From: Cris Di Sclafani Date: Fri, 7 Aug 2020 08:05:09 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.5.0 X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=5096fd1303529fc90b532ec32a07dd80401808ff;p=motion2.git Built motion from commit (unavailable).|2.5.0 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 167a44f..caa59b9 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.5.0", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

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

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-08-07T07:58:45.107Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index fe5fe9a..7d244f3 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.5.0", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

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

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-08-07T07:58:45.107Z", "url": "http://apidocjs.com", "version": "0.19.0" } } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index e520f18..5384756 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 _0xefd1=['integration','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xefd1,0x1da));var _0x1efd=function(_0x3b431d,_0x1f2de7){_0x3b431d=_0x3b431d-0x0;var _0x569d3e=_0xefd1[_0x3b431d];return _0x569d3e;};'use strict';var Sequelize=require(_0x1efd('0x0'));module[_0x1efd('0x1')]={'name':{'type':Sequelize[_0x1efd('0x2')],'get':function(_0x40e776){return this[_0x1efd('0x3')](_0x1efd('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x1efd('0x5'),_0x1efd('0x6'),_0x1efd('0x7'),_0x1efd('0x8'),_0x1efd('0x9'),_0x1efd('0xa'),_0x1efd('0xb'),'script']],'msg':_0x1efd('0xc')}},'comment':_0x1efd('0xc')},'data1':{'type':Sequelize[_0x1efd('0xd')](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[_0x1efd('0xd')](0x1000),'comment':_0x1efd('0xe')},'data3':{'type':Sequelize[_0x1efd('0xd')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x1efd('0xd')](0x1000)},'data6':{'type':Sequelize[_0x1efd('0xd')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3df4=['jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','getDataValue','action','STRING','motionbar'];(function(_0x177753,_0x27f5ac){var _0x4b2095=function(_0x412c4b){while(--_0x412c4b){_0x177753['push'](_0x177753['shift']());}};_0x4b2095(++_0x27f5ac);}(_0x3df4,0x181));var _0x43df=function(_0x2d45f8,_0x563602){_0x2d45f8=_0x2d45f8-0x0;var _0x29b107=_0x3df4[_0x2d45f8];return _0x29b107;};'use strict';var Sequelize=require(_0x43df('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x526615){return this[_0x43df('0x1')](_0x43df('0x2'));}},'action':{'type':Sequelize[_0x43df('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x43df('0x4'),_0x43df('0x5'),'urlForward',_0x43df('0x6'),'bot',_0x43df('0x7')]],'msg':_0x43df('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x43df('0x3')](0x1000),'comment':_0x43df('0x9')},'data2':{'type':Sequelize[_0x43df('0x3')](0x1000),'comment':_0x43df('0xa')},'data3':{'type':Sequelize[_0x43df('0x3')](0x1000),'comment':_0x43df('0xb')},'data4':{'type':Sequelize[_0x43df('0x3')](0x1000)},'data5':{'type':Sequelize[_0x43df('0x3')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x43df('0xc')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 8e2ae0d..d8f5e78 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 _0x2d26=['params','destroy','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','reject','save','update','then','end','error','stack','name','send','body','Action','find'];(function(_0x3f4683,_0x4062f9){var _0x1a80aa=function(_0x5dea92){while(--_0x5dea92){_0x3f4683['push'](_0x3f4683['shift']());}};_0x1a80aa(++_0x4062f9);}(_0x2d26,0x65));var _0x62d2=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x2d26[_0x424a9a];return _0xa7831c;};'use strict';var pdf=require(_0x62d2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x62d2('0x1'));var zipdir=require(_0x62d2('0x2'));var jsonpatch=require(_0x62d2('0x3'));var rp=require('request-promise');var moment=require(_0x62d2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x62d2('0x5'));var util=require(_0x62d2('0x6'));var path=require(_0x62d2('0x7'));var sox=require(_0x62d2('0x8'));var csv=require(_0x62d2('0x9'));var ejs=require(_0x62d2('0xa'));var fs=require('fs');var _=require(_0x62d2('0xb'));var squel=require(_0x62d2('0xc'));var crypto=require(_0x62d2('0xd'));var jsforce=require(_0x62d2('0xe'));var deskjs=require(_0x62d2('0xf'));var toCsv=require(_0x62d2('0x9'));var querystring=require(_0x62d2('0x10'));var Papa=require(_0x62d2('0x11'));var Redis=require(_0x62d2('0x12'));var authService=require(_0x62d2('0x13'));var qs=require(_0x62d2('0x14'));var as=require(_0x62d2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62d2('0x16'))(_0x62d2('0x17'));var utils=require(_0x62d2('0x18'));var config=require(_0x62d2('0x19'));var db=require(_0x62d2('0x1a'))['db'];function respondWithStatusCode(_0x32ce52,_0x2ce34a){_0x2ce34a=_0x2ce34a||0xcc;return function(_0x894c15){if(_0x894c15){return _0x32ce52[_0x62d2('0x1b')](_0x2ce34a);}return _0x32ce52['status'](_0x2ce34a)['end']();};}function respondWithResult(_0x47d284,_0x42b744){_0x42b744=_0x42b744||0xc8;return function(_0x5c18f2){if(_0x5c18f2){return _0x47d284[_0x62d2('0x1c')](_0x42b744)['json'](_0x5c18f2);}};}function respondWithFilteredResult(_0x579ad6,_0x4c7c5e){return function(_0x5d421a){if(_0x5d421a){var _0x1d4513=_0x5d421a['count'],_0x4d5c99=_0x4c7c5e[_0x62d2('0x1d')],_0x163b59=_0x4c7c5e[_0x62d2('0x1d')]+_0x4c7c5e[_0x62d2('0x1e')],_0x10496a;if(_0x163b59>=_0x1d4513){_0x163b59=_0x1d4513;_0x10496a=0xc8;}else{_0x10496a=0xce;}_0x579ad6[_0x62d2('0x1c')](_0x10496a);return _0x579ad6[_0x62d2('0x1f')](_0x62d2('0x20'),_0x4d5c99+'-'+_0x163b59+'/'+_0x1d4513)[_0x62d2('0x21')](_0x5d421a);}return null;};}function patchUpdates(_0x478fd8){return function(_0x15ee44){try{jsonpatch['apply'](_0x15ee44,_0x478fd8,!![]);}catch(_0x26e0c2){return BPromise[_0x62d2('0x22')](_0x26e0c2);}return _0x15ee44[_0x62d2('0x23')]();};}function saveUpdates(_0x540f83,_0x521608){return function(_0x2ea353){if(_0x2ea353){return _0x2ea353[_0x62d2('0x24')](_0x540f83)[_0x62d2('0x25')](function(_0x474c86){return _0x474c86;});}return null;};}function removeEntity(_0x35a6f0,_0x16190f){return function(_0x1f9a85){if(_0x1f9a85){return _0x1f9a85['destroy']()[_0x62d2('0x25')](function(){_0x35a6f0['status'](0xcc)[_0x62d2('0x26')]();});}};}function handleEntityNotFound(_0x23f9ee,_0x191bd8){return function(_0x2ae3b9){if(!_0x2ae3b9){_0x23f9ee[_0x62d2('0x1b')](0x194);}return _0x2ae3b9;};}function handleError(_0x16ac27,_0x2d8411){_0x2d8411=_0x2d8411||0x1f4;return function(_0x233133){logger[_0x62d2('0x27')](_0x233133[_0x62d2('0x28')]);if(_0x233133['name']){delete _0x233133[_0x62d2('0x29')];}_0x16ac27['status'](_0x2d8411)[_0x62d2('0x2a')](_0x233133);};}exports[_0x62d2('0x24')]=function(_0x2a57b8,_0x25bc4f){if(_0x2a57b8[_0x62d2('0x2b')]['id']){delete _0x2a57b8[_0x62d2('0x2b')]['id'];}return db[_0x62d2('0x2c')][_0x62d2('0x2d')]({'where':{'id':_0x2a57b8[_0x62d2('0x2e')]['id']}})[_0x62d2('0x25')](handleEntityNotFound(_0x25bc4f,null))['then'](saveUpdates(_0x2a57b8[_0x62d2('0x2b')],null))[_0x62d2('0x25')](respondWithResult(_0x25bc4f,null))['catch'](handleError(_0x25bc4f,null));};exports[_0x62d2('0x2f')]=function(_0x5c15a2,_0x4c08b4){return db[_0x62d2('0x2c')][_0x62d2('0x2d')]({'where':{'id':_0x5c15a2['params']['id']}})[_0x62d2('0x25')](handleEntityNotFound(_0x4c08b4,null))[_0x62d2('0x25')](removeEntity(_0x4c08b4,null))[_0x62d2('0x30')](handleError(_0x4c08b4,null));}; \ No newline at end of file +var _0x6bdb=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','apply','save','update','then','destroy','error','name','send','body','Action','params','catch','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6bdb,0x105));var _0xb6bd=function(_0x3c353c,_0x42e2bd){_0x3c353c=_0x3c353c-0x0;var _0x4441be=_0x6bdb[_0x3c353c];return _0x4441be;};'use strict';var pdf=require(_0xb6bd('0x0'));var emlformat=require(_0xb6bd('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb6bd('0x2'));var rp=require('request-promise');var moment=require(_0xb6bd('0x3'));var BPromise=require(_0xb6bd('0x4'));var Mustache=require(_0xb6bd('0x5'));var util=require(_0xb6bd('0x6'));var path=require(_0xb6bd('0x7'));var sox=require('sox');var csv=require(_0xb6bd('0x8'));var ejs=require(_0xb6bd('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb6bd('0xa'));var jsforce=require(_0xb6bd('0xb'));var deskjs=require(_0xb6bd('0xc'));var toCsv=require(_0xb6bd('0x8'));var querystring=require(_0xb6bd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb6bd('0xe'));var as=require(_0xb6bd('0xf'));var hardwareService=require(_0xb6bd('0x10'));var logger=require(_0xb6bd('0x11'))(_0xb6bd('0x12'));var utils=require(_0xb6bd('0x13'));var config=require(_0xb6bd('0x14'));var db=require(_0xb6bd('0x15'))['db'];function respondWithStatusCode(_0xc49fa9,_0x1e9731){_0x1e9731=_0x1e9731||0xcc;return function(_0x1dda84){if(_0x1dda84){return _0xc49fa9[_0xb6bd('0x16')](_0x1e9731);}return _0xc49fa9[_0xb6bd('0x17')](_0x1e9731)[_0xb6bd('0x18')]();};}function respondWithResult(_0x3b6540,_0x3a408d){_0x3a408d=_0x3a408d||0xc8;return function(_0x4e0ef7){if(_0x4e0ef7){return _0x3b6540[_0xb6bd('0x17')](_0x3a408d)['json'](_0x4e0ef7);}};}function respondWithFilteredResult(_0x517124,_0x504b23){return function(_0x29c9b0){if(_0x29c9b0){var _0xb8ca83=_0x29c9b0['count'],_0x5c0522=_0x504b23[_0xb6bd('0x19')],_0x361b4d=_0x504b23['offset']+_0x504b23[_0xb6bd('0x1a')],_0x509965;if(_0x361b4d>=_0xb8ca83){_0x361b4d=_0xb8ca83;_0x509965=0xc8;}else{_0x509965=0xce;}_0x517124[_0xb6bd('0x17')](_0x509965);return _0x517124[_0xb6bd('0x1b')]('Content-Range',_0x5c0522+'-'+_0x361b4d+'/'+_0xb8ca83)['json'](_0x29c9b0);}return null;};}function patchUpdates(_0x52a276){return function(_0x47cc2e){try{jsonpatch[_0xb6bd('0x1c')](_0x47cc2e,_0x52a276,!![]);}catch(_0x289790){return BPromise['reject'](_0x289790);}return _0x47cc2e[_0xb6bd('0x1d')]();};}function saveUpdates(_0x284d40,_0x16bba5){return function(_0x595e38){if(_0x595e38){return _0x595e38[_0xb6bd('0x1e')](_0x284d40)[_0xb6bd('0x1f')](function(_0x238da1){return _0x238da1;});}return null;};}function removeEntity(_0x26d36e,_0x4cb790){return function(_0x57adca){if(_0x57adca){return _0x57adca[_0xb6bd('0x20')]()['then'](function(){_0x26d36e[_0xb6bd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2923df,_0x58aa78){return function(_0x5a9d41){if(!_0x5a9d41){_0x2923df[_0xb6bd('0x16')](0x194);}return _0x5a9d41;};}function handleError(_0xeb556b,_0x15c468){_0x15c468=_0x15c468||0x1f4;return function(_0xd46251){logger[_0xb6bd('0x21')](_0xd46251['stack']);if(_0xd46251[_0xb6bd('0x22')]){delete _0xd46251[_0xb6bd('0x22')];}_0xeb556b[_0xb6bd('0x17')](_0x15c468)[_0xb6bd('0x23')](_0xd46251);};}exports[_0xb6bd('0x1e')]=function(_0x2d87d9,_0x210330){if(_0x2d87d9[_0xb6bd('0x24')]['id']){delete _0x2d87d9[_0xb6bd('0x24')]['id'];}return db[_0xb6bd('0x25')]['find']({'where':{'id':_0x2d87d9[_0xb6bd('0x26')]['id']}})[_0xb6bd('0x1f')](handleEntityNotFound(_0x210330,null))[_0xb6bd('0x1f')](saveUpdates(_0x2d87d9[_0xb6bd('0x24')],null))['then'](respondWithResult(_0x210330,null))[_0xb6bd('0x27')](handleError(_0x210330,null));};exports[_0xb6bd('0x20')]=function(_0x37cfb1,_0x380919){return db[_0xb6bd('0x25')]['find']({'where':{'id':_0x37cfb1[_0xb6bd('0x26')]['id']}})[_0xb6bd('0x1f')](handleEntityNotFound(_0x380919,null))[_0xb6bd('0x1f')](removeEntity(_0x380919,null))['catch'](handleError(_0x380919,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 2e562f9..1c0358e 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 _0x07a4=['../../config/logger','moment','bluebird','request-promise','./action.attributes','exports','Action','tools_actions','lodash'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x07a4,0x1dc));var _0x407a=function(_0x2903bc,_0x7a9f1d){_0x2903bc=_0x2903bc-0x0;var _0x2f2a6a=_0x07a4[_0x2903bc];return _0x2f2a6a;};'use strict';var _=require(_0x407a('0x0'));var util=require('util');var logger=require(_0x407a('0x1'))('api');var moment=require(_0x407a('0x2'));var BPromise=require(_0x407a('0x3'));var rp=require(_0x407a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x407a('0x5'));module[_0x407a('0x6')]=function(_0x478dad,_0x41f26a){return _0x478dad['define'](_0x407a('0x7'),attributes,{'tableName':_0x407a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x498d=['moment','path','rimraf','../../config/environment','./action.attributes','exports','tools_actions','lodash','util','../../config/logger','api'];(function(_0x50d8da,_0xe56e5b){var _0x1b55bb=function(_0x5c15eb){while(--_0x5c15eb){_0x50d8da['push'](_0x50d8da['shift']());}};_0x1b55bb(++_0xe56e5b);}(_0x498d,0x6a));var _0xd498=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0x498d[_0x38841c];return _0x500610;};'use strict';var _=require(_0xd498('0x0'));var util=require(_0xd498('0x1'));var logger=require(_0xd498('0x2'))(_0xd498('0x3'));var moment=require(_0xd498('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd498('0x5'));var rimraf=require(_0xd498('0x6'));var config=require(_0xd498('0x7'));var attributes=require(_0xd498('0x8'));module[_0xd498('0x9')]=function(_0x2f6d58,_0x2ed850){return _0x2f6d58['define']('Action',attributes,{'tableName':_0xd498('0xa'),'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 31a5a9c..3ab68fd 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4354ed,_0x5caf1b){var _0x352cd0=function(_0x2aa9c2){while(--_0x2aa9c2){_0x4354ed['push'](_0x4354ed['shift']());}};_0x352cd0(++_0x5caf1b);}(_0xe706,0xa3));var _0x6e70=function(_0x1dacd4,_0x4259f7){_0x1dacd4=_0x1dacd4-0x0;var _0x5c29c5=_0xe706[_0x1dacd4];return _0x5c29c5;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('Action,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('Action,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xb7e7=['Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x5fbdef,_0x267f28){var _0x263e4c=function(_0x5e49f4){while(--_0x5e49f4){_0x5fbdef['push'](_0x5fbdef['shift']());}};_0x263e4c(++_0x267f28);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb7e7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('Action,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 0ff305c..7a498ea 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 _0x8ada=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','multer','util','path','express'];(function(_0x46e978,_0x3eef67){var _0x4d03c5=function(_0x387626){while(--_0x387626){_0x46e978['push'](_0x46e978['shift']());}};_0x4d03c5(++_0x3eef67);}(_0x8ada,0x17c));var _0xa8ad=function(_0x135e73,_0x53d25e){_0x135e73=_0x135e73-0x0;var _0x207d86=_0x8ada[_0x135e73];return _0x207d86;};'use strict';var multer=require(_0xa8ad('0x0'));var util=require(_0xa8ad('0x1'));var path=require(_0xa8ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8ad('0x3'));var router=express[_0xa8ad('0x4')]();var auth=require(_0xa8ad('0x5'));var interaction=require(_0xa8ad('0x6'));var config=require(_0xa8ad('0x7'));var controller=require(_0xa8ad('0x8'));router[_0xa8ad('0x9')]('/:id',auth[_0xa8ad('0xa')](),controller[_0xa8ad('0xb')]);router['delete']('/:id',auth[_0xa8ad('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x34ef=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','update','delete','/:id','multer'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0x34ef,0x144));var _0xf34e=function(_0x5d89e5,_0x10fe83){_0x5d89e5=_0x5d89e5-0x0;var _0x2c4ab5=_0x34ef[_0x5d89e5];return _0x2c4ab5;};'use strict';var multer=require(_0xf34e('0x0'));var util=require(_0xf34e('0x1'));var path=require('path');var timeout=require(_0xf34e('0x2'));var express=require(_0xf34e('0x3'));var router=express[_0xf34e('0x4')]();var auth=require(_0xf34e('0x5'));var interaction=require(_0xf34e('0x6'));var config=require(_0xf34e('0x7'));var controller=require(_0xf34e('0x8'));router[_0xf34e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf34e('0xa')]);router[_0xf34e('0xb')](_0xf34e('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 7e4839d..0ea1095 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 _0xc335=['sequelize','exports','STRING'];(function(_0x33d7d2,_0x3e9a91){var _0x1dca97=function(_0x5b6a93){while(--_0x5b6a93){_0x33d7d2['push'](_0x33d7d2['shift']());}};_0x1dca97(++_0x3e9a91);}(_0xc335,0x1bc));var _0x5c33=function(_0x5a13ef,_0x2bf6ed){_0x5a13ef=_0x5a13ef-0x0;var _0x292370=_0xc335[_0x5a13ef];return _0x292370;};'use strict';var Sequelize=require(_0x5c33('0x0'));module[_0x5c33('0x1')]={'name':{'type':Sequelize[_0x5c33('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5c33('0x2')]},'parent':{'type':Sequelize[_0x5c33('0x2')]},'table':{'type':Sequelize[_0x5c33('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xab8e=['STRING','TEXT','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xab8e,0x1dc));var _0xeab8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xab8e[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xeab8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xeab8('0x1')]},'table':{'type':Sequelize[_0xeab8('0x1')]},'conditions':{'type':Sequelize[_0xeab8('0x2')]},'joins':{'type':Sequelize[_0xeab8('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 1b6c0b5..38c617f 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 _0x4089=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','cross_join','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','AnalyticMetric','metric','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','savename','countTable','COUNT(*)','run','runReport','html-pdf','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','reject','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x405385,_0x56f573){var _0x43837b=function(_0x30e20e){while(--_0x30e20e){_0x405385['push'](_0x405385['shift']());}};_0x43837b(++_0x56f573);}(_0x4089,0x1bf));var _0x9408=function(_0xd1a19f,_0x47aad1){_0xd1a19f=_0xd1a19f-0x0;var _0x443c19=_0x4089[_0xd1a19f];return _0x443c19;};'use strict';var pdf=require(_0x9408('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9408('0x1'));var zipdir=require(_0x9408('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9408('0x3'));var moment=require(_0x9408('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9408('0x5'));var path=require(_0x9408('0x6'));var sox=require(_0x9408('0x7'));var csv=require('to-csv');var ejs=require(_0x9408('0x8'));var fs=require('fs');var _=require(_0x9408('0x9'));var squel=require('squel');var crypto=require(_0x9408('0xa'));var jsforce=require(_0x9408('0xb'));var deskjs=require(_0x9408('0xc'));var toCsv=require(_0x9408('0xd'));var querystring=require(_0x9408('0xe'));var Papa=require(_0x9408('0xf'));var Redis=require(_0x9408('0x10'));var authService=require(_0x9408('0x11'));var qs=require(_0x9408('0x12'));var as=require(_0x9408('0x13'));var hardwareService=require(_0x9408('0x14'));var logger=require(_0x9408('0x15'))('api');var utils=require(_0x9408('0x16'));var config=require(_0x9408('0x17'));var db=require(_0x9408('0x18'))['db'];function respondWithStatusCode(_0x46477e,_0x21d034){_0x21d034=_0x21d034||0xcc;return function(_0x4f78d2){if(_0x4f78d2){return _0x46477e['sendStatus'](_0x21d034);}return _0x46477e[_0x9408('0x19')](_0x21d034)[_0x9408('0x1a')]();};}function respondWithResult(_0x2374e2,_0x40b4d1){_0x40b4d1=_0x40b4d1||0xc8;return function(_0x272ef5){if(_0x272ef5){return _0x2374e2[_0x9408('0x19')](_0x40b4d1)['json'](_0x272ef5);}};}function respondWithFilteredResult(_0x3e3f3f,_0x2d932e){return function(_0x2b06a3){if(_0x2b06a3){var _0x2e6935=_0x2b06a3[_0x9408('0x1b')],_0x5443b8=_0x2d932e[_0x9408('0x1c')],_0x2020a4=_0x2d932e[_0x9408('0x1c')]+_0x2d932e[_0x9408('0x1d')],_0x2de4a0;if(_0x2020a4>=_0x2e6935){_0x2020a4=_0x2e6935;_0x2de4a0=0xc8;}else{_0x2de4a0=0xce;}_0x3e3f3f['status'](_0x2de4a0);return _0x3e3f3f['set'](_0x9408('0x1e'),_0x5443b8+'-'+_0x2020a4+'/'+_0x2e6935)['json'](_0x2b06a3);}return null;};}function patchUpdates(_0x3b5d0e){return function(_0x3af900){try{jsonpatch['apply'](_0x3af900,_0x3b5d0e,!![]);}catch(_0x3aed34){return BPromise[_0x9408('0x1f')](_0x3aed34);}return _0x3af900[_0x9408('0x20')]();};}function saveUpdates(_0x3cfab7,_0x2fb556){return function(_0x560770){if(_0x560770){return _0x560770[_0x9408('0x21')](_0x3cfab7)[_0x9408('0x22')](function(_0x3795ee){return _0x3795ee;});}return null;};}function removeEntity(_0x2130e6,_0x361549){return function(_0xc53029){if(_0xc53029){return _0xc53029[_0x9408('0x23')]()[_0x9408('0x22')](function(){var _0x3bfe93=_0xc53029['get']({'plain':!![]});var _0x1c05ee=_0x9408('0x24');return db[_0x9408('0x25')]['destroy']({'where':{'type':_0x1c05ee,'resourceId':_0x3bfe93['id']}})['then'](function(){return _0xc53029;});})['then'](function(){_0x2130e6[_0x9408('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2538d4,_0x49830f){return function(_0x2370c2){if(!_0x2370c2){_0x2538d4[_0x9408('0x26')](0x194);}return _0x2370c2;};}function handleError(_0x43f68a,_0x40b395){_0x40b395=_0x40b395||0x1f4;return function(_0x4ab16b){logger[_0x9408('0x27')](_0x4ab16b['stack']);if(_0x4ab16b[_0x9408('0x28')]){delete _0x4ab16b['name'];}_0x43f68a[_0x9408('0x19')](_0x40b395)[_0x9408('0x29')](_0x4ab16b);};}exports[_0x9408('0x2a')]=function(_0x4884c4,_0x47a827){var _0x5410d6={},_0x268b5c={},_0x5165ed={'count':0x0,'rows':[]};var _0x4f7490=_[_0x9408('0x2b')](db[_0x9408('0x2c')][_0x9408('0x2d')],function(_0x4c8eb9){return{'name':_0x4c8eb9[_0x9408('0x2e')],'type':_0x4c8eb9['type'][_0x9408('0x2f')]};});_0x268b5c[_0x9408('0x30')]=_[_0x9408('0x2b')](_0x4f7490,_0x9408('0x28'));_0x268b5c[_0x9408('0x31')]=_[_0x9408('0x32')](_0x4884c4[_0x9408('0x31')]);_0x268b5c[_0x9408('0x33')]=_[_0x9408('0x34')](_0x268b5c['model'],_0x268b5c[_0x9408('0x31')]);_0x5410d6[_0x9408('0x35')]=_['intersection'](_0x268b5c['model'],qs[_0x9408('0x36')](_0x4884c4['query'][_0x9408('0x36')]));_0x5410d6[_0x9408('0x35')]=_0x5410d6[_0x9408('0x35')][_0x9408('0x37')]?_0x5410d6[_0x9408('0x35')]:_0x268b5c[_0x9408('0x30')];if(!_0x4884c4[_0x9408('0x31')][_0x9408('0x38')](_0x9408('0x39'))){_0x5410d6[_0x9408('0x1d')]=qs[_0x9408('0x1d')](_0x4884c4['query'][_0x9408('0x1d')]);_0x5410d6[_0x9408('0x1c')]=qs[_0x9408('0x1c')](_0x4884c4[_0x9408('0x31')]['offset']);}_0x5410d6[_0x9408('0x3a')]=qs[_0x9408('0x3b')](_0x4884c4[_0x9408('0x31')][_0x9408('0x3b')]);_0x5410d6['where']=qs[_0x9408('0x33')](_[_0x9408('0x3c')](_0x4884c4[_0x9408('0x31')],_0x268b5c[_0x9408('0x33')]));if(_0x4884c4['query'][_0x9408('0x3d')]){_0x5410d6[_0x9408('0x3e')]=_[_0x9408('0x3f')](_0x5410d6[_0x9408('0x3e')],{'$or':_[_0x9408('0x2b')](_0x4f7490,function(_0x163ad2){if(_0x163ad2['type']!==_0x9408('0x40')){var _0xdc57b7={};_0xdc57b7[_0x163ad2[_0x9408('0x28')]]={'$like':'%'+_0x4884c4[_0x9408('0x31')][_0x9408('0x3d')]+'%'};return _0xdc57b7;}})});}_0x5410d6=_[_0x9408('0x3f')]({},_0x5410d6,_0x4884c4[_0x9408('0x41')]);var _0x2849ae={'where':_0x5410d6['where']};return db[_0x9408('0x2c')][_0x9408('0x1b')](_0x2849ae)[_0x9408('0x22')](function(_0x4533c2){_0x5165ed[_0x9408('0x1b')]=_0x4533c2;if(_0x4884c4['query'][_0x9408('0x42')]){_0x5410d6[_0x9408('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x9408('0x44')](_0x5410d6);})['then'](function(_0x3c4458){_0x5165ed[_0x9408('0x45')]=_0x3c4458;return _0x5165ed;})[_0x9408('0x22')](respondWithFilteredResult(_0x47a827,_0x5410d6))[_0x9408('0x46')](handleError(_0x47a827,null));};exports[_0x9408('0x47')]=function(_0x5c4806,_0x60b0fb){var _0x2afb42={'raw':![],'where':{'id':_0x5c4806[_0x9408('0x48')]['id']}},_0x899aad={};_0x899aad[_0x9408('0x30')]=_[_0x9408('0x32')](db[_0x9408('0x2c')][_0x9408('0x2d')]);_0x899aad[_0x9408('0x31')]=_[_0x9408('0x32')](_0x5c4806[_0x9408('0x31')]);_0x899aad[_0x9408('0x33')]=_[_0x9408('0x34')](_0x899aad[_0x9408('0x30')],_0x899aad['query']);_0x2afb42[_0x9408('0x35')]=_[_0x9408('0x34')](_0x899aad[_0x9408('0x30')],qs[_0x9408('0x36')](_0x5c4806[_0x9408('0x31')][_0x9408('0x36')]));_0x2afb42[_0x9408('0x35')]=_0x2afb42[_0x9408('0x35')][_0x9408('0x37')]?_0x2afb42[_0x9408('0x35')]:_0x899aad[_0x9408('0x30')];if(_0x5c4806[_0x9408('0x31')]['includeAll']){_0x2afb42[_0x9408('0x43')]=[{'all':!![]}];}_0x2afb42=_[_0x9408('0x3f')]({},_0x2afb42,_0x5c4806[_0x9408('0x41')]);return db[_0x9408('0x2c')][_0x9408('0x49')](_0x2afb42)[_0x9408('0x22')](handleEntityNotFound(_0x60b0fb,null))[_0x9408('0x22')](respondWithResult(_0x60b0fb,null))[_0x9408('0x46')](handleError(_0x60b0fb,null));};exports[_0x9408('0x4a')]=function(_0x496d1a,_0x3f35d2){return db[_0x9408('0x2c')][_0x9408('0x4a')](_0x496d1a[_0x9408('0x4b')],{})[_0x9408('0x22')](function(_0x507cb3){var _0x20cc4b=_0x496d1a[_0x9408('0x4c')][_0x9408('0x4d')]({'plain':!![]});if(!_0x20cc4b)throw new Error(_0x9408('0x4e'));if(_0x20cc4b[_0x9408('0x4f')]===_0x9408('0x4c')){var _0x41fe82=_0x507cb3[_0x9408('0x4d')]({'plain':!![]});var _0x5431ab=_0x9408('0x50');return db[_0x9408('0x51')][_0x9408('0x49')]({'where':{'name':_0x5431ab,'userProfileId':_0x20cc4b[_0x9408('0x52')]},'raw':!![]})[_0x9408('0x22')](function(_0x1fb15a){if(_0x1fb15a&&_0x1fb15a[_0x9408('0x53')]===0x0){return db[_0x9408('0x25')][_0x9408('0x4a')]({'name':_0x41fe82[_0x9408('0x28')],'resourceId':_0x41fe82['id'],'type':_0x9408('0x24'),'sectionId':_0x1fb15a['id']},{})[_0x9408('0x22')](function(){return _0x507cb3;});}else{return _0x507cb3;}})['catch'](function(_0x353a06){logger[_0x9408('0x27')](_0x9408('0x54'),_0x353a06);throw _0x353a06;});}return _0x507cb3;})[_0x9408('0x22')](respondWithResult(_0x3f35d2,0xc9))[_0x9408('0x46')](handleError(_0x3f35d2,null));};exports[_0x9408('0x21')]=function(_0x1611b9,_0xf704d1){if(_0x1611b9[_0x9408('0x4b')]['id']){delete _0x1611b9[_0x9408('0x4b')]['id'];}return db[_0x9408('0x2c')]['find']({'where':{'id':_0x1611b9['params']['id']}})[_0x9408('0x22')](handleEntityNotFound(_0xf704d1,null))[_0x9408('0x22')](saveUpdates(_0x1611b9[_0x9408('0x4b')],null))[_0x9408('0x22')](respondWithResult(_0xf704d1,null))['catch'](handleError(_0xf704d1,null));};exports['destroy']=function(_0x3a1223,_0x48f302){return db[_0x9408('0x2c')][_0x9408('0x49')]({'where':{'id':_0x3a1223[_0x9408('0x48')]['id']}})['then'](handleEntityNotFound(_0x48f302,null))[_0x9408('0x22')](removeEntity(_0x48f302,null))[_0x9408('0x46')](handleError(_0x48f302,null));};exports[_0x9408('0x55')]=function(_0x2df29e,_0x105b43){var _0x45f4aa=0xa;var _0x39e017=[_0x9408('0x56'),_0x9408('0x57'),'right_join','cross_join'];var _0x486ac3={'SUM':_0x9408('0x58'),'COUNT':_0x9408('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9408('0x5a'),'MIN':'MIN(%s)','AVG':_0x9408('0x5b'),'GROUP_CONCAT':_0x9408('0x5c'),'GROUP_CONCAT ASC':_0x9408('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x333a5a={'SEC_TO_TIME':_0x9408('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9408('0x5f'),'UNIX_TIMESTAMP':_0x9408('0x60')};var _0x3b3307=function(_0x6c4873){return!_[_0x9408('0x61')]([_0x9408('0x62'),_0x9408('0x63'),_0x9408('0x64'),'IS\x20NOT\x20EMPTY'],_0x6c4873);};var _0x17dc63=function(_0x51657c){if(!_0x51657c||!_0x51657c[_0x9408('0x65')][_0x9408('0x37')]){return'';}for(var _0x50adbc='(',_0x219026=0x0;_0x219026<_0x51657c[_0x9408('0x65')][_0x9408('0x37')];_0x219026+=0x1){_0x219026>0x0&&(_0x50adbc+='\x20'+_0x51657c[_0x9408('0x66')]+'\x20');_0x50adbc+=_0x51657c[_0x9408('0x65')][_0x219026][_0x9408('0x67')]?_0x17dc63(_0x51657c[_0x9408('0x65')][_0x219026][_0x9408('0x67')]):_0x51657c[_0x9408('0x65')][_0x219026][_0x9408('0x68')]+'\x20'+_0x51657c[_0x9408('0x65')][_0x219026]['condition']+(_0x3b3307(_0x51657c[_0x9408('0x65')][_0x219026][_0x9408('0x69')])?'\x20'+_0x51657c[_0x9408('0x65')][_0x219026]['value']:'');}return _0x50adbc+')';};var _0x45bf75={'where':{'id':_0x2df29e['params']['id']}},_0x58f481,_0x3dcee3,_0x174716,_0x543d6d,_0x54f173;_0x45bf75=_['merge']({},_0x45bf75,_0x2df29e[_0x9408('0x41')]);return db[_0x9408('0x2c')][_0x9408('0x49')](_0x45bf75)[_0x9408('0x22')](function(_0xbcf9a7){if(_0xbcf9a7){_0x58f481=_0xbcf9a7;return _0xbcf9a7[_0x9408('0x6a')]();}return null;})['then'](function(_0x240d26){if(_0x240d26){if(!_0x240d26[_0x9408('0x37')]){throw new db[(_0x9408('0x6b'))]['ValidationErrorItem'](_0x9408('0x6c'),0x193);}_0x3dcee3=_0x240d26;return db['AnalyticMetric'][_0x9408('0x44')]({'raw':!![]});}return null;})['then'](function(_0x6206bf){if(_0x6206bf){_0x174716=_[_0x9408('0x6d')](_0x6206bf,'id');var _0x21313b;var _0x56881e=squel[_0x9408('0x6e')]();_0x56881e[_0x9408('0x6f')](_0x58f481['table']);for(var _0x2ff9ce=0x0;_0x2ff9ce<_0x3dcee3[_0x9408('0x37')];_0x2ff9ce+=0x1){_0x21313b=_0x3dcee3[_0x2ff9ce][_0x9408('0x70')]?_0x174716[_0x3dcee3[_0x2ff9ce][_0x9408('0x70')]]['metric']:_0x3dcee3[_0x2ff9ce]['field'];_0x21313b=_0x3dcee3[_0x2ff9ce]['function']?_['replace'](_0x486ac3[_0x3dcee3[_0x2ff9ce][_0x9408('0x71')]],'%s',_0x21313b):_0x21313b;_0x21313b=_0x3dcee3[_0x2ff9ce][_0x9408('0x72')]?_[_0x9408('0x73')](_0x333a5a[_0x3dcee3[_0x2ff9ce][_0x9408('0x72')]],'%s',_0x21313b):_0x21313b;if(_0x3dcee3[_0x2ff9ce][_0x9408('0x74')]){_0x56881e['group'](_0x21313b);}_0x3dcee3[_0x2ff9ce][_0x9408('0x75')]&&_0x56881e['order'](_0x21313b,_0x3dcee3[_0x2ff9ce][_0x9408('0x75')]===_0x9408('0x76')?![]:!![]);_0x56881e['field'](_0x21313b,_0x3dcee3[_0x2ff9ce][_0x9408('0x77')]||_0x21313b);}if(_0x58f481[_0x9408('0x78')]){_0x58f481[_0x9408('0x78')]=JSON[_0x9408('0x79')](_0x58f481[_0x9408('0x78')]);for(var _0x110226=0x0;_0x110226<_0x58f481[_0x9408('0x78')][_0x9408('0x37')];_0x110226+=0x1){if(_0x58f481[_0x9408('0x78')][_0x110226][_0x9408('0x7a')]&&_[_0x9408('0x61')](_0x39e017,_0x58f481[_0x9408('0x78')][_0x110226][_0x9408('0x7a')])&&_0x58f481['joins'][_0x110226][_0x9408('0x7b')]&&_0x58f481[_0x9408('0x78')][_0x110226][_0x9408('0x7c')]&&_0x58f481[_0x9408('0x78')][_0x110226][_0x9408('0x7d')]){_0x56881e[_0x58f481['joins'][_0x110226]['type']](_0x58f481[_0x9408('0x78')][_0x110226][_0x9408('0x7c')],null,util[_0x9408('0x72')](_0x9408('0x7e'),_0x58f481[_0x9408('0x7f')],_0x58f481[_0x9408('0x78')][_0x110226][_0x9408('0x7b')],_0x58f481[_0x9408('0x78')][_0x110226][_0x9408('0x7c')],_0x58f481['joins'][_0x110226][_0x9408('0x7d')]));}}}if(_0x58f481[_0x9408('0x80')]){_0x58f481['conditions']=JSON['parse'](_0x58f481[_0x9408('0x80')]);_0x56881e['where'](_0x17dc63(_0x58f481['conditions'][_0x9408('0x67')]));}_0x54f173=_0x56881e[_0x9408('0x81')]();_0x56881e[_0x9408('0x1d')](_0x45f4aa);_0x56881e['offset'](0x0);logger[_0x9408('0x82')](_0x9408('0x83'),_0x56881e[_0x9408('0x84')]());return db[_0x9408('0x85')][_0x9408('0x31')](_0x56881e[_0x9408('0x84')](),{'type':db[_0x9408('0x85')][_0x9408('0x86')][_0x9408('0x87')]});}})[_0x9408('0x22')](respondWithResult(_0x105b43,null))[_0x9408('0x46')](handleError(_0x105b43,null));};function runReport(_0xe1c0de,_0x5f426f,_0x147aba){var _0x482fdc=_0x5f426f[_0x9408('0x28')];var _0x375fbb=0xa;var _0x586658=[_0x9408('0x56'),_0x9408('0x57'),_0x9408('0x88'),_0x9408('0x89')];var _0x248ef4={'SUM':_0x9408('0x58'),'COUNT':_0x9408('0x59'),'COUNT DISTINCT':_0x9408('0x8a'),'MAX':_0x9408('0x5a'),'MIN':_0x9408('0x8b'),'AVG':_0x9408('0x5b'),'GROUP_CONCAT':_0x9408('0x5c'),'GROUP_CONCAT ASC':_0x9408('0x5d'),'GROUP_CONCAT DESC':_0x9408('0x8c')};var _0x2185d4={'SEC_TO_TIME':_0x9408('0x5e'),'DATE':_0x9408('0x8d'),'HOUR':'HOUR(%s)','ROUND':_0x9408('0x5f'),'UNIX_TIMESTAMP':_0x9408('0x60')};var _0x19c141=function(_0x53b293){return!_['includes'](['IS\x20NULL',_0x9408('0x63'),_0x9408('0x64'),_0x9408('0x8e')],_0x53b293);};var _0x8201a8=function(_0x583c68){if(!_0x583c68||!_0x583c68[_0x9408('0x65')][_0x9408('0x37')]){return'';}for(var _0x1fc501='(',_0x20c615=0x0;_0x20c615<_0x583c68[_0x9408('0x65')]['length'];_0x20c615+=0x1){_0x20c615>0x0&&(_0x1fc501+='\x20'+_0x583c68['operator']+'\x20');_0x1fc501+=_0x583c68['rules'][_0x20c615]['group']?_0x8201a8(_0x583c68[_0x9408('0x65')][_0x20c615][_0x9408('0x67')]):_0x583c68[_0x9408('0x65')][_0x20c615][_0x9408('0x68')]+'\x20'+_0x583c68[_0x9408('0x65')][_0x20c615][_0x9408('0x69')]+(_0x19c141(_0x583c68[_0x9408('0x65')][_0x20c615][_0x9408('0x69')])?'\x20'+_0x583c68[_0x9408('0x65')][_0x20c615][_0x9408('0x8f')]:'');}return _0x1fc501+')';};var _0x56fd02={'where':{'id':_0xe1c0de['id']}},_0x3461be,_0x13620c,_0x27b9ba,_0x448046,_0x575197;_0x56fd02=_[_0x9408('0x3f')]({},_0x56fd02,_0x147aba);return db['AnalyticCustomReport'][_0x9408('0x49')](_0x56fd02)[_0x9408('0x22')](function(_0x607f71){if(_0x607f71){_0x3461be=_0x607f71;return _0x607f71[_0x9408('0x6a')]();}return null;})[_0x9408('0x22')](function(_0x2c40f3){if(_0x2c40f3){if(!_0x2c40f3[_0x9408('0x37')]){throw new db[(_0x9408('0x6b'))][(_0x9408('0x90'))](_0x9408('0x6c'),0x193);}_0x13620c=_0x2c40f3;return db[_0x9408('0x91')][_0x9408('0x44')]({'raw':!![]});}return null;})['then'](function(_0xf0fad6){if(_0xf0fad6){_0x27b9ba=_[_0x9408('0x6d')](_0xf0fad6,'id');var _0x31ce6b;var _0x54c120=squel[_0x9408('0x6e')]();_0x54c120[_0x9408('0x6f')](_0x3461be['table']);for(var _0xbb40c5=0x0;_0xbb40c5<_0x13620c[_0x9408('0x37')];_0xbb40c5+=0x1){_0x31ce6b=_0x13620c[_0xbb40c5][_0x9408('0x70')]?_0x27b9ba[_0x13620c[_0xbb40c5][_0x9408('0x70')]][_0x9408('0x92')]:_0x13620c[_0xbb40c5][_0x9408('0x68')];_0x31ce6b=_0x13620c[_0xbb40c5][_0x9408('0x71')]?_['replace'](_0x248ef4[_0x13620c[_0xbb40c5][_0x9408('0x71')]],'%s',_0x31ce6b):_0x31ce6b;_0x31ce6b=_0x13620c[_0xbb40c5][_0x9408('0x72')]?_[_0x9408('0x73')](_0x2185d4[_0x13620c[_0xbb40c5]['format']],'%s',_0x31ce6b):_0x31ce6b;if(_0x13620c[_0xbb40c5][_0x9408('0x74')]){_0x54c120[_0x9408('0x67')](_0x31ce6b);}_0x13620c[_0xbb40c5][_0x9408('0x75')]&&_0x54c120['order'](_0x31ce6b,_0x13620c[_0xbb40c5]['orderBy']===_0x9408('0x76')?![]:!![]);_0x54c120['field'](_0x31ce6b,_0x13620c[_0xbb40c5][_0x9408('0x77')]||_0x31ce6b);}if(_0x3461be[_0x9408('0x78')]){_0x3461be[_0x9408('0x78')]=JSON[_0x9408('0x79')](_0x3461be[_0x9408('0x78')]);for(var _0x4d0b8d=0x0;_0x4d0b8d<_0x3461be[_0x9408('0x78')][_0x9408('0x37')];_0x4d0b8d+=0x1){if(_0x3461be[_0x9408('0x78')][_0x4d0b8d][_0x9408('0x7a')]&&_['includes'](_0x586658,_0x3461be['joins'][_0x4d0b8d]['type'])&&_0x3461be[_0x9408('0x78')][_0x4d0b8d][_0x9408('0x7b')]&&_0x3461be[_0x9408('0x78')][_0x4d0b8d]['foreignTable']&&_0x3461be[_0x9408('0x78')][_0x4d0b8d][_0x9408('0x7d')]){_0x54c120[_0x3461be[_0x9408('0x78')][_0x4d0b8d]['type']](_0x3461be[_0x9408('0x78')][_0x4d0b8d]['foreignTable'],null,util[_0x9408('0x72')]('%s.%s\x20=\x20%s.%s',_0x3461be[_0x9408('0x7f')],_0x3461be[_0x9408('0x78')][_0x4d0b8d]['parentKey'],_0x3461be['joins'][_0x4d0b8d][_0x9408('0x7c')],_0x3461be[_0x9408('0x78')][_0x4d0b8d][_0x9408('0x7d')]));}}}if(_0x3461be[_0x9408('0x80')]){_0x3461be[_0x9408('0x80')]=JSON[_0x9408('0x79')](_0x3461be[_0x9408('0x80')]);_0x54c120[_0x9408('0x3e')](_0x8201a8(_0x3461be[_0x9408('0x80')][_0x9408('0x67')]));}_0x575197=_0x54c120[_0x9408('0x81')]();_0x54c120[_0x9408('0x1d')](_0x375fbb);_0x54c120[_0x9408('0x1c')](0x0);logger['debug'](_0x9408('0x83'),_0x54c120['toString']());return db[_0x9408('0x85')][_0x9408('0x31')](_0x54c120[_0x9408('0x84')](),{'type':db[_0x9408('0x85')][_0x9408('0x86')][_0x9408('0x87')]});}})[_0x9408('0x22')](function(_0x1d1649){if(!_0x1d1649[_0x9408('0x37')]){throw new db[(_0x9408('0x6b'))][(_0x9408('0x90'))](_0x9408('0x93'),0xcc);}if(_0x5f426f[_0x9408('0x94')]===_0x9408('0x95')){return null;}var _0x23330d=_[_0x9408('0x3f')](_0x5f426f,{'name':_0x5f426f[_0x9408('0x96')]||_0x5f426f[_0x9408('0x28')]||_0x3461be[_0x9408('0x28')],'basename':_0x482fdc,'savename':util[_0x9408('0x72')](_0x9408('0x97'),_0x5f426f[_0x9408('0x28')]||_0x3461be['name'],require(_0x9408('0x98'))['generate'](0x4),_0x5f426f['output']||_0x9408('0x99')),'reportId':_0x3461be['id'],'reportType':_0x9408('0x9a')});return db[_0x9408('0x9b')][_0x9408('0x4a')](_0x23330d,{'raw':!![]});})[_0x9408('0x22')](function(_0x42fc1c){if(_0x3461be['table']===_0x9408('0x9c')){_0x575197[_0x9408('0x3e')](_0x3461be[_0x9408('0x7f')]+_0x9408('0x9d'),_0x5f426f[_0x9408('0x9e')],_0x5f426f[_0x9408('0x9f')]);}else{_0x575197[_0x9408('0x3e')](_0x3461be[_0x9408('0x7f')]+_0x9408('0xa0'),_0x5f426f[_0x9408('0x9e')],_0x5f426f['endDate']);}if(_0x42fc1c){logger[_0x9408('0xa1')](_0x9408('0xa2'),_0x575197[_0x9408('0x84')]());require(_0x9408('0xa3'))[_0x9408('0xa4')](path[_0x9408('0x56')](__dirname,'../../components/export/',_0x42fc1c['output']),[_0x42fc1c['id'],_0x575197[_0x9408('0x84')](),path['join'](__dirname,'../../files/reports',_0x42fc1c[_0x9408('0xa5')]),_0x482fdc]);return _0x42fc1c;}else{var _0x149edf=squel[_0x9408('0x6e')]();_0x149edf[_0x9408('0x6f')]('('+_0x575197[_0x9408('0x84')]()+')',_0x9408('0xa6'));_0x149edf[_0x9408('0x68')](_0x9408('0xa7'),'count');_0x575197[_0x9408('0x1d')](_0x5f426f[_0x9408('0x1d')]||_0x375fbb);_0x575197[_0x9408('0x1c')](_0x5f426f['offset']||0x0);return db['sequelize'][_0x9408('0x31')](_0x149edf['toString'](),{'type':db[_0x9408('0x85')][_0x9408('0x86')][_0x9408('0x87')]})[_0x9408('0x22')](function(_0x24b0af){if(!_0x24b0af['length']){_0x448046=0x0;}else{_0x448046=_0x24b0af[0x0][_0x9408('0x1b')]||0x0;}return db[_0x9408('0x85')][_0x9408('0x31')](_0x575197[_0x9408('0x84')](),{'type':db[_0x9408('0x85')][_0x9408('0x86')][_0x9408('0x87')]});})[_0x9408('0x22')](function(_0x185e26){return{'rows':_0x185e26||[],'count':_0x448046};});}});}exports[_0x9408('0xa8')]=function(_0x2411c2,_0x5ce5e8){return runReport(_0x2411c2[_0x9408('0x48')],_0x2411c2[_0x9408('0x31')],_0x2411c2['options'])['then'](respondWithResult(_0x5ce5e8,null))[_0x9408('0x46')](handleError(_0x5ce5e8,null));};exports[_0x9408('0xa9')]=runReport;exports[_0x9408('0x31')]=function(_0x5bc06c,_0x50c392){var _0x2092e9=0xa;var _0x25b228=[_0x9408('0x56'),_0x9408('0x57'),_0x9408('0x88'),_0x9408('0x89')];var _0x87f041={'SUM':'SUM(%s)','COUNT':_0x9408('0x59'),'COUNT DISTINCT':_0x9408('0x8a'),'MAX':_0x9408('0x5a'),'MIN':_0x9408('0x8b'),'AVG':_0x9408('0x5b'),'GROUP_CONCAT':_0x9408('0x5c'),'GROUP_CONCAT ASC':_0x9408('0x5d'),'GROUP_CONCAT DESC':_0x9408('0x8c')};var _0x109b52={'SEC_TO_TIME':_0x9408('0x5e'),'DATE':_0x9408('0x8d'),'HOUR':'HOUR(%s)','ROUND':_0x9408('0x5f'),'UNIX_TIMESTAMP':_0x9408('0x60')};var _0x5f41a4=function(_0x25b0ad){return!_[_0x9408('0x61')](['IS\x20NULL',_0x9408('0x63'),'IS\x20EMPTY',_0x9408('0x8e')],_0x25b0ad);};var _0x123f6d=function(_0x156f17){if(!_0x156f17||!_0x156f17[_0x9408('0x65')][_0x9408('0x37')]){return'';}for(var _0x2331c5='(',_0x170aa2=0x0;_0x170aa2<_0x156f17[_0x9408('0x65')][_0x9408('0x37')];_0x170aa2+=0x1){_0x170aa2>0x0&&(_0x2331c5+='\x20'+_0x156f17[_0x9408('0x66')]+'\x20');_0x2331c5+=_0x156f17['rules'][_0x170aa2][_0x9408('0x67')]?_0x123f6d(_0x156f17[_0x9408('0x65')][_0x170aa2]['group']):_0x156f17['rules'][_0x170aa2][_0x9408('0x68')]+'\x20'+_0x156f17[_0x9408('0x65')][_0x170aa2][_0x9408('0x69')]+(_0x5f41a4(_0x156f17['rules'][_0x170aa2][_0x9408('0x69')])?'\x20'+_0x156f17['rules'][_0x170aa2][_0x9408('0x8f')]:'');}return _0x2331c5+')';};var _0xb2380c={'where':{'id':_0x5bc06c['params']['id']}},_0x51ab92,_0x487044,_0x2bb06f,_0x214dfb,_0x37d455;_0xb2380c=_[_0x9408('0x3f')]({},_0xb2380c,_0x5bc06c['options']);return db['AnalyticCustomReport'][_0x9408('0x49')](_0xb2380c)[_0x9408('0x22')](function(_0x29c146){if(_0x29c146){_0x51ab92=_0x29c146;return _0x29c146[_0x9408('0x6a')]();}return null;})[_0x9408('0x22')](function(_0x345fc7){if(_0x345fc7){if(!_0x345fc7[_0x9408('0x37')]){throw new db[(_0x9408('0x6b'))][(_0x9408('0x90'))](_0x9408('0x6c'),0x193);}_0x487044=_0x345fc7;return db[_0x9408('0x91')][_0x9408('0x44')]({'raw':!![]});}return null;})[_0x9408('0x22')](function(_0x3983d6){if(_0x3983d6){_0x2bb06f=_['keyBy'](_0x3983d6,'id');var _0x2e57b5;var _0x4fbb07=squel[_0x9408('0x6e')]();_0x4fbb07[_0x9408('0x6f')](_0x51ab92['table']);for(var _0x55123b=0x0;_0x55123b<_0x487044[_0x9408('0x37')];_0x55123b+=0x1){_0x2e57b5=_0x487044[_0x55123b][_0x9408('0x70')]?_0x2bb06f[_0x487044[_0x55123b]['MetricId']][_0x9408('0x92')]:_0x487044[_0x55123b][_0x9408('0x68')];_0x2e57b5=_0x487044[_0x55123b][_0x9408('0x71')]?_[_0x9408('0x73')](_0x87f041[_0x487044[_0x55123b][_0x9408('0x71')]],'%s',_0x2e57b5):_0x2e57b5;_0x2e57b5=_0x487044[_0x55123b][_0x9408('0x72')]?_[_0x9408('0x73')](_0x109b52[_0x487044[_0x55123b][_0x9408('0x72')]],'%s',_0x2e57b5):_0x2e57b5;if(_0x487044[_0x55123b]['groupBy']){_0x4fbb07[_0x9408('0x67')](_0x2e57b5);}_0x487044[_0x55123b][_0x9408('0x75')]&&_0x4fbb07['order'](_0x2e57b5,_0x487044[_0x55123b][_0x9408('0x75')]===_0x9408('0x76')?![]:!![]);_0x4fbb07['field'](_0x2e57b5,_0x487044[_0x55123b][_0x9408('0x77')]||_0x2e57b5);}if(_0x51ab92[_0x9408('0x78')]){_0x51ab92['joins']=JSON[_0x9408('0x79')](_0x51ab92[_0x9408('0x78')]);for(var _0x4bc852=0x0;_0x4bc852<_0x51ab92[_0x9408('0x78')][_0x9408('0x37')];_0x4bc852+=0x1){if(_0x51ab92['joins'][_0x4bc852][_0x9408('0x7a')]&&_[_0x9408('0x61')](_0x25b228,_0x51ab92[_0x9408('0x78')][_0x4bc852]['type'])&&_0x51ab92[_0x9408('0x78')][_0x4bc852][_0x9408('0x7b')]&&_0x51ab92[_0x9408('0x78')][_0x4bc852]['foreignTable']&&_0x51ab92[_0x9408('0x78')][_0x4bc852]['foreignKey']){_0x4fbb07[_0x51ab92[_0x9408('0x78')][_0x4bc852][_0x9408('0x7a')]](_0x51ab92['joins'][_0x4bc852][_0x9408('0x7c')],null,util[_0x9408('0x72')](_0x9408('0x7e'),_0x51ab92[_0x9408('0x7f')],_0x51ab92[_0x9408('0x78')][_0x4bc852][_0x9408('0x7b')],_0x51ab92['joins'][_0x4bc852][_0x9408('0x7c')],_0x51ab92['joins'][_0x4bc852][_0x9408('0x7d')]));}}}if(_0x51ab92[_0x9408('0x80')]){_0x51ab92[_0x9408('0x80')]=JSON[_0x9408('0x79')](_0x51ab92[_0x9408('0x80')]);_0x4fbb07[_0x9408('0x3e')](_0x123f6d(_0x51ab92[_0x9408('0x80')][_0x9408('0x67')]));}_0x37d455=_0x4fbb07[_0x9408('0x81')]();_0x4fbb07[_0x9408('0x1d')](_0x2092e9);_0x4fbb07[_0x9408('0x1c')](0x0);logger[_0x9408('0x82')](_0x9408('0x83'),_0x4fbb07[_0x9408('0x84')]());return db['sequelize'][_0x9408('0x31')](_0x4fbb07[_0x9408('0x84')](),{'type':db[_0x9408('0x85')][_0x9408('0x86')][_0x9408('0x87')]});}})[_0x9408('0x22')](function(){return{'sql':_0x37d455['toString']()};})[_0x9408('0x22')](respondWithResult(_0x50c392,null))[_0x9408('0x46')](handleError(_0x50c392,null));}; \ No newline at end of file +var _0x8163=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','value','Sequelize','keyBy','DESC','SELECT','No\x20available\x20data','web','fullPath','%s-%s.%s','generate','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','output','../../files/reports','savename','COUNT(*)','run','left_join','operator','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x3f90c4,_0x4dde88){var _0x250154=function(_0x96165e){while(--_0x96165e){_0x3f90c4['push'](_0x3f90c4['shift']());}};_0x250154(++_0x4dde88);}(_0x8163,0x9b));var _0x3816=function(_0xdd2dbc,_0x122db8){_0xdd2dbc=_0xdd2dbc-0x0;var _0x3d7f3e=_0x8163[_0xdd2dbc];return _0x3d7f3e;};'use strict';var pdf=require(_0x3816('0x0'));var emlformat=require(_0x3816('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3816('0x2'));var jsonpatch=require(_0x3816('0x3'));var rp=require(_0x3816('0x4'));var moment=require(_0x3816('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3816('0x6'));var path=require(_0x3816('0x7'));var sox=require('sox');var csv=require(_0x3816('0x8'));var ejs=require(_0x3816('0x9'));var fs=require('fs');var _=require(_0x3816('0xa'));var squel=require(_0x3816('0xb'));var crypto=require(_0x3816('0xc'));var jsforce=require(_0x3816('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3816('0xe'));var Papa=require(_0x3816('0xf'));var Redis=require(_0x3816('0x10'));var authService=require(_0x3816('0x11'));var qs=require(_0x3816('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3816('0x13'))(_0x3816('0x14'));var utils=require(_0x3816('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39a5e3,_0x39dfc1){_0x39dfc1=_0x39dfc1||0xcc;return function(_0x5b286a){if(_0x5b286a){return _0x39a5e3[_0x3816('0x16')](_0x39dfc1);}return _0x39a5e3[_0x3816('0x17')](_0x39dfc1)[_0x3816('0x18')]();};}function respondWithResult(_0x51ac49,_0x5567d1){_0x5567d1=_0x5567d1||0xc8;return function(_0x55a40f){if(_0x55a40f){return _0x51ac49['status'](_0x5567d1)[_0x3816('0x19')](_0x55a40f);}};}function respondWithFilteredResult(_0x24ffb5,_0x4fe5b3){return function(_0x1edede){if(_0x1edede){var _0x3125f5=_0x1edede['count'],_0x52393f=_0x4fe5b3[_0x3816('0x1a')],_0x25dc6a=_0x4fe5b3[_0x3816('0x1a')]+_0x4fe5b3['limit'],_0xccd4da;if(_0x25dc6a>=_0x3125f5){_0x25dc6a=_0x3125f5;_0xccd4da=0xc8;}else{_0xccd4da=0xce;}_0x24ffb5[_0x3816('0x17')](_0xccd4da);return _0x24ffb5[_0x3816('0x1b')](_0x3816('0x1c'),_0x52393f+'-'+_0x25dc6a+'/'+_0x3125f5)[_0x3816('0x19')](_0x1edede);}return null;};}function patchUpdates(_0x3c806c){return function(_0x3b298d){try{jsonpatch[_0x3816('0x1d')](_0x3b298d,_0x3c806c,!![]);}catch(_0x59a644){return BPromise[_0x3816('0x1e')](_0x59a644);}return _0x3b298d[_0x3816('0x1f')]();};}function saveUpdates(_0x48940b,_0x127996){return function(_0x7e0da7){if(_0x7e0da7){return _0x7e0da7[_0x3816('0x20')](_0x48940b)[_0x3816('0x21')](function(_0x2d7060){return _0x2d7060;});}return null;};}function removeEntity(_0x1e1795,_0x59af23){return function(_0x2b7c58){if(_0x2b7c58){return _0x2b7c58[_0x3816('0x22')]()['then'](function(){var _0x6559ec=_0x2b7c58[_0x3816('0x23')]({'plain':!![]});var _0x3dd7c9=_0x3816('0x24');return db[_0x3816('0x25')][_0x3816('0x22')]({'where':{'type':_0x3dd7c9,'resourceId':_0x6559ec['id']}})['then'](function(){return _0x2b7c58;});})[_0x3816('0x21')](function(){_0x1e1795[_0x3816('0x17')](0xcc)[_0x3816('0x18')]();});}};}function handleEntityNotFound(_0x4f6747,_0x3d6cb4){return function(_0x133682){if(!_0x133682){_0x4f6747[_0x3816('0x16')](0x194);}return _0x133682;};}function handleError(_0x39f350,_0x128b48){_0x128b48=_0x128b48||0x1f4;return function(_0x3a4e05){logger[_0x3816('0x26')](_0x3a4e05['stack']);if(_0x3a4e05[_0x3816('0x27')]){delete _0x3a4e05['name'];}_0x39f350[_0x3816('0x17')](_0x128b48)['send'](_0x3a4e05);};}exports[_0x3816('0x28')]=function(_0x3ae29d,_0xe9317){var _0x4adff8={},_0x400d42={},_0x13c9a2={'count':0x0,'rows':[]};var _0x48a447=_[_0x3816('0x29')](db[_0x3816('0x2a')][_0x3816('0x2b')],function(_0x18cbe7){return{'name':_0x18cbe7[_0x3816('0x2c')],'type':_0x18cbe7[_0x3816('0x2d')][_0x3816('0x2e')]};});_0x400d42[_0x3816('0x2f')]=_[_0x3816('0x29')](_0x48a447,'name');_0x400d42[_0x3816('0x30')]=_[_0x3816('0x31')](_0x3ae29d[_0x3816('0x30')]);_0x400d42['filters']=_[_0x3816('0x32')](_0x400d42['model'],_0x400d42[_0x3816('0x30')]);_0x4adff8[_0x3816('0x33')]=_[_0x3816('0x32')](_0x400d42[_0x3816('0x2f')],qs[_0x3816('0x34')](_0x3ae29d[_0x3816('0x30')][_0x3816('0x34')]));_0x4adff8[_0x3816('0x33')]=_0x4adff8[_0x3816('0x33')][_0x3816('0x35')]?_0x4adff8[_0x3816('0x33')]:_0x400d42[_0x3816('0x2f')];if(!_0x3ae29d['query'][_0x3816('0x36')]('nolimit')){_0x4adff8[_0x3816('0x37')]=qs[_0x3816('0x37')](_0x3ae29d[_0x3816('0x30')][_0x3816('0x37')]);_0x4adff8[_0x3816('0x1a')]=qs[_0x3816('0x1a')](_0x3ae29d[_0x3816('0x30')][_0x3816('0x1a')]);}_0x4adff8[_0x3816('0x38')]=qs[_0x3816('0x39')](_0x3ae29d['query'][_0x3816('0x39')]);_0x4adff8['where']=qs['filters'](_[_0x3816('0x3a')](_0x3ae29d[_0x3816('0x30')],_0x400d42[_0x3816('0x3b')]));if(_0x3ae29d['query'][_0x3816('0x3c')]){_0x4adff8[_0x3816('0x3d')]=_[_0x3816('0x3e')](_0x4adff8['where'],{'$or':_['map'](_0x48a447,function(_0x4ab3db){if(_0x4ab3db[_0x3816('0x2d')]!==_0x3816('0x3f')){var _0x32184c={};_0x32184c[_0x4ab3db[_0x3816('0x27')]]={'$like':'%'+_0x3ae29d['query'][_0x3816('0x3c')]+'%'};return _0x32184c;}})});}_0x4adff8=_[_0x3816('0x3e')]({},_0x4adff8,_0x3ae29d[_0x3816('0x40')]);var _0x18d6d8={'where':_0x4adff8['where']};return db['AnalyticCustomReport'][_0x3816('0x41')](_0x18d6d8)[_0x3816('0x21')](function(_0x32c8d1){_0x13c9a2[_0x3816('0x41')]=_0x32c8d1;if(_0x3ae29d[_0x3816('0x30')][_0x3816('0x42')]){_0x4adff8[_0x3816('0x43')]=[{'all':!![]}];}return db[_0x3816('0x2a')]['findAll'](_0x4adff8);})[_0x3816('0x21')](function(_0x13e72e){_0x13c9a2[_0x3816('0x44')]=_0x13e72e;return _0x13c9a2;})[_0x3816('0x21')](respondWithFilteredResult(_0xe9317,_0x4adff8))['catch'](handleError(_0xe9317,null));};exports[_0x3816('0x45')]=function(_0x3651ae,_0x266cee){var _0x317d7c={'raw':![],'where':{'id':_0x3651ae[_0x3816('0x46')]['id']}},_0x463969={};_0x463969[_0x3816('0x2f')]=_['keys'](db[_0x3816('0x2a')][_0x3816('0x2b')]);_0x463969[_0x3816('0x30')]=_[_0x3816('0x31')](_0x3651ae[_0x3816('0x30')]);_0x463969[_0x3816('0x3b')]=_[_0x3816('0x32')](_0x463969[_0x3816('0x2f')],_0x463969[_0x3816('0x30')]);_0x317d7c[_0x3816('0x33')]=_[_0x3816('0x32')](_0x463969[_0x3816('0x2f')],qs['fields'](_0x3651ae[_0x3816('0x30')]['fields']));_0x317d7c['attributes']=_0x317d7c[_0x3816('0x33')][_0x3816('0x35')]?_0x317d7c['attributes']:_0x463969['model'];if(_0x3651ae[_0x3816('0x30')][_0x3816('0x42')]){_0x317d7c[_0x3816('0x43')]=[{'all':!![]}];}_0x317d7c=_[_0x3816('0x3e')]({},_0x317d7c,_0x3651ae[_0x3816('0x40')]);return db[_0x3816('0x2a')][_0x3816('0x47')](_0x317d7c)[_0x3816('0x21')](handleEntityNotFound(_0x266cee,null))[_0x3816('0x21')](respondWithResult(_0x266cee,null))[_0x3816('0x48')](handleError(_0x266cee,null));};exports['create']=function(_0x11acff,_0x19d0b6){return db['AnalyticCustomReport'][_0x3816('0x49')](_0x11acff[_0x3816('0x4a')],{})[_0x3816('0x21')](function(_0x2ad5b5){var _0x3557c9=_0x11acff[_0x3816('0x4b')][_0x3816('0x23')]({'plain':!![]});if(!_0x3557c9)throw new Error(_0x3816('0x4c'));if(_0x3557c9[_0x3816('0x4d')]===_0x3816('0x4b')){var _0x43e7c3=_0x2ad5b5['get']({'plain':!![]});var _0x3dec60=_0x3816('0x4e');return db[_0x3816('0x4f')][_0x3816('0x47')]({'where':{'name':_0x3dec60,'userProfileId':_0x3557c9['userProfileId']},'raw':!![]})['then'](function(_0xa050d){if(_0xa050d&&_0xa050d[_0x3816('0x50')]===0x0){return db[_0x3816('0x25')]['create']({'name':_0x43e7c3[_0x3816('0x27')],'resourceId':_0x43e7c3['id'],'type':_0x3816('0x24'),'sectionId':_0xa050d['id']},{})[_0x3816('0x21')](function(){return _0x2ad5b5;});}else{return _0x2ad5b5;}})[_0x3816('0x48')](function(_0x1cfa3c){logger[_0x3816('0x26')](_0x3816('0x51'),_0x1cfa3c);throw _0x1cfa3c;});}return _0x2ad5b5;})['then'](respondWithResult(_0x19d0b6,0xc9))[_0x3816('0x48')](handleError(_0x19d0b6,null));};exports[_0x3816('0x20')]=function(_0x1fa392,_0x527ed6){if(_0x1fa392[_0x3816('0x4a')]['id']){delete _0x1fa392['body']['id'];}return db['AnalyticCustomReport'][_0x3816('0x47')]({'where':{'id':_0x1fa392['params']['id']}})[_0x3816('0x21')](handleEntityNotFound(_0x527ed6,null))[_0x3816('0x21')](saveUpdates(_0x1fa392[_0x3816('0x4a')],null))[_0x3816('0x21')](respondWithResult(_0x527ed6,null))[_0x3816('0x48')](handleError(_0x527ed6,null));};exports[_0x3816('0x22')]=function(_0xe043a4,_0x42ad28){return db[_0x3816('0x2a')]['find']({'where':{'id':_0xe043a4[_0x3816('0x46')]['id']}})['then'](handleEntityNotFound(_0x42ad28,null))['then'](removeEntity(_0x42ad28,null))[_0x3816('0x48')](handleError(_0x42ad28,null));};exports[_0x3816('0x52')]=function(_0x5c8381,_0x5258c7){var _0x23c5bb=0xa;var _0x408f3d=[_0x3816('0x53'),'left_join',_0x3816('0x54'),_0x3816('0x55')];var _0x555653={'SUM':_0x3816('0x56'),'COUNT':_0x3816('0x57'),'COUNT DISTINCT':_0x3816('0x58'),'MAX':_0x3816('0x59'),'MIN':_0x3816('0x5a'),'AVG':_0x3816('0x5b'),'GROUP_CONCAT':_0x3816('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3816('0x5d')};var _0x2fa7d6={'SEC_TO_TIME':_0x3816('0x5e'),'DATE':_0x3816('0x5f'),'HOUR':_0x3816('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3816('0x61')};var _0x2f6a86=function(_0x1ccb46){return!_[_0x3816('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x3816('0x63'),_0x3816('0x64')],_0x1ccb46);};var _0x5be659=function(_0x4bb8f8){if(!_0x4bb8f8||!_0x4bb8f8[_0x3816('0x65')][_0x3816('0x35')]){return'';}for(var _0x4c158c='(',_0x426227=0x0;_0x426227<_0x4bb8f8[_0x3816('0x65')][_0x3816('0x35')];_0x426227+=0x1){_0x426227>0x0&&(_0x4c158c+='\x20'+_0x4bb8f8['operator']+'\x20');_0x4c158c+=_0x4bb8f8[_0x3816('0x65')][_0x426227][_0x3816('0x66')]?_0x5be659(_0x4bb8f8[_0x3816('0x65')][_0x426227][_0x3816('0x66')]):_0x4bb8f8[_0x3816('0x65')][_0x426227]['field']+'\x20'+_0x4bb8f8[_0x3816('0x65')][_0x426227][_0x3816('0x67')]+(_0x2f6a86(_0x4bb8f8[_0x3816('0x65')][_0x426227][_0x3816('0x67')])?'\x20'+_0x4bb8f8['rules'][_0x426227]['value']:'');}return _0x4c158c+')';};var _0x35d39b={'where':{'id':_0x5c8381[_0x3816('0x46')]['id']}},_0x2bdbbf,_0x1b6505,_0x5f2a5b,_0x790014,_0x56bf85;_0x35d39b=_['merge']({},_0x35d39b,_0x5c8381['options']);return db[_0x3816('0x2a')][_0x3816('0x47')](_0x35d39b)[_0x3816('0x21')](function(_0x26988d){if(_0x26988d){_0x2bdbbf=_0x26988d;return _0x26988d[_0x3816('0x68')]();}return null;})[_0x3816('0x21')](function(_0x3dbfc4){if(_0x3dbfc4){if(!_0x3dbfc4[_0x3816('0x35')]){throw new db['Sequelize'][(_0x3816('0x69'))](_0x3816('0x6a'),0x193);}_0x1b6505=_0x3dbfc4;return db[_0x3816('0x6b')][_0x3816('0x6c')]({'raw':!![]});}return null;})[_0x3816('0x21')](function(_0x2d3911){if(_0x2d3911){_0x5f2a5b=_['keyBy'](_0x2d3911,'id');var _0xe4a760;var _0xcf2bc1=squel[_0x3816('0x6d')]();_0xcf2bc1[_0x3816('0x6e')](_0x2bdbbf[_0x3816('0x6f')]);for(var _0x593f84=0x0;_0x593f84<_0x1b6505[_0x3816('0x35')];_0x593f84+=0x1){_0xe4a760=_0x1b6505[_0x593f84][_0x3816('0x70')]?_0x5f2a5b[_0x1b6505[_0x593f84][_0x3816('0x70')]][_0x3816('0x71')]:_0x1b6505[_0x593f84][_0x3816('0x72')];_0xe4a760=_0x1b6505[_0x593f84][_0x3816('0x73')]?_[_0x3816('0x74')](_0x555653[_0x1b6505[_0x593f84][_0x3816('0x73')]],'%s',_0xe4a760):_0xe4a760;_0xe4a760=_0x1b6505[_0x593f84][_0x3816('0x75')]?_['replace'](_0x2fa7d6[_0x1b6505[_0x593f84][_0x3816('0x75')]],'%s',_0xe4a760):_0xe4a760;if(_0x1b6505[_0x593f84][_0x3816('0x76')]){_0xcf2bc1[_0x3816('0x66')](_0xe4a760);}_0x1b6505[_0x593f84][_0x3816('0x77')]&&_0xcf2bc1[_0x3816('0x38')](_0xe4a760,_0x1b6505[_0x593f84]['orderBy']==='DESC'?![]:!![]);_0xcf2bc1[_0x3816('0x72')](_0xe4a760,_0x1b6505[_0x593f84][_0x3816('0x78')]||_0xe4a760);}if(_0x2bdbbf['joins']){_0x2bdbbf[_0x3816('0x79')]=JSON[_0x3816('0x7a')](_0x2bdbbf[_0x3816('0x79')]);for(var _0x5c39d7=0x0;_0x5c39d7<_0x2bdbbf[_0x3816('0x79')][_0x3816('0x35')];_0x5c39d7+=0x1){if(_0x2bdbbf[_0x3816('0x79')][_0x5c39d7][_0x3816('0x2d')]&&_[_0x3816('0x62')](_0x408f3d,_0x2bdbbf[_0x3816('0x79')][_0x5c39d7][_0x3816('0x2d')])&&_0x2bdbbf[_0x3816('0x79')][_0x5c39d7][_0x3816('0x7b')]&&_0x2bdbbf[_0x3816('0x79')][_0x5c39d7][_0x3816('0x7c')]&&_0x2bdbbf['joins'][_0x5c39d7][_0x3816('0x7d')]){_0xcf2bc1[_0x2bdbbf[_0x3816('0x79')][_0x5c39d7][_0x3816('0x2d')]](_0x2bdbbf[_0x3816('0x79')][_0x5c39d7][_0x3816('0x7c')],null,util[_0x3816('0x75')](_0x3816('0x7e'),_0x2bdbbf[_0x3816('0x6f')],_0x2bdbbf[_0x3816('0x79')][_0x5c39d7][_0x3816('0x7b')],_0x2bdbbf[_0x3816('0x79')][_0x5c39d7][_0x3816('0x7c')],_0x2bdbbf[_0x3816('0x79')][_0x5c39d7][_0x3816('0x7d')]));}}}if(_0x2bdbbf[_0x3816('0x7f')]){_0x2bdbbf[_0x3816('0x7f')]=JSON[_0x3816('0x7a')](_0x2bdbbf[_0x3816('0x7f')]);_0xcf2bc1['where'](_0x5be659(_0x2bdbbf[_0x3816('0x7f')][_0x3816('0x66')]));}_0x56bf85=_0xcf2bc1[_0x3816('0x80')]();_0xcf2bc1[_0x3816('0x37')](_0x23c5bb);_0xcf2bc1[_0x3816('0x1a')](0x0);logger[_0x3816('0x81')](_0x3816('0x82'),_0xcf2bc1[_0x3816('0x83')]());return db[_0x3816('0x84')][_0x3816('0x30')](_0xcf2bc1['toString'](),{'type':db[_0x3816('0x84')][_0x3816('0x85')]['SELECT']});}})[_0x3816('0x21')](respondWithResult(_0x5258c7,null))['catch'](handleError(_0x5258c7,null));};function runReport(_0x12c0fb,_0x58b9ab,_0x28659d){var _0x40478d=_0x58b9ab[_0x3816('0x27')];var _0xc7b031=0xa;var _0x3ad8b1=['join','left_join','right_join',_0x3816('0x55')];var _0x5186be={'SUM':_0x3816('0x56'),'COUNT':_0x3816('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3816('0x59'),'MIN':_0x3816('0x5a'),'AVG':_0x3816('0x5b'),'GROUP_CONCAT':_0x3816('0x5c'),'GROUP_CONCAT ASC':_0x3816('0x86'),'GROUP_CONCAT DESC':_0x3816('0x5d')};var _0x4bd589={'SEC_TO_TIME':_0x3816('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x3816('0x87'),'UNIX_TIMESTAMP':_0x3816('0x61')};var _0x2f69cf=function(_0x4b4e68){return!_[_0x3816('0x62')]([_0x3816('0x88'),_0x3816('0x89'),'IS\x20EMPTY',_0x3816('0x64')],_0x4b4e68);};var _0x517cea=function(_0x4292ff){if(!_0x4292ff||!_0x4292ff[_0x3816('0x65')][_0x3816('0x35')]){return'';}for(var _0x566e8d='(',_0x2824f0=0x0;_0x2824f0<_0x4292ff[_0x3816('0x65')]['length'];_0x2824f0+=0x1){_0x2824f0>0x0&&(_0x566e8d+='\x20'+_0x4292ff['operator']+'\x20');_0x566e8d+=_0x4292ff['rules'][_0x2824f0][_0x3816('0x66')]?_0x517cea(_0x4292ff[_0x3816('0x65')][_0x2824f0][_0x3816('0x66')]):_0x4292ff[_0x3816('0x65')][_0x2824f0]['field']+'\x20'+_0x4292ff[_0x3816('0x65')][_0x2824f0][_0x3816('0x67')]+(_0x2f69cf(_0x4292ff[_0x3816('0x65')][_0x2824f0][_0x3816('0x67')])?'\x20'+_0x4292ff[_0x3816('0x65')][_0x2824f0][_0x3816('0x8a')]:'');}return _0x566e8d+')';};var _0x2d88ec={'where':{'id':_0x12c0fb['id']}},_0x1ab9ab,_0x3127bf,_0x535be0,_0x2c6e78,_0x140d1f;_0x2d88ec=_[_0x3816('0x3e')]({},_0x2d88ec,_0x28659d);return db[_0x3816('0x2a')][_0x3816('0x47')](_0x2d88ec)[_0x3816('0x21')](function(_0x1814d8){if(_0x1814d8){_0x1ab9ab=_0x1814d8;return _0x1814d8[_0x3816('0x68')]();}return null;})[_0x3816('0x21')](function(_0x38f4cf){if(_0x38f4cf){if(!_0x38f4cf[_0x3816('0x35')]){throw new db[(_0x3816('0x8b'))][(_0x3816('0x69'))](_0x3816('0x6a'),0x193);}_0x3127bf=_0x38f4cf;return db[_0x3816('0x6b')][_0x3816('0x6c')]({'raw':!![]});}return null;})[_0x3816('0x21')](function(_0x1bf393){if(_0x1bf393){_0x535be0=_[_0x3816('0x8c')](_0x1bf393,'id');var _0x408633;var _0x1c8514=squel[_0x3816('0x6d')]();_0x1c8514[_0x3816('0x6e')](_0x1ab9ab[_0x3816('0x6f')]);for(var _0x54841f=0x0;_0x54841f<_0x3127bf[_0x3816('0x35')];_0x54841f+=0x1){_0x408633=_0x3127bf[_0x54841f][_0x3816('0x70')]?_0x535be0[_0x3127bf[_0x54841f][_0x3816('0x70')]][_0x3816('0x71')]:_0x3127bf[_0x54841f][_0x3816('0x72')];_0x408633=_0x3127bf[_0x54841f]['function']?_[_0x3816('0x74')](_0x5186be[_0x3127bf[_0x54841f]['function']],'%s',_0x408633):_0x408633;_0x408633=_0x3127bf[_0x54841f]['format']?_['replace'](_0x4bd589[_0x3127bf[_0x54841f][_0x3816('0x75')]],'%s',_0x408633):_0x408633;if(_0x3127bf[_0x54841f][_0x3816('0x76')]){_0x1c8514[_0x3816('0x66')](_0x408633);}_0x3127bf[_0x54841f][_0x3816('0x77')]&&_0x1c8514['order'](_0x408633,_0x3127bf[_0x54841f]['orderBy']===_0x3816('0x8d')?![]:!![]);_0x1c8514[_0x3816('0x72')](_0x408633,_0x3127bf[_0x54841f]['alias']||_0x408633);}if(_0x1ab9ab[_0x3816('0x79')]){_0x1ab9ab[_0x3816('0x79')]=JSON[_0x3816('0x7a')](_0x1ab9ab[_0x3816('0x79')]);for(var _0x440cdf=0x0;_0x440cdf<_0x1ab9ab[_0x3816('0x79')]['length'];_0x440cdf+=0x1){if(_0x1ab9ab[_0x3816('0x79')][_0x440cdf]['type']&&_[_0x3816('0x62')](_0x3ad8b1,_0x1ab9ab[_0x3816('0x79')][_0x440cdf]['type'])&&_0x1ab9ab[_0x3816('0x79')][_0x440cdf][_0x3816('0x7b')]&&_0x1ab9ab['joins'][_0x440cdf]['foreignTable']&&_0x1ab9ab[_0x3816('0x79')][_0x440cdf]['foreignKey']){_0x1c8514[_0x1ab9ab['joins'][_0x440cdf][_0x3816('0x2d')]](_0x1ab9ab[_0x3816('0x79')][_0x440cdf][_0x3816('0x7c')],null,util[_0x3816('0x75')](_0x3816('0x7e'),_0x1ab9ab[_0x3816('0x6f')],_0x1ab9ab[_0x3816('0x79')][_0x440cdf][_0x3816('0x7b')],_0x1ab9ab[_0x3816('0x79')][_0x440cdf][_0x3816('0x7c')],_0x1ab9ab['joins'][_0x440cdf][_0x3816('0x7d')]));}}}if(_0x1ab9ab[_0x3816('0x7f')]){_0x1ab9ab[_0x3816('0x7f')]=JSON[_0x3816('0x7a')](_0x1ab9ab[_0x3816('0x7f')]);_0x1c8514[_0x3816('0x3d')](_0x517cea(_0x1ab9ab[_0x3816('0x7f')][_0x3816('0x66')]));}_0x140d1f=_0x1c8514[_0x3816('0x80')]();_0x1c8514['limit'](_0xc7b031);_0x1c8514[_0x3816('0x1a')](0x0);logger[_0x3816('0x81')](_0x3816('0x82'),_0x1c8514[_0x3816('0x83')]());return db[_0x3816('0x84')]['query'](_0x1c8514[_0x3816('0x83')](),{'type':db[_0x3816('0x84')][_0x3816('0x85')][_0x3816('0x8e')]});}})['then'](function(_0x15482c){if(!_0x15482c[_0x3816('0x35')]){throw new db[(_0x3816('0x8b'))][(_0x3816('0x69'))](_0x3816('0x8f'),0xcc);}if(_0x58b9ab['output']===_0x3816('0x90')){return null;}var _0x4c6746=_[_0x3816('0x3e')](_0x58b9ab,{'name':_0x58b9ab[_0x3816('0x91')]||_0x58b9ab['name']||_0x1ab9ab[_0x3816('0x27')],'basename':_0x40478d,'savename':util[_0x3816('0x75')](_0x3816('0x92'),_0x58b9ab[_0x3816('0x27')]||_0x1ab9ab['name'],require('randomstring')[_0x3816('0x93')](0x4),_0x58b9ab['output']||_0x3816('0x94')),'reportId':_0x1ab9ab['id'],'reportType':_0x3816('0x95')});return db['AnalyticExtractedReport'][_0x3816('0x49')](_0x4c6746,{'raw':!![]});})['then'](function(_0x5c51bd){if(_0x1ab9ab['table']==='cdr'){_0x140d1f[_0x3816('0x3d')](_0x1ab9ab[_0x3816('0x6f')]+_0x3816('0x96'),_0x58b9ab[_0x3816('0x97')],_0x58b9ab[_0x3816('0x98')]);}else{_0x140d1f[_0x3816('0x3d')](_0x1ab9ab[_0x3816('0x6f')]+_0x3816('0x99'),_0x58b9ab['startDate'],_0x58b9ab['endDate']);}if(_0x5c51bd){logger[_0x3816('0x9a')]('Run\x20Query:',_0x140d1f['toString']());require(_0x3816('0x9b'))[_0x3816('0x9c')](path[_0x3816('0x53')](__dirname,_0x3816('0x9d'),_0x5c51bd[_0x3816('0x9e')]),[_0x5c51bd['id'],_0x140d1f[_0x3816('0x83')](),path[_0x3816('0x53')](__dirname,_0x3816('0x9f'),_0x5c51bd[_0x3816('0xa0')]),_0x40478d]);return _0x5c51bd;}else{var _0xb6f5eb=squel[_0x3816('0x6d')]();_0xb6f5eb[_0x3816('0x6e')]('('+_0x140d1f[_0x3816('0x83')]()+')','countTable');_0xb6f5eb[_0x3816('0x72')](_0x3816('0xa1'),'count');_0x140d1f[_0x3816('0x37')](_0x58b9ab[_0x3816('0x37')]||_0xc7b031);_0x140d1f[_0x3816('0x1a')](_0x58b9ab[_0x3816('0x1a')]||0x0);return db['sequelize'][_0x3816('0x30')](_0xb6f5eb[_0x3816('0x83')](),{'type':db[_0x3816('0x84')][_0x3816('0x85')][_0x3816('0x8e')]})[_0x3816('0x21')](function(_0x3fe7fc){if(!_0x3fe7fc[_0x3816('0x35')]){_0x2c6e78=0x0;}else{_0x2c6e78=_0x3fe7fc[0x0][_0x3816('0x41')]||0x0;}return db[_0x3816('0x84')][_0x3816('0x30')](_0x140d1f['toString'](),{'type':db[_0x3816('0x84')][_0x3816('0x85')][_0x3816('0x8e')]});})[_0x3816('0x21')](function(_0x5e189e){return{'rows':_0x5e189e||[],'count':_0x2c6e78};});}});}exports[_0x3816('0xa2')]=function(_0x7925ac,_0x334d04){return runReport(_0x7925ac['params'],_0x7925ac[_0x3816('0x30')],_0x7925ac['options'])['then'](respondWithResult(_0x334d04,null))[_0x3816('0x48')](handleError(_0x334d04,null));};exports['runReport']=runReport;exports[_0x3816('0x30')]=function(_0x14f6b9,_0x404ede){var _0xb952a0=0xa;var _0x1c4a58=[_0x3816('0x53'),_0x3816('0xa3'),'right_join','cross_join'];var _0x184fa9={'SUM':_0x3816('0x56'),'COUNT':_0x3816('0x57'),'COUNT DISTINCT':_0x3816('0x58'),'MAX':_0x3816('0x59'),'MIN':_0x3816('0x5a'),'AVG':_0x3816('0x5b'),'GROUP_CONCAT':_0x3816('0x5c'),'GROUP_CONCAT ASC':_0x3816('0x86'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4bbd80={'SEC_TO_TIME':_0x3816('0x5e'),'DATE':_0x3816('0x5f'),'HOUR':_0x3816('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3816('0x61')};var _0x3a2a00=function(_0x47c283){return!_[_0x3816('0x62')](['IS\x20NULL',_0x3816('0x89'),_0x3816('0x63'),_0x3816('0x64')],_0x47c283);};var _0x132d89=function(_0xca9afd){if(!_0xca9afd||!_0xca9afd[_0x3816('0x65')][_0x3816('0x35')]){return'';}for(var _0x357a91='(',_0x580557=0x0;_0x580557<_0xca9afd[_0x3816('0x65')][_0x3816('0x35')];_0x580557+=0x1){_0x580557>0x0&&(_0x357a91+='\x20'+_0xca9afd[_0x3816('0xa4')]+'\x20');_0x357a91+=_0xca9afd['rules'][_0x580557][_0x3816('0x66')]?_0x132d89(_0xca9afd[_0x3816('0x65')][_0x580557][_0x3816('0x66')]):_0xca9afd[_0x3816('0x65')][_0x580557][_0x3816('0x72')]+'\x20'+_0xca9afd[_0x3816('0x65')][_0x580557]['condition']+(_0x3a2a00(_0xca9afd[_0x3816('0x65')][_0x580557]['condition'])?'\x20'+_0xca9afd[_0x3816('0x65')][_0x580557]['value']:'');}return _0x357a91+')';};var _0x38b940={'where':{'id':_0x14f6b9['params']['id']}},_0x1a2fc8,_0x42d2bf,_0x4ae714,_0x243603,_0x55c6a5;_0x38b940=_['merge']({},_0x38b940,_0x14f6b9[_0x3816('0x40')]);return db[_0x3816('0x2a')][_0x3816('0x47')](_0x38b940)[_0x3816('0x21')](function(_0x523ff5){if(_0x523ff5){_0x1a2fc8=_0x523ff5;return _0x523ff5['getFields']();}return null;})[_0x3816('0x21')](function(_0x5627f9){if(_0x5627f9){if(!_0x5627f9['length']){throw new db['Sequelize'][(_0x3816('0x69'))](_0x3816('0x6a'),0x193);}_0x42d2bf=_0x5627f9;return db['AnalyticMetric'][_0x3816('0x6c')]({'raw':!![]});}return null;})[_0x3816('0x21')](function(_0x3b0d38){if(_0x3b0d38){_0x4ae714=_[_0x3816('0x8c')](_0x3b0d38,'id');var _0x20e045;var _0x5e9217=squel[_0x3816('0x6d')]();_0x5e9217[_0x3816('0x6e')](_0x1a2fc8[_0x3816('0x6f')]);for(var _0x2854ac=0x0;_0x2854ac<_0x42d2bf[_0x3816('0x35')];_0x2854ac+=0x1){_0x20e045=_0x42d2bf[_0x2854ac][_0x3816('0x70')]?_0x4ae714[_0x42d2bf[_0x2854ac]['MetricId']]['metric']:_0x42d2bf[_0x2854ac][_0x3816('0x72')];_0x20e045=_0x42d2bf[_0x2854ac][_0x3816('0x73')]?_['replace'](_0x184fa9[_0x42d2bf[_0x2854ac][_0x3816('0x73')]],'%s',_0x20e045):_0x20e045;_0x20e045=_0x42d2bf[_0x2854ac]['format']?_[_0x3816('0x74')](_0x4bbd80[_0x42d2bf[_0x2854ac][_0x3816('0x75')]],'%s',_0x20e045):_0x20e045;if(_0x42d2bf[_0x2854ac][_0x3816('0x76')]){_0x5e9217['group'](_0x20e045);}_0x42d2bf[_0x2854ac][_0x3816('0x77')]&&_0x5e9217[_0x3816('0x38')](_0x20e045,_0x42d2bf[_0x2854ac][_0x3816('0x77')]==='DESC'?![]:!![]);_0x5e9217[_0x3816('0x72')](_0x20e045,_0x42d2bf[_0x2854ac][_0x3816('0x78')]||_0x20e045);}if(_0x1a2fc8[_0x3816('0x79')]){_0x1a2fc8[_0x3816('0x79')]=JSON[_0x3816('0x7a')](_0x1a2fc8['joins']);for(var _0x796179=0x0;_0x796179<_0x1a2fc8['joins'][_0x3816('0x35')];_0x796179+=0x1){if(_0x1a2fc8[_0x3816('0x79')][_0x796179][_0x3816('0x2d')]&&_[_0x3816('0x62')](_0x1c4a58,_0x1a2fc8[_0x3816('0x79')][_0x796179]['type'])&&_0x1a2fc8[_0x3816('0x79')][_0x796179][_0x3816('0x7b')]&&_0x1a2fc8[_0x3816('0x79')][_0x796179][_0x3816('0x7c')]&&_0x1a2fc8[_0x3816('0x79')][_0x796179][_0x3816('0x7d')]){_0x5e9217[_0x1a2fc8[_0x3816('0x79')][_0x796179][_0x3816('0x2d')]](_0x1a2fc8['joins'][_0x796179][_0x3816('0x7c')],null,util['format'](_0x3816('0x7e'),_0x1a2fc8[_0x3816('0x6f')],_0x1a2fc8[_0x3816('0x79')][_0x796179][_0x3816('0x7b')],_0x1a2fc8[_0x3816('0x79')][_0x796179][_0x3816('0x7c')],_0x1a2fc8[_0x3816('0x79')][_0x796179]['foreignKey']));}}}if(_0x1a2fc8[_0x3816('0x7f')]){_0x1a2fc8['conditions']=JSON['parse'](_0x1a2fc8[_0x3816('0x7f')]);_0x5e9217[_0x3816('0x3d')](_0x132d89(_0x1a2fc8[_0x3816('0x7f')][_0x3816('0x66')]));}_0x55c6a5=_0x5e9217[_0x3816('0x80')]();_0x5e9217[_0x3816('0x37')](_0xb952a0);_0x5e9217['offset'](0x0);logger[_0x3816('0x81')](_0x3816('0x82'),_0x5e9217[_0x3816('0x83')]());return db['sequelize'][_0x3816('0x30')](_0x5e9217[_0x3816('0x83')](),{'type':db[_0x3816('0x84')][_0x3816('0x85')][_0x3816('0x8e')]});}})[_0x3816('0x21')](function(){return{'sql':_0x55c6a5['toString']()};})['then'](respondWithResult(_0x404ede,null))[_0x3816('0x48')](handleError(_0x404ede,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 7476ab9..13411d8 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 _0x37aa=['analytics_custom_reports','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x37aa,0x175));var _0xa37a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x37aa[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xa37a('0x0'));var util=require('util');var logger=require(_0xa37a('0x1'))('api');var moment=require(_0xa37a('0x2'));var BPromise=require(_0xa37a('0x3'));var rp=require(_0xa37a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa37a('0x5'));var config=require(_0xa37a('0x6'));var attributes=require(_0xa37a('0x7'));module[_0xa37a('0x8')]=function(_0x219470,_0x492efc){return _0x219470[_0xa37a('0x9')](_0xa37a('0xa'),attributes,{'tableName':_0xa37a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd8=['api','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x59ce45,_0x5160f6){var _0x1649fb=function(_0x2cca8d){while(--_0x2cca8d){_0x59ce45['push'](_0x59ce45['shift']());}};_0x1649fb(++_0x5160f6);}(_0xcdd8,0x69));var _0x8cdd=function(_0x3b1e7b,_0x51641f){_0x3b1e7b=_0x3b1e7b-0x0;var _0x57d855=_0xcdd8[_0x3b1e7b];return _0x57d855;};'use strict';var _=require(_0x8cdd('0x0'));var util=require(_0x8cdd('0x1'));var logger=require(_0x8cdd('0x2'))(_0x8cdd('0x3'));var moment=require('moment');var BPromise=require(_0x8cdd('0x4'));var rp=require(_0x8cdd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8cdd('0x6'));var config=require(_0x8cdd('0x7'));var attributes=require(_0x8cdd('0x8'));module[_0x8cdd('0x9')]=function(_0xdf0a51,_0x4cbb24){return _0xdf0a51['define'](_0x8cdd('0xa'),attributes,{'tableName':_0x8cdd('0xb'),'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 451e08e..b2e6902 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 _0x6d96=['AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x584760,_0x1bf299){var _0x2e7e17=function(_0x1196ea){while(--_0x1196ea){_0x584760['push'](_0x584760['shift']());}};_0x2e7e17(++_0x1bf299);}(_0x6d96,0xef));var _0x66d9=function(_0x188379,_0x7fa345){_0x188379=_0x188379-0x0;var _0x3d8a8f=_0x6d96[_0x188379];return _0x3d8a8f;};'use strict';var _=require(_0x66d9('0x0'));var util=require(_0x66d9('0x1'));var moment=require(_0x66d9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66d9('0x3'));var db=require(_0x66d9('0x4'))['db'];var utils=require(_0x66d9('0x5'));var logger=require(_0x66d9('0x6'))(_0x66d9('0x7'));var config=require(_0x66d9('0x8'));var jayson=require(_0x66d9('0x9'));var client=jayson[_0x66d9('0xa')][_0x66d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x481a93,_0x341ca3,_0x112b3c){return new BPromise(function(_0x35eb04,_0x2876eb){return client[_0x66d9('0xc')](_0x481a93,_0x112b3c)[_0x66d9('0xd')](function(_0x38623c){logger['info'](_0x66d9('0xe'),_0x341ca3,'request\x20sent');logger[_0x66d9('0xf')](_0x66d9('0x10'),_0x341ca3,_0x66d9('0x11'),JSON[_0x66d9('0x12')](_0x38623c));if(_0x38623c[_0x66d9('0x13')]){if(_0x38623c['error']['code']===0x1f4){logger[_0x66d9('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x341ca3,_0x38623c['error'][_0x66d9('0x14')]);return _0x2876eb(_0x38623c[_0x66d9('0x13')]['message']);}logger[_0x66d9('0x13')](_0x66d9('0xe'),_0x341ca3,_0x38623c[_0x66d9('0x13')][_0x66d9('0x14')]);return _0x35eb04(_0x38623c[_0x66d9('0x13')][_0x66d9('0x14')]);}else{logger[_0x66d9('0x15')](_0x66d9('0xe'),_0x341ca3,_0x66d9('0x11'));_0x35eb04(_0x38623c[_0x66d9('0x16')][_0x66d9('0x14')]);}})['catch'](function(_0x4d3199){logger[_0x66d9('0x13')](_0x66d9('0xe'),_0x341ca3,_0x4d3199);_0x2876eb(_0x4d3199);});});} \ No newline at end of file +var _0xc6cc=['request','info','request\x20sent','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0xc6cc,0xda));var _0xcc6c=function(_0x24eb1a,_0x2754ae){_0x24eb1a=_0x24eb1a-0x0;var _0x44d750=_0xc6cc[_0x24eb1a];return _0x44d750;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc6c('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc6c('0x1'))['db'];var utils=require(_0xcc6c('0x2'));var logger=require('../../config/logger')(_0xcc6c('0x3'));var config=require('../../config/environment');var jayson=require(_0xcc6c('0x4'));var client=jayson[_0xcc6c('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38eec9,_0x47dd8c,_0xf2e60f){return new BPromise(function(_0xcdd5ab,_0x176b72){return client[_0xcc6c('0x6')](_0x38eec9,_0xf2e60f)['then'](function(_0x42ff9a){logger[_0xcc6c('0x7')]('AnalyticCustomReport,\x20%s,\x20%s',_0x47dd8c,_0xcc6c('0x8'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x47dd8c,'request\x20sent',JSON[_0xcc6c('0x9')](_0x42ff9a));if(_0x42ff9a[_0xcc6c('0xa')]){if(_0x42ff9a['error'][_0xcc6c('0xb')]===0x1f4){logger['error'](_0xcc6c('0xc'),_0x47dd8c,_0x42ff9a[_0xcc6c('0xa')][_0xcc6c('0xd')]);return _0x176b72(_0x42ff9a[_0xcc6c('0xa')][_0xcc6c('0xd')]);}logger[_0xcc6c('0xa')](_0xcc6c('0xc'),_0x47dd8c,_0x42ff9a[_0xcc6c('0xa')][_0xcc6c('0xd')]);return _0xcdd5ab(_0x42ff9a[_0xcc6c('0xa')][_0xcc6c('0xd')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x47dd8c,'request\x20sent');_0xcdd5ab(_0x42ff9a[_0xcc6c('0xe')][_0xcc6c('0xd')]);}})[_0xcc6c('0xf')](function(_0x5f1879){logger[_0xcc6c('0xa')](_0xcc6c('0xc'),_0x47dd8c,_0x5f1879);_0x176b72(_0x5f1879);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index c141f5f..f3baf42 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 _0x6d9d=['post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','show','get','/:id/preview','preview','/:id/run','run','/:id/query','query'];(function(_0x205951,_0x4ff892){var _0x1c2383=function(_0x30c01f){while(--_0x30c01f){_0x205951['push'](_0x205951['shift']());}};_0x1c2383(++_0x4ff892);}(_0x6d9d,0x100));var _0xd6d9=function(_0x23e3a6,_0x160687){_0x23e3a6=_0x23e3a6-0x0;var _0x3330c=_0x6d9d[_0x23e3a6];return _0x3330c;};'use strict';var multer=require(_0xd6d9('0x0'));var util=require(_0xd6d9('0x1'));var path=require(_0xd6d9('0x2'));var timeout=require(_0xd6d9('0x3'));var express=require(_0xd6d9('0x4'));var router=express[_0xd6d9('0x5')]();var auth=require(_0xd6d9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd6d9('0x7'));var controller=require(_0xd6d9('0x8'));router['get']('/',auth[_0xd6d9('0x9')](),controller[_0xd6d9('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd6d9('0xb')]);router[_0xd6d9('0xc')](_0xd6d9('0xd'),auth[_0xd6d9('0x9')](),controller[_0xd6d9('0xe')]);router[_0xd6d9('0xc')](_0xd6d9('0xf'),auth[_0xd6d9('0x9')](),controller[_0xd6d9('0x10')]);router[_0xd6d9('0xc')](_0xd6d9('0x11'),auth[_0xd6d9('0x9')](),controller[_0xd6d9('0x12')]);router[_0xd6d9('0x13')]('/',auth['isAuthenticated'](),controller[_0xd6d9('0x14')]);router[_0xd6d9('0x15')](_0xd6d9('0x16'),auth[_0xd6d9('0x9')](),controller[_0xd6d9('0x17')]);router['delete'](_0xd6d9('0x16'),auth[_0xd6d9('0x9')](),controller[_0xd6d9('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9adc=['query','post','put','update','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query'];(function(_0x199ae2,_0x345c6b){var _0x8dce97=function(_0x551f57){while(--_0x551f57){_0x199ae2['push'](_0x199ae2['shift']());}};_0x8dce97(++_0x345c6b);}(_0x9adc,0x191));var _0xc9ad=function(_0x5ec4be,_0x590f56){_0x5ec4be=_0x5ec4be-0x0;var _0x445547=_0x9adc[_0x5ec4be];return _0x445547;};'use strict';var multer=require(_0xc9ad('0x0'));var util=require(_0xc9ad('0x1'));var path=require(_0xc9ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xc9ad('0x3'));var router=express['Router']();var auth=require(_0xc9ad('0x4'));var interaction=require(_0xc9ad('0x5'));var config=require(_0xc9ad('0x6'));var controller=require(_0xc9ad('0x7'));router[_0xc9ad('0x8')]('/',auth['isAuthenticated'](),controller[_0xc9ad('0x9')]);router[_0xc9ad('0x8')](_0xc9ad('0xa'),auth[_0xc9ad('0xb')](),controller[_0xc9ad('0xc')]);router[_0xc9ad('0x8')](_0xc9ad('0xd'),auth[_0xc9ad('0xb')](),controller['preview']);router['get'](_0xc9ad('0xe'),auth[_0xc9ad('0xb')](),controller[_0xc9ad('0xf')]);router[_0xc9ad('0x8')](_0xc9ad('0x10'),auth[_0xc9ad('0xb')](),controller[_0xc9ad('0x11')]);router[_0xc9ad('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc9ad('0x13')](_0xc9ad('0xa'),auth[_0xc9ad('0xb')](),controller[_0xc9ad('0x14')]);router['delete'](_0xc9ad('0xa'),auth['isAuthenticated'](),controller[_0xc9ad('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 92732a1..da3b274 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 _0x42b9=['STRING','TEXT','sequelize'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x42b9,0x101));var _0x942b=function(_0x586388,_0x279bdf){_0x586388=_0x586388-0x0;var _0x39a4b7=_0x42b9[_0x586388];return _0x39a4b7;};'use strict';var Sequelize=require(_0x942b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x942b('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x942b('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x942b('0x2')]}}; \ No newline at end of file +var _0x7047=['TEXT','sequelize','exports','STRING'];(function(_0x38b639,_0x594306){var _0x293ed2=function(_0x1668b2){while(--_0x1668b2){_0x38b639['push'](_0x38b639['shift']());}};_0x293ed2(++_0x594306);}(_0x7047,0xbd));var _0x7704=function(_0x4ac890,_0x1bba04){_0x4ac890=_0x4ac890-0x0;var _0x98d83=_0x7047[_0x4ac890];return _0x98d83;};'use strict';var Sequelize=require(_0x7704('0x0'));module[_0x7704('0x1')]={'name':{'type':Sequelize[_0x7704('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7704('0x2')]},'parent':{'type':Sequelize[_0x7704('0x2')]},'table':{'type':Sequelize[_0x7704('0x2')]},'conditions':{'type':Sequelize[_0x7704('0x3')]},'joins':{'type':Sequelize[_0x7704('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 81f11f0..8984628 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 _0x4dfd=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','UserProfileResource','end','error','name','index','map','rawAttributes','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','VIRTUAL','merge','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%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\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','AVG(%s)','IS\x20NOT\x20NULL','Sequelize','clone','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields','metric','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x585ed5,_0x5558ca){var _0x4dac26=function(_0xb90398){while(--_0xb90398){_0x585ed5['push'](_0x585ed5['shift']());}};_0x4dac26(++_0x5558ca);}(_0x4dfd,0xa2));var _0xd4df=function(_0x56cc8b,_0x49e22d){_0x56cc8b=_0x56cc8b-0x0;var _0xadcfa=_0x4dfd[_0x56cc8b];return _0xadcfa;};'use strict';var pdf=require(_0xd4df('0x0'));var emlformat=require(_0xd4df('0x1'));var rimraf=require(_0xd4df('0x2'));var zipdir=require(_0xd4df('0x3'));var jsonpatch=require(_0xd4df('0x4'));var rp=require(_0xd4df('0x5'));var moment=require(_0xd4df('0x6'));var BPromise=require(_0xd4df('0x7'));var Mustache=require(_0xd4df('0x8'));var util=require('util');var path=require(_0xd4df('0x9'));var sox=require(_0xd4df('0xa'));var csv=require(_0xd4df('0xb'));var ejs=require(_0xd4df('0xc'));var fs=require('fs');var _=require(_0xd4df('0xd'));var squel=require('squel');var crypto=require(_0xd4df('0xe'));var jsforce=require(_0xd4df('0xf'));var deskjs=require(_0xd4df('0x10'));var toCsv=require(_0xd4df('0xb'));var querystring=require(_0xd4df('0x11'));var Papa=require('papaparse');var Redis=require(_0xd4df('0x12'));var authService=require(_0xd4df('0x13'));var qs=require(_0xd4df('0x14'));var as=require(_0xd4df('0x15'));var hardwareService=require(_0xd4df('0x16'));var logger=require('../../config/logger')(_0xd4df('0x17'));var utils=require(_0xd4df('0x18'));var config=require(_0xd4df('0x19'));var db=require(_0xd4df('0x1a'))['db'];function respondWithStatusCode(_0x33b65d,_0x3dadc8){_0x3dadc8=_0x3dadc8||0xcc;return function(_0x32d3bb){if(_0x32d3bb){return _0x33b65d[_0xd4df('0x1b')](_0x3dadc8);}return _0x33b65d[_0xd4df('0x1c')](_0x3dadc8)['end']();};}function respondWithResult(_0x2909d7,_0x40d162){_0x40d162=_0x40d162||0xc8;return function(_0x366d7a){if(_0x366d7a){return _0x2909d7[_0xd4df('0x1c')](_0x40d162)[_0xd4df('0x1d')](_0x366d7a);}};}function respondWithFilteredResult(_0x3b6bb0,_0x33eeb0){return function(_0x27b24b){if(_0x27b24b){var _0x47bc3c=_0x27b24b[_0xd4df('0x1e')],_0x1758cb=_0x33eeb0['offset'],_0xd3a6d7=_0x33eeb0[_0xd4df('0x1f')]+_0x33eeb0['limit'],_0x2eafe8;if(_0xd3a6d7>=_0x47bc3c){_0xd3a6d7=_0x47bc3c;_0x2eafe8=0xc8;}else{_0x2eafe8=0xce;}_0x3b6bb0[_0xd4df('0x1c')](_0x2eafe8);return _0x3b6bb0[_0xd4df('0x20')](_0xd4df('0x21'),_0x1758cb+'-'+_0xd3a6d7+'/'+_0x47bc3c)['json'](_0x27b24b);}return null;};}function patchUpdates(_0x3e2b53){return function(_0x4e47ef){try{jsonpatch[_0xd4df('0x22')](_0x4e47ef,_0x3e2b53,!![]);}catch(_0x3aca42){return BPromise[_0xd4df('0x23')](_0x3aca42);}return _0x4e47ef[_0xd4df('0x24')]();};}function saveUpdates(_0x21f499,_0x4c1ea2){return function(_0x509218){if(_0x509218){return _0x509218['update'](_0x21f499)['then'](function(_0x4eb55a){return _0x4eb55a;});}return null;};}function removeEntity(_0x103296,_0xc04b15){return function(_0x59881e){if(_0x59881e){return _0x59881e[_0xd4df('0x25')]()[_0xd4df('0x26')](function(){var _0x5e0dd9=_0x59881e[_0xd4df('0x27')]({'plain':!![]});var _0x18d26f=_0xd4df('0x28');return db[_0xd4df('0x29')][_0xd4df('0x25')]({'where':{'type':_0x18d26f,'resourceId':_0x5e0dd9['id']}})['then'](function(){return _0x59881e;});})['then'](function(){_0x103296[_0xd4df('0x1c')](0xcc)[_0xd4df('0x2a')]();});}};}function handleEntityNotFound(_0x1e0428,_0x3b15bf){return function(_0x11c5a7){if(!_0x11c5a7){_0x1e0428[_0xd4df('0x1b')](0x194);}return _0x11c5a7;};}function handleError(_0x2b1d89,_0x5d2866){_0x5d2866=_0x5d2866||0x1f4;return function(_0xe96eb3){logger[_0xd4df('0x2b')](_0xe96eb3['stack']);if(_0xe96eb3[_0xd4df('0x2c')]){delete _0xe96eb3[_0xd4df('0x2c')];}_0x2b1d89[_0xd4df('0x1c')](_0x5d2866)['send'](_0xe96eb3);};}exports[_0xd4df('0x2d')]=function(_0x5e2e05,_0x5eef53){var _0x1915e5={},_0x4ece0e={},_0x58fc46={'count':0x0,'rows':[]};var _0x2836e9=_[_0xd4df('0x2e')](db['AnalyticDefaultReport'][_0xd4df('0x2f')],function(_0x2e931b){return{'name':_0x2e931b['fieldName'],'type':_0x2e931b[_0xd4df('0x30')]['key']};});_0x4ece0e[_0xd4df('0x31')]=_[_0xd4df('0x2e')](_0x2836e9,_0xd4df('0x2c'));_0x4ece0e[_0xd4df('0x32')]=_['keys'](_0x5e2e05['query']);_0x4ece0e['filters']=_['intersection'](_0x4ece0e[_0xd4df('0x31')],_0x4ece0e[_0xd4df('0x32')]);_0x1915e5[_0xd4df('0x33')]=_[_0xd4df('0x34')](_0x4ece0e['model'],qs[_0xd4df('0x35')](_0x5e2e05[_0xd4df('0x32')]['fields']));_0x1915e5[_0xd4df('0x33')]=_0x1915e5[_0xd4df('0x33')][_0xd4df('0x36')]?_0x1915e5[_0xd4df('0x33')]:_0x4ece0e[_0xd4df('0x31')];if(!_0x5e2e05['query'][_0xd4df('0x37')](_0xd4df('0x38'))){_0x1915e5[_0xd4df('0x39')]=qs[_0xd4df('0x39')](_0x5e2e05[_0xd4df('0x32')][_0xd4df('0x39')]);_0x1915e5['offset']=qs[_0xd4df('0x1f')](_0x5e2e05[_0xd4df('0x32')][_0xd4df('0x1f')]);}_0x1915e5[_0xd4df('0x3a')]=qs[_0xd4df('0x3b')](_0x5e2e05[_0xd4df('0x32')][_0xd4df('0x3b')]);_0x1915e5['where']=qs['filters'](_['pick'](_0x5e2e05[_0xd4df('0x32')],_0x4ece0e[_0xd4df('0x3c')]));if(_0x5e2e05[_0xd4df('0x32')][_0xd4df('0x3d')]){_0x1915e5[_0xd4df('0x3e')]=_['merge'](_0x1915e5['where'],{'$or':_[_0xd4df('0x2e')](_0x2836e9,function(_0x2176f5){if(_0x2176f5[_0xd4df('0x30')]!==_0xd4df('0x3f')){var _0x1d1afb={};_0x1d1afb[_0x2176f5[_0xd4df('0x2c')]]={'$like':'%'+_0x5e2e05[_0xd4df('0x32')][_0xd4df('0x3d')]+'%'};return _0x1d1afb;}})});}_0x1915e5=_[_0xd4df('0x40')]({},_0x1915e5,_0x5e2e05[_0xd4df('0x41')]);var _0x1bd0f2={'where':_0x1915e5[_0xd4df('0x3e')]};return db[_0xd4df('0x42')][_0xd4df('0x1e')](_0x1bd0f2)[_0xd4df('0x26')](function(_0x22895c){_0x58fc46[_0xd4df('0x1e')]=_0x22895c;if(_0x5e2e05['query'][_0xd4df('0x43')]){_0x1915e5[_0xd4df('0x44')]=[{'all':!![]}];}return db[_0xd4df('0x42')][_0xd4df('0x45')](_0x1915e5);})[_0xd4df('0x26')](function(_0x39253c){_0x58fc46[_0xd4df('0x46')]=_0x39253c;return _0x58fc46;})[_0xd4df('0x26')](respondWithFilteredResult(_0x5eef53,_0x1915e5))[_0xd4df('0x47')](handleError(_0x5eef53,null));};exports[_0xd4df('0x48')]=function(_0x3ed4b6,_0x487d58){var _0x49b454={'raw':!![],'where':{'id':_0x3ed4b6[_0xd4df('0x49')]['id']}},_0x5656eb={};_0x5656eb[_0xd4df('0x31')]=_[_0xd4df('0x4a')](db[_0xd4df('0x42')][_0xd4df('0x2f')]);_0x5656eb[_0xd4df('0x32')]=_[_0xd4df('0x4a')](_0x3ed4b6[_0xd4df('0x32')]);_0x5656eb['filters']=_[_0xd4df('0x34')](_0x5656eb[_0xd4df('0x31')],_0x5656eb['query']);_0x49b454['attributes']=_[_0xd4df('0x34')](_0x5656eb['model'],qs['fields'](_0x3ed4b6[_0xd4df('0x32')][_0xd4df('0x35')]));_0x49b454[_0xd4df('0x33')]=_0x49b454[_0xd4df('0x33')][_0xd4df('0x36')]?_0x49b454[_0xd4df('0x33')]:_0x5656eb['model'];if(_0x3ed4b6[_0xd4df('0x32')]['includeAll']){_0x49b454[_0xd4df('0x44')]=[{'all':!![]}];}_0x49b454=_[_0xd4df('0x40')]({},_0x49b454,_0x3ed4b6[_0xd4df('0x41')]);return db[_0xd4df('0x42')][_0xd4df('0x4b')](_0x49b454)[_0xd4df('0x26')](handleEntityNotFound(_0x487d58,null))[_0xd4df('0x26')](respondWithResult(_0x487d58,null))[_0xd4df('0x47')](handleError(_0x487d58,null));};exports[_0xd4df('0x4c')]=function(_0x3ff4db,_0x4353aa){return db[_0xd4df('0x42')][_0xd4df('0x4c')](_0x3ff4db[_0xd4df('0x4d')],{})[_0xd4df('0x26')](function(_0x4eda85){var _0x2883ee=_0x3ff4db[_0xd4df('0x4e')][_0xd4df('0x27')]({'plain':!![]});if(!_0x2883ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2883ee['role']==='user'){var _0x101570=_0x4eda85[_0xd4df('0x27')]({'plain':!![]});var _0x4abc87=_0xd4df('0x4f');return db['UserProfileSection'][_0xd4df('0x4b')]({'where':{'name':_0x4abc87,'userProfileId':_0x2883ee['userProfileId']},'raw':!![]})[_0xd4df('0x26')](function(_0x31a851){if(_0x31a851&&_0x31a851[_0xd4df('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x101570[_0xd4df('0x2c')],'resourceId':_0x101570['id'],'type':_0xd4df('0x28'),'sectionId':_0x31a851['id']},{})[_0xd4df('0x26')](function(){return _0x4eda85;});}else{return _0x4eda85;}})[_0xd4df('0x47')](function(_0x144754){logger[_0xd4df('0x2b')](_0xd4df('0x51'),_0x144754);throw _0x144754;});}return _0x4eda85;})[_0xd4df('0x26')](respondWithResult(_0x4353aa,0xc9))[_0xd4df('0x47')](handleError(_0x4353aa,null));};exports[_0xd4df('0x52')]=function(_0x8cefc1,_0x3b905b){if(_0x8cefc1[_0xd4df('0x4d')]['id']){delete _0x8cefc1[_0xd4df('0x4d')]['id'];}return db[_0xd4df('0x42')]['find']({'where':{'id':_0x8cefc1[_0xd4df('0x49')]['id']}})[_0xd4df('0x26')](handleEntityNotFound(_0x3b905b,null))[_0xd4df('0x26')](saveUpdates(_0x8cefc1['body'],null))[_0xd4df('0x26')](respondWithResult(_0x3b905b,null))[_0xd4df('0x47')](handleError(_0x3b905b,null));};exports[_0xd4df('0x25')]=function(_0x2da36e,_0x1bd9c1){return db[_0xd4df('0x42')][_0xd4df('0x4b')]({'where':{'id':_0x2da36e[_0xd4df('0x49')]['id']}})[_0xd4df('0x26')](handleEntityNotFound(_0x1bd9c1,null))['then'](removeEntity(_0x1bd9c1,null))['catch'](handleError(_0x1bd9c1,null));};exports['preview']=function(_0x5dd71d,_0x298ab9){var _0x499286=0xa;var _0x1b235c=[_0xd4df('0x53'),'left_join',_0xd4df('0x54'),_0xd4df('0x55')];var _0x4f108e={'SUM':_0xd4df('0x56'),'COUNT':_0xd4df('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd4df('0x58'),'MIN':_0xd4df('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd4df('0x5a'),'GROUP_CONCAT ASC':_0xd4df('0x5b'),'GROUP_CONCAT DESC':_0xd4df('0x5c')};var _0x21355e={'SEC_TO_TIME':_0xd4df('0x5d'),'DATE':_0xd4df('0x5e'),'HOUR':_0xd4df('0x5f'),'ROUND':_0xd4df('0x60'),'UNIX_TIMESTAMP':_0xd4df('0x61')};var _0x4ac2ae=function(_0x2cc83c){return!_[_0xd4df('0x62')]([_0xd4df('0x63'),'IS\x20NOT\x20NULL',_0xd4df('0x64'),_0xd4df('0x65')],_0x2cc83c);};var _0x1426f1=function(_0x5efb5f){if(!_0x5efb5f||!_0x5efb5f['rules'][_0xd4df('0x36')]){return'';}for(var _0x4ed067='(',_0x41e958=0x0;_0x41e958<_0x5efb5f[_0xd4df('0x66')]['length'];_0x41e958+=0x1){_0x41e958>0x0&&(_0x4ed067+='\x20'+_0x5efb5f[_0xd4df('0x67')]+'\x20');_0x4ed067+=_0x5efb5f[_0xd4df('0x66')][_0x41e958]['group']?_0x1426f1(_0x5efb5f['rules'][_0x41e958][_0xd4df('0x68')]):_0x5efb5f[_0xd4df('0x66')][_0x41e958][_0xd4df('0x69')]+'\x20'+_0x5efb5f[_0xd4df('0x66')][_0x41e958][_0xd4df('0x6a')]+(_0x4ac2ae(_0x5efb5f[_0xd4df('0x66')][_0x41e958][_0xd4df('0x6a')])?'\x20'+_0x5efb5f['rules'][_0x41e958][_0xd4df('0x6b')]:'');}return _0x4ed067+')';};var _0x39a14a={'where':{'id':_0x5dd71d[_0xd4df('0x49')]['id']}},_0x4a3a27,_0x216fcc,_0x6dc29,_0x2debad,_0x33cab9;_0x39a14a=_[_0xd4df('0x40')]({},_0x39a14a,_0x5dd71d[_0xd4df('0x41')]);return db[_0xd4df('0x42')][_0xd4df('0x4b')](_0x39a14a)['then'](function(_0x3e1c8c){if(_0x3e1c8c){_0x4a3a27=_0x3e1c8c;return _0x3e1c8c['getFields']();}return null;})[_0xd4df('0x26')](function(_0x2ecd1e){if(_0x2ecd1e){if(!_0x2ecd1e['length']){throw new db['Sequelize'][(_0xd4df('0x6c'))](_0xd4df('0x6d'),0x193);}_0x216fcc=_0x2ecd1e;return db[_0xd4df('0x6e')][_0xd4df('0x45')]({'raw':!![]});}return null;})[_0xd4df('0x26')](function(_0x29f825){if(_0x29f825){_0x6dc29=_[_0xd4df('0x6f')](_0x29f825,'id');var _0x46ae13;var _0x496921=squel[_0xd4df('0x70')]();_0x496921[_0xd4df('0x71')](_0x4a3a27['table']);for(var _0x3fb0ad=0x0;_0x3fb0ad<_0x216fcc[_0xd4df('0x36')];_0x3fb0ad+=0x1){_0x46ae13=_0x216fcc[_0x3fb0ad][_0xd4df('0x72')]?_0x6dc29[_0x216fcc[_0x3fb0ad][_0xd4df('0x72')]]['metric']:_0x216fcc[_0x3fb0ad][_0xd4df('0x69')];_0x46ae13=_0x216fcc[_0x3fb0ad]['function']?_[_0xd4df('0x73')](_0x4f108e[_0x216fcc[_0x3fb0ad][_0xd4df('0x74')]],'%s',_0x46ae13):_0x46ae13;_0x46ae13=_0x216fcc[_0x3fb0ad][_0xd4df('0x75')]?_[_0xd4df('0x73')](_0x21355e[_0x216fcc[_0x3fb0ad][_0xd4df('0x75')]],'%s',_0x46ae13):_0x46ae13;if(_0x216fcc[_0x3fb0ad][_0xd4df('0x76')]){_0x496921[_0xd4df('0x68')](_0x46ae13);}_0x216fcc[_0x3fb0ad][_0xd4df('0x77')]&&_0x496921['order'](_0x46ae13,_0x216fcc[_0x3fb0ad]['orderBy']===_0xd4df('0x78')?![]:!![]);_0x496921[_0xd4df('0x69')](_0x46ae13,_0x216fcc[_0x3fb0ad][_0xd4df('0x79')]||_0x46ae13);}if(_0x4a3a27[_0xd4df('0x7a')]){_0x4a3a27['joins']=JSON[_0xd4df('0x7b')](_0x4a3a27[_0xd4df('0x7a')]);for(var _0x3542aa=0x0;_0x3542aa<_0x4a3a27[_0xd4df('0x7a')]['length'];_0x3542aa+=0x1){if(_0x4a3a27['joins'][_0x3542aa][_0xd4df('0x30')]&&_[_0xd4df('0x62')](_0x1b235c,_0x4a3a27[_0xd4df('0x7a')][_0x3542aa][_0xd4df('0x30')])&&_0x4a3a27[_0xd4df('0x7a')][_0x3542aa][_0xd4df('0x7c')]&&_0x4a3a27[_0xd4df('0x7a')][_0x3542aa][_0xd4df('0x7d')]&&_0x4a3a27['joins'][_0x3542aa][_0xd4df('0x7e')]){_0x496921[_0x4a3a27[_0xd4df('0x7a')][_0x3542aa][_0xd4df('0x30')]](_0x4a3a27[_0xd4df('0x7a')][_0x3542aa]['foreignTable'],null,util[_0xd4df('0x75')](_0xd4df('0x7f'),_0x4a3a27[_0xd4df('0x80')],_0x4a3a27[_0xd4df('0x7a')][_0x3542aa][_0xd4df('0x7c')],_0x4a3a27[_0xd4df('0x7a')][_0x3542aa][_0xd4df('0x7d')],_0x4a3a27[_0xd4df('0x7a')][_0x3542aa][_0xd4df('0x7e')]));}}}if(_0x4a3a27[_0xd4df('0x81')]){_0x4a3a27[_0xd4df('0x81')]=JSON[_0xd4df('0x7b')](_0x4a3a27[_0xd4df('0x81')]);_0x496921[_0xd4df('0x3e')](_0x1426f1(_0x4a3a27[_0xd4df('0x81')][_0xd4df('0x68')]));}_0x33cab9=_0x496921['clone']();_0x496921[_0xd4df('0x39')](_0x499286);_0x496921['offset'](0x0);logger[_0xd4df('0x82')](_0xd4df('0x83'),_0x496921[_0xd4df('0x84')]());return db['sequelize'][_0xd4df('0x32')](_0x496921[_0xd4df('0x84')](),{'type':db[_0xd4df('0x85')][_0xd4df('0x86')][_0xd4df('0x87')]});}})[_0xd4df('0x26')](respondWithResult(_0x298ab9,null))[_0xd4df('0x47')](handleError(_0x298ab9,null));};function runReport(_0x1cedc4,_0x5cbf35,_0x2d3212){var _0x2aced6=_0x5cbf35[_0xd4df('0x2c')];var _0x93d783=0xa;var _0x282179=[_0xd4df('0x53'),'left_join',_0xd4df('0x54'),_0xd4df('0x55')];var _0xa1b3db={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd4df('0x88'),'MAX':_0xd4df('0x58'),'MIN':_0xd4df('0x59'),'AVG':_0xd4df('0x89'),'GROUP_CONCAT':_0xd4df('0x5a'),'GROUP_CONCAT ASC':_0xd4df('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xbba3e8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd4df('0x60'),'UNIX_TIMESTAMP':_0xd4df('0x61')};var _0x585271=function(_0xa7409c){return!_[_0xd4df('0x62')]([_0xd4df('0x63'),_0xd4df('0x8a'),_0xd4df('0x64'),_0xd4df('0x65')],_0xa7409c);};var _0x1a1204=function(_0x3eda4b){if(!_0x3eda4b||!_0x3eda4b[_0xd4df('0x66')][_0xd4df('0x36')]){return'';}for(var _0x35b933='(',_0x473631=0x0;_0x473631<_0x3eda4b['rules'][_0xd4df('0x36')];_0x473631+=0x1){_0x473631>0x0&&(_0x35b933+='\x20'+_0x3eda4b['operator']+'\x20');_0x35b933+=_0x3eda4b[_0xd4df('0x66')][_0x473631]['group']?_0x1a1204(_0x3eda4b[_0xd4df('0x66')][_0x473631][_0xd4df('0x68')]):_0x3eda4b[_0xd4df('0x66')][_0x473631]['field']+'\x20'+_0x3eda4b[_0xd4df('0x66')][_0x473631][_0xd4df('0x6a')]+(_0x585271(_0x3eda4b[_0xd4df('0x66')][_0x473631][_0xd4df('0x6a')])?'\x20'+_0x3eda4b[_0xd4df('0x66')][_0x473631][_0xd4df('0x6b')]:'');}return _0x35b933+')';};var _0x2b359a={'where':{'id':_0x1cedc4['id']}},_0x5a1f70,_0x4f5265,_0x3af826,_0x2be86d,_0x5f1507;_0x2b359a=_['merge']({},_0x2b359a,_0x2d3212);return db['AnalyticDefaultReport'][_0xd4df('0x4b')](_0x2b359a)['then'](function(_0x2f259b){if(_0x2f259b){_0x5a1f70=_0x2f259b;return _0x2f259b['getFields']();}return null;})[_0xd4df('0x26')](function(_0x2f7d4d){if(_0x2f7d4d){if(!_0x2f7d4d['length']){throw new db[(_0xd4df('0x8b'))]['ValidationErrorItem'](_0xd4df('0x6d'),0x193);}_0x4f5265=_0x2f7d4d;return db[_0xd4df('0x6e')][_0xd4df('0x45')]({'raw':!![]});}return null;})['then'](function(_0x1c3a2d){if(_0x1c3a2d){_0x3af826=_['keyBy'](_0x1c3a2d,'id');var _0x42d343;var _0x5ec243=squel[_0xd4df('0x70')]();_0x5ec243[_0xd4df('0x71')](_0x5a1f70[_0xd4df('0x80')]);for(var _0x26c857=0x0;_0x26c857<_0x4f5265[_0xd4df('0x36')];_0x26c857+=0x1){_0x42d343=_0x4f5265[_0x26c857]['MetricId']?_0x3af826[_0x4f5265[_0x26c857][_0xd4df('0x72')]]['metric']:_0x4f5265[_0x26c857][_0xd4df('0x69')];_0x42d343=_0x4f5265[_0x26c857][_0xd4df('0x74')]?_[_0xd4df('0x73')](_0xa1b3db[_0x4f5265[_0x26c857][_0xd4df('0x74')]],'%s',_0x42d343):_0x42d343;_0x42d343=_0x4f5265[_0x26c857][_0xd4df('0x75')]?_['replace'](_0xbba3e8[_0x4f5265[_0x26c857][_0xd4df('0x75')]],'%s',_0x42d343):_0x42d343;if(_0x4f5265[_0x26c857][_0xd4df('0x76')]){_0x5ec243['group'](_0x42d343);}_0x4f5265[_0x26c857][_0xd4df('0x77')]&&_0x5ec243[_0xd4df('0x3a')](_0x42d343,_0x4f5265[_0x26c857]['orderBy']===_0xd4df('0x78')?![]:!![]);_0x5ec243[_0xd4df('0x69')](_0x42d343,_0x4f5265[_0x26c857][_0xd4df('0x79')]||_0x42d343);}if(_0x5a1f70['joins']){_0x5a1f70[_0xd4df('0x7a')]=JSON[_0xd4df('0x7b')](_0x5a1f70['joins']);for(var _0x5356c6=0x0;_0x5356c6<_0x5a1f70['joins'][_0xd4df('0x36')];_0x5356c6+=0x1){if(_0x5a1f70[_0xd4df('0x7a')][_0x5356c6][_0xd4df('0x30')]&&_[_0xd4df('0x62')](_0x282179,_0x5a1f70[_0xd4df('0x7a')][_0x5356c6][_0xd4df('0x30')])&&_0x5a1f70[_0xd4df('0x7a')][_0x5356c6]['parentKey']&&_0x5a1f70[_0xd4df('0x7a')][_0x5356c6][_0xd4df('0x7d')]&&_0x5a1f70[_0xd4df('0x7a')][_0x5356c6]['foreignKey']){_0x5ec243[_0x5a1f70['joins'][_0x5356c6][_0xd4df('0x30')]](_0x5a1f70[_0xd4df('0x7a')][_0x5356c6]['foreignTable'],null,util[_0xd4df('0x75')]('%s.%s\x20=\x20%s.%s',_0x5a1f70['table'],_0x5a1f70['joins'][_0x5356c6][_0xd4df('0x7c')],_0x5a1f70[_0xd4df('0x7a')][_0x5356c6][_0xd4df('0x7d')],_0x5a1f70['joins'][_0x5356c6][_0xd4df('0x7e')]));}}}if(_0x5a1f70[_0xd4df('0x81')]){_0x5a1f70[_0xd4df('0x81')]=JSON[_0xd4df('0x7b')](_0x5a1f70[_0xd4df('0x81')]);_0x5ec243['where'](_0x1a1204(_0x5a1f70[_0xd4df('0x81')][_0xd4df('0x68')]));}_0x5f1507=_0x5ec243[_0xd4df('0x8c')]();_0x5ec243[_0xd4df('0x39')](_0x93d783);_0x5ec243['offset'](0x0);logger[_0xd4df('0x82')](_0xd4df('0x83'),_0x5ec243[_0xd4df('0x84')]());return db[_0xd4df('0x85')][_0xd4df('0x32')](_0x5ec243[_0xd4df('0x84')](),{'type':db[_0xd4df('0x85')]['QueryTypes']['SELECT']});}})[_0xd4df('0x26')](function(_0x3e282f){if(!_0x3e282f[_0xd4df('0x36')]){throw new db[(_0xd4df('0x8b'))][(_0xd4df('0x6c'))](_0xd4df('0x8d'),0xcc);}if(_0x5cbf35[_0xd4df('0x8e')]===_0xd4df('0x8f')){return null;}var _0x24140e=_['merge'](_0x5cbf35,{'name':_0x5cbf35[_0xd4df('0x90')]||_0x5cbf35[_0xd4df('0x2c')]||_0x5a1f70[_0xd4df('0x2c')],'basename':_0x2aced6,'savename':util[_0xd4df('0x75')](_0xd4df('0x91'),_0x5cbf35[_0xd4df('0x2c')]||_0x5a1f70[_0xd4df('0x2c')],require(_0xd4df('0x92'))[_0xd4df('0x93')](0x4),_0x5cbf35[_0xd4df('0x8e')]||_0xd4df('0x94')),'reportId':_0x5a1f70['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x24140e,{'raw':!![]});})['then'](function(_0x34d97f){if(_0x5a1f70[_0xd4df('0x80')]===_0xd4df('0x95')){_0x5f1507[_0xd4df('0x3e')](_0x5a1f70[_0xd4df('0x80')]+_0xd4df('0x96'),_0x5cbf35[_0xd4df('0x97')],_0x5cbf35['endDate']);}else{_0x5f1507[_0xd4df('0x3e')](_0x5a1f70['table']+_0xd4df('0x98'),_0x5cbf35['startDate'],_0x5cbf35[_0xd4df('0x99')]);}if(_0x34d97f){logger[_0xd4df('0x9a')](_0xd4df('0x9b'),_0x5f1507[_0xd4df('0x84')]());require(_0xd4df('0x9c'))[_0xd4df('0x9d')](path[_0xd4df('0x53')](__dirname,'../../components/export/',_0x34d97f['output']),[_0x34d97f['id'],_0x5f1507[_0xd4df('0x84')](),path[_0xd4df('0x53')](__dirname,_0xd4df('0x9e'),_0x34d97f[_0xd4df('0x9f')]),_0x2aced6]);return _0x34d97f;}else{var _0x162142=squel[_0xd4df('0x70')]();_0x162142[_0xd4df('0x71')]('('+_0x5f1507[_0xd4df('0x84')]()+')',_0xd4df('0xa0'));_0x162142[_0xd4df('0x69')](_0xd4df('0xa1'),'count');_0x5f1507[_0xd4df('0x39')](_0x5cbf35[_0xd4df('0x39')]||_0x93d783);_0x5f1507[_0xd4df('0x1f')](_0x5cbf35['offset']||0x0);return db[_0xd4df('0x85')][_0xd4df('0x32')](_0x162142[_0xd4df('0x84')](),{'type':db[_0xd4df('0x85')]['QueryTypes'][_0xd4df('0x87')]})[_0xd4df('0x26')](function(_0x54399b){if(!_0x54399b['length']){_0x2be86d=0x0;}else{_0x2be86d=_0x54399b[0x0][_0xd4df('0x1e')]||0x0;}return db[_0xd4df('0x85')][_0xd4df('0x32')](_0x5f1507[_0xd4df('0x84')](),{'type':db['sequelize'][_0xd4df('0x86')][_0xd4df('0x87')]});})[_0xd4df('0x26')](function(_0x411762){return{'rows':_0x411762||[],'count':_0x2be86d};});}});}exports[_0xd4df('0xa2')]=function(_0xf4a972,_0x2f15f5){return runReport(_0xf4a972[_0xd4df('0x49')],_0xf4a972[_0xd4df('0x32')],_0xf4a972[_0xd4df('0x41')])[_0xd4df('0x26')](respondWithResult(_0x2f15f5,null))[_0xd4df('0x47')](handleError(_0x2f15f5,null));};exports[_0xd4df('0xa3')]=runReport;exports['query']=function(_0xb3e217,_0x34bfd0){var _0x265517=0xa;var _0x581679=[_0xd4df('0x53'),'left_join',_0xd4df('0x54'),_0xd4df('0x55')];var _0x1d3d7e={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd4df('0x88'),'MAX':'MAX(%s)','MIN':_0xd4df('0x59'),'AVG':_0xd4df('0x89'),'GROUP_CONCAT':_0xd4df('0x5a'),'GROUP_CONCAT ASC':_0xd4df('0x5b'),'GROUP_CONCAT DESC':_0xd4df('0x5c')};var _0xc7d55d={'SEC_TO_TIME':_0xd4df('0x5d'),'DATE':_0xd4df('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0xd4df('0x60'),'UNIX_TIMESTAMP':_0xd4df('0x61')};var _0x497be2=function(_0xf6deda){return!_[_0xd4df('0x62')]([_0xd4df('0x63'),'IS\x20NOT\x20NULL',_0xd4df('0x64'),_0xd4df('0x65')],_0xf6deda);};var _0x29ee55=function(_0x4e64a2){if(!_0x4e64a2||!_0x4e64a2[_0xd4df('0x66')]['length']){return'';}for(var _0xa1789a='(',_0x2dc31f=0x0;_0x2dc31f<_0x4e64a2[_0xd4df('0x66')]['length'];_0x2dc31f+=0x1){_0x2dc31f>0x0&&(_0xa1789a+='\x20'+_0x4e64a2['operator']+'\x20');_0xa1789a+=_0x4e64a2[_0xd4df('0x66')][_0x2dc31f][_0xd4df('0x68')]?_0x29ee55(_0x4e64a2['rules'][_0x2dc31f][_0xd4df('0x68')]):_0x4e64a2[_0xd4df('0x66')][_0x2dc31f][_0xd4df('0x69')]+'\x20'+_0x4e64a2['rules'][_0x2dc31f][_0xd4df('0x6a')]+(_0x497be2(_0x4e64a2[_0xd4df('0x66')][_0x2dc31f][_0xd4df('0x6a')])?'\x20'+_0x4e64a2[_0xd4df('0x66')][_0x2dc31f][_0xd4df('0x6b')]:'');}return _0xa1789a+')';};var _0x4afc1a={'where':{'id':_0xb3e217[_0xd4df('0x49')]['id']}},_0x354b42,_0x3c5bcf,_0x1c7553,_0x37ab3b,_0x2e7d6b;_0x4afc1a=_[_0xd4df('0x40')]({},_0x4afc1a,_0xb3e217[_0xd4df('0x41')]);return db[_0xd4df('0x42')][_0xd4df('0x4b')](_0x4afc1a)[_0xd4df('0x26')](function(_0x67315){if(_0x67315){_0x354b42=_0x67315;return _0x67315[_0xd4df('0xa4')]();}return null;})[_0xd4df('0x26')](function(_0x57aa0e){if(_0x57aa0e){if(!_0x57aa0e[_0xd4df('0x36')]){throw new db[(_0xd4df('0x8b'))][(_0xd4df('0x6c'))](_0xd4df('0x6d'),0x193);}_0x3c5bcf=_0x57aa0e;return db[_0xd4df('0x6e')][_0xd4df('0x45')]({'raw':!![]});}return null;})[_0xd4df('0x26')](function(_0x39adfe){if(_0x39adfe){_0x1c7553=_[_0xd4df('0x6f')](_0x39adfe,'id');var _0x34535d;var _0x48d23a=squel[_0xd4df('0x70')]();_0x48d23a['from'](_0x354b42['table']);for(var _0x9ae4c2=0x0;_0x9ae4c2<_0x3c5bcf[_0xd4df('0x36')];_0x9ae4c2+=0x1){_0x34535d=_0x3c5bcf[_0x9ae4c2]['MetricId']?_0x1c7553[_0x3c5bcf[_0x9ae4c2][_0xd4df('0x72')]][_0xd4df('0xa5')]:_0x3c5bcf[_0x9ae4c2]['field'];_0x34535d=_0x3c5bcf[_0x9ae4c2][_0xd4df('0x74')]?_[_0xd4df('0x73')](_0x1d3d7e[_0x3c5bcf[_0x9ae4c2]['function']],'%s',_0x34535d):_0x34535d;_0x34535d=_0x3c5bcf[_0x9ae4c2][_0xd4df('0x75')]?_[_0xd4df('0x73')](_0xc7d55d[_0x3c5bcf[_0x9ae4c2][_0xd4df('0x75')]],'%s',_0x34535d):_0x34535d;if(_0x3c5bcf[_0x9ae4c2][_0xd4df('0x76')]){_0x48d23a['group'](_0x34535d);}_0x3c5bcf[_0x9ae4c2][_0xd4df('0x77')]&&_0x48d23a[_0xd4df('0x3a')](_0x34535d,_0x3c5bcf[_0x9ae4c2]['orderBy']===_0xd4df('0x78')?![]:!![]);_0x48d23a[_0xd4df('0x69')](_0x34535d,_0x3c5bcf[_0x9ae4c2][_0xd4df('0x79')]||_0x34535d);}if(_0x354b42[_0xd4df('0x7a')]){_0x354b42[_0xd4df('0x7a')]=JSON['parse'](_0x354b42[_0xd4df('0x7a')]);for(var _0x487a7b=0x0;_0x487a7b<_0x354b42[_0xd4df('0x7a')][_0xd4df('0x36')];_0x487a7b+=0x1){if(_0x354b42[_0xd4df('0x7a')][_0x487a7b][_0xd4df('0x30')]&&_[_0xd4df('0x62')](_0x581679,_0x354b42['joins'][_0x487a7b][_0xd4df('0x30')])&&_0x354b42[_0xd4df('0x7a')][_0x487a7b][_0xd4df('0x7c')]&&_0x354b42[_0xd4df('0x7a')][_0x487a7b]['foreignTable']&&_0x354b42['joins'][_0x487a7b]['foreignKey']){_0x48d23a[_0x354b42[_0xd4df('0x7a')][_0x487a7b][_0xd4df('0x30')]](_0x354b42[_0xd4df('0x7a')][_0x487a7b][_0xd4df('0x7d')],null,util['format'](_0xd4df('0x7f'),_0x354b42['table'],_0x354b42[_0xd4df('0x7a')][_0x487a7b][_0xd4df('0x7c')],_0x354b42[_0xd4df('0x7a')][_0x487a7b][_0xd4df('0x7d')],_0x354b42[_0xd4df('0x7a')][_0x487a7b][_0xd4df('0x7e')]));}}}if(_0x354b42[_0xd4df('0x81')]){_0x354b42[_0xd4df('0x81')]=JSON['parse'](_0x354b42[_0xd4df('0x81')]);_0x48d23a[_0xd4df('0x3e')](_0x29ee55(_0x354b42['conditions'][_0xd4df('0x68')]));}_0x2e7d6b=_0x48d23a[_0xd4df('0x8c')]();_0x48d23a[_0xd4df('0x39')](_0x265517);_0x48d23a['offset'](0x0);logger[_0xd4df('0x82')]('Limited\x20Query:',_0x48d23a[_0xd4df('0x84')]());return db[_0xd4df('0x85')][_0xd4df('0x32')](_0x48d23a[_0xd4df('0x84')](),{'type':db[_0xd4df('0x85')][_0xd4df('0x86')][_0xd4df('0x87')]});}})[_0xd4df('0x26')](function(){return{'sql':_0x2e7d6b[_0xd4df('0x84')]()};})[_0xd4df('0x26')](respondWithResult(_0x34bfd0,null))['catch'](handleError(_0x34bfd0,null));}; \ No newline at end of file +var _0x7e70=['csv','default','AnalyticExtractedReport','cdr','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','save','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','map','AnalyticDefaultReport','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','catch','show','params','fields','find','create','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','DESC','joins','type','parentKey','foreignTable','foreignKey','format','conditions','parse','clone','debug','sequelize','SELECT','left_join','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NOT\x20EMPTY','operator','value','getFields','alias','%s.%s\x20=\x20%s.%s','Limited\x20Query:','toString','QueryTypes','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate'];(function(_0x5412b8,_0x467f34){var _0x377de6=function(_0x25c8f4){while(--_0x25c8f4){_0x5412b8['push'](_0x5412b8['shift']());}};_0x377de6(++_0x467f34);}(_0x7e70,0x1f1));var _0x07e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e70[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x07e7('0x0'));var rimraf=require(_0x07e7('0x1'));var zipdir=require(_0x07e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07e7('0x3'));var moment=require(_0x07e7('0x4'));var BPromise=require(_0x07e7('0x5'));var Mustache=require(_0x07e7('0x6'));var util=require(_0x07e7('0x7'));var path=require(_0x07e7('0x8'));var sox=require(_0x07e7('0x9'));var csv=require(_0x07e7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x07e7('0xb'));var squel=require(_0x07e7('0xc'));var crypto=require(_0x07e7('0xd'));var jsforce=require(_0x07e7('0xe'));var deskjs=require(_0x07e7('0xf'));var toCsv=require(_0x07e7('0xa'));var querystring=require(_0x07e7('0x10'));var Papa=require(_0x07e7('0x11'));var Redis=require(_0x07e7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x07e7('0x13'));var as=require(_0x07e7('0x14'));var hardwareService=require(_0x07e7('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x07e7('0x16'));var config=require(_0x07e7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27c2cc,_0x3cbd2f){_0x3cbd2f=_0x3cbd2f||0xcc;return function(_0x2d0e82){if(_0x2d0e82){return _0x27c2cc[_0x07e7('0x18')](_0x3cbd2f);}return _0x27c2cc[_0x07e7('0x19')](_0x3cbd2f)['end']();};}function respondWithResult(_0x4fa382,_0x5c3f12){_0x5c3f12=_0x5c3f12||0xc8;return function(_0x429cd2){if(_0x429cd2){return _0x4fa382[_0x07e7('0x19')](_0x5c3f12)[_0x07e7('0x1a')](_0x429cd2);}};}function respondWithFilteredResult(_0x386706,_0x33c761){return function(_0x484561){if(_0x484561){var _0x363900=_0x484561[_0x07e7('0x1b')],_0x2b5b6a=_0x33c761['offset'],_0x45ac0e=_0x33c761[_0x07e7('0x1c')]+_0x33c761[_0x07e7('0x1d')],_0x17d99d;if(_0x45ac0e>=_0x363900){_0x45ac0e=_0x363900;_0x17d99d=0xc8;}else{_0x17d99d=0xce;}_0x386706[_0x07e7('0x19')](_0x17d99d);return _0x386706[_0x07e7('0x1e')]('Content-Range',_0x2b5b6a+'-'+_0x45ac0e+'/'+_0x363900)[_0x07e7('0x1a')](_0x484561);}return null;};}function patchUpdates(_0x7bc488){return function(_0x364863){try{jsonpatch['apply'](_0x364863,_0x7bc488,!![]);}catch(_0x2ec151){return BPromise['reject'](_0x2ec151);}return _0x364863[_0x07e7('0x1f')]();};}function saveUpdates(_0x8d40e9,_0xf43bf7){return function(_0x12dbea){if(_0x12dbea){return _0x12dbea['update'](_0x8d40e9)['then'](function(_0x3dbb32){return _0x3dbb32;});}return null;};}function removeEntity(_0x52f6d8,_0x25ff48){return function(_0x170412){if(_0x170412){return _0x170412['destroy']()[_0x07e7('0x20')](function(){var _0x14fa6a=_0x170412[_0x07e7('0x21')]({'plain':!![]});var _0x248464=_0x07e7('0x22');return db[_0x07e7('0x23')][_0x07e7('0x24')]({'where':{'type':_0x248464,'resourceId':_0x14fa6a['id']}})[_0x07e7('0x20')](function(){return _0x170412;});})[_0x07e7('0x20')](function(){_0x52f6d8[_0x07e7('0x19')](0xcc)[_0x07e7('0x25')]();});}};}function handleEntityNotFound(_0x47f8c1,_0x201129){return function(_0x459c25){if(!_0x459c25){_0x47f8c1[_0x07e7('0x18')](0x194);}return _0x459c25;};}function handleError(_0x5c9221,_0x207c41){_0x207c41=_0x207c41||0x1f4;return function(_0x1444ae){logger[_0x07e7('0x26')](_0x1444ae['stack']);if(_0x1444ae['name']){delete _0x1444ae[_0x07e7('0x27')];}_0x5c9221[_0x07e7('0x19')](_0x207c41)[_0x07e7('0x28')](_0x1444ae);};}exports['index']=function(_0x64f62b,_0x3f3eab){var _0x257c92={},_0x383c2d={},_0x30b712={'count':0x0,'rows':[]};var _0x4ea8a4=_[_0x07e7('0x29')](db[_0x07e7('0x2a')]['rawAttributes'],function(_0x3d468c){return{'name':_0x3d468c[_0x07e7('0x2b')],'type':_0x3d468c['type']['key']};});_0x383c2d[_0x07e7('0x2c')]=_[_0x07e7('0x29')](_0x4ea8a4,_0x07e7('0x27'));_0x383c2d[_0x07e7('0x2d')]=_[_0x07e7('0x2e')](_0x64f62b[_0x07e7('0x2d')]);_0x383c2d[_0x07e7('0x2f')]=_[_0x07e7('0x30')](_0x383c2d[_0x07e7('0x2c')],_0x383c2d[_0x07e7('0x2d')]);_0x257c92[_0x07e7('0x31')]=_[_0x07e7('0x30')](_0x383c2d[_0x07e7('0x2c')],qs['fields'](_0x64f62b[_0x07e7('0x2d')]['fields']));_0x257c92['attributes']=_0x257c92['attributes'][_0x07e7('0x32')]?_0x257c92['attributes']:_0x383c2d[_0x07e7('0x2c')];if(!_0x64f62b[_0x07e7('0x2d')][_0x07e7('0x33')](_0x07e7('0x34'))){_0x257c92['limit']=qs[_0x07e7('0x1d')](_0x64f62b['query'][_0x07e7('0x1d')]);_0x257c92[_0x07e7('0x1c')]=qs[_0x07e7('0x1c')](_0x64f62b[_0x07e7('0x2d')][_0x07e7('0x1c')]);}_0x257c92[_0x07e7('0x35')]=qs[_0x07e7('0x36')](_0x64f62b[_0x07e7('0x2d')][_0x07e7('0x36')]);_0x257c92['where']=qs['filters'](_[_0x07e7('0x37')](_0x64f62b['query'],_0x383c2d[_0x07e7('0x2f')]));if(_0x64f62b['query'][_0x07e7('0x38')]){_0x257c92['where']=_[_0x07e7('0x39')](_0x257c92[_0x07e7('0x3a')],{'$or':_['map'](_0x4ea8a4,function(_0x45dbc9){if(_0x45dbc9['type']!==_0x07e7('0x3b')){var _0x40fd5f={};_0x40fd5f[_0x45dbc9['name']]={'$like':'%'+_0x64f62b[_0x07e7('0x2d')][_0x07e7('0x38')]+'%'};return _0x40fd5f;}})});}_0x257c92=_['merge']({},_0x257c92,_0x64f62b[_0x07e7('0x3c')]);var _0x1f2547={'where':_0x257c92[_0x07e7('0x3a')]};return db['AnalyticDefaultReport']['count'](_0x1f2547)['then'](function(_0xee4001){_0x30b712['count']=_0xee4001;if(_0x64f62b[_0x07e7('0x2d')][_0x07e7('0x3d')]){_0x257c92['include']=[{'all':!![]}];}return db[_0x07e7('0x2a')][_0x07e7('0x3e')](_0x257c92);})['then'](function(_0x3a2f67){_0x30b712['rows']=_0x3a2f67;return _0x30b712;})[_0x07e7('0x20')](respondWithFilteredResult(_0x3f3eab,_0x257c92))[_0x07e7('0x3f')](handleError(_0x3f3eab,null));};exports[_0x07e7('0x40')]=function(_0x358ce1,_0x10c9ba){var _0x3c4ccc={'raw':!![],'where':{'id':_0x358ce1[_0x07e7('0x41')]['id']}},_0x5b1319={};_0x5b1319['model']=_[_0x07e7('0x2e')](db[_0x07e7('0x2a')]['rawAttributes']);_0x5b1319[_0x07e7('0x2d')]=_[_0x07e7('0x2e')](_0x358ce1['query']);_0x5b1319[_0x07e7('0x2f')]=_[_0x07e7('0x30')](_0x5b1319['model'],_0x5b1319['query']);_0x3c4ccc['attributes']=_[_0x07e7('0x30')](_0x5b1319[_0x07e7('0x2c')],qs['fields'](_0x358ce1[_0x07e7('0x2d')][_0x07e7('0x42')]));_0x3c4ccc['attributes']=_0x3c4ccc[_0x07e7('0x31')]['length']?_0x3c4ccc[_0x07e7('0x31')]:_0x5b1319[_0x07e7('0x2c')];if(_0x358ce1[_0x07e7('0x2d')][_0x07e7('0x3d')]){_0x3c4ccc['include']=[{'all':!![]}];}_0x3c4ccc=_[_0x07e7('0x39')]({},_0x3c4ccc,_0x358ce1[_0x07e7('0x3c')]);return db[_0x07e7('0x2a')][_0x07e7('0x43')](_0x3c4ccc)[_0x07e7('0x20')](handleEntityNotFound(_0x10c9ba,null))[_0x07e7('0x20')](respondWithResult(_0x10c9ba,null))['catch'](handleError(_0x10c9ba,null));};exports['create']=function(_0x42e439,_0x3bdfea){return db[_0x07e7('0x2a')][_0x07e7('0x44')](_0x42e439['body'],{})[_0x07e7('0x20')](function(_0x346fc9){var _0x3f00ec=_0x42e439[_0x07e7('0x45')][_0x07e7('0x21')]({'plain':!![]});if(!_0x3f00ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f00ec[_0x07e7('0x46')]===_0x07e7('0x45')){var _0x338a5f=_0x346fc9[_0x07e7('0x21')]({'plain':!![]});var _0x5a923c=_0x07e7('0x47');return db[_0x07e7('0x48')][_0x07e7('0x43')]({'where':{'name':_0x5a923c,'userProfileId':_0x3f00ec[_0x07e7('0x49')]},'raw':!![]})['then'](function(_0x365b07){if(_0x365b07&&_0x365b07[_0x07e7('0x4a')]===0x0){return db[_0x07e7('0x23')]['create']({'name':_0x338a5f[_0x07e7('0x27')],'resourceId':_0x338a5f['id'],'type':'DefaultReports','sectionId':_0x365b07['id']},{})[_0x07e7('0x20')](function(){return _0x346fc9;});}else{return _0x346fc9;}})[_0x07e7('0x3f')](function(_0xfd48ca){logger[_0x07e7('0x26')](_0x07e7('0x4b'),_0xfd48ca);throw _0xfd48ca;});}return _0x346fc9;})[_0x07e7('0x20')](respondWithResult(_0x3bdfea,0xc9))[_0x07e7('0x3f')](handleError(_0x3bdfea,null));};exports['update']=function(_0x17287e,_0x51ce91){if(_0x17287e[_0x07e7('0x4c')]['id']){delete _0x17287e[_0x07e7('0x4c')]['id'];}return db[_0x07e7('0x2a')]['find']({'where':{'id':_0x17287e['params']['id']}})[_0x07e7('0x20')](handleEntityNotFound(_0x51ce91,null))[_0x07e7('0x20')](saveUpdates(_0x17287e[_0x07e7('0x4c')],null))[_0x07e7('0x20')](respondWithResult(_0x51ce91,null))[_0x07e7('0x3f')](handleError(_0x51ce91,null));};exports[_0x07e7('0x24')]=function(_0x2d8ad9,_0x372c16){return db[_0x07e7('0x2a')][_0x07e7('0x43')]({'where':{'id':_0x2d8ad9[_0x07e7('0x41')]['id']}})[_0x07e7('0x20')](handleEntityNotFound(_0x372c16,null))[_0x07e7('0x20')](removeEntity(_0x372c16,null))['catch'](handleError(_0x372c16,null));};exports[_0x07e7('0x4d')]=function(_0x1c8ead,_0x289e19){var _0x21fcfd=0xa;var _0x590bb8=[_0x07e7('0x4e'),'left_join',_0x07e7('0x4f'),_0x07e7('0x50')];var _0x32b3a4={'SUM':_0x07e7('0x51'),'COUNT':_0x07e7('0x52'),'COUNT DISTINCT':_0x07e7('0x53'),'MAX':_0x07e7('0x54'),'MIN':_0x07e7('0x55'),'AVG':_0x07e7('0x56'),'GROUP_CONCAT':_0x07e7('0x57'),'GROUP_CONCAT ASC':_0x07e7('0x58'),'GROUP_CONCAT DESC':_0x07e7('0x59')};var _0x1680a5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x07e7('0x5a'),'ROUND':_0x07e7('0x5b'),'UNIX_TIMESTAMP':_0x07e7('0x5c')};var _0x2a5452=function(_0x524396){return!_[_0x07e7('0x5d')]([_0x07e7('0x5e'),_0x07e7('0x5f'),_0x07e7('0x60'),'IS\x20NOT\x20EMPTY'],_0x524396);};var _0x81871b=function(_0x4e63e8){if(!_0x4e63e8||!_0x4e63e8['rules'][_0x07e7('0x32')]){return'';}for(var _0x26b23c='(',_0x20ae34=0x0;_0x20ae34<_0x4e63e8[_0x07e7('0x61')][_0x07e7('0x32')];_0x20ae34+=0x1){_0x20ae34>0x0&&(_0x26b23c+='\x20'+_0x4e63e8['operator']+'\x20');_0x26b23c+=_0x4e63e8['rules'][_0x20ae34][_0x07e7('0x62')]?_0x81871b(_0x4e63e8[_0x07e7('0x61')][_0x20ae34]['group']):_0x4e63e8[_0x07e7('0x61')][_0x20ae34][_0x07e7('0x63')]+'\x20'+_0x4e63e8[_0x07e7('0x61')][_0x20ae34][_0x07e7('0x64')]+(_0x2a5452(_0x4e63e8[_0x07e7('0x61')][_0x20ae34][_0x07e7('0x64')])?'\x20'+_0x4e63e8[_0x07e7('0x61')][_0x20ae34]['value']:'');}return _0x26b23c+')';};var _0x34a94f={'where':{'id':_0x1c8ead['params']['id']}},_0x12cdef,_0x468c16,_0x47144c,_0x9e14f2,_0x3aae7c;_0x34a94f=_['merge']({},_0x34a94f,_0x1c8ead['options']);return db['AnalyticDefaultReport'][_0x07e7('0x43')](_0x34a94f)[_0x07e7('0x20')](function(_0x39c3ef){if(_0x39c3ef){_0x12cdef=_0x39c3ef;return _0x39c3ef['getFields']();}return null;})[_0x07e7('0x20')](function(_0x4c88cf){if(_0x4c88cf){if(!_0x4c88cf[_0x07e7('0x32')]){throw new db[(_0x07e7('0x65'))][(_0x07e7('0x66'))](_0x07e7('0x67'),0x193);}_0x468c16=_0x4c88cf;return db[_0x07e7('0x68')][_0x07e7('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x364b29){if(_0x364b29){_0x47144c=_[_0x07e7('0x69')](_0x364b29,'id');var _0x510937;var _0x4e7a3a=squel[_0x07e7('0x6a')]();_0x4e7a3a[_0x07e7('0x6b')](_0x12cdef[_0x07e7('0x6c')]);for(var _0x495cd9=0x0;_0x495cd9<_0x468c16[_0x07e7('0x32')];_0x495cd9+=0x1){_0x510937=_0x468c16[_0x495cd9][_0x07e7('0x6d')]?_0x47144c[_0x468c16[_0x495cd9]['MetricId']][_0x07e7('0x6e')]:_0x468c16[_0x495cd9][_0x07e7('0x63')];_0x510937=_0x468c16[_0x495cd9][_0x07e7('0x6f')]?_[_0x07e7('0x70')](_0x32b3a4[_0x468c16[_0x495cd9][_0x07e7('0x6f')]],'%s',_0x510937):_0x510937;_0x510937=_0x468c16[_0x495cd9]['format']?_[_0x07e7('0x70')](_0x1680a5[_0x468c16[_0x495cd9]['format']],'%s',_0x510937):_0x510937;if(_0x468c16[_0x495cd9][_0x07e7('0x71')]){_0x4e7a3a['group'](_0x510937);}_0x468c16[_0x495cd9][_0x07e7('0x72')]&&_0x4e7a3a[_0x07e7('0x35')](_0x510937,_0x468c16[_0x495cd9][_0x07e7('0x72')]===_0x07e7('0x73')?![]:!![]);_0x4e7a3a[_0x07e7('0x63')](_0x510937,_0x468c16[_0x495cd9]['alias']||_0x510937);}if(_0x12cdef[_0x07e7('0x74')]){_0x12cdef['joins']=JSON['parse'](_0x12cdef[_0x07e7('0x74')]);for(var _0x3da1b5=0x0;_0x3da1b5<_0x12cdef['joins'][_0x07e7('0x32')];_0x3da1b5+=0x1){if(_0x12cdef[_0x07e7('0x74')][_0x3da1b5][_0x07e7('0x75')]&&_[_0x07e7('0x5d')](_0x590bb8,_0x12cdef[_0x07e7('0x74')][_0x3da1b5][_0x07e7('0x75')])&&_0x12cdef[_0x07e7('0x74')][_0x3da1b5][_0x07e7('0x76')]&&_0x12cdef['joins'][_0x3da1b5][_0x07e7('0x77')]&&_0x12cdef[_0x07e7('0x74')][_0x3da1b5][_0x07e7('0x78')]){_0x4e7a3a[_0x12cdef['joins'][_0x3da1b5][_0x07e7('0x75')]](_0x12cdef[_0x07e7('0x74')][_0x3da1b5]['foreignTable'],null,util[_0x07e7('0x79')]('%s.%s\x20=\x20%s.%s',_0x12cdef[_0x07e7('0x6c')],_0x12cdef['joins'][_0x3da1b5][_0x07e7('0x76')],_0x12cdef[_0x07e7('0x74')][_0x3da1b5]['foreignTable'],_0x12cdef[_0x07e7('0x74')][_0x3da1b5][_0x07e7('0x78')]));}}}if(_0x12cdef[_0x07e7('0x7a')]){_0x12cdef[_0x07e7('0x7a')]=JSON[_0x07e7('0x7b')](_0x12cdef[_0x07e7('0x7a')]);_0x4e7a3a['where'](_0x81871b(_0x12cdef[_0x07e7('0x7a')][_0x07e7('0x62')]));}_0x3aae7c=_0x4e7a3a[_0x07e7('0x7c')]();_0x4e7a3a['limit'](_0x21fcfd);_0x4e7a3a[_0x07e7('0x1c')](0x0);logger[_0x07e7('0x7d')]('Limited\x20Query:',_0x4e7a3a['toString']());return db[_0x07e7('0x7e')][_0x07e7('0x2d')](_0x4e7a3a['toString'](),{'type':db[_0x07e7('0x7e')]['QueryTypes'][_0x07e7('0x7f')]});}})['then'](respondWithResult(_0x289e19,null))[_0x07e7('0x3f')](handleError(_0x289e19,null));};function runReport(_0x235d04,_0x390c7f,_0x2f4c93){var _0x3e7015=_0x390c7f[_0x07e7('0x27')];var _0x34b82d=0xa;var _0x4020f4=[_0x07e7('0x4e'),_0x07e7('0x80'),_0x07e7('0x4f'),_0x07e7('0x50')];var _0xc5b550={'SUM':_0x07e7('0x51'),'COUNT':_0x07e7('0x52'),'COUNT DISTINCT':_0x07e7('0x53'),'MAX':_0x07e7('0x54'),'MIN':_0x07e7('0x55'),'AVG':_0x07e7('0x56'),'GROUP_CONCAT':_0x07e7('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x07e7('0x59')};var _0x1f9cf2={'SEC_TO_TIME':_0x07e7('0x81'),'DATE':_0x07e7('0x82'),'HOUR':_0x07e7('0x5a'),'ROUND':_0x07e7('0x5b'),'UNIX_TIMESTAMP':_0x07e7('0x5c')};var _0x2b270c=function(_0x2f5655){return!_[_0x07e7('0x5d')](['IS\x20NULL',_0x07e7('0x5f'),_0x07e7('0x60'),_0x07e7('0x83')],_0x2f5655);};var _0xdce8a5=function(_0x4bcf8e){if(!_0x4bcf8e||!_0x4bcf8e[_0x07e7('0x61')][_0x07e7('0x32')]){return'';}for(var _0x1c7d10='(',_0x34209c=0x0;_0x34209c<_0x4bcf8e[_0x07e7('0x61')][_0x07e7('0x32')];_0x34209c+=0x1){_0x34209c>0x0&&(_0x1c7d10+='\x20'+_0x4bcf8e[_0x07e7('0x84')]+'\x20');_0x1c7d10+=_0x4bcf8e[_0x07e7('0x61')][_0x34209c][_0x07e7('0x62')]?_0xdce8a5(_0x4bcf8e[_0x07e7('0x61')][_0x34209c]['group']):_0x4bcf8e[_0x07e7('0x61')][_0x34209c][_0x07e7('0x63')]+'\x20'+_0x4bcf8e[_0x07e7('0x61')][_0x34209c][_0x07e7('0x64')]+(_0x2b270c(_0x4bcf8e[_0x07e7('0x61')][_0x34209c][_0x07e7('0x64')])?'\x20'+_0x4bcf8e[_0x07e7('0x61')][_0x34209c][_0x07e7('0x85')]:'');}return _0x1c7d10+')';};var _0x58432c={'where':{'id':_0x235d04['id']}},_0x225403,_0x473160,_0xa65879,_0x1efc13,_0x2cc170;_0x58432c=_[_0x07e7('0x39')]({},_0x58432c,_0x2f4c93);return db[_0x07e7('0x2a')]['find'](_0x58432c)[_0x07e7('0x20')](function(_0x22adb1){if(_0x22adb1){_0x225403=_0x22adb1;return _0x22adb1[_0x07e7('0x86')]();}return null;})[_0x07e7('0x20')](function(_0x439f9b){if(_0x439f9b){if(!_0x439f9b[_0x07e7('0x32')]){throw new db[(_0x07e7('0x65'))][(_0x07e7('0x66'))](_0x07e7('0x67'),0x193);}_0x473160=_0x439f9b;return db[_0x07e7('0x68')][_0x07e7('0x3e')]({'raw':!![]});}return null;})[_0x07e7('0x20')](function(_0x4247d3){if(_0x4247d3){_0xa65879=_[_0x07e7('0x69')](_0x4247d3,'id');var _0xc3f319;var _0x504eac=squel[_0x07e7('0x6a')]();_0x504eac['from'](_0x225403['table']);for(var _0x2887fd=0x0;_0x2887fd<_0x473160[_0x07e7('0x32')];_0x2887fd+=0x1){_0xc3f319=_0x473160[_0x2887fd][_0x07e7('0x6d')]?_0xa65879[_0x473160[_0x2887fd][_0x07e7('0x6d')]][_0x07e7('0x6e')]:_0x473160[_0x2887fd]['field'];_0xc3f319=_0x473160[_0x2887fd][_0x07e7('0x6f')]?_[_0x07e7('0x70')](_0xc5b550[_0x473160[_0x2887fd][_0x07e7('0x6f')]],'%s',_0xc3f319):_0xc3f319;_0xc3f319=_0x473160[_0x2887fd][_0x07e7('0x79')]?_['replace'](_0x1f9cf2[_0x473160[_0x2887fd][_0x07e7('0x79')]],'%s',_0xc3f319):_0xc3f319;if(_0x473160[_0x2887fd][_0x07e7('0x71')]){_0x504eac['group'](_0xc3f319);}_0x473160[_0x2887fd]['orderBy']&&_0x504eac[_0x07e7('0x35')](_0xc3f319,_0x473160[_0x2887fd][_0x07e7('0x72')]==='DESC'?![]:!![]);_0x504eac[_0x07e7('0x63')](_0xc3f319,_0x473160[_0x2887fd][_0x07e7('0x87')]||_0xc3f319);}if(_0x225403['joins']){_0x225403['joins']=JSON['parse'](_0x225403[_0x07e7('0x74')]);for(var _0x5a0eb5=0x0;_0x5a0eb5<_0x225403[_0x07e7('0x74')][_0x07e7('0x32')];_0x5a0eb5+=0x1){if(_0x225403[_0x07e7('0x74')][_0x5a0eb5][_0x07e7('0x75')]&&_[_0x07e7('0x5d')](_0x4020f4,_0x225403[_0x07e7('0x74')][_0x5a0eb5][_0x07e7('0x75')])&&_0x225403['joins'][_0x5a0eb5]['parentKey']&&_0x225403[_0x07e7('0x74')][_0x5a0eb5][_0x07e7('0x77')]&&_0x225403[_0x07e7('0x74')][_0x5a0eb5][_0x07e7('0x78')]){_0x504eac[_0x225403[_0x07e7('0x74')][_0x5a0eb5]['type']](_0x225403[_0x07e7('0x74')][_0x5a0eb5][_0x07e7('0x77')],null,util[_0x07e7('0x79')](_0x07e7('0x88'),_0x225403[_0x07e7('0x6c')],_0x225403[_0x07e7('0x74')][_0x5a0eb5]['parentKey'],_0x225403[_0x07e7('0x74')][_0x5a0eb5][_0x07e7('0x77')],_0x225403[_0x07e7('0x74')][_0x5a0eb5][_0x07e7('0x78')]));}}}if(_0x225403[_0x07e7('0x7a')]){_0x225403[_0x07e7('0x7a')]=JSON['parse'](_0x225403['conditions']);_0x504eac[_0x07e7('0x3a')](_0xdce8a5(_0x225403['conditions']['group']));}_0x2cc170=_0x504eac[_0x07e7('0x7c')]();_0x504eac[_0x07e7('0x1d')](_0x34b82d);_0x504eac[_0x07e7('0x1c')](0x0);logger[_0x07e7('0x7d')](_0x07e7('0x89'),_0x504eac[_0x07e7('0x8a')]());return db['sequelize']['query'](_0x504eac['toString'](),{'type':db['sequelize'][_0x07e7('0x8b')][_0x07e7('0x7f')]});}})['then'](function(_0x309a6a){if(!_0x309a6a[_0x07e7('0x32')]){throw new db[(_0x07e7('0x65'))]['ValidationErrorItem'](_0x07e7('0x8c'),0xcc);}if(_0x390c7f[_0x07e7('0x8d')]===_0x07e7('0x8e')){return null;}var _0x3bd6cc=_[_0x07e7('0x39')](_0x390c7f,{'name':_0x390c7f[_0x07e7('0x8f')]||_0x390c7f[_0x07e7('0x27')]||_0x225403[_0x07e7('0x27')],'basename':_0x3e7015,'savename':util[_0x07e7('0x79')](_0x07e7('0x90'),_0x390c7f[_0x07e7('0x27')]||_0x225403[_0x07e7('0x27')],require(_0x07e7('0x91'))[_0x07e7('0x92')](0x4),_0x390c7f['output']||_0x07e7('0x93')),'reportId':_0x225403['id'],'reportType':_0x07e7('0x94')});return db[_0x07e7('0x95')][_0x07e7('0x44')](_0x3bd6cc,{'raw':!![]});})[_0x07e7('0x20')](function(_0x361fef){if(_0x225403[_0x07e7('0x6c')]===_0x07e7('0x96')){_0x2cc170['where'](_0x225403[_0x07e7('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x390c7f['startDate'],_0x390c7f[_0x07e7('0x97')]);}else{_0x2cc170[_0x07e7('0x3a')](_0x225403[_0x07e7('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x390c7f['startDate'],_0x390c7f[_0x07e7('0x97')]);}if(_0x361fef){logger[_0x07e7('0x98')](_0x07e7('0x99'),_0x2cc170['toString']());require(_0x07e7('0x9a'))[_0x07e7('0x9b')](path['join'](__dirname,'../../components/export/',_0x361fef[_0x07e7('0x8d')]),[_0x361fef['id'],_0x2cc170[_0x07e7('0x8a')](),path[_0x07e7('0x4e')](__dirname,_0x07e7('0x9c'),_0x361fef[_0x07e7('0x9d')]),_0x3e7015]);return _0x361fef;}else{var _0x25e2b5=squel['select']();_0x25e2b5[_0x07e7('0x6b')]('('+_0x2cc170['toString']()+')',_0x07e7('0x9e'));_0x25e2b5[_0x07e7('0x63')]('COUNT(*)',_0x07e7('0x1b'));_0x2cc170[_0x07e7('0x1d')](_0x390c7f[_0x07e7('0x1d')]||_0x34b82d);_0x2cc170[_0x07e7('0x1c')](_0x390c7f[_0x07e7('0x1c')]||0x0);return db[_0x07e7('0x7e')][_0x07e7('0x2d')](_0x25e2b5[_0x07e7('0x8a')](),{'type':db[_0x07e7('0x7e')]['QueryTypes'][_0x07e7('0x7f')]})[_0x07e7('0x20')](function(_0x1a08dc){if(!_0x1a08dc['length']){_0x1efc13=0x0;}else{_0x1efc13=_0x1a08dc[0x0][_0x07e7('0x1b')]||0x0;}return db[_0x07e7('0x7e')][_0x07e7('0x2d')](_0x2cc170[_0x07e7('0x8a')](),{'type':db['sequelize'][_0x07e7('0x8b')]['SELECT']});})['then'](function(_0x34dfa6){return{'rows':_0x34dfa6||[],'count':_0x1efc13};});}});}exports[_0x07e7('0x9f')]=function(_0x439ba3,_0x349ff5){return runReport(_0x439ba3[_0x07e7('0x41')],_0x439ba3[_0x07e7('0x2d')],_0x439ba3['options'])['then'](respondWithResult(_0x349ff5,null))['catch'](handleError(_0x349ff5,null));};exports[_0x07e7('0xa0')]=runReport;exports[_0x07e7('0x2d')]=function(_0x223bba,_0x4afead){var _0x32c037=0xa;var _0x31e3e8=[_0x07e7('0x4e'),_0x07e7('0x80'),_0x07e7('0x4f'),_0x07e7('0x50')];var _0x198d51={'SUM':_0x07e7('0x51'),'COUNT':_0x07e7('0x52'),'COUNT DISTINCT':_0x07e7('0x53'),'MAX':_0x07e7('0x54'),'MIN':'MIN(%s)','AVG':_0x07e7('0x56'),'GROUP_CONCAT':_0x07e7('0x57'),'GROUP_CONCAT ASC':_0x07e7('0x58'),'GROUP_CONCAT DESC':_0x07e7('0x59')};var _0x4eebfb={'SEC_TO_TIME':_0x07e7('0x81'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x07e7('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x336231=function(_0xc62c11){return!_[_0x07e7('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xc62c11);};var _0x2a2d70=function(_0x1a8e74){if(!_0x1a8e74||!_0x1a8e74[_0x07e7('0x61')]['length']){return'';}for(var _0x5cec91='(',_0x11ed98=0x0;_0x11ed98<_0x1a8e74[_0x07e7('0x61')][_0x07e7('0x32')];_0x11ed98+=0x1){_0x11ed98>0x0&&(_0x5cec91+='\x20'+_0x1a8e74[_0x07e7('0x84')]+'\x20');_0x5cec91+=_0x1a8e74[_0x07e7('0x61')][_0x11ed98][_0x07e7('0x62')]?_0x2a2d70(_0x1a8e74['rules'][_0x11ed98]['group']):_0x1a8e74[_0x07e7('0x61')][_0x11ed98][_0x07e7('0x63')]+'\x20'+_0x1a8e74['rules'][_0x11ed98]['condition']+(_0x336231(_0x1a8e74[_0x07e7('0x61')][_0x11ed98][_0x07e7('0x64')])?'\x20'+_0x1a8e74[_0x07e7('0x61')][_0x11ed98][_0x07e7('0x85')]:'');}return _0x5cec91+')';};var _0xe2cc9b={'where':{'id':_0x223bba['params']['id']}},_0xa6adf4,_0x81c1dd,_0x4db0eb,_0x5d2208,_0x2477e8;_0xe2cc9b=_['merge']({},_0xe2cc9b,_0x223bba[_0x07e7('0x3c')]);return db['AnalyticDefaultReport'][_0x07e7('0x43')](_0xe2cc9b)[_0x07e7('0x20')](function(_0x3efbee){if(_0x3efbee){_0xa6adf4=_0x3efbee;return _0x3efbee['getFields']();}return null;})[_0x07e7('0x20')](function(_0x44536f){if(_0x44536f){if(!_0x44536f[_0x07e7('0x32')]){throw new db[(_0x07e7('0x65'))][(_0x07e7('0x66'))](_0x07e7('0x67'),0x193);}_0x81c1dd=_0x44536f;return db[_0x07e7('0x68')][_0x07e7('0x3e')]({'raw':!![]});}return null;})[_0x07e7('0x20')](function(_0x53b391){if(_0x53b391){_0x4db0eb=_['keyBy'](_0x53b391,'id');var _0x15b0c6;var _0x10ff5f=squel['select']();_0x10ff5f[_0x07e7('0x6b')](_0xa6adf4[_0x07e7('0x6c')]);for(var _0x491b0c=0x0;_0x491b0c<_0x81c1dd[_0x07e7('0x32')];_0x491b0c+=0x1){_0x15b0c6=_0x81c1dd[_0x491b0c][_0x07e7('0x6d')]?_0x4db0eb[_0x81c1dd[_0x491b0c][_0x07e7('0x6d')]][_0x07e7('0x6e')]:_0x81c1dd[_0x491b0c][_0x07e7('0x63')];_0x15b0c6=_0x81c1dd[_0x491b0c]['function']?_[_0x07e7('0x70')](_0x198d51[_0x81c1dd[_0x491b0c]['function']],'%s',_0x15b0c6):_0x15b0c6;_0x15b0c6=_0x81c1dd[_0x491b0c][_0x07e7('0x79')]?_[_0x07e7('0x70')](_0x4eebfb[_0x81c1dd[_0x491b0c][_0x07e7('0x79')]],'%s',_0x15b0c6):_0x15b0c6;if(_0x81c1dd[_0x491b0c][_0x07e7('0x71')]){_0x10ff5f[_0x07e7('0x62')](_0x15b0c6);}_0x81c1dd[_0x491b0c][_0x07e7('0x72')]&&_0x10ff5f[_0x07e7('0x35')](_0x15b0c6,_0x81c1dd[_0x491b0c][_0x07e7('0x72')]==='DESC'?![]:!![]);_0x10ff5f[_0x07e7('0x63')](_0x15b0c6,_0x81c1dd[_0x491b0c][_0x07e7('0x87')]||_0x15b0c6);}if(_0xa6adf4[_0x07e7('0x74')]){_0xa6adf4[_0x07e7('0x74')]=JSON[_0x07e7('0x7b')](_0xa6adf4[_0x07e7('0x74')]);for(var _0x8e463e=0x0;_0x8e463e<_0xa6adf4[_0x07e7('0x74')][_0x07e7('0x32')];_0x8e463e+=0x1){if(_0xa6adf4[_0x07e7('0x74')][_0x8e463e][_0x07e7('0x75')]&&_[_0x07e7('0x5d')](_0x31e3e8,_0xa6adf4[_0x07e7('0x74')][_0x8e463e][_0x07e7('0x75')])&&_0xa6adf4[_0x07e7('0x74')][_0x8e463e][_0x07e7('0x76')]&&_0xa6adf4[_0x07e7('0x74')][_0x8e463e][_0x07e7('0x77')]&&_0xa6adf4['joins'][_0x8e463e][_0x07e7('0x78')]){_0x10ff5f[_0xa6adf4[_0x07e7('0x74')][_0x8e463e][_0x07e7('0x75')]](_0xa6adf4['joins'][_0x8e463e][_0x07e7('0x77')],null,util['format'](_0x07e7('0x88'),_0xa6adf4[_0x07e7('0x6c')],_0xa6adf4[_0x07e7('0x74')][_0x8e463e][_0x07e7('0x76')],_0xa6adf4[_0x07e7('0x74')][_0x8e463e][_0x07e7('0x77')],_0xa6adf4[_0x07e7('0x74')][_0x8e463e][_0x07e7('0x78')]));}}}if(_0xa6adf4['conditions']){_0xa6adf4['conditions']=JSON[_0x07e7('0x7b')](_0xa6adf4['conditions']);_0x10ff5f[_0x07e7('0x3a')](_0x2a2d70(_0xa6adf4[_0x07e7('0x7a')]['group']));}_0x2477e8=_0x10ff5f[_0x07e7('0x7c')]();_0x10ff5f[_0x07e7('0x1d')](_0x32c037);_0x10ff5f['offset'](0x0);logger[_0x07e7('0x7d')](_0x07e7('0x89'),_0x10ff5f[_0x07e7('0x8a')]());return db['sequelize']['query'](_0x10ff5f[_0x07e7('0x8a')](),{'type':db['sequelize'][_0x07e7('0x8b')][_0x07e7('0x7f')]});}})['then'](function(){return{'sql':_0x2477e8[_0x07e7('0x8a')]()};})['then'](respondWithResult(_0x4afead,null))[_0x07e7('0x3f')](handleError(_0x4afead,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index c05d4da..6a1a684 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 _0x14e0=['api','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x203868,_0x107f02){var _0x618dd0=function(_0x3af5d2){while(--_0x3af5d2){_0x203868['push'](_0x203868['shift']());}};_0x618dd0(++_0x107f02);}(_0x14e0,0x11d));var _0x014e=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0x14e0[_0x1c3370];return _0xa9b358;};'use strict';var _=require(_0x014e('0x0'));var util=require(_0x014e('0x1'));var logger=require(_0x014e('0x2'))(_0x014e('0x3'));var moment=require(_0x014e('0x4'));var BPromise=require(_0x014e('0x5'));var rp=require(_0x014e('0x6'));var fs=require('fs');var path=require(_0x014e('0x7'));var rimraf=require('rimraf');var config=require(_0x014e('0x8'));var attributes=require(_0x014e('0x9'));module[_0x014e('0xa')]=function(_0x6c2be6,_0x53b3d5){return _0x6c2be6['define']('AnalyticDefaultReport',attributes,{'tableName':_0x014e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5ef=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1d7907,_0x131382){var _0x4656fa=function(_0x440fd6){while(--_0x440fd6){_0x1d7907['push'](_0x1d7907['shift']());}};_0x4656fa(++_0x131382);}(_0xa5ef,0x120));var _0xfa5e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xa5ef[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0xfa5e('0x0'));var util=require(_0xfa5e('0x1'));var logger=require(_0xfa5e('0x2'))(_0xfa5e('0x3'));var moment=require(_0xfa5e('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa5e('0x5'));var fs=require('fs');var path=require(_0xfa5e('0x6'));var rimraf=require(_0xfa5e('0x7'));var config=require(_0xfa5e('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0xfa5e('0x9')]=function(_0x16df33,_0x595f89){return _0x16df33[_0xfa5e('0xa')](_0xfa5e('0xb'),attributes,{'tableName':_0xfa5e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index e7f925f..8aeb319 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 _0xca56=['AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x378b6b,_0x3b8cbe){var _0x1408ba=function(_0xad7d44){while(--_0xad7d44){_0x378b6b['push'](_0x378b6b['shift']());}};_0x1408ba(++_0x3b8cbe);}(_0xca56,0xee));var _0x6ca5=function(_0x5d718c,_0x10f30a){_0x5d718c=_0x5d718c-0x0;var _0x34b5b4=_0xca56[_0x5d718c];return _0x34b5b4;};'use strict';var _=require(_0x6ca5('0x0'));var util=require(_0x6ca5('0x1'));var moment=require(_0x6ca5('0x2'));var BPromise=require(_0x6ca5('0x3'));var rs=require(_0x6ca5('0x4'));var fs=require('fs');var Redis=require(_0x6ca5('0x5'));var db=require(_0x6ca5('0x6'))['db'];var utils=require(_0x6ca5('0x7'));var logger=require(_0x6ca5('0x8'))('rpc');var config=require(_0x6ca5('0x9'));var jayson=require(_0x6ca5('0xa'));var client=jayson[_0x6ca5('0xb')][_0x6ca5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x529cbe,_0x3b2f91,_0x232b31){return new BPromise(function(_0x511b48,_0x586799){return client[_0x6ca5('0xd')](_0x529cbe,_0x232b31)[_0x6ca5('0xe')](function(_0x1d5253){logger[_0x6ca5('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3b2f91,'request\x20sent');logger[_0x6ca5('0x10')](_0x6ca5('0x11'),_0x3b2f91,_0x6ca5('0x12'),JSON[_0x6ca5('0x13')](_0x1d5253));if(_0x1d5253[_0x6ca5('0x14')]){if(_0x1d5253['error'][_0x6ca5('0x15')]===0x1f4){logger['error'](_0x6ca5('0x16'),_0x3b2f91,_0x1d5253['error']['message']);return _0x586799(_0x1d5253[_0x6ca5('0x14')]['message']);}logger['error'](_0x6ca5('0x16'),_0x3b2f91,_0x1d5253[_0x6ca5('0x14')]['message']);return _0x511b48(_0x1d5253[_0x6ca5('0x14')][_0x6ca5('0x17')]);}else{logger['info'](_0x6ca5('0x16'),_0x3b2f91,_0x6ca5('0x12'));_0x511b48(_0x1d5253[_0x6ca5('0x18')][_0x6ca5('0x17')]);}})[_0x6ca5('0x19')](function(_0x48c164){logger[_0x6ca5('0x14')](_0x6ca5('0x16'),_0x3b2f91,_0x48c164);_0x586799(_0x48c164);});});} \ No newline at end of file +var _0xe7b9=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','request','then','info'];(function(_0x206b1d,_0x4628c6){var _0x445422=function(_0x5d2290){while(--_0x5d2290){_0x206b1d['push'](_0x206b1d['shift']());}};_0x445422(++_0x4628c6);}(_0xe7b9,0x170));var _0x9e7b=function(_0x4f63d1,_0x402449){_0x4f63d1=_0x4f63d1-0x0;var _0x5341f8=_0xe7b9[_0x4f63d1];return _0x5341f8;};'use strict';var _=require(_0x9e7b('0x0'));var util=require(_0x9e7b('0x1'));var moment=require(_0x9e7b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e7b('0x3'));var db=require(_0x9e7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e7b('0x5'));var config=require('../../config/environment');var jayson=require(_0x9e7b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e2f86,_0x377a75,_0x13a37d){return new BPromise(function(_0x5ed982,_0x46e445){return client[_0x9e7b('0x7')](_0x1e2f86,_0x13a37d)[_0x9e7b('0x8')](function(_0x128bac){logger[_0x9e7b('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x377a75,'request\x20sent');logger['debug'](_0x9e7b('0xa'),_0x377a75,_0x9e7b('0xb'),JSON[_0x9e7b('0xc')](_0x128bac));if(_0x128bac[_0x9e7b('0xd')]){if(_0x128bac[_0x9e7b('0xd')][_0x9e7b('0xe')]===0x1f4){logger['error'](_0x9e7b('0xf'),_0x377a75,_0x128bac[_0x9e7b('0xd')][_0x9e7b('0x10')]);return _0x46e445(_0x128bac[_0x9e7b('0xd')]['message']);}logger[_0x9e7b('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x377a75,_0x128bac[_0x9e7b('0xd')][_0x9e7b('0x10')]);return _0x5ed982(_0x128bac['error']['message']);}else{logger[_0x9e7b('0x9')](_0x9e7b('0xf'),_0x377a75,_0x9e7b('0xb'));_0x5ed982(_0x128bac['result'][_0x9e7b('0x10')]);}})[_0x9e7b('0x11')](function(_0x231db2){logger[_0x9e7b('0xd')](_0x9e7b('0xf'),_0x377a75,_0x231db2);_0x46e445(_0x231db2);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index b1e6dc1..944bf26 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 _0x1bfe=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/preview','preview','/:id/run','isAuthenticated','run','/:id/query','query','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4254e7,_0x4fc342){var _0x5e0844=function(_0x3a92c7){while(--_0x3a92c7){_0x4254e7['push'](_0x4254e7['shift']());}};_0x5e0844(++_0x4fc342);}(_0x1bfe,0x18c));var _0xe1bf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1bfe[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0xe1bf('0x0'));var util=require(_0xe1bf('0x1'));var path=require(_0xe1bf('0x2'));var timeout=require(_0xe1bf('0x3'));var express=require(_0xe1bf('0x4'));var router=express[_0xe1bf('0x5')]();var auth=require(_0xe1bf('0x6'));var interaction=require(_0xe1bf('0x7'));var config=require(_0xe1bf('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0xe1bf('0x9')]('/',auth['isAuthenticated'](),controller[_0xe1bf('0xa')]);router[_0xe1bf('0x9')](_0xe1bf('0xb'),auth['isAuthenticated'](),controller[_0xe1bf('0xc')]);router[_0xe1bf('0x9')](_0xe1bf('0xd'),auth['isAuthenticated'](),controller[_0xe1bf('0xe')]);router[_0xe1bf('0x9')](_0xe1bf('0xf'),auth[_0xe1bf('0x10')](),controller[_0xe1bf('0x11')]);router[_0xe1bf('0x9')](_0xe1bf('0x12'),auth[_0xe1bf('0x10')](),controller[_0xe1bf('0x13')]);router['post']('/',auth[_0xe1bf('0x10')](),controller[_0xe1bf('0x14')]);router[_0xe1bf('0x15')](_0xe1bf('0xb'),auth[_0xe1bf('0x10')](),controller['update']);router[_0xe1bf('0x16')](_0xe1bf('0xb'),auth[_0xe1bf('0x10')](),controller[_0xe1bf('0x17')]);module[_0xe1bf('0x18')]=router; \ No newline at end of file +var _0x81e3=['connect-timeout','express','Router','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','preview','run','/:id/query','query','post','put','delete','destroy','exports','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x81e3,0x1cb));var _0x381e=function(_0x329d13,_0x1aff27){_0x329d13=_0x329d13-0x0;var _0x33efd9=_0x81e3[_0x329d13];return _0x33efd9;};'use strict';var multer=require(_0x381e('0x0'));var util=require(_0x381e('0x1'));var path=require(_0x381e('0x2'));var timeout=require(_0x381e('0x3'));var express=require(_0x381e('0x4'));var router=express[_0x381e('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x381e('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0x381e('0x7')]('/',auth['isAuthenticated'](),controller[_0x381e('0x8')]);router[_0x381e('0x7')](_0x381e('0x9'),auth[_0x381e('0xa')](),controller[_0x381e('0xb')]);router['get'](_0x381e('0xc'),auth[_0x381e('0xa')](),controller[_0x381e('0xd')]);router[_0x381e('0x7')]('/:id/run',auth[_0x381e('0xa')](),controller[_0x381e('0xe')]);router[_0x381e('0x7')](_0x381e('0xf'),auth[_0x381e('0xa')](),controller[_0x381e('0x10')]);router[_0x381e('0x11')]('/',auth[_0x381e('0xa')](),controller['create']);router[_0x381e('0x12')](_0x381e('0x9'),auth[_0x381e('0xa')](),controller['update']);router[_0x381e('0x13')]('/:id',auth[_0x381e('0xa')](),controller[_0x381e('0x14')]);module[_0x381e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index c0fa227..64f2c08 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 _0x30db=['moment','exports','STRING','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x1b640f,_0x215390){var _0x560770=function(_0x5335ba){while(--_0x5335ba){_0x1b640f['push'](_0x1b640f['shift']());}};_0x560770(++_0x215390);}(_0x30db,0xd7));var _0xb30d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x30db[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xb30d('0x0'));var moment=require(_0xb30d('0x1'));module[_0xb30d('0x2')]={'name':{'type':Sequelize[_0xb30d('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xb30d('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xb30d('0x4'),_0xb30d('0x5'),_0xb30d('0x6')),'allowNull':![],'defaultValue':_0xb30d('0x4')},'savename':{'type':Sequelize[_0xb30d('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xb30d('0x7')]},'status':{'type':Sequelize[_0xb30d('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0xb30d('0x8'),_0xb30d('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xb30d('0xa')](0xb)[_0xb30d('0xb')]},'reportType':{'type':Sequelize[_0xb30d('0x3')]}}; \ No newline at end of file +var _0x8a02=['pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED','moment','exports','STRING','ENUM','csv'];(function(_0x591cf4,_0x555170){var _0x51725b=function(_0x4146d9){while(--_0x4146d9){_0x591cf4['push'](_0x591cf4['shift']());}};_0x51725b(++_0x555170);}(_0x8a02,0x7f));var _0x28a0=function(_0x236c01,_0x5cc77b){_0x236c01=_0x236c01-0x0;var _0x25f13b=_0x8a02[_0x236c01];return _0x25f13b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x28a0('0x0'));module[_0x28a0('0x1')]={'name':{'type':Sequelize[_0x28a0('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x28a0('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x28a0('0x3')](_0x28a0('0x4'),_0x28a0('0x5'),_0x28a0('0x6')),'allowNull':![],'defaultValue':_0x28a0('0x4')},'savename':{'type':Sequelize[_0x28a0('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x28a0('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x28a0('0x8')},'type':{'type':Sequelize[_0x28a0('0x3')](_0x28a0('0x9'),_0x28a0('0xa')),'allowNull':![],'defaultValue':_0x28a0('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x28a0('0xb')]},'reportType':{'type':Sequelize[_0x28a0('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index bf26c6e..9ba18c4 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 _0xcd93=['nolimit','limit','sort','where','merge','AnalyticExtractedReport','include','findAll','rows','show','params','rawAttributes','intersection','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','basename','savename','output','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','join','format','%s.%s','toLowerCase','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','status','count','offset','set','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','fieldName','type','model','filters','query','fields','attributes','length','hasOwnProperty'];(function(_0x59ed8c,_0x497c0f){var _0x2ae760=function(_0x5e0c08){while(--_0x5e0c08){_0x59ed8c['push'](_0x59ed8c['shift']());}};_0x2ae760(++_0x497c0f);}(_0xcd93,0x1dd));var _0x3cd9=function(_0x2e5a38,_0x3ecfa2){_0x2e5a38=_0x2e5a38-0x0;var _0x13165a=_0xcd93[_0x2e5a38];return _0x13165a;};'use strict';var pdf=require(_0x3cd9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3cd9('0x1'));var jsonpatch=require(_0x3cd9('0x2'));var rp=require(_0x3cd9('0x3'));var moment=require('moment');var BPromise=require(_0x3cd9('0x4'));var Mustache=require(_0x3cd9('0x5'));var util=require('util');var path=require(_0x3cd9('0x6'));var sox=require(_0x3cd9('0x7'));var csv=require(_0x3cd9('0x8'));var ejs=require(_0x3cd9('0x9'));var fs=require('fs');var _=require(_0x3cd9('0xa'));var squel=require(_0x3cd9('0xb'));var crypto=require(_0x3cd9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3cd9('0xd'));var toCsv=require(_0x3cd9('0x8'));var querystring=require(_0x3cd9('0xe'));var Papa=require('papaparse');var Redis=require(_0x3cd9('0xf'));var authService=require(_0x3cd9('0x10'));var qs=require(_0x3cd9('0x11'));var as=require(_0x3cd9('0x12'));var hardwareService=require(_0x3cd9('0x13'));var logger=require(_0x3cd9('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3cd9('0x15'))['db'];function respondWithStatusCode(_0x42b96f,_0x276a93){_0x276a93=_0x276a93||0xcc;return function(_0x63626f){if(_0x63626f){return _0x42b96f[_0x3cd9('0x16')](_0x276a93);}return _0x42b96f['status'](_0x276a93)[_0x3cd9('0x17')]();};}function respondWithResult(_0x149100,_0x1f8266){_0x1f8266=_0x1f8266||0xc8;return function(_0x5c652c){if(_0x5c652c){return _0x149100[_0x3cd9('0x18')](_0x1f8266)['json'](_0x5c652c);}};}function respondWithFilteredResult(_0x1364a4,_0x28df75){return function(_0x46a113){if(_0x46a113){var _0x349ff0=_0x46a113[_0x3cd9('0x19')],_0x2ecd98=_0x28df75['offset'],_0x21898d=_0x28df75[_0x3cd9('0x1a')]+_0x28df75['limit'],_0x4c832a;if(_0x21898d>=_0x349ff0){_0x21898d=_0x349ff0;_0x4c832a=0xc8;}else{_0x4c832a=0xce;}_0x1364a4[_0x3cd9('0x18')](_0x4c832a);return _0x1364a4[_0x3cd9('0x1b')]('Content-Range',_0x2ecd98+'-'+_0x21898d+'/'+_0x349ff0)['json'](_0x46a113);}return null;};}function patchUpdates(_0x92136){return function(_0x1ecbea){try{jsonpatch['apply'](_0x1ecbea,_0x92136,!![]);}catch(_0x1a88ee){return BPromise[_0x3cd9('0x1c')](_0x1a88ee);}return _0x1ecbea[_0x3cd9('0x1d')]();};}function saveUpdates(_0x4b1725,_0x55fcd8){return function(_0x5e4b0e){if(_0x5e4b0e){return _0x5e4b0e[_0x3cd9('0x1e')](_0x4b1725)[_0x3cd9('0x1f')](function(_0x366eed){return _0x366eed;});}return null;};}function removeEntity(_0xc7f23a,_0x53be92){return function(_0x237c18){if(_0x237c18){return _0x237c18[_0x3cd9('0x20')]()[_0x3cd9('0x1f')](function(){var _0x5ed1a9=_0x237c18[_0x3cd9('0x21')]({'plain':!![]});var _0x215bf7=_0x3cd9('0x22');return db[_0x3cd9('0x23')][_0x3cd9('0x20')]({'where':{'type':_0x215bf7,'resourceId':_0x5ed1a9['id']}})[_0x3cd9('0x1f')](function(){return _0x237c18;});})[_0x3cd9('0x1f')](function(){_0xc7f23a[_0x3cd9('0x18')](0xcc)[_0x3cd9('0x17')]();});}};}function handleEntityNotFound(_0x2ea889,_0x3a5db5){return function(_0x2f7dc5){if(!_0x2f7dc5){_0x2ea889[_0x3cd9('0x16')](0x194);}return _0x2f7dc5;};}function handleError(_0x3cf9ec,_0x10bdd1){_0x10bdd1=_0x10bdd1||0x1f4;return function(_0x14910c){logger[_0x3cd9('0x24')](_0x14910c[_0x3cd9('0x25')]);if(_0x14910c['name']){delete _0x14910c[_0x3cd9('0x26')];}_0x3cf9ec[_0x3cd9('0x18')](_0x10bdd1)[_0x3cd9('0x27')](_0x14910c);};}exports[_0x3cd9('0x28')]=function(_0x45e606,_0x21f9b3){var _0x3ff353={},_0x2c9a2e={},_0x589633={'count':0x0,'rows':[]};var _0x3c27b6=_[_0x3cd9('0x29')](db['AnalyticExtractedReport']['rawAttributes'],function(_0xf0572d){return{'name':_0xf0572d[_0x3cd9('0x2a')],'type':_0xf0572d[_0x3cd9('0x2b')]['key']};});_0x2c9a2e[_0x3cd9('0x2c')]=_[_0x3cd9('0x29')](_0x3c27b6,'name');_0x2c9a2e['query']=_['keys'](_0x45e606['query']);_0x2c9a2e[_0x3cd9('0x2d')]=_['intersection'](_0x2c9a2e[_0x3cd9('0x2c')],_0x2c9a2e[_0x3cd9('0x2e')]);_0x3ff353['attributes']=_['intersection'](_0x2c9a2e[_0x3cd9('0x2c')],qs[_0x3cd9('0x2f')](_0x45e606[_0x3cd9('0x2e')][_0x3cd9('0x2f')]));_0x3ff353[_0x3cd9('0x30')]=_0x3ff353[_0x3cd9('0x30')][_0x3cd9('0x31')]?_0x3ff353[_0x3cd9('0x30')]:_0x2c9a2e[_0x3cd9('0x2c')];if(!_0x45e606[_0x3cd9('0x2e')][_0x3cd9('0x32')](_0x3cd9('0x33'))){_0x3ff353['limit']=qs[_0x3cd9('0x34')](_0x45e606[_0x3cd9('0x2e')][_0x3cd9('0x34')]);_0x3ff353[_0x3cd9('0x1a')]=qs[_0x3cd9('0x1a')](_0x45e606[_0x3cd9('0x2e')][_0x3cd9('0x1a')]);}_0x3ff353['order']=qs[_0x3cd9('0x35')](_0x45e606[_0x3cd9('0x2e')][_0x3cd9('0x35')]);_0x3ff353[_0x3cd9('0x36')]=qs['filters'](_['pick'](_0x45e606[_0x3cd9('0x2e')],_0x2c9a2e[_0x3cd9('0x2d')]));if(_0x45e606[_0x3cd9('0x2e')]['filter']){_0x3ff353['where']=_['merge'](_0x3ff353['where'],{'$or':_[_0x3cd9('0x29')](_0x3c27b6,function(_0x46121e){if(_0x46121e[_0x3cd9('0x2b')]!=='VIRTUAL'){var _0xa452ca={};_0xa452ca[_0x46121e[_0x3cd9('0x26')]]={'$like':'%'+_0x45e606['query']['filter']+'%'};return _0xa452ca;}})});}_0x3ff353=_[_0x3cd9('0x37')]({},_0x3ff353,_0x45e606['options']);var _0x5d7fc2={'where':_0x3ff353[_0x3cd9('0x36')]};return db[_0x3cd9('0x38')]['count'](_0x5d7fc2)['then'](function(_0x298ab8){_0x589633[_0x3cd9('0x19')]=_0x298ab8;if(_0x45e606['query']['includeAll']){_0x3ff353[_0x3cd9('0x39')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x3cd9('0x3a')](_0x3ff353);})['then'](function(_0x4899df){_0x589633[_0x3cd9('0x3b')]=_0x4899df;return _0x589633;})['then'](respondWithFilteredResult(_0x21f9b3,_0x3ff353))['catch'](handleError(_0x21f9b3,null));};exports[_0x3cd9('0x3c')]=function(_0x5a5722,_0x33fcd1){var _0x34a6e4={'raw':!![],'where':{'id':_0x5a5722[_0x3cd9('0x3d')]['id']}},_0x12c3ae={};_0x12c3ae[_0x3cd9('0x2c')]=_['keys'](db[_0x3cd9('0x38')][_0x3cd9('0x3e')]);_0x12c3ae[_0x3cd9('0x2e')]=_['keys'](_0x5a5722[_0x3cd9('0x2e')]);_0x12c3ae['filters']=_[_0x3cd9('0x3f')](_0x12c3ae[_0x3cd9('0x2c')],_0x12c3ae[_0x3cd9('0x2e')]);_0x34a6e4[_0x3cd9('0x30')]=_['intersection'](_0x12c3ae['model'],qs[_0x3cd9('0x2f')](_0x5a5722[_0x3cd9('0x2e')][_0x3cd9('0x2f')]));_0x34a6e4['attributes']=_0x34a6e4[_0x3cd9('0x30')]['length']?_0x34a6e4['attributes']:_0x12c3ae['model'];if(_0x5a5722[_0x3cd9('0x2e')][_0x3cd9('0x40')]){_0x34a6e4[_0x3cd9('0x39')]=[{'all':!![]}];}_0x34a6e4=_[_0x3cd9('0x37')]({},_0x34a6e4,_0x5a5722['options']);return db[_0x3cd9('0x38')]['find'](_0x34a6e4)[_0x3cd9('0x1f')](handleEntityNotFound(_0x33fcd1,null))[_0x3cd9('0x1f')](respondWithResult(_0x33fcd1,null))[_0x3cd9('0x41')](handleError(_0x33fcd1,null));};exports[_0x3cd9('0x42')]=function(_0x432615,_0x20cfce){return db[_0x3cd9('0x38')]['create'](_0x432615[_0x3cd9('0x43')],{})[_0x3cd9('0x1f')](function(_0x5ac92d){var _0x316f98=_0x432615[_0x3cd9('0x44')][_0x3cd9('0x21')]({'plain':!![]});if(!_0x316f98)throw new Error(_0x3cd9('0x45'));if(_0x316f98[_0x3cd9('0x46')]===_0x3cd9('0x44')){var _0x9f8ecd=_0x5ac92d[_0x3cd9('0x21')]({'plain':!![]});var _0x1cab76=_0x3cd9('0x22');return db[_0x3cd9('0x47')][_0x3cd9('0x48')]({'where':{'name':_0x1cab76,'userProfileId':_0x316f98[_0x3cd9('0x49')]},'raw':!![]})['then'](function(_0x278eca){if(_0x278eca&&_0x278eca[_0x3cd9('0x4a')]===0x0){return db[_0x3cd9('0x23')][_0x3cd9('0x42')]({'name':_0x9f8ecd['name'],'resourceId':_0x9f8ecd['id'],'type':_0x278eca[_0x3cd9('0x26')],'sectionId':_0x278eca['id']},{})['then'](function(){return _0x5ac92d;});}else{return _0x5ac92d;}})[_0x3cd9('0x41')](function(_0x43ebdf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43ebdf);throw _0x43ebdf;});}return _0x5ac92d;})[_0x3cd9('0x1f')](respondWithResult(_0x20cfce,0xc9))[_0x3cd9('0x41')](handleError(_0x20cfce,null));};exports[_0x3cd9('0x1e')]=function(_0x2b5960,_0x23d66c){if(_0x2b5960[_0x3cd9('0x43')]['id']){delete _0x2b5960[_0x3cd9('0x43')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x2b5960[_0x3cd9('0x3d')]['id']}})[_0x3cd9('0x1f')](handleEntityNotFound(_0x23d66c,null))['then'](saveUpdates(_0x2b5960[_0x3cd9('0x43')],null))[_0x3cd9('0x1f')](respondWithResult(_0x23d66c,null))[_0x3cd9('0x41')](handleError(_0x23d66c,null));};exports[_0x3cd9('0x20')]=function(_0xb1d822,_0x3b9754){return db[_0x3cd9('0x38')][_0x3cd9('0x48')]({'where':{'id':_0xb1d822[_0x3cd9('0x3d')]['id']}})[_0x3cd9('0x1f')](handleEntityNotFound(_0x3b9754,null))['then'](removeEntity(_0x3b9754,null))[_0x3cd9('0x41')](handleError(_0x3b9754,null));};exports['download']=function(_0x4216f3,_0x1e4f67,_0x573194){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4216f3[_0x3cd9('0x3d')]['id']},'attributes':[_0x3cd9('0x26'),_0x3cd9('0x4b'),_0x3cd9('0x4c'),_0x3cd9('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x1e4f67,null))['then'](function(_0x1e77cb){if(_0x1e77cb){if(!fs['existsSync'](path['join'](config[_0x3cd9('0x4e')],_0x3cd9('0x4f'),_0x1e77cb[_0x3cd9('0x4c')]))){throw new db[(_0x3cd9('0x50'))]['ValidationError'](_0x3cd9('0x51'));}if(_0x4216f3[_0x3cd9('0x2e')][_0x3cd9('0x52')]){return _0x1e4f67[_0x3cd9('0x16')](0xc8);}return _0x1e4f67[_0x3cd9('0x53')](path[_0x3cd9('0x54')](config[_0x3cd9('0x4e')],_0x3cd9('0x4f'),_0x1e77cb[_0x3cd9('0x4c')]),util[_0x3cd9('0x55')](_0x3cd9('0x56'),_0x1e77cb[_0x3cd9('0x4b')]||_0x1e77cb[_0x3cd9('0x26')],_0x1e77cb[_0x3cd9('0x4d')][_0x3cd9('0x57')]()));}})[_0x3cd9('0x41')](handleError(_0x1e4f67,null));}; \ No newline at end of file +var _0x379c=['basename','output','existsSync','join','root','savename','Sequelize','ValidationError','sendStatus','server/files/reports','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','status','end','json','count','offset','Content-Range','reject','get','ExtractedReports','UserProfileResource','error','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','filter','where','merge','AnalyticExtractedReport','then','includeAll','include','findAll','rows','catch','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','body','find','destroy','download'];(function(_0x1f942a,_0x12a772){var _0x3f79ae=function(_0x573636){while(--_0x573636){_0x1f942a['push'](_0x1f942a['shift']());}};_0x3f79ae(++_0x12a772);}(_0x379c,0xb9));var _0xc379=function(_0x531d09,_0x453266){_0x531d09=_0x531d09-0x0;var _0x12c500=_0x379c[_0x531d09];return _0x12c500;};'use strict';var pdf=require(_0xc379('0x0'));var emlformat=require(_0xc379('0x1'));var rimraf=require(_0xc379('0x2'));var zipdir=require(_0xc379('0x3'));var jsonpatch=require(_0xc379('0x4'));var rp=require(_0xc379('0x5'));var moment=require(_0xc379('0x6'));var BPromise=require(_0xc379('0x7'));var Mustache=require(_0xc379('0x8'));var util=require(_0xc379('0x9'));var path=require('path');var sox=require(_0xc379('0xa'));var csv=require(_0xc379('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc379('0xc'));var crypto=require(_0xc379('0xd'));var jsforce=require(_0xc379('0xe'));var deskjs=require(_0xc379('0xf'));var toCsv=require(_0xc379('0xb'));var querystring=require(_0xc379('0x10'));var Papa=require(_0xc379('0x11'));var Redis=require(_0xc379('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc379('0x13'));var as=require(_0xc379('0x14'));var hardwareService=require(_0xc379('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xc379('0x16'));var config=require(_0xc379('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54b3fd,_0x2fb12b){_0x2fb12b=_0x2fb12b||0xcc;return function(_0x495a2a){if(_0x495a2a){return _0x54b3fd['sendStatus'](_0x2fb12b);}return _0x54b3fd[_0xc379('0x18')](_0x2fb12b)[_0xc379('0x19')]();};}function respondWithResult(_0x3f476a,_0x312afc){_0x312afc=_0x312afc||0xc8;return function(_0x904dd2){if(_0x904dd2){return _0x3f476a[_0xc379('0x18')](_0x312afc)[_0xc379('0x1a')](_0x904dd2);}};}function respondWithFilteredResult(_0x5928b0,_0x4db527){return function(_0x491a35){if(_0x491a35){var _0x429ace=_0x491a35[_0xc379('0x1b')],_0x2545bc=_0x4db527[_0xc379('0x1c')],_0x3aa7fc=_0x4db527[_0xc379('0x1c')]+_0x4db527['limit'],_0x57a3da;if(_0x3aa7fc>=_0x429ace){_0x3aa7fc=_0x429ace;_0x57a3da=0xc8;}else{_0x57a3da=0xce;}_0x5928b0[_0xc379('0x18')](_0x57a3da);return _0x5928b0['set'](_0xc379('0x1d'),_0x2545bc+'-'+_0x3aa7fc+'/'+_0x429ace)['json'](_0x491a35);}return null;};}function patchUpdates(_0x21b5a4){return function(_0x365599){try{jsonpatch['apply'](_0x365599,_0x21b5a4,!![]);}catch(_0x152cfc){return BPromise[_0xc379('0x1e')](_0x152cfc);}return _0x365599['save']();};}function saveUpdates(_0x155707,_0x306cad){return function(_0x135697){if(_0x135697){return _0x135697['update'](_0x155707)['then'](function(_0x11e64f){return _0x11e64f;});}return null;};}function removeEntity(_0x4b3e2d,_0x51c8b9){return function(_0x36c17c){if(_0x36c17c){return _0x36c17c['destroy']()['then'](function(){var _0x3e2a37=_0x36c17c[_0xc379('0x1f')]({'plain':!![]});var _0x331946=_0xc379('0x20');return db[_0xc379('0x21')]['destroy']({'where':{'type':_0x331946,'resourceId':_0x3e2a37['id']}})['then'](function(){return _0x36c17c;});})['then'](function(){_0x4b3e2d[_0xc379('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90f744,_0x44e828){return function(_0x30799e){if(!_0x30799e){_0x90f744['sendStatus'](0x194);}return _0x30799e;};}function handleError(_0xc1dd83,_0x32b56e){_0x32b56e=_0x32b56e||0x1f4;return function(_0x977ede){logger[_0xc379('0x22')](_0x977ede['stack']);if(_0x977ede['name']){delete _0x977ede[_0xc379('0x23')];}_0xc1dd83['status'](_0x32b56e)[_0xc379('0x24')](_0x977ede);};}exports['index']=function(_0x1f2de1,_0x3eb39a){var _0xd6e35f={},_0x41c013={},_0x11ec1a={'count':0x0,'rows':[]};var _0x3bc6f8=_['map'](db['AnalyticExtractedReport'][_0xc379('0x25')],function(_0x16287c){return{'name':_0x16287c[_0xc379('0x26')],'type':_0x16287c[_0xc379('0x27')]['key']};});_0x41c013[_0xc379('0x28')]=_[_0xc379('0x29')](_0x3bc6f8,'name');_0x41c013[_0xc379('0x2a')]=_[_0xc379('0x2b')](_0x1f2de1[_0xc379('0x2a')]);_0x41c013[_0xc379('0x2c')]=_[_0xc379('0x2d')](_0x41c013[_0xc379('0x28')],_0x41c013[_0xc379('0x2a')]);_0xd6e35f[_0xc379('0x2e')]=_[_0xc379('0x2d')](_0x41c013[_0xc379('0x28')],qs['fields'](_0x1f2de1[_0xc379('0x2a')][_0xc379('0x2f')]));_0xd6e35f[_0xc379('0x2e')]=_0xd6e35f[_0xc379('0x2e')][_0xc379('0x30')]?_0xd6e35f[_0xc379('0x2e')]:_0x41c013[_0xc379('0x28')];if(!_0x1f2de1[_0xc379('0x2a')]['hasOwnProperty'](_0xc379('0x31'))){_0xd6e35f[_0xc379('0x32')]=qs['limit'](_0x1f2de1[_0xc379('0x2a')]['limit']);_0xd6e35f[_0xc379('0x1c')]=qs[_0xc379('0x1c')](_0x1f2de1['query'][_0xc379('0x1c')]);}_0xd6e35f['order']=qs[_0xc379('0x33')](_0x1f2de1['query'][_0xc379('0x33')]);_0xd6e35f['where']=qs[_0xc379('0x2c')](_['pick'](_0x1f2de1['query'],_0x41c013['filters']));if(_0x1f2de1['query'][_0xc379('0x34')]){_0xd6e35f[_0xc379('0x35')]=_[_0xc379('0x36')](_0xd6e35f[_0xc379('0x35')],{'$or':_[_0xc379('0x29')](_0x3bc6f8,function(_0xeead09){if(_0xeead09[_0xc379('0x27')]!=='VIRTUAL'){var _0x208890={};_0x208890[_0xeead09[_0xc379('0x23')]]={'$like':'%'+_0x1f2de1[_0xc379('0x2a')][_0xc379('0x34')]+'%'};return _0x208890;}})});}_0xd6e35f=_[_0xc379('0x36')]({},_0xd6e35f,_0x1f2de1['options']);var _0x18f3bc={'where':_0xd6e35f[_0xc379('0x35')]};return db[_0xc379('0x37')][_0xc379('0x1b')](_0x18f3bc)[_0xc379('0x38')](function(_0xb65d29){_0x11ec1a['count']=_0xb65d29;if(_0x1f2de1['query'][_0xc379('0x39')]){_0xd6e35f[_0xc379('0x3a')]=[{'all':!![]}];}return db[_0xc379('0x37')][_0xc379('0x3b')](_0xd6e35f);})[_0xc379('0x38')](function(_0x91d1c2){_0x11ec1a[_0xc379('0x3c')]=_0x91d1c2;return _0x11ec1a;})[_0xc379('0x38')](respondWithFilteredResult(_0x3eb39a,_0xd6e35f))[_0xc379('0x3d')](handleError(_0x3eb39a,null));};exports['show']=function(_0x1ae367,_0x1503f7){var _0x8747cb={'raw':!![],'where':{'id':_0x1ae367[_0xc379('0x3e')]['id']}},_0x43b103={};_0x43b103[_0xc379('0x28')]=_[_0xc379('0x2b')](db[_0xc379('0x37')][_0xc379('0x25')]);_0x43b103['query']=_[_0xc379('0x2b')](_0x1ae367[_0xc379('0x2a')]);_0x43b103[_0xc379('0x2c')]=_[_0xc379('0x2d')](_0x43b103[_0xc379('0x28')],_0x43b103[_0xc379('0x2a')]);_0x8747cb[_0xc379('0x2e')]=_['intersection'](_0x43b103[_0xc379('0x28')],qs[_0xc379('0x2f')](_0x1ae367['query'][_0xc379('0x2f')]));_0x8747cb[_0xc379('0x2e')]=_0x8747cb['attributes'][_0xc379('0x30')]?_0x8747cb['attributes']:_0x43b103[_0xc379('0x28')];if(_0x1ae367['query'][_0xc379('0x39')]){_0x8747cb[_0xc379('0x3a')]=[{'all':!![]}];}_0x8747cb=_[_0xc379('0x36')]({},_0x8747cb,_0x1ae367[_0xc379('0x3f')]);return db[_0xc379('0x37')]['find'](_0x8747cb)[_0xc379('0x38')](handleEntityNotFound(_0x1503f7,null))['then'](respondWithResult(_0x1503f7,null))[_0xc379('0x3d')](handleError(_0x1503f7,null));};exports[_0xc379('0x40')]=function(_0x1259d2,_0x2b403d){return db[_0xc379('0x37')]['create'](_0x1259d2['body'],{})[_0xc379('0x38')](function(_0x1146ff){var _0xe984db=_0x1259d2[_0xc379('0x41')][_0xc379('0x1f')]({'plain':!![]});if(!_0xe984db)throw new Error(_0xc379('0x42'));if(_0xe984db[_0xc379('0x43')]===_0xc379('0x41')){var _0x3e966e=_0x1146ff[_0xc379('0x1f')]({'plain':!![]});var _0xaf70f7=_0xc379('0x20');return db['UserProfileSection']['find']({'where':{'name':_0xaf70f7,'userProfileId':_0xe984db['userProfileId']},'raw':!![]})[_0xc379('0x38')](function(_0x3b325f){if(_0x3b325f&&_0x3b325f[_0xc379('0x44')]===0x0){return db[_0xc379('0x21')][_0xc379('0x40')]({'name':_0x3e966e[_0xc379('0x23')],'resourceId':_0x3e966e['id'],'type':_0x3b325f[_0xc379('0x23')],'sectionId':_0x3b325f['id']},{})[_0xc379('0x38')](function(){return _0x1146ff;});}else{return _0x1146ff;}})[_0xc379('0x3d')](function(_0x27503c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27503c);throw _0x27503c;});}return _0x1146ff;})[_0xc379('0x38')](respondWithResult(_0x2b403d,0xc9))[_0xc379('0x3d')](handleError(_0x2b403d,null));};exports['update']=function(_0xc92aea,_0x5edb1e){if(_0xc92aea[_0xc379('0x45')]['id']){delete _0xc92aea[_0xc379('0x45')]['id'];}return db[_0xc379('0x37')][_0xc379('0x46')]({'where':{'id':_0xc92aea[_0xc379('0x3e')]['id']}})[_0xc379('0x38')](handleEntityNotFound(_0x5edb1e,null))['then'](saveUpdates(_0xc92aea[_0xc379('0x45')],null))['then'](respondWithResult(_0x5edb1e,null))[_0xc379('0x3d')](handleError(_0x5edb1e,null));};exports[_0xc379('0x47')]=function(_0x3c3174,_0x3503ee){return db[_0xc379('0x37')][_0xc379('0x46')]({'where':{'id':_0x3c3174[_0xc379('0x3e')]['id']}})[_0xc379('0x38')](handleEntityNotFound(_0x3503ee,null))['then'](removeEntity(_0x3503ee,null))[_0xc379('0x3d')](handleError(_0x3503ee,null));};exports[_0xc379('0x48')]=function(_0xc042bb,_0x3af3a5,_0x101343){return db['AnalyticExtractedReport'][_0xc379('0x46')]({'where':{'id':_0xc042bb[_0xc379('0x3e')]['id']},'attributes':['name',_0xc379('0x49'),'savename',_0xc379('0x4a')],'raw':!![]})[_0xc379('0x38')](handleEntityNotFound(_0x3af3a5,null))[_0xc379('0x38')](function(_0x4b90d1){if(_0x4b90d1){if(!fs[_0xc379('0x4b')](path[_0xc379('0x4c')](config[_0xc379('0x4d')],'server/files/reports',_0x4b90d1[_0xc379('0x4e')]))){throw new db[(_0xc379('0x4f'))][(_0xc379('0x50'))]('Report\x20not\x20found\x20or\x20empty');}if(_0xc042bb['query']['exists']){return _0x3af3a5[_0xc379('0x51')](0xc8);}return _0x3af3a5[_0xc379('0x48')](path[_0xc379('0x4c')](config[_0xc379('0x4d')],_0xc379('0x52'),_0x4b90d1[_0xc379('0x4e')]),util[_0xc379('0x53')](_0xc379('0x54'),_0x4b90d1[_0xc379('0x49')]||_0x4b90d1[_0xc379('0x23')],_0x4b90d1[_0xc379('0x4a')][_0xc379('0x55')]()));}})['catch'](handleError(_0x3af3a5,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 0f71110..cd39f57 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 _0xe287=['analytics_extracted_reports','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe287,0x14b));var _0x7e28=function(_0x3559ba,_0x2a3462){_0x3559ba=_0x3559ba-0x0;var _0x134fc5=_0xe287[_0x3559ba];return _0x134fc5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7e28('0x0'))(_0x7e28('0x1'));var moment=require(_0x7e28('0x2'));var BPromise=require('bluebird');var rp=require(_0x7e28('0x3'));var fs=require('fs');var path=require(_0x7e28('0x4'));var rimraf=require(_0x7e28('0x5'));var config=require(_0x7e28('0x6'));var attributes=require(_0x7e28('0x7'));module[_0x7e28('0x8')]=function(_0x3b7766,_0x20c23a){return _0x3b7766[_0x7e28('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x7e28('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2a8=['rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','util','api','moment','bluebird','request-promise','path'];(function(_0x2777c2,_0x269c67){var _0xe9f8c=function(_0x4fdefb){while(--_0x4fdefb){_0x2777c2['push'](_0x2777c2['shift']());}};_0xe9f8c(++_0x269c67);}(_0xe2a8,0x1a7));var _0x8e2a=function(_0x53cd6b,_0x14fbdc){_0x53cd6b=_0x53cd6b-0x0;var _0x1819ec=_0xe2a8[_0x53cd6b];return _0x1819ec;};'use strict';var _=require('lodash');var util=require(_0x8e2a('0x0'));var logger=require('../../config/logger')(_0x8e2a('0x1'));var moment=require(_0x8e2a('0x2'));var BPromise=require(_0x8e2a('0x3'));var rp=require(_0x8e2a('0x4'));var fs=require('fs');var path=require(_0x8e2a('0x5'));var rimraf=require(_0x8e2a('0x6'));var config=require(_0x8e2a('0x7'));var attributes=require(_0x8e2a('0x8'));module['exports']=function(_0x6a9203,_0x5546aa){return _0x6a9203[_0x8e2a('0x9')](_0x8e2a('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 8e06df6..3423066 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 _0xbd05=['rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4f3e9f,_0x1e424d){var _0x5dbb3b=function(_0x58cec3){while(--_0x58cec3){_0x4f3e9f['push'](_0x4f3e9f['shift']());}};_0x5dbb3b(++_0x1e424d);}(_0xbd05,0x186));var _0x5bd0=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0xbd05[_0x50af9c];return _0x5b5e5a;};'use strict';var _=require('lodash');var util=require(_0x5bd0('0x0'));var moment=require(_0x5bd0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bd0('0x2'));var db=require(_0x5bd0('0x3'))['db'];var utils=require(_0x5bd0('0x4'));var logger=require(_0x5bd0('0x5'))(_0x5bd0('0x6'));var config=require(_0x5bd0('0x7'));var jayson=require(_0x5bd0('0x8'));var client=jayson[_0x5bd0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28d074,_0x54aec1,_0xe2e4e0){return new BPromise(function(_0x4185d0,_0x5cba26){return client[_0x5bd0('0xa')](_0x28d074,_0xe2e4e0)[_0x5bd0('0xb')](function(_0x49f3a6){logger[_0x5bd0('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x54aec1,_0x5bd0('0xd'));logger[_0x5bd0('0xe')](_0x5bd0('0xf'),_0x54aec1,_0x5bd0('0xd'),JSON[_0x5bd0('0x10')](_0x49f3a6));if(_0x49f3a6[_0x5bd0('0x11')]){if(_0x49f3a6[_0x5bd0('0x11')][_0x5bd0('0x12')]===0x1f4){logger[_0x5bd0('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x54aec1,_0x49f3a6['error'][_0x5bd0('0x13')]);return _0x5cba26(_0x49f3a6[_0x5bd0('0x11')][_0x5bd0('0x13')]);}logger[_0x5bd0('0x11')](_0x5bd0('0x14'),_0x54aec1,_0x49f3a6['error'][_0x5bd0('0x13')]);return _0x4185d0(_0x49f3a6[_0x5bd0('0x11')][_0x5bd0('0x13')]);}else{logger[_0x5bd0('0xc')](_0x5bd0('0x14'),_0x54aec1,'request\x20sent');_0x4185d0(_0x49f3a6['result'][_0x5bd0('0x13')]);}})[_0x5bd0('0x15')](function(_0x49abf9){logger[_0x5bd0('0x11')](_0x5bd0('0x14'),_0x54aec1,_0x49abf9);_0x5cba26(_0x49abf9);});});} \ No newline at end of file +var _0x3501=['jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x48fc78,_0x221335){var _0x57a4db=function(_0x2c843e){while(--_0x2c843e){_0x48fc78['push'](_0x48fc78['shift']());}};_0x57a4db(++_0x221335);}(_0x3501,0x1aa));var _0x1350=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3501[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1350('0x0'));var util=require(_0x1350('0x1'));var moment=require(_0x1350('0x2'));var BPromise=require(_0x1350('0x3'));var rs=require(_0x1350('0x4'));var fs=require('fs');var Redis=require(_0x1350('0x5'));var db=require(_0x1350('0x6'))['db'];var utils=require(_0x1350('0x7'));var logger=require(_0x1350('0x8'))(_0x1350('0x9'));var config=require(_0x1350('0xa'));var jayson=require(_0x1350('0xb'));var client=jayson[_0x1350('0xc')][_0x1350('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1775af,_0x5c7ae3,_0xb7c319){return new BPromise(function(_0x131c3f,_0xc93e94){return client['request'](_0x1775af,_0xb7c319)[_0x1350('0xe')](function(_0x474cc2){logger[_0x1350('0xf')](_0x1350('0x10'),_0x5c7ae3,_0x1350('0x11'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5c7ae3,_0x1350('0x11'),JSON['stringify'](_0x474cc2));if(_0x474cc2[_0x1350('0x12')]){if(_0x474cc2['error'][_0x1350('0x13')]===0x1f4){logger[_0x1350('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5c7ae3,_0x474cc2[_0x1350('0x12')][_0x1350('0x14')]);return _0xc93e94(_0x474cc2[_0x1350('0x12')][_0x1350('0x14')]);}logger[_0x1350('0x12')](_0x1350('0x10'),_0x5c7ae3,_0x474cc2[_0x1350('0x12')][_0x1350('0x14')]);return _0x131c3f(_0x474cc2['error'][_0x1350('0x14')]);}else{logger[_0x1350('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5c7ae3,_0x1350('0x11'));_0x131c3f(_0x474cc2[_0x1350('0x15')][_0x1350('0x14')]);}})[_0x1350('0x16')](function(_0x10defa){logger['error'](_0x1350('0x10'),_0x5c7ae3,_0x10defa);_0xc93e94(_0x10defa);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 8d51820..5c15895 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 _0xe016=['create','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x3a5ed2,_0x4d50e6){var _0x4f694a=function(_0x4637e8){while(--_0x4637e8){_0x3a5ed2['push'](_0x3a5ed2['shift']());}};_0x4f694a(++_0x4d50e6);}(_0xe016,0x1a0));var _0x6e01=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xe016[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0x6e01('0x0'));var util=require(_0x6e01('0x1'));var path=require(_0x6e01('0x2'));var timeout=require(_0x6e01('0x3'));var express=require(_0x6e01('0x4'));var router=express[_0x6e01('0x5')]();var auth=require(_0x6e01('0x6'));var interaction=require(_0x6e01('0x7'));var config=require(_0x6e01('0x8'));var controller=require(_0x6e01('0x9'));router[_0x6e01('0xa')]('/',auth[_0x6e01('0xb')](),controller[_0x6e01('0xc')]);router[_0x6e01('0xa')](_0x6e01('0xd'),auth['isAuthenticated'](),controller[_0x6e01('0xe')]);router[_0x6e01('0xa')]('/:id/download',auth[_0x6e01('0xb')](),controller['download']);router[_0x6e01('0xf')]('/',auth[_0x6e01('0xb')](),controller[_0x6e01('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6e01('0x11')]);router['delete'](_0x6e01('0xd'),auth[_0x6e01('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9153=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9153,0x1a7));var _0x3915=function(_0xe79573,_0x4d2db7){_0xe79573=_0xe79573-0x0;var _0x4b8f11=_0x9153[_0xe79573];return _0x4b8f11;};'use strict';var multer=require(_0x3915('0x0'));var util=require(_0x3915('0x1'));var path=require(_0x3915('0x2'));var timeout=require(_0x3915('0x3'));var express=require('express');var router=express[_0x3915('0x4')]();var auth=require(_0x3915('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3915('0x6'));var controller=require(_0x3915('0x7'));router[_0x3915('0x8')]('/',auth[_0x3915('0x9')](),controller[_0x3915('0xa')]);router[_0x3915('0x8')](_0x3915('0xb'),auth[_0x3915('0x9')](),controller[_0x3915('0xc')]);router[_0x3915('0x8')](_0x3915('0xd'),auth[_0x3915('0x9')](),controller[_0x3915('0xe')]);router['post']('/',auth[_0x3915('0x9')](),controller[_0x3915('0xf')]);router[_0x3915('0x10')](_0x3915('0xb'),auth[_0x3915('0x9')](),controller['update']);router[_0x3915('0x11')]('/:id',auth[_0x3915('0x9')](),controller[_0x3915('0x12')]);module[_0x3915('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index adaba94..8c93217 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 _0x7217=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x5b48c5,_0x143c11){var _0x5d8132=function(_0x368308){while(--_0x368308){_0x5b48c5['push'](_0x5b48c5['shift']());}};_0x5d8132(++_0x143c11);}(_0x7217,0x19e));var _0x7721=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x7217[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'field':{'type':Sequelize[_0x7721('0x1')]},'alias':{'type':Sequelize[_0x7721('0x2')]},'function':{'type':Sequelize[_0x7721('0x2')]},'format':{'type':Sequelize[_0x7721('0x2')]},'groupBy':{'type':Sequelize[_0x7721('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x54f914,_0x1a28e6){var _0x20549a=function(_0x3cd416){while(--_0x3cd416){_0x54f914['push'](_0x54f914['shift']());}};_0x20549a(++_0x1a28e6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index d5d5ff2..3b575ac 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 _0x5655=['reject','save','then','destroy','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','count','include','findAll','keys','length','merge','options','find','create','body','catch','bulkCreate','update','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5655,0x15e));var _0x5565=function(_0x39c491,_0x434b1a){_0x39c491=_0x39c491-0x0;var _0xd6bf40=_0x5655[_0x39c491];return _0xd6bf40;};'use strict';var pdf=require(_0x5565('0x0'));var emlformat=require(_0x5565('0x1'));var rimraf=require(_0x5565('0x2'));var zipdir=require(_0x5565('0x3'));var jsonpatch=require(_0x5565('0x4'));var rp=require(_0x5565('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5565('0x6'));var util=require('util');var path=require(_0x5565('0x7'));var sox=require(_0x5565('0x8'));var csv=require(_0x5565('0x9'));var ejs=require(_0x5565('0xa'));var fs=require('fs');var _=require(_0x5565('0xb'));var squel=require('squel');var crypto=require(_0x5565('0xc'));var jsforce=require(_0x5565('0xd'));var deskjs=require(_0x5565('0xe'));var toCsv=require(_0x5565('0x9'));var querystring=require(_0x5565('0xf'));var Papa=require(_0x5565('0x10'));var Redis=require('ioredis');var authService=require(_0x5565('0x11'));var qs=require(_0x5565('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5565('0x13'))(_0x5565('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5565('0x15'))['db'];function respondWithStatusCode(_0xc15904,_0x1ce120){_0x1ce120=_0x1ce120||0xcc;return function(_0x36ac51){if(_0x36ac51){return _0xc15904[_0x5565('0x16')](_0x1ce120);}return _0xc15904[_0x5565('0x17')](_0x1ce120)[_0x5565('0x18')]();};}function respondWithResult(_0x40584f,_0x553b26){_0x553b26=_0x553b26||0xc8;return function(_0x34cd10){if(_0x34cd10){return _0x40584f[_0x5565('0x17')](_0x553b26)[_0x5565('0x19')](_0x34cd10);}};}function respondWithFilteredResult(_0x199a3c,_0x57058d){return function(_0x1944db){if(_0x1944db){var _0x42b966=_0x1944db['count'],_0x2e252c=_0x57058d['offset'],_0x2b31e0=_0x57058d[_0x5565('0x1a')]+_0x57058d[_0x5565('0x1b')],_0x433461;if(_0x2b31e0>=_0x42b966){_0x2b31e0=_0x42b966;_0x433461=0xc8;}else{_0x433461=0xce;}_0x199a3c['status'](_0x433461);return _0x199a3c[_0x5565('0x1c')](_0x5565('0x1d'),_0x2e252c+'-'+_0x2b31e0+'/'+_0x42b966)[_0x5565('0x19')](_0x1944db);}return null;};}function patchUpdates(_0x5712ad){return function(_0x48c846){try{jsonpatch['apply'](_0x48c846,_0x5712ad,!![]);}catch(_0x1986e1){return BPromise[_0x5565('0x1e')](_0x1986e1);}return _0x48c846[_0x5565('0x1f')]();};}function saveUpdates(_0xb6e20c,_0x183e20){return function(_0x298f4f){if(_0x298f4f){return _0x298f4f['update'](_0xb6e20c)[_0x5565('0x20')](function(_0x11e42b){return _0x11e42b;});}return null;};}function removeEntity(_0x54edc6,_0x163d4c){return function(_0x25f8c9){if(_0x25f8c9){return _0x25f8c9[_0x5565('0x21')]()['then'](function(){_0x54edc6[_0x5565('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c03b,_0x1ab95b){return function(_0x53f065){if(!_0x53f065){_0x30c03b['sendStatus'](0x194);}return _0x53f065;};}function handleError(_0x3ccdc0,_0x9f87b8){_0x9f87b8=_0x9f87b8||0x1f4;return function(_0x4446ee){logger['error'](_0x4446ee['stack']);if(_0x4446ee[_0x5565('0x22')]){delete _0x4446ee[_0x5565('0x22')];}_0x3ccdc0['status'](_0x9f87b8)[_0x5565('0x23')](_0x4446ee);};}exports[_0x5565('0x24')]=function(_0x4ed14a,_0x2c4dee){var _0x4eed17={},_0x3d0171={},_0x2fbd34={'count':0x0,'rows':[]};var _0x2d7f3e=_[_0x5565('0x25')](db[_0x5565('0x26')][_0x5565('0x27')],function(_0x168f16){return{'name':_0x168f16[_0x5565('0x28')],'type':_0x168f16[_0x5565('0x29')]['key']};});_0x3d0171[_0x5565('0x2a')]=_['map'](_0x2d7f3e,'name');_0x3d0171[_0x5565('0x2b')]=_['keys'](_0x4ed14a[_0x5565('0x2b')]);_0x3d0171[_0x5565('0x2c')]=_[_0x5565('0x2d')](_0x3d0171['model'],_0x3d0171['query']);_0x4eed17[_0x5565('0x2e')]=_[_0x5565('0x2d')](_0x3d0171[_0x5565('0x2a')],qs['fields'](_0x4ed14a['query'][_0x5565('0x2f')]));_0x4eed17['attributes']=_0x4eed17[_0x5565('0x2e')]['length']?_0x4eed17[_0x5565('0x2e')]:_0x3d0171['model'];if(!_0x4ed14a['query'][_0x5565('0x30')](_0x5565('0x31'))){_0x4eed17['limit']=qs[_0x5565('0x1b')](_0x4ed14a[_0x5565('0x2b')][_0x5565('0x1b')]);_0x4eed17[_0x5565('0x1a')]=qs[_0x5565('0x1a')](_0x4ed14a[_0x5565('0x2b')][_0x5565('0x1a')]);}_0x4eed17[_0x5565('0x32')]=qs[_0x5565('0x33')](_0x4ed14a[_0x5565('0x2b')]['sort']);_0x4eed17[_0x5565('0x34')]=qs[_0x5565('0x2c')](_['pick'](_0x4ed14a[_0x5565('0x2b')],_0x3d0171[_0x5565('0x2c')]));if(_0x4ed14a['query'][_0x5565('0x35')]){_0x4eed17[_0x5565('0x34')]=_['merge'](_0x4eed17['where'],{'$or':_[_0x5565('0x25')](_0x2d7f3e,function(_0x3ccd99){if(_0x3ccd99[_0x5565('0x29')]!==_0x5565('0x36')){var _0x46bfd7={};_0x46bfd7[_0x3ccd99[_0x5565('0x22')]]={'$like':'%'+_0x4ed14a[_0x5565('0x2b')][_0x5565('0x35')]+'%'};return _0x46bfd7;}})});}_0x4eed17=_['merge']({},_0x4eed17,_0x4ed14a['options']);var _0x4c1254={'where':_0x4eed17[_0x5565('0x34')]};return db[_0x5565('0x26')]['count'](_0x4c1254)[_0x5565('0x20')](function(_0x4daf98){_0x2fbd34[_0x5565('0x37')]=_0x4daf98;if(_0x4ed14a['query']['includeAll']){_0x4eed17[_0x5565('0x38')]=[{'all':!![]}];}return db[_0x5565('0x26')][_0x5565('0x39')](_0x4eed17);})['then'](function(_0x1a5436){_0x2fbd34['rows']=_0x1a5436;return _0x2fbd34;})[_0x5565('0x20')](respondWithFilteredResult(_0x2c4dee,_0x4eed17))['catch'](handleError(_0x2c4dee,null));};exports['show']=function(_0x5bd37f,_0x4f62f7){var _0xaab10={'raw':![],'where':{'id':_0x5bd37f['params']['id']}},_0x541e98={};_0x541e98[_0x5565('0x2a')]=_[_0x5565('0x3a')](db[_0x5565('0x26')][_0x5565('0x27')]);_0x541e98[_0x5565('0x2b')]=_[_0x5565('0x3a')](_0x5bd37f[_0x5565('0x2b')]);_0x541e98['filters']=_[_0x5565('0x2d')](_0x541e98[_0x5565('0x2a')],_0x541e98[_0x5565('0x2b')]);_0xaab10[_0x5565('0x2e')]=_[_0x5565('0x2d')](_0x541e98[_0x5565('0x2a')],qs[_0x5565('0x2f')](_0x5bd37f[_0x5565('0x2b')]['fields']));_0xaab10['attributes']=_0xaab10['attributes'][_0x5565('0x3b')]?_0xaab10[_0x5565('0x2e')]:_0x541e98[_0x5565('0x2a')];if(_0x5bd37f[_0x5565('0x2b')]['includeAll']){_0xaab10[_0x5565('0x38')]=[{'all':!![]}];}_0xaab10=_[_0x5565('0x3c')]({},_0xaab10,_0x5bd37f[_0x5565('0x3d')]);return db[_0x5565('0x26')][_0x5565('0x3e')](_0xaab10)[_0x5565('0x20')](handleEntityNotFound(_0x4f62f7,null))[_0x5565('0x20')](respondWithResult(_0x4f62f7,null))['catch'](handleError(_0x4f62f7,null));};exports[_0x5565('0x3f')]=function(_0x351912,_0x441b3a){return db[_0x5565('0x26')][_0x5565('0x3f')](_0x351912[_0x5565('0x40')],{})[_0x5565('0x20')](respondWithResult(_0x441b3a,0xc9))[_0x5565('0x41')](handleError(_0x441b3a,null));};exports['bulkCreate']=function(_0x1e544a,_0x27232a){return db['AnalyticFieldReport'][_0x5565('0x42')](_0x1e544a[_0x5565('0x40')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x27232a,0xc9))['catch'](handleError(_0x27232a,null));};exports[_0x5565('0x43')]=function(_0x4e3a02,_0x3f7c98){if(_0x4e3a02[_0x5565('0x40')]['id']){delete _0x4e3a02['body']['id'];}return db[_0x5565('0x26')]['find']({'where':{'id':_0x4e3a02['params']['id']}})['then'](handleEntityNotFound(_0x3f7c98,null))[_0x5565('0x20')](saveUpdates(_0x4e3a02[_0x5565('0x40')],null))[_0x5565('0x20')](respondWithResult(_0x3f7c98,null))['catch'](handleError(_0x3f7c98,null));};exports['destroy']=function(_0x784b61,_0x141d4a){return db[_0x5565('0x26')][_0x5565('0x3e')]({'where':{'id':_0x784b61[_0x5565('0x44')]['id']}})['then'](handleEntityNotFound(_0x141d4a,null))[_0x5565('0x20')](removeEntity(_0x141d4a,null))['catch'](handleError(_0x141d4a,null));};exports[_0x5565('0x45')]=function(_0x40b27e,_0x3e39e3){return db[_0x5565('0x26')][_0x5565('0x21')]({'where':{'id':_0x40b27e[_0x5565('0x2b')][_0x5565('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x5565('0x20')](respondWithResult(_0x3e39e3,0xcc))[_0x5565('0x41')](handleError(_0x3e39e3,null));};exports[_0x5565('0x47')]=function(_0x1c7ec9,_0x27580c,_0x8232e9){return db[_0x5565('0x48')][_0x5565('0x49')]({'where':{'id':_0x1c7ec9[_0x5565('0x44')]['id']}})[_0x5565('0x20')](handleEntityNotFound(_0x27580c,null))[_0x5565('0x20')](function(_0x1d7fc9){if(_0x1d7fc9){return db[_0x5565('0x4a')]['transaction'](function(_0x40f92d){return db[_0x5565('0x26')][_0x5565('0x21')]({'where':{'CustomReportId':_0x1c7ec9[_0x5565('0x44')]['id']},'transaction':_0x40f92d})[_0x5565('0x20')](function(_0x207981){var _0x4eb206=_[_0x5565('0x25')](_0x1c7ec9[_0x5565('0x40')],function(_0x2d3251){delete _0x2d3251['id'];_0x2d3251[_0x5565('0x4b')]=_0x1c7ec9['params']['id'];return _0x2d3251;});return db[_0x5565('0x26')]['bulkCreate'](_0x4eb206,{'transaction':_0x40f92d});});})[_0x5565('0x20')](function(){return db[_0x5565('0x26')][_0x5565('0x39')]({'where':{'CustomReportId':_0x1c7ec9[_0x5565('0x44')]['id']}});});}})[_0x5565('0x20')](respondWithResult(_0x27580c,null))[_0x5565('0x41')](handleError(_0x27580c,null));}; \ No newline at end of file +var _0xd663=['length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','bulkCreate','body','params','bulkDestroy','AnalyticCustomReport','findOne','sequelize','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields'];(function(_0x3f57ea,_0x3faa44){var _0x3f9434=function(_0x5e2d22){while(--_0x5e2d22){_0x3f57ea['push'](_0x3f57ea['shift']());}};_0x3f9434(++_0x3faa44);}(_0xd663,0x1ed));var _0x3d66=function(_0xd0e796,_0x5e9f5d){_0xd0e796=_0xd0e796-0x0;var _0x208697=_0xd663[_0xd0e796];return _0x208697;};'use strict';var pdf=require(_0x3d66('0x0'));var emlformat=require(_0x3d66('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3d66('0x2'));var jsonpatch=require(_0x3d66('0x3'));var rp=require(_0x3d66('0x4'));var moment=require(_0x3d66('0x5'));var BPromise=require(_0x3d66('0x6'));var Mustache=require('mustache');var util=require(_0x3d66('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3d66('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3d66('0x9'));var deskjs=require(_0x3d66('0xa'));var toCsv=require(_0x3d66('0xb'));var querystring=require(_0x3d66('0xc'));var Papa=require(_0x3d66('0xd'));var Redis=require(_0x3d66('0xe'));var authService=require(_0x3d66('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3d66('0x10'));var hardwareService=require(_0x3d66('0x11'));var logger=require(_0x3d66('0x12'))('api');var utils=require(_0x3d66('0x13'));var config=require(_0x3d66('0x14'));var db=require(_0x3d66('0x15'))['db'];function respondWithStatusCode(_0x4baacb,_0x207712){_0x207712=_0x207712||0xcc;return function(_0x223de6){if(_0x223de6){return _0x4baacb[_0x3d66('0x16')](_0x207712);}return _0x4baacb[_0x3d66('0x17')](_0x207712)['end']();};}function respondWithResult(_0x4007dc,_0x5a940c){_0x5a940c=_0x5a940c||0xc8;return function(_0x15bba0){if(_0x15bba0){return _0x4007dc[_0x3d66('0x17')](_0x5a940c)[_0x3d66('0x18')](_0x15bba0);}};}function respondWithFilteredResult(_0x3075e2,_0x30260d){return function(_0x153b88){if(_0x153b88){var _0x5628ae=_0x153b88['count'],_0x5eba7e=_0x30260d[_0x3d66('0x19')],_0xe5bf8f=_0x30260d[_0x3d66('0x19')]+_0x30260d[_0x3d66('0x1a')],_0x4651b8;if(_0xe5bf8f>=_0x5628ae){_0xe5bf8f=_0x5628ae;_0x4651b8=0xc8;}else{_0x4651b8=0xce;}_0x3075e2[_0x3d66('0x17')](_0x4651b8);return _0x3075e2[_0x3d66('0x1b')](_0x3d66('0x1c'),_0x5eba7e+'-'+_0xe5bf8f+'/'+_0x5628ae)[_0x3d66('0x18')](_0x153b88);}return null;};}function patchUpdates(_0x27ae83){return function(_0x1accfb){try{jsonpatch[_0x3d66('0x1d')](_0x1accfb,_0x27ae83,!![]);}catch(_0x3bf534){return BPromise[_0x3d66('0x1e')](_0x3bf534);}return _0x1accfb[_0x3d66('0x1f')]();};}function saveUpdates(_0x42df07,_0x21cfd7){return function(_0x4c61ee){if(_0x4c61ee){return _0x4c61ee[_0x3d66('0x20')](_0x42df07)['then'](function(_0x118bba){return _0x118bba;});}return null;};}function removeEntity(_0x26b404,_0x4486f5){return function(_0x37ed73){if(_0x37ed73){return _0x37ed73[_0x3d66('0x21')]()[_0x3d66('0x22')](function(){_0x26b404[_0x3d66('0x17')](0xcc)[_0x3d66('0x23')]();});}};}function handleEntityNotFound(_0x1eb922,_0x4e2c42){return function(_0x151364){if(!_0x151364){_0x1eb922[_0x3d66('0x16')](0x194);}return _0x151364;};}function handleError(_0x2c1779,_0x1cbf89){_0x1cbf89=_0x1cbf89||0x1f4;return function(_0x47c6f1){logger[_0x3d66('0x24')](_0x47c6f1[_0x3d66('0x25')]);if(_0x47c6f1[_0x3d66('0x26')]){delete _0x47c6f1[_0x3d66('0x26')];}_0x2c1779['status'](_0x1cbf89)[_0x3d66('0x27')](_0x47c6f1);};}exports[_0x3d66('0x28')]=function(_0x402a18,_0x7350d8){var _0x3ff9c5={},_0x77dc85={},_0x45ee47={'count':0x0,'rows':[]};var _0x4565a6=_[_0x3d66('0x29')](db[_0x3d66('0x2a')]['rawAttributes'],function(_0x28466b){return{'name':_0x28466b[_0x3d66('0x2b')],'type':_0x28466b[_0x3d66('0x2c')][_0x3d66('0x2d')]};});_0x77dc85[_0x3d66('0x2e')]=_[_0x3d66('0x29')](_0x4565a6,_0x3d66('0x26'));_0x77dc85[_0x3d66('0x2f')]=_[_0x3d66('0x30')](_0x402a18[_0x3d66('0x2f')]);_0x77dc85[_0x3d66('0x31')]=_['intersection'](_0x77dc85['model'],_0x77dc85[_0x3d66('0x2f')]);_0x3ff9c5[_0x3d66('0x32')]=_[_0x3d66('0x33')](_0x77dc85[_0x3d66('0x2e')],qs[_0x3d66('0x34')](_0x402a18[_0x3d66('0x2f')][_0x3d66('0x34')]));_0x3ff9c5[_0x3d66('0x32')]=_0x3ff9c5[_0x3d66('0x32')][_0x3d66('0x35')]?_0x3ff9c5[_0x3d66('0x32')]:_0x77dc85[_0x3d66('0x2e')];if(!_0x402a18[_0x3d66('0x2f')][_0x3d66('0x36')](_0x3d66('0x37'))){_0x3ff9c5[_0x3d66('0x1a')]=qs[_0x3d66('0x1a')](_0x402a18[_0x3d66('0x2f')][_0x3d66('0x1a')]);_0x3ff9c5[_0x3d66('0x19')]=qs[_0x3d66('0x19')](_0x402a18[_0x3d66('0x2f')][_0x3d66('0x19')]);}_0x3ff9c5['order']=qs[_0x3d66('0x38')](_0x402a18[_0x3d66('0x2f')][_0x3d66('0x38')]);_0x3ff9c5['where']=qs[_0x3d66('0x31')](_['pick'](_0x402a18[_0x3d66('0x2f')],_0x77dc85[_0x3d66('0x31')]));if(_0x402a18['query'][_0x3d66('0x39')]){_0x3ff9c5[_0x3d66('0x3a')]=_['merge'](_0x3ff9c5[_0x3d66('0x3a')],{'$or':_[_0x3d66('0x29')](_0x4565a6,function(_0x505ebb){if(_0x505ebb[_0x3d66('0x2c')]!==_0x3d66('0x3b')){var _0x1dea52={};_0x1dea52[_0x505ebb[_0x3d66('0x26')]]={'$like':'%'+_0x402a18['query'][_0x3d66('0x39')]+'%'};return _0x1dea52;}})});}_0x3ff9c5=_['merge']({},_0x3ff9c5,_0x402a18[_0x3d66('0x3c')]);var _0x533f23={'where':_0x3ff9c5[_0x3d66('0x3a')]};return db[_0x3d66('0x2a')][_0x3d66('0x3d')](_0x533f23)['then'](function(_0x9e50f9){_0x45ee47[_0x3d66('0x3d')]=_0x9e50f9;if(_0x402a18[_0x3d66('0x2f')][_0x3d66('0x3e')]){_0x3ff9c5[_0x3d66('0x3f')]=[{'all':!![]}];}return db[_0x3d66('0x2a')][_0x3d66('0x40')](_0x3ff9c5);})[_0x3d66('0x22')](function(_0x3d6cfa){_0x45ee47[_0x3d66('0x41')]=_0x3d6cfa;return _0x45ee47;})[_0x3d66('0x22')](respondWithFilteredResult(_0x7350d8,_0x3ff9c5))[_0x3d66('0x42')](handleError(_0x7350d8,null));};exports[_0x3d66('0x43')]=function(_0x4b4337,_0x3f9010){var _0x4482a3={'raw':![],'where':{'id':_0x4b4337['params']['id']}},_0x31234c={};_0x31234c['model']=_[_0x3d66('0x30')](db[_0x3d66('0x2a')][_0x3d66('0x44')]);_0x31234c[_0x3d66('0x2f')]=_[_0x3d66('0x30')](_0x4b4337[_0x3d66('0x2f')]);_0x31234c[_0x3d66('0x31')]=_[_0x3d66('0x33')](_0x31234c['model'],_0x31234c[_0x3d66('0x2f')]);_0x4482a3[_0x3d66('0x32')]=_[_0x3d66('0x33')](_0x31234c['model'],qs['fields'](_0x4b4337[_0x3d66('0x2f')][_0x3d66('0x34')]));_0x4482a3[_0x3d66('0x32')]=_0x4482a3[_0x3d66('0x32')][_0x3d66('0x35')]?_0x4482a3[_0x3d66('0x32')]:_0x31234c[_0x3d66('0x2e')];if(_0x4b4337[_0x3d66('0x2f')]['includeAll']){_0x4482a3[_0x3d66('0x3f')]=[{'all':!![]}];}_0x4482a3=_['merge']({},_0x4482a3,_0x4b4337[_0x3d66('0x3c')]);return db[_0x3d66('0x2a')][_0x3d66('0x45')](_0x4482a3)['then'](handleEntityNotFound(_0x3f9010,null))[_0x3d66('0x22')](respondWithResult(_0x3f9010,null))[_0x3d66('0x42')](handleError(_0x3f9010,null));};exports[_0x3d66('0x46')]=function(_0x3da5a2,_0x4c8c2d){return db['AnalyticFieldReport'][_0x3d66('0x46')](_0x3da5a2['body'],{})['then'](respondWithResult(_0x4c8c2d,0xc9))[_0x3d66('0x42')](handleError(_0x4c8c2d,null));};exports[_0x3d66('0x47')]=function(_0x32edc2,_0xa576e2){return db[_0x3d66('0x2a')][_0x3d66('0x47')](_0x32edc2[_0x3d66('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xa576e2,0xc9))[_0x3d66('0x42')](handleError(_0xa576e2,null));};exports[_0x3d66('0x20')]=function(_0x22c447,_0x18a603){if(_0x22c447[_0x3d66('0x48')]['id']){delete _0x22c447['body']['id'];}return db[_0x3d66('0x2a')][_0x3d66('0x45')]({'where':{'id':_0x22c447[_0x3d66('0x49')]['id']}})[_0x3d66('0x22')](handleEntityNotFound(_0x18a603,null))[_0x3d66('0x22')](saveUpdates(_0x22c447[_0x3d66('0x48')],null))[_0x3d66('0x22')](respondWithResult(_0x18a603,null))['catch'](handleError(_0x18a603,null));};exports['destroy']=function(_0x505abb,_0x3d2fed){return db[_0x3d66('0x2a')]['find']({'where':{'id':_0x505abb[_0x3d66('0x49')]['id']}})[_0x3d66('0x22')](handleEntityNotFound(_0x3d2fed,null))[_0x3d66('0x22')](removeEntity(_0x3d2fed,null))[_0x3d66('0x42')](handleError(_0x3d2fed,null));};exports[_0x3d66('0x4a')]=function(_0x3c1b6d,_0x17bc27){return db[_0x3d66('0x2a')][_0x3d66('0x21')]({'where':{'id':_0x3c1b6d['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3d66('0x22')](respondWithResult(_0x17bc27,0xcc))['catch'](handleError(_0x17bc27,null));};exports['addFields']=function(_0x36b148,_0x68955a,_0xc1a270){return db[_0x3d66('0x4b')][_0x3d66('0x4c')]({'where':{'id':_0x36b148['params']['id']}})[_0x3d66('0x22')](handleEntityNotFound(_0x68955a,null))[_0x3d66('0x22')](function(_0x19e5b5){if(_0x19e5b5){return db[_0x3d66('0x4d')]['transaction'](function(_0x312181){return db[_0x3d66('0x2a')][_0x3d66('0x21')]({'where':{'CustomReportId':_0x36b148['params']['id']},'transaction':_0x312181})['then'](function(_0x4f6ffa){var _0x11b840=_[_0x3d66('0x29')](_0x36b148[_0x3d66('0x48')],function(_0xb3c10e){delete _0xb3c10e['id'];_0xb3c10e['CustomReportId']=_0x36b148[_0x3d66('0x49')]['id'];return _0xb3c10e;});return db[_0x3d66('0x2a')]['bulkCreate'](_0x11b840,{'transaction':_0x312181});});})[_0x3d66('0x22')](function(){return db[_0x3d66('0x2a')][_0x3d66('0x40')]({'where':{'CustomReportId':_0x36b148[_0x3d66('0x49')]['id']}});});}})[_0x3d66('0x22')](respondWithResult(_0x68955a,null))[_0x3d66('0x42')](handleError(_0x68955a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index bc88dbf..3087937 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 _0x7e42=['request-promise','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','util','../../config/logger','moment','bluebird'];(function(_0x24fb94,_0x2b18bf){var _0x2ade56=function(_0x2a0c8b){while(--_0x2a0c8b){_0x24fb94['push'](_0x24fb94['shift']());}};_0x2ade56(++_0x2b18bf);}(_0x7e42,0x1c8));var _0x27e4=function(_0x49cd31,_0xcf7045){_0x49cd31=_0x49cd31-0x0;var _0x60b61e=_0x7e42[_0x49cd31];return _0x60b61e;};'use strict';var _=require('lodash');var util=require(_0x27e4('0x0'));var logger=require(_0x27e4('0x1'))('api');var moment=require(_0x27e4('0x2'));var BPromise=require(_0x27e4('0x3'));var rp=require(_0x27e4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x27e4('0x5'));var attributes=require(_0x27e4('0x6'));module[_0x27e4('0x7')]=function(_0x15bb43,_0x1de848){return _0x15bb43[_0x27e4('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x27e4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7a8=['bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment'];(function(_0x2e1002,_0x258a00){var _0x1621d5=function(_0x52a07f){while(--_0x52a07f){_0x2e1002['push'](_0x2e1002['shift']());}};_0x1621d5(++_0x258a00);}(_0xd7a8,0xdf));var _0x8d7a=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xd7a8[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x8d7a('0x0'));var util=require(_0x8d7a('0x1'));var logger=require(_0x8d7a('0x2'))(_0x8d7a('0x3'));var moment=require(_0x8d7a('0x4'));var BPromise=require(_0x8d7a('0x5'));var rp=require(_0x8d7a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8d7a('0x7'));var attributes=require(_0x8d7a('0x8'));module['exports']=function(_0x5b346c,_0xc096d){return _0x5b346c[_0x8d7a('0x9')](_0x8d7a('0xa'),attributes,{'tableName':_0x8d7a('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 ed1eb52..03f6913 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 _0xbd4c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xbd4c,0x17b));var _0xcbd4=function(_0x5b6790,_0x408472){_0x5b6790=_0x5b6790-0x0;var _0x391592=_0xbd4c[_0x5b6790];return _0x391592;};'use strict';var _=require(_0xcbd4('0x0'));var util=require('util');var moment=require(_0xcbd4('0x1'));var BPromise=require(_0xcbd4('0x2'));var rs=require(_0xcbd4('0x3'));var fs=require('fs');var Redis=require(_0xcbd4('0x4'));var db=require(_0xcbd4('0x5'))['db'];var utils=require(_0xcbd4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcbd4('0x7'));var jayson=require(_0xcbd4('0x8'));var client=jayson[_0xcbd4('0x9')][_0xcbd4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bddf0,_0x2b9e12,_0x2d69ab){return new BPromise(function(_0x453bd6,_0x3ee144){return client['request'](_0x3bddf0,_0x2d69ab)[_0xcbd4('0xb')](function(_0x558b8e){logger['info'](_0xcbd4('0xc'),_0x2b9e12,_0xcbd4('0xd'));logger[_0xcbd4('0xe')](_0xcbd4('0xf'),_0x2b9e12,_0xcbd4('0xd'),JSON[_0xcbd4('0x10')](_0x558b8e));if(_0x558b8e[_0xcbd4('0x11')]){if(_0x558b8e[_0xcbd4('0x11')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b9e12,_0x558b8e[_0xcbd4('0x11')][_0xcbd4('0x12')]);return _0x3ee144(_0x558b8e[_0xcbd4('0x11')][_0xcbd4('0x12')]);}logger[_0xcbd4('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2b9e12,_0x558b8e[_0xcbd4('0x11')][_0xcbd4('0x12')]);return _0x453bd6(_0x558b8e['error'][_0xcbd4('0x12')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b9e12,_0xcbd4('0xd'));_0x453bd6(_0x558b8e[_0xcbd4('0x13')][_0xcbd4('0x12')]);}})['catch'](function(_0x348fe9){logger[_0xcbd4('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2b9e12,_0x348fe9);_0x3ee144(_0x348fe9);});});} \ No newline at end of file +var _0xb2a2=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x98159,_0x488ea5){var _0x533437=function(_0x328329){while(--_0x328329){_0x98159['push'](_0x98159['shift']());}};_0x533437(++_0x488ea5);}(_0xb2a2,0x9e));var _0x2b2a=function(_0x590ad9,_0x209118){_0x590ad9=_0x590ad9-0x0;var _0x50ba0e=_0xb2a2[_0x590ad9];return _0x50ba0e;};'use strict';var _=require(_0x2b2a('0x0'));var util=require(_0x2b2a('0x1'));var moment=require(_0x2b2a('0x2'));var BPromise=require(_0x2b2a('0x3'));var rs=require(_0x2b2a('0x4'));var fs=require('fs');var Redis=require(_0x2b2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2b2a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2b2a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4dc7f4,_0x3a2eae,_0xf8cffc){return new BPromise(function(_0x5da8d8,_0x2a2687){return client['request'](_0x4dc7f4,_0xf8cffc)[_0x2b2a('0x8')](function(_0x3fd0c9){logger[_0x2b2a('0x9')](_0x2b2a('0xa'),_0x3a2eae,_0x2b2a('0xb'));logger[_0x2b2a('0xc')](_0x2b2a('0xd'),_0x3a2eae,_0x2b2a('0xb'),JSON['stringify'](_0x3fd0c9));if(_0x3fd0c9['error']){if(_0x3fd0c9['error'][_0x2b2a('0xe')]===0x1f4){logger[_0x2b2a('0xf')](_0x2b2a('0xa'),_0x3a2eae,_0x3fd0c9['error'][_0x2b2a('0x10')]);return _0x2a2687(_0x3fd0c9[_0x2b2a('0xf')][_0x2b2a('0x10')]);}logger[_0x2b2a('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3a2eae,_0x3fd0c9['error'][_0x2b2a('0x10')]);return _0x5da8d8(_0x3fd0c9[_0x2b2a('0xf')]['message']);}else{logger[_0x2b2a('0x9')](_0x2b2a('0xa'),_0x3a2eae,'request\x20sent');_0x5da8d8(_0x3fd0c9[_0x2b2a('0x11')]['message']);}})[_0x2b2a('0x12')](function(_0x17602e){logger[_0x2b2a('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3a2eae,_0x17602e);_0x2a2687(_0x17602e);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c7aabb3..d77325c 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 _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','post','/create_many','bulkCreate','/:id/create_many','put','update','delete','/destroy_many','bulkDestroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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('./analyticFieldReport.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('0xc')](_0x7995('0xd'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xc')](_0x7995('0xf'),auth[_0x7995('0x9')](),controller['addFields']);router[_0x7995('0x10')](_0x7995('0xb'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x12')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router; \ No newline at end of file +var _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0x166241,_0x227ee2){var _0x51fd00=function(_0x556fd9){while(--_0x556fd9){_0x166241['push'](_0x166241['shift']());}};_0x51fd00(++_0x227ee2);}(_0xe14b,0x93));var _0xbe14=function(_0x14e936,_0x86cf60){_0x14e936=_0x14e936-0x0;var _0x311bce=_0xe14b[_0x14e936];return _0x311bce;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index d716bfb..82ec586 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 _0xcf61=['STRING','TEXT','exports'];(function(_0x94030f,_0x476ed2){var _0x9f7747=function(_0x2b977a){while(--_0x2b977a){_0x94030f['push'](_0x94030f['shift']());}};_0x9f7747(++_0x476ed2);}(_0xcf61,0xda));var _0x1cf6=function(_0x23979b,_0x42c7bc){_0x23979b=_0x23979b-0x0;var _0x377dba=_0xcf61[_0x23979b];return _0x377dba;};'use strict';var Sequelize=require('sequelize');module[_0x1cf6('0x0')]={'name':{'type':Sequelize[_0x1cf6('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x1cf6('0x1')]},'metric':{'type':Sequelize[_0x1cf6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xadcc=['name','TEXT','sequelize','STRING'];(function(_0x18ac44,_0x5e525e){var _0x521d09=function(_0x512ee4){while(--_0x512ee4){_0x18ac44['push'](_0x18ac44['shift']());}};_0x521d09(++_0x5e525e);}(_0xadcc,0x76));var _0xcadc=function(_0x1962a6,_0x2bb0b0){_0x1962a6=_0x1962a6-0x0;var _0x2af0b2=_0xadcc[_0x1962a6];return _0x2af0b2;};'use strict';var Sequelize=require(_0xcadc('0x0'));module['exports']={'name':{'type':Sequelize[_0xcadc('0x1')],'allowNull':![],'unique':_0xcadc('0x2')},'table':{'type':Sequelize[_0xcadc('0x1')]},'metric':{'type':Sequelize[_0xcadc('0x3')]},'description':{'type':Sequelize[_0xcadc('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 0b4f4a7..d85ad5f 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 _0x49c7=['../../config/logger','../../config/utils','../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','Metrics','UserProfileResource','destroy','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','role','get','userProfileId','autoAssociation','error','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x539829,_0x56507d){var _0x4e3b64=function(_0x73a535){while(--_0x73a535){_0x539829['push'](_0x539829['shift']());}};_0x4e3b64(++_0x56507d);}(_0x49c7,0x132));var _0x749c=function(_0x54457b,_0x46af78){_0x54457b=_0x54457b-0x0;var _0x6e55e=_0x49c7[_0x54457b];return _0x6e55e;};'use strict';var pdf=require(_0x749c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x749c('0x1'));var zipdir=require(_0x749c('0x2'));var jsonpatch=require(_0x749c('0x3'));var rp=require(_0x749c('0x4'));var moment=require(_0x749c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x749c('0x6'));var util=require(_0x749c('0x7'));var path=require(_0x749c('0x8'));var sox=require(_0x749c('0x9'));var csv=require('to-csv');var ejs=require(_0x749c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x749c('0xb'));var crypto=require(_0x749c('0xc'));var jsforce=require(_0x749c('0xd'));var deskjs=require(_0x749c('0xe'));var toCsv=require(_0x749c('0xf'));var querystring=require(_0x749c('0x10'));var Papa=require(_0x749c('0x11'));var Redis=require(_0x749c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x749c('0x13'));var as=require(_0x749c('0x14'));var hardwareService=require(_0x749c('0x15'));var logger=require(_0x749c('0x16'))('api');var utils=require(_0x749c('0x17'));var config=require('../../config/environment');var db=require(_0x749c('0x18'))['db'];function respondWithStatusCode(_0x1b5975,_0x99ef69){_0x99ef69=_0x99ef69||0xcc;return function(_0x432127){if(_0x432127){return _0x1b5975['sendStatus'](_0x99ef69);}return _0x1b5975['status'](_0x99ef69)[_0x749c('0x19')]();};}function respondWithResult(_0x4d6498,_0x3a1586){_0x3a1586=_0x3a1586||0xc8;return function(_0xbd121){if(_0xbd121){return _0x4d6498[_0x749c('0x1a')](_0x3a1586)['json'](_0xbd121);}};}function respondWithFilteredResult(_0x2d2373,_0x4e5ccd){return function(_0x4377f8){if(_0x4377f8){var _0x49d3f5=_0x4377f8[_0x749c('0x1b')],_0x44df6d=_0x4e5ccd[_0x749c('0x1c')],_0x21d1f7=_0x4e5ccd[_0x749c('0x1c')]+_0x4e5ccd[_0x749c('0x1d')],_0x532339;if(_0x21d1f7>=_0x49d3f5){_0x21d1f7=_0x49d3f5;_0x532339=0xc8;}else{_0x532339=0xce;}_0x2d2373[_0x749c('0x1a')](_0x532339);return _0x2d2373[_0x749c('0x1e')](_0x749c('0x1f'),_0x44df6d+'-'+_0x21d1f7+'/'+_0x49d3f5)[_0x749c('0x20')](_0x4377f8);}return null;};}function patchUpdates(_0x3e7025){return function(_0x4e36ff){try{jsonpatch['apply'](_0x4e36ff,_0x3e7025,!![]);}catch(_0x2decb9){return BPromise[_0x749c('0x21')](_0x2decb9);}return _0x4e36ff[_0x749c('0x22')]();};}function saveUpdates(_0x36afc2,_0xa69df8){return function(_0x75e5b3){if(_0x75e5b3){return _0x75e5b3[_0x749c('0x23')](_0x36afc2)[_0x749c('0x24')](function(_0x2aabea){return _0x2aabea;});}return null;};}function removeEntity(_0x62eeef,_0xa92037){return function(_0x5cdb03){if(_0x5cdb03){return _0x5cdb03['destroy']()['then'](function(){var _0x911251=_0x5cdb03['get']({'plain':!![]});var _0x177e10=_0x749c('0x25');return db[_0x749c('0x26')][_0x749c('0x27')]({'where':{'type':_0x177e10,'resourceId':_0x911251['id']}})[_0x749c('0x24')](function(){return _0x5cdb03;});})[_0x749c('0x24')](function(){_0x62eeef[_0x749c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fa4e0,_0x33b752){return function(_0x2d2f8a){if(!_0x2d2f8a){_0x1fa4e0['sendStatus'](0x194);}return _0x2d2f8a;};}function handleError(_0x282956,_0xd96f85){_0xd96f85=_0xd96f85||0x1f4;return function(_0x94f81b){logger['error'](_0x94f81b[_0x749c('0x28')]);if(_0x94f81b[_0x749c('0x29')]){delete _0x94f81b[_0x749c('0x29')];}_0x282956[_0x749c('0x1a')](_0xd96f85)[_0x749c('0x2a')](_0x94f81b);};}exports[_0x749c('0x2b')]=function(_0x3cc206,_0x53714a){var _0x5e2a71={},_0x4c8726={},_0x15ca87={'count':0x0,'rows':[]};var _0x334c91=_['map'](db[_0x749c('0x2c')][_0x749c('0x2d')],function(_0x360556){return{'name':_0x360556[_0x749c('0x2e')],'type':_0x360556[_0x749c('0x2f')][_0x749c('0x30')]};});_0x4c8726[_0x749c('0x31')]=_[_0x749c('0x32')](_0x334c91,_0x749c('0x29'));_0x4c8726[_0x749c('0x33')]=_[_0x749c('0x34')](_0x3cc206[_0x749c('0x33')]);_0x4c8726[_0x749c('0x35')]=_['intersection'](_0x4c8726[_0x749c('0x31')],_0x4c8726[_0x749c('0x33')]);_0x5e2a71['attributes']=_[_0x749c('0x36')](_0x4c8726[_0x749c('0x31')],qs[_0x749c('0x37')](_0x3cc206[_0x749c('0x33')][_0x749c('0x37')]));_0x5e2a71[_0x749c('0x38')]=_0x5e2a71[_0x749c('0x38')][_0x749c('0x39')]?_0x5e2a71[_0x749c('0x38')]:_0x4c8726[_0x749c('0x31')];if(!_0x3cc206[_0x749c('0x33')][_0x749c('0x3a')]('nolimit')){_0x5e2a71[_0x749c('0x1d')]=qs[_0x749c('0x1d')](_0x3cc206[_0x749c('0x33')][_0x749c('0x1d')]);_0x5e2a71[_0x749c('0x1c')]=qs[_0x749c('0x1c')](_0x3cc206[_0x749c('0x33')][_0x749c('0x1c')]);}_0x5e2a71[_0x749c('0x3b')]=qs[_0x749c('0x3c')](_0x3cc206['query']['sort']);_0x5e2a71[_0x749c('0x3d')]=qs[_0x749c('0x35')](_[_0x749c('0x3e')](_0x3cc206[_0x749c('0x33')],_0x4c8726[_0x749c('0x35')]));if(_0x3cc206['query'][_0x749c('0x3f')]){_0x5e2a71[_0x749c('0x3d')]=_[_0x749c('0x40')](_0x5e2a71['where'],{'$or':_[_0x749c('0x32')](_0x334c91,function(_0x926330){if(_0x926330[_0x749c('0x2f')]!==_0x749c('0x41')){var _0x1e209b={};_0x1e209b[_0x926330['name']]={'$like':'%'+_0x3cc206[_0x749c('0x33')][_0x749c('0x3f')]+'%'};return _0x1e209b;}})});}_0x5e2a71=_[_0x749c('0x40')]({},_0x5e2a71,_0x3cc206[_0x749c('0x42')]);var _0x3141d8={'where':_0x5e2a71['where']};return db[_0x749c('0x2c')]['count'](_0x3141d8)['then'](function(_0x48cb4f){_0x15ca87[_0x749c('0x1b')]=_0x48cb4f;if(_0x3cc206[_0x749c('0x33')][_0x749c('0x43')]){_0x5e2a71[_0x749c('0x44')]=[{'all':!![]}];}return db[_0x749c('0x2c')][_0x749c('0x45')](_0x5e2a71);})[_0x749c('0x24')](function(_0x1f943c){_0x15ca87[_0x749c('0x46')]=_0x1f943c;return _0x15ca87;})[_0x749c('0x24')](respondWithFilteredResult(_0x53714a,_0x5e2a71))['catch'](handleError(_0x53714a,null));};exports[_0x749c('0x47')]=function(_0x525a3e,_0x1ecdc7){var _0x5ac9f9={'raw':!![],'where':{'id':_0x525a3e[_0x749c('0x48')]['id']}},_0x5bb1b2={};_0x5bb1b2[_0x749c('0x31')]=_[_0x749c('0x34')](db[_0x749c('0x2c')][_0x749c('0x2d')]);_0x5bb1b2[_0x749c('0x33')]=_[_0x749c('0x34')](_0x525a3e[_0x749c('0x33')]);_0x5bb1b2[_0x749c('0x35')]=_[_0x749c('0x36')](_0x5bb1b2[_0x749c('0x31')],_0x5bb1b2[_0x749c('0x33')]);_0x5ac9f9[_0x749c('0x38')]=_[_0x749c('0x36')](_0x5bb1b2['model'],qs[_0x749c('0x37')](_0x525a3e['query'][_0x749c('0x37')]));_0x5ac9f9[_0x749c('0x38')]=_0x5ac9f9[_0x749c('0x38')][_0x749c('0x39')]?_0x5ac9f9['attributes']:_0x5bb1b2[_0x749c('0x31')];if(_0x525a3e[_0x749c('0x33')][_0x749c('0x43')]){_0x5ac9f9[_0x749c('0x44')]=[{'all':!![]}];}_0x5ac9f9=_[_0x749c('0x40')]({},_0x5ac9f9,_0x525a3e[_0x749c('0x42')]);return db[_0x749c('0x2c')][_0x749c('0x49')](_0x5ac9f9)[_0x749c('0x24')](handleEntityNotFound(_0x1ecdc7,null))[_0x749c('0x24')](respondWithResult(_0x1ecdc7,null))[_0x749c('0x4a')](handleError(_0x1ecdc7,null));};exports['create']=function(_0x230400,_0x22a687){return db[_0x749c('0x2c')][_0x749c('0x4b')](_0x230400[_0x749c('0x4c')],{})['then'](function(_0x5e1e63){var _0x5121f3=_0x230400['user']['get']({'plain':!![]});if(!_0x5121f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5121f3[_0x749c('0x4d')]==='user'){var _0x5d02f4=_0x5e1e63[_0x749c('0x4e')]({'plain':!![]});var _0x5e8ef4=_0x749c('0x25');return db['UserProfileSection'][_0x749c('0x49')]({'where':{'name':_0x5e8ef4,'userProfileId':_0x5121f3[_0x749c('0x4f')]},'raw':!![]})[_0x749c('0x24')](function(_0x1eb3fc){if(_0x1eb3fc&&_0x1eb3fc[_0x749c('0x50')]===0x0){return db[_0x749c('0x26')]['create']({'name':_0x5d02f4[_0x749c('0x29')],'resourceId':_0x5d02f4['id'],'type':_0x1eb3fc[_0x749c('0x29')],'sectionId':_0x1eb3fc['id']},{})[_0x749c('0x24')](function(){return _0x5e1e63;});}else{return _0x5e1e63;}})['catch'](function(_0x343ebf){logger[_0x749c('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x343ebf);throw _0x343ebf;});}return _0x5e1e63;})[_0x749c('0x24')](respondWithResult(_0x22a687,0xc9))['catch'](handleError(_0x22a687,null));};exports[_0x749c('0x23')]=function(_0x4d4a6c,_0x34a3fb){if(_0x4d4a6c[_0x749c('0x4c')]['id']){delete _0x4d4a6c[_0x749c('0x4c')]['id'];}return db[_0x749c('0x2c')][_0x749c('0x49')]({'where':{'id':_0x4d4a6c[_0x749c('0x48')]['id']}})[_0x749c('0x24')](handleEntityNotFound(_0x34a3fb,null))[_0x749c('0x24')](saveUpdates(_0x4d4a6c['body'],null))[_0x749c('0x24')](respondWithResult(_0x34a3fb,null))[_0x749c('0x4a')](handleError(_0x34a3fb,null));};exports['destroy']=function(_0x41c01e,_0x31f33d){return db[_0x749c('0x2c')][_0x749c('0x49')]({'where':{'id':_0x41c01e[_0x749c('0x48')]['id']}})['then'](handleEntityNotFound(_0x31f33d,null))[_0x749c('0x24')](removeEntity(_0x31f33d,null))['catch'](handleError(_0x31f33d,null));}; \ No newline at end of file +var _0xa37f=['path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','Metrics','UserProfileResource','then','error','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','intersection','includeAll','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util'];(function(_0x34fce2,_0x5571d3){var _0x2381d8=function(_0x772b0e){while(--_0x772b0e){_0x34fce2['push'](_0x34fce2['shift']());}};_0x2381d8(++_0x5571d3);}(_0xa37f,0x1e5));var _0xfa37=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa37f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xfa37('0x0'));var emlformat=require(_0xfa37('0x1'));var rimraf=require(_0xfa37('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa37('0x3'));var moment=require('moment');var BPromise=require(_0xfa37('0x4'));var Mustache=require(_0xfa37('0x5'));var util=require(_0xfa37('0x6'));var path=require(_0xfa37('0x7'));var sox=require(_0xfa37('0x8'));var csv=require(_0xfa37('0x9'));var ejs=require(_0xfa37('0xa'));var fs=require('fs');var _=require(_0xfa37('0xb'));var squel=require('squel');var crypto=require(_0xfa37('0xc'));var jsforce=require(_0xfa37('0xd'));var deskjs=require(_0xfa37('0xe'));var toCsv=require(_0xfa37('0x9'));var querystring=require(_0xfa37('0xf'));var Papa=require('papaparse');var Redis=require(_0xfa37('0x10'));var authService=require(_0xfa37('0x11'));var qs=require(_0xfa37('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa37('0x13'));var logger=require(_0xfa37('0x14'))(_0xfa37('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2249cb,_0x436248){_0x436248=_0x436248||0xcc;return function(_0x14c938){if(_0x14c938){return _0x2249cb[_0xfa37('0x16')](_0x436248);}return _0x2249cb['status'](_0x436248)[_0xfa37('0x17')]();};}function respondWithResult(_0x13d078,_0x186682){_0x186682=_0x186682||0xc8;return function(_0x2e70d3){if(_0x2e70d3){return _0x13d078['status'](_0x186682)[_0xfa37('0x18')](_0x2e70d3);}};}function respondWithFilteredResult(_0x471954,_0x1ac689){return function(_0x3d8d2a){if(_0x3d8d2a){var _0x246883=_0x3d8d2a[_0xfa37('0x19')],_0x3ed83d=_0x1ac689['offset'],_0x55e397=_0x1ac689[_0xfa37('0x1a')]+_0x1ac689[_0xfa37('0x1b')],_0x435930;if(_0x55e397>=_0x246883){_0x55e397=_0x246883;_0x435930=0xc8;}else{_0x435930=0xce;}_0x471954[_0xfa37('0x1c')](_0x435930);return _0x471954[_0xfa37('0x1d')](_0xfa37('0x1e'),_0x3ed83d+'-'+_0x55e397+'/'+_0x246883)['json'](_0x3d8d2a);}return null;};}function patchUpdates(_0x1d5833){return function(_0x44f7a8){try{jsonpatch[_0xfa37('0x1f')](_0x44f7a8,_0x1d5833,!![]);}catch(_0x2d9778){return BPromise['reject'](_0x2d9778);}return _0x44f7a8[_0xfa37('0x20')]();};}function saveUpdates(_0x1a9148,_0x1a4b7b){return function(_0x36e132){if(_0x36e132){return _0x36e132[_0xfa37('0x21')](_0x1a9148)['then'](function(_0x1ffd91){return _0x1ffd91;});}return null;};}function removeEntity(_0x348890,_0x353c91){return function(_0x71f5a6){if(_0x71f5a6){return _0x71f5a6['destroy']()['then'](function(){var _0x4f8b8c=_0x71f5a6['get']({'plain':!![]});var _0x481862=_0xfa37('0x22');return db[_0xfa37('0x23')]['destroy']({'where':{'type':_0x481862,'resourceId':_0x4f8b8c['id']}})[_0xfa37('0x24')](function(){return _0x71f5a6;});})[_0xfa37('0x24')](function(){_0x348890[_0xfa37('0x1c')](0xcc)[_0xfa37('0x17')]();});}};}function handleEntityNotFound(_0x228e62,_0xa6d1d8){return function(_0x554882){if(!_0x554882){_0x228e62[_0xfa37('0x16')](0x194);}return _0x554882;};}function handleError(_0x48ff74,_0x3822c5){_0x3822c5=_0x3822c5||0x1f4;return function(_0x578882){logger[_0xfa37('0x25')](_0x578882['stack']);if(_0x578882[_0xfa37('0x26')]){delete _0x578882[_0xfa37('0x26')];}_0x48ff74[_0xfa37('0x1c')](_0x3822c5)[_0xfa37('0x27')](_0x578882);};}exports[_0xfa37('0x28')]=function(_0x306dff,_0x4ea57b){var _0x5be907={},_0x19c71e={},_0x3ce3f9={'count':0x0,'rows':[]};var _0x35bff=_[_0xfa37('0x29')](db[_0xfa37('0x2a')][_0xfa37('0x2b')],function(_0x370aa6){return{'name':_0x370aa6[_0xfa37('0x2c')],'type':_0x370aa6[_0xfa37('0x2d')][_0xfa37('0x2e')]};});_0x19c71e[_0xfa37('0x2f')]=_[_0xfa37('0x29')](_0x35bff,_0xfa37('0x26'));_0x19c71e[_0xfa37('0x30')]=_[_0xfa37('0x31')](_0x306dff[_0xfa37('0x30')]);_0x19c71e[_0xfa37('0x32')]=_['intersection'](_0x19c71e[_0xfa37('0x2f')],_0x19c71e['query']);_0x5be907['attributes']=_['intersection'](_0x19c71e[_0xfa37('0x2f')],qs['fields'](_0x306dff['query'][_0xfa37('0x33')]));_0x5be907['attributes']=_0x5be907[_0xfa37('0x34')][_0xfa37('0x35')]?_0x5be907['attributes']:_0x19c71e[_0xfa37('0x2f')];if(!_0x306dff[_0xfa37('0x30')][_0xfa37('0x36')]('nolimit')){_0x5be907[_0xfa37('0x1b')]=qs['limit'](_0x306dff[_0xfa37('0x30')][_0xfa37('0x1b')]);_0x5be907[_0xfa37('0x1a')]=qs[_0xfa37('0x1a')](_0x306dff[_0xfa37('0x30')][_0xfa37('0x1a')]);}_0x5be907[_0xfa37('0x37')]=qs[_0xfa37('0x38')](_0x306dff[_0xfa37('0x30')][_0xfa37('0x38')]);_0x5be907[_0xfa37('0x39')]=qs[_0xfa37('0x32')](_[_0xfa37('0x3a')](_0x306dff[_0xfa37('0x30')],_0x19c71e[_0xfa37('0x32')]));if(_0x306dff[_0xfa37('0x30')][_0xfa37('0x3b')]){_0x5be907['where']=_[_0xfa37('0x3c')](_0x5be907['where'],{'$or':_['map'](_0x35bff,function(_0x677963){if(_0x677963[_0xfa37('0x2d')]!==_0xfa37('0x3d')){var _0x4debc3={};_0x4debc3[_0x677963[_0xfa37('0x26')]]={'$like':'%'+_0x306dff['query'][_0xfa37('0x3b')]+'%'};return _0x4debc3;}})});}_0x5be907=_[_0xfa37('0x3c')]({},_0x5be907,_0x306dff['options']);var _0x1c4f0d={'where':_0x5be907[_0xfa37('0x39')]};return db[_0xfa37('0x2a')][_0xfa37('0x19')](_0x1c4f0d)[_0xfa37('0x24')](function(_0x415260){_0x3ce3f9[_0xfa37('0x19')]=_0x415260;if(_0x306dff['query']['includeAll']){_0x5be907[_0xfa37('0x3e')]=[{'all':!![]}];}return db[_0xfa37('0x2a')][_0xfa37('0x3f')](_0x5be907);})[_0xfa37('0x24')](function(_0x5914ef){_0x3ce3f9[_0xfa37('0x40')]=_0x5914ef;return _0x3ce3f9;})[_0xfa37('0x24')](respondWithFilteredResult(_0x4ea57b,_0x5be907))[_0xfa37('0x41')](handleError(_0x4ea57b,null));};exports['show']=function(_0x2763df,_0x2b1aa8){var _0x3b0380={'raw':!![],'where':{'id':_0x2763df[_0xfa37('0x42')]['id']}},_0x437ca7={};_0x437ca7[_0xfa37('0x2f')]=_[_0xfa37('0x31')](db[_0xfa37('0x2a')]['rawAttributes']);_0x437ca7['query']=_[_0xfa37('0x31')](_0x2763df[_0xfa37('0x30')]);_0x437ca7[_0xfa37('0x32')]=_['intersection'](_0x437ca7[_0xfa37('0x2f')],_0x437ca7['query']);_0x3b0380[_0xfa37('0x34')]=_[_0xfa37('0x43')](_0x437ca7[_0xfa37('0x2f')],qs[_0xfa37('0x33')](_0x2763df[_0xfa37('0x30')][_0xfa37('0x33')]));_0x3b0380[_0xfa37('0x34')]=_0x3b0380[_0xfa37('0x34')]['length']?_0x3b0380['attributes']:_0x437ca7[_0xfa37('0x2f')];if(_0x2763df[_0xfa37('0x30')][_0xfa37('0x44')]){_0x3b0380[_0xfa37('0x3e')]=[{'all':!![]}];}_0x3b0380=_[_0xfa37('0x3c')]({},_0x3b0380,_0x2763df[_0xfa37('0x45')]);return db[_0xfa37('0x2a')][_0xfa37('0x46')](_0x3b0380)[_0xfa37('0x24')](handleEntityNotFound(_0x2b1aa8,null))['then'](respondWithResult(_0x2b1aa8,null))[_0xfa37('0x41')](handleError(_0x2b1aa8,null));};exports[_0xfa37('0x47')]=function(_0x436f8f,_0x26c6ef){return db['AnalyticMetric'][_0xfa37('0x47')](_0x436f8f['body'],{})['then'](function(_0x2a9847){var _0x4f5549=_0x436f8f[_0xfa37('0x48')][_0xfa37('0x49')]({'plain':!![]});if(!_0x4f5549)throw new Error(_0xfa37('0x4a'));if(_0x4f5549[_0xfa37('0x4b')]===_0xfa37('0x48')){var _0x2701eb=_0x2a9847[_0xfa37('0x49')]({'plain':!![]});var _0x26d697='Metrics';return db[_0xfa37('0x4c')][_0xfa37('0x46')]({'where':{'name':_0x26d697,'userProfileId':_0x4f5549[_0xfa37('0x4d')]},'raw':!![]})[_0xfa37('0x24')](function(_0x570826){if(_0x570826&&_0x570826[_0xfa37('0x4e')]===0x0){return db[_0xfa37('0x23')]['create']({'name':_0x2701eb[_0xfa37('0x26')],'resourceId':_0x2701eb['id'],'type':_0x570826['name'],'sectionId':_0x570826['id']},{})[_0xfa37('0x24')](function(){return _0x2a9847;});}else{return _0x2a9847;}})['catch'](function(_0x5543e6){logger['error'](_0xfa37('0x4f'),_0x5543e6);throw _0x5543e6;});}return _0x2a9847;})[_0xfa37('0x24')](respondWithResult(_0x26c6ef,0xc9))[_0xfa37('0x41')](handleError(_0x26c6ef,null));};exports[_0xfa37('0x21')]=function(_0x2f2484,_0x2b355d){if(_0x2f2484['body']['id']){delete _0x2f2484[_0xfa37('0x50')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x2f2484['params']['id']}})[_0xfa37('0x24')](handleEntityNotFound(_0x2b355d,null))['then'](saveUpdates(_0x2f2484[_0xfa37('0x50')],null))[_0xfa37('0x24')](respondWithResult(_0x2b355d,null))[_0xfa37('0x41')](handleError(_0x2b355d,null));};exports[_0xfa37('0x51')]=function(_0x2b76f9,_0x19a139){return db[_0xfa37('0x2a')]['find']({'where':{'id':_0x2b76f9[_0xfa37('0x42')]['id']}})[_0xfa37('0x24')](handleEntityNotFound(_0x19a139,null))[_0xfa37('0x24')](removeEntity(_0x19a139,null))[_0xfa37('0x41')](handleError(_0x19a139,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index e911fb9..b7dc696 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 _0x4631=['define','AnalyticMetric','lodash','util','../../config/logger','request-promise','path','rimraf','./analyticMetric.attributes','exports'];(function(_0x5ebf44,_0x4e543e){var _0x2fef12=function(_0x59d629){while(--_0x59d629){_0x5ebf44['push'](_0x5ebf44['shift']());}};_0x2fef12(++_0x4e543e);}(_0x4631,0x70));var _0x1463=function(_0x599c94,_0x464f0e){_0x599c94=_0x599c94-0x0;var _0x34e215=_0x4631[_0x599c94];return _0x34e215;};'use strict';var _=require(_0x1463('0x0'));var util=require(_0x1463('0x1'));var logger=require(_0x1463('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1463('0x3'));var fs=require('fs');var path=require(_0x1463('0x4'));var rimraf=require(_0x1463('0x5'));var config=require('../../config/environment');var attributes=require(_0x1463('0x6'));module[_0x1463('0x7')]=function(_0x53c290,_0x1c2fdf){return _0x53c290[_0x1463('0x8')](_0x1463('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5aae=['../../config/environment','exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4479c3,_0x1e23be){var _0x3d55c8=function(_0x335393){while(--_0x335393){_0x4479c3['push'](_0x4479c3['shift']());}};_0x3d55c8(++_0x1e23be);}(_0x5aae,0x72));var _0xe5aa=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5aae[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xe5aa('0x0'));var util=require(_0xe5aa('0x1'));var logger=require(_0xe5aa('0x2'))(_0xe5aa('0x3'));var moment=require(_0xe5aa('0x4'));var BPromise=require(_0xe5aa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe5aa('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xe5aa('0x7')]=function(_0x5e16ca,_0x1c1f3c){return _0x5e16ca['define'](_0xe5aa('0x8'),attributes,{'tableName':_0xe5aa('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 647e2cd..91858bc 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 _0x5105=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x44460,_0x3726a2){var _0x3d52dc=function(_0x294317){while(--_0x294317){_0x44460['push'](_0x44460['shift']());}};_0x3d52dc(++_0x3726a2);}(_0x5105,0x19e));var _0x5510=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5105[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x5510('0x0'));var util=require(_0x5510('0x1'));var moment=require(_0x5510('0x2'));var BPromise=require(_0x5510('0x3'));var rs=require(_0x5510('0x4'));var fs=require('fs');var Redis=require(_0x5510('0x5'));var db=require(_0x5510('0x6'))['db'];var utils=require(_0x5510('0x7'));var logger=require(_0x5510('0x8'))(_0x5510('0x9'));var config=require('../../config/environment');var jayson=require(_0x5510('0xa'));var client=jayson['client'][_0x5510('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14cce0,_0x141cdc,_0x11f8a1){return new BPromise(function(_0x77435d,_0x385a46){return client[_0x5510('0xc')](_0x14cce0,_0x11f8a1)[_0x5510('0xd')](function(_0x3af140){logger['info'](_0x5510('0xe'),_0x141cdc,_0x5510('0xf'));logger[_0x5510('0x10')](_0x5510('0x11'),_0x141cdc,'request\x20sent',JSON[_0x5510('0x12')](_0x3af140));if(_0x3af140[_0x5510('0x13')]){if(_0x3af140[_0x5510('0x13')]['code']===0x1f4){logger['error'](_0x5510('0xe'),_0x141cdc,_0x3af140['error'][_0x5510('0x14')]);return _0x385a46(_0x3af140[_0x5510('0x13')]['message']);}logger[_0x5510('0x13')](_0x5510('0xe'),_0x141cdc,_0x3af140[_0x5510('0x13')]['message']);return _0x77435d(_0x3af140[_0x5510('0x13')]['message']);}else{logger[_0x5510('0x15')]('AnalyticMetric,\x20%s,\x20%s',_0x141cdc,'request\x20sent');_0x77435d(_0x3af140['result']['message']);}})[_0x5510('0x16')](function(_0x232b16){logger[_0x5510('0x13')](_0x5510('0xe'),_0x141cdc,_0x232b16);_0x385a46(_0x232b16);});});} \ No newline at end of file +var _0x24f5=['error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2d81b4,_0x243620){var _0x418f00=function(_0x4a1317){while(--_0x4a1317){_0x2d81b4['push'](_0x2d81b4['shift']());}};_0x418f00(++_0x243620);}(_0x24f5,0xe7));var _0x524f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x24f5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x524f('0x0'));var util=require(_0x524f('0x1'));var moment=require(_0x524f('0x2'));var BPromise=require(_0x524f('0x3'));var rs=require(_0x524f('0x4'));var fs=require('fs');var Redis=require(_0x524f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x524f('0x6'));var logger=require(_0x524f('0x7'))('rpc');var config=require(_0x524f('0x8'));var jayson=require(_0x524f('0x9'));var client=jayson[_0x524f('0xa')][_0x524f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ca4c7,_0x414d82,_0x4130b8){return new BPromise(function(_0x580cac,_0x431b38){return client[_0x524f('0xc')](_0x3ca4c7,_0x4130b8)[_0x524f('0xd')](function(_0x9d3855){logger[_0x524f('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x414d82,_0x524f('0xf'));logger[_0x524f('0x10')](_0x524f('0x11'),_0x414d82,_0x524f('0xf'),JSON[_0x524f('0x12')](_0x9d3855));if(_0x9d3855[_0x524f('0x13')]){if(_0x9d3855[_0x524f('0x13')][_0x524f('0x14')]===0x1f4){logger['error'](_0x524f('0x15'),_0x414d82,_0x9d3855[_0x524f('0x13')][_0x524f('0x16')]);return _0x431b38(_0x9d3855[_0x524f('0x13')][_0x524f('0x16')]);}logger[_0x524f('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x414d82,_0x9d3855[_0x524f('0x13')][_0x524f('0x16')]);return _0x580cac(_0x9d3855['error'][_0x524f('0x16')]);}else{logger[_0x524f('0xe')](_0x524f('0x15'),_0x414d82,_0x524f('0xf'));_0x580cac(_0x9d3855[_0x524f('0x17')]['message']);}})[_0x524f('0x18')](function(_0x122640){logger[_0x524f('0x13')](_0x524f('0x15'),_0x414d82,_0x122640);_0x431b38(_0x122640);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 1febc95..bba8ddc 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 _0x524e=['/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x4b17b8,_0x26aabe){var _0x414f8d=function(_0x11c750){while(--_0x11c750){_0x4b17b8['push'](_0x4b17b8['shift']());}};_0x414f8d(++_0x26aabe);}(_0x524e,0x15e));var _0xe524=function(_0x4c92a1,_0x22b327){_0x4c92a1=_0x4c92a1-0x0;var _0x425e7d=_0x524e[_0x4c92a1];return _0x425e7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var auth=require(_0xe524('0x4'));var interaction=require(_0xe524('0x5'));var config=require(_0xe524('0x6'));var controller=require(_0xe524('0x7'));router[_0xe524('0x8')]('/',auth[_0xe524('0x9')](),controller['index']);router[_0xe524('0x8')](_0xe524('0xa'),auth[_0xe524('0x9')](),controller['show']);router[_0xe524('0xb')]('/',auth[_0xe524('0x9')](),controller[_0xe524('0xc')]);router[_0xe524('0xd')](_0xe524('0xa'),auth[_0xe524('0x9')](),controller[_0xe524('0xe')]);router[_0xe524('0xf')](_0xe524('0xa'),auth[_0xe524('0x9')](),controller[_0xe524('0x10')]);module[_0xe524('0x11')]=router; \ No newline at end of file +var _0xadb5=['destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x6c4af9,_0x3364ce){var _0x5408ee=function(_0x367967){while(--_0x367967){_0x6c4af9['push'](_0x6c4af9['shift']());}};_0x5408ee(++_0x3364ce);}(_0xadb5,0xad));var _0x5adb=function(_0x375a4d,_0x192d69){_0x375a4d=_0x375a4d-0x0;var _0x41bfc4=_0xadb5[_0x375a4d];return _0x41bfc4;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0xc')]('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router[_0x5adb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x11')]);module[_0x5adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index e0789a5..f15de28 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 _0xff52=['exports','TEXT'];(function(_0x27b51f,_0x23841d){var _0x10d44c=function(_0x460eff){while(--_0x460eff){_0x27b51f['push'](_0x27b51f['shift']());}};_0x10d44c(++_0x23841d);}(_0xff52,0xc4));var _0x2ff5=function(_0x19e3c2,_0x177a95){_0x19e3c2=_0x19e3c2-0x0;var _0x2bb88f=_0xff52[_0x19e3c2];return _0x2bb88f;};'use strict';var Sequelize=require('sequelize');module[_0x2ff5('0x0')]={'tree':{'type':Sequelize[_0x2ff5('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x781c=['TEXT','sequelize','exports'];(function(_0x2f1172,_0x5f5b26){var _0x58e374=function(_0x1a61fa){while(--_0x1a61fa){_0x2f1172['push'](_0x2f1172['shift']());}};_0x58e374(++_0x5f5b26);}(_0x781c,0x1cc));var _0xc781=function(_0x1bc3a5,_0x193629){_0x1bc3a5=_0x1bc3a5-0x0;var _0x2253a5=_0x781c[_0x1bc3a5];return _0x2253a5;};'use strict';var Sequelize=require(_0xc781('0x0'));module[_0xc781('0x1')]={'tree':{'type':Sequelize[_0xc781('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 eba087f..2213bd5 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 _0x4fc2=['../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','keys','filters','intersection','query','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','attributes','includeAll','create','update','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5e62f7,_0x61981b){var _0x388289=function(_0x16926b){while(--_0x16926b){_0x5e62f7['push'](_0x5e62f7['shift']());}};_0x388289(++_0x61981b);}(_0x4fc2,0x111));var _0x24fc=function(_0x383a26,_0x460b36){_0x383a26=_0x383a26-0x0;var _0x41b31a=_0x4fc2[_0x383a26];return _0x41b31a;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var as=require(_0x24fc('0x13'));var hardwareService=require(_0x24fc('0x14'));var logger=require(_0x24fc('0x15'))(_0x24fc('0x16'));var utils=require(_0x24fc('0x17'));var config=require('../../config/environment');var db=require(_0x24fc('0x18'))['db'];function respondWithStatusCode(_0x1cde5d,_0x5cc65e){_0x5cc65e=_0x5cc65e||0xcc;return function(_0x306873){if(_0x306873){return _0x1cde5d[_0x24fc('0x19')](_0x5cc65e);}return _0x1cde5d[_0x24fc('0x1a')](_0x5cc65e)[_0x24fc('0x1b')]();};}function respondWithResult(_0x30f19b,_0x326276){_0x326276=_0x326276||0xc8;return function(_0x537b5c){if(_0x537b5c){return _0x30f19b[_0x24fc('0x1a')](_0x326276)[_0x24fc('0x1c')](_0x537b5c);}};}function respondWithFilteredResult(_0x2ffed3,_0x42cbe8){return function(_0x4acd36){if(_0x4acd36){var _0x2ac989=_0x4acd36[_0x24fc('0x1d')],_0x588543=_0x42cbe8[_0x24fc('0x1e')],_0x4af098=_0x42cbe8[_0x24fc('0x1e')]+_0x42cbe8['limit'],_0x3385c7;if(_0x4af098>=_0x2ac989){_0x4af098=_0x2ac989;_0x3385c7=0xc8;}else{_0x3385c7=0xce;}_0x2ffed3[_0x24fc('0x1a')](_0x3385c7);return _0x2ffed3[_0x24fc('0x1f')](_0x24fc('0x20'),_0x588543+'-'+_0x4af098+'/'+_0x2ac989)[_0x24fc('0x1c')](_0x4acd36);}return null;};}function patchUpdates(_0x4c5a43){return function(_0x5eabee){try{jsonpatch[_0x24fc('0x21')](_0x5eabee,_0x4c5a43,!![]);}catch(_0x304881){return BPromise['reject'](_0x304881);}return _0x5eabee[_0x24fc('0x22')]();};}function saveUpdates(_0x36a771,_0xbf1d6b){return function(_0x2d0e3d){if(_0x2d0e3d){return _0x2d0e3d['update'](_0x36a771)[_0x24fc('0x23')](function(_0x545939){return _0x545939;});}return null;};}function removeEntity(_0x339b50,_0x591c8f){return function(_0x3ed464){if(_0x3ed464){return _0x3ed464[_0x24fc('0x24')]()[_0x24fc('0x23')](function(){_0x339b50['status'](0xcc)[_0x24fc('0x1b')]();});}};}function handleEntityNotFound(_0x552035,_0x35a9c7){return function(_0x2bb93a){if(!_0x2bb93a){_0x552035[_0x24fc('0x19')](0x194);}return _0x2bb93a;};}function handleError(_0x34b5b2,_0x3296fc){_0x3296fc=_0x3296fc||0x1f4;return function(_0x262e11){logger[_0x24fc('0x25')](_0x262e11[_0x24fc('0x26')]);if(_0x262e11[_0x24fc('0x27')]){delete _0x262e11[_0x24fc('0x27')];}_0x34b5b2['status'](_0x3296fc)[_0x24fc('0x28')](_0x262e11);};}exports[_0x24fc('0x29')]=function(_0x3ee302,_0x5bb4c8){var _0xf2f77d={},_0x3d1ec8={},_0x35f9f9={'count':0x0,'rows':[]};var _0x290f84=_[_0x24fc('0x2a')](db[_0x24fc('0x2b')]['rawAttributes'],function(_0x240ae7){return{'name':_0x240ae7[_0x24fc('0x2c')],'type':_0x240ae7[_0x24fc('0x2d')][_0x24fc('0x2e')]};});_0x3d1ec8[_0x24fc('0x2f')]=_['map'](_0x290f84,'name');_0x3d1ec8['query']=_[_0x24fc('0x30')](_0x3ee302['query']);_0x3d1ec8[_0x24fc('0x31')]=_[_0x24fc('0x32')](_0x3d1ec8[_0x24fc('0x2f')],_0x3d1ec8[_0x24fc('0x33')]);_0xf2f77d['attributes']=_[_0x24fc('0x32')](_0x3d1ec8[_0x24fc('0x2f')],qs['fields'](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x34')]));_0xf2f77d['attributes']=_0xf2f77d['attributes'][_0x24fc('0x35')]?_0xf2f77d['attributes']:_0x3d1ec8[_0x24fc('0x2f')];if(!_0x3ee302[_0x24fc('0x33')]['hasOwnProperty'](_0x24fc('0x36'))){_0xf2f77d[_0x24fc('0x37')]=qs[_0x24fc('0x37')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x37')]);_0xf2f77d[_0x24fc('0x1e')]=qs[_0x24fc('0x1e')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x1e')]);}_0xf2f77d['order']=qs[_0x24fc('0x38')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x38')]);_0xf2f77d[_0x24fc('0x39')]=qs[_0x24fc('0x31')](_['pick'](_0x3ee302['query'],_0x3d1ec8[_0x24fc('0x31')]));if(_0x3ee302['query'][_0x24fc('0x3a')]){_0xf2f77d[_0x24fc('0x39')]=_[_0x24fc('0x3b')](_0xf2f77d[_0x24fc('0x39')],{'$or':_['map'](_0x290f84,function(_0x610638){if(_0x610638['type']!==_0x24fc('0x3c')){var _0x3b8fb6={};_0x3b8fb6[_0x610638[_0x24fc('0x27')]]={'$like':'%'+_0x3ee302[_0x24fc('0x33')][_0x24fc('0x3a')]+'%'};return _0x3b8fb6;}})});}_0xf2f77d=_['merge']({},_0xf2f77d,_0x3ee302[_0x24fc('0x3d')]);var _0x3f40cd={'where':_0xf2f77d[_0x24fc('0x39')]};return db[_0x24fc('0x2b')]['count'](_0x3f40cd)[_0x24fc('0x23')](function(_0x2f0bd9){_0x35f9f9['count']=_0x2f0bd9;if(_0x3ee302[_0x24fc('0x33')]['includeAll']){_0xf2f77d[_0x24fc('0x3e')]=[{'all':!![]}];}return db[_0x24fc('0x2b')][_0x24fc('0x3f')](_0xf2f77d);})[_0x24fc('0x23')](function(_0x431189){_0x35f9f9[_0x24fc('0x40')]=_0x431189;return _0x35f9f9;})[_0x24fc('0x23')](respondWithFilteredResult(_0x5bb4c8,_0xf2f77d))[_0x24fc('0x41')](handleError(_0x5bb4c8,null));};exports['show']=function(_0x1721ea,_0x43fb6d){var _0x32f72c={'raw':!![],'where':{'id':_0x1721ea[_0x24fc('0x42')]['id']}},_0x4fee9f={};_0x4fee9f[_0x24fc('0x2f')]=_['keys'](db[_0x24fc('0x2b')][_0x24fc('0x43')]);_0x4fee9f[_0x24fc('0x33')]=_['keys'](_0x1721ea[_0x24fc('0x33')]);_0x4fee9f[_0x24fc('0x31')]=_['intersection'](_0x4fee9f[_0x24fc('0x2f')],_0x4fee9f[_0x24fc('0x33')]);_0x32f72c[_0x24fc('0x44')]=_[_0x24fc('0x32')](_0x4fee9f['model'],qs[_0x24fc('0x34')](_0x1721ea[_0x24fc('0x33')][_0x24fc('0x34')]));_0x32f72c[_0x24fc('0x44')]=_0x32f72c[_0x24fc('0x44')]['length']?_0x32f72c[_0x24fc('0x44')]:_0x4fee9f[_0x24fc('0x2f')];if(_0x1721ea[_0x24fc('0x33')][_0x24fc('0x45')]){_0x32f72c['include']=[{'all':!![]}];}_0x32f72c=_[_0x24fc('0x3b')]({},_0x32f72c,_0x1721ea[_0x24fc('0x3d')]);return db['AnalyticTreeReport']['find'](_0x32f72c)[_0x24fc('0x23')](handleEntityNotFound(_0x43fb6d,null))['then'](respondWithResult(_0x43fb6d,null))['catch'](handleError(_0x43fb6d,null));};exports[_0x24fc('0x46')]=function(_0x5879c2,_0x281194){return db[_0x24fc('0x2b')][_0x24fc('0x46')](_0x5879c2['body'],{})[_0x24fc('0x23')](respondWithResult(_0x281194,0xc9))[_0x24fc('0x41')](handleError(_0x281194,null));};exports[_0x24fc('0x47')]=function(_0x1ad8d6,_0x39873d){if(_0x1ad8d6[_0x24fc('0x48')]['id']){delete _0x1ad8d6[_0x24fc('0x48')]['id'];}return db[_0x24fc('0x2b')]['find']({'where':{'id':_0x1ad8d6['params']['id']}})[_0x24fc('0x23')](handleEntityNotFound(_0x39873d,null))[_0x24fc('0x23')](saveUpdates(_0x1ad8d6[_0x24fc('0x48')],null))['then'](respondWithResult(_0x39873d,null))['catch'](handleError(_0x39873d,null));};exports[_0x24fc('0x24')]=function(_0x213439,_0x179a60){return db[_0x24fc('0x2b')][_0x24fc('0x49')]({'where':{'id':_0x213439[_0x24fc('0x42')]['id']}})[_0x24fc('0x23')](handleEntityNotFound(_0x179a60,null))[_0x24fc('0x23')](removeEntity(_0x179a60,null))[_0x24fc('0x41')](handleError(_0x179a60,null));}; \ No newline at end of file +var _0xea28=['fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','rows','catch','show','intersection','create','body','update','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','then','destroy','error','stack','index','AnalyticTreeReport','fieldName','type','key','model','map','name','query','keys'];(function(_0x140322,_0x30bcfa){var _0x4f0d2f=function(_0x1f1027){while(--_0x1f1027){_0x140322['push'](_0x140322['shift']());}};_0x4f0d2f(++_0x30bcfa);}(_0xea28,0x13a));var _0x8ea2=function(_0x3ec920,_0x372578){_0x3ec920=_0x3ec920-0x0;var _0x4dd2d1=_0xea28[_0x3ec920];return _0x4dd2d1;};'use strict';var pdf=require(_0x8ea2('0x0'));var emlformat=require(_0x8ea2('0x1'));var rimraf=require(_0x8ea2('0x2'));var zipdir=require(_0x8ea2('0x3'));var jsonpatch=require(_0x8ea2('0x4'));var rp=require(_0x8ea2('0x5'));var moment=require(_0x8ea2('0x6'));var BPromise=require(_0x8ea2('0x7'));var Mustache=require('mustache');var util=require(_0x8ea2('0x8'));var path=require(_0x8ea2('0x9'));var sox=require(_0x8ea2('0xa'));var csv=require('to-csv');var ejs=require(_0x8ea2('0xb'));var fs=require('fs');var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0x11'));var querystring=require(_0x8ea2('0x12'));var Papa=require(_0x8ea2('0x13'));var Redis=require(_0x8ea2('0x14'));var authService=require(_0x8ea2('0x15'));var qs=require(_0x8ea2('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea2('0x17'))(_0x8ea2('0x18'));var utils=require(_0x8ea2('0x19'));var config=require('../../config/environment');var db=require(_0x8ea2('0x1a'))['db'];function respondWithStatusCode(_0x101a15,_0x1dfb6e){_0x1dfb6e=_0x1dfb6e||0xcc;return function(_0x10aead){if(_0x10aead){return _0x101a15[_0x8ea2('0x1b')](_0x1dfb6e);}return _0x101a15['status'](_0x1dfb6e)[_0x8ea2('0x1c')]();};}function respondWithResult(_0x553154,_0x4b2192){_0x4b2192=_0x4b2192||0xc8;return function(_0x772bad){if(_0x772bad){return _0x553154[_0x8ea2('0x1d')](_0x4b2192)[_0x8ea2('0x1e')](_0x772bad);}};}function respondWithFilteredResult(_0x78669a,_0x393faf){return function(_0xbb9bd1){if(_0xbb9bd1){var _0x3cff96=_0xbb9bd1[_0x8ea2('0x1f')],_0x11f5e8=_0x393faf[_0x8ea2('0x20')],_0x474873=_0x393faf[_0x8ea2('0x20')]+_0x393faf[_0x8ea2('0x21')],_0x396aab;if(_0x474873>=_0x3cff96){_0x474873=_0x3cff96;_0x396aab=0xc8;}else{_0x396aab=0xce;}_0x78669a[_0x8ea2('0x1d')](_0x396aab);return _0x78669a[_0x8ea2('0x22')](_0x8ea2('0x23'),_0x11f5e8+'-'+_0x474873+'/'+_0x3cff96)[_0x8ea2('0x1e')](_0xbb9bd1);}return null;};}function patchUpdates(_0x1068b6){return function(_0x233a40){try{jsonpatch[_0x8ea2('0x24')](_0x233a40,_0x1068b6,!![]);}catch(_0x287597){return BPromise['reject'](_0x287597);}return _0x233a40['save']();};}function saveUpdates(_0x3790e9,_0x248c18){return function(_0x29151a){if(_0x29151a){return _0x29151a['update'](_0x3790e9)[_0x8ea2('0x25')](function(_0x218bd0){return _0x218bd0;});}return null;};}function removeEntity(_0x5c057a,_0x3d593b){return function(_0x283f00){if(_0x283f00){return _0x283f00[_0x8ea2('0x26')]()[_0x8ea2('0x25')](function(){_0x5c057a[_0x8ea2('0x1d')](0xcc)[_0x8ea2('0x1c')]();});}};}function handleEntityNotFound(_0x199417,_0x1e4cc9){return function(_0x18ec34){if(!_0x18ec34){_0x199417['sendStatus'](0x194);}return _0x18ec34;};}function handleError(_0x433bc5,_0x4f48bd){_0x4f48bd=_0x4f48bd||0x1f4;return function(_0x2660cc){logger[_0x8ea2('0x27')](_0x2660cc[_0x8ea2('0x28')]);if(_0x2660cc['name']){delete _0x2660cc['name'];}_0x433bc5[_0x8ea2('0x1d')](_0x4f48bd)['send'](_0x2660cc);};}exports[_0x8ea2('0x29')]=function(_0x4e786d,_0x3be291){var _0x12fa37={},_0x21c526={},_0x266db8={'count':0x0,'rows':[]};var _0x4e1b90=_['map'](db[_0x8ea2('0x2a')]['rawAttributes'],function(_0x4a9875){return{'name':_0x4a9875[_0x8ea2('0x2b')],'type':_0x4a9875[_0x8ea2('0x2c')][_0x8ea2('0x2d')]};});_0x21c526[_0x8ea2('0x2e')]=_[_0x8ea2('0x2f')](_0x4e1b90,_0x8ea2('0x30'));_0x21c526[_0x8ea2('0x31')]=_[_0x8ea2('0x32')](_0x4e786d[_0x8ea2('0x31')]);_0x21c526['filters']=_['intersection'](_0x21c526[_0x8ea2('0x2e')],_0x21c526[_0x8ea2('0x31')]);_0x12fa37['attributes']=_['intersection'](_0x21c526[_0x8ea2('0x2e')],qs['fields'](_0x4e786d[_0x8ea2('0x31')][_0x8ea2('0x33')]));_0x12fa37['attributes']=_0x12fa37[_0x8ea2('0x34')][_0x8ea2('0x35')]?_0x12fa37[_0x8ea2('0x34')]:_0x21c526['model'];if(!_0x4e786d['query']['hasOwnProperty'](_0x8ea2('0x36'))){_0x12fa37[_0x8ea2('0x21')]=qs[_0x8ea2('0x21')](_0x4e786d['query'][_0x8ea2('0x21')]);_0x12fa37[_0x8ea2('0x20')]=qs[_0x8ea2('0x20')](_0x4e786d[_0x8ea2('0x31')][_0x8ea2('0x20')]);}_0x12fa37[_0x8ea2('0x37')]=qs[_0x8ea2('0x38')](_0x4e786d[_0x8ea2('0x31')]['sort']);_0x12fa37[_0x8ea2('0x39')]=qs[_0x8ea2('0x3a')](_[_0x8ea2('0x3b')](_0x4e786d[_0x8ea2('0x31')],_0x21c526['filters']));if(_0x4e786d[_0x8ea2('0x31')]['filter']){_0x12fa37[_0x8ea2('0x39')]=_[_0x8ea2('0x3c')](_0x12fa37[_0x8ea2('0x39')],{'$or':_[_0x8ea2('0x2f')](_0x4e1b90,function(_0x4f3e7e){if(_0x4f3e7e[_0x8ea2('0x2c')]!=='VIRTUAL'){var _0x5adb84={};_0x5adb84[_0x4f3e7e[_0x8ea2('0x30')]]={'$like':'%'+_0x4e786d['query'][_0x8ea2('0x3d')]+'%'};return _0x5adb84;}})});}_0x12fa37=_[_0x8ea2('0x3c')]({},_0x12fa37,_0x4e786d[_0x8ea2('0x3e')]);var _0x49446e={'where':_0x12fa37[_0x8ea2('0x39')]};return db['AnalyticTreeReport'][_0x8ea2('0x1f')](_0x49446e)['then'](function(_0x12a6c2){_0x266db8[_0x8ea2('0x1f')]=_0x12a6c2;if(_0x4e786d[_0x8ea2('0x31')][_0x8ea2('0x3f')]){_0x12fa37['include']=[{'all':!![]}];}return db[_0x8ea2('0x2a')]['findAll'](_0x12fa37);})[_0x8ea2('0x25')](function(_0x5ba351){_0x266db8[_0x8ea2('0x40')]=_0x5ba351;return _0x266db8;})[_0x8ea2('0x25')](respondWithFilteredResult(_0x3be291,_0x12fa37))[_0x8ea2('0x41')](handleError(_0x3be291,null));};exports[_0x8ea2('0x42')]=function(_0x373a70,_0x251a10){var _0x2f4fa8={'raw':!![],'where':{'id':_0x373a70['params']['id']}},_0x478d5c={};_0x478d5c[_0x8ea2('0x2e')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x478d5c[_0x8ea2('0x31')]=_['keys'](_0x373a70[_0x8ea2('0x31')]);_0x478d5c[_0x8ea2('0x3a')]=_[_0x8ea2('0x43')](_0x478d5c[_0x8ea2('0x2e')],_0x478d5c[_0x8ea2('0x31')]);_0x2f4fa8[_0x8ea2('0x34')]=_[_0x8ea2('0x43')](_0x478d5c[_0x8ea2('0x2e')],qs['fields'](_0x373a70[_0x8ea2('0x31')][_0x8ea2('0x33')]));_0x2f4fa8[_0x8ea2('0x34')]=_0x2f4fa8['attributes'][_0x8ea2('0x35')]?_0x2f4fa8[_0x8ea2('0x34')]:_0x478d5c[_0x8ea2('0x2e')];if(_0x373a70[_0x8ea2('0x31')][_0x8ea2('0x3f')]){_0x2f4fa8['include']=[{'all':!![]}];}_0x2f4fa8=_[_0x8ea2('0x3c')]({},_0x2f4fa8,_0x373a70[_0x8ea2('0x3e')]);return db[_0x8ea2('0x2a')]['find'](_0x2f4fa8)[_0x8ea2('0x25')](handleEntityNotFound(_0x251a10,null))[_0x8ea2('0x25')](respondWithResult(_0x251a10,null))[_0x8ea2('0x41')](handleError(_0x251a10,null));};exports[_0x8ea2('0x44')]=function(_0x315ed1,_0x3ca1c8){return db[_0x8ea2('0x2a')][_0x8ea2('0x44')](_0x315ed1[_0x8ea2('0x45')],{})[_0x8ea2('0x25')](respondWithResult(_0x3ca1c8,0xc9))[_0x8ea2('0x41')](handleError(_0x3ca1c8,null));};exports[_0x8ea2('0x46')]=function(_0x220970,_0x12e81f){if(_0x220970['body']['id']){delete _0x220970[_0x8ea2('0x45')]['id'];}return db[_0x8ea2('0x2a')][_0x8ea2('0x47')]({'where':{'id':_0x220970[_0x8ea2('0x48')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x12e81f,null))[_0x8ea2('0x25')](saveUpdates(_0x220970[_0x8ea2('0x45')],null))[_0x8ea2('0x25')](respondWithResult(_0x12e81f,null))['catch'](handleError(_0x12e81f,null));};exports[_0x8ea2('0x26')]=function(_0x37a1cf,_0x24dddb){return db['AnalyticTreeReport']['find']({'where':{'id':_0x37a1cf[_0x8ea2('0x48')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x24dddb,null))[_0x8ea2('0x25')](removeEntity(_0x24dddb,null))['catch'](handleError(_0x24dddb,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index cecfe13..bed1417 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees'];(function(_0x191136,_0x264f48){var _0x45c2a9=function(_0x401496){while(--_0x401496){_0x191136['push'](_0x191136['shift']());}};_0x45c2a9(++_0x264f48);}(_0x1261,0x144));var _0x1126=function(_0x502773,_0xe55d92){_0x502773=_0x502773-0x0;var _0x568f34=_0x1261[_0x502773];return _0x568f34;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc177=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0xe1f54,_0x59e279){var _0x59bfba=function(_0x104c8a){while(--_0x104c8a){_0xe1f54['push'](_0xe1f54['shift']());}};_0x59bfba(++_0x59e279);}(_0xc177,0x1b2));var _0x7c17=function(_0x130ea5,_0x3cdebf){_0x130ea5=_0x130ea5-0x0;var _0x5d9497=_0xc177[_0x130ea5];return _0x5d9497;};'use strict';var _=require(_0x7c17('0x0'));var util=require(_0x7c17('0x1'));var logger=require(_0x7c17('0x2'))(_0x7c17('0x3'));var moment=require(_0x7c17('0x4'));var BPromise=require('bluebird');var rp=require(_0x7c17('0x5'));var fs=require('fs');var path=require(_0x7c17('0x6'));var rimraf=require(_0x7c17('0x7'));var config=require(_0x7c17('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x7c17('0x9')]=function(_0x39d894,_0x4682b8){return _0x39d894['define'](_0x7c17('0xa'),attributes,{'tableName':_0x7c17('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index d901345..63383cc 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 _0x35e7=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird'];(function(_0x1f6379,_0xe2761b){var _0x2ba292=function(_0x987557){while(--_0x987557){_0x1f6379['push'](_0x1f6379['shift']());}};_0x2ba292(++_0xe2761b);}(_0x35e7,0xd9));var _0x735e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x35e7[_0x5037ab];return _0x512adb;};'use strict';var _=require('lodash');var util=require(_0x735e('0x0'));var moment=require(_0x735e('0x1'));var BPromise=require(_0x735e('0x2'));var rs=require(_0x735e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x735e('0x4'))['db'];var utils=require(_0x735e('0x5'));var logger=require(_0x735e('0x6'))(_0x735e('0x7'));var config=require(_0x735e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4354bb,_0x31a4ff,_0x511a52){return new BPromise(function(_0x3de264,_0x5ea3ef){return client[_0x735e('0x9')](_0x4354bb,_0x511a52)[_0x735e('0xa')](function(_0x2fa29a){logger['info'](_0x735e('0xb'),_0x31a4ff,_0x735e('0xc'));logger['debug'](_0x735e('0xd'),_0x31a4ff,_0x735e('0xc'),JSON[_0x735e('0xe')](_0x2fa29a));if(_0x2fa29a[_0x735e('0xf')]){if(_0x2fa29a[_0x735e('0xf')][_0x735e('0x10')]===0x1f4){logger[_0x735e('0xf')](_0x735e('0xb'),_0x31a4ff,_0x2fa29a[_0x735e('0xf')][_0x735e('0x11')]);return _0x5ea3ef(_0x2fa29a[_0x735e('0xf')][_0x735e('0x11')]);}logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x31a4ff,_0x2fa29a[_0x735e('0xf')][_0x735e('0x11')]);return _0x3de264(_0x2fa29a[_0x735e('0xf')]['message']);}else{logger[_0x735e('0x12')](_0x735e('0xb'),_0x31a4ff,_0x735e('0xc'));_0x3de264(_0x2fa29a['result'][_0x735e('0x11')]);}})[_0x735e('0x13')](function(_0x58ea61){logger[_0x735e('0xf')](_0x735e('0xb'),_0x31a4ff,_0x58ea61);_0x5ea3ef(_0x58ea61);});});} \ No newline at end of file +var _0x795d=['AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x562751,_0x300643){var _0x474b16=function(_0x43941a){while(--_0x43941a){_0x562751['push'](_0x562751['shift']());}};_0x474b16(++_0x300643);}(_0x795d,0xc0));var _0xd795=function(_0x263a8a,_0x5c088d){_0x263a8a=_0x263a8a-0x0;var _0x226a79=_0x795d[_0x263a8a];return _0x226a79;};'use strict';var _=require(_0xd795('0x0'));var util=require(_0xd795('0x1'));var moment=require(_0xd795('0x2'));var BPromise=require(_0xd795('0x3'));var rs=require(_0xd795('0x4'));var fs=require('fs');var Redis=require(_0xd795('0x5'));var db=require(_0xd795('0x6'))['db'];var utils=require(_0xd795('0x7'));var logger=require('../../config/logger')(_0xd795('0x8'));var config=require(_0xd795('0x9'));var jayson=require(_0xd795('0xa'));var client=jayson[_0xd795('0xb')][_0xd795('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4793d9,_0x3fcc70,_0x438029){return new BPromise(function(_0x47dc4e,_0x659c96){return client[_0xd795('0xd')](_0x4793d9,_0x438029)[_0xd795('0xe')](function(_0x10ae1f){logger[_0xd795('0xf')](_0xd795('0x10'),_0x3fcc70,_0xd795('0x11'));logger[_0xd795('0x12')](_0xd795('0x13'),_0x3fcc70,_0xd795('0x11'),JSON[_0xd795('0x14')](_0x10ae1f));if(_0x10ae1f[_0xd795('0x15')]){if(_0x10ae1f['error'][_0xd795('0x16')]===0x1f4){logger[_0xd795('0x15')](_0xd795('0x10'),_0x3fcc70,_0x10ae1f[_0xd795('0x15')][_0xd795('0x17')]);return _0x659c96(_0x10ae1f[_0xd795('0x15')]['message']);}logger['error'](_0xd795('0x10'),_0x3fcc70,_0x10ae1f[_0xd795('0x15')][_0xd795('0x17')]);return _0x47dc4e(_0x10ae1f[_0xd795('0x15')]['message']);}else{logger[_0xd795('0xf')](_0xd795('0x10'),_0x3fcc70,_0xd795('0x11'));_0x47dc4e(_0x10ae1f[_0xd795('0x18')][_0xd795('0x17')]);}})[_0xd795('0x19')](function(_0x1c70cf){logger['error'](_0xd795('0x10'),_0x3fcc70,_0x1c70cf);_0x659c96(_0x1c70cf);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index dbbaa31..7a34ca4 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 _0x1df3=['post','put','update','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id'];(function(_0x2a01e8,_0x30e992){var _0x35f73a=function(_0xc16d4f){while(--_0xc16d4f){_0x2a01e8['push'](_0x2a01e8['shift']());}};_0x35f73a(++_0x30e992);}(_0x1df3,0x104));var _0x31df=function(_0x3d4410,_0xb881f2){_0x3d4410=_0x3d4410-0x0;var _0xe9ff41=_0x1df3[_0x3d4410];return _0xe9ff41;};'use strict';var multer=require('multer');var util=require(_0x31df('0x0'));var path=require(_0x31df('0x1'));var timeout=require('connect-timeout');var express=require(_0x31df('0x2'));var router=express[_0x31df('0x3')]();var auth=require(_0x31df('0x4'));var interaction=require(_0x31df('0x5'));var config=require(_0x31df('0x6'));var controller=require(_0x31df('0x7'));router[_0x31df('0x8')]('/',auth[_0x31df('0x9')](),controller[_0x31df('0xa')]);router['get'](_0x31df('0xb'),auth[_0x31df('0x9')](),controller['show']);router[_0x31df('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x31df('0xd')](_0x31df('0xb'),auth[_0x31df('0x9')](),controller[_0x31df('0xe')]);router[_0x31df('0xf')](_0x31df('0xb'),auth[_0x31df('0x9')](),controller[_0x31df('0x10')]);module['exports']=router; \ No newline at end of file +var _0xbdcf=['create','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','/:id','show','post','isAuthenticated'];(function(_0x1d58f5,_0xa257f3){var _0x968fb7=function(_0x9ac703){while(--_0x9ac703){_0x1d58f5['push'](_0x1d58f5['shift']());}};_0x968fb7(++_0xa257f3);}(_0xbdcf,0xf3));var _0xfbdc=function(_0xaf3a7f,_0x111351){_0xaf3a7f=_0xaf3a7f-0x0;var _0x7bf1dc=_0xbdcf[_0xaf3a7f];return _0x7bf1dc;};'use strict';var multer=require(_0xfbdc('0x0'));var util=require('util');var path=require(_0xfbdc('0x1'));var timeout=require('connect-timeout');var express=require(_0xfbdc('0x2'));var router=express[_0xfbdc('0x3')]();var auth=require(_0xfbdc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfbdc('0x5'));var controller=require(_0xfbdc('0x6'));router[_0xfbdc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfbdc('0x7')](_0xfbdc('0x8'),auth['isAuthenticated'](),controller[_0xfbdc('0x9')]);router[_0xfbdc('0xa')]('/',auth[_0xfbdc('0xb')](),controller[_0xfbdc('0xc')]);router[_0xfbdc('0xd')](_0xfbdc('0x8'),auth[_0xfbdc('0xb')](),controller[_0xfbdc('0xe')]);router[_0xfbdc('0xf')]('/:id',auth[_0xfbdc('0xb')](),controller[_0xfbdc('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 3f508f7..615c5a4 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 _0xfb71=['sequelize','exports','STRING'];(function(_0x5e09ab,_0x1081e2){var _0xc35034=function(_0xd16e47){while(--_0xd16e47){_0x5e09ab['push'](_0x5e09ab['shift']());}};_0xc35034(++_0x1081e2);}(_0xfb71,0xae));var _0x1fb7=function(_0x5079d6,_0x5af959){_0x5079d6=_0x5079d6-0x0;var _0x304372=_0xfb71[_0x5079d6];return _0x304372;};'use strict';var Sequelize=require(_0x1fb7('0x0'));module[_0x1fb7('0x1')]={'name':{'type':Sequelize[_0x1fb7('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1fb7('0x2')]}}; \ No newline at end of file +var _0xfb51=['sequelize'];(function(_0x3bd626,_0x526070){var _0x2f8a9e=function(_0xd1e225){while(--_0xd1e225){_0x3bd626['push'](_0x3bd626['shift']());}};_0x2f8a9e(++_0x526070);}(_0xfb51,0xf9));var _0x1fb5=function(_0x5b710b,_0x103f64){_0x5b710b=_0x5b710b-0x0;var _0x40ccbe=_0xfb51[_0x5b710b];return _0x40ccbe;};'use strict';var Sequelize=require(_0x1fb5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index b5b044c..01c97e0 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 _0xca89=['body','omit','createdAt','create','originalname','basename','file','mimetype','download','findOne','join','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','find','include','get','updatedAt'];(function(_0xdb5e72,_0x28235f){var _0x1183d5=function(_0x3c0ffc){while(--_0x3c0ffc){_0xdb5e72['push'](_0xdb5e72['shift']());}};_0x1183d5(++_0x28235f);}(_0xca89,0xb2));var _0x9ca8=function(_0x4f9506,_0x46055e){_0x4f9506=_0x4f9506-0x0;var _0x1eb5bc=_0xca89[_0x4f9506];return _0x1eb5bc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9ca8('0x0'));var rimraf=require(_0x9ca8('0x1'));var zipdir=require(_0x9ca8('0x2'));var jsonpatch=require(_0x9ca8('0x3'));var rp=require(_0x9ca8('0x4'));var moment=require('moment');var BPromise=require(_0x9ca8('0x5'));var Mustache=require(_0x9ca8('0x6'));var util=require(_0x9ca8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9ca8('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9ca8('0x9'));var squel=require(_0x9ca8('0xa'));var crypto=require(_0x9ca8('0xb'));var jsforce=require(_0x9ca8('0xc'));var deskjs=require(_0x9ca8('0xd'));var toCsv=require(_0x9ca8('0x8'));var querystring=require(_0x9ca8('0xe'));var Papa=require(_0x9ca8('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9ca8('0x10'));var as=require(_0x9ca8('0x11'));var hardwareService=require(_0x9ca8('0x12'));var logger=require('../../config/logger')(_0x9ca8('0x13'));var utils=require('../../config/utils');var config=require(_0x9ca8('0x14'));var db=require(_0x9ca8('0x15'))['db'];function respondWithStatusCode(_0x303a3f,_0x187847){_0x187847=_0x187847||0xcc;return function(_0x1e5d4f){if(_0x1e5d4f){return _0x303a3f['sendStatus'](_0x187847);}return _0x303a3f[_0x9ca8('0x16')](_0x187847)[_0x9ca8('0x17')]();};}function respondWithResult(_0x350f29,_0x483454){_0x483454=_0x483454||0xc8;return function(_0x3ea2d1){if(_0x3ea2d1){return _0x350f29[_0x9ca8('0x16')](_0x483454)[_0x9ca8('0x18')](_0x3ea2d1);}};}function respondWithFilteredResult(_0x49343d,_0x3271de){return function(_0x4912b3){if(_0x4912b3){var _0x100578=_0x4912b3[_0x9ca8('0x19')],_0x42093b=_0x3271de[_0x9ca8('0x1a')],_0x255a9c=_0x3271de['offset']+_0x3271de[_0x9ca8('0x1b')],_0x4a17e8;if(_0x255a9c>=_0x100578){_0x255a9c=_0x100578;_0x4a17e8=0xc8;}else{_0x4a17e8=0xce;}_0x49343d['status'](_0x4a17e8);return _0x49343d[_0x9ca8('0x1c')](_0x9ca8('0x1d'),_0x42093b+'-'+_0x255a9c+'/'+_0x100578)[_0x9ca8('0x18')](_0x4912b3);}return null;};}function patchUpdates(_0x1a8869){return function(_0x59808d){try{jsonpatch[_0x9ca8('0x1e')](_0x59808d,_0x1a8869,!![]);}catch(_0x342646){return BPromise[_0x9ca8('0x1f')](_0x342646);}return _0x59808d['save']();};}function saveUpdates(_0x5e391e,_0x60bff0){return function(_0x32cee6){if(_0x32cee6){return _0x32cee6['update'](_0x5e391e)[_0x9ca8('0x20')](function(_0x1580fa){return _0x1580fa;});}return null;};}function removeEntity(_0x167843,_0x4ef159){return function(_0x46a856){if(_0x46a856){return _0x46a856[_0x9ca8('0x21')]()[_0x9ca8('0x20')](function(){_0x167843[_0x9ca8('0x16')](0xcc)[_0x9ca8('0x17')]();});}};}function handleEntityNotFound(_0x2dc9a2,_0x5e2d82){return function(_0x3124f9){if(!_0x3124f9){_0x2dc9a2['sendStatus'](0x194);}return _0x3124f9;};}function handleError(_0x5a190a,_0x28478c){_0x28478c=_0x28478c||0x1f4;return function(_0x1aba8e){logger[_0x9ca8('0x22')](_0x1aba8e[_0x9ca8('0x23')]);if(_0x1aba8e[_0x9ca8('0x24')]){delete _0x1aba8e['name'];}_0x5a190a['status'](_0x28478c)[_0x9ca8('0x25')](_0x1aba8e);};}exports[_0x9ca8('0x26')]=function(_0x59bd76,_0x26971a){var _0x213dce={},_0x46d99f={},_0x2d6054={'count':0x0,'rows':[]};var _0x3afc74=_[_0x9ca8('0x27')](db[_0x9ca8('0x28')][_0x9ca8('0x29')],function(_0x2123f2){return{'name':_0x2123f2[_0x9ca8('0x2a')],'type':_0x2123f2[_0x9ca8('0x2b')][_0x9ca8('0x2c')]};});_0x46d99f[_0x9ca8('0x2d')]=_[_0x9ca8('0x27')](_0x3afc74,_0x9ca8('0x24'));_0x46d99f[_0x9ca8('0x2e')]=_[_0x9ca8('0x2f')](_0x59bd76['query']);_0x46d99f[_0x9ca8('0x30')]=_[_0x9ca8('0x31')](_0x46d99f[_0x9ca8('0x2d')],_0x46d99f['query']);_0x213dce[_0x9ca8('0x32')]=_['intersection'](_0x46d99f[_0x9ca8('0x2d')],qs[_0x9ca8('0x33')](_0x59bd76[_0x9ca8('0x2e')]['fields']));_0x213dce[_0x9ca8('0x32')]=_0x213dce[_0x9ca8('0x32')][_0x9ca8('0x34')]?_0x213dce['attributes']:_0x46d99f[_0x9ca8('0x2d')];if(!_0x59bd76[_0x9ca8('0x2e')][_0x9ca8('0x35')]('nolimit')){_0x213dce[_0x9ca8('0x1b')]=qs[_0x9ca8('0x1b')](_0x59bd76[_0x9ca8('0x2e')][_0x9ca8('0x1b')]);_0x213dce['offset']=qs[_0x9ca8('0x1a')](_0x59bd76[_0x9ca8('0x2e')][_0x9ca8('0x1a')]);}_0x213dce[_0x9ca8('0x36')]=qs[_0x9ca8('0x37')](_0x59bd76[_0x9ca8('0x2e')][_0x9ca8('0x37')]);_0x213dce[_0x9ca8('0x38')]=qs[_0x9ca8('0x30')](_[_0x9ca8('0x39')](_0x59bd76[_0x9ca8('0x2e')],_0x46d99f[_0x9ca8('0x30')]));if(_0x59bd76[_0x9ca8('0x2e')][_0x9ca8('0x3a')]){_0x213dce[_0x9ca8('0x38')]=_[_0x9ca8('0x3b')](_0x213dce['where'],{'$or':_[_0x9ca8('0x27')](_0x3afc74,function(_0x55bd69){if(_0x55bd69[_0x9ca8('0x2b')]!==_0x9ca8('0x3c')){var _0x149645={};_0x149645[_0x55bd69[_0x9ca8('0x24')]]={'$like':'%'+_0x59bd76[_0x9ca8('0x2e')][_0x9ca8('0x3a')]+'%'};return _0x149645;}})});}_0x213dce=_[_0x9ca8('0x3b')]({},_0x213dce,_0x59bd76[_0x9ca8('0x3d')]);var _0x5de341={'where':_0x213dce[_0x9ca8('0x38')]};return db[_0x9ca8('0x28')]['count'](_0x5de341)[_0x9ca8('0x20')](function(_0x4f8192){_0x2d6054[_0x9ca8('0x19')]=_0x4f8192;if(_0x59bd76[_0x9ca8('0x2e')]['includeAll']){_0x213dce['include']=[{'all':!![]}];}return db[_0x9ca8('0x28')][_0x9ca8('0x3e')](_0x213dce);})[_0x9ca8('0x20')](function(_0x1e7fb5){_0x2d6054['rows']=_0x1e7fb5;return _0x2d6054;})['then'](respondWithFilteredResult(_0x26971a,_0x213dce))[_0x9ca8('0x3f')](handleError(_0x26971a,null));};exports[_0x9ca8('0x40')]=function(_0x3e91ca,_0x2e3f3b){var _0x30e35d={'raw':!![],'where':{'id':_0x3e91ca[_0x9ca8('0x41')]['id']}},_0x3a2429={};_0x3a2429[_0x9ca8('0x2d')]=_[_0x9ca8('0x2f')](db[_0x9ca8('0x28')][_0x9ca8('0x29')]);_0x3a2429[_0x9ca8('0x2e')]=_[_0x9ca8('0x2f')](_0x3e91ca[_0x9ca8('0x2e')]);_0x3a2429[_0x9ca8('0x30')]=_[_0x9ca8('0x31')](_0x3a2429[_0x9ca8('0x2d')],_0x3a2429[_0x9ca8('0x2e')]);_0x30e35d[_0x9ca8('0x32')]=_[_0x9ca8('0x31')](_0x3a2429['model'],qs[_0x9ca8('0x33')](_0x3e91ca['query'][_0x9ca8('0x33')]));_0x30e35d[_0x9ca8('0x32')]=_0x30e35d[_0x9ca8('0x32')]['length']?_0x30e35d[_0x9ca8('0x32')]:_0x3a2429['model'];if(_0x3e91ca[_0x9ca8('0x2e')][_0x9ca8('0x42')]){_0x30e35d['include']=[{'all':!![]}];}_0x30e35d=_[_0x9ca8('0x3b')]({},_0x30e35d,_0x3e91ca['options']);return db[_0x9ca8('0x28')][_0x9ca8('0x43')](_0x30e35d)['then'](handleEntityNotFound(_0x2e3f3b,null))[_0x9ca8('0x20')](respondWithResult(_0x2e3f3b,null))[_0x9ca8('0x3f')](handleError(_0x2e3f3b,null));};exports['clone']=function(_0x2c562f,_0x2dd4fe){var _0xe22145={'where':{'id':_0x2c562f[_0x9ca8('0x41')]['id']}},_0x244df2={};_0x244df2[_0x9ca8('0x2d')]=_[_0x9ca8('0x2f')](db['Attachment'][_0x9ca8('0x29')]);_0xe22145[_0x9ca8('0x32')]=_[_0x9ca8('0x31')](_0x244df2['model'],qs[_0x9ca8('0x33')](_0x2c562f['query']['fields']));_0xe22145[_0x9ca8('0x32')]=_0xe22145['attributes']['length']?_0xe22145['attributes']:_0x244df2['model'];if(_0x2c562f[_0x9ca8('0x2e')][_0x9ca8('0x42')]){_0xe22145[_0x9ca8('0x44')]=[{'all':!![]}];}_0xe22145=_['merge']({},_0xe22145,_0x2c562f[_0x9ca8('0x3d')]);return db[_0x9ca8('0x28')][_0x9ca8('0x43')](_0xe22145)[_0x9ca8('0x20')](handleEntityNotFound(_0x2dd4fe,null))[_0x9ca8('0x20')](function(_0x56fc4e){if(_0x56fc4e){var _0x2817d6=_0x56fc4e[_0x9ca8('0x45')]({'plain':!![]});_0x2817d6=qs['omit'](_0x2817d6,['id','createdAt',_0x9ca8('0x46')]);_0x2c562f[_0x9ca8('0x47')]=_[_0x9ca8('0x48')](_0x2c562f[_0x9ca8('0x47')],['id',_0x9ca8('0x49'),_0x9ca8('0x46')]);return db[_0x9ca8('0x28')][_0x9ca8('0x4a')](_['merge'](_0x2817d6,_0x2c562f[_0x9ca8('0x47')]),{'include':_0x2c562f[_0x9ca8('0x2e')][_0x9ca8('0x42')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2dd4fe,0xc9))[_0x9ca8('0x3f')](handleError(_0x2dd4fe,null));};exports['update']=function(_0x16c4a7,_0x2aa8e4){if(_0x16c4a7['body']['id']){delete _0x16c4a7[_0x9ca8('0x47')]['id'];}return db[_0x9ca8('0x28')][_0x9ca8('0x43')]({'where':{'id':_0x16c4a7['params']['id']}})['then'](handleEntityNotFound(_0x2aa8e4,null))[_0x9ca8('0x20')](saveUpdates(_0x16c4a7[_0x9ca8('0x47')],null))[_0x9ca8('0x20')](respondWithResult(_0x2aa8e4,null))[_0x9ca8('0x3f')](handleError(_0x2aa8e4,null));};exports[_0x9ca8('0x21')]=function(_0x4947c3,_0x9cfbcb){return db[_0x9ca8('0x28')]['find']({'where':{'id':_0x4947c3['params']['id']}})[_0x9ca8('0x20')](handleEntityNotFound(_0x9cfbcb,null))['then'](removeEntity(_0x9cfbcb,null))['catch'](handleError(_0x9cfbcb,null));};exports['create']=function(_0x4a8db3,_0x1045c7,_0x3ef251){_0x4a8db3['body']['name']=_0x4a8db3['file'][_0x9ca8('0x4b')];_0x4a8db3[_0x9ca8('0x47')][_0x9ca8('0x4c')]=_0x4a8db3[_0x9ca8('0x4d')]['filename'];_0x4a8db3[_0x9ca8('0x47')]['type']=_0x4a8db3[_0x9ca8('0x4d')][_0x9ca8('0x4e')];return db['Attachment'][_0x9ca8('0x4a')](_0x4a8db3[_0x9ca8('0x47')])[_0x9ca8('0x20')](respondWithResult(_0x1045c7,0xc9))[_0x9ca8('0x3f')](handleError(_0x1045c7,null));};exports[_0x9ca8('0x4f')]=function(_0x2b5085,_0x4b4a1a,_0x55f689){return db['Attachment'][_0x9ca8('0x50')]({'where':{'id':_0x2b5085['params']['id']},'raw':!![]})[_0x9ca8('0x20')](handleEntityNotFound(_0x4b4a1a,null))[_0x9ca8('0x20')](function(_0x37fadb){if(_0x37fadb){return _0x4b4a1a[_0x9ca8('0x4f')](path[_0x9ca8('0x51')](config[_0x9ca8('0x52')],'server/files/attachments/',_0x37fadb[_0x9ca8('0x4c')]));}})[_0x9ca8('0x3f')](handleError(_0x4b4a1a,null));}; \ No newline at end of file +var _0x1948=['then','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','Attachment','count','includeAll','include','rows','params','length','options','find','catch','clone','get','omit','createdAt','body','updatedAt','update','originalname','basename','file','filename','mimetype','create','download','findOne','join','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy'];(function(_0x295add,_0x5d2379){var _0x59e7e6=function(_0x47f8d){while(--_0x47f8d){_0x295add['push'](_0x295add['shift']());}};_0x59e7e6(++_0x5d2379);}(_0x1948,0xe2));var _0x8194=function(_0x6df0ec,_0x56e795){_0x6df0ec=_0x6df0ec-0x0;var _0x5dbab1=_0x1948[_0x6df0ec];return _0x5dbab1;};'use strict';var pdf=require(_0x8194('0x0'));var emlformat=require(_0x8194('0x1'));var rimraf=require(_0x8194('0x2'));var zipdir=require(_0x8194('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8194('0x4'));var moment=require(_0x8194('0x5'));var BPromise=require(_0x8194('0x6'));var Mustache=require('mustache');var util=require(_0x8194('0x7'));var path=require(_0x8194('0x8'));var sox=require(_0x8194('0x9'));var csv=require(_0x8194('0xa'));var ejs=require(_0x8194('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8194('0xc'));var crypto=require(_0x8194('0xd'));var jsforce=require(_0x8194('0xe'));var deskjs=require(_0x8194('0xf'));var toCsv=require(_0x8194('0xa'));var querystring=require(_0x8194('0x10'));var Papa=require(_0x8194('0x11'));var Redis=require(_0x8194('0x12'));var authService=require(_0x8194('0x13'));var qs=require(_0x8194('0x14'));var as=require(_0x8194('0x15'));var hardwareService=require(_0x8194('0x16'));var logger=require(_0x8194('0x17'))(_0x8194('0x18'));var utils=require('../../config/utils');var config=require(_0x8194('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13e528,_0x13a5ed){_0x13a5ed=_0x13a5ed||0xcc;return function(_0x40581c){if(_0x40581c){return _0x13e528[_0x8194('0x1a')](_0x13a5ed);}return _0x13e528[_0x8194('0x1b')](_0x13a5ed)[_0x8194('0x1c')]();};}function respondWithResult(_0x2e8048,_0x55107e){_0x55107e=_0x55107e||0xc8;return function(_0x2bfb93){if(_0x2bfb93){return _0x2e8048['status'](_0x55107e)[_0x8194('0x1d')](_0x2bfb93);}};}function respondWithFilteredResult(_0xa5fdde,_0x19fc63){return function(_0xcab152){if(_0xcab152){var _0x1d3c5f=_0xcab152['count'],_0x155155=_0x19fc63[_0x8194('0x1e')],_0x1d0581=_0x19fc63[_0x8194('0x1e')]+_0x19fc63[_0x8194('0x1f')],_0x3fbe1b;if(_0x1d0581>=_0x1d3c5f){_0x1d0581=_0x1d3c5f;_0x3fbe1b=0xc8;}else{_0x3fbe1b=0xce;}_0xa5fdde[_0x8194('0x1b')](_0x3fbe1b);return _0xa5fdde[_0x8194('0x20')](_0x8194('0x21'),_0x155155+'-'+_0x1d0581+'/'+_0x1d3c5f)['json'](_0xcab152);}return null;};}function patchUpdates(_0x273bd3){return function(_0x437b33){try{jsonpatch[_0x8194('0x22')](_0x437b33,_0x273bd3,!![]);}catch(_0x3ad063){return BPromise[_0x8194('0x23')](_0x3ad063);}return _0x437b33[_0x8194('0x24')]();};}function saveUpdates(_0x4254b5,_0x318b3a){return function(_0x1f443d){if(_0x1f443d){return _0x1f443d['update'](_0x4254b5)['then'](function(_0x5e8a29){return _0x5e8a29;});}return null;};}function removeEntity(_0x43be1b,_0x410d03){return function(_0x2b122e){if(_0x2b122e){return _0x2b122e[_0x8194('0x25')]()[_0x8194('0x26')](function(){_0x43be1b['status'](0xcc)[_0x8194('0x1c')]();});}};}function handleEntityNotFound(_0x18f939,_0x2e1846){return function(_0x370cc7){if(!_0x370cc7){_0x18f939[_0x8194('0x1a')](0x194);}return _0x370cc7;};}function handleError(_0x3a55a8,_0x2f2ac7){_0x2f2ac7=_0x2f2ac7||0x1f4;return function(_0x4c6298){logger[_0x8194('0x27')](_0x4c6298[_0x8194('0x28')]);if(_0x4c6298[_0x8194('0x29')]){delete _0x4c6298[_0x8194('0x29')];}_0x3a55a8[_0x8194('0x1b')](_0x2f2ac7)[_0x8194('0x2a')](_0x4c6298);};}exports['index']=function(_0x4db8ac,_0x3646f2){var _0x4f592b={},_0x42a3fa={},_0x4003c1={'count':0x0,'rows':[]};var _0x2aaea6=_[_0x8194('0x2b')](db['Attachment'][_0x8194('0x2c')],function(_0x2b0c5f){return{'name':_0x2b0c5f[_0x8194('0x2d')],'type':_0x2b0c5f[_0x8194('0x2e')]['key']};});_0x42a3fa['model']=_[_0x8194('0x2b')](_0x2aaea6,_0x8194('0x29'));_0x42a3fa[_0x8194('0x2f')]=_[_0x8194('0x30')](_0x4db8ac[_0x8194('0x2f')]);_0x42a3fa[_0x8194('0x31')]=_[_0x8194('0x32')](_0x42a3fa['model'],_0x42a3fa['query']);_0x4f592b[_0x8194('0x33')]=_['intersection'](_0x42a3fa[_0x8194('0x34')],qs[_0x8194('0x35')](_0x4db8ac['query'][_0x8194('0x35')]));_0x4f592b[_0x8194('0x33')]=_0x4f592b[_0x8194('0x33')]['length']?_0x4f592b['attributes']:_0x42a3fa['model'];if(!_0x4db8ac[_0x8194('0x2f')]['hasOwnProperty'](_0x8194('0x36'))){_0x4f592b[_0x8194('0x1f')]=qs[_0x8194('0x1f')](_0x4db8ac[_0x8194('0x2f')][_0x8194('0x1f')]);_0x4f592b[_0x8194('0x1e')]=qs[_0x8194('0x1e')](_0x4db8ac[_0x8194('0x2f')][_0x8194('0x1e')]);}_0x4f592b[_0x8194('0x37')]=qs[_0x8194('0x38')](_0x4db8ac['query'][_0x8194('0x38')]);_0x4f592b['where']=qs[_0x8194('0x31')](_['pick'](_0x4db8ac[_0x8194('0x2f')],_0x42a3fa[_0x8194('0x31')]));if(_0x4db8ac[_0x8194('0x2f')][_0x8194('0x39')]){_0x4f592b[_0x8194('0x3a')]=_[_0x8194('0x3b')](_0x4f592b[_0x8194('0x3a')],{'$or':_['map'](_0x2aaea6,function(_0x3f8ba3){if(_0x3f8ba3[_0x8194('0x2e')]!==_0x8194('0x3c')){var _0x4302dc={};_0x4302dc[_0x3f8ba3[_0x8194('0x29')]]={'$like':'%'+_0x4db8ac[_0x8194('0x2f')][_0x8194('0x39')]+'%'};return _0x4302dc;}})});}_0x4f592b=_[_0x8194('0x3b')]({},_0x4f592b,_0x4db8ac['options']);var _0x339fbb={'where':_0x4f592b[_0x8194('0x3a')]};return db[_0x8194('0x3d')][_0x8194('0x3e')](_0x339fbb)[_0x8194('0x26')](function(_0x153561){_0x4003c1[_0x8194('0x3e')]=_0x153561;if(_0x4db8ac[_0x8194('0x2f')][_0x8194('0x3f')]){_0x4f592b[_0x8194('0x40')]=[{'all':!![]}];}return db[_0x8194('0x3d')]['findAll'](_0x4f592b);})[_0x8194('0x26')](function(_0x29dcab){_0x4003c1[_0x8194('0x41')]=_0x29dcab;return _0x4003c1;})[_0x8194('0x26')](respondWithFilteredResult(_0x3646f2,_0x4f592b))['catch'](handleError(_0x3646f2,null));};exports['show']=function(_0x48277c,_0x257408){var _0x3a3280={'raw':!![],'where':{'id':_0x48277c[_0x8194('0x42')]['id']}},_0x39783c={};_0x39783c[_0x8194('0x34')]=_[_0x8194('0x30')](db['Attachment'][_0x8194('0x2c')]);_0x39783c[_0x8194('0x2f')]=_['keys'](_0x48277c[_0x8194('0x2f')]);_0x39783c['filters']=_[_0x8194('0x32')](_0x39783c[_0x8194('0x34')],_0x39783c[_0x8194('0x2f')]);_0x3a3280['attributes']=_[_0x8194('0x32')](_0x39783c['model'],qs[_0x8194('0x35')](_0x48277c['query'][_0x8194('0x35')]));_0x3a3280[_0x8194('0x33')]=_0x3a3280[_0x8194('0x33')][_0x8194('0x43')]?_0x3a3280[_0x8194('0x33')]:_0x39783c[_0x8194('0x34')];if(_0x48277c[_0x8194('0x2f')][_0x8194('0x3f')]){_0x3a3280[_0x8194('0x40')]=[{'all':!![]}];}_0x3a3280=_[_0x8194('0x3b')]({},_0x3a3280,_0x48277c[_0x8194('0x44')]);return db[_0x8194('0x3d')][_0x8194('0x45')](_0x3a3280)[_0x8194('0x26')](handleEntityNotFound(_0x257408,null))[_0x8194('0x26')](respondWithResult(_0x257408,null))[_0x8194('0x46')](handleError(_0x257408,null));};exports[_0x8194('0x47')]=function(_0x181bed,_0x4cf193){var _0x127927={'where':{'id':_0x181bed[_0x8194('0x42')]['id']}},_0x1666f5={};_0x1666f5[_0x8194('0x34')]=_['keys'](db[_0x8194('0x3d')][_0x8194('0x2c')]);_0x127927['attributes']=_['intersection'](_0x1666f5[_0x8194('0x34')],qs[_0x8194('0x35')](_0x181bed[_0x8194('0x2f')][_0x8194('0x35')]));_0x127927[_0x8194('0x33')]=_0x127927[_0x8194('0x33')]['length']?_0x127927[_0x8194('0x33')]:_0x1666f5[_0x8194('0x34')];if(_0x181bed[_0x8194('0x2f')][_0x8194('0x3f')]){_0x127927[_0x8194('0x40')]=[{'all':!![]}];}_0x127927=_[_0x8194('0x3b')]({},_0x127927,_0x181bed[_0x8194('0x44')]);return db[_0x8194('0x3d')]['find'](_0x127927)[_0x8194('0x26')](handleEntityNotFound(_0x4cf193,null))['then'](function(_0x1368ad){if(_0x1368ad){var _0x4368cc=_0x1368ad[_0x8194('0x48')]({'plain':!![]});_0x4368cc=qs[_0x8194('0x49')](_0x4368cc,['id',_0x8194('0x4a'),'updatedAt']);_0x181bed['body']=_['omit'](_0x181bed[_0x8194('0x4b')],['id',_0x8194('0x4a'),_0x8194('0x4c')]);return db['Attachment']['create'](_[_0x8194('0x3b')](_0x4368cc,_0x181bed[_0x8194('0x4b')]),{'include':_0x181bed[_0x8194('0x2f')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4cf193,0xc9))['catch'](handleError(_0x4cf193,null));};exports[_0x8194('0x4d')]=function(_0x4f93a,_0x20bfd7){if(_0x4f93a[_0x8194('0x4b')]['id']){delete _0x4f93a[_0x8194('0x4b')]['id'];}return db['Attachment'][_0x8194('0x45')]({'where':{'id':_0x4f93a['params']['id']}})[_0x8194('0x26')](handleEntityNotFound(_0x20bfd7,null))[_0x8194('0x26')](saveUpdates(_0x4f93a[_0x8194('0x4b')],null))[_0x8194('0x26')](respondWithResult(_0x20bfd7,null))[_0x8194('0x46')](handleError(_0x20bfd7,null));};exports[_0x8194('0x25')]=function(_0x39d41c,_0x4f6453){return db[_0x8194('0x3d')][_0x8194('0x45')]({'where':{'id':_0x39d41c[_0x8194('0x42')]['id']}})[_0x8194('0x26')](handleEntityNotFound(_0x4f6453,null))[_0x8194('0x26')](removeEntity(_0x4f6453,null))[_0x8194('0x46')](handleError(_0x4f6453,null));};exports['create']=function(_0x2e1dd9,_0x328b4b,_0x364ce5){_0x2e1dd9[_0x8194('0x4b')][_0x8194('0x29')]=_0x2e1dd9['file'][_0x8194('0x4e')];_0x2e1dd9[_0x8194('0x4b')][_0x8194('0x4f')]=_0x2e1dd9[_0x8194('0x50')][_0x8194('0x51')];_0x2e1dd9[_0x8194('0x4b')][_0x8194('0x2e')]=_0x2e1dd9[_0x8194('0x50')][_0x8194('0x52')];return db[_0x8194('0x3d')][_0x8194('0x53')](_0x2e1dd9[_0x8194('0x4b')])[_0x8194('0x26')](respondWithResult(_0x328b4b,0xc9))[_0x8194('0x46')](handleError(_0x328b4b,null));};exports[_0x8194('0x54')]=function(_0x7608b6,_0x2f13ff,_0x332d16){return db[_0x8194('0x3d')][_0x8194('0x55')]({'where':{'id':_0x7608b6[_0x8194('0x42')]['id']},'raw':!![]})[_0x8194('0x26')](handleEntityNotFound(_0x2f13ff,null))[_0x8194('0x26')](function(_0x1a64f1){if(_0x1a64f1){return _0x2f13ff[_0x8194('0x54')](path[_0x8194('0x56')](config['root'],_0x8194('0x57'),_0x1a64f1[_0x8194('0x4f')]));}})[_0x8194('0x46')](handleError(_0x2f13ff,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 79e2adf..de099b5 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 _0xaaee=['./attachment.attributes','exports','define','Attachment','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xd7478c,_0x2fc5bc){var _0x208350=function(_0x5f58ce){while(--_0x5f58ce){_0xd7478c['push'](_0xd7478c['shift']());}};_0x208350(++_0x2fc5bc);}(_0xaaee,0xa9));var _0xeaae=function(_0x8d115f,_0x369b8d){_0x8d115f=_0x8d115f-0x0;var _0x1956d9=_0xaaee[_0x8d115f];return _0x1956d9;};'use strict';var _=require(_0xeaae('0x0'));var util=require('util');var logger=require(_0xeaae('0x1'))(_0xeaae('0x2'));var moment=require('moment');var BPromise=require(_0xeaae('0x3'));var rp=require(_0xeaae('0x4'));var fs=require('fs');var path=require(_0xeaae('0x5'));var rimraf=require(_0xeaae('0x6'));var config=require('../../config/environment');var attributes=require(_0xeaae('0x7'));module[_0xeaae('0x8')]=function(_0x213422,_0x45c104){return _0x213422[_0xeaae('0x9')](_0xeaae('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dc0=['./attachment.attributes','define','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x52a588,_0x4a3c9d){var _0x30b6dd=function(_0x85552b){while(--_0x85552b){_0x52a588['push'](_0x52a588['shift']());}};_0x30b6dd(++_0x4a3c9d);}(_0x4dc0,0x13d));var _0x04dc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4dc0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x04dc('0x0'))(_0x04dc('0x1'));var moment=require(_0x04dc('0x2'));var BPromise=require(_0x04dc('0x3'));var rp=require(_0x04dc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04dc('0x5'));var config=require(_0x04dc('0x6'));var attributes=require(_0x04dc('0x7'));module['exports']=function(_0x224df5,_0x40b21a){return _0x224df5[_0x04dc('0x8')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index e8b2edc..681f9c6 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 _0x47ce=['client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateAttachment','Attachment','create','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x171bf9,_0x357ee7){var _0x45f804=function(_0x5db1ec){while(--_0x5db1ec){_0x171bf9['push'](_0x171bf9['shift']());}};_0x45f804(++_0x357ee7);}(_0x47ce,0xde));var _0xe47c=function(_0x5594f4,_0x217e30){_0x5594f4=_0x5594f4-0x0;var _0x1c0805=_0x47ce[_0x5594f4];return _0x1c0805;};'use strict';var _=require(_0xe47c('0x0'));var util=require(_0xe47c('0x1'));var moment=require('moment');var BPromise=require(_0xe47c('0x2'));var rs=require(_0xe47c('0x3'));var fs=require('fs');var Redis=require(_0xe47c('0x4'));var db=require(_0xe47c('0x5'))['db'];var utils=require(_0xe47c('0x6'));var logger=require('../../config/logger')(_0xe47c('0x7'));var config=require(_0xe47c('0x8'));var jayson=require(_0xe47c('0x9'));var client=jayson[_0xe47c('0xa')][_0xe47c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1370e4,_0x5f0e1,_0x5acb37){return new BPromise(function(_0x40a7f3,_0x391431){return client[_0xe47c('0xc')](_0x1370e4,_0x5acb37)[_0xe47c('0xd')](function(_0x4dd379){logger[_0xe47c('0xe')](_0xe47c('0xf'),_0x5f0e1,_0xe47c('0x10'));logger[_0xe47c('0x11')](_0xe47c('0x12'),_0x5f0e1,_0xe47c('0x10'),JSON['stringify'](_0x4dd379));if(_0x4dd379[_0xe47c('0x13')]){if(_0x4dd379[_0xe47c('0x13')][_0xe47c('0x14')]===0x1f4){logger[_0xe47c('0x13')](_0xe47c('0xf'),_0x5f0e1,_0x4dd379[_0xe47c('0x13')][_0xe47c('0x15')]);return _0x391431(_0x4dd379[_0xe47c('0x13')][_0xe47c('0x15')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x5f0e1,_0x4dd379[_0xe47c('0x13')][_0xe47c('0x15')]);return _0x40a7f3(_0x4dd379[_0xe47c('0x13')]['message']);}else{logger[_0xe47c('0xe')](_0xe47c('0xf'),_0x5f0e1,'request\x20sent');_0x40a7f3(_0x4dd379['result'][_0xe47c('0x15')]);}})[_0xe47c('0x16')](function(_0x1cbf81){logger[_0xe47c('0x13')]('Attachment,\x20%s,\x20%s',_0x5f0e1,_0x1cbf81);_0x391431(_0x1cbf81);});});}exports[_0xe47c('0x17')]=function(_0x4f4e1c){var _0x51874e=this;return new Promise(function(_0x5ef212,_0x626aef){return db[_0xe47c('0x18')][_0xe47c('0x19')](_0x4f4e1c['body'],{'raw':_0x4f4e1c[_0xe47c('0x1a')]?_0x4f4e1c[_0xe47c('0x1a')][_0xe47c('0x1b')]===undefined?!![]:![]:!![]})[_0xe47c('0xd')](function(_0x3ee37c){logger[_0xe47c('0xe')]('CreateAttachment',_0x4f4e1c);logger['debug'](_0xe47c('0x17'),_0x4f4e1c,JSON[_0xe47c('0x1c')](_0x3ee37c));_0x5ef212(_0x3ee37c);})[_0xe47c('0x16')](function(_0x2283d3){logger['error']('CreateAttachment',_0x2283d3[_0xe47c('0x15')],_0x4f4e1c);_0x626aef(_0x51874e[_0xe47c('0x13')](0x1f4,_0x2283d3['message']));});});}; \ No newline at end of file +var _0x8a23=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring'];(function(_0x15d4d7,_0xb9b57b){var _0x388fd9=function(_0x43bbbb){while(--_0x43bbbb){_0x15d4d7['push'](_0x15d4d7['shift']());}};_0x388fd9(++_0xb9b57b);}(_0x8a23,0x167));var _0x38a2=function(_0x43576f,_0x1356ed){_0x43576f=_0x43576f-0x0;var _0x4d2466=_0x8a23[_0x43576f];return _0x4d2466;};'use strict';var _=require(_0x38a2('0x0'));var util=require(_0x38a2('0x1'));var moment=require(_0x38a2('0x2'));var BPromise=require(_0x38a2('0x3'));var rs=require(_0x38a2('0x4'));var fs=require('fs');var Redis=require(_0x38a2('0x5'));var db=require(_0x38a2('0x6'))['db'];var utils=require(_0x38a2('0x7'));var logger=require('../../config/logger')(_0x38a2('0x8'));var config=require(_0x38a2('0x9'));var jayson=require(_0x38a2('0xa'));var client=jayson[_0x38a2('0xb')][_0x38a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32e69f,_0x3b70e7,_0xb90253){return new BPromise(function(_0x4b2fe5,_0x11399c){return client[_0x38a2('0xd')](_0x32e69f,_0xb90253)[_0x38a2('0xe')](function(_0x2a3f98){logger[_0x38a2('0xf')]('Attachment,\x20%s,\x20%s',_0x3b70e7,_0x38a2('0x10'));logger[_0x38a2('0x11')](_0x38a2('0x12'),_0x3b70e7,_0x38a2('0x10'),JSON[_0x38a2('0x13')](_0x2a3f98));if(_0x2a3f98[_0x38a2('0x14')]){if(_0x2a3f98[_0x38a2('0x14')][_0x38a2('0x15')]===0x1f4){logger['error'](_0x38a2('0x16'),_0x3b70e7,_0x2a3f98[_0x38a2('0x14')][_0x38a2('0x17')]);return _0x11399c(_0x2a3f98['error']['message']);}logger[_0x38a2('0x14')]('Attachment,\x20%s,\x20%s',_0x3b70e7,_0x2a3f98[_0x38a2('0x14')][_0x38a2('0x17')]);return _0x4b2fe5(_0x2a3f98['error']['message']);}else{logger[_0x38a2('0xf')](_0x38a2('0x16'),_0x3b70e7,_0x38a2('0x10'));_0x4b2fe5(_0x2a3f98[_0x38a2('0x18')]['message']);}})['catch'](function(_0x51301d){logger[_0x38a2('0x14')](_0x38a2('0x16'),_0x3b70e7,_0x51301d);_0x11399c(_0x51301d);});});}exports[_0x38a2('0x19')]=function(_0x5c6da7){var _0x503242=this;return new Promise(function(_0x92c5e,_0x46758d){return db['Attachment']['create'](_0x5c6da7[_0x38a2('0x1a')],{'raw':_0x5c6da7[_0x38a2('0x1b')]?_0x5c6da7['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x59bd18){logger[_0x38a2('0xf')](_0x38a2('0x19'),_0x5c6da7);logger[_0x38a2('0x11')](_0x38a2('0x19'),_0x5c6da7,JSON[_0x38a2('0x13')](_0x59bd18));_0x92c5e(_0x59bd18);})['catch'](function(_0x1e813f){logger[_0x38a2('0x14')]('CreateAttachment',_0x1e813f[_0x38a2('0x17')],_0x5c6da7);_0x46758d(_0x503242[_0x38a2('0x14')](0x1f4,_0x1e813f[_0x38a2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 136b1aa..e1228c1 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 _0x50c1=['/:id/download','post','/:id/clone','format','single','file','create','put','update','delete','/:id','destroy','multer','path','express','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show'];(function(_0x5560f0,_0x5b93f4){var _0x16b9be=function(_0x31f59e){while(--_0x31f59e){_0x5560f0['push'](_0x5560f0['shift']());}};_0x16b9be(++_0x5b93f4);}(_0x50c1,0x171));var _0x150c=function(_0x52ea77,_0xbe31b5){_0x52ea77=_0x52ea77-0x0;var _0xcf4fa=_0x50c1[_0x52ea77];return _0xcf4fa;};'use strict';var multer=require(_0x150c('0x0'));var util=require('util');var path=require(_0x150c('0x1'));var timeout=require('connect-timeout');var express=require(_0x150c('0x2'));var router=express['Router']();var auth=require(_0x150c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x150c('0x4'));var controller=require('./attachment.controller');router[_0x150c('0x5')]('/',auth['isAuthenticated'](),controller[_0x150c('0x6')]);router[_0x150c('0x5')]('/:id',auth[_0x150c('0x7')](),controller[_0x150c('0x8')]);router[_0x150c('0x5')](_0x150c('0x9'),auth[_0x150c('0x7')](),controller['download']);router[_0x150c('0xa')](_0x150c('0xb'),auth[_0x150c('0x7')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd66817,_0x40642b,_0x462ae3){_0x462ae3(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x3831c6,_0x5d0626,_0x12a0a1){_0x12a0a1(null,util[_0x150c('0xc')]('%s-%s',Date['now'](),_0x5d0626['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x150c('0xa')]('/',upload[_0x150c('0xd')](_0x150c('0xe')),controller[_0x150c('0xf')]);router[_0x150c('0x10')]('/:id',auth[_0x150c('0x7')](),controller[_0x150c('0x11')]);router[_0x150c('0x12')](_0x150c('0x13'),auth[_0x150c('0x7')](),controller[_0x150c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x1e8c=['../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','download','post','/:id/clone','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','file','create','update','delete','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5cd104,_0x1619af){var _0x5546a1=function(_0x5b196a){while(--_0x5b196a){_0x5cd104['push'](_0x5cd104['shift']());}};_0x5546a1(++_0x1619af);}(_0x1e8c,0xd3));var _0xc1e8=function(_0x1a983d,_0xa72c7b){_0x1a983d=_0x1a983d-0x0;var _0x58e9a3=_0x1e8c[_0x1a983d];return _0x58e9a3;};'use strict';var multer=require('multer');var util=require(_0xc1e8('0x0'));var path=require(_0xc1e8('0x1'));var timeout=require(_0xc1e8('0x2'));var express=require(_0xc1e8('0x3'));var router=express[_0xc1e8('0x4')]();var auth=require(_0xc1e8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc1e8('0x6'));var controller=require(_0xc1e8('0x7'));router[_0xc1e8('0x8')]('/',auth[_0xc1e8('0x9')](),controller[_0xc1e8('0xa')]);router[_0xc1e8('0x8')]('/:id',auth[_0xc1e8('0x9')](),controller[_0xc1e8('0xb')]);router[_0xc1e8('0x8')](_0xc1e8('0xc'),auth[_0xc1e8('0x9')](),controller[_0xc1e8('0xd')]);router[_0xc1e8('0xe')](_0xc1e8('0xf'),auth[_0xc1e8('0x9')](),controller['clone']);var upload=multer({'storage':multer[_0xc1e8('0x10')]({'destination':function(_0x43a338,_0x1dd751,_0x1eefe8){_0x1eefe8(null,path[_0xc1e8('0x11')](config[_0xc1e8('0x12')],_0xc1e8('0x13')));},'filename':function(_0x2e2a05,_0x5c7253,_0xa36773){_0xa36773(null,util[_0xc1e8('0x14')](_0xc1e8('0x15'),Date[_0xc1e8('0x16')](),_0x5c7253[_0xc1e8('0x17')][_0xc1e8('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc1e8('0xe')]('/',upload['single'](_0xc1e8('0x19')),controller[_0xc1e8('0x1a')]);router['put']('/:id',auth[_0xc1e8('0x9')](),controller[_0xc1e8('0x1b')]);router[_0xc1e8('0x1c')](_0xc1e8('0x1d'),auth[_0xc1e8('0x9')](),controller['destroy']);module[_0xc1e8('0x1e')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index d6ec257..30d8e47 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 _0x5791=['../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','/login','profile','email','use','google','clientSecret','Setting','findOne','allowedLoginAttempts','then','User','find','map','emails','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','catch','passport-google-oauth20','Strategy','moment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5791,0x138));var _0x1579=function(_0x1883a8,_0x52850e){_0x1883a8=_0x1883a8-0x0;var _0x77aa6c=_0x5791[_0x1883a8];return _0x77aa6c;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x1579('0x0'))[_0x1579('0x1')];var moment=require(_0x1579('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x1579('0x3'));var signToken=require(_0x1579('0x4'))[_0x1579('0x5')];var utils=require(_0x1579('0x6'));exports[_0x1579('0x7')]=passport[_0x1579('0x8')]('google',{'failureRedirect':_0x1579('0x9'),'scope':[_0x1579('0xa'),_0x1579('0xb')],'session':![]});exports['callback']=passport[_0x1579('0x8')]('google',{'failureRedirect':_0x1579('0x9'),'session':![]});passport[_0x1579('0xc')](new GoogleStrategy({'clientID':config['google']?config[_0x1579('0xd')]['clientID']:'id','clientSecret':config[_0x1579('0xd')]?config[_0x1579('0xd')][_0x1579('0xe')]:'secret','callbackURL':config[_0x1579('0xd')]?config[_0x1579('0xd')]['callbackURL']:''},function(_0x2582fa,_0x33818c,_0x5e8ee6,_0x1aba16){var _0x34aa08,_0x570c83;return db[_0x1579('0xf')][_0x1579('0x10')]({'where':{'id':0x1},'attributes':[_0x1579('0x11'),'blockDuration'],'raw':!![]})[_0x1579('0x12')](function(_0x1ad785){_0x34aa08=_0x1ad785;return db[_0x1579('0x13')][_0x1579('0x14')]({'where':{'email':_[_0x1579('0x15')](_0x5e8ee6[_0x1579('0x16')],_0x1579('0x17')),'role':{'$or':['admin',_0x1579('0x18'),_0x1579('0x19')]}}});})[_0x1579('0x12')](function(_0x430dfd){_0x570c83=_0x430dfd;if(_0x570c83){if(_0x570c83[_0x1579('0x1a')]){return _0x1aba16(_0x1579('0x1b'));}else if(_0x34aa08[_0x1579('0x1c')]>0x0){if(_0x570c83['blocked']){if(moment(_0x570c83[_0x1579('0x1d')])[_0x1579('0x1e')](_0x34aa08[_0x1579('0x1c')],_0x1579('0x1f'))>moment()){return _0x1aba16(_0x1579('0x1b'));}else{return utils[_0x1579('0x20')](_0x570c83,0x0,![],null)[_0x1579('0x12')](function(){return utils[_0x1579('0x21')](_0x570c83);})['then'](function(){return _0x1aba16(null,_0x570c83);});}}else{return utils[_0x1579('0x21')](_0x570c83)['then'](function(){return _0x1aba16(null,_0x570c83);});}}else{return utils[_0x1579('0x21')](_0x570c83)[_0x1579('0x12')](function(){return _0x1aba16(null,_0x570c83);});}}return _0x1aba16('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x1579('0x22')](function(_0x28a697){_0x1aba16(_0x28a697);});})); \ No newline at end of file +var _0x732b=['../../config/environment','signToken','../../config/utils','login','authenticate','google','/login','email','callback','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','map','emails','value','admin','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb'];(function(_0x4f94ee,_0x26e8fd){var _0x1bb8ec=function(_0x466638){while(--_0x466638){_0x4f94ee['push'](_0x4f94ee['shift']());}};_0x1bb8ec(++_0x26e8fd);}(_0x732b,0x163));var _0xb732=function(_0x389738,_0x4866ba){_0x389738=_0x389738-0x0;var _0x1be726=_0x732b[_0x389738];return _0x1be726;};'use strict';var _=require(_0xb732('0x0'));var passport=require(_0xb732('0x1'));var GoogleStrategy=require(_0xb732('0x2'))['Strategy'];var moment=require(_0xb732('0x3'));var db=require(_0xb732('0x4'))['db'];var config=require(_0xb732('0x5'));var signToken=require('../../components/auth/service')[_0xb732('0x6')];var utils=require(_0xb732('0x7'));exports[_0xb732('0x8')]=passport[_0xb732('0x9')](_0xb732('0xa'),{'failureRedirect':_0xb732('0xb'),'scope':['profile',_0xb732('0xc')],'session':![]});exports[_0xb732('0xd')]=passport[_0xb732('0x9')](_0xb732('0xa'),{'failureRedirect':_0xb732('0xb'),'session':![]});passport[_0xb732('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0xb732('0xa')][_0xb732('0xf')]:'id','clientSecret':config[_0xb732('0xa')]?config[_0xb732('0xa')]['clientSecret']:_0xb732('0x10'),'callbackURL':config[_0xb732('0xa')]?config[_0xb732('0xa')][_0xb732('0x11')]:''},function(_0x52db40,_0x3e079a,_0x3221e1,_0x45107b){var _0x56ee29,_0x375186;return db[_0xb732('0x12')][_0xb732('0x13')]({'where':{'id':0x1},'attributes':[_0xb732('0x14'),_0xb732('0x15')],'raw':!![]})[_0xb732('0x16')](function(_0x3a99b1){_0x56ee29=_0x3a99b1;return db[_0xb732('0x17')]['find']({'where':{'email':_[_0xb732('0x18')](_0x3221e1[_0xb732('0x19')],_0xb732('0x1a')),'role':{'$or':[_0xb732('0x1b'),'user','agent']}}});})[_0xb732('0x16')](function(_0x261596){_0x375186=_0x261596;if(_0x375186){if(_0x375186[_0xb732('0x1c')]){return _0x45107b(_0xb732('0x1d'));}else if(_0x56ee29[_0xb732('0x15')]>0x0){if(_0x375186[_0xb732('0x1e')]){if(moment(_0x375186[_0xb732('0x1f')])['add'](_0x56ee29[_0xb732('0x15')],_0xb732('0x20'))>moment()){return _0x45107b(_0xb732('0x1d'));}else{return utils[_0xb732('0x21')](_0x375186,0x0,![],null)[_0xb732('0x16')](function(){return utils[_0xb732('0x22')](_0x375186);})[_0xb732('0x16')](function(){return _0x45107b(null,_0x375186);});}}else{return utils['getLicense'](_0x375186)[_0xb732('0x16')](function(){return _0x45107b(null,_0x375186);});}}else{return utils['getLicense'](_0x375186)[_0xb732('0x16')](function(){return _0x45107b(null,_0x375186);});}}return _0x45107b(_0xb732('0x1d'));})[_0xb732('0x23')](function(_0x4619a3){_0x45107b(_0x4619a3);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 52f463f..14c0a80 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 _0x6ff1=['callback','isMiddleware','express','passport','Router','./authGoogle.controller','get','/callback'];(function(_0x6cd239,_0x3f74cc){var _0x142d0e=function(_0x57703e){while(--_0x57703e){_0x6cd239['push'](_0x6cd239['shift']());}};_0x142d0e(++_0x3f74cc);}(_0x6ff1,0x10a));var _0x16ff=function(_0x3cc5b1,_0xb80024){_0x3cc5b1=_0x3cc5b1-0x0;var _0xf4a384=_0x6ff1[_0x3cc5b1];return _0xf4a384;};'use strict';var express=require(_0x16ff('0x0'));var passport=require(_0x16ff('0x1'));var router=express[_0x16ff('0x2')]();var controller=require(_0x16ff('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x16ff('0x4')]('/',controller['login']);router[_0x16ff('0x4')](_0x16ff('0x5'),controller[_0x16ff('0x6')],authService[_0x16ff('0x7')],userController['login'],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0x4ded=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x5875c1,_0x58a247){var _0x103b60=function(_0xa953ab){while(--_0xa953ab){_0x5875c1['push'](_0x5875c1['shift']());}};_0x103b60(++_0x58a247);}(_0x4ded,0x116));var _0xd4de=function(_0x41d140,_0x19f6e3){_0x41d140=_0x41d140-0x0;var _0x11fe9c=_0x4ded[_0x41d140];return _0x11fe9c;};'use strict';var express=require(_0xd4de('0x0'));var passport=require(_0xd4de('0x1'));var router=express[_0xd4de('0x2')]();var controller=require(_0xd4de('0x3'));var userController=require(_0xd4de('0x4'));var authService=require(_0xd4de('0x5'));router[_0xd4de('0x6')]('/',controller[_0xd4de('0x7')]);router[_0xd4de('0x6')](_0xd4de('0x8'),controller[_0xd4de('0x9')],authService[_0xd4de('0xa')],userController['login'],authService[_0xd4de('0xb')]);module[_0xd4de('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 729e7ee..d3fc48d 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 _0xd6d3=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','test','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','email','generate','body','trim','toLowerCase','blockDuration','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','/reset/','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.','securePassword','save','status','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','client','http','Setting','allowedLoginAttempts','then','findOne','name','password','role','disabled','blocked','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate'];(function(_0x1874b8,_0x2f5ac7){var _0x3b76be=function(_0x5d9753){while(--_0x5d9753){_0x1874b8['push'](_0x1874b8['shift']());}};_0x3b76be(++_0x2f5ac7);}(_0xd6d3,0x133));var _0x3d6d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd6d3[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0x3d6d('0x0'));var passport=require(_0x3d6d('0x1'));var LocalStrategy=require(_0x3d6d('0x2'))[_0x3d6d('0x3')];var jayson=require(_0x3d6d('0x4'));var _=require(_0x3d6d('0x5'));var rs=require(_0x3d6d('0x6'));var moment=require(_0x3d6d('0x7'));var db=require(_0x3d6d('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0x3d6d('0x9')][_0x3d6d('0xa')]({'port':0x232b});function localAuthenticate(_0x55165f,_0x55c9cc,_0x4238a8,_0xf5d3b3){var _0x799c44,_0x57d29b;return db[_0x3d6d('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x3d6d('0xc'),'blockDuration'],'raw':!![]})[_0x3d6d('0xd')](function(_0xb101a6){_0x799c44=_0xb101a6;return _0x55165f[_0x3d6d('0xe')]({'attributes':['id',_0x3d6d('0xf'),_0x3d6d('0x10'),'salt',_0x3d6d('0x11'),_0x3d6d('0x12'),_0x3d6d('0x13'),'blockedAt',_0x3d6d('0x14')],'where':{'name':_0x55c9cc,'role':{'$or':[_0x3d6d('0x15'),_0x3d6d('0x16'),'agent']}}});})[_0x3d6d('0xd')](function(_0x483319){if(!_0x483319||_0x483319&&_0x483319[_0x3d6d('0xf')]!==_0x55c9cc){throw new Error(_0x3d6d('0x17'));}else{_0x57d29b=_0x483319;return _0x57d29b;}})[_0x3d6d('0xd')](function(){_0x57d29b[_0x3d6d('0x18')](_0x4238a8,function(_0x3559b1,_0x2b8e26){var _0x250668=_0x57d29b[_0x3d6d('0x14')]+0x1;if(_0x3559b1){return _0xf5d3b3(_0x3559b1);}else if(!_0x2b8e26){if(_0x57d29b[_0x3d6d('0x12')]){return _0xf5d3b3(null,![],{'message':_0x3d6d('0x17')});}else if(_0x799c44['allowedLoginAttempts']>0x0){if(_0x57d29b['blocked']){if(_0x799c44['blockDuration']>0x0){if(moment(_0x57d29b[_0x3d6d('0x19')])[_0x3d6d('0x1a')](_0x799c44['blockDuration'],_0x3d6d('0x1b'))>moment()){return _0xf5d3b3(null,![],{'message':_0x3d6d('0x17')});}else{return utils[_0x3d6d('0x1c')](_0x57d29b,_0x250668,![],null)[_0x3d6d('0xd')](function(){return _0xf5d3b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0xf5d3b3(null,![],{'message':_0x3d6d('0x17')});}}else{if(_0x250668>=_0x799c44['allowedLoginAttempts']){return utils[_0x3d6d('0x1c')](_0x57d29b,0x0,!![],moment())[_0x3d6d('0xd')](function(){return _0xf5d3b3(null,![],{'message':_0x3d6d('0x17')});});}else{return utils[_0x3d6d('0x1c')](_0x57d29b,_0x250668,![],null)[_0x3d6d('0xd')](function(){return _0xf5d3b3(null,![],{'message':_0x3d6d('0x17')});});}}}else{return _0xf5d3b3(null,![],{'message':_0x3d6d('0x17')});}}else{if(_0x57d29b[_0x3d6d('0x12')]){return _0xf5d3b3(null,![],{'message':_0x3d6d('0x17')});}else if(_0x799c44[_0x3d6d('0xc')]>0x0){if(_0x57d29b[_0x3d6d('0x13')]){if(_0x799c44['blockDuration']>0x0){if(moment(_0x57d29b['blockedAt'])['add'](_0x799c44['blockDuration'],'minutes')>moment()){return _0xf5d3b3(null,![],{'message':_0x3d6d('0x17')});}else{return utils[_0x3d6d('0x1c')](_0x57d29b,0x0,![],null)[_0x3d6d('0xd')](function(){return utils['getLicense'](_0x57d29b);})[_0x3d6d('0xd')](function(){return _0xf5d3b3(null,_0x57d29b);});}}else{return _0xf5d3b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3d6d('0x1c')](_0x57d29b,0x0,![],null)[_0x3d6d('0xd')](function(){return utils[_0x3d6d('0x1d')](_0x57d29b);})[_0x3d6d('0xd')](function(){return _0xf5d3b3(null,_0x57d29b);})[_0x3d6d('0x1e')](function(_0x2d71d6){return _0xf5d3b3(null,![],_0x2d71d6);});}}else{if(_0x57d29b[_0x3d6d('0x13')]){return _0xf5d3b3(null,![],{'message':_0x3d6d('0x17')});}else{return utils['getLicense'](_0x57d29b)['then'](function(){return _0xf5d3b3(null,_0x57d29b);});}}}});})['catch'](function(_0x17ab90){return _0xf5d3b3(null,![],_0x17ab90);});}function sendServiceMail(_0x49a209){return db['MailAccount'][_0x3d6d('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x3d6d('0xf'),'email'],'include':[{'model':db[_0x3d6d('0x20')],'as':_0x3d6d('0x21')}]})['then'](function(_0x43a884){if(!_0x43a884){throw new Error(_0x3d6d('0x22'));}var _0x2620be={'tls':{'rejectUnauthorized':![]}};if(_0x43a884[_0x3d6d('0x21')][_0x3d6d('0x23')]){_0x2620be[_0x3d6d('0x23')]=_0x43a884[_0x3d6d('0x21')][_0x3d6d('0x23')];}else{_0x2620be[_0x3d6d('0x24')]=_0x43a884[_0x3d6d('0x21')][_0x3d6d('0x24')];_0x2620be[_0x3d6d('0x25')]=_0x43a884['Smtp'][_0x3d6d('0x25')];_0x2620be[_0x3d6d('0x26')]=_0x43a884[_0x3d6d('0x21')][_0x3d6d('0x26')];}if(_0x43a884['Smtp']['authentication']){_0x2620be['auth']={'user':_0x43a884[_0x3d6d('0x21')]['user'],'pass':_0x43a884[_0x3d6d('0x21')][_0x3d6d('0x27')]};}var _0x43beba={'account':_0x2620be,'message':_['merge']({'from':util[_0x3d6d('0x28')](_0x3d6d('0x29'),_0x43a884[_0x3d6d('0xf')],_0x43a884['email']||_0x43a884[_0x3d6d('0x21')]['user'])},_0x49a209)};return client[_0x3d6d('0x2a')](_0x3d6d('0x2b'),_0x43beba);})[_0x3d6d('0xd')](function(_0xaaee96){if(_0xaaee96[_0x3d6d('0x2c')]){throw new Error(util[_0x3d6d('0x28')](_0x3d6d('0x2d'),_0xaaee96[_0x3d6d('0x2c')][_0x3d6d('0x2e')]||JSON[_0x3d6d('0x2f')](_0xaaee96[_0x3d6d('0x2c')])));}return!![];});}function handleError(_0x3d18f3,_0x29f59d,_0x15a5d2){return _0x3d18f3['status'](_0x29f59d||0x1f4)[_0x3d6d('0x30')]({'message':_0x15a5d2?_0x15a5d2['message']||_0x15a5d2:''});}function checkPasswordPattern(_0x2c913b,_0x2296ed,_0x3a1655){if(_0x3a1655){var _0x597307=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x597307[_0x3d6d('0x31')](_0x2296ed)){return _0x2c913b;}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 _0x2c913b;}}exports[_0x3d6d('0x32')]=function(_0x94b81c,_0x2f8066,_0x4378ab){passport['authenticate'](_0x3d6d('0x33'),function(_0x1fe8d5,_0x5bddc4,_0x5566c2){var _0x4610e9=_0x1fe8d5||_0x5566c2;if(_0x4610e9){return handleError(_0x2f8066,0x191,_0x4610e9);}if(!_0x5bddc4){return handleError(_0x2f8066,0x194,{'message':_0x3d6d('0x34')});}else{var _0x410a92={'payload':{'id':_0x5bddc4['id'],'role':_0x5bddc4[_0x3d6d('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x410a92)[_0x3d6d('0xd')](function(_0x2763b8){_0x2f8066[_0x3d6d('0x35')]({'id':_0x5bddc4['id'],'token':_0x2763b8,'statusCall':'','isAlreadyLogged':_0x5bddc4[_0x3d6d('0x36')]});});}})(_0x94b81c,_0x2f8066,_0x4378ab);};exports['forgot']=function(_0x22fdeb,_0x48c75f,_0x52e863){if(!_0x22fdeb['body'][_0x3d6d('0x37')]){return handleError(_0x48c75f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5c7967=rs[_0x3d6d('0x38')]();_0x22fdeb[_0x3d6d('0x39')][_0x3d6d('0x37')]=_0x22fdeb[_0x3d6d('0x39')][_0x3d6d('0x37')][_0x3d6d('0x3a')]()[_0x3d6d('0x3b')]();var _0x3fc332;return db[_0x3d6d('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x3d6d('0xc'),_0x3d6d('0x3c')],'raw':!![]})[_0x3d6d('0xd')](function(_0x2e39bf){_0x3fc332=_0x2e39bf;return db[_0x3d6d('0x3d')]['find']({'where':{'email':_0x22fdeb[_0x3d6d('0x39')]['email']}});})[_0x3d6d('0xd')](function(_0x3df5ca){if(!_0x3df5ca){throw new Error(_0x3d6d('0x3e'));}if(_0x3df5ca[_0x3d6d('0x12')]){throw new Error(_0x3d6d('0x3f'));}if(_0x3df5ca[_0x3d6d('0x13')]){if(moment(_0x3df5ca[_0x3d6d('0x19')])[_0x3d6d('0x1a')](_0x3fc332[_0x3d6d('0x3c')],_0x3d6d('0x1b'))>moment()){throw new Error(_0x3d6d('0x40'));}else{_0x3df5ca[_0x3d6d('0x13')]=![];_0x3df5ca['blockedAt']=null;}}_0x3df5ca[_0x3d6d('0x41')]=_0x5c7967;_0x3df5ca[_0x3d6d('0x42')]=Date['now']()+0x36ee80;return _0x3df5ca['save']();})[_0x3d6d('0xd')](function(){return sendServiceMail({'to':_0x22fdeb[_0x3d6d('0x39')][_0x3d6d('0x37')],'subject':_0x3d6d('0x43'),'text':_0x3d6d('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x3d6d('0x45')+_0x22fdeb[_0x3d6d('0x46')]['host']+_0x3d6d('0x47')+_0x5c7967+'\x0a\x0a'+_0x3d6d('0x48')});})['then'](function(){_0x48c75f['status'](0xc8)[_0x3d6d('0x30')]({'message':_0x3d6d('0x49')});})[_0x3d6d('0x1e')](function(_0xe7058c){return handleError(_0x48c75f,0x1f4,_0xe7058c);});};exports[_0x3d6d('0x4a')]=function(_0x1408c5,_0x5b995e,_0x5540fb){var _0x23922f;return db['User'][_0x3d6d('0x1f')]({'where':{'resetPasswordToken':_0x1408c5[_0x3d6d('0x4b')][_0x3d6d('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x3d6d('0x4d')]()}}})[_0x3d6d('0xd')](function(_0xa684ab){_0x23922f=_0xa684ab;if(!_0x23922f){throw new Error(_0x3d6d('0x4e'));}return db['Setting']['findOne']({'attributes':['id','securePassword']});})[_0x3d6d('0xd')](function(_0x3504df){return checkPasswordPattern(_0x3504df,_0x1408c5[_0x3d6d('0x39')][_0x3d6d('0x10')],_0x3504df[_0x3d6d('0x4f')]);})[_0x3d6d('0xd')](function(){_0x23922f['password']=_0x1408c5[_0x3d6d('0x39')]['password'];_0x23922f[_0x3d6d('0x41')]=null;_0x23922f[_0x3d6d('0x42')]=null;return _0x23922f[_0x3d6d('0x50')]();})['then'](function(){_0x5b995e[_0x3d6d('0x51')](0xc8)[_0x3d6d('0x30')]({'message':_0x3d6d('0x52')});})[_0x3d6d('0x1e')](function(_0xee4ed2){return handleError(_0x5b995e,0x1f4,_0xee4ed2);});};passport['use'](new LocalStrategy({'usernameField':_0x3d6d('0xf'),'passwordField':_0x3d6d('0x10')},function(_0x53fbde,_0x226993,_0x1e6f6b){return localAuthenticate(db[_0x3d6d('0x3d')],_0x53fbde,_0x226993,_0x1e6f6b);})); \ No newline at end of file +var _0xd139=['login','authenticate','local','signToken','json','Email\x20parameter\x20is\x20missing','generate','body','trim','User','minutes','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','resetPasswordToken','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','disabled','add','getLicense','catch','find','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','merge','format','\x22%s\x22\x20<%s>','email','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','test'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd139,0xf9));var _0x9d13=function(_0xd35555,_0x5e36b3){_0xd35555=_0xd35555-0x0;var _0x1dd3da=_0xd139[_0xd35555];return _0x1dd3da;};'use strict';var util=require('util');var passport=require(_0x9d13('0x0'));var LocalStrategy=require(_0x9d13('0x1'))[_0x9d13('0x2')];var jayson=require(_0x9d13('0x3'));var _=require(_0x9d13('0x4'));var rs=require('randomstring');var moment=require(_0x9d13('0x5'));var db=require(_0x9d13('0x6'))['db'];var authService=require(_0x9d13('0x7'));var utils=require('../../config/utils');var client=jayson[_0x9d13('0x8')][_0x9d13('0x9')]({'port':0x232b});function localAuthenticate(_0x1dee67,_0x249662,_0x3453e7,_0x4fe81f){var _0x4a7458,_0x551670;return db[_0x9d13('0xa')][_0x9d13('0xb')]({'where':{'id':0x1},'attributes':[_0x9d13('0xc'),_0x9d13('0xd')],'raw':!![]})[_0x9d13('0xe')](function(_0x3a5bf1){_0x4a7458=_0x3a5bf1;return _0x1dee67[_0x9d13('0xb')]({'attributes':['id',_0x9d13('0xf'),'password',_0x9d13('0x10'),'role','disabled',_0x9d13('0x11'),_0x9d13('0x12'),_0x9d13('0x13')],'where':{'name':_0x249662,'role':{'$or':[_0x9d13('0x14'),_0x9d13('0x15'),'agent']}}});})[_0x9d13('0xe')](function(_0x429617){if(!_0x429617||_0x429617&&_0x429617[_0x9d13('0xf')]!==_0x249662){throw new Error(_0x9d13('0x16'));}else{_0x551670=_0x429617;return _0x551670;}})[_0x9d13('0xe')](function(){_0x551670['authenticate'](_0x3453e7,function(_0x538696,_0x2fd5ae){var _0x282643=_0x551670[_0x9d13('0x13')]+0x1;if(_0x538696){return _0x4fe81f(_0x538696);}else if(!_0x2fd5ae){if(_0x551670['disabled']){return _0x4fe81f(null,![],{'message':_0x9d13('0x16')});}else if(_0x4a7458['allowedLoginAttempts']>0x0){if(_0x551670[_0x9d13('0x11')]){if(_0x4a7458[_0x9d13('0xd')]>0x0){if(moment(_0x551670['blockedAt'])['add'](_0x4a7458[_0x9d13('0xd')],'minutes')>moment()){return _0x4fe81f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9d13('0x17')](_0x551670,_0x282643,![],null)['then'](function(){return _0x4fe81f(null,![],{'message':_0x9d13('0x16')});});}}else{return _0x4fe81f(null,![],{'message':_0x9d13('0x16')});}}else{if(_0x282643>=_0x4a7458[_0x9d13('0xc')]){return utils[_0x9d13('0x17')](_0x551670,0x0,!![],moment())[_0x9d13('0xe')](function(){return _0x4fe81f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x9d13('0x17')](_0x551670,_0x282643,![],null)[_0x9d13('0xe')](function(){return _0x4fe81f(null,![],{'message':_0x9d13('0x16')});});}}}else{return _0x4fe81f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x551670[_0x9d13('0x18')]){return _0x4fe81f(null,![],{'message':_0x9d13('0x16')});}else if(_0x4a7458['allowedLoginAttempts']>0x0){if(_0x551670['blocked']){if(_0x4a7458[_0x9d13('0xd')]>0x0){if(moment(_0x551670[_0x9d13('0x12')])[_0x9d13('0x19')](_0x4a7458[_0x9d13('0xd')],'minutes')>moment()){return _0x4fe81f(null,![],{'message':_0x9d13('0x16')});}else{return utils[_0x9d13('0x17')](_0x551670,0x0,![],null)[_0x9d13('0xe')](function(){return utils[_0x9d13('0x1a')](_0x551670);})[_0x9d13('0xe')](function(){return _0x4fe81f(null,_0x551670);});}}else{return _0x4fe81f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x9d13('0x17')](_0x551670,0x0,![],null)[_0x9d13('0xe')](function(){return utils['getLicense'](_0x551670);})[_0x9d13('0xe')](function(){return _0x4fe81f(null,_0x551670);})[_0x9d13('0x1b')](function(_0x10f9af){return _0x4fe81f(null,![],_0x10f9af);});}}else{if(_0x551670[_0x9d13('0x11')]){return _0x4fe81f(null,![],{'message':_0x9d13('0x16')});}else{return utils[_0x9d13('0x1a')](_0x551670)[_0x9d13('0xe')](function(){return _0x4fe81f(null,_0x551670);});}}}});})[_0x9d13('0x1b')](function(_0xd5bd00){return _0x4fe81f(null,![],_0xd5bd00);});}function sendServiceMail(_0x58424e){return db['MailAccount'][_0x9d13('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x9d13('0xf'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x9d13('0x1d')}]})['then'](function(_0xb02e2a){if(!_0xb02e2a){throw new Error(_0x9d13('0x1e'));}var _0x19237e={'tls':{'rejectUnauthorized':![]}};if(_0xb02e2a[_0x9d13('0x1d')]['service']){_0x19237e[_0x9d13('0x1f')]=_0xb02e2a[_0x9d13('0x1d')][_0x9d13('0x1f')];}else{_0x19237e[_0x9d13('0x20')]=_0xb02e2a[_0x9d13('0x1d')][_0x9d13('0x20')];_0x19237e['port']=_0xb02e2a[_0x9d13('0x1d')][_0x9d13('0x21')];_0x19237e[_0x9d13('0x22')]=_0xb02e2a['Smtp']['secure'];}if(_0xb02e2a[_0x9d13('0x1d')][_0x9d13('0x23')]){_0x19237e['auth']={'user':_0xb02e2a[_0x9d13('0x1d')][_0x9d13('0x15')],'pass':_0xb02e2a[_0x9d13('0x1d')][_0x9d13('0x24')]};}var _0x27ddfb={'account':_0x19237e,'message':_[_0x9d13('0x25')]({'from':util[_0x9d13('0x26')](_0x9d13('0x27'),_0xb02e2a[_0x9d13('0xf')],_0xb02e2a[_0x9d13('0x28')]||_0xb02e2a[_0x9d13('0x1d')]['user'])},_0x58424e)};return client['request']('SendMail',_0x27ddfb);})[_0x9d13('0xe')](function(_0x5c1b2b){if(_0x5c1b2b[_0x9d13('0x29')]){throw new Error(util[_0x9d13('0x26')](_0x9d13('0x2a'),_0x5c1b2b[_0x9d13('0x29')]['message']||JSON[_0x9d13('0x2b')](_0x5c1b2b[_0x9d13('0x29')])));}return!![];});}function handleError(_0x30228e,_0x691a2a,_0x456abb){return _0x30228e[_0x9d13('0x2c')](_0x691a2a||0x1f4)[_0x9d13('0x2d')]({'message':_0x456abb?_0x456abb['message']||_0x456abb:''});}function checkPasswordPattern(_0x56b2f3,_0x30b335,_0x2d22a9){if(_0x2d22a9){var _0x3b9199=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b9199[_0x9d13('0x2e')](_0x30b335)){return _0x56b2f3;}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 _0x56b2f3;}}exports[_0x9d13('0x2f')]=function(_0x59441c,_0xd264e5,_0x58aea0){passport[_0x9d13('0x30')](_0x9d13('0x31'),function(_0x3b6603,_0x316581,_0x1bcf26){var _0x29d6f3=_0x3b6603||_0x1bcf26;if(_0x29d6f3){return handleError(_0xd264e5,0x191,_0x29d6f3);}if(!_0x316581){return handleError(_0xd264e5,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5608ee={'payload':{'id':_0x316581['id'],'role':_0x316581['role']},'options':{'expiresIn':0x15180}};return authService[_0x9d13('0x32')](_0x5608ee)['then'](function(_0x4f7a57){_0xd264e5[_0x9d13('0x33')]({'id':_0x316581['id'],'token':_0x4f7a57,'statusCall':'','isAlreadyLogged':_0x316581['online']});});}})(_0x59441c,_0xd264e5,_0x58aea0);};exports['forgot']=function(_0x1e4674,_0x3a1d48,_0x3971fa){if(!_0x1e4674['body'][_0x9d13('0x28')]){return handleError(_0x3a1d48,0x1f4,{'message':_0x9d13('0x34')});}var _0x596834=rs[_0x9d13('0x35')]();_0x1e4674[_0x9d13('0x36')][_0x9d13('0x28')]=_0x1e4674['body']['email'][_0x9d13('0x37')]()['toLowerCase']();var _0x59e122;return db[_0x9d13('0xa')][_0x9d13('0xb')]({'where':{'id':0x1},'attributes':[_0x9d13('0xc'),'blockDuration'],'raw':!![]})[_0x9d13('0xe')](function(_0x4deb3e){_0x59e122=_0x4deb3e;return db[_0x9d13('0x38')][_0x9d13('0x1c')]({'where':{'email':_0x1e4674[_0x9d13('0x36')][_0x9d13('0x28')]}});})['then'](function(_0xdb9305){if(!_0xdb9305){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xdb9305[_0x9d13('0x18')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0xdb9305[_0x9d13('0x11')]){if(moment(_0xdb9305[_0x9d13('0x12')])['add'](_0x59e122['blockDuration'],_0x9d13('0x39'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xdb9305['blocked']=![];_0xdb9305[_0x9d13('0x12')]=null;}}_0xdb9305['resetPasswordToken']=_0x596834;_0xdb9305[_0x9d13('0x3a')]=Date[_0x9d13('0x3b')]()+0x36ee80;return _0xdb9305[_0x9d13('0x3c')]();})['then'](function(){return sendServiceMail({'to':_0x1e4674[_0x9d13('0x36')][_0x9d13('0x28')],'subject':_0x9d13('0x3d'),'text':_0x9d13('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9d13('0x3f')+_0x1e4674[_0x9d13('0x40')][_0x9d13('0x20')]+'/reset/'+_0x596834+'\x0a\x0a'+_0x9d13('0x41')});})[_0x9d13('0xe')](function(){_0x3a1d48[_0x9d13('0x2c')](0xc8)[_0x9d13('0x2d')]({'message':_0x9d13('0x42')});})[_0x9d13('0x1b')](function(_0x7b9d42){return handleError(_0x3a1d48,0x1f4,_0x7b9d42);});};exports[_0x9d13('0x43')]=function(_0x4c4dc4,_0x850840,_0x1c8f66){var _0x3a5085;return db[_0x9d13('0x38')]['find']({'where':{'resetPasswordToken':_0x4c4dc4['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x9d13('0xe')](function(_0x29408a){_0x3a5085=_0x29408a;if(!_0x3a5085){throw new Error(_0x9d13('0x44'));}return db[_0x9d13('0xa')][_0x9d13('0xb')]({'attributes':['id',_0x9d13('0x45')]});})[_0x9d13('0xe')](function(_0x30f3c4){return checkPasswordPattern(_0x30f3c4,_0x4c4dc4[_0x9d13('0x36')]['password'],_0x30f3c4[_0x9d13('0x45')]);})[_0x9d13('0xe')](function(){_0x3a5085[_0x9d13('0x46')]=_0x4c4dc4['body'][_0x9d13('0x46')];_0x3a5085[_0x9d13('0x47')]=null;_0x3a5085[_0x9d13('0x3a')]=null;return _0x3a5085['save']();})[_0x9d13('0xe')](function(){_0x850840[_0x9d13('0x2c')](0xc8)[_0x9d13('0x2d')]({'message':_0x9d13('0x48')});})[_0x9d13('0x1b')](function(_0x4c27e4){return handleError(_0x850840,0x1f4,_0x4c27e4);});};passport[_0x9d13('0x49')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x631cae,_0x6e5de5,_0x3bd1e8){return localAuthenticate(db['User'],_0x631cae,_0x6e5de5,_0x3bd1e8);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index f45f21b..fccdce4 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 _0xb394=['express','Router','./authLocal.controller','post','login','/forgot','forgot','reset','exports'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xb394,0x1c2));var _0x4b39=function(_0x31b650,_0x117caf){_0x31b650=_0x31b650-0x0;var _0x3fcf7b=_0xb394[_0x31b650];return _0x3fcf7b;};'use strict';var express=require(_0x4b39('0x0'));var router=express[_0x4b39('0x1')]();var controller=require(_0x4b39('0x2'));router[_0x4b39('0x3')]('/',controller[_0x4b39('0x4')]);router['post'](_0x4b39('0x5'),controller[_0x4b39('0x6')]);router[_0x4b39('0x3')]('/reset/:token',controller[_0x4b39('0x7')]);module[_0x4b39('0x8')]=router; \ No newline at end of file +var _0x16dc=['/reset/:token','reset','exports','express','Router','post','login','/forgot','forgot'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x16dc,0x162));var _0xc16d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16dc[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0xc16d('0x0'));var router=express[_0xc16d('0x1')]();var controller=require('./authLocal.controller');router[_0xc16d('0x2')]('/',controller[_0xc16d('0x3')]);router[_0xc16d('0x2')](_0xc16d('0x4'),controller[_0xc16d('0x5')]);router['post'](_0xc16d('0x6'),controller[_0xc16d('0x7')]);module[_0xc16d('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 690c7cb..c2b3b48 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 _0x24d4=['exports','STRING','sequelize'];(function(_0x33cf18,_0x21aee4){var _0x53f9a4=function(_0x37b64b){while(--_0x37b64b){_0x33cf18['push'](_0x33cf18['shift']());}};_0x53f9a4(++_0x21aee4);}(_0x24d4,0xe0));var _0x424d=function(_0x2ec7f2,_0xe24da3){_0x2ec7f2=_0x2ec7f2-0x0;var _0x29de00=_0x24d4[_0x2ec7f2];return _0x29de00;};'use strict';var Sequelize=require(_0x424d('0x0'));module[_0x424d('0x1')]={'name':{'type':Sequelize[_0x424d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x424d('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xe41e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x20c383,_0x43a3b5){var _0x3bdcbf=function(_0x29e802){while(--_0x29e802){_0x20c383['push'](_0x20c383['shift']());}};_0x3bdcbf(++_0x43a3b5);}(_0xe41e,0x79));var _0xee41=function(_0x174daa,_0x403d55){_0x174daa=_0x174daa-0x0;var _0x56335d=_0xe41e[_0x174daa];return _0x56335d;};'use strict';var Sequelize=require(_0xee41('0x0'));module[_0xee41('0x1')]={'name':{'type':Sequelize[_0xee41('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xee41('0x2')]},'description':{'type':Sequelize[_0xee41('0x2')]},'status':{'type':Sequelize[_0xee41('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 528a9d1..84bf31a 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 _0x23fd=['body','find','addConditions','ids','getConditions','findOne','Condition','addActions','Action','omit','getActions','eml-format','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','destroy','then','error','stack','name','send','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','create'];(function(_0x37a72a,_0x103af7){var _0x18b6ba=function(_0x52c4f1){while(--_0x52c4f1){_0x37a72a['push'](_0x37a72a['shift']());}};_0x18b6ba(++_0x103af7);}(_0x23fd,0xa9));var _0xd23f=function(_0x151e0b,_0x3bec86){_0x151e0b=_0x151e0b-0x0;var _0x5d4a5c=_0x23fd[_0x151e0b];return _0x5d4a5c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd23f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd23f('0x1'));var jsonpatch=require(_0xd23f('0x2'));var rp=require(_0xd23f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd23f('0x4'));var sox=require(_0xd23f('0x5'));var csv=require(_0xd23f('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd23f('0x7'));var squel=require('squel');var crypto=require(_0xd23f('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd23f('0x9'));var toCsv=require(_0xd23f('0x6'));var querystring=require(_0xd23f('0xa'));var Papa=require('papaparse');var Redis=require(_0xd23f('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xd23f('0xc'));var as=require(_0xd23f('0xd'));var hardwareService=require(_0xd23f('0xe'));var logger=require(_0xd23f('0xf'))(_0xd23f('0x10'));var utils=require(_0xd23f('0x11'));var config=require(_0xd23f('0x12'));var db=require(_0xd23f('0x13'))['db'];function respondWithStatusCode(_0x3bc7c2,_0x309cd5){_0x309cd5=_0x309cd5||0xcc;return function(_0x5d714e){if(_0x5d714e){return _0x3bc7c2[_0xd23f('0x14')](_0x309cd5);}return _0x3bc7c2[_0xd23f('0x15')](_0x309cd5)[_0xd23f('0x16')]();};}function respondWithResult(_0x4c9385,_0x5e8162){_0x5e8162=_0x5e8162||0xc8;return function(_0x1f6687){if(_0x1f6687){return _0x4c9385[_0xd23f('0x15')](_0x5e8162)[_0xd23f('0x17')](_0x1f6687);}};}function respondWithFilteredResult(_0x514c0f,_0x33e445){return function(_0xb153f3){if(_0xb153f3){var _0x4f5e44=_0xb153f3[_0xd23f('0x18')],_0x7c0b8e=_0x33e445[_0xd23f('0x19')],_0x240bc7=_0x33e445['offset']+_0x33e445[_0xd23f('0x1a')],_0x139ed2;if(_0x240bc7>=_0x4f5e44){_0x240bc7=_0x4f5e44;_0x139ed2=0xc8;}else{_0x139ed2=0xce;}_0x514c0f['status'](_0x139ed2);return _0x514c0f[_0xd23f('0x1b')]('Content-Range',_0x7c0b8e+'-'+_0x240bc7+'/'+_0x4f5e44)['json'](_0xb153f3);}return null;};}function patchUpdates(_0x215c9b){return function(_0x357002){try{jsonpatch[_0xd23f('0x1c')](_0x357002,_0x215c9b,!![]);}catch(_0x537184){return BPromise[_0xd23f('0x1d')](_0x537184);}return _0x357002[_0xd23f('0x1e')]();};}function saveUpdates(_0x3bab28,_0x1a1b09){return function(_0x550bd5){if(_0x550bd5){return _0x550bd5['update'](_0x3bab28)['then'](function(_0x2278d9){return _0x2278d9;});}return null;};}function removeEntity(_0x17ec95,_0x46694e){return function(_0x5b71f1){if(_0x5b71f1){return _0x5b71f1[_0xd23f('0x1f')]()[_0xd23f('0x20')](function(){_0x17ec95[_0xd23f('0x15')](0xcc)[_0xd23f('0x16')]();});}};}function handleEntityNotFound(_0xa18f55,_0x494021){return function(_0x55d81d){if(!_0x55d81d){_0xa18f55[_0xd23f('0x14')](0x194);}return _0x55d81d;};}function handleError(_0x3d64ec,_0x701da0){_0x701da0=_0x701da0||0x1f4;return function(_0x3a4bd8){logger[_0xd23f('0x21')](_0x3a4bd8[_0xd23f('0x22')]);if(_0x3a4bd8[_0xd23f('0x23')]){delete _0x3a4bd8[_0xd23f('0x23')];}_0x3d64ec[_0xd23f('0x15')](_0x701da0)[_0xd23f('0x24')](_0x3a4bd8);};}exports['index']=function(_0x40ea5e,_0x31f0e8){var _0x4ffa36={},_0x40fb49={},_0x372103={'count':0x0,'rows':[]};var _0x5c1d3f=_['map'](db[_0xd23f('0x25')][_0xd23f('0x26')],function(_0x7366af){return{'name':_0x7366af[_0xd23f('0x27')],'type':_0x7366af[_0xd23f('0x28')][_0xd23f('0x29')]};});_0x40fb49['model']=_[_0xd23f('0x2a')](_0x5c1d3f,'name');_0x40fb49[_0xd23f('0x2b')]=_[_0xd23f('0x2c')](_0x40ea5e[_0xd23f('0x2b')]);_0x40fb49[_0xd23f('0x2d')]=_[_0xd23f('0x2e')](_0x40fb49[_0xd23f('0x2f')],_0x40fb49['query']);_0x4ffa36[_0xd23f('0x30')]=_[_0xd23f('0x2e')](_0x40fb49['model'],qs['fields'](_0x40ea5e[_0xd23f('0x2b')][_0xd23f('0x31')]));_0x4ffa36['attributes']=_0x4ffa36[_0xd23f('0x30')][_0xd23f('0x32')]?_0x4ffa36[_0xd23f('0x30')]:_0x40fb49['model'];if(!_0x40ea5e[_0xd23f('0x2b')][_0xd23f('0x33')](_0xd23f('0x34'))){_0x4ffa36[_0xd23f('0x1a')]=qs[_0xd23f('0x1a')](_0x40ea5e[_0xd23f('0x2b')]['limit']);_0x4ffa36[_0xd23f('0x19')]=qs[_0xd23f('0x19')](_0x40ea5e[_0xd23f('0x2b')][_0xd23f('0x19')]);}_0x4ffa36[_0xd23f('0x35')]=qs[_0xd23f('0x36')](_0x40ea5e['query']['sort']);_0x4ffa36[_0xd23f('0x37')]=qs[_0xd23f('0x2d')](_[_0xd23f('0x38')](_0x40ea5e['query'],_0x40fb49[_0xd23f('0x2d')]));if(_0x40ea5e[_0xd23f('0x2b')][_0xd23f('0x39')]){_0x4ffa36[_0xd23f('0x37')]=_['merge'](_0x4ffa36[_0xd23f('0x37')],{'$or':_[_0xd23f('0x2a')](_0x5c1d3f,function(_0x2cb626){if(_0x2cb626[_0xd23f('0x28')]!==_0xd23f('0x3a')){var _0x5ad079={};_0x5ad079[_0x2cb626['name']]={'$like':'%'+_0x40ea5e['query'][_0xd23f('0x39')]+'%'};return _0x5ad079;}})});}_0x4ffa36=_[_0xd23f('0x3b')]({},_0x4ffa36,_0x40ea5e['options']);var _0x16e602={'where':_0x4ffa36[_0xd23f('0x37')]};return db['Automation'][_0xd23f('0x18')](_0x16e602)['then'](function(_0x3a6cbe){_0x372103['count']=_0x3a6cbe;if(_0x40ea5e[_0xd23f('0x2b')][_0xd23f('0x3c')]){_0x4ffa36[_0xd23f('0x3d')]=[{'all':!![]}];}return db[_0xd23f('0x25')][_0xd23f('0x3e')](_0x4ffa36);})['then'](function(_0x84d38c){_0x372103[_0xd23f('0x3f')]=_0x84d38c;return _0x372103;})[_0xd23f('0x20')](respondWithFilteredResult(_0x31f0e8,_0x4ffa36))[_0xd23f('0x40')](handleError(_0x31f0e8,null));};exports['show']=function(_0x4ce558,_0x2c2b9b){var _0x451b8a={'raw':![],'where':{'id':_0x4ce558[_0xd23f('0x41')]['id']}},_0x5071b4={};_0x5071b4['model']=_[_0xd23f('0x2c')](db['Automation'][_0xd23f('0x26')]);_0x5071b4[_0xd23f('0x2b')]=_['keys'](_0x4ce558['query']);_0x5071b4[_0xd23f('0x2d')]=_['intersection'](_0x5071b4['model'],_0x5071b4[_0xd23f('0x2b')]);_0x451b8a['attributes']=_[_0xd23f('0x2e')](_0x5071b4[_0xd23f('0x2f')],qs['fields'](_0x4ce558[_0xd23f('0x2b')][_0xd23f('0x31')]));_0x451b8a[_0xd23f('0x30')]=_0x451b8a[_0xd23f('0x30')]['length']?_0x451b8a[_0xd23f('0x30')]:_0x5071b4[_0xd23f('0x2f')];if(_0x4ce558[_0xd23f('0x2b')][_0xd23f('0x3c')]){_0x451b8a[_0xd23f('0x3d')]=[{'all':!![]}];}_0x451b8a=_['merge']({},_0x451b8a,_0x4ce558[_0xd23f('0x42')]);return db['Automation']['find'](_0x451b8a)[_0xd23f('0x20')](handleEntityNotFound(_0x2c2b9b,null))[_0xd23f('0x20')](respondWithResult(_0x2c2b9b,null))[_0xd23f('0x40')](handleError(_0x2c2b9b,null));};exports[_0xd23f('0x43')]=function(_0x1c55fa,_0x56b3bb){return db['Automation'][_0xd23f('0x43')](_0x1c55fa[_0xd23f('0x44')],{})[_0xd23f('0x20')](respondWithResult(_0x56b3bb,0xc9))[_0xd23f('0x40')](handleError(_0x56b3bb,null));};exports['update']=function(_0x2f2396,_0x218810){if(_0x2f2396[_0xd23f('0x44')]['id']){delete _0x2f2396[_0xd23f('0x44')]['id'];}return db[_0xd23f('0x25')][_0xd23f('0x45')]({'where':{'id':_0x2f2396[_0xd23f('0x41')]['id']}})[_0xd23f('0x20')](handleEntityNotFound(_0x218810,null))[_0xd23f('0x20')](saveUpdates(_0x2f2396[_0xd23f('0x44')],null))[_0xd23f('0x20')](respondWithResult(_0x218810,null))[_0xd23f('0x40')](handleError(_0x218810,null));};exports[_0xd23f('0x1f')]=function(_0x4e3ca5,_0x505429){return db[_0xd23f('0x25')]['find']({'where':{'id':_0x4e3ca5[_0xd23f('0x41')]['id']}})[_0xd23f('0x20')](handleEntityNotFound(_0x505429,null))['then'](removeEntity(_0x505429,null))[_0xd23f('0x40')](handleError(_0x505429,null));};exports['addConditions']=function(_0x4a0f89,_0x489ca2,_0x36dcb4){return db['Condition']['find']({'where':{'id':_0x4a0f89[_0xd23f('0x41')]['id']}})[_0xd23f('0x20')](handleEntityNotFound(_0x489ca2,null))[_0xd23f('0x20')](function(_0x5f2e61){if(_0x5f2e61){return _0x5f2e61[_0xd23f('0x46')](_0x4a0f89[_0xd23f('0x44')][_0xd23f('0x47')],_['omit'](_0x4a0f89[_0xd23f('0x44')],[_0xd23f('0x47'),'id'])||{});}})[_0xd23f('0x20')](respondWithResult(_0x489ca2,null))[_0xd23f('0x40')](handleError(_0x489ca2,null));};exports[_0xd23f('0x48')]=function(_0xbba187,_0x28da99,_0x23e7d7){var _0x3efd64={};var _0x10c1ef={};var _0x44d17d;var _0x535d42;return db[_0xd23f('0x25')][_0xd23f('0x49')]({'where':{'id':_0xbba187['params']['id']}})[_0xd23f('0x20')](handleEntityNotFound(_0x28da99,null))['then'](function(_0x1eedca){if(_0x1eedca){_0x44d17d=_0x1eedca;_0x10c1ef[_0xd23f('0x2f')]=_['keys'](db[_0xd23f('0x4a')][_0xd23f('0x26')]);_0x10c1ef[_0xd23f('0x2b')]=_['keys'](_0xbba187['query']);_0x10c1ef[_0xd23f('0x2d')]=_[_0xd23f('0x2e')](_0x10c1ef['model'],_0x10c1ef[_0xd23f('0x2b')]);_0x3efd64[_0xd23f('0x30')]=_[_0xd23f('0x2e')](_0x10c1ef[_0xd23f('0x2f')],qs[_0xd23f('0x31')](_0xbba187[_0xd23f('0x2b')][_0xd23f('0x31')]));_0x3efd64[_0xd23f('0x30')]=_0x3efd64[_0xd23f('0x30')][_0xd23f('0x32')]?_0x3efd64[_0xd23f('0x30')]:_0x10c1ef['model'];_0x3efd64[_0xd23f('0x35')]=qs[_0xd23f('0x36')](_0xbba187[_0xd23f('0x2b')][_0xd23f('0x36')]);_0x3efd64[_0xd23f('0x37')]=qs[_0xd23f('0x2d')](_[_0xd23f('0x38')](_0xbba187[_0xd23f('0x2b')],_0x10c1ef[_0xd23f('0x2d')]));if(_0xbba187[_0xd23f('0x2b')][_0xd23f('0x39')]){_0x3efd64['where']=_[_0xd23f('0x3b')](_0x3efd64['where'],{'$or':_['map'](_0x3efd64[_0xd23f('0x30')],function(_0x212401){var _0x961fae={};_0x961fae[_0x212401]={'$like':'%'+_0xbba187[_0xd23f('0x2b')][_0xd23f('0x39')]+'%'};return _0x961fae;})});}_0x3efd64=_[_0xd23f('0x3b')]({},_0x3efd64,_0xbba187[_0xd23f('0x42')]);return _0x44d17d[_0xd23f('0x48')](_0x3efd64);}})[_0xd23f('0x20')](function(_0x35df14){if(_0x35df14){_0x535d42=_0x35df14[_0xd23f('0x32')];if(!_0xbba187[_0xd23f('0x2b')][_0xd23f('0x33')]('nolimit')){_0x3efd64[_0xd23f('0x1a')]=qs[_0xd23f('0x1a')](_0xbba187[_0xd23f('0x2b')][_0xd23f('0x1a')]);_0x3efd64[_0xd23f('0x19')]=qs[_0xd23f('0x19')](_0xbba187['query'][_0xd23f('0x19')]);}return _0x44d17d['getConditions'](_0x3efd64);}})[_0xd23f('0x20')](function(_0x3529fd){if(_0x3529fd){return _0x3529fd?{'count':_0x535d42,'rows':_0x3529fd}:null;}})['then'](respondWithResult(_0x28da99,null))[_0xd23f('0x40')](handleError(_0x28da99,null));};exports[_0xd23f('0x4b')]=function(_0x211994,_0x3da843,_0x13fdda){return db[_0xd23f('0x4c')]['find']({'where':{'id':_0x211994['params']['id']}})[_0xd23f('0x20')](handleEntityNotFound(_0x3da843,null))[_0xd23f('0x20')](function(_0x51407e){if(_0x51407e){return _0x51407e[_0xd23f('0x4b')](_0x211994[_0xd23f('0x44')][_0xd23f('0x47')],_[_0xd23f('0x4d')](_0x211994[_0xd23f('0x44')],[_0xd23f('0x47'),'id'])||{});}})['then'](respondWithResult(_0x3da843,null))[_0xd23f('0x40')](handleError(_0x3da843,null));};exports[_0xd23f('0x4e')]=function(_0x59a22a,_0x275b9a,_0x20d0bf){var _0x134561={};var _0x2d236b={};var _0x2291d8;var _0x3c515d;return db[_0xd23f('0x25')][_0xd23f('0x49')]({'where':{'id':_0x59a22a[_0xd23f('0x41')]['id']}})['then'](handleEntityNotFound(_0x275b9a,null))['then'](function(_0x540ffa){if(_0x540ffa){_0x2291d8=_0x540ffa;_0x2d236b[_0xd23f('0x2f')]=_['keys'](db[_0xd23f('0x4c')][_0xd23f('0x26')]);_0x2d236b['query']=_[_0xd23f('0x2c')](_0x59a22a[_0xd23f('0x2b')]);_0x2d236b[_0xd23f('0x2d')]=_['intersection'](_0x2d236b[_0xd23f('0x2f')],_0x2d236b[_0xd23f('0x2b')]);_0x134561[_0xd23f('0x30')]=_[_0xd23f('0x2e')](_0x2d236b[_0xd23f('0x2f')],qs[_0xd23f('0x31')](_0x59a22a[_0xd23f('0x2b')][_0xd23f('0x31')]));_0x134561['attributes']=_0x134561[_0xd23f('0x30')][_0xd23f('0x32')]?_0x134561[_0xd23f('0x30')]:_0x2d236b[_0xd23f('0x2f')];_0x134561[_0xd23f('0x35')]=qs[_0xd23f('0x36')](_0x59a22a[_0xd23f('0x2b')][_0xd23f('0x36')]);_0x134561['where']=qs['filters'](_[_0xd23f('0x38')](_0x59a22a[_0xd23f('0x2b')],_0x2d236b[_0xd23f('0x2d')]));if(_0x59a22a[_0xd23f('0x2b')][_0xd23f('0x39')]){_0x134561[_0xd23f('0x37')]=_[_0xd23f('0x3b')](_0x134561[_0xd23f('0x37')],{'$or':_[_0xd23f('0x2a')](_0x134561[_0xd23f('0x30')],function(_0x2f065e){var _0x2be0ad={};_0x2be0ad[_0x2f065e]={'$like':'%'+_0x59a22a[_0xd23f('0x2b')][_0xd23f('0x39')]+'%'};return _0x2be0ad;})});}_0x134561=_[_0xd23f('0x3b')]({},_0x134561,_0x59a22a[_0xd23f('0x42')]);return _0x2291d8['getActions'](_0x134561);}})[_0xd23f('0x20')](function(_0x4cbf72){if(_0x4cbf72){_0x3c515d=_0x4cbf72[_0xd23f('0x32')];if(!_0x59a22a['query'][_0xd23f('0x33')]('nolimit')){_0x134561[_0xd23f('0x1a')]=qs['limit'](_0x59a22a[_0xd23f('0x2b')]['limit']);_0x134561[_0xd23f('0x19')]=qs[_0xd23f('0x19')](_0x59a22a[_0xd23f('0x2b')][_0xd23f('0x19')]);}return _0x2291d8[_0xd23f('0x4e')](_0x134561);}})[_0xd23f('0x20')](function(_0x15e2ea){if(_0x15e2ea){return _0x15e2ea?{'count':_0x3c515d,'rows':_0x15e2ea}:null;}})['then'](respondWithResult(_0x275b9a,null))[_0xd23f('0x40')](handleError(_0x275b9a,null));}; \ No newline at end of file +var _0x451e=['status','end','json','offset','limit','set','Content-Range','reject','save','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','options','find','create','update','body','destroy','addConditions','Condition','ids','omit','getConditions','length','addActions','getActions','findOne','Action','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x4aea1b,_0x4acd69){var _0x25dc9e=function(_0x3aea7a){while(--_0x3aea7a){_0x4aea1b['push'](_0x4aea1b['shift']());}};_0x25dc9e(++_0x4acd69);}(_0x451e,0xe4));var _0xe451=function(_0x1d04fe,_0x19fb9e){_0x1d04fe=_0x1d04fe-0x0;var _0x59be04=_0x451e[_0x1d04fe];return _0x59be04;};'use strict';var pdf=require(_0xe451('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe451('0x1'));var zipdir=require(_0xe451('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe451('0x3'));var moment=require(_0xe451('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe451('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe451('0x6'));var ejs=require(_0xe451('0x7'));var fs=require('fs');var _=require(_0xe451('0x8'));var squel=require(_0xe451('0x9'));var crypto=require(_0xe451('0xa'));var jsforce=require(_0xe451('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe451('0x6'));var querystring=require(_0xe451('0xc'));var Papa=require(_0xe451('0xd'));var Redis=require(_0xe451('0xe'));var authService=require(_0xe451('0xf'));var qs=require(_0xe451('0x10'));var as=require(_0xe451('0x11'));var hardwareService=require(_0xe451('0x12'));var logger=require('../../config/logger')(_0xe451('0x13'));var utils=require(_0xe451('0x14'));var config=require(_0xe451('0x15'));var db=require(_0xe451('0x16'))['db'];function respondWithStatusCode(_0x38e9ba,_0xff4e6){_0xff4e6=_0xff4e6||0xcc;return function(_0x116b16){if(_0x116b16){return _0x38e9ba[_0xe451('0x17')](_0xff4e6);}return _0x38e9ba[_0xe451('0x18')](_0xff4e6)[_0xe451('0x19')]();};}function respondWithResult(_0x3a892b,_0x4df162){_0x4df162=_0x4df162||0xc8;return function(_0x316e05){if(_0x316e05){return _0x3a892b['status'](_0x4df162)[_0xe451('0x1a')](_0x316e05);}};}function respondWithFilteredResult(_0x4fc570,_0x38afe7){return function(_0x25b116){if(_0x25b116){var _0x409b8e=_0x25b116['count'],_0x19d82f=_0x38afe7[_0xe451('0x1b')],_0x421d8d=_0x38afe7[_0xe451('0x1b')]+_0x38afe7[_0xe451('0x1c')],_0x436350;if(_0x421d8d>=_0x409b8e){_0x421d8d=_0x409b8e;_0x436350=0xc8;}else{_0x436350=0xce;}_0x4fc570[_0xe451('0x18')](_0x436350);return _0x4fc570[_0xe451('0x1d')](_0xe451('0x1e'),_0x19d82f+'-'+_0x421d8d+'/'+_0x409b8e)[_0xe451('0x1a')](_0x25b116);}return null;};}function patchUpdates(_0x514a45){return function(_0x166429){try{jsonpatch['apply'](_0x166429,_0x514a45,!![]);}catch(_0x50c674){return BPromise[_0xe451('0x1f')](_0x50c674);}return _0x166429[_0xe451('0x20')]();};}function saveUpdates(_0x567fce,_0x5e14ac){return function(_0xbcab64){if(_0xbcab64){return _0xbcab64['update'](_0x567fce)[_0xe451('0x21')](function(_0x4fe873){return _0x4fe873;});}return null;};}function removeEntity(_0x553958,_0xfc527c){return function(_0x166c53){if(_0x166c53){return _0x166c53['destroy']()[_0xe451('0x21')](function(){_0x553958['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18df0c,_0x5c3182){return function(_0x934979){if(!_0x934979){_0x18df0c['sendStatus'](0x194);}return _0x934979;};}function handleError(_0x4f3061,_0x321de0){_0x321de0=_0x321de0||0x1f4;return function(_0x2cf4cb){logger[_0xe451('0x22')](_0x2cf4cb[_0xe451('0x23')]);if(_0x2cf4cb[_0xe451('0x24')]){delete _0x2cf4cb[_0xe451('0x24')];}_0x4f3061[_0xe451('0x18')](_0x321de0)[_0xe451('0x25')](_0x2cf4cb);};}exports[_0xe451('0x26')]=function(_0x452aae,_0x3807eb){var _0x419abe={},_0x41c6b6={},_0x4da42d={'count':0x0,'rows':[]};var _0x4bca04=_[_0xe451('0x27')](db[_0xe451('0x28')][_0xe451('0x29')],function(_0x56e62d){return{'name':_0x56e62d[_0xe451('0x2a')],'type':_0x56e62d[_0xe451('0x2b')][_0xe451('0x2c')]};});_0x41c6b6[_0xe451('0x2d')]=_[_0xe451('0x27')](_0x4bca04,_0xe451('0x24'));_0x41c6b6[_0xe451('0x2e')]=_[_0xe451('0x2f')](_0x452aae[_0xe451('0x2e')]);_0x41c6b6[_0xe451('0x30')]=_[_0xe451('0x31')](_0x41c6b6[_0xe451('0x2d')],_0x41c6b6[_0xe451('0x2e')]);_0x419abe[_0xe451('0x32')]=_[_0xe451('0x31')](_0x41c6b6[_0xe451('0x2d')],qs[_0xe451('0x33')](_0x452aae['query'][_0xe451('0x33')]));_0x419abe[_0xe451('0x32')]=_0x419abe['attributes']['length']?_0x419abe[_0xe451('0x32')]:_0x41c6b6[_0xe451('0x2d')];if(!_0x452aae[_0xe451('0x2e')][_0xe451('0x34')](_0xe451('0x35'))){_0x419abe['limit']=qs[_0xe451('0x1c')](_0x452aae['query'][_0xe451('0x1c')]);_0x419abe[_0xe451('0x1b')]=qs['offset'](_0x452aae[_0xe451('0x2e')][_0xe451('0x1b')]);}_0x419abe[_0xe451('0x36')]=qs[_0xe451('0x37')](_0x452aae[_0xe451('0x2e')][_0xe451('0x37')]);_0x419abe[_0xe451('0x38')]=qs[_0xe451('0x30')](_[_0xe451('0x39')](_0x452aae[_0xe451('0x2e')],_0x41c6b6['filters']));if(_0x452aae[_0xe451('0x2e')][_0xe451('0x3a')]){_0x419abe['where']=_[_0xe451('0x3b')](_0x419abe['where'],{'$or':_['map'](_0x4bca04,function(_0x275198){if(_0x275198[_0xe451('0x2b')]!==_0xe451('0x3c')){var _0x3a45d7={};_0x3a45d7[_0x275198[_0xe451('0x24')]]={'$like':'%'+_0x452aae[_0xe451('0x2e')][_0xe451('0x3a')]+'%'};return _0x3a45d7;}})});}_0x419abe=_['merge']({},_0x419abe,_0x452aae['options']);var _0x53e70a={'where':_0x419abe[_0xe451('0x38')]};return db[_0xe451('0x28')][_0xe451('0x3d')](_0x53e70a)[_0xe451('0x21')](function(_0x2bfb09){_0x4da42d[_0xe451('0x3d')]=_0x2bfb09;if(_0x452aae[_0xe451('0x2e')][_0xe451('0x3e')]){_0x419abe[_0xe451('0x3f')]=[{'all':!![]}];}return db[_0xe451('0x28')][_0xe451('0x40')](_0x419abe);})[_0xe451('0x21')](function(_0x367eb4){_0x4da42d[_0xe451('0x41')]=_0x367eb4;return _0x4da42d;})['then'](respondWithFilteredResult(_0x3807eb,_0x419abe))[_0xe451('0x42')](handleError(_0x3807eb,null));};exports['show']=function(_0x1093de,_0x5bdd01){var _0x31755d={'raw':![],'where':{'id':_0x1093de[_0xe451('0x43')]['id']}},_0x7ebaa2={};_0x7ebaa2['model']=_[_0xe451('0x2f')](db['Automation']['rawAttributes']);_0x7ebaa2['query']=_[_0xe451('0x2f')](_0x1093de[_0xe451('0x2e')]);_0x7ebaa2[_0xe451('0x30')]=_[_0xe451('0x31')](_0x7ebaa2[_0xe451('0x2d')],_0x7ebaa2['query']);_0x31755d[_0xe451('0x32')]=_[_0xe451('0x31')](_0x7ebaa2[_0xe451('0x2d')],qs[_0xe451('0x33')](_0x1093de[_0xe451('0x2e')]['fields']));_0x31755d[_0xe451('0x32')]=_0x31755d[_0xe451('0x32')]['length']?_0x31755d[_0xe451('0x32')]:_0x7ebaa2[_0xe451('0x2d')];if(_0x1093de[_0xe451('0x2e')][_0xe451('0x3e')]){_0x31755d[_0xe451('0x3f')]=[{'all':!![]}];}_0x31755d=_[_0xe451('0x3b')]({},_0x31755d,_0x1093de[_0xe451('0x44')]);return db[_0xe451('0x28')][_0xe451('0x45')](_0x31755d)[_0xe451('0x21')](handleEntityNotFound(_0x5bdd01,null))['then'](respondWithResult(_0x5bdd01,null))[_0xe451('0x42')](handleError(_0x5bdd01,null));};exports[_0xe451('0x46')]=function(_0x3e3381,_0x22a75b){return db[_0xe451('0x28')][_0xe451('0x46')](_0x3e3381['body'],{})['then'](respondWithResult(_0x22a75b,0xc9))[_0xe451('0x42')](handleError(_0x22a75b,null));};exports[_0xe451('0x47')]=function(_0x9bd109,_0x11b322){if(_0x9bd109[_0xe451('0x48')]['id']){delete _0x9bd109['body']['id'];}return db[_0xe451('0x28')][_0xe451('0x45')]({'where':{'id':_0x9bd109['params']['id']}})[_0xe451('0x21')](handleEntityNotFound(_0x11b322,null))['then'](saveUpdates(_0x9bd109['body'],null))[_0xe451('0x21')](respondWithResult(_0x11b322,null))[_0xe451('0x42')](handleError(_0x11b322,null));};exports[_0xe451('0x49')]=function(_0x264e39,_0x8e2947){return db['Automation'][_0xe451('0x45')]({'where':{'id':_0x264e39[_0xe451('0x43')]['id']}})[_0xe451('0x21')](handleEntityNotFound(_0x8e2947,null))[_0xe451('0x21')](removeEntity(_0x8e2947,null))[_0xe451('0x42')](handleError(_0x8e2947,null));};exports[_0xe451('0x4a')]=function(_0x726bd6,_0x4a2461,_0x272714){return db[_0xe451('0x4b')][_0xe451('0x45')]({'where':{'id':_0x726bd6[_0xe451('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a2461,null))[_0xe451('0x21')](function(_0xe7552){if(_0xe7552){return _0xe7552[_0xe451('0x4a')](_0x726bd6[_0xe451('0x48')][_0xe451('0x4c')],_[_0xe451('0x4d')](_0x726bd6[_0xe451('0x48')],[_0xe451('0x4c'),'id'])||{});}})[_0xe451('0x21')](respondWithResult(_0x4a2461,null))['catch'](handleError(_0x4a2461,null));};exports[_0xe451('0x4e')]=function(_0x349437,_0x4d1ccc,_0x51aabe){var _0x3ad873={};var _0x119674={};var _0x3632fd;var _0x5e4ad2;return db[_0xe451('0x28')]['findOne']({'where':{'id':_0x349437[_0xe451('0x43')]['id']}})[_0xe451('0x21')](handleEntityNotFound(_0x4d1ccc,null))[_0xe451('0x21')](function(_0x1476e6){if(_0x1476e6){_0x3632fd=_0x1476e6;_0x119674[_0xe451('0x2d')]=_[_0xe451('0x2f')](db[_0xe451('0x4b')][_0xe451('0x29')]);_0x119674['query']=_[_0xe451('0x2f')](_0x349437[_0xe451('0x2e')]);_0x119674[_0xe451('0x30')]=_['intersection'](_0x119674[_0xe451('0x2d')],_0x119674[_0xe451('0x2e')]);_0x3ad873[_0xe451('0x32')]=_[_0xe451('0x31')](_0x119674[_0xe451('0x2d')],qs[_0xe451('0x33')](_0x349437[_0xe451('0x2e')][_0xe451('0x33')]));_0x3ad873[_0xe451('0x32')]=_0x3ad873[_0xe451('0x32')][_0xe451('0x4f')]?_0x3ad873['attributes']:_0x119674[_0xe451('0x2d')];_0x3ad873['order']=qs[_0xe451('0x37')](_0x349437[_0xe451('0x2e')][_0xe451('0x37')]);_0x3ad873[_0xe451('0x38')]=qs[_0xe451('0x30')](_['pick'](_0x349437['query'],_0x119674['filters']));if(_0x349437[_0xe451('0x2e')][_0xe451('0x3a')]){_0x3ad873[_0xe451('0x38')]=_[_0xe451('0x3b')](_0x3ad873[_0xe451('0x38')],{'$or':_[_0xe451('0x27')](_0x3ad873['attributes'],function(_0x4541b2){var _0x1c15e8={};_0x1c15e8[_0x4541b2]={'$like':'%'+_0x349437[_0xe451('0x2e')]['filter']+'%'};return _0x1c15e8;})});}_0x3ad873=_[_0xe451('0x3b')]({},_0x3ad873,_0x349437[_0xe451('0x44')]);return _0x3632fd[_0xe451('0x4e')](_0x3ad873);}})[_0xe451('0x21')](function(_0x4acd66){if(_0x4acd66){_0x5e4ad2=_0x4acd66[_0xe451('0x4f')];if(!_0x349437['query']['hasOwnProperty']('nolimit')){_0x3ad873[_0xe451('0x1c')]=qs[_0xe451('0x1c')](_0x349437[_0xe451('0x2e')][_0xe451('0x1c')]);_0x3ad873[_0xe451('0x1b')]=qs[_0xe451('0x1b')](_0x349437[_0xe451('0x2e')][_0xe451('0x1b')]);}return _0x3632fd[_0xe451('0x4e')](_0x3ad873);}})[_0xe451('0x21')](function(_0x6d5912){if(_0x6d5912){return _0x6d5912?{'count':_0x5e4ad2,'rows':_0x6d5912}:null;}})[_0xe451('0x21')](respondWithResult(_0x4d1ccc,null))[_0xe451('0x42')](handleError(_0x4d1ccc,null));};exports[_0xe451('0x50')]=function(_0x508cc6,_0x1d07a1,_0x318068){return db['Action']['find']({'where':{'id':_0x508cc6[_0xe451('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d07a1,null))[_0xe451('0x21')](function(_0x2f0627){if(_0x2f0627){return _0x2f0627['addActions'](_0x508cc6[_0xe451('0x48')][_0xe451('0x4c')],_[_0xe451('0x4d')](_0x508cc6[_0xe451('0x48')],[_0xe451('0x4c'),'id'])||{});}})[_0xe451('0x21')](respondWithResult(_0x1d07a1,null))['catch'](handleError(_0x1d07a1,null));};exports[_0xe451('0x51')]=function(_0x357093,_0x1ff6c1,_0x2cca43){var _0x10b0b0={};var _0x27c548={};var _0x401273;var _0x246d09;return db['Automation'][_0xe451('0x52')]({'where':{'id':_0x357093[_0xe451('0x43')]['id']}})[_0xe451('0x21')](handleEntityNotFound(_0x1ff6c1,null))['then'](function(_0x1f951e){if(_0x1f951e){_0x401273=_0x1f951e;_0x27c548[_0xe451('0x2d')]=_['keys'](db[_0xe451('0x53')]['rawAttributes']);_0x27c548[_0xe451('0x2e')]=_[_0xe451('0x2f')](_0x357093['query']);_0x27c548[_0xe451('0x30')]=_['intersection'](_0x27c548[_0xe451('0x2d')],_0x27c548[_0xe451('0x2e')]);_0x10b0b0[_0xe451('0x32')]=_[_0xe451('0x31')](_0x27c548['model'],qs[_0xe451('0x33')](_0x357093[_0xe451('0x2e')][_0xe451('0x33')]));_0x10b0b0[_0xe451('0x32')]=_0x10b0b0[_0xe451('0x32')]['length']?_0x10b0b0['attributes']:_0x27c548['model'];_0x10b0b0['order']=qs['sort'](_0x357093['query']['sort']);_0x10b0b0[_0xe451('0x38')]=qs[_0xe451('0x30')](_['pick'](_0x357093[_0xe451('0x2e')],_0x27c548[_0xe451('0x30')]));if(_0x357093[_0xe451('0x2e')]['filter']){_0x10b0b0[_0xe451('0x38')]=_[_0xe451('0x3b')](_0x10b0b0[_0xe451('0x38')],{'$or':_[_0xe451('0x27')](_0x10b0b0[_0xe451('0x32')],function(_0x302f46){var _0x2a0dd3={};_0x2a0dd3[_0x302f46]={'$like':'%'+_0x357093[_0xe451('0x2e')][_0xe451('0x3a')]+'%'};return _0x2a0dd3;})});}_0x10b0b0=_['merge']({},_0x10b0b0,_0x357093[_0xe451('0x44')]);return _0x401273['getActions'](_0x10b0b0);}})[_0xe451('0x21')](function(_0x4a3740){if(_0x4a3740){_0x246d09=_0x4a3740['length'];if(!_0x357093[_0xe451('0x2e')][_0xe451('0x34')](_0xe451('0x35'))){_0x10b0b0['limit']=qs[_0xe451('0x1c')](_0x357093[_0xe451('0x2e')][_0xe451('0x1c')]);_0x10b0b0['offset']=qs['offset'](_0x357093['query'][_0xe451('0x1b')]);}return _0x401273[_0xe451('0x51')](_0x10b0b0);}})[_0xe451('0x21')](function(_0x19dd66){if(_0x19dd66){return _0x19dd66?{'count':_0x246d09,'rows':_0x19dd66}:null;}})[_0xe451('0x21')](respondWithResult(_0x1ff6c1,null))['catch'](handleError(_0x1ff6c1,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 6eb4947..3c0c58a 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 _0xdc5d=['exports','define','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4c60a9,_0x29931e){var _0xde880a=function(_0xd1ce03){while(--_0xd1ce03){_0x4c60a9['push'](_0x4c60a9['shift']());}};_0xde880a(++_0x29931e);}(_0xdc5d,0x14d));var _0xddc5=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0xdc5d[_0x33154d];return _0x3b2f03;};'use strict';var _=require(_0xddc5('0x0'));var util=require(_0xddc5('0x1'));var logger=require(_0xddc5('0x2'))(_0xddc5('0x3'));var moment=require(_0xddc5('0x4'));var BPromise=require(_0xddc5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddc5('0x6'));var rimraf=require(_0xddc5('0x7'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0xddc5('0x8')]=function(_0x29fb3a,_0x55edd4){return _0x29fb3a[_0xddc5('0x9')]('Automation',attributes,{'tableName':_0xddc5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43c2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x315c3f,_0xc96adf){var _0x2914e9=function(_0x308763){while(--_0x308763){_0x315c3f['push'](_0x315c3f['shift']());}};_0x2914e9(++_0xc96adf);}(_0x43c2,0x1a1));var _0x243c=function(_0x27ccd7,_0x32a16c){_0x27ccd7=_0x27ccd7-0x0;var _0x298218=_0x43c2[_0x27ccd7];return _0x298218;};'use strict';var _=require(_0x243c('0x0'));var util=require(_0x243c('0x1'));var logger=require(_0x243c('0x2'))(_0x243c('0x3'));var moment=require(_0x243c('0x4'));var BPromise=require(_0x243c('0x5'));var rp=require(_0x243c('0x6'));var fs=require('fs');var path=require(_0x243c('0x7'));var rimraf=require(_0x243c('0x8'));var config=require(_0x243c('0x9'));var attributes=require(_0x243c('0xa'));module['exports']=function(_0x269052,_0x5a4632){return _0x269052[_0x243c('0xb')](_0x243c('0xc'),attributes,{'tableName':_0x243c('0xd'),'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 0992691..d7e52b2 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 _0x91e7=['then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../config/utils','client','http','request'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x91e7,0xf0));var _0x791e=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0x91e7[_0x35485a];return _0x5148e6;};'use strict';var _=require(_0x791e('0x0'));var util=require('util');var moment=require(_0x791e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x791e('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x791e('0x4')][_0x791e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2e4136,_0x10d070,_0x4da38a){return new BPromise(function(_0xb3dd0a,_0x3d2e72){return client[_0x791e('0x6')](_0x2e4136,_0x4da38a)[_0x791e('0x7')](function(_0x2a6703){logger[_0x791e('0x8')]('Automation,\x20%s,\x20%s',_0x10d070,_0x791e('0x9'));logger[_0x791e('0xa')](_0x791e('0xb'),_0x10d070,_0x791e('0x9'),JSON[_0x791e('0xc')](_0x2a6703));if(_0x2a6703['error']){if(_0x2a6703[_0x791e('0xd')][_0x791e('0xe')]===0x1f4){logger['error'](_0x791e('0xf'),_0x10d070,_0x2a6703[_0x791e('0xd')]['message']);return _0x3d2e72(_0x2a6703[_0x791e('0xd')][_0x791e('0x10')]);}logger[_0x791e('0xd')](_0x791e('0xf'),_0x10d070,_0x2a6703[_0x791e('0xd')][_0x791e('0x10')]);return _0xb3dd0a(_0x2a6703[_0x791e('0xd')][_0x791e('0x10')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x10d070,_0x791e('0x9'));_0xb3dd0a(_0x2a6703[_0x791e('0x11')][_0x791e('0x10')]);}})[_0x791e('0x12')](function(_0x316552){logger[_0x791e('0xd')](_0x791e('0xf'),_0x10d070,_0x316552);_0x3d2e72(_0x316552);});});} \ No newline at end of file +var _0x3797=['then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x2f25ec,_0x4ae9a1){var _0x4f79b4=function(_0x26ba81){while(--_0x26ba81){_0x2f25ec['push'](_0x2f25ec['shift']());}};_0x4f79b4(++_0x4ae9a1);}(_0x3797,0x1ef));var _0x7379=function(_0x54cd7e,_0x129ee6){_0x54cd7e=_0x54cd7e-0x0;var _0x2948f2=_0x3797[_0x54cd7e];return _0x2948f2;};'use strict';var _=require(_0x7379('0x0'));var util=require(_0x7379('0x1'));var moment=require(_0x7379('0x2'));var BPromise=require(_0x7379('0x3'));var rs=require(_0x7379('0x4'));var fs=require('fs');var Redis=require(_0x7379('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7379('0x6'));var logger=require('../../config/logger')(_0x7379('0x7'));var config=require(_0x7379('0x8'));var jayson=require(_0x7379('0x9'));var client=jayson['client'][_0x7379('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14cf8d,_0x1ddbd5,_0x4e8314){return new BPromise(function(_0x3492c3,_0x159c40){return client['request'](_0x14cf8d,_0x4e8314)[_0x7379('0xb')](function(_0x327dd2){logger['info'](_0x7379('0xc'),_0x1ddbd5,_0x7379('0xd'));logger[_0x7379('0xe')](_0x7379('0xf'),_0x1ddbd5,'request\x20sent',JSON[_0x7379('0x10')](_0x327dd2));if(_0x327dd2[_0x7379('0x11')]){if(_0x327dd2['error'][_0x7379('0x12')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x1ddbd5,_0x327dd2[_0x7379('0x11')]['message']);return _0x159c40(_0x327dd2['error']['message']);}logger[_0x7379('0x11')]('Automation,\x20%s,\x20%s',_0x1ddbd5,_0x327dd2[_0x7379('0x11')][_0x7379('0x13')]);return _0x3492c3(_0x327dd2[_0x7379('0x11')][_0x7379('0x13')]);}else{logger[_0x7379('0x14')](_0x7379('0xc'),_0x1ddbd5,'request\x20sent');_0x3492c3(_0x327dd2[_0x7379('0x15')][_0x7379('0x13')]);}})[_0x7379('0x16')](function(_0x1aba33){logger[_0x7379('0x11')](_0x7379('0xc'),_0x1ddbd5,_0x1aba33);_0x159c40(_0x1aba33);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 026c231..54a0e20 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 _0xf29d=['/:id/conditions','addConditions','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','show','getConditions','/:id/actions','post'];(function(_0x14d70f,_0x56b0dc){var _0xd610b4=function(_0x328157){while(--_0x328157){_0x14d70f['push'](_0x14d70f['shift']());}};_0xd610b4(++_0x56b0dc);}(_0xf29d,0xc4));var _0xdf29=function(_0x4a5325,_0x5754bb){_0x4a5325=_0x4a5325-0x0;var _0x2d1a2f=_0xf29d[_0x4a5325];return _0x2d1a2f;};'use strict';var multer=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var path=require('path');var timeout=require(_0xdf29('0x2'));var express=require(_0xdf29('0x3'));var router=express[_0xdf29('0x4')]();var auth=require(_0xdf29('0x5'));var interaction=require(_0xdf29('0x6'));var config=require('../../config/environment');var controller=require('./automation.controller');router['get']('/',auth[_0xdf29('0x7')](),controller[_0xdf29('0x8')]);router[_0xdf29('0x9')]('/:id',auth[_0xdf29('0x7')](),controller[_0xdf29('0xa')]);router[_0xdf29('0x9')]('/:id/conditions',auth[_0xdf29('0x7')](),controller[_0xdf29('0xb')]);router[_0xdf29('0x9')](_0xdf29('0xc'),auth['isAuthenticated'](),controller['getActions']);router[_0xdf29('0xd')]('/',auth[_0xdf29('0x7')](),controller['create']);router[_0xdf29('0xd')](_0xdf29('0xe'),auth[_0xdf29('0x7')](),controller[_0xdf29('0xf')]);router[_0xdf29('0xd')]('/:id/actions',auth[_0xdf29('0x7')](),controller['addActions']);router[_0xdf29('0x10')](_0xdf29('0x11'),auth[_0xdf29('0x7')](),controller['update']);router[_0xdf29('0x12')](_0xdf29('0x11'),auth['isAuthenticated'](),controller[_0xdf29('0x13')]);module[_0xdf29('0x14')]=router; \ No newline at end of file +var _0xdace=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/actions','getActions','create','post','addConditions','addActions','put','delete','exports','multer','util','path'];(function(_0xb5b74c,_0x1e0cf7){var _0x17a6bc=function(_0x2c7b91){while(--_0x2c7b91){_0xb5b74c['push'](_0xb5b74c['shift']());}};_0x17a6bc(++_0x1e0cf7);}(_0xdace,0xad));var _0xedac=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0xdace[_0x352d28];return _0x387d7e;};'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/conditions',auth[_0xedac('0xb')](),controller['getConditions']);router[_0xedac('0xa')](_0xedac('0xd'),auth['isAuthenticated'](),controller[_0xedac('0xe')]);router['post']('/',auth[_0xedac('0xb')](),controller[_0xedac('0xf')]);router[_0xedac('0x10')]('/:id/conditions',auth[_0xedac('0xb')](),controller[_0xedac('0x11')]);router[_0xedac('0x10')](_0xedac('0xd'),auth[_0xedac('0xb')](),controller[_0xedac('0x12')]);router[_0xedac('0x13')](_0xedac('0xc'),auth[_0xedac('0xb')](),controller['update']);router[_0xedac('0x14')](_0xedac('0xc'),auth[_0xedac('0xb')](),controller['destroy']);module[_0xedac('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 466482d..d35e906 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 _0x5790=['BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','ivr','STRING','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always'];(function(_0x1883c3,_0x3487c0){var _0x340c3b=function(_0xf3464e){while(--_0xf3464e){_0x1883c3['push'](_0x1883c3['shift']());}};_0x340c3b(++_0x3487c0);}(_0x5790,0x1cf));var _0x0579=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5790[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x0579('0x0'));module[_0x0579('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0579('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0579('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x0579('0x4')},'description':{'type':Sequelize[_0x0579('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0579('0x6')},'limitCalls':{'type':Sequelize[_0x0579('0x7')](0x4)[_0x0579('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0579('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0579('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0579('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0579('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0579('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0579('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0579('0x7')](0x5)[_0x0579('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0579('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x0579('0x7')](0x3)[_0x0579('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0579('0x7')](0x5)[_0x0579('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0579('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0579('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0579('0x7')](0x5)[_0x0579('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0579('0x7')](0x3)[_0x0579('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0579('0xe')},'dialTimezone':{'type':Sequelize[_0x0579('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0579('0x5')],'defaultValue':_0x0579('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x0579('0x3')]('always','never',_0x0579('0x10')),'defaultValue':_0x0579('0x11')},'dialAMDActive':{'type':Sequelize[_0x0579('0x12')],'defaultValue':0x0,'comment':_0x0579('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0579('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0579('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0579('0x7')](0x9)[_0x0579('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0579('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x0579('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0579('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0579('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0579('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0579('0x7')](0x9)[_0x0579('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0579('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0579('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0579('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0579('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0579('0x1c'),_0x0579('0x1d')),'defaultValue':_0x0579('0x1c')},'dialPrefix':{'type':Sequelize[_0x0579('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0579('0x7')](0x3)[_0x0579('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0579('0x1e')},'dialCutDigit':{'type':Sequelize[_0x0579('0x7')](0x3)[_0x0579('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0579('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0579('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0579('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0579('0x7')](0x3)[_0x0579('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0579('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0579('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0579('0x7')](0x3)[_0x0579('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0579('0x7')](0x5)[_0x0579('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0579('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x0579('0x7')](0x3)[_0x0579('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0579('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0579('0x7')](0x5)[_0x0579('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0579('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0579('0x7')](0x3)[_0x0579('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0579('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0579('0x7')](0x5)[_0x0579('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x641c=['#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x5281da,_0x112b6b){var _0x5d9390=function(_0x122664){while(--_0x122664){_0x5281da['push'](_0x5281da['shift']());}};_0x5d9390(++_0x112b6b);}(_0x641c,0x180));var _0xc641=function(_0x5267d7,_0x576a6e){_0x5267d7=_0x5267d7-0x0;var _0x583d1f=_0x641c[_0x5267d7];return _0x583d1f;};'use strict';var Sequelize=require(_0xc641('0x0'));module[_0xc641('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc641('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc641('0x3')](_0xc641('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xc641('0x5')]},'active':{'type':Sequelize[_0xc641('0x6')],'defaultValue':0x0,'comment':_0xc641('0x7')},'limitCalls':{'type':Sequelize[_0xc641('0x8')](0x4)[_0xc641('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc641('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc641('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xc641('0x8')](0x3)[_0xc641('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc641('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc641('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc641('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc641('0x8')](0x5)[_0xc641('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc641('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xc641('0x8')](0x3)[_0xc641('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc641('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc641('0x8')](0x5)[_0xc641('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc641('0x8')](0x3)[_0xc641('0x9')],'defaultValue':0x3,'comment':_0xc641('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc641('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc641('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc641('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc641('0x11')},'dialTimezone':{'type':Sequelize[_0xc641('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc641('0x5')],'defaultValue':_0xc641('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xc641('0x13'),_0xc641('0x14'),_0xc641('0x15')),'defaultValue':_0xc641('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc641('0x16')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc641('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc641('0x17')},'dialAMDGreeting':{'type':Sequelize[_0xc641('0x8')](0x9)[_0xc641('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc641('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc641('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc641('0x19')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc641('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc641('0x1a')},'dialAMDMinWordLength':{'type':Sequelize[_0xc641('0x8')](0x9)[_0xc641('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc641('0x1b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc641('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc641('0x1c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc641('0x8')](0x9)[_0xc641('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc641('0x1d')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xc641('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc641('0x1e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc641('0x8')](0x9)[_0xc641('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc641('0x1f')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc641('0x3')]('DESC',_0xc641('0x20')),'defaultValue':_0xc641('0x21')},'dialPrefix':{'type':Sequelize[_0xc641('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc641('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc641('0x22')},'dialCutDigit':{'type':Sequelize[_0xc641('0x8')](0x3)[_0xc641('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc641('0x23')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc641('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc641('0x24')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc641('0x8')](0x5)[_0xc641('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc641('0x25')},'dialDropMaxRetry':{'type':Sequelize[_0xc641('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xc641('0x8')](0x5)[_0xc641('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc641('0x26')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc641('0x27')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xc641('0x8')](0x3)[_0xc641('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc641('0x28')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc641('0x8')](0x5)[_0xc641('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc641('0x29')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc641('0x8')](0x3)[_0xc641('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc641('0x2a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc641('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc641('0x2b')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 682fc84..9eb1787 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 _0x00bb=['UserProfileResource','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','IvrCampaigns','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','findOne','CmHopper','getHopperHistories','CmHopperHistory','pick','CampaignId','getHopperFinals','CmHopperFinal','findAll','getLists','addLists','ids','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','insert','cm_hopper','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','sequelize','all','removeLists','CmList','spread','push','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','count','offset','Content-Range','apply','update','then','destroy','get'];(function(_0x160dda,_0x1f0390){var _0x58ad4b=function(_0x2b9586){while(--_0x2b9586){_0x160dda['push'](_0x160dda['shift']());}};_0x58ad4b(++_0x1f0390);}(_0x00bb,0x1d8));var _0xb00b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00bb[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0xb00b('0x0'));var emlformat=require(_0xb00b('0x1'));var rimraf=require(_0xb00b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb00b('0x3'));var rp=require('request-promise');var moment=require(_0xb00b('0x4'));var BPromise=require(_0xb00b('0x5'));var Mustache=require('mustache');var util=require(_0xb00b('0x6'));var path=require(_0xb00b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ff792,_0x2d8ddf){_0x2d8ddf=_0x2d8ddf||0xcc;return function(_0x1be8aa){if(_0x1be8aa){return _0x4ff792[_0xb00b('0x14')](_0x2d8ddf);}return _0x4ff792[_0xb00b('0x15')](_0x2d8ddf)[_0xb00b('0x16')]();};}function respondWithResult(_0x4ada81,_0x218de2){_0x218de2=_0x218de2||0xc8;return function(_0xb0d42e){if(_0xb0d42e){return _0x4ada81['status'](_0x218de2)[_0xb00b('0x17')](_0xb0d42e);}};}function respondWithFilteredResult(_0x1084a6,_0x540b79){return function(_0x5da36b){if(_0x5da36b){var _0x9b471e=_0x5da36b[_0xb00b('0x18')],_0x4dcd45=_0x540b79[_0xb00b('0x19')],_0x51d136=_0x540b79[_0xb00b('0x19')]+_0x540b79['limit'],_0x1f9c78;if(_0x51d136>=_0x9b471e){_0x51d136=_0x9b471e;_0x1f9c78=0xc8;}else{_0x1f9c78=0xce;}_0x1084a6[_0xb00b('0x15')](_0x1f9c78);return _0x1084a6['set'](_0xb00b('0x1a'),_0x4dcd45+'-'+_0x51d136+'/'+_0x9b471e)['json'](_0x5da36b);}return null;};}function patchUpdates(_0x25d7a0){return function(_0x5e8d7b){try{jsonpatch[_0xb00b('0x1b')](_0x5e8d7b,_0x25d7a0,!![]);}catch(_0x3355a3){return BPromise['reject'](_0x3355a3);}return _0x5e8d7b['save']();};}function saveUpdates(_0x2b0da1,_0x4a334b){return function(_0x1344c4){if(_0x1344c4){return _0x1344c4[_0xb00b('0x1c')](_0x2b0da1)[_0xb00b('0x1d')](function(_0x3501af){return _0x3501af;});}return null;};}function removeEntity(_0x56c189,_0x362ee0){return function(_0x4df284){if(_0x4df284){return _0x4df284[_0xb00b('0x1e')]()[_0xb00b('0x1d')](function(){var _0x51b841=_0x4df284[_0xb00b('0x1f')]({'plain':!![]});var _0x2896d1='IvrCampaigns';return db[_0xb00b('0x20')][_0xb00b('0x1e')]({'where':{'type':_0x2896d1,'resourceId':_0x51b841['id']}})['then'](function(){return _0x4df284;});})[_0xb00b('0x1d')](function(){_0x56c189[_0xb00b('0x15')](0xcc)[_0xb00b('0x16')]();});}};}function handleEntityNotFound(_0x8caadf,_0x520e55){return function(_0x50be6c){if(!_0x50be6c){_0x8caadf[_0xb00b('0x14')](0x194);}return _0x50be6c;};}function handleError(_0x490380,_0x550587){_0x550587=_0x550587||0x1f4;return function(_0x4a635e){logger[_0xb00b('0x21')](_0x4a635e[_0xb00b('0x22')]);if(_0x4a635e[_0xb00b('0x23')]){delete _0x4a635e[_0xb00b('0x23')];}_0x490380[_0xb00b('0x15')](_0x550587)[_0xb00b('0x24')](_0x4a635e);};}exports[_0xb00b('0x25')]=function(_0x4a8d2b,_0x22c22d){var _0x503c9c={},_0x450129={},_0x348165={'count':0x0,'rows':[]};var _0x5424ca=_['map'](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x16fbd5){return{'name':_0x16fbd5[_0xb00b('0x28')],'type':_0x16fbd5[_0xb00b('0x29')][_0xb00b('0x2a')]};});_0x450129[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x5424ca,_0xb00b('0x23'));_0x450129['query']=_[_0xb00b('0x2d')](_0x4a8d2b[_0xb00b('0x2e')]);_0x450129['filters']=_[_0xb00b('0x2f')](_0x450129[_0xb00b('0x2b')],_0x450129['query']);_0x503c9c[_0xb00b('0x30')]=_['intersection'](_0x450129[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x503c9c[_0xb00b('0x30')]=_0x503c9c[_0xb00b('0x30')][_0xb00b('0x32')]?_0x503c9c['attributes']:_0x450129['model'];if(!_0x4a8d2b['query'][_0xb00b('0x33')](_0xb00b('0x34'))){_0x503c9c[_0xb00b('0x35')]=qs[_0xb00b('0x35')](_0x4a8d2b['query'][_0xb00b('0x35')]);_0x503c9c[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x19')]);}_0x503c9c[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0x4a8d2b[_0xb00b('0x2e')]['sort']);_0x503c9c['where']=qs[_0xb00b('0x38')](_['pick'](_0x4a8d2b[_0xb00b('0x2e')],_0x450129[_0xb00b('0x38')]));if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x39')]){_0x503c9c[_0xb00b('0x3a')]=_[_0xb00b('0x3b')](_0x503c9c[_0xb00b('0x3a')],{'$or':_['map'](_0x5424ca,function(_0x35f1ca){if(_0x35f1ca[_0xb00b('0x29')]!==_0xb00b('0x3c')){var _0xd9c03f={};_0xd9c03f[_0x35f1ca[_0xb00b('0x23')]]={'$like':'%'+_0x4a8d2b[_0xb00b('0x2e')]['filter']+'%'};return _0xd9c03f;}})});}_0x503c9c=_[_0xb00b('0x3b')]({},_0x503c9c,_0x4a8d2b[_0xb00b('0x3d')]);var _0x4801e7={'where':_0x503c9c[_0xb00b('0x3a')]};return db[_0xb00b('0x26')][_0xb00b('0x18')](_0x4801e7)[_0xb00b('0x1d')](function(_0x2954e8){_0x348165['count']=_0x2954e8;if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x3e')]){_0x503c9c[_0xb00b('0x3f')]=[{'all':!![]}];}return db[_0xb00b('0x26')]['findAll'](_0x503c9c);})['then'](function(_0x43f834){_0x348165[_0xb00b('0x40')]=_0x43f834;return _0x348165;})[_0xb00b('0x1d')](respondWithFilteredResult(_0x22c22d,_0x503c9c))[_0xb00b('0x41')](handleError(_0x22c22d,null));};exports[_0xb00b('0x42')]=function(_0x26f17b,_0x275664){var _0x493841={'raw':![],'where':{'id':_0x26f17b[_0xb00b('0x43')]['id']}},_0x36200d={};_0x36200d[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x26')][_0xb00b('0x27')]);_0x36200d[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x26f17b[_0xb00b('0x2e')]);_0x36200d[_0xb00b('0x38')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],_0x36200d['query']);_0x493841[_0xb00b('0x30')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x26f17b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x493841[_0xb00b('0x30')]=_0x493841[_0xb00b('0x30')][_0xb00b('0x32')]?_0x493841[_0xb00b('0x30')]:_0x36200d[_0xb00b('0x2b')];if(_0x26f17b[_0xb00b('0x2e')]['includeAll']){_0x493841['include']=[{'all':!![]}];}_0x493841=_['merge']({},_0x493841,_0x26f17b[_0xb00b('0x3d')]);return db[_0xb00b('0x26')]['find'](_0x493841)[_0xb00b('0x1d')](handleEntityNotFound(_0x275664,null))[_0xb00b('0x1d')](respondWithResult(_0x275664,null))[_0xb00b('0x41')](handleError(_0x275664,null));};exports[_0xb00b('0x44')]=function(_0x4b62b3,_0x58e9cb){return db[_0xb00b('0x26')][_0xb00b('0x44')](_0x4b62b3['body'],{})['then'](function(_0x154759){var _0x3a205d=_0x4b62b3['user'][_0xb00b('0x1f')]({'plain':!![]});if(!_0x3a205d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a205d['role']==='user'){var _0x465d90=_0x154759['get']({'plain':!![]});var _0x1f7b86=_0xb00b('0x45');return db[_0xb00b('0x46')][_0xb00b('0x47')]({'where':{'name':_0x1f7b86,'userProfileId':_0x3a205d[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x1d')](function(_0x4846c9){if(_0x4846c9&&_0x4846c9['autoAssociation']===0x0){return db[_0xb00b('0x20')][_0xb00b('0x44')]({'name':_0x465d90['name'],'resourceId':_0x465d90['id'],'type':_0x4846c9[_0xb00b('0x23')],'sectionId':_0x4846c9['id']},{})[_0xb00b('0x1d')](function(){return _0x154759;});}else{return _0x154759;}})['catch'](function(_0x15dcbf){logger[_0xb00b('0x21')](_0xb00b('0x49'),_0x15dcbf);throw _0x15dcbf;});}return _0x154759;})['then'](respondWithResult(_0x58e9cb,0xc9))['catch'](handleError(_0x58e9cb,null));};exports[_0xb00b('0x4a')]=function(_0x398deb,_0x12737d){var _0xde3cc1={'where':{'id':_0x398deb[_0xb00b('0x43')]['id']}},_0x489b49={};_0x489b49[_0xb00b('0x2b')]=_['keys'](db['Campaign'][_0xb00b('0x27')]);_0xde3cc1['attributes']=_[_0xb00b('0x2f')](_0x489b49[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x398deb[_0xb00b('0x2e')][_0xb00b('0x31')]));_0xde3cc1[_0xb00b('0x30')]=_0xde3cc1['attributes'][_0xb00b('0x32')]?_0xde3cc1['attributes']:_0x489b49[_0xb00b('0x2b')];if(_0x398deb[_0xb00b('0x2e')][_0xb00b('0x3e')]){_0xde3cc1['include']=[{'all':!![]}];}_0xde3cc1=_[_0xb00b('0x3b')]({},_0xde3cc1,_0x398deb[_0xb00b('0x3d')]);return db[_0xb00b('0x26')]['find'](_0xde3cc1)[_0xb00b('0x1d')](handleEntityNotFound(_0x12737d,null))[_0xb00b('0x1d')](function(_0x219b74){if(_0x219b74){var _0x385029=_0x219b74[_0xb00b('0x1f')]({'plain':!![]});_0x385029=qs[_0xb00b('0x4b')](_0x385029,['id',_0xb00b('0x4c'),_0xb00b('0x4d')]);_0x398deb['body']=_[_0xb00b('0x4b')](_0x398deb[_0xb00b('0x4e')],['id',_0xb00b('0x4c'),'updatedAt']);return db[_0xb00b('0x26')][_0xb00b('0x44')](_[_0xb00b('0x3b')](_0x385029,_0x398deb[_0xb00b('0x4e')]),{'include':_0x398deb[_0xb00b('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0xb00b('0x1d')](function(_0x343214){var _0x2e3c56=_0x398deb[_0xb00b('0x4f')]['get']({'plain':!![]});if(!_0x2e3c56)throw new Error(_0xb00b('0x50'));if(_0x2e3c56[_0xb00b('0x51')]===_0xb00b('0x4f')){var _0x2d73bb=_0x343214[_0xb00b('0x1f')]({'plain':!![]});var _0x1e5ed8=_0xb00b('0x45');return db['UserProfileSection'][_0xb00b('0x47')]({'where':{'name':_0x1e5ed8,'userProfileId':_0x2e3c56['userProfileId']},'raw':!![]})[_0xb00b('0x1d')](function(_0x4c2186){if(_0x4c2186&&_0x4c2186[_0xb00b('0x52')]===0x0){return db['UserProfileResource'][_0xb00b('0x44')]({'name':_0x2d73bb['name'],'resourceId':_0x2d73bb['id'],'type':_0x4c2186[_0xb00b('0x23')],'sectionId':_0x4c2186['id']},{})[_0xb00b('0x1d')](function(){return _0x343214;});}else{return _0x343214;}})[_0xb00b('0x41')](function(_0x4d1cec){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d1cec);throw _0x4d1cec;});}return _0x343214;});}})[_0xb00b('0x1d')](respondWithResult(_0x12737d,0xc9))[_0xb00b('0x41')](handleError(_0x12737d,null));};exports[_0xb00b('0x1c')]=function(_0x49246b,_0x311f49){if(_0x49246b[_0xb00b('0x4e')]['id']){delete _0x49246b[_0xb00b('0x4e')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x47')]({'where':{'id':_0x49246b['params']['id']}})[_0xb00b('0x1d')](handleEntityNotFound(_0x311f49,null))[_0xb00b('0x1d')](saveUpdates(_0x49246b['body'],null))[_0xb00b('0x1d')](respondWithResult(_0x311f49,null))[_0xb00b('0x41')](handleError(_0x311f49,null));};exports[_0xb00b('0x1e')]=function(_0x55abaa,_0x4e8b85){return db[_0xb00b('0x26')][_0xb00b('0x47')]({'where':{'id':_0x55abaa[_0xb00b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e8b85,null))['then'](removeEntity(_0x4e8b85,null))['catch'](handleError(_0x4e8b85,null));};exports['getHoppers']=function(_0xc695f,_0x4df7fa,_0x2434a0){var _0x30c0a7={'raw':!![],'where':{}};var _0x53dd22={};var _0x7523d5={'count':0x0,'rows':[]};return db[_0xb00b('0x26')][_0xb00b('0x53')]({'where':{'id':_0xc695f[_0xb00b('0x43')]['id']}})[_0xb00b('0x1d')](handleEntityNotFound(_0x4df7fa,null))['then'](function(_0x222066){if(_0x222066){_0x53dd22[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x54')][_0xb00b('0x27')]);_0x53dd22[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0xc695f['query']);_0x53dd22[_0xb00b('0x38')]=_[_0xb00b('0x2f')](_0x53dd22[_0xb00b('0x2b')],_0x53dd22[_0xb00b('0x2e')]);_0x30c0a7[_0xb00b('0x30')]=_[_0xb00b('0x2f')](_0x53dd22[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0xc695f['query'][_0xb00b('0x31')]));_0x30c0a7[_0xb00b('0x30')]=_0x30c0a7[_0xb00b('0x30')][_0xb00b('0x32')]?_0x30c0a7[_0xb00b('0x30')]:_0x53dd22[_0xb00b('0x2b')];if(!_0xc695f[_0xb00b('0x2e')][_0xb00b('0x33')]('nolimit')){_0x30c0a7[_0xb00b('0x35')]=qs[_0xb00b('0x35')](_0xc695f[_0xb00b('0x2e')][_0xb00b('0x35')]);_0x30c0a7[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0xc695f[_0xb00b('0x2e')]['offset']);}_0x30c0a7[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0xc695f[_0xb00b('0x2e')][_0xb00b('0x37')]);_0x30c0a7[_0xb00b('0x3a')]=qs[_0xb00b('0x38')](_['pick'](_0xc695f[_0xb00b('0x2e')],_0x53dd22['filters']));_0x30c0a7[_0xb00b('0x3a')]['CampaignId']=_0x222066['id'];if(_0xc695f[_0xb00b('0x2e')][_0xb00b('0x39')]){_0x30c0a7[_0xb00b('0x3a')]=_['merge'](_0x30c0a7['where'],{'$or':_[_0xb00b('0x2c')](_0x30c0a7[_0xb00b('0x30')],function(_0x33a483){var _0x355958={};_0x355958[_0x33a483]={'$like':'%'+_0xc695f[_0xb00b('0x2e')][_0xb00b('0x39')]+'%'};return _0x355958;})});}_0x30c0a7=_[_0xb00b('0x3b')]({},_0x30c0a7,_0xc695f[_0xb00b('0x3d')]);return db[_0xb00b('0x54')][_0xb00b('0x18')]({'where':_0x30c0a7[_0xb00b('0x3a')]})[_0xb00b('0x1d')](function(_0x124c3f){_0x7523d5[_0xb00b('0x18')]=_0x124c3f;if(_0xc695f['query']['includeAll']){_0x30c0a7[_0xb00b('0x3f')]=[{'all':!![]}];}return db[_0xb00b('0x54')]['findAll'](_0x30c0a7);})['then'](function(_0x13df84){_0x7523d5[_0xb00b('0x40')]=_0x13df84;return _0x7523d5;});}})[_0xb00b('0x1d')](respondWithFilteredResult(_0x4df7fa,_0x30c0a7))['catch'](handleError(_0x4df7fa,null));};exports[_0xb00b('0x55')]=function(_0x3f415a,_0x13a059,_0x45c9cd){var _0x42b904={'raw':!![],'where':{}};var _0x2082e6={};var _0x3113e9={'count':0x0,'rows':[]};return db['Campaign'][_0xb00b('0x53')]({'where':{'id':_0x3f415a['params']['id']}})[_0xb00b('0x1d')](handleEntityNotFound(_0x13a059,null))[_0xb00b('0x1d')](function(_0x545dfd){if(_0x545dfd){_0x2082e6[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x56')][_0xb00b('0x27')]);_0x2082e6[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x3f415a[_0xb00b('0x2e')]);_0x2082e6[_0xb00b('0x38')]=_[_0xb00b('0x2f')](_0x2082e6[_0xb00b('0x2b')],_0x2082e6[_0xb00b('0x2e')]);_0x42b904[_0xb00b('0x30')]=_['intersection'](_0x2082e6[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x3f415a[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x42b904['attributes']=_0x42b904[_0xb00b('0x30')][_0xb00b('0x32')]?_0x42b904[_0xb00b('0x30')]:_0x2082e6[_0xb00b('0x2b')];if(!_0x3f415a[_0xb00b('0x2e')]['hasOwnProperty'](_0xb00b('0x34'))){_0x42b904[_0xb00b('0x35')]=qs[_0xb00b('0x35')](_0x3f415a[_0xb00b('0x2e')]['limit']);_0x42b904[_0xb00b('0x19')]=qs['offset'](_0x3f415a[_0xb00b('0x2e')][_0xb00b('0x19')]);}_0x42b904[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0x3f415a[_0xb00b('0x2e')][_0xb00b('0x37')]);_0x42b904[_0xb00b('0x3a')]=qs[_0xb00b('0x38')](_[_0xb00b('0x57')](_0x3f415a[_0xb00b('0x2e')],_0x2082e6[_0xb00b('0x38')]));_0x42b904['where'][_0xb00b('0x58')]=_0x545dfd['id'];if(_0x3f415a[_0xb00b('0x2e')][_0xb00b('0x39')]){_0x42b904[_0xb00b('0x3a')]=_['merge'](_0x42b904[_0xb00b('0x3a')],{'$or':_[_0xb00b('0x2c')](_0x42b904['attributes'],function(_0x5c1aaa){var _0x4b0278={};_0x4b0278[_0x5c1aaa]={'$like':'%'+_0x3f415a[_0xb00b('0x2e')][_0xb00b('0x39')]+'%'};return _0x4b0278;})});}_0x42b904=_[_0xb00b('0x3b')]({},_0x42b904,_0x3f415a['options']);return db[_0xb00b('0x56')][_0xb00b('0x18')]({'where':_0x42b904[_0xb00b('0x3a')]})[_0xb00b('0x1d')](function(_0x2a4048){_0x3113e9[_0xb00b('0x18')]=_0x2a4048;if(_0x3f415a[_0xb00b('0x2e')][_0xb00b('0x3e')]){_0x42b904[_0xb00b('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x42b904);})[_0xb00b('0x1d')](function(_0x39d7dd){_0x3113e9[_0xb00b('0x40')]=_0x39d7dd;return _0x3113e9;});}})[_0xb00b('0x1d')](respondWithFilteredResult(_0x13a059,_0x42b904))['catch'](handleError(_0x13a059,null));};exports[_0xb00b('0x59')]=function(_0x3ac189,_0x5eea96,_0x327454){var _0x21cdbe={'raw':!![],'where':{}};var _0x2762fb={};var _0x54244b={'count':0x0,'rows':[]};return db[_0xb00b('0x26')][_0xb00b('0x53')]({'where':{'id':_0x3ac189['params']['id']}})[_0xb00b('0x1d')](handleEntityNotFound(_0x5eea96,null))[_0xb00b('0x1d')](function(_0x275d3e){if(_0x275d3e){_0x2762fb[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x5a')][_0xb00b('0x27')]);_0x2762fb[_0xb00b('0x2e')]=_['keys'](_0x3ac189[_0xb00b('0x2e')]);_0x2762fb[_0xb00b('0x38')]=_[_0xb00b('0x2f')](_0x2762fb[_0xb00b('0x2b')],_0x2762fb['query']);_0x21cdbe[_0xb00b('0x30')]=_['intersection'](_0x2762fb[_0xb00b('0x2b')],qs['fields'](_0x3ac189[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x21cdbe[_0xb00b('0x30')]=_0x21cdbe[_0xb00b('0x30')][_0xb00b('0x32')]?_0x21cdbe['attributes']:_0x2762fb[_0xb00b('0x2b')];if(!_0x3ac189[_0xb00b('0x2e')]['hasOwnProperty'](_0xb00b('0x34'))){_0x21cdbe['limit']=qs[_0xb00b('0x35')](_0x3ac189[_0xb00b('0x2e')][_0xb00b('0x35')]);_0x21cdbe[_0xb00b('0x19')]=qs['offset'](_0x3ac189[_0xb00b('0x2e')][_0xb00b('0x19')]);}_0x21cdbe[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0x3ac189[_0xb00b('0x2e')]['sort']);_0x21cdbe['where']=qs[_0xb00b('0x38')](_[_0xb00b('0x57')](_0x3ac189[_0xb00b('0x2e')],_0x2762fb[_0xb00b('0x38')]));_0x21cdbe[_0xb00b('0x3a')]['CampaignId']=_0x275d3e['id'];if(_0x3ac189['query'][_0xb00b('0x39')]){_0x21cdbe[_0xb00b('0x3a')]=_[_0xb00b('0x3b')](_0x21cdbe[_0xb00b('0x3a')],{'$or':_[_0xb00b('0x2c')](_0x21cdbe[_0xb00b('0x30')],function(_0x31a16f){var _0x5b9964={};_0x5b9964[_0x31a16f]={'$like':'%'+_0x3ac189[_0xb00b('0x2e')]['filter']+'%'};return _0x5b9964;})});}_0x21cdbe=_[_0xb00b('0x3b')]({},_0x21cdbe,_0x3ac189['options']);return db[_0xb00b('0x5a')][_0xb00b('0x18')]({'where':_0x21cdbe[_0xb00b('0x3a')]})[_0xb00b('0x1d')](function(_0x31c7dd){_0x54244b[_0xb00b('0x18')]=_0x31c7dd;if(_0x3ac189[_0xb00b('0x2e')][_0xb00b('0x3e')]){_0x21cdbe[_0xb00b('0x3f')]=[{'all':!![]}];}return db[_0xb00b('0x5a')][_0xb00b('0x5b')](_0x21cdbe);})['then'](function(_0x456a2f){_0x54244b[_0xb00b('0x40')]=_0x456a2f;return _0x54244b;});}})[_0xb00b('0x1d')](respondWithFilteredResult(_0x5eea96,_0x21cdbe))[_0xb00b('0x41')](handleError(_0x5eea96,null));};exports['getHopperBlacks']=function(_0x3f0175,_0x3eaf44,_0x49bd18){var _0x421725={'raw':!![],'where':{}};var _0x545084={};var _0x22d726={'count':0x0,'rows':[]};return db[_0xb00b('0x26')]['findOne']({'where':{'id':_0x3f0175[_0xb00b('0x43')]['id']}})[_0xb00b('0x1d')](handleEntityNotFound(_0x3eaf44,null))[_0xb00b('0x1d')](function(_0x20ca7b){if(_0x20ca7b){_0x545084[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db['CmHopperBlack'][_0xb00b('0x27')]);_0x545084['query']=_[_0xb00b('0x2d')](_0x3f0175[_0xb00b('0x2e')]);_0x545084[_0xb00b('0x38')]=_[_0xb00b('0x2f')](_0x545084['model'],_0x545084[_0xb00b('0x2e')]);_0x421725[_0xb00b('0x30')]=_[_0xb00b('0x2f')](_0x545084['model'],qs[_0xb00b('0x31')](_0x3f0175[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x421725[_0xb00b('0x30')]=_0x421725['attributes'][_0xb00b('0x32')]?_0x421725[_0xb00b('0x30')]:_0x545084[_0xb00b('0x2b')];if(!_0x3f0175[_0xb00b('0x2e')][_0xb00b('0x33')](_0xb00b('0x34'))){_0x421725['limit']=qs['limit'](_0x3f0175[_0xb00b('0x2e')][_0xb00b('0x35')]);_0x421725[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x3f0175[_0xb00b('0x2e')]['offset']);}_0x421725[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0x3f0175[_0xb00b('0x2e')][_0xb00b('0x37')]);_0x421725[_0xb00b('0x3a')]=qs[_0xb00b('0x38')](_['pick'](_0x3f0175[_0xb00b('0x2e')],_0x545084[_0xb00b('0x38')]));_0x421725[_0xb00b('0x3a')][_0xb00b('0x58')]=_0x20ca7b['id'];if(_0x3f0175[_0xb00b('0x2e')][_0xb00b('0x39')]){_0x421725[_0xb00b('0x3a')]=_[_0xb00b('0x3b')](_0x421725[_0xb00b('0x3a')],{'$or':_[_0xb00b('0x2c')](_0x421725['attributes'],function(_0x5a4d53){var _0x20a942={};_0x20a942[_0x5a4d53]={'$like':'%'+_0x3f0175[_0xb00b('0x2e')][_0xb00b('0x39')]+'%'};return _0x20a942;})});}_0x421725=_['merge']({},_0x421725,_0x3f0175['options']);return db['CmHopperBlack'][_0xb00b('0x18')]({'where':_0x421725[_0xb00b('0x3a')]})[_0xb00b('0x1d')](function(_0x5cb267){_0x22d726[_0xb00b('0x18')]=_0x5cb267;if(_0x3f0175[_0xb00b('0x2e')][_0xb00b('0x3e')]){_0x421725[_0xb00b('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xb00b('0x5b')](_0x421725);})[_0xb00b('0x1d')](function(_0x3dc1f5){_0x22d726[_0xb00b('0x40')]=_0x3dc1f5;return _0x22d726;});}})[_0xb00b('0x1d')](respondWithFilteredResult(_0x3eaf44,_0x421725))[_0xb00b('0x41')](handleError(_0x3eaf44,null));};exports[_0xb00b('0x5c')]=function(_0x3f2329,_0x50c1fb,_0x41fcec){var _0x185025={};var _0x45459d={};var _0x40fd9c;var _0xf9c361;return db[_0xb00b('0x26')][_0xb00b('0x53')]({'where':{'id':_0x3f2329[_0xb00b('0x43')]['id']}})['then'](handleEntityNotFound(_0x50c1fb,null))[_0xb00b('0x1d')](function(_0x1f6015){if(_0x1f6015){_0x40fd9c=_0x1f6015;_0x45459d[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db['CmList'][_0xb00b('0x27')]);_0x45459d[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x3f2329[_0xb00b('0x2e')]);_0x45459d[_0xb00b('0x38')]=_[_0xb00b('0x2f')](_0x45459d[_0xb00b('0x2b')],_0x45459d[_0xb00b('0x2e')]);_0x185025['attributes']=_['intersection'](_0x45459d[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x3f2329[_0xb00b('0x2e')]['fields']));_0x185025[_0xb00b('0x30')]=_0x185025[_0xb00b('0x30')][_0xb00b('0x32')]?_0x185025['attributes']:_0x45459d[_0xb00b('0x2b')];_0x185025[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0x3f2329['query']['sort']);_0x185025[_0xb00b('0x3a')]=qs['filters'](_[_0xb00b('0x57')](_0x3f2329['query'],_0x45459d['filters']));if(_0x3f2329[_0xb00b('0x2e')][_0xb00b('0x39')]){_0x185025[_0xb00b('0x3a')]=_[_0xb00b('0x3b')](_0x185025[_0xb00b('0x3a')],{'$or':_['map'](_0x185025[_0xb00b('0x30')],function(_0x54ebe1){var _0x592206={};_0x592206[_0x54ebe1]={'$like':'%'+_0x3f2329[_0xb00b('0x2e')][_0xb00b('0x39')]+'%'};return _0x592206;})});}_0x185025=_[_0xb00b('0x3b')]({},_0x185025,_0x3f2329[_0xb00b('0x3d')]);return _0x40fd9c[_0xb00b('0x5c')](_0x185025);}})[_0xb00b('0x1d')](function(_0x483364){if(_0x483364){_0xf9c361=_0x483364[_0xb00b('0x32')];if(!_0x3f2329['query'][_0xb00b('0x33')](_0xb00b('0x34'))){_0x185025[_0xb00b('0x35')]=qs['limit'](_0x3f2329[_0xb00b('0x2e')][_0xb00b('0x35')]);_0x185025[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x3f2329['query']['offset']);}return _0x40fd9c[_0xb00b('0x5c')](_0x185025);}})['then'](function(_0x5ed24a){if(_0x5ed24a){return _0x5ed24a?{'count':_0xf9c361,'rows':_0x5ed24a}:null;}})[_0xb00b('0x1d')](respondWithResult(_0x50c1fb,null))['catch'](handleError(_0x50c1fb,null));};exports['addLists']=function(_0x2fecca,_0x330bc7,_0x745803){var _0x475abb,_0x500565;return db['Campaign'][_0xb00b('0x47')]({'where':{'id':_0x2fecca[_0xb00b('0x43')]['id']}})[_0xb00b('0x1d')](handleEntityNotFound(_0x330bc7,null))['then'](function(_0x48bac5){if(_0x48bac5){_0x500565=_0x48bac5;return _0x48bac5[_0xb00b('0x5d')](_0x2fecca['body']['ids'],_[_0xb00b('0x4b')](_0x2fecca['body'],[_0xb00b('0x5e'),'id'])||{});}return null;})['spread'](function(_0x1b751e){var _0x5712fd;_0x475abb=_0x1b751e||[];var _0x3de808=[];if(_0x1b751e){for(var _0x3289aa=0x0;_0x3289aa<_0x1b751e[_0xb00b('0x32')];_0x3289aa+=0x1){var _0x54498c=_0x1b751e[_0x3289aa][_0xb00b('0x1f')]({'plain':!![]});_0x500565['dialCheckDuplicateType']=_0x2fecca[_0xb00b('0x4e')][_0xb00b('0x5f')]?_0x2fecca['body']['dialCheckDuplicateType']:_0x500565['dialCheckDuplicateType'];switch(_0x500565['dialCheckDuplicateType']){case _0xb00b('0x60'):_0x5712fd=squel['insert']()[_0xb00b('0x61')]('cm_hopper')[_0xb00b('0x62')]([_0xb00b('0x63'),_0xb00b('0x64'),_0xb00b('0x65'),_0xb00b('0x66'),'CampaignId',_0xb00b('0x4c'),_0xb00b('0x4d')],squel[_0xb00b('0x67')]()[_0xb00b('0x68')]('phone','phone')[_0xb00b('0x68')](_0xb00b('0x69'),_0xb00b('0x64'))[_0xb00b('0x68')]('id',_0xb00b('0x65'))[_0xb00b('0x68')](_0x54498c[_0xb00b('0x6a')][_0xb00b('0x6b')](),_0xb00b('0x66'))['field'](_0x2fecca[_0xb00b('0x43')]['id'][_0xb00b('0x6b')](),'CampaignId')[_0xb00b('0x68')]('NOW()',_0xb00b('0x4c'))[_0xb00b('0x68')]('NOW()','updatedAt')[_0xb00b('0x6c')](_0xb00b('0x6d'))[_0xb00b('0x3a')]('deletedAt\x20IS\x20NULL')[_0xb00b('0x3a')](_0xb00b('0x6e'),_0x54498c[_0xb00b('0x6a')]['toString']())[_0xb00b('0x3a')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xb00b('0x67')]()['field'](_0xb00b('0x6f'))[_0xb00b('0x6c')]('cm_hopper_final')['where'](_0xb00b('0x70'),_0x2fecca[_0xb00b('0x43')]['id']['toString']()))[_0xb00b('0x3a')](_0xb00b('0x71'),squel[_0xb00b('0x67')]()[_0xb00b('0x68')](_0xb00b('0x72'))[_0xb00b('0x6c')]('cm_hopper')[_0xb00b('0x3a')](_0xb00b('0x70'),_0x2fecca['params']['id'][_0xb00b('0x6b')]())))['toString']();break;case'onlyIfOpen':_0x5712fd=squel[_0xb00b('0x73')]()['into'](_0xb00b('0x74'))[_0xb00b('0x62')]([_0xb00b('0x63'),'scheduledAt','ContactId','ListId',_0xb00b('0x58'),_0xb00b('0x4c'),'updatedAt'],squel[_0xb00b('0x67')]()[_0xb00b('0x68')](_0xb00b('0x63'),_0xb00b('0x63'))[_0xb00b('0x68')](_0xb00b('0x69'),_0xb00b('0x64'))[_0xb00b('0x68')]('id','ContactId')[_0xb00b('0x68')](_0x54498c[_0xb00b('0x6a')][_0xb00b('0x6b')](),'ListId')['field'](_0x2fecca['params']['id'][_0xb00b('0x6b')](),_0xb00b('0x58'))[_0xb00b('0x68')]('NOW()',_0xb00b('0x4c'))[_0xb00b('0x68')](_0xb00b('0x69'),_0xb00b('0x4d'))[_0xb00b('0x6c')]('cm_contacts')[_0xb00b('0x3a')]('deletedAt\x20IS\x20NULL')[_0xb00b('0x3a')](_0xb00b('0x6e'),_0x54498c[_0xb00b('0x6a')][_0xb00b('0x6b')]())[_0xb00b('0x3a')](_0xb00b('0x75'))['where'](_0xb00b('0x71'),squel[_0xb00b('0x67')]()[_0xb00b('0x68')](_0xb00b('0x72'))[_0xb00b('0x6c')](_0xb00b('0x74'))[_0xb00b('0x3a')](_0xb00b('0x70'),_0x2fecca[_0xb00b('0x43')]['id'][_0xb00b('0x6b')]())))['toString']();break;default:_0x5712fd=squel[_0xb00b('0x73')]()[_0xb00b('0x61')]('cm_hopper')[_0xb00b('0x62')](['phone','scheduledAt','ContactId',_0xb00b('0x66'),'CampaignId',_0xb00b('0x4c'),_0xb00b('0x4d')],squel[_0xb00b('0x67')]()[_0xb00b('0x68')](_0xb00b('0x63'),_0xb00b('0x63'))[_0xb00b('0x68')](_0xb00b('0x69'),_0xb00b('0x64'))[_0xb00b('0x68')]('id',_0xb00b('0x65'))[_0xb00b('0x68')](_0x54498c[_0xb00b('0x6a')][_0xb00b('0x6b')](),'ListId')[_0xb00b('0x68')](_0x2fecca[_0xb00b('0x43')]['id'][_0xb00b('0x6b')](),_0xb00b('0x58'))[_0xb00b('0x68')]('NOW()',_0xb00b('0x4c'))[_0xb00b('0x68')]('NOW()','updatedAt')[_0xb00b('0x6c')](_0xb00b('0x6d'))[_0xb00b('0x3a')](_0xb00b('0x76'))[_0xb00b('0x3a')](_0xb00b('0x6e'),_0x54498c[_0xb00b('0x6a')][_0xb00b('0x6b')]())[_0xb00b('0x3a')](_0xb00b('0x75')))[_0xb00b('0x6b')]();}_0x3de808['push'](db[_0xb00b('0x77')]['query'](_0x5712fd));}return BPromise[_0xb00b('0x78')](_0x3de808);}})[_0xb00b('0x1d')](function(){return _0x475abb;})[_0xb00b('0x1d')](respondWithResult(_0x330bc7,null))[_0xb00b('0x41')](handleError(_0x330bc7,null));};exports[_0xb00b('0x79')]=function(_0x2371d6,_0x59c4b6,_0x2896bf){return db[_0xb00b('0x26')][_0xb00b('0x47')]({'where':{'id':_0x2371d6[_0xb00b('0x43')]['id']}})['then'](handleEntityNotFound(_0x59c4b6,null))[_0xb00b('0x1d')](function(_0x3db52a){if(_0x3db52a){return _0x3db52a['removeLists'](_0x2371d6[_0xb00b('0x2e')][_0xb00b('0x5e')]);}})[_0xb00b('0x1d')](function(_0xca4a87){if(_0xca4a87){return db[_0xb00b('0x54')][_0xb00b('0x1e')]({'where':{'ListId':_0x2371d6[_0xb00b('0x2e')][_0xb00b('0x5e')],'CampaignId':_0x2371d6[_0xb00b('0x43')]['id']}})['then'](function(){return _0xca4a87;});}})[_0xb00b('0x1d')](respondWithStatusCode(_0x59c4b6,null))[_0xb00b('0x41')](handleError(_0x59c4b6,null));};exports['getBlackLists']=function(_0x51995c,_0x2acac0,_0xb13ed2){var _0xba1460={'raw':!![],'where':{}};var _0x97a50e={};var _0x3960be={'count':0x0,'rows':[]};return db[_0xb00b('0x26')][_0xb00b('0x53')]({'where':{'id':_0x51995c[_0xb00b('0x43')]['id']}})[_0xb00b('0x1d')](handleEntityNotFound(_0x2acac0,null))[_0xb00b('0x1d')](function(_0x5943a2){if(_0x5943a2){_0x97a50e[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x7a')]['rawAttributes']);_0x97a50e[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x51995c[_0xb00b('0x2e')]);_0x97a50e[_0xb00b('0x38')]=_['intersection'](_0x97a50e[_0xb00b('0x2b')],_0x97a50e[_0xb00b('0x2e')]);_0xba1460['attributes']=_['intersection'](_0x97a50e[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x51995c['query'][_0xb00b('0x31')]));_0xba1460['attributes']=_0xba1460['attributes'][_0xb00b('0x32')]?_0xba1460['attributes']:_0x97a50e['model'];if(!_0x51995c[_0xb00b('0x2e')][_0xb00b('0x33')](_0xb00b('0x34'))){_0xba1460[_0xb00b('0x35')]=qs[_0xb00b('0x35')](_0x51995c[_0xb00b('0x2e')][_0xb00b('0x35')]);_0xba1460[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x51995c[_0xb00b('0x2e')][_0xb00b('0x19')]);}_0xba1460[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0x51995c[_0xb00b('0x2e')]['sort']);_0xba1460[_0xb00b('0x3a')]=qs[_0xb00b('0x38')](_['pick'](_0x51995c[_0xb00b('0x2e')],_0x97a50e['filters']));_0xba1460[_0xb00b('0x3a')][_0xb00b('0x58')]=_0x5943a2['id'];if(_0x51995c[_0xb00b('0x2e')]['filter']){_0xba1460[_0xb00b('0x3a')]=_[_0xb00b('0x3b')](_0xba1460['where'],{'$or':_[_0xb00b('0x2c')](_0xba1460[_0xb00b('0x30')],function(_0x140226){var _0x131138={};_0x131138[_0x140226]={'$like':'%'+_0x51995c['query'][_0xb00b('0x39')]+'%'};return _0x131138;})});}_0xba1460=_[_0xb00b('0x3b')]({},_0xba1460,_0x51995c[_0xb00b('0x3d')]);return db['CmList']['count']({'where':_0xba1460['where']})[_0xb00b('0x1d')](function(_0x399a95){_0x3960be[_0xb00b('0x18')]=_0x399a95;if(_0x51995c[_0xb00b('0x2e')][_0xb00b('0x3e')]){_0xba1460[_0xb00b('0x3f')]=[{'all':!![]}];}return db[_0xb00b('0x7a')][_0xb00b('0x5b')](_0xba1460);})[_0xb00b('0x1d')](function(_0x506031){_0x3960be['rows']=_0x506031;return _0x3960be;});}})[_0xb00b('0x1d')](respondWithFilteredResult(_0x2acac0,_0xba1460))[_0xb00b('0x41')](handleError(_0x2acac0,null));};exports['addBlackLists']=function(_0x42fdce,_0x525fb3,_0x392fab){var _0x4a58ce,_0x3c8f37;return db[_0xb00b('0x26')]['find']({'where':{'id':_0x42fdce[_0xb00b('0x43')]['id']}})[_0xb00b('0x1d')](handleEntityNotFound(_0x525fb3,null))['then'](function(_0x44767a){if(_0x44767a){_0x3c8f37=_0x44767a;return _0x44767a['addBlackLists'](_0x42fdce[_0xb00b('0x4e')][_0xb00b('0x5e')],_[_0xb00b('0x4b')](_0x42fdce[_0xb00b('0x4e')],[_0xb00b('0x5e'),'id'])||{});}return null;})[_0xb00b('0x7b')](function(_0x1627b8){var _0xe46b23;_0x4a58ce=_0x1627b8||[];var _0x437d50=[];if(_0x1627b8){for(var _0x405c9b=0x0;_0x405c9b<_0x1627b8['length'];_0x405c9b+=0x1){var _0x4cff99=_0x1627b8[_0x405c9b][_0xb00b('0x1f')]({'plain':!![]});_0xe46b23=squel['insert']()[_0xb00b('0x61')]('cm_hopper_black')[_0xb00b('0x62')]([_0xb00b('0x63'),'ContactId',_0xb00b('0x66'),'CampaignId',_0xb00b('0x4c'),_0xb00b('0x4d')],squel['select']()[_0xb00b('0x68')](_0xb00b('0x63'),_0xb00b('0x63'))[_0xb00b('0x68')]('id',_0xb00b('0x65'))['field'](_0x4cff99[_0xb00b('0x6a')][_0xb00b('0x6b')](),'ListId')['field'](_0x42fdce[_0xb00b('0x43')]['id']['toString'](),'CampaignId')['field'](_0xb00b('0x69'),_0xb00b('0x4c'))[_0xb00b('0x68')](_0xb00b('0x69'),'updatedAt')[_0xb00b('0x6c')]('cm_contacts')[_0xb00b('0x3a')](_0xb00b('0x76'))[_0xb00b('0x3a')](_0xb00b('0x6e'),_0x4cff99['CmListId'][_0xb00b('0x6b')]())[_0xb00b('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xb00b('0x6b')]();_0x437d50[_0xb00b('0x7c')](db[_0xb00b('0x77')]['query'](_0xe46b23));}return BPromise['all'](_0x437d50);}})[_0xb00b('0x1d')](function(){return _0x4a58ce;})[_0xb00b('0x1d')](respondWithResult(_0x525fb3,null))[_0xb00b('0x41')](handleError(_0x525fb3,null));};exports[_0xb00b('0x7d')]=function(_0x74f845,_0x1a83b5,_0x3c969d){return db['Campaign']['find']({'where':{'id':_0x74f845[_0xb00b('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a83b5,null))['then'](function(_0x2b9cdd){if(_0x2b9cdd){return _0x2b9cdd[_0xb00b('0x7d')](_0x74f845['query'][_0xb00b('0x5e')]);}})[_0xb00b('0x1d')](function(_0x13783c){if(_0x13783c){return db['CmHopperBlack'][_0xb00b('0x1e')]({'where':{'ListId':_0x74f845[_0xb00b('0x2e')][_0xb00b('0x5e')],'CampaignId':_0x74f845[_0xb00b('0x43')]['id']}})[_0xb00b('0x1d')](function(){return _0x13783c;});}})[_0xb00b('0x1d')](respondWithStatusCode(_0x1a83b5,null))[_0xb00b('0x41')](handleError(_0x1a83b5,null));}; \ No newline at end of file +var _0x70e0=['../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','filter','where','VIRTUAL','merge','Campaign','count','includeAll','findAll','catch','show','keys','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','autoAssociation','getHoppers','CmHopper','rows','findOne','CmHopperHistory','pick','CampaignId','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','select','field','NOW()','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','fromQuery','ContactId','COALESCE(phone,\x27\x27)','push','sequelize','removeLists','ids','getBlackLists','CmList','addBlackLists','cm_hopper_black','all','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x33e483,_0x2bf04d){var _0x7472a4=function(_0x188658){while(--_0x188658){_0x33e483['push'](_0x33e483['shift']());}};_0x7472a4(++_0x2bf04d);}(_0x70e0,0x17b));var _0x070e=function(_0x1b1a26,_0x4a7bc6){_0x1b1a26=_0x1b1a26-0x0;var _0x430832=_0x70e0[_0x1b1a26];return _0x430832;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){var _0x33e8c6=_0xf8dd5d[_0x070e('0x22')]({'plain':!![]});var _0xa86797=_0x070e('0x23');return db[_0x070e('0x24')]['destroy']({'where':{'type':_0xa86797,'resourceId':_0x33e8c6['id']}})[_0x070e('0x20')](function(){return _0xf8dd5d;});})[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf17c56,_0x5f3e9d){return function(_0x4a2dbd){if(!_0x4a2dbd){_0xf17c56[_0x070e('0x16')](0x194);}return _0x4a2dbd;};}function handleError(_0x25f6e,_0x41deb1){_0x41deb1=_0x41deb1||0x1f4;return function(_0x1743cc){logger[_0x070e('0x25')](_0x1743cc['stack']);if(_0x1743cc[_0x070e('0x26')]){delete _0x1743cc[_0x070e('0x26')];}_0x25f6e[_0x070e('0x1a')](_0x41deb1)[_0x070e('0x27')](_0x1743cc);};}exports[_0x070e('0x28')]=function(_0x28d7f2,_0x1a1892){var _0x26373b={},_0x5e8326={},_0x282344={'count':0x0,'rows':[]};var _0x351641=_[_0x070e('0x29')](db['Campaign']['rawAttributes'],function(_0x13097f){return{'name':_0x13097f[_0x070e('0x2a')],'type':_0x13097f[_0x070e('0x2b')]['key']};});_0x5e8326[_0x070e('0x2c')]=_[_0x070e('0x29')](_0x351641,_0x070e('0x26'));_0x5e8326[_0x070e('0x2d')]=_['keys'](_0x28d7f2['query']);_0x5e8326['filters']=_['intersection'](_0x5e8326[_0x070e('0x2c')],_0x5e8326['query']);_0x26373b[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x5e8326['model'],qs['fields'](_0x28d7f2[_0x070e('0x2d')][_0x070e('0x30')]));_0x26373b['attributes']=_0x26373b['attributes'][_0x070e('0x31')]?_0x26373b[_0x070e('0x2e')]:_0x5e8326[_0x070e('0x2c')];if(!_0x28d7f2[_0x070e('0x2d')][_0x070e('0x32')]('nolimit')){_0x26373b['limit']=qs[_0x070e('0x19')](_0x28d7f2[_0x070e('0x2d')][_0x070e('0x19')]);_0x26373b[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x28d7f2['query'][_0x070e('0x18')]);}_0x26373b[_0x070e('0x33')]=qs['sort'](_0x28d7f2[_0x070e('0x2d')][_0x070e('0x34')]);_0x26373b['where']=qs['filters'](_['pick'](_0x28d7f2[_0x070e('0x2d')],_0x5e8326[_0x070e('0x35')]));if(_0x28d7f2[_0x070e('0x2d')][_0x070e('0x36')]){_0x26373b[_0x070e('0x37')]=_['merge'](_0x26373b[_0x070e('0x37')],{'$or':_[_0x070e('0x29')](_0x351641,function(_0xb53332){if(_0xb53332['type']!==_0x070e('0x38')){var _0x72cbc7={};_0x72cbc7[_0xb53332[_0x070e('0x26')]]={'$like':'%'+_0x28d7f2['query'][_0x070e('0x36')]+'%'};return _0x72cbc7;}})});}_0x26373b=_[_0x070e('0x39')]({},_0x26373b,_0x28d7f2['options']);var _0x173602={'where':_0x26373b['where']};return db[_0x070e('0x3a')][_0x070e('0x3b')](_0x173602)[_0x070e('0x20')](function(_0x30319c){_0x282344[_0x070e('0x3b')]=_0x30319c;if(_0x28d7f2['query'][_0x070e('0x3c')]){_0x26373b['include']=[{'all':!![]}];}return db['Campaign'][_0x070e('0x3d')](_0x26373b);})[_0x070e('0x20')](function(_0x38879f){_0x282344['rows']=_0x38879f;return _0x282344;})[_0x070e('0x20')](respondWithFilteredResult(_0x1a1892,_0x26373b))[_0x070e('0x3e')](handleError(_0x1a1892,null));};exports[_0x070e('0x3f')]=function(_0x7dc240,_0x4a4ee3){var _0x13e4e0={'raw':![],'where':{'id':_0x7dc240['params']['id']}},_0x5851ab={};_0x5851ab['model']=_[_0x070e('0x40')](db[_0x070e('0x3a')][_0x070e('0x41')]);_0x5851ab[_0x070e('0x2d')]=_[_0x070e('0x40')](_0x7dc240['query']);_0x5851ab[_0x070e('0x35')]=_['intersection'](_0x5851ab[_0x070e('0x2c')],_0x5851ab[_0x070e('0x2d')]);_0x13e4e0[_0x070e('0x2e')]=_['intersection'](_0x5851ab['model'],qs[_0x070e('0x30')](_0x7dc240['query'][_0x070e('0x30')]));_0x13e4e0[_0x070e('0x2e')]=_0x13e4e0[_0x070e('0x2e')]['length']?_0x13e4e0[_0x070e('0x2e')]:_0x5851ab[_0x070e('0x2c')];if(_0x7dc240['query']['includeAll']){_0x13e4e0[_0x070e('0x42')]=[{'all':!![]}];}_0x13e4e0=_[_0x070e('0x39')]({},_0x13e4e0,_0x7dc240[_0x070e('0x43')]);return db[_0x070e('0x3a')][_0x070e('0x44')](_0x13e4e0)['then'](handleEntityNotFound(_0x4a4ee3,null))[_0x070e('0x20')](respondWithResult(_0x4a4ee3,null))[_0x070e('0x3e')](handleError(_0x4a4ee3,null));};exports[_0x070e('0x45')]=function(_0x391dee,_0x79eaa0){return db[_0x070e('0x3a')][_0x070e('0x45')](_0x391dee[_0x070e('0x46')],{})[_0x070e('0x20')](function(_0x66a3f3){var _0x210c4d=_0x391dee[_0x070e('0x47')][_0x070e('0x22')]({'plain':!![]});if(!_0x210c4d)throw new Error(_0x070e('0x48'));if(_0x210c4d[_0x070e('0x49')]==='user'){var _0x171621=_0x66a3f3[_0x070e('0x22')]({'plain':!![]});var _0x40298a=_0x070e('0x23');return db[_0x070e('0x4a')][_0x070e('0x44')]({'where':{'name':_0x40298a,'userProfileId':_0x210c4d[_0x070e('0x4b')]},'raw':!![]})[_0x070e('0x20')](function(_0x1c64d2){if(_0x1c64d2&&_0x1c64d2['autoAssociation']===0x0){return db[_0x070e('0x24')]['create']({'name':_0x171621[_0x070e('0x26')],'resourceId':_0x171621['id'],'type':_0x1c64d2[_0x070e('0x26')],'sectionId':_0x1c64d2['id']},{})['then'](function(){return _0x66a3f3;});}else{return _0x66a3f3;}})[_0x070e('0x3e')](function(_0x130a50){logger[_0x070e('0x25')](_0x070e('0x4c'),_0x130a50);throw _0x130a50;});}return _0x66a3f3;})[_0x070e('0x20')](respondWithResult(_0x79eaa0,0xc9))[_0x070e('0x3e')](handleError(_0x79eaa0,null));};exports[_0x070e('0x4d')]=function(_0x5694fa,_0x296978){var _0x5bacbd={'where':{'id':_0x5694fa[_0x070e('0x4e')]['id']}},_0x516161={};_0x516161[_0x070e('0x2c')]=_[_0x070e('0x40')](db[_0x070e('0x3a')][_0x070e('0x41')]);_0x5bacbd[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x516161[_0x070e('0x2c')],qs['fields'](_0x5694fa[_0x070e('0x2d')]['fields']));_0x5bacbd['attributes']=_0x5bacbd[_0x070e('0x2e')][_0x070e('0x31')]?_0x5bacbd['attributes']:_0x516161[_0x070e('0x2c')];if(_0x5694fa[_0x070e('0x2d')][_0x070e('0x3c')]){_0x5bacbd[_0x070e('0x42')]=[{'all':!![]}];}_0x5bacbd=_[_0x070e('0x39')]({},_0x5bacbd,_0x5694fa[_0x070e('0x43')]);return db[_0x070e('0x3a')]['find'](_0x5bacbd)['then'](handleEntityNotFound(_0x296978,null))['then'](function(_0x3087e5){if(_0x3087e5){var _0x1948a5=_0x3087e5[_0x070e('0x22')]({'plain':!![]});_0x1948a5=qs[_0x070e('0x4f')](_0x1948a5,['id','createdAt',_0x070e('0x50')]);_0x5694fa['body']=_[_0x070e('0x4f')](_0x5694fa[_0x070e('0x46')],['id',_0x070e('0x51'),_0x070e('0x50')]);return db[_0x070e('0x3a')][_0x070e('0x45')](_['merge'](_0x1948a5,_0x5694fa[_0x070e('0x46')]),{'include':_0x5694fa[_0x070e('0x2d')][_0x070e('0x3c')]?[{'all':!![]}]:undefined})['then'](function(_0x1d7873){var _0x1da803=_0x5694fa['user'][_0x070e('0x22')]({'plain':!![]});if(!_0x1da803)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1da803[_0x070e('0x49')]==='user'){var _0x4cb86f=_0x1d7873['get']({'plain':!![]});var _0xbaf43e=_0x070e('0x23');return db[_0x070e('0x4a')][_0x070e('0x44')]({'where':{'name':_0xbaf43e,'userProfileId':_0x1da803[_0x070e('0x4b')]},'raw':!![]})[_0x070e('0x20')](function(_0x498bc6){if(_0x498bc6&&_0x498bc6[_0x070e('0x52')]===0x0){return db['UserProfileResource'][_0x070e('0x45')]({'name':_0x4cb86f['name'],'resourceId':_0x4cb86f['id'],'type':_0x498bc6[_0x070e('0x26')],'sectionId':_0x498bc6['id']},{})[_0x070e('0x20')](function(){return _0x1d7873;});}else{return _0x1d7873;}})['catch'](function(_0x1bcdc3){logger['error'](_0x070e('0x4c'),_0x1bcdc3);throw _0x1bcdc3;});}return _0x1d7873;});}})[_0x070e('0x20')](respondWithResult(_0x296978,0xc9))[_0x070e('0x3e')](handleError(_0x296978,null));};exports[_0x070e('0x1f')]=function(_0x764b06,_0x20c772){if(_0x764b06[_0x070e('0x46')]['id']){delete _0x764b06[_0x070e('0x46')]['id'];}return db[_0x070e('0x3a')][_0x070e('0x44')]({'where':{'id':_0x764b06[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x20c772,null))[_0x070e('0x20')](saveUpdates(_0x764b06[_0x070e('0x46')],null))['then'](respondWithResult(_0x20c772,null))[_0x070e('0x3e')](handleError(_0x20c772,null));};exports[_0x070e('0x21')]=function(_0x381c83,_0x93301a){return db['Campaign'][_0x070e('0x44')]({'where':{'id':_0x381c83[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x93301a,null))[_0x070e('0x20')](removeEntity(_0x93301a,null))[_0x070e('0x3e')](handleError(_0x93301a,null));};exports[_0x070e('0x53')]=function(_0x55524b,_0x5251d6,_0x7d154){var _0x240ec9={'raw':!![],'where':{}};var _0x2fe202={};var _0x551ca5={'count':0x0,'rows':[]};return db[_0x070e('0x3a')]['findOne']({'where':{'id':_0x55524b[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x5251d6,null))[_0x070e('0x20')](function(_0x150bf6){if(_0x150bf6){_0x2fe202[_0x070e('0x2c')]=_['keys'](db[_0x070e('0x54')][_0x070e('0x41')]);_0x2fe202[_0x070e('0x2d')]=_[_0x070e('0x40')](_0x55524b['query']);_0x2fe202[_0x070e('0x35')]=_['intersection'](_0x2fe202[_0x070e('0x2c')],_0x2fe202[_0x070e('0x2d')]);_0x240ec9[_0x070e('0x2e')]=_['intersection'](_0x2fe202[_0x070e('0x2c')],qs['fields'](_0x55524b[_0x070e('0x2d')]['fields']));_0x240ec9[_0x070e('0x2e')]=_0x240ec9[_0x070e('0x2e')]['length']?_0x240ec9[_0x070e('0x2e')]:_0x2fe202['model'];if(!_0x55524b[_0x070e('0x2d')][_0x070e('0x32')]('nolimit')){_0x240ec9['limit']=qs[_0x070e('0x19')](_0x55524b[_0x070e('0x2d')][_0x070e('0x19')]);_0x240ec9[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x55524b[_0x070e('0x2d')][_0x070e('0x18')]);}_0x240ec9[_0x070e('0x33')]=qs[_0x070e('0x34')](_0x55524b[_0x070e('0x2d')][_0x070e('0x34')]);_0x240ec9[_0x070e('0x37')]=qs[_0x070e('0x35')](_['pick'](_0x55524b[_0x070e('0x2d')],_0x2fe202[_0x070e('0x35')]));_0x240ec9['where']['CampaignId']=_0x150bf6['id'];if(_0x55524b[_0x070e('0x2d')][_0x070e('0x36')]){_0x240ec9[_0x070e('0x37')]=_[_0x070e('0x39')](_0x240ec9[_0x070e('0x37')],{'$or':_[_0x070e('0x29')](_0x240ec9[_0x070e('0x2e')],function(_0x110813){var _0x24ac0f={};_0x24ac0f[_0x110813]={'$like':'%'+_0x55524b[_0x070e('0x2d')][_0x070e('0x36')]+'%'};return _0x24ac0f;})});}_0x240ec9=_[_0x070e('0x39')]({},_0x240ec9,_0x55524b[_0x070e('0x43')]);return db['CmHopper']['count']({'where':_0x240ec9['where']})[_0x070e('0x20')](function(_0x2e4b4a){_0x551ca5[_0x070e('0x3b')]=_0x2e4b4a;if(_0x55524b[_0x070e('0x2d')]['includeAll']){_0x240ec9[_0x070e('0x42')]=[{'all':!![]}];}return db[_0x070e('0x54')][_0x070e('0x3d')](_0x240ec9);})[_0x070e('0x20')](function(_0xebd963){_0x551ca5[_0x070e('0x55')]=_0xebd963;return _0x551ca5;});}})['then'](respondWithFilteredResult(_0x5251d6,_0x240ec9))[_0x070e('0x3e')](handleError(_0x5251d6,null));};exports['getHopperHistories']=function(_0x2e5bca,_0x413df0,_0x2f704b){var _0x3aa620={'raw':!![],'where':{}};var _0x117fe4={};var _0x4a5694={'count':0x0,'rows':[]};return db[_0x070e('0x3a')][_0x070e('0x56')]({'where':{'id':_0x2e5bca['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x413df0,null))[_0x070e('0x20')](function(_0x553ea1){if(_0x553ea1){_0x117fe4[_0x070e('0x2c')]=_[_0x070e('0x40')](db[_0x070e('0x57')]['rawAttributes']);_0x117fe4[_0x070e('0x2d')]=_[_0x070e('0x40')](_0x2e5bca[_0x070e('0x2d')]);_0x117fe4[_0x070e('0x35')]=_[_0x070e('0x2f')](_0x117fe4[_0x070e('0x2c')],_0x117fe4[_0x070e('0x2d')]);_0x3aa620[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x117fe4[_0x070e('0x2c')],qs[_0x070e('0x30')](_0x2e5bca[_0x070e('0x2d')][_0x070e('0x30')]));_0x3aa620['attributes']=_0x3aa620[_0x070e('0x2e')][_0x070e('0x31')]?_0x3aa620[_0x070e('0x2e')]:_0x117fe4[_0x070e('0x2c')];if(!_0x2e5bca[_0x070e('0x2d')][_0x070e('0x32')]('nolimit')){_0x3aa620['limit']=qs['limit'](_0x2e5bca[_0x070e('0x2d')][_0x070e('0x19')]);_0x3aa620[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x2e5bca['query'][_0x070e('0x18')]);}_0x3aa620[_0x070e('0x33')]=qs[_0x070e('0x34')](_0x2e5bca['query'][_0x070e('0x34')]);_0x3aa620['where']=qs[_0x070e('0x35')](_[_0x070e('0x58')](_0x2e5bca['query'],_0x117fe4['filters']));_0x3aa620[_0x070e('0x37')][_0x070e('0x59')]=_0x553ea1['id'];if(_0x2e5bca['query'][_0x070e('0x36')]){_0x3aa620['where']=_['merge'](_0x3aa620['where'],{'$or':_[_0x070e('0x29')](_0x3aa620[_0x070e('0x2e')],function(_0xc46619){var _0x3aa652={};_0x3aa652[_0xc46619]={'$like':'%'+_0x2e5bca[_0x070e('0x2d')][_0x070e('0x36')]+'%'};return _0x3aa652;})});}_0x3aa620=_[_0x070e('0x39')]({},_0x3aa620,_0x2e5bca[_0x070e('0x43')]);return db[_0x070e('0x57')][_0x070e('0x3b')]({'where':_0x3aa620[_0x070e('0x37')]})[_0x070e('0x20')](function(_0x296008){_0x4a5694[_0x070e('0x3b')]=_0x296008;if(_0x2e5bca[_0x070e('0x2d')][_0x070e('0x3c')]){_0x3aa620[_0x070e('0x42')]=[{'all':!![]}];}return db[_0x070e('0x57')][_0x070e('0x3d')](_0x3aa620);})[_0x070e('0x20')](function(_0x153a37){_0x4a5694[_0x070e('0x55')]=_0x153a37;return _0x4a5694;});}})['then'](respondWithFilteredResult(_0x413df0,_0x3aa620))[_0x070e('0x3e')](handleError(_0x413df0,null));};exports[_0x070e('0x5a')]=function(_0x449337,_0xe50b1b,_0x495403){var _0x2f26d1={'raw':!![],'where':{}};var _0x32fa3b={};var _0x2230ff={'count':0x0,'rows':[]};return db[_0x070e('0x3a')][_0x070e('0x56')]({'where':{'id':_0x449337[_0x070e('0x4e')]['id']}})['then'](handleEntityNotFound(_0xe50b1b,null))['then'](function(_0x524a81){if(_0x524a81){_0x32fa3b[_0x070e('0x2c')]=_['keys'](db[_0x070e('0x5b')][_0x070e('0x41')]);_0x32fa3b['query']=_[_0x070e('0x40')](_0x449337[_0x070e('0x2d')]);_0x32fa3b['filters']=_['intersection'](_0x32fa3b[_0x070e('0x2c')],_0x32fa3b[_0x070e('0x2d')]);_0x2f26d1[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x32fa3b[_0x070e('0x2c')],qs['fields'](_0x449337[_0x070e('0x2d')]['fields']));_0x2f26d1[_0x070e('0x2e')]=_0x2f26d1[_0x070e('0x2e')]['length']?_0x2f26d1[_0x070e('0x2e')]:_0x32fa3b[_0x070e('0x2c')];if(!_0x449337[_0x070e('0x2d')][_0x070e('0x32')](_0x070e('0x5c'))){_0x2f26d1[_0x070e('0x19')]=qs['limit'](_0x449337[_0x070e('0x2d')][_0x070e('0x19')]);_0x2f26d1[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x449337[_0x070e('0x2d')]['offset']);}_0x2f26d1[_0x070e('0x33')]=qs[_0x070e('0x34')](_0x449337[_0x070e('0x2d')][_0x070e('0x34')]);_0x2f26d1[_0x070e('0x37')]=qs[_0x070e('0x35')](_[_0x070e('0x58')](_0x449337[_0x070e('0x2d')],_0x32fa3b[_0x070e('0x35')]));_0x2f26d1[_0x070e('0x37')][_0x070e('0x59')]=_0x524a81['id'];if(_0x449337[_0x070e('0x2d')][_0x070e('0x36')]){_0x2f26d1[_0x070e('0x37')]=_[_0x070e('0x39')](_0x2f26d1[_0x070e('0x37')],{'$or':_['map'](_0x2f26d1['attributes'],function(_0x32e1fa){var _0x214223={};_0x214223[_0x32e1fa]={'$like':'%'+_0x449337['query']['filter']+'%'};return _0x214223;})});}_0x2f26d1=_['merge']({},_0x2f26d1,_0x449337['options']);return db[_0x070e('0x5b')][_0x070e('0x3b')]({'where':_0x2f26d1[_0x070e('0x37')]})[_0x070e('0x20')](function(_0x409811){_0x2230ff[_0x070e('0x3b')]=_0x409811;if(_0x449337[_0x070e('0x2d')][_0x070e('0x3c')]){_0x2f26d1[_0x070e('0x42')]=[{'all':!![]}];}return db[_0x070e('0x5b')]['findAll'](_0x2f26d1);})[_0x070e('0x20')](function(_0x36cfe2){_0x2230ff['rows']=_0x36cfe2;return _0x2230ff;});}})[_0x070e('0x20')](respondWithFilteredResult(_0xe50b1b,_0x2f26d1))[_0x070e('0x3e')](handleError(_0xe50b1b,null));};exports[_0x070e('0x5d')]=function(_0x2ff9a7,_0x59b0c5,_0x2d46fb){var _0x36a689={'raw':!![],'where':{}};var _0x214bea={};var _0x46d83e={'count':0x0,'rows':[]};return db['Campaign'][_0x070e('0x56')]({'where':{'id':_0x2ff9a7[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x59b0c5,null))[_0x070e('0x20')](function(_0xdb8036){if(_0xdb8036){_0x214bea[_0x070e('0x2c')]=_[_0x070e('0x40')](db[_0x070e('0x5e')][_0x070e('0x41')]);_0x214bea[_0x070e('0x2d')]=_[_0x070e('0x40')](_0x2ff9a7['query']);_0x214bea[_0x070e('0x35')]=_[_0x070e('0x2f')](_0x214bea['model'],_0x214bea['query']);_0x36a689[_0x070e('0x2e')]=_['intersection'](_0x214bea[_0x070e('0x2c')],qs[_0x070e('0x30')](_0x2ff9a7[_0x070e('0x2d')][_0x070e('0x30')]));_0x36a689[_0x070e('0x2e')]=_0x36a689[_0x070e('0x2e')][_0x070e('0x31')]?_0x36a689['attributes']:_0x214bea[_0x070e('0x2c')];if(!_0x2ff9a7[_0x070e('0x2d')][_0x070e('0x32')](_0x070e('0x5c'))){_0x36a689['limit']=qs['limit'](_0x2ff9a7[_0x070e('0x2d')][_0x070e('0x19')]);_0x36a689[_0x070e('0x18')]=qs['offset'](_0x2ff9a7[_0x070e('0x2d')][_0x070e('0x18')]);}_0x36a689['order']=qs[_0x070e('0x34')](_0x2ff9a7[_0x070e('0x2d')][_0x070e('0x34')]);_0x36a689[_0x070e('0x37')]=qs[_0x070e('0x35')](_[_0x070e('0x58')](_0x2ff9a7['query'],_0x214bea['filters']));_0x36a689[_0x070e('0x37')]['CampaignId']=_0xdb8036['id'];if(_0x2ff9a7[_0x070e('0x2d')][_0x070e('0x36')]){_0x36a689['where']=_[_0x070e('0x39')](_0x36a689['where'],{'$or':_[_0x070e('0x29')](_0x36a689[_0x070e('0x2e')],function(_0xa4ca5d){var _0x362def={};_0x362def[_0xa4ca5d]={'$like':'%'+_0x2ff9a7[_0x070e('0x2d')][_0x070e('0x36')]+'%'};return _0x362def;})});}_0x36a689=_['merge']({},_0x36a689,_0x2ff9a7[_0x070e('0x43')]);return db[_0x070e('0x5e')]['count']({'where':_0x36a689['where']})[_0x070e('0x20')](function(_0x8e9b5c){_0x46d83e[_0x070e('0x3b')]=_0x8e9b5c;if(_0x2ff9a7[_0x070e('0x2d')][_0x070e('0x3c')]){_0x36a689[_0x070e('0x42')]=[{'all':!![]}];}return db[_0x070e('0x5e')][_0x070e('0x3d')](_0x36a689);})['then'](function(_0x1deb2a){_0x46d83e[_0x070e('0x55')]=_0x1deb2a;return _0x46d83e;});}})[_0x070e('0x20')](respondWithFilteredResult(_0x59b0c5,_0x36a689))[_0x070e('0x3e')](handleError(_0x59b0c5,null));};exports[_0x070e('0x5f')]=function(_0x301719,_0xe2a5b4,_0x85163b){var _0x522513={};var _0x189c8e={};var _0x1f1501;var _0x40532a;return db[_0x070e('0x3a')][_0x070e('0x56')]({'where':{'id':_0x301719[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0xe2a5b4,null))[_0x070e('0x20')](function(_0x3d0cd2){if(_0x3d0cd2){_0x1f1501=_0x3d0cd2;_0x189c8e[_0x070e('0x2c')]=_['keys'](db['CmList'][_0x070e('0x41')]);_0x189c8e[_0x070e('0x2d')]=_[_0x070e('0x40')](_0x301719['query']);_0x189c8e[_0x070e('0x35')]=_[_0x070e('0x2f')](_0x189c8e['model'],_0x189c8e[_0x070e('0x2d')]);_0x522513[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x189c8e[_0x070e('0x2c')],qs[_0x070e('0x30')](_0x301719[_0x070e('0x2d')]['fields']));_0x522513['attributes']=_0x522513[_0x070e('0x2e')][_0x070e('0x31')]?_0x522513['attributes']:_0x189c8e[_0x070e('0x2c')];_0x522513[_0x070e('0x33')]=qs[_0x070e('0x34')](_0x301719[_0x070e('0x2d')][_0x070e('0x34')]);_0x522513[_0x070e('0x37')]=qs['filters'](_[_0x070e('0x58')](_0x301719[_0x070e('0x2d')],_0x189c8e['filters']));if(_0x301719[_0x070e('0x2d')][_0x070e('0x36')]){_0x522513[_0x070e('0x37')]=_[_0x070e('0x39')](_0x522513['where'],{'$or':_['map'](_0x522513[_0x070e('0x2e')],function(_0x210e92){var _0x2ad143={};_0x2ad143[_0x210e92]={'$like':'%'+_0x301719[_0x070e('0x2d')][_0x070e('0x36')]+'%'};return _0x2ad143;})});}_0x522513=_[_0x070e('0x39')]({},_0x522513,_0x301719[_0x070e('0x43')]);return _0x1f1501[_0x070e('0x5f')](_0x522513);}})[_0x070e('0x20')](function(_0x29a42c){if(_0x29a42c){_0x40532a=_0x29a42c['length'];if(!_0x301719[_0x070e('0x2d')][_0x070e('0x32')](_0x070e('0x5c'))){_0x522513[_0x070e('0x19')]=qs['limit'](_0x301719[_0x070e('0x2d')][_0x070e('0x19')]);_0x522513['offset']=qs['offset'](_0x301719[_0x070e('0x2d')][_0x070e('0x18')]);}return _0x1f1501[_0x070e('0x5f')](_0x522513);}})['then'](function(_0xa40cbd){if(_0xa40cbd){return _0xa40cbd?{'count':_0x40532a,'rows':_0xa40cbd}:null;}})[_0x070e('0x20')](respondWithResult(_0xe2a5b4,null))[_0x070e('0x3e')](handleError(_0xe2a5b4,null));};exports[_0x070e('0x60')]=function(_0x34b5ae,_0x5605da,_0x271bb9){var _0x28b6fe,_0x51d71d;return db[_0x070e('0x3a')]['find']({'where':{'id':_0x34b5ae['params']['id']}})['then'](handleEntityNotFound(_0x5605da,null))[_0x070e('0x20')](function(_0x15ef48){if(_0x15ef48){_0x51d71d=_0x15ef48;return _0x15ef48[_0x070e('0x60')](_0x34b5ae[_0x070e('0x46')]['ids'],_[_0x070e('0x4f')](_0x34b5ae[_0x070e('0x46')],['ids','id'])||{});}return null;})[_0x070e('0x61')](function(_0xa9694a){var _0x24448e;_0x28b6fe=_0xa9694a||[];var _0x41afe5=[];if(_0xa9694a){for(var _0x4ea0a6=0x0;_0x4ea0a6<_0xa9694a[_0x070e('0x31')];_0x4ea0a6+=0x1){var _0x50fbb4=_0xa9694a[_0x4ea0a6][_0x070e('0x22')]({'plain':!![]});_0x51d71d['dialCheckDuplicateType']=_0x34b5ae[_0x070e('0x46')][_0x070e('0x62')]?_0x34b5ae[_0x070e('0x46')]['dialCheckDuplicateType']:_0x51d71d[_0x070e('0x62')];switch(_0x51d71d[_0x070e('0x62')]){case _0x070e('0x63'):_0x24448e=squel['insert']()[_0x070e('0x64')](_0x070e('0x65'))['fromQuery']([_0x070e('0x66'),_0x070e('0x67'),'ContactId','ListId','CampaignId','createdAt',_0x070e('0x50')],squel[_0x070e('0x68')]()[_0x070e('0x69')](_0x070e('0x66'),_0x070e('0x66'))[_0x070e('0x69')](_0x070e('0x6a'),_0x070e('0x67'))['field']('id','ContactId')['field'](_0x50fbb4['CmListId'][_0x070e('0x6b')](),_0x070e('0x6c'))[_0x070e('0x69')](_0x34b5ae[_0x070e('0x4e')]['id'][_0x070e('0x6b')](),'CampaignId')['field'](_0x070e('0x6a'),_0x070e('0x51'))['field'](_0x070e('0x6a'),_0x070e('0x50'))[_0x070e('0x6d')](_0x070e('0x6e'))[_0x070e('0x37')](_0x070e('0x6f'))['where'](_0x070e('0x70'),_0x50fbb4[_0x070e('0x71')][_0x070e('0x6b')]())['where'](_0x070e('0x72'))[_0x070e('0x37')](_0x070e('0x73'),squel[_0x070e('0x68')]()['field'](_0x070e('0x74'))[_0x070e('0x6d')]('cm_hopper_final')[_0x070e('0x37')](_0x070e('0x75'),_0x34b5ae['params']['id'][_0x070e('0x6b')]()))['where'](_0x070e('0x73'),squel['select']()[_0x070e('0x69')]('COALESCE(phone,\x27\x27)')['from'](_0x070e('0x65'))['where']('CampaignId\x20=\x20?',_0x34b5ae[_0x070e('0x4e')]['id'][_0x070e('0x6b')]())))[_0x070e('0x6b')]();break;case _0x070e('0x76'):_0x24448e=squel[_0x070e('0x77')]()['into'](_0x070e('0x65'))[_0x070e('0x78')]([_0x070e('0x66'),_0x070e('0x67'),_0x070e('0x79'),_0x070e('0x6c'),'CampaignId',_0x070e('0x51'),_0x070e('0x50')],squel[_0x070e('0x68')]()[_0x070e('0x69')]('phone','phone')[_0x070e('0x69')](_0x070e('0x6a'),_0x070e('0x67'))[_0x070e('0x69')]('id',_0x070e('0x79'))[_0x070e('0x69')](_0x50fbb4['CmListId'][_0x070e('0x6b')](),_0x070e('0x6c'))[_0x070e('0x69')](_0x34b5ae[_0x070e('0x4e')]['id'][_0x070e('0x6b')](),_0x070e('0x59'))['field']('NOW()',_0x070e('0x51'))[_0x070e('0x69')](_0x070e('0x6a'),_0x070e('0x50'))[_0x070e('0x6d')](_0x070e('0x6e'))[_0x070e('0x37')]('deletedAt\x20IS\x20NULL')[_0x070e('0x37')]('ListId\x20=\x20?',_0x50fbb4[_0x070e('0x71')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x070e('0x37')](_0x070e('0x73'),squel[_0x070e('0x68')]()[_0x070e('0x69')](_0x070e('0x7a'))[_0x070e('0x6d')](_0x070e('0x65'))[_0x070e('0x37')](_0x070e('0x75'),_0x34b5ae['params']['id'][_0x070e('0x6b')]())))[_0x070e('0x6b')]();break;default:_0x24448e=squel[_0x070e('0x77')]()[_0x070e('0x64')](_0x070e('0x65'))[_0x070e('0x78')]([_0x070e('0x66'),_0x070e('0x67'),_0x070e('0x79'),'ListId','CampaignId',_0x070e('0x51'),_0x070e('0x50')],squel['select']()[_0x070e('0x69')]('phone','phone')[_0x070e('0x69')](_0x070e('0x6a'),'scheduledAt')[_0x070e('0x69')]('id',_0x070e('0x79'))[_0x070e('0x69')](_0x50fbb4['CmListId']['toString'](),_0x070e('0x6c'))[_0x070e('0x69')](_0x34b5ae[_0x070e('0x4e')]['id']['toString'](),_0x070e('0x59'))[_0x070e('0x69')]('NOW()',_0x070e('0x51'))[_0x070e('0x69')](_0x070e('0x6a'),_0x070e('0x50'))[_0x070e('0x6d')](_0x070e('0x6e'))[_0x070e('0x37')](_0x070e('0x6f'))[_0x070e('0x37')](_0x070e('0x70'),_0x50fbb4[_0x070e('0x71')][_0x070e('0x6b')]())[_0x070e('0x37')](_0x070e('0x72')))[_0x070e('0x6b')]();}_0x41afe5[_0x070e('0x7b')](db[_0x070e('0x7c')]['query'](_0x24448e));}return BPromise['all'](_0x41afe5);}})['then'](function(){return _0x28b6fe;})['then'](respondWithResult(_0x5605da,null))[_0x070e('0x3e')](handleError(_0x5605da,null));};exports[_0x070e('0x7d')]=function(_0x19a31f,_0x4f89d2,_0x558482){return db[_0x070e('0x3a')][_0x070e('0x44')]({'where':{'id':_0x19a31f['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x4f89d2,null))[_0x070e('0x20')](function(_0x7dd27c){if(_0x7dd27c){return _0x7dd27c[_0x070e('0x7d')](_0x19a31f['query'][_0x070e('0x7e')]);}})[_0x070e('0x20')](function(_0x4717de){if(_0x4717de){return db['CmHopper'][_0x070e('0x21')]({'where':{'ListId':_0x19a31f[_0x070e('0x2d')][_0x070e('0x7e')],'CampaignId':_0x19a31f[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](function(){return _0x4717de;});}})[_0x070e('0x20')](respondWithStatusCode(_0x4f89d2,null))[_0x070e('0x3e')](handleError(_0x4f89d2,null));};exports[_0x070e('0x7f')]=function(_0x8819d7,_0x5e56e8,_0x485e4d){var _0x276c34={'raw':!![],'where':{}};var _0x57909a={};var _0x4fc9db={'count':0x0,'rows':[]};return db[_0x070e('0x3a')][_0x070e('0x56')]({'where':{'id':_0x8819d7[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x5e56e8,null))[_0x070e('0x20')](function(_0x3470ec){if(_0x3470ec){_0x57909a['model']=_[_0x070e('0x40')](db[_0x070e('0x80')][_0x070e('0x41')]);_0x57909a[_0x070e('0x2d')]=_['keys'](_0x8819d7[_0x070e('0x2d')]);_0x57909a['filters']=_[_0x070e('0x2f')](_0x57909a[_0x070e('0x2c')],_0x57909a[_0x070e('0x2d')]);_0x276c34[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x57909a[_0x070e('0x2c')],qs[_0x070e('0x30')](_0x8819d7[_0x070e('0x2d')][_0x070e('0x30')]));_0x276c34['attributes']=_0x276c34[_0x070e('0x2e')][_0x070e('0x31')]?_0x276c34[_0x070e('0x2e')]:_0x57909a[_0x070e('0x2c')];if(!_0x8819d7[_0x070e('0x2d')][_0x070e('0x32')](_0x070e('0x5c'))){_0x276c34[_0x070e('0x19')]=qs['limit'](_0x8819d7[_0x070e('0x2d')][_0x070e('0x19')]);_0x276c34['offset']=qs['offset'](_0x8819d7[_0x070e('0x2d')][_0x070e('0x18')]);}_0x276c34[_0x070e('0x33')]=qs[_0x070e('0x34')](_0x8819d7[_0x070e('0x2d')][_0x070e('0x34')]);_0x276c34['where']=qs['filters'](_[_0x070e('0x58')](_0x8819d7[_0x070e('0x2d')],_0x57909a['filters']));_0x276c34[_0x070e('0x37')]['CampaignId']=_0x3470ec['id'];if(_0x8819d7[_0x070e('0x2d')][_0x070e('0x36')]){_0x276c34['where']=_[_0x070e('0x39')](_0x276c34[_0x070e('0x37')],{'$or':_['map'](_0x276c34['attributes'],function(_0x2b42e8){var _0x486fb3={};_0x486fb3[_0x2b42e8]={'$like':'%'+_0x8819d7[_0x070e('0x2d')][_0x070e('0x36')]+'%'};return _0x486fb3;})});}_0x276c34=_[_0x070e('0x39')]({},_0x276c34,_0x8819d7['options']);return db[_0x070e('0x80')][_0x070e('0x3b')]({'where':_0x276c34['where']})[_0x070e('0x20')](function(_0x19a689){_0x4fc9db[_0x070e('0x3b')]=_0x19a689;if(_0x8819d7[_0x070e('0x2d')][_0x070e('0x3c')]){_0x276c34[_0x070e('0x42')]=[{'all':!![]}];}return db[_0x070e('0x80')][_0x070e('0x3d')](_0x276c34);})[_0x070e('0x20')](function(_0x26eff3){_0x4fc9db['rows']=_0x26eff3;return _0x4fc9db;});}})[_0x070e('0x20')](respondWithFilteredResult(_0x5e56e8,_0x276c34))[_0x070e('0x3e')](handleError(_0x5e56e8,null));};exports[_0x070e('0x81')]=function(_0x52d89d,_0x595531,_0x343c14){var _0x35dc2e,_0x1cbccc;return db[_0x070e('0x3a')]['find']({'where':{'id':_0x52d89d[_0x070e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x595531,null))['then'](function(_0x1a1851){if(_0x1a1851){_0x1cbccc=_0x1a1851;return _0x1a1851['addBlackLists'](_0x52d89d[_0x070e('0x46')][_0x070e('0x7e')],_[_0x070e('0x4f')](_0x52d89d[_0x070e('0x46')],['ids','id'])||{});}return null;})[_0x070e('0x61')](function(_0x532c79){var _0x10ec1a;_0x35dc2e=_0x532c79||[];var _0x31aff5=[];if(_0x532c79){for(var _0x45d6b6=0x0;_0x45d6b6<_0x532c79[_0x070e('0x31')];_0x45d6b6+=0x1){var _0x475774=_0x532c79[_0x45d6b6][_0x070e('0x22')]({'plain':!![]});_0x10ec1a=squel[_0x070e('0x77')]()[_0x070e('0x64')](_0x070e('0x82'))[_0x070e('0x78')]([_0x070e('0x66'),_0x070e('0x79'),_0x070e('0x6c'),_0x070e('0x59'),_0x070e('0x51'),_0x070e('0x50')],squel['select']()['field'](_0x070e('0x66'),_0x070e('0x66'))['field']('id',_0x070e('0x79'))[_0x070e('0x69')](_0x475774['CmListId'][_0x070e('0x6b')](),_0x070e('0x6c'))['field'](_0x52d89d[_0x070e('0x4e')]['id'][_0x070e('0x6b')](),_0x070e('0x59'))[_0x070e('0x69')](_0x070e('0x6a'),_0x070e('0x51'))['field'](_0x070e('0x6a'),_0x070e('0x50'))[_0x070e('0x6d')]('cm_contacts')[_0x070e('0x37')](_0x070e('0x6f'))[_0x070e('0x37')](_0x070e('0x70'),_0x475774['CmListId']['toString']())[_0x070e('0x37')](_0x070e('0x72')))[_0x070e('0x6b')]();_0x31aff5[_0x070e('0x7b')](db[_0x070e('0x7c')][_0x070e('0x2d')](_0x10ec1a));}return BPromise[_0x070e('0x83')](_0x31aff5);}})['then'](function(){return _0x35dc2e;})[_0x070e('0x20')](respondWithResult(_0x595531,null))[_0x070e('0x3e')](handleError(_0x595531,null));};exports[_0x070e('0x84')]=function(_0x172aa1,_0x47165e,_0xd9becc){return db[_0x070e('0x3a')][_0x070e('0x44')]({'where':{'id':_0x172aa1[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x47165e,null))[_0x070e('0x20')](function(_0x340a7a){if(_0x340a7a){return _0x340a7a[_0x070e('0x84')](_0x172aa1[_0x070e('0x2d')][_0x070e('0x7e')]);}})['then'](function(_0x3ae484){if(_0x3ae484){return db[_0x070e('0x5e')][_0x070e('0x21')]({'where':{'ListId':_0x172aa1[_0x070e('0x2d')][_0x070e('0x7e')],'CampaignId':_0x172aa1[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](function(){return _0x3ae484;});}})['then'](respondWithStatusCode(_0x47165e,null))[_0x070e('0x3e')](handleError(_0x47165e,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 272baf1..00bd565 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 _0x57bc=['request-promise','rimraf','../../config/environment','./campaign.attributes','exports','define','Campaign','lodash','util','../../config/logger','api','moment'];(function(_0x29eb10,_0x190cb3){var _0x5371a2=function(_0x3109ea){while(--_0x3109ea){_0x29eb10['push'](_0x29eb10['shift']());}};_0x5371a2(++_0x190cb3);}(_0x57bc,0x1ab));var _0xc57b=function(_0x387ddf,_0x3066bc){_0x387ddf=_0x387ddf-0x0;var _0x3f503e=_0x57bc[_0x387ddf];return _0x3f503e;};'use strict';var _=require(_0xc57b('0x0'));var util=require(_0xc57b('0x1'));var logger=require(_0xc57b('0x2'))(_0xc57b('0x3'));var moment=require(_0xc57b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc57b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc57b('0x6'));var config=require(_0xc57b('0x7'));var attributes=require(_0xc57b('0x8'));module[_0xc57b('0x9')]=function(_0x19af9c,_0x4f1c7a){return _0x19af9c[_0xc57b('0xa')](_0xc57b('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7079=['path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7079,0x1b5));var _0x9707=function(_0x4d3a01,_0x387b59){_0x4d3a01=_0x4d3a01-0x0;var _0x1ea963=_0x7079[_0x4d3a01];return _0x1ea963;};'use strict';var _=require(_0x9707('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9707('0x1'));var rp=require(_0x9707('0x2'));var fs=require('fs');var path=require(_0x9707('0x3'));var rimraf=require(_0x9707('0x4'));var config=require(_0x9707('0x5'));var attributes=require(_0x9707('0x6'));module[_0x9707('0x7')]=function(_0x43103c,_0x38121a){return _0x43103c['define'](_0x9707('0x8'),attributes,{'tableName':_0x9707('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index a44543a..b81d09c 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x28ca56,_0xa566e5){var _0x411b7d=function(_0x3e50f2){while(--_0x3e50f2){_0x28ca56['push'](_0x28ca56['shift']());}};_0x411b7d(++_0xa566e5);}(_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']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file +var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4567be,_0x471824){var _0x49adac=function(_0x1b76b1){while(--_0x1b76b1){_0x4567be['push'](_0x4567be['shift']());}};_0x49adac(++_0x471824);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index decf369..af17e9a 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 _0x5f61=['../../config/environment','./campaign.controller','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','get','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x55decc,_0x112aa4){var _0x10ec8a=function(_0x4b50c2){while(--_0x4b50c2){_0x55decc['push'](_0x55decc['shift']());}};_0x10ec8a(++_0x112aa4);}(_0x5f61,0xac));var _0x15f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f61[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x15f6('0x0'));var util=require(_0x15f6('0x1'));var path=require(_0x15f6('0x2'));var timeout=require(_0x15f6('0x3'));var express=require(_0x15f6('0x4'));var router=express[_0x15f6('0x5')]();var auth=require(_0x15f6('0x6'));var interaction=require(_0x15f6('0x7'));var config=require(_0x15f6('0x8'));var controller=require(_0x15f6('0x9'));router['get']('/',auth[_0x15f6('0xa')](),controller[_0x15f6('0xb')]);router['get'](_0x15f6('0xc'),auth[_0x15f6('0xa')](),controller[_0x15f6('0xd')]);router['get'](_0x15f6('0xe'),auth[_0x15f6('0xa')](),controller[_0x15f6('0xf')]);router[_0x15f6('0x10')](_0x15f6('0x11'),auth[_0x15f6('0xa')](),controller[_0x15f6('0x12')]);router[_0x15f6('0x10')]('/:id/hopper_finals',auth[_0x15f6('0xa')](),controller['getHopperFinals']);router[_0x15f6('0x10')](_0x15f6('0x13'),auth[_0x15f6('0xa')](),controller[_0x15f6('0x14')]);router[_0x15f6('0x10')](_0x15f6('0x15'),auth['isAuthenticated'](),controller[_0x15f6('0x16')]);router[_0x15f6('0x10')](_0x15f6('0x17'),auth[_0x15f6('0xa')](),controller['getBlackLists']);router[_0x15f6('0x18')]('/',auth[_0x15f6('0xa')](),controller[_0x15f6('0x19')]);router[_0x15f6('0x18')](_0x15f6('0x1a'),auth[_0x15f6('0xa')](),controller[_0x15f6('0x1b')]);router['post']('/:id/lists',auth[_0x15f6('0xa')](),controller[_0x15f6('0x1c')]);router[_0x15f6('0x18')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x15f6('0x1d')]);router[_0x15f6('0x1e')](_0x15f6('0xc'),auth[_0x15f6('0xa')](),controller[_0x15f6('0x1f')]);router[_0x15f6('0x20')]('/:id',auth[_0x15f6('0xa')](),controller[_0x15f6('0x21')]);router['delete'](_0x15f6('0x15'),auth[_0x15f6('0xa')](),controller['removeLists']);router[_0x15f6('0x20')](_0x15f6('0x17'),auth[_0x15f6('0xa')](),controller[_0x15f6('0x22')]);module[_0x15f6('0x23')]=router; \ No newline at end of file +var _0x292c=['getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','addLists','put','update','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x292c,0xbb));var _0xc292=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x292c[_0x5c2e5e];return _0x46a5da;};'use strict';var multer=require(_0xc292('0x0'));var util=require(_0xc292('0x1'));var path=require(_0xc292('0x2'));var timeout=require(_0xc292('0x3'));var express=require(_0xc292('0x4'));var router=express[_0xc292('0x5')]();var auth=require(_0xc292('0x6'));var interaction=require(_0xc292('0x7'));var config=require(_0xc292('0x8'));var controller=require('./campaign.controller');router[_0xc292('0x9')]('/',auth[_0xc292('0xa')](),controller[_0xc292('0xb')]);router[_0xc292('0x9')](_0xc292('0xc'),auth[_0xc292('0xa')](),controller[_0xc292('0xd')]);router[_0xc292('0x9')](_0xc292('0xe'),auth[_0xc292('0xa')](),controller[_0xc292('0xf')]);router[_0xc292('0x9')](_0xc292('0x10'),auth[_0xc292('0xa')](),controller[_0xc292('0x11')]);router[_0xc292('0x9')]('/:id/hopper_finals',auth[_0xc292('0xa')](),controller[_0xc292('0x12')]);router[_0xc292('0x9')](_0xc292('0x13'),auth['isAuthenticated'](),controller[_0xc292('0x14')]);router[_0xc292('0x9')]('/:id/lists',auth[_0xc292('0xa')](),controller[_0xc292('0x15')]);router['get'](_0xc292('0x16'),auth[_0xc292('0xa')](),controller[_0xc292('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc292('0x18')]);router[_0xc292('0x19')](_0xc292('0x1a'),auth[_0xc292('0xa')](),controller['clone']);router[_0xc292('0x19')]('/:id/lists',auth[_0xc292('0xa')](),controller[_0xc292('0x1b')]);router[_0xc292('0x19')](_0xc292('0x16'),auth[_0xc292('0xa')](),controller['addBlackLists']);router[_0xc292('0x1c')]('/:id',auth[_0xc292('0xa')](),controller[_0xc292('0x1d')]);router[_0xc292('0x1e')](_0xc292('0xc'),auth[_0xc292('0xa')](),controller[_0xc292('0x1f')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0xc292('0x20')]);router[_0xc292('0x1e')]('/:id/blacklists',auth[_0xc292('0xa')](),controller['removeBlackLists']);module[_0xc292('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 86a45de..4ce4fad 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 _0x0056=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x39320c,_0x602fb7){var _0x981280=function(_0x447d8e){while(--_0x447d8e){_0x39320c['push'](_0x39320c['shift']());}};_0x981280(++_0x602fb7);}(_0x0056,0x99));var _0x6005=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x0056[_0x1ebc6c];return _0x3a826d;};'use strict';var Sequelize=require(_0x6005('0x0'));module[_0x6005('0x1')]={'key':{'type':Sequelize[_0x6005('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x6005('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x6005('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6005('0x4')](_0x6005('0x5'));}}}; \ No newline at end of file +var _0x0796=['VIRTUAL','getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x39124a,_0x2503a4){var _0x1dd690=function(_0x2d01ff){while(--_0x2d01ff){_0x39124a['push'](_0x39124a['shift']());}};_0x1dd690(++_0x2503a4);}(_0x0796,0xf1));var _0x6079=function(_0x18af82,_0x3efd97){_0x18af82=_0x18af82-0x0;var _0x485ffd=_0x0796[_0x18af82];return _0x485ffd;};'use strict';var Sequelize=require(_0x6079('0x0'));module[_0x6079('0x1')]={'key':{'type':Sequelize[_0x6079('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x6079('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x6079('0x2')]},'name':{'type':Sequelize[_0x6079('0x4')],'get':function(){return this[_0x6079('0x5')](_0x6079('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 656bd2a..a05f3a2 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','sendStatus','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x46afbf,_0x3a4129){var _0x14340b=function(_0x468f8b){while(--_0x468f8b){_0x46afbf['push'](_0x46afbf['shift']());}};_0x14340b(++_0x3a4129);}(_0x34e8,0x12c));var _0x834e=function(_0x2b0e25,_0x227de5){_0x2b0e25=_0x2b0e25-0x0;var _0x112c15=_0x34e8[_0x2b0e25];return _0x112c15;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];function respondWithStatusCode(_0x538bb3,_0x5e5b6d){_0x5e5b6d=_0x5e5b6d||0xcc;return function(_0x6cd9b9){if(_0x6cd9b9){return _0x538bb3['sendStatus'](_0x5e5b6d);}return _0x538bb3[_0x834e('0x1d')](_0x5e5b6d)[_0x834e('0x1e')]();};}function respondWithResult(_0x28e659,_0x21cc0a){_0x21cc0a=_0x21cc0a||0xc8;return function(_0x50e860){if(_0x50e860){return _0x28e659[_0x834e('0x1d')](_0x21cc0a)[_0x834e('0x1f')](_0x50e860);}};}function respondWithFilteredResult(_0x57274a,_0x316205){return function(_0x4a9cdc){if(_0x4a9cdc){var _0x38a8cd=_0x4a9cdc[_0x834e('0x20')],_0x36d443=_0x316205[_0x834e('0x21')],_0x478afe=_0x316205['offset']+_0x316205[_0x834e('0x22')],_0x43ac41;if(_0x478afe>=_0x38a8cd){_0x478afe=_0x38a8cd;_0x43ac41=0xc8;}else{_0x43ac41=0xce;}_0x57274a[_0x834e('0x1d')](_0x43ac41);return _0x57274a[_0x834e('0x23')](_0x834e('0x24'),_0x36d443+'-'+_0x478afe+'/'+_0x38a8cd)[_0x834e('0x1f')](_0x4a9cdc);}return null;};}function patchUpdates(_0x254677){return function(_0x1dd214){try{jsonpatch['apply'](_0x1dd214,_0x254677,!![]);}catch(_0x2545b4){return BPromise[_0x834e('0x25')](_0x2545b4);}return _0x1dd214[_0x834e('0x26')]();};}function saveUpdates(_0x325a99,_0x4ab05d){return function(_0x45a630){if(_0x45a630){return _0x45a630[_0x834e('0x27')](_0x325a99)['then'](function(_0x1b4bdf){return _0x1b4bdf;});}return null;};}function removeEntity(_0x28d687,_0x8d406e){return function(_0x5c55ca){if(_0x5c55ca){return _0x5c55ca['destroy']()[_0x834e('0x28')](function(){var _0x34563b=_0x5c55ca['get']({'plain':!![]});var _0x25ee1d=_0x834e('0x29');return db['UserProfileResource'][_0x834e('0x2a')]({'where':{'type':_0x25ee1d,'resourceId':_0x34563b['id']}})[_0x834e('0x28')](function(){return _0x5c55ca;});})[_0x834e('0x28')](function(){_0x28d687['status'](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x3e310f[_0x834e('0x2b')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x2c')](_0x3f1b0b[_0x834e('0x2d')]);if(_0x3f1b0b[_0x834e('0x2e')]){delete _0x3f1b0b[_0x834e('0x2e')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={},_0x106d6a={},_0x5dacc1={'count':0x0,'rows':[]};var _0xb5bc06=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x4551f5){return{'name':_0x4551f5[_0x834e('0x32')],'type':_0x4551f5[_0x834e('0x33')][_0x834e('0x34')]};});_0x106d6a[_0x834e('0x35')]=_['map'](_0xb5bc06,_0x834e('0x2e'));_0x106d6a['query']=_[_0x834e('0x36')](_0x58c1d7[_0x834e('0x37')]);_0x106d6a[_0x834e('0x38')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],_0x106d6a[_0x834e('0x37')]);_0x567cea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x58c1d7['query'][_0x834e('0x3b')]));_0x567cea[_0x834e('0x3a')]=_0x567cea[_0x834e('0x3a')][_0x834e('0x3c')]?_0x567cea['attributes']:_0x106d6a[_0x834e('0x35')];if(!_0x58c1d7[_0x834e('0x37')]['hasOwnProperty']('nolimit')){_0x567cea['limit']=qs[_0x834e('0x22')](_0x58c1d7[_0x834e('0x37')][_0x834e('0x22')]);_0x567cea[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x58c1d7[_0x834e('0x37')]['offset']);}_0x567cea[_0x834e('0x3d')]=qs['sort'](_0x58c1d7[_0x834e('0x37')][_0x834e('0x3e')]);_0x567cea['where']=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x58c1d7['query'],_0x106d6a['filters']));if(_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]){_0x567cea[_0x834e('0x41')]=_[_0x834e('0x42')](_0x567cea[_0x834e('0x41')],{'$or':_['map'](_0xb5bc06,function(_0x1c5ed6){if(_0x1c5ed6['type']!=='VIRTUAL'){var _0x1b2edf={};_0x1b2edf[_0x1c5ed6['name']]={'$like':'%'+_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x1b2edf;}})});}_0x567cea=_[_0x834e('0x42')]({},_0x567cea,_0x58c1d7[_0x834e('0x43')]);var _0x2b7933={'where':_0x567cea['where']};return db[_0x834e('0x30')][_0x834e('0x20')](_0x2b7933)[_0x834e('0x28')](function(_0x58c5fb){_0x5dacc1[_0x834e('0x20')]=_0x58c5fb;if(_0x58c1d7[_0x834e('0x37')]['includeAll']){_0x567cea[_0x834e('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x834e('0x45')](_0x567cea);})[_0x834e('0x28')](function(_0x4a18bb){_0x5dacc1['rows']=_0x4a18bb;return _0x5dacc1;})[_0x834e('0x28')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x46')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x47')]=function(_0xbc1571,_0x8ad264){var _0x23feea={'raw':!![],'where':{'id':_0xbc1571['params']['id']}},_0x195204={};_0x195204[_0x834e('0x35')]=_['keys'](db[_0x834e('0x30')]['rawAttributes']);_0x195204[_0x834e('0x37')]=_['keys'](_0xbc1571[_0x834e('0x37')]);_0x195204[_0x834e('0x38')]=_['intersection'](_0x195204[_0x834e('0x35')],_0x195204[_0x834e('0x37')]);_0x23feea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x195204[_0x834e('0x35')],qs[_0x834e('0x3b')](_0xbc1571[_0x834e('0x37')][_0x834e('0x3b')]));_0x23feea[_0x834e('0x3a')]=_0x23feea[_0x834e('0x3a')]['length']?_0x23feea[_0x834e('0x3a')]:_0x195204[_0x834e('0x35')];if(_0xbc1571['query'][_0x834e('0x48')]){_0x23feea[_0x834e('0x44')]=[{'all':!![]}];}_0x23feea=_[_0x834e('0x42')]({},_0x23feea,_0xbc1571[_0x834e('0x43')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x23feea)['then'](handleEntityNotFound(_0x8ad264,null))['then'](respondWithResult(_0x8ad264,null))[_0x834e('0x46')](handleError(_0x8ad264,null));};exports[_0x834e('0x27')]=function(_0x30568e,_0x40ff5a){if(_0x30568e[_0x834e('0x4a')]['id']){delete _0x30568e[_0x834e('0x4a')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x30568e[_0x834e('0x4b')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x40ff5a,null))[_0x834e('0x28')](saveUpdates(_0x30568e[_0x834e('0x4a')],null))[_0x834e('0x28')](respondWithResult(_0x40ff5a,null))[_0x834e('0x46')](handleError(_0x40ff5a,null));};exports[_0x834e('0x2a')]=function(_0x1a3855,_0x3df078){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1a3855[_0x834e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3df078,null))[_0x834e('0x28')](removeEntity(_0x3df078,null))[_0x834e('0x46')](handleError(_0x3df078,null));};exports['create']=function(_0x3c00a3,_0x3b0988){var _0x55d491={'key':_0x3c00a3[_0x834e('0x4a')][_0x834e('0x34')]};if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')]){_0x55d491[_0x834e('0x4c')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')];}else if(_0x3c00a3['body'][_0x834e('0x4d')]){_0x55d491[_0x834e('0x4d')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4d')];}else if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4e')]){_0x55d491[_0x834e('0x4e')]=_0x3c00a3[_0x834e('0x4a')]['OpenchannelAccountId'];}else if(_0x3c00a3[_0x834e('0x4a')]['ChatWebsiteId']){_0x55d491[_0x834e('0x4f')]=_0x3c00a3['body'][_0x834e('0x4f')];}return db['CannedAnswer']['find']({'where':_0x55d491})[_0x834e('0x28')](function(_0x3e1bee){if(_0x3e1bee){throw new db['Sequelize']['ValidationError'](_0x834e('0x50'));}return db[_0x834e('0x30')][_0x834e('0x51')](_0x3c00a3[_0x834e('0x4a')]);})[_0x834e('0x28')](function(_0x315858){var _0x3d3f2b=_0x3c00a3[_0x834e('0x52')]['get']({'plain':!![]});if(!_0x3d3f2b)throw new Error(_0x834e('0x53'));if(_0x3d3f2b[_0x834e('0x54')]==='user'){var _0x281342=_0x315858['get']({'plain':!![]});return db[_0x834e('0x55')][_0x834e('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x3d3f2b[_0x834e('0x56')]},'raw':!![]})[_0x834e('0x28')](function(_0x2de29a){if(_0x2de29a&&_0x2de29a[_0x834e('0x57')]===0x0){return db['UserProfileResource'][_0x834e('0x51')]({'name':_0x281342[_0x834e('0x2e')],'resourceId':_0x281342['id'],'type':_0x2de29a[_0x834e('0x2e')],'sectionId':_0x2de29a['id']},{})['then'](function(){return _0x315858;});}else{return _0x315858;}})[_0x834e('0x46')](function(_0x1fcae9){logger[_0x834e('0x2c')](_0x834e('0x58'),_0x1fcae9);throw _0x1fcae9;});}return _0x315858;})[_0x834e('0x28')](respondWithResult(_0x3b0988,0xc9))[_0x834e('0x46')](handleError(_0x3b0988,null));}; \ No newline at end of file +var _0x9957=['limit','set','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','CannedAnswer','count','include','catch','show','params','keys','length','includeAll','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x242580,_0x1c32b8){var _0x1f67d0=function(_0x2c5c33){while(--_0x2c5c33){_0x242580['push'](_0x242580['shift']());}};_0x1f67d0(++_0x1c32b8);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){var _0x32a09a=_0x460924[_0x7995('0x26')]({'plain':!![]});var _0x204507=_0x7995('0x27');return db[_0x7995('0x28')][_0x7995('0x25')]({'where':{'type':_0x204507,'resourceId':_0x32a09a['id']}})[_0x7995('0x24')](function(){return _0x460924;});})[_0x7995('0x24')](function(){_0x350fd9['status'](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1a')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x29')]);if(_0x47625f[_0x7995('0x2a')]){delete _0x47625f[_0x7995('0x2a')];}_0x2a307e[_0x7995('0x1b')](_0x56691a)[_0x7995('0x2b')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['CannedAnswer'][_0x7995('0x2c')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2d')],'type':_0xe6b0b3[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x3250e0[_0x7995('0x30')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x31')]=_['keys'](_0x9b2a15[_0x7995('0x31')]);_0x3250e0[_0x7995('0x32')]=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],_0x3250e0[_0x7995('0x31')]);_0x456a28['attributes']=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x34')]=_0x456a28[_0x7995('0x34')]['length']?_0x456a28[_0x7995('0x34')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x31')][_0x7995('0x35')](_0x7995('0x36'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x31')]['limit']);_0x456a28['offset']=qs[_0x7995('0x1e')](_0x9b2a15[_0x7995('0x31')]['offset']);}_0x456a28[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x9b2a15[_0x7995('0x31')][_0x7995('0x38')]);_0x456a28[_0x7995('0x39')]=qs['filters'](_[_0x7995('0x3a')](_0x9b2a15[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]));if(_0x9b2a15[_0x7995('0x31')]['filter']){_0x456a28[_0x7995('0x39')]=_[_0x7995('0x3b')](_0x456a28[_0x7995('0x39')],{'$or':_[_0x7995('0x3c')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2e')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2a')]]={'$like':'%'+_0x9b2a15[_0x7995('0x31')][_0x7995('0x3d')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3b')]({},_0x456a28,_0x9b2a15[_0x7995('0x3e')]);var _0x14d638={'where':_0x456a28[_0x7995('0x39')]};return db[_0x7995('0x3f')][_0x7995('0x40')](_0x14d638)[_0x7995('0x24')](function(_0x270d52){_0x4253e5[_0x7995('0x40')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x3f')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x42')](handleError(_0x514445,null));};exports[_0x7995('0x43')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':!![],'where':{'id':_0x35c8ff[_0x7995('0x44')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x3f')][_0x7995('0x2c')]);_0x5e85b9[_0x7995('0x31')]=_[_0x7995('0x45')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x33')](_0x5e85b9[_0x7995('0x30')],_0x5e85b9[_0x7995('0x31')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x30')],qs['fields'](_0x35c8ff[_0x7995('0x31')]['fields']));_0x46ac4f[_0x7995('0x34')]=_0x46ac4f['attributes'][_0x7995('0x46')]?_0x46ac4f[_0x7995('0x34')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x31')][_0x7995('0x47')]){_0x46ac4f[_0x7995('0x41')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3b')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x3f')][_0x7995('0x48')](_0x46ac4f)[_0x7995('0x24')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x42')](handleError(_0x576b96,null));};exports[_0x7995('0x49')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x4a')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x4a')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x42')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3f')]['find']({'where':{'id':_0xddf537[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x4b')]=function(_0x1fe77e,_0x12d4b8){var _0x47d1d8={'key':_0x1fe77e['body']['key']};if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')]){_0x47d1d8['MailAccountId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')];}else if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4d')]){_0x47d1d8[_0x7995('0x4d')]=_0x1fe77e['body'][_0x7995('0x4d')];}else if(_0x1fe77e['body'][_0x7995('0x4e')]){_0x47d1d8[_0x7995('0x4e')]=_0x1fe77e[_0x7995('0x4a')]['OpenchannelAccountId'];}else if(_0x1fe77e['body']['ChatWebsiteId']){_0x47d1d8['ChatWebsiteId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4f')];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':_0x47d1d8})[_0x7995('0x24')](function(_0x357e60){if(_0x357e60){throw new db[(_0x7995('0x50'))][(_0x7995('0x51'))](_0x7995('0x52'));}return db[_0x7995('0x3f')][_0x7995('0x4b')](_0x1fe77e[_0x7995('0x4a')]);})[_0x7995('0x24')](function(_0x35bea3){var _0x1ea1dc=_0x1fe77e[_0x7995('0x53')][_0x7995('0x26')]({'plain':!![]});if(!_0x1ea1dc)throw new Error(_0x7995('0x54'));if(_0x1ea1dc[_0x7995('0x55')]==='user'){var _0x56a374=_0x35bea3[_0x7995('0x26')]({'plain':!![]});return db[_0x7995('0x56')][_0x7995('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x1ea1dc['userProfileId']},'raw':!![]})[_0x7995('0x24')](function(_0x197b52){if(_0x197b52&&_0x197b52[_0x7995('0x57')]===0x0){return db[_0x7995('0x28')]['create']({'name':_0x56a374[_0x7995('0x2a')],'resourceId':_0x56a374['id'],'type':_0x197b52[_0x7995('0x2a')],'sectionId':_0x197b52['id']},{})[_0x7995('0x24')](function(){return _0x35bea3;});}else{return _0x35bea3;}})[_0x7995('0x42')](function(_0x502d43){logger['error'](_0x7995('0x58'),_0x502d43);throw _0x502d43;});}return _0x35bea3;})[_0x7995('0x24')](respondWithResult(_0x12d4b8,0xc9))[_0x7995('0x42')](handleError(_0x12d4b8,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 0d2c1fe..87f4dbb 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 _0xf323=['define','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xf323,0x1c6));var _0x3f32=function(_0x59b874,_0x25aa7b){_0x59b874=_0x59b874-0x0;var _0x16b59c=_0xf323[_0x59b874];return _0x16b59c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f32('0x0'))(_0x3f32('0x1'));var moment=require('moment');var BPromise=require(_0x3f32('0x2'));var rp=require(_0x3f32('0x3'));var fs=require('fs');var path=require(_0x3f32('0x4'));var rimraf=require(_0x3f32('0x5'));var config=require(_0x3f32('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x3f32('0x7')]=function(_0x2b4488,_0xf8ca8b){return _0x2b4488[_0x3f32('0x8')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f32('0x9'),'collate':_0x3f32('0xa')});}; \ No newline at end of file +var _0x1ef8=['CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x1d9a48,_0x49eb71){var _0x5be3f2=function(_0x41177d){while(--_0x41177d){_0x1d9a48['push'](_0x1d9a48['shift']());}};_0x5be3f2(++_0x49eb71);}(_0x1ef8,0xd5));var _0x81ef=function(_0x34824d,_0x2e997a){_0x34824d=_0x34824d-0x0;var _0x3f5dcd=_0x1ef8[_0x34824d];return _0x3f5dcd;};'use strict';var _=require(_0x81ef('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x81ef('0x1'));var rp=require(_0x81ef('0x2'));var fs=require('fs');var path=require(_0x81ef('0x3'));var rimraf=require(_0x81ef('0x4'));var config=require(_0x81ef('0x5'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x4a92ea,_0x4486ec){return _0x4a92ea[_0x81ef('0x6')](_0x81ef('0x7'),attributes,{'tableName':_0x81ef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x81ef('0x9')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 43d7702..f6a3c52 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 _0xacde=['client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5911c4,_0x2f1777){var _0x1f7316=function(_0x5e0f1a){while(--_0x5e0f1a){_0x5911c4['push'](_0x5911c4['shift']());}};_0x1f7316(++_0x2f1777);}(_0xacde,0x9e));var _0xeacd=function(_0x514e38,_0x18958d){_0x514e38=_0x514e38-0x0;var _0x57305d=_0xacde[_0x514e38];return _0x57305d;};'use strict';var _=require(_0xeacd('0x0'));var util=require(_0xeacd('0x1'));var moment=require(_0xeacd('0x2'));var BPromise=require(_0xeacd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeacd('0x4'));var db=require(_0xeacd('0x5'))['db'];var utils=require(_0xeacd('0x6'));var logger=require('../../config/logger')(_0xeacd('0x7'));var config=require(_0xeacd('0x8'));var jayson=require(_0xeacd('0x9'));var client=jayson[_0xeacd('0xa')][_0xeacd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c2f6d,_0x4c6001,_0x4ca4c2){return new BPromise(function(_0x388fc8,_0x454546){return client[_0xeacd('0xc')](_0x4c2f6d,_0x4ca4c2)[_0xeacd('0xd')](function(_0x264ab1){logger[_0xeacd('0xe')](_0xeacd('0xf'),_0x4c6001,_0xeacd('0x10'));logger[_0xeacd('0x11')](_0xeacd('0x12'),_0x4c6001,'request\x20sent',JSON[_0xeacd('0x13')](_0x264ab1));if(_0x264ab1[_0xeacd('0x14')]){if(_0x264ab1[_0xeacd('0x14')][_0xeacd('0x15')]===0x1f4){logger[_0xeacd('0x14')](_0xeacd('0xf'),_0x4c6001,_0x264ab1[_0xeacd('0x14')]['message']);return _0x454546(_0x264ab1[_0xeacd('0x14')][_0xeacd('0x16')]);}logger[_0xeacd('0x14')]('CannedAnswer,\x20%s,\x20%s',_0x4c6001,_0x264ab1['error'][_0xeacd('0x16')]);return _0x388fc8(_0x264ab1[_0xeacd('0x14')][_0xeacd('0x16')]);}else{logger[_0xeacd('0xe')](_0xeacd('0xf'),_0x4c6001,'request\x20sent');_0x388fc8(_0x264ab1['result'][_0xeacd('0x16')]);}})[_0xeacd('0x17')](function(_0x4d3f3b){logger[_0xeacd('0x14')](_0xeacd('0xf'),_0x4c6001,_0x4d3f3b);_0x454546(_0x4d3f3b);});});} \ No newline at end of file +var _0xadf5=['error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xc123cb,_0x5f065){var _0x3d202e=function(_0x1ac215){while(--_0x1ac215){_0xc123cb['push'](_0xc123cb['shift']());}};_0x3d202e(++_0x5f065);}(_0xadf5,0x9f));var _0x5adf=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0xadf5[_0x3a9661];return _0x5bb119;};'use strict';var _=require('lodash');var util=require(_0x5adf('0x0'));var moment=require(_0x5adf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5adf('0x2'));var db=require(_0x5adf('0x3'))['db'];var utils=require(_0x5adf('0x4'));var logger=require(_0x5adf('0x5'))('rpc');var config=require(_0x5adf('0x6'));var jayson=require(_0x5adf('0x7'));var client=jayson[_0x5adf('0x8')][_0x5adf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52a585,_0x225245,_0x423c8b){return new BPromise(function(_0x378973,_0x49388f){return client['request'](_0x52a585,_0x423c8b)[_0x5adf('0xa')](function(_0x175f16){logger[_0x5adf('0xb')](_0x5adf('0xc'),_0x225245,_0x5adf('0xd'));logger[_0x5adf('0xe')](_0x5adf('0xf'),_0x225245,_0x5adf('0xd'),JSON[_0x5adf('0x10')](_0x175f16));if(_0x175f16[_0x5adf('0x11')]){if(_0x175f16[_0x5adf('0x11')][_0x5adf('0x12')]===0x1f4){logger['error'](_0x5adf('0xc'),_0x225245,_0x175f16[_0x5adf('0x11')][_0x5adf('0x13')]);return _0x49388f(_0x175f16[_0x5adf('0x11')][_0x5adf('0x13')]);}logger['error']('CannedAnswer,\x20%s,\x20%s',_0x225245,_0x175f16['error'][_0x5adf('0x13')]);return _0x378973(_0x175f16[_0x5adf('0x11')]['message']);}else{logger[_0x5adf('0xb')]('CannedAnswer,\x20%s,\x20%s',_0x225245,'request\x20sent');_0x378973(_0x175f16[_0x5adf('0x14')]['message']);}})[_0x5adf('0x15')](function(_0x510f27){logger['error'](_0x5adf('0xc'),_0x225245,_0x510f27);_0x49388f(_0x510f27);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 1f6be7e..e4ccdc4 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 _0xadd2=['../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4d21d0,_0x36bc51){var _0x1414eb=function(_0x11e85f){while(--_0x11e85f){_0x4d21d0['push'](_0x4d21d0['shift']());}};_0x1414eb(++_0x36bc51);}(_0xadd2,0xa5));var _0x2add=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xadd2[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2add('0x0'));var timeout=require('connect-timeout');var express=require(_0x2add('0x1'));var router=express[_0x2add('0x2')]();var auth=require(_0x2add('0x3'));var interaction=require(_0x2add('0x4'));var config=require(_0x2add('0x5'));var controller=require(_0x2add('0x6'));router[_0x2add('0x7')]('/',auth[_0x2add('0x8')](),controller[_0x2add('0x9')]);router['get']('/:id',auth[_0x2add('0x8')](),controller[_0x2add('0xa')]);router[_0x2add('0xb')]('/',auth[_0x2add('0x8')](),controller['create']);router[_0x2add('0xc')](_0x2add('0xd'),auth[_0x2add('0x8')](),controller[_0x2add('0xe')]);router[_0x2add('0xf')](_0x2add('0xd'),auth[_0x2add('0x8')](),controller[_0x2add('0x10')]);module['exports']=router; \ No newline at end of file +var _0xae0e=['../../components/interaction/service','isAuthenticated','index','get','/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x901be1,_0x50855c){var _0x59bde4=function(_0x3a0d52){while(--_0x3a0d52){_0x901be1['push'](_0x901be1['shift']());}};_0x59bde4(++_0x50855c);}(_0xae0e,0xb9));var _0xeae0=function(_0x597005,_0xf66af4){_0x597005=_0x597005-0x0;var _0x439490=_0xae0e[_0x597005];return _0x439490;};'use strict';var multer=require(_0xeae0('0x0'));var util=require(_0xeae0('0x1'));var path=require(_0xeae0('0x2'));var timeout=require(_0xeae0('0x3'));var express=require(_0xeae0('0x4'));var router=express[_0xeae0('0x5')]();var auth=require(_0xeae0('0x6'));var interaction=require(_0xeae0('0x7'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xeae0('0x8')](),controller[_0xeae0('0x9')]);router[_0xeae0('0xa')](_0xeae0('0xb'),auth[_0xeae0('0x8')](),controller[_0xeae0('0xc')]);router['post']('/',auth[_0xeae0('0x8')](),controller['create']);router[_0xeae0('0xd')]('/:id',auth[_0xeae0('0x8')](),controller[_0xeae0('0xe')]);router['delete']('/:id',auth[_0xeae0('0x8')](),controller[_0xeae0('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 4f43332..b126484 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 _0xb0c0=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x18feb8,_0x3f9ff5){var _0xd52687=function(_0x2191a7){while(--_0x2191a7){_0x18feb8['push'](_0x18feb8['shift']());}};_0xd52687(++_0x3f9ff5);}(_0xb0c0,0x133));var _0x0b0c=function(_0x2f0357,_0x56009b){_0x2f0357=_0x2f0357-0x0;var _0x40999c=_0xb0c0[_0x2f0357];return _0x40999c;};'use strict';var Sequelize=require(_0x0b0c('0x0'));module[_0x0b0c('0x1')]={'calldate':{'type':Sequelize[_0x0b0c('0x2')],'allowNull':![],'defaultValue':_0x0b0c('0x3')},'clid':{'type':Sequelize[_0x0b0c('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0b0c('0x4')]},'channel':{'type':Sequelize[_0x0b0c('0x4')]},'dstchannel':{'type':Sequelize[_0x0b0c('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0b0c('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0b0c('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0b0c('0x4')]},'amaflags':{'type':Sequelize[_0x0b0c('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0b0c('0x4')]},'userfield':{'type':Sequelize[_0x0b0c('0x4')]},'uniqueid':{'type':Sequelize[_0x0b0c('0x4')]},'linkedid':{'type':Sequelize[_0x0b0c('0x4')]},'sequence':{'type':Sequelize[_0x0b0c('0x4')]},'peeraccount':{'type':Sequelize[_0x0b0c('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x62ba=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x502ec7,_0x8e99b3){var _0x362b0f=function(_0x379598){while(--_0x379598){_0x502ec7['push'](_0x502ec7['shift']());}};_0x362b0f(++_0x8e99b3);}(_0x62ba,0xdc));var _0xa62b=function(_0x351a91,_0x1b45f6){_0x351a91=_0x351a91-0x0;var _0x430dd3=_0x62ba[_0x351a91];return _0x430dd3;};'use strict';var Sequelize=require(_0xa62b('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xa62b('0x1')],'allowNull':![],'defaultValue':_0xa62b('0x2')},'clid':{'type':Sequelize[_0xa62b('0x3')]},'src':{'type':Sequelize[_0xa62b('0x3')]},'dst':{'type':Sequelize[_0xa62b('0x3')]},'dcontext':{'type':Sequelize[_0xa62b('0x3')]},'channel':{'type':Sequelize[_0xa62b('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xa62b('0x3')]},'duration':{'type':Sequelize[_0xa62b('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa62b('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xa62b('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa62b('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa62b('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xa62b('0x3')]},'type':{'type':Sequelize[_0xa62b('0x3')]},'tag':{'type':Sequelize[_0xa62b('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e0bd58d..6f61558 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 _0x7a9b=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','update','then','destroy','sendStatus','error','stack','name','send','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x730b14,_0x1dc798){var _0x550065=function(_0x51e14c){while(--_0x51e14c){_0x730b14['push'](_0x730b14['shift']());}};_0x550065(++_0x1dc798);}(_0x7a9b,0xd2));var _0xb7a9=function(_0x41cb72,_0x2a0be9){_0x41cb72=_0x41cb72-0x0;var _0x59f630=_0x7a9b[_0x41cb72];return _0x59f630;};'use strict';var pdf=require(_0xb7a9('0x0'));var emlformat=require(_0xb7a9('0x1'));var rimraf=require(_0xb7a9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb7a9('0x3'));var BPromise=require(_0xb7a9('0x4'));var Mustache=require(_0xb7a9('0x5'));var util=require(_0xb7a9('0x6'));var path=require(_0xb7a9('0x7'));var sox=require(_0xb7a9('0x8'));var csv=require(_0xb7a9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb7a9('0xa'));var squel=require(_0xb7a9('0xb'));var crypto=require(_0xb7a9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb7a9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb7a9('0xe'));var Papa=require(_0xb7a9('0xf'));var Redis=require('ioredis');var authService=require(_0xb7a9('0x10'));var qs=require(_0xb7a9('0x11'));var as=require(_0xb7a9('0x12'));var hardwareService=require(_0xb7a9('0x13'));var logger=require(_0xb7a9('0x14'))(_0xb7a9('0x15'));var utils=require(_0xb7a9('0x16'));var config=require(_0xb7a9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x453bcf,_0x125a57){_0x125a57=_0x125a57||0xcc;return function(_0xdfbafe){if(_0xdfbafe){return _0x453bcf['sendStatus'](_0x125a57);}return _0x453bcf[_0xb7a9('0x18')](_0x125a57)[_0xb7a9('0x19')]();};}function respondWithResult(_0x2bc596,_0x329539){_0x329539=_0x329539||0xc8;return function(_0x10fcc6){if(_0x10fcc6){return _0x2bc596[_0xb7a9('0x18')](_0x329539)[_0xb7a9('0x1a')](_0x10fcc6);}};}function respondWithFilteredResult(_0x2e38b0,_0x55af69){return function(_0x2fa5ed){if(_0x2fa5ed){var _0x14ca18=_0x2fa5ed[_0xb7a9('0x1b')],_0x3deb42=_0x55af69[_0xb7a9('0x1c')],_0x20f2d9=_0x55af69['offset']+_0x55af69[_0xb7a9('0x1d')],_0x4b0f9f;if(_0x20f2d9>=_0x14ca18){_0x20f2d9=_0x14ca18;_0x4b0f9f=0xc8;}else{_0x4b0f9f=0xce;}_0x2e38b0[_0xb7a9('0x18')](_0x4b0f9f);return _0x2e38b0[_0xb7a9('0x1e')]('Content-Range',_0x3deb42+'-'+_0x20f2d9+'/'+_0x14ca18)['json'](_0x2fa5ed);}return null;};}function patchUpdates(_0x225a79){return function(_0x11c858){try{jsonpatch['apply'](_0x11c858,_0x225a79,!![]);}catch(_0x2d3570){return BPromise['reject'](_0x2d3570);}return _0x11c858['save']();};}function saveUpdates(_0x18bd12,_0x1fc64e){return function(_0xfc6bb7){if(_0xfc6bb7){return _0xfc6bb7[_0xb7a9('0x1f')](_0x18bd12)[_0xb7a9('0x20')](function(_0x485273){return _0x485273;});}return null;};}function removeEntity(_0x2e9b65,_0x1163cc){return function(_0x51d05c){if(_0x51d05c){return _0x51d05c[_0xb7a9('0x21')]()[_0xb7a9('0x20')](function(){_0x2e9b65['status'](0xcc)[_0xb7a9('0x19')]();});}};}function handleEntityNotFound(_0x59566c,_0x4ed155){return function(_0x5cb651){if(!_0x5cb651){_0x59566c[_0xb7a9('0x22')](0x194);}return _0x5cb651;};}function handleError(_0x234fd8,_0xa56bb4){_0xa56bb4=_0xa56bb4||0x1f4;return function(_0x1b8f7c){logger[_0xb7a9('0x23')](_0x1b8f7c[_0xb7a9('0x24')]);if(_0x1b8f7c[_0xb7a9('0x25')]){delete _0x1b8f7c['name'];}_0x234fd8['status'](_0xa56bb4)[_0xb7a9('0x26')](_0x1b8f7c);};}exports[_0xb7a9('0x27')]=function(_0x435275,_0x2a7065){var _0x50b0c3={},_0x180395={},_0x4c18dd={'count':0x0,'rows':[]};var _0x361391=_[_0xb7a9('0x28')](db[_0xb7a9('0x29')][_0xb7a9('0x2a')],function(_0x498720){return{'name':_0x498720['fieldName'],'type':_0x498720[_0xb7a9('0x2b')][_0xb7a9('0x2c')]};});_0x180395[_0xb7a9('0x2d')]=_[_0xb7a9('0x28')](_0x361391,_0xb7a9('0x25'));_0x180395[_0xb7a9('0x2e')]=_[_0xb7a9('0x2f')](_0x435275['query']);_0x180395[_0xb7a9('0x30')]=_[_0xb7a9('0x31')](_0x180395[_0xb7a9('0x2d')],_0x180395[_0xb7a9('0x2e')]);_0x50b0c3[_0xb7a9('0x32')]=_[_0xb7a9('0x31')](_0x180395['model'],qs[_0xb7a9('0x33')](_0x435275[_0xb7a9('0x2e')][_0xb7a9('0x33')]));_0x50b0c3[_0xb7a9('0x32')]=_0x50b0c3[_0xb7a9('0x32')][_0xb7a9('0x34')]?_0x50b0c3['attributes']:_0x180395[_0xb7a9('0x2d')];if(!_0x435275[_0xb7a9('0x2e')][_0xb7a9('0x35')](_0xb7a9('0x36'))){_0x50b0c3[_0xb7a9('0x1d')]=qs[_0xb7a9('0x1d')](_0x435275[_0xb7a9('0x2e')][_0xb7a9('0x1d')]);_0x50b0c3['offset']=qs[_0xb7a9('0x1c')](_0x435275[_0xb7a9('0x2e')][_0xb7a9('0x1c')]);}_0x50b0c3[_0xb7a9('0x37')]=qs[_0xb7a9('0x38')](_0x435275[_0xb7a9('0x2e')][_0xb7a9('0x38')]);_0x50b0c3[_0xb7a9('0x39')]=qs[_0xb7a9('0x30')](_[_0xb7a9('0x3a')](_0x435275[_0xb7a9('0x2e')],_0x180395['filters']));if(_0x435275[_0xb7a9('0x2e')][_0xb7a9('0x3b')]){_0x50b0c3[_0xb7a9('0x39')]=_[_0xb7a9('0x3c')](_0x50b0c3[_0xb7a9('0x39')],{'$or':_[_0xb7a9('0x28')](_0x361391,function(_0x39180e){if(_0x39180e['type']!==_0xb7a9('0x3d')){var _0x2c9542={};_0x2c9542[_0x39180e[_0xb7a9('0x25')]]={'$like':'%'+_0x435275[_0xb7a9('0x2e')][_0xb7a9('0x3b')]+'%'};return _0x2c9542;}})});}_0x50b0c3=_[_0xb7a9('0x3c')]({},_0x50b0c3,_0x435275[_0xb7a9('0x3e')]);var _0x36c8b5={'where':_0x50b0c3['where']};return db[_0xb7a9('0x29')]['count'](_0x36c8b5)[_0xb7a9('0x20')](function(_0x330ecd){_0x4c18dd[_0xb7a9('0x1b')]=_0x330ecd;if(_0x435275['query'][_0xb7a9('0x3f')]){_0x50b0c3[_0xb7a9('0x40')]=[{'all':!![]}];}return db[_0xb7a9('0x29')][_0xb7a9('0x41')](_0x50b0c3);})[_0xb7a9('0x20')](function(_0x231e53){_0x4c18dd[_0xb7a9('0x42')]=_0x231e53;return _0x4c18dd;})[_0xb7a9('0x20')](respondWithFilteredResult(_0x2a7065,_0x50b0c3))[_0xb7a9('0x43')](handleError(_0x2a7065,null));};exports[_0xb7a9('0x44')]=function(_0x308073,_0x12a82b){var _0x3667dc={'raw':!![],'where':{'id':_0x308073[_0xb7a9('0x45')]['id']}},_0x55c125={};_0x55c125['model']=_[_0xb7a9('0x2f')](db[_0xb7a9('0x29')][_0xb7a9('0x2a')]);_0x55c125[_0xb7a9('0x2e')]=_[_0xb7a9('0x2f')](_0x308073[_0xb7a9('0x2e')]);_0x55c125[_0xb7a9('0x30')]=_[_0xb7a9('0x31')](_0x55c125[_0xb7a9('0x2d')],_0x55c125['query']);_0x3667dc[_0xb7a9('0x32')]=_['intersection'](_0x55c125[_0xb7a9('0x2d')],qs['fields'](_0x308073[_0xb7a9('0x2e')][_0xb7a9('0x33')]));_0x3667dc[_0xb7a9('0x32')]=_0x3667dc[_0xb7a9('0x32')]['length']?_0x3667dc[_0xb7a9('0x32')]:_0x55c125['model'];if(_0x308073[_0xb7a9('0x2e')][_0xb7a9('0x3f')]){_0x3667dc[_0xb7a9('0x40')]=[{'all':!![]}];}_0x3667dc=_[_0xb7a9('0x3c')]({},_0x3667dc,_0x308073[_0xb7a9('0x3e')]);return db['Cdr']['find'](_0x3667dc)[_0xb7a9('0x20')](handleEntityNotFound(_0x12a82b,null))[_0xb7a9('0x20')](respondWithResult(_0x12a82b,null))[_0xb7a9('0x43')](handleError(_0x12a82b,null));};exports[_0xb7a9('0x46')]=function(_0x29cef7,_0x1f6373){return db['Cdr'][_0xb7a9('0x46')](_0x29cef7['body'],{})[_0xb7a9('0x20')](respondWithResult(_0x1f6373,0xc9))['catch'](handleError(_0x1f6373,null));};exports[_0xb7a9('0x1f')]=function(_0x2b0073,_0x29a620){if(_0x2b0073[_0xb7a9('0x47')]['id']){delete _0x2b0073[_0xb7a9('0x47')]['id'];}return db['Cdr'][_0xb7a9('0x48')]({'where':{'id':_0x2b0073['params']['id']}})[_0xb7a9('0x20')](handleEntityNotFound(_0x29a620,null))[_0xb7a9('0x20')](saveUpdates(_0x2b0073[_0xb7a9('0x47')],null))['then'](respondWithResult(_0x29a620,null))[_0xb7a9('0x43')](handleError(_0x29a620,null));};exports['destroy']=function(_0x5bff9e,_0x28899a){return db[_0xb7a9('0x29')][_0xb7a9('0x48')]({'where':{'id':_0x5bff9e[_0xb7a9('0x45')]['id']}})['then'](handleEntityNotFound(_0x28899a,null))[_0xb7a9('0x20')](removeEntity(_0x28899a,null))[_0xb7a9('0x43')](handleError(_0x28899a,null));};exports[_0xb7a9('0x49')]=function(_0x52e9d7,_0x5cd468){return db[_0xb7a9('0x29')]['describe']()[_0xb7a9('0x20')](respondWithResult(_0x5cd468,null))[_0xb7a9('0x43')](handleError(_0x5cd468,null));}; \ No newline at end of file +var _0x8d59=['filter','map','VIRTUAL','options','then','includeAll','Cdr','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','limit','status','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','index','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','where','pick'];(function(_0x132d36,_0x424e13){var _0x32c547=function(_0x2bf185){while(--_0x2bf185){_0x132d36['push'](_0x132d36['shift']());}};_0x32c547(++_0x424e13);}(_0x8d59,0xa5));var _0x98d5=function(_0x47322d,_0xd82a24){_0x47322d=_0x47322d-0x0;var _0x113e9e=_0x8d59[_0x47322d];return _0x113e9e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x98d5('0x0'));var rimraf=require(_0x98d5('0x1'));var zipdir=require(_0x98d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98d5('0x3'));var moment=require(_0x98d5('0x4'));var BPromise=require(_0x98d5('0x5'));var Mustache=require('mustache');var util=require(_0x98d5('0x6'));var path=require(_0x98d5('0x7'));var sox=require(_0x98d5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x98d5('0x9'));var squel=require(_0x98d5('0xa'));var crypto=require(_0x98d5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x98d5('0xc'));var toCsv=require(_0x98d5('0xd'));var querystring=require(_0x98d5('0xe'));var Papa=require(_0x98d5('0xf'));var Redis=require(_0x98d5('0x10'));var authService=require(_0x98d5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98d5('0x12'));var logger=require(_0x98d5('0x13'))('api');var utils=require(_0x98d5('0x14'));var config=require(_0x98d5('0x15'));var db=require(_0x98d5('0x16'))['db'];function respondWithStatusCode(_0x455111,_0x4cf63d){_0x4cf63d=_0x4cf63d||0xcc;return function(_0x5af53f){if(_0x5af53f){return _0x455111[_0x98d5('0x17')](_0x4cf63d);}return _0x455111['status'](_0x4cf63d)[_0x98d5('0x18')]();};}function respondWithResult(_0x50db3e,_0x4a3e8e){_0x4a3e8e=_0x4a3e8e||0xc8;return function(_0x31a878){if(_0x31a878){return _0x50db3e['status'](_0x4a3e8e)['json'](_0x31a878);}};}function respondWithFilteredResult(_0x19310b,_0x362123){return function(_0x25fe09){if(_0x25fe09){var _0x5b998f=_0x25fe09[_0x98d5('0x19')],_0x59b487=_0x362123['offset'],_0x5289aa=_0x362123['offset']+_0x362123[_0x98d5('0x1a')],_0x51c314;if(_0x5289aa>=_0x5b998f){_0x5289aa=_0x5b998f;_0x51c314=0xc8;}else{_0x51c314=0xce;}_0x19310b[_0x98d5('0x1b')](_0x51c314);return _0x19310b[_0x98d5('0x1c')](_0x98d5('0x1d'),_0x59b487+'-'+_0x5289aa+'/'+_0x5b998f)[_0x98d5('0x1e')](_0x25fe09);}return null;};}function patchUpdates(_0x553e81){return function(_0xa56c82){try{jsonpatch[_0x98d5('0x1f')](_0xa56c82,_0x553e81,!![]);}catch(_0x4e36f8){return BPromise[_0x98d5('0x20')](_0x4e36f8);}return _0xa56c82[_0x98d5('0x21')]();};}function saveUpdates(_0x4353ed,_0x54df61){return function(_0x392e62){if(_0x392e62){return _0x392e62[_0x98d5('0x22')](_0x4353ed)['then'](function(_0x429170){return _0x429170;});}return null;};}function removeEntity(_0x81b344,_0x2fc183){return function(_0x294300){if(_0x294300){return _0x294300[_0x98d5('0x23')]()['then'](function(){_0x81b344['status'](0xcc)[_0x98d5('0x18')]();});}};}function handleEntityNotFound(_0x12d30d,_0xed61ab){return function(_0x19912e){if(!_0x19912e){_0x12d30d[_0x98d5('0x17')](0x194);}return _0x19912e;};}function handleError(_0x1bd0ef,_0x2bb517){_0x2bb517=_0x2bb517||0x1f4;return function(_0x6b203a){logger[_0x98d5('0x24')](_0x6b203a[_0x98d5('0x25')]);if(_0x6b203a[_0x98d5('0x26')]){delete _0x6b203a[_0x98d5('0x26')];}_0x1bd0ef[_0x98d5('0x1b')](_0x2bb517)['send'](_0x6b203a);};}exports[_0x98d5('0x27')]=function(_0x3b03a7,_0x4bb40f){var _0x1d2a55={},_0x76136e={},_0xa895da={'count':0x0,'rows':[]};var _0x5a7b5a=_['map'](db['Cdr'][_0x98d5('0x28')],function(_0xebc457){return{'name':_0xebc457['fieldName'],'type':_0xebc457[_0x98d5('0x29')][_0x98d5('0x2a')]};});_0x76136e[_0x98d5('0x2b')]=_['map'](_0x5a7b5a,_0x98d5('0x26'));_0x76136e[_0x98d5('0x2c')]=_[_0x98d5('0x2d')](_0x3b03a7[_0x98d5('0x2c')]);_0x76136e[_0x98d5('0x2e')]=_[_0x98d5('0x2f')](_0x76136e[_0x98d5('0x2b')],_0x76136e[_0x98d5('0x2c')]);_0x1d2a55['attributes']=_[_0x98d5('0x2f')](_0x76136e['model'],qs[_0x98d5('0x30')](_0x3b03a7[_0x98d5('0x2c')][_0x98d5('0x30')]));_0x1d2a55[_0x98d5('0x31')]=_0x1d2a55[_0x98d5('0x31')][_0x98d5('0x32')]?_0x1d2a55[_0x98d5('0x31')]:_0x76136e[_0x98d5('0x2b')];if(!_0x3b03a7[_0x98d5('0x2c')][_0x98d5('0x33')](_0x98d5('0x34'))){_0x1d2a55[_0x98d5('0x1a')]=qs[_0x98d5('0x1a')](_0x3b03a7[_0x98d5('0x2c')][_0x98d5('0x1a')]);_0x1d2a55[_0x98d5('0x35')]=qs[_0x98d5('0x35')](_0x3b03a7['query']['offset']);}_0x1d2a55[_0x98d5('0x36')]=qs['sort'](_0x3b03a7[_0x98d5('0x2c')]['sort']);_0x1d2a55[_0x98d5('0x37')]=qs[_0x98d5('0x2e')](_[_0x98d5('0x38')](_0x3b03a7[_0x98d5('0x2c')],_0x76136e[_0x98d5('0x2e')]));if(_0x3b03a7['query'][_0x98d5('0x39')]){_0x1d2a55['where']=_['merge'](_0x1d2a55[_0x98d5('0x37')],{'$or':_[_0x98d5('0x3a')](_0x5a7b5a,function(_0xf1a353){if(_0xf1a353[_0x98d5('0x29')]!==_0x98d5('0x3b')){var _0x41569a={};_0x41569a[_0xf1a353[_0x98d5('0x26')]]={'$like':'%'+_0x3b03a7[_0x98d5('0x2c')][_0x98d5('0x39')]+'%'};return _0x41569a;}})});}_0x1d2a55=_['merge']({},_0x1d2a55,_0x3b03a7[_0x98d5('0x3c')]);var _0x4ea912={'where':_0x1d2a55[_0x98d5('0x37')]};return db['Cdr'][_0x98d5('0x19')](_0x4ea912)[_0x98d5('0x3d')](function(_0x40f8a6){_0xa895da[_0x98d5('0x19')]=_0x40f8a6;if(_0x3b03a7['query'][_0x98d5('0x3e')]){_0x1d2a55['include']=[{'all':!![]}];}return db[_0x98d5('0x3f')][_0x98d5('0x40')](_0x1d2a55);})[_0x98d5('0x3d')](function(_0xf1fd40){_0xa895da[_0x98d5('0x41')]=_0xf1fd40;return _0xa895da;})[_0x98d5('0x3d')](respondWithFilteredResult(_0x4bb40f,_0x1d2a55))[_0x98d5('0x42')](handleError(_0x4bb40f,null));};exports[_0x98d5('0x43')]=function(_0x4f9a79,_0x48f310){var _0x2d2eca={'raw':!![],'where':{'id':_0x4f9a79[_0x98d5('0x44')]['id']}},_0x361a7e={};_0x361a7e[_0x98d5('0x2b')]=_[_0x98d5('0x2d')](db['Cdr'][_0x98d5('0x28')]);_0x361a7e[_0x98d5('0x2c')]=_[_0x98d5('0x2d')](_0x4f9a79[_0x98d5('0x2c')]);_0x361a7e[_0x98d5('0x2e')]=_[_0x98d5('0x2f')](_0x361a7e[_0x98d5('0x2b')],_0x361a7e[_0x98d5('0x2c')]);_0x2d2eca[_0x98d5('0x31')]=_['intersection'](_0x361a7e[_0x98d5('0x2b')],qs[_0x98d5('0x30')](_0x4f9a79[_0x98d5('0x2c')][_0x98d5('0x30')]));_0x2d2eca[_0x98d5('0x31')]=_0x2d2eca[_0x98d5('0x31')][_0x98d5('0x32')]?_0x2d2eca[_0x98d5('0x31')]:_0x361a7e[_0x98d5('0x2b')];if(_0x4f9a79['query'][_0x98d5('0x3e')]){_0x2d2eca[_0x98d5('0x45')]=[{'all':!![]}];}_0x2d2eca=_['merge']({},_0x2d2eca,_0x4f9a79[_0x98d5('0x3c')]);return db[_0x98d5('0x3f')][_0x98d5('0x46')](_0x2d2eca)[_0x98d5('0x3d')](handleEntityNotFound(_0x48f310,null))[_0x98d5('0x3d')](respondWithResult(_0x48f310,null))[_0x98d5('0x42')](handleError(_0x48f310,null));};exports[_0x98d5('0x47')]=function(_0x1387e5,_0xa9c022){return db[_0x98d5('0x3f')][_0x98d5('0x47')](_0x1387e5[_0x98d5('0x48')],{})['then'](respondWithResult(_0xa9c022,0xc9))['catch'](handleError(_0xa9c022,null));};exports[_0x98d5('0x22')]=function(_0x308659,_0x435888){if(_0x308659[_0x98d5('0x48')]['id']){delete _0x308659['body']['id'];}return db[_0x98d5('0x3f')][_0x98d5('0x46')]({'where':{'id':_0x308659[_0x98d5('0x44')]['id']}})[_0x98d5('0x3d')](handleEntityNotFound(_0x435888,null))['then'](saveUpdates(_0x308659[_0x98d5('0x48')],null))[_0x98d5('0x3d')](respondWithResult(_0x435888,null))[_0x98d5('0x42')](handleError(_0x435888,null));};exports['destroy']=function(_0x4f5e8c,_0x41e45){return db[_0x98d5('0x3f')]['find']({'where':{'id':_0x4f5e8c[_0x98d5('0x44')]['id']}})[_0x98d5('0x3d')](handleEntityNotFound(_0x41e45,null))[_0x98d5('0x3d')](removeEntity(_0x41e45,null))[_0x98d5('0x42')](handleError(_0x41e45,null));};exports[_0x98d5('0x49')]=function(_0x4df907,_0x1eaa39){return db['Cdr'][_0x98d5('0x49')]()['then'](respondWithResult(_0x1eaa39,null))[_0x98d5('0x42')](handleError(_0x1eaa39,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 8f1ea4c..5e4fb6c 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 _0xda19=['accountcode','disposition','dst','src','uniqueid','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr'];(function(_0x5a3af7,_0x3efd5b){var _0x37b773=function(_0x133215){while(--_0x133215){_0x5a3af7['push'](_0x5a3af7['shift']());}};_0x37b773(++_0x3efd5b);}(_0xda19,0xd5));var _0x9da1=function(_0x2a754e,_0x90093b){_0x2a754e=_0x2a754e-0x0;var _0x5dd524=_0xda19[_0x2a754e];return _0x5dd524;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['accountcode']},{'name':'calldate','fields':['calldate']},{'name':_0x9da1('0xc'),'fields':['disposition']},{'name':_0x9da1('0xd'),'fields':[_0x9da1('0xd')]},{'name':_0x9da1('0xe'),'fields':[_0x9da1('0xe')]},{'name':_0x9da1('0xf'),'fields':[_0x9da1('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6d38=['uniqueid','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cdr.attributes','define','Cdr','accountcode','calldate','dst'];(function(_0x249b4d,_0x1fdd50){var _0x4eb2b5=function(_0x1f6d24){while(--_0x1f6d24){_0x249b4d['push'](_0x249b4d['shift']());}};_0x4eb2b5(++_0x1fdd50);}(_0x6d38,0x1ef));var _0x86d3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6d38[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));module['exports']=function(_0x2d8272,_0xfbbc15){return _0x2d8272[_0x86d3('0x7')](_0x86d3('0x8'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x86d3('0x9')]},{'name':_0x86d3('0xa'),'fields':[_0x86d3('0xa')]},{'name':'disposition','fields':['disposition']},{'name':_0x86d3('0xb'),'fields':[_0x86d3('0xb')]},{'name':'src','fields':['src']},{'name':_0x86d3('0xc'),'fields':[_0x86d3('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 31920ca..f5bb19e 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 _0x76d8=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x9197d7,_0x7a68c2){var _0x35ce99=function(_0x4ee9d9){while(--_0x4ee9d9){_0x9197d7['push'](_0x9197d7['shift']());}};_0x35ce99(++_0x7a68c2);}(_0x76d8,0x1df));var _0x876d=function(_0x4c71d9,_0x586159){_0x4c71d9=_0x4c71d9-0x0;var _0x22a5bd=_0x76d8[_0x4c71d9];return _0x22a5bd;};'use strict';var _=require(_0x876d('0x0'));var util=require(_0x876d('0x1'));var moment=require(_0x876d('0x2'));var BPromise=require(_0x876d('0x3'));var rs=require(_0x876d('0x4'));var fs=require('fs');var Redis=require(_0x876d('0x5'));var db=require(_0x876d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x876d('0x7'))(_0x876d('0x8'));var config=require(_0x876d('0x9'));var jayson=require(_0x876d('0xa'));var client=jayson[_0x876d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc23a3c,_0x7da468,_0x52e965){return new BPromise(function(_0x41fed6,_0x2d63b1){return client[_0x876d('0xc')](_0xc23a3c,_0x52e965)[_0x876d('0xd')](function(_0x107697){logger[_0x876d('0xe')](_0x876d('0xf'),_0x7da468,'request\x20sent');logger[_0x876d('0x10')](_0x876d('0x11'),_0x7da468,_0x876d('0x12'),JSON[_0x876d('0x13')](_0x107697));if(_0x107697['error']){if(_0x107697[_0x876d('0x14')][_0x876d('0x15')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x7da468,_0x107697['error'][_0x876d('0x16')]);return _0x2d63b1(_0x107697[_0x876d('0x14')][_0x876d('0x16')]);}logger[_0x876d('0x14')](_0x876d('0xf'),_0x7da468,_0x107697['error'][_0x876d('0x16')]);return _0x41fed6(_0x107697['error']['message']);}else{logger[_0x876d('0xe')](_0x876d('0xf'),_0x7da468,_0x876d('0x12'));_0x41fed6(_0x107697[_0x876d('0x17')][_0x876d('0x16')]);}})[_0x876d('0x18')](function(_0x34a020){logger[_0x876d('0x14')](_0x876d('0xf'),_0x7da468,_0x34a020);_0x2d63b1(_0x34a020);});});} \ No newline at end of file +var _0xa06c=['catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x1beb9a,_0x1863ff){var _0x450503=function(_0xb6de35){while(--_0xb6de35){_0x1beb9a['push'](_0x1beb9a['shift']());}};_0x450503(++_0x1863ff);}(_0xa06c,0xa3));var _0xca06=function(_0x1f3975,_0x3564b9){_0x1f3975=_0x1f3975-0x0;var _0x59aca8=_0xa06c[_0x1f3975];return _0x59aca8;};'use strict';var _=require('lodash');var util=require(_0xca06('0x0'));var moment=require(_0xca06('0x1'));var BPromise=require('bluebird');var rs=require(_0xca06('0x2'));var fs=require('fs');var Redis=require(_0xca06('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xca06('0x4'));var logger=require(_0xca06('0x5'))(_0xca06('0x6'));var config=require(_0xca06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xca06('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27ba92,_0x130879,_0x36439c){return new BPromise(function(_0x11ab83,_0x36ce87){return client['request'](_0x27ba92,_0x36439c)['then'](function(_0x490dc3){logger['info'](_0xca06('0x9'),_0x130879,_0xca06('0xa'));logger['debug'](_0xca06('0xb'),_0x130879,_0xca06('0xa'),JSON[_0xca06('0xc')](_0x490dc3));if(_0x490dc3[_0xca06('0xd')]){if(_0x490dc3['error']['code']===0x1f4){logger[_0xca06('0xd')]('Cdr,\x20%s,\x20%s',_0x130879,_0x490dc3[_0xca06('0xd')][_0xca06('0xe')]);return _0x36ce87(_0x490dc3[_0xca06('0xd')][_0xca06('0xe')]);}logger[_0xca06('0xd')]('Cdr,\x20%s,\x20%s',_0x130879,_0x490dc3[_0xca06('0xd')][_0xca06('0xe')]);return _0x11ab83(_0x490dc3[_0xca06('0xd')][_0xca06('0xe')]);}else{logger[_0xca06('0xf')](_0xca06('0x9'),_0x130879,'request\x20sent');_0x11ab83(_0x490dc3[_0xca06('0x10')][_0xca06('0xe')]);}})[_0xca06('0x11')](function(_0x195cc5){logger[_0xca06('0xd')](_0xca06('0x9'),_0x130879,_0x195cc5);_0x36ce87(_0x195cc5);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 851c19c..fbd6c17 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 _0x0ce2=['get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','util','Router','../../components/auth/service','../../config/environment','./cdr.controller'];(function(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0x0ce2,0x1cf));var _0x20ce=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0ce2[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x20ce('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x20ce('0x1')]();var auth=require(_0x20ce('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x20ce('0x3'));var controller=require(_0x20ce('0x4'));router[_0x20ce('0x5')]('/',auth['isAuthenticated'](),controller[_0x20ce('0x6')]);router[_0x20ce('0x5')](_0x20ce('0x7'),auth[_0x20ce('0x8')](),controller[_0x20ce('0x9')]);router['get'](_0x20ce('0xa'),auth[_0x20ce('0x8')](),controller[_0x20ce('0xb')]);router[_0x20ce('0xc')]('/',auth[_0x20ce('0x8')](),controller['create']);router[_0x20ce('0xd')](_0x20ce('0xa'),auth[_0x20ce('0x8')](),controller[_0x20ce('0xe')]);router[_0x20ce('0xf')](_0x20ce('0xa'),auth[_0x20ce('0x8')](),controller[_0x20ce('0x10')]);module[_0x20ce('0x11')]=router; \ No newline at end of file +var _0x185e=['../../components/auth/service','../../components/interaction/service','./cdr.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x7e6630,_0x4a374d){var _0x4c9398=function(_0x20e5be){while(--_0x20e5be){_0x7e6630['push'](_0x7e6630['shift']());}};_0x4c9398(++_0x4a374d);}(_0x185e,0x164));var _0xe185=function(_0x33fa54,_0x749f02){_0x33fa54=_0x33fa54-0x0;var _0x4f517a=_0x185e[_0x33fa54];return _0x4f517a;};'use strict';var multer=require('multer');var util=require(_0xe185('0x0'));var path=require(_0xe185('0x1'));var timeout=require(_0xe185('0x2'));var express=require(_0xe185('0x3'));var router=express[_0xe185('0x4')]();var auth=require(_0xe185('0x5'));var interaction=require(_0xe185('0x6'));var config=require('../../config/environment');var controller=require(_0xe185('0x7'));router[_0xe185('0x8')]('/',auth[_0xe185('0x9')](),controller['index']);router['get'](_0xe185('0xa'),auth[_0xe185('0x9')](),controller[_0xe185('0xb')]);router[_0xe185('0x8')](_0xe185('0xc'),auth[_0xe185('0x9')](),controller['show']);router[_0xe185('0xd')]('/',auth[_0xe185('0x9')](),controller[_0xe185('0xe')]);router[_0xe185('0xf')]('/:id',auth[_0xe185('0x9')](),controller[_0xe185('0x10')]);router[_0xe185('0x11')](_0xe185('0xc'),auth[_0xe185('0x9')](),controller[_0xe185('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 7c52d22..0364a08 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 _0x0dc4=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3542c1,_0x33d626){var _0x2ce6b9=function(_0x584da2){while(--_0x584da2){_0x3542c1['push'](_0x3542c1['shift']());}};_0x2ce6b9(++_0x33d626);}(_0x0dc4,0xbd));var _0x40dc=function(_0x249565,_0x2a026a){_0x249565=_0x249565-0x0;var _0x43dee8=_0x0dc4[_0x249565];return _0x43dee8;};'use strict';var Sequelize=require(_0x40dc('0x0'));module[_0x40dc('0x1')]={'priority':{'type':Sequelize[_0x40dc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x40dc('0x3')],'allowNull':![],'defaultValue':_0x40dc('0x4')},'appdata':{'type':Sequelize[_0x40dc('0x5')]()},'description':{'type':Sequelize[_0x40dc('0x3')]},'interval':{'type':Sequelize[_0x40dc('0x3')],'defaultValue':_0x40dc('0x6')}}; \ No newline at end of file +var _0xabbf=['exports','INTEGER','STRING','noop'];(function(_0x433dd9,_0x536ae7){var _0x2832d2=function(_0x26303f){while(--_0x26303f){_0x433dd9['push'](_0x433dd9['shift']());}};_0x2832d2(++_0x536ae7);}(_0xabbf,0xa0));var _0xfabb=function(_0x26a818,_0x40708a){_0x26a818=_0x26a818-0x0;var _0x5d8ca0=_0xabbf[_0x26a818];return _0x5d8ca0;};'use strict';var Sequelize=require('sequelize');module[_0xfabb('0x0')]={'priority':{'type':Sequelize[_0xfabb('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfabb('0x2')],'allowNull':![],'defaultValue':_0xfabb('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xfabb('0x2')]},'interval':{'type':Sequelize[_0xfabb('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index ff05e4e..9167fc4 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 _0x9c3c=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x13ebfc,_0x4313a6){var _0x3f069e=function(_0x41f472){while(--_0x41f472){_0x13ebfc['push'](_0x13ebfc['shift']());}};_0x3f069e(++_0x4313a6);}(_0x9c3c,0x141));var _0xc9c3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9c3c[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc9c3('0x0'));var rimraf=require(_0xc9c3('0x1'));var zipdir=require(_0xc9c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9c3('0x3'));var moment=require(_0xc9c3('0x4'));var BPromise=require(_0xc9c3('0x5'));var Mustache=require('mustache');var util=require(_0xc9c3('0x6'));var path=require(_0xc9c3('0x7'));var sox=require(_0xc9c3('0x8'));var csv=require(_0xc9c3('0x9'));var ejs=require(_0xc9c3('0xa'));var fs=require('fs');var _=require(_0xc9c3('0xb'));var squel=require(_0xc9c3('0xc'));var crypto=require(_0xc9c3('0xd'));var jsforce=require(_0xc9c3('0xe'));var deskjs=require(_0xc9c3('0xf'));var toCsv=require(_0xc9c3('0x9'));var querystring=require(_0xc9c3('0x10'));var Papa=require(_0xc9c3('0x11'));var Redis=require(_0xc9c3('0x12'));var authService=require(_0xc9c3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc9c3('0x14'));var hardwareService=require(_0xc9c3('0x15'));var logger=require(_0xc9c3('0x16'))('api');var utils=require(_0xc9c3('0x17'));var config=require(_0xc9c3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41daef,_0x1b2ebb){_0x1b2ebb=_0x1b2ebb||0xcc;return function(_0x20df72){if(_0x20df72){return _0x41daef[_0xc9c3('0x19')](_0x1b2ebb);}return _0x41daef['status'](_0x1b2ebb)[_0xc9c3('0x1a')]();};}function respondWithResult(_0x3e427a,_0x96c93e){_0x96c93e=_0x96c93e||0xc8;return function(_0x445445){if(_0x445445){return _0x3e427a[_0xc9c3('0x1b')](_0x96c93e)[_0xc9c3('0x1c')](_0x445445);}};}function respondWithFilteredResult(_0x16b6e3,_0x3007c7){return function(_0xb547a3){if(_0xb547a3){var _0x5df4f3=_0xb547a3['count'],_0x31c1d8=_0x3007c7[_0xc9c3('0x1d')],_0x36d006=_0x3007c7[_0xc9c3('0x1d')]+_0x3007c7[_0xc9c3('0x1e')],_0x2ba5f1;if(_0x36d006>=_0x5df4f3){_0x36d006=_0x5df4f3;_0x2ba5f1=0xc8;}else{_0x2ba5f1=0xce;}_0x16b6e3[_0xc9c3('0x1b')](_0x2ba5f1);return _0x16b6e3[_0xc9c3('0x1f')](_0xc9c3('0x20'),_0x31c1d8+'-'+_0x36d006+'/'+_0x5df4f3)[_0xc9c3('0x1c')](_0xb547a3);}return null;};}function patchUpdates(_0x607a5f){return function(_0x54dfb0){try{jsonpatch[_0xc9c3('0x21')](_0x54dfb0,_0x607a5f,!![]);}catch(_0x2084a1){return BPromise['reject'](_0x2084a1);}return _0x54dfb0['save']();};}function saveUpdates(_0x555bd5,_0xf38ec4){return function(_0x1e7c82){if(_0x1e7c82){return _0x1e7c82[_0xc9c3('0x22')](_0x555bd5)[_0xc9c3('0x23')](function(_0x130e7b){return _0x130e7b;});}return null;};}function removeEntity(_0xfb8509,_0x2c5b14){return function(_0x2c69e9){if(_0x2c69e9){return _0x2c69e9[_0xc9c3('0x24')]()['then'](function(){_0xfb8509[_0xc9c3('0x1b')](0xcc)[_0xc9c3('0x1a')]();});}};}function handleEntityNotFound(_0x437e12,_0x499667){return function(_0x328c00){if(!_0x328c00){_0x437e12[_0xc9c3('0x19')](0x194);}return _0x328c00;};}function handleError(_0x2d47cb,_0x1e4df4){_0x1e4df4=_0x1e4df4||0x1f4;return function(_0x3da179){logger[_0xc9c3('0x25')](_0x3da179[_0xc9c3('0x26')]);if(_0x3da179['name']){delete _0x3da179[_0xc9c3('0x27')];}_0x2d47cb[_0xc9c3('0x1b')](_0x1e4df4)[_0xc9c3('0x28')](_0x3da179);};}exports[_0xc9c3('0x29')]=function(_0x32f3c7,_0x53491b){var _0x259ddc={'raw':!![],'where':{'id':_0x32f3c7[_0xc9c3('0x2a')]['id']}},_0x3180d3={};_0x3180d3[_0xc9c3('0x2b')]=_[_0xc9c3('0x2c')](db[_0xc9c3('0x2d')][_0xc9c3('0x2e')]);_0x3180d3[_0xc9c3('0x2f')]=_['keys'](_0x32f3c7['query']);_0x3180d3['filters']=_[_0xc9c3('0x30')](_0x3180d3['model'],_0x3180d3['query']);_0x259ddc[_0xc9c3('0x31')]=_[_0xc9c3('0x30')](_0x3180d3[_0xc9c3('0x2b')],qs[_0xc9c3('0x32')](_0x32f3c7[_0xc9c3('0x2f')][_0xc9c3('0x32')]));_0x259ddc[_0xc9c3('0x31')]=_0x259ddc[_0xc9c3('0x31')][_0xc9c3('0x33')]?_0x259ddc[_0xc9c3('0x31')]:_0x3180d3['model'];if(_0x32f3c7[_0xc9c3('0x2f')][_0xc9c3('0x34')]){_0x259ddc[_0xc9c3('0x35')]=[{'all':!![]}];}_0x259ddc=_['merge']({},_0x259ddc,_0x32f3c7['options']);return db[_0xc9c3('0x2d')][_0xc9c3('0x36')](_0x259ddc)['then'](handleEntityNotFound(_0x53491b,null))['then'](respondWithResult(_0x53491b,null))[_0xc9c3('0x37')](handleError(_0x53491b,null));};exports[_0xc9c3('0x22')]=function(_0x8a70aa,_0x15ff43){if(_0x8a70aa['body']['id']){delete _0x8a70aa[_0xc9c3('0x38')]['id'];}return db[_0xc9c3('0x2d')]['find']({'where':{'id':_0x8a70aa['params']['id']}})[_0xc9c3('0x23')](handleEntityNotFound(_0x15ff43,null))[_0xc9c3('0x23')](saveUpdates(_0x8a70aa[_0xc9c3('0x38')],null))[_0xc9c3('0x23')](respondWithResult(_0x15ff43,null))[_0xc9c3('0x37')](handleError(_0x15ff43,null));};exports[_0xc9c3('0x24')]=function(_0x42bf6c,_0x1f403e){return db[_0xc9c3('0x2d')][_0xc9c3('0x36')]({'where':{'id':_0x42bf6c[_0xc9c3('0x2a')]['id']}})[_0xc9c3('0x23')](handleEntityNotFound(_0x1f403e,null))['then'](removeEntity(_0x1f403e,null))[_0xc9c3('0x37')](handleError(_0x1f403e,null));}; \ No newline at end of file +var _0x4d9a=['sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','merge','options','ChatApplication','find','then','catch','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path'];(function(_0x507d71,_0x260c61){var _0xa8f225=function(_0x5c602d){while(--_0x5c602d){_0x507d71['push'](_0x507d71['shift']());}};_0xa8f225(++_0x260c61);}(_0x4d9a,0x68));var _0xa4d9=function(_0x9d727a,_0x15cffc){_0x9d727a=_0x9d727a-0x0;var _0x285ea6=_0x4d9a[_0x9d727a];return _0x285ea6;};'use strict';var pdf=require(_0xa4d9('0x0'));var emlformat=require(_0xa4d9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa4d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4d9('0x3'));var moment=require(_0xa4d9('0x4'));var BPromise=require(_0xa4d9('0x5'));var Mustache=require(_0xa4d9('0x6'));var util=require('util');var path=require(_0xa4d9('0x7'));var sox=require(_0xa4d9('0x8'));var csv=require(_0xa4d9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa4d9('0xa'));var squel=require(_0xa4d9('0xb'));var crypto=require(_0xa4d9('0xc'));var jsforce=require(_0xa4d9('0xd'));var deskjs=require(_0xa4d9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa4d9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4d9('0x10'))(_0xa4d9('0x11'));var utils=require(_0xa4d9('0x12'));var config=require(_0xa4d9('0x13'));var db=require(_0xa4d9('0x14'))['db'];function respondWithStatusCode(_0x28363a,_0x3f35b2){_0x3f35b2=_0x3f35b2||0xcc;return function(_0x573bdd){if(_0x573bdd){return _0x28363a['sendStatus'](_0x3f35b2);}return _0x28363a[_0xa4d9('0x15')](_0x3f35b2)[_0xa4d9('0x16')]();};}function respondWithResult(_0x1c6d53,_0x3d89fb){_0x3d89fb=_0x3d89fb||0xc8;return function(_0x4a8284){if(_0x4a8284){return _0x1c6d53[_0xa4d9('0x15')](_0x3d89fb)['json'](_0x4a8284);}};}function respondWithFilteredResult(_0x51e467,_0x4f4049){return function(_0x4c0eb7){if(_0x4c0eb7){var _0x499350=_0x4c0eb7['count'],_0x42b8ca=_0x4f4049['offset'],_0x4df0c2=_0x4f4049[_0xa4d9('0x17')]+_0x4f4049[_0xa4d9('0x18')],_0x476ef2;if(_0x4df0c2>=_0x499350){_0x4df0c2=_0x499350;_0x476ef2=0xc8;}else{_0x476ef2=0xce;}_0x51e467[_0xa4d9('0x15')](_0x476ef2);return _0x51e467[_0xa4d9('0x19')](_0xa4d9('0x1a'),_0x42b8ca+'-'+_0x4df0c2+'/'+_0x499350)[_0xa4d9('0x1b')](_0x4c0eb7);}return null;};}function patchUpdates(_0x4ac871){return function(_0x26e81e){try{jsonpatch[_0xa4d9('0x1c')](_0x26e81e,_0x4ac871,!![]);}catch(_0x30999e){return BPromise[_0xa4d9('0x1d')](_0x30999e);}return _0x26e81e[_0xa4d9('0x1e')]();};}function saveUpdates(_0xd7d95,_0x362f62){return function(_0x19aa77){if(_0x19aa77){return _0x19aa77[_0xa4d9('0x1f')](_0xd7d95)['then'](function(_0x3a2dcd){return _0x3a2dcd;});}return null;};}function removeEntity(_0x219856,_0x26b868){return function(_0x2d2f05){if(_0x2d2f05){return _0x2d2f05[_0xa4d9('0x20')]()['then'](function(){_0x219856['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x831c5,_0x3dc1ad){return function(_0x99739b){if(!_0x99739b){_0x831c5[_0xa4d9('0x21')](0x194);}return _0x99739b;};}function handleError(_0xfcbf74,_0x1a318e){_0x1a318e=_0x1a318e||0x1f4;return function(_0x26b780){logger[_0xa4d9('0x22')](_0x26b780[_0xa4d9('0x23')]);if(_0x26b780[_0xa4d9('0x24')]){delete _0x26b780['name'];}_0xfcbf74['status'](_0x1a318e)['send'](_0x26b780);};}exports[_0xa4d9('0x25')]=function(_0x391218,_0x340b0d){var _0x3c0e45={'raw':!![],'where':{'id':_0x391218[_0xa4d9('0x26')]['id']}},_0x2bdb24={};_0x2bdb24[_0xa4d9('0x27')]=_[_0xa4d9('0x28')](db['ChatApplication'][_0xa4d9('0x29')]);_0x2bdb24[_0xa4d9('0x2a')]=_[_0xa4d9('0x28')](_0x391218[_0xa4d9('0x2a')]);_0x2bdb24[_0xa4d9('0x2b')]=_[_0xa4d9('0x2c')](_0x2bdb24[_0xa4d9('0x27')],_0x2bdb24[_0xa4d9('0x2a')]);_0x3c0e45['attributes']=_['intersection'](_0x2bdb24[_0xa4d9('0x27')],qs[_0xa4d9('0x2d')](_0x391218[_0xa4d9('0x2a')][_0xa4d9('0x2d')]));_0x3c0e45['attributes']=_0x3c0e45[_0xa4d9('0x2e')][_0xa4d9('0x2f')]?_0x3c0e45[_0xa4d9('0x2e')]:_0x2bdb24[_0xa4d9('0x27')];if(_0x391218['query'][_0xa4d9('0x30')]){_0x3c0e45['include']=[{'all':!![]}];}_0x3c0e45=_[_0xa4d9('0x31')]({},_0x3c0e45,_0x391218[_0xa4d9('0x32')]);return db[_0xa4d9('0x33')][_0xa4d9('0x34')](_0x3c0e45)[_0xa4d9('0x35')](handleEntityNotFound(_0x340b0d,null))[_0xa4d9('0x35')](respondWithResult(_0x340b0d,null))[_0xa4d9('0x36')](handleError(_0x340b0d,null));};exports[_0xa4d9('0x1f')]=function(_0xce5458,_0x4e1908){if(_0xce5458[_0xa4d9('0x37')]['id']){delete _0xce5458['body']['id'];}return db[_0xa4d9('0x33')][_0xa4d9('0x34')]({'where':{'id':_0xce5458[_0xa4d9('0x26')]['id']}})[_0xa4d9('0x35')](handleEntityNotFound(_0x4e1908,null))[_0xa4d9('0x35')](saveUpdates(_0xce5458['body'],null))[_0xa4d9('0x35')](respondWithResult(_0x4e1908,null))[_0xa4d9('0x36')](handleError(_0x4e1908,null));};exports[_0xa4d9('0x20')]=function(_0x34de61,_0x44615f){return db[_0xa4d9('0x33')]['find']({'where':{'id':_0x34de61[_0xa4d9('0x26')]['id']}})[_0xa4d9('0x35')](handleEntityNotFound(_0x44615f,null))[_0xa4d9('0x35')](removeEntity(_0x44615f,null))[_0xa4d9('0x36')](handleError(_0x44615f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4efaad1..52053d4 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index b2756e6..6910764 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 _0x891b=['client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2da3fe,_0x55ad2d){var _0x564b34=function(_0x1c0510){while(--_0x1c0510){_0x2da3fe['push'](_0x2da3fe['shift']());}};_0x564b34(++_0x55ad2d);}(_0x891b,0xfe));var _0xb891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x891b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb891('0x0'));var util=require(_0xb891('0x1'));var moment=require(_0xb891('0x2'));var BPromise=require('bluebird');var rs=require(_0xb891('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb891('0x4'))['db'];var utils=require(_0xb891('0x5'));var logger=require(_0xb891('0x6'))(_0xb891('0x7'));var config=require(_0xb891('0x8'));var jayson=require(_0xb891('0x9'));var client=jayson[_0xb891('0xa')][_0xb891('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17f1e8,_0x2c2190,_0x1a1109){return new BPromise(function(_0x387e2c,_0x4776c5){return client[_0xb891('0xc')](_0x17f1e8,_0x1a1109)['then'](function(_0x34847d){logger[_0xb891('0xd')](_0xb891('0xe'),_0x2c2190,_0xb891('0xf'));logger[_0xb891('0x10')](_0xb891('0x11'),_0x2c2190,_0xb891('0xf'),JSON['stringify'](_0x34847d));if(_0x34847d[_0xb891('0x12')]){if(_0x34847d[_0xb891('0x12')][_0xb891('0x13')]===0x1f4){logger[_0xb891('0x12')](_0xb891('0xe'),_0x2c2190,_0x34847d[_0xb891('0x12')][_0xb891('0x14')]);return _0x4776c5(_0x34847d[_0xb891('0x12')]['message']);}logger[_0xb891('0x12')]('ChatApplication,\x20%s,\x20%s',_0x2c2190,_0x34847d[_0xb891('0x12')]['message']);return _0x387e2c(_0x34847d[_0xb891('0x12')][_0xb891('0x14')]);}else{logger[_0xb891('0xd')](_0xb891('0xe'),_0x2c2190,'request\x20sent');_0x387e2c(_0x34847d['result']['message']);}})[_0xb891('0x15')](function(_0x10104f){logger['error']('ChatApplication,\x20%s,\x20%s',_0x2c2190,_0x10104f);_0x4776c5(_0x10104f);});});} \ No newline at end of file +var _0x2a24=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x2a24,0x1c3));var _0x42a2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2a24[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x42a2('0x0'));var util=require(_0x42a2('0x1'));var moment=require(_0x42a2('0x2'));var BPromise=require(_0x42a2('0x3'));var rs=require(_0x42a2('0x4'));var fs=require('fs');var Redis=require(_0x42a2('0x5'));var db=require(_0x42a2('0x6'))['db'];var utils=require(_0x42a2('0x7'));var logger=require(_0x42a2('0x8'))('rpc');var config=require(_0x42a2('0x9'));var jayson=require(_0x42a2('0xa'));var client=jayson[_0x42a2('0xb')][_0x42a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3894e5,_0x1c263a,_0x4d3ed5){return new BPromise(function(_0xaa2992,_0x35f51e){return client[_0x42a2('0xd')](_0x3894e5,_0x4d3ed5)[_0x42a2('0xe')](function(_0x5027ba){logger[_0x42a2('0xf')]('ChatApplication,\x20%s,\x20%s',_0x1c263a,_0x42a2('0x10'));logger[_0x42a2('0x11')](_0x42a2('0x12'),_0x1c263a,'request\x20sent',JSON[_0x42a2('0x13')](_0x5027ba));if(_0x5027ba['error']){if(_0x5027ba[_0x42a2('0x14')][_0x42a2('0x15')]===0x1f4){logger[_0x42a2('0x14')](_0x42a2('0x16'),_0x1c263a,_0x5027ba[_0x42a2('0x14')][_0x42a2('0x17')]);return _0x35f51e(_0x5027ba['error'][_0x42a2('0x17')]);}logger[_0x42a2('0x14')](_0x42a2('0x16'),_0x1c263a,_0x5027ba['error'][_0x42a2('0x17')]);return _0xaa2992(_0x5027ba[_0x42a2('0x14')][_0x42a2('0x17')]);}else{logger[_0x42a2('0xf')](_0x42a2('0x16'),_0x1c263a,'request\x20sent');_0xaa2992(_0x5027ba[_0x42a2('0x18')][_0x42a2('0x17')]);}})[_0x42a2('0x19')](function(_0x186357){logger[_0x42a2('0x14')](_0x42a2('0x16'),_0x1c263a,_0x186357);_0x35f51e(_0x186357);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2fd8c40..1741d4c 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 _0xc889=['show','/:id','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated'];(function(_0x29a697,_0x4a9f74){var _0x30a67b=function(_0x46ea97){while(--_0x46ea97){_0x29a697['push'](_0x29a697['shift']());}};_0x30a67b(++_0x4a9f74);}(_0xc889,0xd0));var _0x9c88=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xc889[_0x4a53d];return _0x27410e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9c88('0x0'));var timeout=require(_0x9c88('0x1'));var express=require(_0x9c88('0x2'));var router=express['Router']();var auth=require(_0x9c88('0x3'));var interaction=require(_0x9c88('0x4'));var config=require(_0x9c88('0x5'));var controller=require(_0x9c88('0x6'));router['get']('/:id',auth[_0x9c88('0x7')](),controller[_0x9c88('0x8')]);router['put'](_0x9c88('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x9c88('0x7')](),controller[_0x9c88('0xa')]);module[_0x9c88('0xb')]=router; \ No newline at end of file +var _0xd96d=['show','put','isAuthenticated','update','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x5caf86,_0x449a94){var _0x4f439b=function(_0x3e4826){while(--_0x3e4826){_0x5caf86['push'](_0x5caf86['shift']());}};_0x4f439b(++_0x449a94);}(_0xd96d,0x180));var _0xdd96=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xd96d[_0x92c450];return _0x2a9599;};'use strict';var multer=require('multer');var util=require(_0xdd96('0x0'));var path=require('path');var timeout=require(_0xdd96('0x1'));var express=require(_0xdd96('0x2'));var router=express['Router']();var auth=require(_0xdd96('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdd96('0x4'));var controller=require(_0xdd96('0x5'));router[_0xdd96('0x6')](_0xdd96('0x7'),auth['isAuthenticated'](),controller[_0xdd96('0x8')]);router[_0xdd96('0x9')]('/:id',auth[_0xdd96('0xa')](),controller[_0xdd96('0xb')]);router['delete'](_0xdd96('0x7'),auth['isAuthenticated'](),controller[_0xdd96('0xc')]);module[_0xdd96('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 8adfbe7..9a09b40 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 _0x3ec3=['exports','STRING','sequelize'];(function(_0x2d283c,_0x1702d3){var _0xa8fbc0=function(_0x69f21b){while(--_0x69f21b){_0x2d283c['push'](_0x2d283c['shift']());}};_0xa8fbc0(++_0x1702d3);}(_0x3ec3,0xa1));var _0x33ec=function(_0x3a9570,_0x5232a6){_0x3a9570=_0x3a9570-0x0;var _0x211ecb=_0x3ec3[_0x3a9570];return _0x211ecb;};'use strict';var Sequelize=require(_0x33ec('0x0'));module[_0x33ec('0x1')]={'name':{'type':Sequelize[_0x33ec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x33ec('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4b3d=['STRING','BOOLEAN','sequelize','exports'];(function(_0x7b4f51,_0x1898ce){var _0x2a3b5f=function(_0x3a15b7){while(--_0x3a15b7){_0x7b4f51['push'](_0x7b4f51['shift']());}};_0x2a3b5f(++_0x1898ce);}(_0x4b3d,0x1ee));var _0xd4b3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4b3d[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0xd4b3('0x0'));module[_0xd4b3('0x1')]={'name':{'type':Sequelize[_0xd4b3('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xd4b3('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 732a622..01fd3f0 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 _0xbc0f=['params','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','keys','User','pick','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','http','test','Sequelize','ValidationError','request','then','debug','request\x20sent','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','ChatGroup','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','show'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0xbc0f,0x1bf));var _0xfbc0=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xbc0f[_0x2064e5];return _0x21a233;};'use strict';var pdf=require(_0xfbc0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfbc0('0x1'));var zipdir=require(_0xfbc0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfbc0('0x3'));var moment=require('moment');var BPromise=require(_0xfbc0('0x4'));var Mustache=require('mustache');var util=require(_0xfbc0('0x5'));var path=require('path');var sox=require(_0xfbc0('0x6'));var csv=require(_0xfbc0('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfbc0('0x8'));var squel=require(_0xfbc0('0x9'));var crypto=require(_0xfbc0('0xa'));var jsforce=require(_0xfbc0('0xb'));var deskjs=require(_0xfbc0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfbc0('0xd'));var Papa=require(_0xfbc0('0xe'));var Redis=require(_0xfbc0('0xf'));var authService=require(_0xfbc0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfbc0('0x11'));var utils=require(_0xfbc0('0x12'));var config=require('../../config/environment');var db=require(_0xfbc0('0x13'))['db'];config[_0xfbc0('0x14')]=_['defaults'](config[_0xfbc0('0x14')],{'host':_0xfbc0('0x15'),'port':0x18eb});var socket=require(_0xfbc0('0x16'))(new Redis(config[_0xfbc0('0x14')]));require(_0xfbc0('0x17'))[_0xfbc0('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xfbc0('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4e6a9d,_0x192964,_0x3d1d00){if(_0x3d1d00){var _0x317299=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x317299[_0xfbc0('0x1a')](_0x192964)){return _0x4e6a9d;}else{throw new db[(_0xfbc0('0x1b'))][(_0xfbc0('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4e6a9d;}}function respondWithRpcPromise(_0x3eb0a4,_0x1ad9b6,_0x100e4f,_0x1c67c8){return new BPromise(function(_0x149afb,_0x120bf1){var _0x5bea4d=_0x1c67c8||client;return _0x5bea4d[_0xfbc0('0x1d')](_0x3eb0a4,_0x100e4f)[_0xfbc0('0x1e')](function(_0x1eec8e){logger['info']('ChatGroup,\x20%s,\x20%s',_0x1ad9b6,'request\x20sent');logger[_0xfbc0('0x1f')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1ad9b6,_0xfbc0('0x20'),JSON[_0xfbc0('0x21')](_0x1eec8e));if(_0x1eec8e['error']){if(_0x1eec8e[_0xfbc0('0x22')]['code']===0x1f4){logger[_0xfbc0('0x22')](_0xfbc0('0x23'),_0x1ad9b6,_0x1eec8e[_0xfbc0('0x22')][_0xfbc0('0x24')]);return _0x120bf1(_0x1eec8e[_0xfbc0('0x22')][_0xfbc0('0x24')]);}logger[_0xfbc0('0x22')](_0xfbc0('0x23'),_0x1ad9b6,_0x1eec8e[_0xfbc0('0x22')][_0xfbc0('0x24')]);return _0x149afb(_0x1eec8e[_0xfbc0('0x22')][_0xfbc0('0x24')]);}else{logger['info'](_0xfbc0('0x23'),_0x1ad9b6,_0xfbc0('0x20'));_0x149afb(_0x1eec8e[_0xfbc0('0x25')][_0xfbc0('0x24')]);}})['catch'](function(_0x9dbf06){logger[_0xfbc0('0x22')]('ChatGroup,\x20%s,\x20%s',_0x1ad9b6,_0x9dbf06);_0x120bf1(_0x9dbf06);});});}function respondWithStatusCode(_0x54c94a,_0x1d6e1b){_0x1d6e1b=_0x1d6e1b||0xcc;return function(_0x247e93){if(_0x247e93){return _0x54c94a[_0xfbc0('0x26')](_0x1d6e1b);}return _0x54c94a[_0xfbc0('0x27')](_0x1d6e1b)[_0xfbc0('0x28')]();};}function respondWithResult(_0x3b2446,_0x1e1c3b){_0x1e1c3b=_0x1e1c3b||0xc8;return function(_0xf2ec35){if(_0xf2ec35){return _0x3b2446[_0xfbc0('0x27')](_0x1e1c3b)[_0xfbc0('0x29')](_0xf2ec35);}};}function respondWithFilteredResult(_0x22bccd,_0x50242d){return function(_0x95a611){if(_0x95a611){var _0x1f91b5=_0x95a611[_0xfbc0('0x2a')],_0x1f4682=_0x50242d[_0xfbc0('0x2b')],_0x8fac5c=_0x50242d[_0xfbc0('0x2b')]+_0x50242d[_0xfbc0('0x2c')],_0x3dc23c;if(_0x8fac5c>=_0x1f91b5){_0x8fac5c=_0x1f91b5;_0x3dc23c=0xc8;}else{_0x3dc23c=0xce;}_0x22bccd[_0xfbc0('0x27')](_0x3dc23c);return _0x22bccd[_0xfbc0('0x2d')](_0xfbc0('0x2e'),_0x1f4682+'-'+_0x8fac5c+'/'+_0x1f91b5)[_0xfbc0('0x29')](_0x95a611);}return null;};}function patchUpdates(_0x34244b){return function(_0x4c3cbc){try{jsonpatch[_0xfbc0('0x2f')](_0x4c3cbc,_0x34244b,!![]);}catch(_0x9850a){return BPromise[_0xfbc0('0x30')](_0x9850a);}return _0x4c3cbc[_0xfbc0('0x31')]();};}function saveUpdates(_0x14918e,_0x5b3e21){return function(_0x257141){if(_0x257141){return _0x257141[_0xfbc0('0x32')](_0x14918e)[_0xfbc0('0x1e')](function(_0x24f832){return _0x24f832;});}return null;};}function removeEntity(_0x5b36f9,_0x55e460){return function(_0x20c1e9){if(_0x20c1e9){return _0x20c1e9[_0xfbc0('0x33')]()[_0xfbc0('0x1e')](function(){_0x5b36f9['status'](0xcc)[_0xfbc0('0x28')]();});}};}function handleEntityNotFound(_0x1a9e65,_0x22d10c){return function(_0x5bf1cf){if(!_0x5bf1cf){_0x1a9e65[_0xfbc0('0x26')](0x194);}return _0x5bf1cf;};}function handleError(_0x263952,_0x5ce482){_0x5ce482=_0x5ce482||0x1f4;return function(_0x3cc817){logger[_0xfbc0('0x22')](_0x3cc817[_0xfbc0('0x34')]);if(_0x3cc817[_0xfbc0('0x35')]){delete _0x3cc817[_0xfbc0('0x35')];}_0x263952[_0xfbc0('0x27')](_0x5ce482)['send'](_0x3cc817);};}exports[_0xfbc0('0x36')]=function(_0x2c50e3,_0x2819e0){var _0x5795bc={},_0x3ff20d={},_0x414927={'count':0x0,'rows':[]};var _0xc57f2a=_[_0xfbc0('0x37')](db[_0xfbc0('0x38')][_0xfbc0('0x39')],function(_0x5bf6fd){return{'name':_0x5bf6fd['fieldName'],'type':_0x5bf6fd[_0xfbc0('0x3a')][_0xfbc0('0x3b')]};});_0x3ff20d[_0xfbc0('0x3c')]=_[_0xfbc0('0x37')](_0xc57f2a,'name');_0x3ff20d[_0xfbc0('0x3d')]=_['keys'](_0x2c50e3[_0xfbc0('0x3d')]);_0x3ff20d[_0xfbc0('0x3e')]=_['intersection'](_0x3ff20d[_0xfbc0('0x3c')],_0x3ff20d['query']);_0x5795bc[_0xfbc0('0x3f')]=_[_0xfbc0('0x40')](_0x3ff20d[_0xfbc0('0x3c')],qs[_0xfbc0('0x41')](_0x2c50e3[_0xfbc0('0x3d')][_0xfbc0('0x41')]));_0x5795bc[_0xfbc0('0x3f')]=_0x5795bc[_0xfbc0('0x3f')][_0xfbc0('0x42')]?_0x5795bc[_0xfbc0('0x3f')]:_0x3ff20d[_0xfbc0('0x3c')];if(!_0x2c50e3[_0xfbc0('0x3d')][_0xfbc0('0x43')]('nolimit')){_0x5795bc['limit']=qs[_0xfbc0('0x2c')](_0x2c50e3[_0xfbc0('0x3d')][_0xfbc0('0x2c')]);_0x5795bc[_0xfbc0('0x2b')]=qs[_0xfbc0('0x2b')](_0x2c50e3[_0xfbc0('0x3d')][_0xfbc0('0x2b')]);}_0x5795bc[_0xfbc0('0x44')]=qs[_0xfbc0('0x45')](_0x2c50e3[_0xfbc0('0x3d')][_0xfbc0('0x45')]);_0x5795bc[_0xfbc0('0x46')]=qs[_0xfbc0('0x3e')](_['pick'](_0x2c50e3[_0xfbc0('0x3d')],_0x3ff20d[_0xfbc0('0x3e')]));if(_0x2c50e3[_0xfbc0('0x3d')][_0xfbc0('0x47')]){_0x5795bc[_0xfbc0('0x46')]=_[_0xfbc0('0x48')](_0x5795bc[_0xfbc0('0x46')],{'$or':_[_0xfbc0('0x37')](_0xc57f2a,function(_0x956636){if(_0x956636['type']!=='VIRTUAL'){var _0x51ba77={};_0x51ba77[_0x956636[_0xfbc0('0x35')]]={'$like':'%'+_0x2c50e3[_0xfbc0('0x3d')][_0xfbc0('0x47')]+'%'};return _0x51ba77;}})});}_0x5795bc=_[_0xfbc0('0x48')]({},_0x5795bc,_0x2c50e3[_0xfbc0('0x49')]);var _0x5783bd={'where':_0x5795bc['where']};return db['ChatGroup']['count'](_0x5783bd)['then'](function(_0x26c7d5){_0x414927['count']=_0x26c7d5;if(_0x2c50e3[_0xfbc0('0x3d')][_0xfbc0('0x4a')]){_0x5795bc[_0xfbc0('0x4b')]=[{'all':!![]}];}return db['ChatGroup'][_0xfbc0('0x4c')](_0x5795bc);})[_0xfbc0('0x1e')](function(_0x1b5201){_0x414927['rows']=_0x1b5201;return _0x414927;})[_0xfbc0('0x1e')](respondWithFilteredResult(_0x2819e0,_0x5795bc))['catch'](handleError(_0x2819e0,null));};exports[_0xfbc0('0x4d')]=function(_0x20c9e1,_0x469827){var _0x3aa16f={'raw':!![],'where':{'id':_0x20c9e1[_0xfbc0('0x4e')]['id']}},_0x418acd={};_0x418acd[_0xfbc0('0x3c')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x418acd[_0xfbc0('0x3d')]=_['keys'](_0x20c9e1[_0xfbc0('0x3d')]);_0x418acd[_0xfbc0('0x3e')]=_['intersection'](_0x418acd[_0xfbc0('0x3c')],_0x418acd[_0xfbc0('0x3d')]);_0x3aa16f[_0xfbc0('0x3f')]=_[_0xfbc0('0x40')](_0x418acd[_0xfbc0('0x3c')],qs[_0xfbc0('0x41')](_0x20c9e1[_0xfbc0('0x3d')][_0xfbc0('0x41')]));_0x3aa16f[_0xfbc0('0x3f')]=_0x3aa16f['attributes'][_0xfbc0('0x42')]?_0x3aa16f[_0xfbc0('0x3f')]:_0x418acd[_0xfbc0('0x3c')];if(_0x20c9e1[_0xfbc0('0x3d')][_0xfbc0('0x4a')]){_0x3aa16f[_0xfbc0('0x4b')]=[{'all':!![]}];}_0x3aa16f=_[_0xfbc0('0x48')]({},_0x3aa16f,_0x20c9e1[_0xfbc0('0x49')]);return db[_0xfbc0('0x38')][_0xfbc0('0x4f')](_0x3aa16f)['then'](handleEntityNotFound(_0x469827,null))[_0xfbc0('0x1e')](respondWithResult(_0x469827,null))[_0xfbc0('0x50')](handleError(_0x469827,null));};exports[_0xfbc0('0x51')]=function(_0x1e59ad,_0x385cf0){return db[_0xfbc0('0x38')][_0xfbc0('0x51')](_0x1e59ad['body'],{})[_0xfbc0('0x1e')](respondWithResult(_0x385cf0,0xc9))[_0xfbc0('0x50')](handleError(_0x385cf0,null));};exports[_0xfbc0('0x32')]=function(_0x30ae92,_0x113790){if(_0x30ae92['body']['id']){delete _0x30ae92[_0xfbc0('0x52')]['id'];}return db['ChatGroup'][_0xfbc0('0x4f')]({'where':{'id':_0x30ae92[_0xfbc0('0x4e')]['id']}})[_0xfbc0('0x1e')](handleEntityNotFound(_0x113790,null))['then'](saveUpdates(_0x30ae92[_0xfbc0('0x52')],null))[_0xfbc0('0x1e')](respondWithResult(_0x113790,null))[_0xfbc0('0x50')](handleError(_0x113790,null));};exports[_0xfbc0('0x33')]=function(_0x5896a5,_0x1f3d7c){return db[_0xfbc0('0x38')][_0xfbc0('0x4f')]({'where':{'id':_0x5896a5['params']['id']}})[_0xfbc0('0x1e')](handleEntityNotFound(_0x1f3d7c,null))[_0xfbc0('0x1e')](removeEntity(_0x1f3d7c,null))[_0xfbc0('0x50')](handleError(_0x1f3d7c,null));};exports[_0xfbc0('0x53')]=function(_0x4173a7,_0x28b765){return db[_0xfbc0('0x38')]['describe']()[_0xfbc0('0x1e')](respondWithResult(_0x28b765,null))[_0xfbc0('0x50')](handleError(_0x28b765,null));};exports[_0xfbc0('0x54')]=function(_0x1b8009,_0x291492,_0x449888){return db[_0xfbc0('0x55')][_0xfbc0('0x2a')]({'where':{'ChatGroupId':_0x1b8009[_0xfbc0('0x4e')]['id'],'ToId':_0x1b8009[_0xfbc0('0x56')]['id'],'read':![]}})[_0xfbc0('0x1e')](function(_0x3d2544){return{'id':_[_0xfbc0('0x57')](_0x1b8009[_0xfbc0('0x4e')]['id']),'count':_0x3d2544};})[_0xfbc0('0x1e')](respondWithResult(_0x291492,null))['catch'](handleError(_0x291492,null));};exports[_0xfbc0('0x58')]=function(_0x47845e,_0x323afb,_0x4a9acb){return db[_0xfbc0('0x38')]['find']({'where':{'id':_0x47845e[_0xfbc0('0x4e')]['id']}})['then'](handleEntityNotFound(_0x323afb,null))[_0xfbc0('0x1e')](function(_0x5b74c1){if(_0x5b74c1){return _0x5b74c1[_0xfbc0('0x58')](_0x47845e[_0xfbc0('0x52')][_0xfbc0('0x59')],_[_0xfbc0('0x5a')](_0x47845e[_0xfbc0('0x52')],[_0xfbc0('0x59'),'id'])||{});}})[_0xfbc0('0x1e')](respondWithResult(_0x323afb,null))['catch'](handleError(_0x323afb,null));};exports[_0xfbc0('0x5b')]=function(_0x537cba,_0x4a3fb1,_0x4f5c2d){var _0x55ac09={};var _0x30c4b6={};var _0x2f697b;var _0x41b342;return db[_0xfbc0('0x38')]['findOne']({'where':{'id':_0x537cba[_0xfbc0('0x4e')]['id']}})[_0xfbc0('0x1e')](handleEntityNotFound(_0x4a3fb1,null))['then'](function(_0x1f122f){if(_0x1f122f){_0x2f697b=_0x1f122f;_0x30c4b6[_0xfbc0('0x3c')]=_[_0xfbc0('0x5c')](db[_0xfbc0('0x5d')][_0xfbc0('0x39')]);_0x30c4b6[_0xfbc0('0x3d')]=_[_0xfbc0('0x5c')](_0x537cba['query']);_0x30c4b6[_0xfbc0('0x3e')]=_[_0xfbc0('0x40')](_0x30c4b6[_0xfbc0('0x3c')],_0x30c4b6['query']);_0x55ac09[_0xfbc0('0x3f')]=_[_0xfbc0('0x40')](_0x30c4b6[_0xfbc0('0x3c')],qs[_0xfbc0('0x41')](_0x537cba[_0xfbc0('0x3d')]['fields']));_0x55ac09[_0xfbc0('0x3f')]=_0x55ac09[_0xfbc0('0x3f')]['length']?_0x55ac09[_0xfbc0('0x3f')]:_0x30c4b6[_0xfbc0('0x3c')];_0x55ac09[_0xfbc0('0x44')]=qs['sort'](_0x537cba['query']['sort']);_0x55ac09[_0xfbc0('0x46')]=qs['filters'](_[_0xfbc0('0x5e')](_0x537cba[_0xfbc0('0x3d')],_0x30c4b6[_0xfbc0('0x3e')]));if(_0x537cba['query'][_0xfbc0('0x47')]){_0x55ac09[_0xfbc0('0x46')]=_[_0xfbc0('0x48')](_0x55ac09[_0xfbc0('0x46')],{'$or':_[_0xfbc0('0x37')](_0x55ac09['attributes'],function(_0x3eb85d){var _0x3065a9={};_0x3065a9[_0x3eb85d]={'$like':'%'+_0x537cba[_0xfbc0('0x3d')]['filter']+'%'};return _0x3065a9;})});}_0x55ac09=_[_0xfbc0('0x48')]({},_0x55ac09,_0x537cba[_0xfbc0('0x49')]);return _0x2f697b[_0xfbc0('0x5b')](_0x55ac09);}})['then'](function(_0xb36db){if(_0xb36db){_0x41b342=_0xb36db[_0xfbc0('0x42')];if(!_0x537cba[_0xfbc0('0x3d')][_0xfbc0('0x43')](_0xfbc0('0x5f'))){_0x55ac09[_0xfbc0('0x2c')]=qs[_0xfbc0('0x2c')](_0x537cba['query'][_0xfbc0('0x2c')]);_0x55ac09['offset']=qs[_0xfbc0('0x2b')](_0x537cba[_0xfbc0('0x3d')]['offset']);}return _0x2f697b[_0xfbc0('0x5b')](_0x55ac09);}})[_0xfbc0('0x1e')](function(_0x5a01b3){if(_0x5a01b3){return _0x5a01b3?{'count':_0x41b342,'rows':_0x5a01b3}:null;}})[_0xfbc0('0x1e')](respondWithResult(_0x4a3fb1,null))[_0xfbc0('0x50')](handleError(_0x4a3fb1,null));};exports[_0xfbc0('0x60')]=function(_0x3cfbb0,_0xa619df,_0x496cd0){return db[_0xfbc0('0x38')][_0xfbc0('0x4f')]({'where':{'id':_0x3cfbb0[_0xfbc0('0x4e')]['id']}})[_0xfbc0('0x1e')](handleEntityNotFound(_0xa619df,null))[_0xfbc0('0x1e')](function(_0x3ca559){if(_0x3ca559){return _0x3ca559[_0xfbc0('0x60')](_0x3cfbb0[_0xfbc0('0x3d')]['ids']);}})[_0xfbc0('0x1e')](respondWithStatusCode(_0xa619df,null))[_0xfbc0('0x50')](handleError(_0xa619df,null));};exports[_0xfbc0('0x61')]=function(_0x4db6b4,_0x1f0b42,_0x55dc66){if(_0x4db6b4[_0xfbc0('0x52')]['id']){delete _0x4db6b4[_0xfbc0('0x52')]['id'];}return db['ChatGroup'][_0xfbc0('0x4f')]({'where':{'id':_0x4db6b4[_0xfbc0('0x4e')]['id']}})[_0xfbc0('0x1e')](handleEntityNotFound(_0x1f0b42,null))[_0xfbc0('0x1e')](function(_0x2076bb){if(_0x2076bb){_0x4db6b4['body'][_0xfbc0('0x62')]=_0x2076bb['id'];return db['ChatInternalMessage'][_0xfbc0('0x51')](_0x4db6b4[_0xfbc0('0x52')]);}})[_0xfbc0('0x1e')](respondWithResult(_0x1f0b42,null))[_0xfbc0('0x50')](handleError(_0x1f0b42,null));};exports[_0xfbc0('0x63')]=function(_0x124c88,_0x29377f,_0x4f4e0f){var _0x1cd18a={};var _0xf67542={};var _0x29dc7d;var _0x143935;return db[_0xfbc0('0x38')][_0xfbc0('0x64')]({'where':{'id':_0x124c88[_0xfbc0('0x4e')]['id']}})[_0xfbc0('0x1e')](handleEntityNotFound(_0x29377f,null))[_0xfbc0('0x1e')](function(_0x49f5b0){if(_0x49f5b0){_0x29dc7d=_0x49f5b0;_0xf67542[_0xfbc0('0x3c')]=_['keys'](db[_0xfbc0('0x55')]['rawAttributes']);_0xf67542[_0xfbc0('0x3d')]=_[_0xfbc0('0x5c')](_0x124c88['query']);_0xf67542[_0xfbc0('0x3e')]=_[_0xfbc0('0x40')](_0xf67542[_0xfbc0('0x3c')],_0xf67542[_0xfbc0('0x3d')]);_0x1cd18a[_0xfbc0('0x3f')]=_[_0xfbc0('0x40')](_0xf67542[_0xfbc0('0x3c')],qs[_0xfbc0('0x41')](_0x124c88['query'][_0xfbc0('0x41')]));_0x1cd18a[_0xfbc0('0x3f')]=_0x1cd18a[_0xfbc0('0x3f')][_0xfbc0('0x42')]?_0x1cd18a[_0xfbc0('0x3f')]:_0xf67542[_0xfbc0('0x3c')];_0x1cd18a[_0xfbc0('0x44')]=qs[_0xfbc0('0x45')](_0x124c88[_0xfbc0('0x3d')]['sort']);_0x1cd18a[_0xfbc0('0x46')]=qs['filters'](_[_0xfbc0('0x5e')](_0x124c88[_0xfbc0('0x3d')],_0xf67542['filters']));if(_0x124c88['query']['filter']){_0x1cd18a['where']=_[_0xfbc0('0x48')](_0x1cd18a[_0xfbc0('0x46')],{'$or':_[_0xfbc0('0x37')](_0x1cd18a[_0xfbc0('0x3f')],function(_0x5b080c){var _0x544b5d={};_0x544b5d[_0x5b080c]={'$like':'%'+_0x124c88['query'][_0xfbc0('0x47')]+'%'};return _0x544b5d;})});}if(_0x124c88['query'][_0xfbc0('0x65')]){var _0x3e7cba=_0x124c88[_0xfbc0('0x3d')][_0xfbc0('0x65')][_0xfbc0('0x66')](',');var _0x383ce7={};_0x383ce7[_0x3e7cba[0x0]]={'$gte':moment(_0x3e7cba[0x1])[_0xfbc0('0x67')](_0xfbc0('0x68'))};_0x1cd18a[_0xfbc0('0x46')]=_[_0xfbc0('0x48')](_0x1cd18a[_0xfbc0('0x46')],_0x383ce7);}_0x1cd18a=_[_0xfbc0('0x48')]({},_0x1cd18a,_0x124c88[_0xfbc0('0x49')]);return _0x29dc7d[_0xfbc0('0x63')](_0x1cd18a);}})[_0xfbc0('0x1e')](function(_0x4829b1){if(_0x4829b1){_0x143935=_0x4829b1[_0xfbc0('0x42')];if(!_0x124c88[_0xfbc0('0x3d')][_0xfbc0('0x43')](_0xfbc0('0x5f'))){_0x1cd18a[_0xfbc0('0x2c')]=qs['limit'](_0x124c88['query'][_0xfbc0('0x2c')]);_0x1cd18a[_0xfbc0('0x2b')]=qs[_0xfbc0('0x2b')](_0x124c88[_0xfbc0('0x3d')][_0xfbc0('0x2b')]);}return _0x29dc7d[_0xfbc0('0x63')](_0x1cd18a);}})[_0xfbc0('0x1e')](function(_0x3d2368){if(_0x3d2368){return _0x3d2368?{'count':_0x143935,'rows':_0x3d2368}:null;}})[_0xfbc0('0x1e')](respondWithResult(_0x29377f,null))[_0xfbc0('0x50')](handleError(_0x29377f,null));}; \ No newline at end of file +var _0xfb58=['destroy','stack','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','name','keys','filters','query','attributes','intersection','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','order','filter','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','test','ValidationError','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update'];(function(_0x304292,_0xcb4fb6){var _0x1b5918=function(_0x5a4c4d){while(--_0x5a4c4d){_0x304292['push'](_0x304292['shift']());}};_0x1b5918(++_0xcb4fb6);}(_0xfb58,0x180));var _0x8fb5=function(_0x36c0b1,_0x4994e4){_0x36c0b1=_0x36c0b1-0x0;var _0x46889a=_0xfb58[_0x36c0b1];return _0x46889a;};'use strict';var pdf=require(_0x8fb5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8fb5('0x1'));var zipdir=require(_0x8fb5('0x2'));var jsonpatch=require(_0x8fb5('0x3'));var rp=require(_0x8fb5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8fb5('0x5'));var util=require(_0x8fb5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8fb5('0x7'));var ejs=require(_0x8fb5('0x8'));var fs=require('fs');var _=require(_0x8fb5('0x9'));var squel=require(_0x8fb5('0xa'));var crypto=require('crypto');var jsforce=require(_0x8fb5('0xb'));var deskjs=require(_0x8fb5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8fb5('0xd'));var Redis=require(_0x8fb5('0xe'));var authService=require(_0x8fb5('0xf'));var qs=require(_0x8fb5('0x10'));var as=require(_0x8fb5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8fb5('0x12'));var utils=require(_0x8fb5('0x13'));var config=require('../../config/environment');var db=require(_0x8fb5('0x14'))['db'];config[_0x8fb5('0x15')]=_[_0x8fb5('0x16')](config[_0x8fb5('0x15')],{'host':_0x8fb5('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8fb5('0x15')]));require('./chatGroup.socket')[_0x8fb5('0x18')](socket);var jayson=require(_0x8fb5('0x19'));var client=jayson[_0x8fb5('0x1a')][_0x8fb5('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4850c8,_0x1ced86,_0x4a2381){if(_0x4a2381){var _0x1aab81=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1aab81[_0x8fb5('0x1c')](_0x1ced86)){return _0x4850c8;}else{throw new db['Sequelize'][(_0x8fb5('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4850c8;}}function respondWithRpcPromise(_0x1446f6,_0x400a08,_0x5ce9ca,_0x383f1f){return new BPromise(function(_0x474671,_0x1df962){var _0x373842=_0x383f1f||client;return _0x373842['request'](_0x1446f6,_0x5ce9ca)[_0x8fb5('0x1e')](function(_0x45d856){logger[_0x8fb5('0x1f')]('ChatGroup,\x20%s,\x20%s',_0x400a08,'request\x20sent');logger[_0x8fb5('0x20')](_0x8fb5('0x21'),_0x400a08,'request\x20sent',JSON[_0x8fb5('0x22')](_0x45d856));if(_0x45d856[_0x8fb5('0x23')]){if(_0x45d856[_0x8fb5('0x23')][_0x8fb5('0x24')]===0x1f4){logger[_0x8fb5('0x23')](_0x8fb5('0x25'),_0x400a08,_0x45d856['error'][_0x8fb5('0x26')]);return _0x1df962(_0x45d856['error'][_0x8fb5('0x26')]);}logger['error'](_0x8fb5('0x25'),_0x400a08,_0x45d856['error']['message']);return _0x474671(_0x45d856[_0x8fb5('0x23')][_0x8fb5('0x26')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x400a08,'request\x20sent');_0x474671(_0x45d856[_0x8fb5('0x27')][_0x8fb5('0x26')]);}})['catch'](function(_0x35a5ec){logger[_0x8fb5('0x23')](_0x8fb5('0x25'),_0x400a08,_0x35a5ec);_0x1df962(_0x35a5ec);});});}function respondWithStatusCode(_0x3c2f02,_0x4a31af){_0x4a31af=_0x4a31af||0xcc;return function(_0x2c040b){if(_0x2c040b){return _0x3c2f02[_0x8fb5('0x28')](_0x4a31af);}return _0x3c2f02[_0x8fb5('0x29')](_0x4a31af)[_0x8fb5('0x2a')]();};}function respondWithResult(_0x167691,_0x329ac5){_0x329ac5=_0x329ac5||0xc8;return function(_0x241c54){if(_0x241c54){return _0x167691[_0x8fb5('0x29')](_0x329ac5)['json'](_0x241c54);}};}function respondWithFilteredResult(_0x1b356a,_0x4d5ba9){return function(_0x44ef18){if(_0x44ef18){var _0x18127b=_0x44ef18[_0x8fb5('0x2b')],_0x3f4960=_0x4d5ba9['offset'],_0x3b065c=_0x4d5ba9[_0x8fb5('0x2c')]+_0x4d5ba9[_0x8fb5('0x2d')],_0x67a0a0;if(_0x3b065c>=_0x18127b){_0x3b065c=_0x18127b;_0x67a0a0=0xc8;}else{_0x67a0a0=0xce;}_0x1b356a[_0x8fb5('0x29')](_0x67a0a0);return _0x1b356a[_0x8fb5('0x2e')](_0x8fb5('0x2f'),_0x3f4960+'-'+_0x3b065c+'/'+_0x18127b)[_0x8fb5('0x30')](_0x44ef18);}return null;};}function patchUpdates(_0xe2b6c3){return function(_0x309580){try{jsonpatch[_0x8fb5('0x31')](_0x309580,_0xe2b6c3,!![]);}catch(_0x346db4){return BPromise[_0x8fb5('0x32')](_0x346db4);}return _0x309580['save']();};}function saveUpdates(_0x35201e,_0x577b4a){return function(_0x278de2){if(_0x278de2){return _0x278de2[_0x8fb5('0x33')](_0x35201e)['then'](function(_0x39f833){return _0x39f833;});}return null;};}function removeEntity(_0x3c4644,_0x56be52){return function(_0x16ac9a){if(_0x16ac9a){return _0x16ac9a[_0x8fb5('0x34')]()[_0x8fb5('0x1e')](function(){_0x3c4644[_0x8fb5('0x29')](0xcc)[_0x8fb5('0x2a')]();});}};}function handleEntityNotFound(_0x5e9916,_0x2dd9be){return function(_0x18fe36){if(!_0x18fe36){_0x5e9916['sendStatus'](0x194);}return _0x18fe36;};}function handleError(_0x365396,_0x522c3a){_0x522c3a=_0x522c3a||0x1f4;return function(_0x374d54){logger[_0x8fb5('0x23')](_0x374d54[_0x8fb5('0x35')]);if(_0x374d54['name']){delete _0x374d54['name'];}_0x365396[_0x8fb5('0x29')](_0x522c3a)[_0x8fb5('0x36')](_0x374d54);};}exports[_0x8fb5('0x37')]=function(_0x4005da,_0x1d36a2){var _0xa7dc4b={},_0x357bf={},_0x17925f={'count':0x0,'rows':[]};var _0x503c7b=_[_0x8fb5('0x38')](db[_0x8fb5('0x39')][_0x8fb5('0x3a')],function(_0x53eb00){return{'name':_0x53eb00[_0x8fb5('0x3b')],'type':_0x53eb00[_0x8fb5('0x3c')][_0x8fb5('0x3d')]};});_0x357bf[_0x8fb5('0x3e')]=_[_0x8fb5('0x38')](_0x503c7b,_0x8fb5('0x3f'));_0x357bf['query']=_[_0x8fb5('0x40')](_0x4005da['query']);_0x357bf[_0x8fb5('0x41')]=_['intersection'](_0x357bf[_0x8fb5('0x3e')],_0x357bf[_0x8fb5('0x42')]);_0xa7dc4b[_0x8fb5('0x43')]=_[_0x8fb5('0x44')](_0x357bf['model'],qs[_0x8fb5('0x45')](_0x4005da[_0x8fb5('0x42')][_0x8fb5('0x45')]));_0xa7dc4b[_0x8fb5('0x43')]=_0xa7dc4b['attributes'][_0x8fb5('0x46')]?_0xa7dc4b[_0x8fb5('0x43')]:_0x357bf[_0x8fb5('0x3e')];if(!_0x4005da[_0x8fb5('0x42')]['hasOwnProperty'](_0x8fb5('0x47'))){_0xa7dc4b['limit']=qs[_0x8fb5('0x2d')](_0x4005da[_0x8fb5('0x42')][_0x8fb5('0x2d')]);_0xa7dc4b[_0x8fb5('0x2c')]=qs[_0x8fb5('0x2c')](_0x4005da[_0x8fb5('0x42')][_0x8fb5('0x2c')]);}_0xa7dc4b['order']=qs[_0x8fb5('0x48')](_0x4005da[_0x8fb5('0x42')]['sort']);_0xa7dc4b['where']=qs['filters'](_[_0x8fb5('0x49')](_0x4005da['query'],_0x357bf[_0x8fb5('0x41')]));if(_0x4005da[_0x8fb5('0x42')]['filter']){_0xa7dc4b[_0x8fb5('0x4a')]=_[_0x8fb5('0x4b')](_0xa7dc4b[_0x8fb5('0x4a')],{'$or':_['map'](_0x503c7b,function(_0x1f3653){if(_0x1f3653[_0x8fb5('0x3c')]!==_0x8fb5('0x4c')){var _0x359269={};_0x359269[_0x1f3653[_0x8fb5('0x3f')]]={'$like':'%'+_0x4005da['query']['filter']+'%'};return _0x359269;}})});}_0xa7dc4b=_[_0x8fb5('0x4b')]({},_0xa7dc4b,_0x4005da[_0x8fb5('0x4d')]);var _0x2611e9={'where':_0xa7dc4b[_0x8fb5('0x4a')]};return db['ChatGroup'][_0x8fb5('0x2b')](_0x2611e9)[_0x8fb5('0x1e')](function(_0x4b2056){_0x17925f[_0x8fb5('0x2b')]=_0x4b2056;if(_0x4005da[_0x8fb5('0x42')][_0x8fb5('0x4e')]){_0xa7dc4b[_0x8fb5('0x4f')]=[{'all':!![]}];}return db[_0x8fb5('0x39')][_0x8fb5('0x50')](_0xa7dc4b);})[_0x8fb5('0x1e')](function(_0x490973){_0x17925f[_0x8fb5('0x51')]=_0x490973;return _0x17925f;})[_0x8fb5('0x1e')](respondWithFilteredResult(_0x1d36a2,_0xa7dc4b))[_0x8fb5('0x52')](handleError(_0x1d36a2,null));};exports[_0x8fb5('0x53')]=function(_0x2b010d,_0x3fc20a){var _0x960cd7={'raw':!![],'where':{'id':_0x2b010d[_0x8fb5('0x54')]['id']}},_0x249b5c={};_0x249b5c['model']=_[_0x8fb5('0x40')](db[_0x8fb5('0x39')][_0x8fb5('0x3a')]);_0x249b5c[_0x8fb5('0x42')]=_['keys'](_0x2b010d[_0x8fb5('0x42')]);_0x249b5c['filters']=_['intersection'](_0x249b5c[_0x8fb5('0x3e')],_0x249b5c[_0x8fb5('0x42')]);_0x960cd7['attributes']=_[_0x8fb5('0x44')](_0x249b5c[_0x8fb5('0x3e')],qs[_0x8fb5('0x45')](_0x2b010d[_0x8fb5('0x42')][_0x8fb5('0x45')]));_0x960cd7[_0x8fb5('0x43')]=_0x960cd7[_0x8fb5('0x43')]['length']?_0x960cd7[_0x8fb5('0x43')]:_0x249b5c[_0x8fb5('0x3e')];if(_0x2b010d['query'][_0x8fb5('0x4e')]){_0x960cd7[_0x8fb5('0x4f')]=[{'all':!![]}];}_0x960cd7=_['merge']({},_0x960cd7,_0x2b010d['options']);return db[_0x8fb5('0x39')][_0x8fb5('0x55')](_0x960cd7)[_0x8fb5('0x1e')](handleEntityNotFound(_0x3fc20a,null))[_0x8fb5('0x1e')](respondWithResult(_0x3fc20a,null))[_0x8fb5('0x52')](handleError(_0x3fc20a,null));};exports[_0x8fb5('0x56')]=function(_0x54a787,_0xe86b7c){return db['ChatGroup'][_0x8fb5('0x56')](_0x54a787[_0x8fb5('0x57')],{})[_0x8fb5('0x1e')](respondWithResult(_0xe86b7c,0xc9))['catch'](handleError(_0xe86b7c,null));};exports['update']=function(_0x34a9dd,_0x3fe5df){if(_0x34a9dd['body']['id']){delete _0x34a9dd[_0x8fb5('0x57')]['id'];}return db['ChatGroup'][_0x8fb5('0x55')]({'where':{'id':_0x34a9dd[_0x8fb5('0x54')]['id']}})[_0x8fb5('0x1e')](handleEntityNotFound(_0x3fe5df,null))[_0x8fb5('0x1e')](saveUpdates(_0x34a9dd[_0x8fb5('0x57')],null))[_0x8fb5('0x1e')](respondWithResult(_0x3fe5df,null))[_0x8fb5('0x52')](handleError(_0x3fe5df,null));};exports[_0x8fb5('0x34')]=function(_0x2f2404,_0x4f1984){return db[_0x8fb5('0x39')][_0x8fb5('0x55')]({'where':{'id':_0x2f2404['params']['id']}})[_0x8fb5('0x1e')](handleEntityNotFound(_0x4f1984,null))[_0x8fb5('0x1e')](removeEntity(_0x4f1984,null))[_0x8fb5('0x52')](handleError(_0x4f1984,null));};exports[_0x8fb5('0x58')]=function(_0x15092c,_0x7c058a){return db[_0x8fb5('0x39')][_0x8fb5('0x58')]()[_0x8fb5('0x1e')](respondWithResult(_0x7c058a,null))[_0x8fb5('0x52')](handleError(_0x7c058a,null));};exports[_0x8fb5('0x59')]=function(_0x3a6724,_0x8622b7,_0x230276){return db[_0x8fb5('0x5a')][_0x8fb5('0x2b')]({'where':{'ChatGroupId':_0x3a6724[_0x8fb5('0x54')]['id'],'ToId':_0x3a6724[_0x8fb5('0x5b')]['id'],'read':![]}})[_0x8fb5('0x1e')](function(_0xfb1a68){return{'id':_[_0x8fb5('0x5c')](_0x3a6724[_0x8fb5('0x54')]['id']),'count':_0xfb1a68};})['then'](respondWithResult(_0x8622b7,null))[_0x8fb5('0x52')](handleError(_0x8622b7,null));};exports[_0x8fb5('0x5d')]=function(_0x4c2df2,_0x35d8fc,_0x3408cf){return db[_0x8fb5('0x39')]['find']({'where':{'id':_0x4c2df2['params']['id']}})[_0x8fb5('0x1e')](handleEntityNotFound(_0x35d8fc,null))['then'](function(_0x14bedf){if(_0x14bedf){return _0x14bedf[_0x8fb5('0x5d')](_0x4c2df2[_0x8fb5('0x57')][_0x8fb5('0x5e')],_[_0x8fb5('0x5f')](_0x4c2df2['body'],['ids','id'])||{});}})[_0x8fb5('0x1e')](respondWithResult(_0x35d8fc,null))[_0x8fb5('0x52')](handleError(_0x35d8fc,null));};exports['getMembers']=function(_0x4c4804,_0x57a7c1,_0x55156f){var _0x26ef30={};var _0x32a284={};var _0x471a5a;var _0x109d47;return db[_0x8fb5('0x39')]['findOne']({'where':{'id':_0x4c4804['params']['id']}})['then'](handleEntityNotFound(_0x57a7c1,null))[_0x8fb5('0x1e')](function(_0x5ccd05){if(_0x5ccd05){_0x471a5a=_0x5ccd05;_0x32a284['model']=_['keys'](db[_0x8fb5('0x60')][_0x8fb5('0x3a')]);_0x32a284[_0x8fb5('0x42')]=_[_0x8fb5('0x40')](_0x4c4804[_0x8fb5('0x42')]);_0x32a284[_0x8fb5('0x41')]=_[_0x8fb5('0x44')](_0x32a284[_0x8fb5('0x3e')],_0x32a284[_0x8fb5('0x42')]);_0x26ef30[_0x8fb5('0x43')]=_['intersection'](_0x32a284[_0x8fb5('0x3e')],qs[_0x8fb5('0x45')](_0x4c4804[_0x8fb5('0x42')][_0x8fb5('0x45')]));_0x26ef30[_0x8fb5('0x43')]=_0x26ef30[_0x8fb5('0x43')][_0x8fb5('0x46')]?_0x26ef30['attributes']:_0x32a284['model'];_0x26ef30[_0x8fb5('0x61')]=qs['sort'](_0x4c4804['query'][_0x8fb5('0x48')]);_0x26ef30[_0x8fb5('0x4a')]=qs[_0x8fb5('0x41')](_[_0x8fb5('0x49')](_0x4c4804[_0x8fb5('0x42')],_0x32a284[_0x8fb5('0x41')]));if(_0x4c4804[_0x8fb5('0x42')][_0x8fb5('0x62')]){_0x26ef30[_0x8fb5('0x4a')]=_[_0x8fb5('0x4b')](_0x26ef30['where'],{'$or':_['map'](_0x26ef30[_0x8fb5('0x43')],function(_0x9fb5a5){var _0x139c09={};_0x139c09[_0x9fb5a5]={'$like':'%'+_0x4c4804[_0x8fb5('0x42')]['filter']+'%'};return _0x139c09;})});}_0x26ef30=_[_0x8fb5('0x4b')]({},_0x26ef30,_0x4c4804['options']);return _0x471a5a[_0x8fb5('0x63')](_0x26ef30);}})[_0x8fb5('0x1e')](function(_0x5d02e3){if(_0x5d02e3){_0x109d47=_0x5d02e3[_0x8fb5('0x46')];if(!_0x4c4804[_0x8fb5('0x42')][_0x8fb5('0x64')](_0x8fb5('0x47'))){_0x26ef30[_0x8fb5('0x2d')]=qs['limit'](_0x4c4804[_0x8fb5('0x42')]['limit']);_0x26ef30[_0x8fb5('0x2c')]=qs[_0x8fb5('0x2c')](_0x4c4804['query'][_0x8fb5('0x2c')]);}return _0x471a5a[_0x8fb5('0x63')](_0x26ef30);}})['then'](function(_0x1a8d69){if(_0x1a8d69){return _0x1a8d69?{'count':_0x109d47,'rows':_0x1a8d69}:null;}})[_0x8fb5('0x1e')](respondWithResult(_0x57a7c1,null))[_0x8fb5('0x52')](handleError(_0x57a7c1,null));};exports['removeMembers']=function(_0x507e84,_0x408f2d,_0x18a6a3){return db['ChatGroup'][_0x8fb5('0x55')]({'where':{'id':_0x507e84[_0x8fb5('0x54')]['id']}})[_0x8fb5('0x1e')](handleEntityNotFound(_0x408f2d,null))[_0x8fb5('0x1e')](function(_0x5d9094){if(_0x5d9094){return _0x5d9094[_0x8fb5('0x65')](_0x507e84['query']['ids']);}})[_0x8fb5('0x1e')](respondWithStatusCode(_0x408f2d,null))[_0x8fb5('0x52')](handleError(_0x408f2d,null));};exports[_0x8fb5('0x66')]=function(_0x43e095,_0xdc22e5,_0x2ba0a9){if(_0x43e095[_0x8fb5('0x57')]['id']){delete _0x43e095[_0x8fb5('0x57')]['id'];}return db[_0x8fb5('0x39')][_0x8fb5('0x55')]({'where':{'id':_0x43e095[_0x8fb5('0x54')]['id']}})['then'](handleEntityNotFound(_0xdc22e5,null))['then'](function(_0x4185a8){if(_0x4185a8){_0x43e095['body'][_0x8fb5('0x67')]=_0x4185a8['id'];return db[_0x8fb5('0x5a')][_0x8fb5('0x56')](_0x43e095[_0x8fb5('0x57')]);}})['then'](respondWithResult(_0xdc22e5,null))[_0x8fb5('0x52')](handleError(_0xdc22e5,null));};exports[_0x8fb5('0x68')]=function(_0x4ca02c,_0x233c43,_0x3be08b){var _0x5c4ebf={};var _0x5bc641={};var _0xa4773f;var _0x2e1ec3;return db['ChatGroup'][_0x8fb5('0x69')]({'where':{'id':_0x4ca02c[_0x8fb5('0x54')]['id']}})[_0x8fb5('0x1e')](handleEntityNotFound(_0x233c43,null))[_0x8fb5('0x1e')](function(_0x12aed1){if(_0x12aed1){_0xa4773f=_0x12aed1;_0x5bc641['model']=_['keys'](db[_0x8fb5('0x5a')][_0x8fb5('0x3a')]);_0x5bc641[_0x8fb5('0x42')]=_[_0x8fb5('0x40')](_0x4ca02c[_0x8fb5('0x42')]);_0x5bc641[_0x8fb5('0x41')]=_['intersection'](_0x5bc641['model'],_0x5bc641[_0x8fb5('0x42')]);_0x5c4ebf[_0x8fb5('0x43')]=_[_0x8fb5('0x44')](_0x5bc641[_0x8fb5('0x3e')],qs['fields'](_0x4ca02c[_0x8fb5('0x42')][_0x8fb5('0x45')]));_0x5c4ebf['attributes']=_0x5c4ebf['attributes'][_0x8fb5('0x46')]?_0x5c4ebf[_0x8fb5('0x43')]:_0x5bc641[_0x8fb5('0x3e')];_0x5c4ebf[_0x8fb5('0x61')]=qs[_0x8fb5('0x48')](_0x4ca02c[_0x8fb5('0x42')][_0x8fb5('0x48')]);_0x5c4ebf[_0x8fb5('0x4a')]=qs[_0x8fb5('0x41')](_[_0x8fb5('0x49')](_0x4ca02c[_0x8fb5('0x42')],_0x5bc641[_0x8fb5('0x41')]));if(_0x4ca02c[_0x8fb5('0x42')][_0x8fb5('0x62')]){_0x5c4ebf[_0x8fb5('0x4a')]=_[_0x8fb5('0x4b')](_0x5c4ebf[_0x8fb5('0x4a')],{'$or':_[_0x8fb5('0x38')](_0x5c4ebf[_0x8fb5('0x43')],function(_0x22f468){var _0x377866={};_0x377866[_0x22f468]={'$like':'%'+_0x4ca02c[_0x8fb5('0x42')]['filter']+'%'};return _0x377866;})});}if(_0x4ca02c[_0x8fb5('0x42')][_0x8fb5('0x6a')]){var _0x44aa6e=_0x4ca02c[_0x8fb5('0x42')][_0x8fb5('0x6a')][_0x8fb5('0x6b')](',');var _0x24271b={};_0x24271b[_0x44aa6e[0x0]]={'$gte':moment(_0x44aa6e[0x1])['format'](_0x8fb5('0x6c'))};_0x5c4ebf[_0x8fb5('0x4a')]=_[_0x8fb5('0x4b')](_0x5c4ebf[_0x8fb5('0x4a')],_0x24271b);}_0x5c4ebf=_[_0x8fb5('0x4b')]({},_0x5c4ebf,_0x4ca02c[_0x8fb5('0x4d')]);return _0xa4773f[_0x8fb5('0x68')](_0x5c4ebf);}})['then'](function(_0x18a303){if(_0x18a303){_0x2e1ec3=_0x18a303[_0x8fb5('0x46')];if(!_0x4ca02c['query'][_0x8fb5('0x64')](_0x8fb5('0x47'))){_0x5c4ebf['limit']=qs[_0x8fb5('0x2d')](_0x4ca02c[_0x8fb5('0x42')][_0x8fb5('0x2d')]);_0x5c4ebf[_0x8fb5('0x2c')]=qs[_0x8fb5('0x2c')](_0x4ca02c[_0x8fb5('0x42')][_0x8fb5('0x2c')]);}return _0xa4773f[_0x8fb5('0x68')](_0x5c4ebf);}})['then'](function(_0x5bf99){if(_0x5bf99){return _0x5bf99?{'count':_0x2e1ec3,'rows':_0x5bf99}:null;}})[_0x8fb5('0x1e')](respondWithResult(_0x233c43,null))['catch'](handleError(_0x233c43,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 2b883cb..5e26ef0 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x2a24f9,_0x33f21b){var _0x32edf3=function(_0x134e94){while(--_0x134e94){_0x2a24f9['push'](_0x2a24f9['shift']());}};_0x32edf3(++_0x33f21b);}(_0x2ef3,0xba));var _0x32ef=function(_0x5e528a,_0x5d67e2){_0x5e528a=_0x5e528a-0x0;var _0x4e80f3=_0x2ef3[_0x5e528a];return _0x4e80f3;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var ChatGroup=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x32ef('0x3')](0x0);var events={'afterCreate':_0x32ef('0x4'),'afterUpdate':_0x32ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38f865){return function(_0x38b7f3,_0x524ab6,_0x402857){ChatGroupEvents[_0x32ef('0x6')](_0x38f865+':'+_0x38b7f3['id'],_0x38b7f3);ChatGroupEvents['emit'](_0x38f865,_0x38b7f3);_0x402857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x32ef('0x7')](e,emitEvent(event));}}module[_0x32ef('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0xadb5,0xad));var _0x5adb=function(_0x3955d0,_0x2d9367){_0x3955d0=_0x3955d0-0x0;var _0x49d0bf=_0xadb5[_0x3955d0];return _0x49d0bf;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index ed04768..0613f11 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 _0x9576=['request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x9576,0x182));var _0x6957=function(_0x461d4b,_0x4ab767){_0x461d4b=_0x461d4b-0x0;var _0x470919=_0x9576[_0x461d4b];return _0x470919;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var logger=require(_0x6957('0x2'))(_0x6957('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6957('0x4'));var fs=require('fs');var path=require(_0x6957('0x5'));var rimraf=require(_0x6957('0x6'));var config=require(_0x6957('0x7'));var attributes=require(_0x6957('0x8'));module[_0x6957('0x9')]=function(_0x2eb79e,_0x49e08a){return _0x2eb79e[_0x6957('0xa')](_0x6957('0xb'),attributes,{'tableName':_0x6957('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb8=['define','ChatGroup','chat_groups','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x3680d4,_0x2ccdc3){var _0x3ecefb=function(_0x41cfae){while(--_0x41cfae){_0x3680d4['push'](_0x3680d4['shift']());}};_0x3ecefb(++_0x2ccdc3);}(_0x5eb8,0x1d1));var _0x85eb=function(_0x51639a,_0x35f006){_0x51639a=_0x51639a-0x0;var _0x3abae4=_0x5eb8[_0x51639a];return _0x3abae4;};'use strict';var _=require('lodash');var util=require(_0x85eb('0x0'));var logger=require(_0x85eb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x85eb('0x2'));var rp=require(_0x85eb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85eb('0x4'));var config=require(_0x85eb('0x5'));var attributes=require(_0x85eb('0x6'));module[_0x85eb('0x7')]=function(_0x4c6606,_0xec020a){return _0x4c6606[_0x85eb('0x8')](_0x85eb('0x9'),attributes,{'tableName':_0x85eb('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 8096b47..67fda16 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 _0xcb59=['ioredis','../../mysqldb','../../config/environment','client','redis','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xd7b7c4,_0x3bde33){var _0x3701d4=function(_0x37f7de){while(--_0x37f7de){_0xd7b7c4['push'](_0xd7b7c4['shift']());}};_0x3701d4(++_0x3bde33);}(_0xcb59,0x78));var _0x9cb5=function(_0x372a4c,_0x2ed0b0){_0x372a4c=_0x372a4c-0x0;var _0x35130f=_0xcb59[_0x372a4c];return _0x35130f;};'use strict';var _=require(_0x9cb5('0x0'));var util=require(_0x9cb5('0x1'));var moment=require(_0x9cb5('0x2'));var BPromise=require(_0x9cb5('0x3'));var rs=require(_0x9cb5('0x4'));var fs=require('fs');var Redis=require(_0x9cb5('0x5'));var db=require(_0x9cb5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9cb5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9cb5('0x8')]['http']({'port':0x232a});config[_0x9cb5('0x9')]=_['defaults'](config[_0x9cb5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9cb5('0xa'))(new Redis(config[_0x9cb5('0x9')]));require(_0x9cb5('0xb'))[_0x9cb5('0xc')](socket);function respondWithRpcPromise(_0x8317fd,_0xc0c7f4,_0x39e29a){return new BPromise(function(_0x5100d5,_0x404e9c){return client[_0x9cb5('0xd')](_0x8317fd,_0x39e29a)['then'](function(_0x57d159){logger[_0x9cb5('0xe')](_0x9cb5('0xf'),_0xc0c7f4,_0x9cb5('0x10'));logger[_0x9cb5('0x11')](_0x9cb5('0x12'),_0xc0c7f4,_0x9cb5('0x10'),JSON[_0x9cb5('0x13')](_0x57d159));if(_0x57d159[_0x9cb5('0x14')]){if(_0x57d159[_0x9cb5('0x14')][_0x9cb5('0x15')]===0x1f4){logger['error'](_0x9cb5('0xf'),_0xc0c7f4,_0x57d159[_0x9cb5('0x14')][_0x9cb5('0x16')]);return _0x404e9c(_0x57d159[_0x9cb5('0x14')][_0x9cb5('0x16')]);}logger['error'](_0x9cb5('0xf'),_0xc0c7f4,_0x57d159[_0x9cb5('0x14')][_0x9cb5('0x16')]);return _0x5100d5(_0x57d159[_0x9cb5('0x14')]['message']);}else{logger[_0x9cb5('0xe')](_0x9cb5('0xf'),_0xc0c7f4,'request\x20sent');_0x5100d5(_0x57d159[_0x9cb5('0x17')][_0x9cb5('0x16')]);}})[_0x9cb5('0x18')](function(_0x75f540){logger['error'](_0x9cb5('0xf'),_0xc0c7f4,_0x75f540);_0x404e9c(_0x75f540);});});} \ No newline at end of file +var _0x4587=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatGroup.socket'];(function(_0x3569fc,_0x525c39){var _0x49c6b1=function(_0x948d89){while(--_0x948d89){_0x3569fc['push'](_0x3569fc['shift']());}};_0x49c6b1(++_0x525c39);}(_0x4587,0xa5));var _0x7458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4587[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7458('0x0'));var util=require(_0x7458('0x1'));var moment=require(_0x7458('0x2'));var BPromise=require(_0x7458('0x3'));var rs=require(_0x7458('0x4'));var fs=require('fs');var Redis=require(_0x7458('0x5'));var db=require(_0x7458('0x6'))['db'];var utils=require(_0x7458('0x7'));var logger=require('../../config/logger')(_0x7458('0x8'));var config=require(_0x7458('0x9'));var jayson=require(_0x7458('0xa'));var client=jayson[_0x7458('0xb')][_0x7458('0xc')]({'port':0x232a});config['redis']=_[_0x7458('0xd')](config[_0x7458('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x7458('0xf'))(new Redis(config[_0x7458('0xe')]));require(_0x7458('0x10'))['register'](socket);function respondWithRpcPromise(_0x1691f6,_0xa8329a,_0x3e8950){return new BPromise(function(_0x434fb4,_0x11a4db){return client['request'](_0x1691f6,_0x3e8950)['then'](function(_0x125016){logger['info'](_0x7458('0x11'),_0xa8329a,_0x7458('0x12'));logger[_0x7458('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xa8329a,_0x7458('0x12'),JSON['stringify'](_0x125016));if(_0x125016[_0x7458('0x14')]){if(_0x125016['error'][_0x7458('0x15')]===0x1f4){logger[_0x7458('0x14')]('ChatGroup,\x20%s,\x20%s',_0xa8329a,_0x125016[_0x7458('0x14')][_0x7458('0x16')]);return _0x11a4db(_0x125016[_0x7458('0x14')]['message']);}logger[_0x7458('0x14')](_0x7458('0x11'),_0xa8329a,_0x125016['error']['message']);return _0x434fb4(_0x125016['error']['message']);}else{logger[_0x7458('0x17')](_0x7458('0x11'),_0xa8329a,'request\x20sent');_0x434fb4(_0x125016[_0x7458('0x18')][_0x7458('0x16')]);}})[_0x7458('0x19')](function(_0x4de8d5){logger['error'](_0x7458('0x11'),_0xa8329a,_0x4de8d5);_0x11a4db(_0x4de8d5);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index b26ba6e..88ad090 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 _0x9c38=['chatGroup:','./chatGroup.events','save','remove','removeListener','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9c38,0x1bd));var _0x89c3=function(_0x5dd0b2,_0x57e3db){_0x5dd0b2=_0x5dd0b2-0x0;var _0x142ca3=_0x9c38[_0x5dd0b2];return _0x142ca3;};'use strict';var ChatGroupEvents=require(_0x89c3('0x0'));var events=[_0x89c3('0x1'),_0x89c3('0x2'),'update'];function createListener(_0x58b52b,_0x59c535){return function(_0x262722){_0x59c535['emit'](_0x58b52b,_0x262722);};}function removeListener(_0x147ea2,_0x33e864){return function(){ChatGroupEvents[_0x89c3('0x3')](_0x147ea2,_0x33e864);};}exports['register']=function(_0x208dce){for(var _0x4be264=0x0,_0x397837=events[_0x89c3('0x4')];_0x4be264<_0x397837;_0x4be264++){var _0x20ac95=events[_0x4be264];var _0x131c42=createListener(_0x89c3('0x5')+_0x20ac95,_0x208dce);ChatGroupEvents['on'](_0x20ac95,_0x131c42);}}; \ No newline at end of file +var _0x7ead=['./chatGroup.events','remove','removeListener','register'];(function(_0x1ee46d,_0x29f2a5){var _0x57b41c=function(_0x23a3a5){while(--_0x23a3a5){_0x1ee46d['push'](_0x1ee46d['shift']());}};_0x57b41c(++_0x29f2a5);}(_0x7ead,0x1a4));var _0xd7ea=function(_0x4ca217,_0x166e6c){_0x4ca217=_0x4ca217-0x0;var _0x1216e9=_0x7ead[_0x4ca217];return _0x1216e9;};'use strict';var ChatGroupEvents=require(_0xd7ea('0x0'));var events=['save',_0xd7ea('0x1'),'update'];function createListener(_0x495c38,_0x523f31){return function(_0x3d229d){_0x523f31['emit'](_0x495c38,_0x3d229d);};}function removeListener(_0x38883d,_0x4dd705){return function(){ChatGroupEvents[_0xd7ea('0x2')](_0x38883d,_0x4dd705);};}exports[_0xd7ea('0x3')]=function(_0x5973d1){for(var _0xb3d95d=0x0,_0x58be90=events['length'];_0xb3d95d<_0x58be90;_0xb3d95d++){var _0x4b6e25=events[_0xb3d95d];var _0x5d2fa5=createListener('chatGroup:'+_0x4b6e25,_0x5973d1);ChatGroupEvents['on'](_0x4b6e25,_0x5d2fa5);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index b3afe9e..ea491b4 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 _0x3f00=['isAuthenticated','index','get','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','update','delete','destroy','removeMembers','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x267d34,_0x48a3b4){var _0x33eabc=function(_0x51a7be){while(--_0x51a7be){_0x267d34['push'](_0x267d34['shift']());}};_0x33eabc(++_0x48a3b4);}(_0x3f00,0x172));var _0x03f0=function(_0x4c9d50,_0x118495){_0x4c9d50=_0x4c9d50-0x0;var _0x3f97e4=_0x3f00[_0x4c9d50];return _0x3f97e4;};'use strict';var multer=require(_0x03f0('0x0'));var util=require('util');var path=require(_0x03f0('0x1'));var timeout=require(_0x03f0('0x2'));var express=require(_0x03f0('0x3'));var router=express['Router']();var auth=require(_0x03f0('0x4'));var interaction=require(_0x03f0('0x5'));var config=require(_0x03f0('0x6'));var controller=require(_0x03f0('0x7'));router['get']('/',auth[_0x03f0('0x8')](),controller[_0x03f0('0x9')]);router[_0x03f0('0xa')](_0x03f0('0xb'),auth['isAuthenticated'](),controller[_0x03f0('0xc')]);router[_0x03f0('0xa')](_0x03f0('0xd'),auth[_0x03f0('0x8')](),controller['show']);router[_0x03f0('0xa')](_0x03f0('0xe'),auth['isAuthenticated'](),controller[_0x03f0('0xf')]);router[_0x03f0('0xa')](_0x03f0('0x10'),auth[_0x03f0('0x8')](),controller[_0x03f0('0x11')]);router[_0x03f0('0xa')](_0x03f0('0x12'),auth[_0x03f0('0x8')](),controller[_0x03f0('0x13')]);router[_0x03f0('0x14')]('/',auth['isAuthenticated'](),controller[_0x03f0('0x15')]);router[_0x03f0('0x14')](_0x03f0('0x10'),auth[_0x03f0('0x8')](),controller['addMembers']);router['post']('/:id/messages',auth[_0x03f0('0x8')](),controller[_0x03f0('0x16')]);router['put'](_0x03f0('0xd'),auth[_0x03f0('0x8')](),controller[_0x03f0('0x17')]);router[_0x03f0('0x18')](_0x03f0('0xd'),auth[_0x03f0('0x8')](),controller[_0x03f0('0x19')]);router[_0x03f0('0x18')](_0x03f0('0x10'),auth['isAuthenticated'](),controller[_0x03f0('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xf8cc=['/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','put','/:id','update','delete','removeMembers','exports','multer','connect-timeout','express','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xf8cc,0xaf));var _0xcf8c=function(_0x471aeb,_0x4f205f){_0x471aeb=_0x471aeb-0x0;var _0x52a22f=_0xf8cc[_0x471aeb];return _0x52a22f;};'use strict';var multer=require(_0xcf8c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcf8c('0x1'));var express=require(_0xcf8c('0x2'));var router=express['Router']();var auth=require(_0xcf8c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcf8c('0x4'));var controller=require(_0xcf8c('0x5'));router[_0xcf8c('0x6')]('/',auth[_0xcf8c('0x7')](),controller[_0xcf8c('0x8')]);router[_0xcf8c('0x6')](_0xcf8c('0x9'),auth['isAuthenticated'](),controller[_0xcf8c('0xa')]);router[_0xcf8c('0x6')]('/:id',auth[_0xcf8c('0x7')](),controller[_0xcf8c('0xb')]);router[_0xcf8c('0x6')](_0xcf8c('0xc'),auth[_0xcf8c('0x7')](),controller[_0xcf8c('0xd')]);router['get'](_0xcf8c('0xe'),auth[_0xcf8c('0x7')](),controller[_0xcf8c('0xf')]);router['get'](_0xcf8c('0x10'),auth[_0xcf8c('0x7')](),controller['getMessages']);router[_0xcf8c('0x11')]('/',auth[_0xcf8c('0x7')](),controller[_0xcf8c('0x12')]);router[_0xcf8c('0x11')](_0xcf8c('0xe'),auth[_0xcf8c('0x7')](),controller[_0xcf8c('0x13')]);router[_0xcf8c('0x11')](_0xcf8c('0x10'),auth[_0xcf8c('0x7')](),controller[_0xcf8c('0x14')]);router[_0xcf8c('0x15')](_0xcf8c('0x16'),auth[_0xcf8c('0x7')](),controller[_0xcf8c('0x17')]);router[_0xcf8c('0x18')](_0xcf8c('0x16'),auth[_0xcf8c('0x7')](),controller['destroy']);router[_0xcf8c('0x18')](_0xcf8c('0xe'),auth[_0xcf8c('0x7')](),controller[_0xcf8c('0x19')]);module[_0xcf8c('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 83fe9cc..0946cf7 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 _0x12bf=['INTEGER','ENUM','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x12bf,0x115));var _0xf12b=function(_0x3d31a5,_0x379e19){_0x3d31a5=_0x3d31a5-0x0;var _0x378776=_0x12bf[_0x3d31a5];return _0x378776;};'use strict';var Sequelize=require(_0xf12b('0x0'));module[_0xf12b('0x1')]={'closed':{'type':Sequelize[_0xf12b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf12b('0x3')]},'ratingType':{'type':Sequelize[_0xf12b('0x4')]('star','thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xf12b('0x5')]},'pathTranscript':{'type':Sequelize[_0xf12b('0x5')]},'mailTranscript':{'type':Sequelize[_0xf12b('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf12b('0x7')]},'disposition':{'type':Sequelize[_0xf12b('0x6')]},'note':{'type':Sequelize[_0xf12b('0x6')]},'browserName':{'type':Sequelize[_0xf12b('0x6')]},'browserVersion':{'type':Sequelize[_0xf12b('0x6')]},'osName':{'type':Sequelize[_0xf12b('0x6')]},'osVersion':{'type':Sequelize[_0xf12b('0x6')]},'deviceModel':{'type':Sequelize[_0xf12b('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xf12b('0x6')]},'referer':{'type':Sequelize[_0xf12b('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xf12b('0x5')](_0xf12b('0x8'))},'read1stAt':{'type':Sequelize[_0xf12b('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf12b('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf12b('0x6')]},'customerPort':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbda1=['ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbda1,0xf8));var _0x1bda=function(_0x512d9d,_0x322a95){_0x512d9d=_0x512d9d-0x0;var _0x274ad6=_0xbda1[_0x512d9d];return _0x274ad6;};'use strict';var Sequelize=require('sequelize');module[_0x1bda('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1bda('0x1')]},'ratingType':{'type':Sequelize[_0x1bda('0x2')](_0x1bda('0x3'),_0x1bda('0x4')),'defaultValue':_0x1bda('0x3')},'ratingMessage':{'type':Sequelize[_0x1bda('0x5')]},'pathTranscript':{'type':Sequelize[_0x1bda('0x5')]},'mailTranscript':{'type':Sequelize[_0x1bda('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1bda('0x7')]},'disposition':{'type':Sequelize[_0x1bda('0x6')]},'note':{'type':Sequelize[_0x1bda('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x1bda('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x1bda('0x6')]},'deviceVendor':{'type':Sequelize[_0x1bda('0x6')]},'deviceType':{'type':Sequelize[_0x1bda('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x1bda('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x1bda('0x8'))},'read1stAt':{'type':Sequelize[_0x1bda('0x7')]},'lastMsgAt':{'type':Sequelize[_0x1bda('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1bda('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1bda('0x6')]},'customerPort':{'type':Sequelize[_0x1bda('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 726312b..ce14dd3 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 _0x6aa7=['basename','close','mailTranscript','format','now','ChatMessage','Messages','ChatWebsite','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','ChatInteractionId','options','findAll','getMyMessages','includeAgent','includeAll','setTags','spread','Tag','color','chatInteractionTags:save','unix','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Account','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','Owner','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','pipe','createWriteStream','out','firstName','views','downloadInteraction.html','toFile','transcript-','.pdf','log','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','count','offset','limit','set','apply','reject','update','destroy','end','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','ChatInteraction','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','select','field','from','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','clone','DESC','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','params','include','create','body','describe','abandon','entity\x20not\x20found','sendStatus','Sequelize','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','mimetype','Attachment','findOne','Unauthorized','attachId','download','join','root','server/files/attachments/'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6aa7,0x178));var _0x76aa=function(_0x4bb8f2,_0x3e7466){_0x4bb8f2=_0x4bb8f2-0x0;var _0x473b99=_0x6aa7[_0x4bb8f2];return _0x473b99;};'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 as=require(_0x76aa('0x11'));var hardwareService=require(_0x76aa('0x12'));var logger=require(_0x76aa('0x13'))(_0x76aa('0x14'));var utils=require(_0x76aa('0x15'));var config=require(_0x76aa('0x16'));var db=require(_0x76aa('0x17'))['db'];config['redis']=_[_0x76aa('0x18')](config['redis'],{'host':_0x76aa('0x19'),'port':0x18eb});var socket=require(_0x76aa('0x1a'))(new Redis(config[_0x76aa('0x1b')]));require(_0x76aa('0x1c'))[_0x76aa('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x76aa('0x1e')]({'port':0x232b});var client9004=jayson['client'][_0x76aa('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x319bf1,_0x5cf594,_0x2111c7){if(_0x2111c7){var _0x550d9a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x550d9a[_0x76aa('0x1f')](_0x5cf594)){return _0x319bf1;}else{throw new db['Sequelize'][(_0x76aa('0x20'))](_0x76aa('0x21'));}}else{return _0x319bf1;}}function respondWithRpcPromise(_0x2ab30b,_0x21c16d,_0xa1bc7,_0x3ead3f){return new BPromise(function(_0x496902,_0x5d6202){var _0x256636=_0x3ead3f||client;return _0x256636[_0x76aa('0x22')](_0x2ab30b,_0xa1bc7)[_0x76aa('0x23')](function(_0x15b931){logger[_0x76aa('0x24')](_0x76aa('0x25'),_0x21c16d,_0x76aa('0x26'));logger[_0x76aa('0x27')](_0x76aa('0x28'),_0x21c16d,'request\x20sent',JSON[_0x76aa('0x29')](_0x15b931));if(_0x15b931[_0x76aa('0x2a')]){if(_0x15b931[_0x76aa('0x2a')]['code']===0x1f4){logger[_0x76aa('0x2a')](_0x76aa('0x25'),_0x21c16d,_0x15b931[_0x76aa('0x2a')][_0x76aa('0x2b')]);return _0x5d6202(_0x15b931[_0x76aa('0x2a')][_0x76aa('0x2b')]);}logger[_0x76aa('0x2a')](_0x76aa('0x25'),_0x21c16d,_0x15b931[_0x76aa('0x2a')][_0x76aa('0x2b')]);return _0x496902(_0x15b931[_0x76aa('0x2a')][_0x76aa('0x2b')]);}else{logger[_0x76aa('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x21c16d,_0x76aa('0x26'));_0x496902(_0x15b931[_0x76aa('0x2c')][_0x76aa('0x2b')]);}})[_0x76aa('0x2d')](function(_0xa1e6){logger[_0x76aa('0x2a')](_0x76aa('0x25'),_0x21c16d,_0xa1e6);_0x5d6202(_0xa1e6);});});}function respondWithStatusCode(_0x282d0a,_0xd12a99){_0xd12a99=_0xd12a99||0xcc;return function(_0x1bdc3d){if(_0x1bdc3d){return _0x282d0a['sendStatus'](_0xd12a99);}return _0x282d0a[_0x76aa('0x2e')](_0xd12a99)['end']();};}function respondWithResult(_0x994550,_0x365ff8){_0x365ff8=_0x365ff8||0xc8;return function(_0x2dec94){if(_0x2dec94){return _0x994550[_0x76aa('0x2e')](_0x365ff8)[_0x76aa('0x2f')](_0x2dec94);}};}function respondWithFilteredResult(_0x2d6213,_0x2ee0f9){return function(_0x3827ec){if(_0x3827ec){var _0x19fd4f=_0x3827ec[_0x76aa('0x30')],_0x3ea05a=_0x2ee0f9[_0x76aa('0x31')],_0x5edcd8=_0x2ee0f9[_0x76aa('0x31')]+_0x2ee0f9[_0x76aa('0x32')],_0x430ad6;if(_0x5edcd8>=_0x19fd4f){_0x5edcd8=_0x19fd4f;_0x430ad6=0xc8;}else{_0x430ad6=0xce;}_0x2d6213[_0x76aa('0x2e')](_0x430ad6);return _0x2d6213[_0x76aa('0x33')]('Content-Range',_0x3ea05a+'-'+_0x5edcd8+'/'+_0x19fd4f)[_0x76aa('0x2f')](_0x3827ec);}return null;};}function patchUpdates(_0x25a11f){return function(_0x5a0f72){try{jsonpatch[_0x76aa('0x34')](_0x5a0f72,_0x25a11f,!![]);}catch(_0x58d860){return BPromise[_0x76aa('0x35')](_0x58d860);}return _0x5a0f72['save']();};}function saveUpdates(_0x8479a3,_0x5653e0){return function(_0x58f135){if(_0x58f135){return _0x58f135[_0x76aa('0x36')](_0x8479a3)[_0x76aa('0x23')](function(_0x198fcb){return _0x198fcb;});}return null;};}function removeEntity(_0x37dfab,_0x595a0f){return function(_0x592596){if(_0x592596){return _0x592596[_0x76aa('0x37')]()[_0x76aa('0x23')](function(){_0x37dfab[_0x76aa('0x2e')](0xcc)[_0x76aa('0x38')]();});}};}function handleEntityNotFound(_0x23029e,_0x5b57d8){return function(_0x9ce5f4){if(!_0x9ce5f4){_0x23029e['sendStatus'](0x194);}return _0x9ce5f4;};}function handleError(_0x5086f5,_0x4fdbde){_0x4fdbde=_0x4fdbde||0x1f4;return function(_0x36d64e){logger[_0x76aa('0x2a')](_0x36d64e[_0x76aa('0x39')]);if(_0x36d64e['name']){delete _0x36d64e[_0x76aa('0x3a')];}_0x5086f5[_0x76aa('0x2e')](_0x4fdbde)[_0x76aa('0x3b')](_0x36d64e);};}function getInteractionUsers(_0x4e131a,_0x113770){return new BPromise(function(_0x1638db,_0x2f7726){try{if(_0x113770[_0x4e131a['id']]){_0x4e131a[_0x76aa('0x3c')]=_[_0x76aa('0x3d')](_0x113770[_0x4e131a['id']],function(_0x982e62){return{'id':_0x982e62['id'],'fullname':_0x982e62[_0x76aa('0x3e')]};});}}catch(_0x307d67){_0x2f7726(_0x307d67);}_0x1638db(_0x4e131a);});}function getInteractionTags(_0x283179,_0x5f022a){return new BPromise(function(_0x1525cb,_0x4185ec){try{if(_0x283179[_0x76aa('0x3f')]){_0x283179[_0x76aa('0x40')]=[];_0x283179[_0x76aa('0x3f')][_0x76aa('0x41')](',')['forEach'](function(_0x5a16ac){_0x283179[_0x76aa('0x40')][_0x76aa('0x42')](_0x5f022a[_0x5a16ac]);});}delete _0x283179[_0x76aa('0x3f')];}catch(_0x365612){_0x4185ec(_0x365612);}_0x1525cb(_0x283179);});}function updateChatInteraction(_0x50599f,_0x174a14,_0x403084){return new BPromise(function(_0x154567,_0x30cdcb){return getInteractionUsers(_0x50599f,_0x403084)[_0x76aa('0x23')](function(_0x4aa2f3){return getInteractionTags(_0x4aa2f3,_0x174a14);})[_0x76aa('0x23')](function(_0x556f59){_0x154567(_0x556f59);})[_0x76aa('0x2d')](function(_0x54b8fd){_0x30cdcb(_0x54b8fd);});});}exports['index']=function(_0x4f7f3a,_0x144f0a){var _0x541594={},_0x5cf314={},_0x5be7ce={'count':0x0,'rows':[]};var _0x11531b=_[_0x76aa('0x3d')](db[_0x76aa('0x43')][_0x76aa('0x44')],function(_0x27a52e){return{'name':_0x27a52e['fieldName'],'type':_0x27a52e[_0x76aa('0x45')][_0x76aa('0x46')]};});_0x5cf314[_0x76aa('0x47')]=_[_0x76aa('0x3d')](_0x11531b,_0x76aa('0x3a'));_0x5cf314['query']=_[_0x76aa('0x48')](_0x4f7f3a[_0x76aa('0x49')]);_0x5cf314['filters']=_[_0x76aa('0x4a')](_0x5cf314['model'],_0x5cf314[_0x76aa('0x49')]);_0x541594[_0x76aa('0x4b')]=_[_0x76aa('0x4a')](_0x5cf314[_0x76aa('0x47')],qs[_0x76aa('0x4c')](_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x4c')]));_0x541594[_0x76aa('0x4b')]=_0x541594[_0x76aa('0x4b')][_0x76aa('0x4d')]?_0x541594['attributes']:_0x5cf314[_0x76aa('0x47')];if(!_0x4f7f3a['query'][_0x76aa('0x4e')](_0x76aa('0x4f'))){_0x541594[_0x76aa('0x32')]=qs[_0x76aa('0x32')](_0x4f7f3a['query']['limit']);_0x541594[_0x76aa('0x31')]=qs['offset'](_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x31')]);}_0x541594[_0x76aa('0x50')]=qs[_0x76aa('0x51')](_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x51')]);_0x541594['where']=qs['filters'](_[_0x76aa('0x52')](_0x4f7f3a[_0x76aa('0x49')],_0x5cf314[_0x76aa('0x53')]));var _0x40e8ff=[];var _0x18c679=squel[_0x76aa('0x54')]()['field']('id')[_0x76aa('0x55')](_0x76aa('0x3a'))[_0x76aa('0x55')]('color')[_0x76aa('0x56')]('tools_tags');var _0x2a663a=squel['select']()[_0x76aa('0x55')](_0x76aa('0x57'))[_0x76aa('0x55')](_0x76aa('0x58'))[_0x76aa('0x55')](_0x76aa('0x59'))[_0x76aa('0x56')]('user_has_chat_interactions','ui')[_0x76aa('0x5a')]('users','u',_0x76aa('0x5b'));var _0x311bd5=squel[_0x76aa('0x54')]()[_0x76aa('0x56')](_0x76aa('0x5c'),'i')[_0x76aa('0x5a')](_0x76aa('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x76aa('0x5a')](_0x76aa('0x5e'),'o',_0x76aa('0x5f'))[_0x76aa('0x5a')]('chat_websites','a',_0x76aa('0x60'))[_0x76aa('0x5a')](_0x76aa('0x61'),'me',_0x76aa('0x62'))[_0x76aa('0x5a')](_0x76aa('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x76aa('0x5a')](_0x76aa('0x64'),'t',_0x76aa('0x65'));var _0x3620d0=squel[_0x76aa('0x66')]();var _0x2fdc4f=[];var _0x37babe=squel['expr']();var _0x4910fb;if(_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x67')]){_0x4910fb=as['parseSearch'](_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x67')]);var _0x4f832d=_0x4910fb[_0x76aa('0x68')];for(var _0x5e5993=0x0;_0x5e5993<_0x4910fb[_0x76aa('0x69')][_0x76aa('0x4d')];_0x5e5993++){var _0x24662d=_0x4910fb[_0x76aa('0x69')][_0x5e5993];var _0x3376ec='i';var _0x30573a=_[_0x76aa('0x6a')](_0x11531b,['name',_0x24662d[_0x76aa('0x55')]]);if(!_0x30573a){switch(_0x24662d['field']){case _0x76aa('0x6b'):if(_0x24662d[_0x76aa('0x6c')]==0x1){_0x311bd5[_0x76aa('0x6d')]('`'+_0x24662d[_0x76aa('0x55')]+_0x76aa('0x6e'));}else{_0x311bd5[_0x76aa('0x6d')]('`'+_0x24662d[_0x76aa('0x55')]+_0x76aa('0x6f'));}break;case _0x76aa('0x70'):if(_0x24662d['operator']===_0x76aa('0x71')){if(_0x24662d[_0x76aa('0x6c')][_0x76aa('0x41')]('\x20')[_0x76aa('0x4d')]>0x1){_0x3620d0[_0x4f832d](_0x76aa('0x72'),qs[_0x76aa('0x73')](_0x24662d[_0x76aa('0x6c')]),null);}else{var _0x157540='%'+_0x24662d['value']+'%';_0x3620d0[_0x4f832d](_0x76aa('0x74'),_0x157540,_0x157540,_0x157540);}}else{_0x30573a=_['find'](_0x11531b,[_0x76aa('0x3a'),_0x76aa('0x75')]);_0x24662d[_0x76aa('0x55')]=_0x76aa('0x75');_0x557c11=as[_0x76aa('0x76')](_0x3376ec,_0x30573a[_0x76aa('0x45')],_0x24662d);_0x3620d0[_0x4f832d](_0x557c11[_0x76aa('0x77')],_0x557c11['value'][_0x76aa('0x78')],_0x557c11[_0x76aa('0x6c')]['end']);}break;case'Tag':var _0x40429c=_0x24662d[_0x76aa('0x6c')]['split'](',')[_0x76aa('0x3d')](function(_0x35a21f){return Number(_0x35a21f);});_0x40429c[_0x76aa('0x79')](function(_0x5b460e){_0x37babe['or'](_0x76aa('0x7a'),'%,'+_0x5b460e+',%');});_0x2fdc4f=_['union'](_0x2fdc4f,_0x40429c);break;case _0x76aa('0x7b'):if(_0x24662d[_0x76aa('0x7c')]===_0x76aa('0x71')){_0x3620d0[_0x4f832d](_0x76aa('0x7d'),'%'+_0x24662d['value']+'%',null);}else{_0x30573a=_['find'](_0x11531b,[_0x76aa('0x3a'),'UserId']);_0x24662d[_0x76aa('0x55')]=_0x76aa('0x7e');_0x557c11=as[_0x76aa('0x76')](_0x3376ec,_0x30573a[_0x76aa('0x45')],_0x24662d);_0x3620d0[_0x4f832d](_0x557c11[_0x76aa('0x77')],_0x557c11[_0x76aa('0x6c')][_0x76aa('0x78')],_0x557c11[_0x76aa('0x6c')][_0x76aa('0x38')]);}break;case'body':_0x557c11=as[_0x76aa('0x76')]('me',null,_0x24662d);_0x3620d0[_0x4f832d](_0x557c11[_0x76aa('0x77')],_0x557c11[_0x76aa('0x6c')][_0x76aa('0x78')],_0x557c11['value']['end']);break;}}else{var _0x557c11=as[_0x76aa('0x76')](_0x3376ec,_0x30573a['type'],_0x24662d);_0x3620d0[_0x4f832d](_0x557c11[_0x76aa('0x77')],_0x557c11[_0x76aa('0x6c')][_0x76aa('0x78')],_0x557c11[_0x76aa('0x6c')]['end']);}}}else{var _0x7eb34e=_(_0x4f7f3a['query'])[_0x76aa('0x48')]()[_0x76aa('0x3d')](function(_0x122cd7){return _[_0x76aa('0x7f')](_0x11531b,[_0x76aa('0x3a'),_0x122cd7])?_0x122cd7:undefined;})['compact']()[_0x76aa('0x6c')]();if(!_[_0x76aa('0x80')](_0x7eb34e)){_0x7eb34e[_0x76aa('0x79')](function(_0x3601d6){if(_0x3601d6===_0x76aa('0x81')){_0x311bd5[_0x76aa('0x82')](_0x76aa('0x83'),[][_0x76aa('0x84')](_0x4f7f3a['query'][_0x3601d6]));}else if(_0x3601d6===_0x76aa('0x85')){var _0x381f44=JSON['parse'](_0x4f7f3a[_0x76aa('0x49')][_0x3601d6])[_0x76aa('0x86')];var _0x325487=JSON[_0x76aa('0x87')](_0x4f7f3a[_0x76aa('0x49')][_0x3601d6])[_0x76aa('0x88')];_0x311bd5[_0x76aa('0x82')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x381f44,_0x325487);}else{if(_0x4f7f3a[_0x76aa('0x49')][_0x3601d6]==='null'){_0x311bd5['where']('i.'+_0x3601d6+_0x76aa('0x89'));}else{_0x311bd5[_0x76aa('0x82')]('i.'+_0x3601d6+'\x20=\x20?',_0x4f7f3a['query'][_0x3601d6]);}}});}if(_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x8a')]){if(_0x4f7f3a[_0x76aa('0x49')]['read']==0x1){_0x311bd5['having'](_0x76aa('0x8b'));}else{_0x311bd5[_0x76aa('0x6d')](_0x76aa('0x8c'));}}if(_0x4f7f3a['query'][_0x76aa('0x8d')]){_0x2fdc4f=_['isArray'](_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x8d')])?_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x8d')]:new Array(_0x4f7f3a[_0x76aa('0x49')]['tag']);_0x2fdc4f['forEach'](function(_0x117faf){_0x37babe['or'](_0x76aa('0x7a'),'%,'+_0x117faf+',%');});}if(_0x4f7f3a[_0x76aa('0x49')]['filter']){var _0x424638=_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x8e')][_0x76aa('0x8f')]('\x5c','\x5c\x5c')[_0x76aa('0x8f')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x76aa('0x90')](_0x424638)){_0x3620d0['or']('i.id\x20LIKE\x20?',_0x424638+'%');}else{_0x3620d0['or'](_0x76aa('0x91'),qs[_0x76aa('0x73')](_0x424638))['or'](_0x76aa('0x92'),_0x424638+'%');}}}_0x311bd5[_0x76aa('0x82')](_0x3620d0);_0x311bd5[_0x76aa('0x93')](_0x76aa('0x94'));var _0x5b3a19={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x490fa4=_0x311bd5[_0x76aa('0x95')]();_0x490fa4[_0x76aa('0x55')]('i.id');_0x490fa4['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x76aa('0x6b'));if(_0x541594[_0x76aa('0x50')]){_0x541594[_0x76aa('0x50')]['forEach'](function(_0x48671a){_0x311bd5[_0x76aa('0x50')]('i.'+_0x48671a[0x0],_0x48671a[0x1]===_0x76aa('0x96')?![]:!![]);});}if(!_[_0x76aa('0x80')](_0x2fdc4f)){_0x311bd5[_0x76aa('0x6d')](_0x37babe);_0x490fa4[_0x76aa('0x82')]('t.id\x20IN\x20?',_0x2fdc4f);}BPromise['resolve']()[_0x76aa('0x23')](function(){if(!_0x4910fb){if(_0x4f7f3a['query']['ChatWebsiteId']||_0x4f7f3a['query'][_0x76aa('0x97')])return;_0x490fa4[_0x76aa('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x311bd5[_0x76aa('0x82')](_0x76aa('0x98'));return;}return _0x4f7f3a['user'][_0x76aa('0x99')]({'attributes':['id'],'raw':!![]})[_0x76aa('0x23')](function(_0x11d91f){if(_[_0x76aa('0x80')](_0x11d91f)){_0x490fa4[_0x76aa('0x82')](_0x76aa('0x9a'));_0x311bd5[_0x76aa('0x82')](_0x76aa('0x9a'));}else{_0x490fa4[_0x76aa('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0x76aa('0x3d')](_0x11d91f,'id'));_0x311bd5[_0x76aa('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0x76aa('0x3d')](_0x11d91f,'id'));}});})[_0x76aa('0x23')](function(){db[_0x76aa('0x9b')]['query'](_0x490fa4[_0x76aa('0x9c')](),_0x5b3a19)[_0x76aa('0x23')](function(_0x4df4e0){_0x5be7ce[_0x76aa('0x30')]=_0x4df4e0[_0x76aa('0x4d')];if(_0x5be7ce[_0x76aa('0x30')]===0x0)return[];return db['sequelize'][_0x76aa('0x49')](_0x18c679[_0x76aa('0x9c')](),_0x5b3a19)['then'](function(_0x5aabe5){_0x40e8ff=_['keyBy'](_0x5aabe5,'id');_0x5b3a19=_[_0x76aa('0x9d')](_0x5b3a19,{'model':db[_0x76aa('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f7f3a[_0x76aa('0x49')][_0x76aa('0x4c')]){_0x541594['attributes']['forEach'](function(_0x4a449c){_0x311bd5[_0x76aa('0x55')]('i.'+_0x4a449c);});}else{_0x311bd5['field'](_0x76aa('0x9e'),_0x76aa('0x6b'));_0x311bd5['field'](_0x76aa('0x9f'),_0x76aa('0xa0'));_0x311bd5['field'](_0x76aa('0xa1'),_0x76aa('0xa2'));_0x311bd5[_0x76aa('0x55')](_0x76aa('0xa3'));_0x311bd5[_0x76aa('0x55')](_0x76aa('0xa4'),'Contact.firstName');_0x311bd5[_0x76aa('0x55')]('c.lastName','Contact.lastName');_0x311bd5['field']('c.email','Contact.email');_0x311bd5[_0x76aa('0x55')](_0x76aa('0xa5'),_0x76aa('0xa6'));_0x311bd5[_0x76aa('0x55')]('c.mobile',_0x76aa('0xa7'));_0x311bd5[_0x76aa('0x55')](_0x76aa('0xa8'),_0x76aa('0xa9'));_0x311bd5[_0x76aa('0x55')]('o.fullname',_0x76aa('0xaa'));_0x311bd5[_0x76aa('0x55')](_0x76aa('0xab'),_0x76aa('0xac'));_0x311bd5[_0x76aa('0x55')](_0x76aa('0xad'),_0x76aa('0x3f'));}_0x311bd5['limit'](_0x541594[_0x76aa('0x32')]);_0x311bd5[_0x76aa('0x31')](_0x541594['offset']);return db['sequelize'][_0x76aa('0x49')](_0x311bd5[_0x76aa('0x9c')](),_0x5b3a19);})['then'](function(_0x7fd982){_0x2a663a['where'](_0x76aa('0xae'),_['map'](_0x7fd982,'id'));return db[_0x76aa('0x9b')][_0x76aa('0x49')](_0x2a663a[_0x76aa('0x9c')](),_0x5b3a19)[_0x76aa('0x23')](function(_0x3d392d){var _0x534724=_[_0x76aa('0xaf')](_0x3d392d,'ChatInteractionId');var _0x1af32e=[];_0x7fd982[_0x76aa('0x79')](function(_0x53ea01){_0x1af32e['push'](updateChatInteraction(_0x53ea01,_0x40e8ff,_0x534724));});return BPromise[_0x76aa('0xb0')](_0x1af32e);});});})[_0x76aa('0x23')](function(_0x241474){_0x5be7ce[_0x76aa('0xb1')]=_0x241474;return _0x5be7ce;})['then'](respondWithFilteredResult(_0x144f0a,_0x541594));})['catch'](handleError(_0x144f0a,null));};exports[_0x76aa('0xb2')]=function(_0x47cad9,_0x3c928d){var _0x5d18f8={'raw':![],'where':{'id':_0x47cad9[_0x76aa('0xb3')]['id']}},_0x45b761={};_0x45b761['model']=_[_0x76aa('0x48')](db['ChatInteraction']['rawAttributes']);_0x45b761[_0x76aa('0x49')]=_[_0x76aa('0x48')](_0x47cad9['query']);_0x45b761[_0x76aa('0x53')]=_[_0x76aa('0x4a')](_0x45b761[_0x76aa('0x47')],_0x45b761['query']);_0x5d18f8[_0x76aa('0x4b')]=_[_0x76aa('0x4a')](_0x45b761[_0x76aa('0x47')],qs[_0x76aa('0x4c')](_0x47cad9[_0x76aa('0x49')][_0x76aa('0x4c')]));_0x5d18f8[_0x76aa('0x4b')]=_0x5d18f8[_0x76aa('0x4b')][_0x76aa('0x4d')]?_0x5d18f8[_0x76aa('0x4b')]:_0x45b761[_0x76aa('0x47')];if(_0x47cad9[_0x76aa('0x49')]['includeAll']){_0x5d18f8[_0x76aa('0xb4')]=[{'all':!![]}];}_0x5d18f8=_[_0x76aa('0x9d')]({},_0x5d18f8,_0x47cad9['options']);return db[_0x76aa('0x43')][_0x76aa('0x6a')](_0x5d18f8)['then'](handleEntityNotFound(_0x3c928d,null))['then'](respondWithResult(_0x3c928d,null))[_0x76aa('0x2d')](handleError(_0x3c928d,null));};exports[_0x76aa('0xb5')]=function(_0x4ae01e,_0x39a9ca){return db[_0x76aa('0x43')][_0x76aa('0xb5')](_0x4ae01e['body'],{})[_0x76aa('0x23')](respondWithResult(_0x39a9ca,0xc9))[_0x76aa('0x2d')](handleError(_0x39a9ca,null));};exports['update']=function(_0xf58bc0,_0x1c070d){if(_0xf58bc0[_0x76aa('0xb6')]['id']){delete _0xf58bc0[_0x76aa('0xb6')]['id'];}return db[_0x76aa('0x43')][_0x76aa('0x6a')]({'where':{'id':_0xf58bc0['params']['id']}})[_0x76aa('0x23')](handleEntityNotFound(_0x1c070d,null))['then'](saveUpdates(_0xf58bc0[_0x76aa('0xb6')],null))[_0x76aa('0x23')](respondWithResult(_0x1c070d,null))[_0x76aa('0x2d')](handleError(_0x1c070d,null));};exports['destroy']=function(_0x4c5f54,_0x2b482d){return db[_0x76aa('0x43')][_0x76aa('0x6a')]({'where':{'id':_0x4c5f54[_0x76aa('0xb3')]['id']}})[_0x76aa('0x23')](handleEntityNotFound(_0x2b482d,null))[_0x76aa('0x23')](removeEntity(_0x2b482d,null))['catch'](handleError(_0x2b482d,null));};exports['describe']=function(_0x2565a2,_0x109bd3){return db[_0x76aa('0x43')][_0x76aa('0xb7')]()['then'](respondWithResult(_0x109bd3,null))[_0x76aa('0x2d')](handleError(_0x109bd3,null));};exports['customUpdate']=function(_0x54d530,_0x4bc8e3){if(_0x54d530[_0x76aa('0xb6')]['id']){delete _0x54d530[_0x76aa('0xb6')]['id'];}return db['ChatInteraction'][_0x76aa('0x6a')]({'where':{'id':_0x54d530[_0x76aa('0xb3')]['id']}})[_0x76aa('0x23')](handleEntityNotFound(_0x4bc8e3,null))[_0x76aa('0x23')](saveUpdates(_0x54d530[_0x76aa('0xb6')],null))[_0x76aa('0x23')](respondWithResult(_0x4bc8e3,null))[_0x76aa('0x2d')](handleError(_0x4bc8e3,null));};exports['abandon']=function(_0x344ea4,_0x2a3bbf,_0x212adb){if(_0x344ea4[_0x76aa('0xb6')]['id']){delete _0x344ea4[_0x76aa('0xb6')]['id'];}return db[_0x76aa('0x43')]['find']({'where':{'id':_0x344ea4[_0x76aa('0xb3')]['id']}})[_0x76aa('0x23')](function(_0x2cbce9){if(!_0x2cbce9){logger[_0x76aa('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x76aa('0xb8'),0x194,_0x76aa('0xb9'));_0x2a3bbf[_0x76aa('0xba')](0x194);}else{if(_0x2cbce9[_0x76aa('0x7e')]){throw new db[(_0x76aa('0xbb'))]['ValidationError'](_0x76aa('0xbc'));}}return _0x2cbce9;})[_0x76aa('0x23')](function(_0x4f232c){if(_0x4f232c){return _0x4f232c['update']({'closed':_0x344ea4[_0x76aa('0xb6')][_0x76aa('0xbd')],'disposition':_0x344ea4[_0x76aa('0xb6')][_0x76aa('0xbe')]})[_0x76aa('0x23')](function(_0x293221){return _0x293221;});}})['then'](function(_0x3d5f88){return respondWithRpcPromise(_0x76aa('0xbf'),_0x76aa('0xb8'),_0x344ea4[_0x76aa('0xb6')],client9004);})[_0x76aa('0x23')](respondWithResult(_0x2a3bbf,null))[_0x76aa('0x2d')](handleError(_0x2a3bbf,null));};exports['attachmentUpload']=function(_0x2d64bd,_0x393c0d,_0x215bcc){_0x2d64bd[_0x76aa('0xb6')][_0x76aa('0x3a')]=_0x2d64bd[_0x76aa('0xc0')]['originalname'];_0x2d64bd[_0x76aa('0xb6')]['basename']=_0x2d64bd[_0x76aa('0xc0')]['filename'];_0x2d64bd[_0x76aa('0xb6')][_0x76aa('0x45')]=_0x2d64bd['file'][_0x76aa('0xc1')];return db[_0x76aa('0xc2')][_0x76aa('0xb5')](_0x2d64bd['body'])[_0x76aa('0x23')](respondWithResult(_0x393c0d,0xc9))[_0x76aa('0x2d')](handleError(_0x393c0d,null));};exports['attachmentDownload']=function(_0x36d05d,_0xfe926d,_0x343adf){return db[_0x76aa('0x43')][_0x76aa('0xc3')]({'where':{'id':_0x36d05d[_0x76aa('0xb3')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xfe926d,null))[_0x76aa('0x23')](function(_0x159e41){if(_0x159e41){if(_0x159e41[_0x76aa('0xbd')]){return _0xfe926d[_0x76aa('0x2e')](0x193)[_0x76aa('0x2f')]({'status':0x193,'message':_0x76aa('0xc4')});}return db[_0x76aa('0xc2')][_0x76aa('0xc3')]({'where':{'id':_0x36d05d[_0x76aa('0x49')][_0x76aa('0xc5')]},'raw':!![]})[_0x76aa('0x23')](handleEntityNotFound(_0xfe926d,null));}})['then'](function(_0x219e47){if(_0x219e47){return _0xfe926d[_0x76aa('0xc6')](path[_0x76aa('0xc7')](config[_0x76aa('0xc8')],_0x76aa('0xc9'),_0x219e47[_0x76aa('0xca')]));}})[_0x76aa('0x2d')](handleError(_0xfe926d,null));};exports[_0x76aa('0xcb')]=function(_0x530eae,_0x30dcf7){var _0x53090c=null;var _0x439800=null;var _0xae171=null;var _0x2045a2=null;if(_0x530eae['body']['id']){delete _0x530eae[_0x76aa('0xb6')]['id'];}if(_0x530eae[_0x76aa('0xb6')][_0x76aa('0xcc')]){_0x2045a2=path[_0x76aa('0xc7')](config[_0x76aa('0xc8')],'server/files/chat/upload/',util[_0x76aa('0xcd')]('transcript-%s.txt',Date[_0x76aa('0xce')]()));_0x530eae[_0x76aa('0xb6')]['pathTranscript']=_0x2045a2;}return db[_0x76aa('0x43')][_0x76aa('0x6a')]({'where':{'id':_0x530eae[_0x76aa('0xb3')]['id']},'include':[{'model':db[_0x76aa('0xcf')],'as':_0x76aa('0xd0'),'include':[{'model':db[_0x76aa('0x7b')],'as':_0x76aa('0x7b')}]}]})[_0x76aa('0x23')](handleEntityNotFound(_0x30dcf7,null))['then'](saveUpdates(_0x530eae[_0x76aa('0xb6')],null))[_0x76aa('0x23')](function(_0x26a71a){if(_0x26a71a){_0x53090c=_0x26a71a;return db[_0x76aa('0xd1')][_0x76aa('0x6a')]({'where':{'id':_0x53090c[_0x76aa('0x81')]}});}})[_0x76aa('0x23')](function(_0x260bca){if(_0x260bca){_0xae171=_0x260bca;return db['CmContact'][_0x76aa('0x6a')]({'where':{'id':_0x53090c[_0x76aa('0x75')]}});}})[_0x76aa('0x23')](function(_0x54e450){if(_0x54e450){_0x439800=_0x54e450;if(_0x2045a2){var _0x24eaef=null;for(var _0x221fab=0x1;_0x221fab<_0x53090c[_0x76aa('0xd0')][_0x76aa('0x4d')];++_0x221fab){_0x24eaef=_0x53090c[_0x76aa('0xd0')][_0x221fab];var _0x5db8d8=_0x24eaef[_0x76aa('0x7e')]?util['format'](_0x76aa('0xd2'),_0xae171[_0x76aa('0xd3')],_0x24eaef[_0x76aa('0x7e')]):_0x76aa('0xd4');var _0x38ff1e=_0x530eae['body'][_0x76aa('0xd5')]||util['format'](_0x76aa('0xd2'),_0x76aa('0xd6'),_0x24eaef[_0x76aa('0x75')]);switch(_0xae171['agentIdentifier']){case _0x76aa('0xd7'):_0x5db8d8=_0x24eaef['UserId']?util[_0x76aa('0xcd')](_0x76aa('0xd2'),_0xae171[_0x76aa('0xd3')],_0x24eaef[_0x76aa('0x7e')]):_0x76aa('0xd4');break;case _0x76aa('0xd8'):_0x5db8d8=_0x24eaef['UserId']?_0x24eaef[_0x76aa('0x7b')][_0x76aa('0xd9')]||_0x24eaef[_0x76aa('0x7b')][_0x76aa('0x3e')]:_0x76aa('0xd4');break;case _0x76aa('0xda'):_0x5db8d8=_0x24eaef[_0x76aa('0x7e')]?_0x24eaef[_0x76aa('0x7b')][_0x76aa('0x3e')]:_0x76aa('0xd4');break;default:_0x5db8d8=_0x24eaef[_0x76aa('0x7e')]?util[_0x76aa('0xcd')](_0x76aa('0xd2'),_0xae171[_0x76aa('0xd3')],_0x24eaef[_0x76aa('0x7e')]):_0x76aa('0xd4');}var _0x12eb72=util[_0x76aa('0xcd')]('[%s]\x20%s:\x20%s\x0a',moment(_0x24eaef[_0x76aa('0x85')])['format'](_0x76aa('0xdb')),_0x24eaef[_0x76aa('0xdc')]==='in'?_0x38ff1e:_0x5db8d8,_0x24eaef['body']);if(!_0x24eaef[_0x76aa('0xdd')]){fs['appendFileSync'](_0x2045a2,_0x12eb72);}}return db[_0x76aa('0xde')][_0x76aa('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0x76aa('0xdf')],'as':'Smtp','raw':!![]}]});}}})[_0x76aa('0x23')](function(_0x48f3d5){if(_0x48f3d5&&_0x48f3d5['Smtp']&&_0x530eae[_0x76aa('0xb6')]){var _0x5a06b0={'tls':{'rejectUnauthorized':![]}};if(_0x48f3d5[_0x76aa('0xe0')]['service']){_0x5a06b0['service']=_0x48f3d5[_0x76aa('0xe0')][_0x76aa('0xe1')];}else{_0x5a06b0[_0x76aa('0xe2')]=_0x48f3d5[_0x76aa('0xe0')][_0x76aa('0xe2')];_0x5a06b0[_0x76aa('0xe3')]=_0x48f3d5[_0x76aa('0xe0')][_0x76aa('0xe3')];_0x5a06b0[_0x76aa('0xe4')]=_0x48f3d5[_0x76aa('0xe0')][_0x76aa('0xe4')];}if(_0x48f3d5[_0x76aa('0xe0')][_0x76aa('0xe5')]){_0x5a06b0[_0x76aa('0xe6')]={'user':_0x48f3d5['Smtp'][_0x76aa('0xe7')],'pass':_0x48f3d5[_0x76aa('0xe0')][_0x76aa('0xe8')]};}return respondWithRpcPromise(_0x76aa('0xe9'),'sendMail',{'account':_0x5a06b0,'message':{'from':util[_0x76aa('0xcd')]('\x22%s\x22\x20<%s>',_0x48f3d5[_0x76aa('0x3a')],_0x48f3d5['email']||_0x48f3d5[_0x76aa('0xe0')]['user']),'to':_0x530eae[_0x76aa('0xb6')]['mailTranscript'],'subject':_0x76aa('0xea'),'text':util['format'](_0x76aa('0xeb'),_0x530eae[_0x76aa('0xb6')]['mailTranscript']),'attachments':[{'path':_0x2045a2}]}})[_0x76aa('0x23')](function(){return _0x53090c;})['catch'](function(_0x1769aa){console['error'](_0x1769aa);});}else{return _0x53090c;}})[_0x76aa('0x23')](respondWithStatusCode(_0x30dcf7,0xc8))['catch'](handleError(_0x30dcf7,null));};exports['addMessage']=function(_0x8577e7,_0x867c24,_0x38b6aa){return db[_0x76aa('0xcf')][_0x76aa('0x6a')]({'where':{'id':_0x8577e7[_0x76aa('0xb3')]['id']}})[_0x76aa('0x23')](handleEntityNotFound(_0x867c24,null))[_0x76aa('0x23')](function(_0x2e95a1){if(_0x2e95a1){return _0x2e95a1[_0x76aa('0xec')](_0x8577e7['body'][_0x76aa('0xed')],_[_0x76aa('0xee')](_0x8577e7[_0x76aa('0xb6')],[_0x76aa('0xed'),'id'])||{});}})[_0x76aa('0x23')](respondWithResult(_0x867c24,null))[_0x76aa('0x2d')](handleError(_0x867c24,null));};exports[_0x76aa('0xef')]=function(_0x3094e2,_0x1cb8ad,_0x41a434){var _0x181303={'raw':![],'where':{}};var _0x3fc660={};var _0x3274a9={'count':0x0,'rows':[]};return db[_0x76aa('0x43')]['findOne']({'where':{'id':_0x3094e2['params']['id']}})[_0x76aa('0x23')](handleEntityNotFound(_0x1cb8ad,null))[_0x76aa('0x23')](function(_0x2630f8){if(_0x2630f8){_0x3fc660['model']=_['keys'](db[_0x76aa('0xcf')][_0x76aa('0x44')]);_0x3fc660[_0x76aa('0x49')]=_['keys'](_0x3094e2[_0x76aa('0x49')]);_0x3fc660[_0x76aa('0x53')]=_['intersection'](_0x3fc660['model'],_0x3fc660['query']);_0x181303[_0x76aa('0x4b')]=_[_0x76aa('0x4a')](_0x3fc660[_0x76aa('0x47')],qs['fields'](_0x3094e2[_0x76aa('0x49')][_0x76aa('0x4c')]));_0x181303['attributes']=_0x181303['attributes'][_0x76aa('0x4d')]?_0x181303[_0x76aa('0x4b')]:_0x3fc660[_0x76aa('0x47')];if(!_0x3094e2['query'][_0x76aa('0x4e')](_0x76aa('0x4f'))){_0x181303['limit']=qs[_0x76aa('0x32')](_0x3094e2[_0x76aa('0x49')]['limit']);_0x181303[_0x76aa('0x31')]=qs[_0x76aa('0x31')](_0x3094e2['query'][_0x76aa('0x31')]);}_0x181303['order']=qs['sort'](_0x3094e2[_0x76aa('0x49')][_0x76aa('0x51')]);_0x181303[_0x76aa('0x82')]=qs[_0x76aa('0x53')](_[_0x76aa('0x52')](_0x3094e2[_0x76aa('0x49')],_0x3fc660[_0x76aa('0x53')]));_0x181303[_0x76aa('0x82')][_0x76aa('0xf0')]=_0x2630f8['id'];if(_0x3094e2[_0x76aa('0x49')]['filter']){_0x181303['where']=_[_0x76aa('0x9d')](_0x181303[_0x76aa('0x82')],{'$or':_[_0x76aa('0x3d')](_0x181303[_0x76aa('0x4b')],function(_0x1436e8){var _0x2c396f={};_0x2c396f[_0x1436e8]={'$like':'%'+_0x3094e2['query'][_0x76aa('0x8e')]+'%'};return _0x2c396f;})});}if(_0x3094e2[_0x76aa('0x49')][_0x76aa('0x86')]){var _0x29fbf6=_0x3094e2[_0x76aa('0x49')][_0x76aa('0x86')][_0x76aa('0x41')](',');var _0x5a8d0f={};_0x5a8d0f[_0x29fbf6[0x0]]={'$gte':moment(_0x29fbf6[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x181303[_0x76aa('0x82')]=_[_0x76aa('0x9d')](_0x181303[_0x76aa('0x82')],_0x5a8d0f);}_0x181303=_[_0x76aa('0x9d')]({},_0x181303,_0x3094e2[_0x76aa('0xf1')]);return db['ChatMessage']['count']({'where':_0x181303[_0x76aa('0x82')]})[_0x76aa('0x23')](function(_0xf72b59){_0x3274a9[_0x76aa('0x30')]=_0xf72b59;if(_0x3094e2[_0x76aa('0x49')]['includeAll']){_0x181303[_0x76aa('0xb4')]=[{'all':!![]}];}return db['ChatMessage'][_0x76aa('0xf2')](_0x181303);})['then'](function(_0x4b3b1c){_0x3274a9[_0x76aa('0xb1')]=_0x4b3b1c;return _0x3274a9;});}})['then'](respondWithFilteredResult(_0x1cb8ad,_0x181303))[_0x76aa('0x2d')](handleError(_0x1cb8ad,null));};exports[_0x76aa('0xf3')]=function(_0x129b02,_0x2ab1b7,_0x1bb495){var _0x38f257={'where':{}},_0x30da8f={},_0x528fa1={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x76aa('0xc3')]({'where':{'id':_0x129b02[_0x76aa('0xb3')]['id']}})[_0x76aa('0x23')](handleEntityNotFound(_0x2ab1b7,null))[_0x76aa('0x23')](function(_0x3a6a44){if(_0x3a6a44){_0x30da8f['model']=_[_0x76aa('0x48')](db['ChatMessage'][_0x76aa('0x44')]);_0x30da8f['query']=_[_0x76aa('0x48')](_0x129b02['query']);_0x30da8f[_0x76aa('0x53')]=_['intersection'](_0x30da8f[_0x76aa('0x47')],_0x30da8f[_0x76aa('0x49')]);_0x38f257[_0x76aa('0x4b')]=_['intersection'](_0x30da8f['model'],qs[_0x76aa('0x4c')](_0x129b02['query'][_0x76aa('0x4c')]));_0x38f257[_0x76aa('0x4b')]=_0x38f257[_0x76aa('0x4b')]['length']?_0x38f257['attributes']:_0x30da8f['model'];if(!_0x129b02['query'][_0x76aa('0x4e')](_0x76aa('0x4f'))){_0x38f257[_0x76aa('0x32')]=qs[_0x76aa('0x32')](_0x129b02[_0x76aa('0x49')][_0x76aa('0x32')]);_0x38f257[_0x76aa('0x31')]=qs[_0x76aa('0x31')](_0x129b02[_0x76aa('0x49')][_0x76aa('0x31')]);}_0x38f257[_0x76aa('0x50')]=qs[_0x76aa('0x51')](_0x129b02[_0x76aa('0x49')]['sort']);_0x38f257[_0x76aa('0x82')]=qs['filters'](_[_0x76aa('0x52')](_0x129b02[_0x76aa('0x49')],_0x30da8f[_0x76aa('0x53')]));_0x38f257[_0x76aa('0x82')][_0x76aa('0xf0')]=_0x3a6a44['id'];if(_0x129b02[_0x76aa('0x49')][_0x76aa('0x8e')]){_0x38f257[_0x76aa('0x82')]=_[_0x76aa('0x9d')](_0x38f257[_0x76aa('0x82')],{'$or':_[_0x76aa('0x3d')](_0x38f257['attributes'],function(_0x5cada7){var _0x319ded={};_0x319ded[_0x5cada7]={'$like':'%'+_0x129b02[_0x76aa('0x49')]['filter']+'%'};return _0x319ded;})});}_0x38f257[_0x76aa('0x82')][_0x76aa('0xdd')]=![];if(_0x129b02[_0x76aa('0x49')]['id']){_0x38f257[_0x76aa('0x82')]['id']={'$gt':_0x129b02[_0x76aa('0x49')]['id']};}_0x38f257=_[_0x76aa('0x9d')]({},_0x38f257,_0x129b02[_0x76aa('0xf1')]);return db['ChatMessage'][_0x76aa('0x30')]({'where':_0x38f257[_0x76aa('0x82')]})['then'](function(_0x5ebf20){_0x528fa1[_0x76aa('0x30')]=_0x5ebf20;_0x38f257[_0x76aa('0xb4')]=[];if(_0x129b02[_0x76aa('0x49')][_0x76aa('0xf4')]){_0x38f257[_0x76aa('0xb4')][_0x76aa('0x42')]({'model':db[_0x76aa('0x7b')],'as':_0x76aa('0x7b'),'attributes':['id',_0x76aa('0x3e'),_0x76aa('0xd9')]});}if(_0x129b02[_0x76aa('0x49')][_0x76aa('0xf5')]){_0x38f257[_0x76aa('0xb4')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x38f257);})[_0x76aa('0x23')](function(_0x54d6b6){_0x528fa1[_0x76aa('0xb1')]=_0x54d6b6;return _0x528fa1;});}})[_0x76aa('0x23')](respondWithFilteredResult(_0x2ab1b7,_0x38f257))['catch'](handleError(_0x2ab1b7,null));};exports['addTags']=function(_0x2a8410,_0x11f219,_0x34b4a1){return db['ChatInteraction']['find']({'where':{'id':_0x2a8410['params']['id']}})[_0x76aa('0x23')](handleEntityNotFound(_0x11f219,null))['then'](function(_0x2afe3e){if(_0x2afe3e){return _0x2afe3e[_0x76aa('0xf6')](_0x2a8410[_0x76aa('0xb6')][_0x76aa('0xed')],_[_0x76aa('0xee')](_0x2a8410[_0x76aa('0xb6')],[_0x76aa('0xed'),'id'])||{})[_0x76aa('0xf7')](function(){return db[_0x76aa('0xf8')][_0x76aa('0xf2')]({'attributes':['id',_0x76aa('0x3a'),_0x76aa('0xf9')],'where':{'id':_0x2a8410[_0x76aa('0xb6')][_0x76aa('0xed')]}});})[_0x76aa('0x23')](function(_0xc850a7){socket['emit'](_0x76aa('0xfa'),{'id':Number(_0x2a8410['params']['id']),'tags':_0xc850a7||[]});return{'id':Number(_0x2a8410[_0x76aa('0xb3')]['id']),'tags':_0xc850a7||[]};});}})['then'](respondWithResult(_0x11f219,null))[_0x76aa('0x2d')](handleError(_0x11f219,null));};exports['removeTags']=function(_0x363c45,_0x4f96a7,_0x48da54){return db[_0x76aa('0x43')][_0x76aa('0x6a')]({'where':{'id':_0x363c45[_0x76aa('0xb3')]['id']}})[_0x76aa('0x23')](handleEntityNotFound(_0x4f96a7,null))[_0x76aa('0x23')](function(_0x2496b0){if(_0x2496b0){return _0x2496b0['removeTags'](_0x363c45[_0x76aa('0x49')][_0x76aa('0xed')]);}})[_0x76aa('0x23')](respondWithStatusCode(_0x4f96a7,null))[_0x76aa('0x2d')](handleError(_0x4f96a7,null));};exports['download']=function(_0x3655dd,_0x778d80){var _0x3936e5=moment()[_0x76aa('0xfb')]()[_0x76aa('0x9c')]();var _0x106e9a=path[_0x76aa('0xc7')](config[_0x76aa('0xc8')],_0x76aa('0xfc'),_0x76aa('0xfd'),_0x76aa('0xfe'));var _0x1a61a2=path['join'](config['root'],_0x76aa('0xfc'),_0x76aa('0xfd'),_0x76aa('0xff'));var _0x37c09b=path[_0x76aa('0xc7')](_0x106e9a,_0x3936e5);var _0x27e72a=util[_0x76aa('0xcd')](_0x76aa('0x100'),_0x3655dd[_0x76aa('0xb3')]['id'],_0x3936e5);var _0x3c6396=path[_0x76aa('0xc7')](_0x106e9a,_0x27e72a);var _0x515e0b=[];_0x515e0b[_0x76aa('0x42')]({'model':db['User'],'as':_0x76aa('0x7b'),'attributes':['id',_0x76aa('0x3e')],'raw':!![]});_0x515e0b[_0x76aa('0x42')]({'model':db[_0x76aa('0x101')],'as':_0x76aa('0x70'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x3655dd[_0x76aa('0x49')]['attachments']){_0x515e0b[_0x76aa('0x42')]({'model':db[_0x76aa('0xc2')],'as':_0x76aa('0xc2'),'raw':!![]});}var _0x238fba=[{'model':db[_0x76aa('0xcf')],'as':'Messages','attributes':['id','body',_0x76aa('0x85'),_0x76aa('0xdc'),_0x76aa('0xdd'),_0x76aa('0x8a')],'include':_0x515e0b}];_0x238fba[_0x76aa('0x42')]({'model':db[_0x76aa('0xd1')],'as':_0x76aa('0x102'),'attributes':['id',_0x76aa('0x3a')]});_0x238fba[_0x76aa('0x42')]({'model':db[_0x76aa('0x7b')],'as':'Owner','attributes':['id',_0x76aa('0x3e')]});return db[_0x76aa('0x43')]['find']({'where':{'id':_0x3655dd[_0x76aa('0xb3')]['id']},'include':_0x238fba})[_0x76aa('0x23')](handleEntityNotFound(_0x778d80,null))[_0x76aa('0x23')](function(_0x3622ab){if(_0x3622ab){var _0x1a5297=_0x3622ab[_0x76aa('0x103')]({'plain':!![]});fs[_0x76aa('0x104')](_0x37c09b);var _0x532532={'format':'A4','border':_0x76aa('0x105'),'header':{'height':_0x76aa('0x106'),'contents':{'first':_0x76aa('0x107')}},'footer':{'height':_0x76aa('0x108'),'contents':{'default':util['format'](_0x76aa('0x109'),util[_0x76aa('0xcd')](_0x76aa('0x10a'),_0x76aa('0x10b'),_0x1a5297['id']),moment()[_0x76aa('0xcd')](_0x76aa('0x10c'))[_0x76aa('0x9c')]())}}};var _0xb0a4e1={'channel':_0x76aa('0x10b'),'account':_0x1a5297[_0x76aa('0x102')][_0x76aa('0x3a')],'agent':_0x1a5297[_0x76aa('0x10d')]?_0x1a5297[_0x76aa('0x10d')][_0x76aa('0x3e')]:'N.A.','createdAt':moment(_0x1a5297['createdAt'])[_0x76aa('0xcd')](_0x76aa('0x10e'))['toString'](),'closedAt':_0x1a5297[_0x76aa('0xbd')]?moment(_0x1a5297['closedAt'])[_0x76aa('0xcd')](_0x76aa('0x10e'))[_0x76aa('0x9c')]():'','disposition':_0x1a5297[_0x76aa('0xbe')],'chatInfo':{'browser':_0x1a5297[_0x76aa('0x10f')],'os':_0x1a5297[_0x76aa('0x110')],'referer':_0x1a5297[_0x76aa('0x111')],'customerIp':_0x1a5297[_0x76aa('0x112')],'customerPort':_0x1a5297['customerPort']?_0x1a5297[_0x76aa('0x113')]:_0x76aa('0x114')},'messages':_(_0x1a5297['Messages'])['tail']()[_0x76aa('0x8e')]({'secret':![]})[_0x76aa('0x3d')](function(_0x33184f){if(_0x33184f[_0x76aa('0xc2')]){var _0x82c977=path['join'](_0x1a61a2,_0x33184f[_0x76aa('0xc2')]['basename']);if(fs[_0x76aa('0x115')](_0x82c977)){fs[_0x76aa('0x116')](_0x82c977)[_0x76aa('0x117')](fs[_0x76aa('0x118')](path[_0x76aa('0xc7')](_0x37c09b,_0x33184f[_0x76aa('0xc2')][_0x76aa('0xca')])));}}return{'date':moment(_0x33184f[_0x76aa('0x85')])[_0x76aa('0xcd')](_0x76aa('0x10e'))[_0x76aa('0x9c')](),'sender':_0x33184f[_0x76aa('0xdc')]===_0x76aa('0x119')?_0x33184f['User']?_0x33184f[_0x76aa('0x7b')]['fullname']:'System':_0x33184f['Contact'][_0x76aa('0x11a')]+(_0x33184f['Contact']['lastName']?'\x20'+_0x33184f['Contact']['lastName']:''),'body':_0x33184f[_0x76aa('0xc2')]?_0x33184f[_0x76aa('0xc2')]['basename']:_0x33184f[_0x76aa('0xb6')],'direction':_0x33184f[_0x76aa('0xdc')]===_0x76aa('0x119')?'A':'C','secret':_0x33184f['secret'],'read':_0x33184f['read'],'attachment':_0x33184f['Attachment']};})[_0x76aa('0x6c')]()};return ejs['renderFile'](path[_0x76aa('0xc7')](config[_0x76aa('0xc8')],'server',_0x76aa('0x11b'),_0x76aa('0x11c')),{'interaction':_0xb0a4e1})['then'](function(_0x2b10fd){return new BPromise(function(_0x17cd1a,_0x2173f1){pdf[_0x76aa('0xb5')](_0x2b10fd,_0x532532)[_0x76aa('0x11d')](path[_0x76aa('0xc7')](_0x37c09b,_0x76aa('0x11e')+_0x1a5297['id']+'-'+_0x3936e5+_0x76aa('0x11f')),function(_0x5c33a3,_0x1b3d2c){if(_0x5c33a3)return _0x2173f1(_0x5c33a3);_0x17cd1a(_0x1b3d2c);});});})[_0x76aa('0x23')](function(){return new BPromise(function(_0x11b9ee,_0x461448){zipdir(_0x37c09b,{'saveTo':_0x3c6396},function(_0x12a4f8,_0x2f6bd9){if(_0x12a4f8)return _0x461448(_0x12a4f8);return _0x11b9ee(_0x2f6bd9);});})[_0x76aa('0x23')](function(){return new BPromise(function(_0x3271a5,_0xf237d3){rimraf(_0x37c09b,function(_0x43d9a7){if(_0x43d9a7)_0xf237d3(_0x43d9a7);return _0x3271a5();});});})['then'](function(){return _0x778d80[_0x76aa('0xc6')](_0x3c6396,_0x27e72a,function(_0x160443){if(_0x160443){console[_0x76aa('0x120')]('err',_0x160443);}else{fs['unlinkSync'](_0x3c6396);}});});});}else{return _0x778d80['sendStatus'](0xc8);}})[_0x76aa('0x2d')](handleError(_0x778d80,null));}; \ No newline at end of file +var _0x7dfd=['clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','count','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','describe','customUpdate','abandon','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','filename','Attachment','attachmentDownload','findOne','json','Unauthorized','download','join','root','server/files/attachments/','basename','close','mailTranscript','transcript-%s.txt','now','ChatMessage','ChatWebsite','CmContact','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','format','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','addMessage','ids','omit','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','N.A.','closedAt','browserName','referer','customerIp','customerPort','tail','existsSync','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','SELECT'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd7df('0x0'));var emlformat=require(_0xd7df('0x1'));var rimraf=require(_0xd7df('0x2'));var zipdir=require(_0xd7df('0x3'));var jsonpatch=require(_0xd7df('0x4'));var rp=require(_0xd7df('0x5'));var moment=require(_0xd7df('0x6'));var BPromise=require(_0xd7df('0x7'));var Mustache=require(_0xd7df('0x8'));var util=require(_0xd7df('0x9'));var path=require(_0xd7df('0xa'));var sox=require(_0xd7df('0xb'));var csv=require(_0xd7df('0xc'));var ejs=require(_0xd7df('0xd'));var fs=require('fs');var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xc'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var db=require(_0xd7df('0x1a'))['db'];config[_0xd7df('0x1b')]=_[_0xd7df('0x1c')](config[_0xd7df('0x1b')],{'host':_0xd7df('0x1d'),'port':0x18eb});var socket=require(_0xd7df('0x1e'))(new Redis(config[_0xd7df('0x1b')]));require(_0xd7df('0x1f'))[_0xd7df('0x20')](socket);var jayson=require(_0xd7df('0x21'));var client=jayson[_0xd7df('0x22')][_0xd7df('0x23')]({'port':0x232b});var client9004=jayson[_0xd7df('0x22')]['http']({'port':0x232c});function checkPasswordPattern(_0x4c5cf,_0x23cdbc,_0x513b13){if(_0x513b13){var _0x18d38f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18d38f[_0xd7df('0x24')](_0x23cdbc)){return _0x4c5cf;}else{throw new db['Sequelize'][(_0xd7df('0x25'))](_0xd7df('0x26'));}}else{return _0x4c5cf;}}function respondWithRpcPromise(_0x35e0a,_0x5210e5,_0x40167d,_0x471621){return new BPromise(function(_0x3cea3,_0x5ba653){var _0x96d86e=_0x471621||client;return _0x96d86e[_0xd7df('0x27')](_0x35e0a,_0x40167d)[_0xd7df('0x28')](function(_0x5acb0a){logger[_0xd7df('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x5210e5,_0xd7df('0x2a'));logger['debug'](_0xd7df('0x2b'),_0x5210e5,_0xd7df('0x2a'),JSON[_0xd7df('0x2c')](_0x5acb0a));if(_0x5acb0a['error']){if(_0x5acb0a[_0xd7df('0x2d')]['code']===0x1f4){logger[_0xd7df('0x2d')](_0xd7df('0x2e'),_0x5210e5,_0x5acb0a[_0xd7df('0x2d')][_0xd7df('0x2f')]);return _0x5ba653(_0x5acb0a[_0xd7df('0x2d')][_0xd7df('0x2f')]);}logger[_0xd7df('0x2d')]('ChatInteraction,\x20%s,\x20%s',_0x5210e5,_0x5acb0a['error'][_0xd7df('0x2f')]);return _0x3cea3(_0x5acb0a[_0xd7df('0x2d')][_0xd7df('0x2f')]);}else{logger[_0xd7df('0x29')](_0xd7df('0x2e'),_0x5210e5,_0xd7df('0x2a'));_0x3cea3(_0x5acb0a[_0xd7df('0x30')][_0xd7df('0x2f')]);}})[_0xd7df('0x31')](function(_0x5c4d17){logger[_0xd7df('0x2d')](_0xd7df('0x2e'),_0x5210e5,_0x5c4d17);_0x5ba653(_0x5c4d17);});});}function respondWithStatusCode(_0x46c0db,_0x29f0e8){_0x29f0e8=_0x29f0e8||0xcc;return function(_0x29b812){if(_0x29b812){return _0x46c0db[_0xd7df('0x32')](_0x29f0e8);}return _0x46c0db[_0xd7df('0x33')](_0x29f0e8)[_0xd7df('0x34')]();};}function respondWithResult(_0x5195cf,_0x4ba779){_0x4ba779=_0x4ba779||0xc8;return function(_0x52b56a){if(_0x52b56a){return _0x5195cf['status'](_0x4ba779)['json'](_0x52b56a);}};}function respondWithFilteredResult(_0x33f2b9,_0x4e87cd){return function(_0xd366b){if(_0xd366b){var _0x156612=_0xd366b['count'],_0x503a90=_0x4e87cd[_0xd7df('0x35')],_0x3ef553=_0x4e87cd[_0xd7df('0x35')]+_0x4e87cd[_0xd7df('0x36')],_0x2887db;if(_0x3ef553>=_0x156612){_0x3ef553=_0x156612;_0x2887db=0xc8;}else{_0x2887db=0xce;}_0x33f2b9[_0xd7df('0x33')](_0x2887db);return _0x33f2b9[_0xd7df('0x37')](_0xd7df('0x38'),_0x503a90+'-'+_0x3ef553+'/'+_0x156612)['json'](_0xd366b);}return null;};}function patchUpdates(_0x428b4b){return function(_0x149813){try{jsonpatch[_0xd7df('0x39')](_0x149813,_0x428b4b,!![]);}catch(_0x1d81b2){return BPromise[_0xd7df('0x3a')](_0x1d81b2);}return _0x149813[_0xd7df('0x3b')]();};}function saveUpdates(_0x141206,_0x2eb429){return function(_0x19f43d){if(_0x19f43d){return _0x19f43d[_0xd7df('0x3c')](_0x141206)[_0xd7df('0x28')](function(_0x483d09){return _0x483d09;});}return null;};}function removeEntity(_0x4d5a7f,_0x4051fb){return function(_0x564562){if(_0x564562){return _0x564562[_0xd7df('0x3d')]()[_0xd7df('0x28')](function(){_0x4d5a7f[_0xd7df('0x33')](0xcc)[_0xd7df('0x34')]();});}};}function handleEntityNotFound(_0x57f14e,_0x5edf50){return function(_0x57481a){if(!_0x57481a){_0x57f14e[_0xd7df('0x32')](0x194);}return _0x57481a;};}function handleError(_0x15e682,_0x55c43f){_0x55c43f=_0x55c43f||0x1f4;return function(_0x27c57c){logger[_0xd7df('0x2d')](_0x27c57c[_0xd7df('0x3e')]);if(_0x27c57c[_0xd7df('0x3f')]){delete _0x27c57c['name'];}_0x15e682[_0xd7df('0x33')](_0x55c43f)[_0xd7df('0x40')](_0x27c57c);};}function getInteractionUsers(_0x5f0a6d,_0x52933f){return new BPromise(function(_0x564ce2,_0x15089f){try{if(_0x52933f[_0x5f0a6d['id']]){_0x5f0a6d[_0xd7df('0x41')]=_[_0xd7df('0x42')](_0x52933f[_0x5f0a6d['id']],function(_0x59c755){return{'id':_0x59c755['id'],'fullname':_0x59c755[_0xd7df('0x43')]};});}}catch(_0x2a7252){_0x15089f(_0x2a7252);}_0x564ce2(_0x5f0a6d);});}function getInteractionTags(_0x3d5e80,_0x379e32){return new BPromise(function(_0x54ea42,_0x15f88d){try{if(_0x3d5e80[_0xd7df('0x44')]){_0x3d5e80[_0xd7df('0x45')]=[];_0x3d5e80['TagIds'][_0xd7df('0x46')](',')[_0xd7df('0x47')](function(_0x12310c){_0x3d5e80['Tags'][_0xd7df('0x48')](_0x379e32[_0x12310c]);});}delete _0x3d5e80[_0xd7df('0x44')];}catch(_0x4910cb){_0x15f88d(_0x4910cb);}_0x54ea42(_0x3d5e80);});}function updateChatInteraction(_0x4b2561,_0x260bed,_0x211feb){return new BPromise(function(_0x6a024a,_0x4a5152){return getInteractionUsers(_0x4b2561,_0x211feb)['then'](function(_0x2c149e){return getInteractionTags(_0x2c149e,_0x260bed);})['then'](function(_0xe606f4){_0x6a024a(_0xe606f4);})['catch'](function(_0x4f39e9){_0x4a5152(_0x4f39e9);});});}exports[_0xd7df('0x49')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={},_0xad2d69={},_0x2c27ae={'count':0x0,'rows':[]};var _0x2d0e06=_[_0xd7df('0x42')](db[_0xd7df('0x4a')][_0xd7df('0x4b')],function(_0x183ca7){return{'name':_0x183ca7['fieldName'],'type':_0x183ca7[_0xd7df('0x4c')]['key']};});_0xad2d69[_0xd7df('0x4d')]=_[_0xd7df('0x42')](_0x2d0e06,_0xd7df('0x3f'));_0xad2d69[_0xd7df('0x4e')]=_[_0xd7df('0x4f')](_0x579d0f[_0xd7df('0x4e')]);_0xad2d69[_0xd7df('0x50')]=_[_0xd7df('0x51')](_0xad2d69[_0xd7df('0x4d')],_0xad2d69['query']);_0x5302f4[_0xd7df('0x52')]=_[_0xd7df('0x51')](_0xad2d69['model'],qs['fields'](_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x53')]));_0x5302f4[_0xd7df('0x52')]=_0x5302f4['attributes']['length']?_0x5302f4[_0xd7df('0x52')]:_0xad2d69['model'];if(!_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x54')](_0xd7df('0x55'))){_0x5302f4[_0xd7df('0x36')]=qs[_0xd7df('0x36')](_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x36')]);_0x5302f4[_0xd7df('0x35')]=qs[_0xd7df('0x35')](_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x35')]);}_0x5302f4[_0xd7df('0x56')]=qs['sort'](_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x57')]);_0x5302f4[_0xd7df('0x58')]=qs[_0xd7df('0x50')](_[_0xd7df('0x59')](_0x579d0f['query'],_0xad2d69[_0xd7df('0x50')]));var _0x32b147=[];var _0x23f889=squel['select']()[_0xd7df('0x5a')]('id')['field'](_0xd7df('0x3f'))[_0xd7df('0x5a')](_0xd7df('0x5b'))[_0xd7df('0x5c')](_0xd7df('0x5d'));var _0x4c5820=squel['select']()['field'](_0xd7df('0x5e'))['field'](_0xd7df('0x5f'))[_0xd7df('0x5a')](_0xd7df('0x60'))[_0xd7df('0x5c')](_0xd7df('0x61'),'ui')[_0xd7df('0x62')](_0xd7df('0x63'),'u',_0xd7df('0x64'));var _0x453876=squel[_0xd7df('0x65')]()[_0xd7df('0x5c')](_0xd7df('0x66'),'i')[_0xd7df('0x62')](_0xd7df('0x67'),'c',_0xd7df('0x68'))[_0xd7df('0x62')]('users','o',_0xd7df('0x69'))[_0xd7df('0x62')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0xd7df('0x62')]('chat_messages','me',_0xd7df('0x6a'))['left_join'](_0xd7df('0x6b'),'it',_0xd7df('0x6c'))[_0xd7df('0x62')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5ad503=squel[_0xd7df('0x6d')]();var _0x14ac55=[];var _0x19c387=squel[_0xd7df('0x6d')]();var _0x41249b;if(_0x579d0f[_0xd7df('0x4e')]['search']){_0x41249b=as[_0xd7df('0x6e')](_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x6f')]);var _0x25d187=_0x41249b[_0xd7df('0x70')];for(var _0x1d4b48=0x0;_0x1d4b48<_0x41249b[_0xd7df('0x71')][_0xd7df('0x72')];_0x1d4b48++){var _0x1420cf=_0x41249b[_0xd7df('0x71')][_0x1d4b48];var _0x416398='i';var _0x398e43=_[_0xd7df('0x73')](_0x2d0e06,[_0xd7df('0x3f'),_0x1420cf[_0xd7df('0x5a')]]);if(!_0x398e43){switch(_0x1420cf[_0xd7df('0x5a')]){case _0xd7df('0x74'):if(_0x1420cf[_0xd7df('0x75')]==0x1){_0x453876[_0xd7df('0x76')]('`'+_0x1420cf[_0xd7df('0x5a')]+_0xd7df('0x77'));}else{_0x453876[_0xd7df('0x76')]('`'+_0x1420cf[_0xd7df('0x5a')]+_0xd7df('0x78'));}break;case _0xd7df('0x79'):if(_0x1420cf[_0xd7df('0x7a')]==='$substring'){if(_0x1420cf['value'][_0xd7df('0x46')]('\x20')[_0xd7df('0x72')]>0x1){_0x5ad503[_0x25d187](_0xd7df('0x7b'),qs['getFullTextValue'](_0x1420cf[_0xd7df('0x75')]),null);}else{var _0xb6e55='%'+_0x1420cf[_0xd7df('0x75')]+'%';_0x5ad503[_0x25d187](_0xd7df('0x7c'),_0xb6e55,_0xb6e55,_0xb6e55);}}else{_0x398e43=_['find'](_0x2d0e06,[_0xd7df('0x3f'),_0xd7df('0x7d')]);_0x1420cf[_0xd7df('0x5a')]=_0xd7df('0x7d');_0x519f72=as[_0xd7df('0x7e')](_0x416398,_0x398e43[_0xd7df('0x4c')],_0x1420cf);_0x5ad503[_0x25d187](_0x519f72[_0xd7df('0x7f')],_0x519f72[_0xd7df('0x75')]['start'],_0x519f72[_0xd7df('0x75')][_0xd7df('0x34')]);}break;case'Tag':var _0x524b2c=_0x1420cf['value'][_0xd7df('0x46')](',')[_0xd7df('0x42')](function(_0x27b19f){return Number(_0x27b19f);});_0x524b2c[_0xd7df('0x47')](function(_0x4d9db8){_0x19c387['or'](_0xd7df('0x80'),'%,'+_0x4d9db8+',%');});_0x14ac55=_[_0xd7df('0x81')](_0x14ac55,_0x524b2c);break;case _0xd7df('0x82'):if(_0x1420cf[_0xd7df('0x7a')]===_0xd7df('0x83')){_0x5ad503[_0x25d187](_0xd7df('0x84'),'%'+_0x1420cf[_0xd7df('0x75')]+'%',null);}else{_0x398e43=_['find'](_0x2d0e06,['name',_0xd7df('0x85')]);_0x1420cf['field']=_0xd7df('0x85');_0x519f72=as[_0xd7df('0x7e')](_0x416398,_0x398e43[_0xd7df('0x4c')],_0x1420cf);_0x5ad503[_0x25d187](_0x519f72['text'],_0x519f72['value'][_0xd7df('0x86')],_0x519f72[_0xd7df('0x75')]['end']);}break;case _0xd7df('0x87'):_0x519f72=as[_0xd7df('0x7e')]('me',null,_0x1420cf);_0x5ad503[_0x25d187](_0x519f72['text'],_0x519f72[_0xd7df('0x75')][_0xd7df('0x86')],_0x519f72['value'][_0xd7df('0x34')]);break;}}else{var _0x519f72=as[_0xd7df('0x7e')](_0x416398,_0x398e43[_0xd7df('0x4c')],_0x1420cf);_0x5ad503[_0x25d187](_0x519f72[_0xd7df('0x7f')],_0x519f72[_0xd7df('0x75')][_0xd7df('0x86')],_0x519f72[_0xd7df('0x75')][_0xd7df('0x34')]);}}}else{var _0x5831c1=_(_0x579d0f['query'])[_0xd7df('0x4f')]()[_0xd7df('0x42')](function(_0x2e6ea3){return _[_0xd7df('0x88')](_0x2d0e06,[_0xd7df('0x3f'),_0x2e6ea3])?_0x2e6ea3:undefined;})[_0xd7df('0x89')]()[_0xd7df('0x75')]();if(!_[_0xd7df('0x8a')](_0x5831c1)){_0x5831c1[_0xd7df('0x47')](function(_0x48198a){if(_0x48198a===_0xd7df('0x8b')){_0x453876[_0xd7df('0x58')]('i.ChatWebsiteId\x20IN\x20?',[][_0xd7df('0x8c')](_0x579d0f[_0xd7df('0x4e')][_0x48198a]));}else if(_0x48198a===_0xd7df('0x8d')){var _0x45c73b=JSON['parse'](_0x579d0f['query'][_0x48198a])['$gte'];var _0x3c4bd6=JSON['parse'](_0x579d0f[_0xd7df('0x4e')][_0x48198a])[_0xd7df('0x8e')];_0x453876[_0xd7df('0x58')](_0xd7df('0x8f'),_0x45c73b,_0x3c4bd6);}else{if(_0x579d0f[_0xd7df('0x4e')][_0x48198a]===_0xd7df('0x90')){_0x453876['where']('i.'+_0x48198a+_0xd7df('0x91'));}else{_0x453876[_0xd7df('0x58')]('i.'+_0x48198a+_0xd7df('0x92'),_0x579d0f['query'][_0x48198a]);}}});}if(_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x93')]){if(_0x579d0f['query'][_0xd7df('0x93')]==0x1){_0x453876[_0xd7df('0x76')](_0xd7df('0x94'));}else{_0x453876[_0xd7df('0x76')](_0xd7df('0x95'));}}if(_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x96')]){_0x14ac55=_['isArray'](_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x96')])?_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x96')]:new Array(_0x579d0f['query']['tag']);_0x14ac55[_0xd7df('0x47')](function(_0x5e50d5){_0x19c387['or'](_0xd7df('0x80'),'%,'+_0x5e50d5+',%');});}if(_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x97')]){var _0x4f1258=_0x579d0f[_0xd7df('0x4e')]['filter']['replace']('\x5c','\x5c\x5c')[_0xd7df('0x98')]('\x27\x27',_0xd7df('0x99'));if(qs[_0xd7df('0x9a')](_0x4f1258)){_0x5ad503['or'](_0xd7df('0x9b'),_0x4f1258+'%');}else{_0x5ad503['or'](_0xd7df('0x9c'),qs[_0xd7df('0x9d')](_0x4f1258))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4f1258+'%');}}}_0x453876['where'](_0x5ad503);_0x453876[_0xd7df('0x9e')](_0xd7df('0x9f'));var _0x3a874d={'type':db[_0xd7df('0xa0')]['QueryTypes'][_0xd7df('0xa1')],'raw':!![]};var _0x5df36d=_0x453876[_0xd7df('0xa2')]();_0x5df36d['field'](_0xd7df('0x9f'));_0x5df36d[_0xd7df('0x5a')](_0xd7df('0xa3'),_0xd7df('0x74'));if(_0x5302f4[_0xd7df('0x56')]){_0x5302f4[_0xd7df('0x56')]['forEach'](function(_0xd5d9eb){_0x453876['order']('i.'+_0xd5d9eb[0x0],_0xd5d9eb[0x1]===_0xd7df('0xa4')?![]:!![]);});}if(!_[_0xd7df('0x8a')](_0x14ac55)){_0x453876[_0xd7df('0x76')](_0x19c387);_0x5df36d[_0xd7df('0x58')]('t.id\x20IN\x20?',_0x14ac55);}BPromise[_0xd7df('0xa5')]()[_0xd7df('0x28')](function(){if(!_0x41249b){if(_0x579d0f[_0xd7df('0x4e')][_0xd7df('0x8b')]||_0x579d0f[_0xd7df('0x4e')][_0xd7df('0xa6')])return;_0x5df36d[_0xd7df('0x58')](_0xd7df('0xa7'));_0x453876[_0xd7df('0x58')](_0xd7df('0xa7'));return;}return _0x579d0f[_0xd7df('0xa8')][_0xd7df('0xa9')]({'attributes':['id'],'raw':!![]})['then'](function(_0x6c9ab9){if(_[_0xd7df('0x8a')](_0x6c9ab9)){_0x5df36d[_0xd7df('0x58')]('i.ChatWebsiteId\x20IS\x20NULL');_0x453876['where'](_0xd7df('0xaa'));}else{_0x5df36d[_0xd7df('0x58')](_0xd7df('0xab'),_[_0xd7df('0x42')](_0x6c9ab9,'id'));_0x453876[_0xd7df('0x58')](_0xd7df('0xab'),_[_0xd7df('0x42')](_0x6c9ab9,'id'));}});})[_0xd7df('0x28')](function(){db[_0xd7df('0xac')][_0xd7df('0x4e')](_0x5df36d['toString'](),_0x3a874d)[_0xd7df('0x28')](function(_0x2dfcd9){_0x2c27ae[_0xd7df('0xad')]=_0x2dfcd9[_0xd7df('0x72')];if(_0x2c27ae[_0xd7df('0xad')]===0x0)return[];return db[_0xd7df('0xac')]['query'](_0x23f889['toString'](),_0x3a874d)[_0xd7df('0x28')](function(_0x31b159){_0x32b147=_[_0xd7df('0xae')](_0x31b159,'id');_0x3a874d=_[_0xd7df('0xaf')](_0x3a874d,{'model':db[_0xd7df('0x4a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x579d0f['query'][_0xd7df('0x53')]){_0x5302f4[_0xd7df('0x52')][_0xd7df('0x47')](function(_0x3d9fba){_0x453876[_0xd7df('0x5a')]('i.'+_0x3d9fba);});}else{_0x453876[_0xd7df('0x5a')](_0xd7df('0xa3'),'unreadMessages');_0x453876[_0xd7df('0x5a')]('a.key','Account.key');_0x453876[_0xd7df('0x5a')](_0xd7df('0xb0'),_0xd7df('0xb1'));_0x453876['field'](_0xd7df('0xb2'));_0x453876['field']('c.firstName',_0xd7df('0xb3'));_0x453876[_0xd7df('0x5a')](_0xd7df('0xb4'),_0xd7df('0xb5'));_0x453876[_0xd7df('0x5a')]('c.email','Contact.email');_0x453876[_0xd7df('0x5a')](_0xd7df('0xb6'),_0xd7df('0xb7'));_0x453876[_0xd7df('0x5a')](_0xd7df('0xb8'),_0xd7df('0xb9'));_0x453876[_0xd7df('0x5a')](_0xd7df('0xba'),_0xd7df('0xbb'));_0x453876[_0xd7df('0x5a')](_0xd7df('0xbc'),_0xd7df('0xbd'));_0x453876[_0xd7df('0x5a')]('o.internal',_0xd7df('0xbe'));_0x453876[_0xd7df('0x5a')](_0xd7df('0xbf'),'TagIds');}_0x453876[_0xd7df('0x36')](_0x5302f4['limit']);_0x453876[_0xd7df('0x35')](_0x5302f4[_0xd7df('0x35')]);return db['sequelize'][_0xd7df('0x4e')](_0x453876[_0xd7df('0xc0')](),_0x3a874d);})[_0xd7df('0x28')](function(_0x305989){_0x4c5820[_0xd7df('0x58')](_0xd7df('0xc1'),_[_0xd7df('0x42')](_0x305989,'id'));return db[_0xd7df('0xac')][_0xd7df('0x4e')](_0x4c5820['toString'](),_0x3a874d)[_0xd7df('0x28')](function(_0x3ddd4c){var _0x542e68=_['groupBy'](_0x3ddd4c,_0xd7df('0xc2'));var _0x1bd485=[];_0x305989[_0xd7df('0x47')](function(_0x13f57f){_0x1bd485[_0xd7df('0x48')](updateChatInteraction(_0x13f57f,_0x32b147,_0x542e68));});return BPromise[_0xd7df('0xc3')](_0x1bd485);});});})[_0xd7df('0x28')](function(_0x513774){_0x2c27ae[_0xd7df('0xc4')]=_0x513774;return _0x2c27ae;})[_0xd7df('0x28')](respondWithFilteredResult(_0x18ef10,_0x5302f4));})['catch'](handleError(_0x18ef10,null));};exports[_0xd7df('0xc5')]=function(_0x4938d3,_0x710a9d){var _0x204fdf={'raw':![],'where':{'id':_0x4938d3[_0xd7df('0xc6')]['id']}},_0x3fc0de={};_0x3fc0de[_0xd7df('0x4d')]=_[_0xd7df('0x4f')](db['ChatInteraction'][_0xd7df('0x4b')]);_0x3fc0de['query']=_[_0xd7df('0x4f')](_0x4938d3[_0xd7df('0x4e')]);_0x3fc0de[_0xd7df('0x50')]=_[_0xd7df('0x51')](_0x3fc0de[_0xd7df('0x4d')],_0x3fc0de[_0xd7df('0x4e')]);_0x204fdf[_0xd7df('0x52')]=_[_0xd7df('0x51')](_0x3fc0de['model'],qs[_0xd7df('0x53')](_0x4938d3['query'][_0xd7df('0x53')]));_0x204fdf[_0xd7df('0x52')]=_0x204fdf[_0xd7df('0x52')][_0xd7df('0x72')]?_0x204fdf[_0xd7df('0x52')]:_0x3fc0de[_0xd7df('0x4d')];if(_0x4938d3[_0xd7df('0x4e')][_0xd7df('0xc7')]){_0x204fdf[_0xd7df('0xc8')]=[{'all':!![]}];}_0x204fdf=_[_0xd7df('0xaf')]({},_0x204fdf,_0x4938d3[_0xd7df('0xc9')]);return db[_0xd7df('0x4a')][_0xd7df('0x73')](_0x204fdf)['then'](handleEntityNotFound(_0x710a9d,null))[_0xd7df('0x28')](respondWithResult(_0x710a9d,null))['catch'](handleError(_0x710a9d,null));};exports['create']=function(_0x5954f1,_0x179827){return db[_0xd7df('0x4a')][_0xd7df('0xca')](_0x5954f1[_0xd7df('0x87')],{})[_0xd7df('0x28')](respondWithResult(_0x179827,0xc9))[_0xd7df('0x31')](handleError(_0x179827,null));};exports['update']=function(_0x15a1bc,_0x325d2f){if(_0x15a1bc[_0xd7df('0x87')]['id']){delete _0x15a1bc[_0xd7df('0x87')]['id'];}return db[_0xd7df('0x4a')][_0xd7df('0x73')]({'where':{'id':_0x15a1bc['params']['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x325d2f,null))['then'](saveUpdates(_0x15a1bc[_0xd7df('0x87')],null))[_0xd7df('0x28')](respondWithResult(_0x325d2f,null))['catch'](handleError(_0x325d2f,null));};exports[_0xd7df('0x3d')]=function(_0x4c58ba,_0x46321b){return db[_0xd7df('0x4a')][_0xd7df('0x73')]({'where':{'id':_0x4c58ba[_0xd7df('0xc6')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x46321b,null))[_0xd7df('0x28')](removeEntity(_0x46321b,null))['catch'](handleError(_0x46321b,null));};exports[_0xd7df('0xcb')]=function(_0x44805e,_0x487d9c){return db[_0xd7df('0x4a')]['describe']()[_0xd7df('0x28')](respondWithResult(_0x487d9c,null))[_0xd7df('0x31')](handleError(_0x487d9c,null));};exports[_0xd7df('0xcc')]=function(_0x3a987f,_0x21ed91){if(_0x3a987f['body']['id']){delete _0x3a987f[_0xd7df('0x87')]['id'];}return db[_0xd7df('0x4a')][_0xd7df('0x73')]({'where':{'id':_0x3a987f[_0xd7df('0xc6')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x21ed91,null))[_0xd7df('0x28')](saveUpdates(_0x3a987f[_0xd7df('0x87')],null))['then'](respondWithResult(_0x21ed91,null))[_0xd7df('0x31')](handleError(_0x21ed91,null));};exports[_0xd7df('0xcd')]=function(_0x1c1658,_0x5e723a,_0x54df61){if(_0x1c1658[_0xd7df('0x87')]['id']){delete _0x1c1658[_0xd7df('0x87')]['id'];}return db[_0xd7df('0x4a')]['find']({'where':{'id':_0x1c1658[_0xd7df('0xc6')]['id']}})[_0xd7df('0x28')](function(_0x9d4aa5){if(!_0x9d4aa5){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xd7df('0xcd'),0x194,'entity\x20not\x20found');_0x5e723a['sendStatus'](0x194);}else{if(_0x9d4aa5['UserId']){throw new db['Sequelize'][(_0xd7df('0x25'))](_0xd7df('0xce'));}}return _0x9d4aa5;})[_0xd7df('0x28')](function(_0x2a78bb){if(_0x2a78bb){return _0x2a78bb[_0xd7df('0x3c')]({'closed':_0x1c1658[_0xd7df('0x87')][_0xd7df('0xcf')],'disposition':_0x1c1658[_0xd7df('0x87')][_0xd7df('0xd0')]})[_0xd7df('0x28')](function(_0x1161a0){return _0x1161a0;});}})[_0xd7df('0x28')](function(_0x115b9e){return respondWithRpcPromise(_0xd7df('0xd1'),_0xd7df('0xcd'),_0x1c1658[_0xd7df('0x87')],client9004);})['then'](respondWithResult(_0x5e723a,null))[_0xd7df('0x31')](handleError(_0x5e723a,null));};exports['attachmentUpload']=function(_0x3c2db1,_0x33935d,_0x230a9b){_0x3c2db1['body']['name']=_0x3c2db1[_0xd7df('0xd2')][_0xd7df('0xd3')];_0x3c2db1[_0xd7df('0x87')]['basename']=_0x3c2db1[_0xd7df('0xd2')][_0xd7df('0xd4')];_0x3c2db1['body'][_0xd7df('0x4c')]=_0x3c2db1[_0xd7df('0xd2')]['mimetype'];return db[_0xd7df('0xd5')]['create'](_0x3c2db1['body'])['then'](respondWithResult(_0x33935d,0xc9))[_0xd7df('0x31')](handleError(_0x33935d,null));};exports[_0xd7df('0xd6')]=function(_0x5815d9,_0x446ad0,_0x5083d9){return db[_0xd7df('0x4a')][_0xd7df('0xd7')]({'where':{'id':_0x5815d9[_0xd7df('0xc6')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x446ad0,null))[_0xd7df('0x28')](function(_0xe5924a){if(_0xe5924a){if(_0xe5924a[_0xd7df('0xcf')]){return _0x446ad0[_0xd7df('0x33')](0x193)[_0xd7df('0xd8')]({'status':0x193,'message':_0xd7df('0xd9')});}return db[_0xd7df('0xd5')][_0xd7df('0xd7')]({'where':{'id':_0x5815d9['query']['attachId']},'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0x446ad0,null));}})['then'](function(_0x547af6){if(_0x547af6){return _0x446ad0[_0xd7df('0xda')](path[_0xd7df('0xdb')](config[_0xd7df('0xdc')],_0xd7df('0xdd'),_0x547af6[_0xd7df('0xde')]));}})['catch'](handleError(_0x446ad0,null));};exports[_0xd7df('0xdf')]=function(_0x2c2ecb,_0x3967c0){var _0x20a007=null;var _0x239e87=null;var _0x4625a3=null;var _0x33137d=null;if(_0x2c2ecb[_0xd7df('0x87')]['id']){delete _0x2c2ecb['body']['id'];}if(_0x2c2ecb[_0xd7df('0x87')][_0xd7df('0xe0')]){_0x33137d=path[_0xd7df('0xdb')](config[_0xd7df('0xdc')],'server/files/chat/upload/',util['format'](_0xd7df('0xe1'),Date[_0xd7df('0xe2')]()));_0x2c2ecb['body']['pathTranscript']=_0x33137d;}return db[_0xd7df('0x4a')]['find']({'where':{'id':_0x2c2ecb[_0xd7df('0xc6')]['id']},'include':[{'model':db[_0xd7df('0xe3')],'as':'Messages','include':[{'model':db[_0xd7df('0x82')],'as':'User'}]}]})[_0xd7df('0x28')](handleEntityNotFound(_0x3967c0,null))[_0xd7df('0x28')](saveUpdates(_0x2c2ecb[_0xd7df('0x87')],null))[_0xd7df('0x28')](function(_0x2e7068){if(_0x2e7068){_0x20a007=_0x2e7068;return db[_0xd7df('0xe4')][_0xd7df('0x73')]({'where':{'id':_0x20a007[_0xd7df('0x8b')]}});}})['then'](function(_0x4d0242){if(_0x4d0242){_0x4625a3=_0x4d0242;return db[_0xd7df('0xe5')][_0xd7df('0x73')]({'where':{'id':_0x20a007[_0xd7df('0x7d')]}});}})['then'](function(_0x58fb95){if(_0x58fb95){_0x239e87=_0x58fb95;if(_0x33137d){var _0x1854db=null;for(var _0x4474b9=0x1;_0x4474b9<_0x20a007[_0xd7df('0xe6')]['length'];++_0x4474b9){_0x1854db=_0x20a007[_0xd7df('0xe6')][_0x4474b9];var _0x2faf9b=_0x1854db[_0xd7df('0x85')]?util['format'](_0xd7df('0xe7'),_0x4625a3[_0xd7df('0xe8')],_0x1854db[_0xd7df('0x85')]):_0xd7df('0xe9');var _0x302e3b=_0x2c2ecb[_0xd7df('0x87')]['customer']||util['format']('%s%d',_0xd7df('0xea'),_0x1854db[_0xd7df('0x7d')]);switch(_0x4625a3[_0xd7df('0xeb')]){case _0xd7df('0xec'):_0x2faf9b=_0x1854db['UserId']?util[_0xd7df('0xed')](_0xd7df('0xe7'),_0x4625a3['agentAlias'],_0x1854db[_0xd7df('0x85')]):'System';break;case _0xd7df('0xee'):_0x2faf9b=_0x1854db[_0xd7df('0x85')]?_0x1854db[_0xd7df('0x82')][_0xd7df('0xef')]||_0x1854db[_0xd7df('0x82')]['fullname']:'System';break;case _0xd7df('0xf0'):_0x2faf9b=_0x1854db[_0xd7df('0x85')]?_0x1854db[_0xd7df('0x82')]['fullname']:_0xd7df('0xe9');break;default:_0x2faf9b=_0x1854db[_0xd7df('0x85')]?util[_0xd7df('0xed')](_0xd7df('0xe7'),_0x4625a3['agentAlias'],_0x1854db[_0xd7df('0x85')]):_0xd7df('0xe9');}var _0x5e69ae=util[_0xd7df('0xed')](_0xd7df('0xf1'),moment(_0x1854db['createdAt'])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x1854db[_0xd7df('0xf2')]==='in'?_0x302e3b:_0x2faf9b,_0x1854db[_0xd7df('0x87')]);if(!_0x1854db[_0xd7df('0xf3')]){fs[_0xd7df('0xf4')](_0x33137d,_0x5e69ae);}}return db[_0xd7df('0xf5')][_0xd7df('0xd7')]({'where':{'service':!![]},'include':[{'model':db[_0xd7df('0xf6')],'as':'Smtp','raw':!![]}]});}}})['then'](function(_0x5358bc){if(_0x5358bc&&_0x5358bc[_0xd7df('0xf7')]&&_0x2c2ecb['body']){var _0x188610={'tls':{'rejectUnauthorized':![]}};if(_0x5358bc[_0xd7df('0xf7')]['service']){_0x188610[_0xd7df('0xf8')]=_0x5358bc[_0xd7df('0xf7')][_0xd7df('0xf8')];}else{_0x188610[_0xd7df('0xf9')]=_0x5358bc[_0xd7df('0xf7')]['host'];_0x188610[_0xd7df('0xfa')]=_0x5358bc['Smtp']['port'];_0x188610[_0xd7df('0xfb')]=_0x5358bc['Smtp']['secure'];}if(_0x5358bc[_0xd7df('0xf7')]['authentication']){_0x188610[_0xd7df('0xfc')]={'user':_0x5358bc['Smtp']['user'],'pass':_0x5358bc[_0xd7df('0xf7')]['pass']};}return respondWithRpcPromise(_0xd7df('0xfd'),_0xd7df('0xfe'),{'account':_0x188610,'message':{'from':util['format'](_0xd7df('0xff'),_0x5358bc[_0xd7df('0x3f')],_0x5358bc[_0xd7df('0x100')]||_0x5358bc[_0xd7df('0xf7')]['user']),'to':_0x2c2ecb[_0xd7df('0x87')][_0xd7df('0xe0')],'subject':_0xd7df('0x101'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2c2ecb[_0xd7df('0x87')]['mailTranscript']),'attachments':[{'path':_0x33137d}]}})[_0xd7df('0x28')](function(){return _0x20a007;})[_0xd7df('0x31')](function(_0x2eb438){console['error'](_0x2eb438);});}else{return _0x20a007;}})[_0xd7df('0x28')](respondWithStatusCode(_0x3967c0,0xc8))[_0xd7df('0x31')](handleError(_0x3967c0,null));};exports[_0xd7df('0x102')]=function(_0x3e170d,_0x5ef6bd,_0x2629a2){return db[_0xd7df('0xe3')][_0xd7df('0x73')]({'where':{'id':_0x3e170d[_0xd7df('0xc6')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x5ef6bd,null))[_0xd7df('0x28')](function(_0x532214){if(_0x532214){return _0x532214[_0xd7df('0x102')](_0x3e170d['body'][_0xd7df('0x103')],_[_0xd7df('0x104')](_0x3e170d[_0xd7df('0x87')],['ids','id'])||{});}})[_0xd7df('0x28')](respondWithResult(_0x5ef6bd,null))[_0xd7df('0x31')](handleError(_0x5ef6bd,null));};exports['getMessages']=function(_0xfffb72,_0x4cf3a3,_0x179d4e){var _0x17ab51={'raw':![],'where':{}};var _0x3070b4={};var _0x2764ff={'count':0x0,'rows':[]};return db[_0xd7df('0x4a')][_0xd7df('0xd7')]({'where':{'id':_0xfffb72[_0xd7df('0xc6')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x4cf3a3,null))[_0xd7df('0x28')](function(_0x5a1549){if(_0x5a1549){_0x3070b4[_0xd7df('0x4d')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x3070b4['query']=_[_0xd7df('0x4f')](_0xfffb72[_0xd7df('0x4e')]);_0x3070b4[_0xd7df('0x50')]=_[_0xd7df('0x51')](_0x3070b4[_0xd7df('0x4d')],_0x3070b4[_0xd7df('0x4e')]);_0x17ab51[_0xd7df('0x52')]=_['intersection'](_0x3070b4[_0xd7df('0x4d')],qs[_0xd7df('0x53')](_0xfffb72[_0xd7df('0x4e')][_0xd7df('0x53')]));_0x17ab51[_0xd7df('0x52')]=_0x17ab51[_0xd7df('0x52')][_0xd7df('0x72')]?_0x17ab51['attributes']:_0x3070b4[_0xd7df('0x4d')];if(!_0xfffb72[_0xd7df('0x4e')][_0xd7df('0x54')]('nolimit')){_0x17ab51[_0xd7df('0x36')]=qs[_0xd7df('0x36')](_0xfffb72[_0xd7df('0x4e')][_0xd7df('0x36')]);_0x17ab51['offset']=qs[_0xd7df('0x35')](_0xfffb72['query'][_0xd7df('0x35')]);}_0x17ab51[_0xd7df('0x56')]=qs[_0xd7df('0x57')](_0xfffb72['query'][_0xd7df('0x57')]);_0x17ab51[_0xd7df('0x58')]=qs[_0xd7df('0x50')](_[_0xd7df('0x59')](_0xfffb72['query'],_0x3070b4[_0xd7df('0x50')]));_0x17ab51['where'][_0xd7df('0xc2')]=_0x5a1549['id'];if(_0xfffb72[_0xd7df('0x4e')][_0xd7df('0x97')]){_0x17ab51[_0xd7df('0x58')]=_[_0xd7df('0xaf')](_0x17ab51['where'],{'$or':_[_0xd7df('0x42')](_0x17ab51['attributes'],function(_0x6afe20){var _0x40c493={};_0x40c493[_0x6afe20]={'$like':'%'+_0xfffb72[_0xd7df('0x4e')][_0xd7df('0x97')]+'%'};return _0x40c493;})});}if(_0xfffb72['query'][_0xd7df('0x105')]){var _0x2924d4=_0xfffb72[_0xd7df('0x4e')][_0xd7df('0x105')]['split'](',');var _0x61bb4d={};_0x61bb4d[_0x2924d4[0x0]]={'$gte':moment(_0x2924d4[0x1])[_0xd7df('0xed')](_0xd7df('0x106'))};_0x17ab51[_0xd7df('0x58')]=_[_0xd7df('0xaf')](_0x17ab51[_0xd7df('0x58')],_0x61bb4d);}_0x17ab51=_[_0xd7df('0xaf')]({},_0x17ab51,_0xfffb72[_0xd7df('0xc9')]);return db[_0xd7df('0xe3')][_0xd7df('0xad')]({'where':_0x17ab51['where']})[_0xd7df('0x28')](function(_0x5b6af4){_0x2764ff[_0xd7df('0xad')]=_0x5b6af4;if(_0xfffb72[_0xd7df('0x4e')]['includeAll']){_0x17ab51[_0xd7df('0xc8')]=[{'all':!![]}];}return db[_0xd7df('0xe3')][_0xd7df('0x107')](_0x17ab51);})[_0xd7df('0x28')](function(_0x719c95){_0x2764ff[_0xd7df('0xc4')]=_0x719c95;return _0x2764ff;});}})[_0xd7df('0x28')](respondWithFilteredResult(_0x4cf3a3,_0x17ab51))[_0xd7df('0x31')](handleError(_0x4cf3a3,null));};exports[_0xd7df('0x108')]=function(_0x588f8a,_0x34c742,_0x1aa99e){var _0x10dc46={'where':{}},_0x514186={},_0xc6fe74={'count':0x0,'rows':[]};return db[_0xd7df('0x4a')]['findOne']({'where':{'id':_0x588f8a['params']['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x34c742,null))[_0xd7df('0x28')](function(_0x14f37b){if(_0x14f37b){_0x514186[_0xd7df('0x4d')]=_[_0xd7df('0x4f')](db[_0xd7df('0xe3')]['rawAttributes']);_0x514186[_0xd7df('0x4e')]=_[_0xd7df('0x4f')](_0x588f8a[_0xd7df('0x4e')]);_0x514186[_0xd7df('0x50')]=_[_0xd7df('0x51')](_0x514186[_0xd7df('0x4d')],_0x514186[_0xd7df('0x4e')]);_0x10dc46[_0xd7df('0x52')]=_[_0xd7df('0x51')](_0x514186[_0xd7df('0x4d')],qs[_0xd7df('0x53')](_0x588f8a[_0xd7df('0x4e')][_0xd7df('0x53')]));_0x10dc46[_0xd7df('0x52')]=_0x10dc46[_0xd7df('0x52')][_0xd7df('0x72')]?_0x10dc46[_0xd7df('0x52')]:_0x514186[_0xd7df('0x4d')];if(!_0x588f8a['query']['hasOwnProperty'](_0xd7df('0x55'))){_0x10dc46[_0xd7df('0x36')]=qs[_0xd7df('0x36')](_0x588f8a[_0xd7df('0x4e')][_0xd7df('0x36')]);_0x10dc46['offset']=qs[_0xd7df('0x35')](_0x588f8a['query'][_0xd7df('0x35')]);}_0x10dc46[_0xd7df('0x56')]=qs['sort'](_0x588f8a[_0xd7df('0x4e')][_0xd7df('0x57')]);_0x10dc46['where']=qs[_0xd7df('0x50')](_['pick'](_0x588f8a[_0xd7df('0x4e')],_0x514186['filters']));_0x10dc46[_0xd7df('0x58')][_0xd7df('0xc2')]=_0x14f37b['id'];if(_0x588f8a[_0xd7df('0x4e')][_0xd7df('0x97')]){_0x10dc46[_0xd7df('0x58')]=_[_0xd7df('0xaf')](_0x10dc46[_0xd7df('0x58')],{'$or':_[_0xd7df('0x42')](_0x10dc46['attributes'],function(_0x3c782f){var _0x3e413a={};_0x3e413a[_0x3c782f]={'$like':'%'+_0x588f8a['query'][_0xd7df('0x97')]+'%'};return _0x3e413a;})});}_0x10dc46['where'][_0xd7df('0xf3')]=![];if(_0x588f8a[_0xd7df('0x4e')]['id']){_0x10dc46[_0xd7df('0x58')]['id']={'$gt':_0x588f8a[_0xd7df('0x4e')]['id']};}_0x10dc46=_[_0xd7df('0xaf')]({},_0x10dc46,_0x588f8a['options']);return db['ChatMessage']['count']({'where':_0x10dc46[_0xd7df('0x58')]})[_0xd7df('0x28')](function(_0x31dac9){_0xc6fe74[_0xd7df('0xad')]=_0x31dac9;_0x10dc46[_0xd7df('0xc8')]=[];if(_0x588f8a['query']['includeAgent']){_0x10dc46[_0xd7df('0xc8')]['push']({'model':db[_0xd7df('0x82')],'as':_0xd7df('0x82'),'attributes':['id',_0xd7df('0x43'),'alias']});}if(_0x588f8a[_0xd7df('0x4e')][_0xd7df('0xc7')]){_0x10dc46[_0xd7df('0xc8')]=[{'all':!![]}];}return db[_0xd7df('0xe3')][_0xd7df('0x107')](_0x10dc46);})['then'](function(_0x536cfd){_0xc6fe74[_0xd7df('0xc4')]=_0x536cfd;return _0xc6fe74;});}})[_0xd7df('0x28')](respondWithFilteredResult(_0x34c742,_0x10dc46))[_0xd7df('0x31')](handleError(_0x34c742,null));};exports[_0xd7df('0x109')]=function(_0xe1ba77,_0xdc7a5e,_0x33d985){return db[_0xd7df('0x4a')]['find']({'where':{'id':_0xe1ba77[_0xd7df('0xc6')]['id']}})['then'](handleEntityNotFound(_0xdc7a5e,null))[_0xd7df('0x28')](function(_0x2b04fa){if(_0x2b04fa){return _0x2b04fa[_0xd7df('0x10a')](_0xe1ba77[_0xd7df('0x87')][_0xd7df('0x103')],_[_0xd7df('0x104')](_0xe1ba77[_0xd7df('0x87')],['ids','id'])||{})[_0xd7df('0x10b')](function(){return db[_0xd7df('0x10c')][_0xd7df('0x107')]({'attributes':['id','name',_0xd7df('0x5b')],'where':{'id':_0xe1ba77[_0xd7df('0x87')][_0xd7df('0x103')]}});})[_0xd7df('0x28')](function(_0x21f395){socket['emit'](_0xd7df('0x10d'),{'id':Number(_0xe1ba77['params']['id']),'tags':_0x21f395||[]});return{'id':Number(_0xe1ba77[_0xd7df('0xc6')]['id']),'tags':_0x21f395||[]};});}})[_0xd7df('0x28')](respondWithResult(_0xdc7a5e,null))[_0xd7df('0x31')](handleError(_0xdc7a5e,null));};exports['removeTags']=function(_0x253639,_0x298c6a,_0x31cd4f){return db['ChatInteraction']['find']({'where':{'id':_0x253639['params']['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x298c6a,null))['then'](function(_0x3905c4){if(_0x3905c4){return _0x3905c4[_0xd7df('0x10e')](_0x253639[_0xd7df('0x4e')][_0xd7df('0x103')]);}})[_0xd7df('0x28')](respondWithStatusCode(_0x298c6a,null))['catch'](handleError(_0x298c6a,null));};exports[_0xd7df('0xda')]=function(_0x549497,_0x47b520){var _0x46cd8e=moment()[_0xd7df('0x10f')]()[_0xd7df('0xc0')]();var _0x1e0a28=path[_0xd7df('0xdb')](config[_0xd7df('0xdc')],'server',_0xd7df('0x110'),_0xd7df('0x111'));var _0xe9a387=path['join'](config[_0xd7df('0xdc')],_0xd7df('0x112'),_0xd7df('0x110'),_0xd7df('0x113'));var _0x14d74f=path[_0xd7df('0xdb')](_0x1e0a28,_0x46cd8e);var _0x23d3b9=util[_0xd7df('0xed')](_0xd7df('0x114'),_0x549497[_0xd7df('0xc6')]['id'],_0x46cd8e);var _0x48c575=path[_0xd7df('0xdb')](_0x1e0a28,_0x23d3b9);var _0x6b6b39=[];_0x6b6b39['push']({'model':db[_0xd7df('0x82')],'as':'User','attributes':['id',_0xd7df('0x43')],'raw':!![]});_0x6b6b39[_0xd7df('0x48')]({'model':db[_0xd7df('0xe5')],'as':_0xd7df('0x79'),'attributes':['id',_0xd7df('0x115'),_0xd7df('0x116')],'raw':!![]});if(_0x549497[_0xd7df('0x4e')][_0xd7df('0x113')]){_0x6b6b39['push']({'model':db[_0xd7df('0xd5')],'as':'Attachment','raw':!![]});}var _0x108602=[{'model':db[_0xd7df('0xe3')],'as':_0xd7df('0xe6'),'attributes':['id',_0xd7df('0x87'),_0xd7df('0x8d'),_0xd7df('0xf2'),'secret',_0xd7df('0x93')],'include':_0x6b6b39}];_0x108602['push']({'model':db['ChatWebsite'],'as':_0xd7df('0x117'),'attributes':['id',_0xd7df('0x3f')]});_0x108602[_0xd7df('0x48')]({'model':db[_0xd7df('0x82')],'as':_0xd7df('0x118'),'attributes':['id',_0xd7df('0x43')]});return db[_0xd7df('0x4a')][_0xd7df('0x73')]({'where':{'id':_0x549497[_0xd7df('0xc6')]['id']},'include':_0x108602})[_0xd7df('0x28')](handleEntityNotFound(_0x47b520,null))[_0xd7df('0x28')](function(_0x2061e0){if(_0x2061e0){var _0x4643cb=_0x2061e0[_0xd7df('0x119')]({'plain':!![]});fs[_0xd7df('0x11a')](_0x14d74f);var _0xd2d049={'format':'A4','border':'10px','header':{'height':_0xd7df('0x11b'),'contents':{'first':_0xd7df('0x11c')}},'footer':{'height':_0xd7df('0x11d'),'contents':{'default':util[_0xd7df('0xed')](_0xd7df('0x11e'),util[_0xd7df('0xed')](_0xd7df('0x11f'),'Chat',_0x4643cb['id']),moment()['format']('YYYY-MM-DD')[_0xd7df('0xc0')]())}}};var _0x517041={'channel':_0xd7df('0x120'),'account':_0x4643cb[_0xd7df('0x117')][_0xd7df('0x3f')],'agent':_0x4643cb[_0xd7df('0x118')]?_0x4643cb[_0xd7df('0x118')][_0xd7df('0x43')]:_0xd7df('0x121'),'createdAt':moment(_0x4643cb['createdAt'])[_0xd7df('0xed')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd7df('0xc0')](),'closedAt':_0x4643cb[_0xd7df('0xcf')]?moment(_0x4643cb[_0xd7df('0x122')])[_0xd7df('0xed')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd7df('0xc0')]():'','disposition':_0x4643cb[_0xd7df('0xd0')],'chatInfo':{'browser':_0x4643cb[_0xd7df('0x123')],'os':_0x4643cb['osName'],'referer':_0x4643cb[_0xd7df('0x124')],'customerIp':_0x4643cb[_0xd7df('0x125')],'customerPort':_0x4643cb[_0xd7df('0x126')]?_0x4643cb['customerPort']:_0xd7df('0x121')},'messages':_(_0x4643cb[_0xd7df('0xe6')])[_0xd7df('0x127')]()[_0xd7df('0x97')]({'secret':![]})[_0xd7df('0x42')](function(_0x4d17d9){if(_0x4d17d9[_0xd7df('0xd5')]){var _0x5330da=path[_0xd7df('0xdb')](_0xe9a387,_0x4d17d9[_0xd7df('0xd5')][_0xd7df('0xde')]);if(fs[_0xd7df('0x128')](_0x5330da)){fs['createReadStream'](_0x5330da)['pipe'](fs['createWriteStream'](path[_0xd7df('0xdb')](_0x14d74f,_0x4d17d9['Attachment'][_0xd7df('0xde')])));}}return{'date':moment(_0x4d17d9['createdAt'])[_0xd7df('0xed')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x4d17d9[_0xd7df('0xf2')]===_0xd7df('0x129')?_0x4d17d9['User']?_0x4d17d9[_0xd7df('0x82')][_0xd7df('0x43')]:'System':_0x4d17d9['Contact'][_0xd7df('0x115')]+(_0x4d17d9['Contact'][_0xd7df('0x116')]?'\x20'+_0x4d17d9[_0xd7df('0x79')][_0xd7df('0x116')]:''),'body':_0x4d17d9[_0xd7df('0xd5')]?_0x4d17d9[_0xd7df('0xd5')]['basename']:_0x4d17d9['body'],'direction':_0x4d17d9[_0xd7df('0xf2')]===_0xd7df('0x129')?'A':'C','secret':_0x4d17d9[_0xd7df('0xf3')],'read':_0x4d17d9[_0xd7df('0x93')],'attachment':_0x4d17d9[_0xd7df('0xd5')]};})['value']()};return ejs[_0xd7df('0x12a')](path[_0xd7df('0xdb')](config[_0xd7df('0xdc')],_0xd7df('0x112'),_0xd7df('0x12b'),_0xd7df('0x12c')),{'interaction':_0x517041})['then'](function(_0x35f7d3){return new BPromise(function(_0x198c94,_0x10f819){pdf[_0xd7df('0xca')](_0x35f7d3,_0xd2d049)[_0xd7df('0x12d')](path['join'](_0x14d74f,_0xd7df('0x12e')+_0x4643cb['id']+'-'+_0x46cd8e+_0xd7df('0x12f')),function(_0x2b22c8,_0x191524){if(_0x2b22c8)return _0x10f819(_0x2b22c8);_0x198c94(_0x191524);});});})[_0xd7df('0x28')](function(){return new BPromise(function(_0x2490b2,_0x4a2d4a){zipdir(_0x14d74f,{'saveTo':_0x48c575},function(_0x351b85,_0x15bc4a){if(_0x351b85)return _0x4a2d4a(_0x351b85);return _0x2490b2(_0x15bc4a);});})['then'](function(){return new BPromise(function(_0x44d03a,_0x311ce0){rimraf(_0x14d74f,function(_0x25058e){if(_0x25058e)_0x311ce0(_0x25058e);return _0x44d03a();});});})[_0xd7df('0x28')](function(){return _0x47b520[_0xd7df('0xda')](_0x48c575,_0x23d3b9,function(_0xe7318c){if(_0xe7318c){console['log'](_0xd7df('0x130'),_0xe7318c);}else{fs[_0xd7df('0x131')](_0x48c575);}});});});}else{return _0x47b520['sendStatus'](0xc8);}})[_0xd7df('0x31')](handleError(_0x47b520,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 3294622..a1782f3 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 _0x603f=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x603f,0x70));var _0xf603=function(_0x1372e8,_0xf8fbb5){_0x1372e8=_0x1372e8-0x0;var _0x1e0cf6=_0x603f[_0x1372e8];return _0x1e0cf6;};'use strict';var EventEmitter=require(_0xf603('0x0'));var ChatInteraction=require(_0xf603('0x1'))['db'][_0xf603('0x2')];var ChatMessage=require(_0xf603('0x1'))['db'][_0xf603('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf603('0x4')](0x0);var events={'afterCreate':_0xf603('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x44d802){return function(_0x448364,_0x49283a,_0x5efb4b){_0x448364[_0xf603('0x6')]({'attributes':['id'],'raw':!![]})[_0xf603('0x7')](function(_0x5afee9){_0x448364[_0xf603('0x8')]('Users',_0x5afee9[_0xf603('0x9')](function(_0x53848f){return{'id':_0x53848f['id']};}));return ChatMessage[_0xf603('0xa')]({'where':{'ChatInteractionId':_0x448364['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf603('0x7')](function(_0x59b120){_0x448364[_0xf603('0x8')](_0xf603('0xb'),_0x59b120[_0xf603('0xc')]);ChatInteractionEvents['emit'](_0x44d802+':'+_0x448364['id'],_0x448364);ChatInteractionEvents[_0xf603('0xd')](_0x44d802,_0x448364);_0x5efb4b(null);})[_0xf603('0xe')](_0x5efb4b(null));};}for(var e in events){if(events[_0xf603('0xf')](e)){var event=events[e];ChatInteraction[_0xf603('0x10')](e,emitEvent(event));}}module[_0xf603('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x1e67=['../../mysqldb','ChatInteraction','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','hasOwnProperty','exports'];(function(_0x2c0421,_0xa30722){var _0x25a09e=function(_0x10c118){while(--_0x10c118){_0x2c0421['push'](_0x2c0421['shift']());}};_0x25a09e(++_0xa30722);}(_0x1e67,0x1dc));var _0x71e6=function(_0xdb9e6f,_0x3984c4){_0xdb9e6f=_0xdb9e6f-0x0;var _0x542f93=_0x1e67[_0xdb9e6f];return _0x542f93;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x71e6('0x0'))['db'][_0x71e6('0x1')];var ChatMessage=require(_0x71e6('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x71e6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x71e6('0x3'),'afterDestroy':_0x71e6('0x4')};function emitEvent(_0x526c76){return function(_0x381a4b,_0x19176e,_0x5e47ba){_0x381a4b[_0x71e6('0x5')]({'attributes':['id'],'raw':!![]})[_0x71e6('0x6')](function(_0x397d33){_0x381a4b[_0x71e6('0x7')](_0x71e6('0x8'),_0x397d33[_0x71e6('0x9')](function(_0x551ad5){return{'id':_0x551ad5['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x381a4b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4e01f8){_0x381a4b['setDataValue'](_0x71e6('0xa'),_0x4e01f8[_0x71e6('0xb')]);ChatInteractionEvents['emit'](_0x526c76+':'+_0x381a4b['id'],_0x381a4b);ChatInteractionEvents['emit'](_0x526c76,_0x381a4b);_0x5e47ba(null);})['catch'](_0x5e47ba(null));};}for(var e in events){if(events[_0x71e6('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x71e6('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index a218ac1..17f4da5 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 _0xb266=['./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x653681,_0x18bd0d){var _0x7a6998=function(_0x1941dc){while(--_0x1941dc){_0x653681['push'](_0x653681['shift']());}};_0x7a6998(++_0x18bd0d);}(_0xb266,0x117));var _0x6b26=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb266[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x6b26('0x0'));var logger=require(_0x6b26('0x1'))(_0x6b26('0x2'));var moment=require(_0x6b26('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b26('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b26('0x5'));var config=require('../../config/environment');var attributes=require(_0x6b26('0x6'));module[_0x6b26('0x7')]=function(_0x240e2d,_0x129be1){return _0x240e2d[_0x6b26('0x8')](_0x6b26('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd9b848,_0x41780b,_0x3124f8){if(_0xd9b848[_0x6b26('0xa')](_0x6b26('0xb'))){_0xd9b848[_0x6b26('0xc')]=moment()[_0x6b26('0xd')](_0x6b26('0xe'));}_0x3124f8(null,_0xd9b848);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc6c6=['../../config/environment','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4fc415,_0x3ee15b){var _0xf6c94b=function(_0x4e5092){while(--_0x4e5092){_0x4fc415['push'](_0x4fc415['shift']());}};_0xf6c94b(++_0x3ee15b);}(_0xc6c6,0x1ac));var _0x6c6c=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0xc6c6[_0x525af9];return _0x129fbf;};'use strict';var _=require(_0x6c6c('0x0'));var util=require(_0x6c6c('0x1'));var logger=require(_0x6c6c('0x2'))(_0x6c6c('0x3'));var moment=require(_0x6c6c('0x4'));var BPromise=require(_0x6c6c('0x5'));var rp=require(_0x6c6c('0x6'));var fs=require('fs');var path=require(_0x6c6c('0x7'));var rimraf=require(_0x6c6c('0x8'));var config=require(_0x6c6c('0x9'));var attributes=require('./chatInteraction.attributes');module[_0x6c6c('0xa')]=function(_0x291289,_0x322e9e){return _0x291289[_0x6c6c('0xb')]('ChatInteraction',attributes,{'tableName':_0x6c6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x425b91,_0x219d1f,_0xd23394){if(_0x425b91[_0x6c6c('0xd')](_0x6c6c('0xe'))){_0x425b91[_0x6c6c('0xf')]=moment()[_0x6c6c('0x10')](_0x6c6c('0x11'));}_0xd23394(null,_0x425b91);}},'charset':'utf8mb4','collate':_0x6c6c('0x12')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 6ae130a..0c2220d 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 _0xcabd=['util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','ChatInteraction','update','body','options','raw','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','find','where','addTags','ids','AddTags','lodash'];(function(_0xdd671a,_0x260c90){var _0x2d96b5=function(_0x190904){while(--_0x190904){_0xdd671a['push'](_0xdd671a['shift']());}};_0x2d96b5(++_0x260c90);}(_0xcabd,0x9b));var _0xdcab=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xcabd[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0xdcab('0x0'));var util=require(_0xdcab('0x1'));var moment=require(_0xdcab('0x2'));var BPromise=require('bluebird');var rs=require(_0xdcab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcab('0x4'))['db'];var utils=require(_0xdcab('0x5'));var logger=require('../../config/logger')(_0xdcab('0x6'));var config=require(_0xdcab('0x7'));var jayson=require(_0xdcab('0x8'));var client=jayson['client'][_0xdcab('0x9')]({'port':0x232a});config[_0xdcab('0xa')]=_['defaults'](config[_0xdcab('0xa')],{'host':_0xdcab('0xb'),'port':0x18eb});var socket=require(_0xdcab('0xc'))(new Redis(config[_0xdcab('0xa')]));require(_0xdcab('0xd'))[_0xdcab('0xe')](socket);function respondWithRpcPromise(_0x36fcb3,_0x102c05,_0x212372){return new BPromise(function(_0x5796ad,_0x4c5ad1){return client[_0xdcab('0xf')](_0x36fcb3,_0x212372)[_0xdcab('0x10')](function(_0x135b0e){logger[_0xdcab('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x102c05,_0xdcab('0x12'));logger[_0xdcab('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x102c05,_0xdcab('0x12'),JSON[_0xdcab('0x14')](_0x135b0e));if(_0x135b0e['error']){if(_0x135b0e[_0xdcab('0x15')][_0xdcab('0x16')]===0x1f4){logger[_0xdcab('0x15')](_0xdcab('0x17'),_0x102c05,_0x135b0e[_0xdcab('0x15')][_0xdcab('0x18')]);return _0x4c5ad1(_0x135b0e[_0xdcab('0x15')]['message']);}logger[_0xdcab('0x15')](_0xdcab('0x17'),_0x102c05,_0x135b0e[_0xdcab('0x15')]['message']);return _0x5796ad(_0x135b0e['error'][_0xdcab('0x18')]);}else{logger[_0xdcab('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x102c05,'request\x20sent');_0x5796ad(_0x135b0e['result']['message']);}})['catch'](function(_0x46d1ec){logger[_0xdcab('0x15')](_0xdcab('0x17'),_0x102c05,_0x46d1ec);_0x4c5ad1(_0x46d1ec);});});}exports['UpdateChatInteraction']=function(_0x21b431){var _0x47e89c=this;return new Promise(function(_0x1458d0,_0x32378c){return db[_0xdcab('0x19')][_0xdcab('0x1a')](_0x21b431[_0xdcab('0x1b')],{'raw':_0x21b431[_0xdcab('0x1c')]?_0x21b431[_0xdcab('0x1c')][_0xdcab('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21b431[_0xdcab('0x1c')]?_0x21b431['options']['where']||null:null,'attributes':_0x21b431[_0xdcab('0x1c')]?_0x21b431[_0xdcab('0x1c')]['attributes']||null:null,'limit':_0x21b431[_0xdcab('0x1c')]?_0x21b431[_0xdcab('0x1c')][_0xdcab('0x1e')]||null:null})[_0xdcab('0x10')](function(_0x280190){logger['info'](_0xdcab('0x1f'),_0x21b431);logger[_0xdcab('0x13')](_0xdcab('0x1f'),_0x21b431,JSON[_0xdcab('0x14')](_0x280190));_0x1458d0(_0x280190);})[_0xdcab('0x20')](function(_0x5c39cc){logger[_0xdcab('0x15')]('UpdateChatInteraction',_0x5c39cc[_0xdcab('0x18')],_0x21b431);_0x32378c(_0x47e89c[_0xdcab('0x15')](0x1f4,_0x5c39cc[_0xdcab('0x18')]));});});};exports[_0xdcab('0x21')]=function(_0x1164a0){return new Promise(function(_0x287f4b,_0x2b4534){return db[_0xdcab('0x19')][_0xdcab('0x22')]({'where':_0x1164a0[_0xdcab('0x1c')]?_0x1164a0[_0xdcab('0x1c')][_0xdcab('0x23')]||null:null})[_0xdcab('0x10')](function(_0x4957e5){if(_0x4957e5){return _0x4957e5[_0xdcab('0x24')](_0x1164a0[_0xdcab('0x1b')][_0xdcab('0x25')],_['omit'](_0x1164a0[_0xdcab('0x1b')],['ids','id'])||{});}})['spread'](function(_0x462ebc){logger[_0xdcab('0x11')](_0xdcab('0x26'),_0x1164a0);logger['debug'](_0xdcab('0x26'),_0x1164a0,JSON[_0xdcab('0x14')](_0x462ebc));_0x287f4b(_0x462ebc);})['catch'](function(_0x2aa321){logger[_0xdcab('0x15')](_0xdcab('0x26'),_0x2aa321['message'],_0x1164a0);_0x2b4534(_this['error'](0x1f4,_0x2aa321[_0xdcab('0x18')]));});});}; \ No newline at end of file +var _0xbe2b=['redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','AddTagsToChatInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2545c2,_0x509f54){var _0x28c56f=function(_0x4a7a36){while(--_0x4a7a36){_0x2545c2['push'](_0x2545c2['shift']());}};_0x28c56f(++_0x509f54);}(_0xbe2b,0x94));var _0xbbe2=function(_0x2ce18f,_0x5f006a){_0x2ce18f=_0x2ce18f-0x0;var _0x367a5e=_0xbe2b[_0x2ce18f];return _0x367a5e;};'use strict';var _=require(_0xbbe2('0x0'));var util=require(_0xbbe2('0x1'));var moment=require(_0xbbe2('0x2'));var BPromise=require(_0xbbe2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbe2('0x4'));var db=require(_0xbbe2('0x5'))['db'];var utils=require(_0xbbe2('0x6'));var logger=require('../../config/logger')(_0xbbe2('0x7'));var config=require(_0xbbe2('0x8'));var jayson=require(_0xbbe2('0x9'));var client=jayson[_0xbbe2('0xa')][_0xbbe2('0xb')]({'port':0x232a});config[_0xbbe2('0xc')]=_[_0xbbe2('0xd')](config[_0xbbe2('0xc')],{'host':_0xbbe2('0xe'),'port':0x18eb});var socket=require(_0xbbe2('0xf'))(new Redis(config[_0xbbe2('0xc')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1249e1,_0x53b3de,_0xc82a8e){return new BPromise(function(_0x4c7bdc,_0x42e07b){return client[_0xbbe2('0x10')](_0x1249e1,_0xc82a8e)[_0xbbe2('0x11')](function(_0x326c3f){logger[_0xbbe2('0x12')](_0xbbe2('0x13'),_0x53b3de,_0xbbe2('0x14'));logger[_0xbbe2('0x15')](_0xbbe2('0x16'),_0x53b3de,_0xbbe2('0x14'),JSON[_0xbbe2('0x17')](_0x326c3f));if(_0x326c3f[_0xbbe2('0x18')]){if(_0x326c3f[_0xbbe2('0x18')]['code']===0x1f4){logger[_0xbbe2('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x53b3de,_0x326c3f[_0xbbe2('0x18')][_0xbbe2('0x19')]);return _0x42e07b(_0x326c3f[_0xbbe2('0x18')][_0xbbe2('0x19')]);}logger[_0xbbe2('0x18')](_0xbbe2('0x13'),_0x53b3de,_0x326c3f['error'][_0xbbe2('0x19')]);return _0x4c7bdc(_0x326c3f[_0xbbe2('0x18')][_0xbbe2('0x19')]);}else{logger[_0xbbe2('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x53b3de,_0xbbe2('0x14'));_0x4c7bdc(_0x326c3f['result'][_0xbbe2('0x19')]);}})[_0xbbe2('0x1a')](function(_0x273a68){logger['error'](_0xbbe2('0x13'),_0x53b3de,_0x273a68);_0x42e07b(_0x273a68);});});}exports[_0xbbe2('0x1b')]=function(_0x33928c){var _0x3210ee=this;return new Promise(function(_0x1ade5d,_0x12b3c4){return db[_0xbbe2('0x1c')][_0xbbe2('0x1d')](_0x33928c[_0xbbe2('0x1e')],{'raw':_0x33928c[_0xbbe2('0x1f')]?_0x33928c[_0xbbe2('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33928c[_0xbbe2('0x1f')]?_0x33928c[_0xbbe2('0x1f')][_0xbbe2('0x20')]||null:null,'attributes':_0x33928c[_0xbbe2('0x1f')]?_0x33928c[_0xbbe2('0x1f')][_0xbbe2('0x21')]||null:null,'limit':_0x33928c[_0xbbe2('0x1f')]?_0x33928c[_0xbbe2('0x1f')][_0xbbe2('0x22')]||null:null})[_0xbbe2('0x11')](function(_0xe413c5){logger['info']('UpdateChatInteraction',_0x33928c);logger[_0xbbe2('0x15')](_0xbbe2('0x1b'),_0x33928c,JSON[_0xbbe2('0x17')](_0xe413c5));_0x1ade5d(_0xe413c5);})[_0xbbe2('0x1a')](function(_0x449ca8){logger[_0xbbe2('0x18')](_0xbbe2('0x1b'),_0x449ca8[_0xbbe2('0x19')],_0x33928c);_0x12b3c4(_0x3210ee[_0xbbe2('0x18')](0x1f4,_0x449ca8[_0xbbe2('0x19')]));});});};exports[_0xbbe2('0x23')]=function(_0x5240f1){return new Promise(function(_0x52933b,_0x46ff0e){return db[_0xbbe2('0x1c')]['find']({'where':_0x5240f1[_0xbbe2('0x1f')]?_0x5240f1[_0xbbe2('0x1f')][_0xbbe2('0x20')]||null:null})[_0xbbe2('0x11')](function(_0x3348c6){if(_0x3348c6){return _0x3348c6[_0xbbe2('0x24')](_0x5240f1[_0xbbe2('0x1e')][_0xbbe2('0x25')],_['omit'](_0x5240f1[_0xbbe2('0x1e')],[_0xbbe2('0x25'),'id'])||{});}})[_0xbbe2('0x26')](function(_0x3e7b3c){logger[_0xbbe2('0x12')](_0xbbe2('0x27'),_0x5240f1);logger[_0xbbe2('0x15')](_0xbbe2('0x27'),_0x5240f1,JSON[_0xbbe2('0x17')](_0x3e7b3c));_0x52933b(_0x3e7b3c);})[_0xbbe2('0x1a')](function(_0x99bbfa){logger[_0xbbe2('0x18')]('AddTags',_0x99bbfa['message'],_0x5240f1);_0x46ff0e(_this[_0xbbe2('0x18')](0x1f4,_0x99bbfa[_0xbbe2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 0655e64..5f38df9 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 _0x4c71=['register','length','chatInteraction:','./chatInteraction.events','save','update','emit','removeListener'];(function(_0x2b9630,_0x394f14){var _0x5cb3ba=function(_0xf479f4){while(--_0xf479f4){_0x2b9630['push'](_0x2b9630['shift']());}};_0x5cb3ba(++_0x394f14);}(_0x4c71,0x12b));var _0x14c7=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x4c71[_0x5a776b];return _0xbbef59;};'use strict';var ChatInteractionEvents=require(_0x14c7('0x0'));var events=[_0x14c7('0x1'),'remove',_0x14c7('0x2')];function createListener(_0x348462,_0x3a0e7c){return function(_0x2b1786){_0x3a0e7c[_0x14c7('0x3')](_0x348462,_0x2b1786);};}function removeListener(_0x4bbb43,_0x10a777){return function(){ChatInteractionEvents[_0x14c7('0x4')](_0x4bbb43,_0x10a777);};}exports[_0x14c7('0x5')]=function(_0x3c6929){for(var _0x5b50b6=0x0,_0x493824=events[_0x14c7('0x6')];_0x5b50b6<_0x493824;_0x5b50b6++){var _0x38b0fb=events[_0x5b50b6];var _0x33ffc6=createListener(_0x14c7('0x7')+_0x38b0fb,_0x3c6929);ChatInteractionEvents['on'](_0x38b0fb,_0x33ffc6);}}; \ No newline at end of file +var _0xef9f=['./chatInteraction.events','save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x56456b,_0x5babd7){var _0x37da11=function(_0x45698e){while(--_0x45698e){_0x56456b['push'](_0x56456b['shift']());}};_0x37da11(++_0x5babd7);}(_0xef9f,0x160));var _0xfef9=function(_0x162812,_0x180782){_0x162812=_0x162812-0x0;var _0x3754e0=_0xef9f[_0x162812];return _0x3754e0;};'use strict';var ChatInteractionEvents=require(_0xfef9('0x0'));var events=[_0xfef9('0x1'),_0xfef9('0x2'),_0xfef9('0x3')];function createListener(_0x1914fd,_0x18a37f){return function(_0xffe288){_0x18a37f[_0xfef9('0x4')](_0x1914fd,_0xffe288);};}function removeListener(_0x1c1533,_0x2127ec){return function(){ChatInteractionEvents[_0xfef9('0x5')](_0x1c1533,_0x2127ec);};}exports['register']=function(_0x5d8e90){for(var _0x2dbea7=0x0,_0x27bcb2=events[_0xfef9('0x6')];_0x2dbea7<_0x27bcb2;_0x2dbea7++){var _0x4f97a1=events[_0x2dbea7];var _0x27e95e=createListener(_0xfef9('0x7')+_0x4f97a1,_0x5d8e90);ChatInteractionEvents['on'](_0x4f97a1,_0x27e95e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 891b653..c8debd0 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 _0x77b1=['../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','diskStorage','join','server/files/attachments/','format','now','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x403ff8,_0x459e58){var _0xfdee81=function(_0x2f65f8){while(--_0x2f65f8){_0x403ff8['push'](_0x403ff8['shift']());}};_0xfdee81(++_0x459e58);}(_0x77b1,0x19a));var _0x177b=function(_0x7be85b,_0x14e0ce){_0x7be85b=_0x7be85b-0x0;var _0x496bcb=_0x77b1[_0x7be85b];return _0x496bcb;};'use strict';var multer=require(_0x177b('0x0'));var util=require(_0x177b('0x1'));var path=require(_0x177b('0x2'));var timeout=require(_0x177b('0x3'));var express=require(_0x177b('0x4'));var router=express[_0x177b('0x5')]();var auth=require(_0x177b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x177b('0x7'));router[_0x177b('0x8')]('/',auth[_0x177b('0x9')](),controller[_0x177b('0xa')]);router['get'](_0x177b('0xb'),auth[_0x177b('0x9')](),controller[_0x177b('0xc')]);router[_0x177b('0x8')](_0x177b('0xd'),auth[_0x177b('0xe')](),controller[_0x177b('0xf')]);router[_0x177b('0x8')](_0x177b('0x10'),auth[_0x177b('0xe')](),controller[_0x177b('0x11')]);router[_0x177b('0x8')](_0x177b('0x12'),auth[_0x177b('0x9')](),controller[_0x177b('0x13')]);router[_0x177b('0x8')](_0x177b('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x177b('0x15')]);router[_0x177b('0x8')](_0x177b('0x16'),auth[_0x177b('0x9')](),controller['download']);router[_0x177b('0x17')]('/',auth[_0x177b('0x9')](),controller[_0x177b('0x18')]);var upload=multer({'storage':multer[_0x177b('0x19')]({'destination':function(_0xa0b086,_0x1b06dc,_0x5f31af){_0x5f31af(null,path[_0x177b('0x1a')](config['root'],_0x177b('0x1b')));},'filename':function(_0x5a150e,_0x14c629,_0x5b2f70){_0x5b2f70(null,util[_0x177b('0x1c')]('%s-%s',Date[_0x177b('0x1d')](),_0x14c629['originalname'][_0x177b('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x177b('0x17')]('/:id/attachment_upload',upload[_0x177b('0x1f')](_0x177b('0x20')),controller[_0x177b('0x21')]);router['post'](_0x177b('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x177b('0x22')]);router[_0x177b('0x17')](_0x177b('0x23'),auth[_0x177b('0x9')](),interaction[_0x177b('0x24')](_0x177b('0x25'),_0x177b('0x26')),controller[_0x177b('0x27')]);router[_0x177b('0x28')](_0x177b('0xd'),auth[_0x177b('0x9')](),interaction['tracked']('chat',_0x177b('0x29')),controller[_0x177b('0x2a')]);router['put']('/:id/custom_update',controller[_0x177b('0x2b')]);router[_0x177b('0x28')](_0x177b('0x2c'),auth[_0x177b('0xe')](),controller[_0x177b('0x2d')]);router[_0x177b('0x28')](_0x177b('0x2e'),controller['close']);router[_0x177b('0x2f')](_0x177b('0xd'),auth[_0x177b('0x9')](),interaction[_0x177b('0x24')](_0x177b('0x25'),_0x177b('0x30')),controller[_0x177b('0x31')]);router['delete'](_0x177b('0x23'),auth[_0x177b('0x9')](),controller[_0x177b('0x32')]);module[_0x177b('0x33')]=router; \ No newline at end of file +var _0x4be0=['file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single'];(function(_0x16dcc2,_0x1323f2){var _0x41d2ef=function(_0x4b3085){while(--_0x4b3085){_0x16dcc2['push'](_0x16dcc2['shift']());}};_0x41d2ef(++_0x1323f2);}(_0x4be0,0x107));var _0x04be=function(_0x2b2af1,_0x2095fb){_0x2b2af1=_0x2b2af1-0x0;var _0xd18615=_0x4be0[_0x2b2af1];return _0xd18615;};'use strict';var multer=require(_0x04be('0x0'));var util=require(_0x04be('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x04be('0x2'));var router=express[_0x04be('0x3')]();var auth=require(_0x04be('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x04be('0x5'));var controller=require('./chatInteraction.controller');router[_0x04be('0x6')]('/',auth[_0x04be('0x7')](),controller[_0x04be('0x8')]);router[_0x04be('0x6')](_0x04be('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x04be('0x6')](_0x04be('0xa'),auth[_0x04be('0xb')](),controller[_0x04be('0xc')]);router[_0x04be('0x6')](_0x04be('0xd'),auth[_0x04be('0xb')](),controller[_0x04be('0xe')]);router[_0x04be('0x6')](_0x04be('0xf'),auth[_0x04be('0x7')](),controller['getMessages']);router['get'](_0x04be('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x04be('0x11')]);router[_0x04be('0x6')](_0x04be('0x12'),auth[_0x04be('0x7')](),controller[_0x04be('0x13')]);router[_0x04be('0x14')]('/',auth[_0x04be('0x7')](),controller['create']);var upload=multer({'storage':multer[_0x04be('0x15')]({'destination':function(_0x37720c,_0x3dd7b8,_0x311e87){_0x311e87(null,path[_0x04be('0x16')](config[_0x04be('0x17')],_0x04be('0x18')));},'filename':function(_0xd9c13e,_0x57370d,_0x51f1fd){_0x51f1fd(null,util[_0x04be('0x19')]('%s-%s',Date[_0x04be('0x1a')](),_0x57370d[_0x04be('0x1b')][_0x04be('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x04be('0x14')](_0x04be('0x1d'),upload[_0x04be('0x1e')](_0x04be('0x1f')),controller['attachmentUpload']);router['post'](_0x04be('0xf'),auth[_0x04be('0xb')](),controller[_0x04be('0x20')]);router['post'](_0x04be('0x21'),auth['isAuthenticated'](),interaction[_0x04be('0x22')](_0x04be('0x23'),_0x04be('0x24')),controller[_0x04be('0x25')]);router[_0x04be('0x26')](_0x04be('0xa'),auth[_0x04be('0x7')](),interaction[_0x04be('0x22')](_0x04be('0x23'),'chatinteraction:update'),controller[_0x04be('0x27')]);router[_0x04be('0x26')](_0x04be('0x28'),controller[_0x04be('0x29')]);router[_0x04be('0x26')](_0x04be('0x2a'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x04be('0x26')](_0x04be('0x2b'),controller[_0x04be('0x2c')]);router[_0x04be('0x2d')]('/:id',auth[_0x04be('0x7')](),interaction[_0x04be('0x22')](_0x04be('0x23'),_0x04be('0x2e')),controller[_0x04be('0x2f')]);router['delete'](_0x04be('0x21'),auth[_0x04be('0x7')](),controller['removeTags']);module[_0x04be('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 a387948..0c272f5 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 _0x5f2f=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x5bbab8,_0x1760c2){var _0x1085a3=function(_0x353846){while(--_0x353846){_0x5bbab8['push'](_0x5bbab8['shift']());}};_0x1085a3(++_0x1760c2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3231da,_0x3ae101){_0x3231da=_0x3231da-0x0;var _0x256829=_0x5f2f[_0x3231da];return _0x256829;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf5f2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf5f2('0x5')]}}; \ No newline at end of file +var _0x0295=['sequelize','medium'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0295,0x1f0));var _0x5029=function(_0x2a9153,_0x44fd73){_0x2a9153=_0x2a9153-0x0;var _0x2f6615=_0x0295[_0x2a9153];return _0x2f6615;};'use strict';var Sequelize=require(_0x5029('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x5029('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index bda6e4f..a83f5f1 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 _0x9524=['lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','agent','resourceId','push','messages','FromId','ToId','read','-createdAt','all','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','VIRTUAL','filter','includeAll','include','findAll','catch','params','length','options','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9524,0x1de));var _0x4952=function(_0x3ab9d7,_0x2bf463){_0x3ab9d7=_0x3ab9d7-0x0;var _0x519a02=_0x9524[_0x3ab9d7];return _0x519a02;};'use strict';var pdf=require(_0x4952('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4952('0x1'));var zipdir=require(_0x4952('0x2'));var jsonpatch=require(_0x4952('0x3'));var rp=require(_0x4952('0x4'));var moment=require(_0x4952('0x5'));var BPromise=require(_0x4952('0x6'));var Mustache=require(_0x4952('0x7'));var util=require('util');var path=require('path');var sox=require(_0x4952('0x8'));var csv=require(_0x4952('0x9'));var ejs=require(_0x4952('0xa'));var fs=require('fs');var _=require(_0x4952('0xb'));var squel=require(_0x4952('0xc'));var crypto=require('crypto');var jsforce=require(_0x4952('0xd'));var deskjs=require(_0x4952('0xe'));var toCsv=require(_0x4952('0x9'));var querystring=require(_0x4952('0xf'));var Papa=require(_0x4952('0x10'));var Redis=require(_0x4952('0x11'));var authService=require(_0x4952('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4952('0x13'));var hardwareService=require(_0x4952('0x14'));var logger=require('../../config/logger')(_0x4952('0x15'));var utils=require(_0x4952('0x16'));var config=require('../../config/environment');var db=require(_0x4952('0x17'))['db'];config[_0x4952('0x18')]=_[_0x4952('0x19')](config[_0x4952('0x18')],{'host':_0x4952('0x1a'),'port':0x18eb});var socket=require(_0x4952('0x1b'))(new Redis(config[_0x4952('0x18')]));require(_0x4952('0x1c'))[_0x4952('0x1d')](socket);function respondWithStatusCode(_0x19bb77,_0x1844b5){_0x1844b5=_0x1844b5||0xcc;return function(_0x5e3e26){if(_0x5e3e26){return _0x19bb77[_0x4952('0x1e')](_0x1844b5);}return _0x19bb77[_0x4952('0x1f')](_0x1844b5)[_0x4952('0x20')]();};}function respondWithResult(_0x533e04,_0x582c3f){_0x582c3f=_0x582c3f||0xc8;return function(_0x169c64){if(_0x169c64){return _0x533e04[_0x4952('0x1f')](_0x582c3f)[_0x4952('0x21')](_0x169c64);}};}function respondWithFilteredResult(_0x1281a0,_0x4b3d11){return function(_0x442beb){if(_0x442beb){var _0x54d307=_0x442beb[_0x4952('0x22')],_0x59a20a=_0x4b3d11[_0x4952('0x23')],_0x4bb830=_0x4b3d11[_0x4952('0x23')]+_0x4b3d11['limit'],_0x57fd8a;if(_0x4bb830>=_0x54d307){_0x4bb830=_0x54d307;_0x57fd8a=0xc8;}else{_0x57fd8a=0xce;}_0x1281a0[_0x4952('0x1f')](_0x57fd8a);return _0x1281a0[_0x4952('0x24')](_0x4952('0x25'),_0x59a20a+'-'+_0x4bb830+'/'+_0x54d307)[_0x4952('0x21')](_0x442beb);}return null;};}function patchUpdates(_0xe6946c){return function(_0x4f60f5){try{jsonpatch[_0x4952('0x26')](_0x4f60f5,_0xe6946c,!![]);}catch(_0xd9b7e2){return BPromise[_0x4952('0x27')](_0xd9b7e2);}return _0x4f60f5['save']();};}function saveUpdates(_0x4a8b30,_0x154a85){return function(_0x3c5578){if(_0x3c5578){return _0x3c5578[_0x4952('0x28')](_0x4a8b30)[_0x4952('0x29')](function(_0x488ebb){return _0x488ebb;});}return null;};}function removeEntity(_0x48c427,_0x30330d){return function(_0x597b3f){if(_0x597b3f){return _0x597b3f[_0x4952('0x2a')]()['then'](function(){_0x48c427['status'](0xcc)[_0x4952('0x20')]();});}};}function handleEntityNotFound(_0x576a3a,_0x38d697){return function(_0x32ca5c){if(!_0x32ca5c){_0x576a3a[_0x4952('0x1e')](0x194);}return _0x32ca5c;};}function handleError(_0xba16f9,_0x30d690){_0x30d690=_0x30d690||0x1f4;return function(_0x164796){logger[_0x4952('0x2b')](_0x164796[_0x4952('0x2c')]);if(_0x164796[_0x4952('0x2d')]){delete _0x164796['name'];}_0xba16f9['status'](_0x30d690)[_0x4952('0x2e')](_0x164796);};}exports[_0x4952('0x2f')]=function(_0x52a9c5,_0x169eb2){var _0x473038={},_0x121fb9={},_0x202bbd={'count':0x0,'rows':[]};var _0xc2cbd6=_[_0x4952('0x30')](db[_0x4952('0x31')][_0x4952('0x32')],function(_0x2f43ea){return{'name':_0x2f43ea[_0x4952('0x33')],'type':_0x2f43ea[_0x4952('0x34')][_0x4952('0x35')]};});_0x121fb9[_0x4952('0x36')]=_[_0x4952('0x30')](_0xc2cbd6,_0x4952('0x2d'));_0x121fb9[_0x4952('0x37')]=_[_0x4952('0x38')](_0x52a9c5[_0x4952('0x37')]);_0x121fb9[_0x4952('0x39')]=_[_0x4952('0x3a')](_0x121fb9['model'],_0x121fb9[_0x4952('0x37')]);_0x473038[_0x4952('0x3b')]=_[_0x4952('0x3a')](_0x121fb9[_0x4952('0x36')],qs[_0x4952('0x3c')](_0x52a9c5[_0x4952('0x37')]['fields']));_0x473038['attributes']=_0x473038[_0x4952('0x3b')]['length']?_0x473038[_0x4952('0x3b')]:_0x121fb9[_0x4952('0x36')];if(!_0x52a9c5[_0x4952('0x37')][_0x4952('0x3d')](_0x4952('0x3e'))){_0x473038[_0x4952('0x3f')]=qs[_0x4952('0x3f')](_0x52a9c5[_0x4952('0x37')][_0x4952('0x3f')]);_0x473038[_0x4952('0x23')]=qs[_0x4952('0x23')](_0x52a9c5[_0x4952('0x37')][_0x4952('0x23')]);}_0x473038[_0x4952('0x40')]=qs[_0x4952('0x41')](_0x52a9c5[_0x4952('0x37')][_0x4952('0x41')]);_0x473038[_0x4952('0x42')]=qs[_0x4952('0x39')](_['pick'](_0x52a9c5[_0x4952('0x37')],_0x121fb9[_0x4952('0x39')]));if(_0x52a9c5[_0x4952('0x37')]['filter']){_0x473038[_0x4952('0x42')]=_['merge'](_0x473038[_0x4952('0x42')],{'$or':_[_0x4952('0x30')](_0xc2cbd6,function(_0x445cf4){if(_0x445cf4['type']!==_0x4952('0x43')){var _0x27c5fc={};_0x27c5fc[_0x445cf4[_0x4952('0x2d')]]={'$like':'%'+_0x52a9c5[_0x4952('0x37')][_0x4952('0x44')]+'%'};return _0x27c5fc;}})});}_0x473038=_['merge']({},_0x473038,_0x52a9c5['options']);var _0x404224={'where':_0x473038[_0x4952('0x42')]};return db['ChatInternalMessage'][_0x4952('0x22')](_0x404224)[_0x4952('0x29')](function(_0x27e8b6){_0x202bbd[_0x4952('0x22')]=_0x27e8b6;if(_0x52a9c5[_0x4952('0x37')][_0x4952('0x45')]){_0x473038[_0x4952('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x4952('0x47')](_0x473038);})[_0x4952('0x29')](function(_0x46806b){_0x202bbd['rows']=_0x46806b;return _0x202bbd;})['then'](respondWithFilteredResult(_0x169eb2,_0x473038))[_0x4952('0x48')](handleError(_0x169eb2,null));};exports['show']=function(_0x24951d,_0x2bc848){var _0x1e9a81={'raw':!![],'where':{'id':_0x24951d[_0x4952('0x49')]['id']}},_0x35ecc4={};_0x35ecc4[_0x4952('0x36')]=_[_0x4952('0x38')](db['ChatInternalMessage'][_0x4952('0x32')]);_0x35ecc4['query']=_[_0x4952('0x38')](_0x24951d[_0x4952('0x37')]);_0x35ecc4[_0x4952('0x39')]=_[_0x4952('0x3a')](_0x35ecc4[_0x4952('0x36')],_0x35ecc4['query']);_0x1e9a81[_0x4952('0x3b')]=_[_0x4952('0x3a')](_0x35ecc4[_0x4952('0x36')],qs['fields'](_0x24951d[_0x4952('0x37')][_0x4952('0x3c')]));_0x1e9a81['attributes']=_0x1e9a81[_0x4952('0x3b')][_0x4952('0x4a')]?_0x1e9a81[_0x4952('0x3b')]:_0x35ecc4[_0x4952('0x36')];if(_0x24951d[_0x4952('0x37')][_0x4952('0x45')]){_0x1e9a81[_0x4952('0x46')]=[{'all':!![]}];}_0x1e9a81=_['merge']({},_0x1e9a81,_0x24951d[_0x4952('0x4b')]);return db[_0x4952('0x31')][_0x4952('0x4c')](_0x1e9a81)[_0x4952('0x29')](handleEntityNotFound(_0x2bc848,null))['then'](respondWithResult(_0x2bc848,null))[_0x4952('0x48')](handleError(_0x2bc848,null));};exports[_0x4952('0x4d')]=function(_0x27a96a,_0x7396ea){return db[_0x4952('0x31')][_0x4952('0x4d')](_0x27a96a[_0x4952('0x4e')],{})[_0x4952('0x29')](respondWithResult(_0x7396ea,0xc9))[_0x4952('0x48')](handleError(_0x7396ea,null));};exports[_0x4952('0x28')]=function(_0x366b4a,_0x2f7c2a){if(_0x366b4a[_0x4952('0x4e')]['id']){delete _0x366b4a['body']['id'];}return db[_0x4952('0x31')][_0x4952('0x4c')]({'where':{'id':_0x366b4a[_0x4952('0x49')]['id']}})[_0x4952('0x29')](handleEntityNotFound(_0x2f7c2a,null))['then'](saveUpdates(_0x366b4a[_0x4952('0x4e')],null))[_0x4952('0x29')](respondWithResult(_0x2f7c2a,null))[_0x4952('0x48')](handleError(_0x2f7c2a,null));};exports[_0x4952('0x2a')]=function(_0x308489,_0xcbabef){return db[_0x4952('0x31')][_0x4952('0x4c')]({'where':{'id':_0x308489[_0x4952('0x49')]['id']}})[_0x4952('0x29')](handleEntityNotFound(_0xcbabef,null))[_0x4952('0x29')](removeEntity(_0xcbabef,null))[_0x4952('0x48')](handleError(_0xcbabef,null));};exports[_0x4952('0x4f')]=function(_0x359d7a,_0x1807a4){return db[_0x4952('0x31')]['describe']()[_0x4952('0x29')](respondWithResult(_0x1807a4,null))[_0x4952('0x48')](handleError(_0x1807a4,null));};function wrapUser(_0x349346){return function(_0xb787b){var _0x3774f4=_0x349346[_0x4952('0x50')]({'plain':!![]});_0x3774f4['messages']=[];if(_0xb787b){_0x3774f4[_0x4952('0x51')]=_0xb787b[_0x4952('0x52')];_0x3774f4[_0x4952('0x53')]=_0xb787b;}else{_0x3774f4[_0x4952('0x51')]=moment(0x0)[_0x4952('0x54')](_0x4952('0x55'));_0x3774f4[_0x4952('0x53')]={};}return _0x3774f4;};}exports[_0x4952('0x56')]=function(_0x123f1,_0x12399b,_0xef9f4d){var _0x3d3c50=[];return db[_0x4952('0x57')][_0x4952('0x47')]({'where':{'role':['agent',_0x4952('0x58'),'user']},'attributes':['id',_0x4952('0x59'),_0x4952('0x2d'),_0x4952('0x5a'),'userpic','internal',_0x4952('0x5b'),_0x4952('0x5c'),_0x4952('0x5d'),_0x4952('0x5e')],'order':qs[_0x4952('0x41')](_0x4952('0x5f')),'include':[{'model':db[_0x4952('0x60')],'as':_0x4952('0x61'),'attributes':['id',_0x4952('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x4952('0x29')](function(_0x3104c3){if(_0x3104c3){var _0x1e77b5=_0x123f1[_0x4952('0x62')][_0x4952('0x50')]({'plain':!![]});if(!_0x1e77b5)throw new Error(_0x4952('0x63'));if(_0x1e77b5[_0x4952('0x5a')]===_0x4952('0x62')){return db[_0x4952('0x64')]['find']({'where':{'name':_0x4952('0x65'),'userProfileId':_0x1e77b5[_0x4952('0x66')]},'raw':!![]})[_0x4952('0x29')](function(_0x3e0413){if(_0x3e0413){if(_0x3e0413[_0x4952('0x67')]===0x0){return db['UserProfileResource'][_0x4952('0x47')]({'where':{'sectionId':_0x3e0413['id']},'raw':!![]})[_0x4952('0x29')](function(_0x417429){var _0x1197b5=[];if(_[_0x4952('0x68')](_0x417429)){_0x1197b5=_[_0x4952('0x44')](_0x3104c3,function(_0x2315ab){if(_0x2315ab[_0x4952('0x5a')]!==_0x4952('0x69')){return _0x2315ab;}});return _0x1197b5;}else{for(var _0x54f03a=0x0;_0x54f03a<_0x3104c3[_0x4952('0x4a')];_0x54f03a++){var _0x514fc6=_0x3104c3[_0x54f03a];if(_0x514fc6['role']===_0x4952('0x69')){var _0x18328f=_[_0x4952('0x4c')](_0x417429,function(_0x4b0c7a){return _0x4b0c7a[_0x4952('0x6a')]===_0x514fc6['id'];});if(_0x18328f)_0x1197b5[_0x4952('0x6b')](_0x514fc6);}else{_0x1197b5[_0x4952('0x6b')](_0x514fc6);}}return _0x1197b5;}});}else{return _0x3104c3;}}else{var _0x5a6ac8=_[_0x4952('0x44')](_0x3104c3,function(_0x2928da){if(_0x2928da['role']!==_0x4952('0x69')){return _0x2928da;}});return _0x5a6ac8;}});}else{return _0x3104c3;}}})['then'](function(_0x446063){var _0x1990db=[];if(_0x446063){_0x3d3c50=_0x446063;for(var _0x593e88=0x0;_0x593e88<_0x446063[_0x4952('0x4a')];_0x593e88+=0x1){_0x3d3c50[_0x593e88][_0x4952('0x6c')]=[];_0x1990db[_0x4952('0x6b')](db[_0x4952('0x31')]['find']({'where':{'FromId':[_0x123f1[_0x4952('0x62')]['id'],_0x446063[_0x593e88]['id']],'ToId':[_0x123f1['user']['id'],_0x446063[_0x593e88]['id']],'ChatGroupId':null},'attributes':['id',_0x4952('0x52'),_0x4952('0x6d'),_0x4952('0x6e'),_0x4952('0x6f'),_0x4952('0x4e')],'order':qs[_0x4952('0x41')](_0x4952('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4952('0x29')](wrapUser(_0x446063[_0x593e88])));}return BPromise[_0x4952('0x71')](_0x1990db);}return[];})[_0x4952('0x29')](function(_0xabdb4f){return{'rows':_0xabdb4f,'count':_0xabdb4f[_0x4952('0x4a')]};})[_0x4952('0x29')](respondWithResult(_0x12399b,null))[_0x4952('0x48')](handleError(_0x12399b,null));}; \ No newline at end of file +var _0xa6c7=['Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','ChatInternalMessage','fieldName','query','intersection','attributes','fields','length','model','sort','where','pick','filters','type','VIRTUAL','merge','options','includeAll','include','rows','catch','keys','rawAttributes','find','create','body','params','describe','messages','lastMessageAt','createdAt','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','UserProfileSection','Agents','userProfileId','autoAssociation','findAll','isEmpty','filter','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','count','offset','limit','set'];(function(_0x9265cd,_0x4fbb2f){var _0x51649a=function(_0x58c897){while(--_0x58c897){_0x9265cd['push'](_0x9265cd['shift']());}};_0x51649a(++_0x4fbb2f);}(_0xa6c7,0x11a));var _0x7a6c=function(_0x1378d8,_0x70eabd){_0x1378d8=_0x1378d8-0x0;var _0x445476=_0xa6c7[_0x1378d8];return _0x445476;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7a6c('0x0'));var rimraf=require(_0x7a6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7a6c('0x2'));var BPromise=require(_0x7a6c('0x3'));var Mustache=require(_0x7a6c('0x4'));var util=require('util');var path=require(_0x7a6c('0x5'));var sox=require(_0x7a6c('0x6'));var csv=require(_0x7a6c('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7a6c('0x8'));var squel=require(_0x7a6c('0x9'));var crypto=require('crypto');var jsforce=require(_0x7a6c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7a6c('0x7'));var querystring=require('querystring');var Papa=require(_0x7a6c('0xb'));var Redis=require('ioredis');var authService=require(_0x7a6c('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x7a6c('0xd'));var hardwareService=require(_0x7a6c('0xe'));var logger=require(_0x7a6c('0xf'))(_0x7a6c('0x10'));var utils=require(_0x7a6c('0x11'));var config=require(_0x7a6c('0x12'));var db=require(_0x7a6c('0x13'))['db'];config[_0x7a6c('0x14')]=_[_0x7a6c('0x15')](config[_0x7a6c('0x14')],{'host':_0x7a6c('0x16'),'port':0x18eb});var socket=require(_0x7a6c('0x17'))(new Redis(config[_0x7a6c('0x14')]));require(_0x7a6c('0x18'))[_0x7a6c('0x19')](socket);function respondWithStatusCode(_0x11f5a6,_0x5a60ca){_0x5a60ca=_0x5a60ca||0xcc;return function(_0x46268c){if(_0x46268c){return _0x11f5a6['sendStatus'](_0x5a60ca);}return _0x11f5a6[_0x7a6c('0x1a')](_0x5a60ca)[_0x7a6c('0x1b')]();};}function respondWithResult(_0x4ae4d9,_0x1dc3ef){_0x1dc3ef=_0x1dc3ef||0xc8;return function(_0x382c9c){if(_0x382c9c){return _0x4ae4d9[_0x7a6c('0x1a')](_0x1dc3ef)[_0x7a6c('0x1c')](_0x382c9c);}};}function respondWithFilteredResult(_0x68ea13,_0x38e8c7){return function(_0x161346){if(_0x161346){var _0x17472e=_0x161346[_0x7a6c('0x1d')],_0x29842c=_0x38e8c7[_0x7a6c('0x1e')],_0x3868b4=_0x38e8c7[_0x7a6c('0x1e')]+_0x38e8c7[_0x7a6c('0x1f')],_0x2aed41;if(_0x3868b4>=_0x17472e){_0x3868b4=_0x17472e;_0x2aed41=0xc8;}else{_0x2aed41=0xce;}_0x68ea13[_0x7a6c('0x1a')](_0x2aed41);return _0x68ea13[_0x7a6c('0x20')](_0x7a6c('0x21'),_0x29842c+'-'+_0x3868b4+'/'+_0x17472e)[_0x7a6c('0x1c')](_0x161346);}return null;};}function patchUpdates(_0x45ee73){return function(_0x2b941e){try{jsonpatch[_0x7a6c('0x22')](_0x2b941e,_0x45ee73,!![]);}catch(_0x44d76d){return BPromise[_0x7a6c('0x23')](_0x44d76d);}return _0x2b941e['save']();};}function saveUpdates(_0x34b2d3,_0x39ed2d){return function(_0x3e8c19){if(_0x3e8c19){return _0x3e8c19[_0x7a6c('0x24')](_0x34b2d3)[_0x7a6c('0x25')](function(_0x118b1b){return _0x118b1b;});}return null;};}function removeEntity(_0x5bd908,_0x382528){return function(_0x2b2db5){if(_0x2b2db5){return _0x2b2db5[_0x7a6c('0x26')]()[_0x7a6c('0x25')](function(){_0x5bd908[_0x7a6c('0x1a')](0xcc)[_0x7a6c('0x1b')]();});}};}function handleEntityNotFound(_0x5bdc87,_0x1e739d){return function(_0x221720){if(!_0x221720){_0x5bdc87[_0x7a6c('0x27')](0x194);}return _0x221720;};}function handleError(_0x287b7d,_0x338a3e){_0x338a3e=_0x338a3e||0x1f4;return function(_0x3a4b12){logger[_0x7a6c('0x28')](_0x3a4b12[_0x7a6c('0x29')]);if(_0x3a4b12['name']){delete _0x3a4b12[_0x7a6c('0x2a')];}_0x287b7d[_0x7a6c('0x1a')](_0x338a3e)['send'](_0x3a4b12);};}exports[_0x7a6c('0x2b')]=function(_0x2cc639,_0x9f651e){var _0x430594={},_0x54423e={},_0x4e6e5b={'count':0x0,'rows':[]};var _0x46e393=_[_0x7a6c('0x2c')](db[_0x7a6c('0x2d')]['rawAttributes'],function(_0x53a6e0){return{'name':_0x53a6e0[_0x7a6c('0x2e')],'type':_0x53a6e0['type']['key']};});_0x54423e['model']=_[_0x7a6c('0x2c')](_0x46e393,_0x7a6c('0x2a'));_0x54423e[_0x7a6c('0x2f')]=_['keys'](_0x2cc639[_0x7a6c('0x2f')]);_0x54423e['filters']=_[_0x7a6c('0x30')](_0x54423e['model'],_0x54423e[_0x7a6c('0x2f')]);_0x430594[_0x7a6c('0x31')]=_['intersection'](_0x54423e['model'],qs[_0x7a6c('0x32')](_0x2cc639[_0x7a6c('0x2f')][_0x7a6c('0x32')]));_0x430594[_0x7a6c('0x31')]=_0x430594[_0x7a6c('0x31')][_0x7a6c('0x33')]?_0x430594[_0x7a6c('0x31')]:_0x54423e[_0x7a6c('0x34')];if(!_0x2cc639[_0x7a6c('0x2f')]['hasOwnProperty']('nolimit')){_0x430594[_0x7a6c('0x1f')]=qs[_0x7a6c('0x1f')](_0x2cc639[_0x7a6c('0x2f')][_0x7a6c('0x1f')]);_0x430594[_0x7a6c('0x1e')]=qs['offset'](_0x2cc639[_0x7a6c('0x2f')]['offset']);}_0x430594['order']=qs[_0x7a6c('0x35')](_0x2cc639['query'][_0x7a6c('0x35')]);_0x430594[_0x7a6c('0x36')]=qs['filters'](_[_0x7a6c('0x37')](_0x2cc639[_0x7a6c('0x2f')],_0x54423e[_0x7a6c('0x38')]));if(_0x2cc639[_0x7a6c('0x2f')]['filter']){_0x430594['where']=_['merge'](_0x430594['where'],{'$or':_[_0x7a6c('0x2c')](_0x46e393,function(_0x41d123){if(_0x41d123[_0x7a6c('0x39')]!==_0x7a6c('0x3a')){var _0x52441f={};_0x52441f[_0x41d123['name']]={'$like':'%'+_0x2cc639[_0x7a6c('0x2f')]['filter']+'%'};return _0x52441f;}})});}_0x430594=_[_0x7a6c('0x3b')]({},_0x430594,_0x2cc639[_0x7a6c('0x3c')]);var _0x26e1f0={'where':_0x430594[_0x7a6c('0x36')]};return db[_0x7a6c('0x2d')][_0x7a6c('0x1d')](_0x26e1f0)[_0x7a6c('0x25')](function(_0x249f82){_0x4e6e5b[_0x7a6c('0x1d')]=_0x249f82;if(_0x2cc639[_0x7a6c('0x2f')][_0x7a6c('0x3d')]){_0x430594[_0x7a6c('0x3e')]=[{'all':!![]}];}return db[_0x7a6c('0x2d')]['findAll'](_0x430594);})['then'](function(_0x18d979){_0x4e6e5b[_0x7a6c('0x3f')]=_0x18d979;return _0x4e6e5b;})[_0x7a6c('0x25')](respondWithFilteredResult(_0x9f651e,_0x430594))[_0x7a6c('0x40')](handleError(_0x9f651e,null));};exports['show']=function(_0x1fed4a,_0x879990){var _0xc5192c={'raw':!![],'where':{'id':_0x1fed4a['params']['id']}},_0x53438d={};_0x53438d[_0x7a6c('0x34')]=_[_0x7a6c('0x41')](db['ChatInternalMessage'][_0x7a6c('0x42')]);_0x53438d[_0x7a6c('0x2f')]=_['keys'](_0x1fed4a[_0x7a6c('0x2f')]);_0x53438d[_0x7a6c('0x38')]=_[_0x7a6c('0x30')](_0x53438d[_0x7a6c('0x34')],_0x53438d[_0x7a6c('0x2f')]);_0xc5192c[_0x7a6c('0x31')]=_['intersection'](_0x53438d[_0x7a6c('0x34')],qs[_0x7a6c('0x32')](_0x1fed4a[_0x7a6c('0x2f')][_0x7a6c('0x32')]));_0xc5192c[_0x7a6c('0x31')]=_0xc5192c[_0x7a6c('0x31')]['length']?_0xc5192c[_0x7a6c('0x31')]:_0x53438d[_0x7a6c('0x34')];if(_0x1fed4a[_0x7a6c('0x2f')][_0x7a6c('0x3d')]){_0xc5192c[_0x7a6c('0x3e')]=[{'all':!![]}];}_0xc5192c=_[_0x7a6c('0x3b')]({},_0xc5192c,_0x1fed4a['options']);return db['ChatInternalMessage'][_0x7a6c('0x43')](_0xc5192c)[_0x7a6c('0x25')](handleEntityNotFound(_0x879990,null))[_0x7a6c('0x25')](respondWithResult(_0x879990,null))[_0x7a6c('0x40')](handleError(_0x879990,null));};exports['create']=function(_0x71d6a0,_0x517d47){return db[_0x7a6c('0x2d')][_0x7a6c('0x44')](_0x71d6a0[_0x7a6c('0x45')],{})[_0x7a6c('0x25')](respondWithResult(_0x517d47,0xc9))[_0x7a6c('0x40')](handleError(_0x517d47,null));};exports[_0x7a6c('0x24')]=function(_0x1d330d,_0x50b663){if(_0x1d330d[_0x7a6c('0x45')]['id']){delete _0x1d330d[_0x7a6c('0x45')]['id'];}return db[_0x7a6c('0x2d')]['find']({'where':{'id':_0x1d330d[_0x7a6c('0x46')]['id']}})[_0x7a6c('0x25')](handleEntityNotFound(_0x50b663,null))[_0x7a6c('0x25')](saveUpdates(_0x1d330d[_0x7a6c('0x45')],null))[_0x7a6c('0x25')](respondWithResult(_0x50b663,null))[_0x7a6c('0x40')](handleError(_0x50b663,null));};exports['destroy']=function(_0x24cd3b,_0x5b15b7){return db[_0x7a6c('0x2d')][_0x7a6c('0x43')]({'where':{'id':_0x24cd3b[_0x7a6c('0x46')]['id']}})[_0x7a6c('0x25')](handleEntityNotFound(_0x5b15b7,null))[_0x7a6c('0x25')](removeEntity(_0x5b15b7,null))[_0x7a6c('0x40')](handleError(_0x5b15b7,null));};exports['describe']=function(_0x3519f1,_0x30b2a0){return db[_0x7a6c('0x2d')][_0x7a6c('0x47')]()[_0x7a6c('0x25')](respondWithResult(_0x30b2a0,null))[_0x7a6c('0x40')](handleError(_0x30b2a0,null));};function wrapUser(_0x5992d6){return function(_0x2ae459){var _0x3192a4=_0x5992d6['get']({'plain':!![]});_0x3192a4[_0x7a6c('0x48')]=[];if(_0x2ae459){_0x3192a4[_0x7a6c('0x49')]=_0x2ae459[_0x7a6c('0x4a')];_0x3192a4['lastMessage']=_0x2ae459;}else{_0x3192a4[_0x7a6c('0x49')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3192a4['lastMessage']={};}return _0x3192a4;};}exports[_0x7a6c('0x4b')]=function(_0x595e58,_0x5511b4,_0x1e94e3){var _0x2c38a1=[];return db[_0x7a6c('0x4c')]['findAll']({'where':{'role':[_0x7a6c('0x4d'),_0x7a6c('0x4e'),_0x7a6c('0x4f')]},'attributes':['id',_0x7a6c('0x50'),_0x7a6c('0x2a'),_0x7a6c('0x51'),_0x7a6c('0x52'),_0x7a6c('0x53'),_0x7a6c('0x54'),_0x7a6c('0x55'),_0x7a6c('0x56'),_0x7a6c('0x57')],'order':qs[_0x7a6c('0x35')](_0x7a6c('0x58')),'include':[{'model':db[_0x7a6c('0x59')],'as':_0x7a6c('0x5a'),'attributes':['id','name',_0x7a6c('0x39')],'through':{'attributes':[]}}]})[_0x7a6c('0x25')](function(_0x2d0152){if(_0x2d0152){var _0xd0b9e3=_0x595e58[_0x7a6c('0x4f')][_0x7a6c('0x5b')]({'plain':!![]});if(!_0xd0b9e3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd0b9e3['role']===_0x7a6c('0x4f')){return db[_0x7a6c('0x5c')]['find']({'where':{'name':_0x7a6c('0x5d'),'userProfileId':_0xd0b9e3[_0x7a6c('0x5e')]},'raw':!![]})['then'](function(_0x576eb9){if(_0x576eb9){if(_0x576eb9[_0x7a6c('0x5f')]===0x0){return db['UserProfileResource'][_0x7a6c('0x60')]({'where':{'sectionId':_0x576eb9['id']},'raw':!![]})[_0x7a6c('0x25')](function(_0x4c9b29){var _0x1724c9=[];if(_[_0x7a6c('0x61')](_0x4c9b29)){_0x1724c9=_[_0x7a6c('0x62')](_0x2d0152,function(_0x3883aa){if(_0x3883aa['role']!==_0x7a6c('0x4d')){return _0x3883aa;}});return _0x1724c9;}else{for(var _0x3d711d=0x0;_0x3d711d<_0x2d0152[_0x7a6c('0x33')];_0x3d711d++){var _0x6cbca2=_0x2d0152[_0x3d711d];if(_0x6cbca2['role']==='agent'){var _0x164654=_[_0x7a6c('0x43')](_0x4c9b29,function(_0x539bc0){return _0x539bc0[_0x7a6c('0x63')]===_0x6cbca2['id'];});if(_0x164654)_0x1724c9[_0x7a6c('0x64')](_0x6cbca2);}else{_0x1724c9[_0x7a6c('0x64')](_0x6cbca2);}}return _0x1724c9;}});}else{return _0x2d0152;}}else{var _0x48072f=_[_0x7a6c('0x62')](_0x2d0152,function(_0x5dace4){if(_0x5dace4[_0x7a6c('0x51')]!==_0x7a6c('0x4d')){return _0x5dace4;}});return _0x48072f;}});}else{return _0x2d0152;}}})[_0x7a6c('0x25')](function(_0x54403c){var _0x38a3bc=[];if(_0x54403c){_0x2c38a1=_0x54403c;for(var _0xb69ae6=0x0;_0xb69ae6<_0x54403c[_0x7a6c('0x33')];_0xb69ae6+=0x1){_0x2c38a1[_0xb69ae6]['messages']=[];_0x38a3bc[_0x7a6c('0x64')](db[_0x7a6c('0x2d')][_0x7a6c('0x43')]({'where':{'FromId':[_0x595e58[_0x7a6c('0x4f')]['id'],_0x54403c[_0xb69ae6]['id']],'ToId':[_0x595e58[_0x7a6c('0x4f')]['id'],_0x54403c[_0xb69ae6]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x7a6c('0x65'),'ToId',_0x7a6c('0x66'),_0x7a6c('0x45')],'order':qs[_0x7a6c('0x35')](_0x7a6c('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7a6c('0x25')](wrapUser(_0x54403c[_0xb69ae6])));}return BPromise[_0x7a6c('0x68')](_0x38a3bc);}return[];})['then'](function(_0x36831d){return{'rows':_0x36831d,'count':_0x36831d['length']};})[_0x7a6c('0x25')](respondWithResult(_0x5511b4,null))[_0x7a6c('0x40')](handleError(_0x5511b4,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index b850643..ba0949c 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 _0x7af2=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0x7af2,0x1b5));var _0x27af=function(_0x3c89de,_0x19ca19){_0x3c89de=_0x3c89de-0x0;var _0x338fb3=_0x7af2[_0x3c89de];return _0x338fb3;};'use strict';var EventEmitter=require(_0x27af('0x0'));var ChatInternalMessage=require(_0x27af('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x27af('0x2')](0x0);var events={'afterCreate':_0x27af('0x3'),'afterUpdate':_0x27af('0x4'),'afterDestroy':_0x27af('0x5')};function emitEvent(_0x4577ef){return function(_0xa75342,_0x3de7fe,_0x18f0fa){ChatInternalMessageEvents['emit'](_0x4577ef+':'+_0xa75342['id'],_0xa75342);ChatInternalMessageEvents['emit'](_0x4577ef,_0xa75342);_0x18f0fa(null);};}for(var e in events){if(events[_0x27af('0x6')](e)){var event=events[e];ChatInternalMessage[_0x27af('0x7')](e,emitEvent(event));}}module[_0x27af('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xdab2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2dab('0x0'));var ChatInternalMessage=require(_0x2dab('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2dab('0x2')](0x0);var events={'afterCreate':_0x2dab('0x3'),'afterUpdate':_0x2dab('0x4'),'afterDestroy':_0x2dab('0x5')};function emitEvent(_0x56a9cc){return function(_0x2078be,_0x2480cb,_0x319ff2){ChatInternalMessageEvents[_0x2dab('0x6')](_0x56a9cc+':'+_0x2078be['id'],_0x2078be);ChatInternalMessageEvents[_0x2dab('0x6')](_0x56a9cc,_0x2078be);_0x319ff2(null);};}for(var e in events){if(events[_0x2dab('0x7')](e)){var event=events[e];ChatInternalMessage[_0x2dab('0x8')](e,emitEvent(event));}}module[_0x2dab('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index a57feb1..5fcfd2c 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 _0x4fc2=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x376529,_0x2a0d24){var _0x330b0d=function(_0x167afa){while(--_0x167afa){_0x376529['push'](_0x376529['shift']());}};_0x330b0d(++_0x2a0d24);}(_0x4fc2,0x111));var _0x24fc=function(_0xf27c8d,_0x9ae5ef){_0xf27c8d=_0xf27c8d-0x0;var _0x568348=_0x4fc2[_0xf27c8d];return _0x568348;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24fc('0xb'),'collate':_0x24fc('0xc')});}; \ No newline at end of file +var _0xa9e0=['define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_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':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 73e3f18..f8c57b0 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 _0x94ff=['request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x4b4b1a,_0x276dd5){var _0x5056ec=function(_0x362ac7){while(--_0x362ac7){_0x4b4b1a['push'](_0x4b4b1a['shift']());}};_0x5056ec(++_0x276dd5);}(_0x94ff,0x79));var _0xf94f=function(_0x5315f8,_0x1f3b40){_0x5315f8=_0x5315f8-0x0;var _0x42912b=_0x94ff[_0x5315f8];return _0x42912b;};'use strict';var _=require(_0xf94f('0x0'));var util=require(_0xf94f('0x1'));var moment=require(_0xf94f('0x2'));var BPromise=require(_0xf94f('0x3'));var rs=require(_0xf94f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf94f('0x5'))['db'];var utils=require(_0xf94f('0x6'));var logger=require(_0xf94f('0x7'))(_0xf94f('0x8'));var config=require(_0xf94f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf94f('0xa')][_0xf94f('0xb')]({'port':0x232a});config[_0xf94f('0xc')]=_[_0xf94f('0xd')](config[_0xf94f('0xc')],{'host':_0xf94f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf94f('0xc')]));require('./chatInternalMessage.socket')[_0xf94f('0xf')](socket);function respondWithRpcPromise(_0x106bb2,_0x4dbfb7,_0x4e3549){return new BPromise(function(_0x56b004,_0x5b5e6f){return client[_0xf94f('0x10')](_0x106bb2,_0x4e3549)['then'](function(_0xbbce56){logger[_0xf94f('0x11')](_0xf94f('0x12'),_0x4dbfb7,_0xf94f('0x13'));logger[_0xf94f('0x14')](_0xf94f('0x15'),_0x4dbfb7,_0xf94f('0x13'),JSON[_0xf94f('0x16')](_0xbbce56));if(_0xbbce56[_0xf94f('0x17')]){if(_0xbbce56[_0xf94f('0x17')][_0xf94f('0x18')]===0x1f4){logger[_0xf94f('0x17')](_0xf94f('0x12'),_0x4dbfb7,_0xbbce56[_0xf94f('0x17')]['message']);return _0x5b5e6f(_0xbbce56[_0xf94f('0x17')][_0xf94f('0x19')]);}logger['error'](_0xf94f('0x12'),_0x4dbfb7,_0xbbce56[_0xf94f('0x17')][_0xf94f('0x19')]);return _0x56b004(_0xbbce56['error'][_0xf94f('0x19')]);}else{logger[_0xf94f('0x11')](_0xf94f('0x12'),_0x4dbfb7,_0xf94f('0x13'));_0x56b004(_0xbbce56[_0xf94f('0x1a')][_0xf94f('0x19')]);}})[_0xf94f('0x1b')](function(_0x577ea8){logger[_0xf94f('0x17')](_0xf94f('0x12'),_0x4dbfb7,_0x577ea8);_0x5b5e6f(_0x577ea8);});});} \ No newline at end of file +var _0x8206=['info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x25093b,_0x1f9123){var _0x5cd8a0=function(_0x5dd7ba){while(--_0x5dd7ba){_0x25093b['push'](_0x25093b['shift']());}};_0x5cd8a0(++_0x1f9123);}(_0x8206,0x105));var _0x6820=function(_0x5e671f,_0x41e305){_0x5e671f=_0x5e671f-0x0;var _0x4d105a=_0x8206[_0x5e671f];return _0x4d105a;};'use strict';var _=require(_0x6820('0x0'));var util=require(_0x6820('0x1'));var moment=require(_0x6820('0x2'));var BPromise=require(_0x6820('0x3'));var rs=require(_0x6820('0x4'));var fs=require('fs');var Redis=require(_0x6820('0x5'));var db=require(_0x6820('0x6'))['db'];var utils=require(_0x6820('0x7'));var logger=require(_0x6820('0x8'))(_0x6820('0x9'));var config=require(_0x6820('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6820('0xb')]({'port':0x232a});config[_0x6820('0xc')]=_[_0x6820('0xd')](config[_0x6820('0xc')],{'host':_0x6820('0xe'),'port':0x18eb});var socket=require(_0x6820('0xf'))(new Redis(config[_0x6820('0xc')]));require(_0x6820('0x10'))[_0x6820('0x11')](socket);function respondWithRpcPromise(_0x36c058,_0x5bef8d,_0x2473f0){return new BPromise(function(_0x367124,_0x90c86d){return client[_0x6820('0x12')](_0x36c058,_0x2473f0)['then'](function(_0x398586){logger[_0x6820('0x13')](_0x6820('0x14'),_0x5bef8d,_0x6820('0x15'));logger['debug'](_0x6820('0x16'),_0x5bef8d,_0x6820('0x15'),JSON[_0x6820('0x17')](_0x398586));if(_0x398586['error']){if(_0x398586[_0x6820('0x18')][_0x6820('0x19')]===0x1f4){logger[_0x6820('0x18')](_0x6820('0x14'),_0x5bef8d,_0x398586[_0x6820('0x18')][_0x6820('0x1a')]);return _0x90c86d(_0x398586[_0x6820('0x18')][_0x6820('0x1a')]);}logger[_0x6820('0x18')](_0x6820('0x14'),_0x5bef8d,_0x398586[_0x6820('0x18')][_0x6820('0x1a')]);return _0x367124(_0x398586[_0x6820('0x18')]['message']);}else{logger['info'](_0x6820('0x14'),_0x5bef8d,'request\x20sent');_0x367124(_0x398586[_0x6820('0x1b')]['message']);}})['catch'](function(_0x50226f){logger[_0x6820('0x18')](_0x6820('0x14'),_0x5bef8d,_0x50226f);_0x90c86d(_0x50226f);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 3f7f494..41344fe 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 _0xbacb=['register','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0x3e2faf,_0x3316dc){var _0x4c8a26=function(_0x3a76cf){while(--_0x3a76cf){_0x3e2faf['push'](_0x3e2faf['shift']());}};_0x4c8a26(++_0x3316dc);}(_0xbacb,0x1a6));var _0xbbac=function(_0x138096,_0x2a0154){_0x138096=_0x138096-0x0;var _0x26ba9e=_0xbacb[_0x138096];return _0x26ba9e;};'use strict';var ChatInternalMessageEvents=require(_0xbbac('0x0'));var events=[_0xbbac('0x1'),'remove',_0xbbac('0x2')];function createListener(_0x27e607,_0x3689f3){return function(_0x30e505){_0x3689f3[_0xbbac('0x3')](_0x27e607,_0x30e505);};}function removeListener(_0x97ea61,_0x4e3698){return function(){ChatInternalMessageEvents['removeListener'](_0x97ea61,_0x4e3698);};}exports[_0xbbac('0x4')]=function(_0x2b9236){for(var _0x210763=0x0,_0x2d3a31=events['length'];_0x210763<_0x2d3a31;_0x210763++){var _0x17aaf1=events[_0x210763];var _0xfd6f21=createListener(_0xbbac('0x5')+_0x17aaf1,_0x2b9236);ChatInternalMessageEvents['on'](_0x17aaf1,_0xfd6f21);}}; \ No newline at end of file +var _0xf021=['update','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x3a9815,_0x47eb16){var _0x188653=function(_0x203e84){while(--_0x203e84){_0x3a9815['push'](_0x3a9815['shift']());}};_0x188653(++_0x47eb16);}(_0xf021,0x18f));var _0x1f02=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0xf021[_0x1fc84d];return _0x2658fa;};'use strict';var ChatInternalMessageEvents=require(_0x1f02('0x0'));var events=[_0x1f02('0x1'),_0x1f02('0x2'),_0x1f02('0x3')];function createListener(_0x30184d,_0x53cc42){return function(_0x1027d2){_0x53cc42['emit'](_0x30184d,_0x1027d2);};}function removeListener(_0x2e8594,_0x3164f0){return function(){ChatInternalMessageEvents['removeListener'](_0x2e8594,_0x3164f0);};}exports['register']=function(_0x84a8f0){for(var _0x56b275=0x0,_0x383d0b=events[_0x1f02('0x4')];_0x56b275<_0x383d0b;_0x56b275++){var _0x2a6c50=events[_0x56b275];var _0x4193d2=createListener(_0x1f02('0x5')+_0x2a6c50,_0x84a8f0);ChatInternalMessageEvents['on'](_0x2a6c50,_0x4193d2);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index c59927b..4a9203e 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','post','delete'];(function(_0xb6e880,_0x1c8c08){var _0x167043=function(_0x506d89){while(--_0x506d89){_0xb6e880['push'](_0xb6e880['shift']());}};_0x167043(++_0x1c8c08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getUsers']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')]('/',auth[_0x0a9e('0x8')](),controller['create']);router['put']('/:id',controller['update']);router[_0x0a9e('0xe')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xf')]);module[_0x0a9e('0x10')]=router; \ No newline at end of file +var _0x70e0=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/users','isAuthenticated','getUsers','/:id','post','create','put','update','delete','destroy'];(function(_0x4d53a5,_0x3da5df){var _0xb85e6e=function(_0x3a726e){while(--_0x3a726e){_0x4d53a5['push'](_0x4d53a5['shift']());}};_0xb85e6e(++_0x3da5df);}(_0x70e0,0x17b));var _0x070e=function(_0x3927f3,_0x21c280){_0x3927f3=_0x3927f3-0x0;var _0x503396=_0x70e0[_0x3927f3];return _0x503396;};'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('./chatInternalMessage.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['show']);router[_0x070e('0xe')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')](_0x070e('0xd'),controller[_0x070e('0x11')]);router[_0x070e('0x12')](_0x070e('0xd'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);module[_0x070e('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index bb10024..c3bcc5e 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 _0x1063=['BOOLEAN','ENUM','out','sequelize','exports','TEXT','medium'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x1063,0x168));var _0x3106=function(_0x59f305,_0x3c45ad){_0x59f305=_0x59f305-0x0;var _0x334132=_0x1063[_0x59f305];return _0x334132;};'use strict';var Sequelize=require(_0x3106('0x0'));module[_0x3106('0x1')]={'body':{'type':Sequelize[_0x3106('0x2')](_0x3106('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3106('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3106('0x5')]('in',_0x3106('0x6')),'defaultValue':_0x3106('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xd30d=['sequelize','exports','BOOLEAN','ENUM','out'];(function(_0x13f258,_0x48b914){var _0x19b2f9=function(_0x23e5d4){while(--_0x23e5d4){_0x13f258['push'](_0x13f258['shift']());}};_0x19b2f9(++_0x48b914);}(_0xd30d,0x1ea));var _0xdd30=function(_0x34662c,_0x57ed89){_0x34662c=_0x34662c-0x0;var _0x8c11ff=_0xd30d[_0x34662c];return _0x8c11ff;};'use strict';var Sequelize=require(_0xdd30('0x0'));module[_0xdd30('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xdd30('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdd30('0x3')]('in',_0xdd30('0x4')),'defaultValue':_0xdd30('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 994b9af..1408048 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 _0x3d51=['interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','manual','interface','format','channel','event','EventManager','acceptmessage','parse','chat','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SIP/%s','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','count','offset','limit','set','json','reject','update','destroy','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','length','include','create','body','find','describe','chat-interactions','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','ChatInteraction','ChatInteractionId','isNil'];(function(_0xa4b2f1,_0x569dd6){var _0x457e75=function(_0x339500){while(--_0x339500){_0xa4b2f1['push'](_0xa4b2f1['shift']());}};_0x457e75(++_0x569dd6);}(_0x3d51,0x90));var _0x13d5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3d51[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x13d5('0x0'));var rimraf=require(_0x13d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13d5('0x2'));var rp=require(_0x13d5('0x3'));var moment=require(_0x13d5('0x4'));var BPromise=require(_0x13d5('0x5'));var Mustache=require(_0x13d5('0x6'));var util=require(_0x13d5('0x7'));var path=require(_0x13d5('0x8'));var sox=require(_0x13d5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x13d5('0xa'));var squel=require(_0x13d5('0xb'));var crypto=require(_0x13d5('0xc'));var jsforce=require(_0x13d5('0xd'));var deskjs=require(_0x13d5('0xe'));var toCsv=require(_0x13d5('0xf'));var querystring=require(_0x13d5('0x10'));var Papa=require(_0x13d5('0x11'));var Redis=require(_0x13d5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x13d5('0x13'));var as=require(_0x13d5('0x14'));var hardwareService=require(_0x13d5('0x15'));var logger=require(_0x13d5('0x16'))(_0x13d5('0x17'));var utils=require('../../config/utils');var config=require(_0x13d5('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x13d5('0x19')](config[_0x13d5('0x1a')],{'host':_0x13d5('0x1b'),'port':0x18eb});var socket=require(_0x13d5('0x1c'))(new Redis(config[_0x13d5('0x1a')]));require(_0x13d5('0x1d'))[_0x13d5('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x13d5('0x1f')][_0x13d5('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x953832,_0x541ceb,_0x41589b){if(_0x41589b){var _0x1ffc0e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ffc0e['test'](_0x541ceb)){return _0x953832;}else{throw new db[(_0x13d5('0x21'))][(_0x13d5('0x22'))](_0x13d5('0x23'));}}else{return _0x953832;}}function respondWithRpcPromise(_0x3c37b9,_0x218769,_0x572cb8,_0x431509){return new BPromise(function(_0x2feb74,_0x16ced7){var _0xdd6397=_0x431509||client;return _0xdd6397[_0x13d5('0x24')](_0x3c37b9,_0x572cb8)[_0x13d5('0x25')](function(_0x2204b5){logger['info']('ChatMessage,\x20%s,\x20%s',_0x218769,_0x13d5('0x26'));logger[_0x13d5('0x27')](_0x13d5('0x28'),_0x218769,_0x13d5('0x26'),JSON[_0x13d5('0x29')](_0x2204b5));if(_0x2204b5['error']){if(_0x2204b5[_0x13d5('0x2a')]['code']===0x1f4){logger['error'](_0x13d5('0x2b'),_0x218769,_0x2204b5[_0x13d5('0x2a')]['message']);return _0x16ced7(_0x2204b5[_0x13d5('0x2a')][_0x13d5('0x2c')]);}logger[_0x13d5('0x2a')](_0x13d5('0x2b'),_0x218769,_0x2204b5[_0x13d5('0x2a')][_0x13d5('0x2c')]);return _0x2feb74(_0x2204b5['error']['message']);}else{logger[_0x13d5('0x2d')](_0x13d5('0x2b'),_0x218769,_0x13d5('0x26'));_0x2feb74(_0x2204b5[_0x13d5('0x2e')]['message']);}})[_0x13d5('0x2f')](function(_0x5b7c9c){logger['error'](_0x13d5('0x2b'),_0x218769,_0x5b7c9c);_0x16ced7(_0x5b7c9c);});});}function respondWithStatusCode(_0x544685,_0x160deb){_0x160deb=_0x160deb||0xcc;return function(_0x28c5fa){if(_0x28c5fa){return _0x544685[_0x13d5('0x30')](_0x160deb);}return _0x544685[_0x13d5('0x31')](_0x160deb)['end']();};}function respondWithResult(_0x2199a5,_0x4416bb){_0x4416bb=_0x4416bb||0xc8;return function(_0x3252d1){if(_0x3252d1){return _0x2199a5[_0x13d5('0x31')](_0x4416bb)['json'](_0x3252d1);}};}function respondWithFilteredResult(_0x53b9bc,_0x243a5d){return function(_0x3b177d){if(_0x3b177d){var _0x3f1c5f=_0x3b177d[_0x13d5('0x32')],_0x39582a=_0x243a5d['offset'],_0x404481=_0x243a5d[_0x13d5('0x33')]+_0x243a5d[_0x13d5('0x34')],_0x46642e;if(_0x404481>=_0x3f1c5f){_0x404481=_0x3f1c5f;_0x46642e=0xc8;}else{_0x46642e=0xce;}_0x53b9bc[_0x13d5('0x31')](_0x46642e);return _0x53b9bc[_0x13d5('0x35')]('Content-Range',_0x39582a+'-'+_0x404481+'/'+_0x3f1c5f)[_0x13d5('0x36')](_0x3b177d);}return null;};}function patchUpdates(_0x2fd669){return function(_0x523f0e){try{jsonpatch['apply'](_0x523f0e,_0x2fd669,!![]);}catch(_0x216fd0){return BPromise[_0x13d5('0x37')](_0x216fd0);}return _0x523f0e['save']();};}function saveUpdates(_0x554378,_0x15f8ed){return function(_0x3e2bf4){if(_0x3e2bf4){return _0x3e2bf4[_0x13d5('0x38')](_0x554378)['then'](function(_0x4b02b2){return _0x4b02b2;});}return null;};}function removeEntity(_0x4606ec,_0x1b3e84){return function(_0x5c846e){if(_0x5c846e){return _0x5c846e[_0x13d5('0x39')]()[_0x13d5('0x25')](function(){_0x4606ec[_0x13d5('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0xefff15,_0x180724){return function(_0x39fa19){if(!_0x39fa19){_0xefff15[_0x13d5('0x30')](0x194);}return _0x39fa19;};}function handleError(_0x536a75,_0x2f5054){_0x2f5054=_0x2f5054||0x1f4;return function(_0x582a96){logger[_0x13d5('0x2a')](_0x582a96['stack']);if(_0x582a96[_0x13d5('0x3a')]){delete _0x582a96[_0x13d5('0x3a')];}_0x536a75['status'](_0x2f5054)['send'](_0x582a96);};}exports[_0x13d5('0x3b')]=function(_0x1e4f67,_0x510904){var _0x2ff209={},_0x9a8239={},_0x40e180={'count':0x0,'rows':[]};var _0x317fc8=_[_0x13d5('0x3c')](db[_0x13d5('0x3d')][_0x13d5('0x3e')],function(_0x190a27){return{'name':_0x190a27[_0x13d5('0x3f')],'type':_0x190a27[_0x13d5('0x40')][_0x13d5('0x41')]};});_0x9a8239[_0x13d5('0x42')]=_['map'](_0x317fc8,_0x13d5('0x3a'));_0x9a8239[_0x13d5('0x43')]=_[_0x13d5('0x44')](_0x1e4f67[_0x13d5('0x43')]);_0x9a8239[_0x13d5('0x45')]=_[_0x13d5('0x46')](_0x9a8239[_0x13d5('0x42')],_0x9a8239['query']);_0x2ff209[_0x13d5('0x47')]=_[_0x13d5('0x46')](_0x9a8239['model'],qs[_0x13d5('0x48')](_0x1e4f67[_0x13d5('0x43')][_0x13d5('0x48')]));_0x2ff209[_0x13d5('0x47')]=_0x2ff209['attributes']['length']?_0x2ff209[_0x13d5('0x47')]:_0x9a8239['model'];if(!_0x1e4f67[_0x13d5('0x43')][_0x13d5('0x49')](_0x13d5('0x4a'))){_0x2ff209[_0x13d5('0x34')]=qs[_0x13d5('0x34')](_0x1e4f67['query'][_0x13d5('0x34')]);_0x2ff209[_0x13d5('0x33')]=qs[_0x13d5('0x33')](_0x1e4f67[_0x13d5('0x43')][_0x13d5('0x33')]);}_0x2ff209['order']=qs[_0x13d5('0x4b')](_0x1e4f67[_0x13d5('0x43')][_0x13d5('0x4b')]);_0x2ff209[_0x13d5('0x4c')]=qs[_0x13d5('0x45')](_[_0x13d5('0x4d')](_0x1e4f67[_0x13d5('0x43')],_0x9a8239['filters']));if(_0x1e4f67['query'][_0x13d5('0x4e')]){_0x2ff209[_0x13d5('0x4c')]=_[_0x13d5('0x4f')](_0x2ff209[_0x13d5('0x4c')],{'$or':_[_0x13d5('0x3c')](_0x317fc8,function(_0x6f827e){if(_0x6f827e[_0x13d5('0x40')]!==_0x13d5('0x50')){var _0x4ac5dd={};_0x4ac5dd[_0x6f827e[_0x13d5('0x3a')]]={'$like':'%'+_0x1e4f67[_0x13d5('0x43')][_0x13d5('0x4e')]+'%'};return _0x4ac5dd;}})});}_0x2ff209=_[_0x13d5('0x4f')]({},_0x2ff209,_0x1e4f67['options']);var _0x226fc1={'where':_0x2ff209[_0x13d5('0x4c')]};return db['ChatMessage'][_0x13d5('0x32')](_0x226fc1)[_0x13d5('0x25')](function(_0x3fabf8){_0x40e180['count']=_0x3fabf8;if(_0x1e4f67['query'][_0x13d5('0x51')]){_0x2ff209['include']=[{'all':!![]}];}return db[_0x13d5('0x3d')]['findAll'](_0x2ff209);})['then'](function(_0x14d6dd){_0x40e180[_0x13d5('0x52')]=_0x14d6dd;return _0x40e180;})[_0x13d5('0x25')](respondWithFilteredResult(_0x510904,_0x2ff209))[_0x13d5('0x2f')](handleError(_0x510904,null));};exports[_0x13d5('0x53')]=function(_0x47e634,_0x4a0fe2){var _0x49be3c={'raw':!![],'where':{'id':_0x47e634[_0x13d5('0x54')]['id']}},_0x3e87b2={};_0x3e87b2['model']=_['keys'](db[_0x13d5('0x3d')][_0x13d5('0x3e')]);_0x3e87b2[_0x13d5('0x43')]=_[_0x13d5('0x44')](_0x47e634[_0x13d5('0x43')]);_0x3e87b2[_0x13d5('0x45')]=_[_0x13d5('0x46')](_0x3e87b2['model'],_0x3e87b2['query']);_0x49be3c[_0x13d5('0x47')]=_[_0x13d5('0x46')](_0x3e87b2['model'],qs['fields'](_0x47e634[_0x13d5('0x43')][_0x13d5('0x48')]));_0x49be3c[_0x13d5('0x47')]=_0x49be3c[_0x13d5('0x47')][_0x13d5('0x55')]?_0x49be3c[_0x13d5('0x47')]:_0x3e87b2[_0x13d5('0x42')];if(_0x47e634[_0x13d5('0x43')][_0x13d5('0x51')]){_0x49be3c[_0x13d5('0x56')]=[{'all':!![]}];}_0x49be3c=_[_0x13d5('0x4f')]({},_0x49be3c,_0x47e634['options']);return db['ChatMessage']['find'](_0x49be3c)[_0x13d5('0x25')](handleEntityNotFound(_0x4a0fe2,null))[_0x13d5('0x25')](respondWithResult(_0x4a0fe2,null))[_0x13d5('0x2f')](handleError(_0x4a0fe2,null));};exports[_0x13d5('0x57')]=function(_0x254e99,_0x23b2e8){return db[_0x13d5('0x3d')][_0x13d5('0x57')](_0x254e99[_0x13d5('0x58')],{})[_0x13d5('0x25')](respondWithResult(_0x23b2e8,0xc9))[_0x13d5('0x2f')](handleError(_0x23b2e8,null));};exports['update']=function(_0x1c9bfc,_0x3e4526){if(_0x1c9bfc[_0x13d5('0x58')]['id']){delete _0x1c9bfc[_0x13d5('0x58')]['id'];}return db[_0x13d5('0x3d')][_0x13d5('0x59')]({'where':{'id':_0x1c9bfc['params']['id']}})[_0x13d5('0x25')](handleEntityNotFound(_0x3e4526,null))[_0x13d5('0x25')](saveUpdates(_0x1c9bfc[_0x13d5('0x58')],null))[_0x13d5('0x25')](respondWithResult(_0x3e4526,null))[_0x13d5('0x2f')](handleError(_0x3e4526,null));};exports[_0x13d5('0x39')]=function(_0x3c44a0,_0x8b636f){return db[_0x13d5('0x3d')][_0x13d5('0x59')]({'where':{'id':_0x3c44a0[_0x13d5('0x54')]['id']}})[_0x13d5('0x25')](handleEntityNotFound(_0x8b636f,null))[_0x13d5('0x25')](removeEntity(_0x8b636f,null))[_0x13d5('0x2f')](handleError(_0x8b636f,null));};exports[_0x13d5('0x5a')]=function(_0x398b3c,_0x73c634){return db[_0x13d5('0x3d')][_0x13d5('0x5a')]()[_0x13d5('0x25')](respondWithResult(_0x73c634,null))[_0x13d5('0x2f')](handleError(_0x73c634,null));};var interaction_log=require('../../config/logger')(_0x13d5('0x5b'));exports[_0x13d5('0x5c')]=function(_0x29815e,_0x4f9df7,_0x139aa5){var _0x60f39e={'channel':'chat'};if(_0x29815e[_0x13d5('0x58')]['id']){delete _0x29815e[_0x13d5('0x58')]['id'];}_0x29815e['body'][_0x13d5('0x5d')]=!![];_0x29815e['body']['readAt']=moment()['format'](_0x13d5('0x5e'));_0x29815e[_0x13d5('0x58')]['UserId']=_0x29815e[_0x13d5('0x58')][_0x13d5('0x5f')]||_0x29815e[_0x13d5('0x60')]['id'];return db['ChatMessage']['find']({'where':{'id':_0x29815e[_0x13d5('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x13d5('0x61')],'as':_0x13d5('0x62')}]})[_0x13d5('0x25')](handleEntityNotFound(_0x4f9df7,null))[_0x13d5('0x25')](saveUpdates(_0x29815e[_0x13d5('0x58')],null))[_0x13d5('0x25')](function(_0x568455){if(_0x568455){_0x60f39e[_0x13d5('0x2c')]=_0x568455['get']({'plain':!![]});return db[_0x13d5('0x63')][_0x13d5('0x59')]({'where':{'id':_0x568455[_0x13d5('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x4f9df7,null))[_0x13d5('0x25')](function(_0x154243){if(_0x154243){return _0x154243[_0x13d5('0x38')]({'UserId':_0x29815e[_0x13d5('0x58')][_0x13d5('0x5f')],'read1stAt':_[_0x13d5('0x65')](_0x154243['read1stAt'])?moment()['format'](_0x13d5('0x5e')):undefined});}return null;})[_0x13d5('0x25')](function(_0x247b5b){if(_0x247b5b){_0x60f39e[_0x13d5('0x66')]=_0x247b5b[_0x13d5('0x67')]({'plain':!![]});interaction_log[_0x13d5('0x2d')](_0x13d5('0x68'),_0x29815e[_0x13d5('0x60')]['id'],_0x29815e[_0x13d5('0x60')][_0x13d5('0x3a')],_0x29815e[_0x13d5('0x60')][_0x13d5('0x69')],_0x60f39e[_0x13d5('0x66')]['id'],_0x29815e[_0x13d5('0x58')]?JSON[_0x13d5('0x29')](_0x29815e[_0x13d5('0x58')]):'null');return respondWithRpcPromise(_0x13d5('0x6a'),'acceptMessage',_0x60f39e);}return null;})[_0x13d5('0x25')](function(_0x50a5bf){if(_0x50a5bf){if(_0x29815e['body'][_0x13d5('0x6b')]){_0x60f39e[_0x13d5('0x2c')][_0x13d5('0x6c')]=util[_0x13d5('0x6d')]('SIP/%s',_0x29815e[_0x13d5('0x60')]['name']);_0x60f39e[_0x13d5('0x2c')][_0x13d5('0x6e')]=_0x60f39e[_0x13d5('0x6e')];_0x60f39e['message'][_0x13d5('0x6f')]=_0x13d5('0x5c');return respondWithRpcPromise(_0x13d5('0x70'),_0x13d5('0x70'),{'event':_0x13d5('0x71'),'message':_[_0x13d5('0x4f')](_0x60f39e[_0x13d5('0x2c')],JSON[_0x13d5('0x72')](_0x60f39e[_0x13d5('0x66')]['formData']))},client9002)['then'](function(){return _0x60f39e;});}return _0x60f39e;}return null;})[_0x13d5('0x25')](respondWithResult(_0x4f9df7,null))[_0x13d5('0x2f')](handleError(_0x4f9df7,null));};var interaction_log=require(_0x13d5('0x16'))(_0x13d5('0x5b'));exports[_0x13d5('0x37')]=function(_0x26c719,_0x5d421d,_0x5b3574){var _0x319d53={'agent':{},'channel':_0x13d5('0x73')};if(_0x26c719[_0x13d5('0x58')]['id']){delete _0x26c719['body']['id'];}_0x26c719[_0x13d5('0x58')][_0x13d5('0x5f')]=_0x26c719[_0x13d5('0x58')][_0x13d5('0x5f')]||_0x26c719[_0x13d5('0x60')]['id'];_0x319d53[_0x13d5('0x74')]['id']=_0x26c719[_0x13d5('0x58')][_0x13d5('0x5f')];return db['ChatMessage'][_0x13d5('0x59')]({'where':{'id':_0x26c719[_0x13d5('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5d421d,null))[_0x13d5('0x25')](function(_0xb653ba){if(_0xb653ba){_0x319d53[_0x13d5('0x2c')]=_0xb653ba['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0xb653ba['ChatInteractionId']}});}return null;})[_0x13d5('0x25')](handleEntityNotFound(_0x5d421d,null))[_0x13d5('0x25')](function(_0x2b2c83){if(_0x2b2c83){_0x319d53['interaction']=_0x2b2c83[_0x13d5('0x67')]({'plain':!![]});interaction_log[_0x13d5('0x2d')](_0x13d5('0x75'),_0x26c719['user']['id'],_0x26c719[_0x13d5('0x60')][_0x13d5('0x3a')],_0x26c719[_0x13d5('0x60')][_0x13d5('0x69')],_0x319d53[_0x13d5('0x66')]['id'],_0x26c719[_0x13d5('0x58')]?JSON['stringify'](_0x26c719[_0x13d5('0x58')]):_0x13d5('0x76'));return respondWithRpcPromise(_0x13d5('0x77'),_0x13d5('0x78'),_0x319d53);}return null;})[_0x13d5('0x25')](function(_0x5ac858){if(_0x5ac858){_0x5ac858[_0x13d5('0x2c')]['interface']=util[_0x13d5('0x6d')](_0x13d5('0x79'),_0x26c719[_0x13d5('0x60')]['name']);_0x5ac858[_0x13d5('0x2c')][_0x13d5('0x6e')]=_0x319d53[_0x13d5('0x6e')];_0x5ac858[_0x13d5('0x2c')][_0x13d5('0x6f')]=_0x13d5('0x37');respondWithRpcPromise(_0x13d5('0x70'),_0x13d5('0x70'),{'event':_0x13d5('0x7a'),'message':_0x5ac858[_0x13d5('0x2c')]},client9002);return _0x319d53;}return null;})['then'](respondWithResult(_0x5d421d,null))[_0x13d5('0x2f')](handleError(_0x5d421d,null));}; \ No newline at end of file +var _0x469d=['ChatMessage','findAll','rows','show','params','find','create','body','describe','accept','chat','readAt','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','acceptMessage','manual','interface','SIP/%s','event','EventManager','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','channel','rejectmessage','html-pdf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','crypto','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','./chatMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','update','destroy','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include'];(function(_0x32d1ae,_0x575e52){var _0x49cf0b=function(_0x7dc05c){while(--_0x7dc05c){_0x32d1ae['push'](_0x32d1ae['shift']());}};_0x49cf0b(++_0x575e52);}(_0x469d,0x124));var _0xd469=function(_0x4d4ddf,_0xad6a6a){_0x4d4ddf=_0x4d4ddf-0x0;var _0x9a360b=_0x469d[_0x4d4ddf];return _0x9a360b;};'use strict';var pdf=require(_0xd469('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd469('0x1'));var jsonpatch=require(_0xd469('0x2'));var rp=require(_0xd469('0x3'));var moment=require(_0xd469('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd469('0x5'));var path=require(_0xd469('0x6'));var sox=require('sox');var csv=require(_0xd469('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd469('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd469('0x9'));var toCsv=require('to-csv');var querystring=require(_0xd469('0xa'));var Papa=require(_0xd469('0xb'));var Redis=require(_0xd469('0xc'));var authService=require(_0xd469('0xd'));var qs=require(_0xd469('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd469('0xf'));var logger=require(_0xd469('0x10'))(_0xd469('0x11'));var utils=require(_0xd469('0x12'));var config=require(_0xd469('0x13'));var db=require(_0xd469('0x14'))['db'];config[_0xd469('0x15')]=_[_0xd469('0x16')](config[_0xd469('0x15')],{'host':_0xd469('0x17'),'port':0x18eb});var socket=require(_0xd469('0x18'))(new Redis(config[_0xd469('0x15')]));require(_0xd469('0x19'))['register'](socket);var jayson=require(_0xd469('0x1a'));var client=jayson[_0xd469('0x1b')][_0xd469('0x1c')]({'port':0x232c});var client9002=jayson[_0xd469('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0xe1c5a9,_0x2d122a,_0xb07c0d){if(_0xb07c0d){var _0x45edcd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45edcd[_0xd469('0x1d')](_0x2d122a)){return _0xe1c5a9;}else{throw new db[(_0xd469('0x1e'))][(_0xd469('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xe1c5a9;}}function respondWithRpcPromise(_0x9d4722,_0x17bd3d,_0x18d2c1,_0x589b5f){return new BPromise(function(_0x83465d,_0x1644eb){var _0x5f3142=_0x589b5f||client;return _0x5f3142[_0xd469('0x20')](_0x9d4722,_0x18d2c1)[_0xd469('0x21')](function(_0x4156a4){logger['info'](_0xd469('0x22'),_0x17bd3d,_0xd469('0x23'));logger[_0xd469('0x24')](_0xd469('0x25'),_0x17bd3d,_0xd469('0x23'),JSON['stringify'](_0x4156a4));if(_0x4156a4[_0xd469('0x26')]){if(_0x4156a4['error'][_0xd469('0x27')]===0x1f4){logger['error'](_0xd469('0x22'),_0x17bd3d,_0x4156a4[_0xd469('0x26')]['message']);return _0x1644eb(_0x4156a4[_0xd469('0x26')][_0xd469('0x28')]);}logger[_0xd469('0x26')](_0xd469('0x22'),_0x17bd3d,_0x4156a4['error'][_0xd469('0x28')]);return _0x83465d(_0x4156a4[_0xd469('0x26')]['message']);}else{logger[_0xd469('0x29')]('ChatMessage,\x20%s,\x20%s',_0x17bd3d,_0xd469('0x23'));_0x83465d(_0x4156a4[_0xd469('0x2a')][_0xd469('0x28')]);}})[_0xd469('0x2b')](function(_0x4a9ea6){logger[_0xd469('0x26')](_0xd469('0x22'),_0x17bd3d,_0x4a9ea6);_0x1644eb(_0x4a9ea6);});});}function respondWithStatusCode(_0x4109ed,_0x5ddecb){_0x5ddecb=_0x5ddecb||0xcc;return function(_0x4c8224){if(_0x4c8224){return _0x4109ed[_0xd469('0x2c')](_0x5ddecb);}return _0x4109ed[_0xd469('0x2d')](_0x5ddecb)[_0xd469('0x2e')]();};}function respondWithResult(_0x221ecd,_0x4cd883){_0x4cd883=_0x4cd883||0xc8;return function(_0x435773){if(_0x435773){return _0x221ecd[_0xd469('0x2d')](_0x4cd883)['json'](_0x435773);}};}function respondWithFilteredResult(_0x2e8688,_0x414a1c){return function(_0x11f13c){if(_0x11f13c){var _0x204865=_0x11f13c[_0xd469('0x2f')],_0x17c4ed=_0x414a1c[_0xd469('0x30')],_0x2a6c1f=_0x414a1c[_0xd469('0x30')]+_0x414a1c[_0xd469('0x31')],_0x197d87;if(_0x2a6c1f>=_0x204865){_0x2a6c1f=_0x204865;_0x197d87=0xc8;}else{_0x197d87=0xce;}_0x2e8688[_0xd469('0x2d')](_0x197d87);return _0x2e8688['set'](_0xd469('0x32'),_0x17c4ed+'-'+_0x2a6c1f+'/'+_0x204865)[_0xd469('0x33')](_0x11f13c);}return null;};}function patchUpdates(_0x4ee6a5){return function(_0x225001){try{jsonpatch[_0xd469('0x34')](_0x225001,_0x4ee6a5,!![]);}catch(_0x4de380){return BPromise[_0xd469('0x35')](_0x4de380);}return _0x225001['save']();};}function saveUpdates(_0x356608,_0x281f8d){return function(_0x4b9599){if(_0x4b9599){return _0x4b9599[_0xd469('0x36')](_0x356608)['then'](function(_0xc34e8f){return _0xc34e8f;});}return null;};}function removeEntity(_0x39830b,_0x1420f7){return function(_0x325ff2){if(_0x325ff2){return _0x325ff2[_0xd469('0x37')]()[_0xd469('0x21')](function(){_0x39830b[_0xd469('0x2d')](0xcc)[_0xd469('0x2e')]();});}};}function handleEntityNotFound(_0x37cb43,_0x5cd83f){return function(_0x498c04){if(!_0x498c04){_0x37cb43[_0xd469('0x2c')](0x194);}return _0x498c04;};}function handleError(_0xefef5f,_0x374b69){_0x374b69=_0x374b69||0x1f4;return function(_0x5f5a57){logger[_0xd469('0x26')](_0x5f5a57[_0xd469('0x38')]);if(_0x5f5a57['name']){delete _0x5f5a57['name'];}_0xefef5f['status'](_0x374b69)[_0xd469('0x39')](_0x5f5a57);};}exports[_0xd469('0x3a')]=function(_0x875c,_0x100f6e){var _0x32f054={},_0x2ee562={},_0x23b503={'count':0x0,'rows':[]};var _0x460c55=_[_0xd469('0x3b')](db['ChatMessage'][_0xd469('0x3c')],function(_0x240d80){return{'name':_0x240d80[_0xd469('0x3d')],'type':_0x240d80['type'][_0xd469('0x3e')]};});_0x2ee562[_0xd469('0x3f')]=_[_0xd469('0x3b')](_0x460c55,_0xd469('0x40'));_0x2ee562[_0xd469('0x41')]=_[_0xd469('0x42')](_0x875c['query']);_0x2ee562[_0xd469('0x43')]=_[_0xd469('0x44')](_0x2ee562[_0xd469('0x3f')],_0x2ee562[_0xd469('0x41')]);_0x32f054['attributes']=_[_0xd469('0x44')](_0x2ee562[_0xd469('0x3f')],qs[_0xd469('0x45')](_0x875c[_0xd469('0x41')]['fields']));_0x32f054[_0xd469('0x46')]=_0x32f054[_0xd469('0x46')][_0xd469('0x47')]?_0x32f054[_0xd469('0x46')]:_0x2ee562[_0xd469('0x3f')];if(!_0x875c[_0xd469('0x41')]['hasOwnProperty'](_0xd469('0x48'))){_0x32f054[_0xd469('0x31')]=qs[_0xd469('0x31')](_0x875c[_0xd469('0x41')][_0xd469('0x31')]);_0x32f054[_0xd469('0x30')]=qs[_0xd469('0x30')](_0x875c[_0xd469('0x41')][_0xd469('0x30')]);}_0x32f054[_0xd469('0x49')]=qs[_0xd469('0x4a')](_0x875c[_0xd469('0x41')]['sort']);_0x32f054[_0xd469('0x4b')]=qs[_0xd469('0x43')](_[_0xd469('0x4c')](_0x875c[_0xd469('0x41')],_0x2ee562[_0xd469('0x43')]));if(_0x875c[_0xd469('0x41')][_0xd469('0x4d')]){_0x32f054['where']=_[_0xd469('0x4e')](_0x32f054['where'],{'$or':_[_0xd469('0x3b')](_0x460c55,function(_0x529ac7){if(_0x529ac7[_0xd469('0x4f')]!=='VIRTUAL'){var _0x42c83f={};_0x42c83f[_0x529ac7[_0xd469('0x40')]]={'$like':'%'+_0x875c[_0xd469('0x41')]['filter']+'%'};return _0x42c83f;}})});}_0x32f054=_[_0xd469('0x4e')]({},_0x32f054,_0x875c[_0xd469('0x50')]);var _0x1b9c93={'where':_0x32f054[_0xd469('0x4b')]};return db['ChatMessage']['count'](_0x1b9c93)['then'](function(_0x213aa8){_0x23b503[_0xd469('0x2f')]=_0x213aa8;if(_0x875c[_0xd469('0x41')][_0xd469('0x51')]){_0x32f054[_0xd469('0x52')]=[{'all':!![]}];}return db[_0xd469('0x53')][_0xd469('0x54')](_0x32f054);})[_0xd469('0x21')](function(_0x352460){_0x23b503[_0xd469('0x55')]=_0x352460;return _0x23b503;})['then'](respondWithFilteredResult(_0x100f6e,_0x32f054))[_0xd469('0x2b')](handleError(_0x100f6e,null));};exports[_0xd469('0x56')]=function(_0x41c691,_0x55c718){var _0x3194be={'raw':!![],'where':{'id':_0x41c691[_0xd469('0x57')]['id']}},_0xd0f4f7={};_0xd0f4f7[_0xd469('0x3f')]=_['keys'](db[_0xd469('0x53')][_0xd469('0x3c')]);_0xd0f4f7[_0xd469('0x41')]=_[_0xd469('0x42')](_0x41c691[_0xd469('0x41')]);_0xd0f4f7[_0xd469('0x43')]=_['intersection'](_0xd0f4f7[_0xd469('0x3f')],_0xd0f4f7[_0xd469('0x41')]);_0x3194be[_0xd469('0x46')]=_[_0xd469('0x44')](_0xd0f4f7[_0xd469('0x3f')],qs[_0xd469('0x45')](_0x41c691[_0xd469('0x41')][_0xd469('0x45')]));_0x3194be[_0xd469('0x46')]=_0x3194be[_0xd469('0x46')][_0xd469('0x47')]?_0x3194be[_0xd469('0x46')]:_0xd0f4f7[_0xd469('0x3f')];if(_0x41c691[_0xd469('0x41')][_0xd469('0x51')]){_0x3194be[_0xd469('0x52')]=[{'all':!![]}];}_0x3194be=_['merge']({},_0x3194be,_0x41c691['options']);return db[_0xd469('0x53')][_0xd469('0x58')](_0x3194be)[_0xd469('0x21')](handleEntityNotFound(_0x55c718,null))[_0xd469('0x21')](respondWithResult(_0x55c718,null))[_0xd469('0x2b')](handleError(_0x55c718,null));};exports[_0xd469('0x59')]=function(_0x24ecf7,_0x1da8ee){return db[_0xd469('0x53')][_0xd469('0x59')](_0x24ecf7[_0xd469('0x5a')],{})[_0xd469('0x21')](respondWithResult(_0x1da8ee,0xc9))[_0xd469('0x2b')](handleError(_0x1da8ee,null));};exports[_0xd469('0x36')]=function(_0x3845d0,_0x2ac6ad){if(_0x3845d0[_0xd469('0x5a')]['id']){delete _0x3845d0['body']['id'];}return db[_0xd469('0x53')][_0xd469('0x58')]({'where':{'id':_0x3845d0[_0xd469('0x57')]['id']}})[_0xd469('0x21')](handleEntityNotFound(_0x2ac6ad,null))[_0xd469('0x21')](saveUpdates(_0x3845d0[_0xd469('0x5a')],null))['then'](respondWithResult(_0x2ac6ad,null))[_0xd469('0x2b')](handleError(_0x2ac6ad,null));};exports['destroy']=function(_0x2969f6,_0x417087){return db['ChatMessage'][_0xd469('0x58')]({'where':{'id':_0x2969f6[_0xd469('0x57')]['id']}})[_0xd469('0x21')](handleEntityNotFound(_0x417087,null))[_0xd469('0x21')](removeEntity(_0x417087,null))['catch'](handleError(_0x417087,null));};exports[_0xd469('0x5b')]=function(_0x32d64e,_0x4ab3d7){return db['ChatMessage'][_0xd469('0x5b')]()[_0xd469('0x21')](respondWithResult(_0x4ab3d7,null))[_0xd469('0x2b')](handleError(_0x4ab3d7,null));};var interaction_log=require(_0xd469('0x10'))('chat-interactions');exports[_0xd469('0x5c')]=function(_0x5c6f4a,_0x5f3405,_0x682258){var _0x114b09={'channel':_0xd469('0x5d')};if(_0x5c6f4a[_0xd469('0x5a')]['id']){delete _0x5c6f4a['body']['id'];}_0x5c6f4a['body']['read']=!![];_0x5c6f4a[_0xd469('0x5a')][_0xd469('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5c6f4a[_0xd469('0x5a')]['UserId']=_0x5c6f4a[_0xd469('0x5a')][_0xd469('0x5f')]||_0x5c6f4a['user']['id'];return db[_0xd469('0x53')][_0xd469('0x58')]({'where':{'id':_0x5c6f4a['params']['id'],'UserId':null},'include':[{'model':db[_0xd469('0x60')],'as':_0xd469('0x61')}]})[_0xd469('0x21')](handleEntityNotFound(_0x5f3405,null))[_0xd469('0x21')](saveUpdates(_0x5c6f4a[_0xd469('0x5a')],null))[_0xd469('0x21')](function(_0x40f609){if(_0x40f609){_0x114b09[_0xd469('0x28')]=_0x40f609[_0xd469('0x62')]({'plain':!![]});return db[_0xd469('0x63')][_0xd469('0x58')]({'where':{'id':_0x40f609[_0xd469('0x64')]}});}return null;})[_0xd469('0x21')](handleEntityNotFound(_0x5f3405,null))[_0xd469('0x21')](function(_0x212ea4){if(_0x212ea4){return _0x212ea4[_0xd469('0x36')]({'UserId':_0x5c6f4a[_0xd469('0x5a')][_0xd469('0x5f')],'read1stAt':_[_0xd469('0x65')](_0x212ea4[_0xd469('0x66')])?moment()[_0xd469('0x67')](_0xd469('0x68')):undefined});}return null;})[_0xd469('0x21')](function(_0xf6bf7d){if(_0xf6bf7d){_0x114b09[_0xd469('0x69')]=_0xf6bf7d[_0xd469('0x62')]({'plain':!![]});interaction_log[_0xd469('0x29')](_0xd469('0x6a'),_0x5c6f4a[_0xd469('0x6b')]['id'],_0x5c6f4a['user'][_0xd469('0x40')],_0x5c6f4a['user'][_0xd469('0x6c')],_0x114b09[_0xd469('0x69')]['id'],_0x5c6f4a[_0xd469('0x5a')]?JSON[_0xd469('0x6d')](_0x5c6f4a[_0xd469('0x5a')]):_0xd469('0x6e'));return respondWithRpcPromise('AcceptMessage',_0xd469('0x6f'),_0x114b09);}return null;})[_0xd469('0x21')](function(_0x3ea7ce){if(_0x3ea7ce){if(_0x5c6f4a[_0xd469('0x5a')][_0xd469('0x70')]){_0x114b09[_0xd469('0x28')][_0xd469('0x71')]=util['format'](_0xd469('0x72'),_0x5c6f4a[_0xd469('0x6b')][_0xd469('0x40')]);_0x114b09[_0xd469('0x28')]['channel']=_0x114b09['channel'];_0x114b09[_0xd469('0x28')][_0xd469('0x73')]=_0xd469('0x5c');return respondWithRpcPromise(_0xd469('0x74'),'EventManager',{'event':'acceptmessage','message':_['merge'](_0x114b09[_0xd469('0x28')],JSON[_0xd469('0x75')](_0x114b09[_0xd469('0x69')][_0xd469('0x76')]))},client9002)['then'](function(){return _0x114b09;});}return _0x114b09;}return null;})[_0xd469('0x21')](respondWithResult(_0x5f3405,null))[_0xd469('0x2b')](handleError(_0x5f3405,null));};var interaction_log=require(_0xd469('0x10'))(_0xd469('0x77'));exports[_0xd469('0x35')]=function(_0x368638,_0x253684,_0x5d48ac){var _0x1f92c6={'agent':{},'channel':_0xd469('0x5d')};if(_0x368638[_0xd469('0x5a')]['id']){delete _0x368638[_0xd469('0x5a')]['id'];}_0x368638[_0xd469('0x5a')][_0xd469('0x5f')]=_0x368638[_0xd469('0x5a')][_0xd469('0x5f')]||_0x368638[_0xd469('0x6b')]['id'];_0x1f92c6['agent']['id']=_0x368638[_0xd469('0x5a')]['UserId'];return db[_0xd469('0x53')][_0xd469('0x58')]({'where':{'id':_0x368638['params']['id'],'UserId':null}})[_0xd469('0x21')](handleEntityNotFound(_0x253684,null))[_0xd469('0x21')](function(_0x9a3356){if(_0x9a3356){_0x1f92c6[_0xd469('0x28')]=_0x9a3356[_0xd469('0x62')]({'plain':!![]});return db[_0xd469('0x63')]['find']({'where':{'id':_0x9a3356[_0xd469('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x253684,null))[_0xd469('0x21')](function(_0x16563c){if(_0x16563c){_0x1f92c6[_0xd469('0x69')]=_0x16563c[_0xd469('0x62')]({'plain':!![]});interaction_log[_0xd469('0x29')](_0xd469('0x78'),_0x368638['user']['id'],_0x368638['user'][_0xd469('0x40')],_0x368638['user'][_0xd469('0x6c')],_0x1f92c6[_0xd469('0x69')]['id'],_0x368638[_0xd469('0x5a')]?JSON[_0xd469('0x6d')](_0x368638[_0xd469('0x5a')]):_0xd469('0x6e'));return respondWithRpcPromise(_0xd469('0x79'),_0xd469('0x7a'),_0x1f92c6);}return null;})[_0xd469('0x21')](function(_0x305bb4){if(_0x305bb4){_0x305bb4[_0xd469('0x28')][_0xd469('0x71')]=util[_0xd469('0x67')](_0xd469('0x72'),_0x368638[_0xd469('0x6b')][_0xd469('0x40')]);_0x305bb4['message'][_0xd469('0x7b')]=_0x1f92c6[_0xd469('0x7b')];_0x305bb4[_0xd469('0x28')][_0xd469('0x73')]=_0xd469('0x35');respondWithRpcPromise('EventManager',_0xd469('0x74'),{'event':_0xd469('0x7c'),'message':_0x305bb4[_0xd469('0x28')]},client9002);return _0x1f92c6;}return null;})['then'](respondWithResult(_0x253684,null))['catch'](handleError(_0x253684,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 925512b..afa1d84 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 _0xe96c=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x5c61ad,_0x4e1d35){var _0x1c5ce6=function(_0x41045e){while(--_0x41045e){_0x5c61ad['push'](_0x5c61ad['shift']());}};_0x1c5ce6(++_0x4e1d35);}(_0xe96c,0x8f));var _0xce96=function(_0x2d10cb,_0x1903a0){_0x2d10cb=_0x2d10cb-0x0;var _0xdd0c7e=_0xe96c[_0x2d10cb];return _0xdd0c7e;};'use strict';var EventEmitter=require(_0xce96('0x0'));var ChatMessage=require(_0xce96('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xce96('0x2')](0x0);var events={'afterCreate':_0xce96('0x3'),'afterUpdate':_0xce96('0x4'),'afterDestroy':_0xce96('0x5')};function emitEvent(_0x46c4fd){return function(_0x2000d7,_0x1de101,_0x40926a){ChatMessageEvents[_0xce96('0x6')](_0x46c4fd+':'+_0x2000d7['id'],_0x2000d7);ChatMessageEvents[_0xce96('0x6')](_0x46c4fd,_0x2000d7);_0x40926a(null);};}for(var e in events){if(events[_0xce96('0x7')](e)){var event=events[e];ChatMessage[_0xce96('0x8')](e,emitEvent(event));}}module[_0xce96('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x8a2b=['update','remove','emit','hook','exports','events','ChatMessage','save'];(function(_0x2a76cd,_0x520a46){var _0x34a70c=function(_0x7ef74b){while(--_0x7ef74b){_0x2a76cd['push'](_0x2a76cd['shift']());}};_0x34a70c(++_0x520a46);}(_0x8a2b,0x65));var _0xb8a2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8a2b[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xb8a2('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xb8a2('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8a2('0x2'),'afterUpdate':_0xb8a2('0x3'),'afterDestroy':_0xb8a2('0x4')};function emitEvent(_0x1ee741){return function(_0x2f5d0a,_0x3f3a46,_0x55e182){ChatMessageEvents['emit'](_0x1ee741+':'+_0x2f5d0a['id'],_0x2f5d0a);ChatMessageEvents[_0xb8a2('0x5')](_0x1ee741,_0x2f5d0a);_0x55e182(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xb8a2('0x6')](e,emitEvent(event));}}module[_0xb8a2('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 4a09cdf..9ff9de1 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 _0x26dd=['secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','direction','out'];(function(_0x3280ee,_0x2d557e){var _0xbce890=function(_0xa24f1d){while(--_0xa24f1d){_0x3280ee['push'](_0x3280ee['shift']());}};_0xbce890(++_0x2d557e);}(_0x26dd,0x97));var _0xd26d=function(_0x56977d,_0xcd09c2){_0x56977d=_0x56977d-0x0;var _0x1eedb9=_0x26dd[_0x56977d];return _0x1eedb9;};'use strict';var _=require(_0xd26d('0x0'));var util=require('util');var logger=require(_0xd26d('0x1'))(_0xd26d('0x2'));var moment=require('moment');var BPromise=require(_0xd26d('0x3'));var rp=require(_0xd26d('0x4'));var fs=require('fs');var path=require(_0xd26d('0x5'));var rimraf=require(_0xd26d('0x6'));var config=require(_0xd26d('0x7'));var attributes=require('./chatMessage.attributes');module[_0xd26d('0x8')]=function(_0x4a4513,_0x9dbee8){return _0x4a4513[_0xd26d('0x9')](_0xd26d('0xa'),attributes,{'tableName':_0xd26d('0xb'),'paranoid':![],'indexes':[{'name':_0xd26d('0xc'),'fields':['body'],'type':_0xd26d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f04e7,_0x16b25a,_0x56d8d9){var _0x3b3634=_0x4a4513[_0xd26d('0xe')];var _0x44733d=_0x3f04e7['get']({'plain':!![]});if(_0x44733d[_0xd26d('0xf')]['toLowerCase']()==='in'||_0x44733d[_0xd26d('0xf')]['toLowerCase']()===_0xd26d('0x10')&&!_0x44733d[_0xd26d('0x11')]&&!_[_0xd26d('0x12')](_0x44733d[_0xd26d('0x13')])){_0x3b3634[_0xd26d('0x14')]['findOne']({'where':{'id':_0x44733d[_0xd26d('0x15')]}})[_0xd26d('0x16')](function(_0x4b3888){if(_0x4b3888){_0x4b3888[_0xd26d('0x17')]({'lastMsgAt':_0x44733d[_0xd26d('0x18')],'lastMsgDirection':_0x44733d[_0xd26d('0xf')]['toLowerCase']()});}})['catch'](function(_0x148e74){console[_0xd26d('0x19')](_0x148e74);});}_0x56d8d9();}},'charset':_0xd26d('0x1a'),'collate':_0xd26d('0x1b')});}; \ No newline at end of file +var _0x939a=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x939a,0x14b));var _0xa939=function(_0x379833,_0x3657b2){_0x379833=_0x379833-0x0;var _0x510c0a=_0x939a[_0x379833];return _0x510c0a;};'use strict';var _=require(_0xa939('0x0'));var util=require(_0xa939('0x1'));var logger=require(_0xa939('0x2'))(_0xa939('0x3'));var moment=require(_0xa939('0x4'));var BPromise=require(_0xa939('0x5'));var rp=require(_0xa939('0x6'));var fs=require('fs');var path=require(_0xa939('0x7'));var rimraf=require(_0xa939('0x8'));var config=require(_0xa939('0x9'));var attributes=require(_0xa939('0xa'));module[_0xa939('0xb')]=function(_0x3bcf9a,_0x4fd8c0){return _0x3bcf9a[_0xa939('0xc')](_0xa939('0xd'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xa939('0xe'),'fields':[_0xa939('0xf')],'type':_0xa939('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4250a5,_0x4c4191,_0x587e11){var _0xd66996=_0x3bcf9a['models'];var _0x1b7321=_0x4250a5[_0xa939('0x11')]({'plain':!![]});if(_0x1b7321['direction'][_0xa939('0x12')]()==='in'||_0x1b7321[_0xa939('0x13')][_0xa939('0x12')]()===_0xa939('0x14')&&!_0x1b7321[_0xa939('0x15')]&&!_[_0xa939('0x16')](_0x1b7321[_0xa939('0x17')])){_0xd66996[_0xa939('0x18')][_0xa939('0x19')]({'where':{'id':_0x1b7321[_0xa939('0x1a')]}})[_0xa939('0x1b')](function(_0x1a3347){if(_0x1a3347){_0x1a3347['update']({'lastMsgAt':_0x1b7321[_0xa939('0x1c')],'lastMsgDirection':_0x1b7321[_0xa939('0x13')][_0xa939('0x12')]()});}})[_0xa939('0x1d')](function(_0x2aa2ec){console[_0xa939('0x1e')](_0x2aa2ec);});}_0x587e11();}},'charset':_0xa939('0x1f'),'collate':_0xa939('0x20')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index fa53fc1..481b6a6 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 _0xb3da=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','ChatMessage','create','body','options','CreateChatMessage','debug','stringify','catch','lodash','util'];(function(_0x25ce89,_0x1bd388){var _0x5e2b75=function(_0x217d17){while(--_0x217d17){_0x25ce89['push'](_0x25ce89['shift']());}};_0x5e2b75(++_0x1bd388);}(_0xb3da,0x1e8));var _0xab3d=function(_0x3223a5,_0x3b5265){_0x3223a5=_0x3223a5-0x0;var _0x5ca7df=_0xb3da[_0x3223a5];return _0x5ca7df;};'use strict';var _=require(_0xab3d('0x0'));var util=require(_0xab3d('0x1'));var moment=require(_0xab3d('0x2'));var BPromise=require(_0xab3d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab3d('0x4'))['db'];var utils=require(_0xab3d('0x5'));var logger=require(_0xab3d('0x6'))(_0xab3d('0x7'));var config=require(_0xab3d('0x8'));var jayson=require(_0xab3d('0x9'));var client=jayson[_0xab3d('0xa')][_0xab3d('0xb')]({'port':0x232a});config[_0xab3d('0xc')]=_[_0xab3d('0xd')](config[_0xab3d('0xc')],{'host':_0xab3d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab3d('0xc')]));require(_0xab3d('0xf'))[_0xab3d('0x10')](socket);function respondWithRpcPromise(_0x3360a3,_0x268e09,_0x18b7a7){return new BPromise(function(_0x4bfd29,_0x2eb2b3){return client[_0xab3d('0x11')](_0x3360a3,_0x18b7a7)[_0xab3d('0x12')](function(_0x1bd0ea){logger[_0xab3d('0x13')](_0xab3d('0x14'),_0x268e09,'request\x20sent');logger['debug'](_0xab3d('0x15'),_0x268e09,_0xab3d('0x16'),JSON['stringify'](_0x1bd0ea));if(_0x1bd0ea['error']){if(_0x1bd0ea[_0xab3d('0x17')][_0xab3d('0x18')]===0x1f4){logger[_0xab3d('0x17')](_0xab3d('0x14'),_0x268e09,_0x1bd0ea[_0xab3d('0x17')][_0xab3d('0x19')]);return _0x2eb2b3(_0x1bd0ea[_0xab3d('0x17')]['message']);}logger[_0xab3d('0x17')](_0xab3d('0x14'),_0x268e09,_0x1bd0ea[_0xab3d('0x17')]['message']);return _0x4bfd29(_0x1bd0ea[_0xab3d('0x17')]['message']);}else{logger[_0xab3d('0x13')]('ChatMessage,\x20%s,\x20%s',_0x268e09,_0xab3d('0x16'));_0x4bfd29(_0x1bd0ea[_0xab3d('0x1a')][_0xab3d('0x19')]);}})['catch'](function(_0x35ef98){logger['error'](_0xab3d('0x14'),_0x268e09,_0x35ef98);_0x2eb2b3(_0x35ef98);});});}exports['CreateChatMessage']=function(_0x414390){var _0x1013e6=this;return new Promise(function(_0x2869fc,_0x533b74){return db[_0xab3d('0x1b')][_0xab3d('0x1c')](_0x414390[_0xab3d('0x1d')],{'raw':_0x414390[_0xab3d('0x1e')]?_0x414390[_0xab3d('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xab3d('0x12')](function(_0xe3a48f){logger[_0xab3d('0x13')](_0xab3d('0x1f'),_0x414390);logger[_0xab3d('0x20')](_0xab3d('0x1f'),_0x414390,JSON[_0xab3d('0x21')](_0xe3a48f));_0x2869fc(_0xe3a48f);})[_0xab3d('0x22')](function(_0x2ba445){logger['error'](_0xab3d('0x1f'),_0x2ba445[_0xab3d('0x19')],_0x414390);_0x533b74(_0x1013e6[_0xab3d('0x17')](0x1f4,_0x2ba445['message']));});});}; \ No newline at end of file +var _0xa6f0=['error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x42f553,_0x4c1b76){var _0xaaa04c=function(_0x57b420){while(--_0x57b420){_0x42f553['push'](_0x42f553['shift']());}};_0xaaa04c(++_0x4c1b76);}(_0xa6f0,0x8f));var _0x0a6f=function(_0x3fde7a,_0x1a3b17){_0x3fde7a=_0x3fde7a-0x0;var _0x2e45c8=_0xa6f0[_0x3fde7a];return _0x2e45c8;};'use strict';var _=require(_0x0a6f('0x0'));var util=require('util');var moment=require(_0x0a6f('0x1'));var BPromise=require(_0x0a6f('0x2'));var rs=require(_0x0a6f('0x3'));var fs=require('fs');var Redis=require(_0x0a6f('0x4'));var db=require(_0x0a6f('0x5'))['db'];var utils=require(_0x0a6f('0x6'));var logger=require('../../config/logger')(_0x0a6f('0x7'));var config=require(_0x0a6f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a6f('0x9')]['http']({'port':0x232a});config[_0x0a6f('0xa')]=_[_0x0a6f('0xb')](config[_0x0a6f('0xa')],{'host':_0x0a6f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a6f('0xd'))['register'](socket);function respondWithRpcPromise(_0x4dcc2e,_0x57c4d8,_0x4a2d15){return new BPromise(function(_0x1af65a,_0x26332c){return client[_0x0a6f('0xe')](_0x4dcc2e,_0x4a2d15)[_0x0a6f('0xf')](function(_0x1ec34e){logger[_0x0a6f('0x10')](_0x0a6f('0x11'),_0x57c4d8,'request\x20sent');logger[_0x0a6f('0x12')](_0x0a6f('0x13'),_0x57c4d8,_0x0a6f('0x14'),JSON[_0x0a6f('0x15')](_0x1ec34e));if(_0x1ec34e['error']){if(_0x1ec34e[_0x0a6f('0x16')][_0x0a6f('0x17')]===0x1f4){logger['error'](_0x0a6f('0x11'),_0x57c4d8,_0x1ec34e[_0x0a6f('0x16')][_0x0a6f('0x18')]);return _0x26332c(_0x1ec34e[_0x0a6f('0x16')][_0x0a6f('0x18')]);}logger[_0x0a6f('0x16')](_0x0a6f('0x11'),_0x57c4d8,_0x1ec34e[_0x0a6f('0x16')]['message']);return _0x1af65a(_0x1ec34e['error'][_0x0a6f('0x18')]);}else{logger[_0x0a6f('0x10')](_0x0a6f('0x11'),_0x57c4d8,_0x0a6f('0x14'));_0x1af65a(_0x1ec34e[_0x0a6f('0x19')][_0x0a6f('0x18')]);}})[_0x0a6f('0x1a')](function(_0x310674){logger['error'](_0x0a6f('0x11'),_0x57c4d8,_0x310674);_0x26332c(_0x310674);});});}exports[_0x0a6f('0x1b')]=function(_0x19c526){var _0x81977d=this;return new Promise(function(_0x24e10b,_0x33643a){return db[_0x0a6f('0x1c')][_0x0a6f('0x1d')](_0x19c526[_0x0a6f('0x1e')],{'raw':_0x19c526[_0x0a6f('0x1f')]?_0x19c526['options'][_0x0a6f('0x20')]===undefined?!![]:![]:!![]})[_0x0a6f('0xf')](function(_0x4317c3){logger[_0x0a6f('0x10')](_0x0a6f('0x1b'),_0x19c526);logger[_0x0a6f('0x12')]('CreateChatMessage',_0x19c526,JSON[_0x0a6f('0x15')](_0x4317c3));_0x24e10b(_0x4317c3);})[_0x0a6f('0x1a')](function(_0x5ef277){logger[_0x0a6f('0x16')]('CreateChatMessage',_0x5ef277[_0x0a6f('0x18')],_0x19c526);_0x33643a(_0x81977d[_0x0a6f('0x16')](0x1f4,_0x5ef277[_0x0a6f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 0724245..7a2e1c4 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 _0xb016=['register','./chatMessage.events','save','emit'];(function(_0x4baac8,_0x5f1dc7){var _0x56ebc5=function(_0x23d717){while(--_0x23d717){_0x4baac8['push'](_0x4baac8['shift']());}};_0x56ebc5(++_0x5f1dc7);}(_0xb016,0x159));var _0x6b01=function(_0xd00a2f,_0x679db9){_0xd00a2f=_0xd00a2f-0x0;var _0x42c7ac=_0xb016[_0xd00a2f];return _0x42c7ac;};'use strict';var ChatMessageEvents=require(_0x6b01('0x0'));var events=[_0x6b01('0x1'),'remove','update'];function createListener(_0xf74fa1,_0x531b6a){return function(_0x160a7d){_0x531b6a[_0x6b01('0x2')](_0xf74fa1,_0x160a7d);};}function removeListener(_0x161b59,_0x3b9de1){return function(){ChatMessageEvents['removeListener'](_0x161b59,_0x3b9de1);};}exports[_0x6b01('0x3')]=function(_0x65407a){for(var _0x192b2d=0x0,_0x5759a1=events['length'];_0x192b2d<_0x5759a1;_0x192b2d++){var _0x374aab=events[_0x192b2d];var _0x39f9fa=createListener('chatMessage:'+_0x374aab,_0x65407a);ChatMessageEvents['on'](_0x374aab,_0x39f9fa);}}; \ No newline at end of file +var _0xd117=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x3bb79a,_0x4cde65){var _0xa2a47f=function(_0x3e1372){while(--_0x3e1372){_0x3bb79a['push'](_0x3bb79a['shift']());}};_0xa2a47f(++_0x4cde65);}(_0xd117,0x182));var _0x7d11=function(_0x59b48b,_0x584733){_0x59b48b=_0x59b48b-0x0;var _0x4c3f79=_0xd117[_0x59b48b];return _0x4c3f79;};'use strict';var ChatMessageEvents=require(_0x7d11('0x0'));var events=[_0x7d11('0x1'),_0x7d11('0x2'),_0x7d11('0x3')];function createListener(_0x454387,_0x26e0f0){return function(_0x306ae4){_0x26e0f0[_0x7d11('0x4')](_0x454387,_0x306ae4);};}function removeListener(_0x3c07be,_0x31fcb0){return function(){ChatMessageEvents[_0x7d11('0x5')](_0x3c07be,_0x31fcb0);};}exports[_0x7d11('0x6')]=function(_0x27d7e8){for(var _0x40c3c4=0x0,_0x345602=events[_0x7d11('0x7')];_0x40c3c4<_0x345602;_0x40c3c4++){var _0x47b5e6=events[_0x40c3c4];var _0x3803b5=createListener(_0x7d11('0x8')+_0x47b5e6,_0x27d7e8);ChatMessageEvents['on'](_0x47b5e6,_0x3803b5);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 66d4b27..2c3398d 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 _0x8a6e=['/describe','describe','get','/:id','show','tracked','chat','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8a6e,0x1d0));var _0xe8a6=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x8a6e[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0xe8a6('0x0'));var util=require(_0xe8a6('0x1'));var path=require(_0xe8a6('0x2'));var timeout=require(_0xe8a6('0x3'));var express=require(_0xe8a6('0x4'));var router=express[_0xe8a6('0x5')]();var auth=require(_0xe8a6('0x6'));var interaction=require(_0xe8a6('0x7'));var config=require('../../config/environment');var controller=require(_0xe8a6('0x8'));router['get']('/',auth[_0xe8a6('0x9')](),controller[_0xe8a6('0xa')]);router['get'](_0xe8a6('0xb'),auth[_0xe8a6('0x9')](),controller[_0xe8a6('0xc')]);router[_0xe8a6('0xd')](_0xe8a6('0xe'),auth['isAuthenticated'](),controller[_0xe8a6('0xf')]);router['post']('/',auth[_0xe8a6('0x9')](),interaction[_0xe8a6('0x10')](_0xe8a6('0x11'),'chatmessage:create'),controller['create']);router[_0xe8a6('0x12')](_0xe8a6('0xe'),controller['update']);router[_0xe8a6('0x12')](_0xe8a6('0x13'),auth[_0xe8a6('0x9')](),controller[_0xe8a6('0x14')]);router[_0xe8a6('0x12')](_0xe8a6('0x15'),auth[_0xe8a6('0x9')](),controller[_0xe8a6('0x16')]);router[_0xe8a6('0x17')](_0xe8a6('0xe'),auth[_0xe8a6('0x9')](),controller['destroy']);module[_0xe8a6('0x18')]=router; \ No newline at end of file +var _0x7827=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util'];(function(_0x405657,_0x5d2317){var _0x5e3e84=function(_0x55d8f2){while(--_0x55d8f2){_0x405657['push'](_0x405657['shift']());}};_0x5e3e84(++_0x5d2317);}(_0x7827,0x164));var _0x7782=function(_0x3cfc01,_0x4ea6b9){_0x3cfc01=_0x3cfc01-0x0;var _0x52d02c=_0x7827[_0x3cfc01];return _0x52d02c;};'use strict';var multer=require('multer');var util=require(_0x7782('0x0'));var path=require(_0x7782('0x1'));var timeout=require(_0x7782('0x2'));var express=require(_0x7782('0x3'));var router=express['Router']();var auth=require(_0x7782('0x4'));var interaction=require(_0x7782('0x5'));var config=require(_0x7782('0x6'));var controller=require(_0x7782('0x7'));router[_0x7782('0x8')]('/',auth[_0x7782('0x9')](),controller[_0x7782('0xa')]);router['get'](_0x7782('0xb'),auth[_0x7782('0x9')](),controller[_0x7782('0xc')]);router[_0x7782('0x8')](_0x7782('0xd'),auth['isAuthenticated'](),controller[_0x7782('0xe')]);router[_0x7782('0xf')]('/',auth['isAuthenticated'](),interaction['tracked']('chat','chatmessage:create'),controller[_0x7782('0x10')]);router[_0x7782('0x11')](_0x7782('0xd'),controller['update']);router[_0x7782('0x11')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x7782('0x11')]('/:id/reject',auth[_0x7782('0x9')](),controller['reject']);router[_0x7782('0x12')](_0x7782('0xd'),auth['isAuthenticated'](),controller[_0x7782('0x13')]);module[_0x7782('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 9ce7ecd..53d39a0 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 _0x2dff=['medium','sequelize','TEXT'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x2dff,0x17e));var _0xf2df=function(_0x19463c,_0x6b8360){_0x19463c=_0x19463c-0x0;var _0x1ac9ca=_0x2dff[_0x19463c];return _0x1ac9ca;};'use strict';var Sequelize=require(_0xf2df('0x0'));module['exports']={'body':{'type':Sequelize[_0xf2df('0x1')](_0xf2df('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x00cf=['sequelize','TEXT'];(function(_0x5cb927,_0x592a0e){var _0x48d021=function(_0x580a86){while(--_0x580a86){_0x5cb927['push'](_0x5cb927['shift']());}};_0x48d021(++_0x592a0e);}(_0x00cf,0xb8));var _0xf00c=function(_0x21d968,_0x41ef29){_0x21d968=_0x21d968-0x0;var _0x345794=_0x00cf[_0x21d968];return _0x345794;};'use strict';var Sequelize=require(_0xf00c('0x0'));module['exports']={'body':{'type':Sequelize[_0xf00c('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 147a0fd..601254b 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 _0xf047=['offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ChatOfflineMessage','rawAttributes','type','key','query','keys','filters','attributes','model','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','intersection','length','find','create','body','catch','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x290874,_0x4e45fa){var _0x5f25e2=function(_0x4ec23b){while(--_0x4ec23b){_0x290874['push'](_0x290874['shift']());}};_0x5f25e2(++_0x4e45fa);}(_0xf047,0xbc));var _0x7f04=function(_0x55aa15,_0x203620){_0x55aa15=_0x55aa15-0x0;var _0x3d7314=_0xf047[_0x55aa15];return _0x3d7314;};'use strict';var pdf=require(_0x7f04('0x0'));var emlformat=require(_0x7f04('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7f04('0x2'));var jsonpatch=require(_0x7f04('0x3'));var rp=require(_0x7f04('0x4'));var moment=require('moment');var BPromise=require(_0x7f04('0x5'));var Mustache=require(_0x7f04('0x6'));var util=require('util');var path=require(_0x7f04('0x7'));var sox=require('sox');var csv=require(_0x7f04('0x8'));var ejs=require(_0x7f04('0x9'));var fs=require('fs');var _=require(_0x7f04('0xa'));var squel=require(_0x7f04('0xb'));var crypto=require(_0x7f04('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7f04('0xd'));var Redis=require(_0x7f04('0xe'));var authService=require(_0x7f04('0xf'));var qs=require(_0x7f04('0x10'));var as=require(_0x7f04('0x11'));var hardwareService=require(_0x7f04('0x12'));var logger=require(_0x7f04('0x13'))('api');var utils=require(_0x7f04('0x14'));var config=require(_0x7f04('0x15'));var db=require(_0x7f04('0x16'))['db'];function respondWithStatusCode(_0x579054,_0x335b1a){_0x335b1a=_0x335b1a||0xcc;return function(_0x549abe){if(_0x549abe){return _0x579054[_0x7f04('0x17')](_0x335b1a);}return _0x579054[_0x7f04('0x18')](_0x335b1a)[_0x7f04('0x19')]();};}function respondWithResult(_0x124e6f,_0x38259c){_0x38259c=_0x38259c||0xc8;return function(_0x3d7a2b){if(_0x3d7a2b){return _0x124e6f[_0x7f04('0x18')](_0x38259c)[_0x7f04('0x1a')](_0x3d7a2b);}};}function respondWithFilteredResult(_0x18b8d2,_0x206422){return function(_0x8fc5bd){if(_0x8fc5bd){var _0x111110=_0x8fc5bd[_0x7f04('0x1b')],_0x178f89=_0x206422[_0x7f04('0x1c')],_0x21f6f4=_0x206422[_0x7f04('0x1c')]+_0x206422[_0x7f04('0x1d')],_0x213947;if(_0x21f6f4>=_0x111110){_0x21f6f4=_0x111110;_0x213947=0xc8;}else{_0x213947=0xce;}_0x18b8d2[_0x7f04('0x18')](_0x213947);return _0x18b8d2['set'](_0x7f04('0x1e'),_0x178f89+'-'+_0x21f6f4+'/'+_0x111110)[_0x7f04('0x1a')](_0x8fc5bd);}return null;};}function patchUpdates(_0xe5938f){return function(_0x339e9e){try{jsonpatch[_0x7f04('0x1f')](_0x339e9e,_0xe5938f,!![]);}catch(_0x3e9f95){return BPromise[_0x7f04('0x20')](_0x3e9f95);}return _0x339e9e[_0x7f04('0x21')]();};}function saveUpdates(_0x210f71,_0x133cdd){return function(_0x5e89b2){if(_0x5e89b2){return _0x5e89b2[_0x7f04('0x22')](_0x210f71)[_0x7f04('0x23')](function(_0xb8149c){return _0xb8149c;});}return null;};}function removeEntity(_0x3b9504,_0x56a15d){return function(_0x3cefa5){if(_0x3cefa5){return _0x3cefa5[_0x7f04('0x24')]()['then'](function(){_0x3b9504[_0x7f04('0x18')](0xcc)[_0x7f04('0x19')]();});}};}function handleEntityNotFound(_0x15b2e1,_0x52cdda){return function(_0x49d873){if(!_0x49d873){_0x15b2e1['sendStatus'](0x194);}return _0x49d873;};}function handleError(_0x279856,_0x5254a5){_0x5254a5=_0x5254a5||0x1f4;return function(_0x55fd1c){logger[_0x7f04('0x25')](_0x55fd1c[_0x7f04('0x26')]);if(_0x55fd1c[_0x7f04('0x27')]){delete _0x55fd1c[_0x7f04('0x27')];}_0x279856[_0x7f04('0x18')](_0x5254a5)['send'](_0x55fd1c);};}exports['index']=function(_0x4bea53,_0x53a9a4){var _0x3b55f3={},_0x1f29f9={},_0x527ecd={'count':0x0,'rows':[]};var _0x3326a1=_[_0x7f04('0x28')](db[_0x7f04('0x29')][_0x7f04('0x2a')],function(_0x238f33){return{'name':_0x238f33['fieldName'],'type':_0x238f33[_0x7f04('0x2b')][_0x7f04('0x2c')]};});_0x1f29f9['model']=_[_0x7f04('0x28')](_0x3326a1,_0x7f04('0x27'));_0x1f29f9[_0x7f04('0x2d')]=_[_0x7f04('0x2e')](_0x4bea53['query']);_0x1f29f9[_0x7f04('0x2f')]=_['intersection'](_0x1f29f9['model'],_0x1f29f9['query']);_0x3b55f3[_0x7f04('0x30')]=_['intersection'](_0x1f29f9[_0x7f04('0x31')],qs[_0x7f04('0x32')](_0x4bea53['query'][_0x7f04('0x32')]));_0x3b55f3[_0x7f04('0x30')]=_0x3b55f3['attributes']['length']?_0x3b55f3[_0x7f04('0x30')]:_0x1f29f9['model'];if(!_0x4bea53[_0x7f04('0x2d')][_0x7f04('0x33')](_0x7f04('0x34'))){_0x3b55f3['limit']=qs[_0x7f04('0x1d')](_0x4bea53[_0x7f04('0x2d')][_0x7f04('0x1d')]);_0x3b55f3[_0x7f04('0x1c')]=qs[_0x7f04('0x1c')](_0x4bea53[_0x7f04('0x2d')][_0x7f04('0x1c')]);}_0x3b55f3['order']=qs[_0x7f04('0x35')](_0x4bea53['query']['sort']);_0x3b55f3['where']=qs[_0x7f04('0x2f')](_[_0x7f04('0x36')](_0x4bea53['query'],_0x1f29f9[_0x7f04('0x2f')]));if(_0x4bea53[_0x7f04('0x2d')][_0x7f04('0x37')]){_0x3b55f3[_0x7f04('0x38')]=_[_0x7f04('0x39')](_0x3b55f3[_0x7f04('0x38')],{'$or':_[_0x7f04('0x28')](_0x3326a1,function(_0x4592f5){if(_0x4592f5[_0x7f04('0x2b')]!==_0x7f04('0x3a')){var _0x55c823={};_0x55c823[_0x4592f5['name']]={'$like':'%'+_0x4bea53[_0x7f04('0x2d')][_0x7f04('0x37')]+'%'};return _0x55c823;}})});}_0x3b55f3=_[_0x7f04('0x39')]({},_0x3b55f3,_0x4bea53[_0x7f04('0x3b')]);var _0x26e323={'where':_0x3b55f3[_0x7f04('0x38')]};return db[_0x7f04('0x29')][_0x7f04('0x1b')](_0x26e323)[_0x7f04('0x23')](function(_0x5c3583){_0x527ecd[_0x7f04('0x1b')]=_0x5c3583;if(_0x4bea53[_0x7f04('0x2d')][_0x7f04('0x3c')]){_0x3b55f3[_0x7f04('0x3d')]=[{'all':!![]}];}return db[_0x7f04('0x29')][_0x7f04('0x3e')](_0x3b55f3);})['then'](function(_0x53359e){_0x527ecd[_0x7f04('0x3f')]=_0x53359e;return _0x527ecd;})[_0x7f04('0x23')](respondWithFilteredResult(_0x53a9a4,_0x3b55f3))['catch'](handleError(_0x53a9a4,null));};exports['show']=function(_0x12dc7c,_0x50bdcc){var _0x187c22={'raw':!![],'where':{'id':_0x12dc7c['params']['id']}},_0x524251={};_0x524251[_0x7f04('0x31')]=_[_0x7f04('0x2e')](db['ChatOfflineMessage'][_0x7f04('0x2a')]);_0x524251[_0x7f04('0x2d')]=_[_0x7f04('0x2e')](_0x12dc7c['query']);_0x524251['filters']=_[_0x7f04('0x40')](_0x524251[_0x7f04('0x31')],_0x524251['query']);_0x187c22['attributes']=_[_0x7f04('0x40')](_0x524251[_0x7f04('0x31')],qs[_0x7f04('0x32')](_0x12dc7c['query']['fields']));_0x187c22[_0x7f04('0x30')]=_0x187c22[_0x7f04('0x30')][_0x7f04('0x41')]?_0x187c22['attributes']:_0x524251[_0x7f04('0x31')];if(_0x12dc7c[_0x7f04('0x2d')][_0x7f04('0x3c')]){_0x187c22[_0x7f04('0x3d')]=[{'all':!![]}];}_0x187c22=_[_0x7f04('0x39')]({},_0x187c22,_0x12dc7c[_0x7f04('0x3b')]);return db[_0x7f04('0x29')][_0x7f04('0x42')](_0x187c22)['then'](handleEntityNotFound(_0x50bdcc,null))['then'](respondWithResult(_0x50bdcc,null))['catch'](handleError(_0x50bdcc,null));};exports[_0x7f04('0x43')]=function(_0x2aee16,_0x325da9){return db[_0x7f04('0x29')][_0x7f04('0x43')](_0x2aee16[_0x7f04('0x44')],{})[_0x7f04('0x23')](respondWithResult(_0x325da9,0xc9))[_0x7f04('0x45')](handleError(_0x325da9,null));};exports[_0x7f04('0x22')]=function(_0x34a7bc,_0x4718ea){if(_0x34a7bc[_0x7f04('0x44')]['id']){delete _0x34a7bc['body']['id'];}return db[_0x7f04('0x29')]['find']({'where':{'id':_0x34a7bc[_0x7f04('0x46')]['id']}})['then'](handleEntityNotFound(_0x4718ea,null))[_0x7f04('0x23')](saveUpdates(_0x34a7bc['body'],null))[_0x7f04('0x23')](respondWithResult(_0x4718ea,null))[_0x7f04('0x45')](handleError(_0x4718ea,null));};exports[_0x7f04('0x24')]=function(_0x196a87,_0x333cfb){return db[_0x7f04('0x29')]['find']({'where':{'id':_0x196a87[_0x7f04('0x46')]['id']}})[_0x7f04('0x23')](handleEntityNotFound(_0x333cfb,null))[_0x7f04('0x23')](removeEntity(_0x333cfb,null))[_0x7f04('0x45')](handleError(_0x333cfb,null));};exports[_0x7f04('0x47')]=function(_0x30fec3,_0x22ac2f){return db['ChatOfflineMessage'][_0x7f04('0x47')]()['then'](respondWithResult(_0x22ac2f,null))[_0x7f04('0x45')](handleError(_0x22ac2f,null));}; \ No newline at end of file +var _0x128c=['update','then','destroy','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','ChatOfflineMessage','find','catch','create','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','limit','set','Content-Range','json','apply','reject','save'];(function(_0x3d1602,_0x976856){var _0x43ba47=function(_0x9d4970){while(--_0x9d4970){_0x3d1602['push'](_0x3d1602['shift']());}};_0x43ba47(++_0x976856);}(_0x128c,0x6e));var _0xc128=function(_0x23f8a3,_0x20b18d){_0x23f8a3=_0x23f8a3-0x0;var _0x22433d=_0x128c[_0x23f8a3];return _0x22433d;};'use strict';var pdf=require(_0xc128('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc128('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc128('0x2'));var rp=require(_0xc128('0x3'));var moment=require(_0xc128('0x4'));var BPromise=require(_0xc128('0x5'));var Mustache=require('mustache');var util=require(_0xc128('0x6'));var path=require(_0xc128('0x7'));var sox=require(_0xc128('0x8'));var csv=require(_0xc128('0x9'));var ejs=require(_0xc128('0xa'));var fs=require('fs');var _=require(_0xc128('0xb'));var squel=require(_0xc128('0xc'));var crypto=require(_0xc128('0xd'));var jsforce=require(_0xc128('0xe'));var deskjs=require(_0xc128('0xf'));var toCsv=require(_0xc128('0x9'));var querystring=require(_0xc128('0x10'));var Papa=require(_0xc128('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc128('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc128('0x13'));var logger=require(_0xc128('0x14'))(_0xc128('0x15'));var utils=require(_0xc128('0x16'));var config=require(_0xc128('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f6486,_0x386dac){_0x386dac=_0x386dac||0xcc;return function(_0x88a784){if(_0x88a784){return _0x3f6486['sendStatus'](_0x386dac);}return _0x3f6486[_0xc128('0x18')](_0x386dac)[_0xc128('0x19')]();};}function respondWithResult(_0x50871e,_0x187247){_0x187247=_0x187247||0xc8;return function(_0x2b7085){if(_0x2b7085){return _0x50871e[_0xc128('0x18')](_0x187247)['json'](_0x2b7085);}};}function respondWithFilteredResult(_0x2fd5ed,_0x191867){return function(_0xae98e){if(_0xae98e){var _0x4817a1=_0xae98e['count'],_0x17d895=_0x191867[_0xc128('0x1a')],_0x11d6af=_0x191867['offset']+_0x191867[_0xc128('0x1b')],_0x5f0fac;if(_0x11d6af>=_0x4817a1){_0x11d6af=_0x4817a1;_0x5f0fac=0xc8;}else{_0x5f0fac=0xce;}_0x2fd5ed[_0xc128('0x18')](_0x5f0fac);return _0x2fd5ed[_0xc128('0x1c')](_0xc128('0x1d'),_0x17d895+'-'+_0x11d6af+'/'+_0x4817a1)[_0xc128('0x1e')](_0xae98e);}return null;};}function patchUpdates(_0x362bab){return function(_0x303919){try{jsonpatch[_0xc128('0x1f')](_0x303919,_0x362bab,!![]);}catch(_0x3870c7){return BPromise[_0xc128('0x20')](_0x3870c7);}return _0x303919[_0xc128('0x21')]();};}function saveUpdates(_0x129e34,_0x5578b4){return function(_0x74e300){if(_0x74e300){return _0x74e300[_0xc128('0x22')](_0x129e34)[_0xc128('0x23')](function(_0x72fa0e){return _0x72fa0e;});}return null;};}function removeEntity(_0x1c8ed3,_0x56efcb){return function(_0x11a4a0){if(_0x11a4a0){return _0x11a4a0[_0xc128('0x24')]()[_0xc128('0x23')](function(){_0x1c8ed3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51266b,_0x9ee45d){return function(_0x2d5a05){if(!_0x2d5a05){_0x51266b['sendStatus'](0x194);}return _0x2d5a05;};}function handleError(_0x13596d,_0x104a7b){_0x104a7b=_0x104a7b||0x1f4;return function(_0x3d9cf7){logger[_0xc128('0x25')](_0x3d9cf7['stack']);if(_0x3d9cf7[_0xc128('0x26')]){delete _0x3d9cf7['name'];}_0x13596d[_0xc128('0x18')](_0x104a7b)['send'](_0x3d9cf7);};}exports[_0xc128('0x27')]=function(_0x1fa0ad,_0x5c011a){var _0x1d808e={},_0x4a0b69={},_0x22ebef={'count':0x0,'rows':[]};var _0x37ef4a=_[_0xc128('0x28')](db['ChatOfflineMessage'][_0xc128('0x29')],function(_0x26c981){return{'name':_0x26c981[_0xc128('0x2a')],'type':_0x26c981['type'][_0xc128('0x2b')]};});_0x4a0b69[_0xc128('0x2c')]=_[_0xc128('0x28')](_0x37ef4a,_0xc128('0x26'));_0x4a0b69[_0xc128('0x2d')]=_[_0xc128('0x2e')](_0x1fa0ad[_0xc128('0x2d')]);_0x4a0b69['filters']=_[_0xc128('0x2f')](_0x4a0b69[_0xc128('0x2c')],_0x4a0b69[_0xc128('0x2d')]);_0x1d808e[_0xc128('0x30')]=_['intersection'](_0x4a0b69['model'],qs[_0xc128('0x31')](_0x1fa0ad[_0xc128('0x2d')][_0xc128('0x31')]));_0x1d808e[_0xc128('0x30')]=_0x1d808e[_0xc128('0x30')][_0xc128('0x32')]?_0x1d808e['attributes']:_0x4a0b69['model'];if(!_0x1fa0ad['query'][_0xc128('0x33')](_0xc128('0x34'))){_0x1d808e['limit']=qs[_0xc128('0x1b')](_0x1fa0ad['query']['limit']);_0x1d808e[_0xc128('0x1a')]=qs['offset'](_0x1fa0ad['query'][_0xc128('0x1a')]);}_0x1d808e['order']=qs[_0xc128('0x35')](_0x1fa0ad[_0xc128('0x2d')][_0xc128('0x35')]);_0x1d808e[_0xc128('0x36')]=qs['filters'](_[_0xc128('0x37')](_0x1fa0ad['query'],_0x4a0b69['filters']));if(_0x1fa0ad[_0xc128('0x2d')][_0xc128('0x38')]){_0x1d808e[_0xc128('0x36')]=_[_0xc128('0x39')](_0x1d808e['where'],{'$or':_[_0xc128('0x28')](_0x37ef4a,function(_0x413460){if(_0x413460['type']!==_0xc128('0x3a')){var _0xa3dc57={};_0xa3dc57[_0x413460[_0xc128('0x26')]]={'$like':'%'+_0x1fa0ad[_0xc128('0x2d')][_0xc128('0x38')]+'%'};return _0xa3dc57;}})});}_0x1d808e=_[_0xc128('0x39')]({},_0x1d808e,_0x1fa0ad[_0xc128('0x3b')]);var _0x50b10e={'where':_0x1d808e['where']};return db['ChatOfflineMessage'][_0xc128('0x3c')](_0x50b10e)[_0xc128('0x23')](function(_0x11255c){_0x22ebef['count']=_0x11255c;if(_0x1fa0ad[_0xc128('0x2d')][_0xc128('0x3d')]){_0x1d808e[_0xc128('0x3e')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xc128('0x3f')](_0x1d808e);})[_0xc128('0x23')](function(_0x1d360d){_0x22ebef['rows']=_0x1d360d;return _0x22ebef;})[_0xc128('0x23')](respondWithFilteredResult(_0x5c011a,_0x1d808e))['catch'](handleError(_0x5c011a,null));};exports[_0xc128('0x40')]=function(_0x245cc1,_0x5e817b){var _0x2b7572={'raw':!![],'where':{'id':_0x245cc1[_0xc128('0x41')]['id']}},_0x366c2a={};_0x366c2a[_0xc128('0x2c')]=_[_0xc128('0x2e')](db[_0xc128('0x42')][_0xc128('0x29')]);_0x366c2a[_0xc128('0x2d')]=_['keys'](_0x245cc1[_0xc128('0x2d')]);_0x366c2a['filters']=_[_0xc128('0x2f')](_0x366c2a[_0xc128('0x2c')],_0x366c2a[_0xc128('0x2d')]);_0x2b7572[_0xc128('0x30')]=_[_0xc128('0x2f')](_0x366c2a['model'],qs[_0xc128('0x31')](_0x245cc1[_0xc128('0x2d')][_0xc128('0x31')]));_0x2b7572['attributes']=_0x2b7572[_0xc128('0x30')][_0xc128('0x32')]?_0x2b7572[_0xc128('0x30')]:_0x366c2a['model'];if(_0x245cc1['query'][_0xc128('0x3d')]){_0x2b7572[_0xc128('0x3e')]=[{'all':!![]}];}_0x2b7572=_[_0xc128('0x39')]({},_0x2b7572,_0x245cc1[_0xc128('0x3b')]);return db['ChatOfflineMessage'][_0xc128('0x43')](_0x2b7572)['then'](handleEntityNotFound(_0x5e817b,null))['then'](respondWithResult(_0x5e817b,null))[_0xc128('0x44')](handleError(_0x5e817b,null));};exports[_0xc128('0x45')]=function(_0x23510a,_0x391f5b){return db[_0xc128('0x42')][_0xc128('0x45')](_0x23510a['body'],{})['then'](respondWithResult(_0x391f5b,0xc9))['catch'](handleError(_0x391f5b,null));};exports[_0xc128('0x22')]=function(_0x3d142f,_0x186157){if(_0x3d142f[_0xc128('0x46')]['id']){delete _0x3d142f[_0xc128('0x46')]['id'];}return db['ChatOfflineMessage'][_0xc128('0x43')]({'where':{'id':_0x3d142f[_0xc128('0x41')]['id']}})['then'](handleEntityNotFound(_0x186157,null))['then'](saveUpdates(_0x3d142f[_0xc128('0x46')],null))[_0xc128('0x23')](respondWithResult(_0x186157,null))[_0xc128('0x44')](handleError(_0x186157,null));};exports['destroy']=function(_0x44d80b,_0x4df838){return db[_0xc128('0x42')][_0xc128('0x43')]({'where':{'id':_0x44d80b[_0xc128('0x41')]['id']}})[_0xc128('0x23')](handleEntityNotFound(_0x4df838,null))[_0xc128('0x23')](removeEntity(_0x4df838,null))[_0xc128('0x44')](handleError(_0x4df838,null));};exports[_0xc128('0x47')]=function(_0x56d08d,_0x86e185){return db[_0xc128('0x42')][_0xc128('0x47')]()['then'](respondWithResult(_0x86e185,null))[_0xc128('0x44')](handleError(_0x86e185,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index ac76ccb..707472a 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 _0xb7c8=['bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x2f0b9a,_0x23219a){var _0x28986c=function(_0x5d95c4){while(--_0x5d95c4){_0x2f0b9a['push'](_0x2f0b9a['shift']());}};_0x28986c(++_0x23219a);}(_0xb7c8,0x119));var _0x8b7c=function(_0x5a34be,_0x10400c){_0x5a34be=_0x5a34be-0x0;var _0x4f326e=_0xb7c8[_0x5a34be];return _0x4f326e;};'use strict';var _=require('lodash');var util=require(_0x8b7c('0x0'));var logger=require(_0x8b7c('0x1'))(_0x8b7c('0x2'));var moment=require(_0x8b7c('0x3'));var BPromise=require(_0x8b7c('0x4'));var rp=require(_0x8b7c('0x5'));var fs=require('fs');var path=require(_0x8b7c('0x6'));var rimraf=require('rimraf');var config=require(_0x8b7c('0x7'));var attributes=require(_0x8b7c('0x8'));module[_0x8b7c('0x9')]=function(_0x440900,_0x107428){return _0x440900[_0x8b7c('0xa')](_0x8b7c('0xb'),attributes,{'tableName':_0x8b7c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b7c('0xd'),'collate':_0x8b7c('0xe')});}; \ No newline at end of file +var _0x50a6=['util','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0x50a6,0xa4));var _0x650a=function(_0x2ce08c,_0x58ce90){_0x2ce08c=_0x2ce08c-0x0;var _0x3db6bd=_0x50a6[_0x2ce08c];return _0x3db6bd;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x650a('0x2'));var BPromise=require('bluebird');var rp=require(_0x650a('0x3'));var fs=require('fs');var path=require(_0x650a('0x4'));var rimraf=require(_0x650a('0x5'));var config=require('../../config/environment');var attributes=require(_0x650a('0x6'));module['exports']=function(_0x4eabde,_0x2d486d){return _0x4eabde[_0x650a('0x7')](_0x650a('0x8'),attributes,{'tableName':_0x650a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x650a('0xa')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 95c439f..79135d9 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 _0x560b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch'];(function(_0x372522,_0x4f4cd0){var _0x40bac9=function(_0x329ab5){while(--_0x329ab5){_0x372522['push'](_0x372522['shift']());}};_0x40bac9(++_0x4f4cd0);}(_0x560b,0x1b8));var _0xb560=function(_0x40ffed,_0x7c6b1){_0x40ffed=_0x40ffed-0x0;var _0x5119f8=_0x560b[_0x40ffed];return _0x5119f8;};'use strict';var _=require(_0xb560('0x0'));var util=require(_0xb560('0x1'));var moment=require(_0xb560('0x2'));var BPromise=require(_0xb560('0x3'));var rs=require(_0xb560('0x4'));var fs=require('fs');var Redis=require(_0xb560('0x5'));var db=require(_0xb560('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb560('0x7'))('rpc');var config=require(_0xb560('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb560('0x9')][_0xb560('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f0fcd,_0x5134e5,_0x32cd95){return new BPromise(function(_0x30bbfe,_0x20508f){return client[_0xb560('0xb')](_0x1f0fcd,_0x32cd95)[_0xb560('0xc')](function(_0x3baec6){logger['info'](_0xb560('0xd'),_0x5134e5,'request\x20sent');logger[_0xb560('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5134e5,_0xb560('0xf'),JSON[_0xb560('0x10')](_0x3baec6));if(_0x3baec6[_0xb560('0x11')]){if(_0x3baec6[_0xb560('0x11')][_0xb560('0x12')]===0x1f4){logger[_0xb560('0x11')](_0xb560('0xd'),_0x5134e5,_0x3baec6[_0xb560('0x11')]['message']);return _0x20508f(_0x3baec6[_0xb560('0x11')]['message']);}logger['error'](_0xb560('0xd'),_0x5134e5,_0x3baec6[_0xb560('0x11')]['message']);return _0x30bbfe(_0x3baec6['error'][_0xb560('0x13')]);}else{logger[_0xb560('0x14')](_0xb560('0xd'),_0x5134e5,_0xb560('0xf'));_0x30bbfe(_0x3baec6['result'][_0xb560('0x13')]);}})[_0xb560('0x15')](function(_0x1de4a2){logger[_0xb560('0x11')](_0xb560('0xd'),_0x5134e5,_0x1de4a2);_0x20508f(_0x1de4a2);});});} \ No newline at end of file +var _0x697e=['error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2e5f9c,_0x134a52){var _0x538b44=function(_0x38ef13){while(--_0x38ef13){_0x2e5f9c['push'](_0x2e5f9c['shift']());}};_0x538b44(++_0x134a52);}(_0x697e,0x1d2));var _0xe697=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x697e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe697('0x0'));var util=require(_0xe697('0x1'));var moment=require(_0xe697('0x2'));var BPromise=require('bluebird');var rs=require(_0xe697('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe697('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe697('0x5'))(_0xe697('0x6'));var config=require(_0xe697('0x7'));var jayson=require(_0xe697('0x8'));var client=jayson[_0xe697('0x9')][_0xe697('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x307d1a,_0x585f0f,_0x2c0dea){return new BPromise(function(_0x5e48f0,_0x5f33e0){return client[_0xe697('0xb')](_0x307d1a,_0x2c0dea)[_0xe697('0xc')](function(_0x452ff1){logger[_0xe697('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x585f0f,_0xe697('0xe'));logger['debug'](_0xe697('0xf'),_0x585f0f,_0xe697('0xe'),JSON[_0xe697('0x10')](_0x452ff1));if(_0x452ff1[_0xe697('0x11')]){if(_0x452ff1['error'][_0xe697('0x12')]===0x1f4){logger[_0xe697('0x11')](_0xe697('0x13'),_0x585f0f,_0x452ff1['error'][_0xe697('0x14')]);return _0x5f33e0(_0x452ff1[_0xe697('0x11')]['message']);}logger['error'](_0xe697('0x13'),_0x585f0f,_0x452ff1[_0xe697('0x11')]['message']);return _0x5e48f0(_0x452ff1[_0xe697('0x11')][_0xe697('0x14')]);}else{logger[_0xe697('0xd')](_0xe697('0x13'),_0x585f0f,'request\x20sent');_0x5e48f0(_0x452ff1[_0xe697('0x15')][_0xe697('0x14')]);}})[_0xe697('0x16')](function(_0x54f589){logger['error'](_0xe697('0x13'),_0x585f0f,_0x54f589);_0x5f33e0(_0x54f589);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 59b09f0..1f9c174 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 _0x6d1a=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','create','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x162859,_0x294034){var _0xeb3b8e=function(_0x27730e){while(--_0x27730e){_0x162859['push'](_0x162859['shift']());}};_0xeb3b8e(++_0x294034);}(_0x6d1a,0xd3));var _0xa6d1=function(_0x5bbf3a,_0x445d69){_0x5bbf3a=_0x5bbf3a-0x0;var _0xe3f84=_0x6d1a[_0x5bbf3a];return _0xe3f84;};'use strict';var multer=require(_0xa6d1('0x0'));var util=require(_0xa6d1('0x1'));var path=require(_0xa6d1('0x2'));var timeout=require(_0xa6d1('0x3'));var express=require('express');var router=express[_0xa6d1('0x4')]();var auth=require(_0xa6d1('0x5'));var interaction=require(_0xa6d1('0x6'));var config=require(_0xa6d1('0x7'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0xa6d1('0x8')](),controller['index']);router['get'](_0xa6d1('0x9'),auth['isAuthenticated'](),controller[_0xa6d1('0xa')]);router[_0xa6d1('0xb')](_0xa6d1('0xc'),auth[_0xa6d1('0x8')](),controller[_0xa6d1('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa6d1('0xe')]);router[_0xa6d1('0xf')](_0xa6d1('0xc'),auth[_0xa6d1('0x8')](),controller['update']);router[_0xa6d1('0x10')]('/:id',auth[_0xa6d1('0x8')](),controller['destroy']);module[_0xa6d1('0x11')]=router; \ No newline at end of file +var _0x61a7=['update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x451959,_0x18c7a5){var _0x490269=function(_0x40cf17){while(--_0x40cf17){_0x451959['push'](_0x451959['shift']());}};_0x490269(++_0x18c7a5);}(_0x61a7,0x88));var _0x761a=function(_0x200182,_0x2a57f4){_0x200182=_0x200182-0x0;var _0x1a5383=_0x61a7[_0x200182];return _0x1a5383;};'use strict';var multer=require(_0x761a('0x0'));var util=require(_0x761a('0x1'));var path=require(_0x761a('0x2'));var timeout=require('connect-timeout');var express=require(_0x761a('0x3'));var router=express['Router']();var auth=require(_0x761a('0x4'));var interaction=require(_0x761a('0x5'));var config=require('../../config/environment');var controller=require(_0x761a('0x6'));router['get']('/',auth[_0x761a('0x7')](),controller[_0x761a('0x8')]);router['get'](_0x761a('0x9'),auth['isAuthenticated'](),controller[_0x761a('0xa')]);router['get'](_0x761a('0xb'),auth[_0x761a('0x7')](),controller[_0x761a('0xc')]);router[_0x761a('0xd')]('/',auth['isAuthenticated'](),controller[_0x761a('0xe')]);router[_0x761a('0xf')](_0x761a('0xb'),auth[_0x761a('0x7')](),controller[_0x761a('0x10')]);router['delete'](_0x761a('0xb'),auth[_0x761a('0x7')](),controller[_0x761a('0x11')]);module[_0x761a('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index b484460..cd5d597 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 _0xbc42=['ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x12c427,_0xc8c28){var _0x590c7f=function(_0x43e591){while(--_0x43e591){_0x12c427['push'](_0x12c427['shift']());}};_0x590c7f(++_0xc8c28);}(_0xbc42,0x9b));var _0x2bc4=function(_0x1de74a,_0x161a04){_0x1de74a=_0x1de74a-0x0;var _0x3582dd=_0xbc42[_0x1de74a];return _0x3582dd;};'use strict';var Sequelize=require(_0x2bc4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2bc4('0x1')](_0x2bc4('0x2'),_0x2bc4('0x3')),'defaultValue':_0x2bc4('0x2')},'selector':{'type':Sequelize[_0x2bc4('0x4')]},'timeout':{'type':Sequelize[_0x2bc4('0x5')]}}; \ No newline at end of file +var _0x0481=['exports','ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0481,0xfb));var _0x1048=function(_0x37bd0d,_0x1b3079){_0x37bd0d=_0x37bd0d-0x0;var _0x33f81d=_0x0481[_0x37bd0d];return _0x33f81d;};'use strict';var Sequelize=require(_0x1048('0x0'));module[_0x1048('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1048('0x2')](_0x1048('0x3'),_0x1048('0x4')),'defaultValue':_0x1048('0x3')},'selector':{'type':Sequelize[_0x1048('0x5')]},'timeout':{'type':Sequelize[_0x1048('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 2f983e0..7de2613 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 _0xa9e0=['keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','include','options','find','create','body','catch','params','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','show','model'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={'raw':!![],'where':{'id':_0x526cf3['params']['id']}},_0x45a1e7={};_0x45a1e7[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x27')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7[_0x0a9e('0x2b')]=_['intersection'](_0x45a1e7[_0x0a9e('0x26')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x45a1e7['model'],qs[_0x0a9e('0x2e')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2f')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x26')];if(_0x526cf3[_0x0a9e('0x2a')]['includeAll']){_0x479bc4[_0x0a9e('0x30')]=[{'all':!![]}];}_0x479bc4=_['merge']({},_0x479bc4,_0x526cf3[_0x0a9e('0x31')]);return db[_0x0a9e('0x28')][_0x0a9e('0x32')](_0x479bc4)[_0x0a9e('0x1f')](handleEntityNotFound(_0x384319,null))[_0x0a9e('0x1f')](respondWithResult(_0x384319,null))['catch'](handleError(_0x384319,null));};exports[_0x0a9e('0x33')]=function(_0x46f0a5,_0x40cb85){return db[_0x0a9e('0x28')][_0x0a9e('0x33')](_0x46f0a5[_0x0a9e('0x34')],{})[_0x0a9e('0x1f')](respondWithResult(_0x40cb85,0xc9))[_0x0a9e('0x35')](handleError(_0x40cb85,null));};exports['update']=function(_0x44295a,_0x5e7238){if(_0x44295a[_0x0a9e('0x34')]['id']){delete _0x44295a[_0x0a9e('0x34')]['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x32')]({'where':{'id':_0x44295a['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5e7238,null))[_0x0a9e('0x1f')](saveUpdates(_0x44295a[_0x0a9e('0x34')],null))[_0x0a9e('0x1f')](respondWithResult(_0x5e7238,null))['catch'](handleError(_0x5e7238,null));};exports['destroy']=function(_0x1e8694,_0x5640eb){return db[_0x0a9e('0x28')][_0x0a9e('0x32')]({'where':{'id':_0x1e8694[_0x0a9e('0x36')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5640eb,null))['then'](removeEntity(_0x5640eb,null))[_0x0a9e('0x35')](handleError(_0x5640eb,null));}; \ No newline at end of file +var _0x70e0=['mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x2bff25,_0xd6621e){var _0x43d71a=function(_0x2e2184){while(--_0x2e2184){_0x2bff25['push'](_0x2bff25['shift']());}};_0x43d71a(++_0xd6621e);}(_0x70e0,0x17b));var _0x070e=function(_0x67ccec,_0x4c7c19){_0x67ccec=_0x67ccec-0x0;var _0x13613d=_0x70e0[_0x67ccec];return _0x13613d;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={'raw':!![],'where':{'id':_0x1743cc[_0x070e('0x26')]['id']}},_0x374c54={};_0x374c54[_0x070e('0x27')]=_[_0x070e('0x28')](db[_0x070e('0x29')][_0x070e('0x2a')]);_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x28')](_0x1743cc['query']);_0x374c54[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],_0x374c54['query']);_0x497f58['attributes']=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],qs[_0x070e('0x2e')](_0x1743cc['query'][_0x070e('0x2e')]));_0x497f58[_0x070e('0x2f')]=_0x497f58[_0x070e('0x2f')][_0x070e('0x30')]?_0x497f58['attributes']:_0x374c54['model'];if(_0x1743cc['query']['includeAll']){_0x497f58[_0x070e('0x31')]=[{'all':!![]}];}_0x497f58=_['merge']({},_0x497f58,_0x1743cc[_0x070e('0x32')]);return db[_0x070e('0x29')]['find'](_0x497f58)['then'](handleEntityNotFound(_0x4763c6,null))[_0x070e('0x20')](respondWithResult(_0x4763c6,null))[_0x070e('0x33')](handleError(_0x4763c6,null));};exports['create']=function(_0x546a16,_0x41ade4){return db[_0x070e('0x29')][_0x070e('0x34')](_0x546a16[_0x070e('0x35')],{})[_0x070e('0x20')](respondWithResult(_0x41ade4,0xc9))['catch'](handleError(_0x41ade4,null));};exports['update']=function(_0x24d17d,_0x3011c4){if(_0x24d17d[_0x070e('0x35')]['id']){delete _0x24d17d[_0x070e('0x35')]['id'];}return db[_0x070e('0x29')]['find']({'where':{'id':_0x24d17d[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x3011c4,null))['then'](saveUpdates(_0x24d17d[_0x070e('0x35')],null))[_0x070e('0x20')](respondWithResult(_0x3011c4,null))['catch'](handleError(_0x3011c4,null));};exports['destroy']=function(_0x5ddbe9,_0x363bff){return db[_0x070e('0x29')][_0x070e('0x36')]({'where':{'id':_0x5ddbe9[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x363bff,null))['then'](removeEntity(_0x363bff,null))[_0x070e('0x33')](handleError(_0x363bff,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index cf84778..a43f5d1 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 _0xace3=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4cf320,_0x2af5b1){var _0x2581e8=function(_0x690394){while(--_0x690394){_0x4cf320['push'](_0x4cf320['shift']());}};_0x2581e8(++_0x2af5b1);}(_0xace3,0x1d5));var _0x3ace=function(_0x261df3,_0x21bff8){_0x261df3=_0x261df3-0x0;var _0x2f29c6=_0xace3[_0x261df3];return _0x2f29c6;};'use strict';var _=require(_0x3ace('0x0'));var util=require(_0x3ace('0x1'));var logger=require(_0x3ace('0x2'))(_0x3ace('0x3'));var moment=require(_0x3ace('0x4'));var BPromise=require(_0x3ace('0x5'));var rp=require(_0x3ace('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ace('0x7'));var config=require(_0x3ace('0x8'));var attributes=require(_0x3ace('0x9'));module[_0x3ace('0xa')]=function(_0x3bac32,_0x3039e5){return _0x3bac32[_0x3ace('0xb')](_0x3ace('0xc'),attributes,{'tableName':_0x3ace('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9dbe=['lodash','util','../../config/logger','api','rimraf','../../config/environment','exports','define','chat_proactive_actions'];(function(_0x237d67,_0x4ff2db){var _0x292dfb=function(_0x565a7d){while(--_0x565a7d){_0x237d67['push'](_0x237d67['shift']());}};_0x292dfb(++_0x4ff2db);}(_0x9dbe,0x117));var _0xe9db=function(_0x73ba1f,_0x588ccb){_0x73ba1f=_0x73ba1f-0x0;var _0x2e2725=_0x9dbe[_0x73ba1f];return _0x2e2725;};'use strict';var _=require(_0xe9db('0x0'));var util=require(_0xe9db('0x1'));var logger=require(_0xe9db('0x2'))(_0xe9db('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe9db('0x4'));var config=require(_0xe9db('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0xe9db('0x6')]=function(_0x3ff4c3,_0x4c44e1){return _0x3ff4c3[_0xe9db('0x7')]('ChatProactiveAction',attributes,{'tableName':_0xe9db('0x8'),'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 7e02a8b..71ebdcf 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 _0x8a98=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e1c3f,_0xe80c7c){var _0x2acc60=function(_0x113b27){while(--_0x113b27){_0x3e1c3f['push'](_0x3e1c3f['shift']());}};_0x2acc60(++_0xe80c7c);}(_0x8a98,0xdc));var _0x88a9=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x8a98[_0x44268d];return _0x4be92d;};'use strict';var _=require(_0x88a9('0x0'));var util=require(_0x88a9('0x1'));var moment=require(_0x88a9('0x2'));var BPromise=require(_0x88a9('0x3'));var rs=require(_0x88a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88a9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x88a9('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x88a9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17be0f,_0x5f2a00,_0x26aa54){return new BPromise(function(_0x74a543,_0x4baf83){return client['request'](_0x17be0f,_0x26aa54)[_0x88a9('0x8')](function(_0x2e374e){logger['info'](_0x88a9('0x9'),_0x5f2a00,_0x88a9('0xa'));logger['debug'](_0x88a9('0xb'),_0x5f2a00,_0x88a9('0xa'),JSON[_0x88a9('0xc')](_0x2e374e));if(_0x2e374e[_0x88a9('0xd')]){if(_0x2e374e['error'][_0x88a9('0xe')]===0x1f4){logger['error'](_0x88a9('0x9'),_0x5f2a00,_0x2e374e['error'][_0x88a9('0xf')]);return _0x4baf83(_0x2e374e[_0x88a9('0xd')][_0x88a9('0xf')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5f2a00,_0x2e374e[_0x88a9('0xd')][_0x88a9('0xf')]);return _0x74a543(_0x2e374e[_0x88a9('0xd')][_0x88a9('0xf')]);}else{logger[_0x88a9('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x5f2a00,_0x88a9('0xa'));_0x74a543(_0x2e374e['result'][_0x88a9('0xf')]);}})[_0x88a9('0x11')](function(_0x5a7bdf){logger[_0x88a9('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x5f2a00,_0x5a7bdf);_0x4baf83(_0x5a7bdf);});});} \ No newline at end of file +var _0xd417=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x451220,_0x2ed29f){var _0x5b85c5=function(_0x2c8e39){while(--_0x2c8e39){_0x451220['push'](_0x451220['shift']());}};_0x5b85c5(++_0x2ed29f);}(_0xd417,0x119));var _0x7d41=function(_0x4581d0,_0x5eae9a){_0x4581d0=_0x4581d0-0x0;var _0x5f5b13=_0xd417[_0x4581d0];return _0x5f5b13;};'use strict';var _=require(_0x7d41('0x0'));var util=require(_0x7d41('0x1'));var moment=require(_0x7d41('0x2'));var BPromise=require(_0x7d41('0x3'));var rs=require(_0x7d41('0x4'));var fs=require('fs');var Redis=require(_0x7d41('0x5'));var db=require(_0x7d41('0x6'))['db'];var utils=require(_0x7d41('0x7'));var logger=require('../../config/logger')(_0x7d41('0x8'));var config=require(_0x7d41('0x9'));var jayson=require(_0x7d41('0xa'));var client=jayson['client'][_0x7d41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21241d,_0x40114c,_0x1920ca){return new BPromise(function(_0x267182,_0xab5b16){return client['request'](_0x21241d,_0x1920ca)[_0x7d41('0xc')](function(_0x209eb4){logger['info'](_0x7d41('0xd'),_0x40114c,_0x7d41('0xe'));logger[_0x7d41('0xf')](_0x7d41('0x10'),_0x40114c,'request\x20sent',JSON[_0x7d41('0x11')](_0x209eb4));if(_0x209eb4['error']){if(_0x209eb4[_0x7d41('0x12')]['code']===0x1f4){logger['error'](_0x7d41('0xd'),_0x40114c,_0x209eb4[_0x7d41('0x12')][_0x7d41('0x13')]);return _0xab5b16(_0x209eb4[_0x7d41('0x12')][_0x7d41('0x13')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x40114c,_0x209eb4[_0x7d41('0x12')]['message']);return _0x267182(_0x209eb4[_0x7d41('0x12')][_0x7d41('0x13')]);}else{logger[_0x7d41('0x14')](_0x7d41('0xd'),_0x40114c,_0x7d41('0xe'));_0x267182(_0x209eb4[_0x7d41('0x15')][_0x7d41('0x13')]);}})[_0x7d41('0x16')](function(_0x3b1137){logger[_0x7d41('0x12')](_0x7d41('0xd'),_0x40114c,_0x3b1137);_0xab5b16(_0x3b1137);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f8e1289..87fa026 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 _0xd8f6=['path','express','Router','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','create','delete','destroy','exports','multer'];(function(_0x1d2ac1,_0x2f9ed9){var _0x5e08c9=function(_0xe6b7fe){while(--_0xe6b7fe){_0x1d2ac1['push'](_0x1d2ac1['shift']());}};_0x5e08c9(++_0x2f9ed9);}(_0xd8f6,0x6f));var _0x6d8f=function(_0x5882fc,_0x476a98){_0x5882fc=_0x5882fc-0x0;var _0x5e6ac6=_0xd8f6[_0x5882fc];return _0x5e6ac6;};'use strict';var multer=require(_0x6d8f('0x0'));var util=require('util');var path=require(_0x6d8f('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d8f('0x2'));var router=express[_0x6d8f('0x3')]();var auth=require(_0x6d8f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6d8f('0x5'));var controller=require('./chatProactiveAction.controller');router[_0x6d8f('0x6')](_0x6d8f('0x7'),auth[_0x6d8f('0x8')](),controller[_0x6d8f('0x9')]);router['post']('/',auth[_0x6d8f('0x8')](),controller[_0x6d8f('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6d8f('0xb')](_0x6d8f('0x7'),auth[_0x6d8f('0x8')](),controller[_0x6d8f('0xc')]);module[_0x6d8f('0xd')]=router; \ No newline at end of file +var _0xfc30=['/:id','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get'];(function(_0x1599b5,_0x28b24b){var _0x22b161=function(_0x3d936e){while(--_0x3d936e){_0x1599b5['push'](_0x1599b5['shift']());}};_0x22b161(++_0x28b24b);}(_0xfc30,0xd8));var _0x0fc3=function(_0x308351,_0x184653){_0x308351=_0x308351-0x0;var _0x2def07=_0xfc30[_0x308351];return _0x2def07;};'use strict';var multer=require(_0x0fc3('0x0'));var util=require(_0x0fc3('0x1'));var path=require(_0x0fc3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0fc3('0x3')]();var auth=require(_0x0fc3('0x4'));var interaction=require(_0x0fc3('0x5'));var config=require('../../config/environment');var controller=require(_0x0fc3('0x6'));router[_0x0fc3('0x7')](_0x0fc3('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x0fc3('0x9')]('/',auth[_0x0fc3('0xa')](),controller[_0x0fc3('0xb')]);router[_0x0fc3('0xc')](_0x0fc3('0x8'),auth[_0x0fc3('0xa')](),controller[_0x0fc3('0xd')]);router[_0x0fc3('0xe')](_0x0fc3('0x8'),auth[_0x0fc3('0xa')](),controller[_0x0fc3('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 5e04115..9f61cb2 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 _0x7f0d=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x4c0038,_0x1455ad){var _0x40ad1d=function(_0x4006a7){while(--_0x4006a7){_0x4c0038['push'](_0x4c0038['shift']());}};_0x40ad1d(++_0x1455ad);}(_0x7f0d,0xdf));var _0xd7f0=function(_0x7e04f7,_0x39cd1b){_0x7e04f7=_0x7e04f7-0x0;var _0x11bde3=_0x7f0d[_0x7e04f7];return _0x11bde3;};'use strict';var Sequelize=require(_0xd7f0('0x0'));module[_0xd7f0('0x1')]={'name':{'type':Sequelize[_0xd7f0('0x2')],'unique':_0xd7f0('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd7f0('0x2')]},'timeout':{'type':Sequelize[_0xd7f0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd7f0('0x5')](_0xd7f0('0x6'),'beepall',_0xd7f0('0x7'))}}; \ No newline at end of file +var _0xe1f9=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x81f000,_0x15df85){var _0x337aa2=function(_0x37f6a4){while(--_0x37f6a4){_0x81f000['push'](_0x81f000['shift']());}};_0x337aa2(++_0x15df85);}(_0xe1f9,0x1b2));var _0x9e1f=function(_0x2a56f9,_0x34ca70){_0x2a56f9=_0x2a56f9-0x0;var _0x7ddfff=_0xe1f9[_0x2a56f9];return _0x7ddfff;};'use strict';var Sequelize=require(_0x9e1f('0x0'));module[_0x9e1f('0x1')]={'name':{'type':Sequelize[_0x9e1f('0x2')],'unique':_0x9e1f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9e1f('0x2')]},'timeout':{'type':Sequelize[_0x9e1f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9e1f('0x5')](_0x9e1f('0x6'),_0x9e1f('0x7'),_0x9e1f('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 6fc285b..3b7b87f 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 _0xfb67=['pick','filter','VIRTUAL','merge','ChatQueue','include','findAll','rows','show','filters','length','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','User','UserId','chatPause','format','%s/%s','SIP','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','json','count','offset','limit','set','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where'];(function(_0x3ad6b1,_0x3db931){var _0x2cdf59=function(_0x2b8bf6){while(--_0x2b8bf6){_0x3ad6b1['push'](_0x3ad6b1['shift']());}};_0x2cdf59(++_0x3db931);}(_0xfb67,0xdd));var _0x7fb6=function(_0x3d24f8,_0x23f1d4){_0x3d24f8=_0x3d24f8-0x0;var _0x23091a=_0xfb67[_0x3d24f8];return _0x23091a;};'use strict';var pdf=require(_0x7fb6('0x0'));var emlformat=require(_0x7fb6('0x1'));var rimraf=require(_0x7fb6('0x2'));var zipdir=require(_0x7fb6('0x3'));var jsonpatch=require(_0x7fb6('0x4'));var rp=require(_0x7fb6('0x5'));var moment=require(_0x7fb6('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7fb6('0x7'));var util=require(_0x7fb6('0x8'));var path=require(_0x7fb6('0x9'));var sox=require(_0x7fb6('0xa'));var csv=require(_0x7fb6('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7fb6('0xc'));var squel=require(_0x7fb6('0xd'));var crypto=require(_0x7fb6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7fb6('0xf'));var toCsv=require(_0x7fb6('0xb'));var querystring=require('querystring');var Papa=require(_0x7fb6('0x10'));var Redis=require(_0x7fb6('0x11'));var authService=require(_0x7fb6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fb6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fb6('0x14'))(_0x7fb6('0x15'));var utils=require(_0x7fb6('0x16'));var config=require(_0x7fb6('0x17'));var db=require('../../mysqldb')['db'];config[_0x7fb6('0x18')]=_[_0x7fb6('0x19')](config[_0x7fb6('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x7fb6('0x1a')][_0x7fb6('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5264df,_0x196700,_0x3e4441){if(_0x3e4441){var _0x5046e2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5046e2[_0x7fb6('0x1c')](_0x196700)){return _0x5264df;}else{throw new db[(_0x7fb6('0x1d'))][(_0x7fb6('0x1e'))](_0x7fb6('0x1f'));}}else{return _0x5264df;}}function respondWithRpcPromise(_0x33fb18,_0x26c3ec,_0x3b2493,_0x3ef701){return new BPromise(function(_0x2f8b0a,_0x5de506){var _0x70c3a5=_0x3ef701||client;return _0x70c3a5[_0x7fb6('0x20')](_0x33fb18,_0x3b2493)[_0x7fb6('0x21')](function(_0x169389){logger[_0x7fb6('0x22')](_0x7fb6('0x23'),_0x26c3ec,_0x7fb6('0x24'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x26c3ec,_0x7fb6('0x24'),JSON[_0x7fb6('0x25')](_0x169389));if(_0x169389[_0x7fb6('0x26')]){if(_0x169389[_0x7fb6('0x26')]['code']===0x1f4){logger[_0x7fb6('0x26')](_0x7fb6('0x23'),_0x26c3ec,_0x169389['error'][_0x7fb6('0x27')]);return _0x5de506(_0x169389['error']['message']);}logger[_0x7fb6('0x26')]('ChatQueue,\x20%s,\x20%s',_0x26c3ec,_0x169389['error']['message']);return _0x2f8b0a(_0x169389[_0x7fb6('0x26')]['message']);}else{logger[_0x7fb6('0x22')]('ChatQueue,\x20%s,\x20%s',_0x26c3ec,_0x7fb6('0x24'));_0x2f8b0a(_0x169389[_0x7fb6('0x28')][_0x7fb6('0x27')]);}})[_0x7fb6('0x29')](function(_0x253f23){logger['error'](_0x7fb6('0x23'),_0x26c3ec,_0x253f23);_0x5de506(_0x253f23);});});}function respondWithStatusCode(_0x4c7df4,_0x21a045){_0x21a045=_0x21a045||0xcc;return function(_0x25ede1){if(_0x25ede1){return _0x4c7df4['sendStatus'](_0x21a045);}return _0x4c7df4['status'](_0x21a045)['end']();};}function respondWithResult(_0x25216a,_0x440a04){_0x440a04=_0x440a04||0xc8;return function(_0x35e18f){if(_0x35e18f){return _0x25216a[_0x7fb6('0x2a')](_0x440a04)[_0x7fb6('0x2b')](_0x35e18f);}};}function respondWithFilteredResult(_0x2bc3b9,_0x4f43dc){return function(_0x8cd67){if(_0x8cd67){var _0x5251ab=_0x8cd67[_0x7fb6('0x2c')],_0x4221c3=_0x4f43dc[_0x7fb6('0x2d')],_0xa114d5=_0x4f43dc[_0x7fb6('0x2d')]+_0x4f43dc[_0x7fb6('0x2e')],_0xbb0240;if(_0xa114d5>=_0x5251ab){_0xa114d5=_0x5251ab;_0xbb0240=0xc8;}else{_0xbb0240=0xce;}_0x2bc3b9[_0x7fb6('0x2a')](_0xbb0240);return _0x2bc3b9[_0x7fb6('0x2f')]('Content-Range',_0x4221c3+'-'+_0xa114d5+'/'+_0x5251ab)[_0x7fb6('0x2b')](_0x8cd67);}return null;};}function patchUpdates(_0x3c12b5){return function(_0x2ab1bb){try{jsonpatch[_0x7fb6('0x30')](_0x2ab1bb,_0x3c12b5,!![]);}catch(_0x3f4c5e){return BPromise[_0x7fb6('0x31')](_0x3f4c5e);}return _0x2ab1bb[_0x7fb6('0x32')]();};}function saveUpdates(_0x2aa952,_0x26ba7e){return function(_0x4dd22d){if(_0x4dd22d){return _0x4dd22d[_0x7fb6('0x33')](_0x2aa952)[_0x7fb6('0x21')](function(_0x2ee5ad){return _0x2ee5ad;});}return null;};}function removeEntity(_0x3cc10d,_0x4a4c6a){return function(_0x5a1035){if(_0x5a1035){return _0x5a1035[_0x7fb6('0x34')]()[_0x7fb6('0x21')](function(){var _0x7089c=_0x5a1035[_0x7fb6('0x35')]({'plain':!![]});var _0x29d1bf='ChatQueues';return db[_0x7fb6('0x36')][_0x7fb6('0x34')]({'where':{'type':_0x29d1bf,'resourceId':_0x7089c['id']}})[_0x7fb6('0x21')](function(){return _0x5a1035;});})[_0x7fb6('0x21')](function(){_0x3cc10d['status'](0xcc)[_0x7fb6('0x37')]();});}};}function handleEntityNotFound(_0x1bb99d,_0x5e3375){return function(_0x18d5d8){if(!_0x18d5d8){_0x1bb99d['sendStatus'](0x194);}return _0x18d5d8;};}function handleError(_0x379f07,_0x5eb431){_0x5eb431=_0x5eb431||0x1f4;return function(_0xdc9375){logger['error'](_0xdc9375[_0x7fb6('0x38')]);if(_0xdc9375[_0x7fb6('0x39')]){delete _0xdc9375[_0x7fb6('0x39')];}_0x379f07[_0x7fb6('0x2a')](_0x5eb431)[_0x7fb6('0x3a')](_0xdc9375);};}exports[_0x7fb6('0x3b')]=function(_0x4b7b44,_0x5e63c2){var _0x5d237={},_0x36b4cc={},_0x253652={'count':0x0,'rows':[]};var _0xa14677=_['map'](db['ChatQueue'][_0x7fb6('0x3c')],function(_0x49ff5f){return{'name':_0x49ff5f[_0x7fb6('0x3d')],'type':_0x49ff5f[_0x7fb6('0x3e')][_0x7fb6('0x3f')]};});_0x36b4cc[_0x7fb6('0x40')]=_[_0x7fb6('0x41')](_0xa14677,_0x7fb6('0x39'));_0x36b4cc[_0x7fb6('0x42')]=_[_0x7fb6('0x43')](_0x4b7b44['query']);_0x36b4cc['filters']=_[_0x7fb6('0x44')](_0x36b4cc['model'],_0x36b4cc[_0x7fb6('0x42')]);_0x5d237[_0x7fb6('0x45')]=_[_0x7fb6('0x44')](_0x36b4cc[_0x7fb6('0x40')],qs[_0x7fb6('0x46')](_0x4b7b44[_0x7fb6('0x42')][_0x7fb6('0x46')]));_0x5d237[_0x7fb6('0x45')]=_0x5d237['attributes']['length']?_0x5d237[_0x7fb6('0x45')]:_0x36b4cc['model'];if(!_0x4b7b44[_0x7fb6('0x42')]['hasOwnProperty'](_0x7fb6('0x47'))){_0x5d237[_0x7fb6('0x2e')]=qs['limit'](_0x4b7b44[_0x7fb6('0x42')][_0x7fb6('0x2e')]);_0x5d237[_0x7fb6('0x2d')]=qs[_0x7fb6('0x2d')](_0x4b7b44[_0x7fb6('0x42')][_0x7fb6('0x2d')]);}_0x5d237[_0x7fb6('0x48')]=qs[_0x7fb6('0x49')](_0x4b7b44[_0x7fb6('0x42')]['sort']);_0x5d237[_0x7fb6('0x4a')]=qs['filters'](_[_0x7fb6('0x4b')](_0x4b7b44[_0x7fb6('0x42')],_0x36b4cc['filters']));if(_0x4b7b44[_0x7fb6('0x42')][_0x7fb6('0x4c')]){_0x5d237[_0x7fb6('0x4a')]=_['merge'](_0x5d237[_0x7fb6('0x4a')],{'$or':_[_0x7fb6('0x41')](_0xa14677,function(_0x328c1a){if(_0x328c1a[_0x7fb6('0x3e')]!==_0x7fb6('0x4d')){var _0x257ad4={};_0x257ad4[_0x328c1a[_0x7fb6('0x39')]]={'$like':'%'+_0x4b7b44[_0x7fb6('0x42')][_0x7fb6('0x4c')]+'%'};return _0x257ad4;}})});}_0x5d237=_[_0x7fb6('0x4e')]({},_0x5d237,_0x4b7b44['options']);var _0x394182={'where':_0x5d237['where']};return db[_0x7fb6('0x4f')]['count'](_0x394182)[_0x7fb6('0x21')](function(_0x586c58){_0x253652[_0x7fb6('0x2c')]=_0x586c58;if(_0x4b7b44[_0x7fb6('0x42')]['includeAll']){_0x5d237[_0x7fb6('0x50')]=[{'all':!![]}];}return db[_0x7fb6('0x4f')][_0x7fb6('0x51')](_0x5d237);})[_0x7fb6('0x21')](function(_0x2d0fc0){_0x253652[_0x7fb6('0x52')]=_0x2d0fc0;return _0x253652;})[_0x7fb6('0x21')](respondWithFilteredResult(_0x5e63c2,_0x5d237))[_0x7fb6('0x29')](handleError(_0x5e63c2,null));};exports[_0x7fb6('0x53')]=function(_0x3971a2,_0x2f0646){var _0x44ed4f={'raw':!![],'where':{'id':_0x3971a2['params']['id']}},_0x58566b={};_0x58566b[_0x7fb6('0x40')]=_['keys'](db[_0x7fb6('0x4f')][_0x7fb6('0x3c')]);_0x58566b[_0x7fb6('0x42')]=_[_0x7fb6('0x43')](_0x3971a2['query']);_0x58566b[_0x7fb6('0x54')]=_[_0x7fb6('0x44')](_0x58566b[_0x7fb6('0x40')],_0x58566b['query']);_0x44ed4f[_0x7fb6('0x45')]=_[_0x7fb6('0x44')](_0x58566b[_0x7fb6('0x40')],qs['fields'](_0x3971a2[_0x7fb6('0x42')]['fields']));_0x44ed4f[_0x7fb6('0x45')]=_0x44ed4f[_0x7fb6('0x45')][_0x7fb6('0x55')]?_0x44ed4f[_0x7fb6('0x45')]:_0x58566b[_0x7fb6('0x40')];if(_0x3971a2['query'][_0x7fb6('0x56')]){_0x44ed4f[_0x7fb6('0x50')]=[{'all':!![]}];}_0x44ed4f=_[_0x7fb6('0x4e')]({},_0x44ed4f,_0x3971a2[_0x7fb6('0x57')]);return db[_0x7fb6('0x4f')]['find'](_0x44ed4f)[_0x7fb6('0x21')](handleEntityNotFound(_0x2f0646,null))[_0x7fb6('0x21')](respondWithResult(_0x2f0646,null))[_0x7fb6('0x29')](handleError(_0x2f0646,null));};exports['create']=function(_0x32cb56,_0x2577db){return db[_0x7fb6('0x4f')][_0x7fb6('0x58')](_0x32cb56['body'],{})[_0x7fb6('0x21')](function(_0x4ebd80){var _0x214fc2=_0x32cb56[_0x7fb6('0x59')][_0x7fb6('0x35')]({'plain':!![]});if(!_0x214fc2)throw new Error(_0x7fb6('0x5a'));if(_0x214fc2[_0x7fb6('0x5b')]==='user'){var _0x35b3fa=_0x4ebd80[_0x7fb6('0x35')]({'plain':!![]});var _0x59587e=_0x7fb6('0x5c');return db[_0x7fb6('0x5d')]['find']({'where':{'name':_0x59587e,'userProfileId':_0x214fc2[_0x7fb6('0x5e')]},'raw':!![]})[_0x7fb6('0x21')](function(_0x4deabe){if(_0x4deabe&&_0x4deabe[_0x7fb6('0x5f')]===0x0){return db[_0x7fb6('0x36')][_0x7fb6('0x58')]({'name':_0x35b3fa[_0x7fb6('0x39')],'resourceId':_0x35b3fa['id'],'type':_0x4deabe['name'],'sectionId':_0x4deabe['id']},{})[_0x7fb6('0x21')](function(){return _0x4ebd80;});}else{return _0x4ebd80;}})[_0x7fb6('0x29')](function(_0x5592b6){logger['error'](_0x7fb6('0x60'),_0x5592b6);throw _0x5592b6;});}return _0x4ebd80;})[_0x7fb6('0x21')](respondWithResult(_0x2577db,0xc9))[_0x7fb6('0x29')](handleError(_0x2577db,null));};exports['update']=function(_0x314a65,_0x3d3aaf){if(_0x314a65[_0x7fb6('0x61')]['id']){delete _0x314a65[_0x7fb6('0x61')]['id'];}return db[_0x7fb6('0x4f')][_0x7fb6('0x62')]({'where':{'id':_0x314a65[_0x7fb6('0x63')]['id']}})[_0x7fb6('0x21')](handleEntityNotFound(_0x3d3aaf,null))[_0x7fb6('0x21')](saveUpdates(_0x314a65[_0x7fb6('0x61')],null))[_0x7fb6('0x21')](respondWithResult(_0x3d3aaf,null))[_0x7fb6('0x29')](handleError(_0x3d3aaf,null));};exports[_0x7fb6('0x34')]=function(_0x47442a,_0x288add){return db[_0x7fb6('0x4f')]['find']({'where':{'id':_0x47442a[_0x7fb6('0x63')]['id']}})[_0x7fb6('0x21')](handleEntityNotFound(_0x288add,null))[_0x7fb6('0x21')](removeEntity(_0x288add,null))[_0x7fb6('0x29')](handleError(_0x288add,null));};exports[_0x7fb6('0x64')]=function(_0x75fdc,_0x5f304f){return db[_0x7fb6('0x4f')][_0x7fb6('0x64')]()[_0x7fb6('0x21')](respondWithResult(_0x5f304f,null))[_0x7fb6('0x29')](handleError(_0x5f304f,null));};exports[_0x7fb6('0x65')]=function(_0x5afa88,_0x22fbed,_0x19dc4a){var _0xf76fc7={'raw':!![],'where':{}},_0xef5cd8={},_0x47ead4;return db[_0x7fb6('0x4f')][_0x7fb6('0x66')]({'where':{'id':_0x5afa88[_0x7fb6('0x63')]['id']}})[_0x7fb6('0x21')](handleEntityNotFound(_0x22fbed,null))[_0x7fb6('0x21')](function(_0x126d4f){if(_0x126d4f){_0x47ead4=_0x126d4f[_0x7fb6('0x35')]({'plain':!![]});_0xef5cd8['model']=_[_0x7fb6('0x43')](db[_0x7fb6('0x67')][_0x7fb6('0x3c')]);_0xef5cd8[_0x7fb6('0x42')]=_[_0x7fb6('0x43')](_0x5afa88[_0x7fb6('0x42')]);_0xef5cd8[_0x7fb6('0x54')]=_[_0x7fb6('0x44')](_0xef5cd8[_0x7fb6('0x40')],_0xef5cd8[_0x7fb6('0x42')]);_0xf76fc7['attributes']=_['intersection'](_0xef5cd8[_0x7fb6('0x40')],qs[_0x7fb6('0x46')](_0x5afa88[_0x7fb6('0x42')][_0x7fb6('0x46')]));_0xf76fc7[_0x7fb6('0x45')]=_0xf76fc7[_0x7fb6('0x45')][_0x7fb6('0x55')]?_0xf76fc7[_0x7fb6('0x45')]:_0xef5cd8[_0x7fb6('0x40')];if(!_0x5afa88[_0x7fb6('0x42')][_0x7fb6('0x68')](_0x7fb6('0x47'))){_0xf76fc7[_0x7fb6('0x2e')]=qs[_0x7fb6('0x2e')](_0x5afa88[_0x7fb6('0x42')]['limit']);_0xf76fc7[_0x7fb6('0x2d')]=qs[_0x7fb6('0x2d')](_0x5afa88[_0x7fb6('0x42')][_0x7fb6('0x2d')]);}_0xf76fc7['order']=qs['sort'](_0x5afa88['query'][_0x7fb6('0x49')]);_0xf76fc7[_0x7fb6('0x4a')]=qs[_0x7fb6('0x54')](_[_0x7fb6('0x4b')](_0x5afa88[_0x7fb6('0x42')],_0xef5cd8['filters']));_0xf76fc7[_0x7fb6('0x4a')]['ChatQueueId']=_0x126d4f['id'];if(_0x5afa88[_0x7fb6('0x42')][_0x7fb6('0x4c')]){_0xf76fc7[_0x7fb6('0x4a')]=_[_0x7fb6('0x4e')](_0xf76fc7[_0x7fb6('0x4a')],{'$or':_[_0x7fb6('0x41')](_0xf76fc7['attributes'],function(_0x263215){var _0x4af90c={};_0x4af90c[_0x263215]={'$like':'%'+_0x5afa88[_0x7fb6('0x42')][_0x7fb6('0x4c')]+'%'};return _0x4af90c;})});}_0xf76fc7=_[_0x7fb6('0x4e')]({},_0xf76fc7,_0x5afa88[_0x7fb6('0x57')]);return db[_0x7fb6('0x67')]['findAll'](_0xf76fc7);}})[_0x7fb6('0x21')](function(_0x3d27b9){if(_0x3d27b9){return db[_0x7fb6('0x69')]['findAndCountAll']({'where':{'id':_[_0x7fb6('0x41')](_0x3d27b9,_0x7fb6('0x6a')),'role':'agent'},'attributes':['id',_0x7fb6('0x39'),_0x7fb6('0x6b'),'updatedAt','createdAt']});}})[_0x7fb6('0x21')](function(_0x1ede25){if(_0x1ede25){return{'count':_0x1ede25['count'],'rows':_[_0x7fb6('0x41')](_0x1ede25[_0x7fb6('0x52')],function(_0x1818c5){return{'membername':_0x1818c5[_0x7fb6('0x39')],'UserId':_0x1818c5['id'],'queue_name':_0x47ead4[_0x7fb6('0x39')],'ChatQueueId':_0x47ead4['id'],'interface':util[_0x7fb6('0x6c')](_0x7fb6('0x6d'),_0x7fb6('0x6e'),_0x1818c5[_0x7fb6('0x39')]),'penalty':0x0,'paused':_0x1818c5['chatPause'],'createdAt':_0x1818c5['createdAt'],'updatedAt':_0x1818c5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7fb6('0x21')](respondWithFilteredResult(_0x22fbed,_0xf76fc7))[_0x7fb6('0x29')](handleError(_0x22fbed,null));};exports[_0x7fb6('0x6f')]=function(_0x3a89eb,_0x1391c1,_0x28df2d){var _0x3e9947={};var _0x399a6a={};var _0x4a2478;var _0x9cf830;return db[_0x7fb6('0x4f')][_0x7fb6('0x66')]({'where':{'id':_0x3a89eb[_0x7fb6('0x63')]['id']}})[_0x7fb6('0x21')](handleEntityNotFound(_0x1391c1,null))[_0x7fb6('0x21')](function(_0x16f83a){if(_0x16f83a){_0x4a2478=_0x16f83a;_0x399a6a[_0x7fb6('0x40')]=_[_0x7fb6('0x43')](db[_0x7fb6('0x70')][_0x7fb6('0x3c')]);_0x399a6a['query']=_[_0x7fb6('0x43')](_0x3a89eb[_0x7fb6('0x42')]);_0x399a6a[_0x7fb6('0x54')]=_[_0x7fb6('0x44')](_0x399a6a['model'],_0x399a6a['query']);_0x3e9947[_0x7fb6('0x45')]=_[_0x7fb6('0x44')](_0x399a6a[_0x7fb6('0x40')],qs[_0x7fb6('0x46')](_0x3a89eb[_0x7fb6('0x42')][_0x7fb6('0x46')]));_0x3e9947['attributes']=_0x3e9947[_0x7fb6('0x45')]['length']?_0x3e9947[_0x7fb6('0x45')]:_0x399a6a[_0x7fb6('0x40')];_0x3e9947[_0x7fb6('0x48')]=qs['sort'](_0x3a89eb[_0x7fb6('0x42')][_0x7fb6('0x49')]);_0x3e9947['where']=qs[_0x7fb6('0x54')](_['pick'](_0x3a89eb[_0x7fb6('0x42')],_0x399a6a[_0x7fb6('0x54')]));if(_0x3a89eb['query'][_0x7fb6('0x4c')]){_0x3e9947[_0x7fb6('0x4a')]=_[_0x7fb6('0x4e')](_0x3e9947['where'],{'$or':_[_0x7fb6('0x41')](_0x3e9947['attributes'],function(_0x4ec49c){var _0x2039c9={};_0x2039c9[_0x4ec49c]={'$like':'%'+_0x3a89eb['query']['filter']+'%'};return _0x2039c9;})});}_0x3e9947=_[_0x7fb6('0x4e')]({},_0x3e9947,_0x3a89eb[_0x7fb6('0x57')]);return _0x4a2478[_0x7fb6('0x6f')](_0x3e9947);}})[_0x7fb6('0x21')](function(_0x1df442){if(_0x1df442){_0x9cf830=_0x1df442[_0x7fb6('0x55')];if(!_0x3a89eb[_0x7fb6('0x42')][_0x7fb6('0x68')](_0x7fb6('0x47'))){_0x3e9947[_0x7fb6('0x2e')]=qs[_0x7fb6('0x2e')](_0x3a89eb[_0x7fb6('0x42')][_0x7fb6('0x2e')]);_0x3e9947[_0x7fb6('0x2d')]=qs[_0x7fb6('0x2d')](_0x3a89eb[_0x7fb6('0x42')][_0x7fb6('0x2d')]);}return _0x4a2478[_0x7fb6('0x6f')](_0x3e9947);}})['then'](function(_0x77e96f){if(_0x77e96f){return _0x77e96f?{'count':_0x9cf830,'rows':_0x77e96f}:null;}})[_0x7fb6('0x21')](respondWithResult(_0x1391c1,null))[_0x7fb6('0x29')](handleError(_0x1391c1,null));};exports['addTeams']=function(_0x5430d2,_0xd4303b,_0x3da03f){var _0x591f81=_0x5430d2[_0x7fb6('0x61')][_0x7fb6('0x71')];return db[_0x7fb6('0x70')][_0x7fb6('0x51')]({'where':{'id':_0x591f81},'attributes':['id'],'include':[{'model':db[_0x7fb6('0x69')],'as':'Agents','attributes':['id',_0x7fb6('0x39'),_0x7fb6('0x72'),_0x7fb6('0x73'),_0x7fb6('0x74')],'raw':!![]}]})['then'](function(_0x1f85a9){if(_0x1f85a9){var _0x1fe6f0=_[_0x7fb6('0x75')](_0x1f85a9,function(_0xd6faea){var _0x4a279a=_0xd6faea['get']({'plain':!![]});return _0x4a279a[_0x7fb6('0x76')];});return db[_0x7fb6('0x4f')][_0x7fb6('0x62')]({'where':{'id':_0x5430d2[_0x7fb6('0x63')]['id']}})[_0x7fb6('0x21')](function(_0x2f4a1c){return db[_0x7fb6('0x77')][_0x7fb6('0x78')](function(_0x894909){return _0x2f4a1c[_0x7fb6('0x79')](_0x591f81,{'transaction':_0x894909})[_0x7fb6('0x21')](function(){return BPromise['each'](_0x1fe6f0,function(_0x434d29){return db[_0x7fb6('0x67')][_0x7fb6('0x7a')]({'where':{'UserId':_0x434d29['id'],'ChatQueueId':_0x5430d2[_0x7fb6('0x63')]['id']},'transaction':_0x894909});});})[_0x7fb6('0x21')](function(){_0x1fe6f0['forEach'](function(_0x43bb73){socket[_0x7fb6('0x7b')](_0x7fb6('0x7c'),{'UserId':_0x43bb73['id'],'ChatQueueId':_0x2f4a1c['id']});});});});});}})[_0x7fb6('0x21')](respondWithStatusCode(_0xd4303b,null))[_0x7fb6('0x29')](handleError(_0xd4303b,null));};exports[_0x7fb6('0x7d')]=function(_0x3fd36c,_0xa83e8a,_0x5b9ff5){return db[_0x7fb6('0x70')][_0x7fb6('0x51')]({'where':{'id':_0x3fd36c[_0x7fb6('0x42')][_0x7fb6('0x71')]},'attributes':['id'],'include':[{'model':db[_0x7fb6('0x69')],'as':_0x7fb6('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xa83e8a,null))[_0x7fb6('0x21')](function(_0x3b5aec){var _0x4ee5c1=_[_0x7fb6('0x41')](_0x3b5aec,'id');var _0x5f13e6=[];var _0x193411=[];var _0x5271c6=squel[_0x7fb6('0x7e')]();_0x5271c6[_0x7fb6('0x7f')]('tq.TeamId')['from'](_0x7fb6('0x80'),'tq')[_0x7fb6('0x81')]('user_has_teams','ut',_0x7fb6('0x82'))[_0x7fb6('0x4a')](_0x7fb6('0x83'),_0x3fd36c[_0x7fb6('0x63')]['id']);for(var _0x5e7df6=0x0;_0x5e7df6<_0x3b5aec['length'];_0x5e7df6+=0x1){let _0x33cadb=_0x3b5aec[_0x5e7df6];for(var _0x15b8f0=0x0;_0x15b8f0<_0x33cadb['Agents']['length'];_0x15b8f0+=0x1){let _0x516b91=_0x33cadb[_0x7fb6('0x76')][_0x15b8f0];var _0x13006c=_0x5271c6[_0x7fb6('0x84')]();_0x13006c[_0x7fb6('0x4a')]('ut.UserId\x20=\x20?',_0x516b91['id']);_0x193411['push'](db[_0x7fb6('0x77')][_0x7fb6('0x42')](_0x13006c[_0x7fb6('0x85')](),{'type':db['sequelize'][_0x7fb6('0x86')]['SELECT']})[_0x7fb6('0x21')](function(_0x32a728){if(_0x32a728[_0x7fb6('0x55')]===0x1){return _0x516b91['id'];}else{var _0x798c13=_[_0x7fb6('0x87')](_[_0x7fb6('0x41')](_0x32a728,_0x7fb6('0x88')),function(_0x2d9010){return _[_0x7fb6('0x89')](_0x4ee5c1,_0x2d9010);});if(_0x798c13){return _0x516b91['id'];}}}));}}return BPromise[_0x7fb6('0x8a')](_0x193411)[_0x7fb6('0x21')](function(_0x26ee59){_0x5f13e6=_(_0x5f13e6)[_0x7fb6('0x8b')](_0x26ee59)[_0x7fb6('0x8c')]()[_0x7fb6('0x8d')]();return db[_0x7fb6('0x4f')][_0x7fb6('0x62')]({'where':{'id':_0x3fd36c[_0x7fb6('0x63')]['id']}})['then'](function(_0x831ede){return db[_0x7fb6('0x77')][_0x7fb6('0x78')](function(_0x1ac534){return _0x831ede[_0x7fb6('0x7d')](_0x3fd36c[_0x7fb6('0x42')][_0x7fb6('0x71')],{'transaction':_0x1ac534})[_0x7fb6('0x21')](function(){if(!_['isEmpty'](_0x5f13e6)){return _0x831ede[_0x7fb6('0x8e')](_0x5f13e6,{'transaction':_0x1ac534});}})[_0x7fb6('0x21')](function(){_0x5f13e6['forEach'](function(_0x56a134){socket[_0x7fb6('0x7b')](_0x7fb6('0x8f'),{'UserId':_0x56a134,'ChatQueueId':_0x831ede['id']});});});});});});})[_0x7fb6('0x21')](respondWithStatusCode(_0xa83e8a,null))['catch'](handleError(_0xa83e8a,null));};exports['addAgents']=function(_0x14c04f,_0x1330fb,_0x29fb5b){return db['ChatQueue'][_0x7fb6('0x62')]({'where':{'id':_0x14c04f['params']['id']}})[_0x7fb6('0x21')](handleEntityNotFound(_0x1330fb,null))[_0x7fb6('0x21')](function(_0x1b82b4){if(_0x1b82b4){return _0x1b82b4[_0x7fb6('0x90')](_0x14c04f[_0x7fb6('0x61')][_0x7fb6('0x71')],_['omit'](_0x14c04f[_0x7fb6('0x61')],[_0x7fb6('0x71'),'id'])||{})[_0x7fb6('0x91')](function(_0x837e7e){for(var _0x3720ae=0x0;_0x3720ae<_0x14c04f['body'][_0x7fb6('0x71')][_0x7fb6('0x55')];_0x3720ae+=0x1){socket[_0x7fb6('0x7b')]('userChatQueue:save',{'UserId':_0x14c04f['body'][_0x7fb6('0x71')][_0x3720ae],'ChatQueueId':_0x14c04f[_0x7fb6('0x63')]['id']});}return _0x837e7e;});}})[_0x7fb6('0x21')](respondWithResult(_0x1330fb,null))[_0x7fb6('0x29')](handleError(_0x1330fb,null));};exports[_0x7fb6('0x8e')]=function(_0x131e0f,_0x2a27f2,_0x567ddc){return db[_0x7fb6('0x4f')]['find']({'where':{'id':_0x131e0f[_0x7fb6('0x63')]['id']}})['then'](handleEntityNotFound(_0x2a27f2,null))[_0x7fb6('0x21')](function(_0x4ba3bf){if(_0x4ba3bf){return _0x4ba3bf[_0x7fb6('0x8e')](_0x131e0f[_0x7fb6('0x42')][_0x7fb6('0x71')])[_0x7fb6('0x21')](function(){if(_[_0x7fb6('0x92')](_0x131e0f[_0x7fb6('0x42')][_0x7fb6('0x71')])){for(var _0x19ddbd=0x0;_0x19ddbd<_0x131e0f[_0x7fb6('0x42')][_0x7fb6('0x71')][_0x7fb6('0x55')];_0x19ddbd+=0x1){socket[_0x7fb6('0x7b')](_0x7fb6('0x8f'),{'UserId':Number(_0x131e0f[_0x7fb6('0x42')][_0x7fb6('0x71')][_0x19ddbd]),'ChatQueueId':Number(_0x131e0f[_0x7fb6('0x63')]['id'])});}}else{socket['emit'](_0x7fb6('0x8f'),{'UserId':Number(_0x131e0f['query']['ids']),'ChatQueueId':Number(_0x131e0f['params']['id'])});}});}})[_0x7fb6('0x21')](respondWithStatusCode(_0x2a27f2,null))[_0x7fb6('0x29')](handleError(_0x2a27f2,null));};exports[_0x7fb6('0x93')]=function(_0x35f293,_0x40bf5d,_0x29debd){var _0x59c099={};var _0xa36896={};var _0x266585;var _0x223d15;return db['ChatQueue'][_0x7fb6('0x66')]({'where':{'id':_0x35f293[_0x7fb6('0x63')]['id']}})[_0x7fb6('0x21')](handleEntityNotFound(_0x40bf5d,null))[_0x7fb6('0x21')](function(_0x1f2206){if(_0x1f2206){_0x266585=_0x1f2206;_0xa36896['model']=_[_0x7fb6('0x43')](db[_0x7fb6('0x69')]['rawAttributes']);_0xa36896[_0x7fb6('0x42')]=_[_0x7fb6('0x43')](_0x35f293[_0x7fb6('0x42')]);_0xa36896[_0x7fb6('0x54')]=_[_0x7fb6('0x44')](_0xa36896['model'],_0xa36896['query']);_0x59c099['attributes']=_[_0x7fb6('0x44')](_0xa36896[_0x7fb6('0x40')],qs[_0x7fb6('0x46')](_0x35f293[_0x7fb6('0x42')][_0x7fb6('0x46')]));_0x59c099[_0x7fb6('0x45')]=_0x59c099[_0x7fb6('0x45')][_0x7fb6('0x55')]?_0x59c099[_0x7fb6('0x45')]:_0xa36896[_0x7fb6('0x40')];_0x59c099[_0x7fb6('0x48')]=qs[_0x7fb6('0x49')](_0x35f293['query'][_0x7fb6('0x49')]);_0x59c099[_0x7fb6('0x4a')]=qs[_0x7fb6('0x54')](_[_0x7fb6('0x4b')](_0x35f293[_0x7fb6('0x42')],_0xa36896[_0x7fb6('0x54')]));if(_0x35f293[_0x7fb6('0x42')][_0x7fb6('0x4c')]){_0x59c099[_0x7fb6('0x4a')]=_[_0x7fb6('0x4e')](_0x59c099['where'],{'$or':_[_0x7fb6('0x41')](_0x59c099[_0x7fb6('0x45')],function(_0x38be28){var _0x5deeb4={};_0x5deeb4[_0x38be28]={'$like':'%'+_0x35f293[_0x7fb6('0x42')][_0x7fb6('0x4c')]+'%'};return _0x5deeb4;})});}_0x59c099=_[_0x7fb6('0x4e')]({},_0x59c099,_0x35f293[_0x7fb6('0x57')]);return _0x266585[_0x7fb6('0x93')](_0x59c099);}})[_0x7fb6('0x21')](function(_0xbc24d4){if(_0xbc24d4){_0x223d15=_0xbc24d4[_0x7fb6('0x55')];if(!_0x35f293[_0x7fb6('0x42')][_0x7fb6('0x68')]('nolimit')){_0x59c099[_0x7fb6('0x2e')]=qs[_0x7fb6('0x2e')](_0x35f293[_0x7fb6('0x42')]['limit']);_0x59c099[_0x7fb6('0x2d')]=qs['offset'](_0x35f293[_0x7fb6('0x42')][_0x7fb6('0x2d')]);}return _0x266585[_0x7fb6('0x93')](_0x59c099);}})[_0x7fb6('0x21')](function(_0x26656e){if(_0x26656e){return _0x26656e?{'count':_0x223d15,'rows':_0x26656e}:null;}})['then'](respondWithResult(_0x40bf5d,null))[_0x7fb6('0x29')](handleError(_0x40bf5d,null));}; \ No newline at end of file +var _0xb3f9=['request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','count','offset','set','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','limit','sort','where','filter','merge','type','options','ChatQueue','includeAll','include','findAll','rows','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','fields','order','pick','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','hasOwnProperty','addTeams','ids','Team','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userChatQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','value','transaction','isEmpty','userChatQueue:remove','addAgents','omit','emit','removeAgents','getAgents','findOne','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x2ab418,_0x1f2849){var _0x68f709=function(_0x139292){while(--_0x139292){_0x2ab418['push'](_0x2ab418['shift']());}};_0x68f709(++_0x1f2849);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x9d5741,_0x48b348){_0x9d5741=_0x9d5741-0x0;var _0x5871b3=_0xb3f9[_0x9d5741];return _0x5871b3;};'use strict';var pdf=require(_0x9b3f('0x0'));var emlformat=require(_0x9b3f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b3f('0x2'));var rp=require('request-promise');var moment=require(_0x9b3f('0x3'));var BPromise=require(_0x9b3f('0x4'));var Mustache=require(_0x9b3f('0x5'));var util=require(_0x9b3f('0x6'));var path=require(_0x9b3f('0x7'));var sox=require(_0x9b3f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b3f('0x9'));var squel=require(_0x9b3f('0xa'));var crypto=require('crypto');var jsforce=require(_0x9b3f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b3f('0xc'));var Redis=require('ioredis');var authService=require(_0x9b3f('0xd'));var qs=require(_0x9b3f('0xe'));var as=require(_0x9b3f('0xf'));var hardwareService=require(_0x9b3f('0x10'));var logger=require(_0x9b3f('0x11'))('api');var utils=require(_0x9b3f('0x12'));var config=require(_0x9b3f('0x13'));var db=require(_0x9b3f('0x14'))['db'];config[_0x9b3f('0x15')]=_[_0x9b3f('0x16')](config[_0x9b3f('0x15')],{'host':_0x9b3f('0x17'),'port':0x18eb});var socket=require(_0x9b3f('0x18'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x9b3f('0x19')](socket);var jayson=require(_0x9b3f('0x1a'));var client=jayson[_0x9b3f('0x1b')][_0x9b3f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x76978e,_0x52310c,_0x4aa66a){if(_0x4aa66a){var _0x49c0ac=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x49c0ac[_0x9b3f('0x1d')](_0x52310c)){return _0x76978e;}else{throw new db[(_0x9b3f('0x1e'))][(_0x9b3f('0x1f'))](_0x9b3f('0x20'));}}else{return _0x76978e;}}function respondWithRpcPromise(_0xd1e302,_0x2cdc7c,_0x5f5c1c,_0x579c32){return new BPromise(function(_0x2f2a53,_0x235434){var _0x129e24=_0x579c32||client;return _0x129e24[_0x9b3f('0x21')](_0xd1e302,_0x5f5c1c)[_0x9b3f('0x22')](function(_0x297fa8){logger[_0x9b3f('0x23')](_0x9b3f('0x24'),_0x2cdc7c,_0x9b3f('0x25'));logger[_0x9b3f('0x26')](_0x9b3f('0x27'),_0x2cdc7c,_0x9b3f('0x25'),JSON[_0x9b3f('0x28')](_0x297fa8));if(_0x297fa8[_0x9b3f('0x29')]){if(_0x297fa8[_0x9b3f('0x29')][_0x9b3f('0x2a')]===0x1f4){logger[_0x9b3f('0x29')](_0x9b3f('0x24'),_0x2cdc7c,_0x297fa8[_0x9b3f('0x29')]['message']);return _0x235434(_0x297fa8[_0x9b3f('0x29')]['message']);}logger[_0x9b3f('0x29')]('ChatQueue,\x20%s,\x20%s',_0x2cdc7c,_0x297fa8[_0x9b3f('0x29')][_0x9b3f('0x2b')]);return _0x2f2a53(_0x297fa8[_0x9b3f('0x29')]['message']);}else{logger[_0x9b3f('0x23')]('ChatQueue,\x20%s,\x20%s',_0x2cdc7c,_0x9b3f('0x25'));_0x2f2a53(_0x297fa8['result'][_0x9b3f('0x2b')]);}})[_0x9b3f('0x2c')](function(_0x51014e){logger[_0x9b3f('0x29')](_0x9b3f('0x24'),_0x2cdc7c,_0x51014e);_0x235434(_0x51014e);});});}function respondWithStatusCode(_0x2dfef4,_0x9cf303){_0x9cf303=_0x9cf303||0xcc;return function(_0x487527){if(_0x487527){return _0x2dfef4['sendStatus'](_0x9cf303);}return _0x2dfef4[_0x9b3f('0x2d')](_0x9cf303)['end']();};}function respondWithResult(_0x377d0e,_0x4a0d60){_0x4a0d60=_0x4a0d60||0xc8;return function(_0x1059b1){if(_0x1059b1){return _0x377d0e[_0x9b3f('0x2d')](_0x4a0d60)[_0x9b3f('0x2e')](_0x1059b1);}};}function respondWithFilteredResult(_0x1c89d3,_0x2f0045){return function(_0x590e9c){if(_0x590e9c){var _0x23dff5=_0x590e9c[_0x9b3f('0x2f')],_0x38dd12=_0x2f0045[_0x9b3f('0x30')],_0x1dad0e=_0x2f0045[_0x9b3f('0x30')]+_0x2f0045['limit'],_0x2a0a0c;if(_0x1dad0e>=_0x23dff5){_0x1dad0e=_0x23dff5;_0x2a0a0c=0xc8;}else{_0x2a0a0c=0xce;}_0x1c89d3['status'](_0x2a0a0c);return _0x1c89d3[_0x9b3f('0x31')]('Content-Range',_0x38dd12+'-'+_0x1dad0e+'/'+_0x23dff5)['json'](_0x590e9c);}return null;};}function patchUpdates(_0x20b019){return function(_0x4f3640){try{jsonpatch[_0x9b3f('0x32')](_0x4f3640,_0x20b019,!![]);}catch(_0x1a123a){return BPromise[_0x9b3f('0x33')](_0x1a123a);}return _0x4f3640[_0x9b3f('0x34')]();};}function saveUpdates(_0x238910,_0x4e6693){return function(_0x389d19){if(_0x389d19){return _0x389d19[_0x9b3f('0x35')](_0x238910)[_0x9b3f('0x22')](function(_0x344b0f){return _0x344b0f;});}return null;};}function removeEntity(_0x378e87,_0x365df5){return function(_0x5c7a9d){if(_0x5c7a9d){return _0x5c7a9d[_0x9b3f('0x36')]()[_0x9b3f('0x22')](function(){var _0x222118=_0x5c7a9d['get']({'plain':!![]});var _0x3c7c2c=_0x9b3f('0x37');return db[_0x9b3f('0x38')][_0x9b3f('0x36')]({'where':{'type':_0x3c7c2c,'resourceId':_0x222118['id']}})[_0x9b3f('0x22')](function(){return _0x5c7a9d;});})[_0x9b3f('0x22')](function(){_0x378e87[_0x9b3f('0x2d')](0xcc)[_0x9b3f('0x39')]();});}};}function handleEntityNotFound(_0x115d38,_0x11174c){return function(_0x3f4a1d){if(!_0x3f4a1d){_0x115d38[_0x9b3f('0x3a')](0x194);}return _0x3f4a1d;};}function handleError(_0x20126a,_0x565ac){_0x565ac=_0x565ac||0x1f4;return function(_0x10dca3){logger['error'](_0x10dca3[_0x9b3f('0x3b')]);if(_0x10dca3[_0x9b3f('0x3c')]){delete _0x10dca3[_0x9b3f('0x3c')];}_0x20126a[_0x9b3f('0x2d')](_0x565ac)[_0x9b3f('0x3d')](_0x10dca3);};}exports[_0x9b3f('0x3e')]=function(_0x132643,_0x49e4a6){var _0x1c2154={},_0x1ff4a7={},_0x569619={'count':0x0,'rows':[]};var _0x38bb4b=_[_0x9b3f('0x3f')](db['ChatQueue'][_0x9b3f('0x40')],function(_0x2afda2){return{'name':_0x2afda2[_0x9b3f('0x41')],'type':_0x2afda2['type'][_0x9b3f('0x42')]};});_0x1ff4a7[_0x9b3f('0x43')]=_[_0x9b3f('0x3f')](_0x38bb4b,_0x9b3f('0x3c'));_0x1ff4a7[_0x9b3f('0x44')]=_['keys'](_0x132643['query']);_0x1ff4a7[_0x9b3f('0x45')]=_[_0x9b3f('0x46')](_0x1ff4a7['model'],_0x1ff4a7['query']);_0x1c2154[_0x9b3f('0x47')]=_['intersection'](_0x1ff4a7[_0x9b3f('0x43')],qs['fields'](_0x132643[_0x9b3f('0x44')]['fields']));_0x1c2154['attributes']=_0x1c2154[_0x9b3f('0x47')][_0x9b3f('0x48')]?_0x1c2154[_0x9b3f('0x47')]:_0x1ff4a7[_0x9b3f('0x43')];if(!_0x132643['query']['hasOwnProperty'](_0x9b3f('0x49'))){_0x1c2154['limit']=qs[_0x9b3f('0x4a')](_0x132643[_0x9b3f('0x44')]['limit']);_0x1c2154[_0x9b3f('0x30')]=qs[_0x9b3f('0x30')](_0x132643[_0x9b3f('0x44')][_0x9b3f('0x30')]);}_0x1c2154['order']=qs[_0x9b3f('0x4b')](_0x132643[_0x9b3f('0x44')][_0x9b3f('0x4b')]);_0x1c2154[_0x9b3f('0x4c')]=qs[_0x9b3f('0x45')](_['pick'](_0x132643[_0x9b3f('0x44')],_0x1ff4a7[_0x9b3f('0x45')]));if(_0x132643['query'][_0x9b3f('0x4d')]){_0x1c2154[_0x9b3f('0x4c')]=_[_0x9b3f('0x4e')](_0x1c2154[_0x9b3f('0x4c')],{'$or':_[_0x9b3f('0x3f')](_0x38bb4b,function(_0xdf1738){if(_0xdf1738[_0x9b3f('0x4f')]!=='VIRTUAL'){var _0x3e0e8d={};_0x3e0e8d[_0xdf1738[_0x9b3f('0x3c')]]={'$like':'%'+_0x132643[_0x9b3f('0x44')][_0x9b3f('0x4d')]+'%'};return _0x3e0e8d;}})});}_0x1c2154=_[_0x9b3f('0x4e')]({},_0x1c2154,_0x132643[_0x9b3f('0x50')]);var _0x1c0a88={'where':_0x1c2154[_0x9b3f('0x4c')]};return db[_0x9b3f('0x51')]['count'](_0x1c0a88)[_0x9b3f('0x22')](function(_0x498939){_0x569619[_0x9b3f('0x2f')]=_0x498939;if(_0x132643[_0x9b3f('0x44')][_0x9b3f('0x52')]){_0x1c2154[_0x9b3f('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0x9b3f('0x54')](_0x1c2154);})[_0x9b3f('0x22')](function(_0xb55fb0){_0x569619[_0x9b3f('0x55')]=_0xb55fb0;return _0x569619;})['then'](respondWithFilteredResult(_0x49e4a6,_0x1c2154))['catch'](handleError(_0x49e4a6,null));};exports['show']=function(_0x4cc15b,_0x3dc261){var _0x29ef8c={'raw':!![],'where':{'id':_0x4cc15b[_0x9b3f('0x56')]['id']}},_0x37acf4={};_0x37acf4[_0x9b3f('0x43')]=_['keys'](db[_0x9b3f('0x51')]['rawAttributes']);_0x37acf4[_0x9b3f('0x44')]=_[_0x9b3f('0x57')](_0x4cc15b['query']);_0x37acf4[_0x9b3f('0x45')]=_[_0x9b3f('0x46')](_0x37acf4[_0x9b3f('0x43')],_0x37acf4[_0x9b3f('0x44')]);_0x29ef8c[_0x9b3f('0x47')]=_[_0x9b3f('0x46')](_0x37acf4[_0x9b3f('0x43')],qs['fields'](_0x4cc15b[_0x9b3f('0x44')]['fields']));_0x29ef8c[_0x9b3f('0x47')]=_0x29ef8c[_0x9b3f('0x47')][_0x9b3f('0x48')]?_0x29ef8c[_0x9b3f('0x47')]:_0x37acf4[_0x9b3f('0x43')];if(_0x4cc15b['query'][_0x9b3f('0x52')]){_0x29ef8c[_0x9b3f('0x53')]=[{'all':!![]}];}_0x29ef8c=_['merge']({},_0x29ef8c,_0x4cc15b[_0x9b3f('0x50')]);return db[_0x9b3f('0x51')][_0x9b3f('0x58')](_0x29ef8c)['then'](handleEntityNotFound(_0x3dc261,null))[_0x9b3f('0x22')](respondWithResult(_0x3dc261,null))[_0x9b3f('0x2c')](handleError(_0x3dc261,null));};exports['create']=function(_0x4652c4,_0x3078cf){return db[_0x9b3f('0x51')][_0x9b3f('0x59')](_0x4652c4[_0x9b3f('0x5a')],{})['then'](function(_0x3ebadf){var _0x148197=_0x4652c4[_0x9b3f('0x5b')][_0x9b3f('0x5c')]({'plain':!![]});if(!_0x148197)throw new Error(_0x9b3f('0x5d'));if(_0x148197[_0x9b3f('0x5e')]===_0x9b3f('0x5b')){var _0xd793c=_0x3ebadf[_0x9b3f('0x5c')]({'plain':!![]});var _0x3dd4fc=_0x9b3f('0x37');return db[_0x9b3f('0x5f')][_0x9b3f('0x58')]({'where':{'name':_0x3dd4fc,'userProfileId':_0x148197[_0x9b3f('0x60')]},'raw':!![]})[_0x9b3f('0x22')](function(_0x5c989f){if(_0x5c989f&&_0x5c989f[_0x9b3f('0x61')]===0x0){return db[_0x9b3f('0x38')][_0x9b3f('0x59')]({'name':_0xd793c[_0x9b3f('0x3c')],'resourceId':_0xd793c['id'],'type':_0x5c989f[_0x9b3f('0x3c')],'sectionId':_0x5c989f['id']},{})[_0x9b3f('0x22')](function(){return _0x3ebadf;});}else{return _0x3ebadf;}})[_0x9b3f('0x2c')](function(_0x14c89b){logger['error'](_0x9b3f('0x62'),_0x14c89b);throw _0x14c89b;});}return _0x3ebadf;})['then'](respondWithResult(_0x3078cf,0xc9))[_0x9b3f('0x2c')](handleError(_0x3078cf,null));};exports[_0x9b3f('0x35')]=function(_0xe8006d,_0x3ad4bc){if(_0xe8006d[_0x9b3f('0x5a')]['id']){delete _0xe8006d[_0x9b3f('0x5a')]['id'];}return db[_0x9b3f('0x51')][_0x9b3f('0x58')]({'where':{'id':_0xe8006d[_0x9b3f('0x56')]['id']}})[_0x9b3f('0x22')](handleEntityNotFound(_0x3ad4bc,null))['then'](saveUpdates(_0xe8006d[_0x9b3f('0x5a')],null))[_0x9b3f('0x22')](respondWithResult(_0x3ad4bc,null))[_0x9b3f('0x2c')](handleError(_0x3ad4bc,null));};exports[_0x9b3f('0x36')]=function(_0x1659d0,_0x552c45){return db[_0x9b3f('0x51')][_0x9b3f('0x58')]({'where':{'id':_0x1659d0['params']['id']}})[_0x9b3f('0x22')](handleEntityNotFound(_0x552c45,null))['then'](removeEntity(_0x552c45,null))['catch'](handleError(_0x552c45,null));};exports['describe']=function(_0x54f8f3,_0x433489){return db[_0x9b3f('0x51')]['describe']()['then'](respondWithResult(_0x433489,null))[_0x9b3f('0x2c')](handleError(_0x433489,null));};exports[_0x9b3f('0x63')]=function(_0x33f54e,_0x5abd58,_0x3a5055){var _0x5c7ee0={'raw':!![],'where':{}},_0x4b0575={},_0x4acab6;return db['ChatQueue']['findOne']({'where':{'id':_0x33f54e[_0x9b3f('0x56')]['id']}})[_0x9b3f('0x22')](handleEntityNotFound(_0x5abd58,null))[_0x9b3f('0x22')](function(_0x1bfaad){if(_0x1bfaad){_0x4acab6=_0x1bfaad[_0x9b3f('0x5c')]({'plain':!![]});_0x4b0575[_0x9b3f('0x43')]=_[_0x9b3f('0x57')](db['UserChatQueue'][_0x9b3f('0x40')]);_0x4b0575[_0x9b3f('0x44')]=_[_0x9b3f('0x57')](_0x33f54e[_0x9b3f('0x44')]);_0x4b0575[_0x9b3f('0x45')]=_['intersection'](_0x4b0575['model'],_0x4b0575[_0x9b3f('0x44')]);_0x5c7ee0[_0x9b3f('0x47')]=_['intersection'](_0x4b0575[_0x9b3f('0x43')],qs[_0x9b3f('0x64')](_0x33f54e[_0x9b3f('0x44')][_0x9b3f('0x64')]));_0x5c7ee0[_0x9b3f('0x47')]=_0x5c7ee0['attributes'][_0x9b3f('0x48')]?_0x5c7ee0[_0x9b3f('0x47')]:_0x4b0575[_0x9b3f('0x43')];if(!_0x33f54e[_0x9b3f('0x44')]['hasOwnProperty'](_0x9b3f('0x49'))){_0x5c7ee0[_0x9b3f('0x4a')]=qs[_0x9b3f('0x4a')](_0x33f54e['query'][_0x9b3f('0x4a')]);_0x5c7ee0['offset']=qs[_0x9b3f('0x30')](_0x33f54e[_0x9b3f('0x44')][_0x9b3f('0x30')]);}_0x5c7ee0[_0x9b3f('0x65')]=qs[_0x9b3f('0x4b')](_0x33f54e[_0x9b3f('0x44')][_0x9b3f('0x4b')]);_0x5c7ee0[_0x9b3f('0x4c')]=qs[_0x9b3f('0x45')](_[_0x9b3f('0x66')](_0x33f54e[_0x9b3f('0x44')],_0x4b0575[_0x9b3f('0x45')]));_0x5c7ee0[_0x9b3f('0x4c')][_0x9b3f('0x67')]=_0x1bfaad['id'];if(_0x33f54e[_0x9b3f('0x44')][_0x9b3f('0x4d')]){_0x5c7ee0['where']=_['merge'](_0x5c7ee0[_0x9b3f('0x4c')],{'$or':_[_0x9b3f('0x3f')](_0x5c7ee0[_0x9b3f('0x47')],function(_0xbb1af3){var _0x309b72={};_0x309b72[_0xbb1af3]={'$like':'%'+_0x33f54e[_0x9b3f('0x44')][_0x9b3f('0x4d')]+'%'};return _0x309b72;})});}_0x5c7ee0=_[_0x9b3f('0x4e')]({},_0x5c7ee0,_0x33f54e['options']);return db[_0x9b3f('0x68')][_0x9b3f('0x54')](_0x5c7ee0);}})[_0x9b3f('0x22')](function(_0x8cb3ad){if(_0x8cb3ad){return db[_0x9b3f('0x69')][_0x9b3f('0x6a')]({'where':{'id':_[_0x9b3f('0x3f')](_0x8cb3ad,_0x9b3f('0x6b')),'role':_0x9b3f('0x6c')},'attributes':['id','name',_0x9b3f('0x6d'),'updatedAt',_0x9b3f('0x6e')]});}})[_0x9b3f('0x22')](function(_0x582c06){if(_0x582c06){return{'count':_0x582c06[_0x9b3f('0x2f')],'rows':_[_0x9b3f('0x3f')](_0x582c06[_0x9b3f('0x55')],function(_0x10fcb9){return{'membername':_0x10fcb9[_0x9b3f('0x3c')],'UserId':_0x10fcb9['id'],'queue_name':_0x4acab6['name'],'ChatQueueId':_0x4acab6['id'],'interface':util[_0x9b3f('0x6f')](_0x9b3f('0x70'),_0x9b3f('0x71'),_0x10fcb9[_0x9b3f('0x3c')]),'penalty':0x0,'paused':_0x10fcb9[_0x9b3f('0x6d')],'createdAt':_0x10fcb9[_0x9b3f('0x6e')],'updatedAt':_0x10fcb9[_0x9b3f('0x72')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9b3f('0x22')](respondWithFilteredResult(_0x5abd58,_0x5c7ee0))[_0x9b3f('0x2c')](handleError(_0x5abd58,null));};exports['getTeams']=function(_0x71ddae,_0x4766f8,_0x401076){var _0x212aba={};var _0x2d983e={};var _0x3f11d8;var _0xb4cadc;return db[_0x9b3f('0x51')]['findOne']({'where':{'id':_0x71ddae[_0x9b3f('0x56')]['id']}})['then'](handleEntityNotFound(_0x4766f8,null))[_0x9b3f('0x22')](function(_0x5e2ba1){if(_0x5e2ba1){_0x3f11d8=_0x5e2ba1;_0x2d983e[_0x9b3f('0x43')]=_[_0x9b3f('0x57')](db['Team'][_0x9b3f('0x40')]);_0x2d983e[_0x9b3f('0x44')]=_[_0x9b3f('0x57')](_0x71ddae['query']);_0x2d983e['filters']=_[_0x9b3f('0x46')](_0x2d983e[_0x9b3f('0x43')],_0x2d983e[_0x9b3f('0x44')]);_0x212aba['attributes']=_['intersection'](_0x2d983e[_0x9b3f('0x43')],qs['fields'](_0x71ddae['query'][_0x9b3f('0x64')]));_0x212aba[_0x9b3f('0x47')]=_0x212aba[_0x9b3f('0x47')]['length']?_0x212aba['attributes']:_0x2d983e[_0x9b3f('0x43')];_0x212aba[_0x9b3f('0x65')]=qs['sort'](_0x71ddae['query'][_0x9b3f('0x4b')]);_0x212aba[_0x9b3f('0x4c')]=qs[_0x9b3f('0x45')](_[_0x9b3f('0x66')](_0x71ddae[_0x9b3f('0x44')],_0x2d983e[_0x9b3f('0x45')]));if(_0x71ddae[_0x9b3f('0x44')]['filter']){_0x212aba[_0x9b3f('0x4c')]=_['merge'](_0x212aba['where'],{'$or':_[_0x9b3f('0x3f')](_0x212aba[_0x9b3f('0x47')],function(_0x263985){var _0x21ab78={};_0x21ab78[_0x263985]={'$like':'%'+_0x71ddae[_0x9b3f('0x44')][_0x9b3f('0x4d')]+'%'};return _0x21ab78;})});}_0x212aba=_[_0x9b3f('0x4e')]({},_0x212aba,_0x71ddae['options']);return _0x3f11d8[_0x9b3f('0x73')](_0x212aba);}})[_0x9b3f('0x22')](function(_0x3d7696){if(_0x3d7696){_0xb4cadc=_0x3d7696[_0x9b3f('0x48')];if(!_0x71ddae[_0x9b3f('0x44')][_0x9b3f('0x74')]('nolimit')){_0x212aba[_0x9b3f('0x4a')]=qs[_0x9b3f('0x4a')](_0x71ddae['query']['limit']);_0x212aba[_0x9b3f('0x30')]=qs[_0x9b3f('0x30')](_0x71ddae[_0x9b3f('0x44')]['offset']);}return _0x3f11d8['getTeams'](_0x212aba);}})[_0x9b3f('0x22')](function(_0x40e0a0){if(_0x40e0a0){return _0x40e0a0?{'count':_0xb4cadc,'rows':_0x40e0a0}:null;}})['then'](respondWithResult(_0x4766f8,null))[_0x9b3f('0x2c')](handleError(_0x4766f8,null));};exports[_0x9b3f('0x75')]=function(_0x239b74,_0x48c7a1,_0x18bec4){var _0x1bbe79=_0x239b74[_0x9b3f('0x5a')][_0x9b3f('0x76')];return db[_0x9b3f('0x77')][_0x9b3f('0x54')]({'where':{'id':_0x1bbe79},'attributes':['id'],'include':[{'model':db[_0x9b3f('0x69')],'as':'Agents','attributes':['id',_0x9b3f('0x3c'),_0x9b3f('0x78'),_0x9b3f('0x79'),_0x9b3f('0x7a')],'raw':!![]}]})[_0x9b3f('0x22')](function(_0x369d8b){if(_0x369d8b){var _0x1fd3d6=_[_0x9b3f('0x7b')](_0x369d8b,function(_0xcd160e){var _0x3f36cf=_0xcd160e['get']({'plain':!![]});return _0x3f36cf['Agents'];});return db[_0x9b3f('0x51')][_0x9b3f('0x58')]({'where':{'id':_0x239b74[_0x9b3f('0x56')]['id']}})[_0x9b3f('0x22')](function(_0x7e5dce){return db[_0x9b3f('0x7c')]['transaction'](function(_0x4e5788){return _0x7e5dce[_0x9b3f('0x75')](_0x1bbe79,{'transaction':_0x4e5788})[_0x9b3f('0x22')](function(){return BPromise[_0x9b3f('0x7d')](_0x1fd3d6,function(_0x5078d3){return db['UserChatQueue'][_0x9b3f('0x7e')]({'where':{'UserId':_0x5078d3['id'],'ChatQueueId':_0x239b74['params']['id']},'transaction':_0x4e5788});});})[_0x9b3f('0x22')](function(){_0x1fd3d6[_0x9b3f('0x7f')](function(_0x2a482){socket['emit'](_0x9b3f('0x80'),{'UserId':_0x2a482['id'],'ChatQueueId':_0x7e5dce['id']});});});});});}})[_0x9b3f('0x22')](respondWithStatusCode(_0x48c7a1,null))['catch'](handleError(_0x48c7a1,null));};exports[_0x9b3f('0x81')]=function(_0x2b59b5,_0x5855c1,_0x52252f){return db['Team'][_0x9b3f('0x54')]({'where':{'id':_0x2b59b5[_0x9b3f('0x44')][_0x9b3f('0x76')]},'attributes':['id'],'include':[{'model':db[_0x9b3f('0x69')],'as':_0x9b3f('0x82'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5855c1,null))[_0x9b3f('0x22')](function(_0x1fea4f){var _0x4e584a=_[_0x9b3f('0x3f')](_0x1fea4f,'id');var _0x1e44c1=[];var _0x4174cb=[];var _0x4f9867=squel[_0x9b3f('0x83')]();_0x4f9867[_0x9b3f('0x84')](_0x9b3f('0x85'))[_0x9b3f('0x86')]('team_has_chat_queues','tq')[_0x9b3f('0x87')](_0x9b3f('0x88'),'ut',_0x9b3f('0x89'))[_0x9b3f('0x4c')](_0x9b3f('0x8a'),_0x2b59b5[_0x9b3f('0x56')]['id']);for(var _0x2ea654=0x0;_0x2ea654<_0x1fea4f[_0x9b3f('0x48')];_0x2ea654+=0x1){let _0x5c9029=_0x1fea4f[_0x2ea654];for(var _0x544988=0x0;_0x544988<_0x5c9029['Agents']['length'];_0x544988+=0x1){let _0x1bc2f4=_0x5c9029['Agents'][_0x544988];var _0x2763c5=_0x4f9867['clone']();_0x2763c5['where'](_0x9b3f('0x8b'),_0x1bc2f4['id']);_0x4174cb['push'](db[_0x9b3f('0x7c')][_0x9b3f('0x44')](_0x2763c5['toString'](),{'type':db['sequelize'][_0x9b3f('0x8c')][_0x9b3f('0x8d')]})[_0x9b3f('0x22')](function(_0x5b9420){if(_0x5b9420[_0x9b3f('0x48')]===0x1){return _0x1bc2f4['id'];}else{var _0xc03d6e=_['every'](_[_0x9b3f('0x3f')](_0x5b9420,_0x9b3f('0x8e')),function(_0x49c0ea){return _[_0x9b3f('0x8f')](_0x4e584a,_0x49c0ea);});if(_0xc03d6e){return _0x1bc2f4['id'];}}}));}}return BPromise[_0x9b3f('0x90')](_0x4174cb)[_0x9b3f('0x22')](function(_0x1fc038){_0x1e44c1=_(_0x1e44c1)['union'](_0x1fc038)['compact']()[_0x9b3f('0x91')]();return db['ChatQueue']['find']({'where':{'id':_0x2b59b5[_0x9b3f('0x56')]['id']}})['then'](function(_0x2d24a5){return db[_0x9b3f('0x7c')][_0x9b3f('0x92')](function(_0x3fab5c){return _0x2d24a5['removeTeams'](_0x2b59b5[_0x9b3f('0x44')][_0x9b3f('0x76')],{'transaction':_0x3fab5c})['then'](function(){if(!_[_0x9b3f('0x93')](_0x1e44c1)){return _0x2d24a5['removeAgents'](_0x1e44c1,{'transaction':_0x3fab5c});}})[_0x9b3f('0x22')](function(){_0x1e44c1[_0x9b3f('0x7f')](function(_0x25c21e){socket['emit'](_0x9b3f('0x94'),{'UserId':_0x25c21e,'ChatQueueId':_0x2d24a5['id']});});});});});});})[_0x9b3f('0x22')](respondWithStatusCode(_0x5855c1,null))[_0x9b3f('0x2c')](handleError(_0x5855c1,null));};exports[_0x9b3f('0x95')]=function(_0x2cedee,_0x357cc1,_0x2bbeb9){return db[_0x9b3f('0x51')][_0x9b3f('0x58')]({'where':{'id':_0x2cedee[_0x9b3f('0x56')]['id']}})[_0x9b3f('0x22')](handleEntityNotFound(_0x357cc1,null))[_0x9b3f('0x22')](function(_0xf47c7){if(_0xf47c7){return _0xf47c7[_0x9b3f('0x95')](_0x2cedee[_0x9b3f('0x5a')][_0x9b3f('0x76')],_[_0x9b3f('0x96')](_0x2cedee[_0x9b3f('0x5a')],[_0x9b3f('0x76'),'id'])||{})['spread'](function(_0x4fc957){for(var _0x5a4418=0x0;_0x5a4418<_0x2cedee[_0x9b3f('0x5a')]['ids'][_0x9b3f('0x48')];_0x5a4418+=0x1){socket[_0x9b3f('0x97')]('userChatQueue:save',{'UserId':_0x2cedee[_0x9b3f('0x5a')][_0x9b3f('0x76')][_0x5a4418],'ChatQueueId':_0x2cedee[_0x9b3f('0x56')]['id']});}return _0x4fc957;});}})[_0x9b3f('0x22')](respondWithResult(_0x357cc1,null))[_0x9b3f('0x2c')](handleError(_0x357cc1,null));};exports[_0x9b3f('0x98')]=function(_0x3ed188,_0x4a201f,_0xb8281a){return db[_0x9b3f('0x51')][_0x9b3f('0x58')]({'where':{'id':_0x3ed188[_0x9b3f('0x56')]['id']}})['then'](handleEntityNotFound(_0x4a201f,null))[_0x9b3f('0x22')](function(_0x42cb7e){if(_0x42cb7e){return _0x42cb7e[_0x9b3f('0x98')](_0x3ed188['query'][_0x9b3f('0x76')])['then'](function(){if(_['isArray'](_0x3ed188['query']['ids'])){for(var _0x532b4b=0x0;_0x532b4b<_0x3ed188['query']['ids'][_0x9b3f('0x48')];_0x532b4b+=0x1){socket[_0x9b3f('0x97')](_0x9b3f('0x94'),{'UserId':Number(_0x3ed188[_0x9b3f('0x44')][_0x9b3f('0x76')][_0x532b4b]),'ChatQueueId':Number(_0x3ed188[_0x9b3f('0x56')]['id'])});}}else{socket[_0x9b3f('0x97')](_0x9b3f('0x94'),{'UserId':Number(_0x3ed188[_0x9b3f('0x44')][_0x9b3f('0x76')]),'ChatQueueId':Number(_0x3ed188[_0x9b3f('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a201f,null))[_0x9b3f('0x2c')](handleError(_0x4a201f,null));};exports[_0x9b3f('0x99')]=function(_0x477af8,_0x3fc3e0,_0x5a8d5a){var _0x22028e={};var _0x156015={};var _0x473fe5;var _0x546c23;return db[_0x9b3f('0x51')][_0x9b3f('0x9a')]({'where':{'id':_0x477af8[_0x9b3f('0x56')]['id']}})['then'](handleEntityNotFound(_0x3fc3e0,null))[_0x9b3f('0x22')](function(_0x5a3218){if(_0x5a3218){_0x473fe5=_0x5a3218;_0x156015[_0x9b3f('0x43')]=_['keys'](db['User'][_0x9b3f('0x40')]);_0x156015[_0x9b3f('0x44')]=_[_0x9b3f('0x57')](_0x477af8[_0x9b3f('0x44')]);_0x156015[_0x9b3f('0x45')]=_[_0x9b3f('0x46')](_0x156015[_0x9b3f('0x43')],_0x156015[_0x9b3f('0x44')]);_0x22028e[_0x9b3f('0x47')]=_['intersection'](_0x156015[_0x9b3f('0x43')],qs[_0x9b3f('0x64')](_0x477af8[_0x9b3f('0x44')]['fields']));_0x22028e[_0x9b3f('0x47')]=_0x22028e[_0x9b3f('0x47')][_0x9b3f('0x48')]?_0x22028e[_0x9b3f('0x47')]:_0x156015[_0x9b3f('0x43')];_0x22028e[_0x9b3f('0x65')]=qs[_0x9b3f('0x4b')](_0x477af8['query'][_0x9b3f('0x4b')]);_0x22028e['where']=qs[_0x9b3f('0x45')](_[_0x9b3f('0x66')](_0x477af8[_0x9b3f('0x44')],_0x156015['filters']));if(_0x477af8[_0x9b3f('0x44')][_0x9b3f('0x4d')]){_0x22028e[_0x9b3f('0x4c')]=_[_0x9b3f('0x4e')](_0x22028e[_0x9b3f('0x4c')],{'$or':_['map'](_0x22028e[_0x9b3f('0x47')],function(_0x4d4927){var _0x1041f5={};_0x1041f5[_0x4d4927]={'$like':'%'+_0x477af8['query'][_0x9b3f('0x4d')]+'%'};return _0x1041f5;})});}_0x22028e=_[_0x9b3f('0x4e')]({},_0x22028e,_0x477af8['options']);return _0x473fe5[_0x9b3f('0x99')](_0x22028e);}})[_0x9b3f('0x22')](function(_0x494651){if(_0x494651){_0x546c23=_0x494651[_0x9b3f('0x48')];if(!_0x477af8[_0x9b3f('0x44')]['hasOwnProperty'](_0x9b3f('0x49'))){_0x22028e[_0x9b3f('0x4a')]=qs[_0x9b3f('0x4a')](_0x477af8[_0x9b3f('0x44')][_0x9b3f('0x4a')]);_0x22028e['offset']=qs[_0x9b3f('0x30')](_0x477af8['query'][_0x9b3f('0x30')]);}return _0x473fe5[_0x9b3f('0x99')](_0x22028e);}})[_0x9b3f('0x22')](function(_0x280bc0){if(_0x280bc0){return _0x280bc0?{'count':_0x546c23,'rows':_0x280bc0}:null;}})[_0x9b3f('0x22')](respondWithResult(_0x3fc3e0,null))[_0x9b3f('0x2c')](handleError(_0x3fc3e0,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index ab1382c..cedd40c 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 _0xbaf0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x31db70,_0x62d245){var _0x5623a4=function(_0x13ae49){while(--_0x13ae49){_0x31db70['push'](_0x31db70['shift']());}};_0x5623a4(++_0x62d245);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0baf('0x0'))['db'][_0x0baf('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0baf('0x2')](0x0);var events={'afterCreate':_0x0baf('0x3'),'afterUpdate':_0x0baf('0x4'),'afterDestroy':_0x0baf('0x5')};function emitEvent(_0x5a3e42){return function(_0x232cc7,_0x1c383e,_0x2d3fa5){ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42+':'+_0x232cc7['id'],_0x232cc7);ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42,_0x232cc7);_0x2d3fa5(null);};}for(var e in events){if(events[_0x0baf('0x7')](e)){var event=events[e];ChatQueue[_0x0baf('0x8')](e,emitEvent(event));}}module[_0x0baf('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x28065c,_0x3c43b9){var _0x37e908=function(_0x5485e4){while(--_0x5485e4){_0x28065c['push'](_0x28065c['shift']());}};_0x37e908(++_0x3c43b9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x83aa1a,_0x54c5cb){_0x83aa1a=_0x83aa1a-0x0;var _0x162dcb=_0x5f2f[_0x83aa1a];return _0x162dcb;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 1e847aa..432eabd 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 _0x12d8=['ChatQueue','chat_queues','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x12d8,0x152));var _0x812d=function(_0x170877,_0x1c70ee){_0x170877=_0x170877-0x0;var _0xd0b12d=_0x12d8[_0x170877];return _0xd0b12d;};'use strict';var _=require(_0x812d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x812d('0x1'));var moment=require(_0x812d('0x2'));var BPromise=require(_0x812d('0x3'));var rp=require(_0x812d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x812d('0x5'));var config=require(_0x812d('0x6'));var attributes=require(_0x812d('0x7'));module[_0x812d('0x8')]=function(_0x539003,_0x52359d){return _0x539003[_0x812d('0x9')](_0x812d('0xa'),attributes,{'tableName':_0x812d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe1d=['../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x5257c0,_0xc2e255){var _0x5677a6=function(_0x10f09c){while(--_0x10f09c){_0x5257c0['push'](_0x5257c0['shift']());}};_0x5677a6(++_0xc2e255);}(_0xbe1d,0xd1));var _0xdbe1=function(_0x31520d,_0x50046a){_0x31520d=_0x31520d-0x0;var _0x4d0d26=_0xbe1d[_0x31520d];return _0x4d0d26;};'use strict';var _=require(_0xdbe1('0x0'));var util=require(_0xdbe1('0x1'));var logger=require(_0xdbe1('0x2'))('api');var moment=require(_0xdbe1('0x3'));var BPromise=require('bluebird');var rp=require(_0xdbe1('0x4'));var fs=require('fs');var path=require(_0xdbe1('0x5'));var rimraf=require(_0xdbe1('0x6'));var config=require(_0xdbe1('0x7'));var attributes=require(_0xdbe1('0x8'));module['exports']=function(_0x5a39a2,_0x591ebf){return _0x5a39a2[_0xdbe1('0x9')](_0xdbe1('0xa'),attributes,{'tableName':_0xdbe1('0xb'),'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 9ea901a..e421b5c 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 _0x9399=['options','raw','where','limit','include','map','model','attributes','ShowChatQueue','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetChatQueue','ChatQueue'];(function(_0x47da22,_0x5f48f1){var _0xbd7ef3=function(_0x119667){while(--_0x119667){_0x47da22['push'](_0x47da22['shift']());}};_0xbd7ef3(++_0x5f48f1);}(_0x9399,0x131));var _0x9939=function(_0x408dd9,_0x2cd63d){_0x408dd9=_0x408dd9-0x0;var _0x40f209=_0x9399[_0x408dd9];return _0x40f209;};'use strict';var _=require(_0x9939('0x0'));var util=require(_0x9939('0x1'));var moment=require(_0x9939('0x2'));var BPromise=require(_0x9939('0x3'));var rs=require(_0x9939('0x4'));var fs=require('fs');var Redis=require(_0x9939('0x5'));var db=require(_0x9939('0x6'))['db'];var utils=require(_0x9939('0x7'));var logger=require(_0x9939('0x8'))(_0x9939('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9939('0xa')][_0x9939('0xb')]({'port':0x232a});config['redis']=_[_0x9939('0xc')](config['redis'],{'host':_0x9939('0xd'),'port':0x18eb});var socket=require(_0x9939('0xe'))(new Redis(config[_0x9939('0xf')]));require(_0x9939('0x10'))[_0x9939('0x11')](socket);function respondWithRpcPromise(_0xab5c6a,_0x3ab585,_0x3e95fd){return new BPromise(function(_0x262567,_0x37a9c4){return client[_0x9939('0x12')](_0xab5c6a,_0x3e95fd)[_0x9939('0x13')](function(_0x54f3b7){logger[_0x9939('0x14')](_0x9939('0x15'),_0x3ab585,_0x9939('0x16'));logger[_0x9939('0x17')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3ab585,_0x9939('0x16'),JSON[_0x9939('0x18')](_0x54f3b7));if(_0x54f3b7[_0x9939('0x19')]){if(_0x54f3b7[_0x9939('0x19')][_0x9939('0x1a')]===0x1f4){logger[_0x9939('0x19')](_0x9939('0x15'),_0x3ab585,_0x54f3b7[_0x9939('0x19')][_0x9939('0x1b')]);return _0x37a9c4(_0x54f3b7[_0x9939('0x19')]['message']);}logger[_0x9939('0x19')]('ChatQueue,\x20%s,\x20%s',_0x3ab585,_0x54f3b7[_0x9939('0x19')][_0x9939('0x1b')]);return _0x262567(_0x54f3b7['error']['message']);}else{logger[_0x9939('0x14')]('ChatQueue,\x20%s,\x20%s',_0x3ab585,_0x9939('0x16'));_0x262567(_0x54f3b7[_0x9939('0x1c')][_0x9939('0x1b')]);}})['catch'](function(_0x4e0308){logger[_0x9939('0x19')]('ChatQueue,\x20%s,\x20%s',_0x3ab585,_0x4e0308);_0x37a9c4(_0x4e0308);});});}exports[_0x9939('0x1d')]=function(_0x12a27c){var _0x26774d=this;return new Promise(function(_0x16fbf7,_0x6fff2){return db[_0x9939('0x1e')]['findAll']({'raw':_0x12a27c[_0x9939('0x1f')]?_0x12a27c[_0x9939('0x1f')][_0x9939('0x20')]===undefined?!![]:![]:!![],'where':_0x12a27c[_0x9939('0x1f')]?_0x12a27c[_0x9939('0x1f')][_0x9939('0x21')]||null:null,'attributes':_0x12a27c[_0x9939('0x1f')]?_0x12a27c[_0x9939('0x1f')]['attributes']||null:null,'limit':_0x12a27c[_0x9939('0x1f')]?_0x12a27c['options'][_0x9939('0x22')]||null:null,'include':_0x12a27c[_0x9939('0x1f')]?_0x12a27c[_0x9939('0x1f')][_0x9939('0x23')]?_[_0x9939('0x24')](_0x12a27c[_0x9939('0x1f')][_0x9939('0x23')],function(_0x5d6811){return{'model':db[_0x5d6811[_0x9939('0x25')]],'as':_0x5d6811['as'],'attributes':_0x5d6811[_0x9939('0x26')],'include':_0x5d6811[_0x9939('0x23')]?_[_0x9939('0x24')](_0x5d6811['include'],function(_0x2ec48d){return{'model':db[_0x2ec48d['model']],'as':_0x2ec48d['as'],'attributes':_0x2ec48d[_0x9939('0x26')],'include':_0x2ec48d[_0x9939('0x23')]?_[_0x9939('0x24')](_0x2ec48d['include'],function(_0x3daf1b){return{'model':db[_0x3daf1b[_0x9939('0x25')]],'as':_0x3daf1b['as'],'attributes':_0x3daf1b['attributes']};}):[]};}):[]};}):[]:[]})[_0x9939('0x13')](function(_0x32447d){logger[_0x9939('0x14')](_0x9939('0x1d'),_0x12a27c);logger['debug'](_0x9939('0x1d'),_0x12a27c,JSON[_0x9939('0x18')](_0x32447d));_0x16fbf7(_0x32447d);})['catch'](function(_0x1fbd17){logger[_0x9939('0x19')](_0x9939('0x1d'),_0x1fbd17[_0x9939('0x1b')],_0x12a27c);_0x6fff2(_0x26774d[_0x9939('0x19')](0x1f4,_0x1fbd17['message']));});});};exports[_0x9939('0x27')]=function(_0x300d93){var _0x2c7cf7=this;return new Promise(function(_0x25b082,_0x397439){return db[_0x9939('0x1e')][_0x9939('0x28')]({'raw':_0x300d93[_0x9939('0x1f')]?_0x300d93['options'][_0x9939('0x20')]===undefined?!![]:![]:!![],'where':_0x300d93[_0x9939('0x1f')]?_0x300d93[_0x9939('0x1f')][_0x9939('0x21')]||null:null,'attributes':_0x300d93['options']?_0x300d93[_0x9939('0x1f')]['attributes']||null:null,'include':_0x300d93['options']?_0x300d93[_0x9939('0x1f')][_0x9939('0x23')]?_[_0x9939('0x24')](_0x300d93[_0x9939('0x1f')][_0x9939('0x23')],function(_0x1ff91e){return{'model':db[_0x1ff91e['model']],'as':_0x1ff91e['as'],'attributes':_0x1ff91e[_0x9939('0x26')],'include':_0x1ff91e[_0x9939('0x23')]?_[_0x9939('0x24')](_0x1ff91e[_0x9939('0x23')],function(_0x8b2603){return{'model':db[_0x8b2603[_0x9939('0x25')]],'as':_0x8b2603['as'],'attributes':_0x8b2603['attributes'],'include':_0x8b2603[_0x9939('0x23')]?_['map'](_0x8b2603[_0x9939('0x23')],function(_0x5c3802){return{'model':db[_0x5c3802[_0x9939('0x25')]],'as':_0x5c3802['as'],'attributes':_0x5c3802['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x223f47){logger[_0x9939('0x14')](_0x9939('0x27'),_0x300d93);logger[_0x9939('0x17')]('ShowChatQueue',_0x300d93,JSON[_0x9939('0x18')](_0x223f47));_0x25b082(_0x223f47);})[_0x9939('0x29')](function(_0x295240){logger[_0x9939('0x19')](_0x9939('0x27'),_0x295240['message'],_0x300d93);_0x397439(_0x2c7cf7['error'](0x1f4,_0x295240[_0x9939('0x1b')]));});});}; \ No newline at end of file +var _0x1f81=['where','include','map','attributes','model','ShowChatQueue','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x1f81,0xab));var _0x11f8=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0x1f81[_0x5d9867];return _0x7d2118;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var moment=require('moment');var BPromise=require(_0x11f8('0x2'));var rs=require(_0x11f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11f8('0x4'))['db'];var utils=require(_0x11f8('0x5'));var logger=require(_0x11f8('0x6'))(_0x11f8('0x7'));var config=require(_0x11f8('0x8'));var jayson=require(_0x11f8('0x9'));var client=jayson[_0x11f8('0xa')][_0x11f8('0xb')]({'port':0x232a});config['redis']=_[_0x11f8('0xc')](config[_0x11f8('0xd')],{'host':_0x11f8('0xe'),'port':0x18eb});var socket=require(_0x11f8('0xf'))(new Redis(config[_0x11f8('0xd')]));require(_0x11f8('0x10'))[_0x11f8('0x11')](socket);function respondWithRpcPromise(_0x46241e,_0xf7ae38,_0xb830f9){return new BPromise(function(_0x305ee9,_0x5e3dbd){return client[_0x11f8('0x12')](_0x46241e,_0xb830f9)[_0x11f8('0x13')](function(_0x13f6ad){logger[_0x11f8('0x14')](_0x11f8('0x15'),_0xf7ae38,_0x11f8('0x16'));logger['debug'](_0x11f8('0x17'),_0xf7ae38,_0x11f8('0x16'),JSON[_0x11f8('0x18')](_0x13f6ad));if(_0x13f6ad['error']){if(_0x13f6ad[_0x11f8('0x19')][_0x11f8('0x1a')]===0x1f4){logger[_0x11f8('0x19')](_0x11f8('0x15'),_0xf7ae38,_0x13f6ad['error'][_0x11f8('0x1b')]);return _0x5e3dbd(_0x13f6ad[_0x11f8('0x19')][_0x11f8('0x1b')]);}logger[_0x11f8('0x19')](_0x11f8('0x15'),_0xf7ae38,_0x13f6ad['error'][_0x11f8('0x1b')]);return _0x305ee9(_0x13f6ad[_0x11f8('0x19')]['message']);}else{logger[_0x11f8('0x14')]('ChatQueue,\x20%s,\x20%s',_0xf7ae38,_0x11f8('0x16'));_0x305ee9(_0x13f6ad[_0x11f8('0x1c')][_0x11f8('0x1b')]);}})[_0x11f8('0x1d')](function(_0x128e38){logger[_0x11f8('0x19')](_0x11f8('0x15'),_0xf7ae38,_0x128e38);_0x5e3dbd(_0x128e38);});});}exports[_0x11f8('0x1e')]=function(_0xe57a23){var _0x1bee48=this;return new Promise(function(_0x1548fc,_0x1a551d){return db[_0x11f8('0x1f')][_0x11f8('0x20')]({'raw':_0xe57a23[_0x11f8('0x21')]?_0xe57a23['options']['raw']===undefined?!![]:![]:!![],'where':_0xe57a23['options']?_0xe57a23[_0x11f8('0x21')][_0x11f8('0x22')]||null:null,'attributes':_0xe57a23[_0x11f8('0x21')]?_0xe57a23[_0x11f8('0x21')]['attributes']||null:null,'limit':_0xe57a23[_0x11f8('0x21')]?_0xe57a23[_0x11f8('0x21')]['limit']||null:null,'include':_0xe57a23[_0x11f8('0x21')]?_0xe57a23[_0x11f8('0x21')][_0x11f8('0x23')]?_[_0x11f8('0x24')](_0xe57a23[_0x11f8('0x21')][_0x11f8('0x23')],function(_0x23e1fa){return{'model':db[_0x23e1fa['model']],'as':_0x23e1fa['as'],'attributes':_0x23e1fa[_0x11f8('0x25')],'include':_0x23e1fa['include']?_[_0x11f8('0x24')](_0x23e1fa[_0x11f8('0x23')],function(_0x2d381d){return{'model':db[_0x2d381d['model']],'as':_0x2d381d['as'],'attributes':_0x2d381d[_0x11f8('0x25')],'include':_0x2d381d[_0x11f8('0x23')]?_[_0x11f8('0x24')](_0x2d381d[_0x11f8('0x23')],function(_0x5f2ce6){return{'model':db[_0x5f2ce6[_0x11f8('0x26')]],'as':_0x5f2ce6['as'],'attributes':_0x5f2ce6['attributes']};}):[]};}):[]};}):[]:[]})[_0x11f8('0x13')](function(_0x21c09b){logger[_0x11f8('0x14')]('GetChatQueue',_0xe57a23);logger['debug'](_0x11f8('0x1e'),_0xe57a23,JSON['stringify'](_0x21c09b));_0x1548fc(_0x21c09b);})[_0x11f8('0x1d')](function(_0x48a7ad){logger['error'](_0x11f8('0x1e'),_0x48a7ad['message'],_0xe57a23);_0x1a551d(_0x1bee48[_0x11f8('0x19')](0x1f4,_0x48a7ad[_0x11f8('0x1b')]));});});};exports['ShowChatQueue']=function(_0x37eec1){var _0x582a0b=this;return new Promise(function(_0x37d917,_0x5269ce){return db['ChatQueue']['find']({'raw':_0x37eec1[_0x11f8('0x21')]?_0x37eec1['options']['raw']===undefined?!![]:![]:!![],'where':_0x37eec1[_0x11f8('0x21')]?_0x37eec1[_0x11f8('0x21')][_0x11f8('0x22')]||null:null,'attributes':_0x37eec1[_0x11f8('0x21')]?_0x37eec1['options']['attributes']||null:null,'include':_0x37eec1['options']?_0x37eec1['options'][_0x11f8('0x23')]?_[_0x11f8('0x24')](_0x37eec1[_0x11f8('0x21')][_0x11f8('0x23')],function(_0x4c6ba0){return{'model':db[_0x4c6ba0[_0x11f8('0x26')]],'as':_0x4c6ba0['as'],'attributes':_0x4c6ba0[_0x11f8('0x25')],'include':_0x4c6ba0[_0x11f8('0x23')]?_[_0x11f8('0x24')](_0x4c6ba0[_0x11f8('0x23')],function(_0x5daac5){return{'model':db[_0x5daac5['model']],'as':_0x5daac5['as'],'attributes':_0x5daac5[_0x11f8('0x25')],'include':_0x5daac5[_0x11f8('0x23')]?_[_0x11f8('0x24')](_0x5daac5[_0x11f8('0x23')],function(_0x53deb1){return{'model':db[_0x53deb1['model']],'as':_0x53deb1['as'],'attributes':_0x53deb1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d6e92){logger[_0x11f8('0x14')](_0x11f8('0x27'),_0x37eec1);logger[_0x11f8('0x28')](_0x11f8('0x27'),_0x37eec1,JSON[_0x11f8('0x18')](_0x4d6e92));_0x37d917(_0x4d6e92);})['catch'](function(_0x51a9a1){logger[_0x11f8('0x19')](_0x11f8('0x27'),_0x51a9a1[_0x11f8('0x1b')],_0x37eec1);_0x5269ce(_0x582a0b['error'](0x1f4,_0x51a9a1['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 7a0bce8..170e9a6 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x779496,_0x9b0b0b){var _0x472493=function(_0x18db79){while(--_0x18db79){_0x779496['push'](_0x779496['shift']());}};_0x472493(++_0x9b0b0b);}(_0xb10b,0x12a));var _0xbb10=function(_0x38b1fe,_0x53aedb){_0x38b1fe=_0x38b1fe-0x0;var _0x1b3f86=_0xb10b[_0x38b1fe];return _0x1b3f86;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x3c28e7,_0x169024){var _0x557b3a=function(_0x42bf71){while(--_0x42bf71){_0x3c28e7['push'](_0x3c28e7['shift']());}};_0x557b3a(++_0x169024);}(_0x5f2f,0x73));var _0xf5f2=function(_0x368fb5,_0x4aad39){_0x368fb5=_0x368fb5-0x0;var _0x3ccee6=_0x5f2f[_0x368fb5];return _0x3ccee6;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 7494858..16b9f5e 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 _0x9f92=['path','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer'];(function(_0x3bc770,_0x4e78af){var _0x531aa2=function(_0x23e91a){while(--_0x23e91a){_0x3bc770['push'](_0x3bc770['shift']());}};_0x531aa2(++_0x4e78af);}(_0x9f92,0xf2));var _0x29f9=function(_0x4dc0c8,_0x48d51f){_0x4dc0c8=_0x4dc0c8-0x0;var _0x26bf81=_0x9f92[_0x4dc0c8];return _0x26bf81;};'use strict';var multer=require(_0x29f9('0x0'));var util=require('util');var path=require(_0x29f9('0x1'));var timeout=require('connect-timeout');var express=require(_0x29f9('0x2'));var router=express[_0x29f9('0x3')]();var auth=require(_0x29f9('0x4'));var interaction=require(_0x29f9('0x5'));var config=require('../../config/environment');var controller=require(_0x29f9('0x6'));router[_0x29f9('0x7')]('/',auth[_0x29f9('0x8')](),controller[_0x29f9('0x9')]);router[_0x29f9('0x7')]('/describe',auth[_0x29f9('0x8')](),controller[_0x29f9('0xa')]);router[_0x29f9('0x7')](_0x29f9('0xb'),auth[_0x29f9('0x8')](),controller['show']);router[_0x29f9('0x7')](_0x29f9('0xc'),auth[_0x29f9('0x8')](),controller['getMembers']);router[_0x29f9('0x7')](_0x29f9('0xd'),auth['isAuthenticated'](),controller[_0x29f9('0xe')]);router[_0x29f9('0x7')]('/:id/users',auth[_0x29f9('0x8')](),controller[_0x29f9('0xf')]);router[_0x29f9('0x10')]('/',auth[_0x29f9('0x8')](),controller['create']);router['post'](_0x29f9('0xd'),auth[_0x29f9('0x8')](),controller[_0x29f9('0x11')]);router[_0x29f9('0x10')](_0x29f9('0x12'),auth[_0x29f9('0x8')](),controller[_0x29f9('0x13')]);router[_0x29f9('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x29f9('0x15')]);router[_0x29f9('0x16')](_0x29f9('0xb'),auth[_0x29f9('0x8')](),controller[_0x29f9('0x17')]);router[_0x29f9('0x16')](_0x29f9('0xd'),auth[_0x29f9('0x8')](),controller[_0x29f9('0x18')]);router['delete'](_0x29f9('0x12'),auth[_0x29f9('0x8')](),controller[_0x29f9('0x19')]);module[_0x29f9('0x1a')]=router; \ No newline at end of file +var _0x65db=['index','/describe','isAuthenticated','describe','/:id','/:id/teams','getTeams','getAgents','post','create','addTeams','addAgents','put','delete','destroy','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get'];(function(_0x37e961,_0x457dba){var _0x5862b5=function(_0x3a0d85){while(--_0x3a0d85){_0x37e961['push'](_0x37e961['shift']());}};_0x5862b5(++_0x457dba);}(_0x65db,0x1a7));var _0xb65d=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x65db[_0x411add];return _0x238242;};'use strict';var multer=require(_0xb65d('0x0'));var util=require('util');var path=require(_0xb65d('0x1'));var timeout=require(_0xb65d('0x2'));var express=require(_0xb65d('0x3'));var router=express['Router']();var auth=require(_0xb65d('0x4'));var interaction=require(_0xb65d('0x5'));var config=require(_0xb65d('0x6'));var controller=require(_0xb65d('0x7'));router[_0xb65d('0x8')]('/',auth['isAuthenticated'](),controller[_0xb65d('0x9')]);router[_0xb65d('0x8')](_0xb65d('0xa'),auth[_0xb65d('0xb')](),controller[_0xb65d('0xc')]);router['get'](_0xb65d('0xd'),auth[_0xb65d('0xb')](),controller['show']);router[_0xb65d('0x8')]('/:id/members',auth[_0xb65d('0xb')](),controller['getMembers']);router[_0xb65d('0x8')](_0xb65d('0xe'),auth[_0xb65d('0xb')](),controller[_0xb65d('0xf')]);router[_0xb65d('0x8')]('/:id/users',auth[_0xb65d('0xb')](),controller[_0xb65d('0x10')]);router[_0xb65d('0x11')]('/',auth['isAuthenticated'](),controller[_0xb65d('0x12')]);router[_0xb65d('0x11')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb65d('0x13')]);router[_0xb65d('0x11')]('/:id/users',auth[_0xb65d('0xb')](),controller[_0xb65d('0x14')]);router[_0xb65d('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb65d('0x16')](_0xb65d('0xd'),auth[_0xb65d('0xb')](),controller[_0xb65d('0x17')]);router[_0xb65d('0x16')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xb65d('0x16')](_0xb65d('0x18'),auth[_0xb65d('0xb')](),controller[_0xb65d('0x19')]);module[_0xb65d('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 d1cb67c..7cac592 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 _0x03d2=['exports','DATE','STRING','moment','sequelize'];(function(_0x4ebb47,_0x2890ac){var _0x29ba7a=function(_0x58c44c){while(--_0x58c44c){_0x4ebb47['push'](_0x4ebb47['shift']());}};_0x29ba7a(++_0x2890ac);}(_0x03d2,0x8a));var _0x203d=function(_0x289240,_0x21b6e8){_0x289240=_0x289240-0x0;var _0x771cac=_0x03d2[_0x289240];return _0x771cac;};'use strict';var moment=require(_0x203d('0x0'));var Sequelize=require(_0x203d('0x1'));module[_0x203d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x203d('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x203d('0x4')]}}; \ No newline at end of file +var _0x4ea6=['DATE','sequelize','STRING'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x4ea6,0x19c));var _0x64ea=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x4ea6[_0x587dd0];return _0x56f153;};'use strict';var moment=require('moment');var Sequelize=require(_0x64ea('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x64ea('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x64ea('0x1')]},'joinAt':{'type':Sequelize[_0x64ea('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x64ea('0x2')]},'exitAt':{'type':Sequelize[_0x64ea('0x2')]},'reason':{'type':Sequelize[_0x64ea('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 2ffc23b..22efb7e 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 _0x92d5=['apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range'];(function(_0x29962d,_0x3ae2c3){var _0x4f9aa7=function(_0x4251b1){while(--_0x4251b1){_0x29962d['push'](_0x29962d['shift']());}};_0x4f9aa7(++_0x3ae2c3);}(_0x92d5,0x115));var _0x592d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x92d5[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x592d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x592d('0x1'));var rp=require(_0x592d('0x2'));var moment=require(_0x592d('0x3'));var BPromise=require(_0x592d('0x4'));var Mustache=require(_0x592d('0x5'));var util=require(_0x592d('0x6'));var path=require(_0x592d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x592d('0x8'));var fs=require('fs');var _=require(_0x592d('0x9'));var squel=require(_0x592d('0xa'));var crypto=require(_0x592d('0xb'));var jsforce=require(_0x592d('0xc'));var deskjs=require(_0x592d('0xd'));var toCsv=require(_0x592d('0xe'));var querystring=require(_0x592d('0xf'));var Papa=require(_0x592d('0x10'));var Redis=require(_0x592d('0x11'));var authService=require(_0x592d('0x12'));var qs=require(_0x592d('0x13'));var as=require(_0x592d('0x14'));var hardwareService=require(_0x592d('0x15'));var logger=require(_0x592d('0x16'))(_0x592d('0x17'));var utils=require(_0x592d('0x18'));var config=require(_0x592d('0x19'));var db=require(_0x592d('0x1a'))['db'];function respondWithStatusCode(_0x3d8158,_0x5c9058){_0x5c9058=_0x5c9058||0xcc;return function(_0x1e0bd1){if(_0x1e0bd1){return _0x3d8158[_0x592d('0x1b')](_0x5c9058);}return _0x3d8158[_0x592d('0x1c')](_0x5c9058)[_0x592d('0x1d')]();};}function respondWithResult(_0x3a79b8,_0x37c91a){_0x37c91a=_0x37c91a||0xc8;return function(_0x480b8c){if(_0x480b8c){return _0x3a79b8[_0x592d('0x1c')](_0x37c91a)[_0x592d('0x1e')](_0x480b8c);}};}function respondWithFilteredResult(_0x1cd80b,_0x45ea5a){return function(_0x421d8a){if(_0x421d8a){var _0x3ccaa6=_0x421d8a[_0x592d('0x1f')],_0x9f672b=_0x45ea5a['offset'],_0x55fa68=_0x45ea5a['offset']+_0x45ea5a[_0x592d('0x20')],_0x4c0940;if(_0x55fa68>=_0x3ccaa6){_0x55fa68=_0x3ccaa6;_0x4c0940=0xc8;}else{_0x4c0940=0xce;}_0x1cd80b[_0x592d('0x1c')](_0x4c0940);return _0x1cd80b[_0x592d('0x21')](_0x592d('0x22'),_0x9f672b+'-'+_0x55fa68+'/'+_0x3ccaa6)[_0x592d('0x1e')](_0x421d8a);}return null;};}function patchUpdates(_0x166a74){return function(_0x1e2427){try{jsonpatch[_0x592d('0x23')](_0x1e2427,_0x166a74,!![]);}catch(_0x5692a8){return BPromise[_0x592d('0x24')](_0x5692a8);}return _0x1e2427[_0x592d('0x25')]();};}function saveUpdates(_0x594c85,_0x142e8b){return function(_0x3e1124){if(_0x3e1124){return _0x3e1124[_0x592d('0x26')](_0x594c85)[_0x592d('0x27')](function(_0x383332){return _0x383332;});}return null;};}function removeEntity(_0x2475ce,_0x149db1){return function(_0x2b2b71){if(_0x2b2b71){return _0x2b2b71[_0x592d('0x28')]()[_0x592d('0x27')](function(){_0x2475ce[_0x592d('0x1c')](0xcc)[_0x592d('0x1d')]();});}};}function handleEntityNotFound(_0x5ed6f9,_0x48e208){return function(_0x5e55c3){if(!_0x5e55c3){_0x5ed6f9[_0x592d('0x1b')](0x194);}return _0x5e55c3;};}function handleError(_0x513414,_0x2fede8){_0x2fede8=_0x2fede8||0x1f4;return function(_0x1c2c0a){logger[_0x592d('0x29')](_0x1c2c0a[_0x592d('0x2a')]);if(_0x1c2c0a[_0x592d('0x2b')]){delete _0x1c2c0a[_0x592d('0x2b')];}_0x513414['status'](_0x2fede8)[_0x592d('0x2c')](_0x1c2c0a);};}exports['index']=function(_0x48fa2b,_0x48bf98){var _0x40ad0d={},_0x142149={},_0x13be5d={'count':0x0,'rows':[]};var _0x2dc20a=_[_0x592d('0x2d')](db[_0x592d('0x2e')][_0x592d('0x2f')],function(_0x54d2e5){return{'name':_0x54d2e5[_0x592d('0x30')],'type':_0x54d2e5['type'][_0x592d('0x31')]};});_0x142149[_0x592d('0x32')]=_[_0x592d('0x2d')](_0x2dc20a,'name');_0x142149[_0x592d('0x33')]=_['keys'](_0x48fa2b[_0x592d('0x33')]);_0x142149[_0x592d('0x34')]=_[_0x592d('0x35')](_0x142149[_0x592d('0x32')],_0x142149['query']);_0x40ad0d['attributes']=_[_0x592d('0x35')](_0x142149[_0x592d('0x32')],qs['fields'](_0x48fa2b['query'][_0x592d('0x36')]));_0x40ad0d[_0x592d('0x37')]=_0x40ad0d['attributes'][_0x592d('0x38')]?_0x40ad0d[_0x592d('0x37')]:_0x142149[_0x592d('0x32')];if(!_0x48fa2b[_0x592d('0x33')][_0x592d('0x39')](_0x592d('0x3a'))){_0x40ad0d[_0x592d('0x20')]=qs[_0x592d('0x20')](_0x48fa2b[_0x592d('0x33')][_0x592d('0x20')]);_0x40ad0d['offset']=qs[_0x592d('0x3b')](_0x48fa2b['query'][_0x592d('0x3b')]);}_0x40ad0d['order']=qs[_0x592d('0x3c')](_0x48fa2b[_0x592d('0x33')]['sort']);_0x40ad0d[_0x592d('0x3d')]=qs[_0x592d('0x34')](_[_0x592d('0x3e')](_0x48fa2b[_0x592d('0x33')],_0x142149[_0x592d('0x34')]));if(_0x48fa2b[_0x592d('0x33')]['filter']){_0x40ad0d[_0x592d('0x3d')]=_['merge'](_0x40ad0d[_0x592d('0x3d')],{'$or':_[_0x592d('0x2d')](_0x2dc20a,function(_0x28ab57){if(_0x28ab57[_0x592d('0x3f')]!==_0x592d('0x40')){var _0x28314d={};_0x28314d[_0x28ab57[_0x592d('0x2b')]]={'$like':'%'+_0x48fa2b[_0x592d('0x33')]['filter']+'%'};return _0x28314d;}})});}_0x40ad0d=_[_0x592d('0x41')]({},_0x40ad0d,_0x48fa2b['options']);var _0x63412a={'where':_0x40ad0d['where']};return db['ChatQueueReport'][_0x592d('0x1f')](_0x63412a)['then'](function(_0x2c8b40){_0x13be5d[_0x592d('0x1f')]=_0x2c8b40;if(_0x48fa2b['query'][_0x592d('0x42')]){_0x40ad0d[_0x592d('0x43')]=[{'all':!![]}];}return db[_0x592d('0x2e')][_0x592d('0x44')](_0x40ad0d);})['then'](function(_0x23e7dd){_0x13be5d[_0x592d('0x45')]=_0x23e7dd;return _0x13be5d;})[_0x592d('0x27')](respondWithFilteredResult(_0x48bf98,_0x40ad0d))[_0x592d('0x46')](handleError(_0x48bf98,null));};exports[_0x592d('0x47')]=function(_0x57d789,_0x5cb574){var _0x2be96b={'raw':!![],'where':{'id':_0x57d789[_0x592d('0x48')]['id']}},_0xa2bf83={};_0xa2bf83[_0x592d('0x32')]=_[_0x592d('0x49')](db[_0x592d('0x2e')][_0x592d('0x2f')]);_0xa2bf83[_0x592d('0x33')]=_[_0x592d('0x49')](_0x57d789[_0x592d('0x33')]);_0xa2bf83['filters']=_[_0x592d('0x35')](_0xa2bf83['model'],_0xa2bf83['query']);_0x2be96b[_0x592d('0x37')]=_[_0x592d('0x35')](_0xa2bf83[_0x592d('0x32')],qs[_0x592d('0x36')](_0x57d789[_0x592d('0x33')][_0x592d('0x36')]));_0x2be96b[_0x592d('0x37')]=_0x2be96b[_0x592d('0x37')][_0x592d('0x38')]?_0x2be96b[_0x592d('0x37')]:_0xa2bf83[_0x592d('0x32')];if(_0x57d789['query']['includeAll']){_0x2be96b[_0x592d('0x43')]=[{'all':!![]}];}_0x2be96b=_[_0x592d('0x41')]({},_0x2be96b,_0x57d789[_0x592d('0x4a')]);return db[_0x592d('0x2e')][_0x592d('0x4b')](_0x2be96b)[_0x592d('0x27')](handleEntityNotFound(_0x5cb574,null))[_0x592d('0x27')](respondWithResult(_0x5cb574,null))['catch'](handleError(_0x5cb574,null));};exports[_0x592d('0x4c')]=function(_0x1cbfb8,_0x160b8e){return db[_0x592d('0x2e')][_0x592d('0x4c')](_0x1cbfb8[_0x592d('0x4d')],{})['then'](respondWithResult(_0x160b8e,0xc9))[_0x592d('0x46')](handleError(_0x160b8e,null));};exports[_0x592d('0x26')]=function(_0x3f772e,_0x46f5e7){if(_0x3f772e['body']['id']){delete _0x3f772e['body']['id'];}return db[_0x592d('0x2e')][_0x592d('0x4b')]({'where':{'id':_0x3f772e['params']['id']}})[_0x592d('0x27')](handleEntityNotFound(_0x46f5e7,null))[_0x592d('0x27')](saveUpdates(_0x3f772e[_0x592d('0x4d')],null))[_0x592d('0x27')](respondWithResult(_0x46f5e7,null))[_0x592d('0x46')](handleError(_0x46f5e7,null));};exports[_0x592d('0x28')]=function(_0x5cf39c,_0x194911){return db[_0x592d('0x2e')]['find']({'where':{'id':_0x5cf39c[_0x592d('0x48')]['id']}})[_0x592d('0x27')](handleEntityNotFound(_0x194911,null))[_0x592d('0x27')](removeEntity(_0x194911,null))['catch'](handleError(_0x194911,null));};exports['describe']=function(_0x2e2b32,_0x4977d6){return db[_0x592d('0x2e')]['describe']()[_0x592d('0x27')](respondWithResult(_0x4977d6,null))[_0x592d('0x46')](handleError(_0x4977d6,null));}; \ No newline at end of file +var _0x68c8=['update','then','destroy','end','sendStatus','error','stack','name','send','index','map','ChatQueueReport','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','offset','limit','set','Content-Range','apply','reject'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x68c8,0x109));var _0x868c=function(_0x1b85eb,_0x2310e9){_0x1b85eb=_0x1b85eb-0x0;var _0x461285=_0x68c8[_0x1b85eb];return _0x461285;};'use strict';var pdf=require(_0x868c('0x0'));var emlformat=require(_0x868c('0x1'));var rimraf=require(_0x868c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x868c('0x3'));var rp=require(_0x868c('0x4'));var moment=require(_0x868c('0x5'));var BPromise=require(_0x868c('0x6'));var Mustache=require(_0x868c('0x7'));var util=require(_0x868c('0x8'));var path=require(_0x868c('0x9'));var sox=require(_0x868c('0xa'));var csv=require(_0x868c('0xb'));var ejs=require(_0x868c('0xc'));var fs=require('fs');var _=require(_0x868c('0xd'));var squel=require(_0x868c('0xe'));var crypto=require(_0x868c('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x868c('0x10'));var toCsv=require(_0x868c('0xb'));var querystring=require('querystring');var Papa=require(_0x868c('0x11'));var Redis=require('ioredis');var authService=require(_0x868c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x868c('0x13'));var hardwareService=require(_0x868c('0x14'));var logger=require('../../config/logger')(_0x868c('0x15'));var utils=require(_0x868c('0x16'));var config=require('../../config/environment');var db=require(_0x868c('0x17'))['db'];function respondWithStatusCode(_0x99bb72,_0x448b0f){_0x448b0f=_0x448b0f||0xcc;return function(_0x5d671e){if(_0x5d671e){return _0x99bb72['sendStatus'](_0x448b0f);}return _0x99bb72[_0x868c('0x18')](_0x448b0f)['end']();};}function respondWithResult(_0xc5081d,_0x6444f8){_0x6444f8=_0x6444f8||0xc8;return function(_0x5babf9){if(_0x5babf9){return _0xc5081d[_0x868c('0x18')](_0x6444f8)['json'](_0x5babf9);}};}function respondWithFilteredResult(_0x4847b0,_0x346295){return function(_0x5166ef){if(_0x5166ef){var _0x1e4271=_0x5166ef['count'],_0x4aa97f=_0x346295['offset'],_0x57849a=_0x346295[_0x868c('0x19')]+_0x346295[_0x868c('0x1a')],_0x157612;if(_0x57849a>=_0x1e4271){_0x57849a=_0x1e4271;_0x157612=0xc8;}else{_0x157612=0xce;}_0x4847b0[_0x868c('0x18')](_0x157612);return _0x4847b0[_0x868c('0x1b')](_0x868c('0x1c'),_0x4aa97f+'-'+_0x57849a+'/'+_0x1e4271)['json'](_0x5166ef);}return null;};}function patchUpdates(_0x39dcd9){return function(_0x11c915){try{jsonpatch[_0x868c('0x1d')](_0x11c915,_0x39dcd9,!![]);}catch(_0x14443d){return BPromise[_0x868c('0x1e')](_0x14443d);}return _0x11c915['save']();};}function saveUpdates(_0x3d2415,_0x38fe09){return function(_0x1a5262){if(_0x1a5262){return _0x1a5262[_0x868c('0x1f')](_0x3d2415)[_0x868c('0x20')](function(_0xfcbd7c){return _0xfcbd7c;});}return null;};}function removeEntity(_0x5c48ea,_0x37927a){return function(_0x30bc4b){if(_0x30bc4b){return _0x30bc4b[_0x868c('0x21')]()[_0x868c('0x20')](function(){_0x5c48ea['status'](0xcc)[_0x868c('0x22')]();});}};}function handleEntityNotFound(_0x258bd1,_0x4d978b){return function(_0x18ab5e){if(!_0x18ab5e){_0x258bd1[_0x868c('0x23')](0x194);}return _0x18ab5e;};}function handleError(_0x14ae53,_0x1967f1){_0x1967f1=_0x1967f1||0x1f4;return function(_0x1ba201){logger[_0x868c('0x24')](_0x1ba201[_0x868c('0x25')]);if(_0x1ba201[_0x868c('0x26')]){delete _0x1ba201['name'];}_0x14ae53[_0x868c('0x18')](_0x1967f1)[_0x868c('0x27')](_0x1ba201);};}exports[_0x868c('0x28')]=function(_0x24ebe5,_0x5de6b8){var _0x458bb0={},_0x2d16bd={},_0x5ac335={'count':0x0,'rows':[]};var _0x26c153=_[_0x868c('0x29')](db[_0x868c('0x2a')]['rawAttributes'],function(_0x5b0bde){return{'name':_0x5b0bde['fieldName'],'type':_0x5b0bde[_0x868c('0x2b')]['key']};});_0x2d16bd[_0x868c('0x2c')]=_[_0x868c('0x29')](_0x26c153,_0x868c('0x26'));_0x2d16bd[_0x868c('0x2d')]=_['keys'](_0x24ebe5[_0x868c('0x2d')]);_0x2d16bd[_0x868c('0x2e')]=_[_0x868c('0x2f')](_0x2d16bd[_0x868c('0x2c')],_0x2d16bd[_0x868c('0x2d')]);_0x458bb0[_0x868c('0x30')]=_['intersection'](_0x2d16bd[_0x868c('0x2c')],qs['fields'](_0x24ebe5[_0x868c('0x2d')]['fields']));_0x458bb0[_0x868c('0x30')]=_0x458bb0[_0x868c('0x30')][_0x868c('0x31')]?_0x458bb0['attributes']:_0x2d16bd[_0x868c('0x2c')];if(!_0x24ebe5[_0x868c('0x2d')][_0x868c('0x32')](_0x868c('0x33'))){_0x458bb0[_0x868c('0x1a')]=qs[_0x868c('0x1a')](_0x24ebe5[_0x868c('0x2d')][_0x868c('0x1a')]);_0x458bb0[_0x868c('0x19')]=qs[_0x868c('0x19')](_0x24ebe5[_0x868c('0x2d')][_0x868c('0x19')]);}_0x458bb0[_0x868c('0x34')]=qs[_0x868c('0x35')](_0x24ebe5[_0x868c('0x2d')][_0x868c('0x35')]);_0x458bb0[_0x868c('0x36')]=qs[_0x868c('0x2e')](_[_0x868c('0x37')](_0x24ebe5['query'],_0x2d16bd[_0x868c('0x2e')]));if(_0x24ebe5[_0x868c('0x2d')]['filter']){_0x458bb0['where']=_[_0x868c('0x38')](_0x458bb0[_0x868c('0x36')],{'$or':_['map'](_0x26c153,function(_0x4537ef){if(_0x4537ef[_0x868c('0x2b')]!==_0x868c('0x39')){var _0x1899eb={};_0x1899eb[_0x4537ef[_0x868c('0x26')]]={'$like':'%'+_0x24ebe5['query'][_0x868c('0x3a')]+'%'};return _0x1899eb;}})});}_0x458bb0=_[_0x868c('0x38')]({},_0x458bb0,_0x24ebe5[_0x868c('0x3b')]);var _0x897d30={'where':_0x458bb0[_0x868c('0x36')]};return db[_0x868c('0x2a')][_0x868c('0x3c')](_0x897d30)['then'](function(_0x246d90){_0x5ac335['count']=_0x246d90;if(_0x24ebe5['query'][_0x868c('0x3d')]){_0x458bb0[_0x868c('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x868c('0x3f')](_0x458bb0);})['then'](function(_0x4d0af3){_0x5ac335[_0x868c('0x40')]=_0x4d0af3;return _0x5ac335;})[_0x868c('0x20')](respondWithFilteredResult(_0x5de6b8,_0x458bb0))[_0x868c('0x41')](handleError(_0x5de6b8,null));};exports[_0x868c('0x42')]=function(_0x33915a,_0xe25e62){var _0x47da93={'raw':!![],'where':{'id':_0x33915a[_0x868c('0x43')]['id']}},_0x5b96e9={};_0x5b96e9[_0x868c('0x2c')]=_[_0x868c('0x44')](db[_0x868c('0x2a')][_0x868c('0x45')]);_0x5b96e9['query']=_[_0x868c('0x44')](_0x33915a[_0x868c('0x2d')]);_0x5b96e9[_0x868c('0x2e')]=_[_0x868c('0x2f')](_0x5b96e9[_0x868c('0x2c')],_0x5b96e9[_0x868c('0x2d')]);_0x47da93[_0x868c('0x30')]=_[_0x868c('0x2f')](_0x5b96e9[_0x868c('0x2c')],qs['fields'](_0x33915a['query']['fields']));_0x47da93[_0x868c('0x30')]=_0x47da93[_0x868c('0x30')][_0x868c('0x31')]?_0x47da93[_0x868c('0x30')]:_0x5b96e9[_0x868c('0x2c')];if(_0x33915a[_0x868c('0x2d')]['includeAll']){_0x47da93[_0x868c('0x3e')]=[{'all':!![]}];}_0x47da93=_[_0x868c('0x38')]({},_0x47da93,_0x33915a[_0x868c('0x3b')]);return db[_0x868c('0x2a')][_0x868c('0x46')](_0x47da93)[_0x868c('0x20')](handleEntityNotFound(_0xe25e62,null))['then'](respondWithResult(_0xe25e62,null))[_0x868c('0x41')](handleError(_0xe25e62,null));};exports[_0x868c('0x47')]=function(_0x4ab0cb,_0x3e3678){return db[_0x868c('0x2a')][_0x868c('0x47')](_0x4ab0cb[_0x868c('0x48')],{})[_0x868c('0x20')](respondWithResult(_0x3e3678,0xc9))[_0x868c('0x41')](handleError(_0x3e3678,null));};exports[_0x868c('0x1f')]=function(_0x451f1b,_0x4c69e2){if(_0x451f1b[_0x868c('0x48')]['id']){delete _0x451f1b['body']['id'];}return db[_0x868c('0x2a')][_0x868c('0x46')]({'where':{'id':_0x451f1b[_0x868c('0x43')]['id']}})[_0x868c('0x20')](handleEntityNotFound(_0x4c69e2,null))['then'](saveUpdates(_0x451f1b[_0x868c('0x48')],null))[_0x868c('0x20')](respondWithResult(_0x4c69e2,null))[_0x868c('0x41')](handleError(_0x4c69e2,null));};exports['destroy']=function(_0x2ca785,_0x1689e7){return db[_0x868c('0x2a')][_0x868c('0x46')]({'where':{'id':_0x2ca785[_0x868c('0x43')]['id']}})[_0x868c('0x20')](handleEntityNotFound(_0x1689e7,null))[_0x868c('0x20')](removeEntity(_0x1689e7,null))[_0x868c('0x41')](handleError(_0x1689e7,null));};exports[_0x868c('0x49')]=function(_0x46f4e6,_0x40b7c2){return db[_0x868c('0x2a')]['describe']()['then'](respondWithResult(_0x40b7c2,null))['catch'](handleError(_0x40b7c2,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 65e562b..e4a5cdb 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 _0x9aa5=['report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport'];(function(_0x314d82,_0x52f61c){var _0x2f01bc=function(_0x531836){while(--_0x531836){_0x314d82['push'](_0x314d82['shift']());}};_0x2f01bc(++_0x52f61c);}(_0x9aa5,0x16a));var _0x59aa=function(_0x1f2194,_0x41103a){_0x1f2194=_0x1f2194-0x0;var _0x235d2c=_0x9aa5[_0x1f2194];return _0x235d2c;};'use strict';var _=require(_0x59aa('0x0'));var util=require(_0x59aa('0x1'));var logger=require(_0x59aa('0x2'))(_0x59aa('0x3'));var moment=require(_0x59aa('0x4'));var BPromise=require(_0x59aa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59aa('0x6'));var rimraf=require(_0x59aa('0x7'));var config=require(_0x59aa('0x8'));var attributes=require(_0x59aa('0x9'));module[_0x59aa('0xa')]=function(_0xd15085,_0x44f187){return _0xd15085[_0x59aa('0xb')](_0x59aa('0xc'),attributes,{'tableName':_0x59aa('0xd'),'paranoid':![],'indexes':[{'name':_0x59aa('0xe'),'fields':[_0x59aa('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac6c=['./chatQueueReport.attributes','define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1da811,_0x2e30db){var _0x53858b=function(_0x4e70ce){while(--_0x4e70ce){_0x1da811['push'](_0x1da811['shift']());}};_0x53858b(++_0x2e30db);}(_0xac6c,0xe2));var _0xcac6=function(_0x4cb4c2,_0x5914c){_0x4cb4c2=_0x4cb4c2-0x0;var _0x2242a6=_0xac6c[_0x4cb4c2];return _0x2242a6;};'use strict';var _=require('lodash');var util=require(_0xcac6('0x0'));var logger=require(_0xcac6('0x1'))(_0xcac6('0x2'));var moment=require(_0xcac6('0x3'));var BPromise=require(_0xcac6('0x4'));var rp=require(_0xcac6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcac6('0x6'));var config=require(_0xcac6('0x7'));var attributes=require(_0xcac6('0x8'));module['exports']=function(_0x3297b9,_0x405d61){return _0x3297b9[_0xcac6('0x9')](_0xcac6('0xa'),attributes,{'tableName':_0xcac6('0xb'),'paranoid':![],'indexes':[{'name':_0xcac6('0xc'),'fields':[_0xcac6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c431a85..51aac46 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 _0x7473=['http','request','then','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','update','raw','where','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x2e54ca,_0x1d3829){var _0x5a40a7=function(_0x27c13a){while(--_0x27c13a){_0x2e54ca['push'](_0x2e54ca['shift']());}};_0x5a40a7(++_0x1d3829);}(_0x7473,0x176));var _0x3747=function(_0x51d1c2,_0x12d987){_0x51d1c2=_0x51d1c2-0x0;var _0x20b989=_0x7473[_0x51d1c2];return _0x20b989;};'use strict';var _=require(_0x3747('0x0'));var util=require('util');var moment=require(_0x3747('0x1'));var BPromise=require(_0x3747('0x2'));var rs=require(_0x3747('0x3'));var fs=require('fs');var Redis=require(_0x3747('0x4'));var db=require(_0x3747('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3747('0x6'))(_0x3747('0x7'));var config=require('../../config/environment');var jayson=require(_0x3747('0x8'));var client=jayson[_0x3747('0x9')][_0x3747('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa7118a,_0x1800d6,_0x3cae42){return new BPromise(function(_0x4e3c89,_0x2b7fc9){return client[_0x3747('0xb')](_0xa7118a,_0x3cae42)[_0x3747('0xc')](function(_0x5f04b0){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x1800d6,_0x3747('0xd'));logger[_0x3747('0xe')](_0x3747('0xf'),_0x1800d6,_0x3747('0xd'),JSON[_0x3747('0x10')](_0x5f04b0));if(_0x5f04b0[_0x3747('0x11')]){if(_0x5f04b0[_0x3747('0x11')]['code']===0x1f4){logger[_0x3747('0x11')](_0x3747('0x12'),_0x1800d6,_0x5f04b0[_0x3747('0x11')]['message']);return _0x2b7fc9(_0x5f04b0['error'][_0x3747('0x13')]);}logger[_0x3747('0x11')](_0x3747('0x12'),_0x1800d6,_0x5f04b0[_0x3747('0x11')][_0x3747('0x13')]);return _0x4e3c89(_0x5f04b0[_0x3747('0x11')][_0x3747('0x13')]);}else{logger[_0x3747('0x14')](_0x3747('0x12'),_0x1800d6,'request\x20sent');_0x4e3c89(_0x5f04b0[_0x3747('0x15')][_0x3747('0x13')]);}})[_0x3747('0x16')](function(_0x54def7){logger['error'](_0x3747('0x12'),_0x1800d6,_0x54def7);_0x2b7fc9(_0x54def7);});});}exports[_0x3747('0x17')]=function(_0x48070c){var _0x6d3153=this;return new Promise(function(_0x1f2ee7,_0x8cbab5){return db[_0x3747('0x18')][_0x3747('0x19')](_0x48070c[_0x3747('0x1a')],{'raw':_0x48070c[_0x3747('0x1b')]?_0x48070c['options']['raw']===undefined?!![]:![]:!![]})[_0x3747('0xc')](function(_0x29047c){logger[_0x3747('0x14')](_0x3747('0x17'),_0x48070c);logger['debug']('CreateChatQueueReport',_0x48070c,JSON[_0x3747('0x10')](_0x29047c));_0x1f2ee7(_0x29047c);})[_0x3747('0x16')](function(_0x4b4350){logger[_0x3747('0x11')](_0x3747('0x17'),_0x4b4350['message'],_0x48070c);_0x8cbab5(_0x6d3153[_0x3747('0x11')](0x1f4,_0x4b4350[_0x3747('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0xcd2c82){var _0x4da1b3=this;return new Promise(function(_0x1b3ae4,_0xaf9e06){return db[_0x3747('0x18')][_0x3747('0x1c')](_0xcd2c82['body'],{'raw':_0xcd2c82[_0x3747('0x1b')]?_0xcd2c82[_0x3747('0x1b')][_0x3747('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcd2c82['options']?_0xcd2c82[_0x3747('0x1b')][_0x3747('0x1e')]||null:null,'attributes':_0xcd2c82['options']?_0xcd2c82['options']['attributes']||null:null,'limit':_0xcd2c82[_0x3747('0x1b')]?_0xcd2c82[_0x3747('0x1b')]['limit']||null:null})['then'](function(_0x4c0984){logger['info'](_0x3747('0x1f'),_0xcd2c82);logger[_0x3747('0xe')](_0x3747('0x1f'),_0xcd2c82,JSON[_0x3747('0x10')](_0x4c0984));_0x1b3ae4(_0x4c0984);})['catch'](function(_0x15dd3f){logger[_0x3747('0x11')](_0x3747('0x1f'),_0x15dd3f[_0x3747('0x13')],_0xcd2c82);_0xaf9e06(_0x4da1b3[_0x3747('0x11')](0x1f4,_0x15dd3f[_0x3747('0x13')]));});});}; \ No newline at end of file +var _0x8b7e=['message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','stringify','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x222b79,_0x2b3fee){var _0x457878=function(_0x52129c){while(--_0x52129c){_0x222b79['push'](_0x222b79['shift']());}};_0x457878(++_0x2b3fee);}(_0x8b7e,0x7f));var _0xe8b7=function(_0x5554b7,_0x32d51){_0x5554b7=_0x5554b7-0x0;var _0x3ff845=_0x8b7e[_0x5554b7];return _0x3ff845;};'use strict';var _=require(_0xe8b7('0x0'));var util=require(_0xe8b7('0x1'));var moment=require(_0xe8b7('0x2'));var BPromise=require(_0xe8b7('0x3'));var rs=require(_0xe8b7('0x4'));var fs=require('fs');var Redis=require(_0xe8b7('0x5'));var db=require(_0xe8b7('0x6'))['db'];var utils=require(_0xe8b7('0x7'));var logger=require(_0xe8b7('0x8'))(_0xe8b7('0x9'));var config=require(_0xe8b7('0xa'));var jayson=require(_0xe8b7('0xb'));var client=jayson[_0xe8b7('0xc')][_0xe8b7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2fc692,_0x53123e,_0x189b3e){return new BPromise(function(_0x70d70a,_0x42ba7f){return client[_0xe8b7('0xe')](_0x2fc692,_0x189b3e)['then'](function(_0x569cc7){logger['info'](_0xe8b7('0xf'),_0x53123e,_0xe8b7('0x10'));logger[_0xe8b7('0x11')](_0xe8b7('0x12'),_0x53123e,'request\x20sent',JSON['stringify'](_0x569cc7));if(_0x569cc7[_0xe8b7('0x13')]){if(_0x569cc7[_0xe8b7('0x13')][_0xe8b7('0x14')]===0x1f4){logger[_0xe8b7('0x13')](_0xe8b7('0xf'),_0x53123e,_0x569cc7[_0xe8b7('0x13')][_0xe8b7('0x15')]);return _0x42ba7f(_0x569cc7['error'][_0xe8b7('0x15')]);}logger[_0xe8b7('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x53123e,_0x569cc7['error'][_0xe8b7('0x15')]);return _0x70d70a(_0x569cc7[_0xe8b7('0x13')]['message']);}else{logger[_0xe8b7('0x16')](_0xe8b7('0xf'),_0x53123e,_0xe8b7('0x10'));_0x70d70a(_0x569cc7[_0xe8b7('0x17')][_0xe8b7('0x15')]);}})[_0xe8b7('0x18')](function(_0x3b3fec){logger[_0xe8b7('0x13')](_0xe8b7('0xf'),_0x53123e,_0x3b3fec);_0x42ba7f(_0x3b3fec);});});}exports[_0xe8b7('0x19')]=function(_0x5bb803){var _0x50482c=this;return new Promise(function(_0x4f8358,_0x119231){return db[_0xe8b7('0x1a')][_0xe8b7('0x1b')](_0x5bb803[_0xe8b7('0x1c')],{'raw':_0x5bb803[_0xe8b7('0x1d')]?_0x5bb803[_0xe8b7('0x1d')][_0xe8b7('0x1e')]===undefined?!![]:![]:!![]})[_0xe8b7('0x1f')](function(_0xd8af71){logger['info']('CreateChatQueueReport',_0x5bb803);logger[_0xe8b7('0x11')]('CreateChatQueueReport',_0x5bb803,JSON[_0xe8b7('0x20')](_0xd8af71));_0x4f8358(_0xd8af71);})[_0xe8b7('0x18')](function(_0x4fb2f8){logger['error'](_0xe8b7('0x19'),_0x4fb2f8[_0xe8b7('0x15')],_0x5bb803);_0x119231(_0x50482c[_0xe8b7('0x13')](0x1f4,_0x4fb2f8[_0xe8b7('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x269a8a){var _0x24dce0=this;return new Promise(function(_0x121b44,_0x2a7796){return db['ChatQueueReport']['update'](_0x269a8a[_0xe8b7('0x1c')],{'raw':_0x269a8a[_0xe8b7('0x1d')]?_0x269a8a[_0xe8b7('0x1d')][_0xe8b7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x269a8a[_0xe8b7('0x1d')]?_0x269a8a['options'][_0xe8b7('0x21')]||null:null,'attributes':_0x269a8a['options']?_0x269a8a[_0xe8b7('0x1d')][_0xe8b7('0x22')]||null:null,'limit':_0x269a8a[_0xe8b7('0x1d')]?_0x269a8a[_0xe8b7('0x1d')][_0xe8b7('0x23')]||null:null})[_0xe8b7('0x1f')](function(_0xa3df81){logger['info'](_0xe8b7('0x24'),_0x269a8a);logger['debug'](_0xe8b7('0x24'),_0x269a8a,JSON[_0xe8b7('0x20')](_0xa3df81));_0x121b44(_0xa3df81);})[_0xe8b7('0x18')](function(_0x15419b){logger['error'](_0xe8b7('0x24'),_0x15419b[_0xe8b7('0x15')],_0x269a8a);_0x2a7796(_0x24dce0[_0xe8b7('0x13')](0x1f4,_0x15419b[_0xe8b7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 355179b..f239aa1 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 _0xca25=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports'];(function(_0x546c34,_0x29072b){var _0x1828a1=function(_0x540037){while(--_0x540037){_0x546c34['push'](_0x546c34['shift']());}};_0x1828a1(++_0x29072b);}(_0xca25,0x1e6));var _0x5ca2=function(_0x4fc435,_0x45eddf){_0x4fc435=_0x4fc435-0x0;var _0x3c5db1=_0xca25[_0x4fc435];return _0x3c5db1;};'use strict';var multer=require(_0x5ca2('0x0'));var util=require(_0x5ca2('0x1'));var path=require(_0x5ca2('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ca2('0x3'));var router=express[_0x5ca2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5ca2('0x5'));var config=require(_0x5ca2('0x6'));var controller=require('./chatQueueReport.controller');router[_0x5ca2('0x7')]('/',auth[_0x5ca2('0x8')](),controller[_0x5ca2('0x9')]);router['get'](_0x5ca2('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x5ca2('0x7')](_0x5ca2('0xb'),auth[_0x5ca2('0x8')](),controller[_0x5ca2('0xc')]);router[_0x5ca2('0xd')]('/',auth['isAuthenticated'](),controller[_0x5ca2('0xe')]);router[_0x5ca2('0xf')](_0x5ca2('0xb'),auth[_0x5ca2('0x8')](),controller['update']);router[_0x5ca2('0x10')](_0x5ca2('0xb'),auth[_0x5ca2('0x8')](),controller['destroy']);module[_0x5ca2('0x11')]=router; \ No newline at end of file +var _0x8549=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','post','create','/:id','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x27f9d3,_0x54ee48){var _0x1d2c10=function(_0x591eae){while(--_0x591eae){_0x27f9d3['push'](_0x27f9d3['shift']());}};_0x1d2c10(++_0x54ee48);}(_0x8549,0x1c2));var _0x9854=function(_0x325be2,_0x4a3e19){_0x325be2=_0x325be2-0x0;var _0x54986c=_0x8549[_0x325be2];return _0x54986c;};'use strict';var multer=require(_0x9854('0x0'));var util=require(_0x9854('0x1'));var path=require(_0x9854('0x2'));var timeout=require(_0x9854('0x3'));var express=require(_0x9854('0x4'));var router=express[_0x9854('0x5')]();var auth=require(_0x9854('0x6'));var interaction=require(_0x9854('0x7'));var config=require(_0x9854('0x8'));var controller=require(_0x9854('0x9'));router[_0x9854('0xa')]('/',auth[_0x9854('0xb')](),controller['index']);router['get'](_0x9854('0xc'),auth[_0x9854('0xb')](),controller[_0x9854('0xd')]);router[_0x9854('0xa')]('/:id',auth[_0x9854('0xb')](),controller['show']);router[_0x9854('0xe')]('/',auth[_0x9854('0xb')](),controller[_0x9854('0xf')]);router['put'](_0x9854('0x10'),auth[_0x9854('0xb')](),controller[_0x9854('0x11')]);router['delete']('/:id',auth[_0x9854('0xb')](),controller[_0x9854('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index ba1574d..936fc09 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 _0xe643=['STRING','ENUM','account','DATE','moment','sequelize'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0xe643,0x1ea));var _0x3e64=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe643[_0x2be8c2];return _0x97f531;};'use strict';var moment=require(_0x3e64('0x0'));var Sequelize=require(_0x3e64('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3e64('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3e64('0x3')](_0x3e64('0x4'),'agent','queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x3e64('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x69ca=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x64c4e,_0x493d08){var _0x5df5d3=function(_0x523897){while(--_0x523897){_0x64c4e['push'](_0x64c4e['shift']());}};_0x5df5d3(++_0x493d08);}(_0x69ca,0x1ba));var _0xa69c=function(_0x17541e,_0x46df72){_0x17541e=_0x17541e-0x0;var _0x1c17eb=_0x69ca[_0x17541e];return _0x1c17eb;};'use strict';var moment=require(_0xa69c('0x0'));var Sequelize=require(_0xa69c('0x1'));module[_0xa69c('0x2')]={'uniqueid':{'type':Sequelize[_0xa69c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa69c('0x4')](_0xa69c('0x5'),_0xa69c('0x6'),_0xa69c('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xa69c('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xa69c('0x9')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index d2edbd6..4dd427f 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 _0x29af=['params','keys','includeAll','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','save','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','nolimit','limit','sort','where','filters','filter','merge','VIRTUAL','options','ChatTransferReport','count','then','include','findAll','rows','catch','show'];(function(_0x1e329d,_0x15e755){var _0x1e0337=function(_0x309d3b){while(--_0x309d3b){_0x1e329d['push'](_0x1e329d['shift']());}};_0x1e0337(++_0x15e755);}(_0x29af,0x1be));var _0xf29a=function(_0x5aa35,_0x581ac2){_0x5aa35=_0x5aa35-0x0;var _0x557177=_0x29af[_0x5aa35];return _0x557177;};'use strict';var pdf=require(_0xf29a('0x0'));var emlformat=require(_0xf29a('0x1'));var rimraf=require(_0xf29a('0x2'));var zipdir=require(_0xf29a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf29a('0x4'));var moment=require('moment');var BPromise=require(_0xf29a('0x5'));var Mustache=require(_0xf29a('0x6'));var util=require(_0xf29a('0x7'));var path=require(_0xf29a('0x8'));var sox=require(_0xf29a('0x9'));var csv=require(_0xf29a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf29a('0xb'));var crypto=require(_0xf29a('0xc'));var jsforce=require(_0xf29a('0xd'));var deskjs=require(_0xf29a('0xe'));var toCsv=require(_0xf29a('0xa'));var querystring=require(_0xf29a('0xf'));var Papa=require(_0xf29a('0x10'));var Redis=require(_0xf29a('0x11'));var authService=require(_0xf29a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf29a('0x13'));var hardwareService=require(_0xf29a('0x14'));var logger=require(_0xf29a('0x15'))(_0xf29a('0x16'));var utils=require(_0xf29a('0x17'));var config=require(_0xf29a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cd95e,_0x4baa37){_0x4baa37=_0x4baa37||0xcc;return function(_0x20fb74){if(_0x20fb74){return _0x3cd95e[_0xf29a('0x19')](_0x4baa37);}return _0x3cd95e[_0xf29a('0x1a')](_0x4baa37)[_0xf29a('0x1b')]();};}function respondWithResult(_0x475927,_0x578429){_0x578429=_0x578429||0xc8;return function(_0x5daad9){if(_0x5daad9){return _0x475927['status'](_0x578429)[_0xf29a('0x1c')](_0x5daad9);}};}function respondWithFilteredResult(_0x59a06c,_0x1cba05){return function(_0x4057db){if(_0x4057db){var _0x408a2f=_0x4057db['count'],_0x14e41a=_0x1cba05[_0xf29a('0x1d')],_0x3a315d=_0x1cba05['offset']+_0x1cba05['limit'],_0x120460;if(_0x3a315d>=_0x408a2f){_0x3a315d=_0x408a2f;_0x120460=0xc8;}else{_0x120460=0xce;}_0x59a06c[_0xf29a('0x1a')](_0x120460);return _0x59a06c['set']('Content-Range',_0x14e41a+'-'+_0x3a315d+'/'+_0x408a2f)[_0xf29a('0x1c')](_0x4057db);}return null;};}function patchUpdates(_0x2cc307){return function(_0x39dedb){try{jsonpatch['apply'](_0x39dedb,_0x2cc307,!![]);}catch(_0x16c278){return BPromise['reject'](_0x16c278);}return _0x39dedb[_0xf29a('0x1e')]();};}function saveUpdates(_0x1ecff0,_0x256af3){return function(_0x535465){if(_0x535465){return _0x535465['update'](_0x1ecff0)['then'](function(_0xa7caf7){return _0xa7caf7;});}return null;};}function removeEntity(_0x11681a,_0x2bc9cf){return function(_0x4afa56){if(_0x4afa56){return _0x4afa56[_0xf29a('0x1f')]()['then'](function(){_0x11681a['status'](0xcc)[_0xf29a('0x1b')]();});}};}function handleEntityNotFound(_0x22a86f,_0x2c340a){return function(_0x23322d){if(!_0x23322d){_0x22a86f[_0xf29a('0x19')](0x194);}return _0x23322d;};}function handleError(_0x140bd7,_0x143450){_0x143450=_0x143450||0x1f4;return function(_0x1b03e7){logger[_0xf29a('0x20')](_0x1b03e7[_0xf29a('0x21')]);if(_0x1b03e7[_0xf29a('0x22')]){delete _0x1b03e7[_0xf29a('0x22')];}_0x140bd7['status'](_0x143450)[_0xf29a('0x23')](_0x1b03e7);};}exports[_0xf29a('0x24')]=function(_0x3d9b24,_0x4880dc){var _0x49af6d={},_0x23042d={},_0x12b125={'count':0x0,'rows':[]};var _0x335309=_['map'](db['ChatTransferReport'][_0xf29a('0x25')],function(_0x55e1dd){return{'name':_0x55e1dd[_0xf29a('0x26')],'type':_0x55e1dd[_0xf29a('0x27')][_0xf29a('0x28')]};});_0x23042d[_0xf29a('0x29')]=_[_0xf29a('0x2a')](_0x335309,_0xf29a('0x22'));_0x23042d[_0xf29a('0x2b')]=_['keys'](_0x3d9b24[_0xf29a('0x2b')]);_0x23042d['filters']=_[_0xf29a('0x2c')](_0x23042d[_0xf29a('0x29')],_0x23042d['query']);_0x49af6d[_0xf29a('0x2d')]=_['intersection'](_0x23042d[_0xf29a('0x29')],qs[_0xf29a('0x2e')](_0x3d9b24['query'][_0xf29a('0x2e')]));_0x49af6d[_0xf29a('0x2d')]=_0x49af6d[_0xf29a('0x2d')][_0xf29a('0x2f')]?_0x49af6d[_0xf29a('0x2d')]:_0x23042d['model'];if(!_0x3d9b24['query']['hasOwnProperty'](_0xf29a('0x30'))){_0x49af6d[_0xf29a('0x31')]=qs['limit'](_0x3d9b24[_0xf29a('0x2b')][_0xf29a('0x31')]);_0x49af6d[_0xf29a('0x1d')]=qs[_0xf29a('0x1d')](_0x3d9b24['query'][_0xf29a('0x1d')]);}_0x49af6d['order']=qs[_0xf29a('0x32')](_0x3d9b24['query'][_0xf29a('0x32')]);_0x49af6d[_0xf29a('0x33')]=qs[_0xf29a('0x34')](_['pick'](_0x3d9b24['query'],_0x23042d[_0xf29a('0x34')]));if(_0x3d9b24[_0xf29a('0x2b')][_0xf29a('0x35')]){_0x49af6d[_0xf29a('0x33')]=_[_0xf29a('0x36')](_0x49af6d[_0xf29a('0x33')],{'$or':_[_0xf29a('0x2a')](_0x335309,function(_0x2dd0c5){if(_0x2dd0c5[_0xf29a('0x27')]!==_0xf29a('0x37')){var _0x46eab8={};_0x46eab8[_0x2dd0c5[_0xf29a('0x22')]]={'$like':'%'+_0x3d9b24[_0xf29a('0x2b')][_0xf29a('0x35')]+'%'};return _0x46eab8;}})});}_0x49af6d=_[_0xf29a('0x36')]({},_0x49af6d,_0x3d9b24[_0xf29a('0x38')]);var _0x2edbd8={'where':_0x49af6d['where']};return db[_0xf29a('0x39')][_0xf29a('0x3a')](_0x2edbd8)[_0xf29a('0x3b')](function(_0xfc8d62){_0x12b125[_0xf29a('0x3a')]=_0xfc8d62;if(_0x3d9b24[_0xf29a('0x2b')]['includeAll']){_0x49af6d[_0xf29a('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xf29a('0x3d')](_0x49af6d);})[_0xf29a('0x3b')](function(_0x20ac7f){_0x12b125[_0xf29a('0x3e')]=_0x20ac7f;return _0x12b125;})['then'](respondWithFilteredResult(_0x4880dc,_0x49af6d))[_0xf29a('0x3f')](handleError(_0x4880dc,null));};exports[_0xf29a('0x40')]=function(_0x30fd17,_0xcdc1cd){var _0x75e05={'raw':!![],'where':{'id':_0x30fd17[_0xf29a('0x41')]['id']}},_0x4b1c0d={};_0x4b1c0d[_0xf29a('0x29')]=_[_0xf29a('0x42')](db['ChatTransferReport'][_0xf29a('0x25')]);_0x4b1c0d[_0xf29a('0x2b')]=_['keys'](_0x30fd17['query']);_0x4b1c0d[_0xf29a('0x34')]=_[_0xf29a('0x2c')](_0x4b1c0d[_0xf29a('0x29')],_0x4b1c0d[_0xf29a('0x2b')]);_0x75e05[_0xf29a('0x2d')]=_[_0xf29a('0x2c')](_0x4b1c0d[_0xf29a('0x29')],qs[_0xf29a('0x2e')](_0x30fd17['query'][_0xf29a('0x2e')]));_0x75e05['attributes']=_0x75e05[_0xf29a('0x2d')]['length']?_0x75e05[_0xf29a('0x2d')]:_0x4b1c0d['model'];if(_0x30fd17[_0xf29a('0x2b')][_0xf29a('0x43')]){_0x75e05[_0xf29a('0x3c')]=[{'all':!![]}];}_0x75e05=_[_0xf29a('0x36')]({},_0x75e05,_0x30fd17['options']);return db['ChatTransferReport'][_0xf29a('0x44')](_0x75e05)['then'](handleEntityNotFound(_0xcdc1cd,null))[_0xf29a('0x3b')](respondWithResult(_0xcdc1cd,null))['catch'](handleError(_0xcdc1cd,null));};exports['create']=function(_0x37e175,_0x557b8e){return db[_0xf29a('0x39')][_0xf29a('0x45')](_0x37e175[_0xf29a('0x46')],{})[_0xf29a('0x3b')](respondWithResult(_0x557b8e,0xc9))['catch'](handleError(_0x557b8e,null));};exports[_0xf29a('0x47')]=function(_0x4ca053,_0x339afe){if(_0x4ca053['body']['id']){delete _0x4ca053[_0xf29a('0x46')]['id'];}return db['ChatTransferReport'][_0xf29a('0x44')]({'where':{'id':_0x4ca053[_0xf29a('0x41')]['id']}})['then'](handleEntityNotFound(_0x339afe,null))[_0xf29a('0x3b')](saveUpdates(_0x4ca053[_0xf29a('0x46')],null))['then'](respondWithResult(_0x339afe,null))[_0xf29a('0x3f')](handleError(_0x339afe,null));};exports[_0xf29a('0x1f')]=function(_0x2ff452,_0x563d8f){return db['ChatTransferReport'][_0xf29a('0x44')]({'where':{'id':_0x2ff452[_0xf29a('0x41')]['id']}})[_0xf29a('0x3b')](handleEntityNotFound(_0x563d8f,null))['then'](removeEntity(_0x563d8f,null))[_0xf29a('0x3f')](handleError(_0x563d8f,null));};exports[_0xf29a('0x48')]=function(_0x2b503c,_0x4f74f4){return db[_0xf29a('0x39')][_0xf29a('0x48')]()[_0xf29a('0x3b')](respondWithResult(_0x4f74f4,null))[_0xf29a('0x3f')](handleError(_0x4f74f4,null));}; \ No newline at end of file +var _0xc8df=['keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','params','length','options','find','create','body','catch','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','then','end','error','name','index','map','ChatTransferReport','rawAttributes','type','key','model','query'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc8df,0x1b8));var _0xfc8d=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xc8df[_0x5f3f88];return _0xd08119;};'use strict';var pdf=require(_0xfc8d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfc8d('0x1'));var zipdir=require(_0xfc8d('0x2'));var jsonpatch=require(_0xfc8d('0x3'));var rp=require(_0xfc8d('0x4'));var moment=require('moment');var BPromise=require(_0xfc8d('0x5'));var Mustache=require(_0xfc8d('0x6'));var util=require(_0xfc8d('0x7'));var path=require('path');var sox=require(_0xfc8d('0x8'));var csv=require(_0xfc8d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfc8d('0xa'));var squel=require(_0xfc8d('0xb'));var crypto=require('crypto');var jsforce=require(_0xfc8d('0xc'));var deskjs=require(_0xfc8d('0xd'));var toCsv=require(_0xfc8d('0x9'));var querystring=require('querystring');var Papa=require(_0xfc8d('0xe'));var Redis=require(_0xfc8d('0xf'));var authService=require(_0xfc8d('0x10'));var qs=require(_0xfc8d('0x11'));var as=require(_0xfc8d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc8d('0x13'))(_0xfc8d('0x14'));var utils=require('../../config/utils');var config=require(_0xfc8d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x534cdc,_0x35fe8f){_0x35fe8f=_0x35fe8f||0xcc;return function(_0x1b9b3a){if(_0x1b9b3a){return _0x534cdc[_0xfc8d('0x16')](_0x35fe8f);}return _0x534cdc['status'](_0x35fe8f)['end']();};}function respondWithResult(_0x3cdc7e,_0x395c84){_0x395c84=_0x395c84||0xc8;return function(_0x590142){if(_0x590142){return _0x3cdc7e[_0xfc8d('0x17')](_0x395c84)[_0xfc8d('0x18')](_0x590142);}};}function respondWithFilteredResult(_0x58ad3f,_0x3fef8e){return function(_0x1c2082){if(_0x1c2082){var _0x44cb88=_0x1c2082[_0xfc8d('0x19')],_0x210289=_0x3fef8e[_0xfc8d('0x1a')],_0x2b4cd0=_0x3fef8e[_0xfc8d('0x1a')]+_0x3fef8e[_0xfc8d('0x1b')],_0x7960aa;if(_0x2b4cd0>=_0x44cb88){_0x2b4cd0=_0x44cb88;_0x7960aa=0xc8;}else{_0x7960aa=0xce;}_0x58ad3f[_0xfc8d('0x17')](_0x7960aa);return _0x58ad3f['set'](_0xfc8d('0x1c'),_0x210289+'-'+_0x2b4cd0+'/'+_0x44cb88)[_0xfc8d('0x18')](_0x1c2082);}return null;};}function patchUpdates(_0x354ea4){return function(_0x53e5d4){try{jsonpatch[_0xfc8d('0x1d')](_0x53e5d4,_0x354ea4,!![]);}catch(_0x124a1b){return BPromise['reject'](_0x124a1b);}return _0x53e5d4[_0xfc8d('0x1e')]();};}function saveUpdates(_0x215633,_0x547322){return function(_0x51476a){if(_0x51476a){return _0x51476a['update'](_0x215633)[_0xfc8d('0x1f')](function(_0x1c19cd){return _0x1c19cd;});}return null;};}function removeEntity(_0xb7eea7,_0x2d260e){return function(_0xf16f53){if(_0xf16f53){return _0xf16f53['destroy']()['then'](function(){_0xb7eea7[_0xfc8d('0x17')](0xcc)[_0xfc8d('0x20')]();});}};}function handleEntityNotFound(_0xb1f5f9,_0x3b8e7c){return function(_0x42f526){if(!_0x42f526){_0xb1f5f9['sendStatus'](0x194);}return _0x42f526;};}function handleError(_0x2755e1,_0x4dc77c){_0x4dc77c=_0x4dc77c||0x1f4;return function(_0x1d95e9){logger[_0xfc8d('0x21')](_0x1d95e9['stack']);if(_0x1d95e9['name']){delete _0x1d95e9[_0xfc8d('0x22')];}_0x2755e1[_0xfc8d('0x17')](_0x4dc77c)['send'](_0x1d95e9);};}exports[_0xfc8d('0x23')]=function(_0x26c5b6,_0x435ff5){var _0x3b4023={},_0x46c7ce={},_0x2f63ee={'count':0x0,'rows':[]};var _0x29b38d=_[_0xfc8d('0x24')](db[_0xfc8d('0x25')][_0xfc8d('0x26')],function(_0x1d56b3){return{'name':_0x1d56b3['fieldName'],'type':_0x1d56b3[_0xfc8d('0x27')][_0xfc8d('0x28')]};});_0x46c7ce[_0xfc8d('0x29')]=_[_0xfc8d('0x24')](_0x29b38d,'name');_0x46c7ce[_0xfc8d('0x2a')]=_[_0xfc8d('0x2b')](_0x26c5b6[_0xfc8d('0x2a')]);_0x46c7ce[_0xfc8d('0x2c')]=_['intersection'](_0x46c7ce[_0xfc8d('0x29')],_0x46c7ce[_0xfc8d('0x2a')]);_0x3b4023[_0xfc8d('0x2d')]=_[_0xfc8d('0x2e')](_0x46c7ce['model'],qs[_0xfc8d('0x2f')](_0x26c5b6['query'][_0xfc8d('0x2f')]));_0x3b4023['attributes']=_0x3b4023['attributes']['length']?_0x3b4023['attributes']:_0x46c7ce[_0xfc8d('0x29')];if(!_0x26c5b6[_0xfc8d('0x2a')][_0xfc8d('0x30')](_0xfc8d('0x31'))){_0x3b4023[_0xfc8d('0x1b')]=qs[_0xfc8d('0x1b')](_0x26c5b6[_0xfc8d('0x2a')][_0xfc8d('0x1b')]);_0x3b4023[_0xfc8d('0x1a')]=qs['offset'](_0x26c5b6[_0xfc8d('0x2a')][_0xfc8d('0x1a')]);}_0x3b4023[_0xfc8d('0x32')]=qs['sort'](_0x26c5b6[_0xfc8d('0x2a')][_0xfc8d('0x33')]);_0x3b4023[_0xfc8d('0x34')]=qs['filters'](_[_0xfc8d('0x35')](_0x26c5b6[_0xfc8d('0x2a')],_0x46c7ce[_0xfc8d('0x2c')]));if(_0x26c5b6[_0xfc8d('0x2a')]['filter']){_0x3b4023['where']=_[_0xfc8d('0x36')](_0x3b4023[_0xfc8d('0x34')],{'$or':_['map'](_0x29b38d,function(_0x312bb9){if(_0x312bb9[_0xfc8d('0x27')]!==_0xfc8d('0x37')){var _0x33f8ed={};_0x33f8ed[_0x312bb9['name']]={'$like':'%'+_0x26c5b6[_0xfc8d('0x2a')]['filter']+'%'};return _0x33f8ed;}})});}_0x3b4023=_[_0xfc8d('0x36')]({},_0x3b4023,_0x26c5b6['options']);var _0x25f28a={'where':_0x3b4023[_0xfc8d('0x34')]};return db[_0xfc8d('0x25')]['count'](_0x25f28a)[_0xfc8d('0x1f')](function(_0x51f232){_0x2f63ee[_0xfc8d('0x19')]=_0x51f232;if(_0x26c5b6[_0xfc8d('0x2a')][_0xfc8d('0x38')]){_0x3b4023[_0xfc8d('0x39')]=[{'all':!![]}];}return db[_0xfc8d('0x25')][_0xfc8d('0x3a')](_0x3b4023);})['then'](function(_0x85f7e2){_0x2f63ee[_0xfc8d('0x3b')]=_0x85f7e2;return _0x2f63ee;})['then'](respondWithFilteredResult(_0x435ff5,_0x3b4023))['catch'](handleError(_0x435ff5,null));};exports['show']=function(_0x3cbebe,_0x5ab295){var _0x1aed47={'raw':!![],'where':{'id':_0x3cbebe[_0xfc8d('0x3c')]['id']}},_0x4a50cd={};_0x4a50cd[_0xfc8d('0x29')]=_[_0xfc8d('0x2b')](db['ChatTransferReport'][_0xfc8d('0x26')]);_0x4a50cd['query']=_[_0xfc8d('0x2b')](_0x3cbebe[_0xfc8d('0x2a')]);_0x4a50cd[_0xfc8d('0x2c')]=_[_0xfc8d('0x2e')](_0x4a50cd[_0xfc8d('0x29')],_0x4a50cd[_0xfc8d('0x2a')]);_0x1aed47[_0xfc8d('0x2d')]=_[_0xfc8d('0x2e')](_0x4a50cd[_0xfc8d('0x29')],qs['fields'](_0x3cbebe['query'][_0xfc8d('0x2f')]));_0x1aed47[_0xfc8d('0x2d')]=_0x1aed47['attributes'][_0xfc8d('0x3d')]?_0x1aed47['attributes']:_0x4a50cd[_0xfc8d('0x29')];if(_0x3cbebe[_0xfc8d('0x2a')][_0xfc8d('0x38')]){_0x1aed47[_0xfc8d('0x39')]=[{'all':!![]}];}_0x1aed47=_['merge']({},_0x1aed47,_0x3cbebe[_0xfc8d('0x3e')]);return db['ChatTransferReport'][_0xfc8d('0x3f')](_0x1aed47)[_0xfc8d('0x1f')](handleEntityNotFound(_0x5ab295,null))['then'](respondWithResult(_0x5ab295,null))['catch'](handleError(_0x5ab295,null));};exports[_0xfc8d('0x40')]=function(_0x407b47,_0x23fbcd){return db[_0xfc8d('0x25')]['create'](_0x407b47[_0xfc8d('0x41')],{})[_0xfc8d('0x1f')](respondWithResult(_0x23fbcd,0xc9))[_0xfc8d('0x42')](handleError(_0x23fbcd,null));};exports[_0xfc8d('0x43')]=function(_0x6df0da,_0x23e98e){if(_0x6df0da['body']['id']){delete _0x6df0da[_0xfc8d('0x41')]['id'];}return db[_0xfc8d('0x25')][_0xfc8d('0x3f')]({'where':{'id':_0x6df0da[_0xfc8d('0x3c')]['id']}})[_0xfc8d('0x1f')](handleEntityNotFound(_0x23e98e,null))[_0xfc8d('0x1f')](saveUpdates(_0x6df0da[_0xfc8d('0x41')],null))[_0xfc8d('0x1f')](respondWithResult(_0x23e98e,null))['catch'](handleError(_0x23e98e,null));};exports['destroy']=function(_0x5e4fd9,_0x2a8d19){return db['ChatTransferReport'][_0xfc8d('0x3f')]({'where':{'id':_0x5e4fd9[_0xfc8d('0x3c')]['id']}})[_0xfc8d('0x1f')](handleEntityNotFound(_0x2a8d19,null))[_0xfc8d('0x1f')](removeEntity(_0x2a8d19,null))[_0xfc8d('0x42')](handleError(_0x2a8d19,null));};exports[_0xfc8d('0x44')]=function(_0x31b1fc,_0x20d0f5){return db[_0xfc8d('0x25')][_0xfc8d('0x44')]()[_0xfc8d('0x1f')](respondWithResult(_0x20d0f5,null))[_0xfc8d('0x42')](handleError(_0x20d0f5,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 7f8c258..799569b 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 _0x8f35=['define','ChatTransferReport','report_chat_transfer','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x126508,_0x474c77){var _0x119c9b=function(_0x18f4c1){while(--_0x18f4c1){_0x126508['push'](_0x126508['shift']());}};_0x119c9b(++_0x474c77);}(_0x8f35,0x108));var _0x58f3=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x8f35[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var util=require(_0x58f3('0x0'));var logger=require('../../config/logger')(_0x58f3('0x1'));var moment=require(_0x58f3('0x2'));var BPromise=require(_0x58f3('0x3'));var rp=require(_0x58f3('0x4'));var fs=require('fs');var path=require(_0x58f3('0x5'));var rimraf=require(_0x58f3('0x6'));var config=require(_0x58f3('0x7'));var attributes=require(_0x58f3('0x8'));module['exports']=function(_0x4e3bcd,_0x2c23f3){return _0x4e3bcd[_0x58f3('0x9')](_0x58f3('0xa'),attributes,{'tableName':_0x58f3('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x58f3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7d0=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7d0,0x148));var _0x0a7d=function(_0xc38e6f,_0x525004){_0xc38e6f=_0xc38e6f-0x0;var _0x4e7bf5=_0xa7d0[_0xc38e6f];return _0x4e7bf5;};'use strict';var _=require(_0x0a7d('0x0'));var util=require(_0x0a7d('0x1'));var logger=require(_0x0a7d('0x2'))(_0x0a7d('0x3'));var moment=require(_0x0a7d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a7d('0x5'));var rimraf=require(_0x0a7d('0x6'));var config=require(_0x0a7d('0x7'));var attributes=require(_0x0a7d('0x8'));module[_0x0a7d('0x9')]=function(_0x15fabd,_0x22c962){return _0x15fabd[_0x0a7d('0xa')](_0x0a7d('0xb'),attributes,{'tableName':_0x0a7d('0xc'),'paranoid':![],'indexes':[{'name':_0x0a7d('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 1f271e5..1c1572b 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 _0x5295=['client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x39604a,_0x3b76f0){var _0x1aef58=function(_0x505062){while(--_0x505062){_0x39604a['push'](_0x39604a['shift']());}};_0x1aef58(++_0x3b76f0);}(_0x5295,0x166));var _0x5529=function(_0x2ebb91,_0x33ee0d){_0x2ebb91=_0x2ebb91-0x0;var _0x2e8739=_0x5295[_0x2ebb91];return _0x2e8739;};'use strict';var _=require(_0x5529('0x0'));var util=require(_0x5529('0x1'));var moment=require(_0x5529('0x2'));var BPromise=require(_0x5529('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5529('0x4'));var db=require(_0x5529('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5529('0x6'))(_0x5529('0x7'));var config=require(_0x5529('0x8'));var jayson=require(_0x5529('0x9'));var client=jayson[_0x5529('0xa')][_0x5529('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f5627,_0x433a58,_0x2c5dd0){return new BPromise(function(_0x393930,_0x4d21ff){return client[_0x5529('0xc')](_0x2f5627,_0x2c5dd0)[_0x5529('0xd')](function(_0x3615ad){logger['info'](_0x5529('0xe'),_0x433a58,_0x5529('0xf'));logger[_0x5529('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x433a58,'request\x20sent',JSON['stringify'](_0x3615ad));if(_0x3615ad[_0x5529('0x11')]){if(_0x3615ad[_0x5529('0x11')][_0x5529('0x12')]===0x1f4){logger[_0x5529('0x11')](_0x5529('0xe'),_0x433a58,_0x3615ad[_0x5529('0x11')][_0x5529('0x13')]);return _0x4d21ff(_0x3615ad[_0x5529('0x11')]['message']);}logger[_0x5529('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x433a58,_0x3615ad[_0x5529('0x11')][_0x5529('0x13')]);return _0x393930(_0x3615ad[_0x5529('0x11')][_0x5529('0x13')]);}else{logger[_0x5529('0x14')](_0x5529('0xe'),_0x433a58,_0x5529('0xf'));_0x393930(_0x3615ad[_0x5529('0x15')][_0x5529('0x13')]);}})[_0x5529('0x16')](function(_0x5620c5){logger[_0x5529('0x11')](_0x5529('0xe'),_0x433a58,_0x5620c5);_0x4d21ff(_0x5620c5);});});} \ No newline at end of file +var _0x05fc=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x05fc,0x13a));var _0xc05f=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x05fc[_0x369151];return _0x4292d5;};'use strict';var _=require('lodash');var util=require(_0xc05f('0x0'));var moment=require(_0xc05f('0x1'));var BPromise=require(_0xc05f('0x2'));var rs=require(_0xc05f('0x3'));var fs=require('fs');var Redis=require(_0xc05f('0x4'));var db=require(_0xc05f('0x5'))['db'];var utils=require(_0xc05f('0x6'));var logger=require(_0xc05f('0x7'))('rpc');var config=require(_0xc05f('0x8'));var jayson=require(_0xc05f('0x9'));var client=jayson[_0xc05f('0xa')][_0xc05f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x374138,_0x1f1fc4,_0x1bd7f4){return new BPromise(function(_0x3cde6,_0x1f4543){return client[_0xc05f('0xc')](_0x374138,_0x1bd7f4)[_0xc05f('0xd')](function(_0x3d73a7){logger[_0xc05f('0xe')](_0xc05f('0xf'),_0x1f1fc4,_0xc05f('0x10'));logger[_0xc05f('0x11')](_0xc05f('0x12'),_0x1f1fc4,_0xc05f('0x10'),JSON[_0xc05f('0x13')](_0x3d73a7));if(_0x3d73a7['error']){if(_0x3d73a7['error'][_0xc05f('0x14')]===0x1f4){logger[_0xc05f('0x15')](_0xc05f('0xf'),_0x1f1fc4,_0x3d73a7[_0xc05f('0x15')][_0xc05f('0x16')]);return _0x1f4543(_0x3d73a7['error'][_0xc05f('0x16')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1f1fc4,_0x3d73a7[_0xc05f('0x15')]['message']);return _0x3cde6(_0x3d73a7[_0xc05f('0x15')]['message']);}else{logger[_0xc05f('0xe')](_0xc05f('0xf'),_0x1f1fc4,_0xc05f('0x10'));_0x3cde6(_0x3d73a7['result'][_0xc05f('0x16')]);}})[_0xc05f('0x17')](function(_0x39bb9b){logger[_0xc05f('0x15')](_0xc05f('0xf'),_0x1f1fc4,_0x39bb9b);_0x1f4543(_0x39bb9b);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 5ebee71..86dff19 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x5b1794,_0x5d061f){var _0x17322b=function(_0x23b27d){while(--_0x23b27d){_0x5b1794['push'](_0x5b1794['shift']());}};_0x17322b(++_0x5d061f);}(_0x2032,0xd9));var _0x2203=function(_0x22b39b,_0x38764a){_0x22b39b=_0x22b39b-0x0;var _0x4b3971=_0x2032[_0x22b39b];return _0x4b3971;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router; \ No newline at end of file +var _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 6efe4b9..af19567 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 _0xc375=['You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','bottom_right','#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','INTEGER','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','Send','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','ENUM','thumb','star','input','name','getDataValue','onlineForm','parse','setDataValue','stringify','TEXT','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc375,0x96));var _0x5c37=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xc375[_0x39780c];return _0x53c19b;};'use strict';var Sequelize=require(_0x5c37('0x0'));var rs=require(_0x5c37('0x1'));module[_0x5c37('0x2')]={'name':{'type':Sequelize[_0x5c37('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x5c37('0x3')],'allowNull':![],'unique':_0x5c37('0x4')},'description':{'type':Sequelize[_0x5c37('0x3')]},'mapKey':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x5c37('0x5')},'key':{'type':Sequelize[_0x5c37('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5c37('0x3')],'allowNull':![],'defaultValue':_0x5c37('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5c37('0x3')],'allowNull':![],'defaultValue':_0x5c37('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5c37('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5c37('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x5c37('0x9')),'defaultValue':_0x5c37('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x5c37('0xb')},'start_chat_button':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0xc')},'offline_chat_button':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5c37('0x10')},'noteTitle':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0x11')},'placeholderMessage':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0x12')},'closingMessage':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0x13')},'closingMessageButton':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0x14')},'ratingType':{'type':Sequelize[_0x5c37('0x15')]('star',_0x5c37('0x16')),'defaultValue':_0x5c37('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x5c37('0x18'),'variable':null,'config':{'placeholder':_0x5c37('0x19'),'type':'text','required':!![]},'props':{'title':_0x5c37('0x19'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x5c37('0x5'),'type':_0x5c37('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5c37('0x1a')](_0x5c37('0x1b'))?JSON[_0x5c37('0x1c')](this[_0x5c37('0x1a')](_0x5c37('0x1b'))):{};},'set':function(_0x485fc6){return this[_0x5c37('0x1d')](_0x5c37('0x1b'),JSON[_0x5c37('0x1e')](_0x485fc6));}},'offlineForm':{'type':Sequelize[_0x5c37('0x1f')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x5c37('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5c37('0x5'),'type':_0x5c37('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x5c37('0x20')},'props':{'title':_0x5c37('0x20'),'helpText':_0x5c37('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x5c37('0x1a')](_0x5c37('0x22'))?JSON[_0x5c37('0x1c')](this[_0x5c37('0x1a')](_0x5c37('0x22'))):{};},'set':function(_0xaf5b91){return this['setDataValue'](_0x5c37('0x22'),JSON['stringify'](_0xaf5b91));}},'token':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':function(){return rs[_0x5c37('0x23')]();}},'autoclose':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5c37('0x3')]},'forwardOffline':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5c37('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5c37('0x24')},'waitingMessage':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x5c37('0x25')},'offlineMessageBody':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0x27')},'sendUnmanaged':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5c37('0x1f')]},'showAgentAvatar':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5c37('0x1f')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0x28')},'verticalAlignment':{'type':Sequelize[_0x5c37('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x5c37('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5c37('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5c37('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5c37('0x3')],'defaultValue':_0x5c37('0x2a')},'systemAvatar':{'type':Sequelize[_0x5c37('0x1f')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5c37('0x7')],'comment':_0x5c37('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x5c37('0x8')],'defaultValue':![],'comment':_0x5c37('0x2c'),'set':function(_0x26f4dc){if(!_0x26f4dc)this[_0x5c37('0x1d')](_0x5c37('0x2d'),null);this[_0x5c37('0x1d')](_0x5c37('0x2e'),_0x26f4dc);}}}; \ No newline at end of file +var _0x8c97=['#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','randomstring','exports','STRING','email','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','star','thumb','stringify','input','name','text','onlineForm','getDataValue','setDataValue','Comments','Leave\x20your\x20comments','parse','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','alternate'];(function(_0x444a85,_0x1d1dcb){var _0x251685=function(_0x491bd8){while(--_0x491bd8){_0x444a85['push'](_0x444a85['shift']());}};_0x251685(++_0x1d1dcb);}(_0x8c97,0x137));var _0x78c9=function(_0xf4ad0,_0x1b53d8){_0xf4ad0=_0xf4ad0-0x0;var _0x17c21c=_0x8c97[_0xf4ad0];return _0x17c21c;};'use strict';var Sequelize=require(_0x78c9('0x0'));var rs=require(_0x78c9('0x1'));module[_0x78c9('0x2')]={'name':{'type':Sequelize[_0x78c9('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x78c9('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x78c9('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x78c9('0x4')},'mapKeyOffline':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x78c9('0x3')],'allowNull':![],'defaultValue':_0x78c9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x78c9('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x78c9('0x3')],'allowNull':![],'defaultValue':_0x78c9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x78c9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x78c9('0x3')]},'animation':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x78c9('0x9')](_0x78c9('0xa'),_0x78c9('0xb')),'defaultValue':_0x78c9('0xa')},'header_online':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0xc')},'start_chat_button':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0xd')},'header_offline':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x78c9('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x78c9('0xf')]},'closingQuestion':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0x11')},'noteTitle':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x78c9('0x13')},'closingMessage':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0xd')},'skipMessageButton':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x78c9('0x14')},'ratingType':{'type':Sequelize[_0x78c9('0x9')](_0x78c9('0x15'),_0x78c9('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x78c9('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x78c9('0xf')],'defaultValue':function(){return JSON[_0x78c9('0x17')]({'items':[{'type':_0x78c9('0x18'),'variable':null,'config':{'placeholder':_0x78c9('0x19'),'type':_0x78c9('0x1a'),'required':!![]},'props':{'title':_0x78c9('0x19'),'helpText':''}},{'type':_0x78c9('0x18'),'props':{'title':_0x78c9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x78c9('0x4'),'type':_0x78c9('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x78c9('0x1b'))?JSON['parse'](this[_0x78c9('0x1c')](_0x78c9('0x1b'))):{};},'set':function(_0x520bf7){return this[_0x78c9('0x1d')](_0x78c9('0x1b'),JSON[_0x78c9('0x17')](_0x520bf7));}},'offlineForm':{'type':Sequelize[_0x78c9('0xf')],'defaultValue':function(){return JSON[_0x78c9('0x17')]({'items':[{'type':'input','props':{'title':_0x78c9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x78c9('0x4'),'type':_0x78c9('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x78c9('0x1e'),'helpText':_0x78c9('0x1f')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x78c9('0x20')](this[_0x78c9('0x1c')]('offlineForm')):{};},'set':function(_0xd49185){return this[_0x78c9('0x1d')](_0x78c9('0x21'),JSON[_0x78c9('0x17')](_0xd49185));}},'token':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':function(){return rs[_0x78c9('0x22')]();}},'autoclose':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x78c9('0x3')]},'forwardOffline':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x78c9('0x3')]},'waitingTitle':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x78c9('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x78c9('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x78c9('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x78c9('0x3')]},'notificationTemplate':{'type':Sequelize[_0x78c9('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x78c9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x78c9('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x78c9('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x78c9('0x3')],'allowNull':![],'defaultValue':_0x78c9('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x78c9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x78c9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x78c9('0x3')],'defaultValue':_0x78c9('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x78c9('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x78c9('0x8')],'defaultValue':![],'comment':_0x78c9('0x2b'),'set':function(_0x176a6f){if(!_0x176a6f)this[_0x78c9('0x1d')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x176a6f);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index d43c323..4f27903 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 _0x3a70=['referer','%s\x20%s','browser','version','unknown','format','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','offline','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','utf8','toPairs','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','Tag','Tags','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','Interval','getProactiveActions','getLicense','custom','License','chatLicenseExceeded','Intervals','some','x-real-ip','connection','remoteAddress','virtual','render','alignment','verticalAlignment','textColor','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','http','client','test','Sequelize','ValidationError','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','update','destroy','get','stack','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','merge','name','ChatWebsite','includeAll','include','findAll','rows','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','describe','addDisposition','ChatWebsiteId','Disposition','findOne','sort','pick','filter','options','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','server/files/images/logos/','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','no\x20available\x20attributes','difference','createdAt','ListId','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','updatedAt','DESC','ChatApplication','Applications','applications','list','orderBy','priority','asc','account','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0x3a70,0x186));var _0x03a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a70[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x03a7('0x0'));var emlformat=require(_0x03a7('0x1'));var rimraf=require(_0x03a7('0x2'));var zipdir=require(_0x03a7('0x3'));var jsonpatch=require(_0x03a7('0x4'));var rp=require(_0x03a7('0x5'));var moment=require(_0x03a7('0x6'));var BPromise=require(_0x03a7('0x7'));var Mustache=require(_0x03a7('0x8'));var util=require(_0x03a7('0x9'));var path=require(_0x03a7('0xa'));var sox=require(_0x03a7('0xb'));var csv=require('to-csv');var ejs=require(_0x03a7('0xc'));var fs=require('fs');var _=require(_0x03a7('0xd'));var squel=require(_0x03a7('0xe'));var crypto=require(_0x03a7('0xf'));var jsforce=require(_0x03a7('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x03a7('0x11'));var querystring=require(_0x03a7('0x12'));var Papa=require('papaparse');var Redis=require(_0x03a7('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x03a7('0x14'));var as=require(_0x03a7('0x15'));var hardwareService=require(_0x03a7('0x16'));var logger=require('../../config/logger')(_0x03a7('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x03a7('0x18'))['db'];config[_0x03a7('0x19')]=_[_0x03a7('0x1a')](config[_0x03a7('0x19')],{'host':_0x03a7('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03a7('0x19')]));require(_0x03a7('0x1c'))[_0x03a7('0x1d')](socket);var jayson=require(_0x03a7('0x1e'));var client=jayson['client'][_0x03a7('0x1f')]({'port':0x232c});var client9002=jayson[_0x03a7('0x20')]['http']({'port':0x232a});var client9003=jayson[_0x03a7('0x20')][_0x03a7('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x4765c0,_0x16d4c1,_0x5acde7){if(_0x5acde7){var _0x52dfa5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x52dfa5[_0x03a7('0x21')](_0x16d4c1)){return _0x4765c0;}else{throw new db[(_0x03a7('0x22'))][(_0x03a7('0x23'))]('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 _0x4765c0;}}function respondWithRpcPromise(_0x45f0d7,_0xe4409e,_0x4a94bb,_0x4570a9){return new BPromise(function(_0x4b432e,_0x3101be){var _0x238ea8=_0x4570a9||client;return _0x238ea8['request'](_0x45f0d7,_0x4a94bb)[_0x03a7('0x24')](function(_0x43c744){logger[_0x03a7('0x25')](_0x03a7('0x26'),_0xe4409e,'request\x20sent');logger[_0x03a7('0x27')](_0x03a7('0x28'),_0xe4409e,_0x03a7('0x29'),JSON[_0x03a7('0x2a')](_0x43c744));if(_0x43c744['error']){if(_0x43c744[_0x03a7('0x2b')][_0x03a7('0x2c')]===0x1f4){logger[_0x03a7('0x2b')](_0x03a7('0x26'),_0xe4409e,_0x43c744[_0x03a7('0x2b')][_0x03a7('0x2d')]);return _0x3101be(_0x43c744['error'][_0x03a7('0x2d')]);}logger[_0x03a7('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0xe4409e,_0x43c744[_0x03a7('0x2b')][_0x03a7('0x2d')]);return _0x4b432e(_0x43c744[_0x03a7('0x2b')][_0x03a7('0x2d')]);}else{logger[_0x03a7('0x25')](_0x03a7('0x26'),_0xe4409e,_0x03a7('0x29'));_0x4b432e(_0x43c744[_0x03a7('0x2e')]['message']);}})[_0x03a7('0x2f')](function(_0x47282b){logger['error'](_0x03a7('0x26'),_0xe4409e,_0x47282b);_0x3101be(_0x47282b);});});}function respondWithStatusCode(_0x3070df,_0x3061d4){_0x3061d4=_0x3061d4||0xcc;return function(_0x1da9fa){if(_0x1da9fa){return _0x3070df[_0x03a7('0x30')](_0x3061d4);}return _0x3070df[_0x03a7('0x31')](_0x3061d4)[_0x03a7('0x32')]();};}function respondWithResult(_0x4701c9,_0x149a34){_0x149a34=_0x149a34||0xc8;return function(_0x46cfc4){if(_0x46cfc4){return _0x4701c9[_0x03a7('0x31')](_0x149a34)[_0x03a7('0x33')](_0x46cfc4);}};}function respondWithFilteredResult(_0x40ad83,_0x2eac58){return function(_0x2cda9d){if(_0x2cda9d){var _0x442094=_0x2cda9d[_0x03a7('0x34')],_0x519656=_0x2eac58[_0x03a7('0x35')],_0x47ee6e=_0x2eac58[_0x03a7('0x35')]+_0x2eac58[_0x03a7('0x36')],_0x25cba5;if(_0x47ee6e>=_0x442094){_0x47ee6e=_0x442094;_0x25cba5=0xc8;}else{_0x25cba5=0xce;}_0x40ad83['status'](_0x25cba5);return _0x40ad83[_0x03a7('0x37')](_0x03a7('0x38'),_0x519656+'-'+_0x47ee6e+'/'+_0x442094)[_0x03a7('0x33')](_0x2cda9d);}return null;};}function patchUpdates(_0x1ff02c){return function(_0x43ae1a){try{jsonpatch[_0x03a7('0x39')](_0x43ae1a,_0x1ff02c,!![]);}catch(_0x4f1544){return BPromise[_0x03a7('0x3a')](_0x4f1544);}return _0x43ae1a['save']();};}function saveUpdates(_0x454aa9,_0x22f6d4){return function(_0xf005b7){if(_0xf005b7){return _0xf005b7[_0x03a7('0x3b')](_0x454aa9)[_0x03a7('0x24')](function(_0x1a0d82){return _0x1a0d82;});}return null;};}function removeEntity(_0x46f510,_0x233481){return function(_0x43a525){if(_0x43a525){return _0x43a525[_0x03a7('0x3c')]()[_0x03a7('0x24')](function(){var _0x1b5cde=_0x43a525[_0x03a7('0x3d')]({'plain':!![]});var _0x3fe911='ChatWebsites';return db['UserProfileResource'][_0x03a7('0x3c')]({'where':{'type':_0x3fe911,'resourceId':_0x1b5cde['id']}})[_0x03a7('0x24')](function(){return _0x43a525;});})[_0x03a7('0x24')](function(){_0x46f510[_0x03a7('0x31')](0xcc)[_0x03a7('0x32')]();});}};}function handleEntityNotFound(_0xf40dee,_0x562fa5){return function(_0x23c8a4){if(!_0x23c8a4){_0xf40dee[_0x03a7('0x30')](0x194);}return _0x23c8a4;};}function handleError(_0x564c00,_0x34eb4c){_0x34eb4c=_0x34eb4c||0x1f4;return function(_0x32237b){logger[_0x03a7('0x2b')](_0x32237b[_0x03a7('0x3e')]);if(_0x32237b['name']){delete _0x32237b['name'];}_0x564c00[_0x03a7('0x31')](_0x34eb4c)[_0x03a7('0x3f')](_0x32237b);};}exports[_0x03a7('0x40')]=function(_0x121fd9,_0x5ce9fa){var _0x2671c9={'include':[{'model':db[_0x03a7('0x41')],'as':_0x03a7('0x42')}]},_0x51ee4f={},_0x340262={'count':0x0,'rows':[]};var _0x39ff43=_[_0x03a7('0x43')](db['ChatWebsite'][_0x03a7('0x44')],function(_0x15d8bb){return{'name':_0x15d8bb[_0x03a7('0x45')],'type':_0x15d8bb['type'][_0x03a7('0x46')]};});_0x51ee4f[_0x03a7('0x47')]=_[_0x03a7('0x43')](_0x39ff43,'name');_0x51ee4f[_0x03a7('0x48')]=_['keys'](_0x121fd9[_0x03a7('0x48')]);_0x51ee4f[_0x03a7('0x49')]=_[_0x03a7('0x4a')](_0x51ee4f[_0x03a7('0x47')],_0x51ee4f[_0x03a7('0x48')]);_0x2671c9['attributes']=_[_0x03a7('0x4a')](_0x51ee4f[_0x03a7('0x47')],qs[_0x03a7('0x4b')](_0x121fd9[_0x03a7('0x48')][_0x03a7('0x4b')]));_0x2671c9[_0x03a7('0x4c')]=_0x2671c9['attributes']['length']?_0x2671c9[_0x03a7('0x4c')]:_0x51ee4f[_0x03a7('0x47')];if(!_0x121fd9[_0x03a7('0x48')][_0x03a7('0x4d')](_0x03a7('0x4e'))){_0x2671c9['limit']=qs[_0x03a7('0x36')](_0x121fd9[_0x03a7('0x48')][_0x03a7('0x36')]);_0x2671c9['offset']=qs['offset'](_0x121fd9['query'][_0x03a7('0x35')]);}_0x2671c9[_0x03a7('0x4f')]=qs['sort'](_0x121fd9[_0x03a7('0x48')]['sort']);_0x2671c9[_0x03a7('0x50')]=qs[_0x03a7('0x49')](_['pick'](_0x121fd9['query'],_0x51ee4f[_0x03a7('0x49')]));if(_0x121fd9[_0x03a7('0x48')]['filter']){_0x2671c9[_0x03a7('0x50')]=_[_0x03a7('0x51')](_0x2671c9[_0x03a7('0x50')],{'$or':_['map'](_0x39ff43,function(_0x2a28d4){if(_0x2a28d4['type']!=='VIRTUAL'){var _0x4a6881={};_0x4a6881[_0x2a28d4[_0x03a7('0x52')]]={'$like':'%'+_0x121fd9[_0x03a7('0x48')]['filter']+'%'};return _0x4a6881;}})});}_0x2671c9=_[_0x03a7('0x51')]({},_0x2671c9,_0x121fd9['options']);var _0x573e84={'where':_0x2671c9['where']};return db[_0x03a7('0x53')]['count'](_0x573e84)[_0x03a7('0x24')](function(_0x15cff1){_0x340262[_0x03a7('0x34')]=_0x15cff1;if(_0x121fd9[_0x03a7('0x48')][_0x03a7('0x54')]){_0x2671c9[_0x03a7('0x55')]=[{'all':!![]}];}return db[_0x03a7('0x53')][_0x03a7('0x56')](_0x2671c9);})[_0x03a7('0x24')](function(_0x489ff9){_0x340262[_0x03a7('0x57')]=_0x489ff9;return _0x340262;})[_0x03a7('0x24')](respondWithFilteredResult(_0x5ce9fa,_0x2671c9))[_0x03a7('0x2f')](handleError(_0x5ce9fa,null));};exports[_0x03a7('0x58')]=function(_0x87774e,_0x5d2245){var _0x301e36={'raw':![],'where':{'id':_0x87774e[_0x03a7('0x59')]['id']},'include':[{'model':db[_0x03a7('0x41')],'as':'mandatoryDispositionPause'}]},_0x211bdd={};_0x211bdd['model']=_[_0x03a7('0x5a')](db[_0x03a7('0x53')][_0x03a7('0x44')]);_0x211bdd['query']=_['keys'](_0x87774e['query']);_0x211bdd[_0x03a7('0x49')]=_[_0x03a7('0x4a')](_0x211bdd[_0x03a7('0x47')],_0x211bdd[_0x03a7('0x48')]);_0x301e36[_0x03a7('0x4c')]=_['intersection'](_0x211bdd[_0x03a7('0x47')],qs['fields'](_0x87774e['query'][_0x03a7('0x4b')]));_0x301e36['attributes']=_0x301e36[_0x03a7('0x4c')][_0x03a7('0x5b')]?_0x301e36['attributes']:_0x211bdd[_0x03a7('0x47')];if(_0x87774e['query']['includeAll']){_0x301e36[_0x03a7('0x55')]=[{'all':!![]}];}_0x301e36=_[_0x03a7('0x51')]({},_0x301e36,_0x87774e['options']);return db[_0x03a7('0x53')][_0x03a7('0x5c')](_0x301e36)[_0x03a7('0x24')](handleEntityNotFound(_0x5d2245,null))['then'](respondWithResult(_0x5d2245,null))[_0x03a7('0x2f')](handleError(_0x5d2245,null));};exports[_0x03a7('0x5d')]=function(_0x133cf6,_0x340b51){return db[_0x03a7('0x53')]['create'](_0x133cf6[_0x03a7('0x5e')],{})[_0x03a7('0x24')](function(_0x47ac0a){var _0x16e499=_0x133cf6[_0x03a7('0x5f')][_0x03a7('0x3d')]({'plain':!![]});if(!_0x16e499)throw new Error(_0x03a7('0x60'));if(_0x16e499['role']===_0x03a7('0x5f')){var _0x2ab6ec=_0x47ac0a['get']({'plain':!![]});var _0x2e82f7=_0x03a7('0x61');return db[_0x03a7('0x62')][_0x03a7('0x5c')]({'where':{'name':_0x2e82f7,'userProfileId':_0x16e499[_0x03a7('0x63')]},'raw':!![]})[_0x03a7('0x24')](function(_0x2f0e1e){if(_0x2f0e1e&&_0x2f0e1e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2ab6ec[_0x03a7('0x52')],'resourceId':_0x2ab6ec['id'],'type':_0x2f0e1e[_0x03a7('0x52')],'sectionId':_0x2f0e1e['id']},{})[_0x03a7('0x24')](function(){return _0x47ac0a;});}else{return _0x47ac0a;}})[_0x03a7('0x2f')](function(_0x4b49b5){logger[_0x03a7('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b49b5);throw _0x4b49b5;});}return _0x47ac0a;})['then'](respondWithResult(_0x340b51,0xc9))['catch'](handleError(_0x340b51,null));};exports['update']=function(_0x47e100,_0x5974d4){if(_0x47e100['body']['id']){delete _0x47e100[_0x03a7('0x5e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x47e100[_0x03a7('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x03a7('0x42')}]})[_0x03a7('0x24')](handleEntityNotFound(_0x5974d4,null))['then'](saveUpdates(_0x47e100[_0x03a7('0x5e')],null))[_0x03a7('0x24')](respondWithResult(_0x5974d4,null))['catch'](handleError(_0x5974d4,null));};exports[_0x03a7('0x3c')]=function(_0x12133f,_0x5b0b6b){return db[_0x03a7('0x53')][_0x03a7('0x5c')]({'where':{'id':_0x12133f[_0x03a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b0b6b,null))[_0x03a7('0x24')](removeEntity(_0x5b0b6b,null))[_0x03a7('0x2f')](handleError(_0x5b0b6b,null));};exports[_0x03a7('0x64')]=function(_0x1467ec,_0x1b7c68){return db[_0x03a7('0x53')][_0x03a7('0x64')]()[_0x03a7('0x24')](respondWithResult(_0x1b7c68,null))[_0x03a7('0x2f')](handleError(_0x1b7c68,null));};exports[_0x03a7('0x65')]=function(_0x5dba12,_0x1bf3de,_0x30400a){if(_0x5dba12[_0x03a7('0x5e')]['id']){delete _0x5dba12[_0x03a7('0x5e')]['id'];}return db[_0x03a7('0x53')][_0x03a7('0x5c')]({'where':{'id':_0x5dba12[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x1bf3de,null))[_0x03a7('0x24')](function(_0x365181){if(_0x365181){_0x5dba12[_0x03a7('0x5e')][_0x03a7('0x66')]=_0x365181['id'];return db[_0x03a7('0x67')]['create'](_0x5dba12['body']);}})[_0x03a7('0x24')](respondWithResult(_0x1bf3de,null))['catch'](handleError(_0x1bf3de,null));};exports['getDispositions']=function(_0x1f77d9,_0x5347c3,_0x1086b5){var _0x215e91={'raw':![],'where':{}};var _0x30b592={};var _0x3a9e66={'count':0x0,'rows':[]};return db[_0x03a7('0x53')][_0x03a7('0x68')]({'where':{'id':_0x1f77d9[_0x03a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x5347c3,null))['then'](function(_0x489868){if(_0x489868){_0x30b592[_0x03a7('0x47')]=_['keys'](db[_0x03a7('0x67')][_0x03a7('0x44')]);_0x30b592['query']=_[_0x03a7('0x5a')](_0x1f77d9[_0x03a7('0x48')]);_0x30b592[_0x03a7('0x49')]=_[_0x03a7('0x4a')](_0x30b592['model'],_0x30b592[_0x03a7('0x48')]);_0x215e91[_0x03a7('0x4c')]=_['intersection'](_0x30b592[_0x03a7('0x47')],qs[_0x03a7('0x4b')](_0x1f77d9[_0x03a7('0x48')][_0x03a7('0x4b')]));_0x215e91[_0x03a7('0x4c')]=_0x215e91[_0x03a7('0x4c')]['length']?_0x215e91['attributes']:_0x30b592['model'];if(!_0x1f77d9[_0x03a7('0x48')]['hasOwnProperty'](_0x03a7('0x4e'))){_0x215e91[_0x03a7('0x36')]=qs[_0x03a7('0x36')](_0x1f77d9[_0x03a7('0x48')][_0x03a7('0x36')]);_0x215e91['offset']=qs['offset'](_0x1f77d9[_0x03a7('0x48')][_0x03a7('0x35')]);}_0x215e91['order']=qs[_0x03a7('0x69')](_0x1f77d9[_0x03a7('0x48')][_0x03a7('0x69')]);_0x215e91[_0x03a7('0x50')]=qs['filters'](_[_0x03a7('0x6a')](_0x1f77d9[_0x03a7('0x48')],_0x30b592[_0x03a7('0x49')]));_0x215e91[_0x03a7('0x50')]['ChatWebsiteId']=_0x489868['id'];if(_0x1f77d9['query'][_0x03a7('0x6b')]){_0x215e91[_0x03a7('0x50')]=_[_0x03a7('0x51')](_0x215e91['where'],{'$or':_['map'](_0x215e91[_0x03a7('0x4c')],function(_0x32b5b8){var _0x573e86={};_0x573e86[_0x32b5b8]={'$like':'%'+_0x1f77d9[_0x03a7('0x48')]['filter']+'%'};return _0x573e86;})});}_0x215e91=_['merge']({},_0x215e91,_0x1f77d9[_0x03a7('0x6c')]);return db[_0x03a7('0x67')][_0x03a7('0x34')]({'where':_0x215e91['where']})['then'](function(_0x4cfc01){_0x3a9e66[_0x03a7('0x34')]=_0x4cfc01;if(_0x1f77d9[_0x03a7('0x48')][_0x03a7('0x54')]){_0x215e91[_0x03a7('0x55')]=[{'all':!![]}];}return db[_0x03a7('0x67')][_0x03a7('0x56')](_0x215e91);})[_0x03a7('0x24')](function(_0x4a1147){_0x3a9e66[_0x03a7('0x57')]=_0x4a1147;return _0x3a9e66;});}})['then'](respondWithFilteredResult(_0x5347c3,_0x215e91))[_0x03a7('0x2f')](handleError(_0x5347c3,null));};exports[_0x03a7('0x6d')]=function(_0x378a41,_0x47c282,_0x37a687){return db[_0x03a7('0x53')]['find']({'where':{'id':_0x378a41['params']['id']}})['then'](handleEntityNotFound(_0x47c282,null))[_0x03a7('0x24')](function(_0x3b3c0f){if(_0x3b3c0f){return _0x3b3c0f[_0x03a7('0x6d')](_0x378a41[_0x03a7('0x48')][_0x03a7('0x6e')]);}})[_0x03a7('0x24')](respondWithStatusCode(_0x47c282,null))[_0x03a7('0x2f')](handleError(_0x47c282,null));};exports['addAnswer']=function(_0x22e8e5,_0x2bb59c,_0x3f1561){if(_0x22e8e5[_0x03a7('0x5e')]['id']){delete _0x22e8e5[_0x03a7('0x5e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x22e8e5[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x2bb59c,null))['then'](function(_0x2ad0ef){if(_0x2ad0ef){_0x22e8e5['body'][_0x03a7('0x66')]=_0x2ad0ef['id'];return db[_0x03a7('0x6f')][_0x03a7('0x5d')](_0x22e8e5['body']);}})[_0x03a7('0x24')](respondWithResult(_0x2bb59c,null))[_0x03a7('0x2f')](handleError(_0x2bb59c,null));};exports[_0x03a7('0x70')]=function(_0x46a834,_0x121e80,_0xaedd11){var _0x1a40d0={'raw':![],'where':{}};var _0x1dbd99={};var _0x3cb63b={'count':0x0,'rows':[]};return db[_0x03a7('0x53')][_0x03a7('0x68')]({'where':{'id':_0x46a834[_0x03a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x121e80,null))['then'](function(_0x39e7fa){if(_0x39e7fa){_0x1dbd99[_0x03a7('0x47')]=_[_0x03a7('0x5a')](db[_0x03a7('0x6f')]['rawAttributes']);_0x1dbd99[_0x03a7('0x48')]=_[_0x03a7('0x5a')](_0x46a834[_0x03a7('0x48')]);_0x1dbd99['filters']=_[_0x03a7('0x4a')](_0x1dbd99[_0x03a7('0x47')],_0x1dbd99[_0x03a7('0x48')]);_0x1a40d0['attributes']=_[_0x03a7('0x4a')](_0x1dbd99[_0x03a7('0x47')],qs[_0x03a7('0x4b')](_0x46a834[_0x03a7('0x48')]['fields']));_0x1a40d0[_0x03a7('0x4c')]=_0x1a40d0['attributes']['length']?_0x1a40d0['attributes']:_0x1dbd99['model'];if(!_0x46a834['query']['hasOwnProperty']('nolimit')){_0x1a40d0[_0x03a7('0x36')]=qs[_0x03a7('0x36')](_0x46a834[_0x03a7('0x48')][_0x03a7('0x36')]);_0x1a40d0['offset']=qs[_0x03a7('0x35')](_0x46a834[_0x03a7('0x48')][_0x03a7('0x35')]);}_0x1a40d0[_0x03a7('0x4f')]=qs[_0x03a7('0x69')](_0x46a834[_0x03a7('0x48')][_0x03a7('0x69')]);_0x1a40d0[_0x03a7('0x50')]=qs['filters'](_['pick'](_0x46a834[_0x03a7('0x48')],_0x1dbd99[_0x03a7('0x49')]));_0x1a40d0['where'][_0x03a7('0x66')]=_0x39e7fa['id'];if(_0x46a834[_0x03a7('0x48')][_0x03a7('0x6b')]){_0x1a40d0[_0x03a7('0x50')]=_[_0x03a7('0x51')](_0x1a40d0[_0x03a7('0x50')],{'$or':_[_0x03a7('0x43')](_0x1a40d0[_0x03a7('0x4c')],function(_0x1b83ae){var _0x1aca31={};_0x1aca31[_0x1b83ae]={'$like':'%'+_0x46a834[_0x03a7('0x48')]['filter']+'%'};return _0x1aca31;})});}_0x1a40d0=_[_0x03a7('0x51')]({},_0x1a40d0,_0x46a834[_0x03a7('0x6c')]);return db['CannedAnswer'][_0x03a7('0x34')]({'where':_0x1a40d0[_0x03a7('0x50')]})[_0x03a7('0x24')](function(_0x22ec1f){_0x3cb63b[_0x03a7('0x34')]=_0x22ec1f;if(_0x46a834[_0x03a7('0x48')][_0x03a7('0x54')]){_0x1a40d0['include']=[{'all':!![]}];}return db[_0x03a7('0x6f')][_0x03a7('0x56')](_0x1a40d0);})[_0x03a7('0x24')](function(_0x145725){_0x3cb63b[_0x03a7('0x57')]=_0x145725;return _0x3cb63b;});}})[_0x03a7('0x24')](respondWithFilteredResult(_0x121e80,_0x1a40d0))[_0x03a7('0x2f')](handleError(_0x121e80,null));};exports['removeAnswers']=function(_0x122bf0,_0x19a3e0,_0x322e97){return db[_0x03a7('0x53')][_0x03a7('0x5c')]({'where':{'id':_0x122bf0[_0x03a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x19a3e0,null))[_0x03a7('0x24')](function(_0x43e520){if(_0x43e520){return _0x43e520[_0x03a7('0x71')](_0x122bf0[_0x03a7('0x48')][_0x03a7('0x6e')]);}})[_0x03a7('0x24')](respondWithStatusCode(_0x19a3e0,null))[_0x03a7('0x2f')](handleError(_0x19a3e0,null));};exports[_0x03a7('0x72')]=function(_0x408121,_0x238dc9,_0x599d2a){_0x408121[_0x03a7('0x5e')][_0x03a7('0x73')]=_0x408121['file'][_0x03a7('0x74')];return db[_0x03a7('0x53')][_0x03a7('0x5c')]({'where':{'id':_0x408121[_0x03a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x238dc9,null))['then'](saveUpdates(_0x408121[_0x03a7('0x5e')],null))[_0x03a7('0x24')](respondWithResult(_0x238dc9,null))[_0x03a7('0x2f')](handleError(_0x238dc9,null));};exports[_0x03a7('0x75')]=function(_0x377a4d,_0xf4ac8f,_0x5894fa){_0x377a4d['body'][_0x03a7('0x76')]=_0x377a4d[_0x03a7('0x77')][_0x03a7('0x74')];return db[_0x03a7('0x53')][_0x03a7('0x5c')]({'where':{'id':_0x377a4d[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0xf4ac8f,null))[_0x03a7('0x24')](saveUpdates(_0x377a4d['body'],null))['then'](respondWithResult(_0xf4ac8f,null))[_0x03a7('0x2f')](handleError(_0xf4ac8f,null));};exports[_0x03a7('0x78')]=function(_0x594128,_0x50d24f,_0x183ec1){_0x594128['body']['customerAvatar']=_0x594128['file']['filename'];return db['ChatWebsite'][_0x03a7('0x5c')]({'where':{'id':_0x594128[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x50d24f,null))[_0x03a7('0x24')](saveUpdates(_0x594128['body'],null))['then'](respondWithResult(_0x50d24f,null))[_0x03a7('0x2f')](handleError(_0x50d24f,null));};exports[_0x03a7('0x79')]=function(_0x2a4e93,_0x4b8c8b,_0x104ec6){_0x2a4e93['body'][_0x03a7('0x7a')]=_0x2a4e93[_0x03a7('0x77')][_0x03a7('0x74')];return db[_0x03a7('0x53')][_0x03a7('0x5c')]({'where':{'id':_0x2a4e93[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x4b8c8b,null))[_0x03a7('0x24')](saveUpdates(_0x2a4e93[_0x03a7('0x5e')],null))[_0x03a7('0x24')](respondWithResult(_0x4b8c8b,null))[_0x03a7('0x2f')](handleError(_0x4b8c8b,null));};exports[_0x03a7('0x7b')]=function(_0x5b680a,_0x268240,_0x10ed7d){var _0xc30db1=path[_0x03a7('0x7c')](config[_0x03a7('0x7d')],_0x03a7('0x7e'));var _0x5cb7f6={'where':{'id':_0x5b680a[_0x03a7('0x59')]['id']},'attributes':['id',_0x03a7('0x73')],'raw':!![]};var _0x1e796d=![];return require(_0x03a7('0x7f'))['getLicense']()[_0x03a7('0x24')](function(_0x30c0d7){if(_0x30c0d7){_0x1e796d=_0x30c0d7['custom'];}})['then'](function(){return db[_0x03a7('0x53')][_0x03a7('0x5c')](_0x5cb7f6);})[_0x03a7('0x24')](handleEntityNotFound(_0x268240,null))[_0x03a7('0x24')](function(_0x3bc019){if(_0x3bc019){if(!_['isNil'](_0x3bc019[_0x03a7('0x73')])){if(fs['existsSync'](path[_0x03a7('0x7c')](config['root'],'server/files/images/logos/',_0x3bc019[_0x03a7('0x73')]))&&_0x1e796d){_0xc30db1=path[_0x03a7('0x7c')](config['root'],_0x03a7('0x80'),_0x3bc019['sitepic']);}}return _0x268240['download'](_0xc30db1);}})['catch'](handleError(_0x268240,null));};exports['getAvatar']=function(_0x859f49,_0x1e0fa2,_0x208432){var _0x407a10=path[_0x03a7('0x7c')](config[_0x03a7('0x7d')],_0x03a7('0x81'));var _0x4849cf={'where':{'id':_0x859f49[_0x03a7('0x59')]['id']},'attributes':['id',_0x03a7('0x76')],'raw':!![]};return db['ChatWebsite'][_0x03a7('0x5c')](_0x4849cf)[_0x03a7('0x24')](handleEntityNotFound(_0x1e0fa2,null))[_0x03a7('0x24')](function(_0x1c7f4b){if(_0x1c7f4b){if(!_[_0x03a7('0x82')](_0x1c7f4b[_0x03a7('0x76')])){if(fs[_0x03a7('0x83')](path[_0x03a7('0x7c')](config[_0x03a7('0x7d')],_0x03a7('0x84'),_0x1c7f4b[_0x03a7('0x76')]))){_0x407a10=path[_0x03a7('0x7c')](config[_0x03a7('0x7d')],_0x03a7('0x84'),_0x1c7f4b[_0x03a7('0x76')]);}}return _0x1e0fa2[_0x03a7('0x85')](_0x407a10);}})['catch'](handleError(_0x1e0fa2,null));};exports[_0x03a7('0x86')]=function(_0x41c7c7,_0x4cd1d2,_0x267a11){var _0x3707c2=path[_0x03a7('0x7c')](config['root'],_0x03a7('0x87'));var _0x51a15f={'where':{'id':_0x41c7c7['params']['id']},'attributes':['id',_0x03a7('0x88'),_0x03a7('0x89')],'raw':!![]};return db[_0x03a7('0x53')][_0x03a7('0x5c')](_0x51a15f)[_0x03a7('0x24')](handleEntityNotFound(_0x4cd1d2,null))[_0x03a7('0x24')](function(_0x2c4cde){if(_0x2c4cde){if(!_['isNil'](_0x2c4cde['customerAvatar'])){if(fs[_0x03a7('0x83')](path[_0x03a7('0x7c')](config['root'],'server/files/images/avatars/',_0x2c4cde[_0x03a7('0x88')]))&&_0x2c4cde[_0x03a7('0x89')]){_0x3707c2=path['join'](config[_0x03a7('0x7d')],_0x03a7('0x84'),_0x2c4cde[_0x03a7('0x88')]);}}return _0x4cd1d2[_0x03a7('0x85')](_0x3707c2);}})[_0x03a7('0x2f')](handleError(_0x4cd1d2,null));};exports[_0x03a7('0x8a')]=function(_0x4f90ba,_0x3cc845,_0x37ee7f){var _0x568581=path[_0x03a7('0x7c')](config['root'],_0x03a7('0x8b'));var _0x4c0483={'where':{'id':_0x4f90ba[_0x03a7('0x59')]['id']},'attributes':['id',_0x03a7('0x7a')],'raw':!![]};return db[_0x03a7('0x53')][_0x03a7('0x5c')](_0x4c0483)[_0x03a7('0x24')](handleEntityNotFound(_0x3cc845,null))[_0x03a7('0x24')](function(_0x7345c9){if(_0x7345c9){if(!_[_0x03a7('0x82')](_0x7345c9[_0x03a7('0x7a')])){if(fs[_0x03a7('0x83')](path[_0x03a7('0x7c')](config[_0x03a7('0x7d')],'server/files/images/avatars/',_0x7345c9[_0x03a7('0x7a')]))){_0x568581=path['join'](config[_0x03a7('0x7d')],'server/files/images/avatars/',_0x7345c9['systemAvatar']);}}return _0x3cc845['download'](_0x568581);}})['catch'](handleError(_0x3cc845,null));};exports[_0x03a7('0x8c')]=function(_0x377f18,_0x50145c,_0x1262f1){var _0xe15295=require(_0x03a7('0x8d'));var _0x31c317=new _0xe15295();var _0x52fe1e=_0x31c317[_0x03a7('0x8e')](_0x377f18[_0x03a7('0x8f')]['user-agent'])[_0x03a7('0x90')]();var _0x1ff74e={'body':_0x377f18[_0x03a7('0x5e')],'channel':_0x03a7('0x91')};var _0x28c94b=[];var _0x382088=[];var _0x3c61af={};var _0x5167a0=![];return db[_0x03a7('0x92')][_0x03a7('0x64')]()[_0x03a7('0x24')](function(_0x1728fb){if(!_0x1728fb){throw new db[(_0x03a7('0x22'))][(_0x03a7('0x23'))](_0x03a7('0x93'));}_0x28c94b=_[_0x03a7('0x94')](_[_0x03a7('0x5a')](_0x1728fb),['createdAt','updatedAt']);_0x382088=_[_0x03a7('0x94')](_['keys'](_0x1728fb),[_0x03a7('0x95'),'updatedAt','CompanyId',_0x03a7('0x96')]);if(_0x377f18[_0x03a7('0x5e')]['id']){delete _0x377f18[_0x03a7('0x5e')]['id'];}if(_['isNil'](_0x377f18[_0x03a7('0x5e')][_0x03a7('0x97')])){throw new db['Sequelize'][(_0x03a7('0x23'))](_0x03a7('0x98'));}if(_['isNil'](_0x377f18[_0x03a7('0x5e')]['body'])||_0x377f18[_0x03a7('0x5e')][_0x03a7('0x5e')]===''){throw new db[(_0x03a7('0x22'))][(_0x03a7('0x23'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x03a7('0x82')](_0x377f18[_0x03a7('0x5e')]['mapKey'])){throw new db[(_0x03a7('0x22'))][(_0x03a7('0x23'))](_0x03a7('0x99')+_0x382088);}if(!_[_0x03a7('0x9a')](_0x382088,_0x377f18['body']['mapKey'])){throw new db['Sequelize'][(_0x03a7('0x23'))](_0x03a7('0x9b')+_0x382088);}_0x3c61af[_0x377f18[_0x03a7('0x5e')][_0x03a7('0x9c')]]=_0x377f18[_0x03a7('0x5e')][_0x03a7('0x97')];})['then'](function(){return db[_0x03a7('0x53')][_0x03a7('0x5c')]({'where':{'id':_0x377f18[_0x03a7('0x59')]['id']},'include':[{'model':db[_0x03a7('0x9d')],'as':_0x03a7('0x9e'),'include':[{'model':db[_0x03a7('0x92')],'as':'Contacts','where':_0x3c61af,'limit':0x1,'order':[[_0x03a7('0x9f'),_0x03a7('0xa0')]]}]},{'model':db[_0x03a7('0xa1')],'as':_0x03a7('0xa2')}]});})['then'](handleEntityNotFound(_0x50145c,null))['then'](function(_0x533ccf){if(_0x533ccf&&_0x533ccf['List']){_0x1ff74e['account']=_0x533ccf;_0x1ff74e[_0x03a7('0xa3')]=_0x533ccf['Applications'];_0x1ff74e[_0x03a7('0xa4')]=_0x533ccf['List'];_0x1ff74e[_0x03a7('0xa3')]=_[_0x03a7('0xa5')](_0x1ff74e['applications'],[_0x03a7('0xa6')],[_0x03a7('0xa7')]);if(_0x1ff74e[_0x03a7('0xa8')][_0x03a7('0xa2')]){delete _0x1ff74e['account']['Applications'];}if(_0x1ff74e[_0x03a7('0xa8')][_0x03a7('0x9e')]&&_0x1ff74e[_0x03a7('0xa8')][_0x03a7('0x9e')][_0x03a7('0xa9')][_0x03a7('0x5b')]){return _0x1ff74e['account'][_0x03a7('0x9e')][_0x03a7('0xa9')][0x0];}var _0x365249=_[_0x03a7('0x1a')](_0x377f18[_0x03a7('0x5e')],{'firstName':_0x377f18['body'][_0x03a7('0x97')],'ListId':_0x533ccf[_0x03a7('0x96')]});_0x365249[_0x377f18[_0x03a7('0x5e')][_0x03a7('0x9c')]]=_0x377f18['body'][_0x03a7('0x97')];return db[_0x03a7('0x92')][_0x03a7('0x5d')](_0x365249,{'fields':_0x28c94b,'raw':!![]});}})[_0x03a7('0x24')](handleEntityNotFound(_0x50145c,null))[_0x03a7('0x24')](function(_0x4f1a12){_0x1ff74e[_0x03a7('0xaa')]=_0x4f1a12;var _0x42e814=_0x377f18[_0x03a7('0x5e')][_0x03a7('0xab')];if(_0x377f18[_0x03a7('0x8f')][_0x03a7('0xac')]){_0x42e814=_0x377f18['headers'][_0x03a7('0xac')];}else if(_0x377f18[_0x03a7('0x8f')][_0x03a7('0xad')]){_0x42e814=_[_0x03a7('0xae')](_0x377f18[_0x03a7('0x8f')][_0x03a7('0xad')]['split'](','));}if(_0x4f1a12){var _0x13b7c7={'ContactId':_0x4f1a12['id'],'ChatWebsiteId':_0x377f18[_0x03a7('0x59')]['id'],'from':(_0x4f1a12[_0x03a7('0xaf')]||'')+'\x20'+(_0x4f1a12[_0x03a7('0xb0')]||''),'customerIp':_0x42e814,'customerPort':_0x377f18[_0x03a7('0x8f')][_0x03a7('0xb1')]?_0x377f18[_0x03a7('0x8f')][_0x03a7('0xb1')]:null,'referer':_0x377f18[_0x03a7('0x5e')][_0x03a7('0xb2')],'browserName':_0x52fe1e['browser'][_0x03a7('0x52')]&&_0x52fe1e['browser']['version']?util['format'](_0x03a7('0xb3'),_0x52fe1e[_0x03a7('0xb4')]['name'],_0x52fe1e[_0x03a7('0xb4')][_0x03a7('0xb5')]):_0x03a7('0xb6'),'browserVersion':_0x52fe1e[_0x03a7('0xb4')]['version']||'unknown','osName':util[_0x03a7('0xb7')](_0x03a7('0xb3'),_0x52fe1e['os']['name'],_0x52fe1e['os'][_0x03a7('0xb5')]),'osVersion':_0x52fe1e['os']['version'],'deviceModel':_0x52fe1e[_0x03a7('0xb8')][_0x03a7('0x47')]&&_0x52fe1e['device'][_0x03a7('0xb9')]?util[_0x03a7('0xb7')](_0x03a7('0xba'),_0x52fe1e[_0x03a7('0xb8')][_0x03a7('0x47')],_0x52fe1e[_0x03a7('0xb8')][_0x03a7('0xb9')],_0x52fe1e[_0x03a7('0xb8')][_0x03a7('0xbb')]):null,'deviceVendor':_0x52fe1e['device'][_0x03a7('0xb9')],'deviceType':_0x52fe1e[_0x03a7('0xb8')][_0x03a7('0xbb')],'formData':JSON[_0x03a7('0x2a')](_0x377f18[_0x03a7('0x5e')])};var _0x17e03f={'ChatWebsiteId':_0x377f18[_0x03a7('0x59')]['id'],'closed':![]};if(_0x377f18[_0x03a7('0x5e')]['threadId']){_0x17e03f[_0x03a7('0xbc')]=_0x377f18[_0x03a7('0x5e')][_0x03a7('0xbc')];return db[_0x03a7('0xbd')][_0x03a7('0x5c')]({'where':_0x17e03f})[_0x03a7('0x24')](function(_0x2840ba){if(_0x2840ba){return[_0x2840ba,![]];}_0x13b7c7['threadId']=_0x377f18[_0x03a7('0x5e')]['threadId'];_0x13b7c7[_0x03a7('0xbe')]=_0x377f18[_0x03a7('0x5e')]['externalUrl'];return db[_0x03a7('0xbd')][_0x03a7('0x5d')](_0x13b7c7)[_0x03a7('0x24')](function(_0x45eab3){return[_0x45eab3,!![]];});});}_0x17e03f[_0x03a7('0xbf')]=_0x4f1a12['id'];if(_0x377f18['body'][_0x03a7('0xc0')]&&_0x377f18[_0x03a7('0x5e')][_0x03a7('0xc0')]['id']){_0x17e03f['id']=_0x377f18['body'][_0x03a7('0xc0')]['id'];return db[_0x03a7('0xbd')][_0x03a7('0x5c')]({'where':_0x17e03f})[_0x03a7('0x24')](function(_0x37b8cc){if(_0x37b8cc){return[_0x37b8cc,![]];}return db[_0x03a7('0xbd')][_0x03a7('0x5d')](_0x13b7c7)[_0x03a7('0x24')](function(_0x5a52fd){return[_0x5a52fd,!![]];});});}return db[_0x03a7('0xbd')][_0x03a7('0x5d')](_0x13b7c7)['then'](function(_0x56cc79){return[_0x56cc79,!![]];});}})[_0x03a7('0xc1')](function(_0x3492bc,_0x51dd76){if(_0x3492bc){_0x5167a0=_0x51dd76;if(!_0x51dd76){var _0x4db273={'from':(_0x1ff74e[_0x03a7('0xaa')][_0x03a7('0xaf')]||'')+'\x20'+(_0x1ff74e[_0x03a7('0xaa')][_0x03a7('0xb0')]||'')};if(_0x377f18[_0x03a7('0x5e')][_0x03a7('0xbc')]&&_0x377f18[_0x03a7('0x5e')][_0x03a7('0xc2')]&&_0x377f18[_0x03a7('0x5e')][_0x03a7('0xbc')]!=_0x377f18[_0x03a7('0x5e')][_0x03a7('0xc2')]){_0x4db273[_0x03a7('0xbc')]=_0x377f18[_0x03a7('0x5e')][_0x03a7('0xc2')];}return _0x3492bc[_0x03a7('0x3b')](_0x4db273);}else{return _0x3492bc;}}})[_0x03a7('0x24')](function(_0x5f2aa2){_0x1ff74e[_0x03a7('0xc0')]=_0x5f2aa2['get']({'plain':!![]});_0x1ff74e['interaction']['created']=_0x5167a0;if(_0x1ff74e[_0x03a7('0xc0')][_0x03a7('0xc3')]){if(_0x1ff74e[_0x03a7('0xa8')][_0x03a7('0xc4')]){_0x1ff74e[_0x03a7('0xa3')][_0x03a7('0xc5')]({'id':0x0,'priority':_0x1ff74e[_0x03a7('0xa3')]['length']+0x1,'app':'close','appdata':_0x03a7('0xc6'),'interval':'*,*,*,*'});}}return db[_0x03a7('0xc7')][_0x03a7('0x5d')]({'body':_0x377f18[_0x03a7('0x5e')][_0x03a7('0x5e')],'ChatWebsiteId':_0x377f18[_0x03a7('0x59')]['id'],'ChatInteractionId':_0x5f2aa2['id'],'direction':'in','ContactId':_0x1ff74e[_0x03a7('0xaa')]['id'],'AttachmentId':_0x377f18['body'][_0x03a7('0xc8')]});})['then'](function(_0x584b9e){_0x1ff74e[_0x03a7('0x2d')]=_0x584b9e;if(_0x1ff74e[_0x03a7('0xc0')]['UserId']){return db[_0x03a7('0xc9')][_0x03a7('0x5c')]({'attributes':['id',_0x03a7('0x52')],'where':{'id':_0x1ff74e[_0x03a7('0xc0')][_0x03a7('0xca')]}})[_0x03a7('0x24')](function(_0x351d0b){if(_0x351d0b){_0x1ff74e[_0x03a7('0xa3')][_0x03a7('0xcb')]({'id':0x0,'priority':0x0,'app':_0x03a7('0xcc'),'appdata':_0x351d0b[_0x03a7('0x52')]+','+(_0x1ff74e[_0x03a7('0xa8')][_0x03a7('0xcd')]||0xa),'interval':'*,*,*,*'});_0x1ff74e[_0x03a7('0xce')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x1ff74e);});}return respondWithRpcPromise('Start',_0x03a7('0xcf'),_0x1ff74e);})[_0x03a7('0x24')](function(_0x359e3b){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x359e3b},client9002);return _0x359e3b;})[_0x03a7('0x24')](respondWithResult(_0x50145c,null))[_0x03a7('0x2f')](handleError(_0x50145c,null));};exports[_0x03a7('0xd0')]=function(_0x15b834,_0x3ab256,_0x2a2e4e){var _0x5ce6c5,_0x1bf22e,_0x44519c;var _0x28a139=[];var _0xc3c40c=[];var _0x11918d={};return db[_0x03a7('0x92')][_0x03a7('0x64')]()[_0x03a7('0x24')](function(_0x24e8b){if(!_0x24e8b){throw new db[(_0x03a7('0x22'))][(_0x03a7('0x23'))]('no\x20available\x20attributes');}_0xc3c40c=_['difference'](_[_0x03a7('0x5a')](_0x24e8b),[_0x03a7('0x95'),_0x03a7('0x9f')]);_0x28a139=_[_0x03a7('0x94')](_[_0x03a7('0x5a')](_0x24e8b),[_0x03a7('0x95'),_0x03a7('0x9f'),_0x03a7('0xd1'),'ListId']);if(_0x15b834[_0x03a7('0x5e')]['id']){delete _0x15b834[_0x03a7('0x5e')]['id'];}if(_['isNil'](_0x15b834[_0x03a7('0x5e')][_0x03a7('0x97')])){throw _0x3ab256['status'](0x1f4)[_0x03a7('0x3f')](new db[(_0x03a7('0x22'))]['ValidationError'](_0x03a7('0x98')));}if(_['isNil'](_0x15b834['body'][_0x03a7('0x5e')])||_0x15b834[_0x03a7('0x5e')][_0x03a7('0x5e')]===''){throw _0x3ab256[_0x03a7('0x31')](0x1f4)[_0x03a7('0x3f')](new db['Sequelize'][(_0x03a7('0x23'))](_0x03a7('0xd2')));}if(_[_0x03a7('0x82')](_0x15b834[_0x03a7('0x5e')][_0x03a7('0xd3')])){throw _0x3ab256['status'](0x1f4)[_0x03a7('0x3f')](new db['Sequelize'][(_0x03a7('0x23'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x28a139));}if(!_[_0x03a7('0x9a')](_0x28a139,_0x15b834[_0x03a7('0x5e')][_0x03a7('0xd3')])){throw _0x3ab256[_0x03a7('0x31')](0x1f4)['send'](new db[(_0x03a7('0x22'))][(_0x03a7('0x23'))](_0x03a7('0xd4')+_0x28a139));}_0x11918d[_0x15b834['body'][_0x03a7('0xd3')]]=_0x15b834[_0x03a7('0x5e')][_0x03a7('0x97')];})[_0x03a7('0x24')](function(){return db[_0x03a7('0x53')][_0x03a7('0x5c')]({'where':{'id':_0x15b834['params']['id']},'include':[{'model':db[_0x03a7('0x9d')],'as':_0x03a7('0x9e')}]});})['then'](handleEntityNotFound(_0x3ab256,null))[_0x03a7('0x24')](function(_0x16f779){if(_0x16f779&&_0x16f779[_0x03a7('0x9e')]){_0x1bf22e=_0x16f779;var _0x134df0=_[_0x03a7('0x1a')](_0x15b834[_0x03a7('0x5e')],{'firstName':_0x15b834[_0x03a7('0x5e')][_0x03a7('0x97')],'phone':_0x15b834[_0x03a7('0x5e')][_0x03a7('0x97')],'ListId':_0x16f779['ListId']});_0x134df0[_0x15b834[_0x03a7('0x5e')]['mapKeyOffline']]=_0x15b834[_0x03a7('0x5e')][_0x03a7('0x97')];return db[_0x03a7('0x92')]['findOrCreate']({'where':_0x11918d,'defaults':_0x134df0});}})[_0x03a7('0xc1')](function(_0x33e722){if(_0x33e722){_0x44519c=_0x33e722;var _0x35c572=fs['readFileSync'](path[_0x03a7('0x7c')](config[_0x03a7('0x7d')],'server/files/templates/chatOfflineMessage.ejs'),_0x03a7('0xd5'));var _0x2ce4f4=ejs['render'](_0x35c572,{'body':_[_0x03a7('0xd6')](_0x15b834['body'][_0x03a7('0x5e')]),'bodyTitle':_0x1bf22e['offlineMessageBody']});return db[_0x03a7('0xd7')][_0x03a7('0x5d')]({'body':_0x2ce4f4,'ContactId':_0x33e722['id'],'ChatWebsiteId':_0x1bf22e['id']});}})[_0x03a7('0x24')](function(_0x3023bf){if(_0x3023bf){_0x5ce6c5=_0x3023bf;return db[_0x03a7('0xd8')][_0x03a7('0x68')]({'where':{'service':!![]},'include':[{'model':db[_0x03a7('0xd9')],'as':_0x03a7('0xda'),'raw':!![]}]});}})[_0x03a7('0x24')](function(_0x1a5c98){if(_0x1a5c98&&_0x1a5c98['Smtp']&&_0x1bf22e[_0x03a7('0xdb')]){var _0x14ea5a={'tls':{'rejectUnauthorized':![]}};if(_0x1a5c98['Smtp'][_0x03a7('0xdc')]){_0x14ea5a[_0x03a7('0xdc')]=_0x1a5c98['Smtp'][_0x03a7('0xdc')];}else{_0x14ea5a[_0x03a7('0xdd')]=_0x1a5c98[_0x03a7('0xda')][_0x03a7('0xdd')];_0x14ea5a[_0x03a7('0xde')]=_0x1a5c98[_0x03a7('0xda')]['port'];_0x14ea5a[_0x03a7('0xdf')]=_0x1a5c98[_0x03a7('0xda')]['secure'];}if(_0x1a5c98[_0x03a7('0xda')]['authentication']){_0x14ea5a[_0x03a7('0xe0')]={'user':_0x1a5c98['Smtp'][_0x03a7('0x5f')],'pass':_0x1a5c98[_0x03a7('0xda')]['pass']};}return respondWithRpcPromise(_0x03a7('0xe1'),_0x03a7('0xe2'),{'account':_0x14ea5a,'message':{'from':util[_0x03a7('0xb7')](_0x03a7('0xe3'),_0x1a5c98['name'],_0x1a5c98[_0x03a7('0xe4')]||_0x1a5c98[_0x03a7('0xda')][_0x03a7('0x5f')]),'to':_0x1bf22e['forwardOfflineAddress'],'subject':_0x1bf22e[_0x03a7('0xe5')],'text':_0x5ce6c5[_0x03a7('0x5e')]}},client9003)[_0x03a7('0x24')](function(){return _0x5ce6c5;})[_0x03a7('0x2f')](function(_0x2c4af5){console[_0x03a7('0x2b')](_0x2c4af5);});}})['then'](function(){if(_0x5ce6c5){return _0x5ce6c5;}})['then'](respondWithResult(_0x3ab256,null))[_0x03a7('0x2f')](handleError(_0x3ab256,null));};exports['addInteraction']=function(_0x569274,_0x4d15e1,_0x5908f7){return db[_0x03a7('0xbd')]['find']({'where':{'id':_0x569274['params']['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x4d15e1,null))[_0x03a7('0x24')](function(_0x136d57){if(_0x136d57){return _0x136d57[_0x03a7('0xe6')](_0x569274[_0x03a7('0x5e')]['ids'],_[_0x03a7('0xe7')](_0x569274[_0x03a7('0x5e')],[_0x03a7('0x6e'),'id'])||{});}})[_0x03a7('0x24')](respondWithResult(_0x4d15e1,null))['catch'](handleError(_0x4d15e1,null));};exports[_0x03a7('0xe8')]=function(_0x2e00f8,_0x3b0e17,_0x4d64ea){var _0x1259bf={'raw':![],'where':{}};var _0x2a9f0f={};var _0xcc71e5={'count':0x0,'rows':[]};return db[_0x03a7('0x53')][_0x03a7('0x68')]({'where':{'id':_0x2e00f8[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x3b0e17,null))['then'](function(_0x49ffba){if(_0x49ffba){_0x2a9f0f[_0x03a7('0x47')]=_[_0x03a7('0x5a')](db[_0x03a7('0xbd')][_0x03a7('0x44')]);_0x2a9f0f[_0x03a7('0x48')]=_[_0x03a7('0x5a')](_0x2e00f8[_0x03a7('0x48')]);_0x2a9f0f[_0x03a7('0x49')]=_['intersection'](_0x2a9f0f[_0x03a7('0x47')],_0x2a9f0f[_0x03a7('0x48')]);_0x1259bf[_0x03a7('0x4c')]=_[_0x03a7('0x4a')](_0x2a9f0f[_0x03a7('0x47')],qs[_0x03a7('0x4b')](_0x2e00f8[_0x03a7('0x48')][_0x03a7('0x4b')]));_0x1259bf[_0x03a7('0x4c')]=_0x1259bf['attributes']['length']?_0x1259bf[_0x03a7('0x4c')]:_0x2a9f0f[_0x03a7('0x47')];if(!_0x2e00f8[_0x03a7('0x48')][_0x03a7('0x4d')](_0x03a7('0x4e'))){_0x1259bf[_0x03a7('0x36')]=qs[_0x03a7('0x36')](_0x2e00f8[_0x03a7('0x48')][_0x03a7('0x36')]);_0x1259bf[_0x03a7('0x35')]=qs[_0x03a7('0x35')](_0x2e00f8['query'][_0x03a7('0x35')]);}_0x1259bf[_0x03a7('0x4f')]=qs['sort'](_0x2e00f8[_0x03a7('0x48')][_0x03a7('0x69')]);_0x1259bf['where']=qs[_0x03a7('0x49')](_[_0x03a7('0x6a')](_0x2e00f8[_0x03a7('0x48')],_0x2a9f0f[_0x03a7('0x49')]));_0x1259bf['where'][_0x03a7('0x66')]=_0x49ffba['id'];if(_0x2e00f8[_0x03a7('0x48')]['filter']){_0x1259bf[_0x03a7('0x50')]=_[_0x03a7('0x51')](_0x1259bf[_0x03a7('0x50')],{'$or':_[_0x03a7('0x43')](_0x1259bf[_0x03a7('0x4c')],function(_0x397e2d){var _0x26fd5d={};_0x26fd5d[_0x397e2d]={'$like':'%'+_0x2e00f8[_0x03a7('0x48')][_0x03a7('0x6b')]+'%'};return _0x26fd5d;})});}_0x1259bf=_[_0x03a7('0x51')]({},_0x1259bf,_0x2e00f8[_0x03a7('0x6c')]);return db[_0x03a7('0xbd')][_0x03a7('0x34')]({'where':_0x1259bf['where']})[_0x03a7('0x24')](function(_0x25d030){_0xcc71e5[_0x03a7('0x34')]=_0x25d030;if(_0x2e00f8['query'][_0x03a7('0x54')]){_0x1259bf['include']=[{'model':db['CmContact'],'as':_0x03a7('0xe9'),'required':![]},{'model':db[_0x03a7('0xc9')],'as':_0x03a7('0xea'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x03a7('0xeb')],'as':_0x03a7('0xec'),'attributes':['id',_0x03a7('0x52'),_0x03a7('0xed')],'where':_0x2e00f8['query'][_0x03a7('0xee')]?{'id':_0x2e00f8['query'][_0x03a7('0xee')]}:undefined,'required':_0x2e00f8[_0x03a7('0x48')][_0x03a7('0xee')]?!![]:![]}];}return db['ChatInteraction'][_0x03a7('0x56')](_0x1259bf);})[_0x03a7('0x24')](function(_0x3d9824){_0xcc71e5[_0x03a7('0x57')]=_0x3d9824;return _0xcc71e5;});}})[_0x03a7('0x24')](respondWithFilteredResult(_0x3b0e17,_0x1259bf))[_0x03a7('0x2f')](handleError(_0x3b0e17,null));};function iftimePromise(_0x3d2b1b,_0x28c910){return respondWithRpcPromise(_0x03a7('0xef'),'getSnippet',{'command':_0x28c910[_0x03a7('0xf0')]?util['format']('iftime\x20%s,%s',_0x3d2b1b[_0x03a7('0xf1')],_0x28c910[_0x03a7('0xf0')]):util[_0x03a7('0xb7')](_0x03a7('0xf2'),_0x3d2b1b[_0x03a7('0xf1')])},client9002)[_0x03a7('0x24')](function(_0x5a5250){var _0x5d2f74=_0x5a5250&&_0x5a5250[_0x03a7('0xf3')](_0x03a7('0xf4'))>=0x0?!![]:![];logger[_0x03a7('0x25')](_0x03a7('0xf5'),_0x28c910['id'],_0x3d2b1b['id'],_0x3d2b1b[_0x03a7('0xf1')],_0x5d2f74?'ONLINE':_0x03a7('0xf6'),_0x28c910['timezone']?_0x28c910[_0x03a7('0xf0')]:_0x03a7('0xf7'));return _0x5d2f74;})['catch'](function(_0x1b0307){logger[_0x03a7('0x2b')](_0x03a7('0xf5'),_0x28c910['id'],_0x3d2b1b['id'],_0x3d2b1b[_0x03a7('0xf1')],util['inspect'](_0x1b0307,{'showHidden':![],'depth':null}),_0x28c910[_0x03a7('0xf0')]?_0x28c910[_0x03a7('0xf0')]:_0x03a7('0xf7'));return![];});}exports['getSnippet']=function(_0x193ad2,_0x2275e0,_0x3a1683){var _0x1d629e=0x0;var _0x3ac842=0x0;var _0x257c6b=![];var _0x43f6cc;var _0x1e3ca6;return db[_0x03a7('0x53')]['find']({'where':{'id':_0x193ad2[_0x03a7('0x59')]['id']},'include':[{'model':db[_0x03a7('0xf8')],'as':_0x03a7('0xf8'),'include':[{'model':db[_0x03a7('0xf8')],'as':'Intervals','attributes':['id',_0x03a7('0xf1')],'raw':!![]}]}]})[_0x03a7('0x24')](handleEntityNotFound(_0x2275e0,null))['then'](function(_0x7413ea){if(_0x7413ea){_0x43f6cc=_0x7413ea;return _0x7413ea[_0x03a7('0xf9')]({'raw':!![]});}})['then'](function(_0x4f76c0){if(_0x43f6cc){if(_0x4f76c0){_0x1e3ca6=_0x4f76c0;}}return require(_0x03a7('0x7f'))[_0x03a7('0xfa')]();})[_0x03a7('0x24')](function(_0x2e268e){if(_0x2e268e){_0x3ac842=_0x2e268e['virtual'];_0x257c6b=_0x2e268e[_0x03a7('0xfb')];}})['then'](function(){return db['ChatInteraction'][_0x03a7('0x34')]({'where':{'closed':![]}});})[_0x03a7('0x24')](function(_0x178904){_0x1d629e=_0x178904;if(_0x3ac842&&_0x178904>_0x3ac842){return db[_0x03a7('0xfc')][_0x03a7('0x68')]({'where':{'id':0x1}})[_0x03a7('0x24')](function(_0x4f5681){if(_0x4f5681){_0x4f5681['increment'](_0x03a7('0xfd'));}});}})['then'](function(){if(_0x43f6cc['Interval']&&_0x43f6cc[_0x03a7('0xf8')][_0x03a7('0xfe')]){var _0x323401=[];for(var _0x1c38e3=0x0;_0x1c38e3<_0x43f6cc[_0x03a7('0xf8')][_0x03a7('0xfe')]['length'];_0x1c38e3++){var _0xc259ab=_0x43f6cc[_0x03a7('0xf8')][_0x03a7('0xfe')][_0x1c38e3]['get']({'plain':!![]});_0x323401[_0x03a7('0xc5')](iftimePromise(_0xc259ab,_0x43f6cc));}return BPromise['all'](_0x323401)[_0x03a7('0x24')](function(_0x34ae66){return _[_0x03a7('0xff')](_0x34ae66);});}else{return!![];}})[_0x03a7('0x24')](function(_0xd0d3cd){var _0x216ea6=fs['readFileSync'](path[_0x03a7('0x7c')](config[_0x03a7('0x7d')],'server/files/chat/iframe.js'),'utf8');var _0x5079e8={'remote':_0x43f6cc['remote'],'query':querystring[_0x03a7('0x2a')](_[_0x03a7('0x51')](_0x43f6cc['get']({'plain':!![]}),{'customerIp':_0x193ad2['headers']['x-forwarded-for']||_0x193ad2[_0x03a7('0x8f')][_0x03a7('0x100')]||_0x193ad2[_0x03a7('0x101')][_0x03a7('0x102')]||_0x193ad2['ip'],'referer':_0x193ad2[_0x03a7('0x8f')][_0x03a7('0xb2')],'openedInteractions':_0x1d629e,'maxInteractions':_0x3ac842,'virtual':_0x257c6b[_0x03a7('0x103')],'online':_0xd0d3cd,'custom':_0x257c6b}))['replace'](/'/g,'\x5c\x27')};_0x2275e0[_0x03a7('0x3f')](ejs[_0x03a7('0x104')](Mustache[_0x03a7('0x104')](_0x216ea6,_0x5079e8),{'proactiveActions':_0x1e3ca6,'alignment':_0x43f6cc[_0x03a7('0x105')],'verticalAlignment':_0x43f6cc[_0x03a7('0x106')],'div_color':_0x43f6cc[_0x03a7('0xed')],'text_color':_0x43f6cc[_0x03a7('0x107')]}));})[_0x03a7('0x2f')](handleError(_0x2275e0,null));};exports[_0x03a7('0x108')]=function(_0x1545f5,_0x3228cf,_0x16ebe4){return db[_0x03a7('0x53')][_0x03a7('0x68')]({'where':{'id':_0x1545f5[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x3228cf,null))[_0x03a7('0x24')](function(_0x584c46){if(_0x584c46){return db[_0x03a7('0x109')][_0x03a7('0x10a')](function(_0x5c7da6){return db[_0x03a7('0xa1')][_0x03a7('0x3c')]({'where':{'ChatWebsiteId':_0x1545f5['params']['id']},'transaction':_0x5c7da6})['then'](function(_0x27e26a){var _0x3bc2c3=_['map'](_0x1545f5[_0x03a7('0x5e')],function(_0x20e222){_0x20e222[_0x03a7('0x66')]=_0x1545f5['params']['id'];return _0x20e222;});return db[_0x03a7('0xa1')][_0x03a7('0x10b')](_0x3bc2c3,{'transaction':_0x5c7da6});});})[_0x03a7('0x24')](function(){return db['ChatApplication'][_0x03a7('0x10c')]({'where':{'ChatWebsiteId':_0x1545f5[_0x03a7('0x59')]['id']},'order':_0x03a7('0xa6')});});}})[_0x03a7('0x24')](respondWithResult(_0x3228cf,null))[_0x03a7('0x2f')](handleError(_0x3228cf,null));};exports[_0x03a7('0x10d')]=function(_0x4efbfd,_0x30fd22,_0x27a783){var _0x263285={};var _0x48c706={};var _0x4e2325;var _0x41d5cc;return db[_0x03a7('0x53')]['findOne']({'where':{'id':_0x4efbfd[_0x03a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x30fd22,null))[_0x03a7('0x24')](function(_0x2163e4){if(_0x2163e4){_0x4e2325=_0x2163e4;_0x48c706[_0x03a7('0x47')]=_[_0x03a7('0x5a')](db['ChatApplication']['rawAttributes']);_0x48c706[_0x03a7('0x48')]=_[_0x03a7('0x5a')](_0x4efbfd[_0x03a7('0x48')]);_0x48c706[_0x03a7('0x49')]=_['intersection'](_0x48c706['model'],_0x48c706['query']);_0x263285['attributes']=_[_0x03a7('0x4a')](_0x48c706[_0x03a7('0x47')],qs[_0x03a7('0x4b')](_0x4efbfd[_0x03a7('0x48')]['fields']));_0x263285[_0x03a7('0x4c')]=_0x263285[_0x03a7('0x4c')][_0x03a7('0x5b')]?_0x263285[_0x03a7('0x4c')]:_0x48c706[_0x03a7('0x47')];_0x263285[_0x03a7('0x4f')]=qs[_0x03a7('0x69')](_0x4efbfd[_0x03a7('0x48')]['sort']);_0x263285['where']=qs['filters'](_[_0x03a7('0x6a')](_0x4efbfd[_0x03a7('0x48')],_0x48c706[_0x03a7('0x49')]));if(_0x4efbfd[_0x03a7('0x48')][_0x03a7('0x6b')]){_0x263285['where']=_[_0x03a7('0x51')](_0x263285['where'],{'$or':_[_0x03a7('0x43')](_0x263285[_0x03a7('0x4c')],function(_0x5da422){var _0x2ddc78={};_0x2ddc78[_0x5da422]={'$like':'%'+_0x4efbfd['query']['filter']+'%'};return _0x2ddc78;})});}_0x263285=_[_0x03a7('0x51')]({},_0x263285,_0x4efbfd[_0x03a7('0x6c')]);return _0x4e2325['getApplications'](_0x263285);}})[_0x03a7('0x24')](function(_0x2c9f38){if(_0x2c9f38){_0x41d5cc=_0x2c9f38[_0x03a7('0x5b')];if(!_0x4efbfd[_0x03a7('0x48')][_0x03a7('0x4d')](_0x03a7('0x4e'))){_0x263285['limit']=qs[_0x03a7('0x36')](_0x4efbfd[_0x03a7('0x48')][_0x03a7('0x36')]);_0x263285[_0x03a7('0x35')]=qs[_0x03a7('0x35')](_0x4efbfd[_0x03a7('0x48')][_0x03a7('0x35')]);}return _0x4e2325['getApplications'](_0x263285);}})[_0x03a7('0x24')](function(_0x2f7f0c){if(_0x2f7f0c){return _0x2f7f0c?{'count':_0x41d5cc,'rows':_0x2f7f0c}:null;}})[_0x03a7('0x24')](respondWithResult(_0x30fd22,null))[_0x03a7('0x2f')](handleError(_0x30fd22,null));};exports['addProactiveActions']=function(_0x4d32be,_0x3e05bf,_0x51bed2){return db[_0x03a7('0x10e')][_0x03a7('0x5c')]({'where':{'id':_0x4d32be[_0x03a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x3e05bf,null))[_0x03a7('0x24')](function(_0x3b0a7b){if(_0x3b0a7b){return _0x3b0a7b['addProactiveActions'](_0x4d32be[_0x03a7('0x5e')][_0x03a7('0x6e')],_['omit'](_0x4d32be[_0x03a7('0x5e')],[_0x03a7('0x6e'),'id'])||{});}})[_0x03a7('0x24')](respondWithResult(_0x3e05bf,null))[_0x03a7('0x2f')](handleError(_0x3e05bf,null));};exports[_0x03a7('0xf9')]=function(_0x4156ad,_0x1c6c6f,_0x30bc0f){var _0x2d06aa={};var _0x190c42={};var _0x49e55a;var _0x3de4ab;return db['ChatWebsite'][_0x03a7('0x68')]({'where':{'id':_0x4156ad[_0x03a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x1c6c6f,null))['then'](function(_0x47b97f){if(_0x47b97f){_0x49e55a=_0x47b97f;_0x190c42[_0x03a7('0x47')]=_[_0x03a7('0x5a')](db['ChatProactiveAction']['rawAttributes']);_0x190c42[_0x03a7('0x48')]=_[_0x03a7('0x5a')](_0x4156ad[_0x03a7('0x48')]);_0x190c42[_0x03a7('0x49')]=_[_0x03a7('0x4a')](_0x190c42['model'],_0x190c42[_0x03a7('0x48')]);_0x2d06aa[_0x03a7('0x4c')]=_[_0x03a7('0x4a')](_0x190c42[_0x03a7('0x47')],qs[_0x03a7('0x4b')](_0x4156ad['query'][_0x03a7('0x4b')]));_0x2d06aa[_0x03a7('0x4c')]=_0x2d06aa['attributes'][_0x03a7('0x5b')]?_0x2d06aa['attributes']:_0x190c42[_0x03a7('0x47')];_0x2d06aa[_0x03a7('0x4f')]=qs['sort'](_0x4156ad[_0x03a7('0x48')][_0x03a7('0x69')]);_0x2d06aa[_0x03a7('0x50')]=qs[_0x03a7('0x49')](_[_0x03a7('0x6a')](_0x4156ad['query'],_0x190c42[_0x03a7('0x49')]));if(_0x4156ad[_0x03a7('0x48')][_0x03a7('0x6b')]){_0x2d06aa[_0x03a7('0x50')]=_[_0x03a7('0x51')](_0x2d06aa['where'],{'$or':_[_0x03a7('0x43')](_0x2d06aa[_0x03a7('0x4c')],function(_0x40589d){var _0x5cd109={};_0x5cd109[_0x40589d]={'$like':'%'+_0x4156ad[_0x03a7('0x48')]['filter']+'%'};return _0x5cd109;})});}_0x2d06aa=_[_0x03a7('0x51')]({},_0x2d06aa,_0x4156ad[_0x03a7('0x6c')]);return _0x49e55a[_0x03a7('0xf9')](_0x2d06aa);}})[_0x03a7('0x24')](function(_0x4750fa){if(_0x4750fa){_0x3de4ab=_0x4750fa[_0x03a7('0x5b')];if(!_0x4156ad[_0x03a7('0x48')][_0x03a7('0x4d')]('nolimit')){_0x2d06aa[_0x03a7('0x36')]=qs['limit'](_0x4156ad[_0x03a7('0x48')]['limit']);_0x2d06aa['offset']=qs[_0x03a7('0x35')](_0x4156ad[_0x03a7('0x48')][_0x03a7('0x35')]);}return _0x49e55a['getProactiveActions'](_0x2d06aa);}})[_0x03a7('0x24')](function(_0x35b3d7){if(_0x35b3d7){return _0x35b3d7?{'count':_0x3de4ab,'rows':_0x35b3d7}:null;}})[_0x03a7('0x24')](respondWithResult(_0x1c6c6f,null))[_0x03a7('0x2f')](handleError(_0x1c6c6f,null));};exports['getFields']=function(_0x22de7c,_0x310c4c,_0xc1d56c){var _0xbc4fc2=_0x22de7c[_0x03a7('0x48')][_0x03a7('0x10f')]===_0x03a7('0x110')?_0x03a7('0x111'):_0x03a7('0x112');return db[_0x03a7('0x53')][_0x03a7('0x5c')]({'attributes':['id',_0xbc4fc2],'where':{'id':_0x22de7c[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x310c4c,null))['then'](function(_0x3b3608){if(_0x3b3608){var _0x2b68e3=_0x3b3608[_0xbc4fc2];var _0xa18144=_0x2b68e3&&_0x2b68e3[_0x03a7('0x113')]?_0x2b68e3['items']:[];_0x310c4c['send']({'fromKey':_['isNil'](_0x2b68e3[_0x03a7('0x114')])?undefined:_0x2b68e3[_0x03a7('0x114')],'count':_0xa18144[_0x03a7('0x5b')],'rows':_0xa18144});}})['catch'](handleError(_0x310c4c,null));};exports[_0x03a7('0x115')]=function(_0x5087db,_0x3dc93e,_0x43ffa5){var _0x11ba75={'raw':![],'where':{}};var _0x4837c0={};var _0x59c003={'count':0x0,'rows':[]};return db[_0x03a7('0x53')][_0x03a7('0x68')]({'where':{'id':_0x5087db[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x3dc93e,null))[_0x03a7('0x24')](function(_0x5cf7d6){if(_0x5cf7d6){_0x4837c0[_0x03a7('0x47')]=_[_0x03a7('0x5a')](db['ChatOfflineMessage'][_0x03a7('0x44')]);_0x4837c0['query']=_[_0x03a7('0x5a')](_0x5087db['query']);_0x4837c0['filters']=_['intersection'](_0x4837c0[_0x03a7('0x47')],_0x4837c0['query']);_0x11ba75[_0x03a7('0x4c')]=_[_0x03a7('0x4a')](_0x4837c0[_0x03a7('0x47')],qs[_0x03a7('0x4b')](_0x5087db[_0x03a7('0x48')]['fields']));_0x11ba75[_0x03a7('0x4c')]=_0x11ba75[_0x03a7('0x4c')][_0x03a7('0x5b')]?_0x11ba75[_0x03a7('0x4c')]:_0x4837c0['model'];if(!_0x5087db['query'][_0x03a7('0x4d')](_0x03a7('0x4e'))){_0x11ba75[_0x03a7('0x36')]=qs[_0x03a7('0x36')](_0x5087db[_0x03a7('0x48')]['limit']);_0x11ba75[_0x03a7('0x35')]=qs[_0x03a7('0x35')](_0x5087db[_0x03a7('0x48')][_0x03a7('0x35')]);}_0x11ba75[_0x03a7('0x4f')]=qs[_0x03a7('0x69')](_0x5087db[_0x03a7('0x48')][_0x03a7('0x69')]);_0x11ba75[_0x03a7('0x50')]=qs[_0x03a7('0x49')](_[_0x03a7('0x6a')](_0x5087db['query'],_0x4837c0[_0x03a7('0x49')]));_0x11ba75[_0x03a7('0x50')][_0x03a7('0x66')]=_0x5cf7d6['id'];if(_0x5087db[_0x03a7('0x48')]['filter']){_0x11ba75[_0x03a7('0x50')]=_[_0x03a7('0x51')](_0x11ba75['where'],{'$or':_[_0x03a7('0x43')](_0x11ba75['attributes'],function(_0x20b818){var _0x55f9b3={};_0x55f9b3[_0x20b818]={'$like':'%'+_0x5087db[_0x03a7('0x48')][_0x03a7('0x6b')]+'%'};return _0x55f9b3;})});}_0x11ba75=_[_0x03a7('0x51')]({},_0x11ba75,_0x5087db[_0x03a7('0x6c')]);return db['ChatOfflineMessage']['count']({'where':_0x11ba75[_0x03a7('0x50')]})[_0x03a7('0x24')](function(_0x13ee5c){_0x59c003['count']=_0x13ee5c;if(_0x5087db['query'][_0x03a7('0x54')]){_0x11ba75[_0x03a7('0x55')]=[{'all':!![]}];}else{_0x11ba75['include']=[{'model':db[_0x03a7('0x92')],'as':_0x03a7('0xe9'),'required':![]}];}return db[_0x03a7('0xd7')][_0x03a7('0x56')](_0x11ba75);})['then'](function(_0x58c418){_0x59c003['rows']=_0x58c418;return _0x59c003;});}})[_0x03a7('0x24')](respondWithFilteredResult(_0x3dc93e,_0x11ba75))[_0x03a7('0x2f')](handleError(_0x3dc93e,null));};exports['addAgents']=function(_0x101054,_0x5b1865,_0x55afb9){return db['ChatWebsite'][_0x03a7('0x5c')]({'where':{'id':_0x101054['params']['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x5b1865,null))['then'](function(_0x1c13dc){if(_0x1c13dc){return _0x1c13dc[_0x03a7('0x116')](_0x101054[_0x03a7('0x5e')][_0x03a7('0x6e')],_['omit'](_0x101054[_0x03a7('0x5e')],[_0x03a7('0x6e'),'id'])||{})[_0x03a7('0xc1')](function(_0x13c58b){for(var _0x5133b5=0x0;_0x5133b5<_0x101054['body'][_0x03a7('0x6e')][_0x03a7('0x5b')];_0x5133b5+=0x1){socket[_0x03a7('0x117')](_0x03a7('0x118'),{'UserId':_0x101054['body'][_0x03a7('0x6e')][_0x5133b5],'ChatWebsiteId':_0x101054[_0x03a7('0x59')]['id']});}return _0x13c58b;});}})[_0x03a7('0x24')](respondWithResult(_0x5b1865,null))[_0x03a7('0x2f')](handleError(_0x5b1865,null));};exports[_0x03a7('0x119')]=function(_0x443bf9,_0x4599c3,_0x23eb9b){return db['ChatWebsite'][_0x03a7('0x5c')]({'where':{'id':_0x443bf9[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x4599c3,null))[_0x03a7('0x24')](function(_0x37dba0){if(_0x37dba0){return _0x37dba0['removeAgents'](_0x443bf9['query'][_0x03a7('0x6e')])[_0x03a7('0x24')](function(){if(_['isArray'](_0x443bf9[_0x03a7('0x48')][_0x03a7('0x6e')])){for(var _0x2669e3=0x0;_0x2669e3<_0x443bf9['query'][_0x03a7('0x6e')][_0x03a7('0x5b')];_0x2669e3+=0x1){socket[_0x03a7('0x117')](_0x03a7('0x11a'),{'UserId':Number(_0x443bf9[_0x03a7('0x48')][_0x03a7('0x6e')][_0x2669e3]),'ChatWebsiteId':Number(_0x443bf9['params']['id'])});}}else{socket['emit'](_0x03a7('0x11a'),{'UserId':Number(_0x443bf9[_0x03a7('0x48')]['ids']),'ChatWebsiteId':Number(_0x443bf9[_0x03a7('0x59')]['id'])});}});}})[_0x03a7('0x24')](respondWithStatusCode(_0x4599c3,null))[_0x03a7('0x2f')](handleError(_0x4599c3,null));};exports[_0x03a7('0x11b')]=function(_0x507a60,_0x221c55,_0x299bcc){var _0x261db8={};var _0x350e11={};var _0x2b7acf;var _0x2adbca;return db[_0x03a7('0x53')][_0x03a7('0x68')]({'where':{'id':_0x507a60[_0x03a7('0x59')]['id']}})[_0x03a7('0x24')](handleEntityNotFound(_0x221c55,null))[_0x03a7('0x24')](function(_0x4b5285){if(_0x4b5285){_0x2b7acf=_0x4b5285;_0x350e11['model']=_['keys'](db['User']['rawAttributes']);_0x350e11['query']=_['keys'](_0x507a60[_0x03a7('0x48')]);_0x350e11[_0x03a7('0x49')]=_[_0x03a7('0x4a')](_0x350e11[_0x03a7('0x47')],_0x350e11[_0x03a7('0x48')]);_0x261db8['attributes']=_[_0x03a7('0x4a')](_0x350e11[_0x03a7('0x47')],qs[_0x03a7('0x4b')](_0x507a60[_0x03a7('0x48')][_0x03a7('0x4b')]));_0x261db8[_0x03a7('0x4c')]=_0x261db8['attributes'][_0x03a7('0x5b')]?_0x261db8['attributes']:_0x350e11[_0x03a7('0x47')];_0x261db8[_0x03a7('0x4f')]=qs[_0x03a7('0x69')](_0x507a60[_0x03a7('0x48')][_0x03a7('0x69')]);_0x261db8[_0x03a7('0x50')]=qs[_0x03a7('0x49')](_[_0x03a7('0x6a')](_0x507a60[_0x03a7('0x48')],_0x350e11[_0x03a7('0x49')]));if(_0x507a60[_0x03a7('0x48')][_0x03a7('0x6b')]){_0x261db8['where']=_[_0x03a7('0x51')](_0x261db8[_0x03a7('0x50')],{'$or':_[_0x03a7('0x43')](_0x261db8[_0x03a7('0x4c')],function(_0x783b25){var _0xabe563={};_0xabe563[_0x783b25]={'$like':'%'+_0x507a60[_0x03a7('0x48')][_0x03a7('0x6b')]+'%'};return _0xabe563;})});}_0x261db8=_[_0x03a7('0x51')]({},_0x261db8,_0x507a60[_0x03a7('0x6c')]);return _0x2b7acf['getAgents'](_0x261db8);}})[_0x03a7('0x24')](function(_0x23ce3d){if(_0x23ce3d){_0x2adbca=_0x23ce3d[_0x03a7('0x5b')];if(!_0x507a60['query'][_0x03a7('0x4d')]('nolimit')){_0x261db8[_0x03a7('0x36')]=qs[_0x03a7('0x36')](_0x507a60[_0x03a7('0x48')][_0x03a7('0x36')]);_0x261db8[_0x03a7('0x35')]=qs[_0x03a7('0x35')](_0x507a60['query'][_0x03a7('0x35')]);}return _0x2b7acf[_0x03a7('0x11b')](_0x261db8);}})['then'](function(_0x25a849){if(_0x25a849){return _0x25a849?{'count':_0x2adbca,'rows':_0x25a849}:null;}})[_0x03a7('0x24')](respondWithResult(_0x221c55,null))[_0x03a7('0x2f')](handleError(_0x221c55,null));}; \ No newline at end of file +var _0x8994=['virtual','License','increment','Intervals','some','server/files/chat/iframe.js','x-real-ip','remoteAddress','alignment','verticalAlignment','textColor','sequelize','transaction','bulkCreate','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','ChatWebsite','includeAll','include','catch','show','Pause','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','findOne','ChatWebsiteId','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','browser','version','format','unknown','device','%s\x20%s\x20%s','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','MailAccount','MailServerOut','forwardOfflineAddress','Smtp','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','getProactiveActions'];(function(_0x4973ae,_0x56dfea){var _0x1130ed=function(_0x2ca911){while(--_0x2ca911){_0x4973ae['push'](_0x4973ae['shift']());}};_0x1130ed(++_0x56dfea);}(_0x8994,0x143));var _0x4899=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8994[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require(_0x4899('0x0'));var emlformat=require(_0x4899('0x1'));var rimraf=require(_0x4899('0x2'));var zipdir=require(_0x4899('0x3'));var jsonpatch=require(_0x4899('0x4'));var rp=require(_0x4899('0x5'));var moment=require(_0x4899('0x6'));var BPromise=require(_0x4899('0x7'));var Mustache=require(_0x4899('0x8'));var util=require(_0x4899('0x9'));var path=require(_0x4899('0xa'));var sox=require('sox');var csv=require(_0x4899('0xb'));var ejs=require(_0x4899('0xc'));var fs=require('fs');var _=require(_0x4899('0xd'));var squel=require(_0x4899('0xe'));var crypto=require(_0x4899('0xf'));var jsforce=require(_0x4899('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4899('0xb'));var querystring=require(_0x4899('0x11'));var Papa=require(_0x4899('0x12'));var Redis=require(_0x4899('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4899('0x14'));var as=require(_0x4899('0x15'));var hardwareService=require(_0x4899('0x16'));var logger=require(_0x4899('0x17'))(_0x4899('0x18'));var utils=require('../../config/utils');var config=require(_0x4899('0x19'));var db=require(_0x4899('0x1a'))['db'];config[_0x4899('0x1b')]=_[_0x4899('0x1c')](config[_0x4899('0x1b')],{'host':_0x4899('0x1d'),'port':0x18eb});var socket=require(_0x4899('0x1e'))(new Redis(config[_0x4899('0x1b')]));require('./chatWebsite.socket')[_0x4899('0x1f')](socket);var jayson=require(_0x4899('0x20'));var client=jayson[_0x4899('0x21')]['http']({'port':0x232c});var client9002=jayson['client'][_0x4899('0x22')]({'port':0x232a});var client9003=jayson[_0x4899('0x21')][_0x4899('0x22')]({'port':0x232b});function checkPasswordPattern(_0x5cee43,_0x1908a7,_0x5e3d2a){if(_0x5e3d2a){var _0x71b5c1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x71b5c1[_0x4899('0x23')](_0x1908a7)){return _0x5cee43;}else{throw new db[(_0x4899('0x24'))]['ValidationError'](_0x4899('0x25'));}}else{return _0x5cee43;}}function respondWithRpcPromise(_0x47b815,_0x868d2,_0x366193,_0x11d82a){return new BPromise(function(_0x3f4218,_0x5b61c6){var _0x4eeab2=_0x11d82a||client;return _0x4eeab2[_0x4899('0x26')](_0x47b815,_0x366193)[_0x4899('0x27')](function(_0x273c4d){logger[_0x4899('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x868d2,_0x4899('0x29'));logger[_0x4899('0x2a')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x868d2,_0x4899('0x29'),JSON['stringify'](_0x273c4d));if(_0x273c4d[_0x4899('0x2b')]){if(_0x273c4d[_0x4899('0x2b')][_0x4899('0x2c')]===0x1f4){logger[_0x4899('0x2b')](_0x4899('0x2d'),_0x868d2,_0x273c4d[_0x4899('0x2b')][_0x4899('0x2e')]);return _0x5b61c6(_0x273c4d[_0x4899('0x2b')][_0x4899('0x2e')]);}logger[_0x4899('0x2b')](_0x4899('0x2d'),_0x868d2,_0x273c4d[_0x4899('0x2b')][_0x4899('0x2e')]);return _0x3f4218(_0x273c4d[_0x4899('0x2b')][_0x4899('0x2e')]);}else{logger[_0x4899('0x28')](_0x4899('0x2d'),_0x868d2,'request\x20sent');_0x3f4218(_0x273c4d[_0x4899('0x2f')][_0x4899('0x2e')]);}})['catch'](function(_0x810d6f){logger[_0x4899('0x2b')](_0x4899('0x2d'),_0x868d2,_0x810d6f);_0x5b61c6(_0x810d6f);});});}function respondWithStatusCode(_0x5eea62,_0x5c08b7){_0x5c08b7=_0x5c08b7||0xcc;return function(_0x12b370){if(_0x12b370){return _0x5eea62[_0x4899('0x30')](_0x5c08b7);}return _0x5eea62[_0x4899('0x31')](_0x5c08b7)[_0x4899('0x32')]();};}function respondWithResult(_0x3cb98a,_0x3a6b8d){_0x3a6b8d=_0x3a6b8d||0xc8;return function(_0x4cec26){if(_0x4cec26){return _0x3cb98a[_0x4899('0x31')](_0x3a6b8d)[_0x4899('0x33')](_0x4cec26);}};}function respondWithFilteredResult(_0x25e08b,_0x592e5d){return function(_0x1b3ba6){if(_0x1b3ba6){var _0x4fa8e0=_0x1b3ba6[_0x4899('0x34')],_0x48ca71=_0x592e5d['offset'],_0x1cebba=_0x592e5d[_0x4899('0x35')]+_0x592e5d['limit'],_0x1b0cb2;if(_0x1cebba>=_0x4fa8e0){_0x1cebba=_0x4fa8e0;_0x1b0cb2=0xc8;}else{_0x1b0cb2=0xce;}_0x25e08b[_0x4899('0x31')](_0x1b0cb2);return _0x25e08b['set']('Content-Range',_0x48ca71+'-'+_0x1cebba+'/'+_0x4fa8e0)[_0x4899('0x33')](_0x1b3ba6);}return null;};}function patchUpdates(_0x25092e){return function(_0x32642e){try{jsonpatch[_0x4899('0x36')](_0x32642e,_0x25092e,!![]);}catch(_0x3df533){return BPromise['reject'](_0x3df533);}return _0x32642e[_0x4899('0x37')]();};}function saveUpdates(_0x2074a9,_0x149cd5){return function(_0x4b179c){if(_0x4b179c){return _0x4b179c[_0x4899('0x38')](_0x2074a9)[_0x4899('0x27')](function(_0x2c59fc){return _0x2c59fc;});}return null;};}function removeEntity(_0x1b08a1,_0x3105d5){return function(_0x17a439){if(_0x17a439){return _0x17a439[_0x4899('0x39')]()[_0x4899('0x27')](function(){var _0x5d93db=_0x17a439[_0x4899('0x3a')]({'plain':!![]});var _0x3f39dd=_0x4899('0x3b');return db[_0x4899('0x3c')][_0x4899('0x39')]({'where':{'type':_0x3f39dd,'resourceId':_0x5d93db['id']}})['then'](function(){return _0x17a439;});})[_0x4899('0x27')](function(){_0x1b08a1[_0x4899('0x31')](0xcc)[_0x4899('0x32')]();});}};}function handleEntityNotFound(_0xff25d4,_0x22f743){return function(_0x4ed4db){if(!_0x4ed4db){_0xff25d4[_0x4899('0x30')](0x194);}return _0x4ed4db;};}function handleError(_0x25c53a,_0x1309d3){_0x1309d3=_0x1309d3||0x1f4;return function(_0xcb0d81){logger['error'](_0xcb0d81[_0x4899('0x3d')]);if(_0xcb0d81[_0x4899('0x3e')]){delete _0xcb0d81['name'];}_0x25c53a[_0x4899('0x31')](_0x1309d3)[_0x4899('0x3f')](_0xcb0d81);};}exports[_0x4899('0x40')]=function(_0x59a3fe,_0x4aab4b){var _0x4bf5c5={'include':[{'model':db['Pause'],'as':_0x4899('0x41')}]},_0x5e10d8={},_0x76862={'count':0x0,'rows':[]};var _0x3eba11=_[_0x4899('0x42')](db['ChatWebsite'][_0x4899('0x43')],function(_0x481967){return{'name':_0x481967[_0x4899('0x44')],'type':_0x481967['type'][_0x4899('0x45')]};});_0x5e10d8[_0x4899('0x46')]=_[_0x4899('0x42')](_0x3eba11,_0x4899('0x3e'));_0x5e10d8[_0x4899('0x47')]=_[_0x4899('0x48')](_0x59a3fe[_0x4899('0x47')]);_0x5e10d8[_0x4899('0x49')]=_[_0x4899('0x4a')](_0x5e10d8['model'],_0x5e10d8['query']);_0x4bf5c5[_0x4899('0x4b')]=_['intersection'](_0x5e10d8[_0x4899('0x46')],qs[_0x4899('0x4c')](_0x59a3fe[_0x4899('0x47')][_0x4899('0x4c')]));_0x4bf5c5[_0x4899('0x4b')]=_0x4bf5c5[_0x4899('0x4b')][_0x4899('0x4d')]?_0x4bf5c5[_0x4899('0x4b')]:_0x5e10d8['model'];if(!_0x59a3fe['query']['hasOwnProperty'](_0x4899('0x4e'))){_0x4bf5c5[_0x4899('0x4f')]=qs[_0x4899('0x4f')](_0x59a3fe['query'][_0x4899('0x4f')]);_0x4bf5c5[_0x4899('0x35')]=qs['offset'](_0x59a3fe[_0x4899('0x47')][_0x4899('0x35')]);}_0x4bf5c5[_0x4899('0x50')]=qs[_0x4899('0x51')](_0x59a3fe[_0x4899('0x47')][_0x4899('0x51')]);_0x4bf5c5[_0x4899('0x52')]=qs[_0x4899('0x49')](_[_0x4899('0x53')](_0x59a3fe[_0x4899('0x47')],_0x5e10d8[_0x4899('0x49')]));if(_0x59a3fe[_0x4899('0x47')][_0x4899('0x54')]){_0x4bf5c5[_0x4899('0x52')]=_['merge'](_0x4bf5c5[_0x4899('0x52')],{'$or':_['map'](_0x3eba11,function(_0xc9623c){if(_0xc9623c[_0x4899('0x55')]!==_0x4899('0x56')){var _0x2b494c={};_0x2b494c[_0xc9623c[_0x4899('0x3e')]]={'$like':'%'+_0x59a3fe[_0x4899('0x47')][_0x4899('0x54')]+'%'};return _0x2b494c;}})});}_0x4bf5c5=_[_0x4899('0x57')]({},_0x4bf5c5,_0x59a3fe[_0x4899('0x58')]);var _0x400b71={'where':_0x4bf5c5[_0x4899('0x52')]};return db[_0x4899('0x59')][_0x4899('0x34')](_0x400b71)['then'](function(_0x5c836f){_0x76862['count']=_0x5c836f;if(_0x59a3fe[_0x4899('0x47')][_0x4899('0x5a')]){_0x4bf5c5[_0x4899('0x5b')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x4bf5c5);})['then'](function(_0x218afa){_0x76862['rows']=_0x218afa;return _0x76862;})[_0x4899('0x27')](respondWithFilteredResult(_0x4aab4b,_0x4bf5c5))[_0x4899('0x5c')](handleError(_0x4aab4b,null));};exports[_0x4899('0x5d')]=function(_0x187af1,_0x21ffb9){var _0x1caf23={'raw':![],'where':{'id':_0x187af1['params']['id']},'include':[{'model':db[_0x4899('0x5e')],'as':_0x4899('0x41')}]},_0x1274c4={};_0x1274c4[_0x4899('0x46')]=_['keys'](db[_0x4899('0x59')][_0x4899('0x43')]);_0x1274c4[_0x4899('0x47')]=_[_0x4899('0x48')](_0x187af1['query']);_0x1274c4[_0x4899('0x49')]=_['intersection'](_0x1274c4[_0x4899('0x46')],_0x1274c4[_0x4899('0x47')]);_0x1caf23[_0x4899('0x4b')]=_[_0x4899('0x4a')](_0x1274c4[_0x4899('0x46')],qs[_0x4899('0x4c')](_0x187af1['query']['fields']));_0x1caf23['attributes']=_0x1caf23[_0x4899('0x4b')]['length']?_0x1caf23[_0x4899('0x4b')]:_0x1274c4[_0x4899('0x46')];if(_0x187af1[_0x4899('0x47')][_0x4899('0x5a')]){_0x1caf23[_0x4899('0x5b')]=[{'all':!![]}];}_0x1caf23=_['merge']({},_0x1caf23,_0x187af1[_0x4899('0x58')]);return db[_0x4899('0x59')]['find'](_0x1caf23)[_0x4899('0x27')](handleEntityNotFound(_0x21ffb9,null))[_0x4899('0x27')](respondWithResult(_0x21ffb9,null))['catch'](handleError(_0x21ffb9,null));};exports[_0x4899('0x5f')]=function(_0x3f1073,_0x370abf){return db[_0x4899('0x59')][_0x4899('0x5f')](_0x3f1073[_0x4899('0x60')],{})['then'](function(_0x15d392){var _0x2409c8=_0x3f1073['user']['get']({'plain':!![]});if(!_0x2409c8)throw new Error(_0x4899('0x61'));if(_0x2409c8[_0x4899('0x62')]===_0x4899('0x63')){var _0x527322=_0x15d392[_0x4899('0x3a')]({'plain':!![]});var _0x2adba7=_0x4899('0x3b');return db[_0x4899('0x64')][_0x4899('0x65')]({'where':{'name':_0x2adba7,'userProfileId':_0x2409c8[_0x4899('0x66')]},'raw':!![]})[_0x4899('0x27')](function(_0x2dfeef){if(_0x2dfeef&&_0x2dfeef[_0x4899('0x67')]===0x0){return db[_0x4899('0x3c')]['create']({'name':_0x527322[_0x4899('0x3e')],'resourceId':_0x527322['id'],'type':_0x2dfeef['name'],'sectionId':_0x2dfeef['id']},{})[_0x4899('0x27')](function(){return _0x15d392;});}else{return _0x15d392;}})['catch'](function(_0x3e19ef){logger[_0x4899('0x2b')](_0x4899('0x68'),_0x3e19ef);throw _0x3e19ef;});}return _0x15d392;})['then'](respondWithResult(_0x370abf,0xc9))[_0x4899('0x5c')](handleError(_0x370abf,null));};exports[_0x4899('0x38')]=function(_0x4c8ba2,_0x4e4e6a){if(_0x4c8ba2['body']['id']){delete _0x4c8ba2[_0x4899('0x60')]['id'];}return db[_0x4899('0x59')]['find']({'where':{'id':_0x4c8ba2['params']['id']},'include':[{'model':db[_0x4899('0x5e')],'as':'mandatoryDispositionPause'}]})[_0x4899('0x27')](handleEntityNotFound(_0x4e4e6a,null))['then'](saveUpdates(_0x4c8ba2[_0x4899('0x60')],null))[_0x4899('0x27')](respondWithResult(_0x4e4e6a,null))['catch'](handleError(_0x4e4e6a,null));};exports[_0x4899('0x39')]=function(_0x3abcee,_0x12ffd5){return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0x3abcee[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x12ffd5,null))[_0x4899('0x27')](removeEntity(_0x12ffd5,null))['catch'](handleError(_0x12ffd5,null));};exports[_0x4899('0x6a')]=function(_0xe7a302,_0x4e31ca){return db['ChatWebsite'][_0x4899('0x6a')]()[_0x4899('0x27')](respondWithResult(_0x4e31ca,null))[_0x4899('0x5c')](handleError(_0x4e31ca,null));};exports[_0x4899('0x6b')]=function(_0x4ba9d9,_0x9ab4e7,_0x3cba1d){if(_0x4ba9d9[_0x4899('0x60')]['id']){delete _0x4ba9d9[_0x4899('0x60')]['id'];}return db[_0x4899('0x59')]['find']({'where':{'id':_0x4ba9d9[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x9ab4e7,null))[_0x4899('0x27')](function(_0x25b369){if(_0x25b369){_0x4ba9d9[_0x4899('0x60')]['ChatWebsiteId']=_0x25b369['id'];return db[_0x4899('0x6c')][_0x4899('0x5f')](_0x4ba9d9['body']);}})[_0x4899('0x27')](respondWithResult(_0x9ab4e7,null))[_0x4899('0x5c')](handleError(_0x9ab4e7,null));};exports['getDispositions']=function(_0x172fd1,_0x1f0e7f,_0x57182f){var _0x224b92={'raw':![],'where':{}};var _0x290ba0={};var _0x4236de={'count':0x0,'rows':[]};return db[_0x4899('0x59')][_0x4899('0x6d')]({'where':{'id':_0x172fd1[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x1f0e7f,null))[_0x4899('0x27')](function(_0x150877){if(_0x150877){_0x290ba0[_0x4899('0x46')]=_[_0x4899('0x48')](db['Disposition']['rawAttributes']);_0x290ba0['query']=_[_0x4899('0x48')](_0x172fd1[_0x4899('0x47')]);_0x290ba0[_0x4899('0x49')]=_[_0x4899('0x4a')](_0x290ba0['model'],_0x290ba0[_0x4899('0x47')]);_0x224b92[_0x4899('0x4b')]=_[_0x4899('0x4a')](_0x290ba0[_0x4899('0x46')],qs[_0x4899('0x4c')](_0x172fd1[_0x4899('0x47')]['fields']));_0x224b92['attributes']=_0x224b92[_0x4899('0x4b')][_0x4899('0x4d')]?_0x224b92[_0x4899('0x4b')]:_0x290ba0[_0x4899('0x46')];if(!_0x172fd1[_0x4899('0x47')]['hasOwnProperty'](_0x4899('0x4e'))){_0x224b92['limit']=qs[_0x4899('0x4f')](_0x172fd1[_0x4899('0x47')]['limit']);_0x224b92[_0x4899('0x35')]=qs[_0x4899('0x35')](_0x172fd1[_0x4899('0x47')][_0x4899('0x35')]);}_0x224b92[_0x4899('0x50')]=qs[_0x4899('0x51')](_0x172fd1[_0x4899('0x47')]['sort']);_0x224b92[_0x4899('0x52')]=qs[_0x4899('0x49')](_['pick'](_0x172fd1[_0x4899('0x47')],_0x290ba0['filters']));_0x224b92[_0x4899('0x52')][_0x4899('0x6e')]=_0x150877['id'];if(_0x172fd1['query'][_0x4899('0x54')]){_0x224b92['where']=_[_0x4899('0x57')](_0x224b92[_0x4899('0x52')],{'$or':_[_0x4899('0x42')](_0x224b92['attributes'],function(_0x8c5e47){var _0x9eab3c={};_0x9eab3c[_0x8c5e47]={'$like':'%'+_0x172fd1[_0x4899('0x47')][_0x4899('0x54')]+'%'};return _0x9eab3c;})});}_0x224b92=_['merge']({},_0x224b92,_0x172fd1['options']);return db[_0x4899('0x6c')][_0x4899('0x34')]({'where':_0x224b92[_0x4899('0x52')]})[_0x4899('0x27')](function(_0x156c0b){_0x4236de['count']=_0x156c0b;if(_0x172fd1['query']['includeAll']){_0x224b92['include']=[{'all':!![]}];}return db[_0x4899('0x6c')][_0x4899('0x6f')](_0x224b92);})[_0x4899('0x27')](function(_0x34f555){_0x4236de[_0x4899('0x70')]=_0x34f555;return _0x4236de;});}})[_0x4899('0x27')](respondWithFilteredResult(_0x1f0e7f,_0x224b92))[_0x4899('0x5c')](handleError(_0x1f0e7f,null));};exports[_0x4899('0x71')]=function(_0xe228c6,_0x1f73d2,_0x43839b){return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0xe228c6[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x1f73d2,null))[_0x4899('0x27')](function(_0x522f4d){if(_0x522f4d){return _0x522f4d['removeDispositions'](_0xe228c6[_0x4899('0x47')][_0x4899('0x72')]);}})[_0x4899('0x27')](respondWithStatusCode(_0x1f73d2,null))['catch'](handleError(_0x1f73d2,null));};exports[_0x4899('0x73')]=function(_0x4a5dc6,_0x5d2de6,_0xa4c06e){if(_0x4a5dc6[_0x4899('0x60')]['id']){delete _0x4a5dc6[_0x4899('0x60')]['id'];}return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0x4a5dc6[_0x4899('0x69')]['id']}})['then'](handleEntityNotFound(_0x5d2de6,null))['then'](function(_0x229e30){if(_0x229e30){_0x4a5dc6[_0x4899('0x60')][_0x4899('0x6e')]=_0x229e30['id'];return db[_0x4899('0x74')][_0x4899('0x5f')](_0x4a5dc6[_0x4899('0x60')]);}})[_0x4899('0x27')](respondWithResult(_0x5d2de6,null))['catch'](handleError(_0x5d2de6,null));};exports[_0x4899('0x75')]=function(_0x4dd1fc,_0x5295e3,_0x2b4d43){var _0x3750b3={'raw':![],'where':{}};var _0x270154={};var _0x5e3052={'count':0x0,'rows':[]};return db[_0x4899('0x59')][_0x4899('0x6d')]({'where':{'id':_0x4dd1fc[_0x4899('0x69')]['id']}})['then'](handleEntityNotFound(_0x5295e3,null))[_0x4899('0x27')](function(_0x10686c){if(_0x10686c){_0x270154[_0x4899('0x46')]=_['keys'](db[_0x4899('0x74')][_0x4899('0x43')]);_0x270154[_0x4899('0x47')]=_['keys'](_0x4dd1fc[_0x4899('0x47')]);_0x270154[_0x4899('0x49')]=_[_0x4899('0x4a')](_0x270154[_0x4899('0x46')],_0x270154['query']);_0x3750b3['attributes']=_['intersection'](_0x270154['model'],qs[_0x4899('0x4c')](_0x4dd1fc[_0x4899('0x47')][_0x4899('0x4c')]));_0x3750b3[_0x4899('0x4b')]=_0x3750b3[_0x4899('0x4b')][_0x4899('0x4d')]?_0x3750b3[_0x4899('0x4b')]:_0x270154[_0x4899('0x46')];if(!_0x4dd1fc['query'][_0x4899('0x76')](_0x4899('0x4e'))){_0x3750b3['limit']=qs[_0x4899('0x4f')](_0x4dd1fc['query']['limit']);_0x3750b3[_0x4899('0x35')]=qs[_0x4899('0x35')](_0x4dd1fc[_0x4899('0x47')][_0x4899('0x35')]);}_0x3750b3[_0x4899('0x50')]=qs[_0x4899('0x51')](_0x4dd1fc[_0x4899('0x47')][_0x4899('0x51')]);_0x3750b3[_0x4899('0x52')]=qs['filters'](_[_0x4899('0x53')](_0x4dd1fc[_0x4899('0x47')],_0x270154['filters']));_0x3750b3[_0x4899('0x52')]['ChatWebsiteId']=_0x10686c['id'];if(_0x4dd1fc[_0x4899('0x47')][_0x4899('0x54')]){_0x3750b3[_0x4899('0x52')]=_[_0x4899('0x57')](_0x3750b3[_0x4899('0x52')],{'$or':_['map'](_0x3750b3[_0x4899('0x4b')],function(_0x3084a2){var _0x28b0fb={};_0x28b0fb[_0x3084a2]={'$like':'%'+_0x4dd1fc[_0x4899('0x47')][_0x4899('0x54')]+'%'};return _0x28b0fb;})});}_0x3750b3=_['merge']({},_0x3750b3,_0x4dd1fc[_0x4899('0x58')]);return db[_0x4899('0x74')][_0x4899('0x34')]({'where':_0x3750b3[_0x4899('0x52')]})[_0x4899('0x27')](function(_0x417592){_0x5e3052[_0x4899('0x34')]=_0x417592;if(_0x4dd1fc[_0x4899('0x47')][_0x4899('0x5a')]){_0x3750b3['include']=[{'all':!![]}];}return db[_0x4899('0x74')][_0x4899('0x6f')](_0x3750b3);})[_0x4899('0x27')](function(_0xd8f9d5){_0x5e3052[_0x4899('0x70')]=_0xd8f9d5;return _0x5e3052;});}})[_0x4899('0x27')](respondWithFilteredResult(_0x5295e3,_0x3750b3))[_0x4899('0x5c')](handleError(_0x5295e3,null));};exports[_0x4899('0x77')]=function(_0x73755f,_0x35ed5d,_0x346b76){return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0x73755f['params']['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x35ed5d,null))['then'](function(_0x368a6b){if(_0x368a6b){return _0x368a6b[_0x4899('0x77')](_0x73755f[_0x4899('0x47')][_0x4899('0x72')]);}})[_0x4899('0x27')](respondWithStatusCode(_0x35ed5d,null))['catch'](handleError(_0x35ed5d,null));};exports[_0x4899('0x78')]=function(_0x5a8f0b,_0x4e0c0f,_0x25db1b){_0x5a8f0b[_0x4899('0x60')][_0x4899('0x79')]=_0x5a8f0b['file'][_0x4899('0x7a')];return db['ChatWebsite'][_0x4899('0x65')]({'where':{'id':_0x5a8f0b['params']['id']}})['then'](handleEntityNotFound(_0x4e0c0f,null))[_0x4899('0x27')](saveUpdates(_0x5a8f0b[_0x4899('0x60')],null))[_0x4899('0x27')](respondWithResult(_0x4e0c0f,null))[_0x4899('0x5c')](handleError(_0x4e0c0f,null));};exports[_0x4899('0x7b')]=function(_0x7baed5,_0x440d4e,_0x1dbae1){_0x7baed5[_0x4899('0x60')][_0x4899('0x7c')]=_0x7baed5[_0x4899('0x7d')][_0x4899('0x7a')];return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0x7baed5[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x440d4e,null))[_0x4899('0x27')](saveUpdates(_0x7baed5[_0x4899('0x60')],null))['then'](respondWithResult(_0x440d4e,null))[_0x4899('0x5c')](handleError(_0x440d4e,null));};exports[_0x4899('0x7e')]=function(_0x56b20a,_0x43c2e1,_0x2a68cd){_0x56b20a[_0x4899('0x60')][_0x4899('0x7f')]=_0x56b20a[_0x4899('0x7d')][_0x4899('0x7a')];return db[_0x4899('0x59')]['find']({'where':{'id':_0x56b20a[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x43c2e1,null))[_0x4899('0x27')](saveUpdates(_0x56b20a[_0x4899('0x60')],null))[_0x4899('0x27')](respondWithResult(_0x43c2e1,null))[_0x4899('0x5c')](handleError(_0x43c2e1,null));};exports[_0x4899('0x80')]=function(_0x567fb7,_0x177b3f,_0x2dad8a){_0x567fb7[_0x4899('0x60')][_0x4899('0x81')]=_0x567fb7[_0x4899('0x7d')][_0x4899('0x7a')];return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0x567fb7[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x177b3f,null))[_0x4899('0x27')](saveUpdates(_0x567fb7['body'],null))['then'](respondWithResult(_0x177b3f,null))[_0x4899('0x5c')](handleError(_0x177b3f,null));};exports[_0x4899('0x82')]=function(_0x2aebf0,_0x34423e,_0xde200c){var _0xe397e1=path[_0x4899('0x83')](config[_0x4899('0x84')],_0x4899('0x85'));var _0x245254={'where':{'id':_0x2aebf0['params']['id']},'attributes':['id',_0x4899('0x79')],'raw':!![]};var _0x15cf24=![];return require(_0x4899('0x86'))[_0x4899('0x87')]()[_0x4899('0x27')](function(_0x4eef48){if(_0x4eef48){_0x15cf24=_0x4eef48[_0x4899('0x88')];}})[_0x4899('0x27')](function(){return db[_0x4899('0x59')][_0x4899('0x65')](_0x245254);})[_0x4899('0x27')](handleEntityNotFound(_0x34423e,null))['then'](function(_0x226ecb){if(_0x226ecb){if(!_[_0x4899('0x89')](_0x226ecb[_0x4899('0x79')])){if(fs[_0x4899('0x8a')](path['join'](config[_0x4899('0x84')],_0x4899('0x8b'),_0x226ecb[_0x4899('0x79')]))&&_0x15cf24){_0xe397e1=path['join'](config[_0x4899('0x84')],'server/files/images/logos/',_0x226ecb[_0x4899('0x79')]);}}return _0x34423e['download'](_0xe397e1);}})[_0x4899('0x5c')](handleError(_0x34423e,null));};exports[_0x4899('0x8c')]=function(_0x594415,_0x44684d,_0xe48422){var _0x39dffb=path[_0x4899('0x83')](config[_0x4899('0x84')],_0x4899('0x8d'));var _0x6b1c1e={'where':{'id':_0x594415[_0x4899('0x69')]['id']},'attributes':['id',_0x4899('0x7c')],'raw':!![]};return db['ChatWebsite'][_0x4899('0x65')](_0x6b1c1e)[_0x4899('0x27')](handleEntityNotFound(_0x44684d,null))[_0x4899('0x27')](function(_0x3b72cd){if(_0x3b72cd){if(!_[_0x4899('0x89')](_0x3b72cd[_0x4899('0x7c')])){if(fs[_0x4899('0x8a')](path[_0x4899('0x83')](config[_0x4899('0x84')],_0x4899('0x8e'),_0x3b72cd['agentAvatar']))){_0x39dffb=path['join'](config[_0x4899('0x84')],_0x4899('0x8e'),_0x3b72cd[_0x4899('0x7c')]);}}return _0x44684d[_0x4899('0x8f')](_0x39dffb);}})[_0x4899('0x5c')](handleError(_0x44684d,null));};exports[_0x4899('0x90')]=function(_0x21137c,_0x2459ee,_0x110d41){var _0x512539=path[_0x4899('0x83')](config[_0x4899('0x84')],_0x4899('0x91'));var _0x55ba18={'where':{'id':_0x21137c[_0x4899('0x69')]['id']},'attributes':['id','customerAvatar',_0x4899('0x92')],'raw':!![]};return db[_0x4899('0x59')][_0x4899('0x65')](_0x55ba18)[_0x4899('0x27')](handleEntityNotFound(_0x2459ee,null))[_0x4899('0x27')](function(_0x2e07c3){if(_0x2e07c3){if(!_['isNil'](_0x2e07c3[_0x4899('0x7f')])){if(fs[_0x4899('0x8a')](path['join'](config[_0x4899('0x84')],_0x4899('0x8e'),_0x2e07c3[_0x4899('0x7f')]))&&_0x2e07c3[_0x4899('0x92')]){_0x512539=path[_0x4899('0x83')](config[_0x4899('0x84')],_0x4899('0x8e'),_0x2e07c3['customerAvatar']);}}return _0x2459ee[_0x4899('0x8f')](_0x512539);}})[_0x4899('0x5c')](handleError(_0x2459ee,null));};exports[_0x4899('0x93')]=function(_0x2066df,_0x12ff01,_0x29b5c6){var _0x2fb607=path['join'](config[_0x4899('0x84')],_0x4899('0x94'));var _0x101741={'where':{'id':_0x2066df[_0x4899('0x69')]['id']},'attributes':['id',_0x4899('0x81')],'raw':!![]};return db[_0x4899('0x59')][_0x4899('0x65')](_0x101741)[_0x4899('0x27')](handleEntityNotFound(_0x12ff01,null))['then'](function(_0x3d69ef){if(_0x3d69ef){if(!_[_0x4899('0x89')](_0x3d69ef[_0x4899('0x81')])){if(fs[_0x4899('0x8a')](path['join'](config['root'],'server/files/images/avatars/',_0x3d69ef[_0x4899('0x81')]))){_0x2fb607=path[_0x4899('0x83')](config[_0x4899('0x84')],_0x4899('0x8e'),_0x3d69ef[_0x4899('0x81')]);}}return _0x12ff01['download'](_0x2fb607);}})['catch'](handleError(_0x12ff01,null));};exports[_0x4899('0x95')]=function(_0x980cde,_0x4d4a40,_0x564009){var _0x5aa394=require('user-agent-parser');var _0x435b2a=new _0x5aa394();var _0x378330=_0x435b2a[_0x4899('0x96')](_0x980cde[_0x4899('0x97')][_0x4899('0x98')])[_0x4899('0x99')]();var _0x13846d={'body':_0x980cde[_0x4899('0x60')],'channel':_0x4899('0x9a')};var _0x14d737=[];var _0x2d4a85=[];var _0x370316={};var _0x5e1f98=![];return db[_0x4899('0x9b')][_0x4899('0x6a')]()[_0x4899('0x27')](function(_0x693657){if(!_0x693657){throw new db[(_0x4899('0x24'))][(_0x4899('0x9c'))]('no\x20available\x20attributes');}_0x14d737=_[_0x4899('0x9d')](_[_0x4899('0x48')](_0x693657),[_0x4899('0x9e'),_0x4899('0x9f')]);_0x2d4a85=_[_0x4899('0x9d')](_['keys'](_0x693657),['createdAt',_0x4899('0x9f'),_0x4899('0xa0'),_0x4899('0xa1')]);if(_0x980cde[_0x4899('0x60')]['id']){delete _0x980cde[_0x4899('0x60')]['id'];}if(_[_0x4899('0x89')](_0x980cde['body']['from'])){throw new db['Sequelize'][(_0x4899('0x9c'))]('from\x20is\x20mandatory');}if(_[_0x4899('0x89')](_0x980cde[_0x4899('0x60')]['body'])||_0x980cde[_0x4899('0x60')]['body']===''){throw new db['Sequelize'][(_0x4899('0x9c'))](_0x4899('0xa2'));}if(_[_0x4899('0x89')](_0x980cde['body'][_0x4899('0xa3')])){throw new db[(_0x4899('0x24'))][(_0x4899('0x9c'))](_0x4899('0xa4')+_0x2d4a85);}if(!_[_0x4899('0xa5')](_0x2d4a85,_0x980cde[_0x4899('0x60')][_0x4899('0xa3')])){throw new db[(_0x4899('0x24'))]['ValidationError'](_0x4899('0xa6')+_0x2d4a85);}_0x370316[_0x980cde[_0x4899('0x60')][_0x4899('0xa3')]]=_0x980cde[_0x4899('0x60')][_0x4899('0xa7')];})[_0x4899('0x27')](function(){return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0x980cde[_0x4899('0x69')]['id']},'include':[{'model':db[_0x4899('0xa8')],'as':_0x4899('0xa9'),'include':[{'model':db[_0x4899('0x9b')],'as':_0x4899('0xaa'),'where':_0x370316,'limit':0x1,'order':[['updatedAt',_0x4899('0xab')]]}]},{'model':db[_0x4899('0xac')],'as':_0x4899('0xad')}]});})['then'](handleEntityNotFound(_0x4d4a40,null))['then'](function(_0x1c2929){if(_0x1c2929&&_0x1c2929['List']){_0x13846d[_0x4899('0xae')]=_0x1c2929;_0x13846d[_0x4899('0xaf')]=_0x1c2929[_0x4899('0xad')];_0x13846d[_0x4899('0xb0')]=_0x1c2929['List'];_0x13846d[_0x4899('0xaf')]=_[_0x4899('0xb1')](_0x13846d['applications'],[_0x4899('0xb2')],[_0x4899('0xb3')]);if(_0x13846d['account']['Applications']){delete _0x13846d[_0x4899('0xae')]['Applications'];}if(_0x13846d['account'][_0x4899('0xa9')]&&_0x13846d[_0x4899('0xae')]['List'][_0x4899('0xaa')][_0x4899('0x4d')]){return _0x13846d[_0x4899('0xae')][_0x4899('0xa9')][_0x4899('0xaa')][0x0];}var _0x561593=_[_0x4899('0x1c')](_0x980cde[_0x4899('0x60')],{'firstName':_0x980cde['body'][_0x4899('0xa7')],'ListId':_0x1c2929[_0x4899('0xa1')]});_0x561593[_0x980cde[_0x4899('0x60')][_0x4899('0xa3')]]=_0x980cde['body'][_0x4899('0xa7')];return db[_0x4899('0x9b')][_0x4899('0x5f')](_0x561593,{'fields':_0x14d737,'raw':!![]});}})[_0x4899('0x27')](handleEntityNotFound(_0x4d4a40,null))['then'](function(_0x5d2220){_0x13846d['contact']=_0x5d2220;var _0x236695=_0x980cde['body'][_0x4899('0xb4')];if(_0x980cde[_0x4899('0x97')][_0x4899('0xb5')]){_0x236695=_0x980cde[_0x4899('0x97')][_0x4899('0xb5')];}else if(_0x980cde[_0x4899('0x97')][_0x4899('0xb6')]){_0x236695=_[_0x4899('0xb7')](_0x980cde[_0x4899('0x97')]['x-forwarded-for']['split'](','));}if(_0x5d2220){var _0x4a36c7={'ContactId':_0x5d2220['id'],'ChatWebsiteId':_0x980cde[_0x4899('0x69')]['id'],'from':(_0x5d2220[_0x4899('0xb8')]||'')+'\x20'+(_0x5d2220['lastName']||''),'customerIp':_0x236695,'customerPort':_0x980cde[_0x4899('0x97')][_0x4899('0xb9')]?_0x980cde[_0x4899('0x97')][_0x4899('0xb9')]:null,'referer':_0x980cde[_0x4899('0x60')]['referer'],'browserName':_0x378330[_0x4899('0xba')][_0x4899('0x3e')]&&_0x378330[_0x4899('0xba')][_0x4899('0xbb')]?util[_0x4899('0xbc')]('%s\x20%s',_0x378330[_0x4899('0xba')]['name'],_0x378330[_0x4899('0xba')][_0x4899('0xbb')]):'unknown','browserVersion':_0x378330[_0x4899('0xba')][_0x4899('0xbb')]||_0x4899('0xbd'),'osName':util['format']('%s\x20%s',_0x378330['os'][_0x4899('0x3e')],_0x378330['os'][_0x4899('0xbb')]),'osVersion':_0x378330['os'][_0x4899('0xbb')],'deviceModel':_0x378330[_0x4899('0xbe')]['model']&&_0x378330[_0x4899('0xbe')]['vendor']?util['format'](_0x4899('0xbf'),_0x378330[_0x4899('0xbe')][_0x4899('0x46')],_0x378330[_0x4899('0xbe')]['vendor'],_0x378330[_0x4899('0xbe')][_0x4899('0x55')]):null,'deviceVendor':_0x378330[_0x4899('0xbe')][_0x4899('0xc0')],'deviceType':_0x378330[_0x4899('0xbe')][_0x4899('0x55')],'formData':JSON[_0x4899('0xc1')](_0x980cde[_0x4899('0x60')])};var _0x551276={'ChatWebsiteId':_0x980cde[_0x4899('0x69')]['id'],'closed':![]};if(_0x980cde[_0x4899('0x60')][_0x4899('0xc2')]){_0x551276[_0x4899('0xc2')]=_0x980cde['body']['threadId'];return db[_0x4899('0xc3')]['find']({'where':_0x551276})[_0x4899('0x27')](function(_0x54db40){if(_0x54db40){return[_0x54db40,![]];}_0x4a36c7[_0x4899('0xc2')]=_0x980cde[_0x4899('0x60')][_0x4899('0xc2')];_0x4a36c7[_0x4899('0xc4')]=_0x980cde[_0x4899('0x60')][_0x4899('0xc4')];return db[_0x4899('0xc3')][_0x4899('0x5f')](_0x4a36c7)[_0x4899('0x27')](function(_0x4dd09a){return[_0x4dd09a,!![]];});});}_0x551276[_0x4899('0xc5')]=_0x5d2220['id'];if(_0x980cde[_0x4899('0x60')][_0x4899('0xc6')]&&_0x980cde[_0x4899('0x60')][_0x4899('0xc6')]['id']){_0x551276['id']=_0x980cde[_0x4899('0x60')][_0x4899('0xc6')]['id'];return db[_0x4899('0xc3')][_0x4899('0x65')]({'where':_0x551276})[_0x4899('0x27')](function(_0x58e4e0){if(_0x58e4e0){return[_0x58e4e0,![]];}return db['ChatInteraction'][_0x4899('0x5f')](_0x4a36c7)[_0x4899('0x27')](function(_0x427e01){return[_0x427e01,!![]];});});}return db[_0x4899('0xc3')][_0x4899('0x5f')](_0x4a36c7)[_0x4899('0x27')](function(_0x44fbb9){return[_0x44fbb9,!![]];});}})['spread'](function(_0x2823ff,_0x332d81){if(_0x2823ff){_0x5e1f98=_0x332d81;if(!_0x332d81){var _0x509a6b={'from':(_0x13846d[_0x4899('0xc7')][_0x4899('0xb8')]||'')+'\x20'+(_0x13846d['contact'][_0x4899('0xc8')]||'')};if(_0x980cde[_0x4899('0x60')][_0x4899('0xc2')]&&_0x980cde[_0x4899('0x60')][_0x4899('0xc9')]&&_0x980cde[_0x4899('0x60')][_0x4899('0xc2')]!=_0x980cde[_0x4899('0x60')][_0x4899('0xc9')]){_0x509a6b['threadId']=_0x980cde[_0x4899('0x60')][_0x4899('0xc9')];}return _0x2823ff[_0x4899('0x38')](_0x509a6b);}else{return _0x2823ff;}}})[_0x4899('0x27')](function(_0x10aa54){_0x13846d[_0x4899('0xc6')]=_0x10aa54['get']({'plain':!![]});_0x13846d[_0x4899('0xc6')][_0x4899('0xca')]=_0x5e1f98;if(_0x13846d['interaction'][_0x4899('0xca')]){if(_0x13846d[_0x4899('0xae')][_0x4899('0xcb')]){_0x13846d[_0x4899('0xaf')][_0x4899('0xcc')]({'id':0x0,'priority':_0x13846d[_0x4899('0xaf')][_0x4899('0x4d')]+0x1,'app':'close','appdata':_0x4899('0xcd'),'interval':_0x4899('0xce')});}}return db[_0x4899('0xcf')][_0x4899('0x5f')]({'body':_0x980cde['body'][_0x4899('0x60')],'ChatWebsiteId':_0x980cde[_0x4899('0x69')]['id'],'ChatInteractionId':_0x10aa54['id'],'direction':'in','ContactId':_0x13846d[_0x4899('0xc7')]['id'],'AttachmentId':_0x980cde['body']['AttachmentId']});})[_0x4899('0x27')](function(_0x55b5bf){_0x13846d[_0x4899('0x2e')]=_0x55b5bf;if(_0x13846d[_0x4899('0xc6')][_0x4899('0xd0')]){return db[_0x4899('0xd1')]['find']({'attributes':['id',_0x4899('0x3e')],'where':{'id':_0x13846d[_0x4899('0xc6')][_0x4899('0xd0')]}})['then'](function(_0x243a7c){if(_0x243a7c){_0x13846d['applications'][_0x4899('0xd2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x243a7c['name']+','+(_0x13846d[_0x4899('0xae')][_0x4899('0xd3')]||0xa),'interval':_0x4899('0xce')});_0x13846d[_0x4899('0xd4')]=!![];}return respondWithRpcPromise('Start',_0x4899('0xd5'),_0x13846d);});}return respondWithRpcPromise('Start',_0x4899('0xd5'),_0x13846d);})[_0x4899('0x27')](function(_0x54361d){respondWithRpcPromise(_0x4899('0xd6'),_0x4899('0xd6'),{'event':'notify','message':_0x54361d},client9002);return _0x54361d;})[_0x4899('0x27')](respondWithResult(_0x4d4a40,null))[_0x4899('0x5c')](handleError(_0x4d4a40,null));};exports['offline']=function(_0x10061a,_0x5523d7,_0x5c5e84){var _0x214db8,_0x57de55,_0x289509;var _0x54e003=[];var _0x4796ed=[];var _0x1afcc0={};return db[_0x4899('0x9b')]['describe']()[_0x4899('0x27')](function(_0x138ce2){if(!_0x138ce2){throw new db[(_0x4899('0x24'))]['ValidationError']('no\x20available\x20attributes');}_0x4796ed=_[_0x4899('0x9d')](_[_0x4899('0x48')](_0x138ce2),['createdAt',_0x4899('0x9f')]);_0x54e003=_['difference'](_[_0x4899('0x48')](_0x138ce2),[_0x4899('0x9e'),_0x4899('0x9f'),_0x4899('0xa0'),_0x4899('0xa1')]);if(_0x10061a[_0x4899('0x60')]['id']){delete _0x10061a['body']['id'];}if(_['isNil'](_0x10061a[_0x4899('0x60')][_0x4899('0xa7')])){throw _0x5523d7[_0x4899('0x31')](0x1f4)[_0x4899('0x3f')](new db['Sequelize'][(_0x4899('0x9c'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x10061a['body']['body'])||_0x10061a['body'][_0x4899('0x60')]===''){throw _0x5523d7[_0x4899('0x31')](0x1f4)[_0x4899('0x3f')](new db[(_0x4899('0x24'))][(_0x4899('0x9c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4899('0x89')](_0x10061a[_0x4899('0x60')][_0x4899('0xd7')])){throw _0x5523d7['status'](0x1f4)['send'](new db[(_0x4899('0x24'))][(_0x4899('0x9c'))](_0x4899('0xd8')+_0x54e003));}if(!_[_0x4899('0xa5')](_0x54e003,_0x10061a[_0x4899('0x60')]['mapKeyOffline'])){throw _0x5523d7[_0x4899('0x31')](0x1f4)[_0x4899('0x3f')](new db[(_0x4899('0x24'))][(_0x4899('0x9c'))](_0x4899('0xd9')+_0x54e003));}_0x1afcc0[_0x10061a['body']['mapKeyOffline']]=_0x10061a[_0x4899('0x60')]['from'];})[_0x4899('0x27')](function(){return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0x10061a[_0x4899('0x69')]['id']},'include':[{'model':db[_0x4899('0xa8')],'as':_0x4899('0xa9')}]});})['then'](handleEntityNotFound(_0x5523d7,null))['then'](function(_0x5bdf09){if(_0x5bdf09&&_0x5bdf09['List']){_0x57de55=_0x5bdf09;var _0x357ec2=_[_0x4899('0x1c')](_0x10061a[_0x4899('0x60')],{'firstName':_0x10061a['body'][_0x4899('0xa7')],'phone':_0x10061a[_0x4899('0x60')][_0x4899('0xa7')],'ListId':_0x5bdf09[_0x4899('0xa1')]});_0x357ec2[_0x10061a[_0x4899('0x60')][_0x4899('0xd7')]]=_0x10061a[_0x4899('0x60')]['from'];return db[_0x4899('0x9b')][_0x4899('0xda')]({'where':_0x1afcc0,'defaults':_0x357ec2});}})[_0x4899('0xdb')](function(_0xeaa889){if(_0xeaa889){_0x289509=_0xeaa889;var _0x50cef1=fs['readFileSync'](path[_0x4899('0x83')](config[_0x4899('0x84')],_0x4899('0xdc')),_0x4899('0xdd'));var _0x4cb781=ejs[_0x4899('0xde')](_0x50cef1,{'body':_[_0x4899('0xdf')](_0x10061a[_0x4899('0x60')]['body']),'bodyTitle':_0x57de55['offlineMessageBody']});return db[_0x4899('0xe0')][_0x4899('0x5f')]({'body':_0x4cb781,'ContactId':_0xeaa889['id'],'ChatWebsiteId':_0x57de55['id']});}})[_0x4899('0x27')](function(_0x2b3bd1){if(_0x2b3bd1){_0x214db8=_0x2b3bd1;return db[_0x4899('0xe1')][_0x4899('0x6d')]({'where':{'service':!![]},'include':[{'model':db[_0x4899('0xe2')],'as':'Smtp','raw':!![]}]});}})[_0x4899('0x27')](function(_0x4e9b4d){if(_0x4e9b4d&&_0x4e9b4d['Smtp']&&_0x57de55[_0x4899('0xe3')]){var _0x1cabdb={'tls':{'rejectUnauthorized':![]}};if(_0x4e9b4d[_0x4899('0xe4')][_0x4899('0xe5')]){_0x1cabdb[_0x4899('0xe5')]=_0x4e9b4d[_0x4899('0xe4')][_0x4899('0xe5')];}else{_0x1cabdb[_0x4899('0xe6')]=_0x4e9b4d[_0x4899('0xe4')][_0x4899('0xe6')];_0x1cabdb['port']=_0x4e9b4d[_0x4899('0xe4')][_0x4899('0xe7')];_0x1cabdb[_0x4899('0xe8')]=_0x4e9b4d[_0x4899('0xe4')][_0x4899('0xe8')];}if(_0x4e9b4d[_0x4899('0xe4')][_0x4899('0xe9')]){_0x1cabdb[_0x4899('0xea')]={'user':_0x4e9b4d[_0x4899('0xe4')]['user'],'pass':_0x4e9b4d[_0x4899('0xe4')]['pass']};}return respondWithRpcPromise(_0x4899('0xeb'),'sendMail',{'account':_0x1cabdb,'message':{'from':util[_0x4899('0xbc')](_0x4899('0xec'),_0x4e9b4d['name'],_0x4e9b4d[_0x4899('0xed')]||_0x4e9b4d['Smtp'][_0x4899('0x63')]),'to':_0x57de55[_0x4899('0xe3')],'subject':_0x57de55[_0x4899('0xee')],'text':_0x214db8['body']}},client9003)['then'](function(){return _0x214db8;})[_0x4899('0x5c')](function(_0x406652){console[_0x4899('0x2b')](_0x406652);});}})[_0x4899('0x27')](function(){if(_0x214db8){return _0x214db8;}})['then'](respondWithResult(_0x5523d7,null))[_0x4899('0x5c')](handleError(_0x5523d7,null));};exports[_0x4899('0xef')]=function(_0xf7e45c,_0x45c429,_0x2675ca){return db[_0x4899('0xc3')][_0x4899('0x65')]({'where':{'id':_0xf7e45c['params']['id']}})['then'](handleEntityNotFound(_0x45c429,null))[_0x4899('0x27')](function(_0x576681){if(_0x576681){return _0x576681[_0x4899('0xef')](_0xf7e45c[_0x4899('0x60')][_0x4899('0x72')],_[_0x4899('0xf0')](_0xf7e45c[_0x4899('0x60')],[_0x4899('0x72'),'id'])||{});}})[_0x4899('0x27')](respondWithResult(_0x45c429,null))[_0x4899('0x5c')](handleError(_0x45c429,null));};exports[_0x4899('0xf1')]=function(_0x8da7da,_0x26a564,_0x5e506b){var _0x466d29={'raw':![],'where':{}};var _0x4be139={};var _0x147f64={'count':0x0,'rows':[]};return db[_0x4899('0x59')][_0x4899('0x6d')]({'where':{'id':_0x8da7da[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x26a564,null))['then'](function(_0x2985dc){if(_0x2985dc){_0x4be139[_0x4899('0x46')]=_[_0x4899('0x48')](db[_0x4899('0xc3')][_0x4899('0x43')]);_0x4be139[_0x4899('0x47')]=_['keys'](_0x8da7da['query']);_0x4be139[_0x4899('0x49')]=_[_0x4899('0x4a')](_0x4be139[_0x4899('0x46')],_0x4be139[_0x4899('0x47')]);_0x466d29[_0x4899('0x4b')]=_['intersection'](_0x4be139[_0x4899('0x46')],qs[_0x4899('0x4c')](_0x8da7da[_0x4899('0x47')][_0x4899('0x4c')]));_0x466d29[_0x4899('0x4b')]=_0x466d29[_0x4899('0x4b')][_0x4899('0x4d')]?_0x466d29['attributes']:_0x4be139[_0x4899('0x46')];if(!_0x8da7da[_0x4899('0x47')][_0x4899('0x76')](_0x4899('0x4e'))){_0x466d29[_0x4899('0x4f')]=qs['limit'](_0x8da7da[_0x4899('0x47')][_0x4899('0x4f')]);_0x466d29['offset']=qs[_0x4899('0x35')](_0x8da7da[_0x4899('0x47')]['offset']);}_0x466d29['order']=qs[_0x4899('0x51')](_0x8da7da[_0x4899('0x47')][_0x4899('0x51')]);_0x466d29[_0x4899('0x52')]=qs['filters'](_['pick'](_0x8da7da[_0x4899('0x47')],_0x4be139[_0x4899('0x49')]));_0x466d29[_0x4899('0x52')]['ChatWebsiteId']=_0x2985dc['id'];if(_0x8da7da[_0x4899('0x47')]['filter']){_0x466d29[_0x4899('0x52')]=_[_0x4899('0x57')](_0x466d29[_0x4899('0x52')],{'$or':_[_0x4899('0x42')](_0x466d29[_0x4899('0x4b')],function(_0x8dadc0){var _0x56caf3={};_0x56caf3[_0x8dadc0]={'$like':'%'+_0x8da7da[_0x4899('0x47')][_0x4899('0x54')]+'%'};return _0x56caf3;})});}_0x466d29=_[_0x4899('0x57')]({},_0x466d29,_0x8da7da[_0x4899('0x58')]);return db[_0x4899('0xc3')][_0x4899('0x34')]({'where':_0x466d29[_0x4899('0x52')]})[_0x4899('0x27')](function(_0x478a28){_0x147f64[_0x4899('0x34')]=_0x478a28;if(_0x8da7da[_0x4899('0x47')][_0x4899('0x5a')]){_0x466d29[_0x4899('0x5b')]=[{'model':db[_0x4899('0x9b')],'as':_0x4899('0xf2'),'required':![]},{'model':db[_0x4899('0xd1')],'as':_0x4899('0xf3'),'attributes':['name','fullname',_0x4899('0xf4')],'required':![]},{'model':db[_0x4899('0xf5')],'as':_0x4899('0xf6'),'attributes':['id',_0x4899('0x3e'),_0x4899('0xf7')],'where':_0x8da7da[_0x4899('0x47')][_0x4899('0xf8')]?{'id':_0x8da7da[_0x4899('0x47')][_0x4899('0xf8')]}:undefined,'required':_0x8da7da[_0x4899('0x47')][_0x4899('0xf8')]?!![]:![]}];}return db[_0x4899('0xc3')][_0x4899('0x6f')](_0x466d29);})[_0x4899('0x27')](function(_0x18cb3d){_0x147f64[_0x4899('0x70')]=_0x18cb3d;return _0x147f64;});}})[_0x4899('0x27')](respondWithFilteredResult(_0x26a564,_0x466d29))[_0x4899('0x5c')](handleError(_0x26a564,null));};function iftimePromise(_0x27d66d,_0x25fc7a){return respondWithRpcPromise(_0x4899('0xf9'),'getSnippet',{'command':_0x25fc7a[_0x4899('0xfa')]?util[_0x4899('0xbc')](_0x4899('0xfb'),_0x27d66d[_0x4899('0xfc')],_0x25fc7a['timezone']):util[_0x4899('0xbc')](_0x4899('0xfd'),_0x27d66d['interval'])},client9002)[_0x4899('0x27')](function(_0x10ec33){var _0x21fee0=_0x10ec33&&_0x10ec33['indexOf'](_0x4899('0xfe'))>=0x0?!![]:![];logger[_0x4899('0x28')](_0x4899('0xff'),_0x25fc7a['id'],_0x27d66d['id'],_0x27d66d['interval'],_0x21fee0?_0x4899('0x100'):_0x4899('0x101'),_0x25fc7a['timezone']?_0x25fc7a[_0x4899('0xfa')]:'No\x20timezone');return _0x21fee0;})[_0x4899('0x5c')](function(_0x5be466){logger[_0x4899('0x2b')](_0x4899('0xff'),_0x25fc7a['id'],_0x27d66d['id'],_0x27d66d[_0x4899('0xfc')],util[_0x4899('0x102')](_0x5be466,{'showHidden':![],'depth':null}),_0x25fc7a[_0x4899('0xfa')]?_0x25fc7a['timezone']:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x16a3be,_0x1683a1,_0x4d8d4e){var _0x44ab74=0x0;var _0x1f4bce=0x0;var _0x21d125=![];var _0x4a0999;var _0x42bb66;return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0x16a3be[_0x4899('0x69')]['id']},'include':[{'model':db[_0x4899('0x103')],'as':_0x4899('0x103'),'include':[{'model':db[_0x4899('0x103')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x4899('0x27')](handleEntityNotFound(_0x1683a1,null))[_0x4899('0x27')](function(_0x33afe1){if(_0x33afe1){_0x4a0999=_0x33afe1;return _0x33afe1[_0x4899('0x104')]({'raw':!![]});}})['then'](function(_0x10f167){if(_0x4a0999){if(_0x10f167){_0x42bb66=_0x10f167;}}return require(_0x4899('0x86'))[_0x4899('0x87')]();})[_0x4899('0x27')](function(_0x235385){if(_0x235385){_0x1f4bce=_0x235385[_0x4899('0x105')];_0x21d125=_0x235385[_0x4899('0x88')];}})[_0x4899('0x27')](function(){return db[_0x4899('0xc3')][_0x4899('0x34')]({'where':{'closed':![]}});})[_0x4899('0x27')](function(_0x43aab4){_0x44ab74=_0x43aab4;if(_0x1f4bce&&_0x43aab4>_0x1f4bce){return db[_0x4899('0x106')][_0x4899('0x6d')]({'where':{'id':0x1}})[_0x4899('0x27')](function(_0x515997){if(_0x515997){_0x515997[_0x4899('0x107')]('chatLicenseExceeded');}});}})[_0x4899('0x27')](function(){if(_0x4a0999[_0x4899('0x103')]&&_0x4a0999[_0x4899('0x103')]['Intervals']){var _0x3da82e=[];for(var _0x267d1a=0x0;_0x267d1a<_0x4a0999[_0x4899('0x103')][_0x4899('0x108')][_0x4899('0x4d')];_0x267d1a++){var _0x130516=_0x4a0999[_0x4899('0x103')][_0x4899('0x108')][_0x267d1a]['get']({'plain':!![]});_0x3da82e[_0x4899('0xcc')](iftimePromise(_0x130516,_0x4a0999));}return BPromise['all'](_0x3da82e)[_0x4899('0x27')](function(_0xeb8240){return _[_0x4899('0x109')](_0xeb8240);});}else{return!![];}})[_0x4899('0x27')](function(_0x3e2580){var _0x3a07ab=fs['readFileSync'](path['join'](config[_0x4899('0x84')],_0x4899('0x10a')),_0x4899('0xdd'));var _0x38ac0d={'remote':_0x4a0999['remote'],'query':querystring['stringify'](_[_0x4899('0x57')](_0x4a0999['get']({'plain':!![]}),{'customerIp':_0x16a3be[_0x4899('0x97')][_0x4899('0xb6')]||_0x16a3be['headers'][_0x4899('0x10b')]||_0x16a3be['connection'][_0x4899('0x10c')]||_0x16a3be['ip'],'referer':_0x16a3be[_0x4899('0x97')]['referer'],'openedInteractions':_0x44ab74,'maxInteractions':_0x1f4bce,'virtual':_0x21d125[_0x4899('0x105')],'online':_0x3e2580,'custom':_0x21d125}))['replace'](/'/g,'\x5c\x27')};_0x1683a1['send'](ejs[_0x4899('0xde')](Mustache[_0x4899('0xde')](_0x3a07ab,_0x38ac0d),{'proactiveActions':_0x42bb66,'alignment':_0x4a0999[_0x4899('0x10d')],'verticalAlignment':_0x4a0999[_0x4899('0x10e')],'div_color':_0x4a0999[_0x4899('0xf7')],'text_color':_0x4a0999[_0x4899('0x10f')]}));})[_0x4899('0x5c')](handleError(_0x1683a1,null));};exports['addApplications']=function(_0x5d0759,_0x5b369a,_0x1a6152){return db[_0x4899('0x59')]['findOne']({'where':{'id':_0x5d0759[_0x4899('0x69')]['id']}})['then'](handleEntityNotFound(_0x5b369a,null))[_0x4899('0x27')](function(_0x796200){if(_0x796200){return db[_0x4899('0x110')][_0x4899('0x111')](function(_0x31fa93){return db[_0x4899('0xac')][_0x4899('0x39')]({'where':{'ChatWebsiteId':_0x5d0759[_0x4899('0x69')]['id']},'transaction':_0x31fa93})[_0x4899('0x27')](function(_0x1a0e6c){var _0xb18767=_[_0x4899('0x42')](_0x5d0759[_0x4899('0x60')],function(_0x43ff9c){_0x43ff9c[_0x4899('0x6e')]=_0x5d0759[_0x4899('0x69')]['id'];return _0x43ff9c;});return db[_0x4899('0xac')][_0x4899('0x112')](_0xb18767,{'transaction':_0x31fa93});});})[_0x4899('0x27')](function(){return db[_0x4899('0xac')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x5d0759['params']['id']},'order':_0x4899('0xb2')});});}})['then'](respondWithResult(_0x5b369a,null))[_0x4899('0x5c')](handleError(_0x5b369a,null));};exports[_0x4899('0x113')]=function(_0x594287,_0x26d246,_0x5c8e42){var _0x4737bd={};var _0x41cd78={};var _0x5df760;var _0x45a2dc;return db[_0x4899('0x59')][_0x4899('0x6d')]({'where':{'id':_0x594287[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x26d246,null))[_0x4899('0x27')](function(_0x205a11){if(_0x205a11){_0x5df760=_0x205a11;_0x41cd78[_0x4899('0x46')]=_['keys'](db[_0x4899('0xac')][_0x4899('0x43')]);_0x41cd78[_0x4899('0x47')]=_['keys'](_0x594287[_0x4899('0x47')]);_0x41cd78[_0x4899('0x49')]=_[_0x4899('0x4a')](_0x41cd78['model'],_0x41cd78['query']);_0x4737bd['attributes']=_[_0x4899('0x4a')](_0x41cd78[_0x4899('0x46')],qs[_0x4899('0x4c')](_0x594287[_0x4899('0x47')][_0x4899('0x4c')]));_0x4737bd[_0x4899('0x4b')]=_0x4737bd[_0x4899('0x4b')][_0x4899('0x4d')]?_0x4737bd[_0x4899('0x4b')]:_0x41cd78['model'];_0x4737bd[_0x4899('0x50')]=qs[_0x4899('0x51')](_0x594287[_0x4899('0x47')][_0x4899('0x51')]);_0x4737bd['where']=qs[_0x4899('0x49')](_[_0x4899('0x53')](_0x594287[_0x4899('0x47')],_0x41cd78[_0x4899('0x49')]));if(_0x594287[_0x4899('0x47')]['filter']){_0x4737bd[_0x4899('0x52')]=_[_0x4899('0x57')](_0x4737bd[_0x4899('0x52')],{'$or':_[_0x4899('0x42')](_0x4737bd[_0x4899('0x4b')],function(_0x14dcb8){var _0x5c9678={};_0x5c9678[_0x14dcb8]={'$like':'%'+_0x594287['query'][_0x4899('0x54')]+'%'};return _0x5c9678;})});}_0x4737bd=_[_0x4899('0x57')]({},_0x4737bd,_0x594287[_0x4899('0x58')]);return _0x5df760[_0x4899('0x113')](_0x4737bd);}})[_0x4899('0x27')](function(_0x573e3c){if(_0x573e3c){_0x45a2dc=_0x573e3c['length'];if(!_0x594287['query'][_0x4899('0x76')]('nolimit')){_0x4737bd['limit']=qs[_0x4899('0x4f')](_0x594287[_0x4899('0x47')][_0x4899('0x4f')]);_0x4737bd[_0x4899('0x35')]=qs[_0x4899('0x35')](_0x594287[_0x4899('0x47')][_0x4899('0x35')]);}return _0x5df760[_0x4899('0x113')](_0x4737bd);}})[_0x4899('0x27')](function(_0xfc0097){if(_0xfc0097){return _0xfc0097?{'count':_0x45a2dc,'rows':_0xfc0097}:null;}})['then'](respondWithResult(_0x26d246,null))[_0x4899('0x5c')](handleError(_0x26d246,null));};exports[_0x4899('0x114')]=function(_0x4b17a8,_0x3163e8,_0x2f2f6c){return db['chatProactiveAction'][_0x4899('0x65')]({'where':{'id':_0x4b17a8[_0x4899('0x69')]['id']}})['then'](handleEntityNotFound(_0x3163e8,null))[_0x4899('0x27')](function(_0x4a1ad3){if(_0x4a1ad3){return _0x4a1ad3[_0x4899('0x114')](_0x4b17a8[_0x4899('0x60')][_0x4899('0x72')],_['omit'](_0x4b17a8[_0x4899('0x60')],['ids','id'])||{});}})[_0x4899('0x27')](respondWithResult(_0x3163e8,null))[_0x4899('0x5c')](handleError(_0x3163e8,null));};exports[_0x4899('0x104')]=function(_0x525672,_0x44d6da,_0x4c1056){var _0x4f215d={};var _0x509ac0={};var _0x10a16f;var _0x24a0f8;return db['ChatWebsite']['findOne']({'where':{'id':_0x525672['params']['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x44d6da,null))[_0x4899('0x27')](function(_0x2a2b8c){if(_0x2a2b8c){_0x10a16f=_0x2a2b8c;_0x509ac0[_0x4899('0x46')]=_[_0x4899('0x48')](db[_0x4899('0x115')]['rawAttributes']);_0x509ac0[_0x4899('0x47')]=_['keys'](_0x525672[_0x4899('0x47')]);_0x509ac0[_0x4899('0x49')]=_[_0x4899('0x4a')](_0x509ac0[_0x4899('0x46')],_0x509ac0[_0x4899('0x47')]);_0x4f215d[_0x4899('0x4b')]=_[_0x4899('0x4a')](_0x509ac0[_0x4899('0x46')],qs[_0x4899('0x4c')](_0x525672[_0x4899('0x47')]['fields']));_0x4f215d['attributes']=_0x4f215d[_0x4899('0x4b')][_0x4899('0x4d')]?_0x4f215d[_0x4899('0x4b')]:_0x509ac0[_0x4899('0x46')];_0x4f215d[_0x4899('0x50')]=qs[_0x4899('0x51')](_0x525672[_0x4899('0x47')][_0x4899('0x51')]);_0x4f215d[_0x4899('0x52')]=qs[_0x4899('0x49')](_['pick'](_0x525672[_0x4899('0x47')],_0x509ac0['filters']));if(_0x525672[_0x4899('0x47')][_0x4899('0x54')]){_0x4f215d[_0x4899('0x52')]=_[_0x4899('0x57')](_0x4f215d['where'],{'$or':_['map'](_0x4f215d['attributes'],function(_0x3fc5ce){var _0x4ce596={};_0x4ce596[_0x3fc5ce]={'$like':'%'+_0x525672['query']['filter']+'%'};return _0x4ce596;})});}_0x4f215d=_[_0x4899('0x57')]({},_0x4f215d,_0x525672['options']);return _0x10a16f[_0x4899('0x104')](_0x4f215d);}})[_0x4899('0x27')](function(_0x1b8187){if(_0x1b8187){_0x24a0f8=_0x1b8187[_0x4899('0x4d')];if(!_0x525672[_0x4899('0x47')][_0x4899('0x76')](_0x4899('0x4e'))){_0x4f215d[_0x4899('0x4f')]=qs['limit'](_0x525672[_0x4899('0x47')][_0x4899('0x4f')]);_0x4f215d[_0x4899('0x35')]=qs[_0x4899('0x35')](_0x525672[_0x4899('0x47')][_0x4899('0x35')]);}return _0x10a16f[_0x4899('0x104')](_0x4f215d);}})[_0x4899('0x27')](function(_0x8551a4){if(_0x8551a4){return _0x8551a4?{'count':_0x24a0f8,'rows':_0x8551a4}:null;}})[_0x4899('0x27')](respondWithResult(_0x44d6da,null))[_0x4899('0x5c')](handleError(_0x44d6da,null));};exports[_0x4899('0x116')]=function(_0xd8d4c5,_0x403c28,_0x4cbfa6){var _0x1da83b=_0xd8d4c5[_0x4899('0x47')][_0x4899('0x117')]===_0x4899('0x118')?_0x4899('0x119'):_0x4899('0x11a');return db[_0x4899('0x59')]['find']({'attributes':['id',_0x1da83b],'where':{'id':_0xd8d4c5[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x403c28,null))[_0x4899('0x27')](function(_0x5c9339){if(_0x5c9339){var _0x3347a2=_0x5c9339[_0x1da83b];var _0x5b4747=_0x3347a2&&_0x3347a2['items']?_0x3347a2[_0x4899('0x11b')]:[];_0x403c28[_0x4899('0x3f')]({'fromKey':_[_0x4899('0x89')](_0x3347a2['fromKey'])?undefined:_0x3347a2[_0x4899('0x11c')],'count':_0x5b4747['length'],'rows':_0x5b4747});}})['catch'](handleError(_0x403c28,null));};exports[_0x4899('0x11d')]=function(_0x1aeb7b,_0x25184b,_0x1135d6){var _0x41cf35={'raw':![],'where':{}};var _0x4a63a7={};var _0x29737a={'count':0x0,'rows':[]};return db[_0x4899('0x59')]['findOne']({'where':{'id':_0x1aeb7b['params']['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x25184b,null))['then'](function(_0x1f7693){if(_0x1f7693){_0x4a63a7[_0x4899('0x46')]=_[_0x4899('0x48')](db['ChatOfflineMessage']['rawAttributes']);_0x4a63a7[_0x4899('0x47')]=_[_0x4899('0x48')](_0x1aeb7b[_0x4899('0x47')]);_0x4a63a7[_0x4899('0x49')]=_[_0x4899('0x4a')](_0x4a63a7[_0x4899('0x46')],_0x4a63a7['query']);_0x41cf35[_0x4899('0x4b')]=_[_0x4899('0x4a')](_0x4a63a7[_0x4899('0x46')],qs[_0x4899('0x4c')](_0x1aeb7b['query'][_0x4899('0x4c')]));_0x41cf35['attributes']=_0x41cf35[_0x4899('0x4b')][_0x4899('0x4d')]?_0x41cf35[_0x4899('0x4b')]:_0x4a63a7[_0x4899('0x46')];if(!_0x1aeb7b[_0x4899('0x47')][_0x4899('0x76')]('nolimit')){_0x41cf35[_0x4899('0x4f')]=qs[_0x4899('0x4f')](_0x1aeb7b[_0x4899('0x47')]['limit']);_0x41cf35[_0x4899('0x35')]=qs[_0x4899('0x35')](_0x1aeb7b[_0x4899('0x47')][_0x4899('0x35')]);}_0x41cf35[_0x4899('0x50')]=qs['sort'](_0x1aeb7b[_0x4899('0x47')]['sort']);_0x41cf35[_0x4899('0x52')]=qs[_0x4899('0x49')](_['pick'](_0x1aeb7b[_0x4899('0x47')],_0x4a63a7[_0x4899('0x49')]));_0x41cf35[_0x4899('0x52')][_0x4899('0x6e')]=_0x1f7693['id'];if(_0x1aeb7b[_0x4899('0x47')]['filter']){_0x41cf35[_0x4899('0x52')]=_[_0x4899('0x57')](_0x41cf35[_0x4899('0x52')],{'$or':_[_0x4899('0x42')](_0x41cf35['attributes'],function(_0x4bdc4b){var _0x20673b={};_0x20673b[_0x4bdc4b]={'$like':'%'+_0x1aeb7b[_0x4899('0x47')]['filter']+'%'};return _0x20673b;})});}_0x41cf35=_[_0x4899('0x57')]({},_0x41cf35,_0x1aeb7b[_0x4899('0x58')]);return db[_0x4899('0xe0')][_0x4899('0x34')]({'where':_0x41cf35[_0x4899('0x52')]})[_0x4899('0x27')](function(_0x1e5653){_0x29737a[_0x4899('0x34')]=_0x1e5653;if(_0x1aeb7b[_0x4899('0x47')][_0x4899('0x5a')]){_0x41cf35[_0x4899('0x5b')]=[{'all':!![]}];}else{_0x41cf35[_0x4899('0x5b')]=[{'model':db[_0x4899('0x9b')],'as':_0x4899('0xf2'),'required':![]}];}return db[_0x4899('0xe0')][_0x4899('0x6f')](_0x41cf35);})[_0x4899('0x27')](function(_0x1eb81a){_0x29737a[_0x4899('0x70')]=_0x1eb81a;return _0x29737a;});}})[_0x4899('0x27')](respondWithFilteredResult(_0x25184b,_0x41cf35))[_0x4899('0x5c')](handleError(_0x25184b,null));};exports[_0x4899('0x11e')]=function(_0x15b486,_0x1131ea,_0x192a34){return db['ChatWebsite']['find']({'where':{'id':_0x15b486[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x1131ea,null))[_0x4899('0x27')](function(_0x1a0025){if(_0x1a0025){return _0x1a0025[_0x4899('0x11e')](_0x15b486[_0x4899('0x60')]['ids'],_[_0x4899('0xf0')](_0x15b486[_0x4899('0x60')],['ids','id'])||{})['spread'](function(_0x17b1e0){for(var _0x10007e=0x0;_0x10007e<_0x15b486[_0x4899('0x60')]['ids'][_0x4899('0x4d')];_0x10007e+=0x1){socket[_0x4899('0x11f')](_0x4899('0x120'),{'UserId':_0x15b486[_0x4899('0x60')][_0x4899('0x72')][_0x10007e],'ChatWebsiteId':_0x15b486[_0x4899('0x69')]['id']});}return _0x17b1e0;});}})[_0x4899('0x27')](respondWithResult(_0x1131ea,null))[_0x4899('0x5c')](handleError(_0x1131ea,null));};exports[_0x4899('0x121')]=function(_0x27c82c,_0x27a152,_0x170176){return db[_0x4899('0x59')][_0x4899('0x65')]({'where':{'id':_0x27c82c[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x27a152,null))[_0x4899('0x27')](function(_0x379177){if(_0x379177){return _0x379177[_0x4899('0x121')](_0x27c82c['query']['ids'])[_0x4899('0x27')](function(){if(_['isArray'](_0x27c82c[_0x4899('0x47')][_0x4899('0x72')])){for(var _0x3cf8a1=0x0;_0x3cf8a1<_0x27c82c[_0x4899('0x47')][_0x4899('0x72')][_0x4899('0x4d')];_0x3cf8a1+=0x1){socket['emit'](_0x4899('0x122'),{'UserId':Number(_0x27c82c[_0x4899('0x47')][_0x4899('0x72')][_0x3cf8a1]),'ChatWebsiteId':Number(_0x27c82c[_0x4899('0x69')]['id'])});}}else{socket[_0x4899('0x11f')](_0x4899('0x122'),{'UserId':Number(_0x27c82c[_0x4899('0x47')][_0x4899('0x72')]),'ChatWebsiteId':Number(_0x27c82c[_0x4899('0x69')]['id'])});}});}})[_0x4899('0x27')](respondWithStatusCode(_0x27a152,null))[_0x4899('0x5c')](handleError(_0x27a152,null));};exports[_0x4899('0x123')]=function(_0x11b53c,_0x16306c,_0x39feac){var _0x49a528={};var _0x42a969={};var _0x47853f;var _0x1af4f9;return db['ChatWebsite'][_0x4899('0x6d')]({'where':{'id':_0x11b53c[_0x4899('0x69')]['id']}})[_0x4899('0x27')](handleEntityNotFound(_0x16306c,null))[_0x4899('0x27')](function(_0x198de1){if(_0x198de1){_0x47853f=_0x198de1;_0x42a969[_0x4899('0x46')]=_['keys'](db['User'][_0x4899('0x43')]);_0x42a969[_0x4899('0x47')]=_['keys'](_0x11b53c['query']);_0x42a969[_0x4899('0x49')]=_[_0x4899('0x4a')](_0x42a969['model'],_0x42a969[_0x4899('0x47')]);_0x49a528['attributes']=_['intersection'](_0x42a969[_0x4899('0x46')],qs[_0x4899('0x4c')](_0x11b53c[_0x4899('0x47')][_0x4899('0x4c')]));_0x49a528[_0x4899('0x4b')]=_0x49a528[_0x4899('0x4b')]['length']?_0x49a528['attributes']:_0x42a969[_0x4899('0x46')];_0x49a528[_0x4899('0x50')]=qs[_0x4899('0x51')](_0x11b53c[_0x4899('0x47')][_0x4899('0x51')]);_0x49a528['where']=qs[_0x4899('0x49')](_[_0x4899('0x53')](_0x11b53c['query'],_0x42a969['filters']));if(_0x11b53c[_0x4899('0x47')][_0x4899('0x54')]){_0x49a528[_0x4899('0x52')]=_['merge'](_0x49a528[_0x4899('0x52')],{'$or':_['map'](_0x49a528['attributes'],function(_0x30fbec){var _0xb7fe0f={};_0xb7fe0f[_0x30fbec]={'$like':'%'+_0x11b53c[_0x4899('0x47')][_0x4899('0x54')]+'%'};return _0xb7fe0f;})});}_0x49a528=_['merge']({},_0x49a528,_0x11b53c['options']);return _0x47853f['getAgents'](_0x49a528);}})[_0x4899('0x27')](function(_0x513c99){if(_0x513c99){_0x1af4f9=_0x513c99['length'];if(!_0x11b53c[_0x4899('0x47')][_0x4899('0x76')](_0x4899('0x4e'))){_0x49a528['limit']=qs['limit'](_0x11b53c[_0x4899('0x47')]['limit']);_0x49a528[_0x4899('0x35')]=qs[_0x4899('0x35')](_0x11b53c[_0x4899('0x47')][_0x4899('0x35')]);}return _0x47853f['getAgents'](_0x49a528);}})[_0x4899('0x27')](function(_0x259ba1){if(_0x259ba1){return _0x259ba1?{'count':_0x1af4f9,'rows':_0x259ba1}:null;}})[_0x4899('0x27')](respondWithResult(_0x16306c,null))['catch'](handleError(_0x16306c,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0466206..0af953d 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 _0xd6d6=['events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x309f5f,_0x32c7ce){var _0xaf89c7=function(_0x1f284f){while(--_0x1f284f){_0x309f5f['push'](_0x309f5f['shift']());}};_0xaf89c7(++_0x32c7ce);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x3ca1f4,_0x34e27b){_0x3ca1f4=_0x3ca1f4-0x0;var _0x58bcf8=_0xd6d6[_0x3ca1f4];return _0x58bcf8;};'use strict';var EventEmitter=require(_0x6d6d('0x0'));var ChatWebsite=require(_0x6d6d('0x1'))['db'][_0x6d6d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6d6d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d6d('0x4'),'afterDestroy':_0x6d6d('0x5')};function emitEvent(_0x1b8610){return function(_0x2a838a,_0x5207c9,_0x16e259){ChatWebsiteEvents[_0x6d6d('0x6')](_0x1b8610+':'+_0x2a838a['id'],_0x2a838a);ChatWebsiteEvents['emit'](_0x1b8610,_0x2a838a);_0x16e259(null);};}for(var e in events){if(events[_0x6d6d('0x7')](e)){var event=events[e];ChatWebsite[_0x6d6d('0x8')](e,emitEvent(event));}}module[_0x6d6d('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x057a=['ChatWebsite','save','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5bbca2,_0x2910f1){var _0xea1559=function(_0x19d611){while(--_0x19d611){_0x5bbca2['push'](_0x5bbca2['shift']());}};_0xea1559(++_0x2910f1);}(_0x057a,0x1a6));var _0xa057=function(_0xdef1c0,_0x4054e5){_0xdef1c0=_0xdef1c0-0x0;var _0x2ad3da=_0x057a[_0xdef1c0];return _0x2ad3da;};'use strict';var EventEmitter=require(_0xa057('0x0'));var ChatWebsite=require(_0xa057('0x1'))['db'][_0xa057('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa057('0x3'),'afterUpdate':'update','afterDestroy':_0xa057('0x4')};function emitEvent(_0x92634f){return function(_0x5481b7,_0x2320cf,_0xb332){ChatWebsiteEvents['emit'](_0x92634f+':'+_0x5481b7['id'],_0x5481b7);ChatWebsiteEvents['emit'](_0x92634f,_0x5481b7);_0xb332(null);};}for(var e in events){if(events[_0xa057('0x5')](e)){var event=events[e];ChatWebsite[_0xa057('0x6')](e,emitEvent(event));}}module[_0xa057('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 bf5dd56..8f17826 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 _0xc29b=['ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0xc29b,0x12d));var _0xbc29=function(_0x337826,_0x278d57){_0x337826=_0x337826-0x0;var _0x1b4a4a=_0xc29b[_0x337826];return _0x1b4a4a;};'use strict';var _=require(_0xbc29('0x0'));var util=require(_0xbc29('0x1'));var logger=require(_0xbc29('0x2'))('api');var moment=require(_0xbc29('0x3'));var BPromise=require(_0xbc29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc29('0x5'));var rimraf=require(_0xbc29('0x6'));var config=require(_0xbc29('0x7'));var attributes=require(_0xbc29('0x8'));module[_0xbc29('0x9')]=function(_0x2b8a98,_0x3ac58d){return _0x2b8a98[_0xbc29('0xa')](_0xbc29('0xb'),attributes,{'tableName':_0xbc29('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6d8=['../../config/logger','moment','request-promise','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash'];(function(_0x3d297f,_0x37be5c){var _0x34a212=function(_0x476e05){while(--_0x476e05){_0x3d297f['push'](_0x3d297f['shift']());}};_0x34a212(++_0x37be5c);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0xc6d8[_0x4aa838];return _0x3abff0;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var logger=require(_0x8c6d('0x1'))('api');var moment=require(_0x8c6d('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c6d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8c6d('0x4'));var attributes=require(_0x8c6d('0x5'));module[_0x8c6d('0x6')]=function(_0x4f5e8f,_0x3c265c){return _0x4f5e8f[_0x8c6d('0x7')](_0x8c6d('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index ecd295d..f8899a1 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 _0x01d9=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x35395a,_0x2f4bf1){var _0x17cc9b=function(_0x596635){while(--_0x596635){_0x35395a['push'](_0x35395a['shift']());}};_0x17cc9b(++_0x2f4bf1);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});config[_0x901d('0xc')]=_[_0x901d('0xd')](config[_0x901d('0xc')],{'host':_0x901d('0xe'),'port':0x18eb});var socket=require(_0x901d('0xf'))(new Redis(config[_0x901d('0xc')]));require(_0x901d('0x10'))[_0x901d('0x11')](socket);function respondWithRpcPromise(_0xacff40,_0x440fb0,_0xd819f0){return new BPromise(function(_0x1d3137,_0x5d74e2){return client[_0x901d('0x12')](_0xacff40,_0xd819f0)['then'](function(_0x220153){logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));logger[_0x901d('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x440fb0,_0x901d('0x15'),JSON[_0x901d('0x17')](_0x220153));if(_0x220153[_0x901d('0x18')]){if(_0x220153[_0x901d('0x18')][_0x901d('0x19')]===0x1f4){logger[_0x901d('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x5d74e2(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}logger[_0x901d('0x18')](_0x901d('0x14'),_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x1d3137(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}else{logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));_0x1d3137(_0x220153[_0x901d('0x1b')][_0x901d('0x1a')]);}})[_0x901d('0x1c')](function(_0xf3c66a){logger[_0x901d('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x440fb0,_0xf3c66a);_0x5d74e2(_0xf3c66a);});});} \ No newline at end of file +var _0x66fa=['client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','request','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x43736f,_0x14409f){var _0x2027ac=function(_0x2d681a){while(--_0x2d681a){_0x43736f['push'](_0x43736f['shift']());}};_0x2027ac(++_0x14409f);}(_0x66fa,0x117));var _0xa66f=function(_0x1965e3,_0x36d93c){_0x1965e3=_0x1965e3-0x0;var _0x1fb4cf=_0x66fa[_0x1965e3];return _0x1fb4cf;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});config[_0xa66f('0xb')]=_[_0xa66f('0xc')](config[_0xa66f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0xd'))(new Redis(config['redis']));require(_0xa66f('0xe'))['register'](socket);function respondWithRpcPromise(_0x101e10,_0x53ca76,_0x52d802){return new BPromise(function(_0x55e6dc,_0x1e1997){return client[_0xa66f('0xf')](_0x101e10,_0x52d802)['then'](function(_0x14d31e){logger['info'](_0xa66f('0x10'),_0x53ca76,'request\x20sent');logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x53ca76,_0xa66f('0x13'),JSON['stringify'](_0x14d31e));if(_0x14d31e['error']){if(_0x14d31e[_0xa66f('0x14')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x53ca76,_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);return _0x1e1997(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}logger[_0xa66f('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x53ca76,_0x14d31e['error'][_0xa66f('0x15')]);return _0x55e6dc(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}else{logger[_0xa66f('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x53ca76,_0xa66f('0x13'));_0x55e6dc(_0x14d31e['result']['message']);}})[_0xa66f('0x17')](function(_0x413e80){logger[_0xa66f('0x14')](_0xa66f('0x10'),_0x53ca76,_0x413e80);_0x1e1997(_0x413e80);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e21d8aa..f02f930 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x310dc2,_0x2299c4){var _0x24980f=function(_0xde9b88){while(--_0xde9b88){_0x310dc2['push'](_0x310dc2['shift']());}};_0x24980f(++_0x2299c4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x398294,_0x5ceb9d){_0x398294=_0x398294-0x0;var _0x2a872d=_0x5f2f[_0x398294];return _0x2a872d;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x4cdcdc,_0x34eac7){var _0x4704ce=function(_0x1de4ed){while(--_0x1de4ed){_0x4cdcdc['push'](_0x4cdcdc['shift']());}};_0x4704ce(++_0x34eac7);}(_0xb10b,0x12a));var _0xbb10=function(_0xd0e677,_0x42939d){_0xd0e677=_0xd0e677-0x0;var _0x18aeb9=_0xb10b[_0xd0e677];return _0x18aeb9;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 69fc759..0af45c2 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 _0x59c1=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','getDispositions','getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','create','/:id/dispositions','addDisposition','post','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','diskStorage','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline','addApplications','addAgents','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','path','connect-timeout','express'];(function(_0x36154a,_0x2cf98c){var _0x61104e=function(_0x1e23ed){while(--_0x1e23ed){_0x36154a['push'](_0x36154a['shift']());}};_0x61104e(++_0x2cf98c);}(_0x59c1,0x129));var _0x159c=function(_0x35f718,_0x1e7183){_0x35f718=_0x35f718-0x0;var _0x465a75=_0x59c1[_0x35f718];return _0x465a75;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x159c('0x0'));var timeout=require(_0x159c('0x1'));var express=require(_0x159c('0x2'));var router=express[_0x159c('0x3')]();var auth=require(_0x159c('0x4'));var interaction=require(_0x159c('0x5'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0x159c('0x6')]('/',auth[_0x159c('0x7')](),controller['index']);router[_0x159c('0x6')]('/describe',auth[_0x159c('0x7')](),controller[_0x159c('0x8')]);router[_0x159c('0x6')](_0x159c('0x9'),auth[_0x159c('0x7')](),controller['show']);router[_0x159c('0x6')]('/:id/dispositions',auth[_0x159c('0x7')](),controller[_0x159c('0xa')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x159c('0xb')]);router[_0x159c('0x6')](_0x159c('0xc'),controller['getLogo']);router[_0x159c('0x6')](_0x159c('0xd'),controller['getAvatar']);router[_0x159c('0x6')](_0x159c('0xe'),controller['getCustomerAvatar']);router[_0x159c('0x6')](_0x159c('0xf'),controller[_0x159c('0x10')]);router[_0x159c('0x6')](_0x159c('0x11'),auth[_0x159c('0x7')](),controller[_0x159c('0x12')]);router[_0x159c('0x6')]('/:id/snippet',controller[_0x159c('0x13')]);router[_0x159c('0x6')](_0x159c('0x14'),auth['isAuthenticated'](),controller['getApplications']);router[_0x159c('0x6')](_0x159c('0x15'),auth['isAuthenticated'](),controller[_0x159c('0x16')]);router[_0x159c('0x6')](_0x159c('0x17'),controller[_0x159c('0x18')]);router[_0x159c('0x6')](_0x159c('0x19'),auth[_0x159c('0x7')](),controller['getOfflineMessages']);router['get'](_0x159c('0x1a'),auth[_0x159c('0x7')](),controller[_0x159c('0x1b')]);router['post']('/',auth[_0x159c('0x7')](),controller[_0x159c('0x1c')]);router['post'](_0x159c('0x1d'),auth[_0x159c('0x7')](),controller[_0x159c('0x1e')]);router[_0x159c('0x1f')]('/:id/canned_answers',auth[_0x159c('0x7')](),controller[_0x159c('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1976b7,_0x32345e,_0xba4f7c){_0xba4f7c(null,path[_0x159c('0x21')](config[_0x159c('0x22')],_0x159c('0x23')));},'filename':function(_0x33fa08,_0x1fe778,_0x31bc70){_0x31bc70(null,util[_0x159c('0x24')](_0x159c('0x25'),Date[_0x159c('0x26')](),_0x1fe778[_0x159c('0x27')]));}})});router[_0x159c('0x1f')]('/:id/logo',upload[_0x159c('0x28')](_0x159c('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0x159c('0x2a')]({'destination':function(_0xff414a,_0x1ae22b,_0x36e8b7){_0x36e8b7(null,path[_0x159c('0x21')](config['root'],_0x159c('0x2b')));},'filename':function(_0x39d93c,_0x2b5f12,_0x409106){_0x409106(null,util['format'](_0x159c('0x25'),Date[_0x159c('0x26')](),_0x2b5f12[_0x159c('0x27')]));}})});router[_0x159c('0x1f')](_0x159c('0xd'),upload[_0x159c('0x28')](_0x159c('0x29')),controller[_0x159c('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36e48e,_0x14668f,_0x4c518c){_0x4c518c(null,path[_0x159c('0x21')](config[_0x159c('0x22')],_0x159c('0x2b')));},'filename':function(_0xbd4c88,_0xbd4df0,_0x287eed){_0x287eed(null,util['format']('%s-%s',Date[_0x159c('0x26')](),_0xbd4df0['originalname']));}})});router[_0x159c('0x1f')](_0x159c('0xe'),upload[_0x159c('0x28')](_0x159c('0x29')),controller[_0x159c('0x2d')]);var upload=multer({'storage':multer[_0x159c('0x2a')]({'destination':function(_0xe695f3,_0x1bec26,_0x3ab0a8){_0x3ab0a8(null,path[_0x159c('0x21')](config[_0x159c('0x22')],'server/files/images/avatars/'));},'filename':function(_0x141263,_0x29baf8,_0x1129ec){_0x1129ec(null,util['format']('%s-%s',Date['now'](),_0x29baf8['originalname']));}})});router[_0x159c('0x1f')](_0x159c('0xf'),upload[_0x159c('0x28')](_0x159c('0x29')),controller[_0x159c('0x2e')]);router[_0x159c('0x1f')](_0x159c('0x2f'),controller[_0x159c('0x30')]);router[_0x159c('0x1f')]('/:id/offline',controller[_0x159c('0x31')]);router[_0x159c('0x1f')](_0x159c('0x11'),auth[_0x159c('0x7')](),controller['addInteraction']);router['post']('/:id/applications',auth[_0x159c('0x7')](),controller[_0x159c('0x32')]);router[_0x159c('0x1f')]('/:id/proactive_actions',auth[_0x159c('0x7')](),controller['addProactiveActions']);router[_0x159c('0x1f')](_0x159c('0x1a'),auth[_0x159c('0x7')](),controller[_0x159c('0x33')]);router[_0x159c('0x34')](_0x159c('0x9'),auth[_0x159c('0x7')](),controller['update']);router[_0x159c('0x35')](_0x159c('0x9'),auth[_0x159c('0x7')](),controller[_0x159c('0x36')]);router[_0x159c('0x35')](_0x159c('0x1d'),auth[_0x159c('0x7')](),controller[_0x159c('0x37')]);router[_0x159c('0x35')](_0x159c('0x38'),auth['isAuthenticated'](),controller[_0x159c('0x39')]);router[_0x159c('0x35')](_0x159c('0x1a'),auth['isAuthenticated'](),controller[_0x159c('0x3a')]);module[_0x159c('0x3b')]=router; \ No newline at end of file +var _0xd081=['addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','post','create','addAnswer','diskStorage','join','root','%s-%s','now','originalname','file','addLogo','server/files/images/avatars/','format','single','addAvatar','addCustomerAvatar','addSystemAvatar','notify','/:id/offline','addInteraction','addApplications','addProactiveActions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd081,0x13d));var _0x1d08=function(_0x2734a2,_0x2bf361){_0x2734a2=_0x2734a2-0x0;var _0x314ae7=_0xd081[_0x2734a2];return _0x314ae7;};'use strict';var multer=require(_0x1d08('0x0'));var util=require(_0x1d08('0x1'));var path=require(_0x1d08('0x2'));var timeout=require(_0x1d08('0x3'));var express=require(_0x1d08('0x4'));var router=express[_0x1d08('0x5')]();var auth=require(_0x1d08('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d08('0x7'));var controller=require(_0x1d08('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1d08('0x9')]);router['get'](_0x1d08('0xa'),auth[_0x1d08('0xb')](),controller[_0x1d08('0xc')]);router[_0x1d08('0xd')](_0x1d08('0xe'),auth[_0x1d08('0xb')](),controller[_0x1d08('0xf')]);router[_0x1d08('0xd')](_0x1d08('0x10'),auth['isAuthenticated'](),controller[_0x1d08('0x11')]);router['get'](_0x1d08('0x12'),auth[_0x1d08('0xb')](),controller[_0x1d08('0x13')]);router[_0x1d08('0xd')](_0x1d08('0x14'),controller['getLogo']);router[_0x1d08('0xd')](_0x1d08('0x15'),controller['getAvatar']);router[_0x1d08('0xd')]('/:id/customer_avatar',controller[_0x1d08('0x16')]);router[_0x1d08('0xd')](_0x1d08('0x17'),controller[_0x1d08('0x18')]);router[_0x1d08('0xd')]('/:id/interactions',auth[_0x1d08('0xb')](),controller[_0x1d08('0x19')]);router['get']('/:id/snippet',controller['getSnippet']);router[_0x1d08('0xd')](_0x1d08('0x1a'),auth[_0x1d08('0xb')](),controller[_0x1d08('0x1b')]);router['get'](_0x1d08('0x1c'),auth['isAuthenticated'](),controller[_0x1d08('0x1d')]);router['get'](_0x1d08('0x1e'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0x1d08('0xb')](),controller[_0x1d08('0x1f')]);router[_0x1d08('0xd')](_0x1d08('0x20'),auth[_0x1d08('0xb')](),controller['getAgents']);router[_0x1d08('0x21')]('/',auth[_0x1d08('0xb')](),controller[_0x1d08('0x22')]);router[_0x1d08('0x21')](_0x1d08('0x10'),auth['isAuthenticated'](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x1d08('0xb')](),controller[_0x1d08('0x23')]);var upload=multer({'storage':multer[_0x1d08('0x24')]({'destination':function(_0x3df6d3,_0x3731c4,_0x2b1e64){_0x2b1e64(null,path[_0x1d08('0x25')](config[_0x1d08('0x26')],'server/files/images/logos/'));},'filename':function(_0x42a80c,_0x358aa9,_0x520ce6){_0x520ce6(null,util['format'](_0x1d08('0x27'),Date[_0x1d08('0x28')](),_0x358aa9[_0x1d08('0x29')]));}})});router['post'](_0x1d08('0x14'),upload['single'](_0x1d08('0x2a')),controller[_0x1d08('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x274c23,_0x176db3,_0x2b6a1b){_0x2b6a1b(null,path[_0x1d08('0x25')](config[_0x1d08('0x26')],_0x1d08('0x2c')));},'filename':function(_0x42a020,_0x38e284,_0x2014c2){_0x2014c2(null,util[_0x1d08('0x2d')](_0x1d08('0x27'),Date['now'](),_0x38e284['originalname']));}})});router['post']('/:id/avatar',upload[_0x1d08('0x2e')](_0x1d08('0x2a')),controller[_0x1d08('0x2f')]);var upload=multer({'storage':multer[_0x1d08('0x24')]({'destination':function(_0x5481c9,_0x4cd7b3,_0x25626c){_0x25626c(null,path[_0x1d08('0x25')](config[_0x1d08('0x26')],'server/files/images/avatars/'));},'filename':function(_0x3c3c04,_0x1bfcf9,_0x569e6a){_0x569e6a(null,util['format'](_0x1d08('0x27'),Date[_0x1d08('0x28')](),_0x1bfcf9[_0x1d08('0x29')]));}})});router[_0x1d08('0x21')]('/:id/customer_avatar',upload['single'](_0x1d08('0x2a')),controller[_0x1d08('0x30')]);var upload=multer({'storage':multer[_0x1d08('0x24')]({'destination':function(_0x2f439e,_0x37b6c6,_0x6bd1e4){_0x6bd1e4(null,path[_0x1d08('0x25')](config[_0x1d08('0x26')],_0x1d08('0x2c')));},'filename':function(_0x150edd,_0x58a7b3,_0x307449){_0x307449(null,util[_0x1d08('0x2d')](_0x1d08('0x27'),Date[_0x1d08('0x28')](),_0x58a7b3[_0x1d08('0x29')]));}})});router[_0x1d08('0x21')](_0x1d08('0x17'),upload[_0x1d08('0x2e')](_0x1d08('0x2a')),controller[_0x1d08('0x31')]);router[_0x1d08('0x21')]('/:id/notify',controller[_0x1d08('0x32')]);router[_0x1d08('0x21')](_0x1d08('0x33'),controller['offline']);router[_0x1d08('0x21')]('/:id/interactions',auth[_0x1d08('0xb')](),controller[_0x1d08('0x34')]);router[_0x1d08('0x21')](_0x1d08('0x1a'),auth[_0x1d08('0xb')](),controller[_0x1d08('0x35')]);router['post']('/:id/proactive_actions',auth[_0x1d08('0xb')](),controller[_0x1d08('0x36')]);router[_0x1d08('0x21')](_0x1d08('0x20'),auth[_0x1d08('0xb')](),controller[_0x1d08('0x37')]);router[_0x1d08('0x38')]('/:id',auth['isAuthenticated'](),controller[_0x1d08('0x39')]);router['delete'](_0x1d08('0xe'),auth[_0x1d08('0xb')](),controller[_0x1d08('0x3a')]);router[_0x1d08('0x3b')](_0x1d08('0x10'),auth[_0x1d08('0xb')](),controller[_0x1d08('0x3c')]);router[_0x1d08('0x3b')](_0x1d08('0x12'),auth[_0x1d08('0xb')](),controller[_0x1d08('0x3d')]);router[_0x1d08('0x3b')](_0x1d08('0x20'),auth[_0x1d08('0xb')](),controller['removeAgents']);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 c340669..5ac001b 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 _0x6541=['exports','STRING'];(function(_0x743178,_0x16c6b7){var _0x31ee3f=function(_0x2a98e4){while(--_0x2a98e4){_0x743178['push'](_0x743178['shift']());}};_0x31ee3f(++_0x16c6b7);}(_0x6541,0x1c8));var _0x1654=function(_0x56f38c,_0x57ae0b){_0x56f38c=_0x56f38c-0x0;var _0x230c06=_0x6541[_0x56f38c];return _0x230c06;};'use strict';var Sequelize=require('sequelize');module[_0x1654('0x0')]={'name':{'type':Sequelize[_0x1654('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x1654('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1654('0x1')]},'type':{'type':Sequelize[_0x1654('0x1')]},'street':{'type':Sequelize[_0x1654('0x1')]},'postalCode':{'type':Sequelize[_0x1654('0x1')]},'city':{'type':Sequelize[_0x1654('0x1')]},'country':{'type':Sequelize[_0x1654('0x1')]},'email':{'type':Sequelize[_0x1654('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1654('0x1')]},'sStreet':{'type':Sequelize[_0x1654('0x1')]},'sPostalCode':{'type':Sequelize[_0x1654('0x1')]},'sCity':{'type':Sequelize[_0x1654('0x1')]},'sCountry':{'type':Sequelize[_0x1654('0x1')]},'description':{'type':Sequelize[_0x1654('0x1')]}}; \ No newline at end of file +var _0x45de=['name','exports','STRING'];(function(_0x16782e,_0x13645b){var _0x4b418c=function(_0x47acbd){while(--_0x47acbd){_0x16782e['push'](_0x16782e['shift']());}};_0x4b418c(++_0x13645b);}(_0x45de,0x94));var _0xe45d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x45de[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require('sequelize');module[_0xe45d('0x0')]={'name':{'type':Sequelize[_0xe45d('0x1')],'unique':_0xe45d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe45d('0x1')]},'companyId':{'type':Sequelize[_0xe45d('0x1')]},'website':{'type':Sequelize[_0xe45d('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe45d('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe45d('0x1')]},'postalCode':{'type':Sequelize[_0xe45d('0x1')]},'city':{'type':Sequelize[_0xe45d('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe45d('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xe45d('0x1')]},'sCity':{'type':Sequelize[_0xe45d('0x1')]},'sCountry':{'type':Sequelize[_0xe45d('0x1')]},'description':{'type':Sequelize[_0xe45d('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index bcc0a58..2d1afb4 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 _0x25ec=['map','includeAll','include','findAll','catch','show','params','filters','length','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','rawAttributes','pick','html-pdf','fast-json-patch','request-promise','moment','bluebird','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','update','then','destroy','get','Companies','stack','name','index','CmCompany','describe','keys','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x25ec,0x1ed));var _0xc25e=function(_0x3fc686,_0x1e4d8b){_0x3fc686=_0x3fc686-0x0;var _0x510c43=_0x25ec[_0x3fc686];return _0x510c43;};'use strict';var pdf=require(_0xc25e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc25e('0x1'));var rp=require(_0xc25e('0x2'));var moment=require(_0xc25e('0x3'));var BPromise=require(_0xc25e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc25e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc25e('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc25e('0x7'));var crypto=require(_0xc25e('0x8'));var jsforce=require(_0xc25e('0x9'));var deskjs=require(_0xc25e('0xa'));var toCsv=require(_0xc25e('0xb'));var querystring=require(_0xc25e('0xc'));var Papa=require(_0xc25e('0xd'));var Redis=require('ioredis');var authService=require(_0xc25e('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc25e('0xf'));var logger=require(_0xc25e('0x10'))(_0xc25e('0x11'));var utils=require(_0xc25e('0x12'));var config=require(_0xc25e('0x13'));var db=require(_0xc25e('0x14'))['db'];function respondWithStatusCode(_0x2e52e6,_0x2ee649){_0x2ee649=_0x2ee649||0xcc;return function(_0x3b2ee3){if(_0x3b2ee3){return _0x2e52e6[_0xc25e('0x15')](_0x2ee649);}return _0x2e52e6[_0xc25e('0x16')](_0x2ee649)[_0xc25e('0x17')]();};}function respondWithResult(_0x43703d,_0x5d6346){_0x5d6346=_0x5d6346||0xc8;return function(_0x4dd6a2){if(_0x4dd6a2){return _0x43703d[_0xc25e('0x16')](_0x5d6346)['json'](_0x4dd6a2);}};}function respondWithFilteredResult(_0x1171b5,_0x4aad73){return function(_0x41e915){if(_0x41e915){var _0x15ea84=_0x41e915[_0xc25e('0x18')],_0x1f04ea=_0x4aad73[_0xc25e('0x19')],_0x5efd98=_0x4aad73[_0xc25e('0x19')]+_0x4aad73[_0xc25e('0x1a')],_0x594823;if(_0x5efd98>=_0x15ea84){_0x5efd98=_0x15ea84;_0x594823=0xc8;}else{_0x594823=0xce;}_0x1171b5[_0xc25e('0x16')](_0x594823);return _0x1171b5[_0xc25e('0x1b')]('Content-Range',_0x1f04ea+'-'+_0x5efd98+'/'+_0x15ea84)[_0xc25e('0x1c')](_0x41e915);}return null;};}function patchUpdates(_0x437a40){return function(_0x381352){try{jsonpatch[_0xc25e('0x1d')](_0x381352,_0x437a40,!![]);}catch(_0x2f50d7){return BPromise[_0xc25e('0x1e')](_0x2f50d7);}return _0x381352['save']();};}function saveUpdates(_0x2d639a,_0xda9a41){return function(_0x334fd6){if(_0x334fd6){return _0x334fd6[_0xc25e('0x1f')](_0x2d639a)[_0xc25e('0x20')](function(_0x4b7bd8){return _0x4b7bd8;});}return null;};}function removeEntity(_0x566bf0,_0x4d5f88){return function(_0x3e5a62){if(_0x3e5a62){return _0x3e5a62[_0xc25e('0x21')]()[_0xc25e('0x20')](function(){var _0x474920=_0x3e5a62[_0xc25e('0x22')]({'plain':!![]});var _0x34dfbc=_0xc25e('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x34dfbc,'resourceId':_0x474920['id']}})[_0xc25e('0x20')](function(){return _0x3e5a62;});})[_0xc25e('0x20')](function(){_0x566bf0[_0xc25e('0x16')](0xcc)[_0xc25e('0x17')]();});}};}function handleEntityNotFound(_0x234f6a,_0x1642a3){return function(_0x3a6fb4){if(!_0x3a6fb4){_0x234f6a[_0xc25e('0x15')](0x194);}return _0x3a6fb4;};}function handleError(_0x3b5c95,_0x4737a6){_0x4737a6=_0x4737a6||0x1f4;return function(_0x1153c3){logger['error'](_0x1153c3[_0xc25e('0x24')]);if(_0x1153c3[_0xc25e('0x25')]){delete _0x1153c3[_0xc25e('0x25')];}_0x3b5c95[_0xc25e('0x16')](_0x4737a6)['send'](_0x1153c3);};}exports[_0xc25e('0x26')]=function(_0x39a78e,_0x5163fd){var _0x49eaa5={},_0x3522fa={},_0x369221={'count':0x0,'rows':[]};return db[_0xc25e('0x27')][_0xc25e('0x28')]()['then'](function(_0x565fac){_0x3522fa['model']=_[_0xc25e('0x29')](_0x565fac);_0x3522fa[_0xc25e('0x2a')]=_[_0xc25e('0x29')](_0x39a78e[_0xc25e('0x2a')]);_0x3522fa['filters']=_[_0xc25e('0x2b')](_0x3522fa[_0xc25e('0x2c')],_0x3522fa[_0xc25e('0x2a')]);_0x49eaa5[_0xc25e('0x2d')]=_[_0xc25e('0x2b')](_0x3522fa[_0xc25e('0x2c')],qs[_0xc25e('0x2e')](_0x39a78e[_0xc25e('0x2a')]['fields']));_0x49eaa5[_0xc25e('0x2d')]=_0x49eaa5[_0xc25e('0x2d')]['length']?_0x49eaa5[_0xc25e('0x2d')]:_0x3522fa[_0xc25e('0x2c')];if(!_0x39a78e[_0xc25e('0x2a')][_0xc25e('0x2f')]('nolimit')){_0x49eaa5[_0xc25e('0x1a')]=qs[_0xc25e('0x1a')](_0x39a78e[_0xc25e('0x2a')][_0xc25e('0x1a')]);_0x49eaa5[_0xc25e('0x19')]=qs[_0xc25e('0x19')](_0x39a78e['query']['offset']);}_0x49eaa5[_0xc25e('0x30')]=qs[_0xc25e('0x31')](_0x39a78e[_0xc25e('0x2a')]['sort']);_0x49eaa5[_0xc25e('0x32')]=qs['filters'](_['pick'](_0x39a78e['query'],_0x3522fa['filters']));if(_0x39a78e[_0xc25e('0x2a')][_0xc25e('0x33')]){_0x49eaa5[_0xc25e('0x32')]=_[_0xc25e('0x34')](_0x49eaa5[_0xc25e('0x32')],{'$or':_[_0xc25e('0x35')](_0x49eaa5[_0xc25e('0x2d')],function(_0x287724){var _0x4699fd={};_0x4699fd[_0x287724]={'$like':'%'+_0x39a78e[_0xc25e('0x2a')][_0xc25e('0x33')]+'%'};return _0x4699fd;})});}_0x49eaa5=_[_0xc25e('0x34')]({},_0x49eaa5,_0x39a78e['options']);var _0x2b5b92={'where':_0x49eaa5[_0xc25e('0x32')]};return db[_0xc25e('0x27')][_0xc25e('0x18')](_0x2b5b92)[_0xc25e('0x20')](function(_0x37f484){_0x369221[_0xc25e('0x18')]=_0x37f484;if(_0x39a78e['query'][_0xc25e('0x36')]){_0x49eaa5[_0xc25e('0x37')]=[{'all':!![]}];}return db['CmCompany'][_0xc25e('0x38')](_0x49eaa5);})[_0xc25e('0x20')](function(_0x135692){_0x369221['rows']=_0x135692;return _0x369221;})[_0xc25e('0x20')](respondWithFilteredResult(_0x5163fd,_0x49eaa5))[_0xc25e('0x39')](handleError(_0x5163fd,null));})['catch'](handleError(_0x5163fd,null));};exports[_0xc25e('0x3a')]=function(_0x558c79,_0x167617){var _0x413c3f={'raw':![],'where':{'id':_0x558c79[_0xc25e('0x3b')]['id']}},_0x221c4d={};_0x221c4d[_0xc25e('0x2c')]=_['keys'](db[_0xc25e('0x27')]['rawAttributes']);_0x221c4d[_0xc25e('0x2a')]=_['keys'](_0x558c79[_0xc25e('0x2a')]);_0x221c4d[_0xc25e('0x3c')]=_[_0xc25e('0x2b')](_0x221c4d[_0xc25e('0x2c')],_0x221c4d[_0xc25e('0x2a')]);_0x413c3f[_0xc25e('0x2d')]=_['intersection'](_0x221c4d['model'],qs[_0xc25e('0x2e')](_0x558c79[_0xc25e('0x2a')][_0xc25e('0x2e')]));_0x413c3f['attributes']=_0x413c3f[_0xc25e('0x2d')][_0xc25e('0x3d')]?_0x413c3f[_0xc25e('0x2d')]:_0x221c4d[_0xc25e('0x2c')];if(_0x558c79[_0xc25e('0x2a')][_0xc25e('0x36')]){_0x413c3f['include']=[{'all':!![]}];}_0x413c3f=_['merge']({},_0x413c3f,_0x558c79['options']);return db['CmCompany'][_0xc25e('0x3e')](_0x413c3f)['then'](handleEntityNotFound(_0x167617,null))[_0xc25e('0x20')](respondWithResult(_0x167617,null))[_0xc25e('0x39')](handleError(_0x167617,null));};exports[_0xc25e('0x3f')]=function(_0x1ceaae,_0x40c4f9){return db[_0xc25e('0x27')][_0xc25e('0x3f')](_0x1ceaae[_0xc25e('0x40')],{})[_0xc25e('0x20')](function(_0x4874f2){var _0x2f1bb1=_0x1ceaae[_0xc25e('0x41')]['get']({'plain':!![]});if(!_0x2f1bb1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f1bb1[_0xc25e('0x42')]===_0xc25e('0x41')){var _0x23a054=_0x4874f2[_0xc25e('0x22')]({'plain':!![]});var _0x3071e4=_0xc25e('0x23');return db[_0xc25e('0x43')][_0xc25e('0x3e')]({'where':{'name':_0x3071e4,'userProfileId':_0x2f1bb1['userProfileId']},'raw':!![]})[_0xc25e('0x20')](function(_0x26936e){if(_0x26936e&&_0x26936e[_0xc25e('0x44')]===0x0){return db[_0xc25e('0x45')][_0xc25e('0x3f')]({'name':_0x23a054[_0xc25e('0x25')],'resourceId':_0x23a054['id'],'type':_0x26936e['name'],'sectionId':_0x26936e['id']},{})[_0xc25e('0x20')](function(){return _0x4874f2;});}else{return _0x4874f2;}})[_0xc25e('0x39')](function(_0xb483f0){logger[_0xc25e('0x46')](_0xc25e('0x47'),_0xb483f0);throw _0xb483f0;});}return _0x4874f2;})[_0xc25e('0x20')](respondWithResult(_0x40c4f9,0xc9))[_0xc25e('0x39')](handleError(_0x40c4f9,null));};exports[_0xc25e('0x1f')]=function(_0x420860,_0x4905dd){if(_0x420860[_0xc25e('0x40')]['id']){delete _0x420860['body']['id'];}return db[_0xc25e('0x27')][_0xc25e('0x3e')]({'where':{'id':_0x420860[_0xc25e('0x3b')]['id']}})[_0xc25e('0x20')](handleEntityNotFound(_0x4905dd,null))[_0xc25e('0x20')](saveUpdates(_0x420860[_0xc25e('0x40')],null))[_0xc25e('0x20')](respondWithResult(_0x4905dd,null))[_0xc25e('0x39')](handleError(_0x4905dd,null));};exports['destroy']=function(_0x31bbac,_0x4a8c87){return db['CmCompany']['find']({'where':{'id':_0x31bbac[_0xc25e('0x3b')]['id']}})[_0xc25e('0x20')](handleEntityNotFound(_0x4a8c87,null))[_0xc25e('0x20')](removeEntity(_0x4a8c87,null))['catch'](handleError(_0x4a8c87,null));};exports[_0xc25e('0x28')]=function(_0x597edd,_0x4d329a){return db[_0xc25e('0x27')][_0xc25e('0x28')]()[_0xc25e('0x20')](respondWithResult(_0x4d329a,null))[_0xc25e('0x39')](handleError(_0x4d329a,null));};exports[_0xc25e('0x48')]=function(_0x473b97,_0x4890c7,_0x6fc20){return db[_0xc25e('0x49')][_0xc25e('0x3e')]({'where':{'id':_0x473b97[_0xc25e('0x3b')]['id']}})[_0xc25e('0x20')](handleEntityNotFound(_0x4890c7,null))[_0xc25e('0x20')](function(_0x4f8f71){if(_0x4f8f71){return _0x4f8f71[_0xc25e('0x48')](_0x473b97[_0xc25e('0x40')][_0xc25e('0x4a')],_['omit'](_0x473b97['body'],[_0xc25e('0x4a'),'id'])||{});}})[_0xc25e('0x20')](respondWithResult(_0x4890c7,null))[_0xc25e('0x39')](handleError(_0x4890c7,null));};exports[_0xc25e('0x4b')]=function(_0x1e6e8b,_0x5af1ed,_0xed9a89){var _0x596531={};var _0xb18af0={};var _0x575368;var _0x1fac51;return db[_0xc25e('0x27')]['findOne']({'where':{'id':_0x1e6e8b['params']['id']}})[_0xc25e('0x20')](handleEntityNotFound(_0x5af1ed,null))['then'](function(_0x2b5d2f){if(_0x2b5d2f){_0x575368=_0x2b5d2f;_0xb18af0[_0xc25e('0x2c')]=_[_0xc25e('0x29')](db[_0xc25e('0x49')][_0xc25e('0x4c')]);_0xb18af0[_0xc25e('0x2a')]=_[_0xc25e('0x29')](_0x1e6e8b[_0xc25e('0x2a')]);_0xb18af0[_0xc25e('0x3c')]=_[_0xc25e('0x2b')](_0xb18af0[_0xc25e('0x2c')],_0xb18af0['query']);_0x596531[_0xc25e('0x2d')]=_[_0xc25e('0x2b')](_0xb18af0[_0xc25e('0x2c')],qs[_0xc25e('0x2e')](_0x1e6e8b['query'][_0xc25e('0x2e')]));_0x596531[_0xc25e('0x2d')]=_0x596531[_0xc25e('0x2d')][_0xc25e('0x3d')]?_0x596531[_0xc25e('0x2d')]:_0xb18af0[_0xc25e('0x2c')];_0x596531['order']=qs[_0xc25e('0x31')](_0x1e6e8b[_0xc25e('0x2a')][_0xc25e('0x31')]);_0x596531[_0xc25e('0x32')]=qs[_0xc25e('0x3c')](_[_0xc25e('0x4d')](_0x1e6e8b['query'],_0xb18af0[_0xc25e('0x3c')]));if(_0x1e6e8b[_0xc25e('0x2a')]['filter']){_0x596531[_0xc25e('0x32')]=_[_0xc25e('0x34')](_0x596531[_0xc25e('0x32')],{'$or':_[_0xc25e('0x35')](_0x596531['attributes'],function(_0x56027a){var _0x281df7={};_0x281df7[_0x56027a]={'$like':'%'+_0x1e6e8b[_0xc25e('0x2a')]['filter']+'%'};return _0x281df7;})});}_0x596531=_['merge']({},_0x596531,_0x1e6e8b['options']);return _0x575368[_0xc25e('0x4b')](_0x596531);}})[_0xc25e('0x20')](function(_0x2c9f7d){if(_0x2c9f7d){_0x1fac51=_0x2c9f7d[_0xc25e('0x3d')];if(!_0x1e6e8b[_0xc25e('0x2a')][_0xc25e('0x2f')]('nolimit')){_0x596531[_0xc25e('0x1a')]=qs[_0xc25e('0x1a')](_0x1e6e8b['query'][_0xc25e('0x1a')]);_0x596531['offset']=qs[_0xc25e('0x19')](_0x1e6e8b[_0xc25e('0x2a')][_0xc25e('0x19')]);}return _0x575368[_0xc25e('0x4b')](_0x596531);}})[_0xc25e('0x20')](function(_0x4d62b5){if(_0x4d62b5){return _0x4d62b5?{'count':_0x1fac51,'rows':_0x4d62b5}:null;}})['then'](respondWithResult(_0x5af1ed,null))[_0xc25e('0x39')](handleError(_0x5af1ed,null));}; \ No newline at end of file +var _0xb182=['merge','map','count','includeAll','include','findAll','rows','catch','show','rawAttributes','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','userProfileId','autoAssociation','update','body','params','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','limit','set','Content-Range','reject','then','destroy','get','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','where'];(function(_0x275c1b,_0x13947f){var _0x467b53=function(_0x513054){while(--_0x513054){_0x275c1b['push'](_0x275c1b['shift']());}};_0x467b53(++_0x13947f);}(_0xb182,0x121));var _0x2b18=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0xb182[_0x4cce65];return _0x4d1b45;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2b18('0x0'));var rimraf=require(_0x2b18('0x1'));var zipdir=require(_0x2b18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2b18('0x3'));var BPromise=require(_0x2b18('0x4'));var Mustache=require(_0x2b18('0x5'));var util=require('util');var path=require(_0x2b18('0x6'));var sox=require(_0x2b18('0x7'));var csv=require(_0x2b18('0x8'));var ejs=require(_0x2b18('0x9'));var fs=require('fs');var _=require(_0x2b18('0xa'));var squel=require(_0x2b18('0xb'));var crypto=require(_0x2b18('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2b18('0xd'));var toCsv=require(_0x2b18('0x8'));var querystring=require(_0x2b18('0xe'));var Papa=require(_0x2b18('0xf'));var Redis=require(_0x2b18('0x10'));var authService=require(_0x2b18('0x11'));var qs=require(_0x2b18('0x12'));var as=require(_0x2b18('0x13'));var hardwareService=require(_0x2b18('0x14'));var logger=require(_0x2b18('0x15'))(_0x2b18('0x16'));var utils=require(_0x2b18('0x17'));var config=require(_0x2b18('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42d679,_0x5a185f){_0x5a185f=_0x5a185f||0xcc;return function(_0x5be72d){if(_0x5be72d){return _0x42d679['sendStatus'](_0x5a185f);}return _0x42d679[_0x2b18('0x19')](_0x5a185f)[_0x2b18('0x1a')]();};}function respondWithResult(_0x436f48,_0x1d20a0){_0x1d20a0=_0x1d20a0||0xc8;return function(_0x2aee11){if(_0x2aee11){return _0x436f48[_0x2b18('0x19')](_0x1d20a0)[_0x2b18('0x1b')](_0x2aee11);}};}function respondWithFilteredResult(_0xe6bc1b,_0x5e4785){return function(_0x2ef594){if(_0x2ef594){var _0xa339af=_0x2ef594['count'],_0x1191ee=_0x5e4785['offset'],_0x4e5eff=_0x5e4785['offset']+_0x5e4785[_0x2b18('0x1c')],_0x3f7086;if(_0x4e5eff>=_0xa339af){_0x4e5eff=_0xa339af;_0x3f7086=0xc8;}else{_0x3f7086=0xce;}_0xe6bc1b[_0x2b18('0x19')](_0x3f7086);return _0xe6bc1b[_0x2b18('0x1d')](_0x2b18('0x1e'),_0x1191ee+'-'+_0x4e5eff+'/'+_0xa339af)[_0x2b18('0x1b')](_0x2ef594);}return null;};}function patchUpdates(_0x12ff10){return function(_0x279914){try{jsonpatch['apply'](_0x279914,_0x12ff10,!![]);}catch(_0x349557){return BPromise[_0x2b18('0x1f')](_0x349557);}return _0x279914['save']();};}function saveUpdates(_0x5be6f2,_0x2cef3a){return function(_0x603b94){if(_0x603b94){return _0x603b94['update'](_0x5be6f2)[_0x2b18('0x20')](function(_0x43912d){return _0x43912d;});}return null;};}function removeEntity(_0x309633,_0x2975ab){return function(_0x4e45d0){if(_0x4e45d0){return _0x4e45d0[_0x2b18('0x21')]()['then'](function(){var _0x729668=_0x4e45d0[_0x2b18('0x22')]({'plain':!![]});var _0x118197='Companies';return db['UserProfileResource']['destroy']({'where':{'type':_0x118197,'resourceId':_0x729668['id']}})[_0x2b18('0x20')](function(){return _0x4e45d0;});})[_0x2b18('0x20')](function(){_0x309633[_0x2b18('0x19')](0xcc)[_0x2b18('0x1a')]();});}};}function handleEntityNotFound(_0x3e52c2,_0x3f0425){return function(_0x432625){if(!_0x432625){_0x3e52c2[_0x2b18('0x23')](0x194);}return _0x432625;};}function handleError(_0x3b8aaa,_0x4e600b){_0x4e600b=_0x4e600b||0x1f4;return function(_0x141aef){logger[_0x2b18('0x24')](_0x141aef[_0x2b18('0x25')]);if(_0x141aef[_0x2b18('0x26')]){delete _0x141aef[_0x2b18('0x26')];}_0x3b8aaa[_0x2b18('0x19')](_0x4e600b)[_0x2b18('0x27')](_0x141aef);};}exports[_0x2b18('0x28')]=function(_0x1dd39e,_0x26afc0){var _0x225521={},_0x390724={},_0x161709={'count':0x0,'rows':[]};return db[_0x2b18('0x29')][_0x2b18('0x2a')]()[_0x2b18('0x20')](function(_0x407eba){_0x390724[_0x2b18('0x2b')]=_[_0x2b18('0x2c')](_0x407eba);_0x390724[_0x2b18('0x2d')]=_[_0x2b18('0x2c')](_0x1dd39e[_0x2b18('0x2d')]);_0x390724['filters']=_[_0x2b18('0x2e')](_0x390724[_0x2b18('0x2b')],_0x390724[_0x2b18('0x2d')]);_0x225521[_0x2b18('0x2f')]=_['intersection'](_0x390724['model'],qs['fields'](_0x1dd39e[_0x2b18('0x2d')][_0x2b18('0x30')]));_0x225521[_0x2b18('0x2f')]=_0x225521[_0x2b18('0x2f')][_0x2b18('0x31')]?_0x225521[_0x2b18('0x2f')]:_0x390724[_0x2b18('0x2b')];if(!_0x1dd39e[_0x2b18('0x2d')][_0x2b18('0x32')](_0x2b18('0x33'))){_0x225521[_0x2b18('0x1c')]=qs[_0x2b18('0x1c')](_0x1dd39e[_0x2b18('0x2d')][_0x2b18('0x1c')]);_0x225521['offset']=qs['offset'](_0x1dd39e['query'][_0x2b18('0x34')]);}_0x225521[_0x2b18('0x35')]=qs[_0x2b18('0x36')](_0x1dd39e[_0x2b18('0x2d')]['sort']);_0x225521['where']=qs[_0x2b18('0x37')](_[_0x2b18('0x38')](_0x1dd39e[_0x2b18('0x2d')],_0x390724[_0x2b18('0x37')]));if(_0x1dd39e[_0x2b18('0x2d')][_0x2b18('0x39')]){_0x225521[_0x2b18('0x3a')]=_[_0x2b18('0x3b')](_0x225521[_0x2b18('0x3a')],{'$or':_[_0x2b18('0x3c')](_0x225521[_0x2b18('0x2f')],function(_0x82c444){var _0x2503db={};_0x2503db[_0x82c444]={'$like':'%'+_0x1dd39e[_0x2b18('0x2d')][_0x2b18('0x39')]+'%'};return _0x2503db;})});}_0x225521=_[_0x2b18('0x3b')]({},_0x225521,_0x1dd39e['options']);var _0x23e46d={'where':_0x225521[_0x2b18('0x3a')]};return db[_0x2b18('0x29')][_0x2b18('0x3d')](_0x23e46d)[_0x2b18('0x20')](function(_0x175659){_0x161709[_0x2b18('0x3d')]=_0x175659;if(_0x1dd39e[_0x2b18('0x2d')][_0x2b18('0x3e')]){_0x225521[_0x2b18('0x3f')]=[{'all':!![]}];}return db[_0x2b18('0x29')][_0x2b18('0x40')](_0x225521);})[_0x2b18('0x20')](function(_0xfbe572){_0x161709[_0x2b18('0x41')]=_0xfbe572;return _0x161709;})[_0x2b18('0x20')](respondWithFilteredResult(_0x26afc0,_0x225521))[_0x2b18('0x42')](handleError(_0x26afc0,null));})[_0x2b18('0x42')](handleError(_0x26afc0,null));};exports[_0x2b18('0x43')]=function(_0xffbf0a,_0xa8f9f){var _0xc96f62={'raw':![],'where':{'id':_0xffbf0a['params']['id']}},_0x283a2f={};_0x283a2f['model']=_[_0x2b18('0x2c')](db[_0x2b18('0x29')][_0x2b18('0x44')]);_0x283a2f[_0x2b18('0x2d')]=_[_0x2b18('0x2c')](_0xffbf0a[_0x2b18('0x2d')]);_0x283a2f['filters']=_['intersection'](_0x283a2f[_0x2b18('0x2b')],_0x283a2f[_0x2b18('0x2d')]);_0xc96f62[_0x2b18('0x2f')]=_[_0x2b18('0x2e')](_0x283a2f[_0x2b18('0x2b')],qs['fields'](_0xffbf0a['query'][_0x2b18('0x30')]));_0xc96f62[_0x2b18('0x2f')]=_0xc96f62['attributes']['length']?_0xc96f62[_0x2b18('0x2f')]:_0x283a2f[_0x2b18('0x2b')];if(_0xffbf0a[_0x2b18('0x2d')][_0x2b18('0x3e')]){_0xc96f62[_0x2b18('0x3f')]=[{'all':!![]}];}_0xc96f62=_[_0x2b18('0x3b')]({},_0xc96f62,_0xffbf0a[_0x2b18('0x45')]);return db[_0x2b18('0x29')]['find'](_0xc96f62)[_0x2b18('0x20')](handleEntityNotFound(_0xa8f9f,null))[_0x2b18('0x20')](respondWithResult(_0xa8f9f,null))['catch'](handleError(_0xa8f9f,null));};exports[_0x2b18('0x46')]=function(_0x4ac135,_0x485036){return db['CmCompany'][_0x2b18('0x46')](_0x4ac135['body'],{})['then'](function(_0x166e40){var _0x51b872=_0x4ac135[_0x2b18('0x47')][_0x2b18('0x22')]({'plain':!![]});if(!_0x51b872)throw new Error(_0x2b18('0x48'));if(_0x51b872[_0x2b18('0x49')]===_0x2b18('0x47')){var _0x15b243=_0x166e40['get']({'plain':!![]});var _0x1bd5de=_0x2b18('0x4a');return db[_0x2b18('0x4b')][_0x2b18('0x4c')]({'where':{'name':_0x1bd5de,'userProfileId':_0x51b872[_0x2b18('0x4d')]},'raw':!![]})[_0x2b18('0x20')](function(_0x3435f5){if(_0x3435f5&&_0x3435f5[_0x2b18('0x4e')]===0x0){return db['UserProfileResource'][_0x2b18('0x46')]({'name':_0x15b243[_0x2b18('0x26')],'resourceId':_0x15b243['id'],'type':_0x3435f5[_0x2b18('0x26')],'sectionId':_0x3435f5['id']},{})[_0x2b18('0x20')](function(){return _0x166e40;});}else{return _0x166e40;}})['catch'](function(_0x19c3e6){logger[_0x2b18('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19c3e6);throw _0x19c3e6;});}return _0x166e40;})[_0x2b18('0x20')](respondWithResult(_0x485036,0xc9))[_0x2b18('0x42')](handleError(_0x485036,null));};exports[_0x2b18('0x4f')]=function(_0x1078b9,_0x482d20){if(_0x1078b9[_0x2b18('0x50')]['id']){delete _0x1078b9['body']['id'];}return db['CmCompany'][_0x2b18('0x4c')]({'where':{'id':_0x1078b9['params']['id']}})[_0x2b18('0x20')](handleEntityNotFound(_0x482d20,null))[_0x2b18('0x20')](saveUpdates(_0x1078b9[_0x2b18('0x50')],null))[_0x2b18('0x20')](respondWithResult(_0x482d20,null))[_0x2b18('0x42')](handleError(_0x482d20,null));};exports[_0x2b18('0x21')]=function(_0x6b19d0,_0x46b328){return db['CmCompany'][_0x2b18('0x4c')]({'where':{'id':_0x6b19d0[_0x2b18('0x51')]['id']}})['then'](handleEntityNotFound(_0x46b328,null))[_0x2b18('0x20')](removeEntity(_0x46b328,null))['catch'](handleError(_0x46b328,null));};exports['describe']=function(_0x11d8fc,_0x49ea46){return db['CmCompany'][_0x2b18('0x2a')]()[_0x2b18('0x20')](respondWithResult(_0x49ea46,null))[_0x2b18('0x42')](handleError(_0x49ea46,null));};exports[_0x2b18('0x52')]=function(_0x317564,_0x5ec2ac,_0x24d034){return db[_0x2b18('0x53')][_0x2b18('0x4c')]({'where':{'id':_0x317564['params']['id']}})[_0x2b18('0x20')](handleEntityNotFound(_0x5ec2ac,null))['then'](function(_0x3b41bc){if(_0x3b41bc){return _0x3b41bc[_0x2b18('0x52')](_0x317564[_0x2b18('0x50')][_0x2b18('0x54')],_[_0x2b18('0x55')](_0x317564['body'],[_0x2b18('0x54'),'id'])||{});}})['then'](respondWithResult(_0x5ec2ac,null))[_0x2b18('0x42')](handleError(_0x5ec2ac,null));};exports[_0x2b18('0x56')]=function(_0x2d4967,_0x3bce5e,_0x5312cc){var _0x481196={};var _0x3fb422={};var _0x46024c;var _0x41117b;return db[_0x2b18('0x29')]['findOne']({'where':{'id':_0x2d4967[_0x2b18('0x51')]['id']}})['then'](handleEntityNotFound(_0x3bce5e,null))['then'](function(_0x1c0048){if(_0x1c0048){_0x46024c=_0x1c0048;_0x3fb422[_0x2b18('0x2b')]=_[_0x2b18('0x2c')](db['CmContact']['rawAttributes']);_0x3fb422[_0x2b18('0x2d')]=_[_0x2b18('0x2c')](_0x2d4967[_0x2b18('0x2d')]);_0x3fb422[_0x2b18('0x37')]=_[_0x2b18('0x2e')](_0x3fb422[_0x2b18('0x2b')],_0x3fb422['query']);_0x481196[_0x2b18('0x2f')]=_[_0x2b18('0x2e')](_0x3fb422[_0x2b18('0x2b')],qs['fields'](_0x2d4967[_0x2b18('0x2d')][_0x2b18('0x30')]));_0x481196[_0x2b18('0x2f')]=_0x481196[_0x2b18('0x2f')][_0x2b18('0x31')]?_0x481196[_0x2b18('0x2f')]:_0x3fb422[_0x2b18('0x2b')];_0x481196[_0x2b18('0x35')]=qs[_0x2b18('0x36')](_0x2d4967[_0x2b18('0x2d')][_0x2b18('0x36')]);_0x481196[_0x2b18('0x3a')]=qs[_0x2b18('0x37')](_[_0x2b18('0x38')](_0x2d4967['query'],_0x3fb422[_0x2b18('0x37')]));if(_0x2d4967[_0x2b18('0x2d')][_0x2b18('0x39')]){_0x481196[_0x2b18('0x3a')]=_[_0x2b18('0x3b')](_0x481196['where'],{'$or':_[_0x2b18('0x3c')](_0x481196[_0x2b18('0x2f')],function(_0x523f85){var _0x3a996d={};_0x3a996d[_0x523f85]={'$like':'%'+_0x2d4967[_0x2b18('0x2d')]['filter']+'%'};return _0x3a996d;})});}_0x481196=_[_0x2b18('0x3b')]({},_0x481196,_0x2d4967[_0x2b18('0x45')]);return _0x46024c[_0x2b18('0x56')](_0x481196);}})['then'](function(_0xf09a61){if(_0xf09a61){_0x41117b=_0xf09a61[_0x2b18('0x31')];if(!_0x2d4967[_0x2b18('0x2d')][_0x2b18('0x32')](_0x2b18('0x33'))){_0x481196['limit']=qs['limit'](_0x2d4967['query']['limit']);_0x481196[_0x2b18('0x34')]=qs[_0x2b18('0x34')](_0x2d4967[_0x2b18('0x2d')][_0x2b18('0x34')]);}return _0x46024c['getContacts'](_0x481196);}})[_0x2b18('0x20')](function(_0x291302){if(_0x291302){return _0x291302?{'count':_0x41117b,'rows':_0x291302}:null;}})[_0x2b18('0x20')](respondWithResult(_0x3bce5e,null))[_0x2b18('0x42')](handleError(_0x3bce5e,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 507e040..1d07a4b 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 _0xfd7b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','util'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xfd7b,0x1df));var _0xbfd7=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0xfd7b[_0xe8129c];return _0x709fc5;};'use strict';var _=require('lodash');var util=require(_0xbfd7('0x0'));var logger=require(_0xbfd7('0x1'))(_0xbfd7('0x2'));var moment=require(_0xbfd7('0x3'));var BPromise=require(_0xbfd7('0x4'));var rp=require(_0xbfd7('0x5'));var fs=require('fs');var path=require(_0xbfd7('0x6'));var rimraf=require(_0xbfd7('0x7'));var config=require(_0xbfd7('0x8'));var attributes=require(_0xbfd7('0x9'));module[_0xbfd7('0xa')]=function(_0x2ad158,_0x639dd4){return _0x2ad158['define'](_0xbfd7('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a93=['rimraf','../../config/environment','exports','define','CmCompany','cm_companies','util','api','moment','path'];(function(_0x1ecdc3,_0x3095e1){var _0x3af46c=function(_0x1cc793){while(--_0x1cc793){_0x1ecdc3['push'](_0x1ecdc3['shift']());}};_0x3af46c(++_0x3095e1);}(_0x5a93,0xf6));var _0x35a9=function(_0x460683,_0x13ff5f){_0x460683=_0x460683-0x0;var _0x9e948b=_0x5a93[_0x460683];return _0x9e948b;};'use strict';var _=require('lodash');var util=require(_0x35a9('0x0'));var logger=require('../../config/logger')(_0x35a9('0x1'));var moment=require(_0x35a9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x35a9('0x3'));var rimraf=require(_0x35a9('0x4'));var config=require(_0x35a9('0x5'));var attributes=require('./cmCompany.attributes');module[_0x35a9('0x6')]=function(_0x27ed9f,_0x2e8a14){return _0x27ed9f[_0x35a9('0x7')](_0x35a9('0x8'),attributes,{'tableName':_0x35a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index d2a70c7..1c3c7d6 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 _0xfb08=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xfb08,0x118));var _0x8fb0=function(_0x101309,_0x25ffa5){_0x101309=_0x101309-0x0;var _0x837acf=_0xfb08[_0x101309];return _0x837acf;};'use strict';var _=require(_0x8fb0('0x0'));var util=require(_0x8fb0('0x1'));var moment=require(_0x8fb0('0x2'));var BPromise=require(_0x8fb0('0x3'));var rs=require(_0x8fb0('0x4'));var fs=require('fs');var Redis=require(_0x8fb0('0x5'));var db=require(_0x8fb0('0x6'))['db'];var utils=require(_0x8fb0('0x7'));var logger=require(_0x8fb0('0x8'))(_0x8fb0('0x9'));var config=require(_0x8fb0('0xa'));var jayson=require(_0x8fb0('0xb'));var client=jayson[_0x8fb0('0xc')][_0x8fb0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2a420c,_0x5be944,_0x34aaf3){return new BPromise(function(_0x199e3f,_0x176b37){return client[_0x8fb0('0xe')](_0x2a420c,_0x34aaf3)[_0x8fb0('0xf')](function(_0x4f3ced){logger[_0x8fb0('0x10')](_0x8fb0('0x11'),_0x5be944,_0x8fb0('0x12'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x5be944,_0x8fb0('0x12'),JSON['stringify'](_0x4f3ced));if(_0x4f3ced[_0x8fb0('0x13')]){if(_0x4f3ced['error']['code']===0x1f4){logger['error'](_0x8fb0('0x11'),_0x5be944,_0x4f3ced[_0x8fb0('0x13')][_0x8fb0('0x14')]);return _0x176b37(_0x4f3ced['error'][_0x8fb0('0x14')]);}logger['error'](_0x8fb0('0x11'),_0x5be944,_0x4f3ced['error']['message']);return _0x199e3f(_0x4f3ced[_0x8fb0('0x13')][_0x8fb0('0x14')]);}else{logger[_0x8fb0('0x10')](_0x8fb0('0x11'),_0x5be944,_0x8fb0('0x12'));_0x199e3f(_0x4f3ced[_0x8fb0('0x15')]['message']);}})[_0x8fb0('0x16')](function(_0x384eda){logger[_0x8fb0('0x13')]('CmCompany,\x20%s,\x20%s',_0x5be944,_0x384eda);_0x176b37(_0x384eda);});});} \ No newline at end of file +var _0xab80=['request','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc62ac8,_0x284965){var _0x3ee8bc=function(_0x1aa12d){while(--_0x1aa12d){_0xc62ac8['push'](_0xc62ac8['shift']());}};_0x3ee8bc(++_0x284965);}(_0xab80,0x109));var _0x0ab8=function(_0x408620,_0x6f1d4e){_0x408620=_0x408620-0x0;var _0x164382=_0xab80[_0x408620];return _0x164382;};'use strict';var _=require(_0x0ab8('0x0'));var util=require(_0x0ab8('0x1'));var moment=require(_0x0ab8('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ab8('0x3'));var fs=require('fs');var Redis=require(_0x0ab8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0ab8('0x5'))(_0x0ab8('0x6'));var config=require(_0x0ab8('0x7'));var jayson=require(_0x0ab8('0x8'));var client=jayson[_0x0ab8('0x9')][_0x0ab8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31b41e,_0x24b901,_0x84256d){return new BPromise(function(_0x36d74,_0x21e79e){return client[_0x0ab8('0xb')](_0x31b41e,_0x84256d)[_0x0ab8('0xc')](function(_0x2777b4){logger['info'](_0x0ab8('0xd'),_0x24b901,'request\x20sent');logger[_0x0ab8('0xe')](_0x0ab8('0xf'),_0x24b901,_0x0ab8('0x10'),JSON[_0x0ab8('0x11')](_0x2777b4));if(_0x2777b4[_0x0ab8('0x12')]){if(_0x2777b4[_0x0ab8('0x12')][_0x0ab8('0x13')]===0x1f4){logger[_0x0ab8('0x12')](_0x0ab8('0xd'),_0x24b901,_0x2777b4[_0x0ab8('0x12')][_0x0ab8('0x14')]);return _0x21e79e(_0x2777b4['error']['message']);}logger[_0x0ab8('0x12')](_0x0ab8('0xd'),_0x24b901,_0x2777b4[_0x0ab8('0x12')]['message']);return _0x36d74(_0x2777b4['error'][_0x0ab8('0x14')]);}else{logger[_0x0ab8('0x15')](_0x0ab8('0xd'),_0x24b901,_0x0ab8('0x10'));_0x36d74(_0x2777b4['result'][_0x0ab8('0x14')]);}})[_0x0ab8('0x16')](function(_0x3803a8){logger[_0x0ab8('0x12')](_0x0ab8('0xd'),_0x24b901,_0x3803a8);_0x21e79e(_0x3803a8);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index a6cc3f3..6a62066 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 _0x01d9=['post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts'];(function(_0x19a29,_0x4267e8){var _0x1ea624=function(_0x2a1a38){while(--_0x2a1a38){_0x19a29['push'](_0x19a29['shift']());}};_0x1ea624(++_0x4267e8);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var auth=require(_0x901d('0x5'));var interaction=require(_0x901d('0x6'));var config=require(_0x901d('0x7'));var controller=require(_0x901d('0x8'));router[_0x901d('0x9')]('/',auth[_0x901d('0xa')](),controller['index']);router[_0x901d('0x9')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0xc')]);router[_0x901d('0x9')](_0x901d('0xd'),auth[_0x901d('0xa')](),controller[_0x901d('0xe')]);router[_0x901d('0x9')](_0x901d('0xf'),auth[_0x901d('0xa')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')]('/',auth['isAuthenticated'](),controller[_0x901d('0x12')]);router['post'](_0x901d('0xf'),auth[_0x901d('0xa')](),controller[_0x901d('0x13')]);router[_0x901d('0x14')](_0x901d('0xd'),auth['isAuthenticated'](),controller[_0x901d('0x15')]);router[_0x901d('0x16')](_0x901d('0xd'),auth[_0x901d('0xa')](),controller[_0x901d('0x17')]);module[_0x901d('0x18')]=router; \ No newline at end of file +var _0x5204=['addContacts','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id/contacts','getContacts','post','create'];(function(_0x20c205,_0x39bc5e){var _0x3d6cf2=function(_0x209286){while(--_0x209286){_0x20c205['push'](_0x20c205['shift']());}};_0x3d6cf2(++_0x39bc5e);}(_0x5204,0xdf));var _0x4520=function(_0x11ec6c,_0x1a8169){_0x11ec6c=_0x11ec6c-0x0;var _0xb59506=_0x5204[_0x11ec6c];return _0xb59506;};'use strict';var multer=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var path=require('path');var timeout=require(_0x4520('0x2'));var express=require(_0x4520('0x3'));var router=express[_0x4520('0x4')]();var auth=require(_0x4520('0x5'));var interaction=require(_0x4520('0x6'));var config=require('../../config/environment');var controller=require(_0x4520('0x7'));router['get']('/',auth[_0x4520('0x8')](),controller[_0x4520('0x9')]);router[_0x4520('0xa')](_0x4520('0xb'),auth[_0x4520('0x8')](),controller[_0x4520('0xc')]);router[_0x4520('0xa')]('/:id',auth[_0x4520('0x8')](),controller['show']);router[_0x4520('0xa')](_0x4520('0xd'),auth[_0x4520('0x8')](),controller[_0x4520('0xe')]);router[_0x4520('0xf')]('/',auth[_0x4520('0x8')](),controller[_0x4520('0x10')]);router[_0x4520('0xf')](_0x4520('0xd'),auth[_0x4520('0x8')](),controller[_0x4520('0x11')]);router[_0x4520('0x12')](_0x4520('0x13'),auth[_0x4520('0x8')](),controller[_0x4520('0x14')]);router[_0x4520('0x15')](_0x4520('0x13'),auth[_0x4520('0x8')](),controller[_0x4520('0x16')]);module[_0x4520('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index f67ef1a..0ea6113 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 _0xedd5=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x310fc1,_0x32d346){var _0x3d1e75=function(_0x48bc5f){while(--_0x48bc5f){_0x310fc1['push'](_0x310fc1['shift']());}};_0x3d1e75(++_0x32d346);}(_0xedd5,0x18f));var _0x5edd=function(_0x3074f3,_0x4f2c03){_0x3074f3=_0x3074f3-0x0;var _0x53f112=_0xedd5[_0x3074f3];return _0x53f112;};'use strict';var _=require(_0x5edd('0x0'));var Sequelize=require('sequelize');module[_0x5edd('0x1')]={'firstName':{'type':Sequelize[_0x5edd('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5edd('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5edd('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x5edd('0x2')]},'description':{'type':Sequelize[_0x5edd('0x3')]},'phone':{'type':Sequelize[_0x5edd('0x2')]},'mobile':{'type':Sequelize[_0x5edd('0x2')]},'fax':{'type':Sequelize[_0x5edd('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x5edd('0x2')]},'facebook':{'type':Sequelize[_0x5edd('0x2')]},'fb_data':{'type':Sequelize[_0x5edd('0x2')]},'twitter':{'type':Sequelize[_0x5edd('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x5edd('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x5edd('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x5edd('0x4')](0x2)[_0x5edd('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5edd('0x6')],'defaultValue':Sequelize[_0x5edd('0x7')]}}; \ No newline at end of file +var _0x3961=['INTEGER','UNSIGNED','DATE','NOW','sequelize','exports','STRING','TEXT'];(function(_0x540aac,_0x3bb9d2){var _0x19696a=function(_0x49f369){while(--_0x49f369){_0x540aac['push'](_0x540aac['shift']());}};_0x19696a(++_0x3bb9d2);}(_0x3961,0xec));var _0x1396=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x3961[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var Sequelize=require(_0x1396('0x0'));module[_0x1396('0x1')]={'firstName':{'type':Sequelize[_0x1396('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1396('0x2')]},'street':{'type':Sequelize[_0x1396('0x2')]},'postalCode':{'type':Sequelize[_0x1396('0x2')]},'city':{'type':Sequelize[_0x1396('0x2')]},'country':{'type':Sequelize[_0x1396('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1396('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1396('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x1396('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x1396('0x2')]},'skype':{'type':Sequelize[_0x1396('0x2')]},'teams':{'type':Sequelize[_0x1396('0x2')]},'viber':{'type':Sequelize[_0x1396('0x2')]},'line':{'type':Sequelize[_0x1396('0x2')]},'wechat':{'type':Sequelize[_0x1396('0x2')]},'telegram':{'type':Sequelize[_0x1396('0x2')]},'UserId':{'type':Sequelize[_0x1396('0x4')]},'priority':{'type':Sequelize[_0x1396('0x4')](0x2)[_0x1396('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1396('0x6')],'defaultValue':Sequelize[_0x1396('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index b4430d9..826bf2d 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 _0x05a8=['message','exit','error\x20child\x20process','eml-format','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','sendStatus','status','end','limit','set','reject','save','destroy','then','error','stack','name','send','CmContact','describe','length','startsWith','cf_','push','CmCustomField','trimStart','all','fieldType','query','attributes','intersection','model','fields','hasOwnProperty','nolimit','offset','sort','filters','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','where','expr','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','dateOfBirth','datetime','castTo','DATE','text','start','keys','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','filter','replace','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','clone','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','c.firstName','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','findAll','displayName','alias','custom','type','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','update','ChatMessage','ChatOfflineMessage','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','join','bulkCreate','each','duplicates','ListId','findOrCreate','show','$and','omit','format','cf_%d','pickBy','table','id\x20=\x20?','toParam','values','phone','getTags','findOne','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','getHopperFinals','getJscriptySessions','include','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','createReadStream','path','parse','json','agent','binding','../../components/import/cm/csv2','stringify'];(function(_0xc934ab,_0x4d277b){var _0x5ade40=function(_0x17e9df){while(--_0x17e9df){_0xc934ab['push'](_0xc934ab['shift']());}};_0x5ade40(++_0x4d277b);}(_0x05a8,0xeb));var _0x805a=function(_0x12cb2e,_0xdf4665){_0x12cb2e=_0x12cb2e-0x0;var _0x5a6135=_0x05a8[_0x12cb2e];return _0x5a6135;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x805a('0x0'));var rimraf=require(_0x805a('0x1'));var zipdir=require(_0x805a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x805a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x805a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x805a('0x5'));var csv=require(_0x805a('0x6'));var ejs=require(_0x805a('0x7'));var fs=require('fs');var _=require(_0x805a('0x8'));var squel=require(_0x805a('0x9'));var crypto=require(_0x805a('0xa'));var jsforce=require(_0x805a('0xb'));var deskjs=require(_0x805a('0xc'));var toCsv=require(_0x805a('0x6'));var querystring=require(_0x805a('0xd'));var Papa=require(_0x805a('0xe'));var Redis=require('ioredis');var authService=require(_0x805a('0xf'));var qs=require(_0x805a('0x10'));var as=require(_0x805a('0x11'));var hardwareService=require(_0x805a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x805a('0x13'));var config=require(_0x805a('0x14'));var db=require(_0x805a('0x15'))['db'];config[_0x805a('0x16')]=_[_0x805a('0x17')](config[_0x805a('0x16')],{'host':_0x805a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x805a('0x16')]));require(_0x805a('0x19'))[_0x805a('0x1a')](socket);function respondWithStatusCode(_0x32ced9,_0x870954){_0x870954=_0x870954||0xcc;return function(_0x40db1f){if(_0x40db1f){return _0x32ced9[_0x805a('0x1b')](_0x870954);}return _0x32ced9[_0x805a('0x1c')](_0x870954)[_0x805a('0x1d')]();};}function respondWithResult(_0x3a025c,_0x2011d8){_0x2011d8=_0x2011d8||0xc8;return function(_0x42ee89){if(_0x42ee89){return _0x3a025c['status'](_0x2011d8)['json'](_0x42ee89);}};}function respondWithFilteredResult(_0x44c0cd,_0x4de7c3){return function(_0x63bcd4){if(_0x63bcd4){var _0x40f773=_0x63bcd4['count'],_0x33de99=_0x4de7c3['offset'],_0x1507d5=_0x4de7c3['offset']+_0x4de7c3[_0x805a('0x1e')],_0x3b07c9;if(_0x1507d5>=_0x40f773){_0x1507d5=_0x40f773;_0x3b07c9=0xc8;}else{_0x3b07c9=0xce;}_0x44c0cd[_0x805a('0x1c')](_0x3b07c9);return _0x44c0cd[_0x805a('0x1f')]('Content-Range',_0x33de99+'-'+_0x1507d5+'/'+_0x40f773)['json'](_0x63bcd4);}return null;};}function patchUpdates(_0x1dbf95){return function(_0x406db8){try{jsonpatch['apply'](_0x406db8,_0x1dbf95,!![]);}catch(_0x19ca75){return BPromise[_0x805a('0x20')](_0x19ca75);}return _0x406db8[_0x805a('0x21')]();};}function saveUpdates(_0x3151ce,_0x332999){return function(_0x680499){if(_0x680499){return _0x680499['update'](_0x3151ce)['then'](function(_0x1ab8ad){return _0x1ab8ad;});}return null;};}function removeEntity(_0x3c7b83,_0xdd0695){return function(_0x2580f4){if(_0x2580f4){return _0x2580f4[_0x805a('0x22')]()[_0x805a('0x23')](function(){_0x3c7b83[_0x805a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3687b5,_0xe3d5d2){return function(_0x2d4709){if(!_0x2d4709){_0x3687b5[_0x805a('0x1b')](0x194);}return _0x2d4709;};}function handleError(_0x2d93c6,_0x47fa61){_0x47fa61=_0x47fa61||0x1f4;return function(_0x5c5aa7){logger[_0x805a('0x24')](_0x5c5aa7[_0x805a('0x25')]);if(_0x5c5aa7['name']){delete _0x5c5aa7[_0x805a('0x26')];}_0x2d93c6['status'](_0x47fa61)[_0x805a('0x27')](_0x5c5aa7);};}exports['index']=function(_0x3bb67e,_0x33b027){var _0xb67f69={},_0x4d43f7={},_0x3c47f5={'count':0x0,'rows':[]};return db[_0x805a('0x28')][_0x805a('0x29')]()['then'](function(_0x2d93e1){var _0x1886bb=[];for(var _0x5d0e46=0x0;_0x5d0e460x1){_0x3265ef['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x805a('0x65')](_0x339fef),null);}else{if(qs['isNumeric'](_0x339fef)){_0x3265ef['or'](_0x805a('0x66'),_0x339fef+'%');_0x3265ef['or'](_0x805a('0x67'),_0x339fef+'%');_0x3265ef['or'](_0x805a('0x68'),_0x339fef+'%');_0x3265ef['or']('c.fax\x20LIKE\x20?',_0x339fef+'%');}else if(qs['isEmail'](_0x339fef)){_0x3265ef['or']('c.email\x20LIKE\x20?',_0x339fef+'%');}else{_0x3265ef['or'](_0x805a('0x69'),'%'+_0x339fef+'%');_0x3265ef['or'](_0x805a('0x6a'),'%'+_0x339fef+'%');_0x3265ef['or'](_0x805a('0x6b'),'%'+_0x339fef+'%');}}}}_0x3be873[_0x805a('0x48')](_0x3265ef);_0x3be873[_0x805a('0x6c')](_0x805a('0x6d'));var _0x1e2ef2={'type':db['Sequelize'][_0x805a('0x6e')][_0x805a('0x6f')],'raw':!![]};var _0xb3b4a2=_0x3be873[_0x805a('0x70')]()[_0x805a('0x3e')]('c.id');if(_0xb67f69['order']){_0xb67f69['order'][_0x805a('0x52')](function(_0x324674){_0x3be873[_0x805a('0x71')]('c.'+_0x324674[0x0],_0x324674[0x1]===_0x805a('0x72')?![]:!![]);});}if(!_[_0x805a('0x73')](_0x58b95e)){_0x3be873['having'](_0x29523d);_0xb3b4a2['where'](_0x805a('0x74'),_0x58b95e);}BPromise[_0x805a('0x75')]()[_0x805a('0x23')](function(){if(_0x34a438&&!_[_0x805a('0x76')](_0x34a438[_0x805a('0x4c')],[_0x805a('0x3e'),'User'])){return _0x3bb67e['user'][_0x805a('0x77')]({'attributes':['id'],'raw':!![]})[_0x805a('0x23')](function(_0x8717ec){if(_['isEmpty'](_0x8717ec)){_0xb3b4a2[_0x805a('0x48')](_0x805a('0x78'));_0x3be873[_0x805a('0x48')](_0x805a('0x78'));}else{_0xb3b4a2['where'](_0x805a('0x5d'),_['map'](_0x8717ec,'id'));_0x3be873[_0x805a('0x48')](_0x805a('0x5d'),_[_0x805a('0x51')](_0x8717ec,'id'));}});}else{return;}})[_0x805a('0x23')](function(){db[_0x805a('0x79')][_0x805a('0x32')](_0xb3b4a2[_0x805a('0x7a')](),_0x1e2ef2)[_0x805a('0x23')](function(_0x39c8e1){_0x3c47f5[_0x805a('0x7b')]=_0x39c8e1[_0x805a('0x2a')];if(_0x3c47f5[_0x805a('0x7b')]===0x0)return[];return db['sequelize']['query'](_0x500a8a[_0x805a('0x7a')](),_0x1e2ef2);})['then'](function(_0x3001be){_0x593446=_[_0x805a('0x7c')](_0x3001be,'id');_0x1e2ef2=_[_0x805a('0x7d')](_0x1e2ef2,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3bb67e[_0x805a('0x32')]['fields']){_0xb67f69[_0x805a('0x33')][_0x805a('0x52')](function(_0x2d9b65){_0x3be873[_0x805a('0x3e')]('c.'+_0x2d9b65);});}else{_0x3be873[_0x805a('0x3e')]('c.id');_0x3be873['field'](_0x805a('0x7e'));_0x3be873['field']('c.lastName');_0x3be873[_0x805a('0x3e')]('c.phone');_0x3be873['field'](_0x805a('0x7f'));_0x3be873['field'](_0x805a('0x80'));_0x3be873[_0x805a('0x3e')](_0x805a('0x81'));_0x3be873[_0x805a('0x3e')](_0x805a('0x82'));_0x3be873['field'](_0x805a('0x83'));_0x3be873['field'](_0x805a('0x84'),_0x805a('0x85'));}if(_0xb67f69[_0x805a('0x1e')])_0x3be873[_0x805a('0x1e')](_0xb67f69[_0x805a('0x1e')]);if(_0xb67f69[_0x805a('0x39')])_0x3be873[_0x805a('0x39')](_0xb67f69[_0x805a('0x39')]);return db[_0x805a('0x79')][_0x805a('0x32')](_0x3be873['toString'](),_0x1e2ef2);})[_0x805a('0x23')](function(_0x2e8e24){_0x2e8e24['forEach'](function(_0x54a9af){if(_0x54a9af['TagIds']){_0x54a9af[_0x805a('0x86')]=[];_0x54a9af[_0x805a('0x85')][_0x805a('0x50')](',')[_0x805a('0x52')](function(_0x16c9ab){_0x54a9af[_0x805a('0x86')]['push'](_0x593446[_0x16c9ab]);});}delete _0x54a9af[_0x805a('0x85')];});_0x3c47f5[_0x805a('0x87')]=_0x2e8e24;return _0x3c47f5;})[_0x805a('0x23')](respondWithFilteredResult(_0x33b027,_0xb67f69));});})[_0x805a('0x88')](handleError(_0x33b027,null));};exports['destroy']=function(_0x25ab6c,_0x28bb28){return db[_0x805a('0x28')][_0x805a('0x4d')]({'where':{'id':_0x25ab6c[_0x805a('0x89')]['id']}})[_0x805a('0x23')](handleEntityNotFound(_0x28bb28,null))[_0x805a('0x23')](removeEntity(_0x28bb28,null))[_0x805a('0x88')](handleError(_0x28bb28,null));};exports[_0x805a('0x29')]=function(_0x329b8a,_0x5d5e34){return db['CmContact'][_0x805a('0x29')]()[_0x805a('0x23')](function(_0x1543de){delete _0x1543de[_0x805a('0x8a')];for(var _0x5c942a=0x0;_0x5c942a=_0x1ab3ce){_0x452a42=_0x1ab3ce;_0x1ca514=0xc8;}else{_0x1ca514=0xce;}_0x576b80[_0x1cdc('0x21')](_0x1ca514);return _0x576b80[_0x1cdc('0x27')]('Content-Range',_0x2a2ade+'-'+_0x452a42+'/'+_0x1ab3ce)[_0x1cdc('0x23')](_0xb2b4f3);}return null;};}function patchUpdates(_0xf8328b){return function(_0x24cc88){try{jsonpatch['apply'](_0x24cc88,_0xf8328b,!![]);}catch(_0x3ca9d9){return BPromise[_0x1cdc('0x28')](_0x3ca9d9);}return _0x24cc88[_0x1cdc('0x29')]();};}function saveUpdates(_0x1979b7,_0x4e060d){return function(_0x316de1){if(_0x316de1){return _0x316de1[_0x1cdc('0x2a')](_0x1979b7)[_0x1cdc('0x2b')](function(_0x4244f5){return _0x4244f5;});}return null;};}function removeEntity(_0x40d56f,_0x5b5929){return function(_0x200041){if(_0x200041){return _0x200041[_0x1cdc('0x2c')]()[_0x1cdc('0x2b')](function(){_0x40d56f[_0x1cdc('0x21')](0xcc)[_0x1cdc('0x22')]();});}};}function handleEntityNotFound(_0x48d4cd,_0x2765b1){return function(_0x909ba1){if(!_0x909ba1){_0x48d4cd[_0x1cdc('0x20')](0x194);}return _0x909ba1;};}function handleError(_0x455201,_0x33f41b){_0x33f41b=_0x33f41b||0x1f4;return function(_0x1dcaa6){logger[_0x1cdc('0x2d')](_0x1dcaa6[_0x1cdc('0x2e')]);if(_0x1dcaa6['name']){delete _0x1dcaa6[_0x1cdc('0x2f')];}_0x455201[_0x1cdc('0x21')](_0x33f41b)[_0x1cdc('0x30')](_0x1dcaa6);};}exports[_0x1cdc('0x31')]=function(_0x3a6b3c,_0x4849db){var _0x5cb3dd={},_0x412d24={},_0x24d8e7={'count':0x0,'rows':[]};return db[_0x1cdc('0x32')]['describe']()[_0x1cdc('0x2b')](function(_0x52afd9){var _0x13d04d=[];for(var _0x39a0ce=0x0;_0x39a0ce0x1){_0x2e5f59['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1cdc('0x70')](_0x2ce42e),null);}else{if(qs[_0x1cdc('0x71')](_0x2ce42e)){_0x2e5f59['or'](_0x1cdc('0x72'),_0x2ce42e+'%');_0x2e5f59['or'](_0x1cdc('0x73'),_0x2ce42e+'%');_0x2e5f59['or']('c.mobile\x20LIKE\x20?',_0x2ce42e+'%');_0x2e5f59['or'](_0x1cdc('0x74'),_0x2ce42e+'%');}else if(qs[_0x1cdc('0x75')](_0x2ce42e)){_0x2e5f59['or'](_0x1cdc('0x76'),_0x2ce42e+'%');}else{_0x2e5f59['or'](_0x1cdc('0x77'),'%'+_0x2ce42e+'%');_0x2e5f59['or'](_0x1cdc('0x78'),'%'+_0x2ce42e+'%');_0x2e5f59['or']('c.email\x20LIKE\x20?','%'+_0x2ce42e+'%');}}}}_0x20584f[_0x1cdc('0x46')](_0x2e5f59);_0x20584f[_0x1cdc('0x79')](_0x1cdc('0x7a'));var _0x4835cc={'type':db[_0x1cdc('0x7b')][_0x1cdc('0x7c')][_0x1cdc('0x7d')],'raw':!![]};var _0x30616b=_0x20584f[_0x1cdc('0x7e')]()['field']('c.id');if(_0x5cb3dd['order']){_0x5cb3dd['order'][_0x1cdc('0x5a')](function(_0x46b8de){_0x20584f[_0x1cdc('0x44')]('c.'+_0x46b8de[0x0],_0x46b8de[0x1]===_0x1cdc('0x7f')?![]:!![]);});}if(!_[_0x1cdc('0x67')](_0x4bf5ae)){_0x20584f[_0x1cdc('0x80')](_0x4de6bb);_0x30616b[_0x1cdc('0x46')](_0x1cdc('0x81'),_0x4bf5ae);}BPromise[_0x1cdc('0x82')]()[_0x1cdc('0x2b')](function(){if(_0x4f31be&&!_[_0x1cdc('0x83')](_0x4f31be[_0x1cdc('0x84')],[_0x1cdc('0x49'),'User'])){return _0x3a6b3c[_0x1cdc('0x85')]['getLists']({'attributes':['id'],'raw':!![]})[_0x1cdc('0x2b')](function(_0x2c3f1c){if(_[_0x1cdc('0x67')](_0x2c3f1c)){_0x30616b[_0x1cdc('0x46')]('c.ListId\x20IS\x20NULL');_0x20584f[_0x1cdc('0x46')](_0x1cdc('0x86'));}else{_0x30616b[_0x1cdc('0x46')](_0x1cdc('0x69'),_['map'](_0x2c3f1c,'id'));_0x20584f[_0x1cdc('0x46')](_0x1cdc('0x69'),_[_0x1cdc('0x59')](_0x2c3f1c,'id'));}});}else{return;}})['then'](function(){db[_0x1cdc('0x87')]['query'](_0x30616b[_0x1cdc('0x88')](),_0x4835cc)[_0x1cdc('0x2b')](function(_0x2c2b26){_0x24d8e7['count']=_0x2c2b26[_0x1cdc('0x34')];if(_0x24d8e7['count']===0x0)return[];return db[_0x1cdc('0x87')][_0x1cdc('0x3d')](_0x23d58e['toString'](),_0x4835cc);})[_0x1cdc('0x2b')](function(_0x502544){_0x515ef7=_[_0x1cdc('0x89')](_0x502544,'id');_0x4835cc=_['merge'](_0x4835cc,{'model':db[_0x1cdc('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a6b3c[_0x1cdc('0x3d')][_0x1cdc('0x41')]){_0x5cb3dd['attributes'][_0x1cdc('0x5a')](function(_0x37cf26){_0x20584f[_0x1cdc('0x49')]('c.'+_0x37cf26);});}else{_0x20584f[_0x1cdc('0x49')]('c.id');_0x20584f[_0x1cdc('0x49')](_0x1cdc('0x8a'));_0x20584f[_0x1cdc('0x49')](_0x1cdc('0x8b'));_0x20584f[_0x1cdc('0x49')](_0x1cdc('0x8c'));_0x20584f[_0x1cdc('0x49')](_0x1cdc('0x8d'));_0x20584f[_0x1cdc('0x49')](_0x1cdc('0x8e'));_0x20584f['field'](_0x1cdc('0x8f'));_0x20584f[_0x1cdc('0x49')]('c.ListId');_0x20584f[_0x1cdc('0x49')](_0x1cdc('0x90'));_0x20584f[_0x1cdc('0x49')](_0x1cdc('0x91'),_0x1cdc('0x92'));}if(_0x5cb3dd[_0x1cdc('0x26')])_0x20584f[_0x1cdc('0x26')](_0x5cb3dd[_0x1cdc('0x26')]);if(_0x5cb3dd['offset'])_0x20584f['offset'](_0x5cb3dd[_0x1cdc('0x25')]);return db[_0x1cdc('0x87')][_0x1cdc('0x3d')](_0x20584f[_0x1cdc('0x88')](),_0x4835cc);})[_0x1cdc('0x2b')](function(_0x5d7375){_0x5d7375[_0x1cdc('0x5a')](function(_0x9f956e){if(_0x9f956e[_0x1cdc('0x92')]){_0x9f956e[_0x1cdc('0x93')]=[];_0x9f956e[_0x1cdc('0x92')][_0x1cdc('0x58')](',')[_0x1cdc('0x5a')](function(_0x713d27){_0x9f956e[_0x1cdc('0x93')]['push'](_0x515ef7[_0x713d27]);});}delete _0x9f956e[_0x1cdc('0x92')];});_0x24d8e7[_0x1cdc('0x94')]=_0x5d7375;return _0x24d8e7;})[_0x1cdc('0x2b')](respondWithFilteredResult(_0x4849db,_0x5cb3dd));});})[_0x1cdc('0x95')](handleError(_0x4849db,null));};exports['destroy']=function(_0xc1fa1c,_0xc9ee51){return db[_0x1cdc('0x32')]['find']({'where':{'id':_0xc1fa1c[_0x1cdc('0x96')]['id']}})[_0x1cdc('0x2b')](handleEntityNotFound(_0xc9ee51,null))[_0x1cdc('0x2b')](removeEntity(_0xc9ee51,null))['catch'](handleError(_0xc9ee51,null));};exports[_0x1cdc('0x97')]=function(_0x3b078a,_0x482e3f){return db[_0x1cdc('0x32')][_0x1cdc('0x97')]()[_0x1cdc('0x2b')](function(_0x3645ea){delete _0x3645ea[_0x1cdc('0x98')];for(var _0x5b80ba=0x0;_0x5b80ba{}\s\\|]/g,'-');_0x554122(null,util['format'](_0x97c0('0x24'),path[_0x97c0('0x25')](_0x4ca20a[_0x97c0('0x22')],path[_0x97c0('0x26')](_0x4ca20a[_0x97c0('0x22')])),Date[_0x97c0('0x27')](),path[_0x97c0('0x26')](_0x4ca20a['originalname'])));}})});router[_0x97c0('0x17')](_0x97c0('0x28'),upload[_0x97c0('0x29')](_0x97c0('0x2a')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x97c0('0x1e')]({'destination':function(_0x14cada,_0x52a429,_0x2ec9d6){_0x2ec9d6(null,path[_0x97c0('0x1f')](config[_0x97c0('0x20')],'server/files/tmp'));},'filename':function(_0x4f11ba,_0x51f258,_0x11b8ad){_0x51f258[_0x97c0('0x22')]=_0x51f258[_0x97c0('0x22')][_0x97c0('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x11b8ad(null,util[_0x97c0('0x2b')](_0x97c0('0x24'),path['basename'](_0x51f258[_0x97c0('0x22')],path[_0x97c0('0x26')](_0x51f258[_0x97c0('0x22')])),Date['now'](),path[_0x97c0('0x26')](_0x51f258[_0x97c0('0x22')])));}})});router[_0x97c0('0x17')](_0x97c0('0x2c'),upload[_0x97c0('0x29')]('file'),controller['upload']);router[_0x97c0('0x17')](_0x97c0('0x2d'),auth[_0x97c0('0xa')](),controller['import']);router[_0x97c0('0x2e')](_0x97c0('0xc'),auth['isAuthenticated'](),controller[_0x97c0('0x2f')]);router[_0x97c0('0x30')](_0x97c0('0xc'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x31')]);module[_0x97c0('0x32')]=router; \ No newline at end of file +var _0x7217=['getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','/merge','create','post','/create_many','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','now','extname','/csv','single','uploadCsv','basename','file','upload','/upload/:id','import','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x468acd,_0x34bc71){var _0x2b4861=function(_0x100923){while(--_0x100923){_0x468acd['push'](_0x468acd['shift']());}};_0x2b4861(++_0x34bc71);}(_0x7217,0x19e));var _0x7721=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7217[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0x7')](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0x7')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller['getTags']);router[_0x7721('0x7')](_0x7721('0xf'),auth[_0x7721('0x8')](),controller[_0x7721('0x10')]);router[_0x7721('0x7')](_0x7721('0x11'),auth[_0x7721('0x8')](),controller[_0x7721('0x12')]);router['get'](_0x7721('0x13'),auth[_0x7721('0x8')](),controller['getHopperFinals']);router[_0x7721('0x7')](_0x7721('0x14'),auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x16'),auth[_0x7721('0x8')](),controller['merge']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x17')]);router[_0x7721('0x18')](_0x7721('0x19'),auth[_0x7721('0x8')](),controller['bulkCreate']);router[_0x7721('0x18')]('/:id/tags',auth[_0x7721('0x8')](),controller['setTags']);var upload=multer({'storage':multer[_0x7721('0x1a')]({'destination':function(_0x4e96fb,_0x3ab5a5,_0x3e140d){_0x3e140d(null,path[_0x7721('0x1b')](config[_0x7721('0x1c')],_0x7721('0x1d')));},'filename':function(_0x413263,_0x3b29ac,_0xaeccc4){_0x3b29ac['originalname']=_0x3b29ac[_0x7721('0x1e')][_0x7721('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xaeccc4(null,util[_0x7721('0x20')](_0x7721('0x21'),path['basename'](_0x3b29ac[_0x7721('0x1e')],path['extname'](_0x3b29ac[_0x7721('0x1e')])),Date[_0x7721('0x22')](),path[_0x7721('0x23')](_0x3b29ac[_0x7721('0x1e')])));}})});router[_0x7721('0x18')](_0x7721('0x24'),upload[_0x7721('0x25')]('file'),controller[_0x7721('0x26')]);var upload=multer({'storage':multer[_0x7721('0x1a')]({'destination':function(_0x125564,_0x1f67c7,_0x40d550){_0x40d550(null,path[_0x7721('0x1b')](config[_0x7721('0x1c')],_0x7721('0x1d')));},'filename':function(_0x40f367,_0x52316e,_0x258ddf){_0x52316e['originalname']=_0x52316e['originalname'][_0x7721('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x258ddf(null,util[_0x7721('0x20')](_0x7721('0x21'),path[_0x7721('0x27')](_0x52316e[_0x7721('0x1e')],path[_0x7721('0x23')](_0x52316e[_0x7721('0x1e')])),Date[_0x7721('0x22')](),path['extname'](_0x52316e[_0x7721('0x1e')])));}})});router[_0x7721('0x18')]('/upload',upload['single'](_0x7721('0x28')),controller[_0x7721('0x29')]);router['post'](_0x7721('0x2a'),auth[_0x7721('0x8')](),controller[_0x7721('0x2b')]);router['put'](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0x2c')]);router[_0x7721('0x2d')](_0x7721('0xc'),auth['isAuthenticated'](),controller[_0x7721('0x2e')]);module[_0x7721('0x2f')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index d8437df..12cdf84 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 _0xe24f=['STRING','alias','name','long','type','select','values','isArray','setDataValue','BOOLEAN','lodash','exports','VIRTUAL','getDataValue'];(function(_0x559057,_0xc1a46c){var _0x13c81d=function(_0x44dd8c){while(--_0x44dd8c){_0x559057['push'](_0x559057['shift']());}};_0x13c81d(++_0xc1a46c);}(_0xe24f,0xea));var _0xfe24=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe24f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var _=require(_0xfe24('0x0'));module[_0xfe24('0x1')]={'name':{'type':Sequelize[_0xfe24('0x2')],'get':function(_0x400a1f){return this[_0xfe24('0x3')]('alias');}},'alias':{'type':Sequelize[_0xfe24('0x4')],'allowNull':![],'set':function(_0x1a44e1){this['setDataValue'](_0xfe24('0x5'),_0x1a44e1?_0x1a44e1:this[_0xfe24('0x3')](_0xfe24('0x6')));}},'type':{'type':Sequelize[_0xfe24('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xfe24('0x7')),'get':function(){if(this[_0xfe24('0x3')](_0xfe24('0x8'))===_0xfe24('0x9')){return JSON['parse'](this[_0xfe24('0x3')](_0xfe24('0xa')));}else{return this[_0xfe24('0x3')]('values');}},'set':function(_0x3b84dd){if(Array[_0xfe24('0xb')](_0x3b84dd)){this[_0xfe24('0xc')]('values',JSON['stringify'](_0x3b84dd));}else{this['setDataValue'](_0xfe24('0xa'),_0x3b84dd);}}},'required':{'type':Sequelize[_0xfe24('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x4c5c=['VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','values','isArray','BOOLEAN','sequelize','lodash','exports'];(function(_0x685346,_0x3ef2e5){var _0x52e15b=function(_0x4435da){while(--_0x4435da){_0x685346['push'](_0x685346['shift']());}};_0x52e15b(++_0x3ef2e5);}(_0x4c5c,0x7d));var _0xc4c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c5c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc4c5('0x0'));var _=require(_0xc4c5('0x1'));module[_0xc4c5('0x2')]={'name':{'type':Sequelize[_0xc4c5('0x3')],'get':function(_0x44b3b4){return this[_0xc4c5('0x4')](_0xc4c5('0x5'));}},'alias':{'type':Sequelize[_0xc4c5('0x6')],'allowNull':![],'set':function(_0x8724a0){this[_0xc4c5('0x7')]('alias',_0x8724a0?_0x8724a0:this[_0xc4c5('0x4')](_0xc4c5('0x8')));}},'type':{'type':Sequelize[_0xc4c5('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xc4c5('0x9')](_0xc4c5('0xa')),'get':function(){if(this['getDataValue'](_0xc4c5('0xb'))===_0xc4c5('0xc')){return JSON['parse'](this[_0xc4c5('0x4')](_0xc4c5('0xd')));}else{return this[_0xc4c5('0x4')](_0xc4c5('0xd'));}},'set':function(_0x358609){if(Array[_0xc4c5('0xe')](_0x358609)){this[_0xc4c5('0x7')](_0xc4c5('0xd'),JSON['stringify'](_0x358609));}else{this['setDataValue'](_0xc4c5('0xd'),_0x358609);}}},'required':{'type':Sequelize[_0xc4c5('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 70a8d34..40a8384 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 _0xe70a=['query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','CmCustomField','count','includeAll','include','findAll','params','body','find','catch','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','BOOLEAN','cm_contacts','format','cf_%d','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','type','key','model'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0xe70a,0x1b9));var _0xae70=function(_0x2c28a3,_0x3589d9){_0x2c28a3=_0x2c28a3-0x0;var _0x5b37f0=_0xe70a[_0x2c28a3];return _0x5b37f0;};'use strict';var pdf=require(_0xae70('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xae70('0x1'));var zipdir=require(_0xae70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae70('0x3'));var moment=require(_0xae70('0x4'));var BPromise=require(_0xae70('0x5'));var Mustache=require(_0xae70('0x6'));var util=require(_0xae70('0x7'));var path=require('path');var sox=require(_0xae70('0x8'));var csv=require(_0xae70('0x9'));var ejs=require(_0xae70('0xa'));var fs=require('fs');var _=require(_0xae70('0xb'));var squel=require(_0xae70('0xc'));var crypto=require('crypto');var jsforce=require(_0xae70('0xd'));var deskjs=require(_0xae70('0xe'));var toCsv=require('to-csv');var querystring=require(_0xae70('0xf'));var Papa=require(_0xae70('0x10'));var Redis=require('ioredis');var authService=require(_0xae70('0x11'));var qs=require(_0xae70('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae70('0x13'));var logger=require(_0xae70('0x14'))(_0xae70('0x15'));var utils=require(_0xae70('0x16'));var config=require('../../config/environment');var db=require(_0xae70('0x17'))['db'];function respondWithStatusCode(_0x5805cb,_0x4e16f1){_0x4e16f1=_0x4e16f1||0xcc;return function(_0x566ab3){if(_0x566ab3){return _0x5805cb[_0xae70('0x18')](_0x4e16f1);}return _0x5805cb[_0xae70('0x19')](_0x4e16f1)[_0xae70('0x1a')]();};}function respondWithResult(_0x3b3634,_0x532e18){_0x532e18=_0x532e18||0xc8;return function(_0x29179a){if(_0x29179a){return _0x3b3634[_0xae70('0x19')](_0x532e18)[_0xae70('0x1b')](_0x29179a);}};}function respondWithFilteredResult(_0x2b9b02,_0x271fbc){return function(_0x32b0ac){if(_0x32b0ac){var _0x313536=_0x32b0ac['count'],_0x54901c=_0x271fbc[_0xae70('0x1c')],_0x38c951=_0x271fbc[_0xae70('0x1c')]+_0x271fbc[_0xae70('0x1d')],_0x567b60;if(_0x38c951>=_0x313536){_0x38c951=_0x313536;_0x567b60=0xc8;}else{_0x567b60=0xce;}_0x2b9b02[_0xae70('0x19')](_0x567b60);return _0x2b9b02[_0xae70('0x1e')]('Content-Range',_0x54901c+'-'+_0x38c951+'/'+_0x313536)[_0xae70('0x1b')](_0x32b0ac);}return null;};}function patchUpdates(_0x5522d6){return function(_0x1b0f4f){try{jsonpatch[_0xae70('0x1f')](_0x1b0f4f,_0x5522d6,!![]);}catch(_0x1c408f){return BPromise[_0xae70('0x20')](_0x1c408f);}return _0x1b0f4f[_0xae70('0x21')]();};}function saveUpdates(_0x563299,_0x9ebe74){return function(_0x1d3943){if(_0x1d3943){return _0x1d3943[_0xae70('0x22')](_0x563299)[_0xae70('0x23')](function(_0x14524c){return _0x14524c;});}return null;};}function removeEntity(_0x38347d,_0x38200f){return function(_0x201b95){if(_0x201b95){return _0x201b95[_0xae70('0x24')]()[_0xae70('0x23')](function(){_0x38347d['status'](0xcc)[_0xae70('0x1a')]();});}};}function handleEntityNotFound(_0x4f50f2,_0xa50bb3){return function(_0x182a6b){if(!_0x182a6b){_0x4f50f2[_0xae70('0x18')](0x194);}return _0x182a6b;};}function handleError(_0x350bcb,_0x1738f8){_0x1738f8=_0x1738f8||0x1f4;return function(_0xfa117d){logger['error'](_0xfa117d[_0xae70('0x25')]);if(_0xfa117d[_0xae70('0x26')]){delete _0xfa117d[_0xae70('0x26')];}_0x350bcb[_0xae70('0x19')](_0x1738f8)['send'](_0xfa117d);};}exports[_0xae70('0x27')]=function(_0x2522eb,_0x2a66f9){var _0x3e8dc0={},_0x23ea26={},_0x42d42c={'count':0x0,'rows':[]};var _0x2be828=_[_0xae70('0x28')](db['CmCustomField'][_0xae70('0x29')],function(_0x2be4c7){return{'name':_0x2be4c7['fieldName'],'type':_0x2be4c7[_0xae70('0x2a')][_0xae70('0x2b')]};});_0x23ea26[_0xae70('0x2c')]=_['differenceBy'](_[_0xae70('0x28')](_0x2be828,_0xae70('0x26')),['name']);_0x23ea26[_0xae70('0x2d')]=_[_0xae70('0x2e')](_0x2522eb[_0xae70('0x2d')]);_0x23ea26['filters']=_[_0xae70('0x2f')](_0x23ea26['model'],_0x23ea26[_0xae70('0x2d')]);_0x3e8dc0['attributes']=_['intersection'](_0x23ea26[_0xae70('0x2c')],qs[_0xae70('0x30')](_0x2522eb[_0xae70('0x2d')][_0xae70('0x30')]));_0x3e8dc0[_0xae70('0x31')]=_0x3e8dc0[_0xae70('0x31')][_0xae70('0x32')]?_0x3e8dc0['attributes']:_0x23ea26[_0xae70('0x2c')];if(!_0x2522eb[_0xae70('0x2d')][_0xae70('0x33')](_0xae70('0x34'))){_0x3e8dc0[_0xae70('0x1d')]=qs[_0xae70('0x1d')](_0x2522eb[_0xae70('0x2d')][_0xae70('0x1d')]);_0x3e8dc0[_0xae70('0x1c')]=qs[_0xae70('0x1c')](_0x2522eb['query'][_0xae70('0x1c')]);}_0x3e8dc0[_0xae70('0x35')]=qs[_0xae70('0x36')](_0x2522eb[_0xae70('0x2d')][_0xae70('0x36')]);_0x3e8dc0[_0xae70('0x37')]=qs['filters'](_[_0xae70('0x38')](_0x2522eb['query'],_0x23ea26[_0xae70('0x39')]));if(_0x2522eb[_0xae70('0x2d')][_0xae70('0x3a')]){_0x3e8dc0['where']=_[_0xae70('0x3b')](_0x3e8dc0[_0xae70('0x37')],{'$or':_[_0xae70('0x28')](_0x2be828,function(_0x3d5757){if(_0x3d5757[_0xae70('0x2a')]!=='VIRTUAL'){var _0x113d7a={};_0x113d7a[_0x3d5757[_0xae70('0x26')]]={'$like':'%'+_0x2522eb['query'][_0xae70('0x3a')]+'%'};return _0x113d7a;}})});}_0x3e8dc0=_[_0xae70('0x3b')]({},_0x3e8dc0,_0x2522eb[_0xae70('0x3c')]);var _0x18efa9={'where':_0x3e8dc0[_0xae70('0x37')]};return db[_0xae70('0x3d')][_0xae70('0x3e')](_0x18efa9)['then'](function(_0x2d1109){_0x42d42c[_0xae70('0x3e')]=_0x2d1109;if(_0x2522eb[_0xae70('0x2d')][_0xae70('0x3f')]){_0x3e8dc0[_0xae70('0x40')]=[{'all':!![]}];}return db[_0xae70('0x3d')][_0xae70('0x41')](_0x3e8dc0);})[_0xae70('0x23')](function(_0x3185d4){_0x42d42c['rows']=_0x3185d4;return _0x42d42c;})[_0xae70('0x23')](respondWithFilteredResult(_0x2a66f9,_0x3e8dc0))['catch'](handleError(_0x2a66f9,null));};exports['show']=function(_0x207d0c,_0x21a53b){var _0x488e4d={'raw':!![],'where':{'id':_0x207d0c[_0xae70('0x42')]['id']}},_0x37972b={};_0x37972b[_0xae70('0x2c')]=_['keys'](db[_0xae70('0x3d')][_0xae70('0x29')]);_0x37972b['query']=_[_0xae70('0x2e')](_0x207d0c[_0xae70('0x2d')]);_0x37972b['filters']=_['intersection'](_0x37972b[_0xae70('0x2c')],_0x37972b[_0xae70('0x2d')]);_0x488e4d[_0xae70('0x31')]=_['intersection'](_0x37972b[_0xae70('0x2c')],qs[_0xae70('0x30')](_0x207d0c[_0xae70('0x2d')][_0xae70('0x30')]));_0x488e4d['attributes']=_0x488e4d[_0xae70('0x31')][_0xae70('0x32')]?_0x488e4d[_0xae70('0x31')]:_0x37972b['model'];if(_0x207d0c[_0xae70('0x2d')][_0xae70('0x3f')]){_0x488e4d[_0xae70('0x40')]=[{'all':!![]}];}_0x488e4d=_['merge']({},_0x488e4d,_0x207d0c[_0xae70('0x3c')]);return db[_0xae70('0x3d')]['find'](_0x488e4d)[_0xae70('0x23')](handleEntityNotFound(_0x21a53b,null))[_0xae70('0x23')](respondWithResult(_0x21a53b,null))['catch'](handleError(_0x21a53b,null));};exports[_0xae70('0x22')]=function(_0x5ef2dd,_0x44c97c){if(_0x5ef2dd[_0xae70('0x43')]['id']){delete _0x5ef2dd['body']['id'];}return db[_0xae70('0x3d')][_0xae70('0x44')]({'where':{'id':_0x5ef2dd[_0xae70('0x42')]['id']}})[_0xae70('0x23')](handleEntityNotFound(_0x44c97c,null))[_0xae70('0x23')](saveUpdates(_0x5ef2dd[_0xae70('0x43')],null))[_0xae70('0x23')](respondWithResult(_0x44c97c,null))[_0xae70('0x45')](handleError(_0x44c97c,null));};exports[_0xae70('0x24')]=function(_0x12c568,_0x169152){return db[_0xae70('0x3d')][_0xae70('0x44')]({'where':{'id':_0x12c568['params']['id']}})[_0xae70('0x23')](handleEntityNotFound(_0x169152,null))[_0xae70('0x23')](removeEntity(_0x169152,null))['catch'](handleError(_0x169152,null));};exports[_0xae70('0x46')]=function(_0x361e77,_0x1e89a7){var _0x28a85b;return db[_0xae70('0x47')][_0xae70('0x48')](function(_0x5c293a){return db['CmCustomField'][_0xae70('0x46')](_0x361e77[_0xae70('0x43')],{'transaction':_0x5c293a})['then'](function(_0x2f446b){_0x28a85b=_0x2f446b;var _0xe06cae={'type':db[_0xae70('0x49')][_0xae70('0x4a')],'transaction':_0x5c293a};switch(_0x361e77['body'][_0xae70('0x2a')]){case'text':_0xe06cae[_0xae70('0x2a')]=db['Sequelize']['TEXT'];break;case _0xae70('0x4b'):_0xe06cae[_0xae70('0x2a')]=db[_0xae70('0x49')][_0xae70('0x4c')];break;case'switch':_0xe06cae[_0xae70('0x2a')]=db[_0xae70('0x49')][_0xae70('0x4d')];_0xe06cae['defaultValue']=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0xae70('0x4e'),util[_0xae70('0x4f')](_0xae70('0x50'),_0x28a85b['id']),_0xe06cae);})[_0xae70('0x23')](function(){return _0x28a85b;});})['then'](respondWithResult(_0x1e89a7,0xc9))[_0xae70('0x45')](handleError(_0x1e89a7,null));}; \ No newline at end of file +var _0x4e24=['map','CmCustomField','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','limit','order','where','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','include','find','catch','body','sequelize','transaction','TEXT','Sequelize','number','INTEGER','defaultValue','addColumn','format','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','then','destroy','name'];(function(_0x388385,_0x3d1a0d){var _0x25e37e=function(_0x27a959){while(--_0x27a959){_0x388385['push'](_0x388385['shift']());}};_0x25e37e(++_0x3d1a0d);}(_0x4e24,0x157));var _0x44e2=function(_0x18f0f2,_0x46196a){_0x18f0f2=_0x18f0f2-0x0;var _0x3861f6=_0x4e24[_0x18f0f2];return _0x3861f6;};'use strict';var pdf=require(_0x44e2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x44e2('0x1'));var zipdir=require(_0x44e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x44e2('0x3'));var BPromise=require(_0x44e2('0x4'));var Mustache=require(_0x44e2('0x5'));var util=require(_0x44e2('0x6'));var path=require(_0x44e2('0x7'));var sox=require(_0x44e2('0x8'));var csv=require(_0x44e2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x44e2('0xa'));var squel=require(_0x44e2('0xb'));var crypto=require(_0x44e2('0xc'));var jsforce=require(_0x44e2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44e2('0xe'));var Papa=require(_0x44e2('0xf'));var Redis=require(_0x44e2('0x10'));var authService=require(_0x44e2('0x11'));var qs=require(_0x44e2('0x12'));var as=require(_0x44e2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44e2('0x14'))(_0x44e2('0x15'));var utils=require(_0x44e2('0x16'));var config=require('../../config/environment');var db=require(_0x44e2('0x17'))['db'];function respondWithStatusCode(_0x1ba8ff,_0x346713){_0x346713=_0x346713||0xcc;return function(_0x54daec){if(_0x54daec){return _0x1ba8ff[_0x44e2('0x18')](_0x346713);}return _0x1ba8ff[_0x44e2('0x19')](_0x346713)[_0x44e2('0x1a')]();};}function respondWithResult(_0x44b3f0,_0xdb49d7){_0xdb49d7=_0xdb49d7||0xc8;return function(_0x25334c){if(_0x25334c){return _0x44b3f0['status'](_0xdb49d7)[_0x44e2('0x1b')](_0x25334c);}};}function respondWithFilteredResult(_0x5462a2,_0x5f42f0){return function(_0x308e10){if(_0x308e10){var _0x4b194c=_0x308e10['count'],_0x4c669a=_0x5f42f0[_0x44e2('0x1c')],_0x141ab0=_0x5f42f0[_0x44e2('0x1c')]+_0x5f42f0['limit'],_0x3f40be;if(_0x141ab0>=_0x4b194c){_0x141ab0=_0x4b194c;_0x3f40be=0xc8;}else{_0x3f40be=0xce;}_0x5462a2[_0x44e2('0x19')](_0x3f40be);return _0x5462a2[_0x44e2('0x1d')](_0x44e2('0x1e'),_0x4c669a+'-'+_0x141ab0+'/'+_0x4b194c)['json'](_0x308e10);}return null;};}function patchUpdates(_0x127463){return function(_0xa44dbb){try{jsonpatch['apply'](_0xa44dbb,_0x127463,!![]);}catch(_0xfd218e){return BPromise[_0x44e2('0x1f')](_0xfd218e);}return _0xa44dbb[_0x44e2('0x20')]();};}function saveUpdates(_0x286cf7,_0xbfdf57){return function(_0x1938f8){if(_0x1938f8){return _0x1938f8[_0x44e2('0x21')](_0x286cf7)[_0x44e2('0x22')](function(_0x5af2d1){return _0x5af2d1;});}return null;};}function removeEntity(_0x149746,_0x50fc25){return function(_0x35714b){if(_0x35714b){return _0x35714b[_0x44e2('0x23')]()[_0x44e2('0x22')](function(){_0x149746[_0x44e2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfcf428,_0x4749da){return function(_0x1af230){if(!_0x1af230){_0xfcf428['sendStatus'](0x194);}return _0x1af230;};}function handleError(_0x5a084e,_0x22cce4){_0x22cce4=_0x22cce4||0x1f4;return function(_0x371714){logger['error'](_0x371714['stack']);if(_0x371714[_0x44e2('0x24')]){delete _0x371714[_0x44e2('0x24')];}_0x5a084e['status'](_0x22cce4)['send'](_0x371714);};}exports['index']=function(_0x30be93,_0x1144f2){var _0x18c62f={},_0x339638={},_0x4c59ac={'count':0x0,'rows':[]};var _0x50908a=_[_0x44e2('0x25')](db[_0x44e2('0x26')][_0x44e2('0x27')],function(_0xa0d55f){return{'name':_0xa0d55f['fieldName'],'type':_0xa0d55f[_0x44e2('0x28')][_0x44e2('0x29')]};});_0x339638['model']=_['differenceBy'](_[_0x44e2('0x25')](_0x50908a,_0x44e2('0x24')),[_0x44e2('0x24')]);_0x339638[_0x44e2('0x2a')]=_[_0x44e2('0x2b')](_0x30be93[_0x44e2('0x2a')]);_0x339638[_0x44e2('0x2c')]=_[_0x44e2('0x2d')](_0x339638['model'],_0x339638[_0x44e2('0x2a')]);_0x18c62f[_0x44e2('0x2e')]=_['intersection'](_0x339638[_0x44e2('0x2f')],qs['fields'](_0x30be93['query'][_0x44e2('0x30')]));_0x18c62f[_0x44e2('0x2e')]=_0x18c62f[_0x44e2('0x2e')][_0x44e2('0x31')]?_0x18c62f[_0x44e2('0x2e')]:_0x339638[_0x44e2('0x2f')];if(!_0x30be93[_0x44e2('0x2a')]['hasOwnProperty'](_0x44e2('0x32'))){_0x18c62f[_0x44e2('0x33')]=qs[_0x44e2('0x33')](_0x30be93[_0x44e2('0x2a')][_0x44e2('0x33')]);_0x18c62f[_0x44e2('0x1c')]=qs[_0x44e2('0x1c')](_0x30be93[_0x44e2('0x2a')][_0x44e2('0x1c')]);}_0x18c62f[_0x44e2('0x34')]=qs['sort'](_0x30be93[_0x44e2('0x2a')]['sort']);_0x18c62f[_0x44e2('0x35')]=qs[_0x44e2('0x2c')](_['pick'](_0x30be93[_0x44e2('0x2a')],_0x339638[_0x44e2('0x2c')]));if(_0x30be93[_0x44e2('0x2a')][_0x44e2('0x36')]){_0x18c62f[_0x44e2('0x35')]=_[_0x44e2('0x37')](_0x18c62f[_0x44e2('0x35')],{'$or':_['map'](_0x50908a,function(_0x2e1574){if(_0x2e1574['type']!==_0x44e2('0x38')){var _0x47cbaa={};_0x47cbaa[_0x2e1574['name']]={'$like':'%'+_0x30be93[_0x44e2('0x2a')]['filter']+'%'};return _0x47cbaa;}})});}_0x18c62f=_[_0x44e2('0x37')]({},_0x18c62f,_0x30be93[_0x44e2('0x39')]);var _0x110a42={'where':_0x18c62f[_0x44e2('0x35')]};return db[_0x44e2('0x26')]['count'](_0x110a42)[_0x44e2('0x22')](function(_0x4e8355){_0x4c59ac[_0x44e2('0x3a')]=_0x4e8355;if(_0x30be93[_0x44e2('0x2a')][_0x44e2('0x3b')]){_0x18c62f['include']=[{'all':!![]}];}return db[_0x44e2('0x26')]['findAll'](_0x18c62f);})[_0x44e2('0x22')](function(_0x4669b6){_0x4c59ac[_0x44e2('0x3c')]=_0x4669b6;return _0x4c59ac;})[_0x44e2('0x22')](respondWithFilteredResult(_0x1144f2,_0x18c62f))['catch'](handleError(_0x1144f2,null));};exports[_0x44e2('0x3d')]=function(_0x45ba7c,_0x5dff95){var _0x3537f5={'raw':!![],'where':{'id':_0x45ba7c[_0x44e2('0x3e')]['id']}},_0x5cd3e8={};_0x5cd3e8[_0x44e2('0x2f')]=_[_0x44e2('0x2b')](db[_0x44e2('0x26')][_0x44e2('0x27')]);_0x5cd3e8[_0x44e2('0x2a')]=_[_0x44e2('0x2b')](_0x45ba7c[_0x44e2('0x2a')]);_0x5cd3e8['filters']=_[_0x44e2('0x2d')](_0x5cd3e8['model'],_0x5cd3e8['query']);_0x3537f5[_0x44e2('0x2e')]=_[_0x44e2('0x2d')](_0x5cd3e8[_0x44e2('0x2f')],qs[_0x44e2('0x30')](_0x45ba7c['query'][_0x44e2('0x30')]));_0x3537f5['attributes']=_0x3537f5[_0x44e2('0x2e')]['length']?_0x3537f5[_0x44e2('0x2e')]:_0x5cd3e8[_0x44e2('0x2f')];if(_0x45ba7c[_0x44e2('0x2a')][_0x44e2('0x3b')]){_0x3537f5[_0x44e2('0x3f')]=[{'all':!![]}];}_0x3537f5=_[_0x44e2('0x37')]({},_0x3537f5,_0x45ba7c[_0x44e2('0x39')]);return db[_0x44e2('0x26')][_0x44e2('0x40')](_0x3537f5)[_0x44e2('0x22')](handleEntityNotFound(_0x5dff95,null))[_0x44e2('0x22')](respondWithResult(_0x5dff95,null))[_0x44e2('0x41')](handleError(_0x5dff95,null));};exports[_0x44e2('0x21')]=function(_0x242d1b,_0x47e5ba){if(_0x242d1b[_0x44e2('0x42')]['id']){delete _0x242d1b['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x242d1b[_0x44e2('0x3e')]['id']}})[_0x44e2('0x22')](handleEntityNotFound(_0x47e5ba,null))[_0x44e2('0x22')](saveUpdates(_0x242d1b[_0x44e2('0x42')],null))[_0x44e2('0x22')](respondWithResult(_0x47e5ba,null))[_0x44e2('0x41')](handleError(_0x47e5ba,null));};exports[_0x44e2('0x23')]=function(_0x8c2581,_0xfb47d5){return db[_0x44e2('0x26')]['find']({'where':{'id':_0x8c2581[_0x44e2('0x3e')]['id']}})[_0x44e2('0x22')](handleEntityNotFound(_0xfb47d5,null))['then'](removeEntity(_0xfb47d5,null))['catch'](handleError(_0xfb47d5,null));};exports['create']=function(_0x3d6fa6,_0x26dbb4){var _0x52667f;return db[_0x44e2('0x43')][_0x44e2('0x44')](function(_0x565a9e){return db[_0x44e2('0x26')]['create'](_0x3d6fa6['body'],{'transaction':_0x565a9e})[_0x44e2('0x22')](function(_0x160b13){_0x52667f=_0x160b13;var _0x39eeb3={'type':db['Sequelize'][_0x44e2('0x45')],'transaction':_0x565a9e};switch(_0x3d6fa6[_0x44e2('0x42')]['type']){case'text':_0x39eeb3[_0x44e2('0x28')]=db[_0x44e2('0x46')][_0x44e2('0x45')];break;case _0x44e2('0x47'):_0x39eeb3[_0x44e2('0x28')]=db[_0x44e2('0x46')][_0x44e2('0x48')];break;case'switch':_0x39eeb3['type']=db[_0x44e2('0x46')]['BOOLEAN'];_0x39eeb3[_0x44e2('0x49')]=![];break;default:}return db[_0x44e2('0x43')]['queryInterface'][_0x44e2('0x4a')]('cm_contacts',util[_0x44e2('0x4b')]('cf_%d',_0x52667f['id']),_0x39eeb3);})[_0x44e2('0x22')](function(){return _0x52667f;});})[_0x44e2('0x22')](respondWithResult(_0x26dbb4,0xc9))[_0x44e2('0x41')](handleError(_0x26dbb4,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index dcd747a..d8755e8 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 _0x28a6=['cm_custom_fields','util','moment','request-promise','rimraf','define','CmCustomField'];(function(_0x1bacaf,_0x2f9951){var _0xeb8dbf=function(_0x5b1c4e){while(--_0x5b1c4e){_0x1bacaf['push'](_0x1bacaf['shift']());}};_0xeb8dbf(++_0x2f9951);}(_0x28a6,0x166));var _0x628a=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0x28a6[_0x416cdc];return _0x1931ce;};'use strict';var _=require('lodash');var util=require(_0x628a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x628a('0x1'));var BPromise=require('bluebird');var rp=require(_0x628a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x628a('0x3'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x49cfbe,_0x304a93){return _0x49cfbe[_0x628a('0x4')](_0x628a('0x5'),attributes,{'tableName':_0x628a('0x6'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7525=['api','moment','bluebird','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x3359b2,_0x28207a){var _0x112271=function(_0x37bd42){while(--_0x37bd42){_0x3359b2['push'](_0x3359b2['shift']());}};_0x112271(++_0x28207a);}(_0x7525,0x1a2));var _0x5752=function(_0x36cef1,_0x140a7c){_0x36cef1=_0x36cef1-0x0;var _0x1d333d=_0x7525[_0x36cef1];return _0x1d333d;};'use strict';var _=require(_0x5752('0x0'));var util=require(_0x5752('0x1'));var logger=require('../../config/logger')(_0x5752('0x2'));var moment=require(_0x5752('0x3'));var BPromise=require(_0x5752('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5752('0x5'));var rimraf=require(_0x5752('0x6'));var config=require('../../config/environment');var attributes=require(_0x5752('0x7'));module[_0x5752('0x8')]=function(_0x1ce1fc,_0x1831c4){return _0x1ce1fc[_0x5752('0x9')](_0x5752('0xa'),attributes,{'tableName':_0x5752('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 1289397..9142580 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 _0x8ce3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x118e37,_0x48569f){var _0x3660bc=function(_0x9fc10){while(--_0x9fc10){_0x118e37['push'](_0x118e37['shift']());}};_0x3660bc(++_0x48569f);}(_0x8ce3,0xc3));var _0x38ce=function(_0xbc3542,_0x4de021){_0xbc3542=_0xbc3542-0x0;var _0x1c88ff=_0x8ce3[_0xbc3542];return _0x1c88ff;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var moment=require('moment');var BPromise=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var fs=require('fs');var Redis=require(_0x38ce('0x4'));var db=require(_0x38ce('0x5'))['db'];var utils=require(_0x38ce('0x6'));var logger=require(_0x38ce('0x7'))(_0x38ce('0x8'));var config=require(_0x38ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0xa')][_0x38ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58074c,_0x262b13,_0xbe7332){return new BPromise(function(_0x3f8011,_0x482955){return client[_0x38ce('0xc')](_0x58074c,_0xbe7332)['then'](function(_0x725d27){logger['info'](_0x38ce('0xd'),_0x262b13,_0x38ce('0xe'));logger[_0x38ce('0xf')](_0x38ce('0x10'),_0x262b13,_0x38ce('0xe'),JSON[_0x38ce('0x11')](_0x725d27));if(_0x725d27[_0x38ce('0x12')]){if(_0x725d27[_0x38ce('0x12')][_0x38ce('0x13')]===0x1f4){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);return _0x482955(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}logger[_0x38ce('0x12')]('CmCustomField,\x20%s,\x20%s',_0x262b13,_0x725d27['error'][_0x38ce('0x14')]);return _0x3f8011(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}else{logger['info'](_0x38ce('0xd'),_0x262b13,'request\x20sent');_0x3f8011(_0x725d27[_0x38ce('0x15')][_0x38ce('0x14')]);}})['catch'](function(_0x5fc115){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x5fc115);_0x482955(_0x5fc115);});});} \ No newline at end of file +var _0x8d0e=['info','CmCustomField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x24f716,_0x12af55){var _0x66489f=function(_0x15b3b0){while(--_0x15b3b0){_0x24f716['push'](_0x24f716['shift']());}};_0x66489f(++_0x12af55);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4b10b7,_0x1433e9){_0x4b10b7=_0x4b10b7-0x0;var _0x52d785=_0x8d0e[_0x4b10b7];return _0x52d785;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('CmCustomField,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('CmCustomField,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 61cc866..7358224 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 _0x0d3c=['get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x3cfc44,_0x2039de){var _0x2dfbe7=function(_0x466ed6){while(--_0x466ed6){_0x3cfc44['push'](_0x3cfc44['shift']());}};_0x2dfbe7(++_0x2039de);}(_0x0d3c,0x1d6));var _0xc0d3=function(_0x503d00,_0x323df1){_0x503d00=_0x503d00-0x0;var _0x2263d8=_0x0d3c[_0x503d00];return _0x2263d8;};'use strict';var multer=require(_0xc0d3('0x0'));var util=require(_0xc0d3('0x1'));var path=require(_0xc0d3('0x2'));var timeout=require(_0xc0d3('0x3'));var express=require('express');var router=express[_0xc0d3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc0d3('0x5'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xc0d3('0x6')]('/',auth['isAuthenticated'](),controller[_0xc0d3('0x7')]);router[_0xc0d3('0x6')](_0xc0d3('0x8'),auth[_0xc0d3('0x9')](),controller[_0xc0d3('0xa')]);router[_0xc0d3('0xb')]('/',auth[_0xc0d3('0x9')](),controller[_0xc0d3('0xc')]);router['put']('/:id',auth[_0xc0d3('0x9')](),controller[_0xc0d3('0xd')]);router[_0xc0d3('0xe')](_0xc0d3('0x8'),auth[_0xc0d3('0x9')](),controller[_0xc0d3('0xf')]);module[_0xc0d3('0x10')]=router; \ No newline at end of file +var _0xa769=['get','isAuthenticated','index','/:id','post','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller'];(function(_0x314ee0,_0x2c854d){var _0x2c618a=function(_0x7c5729){while(--_0x7c5729){_0x314ee0['push'](_0x314ee0['shift']());}};_0x2c618a(++_0x2c854d);}(_0xa769,0x17f));var _0x9a76=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xa769[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x9a76('0x0'));var util=require(_0x9a76('0x1'));var path=require('path');var timeout=require(_0x9a76('0x2'));var express=require(_0x9a76('0x3'));var router=express[_0x9a76('0x4')]();var auth=require(_0x9a76('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9a76('0x6'));var controller=require(_0x9a76('0x7'));router[_0x9a76('0x8')]('/',auth[_0x9a76('0x9')](),controller[_0x9a76('0xa')]);router[_0x9a76('0x8')](_0x9a76('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9a76('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9a76('0xd')](_0x9a76('0xb'),auth['isAuthenticated'](),controller[_0x9a76('0xe')]);router[_0x9a76('0xf')](_0x9a76('0xb'),auth[_0x9a76('0x9')](),controller[_0x9a76('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index fa6e36e..28d9781 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 _0xe14b=['STRING','UNSIGNED','contactListQueue','moment','sequelize','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x3bd69f,_0x340b58){var _0x1f0d4c=function(_0x4682c2){while(--_0x4682c2){_0x3bd69f['push'](_0x3bd69f['shift']());}};_0x1f0d4c(++_0x340b58);}(_0xe14b,0x93));var _0xbe14=function(_0x46968b,_0x250fbd){_0x46968b=_0x46968b-0x0;var _0x366da1=_0xe14b[_0x46968b];return _0x366da1;};'use strict';var moment=require(_0xbe14('0x0'));var Sequelize=require(_0xbe14('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xbe14('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':moment()['format'](_0xbe14('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbe14('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xbe14('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbe14('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbe14('0x3')]},'priority':{'type':Sequelize[_0xbe14('0x5')](0x2)[_0xbe14('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xbe14('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xbe14('0x8')},'UserId':{'type':Sequelize[_0xbe14('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xbe14('0x5')],'unique':_0xbe14('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbe14('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbe14('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbe14('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc3b5=['INTEGER','UNSIGNED','contactListQueue','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x39fdf8,_0x3c43e2){var _0x101beb=function(_0x5630d8){while(--_0x5630d8){_0x39fdf8['push'](_0x39fdf8['shift']());}};_0x101beb(++_0x3c43e2);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x4e41c8,_0x58bc98){_0x4e41c8=_0x4e41c8-0x0;var _0xf60084=_0xc3b5[_0x4e41c8];return _0xf60084;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5c3b('0x0')]={'phone':{'type':Sequelize[_0x5c3b('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x5c3b('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5c3b('0x3')],'defaultValue':moment()[_0x5c3b('0x4')](_0x5c3b('0x5'))},'countbusyretry':{'type':Sequelize[_0x5c3b('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5c3b('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5c3b('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5c3b('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x5c3b('0x6')](0x2)[_0x5c3b('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5c3b('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5c3b('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5c3b('0x6')],'unique':_0x5c3b('0x8')},'UserId':{'type':Sequelize[_0x5c3b('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x5c3b('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x5c3b('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x5c3b('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5c3b('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5c3b('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5c3b('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index b044867..43a8875 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 _0x6793=['key','model','map','query','intersection','filters','$and','$or','$gt','$gte','$lt','$ne','$in','$notIn','$iLike','$like','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','CampaignId','VoiceQueueId','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','getPreview','CmContact','outbound','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','isNumber','entity\x20not\x20found','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','index','CmHopper','rawAttributes','type'];(function(_0x1a0901,_0x47051b){var _0x336310=function(_0x29da85){while(--_0x29da85){_0x1a0901['push'](_0x1a0901['shift']());}};_0x336310(++_0x47051b);}(_0x6793,0x185));var _0x3679=function(_0x3d4689,_0x14f517){_0x3d4689=_0x3d4689-0x0;var _0x2540e8=_0x6793[_0x3d4689];return _0x2540e8;};'use strict';var pdf=require(_0x3679('0x0'));var emlformat=require(_0x3679('0x1'));var rimraf=require(_0x3679('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3679('0x3'));var moment=require(_0x3679('0x4'));var BPromise=require(_0x3679('0x5'));var Mustache=require('mustache');var util=require(_0x3679('0x6'));var path=require(_0x3679('0x7'));var sox=require('sox');var csv=require(_0x3679('0x8'));var ejs=require(_0x3679('0x9'));var fs=require('fs');var _=require(_0x3679('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3679('0xb'));var deskjs=require(_0x3679('0xc'));var toCsv=require(_0x3679('0x8'));var querystring=require(_0x3679('0xd'));var Papa=require(_0x3679('0xe'));var Redis=require(_0x3679('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3679('0x10'));var as=require(_0x3679('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3679('0x12'))(_0x3679('0x13'));var utils=require(_0x3679('0x14'));var config=require(_0x3679('0x15'));var db=require(_0x3679('0x16'))['db'];function respondWithStatusCode(_0x240e17,_0x1d36d6){_0x1d36d6=_0x1d36d6||0xcc;return function(_0x20390d){if(_0x20390d){return _0x240e17[_0x3679('0x17')](_0x1d36d6);}return _0x240e17[_0x3679('0x18')](_0x1d36d6)[_0x3679('0x19')]();};}function respondWithResult(_0xcde13e,_0x1fcbcc){_0x1fcbcc=_0x1fcbcc||0xc8;return function(_0x21ef1a){if(_0x21ef1a){return _0xcde13e[_0x3679('0x18')](_0x1fcbcc)[_0x3679('0x1a')](_0x21ef1a);}};}function respondWithFilteredResult(_0x580b16,_0x409654){return function(_0x39ee81){if(_0x39ee81){var _0x17e2ee=_0x39ee81[_0x3679('0x1b')],_0x17ab5f=_0x409654[_0x3679('0x1c')],_0x49c3e0=_0x409654[_0x3679('0x1c')]+_0x409654[_0x3679('0x1d')],_0x5d2228;if(_0x49c3e0>=_0x17e2ee){_0x49c3e0=_0x17e2ee;_0x5d2228=0xc8;}else{_0x5d2228=0xce;}_0x580b16[_0x3679('0x18')](_0x5d2228);return _0x580b16[_0x3679('0x1e')](_0x3679('0x1f'),_0x17ab5f+'-'+_0x49c3e0+'/'+_0x17e2ee)[_0x3679('0x1a')](_0x39ee81);}return null;};}function patchUpdates(_0x58e65e){return function(_0x544144){try{jsonpatch[_0x3679('0x20')](_0x544144,_0x58e65e,!![]);}catch(_0xb2e515){return BPromise['reject'](_0xb2e515);}return _0x544144[_0x3679('0x21')]();};}function saveUpdates(_0x36241d,_0x3b812d){return function(_0x4d87b4){if(_0x4d87b4){return _0x4d87b4['update'](_0x36241d)[_0x3679('0x22')](function(_0x5ef7c1){return _0x5ef7c1;});}return null;};}function removeEntity(_0x24bddb,_0x339e17){return function(_0x4300ad){if(_0x4300ad){return _0x4300ad[_0x3679('0x23')]()[_0x3679('0x22')](function(){_0x24bddb[_0x3679('0x18')](0xcc)[_0x3679('0x19')]();});}};}function handleEntityNotFound(_0x36bc93,_0x1a9bec){return function(_0x1f6c46){if(!_0x1f6c46){_0x36bc93[_0x3679('0x17')](0x194);}return _0x1f6c46;};}function handleError(_0x13c1c3,_0x33bc30){_0x33bc30=_0x33bc30||0x1f4;return function(_0x11e02c){logger[_0x3679('0x24')](_0x11e02c[_0x3679('0x25')]);if(_0x11e02c[_0x3679('0x26')]){delete _0x11e02c['name'];}_0x13c1c3['status'](_0x33bc30)['send'](_0x11e02c);};}exports[_0x3679('0x27')]=function(_0x3f3f32,_0x149acf){var _0x2400f3={},_0x158b50={},_0xa46aad={'count':0x0,'rows':[]};var _0x2aab1f=_['map'](db[_0x3679('0x28')][_0x3679('0x29')],function(_0x3dd446){return{'name':_0x3dd446['fieldName'],'type':_0x3dd446[_0x3679('0x2a')][_0x3679('0x2b')]};});_0x158b50[_0x3679('0x2c')]=_[_0x3679('0x2d')](_0x2aab1f,_0x3679('0x26'));_0x158b50[_0x3679('0x2e')]=_['keys'](_0x3f3f32[_0x3679('0x2e')]);_0x158b50['filters']=_[_0x3679('0x2f')](_0x158b50['model'],_0x158b50[_0x3679('0x2e')]);_0x158b50[_0x3679('0x30')]=_['concat'](_0x158b50[_0x3679('0x30')],[_0x3679('0x31'),_0x3679('0x32'),_0x3679('0x33'),_0x3679('0x34'),_0x3679('0x35'),'$lte',_0x3679('0x36'),'$eq','$not','$between','$notBetween',_0x3679('0x37'),_0x3679('0x38'),'$like','$notLike',_0x3679('0x39'),'$notILike',_0x3679('0x3a'),_0x3679('0x3b'),_0x3679('0x3c'),_0x3679('0x3d'),_0x3679('0x3e')]);_0x2400f3[_0x3679('0x3f')]=_[_0x3679('0x2f')](_0x158b50[_0x3679('0x2c')],qs[_0x3679('0x40')](_0x3f3f32[_0x3679('0x2e')][_0x3679('0x40')]));_0x2400f3[_0x3679('0x3f')]=_0x2400f3[_0x3679('0x3f')][_0x3679('0x41')]?_0x2400f3[_0x3679('0x3f')]:_0x158b50[_0x3679('0x2c')];if(!_0x3f3f32[_0x3679('0x2e')][_0x3679('0x42')](_0x3679('0x43'))){_0x2400f3[_0x3679('0x1d')]=qs['limit'](_0x3f3f32[_0x3679('0x2e')][_0x3679('0x1d')]);_0x2400f3[_0x3679('0x1c')]=qs[_0x3679('0x1c')](_0x3f3f32[_0x3679('0x2e')][_0x3679('0x1c')]);}_0x2400f3[_0x3679('0x44')]=qs['sort'](_0x3f3f32[_0x3679('0x2e')][_0x3679('0x45')]);_0x2400f3[_0x3679('0x46')]=qs['filters'](_[_0x3679('0x47')](_0x3f3f32['query'],_0x158b50[_0x3679('0x30')]));if(_0x3f3f32[_0x3679('0x2e')][_0x3679('0x48')]){_0x2400f3[_0x3679('0x46')]=_[_0x3679('0x49')](_0x2400f3[_0x3679('0x46')],{'$or':_[_0x3679('0x2d')](_0x2aab1f,function(_0xedbcf0){if(_0xedbcf0[_0x3679('0x2a')]!=='VIRTUAL'){var _0x4ca24d={};_0x4ca24d[_0xedbcf0[_0x3679('0x26')]]={'$like':'%'+_0x3f3f32[_0x3679('0x2e')][_0x3679('0x48')]+'%'};return _0x4ca24d;}})});}_0x2400f3=_[_0x3679('0x49')]({},_0x2400f3,_0x3f3f32[_0x3679('0x4a')]);var _0x1c7b23={'where':_0x2400f3[_0x3679('0x46')]};return db[_0x3679('0x28')]['count'](_0x1c7b23)['then'](function(_0x207eba){_0xa46aad[_0x3679('0x1b')]=_0x207eba;if(_0x3f3f32[_0x3679('0x2e')][_0x3679('0x4b')]){_0x2400f3[_0x3679('0x4c')]=[{'all':!![]}];}return db[_0x3679('0x28')][_0x3679('0x4d')](_0x2400f3);})[_0x3679('0x22')](function(_0x2f8e86){_0xa46aad[_0x3679('0x4e')]=_0x2f8e86;return _0xa46aad;})[_0x3679('0x22')](respondWithFilteredResult(_0x149acf,_0x2400f3))[_0x3679('0x4f')](handleError(_0x149acf,null));};exports[_0x3679('0x50')]=function(_0x4f217a,_0x4fe615){var _0x257461={'raw':!![],'where':{'id':_0x4f217a[_0x3679('0x51')]['id']}},_0x58e98a={};_0x58e98a[_0x3679('0x2c')]=_[_0x3679('0x52')](db[_0x3679('0x28')]['rawAttributes']);_0x58e98a['query']=_[_0x3679('0x52')](_0x4f217a['query']);_0x58e98a[_0x3679('0x30')]=_[_0x3679('0x2f')](_0x58e98a[_0x3679('0x2c')],_0x58e98a[_0x3679('0x2e')]);_0x257461[_0x3679('0x3f')]=_['intersection'](_0x58e98a['model'],qs[_0x3679('0x40')](_0x4f217a[_0x3679('0x2e')][_0x3679('0x40')]));_0x257461[_0x3679('0x3f')]=_0x257461[_0x3679('0x3f')][_0x3679('0x41')]?_0x257461['attributes']:_0x58e98a[_0x3679('0x2c')];if(_0x4f217a[_0x3679('0x2e')]['includeAll']){_0x257461[_0x3679('0x4c')]=[{'all':!![]}];}_0x257461=_[_0x3679('0x49')]({},_0x257461,_0x4f217a[_0x3679('0x4a')]);return db[_0x3679('0x28')][_0x3679('0x53')](_0x257461)[_0x3679('0x22')](handleEntityNotFound(_0x4fe615,null))[_0x3679('0x22')](respondWithResult(_0x4fe615,null))[_0x3679('0x4f')](handleError(_0x4fe615,null));};exports['create']=function(_0x45fbbe,_0x1d1b09){return db['CmHopper'][_0x3679('0x54')](_0x45fbbe[_0x3679('0x55')],{})[_0x3679('0x22')](respondWithResult(_0x1d1b09,0xc9))[_0x3679('0x4f')](handleError(_0x1d1b09,null));};exports[_0x3679('0x56')]=function(_0x379a9e,_0x339635){if(_0x379a9e[_0x3679('0x55')]['id']){delete _0x379a9e[_0x3679('0x55')]['id'];}return db[_0x3679('0x28')]['find']({'where':{'id':_0x379a9e[_0x3679('0x51')]['id']}})['then'](handleEntityNotFound(_0x339635,null))[_0x3679('0x22')](saveUpdates(_0x379a9e[_0x3679('0x55')],null))[_0x3679('0x22')](respondWithResult(_0x339635,null))[_0x3679('0x4f')](handleError(_0x339635,null));};exports[_0x3679('0x57')]=function(_0x432b5a,_0x283892){return db[_0x3679('0x28')][_0x3679('0x57')]()[_0x3679('0x22')](respondWithResult(_0x283892,null))[_0x3679('0x4f')](handleError(_0x283892,null));};exports[_0x3679('0x23')]=function(_0x251f9d,_0x3cd01a){var _0x1561c0;return db[_0x3679('0x28')][_0x3679('0x53')]({'where':{'id':_0x251f9d['params']['id']}})['then'](handleEntityNotFound(_0x3cd01a,null))[_0x3679('0x22')](function(_0x2ec90c){if(_0x2ec90c){return _0x2ec90c[_0x3679('0x23')]()['then'](function(_0x58a95d){return _0x58a95d;});}})[_0x3679('0x22')](function(_0x368ae5){_0x1561c0=_0x368ae5;if(_0x368ae5){if(_0x368ae5['VoiceQueueId']||_0x368ae5[_0x3679('0x58')]){return db[_0x368ae5['VoiceQueueId']?'VoiceQueue':'Campaign']['find']({'where':{'id':_0x368ae5[_0x3679('0x59')]?_0x368ae5[_0x3679('0x59')]:_0x368ae5[_0x3679('0x58')]},'attributes':['id',_0x3679('0x26')],'raw':!![]});}}})[_0x3679('0x22')](function(_0x146167){var _0x1b1e9e={};if(_0x146167){_[_0x3679('0x49')](_0x1b1e9e,_['omit'](_0x1561c0[_0x3679('0x5a')],[_0x3679('0x5b'),_0x3679('0x5c'),'id']));_0x1b1e9e[_0x3679('0x5d')]=0x15;_0x1b1e9e[_0x3679('0x5e')]=_0x3679('0x5f');_0x1b1e9e[_0x3679('0x60')]=_0x146167[_0x3679('0x26')];_0x1b1e9e[_0x3679('0x61')]=_0x251f9d['user'][_0x3679('0x26')];_0x1b1e9e['UserId']=_0x251f9d[_0x3679('0x62')]['id'];_0x1b1e9e['deleted']=!![];_0x1b1e9e[_0x3679('0x63')]=moment()[_0x3679('0x64')](_0x3679('0x65'));_0x1b1e9e[_0x3679('0x66')]=_0x1561c0[_0x3679('0x67')];_0x1b1e9e[_0x3679('0x68')]=_0x1561c0[_0x3679('0x59')]?_0x3679('0x69'):_0x3679('0x6a');return db['CmContact']['find']({'where':{'id':_0x1b1e9e[_0x3679('0x6b')]},'attributes':[_0x3679('0x6c'),_0x3679('0x6d')]})[_0x3679('0x22')](function(_0x3eecc1){if(!_[_0x3679('0x6e')](_0x3cd01a)&&!_[_0x3679('0x6e')](_0x3eecc1[_0x3679('0x6c')])){_0x1b1e9e[_0x3679('0x6f')]=_0x3eecc1['firstName'];if(!_[_0x3679('0x6e')](_0x3eecc1[_0x3679('0x6d')])){_0x1b1e9e[_0x3679('0x6f')]+='\x20'+_0x3eecc1[_0x3679('0x6d')];}}})['finally'](function(){return db['CmHopperFinal']['create'](_0x1b1e9e);});}})[_0x3679('0x22')](function(){return _0x3cd01a[_0x3679('0x18')](0xcc)['end']();})[_0x3679('0x4f')](handleError(_0x3cd01a,null));};exports[_0x3679('0x70')]=function(_0x29233e,_0x484d99,_0x1c95e3){var _0x55cbcb=[];return db[_0x3679('0x71')][_0x3679('0x57')]()['then'](function(_0x2def5d){_0x55cbcb=_['keys'](_0x2def5d);return _0x29233e['user']['getVoiceQueues']({'where':{'type':_0x3679('0x72'),'dialActive':!![],'dialMethod':_0x3679('0x73')},'attributes':['id',_0x3679('0x74')],'raw':!![]});})[_0x3679('0x22')](function(_0x14e7f8){if(_0x14e7f8&&_0x14e7f8[_0x3679('0x41')]){return db['sequelize'][_0x3679('0x75')](function(_0x5e5b5c){var _0x33e365={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3679('0x64')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x3679('0x2d')](_0x14e7f8,'id')},'$or':[{'UserId':null},{'UserId':_0x29233e[_0x3679('0x62')]['id']}]};var _0xb1e471=[];if(_0x29233e[_0x3679('0x55')][_0x3679('0x76')]&&_0x29233e[_0x3679('0x55')][_0x3679('0x76')]===_0x3679('0x77')){if(!_[_0x3679('0x78')](_0x29233e[_0x3679('0x55')][_0x3679('0x79')])){_0x33e365['id']={'$in':_0x29233e['body'][_0x3679('0x79')]};}_0xb1e471=[['priority',_0x3679('0x7a')],[_0x3679('0x7b'),_0x14e7f8[0x0][_0x3679('0x74')]===_0x3679('0x7a')?_0x3679('0x7c'):_0x3679('0x7a')],db[_0x3679('0x7d')][_0x3679('0x7e')](_0x3679('0x7f')),['id',_0x3679('0x7c')]];}else{if(!_[_0x3679('0x78')](_0x29233e['body'][_0x3679('0x79')])){_0x33e365['id']={'$notIn':_0x29233e[_0x3679('0x55')][_0x3679('0x79')]};}_0xb1e471=[[_0x3679('0x80'),_0x3679('0x7c')],[_0x3679('0x7b'),_0x14e7f8[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x3679('0x7e')](_0x3679('0x81')),['id',_0x3679('0x7a')]];}return db['CmHopper'][_0x3679('0x82')]({'attributes':['id',_0x3679('0x83')],'where':_0x33e365,'order':_0xb1e471,'transaction':_0x5e5b5c,'lock':_0x5e5b5c[_0x3679('0x84')][_0x3679('0x85')],'include':[{'model':db[_0x3679('0x71')],'as':_0x3679('0x86'),'attributes':_0x55cbcb,'include':[{'model':db[_0x3679('0x87')],'as':_0x3679('0x88'),'attributes':['id','name']}]},{'model':db[_0x3679('0x89')],'as':_0x3679('0x8a'),'attributes':['id','name']},{'model':db[_0x3679('0x8b')],'as':_0x3679('0x8c'),'attributes':['id',_0x3679('0x26'),_0x3679('0x8d')]}]})['then'](function(_0x5eee75){if(_0x5eee75){return _0x5eee75[_0x3679('0x56')]({'UserId':_0x29233e[_0x3679('0x62')]['id']},{'transaction':_0x5e5b5c});}});});}})[_0x3679('0x22')](handleEntityNotFound(_0x484d99,null))[_0x3679('0x22')](respondWithResult(_0x484d99,null))['catch'](handleError(_0x484d99,null));};exports['getOpenContacts']=function(_0x471dec,_0x9d3d19,_0x6971a8){return _0x471dec['user']['getVoiceQueues']({'where':{'type':_0x3679('0x72'),'dialActive':!![],'dialMethod':_0x3679('0x73')},'attributes':['id'],'raw':!![]})[_0x3679('0x22')](function(_0x6a95a1){if(_0x6a95a1&&_0x6a95a1['length']){return db[_0x3679('0x28')][_0x3679('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3679('0x64')](_0x3679('0x65'))},'VoiceQueueId':{'$in':_[_0x3679('0x2d')](_0x6a95a1,'id')},'$or':[{'UserId':null},{'UserId':_0x471dec[_0x3679('0x62')]['id']}]}});}return 0x0;})['then'](function(_0x137f03){if(!_[_0x3679('0x6e')](_0x137f03)&&_[_0x3679('0x8e')](_0x137f03)){return _0x9d3d19[_0x3679('0x18')](0xc8)[_0x3679('0x1a')]({'contacts':_0x137f03});}else{logger[_0x3679('0x24')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x3679('0x8f'));_0x9d3d19[_0x3679('0x17')](0x194);}})[_0x3679('0x4f')](handleError(_0x9d3d19,null));}; \ No newline at end of file +var _0x6f46=['lastName','finally','CmHopperFinal','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','format','direction','isEmpty','hopperIds','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','YYYY-MM-DD\x20HH:mm:ss','isNumber','getOpenContacts','entity\x20not\x20found','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','save','update','then','error','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','query','intersection','filters','concat','$gt','$gte','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','VIRTUAL','include','findAll','rows','catch','params','keys','includeAll','options','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','isNil','calleridname'];(function(_0x4f3056,_0xe685f6){var _0x2b8af0=function(_0x3e04c2){while(--_0x3e04c2){_0x4f3056['push'](_0x4f3056['shift']());}};_0x2b8af0(++_0xe685f6);}(_0x6f46,0xb8));var _0x66f4=function(_0x3676f1,_0x19c567){_0x3676f1=_0x3676f1-0x0;var _0x19f97d=_0x6f46[_0x3676f1];return _0x19f97d;};'use strict';var pdf=require(_0x66f4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x66f4('0x1'));var zipdir=require(_0x66f4('0x2'));var jsonpatch=require(_0x66f4('0x3'));var rp=require(_0x66f4('0x4'));var moment=require(_0x66f4('0x5'));var BPromise=require(_0x66f4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x66f4('0x7'));var sox=require(_0x66f4('0x8'));var csv=require(_0x66f4('0x9'));var ejs=require(_0x66f4('0xa'));var fs=require('fs');var _=require(_0x66f4('0xb'));var squel=require(_0x66f4('0xc'));var crypto=require(_0x66f4('0xd'));var jsforce=require(_0x66f4('0xe'));var deskjs=require(_0x66f4('0xf'));var toCsv=require(_0x66f4('0x9'));var querystring=require(_0x66f4('0x10'));var Papa=require(_0x66f4('0x11'));var Redis=require(_0x66f4('0x12'));var authService=require(_0x66f4('0x13'));var qs=require(_0x66f4('0x14'));var as=require(_0x66f4('0x15'));var hardwareService=require(_0x66f4('0x16'));var logger=require('../../config/logger')(_0x66f4('0x17'));var utils=require(_0x66f4('0x18'));var config=require(_0x66f4('0x19'));var db=require(_0x66f4('0x1a'))['db'];function respondWithStatusCode(_0x30f3ca,_0x55eaec){_0x55eaec=_0x55eaec||0xcc;return function(_0x2b4abe){if(_0x2b4abe){return _0x30f3ca[_0x66f4('0x1b')](_0x55eaec);}return _0x30f3ca[_0x66f4('0x1c')](_0x55eaec)['end']();};}function respondWithResult(_0x22dadc,_0x39c1a2){_0x39c1a2=_0x39c1a2||0xc8;return function(_0x433501){if(_0x433501){return _0x22dadc['status'](_0x39c1a2)[_0x66f4('0x1d')](_0x433501);}};}function respondWithFilteredResult(_0x56d0c2,_0xe95e08){return function(_0x1f752b){if(_0x1f752b){var _0x471ed8=_0x1f752b[_0x66f4('0x1e')],_0x232a9e=_0xe95e08[_0x66f4('0x1f')],_0x4fba58=_0xe95e08[_0x66f4('0x1f')]+_0xe95e08['limit'],_0x22d1cd;if(_0x4fba58>=_0x471ed8){_0x4fba58=_0x471ed8;_0x22d1cd=0xc8;}else{_0x22d1cd=0xce;}_0x56d0c2[_0x66f4('0x1c')](_0x22d1cd);return _0x56d0c2['set'](_0x66f4('0x20'),_0x232a9e+'-'+_0x4fba58+'/'+_0x471ed8)[_0x66f4('0x1d')](_0x1f752b);}return null;};}function patchUpdates(_0x1fb46b){return function(_0x553618){try{jsonpatch[_0x66f4('0x21')](_0x553618,_0x1fb46b,!![]);}catch(_0x40655f){return BPromise['reject'](_0x40655f);}return _0x553618[_0x66f4('0x22')]();};}function saveUpdates(_0x91be14,_0x3849b6){return function(_0x4614a3){if(_0x4614a3){return _0x4614a3[_0x66f4('0x23')](_0x91be14)['then'](function(_0x3771a7){return _0x3771a7;});}return null;};}function removeEntity(_0x284be6,_0x36d5c9){return function(_0x2ebef0){if(_0x2ebef0){return _0x2ebef0['destroy']()[_0x66f4('0x24')](function(){_0x284be6[_0x66f4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3756c2,_0x38bc18){return function(_0x5202ae){if(!_0x5202ae){_0x3756c2[_0x66f4('0x1b')](0x194);}return _0x5202ae;};}function handleError(_0xd36e92,_0x2a3c06){_0x2a3c06=_0x2a3c06||0x1f4;return function(_0x58bbe0){logger[_0x66f4('0x25')](_0x58bbe0['stack']);if(_0x58bbe0[_0x66f4('0x26')]){delete _0x58bbe0[_0x66f4('0x26')];}_0xd36e92[_0x66f4('0x1c')](_0x2a3c06)[_0x66f4('0x27')](_0x58bbe0);};}exports[_0x66f4('0x28')]=function(_0x2920fc,_0x3ced22){var _0x320697={},_0x5b4b1a={},_0x1f9ec4={'count':0x0,'rows':[]};var _0xd8f179=_[_0x66f4('0x29')](db[_0x66f4('0x2a')][_0x66f4('0x2b')],function(_0x348bac){return{'name':_0x348bac[_0x66f4('0x2c')],'type':_0x348bac[_0x66f4('0x2d')][_0x66f4('0x2e')]};});_0x5b4b1a['model']=_['map'](_0xd8f179,_0x66f4('0x26'));_0x5b4b1a[_0x66f4('0x2f')]=_['keys'](_0x2920fc[_0x66f4('0x2f')]);_0x5b4b1a['filters']=_[_0x66f4('0x30')](_0x5b4b1a['model'],_0x5b4b1a[_0x66f4('0x2f')]);_0x5b4b1a[_0x66f4('0x31')]=_[_0x66f4('0x32')](_0x5b4b1a[_0x66f4('0x31')],['$and','$or',_0x66f4('0x33'),_0x66f4('0x34'),'$lt',_0x66f4('0x35'),_0x66f4('0x36'),'$eq',_0x66f4('0x37'),_0x66f4('0x38'),_0x66f4('0x39'),_0x66f4('0x3a'),_0x66f4('0x3b'),_0x66f4('0x3c'),_0x66f4('0x3d'),_0x66f4('0x3e'),_0x66f4('0x3f'),'$like',_0x66f4('0x40'),_0x66f4('0x41'),_0x66f4('0x42'),'$any']);_0x320697[_0x66f4('0x43')]=_[_0x66f4('0x30')](_0x5b4b1a[_0x66f4('0x44')],qs[_0x66f4('0x45')](_0x2920fc['query']['fields']));_0x320697[_0x66f4('0x43')]=_0x320697['attributes'][_0x66f4('0x46')]?_0x320697[_0x66f4('0x43')]:_0x5b4b1a[_0x66f4('0x44')];if(!_0x2920fc[_0x66f4('0x2f')][_0x66f4('0x47')](_0x66f4('0x48'))){_0x320697['limit']=qs[_0x66f4('0x49')](_0x2920fc[_0x66f4('0x2f')][_0x66f4('0x49')]);_0x320697[_0x66f4('0x1f')]=qs[_0x66f4('0x1f')](_0x2920fc[_0x66f4('0x2f')][_0x66f4('0x1f')]);}_0x320697[_0x66f4('0x4a')]=qs['sort'](_0x2920fc[_0x66f4('0x2f')][_0x66f4('0x4b')]);_0x320697['where']=qs['filters'](_['pick'](_0x2920fc[_0x66f4('0x2f')],_0x5b4b1a[_0x66f4('0x31')]));if(_0x2920fc[_0x66f4('0x2f')][_0x66f4('0x4c')]){_0x320697['where']=_[_0x66f4('0x4d')](_0x320697[_0x66f4('0x4e')],{'$or':_[_0x66f4('0x29')](_0xd8f179,function(_0x5d9993){if(_0x5d9993[_0x66f4('0x2d')]!==_0x66f4('0x4f')){var _0x219185={};_0x219185[_0x5d9993[_0x66f4('0x26')]]={'$like':'%'+_0x2920fc[_0x66f4('0x2f')][_0x66f4('0x4c')]+'%'};return _0x219185;}})});}_0x320697=_[_0x66f4('0x4d')]({},_0x320697,_0x2920fc['options']);var _0x2401dd={'where':_0x320697[_0x66f4('0x4e')]};return db[_0x66f4('0x2a')][_0x66f4('0x1e')](_0x2401dd)[_0x66f4('0x24')](function(_0x1bdcd2){_0x1f9ec4[_0x66f4('0x1e')]=_0x1bdcd2;if(_0x2920fc[_0x66f4('0x2f')]['includeAll']){_0x320697[_0x66f4('0x50')]=[{'all':!![]}];}return db[_0x66f4('0x2a')][_0x66f4('0x51')](_0x320697);})[_0x66f4('0x24')](function(_0x34f34a){_0x1f9ec4[_0x66f4('0x52')]=_0x34f34a;return _0x1f9ec4;})[_0x66f4('0x24')](respondWithFilteredResult(_0x3ced22,_0x320697))[_0x66f4('0x53')](handleError(_0x3ced22,null));};exports['show']=function(_0x55d8c4,_0x5bf3c7){var _0x3b4b86={'raw':!![],'where':{'id':_0x55d8c4[_0x66f4('0x54')]['id']}},_0x41af93={};_0x41af93[_0x66f4('0x44')]=_[_0x66f4('0x55')](db[_0x66f4('0x2a')][_0x66f4('0x2b')]);_0x41af93[_0x66f4('0x2f')]=_['keys'](_0x55d8c4['query']);_0x41af93[_0x66f4('0x31')]=_[_0x66f4('0x30')](_0x41af93['model'],_0x41af93[_0x66f4('0x2f')]);_0x3b4b86[_0x66f4('0x43')]=_[_0x66f4('0x30')](_0x41af93[_0x66f4('0x44')],qs[_0x66f4('0x45')](_0x55d8c4[_0x66f4('0x2f')][_0x66f4('0x45')]));_0x3b4b86['attributes']=_0x3b4b86['attributes']['length']?_0x3b4b86['attributes']:_0x41af93['model'];if(_0x55d8c4['query'][_0x66f4('0x56')]){_0x3b4b86[_0x66f4('0x50')]=[{'all':!![]}];}_0x3b4b86=_[_0x66f4('0x4d')]({},_0x3b4b86,_0x55d8c4[_0x66f4('0x57')]);return db[_0x66f4('0x2a')][_0x66f4('0x58')](_0x3b4b86)['then'](handleEntityNotFound(_0x5bf3c7,null))[_0x66f4('0x24')](respondWithResult(_0x5bf3c7,null))[_0x66f4('0x53')](handleError(_0x5bf3c7,null));};exports[_0x66f4('0x59')]=function(_0x20491c,_0x22531f){return db[_0x66f4('0x2a')][_0x66f4('0x59')](_0x20491c['body'],{})[_0x66f4('0x24')](respondWithResult(_0x22531f,0xc9))[_0x66f4('0x53')](handleError(_0x22531f,null));};exports['update']=function(_0x5176a1,_0x22aa26){if(_0x5176a1[_0x66f4('0x5a')]['id']){delete _0x5176a1['body']['id'];}return db[_0x66f4('0x2a')][_0x66f4('0x58')]({'where':{'id':_0x5176a1[_0x66f4('0x54')]['id']}})[_0x66f4('0x24')](handleEntityNotFound(_0x22aa26,null))[_0x66f4('0x24')](saveUpdates(_0x5176a1[_0x66f4('0x5a')],null))[_0x66f4('0x24')](respondWithResult(_0x22aa26,null))[_0x66f4('0x53')](handleError(_0x22aa26,null));};exports[_0x66f4('0x5b')]=function(_0x6766b7,_0xd4547){return db[_0x66f4('0x2a')]['describe']()[_0x66f4('0x24')](respondWithResult(_0xd4547,null))['catch'](handleError(_0xd4547,null));};exports[_0x66f4('0x5c')]=function(_0xa2fc62,_0x13d2a0){var _0xed0000;return db[_0x66f4('0x2a')]['find']({'where':{'id':_0xa2fc62[_0x66f4('0x54')]['id']}})[_0x66f4('0x24')](handleEntityNotFound(_0x13d2a0,null))['then'](function(_0xdfaa82){if(_0xdfaa82){return _0xdfaa82[_0x66f4('0x5c')]()[_0x66f4('0x24')](function(_0x216794){return _0x216794;});}})[_0x66f4('0x24')](function(_0x44f989){_0xed0000=_0x44f989;if(_0x44f989){if(_0x44f989[_0x66f4('0x5d')]||_0x44f989[_0x66f4('0x5e')]){return db[_0x44f989[_0x66f4('0x5d')]?_0x66f4('0x5f'):_0x66f4('0x60')][_0x66f4('0x58')]({'where':{'id':_0x44f989[_0x66f4('0x5d')]?_0x44f989[_0x66f4('0x5d')]:_0x44f989[_0x66f4('0x5e')]},'attributes':['id',_0x66f4('0x26')],'raw':!![]});}}})[_0x66f4('0x24')](function(_0xba3b5b){var _0x24a40b={};if(_0xba3b5b){_[_0x66f4('0x4d')](_0x24a40b,_['omit'](_0xed0000[_0x66f4('0x61')],['createdAt',_0x66f4('0x62'),'id']));_0x24a40b[_0x66f4('0x63')]=0x15;_0x24a40b[_0x66f4('0x64')]=_0x66f4('0x65');_0x24a40b[_0x66f4('0x66')]=_0xba3b5b['name'];_0x24a40b[_0x66f4('0x67')]=_0xa2fc62[_0x66f4('0x68')][_0x66f4('0x26')];_0x24a40b[_0x66f4('0x69')]=_0xa2fc62[_0x66f4('0x68')]['id'];_0x24a40b[_0x66f4('0x65')]=!![];_0x24a40b[_0x66f4('0x6a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x24a40b[_0x66f4('0x6b')]=_0xed0000[_0x66f4('0x6c')];_0x24a40b[_0x66f4('0x6d')]=_0xed0000[_0x66f4('0x5d')]?_0x66f4('0x6e'):_0x66f4('0x6f');return db['CmContact'][_0x66f4('0x58')]({'where':{'id':_0x24a40b[_0x66f4('0x70')]},'attributes':[_0x66f4('0x71'),'lastName']})[_0x66f4('0x24')](function(_0x735b3f){if(!_[_0x66f4('0x72')](_0x13d2a0)&&!_['isNil'](_0x735b3f[_0x66f4('0x71')])){_0x24a40b[_0x66f4('0x73')]=_0x735b3f[_0x66f4('0x71')];if(!_[_0x66f4('0x72')](_0x735b3f[_0x66f4('0x74')])){_0x24a40b[_0x66f4('0x73')]+='\x20'+_0x735b3f[_0x66f4('0x74')];}}})[_0x66f4('0x75')](function(){return db[_0x66f4('0x76')][_0x66f4('0x59')](_0x24a40b);});}})[_0x66f4('0x24')](function(){return _0x13d2a0[_0x66f4('0x1c')](0xcc)['end']();})[_0x66f4('0x53')](handleError(_0x13d2a0,null));};exports['getPreview']=function(_0x1da273,_0x276639,_0x215311){var _0x5e7da4=[];return db[_0x66f4('0x77')]['describe']()['then'](function(_0x40ae4e){_0x5e7da4=_[_0x66f4('0x55')](_0x40ae4e);return _0x1da273[_0x66f4('0x68')][_0x66f4('0x78')]({'where':{'type':_0x66f4('0x79'),'dialActive':!![],'dialMethod':_0x66f4('0x7a')},'attributes':['id',_0x66f4('0x7b')],'raw':!![]});})[_0x66f4('0x24')](function(_0x78ce6e){if(_0x78ce6e&&_0x78ce6e['length']){return db['sequelize']['transaction'](function(_0x3b7025){var _0x2d71a4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x66f4('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x66f4('0x29')](_0x78ce6e,'id')},'$or':[{'UserId':null},{'UserId':_0x1da273[_0x66f4('0x68')]['id']}]};var _0xe96991=[];if(_0x1da273[_0x66f4('0x5a')][_0x66f4('0x7d')]&&_0x1da273[_0x66f4('0x5a')][_0x66f4('0x7d')]==='prev'){if(!_[_0x66f4('0x7e')](_0x1da273['body'][_0x66f4('0x7f')])){_0x2d71a4['id']={'$in':_0x1da273[_0x66f4('0x5a')]['hopperIds']};}_0xe96991=[['priority',_0x66f4('0x80')],[_0x66f4('0x81'),_0x78ce6e[0x0][_0x66f4('0x7b')]===_0x66f4('0x80')?_0x66f4('0x82'):_0x66f4('0x80')],db[_0x66f4('0x83')][_0x66f4('0x84')](_0x66f4('0x85')),['id','DESC']];}else{if(!_[_0x66f4('0x7e')](_0x1da273[_0x66f4('0x5a')][_0x66f4('0x7f')])){_0x2d71a4['id']={'$notIn':_0x1da273[_0x66f4('0x5a')]['hopperIds']};}_0xe96991=[[_0x66f4('0x86'),_0x66f4('0x82')],['scheduledAt',_0x78ce6e[0x0][_0x66f4('0x7b')]],db[_0x66f4('0x83')][_0x66f4('0x84')](_0x66f4('0x87')),['id',_0x66f4('0x80')]];}return db[_0x66f4('0x2a')][_0x66f4('0x88')]({'attributes':['id',_0x66f4('0x89')],'where':_0x2d71a4,'order':_0xe96991,'transaction':_0x3b7025,'lock':_0x3b7025['LOCK'][_0x66f4('0x8a')],'include':[{'model':db['CmContact'],'as':_0x66f4('0x8b'),'attributes':_0x5e7da4,'include':[{'model':db[_0x66f4('0x8c')],'as':_0x66f4('0x8d'),'attributes':['id',_0x66f4('0x26')]}]},{'model':db[_0x66f4('0x8e')],'as':_0x66f4('0x8f'),'attributes':['id',_0x66f4('0x26')]},{'model':db[_0x66f4('0x5f')],'as':_0x66f4('0x90'),'attributes':['id','name',_0x66f4('0x91')]}]})['then'](function(_0x180137){if(_0x180137){return _0x180137[_0x66f4('0x23')]({'UserId':_0x1da273[_0x66f4('0x68')]['id']},{'transaction':_0x3b7025});}});});}})[_0x66f4('0x24')](handleEntityNotFound(_0x276639,null))[_0x66f4('0x24')](respondWithResult(_0x276639,null))[_0x66f4('0x53')](handleError(_0x276639,null));};exports['getOpenContacts']=function(_0xe1d6b7,_0x16de67,_0x4c8dcf){return _0xe1d6b7['user']['getVoiceQueues']({'where':{'type':_0x66f4('0x79'),'dialActive':!![],'dialMethod':_0x66f4('0x7a')},'attributes':['id'],'raw':!![]})[_0x66f4('0x24')](function(_0x5359f8){if(_0x5359f8&&_0x5359f8[_0x66f4('0x46')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x66f4('0x92'))},'VoiceQueueId':{'$in':_['map'](_0x5359f8,'id')},'$or':[{'UserId':null},{'UserId':_0xe1d6b7[_0x66f4('0x68')]['id']}]}});}return 0x0;})['then'](function(_0x26731e){if(!_[_0x66f4('0x72')](_0x26731e)&&_[_0x66f4('0x93')](_0x26731e)){return _0x16de67[_0x66f4('0x1c')](0xc8)[_0x66f4('0x1d')]({'contacts':_0x26731e});}else{logger[_0x66f4('0x25')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x66f4('0x94'),0x194,_0x66f4('0x95'));_0x16de67[_0x66f4('0x1b')](0x194);}})['catch'](handleError(_0x16de67,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 4af1a62..6f35194 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 _0xa935=['rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x182e74,_0x40a073){var _0xa03a21=function(_0x1398aa){while(--_0x1398aa){_0x182e74['push'](_0x182e74['shift']());}};_0xa03a21(++_0x40a073);}(_0xa935,0x144));var _0x5a93=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0xa935[_0x1627ae];return _0x34b38f;};'use strict';var _=require(_0x5a93('0x0'));var util=require(_0x5a93('0x1'));var logger=require(_0x5a93('0x2'))(_0x5a93('0x3'));var moment=require(_0x5a93('0x4'));var BPromise=require(_0x5a93('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5a93('0x6'));var config=require(_0x5a93('0x7'));var attributes=require(_0x5a93('0x8'));module['exports']=function(_0x404324,_0x4d37f3){return _0x404324[_0x5a93('0x9')](_0x5a93('0xa'),attributes,{'tableName':_0x5a93('0xb'),'paranoid':![],'indexes':[{'name':_0x5a93('0xc'),'fields':[_0x5a93('0xc')]},{'name':_0x5a93('0xd'),'fields':[_0x5a93('0xd')]},{'name':_0x5a93('0xe'),'fields':[_0x5a93('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9aa5=['util','../../config/logger','moment','request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','phone','priority','lodash'];(function(_0x475e88,_0x2553e6){var _0x29fb5b=function(_0x43c737){while(--_0x43c737){_0x475e88['push'](_0x475e88['shift']());}};_0x29fb5b(++_0x2553e6);}(_0x9aa5,0x137));var _0x59aa=function(_0x2cd980,_0x1c026a){_0x2cd980=_0x2cd980-0x0;var _0x316ea6=_0x9aa5[_0x2cd980];return _0x316ea6;};'use strict';var _=require(_0x59aa('0x0'));var util=require(_0x59aa('0x1'));var logger=require(_0x59aa('0x2'))('api');var moment=require(_0x59aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x59aa('0x4'));var fs=require('fs');var path=require(_0x59aa('0x5'));var rimraf=require(_0x59aa('0x6'));var config=require('../../config/environment');var attributes=require(_0x59aa('0x7'));module[_0x59aa('0x8')]=function(_0x510780,_0x329859){return _0x510780[_0x59aa('0x9')](_0x59aa('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':_0x59aa('0xb'),'fields':[_0x59aa('0xb')]},{'name':_0x59aa('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 5cc9c23..a89da9a 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 _0xb10b=['order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','push','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','debug','catch','ShowCmHopper','CreateCmHopper','create','body','update','limit','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb10b,0x12a));var _0xbb10=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0xb10b[_0xf97eb0];return _0xea70f4;};'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,'limit':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['limit']||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x407cb4){return{'model':db[_0x407cb4[_0xbb10('0x1e')]],'as':_0x407cb4['as'],'attributes':_0x407cb4[_0xbb10('0x1b')],'include':_0x407cb4[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x407cb4[_0xbb10('0x1c')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x537898[_0xbb10('0x1c')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x1e')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x1d5e95){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')]('GetCmHopper',_0x378da8,JSON[_0xbb10('0x11')](_0x1d5e95));_0x575cca(_0x1d5e95);})[_0xbb10('0x20')](function(_0xfc3595){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0xfc3595[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0xfc3595[_0xbb10('0x13')]));});});};exports['ShowCmHopper']=function(_0x448d5c){var _0x56f2da=this;return new Promise(function(_0x16ad2a,_0x1dcc9c){return db[_0xbb10('0x16')]['find']({'raw':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'include':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x8c1ce6){return{'model':db[_0x8c1ce6[_0xbb10('0x1e')]],'as':_0x8c1ce6['as'],'attributes':_0x8c1ce6[_0xbb10('0x1b')],'include':_0x8c1ce6[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x8c1ce6[_0xbb10('0x1c')],function(_0x56943c){return{'model':db[_0x56943c[_0xbb10('0x1e')]],'as':_0x56943c['as'],'attributes':_0x56943c[_0xbb10('0x1b')],'include':_0x56943c[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x56943c['include'],function(_0x111762){return{'model':db[_0x111762['model']],'as':_0x111762['as'],'attributes':_0x111762['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x40c164){logger[_0xbb10('0xd')](_0xbb10('0x21'),_0x448d5c);logger[_0xbb10('0x1f')](_0xbb10('0x21'),_0x448d5c,JSON['stringify'](_0x40c164));_0x16ad2a(_0x40c164);})[_0xbb10('0x20')](function(_0x25d72f){logger['error']('ShowCmHopper',_0x25d72f['message'],_0x448d5c);_0x1dcc9c(_0x56f2da[_0xbb10('0x12')](0x1f4,_0x25d72f[_0xbb10('0x13')]));});});};exports[_0xbb10('0x22')]=function(_0x4d5a9b){var _0x3c0cd7=this;return new Promise(function(_0x3e8538,_0x4345f3){return db['CmHopper'][_0xbb10('0x23')](_0x4d5a9b[_0xbb10('0x24')],{'raw':_0x4d5a9b[_0xbb10('0x18')]?_0x4d5a9b[_0xbb10('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0x110eb5){logger['info'](_0xbb10('0x22'),_0x4d5a9b);logger[_0xbb10('0x1f')](_0xbb10('0x22'),_0x4d5a9b,JSON[_0xbb10('0x11')](_0x110eb5));_0x3e8538(_0x110eb5);})[_0xbb10('0x20')](function(_0x185a52){logger['error'](_0xbb10('0x22'),_0x185a52[_0xbb10('0x13')],_0x4d5a9b);_0x4345f3(_0x3c0cd7[_0xbb10('0x12')](0x1f4,_0x185a52[_0xbb10('0x13')]));});});};exports['UpdateCmHopper']=function(_0x3fff6c){var _0x331751=this;return new Promise(function(_0x23dc18,_0x403beb){return db['CmHopper'][_0xbb10('0x25')](_0x3fff6c[_0xbb10('0x24')],{'raw':_0x3fff6c['options']?_0x3fff6c['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x3fff6c[_0xbb10('0x18')]?_0x3fff6c['options'][_0xbb10('0x26')]||null:null})[_0xbb10('0xc')](function(_0x3b9fdf){logger[_0xbb10('0xd')](_0xbb10('0x27'),_0x3fff6c);logger[_0xbb10('0x1f')](_0xbb10('0x27'),_0x3fff6c,JSON[_0xbb10('0x11')](_0x3b9fdf));_0x23dc18(_0x3b9fdf);})[_0xbb10('0x20')](function(_0x43b948){logger[_0xbb10('0x12')](_0xbb10('0x27'),_0x43b948['message'],_0x3fff6c);_0x403beb(_0x331751[_0xbb10('0x12')](0x1f4,_0x43b948[_0xbb10('0x13')]));});});};exports['DestroyCmHopper']=function(_0x14e1cb){var _0x2f5027=this;return new Promise(function(_0x1a7df6,_0x5a5226){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x14e1cb[_0xbb10('0x18')]?_0x14e1cb['options']['where']||null:null})[_0xbb10('0xc')](function(_0x76a208){logger[_0xbb10('0xd')]('DestroyCmHopper',_0x14e1cb);logger['debug'](_0xbb10('0x29'),_0x14e1cb,JSON[_0xbb10('0x11')](_0x76a208));_0x1a7df6(_0x76a208);})[_0xbb10('0x20')](function(_0xf820fe){logger[_0xbb10('0x12')](_0xbb10('0x29'),_0xf820fe[_0xbb10('0x13')],_0x14e1cb);_0x5a5226(_0x2f5027[_0xbb10('0x12')](0x1f4,_0xf820fe[_0xbb10('0x13')]));});});};exports[_0xbb10('0x2a')]=function(_0x550111){var _0x5eafac=this;return new Promise(function(_0x412e13,_0x467dba){return db[_0xbb10('0x2b')][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x440f9e){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x1c0d8f){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'where':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x550111[_0xbb10('0x18')]?_0x550111['options'][_0xbb10('0x1b')]||null:null,'limit':_0x550111['options']?_0x550111[_0xbb10('0x18')][_0xbb10('0x26')]||null:null,'order':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x2f')]||null:null,'transaction':_0x1c0d8f,'lock':_0x1c0d8f[_0xbb10('0x30')][_0xbb10('0x31')],'include':[{'model':db[_0xbb10('0x2b')],'as':_0xbb10('0x32'),'attributes':_[_0xbb10('0x33')](_0x440f9e)},{'model':db[_0xbb10('0x34')],'as':_0xbb10('0x35'),'attributes':['id',_0xbb10('0x36'),_0xbb10('0x37')]}]})[_0xbb10('0xc')](function(_0x5de0cc){var _0x4571b6=[];for(var _0x466eb7=0x0;_0x466eb7<_0x5de0cc[_0xbb10('0x38')];_0x466eb7+=0x1){_0x4571b6[_0xbb10('0x39')](_0x5de0cc[_0x466eb7][_0xbb10('0x25')](_0x550111[_0xbb10('0x24')],{'transaction':_0x1c0d8f}));}return BPromise['all'](_0x4571b6);});})[_0xbb10('0xc')](function(_0x4731ce){logger[_0xbb10('0xd')](_0xbb10('0x2a'),_0x550111);logger[_0xbb10('0x1f')](_0xbb10('0x2a'),_0x550111,JSON[_0xbb10('0x11')](_0x4731ce));_0x412e13(_0x4731ce);})[_0xbb10('0x20')](function(_0x205e01){logger[_0xbb10('0x12')](_0xbb10('0x2a'),_0x205e01[_0xbb10('0x13')],_0x550111);_0x467dba(_0x5eafac[_0xbb10('0x12')](0x1f4,_0x205e01['message']));});});});};exports['MoveContactManagedDialer']=function(_0x16272d){var _0x3e6338=this;return new Promise(function(_0x3d0cb7,_0x8b0a7d){return db['sequelize']['transaction'](function(_0x79411e){return db[_0xbb10('0x3a')][_0xbb10('0x23')](_0x16272d[_0xbb10('0x24')],{'raw':_0x16272d[_0xbb10('0x18')]?_0x16272d[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'transaction':_0x79411e})['then'](function(){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x16272d['options']?_0x16272d['options']['where']||null:null,'transaction':_0x79411e});});})[_0xbb10('0xc')](function(_0x31c727){logger[_0xbb10('0xd')]('MoveContactManagedDialer',_0x16272d);logger['debug']('MoveContactManagedDialer',_0x16272d,JSON[_0xbb10('0x11')](_0x31c727));_0x3d0cb7(_0x31c727);})[_0xbb10('0x20')](function(_0x45167a){logger['error'](_0xbb10('0x3b'),_0x45167a[_0xbb10('0x13')],_0x16272d);_0x8b0a7d(_0x3e6338['error'](0x1f4,_0x45167a['message']));});});};exports[_0xbb10('0x3c')]=function(_0x308896){var _0xd77753=this;return new Promise(function(_0x237246,_0x54b7c5){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x308896[_0xbb10('0x18')]?_0x308896['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x308896[_0xbb10('0x18')]?_0x308896[_0xbb10('0x18')]['where']||null:null,'attributes':[[db[_0xbb10('0x2d')]['fn'](_0xbb10('0x3d'),db[_0xbb10('0x2d')]['fn']('IF',db[_0xbb10('0x2d')]['literal'](_0xbb10('0x3e')+util[_0xbb10('0x3f')](_0xbb10('0x40'),moment()[_0xbb10('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xbb10('0x41')))),_0xbb10('0x42')]]})[_0xbb10('0xc')](function(_0x2ceb3e){logger[_0xbb10('0xd')](_0xbb10('0x3c'),_0x308896);logger[_0xbb10('0x1f')]('CountReScheduled',_0x308896,JSON['stringify'](_0x2ceb3e));_0x237246(_0x2ceb3e);})['catch'](function(_0xdfbc0b){logger[_0xbb10('0x12')](_0xbb10('0x3c'),_0xdfbc0b['message'],_0x308896);_0x54b7c5(_0xd77753['error'](0x1f4,_0xdfbc0b[_0xbb10('0x13')]));});});};exports[_0xbb10('0x43')]=function(_0xd9e743){var _0x3a9677=this;return new Promise(function(_0x260e06,_0x1ad2ed){return db['CmContact'][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x270fdb){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x5bfc68){return db['CmHopper']['findAll']({'where':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':0x1,'order':_0xd9e743['options']?_0xd9e743[_0xbb10('0x18')]['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x5bfc68,'lock':_0x5bfc68[_0xbb10('0x30')][_0xbb10('0x31')],'include':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0xd9e743['options']['include'],function(_0x165fe9){return{'model':db[_0x165fe9[_0xbb10('0x1e')]],'as':_0x165fe9['as'],'attributes':_0x165fe9[_0xbb10('0x1b')],'include':_0x165fe9[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x165fe9['include'],function(_0x2d52ea){return{'model':db[_0x2d52ea[_0xbb10('0x1e')]],'as':_0x2d52ea['as'],'attributes':_0x2d52ea[_0xbb10('0x1b')],'include':_0x2d52ea[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x2d52ea[_0xbb10('0x1c')],function(_0x174395){return{'model':db[_0x174395['model']],'as':_0x174395['as'],'attributes':_0x174395[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x30f3ea){var _0x322b41=[];for(var _0x37b20e=0x0;_0x37b20e<_0x30f3ea[_0xbb10('0x38')];_0x37b20e+=0x1){_0x322b41[_0xbb10('0x39')](_0x30f3ea[_0x37b20e][_0xbb10('0x25')](_0xd9e743['body'],{'transaction':_0x5bfc68}));}return BPromise[_0xbb10('0x44')](_0x322b41);});})[_0xbb10('0xc')](function(_0x145baf){logger['info']('GetContactRecallMe',_0xd9e743);logger['debug'](_0xbb10('0x43'),_0xd9e743,JSON['stringify'](_0x145baf));_0x260e06(_0x145baf);})['catch'](function(_0x1701c5){logger[_0xbb10('0x12')](_0xbb10('0x43'),_0x1701c5[_0xbb10('0x13')],_0xd9e743);_0x1ad2ed(_0x3a9677[_0xbb10('0x12')](0x1f4,_0x1701c5[_0xbb10('0x13')]));});});});}; \ No newline at end of file +var _0xb10b=['order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','push','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','debug','catch','ShowCmHopper','CreateCmHopper','create','body','update','limit','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb10b,0x12a));var _0xbb10=function(_0x44a274,_0x17b558){_0x44a274=_0x44a274-0x0;var _0x582fdc=_0xb10b[_0x44a274];return _0x582fdc;};'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,'limit':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['limit']||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x407cb4){return{'model':db[_0x407cb4[_0xbb10('0x1e')]],'as':_0x407cb4['as'],'attributes':_0x407cb4[_0xbb10('0x1b')],'include':_0x407cb4[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x407cb4[_0xbb10('0x1c')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x537898[_0xbb10('0x1c')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x1e')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x1d5e95){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')]('GetCmHopper',_0x378da8,JSON[_0xbb10('0x11')](_0x1d5e95));_0x575cca(_0x1d5e95);})[_0xbb10('0x20')](function(_0xfc3595){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0xfc3595[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0xfc3595[_0xbb10('0x13')]));});});};exports['ShowCmHopper']=function(_0x448d5c){var _0x56f2da=this;return new Promise(function(_0x16ad2a,_0x1dcc9c){return db[_0xbb10('0x16')]['find']({'raw':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'include':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x8c1ce6){return{'model':db[_0x8c1ce6[_0xbb10('0x1e')]],'as':_0x8c1ce6['as'],'attributes':_0x8c1ce6[_0xbb10('0x1b')],'include':_0x8c1ce6[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x8c1ce6[_0xbb10('0x1c')],function(_0x56943c){return{'model':db[_0x56943c[_0xbb10('0x1e')]],'as':_0x56943c['as'],'attributes':_0x56943c[_0xbb10('0x1b')],'include':_0x56943c[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x56943c['include'],function(_0x111762){return{'model':db[_0x111762['model']],'as':_0x111762['as'],'attributes':_0x111762['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x40c164){logger[_0xbb10('0xd')](_0xbb10('0x21'),_0x448d5c);logger[_0xbb10('0x1f')](_0xbb10('0x21'),_0x448d5c,JSON['stringify'](_0x40c164));_0x16ad2a(_0x40c164);})[_0xbb10('0x20')](function(_0x25d72f){logger['error']('ShowCmHopper',_0x25d72f['message'],_0x448d5c);_0x1dcc9c(_0x56f2da[_0xbb10('0x12')](0x1f4,_0x25d72f[_0xbb10('0x13')]));});});};exports[_0xbb10('0x22')]=function(_0x4d5a9b){var _0x3c0cd7=this;return new Promise(function(_0x3e8538,_0x4345f3){return db['CmHopper'][_0xbb10('0x23')](_0x4d5a9b[_0xbb10('0x24')],{'raw':_0x4d5a9b[_0xbb10('0x18')]?_0x4d5a9b[_0xbb10('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0x110eb5){logger['info'](_0xbb10('0x22'),_0x4d5a9b);logger[_0xbb10('0x1f')](_0xbb10('0x22'),_0x4d5a9b,JSON[_0xbb10('0x11')](_0x110eb5));_0x3e8538(_0x110eb5);})[_0xbb10('0x20')](function(_0x185a52){logger['error'](_0xbb10('0x22'),_0x185a52[_0xbb10('0x13')],_0x4d5a9b);_0x4345f3(_0x3c0cd7[_0xbb10('0x12')](0x1f4,_0x185a52[_0xbb10('0x13')]));});});};exports['UpdateCmHopper']=function(_0x3fff6c){var _0x331751=this;return new Promise(function(_0x23dc18,_0x403beb){return db['CmHopper'][_0xbb10('0x25')](_0x3fff6c[_0xbb10('0x24')],{'raw':_0x3fff6c['options']?_0x3fff6c['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x3fff6c[_0xbb10('0x18')]?_0x3fff6c['options'][_0xbb10('0x26')]||null:null})[_0xbb10('0xc')](function(_0x3b9fdf){logger[_0xbb10('0xd')](_0xbb10('0x27'),_0x3fff6c);logger[_0xbb10('0x1f')](_0xbb10('0x27'),_0x3fff6c,JSON[_0xbb10('0x11')](_0x3b9fdf));_0x23dc18(_0x3b9fdf);})[_0xbb10('0x20')](function(_0x43b948){logger[_0xbb10('0x12')](_0xbb10('0x27'),_0x43b948['message'],_0x3fff6c);_0x403beb(_0x331751[_0xbb10('0x12')](0x1f4,_0x43b948[_0xbb10('0x13')]));});});};exports['DestroyCmHopper']=function(_0x14e1cb){var _0x2f5027=this;return new Promise(function(_0x1a7df6,_0x5a5226){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x14e1cb[_0xbb10('0x18')]?_0x14e1cb['options']['where']||null:null})[_0xbb10('0xc')](function(_0x76a208){logger[_0xbb10('0xd')]('DestroyCmHopper',_0x14e1cb);logger['debug'](_0xbb10('0x29'),_0x14e1cb,JSON[_0xbb10('0x11')](_0x76a208));_0x1a7df6(_0x76a208);})[_0xbb10('0x20')](function(_0xf820fe){logger[_0xbb10('0x12')](_0xbb10('0x29'),_0xf820fe[_0xbb10('0x13')],_0x14e1cb);_0x5a5226(_0x2f5027[_0xbb10('0x12')](0x1f4,_0xf820fe[_0xbb10('0x13')]));});});};exports[_0xbb10('0x2a')]=function(_0x550111){var _0x5eafac=this;return new Promise(function(_0x412e13,_0x467dba){return db[_0xbb10('0x2b')][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x440f9e){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x1c0d8f){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'where':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x550111[_0xbb10('0x18')]?_0x550111['options'][_0xbb10('0x1b')]||null:null,'limit':_0x550111['options']?_0x550111[_0xbb10('0x18')][_0xbb10('0x26')]||null:null,'order':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x2f')]||null:null,'transaction':_0x1c0d8f,'lock':_0x1c0d8f[_0xbb10('0x30')][_0xbb10('0x31')],'include':[{'model':db[_0xbb10('0x2b')],'as':_0xbb10('0x32'),'attributes':_[_0xbb10('0x33')](_0x440f9e)},{'model':db[_0xbb10('0x34')],'as':_0xbb10('0x35'),'attributes':['id',_0xbb10('0x36'),_0xbb10('0x37')]}]})[_0xbb10('0xc')](function(_0x5de0cc){var _0x4571b6=[];for(var _0x466eb7=0x0;_0x466eb7<_0x5de0cc[_0xbb10('0x38')];_0x466eb7+=0x1){_0x4571b6[_0xbb10('0x39')](_0x5de0cc[_0x466eb7][_0xbb10('0x25')](_0x550111[_0xbb10('0x24')],{'transaction':_0x1c0d8f}));}return BPromise['all'](_0x4571b6);});})[_0xbb10('0xc')](function(_0x4731ce){logger[_0xbb10('0xd')](_0xbb10('0x2a'),_0x550111);logger[_0xbb10('0x1f')](_0xbb10('0x2a'),_0x550111,JSON[_0xbb10('0x11')](_0x4731ce));_0x412e13(_0x4731ce);})[_0xbb10('0x20')](function(_0x205e01){logger[_0xbb10('0x12')](_0xbb10('0x2a'),_0x205e01[_0xbb10('0x13')],_0x550111);_0x467dba(_0x5eafac[_0xbb10('0x12')](0x1f4,_0x205e01['message']));});});});};exports['MoveContactManagedDialer']=function(_0x16272d){var _0x3e6338=this;return new Promise(function(_0x3d0cb7,_0x8b0a7d){return db['sequelize']['transaction'](function(_0x79411e){return db[_0xbb10('0x3a')][_0xbb10('0x23')](_0x16272d[_0xbb10('0x24')],{'raw':_0x16272d[_0xbb10('0x18')]?_0x16272d[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'transaction':_0x79411e})['then'](function(){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x16272d['options']?_0x16272d['options']['where']||null:null,'transaction':_0x79411e});});})[_0xbb10('0xc')](function(_0x31c727){logger[_0xbb10('0xd')]('MoveContactManagedDialer',_0x16272d);logger['debug']('MoveContactManagedDialer',_0x16272d,JSON[_0xbb10('0x11')](_0x31c727));_0x3d0cb7(_0x31c727);})[_0xbb10('0x20')](function(_0x45167a){logger['error'](_0xbb10('0x3b'),_0x45167a[_0xbb10('0x13')],_0x16272d);_0x8b0a7d(_0x3e6338['error'](0x1f4,_0x45167a['message']));});});};exports[_0xbb10('0x3c')]=function(_0x308896){var _0xd77753=this;return new Promise(function(_0x237246,_0x54b7c5){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x308896[_0xbb10('0x18')]?_0x308896['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x308896[_0xbb10('0x18')]?_0x308896[_0xbb10('0x18')]['where']||null:null,'attributes':[[db[_0xbb10('0x2d')]['fn'](_0xbb10('0x3d'),db[_0xbb10('0x2d')]['fn']('IF',db[_0xbb10('0x2d')]['literal'](_0xbb10('0x3e')+util[_0xbb10('0x3f')](_0xbb10('0x40'),moment()[_0xbb10('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xbb10('0x41')))),_0xbb10('0x42')]]})[_0xbb10('0xc')](function(_0x2ceb3e){logger[_0xbb10('0xd')](_0xbb10('0x3c'),_0x308896);logger[_0xbb10('0x1f')]('CountReScheduled',_0x308896,JSON['stringify'](_0x2ceb3e));_0x237246(_0x2ceb3e);})['catch'](function(_0xdfbc0b){logger[_0xbb10('0x12')](_0xbb10('0x3c'),_0xdfbc0b['message'],_0x308896);_0x54b7c5(_0xd77753['error'](0x1f4,_0xdfbc0b[_0xbb10('0x13')]));});});};exports[_0xbb10('0x43')]=function(_0xd9e743){var _0x3a9677=this;return new Promise(function(_0x260e06,_0x1ad2ed){return db['CmContact'][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x270fdb){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x5bfc68){return db['CmHopper']['findAll']({'where':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':0x1,'order':_0xd9e743['options']?_0xd9e743[_0xbb10('0x18')]['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x5bfc68,'lock':_0x5bfc68[_0xbb10('0x30')][_0xbb10('0x31')],'include':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0xd9e743['options']['include'],function(_0x165fe9){return{'model':db[_0x165fe9[_0xbb10('0x1e')]],'as':_0x165fe9['as'],'attributes':_0x165fe9[_0xbb10('0x1b')],'include':_0x165fe9[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x165fe9['include'],function(_0x2d52ea){return{'model':db[_0x2d52ea[_0xbb10('0x1e')]],'as':_0x2d52ea['as'],'attributes':_0x2d52ea[_0xbb10('0x1b')],'include':_0x2d52ea[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x2d52ea[_0xbb10('0x1c')],function(_0x174395){return{'model':db[_0x174395['model']],'as':_0x174395['as'],'attributes':_0x174395[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x30f3ea){var _0x322b41=[];for(var _0x37b20e=0x0;_0x37b20e<_0x30f3ea[_0xbb10('0x38')];_0x37b20e+=0x1){_0x322b41[_0xbb10('0x39')](_0x30f3ea[_0x37b20e][_0xbb10('0x25')](_0xd9e743['body'],{'transaction':_0x5bfc68}));}return BPromise[_0xbb10('0x44')](_0x322b41);});})[_0xbb10('0xc')](function(_0x145baf){logger['info']('GetContactRecallMe',_0xd9e743);logger['debug'](_0xbb10('0x43'),_0xd9e743,JSON['stringify'](_0x145baf));_0x260e06(_0x145baf);})['catch'](function(_0x1701c5){logger[_0xbb10('0x12')](_0xbb10('0x43'),_0x1701c5[_0xbb10('0x13')],_0xd9e743);_0x1ad2ed(_0x3a9677[_0xbb10('0x12')](0x1f4,_0x1701c5[_0xbb10('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 7efe1ec..77b4cb2 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 _0x17a7=['/preview','getPreview','update','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/opencontacts','getOpenContacts','/:id','show','create','post'];(function(_0x24125b,_0x1b3316){var _0xe9ad40=function(_0x15beea){while(--_0x15beea){_0x24125b['push'](_0x24125b['shift']());}};_0xe9ad40(++_0x1b3316);}(_0x17a7,0xc2));var _0x717a=function(_0x27fbd1,_0x3f307e){_0x27fbd1=_0x27fbd1-0x0;var _0xb35c63=_0x17a7[_0x27fbd1];return _0xb35c63;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x717a('0x0'));var express=require(_0x717a('0x1'));var router=express[_0x717a('0x2')]();var auth=require(_0x717a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x717a('0x4'));var controller=require('./cmHopper.controller');router[_0x717a('0x5')]('/',auth[_0x717a('0x6')](),controller['index']);router[_0x717a('0x5')](_0x717a('0x7'),auth[_0x717a('0x6')](),controller[_0x717a('0x8')]);router['get'](_0x717a('0x9'),auth['isAuthenticated'](),controller[_0x717a('0xa')]);router['get'](_0x717a('0xb'),auth[_0x717a('0x6')](),controller[_0x717a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x717a('0xd')]);router[_0x717a('0xe')](_0x717a('0xf'),auth[_0x717a('0x6')](),controller[_0x717a('0x10')]);router['put'](_0x717a('0xb'),auth['isAuthenticated'](),controller[_0x717a('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x717a('0x12')]=router; \ No newline at end of file +var _0xc692=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','getOpenContacts','post','create','/preview','getPreview','put','delete','/:id','destroy','exports','multer'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xc692,0x15f));var _0x2c69=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xc692[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x2c69('0x0'));var util=require(_0x2c69('0x1'));var path=require(_0x2c69('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c69('0x3')]();var auth=require(_0x2c69('0x4'));var interaction=require(_0x2c69('0x5'));var config=require(_0x2c69('0x6'));var controller=require(_0x2c69('0x7'));router[_0x2c69('0x8')]('/',auth[_0x2c69('0x9')](),controller['index']);router[_0x2c69('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x2c69('0xa')]);router[_0x2c69('0x8')](_0x2c69('0xb'),auth[_0x2c69('0x9')](),controller[_0x2c69('0xc')]);router[_0x2c69('0x8')]('/:id',auth[_0x2c69('0x9')](),controller['show']);router[_0x2c69('0xd')]('/',auth['isAuthenticated'](),controller[_0x2c69('0xe')]);router[_0x2c69('0xd')](_0x2c69('0xf'),auth[_0x2c69('0x9')](),controller[_0x2c69('0x10')]);router[_0x2c69('0x11')]('/:id',auth[_0x2c69('0x9')](),controller['update']);router[_0x2c69('0x12')](_0x2c69('0x13'),auth[_0x2c69('0x9')](),controller[_0x2c69('0x14')]);module[_0x2c69('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 304c9b5..2feab01 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 _0x1cd7=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x1cd7,0x1ad));var _0x71cd=function(_0x219b38,_0x48f334){_0x219b38=_0x219b38-0x0;var _0xb043f1=_0x1cd7[_0x219b38];return _0xb043f1;};'use strict';var moment=require(_0x71cd('0x0'));var Sequelize=require(_0x71cd('0x1'));module['exports']={'phone':{'type':Sequelize[_0x71cd('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x71cd('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x71cd('0x3')],'unique':_0x71cd('0x4')},'VoiceQueueId':{'type':Sequelize[_0x71cd('0x3')],'unique':_0x71cd('0x4')}}; \ No newline at end of file +var _0xddce=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x147715,_0x3406f){var _0x49f4b1=function(_0x4014a9){while(--_0x4014a9){_0x147715['push'](_0x147715['shift']());}};_0x49f4b1(++_0x3406f);}(_0xddce,0x1e3));var _0xeddc=function(_0xa88898,_0x1a1f15){_0xa88898=_0xa88898-0x0;var _0x339157=_0xddce[_0xa88898];return _0x339157;};'use strict';var moment=require(_0xeddc('0x0'));var Sequelize=require(_0xeddc('0x1'));module[_0xeddc('0x2')]={'phone':{'type':Sequelize[_0xeddc('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xeddc('0x4')],'unique':_0xeddc('0x5')},'ListId':{'type':Sequelize[_0xeddc('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xeddc('0x4')],'unique':_0xeddc('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 16212e9..ab5b06f 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 _0x9ab9=['end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x5b5199,_0x356ab1){var _0x8101f9=function(_0x2b0b4a){while(--_0x2b0b4a){_0x5b5199['push'](_0x5b5199['shift']());}};_0x8101f9(++_0x356ab1);}(_0x9ab9,0x19d));var _0x99ab=function(_0x31da22,_0xd4dce6){_0x31da22=_0x31da22-0x0;var _0x5216b5=_0x9ab9[_0x31da22];return _0x5216b5;};'use strict';var pdf=require(_0x99ab('0x0'));var emlformat=require(_0x99ab('0x1'));var rimraf=require(_0x99ab('0x2'));var zipdir=require(_0x99ab('0x3'));var jsonpatch=require(_0x99ab('0x4'));var rp=require('request-promise');var moment=require(_0x99ab('0x5'));var BPromise=require(_0x99ab('0x6'));var Mustache=require('mustache');var util=require(_0x99ab('0x7'));var path=require('path');var sox=require(_0x99ab('0x8'));var csv=require(_0x99ab('0x9'));var ejs=require(_0x99ab('0xa'));var fs=require('fs');var _=require(_0x99ab('0xb'));var squel=require(_0x99ab('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99ab('0xd'));var toCsv=require(_0x99ab('0x9'));var querystring=require('querystring');var Papa=require(_0x99ab('0xe'));var Redis=require(_0x99ab('0xf'));var authService=require(_0x99ab('0x10'));var qs=require(_0x99ab('0x11'));var as=require(_0x99ab('0x12'));var hardwareService=require(_0x99ab('0x13'));var logger=require('../../config/logger')(_0x99ab('0x14'));var utils=require(_0x99ab('0x15'));var config=require(_0x99ab('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e7b4a,_0xed2100){_0xed2100=_0xed2100||0xcc;return function(_0x24229c){if(_0x24229c){return _0x4e7b4a[_0x99ab('0x17')](_0xed2100);}return _0x4e7b4a[_0x99ab('0x18')](_0xed2100)[_0x99ab('0x19')]();};}function respondWithResult(_0x536af1,_0x584744){_0x584744=_0x584744||0xc8;return function(_0x97639f){if(_0x97639f){return _0x536af1[_0x99ab('0x18')](_0x584744)['json'](_0x97639f);}};}function respondWithFilteredResult(_0x381959,_0x36d89e){return function(_0xa60b53){if(_0xa60b53){var _0x4b11f1=_0xa60b53[_0x99ab('0x1a')],_0x4299ae=_0x36d89e[_0x99ab('0x1b')],_0x13b9aa=_0x36d89e[_0x99ab('0x1b')]+_0x36d89e[_0x99ab('0x1c')],_0x1c52a6;if(_0x13b9aa>=_0x4b11f1){_0x13b9aa=_0x4b11f1;_0x1c52a6=0xc8;}else{_0x1c52a6=0xce;}_0x381959[_0x99ab('0x18')](_0x1c52a6);return _0x381959['set'](_0x99ab('0x1d'),_0x4299ae+'-'+_0x13b9aa+'/'+_0x4b11f1)[_0x99ab('0x1e')](_0xa60b53);}return null;};}function patchUpdates(_0x4193c0){return function(_0x1cdd6d){try{jsonpatch[_0x99ab('0x1f')](_0x1cdd6d,_0x4193c0,!![]);}catch(_0x414cfe){return BPromise[_0x99ab('0x20')](_0x414cfe);}return _0x1cdd6d[_0x99ab('0x21')]();};}function saveUpdates(_0x2d67c3,_0x51ded6){return function(_0x5ab547){if(_0x5ab547){return _0x5ab547[_0x99ab('0x22')](_0x2d67c3)[_0x99ab('0x23')](function(_0x194f39){return _0x194f39;});}return null;};}function removeEntity(_0x4e7647,_0x2e0464){return function(_0x3a0897){if(_0x3a0897){return _0x3a0897[_0x99ab('0x24')]()[_0x99ab('0x23')](function(){_0x4e7647[_0x99ab('0x18')](0xcc)[_0x99ab('0x19')]();});}};}function handleEntityNotFound(_0x2fd2df,_0x5411a6){return function(_0x5de675){if(!_0x5de675){_0x2fd2df['sendStatus'](0x194);}return _0x5de675;};}function handleError(_0x461f2f,_0x56bdb7){_0x56bdb7=_0x56bdb7||0x1f4;return function(_0x4e52db){logger[_0x99ab('0x25')](_0x4e52db[_0x99ab('0x26')]);if(_0x4e52db[_0x99ab('0x27')]){delete _0x4e52db['name'];}_0x461f2f[_0x99ab('0x18')](_0x56bdb7)[_0x99ab('0x28')](_0x4e52db);};}exports[_0x99ab('0x29')]=function(_0x3a9909,_0x36414c){var _0x45d50e={},_0x970ce7={},_0x2efec3={'count':0x0,'rows':[]};var _0xe3945b=_['map'](db[_0x99ab('0x2a')][_0x99ab('0x2b')],function(_0x50ffdc){return{'name':_0x50ffdc[_0x99ab('0x2c')],'type':_0x50ffdc[_0x99ab('0x2d')][_0x99ab('0x2e')]};});_0x970ce7['model']=_['map'](_0xe3945b,_0x99ab('0x27'));_0x970ce7[_0x99ab('0x2f')]=_[_0x99ab('0x30')](_0x3a9909[_0x99ab('0x2f')]);_0x970ce7[_0x99ab('0x31')]=_[_0x99ab('0x32')](_0x970ce7[_0x99ab('0x33')],_0x970ce7[_0x99ab('0x2f')]);_0x45d50e['attributes']=_[_0x99ab('0x32')](_0x970ce7[_0x99ab('0x33')],qs['fields'](_0x3a9909[_0x99ab('0x2f')][_0x99ab('0x34')]));_0x45d50e['attributes']=_0x45d50e['attributes'][_0x99ab('0x35')]?_0x45d50e[_0x99ab('0x36')]:_0x970ce7[_0x99ab('0x33')];if(!_0x3a9909['query']['hasOwnProperty']('nolimit')){_0x45d50e['limit']=qs['limit'](_0x3a9909['query'][_0x99ab('0x1c')]);_0x45d50e[_0x99ab('0x1b')]=qs[_0x99ab('0x1b')](_0x3a9909['query'][_0x99ab('0x1b')]);}_0x45d50e[_0x99ab('0x37')]=qs[_0x99ab('0x38')](_0x3a9909['query'][_0x99ab('0x38')]);_0x45d50e[_0x99ab('0x39')]=qs[_0x99ab('0x31')](_[_0x99ab('0x3a')](_0x3a9909[_0x99ab('0x2f')],_0x970ce7[_0x99ab('0x31')]));if(_0x3a9909[_0x99ab('0x2f')]['filter']){_0x45d50e['where']=_[_0x99ab('0x3b')](_0x45d50e[_0x99ab('0x39')],{'$or':_['map'](_0xe3945b,function(_0x2a70ae){if(_0x2a70ae[_0x99ab('0x2d')]!==_0x99ab('0x3c')){var _0x581896={};_0x581896[_0x2a70ae[_0x99ab('0x27')]]={'$like':'%'+_0x3a9909[_0x99ab('0x2f')][_0x99ab('0x3d')]+'%'};return _0x581896;}})});}_0x45d50e=_[_0x99ab('0x3b')]({},_0x45d50e,_0x3a9909[_0x99ab('0x3e')]);var _0x532763={'where':_0x45d50e[_0x99ab('0x39')]};return db[_0x99ab('0x2a')]['count'](_0x532763)[_0x99ab('0x23')](function(_0x4f8b80){_0x2efec3[_0x99ab('0x1a')]=_0x4f8b80;if(_0x3a9909[_0x99ab('0x2f')][_0x99ab('0x3f')]){_0x45d50e[_0x99ab('0x40')]=[{'all':!![]}];}return db[_0x99ab('0x2a')][_0x99ab('0x41')](_0x45d50e);})[_0x99ab('0x23')](function(_0xb3529b){_0x2efec3[_0x99ab('0x42')]=_0xb3529b;return _0x2efec3;})[_0x99ab('0x23')](respondWithFilteredResult(_0x36414c,_0x45d50e))['catch'](handleError(_0x36414c,null));};exports[_0x99ab('0x43')]=function(_0x295276,_0x4e6a11){var _0x13c94f={'raw':!![],'where':{'id':_0x295276[_0x99ab('0x44')]['id']}},_0x5c6f5f={};_0x5c6f5f['model']=_[_0x99ab('0x30')](db[_0x99ab('0x2a')][_0x99ab('0x2b')]);_0x5c6f5f[_0x99ab('0x2f')]=_['keys'](_0x295276[_0x99ab('0x2f')]);_0x5c6f5f[_0x99ab('0x31')]=_[_0x99ab('0x32')](_0x5c6f5f[_0x99ab('0x33')],_0x5c6f5f[_0x99ab('0x2f')]);_0x13c94f[_0x99ab('0x36')]=_[_0x99ab('0x32')](_0x5c6f5f[_0x99ab('0x33')],qs[_0x99ab('0x34')](_0x295276[_0x99ab('0x2f')][_0x99ab('0x34')]));_0x13c94f[_0x99ab('0x36')]=_0x13c94f[_0x99ab('0x36')][_0x99ab('0x35')]?_0x13c94f[_0x99ab('0x36')]:_0x5c6f5f['model'];if(_0x295276[_0x99ab('0x2f')][_0x99ab('0x3f')]){_0x13c94f['include']=[{'all':!![]}];}_0x13c94f=_[_0x99ab('0x3b')]({},_0x13c94f,_0x295276[_0x99ab('0x3e')]);return db[_0x99ab('0x2a')][_0x99ab('0x45')](_0x13c94f)[_0x99ab('0x23')](handleEntityNotFound(_0x4e6a11,null))[_0x99ab('0x23')](respondWithResult(_0x4e6a11,null))[_0x99ab('0x46')](handleError(_0x4e6a11,null));};exports[_0x99ab('0x22')]=function(_0x321143,_0x104657){if(_0x321143[_0x99ab('0x47')]['id']){delete _0x321143['body']['id'];}return db[_0x99ab('0x2a')][_0x99ab('0x45')]({'where':{'id':_0x321143[_0x99ab('0x44')]['id']}})[_0x99ab('0x23')](handleEntityNotFound(_0x104657,null))['then'](saveUpdates(_0x321143['body'],null))[_0x99ab('0x23')](respondWithResult(_0x104657,null))['catch'](handleError(_0x104657,null));};exports[_0x99ab('0x24')]=function(_0xd44d36,_0x241345){return db[_0x99ab('0x2a')][_0x99ab('0x45')]({'where':{'id':_0xd44d36[_0x99ab('0x44')]['id']}})[_0x99ab('0x23')](handleEntityNotFound(_0x241345,null))['then'](removeEntity(_0x241345,null))[_0x99ab('0x46')](handleError(_0x241345,null));};exports[_0x99ab('0x48')]=function(_0x78eb5e,_0x436f84){return db[_0x99ab('0x2a')][_0x99ab('0x48')]()[_0x99ab('0x23')](respondWithResult(_0x436f84,null))[_0x99ab('0x46')](handleError(_0x436f84,null));}; \ No newline at end of file +var _0x3c91=['update','body','find','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','offset','order','sort','filters','pick','filter','merge','where','name','options','CmHopperBlack','includeAll','include','findAll','rows','catch'];(function(_0x2b432f,_0x1525e2){var _0x27b15f=function(_0x3f8d49){while(--_0x3f8d49){_0x2b432f['push'](_0x2b432f['shift']());}};_0x27b15f(++_0x1525e2);}(_0x3c91,0x1af));var _0x13c9=function(_0x5a0f7d,_0x38f380){_0x5a0f7d=_0x5a0f7d-0x0;var _0x4a2a25=_0x3c91[_0x5a0f7d];return _0x4a2a25;};'use strict';var pdf=require(_0x13c9('0x0'));var emlformat=require(_0x13c9('0x1'));var rimraf=require(_0x13c9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x13c9('0x3'));var moment=require(_0x13c9('0x4'));var BPromise=require(_0x13c9('0x5'));var Mustache=require('mustache');var util=require(_0x13c9('0x6'));var path=require(_0x13c9('0x7'));var sox=require(_0x13c9('0x8'));var csv=require(_0x13c9('0x9'));var ejs=require(_0x13c9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x13c9('0xb'));var jsforce=require(_0x13c9('0xc'));var deskjs=require(_0x13c9('0xd'));var toCsv=require(_0x13c9('0x9'));var querystring=require(_0x13c9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x13c9('0xf'));var qs=require(_0x13c9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x13c9('0x11'))(_0x13c9('0x12'));var utils=require(_0x13c9('0x13'));var config=require(_0x13c9('0x14'));var db=require(_0x13c9('0x15'))['db'];function respondWithStatusCode(_0x25eac0,_0x1f63b8){_0x1f63b8=_0x1f63b8||0xcc;return function(_0x4a5f84){if(_0x4a5f84){return _0x25eac0[_0x13c9('0x16')](_0x1f63b8);}return _0x25eac0['status'](_0x1f63b8)['end']();};}function respondWithResult(_0x5a5690,_0x4b528e){_0x4b528e=_0x4b528e||0xc8;return function(_0x5c1814){if(_0x5c1814){return _0x5a5690[_0x13c9('0x17')](_0x4b528e)[_0x13c9('0x18')](_0x5c1814);}};}function respondWithFilteredResult(_0x52abdd,_0x4f46c1){return function(_0x3daab9){if(_0x3daab9){var _0xa59ee9=_0x3daab9[_0x13c9('0x19')],_0x1c9601=_0x4f46c1['offset'],_0xb269f4=_0x4f46c1['offset']+_0x4f46c1['limit'],_0x170c98;if(_0xb269f4>=_0xa59ee9){_0xb269f4=_0xa59ee9;_0x170c98=0xc8;}else{_0x170c98=0xce;}_0x52abdd[_0x13c9('0x17')](_0x170c98);return _0x52abdd[_0x13c9('0x1a')](_0x13c9('0x1b'),_0x1c9601+'-'+_0xb269f4+'/'+_0xa59ee9)[_0x13c9('0x18')](_0x3daab9);}return null;};}function patchUpdates(_0x3b6c1a){return function(_0x4dd6ae){try{jsonpatch[_0x13c9('0x1c')](_0x4dd6ae,_0x3b6c1a,!![]);}catch(_0x44d38a){return BPromise[_0x13c9('0x1d')](_0x44d38a);}return _0x4dd6ae[_0x13c9('0x1e')]();};}function saveUpdates(_0x6fc26f,_0x329c69){return function(_0x3e5d04){if(_0x3e5d04){return _0x3e5d04['update'](_0x6fc26f)[_0x13c9('0x1f')](function(_0xed27ee){return _0xed27ee;});}return null;};}function removeEntity(_0x224535,_0x254636){return function(_0x27ebb6){if(_0x27ebb6){return _0x27ebb6[_0x13c9('0x20')]()[_0x13c9('0x1f')](function(){_0x224535[_0x13c9('0x17')](0xcc)[_0x13c9('0x21')]();});}};}function handleEntityNotFound(_0x3c3366,_0x5dfd9d){return function(_0x63df88){if(!_0x63df88){_0x3c3366[_0x13c9('0x16')](0x194);}return _0x63df88;};}function handleError(_0x25c866,_0x36f4b2){_0x36f4b2=_0x36f4b2||0x1f4;return function(_0x263171){logger['error'](_0x263171[_0x13c9('0x22')]);if(_0x263171['name']){delete _0x263171['name'];}_0x25c866[_0x13c9('0x17')](_0x36f4b2)[_0x13c9('0x23')](_0x263171);};}exports[_0x13c9('0x24')]=function(_0x5d0113,_0x362cb7){var _0x445486={},_0x3fcf1c={},_0x447c76={'count':0x0,'rows':[]};var _0x2beb6e=_[_0x13c9('0x25')](db['CmHopperBlack'][_0x13c9('0x26')],function(_0x21dbac){return{'name':_0x21dbac['fieldName'],'type':_0x21dbac[_0x13c9('0x27')][_0x13c9('0x28')]};});_0x3fcf1c[_0x13c9('0x29')]=_['map'](_0x2beb6e,'name');_0x3fcf1c[_0x13c9('0x2a')]=_[_0x13c9('0x2b')](_0x5d0113[_0x13c9('0x2a')]);_0x3fcf1c['filters']=_[_0x13c9('0x2c')](_0x3fcf1c[_0x13c9('0x29')],_0x3fcf1c[_0x13c9('0x2a')]);_0x445486[_0x13c9('0x2d')]=_[_0x13c9('0x2c')](_0x3fcf1c['model'],qs[_0x13c9('0x2e')](_0x5d0113[_0x13c9('0x2a')][_0x13c9('0x2e')]));_0x445486[_0x13c9('0x2d')]=_0x445486[_0x13c9('0x2d')][_0x13c9('0x2f')]?_0x445486[_0x13c9('0x2d')]:_0x3fcf1c['model'];if(!_0x5d0113[_0x13c9('0x2a')][_0x13c9('0x30')]('nolimit')){_0x445486[_0x13c9('0x31')]=qs[_0x13c9('0x31')](_0x5d0113[_0x13c9('0x2a')][_0x13c9('0x31')]);_0x445486[_0x13c9('0x32')]=qs[_0x13c9('0x32')](_0x5d0113['query']['offset']);}_0x445486[_0x13c9('0x33')]=qs[_0x13c9('0x34')](_0x5d0113[_0x13c9('0x2a')][_0x13c9('0x34')]);_0x445486['where']=qs[_0x13c9('0x35')](_[_0x13c9('0x36')](_0x5d0113['query'],_0x3fcf1c[_0x13c9('0x35')]));if(_0x5d0113[_0x13c9('0x2a')][_0x13c9('0x37')]){_0x445486['where']=_[_0x13c9('0x38')](_0x445486[_0x13c9('0x39')],{'$or':_[_0x13c9('0x25')](_0x2beb6e,function(_0x443c00){if(_0x443c00['type']!=='VIRTUAL'){var _0x40207c={};_0x40207c[_0x443c00[_0x13c9('0x3a')]]={'$like':'%'+_0x5d0113['query'][_0x13c9('0x37')]+'%'};return _0x40207c;}})});}_0x445486=_[_0x13c9('0x38')]({},_0x445486,_0x5d0113[_0x13c9('0x3b')]);var _0x1b9ef6={'where':_0x445486[_0x13c9('0x39')]};return db[_0x13c9('0x3c')][_0x13c9('0x19')](_0x1b9ef6)[_0x13c9('0x1f')](function(_0x537e80){_0x447c76['count']=_0x537e80;if(_0x5d0113[_0x13c9('0x2a')][_0x13c9('0x3d')]){_0x445486[_0x13c9('0x3e')]=[{'all':!![]}];}return db[_0x13c9('0x3c')][_0x13c9('0x3f')](_0x445486);})[_0x13c9('0x1f')](function(_0x53c8f8){_0x447c76[_0x13c9('0x40')]=_0x53c8f8;return _0x447c76;})[_0x13c9('0x1f')](respondWithFilteredResult(_0x362cb7,_0x445486))[_0x13c9('0x41')](handleError(_0x362cb7,null));};exports['show']=function(_0x14705b,_0x298084){var _0x1269da={'raw':!![],'where':{'id':_0x14705b['params']['id']}},_0x1adfeb={};_0x1adfeb[_0x13c9('0x29')]=_[_0x13c9('0x2b')](db['CmHopperBlack'][_0x13c9('0x26')]);_0x1adfeb['query']=_['keys'](_0x14705b[_0x13c9('0x2a')]);_0x1adfeb[_0x13c9('0x35')]=_[_0x13c9('0x2c')](_0x1adfeb[_0x13c9('0x29')],_0x1adfeb[_0x13c9('0x2a')]);_0x1269da['attributes']=_[_0x13c9('0x2c')](_0x1adfeb[_0x13c9('0x29')],qs[_0x13c9('0x2e')](_0x14705b[_0x13c9('0x2a')][_0x13c9('0x2e')]));_0x1269da[_0x13c9('0x2d')]=_0x1269da[_0x13c9('0x2d')][_0x13c9('0x2f')]?_0x1269da[_0x13c9('0x2d')]:_0x1adfeb[_0x13c9('0x29')];if(_0x14705b[_0x13c9('0x2a')][_0x13c9('0x3d')]){_0x1269da['include']=[{'all':!![]}];}_0x1269da=_[_0x13c9('0x38')]({},_0x1269da,_0x14705b[_0x13c9('0x3b')]);return db[_0x13c9('0x3c')]['find'](_0x1269da)['then'](handleEntityNotFound(_0x298084,null))[_0x13c9('0x1f')](respondWithResult(_0x298084,null))[_0x13c9('0x41')](handleError(_0x298084,null));};exports[_0x13c9('0x42')]=function(_0x2e37f2,_0x5db972){if(_0x2e37f2[_0x13c9('0x43')]['id']){delete _0x2e37f2[_0x13c9('0x43')]['id'];}return db['CmHopperBlack'][_0x13c9('0x44')]({'where':{'id':_0x2e37f2[_0x13c9('0x45')]['id']}})[_0x13c9('0x1f')](handleEntityNotFound(_0x5db972,null))[_0x13c9('0x1f')](saveUpdates(_0x2e37f2[_0x13c9('0x43')],null))['then'](respondWithResult(_0x5db972,null))[_0x13c9('0x41')](handleError(_0x5db972,null));};exports['destroy']=function(_0x2a810b,_0x394b42){return db['CmHopperBlack'][_0x13c9('0x44')]({'where':{'id':_0x2a810b[_0x13c9('0x45')]['id']}})[_0x13c9('0x1f')](handleEntityNotFound(_0x394b42,null))[_0x13c9('0x1f')](removeEntity(_0x394b42,null))[_0x13c9('0x41')](handleError(_0x394b42,null));};exports[_0x13c9('0x46')]=function(_0x24907f,_0x10c4f8){return db[_0x13c9('0x3c')][_0x13c9('0x46')]()['then'](respondWithResult(_0x10c4f8,null))[_0x13c9('0x41')](handleError(_0x10c4f8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 7940bee..eeae4cd 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 _0xd2bd=['bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util','../../config/logger','api'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xd2bd,0x14c));var _0xdd2b=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xd2bd[_0x24259d];return _0x5a701;};'use strict';var _=require(_0xdd2b('0x0'));var util=require(_0xdd2b('0x1'));var logger=require(_0xdd2b('0x2'))(_0xdd2b('0x3'));var moment=require('moment');var BPromise=require(_0xdd2b('0x4'));var rp=require(_0xdd2b('0x5'));var fs=require('fs');var path=require(_0xdd2b('0x6'));var rimraf=require(_0xdd2b('0x7'));var config=require('../../config/environment');var attributes=require(_0xdd2b('0x8'));module[_0xdd2b('0x9')]=function(_0x4f9409,_0x3d4aa0){return _0x4f9409[_0xdd2b('0xa')]('CmHopperBlack',attributes,{'tableName':_0xdd2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3b4=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util'];(function(_0x345121,_0x2ab321){var _0xc02253=function(_0x2f169b){while(--_0x2f169b){_0x345121['push'](_0x345121['shift']());}};_0xc02253(++_0x2ab321);}(_0xe3b4,0xa7));var _0x4e3b=function(_0x502a32,_0x23d261){_0x502a32=_0x502a32-0x0;var _0x30191c=_0xe3b4[_0x502a32];return _0x30191c;};'use strict';var _=require('lodash');var util=require(_0x4e3b('0x0'));var logger=require(_0x4e3b('0x1'))('api');var moment=require(_0x4e3b('0x2'));var BPromise=require(_0x4e3b('0x3'));var rp=require(_0x4e3b('0x4'));var fs=require('fs');var path=require(_0x4e3b('0x5'));var rimraf=require(_0x4e3b('0x6'));var config=require('../../config/environment');var attributes=require(_0x4e3b('0x7'));module[_0x4e3b('0x8')]=function(_0x59994c,_0x4c3fbf){return _0x59994c[_0x4e3b('0x9')](_0x4e3b('0xa'),attributes,{'tableName':_0x4e3b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index a99fd44..6e41d92 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 _0xf162=['stringify','UpdateCmHopperBlack','CmHopperBlack','update','body','where','DestroyCmHopperBlack','destroy','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','CmHopperBlack,\x20%s,\x20%s','catch','GetCmHopperBlack','findAll','options','raw','attributes','limit','map','include','model'];(function(_0x5c2d83,_0x3ac3d0){var _0x2dcb23=function(_0x40247f){while(--_0x40247f){_0x5c2d83['push'](_0x5c2d83['shift']());}};_0x2dcb23(++_0x3ac3d0);}(_0xf162,0xec));var _0x2f16=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf162[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x2f16('0x0'));var util=require(_0x2f16('0x1'));var moment=require('moment');var BPromise=require(_0x2f16('0x2'));var rs=require(_0x2f16('0x3'));var fs=require('fs');var Redis=require(_0x2f16('0x4'));var db=require(_0x2f16('0x5'))['db'];var utils=require(_0x2f16('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f16('0x7'));var jayson=require(_0x2f16('0x8'));var client=jayson['client'][_0x2f16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36fe7f,_0x38640f,_0x25e39f){return new BPromise(function(_0x5766ca,_0x5ccb6c){return client[_0x2f16('0xa')](_0x36fe7f,_0x25e39f)[_0x2f16('0xb')](function(_0x4fa51b){logger[_0x2f16('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x38640f,'request\x20sent');logger[_0x2f16('0xd')](_0x2f16('0xe'),_0x38640f,_0x2f16('0xf'),JSON['stringify'](_0x4fa51b));if(_0x4fa51b[_0x2f16('0x10')]){if(_0x4fa51b['error'][_0x2f16('0x11')]===0x1f4){logger[_0x2f16('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x38640f,_0x4fa51b[_0x2f16('0x10')][_0x2f16('0x12')]);return _0x5ccb6c(_0x4fa51b[_0x2f16('0x10')][_0x2f16('0x12')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x38640f,_0x4fa51b['error']['message']);return _0x5766ca(_0x4fa51b[_0x2f16('0x10')][_0x2f16('0x12')]);}else{logger[_0x2f16('0xc')](_0x2f16('0x13'),_0x38640f,_0x2f16('0xf'));_0x5766ca(_0x4fa51b['result'][_0x2f16('0x12')]);}})[_0x2f16('0x14')](function(_0x339900){logger[_0x2f16('0x10')](_0x2f16('0x13'),_0x38640f,_0x339900);_0x5ccb6c(_0x339900);});});}exports[_0x2f16('0x15')]=function(_0x51f3de){var _0x53ad10=this;return new Promise(function(_0x2fd708,_0x3cdbf1){return db['CmHopperBlack'][_0x2f16('0x16')]({'raw':_0x51f3de[_0x2f16('0x17')]?_0x51f3de[_0x2f16('0x17')][_0x2f16('0x18')]===undefined?!![]:![]:!![],'where':_0x51f3de[_0x2f16('0x17')]?_0x51f3de[_0x2f16('0x17')]['where']||null:null,'attributes':_0x51f3de[_0x2f16('0x17')]?_0x51f3de[_0x2f16('0x17')][_0x2f16('0x19')]||null:null,'limit':_0x51f3de['options']?_0x51f3de[_0x2f16('0x17')][_0x2f16('0x1a')]||null:null,'include':_0x51f3de[_0x2f16('0x17')]?_0x51f3de['options']['include']?_[_0x2f16('0x1b')](_0x51f3de[_0x2f16('0x17')][_0x2f16('0x1c')],function(_0x4672bc){return{'model':db[_0x4672bc['model']],'as':_0x4672bc['as'],'attributes':_0x4672bc[_0x2f16('0x19')],'include':_0x4672bc[_0x2f16('0x1c')]?_[_0x2f16('0x1b')](_0x4672bc[_0x2f16('0x1c')],function(_0x8d0ceb){return{'model':db[_0x8d0ceb[_0x2f16('0x1d')]],'as':_0x8d0ceb['as'],'attributes':_0x8d0ceb[_0x2f16('0x19')],'include':_0x8d0ceb['include']?_[_0x2f16('0x1b')](_0x8d0ceb[_0x2f16('0x1c')],function(_0x201c6e){return{'model':db[_0x201c6e[_0x2f16('0x1d')]],'as':_0x201c6e['as'],'attributes':_0x201c6e[_0x2f16('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2f16('0xb')](function(_0x360a81){logger['info']('GetCmHopperBlack',_0x51f3de);logger[_0x2f16('0xd')](_0x2f16('0x15'),_0x51f3de,JSON[_0x2f16('0x1e')](_0x360a81));_0x2fd708(_0x360a81);})[_0x2f16('0x14')](function(_0x593ecd){logger[_0x2f16('0x10')](_0x2f16('0x15'),_0x593ecd[_0x2f16('0x12')],_0x51f3de);_0x3cdbf1(_0x53ad10[_0x2f16('0x10')](0x1f4,_0x593ecd[_0x2f16('0x12')]));});});};exports[_0x2f16('0x1f')]=function(_0x207803){var _0x2a1361=this;return new Promise(function(_0x5a7451,_0x5da5ab){return db[_0x2f16('0x20')][_0x2f16('0x21')](_0x207803[_0x2f16('0x22')],{'raw':_0x207803[_0x2f16('0x17')]?_0x207803[_0x2f16('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x207803[_0x2f16('0x17')]?_0x207803[_0x2f16('0x17')][_0x2f16('0x23')]||null:null,'attributes':_0x207803['options']?_0x207803[_0x2f16('0x17')][_0x2f16('0x19')]||null:null,'limit':_0x207803[_0x2f16('0x17')]?_0x207803[_0x2f16('0x17')][_0x2f16('0x1a')]||null:null})[_0x2f16('0xb')](function(_0x34c86b){logger[_0x2f16('0xc')](_0x2f16('0x1f'),_0x207803);logger[_0x2f16('0xd')](_0x2f16('0x1f'),_0x207803,JSON[_0x2f16('0x1e')](_0x34c86b));_0x5a7451(_0x34c86b);})[_0x2f16('0x14')](function(_0x5bba7a){logger[_0x2f16('0x10')](_0x2f16('0x1f'),_0x5bba7a['message'],_0x207803);_0x5da5ab(_0x2a1361[_0x2f16('0x10')](0x1f4,_0x5bba7a['message']));});});};exports[_0x2f16('0x24')]=function(_0x139eb9){var _0x10dc5e=this;return new Promise(function(_0x4f5eb8,_0x240c6d){return db[_0x2f16('0x20')][_0x2f16('0x25')]({'where':_0x139eb9[_0x2f16('0x17')]?_0x139eb9[_0x2f16('0x17')][_0x2f16('0x23')]||null:null})[_0x2f16('0xb')](function(_0x4600a1){logger[_0x2f16('0xc')](_0x2f16('0x24'),_0x139eb9);logger[_0x2f16('0xd')](_0x2f16('0x24'),_0x139eb9,JSON[_0x2f16('0x1e')](_0x4600a1));_0x4f5eb8(_0x4600a1);})['catch'](function(_0x51d81f){logger[_0x2f16('0x10')](_0x2f16('0x24'),_0x51d81f[_0x2f16('0x12')],_0x139eb9);_0x240c6d(_0x10dc5e[_0x2f16('0x10')](0x1f4,_0x51d81f['message']));});});}; \ No newline at end of file +var _0x8bdc=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','error','CmHopperBlack,\x20%s,\x20%s','message','result','GetCmHopperBlack','CmHopperBlack','options','where','limit','include','map','model','attributes','catch','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','util'];(function(_0x13757b,_0x264db0){var _0x1a8c92=function(_0x2f8cdf){while(--_0x2f8cdf){_0x13757b['push'](_0x13757b['shift']());}};_0x1a8c92(++_0x264db0);}(_0x8bdc,0x6d));var _0xc8bd=function(_0x16a5e2,_0x17000c){_0x16a5e2=_0x16a5e2-0x0;var _0x4ff47d=_0x8bdc[_0x16a5e2];return _0x4ff47d;};'use strict';var _=require(_0xc8bd('0x0'));var util=require(_0xc8bd('0x1'));var moment=require(_0xc8bd('0x2'));var BPromise=require(_0xc8bd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8bd('0x4'));var db=require(_0xc8bd('0x5'))['db'];var utils=require(_0xc8bd('0x6'));var logger=require('../../config/logger')(_0xc8bd('0x7'));var config=require(_0xc8bd('0x8'));var jayson=require(_0xc8bd('0x9'));var client=jayson[_0xc8bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50d15c,_0x4685b9,_0x2a5d78){return new BPromise(function(_0xead133,_0x57539e){return client['request'](_0x50d15c,_0x2a5d78)[_0xc8bd('0xb')](function(_0x5a76e3){logger[_0xc8bd('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x4685b9,_0xc8bd('0xd'));logger[_0xc8bd('0xe')](_0xc8bd('0xf'),_0x4685b9,_0xc8bd('0xd'),JSON[_0xc8bd('0x10')](_0x5a76e3));if(_0x5a76e3['error']){if(_0x5a76e3['error'][_0xc8bd('0x11')]===0x1f4){logger[_0xc8bd('0x12')](_0xc8bd('0x13'),_0x4685b9,_0x5a76e3[_0xc8bd('0x12')][_0xc8bd('0x14')]);return _0x57539e(_0x5a76e3['error'][_0xc8bd('0x14')]);}logger[_0xc8bd('0x12')](_0xc8bd('0x13'),_0x4685b9,_0x5a76e3[_0xc8bd('0x12')][_0xc8bd('0x14')]);return _0xead133(_0x5a76e3[_0xc8bd('0x12')][_0xc8bd('0x14')]);}else{logger[_0xc8bd('0xc')](_0xc8bd('0x13'),_0x4685b9,'request\x20sent');_0xead133(_0x5a76e3[_0xc8bd('0x15')][_0xc8bd('0x14')]);}})['catch'](function(_0x474d73){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x4685b9,_0x474d73);_0x57539e(_0x474d73);});});}exports[_0xc8bd('0x16')]=function(_0x1c3e61){var _0xbd3042=this;return new Promise(function(_0x2de99b,_0x194f92){return db[_0xc8bd('0x17')]['findAll']({'raw':_0x1c3e61[_0xc8bd('0x18')]?_0x1c3e61[_0xc8bd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1c3e61['options']?_0x1c3e61[_0xc8bd('0x18')][_0xc8bd('0x19')]||null:null,'attributes':_0x1c3e61['options']?_0x1c3e61[_0xc8bd('0x18')]['attributes']||null:null,'limit':_0x1c3e61[_0xc8bd('0x18')]?_0x1c3e61['options'][_0xc8bd('0x1a')]||null:null,'include':_0x1c3e61['options']?_0x1c3e61['options'][_0xc8bd('0x1b')]?_[_0xc8bd('0x1c')](_0x1c3e61['options'][_0xc8bd('0x1b')],function(_0x20aa45){return{'model':db[_0x20aa45[_0xc8bd('0x1d')]],'as':_0x20aa45['as'],'attributes':_0x20aa45['attributes'],'include':_0x20aa45[_0xc8bd('0x1b')]?_['map'](_0x20aa45[_0xc8bd('0x1b')],function(_0x27c7fe){return{'model':db[_0x27c7fe[_0xc8bd('0x1d')]],'as':_0x27c7fe['as'],'attributes':_0x27c7fe[_0xc8bd('0x1e')],'include':_0x27c7fe[_0xc8bd('0x1b')]?_['map'](_0x27c7fe['include'],function(_0x15ba5d){return{'model':db[_0x15ba5d['model']],'as':_0x15ba5d['as'],'attributes':_0x15ba5d[_0xc8bd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc8bd('0xb')](function(_0x176b42){logger[_0xc8bd('0xc')](_0xc8bd('0x16'),_0x1c3e61);logger[_0xc8bd('0xe')](_0xc8bd('0x16'),_0x1c3e61,JSON[_0xc8bd('0x10')](_0x176b42));_0x2de99b(_0x176b42);})[_0xc8bd('0x1f')](function(_0x7fab88){logger['error']('GetCmHopperBlack',_0x7fab88['message'],_0x1c3e61);_0x194f92(_0xbd3042[_0xc8bd('0x12')](0x1f4,_0x7fab88[_0xc8bd('0x14')]));});});};exports[_0xc8bd('0x20')]=function(_0x2ca6d6){var _0x1515c3=this;return new Promise(function(_0x1ec889,_0x3a512f){return db[_0xc8bd('0x17')][_0xc8bd('0x21')](_0x2ca6d6[_0xc8bd('0x22')],{'raw':_0x2ca6d6['options']?_0x2ca6d6['options'][_0xc8bd('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ca6d6[_0xc8bd('0x18')]?_0x2ca6d6[_0xc8bd('0x18')][_0xc8bd('0x19')]||null:null,'attributes':_0x2ca6d6[_0xc8bd('0x18')]?_0x2ca6d6[_0xc8bd('0x18')][_0xc8bd('0x1e')]||null:null,'limit':_0x2ca6d6[_0xc8bd('0x18')]?_0x2ca6d6[_0xc8bd('0x18')]['limit']||null:null})['then'](function(_0x145672){logger[_0xc8bd('0xc')]('UpdateCmHopperBlack',_0x2ca6d6);logger[_0xc8bd('0xe')](_0xc8bd('0x20'),_0x2ca6d6,JSON[_0xc8bd('0x10')](_0x145672));_0x1ec889(_0x145672);})[_0xc8bd('0x1f')](function(_0x484ae2){logger[_0xc8bd('0x12')](_0xc8bd('0x20'),_0x484ae2[_0xc8bd('0x14')],_0x2ca6d6);_0x3a512f(_0x1515c3[_0xc8bd('0x12')](0x1f4,_0x484ae2[_0xc8bd('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x3a6116){var _0x1b54c5=this;return new Promise(function(_0x384a55,_0x2c12f1){return db['CmHopperBlack']['destroy']({'where':_0x3a6116[_0xc8bd('0x18')]?_0x3a6116[_0xc8bd('0x18')][_0xc8bd('0x19')]||null:null})[_0xc8bd('0xb')](function(_0x4b1dd8){logger[_0xc8bd('0xc')](_0xc8bd('0x24'),_0x3a6116);logger[_0xc8bd('0xe')](_0xc8bd('0x24'),_0x3a6116,JSON['stringify'](_0x4b1dd8));_0x384a55(_0x4b1dd8);})['catch'](function(_0x33a5ba){logger[_0xc8bd('0x12')](_0xc8bd('0x24'),_0x33a5ba[_0xc8bd('0x14')],_0x3a6116);_0x2c12f1(_0x1b54c5['error'](0x1f4,_0x33a5ba[_0xc8bd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 6371bb1..b57bfaf 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 _0xf2ca=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','put','update','delete','/:id'];(function(_0x1cc935,_0xd7c27f){var _0x29f1bf=function(_0x1517ef){while(--_0x1517ef){_0x1cc935['push'](_0x1cc935['shift']());}};_0x29f1bf(++_0xd7c27f);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xf2ca[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var auth=require(_0xaf2c('0x5'));var interaction=require(_0xaf2c('0x6'));var config=require(_0xaf2c('0x7'));var controller=require(_0xaf2c('0x8'));router['get']('/',auth[_0xaf2c('0x9')](),controller[_0xaf2c('0xa')]);router[_0xaf2c('0xb')](_0xaf2c('0xc'),auth['isAuthenticated'](),controller[_0xaf2c('0xd')]);router[_0xaf2c('0xb')]('/:id',auth[_0xaf2c('0x9')](),controller['show']);router[_0xaf2c('0xe')]('/:id',auth[_0xaf2c('0x9')](),controller[_0xaf2c('0xf')]);router[_0xaf2c('0x10')](_0xaf2c('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xaf2c('0x12')]=router; \ No newline at end of file +var _0x7bae=['index','/describe','describe','/:id','show','update','delete','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x4b317f,_0x1e19cd){var _0x1430bf=function(_0x26f671){while(--_0x26f671){_0x4b317f['push'](_0x4b317f['shift']());}};_0x1430bf(++_0x1e19cd);}(_0x7bae,0x13b));var _0xe7ba=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7bae[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe7ba('0x3'));var config=require(_0xe7ba('0x4'));var controller=require(_0xe7ba('0x5'));router[_0xe7ba('0x6')]('/',auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x8')]);router[_0xe7ba('0x6')](_0xe7ba('0x9'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xa')]);router[_0xe7ba('0x6')](_0xe7ba('0xb'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xc')]);router['put'](_0xe7ba('0xb'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xd')]);router[_0xe7ba('0xe')](_0xe7ba('0xb'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xf')]);module[_0xe7ba('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 6f6c93e..9570f4b 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 _0x1981=['INTEGER','STRING','getDataValue','endtime','setDataValue','dispositionat','BOOLEAN','sequelize','DATE'];(function(_0x3600a9,_0x4a3cbb){var _0x4532fd=function(_0x1e66aa){while(--_0x1e66aa){_0x3600a9['push'](_0x3600a9['shift']());}};_0x4532fd(++_0x4a3cbb);}(_0x1981,0x127));var _0x1198=function(_0x5ee59b,_0x2dabeb){_0x5ee59b=_0x5ee59b-0x0;var _0x5a0c47=_0x1981[_0x5ee59b];return _0x5a0c47;};'use strict';var Sequelize=require(_0x1198('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1198('0x1')]},'countbusyretry':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1198('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x1198('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1198('0x3')]},'starttime':{'type':Sequelize[_0x1198('0x1')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x1198('0x1')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x1198('0x1')]},'ringtime':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1198('0x3')]},'campaign':{'type':Sequelize[_0x1198('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x1198('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x5220f8){var _0xaf3757=this[_0x1198('0x4')](_0x1198('0x5'));if(_0xaf3757&&_0x5220f8){this[_0x1198('0x6')]('followuptime',moment(_0x5220f8)['diff'](moment(_0xaf3757),'seconds'));}return this['setDataValue'](_0x1198('0x7'),_0x5220f8);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x1198('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1198('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1198('0x1')]},'deleted':{'type':Sequelize[_0x1198('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1198('0x1')]},'recallme':{'type':Sequelize[_0x1198('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1198('0x1')]},'countnosuchnumberretry':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1198('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7709=['STRING','DATE','getDataValue','endtime','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7709,0x1c5));var _0x9770=function(_0x33b9d4,_0x3d8144){_0x33b9d4=_0x33b9d4-0x0;var _0x5ef514=_0x7709[_0x33b9d4];return _0x5ef514;};'use strict';var Sequelize=require(_0x9770('0x0'));var moment=require(_0x9770('0x1'));module['exports']={'state':{'type':Sequelize[_0x9770('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x9770('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9770('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9770('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x9770('0x3')]},'originatecalleridname':{'type':Sequelize[_0x9770('0x3')]},'calleridnum':{'type':Sequelize[_0x9770('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9770('0x4')]},'responsetime':{'type':Sequelize[_0x9770('0x4')]},'answertime':{'type':Sequelize[_0x9770('0x4')]},'droptime':{'type':Sequelize[_0x9770('0x4')]},'endtime':{'type':Sequelize[_0x9770('0x4')]},'ringtime':{'type':Sequelize[_0x9770('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9770('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9770('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9770('0x3')]},'campaign':{'type':Sequelize[_0x9770('0x3')]},'campaigntype':{'type':Sequelize[_0x9770('0x3')]},'membername':{'type':Sequelize[_0x9770('0x3')]},'reason':{'type':Sequelize[_0x9770('0x3')]},'disposition':{'type':Sequelize[_0x9770('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x30daa9){var _0x1f9d6c=this[_0x9770('0x5')](_0x9770('0x6'));if(_0x1f9d6c&&_0x30daa9){this['setDataValue'](_0x9770('0x7'),moment(_0x30daa9)[_0x9770('0x8')](moment(_0x1f9d6c),_0x9770('0x9')));}return this['setDataValue'](_0x9770('0xa'),_0x30daa9);}},'amd':{'type':Sequelize[_0x9770('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9770('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9770('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9770('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9770('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x9770('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9770('0x4')]},'recallme':{'type':Sequelize[_0x9770('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x9770('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9770('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9770('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9770('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index bcc9492..e49ae23 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 _0x253f=['toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','scheduledAt','ANY_VALUE(CampaignId)','CampaignId','state','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?'];(function(_0x32ce18,_0x52d1ff){var _0x521556=function(_0x6b6c8a){while(--_0x6b6c8a){_0x32ce18['push'](_0x32ce18['shift']());}};_0x521556(++_0x52d1ff);}(_0x253f,0x110));var _0xf253=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x253f[_0x1ccdf7];return _0x52a0ae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf253('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf253('0x1'));var jsonpatch=require(_0xf253('0x2'));var rp=require(_0xf253('0x3'));var moment=require(_0xf253('0x4'));var BPromise=require(_0xf253('0x5'));var Mustache=require(_0xf253('0x6'));var util=require(_0xf253('0x7'));var path=require(_0xf253('0x8'));var sox=require(_0xf253('0x9'));var csv=require(_0xf253('0xa'));var ejs=require(_0xf253('0xb'));var fs=require('fs');var _=require(_0xf253('0xc'));var squel=require('squel');var crypto=require(_0xf253('0xd'));var jsforce=require(_0xf253('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf253('0xa'));var querystring=require(_0xf253('0xf'));var Papa=require(_0xf253('0x10'));var Redis=require(_0xf253('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf253('0x12'));var hardwareService=require(_0xf253('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf253('0x14'));var config=require('../../config/environment');var db=require(_0xf253('0x15'))['db'];function respondWithStatusCode(_0x5b643c,_0x3a4924){_0x3a4924=_0x3a4924||0xcc;return function(_0x4d3fd3){if(_0x4d3fd3){return _0x5b643c[_0xf253('0x16')](_0x3a4924);}return _0x5b643c[_0xf253('0x17')](_0x3a4924)['end']();};}function respondWithResult(_0x179749,_0x53428f){_0x53428f=_0x53428f||0xc8;return function(_0x12df19){if(_0x12df19){return _0x179749[_0xf253('0x17')](_0x53428f)[_0xf253('0x18')](_0x12df19);}};}function respondWithFilteredResult(_0x23ddfe,_0x5a7c54){return function(_0x12e106){if(_0x12e106){var _0x42f4f9=_0x12e106[_0xf253('0x19')],_0x37d8ed=_0x5a7c54[_0xf253('0x1a')],_0x3c857e=_0x5a7c54[_0xf253('0x1a')]+_0x5a7c54[_0xf253('0x1b')],_0x55f7d2;if(_0x3c857e>=_0x42f4f9){_0x3c857e=_0x42f4f9;_0x55f7d2=0xc8;}else{_0x55f7d2=0xce;}_0x23ddfe[_0xf253('0x17')](_0x55f7d2);return _0x23ddfe[_0xf253('0x1c')](_0xf253('0x1d'),_0x37d8ed+'-'+_0x3c857e+'/'+_0x42f4f9)['json'](_0x12e106);}return null;};}function patchUpdates(_0x3216c2){return function(_0x4a07ea){try{jsonpatch[_0xf253('0x1e')](_0x4a07ea,_0x3216c2,!![]);}catch(_0x2e5db2){return BPromise[_0xf253('0x1f')](_0x2e5db2);}return _0x4a07ea[_0xf253('0x20')]();};}function saveUpdates(_0x45e78c,_0x321883){return function(_0x55a24a){if(_0x55a24a){return _0x55a24a[_0xf253('0x21')](_0x45e78c)[_0xf253('0x22')](function(_0x4976a8){return _0x4976a8;});}return null;};}function removeEntity(_0x48d02f,_0x37279d){return function(_0x20b8a4){if(_0x20b8a4){return _0x20b8a4[_0xf253('0x23')]()[_0xf253('0x22')](function(){_0x48d02f[_0xf253('0x17')](0xcc)[_0xf253('0x24')]();});}};}function handleEntityNotFound(_0xfd1e6c,_0x42965a){return function(_0x46ec97){if(!_0x46ec97){_0xfd1e6c['sendStatus'](0x194);}return _0x46ec97;};}function handleError(_0x32fefe,_0x74e1e3){_0x74e1e3=_0x74e1e3||0x1f4;return function(_0x578116){logger['error'](_0x578116[_0xf253('0x25')]);if(_0x578116[_0xf253('0x26')]){delete _0x578116[_0xf253('0x26')];}_0x32fefe[_0xf253('0x17')](_0x74e1e3)['send'](_0x578116);};}exports['index']=function(_0x3e8702,_0x1bf659){var _0x2e8696={},_0x3661e6={},_0x346478={'count':0x0,'rows':[]};var _0x223966=_[_0xf253('0x27')](db[_0xf253('0x28')][_0xf253('0x29')],function(_0x4ff3df){return{'name':_0x4ff3df[_0xf253('0x2a')],'type':_0x4ff3df[_0xf253('0x2b')]['key']};});_0x3661e6[_0xf253('0x2c')]=_['map'](_0x223966,_0xf253('0x26'));_0x3661e6[_0xf253('0x2d')]=_[_0xf253('0x2e')](_0x3e8702[_0xf253('0x2d')]);_0x3661e6[_0xf253('0x2f')]=_[_0xf253('0x30')](_0x3661e6['model'],_0x3661e6[_0xf253('0x2d')]);_0x2e8696['attributes']=_[_0xf253('0x30')](_0x3661e6[_0xf253('0x2c')],qs[_0xf253('0x31')](_0x3e8702[_0xf253('0x2d')][_0xf253('0x31')]));_0x2e8696[_0xf253('0x32')]=_0x2e8696[_0xf253('0x32')]['length']?_0x2e8696[_0xf253('0x32')]:_0x3661e6[_0xf253('0x2c')];if(!_0x3e8702[_0xf253('0x2d')][_0xf253('0x33')](_0xf253('0x34'))){_0x2e8696[_0xf253('0x1b')]=qs[_0xf253('0x1b')](_0x3e8702[_0xf253('0x2d')][_0xf253('0x1b')]);_0x2e8696[_0xf253('0x1a')]=qs[_0xf253('0x1a')](_0x3e8702[_0xf253('0x2d')]['offset']);}_0x2e8696[_0xf253('0x35')]=qs['sort'](_0x3e8702[_0xf253('0x2d')][_0xf253('0x36')]);_0x2e8696[_0xf253('0x37')]=qs['filters'](_['pick'](_0x3e8702[_0xf253('0x2d')],_0x3661e6[_0xf253('0x2f')]));if(_0x3e8702['query'][_0xf253('0x38')]){_0x2e8696[_0xf253('0x37')]=_[_0xf253('0x39')](_0x2e8696[_0xf253('0x37')],{'$or':_[_0xf253('0x27')](_0x223966,function(_0x3f1659){if(_0x3f1659[_0xf253('0x2b')]!==_0xf253('0x3a')){var _0x7d3ccc={};_0x7d3ccc[_0x3f1659[_0xf253('0x26')]]={'$like':'%'+_0x3e8702[_0xf253('0x2d')][_0xf253('0x38')]+'%'};return _0x7d3ccc;}})});}_0x2e8696=_[_0xf253('0x39')]({},_0x2e8696,_0x3e8702[_0xf253('0x3b')]);var _0x51d401={'where':_0x2e8696[_0xf253('0x37')]};return db[_0xf253('0x28')]['count'](_0x51d401)[_0xf253('0x22')](function(_0x29a9a7){_0x346478[_0xf253('0x19')]=_0x29a9a7;if(_0x3e8702[_0xf253('0x2d')][_0xf253('0x3c')]){_0x2e8696[_0xf253('0x3d')]=[{'all':!![]}];}return db[_0xf253('0x28')]['findAll'](_0x2e8696);})['then'](function(_0x54f5b5){_0x346478['rows']=_0x54f5b5;return _0x346478;})[_0xf253('0x22')](respondWithFilteredResult(_0x1bf659,_0x2e8696))[_0xf253('0x3e')](handleError(_0x1bf659,null));};exports[_0xf253('0x3f')]=function(_0x353918,_0x99f31c){var _0x35368a={'raw':!![],'where':{'id':_0x353918[_0xf253('0x40')]['id']}},_0x40d048={};_0x40d048[_0xf253('0x2c')]=_[_0xf253('0x2e')](db[_0xf253('0x28')][_0xf253('0x29')]);_0x40d048['query']=_[_0xf253('0x2e')](_0x353918[_0xf253('0x2d')]);_0x40d048[_0xf253('0x2f')]=_[_0xf253('0x30')](_0x40d048[_0xf253('0x2c')],_0x40d048[_0xf253('0x2d')]);_0x35368a[_0xf253('0x32')]=_[_0xf253('0x30')](_0x40d048['model'],qs[_0xf253('0x31')](_0x353918[_0xf253('0x2d')][_0xf253('0x31')]));_0x35368a['attributes']=_0x35368a[_0xf253('0x32')][_0xf253('0x41')]?_0x35368a[_0xf253('0x32')]:_0x40d048['model'];if(_0x353918[_0xf253('0x2d')][_0xf253('0x3c')]){_0x35368a['include']=[{'all':!![]}];}_0x35368a=_['merge']({},_0x35368a,_0x353918['options']);return db['CmHopperFinal'][_0xf253('0x42')](_0x35368a)[_0xf253('0x22')](handleEntityNotFound(_0x99f31c,null))[_0xf253('0x22')](respondWithResult(_0x99f31c,null))['catch'](handleError(_0x99f31c,null));};exports['describe']=function(_0x1832b2,_0xb95949){return db[_0xf253('0x28')][_0xf253('0x43')]()[_0xf253('0x22')](respondWithResult(_0xb95949,null))['catch'](handleError(_0xb95949,null));};exports[_0xf253('0x21')]=function(_0x404be9,_0x67b00e){if(_0x404be9[_0xf253('0x44')][_0xf253('0x45')]){delete _0x404be9[_0xf253('0x44')][_0xf253('0x45')];}return db[_0xf253('0x28')]['find']({'where':{'uniqueid':_0x404be9[_0xf253('0x40')]['id']}})[_0xf253('0x22')](handleEntityNotFound(_0x67b00e,null))['then'](saveUpdates(_0x404be9['body'],null))[_0xf253('0x22')](respondWithResult(_0x67b00e,null))['catch'](handleError(_0x67b00e,null));};exports[_0xf253('0x46')]=function(_0x3fd96a,_0x3111ff,_0x15a121){return db[_0xf253('0x28')][_0xf253('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x3fd96a[_0xf253('0x40')]['id']},'attributes':[[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db['sequelize']['fn']('IF',db[_0xf253('0x48')][_0xf253('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),_0xf253('0x4b')],[db['sequelize']['fn'](_0xf253('0x49'),db[_0xf253('0x48')]['fn']('IF',db['sequelize'][_0xf253('0x4a')](_0xf253('0x4c')))),_0xf253('0x4d')],[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db[_0xf253('0x48')]['fn']('IF',db['sequelize'][_0xf253('0x4a')](_0xf253('0x4e')))),_0xf253('0x4f')],[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db[_0xf253('0x48')]['fn']('IF',db['sequelize'][_0xf253('0x4a')](_0xf253('0x50')))),'congestionContacts'],[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db[_0xf253('0x48')]['fn']('IF',db[_0xf253('0x48')]['literal'](_0xf253('0x51')))),_0xf253('0x52')],[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0xf253('0x4a')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf253('0x53')],[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db['sequelize']['fn']('IF',db[_0xf253('0x48')][_0xf253('0x4a')](_0xf253('0x54')))),_0xf253('0x55')],[db[_0xf253('0x48')]['fn']('COUNT',db[_0xf253('0x48')]['fn']('IF',db['sequelize'][_0xf253('0x4a')](_0xf253('0x56')))),_0xf253('0x57')]]})[_0xf253('0x22')](handleEntityNotFound(_0x3111ff,null))['then'](respondWithResult(_0x3111ff,null))[_0xf253('0x3e')](handleError(_0x3111ff,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x9d77db,_0x192536,_0x417fe4){return db[_0xf253('0x28')][_0xf253('0x47')]({'raw':![],'where':{'CampaignId':_0x9d77db[_0xf253('0x40')]['id']},'attributes':[[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db['sequelize']['fn']('IF',db[_0xf253('0x48')][_0xf253('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),_0xf253('0x4b')],[db['sequelize']['fn'](_0xf253('0x49'),db[_0xf253('0x48')]['fn']('IF',db[_0xf253('0x48')][_0xf253('0x4a')](_0xf253('0x4c')))),_0xf253('0x4d')],[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db[_0xf253('0x48')]['fn']('IF',db[_0xf253('0x48')][_0xf253('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf253('0x4f')],[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db['sequelize']['fn']('IF',db[_0xf253('0x48')][_0xf253('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0xf253('0x48')]['fn'](_0xf253('0x49'),db[_0xf253('0x48')]['fn']('IF',db[_0xf253('0x48')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xf253('0x52')],[db[_0xf253('0x48')]['fn']('COUNT',db[_0xf253('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf253('0x58')))),_0xf253('0x53')],[db['sequelize']['fn'](_0xf253('0x49'),db[_0xf253('0x48')]['fn']('IF',db['sequelize'][_0xf253('0x4a')](_0xf253('0x54')))),_0xf253('0x55')],[db['sequelize']['fn'](_0xf253('0x49'),db['sequelize']['fn']('IF',db[_0xf253('0x48')]['literal'](_0xf253('0x56')))),_0xf253('0x57')]]})[_0xf253('0x22')](handleEntityNotFound(_0x192536,null))[_0xf253('0x22')](respondWithResult(_0x192536,null))[_0xf253('0x3e')](handleError(_0x192536,null));};exports[_0xf253('0x59')]=function(_0xd33fac,_0x537c42,_0xea229b){return db[_0xf253('0x5a')][_0xf253('0x42')]({'where':{'id':_0xd33fac[_0xf253('0x40')]['id']}})['then'](handleEntityNotFound(_0x537c42,null))['then'](function(_0x28f1a4){var _0x4ffe37;if(_0x28f1a4){_0x4ffe37=squel[_0xf253('0x5b')]()[_0xf253('0x5c')]('cm_hopper')['fromQuery']([_0xf253('0x5d'),'scheduledAt','ContactId','ListId',_0xf253('0x5e'),_0xf253('0x5f'),'updatedAt'],squel[_0xf253('0x60')]()[_0xf253('0x61')](_0xf253('0x62'),_0xf253('0x5d'))[_0xf253('0x61')]('NOW()','scheduledAt')[_0xf253('0x61')](_0xf253('0x63'),_0xf253('0x64'))['field'](_0xf253('0x65'),_0xf253('0x66'))['field'](_0xf253('0x67'),_0xf253('0x5e'))[_0xf253('0x61')](_0xf253('0x68'),_0xf253('0x5f'))['field'](_0xf253('0x68'),_0xf253('0x69'))[_0xf253('0x6a')](_0xf253('0x6b'))[_0xf253('0x37')](_0xf253('0x6c'),_0xd33fac[_0xf253('0x40')]['id'][_0xf253('0x6d')]())[_0xf253('0x37')](_0xf253('0x6e'),_0xd33fac[_0xf253('0x44')]['state'][_0xf253('0x6d')]())['where'](_0xf253('0x6f'))[_0xf253('0x37')](_0xf253('0x70'),squel[_0xf253('0x60')]()[_0xf253('0x61')](_0xf253('0x5d'))[_0xf253('0x6a')](_0xf253('0x71'))[_0xf253('0x37')](_0xf253('0x6c'),_0xd33fac[_0xf253('0x40')]['id'][_0xf253('0x6d')]()))[_0xf253('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xf253('0x61')](_0xf253('0x72'))[_0xf253('0x6a')](_0xf253('0x6b'))['where'](_0xf253('0x6c'),_0xd33fac[_0xf253('0x40')]['id'][_0xf253('0x6d')]())[_0xf253('0x37')](_0xf253('0x73')))[_0xf253('0x74')](_0xf253('0x64')))['toString']();return db['sequelize'][_0xf253('0x2d')](_0x4ffe37);}return[];})['then'](respondWithResult(_0x537c42,null))[_0xf253('0x3e')](handleError(_0x537c42,null));};exports[_0xf253('0x75')]=function(_0x5f0e62,_0x144fec,_0x49c713){return db[_0xf253('0x76')]['find']({'where':{'id':_0x5f0e62['params']['id']}})[_0xf253('0x22')](handleEntityNotFound(_0x144fec,null))[_0xf253('0x22')](function(_0x7536a4){var _0x427636;if(_0x7536a4){_0x427636=squel['insert']()[_0xf253('0x5c')](_0xf253('0x71'))['fromQuery']([_0xf253('0x5d'),_0xf253('0x77'),_0xf253('0x64'),'ListId','CampaignId',_0xf253('0x5f'),_0xf253('0x69')],squel['select']()[_0xf253('0x61')]('ANY_VALUE(calleridnum)','phone')[_0xf253('0x61')]('NOW()',_0xf253('0x77'))['field'](_0xf253('0x63'),_0xf253('0x64'))[_0xf253('0x61')](_0xf253('0x65'),_0xf253('0x66'))['field'](_0xf253('0x78'),_0xf253('0x79'))[_0xf253('0x61')](_0xf253('0x68'),_0xf253('0x5f'))['field'](_0xf253('0x68'),_0xf253('0x69'))[_0xf253('0x6a')](_0xf253('0x6b'))['where']('CampaignId\x20=\x20?',_0x5f0e62[_0xf253('0x40')]['id'][_0xf253('0x6d')]())[_0xf253('0x37')]('state\x20=\x20?',_0x5f0e62['body'][_0xf253('0x7a')][_0xf253('0x6d')]())[_0xf253('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xf253('0x37')](_0xf253('0x70'),squel[_0xf253('0x60')]()[_0xf253('0x61')](_0xf253('0x5d'))[_0xf253('0x6a')](_0xf253('0x71'))[_0xf253('0x37')](_0xf253('0x7b'),_0x5f0e62[_0xf253('0x40')]['id']['toString']()))[_0xf253('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xf253('0x60')]()[_0xf253('0x61')](_0xf253('0x72'))['from'](_0xf253('0x6b'))[_0xf253('0x37')](_0xf253('0x7b'),_0x5f0e62[_0xf253('0x40')]['id'][_0xf253('0x6d')]())['where'](_0xf253('0x73')))[_0xf253('0x74')](_0xf253('0x64')))['toString']();return db[_0xf253('0x48')][_0xf253('0x2d')](_0x427636);}return[];})['then'](respondWithResult(_0x144fec,null))[_0xf253('0x3e')](handleError(_0x144fec,null));};exports[_0xf253('0x7c')]=function(_0x3e053a,_0x235ec9,_0x4efac3){return db[_0xf253('0x7d')][_0xf253('0x7e')]({'where':{'VoiceQueueId':_0x3e053a[_0xf253('0x44')][_0xf253('0x5e')],'CampaignId':_0x3e053a[_0xf253('0x44')][_0xf253('0x79')],'ContactId':_0x3e053a[_0xf253('0x44')][_0xf253('0x64')]}})[_0xf253('0x22')](handleEntityNotFound(_0x235ec9,null))[_0xf253('0x22')](function(_0x597f40){if(_0x597f40){return _0x597f40;}return null;})[_0xf253('0x22')](respondWithResult(_0x235ec9,null))[_0xf253('0x3e')](handleError(_0x235ec9,null));}; \ No newline at end of file +var _0xf7ee=['CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','fieldName','model','query','filters','attributes','intersection','fields','nolimit','where','pick','filter','type','VIRTUAL','merge','includeAll','include','rows','show','params','rawAttributes','keys','length','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','ListId','CampaignId','ANY_VALUE(CampaignId)'];(function(_0xd3c494,_0x62fa3a){var _0xb3587a=function(_0x3e8b29){while(--_0x3e8b29){_0xd3c494['push'](_0xd3c494['shift']());}};_0xb3587a(++_0x62fa3a);}(_0xf7ee,0x83));var _0xef7e=function(_0x534692,_0x471eb2){_0x534692=_0x534692-0x0;var _0x41239e=_0xf7ee[_0x534692];return _0x41239e;};'use strict';var pdf=require(_0xef7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xef7e('0x1'));var zipdir=require(_0xef7e('0x2'));var jsonpatch=require(_0xef7e('0x3'));var rp=require(_0xef7e('0x4'));var moment=require(_0xef7e('0x5'));var BPromise=require(_0xef7e('0x6'));var Mustache=require(_0xef7e('0x7'));var util=require('util');var path=require('path');var sox=require(_0xef7e('0x8'));var csv=require(_0xef7e('0x9'));var ejs=require(_0xef7e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xef7e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xef7e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xef7e('0xd'));var Papa=require(_0xef7e('0xe'));var Redis=require('ioredis');var authService=require(_0xef7e('0xf'));var qs=require(_0xef7e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xef7e('0x11'))(_0xef7e('0x12'));var utils=require('../../config/utils');var config=require(_0xef7e('0x13'));var db=require(_0xef7e('0x14'))['db'];function respondWithStatusCode(_0x264b3f,_0x42fc3b){_0x42fc3b=_0x42fc3b||0xcc;return function(_0x12f633){if(_0x12f633){return _0x264b3f[_0xef7e('0x15')](_0x42fc3b);}return _0x264b3f['status'](_0x42fc3b)[_0xef7e('0x16')]();};}function respondWithResult(_0x1ac571,_0x535af0){_0x535af0=_0x535af0||0xc8;return function(_0x152386){if(_0x152386){return _0x1ac571[_0xef7e('0x17')](_0x535af0)[_0xef7e('0x18')](_0x152386);}};}function respondWithFilteredResult(_0x3ecad4,_0x5a7e3e){return function(_0x1f80ae){if(_0x1f80ae){var _0x81b070=_0x1f80ae[_0xef7e('0x19')],_0x146373=_0x5a7e3e['offset'],_0x4f1ce3=_0x5a7e3e[_0xef7e('0x1a')]+_0x5a7e3e[_0xef7e('0x1b')],_0x465630;if(_0x4f1ce3>=_0x81b070){_0x4f1ce3=_0x81b070;_0x465630=0xc8;}else{_0x465630=0xce;}_0x3ecad4[_0xef7e('0x17')](_0x465630);return _0x3ecad4[_0xef7e('0x1c')](_0xef7e('0x1d'),_0x146373+'-'+_0x4f1ce3+'/'+_0x81b070)[_0xef7e('0x18')](_0x1f80ae);}return null;};}function patchUpdates(_0x3b2b38){return function(_0x539fd9){try{jsonpatch[_0xef7e('0x1e')](_0x539fd9,_0x3b2b38,!![]);}catch(_0x2e8661){return BPromise[_0xef7e('0x1f')](_0x2e8661);}return _0x539fd9[_0xef7e('0x20')]();};}function saveUpdates(_0x4cbf8d,_0x22708f){return function(_0x1ab5cf){if(_0x1ab5cf){return _0x1ab5cf[_0xef7e('0x21')](_0x4cbf8d)[_0xef7e('0x22')](function(_0xc8efc8){return _0xc8efc8;});}return null;};}function removeEntity(_0x31aa0b,_0x528338){return function(_0x40c9ff){if(_0x40c9ff){return _0x40c9ff[_0xef7e('0x23')]()[_0xef7e('0x22')](function(){_0x31aa0b[_0xef7e('0x17')](0xcc)[_0xef7e('0x16')]();});}};}function handleEntityNotFound(_0x10ba65,_0x222f51){return function(_0x5166ea){if(!_0x5166ea){_0x10ba65[_0xef7e('0x15')](0x194);}return _0x5166ea;};}function handleError(_0x1c14fc,_0xf156ce){_0xf156ce=_0xf156ce||0x1f4;return function(_0x5380c0){logger['error'](_0x5380c0[_0xef7e('0x24')]);if(_0x5380c0[_0xef7e('0x25')]){delete _0x5380c0[_0xef7e('0x25')];}_0x1c14fc['status'](_0xf156ce)[_0xef7e('0x26')](_0x5380c0);};}exports[_0xef7e('0x27')]=function(_0x46ac1f,_0x388f71){var _0x464976={},_0x5859dc={},_0x573598={'count':0x0,'rows':[]};var _0x20032c=_[_0xef7e('0x28')](db[_0xef7e('0x29')]['rawAttributes'],function(_0x303889){return{'name':_0x303889[_0xef7e('0x2a')],'type':_0x303889['type']['key']};});_0x5859dc[_0xef7e('0x2b')]=_[_0xef7e('0x28')](_0x20032c,_0xef7e('0x25'));_0x5859dc[_0xef7e('0x2c')]=_['keys'](_0x46ac1f[_0xef7e('0x2c')]);_0x5859dc[_0xef7e('0x2d')]=_['intersection'](_0x5859dc[_0xef7e('0x2b')],_0x5859dc[_0xef7e('0x2c')]);_0x464976[_0xef7e('0x2e')]=_[_0xef7e('0x2f')](_0x5859dc[_0xef7e('0x2b')],qs[_0xef7e('0x30')](_0x46ac1f[_0xef7e('0x2c')][_0xef7e('0x30')]));_0x464976[_0xef7e('0x2e')]=_0x464976[_0xef7e('0x2e')]['length']?_0x464976[_0xef7e('0x2e')]:_0x5859dc['model'];if(!_0x46ac1f[_0xef7e('0x2c')]['hasOwnProperty'](_0xef7e('0x31'))){_0x464976['limit']=qs['limit'](_0x46ac1f[_0xef7e('0x2c')]['limit']);_0x464976[_0xef7e('0x1a')]=qs['offset'](_0x46ac1f['query'][_0xef7e('0x1a')]);}_0x464976['order']=qs['sort'](_0x46ac1f[_0xef7e('0x2c')]['sort']);_0x464976[_0xef7e('0x32')]=qs[_0xef7e('0x2d')](_[_0xef7e('0x33')](_0x46ac1f[_0xef7e('0x2c')],_0x5859dc[_0xef7e('0x2d')]));if(_0x46ac1f['query'][_0xef7e('0x34')]){_0x464976[_0xef7e('0x32')]=_['merge'](_0x464976[_0xef7e('0x32')],{'$or':_[_0xef7e('0x28')](_0x20032c,function(_0x25990a){if(_0x25990a[_0xef7e('0x35')]!==_0xef7e('0x36')){var _0x76b983={};_0x76b983[_0x25990a[_0xef7e('0x25')]]={'$like':'%'+_0x46ac1f[_0xef7e('0x2c')][_0xef7e('0x34')]+'%'};return _0x76b983;}})});}_0x464976=_[_0xef7e('0x37')]({},_0x464976,_0x46ac1f['options']);var _0x39a0de={'where':_0x464976[_0xef7e('0x32')]};return db[_0xef7e('0x29')]['count'](_0x39a0de)[_0xef7e('0x22')](function(_0x3e36df){_0x573598['count']=_0x3e36df;if(_0x46ac1f[_0xef7e('0x2c')][_0xef7e('0x38')]){_0x464976[_0xef7e('0x39')]=[{'all':!![]}];}return db[_0xef7e('0x29')]['findAll'](_0x464976);})[_0xef7e('0x22')](function(_0xf8f378){_0x573598[_0xef7e('0x3a')]=_0xf8f378;return _0x573598;})[_0xef7e('0x22')](respondWithFilteredResult(_0x388f71,_0x464976))['catch'](handleError(_0x388f71,null));};exports[_0xef7e('0x3b')]=function(_0x552227,_0x4c6fff){var _0x4b66e3={'raw':!![],'where':{'id':_0x552227[_0xef7e('0x3c')]['id']}},_0xbd9fc7={};_0xbd9fc7[_0xef7e('0x2b')]=_['keys'](db['CmHopperFinal'][_0xef7e('0x3d')]);_0xbd9fc7[_0xef7e('0x2c')]=_[_0xef7e('0x3e')](_0x552227['query']);_0xbd9fc7[_0xef7e('0x2d')]=_[_0xef7e('0x2f')](_0xbd9fc7[_0xef7e('0x2b')],_0xbd9fc7[_0xef7e('0x2c')]);_0x4b66e3[_0xef7e('0x2e')]=_[_0xef7e('0x2f')](_0xbd9fc7[_0xef7e('0x2b')],qs[_0xef7e('0x30')](_0x552227[_0xef7e('0x2c')]['fields']));_0x4b66e3[_0xef7e('0x2e')]=_0x4b66e3[_0xef7e('0x2e')][_0xef7e('0x3f')]?_0x4b66e3[_0xef7e('0x2e')]:_0xbd9fc7['model'];if(_0x552227[_0xef7e('0x2c')][_0xef7e('0x38')]){_0x4b66e3[_0xef7e('0x39')]=[{'all':!![]}];}_0x4b66e3=_['merge']({},_0x4b66e3,_0x552227['options']);return db['CmHopperFinal'][_0xef7e('0x40')](_0x4b66e3)[_0xef7e('0x22')](handleEntityNotFound(_0x4c6fff,null))[_0xef7e('0x22')](respondWithResult(_0x4c6fff,null))[_0xef7e('0x41')](handleError(_0x4c6fff,null));};exports[_0xef7e('0x42')]=function(_0x11add6,_0x5009eb){return db[_0xef7e('0x29')][_0xef7e('0x42')]()[_0xef7e('0x22')](respondWithResult(_0x5009eb,null))['catch'](handleError(_0x5009eb,null));};exports['update']=function(_0x5f5943,_0x186f53){if(_0x5f5943[_0xef7e('0x43')][_0xef7e('0x44')]){delete _0x5f5943['body'][_0xef7e('0x44')];}return db[_0xef7e('0x29')][_0xef7e('0x40')]({'where':{'uniqueid':_0x5f5943[_0xef7e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x186f53,null))[_0xef7e('0x22')](saveUpdates(_0x5f5943[_0xef7e('0x43')],null))[_0xef7e('0x22')](respondWithResult(_0x186f53,null))[_0xef7e('0x41')](handleError(_0x186f53,null));};exports[_0xef7e('0x45')]=function(_0x4054f7,_0x2ccf2a,_0x5dd020){return db[_0xef7e('0x29')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x4054f7[_0xef7e('0x3c')]['id']},'attributes':[[db['sequelize']['fn'](_0xef7e('0x46'),db[_0xef7e('0x47')]['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x49')))),_0xef7e('0x4a')],[db[_0xef7e('0x47')]['fn'](_0xef7e('0x46'),db[_0xef7e('0x47')]['fn']('IF',db[_0xef7e('0x47')]['literal'](_0xef7e('0x4b')))),'noAnswerContacts'],[db[_0xef7e('0x47')]['fn'](_0xef7e('0x46'),db['sequelize']['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x4c')))),_0xef7e('0x4d')],[db['sequelize']['fn'](_0xef7e('0x46'),db['sequelize']['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x4e')))),_0xef7e('0x4f')],[db[_0xef7e('0x47')]['fn'](_0xef7e('0x46'),db[_0xef7e('0x47')]['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x50')))),_0xef7e('0x51')],[db[_0xef7e('0x47')]['fn'](_0xef7e('0x46'),db[_0xef7e('0x47')]['fn']('IF',db[_0xef7e('0x47')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xef7e('0x52')],[db[_0xef7e('0x47')]['fn'](_0xef7e('0x46'),db[_0xef7e('0x47')]['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x53')))),_0xef7e('0x54')],[db[_0xef7e('0x47')]['fn'](_0xef7e('0x46'),db[_0xef7e('0x47')]['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x55')))),_0xef7e('0x56')]]})[_0xef7e('0x22')](handleEntityNotFound(_0x2ccf2a,null))[_0xef7e('0x22')](respondWithResult(_0x2ccf2a,null))['catch'](handleError(_0x2ccf2a,null));};exports[_0xef7e('0x57')]=function(_0x1bd5f0,_0x1024e3,_0x266b27){return db[_0xef7e('0x29')]['findAll']({'raw':![],'where':{'CampaignId':_0x1bd5f0[_0xef7e('0x3c')]['id']},'attributes':[[db[_0xef7e('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x49')))),_0xef7e('0x4a')],[db[_0xef7e('0x47')]['fn'](_0xef7e('0x46'),db[_0xef7e('0x47')]['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x4b')))),_0xef7e('0x58')],[db['sequelize']['fn'](_0xef7e('0x46'),db[_0xef7e('0x47')]['fn']('IF',db['sequelize'][_0xef7e('0x48')]('`state`\x20=\x205,\x201,\x20null'))),_0xef7e('0x4d')],[db['sequelize']['fn']('COUNT',db[_0xef7e('0x47')]['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')]('`state`\x20=\x208,\x201,\x20null'))),_0xef7e('0x4f')],[db[_0xef7e('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x50')))),_0xef7e('0x51')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xef7e('0x52')],[db['sequelize']['fn'](_0xef7e('0x46'),db['sequelize']['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x53')))),_0xef7e('0x54')],[db[_0xef7e('0x47')]['fn'](_0xef7e('0x46'),db['sequelize']['fn']('IF',db[_0xef7e('0x47')][_0xef7e('0x48')](_0xef7e('0x55')))),_0xef7e('0x56')]]})[_0xef7e('0x22')](handleEntityNotFound(_0x1024e3,null))[_0xef7e('0x22')](respondWithResult(_0x1024e3,null))[_0xef7e('0x41')](handleError(_0x1024e3,null));};exports[_0xef7e('0x59')]=function(_0x281597,_0x443179,_0x2d0937){return db[_0xef7e('0x5a')][_0xef7e('0x40')]({'where':{'id':_0x281597[_0xef7e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x443179,null))[_0xef7e('0x22')](function(_0x1b66c9){var _0x129f50;if(_0x1b66c9){_0x129f50=squel['insert']()[_0xef7e('0x5b')](_0xef7e('0x5c'))[_0xef7e('0x5d')]([_0xef7e('0x5e'),_0xef7e('0x5f'),_0xef7e('0x60'),'ListId',_0xef7e('0x61'),_0xef7e('0x62'),'updatedAt'],squel['select']()[_0xef7e('0x63')](_0xef7e('0x64'),_0xef7e('0x5e'))[_0xef7e('0x63')]('NOW()',_0xef7e('0x5f'))[_0xef7e('0x63')](_0xef7e('0x65'),_0xef7e('0x60'))[_0xef7e('0x63')]('ANY_VALUE(ListId)','ListId')[_0xef7e('0x63')](_0xef7e('0x66'),_0xef7e('0x61'))[_0xef7e('0x63')](_0xef7e('0x67'),_0xef7e('0x62'))[_0xef7e('0x63')]('NOW()',_0xef7e('0x68'))[_0xef7e('0x69')](_0xef7e('0x6a'))['where'](_0xef7e('0x6b'),_0x281597['params']['id'][_0xef7e('0x6c')]())[_0xef7e('0x32')](_0xef7e('0x6d'),_0x281597[_0xef7e('0x43')][_0xef7e('0x6e')][_0xef7e('0x6c')]())[_0xef7e('0x32')](_0xef7e('0x6f'))['where'](_0xef7e('0x70'),squel['select']()[_0xef7e('0x63')](_0xef7e('0x5e'))[_0xef7e('0x69')](_0xef7e('0x5c'))['where'](_0xef7e('0x6b'),_0x281597[_0xef7e('0x3c')]['id'][_0xef7e('0x6c')]()))[_0xef7e('0x32')](_0xef7e('0x70'),squel[_0xef7e('0x71')]()[_0xef7e('0x63')](_0xef7e('0x72'))[_0xef7e('0x69')](_0xef7e('0x6a'))[_0xef7e('0x32')](_0xef7e('0x6b'),_0x281597[_0xef7e('0x3c')]['id'][_0xef7e('0x6c')]())[_0xef7e('0x32')](_0xef7e('0x73')))[_0xef7e('0x74')](_0xef7e('0x60')))[_0xef7e('0x6c')]();return db[_0xef7e('0x47')]['query'](_0x129f50);}return[];})['then'](respondWithResult(_0x443179,null))[_0xef7e('0x41')](handleError(_0x443179,null));};exports[_0xef7e('0x75')]=function(_0x10d06e,_0x5396ca,_0x18f13f){return db[_0xef7e('0x76')]['find']({'where':{'id':_0x10d06e[_0xef7e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5396ca,null))[_0xef7e('0x22')](function(_0x3e1202){var _0x27972f;if(_0x3e1202){_0x27972f=squel[_0xef7e('0x77')]()[_0xef7e('0x5b')](_0xef7e('0x5c'))[_0xef7e('0x5d')]([_0xef7e('0x5e'),_0xef7e('0x5f'),_0xef7e('0x60'),_0xef7e('0x78'),_0xef7e('0x79'),_0xef7e('0x62'),'updatedAt'],squel[_0xef7e('0x71')]()['field'](_0xef7e('0x64'),_0xef7e('0x5e'))[_0xef7e('0x63')]('NOW()','scheduledAt')['field'](_0xef7e('0x65'),_0xef7e('0x60'))[_0xef7e('0x63')]('ANY_VALUE(ListId)',_0xef7e('0x78'))[_0xef7e('0x63')](_0xef7e('0x7a'),_0xef7e('0x79'))[_0xef7e('0x63')](_0xef7e('0x67'),_0xef7e('0x62'))[_0xef7e('0x63')](_0xef7e('0x67'),'updatedAt')[_0xef7e('0x69')](_0xef7e('0x6a'))[_0xef7e('0x32')]('CampaignId\x20=\x20?',_0x10d06e[_0xef7e('0x3c')]['id'][_0xef7e('0x6c')]())[_0xef7e('0x32')](_0xef7e('0x6d'),_0x10d06e['body']['state'][_0xef7e('0x6c')]())[_0xef7e('0x32')](_0xef7e('0x6f'))[_0xef7e('0x32')](_0xef7e('0x70'),squel[_0xef7e('0x71')]()[_0xef7e('0x63')](_0xef7e('0x5e'))[_0xef7e('0x69')]('cm_hopper')[_0xef7e('0x32')](_0xef7e('0x7b'),_0x10d06e[_0xef7e('0x3c')]['id'][_0xef7e('0x6c')]()))[_0xef7e('0x32')](_0xef7e('0x70'),squel[_0xef7e('0x71')]()[_0xef7e('0x63')](_0xef7e('0x72'))[_0xef7e('0x69')]('cm_hopper_final')[_0xef7e('0x32')]('CampaignId\x20=\x20?',_0x10d06e['params']['id'][_0xef7e('0x6c')]())[_0xef7e('0x32')]('state\x20=\x204'))[_0xef7e('0x74')]('ContactId'))[_0xef7e('0x6c')]();return db[_0xef7e('0x47')]['query'](_0x27972f);}return[];})[_0xef7e('0x22')](respondWithResult(_0x5396ca,null))[_0xef7e('0x41')](handleError(_0x5396ca,null));};exports[_0xef7e('0x7c')]=function(_0x3bf6ba,_0x17b9b5,_0x2a19a9){return db[_0xef7e('0x7d')][_0xef7e('0x7e')]({'where':{'VoiceQueueId':_0x3bf6ba['body'][_0xef7e('0x61')],'CampaignId':_0x3bf6ba[_0xef7e('0x43')][_0xef7e('0x79')],'ContactId':_0x3bf6ba[_0xef7e('0x43')][_0xef7e('0x60')]}})[_0xef7e('0x22')](handleEntityNotFound(_0x17b9b5,null))[_0xef7e('0x22')](function(_0x1fdad2){if(_0x1fdad2){return _0x1fdad2;}return null;})[_0xef7e('0x22')](respondWithResult(_0x17b9b5,null))[_0xef7e('0x41')](handleError(_0x17b9b5,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index b0400a9..c75ed0e 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 _0x9499=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment'];(function(_0x408704,_0x139393){var _0x3dfbc7=function(_0x43a6ff){while(--_0x43a6ff){_0x408704['push'](_0x408704['shift']());}};_0x3dfbc7(++_0x139393);}(_0x9499,0xcc));var _0x9949=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9499[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x9949('0x0'));var util=require(_0x9949('0x1'));var logger=require('../../config/logger')(_0x9949('0x2'));var moment=require(_0x9949('0x3'));var BPromise=require(_0x9949('0x4'));var rp=require(_0x9949('0x5'));var fs=require('fs');var path=require(_0x9949('0x6'));var rimraf=require(_0x9949('0x7'));var config=require(_0x9949('0x8'));var attributes=require(_0x9949('0x9'));module[_0x9949('0xa')]=function(_0xf8ad2c,_0x4a85dc){return _0xf8ad2c[_0x9949('0xb')](_0x9949('0xc'),attributes,{'tableName':_0x9949('0xd'),'paranoid':![],'indexes':[{'name':_0x9949('0xe'),'fields':[_0x9949('0xe')]},{'name':_0x9949('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7797=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x3e4e88,_0x20fafd){var _0x388fda=function(_0x4d3bb8){while(--_0x4d3bb8){_0x3e4e88['push'](_0x3e4e88['shift']());}};_0x388fda(++_0x20fafd);}(_0x7797,0x1ac));var _0x7779=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x7797[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require(_0x7779('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7779('0x1'));var moment=require('moment');var BPromise=require(_0x7779('0x2'));var rp=require(_0x7779('0x3'));var fs=require('fs');var path=require(_0x7779('0x4'));var rimraf=require(_0x7779('0x5'));var config=require(_0x7779('0x6'));var attributes=require(_0x7779('0x7'));module[_0x7779('0x8')]=function(_0x55caea,_0x366cd7){return _0x55caea[_0x7779('0x9')]('CmHopperFinal',attributes,{'tableName':_0x7779('0xa'),'paranoid':![],'indexes':[{'name':_0x7779('0xb'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x7779('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index b065ac4..827e3ae 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 _0x3f4b=['request\x20sent','debug','stringify','error','message','info','result','catch','CreateCmHopperFinal','create','body','options','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','CmHopperFinal,\x20%s,\x20%s'];(function(_0x307fdb,_0x136439){var _0x4b30e4=function(_0x2b4e7e){while(--_0x2b4e7e){_0x307fdb['push'](_0x307fdb['shift']());}};_0x4b30e4(++_0x136439);}(_0x3f4b,0x11f));var _0xb3f4=function(_0x4833cf,_0x2474df){_0x4833cf=_0x4833cf-0x0;var _0x19e58f=_0x3f4b[_0x4833cf];return _0x19e58f;};'use strict';var _=require(_0xb3f4('0x0'));var util=require(_0xb3f4('0x1'));var moment=require(_0xb3f4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb3f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3f4('0x4'))['db'];var utils=require(_0xb3f4('0x5'));var logger=require(_0xb3f4('0x6'))(_0xb3f4('0x7'));var config=require('../../config/environment');var jayson=require(_0xb3f4('0x8'));var client=jayson[_0xb3f4('0x9')][_0xb3f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb3a440,_0x2b714f,_0x5600e7){return new BPromise(function(_0x52ca41,_0x5cdbb3){return client['request'](_0xb3a440,_0x5600e7)[_0xb3f4('0xb')](function(_0x2fff59){logger['info'](_0xb3f4('0xc'),_0x2b714f,_0xb3f4('0xd'));logger[_0xb3f4('0xe')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x2b714f,_0xb3f4('0xd'),JSON[_0xb3f4('0xf')](_0x2fff59));if(_0x2fff59[_0xb3f4('0x10')]){if(_0x2fff59[_0xb3f4('0x10')]['code']===0x1f4){logger[_0xb3f4('0x10')](_0xb3f4('0xc'),_0x2b714f,_0x2fff59[_0xb3f4('0x10')]['message']);return _0x5cdbb3(_0x2fff59['error']['message']);}logger[_0xb3f4('0x10')](_0xb3f4('0xc'),_0x2b714f,_0x2fff59[_0xb3f4('0x10')][_0xb3f4('0x11')]);return _0x52ca41(_0x2fff59[_0xb3f4('0x10')][_0xb3f4('0x11')]);}else{logger[_0xb3f4('0x12')](_0xb3f4('0xc'),_0x2b714f,_0xb3f4('0xd'));_0x52ca41(_0x2fff59[_0xb3f4('0x13')][_0xb3f4('0x11')]);}})[_0xb3f4('0x14')](function(_0x2e4d6d){logger['error'](_0xb3f4('0xc'),_0x2b714f,_0x2e4d6d);_0x5cdbb3(_0x2e4d6d);});});}exports[_0xb3f4('0x15')]=function(_0x438acd){var _0x3d278b=this;return new Promise(function(_0x1c238f,_0x108ed0){return db['CmHopperFinal'][_0xb3f4('0x16')](_0x438acd[_0xb3f4('0x17')],{'raw':_0x438acd[_0xb3f4('0x18')]?_0x438acd[_0xb3f4('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x9bb6a4){logger[_0xb3f4('0x12')](_0xb3f4('0x15'),_0x438acd);logger[_0xb3f4('0xe')](_0xb3f4('0x15'),_0x438acd,JSON[_0xb3f4('0xf')](_0x9bb6a4));_0x1c238f(_0x9bb6a4);})[_0xb3f4('0x14')](function(_0x3522a2){logger[_0xb3f4('0x10')](_0xb3f4('0x15'),_0x3522a2[_0xb3f4('0x11')],_0x438acd);_0x108ed0(_0x3d278b[_0xb3f4('0x10')](0x1f4,_0x3522a2[_0xb3f4('0x11')]));});});}; \ No newline at end of file +var _0xc9c5=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateCmHopperFinal','CmHopperFinal','body','options','raw','lodash','bluebird'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0xc9c5,0x150));var _0x5c9c=function(_0x741334,_0x4dadd8){_0x741334=_0x741334-0x0;var _0x11f9e0=_0xc9c5[_0x741334];return _0x11f9e0;};'use strict';var _=require(_0x5c9c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5c9c('0x1'));var rs=require(_0x5c9c('0x2'));var fs=require('fs');var Redis=require(_0x5c9c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c9c('0x4'));var logger=require('../../config/logger')(_0x5c9c('0x5'));var config=require(_0x5c9c('0x6'));var jayson=require(_0x5c9c('0x7'));var client=jayson['client'][_0x5c9c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1295dd,_0x3bbb49,_0x226368){return new BPromise(function(_0x579179,_0x5637d3){return client[_0x5c9c('0x9')](_0x1295dd,_0x226368)[_0x5c9c('0xa')](function(_0x29c64e){logger['info'](_0x5c9c('0xb'),_0x3bbb49,_0x5c9c('0xc'));logger['debug'](_0x5c9c('0xd'),_0x3bbb49,_0x5c9c('0xc'),JSON[_0x5c9c('0xe')](_0x29c64e));if(_0x29c64e[_0x5c9c('0xf')]){if(_0x29c64e[_0x5c9c('0xf')][_0x5c9c('0x10')]===0x1f4){logger['error'](_0x5c9c('0xb'),_0x3bbb49,_0x29c64e[_0x5c9c('0xf')][_0x5c9c('0x11')]);return _0x5637d3(_0x29c64e[_0x5c9c('0xf')][_0x5c9c('0x11')]);}logger[_0x5c9c('0xf')](_0x5c9c('0xb'),_0x3bbb49,_0x29c64e[_0x5c9c('0xf')][_0x5c9c('0x11')]);return _0x579179(_0x29c64e['error'][_0x5c9c('0x11')]);}else{logger[_0x5c9c('0x12')](_0x5c9c('0xb'),_0x3bbb49,_0x5c9c('0xc'));_0x579179(_0x29c64e[_0x5c9c('0x13')]['message']);}})[_0x5c9c('0x14')](function(_0x356731){logger[_0x5c9c('0xf')](_0x5c9c('0xb'),_0x3bbb49,_0x356731);_0x5637d3(_0x356731);});});}exports[_0x5c9c('0x15')]=function(_0x344fbf){var _0x3e19ee=this;return new Promise(function(_0x3fe4de,_0xc39a94){return db[_0x5c9c('0x16')]['create'](_0x344fbf[_0x5c9c('0x17')],{'raw':_0x344fbf[_0x5c9c('0x18')]?_0x344fbf['options'][_0x5c9c('0x19')]===undefined?!![]:![]:!![]})[_0x5c9c('0xa')](function(_0x1ed91e){logger[_0x5c9c('0x12')](_0x5c9c('0x15'),_0x344fbf);logger['debug'](_0x5c9c('0x15'),_0x344fbf,JSON[_0x5c9c('0xe')](_0x1ed91e));_0x3fe4de(_0x1ed91e);})[_0x5c9c('0x14')](function(_0x3ae25b){logger[_0x5c9c('0xf')]('CreateCmHopperFinal',_0x3ae25b[_0x5c9c('0x11')],_0x344fbf);_0xc39a94(_0x3e19ee[_0x5c9c('0xf')](0x1f4,_0x3ae25b[_0x5c9c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index bdd705e..7de4867 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 _0x3f54=['get','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0xdaac30,_0x465845){var _0x5b6c54=function(_0x20cef3){while(--_0x20cef3){_0xdaac30['push'](_0xdaac30['shift']());}};_0x5b6c54(++_0x465845);}(_0x3f54,0x15f));var _0x43f5=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3f54[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x43f5('0x0'));var util=require(_0x43f5('0x1'));var path=require('path');var timeout=require(_0x43f5('0x2'));var express=require(_0x43f5('0x3'));var router=express['Router']();var auth=require(_0x43f5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43f5('0x5'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x43f5('0x6')](_0x43f5('0x7'),auth[_0x43f5('0x8')](),controller[_0x43f5('0x9')]);router[_0x43f5('0x6')](_0x43f5('0xa'),auth[_0x43f5('0x8')](),controller[_0x43f5('0xb')]);router[_0x43f5('0x6')](_0x43f5('0xc'),auth['isAuthenticated'](),controller[_0x43f5('0xd')]);router[_0x43f5('0x6')](_0x43f5('0xe'),auth[_0x43f5('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x43f5('0xf'),auth['isAuthenticated'](),controller[_0x43f5('0x10')]);router[_0x43f5('0x11')](_0x43f5('0x12'),auth[_0x43f5('0x8')](),controller[_0x43f5('0x13')]);router['post']('/checkContactHopper',auth[_0x43f5('0x8')](),controller['checkContactHopper']);router['put'](_0x43f5('0xa'),auth[_0x43f5('0x8')](),controller['update']);module[_0x43f5('0x14')]=router; \ No newline at end of file +var _0x90a6=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0x90a6,0xf1));var _0x690a=function(_0x37035b,_0x2914ea){_0x37035b=_0x37035b-0x0;var _0x562d89=_0x90a6[_0x37035b];return _0x562d89;};'use strict';var multer=require(_0x690a('0x0'));var util=require(_0x690a('0x1'));var path=require(_0x690a('0x2'));var timeout=require(_0x690a('0x3'));var express=require('express');var router=express[_0x690a('0x4')]();var auth=require(_0x690a('0x5'));var interaction=require(_0x690a('0x6'));var config=require('../../config/environment');var controller=require(_0x690a('0x7'));router[_0x690a('0x8')]('/',auth[_0x690a('0x9')](),controller[_0x690a('0xa')]);router[_0x690a('0x8')](_0x690a('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x690a('0xc'),auth[_0x690a('0x9')](),controller[_0x690a('0xd')]);router[_0x690a('0x8')](_0x690a('0xe'),auth[_0x690a('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x690a('0x8')]('/campaign/countAttributes/:id',auth[_0x690a('0x9')](),controller[_0x690a('0xf')]);router[_0x690a('0x10')]('/voice/queue/moveContacts/:id',auth[_0x690a('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x690a('0x10')](_0x690a('0x11'),auth[_0x690a('0x9')](),controller[_0x690a('0x12')]);router[_0x690a('0x10')](_0x690a('0x13'),auth['isAuthenticated'](),controller[_0x690a('0x14')]);router[_0x690a('0x15')](_0x690a('0xc'),auth[_0x690a('0x9')](),controller[_0x690a('0x16')]);module[_0x690a('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 0dc1df4..d3b5d86 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 _0xa0c7=['INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xa0c7,0x199));var _0x7a0c=function(_0x5dd3f8,_0x3e1515){_0x5dd3f8=_0x5dd3f8-0x0;var _0x27cef4=_0xa0c7[_0x5dd3f8];return _0x27cef4;};'use strict';var Sequelize=require(_0x7a0c('0x0'));module['exports']={'state':{'type':Sequelize[_0x7a0c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x7a0c('0x2')]},'scheduledat':{'type':Sequelize[_0x7a0c('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7a0c('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7a0c('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x7a0c('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7a0c('0x2')]},'starttime':{'type':Sequelize[_0x7a0c('0x3')]},'responsetime':{'type':Sequelize[_0x7a0c('0x3')]},'answertime':{'type':Sequelize[_0x7a0c('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x7a0c('0x3')]},'ringtime':{'type':Sequelize[_0x7a0c('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7a0c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7a0c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7a0c('0x2')]},'campaign':{'type':Sequelize[_0x7a0c('0x2')]},'campaigntype':{'type':Sequelize[_0x7a0c('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x7a0c('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7a0c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7a0c('0x3')]},'recallme':{'type':Sequelize[_0x7a0c('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7a0c('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7a0c('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7a0c('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7a0c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7295=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7295,0x180));var _0x5729=function(_0x2e33d3,_0x4375d2){_0x2e33d3=_0x2e33d3-0x0;var _0x5cd87d=_0x7295[_0x2e33d3];return _0x5cd87d;};'use strict';var Sequelize=require(_0x5729('0x0'));module[_0x5729('0x1')]={'state':{'type':Sequelize[_0x5729('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5729('0x3')]},'scheduledat':{'type':Sequelize[_0x5729('0x4')]},'countbusyretry':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5729('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5729('0x3')]},'originatecalleridname':{'type':Sequelize[_0x5729('0x3')]},'calleridnum':{'type':Sequelize[_0x5729('0x3')]},'calleridname':{'type':Sequelize[_0x5729('0x3')]},'starttime':{'type':Sequelize[_0x5729('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5729('0x4')]},'droptime':{'type':Sequelize[_0x5729('0x4')]},'endtime':{'type':Sequelize[_0x5729('0x4')]},'ringtime':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5729('0x3')]},'campaign':{'type':Sequelize[_0x5729('0x3')]},'campaigntype':{'type':Sequelize[_0x5729('0x3')]},'membername':{'type':Sequelize[_0x5729('0x3')]},'reason':{'type':Sequelize[_0x5729('0x3')]},'amd':{'type':Sequelize[_0x5729('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5729('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x5729('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5729('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5729('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5729('0x4')]},'edited':{'type':Sequelize[_0x5729('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5729('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index fb3c99c..2f70b8a 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 _0xcd3d=['show','params','include','find','create','catch','describe','uniqueid','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','CmHopperHistory','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd3d,0xa1));var _0xdcd3=function(_0x52d3d9,_0x5efa05){_0x52d3d9=_0x52d3d9-0x0;var _0x591390=_0xcd3d[_0x52d3d9];return _0x591390;};'use strict';var pdf=require(_0xdcd3('0x0'));var emlformat=require(_0xdcd3('0x1'));var rimraf=require(_0xdcd3('0x2'));var zipdir=require(_0xdcd3('0x3'));var jsonpatch=require(_0xdcd3('0x4'));var rp=require(_0xdcd3('0x5'));var moment=require('moment');var BPromise=require(_0xdcd3('0x6'));var Mustache=require('mustache');var util=require(_0xdcd3('0x7'));var path=require(_0xdcd3('0x8'));var sox=require(_0xdcd3('0x9'));var csv=require(_0xdcd3('0xa'));var ejs=require(_0xdcd3('0xb'));var fs=require('fs');var _=require(_0xdcd3('0xc'));var squel=require(_0xdcd3('0xd'));var crypto=require(_0xdcd3('0xe'));var jsforce=require(_0xdcd3('0xf'));var deskjs=require(_0xdcd3('0x10'));var toCsv=require(_0xdcd3('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdcd3('0x11'));var qs=require(_0xdcd3('0x12'));var as=require(_0xdcd3('0x13'));var hardwareService=require(_0xdcd3('0x14'));var logger=require(_0xdcd3('0x15'))(_0xdcd3('0x16'));var utils=require('../../config/utils');var config=require(_0xdcd3('0x17'));var db=require(_0xdcd3('0x18'))['db'];function respondWithStatusCode(_0xcb8db8,_0x3c13e7){_0x3c13e7=_0x3c13e7||0xcc;return function(_0x4818b3){if(_0x4818b3){return _0xcb8db8[_0xdcd3('0x19')](_0x3c13e7);}return _0xcb8db8[_0xdcd3('0x1a')](_0x3c13e7)[_0xdcd3('0x1b')]();};}function respondWithResult(_0x8a6bf,_0x157239){_0x157239=_0x157239||0xc8;return function(_0x190901){if(_0x190901){return _0x8a6bf[_0xdcd3('0x1a')](_0x157239)[_0xdcd3('0x1c')](_0x190901);}};}function respondWithFilteredResult(_0x1273e8,_0xc453a5){return function(_0x414faf){if(_0x414faf){var _0xb45d66=_0x414faf[_0xdcd3('0x1d')],_0x3e89d7=_0xc453a5['offset'],_0x25d7c7=_0xc453a5[_0xdcd3('0x1e')]+_0xc453a5[_0xdcd3('0x1f')],_0x1c6c7c;if(_0x25d7c7>=_0xb45d66){_0x25d7c7=_0xb45d66;_0x1c6c7c=0xc8;}else{_0x1c6c7c=0xce;}_0x1273e8[_0xdcd3('0x1a')](_0x1c6c7c);return _0x1273e8[_0xdcd3('0x20')](_0xdcd3('0x21'),_0x3e89d7+'-'+_0x25d7c7+'/'+_0xb45d66)[_0xdcd3('0x1c')](_0x414faf);}return null;};}function patchUpdates(_0x1ad4b9){return function(_0x205993){try{jsonpatch[_0xdcd3('0x22')](_0x205993,_0x1ad4b9,!![]);}catch(_0x4dde61){return BPromise[_0xdcd3('0x23')](_0x4dde61);}return _0x205993[_0xdcd3('0x24')]();};}function saveUpdates(_0x566065,_0x5bd13c){return function(_0x5307b5){if(_0x5307b5){return _0x5307b5[_0xdcd3('0x25')](_0x566065)[_0xdcd3('0x26')](function(_0x116c51){return _0x116c51;});}return null;};}function removeEntity(_0x20e432,_0x54aae7){return function(_0x3e0db4){if(_0x3e0db4){return _0x3e0db4[_0xdcd3('0x27')]()[_0xdcd3('0x26')](function(){_0x20e432[_0xdcd3('0x1a')](0xcc)[_0xdcd3('0x1b')]();});}};}function handleEntityNotFound(_0x4052bc,_0x51cce9){return function(_0x6249f2){if(!_0x6249f2){_0x4052bc[_0xdcd3('0x19')](0x194);}return _0x6249f2;};}function handleError(_0x4e8f68,_0x4bd4ef){_0x4bd4ef=_0x4bd4ef||0x1f4;return function(_0x130fbe){logger['error'](_0x130fbe['stack']);if(_0x130fbe[_0xdcd3('0x28')]){delete _0x130fbe[_0xdcd3('0x28')];}_0x4e8f68[_0xdcd3('0x1a')](_0x4bd4ef)[_0xdcd3('0x29')](_0x130fbe);};}exports['index']=function(_0x48a06f,_0x42a822){var _0x434872={},_0x22eeba={},_0x199973={'count':0x0,'rows':[]};var _0x511fec=_['map'](db[_0xdcd3('0x2a')][_0xdcd3('0x2b')],function(_0x19be2b){return{'name':_0x19be2b[_0xdcd3('0x2c')],'type':_0x19be2b['type']['key']};});_0x22eeba[_0xdcd3('0x2d')]=_[_0xdcd3('0x2e')](_0x511fec,_0xdcd3('0x28'));_0x22eeba[_0xdcd3('0x2f')]=_[_0xdcd3('0x30')](_0x48a06f[_0xdcd3('0x2f')]);_0x22eeba[_0xdcd3('0x31')]=_[_0xdcd3('0x32')](_0x22eeba[_0xdcd3('0x2d')],_0x22eeba['query']);_0x434872[_0xdcd3('0x33')]=_[_0xdcd3('0x32')](_0x22eeba[_0xdcd3('0x2d')],qs[_0xdcd3('0x34')](_0x48a06f[_0xdcd3('0x2f')][_0xdcd3('0x34')]));_0x434872['attributes']=_0x434872[_0xdcd3('0x33')][_0xdcd3('0x35')]?_0x434872[_0xdcd3('0x33')]:_0x22eeba[_0xdcd3('0x2d')];if(!_0x48a06f[_0xdcd3('0x2f')][_0xdcd3('0x36')](_0xdcd3('0x37'))){_0x434872['limit']=qs['limit'](_0x48a06f[_0xdcd3('0x2f')][_0xdcd3('0x1f')]);_0x434872['offset']=qs[_0xdcd3('0x1e')](_0x48a06f[_0xdcd3('0x2f')][_0xdcd3('0x1e')]);}_0x434872[_0xdcd3('0x38')]=qs[_0xdcd3('0x39')](_0x48a06f[_0xdcd3('0x2f')][_0xdcd3('0x39')]);_0x434872[_0xdcd3('0x3a')]=qs['filters'](_['pick'](_0x48a06f[_0xdcd3('0x2f')],_0x22eeba[_0xdcd3('0x31')]));if(_0x48a06f['query'][_0xdcd3('0x3b')]){_0x434872[_0xdcd3('0x3a')]=_[_0xdcd3('0x3c')](_0x434872['where'],{'$or':_['map'](_0x511fec,function(_0x460c46){if(_0x460c46[_0xdcd3('0x3d')]!==_0xdcd3('0x3e')){var _0x437519={};_0x437519[_0x460c46[_0xdcd3('0x28')]]={'$like':'%'+_0x48a06f[_0xdcd3('0x2f')][_0xdcd3('0x3b')]+'%'};return _0x437519;}})});}_0x434872=_['merge']({},_0x434872,_0x48a06f[_0xdcd3('0x3f')]);var _0x7222d6={'where':_0x434872[_0xdcd3('0x3a')]};return db[_0xdcd3('0x2a')][_0xdcd3('0x1d')](_0x7222d6)[_0xdcd3('0x26')](function(_0x1ebf49){_0x199973[_0xdcd3('0x1d')]=_0x1ebf49;if(_0x48a06f[_0xdcd3('0x2f')][_0xdcd3('0x40')]){_0x434872['include']=[{'all':!![]}];}return db[_0xdcd3('0x2a')][_0xdcd3('0x41')](_0x434872);})['then'](function(_0x939068){_0x199973[_0xdcd3('0x42')]=_0x939068;return _0x199973;})[_0xdcd3('0x26')](respondWithFilteredResult(_0x42a822,_0x434872))['catch'](handleError(_0x42a822,null));};exports[_0xdcd3('0x43')]=function(_0x114422,_0x4e9bc3){var _0x220a5e={'raw':!![],'where':{'id':_0x114422[_0xdcd3('0x44')]['id']}},_0xfc3a73={};_0xfc3a73['model']=_[_0xdcd3('0x30')](db[_0xdcd3('0x2a')][_0xdcd3('0x2b')]);_0xfc3a73['query']=_[_0xdcd3('0x30')](_0x114422[_0xdcd3('0x2f')]);_0xfc3a73[_0xdcd3('0x31')]=_[_0xdcd3('0x32')](_0xfc3a73['model'],_0xfc3a73[_0xdcd3('0x2f')]);_0x220a5e[_0xdcd3('0x33')]=_[_0xdcd3('0x32')](_0xfc3a73[_0xdcd3('0x2d')],qs['fields'](_0x114422[_0xdcd3('0x2f')][_0xdcd3('0x34')]));_0x220a5e['attributes']=_0x220a5e['attributes'][_0xdcd3('0x35')]?_0x220a5e[_0xdcd3('0x33')]:_0xfc3a73[_0xdcd3('0x2d')];if(_0x114422[_0xdcd3('0x2f')][_0xdcd3('0x40')]){_0x220a5e[_0xdcd3('0x45')]=[{'all':!![]}];}_0x220a5e=_[_0xdcd3('0x3c')]({},_0x220a5e,_0x114422[_0xdcd3('0x3f')]);return db[_0xdcd3('0x2a')][_0xdcd3('0x46')](_0x220a5e)['then'](handleEntityNotFound(_0x4e9bc3,null))[_0xdcd3('0x26')](respondWithResult(_0x4e9bc3,null))['catch'](handleError(_0x4e9bc3,null));};exports[_0xdcd3('0x47')]=function(_0x4dcf85,_0x308ed7){return db['CmHopperHistory'][_0xdcd3('0x47')](_0x4dcf85['body'],{})['then'](respondWithResult(_0x308ed7,0xc9))[_0xdcd3('0x48')](handleError(_0x308ed7,null));};exports[_0xdcd3('0x49')]=function(_0x5e0dd4,_0x56737e){return db[_0xdcd3('0x2a')][_0xdcd3('0x49')]()[_0xdcd3('0x26')](respondWithResult(_0x56737e,null))[_0xdcd3('0x48')](handleError(_0x56737e,null));};exports[_0xdcd3('0x25')]=function(_0x3476d9,_0x127e07){if(_0x3476d9['body'][_0xdcd3('0x4a')]){delete _0x3476d9[_0xdcd3('0x4b')][_0xdcd3('0x4a')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x3476d9[_0xdcd3('0x44')]['id']}})[_0xdcd3('0x26')](handleEntityNotFound(_0x127e07,null))['then'](saveUpdates(_0x3476d9[_0xdcd3('0x4b')],null))[_0xdcd3('0x26')](respondWithResult(_0x127e07,null))[_0xdcd3('0x48')](handleError(_0x127e07,null));}; \ No newline at end of file +var _0xb7d6=['mustache','util','path','to-csv','ejs','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','error','name','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','pick','where','VIRTUAL','merge','options','include','CmHopperHistory','findAll','catch','keys','includeAll','create','describe','body','uniqueid','find','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb7d6,0x7f));var _0x6b7d=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xb7d6[_0x88cd7b];return _0x56fcc8;};'use strict';var pdf=require(_0x6b7d('0x0'));var emlformat=require(_0x6b7d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6b7d('0x2'));var jsonpatch=require(_0x6b7d('0x3'));var rp=require(_0x6b7d('0x4'));var moment=require(_0x6b7d('0x5'));var BPromise=require(_0x6b7d('0x6'));var Mustache=require(_0x6b7d('0x7'));var util=require(_0x6b7d('0x8'));var path=require(_0x6b7d('0x9'));var sox=require('sox');var csv=require(_0x6b7d('0xa'));var ejs=require(_0x6b7d('0xb'));var fs=require('fs');var _=require(_0x6b7d('0xc'));var squel=require(_0x6b7d('0xd'));var crypto=require('crypto');var jsforce=require(_0x6b7d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6b7d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6b7d('0xf'));var authService=require(_0x6b7d('0x10'));var qs=require(_0x6b7d('0x11'));var as=require(_0x6b7d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b7d('0x13'))(_0x6b7d('0x14'));var utils=require(_0x6b7d('0x15'));var config=require(_0x6b7d('0x16'));var db=require(_0x6b7d('0x17'))['db'];function respondWithStatusCode(_0xf7ef7d,_0x581fba){_0x581fba=_0x581fba||0xcc;return function(_0xa4fcab){if(_0xa4fcab){return _0xf7ef7d[_0x6b7d('0x18')](_0x581fba);}return _0xf7ef7d[_0x6b7d('0x19')](_0x581fba)[_0x6b7d('0x1a')]();};}function respondWithResult(_0x4bb73f,_0x314ebc){_0x314ebc=_0x314ebc||0xc8;return function(_0x22204a){if(_0x22204a){return _0x4bb73f[_0x6b7d('0x19')](_0x314ebc)[_0x6b7d('0x1b')](_0x22204a);}};}function respondWithFilteredResult(_0x5daa2a,_0xb0fd0c){return function(_0x17b3cd){if(_0x17b3cd){var _0x59922c=_0x17b3cd[_0x6b7d('0x1c')],_0x48b359=_0xb0fd0c[_0x6b7d('0x1d')],_0x14115e=_0xb0fd0c[_0x6b7d('0x1d')]+_0xb0fd0c[_0x6b7d('0x1e')],_0x2cbb68;if(_0x14115e>=_0x59922c){_0x14115e=_0x59922c;_0x2cbb68=0xc8;}else{_0x2cbb68=0xce;}_0x5daa2a['status'](_0x2cbb68);return _0x5daa2a['set']('Content-Range',_0x48b359+'-'+_0x14115e+'/'+_0x59922c)['json'](_0x17b3cd);}return null;};}function patchUpdates(_0x4af4ba){return function(_0x9c4d67){try{jsonpatch[_0x6b7d('0x1f')](_0x9c4d67,_0x4af4ba,!![]);}catch(_0x2f2f16){return BPromise[_0x6b7d('0x20')](_0x2f2f16);}return _0x9c4d67[_0x6b7d('0x21')]();};}function saveUpdates(_0x5d7363,_0x26c9e4){return function(_0x313475){if(_0x313475){return _0x313475['update'](_0x5d7363)[_0x6b7d('0x22')](function(_0x12b8a8){return _0x12b8a8;});}return null;};}function removeEntity(_0x2fbb94,_0x1fd21d){return function(_0x55eef2){if(_0x55eef2){return _0x55eef2['destroy']()[_0x6b7d('0x22')](function(){_0x2fbb94[_0x6b7d('0x19')](0xcc)[_0x6b7d('0x1a')]();});}};}function handleEntityNotFound(_0x435b07,_0x5bc0a6){return function(_0x4b40a3){if(!_0x4b40a3){_0x435b07['sendStatus'](0x194);}return _0x4b40a3;};}function handleError(_0x825fd3,_0x2354df){_0x2354df=_0x2354df||0x1f4;return function(_0x4d56dc){logger[_0x6b7d('0x23')](_0x4d56dc['stack']);if(_0x4d56dc[_0x6b7d('0x24')]){delete _0x4d56dc[_0x6b7d('0x24')];}_0x825fd3[_0x6b7d('0x19')](_0x2354df)['send'](_0x4d56dc);};}exports['index']=function(_0x3b9030,_0x1653fa){var _0x3e2c2a={},_0x2b0970={},_0x460293={'count':0x0,'rows':[]};var _0x3a905f=_[_0x6b7d('0x25')](db['CmHopperHistory'][_0x6b7d('0x26')],function(_0x542f86){return{'name':_0x542f86[_0x6b7d('0x27')],'type':_0x542f86[_0x6b7d('0x28')][_0x6b7d('0x29')]};});_0x2b0970['model']=_[_0x6b7d('0x25')](_0x3a905f,_0x6b7d('0x24'));_0x2b0970[_0x6b7d('0x2a')]=_['keys'](_0x3b9030[_0x6b7d('0x2a')]);_0x2b0970[_0x6b7d('0x2b')]=_[_0x6b7d('0x2c')](_0x2b0970['model'],_0x2b0970['query']);_0x3e2c2a[_0x6b7d('0x2d')]=_[_0x6b7d('0x2c')](_0x2b0970[_0x6b7d('0x2e')],qs[_0x6b7d('0x2f')](_0x3b9030[_0x6b7d('0x2a')][_0x6b7d('0x2f')]));_0x3e2c2a[_0x6b7d('0x2d')]=_0x3e2c2a[_0x6b7d('0x2d')][_0x6b7d('0x30')]?_0x3e2c2a[_0x6b7d('0x2d')]:_0x2b0970[_0x6b7d('0x2e')];if(!_0x3b9030[_0x6b7d('0x2a')]['hasOwnProperty'](_0x6b7d('0x31'))){_0x3e2c2a['limit']=qs[_0x6b7d('0x1e')](_0x3b9030[_0x6b7d('0x2a')][_0x6b7d('0x1e')]);_0x3e2c2a[_0x6b7d('0x1d')]=qs[_0x6b7d('0x1d')](_0x3b9030[_0x6b7d('0x2a')]['offset']);}_0x3e2c2a['order']=qs['sort'](_0x3b9030[_0x6b7d('0x2a')]['sort']);_0x3e2c2a['where']=qs[_0x6b7d('0x2b')](_[_0x6b7d('0x32')](_0x3b9030[_0x6b7d('0x2a')],_0x2b0970['filters']));if(_0x3b9030[_0x6b7d('0x2a')]['filter']){_0x3e2c2a[_0x6b7d('0x33')]=_['merge'](_0x3e2c2a[_0x6b7d('0x33')],{'$or':_[_0x6b7d('0x25')](_0x3a905f,function(_0x2961cc){if(_0x2961cc[_0x6b7d('0x28')]!==_0x6b7d('0x34')){var _0x4cde7c={};_0x4cde7c[_0x2961cc[_0x6b7d('0x24')]]={'$like':'%'+_0x3b9030[_0x6b7d('0x2a')]['filter']+'%'};return _0x4cde7c;}})});}_0x3e2c2a=_[_0x6b7d('0x35')]({},_0x3e2c2a,_0x3b9030[_0x6b7d('0x36')]);var _0x159e43={'where':_0x3e2c2a[_0x6b7d('0x33')]};return db['CmHopperHistory'][_0x6b7d('0x1c')](_0x159e43)[_0x6b7d('0x22')](function(_0x3d29aa){_0x460293['count']=_0x3d29aa;if(_0x3b9030[_0x6b7d('0x2a')]['includeAll']){_0x3e2c2a[_0x6b7d('0x37')]=[{'all':!![]}];}return db[_0x6b7d('0x38')][_0x6b7d('0x39')](_0x3e2c2a);})[_0x6b7d('0x22')](function(_0x1b0791){_0x460293['rows']=_0x1b0791;return _0x460293;})[_0x6b7d('0x22')](respondWithFilteredResult(_0x1653fa,_0x3e2c2a))[_0x6b7d('0x3a')](handleError(_0x1653fa,null));};exports['show']=function(_0x99dd0d,_0x2583eb){var _0x4e25ea={'raw':!![],'where':{'id':_0x99dd0d['params']['id']}},_0x124e17={};_0x124e17[_0x6b7d('0x2e')]=_['keys'](db[_0x6b7d('0x38')][_0x6b7d('0x26')]);_0x124e17['query']=_[_0x6b7d('0x3b')](_0x99dd0d[_0x6b7d('0x2a')]);_0x124e17[_0x6b7d('0x2b')]=_[_0x6b7d('0x2c')](_0x124e17[_0x6b7d('0x2e')],_0x124e17['query']);_0x4e25ea[_0x6b7d('0x2d')]=_[_0x6b7d('0x2c')](_0x124e17['model'],qs[_0x6b7d('0x2f')](_0x99dd0d['query'][_0x6b7d('0x2f')]));_0x4e25ea[_0x6b7d('0x2d')]=_0x4e25ea[_0x6b7d('0x2d')][_0x6b7d('0x30')]?_0x4e25ea[_0x6b7d('0x2d')]:_0x124e17[_0x6b7d('0x2e')];if(_0x99dd0d[_0x6b7d('0x2a')][_0x6b7d('0x3c')]){_0x4e25ea[_0x6b7d('0x37')]=[{'all':!![]}];}_0x4e25ea=_[_0x6b7d('0x35')]({},_0x4e25ea,_0x99dd0d['options']);return db[_0x6b7d('0x38')]['find'](_0x4e25ea)[_0x6b7d('0x22')](handleEntityNotFound(_0x2583eb,null))[_0x6b7d('0x22')](respondWithResult(_0x2583eb,null))[_0x6b7d('0x3a')](handleError(_0x2583eb,null));};exports[_0x6b7d('0x3d')]=function(_0x4d9d81,_0x6058ae){return db[_0x6b7d('0x38')]['create'](_0x4d9d81['body'],{})[_0x6b7d('0x22')](respondWithResult(_0x6058ae,0xc9))['catch'](handleError(_0x6058ae,null));};exports[_0x6b7d('0x3e')]=function(_0x3f4196,_0x22600c){return db[_0x6b7d('0x38')][_0x6b7d('0x3e')]()['then'](respondWithResult(_0x22600c,null))['catch'](handleError(_0x22600c,null));};exports['update']=function(_0x35ee07,_0x2c6520){if(_0x35ee07[_0x6b7d('0x3f')]['uniqueid']){delete _0x35ee07['body'][_0x6b7d('0x40')];}return db[_0x6b7d('0x38')][_0x6b7d('0x41')]({'where':{'uniqueid':_0x35ee07[_0x6b7d('0x42')]['id']}})[_0x6b7d('0x22')](handleEntityNotFound(_0x2c6520,null))[_0x6b7d('0x22')](saveUpdates(_0x35ee07['body'],null))[_0x6b7d('0x22')](respondWithResult(_0x2c6520,null))[_0x6b7d('0x3a')](handleError(_0x2c6520,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 549b400..281f2af 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 _0x2ac5=['../../config/logger','moment','bluebird','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x24a4ca,_0x456078){var _0x1973f8=function(_0x3e776f){while(--_0x3e776f){_0x24a4ca['push'](_0x24a4ca['shift']());}};_0x1973f8(++_0x456078);}(_0x2ac5,0x177));var _0x52ac=function(_0xc4e092,_0x5059f7){_0xc4e092=_0xc4e092-0x0;var _0xa4f542=_0x2ac5[_0xc4e092];return _0xa4f542;};'use strict';var _=require(_0x52ac('0x0'));var util=require('util');var logger=require(_0x52ac('0x1'))('api');var moment=require(_0x52ac('0x2'));var BPromise=require(_0x52ac('0x3'));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('./cmHopperHistory.attributes');module['exports']=function(_0x512983,_0x63c953){return _0x512983[_0x52ac('0x4')](_0x52ac('0x5'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x52ac('0x6'),'fields':[_0x52ac('0x6')]},{'name':'uniqueid','fields':[_0x52ac('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd48e=['uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','CmHopperHistory','endtime'];(function(_0x6be9d9,_0x153d7e){var _0x43858f=function(_0x10bc51){while(--_0x10bc51){_0x6be9d9['push'](_0x6be9d9['shift']());}};_0x43858f(++_0x153d7e);}(_0xd48e,0x64));var _0xed48=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xd48e[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require(_0xed48('0x0'));var logger=require(_0xed48('0x1'))(_0xed48('0x2'));var moment=require('moment');var BPromise=require(_0xed48('0x3'));var rp=require(_0xed48('0x4'));var fs=require('fs');var path=require(_0xed48('0x5'));var rimraf=require(_0xed48('0x6'));var config=require(_0xed48('0x7'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x268d82,_0x1925dc){return _0x268d82['define'](_0xed48('0x8'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xed48('0x9'),'fields':[_0xed48('0x9')]},{'name':_0xed48('0xa'),'fields':[_0xed48('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 643cece..25e1595 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 _0x9348=['message','info','result','CmHopperHistory','create','body','options','then','CreateCmHopperHistory','catch','AvgHandleTime','findAll','raw','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9348,0x10d));var _0x8934=function(_0x36d348,_0x2e9572){_0x36d348=_0x36d348-0x0;var _0x287f2f=_0x9348[_0x36d348];return _0x287f2f;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});}exports['CreateCmHopperHistory']=function(_0x47f25e){var _0x597eed=this;return new Promise(function(_0x2ff9ce,_0x51f9ed){return db[_0x8934('0x16')][_0x8934('0x17')](_0x47f25e[_0x8934('0x18')],{'raw':_0x47f25e[_0x8934('0x19')]?_0x47f25e[_0x8934('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8934('0x1a')](function(_0x5ae49f){logger[_0x8934('0x14')](_0x8934('0x1b'),_0x47f25e);logger[_0x8934('0xd')](_0x8934('0x1b'),_0x47f25e,JSON[_0x8934('0x10')](_0x5ae49f));_0x2ff9ce(_0x5ae49f);})[_0x8934('0x1c')](function(_0x36fe20){logger['error'](_0x8934('0x1b'),_0x36fe20[_0x8934('0x13')],_0x47f25e);_0x51f9ed(_0x597eed[_0x8934('0x11')](0x1f4,_0x36fe20[_0x8934('0x13')]));});});};exports[_0x8934('0x1d')]=function(_0x5e593b){var _0x3cf295=this;return new Promise(function(_0x1c15c5,_0x1b5775){return db['CmHopperHistory'][_0x8934('0x1e')]({'raw':_0x5e593b['options']?_0x5e593b[_0x8934('0x19')][_0x8934('0x1f')]===undefined?!![]:![]:!![],'where':_0x5e593b[_0x8934('0x19')]?_0x5e593b['options'][_0x8934('0x20')]||null:null,'attributes':[[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['col']('id')),_0x8934('0x23')],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')](_0x8934('0x25')))),_0x8934('0x26')],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db['sequelize']['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')]('`state`\x20=\x2010,\x201,\x20null'))),_0x8934('0x27')],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['fn']('IF',db['sequelize'][_0x8934('0x24')](_0x8934('0x28')))),_0x8934('0x29')],[db[_0x8934('0x21')]['fn'](_0x8934('0x2a'),db['sequelize']['fn']('IF',db[_0x8934('0x21')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x8934('0x2b')],[db[_0x8934('0x21')]['fn'](_0x8934('0x2a'),db[_0x8934('0x21')]['fn']('IF',db['sequelize'][_0x8934('0x24')](_0x8934('0x2c')))),_0x8934('0x2d')]]})[_0x8934('0x1a')](function(_0x7b2a1c){logger['info'](_0x8934('0x1d'),_0x5e593b);logger[_0x8934('0xd')]('AvgHandleTime',_0x5e593b,JSON['stringify'](_0x7b2a1c));_0x1c15c5(_0x7b2a1c);})[_0x8934('0x1c')](function(_0x2a790f){logger['error']('AvgHandleTime',_0x2a790f[_0x8934('0x13')],_0x5e593b);_0x1b5775(_0x3cf295[_0x8934('0x11')](0x1f4,_0x2a790f[_0x8934('0x13')]));});});};exports[_0x8934('0x2e')]=function(_0x834d54){var _0x1c624f=this;return new Promise(function(_0x30f8c6,_0x1bc2d8){return db[_0x8934('0x16')][_0x8934('0x1e')]({'raw':_0x834d54[_0x8934('0x19')]?_0x834d54['options'][_0x8934('0x1f')]===undefined?!![]:![]:!![],'where':_0x834d54[_0x8934('0x19')]?_0x834d54['options'][_0x8934('0x20')]||null:null,'attributes':[[_0x8934('0x2f'),_0x8934('0x30')],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x8934('0x31')))),_0x8934('0x32')],[db[_0x8934('0x21')]['fn']('COUNT',db[_0x8934('0x21')]['fn']('IF',db['sequelize']['literal'](_0x8934('0x33')))),_0x8934('0x34')],[db['sequelize']['fn']('COUNT',db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x8934('0x35')],[db['sequelize']['fn'](_0x8934('0x22'),db['sequelize']['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')](_0x8934('0x36')))),'outboundBusyCallsDay'],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')]['literal'](_0x8934('0x37')))),_0x8934('0x38')],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')](_0x8934('0x39')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')]['literal'](_0x8934('0x3a')))),'outboundDropCallsDayCallersExit'],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db['sequelize']['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')](_0x8934('0x3b')))),_0x8934('0x3c')],[db['sequelize']['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['fn']('IF',db['sequelize'][_0x8934('0x24')](_0x8934('0x3d')))),_0x8934('0x3e')],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')](_0x8934('0x3f')))),_0x8934('0x40')],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')](_0x8934('0x41')))),_0x8934('0x42')],[db[_0x8934('0x21')]['fn']('COUNT',db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x8934('0x42')],[db['sequelize']['fn']('COUNT',db[_0x8934('0x21')]['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')](_0x8934('0x43')))),_0x8934('0x44')]],'group':[_0x8934('0x2f')]})[_0x8934('0x1a')](function(_0x575bd7){logger[_0x8934('0x14')]('GetVoiceQueueHopperHistory',_0x834d54);logger[_0x8934('0xd')](_0x8934('0x2e'),_0x834d54,JSON[_0x8934('0x10')](_0x575bd7));_0x30f8c6(_0x575bd7);})[_0x8934('0x1c')](function(_0x40be23){logger[_0x8934('0x11')](_0x8934('0x2e'),_0x40be23[_0x8934('0x13')],_0x834d54);_0x1bc2d8(_0x1c624f['error'](0x1f4,_0x40be23[_0x8934('0x13')]));});});};exports[_0x8934('0x45')]=function(_0x25cfe0){var _0xadc2f4=this;return new Promise(function(_0x2ab06d,_0x5a791a){return db[_0x8934('0x16')][_0x8934('0x1e')]({'raw':_0x25cfe0[_0x8934('0x19')]?_0x25cfe0['options'][_0x8934('0x1f')]===undefined?!![]:![]:!![],'where':_0x25cfe0[_0x8934('0x19')]?_0x25cfe0[_0x8934('0x19')]['where']||null:null,'attributes':[['campaign','name'],[db[_0x8934('0x21')]['fn'](_0x8934('0x22'),db[_0x8934('0x21')]['col']('id')),_0x8934('0x46')],[db[_0x8934('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8934('0x21')][_0x8934('0x24')](_0x8934('0x25')))),_0x8934('0x47')]],'group':['campaign']})['then'](function(_0x4ea19e){logger['info'](_0x8934('0x45'),_0x25cfe0);logger[_0x8934('0xd')](_0x8934('0x45'),_0x25cfe0,JSON[_0x8934('0x10')](_0x4ea19e));_0x2ab06d(_0x4ea19e);})[_0x8934('0x1c')](function(_0x4382be){logger['error'](_0x8934('0x45'),_0x4382be[_0x8934('0x13')],_0x25cfe0);_0x5a791a(_0xadc2f4['error'](0x1f4,_0x4382be[_0x8934('0x13')]));});});}; \ No newline at end of file +var _0xd64b=['`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','name','col','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','then','debug','AvgHandleTime','findAll','raw','where','sequelize','literal','predictiveIntervalAnsweredCalls','COUNT','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay'];(function(_0x3bc00f,_0x37babf){var _0x1af8d1=function(_0x51fe88){while(--_0x51fe88){_0x3bc00f['push'](_0x3bc00f['shift']());}};_0x1af8d1(++_0x37babf);}(_0xd64b,0xc1));var _0xbd64=function(_0xfdc816,_0x4e0916){_0xfdc816=_0xfdc816-0x0;var _0x40c5f2=_0xd64b[_0xfdc816];return _0x40c5f2;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});}exports[_0xbd64('0x13')]=function(_0x1d7a14){var _0x17d015=this;return new Promise(function(_0x2f4554,_0xa5491d){return db[_0xbd64('0x14')]['create'](_0x1d7a14[_0xbd64('0x15')],{'raw':_0x1d7a14[_0xbd64('0x16')]?_0x1d7a14['options']['raw']===undefined?!![]:![]:!![]})[_0xbd64('0x17')](function(_0x42b328){logger[_0xbd64('0x9')](_0xbd64('0x13'),_0x1d7a14);logger[_0xbd64('0x18')](_0xbd64('0x13'),_0x1d7a14,JSON['stringify'](_0x42b328));_0x2f4554(_0x42b328);})['catch'](function(_0x6038f){logger[_0xbd64('0xe')](_0xbd64('0x13'),_0x6038f[_0xbd64('0x10')],_0x1d7a14);_0xa5491d(_0x17d015['error'](0x1f4,_0x6038f['message']));});});};exports[_0xbd64('0x19')]=function(_0x4afaff){var _0x46ab38=this;return new Promise(function(_0x5b356b,_0x33452d){return db[_0xbd64('0x14')][_0xbd64('0x1a')]({'raw':_0x4afaff[_0xbd64('0x16')]?_0x4afaff['options'][_0xbd64('0x1b')]===undefined?!![]:![]:!![],'where':_0x4afaff[_0xbd64('0x16')]?_0x4afaff[_0xbd64('0x16')][_0xbd64('0x1c')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xbd64('0x1d')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0xbd64('0x1d')]['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db['sequelize'][_0xbd64('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0xbd64('0x1f')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x2010,\x201,\x20null'))),_0xbd64('0x21')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xbd64('0x1d')]['fn']('AVG',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xbd64('0x22')],[db['sequelize']['fn']('AVG',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xbd64('0x23')]]})['then'](function(_0x1fc9cf){logger[_0xbd64('0x9')](_0xbd64('0x19'),_0x4afaff);logger[_0xbd64('0x18')](_0xbd64('0x19'),_0x4afaff,JSON[_0xbd64('0xd')](_0x1fc9cf));_0x5b356b(_0x1fc9cf);})['catch'](function(_0x4d870e){logger[_0xbd64('0xe')](_0xbd64('0x19'),_0x4d870e[_0xbd64('0x10')],_0x4afaff);_0x33452d(_0x46ab38[_0xbd64('0xe')](0x1f4,_0x4d870e[_0xbd64('0x10')]));});});};exports[_0xbd64('0x24')]=function(_0x54784f){var _0x5a74a9=this;return new Promise(function(_0x1db1fa,_0x1bcd4c){return db[_0xbd64('0x14')]['findAll']({'raw':_0x54784f['options']?_0x54784f[_0xbd64('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x54784f[_0xbd64('0x16')]?_0x54784f['options'][_0xbd64('0x1c')]||null:null,'attributes':[[_0xbd64('0x25'),'name'],[db[_0xbd64('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x26')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')]['literal'](_0xbd64('0x27')))),_0xbd64('0x28')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0xbd64('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x29')))),_0xbd64('0x2a')],[db[_0xbd64('0x1d')]['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')]['literal'](_0xbd64('0x2b')))),_0xbd64('0x2c')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xbd64('0x2d')],[db['sequelize']['fn'](_0xbd64('0x20'),db['sequelize']['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x2e')))),'outboundDropCallsDayCallersExit'],[db[_0xbd64('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xbd64('0x1e')](_0xbd64('0x2f')))),_0xbd64('0x30')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')]['literal'](_0xbd64('0x31')))),_0xbd64('0x32')],[db[_0xbd64('0x1d')]['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x33')))),_0xbd64('0x34')],[db['sequelize']['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x35')))),_0xbd64('0x36')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x37')))),_0xbd64('0x38')],[db[_0xbd64('0x1d')]['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xbd64('0x25')]})[_0xbd64('0x17')](function(_0x5480f5){logger[_0xbd64('0x9')](_0xbd64('0x24'),_0x54784f);logger[_0xbd64('0x18')]('GetVoiceQueueHopperHistory',_0x54784f,JSON[_0xbd64('0xd')](_0x5480f5));_0x1db1fa(_0x5480f5);})[_0xbd64('0x12')](function(_0x44cd4f){logger[_0xbd64('0xe')](_0xbd64('0x24'),_0x44cd4f[_0xbd64('0x10')],_0x54784f);_0x1bcd4c(_0x5a74a9['error'](0x1f4,_0x44cd4f['message']));});});};exports['GetCampaignHopperHistory']=function(_0x11c50e){var _0x15c0de=this;return new Promise(function(_0x3548fe,_0x958272){return db['CmHopperHistory'][_0xbd64('0x1a')]({'raw':_0x11c50e[_0xbd64('0x16')]?_0x11c50e[_0xbd64('0x16')][_0xbd64('0x1b')]===undefined?!![]:![]:!![],'where':_0x11c50e[_0xbd64('0x16')]?_0x11c50e[_0xbd64('0x16')]['where']||null:null,'attributes':[[_0xbd64('0x25'),_0xbd64('0x39')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')][_0xbd64('0x3a')]('id')),_0xbd64('0x3b')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0xbd64('0x25')]})[_0xbd64('0x17')](function(_0x5ab7b3){logger['info'](_0xbd64('0x3c'),_0x11c50e);logger[_0xbd64('0x18')]('GetCampaignHopperHistory',_0x11c50e,JSON[_0xbd64('0xd')](_0x5ab7b3));_0x3548fe(_0x5ab7b3);})[_0xbd64('0x12')](function(_0x45573c){logger[_0xbd64('0xe')](_0xbd64('0x3c'),_0x45573c[_0xbd64('0x10')],_0x11c50e);_0x958272(_0x15c0de[_0xbd64('0xe')](0x1f4,_0x45573c[_0xbd64('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index f427184..5c7d02e 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 _0x648e=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update'];(function(_0x4d4abe,_0x4fa526){var _0x594899=function(_0x40945c){while(--_0x40945c){_0x4d4abe['push'](_0x4d4abe['shift']());}};_0x594899(++_0x4fa526);}(_0x648e,0xa3));var _0xe648=function(_0x3179b1,_0x1cd3aa){_0x3179b1=_0x3179b1-0x0;var _0xbef372=_0x648e[_0x3179b1];return _0xbef372;};'use strict';var multer=require(_0xe648('0x0'));var util=require(_0xe648('0x1'));var path=require('path');var timeout=require(_0xe648('0x2'));var express=require('express');var router=express[_0xe648('0x3')]();var auth=require(_0xe648('0x4'));var interaction=require(_0xe648('0x5'));var config=require(_0xe648('0x6'));var controller=require(_0xe648('0x7'));router[_0xe648('0x8')]('/',auth[_0xe648('0x9')](),controller[_0xe648('0xa')]);router[_0xe648('0x8')](_0xe648('0xb'),auth[_0xe648('0x9')](),controller[_0xe648('0xc')]);router[_0xe648('0x8')](_0xe648('0xd'),auth[_0xe648('0x9')](),controller['show']);router[_0xe648('0xe')]('/',auth[_0xe648('0x9')](),controller['create']);router[_0xe648('0xf')]('/:id',auth[_0xe648('0x9')](),controller[_0xe648('0x10')]);module[_0xe648('0x11')]=router; \ No newline at end of file +var _0xa0c8=['post','create','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x52e540,_0x1d848a){var _0x5e3a2c=function(_0xc2f2d5){while(--_0xc2f2d5){_0x52e540['push'](_0x52e540['shift']());}};_0x5e3a2c(++_0x1d848a);}(_0xa0c8,0xf2));var _0x8a0c=function(_0x4ffafb,_0x20171a){_0x4ffafb=_0x4ffafb-0x0;var _0x4ab472=_0xa0c8[_0x4ffafb];return _0x4ab472;};'use strict';var multer=require(_0x8a0c('0x0'));var util=require(_0x8a0c('0x1'));var path=require('path');var timeout=require(_0x8a0c('0x2'));var express=require(_0x8a0c('0x3'));var router=express[_0x8a0c('0x4')]();var auth=require(_0x8a0c('0x5'));var interaction=require(_0x8a0c('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x8a0c('0x7')](),controller[_0x8a0c('0x8')]);router[_0x8a0c('0x9')](_0x8a0c('0xa'),auth[_0x8a0c('0x7')](),controller[_0x8a0c('0xb')]);router['get'](_0x8a0c('0xc'),auth['isAuthenticated'](),controller[_0x8a0c('0xd')]);router[_0x8a0c('0xe')]('/',auth[_0x8a0c('0x7')](),controller[_0x8a0c('0xf')]);router['put'](_0x8a0c('0xc'),auth['isAuthenticated'](),controller['update']);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 10aab7f..8e27df7 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 _0xb690=['exports','STRING','sequelize'];(function(_0xa6df52,_0x1b8584){var _0x5edd57=function(_0x543f11){while(--_0x543f11){_0xa6df52['push'](_0xa6df52['shift']());}};_0x5edd57(++_0x1b8584);}(_0xb690,0x182));var _0x0b69=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0xb690[_0x11155f];return _0xd07e48;};'use strict';var Sequelize=require(_0x0b69('0x0'));module[_0x0b69('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x0b69('0x2')]}}; \ No newline at end of file +var _0x3ea7=['sequelize','exports','name','STRING'];(function(_0xc1f0cc,_0x2ba33b){var _0x406776=function(_0x4dd327){while(--_0x4dd327){_0xc1f0cc['push'](_0xc1f0cc['shift']());}};_0x406776(++_0x2ba33b);}(_0x3ea7,0x1c8));var _0x73ea=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0x3ea7[_0x257b0e];return _0x27ac2a;};'use strict';var Sequelize=require(_0x73ea('0x0'));module[_0x73ea('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x73ea('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x73ea('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 31a0d2e..e01a53a 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 _0xedd9=['end','json','count','offset','Content-Range','apply','save','update','then','destroy','get','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','length','includeAll','find','create','body','user','role','Lists','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','Disposition','findAll','removeDispositions','addContacts','CmContact','tags','isArray','join','push','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','cf_%d','raw','getContactsCsv','CustomFields','format','isEmpty','now','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','Content-type','download','/tmp/list_%d_%s.csv','addCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','findOne','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status'];(function(_0x499b00,_0x390b06){var _0x3d9397=function(_0xc7eb3c){while(--_0xc7eb3c){_0x499b00['push'](_0x499b00['shift']());}};_0x3d9397(++_0x390b06);}(_0xedd9,0xfc));var _0x9edd=function(_0x9545c8,_0x13e3da){_0x9545c8=_0x9545c8-0x0;var _0x1036b9=_0xedd9[_0x9545c8];return _0x1036b9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var db=require(_0x9edd('0x16'))['db'];config[_0x9edd('0x17')]=_[_0x9edd('0x18')](config[_0x9edd('0x17')],{'host':_0x9edd('0x19'),'port':0x18eb});var socket=require(_0x9edd('0x1a'))(new Redis(config[_0x9edd('0x17')]));require('./cmList.socket')[_0x9edd('0x1b')](socket);function respondWithStatusCode(_0x44fc7c,_0x891832){_0x891832=_0x891832||0xcc;return function(_0x4d9a7){if(_0x4d9a7){return _0x44fc7c[_0x9edd('0x1c')](_0x891832);}return _0x44fc7c[_0x9edd('0x1d')](_0x891832)[_0x9edd('0x1e')]();};}function respondWithResult(_0x75a4ab,_0x4ea60f){_0x4ea60f=_0x4ea60f||0xc8;return function(_0x5f5bf4){if(_0x5f5bf4){return _0x75a4ab[_0x9edd('0x1d')](_0x4ea60f)[_0x9edd('0x1f')](_0x5f5bf4);}};}function respondWithFilteredResult(_0x5acf65,_0x1b54c0){return function(_0x35f454){if(_0x35f454){var _0x40ba32=_0x35f454[_0x9edd('0x20')],_0x4d8f33=_0x1b54c0[_0x9edd('0x21')],_0x43dc70=_0x1b54c0['offset']+_0x1b54c0['limit'],_0x5d879c;if(_0x43dc70>=_0x40ba32){_0x43dc70=_0x40ba32;_0x5d879c=0xc8;}else{_0x5d879c=0xce;}_0x5acf65[_0x9edd('0x1d')](_0x5d879c);return _0x5acf65['set'](_0x9edd('0x22'),_0x4d8f33+'-'+_0x43dc70+'/'+_0x40ba32)['json'](_0x35f454);}return null;};}function patchUpdates(_0x535f37){return function(_0x356751){try{jsonpatch[_0x9edd('0x23')](_0x356751,_0x535f37,!![]);}catch(_0x4fb7bf){return BPromise['reject'](_0x4fb7bf);}return _0x356751[_0x9edd('0x24')]();};}function saveUpdates(_0x186186,_0x477878){return function(_0x542172){if(_0x542172){return _0x542172[_0x9edd('0x25')](_0x186186)[_0x9edd('0x26')](function(_0x44a6c1){return _0x44a6c1;});}return null;};}function removeEntity(_0x2ca65f,_0x339a0d){return function(_0x4c75d2){if(_0x4c75d2){return _0x4c75d2[_0x9edd('0x27')]()[_0x9edd('0x26')](function(){var _0x3a1ea5=_0x4c75d2[_0x9edd('0x28')]({'plain':!![]});var _0x310a4d='Lists';return db['UserProfileResource'][_0x9edd('0x27')]({'where':{'type':_0x310a4d,'resourceId':_0x3a1ea5['id']}})[_0x9edd('0x26')](function(){return _0x4c75d2;});})[_0x9edd('0x26')](function(){_0x2ca65f[_0x9edd('0x1d')](0xcc)[_0x9edd('0x1e')]();});}};}function handleEntityNotFound(_0x4fe471,_0x57a2cc){return function(_0x214d0a){if(!_0x214d0a){_0x4fe471[_0x9edd('0x1c')](0x194);}return _0x214d0a;};}function handleError(_0x1c762c,_0x52746a){_0x52746a=_0x52746a||0x1f4;return function(_0x238b22){logger[_0x9edd('0x29')](_0x238b22[_0x9edd('0x2a')]);if(_0x238b22[_0x9edd('0x2b')]){delete _0x238b22['name'];}_0x1c762c[_0x9edd('0x1d')](_0x52746a)[_0x9edd('0x2c')](_0x238b22);};}exports[_0x9edd('0x2d')]=function(_0x12c1bc,_0xbbf08f){var _0x42e664={},_0x209aba={},_0x1fba7b={'count':0x0,'rows':[]};var _0x19b6c1=_[_0x9edd('0x2e')](db[_0x9edd('0x2f')][_0x9edd('0x30')],function(_0x6907a5){return{'name':_0x6907a5[_0x9edd('0x31')],'type':_0x6907a5[_0x9edd('0x32')]['key']};});_0x209aba[_0x9edd('0x33')]=_[_0x9edd('0x2e')](_0x19b6c1,_0x9edd('0x2b'));_0x209aba['query']=_[_0x9edd('0x34')](_0x12c1bc[_0x9edd('0x35')]);_0x209aba[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x209aba[_0x9edd('0x33')],_0x209aba[_0x9edd('0x35')]);_0x42e664[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x209aba[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x39')]));_0x42e664[_0x9edd('0x38')]=_0x42e664[_0x9edd('0x38')]['length']?_0x42e664[_0x9edd('0x38')]:_0x209aba['model'];if(!_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x42e664[_0x9edd('0x3c')]=qs[_0x9edd('0x3c')](_0x12c1bc['query'][_0x9edd('0x3c')]);_0x42e664[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x42e664[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x42e664[_0x9edd('0x3f')]=qs['filters'](_[_0x9edd('0x40')](_0x12c1bc['query'],_0x209aba[_0x9edd('0x36')]));if(_0x12c1bc['query'][_0x9edd('0x41')]){_0x42e664[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x42e664['where'],{'$or':_[_0x9edd('0x2e')](_0x19b6c1,function(_0xcbd0ef){if(_0xcbd0ef[_0x9edd('0x32')]!=='VIRTUAL'){var _0x1b5a43={};_0x1b5a43[_0xcbd0ef['name']]={'$like':'%'+_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x1b5a43;}})});}_0x42e664=_['merge']({},_0x42e664,_0x12c1bc[_0x9edd('0x43')]);var _0x40fdfb={'where':_0x42e664[_0x9edd('0x3f')]};return db[_0x9edd('0x2f')]['count'](_0x40fdfb)[_0x9edd('0x26')](function(_0x5bbdf8){_0x1fba7b[_0x9edd('0x20')]=_0x5bbdf8;if(_0x12c1bc[_0x9edd('0x35')]['includeAll']){_0x42e664[_0x9edd('0x44')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x42e664);})[_0x9edd('0x26')](function(_0x9cab86){_0x1fba7b[_0x9edd('0x45')]=_0x9cab86;return _0x1fba7b;})[_0x9edd('0x26')](respondWithFilteredResult(_0xbbf08f,_0x42e664))[_0x9edd('0x46')](handleError(_0xbbf08f,null));};exports[_0x9edd('0x47')]=function(_0x3ff512,_0x75efbe){var _0x18c149={'raw':![],'where':{'id':_0x3ff512[_0x9edd('0x48')]['id']}},_0x2b081a={};_0x2b081a[_0x9edd('0x33')]=_[_0x9edd('0x34')](db[_0x9edd('0x2f')][_0x9edd('0x30')]);_0x2b081a['query']=_[_0x9edd('0x34')](_0x3ff512[_0x9edd('0x35')]);_0x2b081a[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x2b081a[_0x9edd('0x33')],_0x2b081a[_0x9edd('0x35')]);_0x18c149[_0x9edd('0x38')]=_['intersection'](_0x2b081a['model'],qs['fields'](_0x3ff512[_0x9edd('0x35')]['fields']));_0x18c149[_0x9edd('0x38')]=_0x18c149[_0x9edd('0x38')][_0x9edd('0x49')]?_0x18c149[_0x9edd('0x38')]:_0x2b081a[_0x9edd('0x33')];if(_0x3ff512['query'][_0x9edd('0x4a')]){_0x18c149[_0x9edd('0x44')]=[{'all':!![]}];}_0x18c149=_[_0x9edd('0x42')]({},_0x18c149,_0x3ff512['options']);return db[_0x9edd('0x2f')][_0x9edd('0x4b')](_0x18c149)[_0x9edd('0x26')](handleEntityNotFound(_0x75efbe,null))[_0x9edd('0x26')](respondWithResult(_0x75efbe,null))[_0x9edd('0x46')](handleError(_0x75efbe,null));};exports[_0x9edd('0x4c')]=function(_0x4d4f33,_0x441e4a){return db[_0x9edd('0x2f')]['create'](_0x4d4f33[_0x9edd('0x4d')],{})[_0x9edd('0x26')](function(_0x4bb324){var _0x2bd089=_0x4d4f33[_0x9edd('0x4e')][_0x9edd('0x28')]({'plain':!![]});if(!_0x2bd089)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bd089[_0x9edd('0x4f')]===_0x9edd('0x4e')){var _0x317a60=_0x4bb324[_0x9edd('0x28')]({'plain':!![]});var _0x53f6e3=_0x9edd('0x50');return db[_0x9edd('0x51')][_0x9edd('0x4b')]({'where':{'name':_0x53f6e3,'userProfileId':_0x2bd089['userProfileId']},'raw':!![]})[_0x9edd('0x26')](function(_0x21f6ce){if(_0x21f6ce&&_0x21f6ce['autoAssociation']===0x0){return db[_0x9edd('0x52')]['create']({'name':_0x317a60[_0x9edd('0x2b')],'resourceId':_0x317a60['id'],'type':_0x21f6ce[_0x9edd('0x2b')],'sectionId':_0x21f6ce['id']},{})[_0x9edd('0x26')](function(){return _0x4bb324;});}else{return _0x4bb324;}})[_0x9edd('0x46')](function(_0x1e3c19){logger[_0x9edd('0x29')](_0x9edd('0x53'),_0x1e3c19);throw _0x1e3c19;});}return _0x4bb324;})[_0x9edd('0x26')](respondWithResult(_0x441e4a,0xc9))[_0x9edd('0x46')](handleError(_0x441e4a,null));};exports[_0x9edd('0x25')]=function(_0x31272d,_0x5a3b1d){if(_0x31272d[_0x9edd('0x4d')]['id']){delete _0x31272d[_0x9edd('0x4d')]['id'];}return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x31272d[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a3b1d,null))['then'](saveUpdates(_0x31272d['body'],null))[_0x9edd('0x26')](respondWithResult(_0x5a3b1d,null))[_0x9edd('0x46')](handleError(_0x5a3b1d,null));};exports[_0x9edd('0x27')]=function(_0x35ddb3,_0x48a900){return db['CmList']['find']({'where':{'id':_0x35ddb3[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x48a900,null))[_0x9edd('0x26')](removeEntity(_0x48a900,null))[_0x9edd('0x46')](handleError(_0x48a900,null));};exports[_0x9edd('0x54')]=function(_0x41ec97,_0x25906c){return db[_0x9edd('0x2f')]['describe']()[_0x9edd('0x26')](respondWithResult(_0x25906c,null))['catch'](handleError(_0x25906c,null));};exports[_0x9edd('0x55')]=function(_0x6a1cfc,_0x4b7e68,_0x22b91a){if(_0x6a1cfc[_0x9edd('0x4d')]['id']){delete _0x6a1cfc[_0x9edd('0x4d')]['id'];}return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0x6a1cfc[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x4b7e68,null))[_0x9edd('0x26')](function(_0x1720b1){if(_0x1720b1){_0x6a1cfc[_0x9edd('0x4d')]['ListId']=_0x1720b1['id'];return db['Disposition'][_0x9edd('0x4c')](_0x6a1cfc['body']);}})[_0x9edd('0x26')](respondWithResult(_0x4b7e68,null))[_0x9edd('0x46')](handleError(_0x4b7e68,null));};exports[_0x9edd('0x56')]=function(_0x17d2f2,_0x5df1d7,_0x21ead2){var _0x507cce={'raw':![],'where':{}};var _0x3e5dca={};var _0x344692={'count':0x0,'rows':[]};return db[_0x9edd('0x2f')]['findOne']({'where':{'id':_0x17d2f2[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5df1d7,null))[_0x9edd('0x26')](function(_0x4e1eda){if(_0x4e1eda){_0x3e5dca['model']=_[_0x9edd('0x34')](db['Disposition'][_0x9edd('0x30')]);_0x3e5dca[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x17d2f2['query']);_0x3e5dca[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x3e5dca[_0x9edd('0x33')],_0x3e5dca[_0x9edd('0x35')]);_0x507cce[_0x9edd('0x38')]=_['intersection'](_0x3e5dca['model'],qs[_0x9edd('0x39')](_0x17d2f2[_0x9edd('0x35')]['fields']));_0x507cce['attributes']=_0x507cce['attributes'][_0x9edd('0x49')]?_0x507cce['attributes']:_0x3e5dca['model'];if(!_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x3a')]('nolimit')){_0x507cce[_0x9edd('0x3c')]=qs[_0x9edd('0x3c')](_0x17d2f2[_0x9edd('0x35')]['limit']);_0x507cce[_0x9edd('0x21')]=qs['offset'](_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x507cce['order']=qs[_0x9edd('0x3e')](_0x17d2f2[_0x9edd('0x35')]['sort']);_0x507cce[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x17d2f2[_0x9edd('0x35')],_0x3e5dca['filters']));_0x507cce[_0x9edd('0x3f')]['ListId']=_0x4e1eda['id'];if(_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x41')]){_0x507cce[_0x9edd('0x3f')]=_['merge'](_0x507cce[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x507cce[_0x9edd('0x38')],function(_0x383cb9){var _0x25626a={};_0x25626a[_0x383cb9]={'$like':'%'+_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x25626a;})});}_0x507cce=_['merge']({},_0x507cce,_0x17d2f2['options']);return db[_0x9edd('0x57')][_0x9edd('0x20')]({'where':_0x507cce[_0x9edd('0x3f')]})[_0x9edd('0x26')](function(_0x1e2126){_0x344692['count']=_0x1e2126;if(_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x4a')]){_0x507cce[_0x9edd('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x9edd('0x58')](_0x507cce);})[_0x9edd('0x26')](function(_0x4b1c12){_0x344692[_0x9edd('0x45')]=_0x4b1c12;return _0x344692;});}})[_0x9edd('0x26')](respondWithFilteredResult(_0x5df1d7,_0x507cce))['catch'](handleError(_0x5df1d7,null));};exports[_0x9edd('0x59')]=function(_0x1e2de6,_0x566be7,_0x3f08ac){return db['CmList']['find']({'where':{'id':_0x1e2de6[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x566be7,null))[_0x9edd('0x26')](function(_0x5b56c7){if(_0x5b56c7){return _0x5b56c7[_0x9edd('0x59')](_0x1e2de6[_0x9edd('0x35')]['ids']);}})[_0x9edd('0x26')](respondWithStatusCode(_0x566be7,null))[_0x9edd('0x46')](handleError(_0x566be7,null));};exports[_0x9edd('0x5a')]=function(_0x1ad198,_0x54ac71,_0x5e68db){return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x1ad198[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x54ac71,null))[_0x9edd('0x26')](function(_0x3cfd35){if(_0x3cfd35){var _0x195921=[];var _0x4786f8={'success':[],'errors':[]};return db[_0x9edd('0x5b')][_0x9edd('0x54')]()[_0x9edd('0x26')](function(_0x554241){if(_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]&&_[_0x9edd('0x5d')](_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')])){if(_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]['length']){_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]=_0x1ad198['body'][_0x9edd('0x5c')][_0x9edd('0x5e')](';')+';';}else{_0x1ad198['body'][_0x9edd('0x5c')]=null;}}else{_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]=null;}if(_0x1ad198['body']&&_[_0x9edd('0x5d')](_0x1ad198[_0x9edd('0x4d')])){for(var _0x3f04d3=0x0;_0x3f04d3<_0x1ad198['body']['length'];_0x3f04d3+=0x1){_0x1ad198['body'][_0x3f04d3]['ListId']=_0x1ad198[_0x9edd('0x48')]['id'];_0x195921[_0x9edd('0x5f')](_0x1ad198[_0x9edd('0x4d')][_0x3f04d3]);}return BPromise['each'](_0x195921,function(_0x53e141){return db['CmContact'][_0x9edd('0x4c')](_[_0x9edd('0x60')](_0x53e141,[_0x9edd('0x61'),'id'])||{},{'fields':_[_0x9edd('0x34')](_0x554241),'raw':!![]})[_0x9edd('0x26')](function(_0x18b25e){_0x4786f8[_0x9edd('0x62')][_0x9edd('0x5f')](_0x18b25e[_0x9edd('0x63')]);})[_0x9edd('0x46')](function(_0x2523b5){_0x4786f8[_0x9edd('0x64')]['push']({'data':_0x53e141,'error':_0x2523b5[_0x9edd('0x65')]});});})[_0x9edd('0x26')](function(_0x33b5dc){return _0x4786f8;})[_0x9edd('0x46')](function(_0x104afc){return _0x104afc;});}else{_0x54ac71[_0x9edd('0x1d')](0x190)[_0x9edd('0x1f')]({'message':_0x9edd('0x66')});}});}})['then'](respondWithResult(_0x54ac71,null))['catch'](handleError(_0x54ac71,null));};exports[_0x9edd('0x67')]=function(_0x4ec836,_0x35950b,_0x4a685e){var _0x21c35f;return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x4ec836[_0x9edd('0x48')]['id']},'include':[{'model':db[_0x9edd('0x68')],'as':'CustomFields'}]})[_0x9edd('0x26')](handleEntityNotFound(_0x35950b,null))[_0x9edd('0x26')](function(_0x42d546){if(_0x42d546){_0x21c35f=_0x42d546;return db[_0x9edd('0x5b')][_0x9edd('0x30')];}})['then'](function(_0x33a077){if(_0x33a077){var _0x3ff07e={};var _0x3ec531={};_0x3ec531[_0x9edd('0x33')]=_[_0x9edd('0x69')](_['keys'](_0x33a077),_['map'](_0x21c35f['CustomFields'],function(_0x50316a){return util['format'](_0x9edd('0x6a'),_0x50316a['id']);}));_0x3ec531['query']=_['keys'](_0x4ec836[_0x9edd('0x35')]);_0x3ec531[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x3ec531[_0x9edd('0x33')],_0x3ec531[_0x9edd('0x35')]);_0x3ff07e[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x3ec531[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x4ec836[_0x9edd('0x35')]['fields']));_0x3ff07e[_0x9edd('0x38')]=_0x3ff07e[_0x9edd('0x38')][_0x9edd('0x49')]?_0x3ff07e[_0x9edd('0x38')]:_0x3ec531[_0x9edd('0x33')];if(!_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x3ff07e['limit']=qs['limit'](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x3ff07e[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x3ff07e[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x3ff07e[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x4ec836[_0x9edd('0x35')],_0x3ec531['filters']));_0x3ff07e[_0x9edd('0x6b')]=!![];if(_0x4ec836[_0x9edd('0x35')]['filter']){_0x3ff07e[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x3ff07e[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x3ff07e['attributes'],function(_0x3429b6){var _0x398c34={};_0x398c34[_0x3429b6]={'$like':'%'+_0x4ec836[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x398c34;})});}_0x3ff07e=_[_0x9edd('0x42')]({},_0x3ff07e,_0x4ec836['options']);return _0x21c35f[_0x9edd('0x67')](_0x3ff07e);}})[_0x9edd('0x26')](respondWithResult(_0x35950b,null))[_0x9edd('0x46')](handleError(_0x35950b,null));};exports[_0x9edd('0x6c')]=function(_0xa8d944,_0x59927d,_0x4d0734){var _0x2f8ce1;return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0xa8d944['params']['id']},'include':[{'model':db[_0x9edd('0x68')],'as':_0x9edd('0x6d')}]})[_0x9edd('0x26')](handleEntityNotFound(_0x59927d,null))[_0x9edd('0x26')](function(_0x2c7245){if(_0x2c7245){_0x2f8ce1=_0x2c7245;return db[_0x9edd('0x5b')]['rawAttributes'];}})[_0x9edd('0x26')](function(_0x33beb7){if(_0x33beb7){var _0x3aae72={};var _0x39d6dd={};_0x39d6dd[_0x9edd('0x33')]=_[_0x9edd('0x69')](_[_0x9edd('0x34')](_0x33beb7),_[_0x9edd('0x2e')](_0x2f8ce1['CustomFields'],function(_0x195088){return util[_0x9edd('0x6e')](_0x9edd('0x6a'),_0x195088['id']);}));_0x39d6dd[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0xa8d944[_0x9edd('0x35')]);_0x39d6dd[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x39d6dd[_0x9edd('0x33')],_0x39d6dd[_0x9edd('0x35')]);_0x3aae72[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x39d6dd[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x39')]));_0x3aae72[_0x9edd('0x38')]=_0x3aae72[_0x9edd('0x38')][_0x9edd('0x49')]?_0x3aae72[_0x9edd('0x38')]:_0x39d6dd[_0x9edd('0x33')];if(!_0xa8d944['query'][_0x9edd('0x3a')]('nolimit')){_0x3aae72['limit']=qs[_0x9edd('0x3c')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x3aae72[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x3aae72[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0xa8d944[_0x9edd('0x35')]['sort']);_0x3aae72[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_['pick'](_0xa8d944['query'],_0x39d6dd[_0x9edd('0x36')]));_0x3aae72[_0x9edd('0x6b')]=!![];if(_0xa8d944[_0x9edd('0x35')][_0x9edd('0x41')]){_0x3aae72['where']=_['merge'](_0x3aae72[_0x9edd('0x3f')],{'$or':_['map'](_0x3aae72[_0x9edd('0x38')],function(_0x24a9d1){var _0x3e2404={};_0x3e2404[_0x24a9d1]={'$like':'%'+_0xa8d944['query']['filter']+'%'};return _0x3e2404;})});}_0x3aae72=_['merge']({},_0x3aae72,_0xa8d944[_0x9edd('0x43')]);return _0x2f8ce1[_0x9edd('0x67')](_0x3aae72);}})[_0x9edd('0x26')](function(_0x5bfbfd){if(!_[_0x9edd('0x6f')](_0x5bfbfd)){var _0x402574=toCsv(_0x5bfbfd);var _0x4f12b9=Date[_0x9edd('0x70')]();fs[_0x9edd('0x71')](util['format']('/tmp/list_%d_%s.csv',_0x2f8ce1['id'],_0x4f12b9),_0x402574);_0x59927d[_0x9edd('0x72')](_0x9edd('0x73'),'attachment;\x20filename='+util[_0x9edd('0x6e')](_0x9edd('0x74'),_0x2f8ce1['id'],_0x4f12b9));_0x59927d['setHeader'](_0x9edd('0x75'),'text/csv');return _0x59927d[_0x9edd('0x76')](util[_0x9edd('0x6e')](_0x9edd('0x77'),_0x2f8ce1['id'],_0x4f12b9));}else{return _0x59927d[_0x9edd('0x1c')](0xcc);}})[_0x9edd('0x46')](handleError(_0x59927d,null));};exports[_0x9edd('0x78')]=function(_0x58bc3c,_0x2fe810,_0x22aa2b){var _0x68047e;delete _0x58bc3c['body']['id'];return db[_0x9edd('0x2f')]['findOne']({'where':{'id':_0x58bc3c[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x2fe810,null))[_0x9edd('0x26')](function(_0x41b0ea){if(_0x41b0ea){return db['sequelize']['transaction'](function(_0x4e9242){return db[_0x9edd('0x68')][_0x9edd('0x4c')](_0x58bc3c[_0x9edd('0x4d')],{'transaction':_0x4e9242})['then'](function(_0x41a761){_0x68047e=_0x41a761;return _0x41b0ea[_0x9edd('0x79')](_0x41a761,{'transaction':_0x4e9242});})[_0x9edd('0x26')](function(){var _0xb66eaf={'type':db[_0x9edd('0x7a')][_0x9edd('0x7b')],'transaction':_0x4e9242};switch(_0x58bc3c['body']['type']){case _0x9edd('0x7c'):_0xb66eaf[_0x9edd('0x32')]=db[_0x9edd('0x7a')]['TEXT'];break;case _0x9edd('0x7d'):_0xb66eaf[_0x9edd('0x32')]=db[_0x9edd('0x7a')][_0x9edd('0x7e')];break;case'switch':_0xb66eaf[_0x9edd('0x32')]=db['Sequelize'][_0x9edd('0x7f')];_0xb66eaf[_0x9edd('0x80')]=![];break;default:}return db[_0x9edd('0x81')][_0x9edd('0x82')][_0x9edd('0x83')]('cm_contacts',util[_0x9edd('0x6e')]('cf_%s',_0x68047e['id']),_0xb66eaf);})[_0x9edd('0x26')](function(){return _0x68047e;});});}})['then'](respondWithResult(_0x2fe810,null))[_0x9edd('0x46')](handleError(_0x2fe810,null));};exports['getCustomFields']=function(_0x363c5c,_0x96e3d7,_0x3bc495){var _0x575377={};var _0x244dce={};var _0x7512ea;var _0x1c5038;return db[_0x9edd('0x2f')][_0x9edd('0x84')]({'where':{'id':_0x363c5c[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x96e3d7,null))[_0x9edd('0x26')](function(_0x365b27){if(_0x365b27){_0x7512ea=_0x365b27;_0x244dce[_0x9edd('0x33')]=_[_0x9edd('0x34')](db[_0x9edd('0x68')][_0x9edd('0x30')]);_0x244dce[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x363c5c[_0x9edd('0x35')]);_0x244dce[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x244dce[_0x9edd('0x33')],_0x244dce[_0x9edd('0x35')]);_0x575377[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x244dce['model'],qs[_0x9edd('0x39')](_0x363c5c['query'][_0x9edd('0x39')]));_0x575377[_0x9edd('0x38')]=_0x575377[_0x9edd('0x38')][_0x9edd('0x49')]?_0x575377[_0x9edd('0x38')]:_0x244dce['model'];_0x575377[_0x9edd('0x3d')]=qs['sort'](_0x363c5c[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x575377[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x363c5c[_0x9edd('0x35')],_0x244dce['filters']));_0x575377[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x575377['where'],{'$or':[{'ListId':_0x365b27['id']},{'ListId':null}]});if(_0x363c5c['query']['filter']){_0x575377['where']=_[_0x9edd('0x42')](_0x575377[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x575377[_0x9edd('0x38')],function(_0x239774){var _0x229a92={};_0x229a92[_0x239774]={'$like':'%'+_0x363c5c[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x229a92;})});}_0x575377=_[_0x9edd('0x42')]({},_0x575377,_0x363c5c[_0x9edd('0x43')]);return db['CmCustomField'][_0x9edd('0x85')](_0x575377);}})['then'](respondWithResult(_0x96e3d7,null))['catch'](handleError(_0x96e3d7,null));};exports[_0x9edd('0x86')]=function(_0x2dafd2,_0x35e9b9,_0x42a142){return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x2dafd2[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x35e9b9,null))[_0x9edd('0x26')](function(_0x181469){if(_0x181469){return _0x181469['addAgents'](_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')],_[_0x9edd('0x60')](_0x2dafd2[_0x9edd('0x4d')],[_0x9edd('0x61'),'id'])||{})[_0x9edd('0x87')](function(_0x55052b){for(var _0x9ff2d3=0x0;_0x9ff2d3<_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')][_0x9edd('0x49')];_0x9ff2d3+=0x1){socket['emit'](_0x9edd('0x88'),{'UserId':_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')][_0x9ff2d3],'CmListId':_0x2dafd2[_0x9edd('0x48')]['id']});}return _0x55052b;});}})[_0x9edd('0x26')](respondWithResult(_0x35e9b9,null))[_0x9edd('0x46')](handleError(_0x35e9b9,null));};exports[_0x9edd('0x89')]=function(_0x39e3b3,_0x4a3955,_0x4a19a0){return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0x39e3b3[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x4a3955,null))[_0x9edd('0x26')](function(_0x223c42){if(_0x223c42){return _0x223c42[_0x9edd('0x89')](_0x39e3b3[_0x9edd('0x35')][_0x9edd('0x61')])[_0x9edd('0x26')](function(){if(_[_0x9edd('0x5d')](_0x39e3b3['query'][_0x9edd('0x61')])){for(var _0x56dc7e=0x0;_0x56dc7e<_0x39e3b3['query'][_0x9edd('0x61')][_0x9edd('0x49')];_0x56dc7e+=0x1){socket[_0x9edd('0x8a')]('userCmList:remove',{'UserId':Number(_0x39e3b3['query']['ids'][_0x56dc7e]),'CmListId':Number(_0x39e3b3['params']['id'])});}}else{socket['emit'](_0x9edd('0x8b'),{'UserId':Number(_0x39e3b3[_0x9edd('0x35')][_0x9edd('0x61')]),'CmListId':Number(_0x39e3b3['params']['id'])});}});}})[_0x9edd('0x26')](respondWithStatusCode(_0x4a3955,null))[_0x9edd('0x46')](handleError(_0x4a3955,null));};exports[_0x9edd('0x8c')]=function(_0x557156,_0x2c2f00,_0x4afe0b){var _0x16a1c8={};var _0x1a2376={};var _0xc84fb7;var _0x259d33;return db['CmList'][_0x9edd('0x84')]({'where':{'id':_0x557156[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c2f00,null))[_0x9edd('0x26')](function(_0x36e825){if(_0x36e825){_0xc84fb7=_0x36e825;_0x1a2376[_0x9edd('0x33')]=_[_0x9edd('0x34')](db['User'][_0x9edd('0x30')]);_0x1a2376[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x557156[_0x9edd('0x35')]);_0x1a2376[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x1a2376[_0x9edd('0x33')],_0x1a2376['query']);_0x16a1c8[_0x9edd('0x38')]=_['intersection'](_0x1a2376[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x557156['query'][_0x9edd('0x39')]));_0x16a1c8[_0x9edd('0x38')]=_0x16a1c8[_0x9edd('0x38')]['length']?_0x16a1c8[_0x9edd('0x38')]:_0x1a2376[_0x9edd('0x33')];_0x16a1c8[_0x9edd('0x3d')]=qs['sort'](_0x557156[_0x9edd('0x35')]['sort']);_0x16a1c8[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x557156[_0x9edd('0x35')],_0x1a2376['filters']));if(_0x557156['query'][_0x9edd('0x41')]){_0x16a1c8[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x16a1c8[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x16a1c8['attributes'],function(_0x1a1938){var _0x235762={};_0x235762[_0x1a1938]={'$like':'%'+_0x557156[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x235762;})});}_0x16a1c8=_[_0x9edd('0x42')]({},_0x16a1c8,_0x557156[_0x9edd('0x43')]);return _0xc84fb7[_0x9edd('0x8c')](_0x16a1c8);}})[_0x9edd('0x26')](function(_0x3173fa){if(_0x3173fa){_0x259d33=_0x3173fa[_0x9edd('0x49')];if(!_0x557156[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x16a1c8['limit']=qs[_0x9edd('0x3c')](_0x557156[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x16a1c8[_0x9edd('0x21')]=qs['offset'](_0x557156[_0x9edd('0x35')][_0x9edd('0x21')]);}return _0xc84fb7[_0x9edd('0x8c')](_0x16a1c8);}})['then'](function(_0x910adf){if(_0x910adf){return _0x910adf?{'count':_0x259d33,'rows':_0x910adf}:null;}})['then'](respondWithResult(_0x2c2f00,null))['catch'](handleError(_0x2c2f00,null));}; \ No newline at end of file +var _0xa9e0=['addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','findOne','Disposition','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','errors','message','CmCustomField','CustomFields','concat','format','cf_%d','nolimit','raw','getContacts','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll'];(function(_0x525c90,_0x1fe2da){var _0x16f1a9=function(_0x4186f8){while(--_0x4186f8){_0x525c90['push'](_0x525c90['shift']());}};_0x16f1a9(++_0x1fe2da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x2b4227,_0x281129){_0x281129=_0x281129||0xcc;return function(_0x44dcfd){if(_0x44dcfd){return _0x2b4227[_0x0a9e('0x1a')](_0x281129);}return _0x2b4227['status'](_0x281129)[_0x0a9e('0x1b')]();};}function respondWithResult(_0x5d0880,_0x1985b6){_0x1985b6=_0x1985b6||0xc8;return function(_0x519dfd){if(_0x519dfd){return _0x5d0880[_0x0a9e('0x1c')](_0x1985b6)[_0x0a9e('0x1d')](_0x519dfd);}};}function respondWithFilteredResult(_0x48f32d,_0x225616){return function(_0x5a0a06){if(_0x5a0a06){var _0x459eb1=_0x5a0a06[_0x0a9e('0x1e')],_0x478723=_0x225616[_0x0a9e('0x1f')],_0x106033=_0x225616[_0x0a9e('0x1f')]+_0x225616[_0x0a9e('0x20')],_0x205fd6;if(_0x106033>=_0x459eb1){_0x106033=_0x459eb1;_0x205fd6=0xc8;}else{_0x205fd6=0xce;}_0x48f32d[_0x0a9e('0x1c')](_0x205fd6);return _0x48f32d[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x478723+'-'+_0x106033+'/'+_0x459eb1)[_0x0a9e('0x1d')](_0x5a0a06);}return null;};}function patchUpdates(_0x4bb1e3){return function(_0x2c3407){try{jsonpatch[_0x0a9e('0x23')](_0x2c3407,_0x4bb1e3,!![]);}catch(_0x53682f){return BPromise[_0x0a9e('0x24')](_0x53682f);}return _0x2c3407['save']();};}function saveUpdates(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x25')](_0x588269)[_0x0a9e('0x26')](function(_0x4abc77){return _0x4abc77;});}return null;};}function removeEntity(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(_0x3b45bc){return _0x3b45bc[_0x0a9e('0x27')]()[_0x0a9e('0x26')](function(){var _0x42ac8f=_0x3b45bc[_0x0a9e('0x28')]({'plain':!![]});var _0x5ea472='Lists';return db[_0x0a9e('0x29')][_0x0a9e('0x27')]({'where':{'type':_0x5ea472,'resourceId':_0x42ac8f['id']}})[_0x0a9e('0x26')](function(){return _0x3b45bc;});})[_0x0a9e('0x26')](function(){_0xfb6e48['status'](0xcc)[_0x0a9e('0x1b')]();});}};}function handleEntityNotFound(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(!_0x5bfb33){_0x479bc4[_0x0a9e('0x1a')](0x194);}return _0x5bfb33;};}function handleError(_0x34dc65,_0x25fba9){_0x25fba9=_0x25fba9||0x1f4;return function(_0x14433c){logger[_0x0a9e('0x2a')](_0x14433c[_0x0a9e('0x2b')]);if(_0x14433c[_0x0a9e('0x2c')]){delete _0x14433c[_0x0a9e('0x2c')];}_0x34dc65['status'](_0x25fba9)[_0x0a9e('0x2d')](_0x14433c);};}exports[_0x0a9e('0x2e')]=function(_0x2b1f27,_0x2ec755){var _0x5c877d={},_0x15b200={},_0x40e7a3={'count':0x0,'rows':[]};var _0x1843b2=_[_0x0a9e('0x2f')](db[_0x0a9e('0x30')][_0x0a9e('0x31')],function(_0x296f41){return{'name':_0x296f41[_0x0a9e('0x32')],'type':_0x296f41[_0x0a9e('0x33')]['key']};});_0x15b200[_0x0a9e('0x34')]=_['map'](_0x1843b2,_0x0a9e('0x2c'));_0x15b200[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2b1f27[_0x0a9e('0x35')]);_0x15b200[_0x0a9e('0x37')]=_['intersection'](_0x15b200[_0x0a9e('0x34')],_0x15b200[_0x0a9e('0x35')]);_0x5c877d[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x15b200[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x5c877d['attributes']=_0x5c877d[_0x0a9e('0x38')]['length']?_0x5c877d[_0x0a9e('0x38')]:_0x15b200[_0x0a9e('0x34')];if(!_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3b')]('nolimit')){_0x5c877d[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x20')]);_0x5c877d['offset']=qs['offset'](_0x2b1f27[_0x0a9e('0x35')]['offset']);}_0x5c877d[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x5c877d['where']=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x2b1f27[_0x0a9e('0x35')],_0x15b200['filters']));if(_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x5c877d[_0x0a9e('0x40')]=_['merge'](_0x5c877d['where'],{'$or':_[_0x0a9e('0x2f')](_0x1843b2,function(_0x40d766){if(_0x40d766['type']!==_0x0a9e('0x41')){var _0x419125={};_0x419125[_0x40d766[_0x0a9e('0x2c')]]={'$like':'%'+_0x2b1f27[_0x0a9e('0x35')]['filter']+'%'};return _0x419125;}})});}_0x5c877d=_['merge']({},_0x5c877d,_0x2b1f27[_0x0a9e('0x42')]);var _0x45b3d0={'where':_0x5c877d['where']};return db[_0x0a9e('0x30')][_0x0a9e('0x1e')](_0x45b3d0)[_0x0a9e('0x26')](function(_0x5b4f5e){_0x40e7a3[_0x0a9e('0x1e')]=_0x5b4f5e;if(_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x43')]){_0x5c877d[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x30')][_0x0a9e('0x45')](_0x5c877d);})[_0x0a9e('0x26')](function(_0x45a9b8){_0x40e7a3[_0x0a9e('0x46')]=_0x45a9b8;return _0x40e7a3;})[_0x0a9e('0x26')](respondWithFilteredResult(_0x2ec755,_0x5c877d))[_0x0a9e('0x47')](handleError(_0x2ec755,null));};exports[_0x0a9e('0x48')]=function(_0x1a7bce,_0x11ca30){var _0x37f6cc={'raw':![],'where':{'id':_0x1a7bce['params']['id']}},_0x4d04c8={};_0x4d04c8[_0x0a9e('0x34')]=_[_0x0a9e('0x36')](db[_0x0a9e('0x30')][_0x0a9e('0x31')]);_0x4d04c8[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x1a7bce[_0x0a9e('0x35')]);_0x4d04c8[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x4d04c8[_0x0a9e('0x34')],_0x4d04c8[_0x0a9e('0x35')]);_0x37f6cc[_0x0a9e('0x38')]=_['intersection'](_0x4d04c8[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x1a7bce[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x37f6cc[_0x0a9e('0x38')]=_0x37f6cc[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x37f6cc[_0x0a9e('0x38')]:_0x4d04c8['model'];if(_0x1a7bce[_0x0a9e('0x35')]['includeAll']){_0x37f6cc[_0x0a9e('0x44')]=[{'all':!![]}];}_0x37f6cc=_[_0x0a9e('0x4a')]({},_0x37f6cc,_0x1a7bce[_0x0a9e('0x42')]);return db['CmList'][_0x0a9e('0x4b')](_0x37f6cc)[_0x0a9e('0x26')](handleEntityNotFound(_0x11ca30,null))[_0x0a9e('0x26')](respondWithResult(_0x11ca30,null))[_0x0a9e('0x47')](handleError(_0x11ca30,null));};exports[_0x0a9e('0x4c')]=function(_0x37be73,_0x45bf7f){return db['CmList'][_0x0a9e('0x4c')](_0x37be73[_0x0a9e('0x4d')],{})[_0x0a9e('0x26')](function(_0x16f976){var _0x409789=_0x37be73[_0x0a9e('0x4e')][_0x0a9e('0x28')]({'plain':!![]});if(!_0x409789)throw new Error(_0x0a9e('0x4f'));if(_0x409789[_0x0a9e('0x50')]==='user'){var _0xe401a=_0x16f976[_0x0a9e('0x28')]({'plain':!![]});var _0x4f7240='Lists';return db['UserProfileSection'][_0x0a9e('0x4b')]({'where':{'name':_0x4f7240,'userProfileId':_0x409789[_0x0a9e('0x51')]},'raw':!![]})[_0x0a9e('0x26')](function(_0x11545a){if(_0x11545a&&_0x11545a[_0x0a9e('0x52')]===0x0){return db[_0x0a9e('0x29')][_0x0a9e('0x4c')]({'name':_0xe401a[_0x0a9e('0x2c')],'resourceId':_0xe401a['id'],'type':_0x11545a['name'],'sectionId':_0x11545a['id']},{})['then'](function(){return _0x16f976;});}else{return _0x16f976;}})['catch'](function(_0x39d77d){logger[_0x0a9e('0x2a')](_0x0a9e('0x53'),_0x39d77d);throw _0x39d77d;});}return _0x16f976;})['then'](respondWithResult(_0x45bf7f,0xc9))[_0x0a9e('0x47')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x25')]=function(_0x53d113,_0x5a88da){if(_0x53d113[_0x0a9e('0x4d')]['id']){delete _0x53d113['body']['id'];}return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x26')](saveUpdates(_0x53d113['body'],null))[_0x0a9e('0x26')](respondWithResult(_0x5a88da,null))[_0x0a9e('0x47')](handleError(_0x5a88da,null));};exports['destroy']=function(_0x50f687,_0x128aa6){return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x50f687[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x128aa6,null))[_0x0a9e('0x26')](removeEntity(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x55')]=function(_0x4a6deb,_0x5da27d){return db['CmList'][_0x0a9e('0x55')]()['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0x47')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x56')]=function(_0x3cfd00,_0x19b4df,_0x232830){if(_0x3cfd00[_0x0a9e('0x4d')]['id']){delete _0x3cfd00[_0x0a9e('0x4d')]['id'];}return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x3cfd00[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x19b4df,null))[_0x0a9e('0x26')](function(_0x30c491){if(_0x30c491){_0x3cfd00[_0x0a9e('0x4d')][_0x0a9e('0x57')]=_0x30c491['id'];return db['Disposition'][_0x0a9e('0x4c')](_0x3cfd00[_0x0a9e('0x4d')]);}})['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0x47')](handleError(_0x19b4df,null));};exports['getDispositions']=function(_0x20c668,_0x5ba1f9,_0x4b3c1a){var _0x5674ee={'raw':![],'where':{}};var _0x273cb5={};var _0x49d231={'count':0x0,'rows':[]};return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x20c668[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5ba1f9,null))[_0x0a9e('0x26')](function(_0x26d7db){if(_0x26d7db){_0x273cb5['model']=_[_0x0a9e('0x36')](db['Disposition'][_0x0a9e('0x31')]);_0x273cb5[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x20c668['query']);_0x273cb5[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x273cb5[_0x0a9e('0x34')],_0x273cb5[_0x0a9e('0x35')]);_0x5674ee['attributes']=_[_0x0a9e('0x39')](_0x273cb5[_0x0a9e('0x34')],qs['fields'](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x5674ee[_0x0a9e('0x38')]=_0x5674ee[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x5674ee['attributes']:_0x273cb5[_0x0a9e('0x34')];if(!_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3b')]('nolimit')){_0x5674ee[_0x0a9e('0x20')]=qs['limit'](_0x20c668['query'][_0x0a9e('0x20')]);_0x5674ee[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x5674ee[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x5674ee[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x20c668[_0x0a9e('0x35')],_0x273cb5[_0x0a9e('0x37')]));_0x5674ee[_0x0a9e('0x40')][_0x0a9e('0x57')]=_0x26d7db['id'];if(_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x5674ee['where']=_[_0x0a9e('0x4a')](_0x5674ee[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x5674ee['attributes'],function(_0x1148a1){var _0x30944e={};_0x30944e[_0x1148a1]={'$like':'%'+_0x20c668['query'][_0x0a9e('0x3f')]+'%'};return _0x30944e;})});}_0x5674ee=_[_0x0a9e('0x4a')]({},_0x5674ee,_0x20c668[_0x0a9e('0x42')]);return db[_0x0a9e('0x59')][_0x0a9e('0x1e')]({'where':_0x5674ee['where']})['then'](function(_0x4a2438){_0x49d231[_0x0a9e('0x1e')]=_0x4a2438;if(_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x43')]){_0x5674ee[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x59')][_0x0a9e('0x45')](_0x5674ee);})[_0x0a9e('0x26')](function(_0x1a0677){_0x49d231['rows']=_0x1a0677;return _0x49d231;});}})[_0x0a9e('0x26')](respondWithFilteredResult(_0x5ba1f9,_0x5674ee))[_0x0a9e('0x47')](handleError(_0x5ba1f9,null));};exports[_0x0a9e('0x5a')]=function(_0x4a4fc7,_0x2bdc44,_0x583b2e){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x4a4fc7['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x2bdc44,null))[_0x0a9e('0x26')](function(_0x2cc7a7){if(_0x2cc7a7){return _0x2cc7a7[_0x0a9e('0x5a')](_0x4a4fc7['query'][_0x0a9e('0x5b')]);}})[_0x0a9e('0x26')](respondWithStatusCode(_0x2bdc44,null))[_0x0a9e('0x47')](handleError(_0x2bdc44,null));};exports[_0x0a9e('0x5c')]=function(_0x5b7fc3,_0x109ccb,_0x3d91db){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x5b7fc3['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x109ccb,null))[_0x0a9e('0x26')](function(_0x30a4c7){if(_0x30a4c7){var _0xf410e5=[];var _0x332367={'success':[],'errors':[]};return db[_0x0a9e('0x5d')][_0x0a9e('0x55')]()[_0x0a9e('0x26')](function(_0x1a7b03){if(_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')]&&_[_0x0a9e('0x5f')](_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')])){if(_0x5b7fc3['body'][_0x0a9e('0x5e')][_0x0a9e('0x49')]){_0x5b7fc3[_0x0a9e('0x4d')]['tags']=_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')][_0x0a9e('0x60')](';')+';';}else{_0x5b7fc3[_0x0a9e('0x4d')]['tags']=null;}}else{_0x5b7fc3['body'][_0x0a9e('0x5e')]=null;}if(_0x5b7fc3[_0x0a9e('0x4d')]&&_['isArray'](_0x5b7fc3[_0x0a9e('0x4d')])){for(var _0x53a6a1=0x0;_0x53a6a1<_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x49')];_0x53a6a1+=0x1){_0x5b7fc3['body'][_0x53a6a1][_0x0a9e('0x57')]=_0x5b7fc3[_0x0a9e('0x54')]['id'];_0xf410e5[_0x0a9e('0x61')](_0x5b7fc3[_0x0a9e('0x4d')][_0x53a6a1]);}return BPromise[_0x0a9e('0x62')](_0xf410e5,function(_0x1f42a0){return db[_0x0a9e('0x5d')]['create'](_[_0x0a9e('0x63')](_0x1f42a0,[_0x0a9e('0x5b'),'id'])||{},{'fields':_[_0x0a9e('0x36')](_0x1a7b03),'raw':!![]})[_0x0a9e('0x26')](function(_0x492543){_0x332367[_0x0a9e('0x64')][_0x0a9e('0x61')](_0x492543['dataValues']);})[_0x0a9e('0x47')](function(_0x5b7940){_0x332367[_0x0a9e('0x65')][_0x0a9e('0x61')]({'data':_0x1f42a0,'error':_0x5b7940[_0x0a9e('0x66')]});});})[_0x0a9e('0x26')](function(_0x5af453){return _0x332367;})['catch'](function(_0x353384){return _0x353384;});}else{_0x109ccb[_0x0a9e('0x1c')](0x190)[_0x0a9e('0x1d')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x0a9e('0x26')](respondWithResult(_0x109ccb,null))[_0x0a9e('0x47')](handleError(_0x109ccb,null));};exports['getContacts']=function(_0x4e46b2,_0xf0a802,_0x56acca){var _0x5ea541;return db['CmList'][_0x0a9e('0x4b')]({'where':{'id':_0x4e46b2[_0x0a9e('0x54')]['id']},'include':[{'model':db[_0x0a9e('0x67')],'as':_0x0a9e('0x68')}]})[_0x0a9e('0x26')](handleEntityNotFound(_0xf0a802,null))[_0x0a9e('0x26')](function(_0x5a8854){if(_0x5a8854){_0x5ea541=_0x5a8854;return db[_0x0a9e('0x5d')]['rawAttributes'];}})[_0x0a9e('0x26')](function(_0x2aabab){if(_0x2aabab){var _0x18ad56={};var _0x4566b0={};_0x4566b0['model']=_[_0x0a9e('0x69')](_[_0x0a9e('0x36')](_0x2aabab),_[_0x0a9e('0x2f')](_0x5ea541['CustomFields'],function(_0xb6e411){return util[_0x0a9e('0x6a')](_0x0a9e('0x6b'),_0xb6e411['id']);}));_0x4566b0[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x4e46b2[_0x0a9e('0x35')]);_0x4566b0[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x4566b0['model'],_0x4566b0[_0x0a9e('0x35')]);_0x18ad56[_0x0a9e('0x38')]=_['intersection'](_0x4566b0[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x4e46b2[_0x0a9e('0x35')]['fields']));_0x18ad56[_0x0a9e('0x38')]=_0x18ad56['attributes'][_0x0a9e('0x49')]?_0x18ad56[_0x0a9e('0x38')]:_0x4566b0[_0x0a9e('0x34')];if(!_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3b')](_0x0a9e('0x6c'))){_0x18ad56[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x4e46b2['query'][_0x0a9e('0x20')]);_0x18ad56[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x18ad56[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x18ad56[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x4e46b2[_0x0a9e('0x35')],_0x4566b0['filters']));_0x18ad56[_0x0a9e('0x6d')]=!![];if(_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x18ad56[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x18ad56['where'],{'$or':_[_0x0a9e('0x2f')](_0x18ad56[_0x0a9e('0x38')],function(_0x5ce99d){var _0x23b447={};_0x23b447[_0x5ce99d]={'$like':'%'+_0x4e46b2['query'][_0x0a9e('0x3f')]+'%'};return _0x23b447;})});}_0x18ad56=_[_0x0a9e('0x4a')]({},_0x18ad56,_0x4e46b2[_0x0a9e('0x42')]);return _0x5ea541[_0x0a9e('0x6e')](_0x18ad56);}})['then'](respondWithResult(_0xf0a802,null))[_0x0a9e('0x47')](handleError(_0xf0a802,null));};exports['getContactsCsv']=function(_0x2ec396,_0x3d0a77,_0x5e5b89){var _0x231c6a;return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x2ec396['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x0a9e('0x68')}]})[_0x0a9e('0x26')](handleEntityNotFound(_0x3d0a77,null))[_0x0a9e('0x26')](function(_0x413190){if(_0x413190){_0x231c6a=_0x413190;return db[_0x0a9e('0x5d')][_0x0a9e('0x31')];}})[_0x0a9e('0x26')](function(_0x3c75b9){if(_0x3c75b9){var _0x3f8124={};var _0x586510={};_0x586510[_0x0a9e('0x34')]=_['concat'](_[_0x0a9e('0x36')](_0x3c75b9),_[_0x0a9e('0x2f')](_0x231c6a[_0x0a9e('0x68')],function(_0x28ce92){return util[_0x0a9e('0x6a')]('cf_%d',_0x28ce92['id']);}));_0x586510[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2ec396[_0x0a9e('0x35')]);_0x586510[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x586510['model'],_0x586510['query']);_0x3f8124[_0x0a9e('0x38')]=_['intersection'](_0x586510[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x3f8124[_0x0a9e('0x38')]=_0x3f8124[_0x0a9e('0x38')]['length']?_0x3f8124['attributes']:_0x586510[_0x0a9e('0x34')];if(!_0x2ec396['query'][_0x0a9e('0x3b')]('nolimit')){_0x3f8124[_0x0a9e('0x20')]=qs['limit'](_0x2ec396['query'][_0x0a9e('0x20')]);_0x3f8124[_0x0a9e('0x1f')]=qs['offset'](_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x3f8124[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2ec396[_0x0a9e('0x35')]['sort']);_0x3f8124['where']=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x2ec396[_0x0a9e('0x35')],_0x586510[_0x0a9e('0x37')]));_0x3f8124[_0x0a9e('0x6d')]=!![];if(_0x2ec396['query'][_0x0a9e('0x3f')]){_0x3f8124[_0x0a9e('0x40')]=_['merge'](_0x3f8124[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x3f8124[_0x0a9e('0x38')],function(_0x2427d5){var _0x23b25b={};_0x23b25b[_0x2427d5]={'$like':'%'+_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x3f')]+'%'};return _0x23b25b;})});}_0x3f8124=_[_0x0a9e('0x4a')]({},_0x3f8124,_0x2ec396[_0x0a9e('0x42')]);return _0x231c6a[_0x0a9e('0x6e')](_0x3f8124);}})['then'](function(_0x1065a7){if(!_[_0x0a9e('0x6f')](_0x1065a7)){var _0x2ada60=toCsv(_0x1065a7);var _0x1c4232=Date[_0x0a9e('0x70')]();fs['writeFileSync'](util['format'](_0x0a9e('0x71'),_0x231c6a['id'],_0x1c4232),_0x2ada60);_0x3d0a77[_0x0a9e('0x72')](_0x0a9e('0x73'),_0x0a9e('0x74')+util[_0x0a9e('0x6a')]('list_%d_%s.csv',_0x231c6a['id'],_0x1c4232));_0x3d0a77[_0x0a9e('0x72')](_0x0a9e('0x75'),_0x0a9e('0x76'));return _0x3d0a77['download'](util[_0x0a9e('0x6a')]('/tmp/list_%d_%s.csv',_0x231c6a['id'],_0x1c4232));}else{return _0x3d0a77[_0x0a9e('0x1a')](0xcc);}})['catch'](handleError(_0x3d0a77,null));};exports[_0x0a9e('0x77')]=function(_0x42b833,_0xe339b1,_0x5c500c){var _0xc9529d;delete _0x42b833['body']['id'];return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x42b833[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0xe339b1,null))[_0x0a9e('0x26')](function(_0x1bee04){if(_0x1bee04){return db[_0x0a9e('0x78')][_0x0a9e('0x79')](function(_0x2aaf07){return db[_0x0a9e('0x67')][_0x0a9e('0x4c')](_0x42b833[_0x0a9e('0x4d')],{'transaction':_0x2aaf07})[_0x0a9e('0x26')](function(_0x399def){_0xc9529d=_0x399def;return _0x1bee04[_0x0a9e('0x7a')](_0x399def,{'transaction':_0x2aaf07});})[_0x0a9e('0x26')](function(){var _0x5b93dd={'type':db['Sequelize'][_0x0a9e('0x7b')],'transaction':_0x2aaf07};switch(_0x42b833['body'][_0x0a9e('0x33')]){case _0x0a9e('0x7c'):_0x5b93dd['type']=db[_0x0a9e('0x7d')][_0x0a9e('0x7b')];break;case _0x0a9e('0x7e'):_0x5b93dd[_0x0a9e('0x33')]=db['Sequelize'][_0x0a9e('0x7f')];break;case _0x0a9e('0x80'):_0x5b93dd[_0x0a9e('0x33')]=db[_0x0a9e('0x7d')]['BOOLEAN'];_0x5b93dd[_0x0a9e('0x81')]=![];break;default:}return db[_0x0a9e('0x78')][_0x0a9e('0x82')]['addColumn'](_0x0a9e('0x83'),util[_0x0a9e('0x6a')](_0x0a9e('0x84'),_0xc9529d['id']),_0x5b93dd);})['then'](function(){return _0xc9529d;});});}})[_0x0a9e('0x26')](respondWithResult(_0xe339b1,null))[_0x0a9e('0x47')](handleError(_0xe339b1,null));};exports[_0x0a9e('0x85')]=function(_0x1a7f58,_0x2394d3,_0x555780){var _0x3211d2={};var _0x289e65={};var _0x4795ae;var _0x3bab3e;return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x1a7f58['params']['id']}})['then'](handleEntityNotFound(_0x2394d3,null))['then'](function(_0x1015aa){if(_0x1015aa){_0x4795ae=_0x1015aa;_0x289e65[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x67')][_0x0a9e('0x31')]);_0x289e65[_0x0a9e('0x35')]=_['keys'](_0x1a7f58[_0x0a9e('0x35')]);_0x289e65[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x289e65[_0x0a9e('0x34')],_0x289e65[_0x0a9e('0x35')]);_0x3211d2[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x289e65[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x1a7f58['query'][_0x0a9e('0x3a')]));_0x3211d2['attributes']=_0x3211d2[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x3211d2[_0x0a9e('0x38')]:_0x289e65[_0x0a9e('0x34')];_0x3211d2[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x1a7f58['query'][_0x0a9e('0x3d')]);_0x3211d2[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x1a7f58['query'],_0x289e65[_0x0a9e('0x37')]));_0x3211d2[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x3211d2[_0x0a9e('0x40')],{'$or':[{'ListId':_0x1015aa['id']},{'ListId':null}]});if(_0x1a7f58[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x3211d2[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x3211d2[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x3211d2['attributes'],function(_0x2272bc){var _0x88b25f={};_0x88b25f[_0x2272bc]={'$like':'%'+_0x1a7f58[_0x0a9e('0x35')][_0x0a9e('0x3f')]+'%'};return _0x88b25f;})});}_0x3211d2=_[_0x0a9e('0x4a')]({},_0x3211d2,_0x1a7f58[_0x0a9e('0x42')]);return db[_0x0a9e('0x67')][_0x0a9e('0x86')](_0x3211d2);}})['then'](respondWithResult(_0x2394d3,null))[_0x0a9e('0x47')](handleError(_0x2394d3,null));};exports[_0x0a9e('0x87')]=function(_0x1a9ef1,_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x1a9ef1[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5c65fc,null))[_0x0a9e('0x26')](function(_0x424f1b){if(_0x424f1b){return _0x424f1b[_0x0a9e('0x87')](_0x1a9ef1[_0x0a9e('0x4d')][_0x0a9e('0x5b')],_['omit'](_0x1a9ef1[_0x0a9e('0x4d')],[_0x0a9e('0x5b'),'id'])||{})[_0x0a9e('0x88')](function(_0x3db98f){for(var _0x2b624e=0x0;_0x2b624e<_0x1a9ef1[_0x0a9e('0x4d')]['ids'][_0x0a9e('0x49')];_0x2b624e+=0x1){socket['emit']('userCmList:save',{'UserId':_0x1a9ef1['body'][_0x0a9e('0x5b')][_0x2b624e],'CmListId':_0x1a9ef1[_0x0a9e('0x54')]['id']});}return _0x3db98f;});}})[_0x0a9e('0x26')](respondWithResult(_0x5c65fc,null))[_0x0a9e('0x47')](handleError(_0x5c65fc,null));};exports['removeAgents']=function(_0x4156a5,_0x309fa9,_0x3ddbc7){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x4156a5['params']['id']}})['then'](handleEntityNotFound(_0x309fa9,null))[_0x0a9e('0x26')](function(_0x33bcb2){if(_0x33bcb2){return _0x33bcb2[_0x0a9e('0x89')](_0x4156a5['query'][_0x0a9e('0x5b')])[_0x0a9e('0x26')](function(){if(_[_0x0a9e('0x5f')](_0x4156a5['query'][_0x0a9e('0x5b')])){for(var _0x2bf85d=0x0;_0x2bf85d<_0x4156a5[_0x0a9e('0x35')]['ids'][_0x0a9e('0x49')];_0x2bf85d+=0x1){socket[_0x0a9e('0x8a')](_0x0a9e('0x8b'),{'UserId':Number(_0x4156a5['query']['ids'][_0x2bf85d]),'CmListId':Number(_0x4156a5['params']['id'])});}}else{socket[_0x0a9e('0x8a')](_0x0a9e('0x8b'),{'UserId':Number(_0x4156a5[_0x0a9e('0x35')][_0x0a9e('0x5b')]),'CmListId':Number(_0x4156a5['params']['id'])});}});}})[_0x0a9e('0x26')](respondWithStatusCode(_0x309fa9,null))['catch'](handleError(_0x309fa9,null));};exports[_0x0a9e('0x8c')]=function(_0x2ff2ab,_0x242f23,_0x57f673){var _0x33b4b3={};var _0x33a26c={};var _0xb8a476;var _0x580dd6;return db[_0x0a9e('0x30')]['findOne']({'where':{'id':_0x2ff2ab[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x242f23,null))[_0x0a9e('0x26')](function(_0x57b7d4){if(_0x57b7d4){_0xb8a476=_0x57b7d4;_0x33a26c[_0x0a9e('0x34')]=_[_0x0a9e('0x36')](db[_0x0a9e('0x8d')][_0x0a9e('0x31')]);_0x33a26c[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2ff2ab[_0x0a9e('0x35')]);_0x33a26c['filters']=_[_0x0a9e('0x39')](_0x33a26c[_0x0a9e('0x34')],_0x33a26c['query']);_0x33b4b3[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x33a26c['model'],qs[_0x0a9e('0x3a')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x33b4b3['attributes']=_0x33b4b3[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x33b4b3[_0x0a9e('0x38')]:_0x33a26c[_0x0a9e('0x34')];_0x33b4b3[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x33b4b3[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_['pick'](_0x2ff2ab[_0x0a9e('0x35')],_0x33a26c['filters']));if(_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x33b4b3[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x33b4b3[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x33b4b3['attributes'],function(_0x119708){var _0x469035={};_0x469035[_0x119708]={'$like':'%'+_0x2ff2ab[_0x0a9e('0x35')]['filter']+'%'};return _0x469035;})});}_0x33b4b3=_[_0x0a9e('0x4a')]({},_0x33b4b3,_0x2ff2ab[_0x0a9e('0x42')]);return _0xb8a476[_0x0a9e('0x8c')](_0x33b4b3);}})[_0x0a9e('0x26')](function(_0x31e1e0){if(_0x31e1e0){_0x580dd6=_0x31e1e0[_0x0a9e('0x49')];if(!_0x2ff2ab[_0x0a9e('0x35')]['hasOwnProperty'](_0x0a9e('0x6c'))){_0x33b4b3[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x20')]);_0x33b4b3[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x2ff2ab['query']['offset']);}return _0xb8a476[_0x0a9e('0x8c')](_0x33b4b3);}})[_0x0a9e('0x26')](function(_0x1f4929){if(_0x1f4929){return _0x1f4929?{'count':_0x580dd6,'rows':_0x1f4929}:null;}})[_0x0a9e('0x26')](respondWithResult(_0x242f23,null))[_0x0a9e('0x47')](handleError(_0x242f23,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c0c6c46..f18b781 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 _0xa739=['../../mysqldb','CmList','update','remove','emit','events'];(function(_0x50986,_0x9a6416){var _0xa00b3=function(_0x529237){while(--_0x529237){_0x50986['push'](_0x50986['shift']());}};_0xa00b3(++_0x9a6416);}(_0xa739,0x1cd));var _0x9a73=function(_0x340758,_0x477dea){_0x340758=_0x340758-0x0;var _0x51380b=_0xa739[_0x340758];return _0x51380b;};'use strict';var EventEmitter=require(_0x9a73('0x0'));var CmList=require(_0x9a73('0x1'))['db'][_0x9a73('0x2')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9a73('0x3'),'afterDestroy':_0x9a73('0x4')};function emitEvent(_0x477242){return function(_0x380ee6,_0x1a4d48,_0x1f12f8){CmListEvents[_0x9a73('0x5')](_0x477242+':'+_0x380ee6['id'],_0x380ee6);CmListEvents['emit'](_0x477242,_0x380ee6);_0x1f12f8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xe698=['../../mysqldb','CmList','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4c9c93,_0x396c61){var _0x45bdd5=function(_0xbbfec3){while(--_0xbbfec3){_0x4c9c93['push'](_0x4c9c93['shift']());}};_0x45bdd5(++_0x396c61);}(_0xe698,0x156));var _0x8e69=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe698[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require('events');var CmList=require(_0x8e69('0x0'))['db'][_0x8e69('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x8e69('0x2')](0x0);var events={'afterCreate':_0x8e69('0x3'),'afterUpdate':'update','afterDestroy':_0x8e69('0x4')};function emitEvent(_0x4b034a){return function(_0x6ec86c,_0xd61494,_0x4866f7){CmListEvents[_0x8e69('0x5')](_0x4b034a+':'+_0x6ec86c['id'],_0x6ec86c);CmListEvents[_0x8e69('0x5')](_0x4b034a,_0x6ec86c);_0x4866f7(null);};}for(var e in events){if(events[_0x8e69('0x6')](e)){var event=events[e];CmList[_0x8e69('0x7')](e,emitEvent(event));}}module[_0x8e69('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index abb6b04..c264127 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 _0x47f5=['exports','define','cm_lists','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes'];(function(_0x52f0f4,_0x5de069){var _0x1e17b6=function(_0x32bcd4){while(--_0x32bcd4){_0x52f0f4['push'](_0x52f0f4['shift']());}};_0x1e17b6(++_0x5de069);}(_0x47f5,0x1e4));var _0x547f=function(_0x4b0290,_0x188c34){_0x4b0290=_0x4b0290-0x0;var _0x4bd9f4=_0x47f5[_0x4b0290];return _0x4bd9f4;};'use strict';var _=require('lodash');var util=require(_0x547f('0x0'));var logger=require(_0x547f('0x1'))(_0x547f('0x2'));var moment=require(_0x547f('0x3'));var BPromise=require(_0x547f('0x4'));var rp=require(_0x547f('0x5'));var fs=require('fs');var path=require(_0x547f('0x6'));var rimraf=require(_0x547f('0x7'));var config=require(_0x547f('0x8'));var attributes=require(_0x547f('0x9'));module[_0x547f('0xa')]=function(_0x57d474,_0x2f8556){return _0x57d474[_0x547f('0xb')]('CmList',attributes,{'tableName':_0x547f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d89=['api','moment','request-promise','path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','../../config/logger'];(function(_0x586109,_0x4cbd3f){var _0x4a9260=function(_0x38e49a){while(--_0x38e49a){_0x586109['push'](_0x586109['shift']());}};_0x4a9260(++_0x4cbd3f);}(_0x4d89,0x1de));var _0x94d8=function(_0x39ee06,_0x4e1597){_0x39ee06=_0x39ee06-0x0;var _0x4bd680=_0x4d89[_0x39ee06];return _0x4bd680;};'use strict';var _=require(_0x94d8('0x0'));var util=require(_0x94d8('0x1'));var logger=require(_0x94d8('0x2'))(_0x94d8('0x3'));var moment=require(_0x94d8('0x4'));var BPromise=require('bluebird');var rp=require(_0x94d8('0x5'));var fs=require('fs');var path=require(_0x94d8('0x6'));var rimraf=require('rimraf');var config=require(_0x94d8('0x7'));var attributes=require(_0x94d8('0x8'));module[_0x94d8('0x9')]=function(_0xa39bfd,_0x56f58c){return _0xa39bfd[_0x94d8('0xa')](_0x94d8('0xb'),attributes,{'tableName':_0x94d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 5a1be51..25b7834 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 _0xf62e=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xf62e,0xa8));var _0xef62=function(_0x588fe7,_0x49bcfa){_0x588fe7=_0x588fe7-0x0;var _0x535965=_0xf62e[_0x588fe7];return _0x535965;};'use strict';var _=require(_0xef62('0x0'));var util=require(_0xef62('0x1'));var moment=require('moment');var BPromise=require(_0xef62('0x2'));var rs=require(_0xef62('0x3'));var fs=require('fs');var Redis=require(_0xef62('0x4'));var db=require(_0xef62('0x5'))['db'];var utils=require(_0xef62('0x6'));var logger=require(_0xef62('0x7'))('rpc');var config=require(_0xef62('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xef62('0x9')][_0xef62('0xa')]({'port':0x232a});config[_0xef62('0xb')]=_[_0xef62('0xc')](config[_0xef62('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xef62('0xd'))(new Redis(config['redis']));require(_0xef62('0xe'))[_0xef62('0xf')](socket);function respondWithRpcPromise(_0x132703,_0x54eada,_0xf63dd0){return new BPromise(function(_0x27ea7e,_0x3308a1){return client[_0xef62('0x10')](_0x132703,_0xf63dd0)[_0xef62('0x11')](function(_0x34f4b3){logger['info'](_0xef62('0x12'),_0x54eada,_0xef62('0x13'));logger[_0xef62('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x54eada,_0xef62('0x13'),JSON[_0xef62('0x15')](_0x34f4b3));if(_0x34f4b3[_0xef62('0x16')]){if(_0x34f4b3[_0xef62('0x16')][_0xef62('0x17')]===0x1f4){logger[_0xef62('0x16')]('CmList,\x20%s,\x20%s',_0x54eada,_0x34f4b3[_0xef62('0x16')]['message']);return _0x3308a1(_0x34f4b3[_0xef62('0x16')][_0xef62('0x18')]);}logger[_0xef62('0x16')]('CmList,\x20%s,\x20%s',_0x54eada,_0x34f4b3[_0xef62('0x16')][_0xef62('0x18')]);return _0x27ea7e(_0x34f4b3['error'][_0xef62('0x18')]);}else{logger[_0xef62('0x19')]('CmList,\x20%s,\x20%s',_0x54eada,_0xef62('0x13'));_0x27ea7e(_0x34f4b3[_0xef62('0x1a')][_0xef62('0x18')]);}})[_0xef62('0x1b')](function(_0x176ce1){logger[_0xef62('0x16')](_0xef62('0x12'),_0x54eada,_0x176ce1);_0x3308a1(_0x176ce1);});});} \ No newline at end of file +var _0x9e71=['client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4d95b2,_0x404389){var _0x1c1d26=function(_0x225f14){while(--_0x225f14){_0x4d95b2['push'](_0x4d95b2['shift']());}};_0x1c1d26(++_0x404389);}(_0x9e71,0x97));var _0x19e7=function(_0x2c0a26,_0x541967){_0x2c0a26=_0x2c0a26-0x0;var _0x22663e=_0x9e71[_0x2c0a26];return _0x22663e;};'use strict';var _=require(_0x19e7('0x0'));var util=require('util');var moment=require(_0x19e7('0x1'));var BPromise=require(_0x19e7('0x2'));var rs=require(_0x19e7('0x3'));var fs=require('fs');var Redis=require(_0x19e7('0x4'));var db=require(_0x19e7('0x5'))['db'];var utils=require(_0x19e7('0x6'));var logger=require(_0x19e7('0x7'))(_0x19e7('0x8'));var config=require(_0x19e7('0x9'));var jayson=require(_0x19e7('0xa'));var client=jayson[_0x19e7('0xb')][_0x19e7('0xc')]({'port':0x232a});config[_0x19e7('0xd')]=_['defaults'](config['redis'],{'host':_0x19e7('0xe'),'port':0x18eb});var socket=require(_0x19e7('0xf'))(new Redis(config[_0x19e7('0xd')]));require(_0x19e7('0x10'))[_0x19e7('0x11')](socket);function respondWithRpcPromise(_0xb73a61,_0x25a176,_0x411128){return new BPromise(function(_0x48e6a8,_0x403ec4){return client[_0x19e7('0x12')](_0xb73a61,_0x411128)['then'](function(_0x12e1f2){logger[_0x19e7('0x13')](_0x19e7('0x14'),_0x25a176,_0x19e7('0x15'));logger['debug'](_0x19e7('0x16'),_0x25a176,_0x19e7('0x15'),JSON[_0x19e7('0x17')](_0x12e1f2));if(_0x12e1f2['error']){if(_0x12e1f2[_0x19e7('0x18')]['code']===0x1f4){logger[_0x19e7('0x18')](_0x19e7('0x14'),_0x25a176,_0x12e1f2[_0x19e7('0x18')]['message']);return _0x403ec4(_0x12e1f2['error']['message']);}logger[_0x19e7('0x18')](_0x19e7('0x14'),_0x25a176,_0x12e1f2[_0x19e7('0x18')]['message']);return _0x48e6a8(_0x12e1f2['error']['message']);}else{logger['info'](_0x19e7('0x14'),_0x25a176,_0x19e7('0x15'));_0x48e6a8(_0x12e1f2[_0x19e7('0x19')]['message']);}})[_0x19e7('0x1a')](function(_0x33f844){logger[_0x19e7('0x18')](_0x19e7('0x14'),_0x25a176,_0x33f844);_0x403ec4(_0x33f844);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 63eadfe..adb6a17 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 _0xa7be=['update','emit','register','length','cmList:','./cmList.events','save','remove'];(function(_0x155b64,_0x39f501){var _0x37e619=function(_0x5f28f5){while(--_0x5f28f5){_0x155b64['push'](_0x155b64['shift']());}};_0x37e619(++_0x39f501);}(_0xa7be,0xfd));var _0xea7b=function(_0x4b6b5d,_0x12372d){_0x4b6b5d=_0x4b6b5d-0x0;var _0x4437c3=_0xa7be[_0x4b6b5d];return _0x4437c3;};'use strict';var CmListEvents=require(_0xea7b('0x0'));var events=[_0xea7b('0x1'),_0xea7b('0x2'),_0xea7b('0x3')];function createListener(_0x200bf3,_0x56bfb4){return function(_0x49ed41){_0x56bfb4[_0xea7b('0x4')](_0x200bf3,_0x49ed41);};}function removeListener(_0x98ad19,_0x3a1456){return function(){CmListEvents['removeListener'](_0x98ad19,_0x3a1456);};}exports[_0xea7b('0x5')]=function(_0x1bf6cb){for(var _0x3078c9=0x0,_0x211831=events[_0xea7b('0x6')];_0x3078c9<_0x211831;_0x3078c9++){var _0x3601b3=events[_0x3078c9];var _0x1c789e=createListener(_0xea7b('0x7')+_0x3601b3,_0x1bf6cb);CmListEvents['on'](_0x3601b3,_0x1c789e);}}; \ No newline at end of file +var _0xed08=['remove','update','emit','removeListener','register','length','cmList:','save'];(function(_0x2526e3,_0x5f22f8){var _0xcf6f48=function(_0x284491){while(--_0x284491){_0x2526e3['push'](_0x2526e3['shift']());}};_0xcf6f48(++_0x5f22f8);}(_0xed08,0x67));var _0x8ed0=function(_0x395d91,_0x229178){_0x395d91=_0x395d91-0x0;var _0x4dcc3f=_0xed08[_0x395d91];return _0x4dcc3f;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x8ed0('0x0'),_0x8ed0('0x1'),_0x8ed0('0x2')];function createListener(_0x13c458,_0xce1ff){return function(_0x1ff91e){_0xce1ff[_0x8ed0('0x3')](_0x13c458,_0x1ff91e);};}function removeListener(_0x33c3ad,_0x14901f){return function(){CmListEvents[_0x8ed0('0x4')](_0x33c3ad,_0x14901f);};}exports[_0x8ed0('0x5')]=function(_0x43ca60){for(var _0x5c1343=0x0,_0x15f266=events[_0x8ed0('0x6')];_0x5c1343<_0x15f266;_0x5c1343++){var _0x1c86e6=events[_0x5c1343];var _0x39642a=createListener(_0x8ed0('0x7')+_0x1c86e6,_0x43ca60);CmListEvents['on'](_0x1c86e6,_0x39642a);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index ffd6fd6..da7eaa5 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 _0xe32d=['/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','addContacts','addCustomField','addAgents','update','destroy','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x118d25,_0x59aac1){var _0x490944=function(_0x541554){while(--_0x541554){_0x118d25['push'](_0x118d25['shift']());}};_0x490944(++_0x59aac1);}(_0xe32d,0x1a4));var _0xde32=function(_0x1c64e0,_0x3c1627){_0x1c64e0=_0x1c64e0-0x0;var _0x3a3cb2=_0xe32d[_0x1c64e0];return _0x3a3cb2;};'use strict';var multer=require('multer');var util=require(_0xde32('0x0'));var path=require('path');var timeout=require(_0xde32('0x1'));var express=require('express');var router=express[_0xde32('0x2')]();var auth=require(_0xde32('0x3'));var interaction=require(_0xde32('0x4'));var config=require(_0xde32('0x5'));var controller=require(_0xde32('0x6'));router[_0xde32('0x7')]('/',auth[_0xde32('0x8')](),controller['index']);router[_0xde32('0x7')](_0xde32('0x9'),auth[_0xde32('0x8')](),controller[_0xde32('0xa')]);router[_0xde32('0x7')](_0xde32('0xb'),auth[_0xde32('0x8')](),controller[_0xde32('0xc')]);router[_0xde32('0x7')](_0xde32('0xd'),auth[_0xde32('0x8')](),controller[_0xde32('0xe')]);router[_0xde32('0x7')](_0xde32('0xf'),auth[_0xde32('0x8')](),controller[_0xde32('0x10')]);router[_0xde32('0x7')](_0xde32('0x11'),auth[_0xde32('0x8')](),controller['getContactsCsv']);router[_0xde32('0x7')](_0xde32('0x12'),auth[_0xde32('0x8')](),controller[_0xde32('0x13')]);router[_0xde32('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xde32('0x14')]);router[_0xde32('0x15')]('/',auth[_0xde32('0x8')](),controller['create']);router[_0xde32('0x15')](_0xde32('0xd'),auth[_0xde32('0x8')](),controller['addDisposition']);router[_0xde32('0x15')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xde32('0x16')]);router[_0xde32('0x15')](_0xde32('0x12'),auth['isAuthenticated'](),controller[_0xde32('0x17')]);router[_0xde32('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xde32('0x18')]);router['put'](_0xde32('0xb'),auth[_0xde32('0x8')](),controller[_0xde32('0x19')]);router['delete'](_0xde32('0xb'),auth[_0xde32('0x8')](),controller[_0xde32('0x1a')]);router[_0xde32('0x1b')](_0xde32('0xd'),auth[_0xde32('0x8')](),controller['removeDispositions']);router['delete']('/:id/users',auth[_0xde32('0x8')](),controller['removeAgents']);module[_0xde32('0x1c')]=router; \ No newline at end of file +var _0x77a6=['/:id/fields','getCustomFields','/:id/users','getAgents','create','addDisposition','/:id/contacts','addContacts','post','addCustomField','addAgents','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts/csv','getContactsCsv'];(function(_0xfdec55,_0x216a99){var _0x11ec76=function(_0x3086d3){while(--_0x3086d3){_0xfdec55['push'](_0xfdec55['shift']());}};_0x11ec76(++_0x216a99);}(_0x77a6,0x117));var _0x677a=function(_0x10bf2d,_0x595b75){_0x10bf2d=_0x10bf2d-0x0;var _0x2dba98=_0x77a6[_0x10bf2d];return _0x2dba98;};'use strict';var multer=require(_0x677a('0x0'));var util=require(_0x677a('0x1'));var path=require(_0x677a('0x2'));var timeout=require(_0x677a('0x3'));var express=require(_0x677a('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x677a('0x5'));var config=require(_0x677a('0x6'));var controller=require(_0x677a('0x7'));router[_0x677a('0x8')]('/',auth[_0x677a('0x9')](),controller[_0x677a('0xa')]);router[_0x677a('0x8')](_0x677a('0xb'),auth[_0x677a('0x9')](),controller['describe']);router[_0x677a('0x8')](_0x677a('0xc'),auth[_0x677a('0x9')](),controller[_0x677a('0xd')]);router[_0x677a('0x8')](_0x677a('0xe'),auth['isAuthenticated'](),controller[_0x677a('0xf')]);router[_0x677a('0x8')]('/:id/contacts',auth[_0x677a('0x9')](),controller['getContacts']);router[_0x677a('0x8')](_0x677a('0x10'),auth['isAuthenticated'](),controller[_0x677a('0x11')]);router[_0x677a('0x8')](_0x677a('0x12'),auth[_0x677a('0x9')](),controller[_0x677a('0x13')]);router[_0x677a('0x8')](_0x677a('0x14'),auth[_0x677a('0x9')](),controller[_0x677a('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x677a('0x16')]);router['post'](_0x677a('0xe'),auth[_0x677a('0x9')](),controller[_0x677a('0x17')]);router['post'](_0x677a('0x18'),auth[_0x677a('0x9')](),controller[_0x677a('0x19')]);router[_0x677a('0x1a')](_0x677a('0x12'),auth['isAuthenticated'](),controller[_0x677a('0x1b')]);router[_0x677a('0x1a')](_0x677a('0x14'),auth['isAuthenticated'](),controller[_0x677a('0x1c')]);router['put'](_0x677a('0xc'),auth[_0x677a('0x9')](),controller[_0x677a('0x1d')]);router[_0x677a('0x1e')]('/:id',auth[_0x677a('0x9')](),controller['destroy']);router['delete'](_0x677a('0xe'),auth[_0x677a('0x9')](),controller[_0x677a('0x1f')]);router[_0x677a('0x1e')](_0x677a('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x677a('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index c6d85de..a356bd2 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x3e6cfa,_0x4d0ef7){var _0x3947fa=function(_0x44be59){while(--_0x44be59){_0x3e6cfa['push'](_0x3e6cfa['shift']());}};_0x3947fa(++_0x4d0ef7);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x17de73,_0x960b6d){var _0x3b2323=function(_0x657905){while(--_0x657905){_0x17de73['push'](_0x17de73['shift']());}};_0x3b2323(++_0x960b6d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 0f1ffe9..03cff85 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 _0xb2c8=['then','error','stack','name','send','update','body','Condition','find','params','catch','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','reject','save'];(function(_0x124169,_0x2c3b21){var _0x1e9a8d=function(_0x79350a){while(--_0x79350a){_0x124169['push'](_0x124169['shift']());}};_0x1e9a8d(++_0x2c3b21);}(_0xb2c8,0x197));var _0x8b2c=function(_0x2bef11,_0x5926ae){_0x2bef11=_0x2bef11-0x0;var _0x393d55=_0xb2c8[_0x2bef11];return _0x393d55;};'use strict';var pdf=require(_0x8b2c('0x0'));var emlformat=require(_0x8b2c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8b2c('0x2'));var rp=require(_0x8b2c('0x3'));var moment=require(_0x8b2c('0x4'));var BPromise=require(_0x8b2c('0x5'));var Mustache=require(_0x8b2c('0x6'));var util=require('util');var path=require(_0x8b2c('0x7'));var sox=require(_0x8b2c('0x8'));var csv=require(_0x8b2c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8b2c('0xa'));var squel=require(_0x8b2c('0xb'));var crypto=require(_0x8b2c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8b2c('0xd'));var toCsv=require(_0x8b2c('0x9'));var querystring=require('querystring');var Papa=require(_0x8b2c('0xe'));var Redis=require('ioredis');var authService=require(_0x8b2c('0xf'));var qs=require(_0x8b2c('0x10'));var as=require(_0x8b2c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b2c('0x12'))(_0x8b2c('0x13'));var utils=require(_0x8b2c('0x14'));var config=require(_0x8b2c('0x15'));var db=require(_0x8b2c('0x16'))['db'];function respondWithStatusCode(_0x56c1bf,_0xaf80da){_0xaf80da=_0xaf80da||0xcc;return function(_0x11539e){if(_0x11539e){return _0x56c1bf[_0x8b2c('0x17')](_0xaf80da);}return _0x56c1bf[_0x8b2c('0x18')](_0xaf80da)[_0x8b2c('0x19')]();};}function respondWithResult(_0x2220c4,_0x33499d){_0x33499d=_0x33499d||0xc8;return function(_0x5634aa){if(_0x5634aa){return _0x2220c4['status'](_0x33499d)['json'](_0x5634aa);}};}function respondWithFilteredResult(_0xf01caa,_0x4721a2){return function(_0x4d2c37){if(_0x4d2c37){var _0x38c88d=_0x4d2c37['count'],_0xde121e=_0x4721a2['offset'],_0x3f3055=_0x4721a2[_0x8b2c('0x1a')]+_0x4721a2[_0x8b2c('0x1b')],_0xb06123;if(_0x3f3055>=_0x38c88d){_0x3f3055=_0x38c88d;_0xb06123=0xc8;}else{_0xb06123=0xce;}_0xf01caa[_0x8b2c('0x18')](_0xb06123);return _0xf01caa[_0x8b2c('0x1c')]('Content-Range',_0xde121e+'-'+_0x3f3055+'/'+_0x38c88d)[_0x8b2c('0x1d')](_0x4d2c37);}return null;};}function patchUpdates(_0x1c1743){return function(_0x25b2c6){try{jsonpatch[_0x8b2c('0x1e')](_0x25b2c6,_0x1c1743,!![]);}catch(_0x14992b){return BPromise[_0x8b2c('0x1f')](_0x14992b);}return _0x25b2c6[_0x8b2c('0x20')]();};}function saveUpdates(_0x4ffcba,_0x43b8ea){return function(_0x361d41){if(_0x361d41){return _0x361d41['update'](_0x4ffcba)[_0x8b2c('0x21')](function(_0x3725c5){return _0x3725c5;});}return null;};}function removeEntity(_0x2fc2df,_0x4bae8c){return function(_0x4136ba){if(_0x4136ba){return _0x4136ba['destroy']()[_0x8b2c('0x21')](function(){_0x2fc2df[_0x8b2c('0x18')](0xcc)[_0x8b2c('0x19')]();});}};}function handleEntityNotFound(_0x3ac57b,_0x43ae23){return function(_0x29d277){if(!_0x29d277){_0x3ac57b['sendStatus'](0x194);}return _0x29d277;};}function handleError(_0x4803a7,_0xe1cb95){_0xe1cb95=_0xe1cb95||0x1f4;return function(_0x34fa36){logger[_0x8b2c('0x22')](_0x34fa36[_0x8b2c('0x23')]);if(_0x34fa36[_0x8b2c('0x24')]){delete _0x34fa36[_0x8b2c('0x24')];}_0x4803a7[_0x8b2c('0x18')](_0xe1cb95)[_0x8b2c('0x25')](_0x34fa36);};}exports[_0x8b2c('0x26')]=function(_0x394bbd,_0x2b81d6){if(_0x394bbd[_0x8b2c('0x27')]['id']){delete _0x394bbd[_0x8b2c('0x27')]['id'];}return db[_0x8b2c('0x28')][_0x8b2c('0x29')]({'where':{'id':_0x394bbd[_0x8b2c('0x2a')]['id']}})[_0x8b2c('0x21')](handleEntityNotFound(_0x2b81d6,null))['then'](saveUpdates(_0x394bbd[_0x8b2c('0x27')],null))[_0x8b2c('0x21')](respondWithResult(_0x2b81d6,null))['catch'](handleError(_0x2b81d6,null));};exports['destroy']=function(_0x445c69,_0x4ac6c6){return db[_0x8b2c('0x28')][_0x8b2c('0x29')]({'where':{'id':_0x445c69[_0x8b2c('0x2a')]['id']}})[_0x8b2c('0x21')](handleEntityNotFound(_0x4ac6c6,null))[_0x8b2c('0x21')](removeEntity(_0x4ac6c6,null))[_0x8b2c('0x2b')](handleError(_0x4ac6c6,null));}; \ No newline at end of file +var _0x1dd1=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','name','send','update','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1dd1,0x1e2));var _0x11dd=function(_0x17ec07,_0xe3ca90){_0x17ec07=_0x17ec07-0x0;var _0x5a6c45=_0x1dd1[_0x17ec07];return _0x5a6c45;};'use strict';var pdf=require(_0x11dd('0x0'));var emlformat=require(_0x11dd('0x1'));var rimraf=require(_0x11dd('0x2'));var zipdir=require(_0x11dd('0x3'));var jsonpatch=require(_0x11dd('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x11dd('0x5'));var Mustache=require(_0x11dd('0x6'));var util=require(_0x11dd('0x7'));var path=require('path');var sox=require(_0x11dd('0x8'));var csv=require(_0x11dd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x11dd('0xa'));var squel=require(_0x11dd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x11dd('0xc'));var toCsv=require(_0x11dd('0x9'));var querystring=require(_0x11dd('0xd'));var Papa=require(_0x11dd('0xe'));var Redis=require(_0x11dd('0xf'));var authService=require(_0x11dd('0x10'));var qs=require(_0x11dd('0x11'));var as=require(_0x11dd('0x12'));var hardwareService=require(_0x11dd('0x13'));var logger=require(_0x11dd('0x14'))(_0x11dd('0x15'));var utils=require(_0x11dd('0x16'));var config=require(_0x11dd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a6140,_0xafdb2b){_0xafdb2b=_0xafdb2b||0xcc;return function(_0x198c46){if(_0x198c46){return _0x1a6140[_0x11dd('0x18')](_0xafdb2b);}return _0x1a6140[_0x11dd('0x19')](_0xafdb2b)[_0x11dd('0x1a')]();};}function respondWithResult(_0xbe1308,_0x5342cf){_0x5342cf=_0x5342cf||0xc8;return function(_0x129e8f){if(_0x129e8f){return _0xbe1308[_0x11dd('0x19')](_0x5342cf)[_0x11dd('0x1b')](_0x129e8f);}};}function respondWithFilteredResult(_0x5c590f,_0x116a0f){return function(_0x4a98be){if(_0x4a98be){var _0x131a6d=_0x4a98be[_0x11dd('0x1c')],_0x46e6c7=_0x116a0f[_0x11dd('0x1d')],_0x3e8ddb=_0x116a0f[_0x11dd('0x1d')]+_0x116a0f[_0x11dd('0x1e')],_0x53b358;if(_0x3e8ddb>=_0x131a6d){_0x3e8ddb=_0x131a6d;_0x53b358=0xc8;}else{_0x53b358=0xce;}_0x5c590f[_0x11dd('0x19')](_0x53b358);return _0x5c590f['set'](_0x11dd('0x1f'),_0x46e6c7+'-'+_0x3e8ddb+'/'+_0x131a6d)[_0x11dd('0x1b')](_0x4a98be);}return null;};}function patchUpdates(_0x79a737){return function(_0x95c96d){try{jsonpatch[_0x11dd('0x20')](_0x95c96d,_0x79a737,!![]);}catch(_0x371cfe){return BPromise[_0x11dd('0x21')](_0x371cfe);}return _0x95c96d[_0x11dd('0x22')]();};}function saveUpdates(_0x5c00ec,_0x2d79da){return function(_0x21bfa9){if(_0x21bfa9){return _0x21bfa9['update'](_0x5c00ec)[_0x11dd('0x23')](function(_0x5cc588){return _0x5cc588;});}return null;};}function removeEntity(_0x30a60c,_0x19d161){return function(_0x13f810){if(_0x13f810){return _0x13f810[_0x11dd('0x24')]()[_0x11dd('0x23')](function(){_0x30a60c[_0x11dd('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a6e9b,_0x27256b){return function(_0x178586){if(!_0x178586){_0x2a6e9b['sendStatus'](0x194);}return _0x178586;};}function handleError(_0x260cd0,_0x455358){_0x455358=_0x455358||0x1f4;return function(_0x14e082){logger['error'](_0x14e082['stack']);if(_0x14e082[_0x11dd('0x25')]){delete _0x14e082[_0x11dd('0x25')];}_0x260cd0['status'](_0x455358)[_0x11dd('0x26')](_0x14e082);};}exports[_0x11dd('0x27')]=function(_0x3c1253,_0x144a36){if(_0x3c1253[_0x11dd('0x28')]['id']){delete _0x3c1253['body']['id'];}return db[_0x11dd('0x29')][_0x11dd('0x2a')]({'where':{'id':_0x3c1253[_0x11dd('0x2b')]['id']}})[_0x11dd('0x23')](handleEntityNotFound(_0x144a36,null))['then'](saveUpdates(_0x3c1253[_0x11dd('0x28')],null))['then'](respondWithResult(_0x144a36,null))[_0x11dd('0x2c')](handleError(_0x144a36,null));};exports['destroy']=function(_0x23ae5d,_0x36f5bf){return db[_0x11dd('0x29')][_0x11dd('0x2a')]({'where':{'id':_0x23ae5d[_0x11dd('0x2b')]['id']}})[_0x11dd('0x23')](handleEntityNotFound(_0x36f5bf,null))[_0x11dd('0x23')](removeEntity(_0x36f5bf,null))[_0x11dd('0x2c')](handleError(_0x36f5bf,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index fd6edea..af4cfdb 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 _0x38d3=['path','rimraf','../../config/environment','./condition.attributes','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x199a74,_0xca2280){var _0x2ba6f5=function(_0x1bfe1a){while(--_0x1bfe1a){_0x199a74['push'](_0x199a74['shift']());}};_0x2ba6f5(++_0xca2280);}(_0x38d3,0x96));var _0x338d=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x38d3[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var logger=require(_0x338d('0x2'))(_0x338d('0x3'));var moment=require(_0x338d('0x4'));var BPromise=require('bluebird');var rp=require(_0x338d('0x5'));var fs=require('fs');var path=require(_0x338d('0x6'));var rimraf=require(_0x338d('0x7'));var config=require(_0x338d('0x8'));var attributes=require(_0x338d('0x9'));module['exports']=function(_0xdd4da5,_0x374b5d){return _0xdd4da5[_0x338d('0xa')](_0x338d('0xb'),attributes,{'tableName':_0x338d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9070=['path','rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1ba9fb,_0x1d4bc7){var _0x44194e=function(_0x5bcee3){while(--_0x5bcee3){_0x1ba9fb['push'](_0x1ba9fb['shift']());}};_0x44194e(++_0x1d4bc7);}(_0x9070,0xfe));var _0x0907=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x9070[_0x516927];return _0x30749b;};'use strict';var _=require(_0x0907('0x0'));var util=require(_0x0907('0x1'));var logger=require(_0x0907('0x2'))('api');var moment=require(_0x0907('0x3'));var BPromise=require(_0x0907('0x4'));var rp=require(_0x0907('0x5'));var fs=require('fs');var path=require(_0x0907('0x6'));var rimraf=require(_0x0907('0x7'));var config=require(_0x0907('0x8'));var attributes=require(_0x0907('0x9'));module[_0x0907('0xa')]=function(_0x222342,_0x36652d){return _0x222342['define'](_0x0907('0xb'),attributes,{'tableName':_0x0907('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 83694d4..595b515 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 _0xc438=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x8e8823,_0x6e0915){var _0x4e2601=function(_0x341d5e){while(--_0x341d5e){_0x8e8823['push'](_0x8e8823['shift']());}};_0x4e2601(++_0x6e0915);}(_0xc438,0x18e));var _0x8c43=function(_0x1e21ba,_0x55f7a4){_0x1e21ba=_0x1e21ba-0x0;var _0x32866b=_0xc438[_0x1e21ba];return _0x32866b;};'use strict';var _=require(_0x8c43('0x0'));var util=require(_0x8c43('0x1'));var moment=require(_0x8c43('0x2'));var BPromise=require(_0x8c43('0x3'));var rs=require(_0x8c43('0x4'));var fs=require('fs');var Redis=require(_0x8c43('0x5'));var db=require(_0x8c43('0x6'))['db'];var utils=require(_0x8c43('0x7'));var logger=require(_0x8c43('0x8'))(_0x8c43('0x9'));var config=require(_0x8c43('0xa'));var jayson=require(_0x8c43('0xb'));var client=jayson[_0x8c43('0xc')][_0x8c43('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5654a5,_0x380d5e,_0x1fcfcb){return new BPromise(function(_0x4fb131,_0x50879c){return client['request'](_0x5654a5,_0x1fcfcb)[_0x8c43('0xe')](function(_0x2df926){logger[_0x8c43('0xf')](_0x8c43('0x10'),_0x380d5e,_0x8c43('0x11'));logger['debug'](_0x8c43('0x12'),_0x380d5e,'request\x20sent',JSON[_0x8c43('0x13')](_0x2df926));if(_0x2df926[_0x8c43('0x14')]){if(_0x2df926[_0x8c43('0x14')][_0x8c43('0x15')]===0x1f4){logger[_0x8c43('0x14')]('Condition,\x20%s,\x20%s',_0x380d5e,_0x2df926[_0x8c43('0x14')][_0x8c43('0x16')]);return _0x50879c(_0x2df926[_0x8c43('0x14')][_0x8c43('0x16')]);}logger[_0x8c43('0x14')]('Condition,\x20%s,\x20%s',_0x380d5e,_0x2df926[_0x8c43('0x14')]['message']);return _0x4fb131(_0x2df926['error'][_0x8c43('0x16')]);}else{logger[_0x8c43('0xf')](_0x8c43('0x10'),_0x380d5e,'request\x20sent');_0x4fb131(_0x2df926[_0x8c43('0x17')][_0x8c43('0x16')]);}})[_0x8c43('0x18')](function(_0x59b193){logger[_0x8c43('0x14')](_0x8c43('0x10'),_0x380d5e,_0x59b193);_0x50879c(_0x59b193);});});} \ No newline at end of file +var _0x0a81=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0x0a81,0x1cb));var _0x10a8=function(_0x5c5e4b,_0x3f5811){_0x5c5e4b=_0x5c5e4b-0x0;var _0x4ca419=_0x0a81[_0x5c5e4b];return _0x4ca419;};'use strict';var _=require(_0x10a8('0x0'));var util=require(_0x10a8('0x1'));var moment=require(_0x10a8('0x2'));var BPromise=require(_0x10a8('0x3'));var rs=require(_0x10a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10a8('0x5'))['db'];var utils=require(_0x10a8('0x6'));var logger=require('../../config/logger')(_0x10a8('0x7'));var config=require(_0x10a8('0x8'));var jayson=require(_0x10a8('0x9'));var client=jayson[_0x10a8('0xa')][_0x10a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30b769,_0x82c1c4,_0x1a686c){return new BPromise(function(_0x4528fb,_0x175033){return client[_0x10a8('0xc')](_0x30b769,_0x1a686c)[_0x10a8('0xd')](function(_0x2bd243){logger[_0x10a8('0xe')](_0x10a8('0xf'),_0x82c1c4,_0x10a8('0x10'));logger['debug'](_0x10a8('0x11'),_0x82c1c4,'request\x20sent',JSON[_0x10a8('0x12')](_0x2bd243));if(_0x2bd243[_0x10a8('0x13')]){if(_0x2bd243['error'][_0x10a8('0x14')]===0x1f4){logger[_0x10a8('0x13')](_0x10a8('0xf'),_0x82c1c4,_0x2bd243['error'][_0x10a8('0x15')]);return _0x175033(_0x2bd243['error'][_0x10a8('0x15')]);}logger[_0x10a8('0x13')](_0x10a8('0xf'),_0x82c1c4,_0x2bd243[_0x10a8('0x13')]['message']);return _0x4528fb(_0x2bd243[_0x10a8('0x13')][_0x10a8('0x15')]);}else{logger[_0x10a8('0xe')]('Condition,\x20%s,\x20%s',_0x82c1c4,_0x10a8('0x10'));_0x4528fb(_0x2bd243[_0x10a8('0x16')][_0x10a8('0x15')]);}})[_0x10a8('0x17')](function(_0x5b28cf){logger[_0x10a8('0x13')](_0x10a8('0xf'),_0x82c1c4,_0x5b28cf);_0x175033(_0x5b28cf);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a257efe..67e9922 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 _0xb59f=['./condition.controller','put','/:id','isAuthenticated','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x47707e,_0x58c7dc){var _0x37b727=function(_0x158bf4){while(--_0x158bf4){_0x47707e['push'](_0x47707e['shift']());}};_0x37b727(++_0x58c7dc);}(_0xb59f,0x19d));var _0xfb59=function(_0x4ef343,_0x124611){_0x4ef343=_0x4ef343-0x0;var _0x14f697=_0xb59f[_0x4ef343];return _0x14f697;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfb59('0x0'));var timeout=require(_0xfb59('0x1'));var express=require(_0xfb59('0x2'));var router=express[_0xfb59('0x3')]();var auth=require(_0xfb59('0x4'));var interaction=require(_0xfb59('0x5'));var config=require(_0xfb59('0x6'));var controller=require(_0xfb59('0x7'));router[_0xfb59('0x8')](_0xfb59('0x9'),auth[_0xfb59('0xa')](),controller[_0xfb59('0xb')]);router[_0xfb59('0xc')](_0xfb59('0x9'),auth[_0xfb59('0xa')](),controller['destroy']);module[_0xfb59('0xd')]=router; \ No newline at end of file +var _0x2fd8=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x12d82d,_0x40a7ab){var _0x5fde95=function(_0x432761){while(--_0x432761){_0x12d82d['push'](_0x12d82d['shift']());}};_0x5fde95(++_0x40a7ab);}(_0x2fd8,0x14b));var _0x82fd=function(_0x2e4ff1,_0xfc87d2){_0x2e4ff1=_0x2e4ff1-0x0;var _0x326062=_0x2fd8[_0x2e4ff1];return _0x326062;};'use strict';var multer=require(_0x82fd('0x0'));var util=require(_0x82fd('0x1'));var path=require(_0x82fd('0x2'));var timeout=require(_0x82fd('0x3'));var express=require(_0x82fd('0x4'));var router=express[_0x82fd('0x5')]();var auth=require(_0x82fd('0x6'));var interaction=require(_0x82fd('0x7'));var config=require(_0x82fd('0x8'));var controller=require(_0x82fd('0x9'));router['put'](_0x82fd('0xa'),auth[_0x82fd('0xb')](),controller[_0x82fd('0xc')]);router[_0x82fd('0xd')](_0x82fd('0xa'),auth[_0x82fd('0xb')](),controller[_0x82fd('0xe')]);module[_0x82fd('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 6b6fa2f..3dc3d08 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 _0x3ca4=['sequelize','exports','STRING'];(function(_0x47548a,_0xb21b59){var _0x4246b4=function(_0x306fa8){while(--_0x306fa8){_0x47548a['push'](_0x47548a['shift']());}};_0x4246b4(++_0xb21b59);}(_0x3ca4,0x17d));var _0x43ca=function(_0x1bad3e,_0x3c169c){_0x1bad3e=_0x1bad3e-0x0;var _0x2796fc=_0x3ca4[_0x1bad3e];return _0x2796fc;};'use strict';var Sequelize=require(_0x43ca('0x0'));module[_0x43ca('0x1')]={'name':{'type':Sequelize[_0x43ca('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeff8=['name','STRING','sequelize','exports'];(function(_0x3fad5a,_0x2d3b02){var _0x4ca713=function(_0x2abe58){while(--_0x2abe58){_0x3fad5a['push'](_0x3fad5a['shift']());}};_0x4ca713(++_0x2d3b02);}(_0xeff8,0x186));var _0x8eff=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xeff8[_0x235482];return _0x5f5bea;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8eff('0x2')},'description':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 130219d..a53c89a 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 _0xf296=['createdAt','updatedAt','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','getItems','findOne','html-pdf','eml-format','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','status','count','offset','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0xf296,0x94));var _0x6f29=function(_0x1e4dca,_0x44147a){_0x1e4dca=_0x1e4dca-0x0;var _0x355ca9=_0xf296[_0x1e4dca];return _0x355ca9;};'use strict';var pdf=require(_0x6f29('0x0'));var emlformat=require(_0x6f29('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6f29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f29('0x3'));var BPromise=require(_0x6f29('0x4'));var Mustache=require('mustache');var util=require(_0x6f29('0x5'));var path=require(_0x6f29('0x6'));var sox=require(_0x6f29('0x7'));var csv=require('to-csv');var ejs=require(_0x6f29('0x8'));var fs=require('fs');var _=require(_0x6f29('0x9'));var squel=require('squel');var crypto=require(_0x6f29('0xa'));var jsforce=require(_0x6f29('0xb'));var deskjs=require(_0x6f29('0xc'));var toCsv=require(_0x6f29('0xd'));var querystring=require(_0x6f29('0xe'));var Papa=require(_0x6f29('0xf'));var Redis=require(_0x6f29('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6f29('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6f29('0x12'));var utils=require('../../config/utils');var config=require(_0x6f29('0x13'));var db=require(_0x6f29('0x14'))['db'];config[_0x6f29('0x15')]=_['defaults'](config[_0x6f29('0x15')],{'host':_0x6f29('0x16'),'port':0x18eb});var socket=require(_0x6f29('0x17'))(new Redis(config[_0x6f29('0x15')]));require(_0x6f29('0x18'))['register'](socket);function respondWithStatusCode(_0x429604,_0x115d08){_0x115d08=_0x115d08||0xcc;return function(_0x3a9802){if(_0x3a9802){return _0x429604['sendStatus'](_0x115d08);}return _0x429604[_0x6f29('0x19')](_0x115d08)['end']();};}function respondWithResult(_0x3959e4,_0x2907e4){_0x2907e4=_0x2907e4||0xc8;return function(_0x1c1f05){if(_0x1c1f05){return _0x3959e4[_0x6f29('0x19')](_0x2907e4)['json'](_0x1c1f05);}};}function respondWithFilteredResult(_0x5c50ba,_0x28995e){return function(_0x4345ea){if(_0x4345ea){var _0x5b524d=_0x4345ea[_0x6f29('0x1a')],_0x5b4998=_0x28995e[_0x6f29('0x1b')],_0x30e10f=_0x28995e[_0x6f29('0x1b')]+_0x28995e['limit'],_0x19a72c;if(_0x30e10f>=_0x5b524d){_0x30e10f=_0x5b524d;_0x19a72c=0xc8;}else{_0x19a72c=0xce;}_0x5c50ba[_0x6f29('0x19')](_0x19a72c);return _0x5c50ba[_0x6f29('0x1c')](_0x6f29('0x1d'),_0x5b4998+'-'+_0x30e10f+'/'+_0x5b524d)[_0x6f29('0x1e')](_0x4345ea);}return null;};}function patchUpdates(_0x1f7c53){return function(_0x115ae4){try{jsonpatch['apply'](_0x115ae4,_0x1f7c53,!![]);}catch(_0x47df19){return BPromise[_0x6f29('0x1f')](_0x47df19);}return _0x115ae4[_0x6f29('0x20')]();};}function saveUpdates(_0xf7309,_0x4924ca){return function(_0x477721){if(_0x477721){return _0x477721[_0x6f29('0x21')](_0xf7309)[_0x6f29('0x22')](function(_0x3e9977){return _0x3e9977;});}return null;};}function removeEntity(_0x16eaa9,_0x9d7eda){return function(_0x50a9e8){if(_0x50a9e8){return _0x50a9e8[_0x6f29('0x23')]()[_0x6f29('0x22')](function(){var _0x2d0a81=_0x50a9e8['get']({'plain':!![]});var _0x5883e3='CustomDashboards';return db[_0x6f29('0x24')][_0x6f29('0x23')]({'where':{'type':_0x5883e3,'resourceId':_0x2d0a81['id']}})[_0x6f29('0x22')](function(){return _0x50a9e8;});})[_0x6f29('0x22')](function(){_0x16eaa9[_0x6f29('0x19')](0xcc)[_0x6f29('0x25')]();});}};}function handleEntityNotFound(_0x19a87b,_0x246460){return function(_0x4c2c7e){if(!_0x4c2c7e){_0x19a87b[_0x6f29('0x26')](0x194);}return _0x4c2c7e;};}function handleError(_0x45e490,_0x4ceaea){_0x4ceaea=_0x4ceaea||0x1f4;return function(_0x18f379){logger[_0x6f29('0x27')](_0x18f379[_0x6f29('0x28')]);if(_0x18f379[_0x6f29('0x29')]){delete _0x18f379[_0x6f29('0x29')];}_0x45e490['status'](_0x4ceaea)[_0x6f29('0x2a')](_0x18f379);};}exports[_0x6f29('0x2b')]=function(_0x5b57a3,_0x2ed762){var _0xb321a0={},_0x4bbedf={},_0x208d63={'count':0x0,'rows':[]};var _0x5db197=_[_0x6f29('0x2c')](db[_0x6f29('0x2d')][_0x6f29('0x2e')],function(_0x52ebd3){return{'name':_0x52ebd3[_0x6f29('0x2f')],'type':_0x52ebd3[_0x6f29('0x30')][_0x6f29('0x31')]};});_0x4bbedf['model']=_[_0x6f29('0x2c')](_0x5db197,_0x6f29('0x29'));_0x4bbedf['query']=_[_0x6f29('0x32')](_0x5b57a3[_0x6f29('0x33')]);_0x4bbedf[_0x6f29('0x34')]=_[_0x6f29('0x35')](_0x4bbedf[_0x6f29('0x36')],_0x4bbedf[_0x6f29('0x33')]);_0xb321a0[_0x6f29('0x37')]=_[_0x6f29('0x35')](_0x4bbedf[_0x6f29('0x36')],qs[_0x6f29('0x38')](_0x5b57a3['query']['fields']));_0xb321a0[_0x6f29('0x37')]=_0xb321a0['attributes'][_0x6f29('0x39')]?_0xb321a0[_0x6f29('0x37')]:_0x4bbedf[_0x6f29('0x36')];if(!_0x5b57a3['query'][_0x6f29('0x3a')](_0x6f29('0x3b'))){_0xb321a0['limit']=qs[_0x6f29('0x3c')](_0x5b57a3['query'][_0x6f29('0x3c')]);_0xb321a0[_0x6f29('0x1b')]=qs[_0x6f29('0x1b')](_0x5b57a3['query'][_0x6f29('0x1b')]);}_0xb321a0[_0x6f29('0x3d')]=qs[_0x6f29('0x3e')](_0x5b57a3[_0x6f29('0x33')][_0x6f29('0x3e')]);_0xb321a0[_0x6f29('0x3f')]=qs[_0x6f29('0x34')](_[_0x6f29('0x40')](_0x5b57a3[_0x6f29('0x33')],_0x4bbedf[_0x6f29('0x34')]));if(_0x5b57a3[_0x6f29('0x33')][_0x6f29('0x41')]){_0xb321a0[_0x6f29('0x3f')]=_['merge'](_0xb321a0['where'],{'$or':_[_0x6f29('0x2c')](_0x5db197,function(_0x319ed2){if(_0x319ed2[_0x6f29('0x30')]!==_0x6f29('0x42')){var _0x3eb0ba={};_0x3eb0ba[_0x319ed2[_0x6f29('0x29')]]={'$like':'%'+_0x5b57a3[_0x6f29('0x33')]['filter']+'%'};return _0x3eb0ba;}})});}_0xb321a0=_[_0x6f29('0x43')]({},_0xb321a0,_0x5b57a3[_0x6f29('0x44')]);var _0x4c103c={'where':_0xb321a0['where']};return db[_0x6f29('0x2d')]['count'](_0x4c103c)[_0x6f29('0x22')](function(_0x3fc132){_0x208d63[_0x6f29('0x1a')]=_0x3fc132;if(_0x5b57a3[_0x6f29('0x33')]['includeAll']){_0xb321a0['include']=[{'all':!![]}];}return db[_0x6f29('0x2d')][_0x6f29('0x45')](_0xb321a0);})[_0x6f29('0x22')](function(_0x3a3f7b){_0x208d63[_0x6f29('0x46')]=_0x3a3f7b;return _0x208d63;})[_0x6f29('0x22')](respondWithFilteredResult(_0x2ed762,_0xb321a0))['catch'](handleError(_0x2ed762,null));};exports[_0x6f29('0x47')]=function(_0xcede83,_0x57e3fa){var _0x419271={'raw':![],'where':{'id':_0xcede83[_0x6f29('0x48')]['id']}},_0x38e916={};_0x38e916[_0x6f29('0x36')]=_[_0x6f29('0x32')](db[_0x6f29('0x2d')][_0x6f29('0x2e')]);_0x38e916[_0x6f29('0x33')]=_[_0x6f29('0x32')](_0xcede83[_0x6f29('0x33')]);_0x38e916[_0x6f29('0x34')]=_[_0x6f29('0x35')](_0x38e916[_0x6f29('0x36')],_0x38e916[_0x6f29('0x33')]);_0x419271['attributes']=_[_0x6f29('0x35')](_0x38e916[_0x6f29('0x36')],qs['fields'](_0xcede83[_0x6f29('0x33')][_0x6f29('0x38')]));_0x419271[_0x6f29('0x37')]=_0x419271['attributes'][_0x6f29('0x39')]?_0x419271[_0x6f29('0x37')]:_0x38e916['model'];if(_0xcede83[_0x6f29('0x33')][_0x6f29('0x49')]){_0x419271[_0x6f29('0x4a')]=[{'all':!![]}];}_0x419271=_[_0x6f29('0x43')]({},_0x419271,_0xcede83[_0x6f29('0x44')]);return db[_0x6f29('0x2d')][_0x6f29('0x4b')](_0x419271)[_0x6f29('0x22')](handleEntityNotFound(_0x57e3fa,null))['then'](respondWithResult(_0x57e3fa,null))[_0x6f29('0x4c')](handleError(_0x57e3fa,null));};exports[_0x6f29('0x4d')]=function(_0x1042c9,_0x2e665f){return db[_0x6f29('0x2d')]['create'](_0x1042c9[_0x6f29('0x4e')],{})[_0x6f29('0x22')](function(_0x80052c){var _0x37d544=_0x1042c9['user'][_0x6f29('0x4f')]({'plain':!![]});if(!_0x37d544)throw new Error(_0x6f29('0x50'));if(_0x37d544[_0x6f29('0x51')]===_0x6f29('0x52')){var _0x58f431=_0x80052c[_0x6f29('0x4f')]({'plain':!![]});var _0x349ca0=_0x6f29('0x53');return db[_0x6f29('0x54')]['find']({'where':{'name':_0x349ca0,'userProfileId':_0x37d544['userProfileId']},'raw':!![]})[_0x6f29('0x22')](function(_0x117ffb){if(_0x117ffb&&_0x117ffb[_0x6f29('0x55')]===0x0){return db[_0x6f29('0x24')][_0x6f29('0x4d')]({'name':_0x58f431[_0x6f29('0x29')],'resourceId':_0x58f431['id'],'type':_0x117ffb[_0x6f29('0x29')],'sectionId':_0x117ffb['id']},{})[_0x6f29('0x22')](function(){return _0x80052c;});}else{return _0x80052c;}})[_0x6f29('0x4c')](function(_0x2ffd50){logger['error'](_0x6f29('0x56'),_0x2ffd50);throw _0x2ffd50;});}return _0x80052c;})[_0x6f29('0x22')](respondWithResult(_0x2e665f,0xc9))['catch'](handleError(_0x2e665f,null));};exports['clone']=function(_0x1f57fe,_0x397a03){var _0x5e70f1={'where':{'id':_0x1f57fe[_0x6f29('0x48')]['id']}},_0x9f4c47={};_0x9f4c47[_0x6f29('0x36')]=_['keys'](db[_0x6f29('0x2d')][_0x6f29('0x2e')]);_0x5e70f1[_0x6f29('0x37')]=_[_0x6f29('0x35')](_0x9f4c47[_0x6f29('0x36')],qs[_0x6f29('0x38')](_0x1f57fe['query'][_0x6f29('0x38')]));_0x5e70f1[_0x6f29('0x37')]=_0x5e70f1[_0x6f29('0x37')][_0x6f29('0x39')]?_0x5e70f1['attributes']:_0x9f4c47[_0x6f29('0x36')];if(_0x1f57fe[_0x6f29('0x33')][_0x6f29('0x49')]){_0x5e70f1[_0x6f29('0x4a')]=[{'all':!![]}];}_0x5e70f1=_['merge']({},_0x5e70f1,_0x1f57fe[_0x6f29('0x44')]);return db[_0x6f29('0x2d')][_0x6f29('0x4b')](_0x5e70f1)[_0x6f29('0x22')](handleEntityNotFound(_0x397a03,null))[_0x6f29('0x22')](function(_0x28ca50){if(_0x28ca50){var _0x22cb93=_0x28ca50[_0x6f29('0x4f')]({'plain':!![]});_0x22cb93=qs[_0x6f29('0x57')](_0x22cb93,['id',_0x6f29('0x58'),'updatedAt']);_0x1f57fe[_0x6f29('0x4e')]=_[_0x6f29('0x57')](_0x1f57fe[_0x6f29('0x4e')],['id',_0x6f29('0x58'),_0x6f29('0x59')]);return db[_0x6f29('0x2d')]['create'](_[_0x6f29('0x43')](_0x22cb93,_0x1f57fe[_0x6f29('0x4e')]),{'include':_0x1f57fe[_0x6f29('0x33')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x197ec2){var _0x90e071=_0x1f57fe[_0x6f29('0x52')][_0x6f29('0x4f')]({'plain':!![]});if(!_0x90e071)throw new Error(_0x6f29('0x50'));if(_0x90e071['role']===_0x6f29('0x52')){var _0x164b60=_0x197ec2[_0x6f29('0x4f')]({'plain':!![]});var _0x4b97f5=_0x6f29('0x53');return db[_0x6f29('0x54')][_0x6f29('0x4b')]({'where':{'name':_0x4b97f5,'userProfileId':_0x90e071[_0x6f29('0x5a')]},'raw':!![]})[_0x6f29('0x22')](function(_0x15afd6){if(_0x15afd6&&_0x15afd6[_0x6f29('0x55')]===0x0){return db[_0x6f29('0x24')]['create']({'name':_0x164b60[_0x6f29('0x29')],'resourceId':_0x164b60['id'],'type':_0x15afd6[_0x6f29('0x29')],'sectionId':_0x15afd6['id']},{})[_0x6f29('0x22')](function(){return _0x197ec2;});}else{return _0x197ec2;}})['catch'](function(_0x580f8e){logger['error'](_0x6f29('0x56'),_0x580f8e);throw _0x580f8e;});}return _0x197ec2;});}})[_0x6f29('0x22')](respondWithResult(_0x397a03,0xc9))[_0x6f29('0x4c')](handleError(_0x397a03,null));};exports['update']=function(_0xe138d9,_0x1c555f){if(_0xe138d9[_0x6f29('0x4e')]['id']){delete _0xe138d9[_0x6f29('0x4e')]['id'];}return db[_0x6f29('0x2d')][_0x6f29('0x4b')]({'where':{'id':_0xe138d9[_0x6f29('0x48')]['id']}})[_0x6f29('0x22')](handleEntityNotFound(_0x1c555f,null))[_0x6f29('0x22')](saveUpdates(_0xe138d9[_0x6f29('0x4e')],null))['then'](respondWithResult(_0x1c555f,null))[_0x6f29('0x4c')](handleError(_0x1c555f,null));};exports['destroy']=function(_0x2b2766,_0x43d5a4){return db[_0x6f29('0x2d')]['find']({'where':{'id':_0x2b2766[_0x6f29('0x48')]['id']}})[_0x6f29('0x22')](handleEntityNotFound(_0x43d5a4,null))[_0x6f29('0x22')](removeEntity(_0x43d5a4,null))[_0x6f29('0x4c')](handleError(_0x43d5a4,null));};function widgetAttributes(_0x3f84a7){try{switch(_0x3f84a7['type']){case _0x6f29('0x5b'):return[{'name':_0x6f29('0x5c'),'value':_0x3f84a7[_0x6f29('0x5c')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x0]?_0x3f84a7[_0x6f29('0x5d')][0x0][_0x6f29('0x5e')]:undefined)||_0x6f29('0x5f')}];case _0x6f29('0x60'):return[{'name':_0x6f29('0x61'),'value':_0x3f84a7[_0x6f29('0x61')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x0]?_0x3f84a7[_0x6f29('0x5d')][0x0]['value']:undefined)||''}];case _0x6f29('0x62'):return[{'name':_0x6f29('0x63'),'value':_0x3f84a7[_0x6f29('0x63')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x0]?_0x3f84a7[_0x6f29('0x5d')][0x0][_0x6f29('0x5e')]:undefined)||'HH:mm:ss'},{'name':_0x6f29('0x64'),'value':_0x3f84a7[_0x6f29('0x64')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x1]?_0x3f84a7[_0x6f29('0x5d')][0x1][_0x6f29('0x5e')]:undefined)||_0x6f29('0x65')},{'name':_0x6f29('0x66'),'value':_0x3f84a7[_0x6f29('0x66')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x2]?_0x3f84a7[_0x6f29('0x5d')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x3f84a7[_0x6f29('0x67')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7['attrs'][0x0]?_0x3f84a7[_0x6f29('0x5d')][0x0][_0x6f29('0x5e')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x3f84a7[_0x6f29('0x68')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x1]?_0x3f84a7[_0x6f29('0x5d')][0x1][_0x6f29('0x5e')]:undefined)||[]},{'name':_0x6f29('0x66'),'value':_0x3f84a7[_0x6f29('0x66')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x2]?_0x3f84a7[_0x6f29('0x5d')][0x2][_0x6f29('0x5e')]:undefined)||0x14}];case _0x6f29('0x69'):case _0x6f29('0x6a'):return[{'name':_0x6f29('0x6b'),'value':_0x3f84a7[_0x6f29('0x6b')]||(_0x3f84a7['attrs']&&_0x3f84a7[_0x6f29('0x5d')][0x0]?_0x3f84a7[_0x6f29('0x5d')][0x0][_0x6f29('0x5e')]:undefined)||_0x6f29('0x6c')},{'name':_0x6f29('0x6d'),'value':_0x3f84a7['attrSerie2']||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x1]?_0x3f84a7[_0x6f29('0x5d')][0x1][_0x6f29('0x5e')]:undefined)||null},{'name':_0x6f29('0x6e'),'value':_0x3f84a7[_0x6f29('0x6e')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x2]?_0x3f84a7[_0x6f29('0x5d')][0x2][_0x6f29('0x5e')]:undefined)||null},{'name':_0x6f29('0x68'),'value':_0x3f84a7[_0x6f29('0x68')]||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7[_0x6f29('0x5d')][0x3]?_0x3f84a7['attrs'][0x3]['value']:undefined)||[]}];case _0x6f29('0x6f'):return[{'name':'attrReport','type':_0x3f84a7['reportType']||(_0x3f84a7['attrs']&&_0x3f84a7[_0x6f29('0x5d')][0x0]?_0x3f84a7[_0x6f29('0x5d')][0x0][_0x6f29('0x30')]:undefined)||null,'value':_0x3f84a7['attrReport']||(_0x3f84a7[_0x6f29('0x5d')]&&_0x3f84a7['attrs'][0x0]?_0x3f84a7[_0x6f29('0x5d')][0x0][_0x6f29('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x3f84a7[_0x6f29('0x70')]||(_0x3f84a7['attrs']&&_0x3f84a7[_0x6f29('0x5d')][0x1]?_0x3f84a7[_0x6f29('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2082a2){logger[_0x6f29('0x27')](_0x6f29('0x71'),JSON[_0x6f29('0x72')](_0x2082a2));return[];}}exports[_0x6f29('0x73')]=function(_0x528478,_0x1c706b,_0x4d0c6c){if(_0x528478[_0x6f29('0x4e')]['id']){delete _0x528478[_0x6f29('0x4e')]['id'];}return db[_0x6f29('0x2d')]['find']({'where':{'id':_0x528478[_0x6f29('0x48')]['id']}})[_0x6f29('0x22')](handleEntityNotFound(_0x1c706b,null))[_0x6f29('0x22')](function(_0x4eac87){if(_0x4eac87){_0x528478[_0x6f29('0x4e')]['DashboardId']=_0x4eac87['id'];_0x528478[_0x6f29('0x4e')][_0x6f29('0x5d')]=widgetAttributes(_0x528478[_0x6f29('0x4e')]);return db['DashboardItem'][_0x6f29('0x4d')](_0x528478[_0x6f29('0x4e')]);}})['then'](respondWithResult(_0x1c706b,null))['catch'](handleError(_0x1c706b,null));};exports[_0x6f29('0x74')]=function(_0x23b4a4,_0x3bb315,_0x16e581){var _0x583211={};var _0x1f2fc9={};var _0x5b47be;var _0x380a24;return db['Dashboard'][_0x6f29('0x75')]({'where':{'id':_0x23b4a4[_0x6f29('0x48')]['id']}})['then'](handleEntityNotFound(_0x3bb315,null))[_0x6f29('0x22')](function(_0x48c3f8){if(_0x48c3f8){_0x5b47be=_0x48c3f8;_0x1f2fc9[_0x6f29('0x36')]=_['keys'](db['DashboardItem'][_0x6f29('0x2e')]);_0x1f2fc9[_0x6f29('0x33')]=_[_0x6f29('0x32')](_0x23b4a4[_0x6f29('0x33')]);_0x1f2fc9['filters']=_['intersection'](_0x1f2fc9['model'],_0x1f2fc9[_0x6f29('0x33')]);_0x583211[_0x6f29('0x37')]=_['intersection'](_0x1f2fc9['model'],qs[_0x6f29('0x38')](_0x23b4a4['query'][_0x6f29('0x38')]));_0x583211['attributes']=_0x583211[_0x6f29('0x37')][_0x6f29('0x39')]?_0x583211[_0x6f29('0x37')]:_0x1f2fc9[_0x6f29('0x36')];_0x583211[_0x6f29('0x3d')]=qs[_0x6f29('0x3e')](_0x23b4a4['query']['sort']);_0x583211[_0x6f29('0x3f')]=qs[_0x6f29('0x34')](_[_0x6f29('0x40')](_0x23b4a4[_0x6f29('0x33')],_0x1f2fc9['filters']));if(_0x23b4a4['query'][_0x6f29('0x41')]){_0x583211[_0x6f29('0x3f')]=_[_0x6f29('0x43')](_0x583211[_0x6f29('0x3f')],{'$or':_[_0x6f29('0x2c')](_0x583211[_0x6f29('0x37')],function(_0x2d9572){var _0x45dce2={};_0x45dce2[_0x2d9572]={'$like':'%'+_0x23b4a4[_0x6f29('0x33')][_0x6f29('0x41')]+'%'};return _0x45dce2;})});}_0x583211=_[_0x6f29('0x43')]({},_0x583211,_0x23b4a4[_0x6f29('0x44')]);return _0x5b47be['getItems'](_0x583211);}})[_0x6f29('0x22')](function(_0x23797d){if(_0x23797d){_0x380a24=_0x23797d[_0x6f29('0x39')];if(!_0x23b4a4['query']['hasOwnProperty'](_0x6f29('0x3b'))){_0x583211[_0x6f29('0x3c')]=qs[_0x6f29('0x3c')](_0x23b4a4[_0x6f29('0x33')][_0x6f29('0x3c')]);_0x583211['offset']=qs[_0x6f29('0x1b')](_0x23b4a4[_0x6f29('0x33')][_0x6f29('0x1b')]);}return _0x5b47be['getItems'](_0x583211);}})['then'](function(_0x2ae7c2){if(_0x2ae7c2){return _0x2ae7c2?{'count':_0x380a24,'rows':_0x2ae7c2}:null;}})[_0x6f29('0x22')](respondWithResult(_0x3bb315,null))['catch'](handleError(_0x3bb315,null));}; \ No newline at end of file +var _0x4242=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','rows','catch','show','params','includeAll','include','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','clone','createdAt','updatedAt','attrUrl','attrs','https://','custom','attrPath','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','defaults','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','limit','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','stack','name','send','index','map','Dashboard','rawAttributes','type'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x4242,0xb5));var _0x2424=function(_0x1a04ea,_0x3147f1){_0x1a04ea=_0x1a04ea-0x0;var _0x26c973=_0x4242[_0x1a04ea];return _0x26c973;};'use strict';var pdf=require(_0x2424('0x0'));var emlformat=require(_0x2424('0x1'));var rimraf=require(_0x2424('0x2'));var zipdir=require(_0x2424('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2424('0x4'));var BPromise=require(_0x2424('0x5'));var Mustache=require(_0x2424('0x6'));var util=require('util');var path=require(_0x2424('0x7'));var sox=require(_0x2424('0x8'));var csv=require(_0x2424('0x9'));var ejs=require(_0x2424('0xa'));var fs=require('fs');var _=require(_0x2424('0xb'));var squel=require('squel');var crypto=require(_0x2424('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2424('0x9'));var querystring=require(_0x2424('0xd'));var Papa=require(_0x2424('0xe'));var Redis=require('ioredis');var authService=require(_0x2424('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2424('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2424('0x11'))(_0x2424('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2424('0x13'))['db'];config['redis']=_[_0x2424('0x14')](config[_0x2424('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x2424('0x16'))(new Redis(config[_0x2424('0x15')]));require(_0x2424('0x17'))[_0x2424('0x18')](socket);function respondWithStatusCode(_0x6cbc4d,_0x28d9eb){_0x28d9eb=_0x28d9eb||0xcc;return function(_0x4ac440){if(_0x4ac440){return _0x6cbc4d[_0x2424('0x19')](_0x28d9eb);}return _0x6cbc4d['status'](_0x28d9eb)['end']();};}function respondWithResult(_0x5b1ed9,_0x9798ad){_0x9798ad=_0x9798ad||0xc8;return function(_0x55d57f){if(_0x55d57f){return _0x5b1ed9[_0x2424('0x1a')](_0x9798ad)[_0x2424('0x1b')](_0x55d57f);}};}function respondWithFilteredResult(_0x137215,_0x363a15){return function(_0x153d7b){if(_0x153d7b){var _0x26a9ce=_0x153d7b['count'],_0x540c7a=_0x363a15[_0x2424('0x1c')],_0x2becd7=_0x363a15[_0x2424('0x1c')]+_0x363a15[_0x2424('0x1d')],_0x5a763c;if(_0x2becd7>=_0x26a9ce){_0x2becd7=_0x26a9ce;_0x5a763c=0xc8;}else{_0x5a763c=0xce;}_0x137215[_0x2424('0x1a')](_0x5a763c);return _0x137215['set']('Content-Range',_0x540c7a+'-'+_0x2becd7+'/'+_0x26a9ce)[_0x2424('0x1b')](_0x153d7b);}return null;};}function patchUpdates(_0x5468e1){return function(_0x1af292){try{jsonpatch[_0x2424('0x1e')](_0x1af292,_0x5468e1,!![]);}catch(_0x1e4239){return BPromise[_0x2424('0x1f')](_0x1e4239);}return _0x1af292[_0x2424('0x20')]();};}function saveUpdates(_0x176a05,_0x4e7f2d){return function(_0x2b14fb){if(_0x2b14fb){return _0x2b14fb[_0x2424('0x21')](_0x176a05)[_0x2424('0x22')](function(_0x6de5a0){return _0x6de5a0;});}return null;};}function removeEntity(_0x155d6f,_0x4787cc){return function(_0x4ff014){if(_0x4ff014){return _0x4ff014[_0x2424('0x23')]()[_0x2424('0x22')](function(){var _0x1cf5fd=_0x4ff014[_0x2424('0x24')]({'plain':!![]});var _0x45470e=_0x2424('0x25');return db[_0x2424('0x26')][_0x2424('0x23')]({'where':{'type':_0x45470e,'resourceId':_0x1cf5fd['id']}})[_0x2424('0x22')](function(){return _0x4ff014;});})[_0x2424('0x22')](function(){_0x155d6f[_0x2424('0x1a')](0xcc)[_0x2424('0x27')]();});}};}function handleEntityNotFound(_0x32914c,_0x3c32a5){return function(_0x24fe86){if(!_0x24fe86){_0x32914c[_0x2424('0x19')](0x194);}return _0x24fe86;};}function handleError(_0x21e87e,_0x4e5770){_0x4e5770=_0x4e5770||0x1f4;return function(_0x5ba1e4){logger[_0x2424('0x28')](_0x5ba1e4[_0x2424('0x29')]);if(_0x5ba1e4[_0x2424('0x2a')]){delete _0x5ba1e4['name'];}_0x21e87e[_0x2424('0x1a')](_0x4e5770)[_0x2424('0x2b')](_0x5ba1e4);};}exports[_0x2424('0x2c')]=function(_0xc0bec2,_0x41c9d1){var _0x355f8c={},_0x4f5318={},_0xc88f0={'count':0x0,'rows':[]};var _0x1dfdb2=_[_0x2424('0x2d')](db[_0x2424('0x2e')][_0x2424('0x2f')],function(_0x2e685a){return{'name':_0x2e685a['fieldName'],'type':_0x2e685a[_0x2424('0x30')][_0x2424('0x31')]};});_0x4f5318[_0x2424('0x32')]=_[_0x2424('0x2d')](_0x1dfdb2,_0x2424('0x2a'));_0x4f5318[_0x2424('0x33')]=_[_0x2424('0x34')](_0xc0bec2[_0x2424('0x33')]);_0x4f5318[_0x2424('0x35')]=_[_0x2424('0x36')](_0x4f5318[_0x2424('0x32')],_0x4f5318[_0x2424('0x33')]);_0x355f8c[_0x2424('0x37')]=_[_0x2424('0x36')](_0x4f5318[_0x2424('0x32')],qs[_0x2424('0x38')](_0xc0bec2[_0x2424('0x33')][_0x2424('0x38')]));_0x355f8c[_0x2424('0x37')]=_0x355f8c['attributes'][_0x2424('0x39')]?_0x355f8c[_0x2424('0x37')]:_0x4f5318[_0x2424('0x32')];if(!_0xc0bec2[_0x2424('0x33')][_0x2424('0x3a')](_0x2424('0x3b'))){_0x355f8c[_0x2424('0x1d')]=qs['limit'](_0xc0bec2[_0x2424('0x33')][_0x2424('0x1d')]);_0x355f8c[_0x2424('0x1c')]=qs[_0x2424('0x1c')](_0xc0bec2[_0x2424('0x33')][_0x2424('0x1c')]);}_0x355f8c[_0x2424('0x3c')]=qs[_0x2424('0x3d')](_0xc0bec2['query'][_0x2424('0x3d')]);_0x355f8c[_0x2424('0x3e')]=qs[_0x2424('0x35')](_[_0x2424('0x3f')](_0xc0bec2[_0x2424('0x33')],_0x4f5318['filters']));if(_0xc0bec2[_0x2424('0x33')][_0x2424('0x40')]){_0x355f8c['where']=_[_0x2424('0x41')](_0x355f8c[_0x2424('0x3e')],{'$or':_[_0x2424('0x2d')](_0x1dfdb2,function(_0x25d11d){if(_0x25d11d[_0x2424('0x30')]!==_0x2424('0x42')){var _0x214a04={};_0x214a04[_0x25d11d['name']]={'$like':'%'+_0xc0bec2[_0x2424('0x33')][_0x2424('0x40')]+'%'};return _0x214a04;}})});}_0x355f8c=_['merge']({},_0x355f8c,_0xc0bec2[_0x2424('0x43')]);var _0x2a8eaa={'where':_0x355f8c['where']};return db[_0x2424('0x2e')][_0x2424('0x44')](_0x2a8eaa)[_0x2424('0x22')](function(_0x400316){_0xc88f0['count']=_0x400316;if(_0xc0bec2[_0x2424('0x33')]['includeAll']){_0x355f8c['include']=[{'all':!![]}];}return db[_0x2424('0x2e')]['findAll'](_0x355f8c);})[_0x2424('0x22')](function(_0x48f24e){_0xc88f0[_0x2424('0x45')]=_0x48f24e;return _0xc88f0;})[_0x2424('0x22')](respondWithFilteredResult(_0x41c9d1,_0x355f8c))[_0x2424('0x46')](handleError(_0x41c9d1,null));};exports[_0x2424('0x47')]=function(_0x592fef,_0x50cbad){var _0xe497e9={'raw':![],'where':{'id':_0x592fef[_0x2424('0x48')]['id']}},_0xa07200={};_0xa07200[_0x2424('0x32')]=_[_0x2424('0x34')](db[_0x2424('0x2e')][_0x2424('0x2f')]);_0xa07200[_0x2424('0x33')]=_[_0x2424('0x34')](_0x592fef[_0x2424('0x33')]);_0xa07200['filters']=_[_0x2424('0x36')](_0xa07200[_0x2424('0x32')],_0xa07200[_0x2424('0x33')]);_0xe497e9[_0x2424('0x37')]=_[_0x2424('0x36')](_0xa07200[_0x2424('0x32')],qs['fields'](_0x592fef[_0x2424('0x33')][_0x2424('0x38')]));_0xe497e9[_0x2424('0x37')]=_0xe497e9[_0x2424('0x37')][_0x2424('0x39')]?_0xe497e9['attributes']:_0xa07200[_0x2424('0x32')];if(_0x592fef[_0x2424('0x33')][_0x2424('0x49')]){_0xe497e9[_0x2424('0x4a')]=[{'all':!![]}];}_0xe497e9=_[_0x2424('0x41')]({},_0xe497e9,_0x592fef[_0x2424('0x43')]);return db['Dashboard'][_0x2424('0x4b')](_0xe497e9)['then'](handleEntityNotFound(_0x50cbad,null))['then'](respondWithResult(_0x50cbad,null))[_0x2424('0x46')](handleError(_0x50cbad,null));};exports[_0x2424('0x4c')]=function(_0x117b24,_0x375d8a){return db[_0x2424('0x2e')]['create'](_0x117b24[_0x2424('0x4d')],{})[_0x2424('0x22')](function(_0x29cf75){var _0x16efe3=_0x117b24[_0x2424('0x4e')][_0x2424('0x24')]({'plain':!![]});if(!_0x16efe3)throw new Error(_0x2424('0x4f'));if(_0x16efe3[_0x2424('0x50')]===_0x2424('0x4e')){var _0x8c09c=_0x29cf75[_0x2424('0x24')]({'plain':!![]});var _0x2314b5='CustomDashboards';return db[_0x2424('0x51')]['find']({'where':{'name':_0x2314b5,'userProfileId':_0x16efe3[_0x2424('0x52')]},'raw':!![]})[_0x2424('0x22')](function(_0x509444){if(_0x509444&&_0x509444[_0x2424('0x53')]===0x0){return db[_0x2424('0x26')][_0x2424('0x4c')]({'name':_0x8c09c[_0x2424('0x2a')],'resourceId':_0x8c09c['id'],'type':_0x509444[_0x2424('0x2a')],'sectionId':_0x509444['id']},{})[_0x2424('0x22')](function(){return _0x29cf75;});}else{return _0x29cf75;}})[_0x2424('0x46')](function(_0x1563e4){logger[_0x2424('0x28')](_0x2424('0x54'),_0x1563e4);throw _0x1563e4;});}return _0x29cf75;})['then'](respondWithResult(_0x375d8a,0xc9))['catch'](handleError(_0x375d8a,null));};exports[_0x2424('0x55')]=function(_0x17cc8b,_0x22b37e){var _0x3e7017={'where':{'id':_0x17cc8b[_0x2424('0x48')]['id']}},_0x27f46f={};_0x27f46f[_0x2424('0x32')]=_[_0x2424('0x34')](db[_0x2424('0x2e')][_0x2424('0x2f')]);_0x3e7017[_0x2424('0x37')]=_[_0x2424('0x36')](_0x27f46f[_0x2424('0x32')],qs[_0x2424('0x38')](_0x17cc8b[_0x2424('0x33')][_0x2424('0x38')]));_0x3e7017[_0x2424('0x37')]=_0x3e7017['attributes'][_0x2424('0x39')]?_0x3e7017[_0x2424('0x37')]:_0x27f46f['model'];if(_0x17cc8b[_0x2424('0x33')]['includeAll']){_0x3e7017[_0x2424('0x4a')]=[{'all':!![]}];}_0x3e7017=_[_0x2424('0x41')]({},_0x3e7017,_0x17cc8b['options']);return db['Dashboard'][_0x2424('0x4b')](_0x3e7017)['then'](handleEntityNotFound(_0x22b37e,null))['then'](function(_0x47e1ec){if(_0x47e1ec){var _0x4201b6=_0x47e1ec[_0x2424('0x24')]({'plain':!![]});_0x4201b6=qs['omit'](_0x4201b6,['id',_0x2424('0x56'),_0x2424('0x57')]);_0x17cc8b[_0x2424('0x4d')]=_['omit'](_0x17cc8b[_0x2424('0x4d')],['id',_0x2424('0x56'),_0x2424('0x57')]);return db['Dashboard'][_0x2424('0x4c')](_['merge'](_0x4201b6,_0x17cc8b[_0x2424('0x4d')]),{'include':_0x17cc8b[_0x2424('0x33')][_0x2424('0x49')]?[{'all':!![]}]:undefined})[_0x2424('0x22')](function(_0x49b040){var _0x5a7bd6=_0x17cc8b[_0x2424('0x4e')]['get']({'plain':!![]});if(!_0x5a7bd6)throw new Error(_0x2424('0x4f'));if(_0x5a7bd6[_0x2424('0x50')]==='user'){var _0x4a7328=_0x49b040[_0x2424('0x24')]({'plain':!![]});var _0x2efd52=_0x2424('0x25');return db[_0x2424('0x51')][_0x2424('0x4b')]({'where':{'name':_0x2efd52,'userProfileId':_0x5a7bd6[_0x2424('0x52')]},'raw':!![]})[_0x2424('0x22')](function(_0xca0996){if(_0xca0996&&_0xca0996[_0x2424('0x53')]===0x0){return db['UserProfileResource'][_0x2424('0x4c')]({'name':_0x4a7328[_0x2424('0x2a')],'resourceId':_0x4a7328['id'],'type':_0xca0996[_0x2424('0x2a')],'sectionId':_0xca0996['id']},{})['then'](function(){return _0x49b040;});}else{return _0x49b040;}})[_0x2424('0x46')](function(_0x3a8382){logger[_0x2424('0x28')](_0x2424('0x54'),_0x3a8382);throw _0x3a8382;});}return _0x49b040;});}})['then'](respondWithResult(_0x22b37e,0xc9))[_0x2424('0x46')](handleError(_0x22b37e,null));};exports[_0x2424('0x21')]=function(_0x54b0c5,_0x59fced){if(_0x54b0c5['body']['id']){delete _0x54b0c5[_0x2424('0x4d')]['id'];}return db[_0x2424('0x2e')][_0x2424('0x4b')]({'where':{'id':_0x54b0c5[_0x2424('0x48')]['id']}})[_0x2424('0x22')](handleEntityNotFound(_0x59fced,null))[_0x2424('0x22')](saveUpdates(_0x54b0c5[_0x2424('0x4d')],null))['then'](respondWithResult(_0x59fced,null))[_0x2424('0x46')](handleError(_0x59fced,null));};exports[_0x2424('0x23')]=function(_0x43484b,_0x3d640a){return db[_0x2424('0x2e')][_0x2424('0x4b')]({'where':{'id':_0x43484b[_0x2424('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d640a,null))[_0x2424('0x22')](removeEntity(_0x3d640a,null))[_0x2424('0x46')](handleError(_0x3d640a,null));};function widgetAttributes(_0x1c1ce6){try{switch(_0x1c1ce6[_0x2424('0x30')]){case'iframe':return[{'name':_0x2424('0x58'),'value':_0x1c1ce6[_0x2424('0x58')]||(_0x1c1ce6[_0x2424('0x59')]&&_0x1c1ce6[_0x2424('0x59')][0x0]?_0x1c1ce6[_0x2424('0x59')][0x0]['value']:undefined)||_0x2424('0x5a')}];case _0x2424('0x5b'):return[{'name':_0x2424('0x5c'),'value':_0x1c1ce6['attrPath']||(_0x1c1ce6[_0x2424('0x59')]&&_0x1c1ce6['attrs'][0x0]?_0x1c1ce6[_0x2424('0x59')][0x0][_0x2424('0x5d')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x1c1ce6['attrHourFormat']||(_0x1c1ce6['attrs']&&_0x1c1ce6[_0x2424('0x59')][0x0]?_0x1c1ce6[_0x2424('0x59')][0x0][_0x2424('0x5d')]:undefined)||_0x2424('0x5e')},{'name':_0x2424('0x5f'),'value':_0x1c1ce6['attrTimezone']||(_0x1c1ce6[_0x2424('0x59')]&&_0x1c1ce6['attrs'][0x1]?_0x1c1ce6[_0x2424('0x59')][0x1][_0x2424('0x5d')]:undefined)||_0x2424('0x60')},{'name':_0x2424('0x61'),'value':_0x1c1ce6['attrFontSize']||(_0x1c1ce6['attrs']&&_0x1c1ce6[_0x2424('0x59')][0x2]?_0x1c1ce6[_0x2424('0x59')][0x2][_0x2424('0x5d')]:undefined)||0xc}];case _0x2424('0x62'):return[{'name':_0x2424('0x63'),'value':_0x1c1ce6['attrMetric']||(_0x1c1ce6['attrs']&&_0x1c1ce6['attrs'][0x0]?_0x1c1ce6[_0x2424('0x59')][0x0][_0x2424('0x5d')]:undefined)||_0x2424('0x64')},{'name':_0x2424('0x65'),'value':_0x1c1ce6[_0x2424('0x65')]||(_0x1c1ce6[_0x2424('0x59')]&&_0x1c1ce6['attrs'][0x1]?_0x1c1ce6['attrs'][0x1]['value']:undefined)||[]},{'name':_0x2424('0x61'),'value':_0x1c1ce6[_0x2424('0x61')]||(_0x1c1ce6['attrs']&&_0x1c1ce6[_0x2424('0x59')][0x2]?_0x1c1ce6[_0x2424('0x59')][0x2][_0x2424('0x5d')]:undefined)||0x14}];case _0x2424('0x66'):case _0x2424('0x67'):return[{'name':_0x2424('0x68'),'value':_0x1c1ce6['attrSerie1']||(_0x1c1ce6[_0x2424('0x59')]&&_0x1c1ce6['attrs'][0x0]?_0x1c1ce6[_0x2424('0x59')][0x0][_0x2424('0x5d')]:undefined)||_0x2424('0x64')},{'name':'attrSerie2','value':_0x1c1ce6['attrSerie2']||(_0x1c1ce6['attrs']&&_0x1c1ce6[_0x2424('0x59')][0x1]?_0x1c1ce6[_0x2424('0x59')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x1c1ce6['attrSerie3']||(_0x1c1ce6[_0x2424('0x59')]&&_0x1c1ce6[_0x2424('0x59')][0x2]?_0x1c1ce6['attrs'][0x2][_0x2424('0x5d')]:undefined)||null},{'name':_0x2424('0x65'),'value':_0x1c1ce6[_0x2424('0x65')]||(_0x1c1ce6[_0x2424('0x59')]&&_0x1c1ce6[_0x2424('0x59')][0x3]?_0x1c1ce6['attrs'][0x3][_0x2424('0x5d')]:undefined)||[]}];case _0x2424('0x69'):return[{'name':_0x2424('0x6a'),'type':_0x1c1ce6[_0x2424('0x6b')]||(_0x1c1ce6[_0x2424('0x59')]&&_0x1c1ce6[_0x2424('0x59')][0x0]?_0x1c1ce6[_0x2424('0x59')][0x0][_0x2424('0x30')]:undefined)||null,'value':_0x1c1ce6[_0x2424('0x6a')]||(_0x1c1ce6['attrs']&&_0x1c1ce6[_0x2424('0x59')][0x0]?_0x1c1ce6[_0x2424('0x59')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x1c1ce6['attrRefresh']||(_0x1c1ce6[_0x2424('0x59')]&&_0x1c1ce6['attrs'][0x1]?_0x1c1ce6[_0x2424('0x59')][0x1][_0x2424('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x5c7023){logger['error'](_0x2424('0x6c'),JSON[_0x2424('0x6d')](_0x5c7023));return[];}}exports[_0x2424('0x6e')]=function(_0x3f6d9d,_0x40fd41,_0x13b7de){if(_0x3f6d9d[_0x2424('0x4d')]['id']){delete _0x3f6d9d['body']['id'];}return db['Dashboard'][_0x2424('0x4b')]({'where':{'id':_0x3f6d9d[_0x2424('0x48')]['id']}})['then'](handleEntityNotFound(_0x40fd41,null))['then'](function(_0x37a08c){if(_0x37a08c){_0x3f6d9d[_0x2424('0x4d')][_0x2424('0x6f')]=_0x37a08c['id'];_0x3f6d9d[_0x2424('0x4d')][_0x2424('0x59')]=widgetAttributes(_0x3f6d9d[_0x2424('0x4d')]);return db['DashboardItem'][_0x2424('0x4c')](_0x3f6d9d[_0x2424('0x4d')]);}})[_0x2424('0x22')](respondWithResult(_0x40fd41,null))['catch'](handleError(_0x40fd41,null));};exports[_0x2424('0x70')]=function(_0x329ff1,_0xe2b526,_0x30a56c){var _0x4864fe={};var _0x4f4891={};var _0x523e65;var _0x2bde68;return db[_0x2424('0x2e')][_0x2424('0x71')]({'where':{'id':_0x329ff1[_0x2424('0x48')]['id']}})['then'](handleEntityNotFound(_0xe2b526,null))['then'](function(_0x5bfb98){if(_0x5bfb98){_0x523e65=_0x5bfb98;_0x4f4891[_0x2424('0x32')]=_[_0x2424('0x34')](db[_0x2424('0x72')][_0x2424('0x2f')]);_0x4f4891[_0x2424('0x33')]=_[_0x2424('0x34')](_0x329ff1[_0x2424('0x33')]);_0x4f4891[_0x2424('0x35')]=_[_0x2424('0x36')](_0x4f4891[_0x2424('0x32')],_0x4f4891[_0x2424('0x33')]);_0x4864fe['attributes']=_[_0x2424('0x36')](_0x4f4891[_0x2424('0x32')],qs[_0x2424('0x38')](_0x329ff1['query'][_0x2424('0x38')]));_0x4864fe[_0x2424('0x37')]=_0x4864fe['attributes']['length']?_0x4864fe[_0x2424('0x37')]:_0x4f4891['model'];_0x4864fe['order']=qs[_0x2424('0x3d')](_0x329ff1['query'][_0x2424('0x3d')]);_0x4864fe[_0x2424('0x3e')]=qs['filters'](_[_0x2424('0x3f')](_0x329ff1[_0x2424('0x33')],_0x4f4891[_0x2424('0x35')]));if(_0x329ff1[_0x2424('0x33')][_0x2424('0x40')]){_0x4864fe[_0x2424('0x3e')]=_['merge'](_0x4864fe[_0x2424('0x3e')],{'$or':_[_0x2424('0x2d')](_0x4864fe[_0x2424('0x37')],function(_0x521a84){var _0x3cf9dc={};_0x3cf9dc[_0x521a84]={'$like':'%'+_0x329ff1[_0x2424('0x33')][_0x2424('0x40')]+'%'};return _0x3cf9dc;})});}_0x4864fe=_[_0x2424('0x41')]({},_0x4864fe,_0x329ff1[_0x2424('0x43')]);return _0x523e65['getItems'](_0x4864fe);}})[_0x2424('0x22')](function(_0x2eddb9){if(_0x2eddb9){_0x2bde68=_0x2eddb9[_0x2424('0x39')];if(!_0x329ff1[_0x2424('0x33')][_0x2424('0x3a')]('nolimit')){_0x4864fe[_0x2424('0x1d')]=qs[_0x2424('0x1d')](_0x329ff1[_0x2424('0x33')][_0x2424('0x1d')]);_0x4864fe[_0x2424('0x1c')]=qs[_0x2424('0x1c')](_0x329ff1['query'][_0x2424('0x1c')]);}return _0x523e65['getItems'](_0x4864fe);}})['then'](function(_0x54ca18){if(_0x54ca18){return _0x54ca18?{'count':_0x2bde68,'rows':_0x54ca18}:null;}})[_0x2424('0x22')](respondWithResult(_0xe2b526,null))[_0x2424('0x46')](handleError(_0xe2b526,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index b5eb8e1..7f526a5 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 _0xcc2d=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard'];(function(_0x8afda6,_0x1bd4e9){var _0x46e004=function(_0xbd21e8){while(--_0xbd21e8){_0x8afda6['push'](_0x8afda6['shift']());}};_0x46e004(++_0x1bd4e9);}(_0xcc2d,0x1c9));var _0xdcc2=function(_0x5e6bd8,_0x2100ca){_0x5e6bd8=_0x5e6bd8-0x0;var _0x595ca6=_0xcc2d[_0x5e6bd8];return _0x595ca6;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xdcc2('0x0'))['db'][_0xdcc2('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdcc2('0x2'),'afterUpdate':_0xdcc2('0x3'),'afterDestroy':_0xdcc2('0x4')};function emitEvent(_0x141db){return function(_0x5eced2,_0xf158f0,_0x3cca2c){DashboardEvents['emit'](_0x141db+':'+_0x5eced2['id'],_0x5eced2);DashboardEvents[_0xdcc2('0x5')](_0x141db,_0x5eced2);_0x3cca2c(null);};}for(var e in events){if(events[_0xdcc2('0x6')](e)){var event=events[e];Dashboard[_0xdcc2('0x7')](e,emitEvent(event));}}module[_0xdcc2('0x8')]=DashboardEvents; \ No newline at end of file +var _0x7754=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','Dashboard'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7754,0xd7));var _0x4775=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0x7754[_0x65c0bb];return _0x320bd5;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x4775('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4775('0x1')](0x0);var events={'afterCreate':_0x4775('0x2'),'afterUpdate':_0x4775('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2948f3){return function(_0x4428db,_0x8102f3,_0x1065a3){DashboardEvents[_0x4775('0x4')](_0x2948f3+':'+_0x4428db['id'],_0x4428db);DashboardEvents[_0x4775('0x4')](_0x2948f3,_0x4428db);_0x1065a3(null);};}for(var e in events){if(events[_0x4775('0x5')](e)){var event=events[e];Dashboard[_0x4775('0x6')](e,emitEvent(event));}}module[_0x4775('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 9eae77d..d8ecf49 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 _0xb543=['dashboards','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard'];(function(_0x32c1ae,_0x1c7504){var _0xcff9b2=function(_0xfde4b0){while(--_0xfde4b0){_0x32c1ae['push'](_0x32c1ae['shift']());}};_0xcff9b2(++_0x1c7504);}(_0xb543,0x1c8));var _0x3b54=function(_0x2219ee,_0xc76671){_0x2219ee=_0x2219ee-0x0;var _0x5bbd7e=_0xb543[_0x2219ee];return _0x5bbd7e;};'use strict';var _=require(_0x3b54('0x0'));var util=require('util');var logger=require(_0x3b54('0x1'))(_0x3b54('0x2'));var moment=require(_0x3b54('0x3'));var BPromise=require(_0x3b54('0x4'));var rp=require(_0x3b54('0x5'));var fs=require('fs');var path=require(_0x3b54('0x6'));var rimraf=require(_0x3b54('0x7'));var config=require(_0x3b54('0x8'));var attributes=require(_0x3b54('0x9'));module['exports']=function(_0xb56358,_0x56d2ae){return _0xb56358[_0x3b54('0xa')](_0x3b54('0xb'),attributes,{'tableName':_0x3b54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb643=['exports','define','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0xb643,0x11b));var _0x3b64=function(_0x2d148b,_0x5c2bd9){_0x2d148b=_0x2d148b-0x0;var _0x59caeb=_0xb643[_0x2d148b];return _0x59caeb;};'use strict';var _=require(_0x3b64('0x0'));var util=require(_0x3b64('0x1'));var logger=require(_0x3b64('0x2'))(_0x3b64('0x3'));var moment=require(_0x3b64('0x4'));var BPromise=require(_0x3b64('0x5'));var rp=require(_0x3b64('0x6'));var fs=require('fs');var path=require(_0x3b64('0x7'));var rimraf=require(_0x3b64('0x8'));var config=require(_0x3b64('0x9'));var attributes=require(_0x3b64('0xa'));module[_0x3b64('0xb')]=function(_0x14a51e,_0x461923){return _0x14a51e[_0x3b64('0xc')]('Dashboard',attributes,{'tableName':_0x3b64('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 d6f7d6b..8d50cf0 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 _0x9fc3=['request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','register','then','info'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x9fc3,0x166));var _0x39fc=function(_0x5d2c67,_0x3cacfa){_0x5d2c67=_0x5d2c67-0x0;var _0x3d2395=_0x9fc3[_0x5d2c67];return _0x3d2395;};'use strict';var _=require(_0x39fc('0x0'));var util=require(_0x39fc('0x1'));var moment=require(_0x39fc('0x2'));var BPromise=require(_0x39fc('0x3'));var rs=require(_0x39fc('0x4'));var fs=require('fs');var Redis=require(_0x39fc('0x5'));var db=require(_0x39fc('0x6'))['db'];var utils=require(_0x39fc('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x39fc('0x8'));var jayson=require(_0x39fc('0x9'));var client=jayson[_0x39fc('0xa')][_0x39fc('0xb')]({'port':0x232a});config[_0x39fc('0xc')]=_['defaults'](config['redis'],{'host':_0x39fc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x39fc('0xc')]));require('./dashboard.socket')[_0x39fc('0xe')](socket);function respondWithRpcPromise(_0x30a883,_0x15d999,_0x52b8ca){return new BPromise(function(_0x142299,_0x1f7a79){return client['request'](_0x30a883,_0x52b8ca)[_0x39fc('0xf')](function(_0x301f25){logger[_0x39fc('0x10')]('Dashboard,\x20%s,\x20%s',_0x15d999,_0x39fc('0x11'));logger['debug'](_0x39fc('0x12'),_0x15d999,_0x39fc('0x11'),JSON['stringify'](_0x301f25));if(_0x301f25[_0x39fc('0x13')]){if(_0x301f25[_0x39fc('0x13')][_0x39fc('0x14')]===0x1f4){logger[_0x39fc('0x13')](_0x39fc('0x15'),_0x15d999,_0x301f25['error'][_0x39fc('0x16')]);return _0x1f7a79(_0x301f25[_0x39fc('0x13')]['message']);}logger['error']('Dashboard,\x20%s,\x20%s',_0x15d999,_0x301f25['error'][_0x39fc('0x16')]);return _0x142299(_0x301f25[_0x39fc('0x13')]['message']);}else{logger['info'](_0x39fc('0x15'),_0x15d999,_0x39fc('0x11'));_0x142299(_0x301f25[_0x39fc('0x17')][_0x39fc('0x16')]);}})[_0x39fc('0x18')](function(_0xa2ec6e){logger[_0x39fc('0x13')](_0x39fc('0x15'),_0x15d999,_0xa2ec6e);_0x1f7a79(_0xa2ec6e);});});} \ No newline at end of file +var _0x3e22=['socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x45fe92,_0x3d745a){var _0x491ada=function(_0x373d83){while(--_0x373d83){_0x45fe92['push'](_0x45fe92['shift']());}};_0x491ada(++_0x3d745a);}(_0x3e22,0x11b));var _0x23e2=function(_0x536735,_0x4bb008){_0x536735=_0x536735-0x0;var _0xaed5c5=_0x3e22[_0x536735];return _0xaed5c5;};'use strict';var _=require(_0x23e2('0x0'));var util=require(_0x23e2('0x1'));var moment=require('moment');var BPromise=require(_0x23e2('0x2'));var rs=require(_0x23e2('0x3'));var fs=require('fs');var Redis=require(_0x23e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x23e2('0x5'));var logger=require(_0x23e2('0x6'))(_0x23e2('0x7'));var config=require(_0x23e2('0x8'));var jayson=require(_0x23e2('0x9'));var client=jayson[_0x23e2('0xa')]['http']({'port':0x232a});config[_0x23e2('0xb')]=_[_0x23e2('0xc')](config[_0x23e2('0xb')],{'host':_0x23e2('0xd'),'port':0x18eb});var socket=require(_0x23e2('0xe'))(new Redis(config[_0x23e2('0xb')]));require(_0x23e2('0xf'))['register'](socket);function respondWithRpcPromise(_0x4c65a1,_0x44e369,_0x249adc){return new BPromise(function(_0x550a0c,_0x3cda6c){return client[_0x23e2('0x10')](_0x4c65a1,_0x249adc)[_0x23e2('0x11')](function(_0x4f02fd){logger[_0x23e2('0x12')](_0x23e2('0x13'),_0x44e369,_0x23e2('0x14'));logger[_0x23e2('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x44e369,_0x23e2('0x14'),JSON[_0x23e2('0x16')](_0x4f02fd));if(_0x4f02fd[_0x23e2('0x17')]){if(_0x4f02fd['error'][_0x23e2('0x18')]===0x1f4){logger['error'](_0x23e2('0x13'),_0x44e369,_0x4f02fd[_0x23e2('0x17')]['message']);return _0x3cda6c(_0x4f02fd[_0x23e2('0x17')][_0x23e2('0x19')]);}logger['error'](_0x23e2('0x13'),_0x44e369,_0x4f02fd['error'][_0x23e2('0x19')]);return _0x550a0c(_0x4f02fd['error'][_0x23e2('0x19')]);}else{logger['info'](_0x23e2('0x13'),_0x44e369,_0x23e2('0x14'));_0x550a0c(_0x4f02fd[_0x23e2('0x1a')][_0x23e2('0x19')]);}})['catch'](function(_0x37f6dc){logger[_0x23e2('0x17')]('Dashboard,\x20%s,\x20%s',_0x44e369,_0x37f6dc);_0x3cda6c(_0x37f6dc);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 35be4f4..77f9a46 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 _0x31b0=['register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x43f8b0,_0x4f755a){var _0xcfd7e=function(_0x241011){while(--_0x241011){_0x43f8b0['push'](_0x43f8b0['shift']());}};_0xcfd7e(++_0x4f755a);}(_0x31b0,0x15f));var _0x031b=function(_0x4bad5a,_0x21dc53){_0x4bad5a=_0x4bad5a-0x0;var _0x4cb436=_0x31b0[_0x4bad5a];return _0x4cb436;};'use strict';var DashboardEvents=require(_0x031b('0x0'));var events=[_0x031b('0x1'),_0x031b('0x2'),'update'];function createListener(_0x5d785e,_0x264e2f){return function(_0x3f807b){_0x264e2f['emit'](_0x5d785e,_0x3f807b);};}function removeListener(_0x433821,_0x4c6a4c){return function(){DashboardEvents['removeListener'](_0x433821,_0x4c6a4c);};}exports[_0x031b('0x3')]=function(_0x42c6be){for(var _0x2385c8=0x0,_0x31ca39=events[_0x031b('0x4')];_0x2385c8<_0x31ca39;_0x2385c8++){var _0x637a23=events[_0x2385c8];var _0x169d28=createListener(_0x031b('0x5')+_0x637a23,_0x42c6be);DashboardEvents['on'](_0x637a23,_0x169d28);}}; \ No newline at end of file +var _0x2562=['removeListener','register','save','remove','update','emit'];(function(_0x7a1ad0,_0x28a227){var _0x50166f=function(_0x37da3a){while(--_0x37da3a){_0x7a1ad0['push'](_0x7a1ad0['shift']());}};_0x50166f(++_0x28a227);}(_0x2562,0x182));var _0x2256=function(_0x552454,_0x563146){_0x552454=_0x552454-0x0;var _0x188fd8=_0x2562[_0x552454];return _0x188fd8;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x2256('0x0'),_0x2256('0x1'),_0x2256('0x2')];function createListener(_0x1e6e5c,_0x5c15c4){return function(_0x4bbc07){_0x5c15c4[_0x2256('0x3')](_0x1e6e5c,_0x4bbc07);};}function removeListener(_0x27650a,_0x4a9195){return function(){DashboardEvents[_0x2256('0x4')](_0x27650a,_0x4a9195);};}exports[_0x2256('0x5')]=function(_0x14190e){for(var _0x3f64c2=0x0,_0x4955db=events['length'];_0x3f64c2<_0x4955db;_0x3f64c2++){var _0x2eca69=events[_0x3f64c2];var _0x10f3f5=createListener('dashboard:'+_0x2eca69,_0x14190e);DashboardEvents['on'](_0x2eca69,_0x10f3f5);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index e29c37b..c50d951 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 _0x70e0=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/items','isAuthenticated','getItems','post','/:id/clone','clone','addItem','put','/:id','update','multer'];(function(_0x265dd3,_0x269eb0){var _0xe0454=function(_0x43578b){while(--_0x43578b){_0x265dd3['push'](_0x265dd3['shift']());}};_0xe0454(++_0x269eb0);}(_0x70e0,0x17b));var _0x070e=function(_0x4c68aa,_0x13f906){_0x4c68aa=_0x4c68aa-0x0;var _0x244b86=_0x70e0[_0x4c68aa];return _0x244b86;};'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('./dashboard.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth[_0x070e('0xb')](),controller['create']);router['post'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0xd')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0x12'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);router['delete']('/:id',auth[_0x070e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcb91=['isAuthenticated','/:id','show','create','post','/:id/clone','/:id/items','addItem','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x49b73b,_0x49456b){var _0x391e11=function(_0x111b67){while(--_0x111b67){_0x49b73b['push'](_0x49b73b['shift']());}};_0x391e11(++_0x49456b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xcb91[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./dashboard.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/:id/items',auth[_0x1cb9('0x7')](),controller['getItems']);router['post']('/',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xa')]);router[_0x1cb9('0xb')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),controller['clone']);router[_0x1cb9('0xb')](_0x1cb9('0xd'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x10')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 1757c16..dae930e 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 _0x7768=['long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','STRING','TEXT'];(function(_0x41dacd,_0x209df8){var _0x32b154=function(_0x5329c7){while(--_0x5329c7){_0x41dacd['push'](_0x41dacd['shift']());}};_0x32b154(++_0x209df8);}(_0x7768,0x1d0));var _0x8776=function(_0x3d7ee1,_0x15a49e){_0x3d7ee1=_0x3d7ee1-0x0;var _0x4bbdc7=_0x7768[_0x3d7ee1];return _0x4bbdc7;};'use strict';var Sequelize=require(_0x8776('0x0'));var squel=require(_0x8776('0x1'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x8776('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8776('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8776('0x3')](_0x8776('0x4')),'get':function(){try{return JSON[_0x8776('0x5')](this[_0x8776('0x6')](_0x8776('0x7')));}catch(_0x2a4e1e){return[];}},'set':function(_0x376dfc){try{this['setDataValue'](_0x8776('0x7'),JSON[_0x8776('0x8')](_0x376dfc));}catch(_0x4fadc0){this[_0x8776('0x9')](_0x8776('0x7'),JSON[_0x8776('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x8776('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x8776('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x8776('0xa')]},'col':{'type':Sequelize[_0x8776('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8776('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x8776('0x2')],'allowNull':![],'defaultValue':_0x8776('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8776('0x2')]}}; \ No newline at end of file +var _0x7252=['#2196f3','sequelize','lodash','exports','STRING','TEXT','getDataValue','setDataValue','attrs','stringify','INTEGER','#ffffff'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7252,0x91));var _0x2725=function(_0x5d8695,_0x1a6807){_0x5d8695=_0x5d8695-0x0;var _0x24b352=_0x7252[_0x5d8695];return _0x24b352;};'use strict';var Sequelize=require(_0x2725('0x0'));var squel=require('squel');var _=require(_0x2725('0x1'));module[_0x2725('0x2')]={'title':{'type':Sequelize[_0x2725('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x2725('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x2725('0x4')]('long'),'get':function(){try{return JSON['parse'](this[_0x2725('0x5')]('attrs'));}catch(_0x36a1ff){return[];}},'set':function(_0x873815){try{this[_0x2725('0x6')](_0x2725('0x7'),JSON[_0x2725('0x8')](_0x873815));}catch(_0x4b9eae){this[_0x2725('0x6')](_0x2725('0x7'),JSON[_0x2725('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x2725('0x9')]},'col':{'type':Sequelize[_0x2725('0x9')]},'background':{'type':Sequelize[_0x2725('0x3')],'allowNull':![],'defaultValue':_0x2725('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x2725('0x3')],'allowNull':![],'defaultValue':_0x2725('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 9178aff..10c6b17 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 _0x7d86=['attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','error','body','create','catch','html-pdf','eml-format','fast-json-patch','moment','util','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./dashboardItem.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','options','find','type','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00'];(function(_0x547975,_0x53c9c8){var _0x4ac311=function(_0x438e45){while(--_0x438e45){_0x547975['push'](_0x547975['shift']());}};_0x4ac311(++_0x53c9c8);}(_0x7d86,0xfd));var _0x67d8=function(_0x528feb,_0x1288fb){_0x528feb=_0x528feb-0x0;var _0x3039b3=_0x7d86[_0x528feb];return _0x3039b3;};'use strict';var pdf=require(_0x67d8('0x0'));var emlformat=require(_0x67d8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x67d8('0x2'));var rp=require('request-promise');var moment=require(_0x67d8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x67d8('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x67d8('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x67d8('0x6'));var crypto=require(_0x67d8('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x67d8('0x8'));var toCsv=require('to-csv');var querystring=require(_0x67d8('0x9'));var Papa=require(_0x67d8('0xa'));var Redis=require(_0x67d8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x67d8('0xc'));var as=require(_0x67d8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67d8('0xe'))('api');var utils=require(_0x67d8('0xf'));var config=require(_0x67d8('0x10'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x67d8('0x11')](config[_0x67d8('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x67d8('0x13'))(new Redis(config[_0x67d8('0x12')]));require(_0x67d8('0x14'))['register'](socket);function respondWithStatusCode(_0x5d2b9c,_0x2552b5){_0x2552b5=_0x2552b5||0xcc;return function(_0x3f4e8f){if(_0x3f4e8f){return _0x5d2b9c[_0x67d8('0x15')](_0x2552b5);}return _0x5d2b9c[_0x67d8('0x16')](_0x2552b5)['end']();};}function respondWithResult(_0x1e3658,_0x478570){_0x478570=_0x478570||0xc8;return function(_0x9dedf3){if(_0x9dedf3){return _0x1e3658[_0x67d8('0x16')](_0x478570)[_0x67d8('0x17')](_0x9dedf3);}};}function respondWithFilteredResult(_0x51994b,_0x5ae514){return function(_0x1741e0){if(_0x1741e0){var _0x111739=_0x1741e0[_0x67d8('0x18')],_0x17e5fa=_0x5ae514[_0x67d8('0x19')],_0x5234bb=_0x5ae514['offset']+_0x5ae514[_0x67d8('0x1a')],_0x3b921d;if(_0x5234bb>=_0x111739){_0x5234bb=_0x111739;_0x3b921d=0xc8;}else{_0x3b921d=0xce;}_0x51994b[_0x67d8('0x16')](_0x3b921d);return _0x51994b[_0x67d8('0x1b')](_0x67d8('0x1c'),_0x17e5fa+'-'+_0x5234bb+'/'+_0x111739)[_0x67d8('0x17')](_0x1741e0);}return null;};}function patchUpdates(_0x4b618f){return function(_0x567bfa){try{jsonpatch[_0x67d8('0x1d')](_0x567bfa,_0x4b618f,!![]);}catch(_0x4addb6){return BPromise[_0x67d8('0x1e')](_0x4addb6);}return _0x567bfa[_0x67d8('0x1f')]();};}function saveUpdates(_0xd91858,_0x4d9364){return function(_0x239088){if(_0x239088){return _0x239088[_0x67d8('0x20')](_0xd91858)[_0x67d8('0x21')](function(_0x642e0f){return _0x642e0f;});}return null;};}function removeEntity(_0xea7036,_0xcf4ef3){return function(_0x437ded){if(_0x437ded){return _0x437ded[_0x67d8('0x22')]()[_0x67d8('0x21')](function(){_0xea7036[_0x67d8('0x16')](0xcc)[_0x67d8('0x23')]();});}};}function handleEntityNotFound(_0x132b42,_0x3f505a){return function(_0x29eff4){if(!_0x29eff4){_0x132b42[_0x67d8('0x15')](0x194);}return _0x29eff4;};}function handleError(_0x30092a,_0x38523e){_0x38523e=_0x38523e||0x1f4;return function(_0x1c15d5){logger['error'](_0x1c15d5[_0x67d8('0x24')]);if(_0x1c15d5[_0x67d8('0x25')]){delete _0x1c15d5['name'];}_0x30092a[_0x67d8('0x16')](_0x38523e)['send'](_0x1c15d5);};}exports['show']=function(_0x147e32,_0xce49a4){var _0x36524a={'raw':![],'where':{'id':_0x147e32[_0x67d8('0x26')]['id']}},_0x374453={};_0x374453[_0x67d8('0x27')]=_['keys'](db[_0x67d8('0x28')][_0x67d8('0x29')]);_0x374453[_0x67d8('0x2a')]=_[_0x67d8('0x2b')](_0x147e32[_0x67d8('0x2a')]);_0x374453[_0x67d8('0x2c')]=_[_0x67d8('0x2d')](_0x374453['model'],_0x374453[_0x67d8('0x2a')]);_0x36524a[_0x67d8('0x2e')]=_['intersection'](_0x374453['model'],qs[_0x67d8('0x2f')](_0x147e32[_0x67d8('0x2a')][_0x67d8('0x2f')]));_0x36524a['attributes']=_0x36524a[_0x67d8('0x2e')][_0x67d8('0x30')]?_0x36524a['attributes']:_0x374453[_0x67d8('0x27')];if(_0x147e32[_0x67d8('0x2a')][_0x67d8('0x31')]){_0x36524a['include']=[{'all':!![]}];}_0x36524a=_['merge']({},_0x36524a,_0x147e32[_0x67d8('0x32')]);return db[_0x67d8('0x28')][_0x67d8('0x33')](_0x36524a)[_0x67d8('0x21')](handleEntityNotFound(_0xce49a4,null))[_0x67d8('0x21')](respondWithResult(_0xce49a4,null))['catch'](handleError(_0xce49a4,null));};exports[_0x67d8('0x22')]=function(_0x5005b1,_0x510e99){return db[_0x67d8('0x28')][_0x67d8('0x33')]({'where':{'id':_0x5005b1[_0x67d8('0x26')]['id']}})[_0x67d8('0x21')](handleEntityNotFound(_0x510e99,null))['then'](removeEntity(_0x510e99,null))['catch'](handleError(_0x510e99,null));};function widgetAttributes(_0x5c2e7e){try{switch(_0x5c2e7e[_0x67d8('0x34')]){case _0x67d8('0x35'):return[{'name':_0x67d8('0x36'),'value':_0x5c2e7e[_0x67d8('0x36')]||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e['attrs'][0x0]?_0x5c2e7e[_0x67d8('0x37')][0x0][_0x67d8('0x38')]:undefined)||'https://'}];case'custom':return[{'name':_0x67d8('0x39'),'value':_0x5c2e7e[_0x67d8('0x39')]||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e[_0x67d8('0x37')][0x0]?_0x5c2e7e[_0x67d8('0x37')][0x0]['value']:undefined)||''}];case _0x67d8('0x3a'):return[{'name':_0x67d8('0x3b'),'value':_0x5c2e7e[_0x67d8('0x3b')]||(_0x5c2e7e['attrs']&&_0x5c2e7e[_0x67d8('0x37')][0x0]?_0x5c2e7e['attrs'][0x0][_0x67d8('0x38')]:undefined)||_0x67d8('0x3c')},{'name':_0x67d8('0x3d'),'value':_0x5c2e7e[_0x67d8('0x3d')]||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e[_0x67d8('0x37')][0x1]?_0x5c2e7e[_0x67d8('0x37')][0x1][_0x67d8('0x38')]:undefined)||_0x67d8('0x3e')},{'name':'attrFontSize','value':_0x5c2e7e['attrFontSize']||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e['attrs'][0x2]?_0x5c2e7e['attrs'][0x2][_0x67d8('0x38')]:undefined)||0xc}];case'counter':return[{'name':_0x67d8('0x3f'),'value':_0x5c2e7e[_0x67d8('0x3f')]||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e[_0x67d8('0x37')][0x0]?_0x5c2e7e['attrs'][0x0][_0x67d8('0x38')]:undefined)||_0x67d8('0x40')},{'name':_0x67d8('0x41'),'value':_0x5c2e7e[_0x67d8('0x41')]||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e[_0x67d8('0x37')][0x1]?_0x5c2e7e['attrs'][0x1][_0x67d8('0x38')]:undefined)||[]},{'name':'attrFontSize','value':_0x5c2e7e[_0x67d8('0x42')]||(_0x5c2e7e['attrs']&&_0x5c2e7e[_0x67d8('0x37')][0x2]?_0x5c2e7e[_0x67d8('0x37')][0x2]['value']:undefined)||0x14}];case _0x67d8('0x43'):case _0x67d8('0x44'):return[{'name':_0x67d8('0x45'),'value':_0x5c2e7e[_0x67d8('0x45')]||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e[_0x67d8('0x37')][0x0]?_0x5c2e7e[_0x67d8('0x37')][0x0]['value']:undefined)||_0x67d8('0x40')},{'name':_0x67d8('0x46'),'value':_0x5c2e7e[_0x67d8('0x46')]||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e[_0x67d8('0x37')][0x1]?_0x5c2e7e['attrs'][0x1][_0x67d8('0x38')]:undefined)||null},{'name':_0x67d8('0x47'),'value':_0x5c2e7e['attrSerie3']||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e['attrs'][0x2]?_0x5c2e7e[_0x67d8('0x37')][0x2][_0x67d8('0x38')]:undefined)||null},{'name':_0x67d8('0x41'),'value':_0x5c2e7e['attrVoiceQueues']||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e[_0x67d8('0x37')][0x3]?_0x5c2e7e[_0x67d8('0x37')][0x3][_0x67d8('0x38')]:undefined)||[]}];case _0x67d8('0x48'):return[{'name':'attrReport','type':_0x5c2e7e['reportType']||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e[_0x67d8('0x37')][0x0]?_0x5c2e7e[_0x67d8('0x37')][0x0][_0x67d8('0x34')]:undefined)||null,'value':_0x5c2e7e[_0x67d8('0x49')]||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e[_0x67d8('0x37')][0x0]?_0x5c2e7e[_0x67d8('0x37')][0x0]['value']:undefined)||null},{'name':_0x67d8('0x4a'),'value':_0x5c2e7e['attrRefresh']||(_0x5c2e7e[_0x67d8('0x37')]&&_0x5c2e7e['attrs'][0x1]?_0x5c2e7e[_0x67d8('0x37')][0x1][_0x67d8('0x38')]:undefined)||0x0}];default:return[];}}catch(_0x4afb46){logger[_0x67d8('0x4b')]('widgetAttributes:\x20%s',JSON['stringify'](_0x4afb46));return[];}}exports['create']=function(_0x4eb612,_0x5018c7){if(_0x4eb612[_0x67d8('0x4c')]){_0x4eb612[_0x67d8('0x4c')][_0x67d8('0x37')]=widgetAttributes(_0x4eb612[_0x67d8('0x4c')]);}return db[_0x67d8('0x28')][_0x67d8('0x4d')](_0x4eb612[_0x67d8('0x4c')],{})['then'](respondWithResult(_0x5018c7,0xc9))['catch'](handleError(_0x5018c7,null));};exports[_0x67d8('0x20')]=function(_0x92a568,_0x12a92b){if(_0x92a568[_0x67d8('0x4c')]['id']){delete _0x92a568[_0x67d8('0x4c')]['id'];}_0x92a568[_0x67d8('0x4c')]['attrs']=widgetAttributes(_0x92a568[_0x67d8('0x4c')]);return db[_0x67d8('0x28')][_0x67d8('0x33')]({'where':{'id':_0x92a568[_0x67d8('0x26')]['id']}})[_0x67d8('0x21')](handleEntityNotFound(_0x12a92b,null))['then'](saveUpdates(_0x92a568[_0x67d8('0x4c')],null))[_0x67d8('0x21')](respondWithResult(_0x12a92b,null))[_0x67d8('0x4e')](handleError(_0x12a92b,null));}; \ No newline at end of file +var _0xa21d=['count','offset','limit','set','json','apply','reject','then','destroy','sendStatus','error','name','send','params','keys','DashboardItem','rawAttributes','query','intersection','model','attributes','includeAll','merge','find','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','catch','update','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','status','end'];(function(_0x3e3f94,_0x27528b){var _0x5548bb=function(_0x272be9){while(--_0x272be9){_0x3e3f94['push'](_0x3e3f94['shift']());}};_0x5548bb(++_0x27528b);}(_0xa21d,0x1cb));var _0xda21=function(_0x431cd4,_0x172bcb){_0x431cd4=_0x431cd4-0x0;var _0x8a4e64=_0xa21d[_0x431cd4];return _0x8a4e64;};'use strict';var pdf=require(_0xda21('0x0'));var emlformat=require(_0xda21('0x1'));var rimraf=require(_0xda21('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xda21('0x3'));var moment=require(_0xda21('0x4'));var BPromise=require(_0xda21('0x5'));var Mustache=require(_0xda21('0x6'));var util=require(_0xda21('0x7'));var path=require(_0xda21('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xda21('0x9'));var squel=require(_0xda21('0xa'));var crypto=require(_0xda21('0xb'));var jsforce=require(_0xda21('0xc'));var deskjs=require(_0xda21('0xd'));var toCsv=require(_0xda21('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda21('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xda21('0x10'));var hardwareService=require(_0xda21('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xda21('0x12'));var config=require(_0xda21('0x13'));var db=require(_0xda21('0x14'))['db'];config['redis']=_[_0xda21('0x15')](config['redis'],{'host':_0xda21('0x16'),'port':0x18eb});var socket=require(_0xda21('0x17'))(new Redis(config[_0xda21('0x18')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x1bd30b,_0x24b2ce){_0x24b2ce=_0x24b2ce||0xcc;return function(_0x442929){if(_0x442929){return _0x1bd30b['sendStatus'](_0x24b2ce);}return _0x1bd30b[_0xda21('0x19')](_0x24b2ce)[_0xda21('0x1a')]();};}function respondWithResult(_0x1a0d95,_0x352b7e){_0x352b7e=_0x352b7e||0xc8;return function(_0x41b850){if(_0x41b850){return _0x1a0d95[_0xda21('0x19')](_0x352b7e)['json'](_0x41b850);}};}function respondWithFilteredResult(_0x1efcc8,_0x3dd337){return function(_0x26475f){if(_0x26475f){var _0x573226=_0x26475f[_0xda21('0x1b')],_0x5afc93=_0x3dd337[_0xda21('0x1c')],_0x448821=_0x3dd337['offset']+_0x3dd337[_0xda21('0x1d')],_0x5543ff;if(_0x448821>=_0x573226){_0x448821=_0x573226;_0x5543ff=0xc8;}else{_0x5543ff=0xce;}_0x1efcc8[_0xda21('0x19')](_0x5543ff);return _0x1efcc8[_0xda21('0x1e')]('Content-Range',_0x5afc93+'-'+_0x448821+'/'+_0x573226)[_0xda21('0x1f')](_0x26475f);}return null;};}function patchUpdates(_0x122909){return function(_0x29541d){try{jsonpatch[_0xda21('0x20')](_0x29541d,_0x122909,!![]);}catch(_0x42ae6c){return BPromise[_0xda21('0x21')](_0x42ae6c);}return _0x29541d['save']();};}function saveUpdates(_0x4d5f69,_0x177261){return function(_0x3c9963){if(_0x3c9963){return _0x3c9963['update'](_0x4d5f69)[_0xda21('0x22')](function(_0x3363e5){return _0x3363e5;});}return null;};}function removeEntity(_0x9efe06,_0x239ea6){return function(_0x4fef52){if(_0x4fef52){return _0x4fef52[_0xda21('0x23')]()[_0xda21('0x22')](function(){_0x9efe06[_0xda21('0x19')](0xcc)[_0xda21('0x1a')]();});}};}function handleEntityNotFound(_0x36c9b4,_0x4b8497){return function(_0x21a17d){if(!_0x21a17d){_0x36c9b4[_0xda21('0x24')](0x194);}return _0x21a17d;};}function handleError(_0x2eb256,_0xcbbeb7){_0xcbbeb7=_0xcbbeb7||0x1f4;return function(_0x5a9d33){logger[_0xda21('0x25')](_0x5a9d33['stack']);if(_0x5a9d33['name']){delete _0x5a9d33[_0xda21('0x26')];}_0x2eb256[_0xda21('0x19')](_0xcbbeb7)[_0xda21('0x27')](_0x5a9d33);};}exports['show']=function(_0x22ace3,_0x13e61b){var _0x1d2c8b={'raw':![],'where':{'id':_0x22ace3[_0xda21('0x28')]['id']}},_0x1e0f4e={};_0x1e0f4e['model']=_[_0xda21('0x29')](db[_0xda21('0x2a')][_0xda21('0x2b')]);_0x1e0f4e[_0xda21('0x2c')]=_[_0xda21('0x29')](_0x22ace3['query']);_0x1e0f4e['filters']=_[_0xda21('0x2d')](_0x1e0f4e[_0xda21('0x2e')],_0x1e0f4e['query']);_0x1d2c8b[_0xda21('0x2f')]=_[_0xda21('0x2d')](_0x1e0f4e[_0xda21('0x2e')],qs['fields'](_0x22ace3[_0xda21('0x2c')]['fields']));_0x1d2c8b['attributes']=_0x1d2c8b['attributes']['length']?_0x1d2c8b[_0xda21('0x2f')]:_0x1e0f4e[_0xda21('0x2e')];if(_0x22ace3[_0xda21('0x2c')][_0xda21('0x30')]){_0x1d2c8b['include']=[{'all':!![]}];}_0x1d2c8b=_[_0xda21('0x31')]({},_0x1d2c8b,_0x22ace3['options']);return db[_0xda21('0x2a')][_0xda21('0x32')](_0x1d2c8b)[_0xda21('0x22')](handleEntityNotFound(_0x13e61b,null))['then'](respondWithResult(_0x13e61b,null))['catch'](handleError(_0x13e61b,null));};exports[_0xda21('0x23')]=function(_0x3aa1cf,_0x5c130a){return db[_0xda21('0x2a')][_0xda21('0x32')]({'where':{'id':_0x3aa1cf[_0xda21('0x28')]['id']}})[_0xda21('0x22')](handleEntityNotFound(_0x5c130a,null))[_0xda21('0x22')](removeEntity(_0x5c130a,null))['catch'](handleError(_0x5c130a,null));};function widgetAttributes(_0x5eb408){try{switch(_0x5eb408[_0xda21('0x33')]){case _0xda21('0x34'):return[{'name':_0xda21('0x35'),'value':_0x5eb408[_0xda21('0x35')]||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408['attrs'][0x0]?_0x5eb408[_0xda21('0x36')][0x0][_0xda21('0x37')]:undefined)||_0xda21('0x38')}];case _0xda21('0x39'):return[{'name':'attrPath','value':_0x5eb408[_0xda21('0x3a')]||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408[_0xda21('0x36')][0x0]?_0x5eb408[_0xda21('0x36')][0x0][_0xda21('0x37')]:undefined)||''}];case'clock':return[{'name':_0xda21('0x3b'),'value':_0x5eb408[_0xda21('0x3b')]||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408[_0xda21('0x36')][0x0]?_0x5eb408[_0xda21('0x36')][0x0][_0xda21('0x37')]:undefined)||_0xda21('0x3c')},{'name':_0xda21('0x3d'),'value':_0x5eb408['attrTimezone']||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408[_0xda21('0x36')][0x1]?_0x5eb408['attrs'][0x1]['value']:undefined)||_0xda21('0x3e')},{'name':'attrFontSize','value':_0x5eb408[_0xda21('0x3f')]||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408[_0xda21('0x36')][0x2]?_0x5eb408[_0xda21('0x36')][0x2]['value']:undefined)||0xc}];case _0xda21('0x40'):return[{'name':'attrMetric','value':_0x5eb408[_0xda21('0x41')]||(_0x5eb408['attrs']&&_0x5eb408[_0xda21('0x36')][0x0]?_0x5eb408['attrs'][0x0]['value']:undefined)||_0xda21('0x42')},{'name':_0xda21('0x43'),'value':_0x5eb408[_0xda21('0x43')]||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408[_0xda21('0x36')][0x1]?_0x5eb408[_0xda21('0x36')][0x1][_0xda21('0x37')]:undefined)||[]},{'name':_0xda21('0x3f'),'value':_0x5eb408[_0xda21('0x3f')]||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408['attrs'][0x2]?_0x5eb408[_0xda21('0x36')][0x2][_0xda21('0x37')]:undefined)||0x14}];case _0xda21('0x44'):case _0xda21('0x45'):return[{'name':'attrSerie1','value':_0x5eb408['attrSerie1']||(_0x5eb408['attrs']&&_0x5eb408[_0xda21('0x36')][0x0]?_0x5eb408[_0xda21('0x36')][0x0][_0xda21('0x37')]:undefined)||_0xda21('0x42')},{'name':_0xda21('0x46'),'value':_0x5eb408[_0xda21('0x46')]||(_0x5eb408['attrs']&&_0x5eb408['attrs'][0x1]?_0x5eb408[_0xda21('0x36')][0x1]['value']:undefined)||null},{'name':_0xda21('0x47'),'value':_0x5eb408[_0xda21('0x47')]||(_0x5eb408['attrs']&&_0x5eb408[_0xda21('0x36')][0x2]?_0x5eb408[_0xda21('0x36')][0x2][_0xda21('0x37')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5eb408[_0xda21('0x43')]||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408[_0xda21('0x36')][0x3]?_0x5eb408[_0xda21('0x36')][0x3]['value']:undefined)||[]}];case _0xda21('0x48'):return[{'name':_0xda21('0x49'),'type':_0x5eb408[_0xda21('0x4a')]||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408[_0xda21('0x36')][0x0]?_0x5eb408[_0xda21('0x36')][0x0][_0xda21('0x33')]:undefined)||null,'value':_0x5eb408[_0xda21('0x49')]||(_0x5eb408[_0xda21('0x36')]&&_0x5eb408[_0xda21('0x36')][0x0]?_0x5eb408[_0xda21('0x36')][0x0][_0xda21('0x37')]:undefined)||null},{'name':_0xda21('0x4b'),'value':_0x5eb408[_0xda21('0x4b')]||(_0x5eb408['attrs']&&_0x5eb408['attrs'][0x1]?_0x5eb408[_0xda21('0x36')][0x1][_0xda21('0x37')]:undefined)||0x0}];default:return[];}}catch(_0x328aa6){logger[_0xda21('0x25')]('widgetAttributes:\x20%s',JSON[_0xda21('0x4c')](_0x328aa6));return[];}}exports[_0xda21('0x4d')]=function(_0x18e6f9,_0x55b45f){if(_0x18e6f9[_0xda21('0x4e')]){_0x18e6f9['body']['attrs']=widgetAttributes(_0x18e6f9[_0xda21('0x4e')]);}return db[_0xda21('0x2a')][_0xda21('0x4d')](_0x18e6f9[_0xda21('0x4e')],{})[_0xda21('0x22')](respondWithResult(_0x55b45f,0xc9))[_0xda21('0x4f')](handleError(_0x55b45f,null));};exports[_0xda21('0x50')]=function(_0x4c165b,_0x127d9f){if(_0x4c165b[_0xda21('0x4e')]['id']){delete _0x4c165b[_0xda21('0x4e')]['id'];}_0x4c165b[_0xda21('0x4e')][_0xda21('0x36')]=widgetAttributes(_0x4c165b[_0xda21('0x4e')]);return db['DashboardItem'][_0xda21('0x32')]({'where':{'id':_0x4c165b[_0xda21('0x28')]['id']}})['then'](handleEntityNotFound(_0x127d9f,null))[_0xda21('0x22')](saveUpdates(_0x4c165b[_0xda21('0x4e')],null))['then'](respondWithResult(_0x127d9f,null))[_0xda21('0x4f')](handleError(_0x127d9f,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 1c81076..d7dc59f 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 _0xb31e=['save','update','emit','hasOwnProperty','hook','exports','events','DashboardItem'];(function(_0x11457b,_0x2b6e39){var _0xb306cc=function(_0x286eaf){while(--_0x286eaf){_0x11457b['push'](_0x11457b['shift']());}};_0xb306cc(++_0x2b6e39);}(_0xb31e,0x1c6));var _0xeb31=function(_0x483bd3,_0x5dad47){_0x483bd3=_0x483bd3-0x0;var _0x58200c=_0xb31e[_0x483bd3];return _0x58200c;};'use strict';var EventEmitter=require(_0xeb31('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xeb31('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb31('0x2'),'afterUpdate':_0xeb31('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2a6211){return function(_0x1ca713,_0x138508,_0x5d7714){DashboardItemEvents[_0xeb31('0x4')](_0x2a6211+':'+_0x1ca713['id'],_0x1ca713);DashboardItemEvents[_0xeb31('0x4')](_0x2a6211,_0x1ca713);_0x5d7714(null);};}for(var e in events){if(events[_0xeb31('0x5')](e)){var event=events[e];DashboardItem[_0xeb31('0x6')](e,emitEvent(event));}}module[_0xeb31('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xc01b=['hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','update','remove','emit'];(function(_0x25015c,_0x42d77a){var _0x9fa00f=function(_0x2fc287){while(--_0x2fc287){_0x25015c['push'](_0x25015c['shift']());}};_0x9fa00f(++_0x42d77a);}(_0xc01b,0x65));var _0xbc01=function(_0x20f769,_0x49555d){_0x20f769=_0x20f769-0x0;var _0x598c76=_0xc01b[_0x20f769];return _0x598c76;};'use strict';var EventEmitter=require(_0xbc01('0x0'));var DashboardItem=require(_0xbc01('0x1'))['db'][_0xbc01('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xbc01('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc01('0x4'),'afterDestroy':_0xbc01('0x5')};function emitEvent(_0x48fa3f){return function(_0x538b32,_0x52b070,_0x17f136){DashboardItemEvents[_0xbc01('0x6')](_0x48fa3f+':'+_0x538b32['id'],_0x538b32);DashboardItemEvents['emit'](_0x48fa3f,_0x538b32);_0x17f136(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xbc01('0x7')](e,emitEvent(event));}}module[_0xbc01('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 073f862..c98e5f3 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 _0xb71a=['request-promise','rimraf','exports','define','DashboardItem','../../config/logger','api','bluebird'];(function(_0x4386b5,_0x45a975){var _0x392631=function(_0x4310e5){while(--_0x4310e5){_0x4386b5['push'](_0x4386b5['shift']());}};_0x392631(++_0x45a975);}(_0xb71a,0x8d));var _0xab71=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xb71a[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab71('0x0'))(_0xab71('0x1'));var moment=require('moment');var BPromise=require(_0xab71('0x2'));var rp=require(_0xab71('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab71('0x4'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xab71('0x5')]=function(_0x421cb7,_0x518d0a){return _0x421cb7[_0xab71('0x6')](_0xab71('0x7'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a03=['exports','define','DashboardItem','dashboard_items','util','../../config/logger','bluebird','request-promise','./dashboardItem.attributes'];(function(_0x3c961b,_0x59bdb2){var _0x27ff12=function(_0xd38a30){while(--_0xd38a30){_0x3c961b['push'](_0x3c961b['shift']());}};_0x27ff12(++_0x59bdb2);}(_0x1a03,0x1b4));var _0x31a0=function(_0x2ee20d,_0x354e70){_0x2ee20d=_0x2ee20d-0x0;var _0xade530=_0x1a03[_0x2ee20d];return _0xade530;};'use strict';var _=require('lodash');var util=require(_0x31a0('0x0'));var logger=require(_0x31a0('0x1'))('api');var moment=require('moment');var BPromise=require(_0x31a0('0x2'));var rp=require(_0x31a0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x31a0('0x4'));module[_0x31a0('0x5')]=function(_0x276bad,_0x3f06f1){return _0x276bad[_0x31a0('0x6')](_0x31a0('0x7'),attributes,{'tableName':_0x31a0('0x8'),'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 de74255..ad3a7af 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 _0x13aa=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','lodash','util','moment','bluebird'];(function(_0x4d1ddb,_0x4314cd){var _0xd4c1b3=function(_0x4ebae5){while(--_0x4ebae5){_0x4d1ddb['push'](_0x4d1ddb['shift']());}};_0xd4c1b3(++_0x4314cd);}(_0x13aa,0x125));var _0xa13a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13aa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa13a('0x0'));var util=require(_0xa13a('0x1'));var moment=require(_0xa13a('0x2'));var BPromise=require(_0xa13a('0x3'));var rs=require(_0xa13a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa13a('0x5'))['db'];var utils=require(_0xa13a('0x6'));var logger=require(_0xa13a('0x7'))(_0xa13a('0x8'));var config=require(_0xa13a('0x9'));var jayson=require(_0xa13a('0xa'));var client=jayson['client'][_0xa13a('0xb')]({'port':0x232a});config[_0xa13a('0xc')]=_[_0xa13a('0xd')](config[_0xa13a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa13a('0xe'))(new Redis(config[_0xa13a('0xc')]));require('./dashboardItem.socket')[_0xa13a('0xf')](socket);function respondWithRpcPromise(_0x1829e0,_0xc46a12,_0x2db28a){return new BPromise(function(_0x56eaf4,_0x55239b){return client['request'](_0x1829e0,_0x2db28a)['then'](function(_0x4c98ea){logger[_0xa13a('0x10')](_0xa13a('0x11'),_0xc46a12,_0xa13a('0x12'));logger[_0xa13a('0x13')](_0xa13a('0x14'),_0xc46a12,'request\x20sent',JSON[_0xa13a('0x15')](_0x4c98ea));if(_0x4c98ea['error']){if(_0x4c98ea['error'][_0xa13a('0x16')]===0x1f4){logger['error'](_0xa13a('0x11'),_0xc46a12,_0x4c98ea['error'][_0xa13a('0x17')]);return _0x55239b(_0x4c98ea[_0xa13a('0x18')]['message']);}logger[_0xa13a('0x18')]('DashboardItem,\x20%s,\x20%s',_0xc46a12,_0x4c98ea[_0xa13a('0x18')][_0xa13a('0x17')]);return _0x56eaf4(_0x4c98ea[_0xa13a('0x18')][_0xa13a('0x17')]);}else{logger['info'](_0xa13a('0x11'),_0xc46a12,_0xa13a('0x12'));_0x56eaf4(_0x4c98ea[_0xa13a('0x19')][_0xa13a('0x17')]);}})[_0xa13a('0x1a')](function(_0x4ba233){logger[_0xa13a('0x18')](_0xa13a('0x11'),_0xc46a12,_0x4ba233);_0x55239b(_0x4ba233);});});} \ No newline at end of file +var _0x2db2=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2db2,0xc4));var _0x22db=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0x2db2[_0x1f7413];return _0x2d2775;};'use strict';var _=require(_0x22db('0x0'));var util=require(_0x22db('0x1'));var moment=require('moment');var BPromise=require(_0x22db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22db('0x3'));var db=require(_0x22db('0x4'))['db'];var utils=require(_0x22db('0x5'));var logger=require(_0x22db('0x6'))('rpc');var config=require(_0x22db('0x7'));var jayson=require(_0x22db('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x22db('0x9')]=_[_0x22db('0xa')](config[_0x22db('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x22db('0xb'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x22db('0xc')](socket);function respondWithRpcPromise(_0x3665d1,_0x3a831b,_0x2d57cb){return new BPromise(function(_0x4b4426,_0x19ec89){return client[_0x22db('0xd')](_0x3665d1,_0x2d57cb)[_0x22db('0xe')](function(_0x2e8178){logger['info'](_0x22db('0xf'),_0x3a831b,_0x22db('0x10'));logger[_0x22db('0x11')](_0x22db('0x12'),_0x3a831b,_0x22db('0x10'),JSON[_0x22db('0x13')](_0x2e8178));if(_0x2e8178['error']){if(_0x2e8178[_0x22db('0x14')]['code']===0x1f4){logger['error'](_0x22db('0xf'),_0x3a831b,_0x2e8178['error'][_0x22db('0x15')]);return _0x19ec89(_0x2e8178['error'][_0x22db('0x15')]);}logger[_0x22db('0x14')](_0x22db('0xf'),_0x3a831b,_0x2e8178[_0x22db('0x14')][_0x22db('0x15')]);return _0x4b4426(_0x2e8178['error'][_0x22db('0x15')]);}else{logger[_0x22db('0x16')]('DashboardItem,\x20%s,\x20%s',_0x3a831b,_0x22db('0x10'));_0x4b4426(_0x2e8178[_0x22db('0x17')][_0x22db('0x15')]);}})[_0x22db('0x18')](function(_0x179f2f){logger[_0x22db('0x14')](_0x22db('0xf'),_0x3a831b,_0x179f2f);_0x19ec89(_0x179f2f);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index eacd282..92694d8 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 _0x8c41=['./dashboardItem.events','remove','emit','removeListener','length','dashboardItem:'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x8c41,0x1a4));var _0x18c4=function(_0x42975f,_0x4d5eb1){_0x42975f=_0x42975f-0x0;var _0x33f081=_0x8c41[_0x42975f];return _0x33f081;};'use strict';var DashboardItemEvents=require(_0x18c4('0x0'));var events=['save',_0x18c4('0x1'),'update'];function createListener(_0xa002f7,_0x95baf){return function(_0x475a8f){_0x95baf[_0x18c4('0x2')](_0xa002f7,_0x475a8f);};}function removeListener(_0x5c807d,_0x89202e){return function(){DashboardItemEvents[_0x18c4('0x3')](_0x5c807d,_0x89202e);};}exports['register']=function(_0x5b705c){for(var _0x3a3b61=0x0,_0x1220d2=events[_0x18c4('0x4')];_0x3a3b61<_0x1220d2;_0x3a3b61++){var _0x25e094=events[_0x3a3b61];var _0x10717d=createListener(_0x18c4('0x5')+_0x25e094,_0x5b705c);DashboardItemEvents['on'](_0x25e094,_0x10717d);}}; \ No newline at end of file +var _0x1251=['emit','removeListener','length','dashboardItem:','save','remove'];(function(_0x138cd3,_0x49a3a4){var _0x4d2252=function(_0x497987){while(--_0x497987){_0x138cd3['push'](_0x138cd3['shift']());}};_0x4d2252(++_0x49a3a4);}(_0x1251,0x136));var _0x1125=function(_0x3df55a,_0xeb8149){_0x3df55a=_0x3df55a-0x0;var _0x510feb=_0x1251[_0x3df55a];return _0x510feb;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x1125('0x0'),_0x1125('0x1'),'update'];function createListener(_0xa31394,_0x5ad14c){return function(_0x14464f){_0x5ad14c[_0x1125('0x2')](_0xa31394,_0x14464f);};}function removeListener(_0x3a1dfc,_0x3617dd){return function(){DashboardItemEvents[_0x1125('0x3')](_0x3a1dfc,_0x3617dd);};}exports['register']=function(_0x4e5d62){for(var _0x16071a=0x0,_0x3bbd25=events[_0x1125('0x4')];_0x16071a<_0x3bbd25;_0x16071a++){var _0x272578=events[_0x16071a];var _0x4e6a13=createListener(_0x1125('0x5')+_0x272578,_0x4e5d62);DashboardItemEvents['on'](_0x272578,_0x4e6a13);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index aa6f86c..fb77ef2 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 _0xf494=['put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post'];(function(_0x1adbd7,_0xb04b54){var _0x17f4b4=function(_0x10ec36){while(--_0x10ec36){_0x1adbd7['push'](_0x1adbd7['shift']());}};_0x17f4b4(++_0xb04b54);}(_0xf494,0x1c6));var _0x4f49=function(_0x394622,_0xbb2dd9){_0x394622=_0x394622-0x0;var _0x17be65=_0xf494[_0x394622];return _0x17be65;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router[_0x4f49('0x9')](_0x4f49('0xa'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0xe')](_0x4f49('0xa'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')](_0x4f49('0xa'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe2fe=['put','update','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post'];(function(_0x58a5a3,_0x2dd4e9){var _0x43a6fd=function(_0xd2340b){while(--_0xd2340b){_0x58a5a3['push'](_0x58a5a3['shift']());}};_0x43a6fd(++_0x2dd4e9);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'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'));var controller=require(_0xee2f('0x6'));router['get'](_0xee2f('0x7'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x9')]('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0xa')]('/:id',auth[_0xee2f('0x8')](),controller[_0xee2f('0xb')]);router['delete'](_0xee2f('0x7'),auth[_0xee2f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index f5ce978..725db52 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 _0xf77f=['exports','sequelize'];(function(_0x3e43b4,_0x29e27a){var _0x5a46a7=function(_0x173fc1){while(--_0x173fc1){_0x3e43b4['push'](_0x3e43b4['shift']());}};_0x5a46a7(++_0x29e27a);}(_0xf77f,0x181));var _0xff77=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf77f[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0xff77('0x0'));module[_0xff77('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x26ed=['exports','STRING','sequelize'];(function(_0x343a9a,_0x2a6c95){var _0x23cfeb=function(_0xf29bc7){while(--_0xf29bc7){_0x343a9a['push'](_0x343a9a['shift']());}};_0x23cfeb(++_0x2a6c95);}(_0x26ed,0x125));var _0xd26e=function(_0xf7bf02,_0x13da13){_0xf7bf02=_0xf7bf02-0x0;var _0x4f263f=_0x26ed[_0xf7bf02];return _0x4f263f;};'use strict';var Sequelize=require(_0xd26e('0x0'));module[_0xd26e('0x1')]={'name':{'type':Sequelize[_0xd26e('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 bbe5eee..6de8178 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 _0x5292=['rows','show','rawAttributes','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','then','destroy','Dispositions','UserProfileResource','error','stack','name','send','map','Disposition','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','filter','options','include','findAll'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5292,0xf7));var _0x2529=function(_0x45a945,_0x2e8b66){_0x45a945=_0x45a945-0x0;var _0x403af5=_0x5292[_0x45a945];return _0x403af5;};'use strict';var pdf=require(_0x2529('0x0'));var emlformat=require(_0x2529('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2529('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2529('0x3'));var moment=require(_0x2529('0x4'));var BPromise=require(_0x2529('0x5'));var Mustache=require(_0x2529('0x6'));var util=require('util');var path=require(_0x2529('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var db=require(_0x2529('0x15'))['db'];function respondWithStatusCode(_0x521a43,_0xe333c9){_0xe333c9=_0xe333c9||0xcc;return function(_0x23bfaf){if(_0x23bfaf){return _0x521a43[_0x2529('0x16')](_0xe333c9);}return _0x521a43[_0x2529('0x17')](_0xe333c9)[_0x2529('0x18')]();};}function respondWithResult(_0x31c39c,_0x3f3b40){_0x3f3b40=_0x3f3b40||0xc8;return function(_0x5245cf){if(_0x5245cf){return _0x31c39c[_0x2529('0x17')](_0x3f3b40)[_0x2529('0x19')](_0x5245cf);}};}function respondWithFilteredResult(_0x301eec,_0x19e4bf){return function(_0x1cc716){if(_0x1cc716){var _0x2598a1=_0x1cc716[_0x2529('0x1a')],_0x1a1ccc=_0x19e4bf['offset'],_0xf10dfb=_0x19e4bf[_0x2529('0x1b')]+_0x19e4bf[_0x2529('0x1c')],_0x574975;if(_0xf10dfb>=_0x2598a1){_0xf10dfb=_0x2598a1;_0x574975=0xc8;}else{_0x574975=0xce;}_0x301eec[_0x2529('0x17')](_0x574975);return _0x301eec['set']('Content-Range',_0x1a1ccc+'-'+_0xf10dfb+'/'+_0x2598a1)[_0x2529('0x19')](_0x1cc716);}return null;};}function patchUpdates(_0x3e0be5){return function(_0x41e530){try{jsonpatch[_0x2529('0x1d')](_0x41e530,_0x3e0be5,!![]);}catch(_0x2a1a94){return BPromise['reject'](_0x2a1a94);}return _0x41e530[_0x2529('0x1e')]();};}function saveUpdates(_0x34aafd,_0x1ca15f){return function(_0xeff5a6){if(_0xeff5a6){return _0xeff5a6['update'](_0x34aafd)[_0x2529('0x1f')](function(_0x40f2bc){return _0x40f2bc;});}return null;};}function removeEntity(_0x87a9da,_0x5b4760){return function(_0x3d5d17){if(_0x3d5d17){return _0x3d5d17[_0x2529('0x20')]()[_0x2529('0x1f')](function(){var _0x25d3c1=_0x3d5d17['get']({'plain':!![]});var _0x2736f6=_0x2529('0x21');return db[_0x2529('0x22')][_0x2529('0x20')]({'where':{'type':_0x2736f6,'resourceId':_0x25d3c1['id']}})[_0x2529('0x1f')](function(){return _0x3d5d17;});})[_0x2529('0x1f')](function(){_0x87a9da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x856e50,_0x40f42b){return function(_0xbd829f){if(!_0xbd829f){_0x856e50[_0x2529('0x16')](0x194);}return _0xbd829f;};}function handleError(_0x24418a,_0x2a8371){_0x2a8371=_0x2a8371||0x1f4;return function(_0x22ceec){logger[_0x2529('0x23')](_0x22ceec[_0x2529('0x24')]);if(_0x22ceec[_0x2529('0x25')]){delete _0x22ceec['name'];}_0x24418a[_0x2529('0x17')](_0x2a8371)[_0x2529('0x26')](_0x22ceec);};}exports['index']=function(_0x1822ce,_0x3c46c6){var _0x5bea2d={},_0x17bcbd={},_0x1d7e98={'count':0x0,'rows':[]};var _0x577c5f=_[_0x2529('0x27')](db[_0x2529('0x28')]['rawAttributes'],function(_0x96bd62){return{'name':_0x96bd62[_0x2529('0x29')],'type':_0x96bd62[_0x2529('0x2a')][_0x2529('0x2b')]};});_0x17bcbd[_0x2529('0x2c')]=_['map'](_0x577c5f,_0x2529('0x25'));_0x17bcbd[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1822ce[_0x2529('0x2d')]);_0x17bcbd[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x17bcbd[_0x2529('0x2c')],_0x17bcbd['query']);_0x5bea2d['attributes']=_[_0x2529('0x30')](_0x17bcbd['model'],qs[_0x2529('0x31')](_0x1822ce['query']['fields']));_0x5bea2d['attributes']=_0x5bea2d[_0x2529('0x32')][_0x2529('0x33')]?_0x5bea2d[_0x2529('0x32')]:_0x17bcbd['model'];if(!_0x1822ce[_0x2529('0x2d')]['hasOwnProperty']('nolimit')){_0x5bea2d['limit']=qs[_0x2529('0x1c')](_0x1822ce[_0x2529('0x2d')][_0x2529('0x1c')]);_0x5bea2d[_0x2529('0x1b')]=qs[_0x2529('0x1b')](_0x1822ce[_0x2529('0x2d')][_0x2529('0x1b')]);}_0x5bea2d[_0x2529('0x34')]=qs[_0x2529('0x35')](_0x1822ce[_0x2529('0x2d')][_0x2529('0x35')]);_0x5bea2d[_0x2529('0x36')]=qs[_0x2529('0x2f')](_['pick'](_0x1822ce['query'],_0x17bcbd[_0x2529('0x2f')]));if(_0x1822ce[_0x2529('0x2d')]['filter']){_0x5bea2d[_0x2529('0x36')]=_[_0x2529('0x37')](_0x5bea2d[_0x2529('0x36')],{'$or':_[_0x2529('0x27')](_0x577c5f,function(_0xaa3403){if(_0xaa3403[_0x2529('0x2a')]!==_0x2529('0x38')){var _0x5cfbe5={};_0x5cfbe5[_0xaa3403[_0x2529('0x25')]]={'$like':'%'+_0x1822ce[_0x2529('0x2d')][_0x2529('0x39')]+'%'};return _0x5cfbe5;}})});}_0x5bea2d=_['merge']({},_0x5bea2d,_0x1822ce[_0x2529('0x3a')]);var _0x3a3127={'where':_0x5bea2d[_0x2529('0x36')]};return db[_0x2529('0x28')][_0x2529('0x1a')](_0x3a3127)[_0x2529('0x1f')](function(_0x7ff409){_0x1d7e98[_0x2529('0x1a')]=_0x7ff409;if(_0x1822ce[_0x2529('0x2d')]['includeAll']){_0x5bea2d[_0x2529('0x3b')]=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3c')](_0x5bea2d);})[_0x2529('0x1f')](function(_0x99ffb){_0x1d7e98[_0x2529('0x3d')]=_0x99ffb;return _0x1d7e98;})[_0x2529('0x1f')](respondWithFilteredResult(_0x3c46c6,_0x5bea2d))['catch'](handleError(_0x3c46c6,null));};exports[_0x2529('0x3e')]=function(_0x33a13e,_0x3f76e8){var _0x2aaecb={'raw':!![],'where':{'id':_0x33a13e['params']['id']}},_0x2c3c19={};_0x2c3c19[_0x2529('0x2c')]=_[_0x2529('0x2e')](db[_0x2529('0x28')][_0x2529('0x3f')]);_0x2c3c19[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x33a13e['query']);_0x2c3c19['filters']=_['intersection'](_0x2c3c19['model'],_0x2c3c19[_0x2529('0x2d')]);_0x2aaecb['attributes']=_[_0x2529('0x30')](_0x2c3c19[_0x2529('0x2c')],qs[_0x2529('0x31')](_0x33a13e[_0x2529('0x2d')][_0x2529('0x31')]));_0x2aaecb['attributes']=_0x2aaecb[_0x2529('0x32')]['length']?_0x2aaecb[_0x2529('0x32')]:_0x2c3c19['model'];if(_0x33a13e[_0x2529('0x2d')]['includeAll']){_0x2aaecb[_0x2529('0x3b')]=[{'all':!![]}];}_0x2aaecb=_[_0x2529('0x37')]({},_0x2aaecb,_0x33a13e['options']);return db[_0x2529('0x28')]['find'](_0x2aaecb)[_0x2529('0x1f')](handleEntityNotFound(_0x3f76e8,null))[_0x2529('0x1f')](respondWithResult(_0x3f76e8,null))[_0x2529('0x40')](handleError(_0x3f76e8,null));};exports[_0x2529('0x41')]=function(_0xdc4bef,_0x15ca15){return db[_0x2529('0x28')][_0x2529('0x41')](_0xdc4bef[_0x2529('0x42')],{})['then'](function(_0x47d7e4){var _0x5e72d1=_0xdc4bef[_0x2529('0x43')][_0x2529('0x44')]({'plain':!![]});if(!_0x5e72d1)throw new Error(_0x2529('0x45'));if(_0x5e72d1['role']==='user'){var _0x21bab1=_0x47d7e4['get']({'plain':!![]});var _0x2e5bfc=_0x2529('0x21');return db[_0x2529('0x46')][_0x2529('0x47')]({'where':{'name':_0x2e5bfc,'userProfileId':_0x5e72d1[_0x2529('0x48')]},'raw':!![]})[_0x2529('0x1f')](function(_0x4583ba){if(_0x4583ba&&_0x4583ba[_0x2529('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x21bab1[_0x2529('0x25')],'resourceId':_0x21bab1['id'],'type':_0x4583ba[_0x2529('0x25')],'sectionId':_0x4583ba['id']},{})[_0x2529('0x1f')](function(){return _0x47d7e4;});}else{return _0x47d7e4;}})[_0x2529('0x40')](function(_0x1f76d3){logger[_0x2529('0x23')](_0x2529('0x4a'),_0x1f76d3);throw _0x1f76d3;});}return _0x47d7e4;})[_0x2529('0x1f')](respondWithResult(_0x15ca15,0xc9))[_0x2529('0x40')](handleError(_0x15ca15,null));};exports[_0x2529('0x4b')]=function(_0x293dfd,_0x5f3cf7){if(_0x293dfd['body']['id']){delete _0x293dfd[_0x2529('0x42')]['id'];}return db[_0x2529('0x28')]['find']({'where':{'id':_0x293dfd[_0x2529('0x4c')]['id']}})[_0x2529('0x1f')](handleEntityNotFound(_0x5f3cf7,null))['then'](saveUpdates(_0x293dfd[_0x2529('0x42')],null))[_0x2529('0x1f')](respondWithResult(_0x5f3cf7,null))[_0x2529('0x40')](handleError(_0x5f3cf7,null));};exports[_0x2529('0x20')]=function(_0x203700,_0x166926){return db[_0x2529('0x28')][_0x2529('0x47')]({'where':{'id':_0x203700['params']['id']}})[_0x2529('0x1f')](handleEntityNotFound(_0x166926,null))['then'](removeEntity(_0x166926,null))[_0x2529('0x40')](handleError(_0x166926,null));}; \ No newline at end of file +var _0xca9e=['path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','Content-Range','apply','save','then','destroy','Dispositions','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','Disposition','count','includeAll','findAll','rows','catch','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x140202,_0x4245c7){var _0x3037c2=function(_0x525d19){while(--_0x525d19){_0x140202['push'](_0x140202['shift']());}};_0x3037c2(++_0x4245c7);}(_0xca9e,0x136));var _0xeca9=function(_0x1d207b,_0x2bdc82){_0x1d207b=_0x1d207b-0x0;var _0x1c3c16=_0xca9e[_0x1d207b];return _0x1c3c16;};'use strict';var pdf=require(_0xeca9('0x0'));var emlformat=require(_0xeca9('0x1'));var rimraf=require(_0xeca9('0x2'));var zipdir=require(_0xeca9('0x3'));var jsonpatch=require(_0xeca9('0x4'));var rp=require(_0xeca9('0x5'));var moment=require(_0xeca9('0x6'));var BPromise=require(_0xeca9('0x7'));var Mustache=require(_0xeca9('0x8'));var util=require(_0xeca9('0x9'));var path=require(_0xeca9('0xa'));var sox=require(_0xeca9('0xb'));var csv=require(_0xeca9('0xc'));var ejs=require(_0xeca9('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xeca9('0xe'));var crypto=require(_0xeca9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeca9('0xc'));var querystring=require(_0xeca9('0x10'));var Papa=require(_0xeca9('0x11'));var Redis=require('ioredis');var authService=require(_0xeca9('0x12'));var qs=require(_0xeca9('0x13'));var as=require(_0xeca9('0x14'));var hardwareService=require(_0xeca9('0x15'));var logger=require(_0xeca9('0x16'))(_0xeca9('0x17'));var utils=require('../../config/utils');var config=require(_0xeca9('0x18'));var db=require(_0xeca9('0x19'))['db'];function respondWithStatusCode(_0x4f8839,_0x27ca6f){_0x27ca6f=_0x27ca6f||0xcc;return function(_0x4b2ae1){if(_0x4b2ae1){return _0x4f8839[_0xeca9('0x1a')](_0x27ca6f);}return _0x4f8839[_0xeca9('0x1b')](_0x27ca6f)['end']();};}function respondWithResult(_0x3e9377,_0x384ae2){_0x384ae2=_0x384ae2||0xc8;return function(_0x1ba9e9){if(_0x1ba9e9){return _0x3e9377['status'](_0x384ae2)[_0xeca9('0x1c')](_0x1ba9e9);}};}function respondWithFilteredResult(_0x4422a6,_0x910814){return function(_0x6e9fd4){if(_0x6e9fd4){var _0x551393=_0x6e9fd4['count'],_0x520411=_0x910814[_0xeca9('0x1d')],_0x964e05=_0x910814[_0xeca9('0x1d')]+_0x910814['limit'],_0x77cb;if(_0x964e05>=_0x551393){_0x964e05=_0x551393;_0x77cb=0xc8;}else{_0x77cb=0xce;}_0x4422a6['status'](_0x77cb);return _0x4422a6['set'](_0xeca9('0x1e'),_0x520411+'-'+_0x964e05+'/'+_0x551393)[_0xeca9('0x1c')](_0x6e9fd4);}return null;};}function patchUpdates(_0x3525ee){return function(_0x5dde5f){try{jsonpatch[_0xeca9('0x1f')](_0x5dde5f,_0x3525ee,!![]);}catch(_0x5a5c52){return BPromise['reject'](_0x5a5c52);}return _0x5dde5f[_0xeca9('0x20')]();};}function saveUpdates(_0x5df8e9,_0x31720b){return function(_0x1c4dd6){if(_0x1c4dd6){return _0x1c4dd6['update'](_0x5df8e9)[_0xeca9('0x21')](function(_0x356321){return _0x356321;});}return null;};}function removeEntity(_0x55cd76,_0x3647ed){return function(_0x5279d0){if(_0x5279d0){return _0x5279d0[_0xeca9('0x22')]()[_0xeca9('0x21')](function(){var _0x1da959=_0x5279d0['get']({'plain':!![]});var _0x3fcfb8=_0xeca9('0x23');return db['UserProfileResource'][_0xeca9('0x22')]({'where':{'type':_0x3fcfb8,'resourceId':_0x1da959['id']}})[_0xeca9('0x21')](function(){return _0x5279d0;});})[_0xeca9('0x21')](function(){_0x55cd76[_0xeca9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32699b,_0x57e190){return function(_0x278591){if(!_0x278591){_0x32699b[_0xeca9('0x1a')](0x194);}return _0x278591;};}function handleError(_0x1702fb,_0x3e41df){_0x3e41df=_0x3e41df||0x1f4;return function(_0x25eac6){logger[_0xeca9('0x24')](_0x25eac6[_0xeca9('0x25')]);if(_0x25eac6[_0xeca9('0x26')]){delete _0x25eac6[_0xeca9('0x26')];}_0x1702fb[_0xeca9('0x1b')](_0x3e41df)[_0xeca9('0x27')](_0x25eac6);};}exports[_0xeca9('0x28')]=function(_0x424f7b,_0x1436d0){var _0x8d9a8d={},_0x4910a3={},_0x4db3e2={'count':0x0,'rows':[]};var _0x4c9b32=_[_0xeca9('0x29')](db['Disposition'][_0xeca9('0x2a')],function(_0x1993ba){return{'name':_0x1993ba[_0xeca9('0x2b')],'type':_0x1993ba[_0xeca9('0x2c')][_0xeca9('0x2d')]};});_0x4910a3[_0xeca9('0x2e')]=_['map'](_0x4c9b32,_0xeca9('0x26'));_0x4910a3['query']=_[_0xeca9('0x2f')](_0x424f7b[_0xeca9('0x30')]);_0x4910a3[_0xeca9('0x31')]=_['intersection'](_0x4910a3[_0xeca9('0x2e')],_0x4910a3[_0xeca9('0x30')]);_0x8d9a8d[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x4910a3['model'],qs[_0xeca9('0x34')](_0x424f7b['query'][_0xeca9('0x34')]));_0x8d9a8d[_0xeca9('0x32')]=_0x8d9a8d[_0xeca9('0x32')][_0xeca9('0x35')]?_0x8d9a8d[_0xeca9('0x32')]:_0x4910a3[_0xeca9('0x2e')];if(!_0x424f7b['query'][_0xeca9('0x36')](_0xeca9('0x37'))){_0x8d9a8d[_0xeca9('0x38')]=qs[_0xeca9('0x38')](_0x424f7b[_0xeca9('0x30')][_0xeca9('0x38')]);_0x8d9a8d[_0xeca9('0x1d')]=qs['offset'](_0x424f7b[_0xeca9('0x30')][_0xeca9('0x1d')]);}_0x8d9a8d[_0xeca9('0x39')]=qs[_0xeca9('0x3a')](_0x424f7b[_0xeca9('0x30')][_0xeca9('0x3a')]);_0x8d9a8d['where']=qs[_0xeca9('0x31')](_['pick'](_0x424f7b[_0xeca9('0x30')],_0x4910a3['filters']));if(_0x424f7b[_0xeca9('0x30')][_0xeca9('0x3b')]){_0x8d9a8d['where']=_[_0xeca9('0x3c')](_0x8d9a8d['where'],{'$or':_[_0xeca9('0x29')](_0x4c9b32,function(_0x5ac67c){if(_0x5ac67c[_0xeca9('0x2c')]!=='VIRTUAL'){var _0x1bab33={};_0x1bab33[_0x5ac67c[_0xeca9('0x26')]]={'$like':'%'+_0x424f7b['query'][_0xeca9('0x3b')]+'%'};return _0x1bab33;}})});}_0x8d9a8d=_[_0xeca9('0x3c')]({},_0x8d9a8d,_0x424f7b['options']);var _0x2e2496={'where':_0x8d9a8d[_0xeca9('0x3d')]};return db[_0xeca9('0x3e')][_0xeca9('0x3f')](_0x2e2496)[_0xeca9('0x21')](function(_0x2d72e3){_0x4db3e2[_0xeca9('0x3f')]=_0x2d72e3;if(_0x424f7b[_0xeca9('0x30')][_0xeca9('0x40')]){_0x8d9a8d['include']=[{'all':!![]}];}return db[_0xeca9('0x3e')][_0xeca9('0x41')](_0x8d9a8d);})[_0xeca9('0x21')](function(_0x35ac2f){_0x4db3e2[_0xeca9('0x42')]=_0x35ac2f;return _0x4db3e2;})[_0xeca9('0x21')](respondWithFilteredResult(_0x1436d0,_0x8d9a8d))[_0xeca9('0x43')](handleError(_0x1436d0,null));};exports['show']=function(_0x1d3338,_0x388943){var _0x188ebc={'raw':!![],'where':{'id':_0x1d3338[_0xeca9('0x44')]['id']}},_0x1d40a7={};_0x1d40a7['model']=_[_0xeca9('0x2f')](db[_0xeca9('0x3e')][_0xeca9('0x2a')]);_0x1d40a7[_0xeca9('0x30')]=_['keys'](_0x1d3338[_0xeca9('0x30')]);_0x1d40a7[_0xeca9('0x31')]=_['intersection'](_0x1d40a7[_0xeca9('0x2e')],_0x1d40a7[_0xeca9('0x30')]);_0x188ebc[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x1d40a7[_0xeca9('0x2e')],qs[_0xeca9('0x34')](_0x1d3338[_0xeca9('0x30')][_0xeca9('0x34')]));_0x188ebc[_0xeca9('0x32')]=_0x188ebc[_0xeca9('0x32')][_0xeca9('0x35')]?_0x188ebc[_0xeca9('0x32')]:_0x1d40a7[_0xeca9('0x2e')];if(_0x1d3338[_0xeca9('0x30')][_0xeca9('0x40')]){_0x188ebc['include']=[{'all':!![]}];}_0x188ebc=_[_0xeca9('0x3c')]({},_0x188ebc,_0x1d3338[_0xeca9('0x45')]);return db[_0xeca9('0x3e')][_0xeca9('0x46')](_0x188ebc)['then'](handleEntityNotFound(_0x388943,null))[_0xeca9('0x21')](respondWithResult(_0x388943,null))[_0xeca9('0x43')](handleError(_0x388943,null));};exports['create']=function(_0x5e6dc2,_0x3edca5){return db[_0xeca9('0x3e')][_0xeca9('0x47')](_0x5e6dc2[_0xeca9('0x48')],{})['then'](function(_0x2da2c2){var _0xa4faf9=_0x5e6dc2[_0xeca9('0x49')][_0xeca9('0x4a')]({'plain':!![]});if(!_0xa4faf9)throw new Error(_0xeca9('0x4b'));if(_0xa4faf9[_0xeca9('0x4c')]===_0xeca9('0x49')){var _0x44d4b7=_0x2da2c2[_0xeca9('0x4a')]({'plain':!![]});var _0x5cb943='Dispositions';return db[_0xeca9('0x4d')][_0xeca9('0x46')]({'where':{'name':_0x5cb943,'userProfileId':_0xa4faf9['userProfileId']},'raw':!![]})[_0xeca9('0x21')](function(_0x315f54){if(_0x315f54&&_0x315f54[_0xeca9('0x4e')]===0x0){return db[_0xeca9('0x4f')][_0xeca9('0x47')]({'name':_0x44d4b7[_0xeca9('0x26')],'resourceId':_0x44d4b7['id'],'type':_0x315f54[_0xeca9('0x26')],'sectionId':_0x315f54['id']},{})[_0xeca9('0x21')](function(){return _0x2da2c2;});}else{return _0x2da2c2;}})[_0xeca9('0x43')](function(_0x56a212){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56a212);throw _0x56a212;});}return _0x2da2c2;})['then'](respondWithResult(_0x3edca5,0xc9))[_0xeca9('0x43')](handleError(_0x3edca5,null));};exports['update']=function(_0x940aaf,_0x2df098){if(_0x940aaf['body']['id']){delete _0x940aaf[_0xeca9('0x48')]['id'];}return db[_0xeca9('0x3e')][_0xeca9('0x46')]({'where':{'id':_0x940aaf['params']['id']}})['then'](handleEntityNotFound(_0x2df098,null))[_0xeca9('0x21')](saveUpdates(_0x940aaf[_0xeca9('0x48')],null))[_0xeca9('0x21')](respondWithResult(_0x2df098,null))[_0xeca9('0x43')](handleError(_0x2df098,null));};exports['destroy']=function(_0x282925,_0x2c5cb4){return db[_0xeca9('0x3e')][_0xeca9('0x46')]({'where':{'id':_0x282925[_0xeca9('0x44')]['id']}})[_0xeca9('0x21')](handleEntityNotFound(_0x2c5cb4,null))[_0xeca9('0x21')](removeEntity(_0x2c5cb4,null))[_0xeca9('0x43')](handleError(_0x2c5cb4,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index a6a8266..7f02909 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 _0x3772=['name_openchannel','OpenchannelAccountId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name','ListId','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId'];(function(_0x2bae2d,_0x5bb4a7){var _0x1e7bdc=function(_0x240c79){while(--_0x240c79){_0x2bae2d['push'](_0x2bae2d['shift']());}};_0x1e7bdc(++_0x5bb4a7);}(_0x3772,0xb6));var _0x2377=function(_0x233282,_0x305444){_0x233282=_0x233282-0x0;var _0x387f16=_0x3772[_0x233282];return _0x387f16;};'use strict';var _=require('lodash');var util=require(_0x2377('0x0'));var logger=require(_0x2377('0x1'))('api');var moment=require(_0x2377('0x2'));var BPromise=require(_0x2377('0x3'));var rp=require(_0x2377('0x4'));var fs=require('fs');var path=require(_0x2377('0x5'));var rimraf=require(_0x2377('0x6'));var config=require(_0x2377('0x7'));var attributes=require(_0x2377('0x8'));module[_0x2377('0x9')]=function(_0x29a0a5,_0xdb0eed){return _0x29a0a5[_0x2377('0xa')]('Disposition',attributes,{'tableName':_0x2377('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x2377('0xc'),_0x2377('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0x2377('0xc'),_0x2377('0xe')]},{'unique':!![],'name':_0x2377('0xf'),'fields':['name',_0x2377('0x10')]},{'unique':!![],'name':'name_sms','fields':[_0x2377('0xc'),_0x2377('0x11')]},{'unique':!![],'name':'name_fax','fields':['name','FaxAccountId']},{'unique':!![],'name':_0x2377('0x12'),'fields':[_0x2377('0xc'),_0x2377('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4056=['util','api','bluebird','request-promise','path','rimraf','./disposition.attributes','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId'];(function(_0x4ae024,_0x2e3bfc){var _0x1b0f81=function(_0x52417d){while(--_0x52417d){_0x4ae024['push'](_0x4ae024['shift']());}};_0x1b0f81(++_0x2e3bfc);}(_0x4056,0x110));var _0x6405=function(_0x23ed02,_0x253118){_0x23ed02=_0x23ed02-0x0;var _0x189373=_0x4056[_0x23ed02];return _0x189373;};'use strict';var _=require('lodash');var util=require(_0x6405('0x0'));var logger=require('../../config/logger')(_0x6405('0x1'));var moment=require('moment');var BPromise=require(_0x6405('0x2'));var rp=require(_0x6405('0x3'));var fs=require('fs');var path=require(_0x6405('0x4'));var rimraf=require(_0x6405('0x5'));var config=require('../../config/environment');var attributes=require(_0x6405('0x6'));module['exports']=function(_0x26a655,_0x5ec35a){return _0x26a655['define']('Disposition',attributes,{'tableName':_0x6405('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6405('0x8'),'fields':[_0x6405('0x9'),'ListId']},{'unique':!![],'name':_0x6405('0xa'),'fields':[_0x6405('0x9'),_0x6405('0xb')]},{'unique':!![],'name':'name_mail','fields':[_0x6405('0x9'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x6405('0x9'),_0x6405('0xc')]},{'unique':!![],'name':'name_fax','fields':[_0x6405('0x9'),_0x6405('0xd')]},{'unique':!![],'name':_0x6405('0xe'),'fields':['name',_0x6405('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index aa31f57..64934e8 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 _0xa1ee=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Disposition,\x20%s,\x20%s','message','catch'];(function(_0x2c921c,_0x3c6a85){var _0x440bf2=function(_0x4db0df){while(--_0x4db0df){_0x2c921c['push'](_0x2c921c['shift']());}};_0x440bf2(++_0x3c6a85);}(_0xa1ee,0x9a));var _0xea1e=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0xa1ee[_0x3da832];return _0xe602f2;};'use strict';var _=require(_0xea1e('0x0'));var util=require(_0xea1e('0x1'));var moment=require(_0xea1e('0x2'));var BPromise=require('bluebird');var rs=require(_0xea1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea1e('0x4'))['db'];var utils=require(_0xea1e('0x5'));var logger=require('../../config/logger')(_0xea1e('0x6'));var config=require(_0xea1e('0x7'));var jayson=require(_0xea1e('0x8'));var client=jayson[_0xea1e('0x9')][_0xea1e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d950,_0x13ba78,_0xa381ba){return new BPromise(function(_0x2021da,_0x2dcbe9){return client[_0xea1e('0xb')](_0x30d950,_0xa381ba)[_0xea1e('0xc')](function(_0x1b6acc){logger[_0xea1e('0xd')]('Disposition,\x20%s,\x20%s',_0x13ba78,_0xea1e('0xe'));logger[_0xea1e('0xf')]('Disposition,\x20%s,\x20%s,\x20%s',_0x13ba78,_0xea1e('0xe'),JSON[_0xea1e('0x10')](_0x1b6acc));if(_0x1b6acc[_0xea1e('0x11')]){if(_0x1b6acc[_0xea1e('0x11')][_0xea1e('0x12')]===0x1f4){logger[_0xea1e('0x11')](_0xea1e('0x13'),_0x13ba78,_0x1b6acc[_0xea1e('0x11')][_0xea1e('0x14')]);return _0x2dcbe9(_0x1b6acc[_0xea1e('0x11')][_0xea1e('0x14')]);}logger[_0xea1e('0x11')]('Disposition,\x20%s,\x20%s',_0x13ba78,_0x1b6acc[_0xea1e('0x11')][_0xea1e('0x14')]);return _0x2021da(_0x1b6acc[_0xea1e('0x11')][_0xea1e('0x14')]);}else{logger['info'](_0xea1e('0x13'),_0x13ba78,_0xea1e('0xe'));_0x2021da(_0x1b6acc['result']['message']);}})[_0xea1e('0x15')](function(_0x5e2533){logger[_0xea1e('0x11')](_0xea1e('0x13'),_0x13ba78,_0x5e2533);_0x2dcbe9(_0x5e2533);});});} \ No newline at end of file +var _0x12be=['debug','Disposition,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Disposition,\x20%s,\x20%s','request\x20sent'];(function(_0x50dc4e,_0xc4040b){var _0x429e20=function(_0x416bb9){while(--_0x416bb9){_0x50dc4e['push'](_0x50dc4e['shift']());}};_0x429e20(++_0xc4040b);}(_0x12be,0x14a));var _0xe12b=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x12be[_0x1ad926];return _0x1b81dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe12b('0x0'));var BPromise=require(_0xe12b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe12b('0x2'));var db=require(_0xe12b('0x3'))['db'];var utils=require(_0xe12b('0x4'));var logger=require(_0xe12b('0x5'))(_0xe12b('0x6'));var config=require(_0xe12b('0x7'));var jayson=require(_0xe12b('0x8'));var client=jayson[_0xe12b('0x9')][_0xe12b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143333,_0x29e477,_0x436756){return new BPromise(function(_0x456b57,_0x161a3d){return client[_0xe12b('0xb')](_0x143333,_0x436756)[_0xe12b('0xc')](function(_0x55f132){logger['info'](_0xe12b('0xd'),_0x29e477,_0xe12b('0xe'));logger[_0xe12b('0xf')](_0xe12b('0x10'),_0x29e477,'request\x20sent',JSON['stringify'](_0x55f132));if(_0x55f132[_0xe12b('0x11')]){if(_0x55f132[_0xe12b('0x11')][_0xe12b('0x12')]===0x1f4){logger[_0xe12b('0x11')]('Disposition,\x20%s,\x20%s',_0x29e477,_0x55f132[_0xe12b('0x11')][_0xe12b('0x13')]);return _0x161a3d(_0x55f132[_0xe12b('0x11')][_0xe12b('0x13')]);}logger[_0xe12b('0x11')](_0xe12b('0xd'),_0x29e477,_0x55f132['error'][_0xe12b('0x13')]);return _0x456b57(_0x55f132[_0xe12b('0x11')][_0xe12b('0x13')]);}else{logger[_0xe12b('0x14')](_0xe12b('0xd'),_0x29e477,_0xe12b('0xe'));_0x456b57(_0x55f132[_0xe12b('0x15')][_0xe12b('0x13')]);}})[_0xe12b('0x16')](function(_0x7a660){logger[_0xe12b('0x11')]('Disposition,\x20%s,\x20%s',_0x29e477,_0x7a660);_0x161a3d(_0x7a660);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 19ff3ca..6317547 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 _0xee9c=['/:id','create','update','delete','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x430095,_0x122722){var _0x115f8a=function(_0x5af765){while(--_0x5af765){_0x430095['push'](_0x430095['shift']());}};_0x115f8a(++_0x122722);}(_0xee9c,0x1e6));var _0xcee9=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xee9c[_0x28aea5];return _0x6a55f9;};'use strict';var multer=require('multer');var util=require(_0xcee9('0x0'));var path=require(_0xcee9('0x1'));var timeout=require(_0xcee9('0x2'));var express=require(_0xcee9('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xcee9('0x4'));var config=require(_0xcee9('0x5'));var controller=require('./disposition.controller');router['get']('/',auth[_0xcee9('0x6')](),controller['index']);router[_0xcee9('0x7')](_0xcee9('0x8'),auth[_0xcee9('0x6')](),controller['show']);router['post']('/',auth[_0xcee9('0x6')](),controller[_0xcee9('0x9')]);router['put'](_0xcee9('0x8'),auth[_0xcee9('0x6')](),controller[_0xcee9('0xa')]);router[_0xcee9('0xb')](_0xcee9('0x8'),auth[_0xcee9('0x6')](),controller['destroy']);module[_0xcee9('0xc')]=router; \ No newline at end of file +var _0x47d6=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0xba4839,_0x575d37){var _0x1969c8=function(_0x23846f){while(--_0x23846f){_0xba4839['push'](_0xba4839['shift']());}};_0x1969c8(++_0x575d37);}(_0x47d6,0x13f));var _0x647d=function(_0x4f7073,_0x56a58e){_0x4f7073=_0x4f7073-0x0;var _0xecf5ae=_0x47d6[_0x4f7073];return _0xecf5ae;};'use strict';var multer=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var path=require(_0x647d('0x2'));var timeout=require(_0x647d('0x3'));var express=require(_0x647d('0x4'));var router=express[_0x647d('0x5')]();var auth=require(_0x647d('0x6'));var interaction=require(_0x647d('0x7'));var config=require(_0x647d('0x8'));var controller=require(_0x647d('0x9'));router[_0x647d('0xa')]('/',auth[_0x647d('0xb')](),controller[_0x647d('0xc')]);router[_0x647d('0xa')](_0x647d('0xd'),auth[_0x647d('0xb')](),controller['show']);router[_0x647d('0xe')]('/',auth[_0x647d('0xb')](),controller[_0x647d('0xf')]);router[_0x647d('0x10')](_0x647d('0xd'),auth[_0x647d('0xb')](),controller[_0x647d('0x11')]);router[_0x647d('0x12')](_0x647d('0xd'),auth[_0x647d('0xb')](),controller[_0x647d('0x13')]);module[_0x647d('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 8f06d49..91cf349 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 _0x66f2=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','4800','14400','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','INTEGER'];(function(_0x88af9c,_0xc968da){var _0x39a003=function(_0x10374c){while(--_0x10374c){_0x88af9c['push'](_0x88af9c['shift']());}};_0x39a003(++_0xc968da);}(_0x66f2,0x1ad));var _0x266f=function(_0xc989a3,_0x2ad1b0){_0xc989a3=_0xc989a3-0x0;var _0x24de1a=_0x66f2[_0xc989a3];return _0x24de1a;};'use strict';var Sequelize=require(_0x266f('0x0'));module[_0x266f('0x1')]={'name':{'type':Sequelize[_0x266f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x266f('0x2')]},'ecm':{'type':Sequelize[_0x266f('0x3')](_0x266f('0x4'),'no'),'defaultValue':_0x266f('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x266f('0x5')},'localstationid':{'type':Sequelize[_0x266f('0x2')],'unique':_0x266f('0x6')},'minrate':{'type':Sequelize[_0x266f('0x3')](_0x266f('0x7'),'4800',_0x266f('0x8'),_0x266f('0x9'),_0x266f('0xa'),'14400'),'defaultValue':_0x266f('0xb')},'maxrate':{'type':Sequelize[_0x266f('0x3')](_0x266f('0x7'),_0x266f('0xb'),_0x266f('0x8'),_0x266f('0x9'),'12000',_0x266f('0xc')),'defaultValue':_0x266f('0xc')},'modem':{'type':Sequelize[_0x266f('0x2')],'defaultValue':_0x266f('0xd')},'gateway':{'type':Sequelize[_0x266f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x266f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x266f('0x3')](_0x266f('0xe'),_0x266f('0xf'),_0x266f('0x10'),_0x266f('0x11')),'defaultValue':_0x266f('0xe')},'key':{'type':Sequelize[_0x266f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x266f('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x266f('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x266f('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x266f('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x266f('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x266f('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x266f('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x266f('0x14')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x266f('0x13')],'defaultValue':![],'comment':_0x266f('0x15'),'set':function(_0x5baaec){if(!_0x5baaec)this[_0x266f('0x16')](_0x266f('0x17'),null);this['setDataValue'](_0x266f('0x18'),_0x5baaec);}}}; \ No newline at end of file +var _0x6211=['14400','9600','12000','v17,v27,v29','INTEGER','IAX','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','4800','7200'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6211,0x11e));var _0x1621=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6211[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x1621('0x0'));module[_0x1621('0x1')]={'name':{'type':Sequelize[_0x1621('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1621('0x2')]},'ecm':{'type':Sequelize[_0x1621('0x3')](_0x1621('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x1621('0x2')],'defaultValue':_0x1621('0x5')},'localstationid':{'type':Sequelize[_0x1621('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x1621('0x3')]('2400',_0x1621('0x6'),_0x1621('0x7'),'9600','12000',_0x1621('0x8')),'defaultValue':_0x1621('0x6')},'maxrate':{'type':Sequelize[_0x1621('0x3')]('2400',_0x1621('0x6'),_0x1621('0x7'),_0x1621('0x9'),_0x1621('0xa'),_0x1621('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x1621('0x2')],'defaultValue':_0x1621('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x1621('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1621('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x1621('0xd'),'DADHI',_0x1621('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1621('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1621('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1621('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1621('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1621('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1621('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1621('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1621('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1621('0x10')],'defaultValue':![],'comment':_0x1621('0x11'),'set':function(_0x204a1f){if(!_0x204a1f)this[_0x1621('0x12')](_0x1621('0x13'),null);this[_0x1621('0x12')](_0x1621('0x14'),_0x204a1f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 4d8dfd1..93b1cf7 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 _0xd906=['addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','count','offset','limit','set','reject','save','update','destroy','get','FaxAccounts','stack','index','Pause','map','FaxAccount','rawAttributes','type','key','model','name','filters','intersection','query','attributes','fields','length','nolimit','sort','pick','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','filter','merge','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','Tags','color','tag','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','sequelize','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','Contact\x20not\x20found','spread','out','filename','ContactId','Messages','dataValues','SendFax','SendFaxRpc,\x20%s'];(function(_0x4140da,_0x237574){var _0x174438=function(_0x1c96c6){while(--_0x1c96c6){_0x4140da['push'](_0x4140da['shift']());}};_0x174438(++_0x237574);}(_0xd906,0x197));var _0x6d90=function(_0x554426,_0x2f4360){_0x554426=_0x554426-0x0;var _0x49ad51=_0xd906[_0x554426];return _0x49ad51;};'use strict';var pdf=require(_0x6d90('0x0'));var emlformat=require(_0x6d90('0x1'));var rimraf=require(_0x6d90('0x2'));var zipdir=require(_0x6d90('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d90('0x4'));var moment=require(_0x6d90('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6d90('0x6'));var path=require(_0x6d90('0x7'));var sox=require(_0x6d90('0x8'));var csv=require(_0x6d90('0x9'));var ejs=require(_0x6d90('0xa'));var fs=require('fs');var _=require(_0x6d90('0xb'));var squel=require(_0x6d90('0xc'));var crypto=require('crypto');var jsforce=require(_0x6d90('0xd'));var deskjs=require(_0x6d90('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6d90('0xf'));var Papa=require(_0x6d90('0x10'));var Redis=require(_0x6d90('0x11'));var authService=require(_0x6d90('0x12'));var qs=require(_0x6d90('0x13'));var as=require(_0x6d90('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6d90('0x15'));var utils=require(_0x6d90('0x16'));var config=require(_0x6d90('0x17'));var db=require(_0x6d90('0x18'))['db'];config['redis']=_[_0x6d90('0x19')](config[_0x6d90('0x1a')],{'host':_0x6d90('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d90('0x1a')]));require('./faxAccount.socket')[_0x6d90('0x1c')](socket);var jayson=require(_0x6d90('0x1d'));var client=jayson[_0x6d90('0x1e')][_0x6d90('0x1f')]({'port':0x232c});var client9002=jayson[_0x6d90('0x1e')][_0x6d90('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x4aa2eb,_0x2ddb4d,_0x3cca7d){if(_0x3cca7d){var _0xeb48fc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xeb48fc['test'](_0x2ddb4d)){return _0x4aa2eb;}else{throw new db[(_0x6d90('0x20'))][(_0x6d90('0x21'))](_0x6d90('0x22'));}}else{return _0x4aa2eb;}}function respondWithRpcPromise(_0x81be53,_0x503440,_0x4972db,_0x35e4eb){return new BPromise(function(_0x47a7e4,_0x36b322){var _0x5e857e=_0x35e4eb||client;return _0x5e857e[_0x6d90('0x23')](_0x81be53,_0x4972db)[_0x6d90('0x24')](function(_0x3a61f8){logger[_0x6d90('0x25')](_0x6d90('0x26'),_0x503440,_0x6d90('0x27'));logger['debug'](_0x6d90('0x28'),_0x503440,_0x6d90('0x27'),JSON[_0x6d90('0x29')](_0x3a61f8));if(_0x3a61f8['error']){if(_0x3a61f8[_0x6d90('0x2a')][_0x6d90('0x2b')]===0x1f4){logger[_0x6d90('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x503440,_0x3a61f8[_0x6d90('0x2a')][_0x6d90('0x2c')]);return _0x36b322(_0x3a61f8[_0x6d90('0x2a')][_0x6d90('0x2c')]);}logger[_0x6d90('0x2a')](_0x6d90('0x26'),_0x503440,_0x3a61f8[_0x6d90('0x2a')][_0x6d90('0x2c')]);return _0x47a7e4(_0x3a61f8[_0x6d90('0x2a')][_0x6d90('0x2c')]);}else{logger[_0x6d90('0x25')](_0x6d90('0x26'),_0x503440,_0x6d90('0x27'));_0x47a7e4(_0x3a61f8[_0x6d90('0x2d')][_0x6d90('0x2c')]);}})['catch'](function(_0x1561b4){logger['error'](_0x6d90('0x26'),_0x503440,_0x1561b4);_0x36b322(_0x1561b4);});});}function respondWithStatusCode(_0x4b2deb,_0x1b6d96){_0x1b6d96=_0x1b6d96||0xcc;return function(_0x5f31b4){if(_0x5f31b4){return _0x4b2deb[_0x6d90('0x2e')](_0x1b6d96);}return _0x4b2deb['status'](_0x1b6d96)[_0x6d90('0x2f')]();};}function respondWithResult(_0x295fa1,_0x2d9da6){_0x2d9da6=_0x2d9da6||0xc8;return function(_0x25f856){if(_0x25f856){return _0x295fa1[_0x6d90('0x30')](_0x2d9da6)[_0x6d90('0x31')](_0x25f856);}};}function respondWithFilteredResult(_0x5cd219,_0x476609){return function(_0x5d4c59){if(_0x5d4c59){var _0x268440=_0x5d4c59[_0x6d90('0x32')],_0x287a69=_0x476609[_0x6d90('0x33')],_0x4c63d2=_0x476609['offset']+_0x476609[_0x6d90('0x34')],_0x19efbb;if(_0x4c63d2>=_0x268440){_0x4c63d2=_0x268440;_0x19efbb=0xc8;}else{_0x19efbb=0xce;}_0x5cd219[_0x6d90('0x30')](_0x19efbb);return _0x5cd219[_0x6d90('0x35')]('Content-Range',_0x287a69+'-'+_0x4c63d2+'/'+_0x268440)['json'](_0x5d4c59);}return null;};}function patchUpdates(_0x46f507){return function(_0x552365){try{jsonpatch['apply'](_0x552365,_0x46f507,!![]);}catch(_0x4016c7){return BPromise[_0x6d90('0x36')](_0x4016c7);}return _0x552365[_0x6d90('0x37')]();};}function saveUpdates(_0x3b4855,_0x14d450){return function(_0x3fad98){if(_0x3fad98){return _0x3fad98[_0x6d90('0x38')](_0x3b4855)[_0x6d90('0x24')](function(_0x466616){return _0x466616;});}return null;};}function removeEntity(_0x51bba1,_0x3cbc38){return function(_0x21cc0f){if(_0x21cc0f){return _0x21cc0f[_0x6d90('0x39')]()[_0x6d90('0x24')](function(){var _0x2630a4=_0x21cc0f[_0x6d90('0x3a')]({'plain':!![]});var _0x23465f=_0x6d90('0x3b');return db['UserProfileResource'][_0x6d90('0x39')]({'where':{'type':_0x23465f,'resourceId':_0x2630a4['id']}})[_0x6d90('0x24')](function(){return _0x21cc0f;});})['then'](function(){_0x51bba1[_0x6d90('0x30')](0xcc)[_0x6d90('0x2f')]();});}};}function handleEntityNotFound(_0x265bf3,_0x113184){return function(_0x38b702){if(!_0x38b702){_0x265bf3[_0x6d90('0x2e')](0x194);}return _0x38b702;};}function handleError(_0x50f13f,_0x5ea608){_0x5ea608=_0x5ea608||0x1f4;return function(_0x559743){logger[_0x6d90('0x2a')](_0x559743[_0x6d90('0x3c')]);if(_0x559743['name']){delete _0x559743['name'];}_0x50f13f[_0x6d90('0x30')](_0x5ea608)['send'](_0x559743);};}exports[_0x6d90('0x3d')]=function(_0x1d0080,_0x5379f3){var _0x231862={'include':[{'model':db[_0x6d90('0x3e')],'as':'mandatoryDispositionPause'}]},_0x2a2cf7={},_0x28ddf2={'count':0x0,'rows':[]};var _0x21ea6b=_[_0x6d90('0x3f')](db[_0x6d90('0x40')][_0x6d90('0x41')],function(_0xd0371a){return{'name':_0xd0371a['fieldName'],'type':_0xd0371a[_0x6d90('0x42')][_0x6d90('0x43')]};});_0x2a2cf7[_0x6d90('0x44')]=_[_0x6d90('0x3f')](_0x21ea6b,_0x6d90('0x45'));_0x2a2cf7['query']=_['keys'](_0x1d0080['query']);_0x2a2cf7[_0x6d90('0x46')]=_[_0x6d90('0x47')](_0x2a2cf7[_0x6d90('0x44')],_0x2a2cf7[_0x6d90('0x48')]);_0x231862[_0x6d90('0x49')]=_[_0x6d90('0x47')](_0x2a2cf7['model'],qs[_0x6d90('0x4a')](_0x1d0080['query']['fields']));_0x231862['attributes']=_0x231862[_0x6d90('0x49')][_0x6d90('0x4b')]?_0x231862['attributes']:_0x2a2cf7['model'];if(!_0x1d0080[_0x6d90('0x48')]['hasOwnProperty'](_0x6d90('0x4c'))){_0x231862[_0x6d90('0x34')]=qs[_0x6d90('0x34')](_0x1d0080['query'][_0x6d90('0x34')]);_0x231862['offset']=qs[_0x6d90('0x33')](_0x1d0080[_0x6d90('0x48')][_0x6d90('0x33')]);}_0x231862['order']=qs[_0x6d90('0x4d')](_0x1d0080['query'][_0x6d90('0x4d')]);_0x231862['where']=qs[_0x6d90('0x46')](_[_0x6d90('0x4e')](_0x1d0080[_0x6d90('0x48')],_0x2a2cf7[_0x6d90('0x46')]));if(_0x1d0080[_0x6d90('0x48')]['filter']){_0x231862[_0x6d90('0x4f')]=_['merge'](_0x231862[_0x6d90('0x4f')],{'$or':_['map'](_0x21ea6b,function(_0x31b406){if(_0x31b406[_0x6d90('0x42')]!==_0x6d90('0x50')){var _0x2919b6={};_0x2919b6[_0x31b406[_0x6d90('0x45')]]={'$like':'%'+_0x1d0080[_0x6d90('0x48')]['filter']+'%'};return _0x2919b6;}})});}_0x231862=_['merge']({},_0x231862,_0x1d0080[_0x6d90('0x51')]);var _0x4bf629={'where':_0x231862[_0x6d90('0x4f')]};return db[_0x6d90('0x40')][_0x6d90('0x32')](_0x4bf629)['then'](function(_0x585cce){_0x28ddf2[_0x6d90('0x32')]=_0x585cce;if(_0x1d0080['query'][_0x6d90('0x52')]){_0x231862[_0x6d90('0x53')]=[{'all':!![]}];}return db[_0x6d90('0x40')][_0x6d90('0x54')](_0x231862);})[_0x6d90('0x24')](function(_0x1ac6b8){_0x28ddf2[_0x6d90('0x55')]=_0x1ac6b8;return _0x28ddf2;})[_0x6d90('0x24')](respondWithFilteredResult(_0x5379f3,_0x231862))[_0x6d90('0x56')](handleError(_0x5379f3,null));};exports[_0x6d90('0x57')]=function(_0x8004ba,_0x5ef3a8){var _0x4411f1={'raw':![],'where':{'id':_0x8004ba[_0x6d90('0x58')]['id']},'include':[{'model':db[_0x6d90('0x3e')],'as':_0x6d90('0x59')}]},_0x5b3250={};_0x5b3250[_0x6d90('0x44')]=_[_0x6d90('0x5a')](db[_0x6d90('0x40')][_0x6d90('0x41')]);_0x5b3250[_0x6d90('0x48')]=_[_0x6d90('0x5a')](_0x8004ba[_0x6d90('0x48')]);_0x5b3250[_0x6d90('0x46')]=_[_0x6d90('0x47')](_0x5b3250[_0x6d90('0x44')],_0x5b3250['query']);_0x4411f1['attributes']=_[_0x6d90('0x47')](_0x5b3250['model'],qs[_0x6d90('0x4a')](_0x8004ba['query'][_0x6d90('0x4a')]));_0x4411f1[_0x6d90('0x49')]=_0x4411f1[_0x6d90('0x49')][_0x6d90('0x4b')]?_0x4411f1[_0x6d90('0x49')]:_0x5b3250[_0x6d90('0x44')];if(_0x8004ba['query'][_0x6d90('0x52')]){_0x4411f1['include']=[{'all':!![]}];}_0x4411f1=_['merge']({},_0x4411f1,_0x8004ba[_0x6d90('0x51')]);return db[_0x6d90('0x40')][_0x6d90('0x5b')](_0x4411f1)[_0x6d90('0x24')](handleEntityNotFound(_0x5ef3a8,null))[_0x6d90('0x24')](respondWithResult(_0x5ef3a8,null))[_0x6d90('0x56')](handleError(_0x5ef3a8,null));};exports[_0x6d90('0x5c')]=function(_0x295a6b,_0x383d06){return db[_0x6d90('0x40')][_0x6d90('0x5c')](_0x295a6b[_0x6d90('0x5d')],{})[_0x6d90('0x24')](function(_0x3bf031){var _0x46ea79=_0x295a6b['user']['get']({'plain':!![]});if(!_0x46ea79)throw new Error(_0x6d90('0x5e'));if(_0x46ea79[_0x6d90('0x5f')]===_0x6d90('0x60')){var _0x2a409b=_0x3bf031['get']({'plain':!![]});var _0x2df517='FaxAccounts';return db[_0x6d90('0x61')]['find']({'where':{'name':_0x2df517,'userProfileId':_0x46ea79[_0x6d90('0x62')]},'raw':!![]})[_0x6d90('0x24')](function(_0x50fbf7){if(_0x50fbf7&&_0x50fbf7[_0x6d90('0x63')]===0x0){return db[_0x6d90('0x64')]['create']({'name':_0x2a409b[_0x6d90('0x45')],'resourceId':_0x2a409b['id'],'type':_0x50fbf7[_0x6d90('0x45')],'sectionId':_0x50fbf7['id']},{})[_0x6d90('0x24')](function(){return _0x3bf031;});}else{return _0x3bf031;}})[_0x6d90('0x56')](function(_0x1376a8){logger['error'](_0x6d90('0x65'),_0x1376a8);throw _0x1376a8;});}return _0x3bf031;})[_0x6d90('0x24')](respondWithResult(_0x383d06,0xc9))[_0x6d90('0x56')](handleError(_0x383d06,null));};exports[_0x6d90('0x38')]=function(_0x1b228b,_0x48495d){if(_0x1b228b['body']['id']){delete _0x1b228b[_0x6d90('0x5d')]['id'];}return db[_0x6d90('0x40')]['find']({'where':{'id':_0x1b228b['params']['id']},'include':[{'model':db[_0x6d90('0x3e')],'as':_0x6d90('0x59')}]})[_0x6d90('0x24')](handleEntityNotFound(_0x48495d,null))[_0x6d90('0x24')](saveUpdates(_0x1b228b[_0x6d90('0x5d')],null))[_0x6d90('0x24')](respondWithResult(_0x48495d,null))[_0x6d90('0x56')](handleError(_0x48495d,null));};exports[_0x6d90('0x39')]=function(_0x1f2f4,_0x311ca5){return db[_0x6d90('0x40')][_0x6d90('0x5b')]({'where':{'id':_0x1f2f4[_0x6d90('0x58')]['id']}})[_0x6d90('0x24')](handleEntityNotFound(_0x311ca5,null))[_0x6d90('0x24')](removeEntity(_0x311ca5,null))[_0x6d90('0x56')](handleError(_0x311ca5,null));};exports[_0x6d90('0x66')]=function(_0x260d96,_0x2f5e0a){return db[_0x6d90('0x40')][_0x6d90('0x66')]()['then'](respondWithResult(_0x2f5e0a,null))['catch'](handleError(_0x2f5e0a,null));};exports['addDisposition']=function(_0x1965eb,_0x351fef,_0x30224c){if(_0x1965eb['body']['id']){delete _0x1965eb[_0x6d90('0x5d')]['id'];}return db['FaxAccount'][_0x6d90('0x5b')]({'where':{'id':_0x1965eb[_0x6d90('0x58')]['id']}})['then'](handleEntityNotFound(_0x351fef,null))[_0x6d90('0x24')](function(_0x56db70){if(_0x56db70){_0x1965eb[_0x6d90('0x5d')][_0x6d90('0x67')]=_0x56db70['id'];return db[_0x6d90('0x68')][_0x6d90('0x5c')](_0x1965eb['body']);}})[_0x6d90('0x24')](respondWithResult(_0x351fef,null))['catch'](handleError(_0x351fef,null));};exports[_0x6d90('0x69')]=function(_0x61f23e,_0x35f3b3,_0x22026d){var _0x3e3308={'raw':![],'where':{}};var _0x344c1f={};var _0x47b7d4={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6d90('0x6a')]({'where':{'id':_0x61f23e[_0x6d90('0x58')]['id']}})[_0x6d90('0x24')](handleEntityNotFound(_0x35f3b3,null))[_0x6d90('0x24')](function(_0x2630f3){if(_0x2630f3){_0x344c1f[_0x6d90('0x44')]=_[_0x6d90('0x5a')](db[_0x6d90('0x68')]['rawAttributes']);_0x344c1f['query']=_[_0x6d90('0x5a')](_0x61f23e[_0x6d90('0x48')]);_0x344c1f['filters']=_[_0x6d90('0x47')](_0x344c1f['model'],_0x344c1f[_0x6d90('0x48')]);_0x3e3308[_0x6d90('0x49')]=_[_0x6d90('0x47')](_0x344c1f[_0x6d90('0x44')],qs[_0x6d90('0x4a')](_0x61f23e[_0x6d90('0x48')][_0x6d90('0x4a')]));_0x3e3308[_0x6d90('0x49')]=_0x3e3308[_0x6d90('0x49')][_0x6d90('0x4b')]?_0x3e3308[_0x6d90('0x49')]:_0x344c1f[_0x6d90('0x44')];if(!_0x61f23e['query'][_0x6d90('0x6b')]('nolimit')){_0x3e3308['limit']=qs[_0x6d90('0x34')](_0x61f23e[_0x6d90('0x48')][_0x6d90('0x34')]);_0x3e3308[_0x6d90('0x33')]=qs[_0x6d90('0x33')](_0x61f23e[_0x6d90('0x48')][_0x6d90('0x33')]);}_0x3e3308[_0x6d90('0x6c')]=qs[_0x6d90('0x4d')](_0x61f23e[_0x6d90('0x48')][_0x6d90('0x4d')]);_0x3e3308[_0x6d90('0x4f')]=qs[_0x6d90('0x46')](_[_0x6d90('0x4e')](_0x61f23e[_0x6d90('0x48')],_0x344c1f[_0x6d90('0x46')]));_0x3e3308[_0x6d90('0x4f')][_0x6d90('0x67')]=_0x2630f3['id'];if(_0x61f23e[_0x6d90('0x48')][_0x6d90('0x6d')]){_0x3e3308[_0x6d90('0x4f')]=_['merge'](_0x3e3308[_0x6d90('0x4f')],{'$or':_['map'](_0x3e3308[_0x6d90('0x49')],function(_0x2900c1){var _0x43f02a={};_0x43f02a[_0x2900c1]={'$like':'%'+_0x61f23e[_0x6d90('0x48')][_0x6d90('0x6d')]+'%'};return _0x43f02a;})});}_0x3e3308=_[_0x6d90('0x6e')]({},_0x3e3308,_0x61f23e[_0x6d90('0x51')]);return db[_0x6d90('0x68')][_0x6d90('0x32')]({'where':_0x3e3308['where']})[_0x6d90('0x24')](function(_0x279d93){_0x47b7d4[_0x6d90('0x32')]=_0x279d93;if(_0x61f23e[_0x6d90('0x48')][_0x6d90('0x52')]){_0x3e3308['include']=[{'all':!![]}];}return db[_0x6d90('0x68')]['findAll'](_0x3e3308);})['then'](function(_0x208017){_0x47b7d4['rows']=_0x208017;return _0x47b7d4;});}})[_0x6d90('0x24')](respondWithFilteredResult(_0x35f3b3,_0x3e3308))['catch'](handleError(_0x35f3b3,null));};exports[_0x6d90('0x6f')]=function(_0x3c0b44,_0xf2d78f,_0x974230){return db[_0x6d90('0x40')][_0x6d90('0x5b')]({'where':{'id':_0x3c0b44['params']['id']}})[_0x6d90('0x24')](handleEntityNotFound(_0xf2d78f,null))[_0x6d90('0x24')](function(_0x585183){if(_0x585183){return _0x585183[_0x6d90('0x6f')](_0x3c0b44[_0x6d90('0x48')][_0x6d90('0x70')]);}})[_0x6d90('0x24')](respondWithStatusCode(_0xf2d78f,null))['catch'](handleError(_0xf2d78f,null));};exports[_0x6d90('0x71')]=function(_0x4d90dc,_0x57b8c2,_0x54892f){if(_0x4d90dc[_0x6d90('0x5d')]['id']){delete _0x4d90dc[_0x6d90('0x5d')]['id'];}return db[_0x6d90('0x40')]['find']({'where':{'id':_0x4d90dc[_0x6d90('0x58')]['id']}})[_0x6d90('0x24')](handleEntityNotFound(_0x57b8c2,null))[_0x6d90('0x24')](function(_0x52ec7c){if(_0x52ec7c){_0x4d90dc['body'][_0x6d90('0x67')]=_0x52ec7c['id'];return db[_0x6d90('0x72')]['create'](_0x4d90dc[_0x6d90('0x5d')]);}})[_0x6d90('0x24')](respondWithResult(_0x57b8c2,null))[_0x6d90('0x56')](handleError(_0x57b8c2,null));};exports['getAnswers']=function(_0x58b8ed,_0x2ad354,_0x42bf33){var _0x1b5524={'raw':![],'where':{}};var _0xc38b91={};var _0x2b2e25={'count':0x0,'rows':[]};return db[_0x6d90('0x40')][_0x6d90('0x6a')]({'where':{'id':_0x58b8ed['params']['id']}})['then'](handleEntityNotFound(_0x2ad354,null))[_0x6d90('0x24')](function(_0x38b43b){if(_0x38b43b){_0xc38b91[_0x6d90('0x44')]=_[_0x6d90('0x5a')](db['CannedAnswer'][_0x6d90('0x41')]);_0xc38b91[_0x6d90('0x48')]=_[_0x6d90('0x5a')](_0x58b8ed[_0x6d90('0x48')]);_0xc38b91[_0x6d90('0x46')]=_[_0x6d90('0x47')](_0xc38b91[_0x6d90('0x44')],_0xc38b91['query']);_0x1b5524['attributes']=_[_0x6d90('0x47')](_0xc38b91[_0x6d90('0x44')],qs[_0x6d90('0x4a')](_0x58b8ed['query'][_0x6d90('0x4a')]));_0x1b5524[_0x6d90('0x49')]=_0x1b5524[_0x6d90('0x49')][_0x6d90('0x4b')]?_0x1b5524[_0x6d90('0x49')]:_0xc38b91['model'];if(!_0x58b8ed[_0x6d90('0x48')][_0x6d90('0x6b')]('nolimit')){_0x1b5524[_0x6d90('0x34')]=qs['limit'](_0x58b8ed[_0x6d90('0x48')]['limit']);_0x1b5524[_0x6d90('0x33')]=qs[_0x6d90('0x33')](_0x58b8ed[_0x6d90('0x48')]['offset']);}_0x1b5524[_0x6d90('0x6c')]=qs[_0x6d90('0x4d')](_0x58b8ed['query'][_0x6d90('0x4d')]);_0x1b5524[_0x6d90('0x4f')]=qs[_0x6d90('0x46')](_[_0x6d90('0x4e')](_0x58b8ed[_0x6d90('0x48')],_0xc38b91[_0x6d90('0x46')]));_0x1b5524['where'][_0x6d90('0x67')]=_0x38b43b['id'];if(_0x58b8ed[_0x6d90('0x48')]['filter']){_0x1b5524[_0x6d90('0x4f')]=_[_0x6d90('0x6e')](_0x1b5524[_0x6d90('0x4f')],{'$or':_[_0x6d90('0x3f')](_0x1b5524[_0x6d90('0x49')],function(_0x325a2a){var _0x1e8359={};_0x1e8359[_0x325a2a]={'$like':'%'+_0x58b8ed[_0x6d90('0x48')][_0x6d90('0x6d')]+'%'};return _0x1e8359;})});}_0x1b5524=_[_0x6d90('0x6e')]({},_0x1b5524,_0x58b8ed[_0x6d90('0x51')]);return db['CannedAnswer'][_0x6d90('0x32')]({'where':_0x1b5524[_0x6d90('0x4f')]})['then'](function(_0x4fcc23){_0x2b2e25[_0x6d90('0x32')]=_0x4fcc23;if(_0x58b8ed[_0x6d90('0x48')]['includeAll']){_0x1b5524[_0x6d90('0x53')]=[{'all':!![]}];}return db[_0x6d90('0x72')]['findAll'](_0x1b5524);})[_0x6d90('0x24')](function(_0x5d69b5){_0x2b2e25['rows']=_0x5d69b5;return _0x2b2e25;});}})[_0x6d90('0x24')](respondWithFilteredResult(_0x2ad354,_0x1b5524))[_0x6d90('0x56')](handleError(_0x2ad354,null));};exports[_0x6d90('0x73')]=function(_0x15354c,_0x14f5ad,_0x143c2c){return db[_0x6d90('0x40')][_0x6d90('0x5b')]({'where':{'id':_0x15354c[_0x6d90('0x58')]['id']}})[_0x6d90('0x24')](handleEntityNotFound(_0x14f5ad,null))[_0x6d90('0x24')](function(_0x21248c){if(_0x21248c){return _0x21248c[_0x6d90('0x73')](_0x15354c[_0x6d90('0x48')][_0x6d90('0x70')]);}})[_0x6d90('0x24')](respondWithStatusCode(_0x14f5ad,null))['catch'](handleError(_0x14f5ad,null));};exports[_0x6d90('0x74')]=function(_0xae2c0d,_0xfe3279,_0xc0be9f){return db[_0x6d90('0x75')]['find']({'where':{'id':_0xae2c0d[_0x6d90('0x58')]['id']}})['then'](handleEntityNotFound(_0xfe3279,null))[_0x6d90('0x24')](function(_0xfa830e){if(_0xfa830e){return _0xfa830e[_0x6d90('0x74')](_0xae2c0d[_0x6d90('0x5d')][_0x6d90('0x70')],_[_0x6d90('0x76')](_0xae2c0d['body'],['ids','id'])||{});}})[_0x6d90('0x24')](respondWithResult(_0xfe3279,null))['catch'](handleError(_0xfe3279,null));};exports[_0x6d90('0x77')]=function(_0x4a535a,_0x2baf1a,_0x108ff6){var _0x5798d1={'raw':![],'where':{}};var _0x5e6fb9={};var _0x5a8a91={'count':0x0,'rows':[]};return db[_0x6d90('0x40')][_0x6d90('0x6a')]({'where':{'id':_0x4a535a[_0x6d90('0x58')]['id']}})[_0x6d90('0x24')](handleEntityNotFound(_0x2baf1a,null))[_0x6d90('0x24')](function(_0x1ac0e2){if(_0x1ac0e2){_0x5e6fb9['model']=_[_0x6d90('0x5a')](db[_0x6d90('0x75')][_0x6d90('0x41')]);_0x5e6fb9[_0x6d90('0x48')]=_['keys'](_0x4a535a[_0x6d90('0x48')]);_0x5e6fb9['filters']=_[_0x6d90('0x47')](_0x5e6fb9[_0x6d90('0x44')],_0x5e6fb9[_0x6d90('0x48')]);_0x5798d1[_0x6d90('0x49')]=_[_0x6d90('0x47')](_0x5e6fb9[_0x6d90('0x44')],qs[_0x6d90('0x4a')](_0x4a535a[_0x6d90('0x48')][_0x6d90('0x4a')]));_0x5798d1[_0x6d90('0x49')]=_0x5798d1[_0x6d90('0x49')][_0x6d90('0x4b')]?_0x5798d1[_0x6d90('0x49')]:_0x5e6fb9[_0x6d90('0x44')];if(!_0x4a535a[_0x6d90('0x48')][_0x6d90('0x6b')](_0x6d90('0x4c'))){_0x5798d1['limit']=qs[_0x6d90('0x34')](_0x4a535a[_0x6d90('0x48')]['limit']);_0x5798d1['offset']=qs[_0x6d90('0x33')](_0x4a535a['query'][_0x6d90('0x33')]);}_0x5798d1[_0x6d90('0x6c')]=qs['sort'](_0x4a535a[_0x6d90('0x48')][_0x6d90('0x4d')]);_0x5798d1['where']=qs['filters'](_[_0x6d90('0x4e')](_0x4a535a['query'],_0x5e6fb9[_0x6d90('0x46')]));_0x5798d1[_0x6d90('0x4f')][_0x6d90('0x67')]=_0x1ac0e2['id'];if(_0x4a535a[_0x6d90('0x48')][_0x6d90('0x6d')]){_0x5798d1[_0x6d90('0x4f')]=_[_0x6d90('0x6e')](_0x5798d1['where'],{'$or':_[_0x6d90('0x3f')](_0x5798d1[_0x6d90('0x49')],function(_0x45fe28){var _0x493669={};_0x493669[_0x45fe28]={'$like':'%'+_0x4a535a[_0x6d90('0x48')]['filter']+'%'};return _0x493669;})});}_0x5798d1=_[_0x6d90('0x6e')]({},_0x5798d1,_0x4a535a[_0x6d90('0x51')]);return db[_0x6d90('0x75')][_0x6d90('0x32')]({'where':_0x5798d1[_0x6d90('0x4f')]})[_0x6d90('0x24')](function(_0x5d1f83){_0x5a8a91['count']=_0x5d1f83;if(_0x4a535a[_0x6d90('0x48')][_0x6d90('0x52')]){_0x5798d1['include']=[{'model':db[_0x6d90('0x78')],'as':'Contact','required':![]},{'model':db[_0x6d90('0x79')],'as':'Owner','attributes':[_0x6d90('0x45'),_0x6d90('0x7a'),_0x6d90('0x7b')],'required':![]},{'model':db[_0x6d90('0x7c')],'as':_0x6d90('0x7d'),'attributes':['id',_0x6d90('0x45'),_0x6d90('0x7e')],'where':_0x4a535a[_0x6d90('0x48')][_0x6d90('0x7f')]?{'id':_0x4a535a[_0x6d90('0x48')][_0x6d90('0x7f')]}:undefined,'required':_0x4a535a['query'][_0x6d90('0x7f')]?!![]:![]}];}return db['FaxInteraction'][_0x6d90('0x54')](_0x5798d1);})[_0x6d90('0x24')](function(_0x3f57b4){_0x5a8a91[_0x6d90('0x55')]=_0x3f57b4;return _0x5a8a91;});}})[_0x6d90('0x24')](respondWithFilteredResult(_0x2baf1a,_0x5798d1))['catch'](handleError(_0x2baf1a,null));};exports['addApplications']=function(_0x3a2251,_0x1f6a5a,_0x6b79c8){return db[_0x6d90('0x40')][_0x6d90('0x6a')]({'where':{'id':_0x3a2251[_0x6d90('0x58')]['id']}})[_0x6d90('0x24')](handleEntityNotFound(_0x1f6a5a,null))[_0x6d90('0x24')](function(_0x3c2d46){if(_0x3c2d46){return db['sequelize'][_0x6d90('0x80')](function(_0x546870){return db[_0x6d90('0x81')][_0x6d90('0x39')]({'where':{'FaxAccountId':_0x3a2251[_0x6d90('0x58')]['id']},'transaction':_0x546870})['then'](function(_0x270829){var _0x495b26=_[_0x6d90('0x3f')](_0x3a2251['body'],function(_0x172558){_0x172558[_0x6d90('0x67')]=_0x3a2251[_0x6d90('0x58')]['id'];return _0x172558;});return db[_0x6d90('0x81')][_0x6d90('0x82')](_0x495b26,{'transaction':_0x546870});});})[_0x6d90('0x24')](function(){return db[_0x6d90('0x81')][_0x6d90('0x83')]({'where':{'FaxAccountId':_0x3a2251[_0x6d90('0x58')]['id']},'order':_0x6d90('0x84')});});}})[_0x6d90('0x24')](respondWithResult(_0x1f6a5a,null))[_0x6d90('0x56')](handleError(_0x1f6a5a,null));};exports['getApplications']=function(_0x419d56,_0x441e0b,_0x142fc1){var _0x9ad05a={};var _0xe936b={};var _0x5f5bcc;var _0x46911a;return db[_0x6d90('0x40')]['findOne']({'where':{'id':_0x419d56[_0x6d90('0x58')]['id']}})[_0x6d90('0x24')](handleEntityNotFound(_0x441e0b,null))[_0x6d90('0x24')](function(_0x3e289a){if(_0x3e289a){_0x5f5bcc=_0x3e289a;_0xe936b[_0x6d90('0x44')]=_[_0x6d90('0x5a')](db['FaxApplication'][_0x6d90('0x41')]);_0xe936b[_0x6d90('0x48')]=_[_0x6d90('0x5a')](_0x419d56[_0x6d90('0x48')]);_0xe936b[_0x6d90('0x46')]=_[_0x6d90('0x47')](_0xe936b[_0x6d90('0x44')],_0xe936b['query']);_0x9ad05a[_0x6d90('0x49')]=_[_0x6d90('0x47')](_0xe936b[_0x6d90('0x44')],qs[_0x6d90('0x4a')](_0x419d56[_0x6d90('0x48')][_0x6d90('0x4a')]));_0x9ad05a[_0x6d90('0x49')]=_0x9ad05a['attributes'][_0x6d90('0x4b')]?_0x9ad05a[_0x6d90('0x49')]:_0xe936b[_0x6d90('0x44')];_0x9ad05a[_0x6d90('0x6c')]=qs[_0x6d90('0x4d')](_0x419d56[_0x6d90('0x48')]['sort']);_0x9ad05a[_0x6d90('0x4f')]=qs[_0x6d90('0x46')](_[_0x6d90('0x4e')](_0x419d56[_0x6d90('0x48')],_0xe936b[_0x6d90('0x46')]));if(_0x419d56[_0x6d90('0x48')]['filter']){_0x9ad05a[_0x6d90('0x4f')]=_[_0x6d90('0x6e')](_0x9ad05a[_0x6d90('0x4f')],{'$or':_[_0x6d90('0x3f')](_0x9ad05a[_0x6d90('0x49')],function(_0x4e39a8){var _0x29fbb9={};_0x29fbb9[_0x4e39a8]={'$like':'%'+_0x419d56[_0x6d90('0x48')][_0x6d90('0x6d')]+'%'};return _0x29fbb9;})});}_0x9ad05a=_[_0x6d90('0x6e')]({},_0x9ad05a,_0x419d56[_0x6d90('0x51')]);return _0x5f5bcc[_0x6d90('0x85')](_0x9ad05a);}})['then'](function(_0x79ea3e){if(_0x79ea3e){_0x46911a=_0x79ea3e[_0x6d90('0x4b')];if(!_0x419d56['query']['hasOwnProperty'](_0x6d90('0x4c'))){_0x9ad05a[_0x6d90('0x34')]=qs[_0x6d90('0x34')](_0x419d56[_0x6d90('0x48')][_0x6d90('0x34')]);_0x9ad05a[_0x6d90('0x33')]=qs['offset'](_0x419d56[_0x6d90('0x48')][_0x6d90('0x33')]);}return _0x5f5bcc[_0x6d90('0x85')](_0x9ad05a);}})['then'](function(_0x248ab7){if(_0x248ab7){return _0x248ab7?{'count':_0x46911a,'rows':_0x248ab7}:null;}})['then'](respondWithResult(_0x441e0b,null))[_0x6d90('0x56')](handleError(_0x441e0b,null));};function Extension(_0x4af736,_0x573187,_0x5376de,_0x46d4ff){this[_0x6d90('0x86')]=_0x6d90('0x87');this[_0x6d90('0x88')]=_0x4af736[_0x6d90('0x89')];this[_0x6d90('0x8a')]=_0x46d4ff;this[_0x6d90('0x42')]=_0x6d90('0x8b');this[_0x6d90('0x8c')]=_0x6d90('0x8d');this[_0x6d90('0x67')]=_0x4af736['id'];this[_0x6d90('0x84')]=_0x573187;this[_0x6d90('0x8e')]=_0x5376de;}function createExtensionsReciveFax(_0x248c85){var _0x5eb6ea=0x1;var _0x1c17b1=[];_0x1c17b1[_0x6d90('0x8f')](new Extension(_0x248c85,_0x5eb6ea,'',_0x6d90('0x90')));_0x5eb6ea+=0x1;_0x1c17b1['push'](new Extension(_0x248c85,_0x5eb6ea,_0x6d90('0x91'),_0x6d90('0x92')));_0x5eb6ea+=0x1;for(var _0x4a1434 in _0x248c85){if(_0x248c85[_0x6d90('0x6b')](_0x4a1434)&&(_0x4a1434===_0x6d90('0x93')||_0x4a1434===_0x6d90('0x89')||_0x4a1434===_0x6d90('0x94')||_0x4a1434===_0x6d90('0x95')||_0x4a1434===_0x6d90('0x96')||_0x4a1434===_0x6d90('0x97')||_0x4a1434===_0x6d90('0x98')||_0x4a1434==='modem'||_0x4a1434==='t38timeout')){_0x1c17b1[_0x6d90('0x8f')](new Extension(_0x248c85,_0x5eb6ea,'FAXOPT('+_0x4a1434+')='+_0x248c85[_0x4a1434],_0x6d90('0x92')));_0x5eb6ea+=0x1;}}_0x1c17b1['push'](new Extension(_0x248c85,_0x5eb6ea,'6',_0x6d90('0x99')));_0x5eb6ea+=0x1;_0x1c17b1[_0x6d90('0x8f')](new Extension(_0x248c85,_0x5eb6ea,_0x6d90('0x9a'),_0x6d90('0x9b')));_0x5eb6ea=0x0;return _0x1c17b1;}exports['addAccountApplications']=function(_0x42a7f9,_0x1df9cd,_0x12ae36){var _0x38410b;return db[_0x6d90('0x9c')][_0x6d90('0x80')](function(_0x61b08a){return db[_0x6d90('0x40')]['create'](_0x42a7f9[_0x6d90('0x5d')],{'transaction':_0x61b08a})[_0x6d90('0x24')](function(_0x196cd0){_0x38410b=_0x196cd0[_0x6d90('0x3a')]({'plain':!![]});return db[_0x6d90('0x9d')][_0x6d90('0x82')](createExtensionsReciveFax(_0x38410b),{'transaction':_0x61b08a});});})[_0x6d90('0x24')](function(){return _0x38410b;})[_0x6d90('0x24')](respondWithResult(_0x1df9cd,null))[_0x6d90('0x56')](handleError(_0x1df9cd,null));};exports[_0x6d90('0x9e')]=function(_0x2a7995,_0x31494a,_0x5c56cc){var _0x289612;return db[_0x6d90('0x9c')][_0x6d90('0x80')](function(_0x3667c9){return db[_0x6d90('0x40')][_0x6d90('0x38')](_0x2a7995[_0x6d90('0x5d')],{'where':{'id':_0x2a7995[_0x6d90('0x5d')]['id']},'transaction':_0x3667c9})[_0x6d90('0x24')](function(_0x336886){return db[_0x6d90('0x9d')]['destroy']({'where':{'FaxAccountId':_0x2a7995['body']['id']},'transaction':_0x3667c9})[_0x6d90('0x24')](function(_0x524f24){return db[_0x6d90('0x9d')][_0x6d90('0x82')](createExtensionsReciveFax(_['omit'](_0x2a7995[_0x6d90('0x5d')],[_0x6d90('0x9f'),_0x6d90('0x43'),_0x6d90('0xa0'),_0x6d90('0xa1'),_0x6d90('0xa2'),_0x6d90('0xa3')])),{'transaction':_0x3667c9});});});})['then'](function(){return db[_0x6d90('0x40')][_0x6d90('0xa4')](_0x2a7995['body']['id']);})[_0x6d90('0x24')](respondWithResult(_0x31494a,null))[_0x6d90('0x56')](handleError(_0x31494a,null));};exports[_0x6d90('0xa5')]=function(_0x23aab6,_0x1e38d1,_0x3f182e){var _0x15feaf={'raw':!![],'where':{}};var _0xc8fbe2={};var _0x31f18d={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6d90('0x6a')]({'where':{'id':_0x23aab6[_0x6d90('0x58')]['id']}})['then'](handleEntityNotFound(_0x1e38d1,null))[_0x6d90('0x24')](function(_0x39d6f6){if(_0x39d6f6){_0xc8fbe2[_0x6d90('0x44')]=_[_0x6d90('0x5a')](db['FaxMessage'][_0x6d90('0x41')]);_0xc8fbe2[_0x6d90('0x48')]=_[_0x6d90('0x5a')](_0x23aab6[_0x6d90('0x48')]);_0xc8fbe2['filters']=_[_0x6d90('0x47')](_0xc8fbe2[_0x6d90('0x44')],_0xc8fbe2['query']);_0x15feaf[_0x6d90('0x49')]=_['intersection'](_0xc8fbe2['model'],qs[_0x6d90('0x4a')](_0x23aab6[_0x6d90('0x48')][_0x6d90('0x4a')]));_0x15feaf[_0x6d90('0x49')]=_0x15feaf[_0x6d90('0x49')]['length']?_0x15feaf['attributes']:_0xc8fbe2[_0x6d90('0x44')];if(!_0x23aab6[_0x6d90('0x48')][_0x6d90('0x6b')]('nolimit')){_0x15feaf[_0x6d90('0x34')]=qs[_0x6d90('0x34')](_0x23aab6[_0x6d90('0x48')][_0x6d90('0x34')]);_0x15feaf['offset']=qs[_0x6d90('0x33')](_0x23aab6[_0x6d90('0x48')][_0x6d90('0x33')]);}_0x15feaf[_0x6d90('0x6c')]=qs[_0x6d90('0x4d')](_0x23aab6[_0x6d90('0x48')][_0x6d90('0x4d')]);_0x15feaf['where']=qs[_0x6d90('0x46')](_[_0x6d90('0x4e')](_0x23aab6['query'],_0xc8fbe2['filters']));_0x15feaf[_0x6d90('0x4f')][_0x6d90('0x67')]=_0x39d6f6['id'];if(_0x23aab6[_0x6d90('0x48')][_0x6d90('0x6d')]){_0x15feaf['where']=_[_0x6d90('0x6e')](_0x15feaf[_0x6d90('0x4f')],{'$or':_[_0x6d90('0x3f')](_0x15feaf['attributes'],function(_0x2cd157){var _0x134c5c={};_0x134c5c[_0x2cd157]={'$like':'%'+_0x23aab6[_0x6d90('0x48')][_0x6d90('0x6d')]+'%'};return _0x134c5c;})});}if(_0x23aab6[_0x6d90('0x48')][_0x6d90('0xa6')]){var _0x1b2525=_0x23aab6[_0x6d90('0x48')]['$gte'][_0x6d90('0xa7')](',');var _0x1f2c4a={};_0x1f2c4a[_0x1b2525[0x0]]={'$gte':moment(_0x1b2525[0x1])[_0x6d90('0xa8')](_0x6d90('0xa9'))};_0x15feaf[_0x6d90('0x4f')]=_[_0x6d90('0x6e')](_0x15feaf[_0x6d90('0x4f')],_0x1f2c4a);}_0x15feaf=_['merge']({},_0x15feaf,_0x23aab6[_0x6d90('0x51')]);return db['FaxMessage']['count']({'where':_0x15feaf[_0x6d90('0x4f')]})[_0x6d90('0x24')](function(_0x297f3d){_0x31f18d['count']=_0x297f3d;if(_0x23aab6[_0x6d90('0x48')][_0x6d90('0x52')]){_0x15feaf['include']=[{'all':!![]}];}return db[_0x6d90('0xaa')][_0x6d90('0x54')](_0x15feaf);})['then'](function(_0x3103d0){_0x31f18d[_0x6d90('0x55')]=_0x3103d0;return _0x31f18d;});}})[_0x6d90('0x24')](respondWithFilteredResult(_0x1e38d1,_0x15feaf))[_0x6d90('0x56')](handleError(_0x1e38d1,null));};exports['send']=function(_0x270f03,_0x212f0e,_0x4353e9){var _0x3f1086,_0x3232f4={},_0x37b273;if(_0x270f03[_0x6d90('0x5d')]['to']){_0x37b273=_0x270f03[_0x6d90('0x5d')]['to'][0x0];}return db['FaxAccount'][_0x6d90('0x5b')]({'where':{'id':_0x270f03[_0x6d90('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x6d90('0xab'),'include':[{'model':db[_0x6d90('0x78')],'as':_0x6d90('0xac'),'where':{'fax':_0x37b273},'limit':0x1,'order':[[_0x6d90('0xa1'),_0x6d90('0xad')]]}]}]})[_0x6d90('0x24')](handleEntityNotFound(_0x212f0e,null))['then'](function(_0x3e59b8){_0x3f1086=_0x3e59b8;if(_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')]&&_0x270f03[_0x6d90('0x5d')]['attachments']['length']){for(var _0x5f0690=0x0;_0x5f0690<_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')]['length'];_0x5f0690+=0x1){_0x270f03[_0x6d90('0x5d')]['attachments'][_0x5f0690]={'filename':_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][_0x5f0690][_0x6d90('0x45')],'id':_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][_0x5f0690]['id'],'path':path[_0x6d90('0xaf')](config['root'],_0x6d90('0xb0'),_0x270f03['body'][_0x6d90('0xae')][_0x5f0690][_0x6d90('0xb1')])};}}return respondWithRpcPromise(_0x6d90('0xb2'),_0x6d90('0xb2'),{'FaxAccountId':_[_0x6d90('0xb3')](_0x270f03[_0x6d90('0x58')]['id'])?undefined:_0x270f03[_0x6d90('0x58')]['id'],'path':_[_0x6d90('0xb3')](_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][0x0][_0x6d90('0x7')])?undefined:_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][0x0][_0x6d90('0x7')],'fax':_[_0x6d90('0xb3')](_0x270f03[_0x6d90('0x5d')]['to'][0x0])?undefined:_0x270f03[_0x6d90('0x5d')]['to'][0x0]},client9002);})['then'](function(){if(_0x3f1086){if(_[_0x6d90('0xb3')](_0x270f03[_0x6d90('0x5d')][_0x6d90('0xb4')])){_0x270f03[_0x6d90('0x5d')][_0x6d90('0xb4')]=util[_0x6d90('0xa8')](_0x6d90('0xb5'),_0x3f1086['name'],_0x3f1086[_0x6d90('0xb6')]);}if(_0x3f1086[_0x6d90('0xab')]){if(_0x3f1086['List']['Contacts']['length']){return _0x3f1086[_0x6d90('0xab')][_0x6d90('0xac')][0x0];}else{return db[_0x6d90('0x78')][_0x6d90('0x5c')](_['defaults'](_0x270f03[_0x6d90('0x5d')],{'firstName':_0x270f03[_0x6d90('0x5d')]['to'][0x0],'phone':_0x270f03['body']['to'][0x0],'fax':_0x270f03['body']['to'][0x0],'ListId':_0x3f1086[_0x6d90('0xa3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x6d90('0xb7'));}})[_0x6d90('0x24')](function(_0x4c5cf9){if(_0x4c5cf9){return db[_0x6d90('0x75')]['find']({'where':{'ContactId':_0x4c5cf9['id'],'closed':![],'FaxAccountId':_0x3f1086['id']}})['then'](function(_0x2e357d){if(_0x2e357d){return[_0x2e357d,![]];}return db[_0x6d90('0x75')][_0x6d90('0x5c')]({'UserId':_0x270f03[_0x6d90('0x60')]['id'],'ContactId':_0x4c5cf9['id'],'FaxAccountId':_0x3f1086['id'],'fax':_0x270f03[_0x6d90('0x5d')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x270f03[_0x6d90('0x5d')],{'read':![],'body':_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][0x0]['filename'],'FaxAccountId':_0x3f1086['id'],'UserId':_0x270f03['user']['id'],'ContactId':_0x4c5cf9['id'],'AttachmentId':_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][0x0]['id']})]},{'include':[{'model':db[_0x6d90('0xaa')],'as':'Messages'}]})[_0x6d90('0x24')](function(_0x1e4881){return[_0x1e4881,!![]];});});}else{throw new Error(_0x6d90('0xb8'));}})[_0x6d90('0xb9')](function(_0x23e557,_0xaed947){if(_0xaed947){return _0x23e557;}return db[_0x6d90('0xaa')][_0x6d90('0x5c')]({'direction':_0x6d90('0xba'),'read':![],'body':_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][0x0][_0x6d90('0xbb')],'FaxAccountId':_0x3f1086['id'],'FaxInteractionId':_0x23e557['id'],'UserId':_0x270f03['user']['id'],'ContactId':_0x23e557[_0x6d90('0xbc')],'AttachmentId':_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][0x0]['id']})[_0x6d90('0x24')](function(_0x477b07){_0x23e557['dataValues'][_0x6d90('0xbd')]=[];_0x23e557[_0x6d90('0xbe')][_0x6d90('0xbd')][_0x6d90('0x8f')](_0x477b07[_0x6d90('0xbe')]);return _0x23e557;});})[_0x6d90('0x24')](function(_0x4ee8cc){respondWithRpcPromise('SendFax',_0x6d90('0xbf'),{'FaxAccountId':_[_0x6d90('0xb3')](_0x270f03['params']['id'])?undefined:_0x270f03[_0x6d90('0x58')]['id'],'path':_[_0x6d90('0xb3')](_0x270f03['body'][_0x6d90('0xae')][0x0][_0x6d90('0x7')])?undefined:_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][0x0][_0x6d90('0x7')],'fax':_[_0x6d90('0xb3')](_0x270f03[_0x6d90('0x5d')]['to'][0x0])?undefined:_0x270f03[_0x6d90('0x5d')]['to'][0x0],'AttachmentId':_0x270f03[_0x6d90('0x5d')][_0x6d90('0xae')][0x0]['id']},client9002)[_0x6d90('0x24')](function(_0x1f2337){logger[_0x6d90('0x25')](_0x6d90('0xc0'),_0x1f2337);})['catch'](function(_0x411c45){logger[_0x6d90('0x25')](_0x6d90('0xc0'),_0x411c45);});return _0x4ee8cc;})[_0x6d90('0x24')](respondWithResult(_0x212f0e,null))[_0x6d90('0x56')](handleError(_0x212f0e,null));};exports[_0x6d90('0xc1')]=function(_0x505f26,_0x1555b2,_0x1507ae){return db[_0x6d90('0x40')][_0x6d90('0x5b')]({'where':{'id':_0x505f26[_0x6d90('0x58')]['id']}})['then'](handleEntityNotFound(_0x1555b2,null))[_0x6d90('0x24')](function(_0x1a013b){if(_0x1a013b){return _0x1a013b[_0x6d90('0xc1')](_0x505f26[_0x6d90('0x5d')][_0x6d90('0x70')],_['omit'](_0x505f26[_0x6d90('0x5d')],['ids','id'])||{})[_0x6d90('0xb9')](function(_0x466add){for(var _0x3c6bd2=0x0;_0x3c6bd2<_0x505f26['body']['ids']['length'];_0x3c6bd2+=0x1){socket[_0x6d90('0xc2')](_0x6d90('0xc3'),{'UserId':_0x505f26[_0x6d90('0x5d')]['ids'][_0x3c6bd2],'FaxAccountId':_0x505f26['params']['id']});}return _0x466add;});}})['then'](respondWithResult(_0x1555b2,null))[_0x6d90('0x56')](handleError(_0x1555b2,null));};exports[_0x6d90('0xc4')]=function(_0x1ccd14,_0x2c45ef,_0x2f5dcf){return db['FaxAccount'][_0x6d90('0x5b')]({'where':{'id':_0x1ccd14[_0x6d90('0x58')]['id']}})['then'](handleEntityNotFound(_0x2c45ef,null))['then'](function(_0x55c9a8){if(_0x55c9a8){return _0x55c9a8['removeAgents'](_0x1ccd14[_0x6d90('0x48')]['ids'])[_0x6d90('0x24')](function(){if(_[_0x6d90('0xc5')](_0x1ccd14['query'][_0x6d90('0x70')])){for(var _0x4680ec=0x0;_0x4680ec<_0x1ccd14[_0x6d90('0x48')][_0x6d90('0x70')][_0x6d90('0x4b')];_0x4680ec+=0x1){socket[_0x6d90('0xc2')](_0x6d90('0xc6'),{'UserId':Number(_0x1ccd14['query']['ids'][_0x4680ec]),'FaxAccountId':Number(_0x1ccd14[_0x6d90('0x58')]['id'])});}}else{socket['emit'](_0x6d90('0xc6'),{'UserId':Number(_0x1ccd14['query'][_0x6d90('0x70')]),'FaxAccountId':Number(_0x1ccd14[_0x6d90('0x58')]['id'])});}});}})[_0x6d90('0x24')](respondWithStatusCode(_0x2c45ef,null))[_0x6d90('0x56')](handleError(_0x2c45ef,null));};exports[_0x6d90('0xc7')]=function(_0x23eea1,_0x39f2b6,_0x41011b){var _0x33cd22={};var _0x565740={};var _0x232560;var _0x451bf9;return db[_0x6d90('0x40')]['findOne']({'where':{'id':_0x23eea1[_0x6d90('0x58')]['id']}})[_0x6d90('0x24')](handleEntityNotFound(_0x39f2b6,null))['then'](function(_0x9ecc29){if(_0x9ecc29){_0x232560=_0x9ecc29;_0x565740['model']=_[_0x6d90('0x5a')](db[_0x6d90('0x79')][_0x6d90('0x41')]);_0x565740[_0x6d90('0x48')]=_['keys'](_0x23eea1[_0x6d90('0x48')]);_0x565740[_0x6d90('0x46')]=_[_0x6d90('0x47')](_0x565740[_0x6d90('0x44')],_0x565740[_0x6d90('0x48')]);_0x33cd22[_0x6d90('0x49')]=_['intersection'](_0x565740[_0x6d90('0x44')],qs[_0x6d90('0x4a')](_0x23eea1[_0x6d90('0x48')][_0x6d90('0x4a')]));_0x33cd22[_0x6d90('0x49')]=_0x33cd22[_0x6d90('0x49')][_0x6d90('0x4b')]?_0x33cd22[_0x6d90('0x49')]:_0x565740[_0x6d90('0x44')];_0x33cd22[_0x6d90('0x6c')]=qs[_0x6d90('0x4d')](_0x23eea1[_0x6d90('0x48')][_0x6d90('0x4d')]);_0x33cd22[_0x6d90('0x4f')]=qs[_0x6d90('0x46')](_[_0x6d90('0x4e')](_0x23eea1['query'],_0x565740[_0x6d90('0x46')]));if(_0x23eea1[_0x6d90('0x48')][_0x6d90('0x6d')]){_0x33cd22[_0x6d90('0x4f')]=_[_0x6d90('0x6e')](_0x33cd22[_0x6d90('0x4f')],{'$or':_['map'](_0x33cd22['attributes'],function(_0x3e06fd){var _0x41a958={};_0x41a958[_0x3e06fd]={'$like':'%'+_0x23eea1[_0x6d90('0x48')]['filter']+'%'};return _0x41a958;})});}_0x33cd22=_[_0x6d90('0x6e')]({},_0x33cd22,_0x23eea1[_0x6d90('0x51')]);return _0x232560[_0x6d90('0xc7')](_0x33cd22);}})[_0x6d90('0x24')](function(_0x4685da){if(_0x4685da){_0x451bf9=_0x4685da[_0x6d90('0x4b')];if(!_0x23eea1[_0x6d90('0x48')][_0x6d90('0x6b')]('nolimit')){_0x33cd22[_0x6d90('0x34')]=qs[_0x6d90('0x34')](_0x23eea1['query'][_0x6d90('0x34')]);_0x33cd22[_0x6d90('0x33')]=qs[_0x6d90('0x33')](_0x23eea1[_0x6d90('0x48')][_0x6d90('0x33')]);}return _0x232560[_0x6d90('0xc7')](_0x33cd22);}})[_0x6d90('0x24')](function(_0x5e48fa){if(_0x5e48fa){return _0x5e48fa?{'count':_0x451bf9,'rows':_0x5e48fa}:null;}})[_0x6d90('0x24')](respondWithResult(_0x39f2b6,null))['catch'](handleError(_0x39f2b6,null));}; \ No newline at end of file +var _0xe861=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','get','FaxAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Pause','destroy','describe','addDisposition','FaxAccountId','Disposition','findOne','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','CmContact','Contact','User','Tag','Tags','color','tag','addApplications','sequelize','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','system','description','Fax\x20Extension','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','maxrate','minrate','modem','t38timeout','push','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','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','transaction','omit','tech','createdAt','TrunkId','ListId','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','List','List\x20not\x20found','out','filename','FaxMessage','Messages','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe861,0xb3));var _0x1e86=function(_0x47efcf,_0x3bf783){_0x47efcf=_0x47efcf-0x0;var _0x3d778b=_0xe861[_0x47efcf];return _0x3d778b;};'use strict';var pdf=require(_0x1e86('0x0'));var emlformat=require(_0x1e86('0x1'));var rimraf=require(_0x1e86('0x2'));var zipdir=require(_0x1e86('0x3'));var jsonpatch=require(_0x1e86('0x4'));var rp=require(_0x1e86('0x5'));var moment=require(_0x1e86('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x1e86('0x7'));var util=require(_0x1e86('0x8'));var path=require(_0x1e86('0x9'));var sox=require(_0x1e86('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1e86('0xb'));var squel=require(_0x1e86('0xc'));var crypto=require(_0x1e86('0xd'));var jsforce=require(_0x1e86('0xe'));var deskjs=require(_0x1e86('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1e86('0x10'));var qs=require(_0x1e86('0x11'));var as=require(_0x1e86('0x12'));var hardwareService=require(_0x1e86('0x13'));var logger=require('../../config/logger')(_0x1e86('0x14'));var utils=require(_0x1e86('0x15'));var config=require('../../config/environment');var db=require(_0x1e86('0x16'))['db'];config[_0x1e86('0x17')]=_[_0x1e86('0x18')](config[_0x1e86('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1e86('0x17')]));require('./faxAccount.socket')[_0x1e86('0x19')](socket);var jayson=require(_0x1e86('0x1a'));var client=jayson[_0x1e86('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0x1e86('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2f552d,_0x259293,_0xca4493){if(_0xca4493){var _0x3cfab9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3cfab9[_0x1e86('0x1d')](_0x259293)){return _0x2f552d;}else{throw new db[(_0x1e86('0x1e'))][(_0x1e86('0x1f'))](_0x1e86('0x20'));}}else{return _0x2f552d;}}function respondWithRpcPromise(_0x19dda7,_0x40a02f,_0x47ecb4,_0x3447da){return new BPromise(function(_0x470ea2,_0x5d95bb){var _0x4cbb2c=_0x3447da||client;return _0x4cbb2c[_0x1e86('0x21')](_0x19dda7,_0x47ecb4)[_0x1e86('0x22')](function(_0x4d9990){logger[_0x1e86('0x23')](_0x1e86('0x24'),_0x40a02f,_0x1e86('0x25'));logger[_0x1e86('0x26')](_0x1e86('0x27'),_0x40a02f,_0x1e86('0x25'),JSON[_0x1e86('0x28')](_0x4d9990));if(_0x4d9990[_0x1e86('0x29')]){if(_0x4d9990[_0x1e86('0x29')][_0x1e86('0x2a')]===0x1f4){logger[_0x1e86('0x29')](_0x1e86('0x24'),_0x40a02f,_0x4d9990['error'][_0x1e86('0x2b')]);return _0x5d95bb(_0x4d9990[_0x1e86('0x29')]['message']);}logger['error'](_0x1e86('0x24'),_0x40a02f,_0x4d9990[_0x1e86('0x29')][_0x1e86('0x2b')]);return _0x470ea2(_0x4d9990[_0x1e86('0x29')]['message']);}else{logger[_0x1e86('0x23')](_0x1e86('0x24'),_0x40a02f,_0x1e86('0x25'));_0x470ea2(_0x4d9990[_0x1e86('0x2c')]['message']);}})[_0x1e86('0x2d')](function(_0xe2b5af){logger[_0x1e86('0x29')](_0x1e86('0x24'),_0x40a02f,_0xe2b5af);_0x5d95bb(_0xe2b5af);});});}function respondWithStatusCode(_0x2f4124,_0x53605c){_0x53605c=_0x53605c||0xcc;return function(_0x2439b9){if(_0x2439b9){return _0x2f4124[_0x1e86('0x2e')](_0x53605c);}return _0x2f4124[_0x1e86('0x2f')](_0x53605c)[_0x1e86('0x30')]();};}function respondWithResult(_0x53c5ce,_0x873fc0){_0x873fc0=_0x873fc0||0xc8;return function(_0x3c6ca3){if(_0x3c6ca3){return _0x53c5ce['status'](_0x873fc0)[_0x1e86('0x31')](_0x3c6ca3);}};}function respondWithFilteredResult(_0x4a5330,_0x195736){return function(_0x27954e){if(_0x27954e){var _0x261da7=_0x27954e[_0x1e86('0x32')],_0x47d1c5=_0x195736[_0x1e86('0x33')],_0x5afb7f=_0x195736['offset']+_0x195736['limit'],_0x9d95e8;if(_0x5afb7f>=_0x261da7){_0x5afb7f=_0x261da7;_0x9d95e8=0xc8;}else{_0x9d95e8=0xce;}_0x4a5330[_0x1e86('0x2f')](_0x9d95e8);return _0x4a5330[_0x1e86('0x34')](_0x1e86('0x35'),_0x47d1c5+'-'+_0x5afb7f+'/'+_0x261da7)[_0x1e86('0x31')](_0x27954e);}return null;};}function patchUpdates(_0x5282e2){return function(_0x1ec890){try{jsonpatch['apply'](_0x1ec890,_0x5282e2,!![]);}catch(_0x761088){return BPromise['reject'](_0x761088);}return _0x1ec890[_0x1e86('0x36')]();};}function saveUpdates(_0x1922e8,_0x590ecf){return function(_0x29a46f){if(_0x29a46f){return _0x29a46f[_0x1e86('0x37')](_0x1922e8)['then'](function(_0x6eb2d){return _0x6eb2d;});}return null;};}function removeEntity(_0x40cdba,_0x5ae240){return function(_0x67b56){if(_0x67b56){return _0x67b56['destroy']()[_0x1e86('0x22')](function(){var _0x41d487=_0x67b56[_0x1e86('0x38')]({'plain':!![]});var _0x289da3=_0x1e86('0x39');return db[_0x1e86('0x3a')]['destroy']({'where':{'type':_0x289da3,'resourceId':_0x41d487['id']}})[_0x1e86('0x22')](function(){return _0x67b56;});})['then'](function(){_0x40cdba[_0x1e86('0x2f')](0xcc)[_0x1e86('0x30')]();});}};}function handleEntityNotFound(_0x16b21c,_0x437cae){return function(_0x140103){if(!_0x140103){_0x16b21c[_0x1e86('0x2e')](0x194);}return _0x140103;};}function handleError(_0x4459ba,_0x395325){_0x395325=_0x395325||0x1f4;return function(_0x59363e){logger[_0x1e86('0x29')](_0x59363e[_0x1e86('0x3b')]);if(_0x59363e[_0x1e86('0x3c')]){delete _0x59363e[_0x1e86('0x3c')];}_0x4459ba['status'](_0x395325)[_0x1e86('0x3d')](_0x59363e);};}exports[_0x1e86('0x3e')]=function(_0x561390,_0x25d490){var _0x32036d={'include':[{'model':db['Pause'],'as':_0x1e86('0x3f')}]},_0x2e52d8={},_0x4b8b32={'count':0x0,'rows':[]};var _0x13c65e=_[_0x1e86('0x40')](db[_0x1e86('0x41')]['rawAttributes'],function(_0x24707){return{'name':_0x24707[_0x1e86('0x42')],'type':_0x24707[_0x1e86('0x43')][_0x1e86('0x44')]};});_0x2e52d8['model']=_[_0x1e86('0x40')](_0x13c65e,_0x1e86('0x3c'));_0x2e52d8[_0x1e86('0x45')]=_[_0x1e86('0x46')](_0x561390[_0x1e86('0x45')]);_0x2e52d8['filters']=_[_0x1e86('0x47')](_0x2e52d8[_0x1e86('0x48')],_0x2e52d8['query']);_0x32036d[_0x1e86('0x49')]=_[_0x1e86('0x47')](_0x2e52d8[_0x1e86('0x48')],qs[_0x1e86('0x4a')](_0x561390[_0x1e86('0x45')]['fields']));_0x32036d[_0x1e86('0x49')]=_0x32036d[_0x1e86('0x49')][_0x1e86('0x4b')]?_0x32036d['attributes']:_0x2e52d8['model'];if(!_0x561390[_0x1e86('0x45')][_0x1e86('0x4c')]('nolimit')){_0x32036d[_0x1e86('0x4d')]=qs['limit'](_0x561390[_0x1e86('0x45')][_0x1e86('0x4d')]);_0x32036d[_0x1e86('0x33')]=qs['offset'](_0x561390[_0x1e86('0x45')]['offset']);}_0x32036d[_0x1e86('0x4e')]=qs[_0x1e86('0x4f')](_0x561390[_0x1e86('0x45')][_0x1e86('0x4f')]);_0x32036d[_0x1e86('0x50')]=qs['filters'](_[_0x1e86('0x51')](_0x561390[_0x1e86('0x45')],_0x2e52d8[_0x1e86('0x52')]));if(_0x561390['query'][_0x1e86('0x53')]){_0x32036d['where']=_[_0x1e86('0x54')](_0x32036d[_0x1e86('0x50')],{'$or':_[_0x1e86('0x40')](_0x13c65e,function(_0x2321a0){if(_0x2321a0[_0x1e86('0x43')]!==_0x1e86('0x55')){var _0x122dc4={};_0x122dc4[_0x2321a0[_0x1e86('0x3c')]]={'$like':'%'+_0x561390[_0x1e86('0x45')][_0x1e86('0x53')]+'%'};return _0x122dc4;}})});}_0x32036d=_[_0x1e86('0x54')]({},_0x32036d,_0x561390['options']);var _0x34feff={'where':_0x32036d[_0x1e86('0x50')]};return db[_0x1e86('0x41')][_0x1e86('0x32')](_0x34feff)['then'](function(_0x11d045){_0x4b8b32[_0x1e86('0x32')]=_0x11d045;if(_0x561390[_0x1e86('0x45')][_0x1e86('0x56')]){_0x32036d[_0x1e86('0x57')]=[{'all':!![]}];}return db[_0x1e86('0x41')][_0x1e86('0x58')](_0x32036d);})[_0x1e86('0x22')](function(_0x26af8d){_0x4b8b32[_0x1e86('0x59')]=_0x26af8d;return _0x4b8b32;})[_0x1e86('0x22')](respondWithFilteredResult(_0x25d490,_0x32036d))[_0x1e86('0x2d')](handleError(_0x25d490,null));};exports[_0x1e86('0x5a')]=function(_0x6217de,_0x53a2ea){var _0x15e7f8={'raw':![],'where':{'id':_0x6217de[_0x1e86('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2dba57={};_0x2dba57[_0x1e86('0x48')]=_[_0x1e86('0x46')](db[_0x1e86('0x41')][_0x1e86('0x5c')]);_0x2dba57[_0x1e86('0x45')]=_['keys'](_0x6217de[_0x1e86('0x45')]);_0x2dba57[_0x1e86('0x52')]=_[_0x1e86('0x47')](_0x2dba57[_0x1e86('0x48')],_0x2dba57[_0x1e86('0x45')]);_0x15e7f8['attributes']=_['intersection'](_0x2dba57[_0x1e86('0x48')],qs['fields'](_0x6217de['query'][_0x1e86('0x4a')]));_0x15e7f8[_0x1e86('0x49')]=_0x15e7f8['attributes'][_0x1e86('0x4b')]?_0x15e7f8[_0x1e86('0x49')]:_0x2dba57[_0x1e86('0x48')];if(_0x6217de[_0x1e86('0x45')][_0x1e86('0x56')]){_0x15e7f8[_0x1e86('0x57')]=[{'all':!![]}];}_0x15e7f8=_[_0x1e86('0x54')]({},_0x15e7f8,_0x6217de[_0x1e86('0x5d')]);return db[_0x1e86('0x41')][_0x1e86('0x5e')](_0x15e7f8)[_0x1e86('0x22')](handleEntityNotFound(_0x53a2ea,null))[_0x1e86('0x22')](respondWithResult(_0x53a2ea,null))[_0x1e86('0x2d')](handleError(_0x53a2ea,null));};exports['create']=function(_0x1673c9,_0x3d0f3e){return db[_0x1e86('0x41')]['create'](_0x1673c9[_0x1e86('0x5f')],{})[_0x1e86('0x22')](function(_0x93d9f){var _0x3267d7=_0x1673c9[_0x1e86('0x60')][_0x1e86('0x38')]({'plain':!![]});if(!_0x3267d7)throw new Error(_0x1e86('0x61'));if(_0x3267d7[_0x1e86('0x62')]==='user'){var _0x1a0034=_0x93d9f[_0x1e86('0x38')]({'plain':!![]});var _0x11beaf='FaxAccounts';return db[_0x1e86('0x63')]['find']({'where':{'name':_0x11beaf,'userProfileId':_0x3267d7[_0x1e86('0x64')]},'raw':!![]})[_0x1e86('0x22')](function(_0x243b24){if(_0x243b24&&_0x243b24[_0x1e86('0x65')]===0x0){return db[_0x1e86('0x3a')][_0x1e86('0x66')]({'name':_0x1a0034[_0x1e86('0x3c')],'resourceId':_0x1a0034['id'],'type':_0x243b24[_0x1e86('0x3c')],'sectionId':_0x243b24['id']},{})['then'](function(){return _0x93d9f;});}else{return _0x93d9f;}})['catch'](function(_0x46dcf8){logger[_0x1e86('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46dcf8);throw _0x46dcf8;});}return _0x93d9f;})[_0x1e86('0x22')](respondWithResult(_0x3d0f3e,0xc9))[_0x1e86('0x2d')](handleError(_0x3d0f3e,null));};exports['update']=function(_0x546d42,_0x583e12){if(_0x546d42[_0x1e86('0x5f')]['id']){delete _0x546d42[_0x1e86('0x5f')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x546d42['params']['id']},'include':[{'model':db[_0x1e86('0x67')],'as':_0x1e86('0x3f')}]})[_0x1e86('0x22')](handleEntityNotFound(_0x583e12,null))[_0x1e86('0x22')](saveUpdates(_0x546d42['body'],null))[_0x1e86('0x22')](respondWithResult(_0x583e12,null))[_0x1e86('0x2d')](handleError(_0x583e12,null));};exports[_0x1e86('0x68')]=function(_0x1806e6,_0x3c3cd1){return db[_0x1e86('0x41')][_0x1e86('0x5e')]({'where':{'id':_0x1806e6[_0x1e86('0x5b')]['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x3c3cd1,null))[_0x1e86('0x22')](removeEntity(_0x3c3cd1,null))['catch'](handleError(_0x3c3cd1,null));};exports[_0x1e86('0x69')]=function(_0x149bae,_0x1325c1){return db[_0x1e86('0x41')]['describe']()[_0x1e86('0x22')](respondWithResult(_0x1325c1,null))[_0x1e86('0x2d')](handleError(_0x1325c1,null));};exports[_0x1e86('0x6a')]=function(_0x575c44,_0x9246ed,_0x13573a){if(_0x575c44[_0x1e86('0x5f')]['id']){delete _0x575c44[_0x1e86('0x5f')]['id'];}return db[_0x1e86('0x41')][_0x1e86('0x5e')]({'where':{'id':_0x575c44[_0x1e86('0x5b')]['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x9246ed,null))[_0x1e86('0x22')](function(_0x433542){if(_0x433542){_0x575c44[_0x1e86('0x5f')][_0x1e86('0x6b')]=_0x433542['id'];return db[_0x1e86('0x6c')][_0x1e86('0x66')](_0x575c44[_0x1e86('0x5f')]);}})[_0x1e86('0x22')](respondWithResult(_0x9246ed,null))[_0x1e86('0x2d')](handleError(_0x9246ed,null));};exports['getDispositions']=function(_0x39b947,_0x55387e,_0x42ac7c){var _0x295d0f={'raw':![],'where':{}};var _0x4d70e5={};var _0x300954={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1e86('0x6d')]({'where':{'id':_0x39b947['params']['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x55387e,null))[_0x1e86('0x22')](function(_0x192409){if(_0x192409){_0x4d70e5[_0x1e86('0x48')]=_['keys'](db[_0x1e86('0x6c')][_0x1e86('0x5c')]);_0x4d70e5[_0x1e86('0x45')]=_['keys'](_0x39b947[_0x1e86('0x45')]);_0x4d70e5[_0x1e86('0x52')]=_['intersection'](_0x4d70e5[_0x1e86('0x48')],_0x4d70e5[_0x1e86('0x45')]);_0x295d0f[_0x1e86('0x49')]=_[_0x1e86('0x47')](_0x4d70e5['model'],qs[_0x1e86('0x4a')](_0x39b947[_0x1e86('0x45')][_0x1e86('0x4a')]));_0x295d0f[_0x1e86('0x49')]=_0x295d0f['attributes'][_0x1e86('0x4b')]?_0x295d0f['attributes']:_0x4d70e5[_0x1e86('0x48')];if(!_0x39b947[_0x1e86('0x45')][_0x1e86('0x4c')](_0x1e86('0x6e'))){_0x295d0f[_0x1e86('0x4d')]=qs[_0x1e86('0x4d')](_0x39b947['query']['limit']);_0x295d0f[_0x1e86('0x33')]=qs[_0x1e86('0x33')](_0x39b947[_0x1e86('0x45')]['offset']);}_0x295d0f['order']=qs[_0x1e86('0x4f')](_0x39b947[_0x1e86('0x45')][_0x1e86('0x4f')]);_0x295d0f[_0x1e86('0x50')]=qs[_0x1e86('0x52')](_[_0x1e86('0x51')](_0x39b947[_0x1e86('0x45')],_0x4d70e5[_0x1e86('0x52')]));_0x295d0f[_0x1e86('0x50')]['FaxAccountId']=_0x192409['id'];if(_0x39b947['query'][_0x1e86('0x53')]){_0x295d0f['where']=_[_0x1e86('0x54')](_0x295d0f['where'],{'$or':_[_0x1e86('0x40')](_0x295d0f[_0x1e86('0x49')],function(_0xf9013b){var _0x8b13d={};_0x8b13d[_0xf9013b]={'$like':'%'+_0x39b947[_0x1e86('0x45')]['filter']+'%'};return _0x8b13d;})});}_0x295d0f=_[_0x1e86('0x54')]({},_0x295d0f,_0x39b947[_0x1e86('0x5d')]);return db[_0x1e86('0x6c')][_0x1e86('0x32')]({'where':_0x295d0f['where']})[_0x1e86('0x22')](function(_0x1f017a){_0x300954[_0x1e86('0x32')]=_0x1f017a;if(_0x39b947[_0x1e86('0x45')][_0x1e86('0x56')]){_0x295d0f['include']=[{'all':!![]}];}return db[_0x1e86('0x6c')][_0x1e86('0x58')](_0x295d0f);})[_0x1e86('0x22')](function(_0x4baf41){_0x300954[_0x1e86('0x59')]=_0x4baf41;return _0x300954;});}})[_0x1e86('0x22')](respondWithFilteredResult(_0x55387e,_0x295d0f))[_0x1e86('0x2d')](handleError(_0x55387e,null));};exports['removeDispositions']=function(_0x5d2009,_0x33c56f,_0x120a74){return db[_0x1e86('0x41')][_0x1e86('0x5e')]({'where':{'id':_0x5d2009[_0x1e86('0x5b')]['id']}})['then'](handleEntityNotFound(_0x33c56f,null))['then'](function(_0x3d10db){if(_0x3d10db){return _0x3d10db[_0x1e86('0x6f')](_0x5d2009[_0x1e86('0x45')][_0x1e86('0x70')]);}})[_0x1e86('0x22')](respondWithStatusCode(_0x33c56f,null))[_0x1e86('0x2d')](handleError(_0x33c56f,null));};exports['addAnswer']=function(_0x277ef8,_0x5b32ff,_0x59dcd6){if(_0x277ef8['body']['id']){delete _0x277ef8[_0x1e86('0x5f')]['id'];}return db[_0x1e86('0x41')][_0x1e86('0x5e')]({'where':{'id':_0x277ef8['params']['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x5b32ff,null))[_0x1e86('0x22')](function(_0x31c7e5){if(_0x31c7e5){_0x277ef8[_0x1e86('0x5f')][_0x1e86('0x6b')]=_0x31c7e5['id'];return db[_0x1e86('0x71')][_0x1e86('0x66')](_0x277ef8[_0x1e86('0x5f')]);}})[_0x1e86('0x22')](respondWithResult(_0x5b32ff,null))[_0x1e86('0x2d')](handleError(_0x5b32ff,null));};exports[_0x1e86('0x72')]=function(_0x1c0ce8,_0x55491b,_0x2aaf4f){var _0x15440f={'raw':![],'where':{}};var _0x340d36={};var _0x1b9461={'count':0x0,'rows':[]};return db[_0x1e86('0x41')][_0x1e86('0x6d')]({'where':{'id':_0x1c0ce8[_0x1e86('0x5b')]['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x55491b,null))[_0x1e86('0x22')](function(_0x43758a){if(_0x43758a){_0x340d36[_0x1e86('0x48')]=_[_0x1e86('0x46')](db[_0x1e86('0x71')][_0x1e86('0x5c')]);_0x340d36[_0x1e86('0x45')]=_[_0x1e86('0x46')](_0x1c0ce8[_0x1e86('0x45')]);_0x340d36[_0x1e86('0x52')]=_[_0x1e86('0x47')](_0x340d36[_0x1e86('0x48')],_0x340d36[_0x1e86('0x45')]);_0x15440f['attributes']=_[_0x1e86('0x47')](_0x340d36['model'],qs[_0x1e86('0x4a')](_0x1c0ce8[_0x1e86('0x45')][_0x1e86('0x4a')]));_0x15440f[_0x1e86('0x49')]=_0x15440f[_0x1e86('0x49')][_0x1e86('0x4b')]?_0x15440f['attributes']:_0x340d36[_0x1e86('0x48')];if(!_0x1c0ce8[_0x1e86('0x45')][_0x1e86('0x4c')]('nolimit')){_0x15440f[_0x1e86('0x4d')]=qs[_0x1e86('0x4d')](_0x1c0ce8['query'][_0x1e86('0x4d')]);_0x15440f[_0x1e86('0x33')]=qs[_0x1e86('0x33')](_0x1c0ce8[_0x1e86('0x45')][_0x1e86('0x33')]);}_0x15440f['order']=qs[_0x1e86('0x4f')](_0x1c0ce8[_0x1e86('0x45')]['sort']);_0x15440f[_0x1e86('0x50')]=qs[_0x1e86('0x52')](_[_0x1e86('0x51')](_0x1c0ce8['query'],_0x340d36[_0x1e86('0x52')]));_0x15440f[_0x1e86('0x50')]['FaxAccountId']=_0x43758a['id'];if(_0x1c0ce8[_0x1e86('0x45')][_0x1e86('0x53')]){_0x15440f[_0x1e86('0x50')]=_[_0x1e86('0x54')](_0x15440f[_0x1e86('0x50')],{'$or':_[_0x1e86('0x40')](_0x15440f['attributes'],function(_0x35e89b){var _0x36957f={};_0x36957f[_0x35e89b]={'$like':'%'+_0x1c0ce8[_0x1e86('0x45')][_0x1e86('0x53')]+'%'};return _0x36957f;})});}_0x15440f=_[_0x1e86('0x54')]({},_0x15440f,_0x1c0ce8['options']);return db[_0x1e86('0x71')][_0x1e86('0x32')]({'where':_0x15440f[_0x1e86('0x50')]})['then'](function(_0x13d32f){_0x1b9461[_0x1e86('0x32')]=_0x13d32f;if(_0x1c0ce8[_0x1e86('0x45')]['includeAll']){_0x15440f['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x1e86('0x58')](_0x15440f);})[_0x1e86('0x22')](function(_0x793593){_0x1b9461[_0x1e86('0x59')]=_0x793593;return _0x1b9461;});}})[_0x1e86('0x22')](respondWithFilteredResult(_0x55491b,_0x15440f))['catch'](handleError(_0x55491b,null));};exports[_0x1e86('0x73')]=function(_0xdaf0ea,_0x19896a,_0x5653f2){return db[_0x1e86('0x41')][_0x1e86('0x5e')]({'where':{'id':_0xdaf0ea[_0x1e86('0x5b')]['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x19896a,null))['then'](function(_0x50afb4){if(_0x50afb4){return _0x50afb4[_0x1e86('0x73')](_0xdaf0ea[_0x1e86('0x45')][_0x1e86('0x70')]);}})[_0x1e86('0x22')](respondWithStatusCode(_0x19896a,null))[_0x1e86('0x2d')](handleError(_0x19896a,null));};exports[_0x1e86('0x74')]=function(_0x5a41af,_0x1853d1,_0x56cd4e){return db[_0x1e86('0x75')]['find']({'where':{'id':_0x5a41af['params']['id']}})['then'](handleEntityNotFound(_0x1853d1,null))[_0x1e86('0x22')](function(_0x2dbe48){if(_0x2dbe48){return _0x2dbe48[_0x1e86('0x74')](_0x5a41af['body'][_0x1e86('0x70')],_['omit'](_0x5a41af['body'],[_0x1e86('0x70'),'id'])||{});}})[_0x1e86('0x22')](respondWithResult(_0x1853d1,null))['catch'](handleError(_0x1853d1,null));};exports['getInteractions']=function(_0x318d8b,_0x440234,_0x4b55f0){var _0x4862e8={'raw':![],'where':{}};var _0x3a87a4={};var _0x393a22={'count':0x0,'rows':[]};return db[_0x1e86('0x41')][_0x1e86('0x6d')]({'where':{'id':_0x318d8b[_0x1e86('0x5b')]['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x440234,null))['then'](function(_0x17d4b2){if(_0x17d4b2){_0x3a87a4[_0x1e86('0x48')]=_[_0x1e86('0x46')](db[_0x1e86('0x75')]['rawAttributes']);_0x3a87a4['query']=_[_0x1e86('0x46')](_0x318d8b[_0x1e86('0x45')]);_0x3a87a4[_0x1e86('0x52')]=_[_0x1e86('0x47')](_0x3a87a4[_0x1e86('0x48')],_0x3a87a4[_0x1e86('0x45')]);_0x4862e8[_0x1e86('0x49')]=_[_0x1e86('0x47')](_0x3a87a4[_0x1e86('0x48')],qs[_0x1e86('0x4a')](_0x318d8b[_0x1e86('0x45')]['fields']));_0x4862e8[_0x1e86('0x49')]=_0x4862e8['attributes']['length']?_0x4862e8[_0x1e86('0x49')]:_0x3a87a4[_0x1e86('0x48')];if(!_0x318d8b[_0x1e86('0x45')]['hasOwnProperty'](_0x1e86('0x6e'))){_0x4862e8[_0x1e86('0x4d')]=qs[_0x1e86('0x4d')](_0x318d8b[_0x1e86('0x45')][_0x1e86('0x4d')]);_0x4862e8[_0x1e86('0x33')]=qs[_0x1e86('0x33')](_0x318d8b[_0x1e86('0x45')][_0x1e86('0x33')]);}_0x4862e8[_0x1e86('0x4e')]=qs[_0x1e86('0x4f')](_0x318d8b['query'][_0x1e86('0x4f')]);_0x4862e8[_0x1e86('0x50')]=qs[_0x1e86('0x52')](_[_0x1e86('0x51')](_0x318d8b[_0x1e86('0x45')],_0x3a87a4[_0x1e86('0x52')]));_0x4862e8['where'][_0x1e86('0x6b')]=_0x17d4b2['id'];if(_0x318d8b[_0x1e86('0x45')][_0x1e86('0x53')]){_0x4862e8[_0x1e86('0x50')]=_[_0x1e86('0x54')](_0x4862e8[_0x1e86('0x50')],{'$or':_[_0x1e86('0x40')](_0x4862e8[_0x1e86('0x49')],function(_0x2237da){var _0x3afa46={};_0x3afa46[_0x2237da]={'$like':'%'+_0x318d8b['query'][_0x1e86('0x53')]+'%'};return _0x3afa46;})});}_0x4862e8=_[_0x1e86('0x54')]({},_0x4862e8,_0x318d8b[_0x1e86('0x5d')]);return db[_0x1e86('0x75')][_0x1e86('0x32')]({'where':_0x4862e8[_0x1e86('0x50')]})['then'](function(_0x34fbd5){_0x393a22[_0x1e86('0x32')]=_0x34fbd5;if(_0x318d8b[_0x1e86('0x45')][_0x1e86('0x56')]){_0x4862e8[_0x1e86('0x57')]=[{'model':db[_0x1e86('0x76')],'as':_0x1e86('0x77'),'required':![]},{'model':db[_0x1e86('0x78')],'as':'Owner','attributes':[_0x1e86('0x3c'),'fullname','internal'],'required':![]},{'model':db[_0x1e86('0x79')],'as':_0x1e86('0x7a'),'attributes':['id','name',_0x1e86('0x7b')],'where':_0x318d8b[_0x1e86('0x45')][_0x1e86('0x7c')]?{'id':_0x318d8b[_0x1e86('0x45')][_0x1e86('0x7c')]}:undefined,'required':_0x318d8b[_0x1e86('0x45')][_0x1e86('0x7c')]?!![]:![]}];}return db[_0x1e86('0x75')][_0x1e86('0x58')](_0x4862e8);})[_0x1e86('0x22')](function(_0x46c97d){_0x393a22[_0x1e86('0x59')]=_0x46c97d;return _0x393a22;});}})['then'](respondWithFilteredResult(_0x440234,_0x4862e8))[_0x1e86('0x2d')](handleError(_0x440234,null));};exports[_0x1e86('0x7d')]=function(_0x145d6e,_0x2522d4,_0x3eebb6){return db[_0x1e86('0x41')]['findOne']({'where':{'id':_0x145d6e[_0x1e86('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2522d4,null))[_0x1e86('0x22')](function(_0x57d0f1){if(_0x57d0f1){return db[_0x1e86('0x7e')]['transaction'](function(_0x3d461b){return db[_0x1e86('0x7f')][_0x1e86('0x68')]({'where':{'FaxAccountId':_0x145d6e['params']['id']},'transaction':_0x3d461b})[_0x1e86('0x22')](function(_0x158a1c){var _0x50cfd7=_['map'](_0x145d6e[_0x1e86('0x5f')],function(_0xd77b50){_0xd77b50['FaxAccountId']=_0x145d6e[_0x1e86('0x5b')]['id'];return _0xd77b50;});return db['FaxApplication']['bulkCreate'](_0x50cfd7,{'transaction':_0x3d461b});});})[_0x1e86('0x22')](function(){return db[_0x1e86('0x7f')][_0x1e86('0x80')]({'where':{'FaxAccountId':_0x145d6e[_0x1e86('0x5b')]['id']},'order':_0x1e86('0x81')});});}})[_0x1e86('0x22')](respondWithResult(_0x2522d4,null))['catch'](handleError(_0x2522d4,null));};exports['getApplications']=function(_0x54a312,_0x180fa5,_0x1016f3){var _0xa2b68f={};var _0x1a45ae={};var _0x5e1d55;var _0x5ca551;return db['FaxAccount'][_0x1e86('0x6d')]({'where':{'id':_0x54a312[_0x1e86('0x5b')]['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x180fa5,null))['then'](function(_0x437d4f){if(_0x437d4f){_0x5e1d55=_0x437d4f;_0x1a45ae[_0x1e86('0x48')]=_[_0x1e86('0x46')](db['FaxApplication'][_0x1e86('0x5c')]);_0x1a45ae['query']=_['keys'](_0x54a312[_0x1e86('0x45')]);_0x1a45ae[_0x1e86('0x52')]=_[_0x1e86('0x47')](_0x1a45ae[_0x1e86('0x48')],_0x1a45ae[_0x1e86('0x45')]);_0xa2b68f[_0x1e86('0x49')]=_['intersection'](_0x1a45ae[_0x1e86('0x48')],qs[_0x1e86('0x4a')](_0x54a312[_0x1e86('0x45')][_0x1e86('0x4a')]));_0xa2b68f[_0x1e86('0x49')]=_0xa2b68f['attributes']['length']?_0xa2b68f['attributes']:_0x1a45ae['model'];_0xa2b68f[_0x1e86('0x4e')]=qs['sort'](_0x54a312[_0x1e86('0x45')]['sort']);_0xa2b68f[_0x1e86('0x50')]=qs[_0x1e86('0x52')](_[_0x1e86('0x51')](_0x54a312[_0x1e86('0x45')],_0x1a45ae[_0x1e86('0x52')]));if(_0x54a312[_0x1e86('0x45')]['filter']){_0xa2b68f['where']=_['merge'](_0xa2b68f[_0x1e86('0x50')],{'$or':_[_0x1e86('0x40')](_0xa2b68f[_0x1e86('0x49')],function(_0x286932){var _0x560db5={};_0x560db5[_0x286932]={'$like':'%'+_0x54a312[_0x1e86('0x45')][_0x1e86('0x53')]+'%'};return _0x560db5;})});}_0xa2b68f=_[_0x1e86('0x54')]({},_0xa2b68f,_0x54a312[_0x1e86('0x5d')]);return _0x5e1d55[_0x1e86('0x82')](_0xa2b68f);}})[_0x1e86('0x22')](function(_0x5a504a){if(_0x5a504a){_0x5ca551=_0x5a504a[_0x1e86('0x4b')];if(!_0x54a312[_0x1e86('0x45')][_0x1e86('0x4c')](_0x1e86('0x6e'))){_0xa2b68f[_0x1e86('0x4d')]=qs[_0x1e86('0x4d')](_0x54a312['query'][_0x1e86('0x4d')]);_0xa2b68f[_0x1e86('0x33')]=qs[_0x1e86('0x33')](_0x54a312[_0x1e86('0x45')]['offset']);}return _0x5e1d55[_0x1e86('0x82')](_0xa2b68f);}})['then'](function(_0x19e87c){if(_0x19e87c){return _0x19e87c?{'count':_0x5ca551,'rows':_0x19e87c}:null;}})['then'](respondWithResult(_0x180fa5,null))[_0x1e86('0x2d')](handleError(_0x180fa5,null));};function Extension(_0x496ae5,_0x8e6d2a,_0x1432f,_0x3f00da){this[_0x1e86('0x83')]=_0x1e86('0x84');this[_0x1e86('0x85')]=_0x496ae5['localstationid'];this['app']=_0x3f00da;this[_0x1e86('0x43')]=_0x1e86('0x86');this[_0x1e86('0x87')]=_0x1e86('0x88');this[_0x1e86('0x6b')]=_0x496ae5['id'];this[_0x1e86('0x81')]=_0x8e6d2a;this['appdata']=_0x1432f;}function createExtensionsReciveFax(_0x2293d4){var _0x40469f=0x1;var _0xcc82ff=[];_0xcc82ff['push'](new Extension(_0x2293d4,_0x40469f,'',_0x1e86('0x89')));_0x40469f+=0x1;_0xcc82ff['push'](new Extension(_0x2293d4,_0x40469f,_0x1e86('0x8a'),_0x1e86('0x8b')));_0x40469f+=0x1;for(var _0x5e9655 in _0x2293d4){if(_0x2293d4[_0x1e86('0x4c')](_0x5e9655)&&(_0x5e9655===_0x1e86('0x8c')||_0x5e9655===_0x1e86('0x8d')||_0x5e9655===_0x1e86('0x8e')||_0x5e9655===_0x1e86('0x8f')||_0x5e9655==='headerinfo'||_0x5e9655===_0x1e86('0x90')||_0x5e9655===_0x1e86('0x91')||_0x5e9655===_0x1e86('0x92')||_0x5e9655===_0x1e86('0x93'))){_0xcc82ff[_0x1e86('0x94')](new Extension(_0x2293d4,_0x40469f,_0x1e86('0x95')+_0x5e9655+')='+_0x2293d4[_0x5e9655],_0x1e86('0x8b')));_0x40469f+=0x1;}}_0xcc82ff[_0x1e86('0x94')](new Extension(_0x2293d4,_0x40469f,'6',_0x1e86('0x96')));_0x40469f+=0x1;_0xcc82ff[_0x1e86('0x94')](new Extension(_0x2293d4,_0x40469f,_0x1e86('0x97'),_0x1e86('0x98')));_0x40469f=0x0;return _0xcc82ff;}exports[_0x1e86('0x99')]=function(_0x1b1b6e,_0xb91a90,_0x1026ff){var _0x5ef72d;return db[_0x1e86('0x7e')]['transaction'](function(_0x502ffd){return db['FaxAccount'][_0x1e86('0x66')](_0x1b1b6e[_0x1e86('0x5f')],{'transaction':_0x502ffd})[_0x1e86('0x22')](function(_0x3251fe){_0x5ef72d=_0x3251fe[_0x1e86('0x38')]({'plain':!![]});return db[_0x1e86('0x9a')][_0x1e86('0x9b')](createExtensionsReciveFax(_0x5ef72d),{'transaction':_0x502ffd});});})[_0x1e86('0x22')](function(){return _0x5ef72d;})[_0x1e86('0x22')](respondWithResult(_0xb91a90,null))['catch'](handleError(_0xb91a90,null));};exports['updateAccountApplications']=function(_0x41f8f0,_0x2a717f,_0xa83e5d){var _0x199234;return db['sequelize'][_0x1e86('0x9c')](function(_0x1034c7){return db[_0x1e86('0x41')][_0x1e86('0x37')](_0x41f8f0[_0x1e86('0x5f')],{'where':{'id':_0x41f8f0[_0x1e86('0x5f')]['id']},'transaction':_0x1034c7})['then'](function(_0x2b3c85){return db[_0x1e86('0x9a')][_0x1e86('0x68')]({'where':{'FaxAccountId':_0x41f8f0['body']['id']},'transaction':_0x1034c7})[_0x1e86('0x22')](function(_0x192300){return db[_0x1e86('0x9a')]['bulkCreate'](createExtensionsReciveFax(_[_0x1e86('0x9d')](_0x41f8f0[_0x1e86('0x5f')],[_0x1e86('0x9e'),'key',_0x1e86('0x9f'),'updatedAt',_0x1e86('0xa0'),_0x1e86('0xa1')])),{'transaction':_0x1034c7});});});})['then'](function(){return db['FaxAccount'][_0x1e86('0xa2')](_0x41f8f0[_0x1e86('0x5f')]['id']);})[_0x1e86('0x22')](respondWithResult(_0x2a717f,null))['catch'](handleError(_0x2a717f,null));};exports['getMessages']=function(_0x56f0a9,_0x25d9aa,_0xb37e55){var _0x304dbf={'raw':!![],'where':{}};var _0x3d538d={};var _0x841b72={'count':0x0,'rows':[]};return db[_0x1e86('0x41')][_0x1e86('0x6d')]({'where':{'id':_0x56f0a9[_0x1e86('0x5b')]['id']}})['then'](handleEntityNotFound(_0x25d9aa,null))[_0x1e86('0x22')](function(_0x10a33d){if(_0x10a33d){_0x3d538d[_0x1e86('0x48')]=_[_0x1e86('0x46')](db['FaxMessage'][_0x1e86('0x5c')]);_0x3d538d[_0x1e86('0x45')]=_[_0x1e86('0x46')](_0x56f0a9['query']);_0x3d538d['filters']=_[_0x1e86('0x47')](_0x3d538d[_0x1e86('0x48')],_0x3d538d[_0x1e86('0x45')]);_0x304dbf['attributes']=_[_0x1e86('0x47')](_0x3d538d[_0x1e86('0x48')],qs['fields'](_0x56f0a9['query'][_0x1e86('0x4a')]));_0x304dbf['attributes']=_0x304dbf[_0x1e86('0x49')][_0x1e86('0x4b')]?_0x304dbf[_0x1e86('0x49')]:_0x3d538d[_0x1e86('0x48')];if(!_0x56f0a9[_0x1e86('0x45')][_0x1e86('0x4c')](_0x1e86('0x6e'))){_0x304dbf[_0x1e86('0x4d')]=qs[_0x1e86('0x4d')](_0x56f0a9['query'][_0x1e86('0x4d')]);_0x304dbf['offset']=qs[_0x1e86('0x33')](_0x56f0a9['query']['offset']);}_0x304dbf[_0x1e86('0x4e')]=qs[_0x1e86('0x4f')](_0x56f0a9[_0x1e86('0x45')][_0x1e86('0x4f')]);_0x304dbf[_0x1e86('0x50')]=qs[_0x1e86('0x52')](_[_0x1e86('0x51')](_0x56f0a9[_0x1e86('0x45')],_0x3d538d[_0x1e86('0x52')]));_0x304dbf[_0x1e86('0x50')][_0x1e86('0x6b')]=_0x10a33d['id'];if(_0x56f0a9['query'][_0x1e86('0x53')]){_0x304dbf[_0x1e86('0x50')]=_['merge'](_0x304dbf[_0x1e86('0x50')],{'$or':_[_0x1e86('0x40')](_0x304dbf['attributes'],function(_0x206ce4){var _0xa25df0={};_0xa25df0[_0x206ce4]={'$like':'%'+_0x56f0a9[_0x1e86('0x45')][_0x1e86('0x53')]+'%'};return _0xa25df0;})});}if(_0x56f0a9[_0x1e86('0x45')][_0x1e86('0xa3')]){var _0x25fc45=_0x56f0a9[_0x1e86('0x45')][_0x1e86('0xa3')][_0x1e86('0xa4')](',');var _0x5eb23e={};_0x5eb23e[_0x25fc45[0x0]]={'$gte':moment(_0x25fc45[0x1])[_0x1e86('0xa5')](_0x1e86('0xa6'))};_0x304dbf['where']=_['merge'](_0x304dbf[_0x1e86('0x50')],_0x5eb23e);}_0x304dbf=_[_0x1e86('0x54')]({},_0x304dbf,_0x56f0a9[_0x1e86('0x5d')]);return db['FaxMessage'][_0x1e86('0x32')]({'where':_0x304dbf[_0x1e86('0x50')]})['then'](function(_0x5629da){_0x841b72[_0x1e86('0x32')]=_0x5629da;if(_0x56f0a9[_0x1e86('0x45')]['includeAll']){_0x304dbf[_0x1e86('0x57')]=[{'all':!![]}];}return db['FaxMessage'][_0x1e86('0x58')](_0x304dbf);})['then'](function(_0x47a330){_0x841b72[_0x1e86('0x59')]=_0x47a330;return _0x841b72;});}})[_0x1e86('0x22')](respondWithFilteredResult(_0x25d9aa,_0x304dbf))[_0x1e86('0x2d')](handleError(_0x25d9aa,null));};exports[_0x1e86('0x3d')]=function(_0x4b3f08,_0x280931,_0x55c906){var _0x108bdb,_0x3c2366={},_0x3b7148;if(_0x4b3f08['body']['to']){_0x3b7148=_0x4b3f08[_0x1e86('0x5f')]['to'][0x0];}return db[_0x1e86('0x41')][_0x1e86('0x5e')]({'where':{'id':_0x4b3f08[_0x1e86('0x5b')]['id']},'include':[{'model':db[_0x1e86('0xa7')],'as':'List','include':[{'model':db['CmContact'],'as':_0x1e86('0xa8'),'where':{'fax':_0x3b7148},'limit':0x1,'order':[[_0x1e86('0xa9'),_0x1e86('0xaa')]]}]}]})[_0x1e86('0x22')](handleEntityNotFound(_0x280931,null))[_0x1e86('0x22')](function(_0x4bb45a){_0x108bdb=_0x4bb45a;if(_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')]&&_0x4b3f08['body'][_0x1e86('0xab')][_0x1e86('0x4b')]){for(var _0x477e8a=0x0;_0x477e8a<_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')][_0x1e86('0x4b')];_0x477e8a+=0x1){_0x4b3f08['body'][_0x1e86('0xab')][_0x477e8a]={'filename':_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')][_0x477e8a][_0x1e86('0x3c')],'id':_0x4b3f08[_0x1e86('0x5f')]['attachments'][_0x477e8a]['id'],'path':path[_0x1e86('0xac')](config[_0x1e86('0xad')],_0x1e86('0xae'),_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')][_0x477e8a][_0x1e86('0xaf')])};}}return respondWithRpcPromise(_0x1e86('0xb0'),'CheckAfterSend',{'FaxAccountId':_[_0x1e86('0xb1')](_0x4b3f08[_0x1e86('0x5b')]['id'])?undefined:_0x4b3f08[_0x1e86('0x5b')]['id'],'path':_[_0x1e86('0xb1')](_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')][0x0]['path'])?undefined:_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')][0x0][_0x1e86('0x9')],'fax':_['isNil'](_0x4b3f08[_0x1e86('0x5f')]['to'][0x0])?undefined:_0x4b3f08[_0x1e86('0x5f')]['to'][0x0]},client9002);})[_0x1e86('0x22')](function(){if(_0x108bdb){if(_['isNil'](_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xb2')])){_0x4b3f08['body']['from']=util[_0x1e86('0xa5')]('\x22%s\x22\x20<%s>',_0x108bdb[_0x1e86('0x3c')],_0x108bdb['fax']);}if(_0x108bdb[_0x1e86('0xb3')]){if(_0x108bdb['List'][_0x1e86('0xa8')][_0x1e86('0x4b')]){return _0x108bdb['List'][_0x1e86('0xa8')][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x4b3f08[_0x1e86('0x5f')],{'firstName':_0x4b3f08[_0x1e86('0x5f')]['to'][0x0],'phone':_0x4b3f08[_0x1e86('0x5f')]['to'][0x0],'fax':_0x4b3f08[_0x1e86('0x5f')]['to'][0x0],'ListId':_0x108bdb[_0x1e86('0xa1')]}));}}else{throw new Error(_0x1e86('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x1e86('0x22')](function(_0x150fb0){if(_0x150fb0){return db[_0x1e86('0x75')][_0x1e86('0x5e')]({'where':{'ContactId':_0x150fb0['id'],'closed':![],'FaxAccountId':_0x108bdb['id']}})[_0x1e86('0x22')](function(_0x24eaed){if(_0x24eaed){return[_0x24eaed,![]];}return db[_0x1e86('0x75')][_0x1e86('0x66')]({'UserId':_0x4b3f08[_0x1e86('0x60')]['id'],'ContactId':_0x150fb0['id'],'FaxAccountId':_0x108bdb['id'],'fax':_0x4b3f08[_0x1e86('0x5f')]['to'][0x0],'firstMsgDirection':_0x1e86('0xb5'),'Messages':[_['merge'](_0x4b3f08[_0x1e86('0x5f')],{'read':![],'body':_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')][0x0][_0x1e86('0xb6')],'FaxAccountId':_0x108bdb['id'],'UserId':_0x4b3f08['user']['id'],'ContactId':_0x150fb0['id'],'AttachmentId':_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x1e86('0xb7')],'as':_0x1e86('0xb8')}]})['then'](function(_0x123d3f){return[_0x123d3f,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x51add8,_0x15ecba){if(_0x15ecba){return _0x51add8;}return db[_0x1e86('0xb7')][_0x1e86('0x66')]({'direction':_0x1e86('0xb5'),'read':![],'body':_0x4b3f08['body'][_0x1e86('0xab')][0x0][_0x1e86('0xb6')],'FaxAccountId':_0x108bdb['id'],'FaxInteractionId':_0x51add8['id'],'UserId':_0x4b3f08[_0x1e86('0x60')]['id'],'ContactId':_0x51add8[_0x1e86('0xb9')],'AttachmentId':_0x4b3f08[_0x1e86('0x5f')]['attachments'][0x0]['id']})[_0x1e86('0x22')](function(_0x237371){_0x51add8[_0x1e86('0xba')][_0x1e86('0xb8')]=[];_0x51add8[_0x1e86('0xba')][_0x1e86('0xb8')]['push'](_0x237371[_0x1e86('0xba')]);return _0x51add8;});})[_0x1e86('0x22')](function(_0x2fb19b){respondWithRpcPromise(_0x1e86('0xbb'),_0x1e86('0xbb'),{'FaxAccountId':_[_0x1e86('0xb1')](_0x4b3f08['params']['id'])?undefined:_0x4b3f08['params']['id'],'path':_[_0x1e86('0xb1')](_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')][0x0][_0x1e86('0x9')])?undefined:_0x4b3f08[_0x1e86('0x5f')][_0x1e86('0xab')][0x0][_0x1e86('0x9')],'fax':_[_0x1e86('0xb1')](_0x4b3f08[_0x1e86('0x5f')]['to'][0x0])?undefined:_0x4b3f08['body']['to'][0x0],'AttachmentId':_0x4b3f08['body'][_0x1e86('0xab')][0x0]['id']},client9002)[_0x1e86('0x22')](function(_0x489605){logger['info'](_0x1e86('0xbc'),_0x489605);})[_0x1e86('0x2d')](function(_0x2d670d){logger['info']('SendFaxRpc,\x20%s',_0x2d670d);});return _0x2fb19b;})[_0x1e86('0x22')](respondWithResult(_0x280931,null))[_0x1e86('0x2d')](handleError(_0x280931,null));};exports['addAgents']=function(_0x3f7624,_0x5b9688,_0x32b7ec){return db[_0x1e86('0x41')][_0x1e86('0x5e')]({'where':{'id':_0x3f7624['params']['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x5b9688,null))[_0x1e86('0x22')](function(_0x201eb5){if(_0x201eb5){return _0x201eb5[_0x1e86('0xbd')](_0x3f7624[_0x1e86('0x5f')][_0x1e86('0x70')],_[_0x1e86('0x9d')](_0x3f7624['body'],['ids','id'])||{})[_0x1e86('0xbe')](function(_0x10f895){for(var _0x2f3717=0x0;_0x2f3717<_0x3f7624[_0x1e86('0x5f')][_0x1e86('0x70')][_0x1e86('0x4b')];_0x2f3717+=0x1){socket[_0x1e86('0xbf')](_0x1e86('0xc0'),{'UserId':_0x3f7624[_0x1e86('0x5f')][_0x1e86('0x70')][_0x2f3717],'FaxAccountId':_0x3f7624['params']['id']});}return _0x10f895;});}})[_0x1e86('0x22')](respondWithResult(_0x5b9688,null))[_0x1e86('0x2d')](handleError(_0x5b9688,null));};exports['removeAgents']=function(_0x41f3a9,_0x2700c1,_0x29b0ce){return db[_0x1e86('0x41')]['find']({'where':{'id':_0x41f3a9[_0x1e86('0x5b')]['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x2700c1,null))[_0x1e86('0x22')](function(_0xbb390e){if(_0xbb390e){return _0xbb390e[_0x1e86('0xc1')](_0x41f3a9['query'][_0x1e86('0x70')])['then'](function(){if(_['isArray'](_0x41f3a9[_0x1e86('0x45')][_0x1e86('0x70')])){for(var _0x2781b9=0x0;_0x2781b9<_0x41f3a9[_0x1e86('0x45')][_0x1e86('0x70')]['length'];_0x2781b9+=0x1){socket[_0x1e86('0xbf')](_0x1e86('0xc2'),{'UserId':Number(_0x41f3a9['query'][_0x1e86('0x70')][_0x2781b9]),'FaxAccountId':Number(_0x41f3a9[_0x1e86('0x5b')]['id'])});}}else{socket['emit'](_0x1e86('0xc2'),{'UserId':Number(_0x41f3a9['query'][_0x1e86('0x70')]),'FaxAccountId':Number(_0x41f3a9[_0x1e86('0x5b')]['id'])});}});}})[_0x1e86('0x22')](respondWithStatusCode(_0x2700c1,null))[_0x1e86('0x2d')](handleError(_0x2700c1,null));};exports[_0x1e86('0xc3')]=function(_0x578d35,_0x11f672,_0x2d79e9){var _0x4b6c92={};var _0x43079d={};var _0x18ae34;var _0xeabd4f;return db[_0x1e86('0x41')][_0x1e86('0x6d')]({'where':{'id':_0x578d35[_0x1e86('0x5b')]['id']}})[_0x1e86('0x22')](handleEntityNotFound(_0x11f672,null))[_0x1e86('0x22')](function(_0x4936d2){if(_0x4936d2){_0x18ae34=_0x4936d2;_0x43079d[_0x1e86('0x48')]=_[_0x1e86('0x46')](db[_0x1e86('0x78')][_0x1e86('0x5c')]);_0x43079d[_0x1e86('0x45')]=_[_0x1e86('0x46')](_0x578d35['query']);_0x43079d['filters']=_['intersection'](_0x43079d[_0x1e86('0x48')],_0x43079d['query']);_0x4b6c92[_0x1e86('0x49')]=_[_0x1e86('0x47')](_0x43079d['model'],qs[_0x1e86('0x4a')](_0x578d35[_0x1e86('0x45')][_0x1e86('0x4a')]));_0x4b6c92['attributes']=_0x4b6c92['attributes'][_0x1e86('0x4b')]?_0x4b6c92[_0x1e86('0x49')]:_0x43079d['model'];_0x4b6c92['order']=qs[_0x1e86('0x4f')](_0x578d35[_0x1e86('0x45')][_0x1e86('0x4f')]);_0x4b6c92[_0x1e86('0x50')]=qs[_0x1e86('0x52')](_[_0x1e86('0x51')](_0x578d35[_0x1e86('0x45')],_0x43079d['filters']));if(_0x578d35[_0x1e86('0x45')][_0x1e86('0x53')]){_0x4b6c92[_0x1e86('0x50')]=_['merge'](_0x4b6c92[_0x1e86('0x50')],{'$or':_['map'](_0x4b6c92[_0x1e86('0x49')],function(_0x59c697){var _0x11a1e7={};_0x11a1e7[_0x59c697]={'$like':'%'+_0x578d35[_0x1e86('0x45')]['filter']+'%'};return _0x11a1e7;})});}_0x4b6c92=_['merge']({},_0x4b6c92,_0x578d35[_0x1e86('0x5d')]);return _0x18ae34[_0x1e86('0xc3')](_0x4b6c92);}})[_0x1e86('0x22')](function(_0x1e6ac0){if(_0x1e6ac0){_0xeabd4f=_0x1e6ac0[_0x1e86('0x4b')];if(!_0x578d35['query'][_0x1e86('0x4c')](_0x1e86('0x6e'))){_0x4b6c92[_0x1e86('0x4d')]=qs['limit'](_0x578d35[_0x1e86('0x45')][_0x1e86('0x4d')]);_0x4b6c92['offset']=qs[_0x1e86('0x33')](_0x578d35['query'][_0x1e86('0x33')]);}return _0x18ae34['getAgents'](_0x4b6c92);}})[_0x1e86('0x22')](function(_0x39e0be){if(_0x39e0be){return _0x39e0be?{'count':_0xeabd4f,'rows':_0x39e0be}:null;}})[_0x1e86('0x22')](respondWithResult(_0x11f672,null))[_0x1e86('0x2d')](handleError(_0x11f672,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 2caea84..dcee474 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 _0xabe9=['../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xabe9,0xba));var _0x9abe=function(_0x46f471,_0x5d7a28){_0x46f471=_0x46f471-0x0;var _0x40d3ae=_0xabe9[_0x46f471];return _0x40d3ae;};'use strict';var EventEmitter=require(_0x9abe('0x0'));var FaxAccount=require(_0x9abe('0x1'))['db'][_0x9abe('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9abe('0x3')](0x0);var events={'afterCreate':_0x9abe('0x4'),'afterUpdate':_0x9abe('0x5'),'afterDestroy':_0x9abe('0x6')};function emitEvent(_0x4f6623){return function(_0x4dff8a,_0x4f7397,_0x2dbdae){FaxAccountEvents[_0x9abe('0x7')](_0x4f6623+':'+_0x4dff8a['id'],_0x4dff8a);FaxAccountEvents[_0x9abe('0x7')](_0x4f6623,_0x4dff8a);_0x2dbdae(null);};}for(var e in events){if(events[_0x9abe('0x8')](e)){var event=events[e];FaxAccount[_0x9abe('0x9')](e,emitEvent(event));}}module[_0x9abe('0xa')]=FaxAccountEvents; \ No newline at end of file +var _0x1d6f=['events','FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x46d9b7,_0x18ec96){var _0x4e41d1=function(_0x1c2566){while(--_0x1c2566){_0x46d9b7['push'](_0x46d9b7['shift']());}};_0x4e41d1(++_0x18ec96);}(_0x1d6f,0x87));var _0xf1d6=function(_0x7637f9,_0x231c65){_0x7637f9=_0x7637f9-0x0;var _0x170529=_0x1d6f[_0x7637f9];return _0x170529;};'use strict';var EventEmitter=require(_0xf1d6('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xf1d6('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf1d6('0x2')](0x0);var events={'afterCreate':_0xf1d6('0x3'),'afterUpdate':'update','afterDestroy':_0xf1d6('0x4')};function emitEvent(_0x4c63a4){return function(_0x151f85,_0x23d3fe,_0x275458){FaxAccountEvents[_0xf1d6('0x5')](_0x4c63a4+':'+_0x151f85['id'],_0x151f85);FaxAccountEvents[_0xf1d6('0x5')](_0x4c63a4,_0x151f85);_0x275458(null);};}for(var e in events){if(events[_0xf1d6('0x6')](e)){var event=events[e];FaxAccount[_0xf1d6('0x7')](e,emitEvent(event));}}module[_0xf1d6('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index d05ecb6..dd6e8ec 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 _0x1381=['../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x2aa4c8,_0x1f65b4){var _0x29edb8=function(_0x77caef){while(--_0x77caef){_0x2aa4c8['push'](_0x2aa4c8['shift']());}};_0x29edb8(++_0x1f65b4);}(_0x1381,0x73));var _0x1138=function(_0x1a8945,_0x1ae86a){_0x1a8945=_0x1a8945-0x0;var _0x3d4d66=_0x1381[_0x1a8945];return _0x3d4d66;};'use strict';var _=require(_0x1138('0x0'));var util=require(_0x1138('0x1'));var logger=require(_0x1138('0x2'))(_0x1138('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1138('0x4'));var rimraf=require(_0x1138('0x5'));var config=require(_0x1138('0x6'));var attributes=require('./faxAccount.attributes');module[_0x1138('0x7')]=function(_0x4d16fd,_0x88dd47){return _0x4d16fd[_0x1138('0x8')](_0x1138('0x9'),attributes,{'tableName':_0x1138('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88b2=['bluebird','request-promise','path','./faxAccount.attributes','exports','fax_accounts','lodash','../../config/logger','api','moment'];(function(_0x1dad92,_0x2f948c){var _0x90a9f6=function(_0x5644db){while(--_0x5644db){_0x1dad92['push'](_0x1dad92['shift']());}};_0x90a9f6(++_0x2f948c);}(_0x88b2,0x1c8));var _0x288b=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x88b2[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x288b('0x0'));var util=require('util');var logger=require(_0x288b('0x1'))(_0x288b('0x2'));var moment=require(_0x288b('0x3'));var BPromise=require(_0x288b('0x4'));var rp=require(_0x288b('0x5'));var fs=require('fs');var path=require(_0x288b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x288b('0x7'));module[_0x288b('0x8')]=function(_0x41237f,_0xef174e){return _0x41237f['define']('FaxAccount',attributes,{'tableName':_0x288b('0x9'),'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 50b5c49..5818512 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 _0x3750=['findAll','options','raw','where','attributes','include','map','model','body','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','find','account','CmList','List','Contacts','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','defaults','ListId','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','created','interaction','FaxMessage','ContactId','User','UserId','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./faxAccount.socket','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','GetFaxAccount','FaxAccount'];(function(_0x3cc57d,_0xd9c5f1){var _0x5b1311=function(_0x1fd4d8){while(--_0x1fd4d8){_0x3cc57d['push'](_0x3cc57d['shift']());}};_0x5b1311(++_0xd9c5f1);}(_0x3750,0x152));var _0x0375=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0x3750[_0x4dbba7];return _0x43ef83;};'use strict';var _=require(_0x0375('0x0'));var util=require(_0x0375('0x1'));var moment=require(_0x0375('0x2'));var BPromise=require(_0x0375('0x3'));var rs=require(_0x0375('0x4'));var fs=require('fs');var Redis=require(_0x0375('0x5'));var db=require(_0x0375('0x6'))['db'];var utils=require(_0x0375('0x7'));var logger=require(_0x0375('0x8'))(_0x0375('0x9'));var config=require(_0x0375('0xa'));var jayson=require(_0x0375('0xb'));var client=jayson[_0x0375('0xc')][_0x0375('0xd')]({'port':0x232c});config[_0x0375('0xe')]=_['defaults'](config[_0x0375('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0375('0xe')]));require(_0x0375('0xf'))['register'](socket);function respondWithRpcPromise(_0x1a7c63,_0x3db74a,_0x57695d){return new BPromise(function(_0x15cfa2,_0x346083){return client[_0x0375('0x10')](_0x1a7c63,_0x57695d)[_0x0375('0x11')](function(_0x360705){logger['info']('FaxAccount,\x20%s,\x20%s',_0x3db74a,_0x0375('0x12'));logger[_0x0375('0x13')](_0x0375('0x14'),_0x3db74a,_0x0375('0x12'),JSON['stringify'](_0x360705));if(_0x360705[_0x0375('0x15')]){if(_0x360705[_0x0375('0x15')][_0x0375('0x16')]===0x1f4){logger[_0x0375('0x15')](_0x0375('0x17'),_0x3db74a,_0x360705[_0x0375('0x15')][_0x0375('0x18')]);return _0x346083(_0x360705['error']['message']);}logger[_0x0375('0x15')]('FaxAccount,\x20%s,\x20%s',_0x3db74a,_0x360705['error'][_0x0375('0x18')]);return _0x15cfa2(_0x360705[_0x0375('0x15')][_0x0375('0x18')]);}else{logger[_0x0375('0x19')](_0x0375('0x17'),_0x3db74a,'request\x20sent');_0x15cfa2(_0x360705[_0x0375('0x1a')][_0x0375('0x18')]);}})[_0x0375('0x1b')](function(_0x221c8c){logger[_0x0375('0x15')]('FaxAccount,\x20%s,\x20%s',_0x3db74a,_0x221c8c);_0x346083(_0x221c8c);});});}exports[_0x0375('0x1c')]=function(_0x1fbce2){var _0xce8f18=this;return new Promise(function(_0x5dee10,_0x265aba){return db[_0x0375('0x1d')][_0x0375('0x1e')]({'raw':_0x1fbce2[_0x0375('0x1f')]?_0x1fbce2['options'][_0x0375('0x20')]===undefined?!![]:![]:!![],'where':_0x1fbce2['options']?_0x1fbce2[_0x0375('0x1f')][_0x0375('0x21')]||null:null,'attributes':_0x1fbce2[_0x0375('0x1f')]?_0x1fbce2['options'][_0x0375('0x22')]||null:null,'limit':_0x1fbce2['options']?_0x1fbce2['options']['limit']||null:null,'include':_0x1fbce2['options']?_0x1fbce2[_0x0375('0x1f')][_0x0375('0x23')]?_[_0x0375('0x24')](_0x1fbce2[_0x0375('0x1f')][_0x0375('0x23')],function(_0x310bb2){return{'model':db[_0x310bb2[_0x0375('0x25')]],'as':_0x310bb2['as'],'attributes':_0x310bb2[_0x0375('0x22')],'include':_0x310bb2[_0x0375('0x23')]?_[_0x0375('0x24')](_0x310bb2[_0x0375('0x23')],function(_0x4a6536){return{'model':db[_0x4a6536[_0x0375('0x25')]],'as':_0x4a6536['as'],'attributes':_0x4a6536[_0x0375('0x22')],'include':_0x4a6536[_0x0375('0x23')]?_['map'](_0x4a6536['include'],function(_0x2e924f){return{'model':db[_0x2e924f['model']],'as':_0x2e924f['as'],'attributes':_0x2e924f[_0x0375('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf6ecfa){logger[_0x0375('0x19')](_0x0375('0x1c'),_0x1fbce2);logger[_0x0375('0x13')](_0x0375('0x1c'),_0x1fbce2,JSON['stringify'](_0xf6ecfa));_0x5dee10(_0xf6ecfa);})[_0x0375('0x1b')](function(_0x1a4e28){logger['error'](_0x0375('0x1c'),_0x1a4e28[_0x0375('0x18')],_0x1fbce2);_0x265aba(_0xce8f18['error'](0x1f4,_0x1a4e28[_0x0375('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x3b0926,_0x219cd3,_0xf086c8){var _0x5909c1=this;return new Promise(function(_0x3500fe,_0x3aa48e){var _0x454003={'body':_0x3b0926[_0x0375('0x26')],'channel':'fax'};var _0x411968=[];var _0x3513b9=[];var _0x5d133d={};return db[_0x0375('0x27')][_0x0375('0x28')]()[_0x0375('0x11')](function(_0x3eb567){if(!_0x3eb567){throw new db['Sequelize'][(_0x0375('0x29'))](_0x0375('0x2a'));}_0x411968=_[_0x0375('0x2b')](_['keys'](_0x3eb567),[_0x0375('0x2c'),_0x0375('0x2d')]);_0x3513b9=_[_0x0375('0x2b')](_['keys'](_0x3eb567),['createdAt',_0x0375('0x2d'),_0x0375('0x2e'),'ListId']);if(_0x3b0926[_0x0375('0x26')]['id']){delete _0x3b0926[_0x0375('0x26')]['id'];}if(_['isNil'](_0x3b0926[_0x0375('0x26')][_0x0375('0x2f')])){throw new db['Sequelize'][(_0x0375('0x29'))](_0x0375('0x30'));}if(_[_0x0375('0x31')](_0x3b0926[_0x0375('0x26')][_0x0375('0x26')])||_0x3b0926['body'][_0x0375('0x26')]===''){throw new db[(_0x0375('0x32'))]['ValidationError'](_0x0375('0x33'));}if(_['isNil'](_0x3b0926['body'][_0x0375('0x34')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3513b9);}if(!_[_0x0375('0x35')](_0x3513b9,_0x3b0926[_0x0375('0x26')]['mapKey'])){throw new db[(_0x0375('0x32'))][(_0x0375('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3513b9);}_0x5d133d[_0x3b0926['body'][_0x0375('0x34')]]=_0x3b0926[_0x0375('0x26')][_0x0375('0x2f')];})['then'](function(){return db[_0x0375('0x1d')][_0x0375('0x36')]({'where':{'id':_0x3b0926[_0x0375('0x37')]['id']},'include':[{'model':db[_0x0375('0x38')],'as':_0x0375('0x39'),'include':[{'model':db[_0x0375('0x27')],'as':_0x0375('0x3a'),'where':_0x5d133d,'limit':0x1,'order':[[_0x0375('0x2d'),'DESC']]}]},{'model':db[_0x0375('0x3b')],'as':_0x0375('0x3c')}]});})['then'](function(_0x5c0440){if(_0x5c0440&&_0x5c0440['List']){var _0x58f76b=_0x5c0440[_0x0375('0x3d')]({'plain':!![]});_0x454003[_0x0375('0x37')]=_0x58f76b;_0x454003[_0x0375('0x3e')]=_0x58f76b['Applications'];_0x454003[_0x0375('0x3f')]=_0x58f76b[_0x0375('0x39')];_0x454003[_0x0375('0x3e')]=_[_0x0375('0x40')](_0x454003[_0x0375('0x3e')],[_0x0375('0x41')],[_0x0375('0x42')]);if(_0x454003[_0x0375('0x37')][_0x0375('0x3c')]){delete _0x454003['account']['Applications'];}if(_0x454003[_0x0375('0x37')][_0x0375('0x39')]&&_0x454003[_0x0375('0x37')]['List'][_0x0375('0x3a')][_0x0375('0x43')]){return _0x454003[_0x0375('0x37')]['List'][_0x0375('0x3a')][0x0];}var _0x1c777f=_[_0x0375('0x44')](_0x3b0926[_0x0375('0x26')],{'firstName':_0x3b0926[_0x0375('0x26')]['from'],'ListId':_0x58f76b[_0x0375('0x45')]});_0x1c777f[_0x3b0926[_0x0375('0x26')][_0x0375('0x34')]]=_0x3b0926[_0x0375('0x26')]['from'];return db['CmContact'][_0x0375('0x46')](_0x1c777f,{'fields':_0x411968,'raw':!![]});}})[_0x0375('0x11')](function(_0x108728){_0x454003[_0x0375('0x47')]=_0x108728;if(_0x108728){var _0x3f931a={'ContactId':_0x108728['id'],'FaxAccountId':_0x3b0926[_0x0375('0x37')]['id'],'fax':_0x108728[_0x0375('0x48')]};return db[_0x0375('0x49')][_0x0375('0x36')]({'where':{'ContactId':_0x108728['id'],'closed':![],'FaxAccountId':_0x3b0926[_0x0375('0x37')]['id']}})[_0x0375('0x11')](function(_0x3423ef){if(_0x3423ef){return[_0x3423ef,![]];}return db[_0x0375('0x49')]['create'](_0x3f931a)['then'](function(_0x4439e3){return[_0x4439e3,!![]];});});}else{throw new Error(_0x0375('0x4a'));}})[_0x0375('0x4b')](function(_0x1735b2,_0x380ed2){var _0x6bf8fd=_0x1735b2[_0x0375('0x3d')]({'plain':!![]});if(_0x380ed2){if(_0x454003['account'][_0x0375('0x4c')]){_0x454003['applications'][_0x0375('0x4d')]({'id':0x0,'priority':_0x454003[_0x0375('0x3e')][_0x0375('0x43')]+0x1,'app':_0x0375('0x4e'),'appdata':_0x0375('0x4f'),'interval':'*,*,*,*'});}_0x6bf8fd[_0x0375('0x50')]=!![];}else{_0x6bf8fd[_0x0375('0x50')]=![];}_0x454003[_0x0375('0x51')]=_0x6bf8fd;return db[_0x0375('0x52')][_0x0375('0x46')]({'body':_0x3b0926[_0x0375('0x26')][_0x0375('0x26')],'FaxAccountId':_0x3b0926[_0x0375('0x37')]['id'],'FaxInteractionId':_0x1735b2['id'],'direction':'in','ContactId':_0x1735b2[_0x0375('0x53')],'AttachmentId':_0x3b0926[_0x0375('0x26')]['AttachmentId']});})[_0x0375('0x11')](function(_0x912e8e){_0x454003[_0x0375('0x18')]=_0x912e8e;if(_0x454003[_0x0375('0x51')]['UserId']){return db[_0x0375('0x54')][_0x0375('0x36')]({'attributes':['id','name'],'where':{'id':_0x454003[_0x0375('0x51')][_0x0375('0x55')]}})[_0x0375('0x11')](function(_0xeccf19){if(_0xeccf19){_0x454003[_0x0375('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0375('0x56'),'appdata':_0xeccf19[_0x0375('0x57')]+','+(_0x454003[_0x0375('0x37')][_0x0375('0x58')]||0xa),'interval':_0x0375('0x59')});}return respondWithRpcPromise(_0x0375('0x5a'),_0x0375('0x5b'),_0x454003);});}return respondWithRpcPromise(_0x0375('0x5a'),_0x0375('0x5b'),_0x454003);})['then'](function(_0x114f89){_0x3500fe(_0x114f89);})['catch'](function(_0x309fd3){_0x3aa48e(_0x5909c1[_0x0375('0x15')](0x1f4,_0x309fd3[_0x0375('0x18')]));});});}; \ No newline at end of file +var _0xe39c=['map','model','NotifyFaxAccount','CmContact','describe','Sequelize','ValidationError','keys','createdAt','difference','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','create','contact','fax','FaxInteraction','Contact\x20not\x20found','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x223af1,_0x448409){var _0xed620e=function(_0x5ba637){while(--_0x5ba637){_0x223af1['push'](_0x223af1['shift']());}};_0xed620e(++_0x448409);}(_0xe39c,0x98));var _0xce39=function(_0x2113d8,_0x5a3232){_0x2113d8=_0x2113d8-0x0;var _0x1c8538=_0xe39c[_0x2113d8];return _0x1c8538;};'use strict';var _=require(_0xce39('0x0'));var util=require(_0xce39('0x1'));var moment=require(_0xce39('0x2'));var BPromise=require(_0xce39('0x3'));var rs=require(_0xce39('0x4'));var fs=require('fs');var Redis=require(_0xce39('0x5'));var db=require(_0xce39('0x6'))['db'];var utils=require(_0xce39('0x7'));var logger=require(_0xce39('0x8'))(_0xce39('0x9'));var config=require(_0xce39('0xa'));var jayson=require(_0xce39('0xb'));var client=jayson[_0xce39('0xc')]['http']({'port':0x232c});config[_0xce39('0xd')]=_['defaults'](config[_0xce39('0xd')],{'host':_0xce39('0xe'),'port':0x18eb});var socket=require(_0xce39('0xf'))(new Redis(config[_0xce39('0xd')]));require(_0xce39('0x10'))[_0xce39('0x11')](socket);function respondWithRpcPromise(_0x62d8c5,_0x7e2423,_0x3bfc80){return new BPromise(function(_0x2f5828,_0x133f6d){return client[_0xce39('0x12')](_0x62d8c5,_0x3bfc80)[_0xce39('0x13')](function(_0x36d262){logger[_0xce39('0x14')](_0xce39('0x15'),_0x7e2423,'request\x20sent');logger[_0xce39('0x16')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x7e2423,_0xce39('0x17'),JSON[_0xce39('0x18')](_0x36d262));if(_0x36d262['error']){if(_0x36d262[_0xce39('0x19')][_0xce39('0x1a')]===0x1f4){logger[_0xce39('0x19')](_0xce39('0x15'),_0x7e2423,_0x36d262[_0xce39('0x19')]['message']);return _0x133f6d(_0x36d262[_0xce39('0x19')]['message']);}logger[_0xce39('0x19')](_0xce39('0x15'),_0x7e2423,_0x36d262['error'][_0xce39('0x1b')]);return _0x2f5828(_0x36d262[_0xce39('0x19')]['message']);}else{logger[_0xce39('0x14')](_0xce39('0x15'),_0x7e2423,_0xce39('0x17'));_0x2f5828(_0x36d262[_0xce39('0x1c')][_0xce39('0x1b')]);}})[_0xce39('0x1d')](function(_0x49a35a){logger[_0xce39('0x19')]('FaxAccount,\x20%s,\x20%s',_0x7e2423,_0x49a35a);_0x133f6d(_0x49a35a);});});}exports[_0xce39('0x1e')]=function(_0x3a2532){var _0x14eaf2=this;return new Promise(function(_0x5bcb6d,_0x324d1a){return db['FaxAccount'][_0xce39('0x1f')]({'raw':_0x3a2532[_0xce39('0x20')]?_0x3a2532[_0xce39('0x20')][_0xce39('0x21')]===undefined?!![]:![]:!![],'where':_0x3a2532[_0xce39('0x20')]?_0x3a2532[_0xce39('0x20')][_0xce39('0x22')]||null:null,'attributes':_0x3a2532['options']?_0x3a2532[_0xce39('0x20')][_0xce39('0x23')]||null:null,'limit':_0x3a2532[_0xce39('0x20')]?_0x3a2532[_0xce39('0x20')][_0xce39('0x24')]||null:null,'include':_0x3a2532['options']?_0x3a2532['options'][_0xce39('0x25')]?_[_0xce39('0x26')](_0x3a2532[_0xce39('0x20')][_0xce39('0x25')],function(_0x110eef){return{'model':db[_0x110eef[_0xce39('0x27')]],'as':_0x110eef['as'],'attributes':_0x110eef[_0xce39('0x23')],'include':_0x110eef[_0xce39('0x25')]?_['map'](_0x110eef['include'],function(_0x33a445){return{'model':db[_0x33a445[_0xce39('0x27')]],'as':_0x33a445['as'],'attributes':_0x33a445[_0xce39('0x23')],'include':_0x33a445[_0xce39('0x25')]?_[_0xce39('0x26')](_0x33a445['include'],function(_0x29199e){return{'model':db[_0x29199e[_0xce39('0x27')]],'as':_0x29199e['as'],'attributes':_0x29199e['attributes']};}):[]};}):[]};}):[]:[]})[_0xce39('0x13')](function(_0x8e95dd){logger[_0xce39('0x14')](_0xce39('0x1e'),_0x3a2532);logger[_0xce39('0x16')](_0xce39('0x1e'),_0x3a2532,JSON[_0xce39('0x18')](_0x8e95dd));_0x5bcb6d(_0x8e95dd);})[_0xce39('0x1d')](function(_0x15bed5){logger[_0xce39('0x19')]('GetFaxAccount',_0x15bed5['message'],_0x3a2532);_0x324d1a(_0x14eaf2[_0xce39('0x19')](0x1f4,_0x15bed5[_0xce39('0x1b')]));});});};exports[_0xce39('0x28')]=function(_0x1c7598,_0x19f8d2,_0x1ab374){var _0x194900=this;return new Promise(function(_0x22c6e9,_0x305eec){var _0x4cdd62={'body':_0x1c7598['body'],'channel':'fax'};var _0x5d0e83=[];var _0x379185=[];var _0x3b0032={};return db[_0xce39('0x29')][_0xce39('0x2a')]()['then'](function(_0x23b394){if(!_0x23b394){throw new db[(_0xce39('0x2b'))][(_0xce39('0x2c'))]('no\x20available\x20attributes');}_0x5d0e83=_['difference'](_[_0xce39('0x2d')](_0x23b394),[_0xce39('0x2e'),'updatedAt']);_0x379185=_[_0xce39('0x2f')](_[_0xce39('0x2d')](_0x23b394),[_0xce39('0x2e'),_0xce39('0x30'),_0xce39('0x31'),_0xce39('0x32')]);if(_0x1c7598['body']['id']){delete _0x1c7598[_0xce39('0x33')]['id'];}if(_[_0xce39('0x34')](_0x1c7598[_0xce39('0x33')][_0xce39('0x35')])){throw new db[(_0xce39('0x2b'))]['ValidationError'](_0xce39('0x36'));}if(_[_0xce39('0x34')](_0x1c7598[_0xce39('0x33')]['body'])||_0x1c7598['body']['body']===''){throw new db[(_0xce39('0x2b'))][(_0xce39('0x2c'))](_0xce39('0x37'));}if(_[_0xce39('0x34')](_0x1c7598['body'][_0xce39('0x38')])){throw new db[(_0xce39('0x2b'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x379185);}if(!_[_0xce39('0x39')](_0x379185,_0x1c7598[_0xce39('0x33')][_0xce39('0x38')])){throw new db['Sequelize'][(_0xce39('0x2c'))](_0xce39('0x3a')+_0x379185);}_0x3b0032[_0x1c7598[_0xce39('0x33')][_0xce39('0x38')]]=_0x1c7598[_0xce39('0x33')][_0xce39('0x35')];})[_0xce39('0x13')](function(){return db[_0xce39('0x3b')][_0xce39('0x3c')]({'where':{'id':_0x1c7598[_0xce39('0x3d')]['id']},'include':[{'model':db['CmList'],'as':_0xce39('0x3e'),'include':[{'model':db[_0xce39('0x29')],'as':_0xce39('0x3f'),'where':_0x3b0032,'limit':0x1,'order':[['updatedAt',_0xce39('0x40')]]}]},{'model':db[_0xce39('0x41')],'as':_0xce39('0x42')}]});})[_0xce39('0x13')](function(_0x226665){if(_0x226665&&_0x226665['List']){var _0xddd46e=_0x226665[_0xce39('0x43')]({'plain':!![]});_0x4cdd62['account']=_0xddd46e;_0x4cdd62[_0xce39('0x44')]=_0xddd46e['Applications'];_0x4cdd62[_0xce39('0x45')]=_0xddd46e[_0xce39('0x3e')];_0x4cdd62[_0xce39('0x44')]=_[_0xce39('0x46')](_0x4cdd62['applications'],[_0xce39('0x47')],[_0xce39('0x48')]);if(_0x4cdd62[_0xce39('0x3d')][_0xce39('0x42')]){delete _0x4cdd62[_0xce39('0x3d')][_0xce39('0x42')];}if(_0x4cdd62[_0xce39('0x3d')][_0xce39('0x3e')]&&_0x4cdd62[_0xce39('0x3d')][_0xce39('0x3e')][_0xce39('0x3f')][_0xce39('0x49')]){return _0x4cdd62[_0xce39('0x3d')]['List'][_0xce39('0x3f')][0x0];}var _0xdd9848=_['defaults'](_0x1c7598[_0xce39('0x33')],{'firstName':_0x1c7598[_0xce39('0x33')][_0xce39('0x35')],'ListId':_0xddd46e[_0xce39('0x32')]});_0xdd9848[_0x1c7598[_0xce39('0x33')][_0xce39('0x38')]]=_0x1c7598[_0xce39('0x33')][_0xce39('0x35')];return db[_0xce39('0x29')][_0xce39('0x4a')](_0xdd9848,{'fields':_0x5d0e83,'raw':!![]});}})['then'](function(_0x4f82b0){_0x4cdd62[_0xce39('0x4b')]=_0x4f82b0;if(_0x4f82b0){var _0x3204e1={'ContactId':_0x4f82b0['id'],'FaxAccountId':_0x1c7598[_0xce39('0x3d')]['id'],'fax':_0x4f82b0[_0xce39('0x4c')]};return db[_0xce39('0x4d')]['find']({'where':{'ContactId':_0x4f82b0['id'],'closed':![],'FaxAccountId':_0x1c7598[_0xce39('0x3d')]['id']}})[_0xce39('0x13')](function(_0xcc88e7){if(_0xcc88e7){return[_0xcc88e7,![]];}return db[_0xce39('0x4d')][_0xce39('0x4a')](_0x3204e1)[_0xce39('0x13')](function(_0x14308e){return[_0x14308e,!![]];});});}else{throw new Error(_0xce39('0x4e'));}})['spread'](function(_0x4147e2,_0x3df93a){var _0x21254d=_0x4147e2[_0xce39('0x43')]({'plain':!![]});if(_0x3df93a){if(_0x4cdd62[_0xce39('0x3d')]['autoclose']){_0x4cdd62['applications'][_0xce39('0x4f')]({'id':0x0,'priority':_0x4cdd62[_0xce39('0x44')][_0xce39('0x49')]+0x1,'app':_0xce39('0x50'),'appdata':_0xce39('0x51'),'interval':_0xce39('0x52')});}_0x21254d[_0xce39('0x53')]=!![];}else{_0x21254d[_0xce39('0x53')]=![];}_0x4cdd62[_0xce39('0x54')]=_0x21254d;return db[_0xce39('0x55')]['create']({'body':_0x1c7598[_0xce39('0x33')][_0xce39('0x33')],'FaxAccountId':_0x1c7598['account']['id'],'FaxInteractionId':_0x4147e2['id'],'direction':'in','ContactId':_0x4147e2[_0xce39('0x56')],'AttachmentId':_0x1c7598['body'][_0xce39('0x57')]});})[_0xce39('0x13')](function(_0x4059fe){_0x4cdd62[_0xce39('0x1b')]=_0x4059fe;if(_0x4cdd62['interaction'][_0xce39('0x58')]){return db[_0xce39('0x59')]['find']({'attributes':['id',_0xce39('0x5a')],'where':{'id':_0x4cdd62['interaction']['UserId']}})[_0xce39('0x13')](function(_0x37f24e){if(_0x37f24e){_0x4cdd62[_0xce39('0x44')][_0xce39('0x5b')]({'id':0x0,'priority':0x0,'app':_0xce39('0x5c'),'appdata':_0x37f24e[_0xce39('0x5a')]+','+(_0x4cdd62[_0xce39('0x3d')]['waitForTheAssignedAgent']||0xa),'interval':_0xce39('0x52')});}return respondWithRpcPromise(_0xce39('0x5d'),_0xce39('0x5e'),_0x4cdd62);});}return respondWithRpcPromise(_0xce39('0x5d'),_0xce39('0x5e'),_0x4cdd62);})['then'](function(_0x36dd0d){_0x22c6e9(_0x36dd0d);})['catch'](function(_0x446661){_0x305eec(_0x194900[_0xce39('0x19')](0x1f4,_0x446661[_0xce39('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index e45fc4b..8a00ae4 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 _0x32f4=['removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0xb7c380,_0x5b5862){var _0xda1073=function(_0xa5fa33){while(--_0xa5fa33){_0xb7c380['push'](_0xb7c380['shift']());}};_0xda1073(++_0x5b5862);}(_0x32f4,0x154));var _0x432f=function(_0x5f18a1,_0x5aa5e5){_0x5f18a1=_0x5f18a1-0x0;var _0xf65dd6=_0x32f4[_0x5f18a1];return _0xf65dd6;};'use strict';var FaxAccountEvents=require(_0x432f('0x0'));var events=[_0x432f('0x1'),_0x432f('0x2'),_0x432f('0x3')];function createListener(_0x5ee65a,_0x2a4628){return function(_0x6f0e8a){_0x2a4628['emit'](_0x5ee65a,_0x6f0e8a);};}function removeListener(_0x354293,_0x1eabac){return function(){FaxAccountEvents[_0x432f('0x4')](_0x354293,_0x1eabac);};}exports[_0x432f('0x5')]=function(_0x2f5f03){for(var _0x5d8cc0=0x0,_0x5b5f08=events[_0x432f('0x6')];_0x5d8cc0<_0x5b5f08;_0x5d8cc0++){var _0x32b062=events[_0x5d8cc0];var _0x4a5b56=createListener(_0x432f('0x7')+_0x32b062,_0x2f5f03);FaxAccountEvents['on'](_0x32b062,_0x4a5b56);}}; \ No newline at end of file +var _0xda2d=['remove','update','removeListener','register','length','faxAccount:','save'];(function(_0x318dfd,_0x234934){var _0x17ecd5=function(_0x5cec22){while(--_0x5cec22){_0x318dfd['push'](_0x318dfd['shift']());}};_0x17ecd5(++_0x234934);}(_0xda2d,0x102));var _0xdda2=function(_0x206658,_0x4cdbc8){_0x206658=_0x206658-0x0;var _0x376d79=_0xda2d[_0x206658];return _0x376d79;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2')];function createListener(_0x1f1fcc,_0x329c5e){return function(_0x58973d){_0x329c5e['emit'](_0x1f1fcc,_0x58973d);};}function removeListener(_0x5a5f9f,_0x357e97){return function(){FaxAccountEvents[_0xdda2('0x3')](_0x5a5f9f,_0x357e97);};}exports[_0xdda2('0x4')]=function(_0x39f6c9){for(var _0xc256bc=0x0,_0xf38e58=events[_0xdda2('0x5')];_0xc256bc<_0xf38e58;_0xc256bc++){var _0x436676=events[_0xc256bc];var _0x2e2523=createListener(_0xdda2('0x6')+_0x436676,_0x39f6c9);FaxAccountEvents['on'](_0x436676,_0x2e2523);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 6e0e4a3..ae75029 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 _0x0a96=['getAgents','post','create','addDisposition','addAnswer','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a96,0xaf));var _0x60a9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0a96[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x60a9('0x0'));var util=require(_0x60a9('0x1'));var path=require(_0x60a9('0x2'));var timeout=require(_0x60a9('0x3'));var express=require(_0x60a9('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x60a9('0x5'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x60a9('0x6')]('/',auth[_0x60a9('0x7')](),controller['index']);router[_0x60a9('0x6')]('/describe',auth[_0x60a9('0x7')](),controller[_0x60a9('0x8')]);router[_0x60a9('0x6')](_0x60a9('0x9'),auth[_0x60a9('0x7')](),controller[_0x60a9('0xa')]);router[_0x60a9('0x6')](_0x60a9('0xb'),auth[_0x60a9('0x7')](),controller['getDispositions']);router[_0x60a9('0x6')](_0x60a9('0xc'),auth[_0x60a9('0x7')](),controller[_0x60a9('0xd')]);router[_0x60a9('0x6')](_0x60a9('0xe'),auth[_0x60a9('0x7')](),controller[_0x60a9('0xf')]);router[_0x60a9('0x6')]('/:id/applications',auth[_0x60a9('0x7')](),controller[_0x60a9('0x10')]);router[_0x60a9('0x6')](_0x60a9('0x11'),auth[_0x60a9('0x7')](),controller[_0x60a9('0x12')]);router['get'](_0x60a9('0x13'),auth[_0x60a9('0x7')](),controller[_0x60a9('0x14')]);router[_0x60a9('0x15')]('/',auth['isAuthenticated'](),controller[_0x60a9('0x16')]);router[_0x60a9('0x15')](_0x60a9('0xb'),auth[_0x60a9('0x7')](),controller[_0x60a9('0x17')]);router[_0x60a9('0x15')](_0x60a9('0xc'),auth[_0x60a9('0x7')](),controller[_0x60a9('0x18')]);router[_0x60a9('0x15')](_0x60a9('0xe'),auth[_0x60a9('0x7')](),controller['addInteraction']);router[_0x60a9('0x15')](_0x60a9('0x19'),auth[_0x60a9('0x7')](),controller[_0x60a9('0x1a')]);router[_0x60a9('0x15')](_0x60a9('0x1b'),auth[_0x60a9('0x7')](),controller[_0x60a9('0x1c')]);router['post'](_0x60a9('0x1d'),auth['isAuthenticated'](),controller[_0x60a9('0x1e')]);router[_0x60a9('0x15')](_0x60a9('0x1f'),auth[_0x60a9('0x7')](),controller['send']);router['post'](_0x60a9('0x13'),auth[_0x60a9('0x7')](),controller[_0x60a9('0x20')]);router[_0x60a9('0x21')](_0x60a9('0x9'),auth[_0x60a9('0x7')](),controller[_0x60a9('0x22')]);router[_0x60a9('0x23')](_0x60a9('0x9'),auth[_0x60a9('0x7')](),controller[_0x60a9('0x24')]);router[_0x60a9('0x23')](_0x60a9('0xb'),auth['isAuthenticated'](),controller[_0x60a9('0x25')]);router[_0x60a9('0x23')](_0x60a9('0xc'),auth[_0x60a9('0x7')](),controller['removeAnswers']);router[_0x60a9('0x23')](_0x60a9('0x13'),auth[_0x60a9('0x7')](),controller['removeAgents']);module[_0x60a9('0x26')]=router; \ No newline at end of file +var _0x7352=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getInteractions','getApplications','/:id/messages','getMessages','/:id/users','post','create','addDisposition','addAnswer','/:id/interactions','addInteraction','/:id/applications','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','put','delete','removeAnswers','exports','multer','util','path','connect-timeout','express'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x7352,0x19f));var _0x2735=function(_0x58a364,_0x3439f6){_0x58a364=_0x58a364-0x0;var _0x409b74=_0x7352[_0x58a364];return _0x409b74;};'use strict';var multer=require(_0x2735('0x0'));var util=require(_0x2735('0x1'));var path=require(_0x2735('0x2'));var timeout=require(_0x2735('0x3'));var express=require(_0x2735('0x4'));var router=express[_0x2735('0x5')]();var auth=require(_0x2735('0x6'));var interaction=require(_0x2735('0x7'));var config=require(_0x2735('0x8'));var controller=require(_0x2735('0x9'));router['get']('/',auth[_0x2735('0xa')](),controller[_0x2735('0xb')]);router[_0x2735('0xc')](_0x2735('0xd'),auth['isAuthenticated'](),controller[_0x2735('0xe')]);router[_0x2735('0xc')](_0x2735('0xf'),auth[_0x2735('0xa')](),controller[_0x2735('0x10')]);router[_0x2735('0xc')](_0x2735('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x2735('0xc')](_0x2735('0x12'),auth['isAuthenticated'](),controller[_0x2735('0x13')]);router[_0x2735('0xc')]('/:id/interactions',auth[_0x2735('0xa')](),controller[_0x2735('0x14')]);router['get']('/:id/applications',auth[_0x2735('0xa')](),controller[_0x2735('0x15')]);router[_0x2735('0xc')](_0x2735('0x16'),auth[_0x2735('0xa')](),controller[_0x2735('0x17')]);router[_0x2735('0xc')](_0x2735('0x18'),auth[_0x2735('0xa')](),controller['getAgents']);router[_0x2735('0x19')]('/',auth[_0x2735('0xa')](),controller[_0x2735('0x1a')]);router[_0x2735('0x19')](_0x2735('0x11'),auth[_0x2735('0xa')](),controller[_0x2735('0x1b')]);router[_0x2735('0x19')](_0x2735('0x12'),auth['isAuthenticated'](),controller[_0x2735('0x1c')]);router[_0x2735('0x19')](_0x2735('0x1d'),auth[_0x2735('0xa')](),controller[_0x2735('0x1e')]);router[_0x2735('0x19')](_0x2735('0x1f'),auth['isAuthenticated'](),controller[_0x2735('0x20')]);router[_0x2735('0x19')]('/addaccountapplications',auth[_0x2735('0xa')](),controller[_0x2735('0x21')]);router['post'](_0x2735('0x22'),auth[_0x2735('0xa')](),controller[_0x2735('0x23')]);router[_0x2735('0x19')](_0x2735('0x24'),auth[_0x2735('0xa')](),controller[_0x2735('0x25')]);router[_0x2735('0x19')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x2735('0x26')](_0x2735('0xf'),auth[_0x2735('0xa')](),controller['update']);router[_0x2735('0x27')](_0x2735('0xf'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x2735('0x11'),auth[_0x2735('0xa')](),controller['removeDispositions']);router['delete'](_0x2735('0x12'),auth['isAuthenticated'](),controller[_0x2735('0x28')]);router[_0x2735('0x27')](_0x2735('0x18'),auth[_0x2735('0xa')](),controller['removeAgents']);module[_0x2735('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 336b218..dcf545a 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 _0x86c0=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x5aa0d1,_0x2e4b77){var _0xd6c2cb=function(_0x4c92f1){while(--_0x4c92f1){_0x5aa0d1['push'](_0x5aa0d1['shift']());}};_0xd6c2cb(++_0x2e4b77);}(_0x86c0,0x133));var _0x086c=function(_0x1af655,_0x28b928){_0x1af655=_0x1af655-0x0;var _0x29da01=_0x86c0[_0x1af655];return _0x29da01;};'use strict';var Sequelize=require(_0x086c('0x0'));module['exports']={'priority':{'type':Sequelize[_0x086c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x086c('0x2')],'allowNull':![],'defaultValue':_0x086c('0x3')},'appdata':{'type':Sequelize[_0x086c('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x086c('0x2')],'defaultValue':_0x086c('0x5')}}; \ No newline at end of file +var _0xf198=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x229d7c,_0x2e8fd1){var _0x35c63b=function(_0x2f6d3e){while(--_0x2f6d3e){_0x229d7c['push'](_0x229d7c['shift']());}};_0x35c63b(++_0x2e8fd1);}(_0xf198,0xd1));var _0x8f19=function(_0x509754,_0x2ad6e3){_0x509754=_0x509754-0x0;var _0x4c49e8=_0xf198[_0x509754];return _0x4c49e8;};'use strict';var Sequelize=require('sequelize');module[_0x8f19('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8f19('0x1')],'allowNull':![],'defaultValue':_0x8f19('0x2')},'appdata':{'type':Sequelize[_0x8f19('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8f19('0x1')],'defaultValue':_0x8f19('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index fa60171..e114294 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 _0x50b9=['find','create','body','params','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','FaxApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','rows','catch','include','options'];(function(_0x50bace,_0x16f8b7){var _0x25dc5e=function(_0x52340c){while(--_0x52340c){_0x50bace['push'](_0x50bace['shift']());}};_0x25dc5e(++_0x16f8b7);}(_0x50b9,0x171));var _0x950b=function(_0x5982a5,_0x3dc07b){_0x5982a5=_0x5982a5-0x0;var _0x159c80=_0x50b9[_0x5982a5];return _0x159c80;};'use strict';var pdf=require(_0x950b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x950b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x950b('0x2'));var rp=require(_0x950b('0x3'));var moment=require(_0x950b('0x4'));var BPromise=require(_0x950b('0x5'));var Mustache=require(_0x950b('0x6'));var util=require(_0x950b('0x7'));var path=require(_0x950b('0x8'));var sox=require(_0x950b('0x9'));var csv=require(_0x950b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x950b('0xb'));var squel=require(_0x950b('0xc'));var crypto=require(_0x950b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x950b('0xe'));var Papa=require(_0x950b('0xf'));var Redis=require(_0x950b('0x10'));var authService=require(_0x950b('0x11'));var qs=require(_0x950b('0x12'));var as=require(_0x950b('0x13'));var hardwareService=require(_0x950b('0x14'));var logger=require('../../config/logger')(_0x950b('0x15'));var utils=require(_0x950b('0x16'));var config=require('../../config/environment');var db=require(_0x950b('0x17'))['db'];function respondWithStatusCode(_0x590e7f,_0x571cd1){_0x571cd1=_0x571cd1||0xcc;return function(_0x27392f){if(_0x27392f){return _0x590e7f[_0x950b('0x18')](_0x571cd1);}return _0x590e7f[_0x950b('0x19')](_0x571cd1)[_0x950b('0x1a')]();};}function respondWithResult(_0x911121,_0x2c74f1){_0x2c74f1=_0x2c74f1||0xc8;return function(_0x2c5dea){if(_0x2c5dea){return _0x911121[_0x950b('0x19')](_0x2c74f1)[_0x950b('0x1b')](_0x2c5dea);}};}function respondWithFilteredResult(_0x597d6c,_0x3e6335){return function(_0x254bbe){if(_0x254bbe){var _0x24de12=_0x254bbe[_0x950b('0x1c')],_0x2a99bf=_0x3e6335[_0x950b('0x1d')],_0x468ea2=_0x3e6335['offset']+_0x3e6335[_0x950b('0x1e')],_0x1cc2d;if(_0x468ea2>=_0x24de12){_0x468ea2=_0x24de12;_0x1cc2d=0xc8;}else{_0x1cc2d=0xce;}_0x597d6c['status'](_0x1cc2d);return _0x597d6c[_0x950b('0x1f')](_0x950b('0x20'),_0x2a99bf+'-'+_0x468ea2+'/'+_0x24de12)[_0x950b('0x1b')](_0x254bbe);}return null;};}function patchUpdates(_0x3d80c6){return function(_0x10fc68){try{jsonpatch[_0x950b('0x21')](_0x10fc68,_0x3d80c6,!![]);}catch(_0x15c511){return BPromise[_0x950b('0x22')](_0x15c511);}return _0x10fc68[_0x950b('0x23')]();};}function saveUpdates(_0x3f9030,_0x270dc9){return function(_0x2d96bb){if(_0x2d96bb){return _0x2d96bb[_0x950b('0x24')](_0x3f9030)[_0x950b('0x25')](function(_0x2322d3){return _0x2322d3;});}return null;};}function removeEntity(_0x25e072,_0x2220e8){return function(_0x1b31e3){if(_0x1b31e3){return _0x1b31e3[_0x950b('0x26')]()[_0x950b('0x25')](function(){_0x25e072[_0x950b('0x19')](0xcc)[_0x950b('0x1a')]();});}};}function handleEntityNotFound(_0x56e489,_0x33a77b){return function(_0x434c72){if(!_0x434c72){_0x56e489[_0x950b('0x18')](0x194);}return _0x434c72;};}function handleError(_0x1ae88b,_0x16f6bc){_0x16f6bc=_0x16f6bc||0x1f4;return function(_0x499ed5){logger[_0x950b('0x27')](_0x499ed5[_0x950b('0x28')]);if(_0x499ed5[_0x950b('0x29')]){delete _0x499ed5[_0x950b('0x29')];}_0x1ae88b[_0x950b('0x19')](_0x16f6bc)['send'](_0x499ed5);};}exports['index']=function(_0x885c93,_0x40caf2){var _0x2b7477={},_0x362c94={},_0x49fa6a={'count':0x0,'rows':[]};var _0xfe455f=_[_0x950b('0x2a')](db[_0x950b('0x2b')][_0x950b('0x2c')],function(_0x34d38b){return{'name':_0x34d38b[_0x950b('0x2d')],'type':_0x34d38b[_0x950b('0x2e')][_0x950b('0x2f')]};});_0x362c94['model']=_[_0x950b('0x2a')](_0xfe455f,_0x950b('0x29'));_0x362c94[_0x950b('0x30')]=_[_0x950b('0x31')](_0x885c93[_0x950b('0x30')]);_0x362c94[_0x950b('0x32')]=_[_0x950b('0x33')](_0x362c94[_0x950b('0x34')],_0x362c94['query']);_0x2b7477[_0x950b('0x35')]=_[_0x950b('0x33')](_0x362c94[_0x950b('0x34')],qs[_0x950b('0x36')](_0x885c93[_0x950b('0x30')]['fields']));_0x2b7477[_0x950b('0x35')]=_0x2b7477[_0x950b('0x35')][_0x950b('0x37')]?_0x2b7477['attributes']:_0x362c94['model'];if(!_0x885c93[_0x950b('0x30')][_0x950b('0x38')](_0x950b('0x39'))){_0x2b7477[_0x950b('0x1e')]=qs[_0x950b('0x1e')](_0x885c93['query']['limit']);_0x2b7477[_0x950b('0x1d')]=qs[_0x950b('0x1d')](_0x885c93[_0x950b('0x30')][_0x950b('0x1d')]);}_0x2b7477[_0x950b('0x3a')]=qs[_0x950b('0x3b')](_0x885c93[_0x950b('0x30')][_0x950b('0x3b')]);_0x2b7477[_0x950b('0x3c')]=qs['filters'](_['pick'](_0x885c93[_0x950b('0x30')],_0x362c94[_0x950b('0x32')]));if(_0x885c93[_0x950b('0x30')][_0x950b('0x3d')]){_0x2b7477[_0x950b('0x3c')]=_[_0x950b('0x3e')](_0x2b7477[_0x950b('0x3c')],{'$or':_[_0x950b('0x2a')](_0xfe455f,function(_0x202c97){if(_0x202c97[_0x950b('0x2e')]!==_0x950b('0x3f')){var _0x5f277c={};_0x5f277c[_0x202c97[_0x950b('0x29')]]={'$like':'%'+_0x885c93[_0x950b('0x30')][_0x950b('0x3d')]+'%'};return _0x5f277c;}})});}_0x2b7477=_[_0x950b('0x3e')]({},_0x2b7477,_0x885c93['options']);var _0x9af598={'where':_0x2b7477['where']};return db['FaxApplication']['count'](_0x9af598)[_0x950b('0x25')](function(_0xd907f8){_0x49fa6a[_0x950b('0x1c')]=_0xd907f8;if(_0x885c93[_0x950b('0x30')][_0x950b('0x40')]){_0x2b7477['include']=[{'all':!![]}];}return db[_0x950b('0x2b')]['findAll'](_0x2b7477);})['then'](function(_0x432d67){_0x49fa6a[_0x950b('0x41')]=_0x432d67;return _0x49fa6a;})[_0x950b('0x25')](respondWithFilteredResult(_0x40caf2,_0x2b7477))[_0x950b('0x42')](handleError(_0x40caf2,null));};exports['show']=function(_0x3e1139,_0x2e263d){var _0x381855={'raw':!![],'where':{'id':_0x3e1139['params']['id']}},_0x4722c4={};_0x4722c4['model']=_[_0x950b('0x31')](db['FaxApplication'][_0x950b('0x2c')]);_0x4722c4[_0x950b('0x30')]=_['keys'](_0x3e1139[_0x950b('0x30')]);_0x4722c4[_0x950b('0x32')]=_[_0x950b('0x33')](_0x4722c4[_0x950b('0x34')],_0x4722c4[_0x950b('0x30')]);_0x381855['attributes']=_['intersection'](_0x4722c4['model'],qs['fields'](_0x3e1139[_0x950b('0x30')][_0x950b('0x36')]));_0x381855[_0x950b('0x35')]=_0x381855[_0x950b('0x35')]['length']?_0x381855[_0x950b('0x35')]:_0x4722c4[_0x950b('0x34')];if(_0x3e1139['query'][_0x950b('0x40')]){_0x381855[_0x950b('0x43')]=[{'all':!![]}];}_0x381855=_['merge']({},_0x381855,_0x3e1139[_0x950b('0x44')]);return db[_0x950b('0x2b')][_0x950b('0x45')](_0x381855)[_0x950b('0x25')](handleEntityNotFound(_0x2e263d,null))[_0x950b('0x25')](respondWithResult(_0x2e263d,null))['catch'](handleError(_0x2e263d,null));};exports[_0x950b('0x46')]=function(_0x3353ef,_0x45fc27){return db[_0x950b('0x2b')][_0x950b('0x46')](_0x3353ef[_0x950b('0x47')],{})[_0x950b('0x25')](respondWithResult(_0x45fc27,0xc9))[_0x950b('0x42')](handleError(_0x45fc27,null));};exports[_0x950b('0x24')]=function(_0x339934,_0xa827a1){if(_0x339934[_0x950b('0x47')]['id']){delete _0x339934[_0x950b('0x47')]['id'];}return db[_0x950b('0x2b')][_0x950b('0x45')]({'where':{'id':_0x339934['params']['id']}})[_0x950b('0x25')](handleEntityNotFound(_0xa827a1,null))[_0x950b('0x25')](saveUpdates(_0x339934['body'],null))['then'](respondWithResult(_0xa827a1,null))['catch'](handleError(_0xa827a1,null));};exports[_0x950b('0x26')]=function(_0x243d50,_0x1c3b0b){return db[_0x950b('0x2b')]['find']({'where':{'id':_0x243d50[_0x950b('0x48')]['id']}})[_0x950b('0x25')](handleEntityNotFound(_0x1c3b0b,null))[_0x950b('0x25')](removeEntity(_0x1c3b0b,null))[_0x950b('0x42')](handleError(_0x1c3b0b,null));}; \ No newline at end of file +var _0xa3e6=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','FaxApplication','rawAttributes','key','keys','query','model','attributes','intersection','fields','limit','offset','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','find','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0x73740d,_0x49a324){var _0x3eecfe=function(_0x21a628){while(--_0x21a628){_0x73740d['push'](_0x73740d['shift']());}};_0x3eecfe(++_0x49a324);}(_0xa3e6,0xbe));var _0x6a3e=function(_0xf26d38,_0x1adfc8){_0xf26d38=_0xf26d38-0x0;var _0x474b05=_0xa3e6[_0xf26d38];return _0x474b05;};'use strict';var pdf=require(_0x6a3e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6a3e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a3e('0x2'));var rp=require(_0x6a3e('0x3'));var moment=require(_0x6a3e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6a3e('0x5'));var util=require('util');var path=require(_0x6a3e('0x6'));var sox=require(_0x6a3e('0x7'));var csv=require(_0x6a3e('0x8'));var ejs=require(_0x6a3e('0x9'));var fs=require('fs');var _=require(_0x6a3e('0xa'));var squel=require('squel');var crypto=require(_0x6a3e('0xb'));var jsforce=require(_0x6a3e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a3e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a3e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6a3e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a3e('0x10'))(_0x6a3e('0x11'));var utils=require(_0x6a3e('0x12'));var config=require(_0x6a3e('0x13'));var db=require(_0x6a3e('0x14'))['db'];function respondWithStatusCode(_0x2de3cd,_0x4a3a97){_0x4a3a97=_0x4a3a97||0xcc;return function(_0x27e169){if(_0x27e169){return _0x2de3cd[_0x6a3e('0x15')](_0x4a3a97);}return _0x2de3cd[_0x6a3e('0x16')](_0x4a3a97)[_0x6a3e('0x17')]();};}function respondWithResult(_0x1364be,_0x31aefa){_0x31aefa=_0x31aefa||0xc8;return function(_0x222f7c){if(_0x222f7c){return _0x1364be['status'](_0x31aefa)[_0x6a3e('0x18')](_0x222f7c);}};}function respondWithFilteredResult(_0x13b172,_0x8ed74b){return function(_0x2a62a8){if(_0x2a62a8){var _0x500ccd=_0x2a62a8['count'],_0x462b8d=_0x8ed74b['offset'],_0x24666d=_0x8ed74b['offset']+_0x8ed74b['limit'],_0x5de9a7;if(_0x24666d>=_0x500ccd){_0x24666d=_0x500ccd;_0x5de9a7=0xc8;}else{_0x5de9a7=0xce;}_0x13b172[_0x6a3e('0x16')](_0x5de9a7);return _0x13b172[_0x6a3e('0x19')](_0x6a3e('0x1a'),_0x462b8d+'-'+_0x24666d+'/'+_0x500ccd)[_0x6a3e('0x18')](_0x2a62a8);}return null;};}function patchUpdates(_0x17fde0){return function(_0xc3d167){try{jsonpatch[_0x6a3e('0x1b')](_0xc3d167,_0x17fde0,!![]);}catch(_0x2f2150){return BPromise['reject'](_0x2f2150);}return _0xc3d167[_0x6a3e('0x1c')]();};}function saveUpdates(_0x58b7b9,_0xc0452f){return function(_0x5ae73b){if(_0x5ae73b){return _0x5ae73b[_0x6a3e('0x1d')](_0x58b7b9)[_0x6a3e('0x1e')](function(_0x6fd39a){return _0x6fd39a;});}return null;};}function removeEntity(_0x350b66,_0x58721c){return function(_0x4f7507){if(_0x4f7507){return _0x4f7507[_0x6a3e('0x1f')]()[_0x6a3e('0x1e')](function(){_0x350b66[_0x6a3e('0x16')](0xcc)[_0x6a3e('0x17')]();});}};}function handleEntityNotFound(_0x4e5a25,_0x1ae966){return function(_0x21b5aa){if(!_0x21b5aa){_0x4e5a25[_0x6a3e('0x15')](0x194);}return _0x21b5aa;};}function handleError(_0x2f95e2,_0x42a70e){_0x42a70e=_0x42a70e||0x1f4;return function(_0x32ef88){logger[_0x6a3e('0x20')](_0x32ef88[_0x6a3e('0x21')]);if(_0x32ef88[_0x6a3e('0x22')]){delete _0x32ef88[_0x6a3e('0x22')];}_0x2f95e2['status'](_0x42a70e)['send'](_0x32ef88);};}exports[_0x6a3e('0x23')]=function(_0x6cc7c4,_0x13bdc3){var _0x410d4b={},_0x254a0e={},_0x2d0ec1={'count':0x0,'rows':[]};var _0x411eb9=_[_0x6a3e('0x24')](db[_0x6a3e('0x25')][_0x6a3e('0x26')],function(_0x3a831b){return{'name':_0x3a831b['fieldName'],'type':_0x3a831b['type'][_0x6a3e('0x27')]};});_0x254a0e['model']=_[_0x6a3e('0x24')](_0x411eb9,'name');_0x254a0e['query']=_[_0x6a3e('0x28')](_0x6cc7c4[_0x6a3e('0x29')]);_0x254a0e['filters']=_['intersection'](_0x254a0e[_0x6a3e('0x2a')],_0x254a0e[_0x6a3e('0x29')]);_0x410d4b[_0x6a3e('0x2b')]=_[_0x6a3e('0x2c')](_0x254a0e['model'],qs['fields'](_0x6cc7c4[_0x6a3e('0x29')][_0x6a3e('0x2d')]));_0x410d4b[_0x6a3e('0x2b')]=_0x410d4b[_0x6a3e('0x2b')]['length']?_0x410d4b[_0x6a3e('0x2b')]:_0x254a0e[_0x6a3e('0x2a')];if(!_0x6cc7c4['query']['hasOwnProperty']('nolimit')){_0x410d4b[_0x6a3e('0x2e')]=qs[_0x6a3e('0x2e')](_0x6cc7c4[_0x6a3e('0x29')][_0x6a3e('0x2e')]);_0x410d4b[_0x6a3e('0x2f')]=qs[_0x6a3e('0x2f')](_0x6cc7c4[_0x6a3e('0x29')][_0x6a3e('0x2f')]);}_0x410d4b[_0x6a3e('0x30')]=qs[_0x6a3e('0x31')](_0x6cc7c4[_0x6a3e('0x29')][_0x6a3e('0x31')]);_0x410d4b[_0x6a3e('0x32')]=qs[_0x6a3e('0x33')](_[_0x6a3e('0x34')](_0x6cc7c4['query'],_0x254a0e[_0x6a3e('0x33')]));if(_0x6cc7c4[_0x6a3e('0x29')][_0x6a3e('0x35')]){_0x410d4b['where']=_[_0x6a3e('0x36')](_0x410d4b[_0x6a3e('0x32')],{'$or':_['map'](_0x411eb9,function(_0x28961a){if(_0x28961a[_0x6a3e('0x37')]!==_0x6a3e('0x38')){var _0x52494f={};_0x52494f[_0x28961a[_0x6a3e('0x22')]]={'$like':'%'+_0x6cc7c4[_0x6a3e('0x29')][_0x6a3e('0x35')]+'%'};return _0x52494f;}})});}_0x410d4b=_[_0x6a3e('0x36')]({},_0x410d4b,_0x6cc7c4[_0x6a3e('0x39')]);var _0x1f7d13={'where':_0x410d4b['where']};return db[_0x6a3e('0x25')]['count'](_0x1f7d13)['then'](function(_0x4bc630){_0x2d0ec1[_0x6a3e('0x3a')]=_0x4bc630;if(_0x6cc7c4['query'][_0x6a3e('0x3b')]){_0x410d4b[_0x6a3e('0x3c')]=[{'all':!![]}];}return db[_0x6a3e('0x25')][_0x6a3e('0x3d')](_0x410d4b);})[_0x6a3e('0x1e')](function(_0x36944d){_0x2d0ec1['rows']=_0x36944d;return _0x2d0ec1;})['then'](respondWithFilteredResult(_0x13bdc3,_0x410d4b))[_0x6a3e('0x3e')](handleError(_0x13bdc3,null));};exports[_0x6a3e('0x3f')]=function(_0x2bb14a,_0x25c353){var _0x1dd524={'raw':!![],'where':{'id':_0x2bb14a[_0x6a3e('0x40')]['id']}},_0x57f40b={};_0x57f40b[_0x6a3e('0x2a')]=_['keys'](db[_0x6a3e('0x25')][_0x6a3e('0x26')]);_0x57f40b[_0x6a3e('0x29')]=_['keys'](_0x2bb14a[_0x6a3e('0x29')]);_0x57f40b[_0x6a3e('0x33')]=_[_0x6a3e('0x2c')](_0x57f40b[_0x6a3e('0x2a')],_0x57f40b[_0x6a3e('0x29')]);_0x1dd524[_0x6a3e('0x2b')]=_['intersection'](_0x57f40b[_0x6a3e('0x2a')],qs[_0x6a3e('0x2d')](_0x2bb14a[_0x6a3e('0x29')]['fields']));_0x1dd524[_0x6a3e('0x2b')]=_0x1dd524['attributes']['length']?_0x1dd524[_0x6a3e('0x2b')]:_0x57f40b[_0x6a3e('0x2a')];if(_0x2bb14a[_0x6a3e('0x29')]['includeAll']){_0x1dd524['include']=[{'all':!![]}];}_0x1dd524=_[_0x6a3e('0x36')]({},_0x1dd524,_0x2bb14a[_0x6a3e('0x39')]);return db[_0x6a3e('0x25')][_0x6a3e('0x41')](_0x1dd524)[_0x6a3e('0x1e')](handleEntityNotFound(_0x25c353,null))[_0x6a3e('0x1e')](respondWithResult(_0x25c353,null))['catch'](handleError(_0x25c353,null));};exports[_0x6a3e('0x42')]=function(_0x24348c,_0x1da6f9){return db[_0x6a3e('0x25')][_0x6a3e('0x42')](_0x24348c[_0x6a3e('0x43')],{})[_0x6a3e('0x1e')](respondWithResult(_0x1da6f9,0xc9))[_0x6a3e('0x3e')](handleError(_0x1da6f9,null));};exports[_0x6a3e('0x1d')]=function(_0x4d36e2,_0x40a09d){if(_0x4d36e2[_0x6a3e('0x43')]['id']){delete _0x4d36e2['body']['id'];}return db[_0x6a3e('0x25')]['find']({'where':{'id':_0x4d36e2[_0x6a3e('0x40')]['id']}})[_0x6a3e('0x1e')](handleEntityNotFound(_0x40a09d,null))[_0x6a3e('0x1e')](saveUpdates(_0x4d36e2['body'],null))[_0x6a3e('0x1e')](respondWithResult(_0x40a09d,null))[_0x6a3e('0x3e')](handleError(_0x40a09d,null));};exports['destroy']=function(_0x4adc4b,_0x4997d7){return db[_0x6a3e('0x25')][_0x6a3e('0x41')]({'where':{'id':_0x4adc4b[_0x6a3e('0x40')]['id']}})[_0x6a3e('0x1e')](handleEntityNotFound(_0x4997d7,null))[_0x6a3e('0x1e')](removeEntity(_0x4997d7,null))[_0x6a3e('0x3e')](handleError(_0x4997d7,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 8a14a5b..b0c3ed1 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 _0x0cbc=['moment','request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4f7c44,_0x11ddc1){var _0x186c3a=function(_0x240815){while(--_0x240815){_0x4f7c44['push'](_0x4f7c44['shift']());}};_0x186c3a(++_0x11ddc1);}(_0x0cbc,0x1bc));var _0xc0cb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0cbc[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xc0cb('0x0'));var util=require(_0xc0cb('0x1'));var logger=require(_0xc0cb('0x2'))(_0xc0cb('0x3'));var moment=require(_0xc0cb('0x4'));var BPromise=require('bluebird');var rp=require(_0xc0cb('0x5'));var fs=require('fs');var path=require(_0xc0cb('0x6'));var rimraf=require('rimraf');var config=require(_0xc0cb('0x7'));var attributes=require(_0xc0cb('0x8'));module['exports']=function(_0x43ee18,_0x44c763){return _0x43ee18[_0xc0cb('0x9')](_0xc0cb('0xa'),attributes,{'tableName':_0xc0cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc0cb('0xc'),'collate':_0xc0cb('0xd')});}; \ No newline at end of file +var _0x85b5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4_unicode_ci','api'];(function(_0x456d62,_0xf9793d){var _0x164efb=function(_0x4f029d){while(--_0x4f029d){_0x456d62['push'](_0x456d62['shift']());}};_0x164efb(++_0xf9793d);}(_0x85b5,0x77));var _0x585b=function(_0x503ce0,_0x4d4efd){_0x503ce0=_0x503ce0-0x0;var _0x43fc56=_0x85b5[_0x503ce0];return _0x43fc56;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x585b('0x0'));var moment=require(_0x585b('0x1'));var BPromise=require(_0x585b('0x2'));var rp=require(_0x585b('0x3'));var fs=require('fs');var path=require(_0x585b('0x4'));var rimraf=require(_0x585b('0x5'));var config=require(_0x585b('0x6'));var attributes=require(_0x585b('0x7'));module[_0x585b('0x8')]=function(_0x36505c,_0x553a85){return _0x36505c[_0x585b('0x9')](_0x585b('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x585b('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 95c49d7..1fd9d68 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 _0xf7c7=['debug','request\x20sent','stringify','code','FaxApplication,\x20%s,\x20%s','error','message','UpdateFaxApplication','update','body','options','attributes','limit','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info'];(function(_0x261062,_0x4145b9){var _0x38ef4f=function(_0x125c76){while(--_0x125c76){_0x261062['push'](_0x261062['shift']());}};_0x38ef4f(++_0x4145b9);}(_0xf7c7,0x194));var _0x7f7c=function(_0x59db7f,_0x10ab4f){_0x59db7f=_0x59db7f-0x0;var _0x19800f=_0xf7c7[_0x59db7f];return _0x19800f;};'use strict';var _=require(_0x7f7c('0x0'));var util=require(_0x7f7c('0x1'));var moment=require(_0x7f7c('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f7c('0x3'));var fs=require('fs');var Redis=require(_0x7f7c('0x4'));var db=require(_0x7f7c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f7c('0x6'))('rpc');var config=require(_0x7f7c('0x7'));var jayson=require(_0x7f7c('0x8'));var client=jayson['client'][_0x7f7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14cc12,_0x5d3f92,_0x5a8935){return new BPromise(function(_0x5b2a8c,_0x3a6c5c){return client[_0x7f7c('0xa')](_0x14cc12,_0x5a8935)['then'](function(_0x2c9f72){logger[_0x7f7c('0xb')]('FaxApplication,\x20%s,\x20%s',_0x5d3f92,'request\x20sent');logger[_0x7f7c('0xc')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5d3f92,_0x7f7c('0xd'),JSON[_0x7f7c('0xe')](_0x2c9f72));if(_0x2c9f72['error']){if(_0x2c9f72['error'][_0x7f7c('0xf')]===0x1f4){logger['error'](_0x7f7c('0x10'),_0x5d3f92,_0x2c9f72[_0x7f7c('0x11')][_0x7f7c('0x12')]);return _0x3a6c5c(_0x2c9f72[_0x7f7c('0x11')]['message']);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x5d3f92,_0x2c9f72[_0x7f7c('0x11')][_0x7f7c('0x12')]);return _0x5b2a8c(_0x2c9f72[_0x7f7c('0x11')][_0x7f7c('0x12')]);}else{logger[_0x7f7c('0xb')](_0x7f7c('0x10'),_0x5d3f92,_0x7f7c('0xd'));_0x5b2a8c(_0x2c9f72['result'][_0x7f7c('0x12')]);}})['catch'](function(_0x4415f7){logger[_0x7f7c('0x11')](_0x7f7c('0x10'),_0x5d3f92,_0x4415f7);_0x3a6c5c(_0x4415f7);});});}exports[_0x7f7c('0x13')]=function(_0x52cd71){var _0x3f08cd=this;return new Promise(function(_0x44382b,_0xf03b2){return db['FaxApplication'][_0x7f7c('0x14')](_0x52cd71[_0x7f7c('0x15')],{'raw':_0x52cd71[_0x7f7c('0x16')]?_0x52cd71[_0x7f7c('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52cd71[_0x7f7c('0x16')]?_0x52cd71[_0x7f7c('0x16')]['where']||null:null,'attributes':_0x52cd71['options']?_0x52cd71[_0x7f7c('0x16')][_0x7f7c('0x17')]||null:null,'limit':_0x52cd71['options']?_0x52cd71['options'][_0x7f7c('0x18')]||null:null})['then'](function(_0x2f0d0c){logger[_0x7f7c('0xb')](_0x7f7c('0x13'),_0x52cd71);logger['debug']('UpdateFaxApplication',_0x52cd71,JSON[_0x7f7c('0xe')](_0x2f0d0c));_0x44382b(_0x2f0d0c);})[_0x7f7c('0x19')](function(_0x33eba6){logger[_0x7f7c('0x11')](_0x7f7c('0x13'),_0x33eba6[_0x7f7c('0x12')],_0x52cd71);_0xf03b2(_0x3f08cd[_0x7f7c('0x11')](0x1f4,_0x33eba6[_0x7f7c('0x12')]));});});}; \ No newline at end of file +var _0x9572=['code','message','error','result','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5713cc,_0x4a8f2a){var _0x7a7ad9=function(_0x39d1dd){while(--_0x39d1dd){_0x5713cc['push'](_0x5713cc['shift']());}};_0x7a7ad9(++_0x4a8f2a);}(_0x9572,0x1ce));var _0x2957=function(_0x1336db,_0x412170){_0x1336db=_0x1336db-0x0;var _0x3adb95=_0x9572[_0x1336db];return _0x3adb95;};'use strict';var _=require(_0x2957('0x0'));var util=require(_0x2957('0x1'));var moment=require(_0x2957('0x2'));var BPromise=require(_0x2957('0x3'));var rs=require(_0x2957('0x4'));var fs=require('fs');var Redis=require(_0x2957('0x5'));var db=require(_0x2957('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2957('0x7'));var config=require(_0x2957('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2957('0x9')][_0x2957('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54bf83,_0xdaf452,_0x414112){return new BPromise(function(_0x2a9584,_0x55ec80){return client[_0x2957('0xb')](_0x54bf83,_0x414112)[_0x2957('0xc')](function(_0x37910c){logger[_0x2957('0xd')](_0x2957('0xe'),_0xdaf452,_0x2957('0xf'));logger[_0x2957('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0xdaf452,_0x2957('0xf'),JSON[_0x2957('0x11')](_0x37910c));if(_0x37910c['error']){if(_0x37910c['error'][_0x2957('0x12')]===0x1f4){logger['error'](_0x2957('0xe'),_0xdaf452,_0x37910c['error'][_0x2957('0x13')]);return _0x55ec80(_0x37910c[_0x2957('0x14')]['message']);}logger[_0x2957('0x14')](_0x2957('0xe'),_0xdaf452,_0x37910c[_0x2957('0x14')][_0x2957('0x13')]);return _0x2a9584(_0x37910c['error'][_0x2957('0x13')]);}else{logger[_0x2957('0xd')](_0x2957('0xe'),_0xdaf452,_0x2957('0xf'));_0x2a9584(_0x37910c[_0x2957('0x15')][_0x2957('0x13')]);}})['catch'](function(_0x437126){logger[_0x2957('0x14')](_0x2957('0xe'),_0xdaf452,_0x437126);_0x55ec80(_0x437126);});});}exports[_0x2957('0x16')]=function(_0x22f8ac){var _0x3ef1d7=this;return new Promise(function(_0x22d494,_0x42712f){return db[_0x2957('0x17')]['update'](_0x22f8ac[_0x2957('0x18')],{'raw':_0x22f8ac[_0x2957('0x19')]?_0x22f8ac[_0x2957('0x19')][_0x2957('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22f8ac[_0x2957('0x19')]?_0x22f8ac[_0x2957('0x19')][_0x2957('0x1b')]||null:null,'attributes':_0x22f8ac['options']?_0x22f8ac[_0x2957('0x19')][_0x2957('0x1c')]||null:null,'limit':_0x22f8ac[_0x2957('0x19')]?_0x22f8ac[_0x2957('0x19')][_0x2957('0x1d')]||null:null})[_0x2957('0xc')](function(_0x5edbf0){logger[_0x2957('0xd')](_0x2957('0x16'),_0x22f8ac);logger[_0x2957('0x10')](_0x2957('0x16'),_0x22f8ac,JSON[_0x2957('0x11')](_0x5edbf0));_0x22d494(_0x5edbf0);})['catch'](function(_0x360dc1){logger[_0x2957('0x14')](_0x2957('0x16'),_0x360dc1[_0x2957('0x13')],_0x22f8ac);_0x42712f(_0x3ef1d7[_0x2957('0x14')](0x1f4,_0x360dc1['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index e732e3c..960a695 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 _0xae24=['destroy','multer','path','express','Router','../../config/environment','get','isAuthenticated','index','/:id','delete'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xae24,0x182));var _0x4ae2=function(_0x2e7e44,_0x3bf7c2){_0x2e7e44=_0x2e7e44-0x0;var _0x4e74d7=_0xae24[_0x2e7e44];return _0x4e74d7;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ae2('0x4'));var controller=require('./faxApplication.controller');router[_0x4ae2('0x5')]('/',auth[_0x4ae2('0x6')](),controller[_0x4ae2('0x7')]);router[_0x4ae2('0x5')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller['show']);router['post']('/',auth[_0x4ae2('0x6')](),controller['create']);router['put'](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller['update']);router[_0x4ae2('0x9')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0xa')]);module['exports']=router; \ No newline at end of file +var _0x9c5a=['isAuthenticated','get','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxApplication.controller'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x417732,_0x5500f6){_0x417732=_0x417732-0x0;var _0x3c826f=_0x9c5a[_0x417732];return _0x3c826f;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get']('/',auth[_0xa9c5('0x8')](),controller['index']);router[_0xa9c5('0x9')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa9c5('0xb')]('/',auth[_0xa9c5('0x8')](),controller['create']);router[_0xa9c5('0xc')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller[_0xa9c5('0xd')]);router[_0xa9c5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa9c5('0xf')]);module[_0xa9c5('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 7127553..d0e953c 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 _0x7979=['ENUM','out','DATE','sequelize','exports','BOOLEAN','STRING'];(function(_0x30fe3a,_0x26a088){var _0x5a08d2=function(_0x434a40){while(--_0x434a40){_0x30fe3a['push'](_0x30fe3a['shift']());}};_0x5a08d2(++_0x26a088);}(_0x7979,0x1b5));var _0x9797=function(_0x175b33,_0x2487a6){_0x175b33=_0x175b33-0x0;var _0x34f920=_0x7979[_0x175b33];return _0x34f920;};'use strict';var Sequelize=require(_0x9797('0x0'));module[_0x9797('0x1')]={'closed':{'type':Sequelize[_0x9797('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9797('0x3')]},'note':{'type':Sequelize[_0x9797('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x9797('0x4')]('in',_0x9797('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9797('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x9797('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb6d3=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x1a3e33,_0xe419f4){var _0x545085=function(_0x563f55){while(--_0x563f55){_0x1a3e33['push'](_0x1a3e33['shift']());}};_0x545085(++_0xe419f4);}(_0xb6d3,0xab));var _0x3b6d=function(_0x43aea3,_0xc8b030){_0x43aea3=_0x43aea3-0x0;var _0x3f438d=_0xb6d3[_0x43aea3];return _0x3f438d;};'use strict';var Sequelize=require(_0x3b6d('0x0'));module[_0x3b6d('0x1')]={'closed':{'type':Sequelize[_0x3b6d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3b6d('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3b6d('0x4')]},'read1stAt':{'type':Sequelize[_0x3b6d('0x3')]},'fax':{'type':Sequelize[_0x3b6d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3b6d('0x5')]('in',_0x3b6d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3b6d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3b6d('0x5')]('in',_0x3b6d('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 053bacb..002a94c 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 _0xeba1=['`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','count','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','show','params','includeAll','include','options','create','update','body','FaxMessage','addMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','removeTags','download','unix','join','root','server','tmp','files','attachments','format','Attachment','Messages','get','existsSync','createReadStream','pipe','basename','resolve','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','Users','map','Tags','TagIds','split','forEach','catch','index','FaxInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','buildExpression','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','read'];(function(_0x120a6a,_0x401eb4){var _0x339680=function(_0x1af69e){while(--_0x1af69e){_0x120a6a['push'](_0x120a6a['shift']());}};_0x339680(++_0x401eb4);}(_0xeba1,0x12d));var _0x1eba=function(_0x13a933,_0x37002a){_0x13a933=_0x13a933-0x0;var _0x58d82e=_0xeba1[_0x13a933];return _0x58d82e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1eba('0x0'));var rimraf=require(_0x1eba('0x1'));var zipdir=require(_0x1eba('0x2'));var jsonpatch=require(_0x1eba('0x3'));var rp=require('request-promise');var moment=require(_0x1eba('0x4'));var BPromise=require(_0x1eba('0x5'));var Mustache=require(_0x1eba('0x6'));var util=require(_0x1eba('0x7'));var path=require(_0x1eba('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1eba('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1eba('0xa'));var crypto=require(_0x1eba('0xb'));var jsforce=require(_0x1eba('0xc'));var deskjs=require(_0x1eba('0xd'));var toCsv=require(_0x1eba('0xe'));var querystring=require(_0x1eba('0xf'));var Papa=require('papaparse');var Redis=require(_0x1eba('0x10'));var authService=require(_0x1eba('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1eba('0x12'));var logger=require('../../config/logger')(_0x1eba('0x13'));var utils=require(_0x1eba('0x14'));var config=require(_0x1eba('0x15'));var db=require(_0x1eba('0x16'))['db'];config[_0x1eba('0x17')]=_[_0x1eba('0x18')](config[_0x1eba('0x17')],{'host':_0x1eba('0x19'),'port':0x18eb});var socket=require(_0x1eba('0x1a'))(new Redis(config[_0x1eba('0x17')]));require('./faxInteraction.socket')[_0x1eba('0x1b')](socket);function respondWithStatusCode(_0x468824,_0x4c1e9d){_0x4c1e9d=_0x4c1e9d||0xcc;return function(_0x42128a){if(_0x42128a){return _0x468824[_0x1eba('0x1c')](_0x4c1e9d);}return _0x468824['status'](_0x4c1e9d)[_0x1eba('0x1d')]();};}function respondWithResult(_0x40a7ca,_0x51bda1){_0x51bda1=_0x51bda1||0xc8;return function(_0x1b2a6a){if(_0x1b2a6a){return _0x40a7ca[_0x1eba('0x1e')](_0x51bda1)[_0x1eba('0x1f')](_0x1b2a6a);}};}function respondWithFilteredResult(_0x420d8a,_0x57e805){return function(_0x299671){if(_0x299671){var _0x21bdf8=_0x299671['count'],_0x1bdff7=_0x57e805['offset'],_0x4149ef=_0x57e805[_0x1eba('0x20')]+_0x57e805[_0x1eba('0x21')],_0x3e7e2d;if(_0x4149ef>=_0x21bdf8){_0x4149ef=_0x21bdf8;_0x3e7e2d=0xc8;}else{_0x3e7e2d=0xce;}_0x420d8a['status'](_0x3e7e2d);return _0x420d8a[_0x1eba('0x22')](_0x1eba('0x23'),_0x1bdff7+'-'+_0x4149ef+'/'+_0x21bdf8)['json'](_0x299671);}return null;};}function patchUpdates(_0x4bb41f){return function(_0x2f9290){try{jsonpatch[_0x1eba('0x24')](_0x2f9290,_0x4bb41f,!![]);}catch(_0x394e99){return BPromise[_0x1eba('0x25')](_0x394e99);}return _0x2f9290[_0x1eba('0x26')]();};}function saveUpdates(_0x55b37d,_0x3685fa){return function(_0x945761){if(_0x945761){return _0x945761['update'](_0x55b37d)[_0x1eba('0x27')](function(_0x459059){return _0x459059;});}return null;};}function removeEntity(_0x24f1b4,_0x28db2f){return function(_0x49057b){if(_0x49057b){return _0x49057b[_0x1eba('0x28')]()[_0x1eba('0x27')](function(){_0x24f1b4[_0x1eba('0x1e')](0xcc)[_0x1eba('0x1d')]();});}};}function handleEntityNotFound(_0x557f34,_0x4a1754){return function(_0x2b71a2){if(!_0x2b71a2){_0x557f34[_0x1eba('0x1c')](0x194);}return _0x2b71a2;};}function handleError(_0x449246,_0x41b6f8){_0x41b6f8=_0x41b6f8||0x1f4;return function(_0x32bc2f){logger[_0x1eba('0x29')](_0x32bc2f['stack']);if(_0x32bc2f[_0x1eba('0x2a')]){delete _0x32bc2f[_0x1eba('0x2a')];}_0x449246[_0x1eba('0x1e')](_0x41b6f8)[_0x1eba('0x2b')](_0x32bc2f);};}function getInteractionUsers(_0x3e164e,_0x5da4f5){return new BPromise(function(_0x2800a9,_0x4f5d63){try{if(_0x5da4f5[_0x3e164e['id']]){_0x3e164e[_0x1eba('0x2c')]=_[_0x1eba('0x2d')](_0x5da4f5[_0x3e164e['id']],function(_0x39adca){return{'id':_0x39adca['id'],'fullname':_0x39adca['fullname']};});}}catch(_0x395118){_0x4f5d63(_0x395118);}_0x2800a9(_0x3e164e);});}function getInteractionTags(_0x322802,_0x162adc){return new BPromise(function(_0x2d6c94,_0x53b8cf){try{if(_0x322802['TagIds']){_0x322802[_0x1eba('0x2e')]=[];_0x322802[_0x1eba('0x2f')][_0x1eba('0x30')](',')[_0x1eba('0x31')](function(_0x326502){_0x322802[_0x1eba('0x2e')]['push'](_0x162adc[_0x326502]);});}delete _0x322802['TagIds'];}catch(_0x4ebf91){_0x53b8cf(_0x4ebf91);}_0x2d6c94(_0x322802);});}function updateFaxInteraction(_0x275baa,_0x1b6837,_0x2e40b8){return new BPromise(function(_0x99c6e7,_0x473dbe){return getInteractionUsers(_0x275baa,_0x2e40b8)[_0x1eba('0x27')](function(_0x2657d5){return getInteractionTags(_0x2657d5,_0x1b6837);})['then'](function(_0x10e878){_0x99c6e7(_0x10e878);})[_0x1eba('0x32')](function(_0x26fe9a){_0x473dbe(_0x26fe9a);});});}exports[_0x1eba('0x33')]=function(_0x469c95,_0x19a860){var _0x4a994c={},_0x36ff0c={},_0x1445c3={'count':0x0,'rows':[]};var _0x4c9e13=_[_0x1eba('0x2d')](db[_0x1eba('0x34')][_0x1eba('0x35')],function(_0x2b60a8){return{'name':_0x2b60a8[_0x1eba('0x36')],'type':_0x2b60a8['type'][_0x1eba('0x37')]};});_0x36ff0c[_0x1eba('0x38')]=_[_0x1eba('0x2d')](_0x4c9e13,'name');_0x36ff0c[_0x1eba('0x39')]=_[_0x1eba('0x3a')](_0x469c95[_0x1eba('0x39')]);_0x36ff0c[_0x1eba('0x3b')]=_[_0x1eba('0x3c')](_0x36ff0c[_0x1eba('0x38')],_0x36ff0c[_0x1eba('0x39')]);_0x4a994c[_0x1eba('0x3d')]=_[_0x1eba('0x3c')](_0x36ff0c[_0x1eba('0x38')],qs[_0x1eba('0x3e')](_0x469c95['query'][_0x1eba('0x3e')]));_0x4a994c[_0x1eba('0x3d')]=_0x4a994c['attributes'][_0x1eba('0x3f')]?_0x4a994c[_0x1eba('0x3d')]:_0x36ff0c['model'];if(!_0x469c95[_0x1eba('0x39')][_0x1eba('0x40')](_0x1eba('0x41'))){_0x4a994c[_0x1eba('0x21')]=qs['limit'](_0x469c95[_0x1eba('0x39')][_0x1eba('0x21')]);_0x4a994c[_0x1eba('0x20')]=qs[_0x1eba('0x20')](_0x469c95[_0x1eba('0x39')][_0x1eba('0x20')]);}_0x4a994c[_0x1eba('0x42')]=qs[_0x1eba('0x43')](_0x469c95[_0x1eba('0x39')][_0x1eba('0x43')]);_0x4a994c[_0x1eba('0x44')]=qs[_0x1eba('0x3b')](_[_0x1eba('0x45')](_0x469c95[_0x1eba('0x39')],_0x36ff0c['filters']));var _0x2bd234=[];var _0x35f592=squel['select']()['field']('id')[_0x1eba('0x46')]('name')[_0x1eba('0x46')](_0x1eba('0x47'))[_0x1eba('0x48')](_0x1eba('0x49'));var _0x329901=squel[_0x1eba('0x4a')]()[_0x1eba('0x46')](_0x1eba('0x4b'))[_0x1eba('0x46')](_0x1eba('0x4c'))[_0x1eba('0x46')](_0x1eba('0x4d'))[_0x1eba('0x48')](_0x1eba('0x4e'),'ui')[_0x1eba('0x4f')]('users','u','u.id\x20=\x20ui.UserId');var _0x4694e5=squel[_0x1eba('0x4a')]()[_0x1eba('0x48')](_0x1eba('0x50'),'i')[_0x1eba('0x4f')](_0x1eba('0x51'),'c',_0x1eba('0x52'))['left_join'](_0x1eba('0x53'),'o',_0x1eba('0x54'))[_0x1eba('0x4f')](_0x1eba('0x55'),'a',_0x1eba('0x56'))[_0x1eba('0x4f')](_0x1eba('0x57'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x1eba('0x4f')]('fax_interaction_has_tags','it',_0x1eba('0x58'))[_0x1eba('0x4f')](_0x1eba('0x49'),'t',_0x1eba('0x59'));var _0x2dfdd4=squel[_0x1eba('0x5a')]();var _0x15a811=[];var _0x4bf903=squel[_0x1eba('0x5a')]();var _0x329c12;if(_0x469c95[_0x1eba('0x39')][_0x1eba('0x5b')]){_0x329c12=as[_0x1eba('0x5c')](_0x469c95['query'][_0x1eba('0x5b')]);var _0x6fdcc8=_0x329c12[_0x1eba('0x5d')];for(var _0x40a428=0x0;_0x40a428<_0x329c12['conditions'][_0x1eba('0x3f')];_0x40a428++){var _0x43cf5e=_0x329c12[_0x1eba('0x5e')][_0x40a428];var _0x4e57ed='i';var _0x3bb7bf=_[_0x1eba('0x5f')](_0x4c9e13,[_0x1eba('0x2a'),_0x43cf5e[_0x1eba('0x46')]]);if(!_0x3bb7bf){switch(_0x43cf5e[_0x1eba('0x46')]){case _0x1eba('0x60'):if(_0x43cf5e[_0x1eba('0x61')]==0x1){_0x4694e5[_0x1eba('0x62')]('`'+_0x43cf5e[_0x1eba('0x46')]+_0x1eba('0x63'));}else{_0x4694e5[_0x1eba('0x62')]('`'+_0x43cf5e[_0x1eba('0x46')]+_0x1eba('0x64'));}break;case _0x1eba('0x65'):if(_0x43cf5e[_0x1eba('0x66')]==='$substring'){if(_0x43cf5e[_0x1eba('0x61')][_0x1eba('0x30')]('\x20')[_0x1eba('0x3f')]>0x1){_0x2dfdd4[_0x6fdcc8]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1eba('0x67')](_0x43cf5e[_0x1eba('0x61')]),null);}else{var _0xb30f0b='%'+_0x43cf5e[_0x1eba('0x61')]+'%';_0x2dfdd4[_0x6fdcc8](_0x1eba('0x68'),_0xb30f0b,_0xb30f0b,_0xb30f0b);}}else{_0x3bb7bf=_[_0x1eba('0x5f')](_0x4c9e13,[_0x1eba('0x2a'),_0x1eba('0x69')]);_0x43cf5e[_0x1eba('0x46')]=_0x1eba('0x69');_0xf7a53c=as['buildExpression'](_0x4e57ed,_0x3bb7bf[_0x1eba('0x6a')],_0x43cf5e);_0x2dfdd4[_0x6fdcc8](_0xf7a53c['text'],_0xf7a53c[_0x1eba('0x61')][_0x1eba('0x6b')],_0xf7a53c[_0x1eba('0x61')][_0x1eba('0x1d')]);}break;case _0x1eba('0x6c'):var _0x25ec25=_0x43cf5e['value'][_0x1eba('0x30')](',')[_0x1eba('0x2d')](function(_0x35c715){return Number(_0x35c715);});_0x25ec25['forEach'](function(_0x4cc80e){_0x4bf903['or'](_0x1eba('0x6d'),'%,'+_0x4cc80e+',%');});_0x15a811=_[_0x1eba('0x6e')](_0x15a811,_0x25ec25);break;case'User':if(_0x43cf5e[_0x1eba('0x66')]===_0x1eba('0x6f')){_0x2dfdd4[_0x6fdcc8](_0x1eba('0x70'),'%'+_0x43cf5e[_0x1eba('0x61')]+'%',null);}else{_0x3bb7bf=_[_0x1eba('0x5f')](_0x4c9e13,[_0x1eba('0x2a'),'UserId']);_0x43cf5e[_0x1eba('0x46')]=_0x1eba('0x71');_0xf7a53c=as['buildExpression'](_0x4e57ed,_0x3bb7bf[_0x1eba('0x6a')],_0x43cf5e);_0x2dfdd4[_0x6fdcc8](_0xf7a53c[_0x1eba('0x72')],_0xf7a53c[_0x1eba('0x61')][_0x1eba('0x6b')],_0xf7a53c[_0x1eba('0x61')][_0x1eba('0x1d')]);}break;case'body':_0xf7a53c=as[_0x1eba('0x73')]('me',null,_0x43cf5e);_0x2dfdd4[_0x6fdcc8](_0xf7a53c[_0x1eba('0x72')],_0xf7a53c[_0x1eba('0x61')][_0x1eba('0x6b')],_0xf7a53c[_0x1eba('0x61')][_0x1eba('0x1d')]);break;}}else{var _0xf7a53c=as['buildExpression'](_0x4e57ed,_0x3bb7bf[_0x1eba('0x6a')],_0x43cf5e);_0x2dfdd4[_0x6fdcc8](_0xf7a53c[_0x1eba('0x72')],_0xf7a53c[_0x1eba('0x61')][_0x1eba('0x6b')],_0xf7a53c[_0x1eba('0x61')][_0x1eba('0x1d')]);}}}else{var _0x198d83=_(_0x469c95[_0x1eba('0x39')])['keys']()[_0x1eba('0x2d')](function(_0x52c076){return _[_0x1eba('0x74')](_0x4c9e13,[_0x1eba('0x2a'),_0x52c076])?_0x52c076:undefined;})[_0x1eba('0x75')]()[_0x1eba('0x61')]();if(!_['isEmpty'](_0x198d83)){_0x198d83['forEach'](function(_0xaf95e7){if(_0xaf95e7===_0x1eba('0x76')){_0x4694e5[_0x1eba('0x44')](_0x1eba('0x77'),[][_0x1eba('0x78')](_0x469c95[_0x1eba('0x39')][_0xaf95e7]));}else if(_0xaf95e7===_0x1eba('0x79')){var _0xe8b56c=JSON[_0x1eba('0x7a')](_0x469c95[_0x1eba('0x39')][_0xaf95e7])[_0x1eba('0x7b')];var _0x250b3d=JSON[_0x1eba('0x7a')](_0x469c95[_0x1eba('0x39')][_0xaf95e7])[_0x1eba('0x7c')];_0x4694e5[_0x1eba('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe8b56c,_0x250b3d);}else{if(_0x469c95['query'][_0xaf95e7]===_0x1eba('0x7d')){_0x4694e5[_0x1eba('0x44')]('i.'+_0xaf95e7+'\x20IS\x20NULL');}else{_0x4694e5[_0x1eba('0x44')]('i.'+_0xaf95e7+'\x20=\x20?',_0x469c95[_0x1eba('0x39')][_0xaf95e7]);}}});}if(_0x469c95[_0x1eba('0x39')][_0x1eba('0x7e')]){if(_0x469c95[_0x1eba('0x39')][_0x1eba('0x7e')]==0x1){_0x4694e5[_0x1eba('0x62')](_0x1eba('0x7f'));}else{_0x4694e5[_0x1eba('0x62')](_0x1eba('0x80'));}}if(_0x469c95[_0x1eba('0x39')][_0x1eba('0x81')]){_0x15a811=_['isArray'](_0x469c95[_0x1eba('0x39')]['tag'])?_0x469c95['query']['tag']:new Array(_0x469c95[_0x1eba('0x39')][_0x1eba('0x81')]);_0x15a811[_0x1eba('0x31')](function(_0x10d863){_0x4bf903['or'](_0x1eba('0x6d'),'%,'+_0x10d863+',%');});}if(_0x469c95[_0x1eba('0x39')][_0x1eba('0x82')]){var _0x3067c7=_0x469c95[_0x1eba('0x39')]['filter'][_0x1eba('0x83')]('\x5c','\x5c\x5c')[_0x1eba('0x83')]('\x27\x27',_0x1eba('0x84'));if(qs[_0x1eba('0x85')](_0x3067c7)){_0x2dfdd4['or'](_0x1eba('0x86'),_0x3067c7+'%')['or'](_0x1eba('0x87'),_0x3067c7+'%');}_0x2dfdd4['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3067c7+'%');}}_0x4694e5['where'](_0x2dfdd4);_0x4694e5[_0x1eba('0x88')](_0x1eba('0x89'));var _0x5f3c05={'type':db[_0x1eba('0x8a')][_0x1eba('0x8b')][_0x1eba('0x8c')],'raw':!![]};var _0x1c1673=_0x4694e5[_0x1eba('0x8d')]();_0x1c1673[_0x1eba('0x46')](_0x1eba('0x89'));_0x1c1673[_0x1eba('0x46')](_0x1eba('0x8e'),'unreadMessages');if(_0x4a994c[_0x1eba('0x42')]){_0x4a994c[_0x1eba('0x42')][_0x1eba('0x31')](function(_0x50ba16){_0x4694e5[_0x1eba('0x42')]('i.'+_0x50ba16[0x0],_0x50ba16[0x1]===_0x1eba('0x8f')?![]:!![]);});}if(!_[_0x1eba('0x90')](_0x15a811)){_0x4694e5[_0x1eba('0x62')](_0x4bf903);_0x1c1673[_0x1eba('0x44')](_0x1eba('0x91'),_0x15a811);}BPromise['resolve']()['then'](function(){if(!_0x329c12){if(_0x469c95[_0x1eba('0x39')][_0x1eba('0x76')]||_0x469c95[_0x1eba('0x39')]['journey'])return;_0x1c1673['where'](_0x1eba('0x92'));_0x4694e5['where'](_0x1eba('0x92'));return;}return _0x469c95[_0x1eba('0x93')][_0x1eba('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x26ea6e){if(_[_0x1eba('0x90')](_0x26ea6e)){_0x1c1673['where'](_0x1eba('0x95'));_0x4694e5['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x1c1673[_0x1eba('0x44')](_0x1eba('0x77'),_['map'](_0x26ea6e,'id'));_0x4694e5[_0x1eba('0x44')](_0x1eba('0x77'),_[_0x1eba('0x2d')](_0x26ea6e,'id'));}});})[_0x1eba('0x27')](function(){db[_0x1eba('0x96')][_0x1eba('0x39')](_0x1c1673[_0x1eba('0x97')](),_0x5f3c05)['then'](function(_0x17c926){_0x1445c3[_0x1eba('0x98')]=_0x17c926['length'];if(_0x1445c3['count']===0x0)return[];return db[_0x1eba('0x96')][_0x1eba('0x39')](_0x35f592['toString'](),_0x5f3c05)[_0x1eba('0x27')](function(_0x10eaf0){_0x2bd234=_['keyBy'](_0x10eaf0,'id');_0x5f3c05=_[_0x1eba('0x99')](_0x5f3c05,{'model':db[_0x1eba('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x469c95[_0x1eba('0x39')][_0x1eba('0x3e')]){_0x4a994c[_0x1eba('0x3d')][_0x1eba('0x31')](function(_0x2bb032){_0x4694e5[_0x1eba('0x46')]('i.'+_0x2bb032);});}else{_0x4694e5[_0x1eba('0x46')](_0x1eba('0x8e'),_0x1eba('0x60'));_0x4694e5[_0x1eba('0x46')](_0x1eba('0x9a'),'Account.key');_0x4694e5[_0x1eba('0x46')](_0x1eba('0x9b'),_0x1eba('0x9c'));_0x4694e5[_0x1eba('0x46')](_0x1eba('0x9d'));_0x4694e5[_0x1eba('0x46')]('c.firstName',_0x1eba('0x9e'));_0x4694e5['field']('c.lastName',_0x1eba('0x9f'));_0x4694e5[_0x1eba('0x46')]('c.email',_0x1eba('0xa0'));_0x4694e5[_0x1eba('0x46')](_0x1eba('0xa1'),_0x1eba('0xa2'));_0x4694e5['field'](_0x1eba('0xa3'),_0x1eba('0xa4'));_0x4694e5[_0x1eba('0x46')](_0x1eba('0xa5'),_0x1eba('0xa6'));_0x4694e5[_0x1eba('0x46')](_0x1eba('0xa7'),_0x1eba('0xa8'));_0x4694e5['field'](_0x1eba('0xa9'),_0x1eba('0xaa'));_0x4694e5['field'](_0x1eba('0xab'),_0x1eba('0x2f'));}_0x4694e5[_0x1eba('0x21')](_0x4a994c[_0x1eba('0x21')]);_0x4694e5[_0x1eba('0x20')](_0x4a994c[_0x1eba('0x20')]);return db[_0x1eba('0x96')][_0x1eba('0x39')](_0x4694e5['toString'](),_0x5f3c05);})['then'](function(_0x3f8688){_0x329901['where'](_0x1eba('0xac'),_['map'](_0x3f8688,'id'));return db[_0x1eba('0x96')][_0x1eba('0x39')](_0x329901[_0x1eba('0x97')](),_0x5f3c05)[_0x1eba('0x27')](function(_0x552376){var _0x1f56c0=_[_0x1eba('0xad')](_0x552376,_0x1eba('0xae'));var _0x586d39=[];_0x3f8688[_0x1eba('0x31')](function(_0x13ad69){_0x586d39[_0x1eba('0xaf')](updateFaxInteraction(_0x13ad69,_0x2bd234,_0x1f56c0));});return BPromise[_0x1eba('0xb0')](_0x586d39);});});})[_0x1eba('0x27')](function(_0x236549){_0x1445c3['rows']=_0x236549;return _0x1445c3;})[_0x1eba('0x27')](respondWithFilteredResult(_0x19a860,_0x4a994c));})[_0x1eba('0x32')](handleError(_0x19a860,null));};exports[_0x1eba('0xb1')]=function(_0x5e7f1a,_0x28661a){var _0x5b4548={'raw':![],'where':{'id':_0x5e7f1a[_0x1eba('0xb2')]['id']}},_0x11b44c={};_0x11b44c[_0x1eba('0x38')]=_['keys'](db[_0x1eba('0x34')][_0x1eba('0x35')]);_0x11b44c[_0x1eba('0x39')]=_[_0x1eba('0x3a')](_0x5e7f1a[_0x1eba('0x39')]);_0x11b44c[_0x1eba('0x3b')]=_['intersection'](_0x11b44c['model'],_0x11b44c[_0x1eba('0x39')]);_0x5b4548[_0x1eba('0x3d')]=_[_0x1eba('0x3c')](_0x11b44c['model'],qs[_0x1eba('0x3e')](_0x5e7f1a[_0x1eba('0x39')][_0x1eba('0x3e')]));_0x5b4548[_0x1eba('0x3d')]=_0x5b4548[_0x1eba('0x3d')]['length']?_0x5b4548['attributes']:_0x11b44c[_0x1eba('0x38')];if(_0x5e7f1a[_0x1eba('0x39')][_0x1eba('0xb3')]){_0x5b4548[_0x1eba('0xb4')]=[{'all':!![]}];}_0x5b4548=_[_0x1eba('0x99')]({},_0x5b4548,_0x5e7f1a[_0x1eba('0xb5')]);return db['FaxInteraction'][_0x1eba('0x5f')](_0x5b4548)['then'](handleEntityNotFound(_0x28661a,null))[_0x1eba('0x27')](respondWithResult(_0x28661a,null))['catch'](handleError(_0x28661a,null));};exports[_0x1eba('0xb6')]=function(_0x74d947,_0x29e75e){return db[_0x1eba('0x34')][_0x1eba('0xb6')](_0x74d947['body'],{})[_0x1eba('0x27')](respondWithResult(_0x29e75e,0xc9))[_0x1eba('0x32')](handleError(_0x29e75e,null));};exports[_0x1eba('0xb7')]=function(_0x3b2273,_0x39d8fe){if(_0x3b2273[_0x1eba('0xb8')]['id']){delete _0x3b2273[_0x1eba('0xb8')]['id'];}return db[_0x1eba('0x34')][_0x1eba('0x5f')]({'where':{'id':_0x3b2273['params']['id']}})[_0x1eba('0x27')](handleEntityNotFound(_0x39d8fe,null))[_0x1eba('0x27')](saveUpdates(_0x3b2273[_0x1eba('0xb8')],null))['then'](respondWithResult(_0x39d8fe,null))[_0x1eba('0x32')](handleError(_0x39d8fe,null));};exports['destroy']=function(_0x432ad4,_0x3450ef){return db[_0x1eba('0x34')][_0x1eba('0x5f')]({'where':{'id':_0x432ad4['params']['id']}})[_0x1eba('0x27')](handleEntityNotFound(_0x3450ef,null))[_0x1eba('0x27')](removeEntity(_0x3450ef,null))['catch'](handleError(_0x3450ef,null));};exports['describe']=function(_0x3e7c1b,_0x49e7ff){return db[_0x1eba('0x34')]['describe']()[_0x1eba('0x27')](respondWithResult(_0x49e7ff,null))[_0x1eba('0x32')](handleError(_0x49e7ff,null));};exports['addMessage']=function(_0x2495b6,_0x587185,_0x5d52b1){return db[_0x1eba('0xb9')][_0x1eba('0x5f')]({'where':{'id':_0x2495b6['params']['id']}})['then'](handleEntityNotFound(_0x587185,null))[_0x1eba('0x27')](function(_0x43b3d5){if(_0x43b3d5){return _0x43b3d5[_0x1eba('0xba')](_0x2495b6[_0x1eba('0xb8')][_0x1eba('0xbb')],_['omit'](_0x2495b6[_0x1eba('0xb8')],[_0x1eba('0xbb'),'id'])||{});}})[_0x1eba('0x27')](respondWithResult(_0x587185,null))[_0x1eba('0x32')](handleError(_0x587185,null));};exports[_0x1eba('0xbc')]=function(_0x238d11,_0x30682f,_0x34f5ed){var _0x16f43c={'raw':![],'where':{}};var _0x4bd4fb={};var _0x5452bf={'count':0x0,'rows':[]};return db[_0x1eba('0x34')][_0x1eba('0xbd')]({'where':{'id':_0x238d11[_0x1eba('0xb2')]['id']}})[_0x1eba('0x27')](handleEntityNotFound(_0x30682f,null))[_0x1eba('0x27')](function(_0x1514c){if(_0x1514c){_0x4bd4fb['model']=_[_0x1eba('0x3a')](db[_0x1eba('0xb9')]['rawAttributes']);_0x4bd4fb[_0x1eba('0x39')]=_['keys'](_0x238d11[_0x1eba('0x39')]);_0x4bd4fb[_0x1eba('0x3b')]=_[_0x1eba('0x3c')](_0x4bd4fb[_0x1eba('0x38')],_0x4bd4fb[_0x1eba('0x39')]);_0x16f43c[_0x1eba('0x3d')]=_['intersection'](_0x4bd4fb[_0x1eba('0x38')],qs['fields'](_0x238d11[_0x1eba('0x39')]['fields']));_0x16f43c[_0x1eba('0x3d')]=_0x16f43c[_0x1eba('0x3d')][_0x1eba('0x3f')]?_0x16f43c[_0x1eba('0x3d')]:_0x4bd4fb[_0x1eba('0x38')];if(!_0x238d11[_0x1eba('0x39')][_0x1eba('0x40')](_0x1eba('0x41'))){_0x16f43c['limit']=qs['limit'](_0x238d11['query'][_0x1eba('0x21')]);_0x16f43c[_0x1eba('0x20')]=qs[_0x1eba('0x20')](_0x238d11[_0x1eba('0x39')]['offset']);}_0x16f43c[_0x1eba('0x42')]=qs[_0x1eba('0x43')](_0x238d11['query']['sort']);_0x16f43c['where']=qs[_0x1eba('0x3b')](_[_0x1eba('0x45')](_0x238d11[_0x1eba('0x39')],_0x4bd4fb[_0x1eba('0x3b')]));_0x16f43c['where']['FaxInteractionId']=_0x1514c['id'];if(_0x238d11[_0x1eba('0x39')][_0x1eba('0x82')]){_0x16f43c[_0x1eba('0x44')]=_[_0x1eba('0x99')](_0x16f43c['where'],{'$or':_['map'](_0x16f43c[_0x1eba('0x3d')],function(_0x54d7cc){var _0xa183d3={};_0xa183d3[_0x54d7cc]={'$like':'%'+_0x238d11[_0x1eba('0x39')][_0x1eba('0x82')]+'%'};return _0xa183d3;})});}if(_0x238d11[_0x1eba('0x39')][_0x1eba('0x7b')]){var _0x58ff7d=_0x238d11['query'][_0x1eba('0x7b')][_0x1eba('0x30')](',');var _0x23a609={};_0x23a609[_0x58ff7d[0x0]]={'$gte':moment(_0x58ff7d[0x1])['format'](_0x1eba('0xbe'))};_0x16f43c[_0x1eba('0x44')]=_[_0x1eba('0x99')](_0x16f43c[_0x1eba('0x44')],_0x23a609);}_0x16f43c=_[_0x1eba('0x99')]({},_0x16f43c,_0x238d11[_0x1eba('0xb5')]);return db[_0x1eba('0xb9')][_0x1eba('0x98')]({'where':_0x16f43c[_0x1eba('0x44')]})[_0x1eba('0x27')](function(_0xf982fb){_0x5452bf[_0x1eba('0x98')]=_0xf982fb;if(_0x238d11[_0x1eba('0x39')][_0x1eba('0xb3')]){_0x16f43c[_0x1eba('0xb4')]=[{'all':!![]}];}return db['FaxMessage'][_0x1eba('0xbf')](_0x16f43c);})['then'](function(_0x15c8d4){_0x5452bf['rows']=_0x15c8d4;return _0x5452bf;});}})[_0x1eba('0x27')](respondWithFilteredResult(_0x30682f,_0x16f43c))[_0x1eba('0x32')](handleError(_0x30682f,null));};exports[_0x1eba('0xc0')]=function(_0x223eb2,_0x237939,_0x596add){return db['FaxInteraction'][_0x1eba('0x5f')]({'where':{'id':_0x223eb2[_0x1eba('0xb2')]['id']}})['then'](handleEntityNotFound(_0x237939,null))['then'](function(_0x362bfd){if(_0x362bfd){return _0x362bfd['setTags'](_0x223eb2['body']['ids'],_['omit'](_0x223eb2[_0x1eba('0xb8')],[_0x1eba('0xbb'),'id'])||{})[_0x1eba('0xc1')](function(){return db[_0x1eba('0x6c')][_0x1eba('0xbf')]({'attributes':['id',_0x1eba('0x2a'),_0x1eba('0x47')],'where':{'id':_0x223eb2['body'][_0x1eba('0xbb')]}});})[_0x1eba('0x27')](function(_0xcab4b8){socket['emit']('faxInteractionTags:save',{'id':Number(_0x223eb2[_0x1eba('0xb2')]['id']),'tags':_0xcab4b8||[]});return{'id':Number(_0x223eb2[_0x1eba('0xb2')]['id']),'tags':_0xcab4b8||[]};});}})['then'](respondWithResult(_0x237939,null))[_0x1eba('0x32')](handleError(_0x237939,null));};exports[_0x1eba('0xc2')]=function(_0x3ad296,_0x2425b1,_0x4afe47){return db[_0x1eba('0x34')][_0x1eba('0x5f')]({'where':{'id':_0x3ad296[_0x1eba('0xb2')]['id']}})[_0x1eba('0x27')](handleEntityNotFound(_0x2425b1,null))[_0x1eba('0x27')](function(_0x5ddd33){if(_0x5ddd33){return _0x5ddd33[_0x1eba('0xc2')](_0x3ad296[_0x1eba('0x39')][_0x1eba('0xbb')]);}})[_0x1eba('0x27')](respondWithStatusCode(_0x2425b1,null))[_0x1eba('0x32')](handleError(_0x2425b1,null));};exports[_0x1eba('0xc3')]=function(_0x5580e9,_0x435aa4){var _0x3fbd5c=moment()[_0x1eba('0xc4')]()[_0x1eba('0x97')]();var _0x16daf9=path[_0x1eba('0xc5')](config[_0x1eba('0xc6')],_0x1eba('0xc7'),'files',_0x1eba('0xc8'));var _0x5a8c48=path[_0x1eba('0xc5')](config[_0x1eba('0xc6')],_0x1eba('0xc7'),_0x1eba('0xc9'),_0x1eba('0xca'));var _0x48add1=path[_0x1eba('0xc5')](_0x16daf9,_0x3fbd5c);var _0x164d57=util[_0x1eba('0xcb')]('transcript-%d-%s.zip',_0x5580e9[_0x1eba('0xb2')]['id'],_0x3fbd5c);var _0x500ad8=path[_0x1eba('0xc5')](_0x16daf9,_0x164d57);var _0x860ec5=[];_0x860ec5[_0x1eba('0xaf')]({'model':db[_0x1eba('0xcc')],'as':_0x1eba('0xcc'),'raw':!![]});var _0x5b4274=[{'model':db[_0x1eba('0xb9')],'as':_0x1eba('0xcd'),'attributes':['id',_0x1eba('0xb8'),_0x1eba('0x79')],'include':_0x860ec5}];return db[_0x1eba('0x34')][_0x1eba('0x5f')]({'where':{'id':_0x5580e9['params']['id']},'include':_0x5b4274})['then'](handleEntityNotFound(_0x435aa4,null))[_0x1eba('0x27')](function(_0x2e6505){if(_0x2e6505&&_0x2e6505[_0x1eba('0xcd')]){var _0x233075=_0x2e6505[_0x1eba('0xce')]({'plain':!![]});fs['mkdirSync'](_0x48add1);for(var _0x193fef=0x0;_0x193fef<_0x233075[_0x1eba('0xcd')][_0x1eba('0x3f')];_0x193fef++){var _0x33208c=_0x233075[_0x1eba('0xcd')][_0x193fef][_0x1eba('0xcc')];if(_0x33208c){var _0x431e0f=path['join'](_0x5a8c48,_0x33208c['basename']);if(fs[_0x1eba('0xcf')](_0x431e0f)){fs[_0x1eba('0xd0')](_0x431e0f)[_0x1eba('0xd1')](fs['createWriteStream'](path['join'](_0x48add1,_0x33208c[_0x1eba('0xd2')])));}}}return BPromise[_0x1eba('0xd3')]()[_0x1eba('0x27')](function(){return new BPromise(function(_0xda5dec,_0x36dce9){zipdir(_0x48add1,{'saveTo':_0x500ad8},function(_0x19ffaf,_0x46ed24){if(_0x19ffaf)return _0x36dce9(_0x19ffaf);return _0xda5dec(_0x46ed24);});})[_0x1eba('0x27')](function(){return new BPromise(function(_0x36f56f,_0x11ef44){rimraf(_0x48add1,function(_0x5407e7){if(_0x5407e7)_0x11ef44(_0x5407e7);return _0x36f56f();});});})[_0x1eba('0x27')](function(){return _0x435aa4[_0x1eba('0xc3')](_0x500ad8,_0x164d57,function(_0x13d3ad){if(_0x13d3ad){console['log'](_0x1eba('0xd4'),_0x13d3ad);}else{fs[_0x1eba('0xd5')](_0x500ad8);}});});});}else{return _0x435aa4['sendStatus'](0xc8);}})[_0x1eba('0x32')](handleError(_0x435aa4,null));}; \ No newline at end of file +var _0x2603=['Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','rows','params','includeAll','include','options','create','describe','FaxMessage','addMessage','omit','ids','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','basename','existsSync','pipe','createWriteStream','download','log','err','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','./faxInteraction.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','field','color','from','u.id','u.fullname','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','FaxAccountId','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName'];(function(_0x272700,_0x525483){var _0x3927a4=function(_0x5a98e0){while(--_0x5a98e0){_0x272700['push'](_0x272700['shift']());}};_0x3927a4(++_0x525483);}(_0x2603,0x10a));var _0x3260=function(_0x3400ca,_0x27c04d){_0x3400ca=_0x3400ca-0x0;var _0x26e8d1=_0x2603[_0x3400ca];return _0x26e8d1;};'use strict';var pdf=require(_0x3260('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3260('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3260('0x2'));var moment=require(_0x3260('0x3'));var BPromise=require(_0x3260('0x4'));var Mustache=require(_0x3260('0x5'));var util=require(_0x3260('0x6'));var path=require(_0x3260('0x7'));var sox=require(_0x3260('0x8'));var csv=require('to-csv');var ejs=require(_0x3260('0x9'));var fs=require('fs');var _=require(_0x3260('0xa'));var squel=require(_0x3260('0xb'));var crypto=require(_0x3260('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3260('0xd'));var toCsv=require(_0x3260('0xe'));var querystring=require(_0x3260('0xf'));var Papa=require(_0x3260('0x10'));var Redis=require(_0x3260('0x11'));var authService=require(_0x3260('0x12'));var qs=require(_0x3260('0x13'));var as=require(_0x3260('0x14'));var hardwareService=require(_0x3260('0x15'));var logger=require(_0x3260('0x16'))('api');var utils=require(_0x3260('0x17'));var config=require(_0x3260('0x18'));var db=require('../../mysqldb')['db'];config[_0x3260('0x19')]=_['defaults'](config[_0x3260('0x19')],{'host':_0x3260('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3260('0x19')]));require(_0x3260('0x1b'))[_0x3260('0x1c')](socket);function respondWithStatusCode(_0x3e5632,_0xce34c){_0xce34c=_0xce34c||0xcc;return function(_0x5a4f6e){if(_0x5a4f6e){return _0x3e5632[_0x3260('0x1d')](_0xce34c);}return _0x3e5632[_0x3260('0x1e')](_0xce34c)['end']();};}function respondWithResult(_0x42521e,_0x29e569){_0x29e569=_0x29e569||0xc8;return function(_0x239c2c){if(_0x239c2c){return _0x42521e['status'](_0x29e569)['json'](_0x239c2c);}};}function respondWithFilteredResult(_0x340641,_0x4ed953){return function(_0x20b45b){if(_0x20b45b){var _0x360bb2=_0x20b45b[_0x3260('0x1f')],_0x40f193=_0x4ed953['offset'],_0x4c4a91=_0x4ed953[_0x3260('0x20')]+_0x4ed953[_0x3260('0x21')],_0x24dbf6;if(_0x4c4a91>=_0x360bb2){_0x4c4a91=_0x360bb2;_0x24dbf6=0xc8;}else{_0x24dbf6=0xce;}_0x340641['status'](_0x24dbf6);return _0x340641[_0x3260('0x22')](_0x3260('0x23'),_0x40f193+'-'+_0x4c4a91+'/'+_0x360bb2)['json'](_0x20b45b);}return null;};}function patchUpdates(_0x5219ed){return function(_0x2ec99c){try{jsonpatch[_0x3260('0x24')](_0x2ec99c,_0x5219ed,!![]);}catch(_0x286378){return BPromise[_0x3260('0x25')](_0x286378);}return _0x2ec99c[_0x3260('0x26')]();};}function saveUpdates(_0x33a16e,_0x41f9c){return function(_0x378b0c){if(_0x378b0c){return _0x378b0c['update'](_0x33a16e)[_0x3260('0x27')](function(_0x503c01){return _0x503c01;});}return null;};}function removeEntity(_0x768df9,_0x384043){return function(_0xce1916){if(_0xce1916){return _0xce1916[_0x3260('0x28')]()[_0x3260('0x27')](function(){_0x768df9[_0x3260('0x1e')](0xcc)[_0x3260('0x29')]();});}};}function handleEntityNotFound(_0xa15cb2,_0xfb0a29){return function(_0x4f5b0b){if(!_0x4f5b0b){_0xa15cb2[_0x3260('0x1d')](0x194);}return _0x4f5b0b;};}function handleError(_0x44c98d,_0x2c400f){_0x2c400f=_0x2c400f||0x1f4;return function(_0x56f5b4){logger[_0x3260('0x2a')](_0x56f5b4[_0x3260('0x2b')]);if(_0x56f5b4['name']){delete _0x56f5b4[_0x3260('0x2c')];}_0x44c98d[_0x3260('0x1e')](_0x2c400f)[_0x3260('0x2d')](_0x56f5b4);};}function getInteractionUsers(_0x40024a,_0x1a0966){return new BPromise(function(_0x55d008,_0x5efd09){try{if(_0x1a0966[_0x40024a['id']]){_0x40024a['Users']=_[_0x3260('0x2e')](_0x1a0966[_0x40024a['id']],function(_0x4d8b5e){return{'id':_0x4d8b5e['id'],'fullname':_0x4d8b5e[_0x3260('0x2f')]};});}}catch(_0x3820dc){_0x5efd09(_0x3820dc);}_0x55d008(_0x40024a);});}function getInteractionTags(_0x3a35e2,_0x1edae1){return new BPromise(function(_0x215186,_0x528480){try{if(_0x3a35e2[_0x3260('0x30')]){_0x3a35e2[_0x3260('0x31')]=[];_0x3a35e2[_0x3260('0x30')][_0x3260('0x32')](',')[_0x3260('0x33')](function(_0x58bd8a){_0x3a35e2[_0x3260('0x31')][_0x3260('0x34')](_0x1edae1[_0x58bd8a]);});}delete _0x3a35e2[_0x3260('0x30')];}catch(_0x3bdd1d){_0x528480(_0x3bdd1d);}_0x215186(_0x3a35e2);});}function updateFaxInteraction(_0x502bb0,_0x570b2e,_0x2b0e18){return new BPromise(function(_0x44c5ef,_0x2f9ffd){return getInteractionUsers(_0x502bb0,_0x2b0e18)[_0x3260('0x27')](function(_0x586c6d){return getInteractionTags(_0x586c6d,_0x570b2e);})[_0x3260('0x27')](function(_0x59b780){_0x44c5ef(_0x59b780);})[_0x3260('0x35')](function(_0x41a4c4){_0x2f9ffd(_0x41a4c4);});});}exports[_0x3260('0x36')]=function(_0x504fdb,_0x216468){var _0x3e6152={},_0x1ceb71={},_0x2daeeb={'count':0x0,'rows':[]};var _0x58bc68=_['map'](db[_0x3260('0x37')][_0x3260('0x38')],function(_0x2e6bcf){return{'name':_0x2e6bcf[_0x3260('0x39')],'type':_0x2e6bcf[_0x3260('0x3a')]['key']};});_0x1ceb71[_0x3260('0x3b')]=_['map'](_0x58bc68,_0x3260('0x2c'));_0x1ceb71[_0x3260('0x3c')]=_[_0x3260('0x3d')](_0x504fdb['query']);_0x1ceb71['filters']=_[_0x3260('0x3e')](_0x1ceb71[_0x3260('0x3b')],_0x1ceb71[_0x3260('0x3c')]);_0x3e6152[_0x3260('0x3f')]=_[_0x3260('0x3e')](_0x1ceb71['model'],qs['fields'](_0x504fdb['query'][_0x3260('0x40')]));_0x3e6152[_0x3260('0x3f')]=_0x3e6152[_0x3260('0x3f')][_0x3260('0x41')]?_0x3e6152[_0x3260('0x3f')]:_0x1ceb71['model'];if(!_0x504fdb[_0x3260('0x3c')][_0x3260('0x42')](_0x3260('0x43'))){_0x3e6152['limit']=qs[_0x3260('0x21')](_0x504fdb[_0x3260('0x3c')]['limit']);_0x3e6152[_0x3260('0x20')]=qs[_0x3260('0x20')](_0x504fdb['query'][_0x3260('0x20')]);}_0x3e6152['order']=qs[_0x3260('0x44')](_0x504fdb[_0x3260('0x3c')][_0x3260('0x44')]);_0x3e6152[_0x3260('0x45')]=qs[_0x3260('0x46')](_[_0x3260('0x47')](_0x504fdb[_0x3260('0x3c')],_0x1ceb71[_0x3260('0x46')]));var _0x51ad56=[];var _0x1e739c=squel['select']()[_0x3260('0x48')]('id')[_0x3260('0x48')](_0x3260('0x2c'))['field'](_0x3260('0x49'))[_0x3260('0x4a')]('tools_tags');var _0x19748f=squel['select']()[_0x3260('0x48')](_0x3260('0x4b'))[_0x3260('0x48')](_0x3260('0x4c'))[_0x3260('0x48')]('ui.FaxInteractionId')[_0x3260('0x4a')](_0x3260('0x4d'),'ui')[_0x3260('0x4e')]('users','u',_0x3260('0x4f'));var _0x40f54a=squel['select']()[_0x3260('0x4a')](_0x3260('0x50'),'i')['left_join']('cm_contacts','c',_0x3260('0x51'))['left_join']('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x3260('0x52'),'a',_0x3260('0x53'))[_0x3260('0x4e')](_0x3260('0x54'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x3260('0x4e')](_0x3260('0x55'),'it',_0x3260('0x56'))[_0x3260('0x4e')](_0x3260('0x57'),'t',_0x3260('0x58'));var _0x4b110d=squel[_0x3260('0x59')]();var _0x45f0c1=[];var _0x5213e3=squel[_0x3260('0x59')]();var _0x12518;if(_0x504fdb[_0x3260('0x3c')][_0x3260('0x5a')]){_0x12518=as[_0x3260('0x5b')](_0x504fdb[_0x3260('0x3c')][_0x3260('0x5a')]);var _0xdd3ad1=_0x12518[_0x3260('0x5c')];for(var _0xc08f83=0x0;_0xc08f83<_0x12518[_0x3260('0x5d')][_0x3260('0x41')];_0xc08f83++){var _0xc40c9a=_0x12518[_0x3260('0x5d')][_0xc08f83];var _0x120203='i';var _0x389733=_[_0x3260('0x5e')](_0x58bc68,[_0x3260('0x2c'),_0xc40c9a[_0x3260('0x48')]]);if(!_0x389733){switch(_0xc40c9a[_0x3260('0x48')]){case _0x3260('0x5f'):if(_0xc40c9a['value']==0x1){_0x40f54a[_0x3260('0x60')]('`'+_0xc40c9a[_0x3260('0x48')]+_0x3260('0x61'));}else{_0x40f54a[_0x3260('0x60')]('`'+_0xc40c9a['field']+_0x3260('0x62'));}break;case _0x3260('0x63'):if(_0xc40c9a['operator']===_0x3260('0x64')){if(_0xc40c9a['value'][_0x3260('0x32')]('\x20')[_0x3260('0x41')]>0x1){_0x4b110d[_0xdd3ad1](_0x3260('0x65'),qs[_0x3260('0x66')](_0xc40c9a[_0x3260('0x67')]),null);}else{var _0x3e9c35='%'+_0xc40c9a[_0x3260('0x67')]+'%';_0x4b110d[_0xdd3ad1](_0x3260('0x68'),_0x3e9c35,_0x3e9c35,_0x3e9c35);}}else{_0x389733=_[_0x3260('0x5e')](_0x58bc68,[_0x3260('0x2c'),_0x3260('0x69')]);_0xc40c9a['field']=_0x3260('0x69');_0x22e019=as['buildExpression'](_0x120203,_0x389733[_0x3260('0x3a')],_0xc40c9a);_0x4b110d[_0xdd3ad1](_0x22e019[_0x3260('0x6a')],_0x22e019[_0x3260('0x67')][_0x3260('0x6b')],_0x22e019[_0x3260('0x67')][_0x3260('0x29')]);}break;case _0x3260('0x6c'):var _0x1a19e6=_0xc40c9a['value'][_0x3260('0x32')](',')[_0x3260('0x2e')](function(_0x663c){return Number(_0x663c);});_0x1a19e6[_0x3260('0x33')](function(_0x1d20e9){_0x5213e3['or'](_0x3260('0x6d'),'%,'+_0x1d20e9+',%');});_0x45f0c1=_[_0x3260('0x6e')](_0x45f0c1,_0x1a19e6);break;case _0x3260('0x6f'):if(_0xc40c9a['operator']===_0x3260('0x64')){_0x4b110d[_0xdd3ad1](_0x3260('0x70'),'%'+_0xc40c9a[_0x3260('0x67')]+'%',null);}else{_0x389733=_[_0x3260('0x5e')](_0x58bc68,[_0x3260('0x2c'),'UserId']);_0xc40c9a['field']=_0x3260('0x71');_0x22e019=as[_0x3260('0x72')](_0x120203,_0x389733[_0x3260('0x3a')],_0xc40c9a);_0x4b110d[_0xdd3ad1](_0x22e019['text'],_0x22e019[_0x3260('0x67')][_0x3260('0x6b')],_0x22e019[_0x3260('0x67')][_0x3260('0x29')]);}break;case _0x3260('0x73'):_0x22e019=as['buildExpression']('me',null,_0xc40c9a);_0x4b110d[_0xdd3ad1](_0x22e019['text'],_0x22e019['value'][_0x3260('0x6b')],_0x22e019[_0x3260('0x67')][_0x3260('0x29')]);break;}}else{var _0x22e019=as[_0x3260('0x72')](_0x120203,_0x389733[_0x3260('0x3a')],_0xc40c9a);_0x4b110d[_0xdd3ad1](_0x22e019['text'],_0x22e019['value'][_0x3260('0x6b')],_0x22e019['value']['end']);}}}else{var _0x256f8e=_(_0x504fdb[_0x3260('0x3c')])['keys']()[_0x3260('0x2e')](function(_0x160f6c){return _[_0x3260('0x74')](_0x58bc68,[_0x3260('0x2c'),_0x160f6c])?_0x160f6c:undefined;})['compact']()[_0x3260('0x67')]();if(!_['isEmpty'](_0x256f8e)){_0x256f8e[_0x3260('0x33')](function(_0x2c26ec){if(_0x2c26ec===_0x3260('0x75')){_0x40f54a[_0x3260('0x45')]('i.FaxAccountId\x20IN\x20?',[][_0x3260('0x76')](_0x504fdb[_0x3260('0x3c')][_0x2c26ec]));}else if(_0x2c26ec===_0x3260('0x77')){var _0x3d7949=JSON[_0x3260('0x78')](_0x504fdb[_0x3260('0x3c')][_0x2c26ec])['$gte'];var _0x4c9186=JSON[_0x3260('0x78')](_0x504fdb[_0x3260('0x3c')][_0x2c26ec])[_0x3260('0x79')];_0x40f54a['where'](_0x3260('0x7a'),_0x3d7949,_0x4c9186);}else{if(_0x504fdb[_0x3260('0x3c')][_0x2c26ec]===_0x3260('0x7b')){_0x40f54a[_0x3260('0x45')]('i.'+_0x2c26ec+_0x3260('0x7c'));}else{_0x40f54a[_0x3260('0x45')]('i.'+_0x2c26ec+'\x20=\x20?',_0x504fdb[_0x3260('0x3c')][_0x2c26ec]);}}});}if(_0x504fdb[_0x3260('0x3c')]['read']){if(_0x504fdb[_0x3260('0x3c')]['read']==0x1){_0x40f54a[_0x3260('0x60')](_0x3260('0x7d'));}else{_0x40f54a['having']('`unreadMessages`\x20>\x200');}}if(_0x504fdb[_0x3260('0x3c')][_0x3260('0x7e')]){_0x45f0c1=_[_0x3260('0x7f')](_0x504fdb[_0x3260('0x3c')][_0x3260('0x7e')])?_0x504fdb[_0x3260('0x3c')][_0x3260('0x7e')]:new Array(_0x504fdb[_0x3260('0x3c')][_0x3260('0x7e')]);_0x45f0c1[_0x3260('0x33')](function(_0x190887){_0x5213e3['or'](_0x3260('0x6d'),'%,'+_0x190887+',%');});}if(_0x504fdb['query'][_0x3260('0x80')]){var _0x56f7d9=_0x504fdb[_0x3260('0x3c')][_0x3260('0x80')][_0x3260('0x81')]('\x5c','\x5c\x5c')[_0x3260('0x81')]('\x27\x27',_0x3260('0x82'));if(qs['isNumeric'](_0x56f7d9)){_0x4b110d['or'](_0x3260('0x83'),_0x56f7d9+'%')['or']('i.fax\x20LIKE\x20?',_0x56f7d9+'%');}_0x4b110d['or'](_0x3260('0x84'),_0x56f7d9+'%');}}_0x40f54a[_0x3260('0x45')](_0x4b110d);_0x40f54a[_0x3260('0x85')](_0x3260('0x86'));var _0x1c10c8={'type':db['Sequelize'][_0x3260('0x87')][_0x3260('0x88')],'raw':!![]};var _0x233f6f=_0x40f54a['clone']();_0x233f6f[_0x3260('0x48')](_0x3260('0x86'));_0x233f6f[_0x3260('0x48')](_0x3260('0x89'),_0x3260('0x5f'));if(_0x3e6152['order']){_0x3e6152[_0x3260('0x8a')]['forEach'](function(_0x9f76ec){_0x40f54a[_0x3260('0x8a')]('i.'+_0x9f76ec[0x0],_0x9f76ec[0x1]===_0x3260('0x8b')?![]:!![]);});}if(!_[_0x3260('0x8c')](_0x45f0c1)){_0x40f54a[_0x3260('0x60')](_0x5213e3);_0x233f6f['where']('t.id\x20IN\x20?',_0x45f0c1);}BPromise[_0x3260('0x8d')]()[_0x3260('0x27')](function(){if(!_0x12518){if(_0x504fdb[_0x3260('0x3c')][_0x3260('0x75')]||_0x504fdb['query'][_0x3260('0x8e')])return;_0x233f6f['where'](_0x3260('0x8f'));_0x40f54a[_0x3260('0x45')](_0x3260('0x8f'));return;}return _0x504fdb['user'][_0x3260('0x90')]({'attributes':['id'],'raw':!![]})[_0x3260('0x27')](function(_0x2572f0){if(_['isEmpty'](_0x2572f0)){_0x233f6f[_0x3260('0x45')](_0x3260('0x91'));_0x40f54a['where'](_0x3260('0x91'));}else{_0x233f6f[_0x3260('0x45')](_0x3260('0x92'),_[_0x3260('0x2e')](_0x2572f0,'id'));_0x40f54a['where']('i.FaxAccountId\x20IN\x20?',_['map'](_0x2572f0,'id'));}});})[_0x3260('0x27')](function(){db[_0x3260('0x93')][_0x3260('0x3c')](_0x233f6f[_0x3260('0x94')](),_0x1c10c8)[_0x3260('0x27')](function(_0xc5df16){_0x2daeeb[_0x3260('0x1f')]=_0xc5df16[_0x3260('0x41')];if(_0x2daeeb[_0x3260('0x1f')]===0x0)return[];return db[_0x3260('0x93')][_0x3260('0x3c')](_0x1e739c[_0x3260('0x94')](),_0x1c10c8)[_0x3260('0x27')](function(_0x4b7549){_0x51ad56=_['keyBy'](_0x4b7549,'id');_0x1c10c8=_[_0x3260('0x95')](_0x1c10c8,{'model':db[_0x3260('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x504fdb[_0x3260('0x3c')][_0x3260('0x40')]){_0x3e6152[_0x3260('0x3f')][_0x3260('0x33')](function(_0x1f064c){_0x40f54a[_0x3260('0x48')]('i.'+_0x1f064c);});}else{_0x40f54a[_0x3260('0x48')](_0x3260('0x89'),_0x3260('0x5f'));_0x40f54a['field']('a.key',_0x3260('0x96'));_0x40f54a[_0x3260('0x48')](_0x3260('0x97'),_0x3260('0x98'));_0x40f54a[_0x3260('0x48')](_0x3260('0x99'));_0x40f54a[_0x3260('0x48')]('c.firstName',_0x3260('0x9a'));_0x40f54a[_0x3260('0x48')](_0x3260('0x9b'),_0x3260('0x9c'));_0x40f54a[_0x3260('0x48')](_0x3260('0x9d'),'Contact.email');_0x40f54a['field'](_0x3260('0x9e'),_0x3260('0x9f'));_0x40f54a[_0x3260('0x48')](_0x3260('0xa0'),'Contact.mobile');_0x40f54a['field'](_0x3260('0xa1'),_0x3260('0xa2'));_0x40f54a[_0x3260('0x48')](_0x3260('0xa3'),_0x3260('0xa4'));_0x40f54a[_0x3260('0x48')](_0x3260('0xa5'),_0x3260('0xa6'));_0x40f54a[_0x3260('0x48')](_0x3260('0xa7'),_0x3260('0x30'));}_0x40f54a[_0x3260('0x21')](_0x3e6152[_0x3260('0x21')]);_0x40f54a['offset'](_0x3e6152[_0x3260('0x20')]);return db[_0x3260('0x93')][_0x3260('0x3c')](_0x40f54a['toString'](),_0x1c10c8);})[_0x3260('0x27')](function(_0x259821){_0x19748f[_0x3260('0x45')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x259821,'id'));return db[_0x3260('0x93')]['query'](_0x19748f[_0x3260('0x94')](),_0x1c10c8)['then'](function(_0x36d2ed){var _0xa2f2f8=_[_0x3260('0xa8')](_0x36d2ed,_0x3260('0xa9'));var _0x2f66cd=[];_0x259821[_0x3260('0x33')](function(_0x3d1af3){_0x2f66cd[_0x3260('0x34')](updateFaxInteraction(_0x3d1af3,_0x51ad56,_0xa2f2f8));});return BPromise['all'](_0x2f66cd);});});})[_0x3260('0x27')](function(_0x50621c){_0x2daeeb[_0x3260('0xaa')]=_0x50621c;return _0x2daeeb;})[_0x3260('0x27')](respondWithFilteredResult(_0x216468,_0x3e6152));})[_0x3260('0x35')](handleError(_0x216468,null));};exports['show']=function(_0x56f859,_0x31348d){var _0x37c6b1={'raw':![],'where':{'id':_0x56f859[_0x3260('0xab')]['id']}},_0x4948d3={};_0x4948d3[_0x3260('0x3b')]=_[_0x3260('0x3d')](db[_0x3260('0x37')]['rawAttributes']);_0x4948d3[_0x3260('0x3c')]=_[_0x3260('0x3d')](_0x56f859[_0x3260('0x3c')]);_0x4948d3[_0x3260('0x46')]=_[_0x3260('0x3e')](_0x4948d3[_0x3260('0x3b')],_0x4948d3[_0x3260('0x3c')]);_0x37c6b1[_0x3260('0x3f')]=_[_0x3260('0x3e')](_0x4948d3['model'],qs['fields'](_0x56f859[_0x3260('0x3c')][_0x3260('0x40')]));_0x37c6b1[_0x3260('0x3f')]=_0x37c6b1[_0x3260('0x3f')]['length']?_0x37c6b1['attributes']:_0x4948d3['model'];if(_0x56f859['query'][_0x3260('0xac')]){_0x37c6b1[_0x3260('0xad')]=[{'all':!![]}];}_0x37c6b1=_[_0x3260('0x95')]({},_0x37c6b1,_0x56f859[_0x3260('0xae')]);return db['FaxInteraction']['find'](_0x37c6b1)[_0x3260('0x27')](handleEntityNotFound(_0x31348d,null))[_0x3260('0x27')](respondWithResult(_0x31348d,null))['catch'](handleError(_0x31348d,null));};exports[_0x3260('0xaf')]=function(_0x189561,_0x2e9505){return db['FaxInteraction'][_0x3260('0xaf')](_0x189561['body'],{})[_0x3260('0x27')](respondWithResult(_0x2e9505,0xc9))['catch'](handleError(_0x2e9505,null));};exports['update']=function(_0x15b96e,_0x164544){if(_0x15b96e[_0x3260('0x73')]['id']){delete _0x15b96e[_0x3260('0x73')]['id'];}return db['FaxInteraction'][_0x3260('0x5e')]({'where':{'id':_0x15b96e[_0x3260('0xab')]['id']}})['then'](handleEntityNotFound(_0x164544,null))[_0x3260('0x27')](saveUpdates(_0x15b96e[_0x3260('0x73')],null))['then'](respondWithResult(_0x164544,null))['catch'](handleError(_0x164544,null));};exports[_0x3260('0x28')]=function(_0x81d24f,_0x136f95){return db[_0x3260('0x37')][_0x3260('0x5e')]({'where':{'id':_0x81d24f['params']['id']}})[_0x3260('0x27')](handleEntityNotFound(_0x136f95,null))['then'](removeEntity(_0x136f95,null))['catch'](handleError(_0x136f95,null));};exports[_0x3260('0xb0')]=function(_0x2876b2,_0x571f66){return db[_0x3260('0x37')][_0x3260('0xb0')]()[_0x3260('0x27')](respondWithResult(_0x571f66,null))[_0x3260('0x35')](handleError(_0x571f66,null));};exports['addMessage']=function(_0x13fe2a,_0x1bb058,_0x2641ff){return db[_0x3260('0xb1')]['find']({'where':{'id':_0x13fe2a['params']['id']}})[_0x3260('0x27')](handleEntityNotFound(_0x1bb058,null))[_0x3260('0x27')](function(_0x3ffc75){if(_0x3ffc75){return _0x3ffc75[_0x3260('0xb2')](_0x13fe2a[_0x3260('0x73')]['ids'],_[_0x3260('0xb3')](_0x13fe2a[_0x3260('0x73')],[_0x3260('0xb4'),'id'])||{});}})['then'](respondWithResult(_0x1bb058,null))[_0x3260('0x35')](handleError(_0x1bb058,null));};exports[_0x3260('0xb5')]=function(_0x1fd640,_0x244e3a,_0x1efb71){var _0x1e8751={'raw':![],'where':{}};var _0x2d403f={};var _0x2360e2={'count':0x0,'rows':[]};return db[_0x3260('0x37')][_0x3260('0xb6')]({'where':{'id':_0x1fd640[_0x3260('0xab')]['id']}})[_0x3260('0x27')](handleEntityNotFound(_0x244e3a,null))[_0x3260('0x27')](function(_0x2e3039){if(_0x2e3039){_0x2d403f[_0x3260('0x3b')]=_[_0x3260('0x3d')](db[_0x3260('0xb1')][_0x3260('0x38')]);_0x2d403f[_0x3260('0x3c')]=_['keys'](_0x1fd640[_0x3260('0x3c')]);_0x2d403f['filters']=_[_0x3260('0x3e')](_0x2d403f[_0x3260('0x3b')],_0x2d403f[_0x3260('0x3c')]);_0x1e8751[_0x3260('0x3f')]=_['intersection'](_0x2d403f['model'],qs[_0x3260('0x40')](_0x1fd640['query'][_0x3260('0x40')]));_0x1e8751[_0x3260('0x3f')]=_0x1e8751['attributes'][_0x3260('0x41')]?_0x1e8751[_0x3260('0x3f')]:_0x2d403f[_0x3260('0x3b')];if(!_0x1fd640[_0x3260('0x3c')][_0x3260('0x42')](_0x3260('0x43'))){_0x1e8751[_0x3260('0x21')]=qs[_0x3260('0x21')](_0x1fd640[_0x3260('0x3c')]['limit']);_0x1e8751[_0x3260('0x20')]=qs['offset'](_0x1fd640[_0x3260('0x3c')][_0x3260('0x20')]);}_0x1e8751[_0x3260('0x8a')]=qs[_0x3260('0x44')](_0x1fd640['query'][_0x3260('0x44')]);_0x1e8751[_0x3260('0x45')]=qs[_0x3260('0x46')](_[_0x3260('0x47')](_0x1fd640['query'],_0x2d403f[_0x3260('0x46')]));_0x1e8751[_0x3260('0x45')][_0x3260('0xa9')]=_0x2e3039['id'];if(_0x1fd640['query'][_0x3260('0x80')]){_0x1e8751['where']=_[_0x3260('0x95')](_0x1e8751[_0x3260('0x45')],{'$or':_[_0x3260('0x2e')](_0x1e8751[_0x3260('0x3f')],function(_0x1d3e1c){var _0x55f379={};_0x55f379[_0x1d3e1c]={'$like':'%'+_0x1fd640['query'][_0x3260('0x80')]+'%'};return _0x55f379;})});}if(_0x1fd640[_0x3260('0x3c')][_0x3260('0xb7')]){var _0x281ee7=_0x1fd640[_0x3260('0x3c')]['$gte']['split'](',');var _0x2df9a1={};_0x2df9a1[_0x281ee7[0x0]]={'$gte':moment(_0x281ee7[0x1])[_0x3260('0xb8')](_0x3260('0xb9'))};_0x1e8751[_0x3260('0x45')]=_[_0x3260('0x95')](_0x1e8751[_0x3260('0x45')],_0x2df9a1);}_0x1e8751=_[_0x3260('0x95')]({},_0x1e8751,_0x1fd640[_0x3260('0xae')]);return db[_0x3260('0xb1')][_0x3260('0x1f')]({'where':_0x1e8751['where']})[_0x3260('0x27')](function(_0xf995d0){_0x2360e2[_0x3260('0x1f')]=_0xf995d0;if(_0x1fd640[_0x3260('0x3c')][_0x3260('0xac')]){_0x1e8751[_0x3260('0xad')]=[{'all':!![]}];}return db['FaxMessage'][_0x3260('0xba')](_0x1e8751);})[_0x3260('0x27')](function(_0x3d98fc){_0x2360e2['rows']=_0x3d98fc;return _0x2360e2;});}})[_0x3260('0x27')](respondWithFilteredResult(_0x244e3a,_0x1e8751))[_0x3260('0x35')](handleError(_0x244e3a,null));};exports[_0x3260('0xbb')]=function(_0xd140c8,_0x8b0e45,_0x4aaac7){return db[_0x3260('0x37')][_0x3260('0x5e')]({'where':{'id':_0xd140c8['params']['id']}})['then'](handleEntityNotFound(_0x8b0e45,null))[_0x3260('0x27')](function(_0x40fc64){if(_0x40fc64){return _0x40fc64[_0x3260('0xbc')](_0xd140c8[_0x3260('0x73')][_0x3260('0xb4')],_[_0x3260('0xb3')](_0xd140c8['body'],[_0x3260('0xb4'),'id'])||{})[_0x3260('0xbd')](function(){return db[_0x3260('0x6c')][_0x3260('0xba')]({'attributes':['id',_0x3260('0x2c'),_0x3260('0x49')],'where':{'id':_0xd140c8['body']['ids']}});})[_0x3260('0x27')](function(_0x278c90){socket[_0x3260('0xbe')](_0x3260('0xbf'),{'id':Number(_0xd140c8['params']['id']),'tags':_0x278c90||[]});return{'id':Number(_0xd140c8['params']['id']),'tags':_0x278c90||[]};});}})[_0x3260('0x27')](respondWithResult(_0x8b0e45,null))[_0x3260('0x35')](handleError(_0x8b0e45,null));};exports[_0x3260('0xc0')]=function(_0x296ce9,_0x35333c,_0x250dc7){return db[_0x3260('0x37')]['find']({'where':{'id':_0x296ce9[_0x3260('0xab')]['id']}})[_0x3260('0x27')](handleEntityNotFound(_0x35333c,null))[_0x3260('0x27')](function(_0x183263){if(_0x183263){return _0x183263['removeTags'](_0x296ce9[_0x3260('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x35333c,null))[_0x3260('0x35')](handleError(_0x35333c,null));};exports['download']=function(_0x4c322e,_0x1f8332){var _0x4ae8d7=moment()[_0x3260('0xc1')]()['toString']();var _0x29d618=path[_0x3260('0xc2')](config[_0x3260('0xc3')],_0x3260('0xc4'),_0x3260('0xc5'),_0x3260('0xc6'));var _0x4776e6=path['join'](config['root'],_0x3260('0xc4'),_0x3260('0xc5'),_0x3260('0xc7'));var _0x3bf9d1=path[_0x3260('0xc2')](_0x29d618,_0x4ae8d7);var _0x1b5377=util[_0x3260('0xb8')](_0x3260('0xc8'),_0x4c322e[_0x3260('0xab')]['id'],_0x4ae8d7);var _0x2fea08=path['join'](_0x29d618,_0x1b5377);var _0xf6d185=[];_0xf6d185[_0x3260('0x34')]({'model':db[_0x3260('0xc9')],'as':'Attachment','raw':!![]});var _0x51741e=[{'model':db[_0x3260('0xb1')],'as':'Messages','attributes':['id',_0x3260('0x73'),_0x3260('0x77')],'include':_0xf6d185}];return db[_0x3260('0x37')][_0x3260('0x5e')]({'where':{'id':_0x4c322e[_0x3260('0xab')]['id']},'include':_0x51741e})[_0x3260('0x27')](handleEntityNotFound(_0x1f8332,null))[_0x3260('0x27')](function(_0x349c03){if(_0x349c03&&_0x349c03[_0x3260('0xca')]){var _0x19c433=_0x349c03[_0x3260('0xcb')]({'plain':!![]});fs['mkdirSync'](_0x3bf9d1);for(var _0x4ce2e3=0x0;_0x4ce2e3<_0x19c433[_0x3260('0xca')][_0x3260('0x41')];_0x4ce2e3++){var _0x49310f=_0x19c433[_0x3260('0xca')][_0x4ce2e3]['Attachment'];if(_0x49310f){var _0x3dc72b=path['join'](_0x4776e6,_0x49310f[_0x3260('0xcc')]);if(fs[_0x3260('0xcd')](_0x3dc72b)){fs['createReadStream'](_0x3dc72b)[_0x3260('0xce')](fs[_0x3260('0xcf')](path[_0x3260('0xc2')](_0x3bf9d1,_0x49310f['basename'])));}}}return BPromise[_0x3260('0x8d')]()[_0x3260('0x27')](function(){return new BPromise(function(_0x2b204c,_0x512904){zipdir(_0x3bf9d1,{'saveTo':_0x2fea08},function(_0xa9627b,_0x1edd4b){if(_0xa9627b)return _0x512904(_0xa9627b);return _0x2b204c(_0x1edd4b);});})[_0x3260('0x27')](function(){return new BPromise(function(_0x29924c,_0x345f23){rimraf(_0x3bf9d1,function(_0x51eb4c){if(_0x51eb4c)_0x345f23(_0x51eb4c);return _0x29924c();});});})[_0x3260('0x27')](function(){return _0x1f8332[_0x3260('0xd0')](_0x2fea08,_0x1b5377,function(_0x29e8d0){if(_0x29e8d0){console[_0x3260('0xd1')](_0x3260('0xd2'),_0x29e8d0);}else{fs['unlinkSync'](_0x2fea08);}});});});}else{return _0x1f8332[_0x3260('0x1d')](0xc8);}})[_0x3260('0x35')](handleError(_0x1f8332,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 9551084..17fd2c5 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 _0x814b=['then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove'];(function(_0x928e86,_0xccddea){var _0xc51cd5=function(_0x5c86b4){while(--_0x5c86b4){_0x928e86['push'](_0x928e86['shift']());}};_0xc51cd5(++_0xccddea);}(_0x814b,0x1a2));var _0xb814=function(_0x3782f1,_0xdb9da7){_0x3782f1=_0x3782f1-0x0;var _0x59aa2c=_0x814b[_0x3782f1];return _0x59aa2c;};'use strict';var EventEmitter=require(_0xb814('0x0'));var FaxInteraction=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var FaxMessage=require(_0xb814('0x1'))['db'][_0xb814('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb814('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb814('0x5'),'afterDestroy':_0xb814('0x6')};function emitEvent(_0x258866){return function(_0x4237bc,_0x44931c,_0x322a70){_0x4237bc['getUsers']({'attributes':['id'],'raw':!![]})[_0xb814('0x7')](function(_0x2e6272){_0x4237bc['setDataValue'](_0xb814('0x8'),_0x2e6272[_0xb814('0x9')](function(_0x186d5a){return{'id':_0x186d5a['id']};}));return FaxMessage[_0xb814('0xa')]({'where':{'FaxInteractionId':_0x4237bc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb814('0x7')](function(_0x21d4a5){_0x4237bc[_0xb814('0xb')](_0xb814('0xc'),_0x21d4a5[_0xb814('0xd')]);FaxInteractionEvents[_0xb814('0xe')](_0x258866+':'+_0x4237bc['id'],_0x4237bc);FaxInteractionEvents[_0xb814('0xe')](_0x258866,_0x4237bc);_0x322a70(null);})['catch'](_0x322a70(null));};}for(var e in events){if(events[_0xb814('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xb814('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x7a54=['setDataValue','map','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x386139,_0x89a0a3){var _0x296cbe=function(_0x2de7fe){while(--_0x2de7fe){_0x386139['push'](_0x386139['shift']());}};_0x296cbe(++_0x89a0a3);}(_0x7a54,0x106));var _0x47a5=function(_0x236cdf,_0x211526){_0x236cdf=_0x236cdf-0x0;var _0x8c8fcb=_0x7a54[_0x236cdf];return _0x8c8fcb;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var FaxInteraction=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x47a5('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x47a5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47a5('0x5'),'afterDestroy':_0x47a5('0x6')};function emitEvent(_0x2a1a7e){return function(_0x3717e1,_0xfdf934,_0x545a97){_0x3717e1[_0x47a5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x343372){_0x3717e1[_0x47a5('0x8')]('Users',_0x343372[_0x47a5('0x9')](function(_0x5077f3){return{'id':_0x5077f3['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3717e1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a0e98){_0x3717e1[_0x47a5('0x8')]('unreadMessages',_0x2a0e98[_0x47a5('0xa')]);FaxInteractionEvents['emit'](_0x2a1a7e+':'+_0x3717e1['id'],_0x3717e1);FaxInteractionEvents['emit'](_0x2a1a7e,_0x3717e1);_0x545a97(null);})[_0x47a5('0xb')](_0x545a97(null));};}for(var e in events){if(events[_0x47a5('0xc')](e)){var event=events[e];FaxInteraction[_0x47a5('0xd')](e,emitEvent(event));}}module[_0x47a5('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index f854ba6..cbf3f4f 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 _0xe347=['closedAt','format','util','../../config/logger','api','moment','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed'];(function(_0x46c670,_0x2e4719){var _0x51180e=function(_0x37640c){while(--_0x37640c){_0x46c670['push'](_0x46c670['shift']());}};_0x51180e(++_0x2e4719);}(_0xe347,0x8e));var _0x7e34=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0xe347[_0x325501];return _0x2c1626;};'use strict';var _=require('lodash');var util=require(_0x7e34('0x0'));var logger=require(_0x7e34('0x1'))(_0x7e34('0x2'));var moment=require(_0x7e34('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7e34('0x4'));var config=require(_0x7e34('0x5'));var attributes=require(_0x7e34('0x6'));module[_0x7e34('0x7')]=function(_0x24687e,_0x1bacb3){return _0x24687e[_0x7e34('0x8')]('FaxInteraction',attributes,{'tableName':_0x7e34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2938a6,_0x12da7e,_0x4d6fba){if(_0x2938a6[_0x7e34('0xa')](_0x7e34('0xb'))){_0x2938a6[_0x7e34('0xc')]=moment()[_0x7e34('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4d6fba(null,_0x2938a6);}}});}; \ No newline at end of file +var _0xaf8e=['define','FaxInteraction','fax_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','moment','bluebird','path','rimraf','./faxInteraction.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xaf8e,0x13e));var _0xeaf8=function(_0x47fade,_0x4e19fc){_0x47fade=_0x47fade-0x0;var _0x54995a=_0xaf8e[_0x47fade];return _0x54995a;};'use strict';var _=require(_0xeaf8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xeaf8('0x1'));var BPromise=require(_0xeaf8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeaf8('0x3'));var rimraf=require(_0xeaf8('0x4'));var config=require('../../config/environment');var attributes=require(_0xeaf8('0x5'));module[_0xeaf8('0x6')]=function(_0x52d3b6,_0x50a9a3){return _0x52d3b6[_0xeaf8('0x7')](_0xeaf8('0x8'),attributes,{'tableName':_0xeaf8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4bf9b0,_0x3ecda7,_0x5802a3){if(_0x4bf9b0['changed'](_0xeaf8('0xa'))){_0x4bf9b0['closedAt']=moment()[_0xeaf8('0xb')](_0xeaf8('0xc'));}_0x5802a3(null,_0x4bf9b0);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index dbbd545..255da53 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 _0x8f22=['limit','catch','AddTagsToFaxInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','info','result','UpdateFaxInteraction','FaxInteraction','update','body','options','where'];(function(_0x5c9437,_0x4b0d17){var _0x3169d3=function(_0x3f8802){while(--_0x3f8802){_0x5c9437['push'](_0x5c9437['shift']());}};_0x3169d3(++_0x4b0d17);}(_0x8f22,0xaa));var _0x28f2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f22[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x28f2('0x0'));var util=require(_0x28f2('0x1'));var moment=require(_0x28f2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28f2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x28f2('0x4'));var logger=require(_0x28f2('0x5'))(_0x28f2('0x6'));var config=require(_0x28f2('0x7'));var jayson=require(_0x28f2('0x8'));var client=jayson[_0x28f2('0x9')][_0x28f2('0xa')]({'port':0x232a});config[_0x28f2('0xb')]=_[_0x28f2('0xc')](config[_0x28f2('0xb')],{'host':_0x28f2('0xd'),'port':0x18eb});var socket=require(_0x28f2('0xe'))(new Redis(config[_0x28f2('0xb')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x458c9d,_0x334fa3,_0x369fab){return new BPromise(function(_0x4a41f3,_0x3a14cd){return client['request'](_0x458c9d,_0x369fab)['then'](function(_0x32f3f2){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x334fa3,_0x28f2('0xf'));logger[_0x28f2('0x10')](_0x28f2('0x11'),_0x334fa3,'request\x20sent',JSON[_0x28f2('0x12')](_0x32f3f2));if(_0x32f3f2[_0x28f2('0x13')]){if(_0x32f3f2[_0x28f2('0x13')]['code']===0x1f4){logger['error'](_0x28f2('0x14'),_0x334fa3,_0x32f3f2['error'][_0x28f2('0x15')]);return _0x3a14cd(_0x32f3f2[_0x28f2('0x13')][_0x28f2('0x15')]);}logger[_0x28f2('0x13')](_0x28f2('0x14'),_0x334fa3,_0x32f3f2[_0x28f2('0x13')]['message']);return _0x4a41f3(_0x32f3f2[_0x28f2('0x13')]['message']);}else{logger[_0x28f2('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x334fa3,_0x28f2('0xf'));_0x4a41f3(_0x32f3f2[_0x28f2('0x17')]['message']);}})['catch'](function(_0x195902){logger[_0x28f2('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x334fa3,_0x195902);_0x3a14cd(_0x195902);});});}exports[_0x28f2('0x18')]=function(_0x627cbd){var _0x128ccc=this;return new Promise(function(_0x438740,_0x267347){return db[_0x28f2('0x19')][_0x28f2('0x1a')](_0x627cbd[_0x28f2('0x1b')],{'raw':_0x627cbd[_0x28f2('0x1c')]?_0x627cbd[_0x28f2('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x627cbd[_0x28f2('0x1c')]?_0x627cbd[_0x28f2('0x1c')][_0x28f2('0x1d')]||null:null,'attributes':_0x627cbd['options']?_0x627cbd['options']['attributes']||null:null,'limit':_0x627cbd[_0x28f2('0x1c')]?_0x627cbd[_0x28f2('0x1c')][_0x28f2('0x1e')]||null:null})['then'](function(_0x6dce66){logger[_0x28f2('0x16')](_0x28f2('0x18'),_0x627cbd);logger['debug'](_0x28f2('0x18'),_0x627cbd,JSON[_0x28f2('0x12')](_0x6dce66));_0x438740(_0x6dce66);})[_0x28f2('0x1f')](function(_0x2e5cce){logger[_0x28f2('0x13')](_0x28f2('0x18'),_0x2e5cce['message'],_0x627cbd);_0x267347(_0x128ccc[_0x28f2('0x13')](0x1f4,_0x2e5cce[_0x28f2('0x15')]));});});};exports[_0x28f2('0x20')]=function(_0x1af2a1){return new Promise(function(_0x284242,_0x5dd60a){return db[_0x28f2('0x19')][_0x28f2('0x21')]({'where':_0x1af2a1[_0x28f2('0x1c')]?_0x1af2a1[_0x28f2('0x1c')][_0x28f2('0x1d')]||null:null})[_0x28f2('0x22')](function(_0x563ba7){if(_0x563ba7){return _0x563ba7[_0x28f2('0x23')](_0x1af2a1[_0x28f2('0x1b')][_0x28f2('0x24')],_[_0x28f2('0x25')](_0x1af2a1[_0x28f2('0x1b')],[_0x28f2('0x24'),'id'])||{});}})[_0x28f2('0x26')](function(_0xbc71ba){logger['info']('AddTags',_0x1af2a1);logger[_0x28f2('0x10')]('AddTags',_0x1af2a1,JSON[_0x28f2('0x12')](_0xbc71ba));_0x284242(_0xbc71ba);})[_0x28f2('0x1f')](function(_0x150fd1){logger[_0x28f2('0x13')](_0x28f2('0x27'),_0x150fd1[_0x28f2('0x15')],_0x1af2a1);_0x5dd60a(_this['error'](0x1f4,_0x150fd1[_0x28f2('0x15')]));});});}; \ No newline at end of file +var _0xf7b1=['then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0xf7b1,0xf1));var _0x1f7b=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xf7b1[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x1f7b('0x0'));var util=require(_0x1f7b('0x1'));var moment=require(_0x1f7b('0x2'));var BPromise=require(_0x1f7b('0x3'));var rs=require(_0x1f7b('0x4'));var fs=require('fs');var Redis=require(_0x1f7b('0x5'));var db=require(_0x1f7b('0x6'))['db'];var utils=require(_0x1f7b('0x7'));var logger=require(_0x1f7b('0x8'))('rpc');var config=require(_0x1f7b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1f7b('0xa')]({'port':0x232a});config['redis']=_[_0x1f7b('0xb')](config[_0x1f7b('0xc')],{'host':_0x1f7b('0xd'),'port':0x18eb});var socket=require(_0x1f7b('0xe'))(new Redis(config['redis']));require(_0x1f7b('0xf'))[_0x1f7b('0x10')](socket);function respondWithRpcPromise(_0x330b3c,_0x33bb73,_0x4d5873){return new BPromise(function(_0x51d8ea,_0x3cef97){return client['request'](_0x330b3c,_0x4d5873)[_0x1f7b('0x11')](function(_0x1783bf){logger['info'](_0x1f7b('0x12'),_0x33bb73,'request\x20sent');logger[_0x1f7b('0x13')](_0x1f7b('0x14'),_0x33bb73,_0x1f7b('0x15'),JSON[_0x1f7b('0x16')](_0x1783bf));if(_0x1783bf['error']){if(_0x1783bf[_0x1f7b('0x17')][_0x1f7b('0x18')]===0x1f4){logger[_0x1f7b('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x33bb73,_0x1783bf[_0x1f7b('0x17')][_0x1f7b('0x19')]);return _0x3cef97(_0x1783bf[_0x1f7b('0x17')][_0x1f7b('0x19')]);}logger[_0x1f7b('0x17')](_0x1f7b('0x12'),_0x33bb73,_0x1783bf['error']['message']);return _0x51d8ea(_0x1783bf['error'][_0x1f7b('0x19')]);}else{logger[_0x1f7b('0x1a')](_0x1f7b('0x12'),_0x33bb73,_0x1f7b('0x15'));_0x51d8ea(_0x1783bf['result'][_0x1f7b('0x19')]);}})['catch'](function(_0x402f62){logger[_0x1f7b('0x17')](_0x1f7b('0x12'),_0x33bb73,_0x402f62);_0x3cef97(_0x402f62);});});}exports[_0x1f7b('0x1b')]=function(_0x4bc9a7){var _0x1bb81d=this;return new Promise(function(_0x47b782,_0x176309){return db[_0x1f7b('0x1c')][_0x1f7b('0x1d')](_0x4bc9a7[_0x1f7b('0x1e')],{'raw':_0x4bc9a7[_0x1f7b('0x1f')]?_0x4bc9a7[_0x1f7b('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bc9a7[_0x1f7b('0x1f')]?_0x4bc9a7[_0x1f7b('0x1f')][_0x1f7b('0x20')]||null:null,'attributes':_0x4bc9a7[_0x1f7b('0x1f')]?_0x4bc9a7['options'][_0x1f7b('0x21')]||null:null,'limit':_0x4bc9a7[_0x1f7b('0x1f')]?_0x4bc9a7[_0x1f7b('0x1f')][_0x1f7b('0x22')]||null:null})[_0x1f7b('0x11')](function(_0x2340df){logger['info'](_0x1f7b('0x1b'),_0x4bc9a7);logger[_0x1f7b('0x13')](_0x1f7b('0x1b'),_0x4bc9a7,JSON[_0x1f7b('0x16')](_0x2340df));_0x47b782(_0x2340df);})[_0x1f7b('0x23')](function(_0x5ea44b){logger['error'](_0x1f7b('0x1b'),_0x5ea44b[_0x1f7b('0x19')],_0x4bc9a7);_0x176309(_0x1bb81d[_0x1f7b('0x17')](0x1f4,_0x5ea44b[_0x1f7b('0x19')]));});});};exports[_0x1f7b('0x24')]=function(_0x1156e2){return new Promise(function(_0x56f973,_0x1d16c5){return db[_0x1f7b('0x1c')][_0x1f7b('0x25')]({'where':_0x1156e2[_0x1f7b('0x1f')]?_0x1156e2[_0x1f7b('0x1f')][_0x1f7b('0x20')]||null:null})['then'](function(_0x198d26){if(_0x198d26){return _0x198d26[_0x1f7b('0x26')](_0x1156e2[_0x1f7b('0x1e')][_0x1f7b('0x27')],_[_0x1f7b('0x28')](_0x1156e2['body'],[_0x1f7b('0x27'),'id'])||{});}})[_0x1f7b('0x29')](function(_0x210ee3){logger[_0x1f7b('0x1a')](_0x1f7b('0x2a'),_0x1156e2);logger[_0x1f7b('0x13')](_0x1f7b('0x2a'),_0x1156e2,JSON[_0x1f7b('0x16')](_0x210ee3));_0x56f973(_0x210ee3);})[_0x1f7b('0x23')](function(_0x3259c5){logger[_0x1f7b('0x17')]('AddTags',_0x3259c5['message'],_0x1156e2);_0x1d16c5(_this[_0x1f7b('0x17')](0x1f4,_0x3259c5[_0x1f7b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d742552..4da24a8 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 _0x2e87=['remove','update','removeListener','register','length','faxInteraction:','save'];(function(_0x4004ae,_0x48ad92){var _0x3bbc4c=function(_0x33aeae){while(--_0x33aeae){_0x4004ae['push'](_0x4004ae['shift']());}};_0x3bbc4c(++_0x48ad92);}(_0x2e87,0xed));var _0x72e8=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0x2e87[_0x4d2263];return _0x24aba0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x72e8('0x0'),_0x72e8('0x1'),_0x72e8('0x2')];function createListener(_0x58a6a7,_0x376699){return function(_0x50d781){_0x376699['emit'](_0x58a6a7,_0x50d781);};}function removeListener(_0x1a17ff,_0xc5178){return function(){FaxInteractionEvents[_0x72e8('0x3')](_0x1a17ff,_0xc5178);};}exports[_0x72e8('0x4')]=function(_0x2f0eb8){for(var _0x530af2=0x0,_0x2cb45f=events[_0x72e8('0x5')];_0x530af2<_0x2cb45f;_0x530af2++){var _0x4b6094=events[_0x530af2];var _0x2d065e=createListener(_0x72e8('0x6')+_0x4b6094,_0x2f0eb8);FaxInteractionEvents['on'](_0x4b6094,_0x2d065e);}}; \ No newline at end of file +var _0xb405=['./faxInteraction.events','save','remove','update','removeListener','register','faxInteraction:'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0xb405,0xd2));var _0x5b40=function(_0xad266d,_0x418c03){_0xad266d=_0xad266d-0x0;var _0xc16f7a=_0xb405[_0xad266d];return _0xc16f7a;};'use strict';var FaxInteractionEvents=require(_0x5b40('0x0'));var events=[_0x5b40('0x1'),_0x5b40('0x2'),_0x5b40('0x3')];function createListener(_0x2d9254,_0x417dfc){return function(_0x224510){_0x417dfc['emit'](_0x2d9254,_0x224510);};}function removeListener(_0x255dca,_0x556b03){return function(){FaxInteractionEvents[_0x5b40('0x4')](_0x255dca,_0x556b03);};}exports[_0x5b40('0x5')]=function(_0x17826c){for(var _0x42f7c4=0x0,_0x788e89=events['length'];_0x42f7c4<_0x788e89;_0x42f7c4++){var _0x558e93=events[_0x42f7c4];var _0x40fd2f=createListener(_0x5b40('0x6')+_0x558e93,_0x17826c);FaxInteractionEvents['on'](_0x558e93,_0x40fd2f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index c23205f..90ef71e 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 _0xb9cf=['./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','/:id','fax','faxinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x274ba3,_0x43e5fb){var _0x18afc5=function(_0x159ae2){while(--_0x159ae2){_0x274ba3['push'](_0x274ba3['shift']());}};_0x18afc5(++_0x43e5fb);}(_0xb9cf,0x93));var _0xfb9c=function(_0x59e515,_0xd2f90e){_0x59e515=_0x59e515-0x0;var _0x5ecabf=_0xb9cf[_0x59e515];return _0x5ecabf;};'use strict';var multer=require(_0xfb9c('0x0'));var util=require(_0xfb9c('0x1'));var path=require(_0xfb9c('0x2'));var timeout=require(_0xfb9c('0x3'));var express=require(_0xfb9c('0x4'));var router=express['Router']();var auth=require(_0xfb9c('0x5'));var interaction=require(_0xfb9c('0x6'));var config=require(_0xfb9c('0x7'));var controller=require(_0xfb9c('0x8'));router[_0xfb9c('0x9')]('/',auth[_0xfb9c('0xa')](),controller[_0xfb9c('0xb')]);router[_0xfb9c('0x9')](_0xfb9c('0xc'),auth[_0xfb9c('0xa')](),controller[_0xfb9c('0xd')]);router[_0xfb9c('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfb9c('0x9')](_0xfb9c('0xe'),auth[_0xfb9c('0xa')](),controller[_0xfb9c('0xf')]);router[_0xfb9c('0x9')]('/:id/download',auth[_0xfb9c('0xa')](),controller[_0xfb9c('0x10')]);router[_0xfb9c('0x11')]('/',auth[_0xfb9c('0xa')](),controller['create']);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xfb9c('0x12')]);router[_0xfb9c('0x11')](_0xfb9c('0x13'),auth[_0xfb9c('0xa')](),interaction[_0xfb9c('0x14')]('fax',_0xfb9c('0x15')),controller[_0xfb9c('0x16')]);router[_0xfb9c('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0xfb9c('0x14')]('fax',_0xfb9c('0x18')),controller['update']);router[_0xfb9c('0x19')](_0xfb9c('0x1a'),auth[_0xfb9c('0xa')](),interaction[_0xfb9c('0x14')](_0xfb9c('0x1b'),_0xfb9c('0x1c')),controller[_0xfb9c('0x1d')]);router[_0xfb9c('0x19')]('/:id/tags',auth[_0xfb9c('0xa')](),controller[_0xfb9c('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x6836=['/:id/tags','tracked','faxinteraction:addtags','addTags','faxinteraction:update','delete','/:id','fax','faxinteraction:destroy','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','show','getMessages','post','create','addMessage'];(function(_0x49aa7d,_0x5d46d8){var _0xdd0d26=function(_0x159df7){while(--_0x159df7){_0x49aa7d['push'](_0x49aa7d['shift']());}};_0xdd0d26(++_0x5d46d8);}(_0x6836,0x133));var _0x6683=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x6836[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x6683('0x0'));var util=require(_0x6683('0x1'));var path=require('path');var timeout=require(_0x6683('0x2'));var express=require(_0x6683('0x3'));var router=express[_0x6683('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6683('0x5'));var config=require(_0x6683('0x6'));var controller=require(_0x6683('0x7'));router[_0x6683('0x8')]('/',auth[_0x6683('0x9')](),controller['index']);router['get'](_0x6683('0xa'),auth[_0x6683('0x9')](),controller[_0x6683('0xb')]);router['get']('/:id',auth[_0x6683('0x9')](),controller[_0x6683('0xc')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x6683('0xd')]);router[_0x6683('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x6683('0xe')]('/',auth[_0x6683('0x9')](),controller[_0x6683('0xf')]);router['post']('/:id/messages',auth[_0x6683('0x9')](),controller[_0x6683('0x10')]);router['post'](_0x6683('0x11'),auth[_0x6683('0x9')](),interaction[_0x6683('0x12')]('fax',_0x6683('0x13')),controller[_0x6683('0x14')]);router['put']('/:id',auth[_0x6683('0x9')](),interaction[_0x6683('0x12')]('fax',_0x6683('0x15')),controller['update']);router[_0x6683('0x16')](_0x6683('0x17'),auth[_0x6683('0x9')](),interaction[_0x6683('0x12')](_0x6683('0x18'),_0x6683('0x19')),controller[_0x6683('0x1a')]);router[_0x6683('0x16')](_0x6683('0x11'),auth[_0x6683('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 1c32bf5..4a0feb1 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 _0xdfa8=['TEXT','DATE','sequelize','exports','out'];(function(_0x4376e8,_0x4c5069){var _0x3a0123=function(_0x63cbec){while(--_0x63cbec){_0x4376e8['push'](_0x4376e8['shift']());}};_0x3a0123(++_0x4c5069);}(_0xdfa8,0x7f));var _0x8dfa=function(_0x2b9cd9,_0x5627ac){_0x2b9cd9=_0x2b9cd9-0x0;var _0x3b4f60=_0xdfa8[_0x2b9cd9];return _0x3b4f60;};'use strict';var Sequelize=require(_0x8dfa('0x0'));module[_0x8dfa('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8dfa('0x2')),'defaultValue':_0x8dfa('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8dfa('0x3')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8dfa('0x4')]}}; \ No newline at end of file +var _0x82c8=['medium','BOOLEAN','out','DATE','sequelize','exports','TEXT'];(function(_0x151684,_0x48b8a6){var _0x1e2bd6=function(_0x15de30){while(--_0x15de30){_0x151684['push'](_0x151684['shift']());}};_0x1e2bd6(++_0x48b8a6);}(_0x82c8,0x97));var _0x882c=function(_0x11979c,_0x59bcbf){_0x11979c=_0x11979c-0x0;var _0x3fab8f=_0x82c8[_0x11979c];return _0x3fab8f;};'use strict';var Sequelize=require(_0x882c('0x0'));module[_0x882c('0x1')]={'body':{'type':Sequelize[_0x882c('0x2')](_0x882c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x882c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x882c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x882c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x882c('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 612e5fc..f61a905 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file +var _0xb10b=['read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','EventManager','acceptmessage','fax','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','update','stack','name','send','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','body','destroy','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','FaxInteraction','isNil'];(function(_0x16bcf6,_0x150318){var _0x52360f=function(_0x2d8204){while(--_0x2d8204){_0x16bcf6['push'](_0x16bcf6['shift']());}};_0x52360f(++_0x150318);}(_0xb10b,0x12a));var _0xbb10=function(_0x499227,_0x3a8c2c){_0x499227=_0x499227-0x0;var _0xec1c0a=_0xb10b[_0x499227];return _0xec1c0a;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./faxMessage.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x24a57b,_0x36b5e8,_0x3e26f4){if(_0x3e26f4){var _0x2b184e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b184e['test'](_0x36b5e8)){return _0x24a57b;}else{throw new db[(_0xbb10('0x20'))][(_0xbb10('0x21'))](_0xbb10('0x22'));}}else{return _0x24a57b;}}function respondWithRpcPromise(_0x42db98,_0x378da8,_0x1682a4,_0x575cca){return new BPromise(function(_0x30efc6,_0xbf2906){var _0xe1c665=_0x575cca||client;return _0xe1c665['request'](_0x42db98,_0x1682a4)[_0xbb10('0x23')](function(_0x19f48d){logger[_0xbb10('0x24')](_0xbb10('0x25'),_0x378da8,_0xbb10('0x26'));logger[_0xbb10('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'),JSON[_0xbb10('0x28')](_0x19f48d));if(_0x19f48d['error']){if(_0x19f48d['error'][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0xbf2906(_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x30efc6(_0x19f48d[_0xbb10('0x2a')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'));_0x30efc6(_0x19f48d[_0xbb10('0x2c')][_0xbb10('0x2b')]);}})['catch'](function(_0x2fdde9){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x2fdde9);_0xbf2906(_0x2fdde9);});});}function respondWithStatusCode(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xcc;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9);}return _0x1d5e95['status'](_0x1acce9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x21ac54,_0xfc3595){_0xfc3595=_0xfc3595||0xc8;return function(_0x2e0249){if(_0x2e0249){return _0x21ac54[_0xbb10('0x2f')](_0xfc3595)[_0xbb10('0x30')](_0x2e0249);}};}function respondWithFilteredResult(_0x5d5c80,_0x221624){return function(_0x4ee02e){if(_0x4ee02e){var _0x448d5c=_0x4ee02e[_0xbb10('0x31')],_0x56f2da=_0x221624['offset'],_0x16ad2a=_0x221624['offset']+_0x221624[_0xbb10('0x32')],_0x1dcc9c;if(_0x16ad2a>=_0x448d5c){_0x16ad2a=_0x448d5c;_0x1dcc9c=0xc8;}else{_0x1dcc9c=0xce;}_0x5d5c80[_0xbb10('0x2f')](_0x1dcc9c);return _0x5d5c80['set'](_0xbb10('0x33'),_0x56f2da+'-'+_0x16ad2a+'/'+_0x448d5c)[_0xbb10('0x30')](_0x4ee02e);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x23')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x23')](function(){_0x188cbd[_0xbb10('0x2f')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x2a')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}exports[_0xbb10('0x3a')]=function(_0x52de31,_0x5e3fbd){var _0x5cd55f={},_0x31bee3={},_0x2b0b45={'count':0x0,'rows':[]};var _0x2b658a=_['map'](db[_0xbb10('0x3b')][_0xbb10('0x3c')],function(_0x4345f3){return{'name':_0x4345f3['fieldName'],'type':_0x4345f3[_0xbb10('0x3d')][_0xbb10('0x3e')]};});_0x31bee3[_0xbb10('0x3f')]=_[_0xbb10('0x40')](_0x2b658a,'name');_0x31bee3[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x52de31['query']);_0x31bee3[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x31bee3[_0xbb10('0x3f')],_0x31bee3[_0xbb10('0x41')]);_0x5cd55f[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x31bee3['model'],qs[_0xbb10('0x46')](_0x52de31[_0xbb10('0x41')][_0xbb10('0x46')]));_0x5cd55f[_0xbb10('0x45')]=_0x5cd55f['attributes'][_0xbb10('0x47')]?_0x5cd55f[_0xbb10('0x45')]:_0x31bee3[_0xbb10('0x3f')];if(!_0x52de31[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x5cd55f[_0xbb10('0x32')]=qs['limit'](_0x52de31['query'][_0xbb10('0x32')]);_0x5cd55f['offset']=qs[_0xbb10('0x49')](_0x52de31[_0xbb10('0x41')]['offset']);}_0x5cd55f[_0xbb10('0x4a')]=qs[_0xbb10('0x4b')](_0x52de31[_0xbb10('0x41')]['sort']);_0x5cd55f[_0xbb10('0x4c')]=qs[_0xbb10('0x43')](_[_0xbb10('0x4d')](_0x52de31[_0xbb10('0x41')],_0x31bee3[_0xbb10('0x43')]));if(_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]){_0x5cd55f[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x5cd55f[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x40')](_0x2b658a,function(_0x1eadd2){if(_0x1eadd2['type']!==_0xbb10('0x50')){var _0x41bbf8={};_0x41bbf8[_0x1eadd2['name']]={'$like':'%'+_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]+'%'};return _0x41bbf8;}})});}_0x5cd55f=_[_0xbb10('0x4f')]({},_0x5cd55f,_0x52de31[_0xbb10('0x51')]);var _0x41ea91={'where':_0x5cd55f[_0xbb10('0x4c')]};return db[_0xbb10('0x3b')]['count'](_0x41ea91)['then'](function(_0xcb3354){_0x2b0b45[_0xbb10('0x31')]=_0xcb3354;if(_0x52de31[_0xbb10('0x41')]['includeAll']){_0x5cd55f['include']=[{'all':!![]}];}return db[_0xbb10('0x3b')][_0xbb10('0x52')](_0x5cd55f);})[_0xbb10('0x23')](function(_0xf820fe){_0x2b0b45[_0xbb10('0x53')]=_0xf820fe;return _0x2b0b45;})[_0xbb10('0x23')](respondWithFilteredResult(_0x5e3fbd,_0x5cd55f))[_0xbb10('0x54')](handleError(_0x5e3fbd,null));};exports[_0xbb10('0x55')]=function(_0x2626d8,_0x3d7e7e){var _0x550111={'raw':!![],'where':{'id':_0x2626d8[_0xbb10('0x56')]['id']}},_0x5eafac={};_0x5eafac[_0xbb10('0x3f')]=_[_0xbb10('0x42')](db[_0xbb10('0x3b')][_0xbb10('0x3c')]);_0x5eafac[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x2626d8[_0xbb10('0x41')]);_0x5eafac[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],_0x5eafac[_0xbb10('0x41')]);_0x550111[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],qs['fields'](_0x2626d8[_0xbb10('0x41')]['fields']));_0x550111[_0xbb10('0x45')]=_0x550111[_0xbb10('0x45')][_0xbb10('0x47')]?_0x550111[_0xbb10('0x45')]:_0x5eafac[_0xbb10('0x3f')];if(_0x2626d8[_0xbb10('0x41')][_0xbb10('0x57')]){_0x550111[_0xbb10('0x58')]=[{'all':!![]}];}_0x550111=_[_0xbb10('0x4f')]({},_0x550111,_0x2626d8[_0xbb10('0x51')]);return db[_0xbb10('0x3b')][_0xbb10('0x59')](_0x550111)[_0xbb10('0x23')](handleEntityNotFound(_0x3d7e7e,null))[_0xbb10('0x23')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x54')](handleError(_0x3d7e7e,null));};exports['update']=function(_0x4571b6,_0x466eb7){if(_0x4571b6[_0xbb10('0x5a')]['id']){delete _0x4571b6[_0xbb10('0x5a')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x4571b6['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x466eb7,null))[_0xbb10('0x23')](saveUpdates(_0x4571b6[_0xbb10('0x5a')],null))[_0xbb10('0x23')](respondWithResult(_0x466eb7,null))[_0xbb10('0x54')](handleError(_0x466eb7,null));};exports[_0xbb10('0x5b')]=function(_0x175872,_0x12ec18){return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x175872[_0xbb10('0x56')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x23')](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['describe']=function(_0x16272d,_0x3e6338){return db[_0xbb10('0x3b')][_0xbb10('0x5c')]()['then'](respondWithResult(_0x3e6338,null))['catch'](handleError(_0x3e6338,null));};var interaction_log=require(_0xbb10('0x15'))(_0xbb10('0x5d'));exports[_0xbb10('0x5e')]=function(_0x2dd150,_0x412f13,_0x3e9753){var _0x45c0dc={'channel':'fax'};if(_0x2dd150[_0xbb10('0x5a')]['id']){delete _0x2dd150[_0xbb10('0x5a')]['id'];}_0x2dd150['body']['read']=!![];_0x2dd150['body'][_0xbb10('0x5f')]=moment()[_0xbb10('0x60')](_0xbb10('0x61'));_0x2dd150['body']['UserId']=_0x2dd150['body'][_0xbb10('0x62')]||_0x2dd150[_0xbb10('0x63')]['id'];return db[_0xbb10('0x3b')]['find']({'where':{'id':_0x2dd150[_0xbb10('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xbb10('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](saveUpdates(_0x2dd150[_0xbb10('0x5a')],null))[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x45c0dc['message']=_0x237246[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x237246['FaxInteractionId']}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](function(_0x3e3617){if(_0x3e3617){return _0x3e3617['update']({'UserId':_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x62')],'read1stAt':_[_0xbb10('0x67')](_0x3e3617[_0xbb10('0x68')])?moment()['format'](_0xbb10('0x61')):undefined});}return null;})[_0xbb10('0x23')](function(_0x108e5b){if(_0x108e5b){_0x45c0dc[_0xbb10('0x69')]=_0x108e5b['get']({'plain':!![]});interaction_log[_0xbb10('0x24')](_0xbb10('0x6a'),_0x2dd150[_0xbb10('0x63')]['id'],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x6b')],_0x45c0dc['interaction']['id'],_0x2dd150['body']?JSON['stringify'](_0x2dd150[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x6d'),'acceptMessage',_0x45c0dc);}return null;})['then'](function(_0x46f462){if(_0x46f462){if(_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x6e')]){_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')]);_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x45c0dc[_0xbb10('0x70')];_0x45c0dc['message']['event']='accept';return respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':_0xbb10('0x72'),'message':_0x45c0dc[_0xbb10('0x2b')]},client9002)[_0xbb10('0x23')](function(){return _0x45c0dc;});}return _0x45c0dc;}return null;})[_0xbb10('0x23')](respondWithResult(_0x412f13,null))['catch'](handleError(_0x412f13,null));};var interaction_log=require(_0xbb10('0x15'))('fax-interactions');exports['reject']=function(_0x519a54,_0xdf634f,_0x13040d){var _0x23b1d5={'agent':{},'channel':_0xbb10('0x73')};if(_0x519a54['body']['id']){delete _0x519a54[_0xbb10('0x5a')]['id'];}_0x519a54['body']['UserId']=_0x519a54[_0xbb10('0x5a')][_0xbb10('0x62')]||_0x519a54[_0xbb10('0x63')]['id'];_0x23b1d5[_0xbb10('0x74')]['id']=_0x519a54[_0xbb10('0x5a')]['UserId'];return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x519a54[_0xbb10('0x56')]['id'],'UserId':null}})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x27f42f){if(_0x27f42f){_0x23b1d5[_0xbb10('0x2b')]=_0x27f42f['get']({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x27f42f[_0xbb10('0x75')]}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x172be3){if(_0x172be3){_0x23b1d5[_0xbb10('0x69')]=_0x172be3[_0xbb10('0x65')]({'plain':!![]});interaction_log['info'](_0xbb10('0x76'),_0x519a54[_0xbb10('0x63')]['id'],_0x519a54[_0xbb10('0x63')]['name'],_0x519a54['user']['role'],_0x23b1d5[_0xbb10('0x69')]['id'],_0x519a54['body']?JSON['stringify'](_0x519a54[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x77'),_0xbb10('0x78'),_0x23b1d5);}return null;})[_0xbb10('0x23')](function(_0x24dca6){if(_0x24dca6){_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x519a54[_0xbb10('0x63')][_0xbb10('0x38')]);_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x23b1d5['channel'];_0x24dca6['message'][_0xbb10('0x79')]=_0xbb10('0x35');respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':'rejectmessage','message':_0x24dca6[_0xbb10('0x2b')]},client9002);return _0x23b1d5;}return null;})[_0xbb10('0x23')](respondWithResult(_0xdf634f,null))[_0xbb10('0x54')](handleError(_0xdf634f,null));};exports[_0xbb10('0x7a')]=function(_0x35c1e8,_0x517185){var _0x5f0691;return db[_0xbb10('0x3b')][_0xbb10('0x7a')](_0x35c1e8[_0xbb10('0x5a')],{})['then'](function(_0x256b35){_0x5f0691=_0x256b35;return db[_0xbb10('0x64')]['findOne']({'where':{'id':_0x5f0691['ContactId']}});})[_0xbb10('0x23')](function(_0x26d0dd){if(_[_0xbb10('0x67')](_0x26d0dd)){return;}else{_0x5f0691['fax']=_0x26d0dd[_0xbb10('0x73')];return db[_0xbb10('0x7b')][_0xbb10('0x7c')]({'where':{'id':_0x5f0691[_0xbb10('0x7d')]}});}})[_0xbb10('0x23')](function(_0x5de006){return respondWithRpcPromise(_0xbb10('0x7e'),_0xbb10('0x7e'),{'FaxAccountId':_[_0xbb10('0x67')](_0x35c1e8['body'])?undefined:_0x35c1e8[_0xbb10('0x5a')][_0xbb10('0x7f')],'path':_[_0xbb10('0x67')](_0x5de006)?undefined:util[_0xbb10('0x60')](_0xbb10('0x80'),_0x5de006[_0xbb10('0x81')]),'fax':_[_0xbb10('0x67')](_0x5f0691[_0xbb10('0x73')])?undefined:_0x5f0691[_0xbb10('0x73')],'AttachmentId':_0x5f0691[_0xbb10('0x7d')]},client9002);})[_0xbb10('0x23')](respondWithResult(_0x517185,0xc9))[_0xbb10('0x54')](handleError(_0x517185,null));};exports['download']=function(_0x51f106,_0xe1fc51){var _0x3fa344=path[_0xbb10('0x82')](config[_0xbb10('0x83')],_0xbb10('0x84'),'files',_0xbb10('0x85'));return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x51f106[_0xbb10('0x56')]['id']},'include':[{'model':db[_0xbb10('0x7b')],'as':_0xbb10('0x7b')}]})['then'](handleEntityNotFound(_0xe1fc51,null))[_0xbb10('0x23')](function(_0x742e10){if(_0x742e10){return _0xe1fc51['download'](path[_0xbb10('0x82')](_0x3fa344,_0x742e10['Attachment'][_0xbb10('0x81')]));}})[_0xbb10('0x54')](handleError(_0xe1fc51,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index fd517a4..e1f6ac0 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x1e618a,_0x334183){var _0x419ef6=function(_0x446db4){while(--_0x446db4){_0x1e618a['push'](_0x1e618a['shift']());}};_0x419ef6(++_0x334183);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x7995('0x0'));var FaxMessage=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){FaxMessageEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);FaxMessageEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];FaxMessage[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x5fc3[_0x3e25c1];return _0x52e7f2;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var FaxMessage=require(_0x35fc('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){FaxMessageEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);FaxMessageEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 0fc28d9..9b67f3d 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 _0x3226=['bluebird','request-promise','rimraf','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4_unicode_ci','lodash','api'];(function(_0xcf1487,_0x7717be){var _0x4a9a04=function(_0x4e3995){while(--_0x4e3995){_0xcf1487['push'](_0xcf1487['shift']());}};_0x4a9a04(++_0x7717be);}(_0x3226,0x150));var _0x6322=function(_0x49cc29,_0x36121d){_0x49cc29=_0x49cc29-0x0;var _0x3b40e6=_0x3226[_0x49cc29];return _0x3b40e6;};'use strict';var _=require(_0x6322('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6322('0x1'));var moment=require('moment');var BPromise=require(_0x6322('0x2'));var rp=require(_0x6322('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6322('0x4'));var config=require('../../config/environment');var attributes=require(_0x6322('0x5'));module['exports']=function(_0x49f417,_0x54f69a){return _0x49f417[_0x6322('0x6')](_0x6322('0x7'),attributes,{'tableName':_0x6322('0x8'),'paranoid':![],'indexes':[{'name':_0x6322('0x9'),'fields':['body'],'type':_0x6322('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x371c9c,_0x5598e5,_0x32cf38){var _0x5bf61b=_0x49f417[_0x6322('0xb')];var _0x134c1c=_0x371c9c[_0x6322('0xc')]({'plain':!![]});if(_0x134c1c[_0x6322('0xd')][_0x6322('0xe')]()==='in'||_0x134c1c[_0x6322('0xd')][_0x6322('0xe')]()===_0x6322('0xf')&&!_0x134c1c['secret']&&!_[_0x6322('0x10')](_0x134c1c[_0x6322('0x11')])){_0x5bf61b[_0x6322('0x12')][_0x6322('0x13')]({'where':{'id':_0x134c1c[_0x6322('0x14')]}})[_0x6322('0x15')](function(_0x456bcc){if(_0x456bcc){_0x456bcc[_0x6322('0x16')]({'lastMsgAt':_0x134c1c['createdAt'],'lastMsgDirection':_0x134c1c[_0x6322('0xd')][_0x6322('0xe')]()});}})[_0x6322('0x17')](function(_0x3b30dc){console[_0x6322('0x18')](_0x3b30dc);});}_0x32cf38();}},'charset':'utf8mb4','collate':_0x6322('0x19')});}; \ No newline at end of file +var _0xcde1=['createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','models','get','direction','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update'];(function(_0x1c6367,_0x160cd9){var _0x508b27=function(_0x162fdc){while(--_0x162fdc){_0x1c6367['push'](_0x1c6367['shift']());}};_0x508b27(++_0x160cd9);}(_0xcde1,0x11c));var _0x1cde=function(_0x30d3eb,_0x4211e3){_0x30d3eb=_0x30d3eb-0x0;var _0xdc7879=_0xcde1[_0x30d3eb];return _0xdc7879;};'use strict';var _=require(_0x1cde('0x0'));var util=require(_0x1cde('0x1'));var logger=require(_0x1cde('0x2'))(_0x1cde('0x3'));var moment=require(_0x1cde('0x4'));var BPromise=require('bluebird');var rp=require(_0x1cde('0x5'));var fs=require('fs');var path=require(_0x1cde('0x6'));var rimraf=require(_0x1cde('0x7'));var config=require('../../config/environment');var attributes=require(_0x1cde('0x8'));module[_0x1cde('0x9')]=function(_0x3d878f,_0x5130fd){return _0x3d878f[_0x1cde('0xa')](_0x1cde('0xb'),attributes,{'tableName':_0x1cde('0xc'),'paranoid':![],'indexes':[{'name':_0x1cde('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35ef5f,_0x5f17c3,_0x3d5e49){var _0x31e107=_0x3d878f[_0x1cde('0xe')];var _0xda6b75=_0x35ef5f[_0x1cde('0xf')]({'plain':!![]});if(_0xda6b75[_0x1cde('0x10')]['toLowerCase']()==='in'||_0xda6b75[_0x1cde('0x10')]['toLowerCase']()==='out'&&!_0xda6b75['secret']&&!_[_0x1cde('0x11')](_0xda6b75[_0x1cde('0x12')])){_0x31e107[_0x1cde('0x13')][_0x1cde('0x14')]({'where':{'id':_0xda6b75[_0x1cde('0x15')]}})[_0x1cde('0x16')](function(_0x3bf54c){if(_0x3bf54c){_0x3bf54c[_0x1cde('0x17')]({'lastMsgAt':_0xda6b75[_0x1cde('0x18')],'lastMsgDirection':_0xda6b75[_0x1cde('0x10')]['toLowerCase']()});}})['catch'](function(_0x27b143){console[_0x1cde('0x19')](_0x27b143);});}_0x3d5e49();}},'charset':_0x1cde('0x1a'),'collate':_0x1cde('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ded2a36..7ec2e63 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 _0x7866=['where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','FaxMessage','create','options','raw','CreateFaxMessage','catch','UpdateFaxMessage','update'];(function(_0x50c2c6,_0x97b301){var _0x17fc75=function(_0x3253a4){while(--_0x3253a4){_0x50c2c6['push'](_0x50c2c6['shift']());}};_0x17fc75(++_0x97b301);}(_0x7866,0x114));var _0x6786=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x7866[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x6786('0x0'));var util=require(_0x6786('0x1'));var moment=require('moment');var BPromise=require(_0x6786('0x2'));var rs=require(_0x6786('0x3'));var fs=require('fs');var Redis=require(_0x6786('0x4'));var db=require(_0x6786('0x5'))['db'];var utils=require(_0x6786('0x6'));var logger=require(_0x6786('0x7'))(_0x6786('0x8'));var config=require(_0x6786('0x9'));var jayson=require(_0x6786('0xa'));var client=jayson[_0x6786('0xb')][_0x6786('0xc')]({'port':0x232a});config[_0x6786('0xd')]=_[_0x6786('0xe')](config[_0x6786('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6786('0xf'))(new Redis(config[_0x6786('0xd')]));require(_0x6786('0x10'))[_0x6786('0x11')](socket);function respondWithRpcPromise(_0x2959a0,_0x8a23cd,_0xec1291){return new BPromise(function(_0x2e0d0d,_0x37fcc6){return client[_0x6786('0x12')](_0x2959a0,_0xec1291)[_0x6786('0x13')](function(_0x532249){logger[_0x6786('0x14')](_0x6786('0x15'),_0x8a23cd,_0x6786('0x16'));logger[_0x6786('0x17')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x8a23cd,_0x6786('0x16'),JSON[_0x6786('0x18')](_0x532249));if(_0x532249['error']){if(_0x532249[_0x6786('0x19')][_0x6786('0x1a')]===0x1f4){logger[_0x6786('0x19')](_0x6786('0x15'),_0x8a23cd,_0x532249[_0x6786('0x19')][_0x6786('0x1b')]);return _0x37fcc6(_0x532249[_0x6786('0x19')][_0x6786('0x1b')]);}logger[_0x6786('0x19')](_0x6786('0x15'),_0x8a23cd,_0x532249[_0x6786('0x19')]['message']);return _0x2e0d0d(_0x532249[_0x6786('0x19')][_0x6786('0x1b')]);}else{logger[_0x6786('0x14')]('FaxMessage,\x20%s,\x20%s',_0x8a23cd,_0x6786('0x16'));_0x2e0d0d(_0x532249['result']['message']);}})['catch'](function(_0x5ce23d){logger[_0x6786('0x19')](_0x6786('0x15'),_0x8a23cd,_0x5ce23d);_0x37fcc6(_0x5ce23d);});});}exports['CreateFaxMessage']=function(_0x391e70){var _0x151c5f=this;return new Promise(function(_0x39b9a6,_0x5a245b){return db[_0x6786('0x1c')][_0x6786('0x1d')](_0x391e70['body'],{'raw':_0x391e70[_0x6786('0x1e')]?_0x391e70['options'][_0x6786('0x1f')]===undefined?!![]:![]:!![]})[_0x6786('0x13')](function(_0x215f98){logger[_0x6786('0x14')](_0x6786('0x20'),_0x391e70);logger[_0x6786('0x17')](_0x6786('0x20'),_0x391e70,JSON[_0x6786('0x18')](_0x215f98));_0x39b9a6(_0x215f98);})[_0x6786('0x21')](function(_0xbc62c8){logger[_0x6786('0x19')]('CreateFaxMessage',_0xbc62c8[_0x6786('0x1b')],_0x391e70);_0x5a245b(_0x151c5f[_0x6786('0x19')](0x1f4,_0xbc62c8['message']));});});};exports[_0x6786('0x22')]=function(_0x2b1ace){var _0x2256fe=this;return new Promise(function(_0xfa2576,_0x53a8d9){return db[_0x6786('0x1c')][_0x6786('0x23')](_0x2b1ace['body'],{'raw':_0x2b1ace[_0x6786('0x1e')]?_0x2b1ace[_0x6786('0x1e')][_0x6786('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b1ace[_0x6786('0x1e')]?_0x2b1ace[_0x6786('0x1e')][_0x6786('0x24')]||null:null,'attributes':_0x2b1ace['options']?_0x2b1ace['options'][_0x6786('0x25')]||null:null,'limit':_0x2b1ace[_0x6786('0x1e')]?_0x2b1ace['options'][_0x6786('0x26')]||null:null})[_0x6786('0x13')](function(_0x53fd1f){logger[_0x6786('0x14')](_0x6786('0x22'),_0x2b1ace);logger['debug'](_0x6786('0x22'),_0x2b1ace,JSON[_0x6786('0x18')](_0x53fd1f));_0xfa2576(_0x53fd1f);})[_0x6786('0x21')](function(_0x5919ac){logger[_0x6786('0x19')]('UpdateFaxMessage',_0x5919ac[_0x6786('0x1b')],_0x2b1ace);_0x53a8d9(_0x2256fe[_0x6786('0x19')](0x1f4,_0x5919ac[_0x6786('0x1b')]));});});}; \ No newline at end of file +var _0x72ee=['create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0xf9a5a,_0x29ed20){var _0x5a38ca=function(_0x53a420){while(--_0x53a420){_0xf9a5a['push'](_0xf9a5a['shift']());}};_0x5a38ca(++_0x29ed20);}(_0x72ee,0x1ac));var _0xe72e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x72ee[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xe72e('0x0'));var util=require(_0xe72e('0x1'));var moment=require(_0xe72e('0x2'));var BPromise=require(_0xe72e('0x3'));var rs=require(_0xe72e('0x4'));var fs=require('fs');var Redis=require(_0xe72e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe72e('0x6'));var logger=require(_0xe72e('0x7'))('rpc');var config=require(_0xe72e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe72e('0x9')][_0xe72e('0xa')]({'port':0x232a});config[_0xe72e('0xb')]=_[_0xe72e('0xc')](config[_0xe72e('0xb')],{'host':_0xe72e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe72e('0xb')]));require(_0xe72e('0xe'))[_0xe72e('0xf')](socket);function respondWithRpcPromise(_0x29e136,_0x5740f4,_0x2a7fe3){return new BPromise(function(_0x5396c1,_0x11fd13){return client[_0xe72e('0x10')](_0x29e136,_0x2a7fe3)[_0xe72e('0x11')](function(_0x5c7664){logger[_0xe72e('0x12')](_0xe72e('0x13'),_0x5740f4,_0xe72e('0x14'));logger[_0xe72e('0x15')](_0xe72e('0x16'),_0x5740f4,_0xe72e('0x14'),JSON[_0xe72e('0x17')](_0x5c7664));if(_0x5c7664['error']){if(_0x5c7664['error']['code']===0x1f4){logger[_0xe72e('0x18')]('FaxMessage,\x20%s,\x20%s',_0x5740f4,_0x5c7664[_0xe72e('0x18')][_0xe72e('0x19')]);return _0x11fd13(_0x5c7664[_0xe72e('0x18')][_0xe72e('0x19')]);}logger[_0xe72e('0x18')]('FaxMessage,\x20%s,\x20%s',_0x5740f4,_0x5c7664[_0xe72e('0x18')][_0xe72e('0x19')]);return _0x5396c1(_0x5c7664[_0xe72e('0x18')][_0xe72e('0x19')]);}else{logger[_0xe72e('0x12')](_0xe72e('0x13'),_0x5740f4,_0xe72e('0x14'));_0x5396c1(_0x5c7664['result'][_0xe72e('0x19')]);}})[_0xe72e('0x1a')](function(_0x24db00){logger[_0xe72e('0x18')](_0xe72e('0x13'),_0x5740f4,_0x24db00);_0x11fd13(_0x24db00);});});}exports['CreateFaxMessage']=function(_0x4be49d){var _0x1110ad=this;return new Promise(function(_0xbcc125,_0x22fff2){return db['FaxMessage'][_0xe72e('0x1b')](_0x4be49d[_0xe72e('0x1c')],{'raw':_0x4be49d[_0xe72e('0x1d')]?_0x4be49d[_0xe72e('0x1d')][_0xe72e('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x5d83ba){logger[_0xe72e('0x12')](_0xe72e('0x1f'),_0x4be49d);logger['debug'](_0xe72e('0x1f'),_0x4be49d,JSON[_0xe72e('0x17')](_0x5d83ba));_0xbcc125(_0x5d83ba);})[_0xe72e('0x1a')](function(_0x132a35){logger[_0xe72e('0x18')](_0xe72e('0x1f'),_0x132a35[_0xe72e('0x19')],_0x4be49d);_0x22fff2(_0x1110ad['error'](0x1f4,_0x132a35[_0xe72e('0x19')]));});});};exports[_0xe72e('0x20')]=function(_0x1678bd){var _0x35b811=this;return new Promise(function(_0x22c02e,_0x24aa61){return db['FaxMessage'][_0xe72e('0x21')](_0x1678bd[_0xe72e('0x1c')],{'raw':_0x1678bd[_0xe72e('0x1d')]?_0x1678bd[_0xe72e('0x1d')][_0xe72e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1678bd['options']?_0x1678bd[_0xe72e('0x1d')]['where']||null:null,'attributes':_0x1678bd['options']?_0x1678bd[_0xe72e('0x1d')]['attributes']||null:null,'limit':_0x1678bd[_0xe72e('0x1d')]?_0x1678bd[_0xe72e('0x1d')][_0xe72e('0x22')]||null:null})[_0xe72e('0x11')](function(_0x1248d7){logger[_0xe72e('0x12')](_0xe72e('0x20'),_0x1678bd);logger[_0xe72e('0x15')]('UpdateFaxMessage',_0x1678bd,JSON[_0xe72e('0x17')](_0x1248d7));_0x22c02e(_0x1248d7);})['catch'](function(_0x519e07){logger[_0xe72e('0x18')]('UpdateFaxMessage',_0x519e07[_0xe72e('0x19')],_0x1678bd);_0x24aa61(_0x35b811['error'](0x1f4,_0x519e07[_0xe72e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index ffd402b..a8592a5 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 4c30de3..20ef4c2 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 _0x9bae=['/:id/accept','accept','reject','delete','multer','express','Router','../../components/auth/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','fax','create','put','update'];(function(_0x50d8ea,_0x57dff0){var _0x26c328=function(_0x228766){while(--_0x228766){_0x50d8ea['push'](_0x50d8ea['shift']());}};_0x26c328(++_0x57dff0);}(_0x9bae,0x115));var _0xe9ba=function(_0x9c2910,_0x131211){_0x9c2910=_0x9c2910-0x0;var _0x26287a=_0x9bae[_0x9c2910];return _0x26287a;};'use strict';var multer=require(_0xe9ba('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe9ba('0x1'));var router=express[_0xe9ba('0x2')]();var auth=require(_0xe9ba('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe9ba('0x4'));router[_0xe9ba('0x5')]('/',auth[_0xe9ba('0x6')](),controller[_0xe9ba('0x7')]);router['get'](_0xe9ba('0x8'),auth[_0xe9ba('0x6')](),controller[_0xe9ba('0x9')]);router[_0xe9ba('0x5')](_0xe9ba('0xa'),auth[_0xe9ba('0x6')](),controller['show']);router[_0xe9ba('0x5')]('/:id/download',auth[_0xe9ba('0x6')](),controller['download']);router[_0xe9ba('0xb')]('/',auth[_0xe9ba('0x6')](),interaction[_0xe9ba('0xc')](_0xe9ba('0xd'),'faxmessage:create'),controller[_0xe9ba('0xe')]);router[_0xe9ba('0xf')]('/:id',auth[_0xe9ba('0x6')](),controller[_0xe9ba('0x10')]);router[_0xe9ba('0xf')](_0xe9ba('0x11'),auth['isAuthenticated'](),controller[_0xe9ba('0x12')]);router[_0xe9ba('0xf')]('/:id/reject',auth[_0xe9ba('0x6')](),controller[_0xe9ba('0x13')]);router[_0xe9ba('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x957f=['isAuthenticated','describe','/:id','show','tracked','fax','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','index','/describe'];(function(_0x19af4a,_0xa88575){var _0x2aa99b=function(_0x46f021){while(--_0x46f021){_0x19af4a['push'](_0x19af4a['shift']());}};_0x2aa99b(++_0xa88575);}(_0x957f,0xaa));var _0xf957=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0x957f[_0x12e073];return _0x267748;};'use strict';var multer=require(_0xf957('0x0'));var util=require(_0xf957('0x1'));var path=require(_0xf957('0x2'));var timeout=require(_0xf957('0x3'));var express=require(_0xf957('0x4'));var router=express[_0xf957('0x5')]();var auth=require(_0xf957('0x6'));var interaction=require(_0xf957('0x7'));var config=require('../../config/environment');var controller=require(_0xf957('0x8'));router[_0xf957('0x9')]('/',auth['isAuthenticated'](),controller[_0xf957('0xa')]);router[_0xf957('0x9')](_0xf957('0xb'),auth[_0xf957('0xc')](),controller[_0xf957('0xd')]);router['get'](_0xf957('0xe'),auth[_0xf957('0xc')](),controller[_0xf957('0xf')]);router[_0xf957('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xf957('0xc')](),interaction[_0xf957('0x10')](_0xf957('0x11'),'faxmessage:create'),controller['create']);router[_0xf957('0x12')]('/:id',auth[_0xf957('0xc')](),controller[_0xf957('0x13')]);router[_0xf957('0x12')](_0xf957('0x14'),auth[_0xf957('0xc')](),controller['accept']);router[_0xf957('0x12')](_0xf957('0x15'),auth[_0xf957('0xc')](),controller[_0xf957('0x16')]);router[_0xf957('0x17')]('/:id',auth[_0xf957('0xc')](),controller[_0xf957('0x18')]);module[_0xf957('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 3dd8e46..3fdc066 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 _0x1c63=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0xf855cf,_0x41211a){var _0xb05fb0=function(_0x4d66e1){while(--_0x4d66e1){_0xf855cf['push'](_0xf855cf['shift']());}};_0xb05fb0(++_0x41211a);}(_0x1c63,0x124));var _0x31c6=function(_0x4c8fd7,_0x5ac749){_0x4c8fd7=_0x4c8fd7-0x0;var _0xd77a98=_0x1c63[_0x4c8fd7];return _0xd77a98;};'use strict';var Sequelize=require(_0x31c6('0x0'));module[_0x31c6('0x1')]={'name':{'type':Sequelize[_0x31c6('0x2')],'unique':_0x31c6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x31c6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x31c6('0x5')](_0x31c6('0x6'),_0x31c6('0x7'),_0x31c6('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x31c6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xac4e=['name','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xac4e,0x1d9));var _0xeac4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xac4e[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xeac4('0x0'));module[_0xeac4('0x1')]={'name':{'type':Sequelize[_0xeac4('0x2')],'unique':_0xeac4('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeac4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xeac4('0x4'),_0xeac4('0x5'),_0xeac4('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 a058ace..b5334be 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 _0xa788=['./faxQueue.socket','register','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','get','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','FaxQueueId','UserFaxQueue','User','agent','format','%s/%s','SIP','faxPause','createdAt','getTeams','addTeams','ids','Team','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost'];(function(_0x1279f2,_0x428198){var _0x372389=function(_0xe5c416){while(--_0xe5c416){_0x1279f2['push'](_0x1279f2['shift']());}};_0x372389(++_0x428198);}(_0xa788,0x70));var _0x8a78=function(_0x584e9f,_0xbe4d1a){_0x584e9f=_0x584e9f-0x0;var _0x4e1597=_0xa788[_0x584e9f];return _0x4e1597;};'use strict';var pdf=require(_0x8a78('0x0'));var emlformat=require(_0x8a78('0x1'));var rimraf=require(_0x8a78('0x2'));var zipdir=require(_0x8a78('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a78('0x4'));var moment=require(_0x8a78('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8a78('0x6'));var util=require(_0x8a78('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8a78('0x8'));var fs=require('fs');var _=require(_0x8a78('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a78('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a78('0xb'));var Papa=require(_0x8a78('0xc'));var Redis=require('ioredis');var authService=require(_0x8a78('0xd'));var qs=require(_0x8a78('0xe'));var as=require(_0x8a78('0xf'));var hardwareService=require(_0x8a78('0x10'));var logger=require(_0x8a78('0x11'))(_0x8a78('0x12'));var utils=require(_0x8a78('0x13'));var config=require(_0x8a78('0x14'));var db=require(_0x8a78('0x15'))['db'];config['redis']=_[_0x8a78('0x16')](config[_0x8a78('0x17')],{'host':_0x8a78('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a78('0x17')]));require(_0x8a78('0x19'))[_0x8a78('0x1a')](socket);function respondWithStatusCode(_0x4b073b,_0x423787){_0x423787=_0x423787||0xcc;return function(_0x5bf8a4){if(_0x5bf8a4){return _0x4b073b[_0x8a78('0x1b')](_0x423787);}return _0x4b073b['status'](_0x423787)[_0x8a78('0x1c')]();};}function respondWithResult(_0x586d47,_0x57212b){_0x57212b=_0x57212b||0xc8;return function(_0x580cf9){if(_0x580cf9){return _0x586d47[_0x8a78('0x1d')](_0x57212b)[_0x8a78('0x1e')](_0x580cf9);}};}function respondWithFilteredResult(_0x1e7087,_0xf0c379){return function(_0x303aab){if(_0x303aab){var _0x18269a=_0x303aab[_0x8a78('0x1f')],_0x9ce954=_0xf0c379[_0x8a78('0x20')],_0x1f2cb9=_0xf0c379[_0x8a78('0x20')]+_0xf0c379[_0x8a78('0x21')],_0x20343b;if(_0x1f2cb9>=_0x18269a){_0x1f2cb9=_0x18269a;_0x20343b=0xc8;}else{_0x20343b=0xce;}_0x1e7087[_0x8a78('0x1d')](_0x20343b);return _0x1e7087['set'](_0x8a78('0x22'),_0x9ce954+'-'+_0x1f2cb9+'/'+_0x18269a)['json'](_0x303aab);}return null;};}function patchUpdates(_0xa6f4b8){return function(_0x1dd032){try{jsonpatch['apply'](_0x1dd032,_0xa6f4b8,!![]);}catch(_0x1389e8){return BPromise[_0x8a78('0x23')](_0x1389e8);}return _0x1dd032[_0x8a78('0x24')]();};}function saveUpdates(_0x43b3b8,_0x2d7d03){return function(_0x530446){if(_0x530446){return _0x530446[_0x8a78('0x25')](_0x43b3b8)['then'](function(_0x3532d1){return _0x3532d1;});}return null;};}function removeEntity(_0x43305f,_0x118357){return function(_0x381795){if(_0x381795){return _0x381795[_0x8a78('0x26')]()[_0x8a78('0x27')](function(){var _0x4a89a1=_0x381795['get']({'plain':!![]});var _0x21908e=_0x8a78('0x28');return db[_0x8a78('0x29')]['destroy']({'where':{'type':_0x21908e,'resourceId':_0x4a89a1['id']}})[_0x8a78('0x27')](function(){return _0x381795;});})[_0x8a78('0x27')](function(){_0x43305f[_0x8a78('0x1d')](0xcc)[_0x8a78('0x1c')]();});}};}function handleEntityNotFound(_0x33b157,_0x38b27d){return function(_0x14be2b){if(!_0x14be2b){_0x33b157['sendStatus'](0x194);}return _0x14be2b;};}function handleError(_0x4872fd,_0x9054ee){_0x9054ee=_0x9054ee||0x1f4;return function(_0x370927){logger[_0x8a78('0x2a')](_0x370927[_0x8a78('0x2b')]);if(_0x370927['name']){delete _0x370927[_0x8a78('0x2c')];}_0x4872fd[_0x8a78('0x1d')](_0x9054ee)['send'](_0x370927);};}exports[_0x8a78('0x2d')]=function(_0x30a355,_0x2fbc0e){var _0x1373f9={},_0x2835f3={},_0x3932a5={'count':0x0,'rows':[]};var _0x31bc3e=_[_0x8a78('0x2e')](db[_0x8a78('0x2f')][_0x8a78('0x30')],function(_0x53ef6d){return{'name':_0x53ef6d['fieldName'],'type':_0x53ef6d[_0x8a78('0x31')][_0x8a78('0x32')]};});_0x2835f3['model']=_[_0x8a78('0x2e')](_0x31bc3e,'name');_0x2835f3[_0x8a78('0x33')]=_[_0x8a78('0x34')](_0x30a355[_0x8a78('0x33')]);_0x2835f3['filters']=_['intersection'](_0x2835f3[_0x8a78('0x35')],_0x2835f3['query']);_0x1373f9[_0x8a78('0x36')]=_[_0x8a78('0x37')](_0x2835f3[_0x8a78('0x35')],qs[_0x8a78('0x38')](_0x30a355[_0x8a78('0x33')]['fields']));_0x1373f9[_0x8a78('0x36')]=_0x1373f9[_0x8a78('0x36')][_0x8a78('0x39')]?_0x1373f9[_0x8a78('0x36')]:_0x2835f3[_0x8a78('0x35')];if(!_0x30a355['query'][_0x8a78('0x3a')](_0x8a78('0x3b'))){_0x1373f9[_0x8a78('0x21')]=qs['limit'](_0x30a355[_0x8a78('0x33')][_0x8a78('0x21')]);_0x1373f9[_0x8a78('0x20')]=qs['offset'](_0x30a355['query']['offset']);}_0x1373f9['order']=qs[_0x8a78('0x3c')](_0x30a355[_0x8a78('0x33')][_0x8a78('0x3c')]);_0x1373f9[_0x8a78('0x3d')]=qs[_0x8a78('0x3e')](_[_0x8a78('0x3f')](_0x30a355[_0x8a78('0x33')],_0x2835f3['filters']));if(_0x30a355[_0x8a78('0x33')][_0x8a78('0x40')]){_0x1373f9['where']=_[_0x8a78('0x41')](_0x1373f9[_0x8a78('0x3d')],{'$or':_[_0x8a78('0x2e')](_0x31bc3e,function(_0x3aa4c4){if(_0x3aa4c4[_0x8a78('0x31')]!==_0x8a78('0x42')){var _0x44740e={};_0x44740e[_0x3aa4c4[_0x8a78('0x2c')]]={'$like':'%'+_0x30a355[_0x8a78('0x33')][_0x8a78('0x40')]+'%'};return _0x44740e;}})});}_0x1373f9=_[_0x8a78('0x41')]({},_0x1373f9,_0x30a355[_0x8a78('0x43')]);var _0x2e48b1={'where':_0x1373f9[_0x8a78('0x3d')]};return db[_0x8a78('0x2f')][_0x8a78('0x1f')](_0x2e48b1)[_0x8a78('0x27')](function(_0x1d87dd){_0x3932a5[_0x8a78('0x1f')]=_0x1d87dd;if(_0x30a355[_0x8a78('0x33')][_0x8a78('0x44')]){_0x1373f9['include']=[{'all':!![]}];}return db['FaxQueue'][_0x8a78('0x45')](_0x1373f9);})[_0x8a78('0x27')](function(_0xb0eea6){_0x3932a5[_0x8a78('0x46')]=_0xb0eea6;return _0x3932a5;})[_0x8a78('0x27')](respondWithFilteredResult(_0x2fbc0e,_0x1373f9))[_0x8a78('0x47')](handleError(_0x2fbc0e,null));};exports['show']=function(_0x26fe7a,_0xd9b912){var _0x282941={'raw':!![],'where':{'id':_0x26fe7a[_0x8a78('0x48')]['id']}},_0x12c22b={};_0x12c22b[_0x8a78('0x35')]=_[_0x8a78('0x34')](db[_0x8a78('0x2f')][_0x8a78('0x30')]);_0x12c22b[_0x8a78('0x33')]=_[_0x8a78('0x34')](_0x26fe7a[_0x8a78('0x33')]);_0x12c22b[_0x8a78('0x3e')]=_[_0x8a78('0x37')](_0x12c22b[_0x8a78('0x35')],_0x12c22b[_0x8a78('0x33')]);_0x282941[_0x8a78('0x36')]=_[_0x8a78('0x37')](_0x12c22b[_0x8a78('0x35')],qs[_0x8a78('0x38')](_0x26fe7a['query'][_0x8a78('0x38')]));_0x282941[_0x8a78('0x36')]=_0x282941[_0x8a78('0x36')]['length']?_0x282941[_0x8a78('0x36')]:_0x12c22b[_0x8a78('0x35')];if(_0x26fe7a[_0x8a78('0x33')][_0x8a78('0x44')]){_0x282941[_0x8a78('0x49')]=[{'all':!![]}];}_0x282941=_[_0x8a78('0x41')]({},_0x282941,_0x26fe7a[_0x8a78('0x43')]);return db['FaxQueue'][_0x8a78('0x4a')](_0x282941)['then'](handleEntityNotFound(_0xd9b912,null))[_0x8a78('0x27')](respondWithResult(_0xd9b912,null))['catch'](handleError(_0xd9b912,null));};exports['create']=function(_0x568924,_0x2f1542){return db[_0x8a78('0x2f')][_0x8a78('0x4b')](_0x568924[_0x8a78('0x4c')],{})[_0x8a78('0x27')](function(_0x261642){var _0x4f8f88=_0x568924['user'][_0x8a78('0x4d')]({'plain':!![]});if(!_0x4f8f88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f8f88['role']===_0x8a78('0x4e')){var _0x1eba19=_0x261642[_0x8a78('0x4d')]({'plain':!![]});var _0x41f313=_0x8a78('0x28');return db[_0x8a78('0x4f')]['find']({'where':{'name':_0x41f313,'userProfileId':_0x4f8f88[_0x8a78('0x50')]},'raw':!![]})[_0x8a78('0x27')](function(_0xd4a62f){if(_0xd4a62f&&_0xd4a62f[_0x8a78('0x51')]===0x0){return db[_0x8a78('0x29')][_0x8a78('0x4b')]({'name':_0x1eba19[_0x8a78('0x2c')],'resourceId':_0x1eba19['id'],'type':_0xd4a62f[_0x8a78('0x2c')],'sectionId':_0xd4a62f['id']},{})[_0x8a78('0x27')](function(){return _0x261642;});}else{return _0x261642;}})['catch'](function(_0x41d088){logger[_0x8a78('0x2a')](_0x8a78('0x52'),_0x41d088);throw _0x41d088;});}return _0x261642;})['then'](respondWithResult(_0x2f1542,0xc9))['catch'](handleError(_0x2f1542,null));};exports[_0x8a78('0x25')]=function(_0x4937ce,_0x2485a0){if(_0x4937ce[_0x8a78('0x4c')]['id']){delete _0x4937ce['body']['id'];}return db[_0x8a78('0x2f')][_0x8a78('0x4a')]({'where':{'id':_0x4937ce['params']['id']}})[_0x8a78('0x27')](handleEntityNotFound(_0x2485a0,null))[_0x8a78('0x27')](saveUpdates(_0x4937ce[_0x8a78('0x4c')],null))[_0x8a78('0x27')](respondWithResult(_0x2485a0,null))[_0x8a78('0x47')](handleError(_0x2485a0,null));};exports[_0x8a78('0x26')]=function(_0x12e358,_0x254349){return db[_0x8a78('0x2f')][_0x8a78('0x4a')]({'where':{'id':_0x12e358[_0x8a78('0x48')]['id']}})[_0x8a78('0x27')](handleEntityNotFound(_0x254349,null))[_0x8a78('0x27')](removeEntity(_0x254349,null))['catch'](handleError(_0x254349,null));};exports[_0x8a78('0x53')]=function(_0x384c12,_0x8c1dfc){return db[_0x8a78('0x2f')][_0x8a78('0x53')]()[_0x8a78('0x27')](respondWithResult(_0x8c1dfc,null))[_0x8a78('0x47')](handleError(_0x8c1dfc,null));};exports[_0x8a78('0x54')]=function(_0x444c34,_0xecbcc6,_0x38d5a8){var _0x1d6657={'raw':!![],'where':{}},_0x1778ed={},_0x343bdd;return db[_0x8a78('0x2f')][_0x8a78('0x55')]({'where':{'id':_0x444c34['params']['id']}})[_0x8a78('0x27')](handleEntityNotFound(_0xecbcc6,null))[_0x8a78('0x27')](function(_0x4c1212){if(_0x4c1212){_0x343bdd=_0x4c1212[_0x8a78('0x4d')]({'plain':!![]});_0x1778ed[_0x8a78('0x35')]=_[_0x8a78('0x34')](db['UserFaxQueue'][_0x8a78('0x30')]);_0x1778ed[_0x8a78('0x33')]=_[_0x8a78('0x34')](_0x444c34[_0x8a78('0x33')]);_0x1778ed['filters']=_[_0x8a78('0x37')](_0x1778ed[_0x8a78('0x35')],_0x1778ed[_0x8a78('0x33')]);_0x1d6657[_0x8a78('0x36')]=_[_0x8a78('0x37')](_0x1778ed[_0x8a78('0x35')],qs[_0x8a78('0x38')](_0x444c34[_0x8a78('0x33')]['fields']));_0x1d6657[_0x8a78('0x36')]=_0x1d6657[_0x8a78('0x36')]['length']?_0x1d6657['attributes']:_0x1778ed[_0x8a78('0x35')];if(!_0x444c34[_0x8a78('0x33')][_0x8a78('0x3a')](_0x8a78('0x3b'))){_0x1d6657[_0x8a78('0x21')]=qs[_0x8a78('0x21')](_0x444c34[_0x8a78('0x33')][_0x8a78('0x21')]);_0x1d6657[_0x8a78('0x20')]=qs['offset'](_0x444c34['query']['offset']);}_0x1d6657[_0x8a78('0x56')]=qs[_0x8a78('0x3c')](_0x444c34['query'][_0x8a78('0x3c')]);_0x1d6657[_0x8a78('0x3d')]=qs[_0x8a78('0x3e')](_[_0x8a78('0x3f')](_0x444c34['query'],_0x1778ed[_0x8a78('0x3e')]));_0x1d6657['where'][_0x8a78('0x57')]=_0x4c1212['id'];if(_0x444c34[_0x8a78('0x33')][_0x8a78('0x40')]){_0x1d6657['where']=_[_0x8a78('0x41')](_0x1d6657[_0x8a78('0x3d')],{'$or':_[_0x8a78('0x2e')](_0x1d6657[_0x8a78('0x36')],function(_0x21b0f8){var _0x2e3627={};_0x2e3627[_0x21b0f8]={'$like':'%'+_0x444c34[_0x8a78('0x33')][_0x8a78('0x40')]+'%'};return _0x2e3627;})});}_0x1d6657=_['merge']({},_0x1d6657,_0x444c34[_0x8a78('0x43')]);return db[_0x8a78('0x58')]['findAll'](_0x1d6657);}})[_0x8a78('0x27')](function(_0x379db5){if(_0x379db5){return db[_0x8a78('0x59')]['findAndCountAll']({'where':{'id':_[_0x8a78('0x2e')](_0x379db5,'UserId'),'role':_0x8a78('0x5a')},'attributes':['id',_0x8a78('0x2c'),'faxPause','updatedAt','createdAt']});}})[_0x8a78('0x27')](function(_0x5d5c29){if(_0x5d5c29){return{'count':_0x5d5c29['count'],'rows':_['map'](_0x5d5c29[_0x8a78('0x46')],function(_0x227852){return{'membername':_0x227852[_0x8a78('0x2c')],'UserId':_0x227852['id'],'queue_name':_0x343bdd[_0x8a78('0x2c')],'FaxQueueId':_0x343bdd['id'],'interface':util[_0x8a78('0x5b')](_0x8a78('0x5c'),_0x8a78('0x5d'),_0x227852[_0x8a78('0x2c')]),'penalty':0x0,'paused':_0x227852[_0x8a78('0x5e')],'createdAt':_0x227852[_0x8a78('0x5f')],'updatedAt':_0x227852['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8a78('0x27')](respondWithFilteredResult(_0xecbcc6,_0x1d6657))[_0x8a78('0x47')](handleError(_0xecbcc6,null));};exports[_0x8a78('0x60')]=function(_0x3f303a,_0x20c2e8,_0x1b43cd){var _0x29acb2={};var _0x40ae2a={};var _0x565333;var _0x12a7cb;return db[_0x8a78('0x2f')][_0x8a78('0x55')]({'where':{'id':_0x3f303a[_0x8a78('0x48')]['id']}})[_0x8a78('0x27')](handleEntityNotFound(_0x20c2e8,null))[_0x8a78('0x27')](function(_0x50bb07){if(_0x50bb07){_0x565333=_0x50bb07;_0x40ae2a['model']=_[_0x8a78('0x34')](db['Team'][_0x8a78('0x30')]);_0x40ae2a[_0x8a78('0x33')]=_[_0x8a78('0x34')](_0x3f303a[_0x8a78('0x33')]);_0x40ae2a[_0x8a78('0x3e')]=_[_0x8a78('0x37')](_0x40ae2a[_0x8a78('0x35')],_0x40ae2a[_0x8a78('0x33')]);_0x29acb2[_0x8a78('0x36')]=_['intersection'](_0x40ae2a[_0x8a78('0x35')],qs[_0x8a78('0x38')](_0x3f303a[_0x8a78('0x33')][_0x8a78('0x38')]));_0x29acb2['attributes']=_0x29acb2[_0x8a78('0x36')][_0x8a78('0x39')]?_0x29acb2[_0x8a78('0x36')]:_0x40ae2a[_0x8a78('0x35')];_0x29acb2[_0x8a78('0x56')]=qs[_0x8a78('0x3c')](_0x3f303a[_0x8a78('0x33')]['sort']);_0x29acb2['where']=qs['filters'](_[_0x8a78('0x3f')](_0x3f303a['query'],_0x40ae2a[_0x8a78('0x3e')]));if(_0x3f303a[_0x8a78('0x33')][_0x8a78('0x40')]){_0x29acb2['where']=_[_0x8a78('0x41')](_0x29acb2['where'],{'$or':_[_0x8a78('0x2e')](_0x29acb2['attributes'],function(_0x2f07ba){var _0x2f6d35={};_0x2f6d35[_0x2f07ba]={'$like':'%'+_0x3f303a[_0x8a78('0x33')][_0x8a78('0x40')]+'%'};return _0x2f6d35;})});}_0x29acb2=_[_0x8a78('0x41')]({},_0x29acb2,_0x3f303a['options']);return _0x565333[_0x8a78('0x60')](_0x29acb2);}})[_0x8a78('0x27')](function(_0x2581fd){if(_0x2581fd){_0x12a7cb=_0x2581fd[_0x8a78('0x39')];if(!_0x3f303a['query']['hasOwnProperty'](_0x8a78('0x3b'))){_0x29acb2[_0x8a78('0x21')]=qs[_0x8a78('0x21')](_0x3f303a[_0x8a78('0x33')]['limit']);_0x29acb2[_0x8a78('0x20')]=qs[_0x8a78('0x20')](_0x3f303a['query'][_0x8a78('0x20')]);}return _0x565333[_0x8a78('0x60')](_0x29acb2);}})[_0x8a78('0x27')](function(_0x585a57){if(_0x585a57){return _0x585a57?{'count':_0x12a7cb,'rows':_0x585a57}:null;}})[_0x8a78('0x27')](respondWithResult(_0x20c2e8,null))[_0x8a78('0x47')](handleError(_0x20c2e8,null));};exports[_0x8a78('0x61')]=function(_0xa40338,_0x2c3065,_0x42474c){var _0x105a2c=_0xa40338['body'][_0x8a78('0x62')];return db[_0x8a78('0x63')][_0x8a78('0x45')]({'where':{'id':_0x105a2c},'attributes':['id'],'include':[{'model':db[_0x8a78('0x59')],'as':_0x8a78('0x64'),'attributes':['id',_0x8a78('0x2c'),'online',_0x8a78('0x65'),_0x8a78('0x66')],'raw':!![]}]})[_0x8a78('0x27')](function(_0x2d5310){if(_0x2d5310){var _0x88faca=_['flatMap'](_0x2d5310,function(_0x4a75c9){var _0x4e28cf=_0x4a75c9[_0x8a78('0x4d')]({'plain':!![]});return _0x4e28cf[_0x8a78('0x64')];});return db[_0x8a78('0x2f')]['find']({'where':{'id':_0xa40338[_0x8a78('0x48')]['id']}})[_0x8a78('0x27')](function(_0x51ffc3){return db[_0x8a78('0x67')][_0x8a78('0x68')](function(_0x3f987f){return _0x51ffc3[_0x8a78('0x61')](_0x105a2c,{'transaction':_0x3f987f})[_0x8a78('0x27')](function(){return BPromise[_0x8a78('0x69')](_0x88faca,function(_0x2673e0){return db[_0x8a78('0x58')][_0x8a78('0x6a')]({'where':{'UserId':_0x2673e0['id'],'FaxQueueId':_0xa40338[_0x8a78('0x48')]['id']},'transaction':_0x3f987f});});})[_0x8a78('0x27')](function(){_0x88faca[_0x8a78('0x6b')](function(_0x3a215b){socket[_0x8a78('0x6c')]('userFaxQueue:save',{'UserId':_0x3a215b['id'],'FaxQueueId':_0x51ffc3['id']});});});});});}})[_0x8a78('0x27')](respondWithStatusCode(_0x2c3065,null))[_0x8a78('0x47')](handleError(_0x2c3065,null));};exports[_0x8a78('0x6d')]=function(_0x27c879,_0x1d3b1c,_0x306653){return db[_0x8a78('0x63')][_0x8a78('0x45')]({'where':{'id':_0x27c879[_0x8a78('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8a78('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8a78('0x27')](handleEntityNotFound(_0x1d3b1c,null))['then'](function(_0x39243a){var _0x545613=_['map'](_0x39243a,'id');var _0x1e1bac=[];var _0x264821=[];var _0x444efc=squel[_0x8a78('0x6e')]();_0x444efc[_0x8a78('0x6f')](_0x8a78('0x70'))[_0x8a78('0x71')](_0x8a78('0x72'),'tq')[_0x8a78('0x73')](_0x8a78('0x74'),'ut',_0x8a78('0x75'))[_0x8a78('0x3d')](_0x8a78('0x76'),_0x27c879[_0x8a78('0x48')]['id']);for(var _0x20d928=0x0;_0x20d928<_0x39243a[_0x8a78('0x39')];_0x20d928+=0x1){let _0x40cc56=_0x39243a[_0x20d928];for(var _0x299abf=0x0;_0x299abf<_0x40cc56[_0x8a78('0x64')]['length'];_0x299abf+=0x1){let _0x55105e=_0x40cc56['Agents'][_0x299abf];var _0x32b56c=_0x444efc[_0x8a78('0x77')]();_0x32b56c['where']('ut.UserId\x20=\x20?',_0x55105e['id']);_0x264821[_0x8a78('0x78')](db[_0x8a78('0x67')][_0x8a78('0x33')](_0x32b56c[_0x8a78('0x79')](),{'type':db[_0x8a78('0x67')]['QueryTypes'][_0x8a78('0x7a')]})['then'](function(_0x199e6c){if(_0x199e6c[_0x8a78('0x39')]===0x1){return _0x55105e['id'];}else{var _0x1b6558=_[_0x8a78('0x7b')](_[_0x8a78('0x2e')](_0x199e6c,_0x8a78('0x7c')),function(_0x46a56a){return _[_0x8a78('0x7d')](_0x545613,_0x46a56a);});if(_0x1b6558){return _0x55105e['id'];}}}));}}return BPromise[_0x8a78('0x7e')](_0x264821)['then'](function(_0x3ed01e){_0x1e1bac=_(_0x1e1bac)[_0x8a78('0x7f')](_0x3ed01e)[_0x8a78('0x80')]()[_0x8a78('0x81')]();return db[_0x8a78('0x2f')][_0x8a78('0x4a')]({'where':{'id':_0x27c879[_0x8a78('0x48')]['id']}})[_0x8a78('0x27')](function(_0x504883){return db[_0x8a78('0x67')][_0x8a78('0x68')](function(_0x30ad03){return _0x504883[_0x8a78('0x6d')](_0x27c879['query'][_0x8a78('0x62')],{'transaction':_0x30ad03})[_0x8a78('0x27')](function(){if(!_[_0x8a78('0x82')](_0x1e1bac)){return _0x504883[_0x8a78('0x83')](_0x1e1bac,{'transaction':_0x30ad03});}})[_0x8a78('0x27')](function(){_0x1e1bac['forEach'](function(_0x4180c5){socket[_0x8a78('0x6c')](_0x8a78('0x84'),{'UserId':_0x4180c5,'FaxQueueId':_0x504883['id']});});});});});});})[_0x8a78('0x27')](respondWithStatusCode(_0x1d3b1c,null))[_0x8a78('0x47')](handleError(_0x1d3b1c,null));};exports[_0x8a78('0x85')]=function(_0x2b4e51,_0x56b676,_0x3ed1e0){return db['FaxQueue'][_0x8a78('0x4a')]({'where':{'id':_0x2b4e51['params']['id']}})[_0x8a78('0x27')](handleEntityNotFound(_0x56b676,null))[_0x8a78('0x27')](function(_0x287acf){if(_0x287acf){return _0x287acf[_0x8a78('0x85')](_0x2b4e51[_0x8a78('0x4c')]['ids'],_['omit'](_0x2b4e51[_0x8a78('0x4c')],[_0x8a78('0x62'),'id'])||{})['spread'](function(_0x1043cb){for(var _0x54ccd8=0x0;_0x54ccd8<_0x2b4e51[_0x8a78('0x4c')]['ids'][_0x8a78('0x39')];_0x54ccd8+=0x1){socket[_0x8a78('0x6c')](_0x8a78('0x86'),{'UserId':_0x2b4e51[_0x8a78('0x4c')][_0x8a78('0x62')][_0x54ccd8],'FaxQueueId':_0x2b4e51['params']['id']});}return _0x1043cb;});}})['then'](respondWithResult(_0x56b676,null))['catch'](handleError(_0x56b676,null));};exports[_0x8a78('0x83')]=function(_0x9fca85,_0x300c3e,_0x2f5b78){return db[_0x8a78('0x2f')][_0x8a78('0x4a')]({'where':{'id':_0x9fca85['params']['id']}})[_0x8a78('0x27')](handleEntityNotFound(_0x300c3e,null))[_0x8a78('0x27')](function(_0x216462){if(_0x216462){return _0x216462[_0x8a78('0x83')](_0x9fca85['query'][_0x8a78('0x62')])[_0x8a78('0x27')](function(){if(_[_0x8a78('0x87')](_0x9fca85['query'][_0x8a78('0x62')])){for(var _0x5abf8e=0x0;_0x5abf8e<_0x9fca85[_0x8a78('0x33')][_0x8a78('0x62')][_0x8a78('0x39')];_0x5abf8e+=0x1){socket[_0x8a78('0x6c')](_0x8a78('0x84'),{'UserId':Number(_0x9fca85[_0x8a78('0x33')]['ids'][_0x5abf8e]),'FaxQueueId':Number(_0x9fca85['params']['id'])});}}else{socket[_0x8a78('0x6c')](_0x8a78('0x84'),{'UserId':Number(_0x9fca85[_0x8a78('0x33')][_0x8a78('0x62')]),'FaxQueueId':Number(_0x9fca85[_0x8a78('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x300c3e,null))['catch'](handleError(_0x300c3e,null));};exports[_0x8a78('0x88')]=function(_0xd91ed7,_0x3090aa,_0x429420){var _0x57789e={};var _0x3b9896={};var _0x14bb66;var _0x6730a6;return db[_0x8a78('0x2f')][_0x8a78('0x55')]({'where':{'id':_0xd91ed7[_0x8a78('0x48')]['id']}})['then'](handleEntityNotFound(_0x3090aa,null))[_0x8a78('0x27')](function(_0x4f8346){if(_0x4f8346){_0x14bb66=_0x4f8346;_0x3b9896[_0x8a78('0x35')]=_['keys'](db[_0x8a78('0x59')]['rawAttributes']);_0x3b9896[_0x8a78('0x33')]=_[_0x8a78('0x34')](_0xd91ed7['query']);_0x3b9896[_0x8a78('0x3e')]=_[_0x8a78('0x37')](_0x3b9896[_0x8a78('0x35')],_0x3b9896[_0x8a78('0x33')]);_0x57789e[_0x8a78('0x36')]=_[_0x8a78('0x37')](_0x3b9896[_0x8a78('0x35')],qs[_0x8a78('0x38')](_0xd91ed7[_0x8a78('0x33')]['fields']));_0x57789e[_0x8a78('0x36')]=_0x57789e[_0x8a78('0x36')][_0x8a78('0x39')]?_0x57789e[_0x8a78('0x36')]:_0x3b9896[_0x8a78('0x35')];_0x57789e[_0x8a78('0x56')]=qs[_0x8a78('0x3c')](_0xd91ed7[_0x8a78('0x33')][_0x8a78('0x3c')]);_0x57789e['where']=qs[_0x8a78('0x3e')](_['pick'](_0xd91ed7['query'],_0x3b9896[_0x8a78('0x3e')]));if(_0xd91ed7['query']['filter']){_0x57789e[_0x8a78('0x3d')]=_['merge'](_0x57789e[_0x8a78('0x3d')],{'$or':_['map'](_0x57789e['attributes'],function(_0xac4aab){var _0x22183a={};_0x22183a[_0xac4aab]={'$like':'%'+_0xd91ed7[_0x8a78('0x33')][_0x8a78('0x40')]+'%'};return _0x22183a;})});}_0x57789e=_[_0x8a78('0x41')]({},_0x57789e,_0xd91ed7['options']);return _0x14bb66['getAgents'](_0x57789e);}})[_0x8a78('0x27')](function(_0x55ba5a){if(_0x55ba5a){_0x6730a6=_0x55ba5a[_0x8a78('0x39')];if(!_0xd91ed7['query'][_0x8a78('0x3a')](_0x8a78('0x3b'))){_0x57789e[_0x8a78('0x21')]=qs[_0x8a78('0x21')](_0xd91ed7[_0x8a78('0x33')][_0x8a78('0x21')]);_0x57789e['offset']=qs[_0x8a78('0x20')](_0xd91ed7['query'][_0x8a78('0x20')]);}return _0x14bb66[_0x8a78('0x88')](_0x57789e);}})['then'](function(_0x1fb358){if(_0x1fb358){return _0x1fb358?{'count':_0x6730a6,'rows':_0x1fb358}:null;}})[_0x8a78('0x27')](respondWithResult(_0x3090aa,null))[_0x8a78('0x47')](handleError(_0x3090aa,null));}; \ No newline at end of file +var _0x32d5=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','FaxQueues','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','findAll','rows','catch','show','params','keys','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','length','FaxQueueId','UserFaxQueue','User','UserId','agent','faxPause','updatedAt','createdAt','format','SIP','getTeams','pick','addTeams','ids','Team','Agents','online','interface','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','userFaxQueue:remove','omit','spread','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf'];(function(_0x4091da,_0x5740a4){var _0xa14d25=function(_0xa75e86){while(--_0xa75e86){_0x4091da['push'](_0x4091da['shift']());}};_0xa14d25(++_0x5740a4);}(_0x32d5,0x1aa));var _0x532d=function(_0x15160b,_0xbce540){_0x15160b=_0x15160b-0x0;var _0x7bf956=_0x32d5[_0x15160b];return _0x7bf956;};'use strict';var pdf=require(_0x532d('0x0'));var emlformat=require(_0x532d('0x1'));var rimraf=require(_0x532d('0x2'));var zipdir=require(_0x532d('0x3'));var jsonpatch=require(_0x532d('0x4'));var rp=require(_0x532d('0x5'));var moment=require(_0x532d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x532d('0x7'));var util=require(_0x532d('0x8'));var path=require('path');var sox=require(_0x532d('0x9'));var csv=require(_0x532d('0xa'));var ejs=require(_0x532d('0xb'));var fs=require('fs');var _=require(_0x532d('0xc'));var squel=require(_0x532d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x532d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x532d('0xf'));var Papa=require(_0x532d('0x10'));var Redis=require(_0x532d('0x11'));var authService=require(_0x532d('0x12'));var qs=require(_0x532d('0x13'));var as=require(_0x532d('0x14'));var hardwareService=require(_0x532d('0x15'));var logger=require(_0x532d('0x16'))(_0x532d('0x17'));var utils=require(_0x532d('0x18'));var config=require(_0x532d('0x19'));var db=require(_0x532d('0x1a'))['db'];config['redis']=_[_0x532d('0x1b')](config[_0x532d('0x1c')],{'host':_0x532d('0x1d'),'port':0x18eb});var socket=require(_0x532d('0x1e'))(new Redis(config[_0x532d('0x1c')]));require('./faxQueue.socket')[_0x532d('0x1f')](socket);function respondWithStatusCode(_0x581210,_0x10e3b6){_0x10e3b6=_0x10e3b6||0xcc;return function(_0x12e2bd){if(_0x12e2bd){return _0x581210[_0x532d('0x20')](_0x10e3b6);}return _0x581210[_0x532d('0x21')](_0x10e3b6)[_0x532d('0x22')]();};}function respondWithResult(_0x1f48fb,_0x3747e4){_0x3747e4=_0x3747e4||0xc8;return function(_0x176595){if(_0x176595){return _0x1f48fb[_0x532d('0x21')](_0x3747e4)['json'](_0x176595);}};}function respondWithFilteredResult(_0x1ddda,_0x20c080){return function(_0x42dbe9){if(_0x42dbe9){var _0x1a7fb9=_0x42dbe9[_0x532d('0x23')],_0x771ff1=_0x20c080[_0x532d('0x24')],_0x2fa662=_0x20c080['offset']+_0x20c080[_0x532d('0x25')],_0x3a9388;if(_0x2fa662>=_0x1a7fb9){_0x2fa662=_0x1a7fb9;_0x3a9388=0xc8;}else{_0x3a9388=0xce;}_0x1ddda[_0x532d('0x21')](_0x3a9388);return _0x1ddda[_0x532d('0x26')](_0x532d('0x27'),_0x771ff1+'-'+_0x2fa662+'/'+_0x1a7fb9)[_0x532d('0x28')](_0x42dbe9);}return null;};}function patchUpdates(_0x5c0c6e){return function(_0x139981){try{jsonpatch[_0x532d('0x29')](_0x139981,_0x5c0c6e,!![]);}catch(_0x1227df){return BPromise[_0x532d('0x2a')](_0x1227df);}return _0x139981[_0x532d('0x2b')]();};}function saveUpdates(_0x53281d,_0x4c85bb){return function(_0x121d30){if(_0x121d30){return _0x121d30[_0x532d('0x2c')](_0x53281d)[_0x532d('0x2d')](function(_0x5846a9){return _0x5846a9;});}return null;};}function removeEntity(_0x4e7ad1,_0x442604){return function(_0x3d6c0c){if(_0x3d6c0c){return _0x3d6c0c[_0x532d('0x2e')]()['then'](function(){var _0x50f77b=_0x3d6c0c['get']({'plain':!![]});var _0x2f6471=_0x532d('0x2f');return db['UserProfileResource'][_0x532d('0x2e')]({'where':{'type':_0x2f6471,'resourceId':_0x50f77b['id']}})[_0x532d('0x2d')](function(){return _0x3d6c0c;});})[_0x532d('0x2d')](function(){_0x4e7ad1[_0x532d('0x21')](0xcc)[_0x532d('0x22')]();});}};}function handleEntityNotFound(_0x1384d4,_0x4da7c8){return function(_0xbf606b){if(!_0xbf606b){_0x1384d4[_0x532d('0x20')](0x194);}return _0xbf606b;};}function handleError(_0x2fcbf7,_0x3ca076){_0x3ca076=_0x3ca076||0x1f4;return function(_0x3288b5){logger['error'](_0x3288b5['stack']);if(_0x3288b5['name']){delete _0x3288b5[_0x532d('0x30')];}_0x2fcbf7['status'](_0x3ca076)[_0x532d('0x31')](_0x3288b5);};}exports[_0x532d('0x32')]=function(_0x2bd64f,_0x2d196a){var _0x2c13af={},_0x41f984={},_0x56d7c2={'count':0x0,'rows':[]};var _0x477f59=_[_0x532d('0x33')](db[_0x532d('0x34')][_0x532d('0x35')],function(_0x4422fc){return{'name':_0x4422fc[_0x532d('0x36')],'type':_0x4422fc['type'][_0x532d('0x37')]};});_0x41f984[_0x532d('0x38')]=_[_0x532d('0x33')](_0x477f59,_0x532d('0x30'));_0x41f984[_0x532d('0x39')]=_['keys'](_0x2bd64f[_0x532d('0x39')]);_0x41f984[_0x532d('0x3a')]=_['intersection'](_0x41f984[_0x532d('0x38')],_0x41f984[_0x532d('0x39')]);_0x2c13af[_0x532d('0x3b')]=_[_0x532d('0x3c')](_0x41f984[_0x532d('0x38')],qs[_0x532d('0x3d')](_0x2bd64f['query'][_0x532d('0x3d')]));_0x2c13af[_0x532d('0x3b')]=_0x2c13af['attributes']['length']?_0x2c13af[_0x532d('0x3b')]:_0x41f984[_0x532d('0x38')];if(!_0x2bd64f[_0x532d('0x39')][_0x532d('0x3e')](_0x532d('0x3f'))){_0x2c13af[_0x532d('0x25')]=qs[_0x532d('0x25')](_0x2bd64f[_0x532d('0x39')][_0x532d('0x25')]);_0x2c13af[_0x532d('0x24')]=qs[_0x532d('0x24')](_0x2bd64f[_0x532d('0x39')][_0x532d('0x24')]);}_0x2c13af[_0x532d('0x40')]=qs['sort'](_0x2bd64f[_0x532d('0x39')][_0x532d('0x41')]);_0x2c13af[_0x532d('0x42')]=qs[_0x532d('0x3a')](_['pick'](_0x2bd64f[_0x532d('0x39')],_0x41f984[_0x532d('0x3a')]));if(_0x2bd64f['query'][_0x532d('0x43')]){_0x2c13af[_0x532d('0x42')]=_[_0x532d('0x44')](_0x2c13af['where'],{'$or':_['map'](_0x477f59,function(_0x13ed42){if(_0x13ed42[_0x532d('0x45')]!==_0x532d('0x46')){var _0x50ce60={};_0x50ce60[_0x13ed42[_0x532d('0x30')]]={'$like':'%'+_0x2bd64f[_0x532d('0x39')][_0x532d('0x43')]+'%'};return _0x50ce60;}})});}_0x2c13af=_[_0x532d('0x44')]({},_0x2c13af,_0x2bd64f['options']);var _0x27d8d4={'where':_0x2c13af[_0x532d('0x42')]};return db[_0x532d('0x34')][_0x532d('0x23')](_0x27d8d4)[_0x532d('0x2d')](function(_0xa1e87e){_0x56d7c2[_0x532d('0x23')]=_0xa1e87e;if(_0x2bd64f[_0x532d('0x39')]['includeAll']){_0x2c13af['include']=[{'all':!![]}];}return db[_0x532d('0x34')][_0x532d('0x47')](_0x2c13af);})['then'](function(_0x302d19){_0x56d7c2[_0x532d('0x48')]=_0x302d19;return _0x56d7c2;})[_0x532d('0x2d')](respondWithFilteredResult(_0x2d196a,_0x2c13af))[_0x532d('0x49')](handleError(_0x2d196a,null));};exports[_0x532d('0x4a')]=function(_0x4980fc,_0xca980f){var _0x25be17={'raw':!![],'where':{'id':_0x4980fc[_0x532d('0x4b')]['id']}},_0x11a553={};_0x11a553['model']=_[_0x532d('0x4c')](db[_0x532d('0x34')][_0x532d('0x35')]);_0x11a553['query']=_['keys'](_0x4980fc[_0x532d('0x39')]);_0x11a553[_0x532d('0x3a')]=_[_0x532d('0x3c')](_0x11a553['model'],_0x11a553[_0x532d('0x39')]);_0x25be17['attributes']=_[_0x532d('0x3c')](_0x11a553[_0x532d('0x38')],qs[_0x532d('0x3d')](_0x4980fc['query'][_0x532d('0x3d')]));_0x25be17[_0x532d('0x3b')]=_0x25be17[_0x532d('0x3b')]['length']?_0x25be17[_0x532d('0x3b')]:_0x11a553[_0x532d('0x38')];if(_0x4980fc['query']['includeAll']){_0x25be17[_0x532d('0x4d')]=[{'all':!![]}];}_0x25be17=_[_0x532d('0x44')]({},_0x25be17,_0x4980fc[_0x532d('0x4e')]);return db[_0x532d('0x34')][_0x532d('0x4f')](_0x25be17)['then'](handleEntityNotFound(_0xca980f,null))[_0x532d('0x2d')](respondWithResult(_0xca980f,null))['catch'](handleError(_0xca980f,null));};exports['create']=function(_0x3d17ec,_0x17b046){return db['FaxQueue'][_0x532d('0x50')](_0x3d17ec[_0x532d('0x51')],{})[_0x532d('0x2d')](function(_0x2a50fd){var _0x136b84=_0x3d17ec[_0x532d('0x52')][_0x532d('0x53')]({'plain':!![]});if(!_0x136b84)throw new Error(_0x532d('0x54'));if(_0x136b84[_0x532d('0x55')]===_0x532d('0x52')){var _0x11731a=_0x2a50fd[_0x532d('0x53')]({'plain':!![]});var _0x2247af=_0x532d('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0x2247af,'userProfileId':_0x136b84['userProfileId']},'raw':!![]})[_0x532d('0x2d')](function(_0x492bc9){if(_0x492bc9&&_0x492bc9[_0x532d('0x56')]===0x0){return db[_0x532d('0x57')][_0x532d('0x50')]({'name':_0x11731a['name'],'resourceId':_0x11731a['id'],'type':_0x492bc9[_0x532d('0x30')],'sectionId':_0x492bc9['id']},{})[_0x532d('0x2d')](function(){return _0x2a50fd;});}else{return _0x2a50fd;}})['catch'](function(_0x2ed431){logger[_0x532d('0x58')](_0x532d('0x59'),_0x2ed431);throw _0x2ed431;});}return _0x2a50fd;})[_0x532d('0x2d')](respondWithResult(_0x17b046,0xc9))['catch'](handleError(_0x17b046,null));};exports[_0x532d('0x2c')]=function(_0x12414f,_0x18f25a){if(_0x12414f['body']['id']){delete _0x12414f[_0x532d('0x51')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x12414f[_0x532d('0x4b')]['id']}})[_0x532d('0x2d')](handleEntityNotFound(_0x18f25a,null))[_0x532d('0x2d')](saveUpdates(_0x12414f[_0x532d('0x51')],null))[_0x532d('0x2d')](respondWithResult(_0x18f25a,null))[_0x532d('0x49')](handleError(_0x18f25a,null));};exports[_0x532d('0x2e')]=function(_0x5b6aa2,_0x39e9d5){return db[_0x532d('0x34')][_0x532d('0x4f')]({'where':{'id':_0x5b6aa2[_0x532d('0x4b')]['id']}})[_0x532d('0x2d')](handleEntityNotFound(_0x39e9d5,null))[_0x532d('0x2d')](removeEntity(_0x39e9d5,null))[_0x532d('0x49')](handleError(_0x39e9d5,null));};exports['describe']=function(_0x4d6633,_0x3b01ee){return db[_0x532d('0x34')][_0x532d('0x5a')]()[_0x532d('0x2d')](respondWithResult(_0x3b01ee,null))[_0x532d('0x49')](handleError(_0x3b01ee,null));};exports[_0x532d('0x5b')]=function(_0x221978,_0x3c4891,_0x2467e5){var _0x238c4e={'raw':!![],'where':{}},_0x54b82a={},_0x56dec0;return db[_0x532d('0x34')][_0x532d('0x5c')]({'where':{'id':_0x221978[_0x532d('0x4b')]['id']}})[_0x532d('0x2d')](handleEntityNotFound(_0x3c4891,null))[_0x532d('0x2d')](function(_0x3f55f2){if(_0x3f55f2){_0x56dec0=_0x3f55f2[_0x532d('0x53')]({'plain':!![]});_0x54b82a[_0x532d('0x38')]=_[_0x532d('0x4c')](db['UserFaxQueue']['rawAttributes']);_0x54b82a[_0x532d('0x39')]=_['keys'](_0x221978['query']);_0x54b82a[_0x532d('0x3a')]=_['intersection'](_0x54b82a[_0x532d('0x38')],_0x54b82a['query']);_0x238c4e[_0x532d('0x3b')]=_['intersection'](_0x54b82a['model'],qs[_0x532d('0x3d')](_0x221978[_0x532d('0x39')][_0x532d('0x3d')]));_0x238c4e[_0x532d('0x3b')]=_0x238c4e['attributes'][_0x532d('0x5d')]?_0x238c4e[_0x532d('0x3b')]:_0x54b82a[_0x532d('0x38')];if(!_0x221978['query'][_0x532d('0x3e')](_0x532d('0x3f'))){_0x238c4e['limit']=qs['limit'](_0x221978[_0x532d('0x39')][_0x532d('0x25')]);_0x238c4e[_0x532d('0x24')]=qs[_0x532d('0x24')](_0x221978['query'][_0x532d('0x24')]);}_0x238c4e[_0x532d('0x40')]=qs[_0x532d('0x41')](_0x221978[_0x532d('0x39')][_0x532d('0x41')]);_0x238c4e['where']=qs[_0x532d('0x3a')](_['pick'](_0x221978[_0x532d('0x39')],_0x54b82a[_0x532d('0x3a')]));_0x238c4e[_0x532d('0x42')][_0x532d('0x5e')]=_0x3f55f2['id'];if(_0x221978[_0x532d('0x39')][_0x532d('0x43')]){_0x238c4e[_0x532d('0x42')]=_[_0x532d('0x44')](_0x238c4e[_0x532d('0x42')],{'$or':_['map'](_0x238c4e[_0x532d('0x3b')],function(_0x1de3f7){var _0x2be9fd={};_0x2be9fd[_0x1de3f7]={'$like':'%'+_0x221978[_0x532d('0x39')][_0x532d('0x43')]+'%'};return _0x2be9fd;})});}_0x238c4e=_[_0x532d('0x44')]({},_0x238c4e,_0x221978[_0x532d('0x4e')]);return db[_0x532d('0x5f')][_0x532d('0x47')](_0x238c4e);}})[_0x532d('0x2d')](function(_0x29ffbd){if(_0x29ffbd){return db[_0x532d('0x60')]['findAndCountAll']({'where':{'id':_[_0x532d('0x33')](_0x29ffbd,_0x532d('0x61')),'role':_0x532d('0x62')},'attributes':['id',_0x532d('0x30'),_0x532d('0x63'),_0x532d('0x64'),_0x532d('0x65')]});}})[_0x532d('0x2d')](function(_0xddd191){if(_0xddd191){return{'count':_0xddd191[_0x532d('0x23')],'rows':_[_0x532d('0x33')](_0xddd191[_0x532d('0x48')],function(_0x59a105){return{'membername':_0x59a105['name'],'UserId':_0x59a105['id'],'queue_name':_0x56dec0[_0x532d('0x30')],'FaxQueueId':_0x56dec0['id'],'interface':util[_0x532d('0x66')]('%s/%s',_0x532d('0x67'),_0x59a105[_0x532d('0x30')]),'penalty':0x0,'paused':_0x59a105[_0x532d('0x63')],'createdAt':_0x59a105['createdAt'],'updatedAt':_0x59a105[_0x532d('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x532d('0x2d')](respondWithFilteredResult(_0x3c4891,_0x238c4e))[_0x532d('0x49')](handleError(_0x3c4891,null));};exports[_0x532d('0x68')]=function(_0x18e32f,_0x430b78,_0x263ddc){var _0x4a2682={};var _0x3dedb2={};var _0x38149d;var _0x4ccd25;return db[_0x532d('0x34')][_0x532d('0x5c')]({'where':{'id':_0x18e32f[_0x532d('0x4b')]['id']}})[_0x532d('0x2d')](handleEntityNotFound(_0x430b78,null))[_0x532d('0x2d')](function(_0x1b84b0){if(_0x1b84b0){_0x38149d=_0x1b84b0;_0x3dedb2[_0x532d('0x38')]=_[_0x532d('0x4c')](db['Team'][_0x532d('0x35')]);_0x3dedb2[_0x532d('0x39')]=_['keys'](_0x18e32f['query']);_0x3dedb2[_0x532d('0x3a')]=_[_0x532d('0x3c')](_0x3dedb2['model'],_0x3dedb2[_0x532d('0x39')]);_0x4a2682[_0x532d('0x3b')]=_[_0x532d('0x3c')](_0x3dedb2[_0x532d('0x38')],qs[_0x532d('0x3d')](_0x18e32f[_0x532d('0x39')]['fields']));_0x4a2682[_0x532d('0x3b')]=_0x4a2682['attributes'][_0x532d('0x5d')]?_0x4a2682[_0x532d('0x3b')]:_0x3dedb2[_0x532d('0x38')];_0x4a2682['order']=qs[_0x532d('0x41')](_0x18e32f[_0x532d('0x39')][_0x532d('0x41')]);_0x4a2682['where']=qs[_0x532d('0x3a')](_[_0x532d('0x69')](_0x18e32f[_0x532d('0x39')],_0x3dedb2[_0x532d('0x3a')]));if(_0x18e32f[_0x532d('0x39')][_0x532d('0x43')]){_0x4a2682[_0x532d('0x42')]=_[_0x532d('0x44')](_0x4a2682[_0x532d('0x42')],{'$or':_['map'](_0x4a2682[_0x532d('0x3b')],function(_0x461a61){var _0x5d40d1={};_0x5d40d1[_0x461a61]={'$like':'%'+_0x18e32f['query']['filter']+'%'};return _0x5d40d1;})});}_0x4a2682=_[_0x532d('0x44')]({},_0x4a2682,_0x18e32f['options']);return _0x38149d[_0x532d('0x68')](_0x4a2682);}})[_0x532d('0x2d')](function(_0x31908a){if(_0x31908a){_0x4ccd25=_0x31908a[_0x532d('0x5d')];if(!_0x18e32f[_0x532d('0x39')][_0x532d('0x3e')](_0x532d('0x3f'))){_0x4a2682['limit']=qs['limit'](_0x18e32f['query'][_0x532d('0x25')]);_0x4a2682[_0x532d('0x24')]=qs[_0x532d('0x24')](_0x18e32f[_0x532d('0x39')][_0x532d('0x24')]);}return _0x38149d[_0x532d('0x68')](_0x4a2682);}})['then'](function(_0x449b86){if(_0x449b86){return _0x449b86?{'count':_0x4ccd25,'rows':_0x449b86}:null;}})[_0x532d('0x2d')](respondWithResult(_0x430b78,null))['catch'](handleError(_0x430b78,null));};exports[_0x532d('0x6a')]=function(_0x17d718,_0xfa56b0,_0x1d76f4){var _0x4528f6=_0x17d718[_0x532d('0x51')][_0x532d('0x6b')];return db[_0x532d('0x6c')]['findAll']({'where':{'id':_0x4528f6},'attributes':['id'],'include':[{'model':db[_0x532d('0x60')],'as':_0x532d('0x6d'),'attributes':['id','name',_0x532d('0x6e'),'voicePause',_0x532d('0x6f')],'raw':!![]}]})['then'](function(_0x391fe9){if(_0x391fe9){var _0x311db7=_['flatMap'](_0x391fe9,function(_0x24d47f){var _0x8a4981=_0x24d47f[_0x532d('0x53')]({'plain':!![]});return _0x8a4981[_0x532d('0x6d')];});return db['FaxQueue'][_0x532d('0x4f')]({'where':{'id':_0x17d718['params']['id']}})['then'](function(_0x10f85e){return db[_0x532d('0x70')]['transaction'](function(_0x262a9a){return _0x10f85e[_0x532d('0x6a')](_0x4528f6,{'transaction':_0x262a9a})[_0x532d('0x2d')](function(){return BPromise[_0x532d('0x71')](_0x311db7,function(_0x42aff7){return db[_0x532d('0x5f')][_0x532d('0x72')]({'where':{'UserId':_0x42aff7['id'],'FaxQueueId':_0x17d718['params']['id']},'transaction':_0x262a9a});});})[_0x532d('0x2d')](function(){_0x311db7[_0x532d('0x73')](function(_0x1d827b){socket[_0x532d('0x74')]('userFaxQueue:save',{'UserId':_0x1d827b['id'],'FaxQueueId':_0x10f85e['id']});});});});});}})[_0x532d('0x2d')](respondWithStatusCode(_0xfa56b0,null))[_0x532d('0x49')](handleError(_0xfa56b0,null));};exports[_0x532d('0x75')]=function(_0x37af45,_0x5aad03,_0x16ab34){return db[_0x532d('0x6c')][_0x532d('0x47')]({'where':{'id':_0x37af45[_0x532d('0x39')][_0x532d('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x532d('0x60')],'as':_0x532d('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x532d('0x2d')](handleEntityNotFound(_0x5aad03,null))['then'](function(_0xcc483f){var _0x4754ac=_['map'](_0xcc483f,'id');var _0x58fc9b=[];var _0x2ede35=[];var _0x146558=squel[_0x532d('0x76')]();_0x146558[_0x532d('0x77')](_0x532d('0x78'))[_0x532d('0x79')](_0x532d('0x7a'),'tq')['join'](_0x532d('0x7b'),'ut',_0x532d('0x7c'))[_0x532d('0x42')](_0x532d('0x7d'),_0x37af45['params']['id']);for(var _0x57ad39=0x0;_0x57ad39<_0xcc483f[_0x532d('0x5d')];_0x57ad39+=0x1){let _0x4abc41=_0xcc483f[_0x57ad39];for(var _0x20cf5a=0x0;_0x20cf5a<_0x4abc41[_0x532d('0x6d')][_0x532d('0x5d')];_0x20cf5a+=0x1){let _0x307c39=_0x4abc41[_0x532d('0x6d')][_0x20cf5a];var _0x40a45e=_0x146558[_0x532d('0x7e')]();_0x40a45e['where']('ut.UserId\x20=\x20?',_0x307c39['id']);_0x2ede35['push'](db[_0x532d('0x70')][_0x532d('0x39')](_0x40a45e[_0x532d('0x7f')](),{'type':db['sequelize'][_0x532d('0x80')][_0x532d('0x81')]})['then'](function(_0x579e64){if(_0x579e64[_0x532d('0x5d')]===0x1){return _0x307c39['id'];}else{var _0x56e085=_['every'](_[_0x532d('0x33')](_0x579e64,_0x532d('0x82')),function(_0x21071c){return _[_0x532d('0x83')](_0x4754ac,_0x21071c);});if(_0x56e085){return _0x307c39['id'];}}}));}}return BPromise[_0x532d('0x84')](_0x2ede35)[_0x532d('0x2d')](function(_0xa1516a){_0x58fc9b=_(_0x58fc9b)['union'](_0xa1516a)[_0x532d('0x85')]()['value']();return db['FaxQueue'][_0x532d('0x4f')]({'where':{'id':_0x37af45[_0x532d('0x4b')]['id']}})[_0x532d('0x2d')](function(_0x2e2598){return db[_0x532d('0x70')][_0x532d('0x86')](function(_0x5dc165){return _0x2e2598[_0x532d('0x75')](_0x37af45['query']['ids'],{'transaction':_0x5dc165})[_0x532d('0x2d')](function(){if(!_[_0x532d('0x87')](_0x58fc9b)){return _0x2e2598[_0x532d('0x88')](_0x58fc9b,{'transaction':_0x5dc165});}})[_0x532d('0x2d')](function(){_0x58fc9b[_0x532d('0x73')](function(_0x15cb5e){socket[_0x532d('0x74')](_0x532d('0x89'),{'UserId':_0x15cb5e,'FaxQueueId':_0x2e2598['id']});});});});});});})[_0x532d('0x2d')](respondWithStatusCode(_0x5aad03,null))['catch'](handleError(_0x5aad03,null));};exports['addAgents']=function(_0x354bcb,_0x1a7823,_0xa11426){return db[_0x532d('0x34')][_0x532d('0x4f')]({'where':{'id':_0x354bcb[_0x532d('0x4b')]['id']}})[_0x532d('0x2d')](handleEntityNotFound(_0x1a7823,null))[_0x532d('0x2d')](function(_0x550789){if(_0x550789){return _0x550789['addAgents'](_0x354bcb[_0x532d('0x51')][_0x532d('0x6b')],_[_0x532d('0x8a')](_0x354bcb[_0x532d('0x51')],['ids','id'])||{})[_0x532d('0x8b')](function(_0x2ead04){for(var _0x144979=0x0;_0x144979<_0x354bcb[_0x532d('0x51')]['ids'][_0x532d('0x5d')];_0x144979+=0x1){socket['emit'](_0x532d('0x8c'),{'UserId':_0x354bcb[_0x532d('0x51')][_0x532d('0x6b')][_0x144979],'FaxQueueId':_0x354bcb[_0x532d('0x4b')]['id']});}return _0x2ead04;});}})['then'](respondWithResult(_0x1a7823,null))[_0x532d('0x49')](handleError(_0x1a7823,null));};exports[_0x532d('0x88')]=function(_0x56131e,_0x3cadc2,_0x1dfe82){return db[_0x532d('0x34')][_0x532d('0x4f')]({'where':{'id':_0x56131e[_0x532d('0x4b')]['id']}})[_0x532d('0x2d')](handleEntityNotFound(_0x3cadc2,null))['then'](function(_0x49665b){if(_0x49665b){return _0x49665b['removeAgents'](_0x56131e['query']['ids'])[_0x532d('0x2d')](function(){if(_[_0x532d('0x8d')](_0x56131e[_0x532d('0x39')][_0x532d('0x6b')])){for(var _0x10d487=0x0;_0x10d487<_0x56131e['query'][_0x532d('0x6b')][_0x532d('0x5d')];_0x10d487+=0x1){socket[_0x532d('0x74')](_0x532d('0x89'),{'UserId':Number(_0x56131e[_0x532d('0x39')][_0x532d('0x6b')][_0x10d487]),'FaxQueueId':Number(_0x56131e[_0x532d('0x4b')]['id'])});}}else{socket[_0x532d('0x74')](_0x532d('0x89'),{'UserId':Number(_0x56131e[_0x532d('0x39')][_0x532d('0x6b')]),'FaxQueueId':Number(_0x56131e[_0x532d('0x4b')]['id'])});}});}})[_0x532d('0x2d')](respondWithStatusCode(_0x3cadc2,null))[_0x532d('0x49')](handleError(_0x3cadc2,null));};exports[_0x532d('0x8e')]=function(_0x5a0ea5,_0x40a3c2,_0x1ecb2b){var _0x4631f2={};var _0x1ccb33={};var _0xecc38c;var _0x4b1f37;return db[_0x532d('0x34')][_0x532d('0x5c')]({'where':{'id':_0x5a0ea5[_0x532d('0x4b')]['id']}})[_0x532d('0x2d')](handleEntityNotFound(_0x40a3c2,null))[_0x532d('0x2d')](function(_0x17f02e){if(_0x17f02e){_0xecc38c=_0x17f02e;_0x1ccb33['model']=_[_0x532d('0x4c')](db[_0x532d('0x60')][_0x532d('0x35')]);_0x1ccb33[_0x532d('0x39')]=_['keys'](_0x5a0ea5[_0x532d('0x39')]);_0x1ccb33['filters']=_[_0x532d('0x3c')](_0x1ccb33[_0x532d('0x38')],_0x1ccb33[_0x532d('0x39')]);_0x4631f2[_0x532d('0x3b')]=_[_0x532d('0x3c')](_0x1ccb33[_0x532d('0x38')],qs[_0x532d('0x3d')](_0x5a0ea5[_0x532d('0x39')][_0x532d('0x3d')]));_0x4631f2[_0x532d('0x3b')]=_0x4631f2[_0x532d('0x3b')][_0x532d('0x5d')]?_0x4631f2[_0x532d('0x3b')]:_0x1ccb33[_0x532d('0x38')];_0x4631f2[_0x532d('0x40')]=qs[_0x532d('0x41')](_0x5a0ea5['query'][_0x532d('0x41')]);_0x4631f2[_0x532d('0x42')]=qs['filters'](_[_0x532d('0x69')](_0x5a0ea5[_0x532d('0x39')],_0x1ccb33[_0x532d('0x3a')]));if(_0x5a0ea5[_0x532d('0x39')]['filter']){_0x4631f2[_0x532d('0x42')]=_[_0x532d('0x44')](_0x4631f2[_0x532d('0x42')],{'$or':_[_0x532d('0x33')](_0x4631f2[_0x532d('0x3b')],function(_0x193472){var _0x549be6={};_0x549be6[_0x193472]={'$like':'%'+_0x5a0ea5[_0x532d('0x39')]['filter']+'%'};return _0x549be6;})});}_0x4631f2=_['merge']({},_0x4631f2,_0x5a0ea5[_0x532d('0x4e')]);return _0xecc38c['getAgents'](_0x4631f2);}})[_0x532d('0x2d')](function(_0x402183){if(_0x402183){_0x4b1f37=_0x402183['length'];if(!_0x5a0ea5[_0x532d('0x39')][_0x532d('0x3e')](_0x532d('0x3f'))){_0x4631f2[_0x532d('0x25')]=qs[_0x532d('0x25')](_0x5a0ea5[_0x532d('0x39')][_0x532d('0x25')]);_0x4631f2[_0x532d('0x24')]=qs[_0x532d('0x24')](_0x5a0ea5['query'][_0x532d('0x24')]);}return _0xecc38c[_0x532d('0x8e')](_0x4631f2);}})['then'](function(_0x3a18fc){if(_0x3a18fc){return _0x3a18fc?{'count':_0x4b1f37,'rows':_0x3a18fc}:null;}})[_0x532d('0x2d')](respondWithResult(_0x40a3c2,null))[_0x532d('0x49')](handleError(_0x40a3c2,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index ea0594e..d7fad0c 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 _0xdcea=['FaxQueue','setMaxListeners','update','remove','emit','hook','events','../../mysqldb'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xdcea,0x7e));var _0xadce=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xdcea[_0x4154a6];return _0x3b2786;};'use strict';var EventEmitter=require(_0xadce('0x0'));var FaxQueue=require(_0xadce('0x1'))['db'][_0xadce('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xadce('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xadce('0x4'),'afterDestroy':_0xadce('0x5')};function emitEvent(_0x2ce343){return function(_0x3f5a7c,_0x46ca25,_0x321f15){FaxQueueEvents['emit'](_0x2ce343+':'+_0x3f5a7c['id'],_0x3f5a7c);FaxQueueEvents[_0xadce('0x6')](_0x2ce343,_0x3f5a7c);_0x321f15(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xadce('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x1a2c=['update','emit','hook','exports','../../mysqldb'];(function(_0x10e783,_0x6c0c7c){var _0x55c70a=function(_0x4427d8){while(--_0x4427d8){_0x10e783['push'](_0x10e783['shift']());}};_0x55c70a(++_0x6c0c7c);}(_0x1a2c,0xef));var _0xc1a2=function(_0x54bb41,_0x2c57b8){_0x54bb41=_0x54bb41-0x0;var _0x15393d=_0x1a2c[_0x54bb41];return _0x15393d;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xc1a2('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc1a2('0x1'),'afterDestroy':'remove'};function emitEvent(_0x5c6719){return function(_0x3d20f0,_0x12f268,_0x611d7f){FaxQueueEvents[_0xc1a2('0x2')](_0x5c6719+':'+_0x3d20f0['id'],_0x3d20f0);FaxQueueEvents[_0xc1a2('0x2')](_0x5c6719,_0x3d20f0);_0x611d7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xc1a2('0x3')](e,emitEvent(event));}}module[_0xc1a2('0x4')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index fd3b8e3..3043e5e 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 _0x1e16=['define','fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxQueue.attributes','exports'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0x1e16,0x1f1));var _0x61e1=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0x1e16[_0x1406ae];return _0x23a076;};'use strict';var _=require(_0x61e1('0x0'));var util=require('util');var logger=require(_0x61e1('0x1'))(_0x61e1('0x2'));var moment=require(_0x61e1('0x3'));var BPromise=require(_0x61e1('0x4'));var rp=require(_0x61e1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x61e1('0x6'));var attributes=require(_0x61e1('0x7'));module[_0x61e1('0x8')]=function(_0x3da0ff,_0x29cda4){return _0x3da0ff[_0x61e1('0x9')]('FaxQueue',attributes,{'tableName':_0x61e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ad2=['request-promise','rimraf','../../config/environment','exports','lodash','util','../../config/logger','api','bluebird'];(function(_0x147701,_0x47bf0c){var _0x137c72=function(_0x79b9d9){while(--_0x79b9d9){_0x147701['push'](_0x147701['shift']());}};_0x137c72(++_0x47bf0c);}(_0x9ad2,0x163));var _0x29ad=function(_0x1ae34d,_0x617e53){_0x1ae34d=_0x1ae34d-0x0;var _0x13203e=_0x9ad2[_0x1ae34d];return _0x13203e;};'use strict';var _=require(_0x29ad('0x0'));var util=require(_0x29ad('0x1'));var logger=require(_0x29ad('0x2'))(_0x29ad('0x3'));var moment=require('moment');var BPromise=require(_0x29ad('0x4'));var rp=require(_0x29ad('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x29ad('0x6'));var config=require(_0x29ad('0x7'));var attributes=require('./faxQueue.attributes');module[_0x29ad('0x8')]=function(_0x48e8a,_0x212f4f){return _0x48e8a['define']('FaxQueue',attributes,{'tableName':'fax_queues','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 4f0a4db..31004ec 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 _0xf9d9=['options','raw','where','attributes','limit','include','model','map','ShowFaxQueue','find','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','FaxQueue','findAll'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf9d9,0x11b));var _0x9f9d=function(_0xe7c36a,_0x641105){_0xe7c36a=_0xe7c36a-0x0;var _0x8b1186=_0xf9d9[_0xe7c36a];return _0x8b1186;};'use strict';var _=require('lodash');var util=require(_0x9f9d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f9d('0x1'));var fs=require('fs');var Redis=require(_0x9f9d('0x2'));var db=require(_0x9f9d('0x3'))['db'];var utils=require(_0x9f9d('0x4'));var logger=require(_0x9f9d('0x5'))(_0x9f9d('0x6'));var config=require(_0x9f9d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f9d('0x8')][_0x9f9d('0x9')]({'port':0x232a});config[_0x9f9d('0xa')]=_[_0x9f9d('0xb')](config[_0x9f9d('0xa')],{'host':_0x9f9d('0xc'),'port':0x18eb});var socket=require(_0x9f9d('0xd'))(new Redis(config[_0x9f9d('0xa')]));require(_0x9f9d('0xe'))[_0x9f9d('0xf')](socket);function respondWithRpcPromise(_0x3d1ed6,_0x5b1e66,_0x4299bd){return new BPromise(function(_0xb9d023,_0x15fea7){return client[_0x9f9d('0x10')](_0x3d1ed6,_0x4299bd)['then'](function(_0x259c5a){logger[_0x9f9d('0x11')](_0x9f9d('0x12'),_0x5b1e66,'request\x20sent');logger[_0x9f9d('0x13')](_0x9f9d('0x14'),_0x5b1e66,'request\x20sent',JSON[_0x9f9d('0x15')](_0x259c5a));if(_0x259c5a[_0x9f9d('0x16')]){if(_0x259c5a[_0x9f9d('0x16')]['code']===0x1f4){logger['error'](_0x9f9d('0x12'),_0x5b1e66,_0x259c5a[_0x9f9d('0x16')][_0x9f9d('0x17')]);return _0x15fea7(_0x259c5a[_0x9f9d('0x16')][_0x9f9d('0x17')]);}logger[_0x9f9d('0x16')](_0x9f9d('0x12'),_0x5b1e66,_0x259c5a[_0x9f9d('0x16')]['message']);return _0xb9d023(_0x259c5a[_0x9f9d('0x16')][_0x9f9d('0x17')]);}else{logger[_0x9f9d('0x11')](_0x9f9d('0x12'),_0x5b1e66,'request\x20sent');_0xb9d023(_0x259c5a[_0x9f9d('0x18')][_0x9f9d('0x17')]);}})[_0x9f9d('0x19')](function(_0x73d3d2){logger[_0x9f9d('0x16')](_0x9f9d('0x12'),_0x5b1e66,_0x73d3d2);_0x15fea7(_0x73d3d2);});});}exports[_0x9f9d('0x1a')]=function(_0x3760df){var _0x181d82=this;return new Promise(function(_0x5f4881,_0x5eeb2d){return db[_0x9f9d('0x1b')][_0x9f9d('0x1c')]({'raw':_0x3760df[_0x9f9d('0x1d')]?_0x3760df[_0x9f9d('0x1d')][_0x9f9d('0x1e')]===undefined?!![]:![]:!![],'where':_0x3760df['options']?_0x3760df[_0x9f9d('0x1d')][_0x9f9d('0x1f')]||null:null,'attributes':_0x3760df[_0x9f9d('0x1d')]?_0x3760df[_0x9f9d('0x1d')][_0x9f9d('0x20')]||null:null,'limit':_0x3760df['options']?_0x3760df[_0x9f9d('0x1d')][_0x9f9d('0x21')]||null:null,'include':_0x3760df[_0x9f9d('0x1d')]?_0x3760df[_0x9f9d('0x1d')][_0x9f9d('0x22')]?_['map'](_0x3760df[_0x9f9d('0x1d')][_0x9f9d('0x22')],function(_0x1e042f){return{'model':db[_0x1e042f[_0x9f9d('0x23')]],'as':_0x1e042f['as'],'attributes':_0x1e042f[_0x9f9d('0x20')],'include':_0x1e042f['include']?_[_0x9f9d('0x24')](_0x1e042f[_0x9f9d('0x22')],function(_0x26157d){return{'model':db[_0x26157d[_0x9f9d('0x23')]],'as':_0x26157d['as'],'attributes':_0x26157d[_0x9f9d('0x20')],'include':_0x26157d['include']?_[_0x9f9d('0x24')](_0x26157d[_0x9f9d('0x22')],function(_0x250b9d){return{'model':db[_0x250b9d[_0x9f9d('0x23')]],'as':_0x250b9d['as'],'attributes':_0x250b9d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x372e1c){logger[_0x9f9d('0x11')](_0x9f9d('0x1a'),_0x3760df);logger[_0x9f9d('0x13')](_0x9f9d('0x1a'),_0x3760df,JSON[_0x9f9d('0x15')](_0x372e1c));_0x5f4881(_0x372e1c);})[_0x9f9d('0x19')](function(_0x249748){logger[_0x9f9d('0x16')](_0x9f9d('0x1a'),_0x249748[_0x9f9d('0x17')],_0x3760df);_0x5eeb2d(_0x181d82[_0x9f9d('0x16')](0x1f4,_0x249748[_0x9f9d('0x17')]));});});};exports[_0x9f9d('0x25')]=function(_0x5e750b){var _0x1c52fe=this;return new Promise(function(_0x2d09b5,_0x35b5a5){return db[_0x9f9d('0x1b')][_0x9f9d('0x26')]({'raw':_0x5e750b[_0x9f9d('0x1d')]?_0x5e750b[_0x9f9d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5e750b[_0x9f9d('0x1d')]?_0x5e750b[_0x9f9d('0x1d')][_0x9f9d('0x1f')]||null:null,'attributes':_0x5e750b[_0x9f9d('0x1d')]?_0x5e750b['options']['attributes']||null:null,'include':_0x5e750b['options']?_0x5e750b['options']['include']?_[_0x9f9d('0x24')](_0x5e750b[_0x9f9d('0x1d')][_0x9f9d('0x22')],function(_0x5c1e18){return{'model':db[_0x5c1e18['model']],'as':_0x5c1e18['as'],'attributes':_0x5c1e18[_0x9f9d('0x20')],'include':_0x5c1e18['include']?_[_0x9f9d('0x24')](_0x5c1e18[_0x9f9d('0x22')],function(_0x793152){return{'model':db[_0x793152['model']],'as':_0x793152['as'],'attributes':_0x793152[_0x9f9d('0x20')],'include':_0x793152[_0x9f9d('0x22')]?_[_0x9f9d('0x24')](_0x793152['include'],function(_0xfb446c){return{'model':db[_0xfb446c[_0x9f9d('0x23')]],'as':_0xfb446c['as'],'attributes':_0xfb446c[_0x9f9d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26c8f9){logger[_0x9f9d('0x11')]('ShowFaxQueue',_0x5e750b);logger[_0x9f9d('0x13')](_0x9f9d('0x25'),_0x5e750b,JSON[_0x9f9d('0x15')](_0x26c8f9));_0x2d09b5(_0x26c8f9);})['catch'](function(_0x1a424c){logger[_0x9f9d('0x16')](_0x9f9d('0x25'),_0x1a424c['message'],_0x5e750b);_0x35b5a5(_0x1c52fe[_0x9f9d('0x16')](0x1f4,_0x1a424c['message']));});});}; \ No newline at end of file +var _0xd069=['where','limit','include','map','model','attributes','ShowFaxQueue','find','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','options','raw'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd069,0x10b));var _0x9d06=function(_0x9ce749,_0x38b8cf){_0x9ce749=_0x9ce749-0x0;var _0x3d2c62=_0xd069[_0x9ce749];return _0x3d2c62;};'use strict';var _=require(_0x9d06('0x0'));var util=require(_0x9d06('0x1'));var moment=require('moment');var BPromise=require(_0x9d06('0x2'));var rs=require(_0x9d06('0x3'));var fs=require('fs');var Redis=require(_0x9d06('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9d06('0x5'))(_0x9d06('0x6'));var config=require('../../config/environment');var jayson=require(_0x9d06('0x7'));var client=jayson[_0x9d06('0x8')][_0x9d06('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9d06('0xa')],{'host':_0x9d06('0xb'),'port':0x18eb});var socket=require(_0x9d06('0xc'))(new Redis(config['redis']));require(_0x9d06('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e288a,_0x3ae2ff,_0x2ac997){return new BPromise(function(_0xe595a1,_0x57f9fb){return client['request'](_0x2e288a,_0x2ac997)[_0x9d06('0xe')](function(_0x238db3){logger[_0x9d06('0xf')](_0x9d06('0x10'),_0x3ae2ff,_0x9d06('0x11'));logger[_0x9d06('0x12')](_0x9d06('0x13'),_0x3ae2ff,_0x9d06('0x11'),JSON[_0x9d06('0x14')](_0x238db3));if(_0x238db3[_0x9d06('0x15')]){if(_0x238db3[_0x9d06('0x15')][_0x9d06('0x16')]===0x1f4){logger[_0x9d06('0x15')](_0x9d06('0x10'),_0x3ae2ff,_0x238db3[_0x9d06('0x15')][_0x9d06('0x17')]);return _0x57f9fb(_0x238db3[_0x9d06('0x15')][_0x9d06('0x17')]);}logger[_0x9d06('0x15')](_0x9d06('0x10'),_0x3ae2ff,_0x238db3[_0x9d06('0x15')][_0x9d06('0x17')]);return _0xe595a1(_0x238db3[_0x9d06('0x15')][_0x9d06('0x17')]);}else{logger['info'](_0x9d06('0x10'),_0x3ae2ff,_0x9d06('0x11'));_0xe595a1(_0x238db3['result'][_0x9d06('0x17')]);}})[_0x9d06('0x18')](function(_0x572940){logger['error'](_0x9d06('0x10'),_0x3ae2ff,_0x572940);_0x57f9fb(_0x572940);});});}exports[_0x9d06('0x19')]=function(_0x2ea221){var _0xb10610=this;return new Promise(function(_0x55dd98,_0x31d884){return db[_0x9d06('0x1a')]['findAll']({'raw':_0x2ea221[_0x9d06('0x1b')]?_0x2ea221['options'][_0x9d06('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ea221[_0x9d06('0x1b')]?_0x2ea221[_0x9d06('0x1b')][_0x9d06('0x1d')]||null:null,'attributes':_0x2ea221[_0x9d06('0x1b')]?_0x2ea221[_0x9d06('0x1b')]['attributes']||null:null,'limit':_0x2ea221[_0x9d06('0x1b')]?_0x2ea221[_0x9d06('0x1b')][_0x9d06('0x1e')]||null:null,'include':_0x2ea221[_0x9d06('0x1b')]?_0x2ea221['options'][_0x9d06('0x1f')]?_[_0x9d06('0x20')](_0x2ea221[_0x9d06('0x1b')][_0x9d06('0x1f')],function(_0x3ae2f0){return{'model':db[_0x3ae2f0[_0x9d06('0x21')]],'as':_0x3ae2f0['as'],'attributes':_0x3ae2f0[_0x9d06('0x22')],'include':_0x3ae2f0[_0x9d06('0x1f')]?_[_0x9d06('0x20')](_0x3ae2f0[_0x9d06('0x1f')],function(_0x5efc3d){return{'model':db[_0x5efc3d[_0x9d06('0x21')]],'as':_0x5efc3d['as'],'attributes':_0x5efc3d[_0x9d06('0x22')],'include':_0x5efc3d['include']?_[_0x9d06('0x20')](_0x5efc3d[_0x9d06('0x1f')],function(_0x26e573){return{'model':db[_0x26e573['model']],'as':_0x26e573['as'],'attributes':_0x26e573[_0x9d06('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9d06('0xe')](function(_0x5a484f){logger['info'](_0x9d06('0x19'),_0x2ea221);logger[_0x9d06('0x12')]('GetFaxQueue',_0x2ea221,JSON['stringify'](_0x5a484f));_0x55dd98(_0x5a484f);})[_0x9d06('0x18')](function(_0x5c59e6){logger[_0x9d06('0x15')](_0x9d06('0x19'),_0x5c59e6['message'],_0x2ea221);_0x31d884(_0xb10610[_0x9d06('0x15')](0x1f4,_0x5c59e6[_0x9d06('0x17')]));});});};exports[_0x9d06('0x23')]=function(_0x601cf4){var _0x20c745=this;return new Promise(function(_0x1ece72,_0x25e887){return db[_0x9d06('0x1a')][_0x9d06('0x24')]({'raw':_0x601cf4[_0x9d06('0x1b')]?_0x601cf4[_0x9d06('0x1b')][_0x9d06('0x1c')]===undefined?!![]:![]:!![],'where':_0x601cf4[_0x9d06('0x1b')]?_0x601cf4[_0x9d06('0x1b')][_0x9d06('0x1d')]||null:null,'attributes':_0x601cf4[_0x9d06('0x1b')]?_0x601cf4[_0x9d06('0x1b')][_0x9d06('0x22')]||null:null,'include':_0x601cf4[_0x9d06('0x1b')]?_0x601cf4[_0x9d06('0x1b')]['include']?_[_0x9d06('0x20')](_0x601cf4[_0x9d06('0x1b')][_0x9d06('0x1f')],function(_0x465a04){return{'model':db[_0x465a04[_0x9d06('0x21')]],'as':_0x465a04['as'],'attributes':_0x465a04[_0x9d06('0x22')],'include':_0x465a04[_0x9d06('0x1f')]?_[_0x9d06('0x20')](_0x465a04[_0x9d06('0x1f')],function(_0x13bc01){return{'model':db[_0x13bc01[_0x9d06('0x21')]],'as':_0x13bc01['as'],'attributes':_0x13bc01[_0x9d06('0x22')],'include':_0x13bc01[_0x9d06('0x1f')]?_[_0x9d06('0x20')](_0x13bc01[_0x9d06('0x1f')],function(_0x36ed23){return{'model':db[_0x36ed23[_0x9d06('0x21')]],'as':_0x36ed23['as'],'attributes':_0x36ed23[_0x9d06('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9d06('0xe')](function(_0x4f7a2f){logger['info'](_0x9d06('0x23'),_0x601cf4);logger[_0x9d06('0x12')](_0x9d06('0x23'),_0x601cf4,JSON[_0x9d06('0x14')](_0x4f7a2f));_0x1ece72(_0x4f7a2f);})[_0x9d06('0x18')](function(_0x13957b){logger['error'](_0x9d06('0x23'),_0x13957b[_0x9d06('0x17')],_0x601cf4);_0x25e887(_0x20c745[_0x9d06('0x15')](0x1f4,_0x13957b[_0x9d06('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 9cd7586..c023b73 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 _0x87b2=['save','remove','update','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x550b23,_0x2a2966){var _0xf6ea1b=function(_0x316004){while(--_0x316004){_0x550b23['push'](_0x550b23['shift']());}};_0xf6ea1b(++_0x2a2966);}(_0x87b2,0xe7));var _0x287b=function(_0x2eb000,_0x434da1){_0x2eb000=_0x2eb000-0x0;var _0x15c1aa=_0x87b2[_0x2eb000];return _0x15c1aa;};'use strict';var FaxQueueEvents=require(_0x287b('0x0'));var events=[_0x287b('0x1'),_0x287b('0x2'),_0x287b('0x3')];function createListener(_0x1ab3d8,_0x1a7bf5){return function(_0x3bb2fc){_0x1a7bf5['emit'](_0x1ab3d8,_0x3bb2fc);};}function removeListener(_0x3097f3,_0x622ad7){return function(){FaxQueueEvents[_0x287b('0x4')](_0x3097f3,_0x622ad7);};}exports[_0x287b('0x5')]=function(_0x29764f){for(var _0x4a3e38=0x0,_0x255344=events[_0x287b('0x6')];_0x4a3e38<_0x255344;_0x4a3e38++){var _0x1f4f8f=events[_0x4a3e38];var _0xeba7ab=createListener(_0x287b('0x7')+_0x1f4f8f,_0x29764f);FaxQueueEvents['on'](_0x1f4f8f,_0xeba7ab);}}; \ No newline at end of file +var _0x0873=['update','removeListener','length','faxQueue:','remove'];(function(_0x19398e,_0x1eff34){var _0x447ed9=function(_0x3ad4e1){while(--_0x3ad4e1){_0x19398e['push'](_0x19398e['shift']());}};_0x447ed9(++_0x1eff34);}(_0x0873,0x13a));var _0x3087=function(_0xe0db4,_0x547a6b){_0xe0db4=_0xe0db4-0x0;var _0xedf019=_0x0873[_0xe0db4];return _0xedf019;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x3087('0x0'),_0x3087('0x1')];function createListener(_0xf122cf,_0x17be81){return function(_0x43bd16){_0x17be81['emit'](_0xf122cf,_0x43bd16);};}function removeListener(_0x199850,_0x4d907f){return function(){FaxQueueEvents[_0x3087('0x2')](_0x199850,_0x4d907f);};}exports['register']=function(_0x4b0732){for(var _0x2d1e08=0x0,_0x1c8fa4=events[_0x3087('0x3')];_0x2d1e08<_0x1c8fa4;_0x2d1e08++){var _0x563194=events[_0x2d1e08];var _0x3e5563=createListener(_0x3087('0x4')+_0x563194,_0x4b0732);FaxQueueEvents['on'](_0x563194,_0x3e5563);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2a4acc6..bd56062 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x1b1e67,_0x16b059){var _0x5b63d2=function(_0xbc8f7e){while(--_0xbc8f7e){_0x1b1e67['push'](_0x1b1e67['shift']());}};_0x5b63d2(++_0x16b059);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file +var _0x0b0e=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','multer'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2e2f84,_0x24e46f){_0x2e2f84=_0x2e2f84-0x0;var _0x448191=_0x0b0e[_0x2e2f84];return _0x448191;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['get'](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['getMembers']);router[_0xe0b0('0x8')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x8')](_0xe0b0('0x11'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')]('/:id/teams',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x15')]);router[_0xe0b0('0x13')](_0xe0b0('0x11'),auth[_0xe0b0('0x9')](),controller['addAgents']);router[_0xe0b0('0x16')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x17')]);router['delete'](_0xe0b0('0xc'),auth['isAuthenticated'](),controller[_0xe0b0('0x18')]);router[_0xe0b0('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe0b0('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xe0b0('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 911e453..6299ecd 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 _0xd345=['DATE','sequelize','exports','STRING'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xd345,0xf1));var _0x5d34=function(_0x299383,_0x471baf){_0x299383=_0x299383-0x0;var _0x4402a7=_0xd345[_0x299383];return _0x4402a7;};'use strict';var moment=require('moment');var Sequelize=require(_0x5d34('0x0'));module[_0x5d34('0x1')]={'uniqueid':{'type':Sequelize[_0x5d34('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5d34('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5d34('0x3')]},'acceptAt':{'type':Sequelize[_0x5d34('0x3')]},'exitAt':{'type':Sequelize[_0x5d34('0x3')]},'reason':{'type':Sequelize[_0x5d34('0x2')]}}; \ No newline at end of file +var _0xa5a8=['DATE','STRING','exports'];(function(_0x46a67f,_0x5402fe){var _0x4fba78=function(_0x4eafa8){while(--_0x4eafa8){_0x46a67f['push'](_0x46a67f['shift']());}};_0x4fba78(++_0x5402fe);}(_0xa5a8,0x173));var _0x8a5a=function(_0xdbb595,_0x1b1a0b){_0xdbb595=_0xdbb595-0x0;var _0xdf6aa8=_0xa5a8[_0xdbb595];return _0xdf6aa8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x8a5a('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8a5a('0x1')]},'leaveAt':{'type':Sequelize[_0x8a5a('0x1')]},'acceptAt':{'type':Sequelize[_0x8a5a('0x1')]},'exitAt':{'type':Sequelize[_0x8a5a('0x1')]},'reason':{'type':Sequelize[_0x8a5a('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 8bc6398..363f2f4 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 _0x4d14=['include','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','update','then','stack','name','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','rows','catch','show','params','includeAll'];(function(_0x7ad297,_0x5756f8){var _0x23a60f=function(_0x3ab288){while(--_0x3ab288){_0x7ad297['push'](_0x7ad297['shift']());}};_0x23a60f(++_0x5756f8);}(_0x4d14,0x1b6));var _0x44d1=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4d14[_0x1cc8fe];return _0x230054;};'use strict';var pdf=require(_0x44d1('0x0'));var emlformat=require(_0x44d1('0x1'));var rimraf=require(_0x44d1('0x2'));var zipdir=require(_0x44d1('0x3'));var jsonpatch=require(_0x44d1('0x4'));var rp=require(_0x44d1('0x5'));var moment=require(_0x44d1('0x6'));var BPromise=require(_0x44d1('0x7'));var Mustache=require(_0x44d1('0x8'));var util=require(_0x44d1('0x9'));var path=require(_0x44d1('0xa'));var sox=require(_0x44d1('0xb'));var csv=require(_0x44d1('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x44d1('0xd'));var squel=require(_0x44d1('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x44d1('0xf'));var toCsv=require(_0x44d1('0xc'));var querystring=require('querystring');var Papa=require(_0x44d1('0x10'));var Redis=require(_0x44d1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x44d1('0x12'));var as=require(_0x44d1('0x13'));var hardwareService=require(_0x44d1('0x14'));var logger=require(_0x44d1('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x44d1('0x16'));var db=require(_0x44d1('0x17'))['db'];function respondWithStatusCode(_0x53c79c,_0x449230){_0x449230=_0x449230||0xcc;return function(_0x3cb326){if(_0x3cb326){return _0x53c79c[_0x44d1('0x18')](_0x449230);}return _0x53c79c[_0x44d1('0x19')](_0x449230)['end']();};}function respondWithResult(_0x15f0e7,_0xd6766a){_0xd6766a=_0xd6766a||0xc8;return function(_0x9296be){if(_0x9296be){return _0x15f0e7['status'](_0xd6766a)['json'](_0x9296be);}};}function respondWithFilteredResult(_0x20b4a5,_0x3f60f6){return function(_0x396c8d){if(_0x396c8d){var _0x48f7c6=_0x396c8d[_0x44d1('0x1a')],_0x2d0607=_0x3f60f6[_0x44d1('0x1b')],_0xd74a53=_0x3f60f6[_0x44d1('0x1b')]+_0x3f60f6[_0x44d1('0x1c')],_0x5393f2;if(_0xd74a53>=_0x48f7c6){_0xd74a53=_0x48f7c6;_0x5393f2=0xc8;}else{_0x5393f2=0xce;}_0x20b4a5[_0x44d1('0x19')](_0x5393f2);return _0x20b4a5[_0x44d1('0x1d')]('Content-Range',_0x2d0607+'-'+_0xd74a53+'/'+_0x48f7c6)[_0x44d1('0x1e')](_0x396c8d);}return null;};}function patchUpdates(_0x4205e3){return function(_0x4bc38c){try{jsonpatch[_0x44d1('0x1f')](_0x4bc38c,_0x4205e3,!![]);}catch(_0x268256){return BPromise[_0x44d1('0x20')](_0x268256);}return _0x4bc38c['save']();};}function saveUpdates(_0x2b9f76,_0x2ef1ce){return function(_0x217e22){if(_0x217e22){return _0x217e22[_0x44d1('0x21')](_0x2b9f76)[_0x44d1('0x22')](function(_0x36305e){return _0x36305e;});}return null;};}function removeEntity(_0x379fdd,_0x3869ae){return function(_0x3d067d){if(_0x3d067d){return _0x3d067d['destroy']()['then'](function(){_0x379fdd[_0x44d1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x209980,_0x5ee3d0){return function(_0x281c01){if(!_0x281c01){_0x209980['sendStatus'](0x194);}return _0x281c01;};}function handleError(_0xc7f75a,_0x469979){_0x469979=_0x469979||0x1f4;return function(_0xee8b22){logger['error'](_0xee8b22[_0x44d1('0x23')]);if(_0xee8b22[_0x44d1('0x24')]){delete _0xee8b22[_0x44d1('0x24')];}_0xc7f75a[_0x44d1('0x19')](_0x469979)['send'](_0xee8b22);};}exports[_0x44d1('0x25')]=function(_0x20677a,_0x56d9ce){var _0x49c259={},_0x14c01f={},_0x2eb18d={'count':0x0,'rows':[]};var _0x3fb692=_['map'](db[_0x44d1('0x26')][_0x44d1('0x27')],function(_0x48ae09){return{'name':_0x48ae09[_0x44d1('0x28')],'type':_0x48ae09[_0x44d1('0x29')][_0x44d1('0x2a')]};});_0x14c01f[_0x44d1('0x2b')]=_['map'](_0x3fb692,_0x44d1('0x24'));_0x14c01f[_0x44d1('0x2c')]=_[_0x44d1('0x2d')](_0x20677a[_0x44d1('0x2c')]);_0x14c01f[_0x44d1('0x2e')]=_[_0x44d1('0x2f')](_0x14c01f[_0x44d1('0x2b')],_0x14c01f[_0x44d1('0x2c')]);_0x49c259[_0x44d1('0x30')]=_[_0x44d1('0x2f')](_0x14c01f['model'],qs['fields'](_0x20677a['query'][_0x44d1('0x31')]));_0x49c259['attributes']=_0x49c259[_0x44d1('0x30')][_0x44d1('0x32')]?_0x49c259[_0x44d1('0x30')]:_0x14c01f['model'];if(!_0x20677a['query']['hasOwnProperty'](_0x44d1('0x33'))){_0x49c259[_0x44d1('0x1c')]=qs['limit'](_0x20677a[_0x44d1('0x2c')][_0x44d1('0x1c')]);_0x49c259[_0x44d1('0x1b')]=qs['offset'](_0x20677a['query']['offset']);}_0x49c259[_0x44d1('0x34')]=qs[_0x44d1('0x35')](_0x20677a[_0x44d1('0x2c')][_0x44d1('0x35')]);_0x49c259['where']=qs[_0x44d1('0x2e')](_[_0x44d1('0x36')](_0x20677a['query'],_0x14c01f[_0x44d1('0x2e')]));if(_0x20677a[_0x44d1('0x2c')][_0x44d1('0x37')]){_0x49c259[_0x44d1('0x38')]=_['merge'](_0x49c259[_0x44d1('0x38')],{'$or':_[_0x44d1('0x39')](_0x3fb692,function(_0x3d9201){if(_0x3d9201['type']!==_0x44d1('0x3a')){var _0xd4864c={};_0xd4864c[_0x3d9201[_0x44d1('0x24')]]={'$like':'%'+_0x20677a[_0x44d1('0x2c')][_0x44d1('0x37')]+'%'};return _0xd4864c;}})});}_0x49c259=_[_0x44d1('0x3b')]({},_0x49c259,_0x20677a[_0x44d1('0x3c')]);var _0x35fb4f={'where':_0x49c259[_0x44d1('0x38')]};return db[_0x44d1('0x26')][_0x44d1('0x1a')](_0x35fb4f)[_0x44d1('0x22')](function(_0x302218){_0x2eb18d[_0x44d1('0x1a')]=_0x302218;if(_0x20677a[_0x44d1('0x2c')]['includeAll']){_0x49c259['include']=[{'all':!![]}];}return db[_0x44d1('0x26')]['findAll'](_0x49c259);})[_0x44d1('0x22')](function(_0x34ed6b){_0x2eb18d[_0x44d1('0x3d')]=_0x34ed6b;return _0x2eb18d;})[_0x44d1('0x22')](respondWithFilteredResult(_0x56d9ce,_0x49c259))[_0x44d1('0x3e')](handleError(_0x56d9ce,null));};exports[_0x44d1('0x3f')]=function(_0x169d5d,_0x18bc16){var _0x56483f={'raw':!![],'where':{'id':_0x169d5d[_0x44d1('0x40')]['id']}},_0x167b45={};_0x167b45[_0x44d1('0x2b')]=_[_0x44d1('0x2d')](db[_0x44d1('0x26')][_0x44d1('0x27')]);_0x167b45[_0x44d1('0x2c')]=_[_0x44d1('0x2d')](_0x169d5d[_0x44d1('0x2c')]);_0x167b45[_0x44d1('0x2e')]=_[_0x44d1('0x2f')](_0x167b45['model'],_0x167b45[_0x44d1('0x2c')]);_0x56483f['attributes']=_[_0x44d1('0x2f')](_0x167b45['model'],qs[_0x44d1('0x31')](_0x169d5d[_0x44d1('0x2c')][_0x44d1('0x31')]));_0x56483f[_0x44d1('0x30')]=_0x56483f['attributes'][_0x44d1('0x32')]?_0x56483f['attributes']:_0x167b45[_0x44d1('0x2b')];if(_0x169d5d['query'][_0x44d1('0x41')]){_0x56483f[_0x44d1('0x42')]=[{'all':!![]}];}_0x56483f=_['merge']({},_0x56483f,_0x169d5d['options']);return db[_0x44d1('0x26')]['find'](_0x56483f)[_0x44d1('0x22')](handleEntityNotFound(_0x18bc16,null))[_0x44d1('0x22')](respondWithResult(_0x18bc16,null))[_0x44d1('0x3e')](handleError(_0x18bc16,null));};exports[_0x44d1('0x43')]=function(_0x486947,_0x5b2b6c){return db['FaxQueueReport']['create'](_0x486947[_0x44d1('0x44')],{})[_0x44d1('0x22')](respondWithResult(_0x5b2b6c,0xc9))[_0x44d1('0x3e')](handleError(_0x5b2b6c,null));};exports[_0x44d1('0x21')]=function(_0x2ceefb,_0x1d6740){if(_0x2ceefb['body']['id']){delete _0x2ceefb[_0x44d1('0x44')]['id'];}return db[_0x44d1('0x26')][_0x44d1('0x45')]({'where':{'id':_0x2ceefb[_0x44d1('0x40')]['id']}})[_0x44d1('0x22')](handleEntityNotFound(_0x1d6740,null))[_0x44d1('0x22')](saveUpdates(_0x2ceefb['body'],null))[_0x44d1('0x22')](respondWithResult(_0x1d6740,null))[_0x44d1('0x3e')](handleError(_0x1d6740,null));};exports[_0x44d1('0x46')]=function(_0x359c53,_0x1c018e){return db[_0x44d1('0x26')][_0x44d1('0x45')]({'where':{'id':_0x359c53[_0x44d1('0x40')]['id']}})[_0x44d1('0x22')](handleEntityNotFound(_0x1c018e,null))[_0x44d1('0x22')](removeEntity(_0x1c018e,null))[_0x44d1('0x3e')](handleError(_0x1c018e,null));};exports[_0x44d1('0x47')]=function(_0x390210,_0x45182c){return db[_0x44d1('0x26')]['describe']()[_0x44d1('0x22')](respondWithResult(_0x45182c,null))['catch'](handleError(_0x45182c,null));}; \ No newline at end of file +var _0xa9a3=['sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','FaxQueueReport','rows','catch','params','keys','fields','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','fieldName','type','model','query','filters','intersection','attributes','nolimit','order'];(function(_0x2d6f7d,_0x5eae44){var _0x53a67c=function(_0x2de20c){while(--_0x2de20c){_0x2d6f7d['push'](_0x2d6f7d['shift']());}};_0x53a67c(++_0x5eae44);}(_0xa9a3,0x8d));var _0x3a9a=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xa9a3[_0x54d4a8];return _0x3b321b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3a9a('0x0'));var rimraf=require(_0x3a9a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a9a('0x2'));var rp=require(_0x3a9a('0x3'));var moment=require('moment');var BPromise=require(_0x3a9a('0x4'));var Mustache=require(_0x3a9a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3a9a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3a9a('0x7'));var squel=require(_0x3a9a('0x8'));var crypto=require(_0x3a9a('0x9'));var jsforce=require(_0x3a9a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3a9a('0xb'));var qs=require(_0x3a9a('0xc'));var as=require(_0x3a9a('0xd'));var hardwareService=require(_0x3a9a('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x3a9a('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ccc28,_0x19bfda){_0x19bfda=_0x19bfda||0xcc;return function(_0x1ca89d){if(_0x1ca89d){return _0x4ccc28[_0x3a9a('0x10')](_0x19bfda);}return _0x4ccc28[_0x3a9a('0x11')](_0x19bfda)[_0x3a9a('0x12')]();};}function respondWithResult(_0x53128b,_0x59ee7d){_0x59ee7d=_0x59ee7d||0xc8;return function(_0x4e5046){if(_0x4e5046){return _0x53128b[_0x3a9a('0x11')](_0x59ee7d)[_0x3a9a('0x13')](_0x4e5046);}};}function respondWithFilteredResult(_0x212e0b,_0x1d7b9e){return function(_0x177236){if(_0x177236){var _0x1e2776=_0x177236['count'],_0x485627=_0x1d7b9e[_0x3a9a('0x14')],_0x45aeec=_0x1d7b9e[_0x3a9a('0x14')]+_0x1d7b9e[_0x3a9a('0x15')],_0xbc7710;if(_0x45aeec>=_0x1e2776){_0x45aeec=_0x1e2776;_0xbc7710=0xc8;}else{_0xbc7710=0xce;}_0x212e0b[_0x3a9a('0x11')](_0xbc7710);return _0x212e0b[_0x3a9a('0x16')](_0x3a9a('0x17'),_0x485627+'-'+_0x45aeec+'/'+_0x1e2776)[_0x3a9a('0x13')](_0x177236);}return null;};}function patchUpdates(_0x40739a){return function(_0x50a8de){try{jsonpatch['apply'](_0x50a8de,_0x40739a,!![]);}catch(_0x7ca53b){return BPromise[_0x3a9a('0x18')](_0x7ca53b);}return _0x50a8de[_0x3a9a('0x19')]();};}function saveUpdates(_0x442c2e,_0x215178){return function(_0x43c6b4){if(_0x43c6b4){return _0x43c6b4[_0x3a9a('0x1a')](_0x442c2e)[_0x3a9a('0x1b')](function(_0x64c625){return _0x64c625;});}return null;};}function removeEntity(_0x16e76d,_0x5264d6){return function(_0x6d8dce){if(_0x6d8dce){return _0x6d8dce[_0x3a9a('0x1c')]()[_0x3a9a('0x1b')](function(){_0x16e76d[_0x3a9a('0x11')](0xcc)[_0x3a9a('0x12')]();});}};}function handleEntityNotFound(_0x4d028a,_0x3db2ad){return function(_0x44cf12){if(!_0x44cf12){_0x4d028a[_0x3a9a('0x10')](0x194);}return _0x44cf12;};}function handleError(_0x3fa43e,_0x1a381e){_0x1a381e=_0x1a381e||0x1f4;return function(_0x560aed){logger[_0x3a9a('0x1d')](_0x560aed['stack']);if(_0x560aed['name']){delete _0x560aed[_0x3a9a('0x1e')];}_0x3fa43e[_0x3a9a('0x11')](_0x1a381e)[_0x3a9a('0x1f')](_0x560aed);};}exports['index']=function(_0x539dde,_0x4bbcb0){var _0x3549f7={},_0x2b57ba={},_0x37cada={'count':0x0,'rows':[]};var _0x8da2ff=_[_0x3a9a('0x20')](db['FaxQueueReport']['rawAttributes'],function(_0x2a4552){return{'name':_0x2a4552[_0x3a9a('0x21')],'type':_0x2a4552[_0x3a9a('0x22')]['key']};});_0x2b57ba[_0x3a9a('0x23')]=_['map'](_0x8da2ff,_0x3a9a('0x1e'));_0x2b57ba['query']=_['keys'](_0x539dde[_0x3a9a('0x24')]);_0x2b57ba[_0x3a9a('0x25')]=_[_0x3a9a('0x26')](_0x2b57ba[_0x3a9a('0x23')],_0x2b57ba['query']);_0x3549f7[_0x3a9a('0x27')]=_[_0x3a9a('0x26')](_0x2b57ba[_0x3a9a('0x23')],qs['fields'](_0x539dde['query']['fields']));_0x3549f7[_0x3a9a('0x27')]=_0x3549f7['attributes']['length']?_0x3549f7[_0x3a9a('0x27')]:_0x2b57ba['model'];if(!_0x539dde[_0x3a9a('0x24')]['hasOwnProperty'](_0x3a9a('0x28'))){_0x3549f7[_0x3a9a('0x15')]=qs['limit'](_0x539dde[_0x3a9a('0x24')][_0x3a9a('0x15')]);_0x3549f7[_0x3a9a('0x14')]=qs[_0x3a9a('0x14')](_0x539dde[_0x3a9a('0x24')][_0x3a9a('0x14')]);}_0x3549f7[_0x3a9a('0x29')]=qs[_0x3a9a('0x2a')](_0x539dde[_0x3a9a('0x24')]['sort']);_0x3549f7[_0x3a9a('0x2b')]=qs[_0x3a9a('0x25')](_[_0x3a9a('0x2c')](_0x539dde['query'],_0x2b57ba[_0x3a9a('0x25')]));if(_0x539dde['query'][_0x3a9a('0x2d')]){_0x3549f7['where']=_[_0x3a9a('0x2e')](_0x3549f7[_0x3a9a('0x2b')],{'$or':_[_0x3a9a('0x20')](_0x8da2ff,function(_0x22fbde){if(_0x22fbde[_0x3a9a('0x22')]!==_0x3a9a('0x2f')){var _0x2c35f7={};_0x2c35f7[_0x22fbde[_0x3a9a('0x1e')]]={'$like':'%'+_0x539dde[_0x3a9a('0x24')][_0x3a9a('0x2d')]+'%'};return _0x2c35f7;}})});}_0x3549f7=_[_0x3a9a('0x2e')]({},_0x3549f7,_0x539dde['options']);var _0x207731={'where':_0x3549f7[_0x3a9a('0x2b')]};return db['FaxQueueReport'][_0x3a9a('0x30')](_0x207731)[_0x3a9a('0x1b')](function(_0x1911f1){_0x37cada[_0x3a9a('0x30')]=_0x1911f1;if(_0x539dde[_0x3a9a('0x24')][_0x3a9a('0x31')]){_0x3549f7[_0x3a9a('0x32')]=[{'all':!![]}];}return db[_0x3a9a('0x33')]['findAll'](_0x3549f7);})[_0x3a9a('0x1b')](function(_0x274f1c){_0x37cada[_0x3a9a('0x34')]=_0x274f1c;return _0x37cada;})[_0x3a9a('0x1b')](respondWithFilteredResult(_0x4bbcb0,_0x3549f7))[_0x3a9a('0x35')](handleError(_0x4bbcb0,null));};exports['show']=function(_0x407247,_0x1eb72e){var _0x3c96d9={'raw':!![],'where':{'id':_0x407247[_0x3a9a('0x36')]['id']}},_0x4d1dec={};_0x4d1dec[_0x3a9a('0x23')]=_[_0x3a9a('0x37')](db[_0x3a9a('0x33')]['rawAttributes']);_0x4d1dec[_0x3a9a('0x24')]=_[_0x3a9a('0x37')](_0x407247[_0x3a9a('0x24')]);_0x4d1dec[_0x3a9a('0x25')]=_['intersection'](_0x4d1dec['model'],_0x4d1dec['query']);_0x3c96d9[_0x3a9a('0x27')]=_[_0x3a9a('0x26')](_0x4d1dec[_0x3a9a('0x23')],qs[_0x3a9a('0x38')](_0x407247['query']['fields']));_0x3c96d9[_0x3a9a('0x27')]=_0x3c96d9[_0x3a9a('0x27')]['length']?_0x3c96d9[_0x3a9a('0x27')]:_0x4d1dec[_0x3a9a('0x23')];if(_0x407247[_0x3a9a('0x24')][_0x3a9a('0x31')]){_0x3c96d9[_0x3a9a('0x32')]=[{'all':!![]}];}_0x3c96d9=_['merge']({},_0x3c96d9,_0x407247['options']);return db[_0x3a9a('0x33')][_0x3a9a('0x39')](_0x3c96d9)[_0x3a9a('0x1b')](handleEntityNotFound(_0x1eb72e,null))[_0x3a9a('0x1b')](respondWithResult(_0x1eb72e,null))['catch'](handleError(_0x1eb72e,null));};exports[_0x3a9a('0x3a')]=function(_0x5241cf,_0x1be855){return db['FaxQueueReport'][_0x3a9a('0x3a')](_0x5241cf[_0x3a9a('0x3b')],{})[_0x3a9a('0x1b')](respondWithResult(_0x1be855,0xc9))[_0x3a9a('0x35')](handleError(_0x1be855,null));};exports[_0x3a9a('0x1a')]=function(_0x253a2e,_0x498240){if(_0x253a2e[_0x3a9a('0x3b')]['id']){delete _0x253a2e[_0x3a9a('0x3b')]['id'];}return db[_0x3a9a('0x33')][_0x3a9a('0x39')]({'where':{'id':_0x253a2e[_0x3a9a('0x36')]['id']}})[_0x3a9a('0x1b')](handleEntityNotFound(_0x498240,null))[_0x3a9a('0x1b')](saveUpdates(_0x253a2e[_0x3a9a('0x3b')],null))[_0x3a9a('0x1b')](respondWithResult(_0x498240,null))['catch'](handleError(_0x498240,null));};exports[_0x3a9a('0x1c')]=function(_0x504614,_0x593462){return db[_0x3a9a('0x33')]['find']({'where':{'id':_0x504614['params']['id']}})[_0x3a9a('0x1b')](handleEntityNotFound(_0x593462,null))['then'](removeEntity(_0x593462,null))[_0x3a9a('0x35')](handleError(_0x593462,null));};exports[_0x3a9a('0x3c')]=function(_0x1877a1,_0x22a4a6){return db['FaxQueueReport']['describe']()[_0x3a9a('0x1b')](respondWithResult(_0x22a4a6,null))[_0x3a9a('0x35')](handleError(_0x22a4a6,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 06e1cca..887af91 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 _0x9cd6=['path','rimraf','../../config/environment','exports','define','FaxQueueReport','report_fax_queue','uniqueid','util','moment','bluebird','request-promise'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x9cd6,0x8c));var _0x69cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9cd6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x69cd('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x69cd('0x1'));var BPromise=require(_0x69cd('0x2'));var rp=require(_0x69cd('0x3'));var fs=require('fs');var path=require(_0x69cd('0x4'));var rimraf=require(_0x69cd('0x5'));var config=require(_0x69cd('0x6'));var attributes=require('./faxQueueReport.attributes');module[_0x69cd('0x7')]=function(_0x429066,_0x400c0f){return _0x429066[_0x69cd('0x8')](_0x69cd('0x9'),attributes,{'tableName':_0x69cd('0xa'),'paranoid':![],'indexes':[{'name':_0x69cd('0xb'),'fields':[_0x69cd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x875d=['report_fax_queue','uniqueid','../../config/logger','moment','bluebird','./faxQueueReport.attributes'];(function(_0x259633,_0x658189){var _0x5b75dc=function(_0xec8034){while(--_0xec8034){_0x259633['push'](_0x259633['shift']());}};_0x5b75dc(++_0x658189);}(_0x875d,0xbc));var _0xd875=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x875d[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd875('0x0'))('api');var moment=require(_0xd875('0x1'));var BPromise=require(_0xd875('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd875('0x3'));module['exports']=function(_0x4e9f1e,_0x1241ad){return _0x4e9f1e['define']('FaxQueueReport',attributes,{'tableName':_0xd875('0x4'),'paranoid':![],'indexes':[{'name':_0xd875('0x5'),'fields':[_0xd875('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 686b2c9..2553724 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 _0x697b=['http','request','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','then','info','UpdateFaxQueueReport','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x697b,0x13e));var _0xb697=function(_0x1a751b,_0x3edb87){_0x1a751b=_0x1a751b-0x0;var _0x276fae=_0x697b[_0x1a751b];return _0x276fae;};'use strict';var _=require(_0xb697('0x0'));var util=require(_0xb697('0x1'));var moment=require(_0xb697('0x2'));var BPromise=require(_0xb697('0x3'));var rs=require(_0xb697('0x4'));var fs=require('fs');var Redis=require(_0xb697('0x5'));var db=require(_0xb697('0x6'))['db'];var utils=require(_0xb697('0x7'));var logger=require(_0xb697('0x8'))(_0xb697('0x9'));var config=require('../../config/environment');var jayson=require(_0xb697('0xa'));var client=jayson[_0xb697('0xb')][_0xb697('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30a42d,_0x3544d1,_0x453cbc){return new BPromise(function(_0x28aa2b,_0x3298fc){return client[_0xb697('0xd')](_0x30a42d,_0x453cbc)['then'](function(_0x5ef062){logger['info'](_0xb697('0xe'),_0x3544d1,_0xb697('0xf'));logger[_0xb697('0x10')](_0xb697('0x11'),_0x3544d1,_0xb697('0xf'),JSON[_0xb697('0x12')](_0x5ef062));if(_0x5ef062[_0xb697('0x13')]){if(_0x5ef062[_0xb697('0x13')]['code']===0x1f4){logger[_0xb697('0x13')](_0xb697('0xe'),_0x3544d1,_0x5ef062[_0xb697('0x13')][_0xb697('0x14')]);return _0x3298fc(_0x5ef062['error']['message']);}logger[_0xb697('0x13')](_0xb697('0xe'),_0x3544d1,_0x5ef062[_0xb697('0x13')]['message']);return _0x28aa2b(_0x5ef062[_0xb697('0x13')]['message']);}else{logger['info'](_0xb697('0xe'),_0x3544d1,_0xb697('0xf'));_0x28aa2b(_0x5ef062[_0xb697('0x15')]['message']);}})[_0xb697('0x16')](function(_0x5471f7){logger[_0xb697('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x3544d1,_0x5471f7);_0x3298fc(_0x5471f7);});});}exports[_0xb697('0x17')]=function(_0x1e711c){var _0x4bc8ab=this;return new Promise(function(_0x330b46,_0x50ff59){return db[_0xb697('0x18')]['create'](_0x1e711c[_0xb697('0x19')],{'raw':_0x1e711c[_0xb697('0x1a')]?_0x1e711c[_0xb697('0x1a')][_0xb697('0x1b')]===undefined?!![]:![]:!![]})[_0xb697('0x1c')](function(_0x2681d9){logger[_0xb697('0x1d')](_0xb697('0x17'),_0x1e711c);logger[_0xb697('0x10')](_0xb697('0x17'),_0x1e711c,JSON[_0xb697('0x12')](_0x2681d9));_0x330b46(_0x2681d9);})['catch'](function(_0x18a014){logger['error'](_0xb697('0x17'),_0x18a014[_0xb697('0x14')],_0x1e711c);_0x50ff59(_0x4bc8ab[_0xb697('0x13')](0x1f4,_0x18a014[_0xb697('0x14')]));});});};exports[_0xb697('0x1e')]=function(_0x530b3e){var _0x415db6=this;return new Promise(function(_0x4ca9df,_0x38823f){return db[_0xb697('0x18')]['update'](_0x530b3e[_0xb697('0x19')],{'raw':_0x530b3e[_0xb697('0x1a')]?_0x530b3e['options'][_0xb697('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x530b3e[_0xb697('0x1a')]?_0x530b3e[_0xb697('0x1a')][_0xb697('0x1f')]||null:null,'attributes':_0x530b3e[_0xb697('0x1a')]?_0x530b3e[_0xb697('0x1a')]['attributes']||null:null,'limit':_0x530b3e[_0xb697('0x1a')]?_0x530b3e[_0xb697('0x1a')][_0xb697('0x20')]||null:null})[_0xb697('0x1c')](function(_0x4c50ed){logger[_0xb697('0x1d')]('UpdateFaxQueueReport',_0x530b3e);logger['debug'](_0xb697('0x1e'),_0x530b3e,JSON[_0xb697('0x12')](_0x4c50ed));_0x4ca9df(_0x4c50ed);})['catch'](function(_0x46aa7a){logger[_0xb697('0x13')](_0xb697('0x1e'),_0x46aa7a[_0xb697('0x14')],_0x530b3e);_0x38823f(_0x415db6[_0xb697('0x13')](0x1f4,_0x46aa7a[_0xb697('0x14')]));});});}; \ No newline at end of file +var _0x79cc=['raw','attributes','limit','UpdateFaxQueueReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','then','stringify','update'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x79cc,0x197));var _0xc79c=function(_0x44044d,_0x10847c){_0x44044d=_0x44044d-0x0;var _0x559cce=_0x79cc[_0x44044d];return _0x559cce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc79c('0x0'));var BPromise=require(_0xc79c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc79c('0x2'));var db=require(_0xc79c('0x3'))['db'];var utils=require(_0xc79c('0x4'));var logger=require(_0xc79c('0x5'))('rpc');var config=require(_0xc79c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc79c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x586739,_0x748fa9,_0x5d1e4a){return new BPromise(function(_0x20a7aa,_0x3ffac3){return client[_0xc79c('0x8')](_0x586739,_0x5d1e4a)['then'](function(_0x28fce5){logger['info'](_0xc79c('0x9'),_0x748fa9,'request\x20sent');logger[_0xc79c('0xa')](_0xc79c('0xb'),_0x748fa9,'request\x20sent',JSON['stringify'](_0x28fce5));if(_0x28fce5[_0xc79c('0xc')]){if(_0x28fce5[_0xc79c('0xc')][_0xc79c('0xd')]===0x1f4){logger['error'](_0xc79c('0x9'),_0x748fa9,_0x28fce5[_0xc79c('0xc')][_0xc79c('0xe')]);return _0x3ffac3(_0x28fce5[_0xc79c('0xc')][_0xc79c('0xe')]);}logger[_0xc79c('0xc')](_0xc79c('0x9'),_0x748fa9,_0x28fce5[_0xc79c('0xc')][_0xc79c('0xe')]);return _0x20a7aa(_0x28fce5['error'][_0xc79c('0xe')]);}else{logger[_0xc79c('0xf')](_0xc79c('0x9'),_0x748fa9,_0xc79c('0x10'));_0x20a7aa(_0x28fce5[_0xc79c('0x11')]['message']);}})[_0xc79c('0x12')](function(_0x9e907a){logger[_0xc79c('0xc')](_0xc79c('0x9'),_0x748fa9,_0x9e907a);_0x3ffac3(_0x9e907a);});});}exports[_0xc79c('0x13')]=function(_0x24de28){var _0x36e624=this;return new Promise(function(_0x478db9,_0x30aa9f){return db[_0xc79c('0x14')][_0xc79c('0x15')](_0x24de28[_0xc79c('0x16')],{'raw':_0x24de28[_0xc79c('0x17')]?_0x24de28['options']['raw']===undefined?!![]:![]:!![]})[_0xc79c('0x18')](function(_0x2d69f0){logger[_0xc79c('0xf')](_0xc79c('0x13'),_0x24de28);logger[_0xc79c('0xa')](_0xc79c('0x13'),_0x24de28,JSON[_0xc79c('0x19')](_0x2d69f0));_0x478db9(_0x2d69f0);})[_0xc79c('0x12')](function(_0x2512a7){logger['error'](_0xc79c('0x13'),_0x2512a7['message'],_0x24de28);_0x30aa9f(_0x36e624['error'](0x1f4,_0x2512a7[_0xc79c('0xe')]));});});};exports['UpdateFaxQueueReport']=function(_0x4a02cc){var _0x31e307=this;return new Promise(function(_0xdb5aea,_0x33df4){return db[_0xc79c('0x14')][_0xc79c('0x1a')](_0x4a02cc[_0xc79c('0x16')],{'raw':_0x4a02cc[_0xc79c('0x17')]?_0x4a02cc[_0xc79c('0x17')][_0xc79c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a02cc[_0xc79c('0x17')]?_0x4a02cc['options']['where']||null:null,'attributes':_0x4a02cc[_0xc79c('0x17')]?_0x4a02cc[_0xc79c('0x17')][_0xc79c('0x1c')]||null:null,'limit':_0x4a02cc[_0xc79c('0x17')]?_0x4a02cc[_0xc79c('0x17')][_0xc79c('0x1d')]||null:null})[_0xc79c('0x18')](function(_0x776035){logger[_0xc79c('0xf')]('UpdateFaxQueueReport',_0x4a02cc);logger['debug'](_0xc79c('0x1e'),_0x4a02cc,JSON[_0xc79c('0x19')](_0x776035));_0xdb5aea(_0x776035);})[_0xc79c('0x12')](function(_0x3920ab){logger[_0xc79c('0xc')](_0xc79c('0x1e'),_0x3920ab[_0xc79c('0xe')],_0x4a02cc);_0x33df4(_0x31e307[_0xc79c('0xc')](0x1f4,_0x3920ab['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 52f4c7e..abcd466 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 _0x35ce=['index','/describe','describe','/:id','post','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x35ce,0x16f));var _0xe35c=function(_0x1be537,_0x2e75b0){_0x1be537=_0x1be537-0x0;var _0x5e2824=_0x35ce[_0x1be537];return _0x5e2824;};'use strict';var multer=require(_0xe35c('0x0'));var util=require(_0xe35c('0x1'));var path=require(_0xe35c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe35c('0x3'));var router=express[_0xe35c('0x4')]();var auth=require(_0xe35c('0x5'));var interaction=require(_0xe35c('0x6'));var config=require(_0xe35c('0x7'));var controller=require(_0xe35c('0x8'));router[_0xe35c('0x9')]('/',auth[_0xe35c('0xa')](),controller[_0xe35c('0xb')]);router[_0xe35c('0x9')](_0xe35c('0xc'),auth[_0xe35c('0xa')](),controller[_0xe35c('0xd')]);router[_0xe35c('0x9')](_0xe35c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xe35c('0xf')]('/',auth[_0xe35c('0xa')](),controller[_0xe35c('0x10')]);router[_0xe35c('0x11')](_0xe35c('0xe'),auth[_0xe35c('0xa')](),controller[_0xe35c('0x12')]);router['delete'](_0xe35c('0xe'),auth['isAuthenticated'](),controller[_0xe35c('0x13')]);module[_0xe35c('0x14')]=router; \ No newline at end of file +var _0x1070=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports'];(function(_0x3fc7ab,_0x2e0139){var _0x3bd90c=function(_0x4d5721){while(--_0x4d5721){_0x3fc7ab['push'](_0x3fc7ab['shift']());}};_0x3bd90c(++_0x2e0139);}(_0x1070,0xdc));var _0x0107=function(_0x540d67,_0x55b317){_0x540d67=_0x540d67-0x0;var _0x33ac80=_0x1070[_0x540d67];return _0x33ac80;};'use strict';var multer=require(_0x0107('0x0'));var util=require(_0x0107('0x1'));var path=require(_0x0107('0x2'));var timeout=require(_0x0107('0x3'));var express=require('express');var router=express[_0x0107('0x4')]();var auth=require(_0x0107('0x5'));var interaction=require(_0x0107('0x6'));var config=require(_0x0107('0x7'));var controller=require('./faxQueueReport.controller');router[_0x0107('0x8')]('/',auth['isAuthenticated'](),controller[_0x0107('0x9')]);router[_0x0107('0x8')](_0x0107('0xa'),auth[_0x0107('0xb')](),controller[_0x0107('0xc')]);router[_0x0107('0x8')](_0x0107('0xd'),auth[_0x0107('0xb')](),controller[_0x0107('0xe')]);router[_0x0107('0xf')]('/',auth[_0x0107('0xb')](),controller[_0x0107('0x10')]);router[_0x0107('0x11')]('/:id',auth[_0x0107('0xb')](),controller['update']);router['delete'](_0x0107('0xd'),auth[_0x0107('0xb')](),controller[_0x0107('0x12')]);module[_0x0107('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 3f9619d..a576ad4 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 _0xf993=['DATE','moment','exports','STRING','ENUM','queue'];(function(_0x2b5ae1,_0x49b4fc){var _0x24112b=function(_0x4b2157){while(--_0x4b2157){_0x2b5ae1['push'](_0x2b5ae1['shift']());}};_0x24112b(++_0x49b4fc);}(_0xf993,0xc1));var _0x3f99=function(_0x30a0de,_0x5b9171){_0x30a0de=_0x30a0de-0x0;var _0x47b87f=_0xf993[_0x30a0de];return _0x47b87f;};'use strict';var moment=require(_0x3f99('0x0'));var Sequelize=require('sequelize');module[_0x3f99('0x1')]={'uniqueid':{'type':Sequelize[_0x3f99('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3f99('0x3')]('account','agent',_0x3f99('0x4')),'allowNull':![],'defaultValue':_0x3f99('0x4')},'transferredAt':{'type':Sequelize[_0x3f99('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x86bf=['ENUM','account','queue','NOW','moment','exports','STRING'];(function(_0x266e57,_0x41125b){var _0x4cdc1d=function(_0x3d3734){while(--_0x3d3734){_0x266e57['push'](_0x266e57['shift']());}};_0x4cdc1d(++_0x41125b);}(_0x86bf,0x9e));var _0xf86b=function(_0x353a37,_0x7fe55e){_0x353a37=_0x353a37-0x0;var _0x4d93c9=_0x86bf[_0x353a37];return _0x4d93c9;};'use strict';var moment=require(_0xf86b('0x0'));var Sequelize=require('sequelize');module[_0xf86b('0x1')]={'uniqueid':{'type':Sequelize[_0xf86b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf86b('0x3')](_0xf86b('0x4'),'agent',_0xf86b('0x5')),'allowNull':![],'defaultValue':_0xf86b('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf86b('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0cc363f..69e0bac 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 _0xf28d=['update','then','stack','name','index','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','FaxTransferReport','rawAttributes','find','create','body','destroy','describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject'];(function(_0x372acd,_0x28d18f){var _0x1f885a=function(_0x53941c){while(--_0x53941c){_0x372acd['push'](_0x372acd['shift']());}};_0x1f885a(++_0x28d18f);}(_0xf28d,0x146));var _0xdf28=function(_0x85e260,_0x5511ab){_0x85e260=_0x85e260-0x0;var _0x11e0e5=_0xf28d[_0x85e260];return _0x11e0e5;};'use strict';var pdf=require(_0xdf28('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdf28('0x1'));var zipdir=require(_0xdf28('0x2'));var jsonpatch=require(_0xdf28('0x3'));var rp=require(_0xdf28('0x4'));var moment=require(_0xdf28('0x5'));var BPromise=require(_0xdf28('0x6'));var Mustache=require(_0xdf28('0x7'));var util=require(_0xdf28('0x8'));var path=require(_0xdf28('0x9'));var sox=require(_0xdf28('0xa'));var csv=require(_0xdf28('0xb'));var ejs=require(_0xdf28('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdf28('0xd'));var crypto=require(_0xdf28('0xe'));var jsforce=require(_0xdf28('0xf'));var deskjs=require(_0xdf28('0x10'));var toCsv=require(_0xdf28('0xb'));var querystring=require(_0xdf28('0x11'));var Papa=require(_0xdf28('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf28('0x13'));var logger=require(_0xdf28('0x14'))(_0xdf28('0x15'));var utils=require(_0xdf28('0x16'));var config=require(_0xdf28('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f8a86,_0x20b179){_0x20b179=_0x20b179||0xcc;return function(_0x1efa39){if(_0x1efa39){return _0x3f8a86[_0xdf28('0x18')](_0x20b179);}return _0x3f8a86[_0xdf28('0x19')](_0x20b179)[_0xdf28('0x1a')]();};}function respondWithResult(_0x50a7e8,_0x18264a){_0x18264a=_0x18264a||0xc8;return function(_0x4eb75a){if(_0x4eb75a){return _0x50a7e8['status'](_0x18264a)[_0xdf28('0x1b')](_0x4eb75a);}};}function respondWithFilteredResult(_0x4b3ba2,_0x292493){return function(_0x331a9d){if(_0x331a9d){var _0x1e6c34=_0x331a9d['count'],_0x555a0e=_0x292493[_0xdf28('0x1c')],_0x32b1ec=_0x292493[_0xdf28('0x1c')]+_0x292493[_0xdf28('0x1d')],_0x26a512;if(_0x32b1ec>=_0x1e6c34){_0x32b1ec=_0x1e6c34;_0x26a512=0xc8;}else{_0x26a512=0xce;}_0x4b3ba2[_0xdf28('0x19')](_0x26a512);return _0x4b3ba2[_0xdf28('0x1e')](_0xdf28('0x1f'),_0x555a0e+'-'+_0x32b1ec+'/'+_0x1e6c34)[_0xdf28('0x1b')](_0x331a9d);}return null;};}function patchUpdates(_0x549129){return function(_0x16f567){try{jsonpatch[_0xdf28('0x20')](_0x16f567,_0x549129,!![]);}catch(_0x3d8171){return BPromise[_0xdf28('0x21')](_0x3d8171);}return _0x16f567['save']();};}function saveUpdates(_0x5b5599,_0x36402c){return function(_0x5e1c03){if(_0x5e1c03){return _0x5e1c03[_0xdf28('0x22')](_0x5b5599)['then'](function(_0x32608e){return _0x32608e;});}return null;};}function removeEntity(_0x19383c,_0x5c2dd0){return function(_0x49e8b8){if(_0x49e8b8){return _0x49e8b8['destroy']()[_0xdf28('0x23')](function(){_0x19383c[_0xdf28('0x19')](0xcc)[_0xdf28('0x1a')]();});}};}function handleEntityNotFound(_0x2579f9,_0xd83b3d){return function(_0x280a9c){if(!_0x280a9c){_0x2579f9[_0xdf28('0x18')](0x194);}return _0x280a9c;};}function handleError(_0x466d42,_0x262d25){_0x262d25=_0x262d25||0x1f4;return function(_0x44e57c){logger['error'](_0x44e57c[_0xdf28('0x24')]);if(_0x44e57c['name']){delete _0x44e57c[_0xdf28('0x25')];}_0x466d42[_0xdf28('0x19')](_0x262d25)['send'](_0x44e57c);};}exports[_0xdf28('0x26')]=function(_0x43cad9,_0x5b0b3e){var _0x261ae0={},_0x3b8d69={},_0x255dc6={'count':0x0,'rows':[]};var _0x4167c7=_['map'](db['FaxTransferReport']['rawAttributes'],function(_0x31fa76){return{'name':_0x31fa76[_0xdf28('0x27')],'type':_0x31fa76[_0xdf28('0x28')][_0xdf28('0x29')]};});_0x3b8d69['model']=_['map'](_0x4167c7,_0xdf28('0x25'));_0x3b8d69[_0xdf28('0x2a')]=_['keys'](_0x43cad9[_0xdf28('0x2a')]);_0x3b8d69[_0xdf28('0x2b')]=_[_0xdf28('0x2c')](_0x3b8d69[_0xdf28('0x2d')],_0x3b8d69[_0xdf28('0x2a')]);_0x261ae0[_0xdf28('0x2e')]=_[_0xdf28('0x2c')](_0x3b8d69[_0xdf28('0x2d')],qs[_0xdf28('0x2f')](_0x43cad9[_0xdf28('0x2a')][_0xdf28('0x2f')]));_0x261ae0[_0xdf28('0x2e')]=_0x261ae0[_0xdf28('0x2e')][_0xdf28('0x30')]?_0x261ae0['attributes']:_0x3b8d69[_0xdf28('0x2d')];if(!_0x43cad9[_0xdf28('0x2a')]['hasOwnProperty'](_0xdf28('0x31'))){_0x261ae0[_0xdf28('0x1d')]=qs[_0xdf28('0x1d')](_0x43cad9[_0xdf28('0x2a')]['limit']);_0x261ae0[_0xdf28('0x1c')]=qs['offset'](_0x43cad9[_0xdf28('0x2a')]['offset']);}_0x261ae0['order']=qs['sort'](_0x43cad9[_0xdf28('0x2a')]['sort']);_0x261ae0[_0xdf28('0x32')]=qs[_0xdf28('0x2b')](_[_0xdf28('0x33')](_0x43cad9[_0xdf28('0x2a')],_0x3b8d69['filters']));if(_0x43cad9[_0xdf28('0x2a')][_0xdf28('0x34')]){_0x261ae0[_0xdf28('0x32')]=_['merge'](_0x261ae0[_0xdf28('0x32')],{'$or':_['map'](_0x4167c7,function(_0x129fef){if(_0x129fef[_0xdf28('0x28')]!==_0xdf28('0x35')){var _0x162bda={};_0x162bda[_0x129fef[_0xdf28('0x25')]]={'$like':'%'+_0x43cad9[_0xdf28('0x2a')][_0xdf28('0x34')]+'%'};return _0x162bda;}})});}_0x261ae0=_[_0xdf28('0x36')]({},_0x261ae0,_0x43cad9[_0xdf28('0x37')]);var _0x460dfc={'where':_0x261ae0[_0xdf28('0x32')]};return db['FaxTransferReport'][_0xdf28('0x38')](_0x460dfc)[_0xdf28('0x23')](function(_0x21156a){_0x255dc6[_0xdf28('0x38')]=_0x21156a;if(_0x43cad9[_0xdf28('0x2a')][_0xdf28('0x39')]){_0x261ae0[_0xdf28('0x3a')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xdf28('0x3b')](_0x261ae0);})[_0xdf28('0x23')](function(_0x5f2094){_0x255dc6[_0xdf28('0x3c')]=_0x5f2094;return _0x255dc6;})[_0xdf28('0x23')](respondWithFilteredResult(_0x5b0b3e,_0x261ae0))[_0xdf28('0x3d')](handleError(_0x5b0b3e,null));};exports[_0xdf28('0x3e')]=function(_0x309d66,_0x4f1f5c){var _0x383656={'raw':!![],'where':{'id':_0x309d66[_0xdf28('0x3f')]['id']}},_0x155967={};_0x155967['model']=_[_0xdf28('0x40')](db[_0xdf28('0x41')][_0xdf28('0x42')]);_0x155967[_0xdf28('0x2a')]=_['keys'](_0x309d66[_0xdf28('0x2a')]);_0x155967[_0xdf28('0x2b')]=_[_0xdf28('0x2c')](_0x155967[_0xdf28('0x2d')],_0x155967[_0xdf28('0x2a')]);_0x383656[_0xdf28('0x2e')]=_[_0xdf28('0x2c')](_0x155967['model'],qs[_0xdf28('0x2f')](_0x309d66[_0xdf28('0x2a')][_0xdf28('0x2f')]));_0x383656[_0xdf28('0x2e')]=_0x383656['attributes'][_0xdf28('0x30')]?_0x383656['attributes']:_0x155967[_0xdf28('0x2d')];if(_0x309d66[_0xdf28('0x2a')][_0xdf28('0x39')]){_0x383656[_0xdf28('0x3a')]=[{'all':!![]}];}_0x383656=_[_0xdf28('0x36')]({},_0x383656,_0x309d66[_0xdf28('0x37')]);return db[_0xdf28('0x41')][_0xdf28('0x43')](_0x383656)[_0xdf28('0x23')](handleEntityNotFound(_0x4f1f5c,null))[_0xdf28('0x23')](respondWithResult(_0x4f1f5c,null))['catch'](handleError(_0x4f1f5c,null));};exports['create']=function(_0x52fe1f,_0x481a93){return db[_0xdf28('0x41')][_0xdf28('0x44')](_0x52fe1f[_0xdf28('0x45')],{})[_0xdf28('0x23')](respondWithResult(_0x481a93,0xc9))['catch'](handleError(_0x481a93,null));};exports[_0xdf28('0x22')]=function(_0x4db69a,_0x5ad1fb){if(_0x4db69a[_0xdf28('0x45')]['id']){delete _0x4db69a['body']['id'];}return db[_0xdf28('0x41')][_0xdf28('0x43')]({'where':{'id':_0x4db69a[_0xdf28('0x3f')]['id']}})[_0xdf28('0x23')](handleEntityNotFound(_0x5ad1fb,null))[_0xdf28('0x23')](saveUpdates(_0x4db69a['body'],null))['then'](respondWithResult(_0x5ad1fb,null))[_0xdf28('0x3d')](handleError(_0x5ad1fb,null));};exports[_0xdf28('0x46')]=function(_0x946dc4,_0x2bd429){return db['FaxTransferReport']['find']({'where':{'id':_0x946dc4[_0xdf28('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2bd429,null))['then'](removeEntity(_0x2bd429,null))[_0xdf28('0x3d')](handleError(_0x2bd429,null));};exports[_0xdf28('0x47')]=function(_0x3a99f7,_0x54ee01){return db['FaxTransferReport'][_0xdf28('0x47')]()[_0xdf28('0x23')](respondWithResult(_0x54ee01,null))[_0xdf28('0x3d')](handleError(_0x54ee01,null));}; \ No newline at end of file +var _0xd173=['moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','show','params','keys','length','include','options','find','catch','create','body','describe','html-pdf','zip-dir','fast-json-patch','request-promise'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0xd173,0x16e));var _0x3d17=function(_0x2b57fc,_0x38ee94){_0x2b57fc=_0x2b57fc-0x0;var _0xbd2b39=_0xd173[_0x2b57fc];return _0xbd2b39;};'use strict';var pdf=require(_0x3d17('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3d17('0x1'));var jsonpatch=require(_0x3d17('0x2'));var rp=require(_0x3d17('0x3'));var moment=require(_0x3d17('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d17('0x5'));var util=require(_0x3d17('0x6'));var path=require(_0x3d17('0x7'));var sox=require(_0x3d17('0x8'));var csv=require(_0x3d17('0x9'));var ejs=require(_0x3d17('0xa'));var fs=require('fs');var _=require(_0x3d17('0xb'));var squel=require('squel');var crypto=require(_0x3d17('0xc'));var jsforce=require(_0x3d17('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3d17('0x9'));var querystring=require(_0x3d17('0xe'));var Papa=require(_0x3d17('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3d17('0x10'));var hardwareService=require(_0x3d17('0x11'));var logger=require('../../config/logger')(_0x3d17('0x12'));var utils=require(_0x3d17('0x13'));var config=require(_0x3d17('0x14'));var db=require(_0x3d17('0x15'))['db'];function respondWithStatusCode(_0x160425,_0x929b04){_0x929b04=_0x929b04||0xcc;return function(_0x534e03){if(_0x534e03){return _0x160425['sendStatus'](_0x929b04);}return _0x160425[_0x3d17('0x16')](_0x929b04)[_0x3d17('0x17')]();};}function respondWithResult(_0x28f373,_0x1be267){_0x1be267=_0x1be267||0xc8;return function(_0x37535f){if(_0x37535f){return _0x28f373[_0x3d17('0x16')](_0x1be267)[_0x3d17('0x18')](_0x37535f);}};}function respondWithFilteredResult(_0x4690b0,_0x258243){return function(_0x2f647e){if(_0x2f647e){var _0x4509a8=_0x2f647e['count'],_0x1540c6=_0x258243['offset'],_0x5d4b7c=_0x258243[_0x3d17('0x19')]+_0x258243[_0x3d17('0x1a')],_0x2d59d4;if(_0x5d4b7c>=_0x4509a8){_0x5d4b7c=_0x4509a8;_0x2d59d4=0xc8;}else{_0x2d59d4=0xce;}_0x4690b0[_0x3d17('0x16')](_0x2d59d4);return _0x4690b0[_0x3d17('0x1b')](_0x3d17('0x1c'),_0x1540c6+'-'+_0x5d4b7c+'/'+_0x4509a8)[_0x3d17('0x18')](_0x2f647e);}return null;};}function patchUpdates(_0x1c5b20){return function(_0xae201a){try{jsonpatch[_0x3d17('0x1d')](_0xae201a,_0x1c5b20,!![]);}catch(_0x39657d){return BPromise[_0x3d17('0x1e')](_0x39657d);}return _0xae201a[_0x3d17('0x1f')]();};}function saveUpdates(_0x4f14ce,_0x4f7cee){return function(_0xff7d7b){if(_0xff7d7b){return _0xff7d7b[_0x3d17('0x20')](_0x4f14ce)[_0x3d17('0x21')](function(_0x48eabd){return _0x48eabd;});}return null;};}function removeEntity(_0x185ee8,_0x375e73){return function(_0xff17fb){if(_0xff17fb){return _0xff17fb[_0x3d17('0x22')]()[_0x3d17('0x21')](function(){_0x185ee8[_0x3d17('0x16')](0xcc)[_0x3d17('0x17')]();});}};}function handleEntityNotFound(_0x3c0c5a,_0x2bec11){return function(_0x3f2621){if(!_0x3f2621){_0x3c0c5a[_0x3d17('0x23')](0x194);}return _0x3f2621;};}function handleError(_0x1f9f83,_0x5dfcbe){_0x5dfcbe=_0x5dfcbe||0x1f4;return function(_0x214f80){logger[_0x3d17('0x24')](_0x214f80[_0x3d17('0x25')]);if(_0x214f80[_0x3d17('0x26')]){delete _0x214f80[_0x3d17('0x26')];}_0x1f9f83[_0x3d17('0x16')](_0x5dfcbe)[_0x3d17('0x27')](_0x214f80);};}exports['index']=function(_0x363041,_0x734e53){var _0x13e397={},_0x383f67={},_0x33fb64={'count':0x0,'rows':[]};var _0x1e7dd2=_[_0x3d17('0x28')](db[_0x3d17('0x29')][_0x3d17('0x2a')],function(_0x52da01){return{'name':_0x52da01[_0x3d17('0x2b')],'type':_0x52da01[_0x3d17('0x2c')][_0x3d17('0x2d')]};});_0x383f67[_0x3d17('0x2e')]=_[_0x3d17('0x28')](_0x1e7dd2,_0x3d17('0x26'));_0x383f67[_0x3d17('0x2f')]=_['keys'](_0x363041[_0x3d17('0x2f')]);_0x383f67[_0x3d17('0x30')]=_[_0x3d17('0x31')](_0x383f67[_0x3d17('0x2e')],_0x383f67[_0x3d17('0x2f')]);_0x13e397['attributes']=_['intersection'](_0x383f67[_0x3d17('0x2e')],qs['fields'](_0x363041['query'][_0x3d17('0x32')]));_0x13e397['attributes']=_0x13e397[_0x3d17('0x33')]['length']?_0x13e397[_0x3d17('0x33')]:_0x383f67[_0x3d17('0x2e')];if(!_0x363041['query'][_0x3d17('0x34')]('nolimit')){_0x13e397[_0x3d17('0x1a')]=qs[_0x3d17('0x1a')](_0x363041[_0x3d17('0x2f')][_0x3d17('0x1a')]);_0x13e397[_0x3d17('0x19')]=qs['offset'](_0x363041[_0x3d17('0x2f')][_0x3d17('0x19')]);}_0x13e397[_0x3d17('0x35')]=qs['sort'](_0x363041[_0x3d17('0x2f')][_0x3d17('0x36')]);_0x13e397[_0x3d17('0x37')]=qs[_0x3d17('0x30')](_[_0x3d17('0x38')](_0x363041[_0x3d17('0x2f')],_0x383f67[_0x3d17('0x30')]));if(_0x363041[_0x3d17('0x2f')][_0x3d17('0x39')]){_0x13e397['where']=_[_0x3d17('0x3a')](_0x13e397[_0x3d17('0x37')],{'$or':_[_0x3d17('0x28')](_0x1e7dd2,function(_0x289059){if(_0x289059[_0x3d17('0x2c')]!==_0x3d17('0x3b')){var _0x1cf072={};_0x1cf072[_0x289059['name']]={'$like':'%'+_0x363041[_0x3d17('0x2f')][_0x3d17('0x39')]+'%'};return _0x1cf072;}})});}_0x13e397=_[_0x3d17('0x3a')]({},_0x13e397,_0x363041['options']);var _0x47739b={'where':_0x13e397['where']};return db[_0x3d17('0x29')]['count'](_0x47739b)[_0x3d17('0x21')](function(_0x2370c6){_0x33fb64[_0x3d17('0x3c')]=_0x2370c6;if(_0x363041[_0x3d17('0x2f')][_0x3d17('0x3d')]){_0x13e397['include']=[{'all':!![]}];}return db[_0x3d17('0x29')][_0x3d17('0x3e')](_0x13e397);})['then'](function(_0x375fbc){_0x33fb64['rows']=_0x375fbc;return _0x33fb64;})[_0x3d17('0x21')](respondWithFilteredResult(_0x734e53,_0x13e397))['catch'](handleError(_0x734e53,null));};exports[_0x3d17('0x3f')]=function(_0x2626c3,_0x400229){var _0x2c50ad={'raw':!![],'where':{'id':_0x2626c3[_0x3d17('0x40')]['id']}},_0x5996df={};_0x5996df[_0x3d17('0x2e')]=_[_0x3d17('0x41')](db[_0x3d17('0x29')]['rawAttributes']);_0x5996df[_0x3d17('0x2f')]=_[_0x3d17('0x41')](_0x2626c3[_0x3d17('0x2f')]);_0x5996df[_0x3d17('0x30')]=_[_0x3d17('0x31')](_0x5996df[_0x3d17('0x2e')],_0x5996df[_0x3d17('0x2f')]);_0x2c50ad[_0x3d17('0x33')]=_[_0x3d17('0x31')](_0x5996df[_0x3d17('0x2e')],qs[_0x3d17('0x32')](_0x2626c3[_0x3d17('0x2f')][_0x3d17('0x32')]));_0x2c50ad[_0x3d17('0x33')]=_0x2c50ad[_0x3d17('0x33')][_0x3d17('0x42')]?_0x2c50ad[_0x3d17('0x33')]:_0x5996df[_0x3d17('0x2e')];if(_0x2626c3[_0x3d17('0x2f')]['includeAll']){_0x2c50ad[_0x3d17('0x43')]=[{'all':!![]}];}_0x2c50ad=_['merge']({},_0x2c50ad,_0x2626c3[_0x3d17('0x44')]);return db[_0x3d17('0x29')][_0x3d17('0x45')](_0x2c50ad)[_0x3d17('0x21')](handleEntityNotFound(_0x400229,null))['then'](respondWithResult(_0x400229,null))[_0x3d17('0x46')](handleError(_0x400229,null));};exports[_0x3d17('0x47')]=function(_0x31c3be,_0x428d2d){return db[_0x3d17('0x29')][_0x3d17('0x47')](_0x31c3be['body'],{})[_0x3d17('0x21')](respondWithResult(_0x428d2d,0xc9))[_0x3d17('0x46')](handleError(_0x428d2d,null));};exports[_0x3d17('0x20')]=function(_0x14471d,_0x5424f9){if(_0x14471d[_0x3d17('0x48')]['id']){delete _0x14471d[_0x3d17('0x48')]['id'];}return db[_0x3d17('0x29')][_0x3d17('0x45')]({'where':{'id':_0x14471d[_0x3d17('0x40')]['id']}})['then'](handleEntityNotFound(_0x5424f9,null))[_0x3d17('0x21')](saveUpdates(_0x14471d[_0x3d17('0x48')],null))[_0x3d17('0x21')](respondWithResult(_0x5424f9,null))['catch'](handleError(_0x5424f9,null));};exports[_0x3d17('0x22')]=function(_0x25fbfb,_0x271ac1){return db['FaxTransferReport'][_0x3d17('0x45')]({'where':{'id':_0x25fbfb[_0x3d17('0x40')]['id']}})['then'](handleEntityNotFound(_0x271ac1,null))[_0x3d17('0x21')](removeEntity(_0x271ac1,null))[_0x3d17('0x46')](handleError(_0x271ac1,null));};exports['describe']=function(_0x20bd0f,_0x4136ec){return db[_0x3d17('0x29')][_0x3d17('0x49')]()['then'](respondWithResult(_0x4136ec,null))[_0x3d17('0x46')](handleError(_0x4136ec,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ca6e5be..3434218 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 _0x704a=['../../config/logger','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define','uniqueid','util'];(function(_0x3c9396,_0x349a9e){var _0x56a7f0=function(_0x1fc660){while(--_0x1fc660){_0x3c9396['push'](_0x3c9396['shift']());}};_0x56a7f0(++_0x349a9e);}(_0x704a,0x13a));var _0xa704=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x704a[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0xa704('0x0'));var logger=require(_0xa704('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa704('0x2'));var fs=require('fs');var path=require(_0xa704('0x3'));var rimraf=require('rimraf');var config=require(_0xa704('0x4'));var attributes=require(_0xa704('0x5'));module[_0xa704('0x6')]=function(_0x27f12b,_0x10ad05){return _0x27f12b[_0xa704('0x7')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xa704('0x8'),'fields':[_0xa704('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd7ad=['define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x43a29d,_0x59e306){var _0x4d67e2=function(_0x368c1f){while(--_0x368c1f){_0x43a29d['push'](_0x43a29d['shift']());}};_0x4d67e2(++_0x59e306);}(_0xd7ad,0x1d4));var _0xdd7a=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0xd7ad[_0x2cc569];return _0x1bfc2e;};'use strict';var _=require(_0xdd7a('0x0'));var util=require(_0xdd7a('0x1'));var logger=require(_0xdd7a('0x2'))(_0xdd7a('0x3'));var moment=require(_0xdd7a('0x4'));var BPromise=require(_0xdd7a('0x5'));var rp=require(_0xdd7a('0x6'));var fs=require('fs');var path=require(_0xdd7a('0x7'));var rimraf=require(_0xdd7a('0x8'));var config=require(_0xdd7a('0x9'));var attributes=require(_0xdd7a('0xa'));module[_0xdd7a('0xb')]=function(_0x3942fd,_0x3f766c){return _0x3942fd[_0xdd7a('0xc')](_0xdd7a('0xd'),attributes,{'tableName':_0xdd7a('0xe'),'paranoid':![],'indexes':[{'name':_0xdd7a('0xf'),'fields':[_0xdd7a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index d7f27da..f223f28 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 _0x0b5a=['../../config/environment','jayson/promise','client','request','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','rpc'];(function(_0x280324,_0x517ad7){var _0x353096=function(_0x22aa21){while(--_0x22aa21){_0x280324['push'](_0x280324['shift']());}};_0x353096(++_0x517ad7);}(_0x0b5a,0x158));var _0xa0b5=function(_0x2b9fbe,_0x331bdc){_0x2b9fbe=_0x2b9fbe-0x0;var _0x50d910=_0x0b5a[_0x2b9fbe];return _0x50d910;};'use strict';var _=require(_0xa0b5('0x0'));var util=require(_0xa0b5('0x1'));var moment=require(_0xa0b5('0x2'));var BPromise=require(_0xa0b5('0x3'));var rs=require(_0xa0b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0b5('0x5'))['db'];var utils=require(_0xa0b5('0x6'));var logger=require('../../config/logger')(_0xa0b5('0x7'));var config=require(_0xa0b5('0x8'));var jayson=require(_0xa0b5('0x9'));var client=jayson[_0xa0b5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27e6cb,_0x26f211,_0x3ea20c){return new BPromise(function(_0x5c9ff0,_0x354ab4){return client[_0xa0b5('0xb')](_0x27e6cb,_0x3ea20c)['then'](function(_0x5adfef){logger[_0xa0b5('0xc')](_0xa0b5('0xd'),_0x26f211,_0xa0b5('0xe'));logger[_0xa0b5('0xf')](_0xa0b5('0x10'),_0x26f211,'request\x20sent',JSON['stringify'](_0x5adfef));if(_0x5adfef[_0xa0b5('0x11')]){if(_0x5adfef[_0xa0b5('0x11')][_0xa0b5('0x12')]===0x1f4){logger['error'](_0xa0b5('0xd'),_0x26f211,_0x5adfef[_0xa0b5('0x11')][_0xa0b5('0x13')]);return _0x354ab4(_0x5adfef['error']['message']);}logger[_0xa0b5('0x11')](_0xa0b5('0xd'),_0x26f211,_0x5adfef[_0xa0b5('0x11')]['message']);return _0x5c9ff0(_0x5adfef[_0xa0b5('0x11')][_0xa0b5('0x13')]);}else{logger['info'](_0xa0b5('0xd'),_0x26f211,_0xa0b5('0xe'));_0x5c9ff0(_0x5adfef[_0xa0b5('0x14')]['message']);}})[_0xa0b5('0x15')](function(_0x54bd23){logger[_0xa0b5('0x11')](_0xa0b5('0xd'),_0x26f211,_0x54bd23);_0x354ab4(_0x54bd23);});});} \ No newline at end of file +var _0x3375=['jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5bd044,_0xafd5fa){var _0x582fd7=function(_0x1accb9){while(--_0x1accb9){_0x5bd044['push'](_0x5bd044['shift']());}};_0x582fd7(++_0xafd5fa);}(_0x3375,0x79));var _0x5337=function(_0xef1f80,_0x516d48){_0xef1f80=_0xef1f80-0x0;var _0x9ea959=_0x3375[_0xef1f80];return _0x9ea959;};'use strict';var _=require(_0x5337('0x0'));var util=require(_0x5337('0x1'));var moment=require(_0x5337('0x2'));var BPromise=require(_0x5337('0x3'));var rs=require(_0x5337('0x4'));var fs=require('fs');var Redis=require(_0x5337('0x5'));var db=require(_0x5337('0x6'))['db'];var utils=require(_0x5337('0x7'));var logger=require(_0x5337('0x8'))(_0x5337('0x9'));var config=require(_0x5337('0xa'));var jayson=require(_0x5337('0xb'));var client=jayson[_0x5337('0xc')][_0x5337('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xdedae3,_0x3e81ca,_0x1d8f1c){return new BPromise(function(_0x3aff3c,_0x11250d){return client[_0x5337('0xe')](_0xdedae3,_0x1d8f1c)[_0x5337('0xf')](function(_0x5f0b71){logger[_0x5337('0x10')](_0x5337('0x11'),_0x3e81ca,_0x5337('0x12'));logger[_0x5337('0x13')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x3e81ca,_0x5337('0x12'),JSON['stringify'](_0x5f0b71));if(_0x5f0b71[_0x5337('0x14')]){if(_0x5f0b71[_0x5337('0x14')]['code']===0x1f4){logger[_0x5337('0x14')](_0x5337('0x11'),_0x3e81ca,_0x5f0b71[_0x5337('0x14')][_0x5337('0x15')]);return _0x11250d(_0x5f0b71['error'][_0x5337('0x15')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x3e81ca,_0x5f0b71[_0x5337('0x14')][_0x5337('0x15')]);return _0x3aff3c(_0x5f0b71[_0x5337('0x14')][_0x5337('0x15')]);}else{logger[_0x5337('0x10')](_0x5337('0x11'),_0x3e81ca,_0x5337('0x12'));_0x3aff3c(_0x5f0b71['result'][_0x5337('0x15')]);}})['catch'](function(_0x2d7a7){logger['error'](_0x5337('0x11'),_0x3e81ca,_0x2d7a7);_0x11250d(_0x2d7a7);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 306878f..fe001e8 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 _0x9254=['show','post','put','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','get','/describe','describe','/:id'];(function(_0x1891d0,_0x45411f){var _0x8a9f66=function(_0xa6c533){while(--_0xa6c533){_0x1891d0['push'](_0x1891d0['shift']());}};_0x8a9f66(++_0x45411f);}(_0x9254,0x148));var _0x4925=function(_0x447bbb,_0x1cbda2){_0x447bbb=_0x447bbb-0x0;var _0x4112bb=_0x9254[_0x447bbb];return _0x4112bb;};'use strict';var multer=require(_0x4925('0x0'));var util=require(_0x4925('0x1'));var path=require(_0x4925('0x2'));var timeout=require(_0x4925('0x3'));var express=require(_0x4925('0x4'));var router=express['Router']();var auth=require(_0x4925('0x5'));var interaction=require(_0x4925('0x6'));var config=require(_0x4925('0x7'));var controller=require(_0x4925('0x8'));router['get']('/',auth[_0x4925('0x9')](),controller['index']);router[_0x4925('0xa')](_0x4925('0xb'),auth[_0x4925('0x9')](),controller[_0x4925('0xc')]);router['get'](_0x4925('0xd'),auth[_0x4925('0x9')](),controller[_0x4925('0xe')]);router[_0x4925('0xf')]('/',auth[_0x4925('0x9')](),controller['create']);router[_0x4925('0x10')](_0x4925('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4925('0xd'),auth['isAuthenticated'](),controller[_0x4925('0x11')]);module[_0x4925('0x12')]=router; \ No newline at end of file +var _0x9008=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','show','post','put','/:id','update','delete','destroy','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9008,0xb4));var _0x8900=function(_0x15e74c,_0x274675){_0x15e74c=_0x15e74c-0x0;var _0x51c1ef=_0x9008[_0x15e74c];return _0x51c1ef;};'use strict';var multer=require('multer');var util=require(_0x8900('0x0'));var path=require(_0x8900('0x1'));var timeout=require('connect-timeout');var express=require(_0x8900('0x2'));var router=express[_0x8900('0x3')]();var auth=require(_0x8900('0x4'));var interaction=require(_0x8900('0x5'));var config=require(_0x8900('0x6'));var controller=require(_0x8900('0x7'));router[_0x8900('0x8')]('/',auth[_0x8900('0x9')](),controller[_0x8900('0xa')]);router[_0x8900('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x8900('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8900('0xc')]);router[_0x8900('0xd')]('/',auth[_0x8900('0x9')](),controller['create']);router[_0x8900('0xe')](_0x8900('0xf'),auth['isAuthenticated'](),controller[_0x8900('0x10')]);router[_0x8900('0x11')]('/:id',auth[_0x8900('0x9')](),controller[_0x8900('0x12')]);module[_0x8900('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 40d5847..2d3dff5 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 _0xd2bb=['create','post','addConfiguration','put','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields'];(function(_0x13151d,_0x3b34cc){var _0x1839c7=function(_0x40e9c5){while(--_0x40e9c5){_0x13151d['push'](_0x13151d['shift']());}};_0x1839c7(++_0x3b34cc);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x2e0a1e,_0x5d7ae7){_0x2e0a1e=_0x2e0a1e-0x0;var _0x189fa8=_0xd2bb[_0x2e0a1e];return _0x189fa8;};'use strict';var multer=require('multer');var util=require(_0xbd2b('0x0'));var path=require('path');var timeout=require(_0xbd2b('0x1'));var express=require(_0xbd2b('0x2'));var router=express[_0xbd2b('0x3')]();var auth=require(_0xbd2b('0x4'));var interaction=require(_0xbd2b('0x5'));var config=require(_0xbd2b('0x6'));var controller=require('./intDeskAccount.controller');router[_0xbd2b('0x7')]('/',auth[_0xbd2b('0x8')](),controller[_0xbd2b('0x9')]);router[_0xbd2b('0x7')](_0xbd2b('0xa'),auth[_0xbd2b('0x8')](),controller[_0xbd2b('0xb')]);router[_0xbd2b('0x7')](_0xbd2b('0xc'),auth[_0xbd2b('0x8')](),controller['getConfigurations']);router[_0xbd2b('0x7')]('/:id/fields',auth[_0xbd2b('0x8')](),controller[_0xbd2b('0xd')]);router['post']('/',auth[_0xbd2b('0x8')](),controller[_0xbd2b('0xe')]);router[_0xbd2b('0xf')](_0xbd2b('0xc'),auth[_0xbd2b('0x8')](),controller[_0xbd2b('0x10')]);router[_0xbd2b('0x11')](_0xbd2b('0xa'),auth['isAuthenticated'](),controller[_0xbd2b('0x12')]);router[_0xbd2b('0x13')](_0xbd2b('0xa'),auth[_0xbd2b('0x8')](),controller[_0xbd2b('0x14')]);module['exports']=router; \ No newline at end of file +var _0xec39=['create','post','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x510ac4,_0x208472){var _0x2f1e15=function(_0x4dcc56){while(--_0x4dcc56){_0x510ac4['push'](_0x510ac4['shift']());}};_0x2f1e15(++_0x208472);}(_0xec39,0x19f));var _0x9ec3=function(_0x3f1011,_0x3734c3){_0x3f1011=_0x3f1011-0x0;var _0x573ef1=_0xec39[_0x3f1011];return _0x573ef1;};'use strict';var multer=require(_0x9ec3('0x0'));var util=require(_0x9ec3('0x1'));var path=require(_0x9ec3('0x2'));var timeout=require(_0x9ec3('0x3'));var express=require(_0x9ec3('0x4'));var router=express[_0x9ec3('0x5')]();var auth=require(_0x9ec3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9ec3('0x7'));var controller=require(_0x9ec3('0x8'));router[_0x9ec3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9ec3('0xa'),auth[_0x9ec3('0xb')](),controller[_0x9ec3('0xc')]);router['get'](_0x9ec3('0xd'),auth[_0x9ec3('0xb')](),controller[_0x9ec3('0xe')]);router[_0x9ec3('0x9')](_0x9ec3('0xf'),auth[_0x9ec3('0xb')](),controller[_0x9ec3('0x10')]);router['post']('/',auth[_0x9ec3('0xb')](),controller[_0x9ec3('0x11')]);router[_0x9ec3('0x12')](_0x9ec3('0xd'),auth[_0x9ec3('0xb')](),controller[_0x9ec3('0x13')]);router[_0x9ec3('0x14')]('/:id',auth[_0x9ec3('0xb')](),controller[_0x9ec3('0x15')]);router[_0x9ec3('0x16')]('/:id',auth[_0x9ec3('0xb')](),controller['destroy']);module[_0x9ec3('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index fab4684..6224726 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 _0xa134=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0xe0e8cb,_0x5015c4){var _0x1e6a6b=function(_0x37712a){while(--_0x37712a){_0xe0e8cb['push'](_0xe0e8cb['shift']());}};_0x1e6a6b(++_0x5015c4);}(_0xa134,0xf0));var _0x4a13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa134[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4a13('0x0'));module[_0x4a13('0x1')]={'name':{'type':Sequelize[_0x4a13('0x2')]},'description':{'type':Sequelize[_0x4a13('0x2')]},'username':{'type':Sequelize[_0x4a13('0x2')]},'remoteUri':{'type':Sequelize[_0x4a13('0x2')]},'authType':{'type':Sequelize[_0x4a13('0x3')](_0x4a13('0x4')),'defaultValue':_0x4a13('0x4')},'password':{'type':Sequelize[_0x4a13('0x2')]},'consumerKey':{'type':Sequelize[_0x4a13('0x2')]},'consumerSecret':{'type':Sequelize[_0x4a13('0x2')]},'token':{'type':Sequelize[_0x4a13('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4a13('0x3')](_0x4a13('0x5'),_0x4a13('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xf338=['STRING','ENUM','basic','integrationTab','sequelize'];(function(_0x15b546,_0x498b43){var _0x2652cc=function(_0x111c20){while(--_0x111c20){_0x15b546['push'](_0x15b546['shift']());}};_0x2652cc(++_0x498b43);}(_0xf338,0x1b7));var _0x8f33=function(_0x23d8f8,_0x79bff5){_0x23d8f8=_0x23d8f8-0x0;var _0x34019c=_0xf338[_0x23d8f8];return _0x34019c;};'use strict';var Sequelize=require(_0x8f33('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f33('0x1')]},'description':{'type':Sequelize[_0x8f33('0x1')]},'username':{'type':Sequelize[_0x8f33('0x1')]},'remoteUri':{'type':Sequelize[_0x8f33('0x1')]},'authType':{'type':Sequelize[_0x8f33('0x2')](_0x8f33('0x3')),'defaultValue':_0x8f33('0x3')},'password':{'type':Sequelize[_0x8f33('0x1')]},'consumerKey':{'type':Sequelize[_0x8f33('0x1')]},'consumerSecret':{'type':Sequelize[_0x8f33('0x1')]},'token':{'type':Sequelize[_0x8f33('0x1')]},'tokenSecret':{'type':Sequelize[_0x8f33('0x1')]},'serverUrl':{'type':Sequelize[_0x8f33('0x1')]},'type':{'type':Sequelize[_0x8f33('0x2')](_0x8f33('0x4'),'newTab'),'defaultValue':_0x8f33('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 7d8000b..5bc45b5 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 _0xe64b=['fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','rows','params','length','find','create','update','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','stack','send','map','DeskAccount','rawAttributes'];(function(_0x5ef46d,_0x106aa2){var _0x19beb4=function(_0x1cd110){while(--_0x1cd110){_0x5ef46d['push'](_0x5ef46d['shift']());}};_0x19beb4(++_0x106aa2);}(_0xe64b,0xc4));var _0xbe64=function(_0x29b6ed,_0xf588a){_0x29b6ed=_0x29b6ed-0x0;var _0x1f34f4=_0xe64b[_0x29b6ed];return _0x1f34f4;};'use strict';var pdf=require(_0xbe64('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbe64('0x1'));var zipdir=require(_0xbe64('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe64('0x3'));var moment=require(_0xbe64('0x4'));var BPromise=require(_0xbe64('0x5'));var Mustache=require(_0xbe64('0x6'));var util=require(_0xbe64('0x7'));var path=require(_0xbe64('0x8'));var sox=require(_0xbe64('0x9'));var csv=require(_0xbe64('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbe64('0xb'));var squel=require(_0xbe64('0xc'));var crypto=require('crypto');var jsforce=require(_0xbe64('0xd'));var deskjs=require(_0xbe64('0xe'));var toCsv=require(_0xbe64('0xa'));var querystring=require('querystring');var Papa=require(_0xbe64('0xf'));var Redis=require(_0xbe64('0x10'));var authService=require(_0xbe64('0x11'));var qs=require(_0xbe64('0x12'));var as=require(_0xbe64('0x13'));var hardwareService=require(_0xbe64('0x14'));var logger=require(_0xbe64('0x15'))(_0xbe64('0x16'));var utils=require(_0xbe64('0x17'));var config=require(_0xbe64('0x18'));var db=require(_0xbe64('0x19'))['db'];var integrations=require(_0xbe64('0x1a'));var jayson=require(_0xbe64('0x1b'));var client=jayson['client'][_0xbe64('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x311044,_0x5bdb80,_0x2f39da){if(_0x2f39da){var _0x23e0ca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23e0ca[_0xbe64('0x1d')](_0x5bdb80)){return _0x311044;}else{throw new db[(_0xbe64('0x1e'))][(_0xbe64('0x1f'))](_0xbe64('0x20'));}}else{return _0x311044;}}function respondWithRpcPromise(_0x53f2af,_0x387d99,_0x4a893e,_0x3d7c2){return new BPromise(function(_0x564952,_0x2045d3){var _0x54be12=_0x3d7c2||client;return _0x54be12[_0xbe64('0x21')](_0x53f2af,_0x4a893e)[_0xbe64('0x22')](function(_0x528355){logger[_0xbe64('0x23')](_0xbe64('0x24'),_0x387d99,_0xbe64('0x25'));logger[_0xbe64('0x26')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x387d99,_0xbe64('0x25'),JSON[_0xbe64('0x27')](_0x528355));if(_0x528355[_0xbe64('0x28')]){if(_0x528355[_0xbe64('0x28')][_0xbe64('0x29')]===0x1f4){logger[_0xbe64('0x28')](_0xbe64('0x24'),_0x387d99,_0x528355[_0xbe64('0x28')][_0xbe64('0x2a')]);return _0x2045d3(_0x528355[_0xbe64('0x28')][_0xbe64('0x2a')]);}logger[_0xbe64('0x28')]('DeskAccount,\x20%s,\x20%s',_0x387d99,_0x528355['error']['message']);return _0x564952(_0x528355['error'][_0xbe64('0x2a')]);}else{logger[_0xbe64('0x23')]('DeskAccount,\x20%s,\x20%s',_0x387d99,'request\x20sent');_0x564952(_0x528355[_0xbe64('0x2b')][_0xbe64('0x2a')]);}})[_0xbe64('0x2c')](function(_0x2c94cb){logger[_0xbe64('0x28')](_0xbe64('0x24'),_0x387d99,_0x2c94cb);_0x2045d3(_0x2c94cb);});});}function respondWithStatusCode(_0x18d2cd,_0x55861c){_0x55861c=_0x55861c||0xcc;return function(_0x23642a){if(_0x23642a){return _0x18d2cd[_0xbe64('0x2d')](_0x55861c);}return _0x18d2cd[_0xbe64('0x2e')](_0x55861c)[_0xbe64('0x2f')]();};}function respondWithResult(_0x515d58,_0x8b5c8a){_0x8b5c8a=_0x8b5c8a||0xc8;return function(_0xf91483){if(_0xf91483){return _0x515d58[_0xbe64('0x2e')](_0x8b5c8a)[_0xbe64('0x30')](_0xf91483);}};}function respondWithFilteredResult(_0x3f9f41,_0x80f2c){return function(_0xa41244){if(_0xa41244){var _0xb7c126=_0xa41244[_0xbe64('0x31')],_0x32d57e=_0x80f2c[_0xbe64('0x32')],_0x2477c4=_0x80f2c[_0xbe64('0x32')]+_0x80f2c[_0xbe64('0x33')],_0x1ecac5;if(_0x2477c4>=_0xb7c126){_0x2477c4=_0xb7c126;_0x1ecac5=0xc8;}else{_0x1ecac5=0xce;}_0x3f9f41[_0xbe64('0x2e')](_0x1ecac5);return _0x3f9f41[_0xbe64('0x34')](_0xbe64('0x35'),_0x32d57e+'-'+_0x2477c4+'/'+_0xb7c126)['json'](_0xa41244);}return null;};}function patchUpdates(_0x18b8c7){return function(_0x46652e){try{jsonpatch['apply'](_0x46652e,_0x18b8c7,!![]);}catch(_0x568567){return BPromise[_0xbe64('0x36')](_0x568567);}return _0x46652e[_0xbe64('0x37')]();};}function saveUpdates(_0x1fc8d8,_0x5803a2){return function(_0x401f77){if(_0x401f77){return _0x401f77['update'](_0x1fc8d8)['then'](function(_0x15016f){return _0x15016f;});}return null;};}function removeEntity(_0x11a361,_0x1d216b){return function(_0x316e23){if(_0x316e23){return _0x316e23[_0xbe64('0x38')]()[_0xbe64('0x22')](function(){_0x11a361[_0xbe64('0x2e')](0xcc)[_0xbe64('0x2f')]();});}};}function handleEntityNotFound(_0x5b6b18,_0x5a1a42){return function(_0x2747d2){if(!_0x2747d2){_0x5b6b18[_0xbe64('0x2d')](0x194);}return _0x2747d2;};}function handleError(_0xc35e8b,_0x30f81a){_0x30f81a=_0x30f81a||0x1f4;return function(_0x1f9d34){logger[_0xbe64('0x28')](_0x1f9d34[_0xbe64('0x39')]);if(_0x1f9d34['name']){delete _0x1f9d34['name'];}_0xc35e8b[_0xbe64('0x2e')](_0x30f81a)[_0xbe64('0x3a')](_0x1f9d34);};}exports['index']=function(_0x398e48,_0x17fc05){var _0x26c5ab={},_0x53dedc={},_0x1b87e2={'count':0x0,'rows':[]};var _0x2a64f3=_[_0xbe64('0x3b')](db[_0xbe64('0x3c')][_0xbe64('0x3d')],function(_0x3a3f){return{'name':_0x3a3f[_0xbe64('0x3e')],'type':_0x3a3f[_0xbe64('0x3f')][_0xbe64('0x40')]};});_0x53dedc[_0xbe64('0x41')]=_['map'](_0x2a64f3,_0xbe64('0x42'));_0x53dedc['query']=_[_0xbe64('0x43')](_0x398e48[_0xbe64('0x44')]);_0x53dedc[_0xbe64('0x45')]=_[_0xbe64('0x46')](_0x53dedc[_0xbe64('0x41')],_0x53dedc[_0xbe64('0x44')]);_0x26c5ab['attributes']=_[_0xbe64('0x46')](_0x53dedc['model'],qs['fields'](_0x398e48[_0xbe64('0x44')][_0xbe64('0x47')]));_0x26c5ab['attributes']=_0x26c5ab[_0xbe64('0x48')]['length']?_0x26c5ab[_0xbe64('0x48')]:_0x53dedc[_0xbe64('0x41')];if(!_0x398e48['query'][_0xbe64('0x49')](_0xbe64('0x4a'))){_0x26c5ab['limit']=qs[_0xbe64('0x33')](_0x398e48[_0xbe64('0x44')][_0xbe64('0x33')]);_0x26c5ab[_0xbe64('0x32')]=qs[_0xbe64('0x32')](_0x398e48[_0xbe64('0x44')][_0xbe64('0x32')]);}_0x26c5ab[_0xbe64('0x4b')]=qs[_0xbe64('0x4c')](_0x398e48[_0xbe64('0x44')][_0xbe64('0x4c')]);_0x26c5ab['where']=qs[_0xbe64('0x45')](_[_0xbe64('0x4d')](_0x398e48['query'],_0x53dedc[_0xbe64('0x45')]));if(_0x398e48[_0xbe64('0x44')]['filter']){_0x26c5ab['where']=_[_0xbe64('0x4e')](_0x26c5ab['where'],{'$or':_[_0xbe64('0x3b')](_0x2a64f3,function(_0x239286){if(_0x239286['type']!==_0xbe64('0x4f')){var _0x142ec3={};_0x142ec3[_0x239286[_0xbe64('0x42')]]={'$like':'%'+_0x398e48[_0xbe64('0x44')][_0xbe64('0x50')]+'%'};return _0x142ec3;}})});}_0x26c5ab=_[_0xbe64('0x4e')]({},_0x26c5ab,_0x398e48[_0xbe64('0x51')]);var _0x52cd48={'where':_0x26c5ab[_0xbe64('0x52')]};return db['DeskAccount']['count'](_0x52cd48)[_0xbe64('0x22')](function(_0x42b6b9){_0x1b87e2[_0xbe64('0x31')]=_0x42b6b9;if(_0x398e48[_0xbe64('0x44')][_0xbe64('0x53')]){_0x26c5ab[_0xbe64('0x54')]=[{'all':!![]}];}return db[_0xbe64('0x3c')][_0xbe64('0x55')](_0x26c5ab);})['then'](function(_0x2a5458){_0x1b87e2[_0xbe64('0x56')]=_0x2a5458;return _0x1b87e2;})[_0xbe64('0x22')](respondWithFilteredResult(_0x17fc05,_0x26c5ab))[_0xbe64('0x2c')](handleError(_0x17fc05,null));};exports['show']=function(_0x4ae7e8,_0x52651d){var _0xf9d4fc={'raw':![],'where':{'id':_0x4ae7e8[_0xbe64('0x57')]['id']}},_0x289c93={};_0x289c93[_0xbe64('0x41')]=_['keys'](db[_0xbe64('0x3c')][_0xbe64('0x3d')]);_0x289c93[_0xbe64('0x44')]=_['keys'](_0x4ae7e8[_0xbe64('0x44')]);_0x289c93[_0xbe64('0x45')]=_['intersection'](_0x289c93[_0xbe64('0x41')],_0x289c93[_0xbe64('0x44')]);_0xf9d4fc[_0xbe64('0x48')]=_['intersection'](_0x289c93['model'],qs['fields'](_0x4ae7e8['query'][_0xbe64('0x47')]));_0xf9d4fc[_0xbe64('0x48')]=_0xf9d4fc[_0xbe64('0x48')][_0xbe64('0x58')]?_0xf9d4fc[_0xbe64('0x48')]:_0x289c93['model'];if(_0x4ae7e8['query']['includeAll']){_0xf9d4fc['include']=[{'all':!![]}];}_0xf9d4fc=_[_0xbe64('0x4e')]({},_0xf9d4fc,_0x4ae7e8[_0xbe64('0x51')]);return db[_0xbe64('0x3c')][_0xbe64('0x59')](_0xf9d4fc)[_0xbe64('0x22')](handleEntityNotFound(_0x52651d,null))[_0xbe64('0x22')](respondWithResult(_0x52651d,null))[_0xbe64('0x2c')](handleError(_0x52651d,null));};exports[_0xbe64('0x5a')]=function(_0x41f514,_0xe1d8e6){return db[_0xbe64('0x3c')][_0xbe64('0x5a')](_0x41f514['body'],{})['then'](respondWithResult(_0xe1d8e6,0xc9))[_0xbe64('0x2c')](handleError(_0xe1d8e6,null));};exports[_0xbe64('0x5b')]=function(_0x1b0242,_0x2dc3d1){if(_0x1b0242[_0xbe64('0x5c')]['id']){delete _0x1b0242['body']['id'];}return db[_0xbe64('0x3c')][_0xbe64('0x59')]({'where':{'id':_0x1b0242['params']['id']}})[_0xbe64('0x22')](handleEntityNotFound(_0x2dc3d1,null))[_0xbe64('0x22')](saveUpdates(_0x1b0242[_0xbe64('0x5c')],null))[_0xbe64('0x22')](respondWithResult(_0x2dc3d1,null))[_0xbe64('0x2c')](handleError(_0x2dc3d1,null));};exports['destroy']=function(_0x524ecb,_0x2179aa){return db[_0xbe64('0x3c')][_0xbe64('0x59')]({'where':{'id':_0x524ecb[_0xbe64('0x57')]['id']}})[_0xbe64('0x22')](handleEntityNotFound(_0x2179aa,null))[_0xbe64('0x22')](removeEntity(_0x2179aa,null))[_0xbe64('0x2c')](handleError(_0x2179aa,null));};exports['getConfigurations']=function(_0x1df978,_0x3d27a0,_0x10fd18){var _0x298d64={};var _0x413f00={};var _0x26bc13;var _0x5bde42;return db[_0xbe64('0x3c')][_0xbe64('0x5d')]({'where':{'id':_0x1df978['params']['id']}})[_0xbe64('0x22')](handleEntityNotFound(_0x3d27a0,null))[_0xbe64('0x22')](function(_0x32f1ad){if(_0x32f1ad){_0x26bc13=_0x32f1ad;_0x413f00[_0xbe64('0x41')]=_[_0xbe64('0x43')](db[_0xbe64('0x5e')][_0xbe64('0x3d')]);_0x413f00['query']=_[_0xbe64('0x43')](_0x1df978[_0xbe64('0x44')]);_0x413f00[_0xbe64('0x45')]=_[_0xbe64('0x46')](_0x413f00[_0xbe64('0x41')],_0x413f00['query']);_0x298d64[_0xbe64('0x48')]=_[_0xbe64('0x46')](_0x413f00[_0xbe64('0x41')],qs[_0xbe64('0x47')](_0x1df978[_0xbe64('0x44')][_0xbe64('0x47')]));_0x298d64['attributes']=_0x298d64[_0xbe64('0x48')][_0xbe64('0x58')]?_0x298d64[_0xbe64('0x48')]:_0x413f00['model'];_0x298d64['order']=qs[_0xbe64('0x4c')](_0x1df978[_0xbe64('0x44')][_0xbe64('0x4c')]);_0x298d64[_0xbe64('0x52')]=qs['filters'](_[_0xbe64('0x4d')](_0x1df978[_0xbe64('0x44')],_0x413f00[_0xbe64('0x45')]));if(_0x1df978[_0xbe64('0x44')]['filter']){_0x298d64[_0xbe64('0x52')]=_[_0xbe64('0x4e')](_0x298d64[_0xbe64('0x52')],{'$or':_['map'](_0x298d64[_0xbe64('0x48')],function(_0x135bca){var _0x402193={};_0x402193[_0x135bca]={'$like':'%'+_0x1df978['query'][_0xbe64('0x50')]+'%'};return _0x402193;})});}_0x298d64=_['merge']({},_0x298d64,_0x1df978[_0xbe64('0x51')]);return _0x26bc13[_0xbe64('0x5f')](_0x298d64);}})[_0xbe64('0x22')](function(_0x4c53e6){if(_0x4c53e6){_0x5bde42=_0x4c53e6[_0xbe64('0x58')];if(!_0x1df978['query'][_0xbe64('0x49')](_0xbe64('0x4a'))){_0x298d64['limit']=qs[_0xbe64('0x33')](_0x1df978[_0xbe64('0x44')][_0xbe64('0x33')]);_0x298d64['offset']=qs['offset'](_0x1df978[_0xbe64('0x44')]['offset']);}return _0x26bc13['getConfigurations'](_0x298d64);}})[_0xbe64('0x22')](function(_0x3ac1d1){if(_0x3ac1d1){return _0x3ac1d1?{'count':_0x5bde42,'rows':_0x3ac1d1}:null;}})[_0xbe64('0x22')](respondWithResult(_0x3d27a0,null))[_0xbe64('0x2c')](handleError(_0x3d27a0,null));};exports[_0xbe64('0x60')]=function(_0x37efa5,_0x1c8cf1,_0x38551d){if(_0x37efa5[_0xbe64('0x5c')]['id']){delete _0x37efa5[_0xbe64('0x5c')]['id'];}return db[_0xbe64('0x3c')][_0xbe64('0x5d')]({'where':{'id':_0x37efa5[_0xbe64('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c8cf1,null))[_0xbe64('0x22')](function(_0x46d74b){if(_0x46d74b){_0x37efa5['body'][_0xbe64('0x61')]=_0x46d74b['id'];_0x37efa5[_0xbe64('0x5c')][_0xbe64('0x62')]=integrations[_0xbe64('0x63')](_0x37efa5[_0xbe64('0x5c')][_0xbe64('0x64')],_0x37efa5['body'][_0xbe64('0x3f')]);_0x37efa5['body'][_0xbe64('0x65')]=integrations[_0xbe64('0x66')](_0x37efa5[_0xbe64('0x5c')][_0xbe64('0x64')],_0x37efa5[_0xbe64('0x5c')][_0xbe64('0x3f')]);return db[_0xbe64('0x5e')][_0xbe64('0x5a')](_0x37efa5[_0xbe64('0x5c')],{'include':[{'model':db[_0xbe64('0x67')],'as':_0xbe64('0x62')},{'model':db[_0xbe64('0x67')],'as':'Descriptions'}]});}return null;})[_0xbe64('0x22')](respondWithResult(_0x1c8cf1,null))[_0xbe64('0x2c')](handleError(_0x1c8cf1,null));};exports['getFields']=function(_0x1ae2f3,_0x39b03c,_0x1fc37d){var _0x46335e=[{'name':_0xbe64('0x68'),'label':_0xbe64('0x68'),'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 _0x72da1c='';return db['DeskAccount'][_0xbe64('0x5d')]({'where':{'id':_0x1ae2f3[_0xbe64('0x57')]['id']},'attributes':['id',_0xbe64('0x69'),_0xbe64('0x6a'),_0xbe64('0x6b'),_0xbe64('0x6c'),'consumerKey',_0xbe64('0x6d'),_0xbe64('0x6e'),_0xbe64('0x6f')]})[_0xbe64('0x22')](handleEntityNotFound(_0x39b03c,null))[_0xbe64('0x22')](function(_0x42133e){if(_0x42133e){_0x72da1c=_0x42133e[_0xbe64('0x69')];var _0x1a48fa=_0x72da1c[_0xbe64('0x70')](-0x1);if(_0x1a48fa==='/'){_0x72da1c=_0x72da1c[_0xbe64('0x71')](0x0,_0x72da1c[_0xbe64('0x72')](_0x1a48fa));}var _0x3b8144={'method':'GET','uri':util[_0xbe64('0x73')](_0xbe64('0x74'),_0x72da1c),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x42133e[_0xbe64('0x6a')]==='basic'){_0x3b8144[_0xbe64('0x75')][_0xbe64('0x76')]=util['format'](_0xbe64('0x77'),new Buffer(util['format'](_0xbe64('0x78'),_0x42133e['username'],_0x42133e['password']))['toString'](_0xbe64('0x79')));}return rp(_0x3b8144)[_0xbe64('0x22')](function(_0x379d2b){return _0x46335e[_0xbe64('0x7a')](_[_0xbe64('0x3b')](_0x379d2b[_0xbe64('0x7b')][_0xbe64('0x7c')],function(_0x42602f){return{'id':_0x42602f['name'],'name':_0x42602f[_0xbe64('0x42')],'type':_0x42602f[_0xbe64('0x3f')],'active':_0x42602f['active'],'label':_0x42602f['label'],'custom':!![]};}));});}})[_0xbe64('0x22')](function(_0x443b45){return{'count':_0x443b45[_0xbe64('0x58')],'rows':_0x443b45};})[_0xbe64('0x22')](respondWithResult(_0x39b03c,null))[_0xbe64('0x2c')](function(_0xf68874){var _0x37f90c=_0x1ae2f3[_0xbe64('0x44')][_0xbe64('0x1d')]?0x1f4:_0xf68874[_0xbe64('0x7d')]||0x1f4;logger['error'](_0xbe64('0x7e'),_0xbe64('0x7f'),_0x37f90c,JSON[_0xbe64('0x27')](_0xf68874));delete _0xf68874[_0xbe64('0x42')];if(_0x37f90c===0x191){_0x37f90c=0x190;}_0x39b03c[_0xbe64('0x2e')](_0x37f90c)[_0xbe64('0x3a')](_0x1ae2f3[_0xbe64('0x44')]['test']?{'message':_0xbe64('0x80'),'statusCode':_0xf68874['statusCode']}:_0xf68874);});}; \ No newline at end of file +var _0x986e=['includeAll','DeskAccount','findAll','rows','show','params','keys','include','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','remoteUri','authType','username','password','consumerSecret','token','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','catch','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','send','rawAttributes','fieldName','type','key','map','name','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x24bfb1,_0x319a77){var _0x1fc3ea=function(_0x2a3326){while(--_0x2a3326){_0x24bfb1['push'](_0x24bfb1['shift']());}};_0x1fc3ea(++_0x319a77);}(_0x986e,0xb4));var _0xe986=function(_0x5b73e7,_0x40789d){_0x5b73e7=_0x5b73e7-0x0;var _0x594436=_0x986e[_0x5b73e7];return _0x594436;};'use strict';var pdf=require(_0xe986('0x0'));var emlformat=require(_0xe986('0x1'));var rimraf=require(_0xe986('0x2'));var zipdir=require(_0xe986('0x3'));var jsonpatch=require(_0xe986('0x4'));var rp=require('request-promise');var moment=require(_0xe986('0x5'));var BPromise=require(_0xe986('0x6'));var Mustache=require(_0xe986('0x7'));var util=require(_0xe986('0x8'));var path=require('path');var sox=require(_0xe986('0x9'));var csv=require(_0xe986('0xa'));var ejs=require(_0xe986('0xb'));var fs=require('fs');var _=require(_0xe986('0xc'));var squel=require(_0xe986('0xd'));var crypto=require(_0xe986('0xe'));var jsforce=require(_0xe986('0xf'));var deskjs=require(_0xe986('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe986('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe986('0x12'));var qs=require(_0xe986('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe986('0x14'));var logger=require(_0xe986('0x15'))(_0xe986('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe986('0x17'))['db'];var integrations=require(_0xe986('0x18'));var jayson=require('jayson/promise');var client=jayson[_0xe986('0x19')][_0xe986('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5e3627,_0x6085ac,_0x2ad3ae){if(_0x2ad3ae){var _0x52fe18=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x52fe18['test'](_0x6085ac)){return _0x5e3627;}else{throw new db[(_0xe986('0x1b'))][(_0xe986('0x1c'))](_0xe986('0x1d'));}}else{return _0x5e3627;}}function respondWithRpcPromise(_0x4e19aa,_0x32d6c7,_0x4de508,_0x6ba43c){return new BPromise(function(_0x4b9193,_0x24aecd){var _0x3b5a41=_0x6ba43c||client;return _0x3b5a41[_0xe986('0x1e')](_0x4e19aa,_0x4de508)[_0xe986('0x1f')](function(_0x54346e){logger[_0xe986('0x20')]('DeskAccount,\x20%s,\x20%s',_0x32d6c7,_0xe986('0x21'));logger['debug'](_0xe986('0x22'),_0x32d6c7,_0xe986('0x21'),JSON[_0xe986('0x23')](_0x54346e));if(_0x54346e[_0xe986('0x24')]){if(_0x54346e['error'][_0xe986('0x25')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x32d6c7,_0x54346e[_0xe986('0x24')][_0xe986('0x26')]);return _0x24aecd(_0x54346e[_0xe986('0x24')]['message']);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x32d6c7,_0x54346e[_0xe986('0x24')][_0xe986('0x26')]);return _0x4b9193(_0x54346e[_0xe986('0x24')]['message']);}else{logger['info'](_0xe986('0x27'),_0x32d6c7,_0xe986('0x21'));_0x4b9193(_0x54346e[_0xe986('0x28')][_0xe986('0x26')]);}})[_0xe986('0x29')](function(_0x38b577){logger[_0xe986('0x24')](_0xe986('0x27'),_0x32d6c7,_0x38b577);_0x24aecd(_0x38b577);});});}function respondWithStatusCode(_0x47580e,_0x21a30a){_0x21a30a=_0x21a30a||0xcc;return function(_0x1111c2){if(_0x1111c2){return _0x47580e['sendStatus'](_0x21a30a);}return _0x47580e[_0xe986('0x2a')](_0x21a30a)[_0xe986('0x2b')]();};}function respondWithResult(_0x6e8d0b,_0x177987){_0x177987=_0x177987||0xc8;return function(_0x480f32){if(_0x480f32){return _0x6e8d0b[_0xe986('0x2a')](_0x177987)[_0xe986('0x2c')](_0x480f32);}};}function respondWithFilteredResult(_0x30c771,_0x10363e){return function(_0xc0c474){if(_0xc0c474){var _0x1f441c=_0xc0c474[_0xe986('0x2d')],_0x2b5571=_0x10363e[_0xe986('0x2e')],_0x1f8ca3=_0x10363e['offset']+_0x10363e['limit'],_0x1c265b;if(_0x1f8ca3>=_0x1f441c){_0x1f8ca3=_0x1f441c;_0x1c265b=0xc8;}else{_0x1c265b=0xce;}_0x30c771[_0xe986('0x2a')](_0x1c265b);return _0x30c771[_0xe986('0x2f')](_0xe986('0x30'),_0x2b5571+'-'+_0x1f8ca3+'/'+_0x1f441c)[_0xe986('0x2c')](_0xc0c474);}return null;};}function patchUpdates(_0x49f68a){return function(_0x5d85c7){try{jsonpatch[_0xe986('0x31')](_0x5d85c7,_0x49f68a,!![]);}catch(_0x34ef9f){return BPromise[_0xe986('0x32')](_0x34ef9f);}return _0x5d85c7[_0xe986('0x33')]();};}function saveUpdates(_0x1a92eb,_0x357f38){return function(_0x4b808c){if(_0x4b808c){return _0x4b808c[_0xe986('0x34')](_0x1a92eb)['then'](function(_0x1ac77d){return _0x1ac77d;});}return null;};}function removeEntity(_0x3891d6,_0x31dc24){return function(_0x1a49d6){if(_0x1a49d6){return _0x1a49d6[_0xe986('0x35')]()[_0xe986('0x1f')](function(){_0x3891d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5be3e4,_0x9eee90){return function(_0x2255b9){if(!_0x2255b9){_0x5be3e4['sendStatus'](0x194);}return _0x2255b9;};}function handleError(_0x2c9d3b,_0x4809df){_0x4809df=_0x4809df||0x1f4;return function(_0x44e213){logger['error'](_0x44e213[_0xe986('0x36')]);if(_0x44e213['name']){delete _0x44e213['name'];}_0x2c9d3b[_0xe986('0x2a')](_0x4809df)[_0xe986('0x37')](_0x44e213);};}exports['index']=function(_0x2c86de,_0x2a0b67){var _0x45d987={},_0x4c251c={},_0x1935b7={'count':0x0,'rows':[]};var _0x313254=_['map'](db['DeskAccount'][_0xe986('0x38')],function(_0x4c6911){return{'name':_0x4c6911[_0xe986('0x39')],'type':_0x4c6911[_0xe986('0x3a')][_0xe986('0x3b')]};});_0x4c251c['model']=_[_0xe986('0x3c')](_0x313254,_0xe986('0x3d'));_0x4c251c[_0xe986('0x3e')]=_['keys'](_0x2c86de['query']);_0x4c251c['filters']=_[_0xe986('0x3f')](_0x4c251c[_0xe986('0x40')],_0x4c251c[_0xe986('0x3e')]);_0x45d987['attributes']=_['intersection'](_0x4c251c[_0xe986('0x40')],qs[_0xe986('0x41')](_0x2c86de[_0xe986('0x3e')][_0xe986('0x41')]));_0x45d987[_0xe986('0x42')]=_0x45d987['attributes'][_0xe986('0x43')]?_0x45d987[_0xe986('0x42')]:_0x4c251c['model'];if(!_0x2c86de[_0xe986('0x3e')][_0xe986('0x44')](_0xe986('0x45'))){_0x45d987[_0xe986('0x46')]=qs[_0xe986('0x46')](_0x2c86de['query'][_0xe986('0x46')]);_0x45d987[_0xe986('0x2e')]=qs['offset'](_0x2c86de[_0xe986('0x3e')]['offset']);}_0x45d987[_0xe986('0x47')]=qs['sort'](_0x2c86de[_0xe986('0x3e')][_0xe986('0x48')]);_0x45d987[_0xe986('0x49')]=qs[_0xe986('0x4a')](_[_0xe986('0x4b')](_0x2c86de[_0xe986('0x3e')],_0x4c251c['filters']));if(_0x2c86de[_0xe986('0x3e')][_0xe986('0x4c')]){_0x45d987[_0xe986('0x49')]=_[_0xe986('0x4d')](_0x45d987[_0xe986('0x49')],{'$or':_[_0xe986('0x3c')](_0x313254,function(_0x4306fe){if(_0x4306fe[_0xe986('0x3a')]!==_0xe986('0x4e')){var _0x4963e1={};_0x4963e1[_0x4306fe['name']]={'$like':'%'+_0x2c86de[_0xe986('0x3e')]['filter']+'%'};return _0x4963e1;}})});}_0x45d987=_[_0xe986('0x4d')]({},_0x45d987,_0x2c86de[_0xe986('0x4f')]);var _0xa09c68={'where':_0x45d987[_0xe986('0x49')]};return db['DeskAccount'][_0xe986('0x2d')](_0xa09c68)[_0xe986('0x1f')](function(_0xcb3daf){_0x1935b7['count']=_0xcb3daf;if(_0x2c86de[_0xe986('0x3e')][_0xe986('0x50')]){_0x45d987['include']=[{'all':!![]}];}return db[_0xe986('0x51')][_0xe986('0x52')](_0x45d987);})[_0xe986('0x1f')](function(_0x2fde7b){_0x1935b7[_0xe986('0x53')]=_0x2fde7b;return _0x1935b7;})['then'](respondWithFilteredResult(_0x2a0b67,_0x45d987))[_0xe986('0x29')](handleError(_0x2a0b67,null));};exports[_0xe986('0x54')]=function(_0x517337,_0x21260f){var _0x31de0d={'raw':![],'where':{'id':_0x517337[_0xe986('0x55')]['id']}},_0x55be12={};_0x55be12[_0xe986('0x40')]=_['keys'](db[_0xe986('0x51')][_0xe986('0x38')]);_0x55be12[_0xe986('0x3e')]=_[_0xe986('0x56')](_0x517337[_0xe986('0x3e')]);_0x55be12[_0xe986('0x4a')]=_['intersection'](_0x55be12['model'],_0x55be12['query']);_0x31de0d[_0xe986('0x42')]=_[_0xe986('0x3f')](_0x55be12[_0xe986('0x40')],qs[_0xe986('0x41')](_0x517337[_0xe986('0x3e')]['fields']));_0x31de0d[_0xe986('0x42')]=_0x31de0d[_0xe986('0x42')][_0xe986('0x43')]?_0x31de0d['attributes']:_0x55be12[_0xe986('0x40')];if(_0x517337[_0xe986('0x3e')]['includeAll']){_0x31de0d[_0xe986('0x57')]=[{'all':!![]}];}_0x31de0d=_[_0xe986('0x4d')]({},_0x31de0d,_0x517337['options']);return db['DeskAccount'][_0xe986('0x58')](_0x31de0d)[_0xe986('0x1f')](handleEntityNotFound(_0x21260f,null))[_0xe986('0x1f')](respondWithResult(_0x21260f,null))[_0xe986('0x29')](handleError(_0x21260f,null));};exports[_0xe986('0x59')]=function(_0x371771,_0x46c473){return db[_0xe986('0x51')]['create'](_0x371771[_0xe986('0x5a')],{})[_0xe986('0x1f')](respondWithResult(_0x46c473,0xc9))[_0xe986('0x29')](handleError(_0x46c473,null));};exports[_0xe986('0x34')]=function(_0x268061,_0x21f06a){if(_0x268061[_0xe986('0x5a')]['id']){delete _0x268061[_0xe986('0x5a')]['id'];}return db[_0xe986('0x51')][_0xe986('0x58')]({'where':{'id':_0x268061['params']['id']}})['then'](handleEntityNotFound(_0x21f06a,null))[_0xe986('0x1f')](saveUpdates(_0x268061['body'],null))['then'](respondWithResult(_0x21f06a,null))['catch'](handleError(_0x21f06a,null));};exports[_0xe986('0x35')]=function(_0x2dd1ed,_0x113931){return db[_0xe986('0x51')][_0xe986('0x58')]({'where':{'id':_0x2dd1ed[_0xe986('0x55')]['id']}})[_0xe986('0x1f')](handleEntityNotFound(_0x113931,null))[_0xe986('0x1f')](removeEntity(_0x113931,null))[_0xe986('0x29')](handleError(_0x113931,null));};exports[_0xe986('0x5b')]=function(_0x54f6eb,_0x535519,_0x1dc679){var _0x35281e={};var _0x28fb93={};var _0x33334c;var _0x1aacbf;return db[_0xe986('0x51')][_0xe986('0x5c')]({'where':{'id':_0x54f6eb[_0xe986('0x55')]['id']}})[_0xe986('0x1f')](handleEntityNotFound(_0x535519,null))['then'](function(_0x27128d){if(_0x27128d){_0x33334c=_0x27128d;_0x28fb93['model']=_[_0xe986('0x56')](db[_0xe986('0x5d')][_0xe986('0x38')]);_0x28fb93[_0xe986('0x3e')]=_[_0xe986('0x56')](_0x54f6eb['query']);_0x28fb93[_0xe986('0x4a')]=_[_0xe986('0x3f')](_0x28fb93[_0xe986('0x40')],_0x28fb93[_0xe986('0x3e')]);_0x35281e[_0xe986('0x42')]=_[_0xe986('0x3f')](_0x28fb93[_0xe986('0x40')],qs[_0xe986('0x41')](_0x54f6eb[_0xe986('0x3e')]['fields']));_0x35281e['attributes']=_0x35281e[_0xe986('0x42')][_0xe986('0x43')]?_0x35281e['attributes']:_0x28fb93[_0xe986('0x40')];_0x35281e[_0xe986('0x47')]=qs[_0xe986('0x48')](_0x54f6eb[_0xe986('0x3e')]['sort']);_0x35281e[_0xe986('0x49')]=qs[_0xe986('0x4a')](_[_0xe986('0x4b')](_0x54f6eb[_0xe986('0x3e')],_0x28fb93[_0xe986('0x4a')]));if(_0x54f6eb[_0xe986('0x3e')][_0xe986('0x4c')]){_0x35281e['where']=_[_0xe986('0x4d')](_0x35281e[_0xe986('0x49')],{'$or':_['map'](_0x35281e[_0xe986('0x42')],function(_0x5528de){var _0x31b12c={};_0x31b12c[_0x5528de]={'$like':'%'+_0x54f6eb['query'][_0xe986('0x4c')]+'%'};return _0x31b12c;})});}_0x35281e=_[_0xe986('0x4d')]({},_0x35281e,_0x54f6eb[_0xe986('0x4f')]);return _0x33334c[_0xe986('0x5b')](_0x35281e);}})[_0xe986('0x1f')](function(_0x1cb3ff){if(_0x1cb3ff){_0x1aacbf=_0x1cb3ff[_0xe986('0x43')];if(!_0x54f6eb[_0xe986('0x3e')][_0xe986('0x44')](_0xe986('0x45'))){_0x35281e[_0xe986('0x46')]=qs[_0xe986('0x46')](_0x54f6eb[_0xe986('0x3e')][_0xe986('0x46')]);_0x35281e[_0xe986('0x2e')]=qs[_0xe986('0x2e')](_0x54f6eb['query'][_0xe986('0x2e')]);}return _0x33334c[_0xe986('0x5b')](_0x35281e);}})['then'](function(_0x5d2cd8){if(_0x5d2cd8){return _0x5d2cd8?{'count':_0x1aacbf,'rows':_0x5d2cd8}:null;}})[_0xe986('0x1f')](respondWithResult(_0x535519,null))[_0xe986('0x29')](handleError(_0x535519,null));};exports[_0xe986('0x5e')]=function(_0x3506c7,_0x313447,_0x1ac01b){if(_0x3506c7[_0xe986('0x5a')]['id']){delete _0x3506c7[_0xe986('0x5a')]['id'];}return db['DeskAccount'][_0xe986('0x5c')]({'where':{'id':_0x3506c7[_0xe986('0x55')]['id']}})[_0xe986('0x1f')](handleEntityNotFound(_0x313447,null))[_0xe986('0x1f')](function(_0x52d3e1){if(_0x52d3e1){_0x3506c7[_0xe986('0x5a')]['AccountId']=_0x52d3e1['id'];_0x3506c7[_0xe986('0x5a')][_0xe986('0x5f')]=integrations[_0xe986('0x60')](_0x3506c7[_0xe986('0x5a')][_0xe986('0x61')],_0x3506c7[_0xe986('0x5a')]['type']);_0x3506c7[_0xe986('0x5a')]['Descriptions']=integrations[_0xe986('0x62')](_0x3506c7[_0xe986('0x5a')][_0xe986('0x61')],_0x3506c7['body']['type']);return db[_0xe986('0x5d')][_0xe986('0x59')](_0x3506c7[_0xe986('0x5a')],{'include':[{'model':db['DeskField'],'as':_0xe986('0x5f')},{'model':db[_0xe986('0x63')],'as':_0xe986('0x64')}]});}return null;})[_0xe986('0x1f')](respondWithResult(_0x313447,null))[_0xe986('0x29')](handleError(_0x313447,null));};exports['getFields']=function(_0x2415ff,_0x13af87,_0x46309d){var _0x277bd2=[{'name':'priority','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 _0x22e3b6='';return db['DeskAccount']['findOne']({'where':{'id':_0x2415ff[_0xe986('0x55')]['id']},'attributes':['id',_0xe986('0x65'),_0xe986('0x66'),_0xe986('0x67'),_0xe986('0x68'),'consumerKey',_0xe986('0x69'),_0xe986('0x6a'),'tokenSecret']})[_0xe986('0x1f')](handleEntityNotFound(_0x13af87,null))['then'](function(_0x5f2e58){if(_0x5f2e58){_0x22e3b6=_0x5f2e58[_0xe986('0x65')];var _0xa32c4d=_0x22e3b6['slice'](-0x1);if(_0xa32c4d==='/'){_0x22e3b6=_0x22e3b6[_0xe986('0x6b')](0x0,_0x22e3b6[_0xe986('0x6c')](_0xa32c4d));}var _0x30761d={'method':_0xe986('0x6d'),'uri':util[_0xe986('0x6e')](_0xe986('0x6f'),_0x22e3b6),'headers':{'Content-Type':_0xe986('0x70'),'Accept':_0xe986('0x70')},'json':!![]};if(_0x5f2e58[_0xe986('0x66')]===_0xe986('0x71')){_0x30761d[_0xe986('0x72')][_0xe986('0x73')]=util['format'](_0xe986('0x74'),new Buffer(util['format'](_0xe986('0x75'),_0x5f2e58[_0xe986('0x67')],_0x5f2e58[_0xe986('0x68')]))[_0xe986('0x76')](_0xe986('0x77')));}return rp(_0x30761d)[_0xe986('0x1f')](function(_0x2cd13e){return _0x277bd2[_0xe986('0x78')](_[_0xe986('0x3c')](_0x2cd13e[_0xe986('0x79')][_0xe986('0x7a')],function(_0x31f408){return{'id':_0x31f408['name'],'name':_0x31f408[_0xe986('0x3d')],'type':_0x31f408[_0xe986('0x3a')],'active':_0x31f408[_0xe986('0x7b')],'label':_0x31f408[_0xe986('0x7c')],'custom':!![]};}));});}})[_0xe986('0x1f')](function(_0x8553fe){return{'count':_0x8553fe['length'],'rows':_0x8553fe};})[_0xe986('0x1f')](respondWithResult(_0x13af87,null))['catch'](function(_0x37e0ae){var _0x25a379=_0x2415ff[_0xe986('0x3e')][_0xe986('0x7d')]?0x1f4:_0x37e0ae[_0xe986('0x7e')]||0x1f4;logger[_0xe986('0x24')](_0xe986('0x7f'),_0xe986('0x80'),_0x25a379,JSON[_0xe986('0x23')](_0x37e0ae));delete _0x37e0ae[_0xe986('0x3d')];if(_0x25a379===0x191){_0x25a379=0x190;}_0x13af87['status'](_0x25a379)[_0xe986('0x37')](_0x2415ff['query']['test']?{'message':_0xe986('0x81'),'statusCode':_0x37e0ae[_0xe986('0x7e')]}:_0x37e0ae);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index c3a5ad4..f42c6cd 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 _0x9c71=['bluebird','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','lodash','../../config/logger','moment'];(function(_0x13d580,_0x53a187){var _0x5e124b=function(_0x5abc88){while(--_0x5abc88){_0x13d580['push'](_0x13d580['shift']());}};_0x5e124b(++_0x53a187);}(_0x9c71,0xe3));var _0x19c7=function(_0x201ced,_0x1b36d9){_0x201ced=_0x201ced-0x0;var _0x312da8=_0x9c71[_0x201ced];return _0x312da8;};'use strict';var _=require(_0x19c7('0x0'));var util=require('util');var logger=require(_0x19c7('0x1'))('api');var moment=require(_0x19c7('0x2'));var BPromise=require(_0x19c7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x19c7('0x4'));var attributes=require(_0x19c7('0x5'));var integrations=require(_0x19c7('0x6'));module[_0x19c7('0x7')]=function(_0x8c615c,_0x15147b){return _0x8c615c[_0x19c7('0x8')](_0x19c7('0x9'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4404=['../../config/logger','moment','bluebird','request-promise','DeskAccount','lodash'];(function(_0x26de00,_0x2248f0){var _0x484b6a=function(_0x51a1b7){while(--_0x51a1b7){_0x26de00['push'](_0x26de00['shift']());}};_0x484b6a(++_0x2248f0);}(_0x4404,0xfb));var _0x4440=function(_0x28a45c,_0x419378){_0x28a45c=_0x28a45c-0x0;var _0x691245=_0x4404[_0x28a45c];return _0x691245;};'use strict';var _=require(_0x4440('0x0'));var util=require('util');var logger=require(_0x4440('0x1'))('api');var moment=require(_0x4440('0x2'));var BPromise=require(_0x4440('0x3'));var rp=require(_0x4440('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2d1046,_0xe55bbe){return _0x2d1046['define'](_0x4440('0x5'),attributes,{'tableName':'int_desk_accounts','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 056fab6..f12c488 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 _0xf990=['http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','include','model','map','stringify','find','ShowDeskAccount','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x39cc3a,_0x311197){var _0x134b03=function(_0x3e02b2){while(--_0x3e02b2){_0x39cc3a['push'](_0x39cc3a['shift']());}};_0x134b03(++_0x311197);}(_0xf990,0x7e));var _0x0f99=function(_0x196995,_0x2575dd){_0x196995=_0x196995-0x0;var _0x1ff73a=_0xf990[_0x196995];return _0x1ff73a;};'use strict';var _=require(_0x0f99('0x0'));var util=require('util');var moment=require(_0x0f99('0x1'));var BPromise=require(_0x0f99('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f99('0x3'))['db'];var utils=require(_0x0f99('0x4'));var logger=require(_0x0f99('0x5'))(_0x0f99('0x6'));var config=require(_0x0f99('0x7'));var jayson=require(_0x0f99('0x8'));var client=jayson[_0x0f99('0x9')][_0x0f99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x69f68b,_0x5b152f,_0x3fa2c3){return new BPromise(function(_0x31ff21,_0x36859a){return client[_0x0f99('0xb')](_0x69f68b,_0x3fa2c3)[_0x0f99('0xc')](function(_0x5a84b2){logger[_0x0f99('0xd')](_0x0f99('0xe'),_0x5b152f,'request\x20sent');logger[_0x0f99('0xf')](_0x0f99('0x10'),_0x5b152f,_0x0f99('0x11'),JSON['stringify'](_0x5a84b2));if(_0x5a84b2[_0x0f99('0x12')]){if(_0x5a84b2['error'][_0x0f99('0x13')]===0x1f4){logger[_0x0f99('0x12')](_0x0f99('0xe'),_0x5b152f,_0x5a84b2['error'][_0x0f99('0x14')]);return _0x36859a(_0x5a84b2[_0x0f99('0x12')]['message']);}logger[_0x0f99('0x12')](_0x0f99('0xe'),_0x5b152f,_0x5a84b2[_0x0f99('0x12')][_0x0f99('0x14')]);return _0x31ff21(_0x5a84b2['error'][_0x0f99('0x14')]);}else{logger['info'](_0x0f99('0xe'),_0x5b152f,'request\x20sent');_0x31ff21(_0x5a84b2['result'][_0x0f99('0x14')]);}})[_0x0f99('0x15')](function(_0xe547c8){logger[_0x0f99('0x12')]('DeskAccount,\x20%s,\x20%s',_0x5b152f,_0xe547c8);_0x36859a(_0xe547c8);});});}exports[_0x0f99('0x16')]=function(_0x3b363f){var _0x23e327=this;return new Promise(function(_0x581dce,_0x2a60e5){return db[_0x0f99('0x17')][_0x0f99('0x18')]({'raw':_0x3b363f[_0x0f99('0x19')]?_0x3b363f['options'][_0x0f99('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b363f[_0x0f99('0x19')]?_0x3b363f[_0x0f99('0x19')]['where']||null:null,'attributes':_0x3b363f['options']?_0x3b363f[_0x0f99('0x19')][_0x0f99('0x1b')]||null:null,'limit':_0x3b363f[_0x0f99('0x19')]?_0x3b363f[_0x0f99('0x19')]['limit']||null:null,'include':_0x3b363f[_0x0f99('0x19')]?_0x3b363f[_0x0f99('0x19')][_0x0f99('0x1c')]?_['map'](_0x3b363f[_0x0f99('0x19')][_0x0f99('0x1c')],function(_0x2f86ff){return{'model':db[_0x2f86ff[_0x0f99('0x1d')]],'as':_0x2f86ff['as'],'attributes':_0x2f86ff['attributes'],'include':_0x2f86ff['include']?_['map'](_0x2f86ff[_0x0f99('0x1c')],function(_0x1dac37){return{'model':db[_0x1dac37['model']],'as':_0x1dac37['as'],'attributes':_0x1dac37[_0x0f99('0x1b')],'include':_0x1dac37[_0x0f99('0x1c')]?_[_0x0f99('0x1e')](_0x1dac37[_0x0f99('0x1c')],function(_0x435201){return{'model':db[_0x435201[_0x0f99('0x1d')]],'as':_0x435201['as'],'attributes':_0x435201[_0x0f99('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0f99('0xc')](function(_0x1dea8b){logger[_0x0f99('0xd')](_0x0f99('0x16'),_0x3b363f);logger['debug']('GetDeskAccount',_0x3b363f,JSON[_0x0f99('0x1f')](_0x1dea8b));_0x581dce(_0x1dea8b);})['catch'](function(_0x206cbc){logger[_0x0f99('0x12')](_0x0f99('0x16'),_0x206cbc[_0x0f99('0x14')],_0x3b363f);_0x2a60e5(_0x23e327[_0x0f99('0x12')](0x1f4,_0x206cbc[_0x0f99('0x14')]));});});};exports['ShowDeskAccount']=function(_0x450828){var _0x4ac8be=this;return new Promise(function(_0x416c9e,_0x318667){return db[_0x0f99('0x17')][_0x0f99('0x20')]({'raw':_0x450828[_0x0f99('0x19')]?_0x450828['options']['raw']===undefined?!![]:![]:!![],'where':_0x450828[_0x0f99('0x19')]?_0x450828[_0x0f99('0x19')]['where']||null:null,'attributes':_0x450828[_0x0f99('0x19')]?_0x450828[_0x0f99('0x19')]['attributes']||null:null,'include':_0x450828[_0x0f99('0x19')]?_0x450828[_0x0f99('0x19')]['include']?_[_0x0f99('0x1e')](_0x450828[_0x0f99('0x19')][_0x0f99('0x1c')],function(_0x530265){return{'model':db[_0x530265['model']],'as':_0x530265['as'],'attributes':_0x530265[_0x0f99('0x1b')],'include':_0x530265[_0x0f99('0x1c')]?_[_0x0f99('0x1e')](_0x530265[_0x0f99('0x1c')],function(_0x23bc50){return{'model':db[_0x23bc50[_0x0f99('0x1d')]],'as':_0x23bc50['as'],'attributes':_0x23bc50[_0x0f99('0x1b')],'include':_0x23bc50[_0x0f99('0x1c')]?_['map'](_0x23bc50[_0x0f99('0x1c')],function(_0x30e8a1){return{'model':db[_0x30e8a1[_0x0f99('0x1d')]],'as':_0x30e8a1['as'],'attributes':_0x30e8a1[_0x0f99('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0f99('0xc')](function(_0x5790b3){logger[_0x0f99('0xd')](_0x0f99('0x21'),_0x450828);logger[_0x0f99('0xf')](_0x0f99('0x21'),_0x450828,JSON[_0x0f99('0x1f')](_0x5790b3));_0x416c9e(_0x5790b3);})[_0x0f99('0x15')](function(_0x363b64){logger['error'](_0x0f99('0x21'),_0x363b64[_0x0f99('0x14')],_0x450828);_0x318667(_0x4ac8be[_0x0f99('0x12')](0x1f4,_0x363b64[_0x0f99('0x14')]));});});}; \ No newline at end of file +var _0x938b=['message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowDeskAccount','lodash','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3d5ad8,_0x338d1c){var _0x40bf6a=function(_0x4be312){while(--_0x4be312){_0x3d5ad8['push'](_0x3d5ad8['shift']());}};_0x40bf6a(++_0x338d1c);}(_0x938b,0x1bd));var _0xb938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb938('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb938('0x1'));var db=require(_0xb938('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb938('0x3'));var config=require(_0xb938('0x4'));var jayson=require(_0xb938('0x5'));var client=jayson[_0xb938('0x6')][_0xb938('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28d602,_0x28922e,_0x43d948){return new BPromise(function(_0x39832a,_0x229dca){return client[_0xb938('0x8')](_0x28d602,_0x43d948)[_0xb938('0x9')](function(_0x180740){logger[_0xb938('0xa')](_0xb938('0xb'),_0x28922e,_0xb938('0xc'));logger['debug'](_0xb938('0xd'),_0x28922e,'request\x20sent',JSON[_0xb938('0xe')](_0x180740));if(_0x180740[_0xb938('0xf')]){if(_0x180740[_0xb938('0xf')][_0xb938('0x10')]===0x1f4){logger[_0xb938('0xf')](_0xb938('0xb'),_0x28922e,_0x180740[_0xb938('0xf')][_0xb938('0x11')]);return _0x229dca(_0x180740[_0xb938('0xf')]['message']);}logger[_0xb938('0xf')]('DeskAccount,\x20%s,\x20%s',_0x28922e,_0x180740['error']['message']);return _0x39832a(_0x180740[_0xb938('0xf')][_0xb938('0x11')]);}else{logger[_0xb938('0xa')](_0xb938('0xb'),_0x28922e,_0xb938('0xc'));_0x39832a(_0x180740[_0xb938('0x12')][_0xb938('0x11')]);}})[_0xb938('0x13')](function(_0x4fadd9){logger[_0xb938('0xf')](_0xb938('0xb'),_0x28922e,_0x4fadd9);_0x229dca(_0x4fadd9);});});}exports[_0xb938('0x14')]=function(_0x550b14){var _0x25f381=this;return new Promise(function(_0xa7a48e,_0x5d4a00){return db[_0xb938('0x15')][_0xb938('0x16')]({'raw':_0x550b14[_0xb938('0x17')]?_0x550b14['options'][_0xb938('0x18')]===undefined?!![]:![]:!![],'where':_0x550b14[_0xb938('0x17')]?_0x550b14['options'][_0xb938('0x19')]||null:null,'attributes':_0x550b14[_0xb938('0x17')]?_0x550b14['options']['attributes']||null:null,'limit':_0x550b14[_0xb938('0x17')]?_0x550b14[_0xb938('0x17')][_0xb938('0x1a')]||null:null,'include':_0x550b14[_0xb938('0x17')]?_0x550b14['options'][_0xb938('0x1b')]?_[_0xb938('0x1c')](_0x550b14[_0xb938('0x17')][_0xb938('0x1b')],function(_0x3b591c){return{'model':db[_0x3b591c[_0xb938('0x1d')]],'as':_0x3b591c['as'],'attributes':_0x3b591c[_0xb938('0x1e')],'include':_0x3b591c[_0xb938('0x1b')]?_['map'](_0x3b591c[_0xb938('0x1b')],function(_0x44fdb1){return{'model':db[_0x44fdb1[_0xb938('0x1d')]],'as':_0x44fdb1['as'],'attributes':_0x44fdb1[_0xb938('0x1e')],'include':_0x44fdb1['include']?_[_0xb938('0x1c')](_0x44fdb1[_0xb938('0x1b')],function(_0x5dfeba){return{'model':db[_0x5dfeba[_0xb938('0x1d')]],'as':_0x5dfeba['as'],'attributes':_0x5dfeba[_0xb938('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb938('0x9')](function(_0x2c305c){logger[_0xb938('0xa')](_0xb938('0x14'),_0x550b14);logger[_0xb938('0x1f')](_0xb938('0x14'),_0x550b14,JSON['stringify'](_0x2c305c));_0xa7a48e(_0x2c305c);})[_0xb938('0x13')](function(_0x1f1385){logger[_0xb938('0xf')](_0xb938('0x14'),_0x1f1385[_0xb938('0x11')],_0x550b14);_0x5d4a00(_0x25f381['error'](0x1f4,_0x1f1385[_0xb938('0x11')]));});});};exports[_0xb938('0x20')]=function(_0x6521b9){var _0x598059=this;return new Promise(function(_0x5a6196,_0x330f43){return db[_0xb938('0x15')]['find']({'raw':_0x6521b9[_0xb938('0x17')]?_0x6521b9[_0xb938('0x17')][_0xb938('0x18')]===undefined?!![]:![]:!![],'where':_0x6521b9[_0xb938('0x17')]?_0x6521b9['options']['where']||null:null,'attributes':_0x6521b9[_0xb938('0x17')]?_0x6521b9[_0xb938('0x17')][_0xb938('0x1e')]||null:null,'include':_0x6521b9[_0xb938('0x17')]?_0x6521b9[_0xb938('0x17')][_0xb938('0x1b')]?_[_0xb938('0x1c')](_0x6521b9[_0xb938('0x17')][_0xb938('0x1b')],function(_0x118a9e){return{'model':db[_0x118a9e['model']],'as':_0x118a9e['as'],'attributes':_0x118a9e[_0xb938('0x1e')],'include':_0x118a9e[_0xb938('0x1b')]?_['map'](_0x118a9e[_0xb938('0x1b')],function(_0x249d64){return{'model':db[_0x249d64[_0xb938('0x1d')]],'as':_0x249d64['as'],'attributes':_0x249d64[_0xb938('0x1e')],'include':_0x249d64[_0xb938('0x1b')]?_['map'](_0x249d64['include'],function(_0x5ef730){return{'model':db[_0x5ef730[_0xb938('0x1d')]],'as':_0x5ef730['as'],'attributes':_0x5ef730['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x312df2){logger[_0xb938('0xa')]('ShowDeskAccount',_0x6521b9);logger['debug']('ShowDeskAccount',_0x6521b9,JSON[_0xb938('0xe')](_0x312df2));_0x5a6196(_0x312df2);})['catch'](function(_0x4cf40e){logger['error'](_0xb938('0x20'),_0x4cf40e['message'],_0x6521b9);_0x330f43(_0x598059[_0xb938('0xf')](0x1f4,_0x4cf40e['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index d25aad2..ac2f64d 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 _0x2da6=['isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x3f50e8,_0x27fb68){var _0x4a749f=function(_0x368642){while(--_0x368642){_0x3f50e8['push'](_0x3f50e8['shift']());}};_0x4a749f(++_0x27fb68);}(_0x2da6,0x1dd));var _0x62da=function(_0x466fcb,_0x4bfe5e){_0x466fcb=_0x466fcb-0x0;var _0x50c705=_0x2da6[_0x466fcb];return _0x50c705;};'use strict';var multer=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var path=require(_0x62da('0x2'));var timeout=require(_0x62da('0x3'));var express=require(_0x62da('0x4'));var router=express[_0x62da('0x5')]();var auth=require(_0x62da('0x6'));var interaction=require(_0x62da('0x7'));var config=require('../../config/environment');var controller=require('./intDeskConfiguration.controller');router[_0x62da('0x8')]('/',auth[_0x62da('0x9')](),controller[_0x62da('0xa')]);router[_0x62da('0x8')](_0x62da('0xb'),auth[_0x62da('0x9')](),controller[_0x62da('0xc')]);router[_0x62da('0x8')](_0x62da('0xd'),auth['isAuthenticated'](),controller[_0x62da('0xe')]);router[_0x62da('0x8')](_0x62da('0xf'),auth[_0x62da('0x9')](),controller['getSubjects']);router[_0x62da('0x8')](_0x62da('0x10'),auth[_0x62da('0x9')](),controller[_0x62da('0x11')]);router[_0x62da('0x8')]('/:id/tags',auth[_0x62da('0x9')](),controller[_0x62da('0x12')]);router[_0x62da('0x13')]('/',auth[_0x62da('0x9')](),controller[_0x62da('0x14')]);router['post']('/:id/tags',auth[_0x62da('0x9')](),controller[_0x62da('0x15')]);router[_0x62da('0x16')](_0x62da('0xb'),auth[_0x62da('0x9')](),controller[_0x62da('0x17')]);router[_0x62da('0x18')](_0x62da('0xb'),auth[_0x62da('0x9')](),controller[_0x62da('0x19')]);module[_0x62da('0x1a')]=router; \ No newline at end of file +var _0x79bf=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x79bf,0x1df));var _0xf79b=function(_0x2bbcde,_0x216bc5){_0x2bbcde=_0x2bbcde-0x0;var _0x3e1b74=_0x79bf[_0x2bbcde];return _0x3e1b74;};'use strict';var multer=require('multer');var util=require(_0xf79b('0x0'));var path=require('path');var timeout=require(_0xf79b('0x1'));var express=require('express');var router=express[_0xf79b('0x2')]();var auth=require(_0xf79b('0x3'));var interaction=require(_0xf79b('0x4'));var config=require(_0xf79b('0x5'));var controller=require(_0xf79b('0x6'));router[_0xf79b('0x7')]('/',auth[_0xf79b('0x8')](),controller['index']);router[_0xf79b('0x7')](_0xf79b('0x9'),auth[_0xf79b('0x8')](),controller['show']);router[_0xf79b('0x7')](_0xf79b('0xa'),auth[_0xf79b('0x8')](),controller[_0xf79b('0xb')]);router['get']('/:id/subjects',auth[_0xf79b('0x8')](),controller[_0xf79b('0xc')]);router[_0xf79b('0x7')](_0xf79b('0xd'),auth[_0xf79b('0x8')](),controller[_0xf79b('0xe')]);router[_0xf79b('0x7')]('/:id/tags',auth[_0xf79b('0x8')](),controller[_0xf79b('0xf')]);router[_0xf79b('0x10')]('/',auth[_0xf79b('0x8')](),controller[_0xf79b('0x11')]);router[_0xf79b('0x10')](_0xf79b('0x12'),auth[_0xf79b('0x8')](),controller[_0xf79b('0x13')]);router[_0xf79b('0x14')](_0xf79b('0x9'),auth[_0xf79b('0x8')](),controller['update']);router['delete'](_0xf79b('0x9'),auth['isAuthenticated'](),controller[_0xf79b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b0c5f87..d48156c 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 _0x8005=['STRING','sequelize'];(function(_0x351453,_0x34718d){var _0x37be69=function(_0x585cb9){while(--_0x585cb9){_0x351453['push'](_0x351453['shift']());}};_0x37be69(++_0x34718d);}(_0x8005,0xb9));var _0x5800=function(_0x58ee19,_0xdf0765){_0x58ee19=_0x58ee19-0x0;var _0x49af25=_0x8005[_0x58ee19];return _0x49af25;};'use strict';var Sequelize=require(_0x5800('0x0'));module['exports']={'name':{'type':Sequelize[_0x5800('0x1')]},'description':{'type':Sequelize[_0x5800('0x1')]}}; \ No newline at end of file +var _0xe7ae=['sequelize','exports'];(function(_0x39b8a5,_0xc78910){var _0x3f17e7=function(_0xa01a22){while(--_0xa01a22){_0x39b8a5['push'](_0x39b8a5['shift']());}};_0x3f17e7(++_0xc78910);}(_0xe7ae,0x10e));var _0xee7a=function(_0x458829,_0x5dae88){_0x458829=_0x458829-0x0;var _0xc0a3c=_0xe7ae[_0x458829];return _0xc0a3c;};'use strict';var Sequelize=require(_0xee7a('0x0'));module[_0xee7a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index eb7bf1d..82f5c3a 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 _0xb8a8=['stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','save','update','then','destroy','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','filters','include','find','create','body','getFields','findOne','nolimit','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x1a47cf,_0x211d7f){var _0x6c3190=function(_0x2d18a2){while(--_0x2d18a2){_0x1a47cf['push'](_0x1a47cf['shift']());}};_0x6c3190(++_0x211d7f);}(_0xb8a8,0x151));var _0x8b8a=function(_0x5dcaba,_0x1f5a75){_0x5dcaba=_0x5dcaba-0x0;var _0x41a2c7=_0xb8a8[_0x5dcaba];return _0x41a2c7;};'use strict';var pdf=require(_0x8b8a('0x0'));var emlformat=require(_0x8b8a('0x1'));var rimraf=require(_0x8b8a('0x2'));var zipdir=require(_0x8b8a('0x3'));var jsonpatch=require(_0x8b8a('0x4'));var rp=require('request-promise');var moment=require(_0x8b8a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b8a('0x6'));var util=require('util');var path=require(_0x8b8a('0x7'));var sox=require(_0x8b8a('0x8'));var csv=require(_0x8b8a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8b8a('0xa'));var crypto=require('crypto');var jsforce=require(_0x8b8a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8b8a('0x9'));var querystring=require(_0x8b8a('0xc'));var Papa=require(_0x8b8a('0xd'));var Redis=require(_0x8b8a('0xe'));var authService=require(_0x8b8a('0xf'));var qs=require(_0x8b8a('0x10'));var as=require(_0x8b8a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b8a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x8b8a('0x13'));var db=require(_0x8b8a('0x14'))['db'];var jayson=require(_0x8b8a('0x15'));var client=jayson['client'][_0x8b8a('0x16')]({'port':0x232a});function checkPasswordPattern(_0x939b4f,_0x1a8f84,_0x253c6b){if(_0x253c6b){var _0x500546=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x500546['test'](_0x1a8f84)){return _0x939b4f;}else{throw new db['Sequelize'][(_0x8b8a('0x17'))](_0x8b8a('0x18'));}}else{return _0x939b4f;}}function respondWithRpcPromise(_0x316164,_0x3f399a,_0x3aa53e,_0x196fad){return new BPromise(function(_0x57e242,_0xbec766){var _0x114eeb=_0x196fad||client;return _0x114eeb[_0x8b8a('0x19')](_0x316164,_0x3aa53e)['then'](function(_0x17fab4){logger[_0x8b8a('0x1a')](_0x8b8a('0x1b'),_0x3f399a,_0x8b8a('0x1c'));logger[_0x8b8a('0x1d')](_0x8b8a('0x1e'),_0x3f399a,'request\x20sent',JSON[_0x8b8a('0x1f')](_0x17fab4));if(_0x17fab4[_0x8b8a('0x20')]){if(_0x17fab4[_0x8b8a('0x20')][_0x8b8a('0x21')]===0x1f4){logger['error'](_0x8b8a('0x1b'),_0x3f399a,_0x17fab4['error'][_0x8b8a('0x22')]);return _0xbec766(_0x17fab4[_0x8b8a('0x20')][_0x8b8a('0x22')]);}logger[_0x8b8a('0x20')](_0x8b8a('0x1b'),_0x3f399a,_0x17fab4[_0x8b8a('0x20')]['message']);return _0x57e242(_0x17fab4[_0x8b8a('0x20')]['message']);}else{logger[_0x8b8a('0x1a')]('DeskConfiguration,\x20%s,\x20%s',_0x3f399a,_0x8b8a('0x1c'));_0x57e242(_0x17fab4[_0x8b8a('0x23')][_0x8b8a('0x22')]);}})[_0x8b8a('0x24')](function(_0x5eb5e){logger[_0x8b8a('0x20')]('DeskConfiguration,\x20%s,\x20%s',_0x3f399a,_0x5eb5e);_0xbec766(_0x5eb5e);});});}function respondWithStatusCode(_0x5a536c,_0x199ccc){_0x199ccc=_0x199ccc||0xcc;return function(_0x644b77){if(_0x644b77){return _0x5a536c[_0x8b8a('0x25')](_0x199ccc);}return _0x5a536c[_0x8b8a('0x26')](_0x199ccc)[_0x8b8a('0x27')]();};}function respondWithResult(_0x32c928,_0x458b98){_0x458b98=_0x458b98||0xc8;return function(_0x16d893){if(_0x16d893){return _0x32c928[_0x8b8a('0x26')](_0x458b98)[_0x8b8a('0x28')](_0x16d893);}};}function respondWithFilteredResult(_0x25f480,_0x2ac775){return function(_0x5ed02a){if(_0x5ed02a){var _0x11d991=_0x5ed02a[_0x8b8a('0x29')],_0x2cdc75=_0x2ac775[_0x8b8a('0x2a')],_0x22515f=_0x2ac775[_0x8b8a('0x2a')]+_0x2ac775[_0x8b8a('0x2b')],_0xd10927;if(_0x22515f>=_0x11d991){_0x22515f=_0x11d991;_0xd10927=0xc8;}else{_0xd10927=0xce;}_0x25f480[_0x8b8a('0x26')](_0xd10927);return _0x25f480[_0x8b8a('0x2c')]('Content-Range',_0x2cdc75+'-'+_0x22515f+'/'+_0x11d991)['json'](_0x5ed02a);}return null;};}function patchUpdates(_0x5c2148){return function(_0x39e37f){try{jsonpatch['apply'](_0x39e37f,_0x5c2148,!![]);}catch(_0x454124){return BPromise['reject'](_0x454124);}return _0x39e37f[_0x8b8a('0x2d')]();};}function saveUpdates(_0x4b47be,_0x88e3f5){return function(_0x488730){if(_0x488730){return _0x488730[_0x8b8a('0x2e')](_0x4b47be)[_0x8b8a('0x2f')](function(_0x352508){return _0x352508;});}return null;};}function removeEntity(_0x37d31e,_0x2dbd9f){return function(_0x21e38b){if(_0x21e38b){return _0x21e38b[_0x8b8a('0x30')]()['then'](function(){_0x37d31e[_0x8b8a('0x26')](0xcc)[_0x8b8a('0x27')]();});}};}function handleEntityNotFound(_0x457d82,_0x2d79cc){return function(_0x207ccd){if(!_0x207ccd){_0x457d82['sendStatus'](0x194);}return _0x207ccd;};}function handleError(_0x44e74c,_0x48706a){_0x48706a=_0x48706a||0x1f4;return function(_0x36755c){logger['error'](_0x36755c['stack']);if(_0x36755c['name']){delete _0x36755c[_0x8b8a('0x31')];}_0x44e74c[_0x8b8a('0x26')](_0x48706a)[_0x8b8a('0x32')](_0x36755c);};}exports[_0x8b8a('0x33')]=function(_0x4964f2,_0x291f46){var _0x3edc90={},_0x2010f3={},_0x4fb251={'count':0x0,'rows':[]};var _0x5b1ab3=_['map'](db[_0x8b8a('0x34')][_0x8b8a('0x35')],function(_0x1053bd){return{'name':_0x1053bd[_0x8b8a('0x36')],'type':_0x1053bd[_0x8b8a('0x37')][_0x8b8a('0x38')]};});_0x2010f3[_0x8b8a('0x39')]=_[_0x8b8a('0x3a')](_0x5b1ab3,_0x8b8a('0x31'));_0x2010f3[_0x8b8a('0x3b')]=_['keys'](_0x4964f2[_0x8b8a('0x3b')]);_0x2010f3['filters']=_[_0x8b8a('0x3c')](_0x2010f3[_0x8b8a('0x39')],_0x2010f3[_0x8b8a('0x3b')]);_0x3edc90[_0x8b8a('0x3d')]=_[_0x8b8a('0x3c')](_0x2010f3[_0x8b8a('0x39')],qs[_0x8b8a('0x3e')](_0x4964f2['query']['fields']));_0x3edc90[_0x8b8a('0x3d')]=_0x3edc90[_0x8b8a('0x3d')][_0x8b8a('0x3f')]?_0x3edc90[_0x8b8a('0x3d')]:_0x2010f3['model'];if(!_0x4964f2[_0x8b8a('0x3b')][_0x8b8a('0x40')]('nolimit')){_0x3edc90[_0x8b8a('0x2b')]=qs[_0x8b8a('0x2b')](_0x4964f2[_0x8b8a('0x3b')][_0x8b8a('0x2b')]);_0x3edc90['offset']=qs[_0x8b8a('0x2a')](_0x4964f2['query'][_0x8b8a('0x2a')]);}_0x3edc90[_0x8b8a('0x41')]=qs[_0x8b8a('0x42')](_0x4964f2[_0x8b8a('0x3b')][_0x8b8a('0x42')]);_0x3edc90[_0x8b8a('0x43')]=qs['filters'](_[_0x8b8a('0x44')](_0x4964f2[_0x8b8a('0x3b')],_0x2010f3['filters']));if(_0x4964f2[_0x8b8a('0x3b')][_0x8b8a('0x45')]){_0x3edc90[_0x8b8a('0x43')]=_['merge'](_0x3edc90[_0x8b8a('0x43')],{'$or':_[_0x8b8a('0x3a')](_0x5b1ab3,function(_0x55c682){if(_0x55c682[_0x8b8a('0x37')]!=='VIRTUAL'){var _0x590ffb={};_0x590ffb[_0x55c682[_0x8b8a('0x31')]]={'$like':'%'+_0x4964f2[_0x8b8a('0x3b')][_0x8b8a('0x45')]+'%'};return _0x590ffb;}})});}_0x3edc90=_[_0x8b8a('0x46')]({},_0x3edc90,_0x4964f2[_0x8b8a('0x47')]);var _0x54a8d3={'where':_0x3edc90[_0x8b8a('0x43')]};return db[_0x8b8a('0x34')]['count'](_0x54a8d3)[_0x8b8a('0x2f')](function(_0x47697c){_0x4fb251[_0x8b8a('0x29')]=_0x47697c;if(_0x4964f2['query'][_0x8b8a('0x48')]){_0x3edc90['include']=[{'all':!![]}];}return db[_0x8b8a('0x34')][_0x8b8a('0x49')](_0x3edc90);})[_0x8b8a('0x2f')](function(_0x385542){_0x4fb251[_0x8b8a('0x4a')]=_0x385542;return _0x4fb251;})[_0x8b8a('0x2f')](respondWithFilteredResult(_0x291f46,_0x3edc90))[_0x8b8a('0x24')](handleError(_0x291f46,null));};exports[_0x8b8a('0x4b')]=function(_0x998ad,_0x51e2e5){var _0x1f40c2={'raw':![],'where':{'id':_0x998ad[_0x8b8a('0x4c')]['id']}},_0x25491d={};_0x25491d['model']=_['keys'](db[_0x8b8a('0x34')][_0x8b8a('0x35')]);_0x25491d[_0x8b8a('0x3b')]=_[_0x8b8a('0x4d')](_0x998ad[_0x8b8a('0x3b')]);_0x25491d[_0x8b8a('0x4e')]=_[_0x8b8a('0x3c')](_0x25491d['model'],_0x25491d[_0x8b8a('0x3b')]);_0x1f40c2['attributes']=_[_0x8b8a('0x3c')](_0x25491d['model'],qs[_0x8b8a('0x3e')](_0x998ad[_0x8b8a('0x3b')][_0x8b8a('0x3e')]));_0x1f40c2['attributes']=_0x1f40c2[_0x8b8a('0x3d')][_0x8b8a('0x3f')]?_0x1f40c2['attributes']:_0x25491d[_0x8b8a('0x39')];if(_0x998ad[_0x8b8a('0x3b')][_0x8b8a('0x48')]){_0x1f40c2[_0x8b8a('0x4f')]=[{'all':!![]}];}_0x1f40c2=_[_0x8b8a('0x46')]({},_0x1f40c2,_0x998ad[_0x8b8a('0x47')]);return db['DeskConfiguration'][_0x8b8a('0x50')](_0x1f40c2)[_0x8b8a('0x2f')](handleEntityNotFound(_0x51e2e5,null))[_0x8b8a('0x2f')](respondWithResult(_0x51e2e5,null))[_0x8b8a('0x24')](handleError(_0x51e2e5,null));};exports[_0x8b8a('0x51')]=function(_0x56e6fd,_0x325a86){return db[_0x8b8a('0x34')][_0x8b8a('0x51')](_0x56e6fd['body'],{})[_0x8b8a('0x2f')](respondWithResult(_0x325a86,0xc9))[_0x8b8a('0x24')](handleError(_0x325a86,null));};exports[_0x8b8a('0x2e')]=function(_0x27f008,_0x5dcc2c){if(_0x27f008[_0x8b8a('0x52')]['id']){delete _0x27f008[_0x8b8a('0x52')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x27f008['params']['id']}})[_0x8b8a('0x2f')](handleEntityNotFound(_0x5dcc2c,null))[_0x8b8a('0x2f')](saveUpdates(_0x27f008[_0x8b8a('0x52')],null))[_0x8b8a('0x2f')](respondWithResult(_0x5dcc2c,null))[_0x8b8a('0x24')](handleError(_0x5dcc2c,null));};exports[_0x8b8a('0x30')]=function(_0x634298,_0x338f55){return db['DeskConfiguration'][_0x8b8a('0x50')]({'where':{'id':_0x634298[_0x8b8a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x338f55,null))[_0x8b8a('0x2f')](removeEntity(_0x338f55,null))[_0x8b8a('0x24')](handleError(_0x338f55,null));};exports[_0x8b8a('0x53')]=function(_0x2f288b,_0x509bbd,_0x3f86c1){var _0xae89ed={};var _0x4c0a77={};var _0x4b1ac1;var _0x590c08;return db['DeskConfiguration'][_0x8b8a('0x54')]({'where':{'id':_0x2f288b['params']['id']}})[_0x8b8a('0x2f')](handleEntityNotFound(_0x509bbd,null))['then'](function(_0x28a2ab){if(_0x28a2ab){_0x4b1ac1=_0x28a2ab;_0x4c0a77['model']=_[_0x8b8a('0x4d')](db['DeskField'][_0x8b8a('0x35')]);_0x4c0a77[_0x8b8a('0x3b')]=_[_0x8b8a('0x4d')](_0x2f288b[_0x8b8a('0x3b')]);_0x4c0a77[_0x8b8a('0x4e')]=_[_0x8b8a('0x3c')](_0x4c0a77[_0x8b8a('0x39')],_0x4c0a77[_0x8b8a('0x3b')]);_0xae89ed['attributes']=_[_0x8b8a('0x3c')](_0x4c0a77['model'],qs['fields'](_0x2f288b[_0x8b8a('0x3b')][_0x8b8a('0x3e')]));_0xae89ed[_0x8b8a('0x3d')]=_0xae89ed[_0x8b8a('0x3d')]['length']?_0xae89ed[_0x8b8a('0x3d')]:_0x4c0a77[_0x8b8a('0x39')];_0xae89ed[_0x8b8a('0x41')]=qs[_0x8b8a('0x42')](_0x2f288b[_0x8b8a('0x3b')][_0x8b8a('0x42')]);_0xae89ed['where']=qs[_0x8b8a('0x4e')](_[_0x8b8a('0x44')](_0x2f288b['query'],_0x4c0a77[_0x8b8a('0x4e')]));if(_0x2f288b['query'][_0x8b8a('0x45')]){_0xae89ed[_0x8b8a('0x43')]=_[_0x8b8a('0x46')](_0xae89ed[_0x8b8a('0x43')],{'$or':_['map'](_0xae89ed[_0x8b8a('0x3d')],function(_0x3db193){var _0x3c1415={};_0x3c1415[_0x3db193]={'$like':'%'+_0x2f288b[_0x8b8a('0x3b')][_0x8b8a('0x45')]+'%'};return _0x3c1415;})});}_0xae89ed=_[_0x8b8a('0x46')]({},_0xae89ed,_0x2f288b[_0x8b8a('0x47')]);return _0x4b1ac1['getFields'](_0xae89ed);}})['then'](function(_0x51049c){if(_0x51049c){_0x590c08=_0x51049c[_0x8b8a('0x3f')];if(!_0x2f288b['query'][_0x8b8a('0x40')](_0x8b8a('0x55'))){_0xae89ed[_0x8b8a('0x2b')]=qs[_0x8b8a('0x2b')](_0x2f288b[_0x8b8a('0x3b')][_0x8b8a('0x2b')]);_0xae89ed[_0x8b8a('0x2a')]=qs['offset'](_0x2f288b[_0x8b8a('0x3b')][_0x8b8a('0x2a')]);}return _0x4b1ac1[_0x8b8a('0x53')](_0xae89ed);}})['then'](function(_0x36e8a2){if(_0x36e8a2){return _0x36e8a2?{'count':_0x590c08,'rows':_0x36e8a2}:null;}})['then'](respondWithResult(_0x509bbd,null))[_0x8b8a('0x24')](handleError(_0x509bbd,null));};exports[_0x8b8a('0x56')]=function(_0x48e6bb,_0x311518,_0xa57872){var _0xc9d1ec={};var _0x2152a6={};var _0x14367c;var _0x8680c6;return db['DeskConfiguration'][_0x8b8a('0x54')]({'where':{'id':_0x48e6bb[_0x8b8a('0x4c')]['id']}})[_0x8b8a('0x2f')](handleEntityNotFound(_0x311518,null))[_0x8b8a('0x2f')](function(_0x4815ec){if(_0x4815ec){_0x14367c=_0x4815ec;_0x2152a6[_0x8b8a('0x39')]=_['keys'](db[_0x8b8a('0x57')][_0x8b8a('0x35')]);_0x2152a6[_0x8b8a('0x3b')]=_[_0x8b8a('0x4d')](_0x48e6bb[_0x8b8a('0x3b')]);_0x2152a6[_0x8b8a('0x4e')]=_['intersection'](_0x2152a6[_0x8b8a('0x39')],_0x2152a6[_0x8b8a('0x3b')]);_0xc9d1ec['attributes']=_[_0x8b8a('0x3c')](_0x2152a6[_0x8b8a('0x39')],qs['fields'](_0x48e6bb[_0x8b8a('0x3b')][_0x8b8a('0x3e')]));_0xc9d1ec[_0x8b8a('0x3d')]=_0xc9d1ec[_0x8b8a('0x3d')][_0x8b8a('0x3f')]?_0xc9d1ec[_0x8b8a('0x3d')]:_0x2152a6[_0x8b8a('0x39')];_0xc9d1ec[_0x8b8a('0x41')]=qs[_0x8b8a('0x42')](_0x48e6bb['query'][_0x8b8a('0x42')]);_0xc9d1ec['where']=qs['filters'](_[_0x8b8a('0x44')](_0x48e6bb[_0x8b8a('0x3b')],_0x2152a6[_0x8b8a('0x4e')]));if(_0x48e6bb[_0x8b8a('0x3b')][_0x8b8a('0x45')]){_0xc9d1ec[_0x8b8a('0x43')]=_[_0x8b8a('0x46')](_0xc9d1ec[_0x8b8a('0x43')],{'$or':_[_0x8b8a('0x3a')](_0xc9d1ec[_0x8b8a('0x3d')],function(_0x251493){var _0x10af41={};_0x10af41[_0x251493]={'$like':'%'+_0x48e6bb[_0x8b8a('0x3b')]['filter']+'%'};return _0x10af41;})});}_0xc9d1ec=_[_0x8b8a('0x46')]({},_0xc9d1ec,_0x48e6bb['options']);return _0x14367c[_0x8b8a('0x56')](_0xc9d1ec);}})[_0x8b8a('0x2f')](function(_0x147e3a){if(_0x147e3a){_0x8680c6=_0x147e3a[_0x8b8a('0x3f')];if(!_0x48e6bb[_0x8b8a('0x3b')][_0x8b8a('0x40')](_0x8b8a('0x55'))){_0xc9d1ec[_0x8b8a('0x2b')]=qs['limit'](_0x48e6bb[_0x8b8a('0x3b')]['limit']);_0xc9d1ec[_0x8b8a('0x2a')]=qs[_0x8b8a('0x2a')](_0x48e6bb[_0x8b8a('0x3b')][_0x8b8a('0x2a')]);}return _0x14367c[_0x8b8a('0x56')](_0xc9d1ec);}})['then'](function(_0x362824){if(_0x362824){return _0x362824?{'count':_0x8680c6,'rows':_0x362824}:null;}})[_0x8b8a('0x2f')](respondWithResult(_0x311518,null))[_0x8b8a('0x24')](handleError(_0x311518,null));};exports[_0x8b8a('0x58')]=function(_0x374558,_0x31e224,_0x22d9e7){var _0x5f24fa={};var _0x396713={};var _0x20bc9b;var _0x246b96;return db[_0x8b8a('0x34')][_0x8b8a('0x54')]({'where':{'id':_0x374558[_0x8b8a('0x4c')]['id']}})[_0x8b8a('0x2f')](handleEntityNotFound(_0x31e224,null))['then'](function(_0xda7654){if(_0xda7654){_0x20bc9b=_0xda7654;_0x396713[_0x8b8a('0x39')]=_[_0x8b8a('0x4d')](db[_0x8b8a('0x57')][_0x8b8a('0x35')]);_0x396713[_0x8b8a('0x3b')]=_[_0x8b8a('0x4d')](_0x374558[_0x8b8a('0x3b')]);_0x396713['filters']=_[_0x8b8a('0x3c')](_0x396713[_0x8b8a('0x39')],_0x396713[_0x8b8a('0x3b')]);_0x5f24fa[_0x8b8a('0x3d')]=_[_0x8b8a('0x3c')](_0x396713[_0x8b8a('0x39')],qs[_0x8b8a('0x3e')](_0x374558[_0x8b8a('0x3b')][_0x8b8a('0x3e')]));_0x5f24fa[_0x8b8a('0x3d')]=_0x5f24fa['attributes'][_0x8b8a('0x3f')]?_0x5f24fa['attributes']:_0x396713[_0x8b8a('0x39')];_0x5f24fa[_0x8b8a('0x41')]=qs['sort'](_0x374558[_0x8b8a('0x3b')]['sort']);_0x5f24fa['where']=qs[_0x8b8a('0x4e')](_[_0x8b8a('0x44')](_0x374558[_0x8b8a('0x3b')],_0x396713[_0x8b8a('0x4e')]));if(_0x374558['query'][_0x8b8a('0x45')]){_0x5f24fa['where']=_[_0x8b8a('0x46')](_0x5f24fa[_0x8b8a('0x43')],{'$or':_[_0x8b8a('0x3a')](_0x5f24fa[_0x8b8a('0x3d')],function(_0x4761d8){var _0x1191a5={};_0x1191a5[_0x4761d8]={'$like':'%'+_0x374558[_0x8b8a('0x3b')][_0x8b8a('0x45')]+'%'};return _0x1191a5;})});}_0x5f24fa=_[_0x8b8a('0x46')]({},_0x5f24fa,_0x374558[_0x8b8a('0x47')]);return _0x20bc9b['getDescriptions'](_0x5f24fa);}})[_0x8b8a('0x2f')](function(_0x1400f3){if(_0x1400f3){_0x246b96=_0x1400f3[_0x8b8a('0x3f')];if(!_0x374558[_0x8b8a('0x3b')][_0x8b8a('0x40')](_0x8b8a('0x55'))){_0x5f24fa[_0x8b8a('0x2b')]=qs[_0x8b8a('0x2b')](_0x374558[_0x8b8a('0x3b')][_0x8b8a('0x2b')]);_0x5f24fa[_0x8b8a('0x2a')]=qs['offset'](_0x374558['query'][_0x8b8a('0x2a')]);}return _0x20bc9b[_0x8b8a('0x58')](_0x5f24fa);}})[_0x8b8a('0x2f')](function(_0x7b13aa){if(_0x7b13aa){return _0x7b13aa?{'count':_0x246b96,'rows':_0x7b13aa}:null;}})['then'](respondWithResult(_0x31e224,null))[_0x8b8a('0x24')](handleError(_0x31e224,null));};exports[_0x8b8a('0x59')]=function(_0x2081bc,_0xc612e2,_0x520c82){var _0x59fba1={};var _0x25fbb8={};var _0x374c0b;var _0x3eeff1;return db[_0x8b8a('0x34')][_0x8b8a('0x54')]({'where':{'id':_0x2081bc['params']['id']}})['then'](handleEntityNotFound(_0xc612e2,null))[_0x8b8a('0x2f')](function(_0x35986a){if(_0x35986a){_0x374c0b=_0x35986a;_0x25fbb8[_0x8b8a('0x39')]=_[_0x8b8a('0x4d')](db[_0x8b8a('0x5a')][_0x8b8a('0x35')]);_0x25fbb8[_0x8b8a('0x3b')]=_[_0x8b8a('0x4d')](_0x2081bc[_0x8b8a('0x3b')]);_0x25fbb8[_0x8b8a('0x4e')]=_[_0x8b8a('0x3c')](_0x25fbb8[_0x8b8a('0x39')],_0x25fbb8[_0x8b8a('0x3b')]);_0x59fba1[_0x8b8a('0x3d')]=_[_0x8b8a('0x3c')](_0x25fbb8[_0x8b8a('0x39')],qs[_0x8b8a('0x3e')](_0x2081bc[_0x8b8a('0x3b')][_0x8b8a('0x3e')]));_0x59fba1[_0x8b8a('0x3d')]=_0x59fba1['attributes'][_0x8b8a('0x3f')]?_0x59fba1[_0x8b8a('0x3d')]:_0x25fbb8[_0x8b8a('0x39')];_0x59fba1[_0x8b8a('0x41')]=qs[_0x8b8a('0x42')](_0x2081bc[_0x8b8a('0x3b')][_0x8b8a('0x42')]);_0x59fba1[_0x8b8a('0x43')]=qs[_0x8b8a('0x4e')](_[_0x8b8a('0x44')](_0x2081bc['query'],_0x25fbb8['filters']));if(_0x2081bc[_0x8b8a('0x3b')][_0x8b8a('0x45')]){_0x59fba1['where']=_[_0x8b8a('0x46')](_0x59fba1[_0x8b8a('0x43')],{'$or':_[_0x8b8a('0x3a')](_0x59fba1[_0x8b8a('0x3d')],function(_0x55818b){var _0x54b6f3={};_0x54b6f3[_0x55818b]={'$like':'%'+_0x2081bc[_0x8b8a('0x3b')][_0x8b8a('0x45')]+'%'};return _0x54b6f3;})});}_0x59fba1=_[_0x8b8a('0x46')]({},_0x59fba1,_0x2081bc[_0x8b8a('0x47')]);return _0x374c0b[_0x8b8a('0x59')](_0x59fba1);}})[_0x8b8a('0x2f')](function(_0xd3f805){if(_0xd3f805){_0x3eeff1=_0xd3f805[_0x8b8a('0x3f')];if(!_0x2081bc['query'][_0x8b8a('0x40')](_0x8b8a('0x55'))){_0x59fba1['limit']=qs['limit'](_0x2081bc[_0x8b8a('0x3b')]['limit']);_0x59fba1[_0x8b8a('0x2a')]=qs[_0x8b8a('0x2a')](_0x2081bc[_0x8b8a('0x3b')][_0x8b8a('0x2a')]);}return _0x374c0b['getTags'](_0x59fba1);}})[_0x8b8a('0x2f')](function(_0x16951b){if(_0x16951b){return _0x16951b?{'count':_0x3eeff1,'rows':_0x16951b}:null;}})['then'](respondWithResult(_0xc612e2,null))[_0x8b8a('0x24')](handleError(_0xc612e2,null));};exports[_0x8b8a('0x5b')]=function(_0x531d1d,_0x434819,_0x3d8ff9){if(_0x531d1d[_0x8b8a('0x52')]['id']){delete _0x531d1d[_0x8b8a('0x52')]['id'];}return db[_0x8b8a('0x34')][_0x8b8a('0x54')]({'where':{'id':_0x531d1d['params']['id']}})[_0x8b8a('0x2f')](handleEntityNotFound(_0x434819,null))['then'](function(_0x10d659){if(_0x10d659){return _0x10d659[_0x8b8a('0x5b')](_0x531d1d[_0x8b8a('0x52')]['ids']||[]);}return null;})[_0x8b8a('0x2f')](respondWithResult(_0x434819,null))[_0x8b8a('0x24')](handleError(_0x434819,null));}; \ No newline at end of file +var _0x9c95=['offset','limit','set','Content-Range','apply','reject','update','stack','name','send','map','DeskConfiguration','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','show','params','keys','length','includeAll','find','catch','body','getFields','findOne','DeskField','hasOwnProperty','rawAttributes','getSubjects','getDescriptions','getTags','setTags','ids','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','DeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','end','json'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x9c95,0xed));var _0x59c9=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x9c95[_0x44bcb0];return _0xfaf881;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x59c9('0x0'));var jsonpatch=require(_0x59c9('0x1'));var rp=require(_0x59c9('0x2'));var moment=require(_0x59c9('0x3'));var BPromise=require(_0x59c9('0x4'));var Mustache=require(_0x59c9('0x5'));var util=require(_0x59c9('0x6'));var path=require(_0x59c9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x59c9('0x8'));var fs=require('fs');var _=require(_0x59c9('0x9'));var squel=require(_0x59c9('0xa'));var crypto=require(_0x59c9('0xb'));var jsforce=require(_0x59c9('0xc'));var deskjs=require(_0x59c9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x59c9('0xe'));var Papa=require('papaparse');var Redis=require(_0x59c9('0xf'));var authService=require(_0x59c9('0x10'));var qs=require(_0x59c9('0x11'));var as=require(_0x59c9('0x12'));var hardwareService=require(_0x59c9('0x13'));var logger=require(_0x59c9('0x14'))(_0x59c9('0x15'));var utils=require(_0x59c9('0x16'));var config=require('../../config/environment');var db=require(_0x59c9('0x17'))['db'];var jayson=require(_0x59c9('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0xc14d3a,_0x55a9d2,_0x44e7e7){if(_0x44e7e7){var _0x228706=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x228706[_0x59c9('0x19')](_0x55a9d2)){return _0xc14d3a;}else{throw new db[(_0x59c9('0x1a'))][(_0x59c9('0x1b'))](_0x59c9('0x1c'));}}else{return _0xc14d3a;}}function respondWithRpcPromise(_0x3d4b63,_0x1293b8,_0xb9eb77,_0x3bbbbd){return new BPromise(function(_0x4dadec,_0x4f16f0){var _0x42f8c7=_0x3bbbbd||client;return _0x42f8c7[_0x59c9('0x1d')](_0x3d4b63,_0xb9eb77)[_0x59c9('0x1e')](function(_0xe2c197){logger[_0x59c9('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x1293b8,_0x59c9('0x20'));logger[_0x59c9('0x21')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1293b8,_0x59c9('0x20'),JSON['stringify'](_0xe2c197));if(_0xe2c197[_0x59c9('0x22')]){if(_0xe2c197[_0x59c9('0x22')]['code']===0x1f4){logger[_0x59c9('0x22')](_0x59c9('0x23'),_0x1293b8,_0xe2c197['error'][_0x59c9('0x24')]);return _0x4f16f0(_0xe2c197[_0x59c9('0x22')]['message']);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x1293b8,_0xe2c197[_0x59c9('0x22')][_0x59c9('0x24')]);return _0x4dadec(_0xe2c197[_0x59c9('0x22')]['message']);}else{logger[_0x59c9('0x1f')](_0x59c9('0x23'),_0x1293b8,'request\x20sent');_0x4dadec(_0xe2c197[_0x59c9('0x25')][_0x59c9('0x24')]);}})['catch'](function(_0x1b44a1){logger[_0x59c9('0x22')](_0x59c9('0x23'),_0x1293b8,_0x1b44a1);_0x4f16f0(_0x1b44a1);});});}function respondWithStatusCode(_0x2ba805,_0x1459e4){_0x1459e4=_0x1459e4||0xcc;return function(_0x3cc99f){if(_0x3cc99f){return _0x2ba805[_0x59c9('0x26')](_0x1459e4);}return _0x2ba805[_0x59c9('0x27')](_0x1459e4)[_0x59c9('0x28')]();};}function respondWithResult(_0x4d9ef1,_0x4e4ada){_0x4e4ada=_0x4e4ada||0xc8;return function(_0xe366b0){if(_0xe366b0){return _0x4d9ef1[_0x59c9('0x27')](_0x4e4ada)[_0x59c9('0x29')](_0xe366b0);}};}function respondWithFilteredResult(_0x2f4022,_0x372e40){return function(_0x390656){if(_0x390656){var _0x2b3692=_0x390656['count'],_0x236de6=_0x372e40[_0x59c9('0x2a')],_0x4f6ec9=_0x372e40[_0x59c9('0x2a')]+_0x372e40[_0x59c9('0x2b')],_0x4084be;if(_0x4f6ec9>=_0x2b3692){_0x4f6ec9=_0x2b3692;_0x4084be=0xc8;}else{_0x4084be=0xce;}_0x2f4022[_0x59c9('0x27')](_0x4084be);return _0x2f4022[_0x59c9('0x2c')](_0x59c9('0x2d'),_0x236de6+'-'+_0x4f6ec9+'/'+_0x2b3692)[_0x59c9('0x29')](_0x390656);}return null;};}function patchUpdates(_0x234deb){return function(_0x1cf366){try{jsonpatch[_0x59c9('0x2e')](_0x1cf366,_0x234deb,!![]);}catch(_0xd91e21){return BPromise[_0x59c9('0x2f')](_0xd91e21);}return _0x1cf366['save']();};}function saveUpdates(_0x4c552d,_0x5d3a19){return function(_0x5008c3){if(_0x5008c3){return _0x5008c3[_0x59c9('0x30')](_0x4c552d)[_0x59c9('0x1e')](function(_0x1efea0){return _0x1efea0;});}return null;};}function removeEntity(_0x6650c,_0x2c2e73){return function(_0x1108a2){if(_0x1108a2){return _0x1108a2['destroy']()[_0x59c9('0x1e')](function(){_0x6650c[_0x59c9('0x27')](0xcc)[_0x59c9('0x28')]();});}};}function handleEntityNotFound(_0x1d17ec,_0x5ca6b5){return function(_0x22a436){if(!_0x22a436){_0x1d17ec[_0x59c9('0x26')](0x194);}return _0x22a436;};}function handleError(_0x5a62ff,_0x3b417e){_0x3b417e=_0x3b417e||0x1f4;return function(_0x3ec113){logger[_0x59c9('0x22')](_0x3ec113[_0x59c9('0x31')]);if(_0x3ec113['name']){delete _0x3ec113[_0x59c9('0x32')];}_0x5a62ff['status'](_0x3b417e)[_0x59c9('0x33')](_0x3ec113);};}exports['index']=function(_0x4b203e,_0x1f4a5c){var _0x4c1d46={},_0x376d2d={},_0x2e8c7f={'count':0x0,'rows':[]};var _0x2a68c6=_[_0x59c9('0x34')](db[_0x59c9('0x35')]['rawAttributes'],function(_0x14e9dd){return{'name':_0x14e9dd[_0x59c9('0x36')],'type':_0x14e9dd[_0x59c9('0x37')][_0x59c9('0x38')]};});_0x376d2d[_0x59c9('0x39')]=_[_0x59c9('0x34')](_0x2a68c6,'name');_0x376d2d[_0x59c9('0x3a')]=_['keys'](_0x4b203e[_0x59c9('0x3a')]);_0x376d2d[_0x59c9('0x3b')]=_['intersection'](_0x376d2d['model'],_0x376d2d[_0x59c9('0x3a')]);_0x4c1d46['attributes']=_[_0x59c9('0x3c')](_0x376d2d[_0x59c9('0x39')],qs['fields'](_0x4b203e[_0x59c9('0x3a')][_0x59c9('0x3d')]));_0x4c1d46[_0x59c9('0x3e')]=_0x4c1d46['attributes']['length']?_0x4c1d46[_0x59c9('0x3e')]:_0x376d2d['model'];if(!_0x4b203e['query']['hasOwnProperty'](_0x59c9('0x3f'))){_0x4c1d46['limit']=qs[_0x59c9('0x2b')](_0x4b203e[_0x59c9('0x3a')]['limit']);_0x4c1d46[_0x59c9('0x2a')]=qs[_0x59c9('0x2a')](_0x4b203e[_0x59c9('0x3a')][_0x59c9('0x2a')]);}_0x4c1d46[_0x59c9('0x40')]=qs[_0x59c9('0x41')](_0x4b203e['query'][_0x59c9('0x41')]);_0x4c1d46[_0x59c9('0x42')]=qs['filters'](_[_0x59c9('0x43')](_0x4b203e[_0x59c9('0x3a')],_0x376d2d[_0x59c9('0x3b')]));if(_0x4b203e[_0x59c9('0x3a')][_0x59c9('0x44')]){_0x4c1d46['where']=_[_0x59c9('0x45')](_0x4c1d46['where'],{'$or':_['map'](_0x2a68c6,function(_0x37cd71){if(_0x37cd71[_0x59c9('0x37')]!==_0x59c9('0x46')){var _0x319532={};_0x319532[_0x37cd71[_0x59c9('0x32')]]={'$like':'%'+_0x4b203e['query'][_0x59c9('0x44')]+'%'};return _0x319532;}})});}_0x4c1d46=_['merge']({},_0x4c1d46,_0x4b203e[_0x59c9('0x47')]);var _0x197990={'where':_0x4c1d46['where']};return db[_0x59c9('0x35')][_0x59c9('0x48')](_0x197990)[_0x59c9('0x1e')](function(_0x486297){_0x2e8c7f[_0x59c9('0x48')]=_0x486297;if(_0x4b203e[_0x59c9('0x3a')]['includeAll']){_0x4c1d46[_0x59c9('0x49')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x4c1d46);})[_0x59c9('0x1e')](function(_0x2c3630){_0x2e8c7f[_0x59c9('0x4a')]=_0x2c3630;return _0x2e8c7f;})[_0x59c9('0x1e')](respondWithFilteredResult(_0x1f4a5c,_0x4c1d46))['catch'](handleError(_0x1f4a5c,null));};exports[_0x59c9('0x4b')]=function(_0x5ea509,_0x2388e5){var _0x52df59={'raw':![],'where':{'id':_0x5ea509[_0x59c9('0x4c')]['id']}},_0x443af8={};_0x443af8[_0x59c9('0x39')]=_[_0x59c9('0x4d')](db['DeskConfiguration']['rawAttributes']);_0x443af8[_0x59c9('0x3a')]=_['keys'](_0x5ea509[_0x59c9('0x3a')]);_0x443af8[_0x59c9('0x3b')]=_[_0x59c9('0x3c')](_0x443af8[_0x59c9('0x39')],_0x443af8[_0x59c9('0x3a')]);_0x52df59['attributes']=_[_0x59c9('0x3c')](_0x443af8[_0x59c9('0x39')],qs[_0x59c9('0x3d')](_0x5ea509[_0x59c9('0x3a')][_0x59c9('0x3d')]));_0x52df59[_0x59c9('0x3e')]=_0x52df59['attributes'][_0x59c9('0x4e')]?_0x52df59['attributes']:_0x443af8[_0x59c9('0x39')];if(_0x5ea509[_0x59c9('0x3a')][_0x59c9('0x4f')]){_0x52df59['include']=[{'all':!![]}];}_0x52df59=_['merge']({},_0x52df59,_0x5ea509[_0x59c9('0x47')]);return db[_0x59c9('0x35')][_0x59c9('0x50')](_0x52df59)[_0x59c9('0x1e')](handleEntityNotFound(_0x2388e5,null))['then'](respondWithResult(_0x2388e5,null))[_0x59c9('0x51')](handleError(_0x2388e5,null));};exports['create']=function(_0x3eca1f,_0x18ef0f){return db[_0x59c9('0x35')]['create'](_0x3eca1f[_0x59c9('0x52')],{})['then'](respondWithResult(_0x18ef0f,0xc9))[_0x59c9('0x51')](handleError(_0x18ef0f,null));};exports[_0x59c9('0x30')]=function(_0xf85303,_0x42f122){if(_0xf85303['body']['id']){delete _0xf85303[_0x59c9('0x52')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0xf85303['params']['id']}})['then'](handleEntityNotFound(_0x42f122,null))[_0x59c9('0x1e')](saveUpdates(_0xf85303[_0x59c9('0x52')],null))[_0x59c9('0x1e')](respondWithResult(_0x42f122,null))[_0x59c9('0x51')](handleError(_0x42f122,null));};exports['destroy']=function(_0x320f9a,_0x456c98){return db[_0x59c9('0x35')][_0x59c9('0x50')]({'where':{'id':_0x320f9a[_0x59c9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x456c98,null))[_0x59c9('0x1e')](removeEntity(_0x456c98,null))['catch'](handleError(_0x456c98,null));};exports[_0x59c9('0x53')]=function(_0x1650b8,_0x1a6cf8,_0x532b75){var _0x4c2119={};var _0x5d1215={};var _0x5203fa;var _0x4b0ec8;return db[_0x59c9('0x35')][_0x59c9('0x54')]({'where':{'id':_0x1650b8[_0x59c9('0x4c')]['id']}})[_0x59c9('0x1e')](handleEntityNotFound(_0x1a6cf8,null))['then'](function(_0xb74c03){if(_0xb74c03){_0x5203fa=_0xb74c03;_0x5d1215[_0x59c9('0x39')]=_[_0x59c9('0x4d')](db[_0x59c9('0x55')]['rawAttributes']);_0x5d1215[_0x59c9('0x3a')]=_[_0x59c9('0x4d')](_0x1650b8[_0x59c9('0x3a')]);_0x5d1215['filters']=_[_0x59c9('0x3c')](_0x5d1215[_0x59c9('0x39')],_0x5d1215[_0x59c9('0x3a')]);_0x4c2119[_0x59c9('0x3e')]=_[_0x59c9('0x3c')](_0x5d1215[_0x59c9('0x39')],qs['fields'](_0x1650b8[_0x59c9('0x3a')][_0x59c9('0x3d')]));_0x4c2119[_0x59c9('0x3e')]=_0x4c2119[_0x59c9('0x3e')][_0x59c9('0x4e')]?_0x4c2119[_0x59c9('0x3e')]:_0x5d1215[_0x59c9('0x39')];_0x4c2119[_0x59c9('0x40')]=qs[_0x59c9('0x41')](_0x1650b8[_0x59c9('0x3a')][_0x59c9('0x41')]);_0x4c2119[_0x59c9('0x42')]=qs[_0x59c9('0x3b')](_['pick'](_0x1650b8[_0x59c9('0x3a')],_0x5d1215['filters']));if(_0x1650b8[_0x59c9('0x3a')][_0x59c9('0x44')]){_0x4c2119['where']=_[_0x59c9('0x45')](_0x4c2119['where'],{'$or':_[_0x59c9('0x34')](_0x4c2119[_0x59c9('0x3e')],function(_0x5a2d2c){var _0x1e3cea={};_0x1e3cea[_0x5a2d2c]={'$like':'%'+_0x1650b8['query'][_0x59c9('0x44')]+'%'};return _0x1e3cea;})});}_0x4c2119=_[_0x59c9('0x45')]({},_0x4c2119,_0x1650b8['options']);return _0x5203fa['getFields'](_0x4c2119);}})[_0x59c9('0x1e')](function(_0x3a0651){if(_0x3a0651){_0x4b0ec8=_0x3a0651[_0x59c9('0x4e')];if(!_0x1650b8[_0x59c9('0x3a')][_0x59c9('0x56')](_0x59c9('0x3f'))){_0x4c2119['limit']=qs[_0x59c9('0x2b')](_0x1650b8[_0x59c9('0x3a')][_0x59c9('0x2b')]);_0x4c2119[_0x59c9('0x2a')]=qs[_0x59c9('0x2a')](_0x1650b8[_0x59c9('0x3a')]['offset']);}return _0x5203fa[_0x59c9('0x53')](_0x4c2119);}})[_0x59c9('0x1e')](function(_0x4eff6c){if(_0x4eff6c){return _0x4eff6c?{'count':_0x4b0ec8,'rows':_0x4eff6c}:null;}})[_0x59c9('0x1e')](respondWithResult(_0x1a6cf8,null))['catch'](handleError(_0x1a6cf8,null));};exports['getSubjects']=function(_0x49c9c3,_0x1ba0d4,_0x35a100){var _0x17516e={};var _0x223078={};var _0x3fc8cd;var _0x611ead;return db[_0x59c9('0x35')][_0x59c9('0x54')]({'where':{'id':_0x49c9c3[_0x59c9('0x4c')]['id']}})[_0x59c9('0x1e')](handleEntityNotFound(_0x1ba0d4,null))[_0x59c9('0x1e')](function(_0x58b743){if(_0x58b743){_0x3fc8cd=_0x58b743;_0x223078['model']=_['keys'](db[_0x59c9('0x55')][_0x59c9('0x57')]);_0x223078[_0x59c9('0x3a')]=_[_0x59c9('0x4d')](_0x49c9c3[_0x59c9('0x3a')]);_0x223078['filters']=_['intersection'](_0x223078[_0x59c9('0x39')],_0x223078[_0x59c9('0x3a')]);_0x17516e[_0x59c9('0x3e')]=_[_0x59c9('0x3c')](_0x223078['model'],qs[_0x59c9('0x3d')](_0x49c9c3[_0x59c9('0x3a')][_0x59c9('0x3d')]));_0x17516e['attributes']=_0x17516e[_0x59c9('0x3e')]['length']?_0x17516e[_0x59c9('0x3e')]:_0x223078[_0x59c9('0x39')];_0x17516e[_0x59c9('0x40')]=qs[_0x59c9('0x41')](_0x49c9c3['query'][_0x59c9('0x41')]);_0x17516e[_0x59c9('0x42')]=qs[_0x59c9('0x3b')](_[_0x59c9('0x43')](_0x49c9c3[_0x59c9('0x3a')],_0x223078['filters']));if(_0x49c9c3[_0x59c9('0x3a')][_0x59c9('0x44')]){_0x17516e[_0x59c9('0x42')]=_[_0x59c9('0x45')](_0x17516e['where'],{'$or':_[_0x59c9('0x34')](_0x17516e[_0x59c9('0x3e')],function(_0x11e90b){var _0x4d81e9={};_0x4d81e9[_0x11e90b]={'$like':'%'+_0x49c9c3[_0x59c9('0x3a')]['filter']+'%'};return _0x4d81e9;})});}_0x17516e=_[_0x59c9('0x45')]({},_0x17516e,_0x49c9c3[_0x59c9('0x47')]);return _0x3fc8cd[_0x59c9('0x58')](_0x17516e);}})[_0x59c9('0x1e')](function(_0x49c9aa){if(_0x49c9aa){_0x611ead=_0x49c9aa[_0x59c9('0x4e')];if(!_0x49c9c3[_0x59c9('0x3a')][_0x59c9('0x56')](_0x59c9('0x3f'))){_0x17516e[_0x59c9('0x2b')]=qs['limit'](_0x49c9c3['query'][_0x59c9('0x2b')]);_0x17516e[_0x59c9('0x2a')]=qs[_0x59c9('0x2a')](_0x49c9c3['query'][_0x59c9('0x2a')]);}return _0x3fc8cd[_0x59c9('0x58')](_0x17516e);}})[_0x59c9('0x1e')](function(_0x14e070){if(_0x14e070){return _0x14e070?{'count':_0x611ead,'rows':_0x14e070}:null;}})[_0x59c9('0x1e')](respondWithResult(_0x1ba0d4,null))[_0x59c9('0x51')](handleError(_0x1ba0d4,null));};exports[_0x59c9('0x59')]=function(_0x5d241f,_0xc928d7,_0x3bc798){var _0x3a6b39={};var _0x64888d={};var _0x3cc56e;var _0x4667e9;return db[_0x59c9('0x35')]['findOne']({'where':{'id':_0x5d241f[_0x59c9('0x4c')]['id']}})[_0x59c9('0x1e')](handleEntityNotFound(_0xc928d7,null))[_0x59c9('0x1e')](function(_0x3c8b24){if(_0x3c8b24){_0x3cc56e=_0x3c8b24;_0x64888d[_0x59c9('0x39')]=_[_0x59c9('0x4d')](db[_0x59c9('0x55')]['rawAttributes']);_0x64888d[_0x59c9('0x3a')]=_[_0x59c9('0x4d')](_0x5d241f[_0x59c9('0x3a')]);_0x64888d['filters']=_[_0x59c9('0x3c')](_0x64888d[_0x59c9('0x39')],_0x64888d['query']);_0x3a6b39[_0x59c9('0x3e')]=_[_0x59c9('0x3c')](_0x64888d[_0x59c9('0x39')],qs[_0x59c9('0x3d')](_0x5d241f[_0x59c9('0x3a')][_0x59c9('0x3d')]));_0x3a6b39[_0x59c9('0x3e')]=_0x3a6b39['attributes'][_0x59c9('0x4e')]?_0x3a6b39[_0x59c9('0x3e')]:_0x64888d[_0x59c9('0x39')];_0x3a6b39[_0x59c9('0x40')]=qs[_0x59c9('0x41')](_0x5d241f[_0x59c9('0x3a')]['sort']);_0x3a6b39[_0x59c9('0x42')]=qs['filters'](_[_0x59c9('0x43')](_0x5d241f[_0x59c9('0x3a')],_0x64888d[_0x59c9('0x3b')]));if(_0x5d241f['query'][_0x59c9('0x44')]){_0x3a6b39[_0x59c9('0x42')]=_['merge'](_0x3a6b39[_0x59c9('0x42')],{'$or':_[_0x59c9('0x34')](_0x3a6b39[_0x59c9('0x3e')],function(_0x5d927b){var _0x770ac={};_0x770ac[_0x5d927b]={'$like':'%'+_0x5d241f[_0x59c9('0x3a')][_0x59c9('0x44')]+'%'};return _0x770ac;})});}_0x3a6b39=_[_0x59c9('0x45')]({},_0x3a6b39,_0x5d241f['options']);return _0x3cc56e[_0x59c9('0x59')](_0x3a6b39);}})[_0x59c9('0x1e')](function(_0xde5139){if(_0xde5139){_0x4667e9=_0xde5139[_0x59c9('0x4e')];if(!_0x5d241f[_0x59c9('0x3a')][_0x59c9('0x56')](_0x59c9('0x3f'))){_0x3a6b39[_0x59c9('0x2b')]=qs[_0x59c9('0x2b')](_0x5d241f[_0x59c9('0x3a')][_0x59c9('0x2b')]);_0x3a6b39['offset']=qs[_0x59c9('0x2a')](_0x5d241f[_0x59c9('0x3a')][_0x59c9('0x2a')]);}return _0x3cc56e[_0x59c9('0x59')](_0x3a6b39);}})[_0x59c9('0x1e')](function(_0x56e9c3){if(_0x56e9c3){return _0x56e9c3?{'count':_0x4667e9,'rows':_0x56e9c3}:null;}})[_0x59c9('0x1e')](respondWithResult(_0xc928d7,null))['catch'](handleError(_0xc928d7,null));};exports[_0x59c9('0x5a')]=function(_0x4d079c,_0x5b82b8,_0x2e2c92){var _0x4e023f={};var _0x4fb18e={};var _0x122259;var _0x264f90;return db['DeskConfiguration']['findOne']({'where':{'id':_0x4d079c['params']['id']}})['then'](handleEntityNotFound(_0x5b82b8,null))['then'](function(_0x3c098f){if(_0x3c098f){_0x122259=_0x3c098f;_0x4fb18e[_0x59c9('0x39')]=_[_0x59c9('0x4d')](db['Tag'][_0x59c9('0x57')]);_0x4fb18e[_0x59c9('0x3a')]=_[_0x59c9('0x4d')](_0x4d079c[_0x59c9('0x3a')]);_0x4fb18e[_0x59c9('0x3b')]=_[_0x59c9('0x3c')](_0x4fb18e[_0x59c9('0x39')],_0x4fb18e[_0x59c9('0x3a')]);_0x4e023f[_0x59c9('0x3e')]=_['intersection'](_0x4fb18e[_0x59c9('0x39')],qs['fields'](_0x4d079c['query'][_0x59c9('0x3d')]));_0x4e023f['attributes']=_0x4e023f[_0x59c9('0x3e')][_0x59c9('0x4e')]?_0x4e023f[_0x59c9('0x3e')]:_0x4fb18e[_0x59c9('0x39')];_0x4e023f[_0x59c9('0x40')]=qs[_0x59c9('0x41')](_0x4d079c[_0x59c9('0x3a')][_0x59c9('0x41')]);_0x4e023f[_0x59c9('0x42')]=qs[_0x59c9('0x3b')](_[_0x59c9('0x43')](_0x4d079c[_0x59c9('0x3a')],_0x4fb18e[_0x59c9('0x3b')]));if(_0x4d079c[_0x59c9('0x3a')]['filter']){_0x4e023f[_0x59c9('0x42')]=_[_0x59c9('0x45')](_0x4e023f[_0x59c9('0x42')],{'$or':_[_0x59c9('0x34')](_0x4e023f[_0x59c9('0x3e')],function(_0x2a3646){var _0x3d2799={};_0x3d2799[_0x2a3646]={'$like':'%'+_0x4d079c[_0x59c9('0x3a')][_0x59c9('0x44')]+'%'};return _0x3d2799;})});}_0x4e023f=_['merge']({},_0x4e023f,_0x4d079c['options']);return _0x122259['getTags'](_0x4e023f);}})[_0x59c9('0x1e')](function(_0x480632){if(_0x480632){_0x264f90=_0x480632['length'];if(!_0x4d079c[_0x59c9('0x3a')][_0x59c9('0x56')](_0x59c9('0x3f'))){_0x4e023f[_0x59c9('0x2b')]=qs['limit'](_0x4d079c[_0x59c9('0x3a')][_0x59c9('0x2b')]);_0x4e023f[_0x59c9('0x2a')]=qs['offset'](_0x4d079c['query'][_0x59c9('0x2a')]);}return _0x122259[_0x59c9('0x5a')](_0x4e023f);}})[_0x59c9('0x1e')](function(_0x1a779a){if(_0x1a779a){return _0x1a779a?{'count':_0x264f90,'rows':_0x1a779a}:null;}})[_0x59c9('0x1e')](respondWithResult(_0x5b82b8,null))['catch'](handleError(_0x5b82b8,null));};exports[_0x59c9('0x5b')]=function(_0x2b0710,_0x27318a,_0x331af6){if(_0x2b0710['body']['id']){delete _0x2b0710[_0x59c9('0x52')]['id'];}return db['DeskConfiguration'][_0x59c9('0x54')]({'where':{'id':_0x2b0710[_0x59c9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x27318a,null))[_0x59c9('0x1e')](function(_0x143a98){if(_0x143a98){return _0x143a98[_0x59c9('0x5b')](_0x2b0710['body'][_0x59c9('0x5c')]||[]);}return null;})['then'](respondWithResult(_0x27318a,null))[_0x59c9('0x51')](handleError(_0x27318a,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index b0f5474..933b33e 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 _0x8791=['DeskConfiguration','int_desk_configurations','util','api','bluebird','path','rimraf','../../config/environment','define'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x8791,0x1bb));var _0x1879=function(_0x54d1be,_0x5c6d93){_0x54d1be=_0x54d1be-0x0;var _0xf9b537=_0x8791[_0x54d1be];return _0xf9b537;};'use strict';var _=require('lodash');var util=require(_0x1879('0x0'));var logger=require('../../config/logger')(_0x1879('0x1'));var moment=require('moment');var BPromise=require(_0x1879('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1879('0x3'));var rimraf=require(_0x1879('0x4'));var config=require(_0x1879('0x5'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x22bc5f,_0x4cd006){return _0x22bc5f[_0x1879('0x6')](_0x1879('0x7'),attributes,{'tableName':_0x1879('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04e6=['bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','moment'];(function(_0x40f91f,_0x441fdc){var _0x5677e0=function(_0x232a17){while(--_0x232a17){_0x40f91f['push'](_0x40f91f['shift']());}};_0x5677e0(++_0x441fdc);}(_0x04e6,0xbf));var _0x604e=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x04e6[_0x5678b5];return _0x4c09a5;};'use strict';var _=require(_0x604e('0x0'));var util=require(_0x604e('0x1'));var logger=require(_0x604e('0x2'))('api');var moment=require(_0x604e('0x3'));var BPromise=require(_0x604e('0x4'));var rp=require(_0x604e('0x5'));var fs=require('fs');var path=require(_0x604e('0x6'));var rimraf=require(_0x604e('0x7'));var config=require('../../config/environment');var attributes=require(_0x604e('0x8'));module[_0x604e('0x9')]=function(_0x1416b9,_0x22c6cf){return _0x1416b9[_0x604e('0xa')](_0x604e('0xb'),attributes,{'tableName':_0x604e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index de8c198..5c365e9 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 _0x4517=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x180fe3,_0x18eec2){var _0x2e37a5=function(_0x3590d7){while(--_0x3590d7){_0x180fe3['push'](_0x180fe3['shift']());}};_0x2e37a5(++_0x18eec2);}(_0x4517,0x112));var _0x7451=function(_0x49605e,_0xab2bf7){_0x49605e=_0x49605e-0x0;var _0x10aaac=_0x4517[_0x49605e];return _0x10aaac;};'use strict';var _=require('lodash');var util=require(_0x7451('0x0'));var moment=require(_0x7451('0x1'));var BPromise=require('bluebird');var rs=require(_0x7451('0x2'));var fs=require('fs');var Redis=require(_0x7451('0x3'));var db=require(_0x7451('0x4'))['db'];var utils=require(_0x7451('0x5'));var logger=require(_0x7451('0x6'))(_0x7451('0x7'));var config=require(_0x7451('0x8'));var jayson=require(_0x7451('0x9'));var client=jayson[_0x7451('0xa')][_0x7451('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ac271,_0x1bfc08,_0x26306e){return new BPromise(function(_0x443b80,_0x2c2ace){return client[_0x7451('0xc')](_0x3ac271,_0x26306e)[_0x7451('0xd')](function(_0x4b7888){logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));logger[_0x7451('0x11')](_0x7451('0x12'),_0x1bfc08,_0x7451('0x10'),JSON[_0x7451('0x13')](_0x4b7888));if(_0x4b7888['error']){if(_0x4b7888['error'][_0x7451('0x14')]===0x1f4){logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')]['message']);return _0x2c2ace(_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);}logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);return _0x443b80(_0x4b7888[_0x7451('0x15')]['message']);}else{logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));_0x443b80(_0x4b7888['result']['message']);}})[_0x7451('0x17')](function(_0x1db688){logger[_0x7451('0x15')](_0x7451('0xf'),_0x1bfc08,_0x1db688);_0x2c2ace(_0x1db688);});});} \ No newline at end of file +var _0x55e0=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x55e0,0xdc));var _0x055e=function(_0x22011a,_0x1a9609){_0x22011a=_0x22011a-0x0;var _0x2cc3ec=_0x55e0[_0x22011a];return _0x2cc3ec;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 7719878..c0a9461 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 _0x7032=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0x21fc17,_0x251eea){var _0x53e541=function(_0x80efdb){while(--_0x80efdb){_0x21fc17['push'](_0x21fc17['shift']());}};_0x53e541(++_0x251eea);}(_0x7032,0x6d));var _0x2703=function(_0x362e87,_0x38d17c){_0x362e87=_0x362e87-0x0;var _0x334244=_0x7032[_0x362e87];return _0x334244;};'use strict';var multer=require(_0x2703('0x0'));var util=require('util');var path=require(_0x2703('0x1'));var timeout=require(_0x2703('0x2'));var express=require(_0x2703('0x3'));var router=express[_0x2703('0x4')]();var auth=require(_0x2703('0x5'));var interaction=require(_0x2703('0x6'));var config=require(_0x2703('0x7'));var controller=require(_0x2703('0x8'));router['get']('/',auth[_0x2703('0x9')](),controller[_0x2703('0xa')]);router[_0x2703('0xb')](_0x2703('0xc'),auth[_0x2703('0x9')](),controller[_0x2703('0xd')]);router['post']('/',auth[_0x2703('0x9')](),controller[_0x2703('0xe')]);router[_0x2703('0xf')](_0x2703('0xc'),auth[_0x2703('0x9')](),controller[_0x2703('0x10')]);router[_0x2703('0x11')](_0x2703('0xc'),auth[_0x2703('0x9')](),controller[_0x2703('0x12')]);module['exports']=router; \ No newline at end of file +var _0xca5c=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','index','get','/:id','isAuthenticated','show'];(function(_0x246cbe,_0x19305c){var _0x855b0=function(_0x2c8d0d){while(--_0x2c8d0d){_0x246cbe['push'](_0x246cbe['shift']());}};_0x855b0(++_0x19305c);}(_0xca5c,0x16e));var _0xcca5=function(_0x6c0b0a,_0x496391){_0x6c0b0a=_0x6c0b0a-0x0;var _0x5f456a=_0xca5c[_0x6c0b0a];return _0x5f456a;};'use strict';var multer=require(_0xcca5('0x0'));var util=require(_0xcca5('0x1'));var path=require(_0xcca5('0x2'));var timeout=require(_0xcca5('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xcca5('0x4'));var interaction=require(_0xcca5('0x5'));var config=require('../../config/environment');var controller=require(_0xcca5('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xcca5('0x7')]);router[_0xcca5('0x8')](_0xcca5('0x9'),auth[_0xcca5('0xa')](),controller[_0xcca5('0xb')]);router[_0xcca5('0xc')]('/',auth[_0xcca5('0xa')](),controller[_0xcca5('0xd')]);router[_0xcca5('0xe')](_0xcca5('0x9'),auth['isAuthenticated'](),controller[_0xcca5('0xf')]);router[_0xcca5('0x10')](_0xcca5('0x9'),auth[_0xcca5('0xa')](),controller[_0xcca5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 803fdd1..4f6e06d 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 _0x917a=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0xf041e7,_0x37d8e5){var _0x4431cd=function(_0x94bbf4){while(--_0x94bbf4){_0xf041e7['push'](_0xf041e7['shift']());}};_0x4431cd(++_0x37d8e5);}(_0x917a,0x99));var _0xa917=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x917a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xa917('0x0')]={'type':{'type':Sequelize[_0xa917('0x1')](_0xa917('0x2'),_0xa917('0x3'),_0xa917('0x4'),_0xa917('0x5')),'defaultValue':_0xa917('0x2')},'content':{'type':Sequelize[_0xa917('0x6')]},'key':{'type':Sequelize[_0xa917('0x6')]},'keyType':{'type':Sequelize[_0xa917('0x1')](_0xa917('0x2'),'variable',_0xa917('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa917('0x6')]},'nameField':{'type':Sequelize[_0xa917('0x6')]},'customField':{'type':Sequelize[_0xa917('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa917('0x6')]}}; \ No newline at end of file +var _0x38c1=['keyValue','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x19647e,_0x1b1347){var _0x482e6d=function(_0x1e2170){while(--_0x1e2170){_0x19647e['push'](_0x19647e['shift']());}};_0x482e6d(++_0x1b1347);}(_0x38c1,0x1bc));var _0x138c=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0x38c1[_0x4191af];return _0x27bebf;};'use strict';var Sequelize=require(_0x138c('0x0'));module[_0x138c('0x1')]={'type':{'type':Sequelize[_0x138c('0x2')]('string',_0x138c('0x3'),'customVariable',_0x138c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x138c('0x5')]},'key':{'type':Sequelize[_0x138c('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x138c('0x6'),_0x138c('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x138c('0x5')]},'idField':{'type':Sequelize[_0x138c('0x5')]},'nameField':{'type':Sequelize[_0x138c('0x5')]},'customField':{'type':Sequelize[_0x138c('0x7')],'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 281f5dc..291fe94 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 _0xd6d2=['status','end','json','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','DeskField','rawAttributes','fieldName','key','map','keys','filters','intersection','query','model','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x119f82,_0x410719){var _0x3ecccb=function(_0x42d8e2){while(--_0x42d8e2){_0x119f82['push'](_0x119f82['shift']());}};_0x3ecccb(++_0x410719);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x414cc3,_0x1bf21b){_0x414cc3=_0x414cc3-0x0;var _0x20d494=_0xd6d2[_0x414cc3];return _0x20d494;};'use strict';var pdf=require(_0x2d6d('0x0'));var emlformat=require(_0x2d6d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2d6d('0x2'));var jsonpatch=require(_0x2d6d('0x3'));var rp=require('request-promise');var moment=require(_0x2d6d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d6d('0x5'));var util=require(_0x2d6d('0x6'));var path=require(_0x2d6d('0x7'));var sox=require('sox');var csv=require(_0x2d6d('0x8'));var ejs=require(_0x2d6d('0x9'));var fs=require('fs');var _=require(_0x2d6d('0xa'));var squel=require(_0x2d6d('0xb'));var crypto=require(_0x2d6d('0xc'));var jsforce=require(_0x2d6d('0xd'));var deskjs=require(_0x2d6d('0xe'));var toCsv=require(_0x2d6d('0x8'));var querystring=require(_0x2d6d('0xf'));var Papa=require(_0x2d6d('0x10'));var Redis=require(_0x2d6d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2d6d('0x12'));var as=require(_0x2d6d('0x13'));var hardwareService=require(_0x2d6d('0x14'));var logger=require(_0x2d6d('0x15'))(_0x2d6d('0x16'));var utils=require('../../config/utils');var config=require(_0x2d6d('0x17'));var db=require(_0x2d6d('0x18'))['db'];function respondWithStatusCode(_0x1eb4e9,_0x2ad9fc){_0x2ad9fc=_0x2ad9fc||0xcc;return function(_0x5c4bf6){if(_0x5c4bf6){return _0x1eb4e9['sendStatus'](_0x2ad9fc);}return _0x1eb4e9[_0x2d6d('0x19')](_0x2ad9fc)[_0x2d6d('0x1a')]();};}function respondWithResult(_0x46c909,_0x3528de){_0x3528de=_0x3528de||0xc8;return function(_0x58bd29){if(_0x58bd29){return _0x46c909[_0x2d6d('0x19')](_0x3528de)[_0x2d6d('0x1b')](_0x58bd29);}};}function respondWithFilteredResult(_0x48a84e,_0x586085){return function(_0x370096){if(_0x370096){var _0x17340f=_0x370096['count'],_0x109b49=_0x586085['offset'],_0x54c473=_0x586085['offset']+_0x586085[_0x2d6d('0x1c')],_0x385613;if(_0x54c473>=_0x17340f){_0x54c473=_0x17340f;_0x385613=0xc8;}else{_0x385613=0xce;}_0x48a84e[_0x2d6d('0x19')](_0x385613);return _0x48a84e[_0x2d6d('0x1d')](_0x2d6d('0x1e'),_0x109b49+'-'+_0x54c473+'/'+_0x17340f)[_0x2d6d('0x1b')](_0x370096);}return null;};}function patchUpdates(_0x1bb4db){return function(_0x389040){try{jsonpatch[_0x2d6d('0x1f')](_0x389040,_0x1bb4db,!![]);}catch(_0x31b38b){return BPromise['reject'](_0x31b38b);}return _0x389040[_0x2d6d('0x20')]();};}function saveUpdates(_0x41d287,_0x5b0c61){return function(_0x227e44){if(_0x227e44){return _0x227e44[_0x2d6d('0x21')](_0x41d287)[_0x2d6d('0x22')](function(_0x3c50f4){return _0x3c50f4;});}return null;};}function removeEntity(_0x37b4c8,_0x59234a){return function(_0x4aaa62){if(_0x4aaa62){return _0x4aaa62[_0x2d6d('0x23')]()[_0x2d6d('0x22')](function(){_0x37b4c8[_0x2d6d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47eb0e,_0x3ae8ad){return function(_0x4e7ec8){if(!_0x4e7ec8){_0x47eb0e['sendStatus'](0x194);}return _0x4e7ec8;};}function handleError(_0x5763ce,_0x14f291){_0x14f291=_0x14f291||0x1f4;return function(_0xaca9c7){logger[_0x2d6d('0x24')](_0xaca9c7[_0x2d6d('0x25')]);if(_0xaca9c7[_0x2d6d('0x26')]){delete _0xaca9c7['name'];}_0x5763ce[_0x2d6d('0x19')](_0x14f291)[_0x2d6d('0x27')](_0xaca9c7);};}exports[_0x2d6d('0x28')]=function(_0x1a9aff,_0x33817d){var _0x256d84={},_0x3e9f75={},_0x28e182={'count':0x0,'rows':[]};var _0x27b7d2=_['map'](db[_0x2d6d('0x29')][_0x2d6d('0x2a')],function(_0x2e7b32){return{'name':_0x2e7b32[_0x2d6d('0x2b')],'type':_0x2e7b32['type'][_0x2d6d('0x2c')]};});_0x3e9f75['model']=_[_0x2d6d('0x2d')](_0x27b7d2,'name');_0x3e9f75['query']=_[_0x2d6d('0x2e')](_0x1a9aff['query']);_0x3e9f75[_0x2d6d('0x2f')]=_[_0x2d6d('0x30')](_0x3e9f75['model'],_0x3e9f75[_0x2d6d('0x31')]);_0x256d84['attributes']=_[_0x2d6d('0x30')](_0x3e9f75[_0x2d6d('0x32')],qs[_0x2d6d('0x33')](_0x1a9aff[_0x2d6d('0x31')][_0x2d6d('0x33')]));_0x256d84[_0x2d6d('0x34')]=_0x256d84[_0x2d6d('0x34')][_0x2d6d('0x35')]?_0x256d84['attributes']:_0x3e9f75[_0x2d6d('0x32')];if(!_0x1a9aff[_0x2d6d('0x31')]['hasOwnProperty'](_0x2d6d('0x36'))){_0x256d84[_0x2d6d('0x1c')]=qs[_0x2d6d('0x1c')](_0x1a9aff[_0x2d6d('0x31')][_0x2d6d('0x1c')]);_0x256d84['offset']=qs['offset'](_0x1a9aff['query'][_0x2d6d('0x37')]);}_0x256d84[_0x2d6d('0x38')]=qs[_0x2d6d('0x39')](_0x1a9aff['query'][_0x2d6d('0x39')]);_0x256d84[_0x2d6d('0x3a')]=qs[_0x2d6d('0x2f')](_[_0x2d6d('0x3b')](_0x1a9aff['query'],_0x3e9f75[_0x2d6d('0x2f')]));if(_0x1a9aff[_0x2d6d('0x31')][_0x2d6d('0x3c')]){_0x256d84[_0x2d6d('0x3a')]=_[_0x2d6d('0x3d')](_0x256d84[_0x2d6d('0x3a')],{'$or':_[_0x2d6d('0x2d')](_0x27b7d2,function(_0x5b0674){if(_0x5b0674[_0x2d6d('0x3e')]!==_0x2d6d('0x3f')){var _0x134388={};_0x134388[_0x5b0674[_0x2d6d('0x26')]]={'$like':'%'+_0x1a9aff[_0x2d6d('0x31')]['filter']+'%'};return _0x134388;}})});}_0x256d84=_[_0x2d6d('0x3d')]({},_0x256d84,_0x1a9aff[_0x2d6d('0x40')]);var _0x352ca9={'where':_0x256d84[_0x2d6d('0x3a')]};return db[_0x2d6d('0x29')][_0x2d6d('0x41')](_0x352ca9)[_0x2d6d('0x22')](function(_0x124fc2){_0x28e182[_0x2d6d('0x41')]=_0x124fc2;if(_0x1a9aff[_0x2d6d('0x31')][_0x2d6d('0x42')]){_0x256d84[_0x2d6d('0x43')]=[{'all':!![]}];}return db[_0x2d6d('0x29')][_0x2d6d('0x44')](_0x256d84);})[_0x2d6d('0x22')](function(_0x11c737){_0x28e182[_0x2d6d('0x45')]=_0x11c737;return _0x28e182;})['then'](respondWithFilteredResult(_0x33817d,_0x256d84))[_0x2d6d('0x46')](handleError(_0x33817d,null));};exports[_0x2d6d('0x47')]=function(_0x4569a0,_0x4231bb){var _0x246d6e={'raw':!![],'where':{'id':_0x4569a0[_0x2d6d('0x48')]['id']}},_0x5c15d9={};_0x5c15d9[_0x2d6d('0x32')]=_[_0x2d6d('0x2e')](db[_0x2d6d('0x29')]['rawAttributes']);_0x5c15d9[_0x2d6d('0x31')]=_[_0x2d6d('0x2e')](_0x4569a0[_0x2d6d('0x31')]);_0x5c15d9[_0x2d6d('0x2f')]=_[_0x2d6d('0x30')](_0x5c15d9['model'],_0x5c15d9[_0x2d6d('0x31')]);_0x246d6e[_0x2d6d('0x34')]=_['intersection'](_0x5c15d9[_0x2d6d('0x32')],qs[_0x2d6d('0x33')](_0x4569a0[_0x2d6d('0x31')]['fields']));_0x246d6e[_0x2d6d('0x34')]=_0x246d6e[_0x2d6d('0x34')]['length']?_0x246d6e['attributes']:_0x5c15d9['model'];if(_0x4569a0[_0x2d6d('0x31')][_0x2d6d('0x42')]){_0x246d6e['include']=[{'all':!![]}];}_0x246d6e=_[_0x2d6d('0x3d')]({},_0x246d6e,_0x4569a0[_0x2d6d('0x40')]);return db[_0x2d6d('0x29')][_0x2d6d('0x49')](_0x246d6e)['then'](handleEntityNotFound(_0x4231bb,null))[_0x2d6d('0x22')](respondWithResult(_0x4231bb,null))[_0x2d6d('0x46')](handleError(_0x4231bb,null));};exports['create']=function(_0x322f48,_0xa6745d){return db[_0x2d6d('0x29')][_0x2d6d('0x4a')](_0x322f48[_0x2d6d('0x4b')],{})[_0x2d6d('0x22')](respondWithResult(_0xa6745d,0xc9))[_0x2d6d('0x46')](handleError(_0xa6745d,null));};exports['update']=function(_0xe6b038,_0x29771a){if(_0xe6b038[_0x2d6d('0x4b')]['id']){delete _0xe6b038['body']['id'];}return db['DeskField'][_0x2d6d('0x49')]({'where':{'id':_0xe6b038[_0x2d6d('0x48')]['id']}})[_0x2d6d('0x22')](handleEntityNotFound(_0x29771a,null))['then'](saveUpdates(_0xe6b038[_0x2d6d('0x4b')],null))[_0x2d6d('0x22')](respondWithResult(_0x29771a,null))['catch'](handleError(_0x29771a,null));};exports[_0x2d6d('0x23')]=function(_0x375a51,_0x158c8a){return db[_0x2d6d('0x29')][_0x2d6d('0x49')]({'where':{'id':_0x375a51[_0x2d6d('0x48')]['id']}})[_0x2d6d('0x22')](handleEntityNotFound(_0x158c8a,null))[_0x2d6d('0x22')](removeEntity(_0x158c8a,null))[_0x2d6d('0x46')](handleError(_0x158c8a,null));}; \ No newline at end of file +var _0x4876=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','options','DeskField','includeAll','rows','catch','show','params','keys','length','include','find','create','body','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x14f6c6,_0x17ec2){var _0x585d41=function(_0x19029b){while(--_0x19029b){_0x14f6c6['push'](_0x14f6c6['shift']());}};_0x585d41(++_0x17ec2);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6487('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6487('0x1'));var moment=require('moment');var BPromise=require(_0x6487('0x2'));var Mustache=require(_0x6487('0x3'));var util=require(_0x6487('0x4'));var path=require(_0x6487('0x5'));var sox=require('sox');var csv=require(_0x6487('0x6'));var ejs=require(_0x6487('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6487('0x8'));var crypto=require(_0x6487('0x9'));var jsforce=require(_0x6487('0xa'));var deskjs=require(_0x6487('0xb'));var toCsv=require(_0x6487('0x6'));var querystring=require(_0x6487('0xc'));var Papa=require(_0x6487('0xd'));var Redis=require(_0x6487('0xe'));var authService=require(_0x6487('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6487('0x10'));var hardwareService=require(_0x6487('0x11'));var logger=require(_0x6487('0x12'))(_0x6487('0x13'));var utils=require(_0x6487('0x14'));var config=require(_0x6487('0x15'));var db=require(_0x6487('0x16'))['db'];function respondWithStatusCode(_0x33e244,_0x48e266){_0x48e266=_0x48e266||0xcc;return function(_0x30227d){if(_0x30227d){return _0x33e244[_0x6487('0x17')](_0x48e266);}return _0x33e244[_0x6487('0x18')](_0x48e266)[_0x6487('0x19')]();};}function respondWithResult(_0x504546,_0x40a352){_0x40a352=_0x40a352||0xc8;return function(_0x10f2e1){if(_0x10f2e1){return _0x504546[_0x6487('0x18')](_0x40a352)[_0x6487('0x1a')](_0x10f2e1);}};}function respondWithFilteredResult(_0x4cc1b7,_0x522154){return function(_0x1dde46){if(_0x1dde46){var _0x552f2d=_0x1dde46[_0x6487('0x1b')],_0x2fdfc3=_0x522154[_0x6487('0x1c')],_0x583f04=_0x522154[_0x6487('0x1c')]+_0x522154[_0x6487('0x1d')],_0x1bd934;if(_0x583f04>=_0x552f2d){_0x583f04=_0x552f2d;_0x1bd934=0xc8;}else{_0x1bd934=0xce;}_0x4cc1b7['status'](_0x1bd934);return _0x4cc1b7['set']('Content-Range',_0x2fdfc3+'-'+_0x583f04+'/'+_0x552f2d)[_0x6487('0x1a')](_0x1dde46);}return null;};}function patchUpdates(_0x366cc8){return function(_0x17ed83){try{jsonpatch[_0x6487('0x1e')](_0x17ed83,_0x366cc8,!![]);}catch(_0x30abdc){return BPromise[_0x6487('0x1f')](_0x30abdc);}return _0x17ed83[_0x6487('0x20')]();};}function saveUpdates(_0x35543e,_0x1b99ef){return function(_0x30ed2e){if(_0x30ed2e){return _0x30ed2e[_0x6487('0x21')](_0x35543e)[_0x6487('0x22')](function(_0x3efa5e){return _0x3efa5e;});}return null;};}function removeEntity(_0x8cdc62,_0x21b8e8){return function(_0x21050d){if(_0x21050d){return _0x21050d[_0x6487('0x23')]()[_0x6487('0x22')](function(){_0x8cdc62[_0x6487('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58d269,_0x234485){return function(_0x4e8ec8){if(!_0x4e8ec8){_0x58d269['sendStatus'](0x194);}return _0x4e8ec8;};}function handleError(_0x41fafc,_0xc42717){_0xc42717=_0xc42717||0x1f4;return function(_0x4ebd9d){logger[_0x6487('0x24')](_0x4ebd9d[_0x6487('0x25')]);if(_0x4ebd9d[_0x6487('0x26')]){delete _0x4ebd9d[_0x6487('0x26')];}_0x41fafc[_0x6487('0x18')](_0xc42717)['send'](_0x4ebd9d);};}exports[_0x6487('0x27')]=function(_0x5ab526,_0x335bd8){var _0x5a29f9={},_0x5a9ef0={},_0x412056={'count':0x0,'rows':[]};var _0x31ede3=_[_0x6487('0x28')](db['DeskField'][_0x6487('0x29')],function(_0x3c4411){return{'name':_0x3c4411[_0x6487('0x2a')],'type':_0x3c4411[_0x6487('0x2b')][_0x6487('0x2c')]};});_0x5a9ef0[_0x6487('0x2d')]=_['map'](_0x31ede3,_0x6487('0x26'));_0x5a9ef0[_0x6487('0x2e')]=_['keys'](_0x5ab526[_0x6487('0x2e')]);_0x5a9ef0[_0x6487('0x2f')]=_[_0x6487('0x30')](_0x5a9ef0[_0x6487('0x2d')],_0x5a9ef0[_0x6487('0x2e')]);_0x5a29f9[_0x6487('0x31')]=_[_0x6487('0x30')](_0x5a9ef0['model'],qs[_0x6487('0x32')](_0x5ab526['query'][_0x6487('0x32')]));_0x5a29f9['attributes']=_0x5a29f9['attributes']['length']?_0x5a29f9['attributes']:_0x5a9ef0[_0x6487('0x2d')];if(!_0x5ab526[_0x6487('0x2e')][_0x6487('0x33')]('nolimit')){_0x5a29f9[_0x6487('0x1d')]=qs['limit'](_0x5ab526[_0x6487('0x2e')][_0x6487('0x1d')]);_0x5a29f9[_0x6487('0x1c')]=qs[_0x6487('0x1c')](_0x5ab526[_0x6487('0x2e')]['offset']);}_0x5a29f9[_0x6487('0x34')]=qs['sort'](_0x5ab526[_0x6487('0x2e')][_0x6487('0x35')]);_0x5a29f9[_0x6487('0x36')]=qs[_0x6487('0x2f')](_['pick'](_0x5ab526[_0x6487('0x2e')],_0x5a9ef0[_0x6487('0x2f')]));if(_0x5ab526[_0x6487('0x2e')]['filter']){_0x5a29f9['where']=_[_0x6487('0x37')](_0x5a29f9['where'],{'$or':_[_0x6487('0x28')](_0x31ede3,function(_0x175a9c){if(_0x175a9c[_0x6487('0x2b')]!=='VIRTUAL'){var _0x171a49={};_0x171a49[_0x175a9c[_0x6487('0x26')]]={'$like':'%'+_0x5ab526[_0x6487('0x2e')][_0x6487('0x38')]+'%'};return _0x171a49;}})});}_0x5a29f9=_[_0x6487('0x37')]({},_0x5a29f9,_0x5ab526[_0x6487('0x39')]);var _0x295a79={'where':_0x5a29f9['where']};return db[_0x6487('0x3a')][_0x6487('0x1b')](_0x295a79)[_0x6487('0x22')](function(_0x5f4720){_0x412056[_0x6487('0x1b')]=_0x5f4720;if(_0x5ab526['query'][_0x6487('0x3b')]){_0x5a29f9['include']=[{'all':!![]}];}return db[_0x6487('0x3a')]['findAll'](_0x5a29f9);})[_0x6487('0x22')](function(_0x33a783){_0x412056[_0x6487('0x3c')]=_0x33a783;return _0x412056;})[_0x6487('0x22')](respondWithFilteredResult(_0x335bd8,_0x5a29f9))[_0x6487('0x3d')](handleError(_0x335bd8,null));};exports[_0x6487('0x3e')]=function(_0x41393b,_0x39f243){var _0x47b3bb={'raw':!![],'where':{'id':_0x41393b[_0x6487('0x3f')]['id']}},_0x3e6af0={};_0x3e6af0[_0x6487('0x2d')]=_[_0x6487('0x40')](db[_0x6487('0x3a')][_0x6487('0x29')]);_0x3e6af0['query']=_[_0x6487('0x40')](_0x41393b[_0x6487('0x2e')]);_0x3e6af0['filters']=_[_0x6487('0x30')](_0x3e6af0[_0x6487('0x2d')],_0x3e6af0[_0x6487('0x2e')]);_0x47b3bb[_0x6487('0x31')]=_[_0x6487('0x30')](_0x3e6af0[_0x6487('0x2d')],qs[_0x6487('0x32')](_0x41393b[_0x6487('0x2e')][_0x6487('0x32')]));_0x47b3bb['attributes']=_0x47b3bb[_0x6487('0x31')][_0x6487('0x41')]?_0x47b3bb[_0x6487('0x31')]:_0x3e6af0['model'];if(_0x41393b['query'][_0x6487('0x3b')]){_0x47b3bb[_0x6487('0x42')]=[{'all':!![]}];}_0x47b3bb=_[_0x6487('0x37')]({},_0x47b3bb,_0x41393b[_0x6487('0x39')]);return db[_0x6487('0x3a')][_0x6487('0x43')](_0x47b3bb)['then'](handleEntityNotFound(_0x39f243,null))[_0x6487('0x22')](respondWithResult(_0x39f243,null))['catch'](handleError(_0x39f243,null));};exports[_0x6487('0x44')]=function(_0x318db5,_0x42a6e6){return db[_0x6487('0x3a')][_0x6487('0x44')](_0x318db5[_0x6487('0x45')],{})[_0x6487('0x22')](respondWithResult(_0x42a6e6,0xc9))[_0x6487('0x3d')](handleError(_0x42a6e6,null));};exports[_0x6487('0x21')]=function(_0x1e8ae7,_0x12e864){if(_0x1e8ae7[_0x6487('0x45')]['id']){delete _0x1e8ae7['body']['id'];}return db[_0x6487('0x3a')]['find']({'where':{'id':_0x1e8ae7[_0x6487('0x3f')]['id']}})[_0x6487('0x22')](handleEntityNotFound(_0x12e864,null))[_0x6487('0x22')](saveUpdates(_0x1e8ae7[_0x6487('0x45')],null))[_0x6487('0x22')](respondWithResult(_0x12e864,null))[_0x6487('0x3d')](handleError(_0x12e864,null));};exports[_0x6487('0x23')]=function(_0x156646,_0x2046fe){return db[_0x6487('0x3a')][_0x6487('0x43')]({'where':{'id':_0x156646[_0x6487('0x3f')]['id']}})[_0x6487('0x22')](handleEntityNotFound(_0x2046fe,null))[_0x6487('0x22')](removeEntity(_0x2046fe,null))[_0x6487('0x3d')](handleError(_0x2046fe,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 027d586..d798a65 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 _0x8fd6=['../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x4facd9,_0x35f76b){var _0x20a7f8=function(_0x3755b6){while(--_0x3755b6){_0x4facd9['push'](_0x4facd9['shift']());}};_0x20a7f8(++_0x35f76b);}(_0x8fd6,0xe9));var _0x68fd=function(_0x972085,_0x326033){_0x972085=_0x972085-0x0;var _0x298ece=_0x8fd6[_0x972085];return _0x298ece;};'use strict';var _=require(_0x68fd('0x0'));var util=require(_0x68fd('0x1'));var logger=require('../../config/logger')(_0x68fd('0x2'));var moment=require(_0x68fd('0x3'));var BPromise=require(_0x68fd('0x4'));var rp=require(_0x68fd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68fd('0x6'));var config=require(_0x68fd('0x7'));var attributes=require(_0x68fd('0x8'));module[_0x68fd('0x9')]=function(_0x3b481b,_0x250bd0){return _0x3b481b[_0x68fd('0xa')](_0x68fd('0xb'),attributes,{'tableName':_0x68fd('0xc'),'paranoid':![],'indexes':[{'name':_0x68fd('0xd'),'fields':[_0x68fd('0xe'),_0x68fd('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x388a=['request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','api','bluebird'];(function(_0x1cfacc,_0x167cca){var _0x5e8766=function(_0x49819e){while(--_0x49819e){_0x1cfacc['push'](_0x1cfacc['shift']());}};_0x5e8766(++_0x167cca);}(_0x388a,0x8d));var _0xa388=function(_0x491d45,_0x50f5ff){_0x491d45=_0x491d45-0x0;var _0x403473=_0x388a[_0x491d45];return _0x403473;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa388('0x0'));var moment=require('moment');var BPromise=require(_0xa388('0x1'));var rp=require(_0xa388('0x2'));var fs=require('fs');var path=require(_0xa388('0x3'));var rimraf=require(_0xa388('0x4'));var config=require(_0xa388('0x5'));var attributes=require(_0xa388('0x6'));module[_0xa388('0x7')]=function(_0x209d92,_0x4db668){return _0x209d92[_0xa388('0x8')]('DeskField',attributes,{'tableName':_0xa388('0x9'),'paranoid':![],'indexes':[{'name':_0xa388('0xa'),'fields':[_0xa388('0xb'),_0xa388('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 7f5a738..61284ec 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 _0x00fa=['request\x20sent','stringify','error','DeskField,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x00fa,0xae));var _0xa00f=function(_0x165fef,_0x2e2a17){_0x165fef=_0x165fef-0x0;var _0x26dbaa=_0x00fa[_0x165fef];return _0x26dbaa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa00f('0x0'));var BPromise=require(_0xa00f('0x1'));var rs=require(_0xa00f('0x2'));var fs=require('fs');var Redis=require(_0xa00f('0x3'));var db=require(_0xa00f('0x4'))['db'];var utils=require(_0xa00f('0x5'));var logger=require('../../config/logger')(_0xa00f('0x6'));var config=require(_0xa00f('0x7'));var jayson=require(_0xa00f('0x8'));var client=jayson[_0xa00f('0x9')][_0xa00f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fbb79,_0x262874,_0x2ddeb5){return new BPromise(function(_0x41bb57,_0x8a57fd){return client[_0xa00f('0xb')](_0x2fbb79,_0x2ddeb5)['then'](function(_0x37ccbb){logger[_0xa00f('0xc')]('DeskField,\x20%s,\x20%s',_0x262874,'request\x20sent');logger[_0xa00f('0xd')](_0xa00f('0xe'),_0x262874,_0xa00f('0xf'),JSON[_0xa00f('0x10')](_0x37ccbb));if(_0x37ccbb[_0xa00f('0x11')]){if(_0x37ccbb[_0xa00f('0x11')]['code']===0x1f4){logger['error'](_0xa00f('0x12'),_0x262874,_0x37ccbb[_0xa00f('0x11')][_0xa00f('0x13')]);return _0x8a57fd(_0x37ccbb[_0xa00f('0x11')][_0xa00f('0x13')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x262874,_0x37ccbb[_0xa00f('0x11')]['message']);return _0x41bb57(_0x37ccbb[_0xa00f('0x11')][_0xa00f('0x13')]);}else{logger[_0xa00f('0xc')](_0xa00f('0x12'),_0x262874,'request\x20sent');_0x41bb57(_0x37ccbb[_0xa00f('0x14')][_0xa00f('0x13')]);}})['catch'](function(_0x3cf01a){logger[_0xa00f('0x11')](_0xa00f('0x12'),_0x262874,_0x3cf01a);_0x8a57fd(_0x3cf01a);});});} \ No newline at end of file +var _0x120d=['result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','DeskField,\x20%s,\x20%s'];(function(_0x10836e,_0x178cee){var _0xa3de22=function(_0x538630){while(--_0x538630){_0x10836e['push'](_0x10836e['shift']());}};_0xa3de22(++_0x178cee);}(_0x120d,0xf4));var _0xd120=function(_0x3f9ea9,_0x19840d){_0x3f9ea9=_0x3f9ea9-0x0;var _0x291e7f=_0x120d[_0x3f9ea9];return _0x291e7f;};'use strict';var _=require(_0xd120('0x0'));var util=require(_0xd120('0x1'));var moment=require(_0xd120('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd120('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd120('0x4'));var logger=require(_0xd120('0x5'))(_0xd120('0x6'));var config=require(_0xd120('0x7'));var jayson=require(_0xd120('0x8'));var client=jayson[_0xd120('0x9')][_0xd120('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcc3f75,_0x8fe539,_0x30615a){return new BPromise(function(_0x29ebc6,_0x277954){return client[_0xd120('0xb')](_0xcc3f75,_0x30615a)[_0xd120('0xc')](function(_0x30ac7c){logger['info']('DeskField,\x20%s,\x20%s',_0x8fe539,_0xd120('0xd'));logger[_0xd120('0xe')](_0xd120('0xf'),_0x8fe539,_0xd120('0xd'),JSON[_0xd120('0x10')](_0x30ac7c));if(_0x30ac7c[_0xd120('0x11')]){if(_0x30ac7c['error']['code']===0x1f4){logger[_0xd120('0x11')]('DeskField,\x20%s,\x20%s',_0x8fe539,_0x30ac7c['error']['message']);return _0x277954(_0x30ac7c[_0xd120('0x11')][_0xd120('0x12')]);}logger[_0xd120('0x11')](_0xd120('0x13'),_0x8fe539,_0x30ac7c[_0xd120('0x11')][_0xd120('0x12')]);return _0x29ebc6(_0x30ac7c[_0xd120('0x11')][_0xd120('0x12')]);}else{logger['info'](_0xd120('0x13'),_0x8fe539,'request\x20sent');_0x29ebc6(_0x30ac7c[_0xd120('0x14')][_0xd120('0x12')]);}})[_0xd120('0x15')](function(_0x528853){logger[_0xd120('0x11')](_0xd120('0x13'),_0x8fe539,_0x528853);_0x277954(_0x528853);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 35e2ffe..df3e841 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 _0x265b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x332ceb,_0x5c4479){var _0x5324be=function(_0x31aeba){while(--_0x31aeba){_0x332ceb['push'](_0x332ceb['shift']());}};_0x5324be(++_0x5c4479);}(_0x265b,0xb1));var _0xb265=function(_0xab1a26,_0x360795){_0xab1a26=_0xab1a26-0x0;var _0x72d86b=_0x265b[_0xab1a26];return _0x72d86b;};'use strict';var multer=require(_0xb265('0x0'));var util=require(_0xb265('0x1'));var path=require(_0xb265('0x2'));var timeout=require(_0xb265('0x3'));var express=require(_0xb265('0x4'));var router=express[_0xb265('0x5')]();var auth=require(_0xb265('0x6'));var interaction=require(_0xb265('0x7'));var config=require(_0xb265('0x8'));var controller=require(_0xb265('0x9'));router[_0xb265('0xa')]('/',auth[_0xb265('0xb')](),controller[_0xb265('0xc')]);router['get'](_0xb265('0xd'),auth['isAuthenticated'](),controller[_0xb265('0xe')]);router[_0xb265('0xa')](_0xb265('0xf'),auth['isAuthenticated'](),controller[_0xb265('0x10')]);router['get'](_0xb265('0x11'),auth[_0xb265('0xb')](),controller[_0xb265('0x12')]);router[_0xb265('0x13')]('/',auth[_0xb265('0xb')](),controller[_0xb265('0x14')]);router[_0xb265('0x13')](_0xb265('0xf'),auth[_0xb265('0xb')](),controller[_0xb265('0x15')]);router[_0xb265('0x16')](_0xb265('0xd'),auth['isAuthenticated'](),controller[_0xb265('0x17')]);router[_0xb265('0x18')]('/:id',auth[_0xb265('0xb')](),controller[_0xb265('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7b23=['create','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x14250e,_0x42f303){var _0x277c97=function(_0xfe636d){while(--_0xfe636d){_0x14250e['push'](_0x14250e['shift']());}};_0x277c97(++_0x42f303);}(_0x7b23,0x1e7));var _0x37b2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7b23[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x37b2('0x0'));var util=require('util');var path=require(_0x37b2('0x1'));var timeout=require(_0x37b2('0x2'));var express=require(_0x37b2('0x3'));var router=express['Router']();var auth=require(_0x37b2('0x4'));var interaction=require(_0x37b2('0x5'));var config=require(_0x37b2('0x6'));var controller=require(_0x37b2('0x7'));router[_0x37b2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x37b2('0x8')](_0x37b2('0x9'),auth[_0x37b2('0xa')](),controller[_0x37b2('0xb')]);router[_0x37b2('0x8')](_0x37b2('0xc'),auth[_0x37b2('0xa')](),controller[_0x37b2('0xd')]);router[_0x37b2('0x8')](_0x37b2('0xe'),auth[_0x37b2('0xa')](),controller[_0x37b2('0xf')]);router[_0x37b2('0x10')]('/',auth[_0x37b2('0xa')](),controller[_0x37b2('0x11')]);router[_0x37b2('0x10')](_0x37b2('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x37b2('0xa')](),controller['update']);router[_0x37b2('0x12')]('/:id',auth[_0x37b2('0xa')](),controller[_0x37b2('0x13')]);module[_0x37b2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 2413e5c..f3a0b47 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 _0x4564=['exports','STRING','sequelize'];(function(_0x58f8b5,_0x170d97){var _0x2dde1d=function(_0x23c30d){while(--_0x23c30d){_0x58f8b5['push'](_0x58f8b5['shift']());}};_0x2dde1d(++_0x170d97);}(_0x4564,0x107));var _0x4456=function(_0x21c02f,_0x5a4b9a){_0x21c02f=_0x21c02f-0x0;var _0x3a8824=_0x4564[_0x21c02f];return _0x3a8824;};'use strict';var Sequelize=require(_0x4456('0x0'));module[_0x4456('0x1')]={'name':{'type':Sequelize[_0x4456('0x2')]},'username':{'type':Sequelize[_0x4456('0x2')]},'password':{'type':Sequelize[_0x4456('0x2')]},'remoteUri':{'type':Sequelize[_0x4456('0x2')]},'tenantId':{'type':Sequelize[_0x4456('0x2')]},'clientId':{'type':Sequelize[_0x4456('0x2')]},'clientSecret':{'type':Sequelize[_0x4456('0x2')]},'serverUrl':{'type':Sequelize[_0x4456('0x2')]},'description':{'type':Sequelize[_0x4456('0x2')]}}; \ No newline at end of file +var _0x9364=['STRING','sequelize','exports'];(function(_0x34864e,_0x28500b){var _0x3c164f=function(_0x1f625e){while(--_0x1f625e){_0x34864e['push'](_0x34864e['shift']());}};_0x3c164f(++_0x28500b);}(_0x9364,0x1ab));var _0x4936=function(_0x16e691,_0x2e9dba){_0x16e691=_0x16e691-0x0;var _0x5f55b8=_0x9364[_0x16e691];return _0x5f55b8;};'use strict';var Sequelize=require(_0x4936('0x0'));module[_0x4936('0x1')]={'name':{'type':Sequelize[_0x4936('0x2')]},'username':{'type':Sequelize[_0x4936('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x4936('0x2')]},'clientSecret':{'type':Sequelize[_0x4936('0x2')]},'serverUrl':{'type':Sequelize[_0x4936('0x2')]},'description':{'type':Sequelize[_0x4936('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f3fc4bf..79f6f82 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 _0x8227=['getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','incident','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','accountidname','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','slice','substring','lastIndexOf','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','DecimalAttributeMetadata','send','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','4.0','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','OptionSet','FalseOption',')/Microsoft.Dynamics.CRM.','DisplayName','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','filter','where','merge','map','options','Dynamics365Account','includeAll','include','findAll','rows','show','length','find','create','body','params','getConfigurations','findOne','pick','nolimit','addConfiguration','AccountId'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x8227,0x146));var _0x7822=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8227[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7822('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7822('0x1'));var jsonpatch=require(_0x7822('0x2'));var rp=require(_0x7822('0x3'));var moment=require(_0x7822('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7822('0x5'));var util=require(_0x7822('0x6'));var path=require(_0x7822('0x7'));var sox=require(_0x7822('0x8'));var csv=require(_0x7822('0x9'));var ejs=require(_0x7822('0xa'));var fs=require('fs');var _=require(_0x7822('0xb'));var squel=require(_0x7822('0xc'));var crypto=require('crypto');var jsforce=require(_0x7822('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7822('0x9'));var querystring=require(_0x7822('0xe'));var Papa=require(_0x7822('0xf'));var Redis=require(_0x7822('0x10'));var authService=require(_0x7822('0x11'));var qs=require(_0x7822('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7822('0x13'))('api');var utils=require(_0x7822('0x14'));var config=require(_0x7822('0x15'));var db=require(_0x7822('0x16'))['db'];var integrations=require(_0x7822('0x17'));var jayson=require(_0x7822('0x18'));var client=jayson[_0x7822('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x58f462,_0xb0b5c,_0x10703c){if(_0x10703c){var _0x5bd7e0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5bd7e0[_0x7822('0x1a')](_0xb0b5c)){return _0x58f462;}else{throw new db[(_0x7822('0x1b'))][(_0x7822('0x1c'))](_0x7822('0x1d'));}}else{return _0x58f462;}}function respondWithRpcPromise(_0x411d99,_0x5c13de,_0x4a8b06,_0x154c49){return new BPromise(function(_0x228381,_0x65b961){var _0x144fdb=_0x154c49||client;return _0x144fdb[_0x7822('0x1e')](_0x411d99,_0x4a8b06)[_0x7822('0x1f')](function(_0x37f0fd){logger[_0x7822('0x20')](_0x7822('0x21'),_0x5c13de,_0x7822('0x22'));logger[_0x7822('0x23')](_0x7822('0x24'),_0x5c13de,_0x7822('0x22'),JSON[_0x7822('0x25')](_0x37f0fd));if(_0x37f0fd[_0x7822('0x26')]){if(_0x37f0fd[_0x7822('0x26')]['code']===0x1f4){logger[_0x7822('0x26')](_0x7822('0x21'),_0x5c13de,_0x37f0fd[_0x7822('0x26')][_0x7822('0x27')]);return _0x65b961(_0x37f0fd[_0x7822('0x26')]['message']);}logger[_0x7822('0x26')]('Dynamics365Account,\x20%s,\x20%s',_0x5c13de,_0x37f0fd['error'][_0x7822('0x27')]);return _0x228381(_0x37f0fd[_0x7822('0x26')][_0x7822('0x27')]);}else{logger[_0x7822('0x20')]('Dynamics365Account,\x20%s,\x20%s',_0x5c13de,'request\x20sent');_0x228381(_0x37f0fd[_0x7822('0x28')][_0x7822('0x27')]);}})[_0x7822('0x29')](function(_0x53f827){logger[_0x7822('0x26')](_0x7822('0x21'),_0x5c13de,_0x53f827);_0x65b961(_0x53f827);});});}function respondWithStatusCode(_0x47c424,_0x4bbcae){_0x4bbcae=_0x4bbcae||0xcc;return function(_0x6ffc4d){if(_0x6ffc4d){return _0x47c424[_0x7822('0x2a')](_0x4bbcae);}return _0x47c424['status'](_0x4bbcae)[_0x7822('0x2b')]();};}function respondWithResult(_0xef55f2,_0x30d46d){_0x30d46d=_0x30d46d||0xc8;return function(_0x470dcd){if(_0x470dcd){return _0xef55f2[_0x7822('0x2c')](_0x30d46d)[_0x7822('0x2d')](_0x470dcd);}};}function respondWithFilteredResult(_0x54aa99,_0x2dd015){return function(_0x190cb2){if(_0x190cb2){var _0x19173e=_0x190cb2[_0x7822('0x2e')],_0x8ce726=_0x2dd015[_0x7822('0x2f')],_0x3df5ff=_0x2dd015[_0x7822('0x2f')]+_0x2dd015['limit'],_0x1d33b8;if(_0x3df5ff>=_0x19173e){_0x3df5ff=_0x19173e;_0x1d33b8=0xc8;}else{_0x1d33b8=0xce;}_0x54aa99['status'](_0x1d33b8);return _0x54aa99['set'](_0x7822('0x30'),_0x8ce726+'-'+_0x3df5ff+'/'+_0x19173e)[_0x7822('0x2d')](_0x190cb2);}return null;};}function patchUpdates(_0x53e41a){return function(_0x25db50){try{jsonpatch[_0x7822('0x31')](_0x25db50,_0x53e41a,!![]);}catch(_0x56d13c){return BPromise[_0x7822('0x32')](_0x56d13c);}return _0x25db50[_0x7822('0x33')]();};}function saveUpdates(_0x11c9c4,_0x56b2fb){return function(_0x5f35df){if(_0x5f35df){return _0x5f35df[_0x7822('0x34')](_0x11c9c4)['then'](function(_0x4792f5){return _0x4792f5;});}return null;};}function removeEntity(_0x22357a,_0x54544b){return function(_0x31a28c){if(_0x31a28c){return _0x31a28c[_0x7822('0x35')]()[_0x7822('0x1f')](function(){_0x22357a['status'](0xcc)[_0x7822('0x2b')]();});}};}function handleEntityNotFound(_0x464bae,_0x1b1d4d){return function(_0x294302){if(!_0x294302){_0x464bae[_0x7822('0x2a')](0x194);}return _0x294302;};}function handleError(_0xde259c,_0x22285a){_0x22285a=_0x22285a||0x1f4;return function(_0x5d03dd){logger[_0x7822('0x26')](_0x5d03dd[_0x7822('0x36')]);if(_0x5d03dd[_0x7822('0x37')]){delete _0x5d03dd[_0x7822('0x37')];}_0xde259c[_0x7822('0x2c')](_0x22285a)['send'](_0x5d03dd);};}exports['index']=function(_0xc323c3,_0x5adf19){var _0x3c7ab4={},_0x32166f={},_0x47281c={'count':0x0,'rows':[]};var _0x10c2b9=_['map'](db['Dynamics365Account'][_0x7822('0x38')],function(_0x33f4ab){return{'name':_0x33f4ab['fieldName'],'type':_0x33f4ab[_0x7822('0x39')][_0x7822('0x3a')]};});_0x32166f['model']=_['map'](_0x10c2b9,_0x7822('0x37'));_0x32166f[_0x7822('0x3b')]=_[_0x7822('0x3c')](_0xc323c3['query']);_0x32166f[_0x7822('0x3d')]=_[_0x7822('0x3e')](_0x32166f[_0x7822('0x3f')],_0x32166f[_0x7822('0x3b')]);_0x3c7ab4[_0x7822('0x40')]=_[_0x7822('0x3e')](_0x32166f['model'],qs[_0x7822('0x41')](_0xc323c3[_0x7822('0x3b')][_0x7822('0x41')]));_0x3c7ab4[_0x7822('0x40')]=_0x3c7ab4[_0x7822('0x40')]['length']?_0x3c7ab4[_0x7822('0x40')]:_0x32166f[_0x7822('0x3f')];if(!_0xc323c3[_0x7822('0x3b')][_0x7822('0x42')]('nolimit')){_0x3c7ab4[_0x7822('0x43')]=qs[_0x7822('0x43')](_0xc323c3['query'][_0x7822('0x43')]);_0x3c7ab4[_0x7822('0x2f')]=qs[_0x7822('0x2f')](_0xc323c3[_0x7822('0x3b')][_0x7822('0x2f')]);}_0x3c7ab4[_0x7822('0x44')]=qs['sort'](_0xc323c3[_0x7822('0x3b')][_0x7822('0x45')]);_0x3c7ab4['where']=qs[_0x7822('0x3d')](_['pick'](_0xc323c3[_0x7822('0x3b')],_0x32166f[_0x7822('0x3d')]));if(_0xc323c3[_0x7822('0x3b')][_0x7822('0x46')]){_0x3c7ab4[_0x7822('0x47')]=_[_0x7822('0x48')](_0x3c7ab4[_0x7822('0x47')],{'$or':_[_0x7822('0x49')](_0x10c2b9,function(_0x33af3a){if(_0x33af3a['type']!=='VIRTUAL'){var _0x197385={};_0x197385[_0x33af3a['name']]={'$like':'%'+_0xc323c3['query'][_0x7822('0x46')]+'%'};return _0x197385;}})});}_0x3c7ab4=_[_0x7822('0x48')]({},_0x3c7ab4,_0xc323c3[_0x7822('0x4a')]);var _0xad3cce={'where':_0x3c7ab4[_0x7822('0x47')]};return db[_0x7822('0x4b')][_0x7822('0x2e')](_0xad3cce)[_0x7822('0x1f')](function(_0x215bc9){_0x47281c['count']=_0x215bc9;if(_0xc323c3[_0x7822('0x3b')][_0x7822('0x4c')]){_0x3c7ab4[_0x7822('0x4d')]=[{'all':!![]}];}return db[_0x7822('0x4b')][_0x7822('0x4e')](_0x3c7ab4);})[_0x7822('0x1f')](function(_0x5910e7){_0x47281c[_0x7822('0x4f')]=_0x5910e7;return _0x47281c;})[_0x7822('0x1f')](respondWithFilteredResult(_0x5adf19,_0x3c7ab4))[_0x7822('0x29')](handleError(_0x5adf19,null));};exports[_0x7822('0x50')]=function(_0x3b6848,_0x3d8b69){var _0x34c682={'raw':![],'where':{'id':_0x3b6848['params']['id']}},_0x1b9002={};_0x1b9002['model']=_[_0x7822('0x3c')](db['Dynamics365Account'][_0x7822('0x38')]);_0x1b9002[_0x7822('0x3b')]=_[_0x7822('0x3c')](_0x3b6848[_0x7822('0x3b')]);_0x1b9002['filters']=_[_0x7822('0x3e')](_0x1b9002[_0x7822('0x3f')],_0x1b9002[_0x7822('0x3b')]);_0x34c682['attributes']=_[_0x7822('0x3e')](_0x1b9002[_0x7822('0x3f')],qs[_0x7822('0x41')](_0x3b6848[_0x7822('0x3b')]['fields']));_0x34c682['attributes']=_0x34c682['attributes'][_0x7822('0x51')]?_0x34c682[_0x7822('0x40')]:_0x1b9002[_0x7822('0x3f')];if(_0x3b6848[_0x7822('0x3b')][_0x7822('0x4c')]){_0x34c682['include']=[{'all':!![]}];}_0x34c682=_[_0x7822('0x48')]({},_0x34c682,_0x3b6848[_0x7822('0x4a')]);return db[_0x7822('0x4b')][_0x7822('0x52')](_0x34c682)[_0x7822('0x1f')](handleEntityNotFound(_0x3d8b69,null))[_0x7822('0x1f')](respondWithResult(_0x3d8b69,null))[_0x7822('0x29')](handleError(_0x3d8b69,null));};exports[_0x7822('0x53')]=function(_0xd2ed80,_0x332723){return db[_0x7822('0x4b')][_0x7822('0x53')](_0xd2ed80['body'],{})['then'](respondWithResult(_0x332723,0xc9))['catch'](handleError(_0x332723,null));};exports[_0x7822('0x34')]=function(_0x19a673,_0x4803dd){if(_0x19a673[_0x7822('0x54')]['id']){delete _0x19a673[_0x7822('0x54')]['id'];}return db[_0x7822('0x4b')][_0x7822('0x52')]({'where':{'id':_0x19a673[_0x7822('0x55')]['id']}})[_0x7822('0x1f')](handleEntityNotFound(_0x4803dd,null))['then'](saveUpdates(_0x19a673[_0x7822('0x54')],null))[_0x7822('0x1f')](respondWithResult(_0x4803dd,null))[_0x7822('0x29')](handleError(_0x4803dd,null));};exports['destroy']=function(_0x44f064,_0x474f38){return db['Dynamics365Account'][_0x7822('0x52')]({'where':{'id':_0x44f064[_0x7822('0x55')]['id']}})['then'](handleEntityNotFound(_0x474f38,null))[_0x7822('0x1f')](removeEntity(_0x474f38,null))[_0x7822('0x29')](handleError(_0x474f38,null));};exports[_0x7822('0x56')]=function(_0x1212e6,_0x6c440a,_0x31a52f){var _0x1ce2ac={};var _0x1e1eda={};var _0x13d4fd;var _0x4ffcd3;return db[_0x7822('0x4b')][_0x7822('0x57')]({'where':{'id':_0x1212e6[_0x7822('0x55')]['id']}})[_0x7822('0x1f')](handleEntityNotFound(_0x6c440a,null))[_0x7822('0x1f')](function(_0x1e68bb){if(_0x1e68bb){_0x13d4fd=_0x1e68bb;_0x1e1eda['model']=_[_0x7822('0x3c')](db['Dynamics365Configuration'][_0x7822('0x38')]);_0x1e1eda[_0x7822('0x3b')]=_[_0x7822('0x3c')](_0x1212e6[_0x7822('0x3b')]);_0x1e1eda[_0x7822('0x3d')]=_[_0x7822('0x3e')](_0x1e1eda['model'],_0x1e1eda[_0x7822('0x3b')]);_0x1ce2ac[_0x7822('0x40')]=_[_0x7822('0x3e')](_0x1e1eda[_0x7822('0x3f')],qs['fields'](_0x1212e6[_0x7822('0x3b')][_0x7822('0x41')]));_0x1ce2ac[_0x7822('0x40')]=_0x1ce2ac[_0x7822('0x40')][_0x7822('0x51')]?_0x1ce2ac['attributes']:_0x1e1eda[_0x7822('0x3f')];_0x1ce2ac[_0x7822('0x44')]=qs[_0x7822('0x45')](_0x1212e6[_0x7822('0x3b')][_0x7822('0x45')]);_0x1ce2ac['where']=qs[_0x7822('0x3d')](_[_0x7822('0x58')](_0x1212e6[_0x7822('0x3b')],_0x1e1eda[_0x7822('0x3d')]));if(_0x1212e6[_0x7822('0x3b')][_0x7822('0x46')]){_0x1ce2ac[_0x7822('0x47')]=_[_0x7822('0x48')](_0x1ce2ac[_0x7822('0x47')],{'$or':_[_0x7822('0x49')](_0x1ce2ac[_0x7822('0x40')],function(_0x368d23){var _0x57af0a={};_0x57af0a[_0x368d23]={'$like':'%'+_0x1212e6['query'][_0x7822('0x46')]+'%'};return _0x57af0a;})});}_0x1ce2ac=_[_0x7822('0x48')]({},_0x1ce2ac,_0x1212e6[_0x7822('0x4a')]);return _0x13d4fd[_0x7822('0x56')](_0x1ce2ac);}})[_0x7822('0x1f')](function(_0x22e970){if(_0x22e970){_0x4ffcd3=_0x22e970[_0x7822('0x51')];if(!_0x1212e6[_0x7822('0x3b')][_0x7822('0x42')](_0x7822('0x59'))){_0x1ce2ac[_0x7822('0x43')]=qs[_0x7822('0x43')](_0x1212e6['query']['limit']);_0x1ce2ac[_0x7822('0x2f')]=qs[_0x7822('0x2f')](_0x1212e6['query']['offset']);}return _0x13d4fd[_0x7822('0x56')](_0x1ce2ac);}})[_0x7822('0x1f')](function(_0x5ee603){if(_0x5ee603){return _0x5ee603?{'count':_0x4ffcd3,'rows':_0x5ee603}:null;}})['then'](respondWithResult(_0x6c440a,null))[_0x7822('0x29')](handleError(_0x6c440a,null));};exports[_0x7822('0x5a')]=function(_0x30f0f7,_0x2d4f25,_0x48ce7b){if(_0x30f0f7[_0x7822('0x54')]['id']){delete _0x30f0f7[_0x7822('0x54')]['id'];}return db[_0x7822('0x4b')][_0x7822('0x57')]({'where':{'id':_0x30f0f7[_0x7822('0x55')]['id']}})[_0x7822('0x1f')](handleEntityNotFound(_0x2d4f25,null))[_0x7822('0x1f')](function(_0xc35d0c){if(_0xc35d0c){_0x30f0f7[_0x7822('0x54')][_0x7822('0x5b')]=_0xc35d0c['id'];_0x30f0f7['body']['Subjects']=integrations[_0x7822('0x5c')](_0x30f0f7[_0x7822('0x54')][_0x7822('0x5d')],_0x30f0f7[_0x7822('0x54')][_0x7822('0x39')]);_0x30f0f7[_0x7822('0x54')][_0x7822('0x5e')]=integrations[_0x7822('0x5f')](_0x30f0f7[_0x7822('0x54')][_0x7822('0x5d')],_0x30f0f7[_0x7822('0x54')]['type']);return db[_0x7822('0x60')][_0x7822('0x53')](_0x30f0f7['body'],{'include':[{'model':db[_0x7822('0x61')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x7822('0x5e')}]});}return null;})[_0x7822('0x1f')](respondWithResult(_0x2d4f25,null))[_0x7822('0x29')](handleError(_0x2d4f25,null));};exports[_0x7822('0x62')]=function(_0x73b40f,_0x365e34,_0x34d35b){var _0x9b46d4=_0x73b40f[_0x7822('0x3b')]['ticketType'];var _0x5d74b6=_0x9b46d4===_0x7822('0x63')?'Incident':'PhoneCall';var _0x2532fd='';var _0x71556c='';var _0x391d0b='';var _0x411c2d='';var _0xa872ed='';var _0x1eb6f0='';var _0x582210='';var _0x3456ea='';var _0x520344=['title','description',_0x7822('0x64'),_0x7822('0x65'),'caseorigincode',_0x7822('0x66'),_0x7822('0x67'),_0x7822('0x68'),_0x7822('0x69'),'phonecall_activity_parties'];var _0x2f8640=[_0x7822('0x6a'),'accountidyominame','actualserviceunits',_0x7822('0x6b'),_0x7822('0x6c'),_0x7822('0x6d'),_0x7822('0x6e'),_0x7822('0x6f'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x7822('0x70'),_0x7822('0x71'),_0x7822('0x72'),_0x7822('0x73'),'createdonbehalfbyyominame','customeridname',_0x7822('0x74'),_0x7822('0x75'),'emailaddress','entitlementidname',_0x7822('0x76'),_0x7822('0x77'),_0x7822('0x78'),_0x7822('0x79'),'firstresponsebykpiidname',_0x7822('0x7a'),_0x7822('0x7b'),_0x7822('0x7c'),_0x7822('0x7d'),_0x7822('0x7e'),'masteridname',_0x7822('0x7f'),_0x7822('0x80'),_0x7822('0x81'),_0x7822('0x82'),_0x7822('0x83'),_0x7822('0x84'),_0x7822('0x85'),'msdyn_incidenttypename',_0x7822('0x86'),_0x7822('0x87'),_0x7822('0x88'),_0x7822('0x89'),_0x7822('0x8a'),_0x7822('0x8b'),'owneridyominame',_0x7822('0x8c'),'primarycontactidname','primarycontactidyominame',_0x7822('0x8d'),'productidname',_0x7822('0x8e'),_0x7822('0x8f'),_0x7822('0x90'),_0x7822('0x91'),_0x7822('0x92'),_0x7822('0x93'),_0x7822('0x94'),_0x7822('0x95'),'slaname','socialprofileidname',_0x7822('0x96'),_0x7822('0x97'),_0x7822('0x98'),_0x7822('0x99'),_0x7822('0x9a'),_0x7822('0x9b'),_0x7822('0x9c'),_0x7822('0x9d'),_0x7822('0x9e')];var _0x13f7c4=_0x520344[_0x7822('0x9f')](_0x2f8640);return db[_0x7822('0x4b')][_0x7822('0x57')]({'where':{'id':_0x73b40f[_0x7822('0x55')]['id']},'attributes':['id','username',_0x7822('0xa0'),'remoteUri','tenantId','clientId','clientSecret']})[_0x7822('0x1f')](handleEntityNotFound(_0x365e34,null))[_0x7822('0x1f')](function(_0x1c6864){if(_0x1c6864){_0x3456ea=_0x1c6864['remoteUri'];var _0x1b3870=_0x3456ea[_0x7822('0xa1')](-0x1);if(_0x1b3870==='/'){_0x3456ea=_0x3456ea[_0x7822('0xa2')](0x0,_0x3456ea[_0x7822('0xa3')](_0x1b3870));}_0x582210=util['format']('%s/api/data/v9.0/',_0x3456ea);var _0x322b4f={'method':_0x7822('0xa4'),'uri':_0x7822('0xa5')+_0x1c6864[_0x7822('0xa6')]+_0x7822('0xa7'),'form':{'client_id':_0x1c6864[_0x7822('0xa8')],'resource':_0x3456ea,'username':_0x1c6864['username'],'password':_0x1c6864['password'],'grant_type':_0x7822('0xa0'),'client_secret':_0x1c6864[_0x7822('0xa9')]},'json':!![]};return rp(_0x322b4f);}})[_0x7822('0x1f')](function(_0x36a1c6){_0x1eb6f0=_0x36a1c6[_0x7822('0xaa')];var _0x5f594f={'method':_0x7822('0xab'),'uri':encodeURI(_0x582210+_0x7822('0xac')+_0x5d74b6+'\x27'),'headers':{'Authorization':_0x7822('0xad')+_0x1eb6f0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5f594f);})['then'](function(_0x21f32b){var _0x44ba9a=_0x21f32b[_0x7822('0xae')][0x0];var _0xbe4da0=_0x44ba9a[_0x7822('0xaf')];var _0x4ed263={'method':_0x7822('0xab'),'uri':_0x582210+_0x7822('0xb0')+_0xbe4da0+_0x7822('0xb1'),'headers':{'Authorization':_0x7822('0xad')+_0x1eb6f0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4ed263);})[_0x7822('0x1f')](function(_0x3bfbb2){_0x2532fd=_0x3bfbb2;_0x71556c=_0x2532fd[_0x7822('0xb2')];_0x71556c=_['remove'](_0x71556c,function(_0xb4f6df){return!_0x13f7c4['includes'](_0xb4f6df[_0x7822('0xb3')]);});var _0x846d51=[];var _0x70a6fb=[];_0x71556c['forEach'](function(_0x3efa60){if(_0x3efa60['@odata.type']){var _0x3054fc=_0x3efa60[_0x7822('0xb4')][_0x7822('0xa2')](_0x3efa60[_0x7822('0xb4')]['lastIndexOf']('.')+0x1);if(_0x3054fc===_0x7822('0xb5')){_0x846d51[_0x7822('0xb6')](getSelectList(_0x582210,_0x9b46d4,_0x70a6fb,_0x2532fd[_0x7822('0xaf')],_0x3efa60[_0x7822('0xaf')],_0x1eb6f0));}}});return Promise[_0x7822('0xb7')](_0x846d51);})[_0x7822('0x1f')](function(_0x9cf302){_0x391d0b=_0x9cf302[0x0];var _0x2890f3=[];var _0x114ec7=[];_0x71556c[_0x7822('0xb8')](function(_0x33a3ca){if(!_[_0x7822('0xb9')](_0x33a3ca['@odata.type'])){var _0x59340c=_0x33a3ca[_0x7822('0xb4')]['substring'](_0x33a3ca[_0x7822('0xb4')]['lastIndexOf']('.')+0x1);if(_0x59340c===_0x7822('0xba')){_0x2890f3[_0x7822('0xb6')](getBooleanList(_0x582210,_0x9b46d4,_0x114ec7,_0x2532fd[_0x7822('0xaf')],_0x33a3ca['MetadataId'],_0x1eb6f0));}}});return Promise[_0x7822('0xb7')](_0x2890f3);})['then'](function(_0x1ad5ba){_0x411c2d=_0x1ad5ba[0x0];var _0x4f278e=[];var _0x485430=[];_0x71556c[_0x7822('0xb8')](function(_0x18ea90){if(_0x18ea90[_0x7822('0xb4')]){var _0x49d506=_0x18ea90[_0x7822('0xb4')][_0x7822('0xa2')](_0x18ea90[_0x7822('0xb4')][_0x7822('0xa3')]('.')+0x1);if(_0x49d506===_0x7822('0xbb')||_0x49d506===_0x7822('0xbc')||_0x49d506===_0x7822('0xbd')||_0x49d506===_0x7822('0xbe')||_0x49d506==='MemoAttributeMetadata'||_0x49d506===_0x7822('0xbf')||_0x49d506==='StatusAttributeMetadata'||_0x49d506==='EntityNameAttributeMetadata'||_0x49d506==='StateAttributeMetadata'||_0x49d506===_0x7822('0xc0')){_0x4f278e[_0x7822('0xb6')](getInputList(_0x582210,_0x9b46d4,_0x49d506,_0x485430,_0x2532fd['MetadataId'],_0x18ea90['MetadataId'],_0x1eb6f0));}}});return Promise['all'](_0x4f278e);})[_0x7822('0x1f')](function(_0x1eb3b8){_0xa872ed=_0x1eb3b8[0x0];var _0x63f373=_0x391d0b['concat'](_0x411c2d)[_0x7822('0x9f')](_0xa872ed);var _0x4f4386={'count':_0x63f373['length'],'rows':_0x63f373};return _0x4f4386;})['then'](respondWithResult(_0x365e34,null))[_0x7822('0x29')](function(_0xc077be){var _0xe67fc6=_0x73b40f[_0x7822('0x3b')][_0x7822('0x1a')]?0x1f4:_0xc077be['statusCode']||0x1f4;logger[_0x7822('0x26')](_0xc077be[_0x7822('0x36')]);delete _0xc077be[_0x7822('0x37')];if(_0xe67fc6===0x191){_0xe67fc6=0x190;}_0x365e34['status'](_0xe67fc6)[_0x7822('0xc1')](_0x73b40f[_0x7822('0x3b')][_0x7822('0x1a')]?{'message':_0x7822('0xc2'),'statusCode':_0xc077be[_0x7822('0xc3')]}:_0xc077be);});};function getSelectList(_0x6b998,_0x7e213f,_0x27ba31,_0x477c34,_0x31f01b,_0x28d816){var _0x3db5b3={'method':_0x7822('0xab'),'uri':_0x6b998+_0x7822('0xb0')+_0x477c34+_0x7822('0xc4')+_0x31f01b+_0x7822('0xc5')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x28d816,'If-None-Match':null,'OData-Version':_0x7822('0xc6')},'json':!![]};return rp(_0x3db5b3)['then'](function(_0x15b975){var _0x55e1f5=[];var _0x105a5e=_0x15b975['OptionSet']['Options'];_0x105a5e[_0x7822('0xb8')](function(_0x2f0293){_0x55e1f5['push']({'name':_0x2f0293[_0x7822('0xc7')][_0x7822('0xc8')]['Label'],'value':String(_0x2f0293[_0x7822('0xc9')])});});var _0x8530b={'id':_0x7e213f+'_'+_0x15b975[_0x7822('0xb3')],'name':_0x15b975['DisplayName'][_0x7822('0xc8')][_0x7822('0xc7')],'custom':![],'options':_0x55e1f5};_0x27ba31[_0x7822('0xb6')](_0x8530b);return _0x27ba31;});}function getBooleanList(_0x4cfb1f,_0x5b2f45,_0x30d287,_0x1d746a,_0x393cad,_0x2baba6){var _0x1117dc={'method':_0x7822('0xab'),'uri':_0x4cfb1f+_0x7822('0xb0')+_0x1d746a+_0x7822('0xc4')+_0x393cad+_0x7822('0xca'),'headers':{'Authorization':_0x7822('0xad')+_0x2baba6,'If-None-Match':null,'OData-Version':_0x7822('0xc6')},'json':!![]};return rp(_0x1117dc)[_0x7822('0x1f')](function(_0x29c0a8){var _0x4597b8=[];_0x4597b8[_0x7822('0xb6')]({'name':_0x29c0a8['OptionSet'][_0x7822('0xcb')][_0x7822('0xc7')][_0x7822('0xc8')][_0x7822('0xc7')],'value':_0x7822('0xcc')},{'name':_0x29c0a8[_0x7822('0xcd')][_0x7822('0xce')][_0x7822('0xc7')][_0x7822('0xc8')][_0x7822('0xc7')],'value':'false'});var _0x178097={'id':_0x5b2f45+'_'+_0x29c0a8['LogicalName'],'name':_0x29c0a8['DisplayName'][_0x7822('0xc8')]['Label'],'custom':![],'options':_0x4597b8};_0x30d287[_0x7822('0xb6')](_0x178097);return _0x30d287;});}function getInputList(_0x26cce2,_0x6f8c6e,_0x2738ee,_0x295b7a,_0xa610cd,_0x4c1862,_0x1ede01){var _0x38b1e6={'method':'GET','uri':_0x26cce2+'EntityDefinitions('+_0xa610cd+_0x7822('0xc4')+_0x4c1862+_0x7822('0xcf')+_0x2738ee+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x7822('0xad')+_0x1ede01,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x38b1e6)['then'](function(_0x59a3a4){var _0x4c8c46={'id':_0x6f8c6e+'_'+_0x59a3a4[_0x7822('0xb3')],'name':_0x59a3a4[_0x7822('0xd0')]['UserLocalizedLabel']?_0x59a3a4[_0x7822('0xd0')]['UserLocalizedLabel']['Label']:_0x59a3a4['LogicalName'],'custom':![],'options':[]};_0x295b7a[_0x7822('0xb6')](_0x4c8c46);return _0x295b7a;});} \ No newline at end of file +var _0x77ed=['parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/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','remove','LogicalName','@odata.type','forEach','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','false','DisplayName','?$select=DisplayName,LogicalName','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','status','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','findAll','rows','includeAll','include','find','create','body','params','getConfigurations','findOne','order','AccountId','getSubjects','channel','Dynamics365Configuration','Dynamics365Field','Descriptions','getFields','ticketType','incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridyominame'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0x77ed,0x11c));var _0xd77e=function(_0x235467,_0x54e928){_0x235467=_0x235467-0x0;var _0x1341bc=_0x77ed[_0x235467];return _0x1341bc;};'use strict';var pdf=require(_0xd77e('0x0'));var emlformat=require(_0xd77e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd77e('0x2'));var jsonpatch=require(_0xd77e('0x3'));var rp=require(_0xd77e('0x4'));var moment=require('moment');var BPromise=require(_0xd77e('0x5'));var Mustache=require(_0xd77e('0x6'));var util=require(_0xd77e('0x7'));var path=require(_0xd77e('0x8'));var sox=require(_0xd77e('0x9'));var csv=require(_0xd77e('0xa'));var ejs=require(_0xd77e('0xb'));var fs=require('fs');var _=require(_0xd77e('0xc'));var squel=require('squel');var crypto=require(_0xd77e('0xd'));var jsforce=require(_0xd77e('0xe'));var deskjs=require(_0xd77e('0xf'));var toCsv=require(_0xd77e('0xa'));var querystring=require(_0xd77e('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd77e('0x11'));var qs=require(_0xd77e('0x12'));var as=require(_0xd77e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd77e('0x14'))(_0xd77e('0x15'));var utils=require(_0xd77e('0x16'));var config=require(_0xd77e('0x17'));var db=require(_0xd77e('0x18'))['db'];var integrations=require(_0xd77e('0x19'));var jayson=require(_0xd77e('0x1a'));var client=jayson[_0xd77e('0x1b')][_0xd77e('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x19a35f,_0x16f961,_0x7d0b2d){if(_0x7d0b2d){var _0x548cee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x548cee[_0xd77e('0x1d')](_0x16f961)){return _0x19a35f;}else{throw new db[(_0xd77e('0x1e'))]['ValidationError'](_0xd77e('0x1f'));}}else{return _0x19a35f;}}function respondWithRpcPromise(_0x265e9b,_0xd0faae,_0x1c8d65,_0x23b60c){return new BPromise(function(_0x425047,_0x45f43e){var _0x2fc1ae=_0x23b60c||client;return _0x2fc1ae[_0xd77e('0x20')](_0x265e9b,_0x1c8d65)[_0xd77e('0x21')](function(_0xc0165f){logger[_0xd77e('0x22')](_0xd77e('0x23'),_0xd0faae,_0xd77e('0x24'));logger['debug'](_0xd77e('0x25'),_0xd0faae,_0xd77e('0x24'),JSON[_0xd77e('0x26')](_0xc0165f));if(_0xc0165f[_0xd77e('0x27')]){if(_0xc0165f[_0xd77e('0x27')][_0xd77e('0x28')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0xd0faae,_0xc0165f[_0xd77e('0x27')][_0xd77e('0x29')]);return _0x45f43e(_0xc0165f[_0xd77e('0x27')][_0xd77e('0x29')]);}logger['error'](_0xd77e('0x23'),_0xd0faae,_0xc0165f[_0xd77e('0x27')][_0xd77e('0x29')]);return _0x425047(_0xc0165f[_0xd77e('0x27')]['message']);}else{logger['info'](_0xd77e('0x23'),_0xd0faae,_0xd77e('0x24'));_0x425047(_0xc0165f[_0xd77e('0x2a')][_0xd77e('0x29')]);}})[_0xd77e('0x2b')](function(_0x475b5a){logger[_0xd77e('0x27')](_0xd77e('0x23'),_0xd0faae,_0x475b5a);_0x45f43e(_0x475b5a);});});}function respondWithStatusCode(_0x566bdd,_0xf9e51a){_0xf9e51a=_0xf9e51a||0xcc;return function(_0x25d4de){if(_0x25d4de){return _0x566bdd[_0xd77e('0x2c')](_0xf9e51a);}return _0x566bdd['status'](_0xf9e51a)[_0xd77e('0x2d')]();};}function respondWithResult(_0x1ab4e8,_0x34a55b){_0x34a55b=_0x34a55b||0xc8;return function(_0x5e4fd8){if(_0x5e4fd8){return _0x1ab4e8['status'](_0x34a55b)[_0xd77e('0x2e')](_0x5e4fd8);}};}function respondWithFilteredResult(_0x252432,_0xf3d873){return function(_0x1fc2c8){if(_0x1fc2c8){var _0x262f6f=_0x1fc2c8['count'],_0x588b23=_0xf3d873[_0xd77e('0x2f')],_0x34303e=_0xf3d873['offset']+_0xf3d873[_0xd77e('0x30')],_0x37b121;if(_0x34303e>=_0x262f6f){_0x34303e=_0x262f6f;_0x37b121=0xc8;}else{_0x37b121=0xce;}_0x252432['status'](_0x37b121);return _0x252432[_0xd77e('0x31')](_0xd77e('0x32'),_0x588b23+'-'+_0x34303e+'/'+_0x262f6f)['json'](_0x1fc2c8);}return null;};}function patchUpdates(_0x193214){return function(_0x353279){try{jsonpatch[_0xd77e('0x33')](_0x353279,_0x193214,!![]);}catch(_0x50b855){return BPromise['reject'](_0x50b855);}return _0x353279[_0xd77e('0x34')]();};}function saveUpdates(_0x55c023,_0x3f9250){return function(_0x18d1d2){if(_0x18d1d2){return _0x18d1d2[_0xd77e('0x35')](_0x55c023)[_0xd77e('0x21')](function(_0x534a8a){return _0x534a8a;});}return null;};}function removeEntity(_0x334109,_0x1acb4b){return function(_0x3b3736){if(_0x3b3736){return _0x3b3736[_0xd77e('0x36')]()['then'](function(){_0x334109[_0xd77e('0x37')](0xcc)[_0xd77e('0x2d')]();});}};}function handleEntityNotFound(_0x3682c2,_0x2ed945){return function(_0x3c550e){if(!_0x3c550e){_0x3682c2[_0xd77e('0x2c')](0x194);}return _0x3c550e;};}function handleError(_0x375402,_0x587fd5){_0x587fd5=_0x587fd5||0x1f4;return function(_0x25a180){logger[_0xd77e('0x27')](_0x25a180[_0xd77e('0x38')]);if(_0x25a180['name']){delete _0x25a180[_0xd77e('0x39')];}_0x375402['status'](_0x587fd5)[_0xd77e('0x3a')](_0x25a180);};}exports[_0xd77e('0x3b')]=function(_0xa53c03,_0x142510){var _0xbcf890={},_0x3ce31c={},_0x5a0038={'count':0x0,'rows':[]};var _0x359802=_[_0xd77e('0x3c')](db[_0xd77e('0x3d')][_0xd77e('0x3e')],function(_0x438d87){return{'name':_0x438d87[_0xd77e('0x3f')],'type':_0x438d87[_0xd77e('0x40')]['key']};});_0x3ce31c[_0xd77e('0x41')]=_['map'](_0x359802,_0xd77e('0x39'));_0x3ce31c[_0xd77e('0x42')]=_[_0xd77e('0x43')](_0xa53c03['query']);_0x3ce31c[_0xd77e('0x44')]=_[_0xd77e('0x45')](_0x3ce31c[_0xd77e('0x41')],_0x3ce31c[_0xd77e('0x42')]);_0xbcf890['attributes']=_[_0xd77e('0x45')](_0x3ce31c[_0xd77e('0x41')],qs[_0xd77e('0x46')](_0xa53c03[_0xd77e('0x42')][_0xd77e('0x46')]));_0xbcf890[_0xd77e('0x47')]=_0xbcf890[_0xd77e('0x47')][_0xd77e('0x48')]?_0xbcf890['attributes']:_0x3ce31c['model'];if(!_0xa53c03[_0xd77e('0x42')][_0xd77e('0x49')](_0xd77e('0x4a'))){_0xbcf890[_0xd77e('0x30')]=qs[_0xd77e('0x30')](_0xa53c03[_0xd77e('0x42')][_0xd77e('0x30')]);_0xbcf890['offset']=qs[_0xd77e('0x2f')](_0xa53c03[_0xd77e('0x42')][_0xd77e('0x2f')]);}_0xbcf890['order']=qs[_0xd77e('0x4b')](_0xa53c03[_0xd77e('0x42')]['sort']);_0xbcf890[_0xd77e('0x4c')]=qs[_0xd77e('0x44')](_[_0xd77e('0x4d')](_0xa53c03[_0xd77e('0x42')],_0x3ce31c[_0xd77e('0x44')]));if(_0xa53c03[_0xd77e('0x42')][_0xd77e('0x4e')]){_0xbcf890[_0xd77e('0x4c')]=_[_0xd77e('0x4f')](_0xbcf890[_0xd77e('0x4c')],{'$or':_[_0xd77e('0x3c')](_0x359802,function(_0x1c0400){if(_0x1c0400[_0xd77e('0x40')]!=='VIRTUAL'){var _0x149110={};_0x149110[_0x1c0400[_0xd77e('0x39')]]={'$like':'%'+_0xa53c03[_0xd77e('0x42')]['filter']+'%'};return _0x149110;}})});}_0xbcf890=_[_0xd77e('0x4f')]({},_0xbcf890,_0xa53c03[_0xd77e('0x50')]);var _0xa06f81={'where':_0xbcf890[_0xd77e('0x4c')]};return db['Dynamics365Account']['count'](_0xa06f81)[_0xd77e('0x21')](function(_0x385516){_0x5a0038[_0xd77e('0x51')]=_0x385516;if(_0xa53c03[_0xd77e('0x42')]['includeAll']){_0xbcf890['include']=[{'all':!![]}];}return db[_0xd77e('0x3d')][_0xd77e('0x52')](_0xbcf890);})[_0xd77e('0x21')](function(_0x423445){_0x5a0038[_0xd77e('0x53')]=_0x423445;return _0x5a0038;})[_0xd77e('0x21')](respondWithFilteredResult(_0x142510,_0xbcf890))[_0xd77e('0x2b')](handleError(_0x142510,null));};exports['show']=function(_0x4b7da6,_0x3b527a){var _0x724f96={'raw':![],'where':{'id':_0x4b7da6['params']['id']}},_0x447fb4={};_0x447fb4[_0xd77e('0x41')]=_['keys'](db[_0xd77e('0x3d')][_0xd77e('0x3e')]);_0x447fb4[_0xd77e('0x42')]=_[_0xd77e('0x43')](_0x4b7da6['query']);_0x447fb4[_0xd77e('0x44')]=_['intersection'](_0x447fb4[_0xd77e('0x41')],_0x447fb4[_0xd77e('0x42')]);_0x724f96[_0xd77e('0x47')]=_[_0xd77e('0x45')](_0x447fb4[_0xd77e('0x41')],qs['fields'](_0x4b7da6[_0xd77e('0x42')][_0xd77e('0x46')]));_0x724f96[_0xd77e('0x47')]=_0x724f96[_0xd77e('0x47')][_0xd77e('0x48')]?_0x724f96['attributes']:_0x447fb4[_0xd77e('0x41')];if(_0x4b7da6[_0xd77e('0x42')][_0xd77e('0x54')]){_0x724f96[_0xd77e('0x55')]=[{'all':!![]}];}_0x724f96=_['merge']({},_0x724f96,_0x4b7da6[_0xd77e('0x50')]);return db[_0xd77e('0x3d')][_0xd77e('0x56')](_0x724f96)[_0xd77e('0x21')](handleEntityNotFound(_0x3b527a,null))[_0xd77e('0x21')](respondWithResult(_0x3b527a,null))[_0xd77e('0x2b')](handleError(_0x3b527a,null));};exports[_0xd77e('0x57')]=function(_0x427dda,_0xd1d43f){return db[_0xd77e('0x3d')][_0xd77e('0x57')](_0x427dda['body'],{})[_0xd77e('0x21')](respondWithResult(_0xd1d43f,0xc9))[_0xd77e('0x2b')](handleError(_0xd1d43f,null));};exports['update']=function(_0x251538,_0x55d935){if(_0x251538[_0xd77e('0x58')]['id']){delete _0x251538[_0xd77e('0x58')]['id'];}return db['Dynamics365Account'][_0xd77e('0x56')]({'where':{'id':_0x251538['params']['id']}})[_0xd77e('0x21')](handleEntityNotFound(_0x55d935,null))[_0xd77e('0x21')](saveUpdates(_0x251538[_0xd77e('0x58')],null))['then'](respondWithResult(_0x55d935,null))[_0xd77e('0x2b')](handleError(_0x55d935,null));};exports[_0xd77e('0x36')]=function(_0x2cea60,_0x52890c){return db[_0xd77e('0x3d')][_0xd77e('0x56')]({'where':{'id':_0x2cea60[_0xd77e('0x59')]['id']}})[_0xd77e('0x21')](handleEntityNotFound(_0x52890c,null))['then'](removeEntity(_0x52890c,null))['catch'](handleError(_0x52890c,null));};exports[_0xd77e('0x5a')]=function(_0xd1ed,_0x46695e,_0x48d2b1){var _0x33d793={};var _0x2b33c3={};var _0xb799b7;var _0x473451;return db[_0xd77e('0x3d')][_0xd77e('0x5b')]({'where':{'id':_0xd1ed['params']['id']}})[_0xd77e('0x21')](handleEntityNotFound(_0x46695e,null))[_0xd77e('0x21')](function(_0x424773){if(_0x424773){_0xb799b7=_0x424773;_0x2b33c3[_0xd77e('0x41')]=_[_0xd77e('0x43')](db['Dynamics365Configuration']['rawAttributes']);_0x2b33c3[_0xd77e('0x42')]=_['keys'](_0xd1ed[_0xd77e('0x42')]);_0x2b33c3[_0xd77e('0x44')]=_[_0xd77e('0x45')](_0x2b33c3[_0xd77e('0x41')],_0x2b33c3[_0xd77e('0x42')]);_0x33d793[_0xd77e('0x47')]=_['intersection'](_0x2b33c3['model'],qs['fields'](_0xd1ed[_0xd77e('0x42')][_0xd77e('0x46')]));_0x33d793[_0xd77e('0x47')]=_0x33d793[_0xd77e('0x47')][_0xd77e('0x48')]?_0x33d793[_0xd77e('0x47')]:_0x2b33c3[_0xd77e('0x41')];_0x33d793[_0xd77e('0x5c')]=qs[_0xd77e('0x4b')](_0xd1ed[_0xd77e('0x42')]['sort']);_0x33d793[_0xd77e('0x4c')]=qs[_0xd77e('0x44')](_[_0xd77e('0x4d')](_0xd1ed[_0xd77e('0x42')],_0x2b33c3[_0xd77e('0x44')]));if(_0xd1ed[_0xd77e('0x42')][_0xd77e('0x4e')]){_0x33d793[_0xd77e('0x4c')]=_[_0xd77e('0x4f')](_0x33d793[_0xd77e('0x4c')],{'$or':_[_0xd77e('0x3c')](_0x33d793[_0xd77e('0x47')],function(_0x7d0f0){var _0x5f0eaf={};_0x5f0eaf[_0x7d0f0]={'$like':'%'+_0xd1ed['query'][_0xd77e('0x4e')]+'%'};return _0x5f0eaf;})});}_0x33d793=_['merge']({},_0x33d793,_0xd1ed[_0xd77e('0x50')]);return _0xb799b7['getConfigurations'](_0x33d793);}})[_0xd77e('0x21')](function(_0x2d2113){if(_0x2d2113){_0x473451=_0x2d2113[_0xd77e('0x48')];if(!_0xd1ed[_0xd77e('0x42')][_0xd77e('0x49')](_0xd77e('0x4a'))){_0x33d793[_0xd77e('0x30')]=qs[_0xd77e('0x30')](_0xd1ed[_0xd77e('0x42')][_0xd77e('0x30')]);_0x33d793[_0xd77e('0x2f')]=qs['offset'](_0xd1ed[_0xd77e('0x42')]['offset']);}return _0xb799b7[_0xd77e('0x5a')](_0x33d793);}})[_0xd77e('0x21')](function(_0x140016){if(_0x140016){return _0x140016?{'count':_0x473451,'rows':_0x140016}:null;}})['then'](respondWithResult(_0x46695e,null))[_0xd77e('0x2b')](handleError(_0x46695e,null));};exports['addConfiguration']=function(_0x1195d5,_0x402577,_0x588df7){if(_0x1195d5['body']['id']){delete _0x1195d5[_0xd77e('0x58')]['id'];}return db[_0xd77e('0x3d')]['findOne']({'where':{'id':_0x1195d5['params']['id']}})[_0xd77e('0x21')](handleEntityNotFound(_0x402577,null))[_0xd77e('0x21')](function(_0x2ec1b9){if(_0x2ec1b9){_0x1195d5['body'][_0xd77e('0x5d')]=_0x2ec1b9['id'];_0x1195d5[_0xd77e('0x58')]['Subjects']=integrations[_0xd77e('0x5e')](_0x1195d5[_0xd77e('0x58')][_0xd77e('0x5f')],_0x1195d5[_0xd77e('0x58')]['type']);_0x1195d5[_0xd77e('0x58')]['Descriptions']=integrations['getDescriptions'](_0x1195d5[_0xd77e('0x58')]['channel'],_0x1195d5[_0xd77e('0x58')][_0xd77e('0x40')]);return db[_0xd77e('0x60')][_0xd77e('0x57')](_0x1195d5[_0xd77e('0x58')],{'include':[{'model':db[_0xd77e('0x61')],'as':'Subjects'},{'model':db[_0xd77e('0x61')],'as':_0xd77e('0x62')}]});}return null;})[_0xd77e('0x21')](respondWithResult(_0x402577,null))[_0xd77e('0x2b')](handleError(_0x402577,null));};exports[_0xd77e('0x63')]=function(_0x4b044c,_0x162f31,_0x5a5c25){var _0x4b4913=_0x4b044c['query'][_0xd77e('0x64')];var _0x58e1ef=_0x4b4913===_0xd77e('0x65')?'Incident':_0xd77e('0x66');var _0x187f07='';var _0x4b5022='';var _0x419247='';var _0x399285='';var _0x1ce92a='';var _0x1bf632='';var _0x29c308='';var _0x309155='';var _0x19f2fb=['title','description',_0xd77e('0x67'),_0xd77e('0x68'),_0xd77e('0x69'),_0xd77e('0x6a'),_0xd77e('0x6b'),_0xd77e('0x6c'),_0xd77e('0x6d'),'phonecall_activity_parties'];var _0x4f7ed9=[_0xd77e('0x6e'),_0xd77e('0x6f'),'actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname',_0xd77e('0x70'),_0xd77e('0x71'),_0xd77e('0x72'),'createdbyyominame',_0xd77e('0x73'),_0xd77e('0x74'),'createdonbehalfbyyominame',_0xd77e('0x75'),_0xd77e('0x76'),_0xd77e('0x77'),'emailaddress','entitlementidname',_0xd77e('0x78'),_0xd77e('0x79'),_0xd77e('0x7a'),_0xd77e('0x7b'),_0xd77e('0x7c'),_0xd77e('0x7d'),_0xd77e('0x7e'),_0xd77e('0x7f'),'kbarticleidname',_0xd77e('0x80'),_0xd77e('0x81'),_0xd77e('0x82'),'modifiedbyexternalpartyyominame',_0xd77e('0x83'),'modifiedbyyominame',_0xd77e('0x84'),'modifiedonbehalfbyname',_0xd77e('0x85'),_0xd77e('0x86'),_0xd77e('0x87'),_0xd77e('0x88'),'onholdtime',_0xd77e('0x89'),_0xd77e('0x8a'),'owneridtype',_0xd77e('0x8b'),_0xd77e('0x8c'),_0xd77e('0x8d'),_0xd77e('0x8e'),_0xd77e('0x8f'),'productidname',_0xd77e('0x90'),_0xd77e('0x91'),_0xd77e('0x92'),_0xd77e('0x93'),_0xd77e('0x94'),_0xd77e('0x95'),'sentimentvalue',_0xd77e('0x96'),_0xd77e('0x97'),'socialprofileidname',_0xd77e('0x98'),'statuscode',_0xd77e('0x99'),_0xd77e('0x9a'),_0xd77e('0x9b'),'transactioncurrencyidname',_0xd77e('0x9c'),_0xd77e('0x9d'),_0xd77e('0x9e')];var _0x4dd372=_0x19f2fb[_0xd77e('0x9f')](_0x4f7ed9);return db['Dynamics365Account'][_0xd77e('0x5b')]({'where':{'id':_0x4b044c['params']['id']},'attributes':['id',_0xd77e('0xa0'),_0xd77e('0xa1'),'remoteUri','tenantId',_0xd77e('0xa2'),_0xd77e('0xa3')]})[_0xd77e('0x21')](handleEntityNotFound(_0x162f31,null))[_0xd77e('0x21')](function(_0x1cf1eb){if(_0x1cf1eb){_0x309155=_0x1cf1eb[_0xd77e('0xa4')];var _0x4bfefd=_0x309155[_0xd77e('0xa5')](-0x1);if(_0x4bfefd==='/'){_0x309155=_0x309155[_0xd77e('0xa6')](0x0,_0x309155[_0xd77e('0xa7')](_0x4bfefd));}_0x29c308=util[_0xd77e('0xa8')](_0xd77e('0xa9'),_0x309155);var _0x1dae3e={'method':_0xd77e('0xaa'),'uri':_0xd77e('0xab')+_0x1cf1eb['tenantId']+_0xd77e('0xac'),'form':{'client_id':_0x1cf1eb[_0xd77e('0xa2')],'resource':_0x309155,'username':_0x1cf1eb[_0xd77e('0xa0')],'password':_0x1cf1eb['password'],'grant_type':_0xd77e('0xa1'),'client_secret':_0x1cf1eb[_0xd77e('0xa3')]},'json':!![]};return rp(_0x1dae3e);}})['then'](function(_0x838b79){_0x1bf632=_0x838b79['access_token'];var _0x4b3571={'method':_0xd77e('0xad'),'uri':encodeURI(_0x29c308+_0xd77e('0xae')+_0x58e1ef+'\x27'),'headers':{'Authorization':_0xd77e('0xaf')+_0x1bf632,'If-None-Match':null,'OData-Version':_0xd77e('0xb0')},'json':!![]};return rp(_0x4b3571);})[_0xd77e('0x21')](function(_0x3b85cf){var _0x1df871=_0x3b85cf[_0xd77e('0xb1')][0x0];var _0x26c6ec=_0x1df871[_0xd77e('0xb2')];var _0x5008f1={'method':_0xd77e('0xad'),'uri':_0x29c308+_0xd77e('0xb3')+_0x26c6ec+_0xd77e('0xb4'),'headers':{'Authorization':'Bearer\x20'+_0x1bf632,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5008f1);})[_0xd77e('0x21')](function(_0x167799){_0x187f07=_0x167799;_0x4b5022=_0x187f07[_0xd77e('0xb5')];_0x4b5022=_[_0xd77e('0xb6')](_0x4b5022,function(_0x5f3937){return!_0x4dd372['includes'](_0x5f3937[_0xd77e('0xb7')]);});var _0x18d622=[];var _0x5b9c3e=[];_0x4b5022['forEach'](function(_0x1abd11){if(_0x1abd11[_0xd77e('0xb8')]){var _0x3a4d43=_0x1abd11[_0xd77e('0xb8')]['substring'](_0x1abd11[_0xd77e('0xb8')][_0xd77e('0xa7')]('.')+0x1);if(_0x3a4d43==='PicklistAttributeMetadata'){_0x18d622['push'](getSelectList(_0x29c308,_0x4b4913,_0x5b9c3e,_0x187f07[_0xd77e('0xb2')],_0x1abd11[_0xd77e('0xb2')],_0x1bf632));}}});return Promise['all'](_0x18d622);})[_0xd77e('0x21')](function(_0x1f2e7c){_0x419247=_0x1f2e7c[0x0];var _0x2049ee=[];var _0xcb9932=[];_0x4b5022[_0xd77e('0xb9')](function(_0x1318cb){if(!_[_0xd77e('0xba')](_0x1318cb[_0xd77e('0xb8')])){var _0x358ff8=_0x1318cb[_0xd77e('0xb8')][_0xd77e('0xa6')](_0x1318cb['@odata.type'][_0xd77e('0xa7')]('.')+0x1);if(_0x358ff8===_0xd77e('0xbb')){_0x2049ee[_0xd77e('0xbc')](getBooleanList(_0x29c308,_0x4b4913,_0xcb9932,_0x187f07[_0xd77e('0xb2')],_0x1318cb[_0xd77e('0xb2')],_0x1bf632));}}});return Promise[_0xd77e('0xbd')](_0x2049ee);})[_0xd77e('0x21')](function(_0x58ba55){_0x399285=_0x58ba55[0x0];var _0x458bbd=[];var _0x264a29=[];_0x4b5022[_0xd77e('0xb9')](function(_0x4cafd3){if(_0x4cafd3[_0xd77e('0xb8')]){var _0x5b4e00=_0x4cafd3[_0xd77e('0xb8')][_0xd77e('0xa6')](_0x4cafd3[_0xd77e('0xb8')][_0xd77e('0xa7')]('.')+0x1);if(_0x5b4e00===_0xd77e('0xbe')||_0x5b4e00===_0xd77e('0xbf')||_0x5b4e00===_0xd77e('0xc0')||_0x5b4e00===_0xd77e('0xc1')||_0x5b4e00===_0xd77e('0xc2')||_0x5b4e00===_0xd77e('0xc3')||_0x5b4e00===_0xd77e('0xc4')||_0x5b4e00===_0xd77e('0xc5')||_0x5b4e00===_0xd77e('0xc6')||_0x5b4e00===_0xd77e('0xc7')){_0x458bbd['push'](getInputList(_0x29c308,_0x4b4913,_0x5b4e00,_0x264a29,_0x187f07[_0xd77e('0xb2')],_0x4cafd3[_0xd77e('0xb2')],_0x1bf632));}}});return Promise['all'](_0x458bbd);})[_0xd77e('0x21')](function(_0x5e7028){_0x1ce92a=_0x5e7028[0x0];var _0x3e7286=_0x419247[_0xd77e('0x9f')](_0x399285)[_0xd77e('0x9f')](_0x1ce92a);var _0x171c47={'count':_0x3e7286[_0xd77e('0x48')],'rows':_0x3e7286};return _0x171c47;})['then'](respondWithResult(_0x162f31,null))[_0xd77e('0x2b')](function(_0x12bf84){var _0x47a9ce=_0x4b044c[_0xd77e('0x42')]['test']?0x1f4:_0x12bf84[_0xd77e('0xc8')]||0x1f4;logger['error'](_0x12bf84[_0xd77e('0x38')]);delete _0x12bf84['name'];if(_0x47a9ce===0x191){_0x47a9ce=0x190;}_0x162f31[_0xd77e('0x37')](_0x47a9ce)[_0xd77e('0x3a')](_0x4b044c[_0xd77e('0x42')][_0xd77e('0x1d')]?{'message':'Wrong\x20credentials','statusCode':_0x12bf84[_0xd77e('0xc8')]}:_0x12bf84);});};function getSelectList(_0x18c19b,_0x152845,_0x21388d,_0x45d82b,_0x59f90d,_0x398b29){var _0xc10ffa={'method':_0xd77e('0xad'),'uri':_0x18c19b+_0xd77e('0xb3')+_0x45d82b+_0xd77e('0xc9')+_0x59f90d+_0xd77e('0xca')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xd77e('0xaf')+_0x398b29,'If-None-Match':null,'OData-Version':_0xd77e('0xb0')},'json':!![]};return rp(_0xc10ffa)[_0xd77e('0x21')](function(_0x4fbd53){var _0x478a36=[];var _0x91077b=_0x4fbd53[_0xd77e('0xcb')]['Options'];_0x91077b[_0xd77e('0xb9')](function(_0x50d5a9){_0x478a36[_0xd77e('0xbc')]({'name':_0x50d5a9[_0xd77e('0xcc')][_0xd77e('0xcd')][_0xd77e('0xcc')],'value':String(_0x50d5a9[_0xd77e('0xce')])});});var _0x480271={'id':_0x152845+'_'+_0x4fbd53[_0xd77e('0xb7')],'name':_0x4fbd53['DisplayName'][_0xd77e('0xcd')][_0xd77e('0xcc')],'custom':![],'options':_0x478a36};_0x21388d[_0xd77e('0xbc')](_0x480271);return _0x21388d;});}function getBooleanList(_0x42e8b7,_0x1e8217,_0xf1ce0e,_0x1f8f18,_0x3e7fee,_0x2c4474){var _0x2b2b6f={'method':_0xd77e('0xad'),'uri':_0x42e8b7+_0xd77e('0xb3')+_0x1f8f18+')/Attributes('+_0x3e7fee+_0xd77e('0xcf'),'headers':{'Authorization':_0xd77e('0xaf')+_0x2c4474,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2b2b6f)['then'](function(_0x2630db){var _0x501dac=[];_0x501dac[_0xd77e('0xbc')]({'name':_0x2630db['OptionSet'][_0xd77e('0xd0')][_0xd77e('0xcc')][_0xd77e('0xcd')]['Label'],'value':'true'},{'name':_0x2630db[_0xd77e('0xcb')]['FalseOption'][_0xd77e('0xcc')]['UserLocalizedLabel'][_0xd77e('0xcc')],'value':_0xd77e('0xd1')});var _0x2fafee={'id':_0x1e8217+'_'+_0x2630db[_0xd77e('0xb7')],'name':_0x2630db[_0xd77e('0xd2')][_0xd77e('0xcd')][_0xd77e('0xcc')],'custom':![],'options':_0x501dac};_0xf1ce0e[_0xd77e('0xbc')](_0x2fafee);return _0xf1ce0e;});}function getInputList(_0xe9836b,_0x2d6ff6,_0x4d2940,_0x14eafe,_0x28ada2,_0x543dd8,_0xc0b71){var _0x29e23e={'method':_0xd77e('0xad'),'uri':_0xe9836b+_0xd77e('0xb3')+_0x28ada2+_0xd77e('0xc9')+_0x543dd8+')/Microsoft.Dynamics.CRM.'+_0x4d2940+_0xd77e('0xd3'),'headers':{'Authorization':_0xd77e('0xaf')+_0xc0b71,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x29e23e)['then'](function(_0x356489){var _0x45f6e1={'id':_0x2d6ff6+'_'+_0x356489[_0xd77e('0xb7')],'name':_0x356489[_0xd77e('0xd2')]['UserLocalizedLabel']?_0x356489[_0xd77e('0xd2')][_0xd77e('0xcd')][_0xd77e('0xcc')]:_0x356489[_0xd77e('0xb7')],'custom':![],'options':[]};_0x14eafe[_0xd77e('0xbc')](_0x45f6e1);return _0x14eafe;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 1860a73..28cd1fd 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 _0x416f=['Dynamics365Account','int_dynamics365_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','define'];(function(_0x3c959c,_0x34def0){var _0x2d9119=function(_0x42dee7){while(--_0x42dee7){_0x3c959c['push'](_0x3c959c['shift']());}};_0x2d9119(++_0x34def0);}(_0x416f,0x9c));var _0xf416=function(_0x3bc5d7,_0x9d3fd6){_0x3bc5d7=_0x3bc5d7-0x0;var _0x39d5bf=_0x416f[_0x3bc5d7];return _0x39d5bf;};'use strict';var _=require(_0xf416('0x0'));var util=require(_0xf416('0x1'));var logger=require('../../config/logger')(_0xf416('0x2'));var moment=require(_0xf416('0x3'));var BPromise=require(_0xf416('0x4'));var rp=require(_0xf416('0x5'));var fs=require('fs');var path=require(_0xf416('0x6'));var rimraf=require(_0xf416('0x7'));var config=require(_0xf416('0x8'));var attributes=require(_0xf416('0x9'));var integrations=require(_0xf416('0xa'));module['exports']=function(_0x4903b5,_0x43ddcc){return _0x4903b5[_0xf416('0xb')](_0xf416('0xc'),attributes,{'tableName':_0xf416('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbda6=['rimraf','../../config/environment','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x336aa1,_0x5092b1){var _0x1ec814=function(_0xb3f0a2){while(--_0xb3f0a2){_0x336aa1['push'](_0x336aa1['shift']());}};_0x1ec814(++_0x5092b1);}(_0xbda6,0x11f));var _0x6bda=function(_0x5cc58c,_0x3a9ebd){_0x5cc58c=_0x5cc58c-0x0;var _0x2867a9=_0xbda6[_0x5cc58c];return _0x2867a9;};'use strict';var _=require(_0x6bda('0x0'));var util=require(_0x6bda('0x1'));var logger=require(_0x6bda('0x2'))(_0x6bda('0x3'));var moment=require(_0x6bda('0x4'));var BPromise=require(_0x6bda('0x5'));var rp=require(_0x6bda('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bda('0x7'));var config=require(_0x6bda('0x8'));var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x6bda('0x9'));module[_0x6bda('0xa')]=function(_0x2a55d8,_0x23f2ea){return _0x2a55d8[_0x6bda('0xb')](_0x6bda('0xc'),attributes,{'tableName':_0x6bda('0xd'),'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 f4d82b3..87c81e2 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 _0x2d78=['stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','limit','include','attributes','model','map','ShowDynamics365Account','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x38aa2f,_0x496309){var _0x526200=function(_0x4c5afc){while(--_0x4c5afc){_0x38aa2f['push'](_0x38aa2f['shift']());}};_0x526200(++_0x496309);}(_0x2d78,0x199));var _0x82d7=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0x2d78[_0x412342];return _0x3e62cb;};'use strict';var _=require(_0x82d7('0x0'));var util=require(_0x82d7('0x1'));var moment=require(_0x82d7('0x2'));var BPromise=require('bluebird');var rs=require(_0x82d7('0x3'));var fs=require('fs');var Redis=require(_0x82d7('0x4'));var db=require(_0x82d7('0x5'))['db'];var utils=require(_0x82d7('0x6'));var logger=require(_0x82d7('0x7'))(_0x82d7('0x8'));var config=require(_0x82d7('0x9'));var jayson=require(_0x82d7('0xa'));var client=jayson[_0x82d7('0xb')][_0x82d7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57b0a2,_0x509103,_0x835211){return new BPromise(function(_0x30ab71,_0x28d526){return client[_0x82d7('0xd')](_0x57b0a2,_0x835211)[_0x82d7('0xe')](function(_0x37b81a){logger[_0x82d7('0xf')](_0x82d7('0x10'),_0x509103,_0x82d7('0x11'));logger[_0x82d7('0x12')](_0x82d7('0x13'),_0x509103,_0x82d7('0x11'),JSON[_0x82d7('0x14')](_0x37b81a));if(_0x37b81a[_0x82d7('0x15')]){if(_0x37b81a[_0x82d7('0x15')][_0x82d7('0x16')]===0x1f4){logger['error'](_0x82d7('0x10'),_0x509103,_0x37b81a['error'][_0x82d7('0x17')]);return _0x28d526(_0x37b81a['error'][_0x82d7('0x17')]);}logger[_0x82d7('0x15')](_0x82d7('0x10'),_0x509103,_0x37b81a[_0x82d7('0x15')]['message']);return _0x30ab71(_0x37b81a[_0x82d7('0x15')][_0x82d7('0x17')]);}else{logger[_0x82d7('0xf')](_0x82d7('0x10'),_0x509103,_0x82d7('0x11'));_0x30ab71(_0x37b81a[_0x82d7('0x18')][_0x82d7('0x17')]);}})[_0x82d7('0x19')](function(_0x109cb6){logger[_0x82d7('0x15')]('Dynamics365Account,\x20%s,\x20%s',_0x509103,_0x109cb6);_0x28d526(_0x109cb6);});});}exports[_0x82d7('0x1a')]=function(_0x331374){var _0x49b6c8=this;return new Promise(function(_0x45a6a0,_0x3e30a6){return db[_0x82d7('0x1b')][_0x82d7('0x1c')]({'raw':_0x331374[_0x82d7('0x1d')]?_0x331374[_0x82d7('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x331374[_0x82d7('0x1d')]?_0x331374['options'][_0x82d7('0x1e')]||null:null,'attributes':_0x331374[_0x82d7('0x1d')]?_0x331374[_0x82d7('0x1d')]['attributes']||null:null,'limit':_0x331374[_0x82d7('0x1d')]?_0x331374[_0x82d7('0x1d')][_0x82d7('0x1f')]||null:null,'include':_0x331374[_0x82d7('0x1d')]?_0x331374[_0x82d7('0x1d')][_0x82d7('0x20')]?_['map'](_0x331374[_0x82d7('0x1d')][_0x82d7('0x20')],function(_0x1a654d){return{'model':db[_0x1a654d['model']],'as':_0x1a654d['as'],'attributes':_0x1a654d[_0x82d7('0x21')],'include':_0x1a654d[_0x82d7('0x20')]?_['map'](_0x1a654d[_0x82d7('0x20')],function(_0x83b51){return{'model':db[_0x83b51[_0x82d7('0x22')]],'as':_0x83b51['as'],'attributes':_0x83b51[_0x82d7('0x21')],'include':_0x83b51[_0x82d7('0x20')]?_[_0x82d7('0x23')](_0x83b51[_0x82d7('0x20')],function(_0x5dcaea){return{'model':db[_0x5dcaea['model']],'as':_0x5dcaea['as'],'attributes':_0x5dcaea[_0x82d7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x82d7('0xe')](function(_0x135a80){logger[_0x82d7('0xf')](_0x82d7('0x1a'),_0x331374);logger[_0x82d7('0x12')]('GetDynamics365Account',_0x331374,JSON[_0x82d7('0x14')](_0x135a80));_0x45a6a0(_0x135a80);})[_0x82d7('0x19')](function(_0x28d94c){logger['error'](_0x82d7('0x1a'),_0x28d94c[_0x82d7('0x17')],_0x331374);_0x3e30a6(_0x49b6c8[_0x82d7('0x15')](0x1f4,_0x28d94c[_0x82d7('0x17')]));});});};exports[_0x82d7('0x24')]=function(_0x855a5d){var _0x58f23b=this;return new Promise(function(_0x38f174,_0x4c70a6){return db[_0x82d7('0x1b')][_0x82d7('0x25')]({'raw':_0x855a5d[_0x82d7('0x1d')]?_0x855a5d[_0x82d7('0x1d')][_0x82d7('0x26')]===undefined?!![]:![]:!![],'where':_0x855a5d[_0x82d7('0x1d')]?_0x855a5d[_0x82d7('0x1d')][_0x82d7('0x1e')]||null:null,'attributes':_0x855a5d['options']?_0x855a5d[_0x82d7('0x1d')][_0x82d7('0x21')]||null:null,'include':_0x855a5d['options']?_0x855a5d[_0x82d7('0x1d')]['include']?_[_0x82d7('0x23')](_0x855a5d[_0x82d7('0x1d')][_0x82d7('0x20')],function(_0x92f16){return{'model':db[_0x92f16[_0x82d7('0x22')]],'as':_0x92f16['as'],'attributes':_0x92f16[_0x82d7('0x21')],'include':_0x92f16[_0x82d7('0x20')]?_[_0x82d7('0x23')](_0x92f16[_0x82d7('0x20')],function(_0xfe6a9b){return{'model':db[_0xfe6a9b['model']],'as':_0xfe6a9b['as'],'attributes':_0xfe6a9b['attributes'],'include':_0xfe6a9b['include']?_[_0x82d7('0x23')](_0xfe6a9b['include'],function(_0x38be41){return{'model':db[_0x38be41['model']],'as':_0x38be41['as'],'attributes':_0x38be41[_0x82d7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x82d7('0xe')](function(_0x327549){logger[_0x82d7('0xf')]('ShowDynamics365Account',_0x855a5d);logger[_0x82d7('0x12')](_0x82d7('0x24'),_0x855a5d,JSON[_0x82d7('0x14')](_0x327549));_0x38f174(_0x327549);})[_0x82d7('0x19')](function(_0x5bd260){logger[_0x82d7('0x15')]('ShowDynamics365Account',_0x5bd260[_0x82d7('0x17')],_0x855a5d);_0x4c70a6(_0x58f23b[_0x82d7('0x15')](0x1f4,_0x5bd260['message']));});});}; \ No newline at end of file +var _0x3641=['where','attributes','include','map','model','find','raw','ShowDynamics365Account','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options'];(function(_0x2d2a8e,_0x4a4dca){var _0x1b75b6=function(_0x2b109f){while(--_0x2b109f){_0x2d2a8e['push'](_0x2d2a8e['shift']());}};_0x1b75b6(++_0x4a4dca);}(_0x3641,0x173));var _0x1364=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3641[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x1364('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1364('0x1'));var fs=require('fs');var Redis=require(_0x1364('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1364('0x3'));var logger=require(_0x1364('0x4'))(_0x1364('0x5'));var config=require('../../config/environment');var jayson=require(_0x1364('0x6'));var client=jayson['client'][_0x1364('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x278f40,_0x344ee7,_0x5ef8ba){return new BPromise(function(_0xb5d644,_0x153620){return client[_0x1364('0x8')](_0x278f40,_0x5ef8ba)[_0x1364('0x9')](function(_0x72d53a){logger[_0x1364('0xa')](_0x1364('0xb'),_0x344ee7,_0x1364('0xc'));logger[_0x1364('0xd')](_0x1364('0xe'),_0x344ee7,_0x1364('0xc'),JSON[_0x1364('0xf')](_0x72d53a));if(_0x72d53a['error']){if(_0x72d53a['error'][_0x1364('0x10')]===0x1f4){logger[_0x1364('0x11')](_0x1364('0xb'),_0x344ee7,_0x72d53a[_0x1364('0x11')][_0x1364('0x12')]);return _0x153620(_0x72d53a['error'][_0x1364('0x12')]);}logger[_0x1364('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x344ee7,_0x72d53a[_0x1364('0x11')][_0x1364('0x12')]);return _0xb5d644(_0x72d53a[_0x1364('0x11')][_0x1364('0x12')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x344ee7,_0x1364('0xc'));_0xb5d644(_0x72d53a[_0x1364('0x13')][_0x1364('0x12')]);}})[_0x1364('0x14')](function(_0x265be7){logger[_0x1364('0x11')](_0x1364('0xb'),_0x344ee7,_0x265be7);_0x153620(_0x265be7);});});}exports[_0x1364('0x15')]=function(_0x4e7b68){var _0x5f0f59=this;return new Promise(function(_0x9423d5,_0x5cf4cd){return db[_0x1364('0x16')][_0x1364('0x17')]({'raw':_0x4e7b68[_0x1364('0x18')]?_0x4e7b68[_0x1364('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4e7b68[_0x1364('0x18')]?_0x4e7b68[_0x1364('0x18')][_0x1364('0x19')]||null:null,'attributes':_0x4e7b68['options']?_0x4e7b68[_0x1364('0x18')][_0x1364('0x1a')]||null:null,'limit':_0x4e7b68[_0x1364('0x18')]?_0x4e7b68[_0x1364('0x18')]['limit']||null:null,'include':_0x4e7b68[_0x1364('0x18')]?_0x4e7b68[_0x1364('0x18')][_0x1364('0x1b')]?_[_0x1364('0x1c')](_0x4e7b68[_0x1364('0x18')][_0x1364('0x1b')],function(_0x8bc79d){return{'model':db[_0x8bc79d[_0x1364('0x1d')]],'as':_0x8bc79d['as'],'attributes':_0x8bc79d[_0x1364('0x1a')],'include':_0x8bc79d[_0x1364('0x1b')]?_[_0x1364('0x1c')](_0x8bc79d[_0x1364('0x1b')],function(_0x35f0e3){return{'model':db[_0x35f0e3[_0x1364('0x1d')]],'as':_0x35f0e3['as'],'attributes':_0x35f0e3[_0x1364('0x1a')],'include':_0x35f0e3[_0x1364('0x1b')]?_[_0x1364('0x1c')](_0x35f0e3['include'],function(_0x117777){return{'model':db[_0x117777[_0x1364('0x1d')]],'as':_0x117777['as'],'attributes':_0x117777[_0x1364('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ae44c){logger[_0x1364('0xa')]('GetDynamics365Account',_0x4e7b68);logger[_0x1364('0xd')](_0x1364('0x15'),_0x4e7b68,JSON[_0x1364('0xf')](_0x5ae44c));_0x9423d5(_0x5ae44c);})[_0x1364('0x14')](function(_0x4f4438){logger[_0x1364('0x11')](_0x1364('0x15'),_0x4f4438[_0x1364('0x12')],_0x4e7b68);_0x5cf4cd(_0x5f0f59['error'](0x1f4,_0x4f4438[_0x1364('0x12')]));});});};exports['ShowDynamics365Account']=function(_0xf6fabe){var _0x32a611=this;return new Promise(function(_0x5a49a5,_0x4de9ea){return db[_0x1364('0x16')][_0x1364('0x1e')]({'raw':_0xf6fabe['options']?_0xf6fabe[_0x1364('0x18')][_0x1364('0x1f')]===undefined?!![]:![]:!![],'where':_0xf6fabe[_0x1364('0x18')]?_0xf6fabe[_0x1364('0x18')][_0x1364('0x19')]||null:null,'attributes':_0xf6fabe['options']?_0xf6fabe[_0x1364('0x18')][_0x1364('0x1a')]||null:null,'include':_0xf6fabe['options']?_0xf6fabe[_0x1364('0x18')][_0x1364('0x1b')]?_[_0x1364('0x1c')](_0xf6fabe[_0x1364('0x18')]['include'],function(_0x566954){return{'model':db[_0x566954[_0x1364('0x1d')]],'as':_0x566954['as'],'attributes':_0x566954[_0x1364('0x1a')],'include':_0x566954[_0x1364('0x1b')]?_[_0x1364('0x1c')](_0x566954[_0x1364('0x1b')],function(_0x53b347){return{'model':db[_0x53b347['model']],'as':_0x53b347['as'],'attributes':_0x53b347[_0x1364('0x1a')],'include':_0x53b347['include']?_[_0x1364('0x1c')](_0x53b347[_0x1364('0x1b')],function(_0x52cd96){return{'model':db[_0x52cd96[_0x1364('0x1d')]],'as':_0x52cd96['as'],'attributes':_0x52cd96[_0x1364('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1364('0x9')](function(_0x4e655b){logger[_0x1364('0xa')]('ShowDynamics365Account',_0xf6fabe);logger[_0x1364('0xd')](_0x1364('0x20'),_0xf6fabe,JSON[_0x1364('0xf')](_0x4e655b));_0x5a49a5(_0x4e655b);})['catch'](function(_0x5a96d7){logger[_0x1364('0x11')](_0x1364('0x20'),_0x5a96d7[_0x1364('0x12')],_0xf6fabe);_0x4de9ea(_0x32a611[_0x1364('0x11')](0x1f4,_0x5a96d7['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 2820474..575c815 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 _0x0844=['isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get'];(function(_0x3648f4,_0x481863){var _0x3ec57e=function(_0x4a2546){while(--_0x4a2546){_0x3648f4['push'](_0x3648f4['shift']());}};_0x3ec57e(++_0x481863);}(_0x0844,0x12a));var _0x4084=function(_0x56915c,_0x5791f9){_0x56915c=_0x56915c-0x0;var _0x366175=_0x0844[_0x56915c];return _0x366175;};'use strict';var multer=require('multer');var util=require(_0x4084('0x0'));var path=require(_0x4084('0x1'));var timeout=require(_0x4084('0x2'));var express=require(_0x4084('0x3'));var router=express[_0x4084('0x4')]();var auth=require(_0x4084('0x5'));var interaction=require(_0x4084('0x6'));var config=require(_0x4084('0x7'));var controller=require(_0x4084('0x8'));router[_0x4084('0x9')]('/',auth[_0x4084('0xa')](),controller['index']);router[_0x4084('0x9')]('/:id',auth[_0x4084('0xa')](),controller['show']);router['get'](_0x4084('0xb'),auth[_0x4084('0xa')](),controller[_0x4084('0xc')]);router[_0x4084('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x4084('0xd')]);router['get'](_0x4084('0xe'),auth[_0x4084('0xa')](),controller[_0x4084('0xf')]);router['post']('/',auth[_0x4084('0xa')](),controller[_0x4084('0x10')]);router[_0x4084('0x11')](_0x4084('0x12'),auth[_0x4084('0xa')](),controller[_0x4084('0x13')]);router[_0x4084('0x14')]('/:id',auth[_0x4084('0xa')](),controller[_0x4084('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1342=['getFields','get','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','/:id','show','/:id/fields','isAuthenticated'];(function(_0x110fcd,_0x51ded2){var _0x4f7f33=function(_0x6a9a23){while(--_0x6a9a23){_0x110fcd['push'](_0x110fcd['shift']());}};_0x4f7f33(++_0x51ded2);}(_0x1342,0x173));var _0x2134=function(_0x37452f,_0x17a04c){_0x37452f=_0x37452f-0x0;var _0xd5b34f=_0x1342[_0x37452f];return _0xd5b34f;};'use strict';var multer=require(_0x2134('0x0'));var util=require(_0x2134('0x1'));var path=require(_0x2134('0x2'));var timeout=require('connect-timeout');var express=require(_0x2134('0x3'));var router=express[_0x2134('0x4')]();var auth=require(_0x2134('0x5'));var interaction=require(_0x2134('0x6'));var config=require(_0x2134('0x7'));var controller=require(_0x2134('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2134('0x9'),auth['isAuthenticated'](),controller[_0x2134('0xa')]);router['get'](_0x2134('0xb'),auth[_0x2134('0xc')](),controller[_0x2134('0xd')]);router[_0x2134('0xe')]('/:id/subjects',auth[_0x2134('0xc')](),controller['getSubjects']);router['get'](_0x2134('0xf'),auth['isAuthenticated'](),controller[_0x2134('0x10')]);router[_0x2134('0x11')]('/',auth[_0x2134('0xc')](),controller[_0x2134('0x12')]);router[_0x2134('0x13')](_0x2134('0x9'),auth[_0x2134('0xc')](),controller[_0x2134('0x14')]);router[_0x2134('0x15')](_0x2134('0x9'),auth[_0x2134('0xc')](),controller[_0x2134('0x16')]);module[_0x2134('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index f73972a..0009ce9 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 _0x133a=['STRING','ENUM','incident','phonecall'];(function(_0x3a588a,_0x4b1ba0){var _0xa5f0b=function(_0x22871b){while(--_0x22871b){_0x3a588a['push'](_0x3a588a['shift']());}};_0xa5f0b(++_0x4b1ba0);}(_0x133a,0xd8));var _0xa133=function(_0x49d352,_0x2fa521){_0x49d352=_0x49d352-0x0;var _0x1fdb44=_0x133a[_0x49d352];return _0x1fdb44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa133('0x0')]},'description':{'type':Sequelize[_0xa133('0x0')]},'ticketType':{'type':Sequelize[_0xa133('0x1')](_0xa133('0x2'),_0xa133('0x3')),'defaultValue':_0xa133('0x2')}}; \ No newline at end of file +var _0xffa6=['exports','STRING'];(function(_0x2ea5c6,_0x5ceaf2){var _0x4765bc=function(_0x1bdc3e){while(--_0x1bdc3e){_0x2ea5c6['push'](_0x2ea5c6['shift']());}};_0x4765bc(++_0x5ceaf2);}(_0xffa6,0x18e));var _0x6ffa=function(_0x9dc250,_0x2cfa61){_0x9dc250=_0x9dc250-0x0;var _0x522317=_0xffa6[_0x9dc250];return _0x522317;};'use strict';var Sequelize=require('sequelize');module[_0x6ffa('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6ffa('0x1')]},'ticketType':{'type':Sequelize['ENUM']('incident','phonecall'),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 7fe47d9..0d44c8f 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 _0xf007=['Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','find','create','body','getFields','findOne','Dynamics365Field','order','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','client','test'];(function(_0x5ebf87,_0x4983ae){var _0x374f09=function(_0x45b433){while(--_0x45b433){_0x5ebf87['push'](_0x5ebf87['shift']());}};_0x374f09(++_0x4983ae);}(_0xf007,0xfd));var _0x7f00=function(_0x1acefc,_0x5da0bf){_0x1acefc=_0x1acefc-0x0;var _0x543527=_0xf007[_0x1acefc];return _0x543527;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7f00('0x0'));var rimraf=require(_0x7f00('0x1'));var zipdir=require(_0x7f00('0x2'));var jsonpatch=require(_0x7f00('0x3'));var rp=require('request-promise');var moment=require(_0x7f00('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7f00('0x5'));var csv=require(_0x7f00('0x6'));var ejs=require(_0x7f00('0x7'));var fs=require('fs');var _=require(_0x7f00('0x8'));var squel=require(_0x7f00('0x9'));var crypto=require('crypto');var jsforce=require(_0x7f00('0xa'));var deskjs=require(_0x7f00('0xb'));var toCsv=require(_0x7f00('0x6'));var querystring=require(_0x7f00('0xc'));var Papa=require(_0x7f00('0xd'));var Redis=require(_0x7f00('0xe'));var authService=require(_0x7f00('0xf'));var qs=require(_0x7f00('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f00('0x11'));var logger=require(_0x7f00('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7f00('0x13'));var db=require(_0x7f00('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7f00('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x166d33,_0x20fe94,_0x5778d8){if(_0x5778d8){var _0x30c5ba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30c5ba[_0x7f00('0x16')](_0x20fe94)){return _0x166d33;}else{throw new db[(_0x7f00('0x17'))][(_0x7f00('0x18'))](_0x7f00('0x19'));}}else{return _0x166d33;}}function respondWithRpcPromise(_0x4cb9d1,_0x4bfc84,_0x1509e5,_0x4cc5c3){return new BPromise(function(_0xf69454,_0x58a973){var _0x470d68=_0x4cc5c3||client;return _0x470d68[_0x7f00('0x1a')](_0x4cb9d1,_0x1509e5)[_0x7f00('0x1b')](function(_0xc5a91f){logger['info'](_0x7f00('0x1c'),_0x4bfc84,_0x7f00('0x1d'));logger[_0x7f00('0x1e')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4bfc84,'request\x20sent',JSON['stringify'](_0xc5a91f));if(_0xc5a91f[_0x7f00('0x1f')]){if(_0xc5a91f[_0x7f00('0x1f')][_0x7f00('0x20')]===0x1f4){logger[_0x7f00('0x1f')](_0x7f00('0x1c'),_0x4bfc84,_0xc5a91f[_0x7f00('0x1f')][_0x7f00('0x21')]);return _0x58a973(_0xc5a91f[_0x7f00('0x1f')][_0x7f00('0x21')]);}logger[_0x7f00('0x1f')](_0x7f00('0x1c'),_0x4bfc84,_0xc5a91f[_0x7f00('0x1f')][_0x7f00('0x21')]);return _0xf69454(_0xc5a91f[_0x7f00('0x1f')][_0x7f00('0x21')]);}else{logger['info'](_0x7f00('0x1c'),_0x4bfc84,_0x7f00('0x1d'));_0xf69454(_0xc5a91f[_0x7f00('0x22')][_0x7f00('0x21')]);}})[_0x7f00('0x23')](function(_0x396127){logger[_0x7f00('0x1f')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4bfc84,_0x396127);_0x58a973(_0x396127);});});}function respondWithStatusCode(_0x461a27,_0x41ff6f){_0x41ff6f=_0x41ff6f||0xcc;return function(_0x2c322e){if(_0x2c322e){return _0x461a27[_0x7f00('0x24')](_0x41ff6f);}return _0x461a27[_0x7f00('0x25')](_0x41ff6f)[_0x7f00('0x26')]();};}function respondWithResult(_0x4e0711,_0x3b23db){_0x3b23db=_0x3b23db||0xc8;return function(_0x2683f4){if(_0x2683f4){return _0x4e0711[_0x7f00('0x25')](_0x3b23db)[_0x7f00('0x27')](_0x2683f4);}};}function respondWithFilteredResult(_0x16bee1,_0x28ec8b){return function(_0x5ba292){if(_0x5ba292){var _0x33469=_0x5ba292[_0x7f00('0x28')],_0x101b5a=_0x28ec8b[_0x7f00('0x29')],_0x45089f=_0x28ec8b[_0x7f00('0x29')]+_0x28ec8b[_0x7f00('0x2a')],_0x3b37cc;if(_0x45089f>=_0x33469){_0x45089f=_0x33469;_0x3b37cc=0xc8;}else{_0x3b37cc=0xce;}_0x16bee1[_0x7f00('0x25')](_0x3b37cc);return _0x16bee1[_0x7f00('0x2b')](_0x7f00('0x2c'),_0x101b5a+'-'+_0x45089f+'/'+_0x33469)[_0x7f00('0x27')](_0x5ba292);}return null;};}function patchUpdates(_0x404618){return function(_0x49888c){try{jsonpatch[_0x7f00('0x2d')](_0x49888c,_0x404618,!![]);}catch(_0x2c9242){return BPromise[_0x7f00('0x2e')](_0x2c9242);}return _0x49888c[_0x7f00('0x2f')]();};}function saveUpdates(_0x36edb6,_0x102322){return function(_0x113d8f){if(_0x113d8f){return _0x113d8f[_0x7f00('0x30')](_0x36edb6)[_0x7f00('0x1b')](function(_0x1dd1bb){return _0x1dd1bb;});}return null;};}function removeEntity(_0x50ce17,_0x1b1c50){return function(_0x126d56){if(_0x126d56){return _0x126d56[_0x7f00('0x31')]()[_0x7f00('0x1b')](function(){_0x50ce17[_0x7f00('0x25')](0xcc)[_0x7f00('0x26')]();});}};}function handleEntityNotFound(_0x50a82d,_0x11f3a0){return function(_0x4f3af8){if(!_0x4f3af8){_0x50a82d[_0x7f00('0x24')](0x194);}return _0x4f3af8;};}function handleError(_0x1a6c93,_0x18c1b9){_0x18c1b9=_0x18c1b9||0x1f4;return function(_0x3dff8a){logger[_0x7f00('0x1f')](_0x3dff8a[_0x7f00('0x32')]);if(_0x3dff8a[_0x7f00('0x33')]){delete _0x3dff8a[_0x7f00('0x33')];}_0x1a6c93[_0x7f00('0x25')](_0x18c1b9)[_0x7f00('0x34')](_0x3dff8a);};}exports[_0x7f00('0x35')]=function(_0x4ffbf8,_0x200e59){var _0x312a25={},_0x136bca={},_0x258352={'count':0x0,'rows':[]};var _0x45a5b4=_['map'](db[_0x7f00('0x36')][_0x7f00('0x37')],function(_0x165e05){return{'name':_0x165e05[_0x7f00('0x38')],'type':_0x165e05[_0x7f00('0x39')][_0x7f00('0x3a')]};});_0x136bca['model']=_[_0x7f00('0x3b')](_0x45a5b4,'name');_0x136bca[_0x7f00('0x3c')]=_[_0x7f00('0x3d')](_0x4ffbf8['query']);_0x136bca[_0x7f00('0x3e')]=_[_0x7f00('0x3f')](_0x136bca['model'],_0x136bca['query']);_0x312a25[_0x7f00('0x40')]=_[_0x7f00('0x3f')](_0x136bca[_0x7f00('0x41')],qs[_0x7f00('0x42')](_0x4ffbf8[_0x7f00('0x3c')][_0x7f00('0x42')]));_0x312a25[_0x7f00('0x40')]=_0x312a25[_0x7f00('0x40')]['length']?_0x312a25[_0x7f00('0x40')]:_0x136bca['model'];if(!_0x4ffbf8[_0x7f00('0x3c')][_0x7f00('0x43')]('nolimit')){_0x312a25[_0x7f00('0x2a')]=qs['limit'](_0x4ffbf8[_0x7f00('0x3c')][_0x7f00('0x2a')]);_0x312a25[_0x7f00('0x29')]=qs['offset'](_0x4ffbf8[_0x7f00('0x3c')][_0x7f00('0x29')]);}_0x312a25['order']=qs[_0x7f00('0x44')](_0x4ffbf8[_0x7f00('0x3c')][_0x7f00('0x44')]);_0x312a25[_0x7f00('0x45')]=qs[_0x7f00('0x3e')](_[_0x7f00('0x46')](_0x4ffbf8['query'],_0x136bca[_0x7f00('0x3e')]));if(_0x4ffbf8['query'][_0x7f00('0x47')]){_0x312a25[_0x7f00('0x45')]=_[_0x7f00('0x48')](_0x312a25[_0x7f00('0x45')],{'$or':_[_0x7f00('0x3b')](_0x45a5b4,function(_0x224bc7){if(_0x224bc7[_0x7f00('0x39')]!==_0x7f00('0x49')){var _0x13b7b9={};_0x13b7b9[_0x224bc7[_0x7f00('0x33')]]={'$like':'%'+_0x4ffbf8[_0x7f00('0x3c')][_0x7f00('0x47')]+'%'};return _0x13b7b9;}})});}_0x312a25=_[_0x7f00('0x48')]({},_0x312a25,_0x4ffbf8['options']);var _0x5e84c6={'where':_0x312a25['where']};return db[_0x7f00('0x36')]['count'](_0x5e84c6)[_0x7f00('0x1b')](function(_0x811797){_0x258352[_0x7f00('0x28')]=_0x811797;if(_0x4ffbf8[_0x7f00('0x3c')][_0x7f00('0x4a')]){_0x312a25[_0x7f00('0x4b')]=[{'all':!![]}];}return db[_0x7f00('0x36')][_0x7f00('0x4c')](_0x312a25);})[_0x7f00('0x1b')](function(_0xb178de){_0x258352[_0x7f00('0x4d')]=_0xb178de;return _0x258352;})[_0x7f00('0x1b')](respondWithFilteredResult(_0x200e59,_0x312a25))[_0x7f00('0x23')](handleError(_0x200e59,null));};exports[_0x7f00('0x4e')]=function(_0x3d6308,_0x3eed50){var _0x114ae4={'raw':![],'where':{'id':_0x3d6308[_0x7f00('0x4f')]['id']}},_0x41834f={};_0x41834f[_0x7f00('0x41')]=_[_0x7f00('0x3d')](db[_0x7f00('0x36')]['rawAttributes']);_0x41834f[_0x7f00('0x3c')]=_[_0x7f00('0x3d')](_0x3d6308[_0x7f00('0x3c')]);_0x41834f[_0x7f00('0x3e')]=_['intersection'](_0x41834f[_0x7f00('0x41')],_0x41834f[_0x7f00('0x3c')]);_0x114ae4[_0x7f00('0x40')]=_['intersection'](_0x41834f[_0x7f00('0x41')],qs[_0x7f00('0x42')](_0x3d6308['query'][_0x7f00('0x42')]));_0x114ae4[_0x7f00('0x40')]=_0x114ae4[_0x7f00('0x40')][_0x7f00('0x50')]?_0x114ae4[_0x7f00('0x40')]:_0x41834f[_0x7f00('0x41')];if(_0x3d6308[_0x7f00('0x3c')][_0x7f00('0x4a')]){_0x114ae4[_0x7f00('0x4b')]=[{'all':!![]}];}_0x114ae4=_[_0x7f00('0x48')]({},_0x114ae4,_0x3d6308[_0x7f00('0x51')]);return db['Dynamics365Configuration'][_0x7f00('0x52')](_0x114ae4)[_0x7f00('0x1b')](handleEntityNotFound(_0x3eed50,null))['then'](respondWithResult(_0x3eed50,null))[_0x7f00('0x23')](handleError(_0x3eed50,null));};exports[_0x7f00('0x53')]=function(_0x452eea,_0x442d91){return db[_0x7f00('0x36')]['create'](_0x452eea['body'],{})[_0x7f00('0x1b')](respondWithResult(_0x442d91,0xc9))[_0x7f00('0x23')](handleError(_0x442d91,null));};exports[_0x7f00('0x30')]=function(_0x57e4f3,_0x33b014){if(_0x57e4f3[_0x7f00('0x54')]['id']){delete _0x57e4f3[_0x7f00('0x54')]['id'];}return db[_0x7f00('0x36')][_0x7f00('0x52')]({'where':{'id':_0x57e4f3['params']['id']}})[_0x7f00('0x1b')](handleEntityNotFound(_0x33b014,null))[_0x7f00('0x1b')](saveUpdates(_0x57e4f3[_0x7f00('0x54')],null))[_0x7f00('0x1b')](respondWithResult(_0x33b014,null))[_0x7f00('0x23')](handleError(_0x33b014,null));};exports['destroy']=function(_0x41ee6f,_0x205142){return db[_0x7f00('0x36')][_0x7f00('0x52')]({'where':{'id':_0x41ee6f[_0x7f00('0x4f')]['id']}})['then'](handleEntityNotFound(_0x205142,null))[_0x7f00('0x1b')](removeEntity(_0x205142,null))['catch'](handleError(_0x205142,null));};exports[_0x7f00('0x55')]=function(_0x1957d5,_0x5c34a3,_0x2aa963){var _0x1626a9={};var _0x33c47d={};var _0x495d06;var _0x4ca777;return db[_0x7f00('0x36')][_0x7f00('0x56')]({'where':{'id':_0x1957d5['params']['id']}})[_0x7f00('0x1b')](handleEntityNotFound(_0x5c34a3,null))[_0x7f00('0x1b')](function(_0x129034){if(_0x129034){_0x495d06=_0x129034;_0x33c47d[_0x7f00('0x41')]=_['keys'](db[_0x7f00('0x57')][_0x7f00('0x37')]);_0x33c47d[_0x7f00('0x3c')]=_['keys'](_0x1957d5['query']);_0x33c47d[_0x7f00('0x3e')]=_[_0x7f00('0x3f')](_0x33c47d[_0x7f00('0x41')],_0x33c47d[_0x7f00('0x3c')]);_0x1626a9[_0x7f00('0x40')]=_[_0x7f00('0x3f')](_0x33c47d['model'],qs[_0x7f00('0x42')](_0x1957d5[_0x7f00('0x3c')][_0x7f00('0x42')]));_0x1626a9[_0x7f00('0x40')]=_0x1626a9[_0x7f00('0x40')][_0x7f00('0x50')]?_0x1626a9[_0x7f00('0x40')]:_0x33c47d['model'];_0x1626a9[_0x7f00('0x58')]=qs[_0x7f00('0x44')](_0x1957d5[_0x7f00('0x3c')]['sort']);_0x1626a9['where']=qs[_0x7f00('0x3e')](_['pick'](_0x1957d5[_0x7f00('0x3c')],_0x33c47d[_0x7f00('0x3e')]));if(_0x1957d5[_0x7f00('0x3c')][_0x7f00('0x47')]){_0x1626a9['where']=_[_0x7f00('0x48')](_0x1626a9['where'],{'$or':_[_0x7f00('0x3b')](_0x1626a9[_0x7f00('0x40')],function(_0x57c15d){var _0x10594b={};_0x10594b[_0x57c15d]={'$like':'%'+_0x1957d5['query']['filter']+'%'};return _0x10594b;})});}_0x1626a9=_[_0x7f00('0x48')]({},_0x1626a9,_0x1957d5[_0x7f00('0x51')]);return _0x495d06[_0x7f00('0x55')](_0x1626a9);}})[_0x7f00('0x1b')](function(_0x323c3f){if(_0x323c3f){_0x4ca777=_0x323c3f[_0x7f00('0x50')];if(!_0x1957d5[_0x7f00('0x3c')][_0x7f00('0x43')]('nolimit')){_0x1626a9['limit']=qs[_0x7f00('0x2a')](_0x1957d5[_0x7f00('0x3c')][_0x7f00('0x2a')]);_0x1626a9[_0x7f00('0x29')]=qs[_0x7f00('0x29')](_0x1957d5['query'][_0x7f00('0x29')]);}return _0x495d06[_0x7f00('0x55')](_0x1626a9);}})[_0x7f00('0x1b')](function(_0x4b74bb){if(_0x4b74bb){return _0x4b74bb?{'count':_0x4ca777,'rows':_0x4b74bb}:null;}})[_0x7f00('0x1b')](respondWithResult(_0x5c34a3,null))[_0x7f00('0x23')](handleError(_0x5c34a3,null));};exports[_0x7f00('0x59')]=function(_0x2d185d,_0x2472fe,_0x49d43a){var _0x23eb40={};var _0x4c679f={};var _0x59ba05;var _0x1dbed8;return db[_0x7f00('0x36')]['findOne']({'where':{'id':_0x2d185d[_0x7f00('0x4f')]['id']}})[_0x7f00('0x1b')](handleEntityNotFound(_0x2472fe,null))[_0x7f00('0x1b')](function(_0x224cac){if(_0x224cac){_0x59ba05=_0x224cac;_0x4c679f[_0x7f00('0x41')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x4c679f['query']=_[_0x7f00('0x3d')](_0x2d185d['query']);_0x4c679f[_0x7f00('0x3e')]=_[_0x7f00('0x3f')](_0x4c679f[_0x7f00('0x41')],_0x4c679f[_0x7f00('0x3c')]);_0x23eb40['attributes']=_[_0x7f00('0x3f')](_0x4c679f[_0x7f00('0x41')],qs['fields'](_0x2d185d['query'][_0x7f00('0x42')]));_0x23eb40[_0x7f00('0x40')]=_0x23eb40[_0x7f00('0x40')]['length']?_0x23eb40[_0x7f00('0x40')]:_0x4c679f['model'];_0x23eb40['order']=qs['sort'](_0x2d185d['query'][_0x7f00('0x44')]);_0x23eb40[_0x7f00('0x45')]=qs[_0x7f00('0x3e')](_[_0x7f00('0x46')](_0x2d185d[_0x7f00('0x3c')],_0x4c679f[_0x7f00('0x3e')]));if(_0x2d185d[_0x7f00('0x3c')]['filter']){_0x23eb40['where']=_[_0x7f00('0x48')](_0x23eb40[_0x7f00('0x45')],{'$or':_[_0x7f00('0x3b')](_0x23eb40[_0x7f00('0x40')],function(_0x1c4633){var _0x12529c={};_0x12529c[_0x1c4633]={'$like':'%'+_0x2d185d['query'][_0x7f00('0x47')]+'%'};return _0x12529c;})});}_0x23eb40=_[_0x7f00('0x48')]({},_0x23eb40,_0x2d185d['options']);return _0x59ba05['getSubjects'](_0x23eb40);}})[_0x7f00('0x1b')](function(_0x558c55){if(_0x558c55){_0x1dbed8=_0x558c55[_0x7f00('0x50')];if(!_0x2d185d[_0x7f00('0x3c')][_0x7f00('0x43')](_0x7f00('0x5a'))){_0x23eb40[_0x7f00('0x2a')]=qs[_0x7f00('0x2a')](_0x2d185d[_0x7f00('0x3c')][_0x7f00('0x2a')]);_0x23eb40[_0x7f00('0x29')]=qs['offset'](_0x2d185d[_0x7f00('0x3c')][_0x7f00('0x29')]);}return _0x59ba05[_0x7f00('0x59')](_0x23eb40);}})[_0x7f00('0x1b')](function(_0x458395){if(_0x458395){return _0x458395?{'count':_0x1dbed8,'rows':_0x458395}:null;}})[_0x7f00('0x1b')](respondWithResult(_0x2472fe,null))[_0x7f00('0x23')](handleError(_0x2472fe,null));};exports['getDescriptions']=function(_0x21cc17,_0x4aa550,_0x6e90a9){var _0x4058fd={};var _0x15844b={};var _0x510075;var _0x5de9bd;return db[_0x7f00('0x36')][_0x7f00('0x56')]({'where':{'id':_0x21cc17[_0x7f00('0x4f')]['id']}})[_0x7f00('0x1b')](handleEntityNotFound(_0x4aa550,null))[_0x7f00('0x1b')](function(_0x30cd22){if(_0x30cd22){_0x510075=_0x30cd22;_0x15844b[_0x7f00('0x41')]=_[_0x7f00('0x3d')](db[_0x7f00('0x57')][_0x7f00('0x37')]);_0x15844b[_0x7f00('0x3c')]=_[_0x7f00('0x3d')](_0x21cc17[_0x7f00('0x3c')]);_0x15844b['filters']=_['intersection'](_0x15844b[_0x7f00('0x41')],_0x15844b[_0x7f00('0x3c')]);_0x4058fd[_0x7f00('0x40')]=_[_0x7f00('0x3f')](_0x15844b['model'],qs[_0x7f00('0x42')](_0x21cc17[_0x7f00('0x3c')][_0x7f00('0x42')]));_0x4058fd['attributes']=_0x4058fd['attributes']['length']?_0x4058fd['attributes']:_0x15844b[_0x7f00('0x41')];_0x4058fd[_0x7f00('0x58')]=qs[_0x7f00('0x44')](_0x21cc17[_0x7f00('0x3c')][_0x7f00('0x44')]);_0x4058fd[_0x7f00('0x45')]=qs[_0x7f00('0x3e')](_['pick'](_0x21cc17[_0x7f00('0x3c')],_0x15844b[_0x7f00('0x3e')]));if(_0x21cc17[_0x7f00('0x3c')][_0x7f00('0x47')]){_0x4058fd['where']=_[_0x7f00('0x48')](_0x4058fd['where'],{'$or':_['map'](_0x4058fd[_0x7f00('0x40')],function(_0x2262ef){var _0x5ea3d6={};_0x5ea3d6[_0x2262ef]={'$like':'%'+_0x21cc17[_0x7f00('0x3c')][_0x7f00('0x47')]+'%'};return _0x5ea3d6;})});}_0x4058fd=_['merge']({},_0x4058fd,_0x21cc17[_0x7f00('0x51')]);return _0x510075[_0x7f00('0x5b')](_0x4058fd);}})[_0x7f00('0x1b')](function(_0x1fe5cd){if(_0x1fe5cd){_0x5de9bd=_0x1fe5cd[_0x7f00('0x50')];if(!_0x21cc17[_0x7f00('0x3c')][_0x7f00('0x43')](_0x7f00('0x5a'))){_0x4058fd[_0x7f00('0x2a')]=qs[_0x7f00('0x2a')](_0x21cc17[_0x7f00('0x3c')][_0x7f00('0x2a')]);_0x4058fd[_0x7f00('0x29')]=qs['offset'](_0x21cc17[_0x7f00('0x3c')]['offset']);}return _0x510075[_0x7f00('0x5b')](_0x4058fd);}})[_0x7f00('0x1b')](function(_0x27f651){if(_0x27f651){return _0x27f651?{'count':_0x5de9bd,'rows':_0x27f651}:null;}})[_0x7f00('0x1b')](respondWithResult(_0x4aa550,null))[_0x7f00('0x23')](handleError(_0x4aa550,null));}; \ No newline at end of file +var _0x3e3a=['count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','model','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','options','includeAll','rows','show','params','keys','fields','find','create','body','getFields','findOne','Dynamics365Field','order','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','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','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','status','end','json'];(function(_0x1ec705,_0x4f2f3a){var _0x5041cc=function(_0x4da43c){while(--_0x4da43c){_0x1ec705['push'](_0x1ec705['shift']());}};_0x5041cc(++_0x4f2f3a);}(_0x3e3a,0xea));var _0xa3e3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3e3a[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0xa3e3('0x0'));var emlformat=require(_0xa3e3('0x1'));var rimraf=require(_0xa3e3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa3e3('0x3'));var rp=require(_0xa3e3('0x4'));var moment=require(_0xa3e3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa3e3('0x6'));var util=require(_0xa3e3('0x7'));var path=require(_0xa3e3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa3e3('0x9'));var fs=require('fs');var _=require(_0xa3e3('0xa'));var squel=require(_0xa3e3('0xb'));var crypto=require('crypto');var jsforce=require(_0xa3e3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa3e3('0xd'));var querystring=require(_0xa3e3('0xe'));var Papa=require(_0xa3e3('0xf'));var Redis=require(_0xa3e3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa3e3('0x11'));var as=require(_0xa3e3('0x12'));var hardwareService=require(_0xa3e3('0x13'));var logger=require(_0xa3e3('0x14'))(_0xa3e3('0x15'));var utils=require(_0xa3e3('0x16'));var config=require(_0xa3e3('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa3e3('0x18'));var client=jayson[_0xa3e3('0x19')][_0xa3e3('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x73c52d,_0xf824f6,_0x4dc0b3){if(_0x4dc0b3){var _0x50637b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50637b[_0xa3e3('0x1b')](_0xf824f6)){return _0x73c52d;}else{throw new db[(_0xa3e3('0x1c'))]['ValidationError'](_0xa3e3('0x1d'));}}else{return _0x73c52d;}}function respondWithRpcPromise(_0x47baa9,_0x391bd2,_0x57d64c,_0x3d7ec6){return new BPromise(function(_0x470333,_0x5a5488){var _0x277547=_0x3d7ec6||client;return _0x277547['request'](_0x47baa9,_0x57d64c)[_0xa3e3('0x1e')](function(_0x4f6113){logger[_0xa3e3('0x1f')]('Dynamics365Configuration,\x20%s,\x20%s',_0x391bd2,_0xa3e3('0x20'));logger[_0xa3e3('0x21')](_0xa3e3('0x22'),_0x391bd2,_0xa3e3('0x20'),JSON[_0xa3e3('0x23')](_0x4f6113));if(_0x4f6113['error']){if(_0x4f6113[_0xa3e3('0x24')][_0xa3e3('0x25')]===0x1f4){logger[_0xa3e3('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x391bd2,_0x4f6113['error'][_0xa3e3('0x26')]);return _0x5a5488(_0x4f6113[_0xa3e3('0x24')]['message']);}logger[_0xa3e3('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x391bd2,_0x4f6113[_0xa3e3('0x24')][_0xa3e3('0x26')]);return _0x470333(_0x4f6113['error'][_0xa3e3('0x26')]);}else{logger[_0xa3e3('0x1f')](_0xa3e3('0x27'),_0x391bd2,_0xa3e3('0x20'));_0x470333(_0x4f6113[_0xa3e3('0x28')]['message']);}})[_0xa3e3('0x29')](function(_0x1748be){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x391bd2,_0x1748be);_0x5a5488(_0x1748be);});});}function respondWithStatusCode(_0x3d8c6e,_0x3af232){_0x3af232=_0x3af232||0xcc;return function(_0x1d22fc){if(_0x1d22fc){return _0x3d8c6e['sendStatus'](_0x3af232);}return _0x3d8c6e[_0xa3e3('0x2a')](_0x3af232)[_0xa3e3('0x2b')]();};}function respondWithResult(_0x5d2946,_0x2eab24){_0x2eab24=_0x2eab24||0xc8;return function(_0x26c2ef){if(_0x26c2ef){return _0x5d2946[_0xa3e3('0x2a')](_0x2eab24)[_0xa3e3('0x2c')](_0x26c2ef);}};}function respondWithFilteredResult(_0x434a9b,_0x4217e4){return function(_0x1ef100){if(_0x1ef100){var _0x1b3929=_0x1ef100[_0xa3e3('0x2d')],_0x3d562b=_0x4217e4[_0xa3e3('0x2e')],_0x47ca25=_0x4217e4[_0xa3e3('0x2e')]+_0x4217e4['limit'],_0x56e590;if(_0x47ca25>=_0x1b3929){_0x47ca25=_0x1b3929;_0x56e590=0xc8;}else{_0x56e590=0xce;}_0x434a9b[_0xa3e3('0x2a')](_0x56e590);return _0x434a9b[_0xa3e3('0x2f')](_0xa3e3('0x30'),_0x3d562b+'-'+_0x47ca25+'/'+_0x1b3929)[_0xa3e3('0x2c')](_0x1ef100);}return null;};}function patchUpdates(_0x2d52dc){return function(_0x4bc921){try{jsonpatch[_0xa3e3('0x31')](_0x4bc921,_0x2d52dc,!![]);}catch(_0x503fe7){return BPromise[_0xa3e3('0x32')](_0x503fe7);}return _0x4bc921[_0xa3e3('0x33')]();};}function saveUpdates(_0x2579ec,_0x4fd9f5){return function(_0x3fee34){if(_0x3fee34){return _0x3fee34[_0xa3e3('0x34')](_0x2579ec)[_0xa3e3('0x1e')](function(_0x52499a){return _0x52499a;});}return null;};}function removeEntity(_0x169316,_0x35d24b){return function(_0x186a3a){if(_0x186a3a){return _0x186a3a[_0xa3e3('0x35')]()['then'](function(){_0x169316[_0xa3e3('0x2a')](0xcc)[_0xa3e3('0x2b')]();});}};}function handleEntityNotFound(_0x578beb,_0x5b5d33){return function(_0x5ca261){if(!_0x5ca261){_0x578beb[_0xa3e3('0x36')](0x194);}return _0x5ca261;};}function handleError(_0x3bda30,_0x4a902c){_0x4a902c=_0x4a902c||0x1f4;return function(_0x4970ca){logger[_0xa3e3('0x24')](_0x4970ca['stack']);if(_0x4970ca[_0xa3e3('0x37')]){delete _0x4970ca[_0xa3e3('0x37')];}_0x3bda30[_0xa3e3('0x2a')](_0x4a902c)[_0xa3e3('0x38')](_0x4970ca);};}exports[_0xa3e3('0x39')]=function(_0x31cda8,_0x572ec4){var _0x10729f={},_0x2f619b={},_0x250d7c={'count':0x0,'rows':[]};var _0x13a831=_[_0xa3e3('0x3a')](db[_0xa3e3('0x3b')][_0xa3e3('0x3c')],function(_0x4c219b){return{'name':_0x4c219b[_0xa3e3('0x3d')],'type':_0x4c219b[_0xa3e3('0x3e')]['key']};});_0x2f619b[_0xa3e3('0x3f')]=_[_0xa3e3('0x3a')](_0x13a831,_0xa3e3('0x37'));_0x2f619b[_0xa3e3('0x40')]=_['keys'](_0x31cda8[_0xa3e3('0x40')]);_0x2f619b['filters']=_[_0xa3e3('0x41')](_0x2f619b[_0xa3e3('0x3f')],_0x2f619b[_0xa3e3('0x40')]);_0x10729f[_0xa3e3('0x42')]=_[_0xa3e3('0x41')](_0x2f619b[_0xa3e3('0x3f')],qs['fields'](_0x31cda8[_0xa3e3('0x40')]['fields']));_0x10729f['attributes']=_0x10729f[_0xa3e3('0x42')][_0xa3e3('0x43')]?_0x10729f[_0xa3e3('0x42')]:_0x2f619b[_0xa3e3('0x3f')];if(!_0x31cda8[_0xa3e3('0x40')][_0xa3e3('0x44')](_0xa3e3('0x45'))){_0x10729f[_0xa3e3('0x46')]=qs[_0xa3e3('0x46')](_0x31cda8[_0xa3e3('0x40')]['limit']);_0x10729f[_0xa3e3('0x2e')]=qs[_0xa3e3('0x2e')](_0x31cda8[_0xa3e3('0x40')]['offset']);}_0x10729f['order']=qs['sort'](_0x31cda8['query'][_0xa3e3('0x47')]);_0x10729f[_0xa3e3('0x48')]=qs[_0xa3e3('0x49')](_[_0xa3e3('0x4a')](_0x31cda8[_0xa3e3('0x40')],_0x2f619b['filters']));if(_0x31cda8['query'][_0xa3e3('0x4b')]){_0x10729f['where']=_['merge'](_0x10729f[_0xa3e3('0x48')],{'$or':_[_0xa3e3('0x3a')](_0x13a831,function(_0x5d13c1){if(_0x5d13c1[_0xa3e3('0x3e')]!=='VIRTUAL'){var _0x2c1ba5={};_0x2c1ba5[_0x5d13c1['name']]={'$like':'%'+_0x31cda8[_0xa3e3('0x40')][_0xa3e3('0x4b')]+'%'};return _0x2c1ba5;}})});}_0x10729f=_[_0xa3e3('0x4c')]({},_0x10729f,_0x31cda8[_0xa3e3('0x4d')]);var _0x3fa704={'where':_0x10729f[_0xa3e3('0x48')]};return db[_0xa3e3('0x3b')][_0xa3e3('0x2d')](_0x3fa704)[_0xa3e3('0x1e')](function(_0x5ce799){_0x250d7c[_0xa3e3('0x2d')]=_0x5ce799;if(_0x31cda8[_0xa3e3('0x40')][_0xa3e3('0x4e')]){_0x10729f['include']=[{'all':!![]}];}return db[_0xa3e3('0x3b')]['findAll'](_0x10729f);})[_0xa3e3('0x1e')](function(_0x51aa56){_0x250d7c[_0xa3e3('0x4f')]=_0x51aa56;return _0x250d7c;})[_0xa3e3('0x1e')](respondWithFilteredResult(_0x572ec4,_0x10729f))[_0xa3e3('0x29')](handleError(_0x572ec4,null));};exports[_0xa3e3('0x50')]=function(_0x2adc2e,_0x599d91){var _0x341adb={'raw':![],'where':{'id':_0x2adc2e[_0xa3e3('0x51')]['id']}},_0x4e35ff={};_0x4e35ff[_0xa3e3('0x3f')]=_['keys'](db[_0xa3e3('0x3b')][_0xa3e3('0x3c')]);_0x4e35ff[_0xa3e3('0x40')]=_[_0xa3e3('0x52')](_0x2adc2e['query']);_0x4e35ff[_0xa3e3('0x49')]=_[_0xa3e3('0x41')](_0x4e35ff[_0xa3e3('0x3f')],_0x4e35ff[_0xa3e3('0x40')]);_0x341adb[_0xa3e3('0x42')]=_['intersection'](_0x4e35ff['model'],qs[_0xa3e3('0x53')](_0x2adc2e[_0xa3e3('0x40')][_0xa3e3('0x53')]));_0x341adb['attributes']=_0x341adb['attributes'][_0xa3e3('0x43')]?_0x341adb[_0xa3e3('0x42')]:_0x4e35ff[_0xa3e3('0x3f')];if(_0x2adc2e[_0xa3e3('0x40')][_0xa3e3('0x4e')]){_0x341adb['include']=[{'all':!![]}];}_0x341adb=_[_0xa3e3('0x4c')]({},_0x341adb,_0x2adc2e[_0xa3e3('0x4d')]);return db[_0xa3e3('0x3b')][_0xa3e3('0x54')](_0x341adb)[_0xa3e3('0x1e')](handleEntityNotFound(_0x599d91,null))[_0xa3e3('0x1e')](respondWithResult(_0x599d91,null))['catch'](handleError(_0x599d91,null));};exports[_0xa3e3('0x55')]=function(_0x49e3af,_0x5e2a5f){return db[_0xa3e3('0x3b')][_0xa3e3('0x55')](_0x49e3af['body'],{})[_0xa3e3('0x1e')](respondWithResult(_0x5e2a5f,0xc9))['catch'](handleError(_0x5e2a5f,null));};exports[_0xa3e3('0x34')]=function(_0x32202b,_0x205eef){if(_0x32202b[_0xa3e3('0x56')]['id']){delete _0x32202b[_0xa3e3('0x56')]['id'];}return db[_0xa3e3('0x3b')]['find']({'where':{'id':_0x32202b[_0xa3e3('0x51')]['id']}})['then'](handleEntityNotFound(_0x205eef,null))['then'](saveUpdates(_0x32202b[_0xa3e3('0x56')],null))[_0xa3e3('0x1e')](respondWithResult(_0x205eef,null))[_0xa3e3('0x29')](handleError(_0x205eef,null));};exports[_0xa3e3('0x35')]=function(_0x31bee0,_0x55d397){return db[_0xa3e3('0x3b')][_0xa3e3('0x54')]({'where':{'id':_0x31bee0[_0xa3e3('0x51')]['id']}})[_0xa3e3('0x1e')](handleEntityNotFound(_0x55d397,null))[_0xa3e3('0x1e')](removeEntity(_0x55d397,null))[_0xa3e3('0x29')](handleError(_0x55d397,null));};exports[_0xa3e3('0x57')]=function(_0x59a653,_0x1804c2,_0x51b24c){var _0x4e5297={};var _0x553589={};var _0x38bd81;var _0x1ee7ab;return db['Dynamics365Configuration'][_0xa3e3('0x58')]({'where':{'id':_0x59a653['params']['id']}})[_0xa3e3('0x1e')](handleEntityNotFound(_0x1804c2,null))[_0xa3e3('0x1e')](function(_0x4dd735){if(_0x4dd735){_0x38bd81=_0x4dd735;_0x553589[_0xa3e3('0x3f')]=_[_0xa3e3('0x52')](db[_0xa3e3('0x59')][_0xa3e3('0x3c')]);_0x553589[_0xa3e3('0x40')]=_[_0xa3e3('0x52')](_0x59a653[_0xa3e3('0x40')]);_0x553589[_0xa3e3('0x49')]=_[_0xa3e3('0x41')](_0x553589['model'],_0x553589['query']);_0x4e5297[_0xa3e3('0x42')]=_[_0xa3e3('0x41')](_0x553589['model'],qs['fields'](_0x59a653['query']['fields']));_0x4e5297[_0xa3e3('0x42')]=_0x4e5297[_0xa3e3('0x42')]['length']?_0x4e5297['attributes']:_0x553589[_0xa3e3('0x3f')];_0x4e5297[_0xa3e3('0x5a')]=qs[_0xa3e3('0x47')](_0x59a653['query'][_0xa3e3('0x47')]);_0x4e5297[_0xa3e3('0x48')]=qs[_0xa3e3('0x49')](_[_0xa3e3('0x4a')](_0x59a653[_0xa3e3('0x40')],_0x553589[_0xa3e3('0x49')]));if(_0x59a653[_0xa3e3('0x40')]['filter']){_0x4e5297[_0xa3e3('0x48')]=_[_0xa3e3('0x4c')](_0x4e5297[_0xa3e3('0x48')],{'$or':_['map'](_0x4e5297[_0xa3e3('0x42')],function(_0x9b5d1a){var _0x25cda1={};_0x25cda1[_0x9b5d1a]={'$like':'%'+_0x59a653[_0xa3e3('0x40')]['filter']+'%'};return _0x25cda1;})});}_0x4e5297=_[_0xa3e3('0x4c')]({},_0x4e5297,_0x59a653[_0xa3e3('0x4d')]);return _0x38bd81[_0xa3e3('0x57')](_0x4e5297);}})[_0xa3e3('0x1e')](function(_0x3501d8){if(_0x3501d8){_0x1ee7ab=_0x3501d8['length'];if(!_0x59a653['query'][_0xa3e3('0x44')]('nolimit')){_0x4e5297['limit']=qs['limit'](_0x59a653[_0xa3e3('0x40')][_0xa3e3('0x46')]);_0x4e5297[_0xa3e3('0x2e')]=qs['offset'](_0x59a653[_0xa3e3('0x40')]['offset']);}return _0x38bd81['getFields'](_0x4e5297);}})[_0xa3e3('0x1e')](function(_0x3b8c60){if(_0x3b8c60){return _0x3b8c60?{'count':_0x1ee7ab,'rows':_0x3b8c60}:null;}})['then'](respondWithResult(_0x1804c2,null))[_0xa3e3('0x29')](handleError(_0x1804c2,null));};exports[_0xa3e3('0x5b')]=function(_0x20224c,_0x4b6d60,_0xbbe42a){var _0x59d1d8={};var _0x2d57c7={};var _0x5e93b3;var _0xb1b192;return db[_0xa3e3('0x3b')]['findOne']({'where':{'id':_0x20224c[_0xa3e3('0x51')]['id']}})[_0xa3e3('0x1e')](handleEntityNotFound(_0x4b6d60,null))[_0xa3e3('0x1e')](function(_0x20bd71){if(_0x20bd71){_0x5e93b3=_0x20bd71;_0x2d57c7[_0xa3e3('0x3f')]=_['keys'](db[_0xa3e3('0x59')][_0xa3e3('0x3c')]);_0x2d57c7[_0xa3e3('0x40')]=_['keys'](_0x20224c[_0xa3e3('0x40')]);_0x2d57c7[_0xa3e3('0x49')]=_[_0xa3e3('0x41')](_0x2d57c7[_0xa3e3('0x3f')],_0x2d57c7['query']);_0x59d1d8['attributes']=_[_0xa3e3('0x41')](_0x2d57c7[_0xa3e3('0x3f')],qs['fields'](_0x20224c[_0xa3e3('0x40')][_0xa3e3('0x53')]));_0x59d1d8[_0xa3e3('0x42')]=_0x59d1d8['attributes'][_0xa3e3('0x43')]?_0x59d1d8[_0xa3e3('0x42')]:_0x2d57c7[_0xa3e3('0x3f')];_0x59d1d8[_0xa3e3('0x5a')]=qs[_0xa3e3('0x47')](_0x20224c[_0xa3e3('0x40')]['sort']);_0x59d1d8[_0xa3e3('0x48')]=qs[_0xa3e3('0x49')](_['pick'](_0x20224c[_0xa3e3('0x40')],_0x2d57c7['filters']));if(_0x20224c[_0xa3e3('0x40')][_0xa3e3('0x4b')]){_0x59d1d8[_0xa3e3('0x48')]=_[_0xa3e3('0x4c')](_0x59d1d8[_0xa3e3('0x48')],{'$or':_[_0xa3e3('0x3a')](_0x59d1d8['attributes'],function(_0x95cfb8){var _0x47549f={};_0x47549f[_0x95cfb8]={'$like':'%'+_0x20224c[_0xa3e3('0x40')][_0xa3e3('0x4b')]+'%'};return _0x47549f;})});}_0x59d1d8=_['merge']({},_0x59d1d8,_0x20224c[_0xa3e3('0x4d')]);return _0x5e93b3['getSubjects'](_0x59d1d8);}})['then'](function(_0x34193d){if(_0x34193d){_0xb1b192=_0x34193d[_0xa3e3('0x43')];if(!_0x20224c[_0xa3e3('0x40')][_0xa3e3('0x44')](_0xa3e3('0x45'))){_0x59d1d8[_0xa3e3('0x46')]=qs[_0xa3e3('0x46')](_0x20224c[_0xa3e3('0x40')]['limit']);_0x59d1d8['offset']=qs['offset'](_0x20224c[_0xa3e3('0x40')][_0xa3e3('0x2e')]);}return _0x5e93b3['getSubjects'](_0x59d1d8);}})['then'](function(_0x5a9b65){if(_0x5a9b65){return _0x5a9b65?{'count':_0xb1b192,'rows':_0x5a9b65}:null;}})[_0xa3e3('0x1e')](respondWithResult(_0x4b6d60,null))[_0xa3e3('0x29')](handleError(_0x4b6d60,null));};exports[_0xa3e3('0x5c')]=function(_0x54d093,_0x481f70,_0x2817cc){var _0x4ae675={};var _0x57dcdd={};var _0x42a718;var _0x2a760f;return db[_0xa3e3('0x3b')]['findOne']({'where':{'id':_0x54d093['params']['id']}})[_0xa3e3('0x1e')](handleEntityNotFound(_0x481f70,null))[_0xa3e3('0x1e')](function(_0x53c840){if(_0x53c840){_0x42a718=_0x53c840;_0x57dcdd[_0xa3e3('0x3f')]=_[_0xa3e3('0x52')](db['Dynamics365Field'][_0xa3e3('0x3c')]);_0x57dcdd[_0xa3e3('0x40')]=_[_0xa3e3('0x52')](_0x54d093[_0xa3e3('0x40')]);_0x57dcdd['filters']=_[_0xa3e3('0x41')](_0x57dcdd[_0xa3e3('0x3f')],_0x57dcdd[_0xa3e3('0x40')]);_0x4ae675[_0xa3e3('0x42')]=_[_0xa3e3('0x41')](_0x57dcdd[_0xa3e3('0x3f')],qs[_0xa3e3('0x53')](_0x54d093[_0xa3e3('0x40')]['fields']));_0x4ae675['attributes']=_0x4ae675['attributes']['length']?_0x4ae675[_0xa3e3('0x42')]:_0x57dcdd[_0xa3e3('0x3f')];_0x4ae675[_0xa3e3('0x5a')]=qs[_0xa3e3('0x47')](_0x54d093['query']['sort']);_0x4ae675['where']=qs[_0xa3e3('0x49')](_['pick'](_0x54d093[_0xa3e3('0x40')],_0x57dcdd['filters']));if(_0x54d093[_0xa3e3('0x40')][_0xa3e3('0x4b')]){_0x4ae675[_0xa3e3('0x48')]=_['merge'](_0x4ae675[_0xa3e3('0x48')],{'$or':_[_0xa3e3('0x3a')](_0x4ae675['attributes'],function(_0x424f0){var _0x88bc4d={};_0x88bc4d[_0x424f0]={'$like':'%'+_0x54d093[_0xa3e3('0x40')][_0xa3e3('0x4b')]+'%'};return _0x88bc4d;})});}_0x4ae675=_['merge']({},_0x4ae675,_0x54d093['options']);return _0x42a718[_0xa3e3('0x5c')](_0x4ae675);}})[_0xa3e3('0x1e')](function(_0x49f860){if(_0x49f860){_0x2a760f=_0x49f860[_0xa3e3('0x43')];if(!_0x54d093[_0xa3e3('0x40')][_0xa3e3('0x44')]('nolimit')){_0x4ae675['limit']=qs['limit'](_0x54d093[_0xa3e3('0x40')][_0xa3e3('0x46')]);_0x4ae675[_0xa3e3('0x2e')]=qs[_0xa3e3('0x2e')](_0x54d093[_0xa3e3('0x40')][_0xa3e3('0x2e')]);}return _0x42a718[_0xa3e3('0x5c')](_0x4ae675);}})[_0xa3e3('0x1e')](function(_0x19a3e8){if(_0x19a3e8){return _0x19a3e8?{'count':_0x2a760f,'rows':_0x19a3e8}:null;}})[_0xa3e3('0x1e')](respondWithResult(_0x481f70,null))['catch'](handleError(_0x481f70,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 879b611..f3b4a53 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 _0x8df7=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Dynamics365Configuration','lodash'];(function(_0x1f44e4,_0x22d9fd){var _0x591989=function(_0x3aeb88){while(--_0x3aeb88){_0x1f44e4['push'](_0x1f44e4['shift']());}};_0x591989(++_0x22d9fd);}(_0x8df7,0x197));var _0x78df=function(_0x55ad20,_0x9fac19){_0x55ad20=_0x55ad20-0x0;var _0x2d889f=_0x8df7[_0x55ad20];return _0x2d889f;};'use strict';var _=require(_0x78df('0x0'));var util=require(_0x78df('0x1'));var logger=require(_0x78df('0x2'))(_0x78df('0x3'));var moment=require(_0x78df('0x4'));var BPromise=require(_0x78df('0x5'));var rp=require(_0x78df('0x6'));var fs=require('fs');var path=require(_0x78df('0x7'));var rimraf=require('rimraf');var config=require(_0x78df('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0x78df('0x9')]=function(_0x7d9993,_0x126e09){return _0x7d9993[_0x78df('0xa')](_0x78df('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7378=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','util'];(function(_0x231ced,_0x16a4fd){var _0x2d66ea=function(_0x20e956){while(--_0x20e956){_0x231ced['push'](_0x231ced['shift']());}};_0x2d66ea(++_0x16a4fd);}(_0x7378,0xbd));var _0x8737=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7378[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x8737('0x0'));var logger=require(_0x8737('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8737('0x2'));var rp=require(_0x8737('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8737('0x4'));var config=require(_0x8737('0x5'));var attributes=require(_0x8737('0x6'));module[_0x8737('0x7')]=function(_0x444785,_0x5c8ed1){return _0x444785[_0x8737('0x8')](_0x8737('0x9'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 66c5ec1..20934f5 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 _0xb0ee=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb0ee,0x1e2));var _0xeb0e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xb0ee[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xeb0e('0x0'));var util=require(_0xeb0e('0x1'));var moment=require(_0xeb0e('0x2'));var BPromise=require(_0xeb0e('0x3'));var rs=require(_0xeb0e('0x4'));var fs=require('fs');var Redis=require(_0xeb0e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeb0e('0x6'))(_0xeb0e('0x7'));var config=require(_0xeb0e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeb0e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b959e,_0x505b14,_0x5b9ad9){return new BPromise(function(_0x39330f,_0x1b7705){return client[_0xeb0e('0xa')](_0x3b959e,_0x5b9ad9)[_0xeb0e('0xb')](function(_0x139f6f){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x505b14,'request\x20sent');logger[_0xeb0e('0xc')](_0xeb0e('0xd'),_0x505b14,'request\x20sent',JSON[_0xeb0e('0xe')](_0x139f6f));if(_0x139f6f[_0xeb0e('0xf')]){if(_0x139f6f[_0xeb0e('0xf')]['code']===0x1f4){logger[_0xeb0e('0xf')](_0xeb0e('0x10'),_0x505b14,_0x139f6f[_0xeb0e('0xf')][_0xeb0e('0x11')]);return _0x1b7705(_0x139f6f[_0xeb0e('0xf')]['message']);}logger['error'](_0xeb0e('0x10'),_0x505b14,_0x139f6f[_0xeb0e('0xf')][_0xeb0e('0x11')]);return _0x39330f(_0x139f6f[_0xeb0e('0xf')][_0xeb0e('0x11')]);}else{logger[_0xeb0e('0x12')](_0xeb0e('0x10'),_0x505b14,_0xeb0e('0x13'));_0x39330f(_0x139f6f[_0xeb0e('0x14')][_0xeb0e('0x11')]);}})[_0xeb0e('0x15')](function(_0x5dd167){logger[_0xeb0e('0xf')](_0xeb0e('0x10'),_0x505b14,_0x5dd167);_0x1b7705(_0x5dd167);});});} \ No newline at end of file +var _0xbb97=['request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x4afbda,_0x2bc47b){var _0x3cc8fd=function(_0x1f2106){while(--_0x1f2106){_0x4afbda['push'](_0x4afbda['shift']());}};_0x3cc8fd(++_0x2bc47b);}(_0xbb97,0x91));var _0x7bb9=function(_0x23cf32,_0xdf2929){_0x23cf32=_0x23cf32-0x0;var _0x304cc8=_0xbb97[_0x23cf32];return _0x304cc8;};'use strict';var _=require('lodash');var util=require(_0x7bb9('0x0'));var moment=require(_0x7bb9('0x1'));var BPromise=require(_0x7bb9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bb9('0x3'));var db=require(_0x7bb9('0x4'))['db'];var utils=require(_0x7bb9('0x5'));var logger=require(_0x7bb9('0x6'))(_0x7bb9('0x7'));var config=require('../../config/environment');var jayson=require(_0x7bb9('0x8'));var client=jayson[_0x7bb9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd0182c,_0xa58b52,_0x2dfb85){return new BPromise(function(_0x268642,_0x5f4b6a){return client[_0x7bb9('0xa')](_0xd0182c,_0x2dfb85)[_0x7bb9('0xb')](function(_0xf7da80){logger[_0x7bb9('0xc')](_0x7bb9('0xd'),_0xa58b52,'request\x20sent');logger[_0x7bb9('0xe')](_0x7bb9('0xf'),_0xa58b52,_0x7bb9('0x10'),JSON[_0x7bb9('0x11')](_0xf7da80));if(_0xf7da80['error']){if(_0xf7da80[_0x7bb9('0x12')][_0x7bb9('0x13')]===0x1f4){logger[_0x7bb9('0x12')](_0x7bb9('0xd'),_0xa58b52,_0xf7da80[_0x7bb9('0x12')][_0x7bb9('0x14')]);return _0x5f4b6a(_0xf7da80[_0x7bb9('0x12')]['message']);}logger[_0x7bb9('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0xa58b52,_0xf7da80[_0x7bb9('0x12')][_0x7bb9('0x14')]);return _0x268642(_0xf7da80[_0x7bb9('0x12')][_0x7bb9('0x14')]);}else{logger['info'](_0x7bb9('0xd'),_0xa58b52,_0x7bb9('0x10'));_0x268642(_0xf7da80[_0x7bb9('0x15')]['message']);}})[_0x7bb9('0x16')](function(_0x2e7662){logger[_0x7bb9('0x12')](_0x7bb9('0xd'),_0xa58b52,_0x2e7662);_0x5f4b6a(_0x2e7662);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 8f32528..c0fe4bf 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 _0xedd9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','delete','/:id','destroy','exports'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xedd9,0xfc));var _0x9edd=function(_0x39807f,_0x69fd0b){_0x39807f=_0x39807f-0x0;var _0x4bce9e=_0xedd9[_0x39807f];return _0x4bce9e;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./intDynamics365Field.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0xb')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router[_0x9edd('0xd')]('/:id',auth[_0x9edd('0x9')](),controller['update']);router[_0x9edd('0xe')](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);module[_0x9edd('0x11')]=router; \ No newline at end of file +var _0x3eec=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0xf62ec2,_0x400551){var _0x5b414e=function(_0x590f95){while(--_0x590f95){_0xf62ec2['push'](_0xf62ec2['shift']());}};_0x5b414e(++_0x400551);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x1e8648,_0x3e4bfa){_0x1e8648=_0x1e8648-0x0;var _0x229e3b=_0x3eec[_0x1e8648];return _0x229e3b;};'use strict';var multer=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var path=require(_0xc3ee('0x2'));var timeout=require(_0xc3ee('0x3'));var express=require('express');var router=express[_0xc3ee('0x4')]();var auth=require(_0xc3ee('0x5'));var interaction=require(_0xc3ee('0x6'));var config=require(_0xc3ee('0x7'));var controller=require(_0xc3ee('0x8'));router[_0xc3ee('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3ee('0xa')]);router[_0xc3ee('0x9')](_0xc3ee('0xb'),auth[_0xc3ee('0xc')](),controller[_0xc3ee('0xd')]);router[_0xc3ee('0xe')]('/',auth[_0xc3ee('0xc')](),controller[_0xc3ee('0xf')]);router[_0xc3ee('0x10')](_0xc3ee('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc3ee('0x11')](_0xc3ee('0xb'),auth[_0xc3ee('0xc')](),controller[_0xc3ee('0x12')]);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 1f807f8..2efc655 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 _0x4beb=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x4beb,0x17b));var _0xb4be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4beb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb4be('0x0'));module['exports']={'type':{'type':Sequelize[_0xb4be('0x1')](_0xb4be('0x2'),_0xb4be('0x3'),_0xb4be('0x4'),_0xb4be('0x5')),'defaultValue':_0xb4be('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb4be('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xb4be('0x2'),_0xb4be('0x3'),_0xb4be('0x4'))},'keyContent':{'type':Sequelize[_0xb4be('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb4be('0x6')]},'customField':{'type':Sequelize[_0xb4be('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd9b4=['sequelize','exports','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN'];(function(_0x4f1918,_0x3b1e66){var _0x49e958=function(_0x33a9c0){while(--_0x33a9c0){_0x4f1918['push'](_0x4f1918['shift']());}};_0x49e958(++_0x3b1e66);}(_0xd9b4,0x1f0));var _0x4d9b=function(_0x47d0c3,_0x9bac25){_0x47d0c3=_0x47d0c3-0x0;var _0x28c00b=_0xd9b4[_0x47d0c3];return _0x28c00b;};'use strict';var Sequelize=require(_0x4d9b('0x0'));module[_0x4d9b('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x4d9b('0x2'),_0x4d9b('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4d9b('0x4')]},'key':{'type':Sequelize[_0x4d9b('0x4')]},'keyType':{'type':Sequelize[_0x4d9b('0x5')]('string',_0x4d9b('0x6'),_0x4d9b('0x2'))},'keyContent':{'type':Sequelize[_0x4d9b('0x4')]},'idField':{'type':Sequelize[_0x4d9b('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4d9b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4d9b('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 010567e..66324cc 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 _0x714c=['set','Content-Range','apply','reject','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','Dynamics365Field','includeAll','include','findAll','rows','show','params','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit'];(function(_0x1da9e9,_0x5913e1){var _0x54d91a=function(_0x5d188d){while(--_0x5d188d){_0x1da9e9['push'](_0x1da9e9['shift']());}};_0x54d91a(++_0x5913e1);}(_0x714c,0x18d));var _0xc714=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x714c[_0x59eefb];return _0x1a49e8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc714('0x0'));var rimraf=require(_0xc714('0x1'));var zipdir=require(_0xc714('0x2'));var jsonpatch=require(_0xc714('0x3'));var rp=require(_0xc714('0x4'));var moment=require('moment');var BPromise=require(_0xc714('0x5'));var Mustache=require(_0xc714('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc714('0x7'));var csv=require(_0xc714('0x8'));var ejs=require(_0xc714('0x9'));var fs=require('fs');var _=require(_0xc714('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc714('0xb'));var deskjs=require(_0xc714('0xc'));var toCsv=require(_0xc714('0x8'));var querystring=require(_0xc714('0xd'));var Papa=require(_0xc714('0xe'));var Redis=require('ioredis');var authService=require(_0xc714('0xf'));var qs=require(_0xc714('0x10'));var as=require(_0xc714('0x11'));var hardwareService=require(_0xc714('0x12'));var logger=require(_0xc714('0x13'))('api');var utils=require(_0xc714('0x14'));var config=require(_0xc714('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dd735,_0x3ed655){_0x3ed655=_0x3ed655||0xcc;return function(_0x564198){if(_0x564198){return _0x4dd735[_0xc714('0x16')](_0x3ed655);}return _0x4dd735[_0xc714('0x17')](_0x3ed655)[_0xc714('0x18')]();};}function respondWithResult(_0x3be76d,_0x5030c1){_0x5030c1=_0x5030c1||0xc8;return function(_0x3e3d03){if(_0x3e3d03){return _0x3be76d[_0xc714('0x17')](_0x5030c1)[_0xc714('0x19')](_0x3e3d03);}};}function respondWithFilteredResult(_0x25a61c,_0x377af1){return function(_0xf5b54){if(_0xf5b54){var _0x34a83e=_0xf5b54[_0xc714('0x1a')],_0x54144c=_0x377af1[_0xc714('0x1b')],_0x4fd793=_0x377af1[_0xc714('0x1b')]+_0x377af1[_0xc714('0x1c')],_0x4b2f57;if(_0x4fd793>=_0x34a83e){_0x4fd793=_0x34a83e;_0x4b2f57=0xc8;}else{_0x4b2f57=0xce;}_0x25a61c[_0xc714('0x17')](_0x4b2f57);return _0x25a61c[_0xc714('0x1d')](_0xc714('0x1e'),_0x54144c+'-'+_0x4fd793+'/'+_0x34a83e)[_0xc714('0x19')](_0xf5b54);}return null;};}function patchUpdates(_0x50a84a){return function(_0x24ca97){try{jsonpatch[_0xc714('0x1f')](_0x24ca97,_0x50a84a,!![]);}catch(_0x303b58){return BPromise[_0xc714('0x20')](_0x303b58);}return _0x24ca97['save']();};}function saveUpdates(_0x751c4d,_0xc9787a){return function(_0x27ee89){if(_0x27ee89){return _0x27ee89[_0xc714('0x21')](_0x751c4d)[_0xc714('0x22')](function(_0x50e00d){return _0x50e00d;});}return null;};}function removeEntity(_0x32ea3d,_0x5d4a4d){return function(_0x35133e){if(_0x35133e){return _0x35133e[_0xc714('0x23')]()[_0xc714('0x22')](function(){_0x32ea3d[_0xc714('0x17')](0xcc)[_0xc714('0x18')]();});}};}function handleEntityNotFound(_0x587ea8,_0x558907){return function(_0x2bc48c){if(!_0x2bc48c){_0x587ea8['sendStatus'](0x194);}return _0x2bc48c;};}function handleError(_0xbc41ee,_0x4637e7){_0x4637e7=_0x4637e7||0x1f4;return function(_0x5d90d7){logger['error'](_0x5d90d7[_0xc714('0x24')]);if(_0x5d90d7[_0xc714('0x25')]){delete _0x5d90d7[_0xc714('0x25')];}_0xbc41ee[_0xc714('0x17')](_0x4637e7)[_0xc714('0x26')](_0x5d90d7);};}exports['index']=function(_0x354cef,_0x431a00){var _0x56d3c8={},_0x2dad21={},_0x1bcd98={'count':0x0,'rows':[]};var _0x43f8d9=_['map'](db['Dynamics365Field'][_0xc714('0x27')],function(_0x48d8fa){return{'name':_0x48d8fa[_0xc714('0x28')],'type':_0x48d8fa[_0xc714('0x29')]['key']};});_0x2dad21[_0xc714('0x2a')]=_[_0xc714('0x2b')](_0x43f8d9,'name');_0x2dad21[_0xc714('0x2c')]=_[_0xc714('0x2d')](_0x354cef['query']);_0x2dad21[_0xc714('0x2e')]=_[_0xc714('0x2f')](_0x2dad21[_0xc714('0x2a')],_0x2dad21[_0xc714('0x2c')]);_0x56d3c8[_0xc714('0x30')]=_[_0xc714('0x2f')](_0x2dad21[_0xc714('0x2a')],qs['fields'](_0x354cef[_0xc714('0x2c')][_0xc714('0x31')]));_0x56d3c8[_0xc714('0x30')]=_0x56d3c8[_0xc714('0x30')][_0xc714('0x32')]?_0x56d3c8[_0xc714('0x30')]:_0x2dad21[_0xc714('0x2a')];if(!_0x354cef[_0xc714('0x2c')][_0xc714('0x33')](_0xc714('0x34'))){_0x56d3c8[_0xc714('0x1c')]=qs[_0xc714('0x1c')](_0x354cef[_0xc714('0x2c')][_0xc714('0x1c')]);_0x56d3c8['offset']=qs[_0xc714('0x1b')](_0x354cef[_0xc714('0x2c')][_0xc714('0x1b')]);}_0x56d3c8[_0xc714('0x35')]=qs[_0xc714('0x36')](_0x354cef[_0xc714('0x2c')][_0xc714('0x36')]);_0x56d3c8[_0xc714('0x37')]=qs[_0xc714('0x2e')](_['pick'](_0x354cef[_0xc714('0x2c')],_0x2dad21['filters']));if(_0x354cef[_0xc714('0x2c')][_0xc714('0x38')]){_0x56d3c8['where']=_['merge'](_0x56d3c8[_0xc714('0x37')],{'$or':_[_0xc714('0x2b')](_0x43f8d9,function(_0x291cb3){if(_0x291cb3[_0xc714('0x29')]!==_0xc714('0x39')){var _0x54c071={};_0x54c071[_0x291cb3[_0xc714('0x25')]]={'$like':'%'+_0x354cef[_0xc714('0x2c')][_0xc714('0x38')]+'%'};return _0x54c071;}})});}_0x56d3c8=_['merge']({},_0x56d3c8,_0x354cef['options']);var _0x48481f={'where':_0x56d3c8['where']};return db[_0xc714('0x3a')][_0xc714('0x1a')](_0x48481f)[_0xc714('0x22')](function(_0xa6324c){_0x1bcd98[_0xc714('0x1a')]=_0xa6324c;if(_0x354cef[_0xc714('0x2c')][_0xc714('0x3b')]){_0x56d3c8[_0xc714('0x3c')]=[{'all':!![]}];}return db[_0xc714('0x3a')][_0xc714('0x3d')](_0x56d3c8);})['then'](function(_0x3dc06c){_0x1bcd98[_0xc714('0x3e')]=_0x3dc06c;return _0x1bcd98;})[_0xc714('0x22')](respondWithFilteredResult(_0x431a00,_0x56d3c8))['catch'](handleError(_0x431a00,null));};exports[_0xc714('0x3f')]=function(_0x307ced,_0x5d7562){var _0x4a8606={'raw':!![],'where':{'id':_0x307ced[_0xc714('0x40')]['id']}},_0x14797e={};_0x14797e[_0xc714('0x2a')]=_[_0xc714('0x2d')](db[_0xc714('0x3a')][_0xc714('0x27')]);_0x14797e['query']=_['keys'](_0x307ced['query']);_0x14797e[_0xc714('0x2e')]=_[_0xc714('0x2f')](_0x14797e[_0xc714('0x2a')],_0x14797e['query']);_0x4a8606[_0xc714('0x30')]=_[_0xc714('0x2f')](_0x14797e[_0xc714('0x2a')],qs[_0xc714('0x31')](_0x307ced['query'][_0xc714('0x31')]));_0x4a8606['attributes']=_0x4a8606[_0xc714('0x30')][_0xc714('0x32')]?_0x4a8606['attributes']:_0x14797e[_0xc714('0x2a')];if(_0x307ced[_0xc714('0x2c')]['includeAll']){_0x4a8606['include']=[{'all':!![]}];}_0x4a8606=_[_0xc714('0x41')]({},_0x4a8606,_0x307ced[_0xc714('0x42')]);return db['Dynamics365Field'][_0xc714('0x43')](_0x4a8606)['then'](handleEntityNotFound(_0x5d7562,null))[_0xc714('0x22')](respondWithResult(_0x5d7562,null))[_0xc714('0x44')](handleError(_0x5d7562,null));};exports[_0xc714('0x45')]=function(_0x2486f5,_0x51128c){return db[_0xc714('0x3a')][_0xc714('0x45')](_0x2486f5[_0xc714('0x46')],{})[_0xc714('0x22')](respondWithResult(_0x51128c,0xc9))[_0xc714('0x44')](handleError(_0x51128c,null));};exports[_0xc714('0x21')]=function(_0x2b574b,_0x323460){if(_0x2b574b[_0xc714('0x46')]['id']){delete _0x2b574b['body']['id'];}return db[_0xc714('0x3a')][_0xc714('0x43')]({'where':{'id':_0x2b574b[_0xc714('0x40')]['id']}})[_0xc714('0x22')](handleEntityNotFound(_0x323460,null))[_0xc714('0x22')](saveUpdates(_0x2b574b[_0xc714('0x46')],null))[_0xc714('0x22')](respondWithResult(_0x323460,null))[_0xc714('0x44')](handleError(_0x323460,null));};exports[_0xc714('0x23')]=function(_0x4f8478,_0x41f6fd){return db[_0xc714('0x3a')][_0xc714('0x43')]({'where':{'id':_0x4f8478[_0xc714('0x40')]['id']}})[_0xc714('0x22')](handleEntityNotFound(_0x41f6fd,null))['then'](removeEntity(_0x41f6fd,null))[_0xc714('0x44')](handleError(_0x41f6fd,null));}; \ No newline at end of file +var _0x55c3=['body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','status','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','type','VIRTUAL','filter','options','where','include','rows','catch','show','intersection','find','create'];(function(_0xf4e19d,_0x1e2d95){var _0x2d5adf=function(_0x13130e){while(--_0x13130e){_0xf4e19d['push'](_0xf4e19d['shift']());}};_0x2d5adf(++_0x1e2d95);}(_0x55c3,0x189));var _0x355c=function(_0x17f49e,_0x5f4e2e){_0x17f49e=_0x17f49e-0x0;var _0x4b96bf=_0x55c3[_0x17f49e];return _0x4b96bf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x355c('0x0'));var rimraf=require(_0x355c('0x1'));var zipdir=require(_0x355c('0x2'));var jsonpatch=require(_0x355c('0x3'));var rp=require(_0x355c('0x4'));var moment=require(_0x355c('0x5'));var BPromise=require(_0x355c('0x6'));var Mustache=require(_0x355c('0x7'));var util=require(_0x355c('0x8'));var path=require(_0x355c('0x9'));var sox=require(_0x355c('0xa'));var csv=require(_0x355c('0xb'));var ejs=require(_0x355c('0xc'));var fs=require('fs');var _=require(_0x355c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x355c('0xe'));var deskjs=require(_0x355c('0xf'));var toCsv=require(_0x355c('0xb'));var querystring=require(_0x355c('0x10'));var Papa=require(_0x355c('0x11'));var Redis=require(_0x355c('0x12'));var authService=require(_0x355c('0x13'));var qs=require(_0x355c('0x14'));var as=require(_0x355c('0x15'));var hardwareService=require(_0x355c('0x16'));var logger=require(_0x355c('0x17'))(_0x355c('0x18'));var utils=require(_0x355c('0x19'));var config=require(_0x355c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x256de3,_0x174a77){_0x174a77=_0x174a77||0xcc;return function(_0x4dc0d7){if(_0x4dc0d7){return _0x256de3[_0x355c('0x1b')](_0x174a77);}return _0x256de3['status'](_0x174a77)[_0x355c('0x1c')]();};}function respondWithResult(_0x5dc015,_0x980568){_0x980568=_0x980568||0xc8;return function(_0x587d10){if(_0x587d10){return _0x5dc015['status'](_0x980568)[_0x355c('0x1d')](_0x587d10);}};}function respondWithFilteredResult(_0x4ac022,_0x521716){return function(_0x1ddf94){if(_0x1ddf94){var _0xfbf43=_0x1ddf94[_0x355c('0x1e')],_0x39bd6e=_0x521716[_0x355c('0x1f')],_0x2b77c1=_0x521716[_0x355c('0x1f')]+_0x521716[_0x355c('0x20')],_0x1f5b33;if(_0x2b77c1>=_0xfbf43){_0x2b77c1=_0xfbf43;_0x1f5b33=0xc8;}else{_0x1f5b33=0xce;}_0x4ac022['status'](_0x1f5b33);return _0x4ac022[_0x355c('0x21')](_0x355c('0x22'),_0x39bd6e+'-'+_0x2b77c1+'/'+_0xfbf43)['json'](_0x1ddf94);}return null;};}function patchUpdates(_0x4fabef){return function(_0x4ad154){try{jsonpatch['apply'](_0x4ad154,_0x4fabef,!![]);}catch(_0x445302){return BPromise[_0x355c('0x23')](_0x445302);}return _0x4ad154[_0x355c('0x24')]();};}function saveUpdates(_0x5b1788,_0x42323a){return function(_0x306f4b){if(_0x306f4b){return _0x306f4b[_0x355c('0x25')](_0x5b1788)[_0x355c('0x26')](function(_0x24987b){return _0x24987b;});}return null;};}function removeEntity(_0x1ed4a2,_0x3c4708){return function(_0x363257){if(_0x363257){return _0x363257['destroy']()['then'](function(){_0x1ed4a2[_0x355c('0x27')](0xcc)[_0x355c('0x1c')]();});}};}function handleEntityNotFound(_0x27946d,_0x5a378e){return function(_0x26fd36){if(!_0x26fd36){_0x27946d['sendStatus'](0x194);}return _0x26fd36;};}function handleError(_0x3be2fa,_0x285c0b){_0x285c0b=_0x285c0b||0x1f4;return function(_0x3b6a77){logger[_0x355c('0x28')](_0x3b6a77[_0x355c('0x29')]);if(_0x3b6a77['name']){delete _0x3b6a77[_0x355c('0x2a')];}_0x3be2fa[_0x355c('0x27')](_0x285c0b)[_0x355c('0x2b')](_0x3b6a77);};}exports[_0x355c('0x2c')]=function(_0x19e632,_0x4a01e7){var _0x26e537={},_0x5e6345={},_0xb5895a={'count':0x0,'rows':[]};var _0x1b3623=_[_0x355c('0x2d')](db[_0x355c('0x2e')][_0x355c('0x2f')],function(_0x473ac7){return{'name':_0x473ac7[_0x355c('0x30')],'type':_0x473ac7['type'][_0x355c('0x31')]};});_0x5e6345[_0x355c('0x32')]=_[_0x355c('0x2d')](_0x1b3623,_0x355c('0x2a'));_0x5e6345[_0x355c('0x33')]=_[_0x355c('0x34')](_0x19e632[_0x355c('0x33')]);_0x5e6345[_0x355c('0x35')]=_['intersection'](_0x5e6345[_0x355c('0x32')],_0x5e6345[_0x355c('0x33')]);_0x26e537[_0x355c('0x36')]=_['intersection'](_0x5e6345[_0x355c('0x32')],qs['fields'](_0x19e632[_0x355c('0x33')][_0x355c('0x37')]));_0x26e537[_0x355c('0x36')]=_0x26e537['attributes'][_0x355c('0x38')]?_0x26e537[_0x355c('0x36')]:_0x5e6345['model'];if(!_0x19e632[_0x355c('0x33')][_0x355c('0x39')](_0x355c('0x3a'))){_0x26e537['limit']=qs[_0x355c('0x20')](_0x19e632['query'][_0x355c('0x20')]);_0x26e537[_0x355c('0x1f')]=qs[_0x355c('0x1f')](_0x19e632['query'][_0x355c('0x1f')]);}_0x26e537[_0x355c('0x3b')]=qs[_0x355c('0x3c')](_0x19e632['query'][_0x355c('0x3c')]);_0x26e537['where']=qs[_0x355c('0x35')](_[_0x355c('0x3d')](_0x19e632[_0x355c('0x33')],_0x5e6345[_0x355c('0x35')]));if(_0x19e632[_0x355c('0x33')]['filter']){_0x26e537['where']=_[_0x355c('0x3e')](_0x26e537['where'],{'$or':_['map'](_0x1b3623,function(_0x254bc4){if(_0x254bc4[_0x355c('0x3f')]!==_0x355c('0x40')){var _0x560a79={};_0x560a79[_0x254bc4[_0x355c('0x2a')]]={'$like':'%'+_0x19e632[_0x355c('0x33')][_0x355c('0x41')]+'%'};return _0x560a79;}})});}_0x26e537=_['merge']({},_0x26e537,_0x19e632[_0x355c('0x42')]);var _0x95ba86={'where':_0x26e537[_0x355c('0x43')]};return db[_0x355c('0x2e')][_0x355c('0x1e')](_0x95ba86)[_0x355c('0x26')](function(_0x52efea){_0xb5895a['count']=_0x52efea;if(_0x19e632['query']['includeAll']){_0x26e537[_0x355c('0x44')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x26e537);})[_0x355c('0x26')](function(_0x5c0df4){_0xb5895a[_0x355c('0x45')]=_0x5c0df4;return _0xb5895a;})[_0x355c('0x26')](respondWithFilteredResult(_0x4a01e7,_0x26e537))[_0x355c('0x46')](handleError(_0x4a01e7,null));};exports[_0x355c('0x47')]=function(_0x20323a,_0x38dc57){var _0x2d8140={'raw':!![],'where':{'id':_0x20323a['params']['id']}},_0x1afd5={};_0x1afd5[_0x355c('0x32')]=_[_0x355c('0x34')](db[_0x355c('0x2e')]['rawAttributes']);_0x1afd5[_0x355c('0x33')]=_[_0x355c('0x34')](_0x20323a['query']);_0x1afd5[_0x355c('0x35')]=_[_0x355c('0x48')](_0x1afd5[_0x355c('0x32')],_0x1afd5[_0x355c('0x33')]);_0x2d8140[_0x355c('0x36')]=_[_0x355c('0x48')](_0x1afd5[_0x355c('0x32')],qs[_0x355c('0x37')](_0x20323a[_0x355c('0x33')][_0x355c('0x37')]));_0x2d8140[_0x355c('0x36')]=_0x2d8140[_0x355c('0x36')][_0x355c('0x38')]?_0x2d8140[_0x355c('0x36')]:_0x1afd5[_0x355c('0x32')];if(_0x20323a['query']['includeAll']){_0x2d8140[_0x355c('0x44')]=[{'all':!![]}];}_0x2d8140=_[_0x355c('0x3e')]({},_0x2d8140,_0x20323a[_0x355c('0x42')]);return db['Dynamics365Field'][_0x355c('0x49')](_0x2d8140)[_0x355c('0x26')](handleEntityNotFound(_0x38dc57,null))[_0x355c('0x26')](respondWithResult(_0x38dc57,null))['catch'](handleError(_0x38dc57,null));};exports['create']=function(_0x4bfe5a,_0x12c5d9){return db['Dynamics365Field'][_0x355c('0x4a')](_0x4bfe5a[_0x355c('0x4b')],{})[_0x355c('0x26')](respondWithResult(_0x12c5d9,0xc9))[_0x355c('0x46')](handleError(_0x12c5d9,null));};exports[_0x355c('0x25')]=function(_0x4ac306,_0x5a46ab){if(_0x4ac306['body']['id']){delete _0x4ac306[_0x355c('0x4b')]['id'];}return db[_0x355c('0x2e')][_0x355c('0x49')]({'where':{'id':_0x4ac306[_0x355c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a46ab,null))[_0x355c('0x26')](saveUpdates(_0x4ac306[_0x355c('0x4b')],null))[_0x355c('0x26')](respondWithResult(_0x5a46ab,null))[_0x355c('0x46')](handleError(_0x5a46ab,null));};exports[_0x355c('0x4d')]=function(_0x13d07d,_0x3188a0){return db['Dynamics365Field'][_0x355c('0x49')]({'where':{'id':_0x13d07d[_0x355c('0x4c')]['id']}})[_0x355c('0x26')](handleEntityNotFound(_0x3188a0,null))[_0x355c('0x26')](removeEntity(_0x3188a0,null))[_0x355c('0x46')](handleError(_0x3188a0,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index f8ec6c8..a2aec61 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 _0x5c64=['Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./intDynamics365Field.attributes','exports','define'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0x5c64,0x1a9));var _0x45c6=function(_0xe43b18,_0x41575d){_0xe43b18=_0xe43b18-0x0;var _0x434088=_0x5c64[_0xe43b18];return _0x434088;};'use strict';var _=require(_0x45c6('0x0'));var util=require(_0x45c6('0x1'));var logger=require(_0x45c6('0x2'))(_0x45c6('0x3'));var moment=require(_0x45c6('0x4'));var BPromise=require('bluebird');var rp=require(_0x45c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x45c6('0x6'));var attributes=require(_0x45c6('0x7'));module[_0x45c6('0x8')]=function(_0xbc56bc,_0x27d24e){return _0xbc56bc[_0x45c6('0x9')](_0x45c6('0xa'),attributes,{'tableName':_0x45c6('0xb'),'paranoid':![],'indexes':[{'name':_0x45c6('0xc'),'fields':[_0x45c6('0xd'),_0x45c6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27fd=['int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','../../config/environment','./intDynamics365Field.attributes','define'];(function(_0x38576d,_0x527dc7){var _0x32534a=function(_0x2fd590){while(--_0x2fd590){_0x38576d['push'](_0x38576d['shift']());}};_0x32534a(++_0x527dc7);}(_0x27fd,0x16c));var _0xd27f=function(_0xc5e02a,_0xd9da3c){_0xc5e02a=_0xc5e02a-0x0;var _0xbeca77=_0x27fd[_0xc5e02a];return _0xbeca77;};'use strict';var _=require(_0xd27f('0x0'));var util=require(_0xd27f('0x1'));var logger=require(_0xd27f('0x2'))(_0xd27f('0x3'));var moment=require(_0xd27f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd27f('0x5'));var attributes=require(_0xd27f('0x6'));module['exports']=function(_0x58d825,_0x1c3586){return _0x58d825[_0xd27f('0x7')]('Dynamics365Field',attributes,{'tableName':_0xd27f('0x8'),'paranoid':![],'indexes':[{'name':_0xd27f('0x9'),'fields':[_0xd27f('0xa'),_0xd27f('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index a00b05b..5d5a4b9 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 _0xe626=['info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request'];(function(_0x1c7f69,_0x34a2f4){var _0xae6f50=function(_0x194147){while(--_0x194147){_0x1c7f69['push'](_0x1c7f69['shift']());}};_0xae6f50(++_0x34a2f4);}(_0xe626,0x9d));var _0x6e62=function(_0x44c9c,_0x224aff){_0x44c9c=_0x44c9c-0x0;var _0x3c5782=_0xe626[_0x44c9c];return _0x3c5782;};'use strict';var _=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var moment=require(_0x6e62('0x2'));var BPromise=require(_0x6e62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e62('0x4'));var db=require(_0x6e62('0x5'))['db'];var utils=require(_0x6e62('0x6'));var logger=require(_0x6e62('0x7'))(_0x6e62('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6e62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x157047,_0x55165e,_0x32fd89){return new BPromise(function(_0x1dfbaf,_0x16fa52){return client[_0x6e62('0xa')](_0x157047,_0x32fd89)['then'](function(_0xa6e8be){logger[_0x6e62('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x55165e,_0x6e62('0xc'));logger['debug'](_0x6e62('0xd'),_0x55165e,'request\x20sent',JSON[_0x6e62('0xe')](_0xa6e8be));if(_0xa6e8be['error']){if(_0xa6e8be[_0x6e62('0xf')][_0x6e62('0x10')]===0x1f4){logger[_0x6e62('0xf')](_0x6e62('0x11'),_0x55165e,_0xa6e8be[_0x6e62('0xf')][_0x6e62('0x12')]);return _0x16fa52(_0xa6e8be[_0x6e62('0xf')]['message']);}logger['error'](_0x6e62('0x11'),_0x55165e,_0xa6e8be[_0x6e62('0xf')]['message']);return _0x1dfbaf(_0xa6e8be[_0x6e62('0xf')][_0x6e62('0x12')]);}else{logger[_0x6e62('0xb')](_0x6e62('0x11'),_0x55165e,'request\x20sent');_0x1dfbaf(_0xa6e8be[_0x6e62('0x13')][_0x6e62('0x12')]);}})[_0x6e62('0x14')](function(_0x35748b){logger[_0x6e62('0xf')](_0x6e62('0x11'),_0x55165e,_0x35748b);_0x16fa52(_0x35748b);});});} \ No newline at end of file +var _0xd046=['ioredis','../../config/logger','../../config/environment','http','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xd046,0x129));var _0x6d04=function(_0x14490c,_0x50e8ab){_0x14490c=_0x14490c-0x0;var _0x2f6825=_0xd046[_0x14490c];return _0x2f6825;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var moment=require(_0x6d04('0x1'));var BPromise=require(_0x6d04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d04('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d04('0x4'))('rpc');var config=require(_0x6d04('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6d04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1968c4,_0x4f83bc,_0x569c7b){return new BPromise(function(_0x2e2c01,_0x42aa22){return client['request'](_0x1968c4,_0x569c7b)['then'](function(_0x27a3d6){logger['info'](_0x6d04('0x7'),_0x4f83bc,'request\x20sent');logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4f83bc,_0x6d04('0x8'),JSON[_0x6d04('0x9')](_0x27a3d6));if(_0x27a3d6[_0x6d04('0xa')]){if(_0x27a3d6[_0x6d04('0xa')]['code']===0x1f4){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x42aa22(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x2e2c01(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}else{logger[_0x6d04('0xc')](_0x6d04('0x7'),_0x4f83bc,_0x6d04('0x8'));_0x2e2c01(_0x27a3d6[_0x6d04('0xd')][_0x6d04('0xb')]);}})[_0x6d04('0xe')](function(_0xed5538){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0xed5538);_0x42aa22(_0xed5538);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 8616aad..94e4b8f 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 _0xe783=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','post','addConfiguration','/:id','delete','destroy','exports','multer'];(function(_0x131bcb,_0x48c458){var _0x141632=function(_0x351f80){while(--_0x351f80){_0x131bcb['push'](_0x131bcb['shift']());}};_0x141632(++_0x48c458);}(_0xe783,0xfb));var _0x3e78=function(_0x2ffc99,_0x3b7580){_0x2ffc99=_0x2ffc99-0x0;var _0x788593=_0xe783[_0x2ffc99];return _0x788593;};'use strict';var multer=require(_0x3e78('0x0'));var util=require(_0x3e78('0x1'));var path=require(_0x3e78('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e78('0x3'));var router=express[_0x3e78('0x4')]();var auth=require(_0x3e78('0x5'));var interaction=require(_0x3e78('0x6'));var config=require(_0x3e78('0x7'));var controller=require(_0x3e78('0x8'));router[_0x3e78('0x9')]('/',auth[_0x3e78('0xa')](),controller[_0x3e78('0xb')]);router[_0x3e78('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3e78('0x9')](_0x3e78('0xc'),auth[_0x3e78('0xa')](),controller['getConfigurations']);router['get'](_0x3e78('0xd'),auth[_0x3e78('0xa')](),controller[_0x3e78('0xe')]);router[_0x3e78('0xf')]('/',auth[_0x3e78('0xa')](),controller['create']);router[_0x3e78('0xf')](_0x3e78('0xc'),auth[_0x3e78('0xa')](),controller[_0x3e78('0x10')]);router['put'](_0x3e78('0x11'),auth[_0x3e78('0xa')](),controller['update']);router[_0x3e78('0x12')](_0x3e78('0x11'),auth[_0x3e78('0xa')](),controller[_0x3e78('0x13')]);module[_0x3e78('0x14')]=router; \ No newline at end of file +var _0x2f08=['isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x473e3f,_0x2f0947){var _0x59399b=function(_0x26dece){while(--_0x26dece){_0x473e3f['push'](_0x473e3f['shift']());}};_0x59399b(++_0x2f0947);}(_0x2f08,0xad));var _0x82f0=function(_0x26ac27,_0x574b86){_0x26ac27=_0x26ac27-0x0;var _0x44a599=_0x2f08[_0x26ac27];return _0x44a599;};'use strict';var multer=require(_0x82f0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x82f0('0x1'));var express=require(_0x82f0('0x2'));var router=express[_0x82f0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x82f0('0x4'));var config=require(_0x82f0('0x5'));var controller=require('./intFreshdeskAccount.controller');router[_0x82f0('0x6')]('/',auth[_0x82f0('0x7')](),controller['index']);router[_0x82f0('0x6')](_0x82f0('0x8'),auth[_0x82f0('0x7')](),controller['show']);router[_0x82f0('0x6')](_0x82f0('0x9'),auth[_0x82f0('0x7')](),controller[_0x82f0('0xa')]);router[_0x82f0('0x6')](_0x82f0('0xb'),auth['isAuthenticated'](),controller[_0x82f0('0xc')]);router[_0x82f0('0xd')]('/',auth[_0x82f0('0x7')](),controller['create']);router[_0x82f0('0xd')]('/:id/configurations',auth[_0x82f0('0x7')](),controller[_0x82f0('0xe')]);router[_0x82f0('0xf')](_0x82f0('0x8'),auth[_0x82f0('0x7')](),controller[_0x82f0('0x10')]);router[_0x82f0('0x11')](_0x82f0('0x8'),auth[_0x82f0('0x7')](),controller[_0x82f0('0x12')]);module[_0x82f0('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index f0172fe..e1261e5 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 _0x253d=['username','STRING','remoteUri','sequelize'];(function(_0x5e3715,_0x55f0ea){var _0x3d9464=function(_0x4144b2){while(--_0x4144b2){_0x5e3715['push'](_0x5e3715['shift']());}};_0x3d9464(++_0x55f0ea);}(_0x253d,0x1b3));var _0xd253=function(_0x45ddae,_0x410d2c){_0x45ddae=_0x45ddae-0x0;var _0x5bb528=_0x253d[_0x45ddae];return _0x5bb528;};'use strict';var Sequelize=require(_0xd253('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xd253('0x1')},'apiKey':{'type':Sequelize[_0xd253('0x2')]},'remoteUri':{'type':Sequelize[_0xd253('0x2')],'unique':_0xd253('0x3')},'serverUrl':{'type':Sequelize[_0xd253('0x2')]}}; \ No newline at end of file +var _0xd05a=['STRING','remoteUri','exports'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xd05a,0x143));var _0xad05=function(_0x1c08bb,_0x19580c){_0x1c08bb=_0x1c08bb-0x0;var _0x44150e=_0xd05a[_0x1c08bb];return _0x44150e;};'use strict';var Sequelize=require('sequelize');module[_0xad05('0x0')]={'name':{'type':Sequelize[_0xad05('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xad05('0x1')],'unique':_0xad05('0x2')},'serverUrl':{'type':Sequelize[_0xad05('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 92c0b78..7adc762 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 _0xf139=['base64','subject','description','priority','ticket_type','group','company','remove','includes','default','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','name','index','map','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','params','rawAttributes','includeAll','find','create','body','catch','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString'];(function(_0x2201e0,_0x227555){var _0x1edcc0=function(_0x4b5700){while(--_0x4b5700){_0x2201e0['push'](_0x2201e0['shift']());}};_0x1edcc0(++_0x227555);}(_0xf139,0x8f));var _0x9f13=function(_0x9d7cad,_0x5711d7){_0x9d7cad=_0x9d7cad-0x0;var _0x465f25=_0xf139[_0x9d7cad];return _0x465f25;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9f13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f13('0x1'));var jsonpatch=require(_0x9f13('0x2'));var rp=require(_0x9f13('0x3'));var moment=require(_0x9f13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9f13('0x5'));var util=require(_0x9f13('0x6'));var path=require(_0x9f13('0x7'));var sox=require(_0x9f13('0x8'));var csv=require('to-csv');var ejs=require(_0x9f13('0x9'));var fs=require('fs');var _=require(_0x9f13('0xa'));var squel=require(_0x9f13('0xb'));var crypto=require('crypto');var jsforce=require(_0x9f13('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9f13('0xd'));var querystring=require(_0x9f13('0xe'));var Papa=require(_0x9f13('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9f13('0x10'));var as=require(_0x9f13('0x11'));var hardwareService=require(_0x9f13('0x12'));var logger=require('../../config/logger')(_0x9f13('0x13'));var utils=require(_0x9f13('0x14'));var config=require(_0x9f13('0x15'));var db=require(_0x9f13('0x16'))['db'];var integrations=require(_0x9f13('0x17'));var jayson=require(_0x9f13('0x18'));var client=jayson[_0x9f13('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x4aa931,_0x213ed0,_0x1a637c){if(_0x1a637c){var _0x56a1e9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56a1e9[_0x9f13('0x1a')](_0x213ed0)){return _0x4aa931;}else{throw new db[(_0x9f13('0x1b'))][(_0x9f13('0x1c'))](_0x9f13('0x1d'));}}else{return _0x4aa931;}}function respondWithRpcPromise(_0x22e475,_0x74b619,_0x5b02c1,_0x46bce6){return new BPromise(function(_0x1f7e20,_0x4bb409){var _0x1e0b23=_0x46bce6||client;return _0x1e0b23[_0x9f13('0x1e')](_0x22e475,_0x5b02c1)[_0x9f13('0x1f')](function(_0x577985){logger[_0x9f13('0x20')](_0x9f13('0x21'),_0x74b619,_0x9f13('0x22'));logger[_0x9f13('0x23')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x74b619,'request\x20sent',JSON[_0x9f13('0x24')](_0x577985));if(_0x577985[_0x9f13('0x25')]){if(_0x577985[_0x9f13('0x25')][_0x9f13('0x26')]===0x1f4){logger[_0x9f13('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x74b619,_0x577985[_0x9f13('0x25')]['message']);return _0x4bb409(_0x577985[_0x9f13('0x25')][_0x9f13('0x27')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x74b619,_0x577985[_0x9f13('0x25')]['message']);return _0x1f7e20(_0x577985['error'][_0x9f13('0x27')]);}else{logger[_0x9f13('0x20')](_0x9f13('0x21'),_0x74b619,_0x9f13('0x22'));_0x1f7e20(_0x577985[_0x9f13('0x28')][_0x9f13('0x27')]);}})['catch'](function(_0x184db4){logger[_0x9f13('0x25')](_0x9f13('0x21'),_0x74b619,_0x184db4);_0x4bb409(_0x184db4);});});}function respondWithStatusCode(_0x44dec6,_0x59dfce){_0x59dfce=_0x59dfce||0xcc;return function(_0x93ba80){if(_0x93ba80){return _0x44dec6[_0x9f13('0x29')](_0x59dfce);}return _0x44dec6[_0x9f13('0x2a')](_0x59dfce)[_0x9f13('0x2b')]();};}function respondWithResult(_0x3118f,_0x4489e2){_0x4489e2=_0x4489e2||0xc8;return function(_0x21b52c){if(_0x21b52c){return _0x3118f[_0x9f13('0x2a')](_0x4489e2)[_0x9f13('0x2c')](_0x21b52c);}};}function respondWithFilteredResult(_0x5ad0bf,_0x1dcd5b){return function(_0x509252){if(_0x509252){var _0x1c963f=_0x509252[_0x9f13('0x2d')],_0x31e649=_0x1dcd5b[_0x9f13('0x2e')],_0x522a37=_0x1dcd5b[_0x9f13('0x2e')]+_0x1dcd5b[_0x9f13('0x2f')],_0x2098cc;if(_0x522a37>=_0x1c963f){_0x522a37=_0x1c963f;_0x2098cc=0xc8;}else{_0x2098cc=0xce;}_0x5ad0bf[_0x9f13('0x2a')](_0x2098cc);return _0x5ad0bf['set'](_0x9f13('0x30'),_0x31e649+'-'+_0x522a37+'/'+_0x1c963f)['json'](_0x509252);}return null;};}function patchUpdates(_0x18e6f1){return function(_0x22c154){try{jsonpatch[_0x9f13('0x31')](_0x22c154,_0x18e6f1,!![]);}catch(_0x1d0fe0){return BPromise[_0x9f13('0x32')](_0x1d0fe0);}return _0x22c154[_0x9f13('0x33')]();};}function saveUpdates(_0x4c0803,_0x4ac0ad){return function(_0x3afbc0){if(_0x3afbc0){return _0x3afbc0[_0x9f13('0x34')](_0x4c0803)[_0x9f13('0x1f')](function(_0x195911){return _0x195911;});}return null;};}function removeEntity(_0x322af9,_0x274160){return function(_0x5d133e){if(_0x5d133e){return _0x5d133e[_0x9f13('0x35')]()['then'](function(){_0x322af9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5885b0,_0x5e0ec2){return function(_0xa9dfef){if(!_0xa9dfef){_0x5885b0[_0x9f13('0x29')](0x194);}return _0xa9dfef;};}function handleError(_0x2d2c45,_0x386616){_0x386616=_0x386616||0x1f4;return function(_0x1a19ac){logger[_0x9f13('0x25')](_0x1a19ac['stack']);if(_0x1a19ac[_0x9f13('0x36')]){delete _0x1a19ac[_0x9f13('0x36')];}_0x2d2c45[_0x9f13('0x2a')](_0x386616)['send'](_0x1a19ac);};}exports[_0x9f13('0x37')]=function(_0xb48897,_0x26a4cf){var _0x1af278={},_0x188bb1={},_0xcf6c74={'count':0x0,'rows':[]};var _0x13e1dd=_[_0x9f13('0x38')](db['FreshdeskAccount']['rawAttributes'],function(_0x246770){return{'name':_0x246770[_0x9f13('0x39')],'type':_0x246770[_0x9f13('0x3a')][_0x9f13('0x3b')]};});_0x188bb1[_0x9f13('0x3c')]=_['map'](_0x13e1dd,'name');_0x188bb1['query']=_[_0x9f13('0x3d')](_0xb48897[_0x9f13('0x3e')]);_0x188bb1['filters']=_[_0x9f13('0x3f')](_0x188bb1['model'],_0x188bb1['query']);_0x1af278['attributes']=_[_0x9f13('0x3f')](_0x188bb1[_0x9f13('0x3c')],qs[_0x9f13('0x40')](_0xb48897[_0x9f13('0x3e')][_0x9f13('0x40')]));_0x1af278[_0x9f13('0x41')]=_0x1af278[_0x9f13('0x41')][_0x9f13('0x42')]?_0x1af278['attributes']:_0x188bb1[_0x9f13('0x3c')];if(!_0xb48897[_0x9f13('0x3e')]['hasOwnProperty'](_0x9f13('0x43'))){_0x1af278[_0x9f13('0x2f')]=qs['limit'](_0xb48897[_0x9f13('0x3e')][_0x9f13('0x2f')]);_0x1af278['offset']=qs[_0x9f13('0x2e')](_0xb48897[_0x9f13('0x3e')][_0x9f13('0x2e')]);}_0x1af278[_0x9f13('0x44')]=qs[_0x9f13('0x45')](_0xb48897[_0x9f13('0x3e')][_0x9f13('0x45')]);_0x1af278[_0x9f13('0x46')]=qs['filters'](_[_0x9f13('0x47')](_0xb48897[_0x9f13('0x3e')],_0x188bb1[_0x9f13('0x48')]));if(_0xb48897['query'][_0x9f13('0x49')]){_0x1af278[_0x9f13('0x46')]=_[_0x9f13('0x4a')](_0x1af278[_0x9f13('0x46')],{'$or':_[_0x9f13('0x38')](_0x13e1dd,function(_0x5d33be){if(_0x5d33be[_0x9f13('0x3a')]!==_0x9f13('0x4b')){var _0x159b30={};_0x159b30[_0x5d33be[_0x9f13('0x36')]]={'$like':'%'+_0xb48897[_0x9f13('0x3e')][_0x9f13('0x49')]+'%'};return _0x159b30;}})});}_0x1af278=_[_0x9f13('0x4a')]({},_0x1af278,_0xb48897[_0x9f13('0x4c')]);var _0x3bd42b={'where':_0x1af278['where']};return db[_0x9f13('0x4d')][_0x9f13('0x2d')](_0x3bd42b)[_0x9f13('0x1f')](function(_0x1b4bd7){_0xcf6c74['count']=_0x1b4bd7;if(_0xb48897[_0x9f13('0x3e')]['includeAll']){_0x1af278[_0x9f13('0x4e')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x9f13('0x4f')](_0x1af278);})[_0x9f13('0x1f')](function(_0x33dae1){_0xcf6c74[_0x9f13('0x50')]=_0x33dae1;return _0xcf6c74;})['then'](respondWithFilteredResult(_0x26a4cf,_0x1af278))['catch'](handleError(_0x26a4cf,null));};exports['show']=function(_0x23dff2,_0x24a98b){var _0x1dc9f8={'raw':![],'where':{'id':_0x23dff2[_0x9f13('0x51')]['id']}},_0x3f3c64={};_0x3f3c64[_0x9f13('0x3c')]=_[_0x9f13('0x3d')](db[_0x9f13('0x4d')][_0x9f13('0x52')]);_0x3f3c64[_0x9f13('0x3e')]=_[_0x9f13('0x3d')](_0x23dff2['query']);_0x3f3c64[_0x9f13('0x48')]=_[_0x9f13('0x3f')](_0x3f3c64['model'],_0x3f3c64[_0x9f13('0x3e')]);_0x1dc9f8[_0x9f13('0x41')]=_[_0x9f13('0x3f')](_0x3f3c64[_0x9f13('0x3c')],qs[_0x9f13('0x40')](_0x23dff2['query'][_0x9f13('0x40')]));_0x1dc9f8[_0x9f13('0x41')]=_0x1dc9f8[_0x9f13('0x41')][_0x9f13('0x42')]?_0x1dc9f8[_0x9f13('0x41')]:_0x3f3c64[_0x9f13('0x3c')];if(_0x23dff2[_0x9f13('0x3e')][_0x9f13('0x53')]){_0x1dc9f8[_0x9f13('0x4e')]=[{'all':!![]}];}_0x1dc9f8=_[_0x9f13('0x4a')]({},_0x1dc9f8,_0x23dff2['options']);return db[_0x9f13('0x4d')][_0x9f13('0x54')](_0x1dc9f8)['then'](handleEntityNotFound(_0x24a98b,null))[_0x9f13('0x1f')](respondWithResult(_0x24a98b,null))['catch'](handleError(_0x24a98b,null));};exports[_0x9f13('0x55')]=function(_0x12fe4d,_0x4db18d){return db['FreshdeskAccount'][_0x9f13('0x55')](_0x12fe4d[_0x9f13('0x56')],{})[_0x9f13('0x1f')](respondWithResult(_0x4db18d,0xc9))[_0x9f13('0x57')](handleError(_0x4db18d,null));};exports[_0x9f13('0x34')]=function(_0x30f52e,_0x552658){if(_0x30f52e[_0x9f13('0x56')]['id']){delete _0x30f52e[_0x9f13('0x56')]['id'];}return db[_0x9f13('0x4d')][_0x9f13('0x54')]({'where':{'id':_0x30f52e[_0x9f13('0x51')]['id']}})[_0x9f13('0x1f')](handleEntityNotFound(_0x552658,null))['then'](saveUpdates(_0x30f52e[_0x9f13('0x56')],null))[_0x9f13('0x1f')](respondWithResult(_0x552658,null))['catch'](handleError(_0x552658,null));};exports['destroy']=function(_0x1095e1,_0x94050f){return db['FreshdeskAccount'][_0x9f13('0x54')]({'where':{'id':_0x1095e1[_0x9f13('0x51')]['id']}})[_0x9f13('0x1f')](handleEntityNotFound(_0x94050f,null))[_0x9f13('0x1f')](removeEntity(_0x94050f,null))[_0x9f13('0x57')](handleError(_0x94050f,null));};exports[_0x9f13('0x58')]=function(_0x40a99a,_0x3b4f0e,_0x518cb7){var _0x218692={};var _0x51613d={};var _0x4d8185;var _0x1b2c75;return db[_0x9f13('0x4d')][_0x9f13('0x59')]({'where':{'id':_0x40a99a['params']['id']}})[_0x9f13('0x1f')](handleEntityNotFound(_0x3b4f0e,null))['then'](function(_0x125590){if(_0x125590){_0x4d8185=_0x125590;_0x51613d['model']=_[_0x9f13('0x3d')](db[_0x9f13('0x5a')]['rawAttributes']);_0x51613d[_0x9f13('0x3e')]=_[_0x9f13('0x3d')](_0x40a99a[_0x9f13('0x3e')]);_0x51613d[_0x9f13('0x48')]=_[_0x9f13('0x3f')](_0x51613d[_0x9f13('0x3c')],_0x51613d[_0x9f13('0x3e')]);_0x218692[_0x9f13('0x41')]=_['intersection'](_0x51613d[_0x9f13('0x3c')],qs[_0x9f13('0x40')](_0x40a99a['query'][_0x9f13('0x40')]));_0x218692['attributes']=_0x218692[_0x9f13('0x41')][_0x9f13('0x42')]?_0x218692['attributes']:_0x51613d[_0x9f13('0x3c')];_0x218692[_0x9f13('0x44')]=qs[_0x9f13('0x45')](_0x40a99a[_0x9f13('0x3e')][_0x9f13('0x45')]);_0x218692['where']=qs[_0x9f13('0x48')](_[_0x9f13('0x47')](_0x40a99a[_0x9f13('0x3e')],_0x51613d[_0x9f13('0x48')]));if(_0x40a99a[_0x9f13('0x3e')][_0x9f13('0x49')]){_0x218692[_0x9f13('0x46')]=_['merge'](_0x218692[_0x9f13('0x46')],{'$or':_[_0x9f13('0x38')](_0x218692[_0x9f13('0x41')],function(_0x562c00){var _0x346805={};_0x346805[_0x562c00]={'$like':'%'+_0x40a99a[_0x9f13('0x3e')]['filter']+'%'};return _0x346805;})});}_0x218692=_[_0x9f13('0x4a')]({},_0x218692,_0x40a99a[_0x9f13('0x4c')]);return _0x4d8185[_0x9f13('0x58')](_0x218692);}})[_0x9f13('0x1f')](function(_0x17a977){if(_0x17a977){_0x1b2c75=_0x17a977[_0x9f13('0x42')];if(!_0x40a99a[_0x9f13('0x3e')][_0x9f13('0x5b')](_0x9f13('0x43'))){_0x218692[_0x9f13('0x2f')]=qs['limit'](_0x40a99a[_0x9f13('0x3e')]['limit']);_0x218692[_0x9f13('0x2e')]=qs[_0x9f13('0x2e')](_0x40a99a[_0x9f13('0x3e')]['offset']);}return _0x4d8185[_0x9f13('0x58')](_0x218692);}})[_0x9f13('0x1f')](function(_0x1c68bb){if(_0x1c68bb){return _0x1c68bb?{'count':_0x1b2c75,'rows':_0x1c68bb}:null;}})[_0x9f13('0x1f')](respondWithResult(_0x3b4f0e,null))[_0x9f13('0x57')](handleError(_0x3b4f0e,null));};exports[_0x9f13('0x5c')]=function(_0x1a5850,_0x1b5537,_0x118475){if(_0x1a5850['body']['id']){delete _0x1a5850[_0x9f13('0x56')]['id'];}return db[_0x9f13('0x4d')]['findOne']({'where':{'id':_0x1a5850[_0x9f13('0x51')]['id']}})[_0x9f13('0x1f')](handleEntityNotFound(_0x1b5537,null))['then'](function(_0x44d6e1){if(_0x44d6e1){_0x1a5850[_0x9f13('0x56')][_0x9f13('0x5d')]=_0x44d6e1['id'];_0x1a5850[_0x9f13('0x56')][_0x9f13('0x5e')]=integrations[_0x9f13('0x5f')](_0x1a5850[_0x9f13('0x56')]['channel'],_0x1a5850[_0x9f13('0x56')][_0x9f13('0x3a')]);_0x1a5850['body'][_0x9f13('0x60')]=integrations['getDescriptions'](_0x1a5850[_0x9f13('0x56')][_0x9f13('0x61')],_0x1a5850[_0x9f13('0x56')][_0x9f13('0x3a')]);return db['FreshdeskConfiguration'][_0x9f13('0x55')](_0x1a5850[_0x9f13('0x56')],{'include':[{'model':db[_0x9f13('0x62')],'as':_0x9f13('0x5e')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x9f13('0x1f')](respondWithResult(_0x1b5537,null))[_0x9f13('0x57')](handleError(_0x1b5537,null));};exports[_0x9f13('0x63')]=function(_0x1dd4dc,_0x230a1d,_0x254c3a){var _0x289f9d='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x1dd4dc[_0x9f13('0x51')]['id']},'attributes':['id',_0x9f13('0x64'),_0x9f13('0x65')]})[_0x9f13('0x1f')](handleEntityNotFound(_0x230a1d,null))[_0x9f13('0x1f')](function(_0x2ce2f2){if(_0x2ce2f2){_0x289f9d=_0x2ce2f2['remoteUri'];var _0x3983cd=_0x289f9d[_0x9f13('0x66')](-0x1);if(_0x3983cd==='/'){_0x289f9d=_0x289f9d[_0x9f13('0x67')](0x0,_0x289f9d[_0x9f13('0x68')](_0x3983cd));}return rp({'method':_0x9f13('0x69'),'uri':util[_0x9f13('0x6a')](_0x9f13('0x6b'),_0x289f9d,_0x9f13('0x6c')),'headers':{'Authorization':util[_0x9f13('0x6a')]('Basic\x20%s',new Buffer(util[_0x9f13('0x6a')](_0x9f13('0x6d'),_0x2ce2f2[_0x9f13('0x65')]))[_0x9f13('0x6e')](_0x9f13('0x6f')))},'json':!![]});}})[_0x9f13('0x1f')](function(_0x1864d7){if(_0x1864d7){var _0x12d644=['requester',_0x9f13('0x70'),'agent',_0x9f13('0x71'),'status',_0x9f13('0x72'),'group','source',_0x9f13('0x73'),_0x9f13('0x74'),_0x9f13('0x75')];_[_0x9f13('0x76')](_0x1864d7,function(_0xfaea8f){return _0x12d644[_0x9f13('0x77')](_0xfaea8f['name'])||!_0xfaea8f[_0x9f13('0x78')]&&_0xfaea8f[_0x9f13('0x3a')]!==_0x9f13('0x79')&&_0xfaea8f['type']!=='custom_dropdown';});return{'count':_0x1864d7['length'],'rows':_[_0x9f13('0x38')](_0x1864d7,function(_0x206bb3){return{'id':_0x206bb3[_0x9f13('0x36')],'name':_0x206bb3[_0x9f13('0x7a')],'custom':!_0x206bb3['default'],'options':_0x206bb3[_0x9f13('0x7b')]?_[_0x9f13('0x38')](_0x206bb3['choices'],function(_0x3b3566){return{'name':_[_0x9f13('0x7c')](_0x3b3566),'value':_0x3b3566};}):[]};})};}})[_0x9f13('0x1f')](respondWithResult(_0x230a1d,null))['catch'](function(_0x427b09){var _0x14cef0=_0x1dd4dc[_0x9f13('0x3e')][_0x9f13('0x1a')]?0x1f4:_0x427b09[_0x9f13('0x7d')]||0x1f4;logger[_0x9f13('0x25')](_0x9f13('0x7e'),_0x9f13('0x63'),_0x14cef0,JSON[_0x9f13('0x24')](_0x427b09));delete _0x427b09['name'];if(_0x14cef0===0x191){_0x14cef0=0x190;}_0x230a1d[_0x9f13('0x2a')](_0x14cef0)['send'](_0x1dd4dc[_0x9f13('0x3e')][_0x9f13('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x427b09['statusCode']}:_0x427b09);});}; \ No newline at end of file +var _0x9eec=['json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','fieldName','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','includeAll','include','FreshdeskAccount','findAll','rows','catch','params','length','options','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','rawAttributes','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','FreshdeskField','remoteUri','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','Basic\x20%s','format','%s:X','apiKey','toString','base64','requester','description','ticket_type','company','remove','includes','custom_text','label','default','choices','capitalize','statusCode','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0x9eec,0xce));var _0xc9ee=function(_0x5638a2,_0x144aa9){_0x5638a2=_0x5638a2-0x0;var _0x363314=_0x9eec[_0x5638a2];return _0x363314;};'use strict';var pdf=require(_0xc9ee('0x0'));var emlformat=require(_0xc9ee('0x1'));var rimraf=require(_0xc9ee('0x2'));var zipdir=require(_0xc9ee('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9ee('0x4'));var moment=require(_0xc9ee('0x5'));var BPromise=require(_0xc9ee('0x6'));var Mustache=require(_0xc9ee('0x7'));var util=require(_0xc9ee('0x8'));var path=require('path');var sox=require(_0xc9ee('0x9'));var csv=require(_0xc9ee('0xa'));var ejs=require(_0xc9ee('0xb'));var fs=require('fs');var _=require(_0xc9ee('0xc'));var squel=require('squel');var crypto=require(_0xc9ee('0xd'));var jsforce=require(_0xc9ee('0xe'));var deskjs=require(_0xc9ee('0xf'));var toCsv=require(_0xc9ee('0xa'));var querystring=require(_0xc9ee('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc9ee('0x11'));var qs=require(_0xc9ee('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9ee('0x13'));var logger=require(_0xc9ee('0x14'))(_0xc9ee('0x15'));var utils=require(_0xc9ee('0x16'));var config=require(_0xc9ee('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc9ee('0x18'));var jayson=require(_0xc9ee('0x19'));var client=jayson[_0xc9ee('0x1a')][_0xc9ee('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x579de3,_0x5ea468,_0x49e95d){if(_0x49e95d){var _0x25b62c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25b62c[_0xc9ee('0x1c')](_0x5ea468)){return _0x579de3;}else{throw new db[(_0xc9ee('0x1d'))][(_0xc9ee('0x1e'))](_0xc9ee('0x1f'));}}else{return _0x579de3;}}function respondWithRpcPromise(_0x5333f9,_0x40e25e,_0x15ee9f,_0x2425b4){return new BPromise(function(_0x3db904,_0x4c2236){var _0x23df89=_0x2425b4||client;return _0x23df89[_0xc9ee('0x20')](_0x5333f9,_0x15ee9f)[_0xc9ee('0x21')](function(_0x2053c5){logger[_0xc9ee('0x22')](_0xc9ee('0x23'),_0x40e25e,_0xc9ee('0x24'));logger[_0xc9ee('0x25')](_0xc9ee('0x26'),_0x40e25e,'request\x20sent',JSON[_0xc9ee('0x27')](_0x2053c5));if(_0x2053c5[_0xc9ee('0x28')]){if(_0x2053c5[_0xc9ee('0x28')][_0xc9ee('0x29')]===0x1f4){logger[_0xc9ee('0x28')](_0xc9ee('0x23'),_0x40e25e,_0x2053c5[_0xc9ee('0x28')][_0xc9ee('0x2a')]);return _0x4c2236(_0x2053c5['error']['message']);}logger[_0xc9ee('0x28')](_0xc9ee('0x23'),_0x40e25e,_0x2053c5[_0xc9ee('0x28')][_0xc9ee('0x2a')]);return _0x3db904(_0x2053c5['error']['message']);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x40e25e,_0xc9ee('0x24'));_0x3db904(_0x2053c5[_0xc9ee('0x2b')][_0xc9ee('0x2a')]);}})['catch'](function(_0x3a9de9){logger[_0xc9ee('0x28')](_0xc9ee('0x23'),_0x40e25e,_0x3a9de9);_0x4c2236(_0x3a9de9);});});}function respondWithStatusCode(_0x264060,_0x11bd66){_0x11bd66=_0x11bd66||0xcc;return function(_0x5ed199){if(_0x5ed199){return _0x264060['sendStatus'](_0x11bd66);}return _0x264060['status'](_0x11bd66)[_0xc9ee('0x2c')]();};}function respondWithResult(_0x21f3d5,_0x475e60){_0x475e60=_0x475e60||0xc8;return function(_0x5ac84e){if(_0x5ac84e){return _0x21f3d5[_0xc9ee('0x2d')](_0x475e60)[_0xc9ee('0x2e')](_0x5ac84e);}};}function respondWithFilteredResult(_0x37297b,_0x412619){return function(_0x565083){if(_0x565083){var _0x4f0126=_0x565083[_0xc9ee('0x2f')],_0x274239=_0x412619['offset'],_0x532d49=_0x412619[_0xc9ee('0x30')]+_0x412619['limit'],_0x1d7580;if(_0x532d49>=_0x4f0126){_0x532d49=_0x4f0126;_0x1d7580=0xc8;}else{_0x1d7580=0xce;}_0x37297b[_0xc9ee('0x2d')](_0x1d7580);return _0x37297b[_0xc9ee('0x31')](_0xc9ee('0x32'),_0x274239+'-'+_0x532d49+'/'+_0x4f0126)[_0xc9ee('0x2e')](_0x565083);}return null;};}function patchUpdates(_0x23082b){return function(_0x49d1e6){try{jsonpatch[_0xc9ee('0x33')](_0x49d1e6,_0x23082b,!![]);}catch(_0x3fed03){return BPromise[_0xc9ee('0x34')](_0x3fed03);}return _0x49d1e6[_0xc9ee('0x35')]();};}function saveUpdates(_0x88818,_0x1df35d){return function(_0x1a29c8){if(_0x1a29c8){return _0x1a29c8[_0xc9ee('0x36')](_0x88818)[_0xc9ee('0x21')](function(_0x178afc){return _0x178afc;});}return null;};}function removeEntity(_0x326ea5,_0x109b48){return function(_0xde6760){if(_0xde6760){return _0xde6760[_0xc9ee('0x37')]()['then'](function(){_0x326ea5[_0xc9ee('0x2d')](0xcc)[_0xc9ee('0x2c')]();});}};}function handleEntityNotFound(_0x496272,_0xb8f500){return function(_0x26636f){if(!_0x26636f){_0x496272['sendStatus'](0x194);}return _0x26636f;};}function handleError(_0xf59217,_0xf7c2b1){_0xf7c2b1=_0xf7c2b1||0x1f4;return function(_0x1698b1){logger['error'](_0x1698b1[_0xc9ee('0x38')]);if(_0x1698b1[_0xc9ee('0x39')]){delete _0x1698b1['name'];}_0xf59217['status'](_0xf7c2b1)[_0xc9ee('0x3a')](_0x1698b1);};}exports['index']=function(_0x3b7aa5,_0x1a9542){var _0x17b75e={},_0x117dfd={},_0x3a56f9={'count':0x0,'rows':[]};var _0x45e215=_[_0xc9ee('0x3b')](db['FreshdeskAccount']['rawAttributes'],function(_0x1defa6){return{'name':_0x1defa6[_0xc9ee('0x3c')],'type':_0x1defa6['type'][_0xc9ee('0x3d')]};});_0x117dfd[_0xc9ee('0x3e')]=_[_0xc9ee('0x3b')](_0x45e215,'name');_0x117dfd['query']=_[_0xc9ee('0x3f')](_0x3b7aa5['query']);_0x117dfd[_0xc9ee('0x40')]=_[_0xc9ee('0x41')](_0x117dfd[_0xc9ee('0x3e')],_0x117dfd['query']);_0x17b75e[_0xc9ee('0x42')]=_[_0xc9ee('0x41')](_0x117dfd[_0xc9ee('0x3e')],qs[_0xc9ee('0x43')](_0x3b7aa5[_0xc9ee('0x44')][_0xc9ee('0x43')]));_0x17b75e[_0xc9ee('0x42')]=_0x17b75e['attributes']['length']?_0x17b75e[_0xc9ee('0x42')]:_0x117dfd['model'];if(!_0x3b7aa5['query'][_0xc9ee('0x45')](_0xc9ee('0x46'))){_0x17b75e[_0xc9ee('0x47')]=qs['limit'](_0x3b7aa5[_0xc9ee('0x44')][_0xc9ee('0x47')]);_0x17b75e[_0xc9ee('0x30')]=qs['offset'](_0x3b7aa5[_0xc9ee('0x44')][_0xc9ee('0x30')]);}_0x17b75e['order']=qs[_0xc9ee('0x48')](_0x3b7aa5[_0xc9ee('0x44')][_0xc9ee('0x48')]);_0x17b75e[_0xc9ee('0x49')]=qs['filters'](_[_0xc9ee('0x4a')](_0x3b7aa5[_0xc9ee('0x44')],_0x117dfd['filters']));if(_0x3b7aa5[_0xc9ee('0x44')][_0xc9ee('0x4b')]){_0x17b75e[_0xc9ee('0x49')]=_['merge'](_0x17b75e[_0xc9ee('0x49')],{'$or':_[_0xc9ee('0x3b')](_0x45e215,function(_0x143a8d){if(_0x143a8d['type']!=='VIRTUAL'){var _0x34e39a={};_0x34e39a[_0x143a8d[_0xc9ee('0x39')]]={'$like':'%'+_0x3b7aa5[_0xc9ee('0x44')][_0xc9ee('0x4b')]+'%'};return _0x34e39a;}})});}_0x17b75e=_[_0xc9ee('0x4c')]({},_0x17b75e,_0x3b7aa5['options']);var _0x9646d3={'where':_0x17b75e[_0xc9ee('0x49')]};return db['FreshdeskAccount'][_0xc9ee('0x2f')](_0x9646d3)[_0xc9ee('0x21')](function(_0x20d3e9){_0x3a56f9[_0xc9ee('0x2f')]=_0x20d3e9;if(_0x3b7aa5[_0xc9ee('0x44')][_0xc9ee('0x4d')]){_0x17b75e[_0xc9ee('0x4e')]=[{'all':!![]}];}return db[_0xc9ee('0x4f')][_0xc9ee('0x50')](_0x17b75e);})['then'](function(_0x25be08){_0x3a56f9[_0xc9ee('0x51')]=_0x25be08;return _0x3a56f9;})['then'](respondWithFilteredResult(_0x1a9542,_0x17b75e))[_0xc9ee('0x52')](handleError(_0x1a9542,null));};exports['show']=function(_0x2fef6a,_0x52cc8f){var _0x8d6431={'raw':![],'where':{'id':_0x2fef6a[_0xc9ee('0x53')]['id']}},_0x3fa85f={};_0x3fa85f[_0xc9ee('0x3e')]=_[_0xc9ee('0x3f')](db[_0xc9ee('0x4f')]['rawAttributes']);_0x3fa85f[_0xc9ee('0x44')]=_[_0xc9ee('0x3f')](_0x2fef6a[_0xc9ee('0x44')]);_0x3fa85f[_0xc9ee('0x40')]=_['intersection'](_0x3fa85f['model'],_0x3fa85f['query']);_0x8d6431[_0xc9ee('0x42')]=_[_0xc9ee('0x41')](_0x3fa85f[_0xc9ee('0x3e')],qs[_0xc9ee('0x43')](_0x2fef6a[_0xc9ee('0x44')]['fields']));_0x8d6431[_0xc9ee('0x42')]=_0x8d6431[_0xc9ee('0x42')][_0xc9ee('0x54')]?_0x8d6431[_0xc9ee('0x42')]:_0x3fa85f[_0xc9ee('0x3e')];if(_0x2fef6a[_0xc9ee('0x44')][_0xc9ee('0x4d')]){_0x8d6431[_0xc9ee('0x4e')]=[{'all':!![]}];}_0x8d6431=_[_0xc9ee('0x4c')]({},_0x8d6431,_0x2fef6a[_0xc9ee('0x55')]);return db[_0xc9ee('0x4f')][_0xc9ee('0x56')](_0x8d6431)[_0xc9ee('0x21')](handleEntityNotFound(_0x52cc8f,null))['then'](respondWithResult(_0x52cc8f,null))[_0xc9ee('0x52')](handleError(_0x52cc8f,null));};exports[_0xc9ee('0x57')]=function(_0x52e6ce,_0x3ba6b2){return db[_0xc9ee('0x4f')][_0xc9ee('0x57')](_0x52e6ce[_0xc9ee('0x58')],{})[_0xc9ee('0x21')](respondWithResult(_0x3ba6b2,0xc9))['catch'](handleError(_0x3ba6b2,null));};exports['update']=function(_0x24f02d,_0x22fb42){if(_0x24f02d[_0xc9ee('0x58')]['id']){delete _0x24f02d['body']['id'];}return db[_0xc9ee('0x4f')][_0xc9ee('0x56')]({'where':{'id':_0x24f02d[_0xc9ee('0x53')]['id']}})[_0xc9ee('0x21')](handleEntityNotFound(_0x22fb42,null))[_0xc9ee('0x21')](saveUpdates(_0x24f02d[_0xc9ee('0x58')],null))['then'](respondWithResult(_0x22fb42,null))[_0xc9ee('0x52')](handleError(_0x22fb42,null));};exports[_0xc9ee('0x37')]=function(_0x16641a,_0x553101){return db['FreshdeskAccount']['find']({'where':{'id':_0x16641a[_0xc9ee('0x53')]['id']}})[_0xc9ee('0x21')](handleEntityNotFound(_0x553101,null))['then'](removeEntity(_0x553101,null))[_0xc9ee('0x52')](handleError(_0x553101,null));};exports[_0xc9ee('0x59')]=function(_0x3cd276,_0x10fc03,_0x4039b4){var _0x4ab2a0={};var _0x281f16={};var _0x571084;var _0x3cafd4;return db[_0xc9ee('0x4f')][_0xc9ee('0x5a')]({'where':{'id':_0x3cd276[_0xc9ee('0x53')]['id']}})[_0xc9ee('0x21')](handleEntityNotFound(_0x10fc03,null))[_0xc9ee('0x21')](function(_0x668b34){if(_0x668b34){_0x571084=_0x668b34;_0x281f16[_0xc9ee('0x3e')]=_['keys'](db[_0xc9ee('0x5b')][_0xc9ee('0x5c')]);_0x281f16[_0xc9ee('0x44')]=_[_0xc9ee('0x3f')](_0x3cd276[_0xc9ee('0x44')]);_0x281f16['filters']=_[_0xc9ee('0x41')](_0x281f16[_0xc9ee('0x3e')],_0x281f16[_0xc9ee('0x44')]);_0x4ab2a0[_0xc9ee('0x42')]=_[_0xc9ee('0x41')](_0x281f16[_0xc9ee('0x3e')],qs[_0xc9ee('0x43')](_0x3cd276[_0xc9ee('0x44')][_0xc9ee('0x43')]));_0x4ab2a0['attributes']=_0x4ab2a0[_0xc9ee('0x42')][_0xc9ee('0x54')]?_0x4ab2a0[_0xc9ee('0x42')]:_0x281f16[_0xc9ee('0x3e')];_0x4ab2a0['order']=qs[_0xc9ee('0x48')](_0x3cd276['query'][_0xc9ee('0x48')]);_0x4ab2a0[_0xc9ee('0x49')]=qs[_0xc9ee('0x40')](_[_0xc9ee('0x4a')](_0x3cd276['query'],_0x281f16[_0xc9ee('0x40')]));if(_0x3cd276['query'][_0xc9ee('0x4b')]){_0x4ab2a0[_0xc9ee('0x49')]=_[_0xc9ee('0x4c')](_0x4ab2a0[_0xc9ee('0x49')],{'$or':_[_0xc9ee('0x3b')](_0x4ab2a0[_0xc9ee('0x42')],function(_0xafabe6){var _0x1b2c54={};_0x1b2c54[_0xafabe6]={'$like':'%'+_0x3cd276[_0xc9ee('0x44')]['filter']+'%'};return _0x1b2c54;})});}_0x4ab2a0=_[_0xc9ee('0x4c')]({},_0x4ab2a0,_0x3cd276[_0xc9ee('0x55')]);return _0x571084[_0xc9ee('0x59')](_0x4ab2a0);}})[_0xc9ee('0x21')](function(_0x185428){if(_0x185428){_0x3cafd4=_0x185428[_0xc9ee('0x54')];if(!_0x3cd276[_0xc9ee('0x44')][_0xc9ee('0x45')](_0xc9ee('0x46'))){_0x4ab2a0['limit']=qs[_0xc9ee('0x47')](_0x3cd276['query']['limit']);_0x4ab2a0[_0xc9ee('0x30')]=qs['offset'](_0x3cd276[_0xc9ee('0x44')][_0xc9ee('0x30')]);}return _0x571084[_0xc9ee('0x59')](_0x4ab2a0);}})[_0xc9ee('0x21')](function(_0x2037ea){if(_0x2037ea){return _0x2037ea?{'count':_0x3cafd4,'rows':_0x2037ea}:null;}})['then'](respondWithResult(_0x10fc03,null))[_0xc9ee('0x52')](handleError(_0x10fc03,null));};exports[_0xc9ee('0x5d')]=function(_0x200556,_0x4fa97b,_0x5b228b){if(_0x200556[_0xc9ee('0x58')]['id']){delete _0x200556[_0xc9ee('0x58')]['id'];}return db['FreshdeskAccount'][_0xc9ee('0x5a')]({'where':{'id':_0x200556[_0xc9ee('0x53')]['id']}})['then'](handleEntityNotFound(_0x4fa97b,null))[_0xc9ee('0x21')](function(_0x2ef150){if(_0x2ef150){_0x200556['body']['AccountId']=_0x2ef150['id'];_0x200556[_0xc9ee('0x58')][_0xc9ee('0x5e')]=integrations[_0xc9ee('0x5f')](_0x200556[_0xc9ee('0x58')][_0xc9ee('0x60')],_0x200556['body'][_0xc9ee('0x61')]);_0x200556[_0xc9ee('0x58')][_0xc9ee('0x62')]=integrations[_0xc9ee('0x63')](_0x200556['body']['channel'],_0x200556[_0xc9ee('0x58')][_0xc9ee('0x61')]);return db[_0xc9ee('0x5b')][_0xc9ee('0x57')](_0x200556[_0xc9ee('0x58')],{'include':[{'model':db['FreshdeskField'],'as':_0xc9ee('0x5e')},{'model':db[_0xc9ee('0x64')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4fa97b,null))[_0xc9ee('0x52')](handleError(_0x4fa97b,null));};exports['getFields']=function(_0x33a031,_0x2da6ec,_0x561a60){var _0xe4964a='';return db[_0xc9ee('0x4f')]['findOne']({'where':{'id':_0x33a031['params']['id']},'attributes':['id',_0xc9ee('0x65'),'apiKey']})['then'](handleEntityNotFound(_0x2da6ec,null))['then'](function(_0x59c25d){if(_0x59c25d){_0xe4964a=_0x59c25d[_0xc9ee('0x65')];var _0x5b7fc9=_0xe4964a['slice'](-0x1);if(_0x5b7fc9==='/'){_0xe4964a=_0xe4964a['substring'](0x0,_0xe4964a[_0xc9ee('0x66')](_0x5b7fc9));}return rp({'method':_0xc9ee('0x67'),'uri':util['format'](_0xc9ee('0x68'),_0xe4964a,_0xc9ee('0x69')),'headers':{'Authorization':util['format'](_0xc9ee('0x6a'),new Buffer(util[_0xc9ee('0x6b')](_0xc9ee('0x6c'),_0x59c25d[_0xc9ee('0x6d')]))[_0xc9ee('0x6e')](_0xc9ee('0x6f')))},'json':!![]});}})[_0xc9ee('0x21')](function(_0x3cc9cf){if(_0x3cc9cf){var _0x5487f8=[_0xc9ee('0x70'),'subject','agent',_0xc9ee('0x71'),_0xc9ee('0x2d'),'priority','group','source',_0xc9ee('0x72'),'group',_0xc9ee('0x73')];_[_0xc9ee('0x74')](_0x3cc9cf,function(_0x5515f0){return _0x5487f8[_0xc9ee('0x75')](_0x5515f0[_0xc9ee('0x39')])||!_0x5515f0['default']&&_0x5515f0[_0xc9ee('0x61')]!==_0xc9ee('0x76')&&_0x5515f0[_0xc9ee('0x61')]!=='custom_dropdown';});return{'count':_0x3cc9cf[_0xc9ee('0x54')],'rows':_[_0xc9ee('0x3b')](_0x3cc9cf,function(_0x1011da){return{'id':_0x1011da[_0xc9ee('0x39')],'name':_0x1011da[_0xc9ee('0x77')],'custom':!_0x1011da[_0xc9ee('0x78')],'options':_0x1011da[_0xc9ee('0x79')]?_[_0xc9ee('0x3b')](_0x1011da[_0xc9ee('0x79')],function(_0x1b25e4){return{'name':_[_0xc9ee('0x7a')](_0x1b25e4),'value':_0x1b25e4};}):[]};})};}})[_0xc9ee('0x21')](respondWithResult(_0x2da6ec,null))[_0xc9ee('0x52')](function(_0x4ad63e){var _0x98c232=_0x33a031[_0xc9ee('0x44')]['test']?0x1f4:_0x4ad63e[_0xc9ee('0x7b')]||0x1f4;logger[_0xc9ee('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xc9ee('0x7c'),_0x98c232,JSON[_0xc9ee('0x27')](_0x4ad63e));delete _0x4ad63e[_0xc9ee('0x39')];if(_0x98c232===0x191){_0x98c232=0x190;}_0x2da6ec[_0xc9ee('0x2d')](_0x98c232)[_0xc9ee('0x3a')](_0x33a031[_0xc9ee('0x44')][_0xc9ee('0x1c')]?{'message':_0xc9ee('0x7d'),'statusCode':_0x4ad63e[_0xc9ee('0x7b')]}:_0x4ad63e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index f45f8af..3e29842 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 _0x8e75=['util','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8e75,0xb3));var _0x58e7=function(_0x156914,_0x271849){_0x156914=_0x156914-0x0;var _0x4c2321=_0x8e75[_0x156914];return _0x4c2321;};'use strict';var _=require(_0x58e7('0x0'));var util=require(_0x58e7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x58e7('0x2'));var BPromise=require(_0x58e7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58e7('0x4'));var rimraf=require(_0x58e7('0x5'));var config=require(_0x58e7('0x6'));var attributes=require(_0x58e7('0x7'));var integrations=require(_0x58e7('0x8'));module[_0x58e7('0x9')]=function(_0x5db044,_0x4ea9c2){return _0x5db044[_0x58e7('0xa')]('FreshdeskAccount',attributes,{'tableName':_0x58e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4d8=['api','moment','bluebird','request-promise','rimraf','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa4d8,0xb1));var _0x8a4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8a4d('0x0'));var util=require(_0x8a4d('0x1'));var logger=require(_0x8a4d('0x2'))(_0x8a4d('0x3'));var moment=require(_0x8a4d('0x4'));var BPromise=require(_0x8a4d('0x5'));var rp=require(_0x8a4d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a4d('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x8a4d('0x8')]=function(_0x5d27e9,_0x978265){return _0x5d27e9[_0x8a4d('0x9')](_0x8a4d('0xa'),attributes,{'tableName':_0x8a4d('0xb'),'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 c6a9bed..85d790c 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 _0x0e3f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','findAll','options','where','attributes','limit','include','map','model','GetFreshdeskAccount','catch','FreshdeskAccount','find','raw','ShowFreshdeskAccount','lodash','util','moment'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x0e3f,0xc9));var _0xf0e3=function(_0x3cfc34,_0x486def){_0x3cfc34=_0x3cfc34-0x0;var _0x4e4229=_0x0e3f[_0x3cfc34];return _0x4e4229;};'use strict';var _=require(_0xf0e3('0x0'));var util=require(_0xf0e3('0x1'));var moment=require(_0xf0e3('0x2'));var BPromise=require(_0xf0e3('0x3'));var rs=require(_0xf0e3('0x4'));var fs=require('fs');var Redis=require(_0xf0e3('0x5'));var db=require(_0xf0e3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0e3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf0e3('0x8')][_0xf0e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x197104,_0x27ecf1,_0x335340){return new BPromise(function(_0x27943b,_0x37b520){return client['request'](_0x197104,_0x335340)[_0xf0e3('0xa')](function(_0x3c3860){logger[_0xf0e3('0xb')](_0xf0e3('0xc'),_0x27ecf1,_0xf0e3('0xd'));logger[_0xf0e3('0xe')](_0xf0e3('0xf'),_0x27ecf1,_0xf0e3('0xd'),JSON[_0xf0e3('0x10')](_0x3c3860));if(_0x3c3860[_0xf0e3('0x11')]){if(_0x3c3860['error']['code']===0x1f4){logger[_0xf0e3('0x11')](_0xf0e3('0xc'),_0x27ecf1,_0x3c3860[_0xf0e3('0x11')][_0xf0e3('0x12')]);return _0x37b520(_0x3c3860['error'][_0xf0e3('0x12')]);}logger[_0xf0e3('0x11')](_0xf0e3('0xc'),_0x27ecf1,_0x3c3860[_0xf0e3('0x11')][_0xf0e3('0x12')]);return _0x27943b(_0x3c3860[_0xf0e3('0x11')][_0xf0e3('0x12')]);}else{logger['info'](_0xf0e3('0xc'),_0x27ecf1,_0xf0e3('0xd'));_0x27943b(_0x3c3860[_0xf0e3('0x13')][_0xf0e3('0x12')]);}})['catch'](function(_0x420ee2){logger[_0xf0e3('0x11')](_0xf0e3('0xc'),_0x27ecf1,_0x420ee2);_0x37b520(_0x420ee2);});});}exports['GetFreshdeskAccount']=function(_0x4f3ca2){var _0x568b63=this;return new Promise(function(_0x36b3a6,_0x4bff93){return db['FreshdeskAccount'][_0xf0e3('0x14')]({'raw':_0x4f3ca2[_0xf0e3('0x15')]?_0x4f3ca2[_0xf0e3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4f3ca2[_0xf0e3('0x15')]?_0x4f3ca2[_0xf0e3('0x15')][_0xf0e3('0x16')]||null:null,'attributes':_0x4f3ca2[_0xf0e3('0x15')]?_0x4f3ca2[_0xf0e3('0x15')][_0xf0e3('0x17')]||null:null,'limit':_0x4f3ca2['options']?_0x4f3ca2[_0xf0e3('0x15')][_0xf0e3('0x18')]||null:null,'include':_0x4f3ca2[_0xf0e3('0x15')]?_0x4f3ca2[_0xf0e3('0x15')][_0xf0e3('0x19')]?_[_0xf0e3('0x1a')](_0x4f3ca2[_0xf0e3('0x15')][_0xf0e3('0x19')],function(_0x143918){return{'model':db[_0x143918[_0xf0e3('0x1b')]],'as':_0x143918['as'],'attributes':_0x143918[_0xf0e3('0x17')],'include':_0x143918[_0xf0e3('0x19')]?_[_0xf0e3('0x1a')](_0x143918[_0xf0e3('0x19')],function(_0x9f0049){return{'model':db[_0x9f0049[_0xf0e3('0x1b')]],'as':_0x9f0049['as'],'attributes':_0x9f0049[_0xf0e3('0x17')],'include':_0x9f0049[_0xf0e3('0x19')]?_[_0xf0e3('0x1a')](_0x9f0049[_0xf0e3('0x19')],function(_0x2bbd6b){return{'model':db[_0x2bbd6b[_0xf0e3('0x1b')]],'as':_0x2bbd6b['as'],'attributes':_0x2bbd6b[_0xf0e3('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf0e3('0xa')](function(_0x1a74ab){logger['info']('GetFreshdeskAccount',_0x4f3ca2);logger['debug'](_0xf0e3('0x1c'),_0x4f3ca2,JSON['stringify'](_0x1a74ab));_0x36b3a6(_0x1a74ab);})[_0xf0e3('0x1d')](function(_0x155aa8){logger[_0xf0e3('0x11')](_0xf0e3('0x1c'),_0x155aa8[_0xf0e3('0x12')],_0x4f3ca2);_0x4bff93(_0x568b63[_0xf0e3('0x11')](0x1f4,_0x155aa8[_0xf0e3('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x46a715){var _0x116506=this;return new Promise(function(_0x68ca16,_0x426419){return db[_0xf0e3('0x1e')][_0xf0e3('0x1f')]({'raw':_0x46a715[_0xf0e3('0x15')]?_0x46a715[_0xf0e3('0x15')][_0xf0e3('0x20')]===undefined?!![]:![]:!![],'where':_0x46a715[_0xf0e3('0x15')]?_0x46a715['options'][_0xf0e3('0x16')]||null:null,'attributes':_0x46a715[_0xf0e3('0x15')]?_0x46a715['options'][_0xf0e3('0x17')]||null:null,'include':_0x46a715[_0xf0e3('0x15')]?_0x46a715[_0xf0e3('0x15')]['include']?_[_0xf0e3('0x1a')](_0x46a715[_0xf0e3('0x15')]['include'],function(_0x40e2a7){return{'model':db[_0x40e2a7['model']],'as':_0x40e2a7['as'],'attributes':_0x40e2a7[_0xf0e3('0x17')],'include':_0x40e2a7['include']?_[_0xf0e3('0x1a')](_0x40e2a7['include'],function(_0x43df90){return{'model':db[_0x43df90[_0xf0e3('0x1b')]],'as':_0x43df90['as'],'attributes':_0x43df90[_0xf0e3('0x17')],'include':_0x43df90[_0xf0e3('0x19')]?_[_0xf0e3('0x1a')](_0x43df90[_0xf0e3('0x19')],function(_0x49da6d){return{'model':db[_0x49da6d['model']],'as':_0x49da6d['as'],'attributes':_0x49da6d[_0xf0e3('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf0e3('0xa')](function(_0x2718f0){logger[_0xf0e3('0xb')]('ShowFreshdeskAccount',_0x46a715);logger[_0xf0e3('0xe')](_0xf0e3('0x21'),_0x46a715,JSON[_0xf0e3('0x10')](_0x2718f0));_0x68ca16(_0x2718f0);})[_0xf0e3('0x1d')](function(_0x113885){logger[_0xf0e3('0x11')](_0xf0e3('0x21'),_0x113885[_0xf0e3('0x12')],_0x46a715);_0x426419(_0x116506['error'](0x1f4,_0x113885['message']));});});}; \ No newline at end of file +var _0xab73=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','FreshdeskAccount','findAll','options','raw','where','attributes','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find'];(function(_0xe68347,_0xe4af9a){var _0x1ba617=function(_0x194a02){while(--_0x194a02){_0xe68347['push'](_0xe68347['shift']());}};_0x1ba617(++_0xe4af9a);}(_0xab73,0x1dc));var _0x3ab7=function(_0x11dc37,_0x382a70){_0x11dc37=_0x11dc37-0x0;var _0x204348=_0xab73[_0x11dc37];return _0x204348;};'use strict';var _=require('lodash');var util=require(_0x3ab7('0x0'));var moment=require(_0x3ab7('0x1'));var BPromise=require(_0x3ab7('0x2'));var rs=require(_0x3ab7('0x3'));var fs=require('fs');var Redis=require(_0x3ab7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ab7('0x5'));var logger=require(_0x3ab7('0x6'))('rpc');var config=require(_0x3ab7('0x7'));var jayson=require(_0x3ab7('0x8'));var client=jayson[_0x3ab7('0x9')][_0x3ab7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb67b70,_0x45c50e,_0x157d98){return new BPromise(function(_0x332518,_0x125433){return client[_0x3ab7('0xb')](_0xb67b70,_0x157d98)[_0x3ab7('0xc')](function(_0x464d24){logger[_0x3ab7('0xd')](_0x3ab7('0xe'),_0x45c50e,_0x3ab7('0xf'));logger[_0x3ab7('0x10')](_0x3ab7('0x11'),_0x45c50e,'request\x20sent',JSON[_0x3ab7('0x12')](_0x464d24));if(_0x464d24[_0x3ab7('0x13')]){if(_0x464d24['error']['code']===0x1f4){logger['error'](_0x3ab7('0xe'),_0x45c50e,_0x464d24[_0x3ab7('0x13')][_0x3ab7('0x14')]);return _0x125433(_0x464d24[_0x3ab7('0x13')]['message']);}logger[_0x3ab7('0x13')](_0x3ab7('0xe'),_0x45c50e,_0x464d24[_0x3ab7('0x13')][_0x3ab7('0x14')]);return _0x332518(_0x464d24[_0x3ab7('0x13')][_0x3ab7('0x14')]);}else{logger[_0x3ab7('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x45c50e,_0x3ab7('0xf'));_0x332518(_0x464d24['result']['message']);}})[_0x3ab7('0x15')](function(_0x3abf5b){logger['error'](_0x3ab7('0xe'),_0x45c50e,_0x3abf5b);_0x125433(_0x3abf5b);});});}exports['GetFreshdeskAccount']=function(_0x362937){var _0x2fc555=this;return new Promise(function(_0x29844e,_0x503239){return db[_0x3ab7('0x16')][_0x3ab7('0x17')]({'raw':_0x362937[_0x3ab7('0x18')]?_0x362937[_0x3ab7('0x18')][_0x3ab7('0x19')]===undefined?!![]:![]:!![],'where':_0x362937[_0x3ab7('0x18')]?_0x362937[_0x3ab7('0x18')][_0x3ab7('0x1a')]||null:null,'attributes':_0x362937[_0x3ab7('0x18')]?_0x362937[_0x3ab7('0x18')][_0x3ab7('0x1b')]||null:null,'limit':_0x362937[_0x3ab7('0x18')]?_0x362937[_0x3ab7('0x18')]['limit']||null:null,'include':_0x362937['options']?_0x362937[_0x3ab7('0x18')][_0x3ab7('0x1c')]?_[_0x3ab7('0x1d')](_0x362937[_0x3ab7('0x18')][_0x3ab7('0x1c')],function(_0x447534){return{'model':db[_0x447534['model']],'as':_0x447534['as'],'attributes':_0x447534[_0x3ab7('0x1b')],'include':_0x447534[_0x3ab7('0x1c')]?_['map'](_0x447534[_0x3ab7('0x1c')],function(_0x29424c){return{'model':db[_0x29424c[_0x3ab7('0x1e')]],'as':_0x29424c['as'],'attributes':_0x29424c[_0x3ab7('0x1b')],'include':_0x29424c['include']?_[_0x3ab7('0x1d')](_0x29424c[_0x3ab7('0x1c')],function(_0x81f496){return{'model':db[_0x81f496['model']],'as':_0x81f496['as'],'attributes':_0x81f496[_0x3ab7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3ab7('0xc')](function(_0x7af442){logger[_0x3ab7('0xd')](_0x3ab7('0x1f'),_0x362937);logger[_0x3ab7('0x10')](_0x3ab7('0x1f'),_0x362937,JSON['stringify'](_0x7af442));_0x29844e(_0x7af442);})[_0x3ab7('0x15')](function(_0x431728){logger['error'](_0x3ab7('0x1f'),_0x431728[_0x3ab7('0x14')],_0x362937);_0x503239(_0x2fc555['error'](0x1f4,_0x431728[_0x3ab7('0x14')]));});});};exports[_0x3ab7('0x20')]=function(_0x350e18){var _0xa38e56=this;return new Promise(function(_0x4224ee,_0x54cf04){return db['FreshdeskAccount'][_0x3ab7('0x21')]({'raw':_0x350e18['options']?_0x350e18[_0x3ab7('0x18')][_0x3ab7('0x19')]===undefined?!![]:![]:!![],'where':_0x350e18[_0x3ab7('0x18')]?_0x350e18[_0x3ab7('0x18')][_0x3ab7('0x1a')]||null:null,'attributes':_0x350e18[_0x3ab7('0x18')]?_0x350e18[_0x3ab7('0x18')][_0x3ab7('0x1b')]||null:null,'include':_0x350e18[_0x3ab7('0x18')]?_0x350e18[_0x3ab7('0x18')][_0x3ab7('0x1c')]?_[_0x3ab7('0x1d')](_0x350e18['options'][_0x3ab7('0x1c')],function(_0x2715ca){return{'model':db[_0x2715ca[_0x3ab7('0x1e')]],'as':_0x2715ca['as'],'attributes':_0x2715ca[_0x3ab7('0x1b')],'include':_0x2715ca[_0x3ab7('0x1c')]?_[_0x3ab7('0x1d')](_0x2715ca[_0x3ab7('0x1c')],function(_0x277950){return{'model':db[_0x277950[_0x3ab7('0x1e')]],'as':_0x277950['as'],'attributes':_0x277950[_0x3ab7('0x1b')],'include':_0x277950[_0x3ab7('0x1c')]?_[_0x3ab7('0x1d')](_0x277950[_0x3ab7('0x1c')],function(_0xce43b3){return{'model':db[_0xce43b3[_0x3ab7('0x1e')]],'as':_0xce43b3['as'],'attributes':_0xce43b3['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ab7('0xc')](function(_0xfa2f11){logger['info'](_0x3ab7('0x20'),_0x350e18);logger[_0x3ab7('0x10')](_0x3ab7('0x20'),_0x350e18,JSON[_0x3ab7('0x12')](_0xfa2f11));_0x4224ee(_0xfa2f11);})[_0x3ab7('0x15')](function(_0x29c968){logger[_0x3ab7('0x13')](_0x3ab7('0x20'),_0x29c968[_0x3ab7('0x14')],_0x350e18);_0x54cf04(_0xa38e56['error'](0x1f4,_0x29c968[_0x3ab7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 600b66a..a94f4bd 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 _0x1614=['getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','show','getFields','get'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x1614,0x16a));var _0x4161=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1614[_0x494d1f];return _0x457b6e;};'use strict';var multer=require('multer');var util=require(_0x4161('0x0'));var path=require('path');var timeout=require(_0x4161('0x1'));var express=require(_0x4161('0x2'));var router=express[_0x4161('0x3')]();var auth=require(_0x4161('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4161('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x4161('0x6')](),controller[_0x4161('0x7')]);router['get'](_0x4161('0x8'),auth[_0x4161('0x6')](),controller[_0x4161('0x9')]);router['get']('/:id/fields',auth[_0x4161('0x6')](),controller[_0x4161('0xa')]);router[_0x4161('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x4161('0xc')]);router[_0x4161('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x4161('0xd')]);router[_0x4161('0xb')](_0x4161('0xe'),auth[_0x4161('0x6')](),controller[_0x4161('0xf')]);router[_0x4161('0x10')]('/',auth[_0x4161('0x6')](),controller[_0x4161('0x11')]);router[_0x4161('0x10')](_0x4161('0xe'),auth[_0x4161('0x6')](),controller[_0x4161('0x12')]);router['put'](_0x4161('0x8'),auth[_0x4161('0x6')](),controller[_0x4161('0x13')]);router[_0x4161('0x14')]('/:id',auth[_0x4161('0x6')](),controller['destroy']);module[_0x4161('0x15')]=router; \ No newline at end of file +var _0xb022=['update','delete','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','/:id'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb022,0x75));var _0x2b02=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb022[_0x187ee1];return _0x388160;};'use strict';var multer=require('multer');var util=require(_0x2b02('0x0'));var path=require('path');var timeout=require(_0x2b02('0x1'));var express=require(_0x2b02('0x2'));var router=express['Router']();var auth=require(_0x2b02('0x3'));var interaction=require(_0x2b02('0x4'));var config=require(_0x2b02('0x5'));var controller=require(_0x2b02('0x6'));router[_0x2b02('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x2b02('0x8')](),controller[_0x2b02('0x9')]);router[_0x2b02('0x7')]('/:id/fields',auth[_0x2b02('0x8')](),controller[_0x2b02('0xa')]);router[_0x2b02('0x7')](_0x2b02('0xb'),auth[_0x2b02('0x8')](),controller[_0x2b02('0xc')]);router[_0x2b02('0x7')](_0x2b02('0xd'),auth[_0x2b02('0x8')](),controller[_0x2b02('0xe')]);router[_0x2b02('0x7')](_0x2b02('0xf'),auth['isAuthenticated'](),controller[_0x2b02('0x10')]);router['post']('/',auth[_0x2b02('0x8')](),controller[_0x2b02('0x11')]);router[_0x2b02('0x12')]('/:id/tags',auth['isAuthenticated'](),controller[_0x2b02('0x13')]);router['put'](_0x2b02('0x14'),auth[_0x2b02('0x8')](),controller[_0x2b02('0x15')]);router[_0x2b02('0x16')](_0x2b02('0x14'),auth[_0x2b02('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 6beddce..fbb0e63 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 _0x2d2d=['sequelize','STRING'];(function(_0x9e5539,_0x5d5817){var _0x230d21=function(_0x5f9982){while(--_0x5f9982){_0x9e5539['push'](_0x9e5539['shift']());}};_0x230d21(++_0x5d5817);}(_0x2d2d,0x1d6));var _0xd2d2=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2d2d[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0xd2d2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd2d2('0x1')]}}; \ No newline at end of file +var _0x0df0=['exports','STRING','sequelize'];(function(_0xbcd8d9,_0x16451e){var _0x4e7d8f=function(_0x1f198a){while(--_0x1f198a){_0xbcd8d9['push'](_0xbcd8d9['shift']());}};_0x4e7d8f(++_0x16451e);}(_0x0df0,0x143));var _0x00df=function(_0x2deb2b,_0x35f4e5){_0x2deb2b=_0x2deb2b-0x0;var _0x5836a0=_0x0df0[_0x2deb2b];return _0x5836a0;};'use strict';var Sequelize=require(_0x00df('0x0'));module[_0x00df('0x1')]={'name':{'type':Sequelize[_0x00df('0x2')]},'description':{'type':Sequelize[_0x00df('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 1321a0d..d5823e6 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 _0xe9ab=['findOne','FreshdeskField','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','setTags','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','limit','set','Content-Range','json','reject','save','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','offset','order','sort','filter','where','VIRTUAL','merge','options','FreshdeskConfiguration','includeAll','include','findAll','params','find','create','body','update','destroy','getFields'];(function(_0x42eb9d,_0xc372c4){var _0x2bbe80=function(_0x54d132){while(--_0x54d132){_0x42eb9d['push'](_0x42eb9d['shift']());}};_0x2bbe80(++_0xc372c4);}(_0xe9ab,0xc3));var _0xbe9a=function(_0x3128fd,_0x4fdcb7){_0x3128fd=_0x3128fd-0x0;var _0x238387=_0xe9ab[_0x3128fd];return _0x238387;};'use strict';var pdf=require(_0xbe9a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbe9a('0x1'));var zipdir=require(_0xbe9a('0x2'));var jsonpatch=require(_0xbe9a('0x3'));var rp=require(_0xbe9a('0x4'));var moment=require(_0xbe9a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbe9a('0x6'));var util=require(_0xbe9a('0x7'));var path=require('path');var sox=require(_0xbe9a('0x8'));var csv=require(_0xbe9a('0x9'));var ejs=require(_0xbe9a('0xa'));var fs=require('fs');var _=require(_0xbe9a('0xb'));var squel=require(_0xbe9a('0xc'));var crypto=require(_0xbe9a('0xd'));var jsforce=require(_0xbe9a('0xe'));var deskjs=require(_0xbe9a('0xf'));var toCsv=require(_0xbe9a('0x9'));var querystring=require('querystring');var Papa=require(_0xbe9a('0x10'));var Redis=require(_0xbe9a('0x11'));var authService=require(_0xbe9a('0x12'));var qs=require(_0xbe9a('0x13'));var as=require(_0xbe9a('0x14'));var hardwareService=require(_0xbe9a('0x15'));var logger=require(_0xbe9a('0x16'))('api');var utils=require(_0xbe9a('0x17'));var config=require('../../config/environment');var db=require(_0xbe9a('0x18'))['db'];var jayson=require(_0xbe9a('0x19'));var client=jayson[_0xbe9a('0x1a')][_0xbe9a('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x22aeae,_0x42117d,_0x361db6){if(_0x361db6){var _0x58f46a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58f46a['test'](_0x42117d)){return _0x22aeae;}else{throw new db['Sequelize'][(_0xbe9a('0x1c'))](_0xbe9a('0x1d'));}}else{return _0x22aeae;}}function respondWithRpcPromise(_0x3987ee,_0x506290,_0x4c088e,_0x27b9a6){return new BPromise(function(_0x2a1987,_0x236d25){var _0x26b49a=_0x27b9a6||client;return _0x26b49a[_0xbe9a('0x1e')](_0x3987ee,_0x4c088e)[_0xbe9a('0x1f')](function(_0x3eec0e){logger['info'](_0xbe9a('0x20'),_0x506290,_0xbe9a('0x21'));logger[_0xbe9a('0x22')](_0xbe9a('0x23'),_0x506290,_0xbe9a('0x21'),JSON[_0xbe9a('0x24')](_0x3eec0e));if(_0x3eec0e[_0xbe9a('0x25')]){if(_0x3eec0e[_0xbe9a('0x25')]['code']===0x1f4){logger['error'](_0xbe9a('0x20'),_0x506290,_0x3eec0e[_0xbe9a('0x25')][_0xbe9a('0x26')]);return _0x236d25(_0x3eec0e[_0xbe9a('0x25')][_0xbe9a('0x26')]);}logger['error'](_0xbe9a('0x20'),_0x506290,_0x3eec0e[_0xbe9a('0x25')][_0xbe9a('0x26')]);return _0x2a1987(_0x3eec0e[_0xbe9a('0x25')][_0xbe9a('0x26')]);}else{logger['info'](_0xbe9a('0x20'),_0x506290,'request\x20sent');_0x2a1987(_0x3eec0e[_0xbe9a('0x27')][_0xbe9a('0x26')]);}})[_0xbe9a('0x28')](function(_0x4c287e){logger[_0xbe9a('0x25')](_0xbe9a('0x20'),_0x506290,_0x4c287e);_0x236d25(_0x4c287e);});});}function respondWithStatusCode(_0x133a63,_0x5c1182){_0x5c1182=_0x5c1182||0xcc;return function(_0x5570bf){if(_0x5570bf){return _0x133a63[_0xbe9a('0x29')](_0x5c1182);}return _0x133a63[_0xbe9a('0x2a')](_0x5c1182)[_0xbe9a('0x2b')]();};}function respondWithResult(_0x3adb3d,_0x587cb7){_0x587cb7=_0x587cb7||0xc8;return function(_0x54f0ae){if(_0x54f0ae){return _0x3adb3d[_0xbe9a('0x2a')](_0x587cb7)['json'](_0x54f0ae);}};}function respondWithFilteredResult(_0x2b2812,_0x48ecb3){return function(_0x377884){if(_0x377884){var _0x19cd2b=_0x377884['count'],_0x532399=_0x48ecb3['offset'],_0x55b628=_0x48ecb3['offset']+_0x48ecb3[_0xbe9a('0x2c')],_0x2e4cd5;if(_0x55b628>=_0x19cd2b){_0x55b628=_0x19cd2b;_0x2e4cd5=0xc8;}else{_0x2e4cd5=0xce;}_0x2b2812[_0xbe9a('0x2a')](_0x2e4cd5);return _0x2b2812[_0xbe9a('0x2d')](_0xbe9a('0x2e'),_0x532399+'-'+_0x55b628+'/'+_0x19cd2b)[_0xbe9a('0x2f')](_0x377884);}return null;};}function patchUpdates(_0x25a200){return function(_0x129aea){try{jsonpatch['apply'](_0x129aea,_0x25a200,!![]);}catch(_0x1e9c0e){return BPromise[_0xbe9a('0x30')](_0x1e9c0e);}return _0x129aea[_0xbe9a('0x31')]();};}function saveUpdates(_0x3c1be7,_0x4784c0){return function(_0xf17604){if(_0xf17604){return _0xf17604['update'](_0x3c1be7)[_0xbe9a('0x1f')](function(_0x1319d9){return _0x1319d9;});}return null;};}function removeEntity(_0x330198,_0x352c0a){return function(_0x58afd9){if(_0x58afd9){return _0x58afd9['destroy']()['then'](function(){_0x330198['status'](0xcc)[_0xbe9a('0x2b')]();});}};}function handleEntityNotFound(_0x8d985f,_0x26e0e6){return function(_0x1fbd1b){if(!_0x1fbd1b){_0x8d985f['sendStatus'](0x194);}return _0x1fbd1b;};}function handleError(_0xc6d51d,_0x2ac98c){_0x2ac98c=_0x2ac98c||0x1f4;return function(_0x4e3987){logger['error'](_0x4e3987[_0xbe9a('0x32')]);if(_0x4e3987[_0xbe9a('0x33')]){delete _0x4e3987[_0xbe9a('0x33')];}_0xc6d51d[_0xbe9a('0x2a')](_0x2ac98c)[_0xbe9a('0x34')](_0x4e3987);};}exports[_0xbe9a('0x35')]=function(_0x424c3c,_0x31ac10){var _0x58f473={},_0x2a3e62={},_0x4a7323={'count':0x0,'rows':[]};var _0xbd779d=_[_0xbe9a('0x36')](db['FreshdeskConfiguration'][_0xbe9a('0x37')],function(_0x3b2bcf){return{'name':_0x3b2bcf['fieldName'],'type':_0x3b2bcf['type'][_0xbe9a('0x38')]};});_0x2a3e62[_0xbe9a('0x39')]=_[_0xbe9a('0x36')](_0xbd779d,_0xbe9a('0x33'));_0x2a3e62[_0xbe9a('0x3a')]=_[_0xbe9a('0x3b')](_0x424c3c[_0xbe9a('0x3a')]);_0x2a3e62[_0xbe9a('0x3c')]=_[_0xbe9a('0x3d')](_0x2a3e62[_0xbe9a('0x39')],_0x2a3e62['query']);_0x58f473['attributes']=_[_0xbe9a('0x3d')](_0x2a3e62[_0xbe9a('0x39')],qs[_0xbe9a('0x3e')](_0x424c3c[_0xbe9a('0x3a')][_0xbe9a('0x3e')]));_0x58f473[_0xbe9a('0x3f')]=_0x58f473['attributes'][_0xbe9a('0x40')]?_0x58f473[_0xbe9a('0x3f')]:_0x2a3e62[_0xbe9a('0x39')];if(!_0x424c3c['query']['hasOwnProperty']('nolimit')){_0x58f473[_0xbe9a('0x2c')]=qs[_0xbe9a('0x2c')](_0x424c3c[_0xbe9a('0x3a')][_0xbe9a('0x2c')]);_0x58f473[_0xbe9a('0x41')]=qs[_0xbe9a('0x41')](_0x424c3c[_0xbe9a('0x3a')][_0xbe9a('0x41')]);}_0x58f473[_0xbe9a('0x42')]=qs[_0xbe9a('0x43')](_0x424c3c['query']['sort']);_0x58f473['where']=qs['filters'](_['pick'](_0x424c3c[_0xbe9a('0x3a')],_0x2a3e62[_0xbe9a('0x3c')]));if(_0x424c3c[_0xbe9a('0x3a')][_0xbe9a('0x44')]){_0x58f473[_0xbe9a('0x45')]=_['merge'](_0x58f473[_0xbe9a('0x45')],{'$or':_[_0xbe9a('0x36')](_0xbd779d,function(_0x23cec1){if(_0x23cec1['type']!==_0xbe9a('0x46')){var _0x41c135={};_0x41c135[_0x23cec1[_0xbe9a('0x33')]]={'$like':'%'+_0x424c3c['query'][_0xbe9a('0x44')]+'%'};return _0x41c135;}})});}_0x58f473=_[_0xbe9a('0x47')]({},_0x58f473,_0x424c3c[_0xbe9a('0x48')]);var _0x533d33={'where':_0x58f473[_0xbe9a('0x45')]};return db[_0xbe9a('0x49')]['count'](_0x533d33)['then'](function(_0x29e45c){_0x4a7323['count']=_0x29e45c;if(_0x424c3c[_0xbe9a('0x3a')][_0xbe9a('0x4a')]){_0x58f473[_0xbe9a('0x4b')]=[{'all':!![]}];}return db[_0xbe9a('0x49')][_0xbe9a('0x4c')](_0x58f473);})[_0xbe9a('0x1f')](function(_0x1c3a10){_0x4a7323['rows']=_0x1c3a10;return _0x4a7323;})[_0xbe9a('0x1f')](respondWithFilteredResult(_0x31ac10,_0x58f473))[_0xbe9a('0x28')](handleError(_0x31ac10,null));};exports['show']=function(_0x287936,_0x226399){var _0x3a04ef={'raw':![],'where':{'id':_0x287936[_0xbe9a('0x4d')]['id']}},_0x2b677c={};_0x2b677c['model']=_[_0xbe9a('0x3b')](db[_0xbe9a('0x49')][_0xbe9a('0x37')]);_0x2b677c[_0xbe9a('0x3a')]=_[_0xbe9a('0x3b')](_0x287936[_0xbe9a('0x3a')]);_0x2b677c[_0xbe9a('0x3c')]=_[_0xbe9a('0x3d')](_0x2b677c[_0xbe9a('0x39')],_0x2b677c[_0xbe9a('0x3a')]);_0x3a04ef[_0xbe9a('0x3f')]=_[_0xbe9a('0x3d')](_0x2b677c['model'],qs[_0xbe9a('0x3e')](_0x287936[_0xbe9a('0x3a')][_0xbe9a('0x3e')]));_0x3a04ef[_0xbe9a('0x3f')]=_0x3a04ef[_0xbe9a('0x3f')][_0xbe9a('0x40')]?_0x3a04ef[_0xbe9a('0x3f')]:_0x2b677c[_0xbe9a('0x39')];if(_0x287936['query'][_0xbe9a('0x4a')]){_0x3a04ef['include']=[{'all':!![]}];}_0x3a04ef=_[_0xbe9a('0x47')]({},_0x3a04ef,_0x287936[_0xbe9a('0x48')]);return db['FreshdeskConfiguration'][_0xbe9a('0x4e')](_0x3a04ef)[_0xbe9a('0x1f')](handleEntityNotFound(_0x226399,null))[_0xbe9a('0x1f')](respondWithResult(_0x226399,null))[_0xbe9a('0x28')](handleError(_0x226399,null));};exports[_0xbe9a('0x4f')]=function(_0x20237b,_0x3d29fe){return db[_0xbe9a('0x49')]['create'](_0x20237b[_0xbe9a('0x50')],{})[_0xbe9a('0x1f')](respondWithResult(_0x3d29fe,0xc9))['catch'](handleError(_0x3d29fe,null));};exports[_0xbe9a('0x51')]=function(_0x1e577c,_0x545d59){if(_0x1e577c[_0xbe9a('0x50')]['id']){delete _0x1e577c[_0xbe9a('0x50')]['id'];}return db[_0xbe9a('0x49')]['find']({'where':{'id':_0x1e577c['params']['id']}})['then'](handleEntityNotFound(_0x545d59,null))[_0xbe9a('0x1f')](saveUpdates(_0x1e577c['body'],null))['then'](respondWithResult(_0x545d59,null))[_0xbe9a('0x28')](handleError(_0x545d59,null));};exports[_0xbe9a('0x52')]=function(_0x13322a,_0x3f15aa){return db[_0xbe9a('0x49')][_0xbe9a('0x4e')]({'where':{'id':_0x13322a[_0xbe9a('0x4d')]['id']}})[_0xbe9a('0x1f')](handleEntityNotFound(_0x3f15aa,null))[_0xbe9a('0x1f')](removeEntity(_0x3f15aa,null))[_0xbe9a('0x28')](handleError(_0x3f15aa,null));};exports[_0xbe9a('0x53')]=function(_0x371402,_0x18dd8c,_0x300065){var _0x413fbd={};var _0x1c5630={};var _0x3b8e9e;var _0x35e153;return db[_0xbe9a('0x49')][_0xbe9a('0x54')]({'where':{'id':_0x371402[_0xbe9a('0x4d')]['id']}})[_0xbe9a('0x1f')](handleEntityNotFound(_0x18dd8c,null))[_0xbe9a('0x1f')](function(_0x19fa00){if(_0x19fa00){_0x3b8e9e=_0x19fa00;_0x1c5630[_0xbe9a('0x39')]=_[_0xbe9a('0x3b')](db[_0xbe9a('0x55')][_0xbe9a('0x37')]);_0x1c5630['query']=_[_0xbe9a('0x3b')](_0x371402['query']);_0x1c5630['filters']=_[_0xbe9a('0x3d')](_0x1c5630[_0xbe9a('0x39')],_0x1c5630[_0xbe9a('0x3a')]);_0x413fbd[_0xbe9a('0x3f')]=_[_0xbe9a('0x3d')](_0x1c5630[_0xbe9a('0x39')],qs[_0xbe9a('0x3e')](_0x371402[_0xbe9a('0x3a')][_0xbe9a('0x3e')]));_0x413fbd[_0xbe9a('0x3f')]=_0x413fbd[_0xbe9a('0x3f')][_0xbe9a('0x40')]?_0x413fbd['attributes']:_0x1c5630['model'];_0x413fbd[_0xbe9a('0x42')]=qs[_0xbe9a('0x43')](_0x371402[_0xbe9a('0x3a')][_0xbe9a('0x43')]);_0x413fbd[_0xbe9a('0x45')]=qs['filters'](_[_0xbe9a('0x56')](_0x371402[_0xbe9a('0x3a')],_0x1c5630[_0xbe9a('0x3c')]));if(_0x371402['query'][_0xbe9a('0x44')]){_0x413fbd['where']=_[_0xbe9a('0x47')](_0x413fbd[_0xbe9a('0x45')],{'$or':_['map'](_0x413fbd['attributes'],function(_0x2eabd3){var _0x548acb={};_0x548acb[_0x2eabd3]={'$like':'%'+_0x371402[_0xbe9a('0x3a')]['filter']+'%'};return _0x548acb;})});}_0x413fbd=_[_0xbe9a('0x47')]({},_0x413fbd,_0x371402['options']);return _0x3b8e9e[_0xbe9a('0x53')](_0x413fbd);}})[_0xbe9a('0x1f')](function(_0x56ffdf){if(_0x56ffdf){_0x35e153=_0x56ffdf[_0xbe9a('0x40')];if(!_0x371402[_0xbe9a('0x3a')][_0xbe9a('0x57')](_0xbe9a('0x58'))){_0x413fbd[_0xbe9a('0x2c')]=qs[_0xbe9a('0x2c')](_0x371402['query'][_0xbe9a('0x2c')]);_0x413fbd[_0xbe9a('0x41')]=qs[_0xbe9a('0x41')](_0x371402[_0xbe9a('0x3a')][_0xbe9a('0x41')]);}return _0x3b8e9e[_0xbe9a('0x53')](_0x413fbd);}})[_0xbe9a('0x1f')](function(_0x2c140a){if(_0x2c140a){return _0x2c140a?{'count':_0x35e153,'rows':_0x2c140a}:null;}})[_0xbe9a('0x1f')](respondWithResult(_0x18dd8c,null))[_0xbe9a('0x28')](handleError(_0x18dd8c,null));};exports[_0xbe9a('0x59')]=function(_0x3499e1,_0x989d37,_0xff7929){var _0x9a634f={};var _0x4cb2f8={};var _0x7f1c7;var _0x42b094;return db[_0xbe9a('0x49')]['findOne']({'where':{'id':_0x3499e1[_0xbe9a('0x4d')]['id']}})[_0xbe9a('0x1f')](handleEntityNotFound(_0x989d37,null))[_0xbe9a('0x1f')](function(_0x3e98b3){if(_0x3e98b3){_0x7f1c7=_0x3e98b3;_0x4cb2f8[_0xbe9a('0x39')]=_[_0xbe9a('0x3b')](db[_0xbe9a('0x55')][_0xbe9a('0x37')]);_0x4cb2f8[_0xbe9a('0x3a')]=_[_0xbe9a('0x3b')](_0x3499e1[_0xbe9a('0x3a')]);_0x4cb2f8['filters']=_[_0xbe9a('0x3d')](_0x4cb2f8[_0xbe9a('0x39')],_0x4cb2f8[_0xbe9a('0x3a')]);_0x9a634f['attributes']=_[_0xbe9a('0x3d')](_0x4cb2f8['model'],qs['fields'](_0x3499e1[_0xbe9a('0x3a')][_0xbe9a('0x3e')]));_0x9a634f[_0xbe9a('0x3f')]=_0x9a634f[_0xbe9a('0x3f')][_0xbe9a('0x40')]?_0x9a634f['attributes']:_0x4cb2f8['model'];_0x9a634f['order']=qs[_0xbe9a('0x43')](_0x3499e1[_0xbe9a('0x3a')][_0xbe9a('0x43')]);_0x9a634f[_0xbe9a('0x45')]=qs['filters'](_[_0xbe9a('0x56')](_0x3499e1[_0xbe9a('0x3a')],_0x4cb2f8[_0xbe9a('0x3c')]));if(_0x3499e1[_0xbe9a('0x3a')]['filter']){_0x9a634f[_0xbe9a('0x45')]=_[_0xbe9a('0x47')](_0x9a634f[_0xbe9a('0x45')],{'$or':_['map'](_0x9a634f[_0xbe9a('0x3f')],function(_0x1e13fd){var _0x3f0c13={};_0x3f0c13[_0x1e13fd]={'$like':'%'+_0x3499e1['query']['filter']+'%'};return _0x3f0c13;})});}_0x9a634f=_[_0xbe9a('0x47')]({},_0x9a634f,_0x3499e1[_0xbe9a('0x48')]);return _0x7f1c7[_0xbe9a('0x59')](_0x9a634f);}})[_0xbe9a('0x1f')](function(_0x4ed5ea){if(_0x4ed5ea){_0x42b094=_0x4ed5ea[_0xbe9a('0x40')];if(!_0x3499e1['query'][_0xbe9a('0x57')]('nolimit')){_0x9a634f[_0xbe9a('0x2c')]=qs[_0xbe9a('0x2c')](_0x3499e1['query'][_0xbe9a('0x2c')]);_0x9a634f[_0xbe9a('0x41')]=qs[_0xbe9a('0x41')](_0x3499e1['query'][_0xbe9a('0x41')]);}return _0x7f1c7[_0xbe9a('0x59')](_0x9a634f);}})['then'](function(_0x419d45){if(_0x419d45){return _0x419d45?{'count':_0x42b094,'rows':_0x419d45}:null;}})['then'](respondWithResult(_0x989d37,null))[_0xbe9a('0x28')](handleError(_0x989d37,null));};exports[_0xbe9a('0x5a')]=function(_0x16e79b,_0x547abc,_0x29ce40){var _0x31a8d6={};var _0x55d3a6={};var _0x1d8c14;var _0x1cc246;return db[_0xbe9a('0x49')]['findOne']({'where':{'id':_0x16e79b['params']['id']}})[_0xbe9a('0x1f')](handleEntityNotFound(_0x547abc,null))[_0xbe9a('0x1f')](function(_0x2844db){if(_0x2844db){_0x1d8c14=_0x2844db;_0x55d3a6[_0xbe9a('0x39')]=_[_0xbe9a('0x3b')](db[_0xbe9a('0x55')][_0xbe9a('0x37')]);_0x55d3a6[_0xbe9a('0x3a')]=_[_0xbe9a('0x3b')](_0x16e79b[_0xbe9a('0x3a')]);_0x55d3a6[_0xbe9a('0x3c')]=_['intersection'](_0x55d3a6['model'],_0x55d3a6['query']);_0x31a8d6['attributes']=_[_0xbe9a('0x3d')](_0x55d3a6[_0xbe9a('0x39')],qs[_0xbe9a('0x3e')](_0x16e79b['query'][_0xbe9a('0x3e')]));_0x31a8d6[_0xbe9a('0x3f')]=_0x31a8d6[_0xbe9a('0x3f')][_0xbe9a('0x40')]?_0x31a8d6[_0xbe9a('0x3f')]:_0x55d3a6[_0xbe9a('0x39')];_0x31a8d6['order']=qs['sort'](_0x16e79b['query'][_0xbe9a('0x43')]);_0x31a8d6['where']=qs[_0xbe9a('0x3c')](_['pick'](_0x16e79b[_0xbe9a('0x3a')],_0x55d3a6[_0xbe9a('0x3c')]));if(_0x16e79b[_0xbe9a('0x3a')][_0xbe9a('0x44')]){_0x31a8d6[_0xbe9a('0x45')]=_[_0xbe9a('0x47')](_0x31a8d6[_0xbe9a('0x45')],{'$or':_[_0xbe9a('0x36')](_0x31a8d6[_0xbe9a('0x3f')],function(_0x2c2a57){var _0x272233={};_0x272233[_0x2c2a57]={'$like':'%'+_0x16e79b[_0xbe9a('0x3a')]['filter']+'%'};return _0x272233;})});}_0x31a8d6=_[_0xbe9a('0x47')]({},_0x31a8d6,_0x16e79b[_0xbe9a('0x48')]);return _0x1d8c14[_0xbe9a('0x5a')](_0x31a8d6);}})[_0xbe9a('0x1f')](function(_0x5dcef6){if(_0x5dcef6){_0x1cc246=_0x5dcef6[_0xbe9a('0x40')];if(!_0x16e79b[_0xbe9a('0x3a')][_0xbe9a('0x57')](_0xbe9a('0x58'))){_0x31a8d6[_0xbe9a('0x2c')]=qs[_0xbe9a('0x2c')](_0x16e79b[_0xbe9a('0x3a')][_0xbe9a('0x2c')]);_0x31a8d6[_0xbe9a('0x41')]=qs[_0xbe9a('0x41')](_0x16e79b[_0xbe9a('0x3a')]['offset']);}return _0x1d8c14[_0xbe9a('0x5a')](_0x31a8d6);}})['then'](function(_0x4bf726){if(_0x4bf726){return _0x4bf726?{'count':_0x1cc246,'rows':_0x4bf726}:null;}})[_0xbe9a('0x1f')](respondWithResult(_0x547abc,null))[_0xbe9a('0x28')](handleError(_0x547abc,null));};exports[_0xbe9a('0x5b')]=function(_0x5a7dab,_0x2b623b,_0x15382b){var _0x3d2916={};var _0x4f10da={};var _0x15f3b8;var _0x352b6f;return db[_0xbe9a('0x49')][_0xbe9a('0x54')]({'where':{'id':_0x5a7dab[_0xbe9a('0x4d')]['id']}})[_0xbe9a('0x1f')](handleEntityNotFound(_0x2b623b,null))[_0xbe9a('0x1f')](function(_0x4dfbee){if(_0x4dfbee){_0x15f3b8=_0x4dfbee;_0x4f10da['model']=_[_0xbe9a('0x3b')](db['Tag'][_0xbe9a('0x37')]);_0x4f10da[_0xbe9a('0x3a')]=_[_0xbe9a('0x3b')](_0x5a7dab[_0xbe9a('0x3a')]);_0x4f10da[_0xbe9a('0x3c')]=_[_0xbe9a('0x3d')](_0x4f10da[_0xbe9a('0x39')],_0x4f10da[_0xbe9a('0x3a')]);_0x3d2916[_0xbe9a('0x3f')]=_[_0xbe9a('0x3d')](_0x4f10da[_0xbe9a('0x39')],qs[_0xbe9a('0x3e')](_0x5a7dab['query'][_0xbe9a('0x3e')]));_0x3d2916[_0xbe9a('0x3f')]=_0x3d2916['attributes'][_0xbe9a('0x40')]?_0x3d2916[_0xbe9a('0x3f')]:_0x4f10da['model'];_0x3d2916['order']=qs[_0xbe9a('0x43')](_0x5a7dab[_0xbe9a('0x3a')][_0xbe9a('0x43')]);_0x3d2916[_0xbe9a('0x45')]=qs[_0xbe9a('0x3c')](_[_0xbe9a('0x56')](_0x5a7dab[_0xbe9a('0x3a')],_0x4f10da[_0xbe9a('0x3c')]));if(_0x5a7dab[_0xbe9a('0x3a')]['filter']){_0x3d2916[_0xbe9a('0x45')]=_[_0xbe9a('0x47')](_0x3d2916[_0xbe9a('0x45')],{'$or':_['map'](_0x3d2916[_0xbe9a('0x3f')],function(_0x5ccfa9){var _0x36afed={};_0x36afed[_0x5ccfa9]={'$like':'%'+_0x5a7dab[_0xbe9a('0x3a')]['filter']+'%'};return _0x36afed;})});}_0x3d2916=_['merge']({},_0x3d2916,_0x5a7dab[_0xbe9a('0x48')]);return _0x15f3b8[_0xbe9a('0x5b')](_0x3d2916);}})[_0xbe9a('0x1f')](function(_0x48e74d){if(_0x48e74d){_0x352b6f=_0x48e74d[_0xbe9a('0x40')];if(!_0x5a7dab[_0xbe9a('0x3a')][_0xbe9a('0x57')](_0xbe9a('0x58'))){_0x3d2916[_0xbe9a('0x2c')]=qs[_0xbe9a('0x2c')](_0x5a7dab['query'][_0xbe9a('0x2c')]);_0x3d2916['offset']=qs[_0xbe9a('0x41')](_0x5a7dab[_0xbe9a('0x3a')]['offset']);}return _0x15f3b8[_0xbe9a('0x5b')](_0x3d2916);}})[_0xbe9a('0x1f')](function(_0x40011e){if(_0x40011e){return _0x40011e?{'count':_0x352b6f,'rows':_0x40011e}:null;}})[_0xbe9a('0x1f')](respondWithResult(_0x2b623b,null))[_0xbe9a('0x28')](handleError(_0x2b623b,null));};exports[_0xbe9a('0x5c')]=function(_0x4fe71d,_0x49f654,_0x3d1a43){if(_0x4fe71d[_0xbe9a('0x50')]['id']){delete _0x4fe71d[_0xbe9a('0x50')]['id'];}return db['FreshdeskConfiguration'][_0xbe9a('0x54')]({'where':{'id':_0x4fe71d[_0xbe9a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x49f654,null))['then'](function(_0x5e28c5){if(_0x5e28c5){return _0x5e28c5[_0xbe9a('0x5c')](_0x4fe71d[_0xbe9a('0x50')]['ids']||[]);}return null;})[_0xbe9a('0x1f')](respondWithResult(_0x49f654,null))['catch'](handleError(_0x49f654,null));}; \ No newline at end of file +var _0x6a47=['intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','include','findAll','rows','includeAll','options','find','create','body','params','destroy','getFields','findOne','nolimit','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','sendStatus','stack','name','send','FreshdeskConfiguration','rawAttributes','fieldName','model','map','query','keys','filters'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x6a47,0x84));var _0x76a4=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6a47[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0x76a4('0x0'));var emlformat=require(_0x76a4('0x1'));var rimraf=require(_0x76a4('0x2'));var zipdir=require(_0x76a4('0x3'));var jsonpatch=require(_0x76a4('0x4'));var rp=require(_0x76a4('0x5'));var moment=require(_0x76a4('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x76a4('0x7'));var util=require(_0x76a4('0x8'));var path=require(_0x76a4('0x9'));var sox=require(_0x76a4('0xa'));var csv=require(_0x76a4('0xb'));var ejs=require(_0x76a4('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x76a4('0xd'));var crypto=require(_0x76a4('0xe'));var jsforce=require(_0x76a4('0xf'));var deskjs=require(_0x76a4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x76a4('0x11'));var Papa=require(_0x76a4('0x12'));var Redis=require(_0x76a4('0x13'));var authService=require(_0x76a4('0x14'));var qs=require(_0x76a4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76a4('0x16'));var logger=require(_0x76a4('0x17'))(_0x76a4('0x18'));var utils=require(_0x76a4('0x19'));var config=require(_0x76a4('0x1a'));var db=require(_0x76a4('0x1b'))['db'];var jayson=require(_0x76a4('0x1c'));var client=jayson[_0x76a4('0x1d')][_0x76a4('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x56b800,_0x2ff0fd,_0x118a53){if(_0x118a53){var _0x1260d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1260d0[_0x76a4('0x1f')](_0x2ff0fd)){return _0x56b800;}else{throw new db['Sequelize'][(_0x76a4('0x20'))](_0x76a4('0x21'));}}else{return _0x56b800;}}function respondWithRpcPromise(_0x18e422,_0x2f70e2,_0x962263,_0x2cfed3){return new BPromise(function(_0x25e50c,_0x11b558){var _0xec4933=_0x2cfed3||client;return _0xec4933[_0x76a4('0x22')](_0x18e422,_0x962263)[_0x76a4('0x23')](function(_0x1cfc51){logger[_0x76a4('0x24')](_0x76a4('0x25'),_0x2f70e2,_0x76a4('0x26'));logger['debug'](_0x76a4('0x27'),_0x2f70e2,_0x76a4('0x26'),JSON[_0x76a4('0x28')](_0x1cfc51));if(_0x1cfc51[_0x76a4('0x29')]){if(_0x1cfc51[_0x76a4('0x29')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2f70e2,_0x1cfc51[_0x76a4('0x29')][_0x76a4('0x2a')]);return _0x11b558(_0x1cfc51[_0x76a4('0x29')][_0x76a4('0x2a')]);}logger[_0x76a4('0x29')](_0x76a4('0x25'),_0x2f70e2,_0x1cfc51['error'][_0x76a4('0x2a')]);return _0x25e50c(_0x1cfc51[_0x76a4('0x29')][_0x76a4('0x2a')]);}else{logger[_0x76a4('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2f70e2,_0x76a4('0x26'));_0x25e50c(_0x1cfc51[_0x76a4('0x2b')]['message']);}})[_0x76a4('0x2c')](function(_0x31eed1){logger[_0x76a4('0x29')](_0x76a4('0x25'),_0x2f70e2,_0x31eed1);_0x11b558(_0x31eed1);});});}function respondWithStatusCode(_0xe11f8f,_0x2ccc18){_0x2ccc18=_0x2ccc18||0xcc;return function(_0x1481ba){if(_0x1481ba){return _0xe11f8f['sendStatus'](_0x2ccc18);}return _0xe11f8f[_0x76a4('0x2d')](_0x2ccc18)[_0x76a4('0x2e')]();};}function respondWithResult(_0x145f2c,_0x114fbe){_0x114fbe=_0x114fbe||0xc8;return function(_0x1aaf5b){if(_0x1aaf5b){return _0x145f2c[_0x76a4('0x2d')](_0x114fbe)[_0x76a4('0x2f')](_0x1aaf5b);}};}function respondWithFilteredResult(_0x1217d5,_0x430e4a){return function(_0x5bb5b1){if(_0x5bb5b1){var _0x59c759=_0x5bb5b1[_0x76a4('0x30')],_0x16f343=_0x430e4a[_0x76a4('0x31')],_0x1d36dc=_0x430e4a[_0x76a4('0x31')]+_0x430e4a[_0x76a4('0x32')],_0x4c0230;if(_0x1d36dc>=_0x59c759){_0x1d36dc=_0x59c759;_0x4c0230=0xc8;}else{_0x4c0230=0xce;}_0x1217d5['status'](_0x4c0230);return _0x1217d5[_0x76a4('0x33')](_0x76a4('0x34'),_0x16f343+'-'+_0x1d36dc+'/'+_0x59c759)[_0x76a4('0x2f')](_0x5bb5b1);}return null;};}function patchUpdates(_0x1c7361){return function(_0x75d98c){try{jsonpatch[_0x76a4('0x35')](_0x75d98c,_0x1c7361,!![]);}catch(_0x119e43){return BPromise[_0x76a4('0x36')](_0x119e43);}return _0x75d98c['save']();};}function saveUpdates(_0x21cf7e,_0x4f0935){return function(_0x1cfcc8){if(_0x1cfcc8){return _0x1cfcc8[_0x76a4('0x37')](_0x21cf7e)['then'](function(_0x4763d3){return _0x4763d3;});}return null;};}function removeEntity(_0x4dd10d,_0x26526b){return function(_0x2257da){if(_0x2257da){return _0x2257da['destroy']()['then'](function(){_0x4dd10d[_0x76a4('0x2d')](0xcc)[_0x76a4('0x2e')]();});}};}function handleEntityNotFound(_0x3839d8,_0x514ed1){return function(_0xaddd0f){if(!_0xaddd0f){_0x3839d8[_0x76a4('0x38')](0x194);}return _0xaddd0f;};}function handleError(_0x5844f2,_0x3989e1){_0x3989e1=_0x3989e1||0x1f4;return function(_0x28327f){logger[_0x76a4('0x29')](_0x28327f[_0x76a4('0x39')]);if(_0x28327f[_0x76a4('0x3a')]){delete _0x28327f[_0x76a4('0x3a')];}_0x5844f2[_0x76a4('0x2d')](_0x3989e1)[_0x76a4('0x3b')](_0x28327f);};}exports['index']=function(_0x375593,_0xf39fc){var _0x5d63ee={},_0x4b3eee={},_0x2081d1={'count':0x0,'rows':[]};var _0x1c998e=_['map'](db[_0x76a4('0x3c')][_0x76a4('0x3d')],function(_0x209673){return{'name':_0x209673[_0x76a4('0x3e')],'type':_0x209673['type']['key']};});_0x4b3eee[_0x76a4('0x3f')]=_[_0x76a4('0x40')](_0x1c998e,'name');_0x4b3eee[_0x76a4('0x41')]=_[_0x76a4('0x42')](_0x375593['query']);_0x4b3eee[_0x76a4('0x43')]=_[_0x76a4('0x44')](_0x4b3eee[_0x76a4('0x3f')],_0x4b3eee['query']);_0x5d63ee[_0x76a4('0x45')]=_[_0x76a4('0x44')](_0x4b3eee[_0x76a4('0x3f')],qs[_0x76a4('0x46')](_0x375593[_0x76a4('0x41')][_0x76a4('0x46')]));_0x5d63ee[_0x76a4('0x45')]=_0x5d63ee[_0x76a4('0x45')][_0x76a4('0x47')]?_0x5d63ee[_0x76a4('0x45')]:_0x4b3eee[_0x76a4('0x3f')];if(!_0x375593[_0x76a4('0x41')][_0x76a4('0x48')]('nolimit')){_0x5d63ee[_0x76a4('0x32')]=qs[_0x76a4('0x32')](_0x375593[_0x76a4('0x41')][_0x76a4('0x32')]);_0x5d63ee[_0x76a4('0x31')]=qs['offset'](_0x375593[_0x76a4('0x41')][_0x76a4('0x31')]);}_0x5d63ee[_0x76a4('0x49')]=qs[_0x76a4('0x4a')](_0x375593[_0x76a4('0x41')]['sort']);_0x5d63ee[_0x76a4('0x4b')]=qs[_0x76a4('0x43')](_[_0x76a4('0x4c')](_0x375593[_0x76a4('0x41')],_0x4b3eee['filters']));if(_0x375593[_0x76a4('0x41')][_0x76a4('0x4d')]){_0x5d63ee['where']=_[_0x76a4('0x4e')](_0x5d63ee[_0x76a4('0x4b')],{'$or':_[_0x76a4('0x40')](_0x1c998e,function(_0x41271f){if(_0x41271f[_0x76a4('0x4f')]!=='VIRTUAL'){var _0x3c85e9={};_0x3c85e9[_0x41271f['name']]={'$like':'%'+_0x375593[_0x76a4('0x41')][_0x76a4('0x4d')]+'%'};return _0x3c85e9;}})});}_0x5d63ee=_[_0x76a4('0x4e')]({},_0x5d63ee,_0x375593['options']);var _0x270ffd={'where':_0x5d63ee[_0x76a4('0x4b')]};return db['FreshdeskConfiguration'][_0x76a4('0x30')](_0x270ffd)[_0x76a4('0x23')](function(_0x2c239d){_0x2081d1[_0x76a4('0x30')]=_0x2c239d;if(_0x375593[_0x76a4('0x41')]['includeAll']){_0x5d63ee[_0x76a4('0x50')]=[{'all':!![]}];}return db[_0x76a4('0x3c')][_0x76a4('0x51')](_0x5d63ee);})[_0x76a4('0x23')](function(_0xcbfdd7){_0x2081d1[_0x76a4('0x52')]=_0xcbfdd7;return _0x2081d1;})[_0x76a4('0x23')](respondWithFilteredResult(_0xf39fc,_0x5d63ee))[_0x76a4('0x2c')](handleError(_0xf39fc,null));};exports['show']=function(_0x4d3346,_0x56fff5){var _0x286b21={'raw':![],'where':{'id':_0x4d3346['params']['id']}},_0x2de7f2={};_0x2de7f2[_0x76a4('0x3f')]=_[_0x76a4('0x42')](db[_0x76a4('0x3c')][_0x76a4('0x3d')]);_0x2de7f2[_0x76a4('0x41')]=_[_0x76a4('0x42')](_0x4d3346['query']);_0x2de7f2['filters']=_['intersection'](_0x2de7f2[_0x76a4('0x3f')],_0x2de7f2['query']);_0x286b21[_0x76a4('0x45')]=_[_0x76a4('0x44')](_0x2de7f2[_0x76a4('0x3f')],qs['fields'](_0x4d3346[_0x76a4('0x41')][_0x76a4('0x46')]));_0x286b21[_0x76a4('0x45')]=_0x286b21['attributes']['length']?_0x286b21[_0x76a4('0x45')]:_0x2de7f2[_0x76a4('0x3f')];if(_0x4d3346[_0x76a4('0x41')][_0x76a4('0x53')]){_0x286b21[_0x76a4('0x50')]=[{'all':!![]}];}_0x286b21=_['merge']({},_0x286b21,_0x4d3346[_0x76a4('0x54')]);return db[_0x76a4('0x3c')][_0x76a4('0x55')](_0x286b21)[_0x76a4('0x23')](handleEntityNotFound(_0x56fff5,null))['then'](respondWithResult(_0x56fff5,null))[_0x76a4('0x2c')](handleError(_0x56fff5,null));};exports[_0x76a4('0x56')]=function(_0x503674,_0x371ed1){return db['FreshdeskConfiguration'][_0x76a4('0x56')](_0x503674[_0x76a4('0x57')],{})[_0x76a4('0x23')](respondWithResult(_0x371ed1,0xc9))[_0x76a4('0x2c')](handleError(_0x371ed1,null));};exports[_0x76a4('0x37')]=function(_0x50b03c,_0x1b7aa4){if(_0x50b03c[_0x76a4('0x57')]['id']){delete _0x50b03c[_0x76a4('0x57')]['id'];}return db[_0x76a4('0x3c')][_0x76a4('0x55')]({'where':{'id':_0x50b03c[_0x76a4('0x58')]['id']}})[_0x76a4('0x23')](handleEntityNotFound(_0x1b7aa4,null))[_0x76a4('0x23')](saveUpdates(_0x50b03c['body'],null))[_0x76a4('0x23')](respondWithResult(_0x1b7aa4,null))['catch'](handleError(_0x1b7aa4,null));};exports[_0x76a4('0x59')]=function(_0x53e390,_0x3607b4){return db[_0x76a4('0x3c')][_0x76a4('0x55')]({'where':{'id':_0x53e390[_0x76a4('0x58')]['id']}})['then'](handleEntityNotFound(_0x3607b4,null))['then'](removeEntity(_0x3607b4,null))[_0x76a4('0x2c')](handleError(_0x3607b4,null));};exports[_0x76a4('0x5a')]=function(_0x5e0aad,_0x1bbb46,_0x2e9d5e){var _0x2d5b58={};var _0x279443={};var _0x16623c;var _0x39ac31;return db[_0x76a4('0x3c')][_0x76a4('0x5b')]({'where':{'id':_0x5e0aad['params']['id']}})[_0x76a4('0x23')](handleEntityNotFound(_0x1bbb46,null))[_0x76a4('0x23')](function(_0x33e6a7){if(_0x33e6a7){_0x16623c=_0x33e6a7;_0x279443['model']=_[_0x76a4('0x42')](db['FreshdeskField'][_0x76a4('0x3d')]);_0x279443[_0x76a4('0x41')]=_[_0x76a4('0x42')](_0x5e0aad[_0x76a4('0x41')]);_0x279443['filters']=_[_0x76a4('0x44')](_0x279443[_0x76a4('0x3f')],_0x279443[_0x76a4('0x41')]);_0x2d5b58['attributes']=_[_0x76a4('0x44')](_0x279443[_0x76a4('0x3f')],qs['fields'](_0x5e0aad[_0x76a4('0x41')][_0x76a4('0x46')]));_0x2d5b58[_0x76a4('0x45')]=_0x2d5b58[_0x76a4('0x45')][_0x76a4('0x47')]?_0x2d5b58['attributes']:_0x279443['model'];_0x2d5b58[_0x76a4('0x49')]=qs[_0x76a4('0x4a')](_0x5e0aad['query'][_0x76a4('0x4a')]);_0x2d5b58[_0x76a4('0x4b')]=qs[_0x76a4('0x43')](_[_0x76a4('0x4c')](_0x5e0aad[_0x76a4('0x41')],_0x279443[_0x76a4('0x43')]));if(_0x5e0aad['query'][_0x76a4('0x4d')]){_0x2d5b58[_0x76a4('0x4b')]=_[_0x76a4('0x4e')](_0x2d5b58[_0x76a4('0x4b')],{'$or':_['map'](_0x2d5b58[_0x76a4('0x45')],function(_0x46662c){var _0x1b1456={};_0x1b1456[_0x46662c]={'$like':'%'+_0x5e0aad[_0x76a4('0x41')][_0x76a4('0x4d')]+'%'};return _0x1b1456;})});}_0x2d5b58=_['merge']({},_0x2d5b58,_0x5e0aad['options']);return _0x16623c['getFields'](_0x2d5b58);}})[_0x76a4('0x23')](function(_0x2f9d4f){if(_0x2f9d4f){_0x39ac31=_0x2f9d4f[_0x76a4('0x47')];if(!_0x5e0aad[_0x76a4('0x41')]['hasOwnProperty'](_0x76a4('0x5c'))){_0x2d5b58[_0x76a4('0x32')]=qs[_0x76a4('0x32')](_0x5e0aad['query'][_0x76a4('0x32')]);_0x2d5b58[_0x76a4('0x31')]=qs[_0x76a4('0x31')](_0x5e0aad['query'][_0x76a4('0x31')]);}return _0x16623c['getFields'](_0x2d5b58);}})['then'](function(_0x435de9){if(_0x435de9){return _0x435de9?{'count':_0x39ac31,'rows':_0x435de9}:null;}})[_0x76a4('0x23')](respondWithResult(_0x1bbb46,null))[_0x76a4('0x2c')](handleError(_0x1bbb46,null));};exports[_0x76a4('0x5d')]=function(_0x49981f,_0x15aceb,_0x5efc5c){var _0x3e8b07={};var _0x3b3556={};var _0x36bcaa;var _0x2cb021;return db['FreshdeskConfiguration'][_0x76a4('0x5b')]({'where':{'id':_0x49981f['params']['id']}})[_0x76a4('0x23')](handleEntityNotFound(_0x15aceb,null))[_0x76a4('0x23')](function(_0x5edd0c){if(_0x5edd0c){_0x36bcaa=_0x5edd0c;_0x3b3556['model']=_[_0x76a4('0x42')](db[_0x76a4('0x5e')]['rawAttributes']);_0x3b3556[_0x76a4('0x41')]=_[_0x76a4('0x42')](_0x49981f['query']);_0x3b3556[_0x76a4('0x43')]=_[_0x76a4('0x44')](_0x3b3556[_0x76a4('0x3f')],_0x3b3556['query']);_0x3e8b07[_0x76a4('0x45')]=_[_0x76a4('0x44')](_0x3b3556[_0x76a4('0x3f')],qs[_0x76a4('0x46')](_0x49981f[_0x76a4('0x41')][_0x76a4('0x46')]));_0x3e8b07[_0x76a4('0x45')]=_0x3e8b07['attributes'][_0x76a4('0x47')]?_0x3e8b07[_0x76a4('0x45')]:_0x3b3556['model'];_0x3e8b07[_0x76a4('0x49')]=qs[_0x76a4('0x4a')](_0x49981f[_0x76a4('0x41')][_0x76a4('0x4a')]);_0x3e8b07[_0x76a4('0x4b')]=qs['filters'](_[_0x76a4('0x4c')](_0x49981f[_0x76a4('0x41')],_0x3b3556['filters']));if(_0x49981f['query'][_0x76a4('0x4d')]){_0x3e8b07[_0x76a4('0x4b')]=_[_0x76a4('0x4e')](_0x3e8b07[_0x76a4('0x4b')],{'$or':_[_0x76a4('0x40')](_0x3e8b07[_0x76a4('0x45')],function(_0xd99640){var _0x1069d8={};_0x1069d8[_0xd99640]={'$like':'%'+_0x49981f[_0x76a4('0x41')][_0x76a4('0x4d')]+'%'};return _0x1069d8;})});}_0x3e8b07=_[_0x76a4('0x4e')]({},_0x3e8b07,_0x49981f['options']);return _0x36bcaa[_0x76a4('0x5d')](_0x3e8b07);}})['then'](function(_0x56e8a0){if(_0x56e8a0){_0x2cb021=_0x56e8a0['length'];if(!_0x49981f['query']['hasOwnProperty'](_0x76a4('0x5c'))){_0x3e8b07[_0x76a4('0x32')]=qs[_0x76a4('0x32')](_0x49981f[_0x76a4('0x41')][_0x76a4('0x32')]);_0x3e8b07[_0x76a4('0x31')]=qs[_0x76a4('0x31')](_0x49981f[_0x76a4('0x41')]['offset']);}return _0x36bcaa['getSubjects'](_0x3e8b07);}})[_0x76a4('0x23')](function(_0x4d316f){if(_0x4d316f){return _0x4d316f?{'count':_0x2cb021,'rows':_0x4d316f}:null;}})[_0x76a4('0x23')](respondWithResult(_0x15aceb,null))[_0x76a4('0x2c')](handleError(_0x15aceb,null));};exports[_0x76a4('0x5f')]=function(_0x30bb37,_0x2c023f,_0xf22a4b){var _0x4d5723={};var _0x4cce60={};var _0xc79c1f;var _0x58a808;return db[_0x76a4('0x3c')][_0x76a4('0x5b')]({'where':{'id':_0x30bb37[_0x76a4('0x58')]['id']}})[_0x76a4('0x23')](handleEntityNotFound(_0x2c023f,null))[_0x76a4('0x23')](function(_0x1619fe){if(_0x1619fe){_0xc79c1f=_0x1619fe;_0x4cce60['model']=_['keys'](db[_0x76a4('0x5e')]['rawAttributes']);_0x4cce60[_0x76a4('0x41')]=_[_0x76a4('0x42')](_0x30bb37[_0x76a4('0x41')]);_0x4cce60[_0x76a4('0x43')]=_['intersection'](_0x4cce60[_0x76a4('0x3f')],_0x4cce60['query']);_0x4d5723['attributes']=_[_0x76a4('0x44')](_0x4cce60[_0x76a4('0x3f')],qs['fields'](_0x30bb37[_0x76a4('0x41')][_0x76a4('0x46')]));_0x4d5723[_0x76a4('0x45')]=_0x4d5723['attributes']['length']?_0x4d5723[_0x76a4('0x45')]:_0x4cce60[_0x76a4('0x3f')];_0x4d5723[_0x76a4('0x49')]=qs[_0x76a4('0x4a')](_0x30bb37[_0x76a4('0x41')]['sort']);_0x4d5723[_0x76a4('0x4b')]=qs['filters'](_['pick'](_0x30bb37[_0x76a4('0x41')],_0x4cce60[_0x76a4('0x43')]));if(_0x30bb37['query']['filter']){_0x4d5723['where']=_[_0x76a4('0x4e')](_0x4d5723['where'],{'$or':_['map'](_0x4d5723[_0x76a4('0x45')],function(_0x527802){var _0x3d1cea={};_0x3d1cea[_0x527802]={'$like':'%'+_0x30bb37[_0x76a4('0x41')]['filter']+'%'};return _0x3d1cea;})});}_0x4d5723=_[_0x76a4('0x4e')]({},_0x4d5723,_0x30bb37[_0x76a4('0x54')]);return _0xc79c1f[_0x76a4('0x5f')](_0x4d5723);}})[_0x76a4('0x23')](function(_0x54150d){if(_0x54150d){_0x58a808=_0x54150d['length'];if(!_0x30bb37[_0x76a4('0x41')]['hasOwnProperty'](_0x76a4('0x5c'))){_0x4d5723['limit']=qs[_0x76a4('0x32')](_0x30bb37[_0x76a4('0x41')]['limit']);_0x4d5723[_0x76a4('0x31')]=qs[_0x76a4('0x31')](_0x30bb37[_0x76a4('0x41')][_0x76a4('0x31')]);}return _0xc79c1f[_0x76a4('0x5f')](_0x4d5723);}})[_0x76a4('0x23')](function(_0x4cc9f2){if(_0x4cc9f2){return _0x4cc9f2?{'count':_0x58a808,'rows':_0x4cc9f2}:null;}})[_0x76a4('0x23')](respondWithResult(_0x2c023f,null))[_0x76a4('0x2c')](handleError(_0x2c023f,null));};exports[_0x76a4('0x60')]=function(_0x53081f,_0x29c601,_0x73bcdc){var _0xbc669b={};var _0x11c622={};var _0x5b1f88;var _0x4628fe;return db[_0x76a4('0x3c')][_0x76a4('0x5b')]({'where':{'id':_0x53081f[_0x76a4('0x58')]['id']}})[_0x76a4('0x23')](handleEntityNotFound(_0x29c601,null))[_0x76a4('0x23')](function(_0x2f6e73){if(_0x2f6e73){_0x5b1f88=_0x2f6e73;_0x11c622['model']=_['keys'](db[_0x76a4('0x61')]['rawAttributes']);_0x11c622[_0x76a4('0x41')]=_[_0x76a4('0x42')](_0x53081f['query']);_0x11c622['filters']=_[_0x76a4('0x44')](_0x11c622[_0x76a4('0x3f')],_0x11c622[_0x76a4('0x41')]);_0xbc669b[_0x76a4('0x45')]=_['intersection'](_0x11c622[_0x76a4('0x3f')],qs[_0x76a4('0x46')](_0x53081f[_0x76a4('0x41')]['fields']));_0xbc669b['attributes']=_0xbc669b[_0x76a4('0x45')][_0x76a4('0x47')]?_0xbc669b[_0x76a4('0x45')]:_0x11c622[_0x76a4('0x3f')];_0xbc669b[_0x76a4('0x49')]=qs['sort'](_0x53081f[_0x76a4('0x41')][_0x76a4('0x4a')]);_0xbc669b[_0x76a4('0x4b')]=qs[_0x76a4('0x43')](_['pick'](_0x53081f[_0x76a4('0x41')],_0x11c622[_0x76a4('0x43')]));if(_0x53081f[_0x76a4('0x41')]['filter']){_0xbc669b[_0x76a4('0x4b')]=_[_0x76a4('0x4e')](_0xbc669b['where'],{'$or':_[_0x76a4('0x40')](_0xbc669b['attributes'],function(_0x3932a7){var _0x18f70c={};_0x18f70c[_0x3932a7]={'$like':'%'+_0x53081f[_0x76a4('0x41')][_0x76a4('0x4d')]+'%'};return _0x18f70c;})});}_0xbc669b=_[_0x76a4('0x4e')]({},_0xbc669b,_0x53081f[_0x76a4('0x54')]);return _0x5b1f88[_0x76a4('0x60')](_0xbc669b);}})[_0x76a4('0x23')](function(_0x112a80){if(_0x112a80){_0x4628fe=_0x112a80[_0x76a4('0x47')];if(!_0x53081f[_0x76a4('0x41')]['hasOwnProperty'](_0x76a4('0x5c'))){_0xbc669b[_0x76a4('0x32')]=qs['limit'](_0x53081f[_0x76a4('0x41')][_0x76a4('0x32')]);_0xbc669b['offset']=qs[_0x76a4('0x31')](_0x53081f[_0x76a4('0x41')]['offset']);}return _0x5b1f88[_0x76a4('0x60')](_0xbc669b);}})['then'](function(_0x20aedf){if(_0x20aedf){return _0x20aedf?{'count':_0x4628fe,'rows':_0x20aedf}:null;}})[_0x76a4('0x23')](respondWithResult(_0x29c601,null))[_0x76a4('0x2c')](handleError(_0x29c601,null));};exports[_0x76a4('0x62')]=function(_0x5233bb,_0x19ae62,_0x71cc93){if(_0x5233bb[_0x76a4('0x57')]['id']){delete _0x5233bb[_0x76a4('0x57')]['id'];}return db[_0x76a4('0x3c')][_0x76a4('0x5b')]({'where':{'id':_0x5233bb['params']['id']}})[_0x76a4('0x23')](handleEntityNotFound(_0x19ae62,null))['then'](function(_0x469d3b){if(_0x469d3b){return _0x469d3b[_0x76a4('0x62')](_0x5233bb[_0x76a4('0x57')][_0x76a4('0x63')]||[]);}return null;})[_0x76a4('0x23')](respondWithResult(_0x19ae62,null))['catch'](handleError(_0x19ae62,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 87e8595..a8e39a6 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 _0xbc75=['api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','util'];(function(_0x3e2d5f,_0x118dbc){var _0x3cbdbd=function(_0x2e2424){while(--_0x2e2424){_0x3e2d5f['push'](_0x3e2d5f['shift']());}};_0x3cbdbd(++_0x118dbc);}(_0xbc75,0x99));var _0x5bc7=function(_0x10c497,_0x3ec51b){_0x10c497=_0x10c497-0x0;var _0x2b67ae=_0xbc75[_0x10c497];return _0x2b67ae;};'use strict';var _=require('lodash');var util=require(_0x5bc7('0x0'));var logger=require('../../config/logger')(_0x5bc7('0x1'));var moment=require(_0x5bc7('0x2'));var BPromise=require(_0x5bc7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bc7('0x4'));var rimraf=require(_0x5bc7('0x5'));var config=require(_0x5bc7('0x6'));var attributes=require(_0x5bc7('0x7'));module[_0x5bc7('0x8')]=function(_0x2c054f,_0x2cab90){return _0x2c054f['define'](_0x5bc7('0x9'),attributes,{'tableName':_0x5bc7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda55=['../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x5bd91a,_0x460263){var _0x71eace=function(_0x3a36d2){while(--_0x3a36d2){_0x5bd91a['push'](_0x5bd91a['shift']());}};_0x71eace(++_0x460263);}(_0xda55,0x1d9));var _0x5da5=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0xda55[_0x39a2d6];return _0x23af66;};'use strict';var _=require('lodash');var util=require(_0x5da5('0x0'));var logger=require(_0x5da5('0x1'))(_0x5da5('0x2'));var moment=require(_0x5da5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require(_0x5da5('0x7'));var attributes=require(_0x5da5('0x8'));module['exports']=function(_0x3ff704,_0x3cc049){return _0x3ff704[_0x5da5('0x9')](_0x5da5('0xa'),attributes,{'tableName':_0x5da5('0xb'),'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 d89591a..42b2406 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 _0xb3f3=['message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5e48d8,_0x316d64){var _0x4c0e5f=function(_0x4d6dc3){while(--_0x4d6dc3){_0x5e48d8['push'](_0x5e48d8['shift']());}};_0x4c0e5f(++_0x316d64);}(_0xb3f3,0x145));var _0x3b3f=function(_0x128188,_0x418a16){_0x128188=_0x128188-0x0;var _0x4bc209=_0xb3f3[_0x128188];return _0x4bc209;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3b3f('0x0'));var BPromise=require('bluebird');var rs=require(_0x3b3f('0x1'));var fs=require('fs');var Redis=require(_0x3b3f('0x2'));var db=require(_0x3b3f('0x3'))['db'];var utils=require(_0x3b3f('0x4'));var logger=require(_0x3b3f('0x5'))(_0x3b3f('0x6'));var config=require('../../config/environment');var jayson=require(_0x3b3f('0x7'));var client=jayson[_0x3b3f('0x8')][_0x3b3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c9a17,_0x2b4b91,_0x24c20f){return new BPromise(function(_0x57799d,_0x2f74ae){return client[_0x3b3f('0xa')](_0x4c9a17,_0x24c20f)['then'](function(_0x53da66){logger['info'](_0x3b3f('0xb'),_0x2b4b91,'request\x20sent');logger[_0x3b3f('0xc')](_0x3b3f('0xd'),_0x2b4b91,_0x3b3f('0xe'),JSON[_0x3b3f('0xf')](_0x53da66));if(_0x53da66[_0x3b3f('0x10')]){if(_0x53da66[_0x3b3f('0x10')]['code']===0x1f4){logger[_0x3b3f('0x10')](_0x3b3f('0xb'),_0x2b4b91,_0x53da66[_0x3b3f('0x10')][_0x3b3f('0x11')]);return _0x2f74ae(_0x53da66[_0x3b3f('0x10')][_0x3b3f('0x11')]);}logger[_0x3b3f('0x10')](_0x3b3f('0xb'),_0x2b4b91,_0x53da66['error'][_0x3b3f('0x11')]);return _0x57799d(_0x53da66[_0x3b3f('0x10')]['message']);}else{logger['info'](_0x3b3f('0xb'),_0x2b4b91,_0x3b3f('0xe'));_0x57799d(_0x53da66[_0x3b3f('0x12')][_0x3b3f('0x11')]);}})['catch'](function(_0x856ca){logger['error'](_0x3b3f('0xb'),_0x2b4b91,_0x856ca);_0x2f74ae(_0x856ca);});});} \ No newline at end of file +var _0xc534=['request\x20sent','error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug'];(function(_0x4f843d,_0x21311a){var _0x4c5128=function(_0x2255f9){while(--_0x2255f9){_0x4f843d['push'](_0x4f843d['shift']());}};_0x4c5128(++_0x21311a);}(_0xc534,0x16e));var _0x4c53=function(_0x4ac743,_0x3fa20d){_0x4ac743=_0x4ac743-0x0;var _0x3e60a3=_0xc534[_0x4ac743];return _0x3e60a3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c53('0x0'));var BPromise=require('bluebird');var rs=require(_0x4c53('0x1'));var fs=require('fs');var Redis=require(_0x4c53('0x2'));var db=require(_0x4c53('0x3'))['db'];var utils=require(_0x4c53('0x4'));var logger=require('../../config/logger')(_0x4c53('0x5'));var config=require(_0x4c53('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4c53('0x7')][_0x4c53('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x375738,_0x70eb1f,_0x26d956){return new BPromise(function(_0x23a1ad,_0x4c0c64){return client[_0x4c53('0x9')](_0x375738,_0x26d956)[_0x4c53('0xa')](function(_0x1cdf19){logger[_0x4c53('0xb')](_0x4c53('0xc'),_0x70eb1f,'request\x20sent');logger[_0x4c53('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x70eb1f,_0x4c53('0xe'),JSON['stringify'](_0x1cdf19));if(_0x1cdf19[_0x4c53('0xf')]){if(_0x1cdf19['error'][_0x4c53('0x10')]===0x1f4){logger[_0x4c53('0xf')](_0x4c53('0xc'),_0x70eb1f,_0x1cdf19['error'][_0x4c53('0x11')]);return _0x4c0c64(_0x1cdf19[_0x4c53('0xf')]['message']);}logger[_0x4c53('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x70eb1f,_0x1cdf19['error'][_0x4c53('0x11')]);return _0x23a1ad(_0x1cdf19[_0x4c53('0xf')][_0x4c53('0x11')]);}else{logger[_0x4c53('0xb')](_0x4c53('0xc'),_0x70eb1f,'request\x20sent');_0x23a1ad(_0x1cdf19[_0x4c53('0x12')][_0x4c53('0x11')]);}})['catch'](function(_0x1ec70f){logger[_0x4c53('0xf')](_0x4c53('0xc'),_0x70eb1f,_0x1ec70f);_0x4c0c64(_0x1ec70f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 76b6c65..1d2fdcc 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x327bf7,_0x51fa34){var _0x1b5816=function(_0x46f490){while(--_0x46f490){_0x327bf7['push'](_0x327bf7['shift']());}};_0x1b5816(++_0x51fa34);}(_0x008c,0x188));var _0xc008=function(_0x3b584b,_0x39dc34){_0x3b584b=_0x3b584b-0x0;var _0x38559d=_0x008c[_0x3b584b];return _0x38559d;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file +var _0x3e74=['connect-timeout','express','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','multer','path'];(function(_0x28712b,_0x3b1cdc){var _0x53b450=function(_0x554077){while(--_0x554077){_0x28712b['push'](_0x28712b['shift']());}};_0x53b450(++_0x3b1cdc);}(_0x3e74,0x175));var _0x43e7=function(_0x3f903e,_0x1c78b4){_0x3f903e=_0x3f903e-0x0;var _0x422a1c=_0x3e74[_0x3f903e];return _0x422a1c;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['put'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0xd')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 7f86943..7e6e53d 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 _0x42b0=['exports','string','customVariable','STRING','ENUM','variable','sequelize'];(function(_0x3d3fa2,_0x104433){var _0x556091=function(_0x486910){while(--_0x486910){_0x3d3fa2['push'](_0x3d3fa2['shift']());}};_0x556091(++_0x104433);}(_0x42b0,0xbc));var _0x042b=function(_0x3b0b34,_0xe6a14f){_0x3b0b34=_0x3b0b34-0x0;var _0x5f5496=_0x42b0[_0x3b0b34];return _0x5f5496;};'use strict';var Sequelize=require(_0x042b('0x0'));module[_0x042b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x042b('0x2'),'variable',_0x042b('0x3'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x042b('0x4')]},'key':{'type':Sequelize[_0x042b('0x4')]},'keyType':{'type':Sequelize[_0x042b('0x5')](_0x042b('0x2'),_0x042b('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x042b('0x4')]},'nameField':{'type':Sequelize[_0x042b('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8569=['keyValue','STRING','customVariable','BOOLEAN','ENUM','string','variable'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x8569,0x14d));var _0x9856=function(_0x4e21ba,_0x18097f){_0x4e21ba=_0x4e21ba-0x0;var _0x55b94b=_0x8569[_0x4e21ba];return _0x55b94b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9856('0x0')](_0x9856('0x1'),_0x9856('0x2'),'customVariable',_0x9856('0x3')),'defaultValue':_0x9856('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9856('0x4')]},'keyType':{'type':Sequelize[_0x9856('0x0')](_0x9856('0x1'),_0x9856('0x2'),_0x9856('0x5'))},'keyContent':{'type':Sequelize[_0x9856('0x4')]},'idField':{'type':Sequelize[_0x9856('0x4')]},'nameField':{'type':Sequelize[_0x9856('0x4')]},'customField':{'type':Sequelize[_0x9856('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9856('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 283a20f..27e748a 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 _0xac62=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','stack','send','map','FreshdeskField','rawAttributes','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','show','params','include','find','create','body','catch','update','destroy','html-pdf','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse'];(function(_0x52c1e1,_0x5d4e83){var _0x25d937=function(_0x5ca63b){while(--_0x5ca63b){_0x52c1e1['push'](_0x52c1e1['shift']());}};_0x25d937(++_0x5d4e83);}(_0xac62,0x183));var _0x2ac6=function(_0x4ff30d,_0x822aa){_0x4ff30d=_0x4ff30d-0x0;var _0x15b604=_0xac62[_0x4ff30d];return _0x15b604;};'use strict';var pdf=require(_0x2ac6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2ac6('0x1'));var zipdir=require(_0x2ac6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ac6('0x3'));var moment=require(_0x2ac6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2ac6('0x5'));var path=require(_0x2ac6('0x6'));var sox=require(_0x2ac6('0x7'));var csv=require(_0x2ac6('0x8'));var ejs=require(_0x2ac6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2ac6('0xa'));var crypto=require(_0x2ac6('0xb'));var jsforce=require(_0x2ac6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2ac6('0x8'));var querystring=require(_0x2ac6('0xd'));var Papa=require(_0x2ac6('0xe'));var Redis=require(_0x2ac6('0xf'));var authService=require(_0x2ac6('0x10'));var qs=require(_0x2ac6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ac6('0x12'));var logger=require('../../config/logger')(_0x2ac6('0x13'));var utils=require('../../config/utils');var config=require(_0x2ac6('0x14'));var db=require(_0x2ac6('0x15'))['db'];function respondWithStatusCode(_0x3b909e,_0x27b631){_0x27b631=_0x27b631||0xcc;return function(_0x1be725){if(_0x1be725){return _0x3b909e['sendStatus'](_0x27b631);}return _0x3b909e[_0x2ac6('0x16')](_0x27b631)[_0x2ac6('0x17')]();};}function respondWithResult(_0x17cbba,_0x2adf45){_0x2adf45=_0x2adf45||0xc8;return function(_0x4ffd94){if(_0x4ffd94){return _0x17cbba[_0x2ac6('0x16')](_0x2adf45)[_0x2ac6('0x18')](_0x4ffd94);}};}function respondWithFilteredResult(_0x374bc1,_0x39ef74){return function(_0x2d47ee){if(_0x2d47ee){var _0x22afb2=_0x2d47ee[_0x2ac6('0x19')],_0x51e217=_0x39ef74[_0x2ac6('0x1a')],_0x3f89c4=_0x39ef74[_0x2ac6('0x1a')]+_0x39ef74[_0x2ac6('0x1b')],_0x2473c3;if(_0x3f89c4>=_0x22afb2){_0x3f89c4=_0x22afb2;_0x2473c3=0xc8;}else{_0x2473c3=0xce;}_0x374bc1[_0x2ac6('0x16')](_0x2473c3);return _0x374bc1[_0x2ac6('0x1c')](_0x2ac6('0x1d'),_0x51e217+'-'+_0x3f89c4+'/'+_0x22afb2)[_0x2ac6('0x18')](_0x2d47ee);}return null;};}function patchUpdates(_0x41261f){return function(_0x3ee5b3){try{jsonpatch['apply'](_0x3ee5b3,_0x41261f,!![]);}catch(_0x5224f9){return BPromise[_0x2ac6('0x1e')](_0x5224f9);}return _0x3ee5b3[_0x2ac6('0x1f')]();};}function saveUpdates(_0x3969da,_0x16a959){return function(_0x1e73b0){if(_0x1e73b0){return _0x1e73b0['update'](_0x3969da)[_0x2ac6('0x20')](function(_0x3e3761){return _0x3e3761;});}return null;};}function removeEntity(_0x14b2d2,_0x2a36d9){return function(_0x26c489){if(_0x26c489){return _0x26c489['destroy']()[_0x2ac6('0x20')](function(){_0x14b2d2[_0x2ac6('0x16')](0xcc)[_0x2ac6('0x17')]();});}};}function handleEntityNotFound(_0x3c4390,_0x4565cf){return function(_0x23c437){if(!_0x23c437){_0x3c4390['sendStatus'](0x194);}return _0x23c437;};}function handleError(_0x40d3ad,_0x16d40d){_0x16d40d=_0x16d40d||0x1f4;return function(_0x3026a3){logger['error'](_0x3026a3[_0x2ac6('0x21')]);if(_0x3026a3['name']){delete _0x3026a3['name'];}_0x40d3ad[_0x2ac6('0x16')](_0x16d40d)[_0x2ac6('0x22')](_0x3026a3);};}exports['index']=function(_0x4b749f,_0x3a6dbf){var _0x3e40e9={},_0xe6ce85={},_0x4f8e0c={'count':0x0,'rows':[]};var _0x568250=_[_0x2ac6('0x23')](db[_0x2ac6('0x24')][_0x2ac6('0x25')],function(_0x453954){return{'name':_0x453954['fieldName'],'type':_0x453954['type']['key']};});_0xe6ce85['model']=_[_0x2ac6('0x23')](_0x568250,'name');_0xe6ce85[_0x2ac6('0x26')]=_[_0x2ac6('0x27')](_0x4b749f[_0x2ac6('0x26')]);_0xe6ce85[_0x2ac6('0x28')]=_['intersection'](_0xe6ce85['model'],_0xe6ce85[_0x2ac6('0x26')]);_0x3e40e9[_0x2ac6('0x29')]=_[_0x2ac6('0x2a')](_0xe6ce85['model'],qs[_0x2ac6('0x2b')](_0x4b749f[_0x2ac6('0x26')][_0x2ac6('0x2b')]));_0x3e40e9[_0x2ac6('0x29')]=_0x3e40e9[_0x2ac6('0x29')][_0x2ac6('0x2c')]?_0x3e40e9[_0x2ac6('0x29')]:_0xe6ce85[_0x2ac6('0x2d')];if(!_0x4b749f['query'][_0x2ac6('0x2e')](_0x2ac6('0x2f'))){_0x3e40e9[_0x2ac6('0x1b')]=qs[_0x2ac6('0x1b')](_0x4b749f[_0x2ac6('0x26')][_0x2ac6('0x1b')]);_0x3e40e9[_0x2ac6('0x1a')]=qs['offset'](_0x4b749f[_0x2ac6('0x26')]['offset']);}_0x3e40e9[_0x2ac6('0x30')]=qs[_0x2ac6('0x31')](_0x4b749f['query']['sort']);_0x3e40e9[_0x2ac6('0x32')]=qs[_0x2ac6('0x28')](_['pick'](_0x4b749f[_0x2ac6('0x26')],_0xe6ce85[_0x2ac6('0x28')]));if(_0x4b749f['query']['filter']){_0x3e40e9['where']=_[_0x2ac6('0x33')](_0x3e40e9[_0x2ac6('0x32')],{'$or':_['map'](_0x568250,function(_0x28f9a4){if(_0x28f9a4[_0x2ac6('0x34')]!==_0x2ac6('0x35')){var _0x4ff8d3={};_0x4ff8d3[_0x28f9a4['name']]={'$like':'%'+_0x4b749f[_0x2ac6('0x26')][_0x2ac6('0x36')]+'%'};return _0x4ff8d3;}})});}_0x3e40e9=_['merge']({},_0x3e40e9,_0x4b749f['options']);var _0x3e2ede={'where':_0x3e40e9['where']};return db['FreshdeskField']['count'](_0x3e2ede)[_0x2ac6('0x20')](function(_0x8fea66){_0x4f8e0c['count']=_0x8fea66;if(_0x4b749f[_0x2ac6('0x26')][_0x2ac6('0x37')]){_0x3e40e9['include']=[{'all':!![]}];}return db[_0x2ac6('0x24')][_0x2ac6('0x38')](_0x3e40e9);})['then'](function(_0x5236d7){_0x4f8e0c[_0x2ac6('0x39')]=_0x5236d7;return _0x4f8e0c;})[_0x2ac6('0x20')](respondWithFilteredResult(_0x3a6dbf,_0x3e40e9))['catch'](handleError(_0x3a6dbf,null));};exports[_0x2ac6('0x3a')]=function(_0x512bef,_0x3bbe7f){var _0x84761f={'raw':!![],'where':{'id':_0x512bef[_0x2ac6('0x3b')]['id']}},_0x554aeb={};_0x554aeb['model']=_[_0x2ac6('0x27')](db['FreshdeskField'][_0x2ac6('0x25')]);_0x554aeb[_0x2ac6('0x26')]=_[_0x2ac6('0x27')](_0x512bef[_0x2ac6('0x26')]);_0x554aeb[_0x2ac6('0x28')]=_[_0x2ac6('0x2a')](_0x554aeb[_0x2ac6('0x2d')],_0x554aeb[_0x2ac6('0x26')]);_0x84761f[_0x2ac6('0x29')]=_[_0x2ac6('0x2a')](_0x554aeb[_0x2ac6('0x2d')],qs[_0x2ac6('0x2b')](_0x512bef['query']['fields']));_0x84761f[_0x2ac6('0x29')]=_0x84761f['attributes'][_0x2ac6('0x2c')]?_0x84761f['attributes']:_0x554aeb[_0x2ac6('0x2d')];if(_0x512bef[_0x2ac6('0x26')][_0x2ac6('0x37')]){_0x84761f[_0x2ac6('0x3c')]=[{'all':!![]}];}_0x84761f=_['merge']({},_0x84761f,_0x512bef['options']);return db[_0x2ac6('0x24')][_0x2ac6('0x3d')](_0x84761f)['then'](handleEntityNotFound(_0x3bbe7f,null))[_0x2ac6('0x20')](respondWithResult(_0x3bbe7f,null))['catch'](handleError(_0x3bbe7f,null));};exports[_0x2ac6('0x3e')]=function(_0x524eef,_0x344f2c){return db[_0x2ac6('0x24')]['create'](_0x524eef[_0x2ac6('0x3f')],{})[_0x2ac6('0x20')](respondWithResult(_0x344f2c,0xc9))[_0x2ac6('0x40')](handleError(_0x344f2c,null));};exports[_0x2ac6('0x41')]=function(_0x37fd81,_0x3335d1){if(_0x37fd81[_0x2ac6('0x3f')]['id']){delete _0x37fd81[_0x2ac6('0x3f')]['id'];}return db[_0x2ac6('0x24')][_0x2ac6('0x3d')]({'where':{'id':_0x37fd81[_0x2ac6('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3335d1,null))[_0x2ac6('0x20')](saveUpdates(_0x37fd81[_0x2ac6('0x3f')],null))[_0x2ac6('0x20')](respondWithResult(_0x3335d1,null))[_0x2ac6('0x40')](handleError(_0x3335d1,null));};exports[_0x2ac6('0x42')]=function(_0x41636a,_0x405255){return db['FreshdeskField'][_0x2ac6('0x3d')]({'where':{'id':_0x41636a[_0x2ac6('0x3b')]['id']}})['then'](handleEntityNotFound(_0x405255,null))[_0x2ac6('0x20')](removeEntity(_0x405255,null))[_0x2ac6('0x40')](handleError(_0x405255,null));}; \ No newline at end of file +var _0x4a6b=['save','update','then','destroy','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','map','query','keys','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','filter','count','include','findAll','rows','catch','show','params','fields','includeAll','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','reject'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4a6b,0xbd));var _0xb4a6=function(_0x32c022,_0x53de13){_0x32c022=_0x32c022-0x0;var _0x2918bb=_0x4a6b[_0x32c022];return _0x2918bb;};'use strict';var pdf=require(_0xb4a6('0x0'));var emlformat=require(_0xb4a6('0x1'));var rimraf=require(_0xb4a6('0x2'));var zipdir=require(_0xb4a6('0x3'));var jsonpatch=require(_0xb4a6('0x4'));var rp=require('request-promise');var moment=require(_0xb4a6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb4a6('0x6'));var util=require('util');var path=require(_0xb4a6('0x7'));var sox=require('sox');var csv=require(_0xb4a6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb4a6('0x9'));var squel=require(_0xb4a6('0xa'));var crypto=require(_0xb4a6('0xb'));var jsforce=require(_0xb4a6('0xc'));var deskjs=require(_0xb4a6('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb4a6('0xe'));var Papa=require(_0xb4a6('0xf'));var Redis=require(_0xb4a6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb4a6('0x11'));var hardwareService=require(_0xb4a6('0x12'));var logger=require(_0xb4a6('0x13'))(_0xb4a6('0x14'));var utils=require(_0xb4a6('0x15'));var config=require(_0xb4a6('0x16'));var db=require(_0xb4a6('0x17'))['db'];function respondWithStatusCode(_0x2be35b,_0x5e03a7){_0x5e03a7=_0x5e03a7||0xcc;return function(_0x52da58){if(_0x52da58){return _0x2be35b[_0xb4a6('0x18')](_0x5e03a7);}return _0x2be35b[_0xb4a6('0x19')](_0x5e03a7)[_0xb4a6('0x1a')]();};}function respondWithResult(_0x464558,_0x5e2adb){_0x5e2adb=_0x5e2adb||0xc8;return function(_0x49fdec){if(_0x49fdec){return _0x464558[_0xb4a6('0x19')](_0x5e2adb)['json'](_0x49fdec);}};}function respondWithFilteredResult(_0xccda0e,_0x447950){return function(_0x129a59){if(_0x129a59){var _0x1cc6e4=_0x129a59['count'],_0x3da6d9=_0x447950[_0xb4a6('0x1b')],_0x5cf6d8=_0x447950['offset']+_0x447950[_0xb4a6('0x1c')],_0x1aeb0e;if(_0x5cf6d8>=_0x1cc6e4){_0x5cf6d8=_0x1cc6e4;_0x1aeb0e=0xc8;}else{_0x1aeb0e=0xce;}_0xccda0e[_0xb4a6('0x19')](_0x1aeb0e);return _0xccda0e[_0xb4a6('0x1d')](_0xb4a6('0x1e'),_0x3da6d9+'-'+_0x5cf6d8+'/'+_0x1cc6e4)[_0xb4a6('0x1f')](_0x129a59);}return null;};}function patchUpdates(_0x447377){return function(_0x3606dc){try{jsonpatch['apply'](_0x3606dc,_0x447377,!![]);}catch(_0x2badb7){return BPromise[_0xb4a6('0x20')](_0x2badb7);}return _0x3606dc[_0xb4a6('0x21')]();};}function saveUpdates(_0x448fa7,_0x50420f){return function(_0x38a20e){if(_0x38a20e){return _0x38a20e[_0xb4a6('0x22')](_0x448fa7)[_0xb4a6('0x23')](function(_0x5751c6){return _0x5751c6;});}return null;};}function removeEntity(_0xad9b1d,_0x240449){return function(_0x503159){if(_0x503159){return _0x503159[_0xb4a6('0x24')]()['then'](function(){_0xad9b1d[_0xb4a6('0x19')](0xcc)[_0xb4a6('0x1a')]();});}};}function handleEntityNotFound(_0x3dcc2a,_0x3f05d4){return function(_0x2a4d64){if(!_0x2a4d64){_0x3dcc2a[_0xb4a6('0x18')](0x194);}return _0x2a4d64;};}function handleError(_0xbd39a7,_0x12cae3){_0x12cae3=_0x12cae3||0x1f4;return function(_0x4b4a22){logger['error'](_0x4b4a22[_0xb4a6('0x25')]);if(_0x4b4a22[_0xb4a6('0x26')]){delete _0x4b4a22[_0xb4a6('0x26')];}_0xbd39a7[_0xb4a6('0x19')](_0x12cae3)[_0xb4a6('0x27')](_0x4b4a22);};}exports[_0xb4a6('0x28')]=function(_0x369b45,_0x43dd9b){var _0x539bc7={},_0x1e5685={},_0x4b0efc={'count':0x0,'rows':[]};var _0x2fcf34=_['map'](db[_0xb4a6('0x29')][_0xb4a6('0x2a')],function(_0x40a9d5){return{'name':_0x40a9d5[_0xb4a6('0x2b')],'type':_0x40a9d5['type'][_0xb4a6('0x2c')]};});_0x1e5685['model']=_[_0xb4a6('0x2d')](_0x2fcf34,_0xb4a6('0x26'));_0x1e5685[_0xb4a6('0x2e')]=_[_0xb4a6('0x2f')](_0x369b45['query']);_0x1e5685['filters']=_[_0xb4a6('0x30')](_0x1e5685['model'],_0x1e5685['query']);_0x539bc7[_0xb4a6('0x31')]=_[_0xb4a6('0x30')](_0x1e5685[_0xb4a6('0x32')],qs['fields'](_0x369b45['query']['fields']));_0x539bc7['attributes']=_0x539bc7[_0xb4a6('0x31')][_0xb4a6('0x33')]?_0x539bc7[_0xb4a6('0x31')]:_0x1e5685[_0xb4a6('0x32')];if(!_0x369b45['query'][_0xb4a6('0x34')](_0xb4a6('0x35'))){_0x539bc7[_0xb4a6('0x1c')]=qs['limit'](_0x369b45[_0xb4a6('0x2e')]['limit']);_0x539bc7['offset']=qs['offset'](_0x369b45[_0xb4a6('0x2e')][_0xb4a6('0x1b')]);}_0x539bc7[_0xb4a6('0x36')]=qs['sort'](_0x369b45[_0xb4a6('0x2e')][_0xb4a6('0x37')]);_0x539bc7[_0xb4a6('0x38')]=qs['filters'](_['pick'](_0x369b45[_0xb4a6('0x2e')],_0x1e5685[_0xb4a6('0x39')]));if(_0x369b45['query']['filter']){_0x539bc7['where']=_[_0xb4a6('0x3a')](_0x539bc7[_0xb4a6('0x38')],{'$or':_[_0xb4a6('0x2d')](_0x2fcf34,function(_0x41fe24){if(_0x41fe24[_0xb4a6('0x3b')]!=='VIRTUAL'){var _0x5c58d0={};_0x5c58d0[_0x41fe24[_0xb4a6('0x26')]]={'$like':'%'+_0x369b45[_0xb4a6('0x2e')][_0xb4a6('0x3c')]+'%'};return _0x5c58d0;}})});}_0x539bc7=_[_0xb4a6('0x3a')]({},_0x539bc7,_0x369b45['options']);var _0x588666={'where':_0x539bc7['where']};return db[_0xb4a6('0x29')]['count'](_0x588666)[_0xb4a6('0x23')](function(_0x2ca629){_0x4b0efc[_0xb4a6('0x3d')]=_0x2ca629;if(_0x369b45['query']['includeAll']){_0x539bc7[_0xb4a6('0x3e')]=[{'all':!![]}];}return db[_0xb4a6('0x29')][_0xb4a6('0x3f')](_0x539bc7);})[_0xb4a6('0x23')](function(_0xdb0c2f){_0x4b0efc[_0xb4a6('0x40')]=_0xdb0c2f;return _0x4b0efc;})[_0xb4a6('0x23')](respondWithFilteredResult(_0x43dd9b,_0x539bc7))[_0xb4a6('0x41')](handleError(_0x43dd9b,null));};exports[_0xb4a6('0x42')]=function(_0x48ae56,_0xc7c6b3){var _0x356c42={'raw':!![],'where':{'id':_0x48ae56[_0xb4a6('0x43')]['id']}},_0x5e978b={};_0x5e978b['model']=_[_0xb4a6('0x2f')](db[_0xb4a6('0x29')][_0xb4a6('0x2a')]);_0x5e978b[_0xb4a6('0x2e')]=_['keys'](_0x48ae56[_0xb4a6('0x2e')]);_0x5e978b[_0xb4a6('0x39')]=_['intersection'](_0x5e978b[_0xb4a6('0x32')],_0x5e978b['query']);_0x356c42['attributes']=_['intersection'](_0x5e978b['model'],qs[_0xb4a6('0x44')](_0x48ae56[_0xb4a6('0x2e')][_0xb4a6('0x44')]));_0x356c42[_0xb4a6('0x31')]=_0x356c42[_0xb4a6('0x31')]['length']?_0x356c42[_0xb4a6('0x31')]:_0x5e978b[_0xb4a6('0x32')];if(_0x48ae56['query'][_0xb4a6('0x45')]){_0x356c42[_0xb4a6('0x3e')]=[{'all':!![]}];}_0x356c42=_[_0xb4a6('0x3a')]({},_0x356c42,_0x48ae56[_0xb4a6('0x46')]);return db[_0xb4a6('0x29')][_0xb4a6('0x47')](_0x356c42)[_0xb4a6('0x23')](handleEntityNotFound(_0xc7c6b3,null))[_0xb4a6('0x23')](respondWithResult(_0xc7c6b3,null))['catch'](handleError(_0xc7c6b3,null));};exports['create']=function(_0x434476,_0x136a2a){return db[_0xb4a6('0x29')][_0xb4a6('0x48')](_0x434476[_0xb4a6('0x49')],{})[_0xb4a6('0x23')](respondWithResult(_0x136a2a,0xc9))['catch'](handleError(_0x136a2a,null));};exports[_0xb4a6('0x22')]=function(_0x105e44,_0x30a912){if(_0x105e44[_0xb4a6('0x49')]['id']){delete _0x105e44[_0xb4a6('0x49')]['id'];}return db[_0xb4a6('0x29')][_0xb4a6('0x47')]({'where':{'id':_0x105e44[_0xb4a6('0x43')]['id']}})[_0xb4a6('0x23')](handleEntityNotFound(_0x30a912,null))['then'](saveUpdates(_0x105e44[_0xb4a6('0x49')],null))[_0xb4a6('0x23')](respondWithResult(_0x30a912,null))[_0xb4a6('0x41')](handleError(_0x30a912,null));};exports['destroy']=function(_0x3dcb52,_0x3eddf6){return db['FreshdeskField'][_0xb4a6('0x47')]({'where':{'id':_0x3dcb52[_0xb4a6('0x43')]['id']}})[_0xb4a6('0x23')](handleEntityNotFound(_0x3eddf6,null))['then'](removeEntity(_0x3eddf6,null))[_0xb4a6('0x41')](handleError(_0x3eddf6,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1f9cf23..be526d9 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 _0xeee4=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','lodash','util','../../config/logger','moment','bluebird'];(function(_0x19a89d,_0x3bd720){var _0xdfe09=function(_0x29c102){while(--_0x29c102){_0x19a89d['push'](_0x19a89d['shift']());}};_0xdfe09(++_0x3bd720);}(_0xeee4,0x136));var _0x4eee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeee4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4eee('0x0'));var util=require(_0x4eee('0x1'));var logger=require(_0x4eee('0x2'))('api');var moment=require(_0x4eee('0x3'));var BPromise=require(_0x4eee('0x4'));var rp=require(_0x4eee('0x5'));var fs=require('fs');var path=require(_0x4eee('0x6'));var rimraf=require(_0x4eee('0x7'));var config=require(_0x4eee('0x8'));var attributes=require(_0x4eee('0x9'));module[_0x4eee('0xa')]=function(_0x199209,_0x29da10){return _0x199209[_0x4eee('0xb')](_0x4eee('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x4eee('0xd'),'fields':[_0x4eee('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x552f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskField','freshdesk_unique_index','FieldId','../../config/logger','api'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x552f,0x191));var _0xf552=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x552f[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf552('0x0'))(_0xf552('0x1'));var moment=require(_0xf552('0x2'));var BPromise=require(_0xf552('0x3'));var rp=require(_0xf552('0x4'));var fs=require('fs');var path=require(_0xf552('0x5'));var rimraf=require(_0xf552('0x6'));var config=require(_0xf552('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0xf552('0x8')]=function(_0x1a616e,_0x9af1a0){return _0x1a616e[_0xf552('0x9')](_0xf552('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xf552('0xb'),'fields':['idField',_0xf552('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 cc06295..a2a917e 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xbba68b,_0x42d9de){var _0x52c4e1=function(_0xd898da){while(--_0xd898da){_0xbba68b['push'](_0xbba68b['shift']());}};_0x52c4e1(++_0x42d9de);}(_0xb10b,0x12a));var _0xbb10=function(_0x11da1e,_0x597cc5){_0x11da1e=_0x11da1e-0x0;var _0x404daa=_0xb10b[_0x11da1e];return _0x404daa;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xd09fa4,_0x543793){var _0x3990ac=function(_0x5d967f){while(--_0x5d967f){_0xd09fa4['push'](_0xd09fa4['shift']());}};_0x3990ac(++_0x543793);}(_0xb10b,0x12a));var _0xbb10=function(_0xcb8fde,_0x24399c){_0xcb8fde=_0xcb8fde-0x0;var _0x16dd77=_0xb10b[_0xcb8fde];return _0x16dd77;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index c054ee7..6810f35 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a72=['get','/:id','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index'];(function(_0x1d8aff,_0xca4f7c){var _0xf81eed=function(_0x5bb6bc){while(--_0x5bb6bc){_0x1d8aff['push'](_0x1d8aff['shift']());}};_0xf81eed(++_0xca4f7c);}(_0x1a72,0x108));var _0x21a7=function(_0x2df1a2,_0x2003bd){_0x2df1a2=_0x2df1a2-0x0;var _0x2bc536=_0x1a72[_0x2df1a2];return _0x2bc536;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x21a7('0x0'));var express=require(_0x21a7('0x1'));var router=express[_0x21a7('0x2')]();var auth=require(_0x21a7('0x3'));var interaction=require(_0x21a7('0x4'));var config=require(_0x21a7('0x5'));var controller=require(_0x21a7('0x6'));router['get']('/',auth[_0x21a7('0x7')](),controller[_0x21a7('0x8')]);router[_0x21a7('0x9')](_0x21a7('0xa'),auth[_0x21a7('0x7')](),controller['show']);router[_0x21a7('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x21a7('0x9')]('/:id/fields',auth[_0x21a7('0x7')](),controller[_0x21a7('0xb')]);router[_0x21a7('0xc')]('/',auth['isAuthenticated'](),controller[_0x21a7('0xd')]);router['post'](_0x21a7('0xe'),auth[_0x21a7('0x7')](),controller[_0x21a7('0xf')]);router[_0x21a7('0x10')](_0x21a7('0xa'),auth[_0x21a7('0x7')](),controller[_0x21a7('0x11')]);router[_0x21a7('0x12')](_0x21a7('0xa'),auth['isAuthenticated'](),controller[_0x21a7('0x13')]);module[_0x21a7('0x14')]=router; \ No newline at end of file +var _0x53b1=['../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x53b1,0x1c2));var _0x153b=function(_0x460fa7,_0x20f9d8){_0x460fa7=_0x460fa7-0x0;var _0x49ac25=_0x53b1[_0x460fa7];return _0x49ac25;};'use strict';var multer=require(_0x153b('0x0'));var util=require(_0x153b('0x1'));var path=require('path');var timeout=require(_0x153b('0x2'));var express=require(_0x153b('0x3'));var router=express[_0x153b('0x4')]();var auth=require(_0x153b('0x5'));var interaction=require(_0x153b('0x6'));var config=require('../../config/environment');var controller=require(_0x153b('0x7'));router[_0x153b('0x8')]('/',auth[_0x153b('0x9')](),controller[_0x153b('0xa')]);router['get'](_0x153b('0xb'),auth[_0x153b('0x9')](),controller[_0x153b('0xc')]);router[_0x153b('0x8')]('/:id/configurations',auth[_0x153b('0x9')](),controller[_0x153b('0xd')]);router[_0x153b('0x8')](_0x153b('0xe'),auth[_0x153b('0x9')](),controller[_0x153b('0xf')]);router[_0x153b('0x10')]('/',auth[_0x153b('0x9')](),controller[_0x153b('0x11')]);router[_0x153b('0x10')](_0x153b('0x12'),auth[_0x153b('0x9')](),controller[_0x153b('0x13')]);router[_0x153b('0x14')](_0x153b('0xb'),auth[_0x153b('0x9')](),controller['update']);router[_0x153b('0x15')](_0x153b('0xb'),auth[_0x153b('0x9')](),controller[_0x153b('0x16')]);module[_0x153b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index a1bfb4b..0ac5a43 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5c9=['exports','STRING','sequelize'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0xa5c9,0x143));var _0x9a5c=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xa5c9[_0x54edc9];return _0x2ae7a9;};'use strict';var Sequelize=require(_0x9a5c('0x0'));module[_0x9a5c('0x1')]={'name':{'type':Sequelize[_0x9a5c('0x2')]},'description':{'type':Sequelize[_0x9a5c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x9a5c('0x2')]},'remoteUri':{'type':Sequelize[_0x9a5c('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd1d3=['STRING','username','remoteUri','sequelize'];(function(_0x275845,_0x2aefa1){var _0x4f7736=function(_0x44c924){while(--_0x44c924){_0x275845['push'](_0x275845['shift']());}};_0x4f7736(++_0x2aefa1);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x12febf,_0x47cb15){_0x12febf=_0x12febf-0x0;var _0x229247=_0xd1d3[_0x12febf];return _0x229247;};'use strict';var Sequelize=require(_0x3d1d('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d1d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3d1d('0x1')],'unique':_0x3d1d('0x2')},'apiKey':{'type':Sequelize[_0x3d1d('0x1')]},'remoteUri':{'type':Sequelize[_0x3d1d('0x1')],'unique':_0x3d1d('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 07aaa12..9842bf9 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f5d=['Subjects','channel','Descriptions','FreshsalesField','remoteUri','apiKey','username','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','options','FreshsalesAccount','includeAll','rows','show','include','find','create','body','params','destroy','getConfigurations','findOne','FreshsalesConfiguration','order','pick','filter','nolimit','addConfiguration'];(function(_0x1ec4b3,_0x280969){var _0x3dd681=function(_0x1d6ac4){while(--_0x1d6ac4){_0x1ec4b3['push'](_0x1ec4b3['shift']());}};_0x3dd681(++_0x280969);}(_0x0f5d,0x166));var _0xd0f5=function(_0x3f70ff,_0x21d5d9){_0x3f70ff=_0x3f70ff-0x0;var _0x2d0796=_0x0f5d[_0x3f70ff];return _0x2d0796;};'use strict';var pdf=require(_0xd0f5('0x0'));var emlformat=require(_0xd0f5('0x1'));var rimraf=require(_0xd0f5('0x2'));var zipdir=require(_0xd0f5('0x3'));var jsonpatch=require(_0xd0f5('0x4'));var rp=require('request-promise');var moment=require(_0xd0f5('0x5'));var BPromise=require(_0xd0f5('0x6'));var Mustache=require(_0xd0f5('0x7'));var util=require(_0xd0f5('0x8'));var path=require(_0xd0f5('0x9'));var sox=require('sox');var csv=require(_0xd0f5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd0f5('0xb'));var squel=require(_0xd0f5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd0f5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd0f5('0xe'));var Papa=require(_0xd0f5('0xf'));var Redis=require(_0xd0f5('0x10'));var authService=require(_0xd0f5('0x11'));var qs=require(_0xd0f5('0x12'));var as=require(_0xd0f5('0x13'));var hardwareService=require(_0xd0f5('0x14'));var logger=require('../../config/logger')(_0xd0f5('0x15'));var utils=require(_0xd0f5('0x16'));var config=require(_0xd0f5('0x17'));var db=require(_0xd0f5('0x18'))['db'];var integrations=require(_0xd0f5('0x19'));var jayson=require(_0xd0f5('0x1a'));var client=jayson[_0xd0f5('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x35c3ce,_0x4b11d8,_0x2e6410){if(_0x2e6410){var _0xc39197=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc39197[_0xd0f5('0x1c')](_0x4b11d8)){return _0x35c3ce;}else{throw new db[(_0xd0f5('0x1d'))][(_0xd0f5('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x35c3ce;}}function respondWithRpcPromise(_0xdae4ad,_0x459408,_0x333f46,_0x576fb0){return new BPromise(function(_0x395163,_0x61f1ff){var _0x54e2e1=_0x576fb0||client;return _0x54e2e1['request'](_0xdae4ad,_0x333f46)[_0xd0f5('0x1f')](function(_0x525665){logger[_0xd0f5('0x20')](_0xd0f5('0x21'),_0x459408,_0xd0f5('0x22'));logger[_0xd0f5('0x23')](_0xd0f5('0x24'),_0x459408,_0xd0f5('0x22'),JSON[_0xd0f5('0x25')](_0x525665));if(_0x525665['error']){if(_0x525665[_0xd0f5('0x26')][_0xd0f5('0x27')]===0x1f4){logger[_0xd0f5('0x26')](_0xd0f5('0x21'),_0x459408,_0x525665['error'][_0xd0f5('0x28')]);return _0x61f1ff(_0x525665['error'][_0xd0f5('0x28')]);}logger[_0xd0f5('0x26')](_0xd0f5('0x21'),_0x459408,_0x525665[_0xd0f5('0x26')][_0xd0f5('0x28')]);return _0x395163(_0x525665[_0xd0f5('0x26')][_0xd0f5('0x28')]);}else{logger[_0xd0f5('0x20')](_0xd0f5('0x21'),_0x459408,_0xd0f5('0x22'));_0x395163(_0x525665[_0xd0f5('0x29')][_0xd0f5('0x28')]);}})[_0xd0f5('0x2a')](function(_0x33a885){logger[_0xd0f5('0x26')](_0xd0f5('0x21'),_0x459408,_0x33a885);_0x61f1ff(_0x33a885);});});}function respondWithStatusCode(_0x320fdb,_0x2c40f1){_0x2c40f1=_0x2c40f1||0xcc;return function(_0x47cc9c){if(_0x47cc9c){return _0x320fdb[_0xd0f5('0x2b')](_0x2c40f1);}return _0x320fdb[_0xd0f5('0x2c')](_0x2c40f1)[_0xd0f5('0x2d')]();};}function respondWithResult(_0xc99007,_0x479a5d){_0x479a5d=_0x479a5d||0xc8;return function(_0x399912){if(_0x399912){return _0xc99007['status'](_0x479a5d)[_0xd0f5('0x2e')](_0x399912);}};}function respondWithFilteredResult(_0x8832b6,_0x4e1c29){return function(_0x4d498d){if(_0x4d498d){var _0x400896=_0x4d498d[_0xd0f5('0x2f')],_0xd9dc=_0x4e1c29[_0xd0f5('0x30')],_0x5043f5=_0x4e1c29['offset']+_0x4e1c29[_0xd0f5('0x31')],_0x297a99;if(_0x5043f5>=_0x400896){_0x5043f5=_0x400896;_0x297a99=0xc8;}else{_0x297a99=0xce;}_0x8832b6['status'](_0x297a99);return _0x8832b6[_0xd0f5('0x32')](_0xd0f5('0x33'),_0xd9dc+'-'+_0x5043f5+'/'+_0x400896)[_0xd0f5('0x2e')](_0x4d498d);}return null;};}function patchUpdates(_0x17c4b0){return function(_0x2ceb56){try{jsonpatch[_0xd0f5('0x34')](_0x2ceb56,_0x17c4b0,!![]);}catch(_0x23866a){return BPromise['reject'](_0x23866a);}return _0x2ceb56[_0xd0f5('0x35')]();};}function saveUpdates(_0x463216,_0x3810ac){return function(_0x59c0ba){if(_0x59c0ba){return _0x59c0ba[_0xd0f5('0x36')](_0x463216)[_0xd0f5('0x1f')](function(_0x561d1f){return _0x561d1f;});}return null;};}function removeEntity(_0x309b82,_0x1928d9){return function(_0x4e5d2f){if(_0x4e5d2f){return _0x4e5d2f['destroy']()['then'](function(){_0x309b82[_0xd0f5('0x2c')](0xcc)[_0xd0f5('0x2d')]();});}};}function handleEntityNotFound(_0xd593f7,_0x134239){return function(_0x57b343){if(!_0x57b343){_0xd593f7[_0xd0f5('0x2b')](0x194);}return _0x57b343;};}function handleError(_0x3b5854,_0x2b7a02){_0x2b7a02=_0x2b7a02||0x1f4;return function(_0x1317bf){logger['error'](_0x1317bf[_0xd0f5('0x37')]);if(_0x1317bf['name']){delete _0x1317bf[_0xd0f5('0x38')];}_0x3b5854['status'](_0x2b7a02)['send'](_0x1317bf);};}exports['index']=function(_0x5c1799,_0x4dd6da){var _0x4e4e8d={},_0x5a0214={},_0x172cae={'count':0x0,'rows':[]};var _0x175ab2=_[_0xd0f5('0x39')](db['FreshsalesAccount'][_0xd0f5('0x3a')],function(_0x1109e0){return{'name':_0x1109e0[_0xd0f5('0x3b')],'type':_0x1109e0[_0xd0f5('0x3c')][_0xd0f5('0x3d')]};});_0x5a0214['model']=_[_0xd0f5('0x39')](_0x175ab2,'name');_0x5a0214[_0xd0f5('0x3e')]=_[_0xd0f5('0x3f')](_0x5c1799[_0xd0f5('0x3e')]);_0x5a0214[_0xd0f5('0x40')]=_[_0xd0f5('0x41')](_0x5a0214[_0xd0f5('0x42')],_0x5a0214['query']);_0x4e4e8d[_0xd0f5('0x43')]=_[_0xd0f5('0x41')](_0x5a0214['model'],qs[_0xd0f5('0x44')](_0x5c1799[_0xd0f5('0x3e')][_0xd0f5('0x44')]));_0x4e4e8d[_0xd0f5('0x43')]=_0x4e4e8d[_0xd0f5('0x43')][_0xd0f5('0x45')]?_0x4e4e8d['attributes']:_0x5a0214[_0xd0f5('0x42')];if(!_0x5c1799[_0xd0f5('0x3e')][_0xd0f5('0x46')]('nolimit')){_0x4e4e8d['limit']=qs[_0xd0f5('0x31')](_0x5c1799[_0xd0f5('0x3e')]['limit']);_0x4e4e8d[_0xd0f5('0x30')]=qs[_0xd0f5('0x30')](_0x5c1799['query']['offset']);}_0x4e4e8d['order']=qs[_0xd0f5('0x47')](_0x5c1799[_0xd0f5('0x3e')]['sort']);_0x4e4e8d[_0xd0f5('0x48')]=qs[_0xd0f5('0x40')](_['pick'](_0x5c1799[_0xd0f5('0x3e')],_0x5a0214[_0xd0f5('0x40')]));if(_0x5c1799[_0xd0f5('0x3e')]['filter']){_0x4e4e8d['where']=_[_0xd0f5('0x49')](_0x4e4e8d[_0xd0f5('0x48')],{'$or':_[_0xd0f5('0x39')](_0x175ab2,function(_0x3c93ac){if(_0x3c93ac['type']!==_0xd0f5('0x4a')){var _0x4dd7cd={};_0x4dd7cd[_0x3c93ac[_0xd0f5('0x38')]]={'$like':'%'+_0x5c1799[_0xd0f5('0x3e')]['filter']+'%'};return _0x4dd7cd;}})});}_0x4e4e8d=_['merge']({},_0x4e4e8d,_0x5c1799[_0xd0f5('0x4b')]);var _0x1f87f3={'where':_0x4e4e8d['where']};return db[_0xd0f5('0x4c')][_0xd0f5('0x2f')](_0x1f87f3)[_0xd0f5('0x1f')](function(_0x5e2b7e){_0x172cae[_0xd0f5('0x2f')]=_0x5e2b7e;if(_0x5c1799['query'][_0xd0f5('0x4d')]){_0x4e4e8d['include']=[{'all':!![]}];}return db[_0xd0f5('0x4c')]['findAll'](_0x4e4e8d);})[_0xd0f5('0x1f')](function(_0x318d30){_0x172cae[_0xd0f5('0x4e')]=_0x318d30;return _0x172cae;})[_0xd0f5('0x1f')](respondWithFilteredResult(_0x4dd6da,_0x4e4e8d))['catch'](handleError(_0x4dd6da,null));};exports[_0xd0f5('0x4f')]=function(_0x695593,_0x5d2ec0){var _0x135934={'raw':![],'where':{'id':_0x695593['params']['id']}},_0x113cd2={};_0x113cd2[_0xd0f5('0x42')]=_[_0xd0f5('0x3f')](db[_0xd0f5('0x4c')][_0xd0f5('0x3a')]);_0x113cd2[_0xd0f5('0x3e')]=_[_0xd0f5('0x3f')](_0x695593[_0xd0f5('0x3e')]);_0x113cd2['filters']=_[_0xd0f5('0x41')](_0x113cd2[_0xd0f5('0x42')],_0x113cd2[_0xd0f5('0x3e')]);_0x135934[_0xd0f5('0x43')]=_[_0xd0f5('0x41')](_0x113cd2['model'],qs['fields'](_0x695593[_0xd0f5('0x3e')]['fields']));_0x135934[_0xd0f5('0x43')]=_0x135934['attributes']['length']?_0x135934['attributes']:_0x113cd2['model'];if(_0x695593[_0xd0f5('0x3e')][_0xd0f5('0x4d')]){_0x135934[_0xd0f5('0x50')]=[{'all':!![]}];}_0x135934=_[_0xd0f5('0x49')]({},_0x135934,_0x695593['options']);return db[_0xd0f5('0x4c')][_0xd0f5('0x51')](_0x135934)['then'](handleEntityNotFound(_0x5d2ec0,null))[_0xd0f5('0x1f')](respondWithResult(_0x5d2ec0,null))[_0xd0f5('0x2a')](handleError(_0x5d2ec0,null));};exports[_0xd0f5('0x52')]=function(_0x3d722f,_0x491815){return db[_0xd0f5('0x4c')][_0xd0f5('0x52')](_0x3d722f[_0xd0f5('0x53')],{})[_0xd0f5('0x1f')](respondWithResult(_0x491815,0xc9))[_0xd0f5('0x2a')](handleError(_0x491815,null));};exports[_0xd0f5('0x36')]=function(_0x257009,_0x4b9f2c){if(_0x257009[_0xd0f5('0x53')]['id']){delete _0x257009[_0xd0f5('0x53')]['id'];}return db[_0xd0f5('0x4c')]['find']({'where':{'id':_0x257009[_0xd0f5('0x54')]['id']}})[_0xd0f5('0x1f')](handleEntityNotFound(_0x4b9f2c,null))[_0xd0f5('0x1f')](saveUpdates(_0x257009[_0xd0f5('0x53')],null))[_0xd0f5('0x1f')](respondWithResult(_0x4b9f2c,null))[_0xd0f5('0x2a')](handleError(_0x4b9f2c,null));};exports[_0xd0f5('0x55')]=function(_0xdd9bbb,_0x35ef3b){return db['FreshsalesAccount'][_0xd0f5('0x51')]({'where':{'id':_0xdd9bbb[_0xd0f5('0x54')]['id']}})[_0xd0f5('0x1f')](handleEntityNotFound(_0x35ef3b,null))[_0xd0f5('0x1f')](removeEntity(_0x35ef3b,null))[_0xd0f5('0x2a')](handleError(_0x35ef3b,null));};exports[_0xd0f5('0x56')]=function(_0x5c31c9,_0x486a68,_0x4c0dc9){var _0x385b32={};var _0xb99837={};var _0x3cb744;var _0x428933;return db[_0xd0f5('0x4c')][_0xd0f5('0x57')]({'where':{'id':_0x5c31c9['params']['id']}})[_0xd0f5('0x1f')](handleEntityNotFound(_0x486a68,null))[_0xd0f5('0x1f')](function(_0x496744){if(_0x496744){_0x3cb744=_0x496744;_0xb99837[_0xd0f5('0x42')]=_[_0xd0f5('0x3f')](db[_0xd0f5('0x58')][_0xd0f5('0x3a')]);_0xb99837[_0xd0f5('0x3e')]=_['keys'](_0x5c31c9['query']);_0xb99837[_0xd0f5('0x40')]=_[_0xd0f5('0x41')](_0xb99837[_0xd0f5('0x42')],_0xb99837[_0xd0f5('0x3e')]);_0x385b32['attributes']=_[_0xd0f5('0x41')](_0xb99837[_0xd0f5('0x42')],qs[_0xd0f5('0x44')](_0x5c31c9[_0xd0f5('0x3e')]['fields']));_0x385b32[_0xd0f5('0x43')]=_0x385b32[_0xd0f5('0x43')][_0xd0f5('0x45')]?_0x385b32[_0xd0f5('0x43')]:_0xb99837['model'];_0x385b32[_0xd0f5('0x59')]=qs[_0xd0f5('0x47')](_0x5c31c9['query']['sort']);_0x385b32[_0xd0f5('0x48')]=qs[_0xd0f5('0x40')](_[_0xd0f5('0x5a')](_0x5c31c9[_0xd0f5('0x3e')],_0xb99837[_0xd0f5('0x40')]));if(_0x5c31c9[_0xd0f5('0x3e')][_0xd0f5('0x5b')]){_0x385b32[_0xd0f5('0x48')]=_['merge'](_0x385b32['where'],{'$or':_[_0xd0f5('0x39')](_0x385b32[_0xd0f5('0x43')],function(_0x2e08ae){var _0x24311e={};_0x24311e[_0x2e08ae]={'$like':'%'+_0x5c31c9['query']['filter']+'%'};return _0x24311e;})});}_0x385b32=_[_0xd0f5('0x49')]({},_0x385b32,_0x5c31c9[_0xd0f5('0x4b')]);return _0x3cb744['getConfigurations'](_0x385b32);}})[_0xd0f5('0x1f')](function(_0x57518b){if(_0x57518b){_0x428933=_0x57518b[_0xd0f5('0x45')];if(!_0x5c31c9['query'][_0xd0f5('0x46')](_0xd0f5('0x5c'))){_0x385b32['limit']=qs[_0xd0f5('0x31')](_0x5c31c9[_0xd0f5('0x3e')][_0xd0f5('0x31')]);_0x385b32[_0xd0f5('0x30')]=qs['offset'](_0x5c31c9[_0xd0f5('0x3e')][_0xd0f5('0x30')]);}return _0x3cb744['getConfigurations'](_0x385b32);}})[_0xd0f5('0x1f')](function(_0x4508bb){if(_0x4508bb){return _0x4508bb?{'count':_0x428933,'rows':_0x4508bb}:null;}})[_0xd0f5('0x1f')](respondWithResult(_0x486a68,null))['catch'](handleError(_0x486a68,null));};exports[_0xd0f5('0x5d')]=function(_0x20d6ef,_0x50ab13,_0x3ef301){if(_0x20d6ef[_0xd0f5('0x53')]['id']){delete _0x20d6ef[_0xd0f5('0x53')]['id'];}return db[_0xd0f5('0x4c')][_0xd0f5('0x57')]({'where':{'id':_0x20d6ef[_0xd0f5('0x54')]['id']}})[_0xd0f5('0x1f')](handleEntityNotFound(_0x50ab13,null))[_0xd0f5('0x1f')](function(_0x5f1e01){if(_0x5f1e01){_0x20d6ef[_0xd0f5('0x53')]['AccountId']=_0x5f1e01['id'];_0x20d6ef['body'][_0xd0f5('0x5e')]=integrations['getSubjects'](_0x20d6ef[_0xd0f5('0x53')][_0xd0f5('0x5f')],_0x20d6ef[_0xd0f5('0x53')]['type']);_0x20d6ef[_0xd0f5('0x53')][_0xd0f5('0x60')]=integrations['getDescriptions'](_0x20d6ef[_0xd0f5('0x53')][_0xd0f5('0x5f')],_0x20d6ef[_0xd0f5('0x53')][_0xd0f5('0x3c')]);return db['FreshsalesConfiguration'][_0xd0f5('0x52')](_0x20d6ef[_0xd0f5('0x53')],{'include':[{'model':db[_0xd0f5('0x61')],'as':_0xd0f5('0x5e')},{'model':db[_0xd0f5('0x61')],'as':_0xd0f5('0x60')}]});}return null;})[_0xd0f5('0x1f')](respondWithResult(_0x50ab13,null))['catch'](handleError(_0x50ab13,null));};exports['getFields']=function(_0x160897,_0x22299c,_0xeb1767){var _0x14cccf='';var _0x4c4dd7='';return db[_0xd0f5('0x4c')][_0xd0f5('0x57')]({'where':{'id':_0x160897[_0xd0f5('0x54')]['id']},'attributes':['id','username',_0xd0f5('0x62'),_0xd0f5('0x63')]})['then'](handleEntityNotFound(_0x22299c,null))[_0xd0f5('0x1f')](function(_0x4556c7){if(_0x4556c7){_0x4c4dd7=_0x4556c7[_0xd0f5('0x64')];_0x14cccf=_0x4556c7['remoteUri'];var _0xc020f0=_0x4556c7[_0xd0f5('0x62')][_0xd0f5('0x65')](-0x1);if(_0xc020f0==='/'){_0x14cccf=_0x14cccf['substring'](0x0,_0x14cccf[_0xd0f5('0x66')](_0xc020f0));}return rp({'method':_0xd0f5('0x67'),'uri':util[_0xd0f5('0x68')](_0xd0f5('0x69'),_0x14cccf,_0xd0f5('0x6a')),'headers':{'Authorization':_0xd0f5('0x6b')+_0x4556c7[_0xd0f5('0x63')]},'json':!![]});}})[_0xd0f5('0x1f')](function(_0x34affc){if(_0x34affc){var _0x709768=_0x34affc[_0xd0f5('0x6c')];var _0x1e4607=![];var _0x458ed4=null;for(_0x458ed4=0x0;_0x458ed4<_0x709768[_0xd0f5('0x45')];_0x458ed4++){if(_0x709768[_0x458ed4][_0xd0f5('0x6d')]===_0x4c4dd7){_0x1e4607=!![];}}if(_0x1e4607){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xd0f5('0x1f')](respondWithResult(_0x22299c,null))[_0xd0f5('0x2a')](function(_0x111ac2){var _0x43b383=_0x160897['query'][_0xd0f5('0x1c')]?0x1f4:_0x111ac2['statusCode']||0x1f4;logger[_0xd0f5('0x26')](_0xd0f5('0x6e'),'getFields',_0x43b383,JSON[_0xd0f5('0x25')](_0x111ac2));delete _0x111ac2[_0xd0f5('0x38')];if(_0x43b383===0x191){_0x43b383=0x190;}_0x22299c[_0xd0f5('0x2c')](_0x43b383)[_0xd0f5('0x6f')](_0x160897[_0xd0f5('0x3e')][_0xd0f5('0x1c')]?{'message':_0xd0f5('0x70'),'statusCode':_0x111ac2['statusCode']}:_0x111ac2);});}; \ No newline at end of file +var _0x5643=['getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','length','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','name','send','index','map','FreshsalesAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','order','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects'];(function(_0x1a3094,_0x40851f){var _0x161fd6=function(_0x125dab){while(--_0x125dab){_0x1a3094['push'](_0x1a3094['shift']());}};_0x161fd6(++_0x40851f);}(_0x5643,0x162));var _0x3564=function(_0x4e933c,_0x3dc592){_0x4e933c=_0x4e933c-0x0;var _0x5db3ac=_0x5643[_0x4e933c];return _0x5db3ac;};'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(_0x3564('0x0'));var moment=require(_0x3564('0x1'));var BPromise=require(_0x3564('0x2'));var Mustache=require(_0x3564('0x3'));var util=require('util');var path=require(_0x3564('0x4'));var sox=require(_0x3564('0x5'));var csv=require('to-csv');var ejs=require(_0x3564('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3564('0x7'));var jsforce=require(_0x3564('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3564('0x9'));var Papa=require('papaparse');var Redis=require(_0x3564('0xa'));var authService=require(_0x3564('0xb'));var qs=require(_0x3564('0xc'));var as=require(_0x3564('0xd'));var hardwareService=require(_0x3564('0xe'));var logger=require(_0x3564('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x3564('0x10'));var db=require(_0x3564('0x11'))['db'];var integrations=require(_0x3564('0x12'));var jayson=require(_0x3564('0x13'));var client=jayson[_0x3564('0x14')][_0x3564('0x15')]({'port':0x232a});function checkPasswordPattern(_0x2975a8,_0x85516d,_0x4bd9fc){if(_0x4bd9fc){var _0x6e5003=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6e5003[_0x3564('0x16')](_0x85516d)){return _0x2975a8;}else{throw new db[(_0x3564('0x17'))][(_0x3564('0x18'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2975a8;}}function respondWithRpcPromise(_0x336686,_0x4f77f3,_0x40bb71,_0x365250){return new BPromise(function(_0x439111,_0x2069f2){var _0x47c26b=_0x365250||client;return _0x47c26b[_0x3564('0x19')](_0x336686,_0x40bb71)[_0x3564('0x1a')](function(_0x4b31a2){logger[_0x3564('0x1b')](_0x3564('0x1c'),_0x4f77f3,_0x3564('0x1d'));logger['debug'](_0x3564('0x1e'),_0x4f77f3,_0x3564('0x1d'),JSON[_0x3564('0x1f')](_0x4b31a2));if(_0x4b31a2[_0x3564('0x20')]){if(_0x4b31a2[_0x3564('0x20')][_0x3564('0x21')]===0x1f4){logger[_0x3564('0x20')]('FreshsalesAccount,\x20%s,\x20%s',_0x4f77f3,_0x4b31a2[_0x3564('0x20')][_0x3564('0x22')]);return _0x2069f2(_0x4b31a2[_0x3564('0x20')][_0x3564('0x22')]);}logger[_0x3564('0x20')](_0x3564('0x1c'),_0x4f77f3,_0x4b31a2[_0x3564('0x20')][_0x3564('0x22')]);return _0x439111(_0x4b31a2['error'][_0x3564('0x22')]);}else{logger[_0x3564('0x1b')](_0x3564('0x1c'),_0x4f77f3,_0x3564('0x1d'));_0x439111(_0x4b31a2[_0x3564('0x23')][_0x3564('0x22')]);}})[_0x3564('0x24')](function(_0x21f2a7){logger[_0x3564('0x20')](_0x3564('0x1c'),_0x4f77f3,_0x21f2a7);_0x2069f2(_0x21f2a7);});});}function respondWithStatusCode(_0xdaebae,_0x30dd2f){_0x30dd2f=_0x30dd2f||0xcc;return function(_0x7c1778){if(_0x7c1778){return _0xdaebae[_0x3564('0x25')](_0x30dd2f);}return _0xdaebae[_0x3564('0x26')](_0x30dd2f)[_0x3564('0x27')]();};}function respondWithResult(_0x3dde1b,_0x5dfea9){_0x5dfea9=_0x5dfea9||0xc8;return function(_0x465a40){if(_0x465a40){return _0x3dde1b[_0x3564('0x26')](_0x5dfea9)[_0x3564('0x28')](_0x465a40);}};}function respondWithFilteredResult(_0x2166bc,_0x29e948){return function(_0x4503bd){if(_0x4503bd){var _0x2d37cf=_0x4503bd[_0x3564('0x29')],_0xfd8b2f=_0x29e948[_0x3564('0x2a')],_0x3e532e=_0x29e948[_0x3564('0x2a')]+_0x29e948[_0x3564('0x2b')],_0x5ed07f;if(_0x3e532e>=_0x2d37cf){_0x3e532e=_0x2d37cf;_0x5ed07f=0xc8;}else{_0x5ed07f=0xce;}_0x2166bc[_0x3564('0x26')](_0x5ed07f);return _0x2166bc['set'](_0x3564('0x2c'),_0xfd8b2f+'-'+_0x3e532e+'/'+_0x2d37cf)[_0x3564('0x28')](_0x4503bd);}return null;};}function patchUpdates(_0x18c99d){return function(_0x222e3f){try{jsonpatch[_0x3564('0x2d')](_0x222e3f,_0x18c99d,!![]);}catch(_0x5f312e){return BPromise[_0x3564('0x2e')](_0x5f312e);}return _0x222e3f[_0x3564('0x2f')]();};}function saveUpdates(_0x36a44c,_0x3d6ac8){return function(_0x7ba396){if(_0x7ba396){return _0x7ba396[_0x3564('0x30')](_0x36a44c)['then'](function(_0x1c34aa){return _0x1c34aa;});}return null;};}function removeEntity(_0x1a6bbc,_0x2d144a){return function(_0x305231){if(_0x305231){return _0x305231['destroy']()[_0x3564('0x1a')](function(){_0x1a6bbc[_0x3564('0x26')](0xcc)[_0x3564('0x27')]();});}};}function handleEntityNotFound(_0x4692e2,_0x3fbb4e){return function(_0x2d0910){if(!_0x2d0910){_0x4692e2[_0x3564('0x25')](0x194);}return _0x2d0910;};}function handleError(_0x485b7d,_0x1c9f68){_0x1c9f68=_0x1c9f68||0x1f4;return function(_0x46b0cc){logger[_0x3564('0x20')](_0x46b0cc['stack']);if(_0x46b0cc[_0x3564('0x31')]){delete _0x46b0cc[_0x3564('0x31')];}_0x485b7d['status'](_0x1c9f68)[_0x3564('0x32')](_0x46b0cc);};}exports[_0x3564('0x33')]=function(_0x59b605,_0x2fdaf4){var _0x4914f5={},_0x4e2c3e={},_0x54f43d={'count':0x0,'rows':[]};var _0x104787=_[_0x3564('0x34')](db[_0x3564('0x35')]['rawAttributes'],function(_0x39297d){return{'name':_0x39297d[_0x3564('0x36')],'type':_0x39297d['type'][_0x3564('0x37')]};});_0x4e2c3e[_0x3564('0x38')]=_[_0x3564('0x34')](_0x104787,_0x3564('0x31'));_0x4e2c3e[_0x3564('0x39')]=_[_0x3564('0x3a')](_0x59b605[_0x3564('0x39')]);_0x4e2c3e[_0x3564('0x3b')]=_[_0x3564('0x3c')](_0x4e2c3e[_0x3564('0x38')],_0x4e2c3e['query']);_0x4914f5[_0x3564('0x3d')]=_[_0x3564('0x3c')](_0x4e2c3e[_0x3564('0x38')],qs[_0x3564('0x3e')](_0x59b605[_0x3564('0x39')][_0x3564('0x3e')]));_0x4914f5['attributes']=_0x4914f5[_0x3564('0x3d')]['length']?_0x4914f5[_0x3564('0x3d')]:_0x4e2c3e[_0x3564('0x38')];if(!_0x59b605[_0x3564('0x39')]['hasOwnProperty']('nolimit')){_0x4914f5[_0x3564('0x2b')]=qs[_0x3564('0x2b')](_0x59b605[_0x3564('0x39')]['limit']);_0x4914f5[_0x3564('0x2a')]=qs['offset'](_0x59b605[_0x3564('0x39')]['offset']);}_0x4914f5['order']=qs['sort'](_0x59b605[_0x3564('0x39')][_0x3564('0x3f')]);_0x4914f5[_0x3564('0x40')]=qs[_0x3564('0x3b')](_[_0x3564('0x41')](_0x59b605[_0x3564('0x39')],_0x4e2c3e[_0x3564('0x3b')]));if(_0x59b605[_0x3564('0x39')]['filter']){_0x4914f5['where']=_[_0x3564('0x42')](_0x4914f5['where'],{'$or':_[_0x3564('0x34')](_0x104787,function(_0x502390){if(_0x502390[_0x3564('0x43')]!==_0x3564('0x44')){var _0x1bd6d6={};_0x1bd6d6[_0x502390['name']]={'$like':'%'+_0x59b605[_0x3564('0x39')][_0x3564('0x45')]+'%'};return _0x1bd6d6;}})});}_0x4914f5=_[_0x3564('0x42')]({},_0x4914f5,_0x59b605[_0x3564('0x46')]);var _0x4967bc={'where':_0x4914f5[_0x3564('0x40')]};return db['FreshsalesAccount'][_0x3564('0x29')](_0x4967bc)[_0x3564('0x1a')](function(_0x3ff8fb){_0x54f43d[_0x3564('0x29')]=_0x3ff8fb;if(_0x59b605['query'][_0x3564('0x47')]){_0x4914f5[_0x3564('0x48')]=[{'all':!![]}];}return db[_0x3564('0x35')][_0x3564('0x49')](_0x4914f5);})[_0x3564('0x1a')](function(_0x432181){_0x54f43d[_0x3564('0x4a')]=_0x432181;return _0x54f43d;})['then'](respondWithFilteredResult(_0x2fdaf4,_0x4914f5))[_0x3564('0x24')](handleError(_0x2fdaf4,null));};exports[_0x3564('0x4b')]=function(_0x236b68,_0x4106fd){var _0x487aa4={'raw':![],'where':{'id':_0x236b68[_0x3564('0x4c')]['id']}},_0x30f10f={};_0x30f10f[_0x3564('0x38')]=_['keys'](db[_0x3564('0x35')][_0x3564('0x4d')]);_0x30f10f[_0x3564('0x39')]=_['keys'](_0x236b68[_0x3564('0x39')]);_0x30f10f['filters']=_[_0x3564('0x3c')](_0x30f10f['model'],_0x30f10f[_0x3564('0x39')]);_0x487aa4[_0x3564('0x3d')]=_[_0x3564('0x3c')](_0x30f10f['model'],qs[_0x3564('0x3e')](_0x236b68[_0x3564('0x39')]['fields']));_0x487aa4['attributes']=_0x487aa4[_0x3564('0x3d')]['length']?_0x487aa4[_0x3564('0x3d')]:_0x30f10f[_0x3564('0x38')];if(_0x236b68[_0x3564('0x39')][_0x3564('0x47')]){_0x487aa4[_0x3564('0x48')]=[{'all':!![]}];}_0x487aa4=_['merge']({},_0x487aa4,_0x236b68[_0x3564('0x46')]);return db['FreshsalesAccount'][_0x3564('0x4e')](_0x487aa4)[_0x3564('0x1a')](handleEntityNotFound(_0x4106fd,null))[_0x3564('0x1a')](respondWithResult(_0x4106fd,null))[_0x3564('0x24')](handleError(_0x4106fd,null));};exports[_0x3564('0x4f')]=function(_0x301454,_0x14be65){return db[_0x3564('0x35')][_0x3564('0x4f')](_0x301454[_0x3564('0x50')],{})['then'](respondWithResult(_0x14be65,0xc9))[_0x3564('0x24')](handleError(_0x14be65,null));};exports[_0x3564('0x30')]=function(_0x342368,_0x214b80){if(_0x342368[_0x3564('0x50')]['id']){delete _0x342368[_0x3564('0x50')]['id'];}return db['FreshsalesAccount'][_0x3564('0x4e')]({'where':{'id':_0x342368[_0x3564('0x4c')]['id']}})[_0x3564('0x1a')](handleEntityNotFound(_0x214b80,null))[_0x3564('0x1a')](saveUpdates(_0x342368['body'],null))[_0x3564('0x1a')](respondWithResult(_0x214b80,null))['catch'](handleError(_0x214b80,null));};exports['destroy']=function(_0xc59019,_0x53cbd2){return db[_0x3564('0x35')][_0x3564('0x4e')]({'where':{'id':_0xc59019[_0x3564('0x4c')]['id']}})[_0x3564('0x1a')](handleEntityNotFound(_0x53cbd2,null))[_0x3564('0x1a')](removeEntity(_0x53cbd2,null))[_0x3564('0x24')](handleError(_0x53cbd2,null));};exports[_0x3564('0x51')]=function(_0x3c735a,_0x530de6,_0xa461cb){var _0x49f0c3={};var _0x597f1c={};var _0x7f60c1;var _0xb23d7d;return db[_0x3564('0x35')][_0x3564('0x52')]({'where':{'id':_0x3c735a[_0x3564('0x4c')]['id']}})[_0x3564('0x1a')](handleEntityNotFound(_0x530de6,null))[_0x3564('0x1a')](function(_0x533267){if(_0x533267){_0x7f60c1=_0x533267;_0x597f1c[_0x3564('0x38')]=_[_0x3564('0x3a')](db[_0x3564('0x53')][_0x3564('0x4d')]);_0x597f1c['query']=_['keys'](_0x3c735a[_0x3564('0x39')]);_0x597f1c[_0x3564('0x3b')]=_['intersection'](_0x597f1c[_0x3564('0x38')],_0x597f1c[_0x3564('0x39')]);_0x49f0c3[_0x3564('0x3d')]=_['intersection'](_0x597f1c['model'],qs['fields'](_0x3c735a[_0x3564('0x39')][_0x3564('0x3e')]));_0x49f0c3[_0x3564('0x3d')]=_0x49f0c3[_0x3564('0x3d')]['length']?_0x49f0c3[_0x3564('0x3d')]:_0x597f1c[_0x3564('0x38')];_0x49f0c3[_0x3564('0x54')]=qs[_0x3564('0x3f')](_0x3c735a[_0x3564('0x39')]['sort']);_0x49f0c3[_0x3564('0x40')]=qs[_0x3564('0x3b')](_[_0x3564('0x41')](_0x3c735a[_0x3564('0x39')],_0x597f1c[_0x3564('0x3b')]));if(_0x3c735a[_0x3564('0x39')][_0x3564('0x45')]){_0x49f0c3[_0x3564('0x40')]=_['merge'](_0x49f0c3[_0x3564('0x40')],{'$or':_[_0x3564('0x34')](_0x49f0c3[_0x3564('0x3d')],function(_0x5c6b9e){var _0x16d92b={};_0x16d92b[_0x5c6b9e]={'$like':'%'+_0x3c735a[_0x3564('0x39')]['filter']+'%'};return _0x16d92b;})});}_0x49f0c3=_['merge']({},_0x49f0c3,_0x3c735a[_0x3564('0x46')]);return _0x7f60c1[_0x3564('0x51')](_0x49f0c3);}})['then'](function(_0x55fce6){if(_0x55fce6){_0xb23d7d=_0x55fce6['length'];if(!_0x3c735a['query'][_0x3564('0x55')](_0x3564('0x56'))){_0x49f0c3[_0x3564('0x2b')]=qs['limit'](_0x3c735a['query'][_0x3564('0x2b')]);_0x49f0c3[_0x3564('0x2a')]=qs['offset'](_0x3c735a['query'][_0x3564('0x2a')]);}return _0x7f60c1[_0x3564('0x51')](_0x49f0c3);}})['then'](function(_0xbe82b2){if(_0xbe82b2){return _0xbe82b2?{'count':_0xb23d7d,'rows':_0xbe82b2}:null;}})['then'](respondWithResult(_0x530de6,null))[_0x3564('0x24')](handleError(_0x530de6,null));};exports[_0x3564('0x57')]=function(_0x29f91c,_0x4660ce,_0x5223fe){if(_0x29f91c[_0x3564('0x50')]['id']){delete _0x29f91c[_0x3564('0x50')]['id'];}return db['FreshsalesAccount'][_0x3564('0x52')]({'where':{'id':_0x29f91c[_0x3564('0x4c')]['id']}})[_0x3564('0x1a')](handleEntityNotFound(_0x4660ce,null))[_0x3564('0x1a')](function(_0x3d2c5b){if(_0x3d2c5b){_0x29f91c[_0x3564('0x50')][_0x3564('0x58')]=_0x3d2c5b['id'];_0x29f91c[_0x3564('0x50')][_0x3564('0x59')]=integrations[_0x3564('0x5a')](_0x29f91c[_0x3564('0x50')]['channel'],_0x29f91c[_0x3564('0x50')][_0x3564('0x43')]);_0x29f91c['body'][_0x3564('0x5b')]=integrations[_0x3564('0x5c')](_0x29f91c['body'][_0x3564('0x5d')],_0x29f91c[_0x3564('0x50')][_0x3564('0x43')]);return db[_0x3564('0x53')][_0x3564('0x4f')](_0x29f91c[_0x3564('0x50')],{'include':[{'model':db[_0x3564('0x5e')],'as':'Subjects'},{'model':db[_0x3564('0x5e')],'as':_0x3564('0x5b')}]});}return null;})[_0x3564('0x1a')](respondWithResult(_0x4660ce,null))[_0x3564('0x24')](handleError(_0x4660ce,null));};exports['getFields']=function(_0x148532,_0x391168,_0x5bc3e2){var _0xe7fa40='';var _0x23d39e='';return db[_0x3564('0x35')][_0x3564('0x52')]({'where':{'id':_0x148532[_0x3564('0x4c')]['id']},'attributes':['id',_0x3564('0x5f'),_0x3564('0x60'),_0x3564('0x61')]})['then'](handleEntityNotFound(_0x391168,null))[_0x3564('0x1a')](function(_0x4fa170){if(_0x4fa170){_0x23d39e=_0x4fa170[_0x3564('0x5f')];_0xe7fa40=_0x4fa170[_0x3564('0x60')];var _0x595b3e=_0x4fa170[_0x3564('0x60')][_0x3564('0x62')](-0x1);if(_0x595b3e==='/'){_0xe7fa40=_0xe7fa40['substring'](0x0,_0xe7fa40[_0x3564('0x63')](_0x595b3e));}return rp({'method':_0x3564('0x64'),'uri':util[_0x3564('0x65')](_0x3564('0x66'),_0xe7fa40,_0x3564('0x67')),'headers':{'Authorization':_0x3564('0x68')+_0x4fa170['apiKey']},'json':!![]});}})['then'](function(_0x5b2e2a){if(_0x5b2e2a){var _0x3792bf=_0x5b2e2a[_0x3564('0x69')];var _0x1067f1=![];var _0x22728e=null;for(_0x22728e=0x0;_0x22728e<_0x3792bf[_0x3564('0x6a')];_0x22728e++){if(_0x3792bf[_0x22728e]['email']===_0x23d39e){_0x1067f1=!![];}}if(_0x1067f1){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x3564('0x1a')](respondWithResult(_0x391168,null))[_0x3564('0x24')](function(_0x5e2753){var _0x301fb3=_0x148532[_0x3564('0x39')]['test']?0x1f4:_0x5e2753[_0x3564('0x6b')]||0x1f4;logger['error'](_0x3564('0x6c'),_0x3564('0x6d'),_0x301fb3,JSON[_0x3564('0x1f')](_0x5e2753));delete _0x5e2753['name'];if(_0x301fb3===0x191){_0x301fb3=0x190;}_0x391168[_0x3564('0x26')](_0x301fb3)[_0x3564('0x32')](_0x148532['query'][_0x3564('0x16')]?{'message':_0x3564('0x6e'),'statusCode':_0x5e2753[_0x3564('0x6b')]}:_0x5e2753);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 074281f..36583e9 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb077=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','lodash','util'];(function(_0x4929c8,_0x129746){var _0x37e68d=function(_0x2f7d5d){while(--_0x2f7d5d){_0x4929c8['push'](_0x4929c8['shift']());}};_0x37e68d(++_0x129746);}(_0xb077,0x1c6));var _0x7b07=function(_0x61b48e,_0x3fdccf){_0x61b48e=_0x61b48e-0x0;var _0x52c8fd=_0xb077[_0x61b48e];return _0x52c8fd;};'use strict';var _=require(_0x7b07('0x0'));var util=require(_0x7b07('0x1'));var logger=require(_0x7b07('0x2'))(_0x7b07('0x3'));var moment=require(_0x7b07('0x4'));var BPromise=require(_0x7b07('0x5'));var rp=require(_0x7b07('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7b07('0x7'));var attributes=require(_0x7b07('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x7b07('0x9')]=function(_0x8a21d9,_0x6959ff){return _0x8a21d9[_0x7b07('0xa')](_0x7b07('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b47=['lodash','util','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','int_freshsales_accounts'];(function(_0x8e1e89,_0x396be9){var _0x411cbd=function(_0x47aaad){while(--_0x47aaad){_0x8e1e89['push'](_0x8e1e89['shift']());}};_0x411cbd(++_0x396be9);}(_0x5b47,0x120));var _0x75b4=function(_0x36f3af,_0x477f0f){_0x36f3af=_0x36f3af-0x0;var _0x34c1e6=_0x5b47[_0x36f3af];return _0x34c1e6;};'use strict';var _=require(_0x75b4('0x0'));var util=require(_0x75b4('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(_0x75b4('0x2'));var rimraf=require(_0x75b4('0x3'));var config=require(_0x75b4('0x4'));var attributes=require(_0x75b4('0x5'));var integrations=require(_0x75b4('0x6'));module['exports']=function(_0x5ee223,_0x53dcb0){return _0x5ee223[_0x75b4('0x7')]('FreshsalesAccount',attributes,{'tableName':_0x75b4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index ad95236..1a27903 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4639=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','catch','GetFreshsalesAccount','find','ShowFreshsalesAccount','lodash','bluebird','randomstring'];(function(_0x416ea1,_0x29b8bc){var _0x322908=function(_0x108941){while(--_0x108941){_0x416ea1['push'](_0x416ea1['shift']());}};_0x322908(++_0x29b8bc);}(_0x4639,0x115));var _0x9463=function(_0x129c27,_0x333c44){_0x129c27=_0x129c27-0x0;var _0x5a8017=_0x4639[_0x129c27];return _0x5a8017;};'use strict';var _=require(_0x9463('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9463('0x1'));var rs=require(_0x9463('0x2'));var fs=require('fs');var Redis=require(_0x9463('0x3'));var db=require(_0x9463('0x4'))['db'];var utils=require(_0x9463('0x5'));var logger=require(_0x9463('0x6'))(_0x9463('0x7'));var config=require('../../config/environment');var jayson=require(_0x9463('0x8'));var client=jayson[_0x9463('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494a02,_0x3b5e95,_0x500f5d){return new BPromise(function(_0x58d09c,_0x465758){return client[_0x9463('0xa')](_0x494a02,_0x500f5d)[_0x9463('0xb')](function(_0x49e617){logger[_0x9463('0xc')](_0x9463('0xd'),_0x3b5e95,_0x9463('0xe'));logger[_0x9463('0xf')](_0x9463('0x10'),_0x3b5e95,_0x9463('0xe'),JSON[_0x9463('0x11')](_0x49e617));if(_0x49e617[_0x9463('0x12')]){if(_0x49e617[_0x9463('0x12')][_0x9463('0x13')]===0x1f4){logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x49e617[_0x9463('0x12')][_0x9463('0x14')]);return _0x465758(_0x49e617[_0x9463('0x12')][_0x9463('0x14')]);}logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x49e617[_0x9463('0x12')]['message']);return _0x58d09c(_0x49e617[_0x9463('0x12')]['message']);}else{logger[_0x9463('0xc')](_0x9463('0xd'),_0x3b5e95,_0x9463('0xe'));_0x58d09c(_0x49e617[_0x9463('0x15')][_0x9463('0x14')]);}})['catch'](function(_0x3d5a81){logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x3d5a81);_0x465758(_0x3d5a81);});});}exports['GetFreshsalesAccount']=function(_0x549167){var _0xc9099a=this;return new Promise(function(_0x422064,_0x396277){return db[_0x9463('0x16')][_0x9463('0x17')]({'raw':_0x549167[_0x9463('0x18')]?_0x549167[_0x9463('0x18')][_0x9463('0x19')]===undefined?!![]:![]:!![],'where':_0x549167[_0x9463('0x18')]?_0x549167[_0x9463('0x18')][_0x9463('0x1a')]||null:null,'attributes':_0x549167['options']?_0x549167[_0x9463('0x18')][_0x9463('0x1b')]||null:null,'limit':_0x549167[_0x9463('0x18')]?_0x549167[_0x9463('0x18')]['limit']||null:null,'include':_0x549167[_0x9463('0x18')]?_0x549167[_0x9463('0x18')][_0x9463('0x1c')]?_[_0x9463('0x1d')](_0x549167[_0x9463('0x18')][_0x9463('0x1c')],function(_0x214f7e){return{'model':db[_0x214f7e[_0x9463('0x1e')]],'as':_0x214f7e['as'],'attributes':_0x214f7e[_0x9463('0x1b')],'include':_0x214f7e[_0x9463('0x1c')]?_[_0x9463('0x1d')](_0x214f7e[_0x9463('0x1c')],function(_0x447b1a){return{'model':db[_0x447b1a[_0x9463('0x1e')]],'as':_0x447b1a['as'],'attributes':_0x447b1a[_0x9463('0x1b')],'include':_0x447b1a[_0x9463('0x1c')]?_[_0x9463('0x1d')](_0x447b1a[_0x9463('0x1c')],function(_0x505207){return{'model':db[_0x505207[_0x9463('0x1e')]],'as':_0x505207['as'],'attributes':_0x505207[_0x9463('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9463('0xb')](function(_0x454daf){logger[_0x9463('0xc')]('GetFreshsalesAccount',_0x549167);logger[_0x9463('0xf')]('GetFreshsalesAccount',_0x549167,JSON[_0x9463('0x11')](_0x454daf));_0x422064(_0x454daf);})[_0x9463('0x1f')](function(_0x1777f7){logger[_0x9463('0x12')](_0x9463('0x20'),_0x1777f7[_0x9463('0x14')],_0x549167);_0x396277(_0xc9099a[_0x9463('0x12')](0x1f4,_0x1777f7['message']));});});};exports['ShowFreshsalesAccount']=function(_0x371c07){var _0x23a13f=this;return new Promise(function(_0x26408f,_0x592a32){return db[_0x9463('0x16')][_0x9463('0x21')]({'raw':_0x371c07[_0x9463('0x18')]?_0x371c07[_0x9463('0x18')][_0x9463('0x19')]===undefined?!![]:![]:!![],'where':_0x371c07[_0x9463('0x18')]?_0x371c07[_0x9463('0x18')][_0x9463('0x1a')]||null:null,'attributes':_0x371c07[_0x9463('0x18')]?_0x371c07[_0x9463('0x18')][_0x9463('0x1b')]||null:null,'include':_0x371c07[_0x9463('0x18')]?_0x371c07[_0x9463('0x18')][_0x9463('0x1c')]?_[_0x9463('0x1d')](_0x371c07[_0x9463('0x18')][_0x9463('0x1c')],function(_0x256037){return{'model':db[_0x256037[_0x9463('0x1e')]],'as':_0x256037['as'],'attributes':_0x256037[_0x9463('0x1b')],'include':_0x256037[_0x9463('0x1c')]?_['map'](_0x256037['include'],function(_0x51c8e1){return{'model':db[_0x51c8e1[_0x9463('0x1e')]],'as':_0x51c8e1['as'],'attributes':_0x51c8e1[_0x9463('0x1b')],'include':_0x51c8e1[_0x9463('0x1c')]?_[_0x9463('0x1d')](_0x51c8e1[_0x9463('0x1c')],function(_0x13cf19){return{'model':db[_0x13cf19[_0x9463('0x1e')]],'as':_0x13cf19['as'],'attributes':_0x13cf19[_0x9463('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9463('0xb')](function(_0x18e274){logger[_0x9463('0xc')](_0x9463('0x22'),_0x371c07);logger[_0x9463('0xf')]('ShowFreshsalesAccount',_0x371c07,JSON[_0x9463('0x11')](_0x18e274));_0x26408f(_0x18e274);})['catch'](function(_0x3d79e5){logger['error'](_0x9463('0x22'),_0x3d79e5[_0x9463('0x14')],_0x371c07);_0x592a32(_0x23a13f[_0x9463('0x12')](0x1f4,_0x3d79e5[_0x9463('0x14')]));});});}; \ No newline at end of file +var _0xa6ce=['lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','model','include','map','find','where','ShowFreshsalesAccount'];(function(_0xeffb57,_0x702034){var _0x21cd1e=function(_0x3682da){while(--_0x3682da){_0xeffb57['push'](_0xeffb57['shift']());}};_0x21cd1e(++_0x702034);}(_0xa6ce,0x15e));var _0xea6c=function(_0x1fc4e2,_0x493c3b){_0x1fc4e2=_0x1fc4e2-0x0;var _0x2ba184=_0xa6ce[_0x1fc4e2];return _0x2ba184;};'use strict';var _=require(_0xea6c('0x0'));var util=require('util');var moment=require(_0xea6c('0x1'));var BPromise=require(_0xea6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea6c('0x3'));var db=require(_0xea6c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea6c('0x5'));var config=require(_0xea6c('0x6'));var jayson=require(_0xea6c('0x7'));var client=jayson[_0xea6c('0x8')][_0xea6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8a751f,_0x5c3ba1,_0x2af078){return new BPromise(function(_0x3f1ce4,_0x1be5e8){return client[_0xea6c('0xa')](_0x8a751f,_0x2af078)[_0xea6c('0xb')](function(_0x227f1c){logger[_0xea6c('0xc')](_0xea6c('0xd'),_0x5c3ba1,_0xea6c('0xe'));logger[_0xea6c('0xf')](_0xea6c('0x10'),_0x5c3ba1,_0xea6c('0xe'),JSON[_0xea6c('0x11')](_0x227f1c));if(_0x227f1c[_0xea6c('0x12')]){if(_0x227f1c['error'][_0xea6c('0x13')]===0x1f4){logger[_0xea6c('0x12')](_0xea6c('0xd'),_0x5c3ba1,_0x227f1c['error'][_0xea6c('0x14')]);return _0x1be5e8(_0x227f1c[_0xea6c('0x12')]['message']);}logger[_0xea6c('0x12')](_0xea6c('0xd'),_0x5c3ba1,_0x227f1c[_0xea6c('0x12')][_0xea6c('0x14')]);return _0x3f1ce4(_0x227f1c[_0xea6c('0x12')][_0xea6c('0x14')]);}else{logger['info'](_0xea6c('0xd'),_0x5c3ba1,'request\x20sent');_0x3f1ce4(_0x227f1c[_0xea6c('0x15')][_0xea6c('0x14')]);}})[_0xea6c('0x16')](function(_0x105b0b){logger[_0xea6c('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x5c3ba1,_0x105b0b);_0x1be5e8(_0x105b0b);});});}exports[_0xea6c('0x17')]=function(_0x2f4bd0){var _0x254f8e=this;return new Promise(function(_0x2f89e8,_0x9ba42b){return db[_0xea6c('0x18')][_0xea6c('0x19')]({'raw':_0x2f4bd0[_0xea6c('0x1a')]?_0x2f4bd0[_0xea6c('0x1a')][_0xea6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f4bd0['options']?_0x2f4bd0[_0xea6c('0x1a')]['where']||null:null,'attributes':_0x2f4bd0[_0xea6c('0x1a')]?_0x2f4bd0['options'][_0xea6c('0x1c')]||null:null,'limit':_0x2f4bd0[_0xea6c('0x1a')]?_0x2f4bd0[_0xea6c('0x1a')]['limit']||null:null,'include':_0x2f4bd0[_0xea6c('0x1a')]?_0x2f4bd0[_0xea6c('0x1a')]['include']?_['map'](_0x2f4bd0[_0xea6c('0x1a')]['include'],function(_0x540406){return{'model':db[_0x540406[_0xea6c('0x1d')]],'as':_0x540406['as'],'attributes':_0x540406[_0xea6c('0x1c')],'include':_0x540406[_0xea6c('0x1e')]?_[_0xea6c('0x1f')](_0x540406[_0xea6c('0x1e')],function(_0x4fa0ea){return{'model':db[_0x4fa0ea[_0xea6c('0x1d')]],'as':_0x4fa0ea['as'],'attributes':_0x4fa0ea['attributes'],'include':_0x4fa0ea['include']?_[_0xea6c('0x1f')](_0x4fa0ea['include'],function(_0x281717){return{'model':db[_0x281717[_0xea6c('0x1d')]],'as':_0x281717['as'],'attributes':_0x281717[_0xea6c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea6c('0xb')](function(_0x156832){logger[_0xea6c('0xc')](_0xea6c('0x17'),_0x2f4bd0);logger[_0xea6c('0xf')](_0xea6c('0x17'),_0x2f4bd0,JSON[_0xea6c('0x11')](_0x156832));_0x2f89e8(_0x156832);})[_0xea6c('0x16')](function(_0x22e059){logger['error'](_0xea6c('0x17'),_0x22e059[_0xea6c('0x14')],_0x2f4bd0);_0x9ba42b(_0x254f8e['error'](0x1f4,_0x22e059['message']));});});};exports['ShowFreshsalesAccount']=function(_0x434fa7){var _0x3e7bae=this;return new Promise(function(_0xc6836,_0xba97af){return db[_0xea6c('0x18')][_0xea6c('0x20')]({'raw':_0x434fa7[_0xea6c('0x1a')]?_0x434fa7[_0xea6c('0x1a')][_0xea6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x434fa7['options']?_0x434fa7[_0xea6c('0x1a')][_0xea6c('0x21')]||null:null,'attributes':_0x434fa7[_0xea6c('0x1a')]?_0x434fa7[_0xea6c('0x1a')][_0xea6c('0x1c')]||null:null,'include':_0x434fa7[_0xea6c('0x1a')]?_0x434fa7['options'][_0xea6c('0x1e')]?_[_0xea6c('0x1f')](_0x434fa7['options'][_0xea6c('0x1e')],function(_0x20a333){return{'model':db[_0x20a333[_0xea6c('0x1d')]],'as':_0x20a333['as'],'attributes':_0x20a333['attributes'],'include':_0x20a333['include']?_['map'](_0x20a333['include'],function(_0x544184){return{'model':db[_0x544184[_0xea6c('0x1d')]],'as':_0x544184['as'],'attributes':_0x544184[_0xea6c('0x1c')],'include':_0x544184[_0xea6c('0x1e')]?_[_0xea6c('0x1f')](_0x544184['include'],function(_0x22f5e6){return{'model':db[_0x22f5e6[_0xea6c('0x1d')]],'as':_0x22f5e6['as'],'attributes':_0x22f5e6[_0xea6c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d8794){logger[_0xea6c('0xc')]('ShowFreshsalesAccount',_0x434fa7);logger[_0xea6c('0xf')](_0xea6c('0x22'),_0x434fa7,JSON[_0xea6c('0x11')](_0x1d8794));_0xc6836(_0x1d8794);})[_0xea6c('0x16')](function(_0x375a07){logger[_0xea6c('0x12')](_0xea6c('0x22'),_0x375a07[_0xea6c('0x14')],_0x434fa7);_0xba97af(_0x3e7bae[_0xea6c('0x12')](0x1f4,_0x375a07[_0xea6c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index a8f959e..c39e523 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55c3=['getDescriptions','/:id/fields','getFields','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','show','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions'];(function(_0x549267,_0x4bbb15){var _0x41ddff=function(_0x4d2f99){while(--_0x4d2f99){_0x549267['push'](_0x549267['shift']());}};_0x41ddff(++_0x4bbb15);}(_0x55c3,0xb2));var _0x355c=function(_0x84303b,_0x34fc15){_0x84303b=_0x84303b-0x0;var _0xa273d3=_0x55c3[_0x84303b];return _0xa273d3;};'use strict';var multer=require(_0x355c('0x0'));var util=require(_0x355c('0x1'));var path=require('path');var timeout=require(_0x355c('0x2'));var express=require('express');var router=express[_0x355c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x355c('0x4'));var config=require(_0x355c('0x5'));var controller=require(_0x355c('0x6'));router[_0x355c('0x7')]('/',auth['isAuthenticated'](),controller[_0x355c('0x8')]);router[_0x355c('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x355c('0x9')]);router[_0x355c('0x7')](_0x355c('0xa'),auth[_0x355c('0xb')](),controller[_0x355c('0xc')]);router[_0x355c('0x7')](_0x355c('0xd'),auth['isAuthenticated'](),controller[_0x355c('0xe')]);router[_0x355c('0x7')](_0x355c('0xf'),auth[_0x355c('0xb')](),controller[_0x355c('0x10')]);router[_0x355c('0x11')]('/',auth[_0x355c('0xb')](),controller[_0x355c('0x12')]);router[_0x355c('0x13')](_0x355c('0x14'),auth['isAuthenticated'](),controller[_0x355c('0x15')]);router[_0x355c('0x16')](_0x355c('0x14'),auth[_0x355c('0xb')](),controller['destroy']);module[_0x355c('0x17')]=router; \ No newline at end of file +var _0xe544=['../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','/:id','update','destroy','exports','multer','path','express','Router'];(function(_0x5c8f3e,_0x33ba70){var _0xb55f35=function(_0x48f8ef){while(--_0x48f8ef){_0x5c8f3e['push'](_0x5c8f3e['shift']());}};_0xb55f35(++_0x33ba70);}(_0xe544,0xcb));var _0x4e54=function(_0x42cdb8,_0x2416b6){_0x42cdb8=_0x42cdb8-0x0;var _0x48f33d=_0xe544[_0x42cdb8];return _0x48f33d;};'use strict';var multer=require(_0x4e54('0x0'));var util=require('util');var path=require(_0x4e54('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e54('0x2'));var router=express[_0x4e54('0x3')]();var auth=require(_0x4e54('0x4'));var interaction=require(_0x4e54('0x5'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4e54('0x6')]);router[_0x4e54('0x7')]('/:id',auth[_0x4e54('0x8')](),controller[_0x4e54('0x9')]);router[_0x4e54('0x7')](_0x4e54('0xa'),auth[_0x4e54('0x8')](),controller[_0x4e54('0xb')]);router[_0x4e54('0x7')](_0x4e54('0xc'),auth[_0x4e54('0x8')](),controller[_0x4e54('0xd')]);router['get'](_0x4e54('0xe'),auth['isAuthenticated'](),controller[_0x4e54('0xf')]);router[_0x4e54('0x10')]('/',auth[_0x4e54('0x8')](),controller[_0x4e54('0x11')]);router[_0x4e54('0x12')](_0x4e54('0x13'),auth['isAuthenticated'](),controller[_0x4e54('0x14')]);router['delete']('/:id',auth[_0x4e54('0x8')](),controller[_0x4e54('0x15')]);module[_0x4e54('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index e46f936..782969c 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x624a=['STRING','sequelize','exports'];(function(_0x4577c1,_0x107af2){var _0x313dc8=function(_0xabc945){while(--_0xabc945){_0x4577c1['push'](_0x4577c1['shift']());}};_0x313dc8(++_0x107af2);}(_0x624a,0x172));var _0xa624=function(_0x37d76d,_0x14ab7e){_0x37d76d=_0x37d76d-0x0;var _0x486c89=_0x624a[_0x37d76d];return _0x486c89;};'use strict';var Sequelize=require(_0xa624('0x0'));module[_0xa624('0x1')]={'name':{'type':Sequelize[_0xa624('0x2')]},'description':{'type':Sequelize[_0xa624('0x2')]}}; \ No newline at end of file +var _0xf398=['sequelize','STRING'];(function(_0x555c20,_0x133041){var _0xf20ae7=function(_0x4ea0fd){while(--_0x4ea0fd){_0x555c20['push'](_0x555c20['shift']());}};_0xf20ae7(++_0x133041);}(_0xf398,0x1d8));var _0x8f39=function(_0x2a200b,_0x15c32d){_0x2a200b=_0x2a200b-0x0;var _0x41c4f2=_0xf398[_0x2a200b];return _0x41c4f2;};'use strict';var Sequelize=require(_0x8f39('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f39('0x1')]},'description':{'type':Sequelize[_0x8f39('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 1e8975a..698c9fb 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafb9=['rows','show','create','update','body','find','params','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll'];(function(_0xc785da,_0x24f7b0){var _0x48e530=function(_0x25f284){while(--_0x25f284){_0xc785da['push'](_0xc785da['shift']());}};_0x48e530(++_0x24f7b0);}(_0xafb9,0x68));var _0x9afb=function(_0x54aa0d,_0x1dbdd7){_0x54aa0d=_0x54aa0d-0x0;var _0x5c8e27=_0xafb9[_0x54aa0d];return _0x5c8e27;};'use strict';var pdf=require(_0x9afb('0x0'));var emlformat=require(_0x9afb('0x1'));var rimraf=require(_0x9afb('0x2'));var zipdir=require(_0x9afb('0x3'));var jsonpatch=require(_0x9afb('0x4'));var rp=require(_0x9afb('0x5'));var moment=require(_0x9afb('0x6'));var BPromise=require(_0x9afb('0x7'));var Mustache=require(_0x9afb('0x8'));var util=require('util');var path=require('path');var sox=require(_0x9afb('0x9'));var csv=require('to-csv');var ejs=require(_0x9afb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9afb('0xb'));var jsforce=require(_0x9afb('0xc'));var deskjs=require(_0x9afb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9afb('0xe'));var Papa=require(_0x9afb('0xf'));var Redis=require(_0x9afb('0x10'));var authService=require(_0x9afb('0x11'));var qs=require(_0x9afb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9afb('0x13'))(_0x9afb('0x14'));var utils=require(_0x9afb('0x15'));var config=require(_0x9afb('0x16'));var db=require(_0x9afb('0x17'))['db'];var jayson=require(_0x9afb('0x18'));var client=jayson[_0x9afb('0x19')][_0x9afb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x464462,_0x10602b,_0x47a804){if(_0x47a804){var _0x27137c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27137c['test'](_0x10602b)){return _0x464462;}else{throw new db['Sequelize'][(_0x9afb('0x1b'))](_0x9afb('0x1c'));}}else{return _0x464462;}}function respondWithRpcPromise(_0x3c8d2e,_0x2d664d,_0x46b16f,_0x39cdf1){return new BPromise(function(_0xd111f1,_0x4d31e3){var _0x18505a=_0x39cdf1||client;return _0x18505a[_0x9afb('0x1d')](_0x3c8d2e,_0x46b16f)[_0x9afb('0x1e')](function(_0x190cb8){logger[_0x9afb('0x1f')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2d664d,_0x9afb('0x20'));logger['debug'](_0x9afb('0x21'),_0x2d664d,_0x9afb('0x20'),JSON['stringify'](_0x190cb8));if(_0x190cb8['error']){if(_0x190cb8[_0x9afb('0x22')][_0x9afb('0x23')]===0x1f4){logger[_0x9afb('0x22')](_0x9afb('0x24'),_0x2d664d,_0x190cb8[_0x9afb('0x22')]['message']);return _0x4d31e3(_0x190cb8[_0x9afb('0x22')]['message']);}logger['error'](_0x9afb('0x24'),_0x2d664d,_0x190cb8[_0x9afb('0x22')][_0x9afb('0x25')]);return _0xd111f1(_0x190cb8[_0x9afb('0x22')]['message']);}else{logger[_0x9afb('0x1f')](_0x9afb('0x24'),_0x2d664d,'request\x20sent');_0xd111f1(_0x190cb8['result']['message']);}})[_0x9afb('0x26')](function(_0x4fbe61){logger[_0x9afb('0x22')](_0x9afb('0x24'),_0x2d664d,_0x4fbe61);_0x4d31e3(_0x4fbe61);});});}function respondWithStatusCode(_0x50a919,_0x324293){_0x324293=_0x324293||0xcc;return function(_0x28beba){if(_0x28beba){return _0x50a919[_0x9afb('0x27')](_0x324293);}return _0x50a919[_0x9afb('0x28')](_0x324293)['end']();};}function respondWithResult(_0x348255,_0x591e1d){_0x591e1d=_0x591e1d||0xc8;return function(_0x29e092){if(_0x29e092){return _0x348255['status'](_0x591e1d)['json'](_0x29e092);}};}function respondWithFilteredResult(_0x1e6100,_0x304104){return function(_0x30af1b){if(_0x30af1b){var _0x13a33e=_0x30af1b['count'],_0x119e04=_0x304104['offset'],_0x3e3f57=_0x304104[_0x9afb('0x29')]+_0x304104[_0x9afb('0x2a')],_0x46673d;if(_0x3e3f57>=_0x13a33e){_0x3e3f57=_0x13a33e;_0x46673d=0xc8;}else{_0x46673d=0xce;}_0x1e6100['status'](_0x46673d);return _0x1e6100[_0x9afb('0x2b')](_0x9afb('0x2c'),_0x119e04+'-'+_0x3e3f57+'/'+_0x13a33e)['json'](_0x30af1b);}return null;};}function patchUpdates(_0x1b9f18){return function(_0xc220e9){try{jsonpatch[_0x9afb('0x2d')](_0xc220e9,_0x1b9f18,!![]);}catch(_0x3dec39){return BPromise[_0x9afb('0x2e')](_0x3dec39);}return _0xc220e9[_0x9afb('0x2f')]();};}function saveUpdates(_0x3c6de5,_0x367f9d){return function(_0x57fcc5){if(_0x57fcc5){return _0x57fcc5['update'](_0x3c6de5)[_0x9afb('0x1e')](function(_0x1e377c){return _0x1e377c;});}return null;};}function removeEntity(_0x43d58a,_0xf9364e){return function(_0x1a8d78){if(_0x1a8d78){return _0x1a8d78[_0x9afb('0x30')]()[_0x9afb('0x1e')](function(){_0x43d58a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x67d63a,_0x18c03){return function(_0x559a52){if(!_0x559a52){_0x67d63a[_0x9afb('0x27')](0x194);}return _0x559a52;};}function handleError(_0x597571,_0x2f736b){_0x2f736b=_0x2f736b||0x1f4;return function(_0xc59d55){logger['error'](_0xc59d55[_0x9afb('0x31')]);if(_0xc59d55['name']){delete _0xc59d55[_0x9afb('0x32')];}_0x597571[_0x9afb('0x28')](_0x2f736b)[_0x9afb('0x33')](_0xc59d55);};}exports[_0x9afb('0x34')]=function(_0x3681aa,_0x30e533){var _0x19227f={},_0x334c2b={},_0x5531b7={'count':0x0,'rows':[]};var _0x3790fd=_['map'](db[_0x9afb('0x35')][_0x9afb('0x36')],function(_0x3c5231){return{'name':_0x3c5231[_0x9afb('0x37')],'type':_0x3c5231[_0x9afb('0x38')][_0x9afb('0x39')]};});_0x334c2b[_0x9afb('0x3a')]=_[_0x9afb('0x3b')](_0x3790fd,_0x9afb('0x32'));_0x334c2b['query']=_[_0x9afb('0x3c')](_0x3681aa['query']);_0x334c2b[_0x9afb('0x3d')]=_[_0x9afb('0x3e')](_0x334c2b[_0x9afb('0x3a')],_0x334c2b['query']);_0x19227f[_0x9afb('0x3f')]=_[_0x9afb('0x3e')](_0x334c2b[_0x9afb('0x3a')],qs[_0x9afb('0x40')](_0x3681aa[_0x9afb('0x41')][_0x9afb('0x40')]));_0x19227f[_0x9afb('0x3f')]=_0x19227f['attributes'][_0x9afb('0x42')]?_0x19227f[_0x9afb('0x3f')]:_0x334c2b[_0x9afb('0x3a')];if(!_0x3681aa[_0x9afb('0x41')][_0x9afb('0x43')](_0x9afb('0x44'))){_0x19227f[_0x9afb('0x2a')]=qs[_0x9afb('0x2a')](_0x3681aa['query'][_0x9afb('0x2a')]);_0x19227f['offset']=qs['offset'](_0x3681aa['query'][_0x9afb('0x29')]);}_0x19227f[_0x9afb('0x45')]=qs['sort'](_0x3681aa[_0x9afb('0x41')][_0x9afb('0x46')]);_0x19227f[_0x9afb('0x47')]=qs[_0x9afb('0x3d')](_[_0x9afb('0x48')](_0x3681aa[_0x9afb('0x41')],_0x334c2b[_0x9afb('0x3d')]));if(_0x3681aa[_0x9afb('0x41')][_0x9afb('0x49')]){_0x19227f['where']=_[_0x9afb('0x4a')](_0x19227f[_0x9afb('0x47')],{'$or':_[_0x9afb('0x3b')](_0x3790fd,function(_0x11965f){if(_0x11965f['type']!==_0x9afb('0x4b')){var _0x381033={};_0x381033[_0x11965f[_0x9afb('0x32')]]={'$like':'%'+_0x3681aa['query'][_0x9afb('0x49')]+'%'};return _0x381033;}})});}_0x19227f=_[_0x9afb('0x4a')]({},_0x19227f,_0x3681aa[_0x9afb('0x4c')]);var _0x12eddf={'where':_0x19227f[_0x9afb('0x47')]};return db[_0x9afb('0x35')][_0x9afb('0x4d')](_0x12eddf)['then'](function(_0x5a36e4){_0x5531b7['count']=_0x5a36e4;if(_0x3681aa[_0x9afb('0x41')][_0x9afb('0x4e')]){_0x19227f['include']=[{'all':!![]}];}return db[_0x9afb('0x35')][_0x9afb('0x4f')](_0x19227f);})[_0x9afb('0x1e')](function(_0x3b2c71){_0x5531b7[_0x9afb('0x50')]=_0x3b2c71;return _0x5531b7;})[_0x9afb('0x1e')](respondWithFilteredResult(_0x30e533,_0x19227f))[_0x9afb('0x26')](handleError(_0x30e533,null));};exports[_0x9afb('0x51')]=function(_0x20abe4,_0x215764){var _0x12594c={'raw':![],'where':{'id':_0x20abe4['params']['id']}},_0x47df73={};_0x47df73[_0x9afb('0x3a')]=_['keys'](db[_0x9afb('0x35')][_0x9afb('0x36')]);_0x47df73[_0x9afb('0x41')]=_[_0x9afb('0x3c')](_0x20abe4[_0x9afb('0x41')]);_0x47df73['filters']=_[_0x9afb('0x3e')](_0x47df73['model'],_0x47df73[_0x9afb('0x41')]);_0x12594c[_0x9afb('0x3f')]=_[_0x9afb('0x3e')](_0x47df73[_0x9afb('0x3a')],qs[_0x9afb('0x40')](_0x20abe4[_0x9afb('0x41')][_0x9afb('0x40')]));_0x12594c['attributes']=_0x12594c[_0x9afb('0x3f')][_0x9afb('0x42')]?_0x12594c[_0x9afb('0x3f')]:_0x47df73['model'];if(_0x20abe4[_0x9afb('0x41')][_0x9afb('0x4e')]){_0x12594c['include']=[{'all':!![]}];}_0x12594c=_[_0x9afb('0x4a')]({},_0x12594c,_0x20abe4[_0x9afb('0x4c')]);return db[_0x9afb('0x35')]['find'](_0x12594c)[_0x9afb('0x1e')](handleEntityNotFound(_0x215764,null))[_0x9afb('0x1e')](respondWithResult(_0x215764,null))['catch'](handleError(_0x215764,null));};exports['create']=function(_0x54d3ba,_0x1ddab6){return db['FreshsalesConfiguration'][_0x9afb('0x52')](_0x54d3ba['body'],{})[_0x9afb('0x1e')](respondWithResult(_0x1ddab6,0xc9))[_0x9afb('0x26')](handleError(_0x1ddab6,null));};exports[_0x9afb('0x53')]=function(_0x52a9cd,_0x3222f2){if(_0x52a9cd[_0x9afb('0x54')]['id']){delete _0x52a9cd[_0x9afb('0x54')]['id'];}return db[_0x9afb('0x35')][_0x9afb('0x55')]({'where':{'id':_0x52a9cd[_0x9afb('0x56')]['id']}})['then'](handleEntityNotFound(_0x3222f2,null))[_0x9afb('0x1e')](saveUpdates(_0x52a9cd[_0x9afb('0x54')],null))[_0x9afb('0x1e')](respondWithResult(_0x3222f2,null))[_0x9afb('0x26')](handleError(_0x3222f2,null));};exports['destroy']=function(_0x2826c9,_0x344164){return db['FreshsalesConfiguration'][_0x9afb('0x55')]({'where':{'id':_0x2826c9[_0x9afb('0x56')]['id']}})[_0x9afb('0x1e')](handleEntityNotFound(_0x344164,null))['then'](removeEntity(_0x344164,null))[_0x9afb('0x26')](handleError(_0x344164,null));};exports[_0x9afb('0x57')]=function(_0x158dfd,_0x41bb8e,_0x23c96c){var _0x224485={};var _0x19bd41={};var _0x2abd07;var _0x25429d;return db[_0x9afb('0x35')][_0x9afb('0x58')]({'where':{'id':_0x158dfd[_0x9afb('0x56')]['id']}})[_0x9afb('0x1e')](handleEntityNotFound(_0x41bb8e,null))['then'](function(_0x3cecd5){if(_0x3cecd5){_0x2abd07=_0x3cecd5;_0x19bd41[_0x9afb('0x3a')]=_['keys'](db[_0x9afb('0x59')][_0x9afb('0x36')]);_0x19bd41['query']=_['keys'](_0x158dfd[_0x9afb('0x41')]);_0x19bd41[_0x9afb('0x3d')]=_[_0x9afb('0x3e')](_0x19bd41[_0x9afb('0x3a')],_0x19bd41[_0x9afb('0x41')]);_0x224485['attributes']=_[_0x9afb('0x3e')](_0x19bd41[_0x9afb('0x3a')],qs[_0x9afb('0x40')](_0x158dfd[_0x9afb('0x41')][_0x9afb('0x40')]));_0x224485[_0x9afb('0x3f')]=_0x224485[_0x9afb('0x3f')][_0x9afb('0x42')]?_0x224485['attributes']:_0x19bd41[_0x9afb('0x3a')];_0x224485['order']=qs[_0x9afb('0x46')](_0x158dfd[_0x9afb('0x41')][_0x9afb('0x46')]);_0x224485[_0x9afb('0x47')]=qs[_0x9afb('0x3d')](_['pick'](_0x158dfd['query'],_0x19bd41[_0x9afb('0x3d')]));if(_0x158dfd[_0x9afb('0x41')][_0x9afb('0x49')]){_0x224485[_0x9afb('0x47')]=_[_0x9afb('0x4a')](_0x224485['where'],{'$or':_[_0x9afb('0x3b')](_0x224485[_0x9afb('0x3f')],function(_0x4da082){var _0x368c4b={};_0x368c4b[_0x4da082]={'$like':'%'+_0x158dfd[_0x9afb('0x41')]['filter']+'%'};return _0x368c4b;})});}_0x224485=_[_0x9afb('0x4a')]({},_0x224485,_0x158dfd[_0x9afb('0x4c')]);return _0x2abd07['getSubjects'](_0x224485);}})[_0x9afb('0x1e')](function(_0x5d4578){if(_0x5d4578){_0x25429d=_0x5d4578[_0x9afb('0x42')];if(!_0x158dfd[_0x9afb('0x41')][_0x9afb('0x43')](_0x9afb('0x44'))){_0x224485[_0x9afb('0x2a')]=qs['limit'](_0x158dfd['query'][_0x9afb('0x2a')]);_0x224485[_0x9afb('0x29')]=qs[_0x9afb('0x29')](_0x158dfd['query'][_0x9afb('0x29')]);}return _0x2abd07[_0x9afb('0x57')](_0x224485);}})[_0x9afb('0x1e')](function(_0x5357b4){if(_0x5357b4){return _0x5357b4?{'count':_0x25429d,'rows':_0x5357b4}:null;}})[_0x9afb('0x1e')](respondWithResult(_0x41bb8e,null))[_0x9afb('0x26')](handleError(_0x41bb8e,null));};exports[_0x9afb('0x5a')]=function(_0x392b79,_0x1c2350,_0x182600){var _0x4f3a42={};var _0x3084b3={};var _0x5b8b4a;var _0x463df3;return db[_0x9afb('0x35')][_0x9afb('0x58')]({'where':{'id':_0x392b79['params']['id']}})[_0x9afb('0x1e')](handleEntityNotFound(_0x1c2350,null))['then'](function(_0x42f132){if(_0x42f132){_0x5b8b4a=_0x42f132;_0x3084b3[_0x9afb('0x3a')]=_['keys'](db[_0x9afb('0x59')][_0x9afb('0x36')]);_0x3084b3[_0x9afb('0x41')]=_[_0x9afb('0x3c')](_0x392b79['query']);_0x3084b3[_0x9afb('0x3d')]=_[_0x9afb('0x3e')](_0x3084b3[_0x9afb('0x3a')],_0x3084b3[_0x9afb('0x41')]);_0x4f3a42[_0x9afb('0x3f')]=_['intersection'](_0x3084b3[_0x9afb('0x3a')],qs[_0x9afb('0x40')](_0x392b79['query'][_0x9afb('0x40')]));_0x4f3a42[_0x9afb('0x3f')]=_0x4f3a42[_0x9afb('0x3f')][_0x9afb('0x42')]?_0x4f3a42['attributes']:_0x3084b3[_0x9afb('0x3a')];_0x4f3a42[_0x9afb('0x45')]=qs[_0x9afb('0x46')](_0x392b79[_0x9afb('0x41')][_0x9afb('0x46')]);_0x4f3a42[_0x9afb('0x47')]=qs['filters'](_[_0x9afb('0x48')](_0x392b79['query'],_0x3084b3[_0x9afb('0x3d')]));if(_0x392b79[_0x9afb('0x41')][_0x9afb('0x49')]){_0x4f3a42[_0x9afb('0x47')]=_[_0x9afb('0x4a')](_0x4f3a42[_0x9afb('0x47')],{'$or':_[_0x9afb('0x3b')](_0x4f3a42[_0x9afb('0x3f')],function(_0x4d57a9){var _0x28c6a2={};_0x28c6a2[_0x4d57a9]={'$like':'%'+_0x392b79[_0x9afb('0x41')][_0x9afb('0x49')]+'%'};return _0x28c6a2;})});}_0x4f3a42=_[_0x9afb('0x4a')]({},_0x4f3a42,_0x392b79[_0x9afb('0x4c')]);return _0x5b8b4a[_0x9afb('0x5a')](_0x4f3a42);}})[_0x9afb('0x1e')](function(_0x189e0d){if(_0x189e0d){_0x463df3=_0x189e0d[_0x9afb('0x42')];if(!_0x392b79['query'][_0x9afb('0x43')](_0x9afb('0x44'))){_0x4f3a42[_0x9afb('0x2a')]=qs[_0x9afb('0x2a')](_0x392b79[_0x9afb('0x41')][_0x9afb('0x2a')]);_0x4f3a42['offset']=qs[_0x9afb('0x29')](_0x392b79[_0x9afb('0x41')][_0x9afb('0x29')]);}return _0x5b8b4a[_0x9afb('0x5a')](_0x4f3a42);}})['then'](function(_0x372aed){if(_0x372aed){return _0x372aed?{'count':_0x463df3,'rows':_0x372aed}:null;}})[_0x9afb('0x1e')](respondWithResult(_0x1c2350,null))[_0x9afb('0x26')](handleError(_0x1c2350,null));};exports[_0x9afb('0x5b')]=function(_0x548350,_0x24267f,_0x557ee4){var _0x9898de={};var _0x5d1d8e={};var _0x396f50;var _0xa3f4cf;return db[_0x9afb('0x35')]['findOne']({'where':{'id':_0x548350[_0x9afb('0x56')]['id']}})['then'](handleEntityNotFound(_0x24267f,null))['then'](function(_0x2d8077){if(_0x2d8077){_0x396f50=_0x2d8077;_0x5d1d8e['model']=_[_0x9afb('0x3c')](db[_0x9afb('0x59')]['rawAttributes']);_0x5d1d8e['query']=_[_0x9afb('0x3c')](_0x548350[_0x9afb('0x41')]);_0x5d1d8e['filters']=_[_0x9afb('0x3e')](_0x5d1d8e[_0x9afb('0x3a')],_0x5d1d8e[_0x9afb('0x41')]);_0x9898de['attributes']=_['intersection'](_0x5d1d8e[_0x9afb('0x3a')],qs[_0x9afb('0x40')](_0x548350[_0x9afb('0x41')][_0x9afb('0x40')]));_0x9898de[_0x9afb('0x3f')]=_0x9898de[_0x9afb('0x3f')][_0x9afb('0x42')]?_0x9898de[_0x9afb('0x3f')]:_0x5d1d8e[_0x9afb('0x3a')];_0x9898de[_0x9afb('0x45')]=qs['sort'](_0x548350[_0x9afb('0x41')][_0x9afb('0x46')]);_0x9898de['where']=qs[_0x9afb('0x3d')](_['pick'](_0x548350[_0x9afb('0x41')],_0x5d1d8e[_0x9afb('0x3d')]));if(_0x548350[_0x9afb('0x41')][_0x9afb('0x49')]){_0x9898de['where']=_[_0x9afb('0x4a')](_0x9898de['where'],{'$or':_[_0x9afb('0x3b')](_0x9898de[_0x9afb('0x3f')],function(_0x267f7b){var _0x9acaba={};_0x9acaba[_0x267f7b]={'$like':'%'+_0x548350[_0x9afb('0x41')]['filter']+'%'};return _0x9acaba;})});}_0x9898de=_['merge']({},_0x9898de,_0x548350[_0x9afb('0x4c')]);return _0x396f50['getFields'](_0x9898de);}})[_0x9afb('0x1e')](function(_0x2269cc){if(_0x2269cc){_0xa3f4cf=_0x2269cc[_0x9afb('0x42')];if(!_0x548350[_0x9afb('0x41')]['hasOwnProperty'](_0x9afb('0x44'))){_0x9898de[_0x9afb('0x2a')]=qs[_0x9afb('0x2a')](_0x548350['query'][_0x9afb('0x2a')]);_0x9898de[_0x9afb('0x29')]=qs[_0x9afb('0x29')](_0x548350['query'][_0x9afb('0x29')]);}return _0x396f50[_0x9afb('0x5b')](_0x9898de);}})['then'](function(_0x5b2efa){if(_0x5b2efa){return _0x5b2efa?{'count':_0xa3f4cf,'rows':_0x5b2efa}:null;}})[_0x9afb('0x1e')](respondWithResult(_0x24267f,null))[_0x9afb('0x26')](handleError(_0x24267f,null));}; \ No newline at end of file +var _0x44e8=['pick','filter','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','show','rawAttributes','intersection','create','body','params','find','FreshsalesField','order','sort','getSubjects','getDescriptions','nolimit','getFields','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','request','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','where'];(function(_0x37a2ea,_0x58d722){var _0x51a5ad=function(_0x27c9cd){while(--_0x27c9cd){_0x37a2ea['push'](_0x37a2ea['shift']());}};_0x51a5ad(++_0x58d722);}(_0x44e8,0xd7));var _0x844e=function(_0x294fec,_0x30ed1a){_0x294fec=_0x294fec-0x0;var _0x2e8771=_0x44e8[_0x294fec];return _0x2e8771;};'use strict';var pdf=require(_0x844e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x844e('0x1'));var jsonpatch=require(_0x844e('0x2'));var rp=require(_0x844e('0x3'));var moment=require(_0x844e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x844e('0x5'));var util=require(_0x844e('0x6'));var path=require(_0x844e('0x7'));var sox=require(_0x844e('0x8'));var csv=require('to-csv');var ejs=require(_0x844e('0x9'));var fs=require('fs');var _=require(_0x844e('0xa'));var squel=require(_0x844e('0xb'));var crypto=require(_0x844e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x844e('0xd'));var toCsv=require(_0x844e('0xe'));var querystring=require(_0x844e('0xf'));var Papa=require(_0x844e('0x10'));var Redis=require(_0x844e('0x11'));var authService=require(_0x844e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x844e('0x13'));var hardwareService=require(_0x844e('0x14'));var logger=require(_0x844e('0x15'))(_0x844e('0x16'));var utils=require(_0x844e('0x17'));var config=require(_0x844e('0x18'));var db=require(_0x844e('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x844e('0x1a')][_0x844e('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x52ac76,_0x3a09d0,_0x1cd556){if(_0x1cd556){var _0x492094=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x492094[_0x844e('0x1c')](_0x3a09d0)){return _0x52ac76;}else{throw new db[(_0x844e('0x1d'))][(_0x844e('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x52ac76;}}function respondWithRpcPromise(_0x6cc6fb,_0x465e49,_0x380eb4,_0x935134){return new BPromise(function(_0x2588a3,_0x353be9){var _0x2227c6=_0x935134||client;return _0x2227c6[_0x844e('0x1f')](_0x6cc6fb,_0x380eb4)['then'](function(_0x36286c){logger['info'](_0x844e('0x20'),_0x465e49,'request\x20sent');logger[_0x844e('0x21')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x465e49,_0x844e('0x22'),JSON[_0x844e('0x23')](_0x36286c));if(_0x36286c[_0x844e('0x24')]){if(_0x36286c[_0x844e('0x24')][_0x844e('0x25')]===0x1f4){logger[_0x844e('0x24')](_0x844e('0x20'),_0x465e49,_0x36286c[_0x844e('0x24')]['message']);return _0x353be9(_0x36286c[_0x844e('0x24')]['message']);}logger['error'](_0x844e('0x20'),_0x465e49,_0x36286c[_0x844e('0x24')][_0x844e('0x26')]);return _0x2588a3(_0x36286c[_0x844e('0x24')]['message']);}else{logger[_0x844e('0x27')](_0x844e('0x20'),_0x465e49,'request\x20sent');_0x2588a3(_0x36286c[_0x844e('0x28')][_0x844e('0x26')]);}})[_0x844e('0x29')](function(_0xdba48d){logger[_0x844e('0x24')](_0x844e('0x20'),_0x465e49,_0xdba48d);_0x353be9(_0xdba48d);});});}function respondWithStatusCode(_0x498ae0,_0x399a81){_0x399a81=_0x399a81||0xcc;return function(_0xadf0d8){if(_0xadf0d8){return _0x498ae0[_0x844e('0x2a')](_0x399a81);}return _0x498ae0[_0x844e('0x2b')](_0x399a81)[_0x844e('0x2c')]();};}function respondWithResult(_0x5d6856,_0x3725b2){_0x3725b2=_0x3725b2||0xc8;return function(_0x5080c1){if(_0x5080c1){return _0x5d6856['status'](_0x3725b2)[_0x844e('0x2d')](_0x5080c1);}};}function respondWithFilteredResult(_0x130d87,_0x355456){return function(_0x587613){if(_0x587613){var _0x489349=_0x587613[_0x844e('0x2e')],_0x2d4acd=_0x355456[_0x844e('0x2f')],_0xc3ec93=_0x355456[_0x844e('0x2f')]+_0x355456[_0x844e('0x30')],_0x54fd73;if(_0xc3ec93>=_0x489349){_0xc3ec93=_0x489349;_0x54fd73=0xc8;}else{_0x54fd73=0xce;}_0x130d87[_0x844e('0x2b')](_0x54fd73);return _0x130d87[_0x844e('0x31')](_0x844e('0x32'),_0x2d4acd+'-'+_0xc3ec93+'/'+_0x489349)[_0x844e('0x2d')](_0x587613);}return null;};}function patchUpdates(_0x618bf6){return function(_0x2e4bdf){try{jsonpatch['apply'](_0x2e4bdf,_0x618bf6,!![]);}catch(_0x54fc29){return BPromise[_0x844e('0x33')](_0x54fc29);}return _0x2e4bdf[_0x844e('0x34')]();};}function saveUpdates(_0x5f5dc3,_0x43ae36){return function(_0x31754e){if(_0x31754e){return _0x31754e[_0x844e('0x35')](_0x5f5dc3)['then'](function(_0x26d6f2){return _0x26d6f2;});}return null;};}function removeEntity(_0x34ea8b,_0x294dea){return function(_0x599aed){if(_0x599aed){return _0x599aed[_0x844e('0x36')]()[_0x844e('0x37')](function(){_0x34ea8b['status'](0xcc)[_0x844e('0x2c')]();});}};}function handleEntityNotFound(_0x10e867,_0x4eaf55){return function(_0x10769c){if(!_0x10769c){_0x10e867[_0x844e('0x2a')](0x194);}return _0x10769c;};}function handleError(_0x1f06e2,_0x3bddbd){_0x3bddbd=_0x3bddbd||0x1f4;return function(_0x672265){logger[_0x844e('0x24')](_0x672265[_0x844e('0x38')]);if(_0x672265['name']){delete _0x672265[_0x844e('0x39')];}_0x1f06e2[_0x844e('0x2b')](_0x3bddbd)[_0x844e('0x3a')](_0x672265);};}exports[_0x844e('0x3b')]=function(_0x292797,_0x41b911){var _0x5c1531={},_0x1f0ee2={},_0x10dc63={'count':0x0,'rows':[]};var _0x4155ad=_[_0x844e('0x3c')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x3ad6d5){return{'name':_0x3ad6d5[_0x844e('0x3d')],'type':_0x3ad6d5[_0x844e('0x3e')][_0x844e('0x3f')]};});_0x1f0ee2[_0x844e('0x40')]=_[_0x844e('0x3c')](_0x4155ad,_0x844e('0x39'));_0x1f0ee2[_0x844e('0x41')]=_[_0x844e('0x42')](_0x292797['query']);_0x1f0ee2[_0x844e('0x43')]=_['intersection'](_0x1f0ee2[_0x844e('0x40')],_0x1f0ee2['query']);_0x5c1531[_0x844e('0x44')]=_['intersection'](_0x1f0ee2[_0x844e('0x40')],qs[_0x844e('0x45')](_0x292797[_0x844e('0x41')][_0x844e('0x45')]));_0x5c1531[_0x844e('0x44')]=_0x5c1531[_0x844e('0x44')][_0x844e('0x46')]?_0x5c1531[_0x844e('0x44')]:_0x1f0ee2[_0x844e('0x40')];if(!_0x292797[_0x844e('0x41')][_0x844e('0x47')]('nolimit')){_0x5c1531[_0x844e('0x30')]=qs[_0x844e('0x30')](_0x292797[_0x844e('0x41')]['limit']);_0x5c1531['offset']=qs[_0x844e('0x2f')](_0x292797[_0x844e('0x41')][_0x844e('0x2f')]);}_0x5c1531['order']=qs['sort'](_0x292797['query']['sort']);_0x5c1531[_0x844e('0x48')]=qs[_0x844e('0x43')](_[_0x844e('0x49')](_0x292797[_0x844e('0x41')],_0x1f0ee2[_0x844e('0x43')]));if(_0x292797['query'][_0x844e('0x4a')]){_0x5c1531['where']=_['merge'](_0x5c1531[_0x844e('0x48')],{'$or':_[_0x844e('0x3c')](_0x4155ad,function(_0x2a57c7){if(_0x2a57c7[_0x844e('0x3e')]!=='VIRTUAL'){var _0x1993d2={};_0x1993d2[_0x2a57c7[_0x844e('0x39')]]={'$like':'%'+_0x292797[_0x844e('0x41')]['filter']+'%'};return _0x1993d2;}})});}_0x5c1531=_[_0x844e('0x4b')]({},_0x5c1531,_0x292797[_0x844e('0x4c')]);var _0x558f21={'where':_0x5c1531[_0x844e('0x48')]};return db[_0x844e('0x4d')][_0x844e('0x2e')](_0x558f21)[_0x844e('0x37')](function(_0x3c5a5e){_0x10dc63[_0x844e('0x2e')]=_0x3c5a5e;if(_0x292797['query'][_0x844e('0x4e')]){_0x5c1531[_0x844e('0x4f')]=[{'all':!![]}];}return db[_0x844e('0x4d')][_0x844e('0x50')](_0x5c1531);})[_0x844e('0x37')](function(_0x165078){_0x10dc63[_0x844e('0x51')]=_0x165078;return _0x10dc63;})[_0x844e('0x37')](respondWithFilteredResult(_0x41b911,_0x5c1531))[_0x844e('0x29')](handleError(_0x41b911,null));};exports[_0x844e('0x52')]=function(_0x4a6924,_0x32e097){var _0x694791={'raw':![],'where':{'id':_0x4a6924['params']['id']}},_0x40410d={};_0x40410d[_0x844e('0x40')]=_[_0x844e('0x42')](db[_0x844e('0x4d')][_0x844e('0x53')]);_0x40410d[_0x844e('0x41')]=_[_0x844e('0x42')](_0x4a6924[_0x844e('0x41')]);_0x40410d['filters']=_[_0x844e('0x54')](_0x40410d[_0x844e('0x40')],_0x40410d[_0x844e('0x41')]);_0x694791[_0x844e('0x44')]=_[_0x844e('0x54')](_0x40410d[_0x844e('0x40')],qs[_0x844e('0x45')](_0x4a6924[_0x844e('0x41')][_0x844e('0x45')]));_0x694791[_0x844e('0x44')]=_0x694791[_0x844e('0x44')][_0x844e('0x46')]?_0x694791[_0x844e('0x44')]:_0x40410d['model'];if(_0x4a6924[_0x844e('0x41')][_0x844e('0x4e')]){_0x694791[_0x844e('0x4f')]=[{'all':!![]}];}_0x694791=_[_0x844e('0x4b')]({},_0x694791,_0x4a6924[_0x844e('0x4c')]);return db[_0x844e('0x4d')]['find'](_0x694791)[_0x844e('0x37')](handleEntityNotFound(_0x32e097,null))[_0x844e('0x37')](respondWithResult(_0x32e097,null))['catch'](handleError(_0x32e097,null));};exports[_0x844e('0x55')]=function(_0x2ce166,_0x2e94ac){return db[_0x844e('0x4d')][_0x844e('0x55')](_0x2ce166[_0x844e('0x56')],{})[_0x844e('0x37')](respondWithResult(_0x2e94ac,0xc9))[_0x844e('0x29')](handleError(_0x2e94ac,null));};exports[_0x844e('0x35')]=function(_0x2690fc,_0x2dfda6){if(_0x2690fc[_0x844e('0x56')]['id']){delete _0x2690fc[_0x844e('0x56')]['id'];}return db[_0x844e('0x4d')]['find']({'where':{'id':_0x2690fc[_0x844e('0x57')]['id']}})[_0x844e('0x37')](handleEntityNotFound(_0x2dfda6,null))['then'](saveUpdates(_0x2690fc[_0x844e('0x56')],null))['then'](respondWithResult(_0x2dfda6,null))[_0x844e('0x29')](handleError(_0x2dfda6,null));};exports[_0x844e('0x36')]=function(_0x1a84a7,_0x5c4858){return db['FreshsalesConfiguration'][_0x844e('0x58')]({'where':{'id':_0x1a84a7[_0x844e('0x57')]['id']}})[_0x844e('0x37')](handleEntityNotFound(_0x5c4858,null))[_0x844e('0x37')](removeEntity(_0x5c4858,null))[_0x844e('0x29')](handleError(_0x5c4858,null));};exports['getSubjects']=function(_0x13ebe8,_0x3d66e4,_0x4656ab){var _0x192457={};var _0x59f8ce={};var _0x2ea345;var _0x3ea374;return db[_0x844e('0x4d')]['findOne']({'where':{'id':_0x13ebe8['params']['id']}})[_0x844e('0x37')](handleEntityNotFound(_0x3d66e4,null))[_0x844e('0x37')](function(_0xc65f4c){if(_0xc65f4c){_0x2ea345=_0xc65f4c;_0x59f8ce['model']=_['keys'](db[_0x844e('0x59')][_0x844e('0x53')]);_0x59f8ce[_0x844e('0x41')]=_['keys'](_0x13ebe8[_0x844e('0x41')]);_0x59f8ce[_0x844e('0x43')]=_[_0x844e('0x54')](_0x59f8ce['model'],_0x59f8ce[_0x844e('0x41')]);_0x192457[_0x844e('0x44')]=_[_0x844e('0x54')](_0x59f8ce[_0x844e('0x40')],qs['fields'](_0x13ebe8[_0x844e('0x41')][_0x844e('0x45')]));_0x192457[_0x844e('0x44')]=_0x192457[_0x844e('0x44')][_0x844e('0x46')]?_0x192457[_0x844e('0x44')]:_0x59f8ce[_0x844e('0x40')];_0x192457[_0x844e('0x5a')]=qs['sort'](_0x13ebe8['query'][_0x844e('0x5b')]);_0x192457['where']=qs[_0x844e('0x43')](_[_0x844e('0x49')](_0x13ebe8[_0x844e('0x41')],_0x59f8ce[_0x844e('0x43')]));if(_0x13ebe8['query']['filter']){_0x192457['where']=_['merge'](_0x192457['where'],{'$or':_['map'](_0x192457[_0x844e('0x44')],function(_0x1e8a58){var _0x211447={};_0x211447[_0x1e8a58]={'$like':'%'+_0x13ebe8['query'][_0x844e('0x4a')]+'%'};return _0x211447;})});}_0x192457=_[_0x844e('0x4b')]({},_0x192457,_0x13ebe8['options']);return _0x2ea345[_0x844e('0x5c')](_0x192457);}})['then'](function(_0x30749c){if(_0x30749c){_0x3ea374=_0x30749c[_0x844e('0x46')];if(!_0x13ebe8[_0x844e('0x41')][_0x844e('0x47')]('nolimit')){_0x192457['limit']=qs['limit'](_0x13ebe8[_0x844e('0x41')][_0x844e('0x30')]);_0x192457[_0x844e('0x2f')]=qs[_0x844e('0x2f')](_0x13ebe8[_0x844e('0x41')]['offset']);}return _0x2ea345['getSubjects'](_0x192457);}})[_0x844e('0x37')](function(_0x1fc592){if(_0x1fc592){return _0x1fc592?{'count':_0x3ea374,'rows':_0x1fc592}:null;}})[_0x844e('0x37')](respondWithResult(_0x3d66e4,null))[_0x844e('0x29')](handleError(_0x3d66e4,null));};exports[_0x844e('0x5d')]=function(_0x4637d9,_0x537dc5,_0x97d37c){var _0x46e6d7={};var _0x51534f={};var _0x429ce2;var _0x3e3eb2;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x4637d9[_0x844e('0x57')]['id']}})[_0x844e('0x37')](handleEntityNotFound(_0x537dc5,null))[_0x844e('0x37')](function(_0x4b2d23){if(_0x4b2d23){_0x429ce2=_0x4b2d23;_0x51534f['model']=_['keys'](db[_0x844e('0x59')]['rawAttributes']);_0x51534f[_0x844e('0x41')]=_[_0x844e('0x42')](_0x4637d9[_0x844e('0x41')]);_0x51534f[_0x844e('0x43')]=_[_0x844e('0x54')](_0x51534f[_0x844e('0x40')],_0x51534f['query']);_0x46e6d7[_0x844e('0x44')]=_[_0x844e('0x54')](_0x51534f['model'],qs[_0x844e('0x45')](_0x4637d9[_0x844e('0x41')][_0x844e('0x45')]));_0x46e6d7[_0x844e('0x44')]=_0x46e6d7[_0x844e('0x44')]['length']?_0x46e6d7['attributes']:_0x51534f[_0x844e('0x40')];_0x46e6d7[_0x844e('0x5a')]=qs[_0x844e('0x5b')](_0x4637d9[_0x844e('0x41')][_0x844e('0x5b')]);_0x46e6d7[_0x844e('0x48')]=qs[_0x844e('0x43')](_['pick'](_0x4637d9[_0x844e('0x41')],_0x51534f[_0x844e('0x43')]));if(_0x4637d9['query'][_0x844e('0x4a')]){_0x46e6d7[_0x844e('0x48')]=_[_0x844e('0x4b')](_0x46e6d7['where'],{'$or':_['map'](_0x46e6d7[_0x844e('0x44')],function(_0x277087){var _0x57c093={};_0x57c093[_0x277087]={'$like':'%'+_0x4637d9[_0x844e('0x41')][_0x844e('0x4a')]+'%'};return _0x57c093;})});}_0x46e6d7=_[_0x844e('0x4b')]({},_0x46e6d7,_0x4637d9[_0x844e('0x4c')]);return _0x429ce2[_0x844e('0x5d')](_0x46e6d7);}})[_0x844e('0x37')](function(_0x35d7f3){if(_0x35d7f3){_0x3e3eb2=_0x35d7f3['length'];if(!_0x4637d9[_0x844e('0x41')]['hasOwnProperty'](_0x844e('0x5e'))){_0x46e6d7['limit']=qs[_0x844e('0x30')](_0x4637d9['query'][_0x844e('0x30')]);_0x46e6d7[_0x844e('0x2f')]=qs['offset'](_0x4637d9[_0x844e('0x41')][_0x844e('0x2f')]);}return _0x429ce2[_0x844e('0x5d')](_0x46e6d7);}})[_0x844e('0x37')](function(_0x4508af){if(_0x4508af){return _0x4508af?{'count':_0x3e3eb2,'rows':_0x4508af}:null;}})['then'](respondWithResult(_0x537dc5,null))[_0x844e('0x29')](handleError(_0x537dc5,null));};exports[_0x844e('0x5f')]=function(_0x2a87e6,_0x332027,_0x220b2c){var _0x1e7d57={};var _0x167c46={};var _0x201d25;var _0x216482;return db[_0x844e('0x4d')]['findOne']({'where':{'id':_0x2a87e6[_0x844e('0x57')]['id']}})[_0x844e('0x37')](handleEntityNotFound(_0x332027,null))[_0x844e('0x37')](function(_0x3af060){if(_0x3af060){_0x201d25=_0x3af060;_0x167c46[_0x844e('0x40')]=_[_0x844e('0x42')](db[_0x844e('0x59')][_0x844e('0x53')]);_0x167c46[_0x844e('0x41')]=_[_0x844e('0x42')](_0x2a87e6[_0x844e('0x41')]);_0x167c46[_0x844e('0x43')]=_[_0x844e('0x54')](_0x167c46[_0x844e('0x40')],_0x167c46[_0x844e('0x41')]);_0x1e7d57['attributes']=_[_0x844e('0x54')](_0x167c46['model'],qs[_0x844e('0x45')](_0x2a87e6[_0x844e('0x41')][_0x844e('0x45')]));_0x1e7d57[_0x844e('0x44')]=_0x1e7d57[_0x844e('0x44')]['length']?_0x1e7d57[_0x844e('0x44')]:_0x167c46[_0x844e('0x40')];_0x1e7d57[_0x844e('0x5a')]=qs['sort'](_0x2a87e6['query'][_0x844e('0x5b')]);_0x1e7d57[_0x844e('0x48')]=qs['filters'](_[_0x844e('0x49')](_0x2a87e6[_0x844e('0x41')],_0x167c46[_0x844e('0x43')]));if(_0x2a87e6[_0x844e('0x41')][_0x844e('0x4a')]){_0x1e7d57[_0x844e('0x48')]=_[_0x844e('0x4b')](_0x1e7d57[_0x844e('0x48')],{'$or':_[_0x844e('0x3c')](_0x1e7d57['attributes'],function(_0x357361){var _0x47d5e9={};_0x47d5e9[_0x357361]={'$like':'%'+_0x2a87e6[_0x844e('0x41')][_0x844e('0x4a')]+'%'};return _0x47d5e9;})});}_0x1e7d57=_[_0x844e('0x4b')]({},_0x1e7d57,_0x2a87e6[_0x844e('0x4c')]);return _0x201d25[_0x844e('0x5f')](_0x1e7d57);}})['then'](function(_0x3fd6d0){if(_0x3fd6d0){_0x216482=_0x3fd6d0[_0x844e('0x46')];if(!_0x2a87e6['query'][_0x844e('0x47')](_0x844e('0x5e'))){_0x1e7d57[_0x844e('0x30')]=qs[_0x844e('0x30')](_0x2a87e6[_0x844e('0x41')]['limit']);_0x1e7d57[_0x844e('0x2f')]=qs[_0x844e('0x2f')](_0x2a87e6['query']['offset']);}return _0x201d25['getFields'](_0x1e7d57);}})[_0x844e('0x37')](function(_0x8b5128){if(_0x8b5128){return _0x8b5128?{'count':_0x216482,'rows':_0x8b5128}:null;}})['then'](respondWithResult(_0x332027,null))[_0x844e('0x29')](handleError(_0x332027,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index b2220f7..666a5a4 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5bc5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util'];(function(_0x23f0c6,_0x4609e7){var _0x52227e=function(_0x2ed543){while(--_0x2ed543){_0x23f0c6['push'](_0x23f0c6['shift']());}};_0x52227e(++_0x4609e7);}(_0x5bc5,0xb2));var _0x55bc=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x5bc5[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x55bc('0x0'));var util=require(_0x55bc('0x1'));var logger=require(_0x55bc('0x2'))(_0x55bc('0x3'));var moment=require(_0x55bc('0x4'));var BPromise=require(_0x55bc('0x5'));var rp=require(_0x55bc('0x6'));var fs=require('fs');var path=require(_0x55bc('0x7'));var rimraf=require(_0x55bc('0x8'));var config=require(_0x55bc('0x9'));var attributes=require(_0x55bc('0xa'));module[_0x55bc('0xb')]=function(_0x188eb6,_0x5d5f1d){return _0x188eb6[_0x55bc('0xc')](_0x55bc('0xd'),attributes,{'tableName':_0x55bc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7119=['rimraf','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','util','api','bluebird','request-promise','path'];(function(_0x2dde9c,_0x3915dc){var _0x52cfdd=function(_0x158292){while(--_0x158292){_0x2dde9c['push'](_0x2dde9c['shift']());}};_0x52cfdd(++_0x3915dc);}(_0x7119,0x1c7));var _0x9711=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0x7119[_0x427d3a];return _0xe5c521;};'use strict';var _=require('lodash');var util=require(_0x9711('0x0'));var logger=require('../../config/logger')(_0x9711('0x1'));var moment=require('moment');var BPromise=require(_0x9711('0x2'));var rp=require(_0x9711('0x3'));var fs=require('fs');var path=require(_0x9711('0x4'));var rimraf=require(_0x9711('0x5'));var config=require('../../config/environment');var attributes=require(_0x9711('0x6'));module[_0x9711('0x7')]=function(_0x2ffe6c,_0x101827){return _0x2ffe6c[_0x9711('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x9711('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 1a4f95c..343272d 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9aea=['result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x411e97,_0x4848d5){var _0x1498ad=function(_0x57d5b6){while(--_0x57d5b6){_0x411e97['push'](_0x411e97['shift']());}};_0x1498ad(++_0x4848d5);}(_0x9aea,0xdd));var _0xa9ae=function(_0x8adf3d,_0x39c164){_0x8adf3d=_0x8adf3d-0x0;var _0x59620b=_0x9aea[_0x8adf3d];return _0x59620b;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var moment=require(_0xa9ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9ae('0x2'));var fs=require('fs');var Redis=require(_0xa9ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9ae('0x4'));var logger=require(_0xa9ae('0x5'))(_0xa9ae('0x6'));var config=require(_0xa9ae('0x7'));var jayson=require(_0xa9ae('0x8'));var client=jayson['client'][_0xa9ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22734b,_0x1e57c4,_0x53e52c){return new BPromise(function(_0x1f2e4b,_0x3917f0){return client[_0xa9ae('0xa')](_0x22734b,_0x53e52c)[_0xa9ae('0xb')](function(_0x1882dc){logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));logger[_0xa9ae('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1e57c4,_0xa9ae('0xe'),JSON['stringify'](_0x1882dc));if(_0x1882dc[_0xa9ae('0x10')]){if(_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x11')]===0x1f4){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x3917f0(_0x1882dc[_0xa9ae('0x10')]['message']);}logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x1f2e4b(_0x1882dc['error'][_0xa9ae('0x12')]);}else{logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));_0x1f2e4b(_0x1882dc[_0xa9ae('0x13')][_0xa9ae('0x12')]);}})['catch'](function(_0x3e4810){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x3e4810);_0x3917f0(_0x3e4810);});});} \ No newline at end of file +var _0x682e=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x682e,0x1ce));var _0xe682=function(_0x5ea87c,_0x249248){_0x5ea87c=_0x5ea87c-0x0;var _0x3868de=_0x682e[_0x5ea87c];return _0x3868de;};'use strict';var _=require(_0xe682('0x0'));var util=require(_0xe682('0x1'));var moment=require(_0xe682('0x2'));var BPromise=require(_0xe682('0x3'));var rs=require(_0xe682('0x4'));var fs=require('fs');var Redis=require(_0xe682('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe682('0x6'));var logger=require(_0xe682('0x7'))(_0xe682('0x8'));var config=require(_0xe682('0x9'));var jayson=require(_0xe682('0xa'));var client=jayson[_0xe682('0xb')][_0xe682('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd6995,_0x68a2e3,_0x1ab428){return new BPromise(function(_0x4e7e7d,_0x1817bf){return client[_0xe682('0xd')](_0xd6995,_0x1ab428)[_0xe682('0xe')](function(_0x2c098f){logger[_0xe682('0xf')](_0xe682('0x10'),_0x68a2e3,'request\x20sent');logger[_0xe682('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x68a2e3,_0xe682('0x12'),JSON['stringify'](_0x2c098f));if(_0x2c098f['error']){if(_0x2c098f[_0xe682('0x13')][_0xe682('0x14')]===0x1f4){logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);return _0x1817bf(_0x2c098f['error'][_0xe682('0x15')]);}logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);return _0x4e7e7d(_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);}else{logger[_0xe682('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x68a2e3,_0xe682('0x12'));_0x4e7e7d(_0x2c098f['result']['message']);}})['catch'](function(_0x14fc2f){logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x14fc2f);_0x1817bf(_0x14fc2f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 137fd89..a6b474a 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88e5=['get','/:id','show','create','put','update','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x88e5,0xac));var _0x588e=function(_0x335065,_0x3088a7){_0x335065=_0x335065-0x0;var _0xe2100b=_0x88e5[_0x335065];return _0xe2100b;};'use strict';var multer=require('multer');var util=require(_0x588e('0x0'));var path=require(_0x588e('0x1'));var timeout=require('connect-timeout');var express=require(_0x588e('0x2'));var router=express[_0x588e('0x3')]();var auth=require(_0x588e('0x4'));var interaction=require(_0x588e('0x5'));var config=require(_0x588e('0x6'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x588e('0x7')](),controller['index']);router[_0x588e('0x8')](_0x588e('0x9'),auth[_0x588e('0x7')](),controller[_0x588e('0xa')]);router['post']('/',auth[_0x588e('0x7')](),controller[_0x588e('0xb')]);router[_0x588e('0xc')](_0x588e('0x9'),auth[_0x588e('0x7')](),controller[_0x588e('0xd')]);router['delete'](_0x588e('0x9'),auth['isAuthenticated'](),controller[_0x588e('0xe')]);module['exports']=router; \ No newline at end of file +var _0xccae=['../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccae,0x1b5));var _0xecca=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xccae[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0xecca('0x0'));var util=require(_0xecca('0x1'));var path=require(_0xecca('0x2'));var timeout=require(_0xecca('0x3'));var express=require('express');var router=express[_0xecca('0x4')]();var auth=require(_0xecca('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xecca('0x6'));router[_0xecca('0x7')]('/',auth[_0xecca('0x8')](),controller[_0xecca('0x9')]);router[_0xecca('0x7')](_0xecca('0xa'),auth[_0xecca('0x8')](),controller[_0xecca('0xb')]);router[_0xecca('0xc')]('/',auth[_0xecca('0x8')](),controller['create']);router[_0xecca('0xd')](_0xecca('0xa'),auth[_0xecca('0x8')](),controller['update']);router[_0xecca('0xe')](_0xecca('0xa'),auth['isAuthenticated'](),controller[_0xecca('0xf')]);module[_0xecca('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 33cdded..f28ae38 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3934=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x5c98f1,_0x38a1db){var _0x2e50de=function(_0x8959f0){while(--_0x8959f0){_0x5c98f1['push'](_0x5c98f1['shift']());}};_0x2e50de(++_0x38a1db);}(_0x3934,0x10e));var _0x4393=function(_0x32b161,_0x1a6d39){_0x32b161=_0x32b161-0x0;var _0x3ed298=_0x3934[_0x32b161];return _0x3ed298;};'use strict';var Sequelize=require(_0x4393('0x0'));module[_0x4393('0x1')]={'type':{'type':Sequelize[_0x4393('0x2')](_0x4393('0x3'),_0x4393('0x4'),_0x4393('0x5'),_0x4393('0x6')),'defaultValue':_0x4393('0x3')},'content':{'type':Sequelize[_0x4393('0x7')]},'key':{'type':Sequelize[_0x4393('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4393('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x4393('0x7')]},'idField':{'type':Sequelize[_0x4393('0x7')]},'nameField':{'type':Sequelize[_0x4393('0x7')]},'customField':{'type':Sequelize[_0x4393('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x54ef=['keyValue','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x4c16cf,_0x311772){var _0x1ac4ae=function(_0x22d19a){while(--_0x22d19a){_0x4c16cf['push'](_0x4c16cf['shift']());}};_0x1ac4ae(++_0x311772);}(_0x54ef,0x112));var _0xf54e=function(_0x3c418e,_0x13cb6a){_0x3c418e=_0x3c418e-0x0;var _0x2c1189=_0x54ef[_0x3c418e];return _0x2c1189;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'type':{'type':Sequelize[_0xf54e('0x2')]('string',_0xf54e('0x3'),_0xf54e('0x4'),_0xf54e('0x5')),'defaultValue':_0xf54e('0x6')},'content':{'type':Sequelize[_0xf54e('0x7')]},'key':{'type':Sequelize[_0xf54e('0x7')]},'keyType':{'type':Sequelize[_0xf54e('0x2')]('string','variable',_0xf54e('0x4'))},'keyContent':{'type':Sequelize[_0xf54e('0x7')]},'idField':{'type':Sequelize[_0xf54e('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf54e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 6b857f9..679e79d 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51c5=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','reject','save','update','destroy','then','end','error','stack','name','index','map','FreshsalesField','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf'];(function(_0x3d967c,_0x47747b){var _0x6a7c33=function(_0x2503cd){while(--_0x2503cd){_0x3d967c['push'](_0x3d967c['shift']());}};_0x6a7c33(++_0x47747b);}(_0x51c5,0x8f));var _0x551c=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x51c5[_0x44bcb0];return _0xfaf881;};'use strict';var pdf=require(_0x551c('0x0'));var emlformat=require(_0x551c('0x1'));var rimraf=require(_0x551c('0x2'));var zipdir=require(_0x551c('0x3'));var jsonpatch=require(_0x551c('0x4'));var rp=require(_0x551c('0x5'));var moment=require(_0x551c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x551c('0x7'));var util=require(_0x551c('0x8'));var path=require(_0x551c('0x9'));var sox=require(_0x551c('0xa'));var csv=require(_0x551c('0xb'));var ejs=require(_0x551c('0xc'));var fs=require('fs');var _=require(_0x551c('0xd'));var squel=require(_0x551c('0xe'));var crypto=require('crypto');var jsforce=require(_0x551c('0xf'));var deskjs=require(_0x551c('0x10'));var toCsv=require(_0x551c('0xb'));var querystring=require('querystring');var Papa=require(_0x551c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x551c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x551c('0x13'))(_0x551c('0x14'));var utils=require(_0x551c('0x15'));var config=require(_0x551c('0x16'));var db=require(_0x551c('0x17'))['db'];function respondWithStatusCode(_0x280dfa,_0x57aa1b){_0x57aa1b=_0x57aa1b||0xcc;return function(_0x1fbcfd){if(_0x1fbcfd){return _0x280dfa[_0x551c('0x18')](_0x57aa1b);}return _0x280dfa[_0x551c('0x19')](_0x57aa1b)['end']();};}function respondWithResult(_0x3cae3f,_0x3d3984){_0x3d3984=_0x3d3984||0xc8;return function(_0x5b6df4){if(_0x5b6df4){return _0x3cae3f[_0x551c('0x19')](_0x3d3984)['json'](_0x5b6df4);}};}function respondWithFilteredResult(_0x10c5b6,_0x3860a1){return function(_0x15dee8){if(_0x15dee8){var _0x107305=_0x15dee8[_0x551c('0x1a')],_0x5da620=_0x3860a1['offset'],_0x5213ec=_0x3860a1[_0x551c('0x1b')]+_0x3860a1[_0x551c('0x1c')],_0x678e29;if(_0x5213ec>=_0x107305){_0x5213ec=_0x107305;_0x678e29=0xc8;}else{_0x678e29=0xce;}_0x10c5b6[_0x551c('0x19')](_0x678e29);return _0x10c5b6[_0x551c('0x1d')]('Content-Range',_0x5da620+'-'+_0x5213ec+'/'+_0x107305)['json'](_0x15dee8);}return null;};}function patchUpdates(_0x491fec){return function(_0x2539bd){try{jsonpatch['apply'](_0x2539bd,_0x491fec,!![]);}catch(_0x5f1d20){return BPromise[_0x551c('0x1e')](_0x5f1d20);}return _0x2539bd[_0x551c('0x1f')]();};}function saveUpdates(_0x3c232c,_0x1927e7){return function(_0x708f15){if(_0x708f15){return _0x708f15[_0x551c('0x20')](_0x3c232c)['then'](function(_0x50621a){return _0x50621a;});}return null;};}function removeEntity(_0x2b77f4,_0x52b074){return function(_0x330160){if(_0x330160){return _0x330160[_0x551c('0x21')]()[_0x551c('0x22')](function(){_0x2b77f4[_0x551c('0x19')](0xcc)[_0x551c('0x23')]();});}};}function handleEntityNotFound(_0x5bb391,_0x4c77cd){return function(_0x194a1d){if(!_0x194a1d){_0x5bb391[_0x551c('0x18')](0x194);}return _0x194a1d;};}function handleError(_0x164343,_0x30f639){_0x30f639=_0x30f639||0x1f4;return function(_0x2a2c86){logger[_0x551c('0x24')](_0x2a2c86[_0x551c('0x25')]);if(_0x2a2c86[_0x551c('0x26')]){delete _0x2a2c86[_0x551c('0x26')];}_0x164343[_0x551c('0x19')](_0x30f639)['send'](_0x2a2c86);};}exports[_0x551c('0x27')]=function(_0x29432e,_0x5419fd){var _0x30bf74={},_0x1cdd2f={},_0x497a81={'count':0x0,'rows':[]};var _0x14e56e=_[_0x551c('0x28')](db[_0x551c('0x29')][_0x551c('0x2a')],function(_0x2a1645){return{'name':_0x2a1645['fieldName'],'type':_0x2a1645[_0x551c('0x2b')][_0x551c('0x2c')]};});_0x1cdd2f[_0x551c('0x2d')]=_['map'](_0x14e56e,_0x551c('0x26'));_0x1cdd2f[_0x551c('0x2e')]=_['keys'](_0x29432e['query']);_0x1cdd2f[_0x551c('0x2f')]=_[_0x551c('0x30')](_0x1cdd2f['model'],_0x1cdd2f[_0x551c('0x2e')]);_0x30bf74['attributes']=_['intersection'](_0x1cdd2f['model'],qs[_0x551c('0x31')](_0x29432e['query'][_0x551c('0x31')]));_0x30bf74[_0x551c('0x32')]=_0x30bf74['attributes'][_0x551c('0x33')]?_0x30bf74['attributes']:_0x1cdd2f[_0x551c('0x2d')];if(!_0x29432e[_0x551c('0x2e')][_0x551c('0x34')](_0x551c('0x35'))){_0x30bf74[_0x551c('0x1c')]=qs[_0x551c('0x1c')](_0x29432e[_0x551c('0x2e')]['limit']);_0x30bf74[_0x551c('0x1b')]=qs[_0x551c('0x1b')](_0x29432e['query'][_0x551c('0x1b')]);}_0x30bf74[_0x551c('0x36')]=qs['sort'](_0x29432e['query'][_0x551c('0x37')]);_0x30bf74[_0x551c('0x38')]=qs[_0x551c('0x2f')](_[_0x551c('0x39')](_0x29432e[_0x551c('0x2e')],_0x1cdd2f[_0x551c('0x2f')]));if(_0x29432e[_0x551c('0x2e')][_0x551c('0x3a')]){_0x30bf74[_0x551c('0x38')]=_[_0x551c('0x3b')](_0x30bf74['where'],{'$or':_['map'](_0x14e56e,function(_0x4c6993){if(_0x4c6993['type']!=='VIRTUAL'){var _0x5b88d0={};_0x5b88d0[_0x4c6993[_0x551c('0x26')]]={'$like':'%'+_0x29432e[_0x551c('0x2e')][_0x551c('0x3a')]+'%'};return _0x5b88d0;}})});}_0x30bf74=_[_0x551c('0x3b')]({},_0x30bf74,_0x29432e[_0x551c('0x3c')]);var _0x1d2c17={'where':_0x30bf74[_0x551c('0x38')]};return db[_0x551c('0x29')][_0x551c('0x1a')](_0x1d2c17)[_0x551c('0x22')](function(_0x16b3b5){_0x497a81[_0x551c('0x1a')]=_0x16b3b5;if(_0x29432e[_0x551c('0x2e')][_0x551c('0x3d')]){_0x30bf74[_0x551c('0x3e')]=[{'all':!![]}];}return db[_0x551c('0x29')][_0x551c('0x3f')](_0x30bf74);})[_0x551c('0x22')](function(_0x44b42c){_0x497a81[_0x551c('0x40')]=_0x44b42c;return _0x497a81;})[_0x551c('0x22')](respondWithFilteredResult(_0x5419fd,_0x30bf74))[_0x551c('0x41')](handleError(_0x5419fd,null));};exports[_0x551c('0x42')]=function(_0x1371c9,_0x1524b4){var _0x5e9404={'raw':!![],'where':{'id':_0x1371c9[_0x551c('0x43')]['id']}},_0x2759b4={};_0x2759b4[_0x551c('0x2d')]=_[_0x551c('0x44')](db[_0x551c('0x29')][_0x551c('0x2a')]);_0x2759b4['query']=_[_0x551c('0x44')](_0x1371c9[_0x551c('0x2e')]);_0x2759b4[_0x551c('0x2f')]=_[_0x551c('0x30')](_0x2759b4[_0x551c('0x2d')],_0x2759b4['query']);_0x5e9404[_0x551c('0x32')]=_['intersection'](_0x2759b4['model'],qs[_0x551c('0x31')](_0x1371c9['query'][_0x551c('0x31')]));_0x5e9404[_0x551c('0x32')]=_0x5e9404[_0x551c('0x32')][_0x551c('0x33')]?_0x5e9404[_0x551c('0x32')]:_0x2759b4[_0x551c('0x2d')];if(_0x1371c9['query'][_0x551c('0x3d')]){_0x5e9404[_0x551c('0x3e')]=[{'all':!![]}];}_0x5e9404=_['merge']({},_0x5e9404,_0x1371c9[_0x551c('0x3c')]);return db[_0x551c('0x29')][_0x551c('0x45')](_0x5e9404)[_0x551c('0x22')](handleEntityNotFound(_0x1524b4,null))[_0x551c('0x22')](respondWithResult(_0x1524b4,null))[_0x551c('0x41')](handleError(_0x1524b4,null));};exports['create']=function(_0x3b6a40,_0x51e964){return db[_0x551c('0x29')][_0x551c('0x46')](_0x3b6a40[_0x551c('0x47')],{})[_0x551c('0x22')](respondWithResult(_0x51e964,0xc9))['catch'](handleError(_0x51e964,null));};exports[_0x551c('0x20')]=function(_0x3b1a3d,_0x282063){if(_0x3b1a3d[_0x551c('0x47')]['id']){delete _0x3b1a3d['body']['id'];}return db[_0x551c('0x29')]['find']({'where':{'id':_0x3b1a3d[_0x551c('0x43')]['id']}})[_0x551c('0x22')](handleEntityNotFound(_0x282063,null))[_0x551c('0x22')](saveUpdates(_0x3b1a3d[_0x551c('0x47')],null))[_0x551c('0x22')](respondWithResult(_0x282063,null))['catch'](handleError(_0x282063,null));};exports[_0x551c('0x21')]=function(_0x52b880,_0x4fb24f){return db[_0x551c('0x29')]['find']({'where':{'id':_0x52b880[_0x551c('0x43')]['id']}})['then'](handleEntityNotFound(_0x4fb24f,null))[_0x551c('0x22')](removeEntity(_0x4fb24f,null))[_0x551c('0x41')](handleError(_0x4fb24f,null));}; \ No newline at end of file +var _0xd3d1=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','limit','status','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','FreshsalesField','fieldName','type','key','keys','filters','intersection','query','attributes','model','fields','hasOwnProperty','offset','where','pick','filter','includeAll','include','findAll','catch','show','params','rawAttributes','length','merge','options','find','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment'];(function(_0x4bf942,_0x3c5cdb){var _0xc60d52=function(_0x17141a){while(--_0x17141a){_0x4bf942['push'](_0x4bf942['shift']());}};_0xc60d52(++_0x3c5cdb);}(_0xd3d1,0x172));var _0x1d3d=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xd3d1[_0xbd08b4];return _0x314f1e;};'use strict';var pdf=require(_0x1d3d('0x0'));var emlformat=require(_0x1d3d('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1d3d('0x2'));var rp=require(_0x1d3d('0x3'));var moment=require(_0x1d3d('0x4'));var BPromise=require(_0x1d3d('0x5'));var Mustache=require(_0x1d3d('0x6'));var util=require(_0x1d3d('0x7'));var path=require(_0x1d3d('0x8'));var sox=require(_0x1d3d('0x9'));var csv=require(_0x1d3d('0xa'));var ejs=require(_0x1d3d('0xb'));var fs=require('fs');var _=require(_0x1d3d('0xc'));var squel=require(_0x1d3d('0xd'));var crypto=require(_0x1d3d('0xe'));var jsforce=require(_0x1d3d('0xf'));var deskjs=require(_0x1d3d('0x10'));var toCsv=require(_0x1d3d('0xa'));var querystring=require(_0x1d3d('0x11'));var Papa=require('papaparse');var Redis=require(_0x1d3d('0x12'));var authService=require(_0x1d3d('0x13'));var qs=require(_0x1d3d('0x14'));var as=require(_0x1d3d('0x15'));var hardwareService=require(_0x1d3d('0x16'));var logger=require(_0x1d3d('0x17'))(_0x1d3d('0x18'));var utils=require(_0x1d3d('0x19'));var config=require(_0x1d3d('0x1a'));var db=require(_0x1d3d('0x1b'))['db'];function respondWithStatusCode(_0x29e17e,_0x479216){_0x479216=_0x479216||0xcc;return function(_0xb587d){if(_0xb587d){return _0x29e17e[_0x1d3d('0x1c')](_0x479216);}return _0x29e17e['status'](_0x479216)['end']();};}function respondWithResult(_0x12bd00,_0x2f5b7f){_0x2f5b7f=_0x2f5b7f||0xc8;return function(_0x1a8035){if(_0x1a8035){return _0x12bd00['status'](_0x2f5b7f)[_0x1d3d('0x1d')](_0x1a8035);}};}function respondWithFilteredResult(_0x4dcc22,_0x1d54f3){return function(_0x33e7d9){if(_0x33e7d9){var _0x3491e4=_0x33e7d9[_0x1d3d('0x1e')],_0x24bb8c=_0x1d54f3['offset'],_0x21c2e4=_0x1d54f3['offset']+_0x1d54f3[_0x1d3d('0x1f')],_0x1bdbdc;if(_0x21c2e4>=_0x3491e4){_0x21c2e4=_0x3491e4;_0x1bdbdc=0xc8;}else{_0x1bdbdc=0xce;}_0x4dcc22[_0x1d3d('0x20')](_0x1bdbdc);return _0x4dcc22['set'](_0x1d3d('0x21'),_0x24bb8c+'-'+_0x21c2e4+'/'+_0x3491e4)['json'](_0x33e7d9);}return null;};}function patchUpdates(_0x1eade8){return function(_0x392e92){try{jsonpatch[_0x1d3d('0x22')](_0x392e92,_0x1eade8,!![]);}catch(_0x2d6dfb){return BPromise['reject'](_0x2d6dfb);}return _0x392e92[_0x1d3d('0x23')]();};}function saveUpdates(_0x56db7a,_0x56c424){return function(_0x108005){if(_0x108005){return _0x108005[_0x1d3d('0x24')](_0x56db7a)[_0x1d3d('0x25')](function(_0x344a03){return _0x344a03;});}return null;};}function removeEntity(_0xa6f180,_0xe4afa2){return function(_0x471df5){if(_0x471df5){return _0x471df5[_0x1d3d('0x26')]()[_0x1d3d('0x25')](function(){_0xa6f180[_0x1d3d('0x20')](0xcc)[_0x1d3d('0x27')]();});}};}function handleEntityNotFound(_0x502921,_0xfc3606){return function(_0x72868d){if(!_0x72868d){_0x502921['sendStatus'](0x194);}return _0x72868d;};}function handleError(_0x3639f1,_0x5c52da){_0x5c52da=_0x5c52da||0x1f4;return function(_0x467ea7){logger[_0x1d3d('0x28')](_0x467ea7[_0x1d3d('0x29')]);if(_0x467ea7[_0x1d3d('0x2a')]){delete _0x467ea7[_0x1d3d('0x2a')];}_0x3639f1[_0x1d3d('0x20')](_0x5c52da)[_0x1d3d('0x2b')](_0x467ea7);};}exports[_0x1d3d('0x2c')]=function(_0x2294ee,_0x2df7b7){var _0x172dbd={},_0x4f0aa7={},_0x3f5681={'count':0x0,'rows':[]};var _0x5b2986=_[_0x1d3d('0x2d')](db[_0x1d3d('0x2e')]['rawAttributes'],function(_0x185913){return{'name':_0x185913[_0x1d3d('0x2f')],'type':_0x185913[_0x1d3d('0x30')][_0x1d3d('0x31')]};});_0x4f0aa7['model']=_[_0x1d3d('0x2d')](_0x5b2986,_0x1d3d('0x2a'));_0x4f0aa7['query']=_[_0x1d3d('0x32')](_0x2294ee['query']);_0x4f0aa7[_0x1d3d('0x33')]=_[_0x1d3d('0x34')](_0x4f0aa7['model'],_0x4f0aa7[_0x1d3d('0x35')]);_0x172dbd[_0x1d3d('0x36')]=_[_0x1d3d('0x34')](_0x4f0aa7[_0x1d3d('0x37')],qs[_0x1d3d('0x38')](_0x2294ee[_0x1d3d('0x35')][_0x1d3d('0x38')]));_0x172dbd[_0x1d3d('0x36')]=_0x172dbd[_0x1d3d('0x36')]['length']?_0x172dbd[_0x1d3d('0x36')]:_0x4f0aa7[_0x1d3d('0x37')];if(!_0x2294ee[_0x1d3d('0x35')][_0x1d3d('0x39')]('nolimit')){_0x172dbd['limit']=qs[_0x1d3d('0x1f')](_0x2294ee[_0x1d3d('0x35')]['limit']);_0x172dbd[_0x1d3d('0x3a')]=qs[_0x1d3d('0x3a')](_0x2294ee[_0x1d3d('0x35')][_0x1d3d('0x3a')]);}_0x172dbd['order']=qs['sort'](_0x2294ee[_0x1d3d('0x35')]['sort']);_0x172dbd[_0x1d3d('0x3b')]=qs[_0x1d3d('0x33')](_[_0x1d3d('0x3c')](_0x2294ee[_0x1d3d('0x35')],_0x4f0aa7[_0x1d3d('0x33')]));if(_0x2294ee[_0x1d3d('0x35')][_0x1d3d('0x3d')]){_0x172dbd[_0x1d3d('0x3b')]=_['merge'](_0x172dbd[_0x1d3d('0x3b')],{'$or':_['map'](_0x5b2986,function(_0x58ae8e){if(_0x58ae8e[_0x1d3d('0x30')]!=='VIRTUAL'){var _0x175e8a={};_0x175e8a[_0x58ae8e[_0x1d3d('0x2a')]]={'$like':'%'+_0x2294ee[_0x1d3d('0x35')][_0x1d3d('0x3d')]+'%'};return _0x175e8a;}})});}_0x172dbd=_['merge']({},_0x172dbd,_0x2294ee['options']);var _0x434dad={'where':_0x172dbd['where']};return db[_0x1d3d('0x2e')][_0x1d3d('0x1e')](_0x434dad)['then'](function(_0x1ad7a6){_0x3f5681[_0x1d3d('0x1e')]=_0x1ad7a6;if(_0x2294ee['query'][_0x1d3d('0x3e')]){_0x172dbd[_0x1d3d('0x3f')]=[{'all':!![]}];}return db[_0x1d3d('0x2e')][_0x1d3d('0x40')](_0x172dbd);})[_0x1d3d('0x25')](function(_0x36c713){_0x3f5681['rows']=_0x36c713;return _0x3f5681;})[_0x1d3d('0x25')](respondWithFilteredResult(_0x2df7b7,_0x172dbd))[_0x1d3d('0x41')](handleError(_0x2df7b7,null));};exports[_0x1d3d('0x42')]=function(_0x3941bd,_0x232b62){var _0x5f007e={'raw':!![],'where':{'id':_0x3941bd[_0x1d3d('0x43')]['id']}},_0x327e73={};_0x327e73[_0x1d3d('0x37')]=_[_0x1d3d('0x32')](db['FreshsalesField'][_0x1d3d('0x44')]);_0x327e73[_0x1d3d('0x35')]=_[_0x1d3d('0x32')](_0x3941bd[_0x1d3d('0x35')]);_0x327e73[_0x1d3d('0x33')]=_['intersection'](_0x327e73['model'],_0x327e73[_0x1d3d('0x35')]);_0x5f007e[_0x1d3d('0x36')]=_[_0x1d3d('0x34')](_0x327e73[_0x1d3d('0x37')],qs[_0x1d3d('0x38')](_0x3941bd['query'][_0x1d3d('0x38')]));_0x5f007e['attributes']=_0x5f007e[_0x1d3d('0x36')][_0x1d3d('0x45')]?_0x5f007e[_0x1d3d('0x36')]:_0x327e73[_0x1d3d('0x37')];if(_0x3941bd['query'][_0x1d3d('0x3e')]){_0x5f007e[_0x1d3d('0x3f')]=[{'all':!![]}];}_0x5f007e=_[_0x1d3d('0x46')]({},_0x5f007e,_0x3941bd[_0x1d3d('0x47')]);return db[_0x1d3d('0x2e')][_0x1d3d('0x48')](_0x5f007e)[_0x1d3d('0x25')](handleEntityNotFound(_0x232b62,null))['then'](respondWithResult(_0x232b62,null))[_0x1d3d('0x41')](handleError(_0x232b62,null));};exports['create']=function(_0x160f88,_0x256ecc){return db['FreshsalesField'][_0x1d3d('0x49')](_0x160f88['body'],{})[_0x1d3d('0x25')](respondWithResult(_0x256ecc,0xc9))['catch'](handleError(_0x256ecc,null));};exports[_0x1d3d('0x24')]=function(_0xebd1f4,_0x1dafe8){if(_0xebd1f4[_0x1d3d('0x4a')]['id']){delete _0xebd1f4[_0x1d3d('0x4a')]['id'];}return db[_0x1d3d('0x2e')][_0x1d3d('0x48')]({'where':{'id':_0xebd1f4[_0x1d3d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1dafe8,null))['then'](saveUpdates(_0xebd1f4['body'],null))[_0x1d3d('0x25')](respondWithResult(_0x1dafe8,null))[_0x1d3d('0x41')](handleError(_0x1dafe8,null));};exports[_0x1d3d('0x26')]=function(_0x3856d5,_0x438c61){return db[_0x1d3d('0x2e')]['find']({'where':{'id':_0x3856d5['params']['id']}})['then'](handleEntityNotFound(_0x438c61,null))['then'](removeEntity(_0x438c61,null))[_0x1d3d('0x41')](handleError(_0x438c61,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index c32eacb..624df1a 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9053=['FieldId','util','moment','bluebird','path','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','idField'];(function(_0x411200,_0x2232fa){var _0x21a6df=function(_0x3047ea){while(--_0x3047ea){_0x411200['push'](_0x411200['shift']());}};_0x21a6df(++_0x2232fa);}(_0x9053,0x161));var _0x3905=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0x9053[_0xa4c85];return _0x172c1f;};'use strict';var _=require('lodash');var util=require(_0x3905('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3905('0x1'));var BPromise=require(_0x3905('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3905('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3905('0x4'));module[_0x3905('0x5')]=function(_0x2925cf,_0x95ec97){return _0x2925cf[_0x3905('0x6')](_0x3905('0x7'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x3905('0x8'),'fields':[_0x3905('0x9'),_0x3905('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb43d=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField'];(function(_0x43614e,_0x4ff694){var _0x657d63=function(_0x25dd37){while(--_0x25dd37){_0x43614e['push'](_0x43614e['shift']());}};_0x657d63(++_0x4ff694);}(_0xb43d,0xab));var _0xdb43=function(_0x3132ea,_0x1c0e36){_0x3132ea=_0x3132ea-0x0;var _0x279bef=_0xb43d[_0x3132ea];return _0x279bef;};'use strict';var _=require(_0xdb43('0x0'));var util=require(_0xdb43('0x1'));var logger=require(_0xdb43('0x2'))(_0xdb43('0x3'));var moment=require(_0xdb43('0x4'));var BPromise=require(_0xdb43('0x5'));var rp=require(_0xdb43('0x6'));var fs=require('fs');var path=require(_0xdb43('0x7'));var rimraf=require(_0xdb43('0x8'));var config=require(_0xdb43('0x9'));var attributes=require(_0xdb43('0xa'));module[_0xdb43('0xb')]=function(_0x3a8025,_0x156316){return _0x3a8025[_0xdb43('0xc')](_0xdb43('0xd'),attributes,{'tableName':_0xdb43('0xe'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xdb43('0xf'),_0xdb43('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index b9efb3d..6ac6f6f 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2cc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xe2cc,0x189));var _0xce2c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe2cc[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xce2c('0x0'));var moment=require(_0xce2c('0x1'));var BPromise=require('bluebird');var rs=require(_0xce2c('0x2'));var fs=require('fs');var Redis=require(_0xce2c('0x3'));var db=require(_0xce2c('0x4'))['db'];var utils=require(_0xce2c('0x5'));var logger=require(_0xce2c('0x6'))(_0xce2c('0x7'));var config=require(_0xce2c('0x8'));var jayson=require(_0xce2c('0x9'));var client=jayson['client'][_0xce2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1312da,_0x373832,_0x3141c0){return new BPromise(function(_0x162fd8,_0x5632a9){return client['request'](_0x1312da,_0x3141c0)[_0xce2c('0xb')](function(_0x2aacf9){logger[_0xce2c('0xc')](_0xce2c('0xd'),_0x373832,_0xce2c('0xe'));logger[_0xce2c('0xf')](_0xce2c('0x10'),_0x373832,'request\x20sent',JSON[_0xce2c('0x11')](_0x2aacf9));if(_0x2aacf9[_0xce2c('0x12')]){if(_0x2aacf9[_0xce2c('0x12')]['code']===0x1f4){logger[_0xce2c('0x12')](_0xce2c('0xd'),_0x373832,_0x2aacf9['error']['message']);return _0x5632a9(_0x2aacf9['error']['message']);}logger[_0xce2c('0x12')](_0xce2c('0xd'),_0x373832,_0x2aacf9[_0xce2c('0x12')][_0xce2c('0x13')]);return _0x162fd8(_0x2aacf9[_0xce2c('0x12')][_0xce2c('0x13')]);}else{logger['info'](_0xce2c('0xd'),_0x373832,_0xce2c('0xe'));_0x162fd8(_0x2aacf9[_0xce2c('0x14')][_0xce2c('0x13')]);}})[_0xce2c('0x15')](function(_0x562b84){logger['error'](_0xce2c('0xd'),_0x373832,_0x562b84);_0x5632a9(_0x562b84);});});} \ No newline at end of file +var _0xc2f4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash'];(function(_0x1bbbeb,_0x299db1){var _0x12a7c1=function(_0xa87831){while(--_0xa87831){_0x1bbbeb['push'](_0x1bbbeb['shift']());}};_0x12a7c1(++_0x299db1);}(_0xc2f4,0x107));var _0x4c2f=function(_0x7ecd61,_0x28c775){_0x7ecd61=_0x7ecd61-0x0;var _0x67d35d=_0xc2f4[_0x7ecd61];return _0x67d35d;};'use strict';var _=require(_0x4c2f('0x0'));var util=require(_0x4c2f('0x1'));var moment=require(_0x4c2f('0x2'));var BPromise=require(_0x4c2f('0x3'));var rs=require(_0x4c2f('0x4'));var fs=require('fs');var Redis=require(_0x4c2f('0x5'));var db=require(_0x4c2f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c2f('0x7'))(_0x4c2f('0x8'));var config=require(_0x4c2f('0x9'));var jayson=require(_0x4c2f('0xa'));var client=jayson[_0x4c2f('0xb')][_0x4c2f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ea773,_0x23de10,_0x4a6e8d){return new BPromise(function(_0x59212b,_0x175fc1){return client[_0x4c2f('0xd')](_0x4ea773,_0x4a6e8d)['then'](function(_0x349b7b){logger['info'](_0x4c2f('0xe'),_0x23de10,'request\x20sent');logger[_0x4c2f('0xf')](_0x4c2f('0x10'),_0x23de10,_0x4c2f('0x11'),JSON[_0x4c2f('0x12')](_0x349b7b));if(_0x349b7b[_0x4c2f('0x13')]){if(_0x349b7b[_0x4c2f('0x13')]['code']===0x1f4){logger[_0x4c2f('0x13')](_0x4c2f('0xe'),_0x23de10,_0x349b7b['error'][_0x4c2f('0x14')]);return _0x175fc1(_0x349b7b[_0x4c2f('0x13')][_0x4c2f('0x14')]);}logger[_0x4c2f('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x23de10,_0x349b7b[_0x4c2f('0x13')]['message']);return _0x59212b(_0x349b7b['error'][_0x4c2f('0x14')]);}else{logger[_0x4c2f('0x15')](_0x4c2f('0xe'),_0x23de10,'request\x20sent');_0x59212b(_0x349b7b[_0x4c2f('0x16')][_0x4c2f('0x14')]);}})[_0x4c2f('0x17')](function(_0x5598ac){logger[_0x4c2f('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x23de10,_0x5598ac);_0x175fc1(_0x5598ac);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 350b978..f5ef350 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 _0xf5be=['create','/:id/configurations','addConfiguration','put','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','/:id','getConfigurations','/:id/fields','getFields','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf5be,0x15a));var _0xef5b=function(_0x3cfe05,_0x227340){_0x3cfe05=_0x3cfe05-0x0;var _0x3c44af=_0xf5be[_0x3cfe05];return _0x3c44af;};'use strict';var multer=require('multer');var util=require(_0xef5b('0x0'));var path=require(_0xef5b('0x1'));var timeout=require(_0xef5b('0x2'));var express=require(_0xef5b('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xef5b('0x4'));var config=require(_0xef5b('0x5'));var controller=require(_0xef5b('0x6'));router[_0xef5b('0x7')]('/',auth[_0xef5b('0x8')](),controller['index']);router['get'](_0xef5b('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xef5b('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xef5b('0xa')]);router[_0xef5b('0x7')](_0xef5b('0xb'),auth[_0xef5b('0x8')](),controller[_0xef5b('0xc')]);router[_0xef5b('0xd')]('/',auth['isAuthenticated'](),controller[_0xef5b('0xe')]);router[_0xef5b('0xd')](_0xef5b('0xf'),auth[_0xef5b('0x8')](),controller[_0xef5b('0x10')]);router[_0xef5b('0x11')](_0xef5b('0x9'),auth[_0xef5b('0x8')](),controller['update']);router['delete'](_0xef5b('0x9'),auth[_0xef5b('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2e3d=['isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x215924,_0x3f044e){var _0x3d4c5a=function(_0x339370){while(--_0x339370){_0x215924['push'](_0x215924['shift']());}};_0x3d4c5a(++_0x3f044e);}(_0x2e3d,0x8c));var _0xd2e3=function(_0x252043,_0x3fd7f7){_0x252043=_0x252043-0x0;var _0x1004c6=_0x2e3d[_0x252043];return _0x1004c6;};'use strict';var multer=require(_0xd2e3('0x0'));var util=require(_0xd2e3('0x1'));var path=require(_0xd2e3('0x2'));var timeout=require(_0xd2e3('0x3'));var express=require(_0xd2e3('0x4'));var router=express[_0xd2e3('0x5')]();var auth=require(_0xd2e3('0x6'));var interaction=require(_0xd2e3('0x7'));var config=require(_0xd2e3('0x8'));var controller=require('./intSalesforceAccount.controller');router[_0xd2e3('0x9')]('/',auth[_0xd2e3('0xa')](),controller[_0xd2e3('0xb')]);router[_0xd2e3('0x9')]('/:id',auth[_0xd2e3('0xa')](),controller['show']);router[_0xd2e3('0x9')]('/:id/configurations',auth[_0xd2e3('0xa')](),controller[_0xd2e3('0xc')]);router[_0xd2e3('0x9')](_0xd2e3('0xd'),auth['isAuthenticated'](),controller[_0xd2e3('0xe')]);router[_0xd2e3('0xf')]('/',auth['isAuthenticated'](),controller[_0xd2e3('0x10')]);router[_0xd2e3('0xf')](_0xd2e3('0x11'),auth['isAuthenticated'](),controller[_0xd2e3('0x12')]);router[_0xd2e3('0x13')](_0xd2e3('0x14'),auth[_0xd2e3('0xa')](),controller[_0xd2e3('0x15')]);router[_0xd2e3('0x16')](_0xd2e3('0x14'),auth[_0xd2e3('0xa')](),controller[_0xd2e3('0x17')]);module[_0xd2e3('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 89540a0..cc828eb 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 _0x1261=['STRING','username','integrationTab','newTab','exports'];(function(_0x54bf55,_0x11ed8c){var _0x151675=function(_0x8dcaf6){while(--_0x8dcaf6){_0x54bf55['push'](_0x54bf55['shift']());}};_0x151675(++_0x11ed8c);}(_0x1261,0x144));var _0x1126=function(_0x487702,_0x49f5d4){_0x487702=_0x487702-0x0;var _0x5e7150=_0x1261[_0x487702];return _0x5e7150;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')]},'description':{'type':Sequelize[_0x1126('0x1')]},'username':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x2')},'remoteUri':{'type':Sequelize[_0x1126('0x1')]},'password':{'type':Sequelize[_0x1126('0x1')]},'clientId':{'type':Sequelize[_0x1126('0x1')]},'clientSecret':{'type':Sequelize[_0x1126('0x1')]},'securityToken':{'type':Sequelize[_0x1126('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1126('0x3'),_0x1126('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x326f=['STRING','username','ENUM','newTab','integrationTab','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x89f894,_0x4acc03){_0x89f894=_0x89f894-0x0;var _0x1c011c=_0x326f[_0x89f894];return _0x1c011c;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf326('0x1')]},'username':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x2')},'remoteUri':{'type':Sequelize[_0xf326('0x1')]},'password':{'type':Sequelize[_0xf326('0x1')]},'clientId':{'type':Sequelize[_0xf326('0x1')]},'clientSecret':{'type':Sequelize[_0xf326('0x1')]},'securityToken':{'type':Sequelize[_0xf326('0x1')]},'serverUrl':{'type':Sequelize[_0xf326('0x1')]},'type':{'type':Sequelize[_0xf326('0x3')]('integrationTab',_0xf326('0x4')),'defaultValue':_0xf326('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 9c441a5..fda29d6 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 _0x4975=['Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','getSubjects','type','channel','SalesforceField','Descriptions','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','substring','lastIndexOf','login','isNil','ticketType','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Case','Origin','IsEscalated','remove','custom','includes','label','picklistValues','value','boolean','True','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x466a96,_0x1387d6){var _0x83153c=function(_0x555636){while(--_0x555636){_0x466a96['push'](_0x466a96['shift']());}};_0x83153c(++_0x1387d6);}(_0x4975,0x86));var _0x5497=function(_0x3abf34,_0x2e7ccb){_0x3abf34=_0x3abf34-0x0;var _0x1712f3=_0x4975[_0x3abf34];return _0x1712f3;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var as=require(_0x5497('0x14'));var hardwareService=require(_0x5497('0x15'));var logger=require(_0x5497('0x16'))(_0x5497('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x5497('0x18'));var jayson=require(_0x5497('0x19'));var client=jayson[_0x5497('0x1a')][_0x5497('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x747dc7,_0x365144,_0x1f7169){if(_0x1f7169){var _0xaca97d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xaca97d[_0x5497('0x1c')](_0x365144)){return _0x747dc7;}else{throw new db[(_0x5497('0x1d'))]['ValidationError'](_0x5497('0x1e'));}}else{return _0x747dc7;}}function respondWithRpcPromise(_0x4fb8e9,_0x4237a9,_0x2bfd8a,_0x19e5f3){return new BPromise(function(_0x3ce50b,_0x37c18e){var _0x4073e6=_0x19e5f3||client;return _0x4073e6[_0x5497('0x1f')](_0x4fb8e9,_0x2bfd8a)['then'](function(_0x56a788){logger[_0x5497('0x20')](_0x5497('0x21'),_0x4237a9,_0x5497('0x22'));logger['debug'](_0x5497('0x23'),_0x4237a9,_0x5497('0x22'),JSON[_0x5497('0x24')](_0x56a788));if(_0x56a788[_0x5497('0x25')]){if(_0x56a788[_0x5497('0x25')][_0x5497('0x26')]===0x1f4){logger[_0x5497('0x25')](_0x5497('0x21'),_0x4237a9,_0x56a788[_0x5497('0x25')][_0x5497('0x27')]);return _0x37c18e(_0x56a788[_0x5497('0x25')]['message']);}logger[_0x5497('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x4237a9,_0x56a788[_0x5497('0x25')][_0x5497('0x27')]);return _0x3ce50b(_0x56a788[_0x5497('0x25')][_0x5497('0x27')]);}else{logger[_0x5497('0x20')](_0x5497('0x21'),_0x4237a9,'request\x20sent');_0x3ce50b(_0x56a788['result'][_0x5497('0x27')]);}})[_0x5497('0x28')](function(_0x24482a){logger[_0x5497('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x4237a9,_0x24482a);_0x37c18e(_0x24482a);});});}function respondWithStatusCode(_0x13b7a4,_0x57268c){_0x57268c=_0x57268c||0xcc;return function(_0x1f3198){if(_0x1f3198){return _0x13b7a4[_0x5497('0x29')](_0x57268c);}return _0x13b7a4[_0x5497('0x2a')](_0x57268c)[_0x5497('0x2b')]();};}function respondWithResult(_0x163a30,_0x31cd01){_0x31cd01=_0x31cd01||0xc8;return function(_0x48b835){if(_0x48b835){return _0x163a30[_0x5497('0x2a')](_0x31cd01)['json'](_0x48b835);}};}function respondWithFilteredResult(_0x583d06,_0x498f15){return function(_0x39a2b7){if(_0x39a2b7){var _0x48d146=_0x39a2b7[_0x5497('0x2c')],_0x5e9356=_0x498f15['offset'],_0xc3465=_0x498f15['offset']+_0x498f15['limit'],_0xb14593;if(_0xc3465>=_0x48d146){_0xc3465=_0x48d146;_0xb14593=0xc8;}else{_0xb14593=0xce;}_0x583d06[_0x5497('0x2a')](_0xb14593);return _0x583d06[_0x5497('0x2d')](_0x5497('0x2e'),_0x5e9356+'-'+_0xc3465+'/'+_0x48d146)['json'](_0x39a2b7);}return null;};}function patchUpdates(_0x489f71){return function(_0x594866){try{jsonpatch[_0x5497('0x2f')](_0x594866,_0x489f71,!![]);}catch(_0x572460){return BPromise[_0x5497('0x30')](_0x572460);}return _0x594866[_0x5497('0x31')]();};}function saveUpdates(_0x77c575,_0x4d05c4){return function(_0x1d208f){if(_0x1d208f){return _0x1d208f[_0x5497('0x32')](_0x77c575)['then'](function(_0xce7cb2){return _0xce7cb2;});}return null;};}function removeEntity(_0xce2e81,_0x331dfc){return function(_0x489fbd){if(_0x489fbd){return _0x489fbd[_0x5497('0x33')]()[_0x5497('0x34')](function(){_0xce2e81[_0x5497('0x2a')](0xcc)[_0x5497('0x2b')]();});}};}function handleEntityNotFound(_0x412f5b,_0x4a6459){return function(_0x386845){if(!_0x386845){_0x412f5b[_0x5497('0x29')](0x194);}return _0x386845;};}function handleError(_0x558a70,_0x1ffc9b){_0x1ffc9b=_0x1ffc9b||0x1f4;return function(_0x44299b){logger[_0x5497('0x25')](_0x44299b[_0x5497('0x35')]);if(_0x44299b[_0x5497('0x36')]){delete _0x44299b[_0x5497('0x36')];}_0x558a70['status'](_0x1ffc9b)[_0x5497('0x37')](_0x44299b);};}exports['index']=function(_0x7880e4,_0x212199){var _0x2751f5={},_0x5ab18c={},_0x4ec5f7={'count':0x0,'rows':[]};var _0x396a9f=_[_0x5497('0x38')](db[_0x5497('0x39')][_0x5497('0x3a')],function(_0x43d15f){return{'name':_0x43d15f[_0x5497('0x3b')],'type':_0x43d15f['type'][_0x5497('0x3c')]};});_0x5ab18c[_0x5497('0x3d')]=_[_0x5497('0x38')](_0x396a9f,_0x5497('0x36'));_0x5ab18c[_0x5497('0x3e')]=_[_0x5497('0x3f')](_0x7880e4[_0x5497('0x3e')]);_0x5ab18c[_0x5497('0x40')]=_[_0x5497('0x41')](_0x5ab18c['model'],_0x5ab18c[_0x5497('0x3e')]);_0x2751f5[_0x5497('0x42')]=_[_0x5497('0x41')](_0x5ab18c[_0x5497('0x3d')],qs[_0x5497('0x43')](_0x7880e4[_0x5497('0x3e')][_0x5497('0x43')]));_0x2751f5['attributes']=_0x2751f5[_0x5497('0x42')][_0x5497('0x44')]?_0x2751f5[_0x5497('0x42')]:_0x5ab18c[_0x5497('0x3d')];if(!_0x7880e4[_0x5497('0x3e')][_0x5497('0x45')](_0x5497('0x46'))){_0x2751f5['limit']=qs[_0x5497('0x47')](_0x7880e4[_0x5497('0x3e')][_0x5497('0x47')]);_0x2751f5[_0x5497('0x48')]=qs[_0x5497('0x48')](_0x7880e4[_0x5497('0x3e')][_0x5497('0x48')]);}_0x2751f5[_0x5497('0x49')]=qs[_0x5497('0x4a')](_0x7880e4[_0x5497('0x3e')]['sort']);_0x2751f5[_0x5497('0x4b')]=qs['filters'](_[_0x5497('0x4c')](_0x7880e4[_0x5497('0x3e')],_0x5ab18c[_0x5497('0x40')]));if(_0x7880e4[_0x5497('0x3e')][_0x5497('0x4d')]){_0x2751f5['where']=_[_0x5497('0x4e')](_0x2751f5[_0x5497('0x4b')],{'$or':_['map'](_0x396a9f,function(_0x4d9a8d){if(_0x4d9a8d['type']!==_0x5497('0x4f')){var _0x4aa6b8={};_0x4aa6b8[_0x4d9a8d[_0x5497('0x36')]]={'$like':'%'+_0x7880e4[_0x5497('0x3e')][_0x5497('0x4d')]+'%'};return _0x4aa6b8;}})});}_0x2751f5=_[_0x5497('0x4e')]({},_0x2751f5,_0x7880e4[_0x5497('0x50')]);var _0x5bf06d={'where':_0x2751f5['where']};return db['SalesforceAccount']['count'](_0x5bf06d)[_0x5497('0x34')](function(_0x43c430){_0x4ec5f7[_0x5497('0x2c')]=_0x43c430;if(_0x7880e4[_0x5497('0x3e')][_0x5497('0x51')]){_0x2751f5[_0x5497('0x52')]=[{'all':!![]}];}return db[_0x5497('0x39')][_0x5497('0x53')](_0x2751f5);})[_0x5497('0x34')](function(_0x57350a){_0x4ec5f7[_0x5497('0x54')]=_0x57350a;return _0x4ec5f7;})[_0x5497('0x34')](respondWithFilteredResult(_0x212199,_0x2751f5))[_0x5497('0x28')](handleError(_0x212199,null));};exports['show']=function(_0x3e4da2,_0x530475){var _0x12ffbc={'raw':![],'where':{'id':_0x3e4da2[_0x5497('0x55')]['id']}},_0x31f1ba={};_0x31f1ba['model']=_[_0x5497('0x3f')](db[_0x5497('0x39')]['rawAttributes']);_0x31f1ba[_0x5497('0x3e')]=_['keys'](_0x3e4da2[_0x5497('0x3e')]);_0x31f1ba['filters']=_[_0x5497('0x41')](_0x31f1ba[_0x5497('0x3d')],_0x31f1ba[_0x5497('0x3e')]);_0x12ffbc[_0x5497('0x42')]=_[_0x5497('0x41')](_0x31f1ba[_0x5497('0x3d')],qs[_0x5497('0x43')](_0x3e4da2[_0x5497('0x3e')]['fields']));_0x12ffbc[_0x5497('0x42')]=_0x12ffbc['attributes']['length']?_0x12ffbc[_0x5497('0x42')]:_0x31f1ba[_0x5497('0x3d')];if(_0x3e4da2['query'][_0x5497('0x51')]){_0x12ffbc[_0x5497('0x52')]=[{'all':!![]}];}_0x12ffbc=_[_0x5497('0x4e')]({},_0x12ffbc,_0x3e4da2[_0x5497('0x50')]);return db['SalesforceAccount'][_0x5497('0x56')](_0x12ffbc)['then'](handleEntityNotFound(_0x530475,null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x28')](handleError(_0x530475,null));};exports[_0x5497('0x57')]=function(_0x2f7ec8,_0x49c85a){return db['SalesforceAccount'][_0x5497('0x57')](_0x2f7ec8['body'],{})[_0x5497('0x34')](respondWithResult(_0x49c85a,0xc9))['catch'](handleError(_0x49c85a,null));};exports[_0x5497('0x32')]=function(_0x5b9e57,_0xb1eac0){if(_0x5b9e57[_0x5497('0x58')]['id']){delete _0x5b9e57['body']['id'];}return db[_0x5497('0x39')]['find']({'where':{'id':_0x5b9e57['params']['id']}})[_0x5497('0x34')](handleEntityNotFound(_0xb1eac0,null))[_0x5497('0x34')](saveUpdates(_0x5b9e57['body'],null))[_0x5497('0x34')](respondWithResult(_0xb1eac0,null))[_0x5497('0x28')](handleError(_0xb1eac0,null));};exports[_0x5497('0x33')]=function(_0x28b2a3,_0x3fca40){return db[_0x5497('0x39')]['find']({'where':{'id':_0x28b2a3[_0x5497('0x55')]['id']}})['then'](handleEntityNotFound(_0x3fca40,null))['then'](removeEntity(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};exports[_0x5497('0x59')]=function(_0x37e0b9,_0x23fd59,_0x544085){var _0x53eafd={};var _0x528fb4={};var _0x5f0243;var _0x5a676d;return db[_0x5497('0x39')][_0x5497('0x5a')]({'where':{'id':_0x37e0b9[_0x5497('0x55')]['id']}})[_0x5497('0x34')](handleEntityNotFound(_0x23fd59,null))[_0x5497('0x34')](function(_0x573f93){if(_0x573f93){_0x5f0243=_0x573f93;_0x528fb4[_0x5497('0x3d')]=_[_0x5497('0x3f')](db[_0x5497('0x5b')][_0x5497('0x3a')]);_0x528fb4['query']=_[_0x5497('0x3f')](_0x37e0b9[_0x5497('0x3e')]);_0x528fb4[_0x5497('0x40')]=_[_0x5497('0x41')](_0x528fb4['model'],_0x528fb4[_0x5497('0x3e')]);_0x53eafd[_0x5497('0x42')]=_[_0x5497('0x41')](_0x528fb4['model'],qs[_0x5497('0x43')](_0x37e0b9['query']['fields']));_0x53eafd['attributes']=_0x53eafd[_0x5497('0x42')][_0x5497('0x44')]?_0x53eafd[_0x5497('0x42')]:_0x528fb4['model'];_0x53eafd[_0x5497('0x49')]=qs[_0x5497('0x4a')](_0x37e0b9[_0x5497('0x3e')][_0x5497('0x4a')]);_0x53eafd['where']=qs[_0x5497('0x40')](_[_0x5497('0x4c')](_0x37e0b9[_0x5497('0x3e')],_0x528fb4['filters']));if(_0x37e0b9[_0x5497('0x3e')][_0x5497('0x4d')]){_0x53eafd[_0x5497('0x4b')]=_[_0x5497('0x4e')](_0x53eafd[_0x5497('0x4b')],{'$or':_[_0x5497('0x38')](_0x53eafd[_0x5497('0x42')],function(_0x4b4cfe){var _0x2c2651={};_0x2c2651[_0x4b4cfe]={'$like':'%'+_0x37e0b9[_0x5497('0x3e')][_0x5497('0x4d')]+'%'};return _0x2c2651;})});}_0x53eafd=_[_0x5497('0x4e')]({},_0x53eafd,_0x37e0b9['options']);return _0x5f0243['getConfigurations'](_0x53eafd);}})['then'](function(_0x305d5b){if(_0x305d5b){_0x5a676d=_0x305d5b[_0x5497('0x44')];if(!_0x37e0b9[_0x5497('0x3e')]['hasOwnProperty'](_0x5497('0x46'))){_0x53eafd[_0x5497('0x47')]=qs[_0x5497('0x47')](_0x37e0b9[_0x5497('0x3e')][_0x5497('0x47')]);_0x53eafd[_0x5497('0x48')]=qs[_0x5497('0x48')](_0x37e0b9[_0x5497('0x3e')][_0x5497('0x48')]);}return _0x5f0243[_0x5497('0x59')](_0x53eafd);}})[_0x5497('0x34')](function(_0x5a8b3a){if(_0x5a8b3a){return _0x5a8b3a?{'count':_0x5a676d,'rows':_0x5a8b3a}:null;}})[_0x5497('0x34')](respondWithResult(_0x23fd59,null))[_0x5497('0x28')](handleError(_0x23fd59,null));};exports[_0x5497('0x5c')]=function(_0x4ef195,_0x5794ff,_0x589008){if(_0x4ef195[_0x5497('0x58')]['id']){delete _0x4ef195[_0x5497('0x58')]['id'];}return db['SalesforceAccount'][_0x5497('0x5a')]({'where':{'id':_0x4ef195[_0x5497('0x55')]['id']}})[_0x5497('0x34')](handleEntityNotFound(_0x5794ff,null))[_0x5497('0x34')](function(_0x535dba){if(_0x535dba){_0x4ef195[_0x5497('0x58')][_0x5497('0x5d')]=_0x535dba['id'];_0x4ef195[_0x5497('0x58')]['Subjects']=integrations[_0x5497('0x5e')](_0x4ef195[_0x5497('0x58')]['channel'],_0x4ef195[_0x5497('0x58')][_0x5497('0x5f')]);_0x4ef195[_0x5497('0x58')]['Descriptions']=integrations['getDescriptions'](_0x4ef195[_0x5497('0x58')][_0x5497('0x60')],_0x4ef195[_0x5497('0x58')][_0x5497('0x5f')]);return db[_0x5497('0x5b')][_0x5497('0x57')](_0x4ef195[_0x5497('0x58')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x5497('0x61')],'as':_0x5497('0x62')}]});}return null;})['then'](respondWithResult(_0x5794ff,null))[_0x5497('0x28')](handleError(_0x5794ff,null));};exports[_0x5497('0x63')]=function(_0x7415ba,_0x510078,_0xd55539){var _0x3e1e7f;var _0x50356d='';var _0x338957=_0x5497('0x64');return db[_0x5497('0x39')][_0x5497('0x5a')]({'where':{'id':_0x7415ba[_0x5497('0x55')]['id']},'attributes':['id','remoteUri',_0x5497('0x65'),_0x5497('0x66'),_0x5497('0x67'),_0x5497('0x68'),_0x5497('0x69')]})['then'](handleEntityNotFound(_0x510078,null))[_0x5497('0x34')](function(_0xe6996a){if(_0xe6996a){_0x50356d=_0xe6996a[_0x5497('0x6a')];var _0x9e3f4=_0x50356d['slice'](-0x1);if(_0x9e3f4==='/'){_0x50356d=_0x50356d[_0x5497('0x6b')](0x0,_0x50356d[_0x5497('0x6c')](_0x9e3f4));}_0x3e1e7f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x50356d,'clientId':_0xe6996a[_0x5497('0x65')],'clientSecret':_0xe6996a[_0x5497('0x66')]}});return _0x3e1e7f[_0x5497('0x6d')](_0xe6996a[_0x5497('0x67')],_0xe6996a['password']['concat'](_0xe6996a['securityToken']));}})['then'](function(_0x594761){if(_0x594761){if(!_[_0x5497('0x6e')](_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')])){_0x338957=_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')];}return _0x3e1e7f['sobject'](_0x338957)['describe']();}})[_0x5497('0x34')](function(_0x3971dc){var _0x29a2a8=[_0x5497('0x70'),_0x5497('0x71'),_0x5497('0x72'),_0x5497('0x73'),_0x5497('0x74'),_0x5497('0x75'),_0x5497('0x76'),'Type'];if(!_[_0x5497('0x6e')](_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')])&&_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')]===_0x5497('0x77')){_0x29a2a8=['Type',_0x5497('0x78'),'Reason',_0x5497('0x76'),_0x5497('0x75'),_0x5497('0x79'),'SuppliedName','SuppliedCompany'];}if(_0x3971dc){_[_0x5497('0x7a')](_0x3971dc[_0x5497('0x43')],function(_0x953b31){return _0x953b31[_0x5497('0x7b')]===![]&&!_0x29a2a8[_0x5497('0x7c')](_0x953b31[_0x5497('0x36')]);});return{'count':_0x3971dc[_0x5497('0x43')][_0x5497('0x44')],'rows':_['map'](_0x3971dc['fields'],function(_0x492372){return{'id':_0x492372[_0x5497('0x36')],'name':_0x492372[_0x5497('0x7d')],'custom':_0x492372[_0x5497('0x7b')],'options':_0x492372[_0x5497('0x7e')]['length']>0x0?_['map'](_0x492372[_0x5497('0x7e')],function(_0xf38193){return{'name':_0xf38193['label'],'value':_0xf38193[_0x5497('0x7f')]};}):_0x492372[_0x5497('0x5f')]==_0x5497('0x80')?[{'name':_0x5497('0x81'),'value':'true'},{'name':'False','value':'false'}]:[]};})};}})['then'](respondWithResult(_0x510078,null))['catch'](function(_0x497295){var _0x579355=_0x7415ba[_0x5497('0x3e')]['test']?0x1f4:_0x497295[_0x5497('0x82')]||0x1f4;logger[_0x5497('0x25')](_0x5497('0x83'),_0x5497('0x63'),_0x579355,JSON[_0x5497('0x24')](_0x497295));delete _0x497295[_0x5497('0x36')];if(_0x579355===0x191){_0x579355=0x190;}_0x510078['status'](_0x579355)[_0x5497('0x37')](_0x7415ba['query'][_0x5497('0x1c')]?{'message':_0x5497('0x84'),'statusCode':_0x497295[_0x5497('0x82')]}:_0x497295);});}; \ No newline at end of file +var _0x814b=['Status','Priority','IsEscalated','SuppliedCompany','remove','includes','custom','picklistValues','value','boolean','True','true','False','false','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','apply','reject','then','destroy','stack','name','send','SalesforceAccount','type','model','map','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','rows','show','keys','rawAttributes','include','create','body','find','params','findOne','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','getFields','Task','remoteUri','clientId','password','slice','substring','Connection','clientSecret','username','securityToken','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','Case','Type','Origin','Reason'];(function(_0x13ffab,_0x449a1c){var _0x11cfda=function(_0x2cd296){while(--_0x2cd296){_0x13ffab['push'](_0x13ffab['shift']());}};_0x11cfda(++_0x449a1c);}(_0x814b,0x1a2));var _0xb814=function(_0x3b267f,_0x2a7dd9){_0x3b267f=_0x3b267f-0x0;var _0x4c0cd8=_0x814b[_0x3b267f];return _0x4c0cd8;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];var integrations=require(_0xb814('0x1a'));var jayson=require(_0xb814('0x1b'));var client=jayson[_0xb814('0x1c')][_0xb814('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3bde14,_0x1438e7,_0x41ed7b){if(_0x41ed7b){var _0xa0a2e5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa0a2e5[_0xb814('0x1e')](_0x1438e7)){return _0x3bde14;}else{throw new db[(_0xb814('0x1f'))][(_0xb814('0x20'))](_0xb814('0x21'));}}else{return _0x3bde14;}}function respondWithRpcPromise(_0x39bfcf,_0x303aca,_0x3a71d6,_0x45e0d0){return new BPromise(function(_0x265a83,_0x125ce2){var _0x21b73f=_0x45e0d0||client;return _0x21b73f[_0xb814('0x22')](_0x39bfcf,_0x3a71d6)['then'](function(_0x168a48){logger['info'](_0xb814('0x23'),_0x303aca,_0xb814('0x24'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x303aca,'request\x20sent',JSON[_0xb814('0x25')](_0x168a48));if(_0x168a48['error']){if(_0x168a48['error'][_0xb814('0x26')]===0x1f4){logger[_0xb814('0x27')](_0xb814('0x23'),_0x303aca,_0x168a48['error'][_0xb814('0x28')]);return _0x125ce2(_0x168a48['error'][_0xb814('0x28')]);}logger[_0xb814('0x27')](_0xb814('0x23'),_0x303aca,_0x168a48[_0xb814('0x27')][_0xb814('0x28')]);return _0x265a83(_0x168a48[_0xb814('0x27')][_0xb814('0x28')]);}else{logger['info'](_0xb814('0x23'),_0x303aca,'request\x20sent');_0x265a83(_0x168a48[_0xb814('0x29')][_0xb814('0x28')]);}})[_0xb814('0x2a')](function(_0x208927){logger[_0xb814('0x27')](_0xb814('0x23'),_0x303aca,_0x208927);_0x125ce2(_0x208927);});});}function respondWithStatusCode(_0x3d836c,_0x5755ea){_0x5755ea=_0x5755ea||0xcc;return function(_0x392222){if(_0x392222){return _0x3d836c[_0xb814('0x2b')](_0x5755ea);}return _0x3d836c[_0xb814('0x2c')](_0x5755ea)[_0xb814('0x2d')]();};}function respondWithResult(_0x32ed56,_0x1d5965){_0x1d5965=_0x1d5965||0xc8;return function(_0x3f0150){if(_0x3f0150){return _0x32ed56[_0xb814('0x2c')](_0x1d5965)['json'](_0x3f0150);}};}function respondWithFilteredResult(_0x271aa8,_0x328a08){return function(_0x52ed64){if(_0x52ed64){var _0x9008b2=_0x52ed64[_0xb814('0x2e')],_0x37d24d=_0x328a08[_0xb814('0x2f')],_0x530744=_0x328a08['offset']+_0x328a08[_0xb814('0x30')],_0x499f22;if(_0x530744>=_0x9008b2){_0x530744=_0x9008b2;_0x499f22=0xc8;}else{_0x499f22=0xce;}_0x271aa8['status'](_0x499f22);return _0x271aa8[_0xb814('0x31')]('Content-Range',_0x37d24d+'-'+_0x530744+'/'+_0x9008b2)['json'](_0x52ed64);}return null;};}function patchUpdates(_0x419cd9){return function(_0x4a4f27){try{jsonpatch[_0xb814('0x32')](_0x4a4f27,_0x419cd9,!![]);}catch(_0x19469b){return BPromise[_0xb814('0x33')](_0x19469b);}return _0x4a4f27['save']();};}function saveUpdates(_0x51d5ae,_0x26d3a9){return function(_0x336e2b){if(_0x336e2b){return _0x336e2b['update'](_0x51d5ae)[_0xb814('0x34')](function(_0xe558d5){return _0xe558d5;});}return null;};}function removeEntity(_0x692c72,_0x217b7e){return function(_0x1b78de){if(_0x1b78de){return _0x1b78de[_0xb814('0x35')]()[_0xb814('0x34')](function(){_0x692c72['status'](0xcc)[_0xb814('0x2d')]();});}};}function handleEntityNotFound(_0x2263f6,_0x30de5a){return function(_0x424e2b){if(!_0x424e2b){_0x2263f6[_0xb814('0x2b')](0x194);}return _0x424e2b;};}function handleError(_0x4ff31a,_0x16ef82){_0x16ef82=_0x16ef82||0x1f4;return function(_0x57e6e6){logger[_0xb814('0x27')](_0x57e6e6[_0xb814('0x36')]);if(_0x57e6e6[_0xb814('0x37')]){delete _0x57e6e6['name'];}_0x4ff31a[_0xb814('0x2c')](_0x16ef82)[_0xb814('0x38')](_0x57e6e6);};}exports['index']=function(_0x2fcd92,_0x2d0e27){var _0x1a8bd0={},_0x1f7cd8={},_0xd77d96={'count':0x0,'rows':[]};var _0x467cf9=_['map'](db[_0xb814('0x39')]['rawAttributes'],function(_0x2aaf1c){return{'name':_0x2aaf1c['fieldName'],'type':_0x2aaf1c[_0xb814('0x3a')]['key']};});_0x1f7cd8[_0xb814('0x3b')]=_[_0xb814('0x3c')](_0x467cf9,'name');_0x1f7cd8['query']=_['keys'](_0x2fcd92['query']);_0x1f7cd8[_0xb814('0x3d')]=_[_0xb814('0x3e')](_0x1f7cd8[_0xb814('0x3b')],_0x1f7cd8[_0xb814('0x3f')]);_0x1a8bd0['attributes']=_['intersection'](_0x1f7cd8[_0xb814('0x3b')],qs['fields'](_0x2fcd92[_0xb814('0x3f')][_0xb814('0x40')]));_0x1a8bd0[_0xb814('0x41')]=_0x1a8bd0[_0xb814('0x41')][_0xb814('0x42')]?_0x1a8bd0[_0xb814('0x41')]:_0x1f7cd8[_0xb814('0x3b')];if(!_0x2fcd92[_0xb814('0x3f')][_0xb814('0x43')]('nolimit')){_0x1a8bd0['limit']=qs['limit'](_0x2fcd92[_0xb814('0x3f')]['limit']);_0x1a8bd0[_0xb814('0x2f')]=qs['offset'](_0x2fcd92[_0xb814('0x3f')][_0xb814('0x2f')]);}_0x1a8bd0[_0xb814('0x44')]=qs[_0xb814('0x45')](_0x2fcd92['query'][_0xb814('0x45')]);_0x1a8bd0[_0xb814('0x46')]=qs[_0xb814('0x3d')](_[_0xb814('0x47')](_0x2fcd92[_0xb814('0x3f')],_0x1f7cd8[_0xb814('0x3d')]));if(_0x2fcd92['query'][_0xb814('0x48')]){_0x1a8bd0[_0xb814('0x46')]=_[_0xb814('0x49')](_0x1a8bd0[_0xb814('0x46')],{'$or':_[_0xb814('0x3c')](_0x467cf9,function(_0x144d37){if(_0x144d37[_0xb814('0x3a')]!=='VIRTUAL'){var _0x4a5e84={};_0x4a5e84[_0x144d37[_0xb814('0x37')]]={'$like':'%'+_0x2fcd92[_0xb814('0x3f')][_0xb814('0x48')]+'%'};return _0x4a5e84;}})});}_0x1a8bd0=_[_0xb814('0x49')]({},_0x1a8bd0,_0x2fcd92[_0xb814('0x4a')]);var _0x40e627={'where':_0x1a8bd0[_0xb814('0x46')]};return db[_0xb814('0x39')][_0xb814('0x2e')](_0x40e627)[_0xb814('0x34')](function(_0xe73300){_0xd77d96['count']=_0xe73300;if(_0x2fcd92[_0xb814('0x3f')][_0xb814('0x4b')]){_0x1a8bd0['include']=[{'all':!![]}];}return db[_0xb814('0x39')]['findAll'](_0x1a8bd0);})[_0xb814('0x34')](function(_0x37866f){_0xd77d96[_0xb814('0x4c')]=_0x37866f;return _0xd77d96;})[_0xb814('0x34')](respondWithFilteredResult(_0x2d0e27,_0x1a8bd0))[_0xb814('0x2a')](handleError(_0x2d0e27,null));};exports[_0xb814('0x4d')]=function(_0x2cc806,_0x45480e){var _0x32a397={'raw':![],'where':{'id':_0x2cc806['params']['id']}},_0x2a422a={};_0x2a422a['model']=_[_0xb814('0x4e')](db[_0xb814('0x39')][_0xb814('0x4f')]);_0x2a422a[_0xb814('0x3f')]=_[_0xb814('0x4e')](_0x2cc806[_0xb814('0x3f')]);_0x2a422a[_0xb814('0x3d')]=_['intersection'](_0x2a422a[_0xb814('0x3b')],_0x2a422a[_0xb814('0x3f')]);_0x32a397[_0xb814('0x41')]=_['intersection'](_0x2a422a[_0xb814('0x3b')],qs['fields'](_0x2cc806[_0xb814('0x3f')]['fields']));_0x32a397[_0xb814('0x41')]=_0x32a397[_0xb814('0x41')]['length']?_0x32a397[_0xb814('0x41')]:_0x2a422a[_0xb814('0x3b')];if(_0x2cc806[_0xb814('0x3f')]['includeAll']){_0x32a397[_0xb814('0x50')]=[{'all':!![]}];}_0x32a397=_['merge']({},_0x32a397,_0x2cc806[_0xb814('0x4a')]);return db[_0xb814('0x39')]['find'](_0x32a397)[_0xb814('0x34')](handleEntityNotFound(_0x45480e,null))['then'](respondWithResult(_0x45480e,null))['catch'](handleError(_0x45480e,null));};exports[_0xb814('0x51')]=function(_0x35f59a,_0x34935b){return db['SalesforceAccount'][_0xb814('0x51')](_0x35f59a['body'],{})[_0xb814('0x34')](respondWithResult(_0x34935b,0xc9))[_0xb814('0x2a')](handleError(_0x34935b,null));};exports['update']=function(_0x2db5a6,_0x5c32c2){if(_0x2db5a6[_0xb814('0x52')]['id']){delete _0x2db5a6[_0xb814('0x52')]['id'];}return db[_0xb814('0x39')][_0xb814('0x53')]({'where':{'id':_0x2db5a6[_0xb814('0x54')]['id']}})[_0xb814('0x34')](handleEntityNotFound(_0x5c32c2,null))[_0xb814('0x34')](saveUpdates(_0x2db5a6[_0xb814('0x52')],null))['then'](respondWithResult(_0x5c32c2,null))[_0xb814('0x2a')](handleError(_0x5c32c2,null));};exports[_0xb814('0x35')]=function(_0x5d71d5,_0x29a127){return db[_0xb814('0x39')]['find']({'where':{'id':_0x5d71d5[_0xb814('0x54')]['id']}})['then'](handleEntityNotFound(_0x29a127,null))['then'](removeEntity(_0x29a127,null))[_0xb814('0x2a')](handleError(_0x29a127,null));};exports['getConfigurations']=function(_0x3ff213,_0xd1cd8b,_0x2dec52){var _0x586957={};var _0x1a0ef4={};var _0x4df65c;var _0x2ef77d;return db[_0xb814('0x39')][_0xb814('0x55')]({'where':{'id':_0x3ff213[_0xb814('0x54')]['id']}})[_0xb814('0x34')](handleEntityNotFound(_0xd1cd8b,null))[_0xb814('0x34')](function(_0x2e5f99){if(_0x2e5f99){_0x4df65c=_0x2e5f99;_0x1a0ef4[_0xb814('0x3b')]=_[_0xb814('0x4e')](db['SalesforceConfiguration'][_0xb814('0x4f')]);_0x1a0ef4[_0xb814('0x3f')]=_[_0xb814('0x4e')](_0x3ff213[_0xb814('0x3f')]);_0x1a0ef4[_0xb814('0x3d')]=_[_0xb814('0x3e')](_0x1a0ef4['model'],_0x1a0ef4[_0xb814('0x3f')]);_0x586957['attributes']=_[_0xb814('0x3e')](_0x1a0ef4[_0xb814('0x3b')],qs[_0xb814('0x40')](_0x3ff213['query'][_0xb814('0x40')]));_0x586957['attributes']=_0x586957[_0xb814('0x41')]['length']?_0x586957[_0xb814('0x41')]:_0x1a0ef4[_0xb814('0x3b')];_0x586957[_0xb814('0x44')]=qs[_0xb814('0x45')](_0x3ff213[_0xb814('0x3f')][_0xb814('0x45')]);_0x586957[_0xb814('0x46')]=qs['filters'](_[_0xb814('0x47')](_0x3ff213['query'],_0x1a0ef4[_0xb814('0x3d')]));if(_0x3ff213[_0xb814('0x3f')][_0xb814('0x48')]){_0x586957[_0xb814('0x46')]=_[_0xb814('0x49')](_0x586957[_0xb814('0x46')],{'$or':_['map'](_0x586957[_0xb814('0x41')],function(_0x1a2603){var _0x4a49ba={};_0x4a49ba[_0x1a2603]={'$like':'%'+_0x3ff213[_0xb814('0x3f')][_0xb814('0x48')]+'%'};return _0x4a49ba;})});}_0x586957=_[_0xb814('0x49')]({},_0x586957,_0x3ff213[_0xb814('0x4a')]);return _0x4df65c[_0xb814('0x56')](_0x586957);}})['then'](function(_0x3a4d4b){if(_0x3a4d4b){_0x2ef77d=_0x3a4d4b['length'];if(!_0x3ff213[_0xb814('0x3f')][_0xb814('0x43')](_0xb814('0x57'))){_0x586957[_0xb814('0x30')]=qs[_0xb814('0x30')](_0x3ff213[_0xb814('0x3f')]['limit']);_0x586957['offset']=qs['offset'](_0x3ff213[_0xb814('0x3f')]['offset']);}return _0x4df65c[_0xb814('0x56')](_0x586957);}})[_0xb814('0x34')](function(_0x25db89){if(_0x25db89){return _0x25db89?{'count':_0x2ef77d,'rows':_0x25db89}:null;}})['then'](respondWithResult(_0xd1cd8b,null))[_0xb814('0x2a')](handleError(_0xd1cd8b,null));};exports[_0xb814('0x58')]=function(_0xee204,_0x5aabbe,_0x30f717){if(_0xee204[_0xb814('0x52')]['id']){delete _0xee204[_0xb814('0x52')]['id'];}return db[_0xb814('0x39')]['findOne']({'where':{'id':_0xee204['params']['id']}})[_0xb814('0x34')](handleEntityNotFound(_0x5aabbe,null))[_0xb814('0x34')](function(_0x39863d){if(_0x39863d){_0xee204[_0xb814('0x52')][_0xb814('0x59')]=_0x39863d['id'];_0xee204[_0xb814('0x52')][_0xb814('0x5a')]=integrations[_0xb814('0x5b')](_0xee204[_0xb814('0x52')][_0xb814('0x5c')],_0xee204[_0xb814('0x52')][_0xb814('0x3a')]);_0xee204[_0xb814('0x52')][_0xb814('0x5d')]=integrations[_0xb814('0x5e')](_0xee204['body'][_0xb814('0x5c')],_0xee204[_0xb814('0x52')][_0xb814('0x3a')]);return db[_0xb814('0x5f')][_0xb814('0x51')](_0xee204[_0xb814('0x52')],{'include':[{'model':db['SalesforceField'],'as':_0xb814('0x5a')},{'model':db['SalesforceField'],'as':_0xb814('0x5d')}]});}return null;})[_0xb814('0x34')](respondWithResult(_0x5aabbe,null))[_0xb814('0x2a')](handleError(_0x5aabbe,null));};exports[_0xb814('0x60')]=function(_0x265a25,_0x5ce177,_0x4c44ee){var _0xea9cee;var _0x1b502b='';var _0x1bca54=_0xb814('0x61');return db['SalesforceAccount'][_0xb814('0x55')]({'where':{'id':_0x265a25['params']['id']},'attributes':['id',_0xb814('0x62'),_0xb814('0x63'),'clientSecret','username',_0xb814('0x64'),'securityToken']})[_0xb814('0x34')](handleEntityNotFound(_0x5ce177,null))[_0xb814('0x34')](function(_0x3c770d){if(_0x3c770d){_0x1b502b=_0x3c770d[_0xb814('0x62')];var _0x46784f=_0x1b502b[_0xb814('0x65')](-0x1);if(_0x46784f==='/'){_0x1b502b=_0x1b502b[_0xb814('0x66')](0x0,_0x1b502b['lastIndexOf'](_0x46784f));}_0xea9cee=new jsforce[(_0xb814('0x67'))]({'oauth2':{'loginUrl':_0x1b502b,'clientId':_0x3c770d['clientId'],'clientSecret':_0x3c770d[_0xb814('0x68')]}});return _0xea9cee['login'](_0x3c770d[_0xb814('0x69')],_0x3c770d[_0xb814('0x64')]['concat'](_0x3c770d[_0xb814('0x6a')]));}})['then'](function(_0x37adec){if(_0x37adec){if(!_[_0xb814('0x6b')](_0x265a25['query']['ticketType'])){_0x1bca54=_0x265a25[_0xb814('0x3f')][_0xb814('0x6c')];}return _0xea9cee[_0xb814('0x6d')](_0x1bca54)[_0xb814('0x6e')]();}})[_0xb814('0x34')](function(_0x4394da){var _0x2b12a9=[_0xb814('0x6f'),_0xb814('0x70'),_0xb814('0x71'),'CallType','IsArchived','Priority','Status','Type'];if(!_[_0xb814('0x6b')](_0x265a25[_0xb814('0x3f')][_0xb814('0x6c')])&&_0x265a25['query'][_0xb814('0x6c')]===_0xb814('0x72')){_0x2b12a9=[_0xb814('0x73'),_0xb814('0x74'),_0xb814('0x75'),_0xb814('0x76'),_0xb814('0x77'),_0xb814('0x78'),'SuppliedName',_0xb814('0x79')];}if(_0x4394da){_[_0xb814('0x7a')](_0x4394da[_0xb814('0x40')],function(_0x30faa0){return _0x30faa0['custom']===![]&&!_0x2b12a9[_0xb814('0x7b')](_0x30faa0[_0xb814('0x37')]);});return{'count':_0x4394da[_0xb814('0x40')][_0xb814('0x42')],'rows':_[_0xb814('0x3c')](_0x4394da['fields'],function(_0x4db6e2){return{'id':_0x4db6e2[_0xb814('0x37')],'name':_0x4db6e2['label'],'custom':_0x4db6e2[_0xb814('0x7c')],'options':_0x4db6e2[_0xb814('0x7d')]['length']>0x0?_[_0xb814('0x3c')](_0x4db6e2['picklistValues'],function(_0xe17e86){return{'name':_0xe17e86['label'],'value':_0xe17e86[_0xb814('0x7e')]};}):_0x4db6e2[_0xb814('0x3a')]==_0xb814('0x7f')?[{'name':_0xb814('0x80'),'value':_0xb814('0x81')},{'name':_0xb814('0x82'),'value':_0xb814('0x83')}]:[]};})};}})['then'](respondWithResult(_0x5ce177,null))['catch'](function(_0x21aa36){var _0x50ed93=_0x265a25['query'][_0xb814('0x1e')]?0x1f4:_0x21aa36[_0xb814('0x84')]||0x1f4;logger[_0xb814('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xb814('0x60'),_0x50ed93,JSON['stringify'](_0x21aa36));delete _0x21aa36[_0xb814('0x37')];if(_0x50ed93===0x191){_0x50ed93=0x190;}_0x5ce177[_0xb814('0x2c')](_0x50ed93)[_0xb814('0x38')](_0x265a25[_0xb814('0x3f')]['test']?{'message':_0xb814('0x85'),'statusCode':_0x21aa36[_0xb814('0x84')]}:_0x21aa36);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index a7bd992..a84378d 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 _0x4abc=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','lodash'];(function(_0x45c896,_0x2d04a9){var _0x521590=function(_0x32fb36){while(--_0x32fb36){_0x45c896['push'](_0x45c896['shift']());}};_0x521590(++_0x2d04a9);}(_0x4abc,0x99));var _0xc4ab=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4abc[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xc4ab('0x0'));var util=require(_0xc4ab('0x1'));var logger=require(_0xc4ab('0x2'))(_0xc4ab('0x3'));var moment=require('moment');var BPromise=require(_0xc4ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc4ab('0x5'));var config=require(_0xc4ab('0x6'));var attributes=require(_0xc4ab('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xc4ab('0x8')]=function(_0x18ee94,_0x2617f1){return _0x18ee94[_0xc4ab('0x9')](_0xc4ab('0xa'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef5b=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','lodash'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xef5b,0xf6));var _0xbef5=function(_0x6d2ed1,_0x1876b5){_0x6d2ed1=_0x6d2ed1-0x0;var _0x5977c5=_0xef5b[_0x6d2ed1];return _0x5977c5;};'use strict';var _=require(_0xbef5('0x0'));var util=require(_0xbef5('0x1'));var logger=require('../../config/logger')(_0xbef5('0x2'));var moment=require(_0xbef5('0x3'));var BPromise=require(_0xbef5('0x4'));var rp=require(_0xbef5('0x5'));var fs=require('fs');var path=require(_0xbef5('0x6'));var rimraf=require(_0xbef5('0x7'));var config=require(_0xbef5('0x8'));var attributes=require(_0xbef5('0x9'));var integrations=require(_0xbef5('0xa'));module[_0xbef5('0xb')]=function(_0x201bb7,_0x29ff04){return _0x201bb7[_0xbef5('0xc')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index ecd0f96..a9d85e0 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 _0xbf6e=['include','map','model','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xbf6e,0x149));var _0xebf6=function(_0x1a32fe,_0xdab6ac){_0x1a32fe=_0x1a32fe-0x0;var _0x1abca6=_0xbf6e[_0x1a32fe];return _0x1abca6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebf6('0x0'));var BPromise=require(_0xebf6('0x1'));var rs=require(_0xebf6('0x2'));var fs=require('fs');var Redis=require(_0xebf6('0x3'));var db=require(_0xebf6('0x4'))['db'];var utils=require(_0xebf6('0x5'));var logger=require(_0xebf6('0x6'))('rpc');var config=require(_0xebf6('0x7'));var jayson=require(_0xebf6('0x8'));var client=jayson[_0xebf6('0x9')][_0xebf6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143344,_0x1e02b3,_0x137e39){return new BPromise(function(_0x548e9e,_0x1d8035){return client[_0xebf6('0xb')](_0x143344,_0x137e39)[_0xebf6('0xc')](function(_0x591132){logger[_0xebf6('0xd')](_0xebf6('0xe'),_0x1e02b3,'request\x20sent');logger[_0xebf6('0xf')](_0xebf6('0x10'),_0x1e02b3,_0xebf6('0x11'),JSON[_0xebf6('0x12')](_0x591132));if(_0x591132[_0xebf6('0x13')]){if(_0x591132[_0xebf6('0x13')]['code']===0x1f4){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error'][_0xebf6('0x14')]);return _0x1d8035(_0x591132[_0xebf6('0x13')][_0xebf6('0x14')]);}logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error']['message']);return _0x548e9e(_0x591132['error'][_0xebf6('0x14')]);}else{logger[_0xebf6('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x1e02b3,_0xebf6('0x11'));_0x548e9e(_0x591132[_0xebf6('0x15')][_0xebf6('0x14')]);}})[_0xebf6('0x16')](function(_0x3100ee){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x3100ee);_0x1d8035(_0x3100ee);});});}exports[_0xebf6('0x17')]=function(_0x2d3984){var _0x308480=this;return new Promise(function(_0x55fa31,_0x496dea){return db[_0xebf6('0x18')][_0xebf6('0x19')]({'raw':_0x2d3984[_0xebf6('0x1a')]?_0x2d3984[_0xebf6('0x1a')][_0xebf6('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d3984[_0xebf6('0x1a')]?_0x2d3984[_0xebf6('0x1a')][_0xebf6('0x1c')]||null:null,'attributes':_0x2d3984['options']?_0x2d3984[_0xebf6('0x1a')][_0xebf6('0x1d')]||null:null,'limit':_0x2d3984[_0xebf6('0x1a')]?_0x2d3984[_0xebf6('0x1a')][_0xebf6('0x1e')]||null:null,'include':_0x2d3984[_0xebf6('0x1a')]?_0x2d3984[_0xebf6('0x1a')][_0xebf6('0x1f')]?_[_0xebf6('0x20')](_0x2d3984[_0xebf6('0x1a')][_0xebf6('0x1f')],function(_0x2dd2ed){return{'model':db[_0x2dd2ed[_0xebf6('0x21')]],'as':_0x2dd2ed['as'],'attributes':_0x2dd2ed[_0xebf6('0x1d')],'include':_0x2dd2ed[_0xebf6('0x1f')]?_[_0xebf6('0x20')](_0x2dd2ed[_0xebf6('0x1f')],function(_0x1534b2){return{'model':db[_0x1534b2[_0xebf6('0x21')]],'as':_0x1534b2['as'],'attributes':_0x1534b2['attributes'],'include':_0x1534b2['include']?_[_0xebf6('0x20')](_0x1534b2['include'],function(_0x230d84){return{'model':db[_0x230d84[_0xebf6('0x21')]],'as':_0x230d84['as'],'attributes':_0x230d84['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x37950c){logger[_0xebf6('0xd')](_0xebf6('0x17'),_0x2d3984);logger[_0xebf6('0xf')](_0xebf6('0x17'),_0x2d3984,JSON[_0xebf6('0x12')](_0x37950c));_0x55fa31(_0x37950c);})[_0xebf6('0x16')](function(_0x7551ce){logger['error'](_0xebf6('0x17'),_0x7551ce[_0xebf6('0x14')],_0x2d3984);_0x496dea(_0x308480['error'](0x1f4,_0x7551ce[_0xebf6('0x14')]));});});};exports[_0xebf6('0x22')]=function(_0x5ea6b2){var _0x2901fc=this;return new Promise(function(_0x1fa407,_0x32afa3){return db[_0xebf6('0x18')][_0xebf6('0x23')]({'raw':_0x5ea6b2[_0xebf6('0x1a')]?_0x5ea6b2['options'][_0xebf6('0x1b')]===undefined?!![]:![]:!![],'where':_0x5ea6b2[_0xebf6('0x1a')]?_0x5ea6b2['options']['where']||null:null,'attributes':_0x5ea6b2[_0xebf6('0x1a')]?_0x5ea6b2[_0xebf6('0x1a')]['attributes']||null:null,'include':_0x5ea6b2[_0xebf6('0x1a')]?_0x5ea6b2[_0xebf6('0x1a')]['include']?_[_0xebf6('0x20')](_0x5ea6b2[_0xebf6('0x1a')][_0xebf6('0x1f')],function(_0x4f9127){return{'model':db[_0x4f9127[_0xebf6('0x21')]],'as':_0x4f9127['as'],'attributes':_0x4f9127[_0xebf6('0x1d')],'include':_0x4f9127[_0xebf6('0x1f')]?_[_0xebf6('0x20')](_0x4f9127['include'],function(_0x568994){return{'model':db[_0x568994[_0xebf6('0x21')]],'as':_0x568994['as'],'attributes':_0x568994[_0xebf6('0x1d')],'include':_0x568994['include']?_[_0xebf6('0x20')](_0x568994[_0xebf6('0x1f')],function(_0x5cdcb2){return{'model':db[_0x5cdcb2[_0xebf6('0x21')]],'as':_0x5cdcb2['as'],'attributes':_0x5cdcb2[_0xebf6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xebf6('0xc')](function(_0xff8c0f){logger[_0xebf6('0xd')]('ShowSalesforceAccount',_0x5ea6b2);logger[_0xebf6('0xf')]('ShowSalesforceAccount',_0x5ea6b2,JSON[_0xebf6('0x12')](_0xff8c0f));_0x1fa407(_0xff8c0f);})['catch'](function(_0xafef4d){logger[_0xebf6('0x13')](_0xebf6('0x22'),_0xafef4d[_0xebf6('0x14')],_0x5ea6b2);_0x32afa3(_0x2901fc[_0xebf6('0x13')](0x1f4,_0xafef4d[_0xebf6('0x14')]));});});}; \ No newline at end of file +var _0x6f7a=['then','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','SalesforceAccount','options','raw','where','attributes','include','model','map','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3d55a4,_0x57d61b){var _0x38c5c4=function(_0x1e0daa){while(--_0x1e0daa){_0x3d55a4['push'](_0x3d55a4['shift']());}};_0x38c5c4(++_0x57d61b);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x27b380,_0x803b96){_0x27b380=_0x27b380-0x0;var _0x2c2f73=_0x6f7a[_0x27b380];return _0x2c2f73;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});}exports['GetSalesforceAccount']=function(_0x4a8827){var _0xba7755=this;return new Promise(function(_0x5298ba,_0x378967){return db[_0xa6f7('0x1a')]['findAll']({'raw':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x4a8827['options']?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1e')]||null:null,'limit':_0x4a8827['options']?_0x4a8827['options']['limit']||null:null,'include':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')]['include']?_['map'](_0x4a8827['options'][_0xa6f7('0x1f')],function(_0xc77e8e){return{'model':db[_0xc77e8e[_0xa6f7('0x20')]],'as':_0xc77e8e['as'],'attributes':_0xc77e8e['attributes'],'include':_0xc77e8e['include']?_[_0xa6f7('0x21')](_0xc77e8e['include'],function(_0x47ef97){return{'model':db[_0x47ef97[_0xa6f7('0x20')]],'as':_0x47ef97['as'],'attributes':_0x47ef97['attributes'],'include':_0x47ef97[_0xa6f7('0x1f')]?_[_0xa6f7('0x21')](_0x47ef97[_0xa6f7('0x1f')],function(_0x2b4c6c){return{'model':db[_0x2b4c6c[_0xa6f7('0x20')]],'as':_0x2b4c6c['as'],'attributes':_0x2b4c6c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c419b){logger[_0xa6f7('0xf')]('GetSalesforceAccount',_0x4a8827);logger[_0xa6f7('0x10')](_0xa6f7('0x22'),_0x4a8827,JSON[_0xa6f7('0x12')](_0x1c419b));_0x5298ba(_0x1c419b);})[_0xa6f7('0x19')](function(_0x224f5a){logger[_0xa6f7('0x13')](_0xa6f7('0x22'),_0x224f5a[_0xa6f7('0x16')],_0x4a8827);_0x378967(_0xba7755[_0xa6f7('0x13')](0x1f4,_0x224f5a[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x23')]=function(_0x278bad){var _0x52f9c1=this;return new Promise(function(_0x442ccf,_0x42dc49){return db['SalesforceAccount'][_0xa6f7('0x24')]({'raw':_0x278bad[_0xa6f7('0x1b')]?_0x278bad['options']['raw']===undefined?!![]:![]:!![],'where':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')]['attributes']||null:null,'include':_0x278bad['options']?_0x278bad[_0xa6f7('0x1b')]['include']?_[_0xa6f7('0x21')](_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1f')],function(_0x237e5d){return{'model':db[_0x237e5d[_0xa6f7('0x20')]],'as':_0x237e5d['as'],'attributes':_0x237e5d[_0xa6f7('0x1e')],'include':_0x237e5d['include']?_[_0xa6f7('0x21')](_0x237e5d[_0xa6f7('0x1f')],function(_0x1a5de5){return{'model':db[_0x1a5de5['model']],'as':_0x1a5de5['as'],'attributes':_0x1a5de5[_0xa6f7('0x1e')],'include':_0x1a5de5['include']?_[_0xa6f7('0x21')](_0x1a5de5[_0xa6f7('0x1f')],function(_0x45837c){return{'model':db[_0x45837c['model']],'as':_0x45837c['as'],'attributes':_0x45837c[_0xa6f7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa6f7('0xe')](function(_0x3b3bc2){logger[_0xa6f7('0xf')](_0xa6f7('0x23'),_0x278bad);logger[_0xa6f7('0x10')]('ShowSalesforceAccount',_0x278bad,JSON[_0xa6f7('0x12')](_0x3b3bc2));_0x442ccf(_0x3b3bc2);})[_0xa6f7('0x19')](function(_0xc25a1b){logger[_0xa6f7('0x13')](_0xa6f7('0x23'),_0xc25a1b[_0xa6f7('0x16')],_0x278bad);_0x42dc49(_0x52f9c1[_0xa6f7('0x13')](0x1f4,_0xc25a1b[_0xa6f7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index be42887..959aa3c 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 _0xe264=['../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe264,0x1c5));var _0x4e26=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xe264[_0x57975f];return _0x4793b8;};'use strict';var multer=require(_0x4e26('0x0'));var util=require(_0x4e26('0x1'));var path=require(_0x4e26('0x2'));var timeout=require(_0x4e26('0x3'));var express=require(_0x4e26('0x4'));var router=express[_0x4e26('0x5')]();var auth=require(_0x4e26('0x6'));var interaction=require(_0x4e26('0x7'));var config=require(_0x4e26('0x8'));var controller=require(_0x4e26('0x9'));router[_0x4e26('0xa')]('/',auth[_0x4e26('0xb')](),controller[_0x4e26('0xc')]);router['get'](_0x4e26('0xd'),auth[_0x4e26('0xb')](),controller[_0x4e26('0xe')]);router[_0x4e26('0xa')](_0x4e26('0xf'),auth[_0x4e26('0xb')](),controller['getFields']);router['get'](_0x4e26('0x10'),auth[_0x4e26('0xb')](),controller['getSubjects']);router[_0x4e26('0xa')](_0x4e26('0x11'),auth[_0x4e26('0xb')](),controller['getDescriptions']);router[_0x4e26('0x12')]('/',auth[_0x4e26('0xb')](),controller[_0x4e26('0x13')]);router[_0x4e26('0x14')](_0x4e26('0xd'),auth['isAuthenticated'](),controller[_0x4e26('0x15')]);router['delete'](_0x4e26('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4e26('0x16')]=router; \ No newline at end of file +var _0x6847=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','util','path'];(function(_0x1d29e7,_0xb566aa){var _0x48be7e=function(_0x4690d6){while(--_0x4690d6){_0x1d29e7['push'](_0x1d29e7['shift']());}};_0x48be7e(++_0xb566aa);}(_0x6847,0xfa));var _0x7684=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x6847[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x7684('0x0'));var util=require(_0x7684('0x1'));var path=require(_0x7684('0x2'));var timeout=require(_0x7684('0x3'));var express=require(_0x7684('0x4'));var router=express[_0x7684('0x5')]();var auth=require(_0x7684('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7684('0x7'));var controller=require(_0x7684('0x8'));router[_0x7684('0x9')]('/',auth[_0x7684('0xa')](),controller['index']);router[_0x7684('0x9')](_0x7684('0xb'),auth[_0x7684('0xa')](),controller[_0x7684('0xc')]);router[_0x7684('0x9')](_0x7684('0xd'),auth['isAuthenticated'](),controller[_0x7684('0xe')]);router['get'](_0x7684('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x7684('0x9')](_0x7684('0x10'),auth[_0x7684('0xa')](),controller[_0x7684('0x11')]);router[_0x7684('0x12')]('/',auth[_0x7684('0xa')](),controller[_0x7684('0x13')]);router[_0x7684('0x14')](_0x7684('0xb'),auth[_0x7684('0xa')](),controller[_0x7684('0x15')]);router['delete'](_0x7684('0xb'),auth[_0x7684('0xa')](),controller[_0x7684('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 67add3c..8a150a6 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 _0xba42=['exports','STRING','ENUM','Task','Case','lead','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xba42,0x12c));var _0x2ba4=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0xba42[_0x3ec1da];return _0x472358;};'use strict';var Sequelize=require(_0x2ba4('0x0'));module[_0x2ba4('0x1')]={'name':{'type':Sequelize[_0x2ba4('0x2')]},'description':{'type':Sequelize[_0x2ba4('0x2')]},'ticketType':{'type':Sequelize[_0x2ba4('0x3')](_0x2ba4('0x4'),_0x2ba4('0x5')),'defaultValue':_0x2ba4('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact',_0x2ba4('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x2ba4('0x3')]('nothing','contact','lead'),'defaultValue':_0x2ba4('0x6')}}; \ No newline at end of file +var _0xeb4c=['nothing','contact','sequelize','exports','STRING','ENUM','Task','lead','contact_lead'];(function(_0x4bf6b8,_0x444de8){var _0x4450b6=function(_0x116614){while(--_0x116614){_0x4bf6b8['push'](_0x4bf6b8['shift']());}};_0x4450b6(++_0x444de8);}(_0xeb4c,0x134));var _0xceb4=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeb4c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xceb4('0x0'));module[_0xceb4('0x1')]={'name':{'type':Sequelize[_0xceb4('0x2')]},'description':{'type':Sequelize[_0xceb4('0x2')]},'ticketType':{'type':Sequelize[_0xceb4('0x3')](_0xceb4('0x4'),'Case'),'defaultValue':_0xceb4('0x4')},'moduleSearch':{'type':Sequelize[_0xceb4('0x3')]('contact_lead','contact',_0xceb4('0x5')),'defaultValue':_0xceb4('0x6')},'moduleCreate':{'type':Sequelize[_0xceb4('0x3')](_0xceb4('0x7'),_0xceb4('0x8'),_0xceb4('0x5')),'defaultValue':_0xceb4('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index a043bf5..f163360 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 _0x7b49=['set','Content-Range','apply','reject','update','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SalesforceConfiguration','includeAll','findAll','show','include','find','create','body','params','getFields','findOne','SalesforceField','length','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','count','offset','limit'];(function(_0x34abcf,_0x8e69e5){var _0x44b2a4=function(_0xdf9465){while(--_0xdf9465){_0x34abcf['push'](_0x34abcf['shift']());}};_0x44b2a4(++_0x8e69e5);}(_0x7b49,0x87));var _0x97b4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7b49[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x97b4('0x0'));var emlformat=require(_0x97b4('0x1'));var rimraf=require(_0x97b4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x97b4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x97b4('0x4'));var util=require('util');var path=require(_0x97b4('0x5'));var sox=require(_0x97b4('0x6'));var csv=require(_0x97b4('0x7'));var ejs=require(_0x97b4('0x8'));var fs=require('fs');var _=require(_0x97b4('0x9'));var squel=require(_0x97b4('0xa'));var crypto=require(_0x97b4('0xb'));var jsforce=require(_0x97b4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x97b4('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x97b4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x97b4('0xf'));var hardwareService=require(_0x97b4('0x10'));var logger=require(_0x97b4('0x11'))('api');var utils=require(_0x97b4('0x12'));var config=require(_0x97b4('0x13'));var db=require(_0x97b4('0x14'))['db'];var jayson=require(_0x97b4('0x15'));var client=jayson[_0x97b4('0x16')][_0x97b4('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5e405c,_0x6b1f7a,_0x482744){if(_0x482744){var _0x1c62ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c62ee['test'](_0x6b1f7a)){return _0x5e405c;}else{throw new db[(_0x97b4('0x18'))]['ValidationError'](_0x97b4('0x19'));}}else{return _0x5e405c;}}function respondWithRpcPromise(_0x734564,_0x570471,_0x177238,_0x2f2046){return new BPromise(function(_0x1e9269,_0x39d551){var _0x20baae=_0x2f2046||client;return _0x20baae['request'](_0x734564,_0x177238)[_0x97b4('0x1a')](function(_0x4931bc){logger[_0x97b4('0x1b')](_0x97b4('0x1c'),_0x570471,_0x97b4('0x1d'));logger[_0x97b4('0x1e')](_0x97b4('0x1f'),_0x570471,'request\x20sent',JSON['stringify'](_0x4931bc));if(_0x4931bc[_0x97b4('0x20')]){if(_0x4931bc[_0x97b4('0x20')]['code']===0x1f4){logger[_0x97b4('0x20')](_0x97b4('0x1c'),_0x570471,_0x4931bc[_0x97b4('0x20')][_0x97b4('0x21')]);return _0x39d551(_0x4931bc[_0x97b4('0x20')][_0x97b4('0x21')]);}logger[_0x97b4('0x20')](_0x97b4('0x1c'),_0x570471,_0x4931bc[_0x97b4('0x20')][_0x97b4('0x21')]);return _0x1e9269(_0x4931bc['error'][_0x97b4('0x21')]);}else{logger['info'](_0x97b4('0x1c'),_0x570471,_0x97b4('0x1d'));_0x1e9269(_0x4931bc[_0x97b4('0x22')][_0x97b4('0x21')]);}})[_0x97b4('0x23')](function(_0x3e3636){logger['error'](_0x97b4('0x1c'),_0x570471,_0x3e3636);_0x39d551(_0x3e3636);});});}function respondWithStatusCode(_0x440714,_0x2406da){_0x2406da=_0x2406da||0xcc;return function(_0x27036b){if(_0x27036b){return _0x440714['sendStatus'](_0x2406da);}return _0x440714[_0x97b4('0x24')](_0x2406da)['end']();};}function respondWithResult(_0xd9d682,_0x3398c0){_0x3398c0=_0x3398c0||0xc8;return function(_0xae5a5c){if(_0xae5a5c){return _0xd9d682[_0x97b4('0x24')](_0x3398c0)[_0x97b4('0x25')](_0xae5a5c);}};}function respondWithFilteredResult(_0x24cbff,_0x11b69f){return function(_0x1d57d0){if(_0x1d57d0){var _0x526eb1=_0x1d57d0[_0x97b4('0x26')],_0xfc941=_0x11b69f[_0x97b4('0x27')],_0x268b42=_0x11b69f[_0x97b4('0x27')]+_0x11b69f[_0x97b4('0x28')],_0x4fea4b;if(_0x268b42>=_0x526eb1){_0x268b42=_0x526eb1;_0x4fea4b=0xc8;}else{_0x4fea4b=0xce;}_0x24cbff[_0x97b4('0x24')](_0x4fea4b);return _0x24cbff[_0x97b4('0x29')](_0x97b4('0x2a'),_0xfc941+'-'+_0x268b42+'/'+_0x526eb1)['json'](_0x1d57d0);}return null;};}function patchUpdates(_0x3bc028){return function(_0x49eb5e){try{jsonpatch[_0x97b4('0x2b')](_0x49eb5e,_0x3bc028,!![]);}catch(_0x45a744){return BPromise[_0x97b4('0x2c')](_0x45a744);}return _0x49eb5e['save']();};}function saveUpdates(_0x384220,_0x127088){return function(_0x3faeb9){if(_0x3faeb9){return _0x3faeb9[_0x97b4('0x2d')](_0x384220)['then'](function(_0xf31596){return _0xf31596;});}return null;};}function removeEntity(_0x243046,_0x2ef80a){return function(_0x3d15fc){if(_0x3d15fc){return _0x3d15fc[_0x97b4('0x2e')]()[_0x97b4('0x1a')](function(){_0x243046['status'](0xcc)[_0x97b4('0x2f')]();});}};}function handleEntityNotFound(_0x1dae90,_0x2d81b1){return function(_0x4fcbd3){if(!_0x4fcbd3){_0x1dae90['sendStatus'](0x194);}return _0x4fcbd3;};}function handleError(_0x31771f,_0x1bbf6c){_0x1bbf6c=_0x1bbf6c||0x1f4;return function(_0x109cae){logger[_0x97b4('0x20')](_0x109cae[_0x97b4('0x30')]);if(_0x109cae[_0x97b4('0x31')]){delete _0x109cae['name'];}_0x31771f['status'](_0x1bbf6c)[_0x97b4('0x32')](_0x109cae);};}exports['index']=function(_0x2bd05b,_0x149560){var _0x13161f={},_0x484d9a={},_0x22475a={'count':0x0,'rows':[]};var _0x3d4ef7=_[_0x97b4('0x33')](db['SalesforceConfiguration'][_0x97b4('0x34')],function(_0x4be471){return{'name':_0x4be471[_0x97b4('0x35')],'type':_0x4be471[_0x97b4('0x36')][_0x97b4('0x37')]};});_0x484d9a[_0x97b4('0x38')]=_[_0x97b4('0x33')](_0x3d4ef7,_0x97b4('0x31'));_0x484d9a['query']=_[_0x97b4('0x39')](_0x2bd05b[_0x97b4('0x3a')]);_0x484d9a[_0x97b4('0x3b')]=_['intersection'](_0x484d9a[_0x97b4('0x38')],_0x484d9a[_0x97b4('0x3a')]);_0x13161f[_0x97b4('0x3c')]=_[_0x97b4('0x3d')](_0x484d9a[_0x97b4('0x38')],qs[_0x97b4('0x3e')](_0x2bd05b['query'][_0x97b4('0x3e')]));_0x13161f['attributes']=_0x13161f['attributes']['length']?_0x13161f[_0x97b4('0x3c')]:_0x484d9a[_0x97b4('0x38')];if(!_0x2bd05b[_0x97b4('0x3a')][_0x97b4('0x3f')](_0x97b4('0x40'))){_0x13161f['limit']=qs[_0x97b4('0x28')](_0x2bd05b[_0x97b4('0x3a')][_0x97b4('0x28')]);_0x13161f[_0x97b4('0x27')]=qs[_0x97b4('0x27')](_0x2bd05b[_0x97b4('0x3a')]['offset']);}_0x13161f[_0x97b4('0x41')]=qs[_0x97b4('0x42')](_0x2bd05b[_0x97b4('0x3a')][_0x97b4('0x42')]);_0x13161f[_0x97b4('0x43')]=qs[_0x97b4('0x3b')](_[_0x97b4('0x44')](_0x2bd05b[_0x97b4('0x3a')],_0x484d9a['filters']));if(_0x2bd05b['query']['filter']){_0x13161f[_0x97b4('0x43')]=_[_0x97b4('0x45')](_0x13161f[_0x97b4('0x43')],{'$or':_[_0x97b4('0x33')](_0x3d4ef7,function(_0x1c514d){if(_0x1c514d[_0x97b4('0x36')]!==_0x97b4('0x46')){var _0x3b1085={};_0x3b1085[_0x1c514d['name']]={'$like':'%'+_0x2bd05b['query'][_0x97b4('0x47')]+'%'};return _0x3b1085;}})});}_0x13161f=_[_0x97b4('0x45')]({},_0x13161f,_0x2bd05b[_0x97b4('0x48')]);var _0x19692a={'where':_0x13161f[_0x97b4('0x43')]};return db[_0x97b4('0x49')][_0x97b4('0x26')](_0x19692a)[_0x97b4('0x1a')](function(_0x205441){_0x22475a[_0x97b4('0x26')]=_0x205441;if(_0x2bd05b[_0x97b4('0x3a')][_0x97b4('0x4a')]){_0x13161f['include']=[{'all':!![]}];}return db[_0x97b4('0x49')][_0x97b4('0x4b')](_0x13161f);})[_0x97b4('0x1a')](function(_0x3301b5){_0x22475a['rows']=_0x3301b5;return _0x22475a;})['then'](respondWithFilteredResult(_0x149560,_0x13161f))[_0x97b4('0x23')](handleError(_0x149560,null));};exports[_0x97b4('0x4c')]=function(_0x4e543a,_0x2e4c57){var _0x16d085={'raw':![],'where':{'id':_0x4e543a['params']['id']}},_0x49d614={};_0x49d614[_0x97b4('0x38')]=_[_0x97b4('0x39')](db['SalesforceConfiguration'][_0x97b4('0x34')]);_0x49d614[_0x97b4('0x3a')]=_['keys'](_0x4e543a[_0x97b4('0x3a')]);_0x49d614['filters']=_[_0x97b4('0x3d')](_0x49d614[_0x97b4('0x38')],_0x49d614[_0x97b4('0x3a')]);_0x16d085['attributes']=_[_0x97b4('0x3d')](_0x49d614['model'],qs[_0x97b4('0x3e')](_0x4e543a[_0x97b4('0x3a')][_0x97b4('0x3e')]));_0x16d085[_0x97b4('0x3c')]=_0x16d085['attributes']['length']?_0x16d085[_0x97b4('0x3c')]:_0x49d614[_0x97b4('0x38')];if(_0x4e543a['query'][_0x97b4('0x4a')]){_0x16d085[_0x97b4('0x4d')]=[{'all':!![]}];}_0x16d085=_[_0x97b4('0x45')]({},_0x16d085,_0x4e543a[_0x97b4('0x48')]);return db[_0x97b4('0x49')][_0x97b4('0x4e')](_0x16d085)[_0x97b4('0x1a')](handleEntityNotFound(_0x2e4c57,null))[_0x97b4('0x1a')](respondWithResult(_0x2e4c57,null))[_0x97b4('0x23')](handleError(_0x2e4c57,null));};exports[_0x97b4('0x4f')]=function(_0x3d66c9,_0x53f0f8){return db[_0x97b4('0x49')]['create'](_0x3d66c9[_0x97b4('0x50')],{})['then'](respondWithResult(_0x53f0f8,0xc9))[_0x97b4('0x23')](handleError(_0x53f0f8,null));};exports[_0x97b4('0x2d')]=function(_0x38cb75,_0x23801e){if(_0x38cb75[_0x97b4('0x50')]['id']){delete _0x38cb75[_0x97b4('0x50')]['id'];}return db[_0x97b4('0x49')][_0x97b4('0x4e')]({'where':{'id':_0x38cb75[_0x97b4('0x51')]['id']}})['then'](handleEntityNotFound(_0x23801e,null))[_0x97b4('0x1a')](saveUpdates(_0x38cb75[_0x97b4('0x50')],null))[_0x97b4('0x1a')](respondWithResult(_0x23801e,null))[_0x97b4('0x23')](handleError(_0x23801e,null));};exports['destroy']=function(_0x2ef04f,_0x20eead){return db['SalesforceConfiguration'][_0x97b4('0x4e')]({'where':{'id':_0x2ef04f[_0x97b4('0x51')]['id']}})['then'](handleEntityNotFound(_0x20eead,null))[_0x97b4('0x1a')](removeEntity(_0x20eead,null))[_0x97b4('0x23')](handleError(_0x20eead,null));};exports[_0x97b4('0x52')]=function(_0xc5df2a,_0x59fdc4,_0x2cd3bd){var _0x26dd62={};var _0x531d37={};var _0x55c277;var _0x35dc8c;return db[_0x97b4('0x49')][_0x97b4('0x53')]({'where':{'id':_0xc5df2a['params']['id']}})['then'](handleEntityNotFound(_0x59fdc4,null))[_0x97b4('0x1a')](function(_0x4ead01){if(_0x4ead01){_0x55c277=_0x4ead01;_0x531d37[_0x97b4('0x38')]=_[_0x97b4('0x39')](db[_0x97b4('0x54')][_0x97b4('0x34')]);_0x531d37['query']=_[_0x97b4('0x39')](_0xc5df2a['query']);_0x531d37[_0x97b4('0x3b')]=_['intersection'](_0x531d37[_0x97b4('0x38')],_0x531d37['query']);_0x26dd62[_0x97b4('0x3c')]=_['intersection'](_0x531d37[_0x97b4('0x38')],qs['fields'](_0xc5df2a[_0x97b4('0x3a')][_0x97b4('0x3e')]));_0x26dd62[_0x97b4('0x3c')]=_0x26dd62[_0x97b4('0x3c')]['length']?_0x26dd62['attributes']:_0x531d37[_0x97b4('0x38')];_0x26dd62['order']=qs[_0x97b4('0x42')](_0xc5df2a[_0x97b4('0x3a')]['sort']);_0x26dd62[_0x97b4('0x43')]=qs[_0x97b4('0x3b')](_[_0x97b4('0x44')](_0xc5df2a['query'],_0x531d37[_0x97b4('0x3b')]));if(_0xc5df2a[_0x97b4('0x3a')]['filter']){_0x26dd62['where']=_['merge'](_0x26dd62[_0x97b4('0x43')],{'$or':_['map'](_0x26dd62[_0x97b4('0x3c')],function(_0x18fc98){var _0x18ef44={};_0x18ef44[_0x18fc98]={'$like':'%'+_0xc5df2a[_0x97b4('0x3a')][_0x97b4('0x47')]+'%'};return _0x18ef44;})});}_0x26dd62=_[_0x97b4('0x45')]({},_0x26dd62,_0xc5df2a[_0x97b4('0x48')]);return _0x55c277['getFields'](_0x26dd62);}})['then'](function(_0x15254c){if(_0x15254c){_0x35dc8c=_0x15254c[_0x97b4('0x55')];if(!_0xc5df2a[_0x97b4('0x3a')]['hasOwnProperty'](_0x97b4('0x40'))){_0x26dd62[_0x97b4('0x28')]=qs[_0x97b4('0x28')](_0xc5df2a[_0x97b4('0x3a')]['limit']);_0x26dd62[_0x97b4('0x27')]=qs[_0x97b4('0x27')](_0xc5df2a[_0x97b4('0x3a')][_0x97b4('0x27')]);}return _0x55c277[_0x97b4('0x52')](_0x26dd62);}})[_0x97b4('0x1a')](function(_0x1f78cb){if(_0x1f78cb){return _0x1f78cb?{'count':_0x35dc8c,'rows':_0x1f78cb}:null;}})[_0x97b4('0x1a')](respondWithResult(_0x59fdc4,null))[_0x97b4('0x23')](handleError(_0x59fdc4,null));};exports[_0x97b4('0x56')]=function(_0x8c6100,_0x4fbb0b,_0x2b7c1d){var _0x37b96a={};var _0x5637c4={};var _0xc7f0b6;var _0x4aa725;return db[_0x97b4('0x49')][_0x97b4('0x53')]({'where':{'id':_0x8c6100[_0x97b4('0x51')]['id']}})[_0x97b4('0x1a')](handleEntityNotFound(_0x4fbb0b,null))[_0x97b4('0x1a')](function(_0x45ad7c){if(_0x45ad7c){_0xc7f0b6=_0x45ad7c;_0x5637c4[_0x97b4('0x38')]=_[_0x97b4('0x39')](db[_0x97b4('0x54')]['rawAttributes']);_0x5637c4[_0x97b4('0x3a')]=_[_0x97b4('0x39')](_0x8c6100[_0x97b4('0x3a')]);_0x5637c4[_0x97b4('0x3b')]=_[_0x97b4('0x3d')](_0x5637c4[_0x97b4('0x38')],_0x5637c4['query']);_0x37b96a[_0x97b4('0x3c')]=_['intersection'](_0x5637c4['model'],qs[_0x97b4('0x3e')](_0x8c6100[_0x97b4('0x3a')][_0x97b4('0x3e')]));_0x37b96a[_0x97b4('0x3c')]=_0x37b96a['attributes'][_0x97b4('0x55')]?_0x37b96a['attributes']:_0x5637c4[_0x97b4('0x38')];_0x37b96a[_0x97b4('0x41')]=qs[_0x97b4('0x42')](_0x8c6100[_0x97b4('0x3a')][_0x97b4('0x42')]);_0x37b96a[_0x97b4('0x43')]=qs[_0x97b4('0x3b')](_[_0x97b4('0x44')](_0x8c6100[_0x97b4('0x3a')],_0x5637c4[_0x97b4('0x3b')]));if(_0x8c6100[_0x97b4('0x3a')]['filter']){_0x37b96a[_0x97b4('0x43')]=_[_0x97b4('0x45')](_0x37b96a[_0x97b4('0x43')],{'$or':_['map'](_0x37b96a[_0x97b4('0x3c')],function(_0x56c908){var _0x1dd9c8={};_0x1dd9c8[_0x56c908]={'$like':'%'+_0x8c6100[_0x97b4('0x3a')]['filter']+'%'};return _0x1dd9c8;})});}_0x37b96a=_['merge']({},_0x37b96a,_0x8c6100[_0x97b4('0x48')]);return _0xc7f0b6[_0x97b4('0x56')](_0x37b96a);}})['then'](function(_0x27a018){if(_0x27a018){_0x4aa725=_0x27a018[_0x97b4('0x55')];if(!_0x8c6100[_0x97b4('0x3a')][_0x97b4('0x3f')]('nolimit')){_0x37b96a[_0x97b4('0x28')]=qs['limit'](_0x8c6100['query'][_0x97b4('0x28')]);_0x37b96a['offset']=qs[_0x97b4('0x27')](_0x8c6100['query'][_0x97b4('0x27')]);}return _0xc7f0b6[_0x97b4('0x56')](_0x37b96a);}})[_0x97b4('0x1a')](function(_0x2d6a3a){if(_0x2d6a3a){return _0x2d6a3a?{'count':_0x4aa725,'rows':_0x2d6a3a}:null;}})[_0x97b4('0x1a')](respondWithResult(_0x4fbb0b,null))['catch'](handleError(_0x4fbb0b,null));};exports['getDescriptions']=function(_0x1e329b,_0x430c5c,_0x3af9d5){var _0x3eddfe={};var _0x4b6b3b={};var _0x2e07ea;var _0x433024;return db[_0x97b4('0x49')]['findOne']({'where':{'id':_0x1e329b[_0x97b4('0x51')]['id']}})[_0x97b4('0x1a')](handleEntityNotFound(_0x430c5c,null))[_0x97b4('0x1a')](function(_0x5a4603){if(_0x5a4603){_0x2e07ea=_0x5a4603;_0x4b6b3b[_0x97b4('0x38')]=_[_0x97b4('0x39')](db['SalesforceField'][_0x97b4('0x34')]);_0x4b6b3b['query']=_[_0x97b4('0x39')](_0x1e329b[_0x97b4('0x3a')]);_0x4b6b3b[_0x97b4('0x3b')]=_['intersection'](_0x4b6b3b[_0x97b4('0x38')],_0x4b6b3b[_0x97b4('0x3a')]);_0x3eddfe[_0x97b4('0x3c')]=_[_0x97b4('0x3d')](_0x4b6b3b['model'],qs[_0x97b4('0x3e')](_0x1e329b[_0x97b4('0x3a')][_0x97b4('0x3e')]));_0x3eddfe[_0x97b4('0x3c')]=_0x3eddfe[_0x97b4('0x3c')]['length']?_0x3eddfe[_0x97b4('0x3c')]:_0x4b6b3b[_0x97b4('0x38')];_0x3eddfe[_0x97b4('0x41')]=qs['sort'](_0x1e329b['query']['sort']);_0x3eddfe[_0x97b4('0x43')]=qs[_0x97b4('0x3b')](_['pick'](_0x1e329b['query'],_0x4b6b3b['filters']));if(_0x1e329b[_0x97b4('0x3a')][_0x97b4('0x47')]){_0x3eddfe[_0x97b4('0x43')]=_[_0x97b4('0x45')](_0x3eddfe[_0x97b4('0x43')],{'$or':_[_0x97b4('0x33')](_0x3eddfe[_0x97b4('0x3c')],function(_0x424e41){var _0x13e6d9={};_0x13e6d9[_0x424e41]={'$like':'%'+_0x1e329b[_0x97b4('0x3a')][_0x97b4('0x47')]+'%'};return _0x13e6d9;})});}_0x3eddfe=_['merge']({},_0x3eddfe,_0x1e329b[_0x97b4('0x48')]);return _0x2e07ea['getDescriptions'](_0x3eddfe);}})[_0x97b4('0x1a')](function(_0x3d0721){if(_0x3d0721){_0x433024=_0x3d0721['length'];if(!_0x1e329b[_0x97b4('0x3a')]['hasOwnProperty']('nolimit')){_0x3eddfe[_0x97b4('0x28')]=qs['limit'](_0x1e329b[_0x97b4('0x3a')][_0x97b4('0x28')]);_0x3eddfe[_0x97b4('0x27')]=qs[_0x97b4('0x27')](_0x1e329b['query'][_0x97b4('0x27')]);}return _0x2e07ea[_0x97b4('0x57')](_0x3eddfe);}})[_0x97b4('0x1a')](function(_0x2f0566){if(_0x2f0566){return _0x2f0566?{'count':_0x433024,'rows':_0x2f0566}:null;}})[_0x97b4('0x1a')](respondWithResult(_0x430c5c,null))['catch'](handleError(_0x430c5c,null));}; \ No newline at end of file +var _0x8208=['getFields','findOne','pick','options','hasOwnProperty','nolimit','getSubjects','SalesforceField','order','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','sort','filter','where','VIRTUAL','merge','count','include','findAll','rows','params','includeAll','find','create','body'];(function(_0x1688fa,_0x2e2b73){var _0x44abba=function(_0x52fe97){while(--_0x52fe97){_0x1688fa['push'](_0x1688fa['shift']());}};_0x44abba(++_0x2e2b73);}(_0x8208,0xc6));var _0x8820=function(_0x44d2b3,_0x728691){_0x44d2b3=_0x44d2b3-0x0;var _0x281afe=_0x8208[_0x44d2b3];return _0x281afe;};'use strict';var pdf=require(_0x8820('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8820('0x1'));var zipdir=require(_0x8820('0x2'));var jsonpatch=require(_0x8820('0x3'));var rp=require(_0x8820('0x4'));var moment=require('moment');var BPromise=require(_0x8820('0x5'));var Mustache=require(_0x8820('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8820('0x7'));var csv=require(_0x8820('0x8'));var ejs=require(_0x8820('0x9'));var fs=require('fs');var _=require(_0x8820('0xa'));var squel=require(_0x8820('0xb'));var crypto=require(_0x8820('0xc'));var jsforce=require(_0x8820('0xd'));var deskjs=require(_0x8820('0xe'));var toCsv=require(_0x8820('0x8'));var querystring=require(_0x8820('0xf'));var Papa=require(_0x8820('0x10'));var Redis=require('ioredis');var authService=require(_0x8820('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8820('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8820('0x13'))(_0x8820('0x14'));var utils=require(_0x8820('0x15'));var config=require(_0x8820('0x16'));var db=require(_0x8820('0x17'))['db'];var jayson=require(_0x8820('0x18'));var client=jayson[_0x8820('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x44286a,_0x3e5ee6,_0x523f89){if(_0x523f89){var _0x281ed0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x281ed0[_0x8820('0x1a')](_0x3e5ee6)){return _0x44286a;}else{throw new db[(_0x8820('0x1b'))][(_0x8820('0x1c'))](_0x8820('0x1d'));}}else{return _0x44286a;}}function respondWithRpcPromise(_0x13bd49,_0x4bf112,_0x13af99,_0xd82682){return new BPromise(function(_0x4eb297,_0x3a80ff){var _0x4e3caa=_0xd82682||client;return _0x4e3caa[_0x8820('0x1e')](_0x13bd49,_0x13af99)['then'](function(_0x49d88b){logger[_0x8820('0x1f')](_0x8820('0x20'),_0x4bf112,_0x8820('0x21'));logger[_0x8820('0x22')](_0x8820('0x23'),_0x4bf112,'request\x20sent',JSON[_0x8820('0x24')](_0x49d88b));if(_0x49d88b[_0x8820('0x25')]){if(_0x49d88b[_0x8820('0x25')]['code']===0x1f4){logger[_0x8820('0x25')](_0x8820('0x20'),_0x4bf112,_0x49d88b[_0x8820('0x25')]['message']);return _0x3a80ff(_0x49d88b[_0x8820('0x25')][_0x8820('0x26')]);}logger['error'](_0x8820('0x20'),_0x4bf112,_0x49d88b[_0x8820('0x25')]['message']);return _0x4eb297(_0x49d88b['error'][_0x8820('0x26')]);}else{logger[_0x8820('0x1f')](_0x8820('0x20'),_0x4bf112,'request\x20sent');_0x4eb297(_0x49d88b[_0x8820('0x27')][_0x8820('0x26')]);}})[_0x8820('0x28')](function(_0xf8c93a){logger[_0x8820('0x25')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4bf112,_0xf8c93a);_0x3a80ff(_0xf8c93a);});});}function respondWithStatusCode(_0x577db4,_0x32128a){_0x32128a=_0x32128a||0xcc;return function(_0x3b4c94){if(_0x3b4c94){return _0x577db4[_0x8820('0x29')](_0x32128a);}return _0x577db4[_0x8820('0x2a')](_0x32128a)[_0x8820('0x2b')]();};}function respondWithResult(_0x77e64c,_0x19cf08){_0x19cf08=_0x19cf08||0xc8;return function(_0x55c712){if(_0x55c712){return _0x77e64c['status'](_0x19cf08)[_0x8820('0x2c')](_0x55c712);}};}function respondWithFilteredResult(_0x362c70,_0x43c36d){return function(_0x3ada09){if(_0x3ada09){var _0x318589=_0x3ada09['count'],_0x30fcc9=_0x43c36d[_0x8820('0x2d')],_0x32e394=_0x43c36d['offset']+_0x43c36d[_0x8820('0x2e')],_0x347878;if(_0x32e394>=_0x318589){_0x32e394=_0x318589;_0x347878=0xc8;}else{_0x347878=0xce;}_0x362c70[_0x8820('0x2a')](_0x347878);return _0x362c70[_0x8820('0x2f')](_0x8820('0x30'),_0x30fcc9+'-'+_0x32e394+'/'+_0x318589)[_0x8820('0x2c')](_0x3ada09);}return null;};}function patchUpdates(_0x4a964c){return function(_0x47760d){try{jsonpatch[_0x8820('0x31')](_0x47760d,_0x4a964c,!![]);}catch(_0x1c5b26){return BPromise['reject'](_0x1c5b26);}return _0x47760d[_0x8820('0x32')]();};}function saveUpdates(_0x384710,_0x2ee24b){return function(_0x69ce26){if(_0x69ce26){return _0x69ce26[_0x8820('0x33')](_0x384710)[_0x8820('0x34')](function(_0x1b6a8d){return _0x1b6a8d;});}return null;};}function removeEntity(_0x578c8e,_0x3cff4a){return function(_0xaede54){if(_0xaede54){return _0xaede54[_0x8820('0x35')]()[_0x8820('0x34')](function(){_0x578c8e[_0x8820('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eccd4,_0x463d02){return function(_0x3e682d){if(!_0x3e682d){_0x5eccd4[_0x8820('0x29')](0x194);}return _0x3e682d;};}function handleError(_0x105349,_0x473981){_0x473981=_0x473981||0x1f4;return function(_0x194741){logger['error'](_0x194741[_0x8820('0x36')]);if(_0x194741[_0x8820('0x37')]){delete _0x194741[_0x8820('0x37')];}_0x105349[_0x8820('0x2a')](_0x473981)['send'](_0x194741);};}exports[_0x8820('0x38')]=function(_0xe4144a,_0x39ba85){var _0x26d6e2={},_0x5a77ff={},_0x5909b3={'count':0x0,'rows':[]};var _0x184679=_[_0x8820('0x39')](db[_0x8820('0x3a')][_0x8820('0x3b')],function(_0x209966){return{'name':_0x209966[_0x8820('0x3c')],'type':_0x209966[_0x8820('0x3d')]['key']};});_0x5a77ff['model']=_[_0x8820('0x39')](_0x184679,_0x8820('0x37'));_0x5a77ff[_0x8820('0x3e')]=_[_0x8820('0x3f')](_0xe4144a[_0x8820('0x3e')]);_0x5a77ff[_0x8820('0x40')]=_['intersection'](_0x5a77ff[_0x8820('0x41')],_0x5a77ff[_0x8820('0x3e')]);_0x26d6e2['attributes']=_[_0x8820('0x42')](_0x5a77ff[_0x8820('0x41')],qs[_0x8820('0x43')](_0xe4144a[_0x8820('0x3e')][_0x8820('0x43')]));_0x26d6e2['attributes']=_0x26d6e2[_0x8820('0x44')][_0x8820('0x45')]?_0x26d6e2[_0x8820('0x44')]:_0x5a77ff[_0x8820('0x41')];if(!_0xe4144a[_0x8820('0x3e')]['hasOwnProperty']('nolimit')){_0x26d6e2[_0x8820('0x2e')]=qs[_0x8820('0x2e')](_0xe4144a[_0x8820('0x3e')][_0x8820('0x2e')]);_0x26d6e2[_0x8820('0x2d')]=qs[_0x8820('0x2d')](_0xe4144a[_0x8820('0x3e')][_0x8820('0x2d')]);}_0x26d6e2['order']=qs[_0x8820('0x46')](_0xe4144a[_0x8820('0x3e')][_0x8820('0x46')]);_0x26d6e2['where']=qs[_0x8820('0x40')](_['pick'](_0xe4144a[_0x8820('0x3e')],_0x5a77ff[_0x8820('0x40')]));if(_0xe4144a[_0x8820('0x3e')][_0x8820('0x47')]){_0x26d6e2[_0x8820('0x48')]=_['merge'](_0x26d6e2[_0x8820('0x48')],{'$or':_[_0x8820('0x39')](_0x184679,function(_0x494dac){if(_0x494dac[_0x8820('0x3d')]!==_0x8820('0x49')){var _0x232c4f={};_0x232c4f[_0x494dac[_0x8820('0x37')]]={'$like':'%'+_0xe4144a[_0x8820('0x3e')][_0x8820('0x47')]+'%'};return _0x232c4f;}})});}_0x26d6e2=_[_0x8820('0x4a')]({},_0x26d6e2,_0xe4144a['options']);var _0xeae348={'where':_0x26d6e2[_0x8820('0x48')]};return db[_0x8820('0x3a')][_0x8820('0x4b')](_0xeae348)[_0x8820('0x34')](function(_0x585621){_0x5909b3['count']=_0x585621;if(_0xe4144a[_0x8820('0x3e')]['includeAll']){_0x26d6e2[_0x8820('0x4c')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x8820('0x4d')](_0x26d6e2);})['then'](function(_0x20dd33){_0x5909b3[_0x8820('0x4e')]=_0x20dd33;return _0x5909b3;})[_0x8820('0x34')](respondWithFilteredResult(_0x39ba85,_0x26d6e2))[_0x8820('0x28')](handleError(_0x39ba85,null));};exports['show']=function(_0x5b1629,_0xa8a158){var _0xaa4e90={'raw':![],'where':{'id':_0x5b1629[_0x8820('0x4f')]['id']}},_0x58eee1={};_0x58eee1['model']=_[_0x8820('0x3f')](db['SalesforceConfiguration'][_0x8820('0x3b')]);_0x58eee1[_0x8820('0x3e')]=_[_0x8820('0x3f')](_0x5b1629[_0x8820('0x3e')]);_0x58eee1['filters']=_['intersection'](_0x58eee1[_0x8820('0x41')],_0x58eee1[_0x8820('0x3e')]);_0xaa4e90[_0x8820('0x44')]=_['intersection'](_0x58eee1[_0x8820('0x41')],qs[_0x8820('0x43')](_0x5b1629['query'][_0x8820('0x43')]));_0xaa4e90[_0x8820('0x44')]=_0xaa4e90[_0x8820('0x44')][_0x8820('0x45')]?_0xaa4e90[_0x8820('0x44')]:_0x58eee1[_0x8820('0x41')];if(_0x5b1629['query'][_0x8820('0x50')]){_0xaa4e90[_0x8820('0x4c')]=[{'all':!![]}];}_0xaa4e90=_[_0x8820('0x4a')]({},_0xaa4e90,_0x5b1629['options']);return db['SalesforceConfiguration'][_0x8820('0x51')](_0xaa4e90)['then'](handleEntityNotFound(_0xa8a158,null))[_0x8820('0x34')](respondWithResult(_0xa8a158,null))[_0x8820('0x28')](handleError(_0xa8a158,null));};exports['create']=function(_0x4eb030,_0x4e5552){return db['SalesforceConfiguration'][_0x8820('0x52')](_0x4eb030[_0x8820('0x53')],{})[_0x8820('0x34')](respondWithResult(_0x4e5552,0xc9))['catch'](handleError(_0x4e5552,null));};exports[_0x8820('0x33')]=function(_0x2d7f0c,_0x2ab011){if(_0x2d7f0c[_0x8820('0x53')]['id']){delete _0x2d7f0c[_0x8820('0x53')]['id'];}return db[_0x8820('0x3a')][_0x8820('0x51')]({'where':{'id':_0x2d7f0c['params']['id']}})['then'](handleEntityNotFound(_0x2ab011,null))['then'](saveUpdates(_0x2d7f0c['body'],null))[_0x8820('0x34')](respondWithResult(_0x2ab011,null))['catch'](handleError(_0x2ab011,null));};exports[_0x8820('0x35')]=function(_0x159399,_0x3dba84){return db[_0x8820('0x3a')]['find']({'where':{'id':_0x159399['params']['id']}})[_0x8820('0x34')](handleEntityNotFound(_0x3dba84,null))['then'](removeEntity(_0x3dba84,null))[_0x8820('0x28')](handleError(_0x3dba84,null));};exports[_0x8820('0x54')]=function(_0x55d229,_0x4122cb,_0xf0f11a){var _0x211a06={};var _0x4e6de5={};var _0x5c7b36;var _0x968ee4;return db['SalesforceConfiguration'][_0x8820('0x55')]({'where':{'id':_0x55d229['params']['id']}})[_0x8820('0x34')](handleEntityNotFound(_0x4122cb,null))[_0x8820('0x34')](function(_0x36af94){if(_0x36af94){_0x5c7b36=_0x36af94;_0x4e6de5['model']=_[_0x8820('0x3f')](db['SalesforceField'][_0x8820('0x3b')]);_0x4e6de5['query']=_[_0x8820('0x3f')](_0x55d229[_0x8820('0x3e')]);_0x4e6de5['filters']=_[_0x8820('0x42')](_0x4e6de5[_0x8820('0x41')],_0x4e6de5['query']);_0x211a06[_0x8820('0x44')]=_['intersection'](_0x4e6de5[_0x8820('0x41')],qs[_0x8820('0x43')](_0x55d229['query'][_0x8820('0x43')]));_0x211a06[_0x8820('0x44')]=_0x211a06[_0x8820('0x44')][_0x8820('0x45')]?_0x211a06[_0x8820('0x44')]:_0x4e6de5[_0x8820('0x41')];_0x211a06['order']=qs[_0x8820('0x46')](_0x55d229[_0x8820('0x3e')][_0x8820('0x46')]);_0x211a06['where']=qs['filters'](_[_0x8820('0x56')](_0x55d229[_0x8820('0x3e')],_0x4e6de5[_0x8820('0x40')]));if(_0x55d229[_0x8820('0x3e')][_0x8820('0x47')]){_0x211a06['where']=_[_0x8820('0x4a')](_0x211a06[_0x8820('0x48')],{'$or':_[_0x8820('0x39')](_0x211a06[_0x8820('0x44')],function(_0x2ce867){var _0x4eddac={};_0x4eddac[_0x2ce867]={'$like':'%'+_0x55d229[_0x8820('0x3e')]['filter']+'%'};return _0x4eddac;})});}_0x211a06=_[_0x8820('0x4a')]({},_0x211a06,_0x55d229[_0x8820('0x57')]);return _0x5c7b36[_0x8820('0x54')](_0x211a06);}})[_0x8820('0x34')](function(_0x281336){if(_0x281336){_0x968ee4=_0x281336['length'];if(!_0x55d229[_0x8820('0x3e')][_0x8820('0x58')](_0x8820('0x59'))){_0x211a06[_0x8820('0x2e')]=qs[_0x8820('0x2e')](_0x55d229[_0x8820('0x3e')][_0x8820('0x2e')]);_0x211a06['offset']=qs[_0x8820('0x2d')](_0x55d229[_0x8820('0x3e')]['offset']);}return _0x5c7b36[_0x8820('0x54')](_0x211a06);}})[_0x8820('0x34')](function(_0x1b0a7a){if(_0x1b0a7a){return _0x1b0a7a?{'count':_0x968ee4,'rows':_0x1b0a7a}:null;}})[_0x8820('0x34')](respondWithResult(_0x4122cb,null))[_0x8820('0x28')](handleError(_0x4122cb,null));};exports[_0x8820('0x5a')]=function(_0x2d4f44,_0x340ebf,_0x23b4e0){var _0x32574b={};var _0x12a195={};var _0xb191c4;var _0xbbf6eb;return db[_0x8820('0x3a')][_0x8820('0x55')]({'where':{'id':_0x2d4f44[_0x8820('0x4f')]['id']}})[_0x8820('0x34')](handleEntityNotFound(_0x340ebf,null))[_0x8820('0x34')](function(_0x1e942c){if(_0x1e942c){_0xb191c4=_0x1e942c;_0x12a195[_0x8820('0x41')]=_[_0x8820('0x3f')](db[_0x8820('0x5b')][_0x8820('0x3b')]);_0x12a195[_0x8820('0x3e')]=_['keys'](_0x2d4f44[_0x8820('0x3e')]);_0x12a195['filters']=_[_0x8820('0x42')](_0x12a195[_0x8820('0x41')],_0x12a195[_0x8820('0x3e')]);_0x32574b[_0x8820('0x44')]=_['intersection'](_0x12a195[_0x8820('0x41')],qs[_0x8820('0x43')](_0x2d4f44[_0x8820('0x3e')][_0x8820('0x43')]));_0x32574b['attributes']=_0x32574b[_0x8820('0x44')][_0x8820('0x45')]?_0x32574b[_0x8820('0x44')]:_0x12a195[_0x8820('0x41')];_0x32574b[_0x8820('0x5c')]=qs['sort'](_0x2d4f44['query'][_0x8820('0x46')]);_0x32574b['where']=qs[_0x8820('0x40')](_[_0x8820('0x56')](_0x2d4f44[_0x8820('0x3e')],_0x12a195['filters']));if(_0x2d4f44[_0x8820('0x3e')][_0x8820('0x47')]){_0x32574b[_0x8820('0x48')]=_['merge'](_0x32574b[_0x8820('0x48')],{'$or':_[_0x8820('0x39')](_0x32574b[_0x8820('0x44')],function(_0x75b4fc){var _0x43286b={};_0x43286b[_0x75b4fc]={'$like':'%'+_0x2d4f44['query'][_0x8820('0x47')]+'%'};return _0x43286b;})});}_0x32574b=_[_0x8820('0x4a')]({},_0x32574b,_0x2d4f44[_0x8820('0x57')]);return _0xb191c4['getSubjects'](_0x32574b);}})['then'](function(_0x358fb9){if(_0x358fb9){_0xbbf6eb=_0x358fb9[_0x8820('0x45')];if(!_0x2d4f44['query'][_0x8820('0x58')]('nolimit')){_0x32574b[_0x8820('0x2e')]=qs['limit'](_0x2d4f44[_0x8820('0x3e')][_0x8820('0x2e')]);_0x32574b[_0x8820('0x2d')]=qs['offset'](_0x2d4f44[_0x8820('0x3e')][_0x8820('0x2d')]);}return _0xb191c4[_0x8820('0x5a')](_0x32574b);}})['then'](function(_0x18d378){if(_0x18d378){return _0x18d378?{'count':_0xbbf6eb,'rows':_0x18d378}:null;}})['then'](respondWithResult(_0x340ebf,null))[_0x8820('0x28')](handleError(_0x340ebf,null));};exports['getDescriptions']=function(_0x556b2c,_0x2512b1,_0x1f8b72){var _0x57c005={};var _0x1e4914={};var _0x4e65e1;var _0x590438;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x556b2c[_0x8820('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2512b1,null))['then'](function(_0x555304){if(_0x555304){_0x4e65e1=_0x555304;_0x1e4914[_0x8820('0x41')]=_['keys'](db[_0x8820('0x5b')][_0x8820('0x3b')]);_0x1e4914[_0x8820('0x3e')]=_[_0x8820('0x3f')](_0x556b2c[_0x8820('0x3e')]);_0x1e4914[_0x8820('0x40')]=_['intersection'](_0x1e4914[_0x8820('0x41')],_0x1e4914[_0x8820('0x3e')]);_0x57c005[_0x8820('0x44')]=_[_0x8820('0x42')](_0x1e4914[_0x8820('0x41')],qs['fields'](_0x556b2c[_0x8820('0x3e')][_0x8820('0x43')]));_0x57c005[_0x8820('0x44')]=_0x57c005[_0x8820('0x44')]['length']?_0x57c005[_0x8820('0x44')]:_0x1e4914['model'];_0x57c005[_0x8820('0x5c')]=qs['sort'](_0x556b2c[_0x8820('0x3e')]['sort']);_0x57c005[_0x8820('0x48')]=qs[_0x8820('0x40')](_[_0x8820('0x56')](_0x556b2c[_0x8820('0x3e')],_0x1e4914['filters']));if(_0x556b2c[_0x8820('0x3e')][_0x8820('0x47')]){_0x57c005[_0x8820('0x48')]=_[_0x8820('0x4a')](_0x57c005[_0x8820('0x48')],{'$or':_[_0x8820('0x39')](_0x57c005[_0x8820('0x44')],function(_0x1bf417){var _0x20f9af={};_0x20f9af[_0x1bf417]={'$like':'%'+_0x556b2c[_0x8820('0x3e')][_0x8820('0x47')]+'%'};return _0x20f9af;})});}_0x57c005=_[_0x8820('0x4a')]({},_0x57c005,_0x556b2c[_0x8820('0x57')]);return _0x4e65e1[_0x8820('0x5d')](_0x57c005);}})['then'](function(_0x583be8){if(_0x583be8){_0x590438=_0x583be8[_0x8820('0x45')];if(!_0x556b2c[_0x8820('0x3e')]['hasOwnProperty'](_0x8820('0x59'))){_0x57c005[_0x8820('0x2e')]=qs[_0x8820('0x2e')](_0x556b2c[_0x8820('0x3e')][_0x8820('0x2e')]);_0x57c005[_0x8820('0x2d')]=qs[_0x8820('0x2d')](_0x556b2c[_0x8820('0x3e')][_0x8820('0x2d')]);}return _0x4e65e1[_0x8820('0x5d')](_0x57c005);}})[_0x8820('0x34')](function(_0x4286a0){if(_0x4286a0){return _0x4286a0?{'count':_0x590438,'rows':_0x4286a0}:null;}})[_0x8820('0x34')](respondWithResult(_0x2512b1,null))['catch'](handleError(_0x2512b1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index bd57c11..956db12 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 _0xf881=['exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x5b7325,_0x30d721){var _0x54dd2c=function(_0x345ff9){while(--_0x345ff9){_0x5b7325['push'](_0x5b7325['shift']());}};_0x54dd2c(++_0x30d721);}(_0xf881,0x1b6));var _0x1f88=function(_0x47ce68,_0x5551d7){_0x47ce68=_0x47ce68-0x0;var _0x306d06=_0xf881[_0x47ce68];return _0x306d06;};'use strict';var _=require(_0x1f88('0x0'));var util=require(_0x1f88('0x1'));var logger=require('../../config/logger')(_0x1f88('0x2'));var moment=require(_0x1f88('0x3'));var BPromise=require(_0x1f88('0x4'));var rp=require(_0x1f88('0x5'));var fs=require('fs');var path=require(_0x1f88('0x6'));var rimraf=require(_0x1f88('0x7'));var config=require(_0x1f88('0x8'));var attributes=require(_0x1f88('0x9'));module[_0x1f88('0xa')]=function(_0x1aa922,_0x4280d6){return _0x1aa922[_0x1f88('0xb')](_0x1f88('0xc'),attributes,{'tableName':_0x1f88('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93d4=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x93d4,0xc7));var _0x493d=function(_0x15b2aa,_0x25e116){_0x15b2aa=_0x15b2aa-0x0;var _0x57b7ae=_0x93d4[_0x15b2aa];return _0x57b7ae;};'use strict';var _=require(_0x493d('0x0'));var util=require(_0x493d('0x1'));var logger=require(_0x493d('0x2'))(_0x493d('0x3'));var moment=require(_0x493d('0x4'));var BPromise=require(_0x493d('0x5'));var rp=require(_0x493d('0x6'));var fs=require('fs');var path=require(_0x493d('0x7'));var rimraf=require(_0x493d('0x8'));var config=require(_0x493d('0x9'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x493d('0xa')]=function(_0x53968b,_0x1f319d){return _0x53968b[_0x493d('0xb')](_0x493d('0xc'),attributes,{'tableName':_0x493d('0xd'),'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 e411d3f..0269b7a 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 _0x852e=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x852e,0x112));var _0xe852=function(_0x194d5d,_0x3c45f2){_0x194d5d=_0x194d5d-0x0;var _0x41d51e=_0x852e[_0x194d5d];return _0x41d51e;};'use strict';var _=require(_0xe852('0x0'));var util=require(_0xe852('0x1'));var moment=require(_0xe852('0x2'));var BPromise=require(_0xe852('0x3'));var rs=require(_0xe852('0x4'));var fs=require('fs');var Redis=require(_0xe852('0x5'));var db=require(_0xe852('0x6'))['db'];var utils=require(_0xe852('0x7'));var logger=require('../../config/logger')(_0xe852('0x8'));var config=require(_0xe852('0x9'));var jayson=require(_0xe852('0xa'));var client=jayson['client'][_0xe852('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52926d,_0x3a955b,_0x235b8a){return new BPromise(function(_0x240e08,_0x2720a7){return client['request'](_0x52926d,_0x235b8a)[_0xe852('0xc')](function(_0x14d0a1){logger[_0xe852('0xd')](_0xe852('0xe'),_0x3a955b,_0xe852('0xf'));logger[_0xe852('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3a955b,'request\x20sent',JSON[_0xe852('0x11')](_0x14d0a1));if(_0x14d0a1[_0xe852('0x12')]){if(_0x14d0a1['error']['code']===0x1f4){logger[_0xe852('0x12')](_0xe852('0xe'),_0x3a955b,_0x14d0a1[_0xe852('0x12')][_0xe852('0x13')]);return _0x2720a7(_0x14d0a1['error'][_0xe852('0x13')]);}logger[_0xe852('0x12')](_0xe852('0xe'),_0x3a955b,_0x14d0a1[_0xe852('0x12')]['message']);return _0x240e08(_0x14d0a1[_0xe852('0x12')][_0xe852('0x13')]);}else{logger[_0xe852('0xd')](_0xe852('0xe'),_0x3a955b,_0xe852('0xf'));_0x240e08(_0x14d0a1['result'][_0xe852('0x13')]);}})['catch'](function(_0x558f0e){logger[_0xe852('0x12')](_0xe852('0xe'),_0x3a955b,_0x558f0e);_0x2720a7(_0x558f0e);});});} \ No newline at end of file +var _0x4930=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x4c4728,_0x2ef7d5){var _0xe97cff=function(_0x264d3d){while(--_0x264d3d){_0x4c4728['push'](_0x4c4728['shift']());}};_0xe97cff(++_0x2ef7d5);}(_0x4930,0x76));var _0x0493=function(_0x5a9a5,_0x401990){_0x5a9a5=_0x5a9a5-0x0;var _0x56cbf8=_0x4930[_0x5a9a5];return _0x56cbf8;};'use strict';var _=require('lodash');var util=require(_0x0493('0x0'));var moment=require(_0x0493('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0493('0x2'));var db=require(_0x0493('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0493('0x4'))(_0x0493('0x5'));var config=require(_0x0493('0x6'));var jayson=require(_0x0493('0x7'));var client=jayson[_0x0493('0x8')][_0x0493('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcd3f48,_0x58950b,_0x4e07c4){return new BPromise(function(_0x423e74,_0x5a1bb9){return client[_0x0493('0xa')](_0xcd3f48,_0x4e07c4)[_0x0493('0xb')](function(_0x3329bc){logger[_0x0493('0xc')](_0x0493('0xd'),_0x58950b,_0x0493('0xe'));logger[_0x0493('0xf')](_0x0493('0x10'),_0x58950b,_0x0493('0xe'),JSON[_0x0493('0x11')](_0x3329bc));if(_0x3329bc[_0x0493('0x12')]){if(_0x3329bc[_0x0493('0x12')]['code']===0x1f4){logger[_0x0493('0x12')](_0x0493('0xd'),_0x58950b,_0x3329bc[_0x0493('0x12')][_0x0493('0x13')]);return _0x5a1bb9(_0x3329bc[_0x0493('0x12')][_0x0493('0x13')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x58950b,_0x3329bc[_0x0493('0x12')][_0x0493('0x13')]);return _0x423e74(_0x3329bc['error'][_0x0493('0x13')]);}else{logger[_0x0493('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x58950b,'request\x20sent');_0x423e74(_0x3329bc[_0x0493('0x14')][_0x0493('0x13')]);}})[_0x0493('0x15')](function(_0x24e040){logger['error'](_0x0493('0xd'),_0x58950b,_0x24e040);_0x5a1bb9(_0x24e040);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 55e544e..540afed 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 _0xd101=['../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x381379,_0x3f3b86){var _0x3e1063=function(_0x4c282d){while(--_0x4c282d){_0x381379['push'](_0x381379['shift']());}};_0x3e1063(++_0x3f3b86);}(_0xd101,0xc1));var _0x1d10=function(_0x57cfb9,_0x244eed){_0x57cfb9=_0x57cfb9-0x0;var _0x1d2721=_0xd101[_0x57cfb9];return _0x1d2721;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var auth=require(_0x1d10('0x5'));var interaction=require(_0x1d10('0x6'));var config=require(_0x1d10('0x7'));var controller=require(_0x1d10('0x8'));router['get']('/',auth[_0x1d10('0x9')](),controller[_0x1d10('0xa')]);router[_0x1d10('0xb')](_0x1d10('0xc'),auth[_0x1d10('0x9')](),controller[_0x1d10('0xd')]);router[_0x1d10('0xe')]('/',auth[_0x1d10('0x9')](),controller[_0x1d10('0xf')]);router[_0x1d10('0x10')](_0x1d10('0xc'),auth[_0x1d10('0x9')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x12')](_0x1d10('0xc'),auth[_0x1d10('0x9')](),controller[_0x1d10('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2bd8=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0x2bd8,0x130));var _0x82bd=function(_0x5341fb,_0x392bba){_0x5341fb=_0x5341fb-0x0;var _0x9ca4f=_0x2bd8[_0x5341fb];return _0x9ca4f;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var auth=require(_0x82bd('0x5'));var interaction=require(_0x82bd('0x6'));var config=require(_0x82bd('0x7'));var controller=require('./intSalesforceField.controller');router[_0x82bd('0x8')]('/',auth[_0x82bd('0x9')](),controller[_0x82bd('0xa')]);router['get'](_0x82bd('0xb'),auth[_0x82bd('0x9')](),controller[_0x82bd('0xc')]);router[_0x82bd('0xd')]('/',auth['isAuthenticated'](),controller[_0x82bd('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x82bd('0xf')]);router['delete']('/:id',auth[_0x82bd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index fa86f42..30de532 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 _0x5828=['keyValue','string','STRING','sequelize','exports','ENUM','variable'];(function(_0x53747c,_0x340c95){var _0x2024f2=function(_0x2c9893){while(--_0x2c9893){_0x53747c['push'](_0x53747c['shift']());}};_0x2024f2(++_0x340c95);}(_0x5828,0x81));var _0x8582=function(_0x40c0f4,_0x399c17){_0x40c0f4=_0x40c0f4-0x0;var _0x12093f=_0x5828[_0x40c0f4];return _0x12093f;};'use strict';var Sequelize=require(_0x8582('0x0'));module[_0x8582('0x1')]={'type':{'type':Sequelize[_0x8582('0x2')]('string',_0x8582('0x3'),'customVariable',_0x8582('0x4')),'defaultValue':_0x8582('0x5')},'content':{'type':Sequelize[_0x8582('0x6')]},'key':{'type':Sequelize[_0x8582('0x6')]},'keyType':{'type':Sequelize[_0x8582('0x2')](_0x8582('0x5'),_0x8582('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x8582('0x6')]},'idField':{'type':Sequelize[_0x8582('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x39ec=['customVariable','keyValue','STRING','variable','sequelize','ENUM','string'];(function(_0x111bab,_0x271498){var _0x5999fa=function(_0x9512f4){while(--_0x9512f4){_0x111bab['push'](_0x111bab['shift']());}};_0x5999fa(++_0x271498);}(_0x39ec,0x90));var _0xc39e=function(_0x2f0b3c,_0x5c8514){_0x2f0b3c=_0x2f0b3c-0x0;var _0x24e3f7=_0x39ec[_0x2f0b3c];return _0x24e3f7;};'use strict';var Sequelize=require(_0xc39e('0x0'));module['exports']={'type':{'type':Sequelize[_0xc39e('0x1')](_0xc39e('0x2'),'variable',_0xc39e('0x3'),_0xc39e('0x4')),'defaultValue':_0xc39e('0x2')},'content':{'type':Sequelize[_0xc39e('0x5')]},'key':{'type':Sequelize[_0xc39e('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xc39e('0x2'),_0xc39e('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xc39e('0x5')]},'idField':{'type':Sequelize[_0xc39e('0x5')]},'variableName':{'type':Sequelize[_0xc39e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index df8a653..908cb49 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['then','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','limit','set','apply','reject','save','update','destroy'];(function(_0x177c8d,_0x15a8af){var _0x2a771b=function(_0x3b2763){while(--_0x3b2763){_0x177c8d['push'](_0x177c8d['shift']());}};_0x2a771b(++_0x15a8af);}(_0x2ef3,0xba));var _0x32ef=function(_0x56c758,_0x40d0bc){_0x56c758=_0x56c758-0x0;var _0x573bd8=_0x2ef3[_0x56c758];return _0x573bd8;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];function respondWithStatusCode(_0x5afcc2,_0x1a5106){_0x1a5106=_0x1a5106||0xcc;return function(_0x49d590){if(_0x49d590){return _0x5afcc2[_0x32ef('0x19')](_0x1a5106);}return _0x5afcc2[_0x32ef('0x1a')](_0x1a5106)['end']();};}function respondWithResult(_0x539d18,_0x19ce1){_0x19ce1=_0x19ce1||0xc8;return function(_0x4d8009){if(_0x4d8009){return _0x539d18[_0x32ef('0x1a')](_0x19ce1)[_0x32ef('0x1b')](_0x4d8009);}};}function respondWithFilteredResult(_0x93d492,_0x54c7f5){return function(_0x57aff1){if(_0x57aff1){var _0x55bf0b=_0x57aff1[_0x32ef('0x1c')],_0x531e30=_0x54c7f5['offset'],_0x13db1a=_0x54c7f5['offset']+_0x54c7f5[_0x32ef('0x1d')],_0x3950e6;if(_0x13db1a>=_0x55bf0b){_0x13db1a=_0x55bf0b;_0x3950e6=0xc8;}else{_0x3950e6=0xce;}_0x93d492[_0x32ef('0x1a')](_0x3950e6);return _0x93d492[_0x32ef('0x1e')]('Content-Range',_0x531e30+'-'+_0x13db1a+'/'+_0x55bf0b)[_0x32ef('0x1b')](_0x57aff1);}return null;};}function patchUpdates(_0x33e230){return function(_0x4f4c98){try{jsonpatch[_0x32ef('0x1f')](_0x4f4c98,_0x33e230,!![]);}catch(_0x314ef1){return BPromise[_0x32ef('0x20')](_0x314ef1);}return _0x4f4c98[_0x32ef('0x21')]();};}function saveUpdates(_0x445cda,_0x3aec05){return function(_0x4de441){if(_0x4de441){return _0x4de441[_0x32ef('0x22')](_0x445cda)['then'](function(_0x309866){return _0x309866;});}return null;};}function removeEntity(_0x3a20ca,_0x49f2d8){return function(_0x1af371){if(_0x1af371){return _0x1af371[_0x32ef('0x23')]()[_0x32ef('0x24')](function(){_0x3a20ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(!_0x225feb){_0x22f2d7['sendStatus'](0x194);}return _0x225feb;};}function handleError(_0x59585f,_0x19ea6){_0x19ea6=_0x19ea6||0x1f4;return function(_0x4d584b){logger['error'](_0x4d584b[_0x32ef('0x25')]);if(_0x4d584b[_0x32ef('0x26')]){delete _0x4d584b[_0x32ef('0x26')];}_0x59585f[_0x32ef('0x1a')](_0x19ea6)[_0x32ef('0x27')](_0x4d584b);};}exports[_0x32ef('0x28')]=function(_0x1874ea,_0x38aed5){var _0x338f19={},_0x2f52d7={},_0x1335e2={'count':0x0,'rows':[]};var _0xba4b3f=_['map'](db[_0x32ef('0x29')][_0x32ef('0x2a')],function(_0x5a04cd){return{'name':_0x5a04cd[_0x32ef('0x2b')],'type':_0x5a04cd[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x2f52d7[_0x32ef('0x2e')]=_['map'](_0xba4b3f,_0x32ef('0x26'));_0x2f52d7[_0x32ef('0x2f')]=_[_0x32ef('0x30')](_0x1874ea[_0x32ef('0x2f')]);_0x2f52d7[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2f52d7[_0x32ef('0x2e')],_0x2f52d7['query']);_0x338f19[_0x32ef('0x33')]=_['intersection'](_0x2f52d7[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x1874ea['query'][_0x32ef('0x34')]));_0x338f19[_0x32ef('0x33')]=_0x338f19[_0x32ef('0x33')][_0x32ef('0x35')]?_0x338f19[_0x32ef('0x33')]:_0x2f52d7['model'];if(!_0x1874ea['query'][_0x32ef('0x36')]('nolimit')){_0x338f19[_0x32ef('0x1d')]=qs[_0x32ef('0x1d')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x338f19[_0x32ef('0x37')]=qs[_0x32ef('0x37')](_0x1874ea['query']['offset']);}_0x338f19['order']=qs[_0x32ef('0x38')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x38')]);_0x338f19['where']=qs['filters'](_[_0x32ef('0x39')](_0x1874ea[_0x32ef('0x2f')],_0x2f52d7[_0x32ef('0x31')]));if(_0x1874ea['query']['filter']){_0x338f19[_0x32ef('0x3a')]=_[_0x32ef('0x3b')](_0x338f19[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x3c')](_0xba4b3f,function(_0x3a7c49){if(_0x3a7c49[_0x32ef('0x2c')]!==_0x32ef('0x3d')){var _0x21da90={};_0x21da90[_0x3a7c49[_0x32ef('0x26')]]={'$like':'%'+_0x1874ea['query'][_0x32ef('0x3e')]+'%'};return _0x21da90;}})});}_0x338f19=_[_0x32ef('0x3b')]({},_0x338f19,_0x1874ea[_0x32ef('0x3f')]);var _0x4b97dc={'where':_0x338f19[_0x32ef('0x3a')]};return db[_0x32ef('0x29')][_0x32ef('0x1c')](_0x4b97dc)[_0x32ef('0x24')](function(_0x1faf72){_0x1335e2[_0x32ef('0x1c')]=_0x1faf72;if(_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x40')]){_0x338f19[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x29')][_0x32ef('0x42')](_0x338f19);})[_0x32ef('0x24')](function(_0x48e071){_0x1335e2[_0x32ef('0x43')]=_0x48e071;return _0x1335e2;})[_0x32ef('0x24')](respondWithFilteredResult(_0x38aed5,_0x338f19))[_0x32ef('0x44')](handleError(_0x38aed5,null));};exports[_0x32ef('0x45')]=function(_0x2f92f5,_0x2ca66b){var _0x3c0e44={'raw':!![],'where':{'id':_0x2f92f5['params']['id']}},_0x596d5a={};_0x596d5a[_0x32ef('0x2e')]=_[_0x32ef('0x30')](db[_0x32ef('0x29')][_0x32ef('0x2a')]);_0x596d5a['query']=_[_0x32ef('0x30')](_0x2f92f5[_0x32ef('0x2f')]);_0x596d5a['filters']=_[_0x32ef('0x32')](_0x596d5a['model'],_0x596d5a[_0x32ef('0x2f')]);_0x3c0e44[_0x32ef('0x33')]=_[_0x32ef('0x32')](_0x596d5a[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x2f92f5[_0x32ef('0x2f')][_0x32ef('0x34')]));_0x3c0e44[_0x32ef('0x33')]=_0x3c0e44[_0x32ef('0x33')][_0x32ef('0x35')]?_0x3c0e44['attributes']:_0x596d5a[_0x32ef('0x2e')];if(_0x2f92f5['query'][_0x32ef('0x40')]){_0x3c0e44[_0x32ef('0x41')]=[{'all':!![]}];}_0x3c0e44=_[_0x32ef('0x3b')]({},_0x3c0e44,_0x2f92f5['options']);return db[_0x32ef('0x29')][_0x32ef('0x46')](_0x3c0e44)[_0x32ef('0x24')](handleEntityNotFound(_0x2ca66b,null))[_0x32ef('0x24')](respondWithResult(_0x2ca66b,null))[_0x32ef('0x44')](handleError(_0x2ca66b,null));};exports[_0x32ef('0x47')]=function(_0x12c9e6,_0x47dbe1){return db['SalesforceField'][_0x32ef('0x47')](_0x12c9e6[_0x32ef('0x48')],{})[_0x32ef('0x24')](respondWithResult(_0x47dbe1,0xc9))[_0x32ef('0x44')](handleError(_0x47dbe1,null));};exports[_0x32ef('0x22')]=function(_0xd67dc9,_0x44ad11){if(_0xd67dc9[_0x32ef('0x48')]['id']){delete _0xd67dc9[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0xd67dc9[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x44ad11,null))['then'](saveUpdates(_0xd67dc9[_0x32ef('0x48')],null))[_0x32ef('0x24')](respondWithResult(_0x44ad11,null))[_0x32ef('0x44')](handleError(_0x44ad11,null));};exports[_0x32ef('0x23')]=function(_0x1cc9f3,_0x4353f0){return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0x1cc9f3[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x4353f0,null))[_0x32ef('0x24')](removeEntity(_0x4353f0,null))[_0x32ef('0x44')](handleError(_0x4353f0,null));}; \ No newline at end of file +var _0xadb5=['name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','VIRTUAL','merge','options','SalesforceField','findAll','rows','catch','show','rawAttributes','fields','includeAll','include','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','then','destroy','stack'];(function(_0x350ad1,_0x33bf62){var _0x701ea9=function(_0x3a8e38){while(--_0x3a8e38){_0x350ad1['push'](_0x350ad1['shift']());}};_0x701ea9(++_0x33bf62);}(_0xadb5,0xad));var _0x5adb=function(_0x21811b,_0x1a2eee){_0x21811b=_0x21811b-0x0;var _0x8ad03a=_0xadb5[_0x21811b];return _0x8ad03a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var db=require(_0x5adb('0x17'))['db'];function respondWithStatusCode(_0x56012f,_0x2a0b70){_0x2a0b70=_0x2a0b70||0xcc;return function(_0x5433bf){if(_0x5433bf){return _0x56012f[_0x5adb('0x18')](_0x2a0b70);}return _0x56012f[_0x5adb('0x19')](_0x2a0b70)[_0x5adb('0x1a')]();};}function respondWithResult(_0x5c929a,_0x2a545b){_0x2a545b=_0x2a545b||0xc8;return function(_0x34af2c){if(_0x34af2c){return _0x5c929a[_0x5adb('0x19')](_0x2a545b)['json'](_0x34af2c);}};}function respondWithFilteredResult(_0x2312de,_0x518823){return function(_0x367d82){if(_0x367d82){var _0x42a482=_0x367d82[_0x5adb('0x1b')],_0x30614e=_0x518823[_0x5adb('0x1c')],_0x304784=_0x518823[_0x5adb('0x1c')]+_0x518823[_0x5adb('0x1d')],_0x1c0f97;if(_0x304784>=_0x42a482){_0x304784=_0x42a482;_0x1c0f97=0xc8;}else{_0x1c0f97=0xce;}_0x2312de['status'](_0x1c0f97);return _0x2312de[_0x5adb('0x1e')]('Content-Range',_0x30614e+'-'+_0x304784+'/'+_0x42a482)[_0x5adb('0x1f')](_0x367d82);}return null;};}function patchUpdates(_0x558f76){return function(_0x3ef465){try{jsonpatch['apply'](_0x3ef465,_0x558f76,!![]);}catch(_0x5e218c){return BPromise[_0x5adb('0x20')](_0x5e218c);}return _0x3ef465[_0x5adb('0x21')]();};}function saveUpdates(_0x438671,_0x1fd4a7){return function(_0x99bc6c){if(_0x99bc6c){return _0x99bc6c['update'](_0x438671)[_0x5adb('0x22')](function(_0x5c296e){return _0x5c296e;});}return null;};}function removeEntity(_0x4e9f16,_0x3754cc){return function(_0x379b33){if(_0x379b33){return _0x379b33[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0x4e9f16[_0x5adb('0x19')](0xcc)[_0x5adb('0x1a')]();});}};}function handleEntityNotFound(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(!_0x4b1957){_0xfd9bb9[_0x5adb('0x18')](0x194);}return _0x4b1957;};}function handleError(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0x1f4;return function(_0xeb556c){logger['error'](_0xeb556c[_0x5adb('0x24')]);if(_0xeb556c[_0x5adb('0x25')]){delete _0xeb556c['name'];}_0x3220cd[_0x5adb('0x19')](_0x3839fb)[_0x5adb('0x26')](_0xeb556c);};}exports[_0x5adb('0x27')]=function(_0x55b40a,_0x13ad1d){var _0xbe21b1={},_0x3a4fca={},_0x2c64a3={'count':0x0,'rows':[]};var _0x36459b=_[_0x5adb('0x28')](db['SalesforceField']['rawAttributes'],function(_0x5d457e){return{'name':_0x5d457e[_0x5adb('0x29')],'type':_0x5d457e[_0x5adb('0x2a')][_0x5adb('0x2b')]};});_0x3a4fca[_0x5adb('0x2c')]=_[_0x5adb('0x28')](_0x36459b,'name');_0x3a4fca[_0x5adb('0x2d')]=_[_0x5adb('0x2e')](_0x55b40a[_0x5adb('0x2d')]);_0x3a4fca[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x3a4fca[_0x5adb('0x2c')],_0x3a4fca[_0x5adb('0x2d')]);_0xbe21b1[_0x5adb('0x31')]=_[_0x5adb('0x30')](_0x3a4fca[_0x5adb('0x2c')],qs['fields'](_0x55b40a[_0x5adb('0x2d')]['fields']));_0xbe21b1[_0x5adb('0x31')]=_0xbe21b1[_0x5adb('0x31')]['length']?_0xbe21b1[_0x5adb('0x31')]:_0x3a4fca[_0x5adb('0x2c')];if(!_0x55b40a[_0x5adb('0x2d')]['hasOwnProperty'](_0x5adb('0x32'))){_0xbe21b1[_0x5adb('0x1d')]=qs['limit'](_0x55b40a['query'][_0x5adb('0x1d')]);_0xbe21b1['offset']=qs[_0x5adb('0x1c')](_0x55b40a[_0x5adb('0x2d')][_0x5adb('0x1c')]);}_0xbe21b1[_0x5adb('0x33')]=qs[_0x5adb('0x34')](_0x55b40a['query'][_0x5adb('0x34')]);_0xbe21b1[_0x5adb('0x35')]=qs[_0x5adb('0x2f')](_['pick'](_0x55b40a['query'],_0x3a4fca[_0x5adb('0x2f')]));if(_0x55b40a[_0x5adb('0x2d')]['filter']){_0xbe21b1[_0x5adb('0x35')]=_['merge'](_0xbe21b1[_0x5adb('0x35')],{'$or':_['map'](_0x36459b,function(_0x11cb37){if(_0x11cb37['type']!==_0x5adb('0x36')){var _0x23a1db={};_0x23a1db[_0x11cb37['name']]={'$like':'%'+_0x55b40a[_0x5adb('0x2d')]['filter']+'%'};return _0x23a1db;}})});}_0xbe21b1=_[_0x5adb('0x37')]({},_0xbe21b1,_0x55b40a[_0x5adb('0x38')]);var _0xd5660c={'where':_0xbe21b1['where']};return db[_0x5adb('0x39')][_0x5adb('0x1b')](_0xd5660c)[_0x5adb('0x22')](function(_0x132803){_0x2c64a3[_0x5adb('0x1b')]=_0x132803;if(_0x55b40a['query']['includeAll']){_0xbe21b1['include']=[{'all':!![]}];}return db['SalesforceField'][_0x5adb('0x3a')](_0xbe21b1);})[_0x5adb('0x22')](function(_0x3a104a){_0x2c64a3[_0x5adb('0x3b')]=_0x3a104a;return _0x2c64a3;})[_0x5adb('0x22')](respondWithFilteredResult(_0x13ad1d,_0xbe21b1))[_0x5adb('0x3c')](handleError(_0x13ad1d,null));};exports[_0x5adb('0x3d')]=function(_0x3bf282,_0x478a70){var _0x53f2c6={'raw':!![],'where':{'id':_0x3bf282['params']['id']}},_0x27dbb7={};_0x27dbb7[_0x5adb('0x2c')]=_[_0x5adb('0x2e')](db[_0x5adb('0x39')][_0x5adb('0x3e')]);_0x27dbb7[_0x5adb('0x2d')]=_['keys'](_0x3bf282[_0x5adb('0x2d')]);_0x27dbb7[_0x5adb('0x2f')]=_['intersection'](_0x27dbb7[_0x5adb('0x2c')],_0x27dbb7[_0x5adb('0x2d')]);_0x53f2c6['attributes']=_[_0x5adb('0x30')](_0x27dbb7[_0x5adb('0x2c')],qs[_0x5adb('0x3f')](_0x3bf282[_0x5adb('0x2d')][_0x5adb('0x3f')]));_0x53f2c6[_0x5adb('0x31')]=_0x53f2c6[_0x5adb('0x31')]['length']?_0x53f2c6['attributes']:_0x27dbb7[_0x5adb('0x2c')];if(_0x3bf282[_0x5adb('0x2d')][_0x5adb('0x40')]){_0x53f2c6[_0x5adb('0x41')]=[{'all':!![]}];}_0x53f2c6=_['merge']({},_0x53f2c6,_0x3bf282['options']);return db[_0x5adb('0x39')][_0x5adb('0x42')](_0x53f2c6)[_0x5adb('0x22')](handleEntityNotFound(_0x478a70,null))[_0x5adb('0x22')](respondWithResult(_0x478a70,null))[_0x5adb('0x3c')](handleError(_0x478a70,null));};exports['create']=function(_0x182cbc,_0x437f52){return db['SalesforceField'][_0x5adb('0x43')](_0x182cbc[_0x5adb('0x44')],{})[_0x5adb('0x22')](respondWithResult(_0x437f52,0xc9))[_0x5adb('0x3c')](handleError(_0x437f52,null));};exports[_0x5adb('0x45')]=function(_0x3a5409,_0x39840e){if(_0x3a5409[_0x5adb('0x44')]['id']){delete _0x3a5409['body']['id'];}return db[_0x5adb('0x39')]['find']({'where':{'id':_0x3a5409['params']['id']}})['then'](handleEntityNotFound(_0x39840e,null))[_0x5adb('0x22')](saveUpdates(_0x3a5409[_0x5adb('0x44')],null))[_0x5adb('0x22')](respondWithResult(_0x39840e,null))['catch'](handleError(_0x39840e,null));};exports[_0x5adb('0x23')]=function(_0x5cbab5,_0x177a81){return db[_0x5adb('0x39')][_0x5adb('0x42')]({'where':{'id':_0x5cbab5['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x177a81,null))['then'](removeEntity(_0x177a81,null))[_0x5adb('0x3c')](handleError(_0x177a81,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 7f2a0c0..394cff1 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 _0x85b4=['FieldId','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','int_salesforce_fields','salesforce_unique_index','idField'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x85b4,0x17a));var _0x485b=function(_0x187f4b,_0x12fd52){_0x187f4b=_0x187f4b-0x0;var _0x132087=_0x85b4[_0x187f4b];return _0x132087;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x485b('0x0'))('api');var moment=require(_0x485b('0x1'));var BPromise=require(_0x485b('0x2'));var rp=require(_0x485b('0x3'));var fs=require('fs');var path=require(_0x485b('0x4'));var rimraf=require(_0x485b('0x5'));var config=require(_0x485b('0x6'));var attributes=require(_0x485b('0x7'));module['exports']=function(_0x1ead41,_0x214345){return _0x1ead41[_0x485b('0x8')]('SalesforceField',attributes,{'tableName':_0x485b('0x9'),'paranoid':![],'indexes':[{'name':_0x485b('0xa'),'fields':[_0x485b('0xb'),_0x485b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2b8=['bluebird','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','FieldId','lodash','../../config/logger','api','moment'];(function(_0x1a3e05,_0x573027){var _0x2c2677=function(_0x186ec0){while(--_0x186ec0){_0x1a3e05['push'](_0x1a3e05['shift']());}};_0x2c2677(++_0x573027);}(_0xd2b8,0x7e));var _0x8d2b=function(_0x4551bf,_0x5dabc1){_0x4551bf=_0x4551bf-0x0;var _0x3490c0=_0xd2b8[_0x4551bf];return _0x3490c0;};'use strict';var _=require(_0x8d2b('0x0'));var util=require('util');var logger=require(_0x8d2b('0x1'))(_0x8d2b('0x2'));var moment=require(_0x8d2b('0x3'));var BPromise=require(_0x8d2b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d2b('0x5'));var rimraf=require('rimraf');var config=require(_0x8d2b('0x6'));var attributes=require(_0x8d2b('0x7'));module[_0x8d2b('0x8')]=function(_0x51a933,_0xeadb46){return _0x51a933[_0x8d2b('0x9')](_0x8d2b('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x8d2b('0xb'),'fields':['idField',_0x8d2b('0xc')],'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 fb55362..d9ec53c 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x26c12e,_0x55ef42){var _0xbab0c7=function(_0x35eecb){while(--_0x35eecb){_0x26c12e['push'](_0x26c12e['shift']());}};_0xbab0c7(++_0x55ef42);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0x153f=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x1ba138,_0x58dfb3){var _0x132e1b=function(_0x6387be){while(--_0x6387be){_0x1ba138['push'](_0x1ba138['shift']());}};_0x132e1b(++_0x58dfb3);}(_0x153f,0x15b));var _0xf153=function(_0x54d372,_0x4818ab){_0x54d372=_0x54d372-0x0;var _0x282886=_0x153f[_0x54d372];return _0x282886;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 7415382..fd74f91 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 _0x036b=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put'];(function(_0x1e0a28,_0x28db95){var _0x29b819=function(_0x213442){while(--_0x213442){_0x1e0a28['push'](_0x1e0a28['shift']());}};_0x29b819(++_0x28db95);}(_0x036b,0x145));var _0xb036=function(_0x75cfd6,_0x44b213){_0x75cfd6=_0x75cfd6-0x0;var _0x4692e6=_0x036b[_0x75cfd6];return _0x4692e6;};'use strict';var multer=require(_0xb036('0x0'));var util=require(_0xb036('0x1'));var path=require(_0xb036('0x2'));var timeout=require('connect-timeout');var express=require(_0xb036('0x3'));var router=express[_0xb036('0x4')]();var auth=require(_0xb036('0x5'));var interaction=require(_0xb036('0x6'));var config=require(_0xb036('0x7'));var controller=require('./intServicenowAccount.controller');router[_0xb036('0x8')]('/',auth[_0xb036('0x9')](),controller[_0xb036('0xa')]);router[_0xb036('0x8')](_0xb036('0xb'),auth[_0xb036('0x9')](),controller['show']);router[_0xb036('0x8')]('/:id/configurations',auth[_0xb036('0x9')](),controller[_0xb036('0xc')]);router[_0xb036('0x8')](_0xb036('0xd'),auth[_0xb036('0x9')](),controller[_0xb036('0xe')]);router[_0xb036('0xf')]('/',auth[_0xb036('0x9')](),controller[_0xb036('0x10')]);router[_0xb036('0xf')](_0xb036('0x11'),auth[_0xb036('0x9')](),controller[_0xb036('0x12')]);router[_0xb036('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb036('0x14')](_0xb036('0xb'),auth['isAuthenticated'](),controller[_0xb036('0x15')]);module[_0xb036('0x16')]=router; \ No newline at end of file +var _0x4c9e=['delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations'];(function(_0x8303ae,_0x3d3add){var _0x2f054e=function(_0x406e3d){while(--_0x406e3d){_0x8303ae['push'](_0x8303ae['shift']());}};_0x2f054e(++_0x3d3add);}(_0x4c9e,0x145));var _0xe4c9=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x4c9e[_0x173d7e];return _0x2220d6;};'use strict';var multer=require('multer');var util=require(_0xe4c9('0x0'));var path=require(_0xe4c9('0x1'));var timeout=require(_0xe4c9('0x2'));var express=require(_0xe4c9('0x3'));var router=express[_0xe4c9('0x4')]();var auth=require(_0xe4c9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe4c9('0x6'));var controller=require('./intServicenowAccount.controller');router[_0xe4c9('0x7')]('/',auth['isAuthenticated'](),controller[_0xe4c9('0x8')]);router['get'](_0xe4c9('0x9'),auth[_0xe4c9('0xa')](),controller['show']);router[_0xe4c9('0x7')]('/:id/configurations',auth[_0xe4c9('0xa')](),controller[_0xe4c9('0xb')]);router['get'](_0xe4c9('0xc'),auth[_0xe4c9('0xa')](),controller[_0xe4c9('0xd')]);router[_0xe4c9('0xe')]('/',auth[_0xe4c9('0xa')](),controller[_0xe4c9('0xf')]);router[_0xe4c9('0xe')](_0xe4c9('0x10'),auth[_0xe4c9('0xa')](),controller['addConfiguration']);router['put'](_0xe4c9('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xe4c9('0x11')](_0xe4c9('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xe4c9('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ae1501f..00f93ec 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 _0xc0f4=['STRING','username','remoteUri','sequelize'];(function(_0x483fed,_0x1f5eb5){var _0x3cf866=function(_0x54f9fc){while(--_0x54f9fc){_0x483fed['push'](_0x483fed['shift']());}};_0x3cf866(++_0x1f5eb5);}(_0xc0f4,0xaf));var _0x4c0f=function(_0x459cc7,_0x5186f2){_0x459cc7=_0x459cc7-0x0;var _0x338d3e=_0xc0f4[_0x459cc7];return _0x338d3e;};'use strict';var Sequelize=require(_0x4c0f('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c0f('0x1')]},'description':{'type':Sequelize[_0x4c0f('0x1')]},'username':{'type':Sequelize[_0x4c0f('0x1')],'unique':_0x4c0f('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4c0f('0x1')]},'remoteUri':{'type':Sequelize[_0x4c0f('0x1')],'unique':_0x4c0f('0x3')},'serverUrl':{'type':Sequelize[_0x4c0f('0x1')]}}; \ No newline at end of file +var _0x374a=['sequelize','STRING','username','remoteUri'];(function(_0x4b830c,_0x2399de){var _0x274dbc=function(_0x3bc324){while(--_0x3bc324){_0x4b830c['push'](_0x4b830c['shift']());}};_0x274dbc(++_0x2399de);}(_0x374a,0xb0));var _0xa374=function(_0x4eb0f1,_0x39810d){_0x4eb0f1=_0x4eb0f1-0x0;var _0x789564=_0x374a[_0x4eb0f1];return _0x789564;};'use strict';var Sequelize=require(_0xa374('0x0'));module['exports']={'name':{'type':Sequelize[_0xa374('0x1')]},'description':{'type':Sequelize[_0xa374('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xa374('0x2')},'password':{'type':Sequelize[_0xa374('0x1')]},'email':{'type':Sequelize[_0xa374('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa374('0x3')},'serverUrl':{'type':Sequelize[_0xa374('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 77cd2b1..90993aa 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 _0x9735=['offset','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','find','create','body','params','getConfigurations','ServicenowConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','severity','category','parent','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','work_start','additional_assignee_list','description','calendar_duration','notify','close_notes','follow_up','parent_incident','sys_id','reopened_by','incident_state','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','all','TCL:\x20_object','label','concat','statusCode','send','Wrong\x20credentials','boolean','True','true','GET','sys_choice?sysparm_query=name=incident^element=','value','push','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','count','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','index','ServicenowAccount','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x2943e2,_0x106bd4){var _0x32981e=function(_0x1c70a1){while(--_0x1c70a1){_0x2943e2['push'](_0x2943e2['shift']());}};_0x32981e(++_0x106bd4);}(_0x9735,0x7c));var _0x5973=function(_0x2e183a,_0x2fbeef){_0x2e183a=_0x2e183a-0x0;var _0x490d28=_0x9735[_0x2e183a];return _0x490d28;};'use strict';var pdf=require(_0x5973('0x0'));var emlformat=require(_0x5973('0x1'));var rimraf=require(_0x5973('0x2'));var zipdir=require(_0x5973('0x3'));var jsonpatch=require(_0x5973('0x4'));var rp=require(_0x5973('0x5'));var moment=require(_0x5973('0x6'));var BPromise=require(_0x5973('0x7'));var Mustache=require(_0x5973('0x8'));var util=require(_0x5973('0x9'));var path=require(_0x5973('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5973('0xb'));var fs=require('fs');var _=require(_0x5973('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5973('0xd'));var deskjs=require(_0x5973('0xe'));var toCsv=require(_0x5973('0xf'));var querystring=require(_0x5973('0x10'));var Papa=require(_0x5973('0x11'));var Redis=require(_0x5973('0x12'));var authService=require(_0x5973('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5973('0x14'));var logger=require('../../config/logger')(_0x5973('0x15'));var utils=require(_0x5973('0x16'));var config=require('../../config/environment');var db=require(_0x5973('0x17'))['db'];var integrations=require(_0x5973('0x18'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5973('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5a0519,_0x50c3ce,_0x8eb089){if(_0x8eb089){var _0x500d91=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x500d91[_0x5973('0x1a')](_0x50c3ce)){return _0x5a0519;}else{throw new db['Sequelize'][(_0x5973('0x1b'))](_0x5973('0x1c'));}}else{return _0x5a0519;}}function respondWithRpcPromise(_0x16bb0c,_0x183ee7,_0x4a0ac0,_0x2c11cb){return new BPromise(function(_0x39ea9b,_0x12aa64){var _0x4c6cd8=_0x2c11cb||client;return _0x4c6cd8['request'](_0x16bb0c,_0x4a0ac0)['then'](function(_0x2f783d){logger['info'](_0x5973('0x1d'),_0x183ee7,_0x5973('0x1e'));logger['debug'](_0x5973('0x1f'),_0x183ee7,_0x5973('0x1e'),JSON['stringify'](_0x2f783d));if(_0x2f783d[_0x5973('0x20')]){if(_0x2f783d[_0x5973('0x20')][_0x5973('0x21')]===0x1f4){logger[_0x5973('0x20')](_0x5973('0x1d'),_0x183ee7,_0x2f783d['error'][_0x5973('0x22')]);return _0x12aa64(_0x2f783d[_0x5973('0x20')][_0x5973('0x22')]);}logger[_0x5973('0x20')](_0x5973('0x1d'),_0x183ee7,_0x2f783d[_0x5973('0x20')][_0x5973('0x22')]);return _0x39ea9b(_0x2f783d[_0x5973('0x20')][_0x5973('0x22')]);}else{logger[_0x5973('0x23')](_0x5973('0x1d'),_0x183ee7,'request\x20sent');_0x39ea9b(_0x2f783d[_0x5973('0x24')]['message']);}})[_0x5973('0x25')](function(_0x1052fd){logger[_0x5973('0x20')](_0x5973('0x1d'),_0x183ee7,_0x1052fd);_0x12aa64(_0x1052fd);});});}function respondWithStatusCode(_0x2b6504,_0x180b2c){_0x180b2c=_0x180b2c||0xcc;return function(_0xf7eaba){if(_0xf7eaba){return _0x2b6504['sendStatus'](_0x180b2c);}return _0x2b6504[_0x5973('0x26')](_0x180b2c)[_0x5973('0x27')]();};}function respondWithResult(_0x353669,_0x3a5815){_0x3a5815=_0x3a5815||0xc8;return function(_0x17d1ef){if(_0x17d1ef){return _0x353669[_0x5973('0x26')](_0x3a5815)['json'](_0x17d1ef);}};}function respondWithFilteredResult(_0x1ec203,_0x39018c){return function(_0x1be87f){if(_0x1be87f){var _0x5996b6=_0x1be87f[_0x5973('0x28')],_0x501d93=_0x39018c['offset'],_0x2efbbd=_0x39018c['offset']+_0x39018c['limit'],_0x3dc723;if(_0x2efbbd>=_0x5996b6){_0x2efbbd=_0x5996b6;_0x3dc723=0xc8;}else{_0x3dc723=0xce;}_0x1ec203['status'](_0x3dc723);return _0x1ec203['set'](_0x5973('0x29'),_0x501d93+'-'+_0x2efbbd+'/'+_0x5996b6)[_0x5973('0x2a')](_0x1be87f);}return null;};}function patchUpdates(_0x4ffe2b){return function(_0x16175f){try{jsonpatch[_0x5973('0x2b')](_0x16175f,_0x4ffe2b,!![]);}catch(_0x55fbb1){return BPromise['reject'](_0x55fbb1);}return _0x16175f[_0x5973('0x2c')]();};}function saveUpdates(_0x1c63ce,_0x4d8830){return function(_0x2d0f2e){if(_0x2d0f2e){return _0x2d0f2e[_0x5973('0x2d')](_0x1c63ce)[_0x5973('0x2e')](function(_0x266b74){return _0x266b74;});}return null;};}function removeEntity(_0x4bd854,_0x16c6a4){return function(_0x3c32c6){if(_0x3c32c6){return _0x3c32c6[_0x5973('0x2f')]()[_0x5973('0x2e')](function(){_0x4bd854['status'](0xcc)[_0x5973('0x27')]();});}};}function handleEntityNotFound(_0x5f4d76,_0x3bd7b4){return function(_0x3274c8){if(!_0x3274c8){_0x5f4d76[_0x5973('0x30')](0x194);}return _0x3274c8;};}function handleError(_0x15531e,_0x356519){_0x356519=_0x356519||0x1f4;return function(_0x186f9a){logger[_0x5973('0x20')](_0x186f9a[_0x5973('0x31')]);if(_0x186f9a[_0x5973('0x32')]){delete _0x186f9a['name'];}_0x15531e[_0x5973('0x26')](_0x356519)['send'](_0x186f9a);};}exports[_0x5973('0x33')]=function(_0x1b717d,_0x475e97){var _0xd57853={},_0x3fd632={},_0x5a0c59={'count':0x0,'rows':[]};var _0x3833d5=_['map'](db[_0x5973('0x34')][_0x5973('0x35')],function(_0x2fdfd4){return{'name':_0x2fdfd4[_0x5973('0x36')],'type':_0x2fdfd4['type'][_0x5973('0x37')]};});_0x3fd632[_0x5973('0x38')]=_[_0x5973('0x39')](_0x3833d5,_0x5973('0x32'));_0x3fd632['query']=_['keys'](_0x1b717d[_0x5973('0x3a')]);_0x3fd632[_0x5973('0x3b')]=_[_0x5973('0x3c')](_0x3fd632[_0x5973('0x38')],_0x3fd632[_0x5973('0x3a')]);_0xd57853[_0x5973('0x3d')]=_[_0x5973('0x3c')](_0x3fd632[_0x5973('0x38')],qs[_0x5973('0x3e')](_0x1b717d['query']['fields']));_0xd57853[_0x5973('0x3d')]=_0xd57853['attributes'][_0x5973('0x3f')]?_0xd57853[_0x5973('0x3d')]:_0x3fd632[_0x5973('0x38')];if(!_0x1b717d['query'][_0x5973('0x40')](_0x5973('0x41'))){_0xd57853[_0x5973('0x42')]=qs[_0x5973('0x42')](_0x1b717d['query']['limit']);_0xd57853[_0x5973('0x43')]=qs[_0x5973('0x43')](_0x1b717d[_0x5973('0x3a')][_0x5973('0x43')]);}_0xd57853[_0x5973('0x44')]=qs[_0x5973('0x45')](_0x1b717d['query']['sort']);_0xd57853[_0x5973('0x46')]=qs[_0x5973('0x3b')](_[_0x5973('0x47')](_0x1b717d['query'],_0x3fd632[_0x5973('0x3b')]));if(_0x1b717d[_0x5973('0x3a')]['filter']){_0xd57853[_0x5973('0x46')]=_[_0x5973('0x48')](_0xd57853[_0x5973('0x46')],{'$or':_[_0x5973('0x39')](_0x3833d5,function(_0x2538c9){if(_0x2538c9[_0x5973('0x49')]!==_0x5973('0x4a')){var _0x37dd09={};_0x37dd09[_0x2538c9[_0x5973('0x32')]]={'$like':'%'+_0x1b717d['query'][_0x5973('0x4b')]+'%'};return _0x37dd09;}})});}_0xd57853=_[_0x5973('0x48')]({},_0xd57853,_0x1b717d[_0x5973('0x4c')]);var _0x447deb={'where':_0xd57853[_0x5973('0x46')]};return db[_0x5973('0x34')][_0x5973('0x28')](_0x447deb)[_0x5973('0x2e')](function(_0xd53d78){_0x5a0c59[_0x5973('0x28')]=_0xd53d78;if(_0x1b717d[_0x5973('0x3a')][_0x5973('0x4d')]){_0xd57853[_0x5973('0x4e')]=[{'all':!![]}];}return db[_0x5973('0x34')][_0x5973('0x4f')](_0xd57853);})[_0x5973('0x2e')](function(_0x139c51){_0x5a0c59[_0x5973('0x50')]=_0x139c51;return _0x5a0c59;})[_0x5973('0x2e')](respondWithFilteredResult(_0x475e97,_0xd57853))['catch'](handleError(_0x475e97,null));};exports[_0x5973('0x51')]=function(_0x1da1e2,_0x1728f6){var _0x3673c9={'raw':![],'where':{'id':_0x1da1e2['params']['id']}},_0x38e17b={};_0x38e17b[_0x5973('0x38')]=_[_0x5973('0x52')](db['ServicenowAccount'][_0x5973('0x35')]);_0x38e17b['query']=_[_0x5973('0x52')](_0x1da1e2[_0x5973('0x3a')]);_0x38e17b[_0x5973('0x3b')]=_[_0x5973('0x3c')](_0x38e17b[_0x5973('0x38')],_0x38e17b[_0x5973('0x3a')]);_0x3673c9[_0x5973('0x3d')]=_[_0x5973('0x3c')](_0x38e17b[_0x5973('0x38')],qs[_0x5973('0x3e')](_0x1da1e2[_0x5973('0x3a')]['fields']));_0x3673c9[_0x5973('0x3d')]=_0x3673c9[_0x5973('0x3d')]['length']?_0x3673c9[_0x5973('0x3d')]:_0x38e17b[_0x5973('0x38')];if(_0x1da1e2[_0x5973('0x3a')]['includeAll']){_0x3673c9[_0x5973('0x4e')]=[{'all':!![]}];}_0x3673c9=_[_0x5973('0x48')]({},_0x3673c9,_0x1da1e2[_0x5973('0x4c')]);return db['ServicenowAccount'][_0x5973('0x53')](_0x3673c9)['then'](handleEntityNotFound(_0x1728f6,null))[_0x5973('0x2e')](respondWithResult(_0x1728f6,null))[_0x5973('0x25')](handleError(_0x1728f6,null));};exports[_0x5973('0x54')]=function(_0x4e5fad,_0x3a5e33){return db[_0x5973('0x34')]['create'](_0x4e5fad[_0x5973('0x55')],{})[_0x5973('0x2e')](respondWithResult(_0x3a5e33,0xc9))[_0x5973('0x25')](handleError(_0x3a5e33,null));};exports[_0x5973('0x2d')]=function(_0x130210,_0x583fbb){if(_0x130210['body']['id']){delete _0x130210[_0x5973('0x55')]['id'];}return db['ServicenowAccount'][_0x5973('0x53')]({'where':{'id':_0x130210[_0x5973('0x56')]['id']}})[_0x5973('0x2e')](handleEntityNotFound(_0x583fbb,null))['then'](saveUpdates(_0x130210[_0x5973('0x55')],null))[_0x5973('0x2e')](respondWithResult(_0x583fbb,null))[_0x5973('0x25')](handleError(_0x583fbb,null));};exports[_0x5973('0x2f')]=function(_0xa8e225,_0x5b8f31){return db[_0x5973('0x34')]['find']({'where':{'id':_0xa8e225['params']['id']}})[_0x5973('0x2e')](handleEntityNotFound(_0x5b8f31,null))[_0x5973('0x2e')](removeEntity(_0x5b8f31,null))['catch'](handleError(_0x5b8f31,null));};exports[_0x5973('0x57')]=function(_0xba0262,_0xd9c659,_0x26daa7){var _0x1c8cfb={};var _0x1ccc93={};var _0x206acc;var _0x266b98;return db[_0x5973('0x34')]['findOne']({'where':{'id':_0xba0262[_0x5973('0x56')]['id']}})[_0x5973('0x2e')](handleEntityNotFound(_0xd9c659,null))['then'](function(_0x100176){if(_0x100176){_0x206acc=_0x100176;_0x1ccc93[_0x5973('0x38')]=_[_0x5973('0x52')](db[_0x5973('0x58')][_0x5973('0x35')]);_0x1ccc93[_0x5973('0x3a')]=_[_0x5973('0x52')](_0xba0262[_0x5973('0x3a')]);_0x1ccc93[_0x5973('0x3b')]=_['intersection'](_0x1ccc93[_0x5973('0x38')],_0x1ccc93[_0x5973('0x3a')]);_0x1c8cfb[_0x5973('0x3d')]=_[_0x5973('0x3c')](_0x1ccc93[_0x5973('0x38')],qs[_0x5973('0x3e')](_0xba0262['query'][_0x5973('0x3e')]));_0x1c8cfb[_0x5973('0x3d')]=_0x1c8cfb[_0x5973('0x3d')][_0x5973('0x3f')]?_0x1c8cfb[_0x5973('0x3d')]:_0x1ccc93[_0x5973('0x38')];_0x1c8cfb[_0x5973('0x44')]=qs[_0x5973('0x45')](_0xba0262[_0x5973('0x3a')][_0x5973('0x45')]);_0x1c8cfb[_0x5973('0x46')]=qs[_0x5973('0x3b')](_['pick'](_0xba0262[_0x5973('0x3a')],_0x1ccc93['filters']));if(_0xba0262['query'][_0x5973('0x4b')]){_0x1c8cfb[_0x5973('0x46')]=_[_0x5973('0x48')](_0x1c8cfb[_0x5973('0x46')],{'$or':_['map'](_0x1c8cfb[_0x5973('0x3d')],function(_0x34b48b){var _0x32db45={};_0x32db45[_0x34b48b]={'$like':'%'+_0xba0262['query'][_0x5973('0x4b')]+'%'};return _0x32db45;})});}_0x1c8cfb=_[_0x5973('0x48')]({},_0x1c8cfb,_0xba0262[_0x5973('0x4c')]);return _0x206acc[_0x5973('0x57')](_0x1c8cfb);}})['then'](function(_0x345a9f){if(_0x345a9f){_0x266b98=_0x345a9f[_0x5973('0x3f')];if(!_0xba0262['query'][_0x5973('0x40')](_0x5973('0x41'))){_0x1c8cfb[_0x5973('0x42')]=qs[_0x5973('0x42')](_0xba0262[_0x5973('0x3a')][_0x5973('0x42')]);_0x1c8cfb[_0x5973('0x43')]=qs[_0x5973('0x43')](_0xba0262[_0x5973('0x3a')][_0x5973('0x43')]);}return _0x206acc[_0x5973('0x57')](_0x1c8cfb);}})['then'](function(_0x4cdc53){if(_0x4cdc53){return _0x4cdc53?{'count':_0x266b98,'rows':_0x4cdc53}:null;}})['then'](respondWithResult(_0xd9c659,null))[_0x5973('0x25')](handleError(_0xd9c659,null));};exports[_0x5973('0x59')]=function(_0x5d71bd,_0x491826,_0xb1f9b7){if(_0x5d71bd[_0x5973('0x55')]['id']){delete _0x5d71bd['body']['id'];}return db[_0x5973('0x34')][_0x5973('0x5a')]({'where':{'id':_0x5d71bd[_0x5973('0x56')]['id']}})['then'](handleEntityNotFound(_0x491826,null))[_0x5973('0x2e')](function(_0x138fbb){if(_0x138fbb){_0x5d71bd[_0x5973('0x55')][_0x5973('0x5b')]=_0x138fbb['id'];_0x5d71bd[_0x5973('0x55')][_0x5973('0x5c')]=integrations[_0x5973('0x5d')](_0x5d71bd[_0x5973('0x55')][_0x5973('0x5e')],_0x5d71bd[_0x5973('0x55')]['type']);_0x5d71bd[_0x5973('0x55')][_0x5973('0x5f')]=integrations[_0x5973('0x60')](_0x5d71bd['body'][_0x5973('0x5e')],_0x5d71bd[_0x5973('0x55')][_0x5973('0x49')]);return db[_0x5973('0x58')][_0x5973('0x54')](_0x5d71bd[_0x5973('0x55')],{'include':[{'model':db[_0x5973('0x61')],'as':_0x5973('0x5c')},{'model':db[_0x5973('0x61')],'as':_0x5973('0x5f')}]});}return null;})['then'](respondWithResult(_0x491826,null))[_0x5973('0x25')](handleError(_0x491826,null));};exports['getFields']=function(_0xe64766,_0x263687,_0x28465c){var _0x535a55=[_0x5973('0x62'),_0x5973('0x63'),_0x5973('0x64'),'subcategory','close_code','notify','incident_state',_0x5973('0x65'),_0x5973('0x66')];var _0x33b769=[_0x5973('0x67'),_0x5973('0x62'),'caused_by',_0x5973('0x68'),_0x5973('0x69'),_0x5973('0x6a'),'child_incidents',_0x5973('0x63'),_0x5973('0x6b'),_0x5973('0x6c'),_0x5973('0x6d'),_0x5973('0x6e'),_0x5973('0x6f'),_0x5973('0x70'),_0x5973('0x71'),'sys_domain',_0x5973('0x72'),_0x5973('0x73'),_0x5973('0x64'),_0x5973('0x44'),_0x5973('0x74'),_0x5973('0x75'),_0x5973('0x76'),_0x5973('0x77'),_0x5973('0x78'),_0x5973('0x79'),_0x5973('0x7a'),_0x5973('0x7b'),'priority',_0x5973('0x7c'),_0x5973('0x7d'),_0x5973('0x7e'),_0x5973('0x7f'),_0x5973('0x80'),_0x5973('0x81'),_0x5973('0x82'),_0x5973('0x83'),'reopened_time',_0x5973('0x84'),_0x5973('0x85'),_0x5973('0x86'),_0x5973('0x87'),_0x5973('0x88'),_0x5973('0x89'),'close_code','correlation_display','delivery_task',_0x5973('0x8a'),'assignment_group','business_stc',_0x5973('0x8b'),_0x5973('0x8c'),_0x5973('0x8d'),_0x5973('0x8e'),'sys_class_name',_0x5973('0x8f'),'closed_by',_0x5973('0x90'),_0x5973('0x91'),_0x5973('0x92'),'contact_type',_0x5973('0x93'),_0x5973('0x94'),'urgency',_0x5973('0x95'),'company',_0x5973('0x96'),_0x5973('0x97'),_0x5973('0x98'),_0x5973('0x65'),_0x5973('0x99'),_0x5973('0x9a'),'approval',_0x5973('0x9b'),_0x5973('0x9c'),'sys_mod_count','reopen_count',_0x5973('0x9d'),_0x5973('0x9e'),_0x5973('0x9f'),_0x5973('0xa0'),_0x5973('0xa1'),_0x5973('0x66')];var _0x486f6d='';var _0x48a841='';var _0x511ede=[];var _0x2d54b2='';var _0x47bd2b='';var _0x4163ce=[];var _0x480b65='';var _0x57efc1='';var _0x55fa6b={};var _0xfcdac8='';return db[_0x5973('0x34')][_0x5973('0x5a')]({'where':{'id':_0xe64766[_0x5973('0x56')]['id']},'attributes':['id',_0x5973('0xa2'),'password',_0x5973('0xa3'),_0x5973('0xa4'),'serverUrl']})[_0x5973('0x2e')](handleEntityNotFound(_0x263687,null))[_0x5973('0x2e')](function(_0x49c63b){if(_0x49c63b){_0xfcdac8=_0x49c63b[_0x5973('0xa4')];var _0x3b0723=_0xfcdac8[_0x5973('0xa5')](-0x1);if(_0x3b0723==='/'){_0xfcdac8=_0xfcdac8['substring'](0x0,_0xfcdac8['lastIndexOf'](_0x3b0723));}_0x57efc1=util[_0x5973('0xa6')](_0x5973('0xa7'),_0xfcdac8);_0x480b65=util[_0x5973('0xa6')](_0x5973('0xa8'),_0xfcdac8);_0x55fa6b={'user':_0x49c63b[_0x5973('0xa2')],'pass':_0x49c63b[_0x5973('0xa9')]};var _0x15d917={'method':'GET','uri':_0x57efc1+_0x5973('0xaa'),'auth':_0x55fa6b,'json':!![]};return rp(_0x15d917);}})[_0x5973('0x2e')](function(_0x23acbc){if(_0x23acbc['result'][_0x5973('0x3f')]>0x0){_0x486f6d=_0x23acbc[_0x5973('0x24')];}console[_0x5973('0xab')](_0x5973('0xac'),_0x486f6d);_0x4163ce=[];_0x48a841=Object[_0x5973('0xad')]([],_0x486f6d);_[_0x5973('0xae')](_0x48a841,function(_0x25679b){return!_0x535a55[_0x5973('0xaf')](_0x25679b[_0x5973('0x32')]);});_0x48a841[_0x5973('0xb0')](function(_0x10e1d1){var _0x579735=createFieldObject(_0x480b65,_0x55fa6b,_0x10e1d1['internalType'],_0x10e1d1[_0x5973('0x32')],_0x10e1d1['label'],![]);_0x4163ce['push'](_0x579735);});return Promise[_0x5973('0xb1')](_0x4163ce);})['then'](function(_0x112a4e){_0x511ede=_0x112a4e;_0x2d54b2=Object['assign']([],_0x486f6d);console[_0x5973('0xab')](_0x5973('0xb2'),_0x486f6d);_[_0x5973('0xae')](_0x2d54b2,function(_0x522f1d){return _0x33b769[_0x5973('0xaf')](_0x522f1d['name']);});console[_0x5973('0xab')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2d54b2);_0x4163ce=[];_0x2d54b2[_0x5973('0xb0')](function(_0x1308e5){var _0x12c3f8=createFieldObject(_0x480b65,_0x55fa6b,_0x1308e5['internalType'],_0x1308e5['name'],_0x1308e5[_0x5973('0xb3')],!![]);_0x4163ce['push'](_0x12c3f8);});return Promise[_0x5973('0xb1')](_0x4163ce);})[_0x5973('0x2e')](function(_0x59ed7a){_0x47bd2b=_0x59ed7a;var _0x5d4c57=_0x511ede[_0x5973('0xb4')](_0x47bd2b);return{'count':_0x5d4c57['length'],'rows':_0x5d4c57};})[_0x5973('0x2e')](respondWithResult(_0x263687,null))[_0x5973('0x25')](function(_0x2ee827){console[_0x5973('0xab')]('ServiceNow\x20error:\x20'+_0x2ee827);var _0x1eecaa=_0xe64766[_0x5973('0x3a')][_0x5973('0x1a')]?0x1f4:_0x2ee827[_0x5973('0xb5')]||0x1f4;logger[_0x5973('0x20')](_0x2ee827[_0x5973('0x31')]);delete _0x2ee827[_0x5973('0x32')];if(_0x1eecaa===0x191){_0x1eecaa=0x190;}_0x263687[_0x5973('0x26')](_0x1eecaa)[_0x5973('0xb6')](_0xe64766['query'][_0x5973('0x1a')]?{'message':_0x5973('0xb7'),'statusCode':_0x2ee827['statusCode']}:_0x2ee827);});};function createFieldObject(_0x10e6d9,_0x98724d,_0x59ce05,_0x1265db,_0x2a374e,_0x122d17){return new Promise(function(_0x502184,_0x2e3768){var _0x12e67a={'id':_0x1265db,'name':_0x2a374e,'custom':_0x122d17};if(_0x59ce05===_0x5973('0xb8')){_0x12e67a[_0x5973('0x4c')]=[{'name':_0x5973('0xb9'),'value':_0x5973('0xba')},{'name':'False','value':'false'}];_0x502184(_0x12e67a);}else{var _0x49c0a2={'method':_0x5973('0xbb'),'uri':_0x10e6d9+_0x5973('0xbc')+_0x1265db,'auth':_0x98724d,'json':!![]};return rp(_0x49c0a2)[_0x5973('0x2e')](function(_0x2befa9){var _0x4677e7=[];if(_0x2befa9[_0x5973('0x24')]['length']>0x0){_0x2befa9[_0x5973('0x24')][_0x5973('0xb0')](function(_0x468a25){if(_0x468a25['inactive']==='false'){var _0x82e37f={'name':_0x468a25[_0x5973('0xb3')],'value':_0x468a25[_0x5973('0xbd')]};_0x4677e7[_0x5973('0xbe')](_0x82e37f);}});}_0x12e67a[_0x5973('0x4c')]=_0x4677e7;if(_0x12e67a['options']['length']>0x0){_0x502184(_0x12e67a);}else{if(_0x122d17==![]){_0x502184();}else{_0x502184(_0x12e67a);}}});}});} \ No newline at end of file +var _0x1003=['ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','destroy','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','channel','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','category','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','assignment_group','business_stc','description','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','remoteUri','serverUrl','substring','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','remove','includes','forEach','internalType','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','statusCode','Wrong\x20credentials','boolean','True','False','false','inactive','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x1003,0x16a));var _0x3100=function(_0x3b40d1,_0x3944cd){_0x3b40d1=_0x3b40d1-0x0;var _0x23e512=_0x1003[_0x3b40d1];return _0x23e512;};'use strict';var pdf=require(_0x3100('0x0'));var emlformat=require(_0x3100('0x1'));var rimraf=require(_0x3100('0x2'));var zipdir=require(_0x3100('0x3'));var jsonpatch=require(_0x3100('0x4'));var rp=require(_0x3100('0x5'));var moment=require('moment');var BPromise=require(_0x3100('0x6'));var Mustache=require(_0x3100('0x7'));var util=require(_0x3100('0x8'));var path=require(_0x3100('0x9'));var sox=require(_0x3100('0xa'));var csv=require(_0x3100('0xb'));var ejs=require(_0x3100('0xc'));var fs=require('fs');var _=require(_0x3100('0xd'));var squel=require(_0x3100('0xe'));var crypto=require('crypto');var jsforce=require(_0x3100('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3100('0xb'));var querystring=require(_0x3100('0x10'));var Papa=require(_0x3100('0x11'));var Redis=require(_0x3100('0x12'));var authService=require(_0x3100('0x13'));var qs=require(_0x3100('0x14'));var as=require(_0x3100('0x15'));var hardwareService=require(_0x3100('0x16'));var logger=require('../../config/logger')(_0x3100('0x17'));var utils=require(_0x3100('0x18'));var config=require(_0x3100('0x19'));var db=require(_0x3100('0x1a'))['db'];var integrations=require(_0x3100('0x1b'));var jayson=require(_0x3100('0x1c'));var client=jayson[_0x3100('0x1d')][_0x3100('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x316186,_0x4282ee,_0x21a17a){if(_0x21a17a){var _0x2d1cf8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d1cf8[_0x3100('0x1f')](_0x4282ee)){return _0x316186;}else{throw new db[(_0x3100('0x20'))][(_0x3100('0x21'))](_0x3100('0x22'));}}else{return _0x316186;}}function respondWithRpcPromise(_0x2b632a,_0x3ca1ce,_0x24a4bc,_0x14814f){return new BPromise(function(_0x2dc8ee,_0x1bcbc1){var _0x4fce2a=_0x14814f||client;return _0x4fce2a[_0x3100('0x23')](_0x2b632a,_0x24a4bc)[_0x3100('0x24')](function(_0x11bcc8){logger[_0x3100('0x25')](_0x3100('0x26'),_0x3ca1ce,_0x3100('0x27'));logger['debug'](_0x3100('0x28'),_0x3ca1ce,_0x3100('0x27'),JSON[_0x3100('0x29')](_0x11bcc8));if(_0x11bcc8[_0x3100('0x2a')]){if(_0x11bcc8[_0x3100('0x2a')][_0x3100('0x2b')]===0x1f4){logger['error'](_0x3100('0x26'),_0x3ca1ce,_0x11bcc8[_0x3100('0x2a')][_0x3100('0x2c')]);return _0x1bcbc1(_0x11bcc8[_0x3100('0x2a')][_0x3100('0x2c')]);}logger[_0x3100('0x2a')]('ServicenowAccount,\x20%s,\x20%s',_0x3ca1ce,_0x11bcc8[_0x3100('0x2a')]['message']);return _0x2dc8ee(_0x11bcc8[_0x3100('0x2a')][_0x3100('0x2c')]);}else{logger[_0x3100('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0x3ca1ce,_0x3100('0x27'));_0x2dc8ee(_0x11bcc8[_0x3100('0x2d')][_0x3100('0x2c')]);}})[_0x3100('0x2e')](function(_0x2cd6c4){logger[_0x3100('0x2a')]('ServicenowAccount,\x20%s,\x20%s',_0x3ca1ce,_0x2cd6c4);_0x1bcbc1(_0x2cd6c4);});});}function respondWithStatusCode(_0x7f4e5a,_0x429a84){_0x429a84=_0x429a84||0xcc;return function(_0x1ce690){if(_0x1ce690){return _0x7f4e5a[_0x3100('0x2f')](_0x429a84);}return _0x7f4e5a[_0x3100('0x30')](_0x429a84)[_0x3100('0x31')]();};}function respondWithResult(_0x12031e,_0x2f1200){_0x2f1200=_0x2f1200||0xc8;return function(_0x4e87b3){if(_0x4e87b3){return _0x12031e['status'](_0x2f1200)[_0x3100('0x32')](_0x4e87b3);}};}function respondWithFilteredResult(_0x35b9e8,_0x112c14){return function(_0x5e8467){if(_0x5e8467){var _0x20015d=_0x5e8467[_0x3100('0x33')],_0x5b6391=_0x112c14[_0x3100('0x34')],_0x404d05=_0x112c14['offset']+_0x112c14[_0x3100('0x35')],_0x88dbe;if(_0x404d05>=_0x20015d){_0x404d05=_0x20015d;_0x88dbe=0xc8;}else{_0x88dbe=0xce;}_0x35b9e8[_0x3100('0x30')](_0x88dbe);return _0x35b9e8[_0x3100('0x36')]('Content-Range',_0x5b6391+'-'+_0x404d05+'/'+_0x20015d)[_0x3100('0x32')](_0x5e8467);}return null;};}function patchUpdates(_0x11b884){return function(_0x2797b6){try{jsonpatch[_0x3100('0x37')](_0x2797b6,_0x11b884,!![]);}catch(_0x2db0c8){return BPromise[_0x3100('0x38')](_0x2db0c8);}return _0x2797b6[_0x3100('0x39')]();};}function saveUpdates(_0x5c61e6,_0xb5711b){return function(_0x1da25a){if(_0x1da25a){return _0x1da25a['update'](_0x5c61e6)['then'](function(_0x4f532f){return _0x4f532f;});}return null;};}function removeEntity(_0x5c97db,_0x489c35){return function(_0x419519){if(_0x419519){return _0x419519[_0x3100('0x3a')]()[_0x3100('0x24')](function(){_0x5c97db[_0x3100('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x380b3c,_0x4acdaf){return function(_0x51c933){if(!_0x51c933){_0x380b3c[_0x3100('0x2f')](0x194);}return _0x51c933;};}function handleError(_0x5f321a,_0x403116){_0x403116=_0x403116||0x1f4;return function(_0x10ae58){logger[_0x3100('0x2a')](_0x10ae58[_0x3100('0x3b')]);if(_0x10ae58['name']){delete _0x10ae58[_0x3100('0x3c')];}_0x5f321a[_0x3100('0x30')](_0x403116)[_0x3100('0x3d')](_0x10ae58);};}exports[_0x3100('0x3e')]=function(_0x2fb05d,_0x4551e6){var _0x298418={},_0x22dc95={},_0x416f6c={'count':0x0,'rows':[]};var _0x4e721a=_[_0x3100('0x3f')](db[_0x3100('0x40')][_0x3100('0x41')],function(_0x1da871){return{'name':_0x1da871[_0x3100('0x42')],'type':_0x1da871[_0x3100('0x43')]['key']};});_0x22dc95[_0x3100('0x44')]=_['map'](_0x4e721a,_0x3100('0x3c'));_0x22dc95[_0x3100('0x45')]=_[_0x3100('0x46')](_0x2fb05d[_0x3100('0x45')]);_0x22dc95[_0x3100('0x47')]=_[_0x3100('0x48')](_0x22dc95[_0x3100('0x44')],_0x22dc95[_0x3100('0x45')]);_0x298418['attributes']=_['intersection'](_0x22dc95[_0x3100('0x44')],qs['fields'](_0x2fb05d[_0x3100('0x45')][_0x3100('0x49')]));_0x298418['attributes']=_0x298418[_0x3100('0x4a')][_0x3100('0x4b')]?_0x298418[_0x3100('0x4a')]:_0x22dc95[_0x3100('0x44')];if(!_0x2fb05d[_0x3100('0x45')]['hasOwnProperty'](_0x3100('0x4c'))){_0x298418[_0x3100('0x35')]=qs[_0x3100('0x35')](_0x2fb05d[_0x3100('0x45')][_0x3100('0x35')]);_0x298418[_0x3100('0x34')]=qs[_0x3100('0x34')](_0x2fb05d['query'][_0x3100('0x34')]);}_0x298418[_0x3100('0x4d')]=qs[_0x3100('0x4e')](_0x2fb05d[_0x3100('0x45')][_0x3100('0x4e')]);_0x298418[_0x3100('0x4f')]=qs['filters'](_[_0x3100('0x50')](_0x2fb05d[_0x3100('0x45')],_0x22dc95['filters']));if(_0x2fb05d[_0x3100('0x45')][_0x3100('0x51')]){_0x298418[_0x3100('0x4f')]=_[_0x3100('0x52')](_0x298418[_0x3100('0x4f')],{'$or':_['map'](_0x4e721a,function(_0x33e318){if(_0x33e318['type']!==_0x3100('0x53')){var _0x5553a8={};_0x5553a8[_0x33e318[_0x3100('0x3c')]]={'$like':'%'+_0x2fb05d['query']['filter']+'%'};return _0x5553a8;}})});}_0x298418=_[_0x3100('0x52')]({},_0x298418,_0x2fb05d[_0x3100('0x54')]);var _0xead9a9={'where':_0x298418[_0x3100('0x4f')]};return db[_0x3100('0x40')]['count'](_0xead9a9)['then'](function(_0x22e2b1){_0x416f6c[_0x3100('0x33')]=_0x22e2b1;if(_0x2fb05d[_0x3100('0x45')][_0x3100('0x55')]){_0x298418[_0x3100('0x56')]=[{'all':!![]}];}return db[_0x3100('0x40')][_0x3100('0x57')](_0x298418);})[_0x3100('0x24')](function(_0x45b59a){_0x416f6c[_0x3100('0x58')]=_0x45b59a;return _0x416f6c;})[_0x3100('0x24')](respondWithFilteredResult(_0x4551e6,_0x298418))['catch'](handleError(_0x4551e6,null));};exports[_0x3100('0x59')]=function(_0x548ef9,_0x5e887c){var _0x1aeaf9={'raw':![],'where':{'id':_0x548ef9['params']['id']}},_0x18f29a={};_0x18f29a['model']=_['keys'](db[_0x3100('0x40')]['rawAttributes']);_0x18f29a[_0x3100('0x45')]=_[_0x3100('0x46')](_0x548ef9['query']);_0x18f29a[_0x3100('0x47')]=_['intersection'](_0x18f29a[_0x3100('0x44')],_0x18f29a['query']);_0x1aeaf9['attributes']=_[_0x3100('0x48')](_0x18f29a[_0x3100('0x44')],qs['fields'](_0x548ef9[_0x3100('0x45')][_0x3100('0x49')]));_0x1aeaf9['attributes']=_0x1aeaf9[_0x3100('0x4a')]['length']?_0x1aeaf9[_0x3100('0x4a')]:_0x18f29a[_0x3100('0x44')];if(_0x548ef9[_0x3100('0x45')][_0x3100('0x55')]){_0x1aeaf9[_0x3100('0x56')]=[{'all':!![]}];}_0x1aeaf9=_[_0x3100('0x52')]({},_0x1aeaf9,_0x548ef9['options']);return db['ServicenowAccount'][_0x3100('0x5a')](_0x1aeaf9)['then'](handleEntityNotFound(_0x5e887c,null))['then'](respondWithResult(_0x5e887c,null))[_0x3100('0x2e')](handleError(_0x5e887c,null));};exports[_0x3100('0x5b')]=function(_0xd9d2c,_0x3b83a7){return db['ServicenowAccount'][_0x3100('0x5b')](_0xd9d2c[_0x3100('0x5c')],{})[_0x3100('0x24')](respondWithResult(_0x3b83a7,0xc9))[_0x3100('0x2e')](handleError(_0x3b83a7,null));};exports['update']=function(_0x2005cf,_0x354cae){if(_0x2005cf[_0x3100('0x5c')]['id']){delete _0x2005cf[_0x3100('0x5c')]['id'];}return db[_0x3100('0x40')][_0x3100('0x5a')]({'where':{'id':_0x2005cf[_0x3100('0x5d')]['id']}})[_0x3100('0x24')](handleEntityNotFound(_0x354cae,null))[_0x3100('0x24')](saveUpdates(_0x2005cf[_0x3100('0x5c')],null))[_0x3100('0x24')](respondWithResult(_0x354cae,null))[_0x3100('0x2e')](handleError(_0x354cae,null));};exports[_0x3100('0x3a')]=function(_0x432701,_0x1fd292){return db[_0x3100('0x40')][_0x3100('0x5a')]({'where':{'id':_0x432701[_0x3100('0x5d')]['id']}})[_0x3100('0x24')](handleEntityNotFound(_0x1fd292,null))['then'](removeEntity(_0x1fd292,null))['catch'](handleError(_0x1fd292,null));};exports[_0x3100('0x5e')]=function(_0x1e61e8,_0x1df5fc,_0x4cda8a){var _0x3d2ee8={};var _0x31ff7c={};var _0x104028;var _0x74f60e;return db[_0x3100('0x40')][_0x3100('0x5f')]({'where':{'id':_0x1e61e8[_0x3100('0x5d')]['id']}})[_0x3100('0x24')](handleEntityNotFound(_0x1df5fc,null))[_0x3100('0x24')](function(_0x3c492c){if(_0x3c492c){_0x104028=_0x3c492c;_0x31ff7c[_0x3100('0x44')]=_[_0x3100('0x46')](db[_0x3100('0x60')][_0x3100('0x41')]);_0x31ff7c[_0x3100('0x45')]=_[_0x3100('0x46')](_0x1e61e8[_0x3100('0x45')]);_0x31ff7c['filters']=_['intersection'](_0x31ff7c[_0x3100('0x44')],_0x31ff7c[_0x3100('0x45')]);_0x3d2ee8[_0x3100('0x4a')]=_[_0x3100('0x48')](_0x31ff7c[_0x3100('0x44')],qs[_0x3100('0x49')](_0x1e61e8[_0x3100('0x45')]['fields']));_0x3d2ee8[_0x3100('0x4a')]=_0x3d2ee8[_0x3100('0x4a')][_0x3100('0x4b')]?_0x3d2ee8['attributes']:_0x31ff7c[_0x3100('0x44')];_0x3d2ee8[_0x3100('0x4d')]=qs['sort'](_0x1e61e8['query'][_0x3100('0x4e')]);_0x3d2ee8[_0x3100('0x4f')]=qs['filters'](_['pick'](_0x1e61e8[_0x3100('0x45')],_0x31ff7c['filters']));if(_0x1e61e8[_0x3100('0x45')][_0x3100('0x51')]){_0x3d2ee8[_0x3100('0x4f')]=_['merge'](_0x3d2ee8['where'],{'$or':_[_0x3100('0x3f')](_0x3d2ee8[_0x3100('0x4a')],function(_0x1b7c83){var _0x3712d7={};_0x3712d7[_0x1b7c83]={'$like':'%'+_0x1e61e8[_0x3100('0x45')]['filter']+'%'};return _0x3712d7;})});}_0x3d2ee8=_[_0x3100('0x52')]({},_0x3d2ee8,_0x1e61e8['options']);return _0x104028[_0x3100('0x5e')](_0x3d2ee8);}})[_0x3100('0x24')](function(_0x5deefe){if(_0x5deefe){_0x74f60e=_0x5deefe[_0x3100('0x4b')];if(!_0x1e61e8[_0x3100('0x45')]['hasOwnProperty'](_0x3100('0x4c'))){_0x3d2ee8[_0x3100('0x35')]=qs[_0x3100('0x35')](_0x1e61e8[_0x3100('0x45')][_0x3100('0x35')]);_0x3d2ee8[_0x3100('0x34')]=qs['offset'](_0x1e61e8['query'][_0x3100('0x34')]);}return _0x104028['getConfigurations'](_0x3d2ee8);}})[_0x3100('0x24')](function(_0x3f834f){if(_0x3f834f){return _0x3f834f?{'count':_0x74f60e,'rows':_0x3f834f}:null;}})[_0x3100('0x24')](respondWithResult(_0x1df5fc,null))['catch'](handleError(_0x1df5fc,null));};exports[_0x3100('0x61')]=function(_0x55c122,_0x13605d,_0x3687b0){if(_0x55c122['body']['id']){delete _0x55c122['body']['id'];}return db[_0x3100('0x40')][_0x3100('0x5f')]({'where':{'id':_0x55c122[_0x3100('0x5d')]['id']}})['then'](handleEntityNotFound(_0x13605d,null))[_0x3100('0x24')](function(_0x5196a9){if(_0x5196a9){_0x55c122[_0x3100('0x5c')][_0x3100('0x62')]=_0x5196a9['id'];_0x55c122[_0x3100('0x5c')]['Subjects']=integrations['getSubjects'](_0x55c122['body'][_0x3100('0x63')],_0x55c122[_0x3100('0x5c')]['type']);_0x55c122[_0x3100('0x5c')]['Descriptions']=integrations[_0x3100('0x64')](_0x55c122[_0x3100('0x5c')][_0x3100('0x63')],_0x55c122[_0x3100('0x5c')][_0x3100('0x43')]);return db[_0x3100('0x60')][_0x3100('0x5b')](_0x55c122['body'],{'include':[{'model':db[_0x3100('0x65')],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x3100('0x24')](respondWithResult(_0x13605d,null))[_0x3100('0x2e')](handleError(_0x13605d,null));};exports[_0x3100('0x66')]=function(_0x5817ac,_0xf0698c,_0x436acd){var _0x4d0fcd=[_0x3100('0x67'),_0x3100('0x68'),'knowledge',_0x3100('0x69'),_0x3100('0x6a'),_0x3100('0x6b'),_0x3100('0x6c'),'severity',_0x3100('0x6d')];var _0x3d1110=['parent',_0x3100('0x67'),'caused_by',_0x3100('0x6e'),_0x3100('0x6f'),_0x3100('0x70'),'child_incidents',_0x3100('0x68'),_0x3100('0x71'),_0x3100('0x72'),_0x3100('0x73'),_0x3100('0x74'),_0x3100('0x75'),_0x3100('0x76'),_0x3100('0x77'),'sys_domain',_0x3100('0x78'),_0x3100('0x79'),_0x3100('0x7a'),'order',_0x3100('0x7b'),_0x3100('0x7c'),_0x3100('0x7d'),_0x3100('0x7e'),_0x3100('0x7f'),_0x3100('0x80'),_0x3100('0x81'),'business_service','priority','sys_domain_path',_0x3100('0x82'),_0x3100('0x83'),_0x3100('0x84'),_0x3100('0x85'),_0x3100('0x86'),_0x3100('0x87'),_0x3100('0x88'),_0x3100('0x89'),_0x3100('0x8a'),_0x3100('0x8b'),_0x3100('0x8c'),_0x3100('0x69'),_0x3100('0x8d'),_0x3100('0x8e'),_0x3100('0x6a'),'correlation_display',_0x3100('0x8f'),'work_start',_0x3100('0x90'),_0x3100('0x91'),'additional_assignee_list',_0x3100('0x92'),'calendar_duration',_0x3100('0x6b'),_0x3100('0x93'),_0x3100('0x94'),_0x3100('0x95'),'follow_up',_0x3100('0x96'),_0x3100('0x97'),_0x3100('0x98'),_0x3100('0x99'),_0x3100('0x6c'),_0x3100('0x9a'),'problem_id',_0x3100('0x9b'),_0x3100('0x9c'),_0x3100('0x9d'),_0x3100('0x9e'),'severity',_0x3100('0x9f'),_0x3100('0xa0'),_0x3100('0xa1'),_0x3100('0xa2'),'due_date',_0x3100('0xa3'),_0x3100('0xa4'),_0x3100('0xa5'),_0x3100('0xa6'),_0x3100('0xa7'),_0x3100('0xa8'),_0x3100('0xa9'),_0x3100('0x6d')];var _0x284748='';var _0x47838d='';var _0x1d9e22=[];var _0x3f9865='';var _0x25b1f7='';var _0x5e37ba=[];var _0x4a823b='';var _0x21806b='';var _0x19de5d={};var _0x3a9f1c='';return db[_0x3100('0x40')][_0x3100('0x5f')]({'where':{'id':_0x5817ac[_0x3100('0x5d')]['id']},'attributes':['id',_0x3100('0xaa'),'password','email',_0x3100('0xab'),_0x3100('0xac')]})[_0x3100('0x24')](handleEntityNotFound(_0xf0698c,null))['then'](function(_0x230763){if(_0x230763){_0x3a9f1c=_0x230763[_0x3100('0xab')];var _0x5a1465=_0x3a9f1c['slice'](-0x1);if(_0x5a1465==='/'){_0x3a9f1c=_0x3a9f1c[_0x3100('0xad')](0x0,_0x3a9f1c['lastIndexOf'](_0x5a1465));}_0x21806b=util['format'](_0x3100('0xae'),_0x3a9f1c);_0x4a823b=util[_0x3100('0xaf')](_0x3100('0xb0'),_0x3a9f1c);_0x19de5d={'user':_0x230763['username'],'pass':_0x230763['password']};var _0xa0aaea={'method':_0x3100('0xb1'),'uri':_0x21806b+_0x3100('0xb2'),'auth':_0x19de5d,'json':!![]};return rp(_0xa0aaea);}})['then'](function(_0x24eeb7){if(_0x24eeb7[_0x3100('0x2d')][_0x3100('0x4b')]>0x0){_0x284748=_0x24eeb7['result'];}console[_0x3100('0xb3')](_0x3100('0xb4'),_0x284748);_0x5e37ba=[];_0x47838d=Object['assign']([],_0x284748);_[_0x3100('0xb5')](_0x47838d,function(_0x35d4c4){return!_0x4d0fcd[_0x3100('0xb6')](_0x35d4c4['name']);});_0x47838d[_0x3100('0xb7')](function(_0x4db4af){var _0x4ccdf6=createFieldObject(_0x4a823b,_0x19de5d,_0x4db4af[_0x3100('0xb8')],_0x4db4af[_0x3100('0x3c')],_0x4db4af['label'],![]);_0x5e37ba[_0x3100('0xb9')](_0x4ccdf6);});return Promise[_0x3100('0xba')](_0x5e37ba);})[_0x3100('0x24')](function(_0x3df89f){_0x1d9e22=_0x3df89f;_0x3f9865=Object[_0x3100('0xbb')]([],_0x284748);console['log'](_0x3100('0xbc'),_0x284748);_[_0x3100('0xb5')](_0x3f9865,function(_0x5e60c3){return _0x3d1110[_0x3100('0xb6')](_0x5e60c3[_0x3100('0x3c')]);});console['log'](_0x3100('0xbd'),_0x3f9865);_0x5e37ba=[];_0x3f9865[_0x3100('0xb7')](function(_0x2be803){var _0x3ae855=createFieldObject(_0x4a823b,_0x19de5d,_0x2be803['internalType'],_0x2be803[_0x3100('0x3c')],_0x2be803[_0x3100('0xbe')],!![]);_0x5e37ba[_0x3100('0xb9')](_0x3ae855);});return Promise['all'](_0x5e37ba);})[_0x3100('0x24')](function(_0x819b89){_0x25b1f7=_0x819b89;var _0x433e38=_0x1d9e22[_0x3100('0xbf')](_0x25b1f7);return{'count':_0x433e38[_0x3100('0x4b')],'rows':_0x433e38};})[_0x3100('0x24')](respondWithResult(_0xf0698c,null))[_0x3100('0x2e')](function(_0x502d58){console[_0x3100('0xb3')]('ServiceNow\x20error:\x20'+_0x502d58);var _0x1d4734=_0x5817ac['query'][_0x3100('0x1f')]?0x1f4:_0x502d58[_0x3100('0xc0')]||0x1f4;logger[_0x3100('0x2a')](_0x502d58['stack']);delete _0x502d58[_0x3100('0x3c')];if(_0x1d4734===0x191){_0x1d4734=0x190;}_0xf0698c[_0x3100('0x30')](_0x1d4734)[_0x3100('0x3d')](_0x5817ac[_0x3100('0x45')][_0x3100('0x1f')]?{'message':_0x3100('0xc1'),'statusCode':_0x502d58[_0x3100('0xc0')]}:_0x502d58);});};function createFieldObject(_0x301260,_0x5a2ba5,_0x5b1869,_0x2daec7,_0xf3162c,_0x237f5e){return new Promise(function(_0x57a434,_0x598bea){var _0x176bdf={'id':_0x2daec7,'name':_0xf3162c,'custom':_0x237f5e};if(_0x5b1869===_0x3100('0xc2')){_0x176bdf['options']=[{'name':_0x3100('0xc3'),'value':'true'},{'name':_0x3100('0xc4'),'value':_0x3100('0xc5')}];_0x57a434(_0x176bdf);}else{var _0x35cb7f={'method':'GET','uri':_0x301260+'sys_choice?sysparm_query=name=incident^element='+_0x2daec7,'auth':_0x5a2ba5,'json':!![]};return rp(_0x35cb7f)['then'](function(_0x5cbd91){var _0x5e28b5=[];if(_0x5cbd91[_0x3100('0x2d')][_0x3100('0x4b')]>0x0){_0x5cbd91[_0x3100('0x2d')][_0x3100('0xb7')](function(_0xd27a2a){if(_0xd27a2a[_0x3100('0xc6')]===_0x3100('0xc5')){var _0x46c4b7={'name':_0xd27a2a[_0x3100('0xbe')],'value':_0xd27a2a[_0x3100('0xc7')]};_0x5e28b5[_0x3100('0xb9')](_0x46c4b7);}});}_0x176bdf[_0x3100('0x54')]=_0x5e28b5;if(_0x176bdf[_0x3100('0x54')]['length']>0x0){_0x57a434(_0x176bdf);}else{if(_0x237f5e==![]){_0x57a434();}else{_0x57a434(_0x176bdf);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 8ecc0ca..748d94a 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 _0x84e7=['ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x84e7,0x122));var _0x784e=function(_0x57ace4,_0x44ff4a){_0x57ace4=_0x57ace4-0x0;var _0x5e8a69=_0x84e7[_0x57ace4];return _0x5e8a69;};'use strict';var _=require('lodash');var util=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('api');var moment=require(_0x784e('0x2'));var BPromise=require(_0x784e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x784e('0x4'));var rimraf=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var attributes=require(_0x784e('0x7'));var integrations=require(_0x784e('0x8'));module[_0x784e('0x9')]=function(_0x48ed22,_0x3cbdd1){return _0x48ed22['define'](_0x784e('0xa'),attributes,{'tableName':_0x784e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae24=['../../config/logger','moment','bluebird','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','lodash'];(function(_0x1d47a4,_0x197d81){var _0x3a16d7=function(_0x256282){while(--_0x256282){_0x1d47a4['push'](_0x1d47a4['shift']());}};_0x3a16d7(++_0x197d81);}(_0xae24,0x182));var _0x4ae2=function(_0x41aee9,_0xb2f0d3){_0x41aee9=_0x41aee9-0x0;var _0x43d7a0=_0xae24[_0x41aee9];return _0x43d7a0;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var logger=require(_0x4ae2('0x1'))('api');var moment=require(_0x4ae2('0x2'));var BPromise=require(_0x4ae2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ae2('0x4'));var config=require('../../config/environment');var attributes=require(_0x4ae2('0x5'));var integrations=require(_0x4ae2('0x6'));module[_0x4ae2('0x7')]=function(_0x3e6055,_0x428054){return _0x3e6055[_0x4ae2('0x8')]('ServicenowAccount',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 546ea3a..024863d 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 _0xa315=['limit','include','map','ShowServicenowAccount','find','model','then','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','raw','options','where','attributes'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0xa315,0x118));var _0x5a31=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0xa315[_0x4207f4];return _0x29a621;};'use strict';var _=require(_0x5a31('0x0'));var util=require(_0x5a31('0x1'));var moment=require(_0x5a31('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a31('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a31('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a31('0x5'))(_0x5a31('0x6'));var config=require(_0x5a31('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5a31('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x431daf,_0x10c727,_0x289e56){return new BPromise(function(_0x441dde,_0x46f1e8){return client['request'](_0x431daf,_0x289e56)['then'](function(_0x3a62da){logger[_0x5a31('0x9')](_0x5a31('0xa'),_0x10c727,_0x5a31('0xb'));logger['debug'](_0x5a31('0xc'),_0x10c727,_0x5a31('0xb'),JSON[_0x5a31('0xd')](_0x3a62da));if(_0x3a62da[_0x5a31('0xe')]){if(_0x3a62da[_0x5a31('0xe')][_0x5a31('0xf')]===0x1f4){logger['error'](_0x5a31('0xa'),_0x10c727,_0x3a62da['error'][_0x5a31('0x10')]);return _0x46f1e8(_0x3a62da[_0x5a31('0xe')][_0x5a31('0x10')]);}logger[_0x5a31('0xe')](_0x5a31('0xa'),_0x10c727,_0x3a62da['error']['message']);return _0x441dde(_0x3a62da[_0x5a31('0xe')]['message']);}else{logger[_0x5a31('0x9')](_0x5a31('0xa'),_0x10c727,_0x5a31('0xb'));_0x441dde(_0x3a62da[_0x5a31('0x11')][_0x5a31('0x10')]);}})[_0x5a31('0x12')](function(_0x39e000){logger[_0x5a31('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x10c727,_0x39e000);_0x46f1e8(_0x39e000);});});}exports[_0x5a31('0x13')]=function(_0x39dd75){var _0x14de00=this;return new Promise(function(_0x1ffb2a,_0x2f36ea){return db[_0x5a31('0x14')][_0x5a31('0x15')]({'raw':_0x39dd75['options']?_0x39dd75['options'][_0x5a31('0x16')]===undefined?!![]:![]:!![],'where':_0x39dd75['options']?_0x39dd75[_0x5a31('0x17')][_0x5a31('0x18')]||null:null,'attributes':_0x39dd75[_0x5a31('0x17')]?_0x39dd75[_0x5a31('0x17')][_0x5a31('0x19')]||null:null,'limit':_0x39dd75['options']?_0x39dd75['options'][_0x5a31('0x1a')]||null:null,'include':_0x39dd75[_0x5a31('0x17')]?_0x39dd75[_0x5a31('0x17')][_0x5a31('0x1b')]?_['map'](_0x39dd75[_0x5a31('0x17')][_0x5a31('0x1b')],function(_0x1df643){return{'model':db[_0x1df643['model']],'as':_0x1df643['as'],'attributes':_0x1df643[_0x5a31('0x19')],'include':_0x1df643[_0x5a31('0x1b')]?_['map'](_0x1df643['include'],function(_0x17ece5){return{'model':db[_0x17ece5['model']],'as':_0x17ece5['as'],'attributes':_0x17ece5[_0x5a31('0x19')],'include':_0x17ece5[_0x5a31('0x1b')]?_[_0x5a31('0x1c')](_0x17ece5['include'],function(_0x92fc7d){return{'model':db[_0x92fc7d['model']],'as':_0x92fc7d['as'],'attributes':_0x92fc7d[_0x5a31('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x246169){logger[_0x5a31('0x9')](_0x5a31('0x13'),_0x39dd75);logger['debug'](_0x5a31('0x13'),_0x39dd75,JSON[_0x5a31('0xd')](_0x246169));_0x1ffb2a(_0x246169);})[_0x5a31('0x12')](function(_0x778962){logger[_0x5a31('0xe')](_0x5a31('0x13'),_0x778962['message'],_0x39dd75);_0x2f36ea(_0x14de00[_0x5a31('0xe')](0x1f4,_0x778962['message']));});});};exports[_0x5a31('0x1d')]=function(_0x32bfcd){var _0x27f50a=this;return new Promise(function(_0x336df6,_0x4f37e0){return db[_0x5a31('0x14')][_0x5a31('0x1e')]({'raw':_0x32bfcd[_0x5a31('0x17')]?_0x32bfcd[_0x5a31('0x17')][_0x5a31('0x16')]===undefined?!![]:![]:!![],'where':_0x32bfcd[_0x5a31('0x17')]?_0x32bfcd[_0x5a31('0x17')][_0x5a31('0x18')]||null:null,'attributes':_0x32bfcd[_0x5a31('0x17')]?_0x32bfcd[_0x5a31('0x17')][_0x5a31('0x19')]||null:null,'include':_0x32bfcd[_0x5a31('0x17')]?_0x32bfcd['options'][_0x5a31('0x1b')]?_['map'](_0x32bfcd[_0x5a31('0x17')][_0x5a31('0x1b')],function(_0x179104){return{'model':db[_0x179104[_0x5a31('0x1f')]],'as':_0x179104['as'],'attributes':_0x179104[_0x5a31('0x19')],'include':_0x179104[_0x5a31('0x1b')]?_[_0x5a31('0x1c')](_0x179104['include'],function(_0x34a1e0){return{'model':db[_0x34a1e0[_0x5a31('0x1f')]],'as':_0x34a1e0['as'],'attributes':_0x34a1e0[_0x5a31('0x19')],'include':_0x34a1e0['include']?_[_0x5a31('0x1c')](_0x34a1e0[_0x5a31('0x1b')],function(_0x29b7f2){return{'model':db[_0x29b7f2[_0x5a31('0x1f')]],'as':_0x29b7f2['as'],'attributes':_0x29b7f2[_0x5a31('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5a31('0x20')](function(_0x16b958){logger[_0x5a31('0x9')]('ShowServicenowAccount',_0x32bfcd);logger[_0x5a31('0x21')](_0x5a31('0x1d'),_0x32bfcd,JSON[_0x5a31('0xd')](_0x16b958));_0x336df6(_0x16b958);})[_0x5a31('0x12')](function(_0x3b292e){logger[_0x5a31('0xe')](_0x5a31('0x1d'),_0x3b292e[_0x5a31('0x10')],_0x32bfcd);_0x4f37e0(_0x27f50a[_0x5a31('0xe')](0x1f4,_0x3b292e[_0x5a31('0x10')]));});});}; \ No newline at end of file +var _0xdc25=['jayson/promise','client','http','request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','ServicenowAccount,\x20%s,\x20%s','message','result','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','include','model','map','catch','ShowServicenowAccount','debug','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4ebf9,_0x139f08){var _0x3c32e8=function(_0x5e885a){while(--_0x5e885a){_0x4ebf9['push'](_0x4ebf9['shift']());}};_0x3c32e8(++_0x139f08);}(_0xdc25,0x107));var _0x5dc2=function(_0xd97829,_0x45e9c6){_0xd97829=_0xd97829-0x0;var _0x2c7412=_0xdc25[_0xd97829];return _0x2c7412;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var moment=require(_0x5dc2('0x2'));var BPromise=require(_0x5dc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dc2('0x4'));var db=require(_0x5dc2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5dc2('0x6'))(_0x5dc2('0x7'));var config=require(_0x5dc2('0x8'));var jayson=require(_0x5dc2('0x9'));var client=jayson[_0x5dc2('0xa')][_0x5dc2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x602687,_0x2dac03,_0x50d9c2){return new BPromise(function(_0xa1814f,_0x237b79){return client[_0x5dc2('0xc')](_0x602687,_0x50d9c2)[_0x5dc2('0xd')](function(_0x548eb6){logger[_0x5dc2('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x2dac03,_0x5dc2('0xf'));logger['debug'](_0x5dc2('0x10'),_0x2dac03,'request\x20sent',JSON['stringify'](_0x548eb6));if(_0x548eb6[_0x5dc2('0x11')]){if(_0x548eb6[_0x5dc2('0x11')]['code']===0x1f4){logger[_0x5dc2('0x11')](_0x5dc2('0x12'),_0x2dac03,_0x548eb6['error'][_0x5dc2('0x13')]);return _0x237b79(_0x548eb6[_0x5dc2('0x11')]['message']);}logger[_0x5dc2('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x2dac03,_0x548eb6[_0x5dc2('0x11')][_0x5dc2('0x13')]);return _0xa1814f(_0x548eb6[_0x5dc2('0x11')][_0x5dc2('0x13')]);}else{logger[_0x5dc2('0xe')](_0x5dc2('0x12'),_0x2dac03,'request\x20sent');_0xa1814f(_0x548eb6[_0x5dc2('0x14')][_0x5dc2('0x13')]);}})['catch'](function(_0x14549e){logger['error'](_0x5dc2('0x12'),_0x2dac03,_0x14549e);_0x237b79(_0x14549e);});});}exports[_0x5dc2('0x15')]=function(_0xe67f1a){var _0x592ce3=this;return new Promise(function(_0x1583e9,_0xc89df9){return db[_0x5dc2('0x16')]['findAll']({'raw':_0xe67f1a[_0x5dc2('0x17')]?_0xe67f1a[_0x5dc2('0x17')][_0x5dc2('0x18')]===undefined?!![]:![]:!![],'where':_0xe67f1a[_0x5dc2('0x17')]?_0xe67f1a[_0x5dc2('0x17')][_0x5dc2('0x19')]||null:null,'attributes':_0xe67f1a[_0x5dc2('0x17')]?_0xe67f1a[_0x5dc2('0x17')][_0x5dc2('0x1a')]||null:null,'limit':_0xe67f1a[_0x5dc2('0x17')]?_0xe67f1a[_0x5dc2('0x17')]['limit']||null:null,'include':_0xe67f1a[_0x5dc2('0x17')]?_0xe67f1a[_0x5dc2('0x17')][_0x5dc2('0x1b')]?_['map'](_0xe67f1a[_0x5dc2('0x17')]['include'],function(_0x5c1c48){return{'model':db[_0x5c1c48[_0x5dc2('0x1c')]],'as':_0x5c1c48['as'],'attributes':_0x5c1c48[_0x5dc2('0x1a')],'include':_0x5c1c48['include']?_[_0x5dc2('0x1d')](_0x5c1c48[_0x5dc2('0x1b')],function(_0x357a35){return{'model':db[_0x357a35[_0x5dc2('0x1c')]],'as':_0x357a35['as'],'attributes':_0x357a35[_0x5dc2('0x1a')],'include':_0x357a35[_0x5dc2('0x1b')]?_['map'](_0x357a35[_0x5dc2('0x1b')],function(_0x1646b3){return{'model':db[_0x1646b3[_0x5dc2('0x1c')]],'as':_0x1646b3['as'],'attributes':_0x1646b3[_0x5dc2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5dc2('0xd')](function(_0x204c22){logger[_0x5dc2('0xe')](_0x5dc2('0x15'),_0xe67f1a);logger['debug'](_0x5dc2('0x15'),_0xe67f1a,JSON['stringify'](_0x204c22));_0x1583e9(_0x204c22);})[_0x5dc2('0x1e')](function(_0x5c790e){logger[_0x5dc2('0x11')](_0x5dc2('0x15'),_0x5c790e[_0x5dc2('0x13')],_0xe67f1a);_0xc89df9(_0x592ce3['error'](0x1f4,_0x5c790e[_0x5dc2('0x13')]));});});};exports[_0x5dc2('0x1f')]=function(_0x1a0671){var _0x138fa1=this;return new Promise(function(_0x50b648,_0x123980){return db['ServicenowAccount']['find']({'raw':_0x1a0671[_0x5dc2('0x17')]?_0x1a0671[_0x5dc2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1a0671[_0x5dc2('0x17')]?_0x1a0671['options'][_0x5dc2('0x19')]||null:null,'attributes':_0x1a0671['options']?_0x1a0671[_0x5dc2('0x17')][_0x5dc2('0x1a')]||null:null,'include':_0x1a0671['options']?_0x1a0671['options'][_0x5dc2('0x1b')]?_[_0x5dc2('0x1d')](_0x1a0671[_0x5dc2('0x17')][_0x5dc2('0x1b')],function(_0x2e69a9){return{'model':db[_0x2e69a9[_0x5dc2('0x1c')]],'as':_0x2e69a9['as'],'attributes':_0x2e69a9[_0x5dc2('0x1a')],'include':_0x2e69a9[_0x5dc2('0x1b')]?_[_0x5dc2('0x1d')](_0x2e69a9[_0x5dc2('0x1b')],function(_0x498f9a){return{'model':db[_0x498f9a[_0x5dc2('0x1c')]],'as':_0x498f9a['as'],'attributes':_0x498f9a[_0x5dc2('0x1a')],'include':_0x498f9a[_0x5dc2('0x1b')]?_[_0x5dc2('0x1d')](_0x498f9a[_0x5dc2('0x1b')],function(_0x27faa2){return{'model':db[_0x27faa2['model']],'as':_0x27faa2['as'],'attributes':_0x27faa2[_0x5dc2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5dc2('0xd')](function(_0x46db36){logger[_0x5dc2('0xe')](_0x5dc2('0x1f'),_0x1a0671);logger[_0x5dc2('0x20')](_0x5dc2('0x1f'),_0x1a0671,JSON[_0x5dc2('0x21')](_0x46db36));_0x50b648(_0x46db36);})[_0x5dc2('0x1e')](function(_0x2ea9fe){logger['error'](_0x5dc2('0x1f'),_0x2ea9fe[_0x5dc2('0x13')],_0x1a0671);_0x123980(_0x138fa1[_0x5dc2('0x11')](0x1f4,_0x2ea9fe[_0x5dc2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index e07e146..634d635 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 _0x3ef0=['../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3ef0,0x1f4));var _0x03ef=function(_0x701de6,_0x5809e8){_0x701de6=_0x701de6-0x0;var _0x16123e=_0x3ef0[_0x701de6];return _0x16123e;};'use strict';var multer=require(_0x03ef('0x0'));var util=require('util');var path=require(_0x03ef('0x1'));var timeout=require(_0x03ef('0x2'));var express=require(_0x03ef('0x3'));var router=express[_0x03ef('0x4')]();var auth=require(_0x03ef('0x5'));var interaction=require(_0x03ef('0x6'));var config=require(_0x03ef('0x7'));var controller=require(_0x03ef('0x8'));router[_0x03ef('0x9')]('/',auth[_0x03ef('0xa')](),controller['index']);router[_0x03ef('0x9')](_0x03ef('0xb'),auth[_0x03ef('0xa')](),controller[_0x03ef('0xc')]);router[_0x03ef('0x9')](_0x03ef('0xd'),auth[_0x03ef('0xa')](),controller[_0x03ef('0xe')]);router[_0x03ef('0x9')](_0x03ef('0xf'),auth['isAuthenticated'](),controller[_0x03ef('0x10')]);router[_0x03ef('0x9')](_0x03ef('0x11'),auth[_0x03ef('0xa')](),controller['getDescriptions']);router[_0x03ef('0x12')]('/',auth['isAuthenticated'](),controller[_0x03ef('0x13')]);router['put'](_0x03ef('0xb'),auth[_0x03ef('0xa')](),controller[_0x03ef('0x14')]);router[_0x03ef('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x03ef('0x16')]=router; \ No newline at end of file +var _0xacf7=['/:id','show','/:id/fields','isAuthenticated','/:id/subjects','getSubjects','post','create','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x2f2912,_0x4f6155){var _0x5cc562=function(_0x1c8385){while(--_0x1c8385){_0x2f2912['push'](_0x2f2912['shift']());}};_0x5cc562(++_0x4f6155);}(_0xacf7,0x1ef));var _0x7acf=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xacf7[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x7acf('0x0'));var path=require(_0x7acf('0x1'));var timeout=require(_0x7acf('0x2'));var express=require('express');var router=express[_0x7acf('0x3')]();var auth=require(_0x7acf('0x4'));var interaction=require(_0x7acf('0x5'));var config=require(_0x7acf('0x6'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7acf('0x7')]);router[_0x7acf('0x8')](_0x7acf('0x9'),auth['isAuthenticated'](),controller[_0x7acf('0xa')]);router['get'](_0x7acf('0xb'),auth[_0x7acf('0xc')](),controller['getFields']);router[_0x7acf('0x8')](_0x7acf('0xd'),auth[_0x7acf('0xc')](),controller[_0x7acf('0xe')]);router[_0x7acf('0x8')]('/:id/descriptions',auth[_0x7acf('0xc')](),controller['getDescriptions']);router[_0x7acf('0xf')]('/',auth[_0x7acf('0xc')](),controller[_0x7acf('0x10')]);router['put']('/:id',auth[_0x7acf('0xc')](),controller[_0x7acf('0x11')]);router[_0x7acf('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x7acf('0x13')]);module[_0x7acf('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 535ee4b..5fa2779 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 _0x705d=['exports','STRING','sequelize'];(function(_0x12d0e2,_0x10fb29){var _0x1c8777=function(_0x4fd646){while(--_0x4fd646){_0x12d0e2['push'](_0x12d0e2['shift']());}};_0x1c8777(++_0x10fb29);}(_0x705d,0x173));var _0xd705=function(_0xb0d732,_0x17db19){_0xb0d732=_0xb0d732-0x0;var _0xc3f331=_0x705d[_0xb0d732];return _0xc3f331;};'use strict';var Sequelize=require(_0xd705('0x0'));module[_0xd705('0x1')]={'name':{'type':Sequelize[_0xd705('0x2')]},'description':{'type':Sequelize[_0xd705('0x2')]}}; \ No newline at end of file +var _0xc634=['sequelize','exports','STRING'];(function(_0x31d1b9,_0xcb2cc5){var _0x505983=function(_0x19a466){while(--_0x19a466){_0x31d1b9['push'](_0x31d1b9['shift']());}};_0x505983(++_0xcb2cc5);}(_0xc634,0x19b));var _0x4c63=function(_0xd99c22,_0x579862){_0xd99c22=_0xd99c22-0x0;var _0xbbb9e5=_0xc634[_0xd99c22];return _0xbbb9e5;};'use strict';var Sequelize=require(_0x4c63('0x0'));module[_0x4c63('0x1')]={'name':{'type':Sequelize[_0x4c63('0x2')]},'description':{'type':Sequelize[_0x4c63('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 0b6c7b4..7ef1bb5 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 _0x2501=['result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','filters','VIRTUAL','filter','merge','options','count','findAll','rows','show','params','includeAll','include','find','create','body','getFields','findOne','ServicenowField','order','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x2501,0x1ad));var _0x1250=function(_0x2c139d,_0x3fcee1){_0x2c139d=_0x2c139d-0x0;var _0x43bbc3=_0x2501[_0x2c139d];return _0x43bbc3;};'use strict';var pdf=require(_0x1250('0x0'));var emlformat=require(_0x1250('0x1'));var rimraf=require(_0x1250('0x2'));var zipdir=require(_0x1250('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1250('0x4'));var moment=require('moment');var BPromise=require(_0x1250('0x5'));var Mustache=require(_0x1250('0x6'));var util=require(_0x1250('0x7'));var path=require('path');var sox=require(_0x1250('0x8'));var csv=require(_0x1250('0x9'));var ejs=require(_0x1250('0xa'));var fs=require('fs');var _=require(_0x1250('0xb'));var squel=require(_0x1250('0xc'));var crypto=require(_0x1250('0xd'));var jsforce=require(_0x1250('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1250('0x9'));var querystring=require('querystring');var Papa=require(_0x1250('0xf'));var Redis=require('ioredis');var authService=require(_0x1250('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1250('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1250('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x1250('0x13'));var db=require(_0x1250('0x14'))['db'];var jayson=require(_0x1250('0x15'));var client=jayson[_0x1250('0x16')][_0x1250('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1f5e91,_0x5abb2c,_0x3f512d){if(_0x3f512d){var _0x4ad827=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ad827[_0x1250('0x18')](_0x5abb2c)){return _0x1f5e91;}else{throw new db['Sequelize'][(_0x1250('0x19'))](_0x1250('0x1a'));}}else{return _0x1f5e91;}}function respondWithRpcPromise(_0x47e990,_0x304088,_0x3abc8e,_0x355be2){return new BPromise(function(_0x421a2b,_0x1f8f5b){var _0x1bf881=_0x355be2||client;return _0x1bf881['request'](_0x47e990,_0x3abc8e)['then'](function(_0x35a589){logger['info'](_0x1250('0x1b'),_0x304088,_0x1250('0x1c'));logger[_0x1250('0x1d')](_0x1250('0x1e'),_0x304088,'request\x20sent',JSON[_0x1250('0x1f')](_0x35a589));if(_0x35a589[_0x1250('0x20')]){if(_0x35a589[_0x1250('0x20')][_0x1250('0x21')]===0x1f4){logger[_0x1250('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x304088,_0x35a589[_0x1250('0x20')][_0x1250('0x22')]);return _0x1f8f5b(_0x35a589[_0x1250('0x20')]['message']);}logger[_0x1250('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x304088,_0x35a589[_0x1250('0x20')]['message']);return _0x421a2b(_0x35a589[_0x1250('0x20')]['message']);}else{logger[_0x1250('0x23')](_0x1250('0x1b'),_0x304088,_0x1250('0x1c'));_0x421a2b(_0x35a589[_0x1250('0x24')][_0x1250('0x22')]);}})[_0x1250('0x25')](function(_0x33bf41){logger['error'](_0x1250('0x1b'),_0x304088,_0x33bf41);_0x1f8f5b(_0x33bf41);});});}function respondWithStatusCode(_0x527091,_0x4ca7ea){_0x4ca7ea=_0x4ca7ea||0xcc;return function(_0xca187b){if(_0xca187b){return _0x527091[_0x1250('0x26')](_0x4ca7ea);}return _0x527091[_0x1250('0x27')](_0x4ca7ea)[_0x1250('0x28')]();};}function respondWithResult(_0x3e0e18,_0x392d9f){_0x392d9f=_0x392d9f||0xc8;return function(_0x464cf4){if(_0x464cf4){return _0x3e0e18[_0x1250('0x27')](_0x392d9f)[_0x1250('0x29')](_0x464cf4);}};}function respondWithFilteredResult(_0x48554e,_0x25622e){return function(_0x16006b){if(_0x16006b){var _0x4f57e7=_0x16006b['count'],_0x4ea529=_0x25622e[_0x1250('0x2a')],_0x20db27=_0x25622e['offset']+_0x25622e['limit'],_0x448d7a;if(_0x20db27>=_0x4f57e7){_0x20db27=_0x4f57e7;_0x448d7a=0xc8;}else{_0x448d7a=0xce;}_0x48554e[_0x1250('0x27')](_0x448d7a);return _0x48554e[_0x1250('0x2b')](_0x1250('0x2c'),_0x4ea529+'-'+_0x20db27+'/'+_0x4f57e7)['json'](_0x16006b);}return null;};}function patchUpdates(_0x185d5){return function(_0x5203a8){try{jsonpatch[_0x1250('0x2d')](_0x5203a8,_0x185d5,!![]);}catch(_0x2b30f2){return BPromise['reject'](_0x2b30f2);}return _0x5203a8['save']();};}function saveUpdates(_0x12f663,_0x330c63){return function(_0x567ff8){if(_0x567ff8){return _0x567ff8[_0x1250('0x2e')](_0x12f663)[_0x1250('0x2f')](function(_0x3c8f6f){return _0x3c8f6f;});}return null;};}function removeEntity(_0xa0ee92,_0x4fc6e2){return function(_0x1ecba0){if(_0x1ecba0){return _0x1ecba0[_0x1250('0x30')]()[_0x1250('0x2f')](function(){_0xa0ee92['status'](0xcc)[_0x1250('0x28')]();});}};}function handleEntityNotFound(_0x5188fe,_0x4185d2){return function(_0x47afbf){if(!_0x47afbf){_0x5188fe[_0x1250('0x26')](0x194);}return _0x47afbf;};}function handleError(_0x56194e,_0xfb67f9){_0xfb67f9=_0xfb67f9||0x1f4;return function(_0x191880){logger[_0x1250('0x20')](_0x191880[_0x1250('0x31')]);if(_0x191880[_0x1250('0x32')]){delete _0x191880[_0x1250('0x32')];}_0x56194e[_0x1250('0x27')](_0xfb67f9)[_0x1250('0x33')](_0x191880);};}exports[_0x1250('0x34')]=function(_0x203d08,_0x48b23c){var _0x26cf45={},_0x4682f2={},_0x7840db={'count':0x0,'rows':[]};var _0x5d6c0d=_[_0x1250('0x35')](db[_0x1250('0x36')][_0x1250('0x37')],function(_0x2e6f3d){return{'name':_0x2e6f3d[_0x1250('0x38')],'type':_0x2e6f3d[_0x1250('0x39')][_0x1250('0x3a')]};});_0x4682f2[_0x1250('0x3b')]=_[_0x1250('0x35')](_0x5d6c0d,_0x1250('0x32'));_0x4682f2[_0x1250('0x3c')]=_[_0x1250('0x3d')](_0x203d08[_0x1250('0x3c')]);_0x4682f2['filters']=_[_0x1250('0x3e')](_0x4682f2['model'],_0x4682f2['query']);_0x26cf45['attributes']=_[_0x1250('0x3e')](_0x4682f2['model'],qs['fields'](_0x203d08['query'][_0x1250('0x3f')]));_0x26cf45[_0x1250('0x40')]=_0x26cf45[_0x1250('0x40')][_0x1250('0x41')]?_0x26cf45[_0x1250('0x40')]:_0x4682f2[_0x1250('0x3b')];if(!_0x203d08[_0x1250('0x3c')]['hasOwnProperty'](_0x1250('0x42'))){_0x26cf45[_0x1250('0x43')]=qs[_0x1250('0x43')](_0x203d08['query'][_0x1250('0x43')]);_0x26cf45[_0x1250('0x2a')]=qs[_0x1250('0x2a')](_0x203d08[_0x1250('0x3c')]['offset']);}_0x26cf45['order']=qs[_0x1250('0x44')](_0x203d08[_0x1250('0x3c')][_0x1250('0x44')]);_0x26cf45[_0x1250('0x45')]=qs['filters'](_[_0x1250('0x46')](_0x203d08[_0x1250('0x3c')],_0x4682f2[_0x1250('0x47')]));if(_0x203d08['query']['filter']){_0x26cf45[_0x1250('0x45')]=_['merge'](_0x26cf45[_0x1250('0x45')],{'$or':_['map'](_0x5d6c0d,function(_0x494e58){if(_0x494e58[_0x1250('0x39')]!==_0x1250('0x48')){var _0x41f597={};_0x41f597[_0x494e58['name']]={'$like':'%'+_0x203d08[_0x1250('0x3c')][_0x1250('0x49')]+'%'};return _0x41f597;}})});}_0x26cf45=_[_0x1250('0x4a')]({},_0x26cf45,_0x203d08[_0x1250('0x4b')]);var _0xfd80bc={'where':_0x26cf45['where']};return db[_0x1250('0x36')][_0x1250('0x4c')](_0xfd80bc)['then'](function(_0x2b38e1){_0x7840db[_0x1250('0x4c')]=_0x2b38e1;if(_0x203d08['query']['includeAll']){_0x26cf45['include']=[{'all':!![]}];}return db[_0x1250('0x36')][_0x1250('0x4d')](_0x26cf45);})[_0x1250('0x2f')](function(_0x517055){_0x7840db[_0x1250('0x4e')]=_0x517055;return _0x7840db;})[_0x1250('0x2f')](respondWithFilteredResult(_0x48b23c,_0x26cf45))[_0x1250('0x25')](handleError(_0x48b23c,null));};exports[_0x1250('0x4f')]=function(_0x24dd7e,_0x3747a2){var _0x39e3eb={'raw':![],'where':{'id':_0x24dd7e[_0x1250('0x50')]['id']}},_0x46f32a={};_0x46f32a[_0x1250('0x3b')]=_[_0x1250('0x3d')](db[_0x1250('0x36')][_0x1250('0x37')]);_0x46f32a[_0x1250('0x3c')]=_[_0x1250('0x3d')](_0x24dd7e[_0x1250('0x3c')]);_0x46f32a[_0x1250('0x47')]=_['intersection'](_0x46f32a[_0x1250('0x3b')],_0x46f32a['query']);_0x39e3eb['attributes']=_[_0x1250('0x3e')](_0x46f32a['model'],qs['fields'](_0x24dd7e[_0x1250('0x3c')][_0x1250('0x3f')]));_0x39e3eb[_0x1250('0x40')]=_0x39e3eb[_0x1250('0x40')]['length']?_0x39e3eb['attributes']:_0x46f32a[_0x1250('0x3b')];if(_0x24dd7e[_0x1250('0x3c')][_0x1250('0x51')]){_0x39e3eb[_0x1250('0x52')]=[{'all':!![]}];}_0x39e3eb=_[_0x1250('0x4a')]({},_0x39e3eb,_0x24dd7e[_0x1250('0x4b')]);return db['ServicenowConfiguration'][_0x1250('0x53')](_0x39e3eb)[_0x1250('0x2f')](handleEntityNotFound(_0x3747a2,null))['then'](respondWithResult(_0x3747a2,null))[_0x1250('0x25')](handleError(_0x3747a2,null));};exports[_0x1250('0x54')]=function(_0x4f77ff,_0x597c97){return db[_0x1250('0x36')][_0x1250('0x54')](_0x4f77ff['body'],{})[_0x1250('0x2f')](respondWithResult(_0x597c97,0xc9))['catch'](handleError(_0x597c97,null));};exports[_0x1250('0x2e')]=function(_0x1d09f8,_0x407fda){if(_0x1d09f8[_0x1250('0x55')]['id']){delete _0x1d09f8[_0x1250('0x55')]['id'];}return db[_0x1250('0x36')]['find']({'where':{'id':_0x1d09f8[_0x1250('0x50')]['id']}})[_0x1250('0x2f')](handleEntityNotFound(_0x407fda,null))['then'](saveUpdates(_0x1d09f8['body'],null))[_0x1250('0x2f')](respondWithResult(_0x407fda,null))[_0x1250('0x25')](handleError(_0x407fda,null));};exports[_0x1250('0x30')]=function(_0x4e75b5,_0x34f088){return db[_0x1250('0x36')]['find']({'where':{'id':_0x4e75b5[_0x1250('0x50')]['id']}})['then'](handleEntityNotFound(_0x34f088,null))['then'](removeEntity(_0x34f088,null))[_0x1250('0x25')](handleError(_0x34f088,null));};exports[_0x1250('0x56')]=function(_0x3e779a,_0x24b0a7,_0x2b3589){var _0x1fb04a={};var _0xbe75f6={};var _0x42aa1d;var _0xe45564;return db[_0x1250('0x36')][_0x1250('0x57')]({'where':{'id':_0x3e779a[_0x1250('0x50')]['id']}})[_0x1250('0x2f')](handleEntityNotFound(_0x24b0a7,null))[_0x1250('0x2f')](function(_0x1bafe5){if(_0x1bafe5){_0x42aa1d=_0x1bafe5;_0xbe75f6[_0x1250('0x3b')]=_[_0x1250('0x3d')](db[_0x1250('0x58')][_0x1250('0x37')]);_0xbe75f6['query']=_[_0x1250('0x3d')](_0x3e779a['query']);_0xbe75f6['filters']=_[_0x1250('0x3e')](_0xbe75f6[_0x1250('0x3b')],_0xbe75f6[_0x1250('0x3c')]);_0x1fb04a['attributes']=_[_0x1250('0x3e')](_0xbe75f6[_0x1250('0x3b')],qs[_0x1250('0x3f')](_0x3e779a[_0x1250('0x3c')][_0x1250('0x3f')]));_0x1fb04a[_0x1250('0x40')]=_0x1fb04a[_0x1250('0x40')][_0x1250('0x41')]?_0x1fb04a[_0x1250('0x40')]:_0xbe75f6[_0x1250('0x3b')];_0x1fb04a[_0x1250('0x59')]=qs[_0x1250('0x44')](_0x3e779a['query']['sort']);_0x1fb04a['where']=qs[_0x1250('0x47')](_[_0x1250('0x46')](_0x3e779a[_0x1250('0x3c')],_0xbe75f6[_0x1250('0x47')]));if(_0x3e779a[_0x1250('0x3c')][_0x1250('0x49')]){_0x1fb04a['where']=_[_0x1250('0x4a')](_0x1fb04a['where'],{'$or':_['map'](_0x1fb04a[_0x1250('0x40')],function(_0x1431d4){var _0x379501={};_0x379501[_0x1431d4]={'$like':'%'+_0x3e779a[_0x1250('0x3c')]['filter']+'%'};return _0x379501;})});}_0x1fb04a=_[_0x1250('0x4a')]({},_0x1fb04a,_0x3e779a[_0x1250('0x4b')]);return _0x42aa1d[_0x1250('0x56')](_0x1fb04a);}})[_0x1250('0x2f')](function(_0x668382){if(_0x668382){_0xe45564=_0x668382['length'];if(!_0x3e779a['query'][_0x1250('0x5a')](_0x1250('0x42'))){_0x1fb04a[_0x1250('0x43')]=qs[_0x1250('0x43')](_0x3e779a['query'][_0x1250('0x43')]);_0x1fb04a[_0x1250('0x2a')]=qs[_0x1250('0x2a')](_0x3e779a[_0x1250('0x3c')][_0x1250('0x2a')]);}return _0x42aa1d[_0x1250('0x56')](_0x1fb04a);}})[_0x1250('0x2f')](function(_0x46479c){if(_0x46479c){return _0x46479c?{'count':_0xe45564,'rows':_0x46479c}:null;}})[_0x1250('0x2f')](respondWithResult(_0x24b0a7,null))[_0x1250('0x25')](handleError(_0x24b0a7,null));};exports['getSubjects']=function(_0x198efa,_0x104a40,_0x3df51b){var _0x26cb3a={};var _0x401d5e={};var _0x3bcd2a;var _0x2c28c6;return db[_0x1250('0x36')][_0x1250('0x57')]({'where':{'id':_0x198efa[_0x1250('0x50')]['id']}})[_0x1250('0x2f')](handleEntityNotFound(_0x104a40,null))[_0x1250('0x2f')](function(_0x342a85){if(_0x342a85){_0x3bcd2a=_0x342a85;_0x401d5e['model']=_['keys'](db[_0x1250('0x58')][_0x1250('0x37')]);_0x401d5e[_0x1250('0x3c')]=_[_0x1250('0x3d')](_0x198efa[_0x1250('0x3c')]);_0x401d5e[_0x1250('0x47')]=_[_0x1250('0x3e')](_0x401d5e[_0x1250('0x3b')],_0x401d5e[_0x1250('0x3c')]);_0x26cb3a['attributes']=_[_0x1250('0x3e')](_0x401d5e[_0x1250('0x3b')],qs['fields'](_0x198efa[_0x1250('0x3c')][_0x1250('0x3f')]));_0x26cb3a[_0x1250('0x40')]=_0x26cb3a['attributes'][_0x1250('0x41')]?_0x26cb3a[_0x1250('0x40')]:_0x401d5e[_0x1250('0x3b')];_0x26cb3a[_0x1250('0x59')]=qs[_0x1250('0x44')](_0x198efa[_0x1250('0x3c')]['sort']);_0x26cb3a[_0x1250('0x45')]=qs[_0x1250('0x47')](_[_0x1250('0x46')](_0x198efa[_0x1250('0x3c')],_0x401d5e[_0x1250('0x47')]));if(_0x198efa[_0x1250('0x3c')][_0x1250('0x49')]){_0x26cb3a[_0x1250('0x45')]=_[_0x1250('0x4a')](_0x26cb3a[_0x1250('0x45')],{'$or':_[_0x1250('0x35')](_0x26cb3a[_0x1250('0x40')],function(_0x18a5fe){var _0xa014d4={};_0xa014d4[_0x18a5fe]={'$like':'%'+_0x198efa[_0x1250('0x3c')]['filter']+'%'};return _0xa014d4;})});}_0x26cb3a=_['merge']({},_0x26cb3a,_0x198efa['options']);return _0x3bcd2a[_0x1250('0x5b')](_0x26cb3a);}})[_0x1250('0x2f')](function(_0x2502ce){if(_0x2502ce){_0x2c28c6=_0x2502ce[_0x1250('0x41')];if(!_0x198efa['query']['hasOwnProperty'](_0x1250('0x42'))){_0x26cb3a['limit']=qs[_0x1250('0x43')](_0x198efa[_0x1250('0x3c')][_0x1250('0x43')]);_0x26cb3a[_0x1250('0x2a')]=qs[_0x1250('0x2a')](_0x198efa[_0x1250('0x3c')][_0x1250('0x2a')]);}return _0x3bcd2a[_0x1250('0x5b')](_0x26cb3a);}})[_0x1250('0x2f')](function(_0x3a0ff7){if(_0x3a0ff7){return _0x3a0ff7?{'count':_0x2c28c6,'rows':_0x3a0ff7}:null;}})[_0x1250('0x2f')](respondWithResult(_0x104a40,null))['catch'](handleError(_0x104a40,null));};exports['getDescriptions']=function(_0x647962,_0xafe6db,_0x39bee9){var _0x36f9a4={};var _0x37268f={};var _0x1f7ca0;var _0x44a01a;return db[_0x1250('0x36')][_0x1250('0x57')]({'where':{'id':_0x647962['params']['id']}})[_0x1250('0x2f')](handleEntityNotFound(_0xafe6db,null))[_0x1250('0x2f')](function(_0x555745){if(_0x555745){_0x1f7ca0=_0x555745;_0x37268f['model']=_[_0x1250('0x3d')](db[_0x1250('0x58')][_0x1250('0x37')]);_0x37268f[_0x1250('0x3c')]=_[_0x1250('0x3d')](_0x647962[_0x1250('0x3c')]);_0x37268f[_0x1250('0x47')]=_['intersection'](_0x37268f[_0x1250('0x3b')],_0x37268f['query']);_0x36f9a4['attributes']=_[_0x1250('0x3e')](_0x37268f[_0x1250('0x3b')],qs[_0x1250('0x3f')](_0x647962['query'][_0x1250('0x3f')]));_0x36f9a4[_0x1250('0x40')]=_0x36f9a4[_0x1250('0x40')]['length']?_0x36f9a4['attributes']:_0x37268f[_0x1250('0x3b')];_0x36f9a4[_0x1250('0x59')]=qs[_0x1250('0x44')](_0x647962[_0x1250('0x3c')][_0x1250('0x44')]);_0x36f9a4[_0x1250('0x45')]=qs[_0x1250('0x47')](_['pick'](_0x647962['query'],_0x37268f[_0x1250('0x47')]));if(_0x647962[_0x1250('0x3c')]['filter']){_0x36f9a4[_0x1250('0x45')]=_[_0x1250('0x4a')](_0x36f9a4[_0x1250('0x45')],{'$or':_[_0x1250('0x35')](_0x36f9a4[_0x1250('0x40')],function(_0x363b5a){var _0x5776e2={};_0x5776e2[_0x363b5a]={'$like':'%'+_0x647962[_0x1250('0x3c')][_0x1250('0x49')]+'%'};return _0x5776e2;})});}_0x36f9a4=_[_0x1250('0x4a')]({},_0x36f9a4,_0x647962['options']);return _0x1f7ca0[_0x1250('0x5c')](_0x36f9a4);}})[_0x1250('0x2f')](function(_0x54efdc){if(_0x54efdc){_0x44a01a=_0x54efdc[_0x1250('0x41')];if(!_0x647962[_0x1250('0x3c')][_0x1250('0x5a')](_0x1250('0x42'))){_0x36f9a4[_0x1250('0x43')]=qs[_0x1250('0x43')](_0x647962[_0x1250('0x3c')][_0x1250('0x43')]);_0x36f9a4[_0x1250('0x2a')]=qs[_0x1250('0x2a')](_0x647962[_0x1250('0x3c')][_0x1250('0x2a')]);}return _0x1f7ca0[_0x1250('0x5c')](_0x36f9a4);}})[_0x1250('0x2f')](function(_0x683630){if(_0x683630){return _0x683630?{'count':_0x44a01a,'rows':_0x683630}:null;}})[_0x1250('0x2f')](respondWithResult(_0xafe6db,null))[_0x1250('0x25')](handleError(_0xafe6db,null));}; \ No newline at end of file +var _0xb208=['test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','limit','apply','reject','update','destroy','end','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','params','includeAll','find','create','body','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','eml-format','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0xb208,0x13e));var _0x8b20=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb208[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b20('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b20('0x1'));var moment=require(_0x8b20('0x2'));var BPromise=require(_0x8b20('0x3'));var Mustache=require(_0x8b20('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8b20('0x5'));var ejs=require(_0x8b20('0x6'));var fs=require('fs');var _=require(_0x8b20('0x7'));var squel=require(_0x8b20('0x8'));var crypto=require(_0x8b20('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8b20('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8b20('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x8b20('0xc'));var as=require(_0x8b20('0xd'));var hardwareService=require(_0x8b20('0xe'));var logger=require(_0x8b20('0xf'))(_0x8b20('0x10'));var utils=require(_0x8b20('0x11'));var config=require(_0x8b20('0x12'));var db=require(_0x8b20('0x13'))['db'];var jayson=require(_0x8b20('0x14'));var client=jayson['client'][_0x8b20('0x15')]({'port':0x232a});function checkPasswordPattern(_0x3a4672,_0x293f6e,_0x443e76){if(_0x443e76){var _0x4ff0b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ff0b6[_0x8b20('0x16')](_0x293f6e)){return _0x3a4672;}else{throw new db['Sequelize'][(_0x8b20('0x17'))](_0x8b20('0x18'));}}else{return _0x3a4672;}}function respondWithRpcPromise(_0x45049c,_0x432a9d,_0x974d3e,_0x1a5565){return new BPromise(function(_0x1774c0,_0x5b253a){var _0x2d3cc4=_0x1a5565||client;return _0x2d3cc4['request'](_0x45049c,_0x974d3e)[_0x8b20('0x19')](function(_0x39d5d6){logger[_0x8b20('0x1a')](_0x8b20('0x1b'),_0x432a9d,_0x8b20('0x1c'));logger[_0x8b20('0x1d')](_0x8b20('0x1e'),_0x432a9d,_0x8b20('0x1c'),JSON[_0x8b20('0x1f')](_0x39d5d6));if(_0x39d5d6[_0x8b20('0x20')]){if(_0x39d5d6[_0x8b20('0x20')]['code']===0x1f4){logger[_0x8b20('0x20')](_0x8b20('0x1b'),_0x432a9d,_0x39d5d6[_0x8b20('0x20')][_0x8b20('0x21')]);return _0x5b253a(_0x39d5d6[_0x8b20('0x20')]['message']);}logger[_0x8b20('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x432a9d,_0x39d5d6['error'][_0x8b20('0x21')]);return _0x1774c0(_0x39d5d6[_0x8b20('0x20')][_0x8b20('0x21')]);}else{logger['info'](_0x8b20('0x1b'),_0x432a9d,_0x8b20('0x1c'));_0x1774c0(_0x39d5d6[_0x8b20('0x22')][_0x8b20('0x21')]);}})[_0x8b20('0x23')](function(_0x2720e9){logger[_0x8b20('0x20')](_0x8b20('0x1b'),_0x432a9d,_0x2720e9);_0x5b253a(_0x2720e9);});});}function respondWithStatusCode(_0x4fe6c4,_0x2212bd){_0x2212bd=_0x2212bd||0xcc;return function(_0x2e78c3){if(_0x2e78c3){return _0x4fe6c4[_0x8b20('0x24')](_0x2212bd);}return _0x4fe6c4['status'](_0x2212bd)['end']();};}function respondWithResult(_0xbd82fa,_0x2e6c17){_0x2e6c17=_0x2e6c17||0xc8;return function(_0x633bbe){if(_0x633bbe){return _0xbd82fa[_0x8b20('0x25')](_0x2e6c17)[_0x8b20('0x26')](_0x633bbe);}};}function respondWithFilteredResult(_0x527161,_0x1d3d5c){return function(_0x2fd6eb){if(_0x2fd6eb){var _0x6f0f1d=_0x2fd6eb[_0x8b20('0x27')],_0x24bb4c=_0x1d3d5c[_0x8b20('0x28')],_0x586df4=_0x1d3d5c[_0x8b20('0x28')]+_0x1d3d5c[_0x8b20('0x29')],_0x5e57ea;if(_0x586df4>=_0x6f0f1d){_0x586df4=_0x6f0f1d;_0x5e57ea=0xc8;}else{_0x5e57ea=0xce;}_0x527161[_0x8b20('0x25')](_0x5e57ea);return _0x527161['set']('Content-Range',_0x24bb4c+'-'+_0x586df4+'/'+_0x6f0f1d)['json'](_0x2fd6eb);}return null;};}function patchUpdates(_0x472b4c){return function(_0x52d5e7){try{jsonpatch[_0x8b20('0x2a')](_0x52d5e7,_0x472b4c,!![]);}catch(_0x2da24d){return BPromise[_0x8b20('0x2b')](_0x2da24d);}return _0x52d5e7['save']();};}function saveUpdates(_0x94fb28,_0x4961a2){return function(_0x53249d){if(_0x53249d){return _0x53249d[_0x8b20('0x2c')](_0x94fb28)[_0x8b20('0x19')](function(_0x1961d5){return _0x1961d5;});}return null;};}function removeEntity(_0x1e83b1,_0x399fbd){return function(_0x321e5b){if(_0x321e5b){return _0x321e5b[_0x8b20('0x2d')]()[_0x8b20('0x19')](function(){_0x1e83b1[_0x8b20('0x25')](0xcc)[_0x8b20('0x2e')]();});}};}function handleEntityNotFound(_0x4381a6,_0x218636){return function(_0x5e65f5){if(!_0x5e65f5){_0x4381a6[_0x8b20('0x24')](0x194);}return _0x5e65f5;};}function handleError(_0x122072,_0x59075e){_0x59075e=_0x59075e||0x1f4;return function(_0x43b740){logger[_0x8b20('0x20')](_0x43b740[_0x8b20('0x2f')]);if(_0x43b740[_0x8b20('0x30')]){delete _0x43b740[_0x8b20('0x30')];}_0x122072['status'](_0x59075e)[_0x8b20('0x31')](_0x43b740);};}exports['index']=function(_0x3c054c,_0x42dc6d){var _0xd9d754={},_0x2d1bf3={},_0x31b4e1={'count':0x0,'rows':[]};var _0x1f067c=_[_0x8b20('0x32')](db[_0x8b20('0x33')][_0x8b20('0x34')],function(_0xd95628){return{'name':_0xd95628[_0x8b20('0x35')],'type':_0xd95628[_0x8b20('0x36')]['key']};});_0x2d1bf3[_0x8b20('0x37')]=_['map'](_0x1f067c,'name');_0x2d1bf3[_0x8b20('0x38')]=_[_0x8b20('0x39')](_0x3c054c[_0x8b20('0x38')]);_0x2d1bf3['filters']=_[_0x8b20('0x3a')](_0x2d1bf3[_0x8b20('0x37')],_0x2d1bf3[_0x8b20('0x38')]);_0xd9d754[_0x8b20('0x3b')]=_[_0x8b20('0x3a')](_0x2d1bf3['model'],qs[_0x8b20('0x3c')](_0x3c054c['query'][_0x8b20('0x3c')]));_0xd9d754[_0x8b20('0x3b')]=_0xd9d754[_0x8b20('0x3b')][_0x8b20('0x3d')]?_0xd9d754[_0x8b20('0x3b')]:_0x2d1bf3[_0x8b20('0x37')];if(!_0x3c054c[_0x8b20('0x38')][_0x8b20('0x3e')](_0x8b20('0x3f'))){_0xd9d754['limit']=qs[_0x8b20('0x29')](_0x3c054c[_0x8b20('0x38')][_0x8b20('0x29')]);_0xd9d754[_0x8b20('0x28')]=qs[_0x8b20('0x28')](_0x3c054c['query'][_0x8b20('0x28')]);}_0xd9d754['order']=qs['sort'](_0x3c054c['query'][_0x8b20('0x40')]);_0xd9d754[_0x8b20('0x41')]=qs[_0x8b20('0x42')](_[_0x8b20('0x43')](_0x3c054c[_0x8b20('0x38')],_0x2d1bf3[_0x8b20('0x42')]));if(_0x3c054c[_0x8b20('0x38')][_0x8b20('0x44')]){_0xd9d754[_0x8b20('0x41')]=_[_0x8b20('0x45')](_0xd9d754[_0x8b20('0x41')],{'$or':_[_0x8b20('0x32')](_0x1f067c,function(_0x3ce2e7){if(_0x3ce2e7[_0x8b20('0x36')]!==_0x8b20('0x46')){var _0x2f3072={};_0x2f3072[_0x3ce2e7[_0x8b20('0x30')]]={'$like':'%'+_0x3c054c[_0x8b20('0x38')]['filter']+'%'};return _0x2f3072;}})});}_0xd9d754=_[_0x8b20('0x45')]({},_0xd9d754,_0x3c054c[_0x8b20('0x47')]);var _0xbeb9dc={'where':_0xd9d754[_0x8b20('0x41')]};return db[_0x8b20('0x33')][_0x8b20('0x27')](_0xbeb9dc)[_0x8b20('0x19')](function(_0x418d38){_0x31b4e1[_0x8b20('0x27')]=_0x418d38;if(_0x3c054c[_0x8b20('0x38')]['includeAll']){_0xd9d754[_0x8b20('0x48')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0xd9d754);})['then'](function(_0x4c76d8){_0x31b4e1[_0x8b20('0x49')]=_0x4c76d8;return _0x31b4e1;})[_0x8b20('0x19')](respondWithFilteredResult(_0x42dc6d,_0xd9d754))[_0x8b20('0x23')](handleError(_0x42dc6d,null));};exports['show']=function(_0x4ad517,_0x354a47){var _0x4ac9b0={'raw':![],'where':{'id':_0x4ad517[_0x8b20('0x4a')]['id']}},_0x139621={};_0x139621[_0x8b20('0x37')]=_[_0x8b20('0x39')](db[_0x8b20('0x33')][_0x8b20('0x34')]);_0x139621[_0x8b20('0x38')]=_[_0x8b20('0x39')](_0x4ad517['query']);_0x139621['filters']=_[_0x8b20('0x3a')](_0x139621[_0x8b20('0x37')],_0x139621[_0x8b20('0x38')]);_0x4ac9b0[_0x8b20('0x3b')]=_[_0x8b20('0x3a')](_0x139621['model'],qs[_0x8b20('0x3c')](_0x4ad517[_0x8b20('0x38')][_0x8b20('0x3c')]));_0x4ac9b0['attributes']=_0x4ac9b0['attributes']['length']?_0x4ac9b0[_0x8b20('0x3b')]:_0x139621[_0x8b20('0x37')];if(_0x4ad517[_0x8b20('0x38')][_0x8b20('0x4b')]){_0x4ac9b0['include']=[{'all':!![]}];}_0x4ac9b0=_[_0x8b20('0x45')]({},_0x4ac9b0,_0x4ad517[_0x8b20('0x47')]);return db['ServicenowConfiguration'][_0x8b20('0x4c')](_0x4ac9b0)[_0x8b20('0x19')](handleEntityNotFound(_0x354a47,null))[_0x8b20('0x19')](respondWithResult(_0x354a47,null))[_0x8b20('0x23')](handleError(_0x354a47,null));};exports[_0x8b20('0x4d')]=function(_0xe716fd,_0xbb3d6b){return db[_0x8b20('0x33')][_0x8b20('0x4d')](_0xe716fd[_0x8b20('0x4e')],{})[_0x8b20('0x19')](respondWithResult(_0xbb3d6b,0xc9))['catch'](handleError(_0xbb3d6b,null));};exports[_0x8b20('0x2c')]=function(_0x371df7,_0x8f47bf){if(_0x371df7[_0x8b20('0x4e')]['id']){delete _0x371df7[_0x8b20('0x4e')]['id'];}return db[_0x8b20('0x33')][_0x8b20('0x4c')]({'where':{'id':_0x371df7[_0x8b20('0x4a')]['id']}})[_0x8b20('0x19')](handleEntityNotFound(_0x8f47bf,null))[_0x8b20('0x19')](saveUpdates(_0x371df7[_0x8b20('0x4e')],null))[_0x8b20('0x19')](respondWithResult(_0x8f47bf,null))['catch'](handleError(_0x8f47bf,null));};exports[_0x8b20('0x2d')]=function(_0x28a52e,_0x4db3f5){return db[_0x8b20('0x33')][_0x8b20('0x4c')]({'where':{'id':_0x28a52e[_0x8b20('0x4a')]['id']}})[_0x8b20('0x19')](handleEntityNotFound(_0x4db3f5,null))['then'](removeEntity(_0x4db3f5,null))[_0x8b20('0x23')](handleError(_0x4db3f5,null));};exports[_0x8b20('0x4f')]=function(_0x360629,_0x282cec,_0x245640){var _0x175a13={};var _0x4ac7a2={};var _0x127627;var _0x50be07;return db[_0x8b20('0x33')][_0x8b20('0x50')]({'where':{'id':_0x360629['params']['id']}})[_0x8b20('0x19')](handleEntityNotFound(_0x282cec,null))[_0x8b20('0x19')](function(_0x603cbf){if(_0x603cbf){_0x127627=_0x603cbf;_0x4ac7a2[_0x8b20('0x37')]=_[_0x8b20('0x39')](db[_0x8b20('0x51')][_0x8b20('0x34')]);_0x4ac7a2[_0x8b20('0x38')]=_[_0x8b20('0x39')](_0x360629[_0x8b20('0x38')]);_0x4ac7a2[_0x8b20('0x42')]=_['intersection'](_0x4ac7a2['model'],_0x4ac7a2[_0x8b20('0x38')]);_0x175a13[_0x8b20('0x3b')]=_[_0x8b20('0x3a')](_0x4ac7a2[_0x8b20('0x37')],qs[_0x8b20('0x3c')](_0x360629['query'][_0x8b20('0x3c')]));_0x175a13[_0x8b20('0x3b')]=_0x175a13[_0x8b20('0x3b')][_0x8b20('0x3d')]?_0x175a13[_0x8b20('0x3b')]:_0x4ac7a2[_0x8b20('0x37')];_0x175a13[_0x8b20('0x52')]=qs['sort'](_0x360629[_0x8b20('0x38')][_0x8b20('0x40')]);_0x175a13[_0x8b20('0x41')]=qs['filters'](_[_0x8b20('0x43')](_0x360629[_0x8b20('0x38')],_0x4ac7a2[_0x8b20('0x42')]));if(_0x360629[_0x8b20('0x38')][_0x8b20('0x44')]){_0x175a13[_0x8b20('0x41')]=_[_0x8b20('0x45')](_0x175a13[_0x8b20('0x41')],{'$or':_[_0x8b20('0x32')](_0x175a13[_0x8b20('0x3b')],function(_0x1f5491){var _0x52f60f={};_0x52f60f[_0x1f5491]={'$like':'%'+_0x360629[_0x8b20('0x38')][_0x8b20('0x44')]+'%'};return _0x52f60f;})});}_0x175a13=_[_0x8b20('0x45')]({},_0x175a13,_0x360629[_0x8b20('0x47')]);return _0x127627[_0x8b20('0x4f')](_0x175a13);}})[_0x8b20('0x19')](function(_0x32d7c6){if(_0x32d7c6){_0x50be07=_0x32d7c6['length'];if(!_0x360629[_0x8b20('0x38')][_0x8b20('0x3e')](_0x8b20('0x3f'))){_0x175a13[_0x8b20('0x29')]=qs[_0x8b20('0x29')](_0x360629[_0x8b20('0x38')][_0x8b20('0x29')]);_0x175a13[_0x8b20('0x28')]=qs[_0x8b20('0x28')](_0x360629['query']['offset']);}return _0x127627[_0x8b20('0x4f')](_0x175a13);}})[_0x8b20('0x19')](function(_0x7b7744){if(_0x7b7744){return _0x7b7744?{'count':_0x50be07,'rows':_0x7b7744}:null;}})[_0x8b20('0x19')](respondWithResult(_0x282cec,null))[_0x8b20('0x23')](handleError(_0x282cec,null));};exports[_0x8b20('0x53')]=function(_0x2ad571,_0x84dba8,_0x1c76bc){var _0x1cfc2a={};var _0x2d2ee8={};var _0x1f2f69;var _0x363cc0;return db[_0x8b20('0x33')][_0x8b20('0x50')]({'where':{'id':_0x2ad571[_0x8b20('0x4a')]['id']}})[_0x8b20('0x19')](handleEntityNotFound(_0x84dba8,null))['then'](function(_0x7237ad){if(_0x7237ad){_0x1f2f69=_0x7237ad;_0x2d2ee8[_0x8b20('0x37')]=_[_0x8b20('0x39')](db[_0x8b20('0x51')][_0x8b20('0x34')]);_0x2d2ee8[_0x8b20('0x38')]=_['keys'](_0x2ad571[_0x8b20('0x38')]);_0x2d2ee8[_0x8b20('0x42')]=_['intersection'](_0x2d2ee8['model'],_0x2d2ee8['query']);_0x1cfc2a[_0x8b20('0x3b')]=_[_0x8b20('0x3a')](_0x2d2ee8[_0x8b20('0x37')],qs[_0x8b20('0x3c')](_0x2ad571[_0x8b20('0x38')][_0x8b20('0x3c')]));_0x1cfc2a[_0x8b20('0x3b')]=_0x1cfc2a[_0x8b20('0x3b')]['length']?_0x1cfc2a[_0x8b20('0x3b')]:_0x2d2ee8[_0x8b20('0x37')];_0x1cfc2a['order']=qs[_0x8b20('0x40')](_0x2ad571['query']['sort']);_0x1cfc2a['where']=qs['filters'](_[_0x8b20('0x43')](_0x2ad571['query'],_0x2d2ee8[_0x8b20('0x42')]));if(_0x2ad571[_0x8b20('0x38')]['filter']){_0x1cfc2a['where']=_[_0x8b20('0x45')](_0x1cfc2a[_0x8b20('0x41')],{'$or':_['map'](_0x1cfc2a[_0x8b20('0x3b')],function(_0x2194c4){var _0x22a240={};_0x22a240[_0x2194c4]={'$like':'%'+_0x2ad571[_0x8b20('0x38')][_0x8b20('0x44')]+'%'};return _0x22a240;})});}_0x1cfc2a=_[_0x8b20('0x45')]({},_0x1cfc2a,_0x2ad571[_0x8b20('0x47')]);return _0x1f2f69[_0x8b20('0x53')](_0x1cfc2a);}})[_0x8b20('0x19')](function(_0x1987eb){if(_0x1987eb){_0x363cc0=_0x1987eb['length'];if(!_0x2ad571[_0x8b20('0x38')][_0x8b20('0x3e')](_0x8b20('0x3f'))){_0x1cfc2a[_0x8b20('0x29')]=qs[_0x8b20('0x29')](_0x2ad571[_0x8b20('0x38')][_0x8b20('0x29')]);_0x1cfc2a[_0x8b20('0x28')]=qs[_0x8b20('0x28')](_0x2ad571['query'][_0x8b20('0x28')]);}return _0x1f2f69[_0x8b20('0x53')](_0x1cfc2a);}})[_0x8b20('0x19')](function(_0x378b60){if(_0x378b60){return _0x378b60?{'count':_0x363cc0,'rows':_0x378b60}:null;}})['then'](respondWithResult(_0x84dba8,null))[_0x8b20('0x23')](handleError(_0x84dba8,null));};exports[_0x8b20('0x54')]=function(_0x56df6d,_0x591b6c,_0x5a81a2){var _0x5a4c8d={};var _0x2a1b43={};var _0x36bcd6;var _0x4a0c9b;return db[_0x8b20('0x33')][_0x8b20('0x50')]({'where':{'id':_0x56df6d[_0x8b20('0x4a')]['id']}})[_0x8b20('0x19')](handleEntityNotFound(_0x591b6c,null))[_0x8b20('0x19')](function(_0x237dd0){if(_0x237dd0){_0x36bcd6=_0x237dd0;_0x2a1b43[_0x8b20('0x37')]=_['keys'](db[_0x8b20('0x51')][_0x8b20('0x34')]);_0x2a1b43[_0x8b20('0x38')]=_[_0x8b20('0x39')](_0x56df6d[_0x8b20('0x38')]);_0x2a1b43[_0x8b20('0x42')]=_[_0x8b20('0x3a')](_0x2a1b43[_0x8b20('0x37')],_0x2a1b43[_0x8b20('0x38')]);_0x5a4c8d[_0x8b20('0x3b')]=_['intersection'](_0x2a1b43[_0x8b20('0x37')],qs['fields'](_0x56df6d[_0x8b20('0x38')]['fields']));_0x5a4c8d[_0x8b20('0x3b')]=_0x5a4c8d['attributes'][_0x8b20('0x3d')]?_0x5a4c8d[_0x8b20('0x3b')]:_0x2a1b43[_0x8b20('0x37')];_0x5a4c8d[_0x8b20('0x52')]=qs[_0x8b20('0x40')](_0x56df6d[_0x8b20('0x38')][_0x8b20('0x40')]);_0x5a4c8d['where']=qs['filters'](_[_0x8b20('0x43')](_0x56df6d['query'],_0x2a1b43[_0x8b20('0x42')]));if(_0x56df6d[_0x8b20('0x38')][_0x8b20('0x44')]){_0x5a4c8d[_0x8b20('0x41')]=_[_0x8b20('0x45')](_0x5a4c8d[_0x8b20('0x41')],{'$or':_[_0x8b20('0x32')](_0x5a4c8d[_0x8b20('0x3b')],function(_0x1b41f5){var _0x221acf={};_0x221acf[_0x1b41f5]={'$like':'%'+_0x56df6d['query'][_0x8b20('0x44')]+'%'};return _0x221acf;})});}_0x5a4c8d=_[_0x8b20('0x45')]({},_0x5a4c8d,_0x56df6d[_0x8b20('0x47')]);return _0x36bcd6[_0x8b20('0x54')](_0x5a4c8d);}})[_0x8b20('0x19')](function(_0xa5ceb){if(_0xa5ceb){_0x4a0c9b=_0xa5ceb['length'];if(!_0x56df6d[_0x8b20('0x38')][_0x8b20('0x3e')](_0x8b20('0x3f'))){_0x5a4c8d[_0x8b20('0x29')]=qs[_0x8b20('0x29')](_0x56df6d[_0x8b20('0x38')][_0x8b20('0x29')]);_0x5a4c8d[_0x8b20('0x28')]=qs[_0x8b20('0x28')](_0x56df6d[_0x8b20('0x38')][_0x8b20('0x28')]);}return _0x36bcd6['getDescriptions'](_0x5a4c8d);}})[_0x8b20('0x19')](function(_0x1e9a19){if(_0x1e9a19){return _0x1e9a19?{'count':_0x4a0c9b,'rows':_0x1e9a19}:null;}})['then'](respondWithResult(_0x591b6c,null))[_0x8b20('0x23')](handleError(_0x591b6c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index cf12b32..e0036cc 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 _0x8a41=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intServicenowConfiguration.attributes','define'];(function(_0x40f9c0,_0x458553){var _0x20ebc5=function(_0x701f67){while(--_0x701f67){_0x40f9c0['push'](_0x40f9c0['shift']());}};_0x20ebc5(++_0x458553);}(_0x8a41,0xda));var _0x18a4=function(_0x30faac,_0x131760){_0x30faac=_0x30faac-0x0;var _0x544192=_0x8a41[_0x30faac];return _0x544192;};'use strict';var _=require(_0x18a4('0x0'));var util=require(_0x18a4('0x1'));var logger=require(_0x18a4('0x2'))(_0x18a4('0x3'));var moment=require(_0x18a4('0x4'));var BPromise=require('bluebird');var rp=require(_0x18a4('0x5'));var fs=require('fs');var path=require(_0x18a4('0x6'));var rimraf=require(_0x18a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x18a4('0x8'));module['exports']=function(_0x7dceaa,_0x5c8685){return _0x7dceaa[_0x18a4('0x9')](_0x18a4('0xa'),attributes,{'tableName':_0x18a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c29=['exports','ServicenowConfiguration','util','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x4c29,0xe8));var _0x94c2=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x4c29[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0x94c2('0x0'));var logger=require('../../config/logger')(_0x94c2('0x1'));var moment=require(_0x94c2('0x2'));var BPromise=require(_0x94c2('0x3'));var rp=require(_0x94c2('0x4'));var fs=require('fs');var path=require(_0x94c2('0x5'));var rimraf=require('rimraf');var config=require(_0x94c2('0x6'));var attributes=require(_0x94c2('0x7'));module[_0x94c2('0x8')]=function(_0x30ca85,_0x48b799){return _0x30ca85['define'](_0x94c2('0x9'),attributes,{'tableName':'int_servicenow_configurations','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 670e4ca..26c4c83 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 _0x5a05=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment'];(function(_0x41df77,_0x108ad2){var _0x4a0097=function(_0x53467f){while(--_0x53467f){_0x41df77['push'](_0x41df77['shift']());}};_0x4a0097(++_0x108ad2);}(_0x5a05,0x1f1));var _0x55a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a05[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x55a0('0x0'));var util=require(_0x55a0('0x1'));var moment=require(_0x55a0('0x2'));var BPromise=require(_0x55a0('0x3'));var rs=require(_0x55a0('0x4'));var fs=require('fs');var Redis=require(_0x55a0('0x5'));var db=require(_0x55a0('0x6'))['db'];var utils=require(_0x55a0('0x7'));var logger=require(_0x55a0('0x8'))(_0x55a0('0x9'));var config=require(_0x55a0('0xa'));var jayson=require(_0x55a0('0xb'));var client=jayson[_0x55a0('0xc')][_0x55a0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x42aed6,_0x26ca5e,_0x825051){return new BPromise(function(_0x4ffad0,_0x375fc7){return client[_0x55a0('0xe')](_0x42aed6,_0x825051)[_0x55a0('0xf')](function(_0x140693){logger[_0x55a0('0x10')](_0x55a0('0x11'),_0x26ca5e,_0x55a0('0x12'));logger[_0x55a0('0x13')](_0x55a0('0x14'),_0x26ca5e,'request\x20sent',JSON[_0x55a0('0x15')](_0x140693));if(_0x140693[_0x55a0('0x16')]){if(_0x140693[_0x55a0('0x16')]['code']===0x1f4){logger['error'](_0x55a0('0x11'),_0x26ca5e,_0x140693[_0x55a0('0x16')]['message']);return _0x375fc7(_0x140693[_0x55a0('0x16')]['message']);}logger[_0x55a0('0x16')]('ServicenowConfiguration,\x20%s,\x20%s',_0x26ca5e,_0x140693[_0x55a0('0x16')][_0x55a0('0x17')]);return _0x4ffad0(_0x140693[_0x55a0('0x16')]['message']);}else{logger[_0x55a0('0x10')](_0x55a0('0x11'),_0x26ca5e,_0x55a0('0x12'));_0x4ffad0(_0x140693[_0x55a0('0x18')]['message']);}})['catch'](function(_0x4fbd3c){logger[_0x55a0('0x16')]('ServicenowConfiguration,\x20%s,\x20%s',_0x26ca5e,_0x4fbd3c);_0x375fc7(_0x4fbd3c);});});} \ No newline at end of file +var _0x5ca9=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3595ba,_0xf3dc4c){var _0x25632d=function(_0x3b79f2){while(--_0x3b79f2){_0x3595ba['push'](_0x3595ba['shift']());}};_0x25632d(++_0xf3dc4c);}(_0x5ca9,0xa8));var _0x95ca=function(_0x3dfb70,_0x13c956){_0x3dfb70=_0x3dfb70-0x0;var _0x7b7644=_0x5ca9[_0x3dfb70];return _0x7b7644;};'use strict';var _=require(_0x95ca('0x0'));var util=require(_0x95ca('0x1'));var moment=require(_0x95ca('0x2'));var BPromise=require('bluebird');var rs=require(_0x95ca('0x3'));var fs=require('fs');var Redis=require(_0x95ca('0x4'));var db=require(_0x95ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x95ca('0x6'))(_0x95ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x95ca('0x8'));var client=jayson[_0x95ca('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49cb4d,_0x594aa3,_0x3abca0){return new BPromise(function(_0x1d1991,_0x14dd5a){return client[_0x95ca('0xa')](_0x49cb4d,_0x3abca0)['then'](function(_0x40ec5f){logger[_0x95ca('0xb')](_0x95ca('0xc'),_0x594aa3,_0x95ca('0xd'));logger['debug'](_0x95ca('0xe'),_0x594aa3,_0x95ca('0xd'),JSON[_0x95ca('0xf')](_0x40ec5f));if(_0x40ec5f[_0x95ca('0x10')]){if(_0x40ec5f['error'][_0x95ca('0x11')]===0x1f4){logger[_0x95ca('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x594aa3,_0x40ec5f[_0x95ca('0x10')]['message']);return _0x14dd5a(_0x40ec5f['error'][_0x95ca('0x12')]);}logger[_0x95ca('0x10')](_0x95ca('0xc'),_0x594aa3,_0x40ec5f[_0x95ca('0x10')][_0x95ca('0x12')]);return _0x1d1991(_0x40ec5f['error'][_0x95ca('0x12')]);}else{logger[_0x95ca('0xb')](_0x95ca('0xc'),_0x594aa3,_0x95ca('0xd'));_0x1d1991(_0x40ec5f[_0x95ca('0x13')][_0x95ca('0x12')]);}})[_0x95ca('0x14')](function(_0x414133){logger[_0x95ca('0x10')](_0x95ca('0xc'),_0x594aa3,_0x414133);_0x14dd5a(_0x414133);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index a7680e7..c72550e 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 _0xf282=['../../config/environment','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0xf282,0x1f1));var _0x2f28=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xf282[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0x2f28('0x0'));var util=require(_0x2f28('0x1'));var path=require(_0x2f28('0x2'));var timeout=require(_0x2f28('0x3'));var express=require(_0x2f28('0x4'));var router=express[_0x2f28('0x5')]();var auth=require(_0x2f28('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2f28('0x7'));var controller=require('./intServicenowField.controller');router[_0x2f28('0x8')]('/',auth[_0x2f28('0x9')](),controller[_0x2f28('0xa')]);router['get'](_0x2f28('0xb'),auth[_0x2f28('0x9')](),controller['show']);router['post']('/',auth[_0x2f28('0x9')](),controller[_0x2f28('0xc')]);router[_0x2f28('0xd')]('/:id',auth[_0x2f28('0x9')](),controller[_0x2f28('0xe')]);router[_0x2f28('0xf')](_0x2f28('0xb'),auth[_0x2f28('0x9')](),controller[_0x2f28('0x10')]);module[_0x2f28('0x11')]=router; \ No newline at end of file +var _0xc756=['../../config/environment','./intServicenowField.controller','get','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5f4ee6,_0x2f63c2){var _0x52ec31=function(_0x2eedd7){while(--_0x2eedd7){_0x5f4ee6['push'](_0x5f4ee6['shift']());}};_0x52ec31(++_0x2f63c2);}(_0xc756,0xc0));var _0x6c75=function(_0x54a3c1,_0x3aef76){_0x54a3c1=_0x54a3c1-0x0;var _0x5c2943=_0xc756[_0x54a3c1];return _0x5c2943;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6c75('0x0'));var timeout=require(_0x6c75('0x1'));var express=require(_0x6c75('0x2'));var router=express[_0x6c75('0x3')]();var auth=require(_0x6c75('0x4'));var interaction=require(_0x6c75('0x5'));var config=require(_0x6c75('0x6'));var controller=require(_0x6c75('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6c75('0x8')](_0x6c75('0x9'),auth['isAuthenticated'](),controller[_0x6c75('0xa')]);router[_0x6c75('0xb')]('/',auth[_0x6c75('0xc')](),controller['create']);router[_0x6c75('0xd')](_0x6c75('0x9'),auth[_0x6c75('0xc')](),controller[_0x6c75('0xe')]);router[_0x6c75('0xf')]('/:id',auth[_0x6c75('0xc')](),controller[_0x6c75('0x10')]);module[_0x6c75('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index f8e0354..93d6ac4 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 _0xe3f2=['STRING','sequelize','exports','ENUM','string','customVariable','keyValue','variable'];(function(_0x91384,_0x545eef){var _0x44daa0=function(_0x5a0cc5){while(--_0x5a0cc5){_0x91384['push'](_0x91384['shift']());}};_0x44daa0(++_0x545eef);}(_0xe3f2,0x101));var _0x2e3f=function(_0x1aecb8,_0x2d4d82){_0x1aecb8=_0x1aecb8-0x0;var _0x21dc67=_0xe3f2[_0x1aecb8];return _0x21dc67;};'use strict';var Sequelize=require(_0x2e3f('0x0'));module[_0x2e3f('0x1')]={'type':{'type':Sequelize[_0x2e3f('0x2')](_0x2e3f('0x3'),'variable',_0x2e3f('0x4'),_0x2e3f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2e3f('0x2')]('string',_0x2e3f('0x6'),_0x2e3f('0x4'))},'keyContent':{'type':Sequelize[_0x2e3f('0x7')]},'idField':{'type':Sequelize[_0x2e3f('0x7')]},'nameField':{'type':Sequelize[_0x2e3f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2e3f('0x7')]}}; \ No newline at end of file +var _0x406e=['ENUM','variable','customVariable','string','STRING','BOOLEAN','sequelize'];(function(_0x34354d,_0x10a0e7){var _0x48a4bc=function(_0x38c24b){while(--_0x38c24b){_0x34354d['push'](_0x34354d['shift']());}};_0x48a4bc(++_0x10a0e7);}(_0x406e,0x16b));var _0xe406=function(_0x5b76fe,_0x156f0f){_0x5b76fe=_0x5b76fe-0x0;var _0x54ed48=_0x406e[_0x5b76fe];return _0x54ed48;};'use strict';var Sequelize=require(_0xe406('0x0'));module['exports']={'type':{'type':Sequelize[_0xe406('0x1')]('string',_0xe406('0x2'),_0xe406('0x3'),'keyValue'),'defaultValue':_0xe406('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe406('0x5')]},'keyType':{'type':Sequelize[_0xe406('0x1')](_0xe406('0x4'),_0xe406('0x2'),_0xe406('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe406('0x5')]},'nameField':{'type':Sequelize[_0xe406('0x5')]},'customField':{'type':Sequelize[_0xe406('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe406('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 1ab3efd..90ab173 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 _0xb4e0=['include','findAll','rows','params','rawAttributes','find','catch','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','then','destroy','end','stack','name','send','index','ServicenowField','fieldName','type','key','model','map','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','count','includeAll'];(function(_0x50d145,_0x4bab6e){var _0x549748=function(_0x46562a){while(--_0x46562a){_0x50d145['push'](_0x50d145['shift']());}};_0x549748(++_0x4bab6e);}(_0xb4e0,0x1a8));var _0x0b4e=function(_0x26c455,_0x3aab78){_0x26c455=_0x26c455-0x0;var _0x4be061=_0xb4e0[_0x26c455];return _0x4be061;};'use strict';var pdf=require(_0x0b4e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0b4e('0x1'));var zipdir=require(_0x0b4e('0x2'));var jsonpatch=require(_0x0b4e('0x3'));var rp=require(_0x0b4e('0x4'));var moment=require(_0x0b4e('0x5'));var BPromise=require(_0x0b4e('0x6'));var Mustache=require('mustache');var util=require(_0x0b4e('0x7'));var path=require(_0x0b4e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0b4e('0x9'));var fs=require('fs');var _=require(_0x0b4e('0xa'));var squel=require(_0x0b4e('0xb'));var crypto=require('crypto');var jsforce=require(_0x0b4e('0xc'));var deskjs=require(_0x0b4e('0xd'));var toCsv=require(_0x0b4e('0xe'));var querystring=require('querystring');var Papa=require(_0x0b4e('0xf'));var Redis=require('ioredis');var authService=require(_0x0b4e('0x10'));var qs=require(_0x0b4e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b4e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0b4e('0x13'));var config=require(_0x0b4e('0x14'));var db=require(_0x0b4e('0x15'))['db'];function respondWithStatusCode(_0x273139,_0x320bd7){_0x320bd7=_0x320bd7||0xcc;return function(_0x531ed2){if(_0x531ed2){return _0x273139[_0x0b4e('0x16')](_0x320bd7);}return _0x273139[_0x0b4e('0x17')](_0x320bd7)['end']();};}function respondWithResult(_0x5a7503,_0x18c418){_0x18c418=_0x18c418||0xc8;return function(_0x17fafd){if(_0x17fafd){return _0x5a7503['status'](_0x18c418)[_0x0b4e('0x18')](_0x17fafd);}};}function respondWithFilteredResult(_0x1329b6,_0x153f1f){return function(_0x463baf){if(_0x463baf){var _0x4aeae6=_0x463baf['count'],_0xb6d38b=_0x153f1f[_0x0b4e('0x19')],_0x293c46=_0x153f1f[_0x0b4e('0x19')]+_0x153f1f['limit'],_0x4198d5;if(_0x293c46>=_0x4aeae6){_0x293c46=_0x4aeae6;_0x4198d5=0xc8;}else{_0x4198d5=0xce;}_0x1329b6[_0x0b4e('0x17')](_0x4198d5);return _0x1329b6[_0x0b4e('0x1a')](_0x0b4e('0x1b'),_0xb6d38b+'-'+_0x293c46+'/'+_0x4aeae6)['json'](_0x463baf);}return null;};}function patchUpdates(_0x5c7e31){return function(_0x20b1fe){try{jsonpatch[_0x0b4e('0x1c')](_0x20b1fe,_0x5c7e31,!![]);}catch(_0x42dbdc){return BPromise['reject'](_0x42dbdc);}return _0x20b1fe['save']();};}function saveUpdates(_0x29b41a,_0x28fb2e){return function(_0x2afff5){if(_0x2afff5){return _0x2afff5['update'](_0x29b41a)[_0x0b4e('0x1d')](function(_0x2419ed){return _0x2419ed;});}return null;};}function removeEntity(_0xaff38a,_0x5f1685){return function(_0x5cde14){if(_0x5cde14){return _0x5cde14[_0x0b4e('0x1e')]()[_0x0b4e('0x1d')](function(){_0xaff38a[_0x0b4e('0x17')](0xcc)[_0x0b4e('0x1f')]();});}};}function handleEntityNotFound(_0x14b386,_0x2bcca5){return function(_0x4adc3e){if(!_0x4adc3e){_0x14b386[_0x0b4e('0x16')](0x194);}return _0x4adc3e;};}function handleError(_0xe163d4,_0xa960b0){_0xa960b0=_0xa960b0||0x1f4;return function(_0xe24f8b){logger['error'](_0xe24f8b[_0x0b4e('0x20')]);if(_0xe24f8b[_0x0b4e('0x21')]){delete _0xe24f8b[_0x0b4e('0x21')];}_0xe163d4['status'](_0xa960b0)[_0x0b4e('0x22')](_0xe24f8b);};}exports[_0x0b4e('0x23')]=function(_0x550aa6,_0x345d65){var _0x44638c={},_0x2cafb2={},_0x2fc4af={'count':0x0,'rows':[]};var _0x326d3e=_['map'](db[_0x0b4e('0x24')]['rawAttributes'],function(_0xfc4ddf){return{'name':_0xfc4ddf[_0x0b4e('0x25')],'type':_0xfc4ddf[_0x0b4e('0x26')][_0x0b4e('0x27')]};});_0x2cafb2[_0x0b4e('0x28')]=_[_0x0b4e('0x29')](_0x326d3e,_0x0b4e('0x21'));_0x2cafb2['query']=_[_0x0b4e('0x2a')](_0x550aa6[_0x0b4e('0x2b')]);_0x2cafb2[_0x0b4e('0x2c')]=_['intersection'](_0x2cafb2[_0x0b4e('0x28')],_0x2cafb2[_0x0b4e('0x2b')]);_0x44638c[_0x0b4e('0x2d')]=_['intersection'](_0x2cafb2[_0x0b4e('0x28')],qs[_0x0b4e('0x2e')](_0x550aa6[_0x0b4e('0x2b')][_0x0b4e('0x2e')]));_0x44638c[_0x0b4e('0x2d')]=_0x44638c[_0x0b4e('0x2d')]['length']?_0x44638c[_0x0b4e('0x2d')]:_0x2cafb2[_0x0b4e('0x28')];if(!_0x550aa6['query'][_0x0b4e('0x2f')](_0x0b4e('0x30'))){_0x44638c[_0x0b4e('0x31')]=qs[_0x0b4e('0x31')](_0x550aa6[_0x0b4e('0x2b')][_0x0b4e('0x31')]);_0x44638c[_0x0b4e('0x19')]=qs['offset'](_0x550aa6[_0x0b4e('0x2b')][_0x0b4e('0x19')]);}_0x44638c[_0x0b4e('0x32')]=qs[_0x0b4e('0x33')](_0x550aa6['query'][_0x0b4e('0x33')]);_0x44638c[_0x0b4e('0x34')]=qs['filters'](_[_0x0b4e('0x35')](_0x550aa6[_0x0b4e('0x2b')],_0x2cafb2[_0x0b4e('0x2c')]));if(_0x550aa6[_0x0b4e('0x2b')]['filter']){_0x44638c[_0x0b4e('0x34')]=_[_0x0b4e('0x36')](_0x44638c[_0x0b4e('0x34')],{'$or':_[_0x0b4e('0x29')](_0x326d3e,function(_0x416aff){if(_0x416aff[_0x0b4e('0x26')]!=='VIRTUAL'){var _0x7075fa={};_0x7075fa[_0x416aff['name']]={'$like':'%'+_0x550aa6[_0x0b4e('0x2b')][_0x0b4e('0x37')]+'%'};return _0x7075fa;}})});}_0x44638c=_[_0x0b4e('0x36')]({},_0x44638c,_0x550aa6[_0x0b4e('0x38')]);var _0x2bb94c={'where':_0x44638c[_0x0b4e('0x34')]};return db['ServicenowField'][_0x0b4e('0x39')](_0x2bb94c)[_0x0b4e('0x1d')](function(_0xf9a2de){_0x2fc4af['count']=_0xf9a2de;if(_0x550aa6[_0x0b4e('0x2b')][_0x0b4e('0x3a')]){_0x44638c[_0x0b4e('0x3b')]=[{'all':!![]}];}return db['ServicenowField'][_0x0b4e('0x3c')](_0x44638c);})[_0x0b4e('0x1d')](function(_0x3736fe){_0x2fc4af[_0x0b4e('0x3d')]=_0x3736fe;return _0x2fc4af;})[_0x0b4e('0x1d')](respondWithFilteredResult(_0x345d65,_0x44638c))['catch'](handleError(_0x345d65,null));};exports['show']=function(_0x3b7f8c,_0x21c85d){var _0x5bed04={'raw':!![],'where':{'id':_0x3b7f8c[_0x0b4e('0x3e')]['id']}},_0x5ecb81={};_0x5ecb81['model']=_[_0x0b4e('0x2a')](db[_0x0b4e('0x24')][_0x0b4e('0x3f')]);_0x5ecb81[_0x0b4e('0x2b')]=_[_0x0b4e('0x2a')](_0x3b7f8c[_0x0b4e('0x2b')]);_0x5ecb81[_0x0b4e('0x2c')]=_['intersection'](_0x5ecb81[_0x0b4e('0x28')],_0x5ecb81[_0x0b4e('0x2b')]);_0x5bed04[_0x0b4e('0x2d')]=_['intersection'](_0x5ecb81[_0x0b4e('0x28')],qs[_0x0b4e('0x2e')](_0x3b7f8c[_0x0b4e('0x2b')]['fields']));_0x5bed04[_0x0b4e('0x2d')]=_0x5bed04[_0x0b4e('0x2d')]['length']?_0x5bed04['attributes']:_0x5ecb81[_0x0b4e('0x28')];if(_0x3b7f8c['query'][_0x0b4e('0x3a')]){_0x5bed04[_0x0b4e('0x3b')]=[{'all':!![]}];}_0x5bed04=_['merge']({},_0x5bed04,_0x3b7f8c[_0x0b4e('0x38')]);return db[_0x0b4e('0x24')][_0x0b4e('0x40')](_0x5bed04)[_0x0b4e('0x1d')](handleEntityNotFound(_0x21c85d,null))[_0x0b4e('0x1d')](respondWithResult(_0x21c85d,null))[_0x0b4e('0x41')](handleError(_0x21c85d,null));};exports[_0x0b4e('0x42')]=function(_0x3f4a46,_0x24339f){return db['ServicenowField']['create'](_0x3f4a46[_0x0b4e('0x43')],{})['then'](respondWithResult(_0x24339f,0xc9))[_0x0b4e('0x41')](handleError(_0x24339f,null));};exports[_0x0b4e('0x44')]=function(_0x48a454,_0x3599bd){if(_0x48a454['body']['id']){delete _0x48a454['body']['id'];}return db[_0x0b4e('0x24')][_0x0b4e('0x40')]({'where':{'id':_0x48a454[_0x0b4e('0x3e')]['id']}})[_0x0b4e('0x1d')](handleEntityNotFound(_0x3599bd,null))['then'](saveUpdates(_0x48a454[_0x0b4e('0x43')],null))['then'](respondWithResult(_0x3599bd,null))['catch'](handleError(_0x3599bd,null));};exports[_0x0b4e('0x1e')]=function(_0x2ffb06,_0x1b61dd){return db[_0x0b4e('0x24')][_0x0b4e('0x40')]({'where':{'id':_0x2ffb06[_0x0b4e('0x3e')]['id']}})[_0x0b4e('0x1d')](handleEntityNotFound(_0x1b61dd,null))[_0x0b4e('0x1d')](removeEntity(_0x1b61dd,null))[_0x0b4e('0x41')](handleError(_0x1b61dd,null));}; \ No newline at end of file +var _0x34f6=['show','keys','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','save','update','then','destroy','error','stack','name','index','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','ServicenowField','includeAll','include','findAll','rows','catch'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0x34f6,0x19f));var _0x634f=function(_0x4f6342,_0x1c54e5){_0x4f6342=_0x4f6342-0x0;var _0xbb2867=_0x34f6[_0x4f6342];return _0xbb2867;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x634f('0x0'));var rimraf=require(_0x634f('0x1'));var zipdir=require(_0x634f('0x2'));var jsonpatch=require(_0x634f('0x3'));var rp=require(_0x634f('0x4'));var moment=require(_0x634f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x634f('0x6'));var util=require(_0x634f('0x7'));var path=require(_0x634f('0x8'));var sox=require(_0x634f('0x9'));var csv=require(_0x634f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x634f('0xb'));var squel=require(_0x634f('0xc'));var crypto=require(_0x634f('0xd'));var jsforce=require(_0x634f('0xe'));var deskjs=require(_0x634f('0xf'));var toCsv=require(_0x634f('0xa'));var querystring=require(_0x634f('0x10'));var Papa=require('papaparse');var Redis=require(_0x634f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x634f('0x12'));var as=require(_0x634f('0x13'));var hardwareService=require(_0x634f('0x14'));var logger=require('../../config/logger')(_0x634f('0x15'));var utils=require(_0x634f('0x16'));var config=require('../../config/environment');var db=require(_0x634f('0x17'))['db'];function respondWithStatusCode(_0x306682,_0x1de937){_0x1de937=_0x1de937||0xcc;return function(_0x3b6049){if(_0x3b6049){return _0x306682[_0x634f('0x18')](_0x1de937);}return _0x306682[_0x634f('0x19')](_0x1de937)[_0x634f('0x1a')]();};}function respondWithResult(_0x5ac5b0,_0x1ae891){_0x1ae891=_0x1ae891||0xc8;return function(_0xfcf21e){if(_0xfcf21e){return _0x5ac5b0['status'](_0x1ae891)[_0x634f('0x1b')](_0xfcf21e);}};}function respondWithFilteredResult(_0x465eec,_0x290663){return function(_0x38a2f0){if(_0x38a2f0){var _0x41365e=_0x38a2f0[_0x634f('0x1c')],_0x2814c9=_0x290663[_0x634f('0x1d')],_0x206335=_0x290663['offset']+_0x290663[_0x634f('0x1e')],_0x2c0b47;if(_0x206335>=_0x41365e){_0x206335=_0x41365e;_0x2c0b47=0xc8;}else{_0x2c0b47=0xce;}_0x465eec['status'](_0x2c0b47);return _0x465eec['set']('Content-Range',_0x2814c9+'-'+_0x206335+'/'+_0x41365e)[_0x634f('0x1b')](_0x38a2f0);}return null;};}function patchUpdates(_0x2b9c3c){return function(_0xb4bf1a){try{jsonpatch['apply'](_0xb4bf1a,_0x2b9c3c,!![]);}catch(_0x41183f){return BPromise['reject'](_0x41183f);}return _0xb4bf1a[_0x634f('0x1f')]();};}function saveUpdates(_0x58aeb9,_0x29bd98){return function(_0x4a6cc6){if(_0x4a6cc6){return _0x4a6cc6[_0x634f('0x20')](_0x58aeb9)[_0x634f('0x21')](function(_0x19267a){return _0x19267a;});}return null;};}function removeEntity(_0xe695fe,_0x385f3f){return function(_0x5cffdc){if(_0x5cffdc){return _0x5cffdc[_0x634f('0x22')]()[_0x634f('0x21')](function(){_0xe695fe['status'](0xcc)[_0x634f('0x1a')]();});}};}function handleEntityNotFound(_0x4b9c01,_0x220fc4){return function(_0x43761d){if(!_0x43761d){_0x4b9c01[_0x634f('0x18')](0x194);}return _0x43761d;};}function handleError(_0x957aa3,_0x50e694){_0x50e694=_0x50e694||0x1f4;return function(_0x413c6a){logger[_0x634f('0x23')](_0x413c6a[_0x634f('0x24')]);if(_0x413c6a[_0x634f('0x25')]){delete _0x413c6a[_0x634f('0x25')];}_0x957aa3[_0x634f('0x19')](_0x50e694)['send'](_0x413c6a);};}exports[_0x634f('0x26')]=function(_0x47dfe3,_0xfd3870){var _0x57de33={},_0x522e99={},_0x29ec49={'count':0x0,'rows':[]};var _0x1fb399=_[_0x634f('0x27')](db['ServicenowField']['rawAttributes'],function(_0x375f67){return{'name':_0x375f67[_0x634f('0x28')],'type':_0x375f67['type']['key']};});_0x522e99[_0x634f('0x29')]=_[_0x634f('0x27')](_0x1fb399,'name');_0x522e99[_0x634f('0x2a')]=_['keys'](_0x47dfe3[_0x634f('0x2a')]);_0x522e99[_0x634f('0x2b')]=_[_0x634f('0x2c')](_0x522e99['model'],_0x522e99['query']);_0x57de33[_0x634f('0x2d')]=_[_0x634f('0x2c')](_0x522e99[_0x634f('0x29')],qs[_0x634f('0x2e')](_0x47dfe3[_0x634f('0x2a')][_0x634f('0x2e')]));_0x57de33[_0x634f('0x2d')]=_0x57de33[_0x634f('0x2d')][_0x634f('0x2f')]?_0x57de33[_0x634f('0x2d')]:_0x522e99['model'];if(!_0x47dfe3[_0x634f('0x2a')][_0x634f('0x30')]('nolimit')){_0x57de33[_0x634f('0x1e')]=qs[_0x634f('0x1e')](_0x47dfe3['query'][_0x634f('0x1e')]);_0x57de33['offset']=qs[_0x634f('0x1d')](_0x47dfe3[_0x634f('0x2a')][_0x634f('0x1d')]);}_0x57de33[_0x634f('0x31')]=qs['sort'](_0x47dfe3[_0x634f('0x2a')][_0x634f('0x32')]);_0x57de33[_0x634f('0x33')]=qs[_0x634f('0x2b')](_[_0x634f('0x34')](_0x47dfe3[_0x634f('0x2a')],_0x522e99[_0x634f('0x2b')]));if(_0x47dfe3[_0x634f('0x2a')][_0x634f('0x35')]){_0x57de33[_0x634f('0x33')]=_[_0x634f('0x36')](_0x57de33[_0x634f('0x33')],{'$or':_[_0x634f('0x27')](_0x1fb399,function(_0x3482e3){if(_0x3482e3['type']!=='VIRTUAL'){var _0x5d41f6={};_0x5d41f6[_0x3482e3[_0x634f('0x25')]]={'$like':'%'+_0x47dfe3['query'][_0x634f('0x35')]+'%'};return _0x5d41f6;}})});}_0x57de33=_['merge']({},_0x57de33,_0x47dfe3['options']);var _0x1fd711={'where':_0x57de33[_0x634f('0x33')]};return db[_0x634f('0x37')][_0x634f('0x1c')](_0x1fd711)['then'](function(_0x529f8f){_0x29ec49['count']=_0x529f8f;if(_0x47dfe3['query'][_0x634f('0x38')]){_0x57de33[_0x634f('0x39')]=[{'all':!![]}];}return db[_0x634f('0x37')][_0x634f('0x3a')](_0x57de33);})[_0x634f('0x21')](function(_0xb1a3a4){_0x29ec49[_0x634f('0x3b')]=_0xb1a3a4;return _0x29ec49;})[_0x634f('0x21')](respondWithFilteredResult(_0xfd3870,_0x57de33))[_0x634f('0x3c')](handleError(_0xfd3870,null));};exports[_0x634f('0x3d')]=function(_0x24c225,_0x5376cf){var _0x8cbe4={'raw':!![],'where':{'id':_0x24c225['params']['id']}},_0x151436={};_0x151436[_0x634f('0x29')]=_['keys'](db[_0x634f('0x37')]['rawAttributes']);_0x151436[_0x634f('0x2a')]=_[_0x634f('0x3e')](_0x24c225[_0x634f('0x2a')]);_0x151436[_0x634f('0x2b')]=_[_0x634f('0x2c')](_0x151436[_0x634f('0x29')],_0x151436[_0x634f('0x2a')]);_0x8cbe4[_0x634f('0x2d')]=_[_0x634f('0x2c')](_0x151436[_0x634f('0x29')],qs['fields'](_0x24c225[_0x634f('0x2a')][_0x634f('0x2e')]));_0x8cbe4[_0x634f('0x2d')]=_0x8cbe4[_0x634f('0x2d')][_0x634f('0x2f')]?_0x8cbe4['attributes']:_0x151436['model'];if(_0x24c225['query'][_0x634f('0x38')]){_0x8cbe4[_0x634f('0x39')]=[{'all':!![]}];}_0x8cbe4=_[_0x634f('0x36')]({},_0x8cbe4,_0x24c225[_0x634f('0x3f')]);return db[_0x634f('0x37')][_0x634f('0x40')](_0x8cbe4)['then'](handleEntityNotFound(_0x5376cf,null))[_0x634f('0x21')](respondWithResult(_0x5376cf,null))['catch'](handleError(_0x5376cf,null));};exports[_0x634f('0x41')]=function(_0x10f514,_0x7ca5e4){return db[_0x634f('0x37')]['create'](_0x10f514[_0x634f('0x42')],{})[_0x634f('0x21')](respondWithResult(_0x7ca5e4,0xc9))[_0x634f('0x3c')](handleError(_0x7ca5e4,null));};exports['update']=function(_0x491c46,_0x49b215){if(_0x491c46[_0x634f('0x42')]['id']){delete _0x491c46[_0x634f('0x42')]['id'];}return db[_0x634f('0x37')]['find']({'where':{'id':_0x491c46[_0x634f('0x43')]['id']}})[_0x634f('0x21')](handleEntityNotFound(_0x49b215,null))[_0x634f('0x21')](saveUpdates(_0x491c46[_0x634f('0x42')],null))[_0x634f('0x21')](respondWithResult(_0x49b215,null))[_0x634f('0x3c')](handleError(_0x49b215,null));};exports[_0x634f('0x22')]=function(_0xf896d0,_0x16abea){return db['ServicenowField'][_0x634f('0x40')]({'where':{'id':_0xf896d0[_0x634f('0x43')]['id']}})[_0x634f('0x21')](handleEntityNotFound(_0x16abea,null))['then'](removeEntity(_0x16abea,null))[_0x634f('0x3c')](handleError(_0x16abea,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 386a340..3a2f423 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 _0x020b=['rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3d3c63,_0x438ef2){var _0x4eae53=function(_0x22e89e){while(--_0x22e89e){_0x3d3c63['push'](_0x3d3c63['shift']());}};_0x4eae53(++_0x438ef2);}(_0x020b,0x17b));var _0xb020=function(_0x391439,_0x1489e2){_0x391439=_0x391439-0x0;var _0x5b1798=_0x020b[_0x391439];return _0x5b1798;};'use strict';var _=require(_0xb020('0x0'));var util=require(_0xb020('0x1'));var logger=require(_0xb020('0x2'))('api');var moment=require(_0xb020('0x3'));var BPromise=require(_0xb020('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb020('0x5'));var config=require(_0xb020('0x6'));var attributes=require(_0xb020('0x7'));module[_0xb020('0x8')]=function(_0x5ab252,_0x471d99){return _0x5ab252['define'](_0xb020('0x9'),attributes,{'tableName':_0xb020('0xa'),'paranoid':![],'indexes':[{'name':_0xb020('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c91=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','lodash'];(function(_0x308ffd,_0x177246){var _0x4524a9=function(_0x435d2e){while(--_0x435d2e){_0x308ffd['push'](_0x308ffd['shift']());}};_0x4524a9(++_0x177246);}(_0x5c91,0x1a3));var _0x15c9=function(_0x4d20ba,_0x92b596){_0x4d20ba=_0x4d20ba-0x0;var _0x4824d8=_0x5c91[_0x4d20ba];return _0x4824d8;};'use strict';var _=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var logger=require(_0x15c9('0x2'))(_0x15c9('0x3'));var moment=require('moment');var BPromise=require(_0x15c9('0x4'));var rp=require(_0x15c9('0x5'));var fs=require('fs');var path=require(_0x15c9('0x6'));var rimraf=require(_0x15c9('0x7'));var config=require(_0x15c9('0x8'));var attributes=require(_0x15c9('0x9'));module[_0x15c9('0xa')]=function(_0x514b91,_0x52d915){return _0x514b91[_0x15c9('0xb')](_0x15c9('0xc'),attributes,{'tableName':_0x15c9('0xd'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 2d33e77..546b3d9 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 _0x553a=['code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x51da41,_0x7a9e11){var _0x454afb=function(_0x5c3b21){while(--_0x5c3b21){_0x51da41['push'](_0x51da41['shift']());}};_0x454afb(++_0x7a9e11);}(_0x553a,0x164));var _0xa553=function(_0x4855fa,_0x490cf3){_0x4855fa=_0x4855fa-0x0;var _0x4b7a91=_0x553a[_0x4855fa];return _0x4b7a91;};'use strict';var _=require('lodash');var util=require(_0xa553('0x0'));var moment=require(_0xa553('0x1'));var BPromise=require(_0xa553('0x2'));var rs=require(_0xa553('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa553('0x4'))['db'];var utils=require(_0xa553('0x5'));var logger=require(_0xa553('0x6'))(_0xa553('0x7'));var config=require(_0xa553('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa553('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x587d84,_0xa73bb4,_0x157f5d){return new BPromise(function(_0x2c1e69,_0x3ea4c8){return client[_0xa553('0xa')](_0x587d84,_0x157f5d)[_0xa553('0xb')](function(_0x4bf3ec){logger['info'](_0xa553('0xc'),_0xa73bb4,_0xa553('0xd'));logger[_0xa553('0xe')](_0xa553('0xf'),_0xa73bb4,'request\x20sent',JSON[_0xa553('0x10')](_0x4bf3ec));if(_0x4bf3ec[_0xa553('0x11')]){if(_0x4bf3ec[_0xa553('0x11')][_0xa553('0x12')]===0x1f4){logger[_0xa553('0x11')](_0xa553('0xc'),_0xa73bb4,_0x4bf3ec[_0xa553('0x11')][_0xa553('0x13')]);return _0x3ea4c8(_0x4bf3ec[_0xa553('0x11')][_0xa553('0x13')]);}logger[_0xa553('0x11')]('ServicenowField,\x20%s,\x20%s',_0xa73bb4,_0x4bf3ec[_0xa553('0x11')][_0xa553('0x13')]);return _0x2c1e69(_0x4bf3ec['error'][_0xa553('0x13')]);}else{logger[_0xa553('0x14')](_0xa553('0xc'),_0xa73bb4,_0xa553('0xd'));_0x2c1e69(_0x4bf3ec[_0xa553('0x15')][_0xa553('0x13')]);}})['catch'](function(_0x30f7d5){logger[_0xa553('0x11')](_0xa553('0xc'),_0xa73bb4,_0x30f7d5);_0x3ea4c8(_0x30f7d5);});});} \ No newline at end of file +var _0x3a66=['../../config/environment','jayson/promise','http','request','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x9fa2fd,_0x4bc326){var _0x366e80=function(_0x282f5e){while(--_0x282f5e){_0x9fa2fd['push'](_0x9fa2fd['shift']());}};_0x366e80(++_0x4bc326);}(_0x3a66,0xb7));var _0x63a6=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0x3a66[_0x456b57];return _0x18f49f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x63a6('0x0'));var fs=require('fs');var Redis=require(_0x63a6('0x1'));var db=require(_0x63a6('0x2'))['db'];var utils=require(_0x63a6('0x3'));var logger=require(_0x63a6('0x4'))(_0x63a6('0x5'));var config=require(_0x63a6('0x6'));var jayson=require(_0x63a6('0x7'));var client=jayson['client'][_0x63a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e6eb0,_0x11761f,_0x1210f5){return new BPromise(function(_0x2ee50d,_0x5973ab){return client[_0x63a6('0x9')](_0x3e6eb0,_0x1210f5)['then'](function(_0x25e27a){logger['info'](_0x63a6('0xa'),_0x11761f,_0x63a6('0xb'));logger[_0x63a6('0xc')](_0x63a6('0xd'),_0x11761f,_0x63a6('0xb'),JSON[_0x63a6('0xe')](_0x25e27a));if(_0x25e27a[_0x63a6('0xf')]){if(_0x25e27a[_0x63a6('0xf')][_0x63a6('0x10')]===0x1f4){logger[_0x63a6('0xf')](_0x63a6('0xa'),_0x11761f,_0x25e27a[_0x63a6('0xf')][_0x63a6('0x11')]);return _0x5973ab(_0x25e27a[_0x63a6('0xf')][_0x63a6('0x11')]);}logger[_0x63a6('0xf')](_0x63a6('0xa'),_0x11761f,_0x25e27a[_0x63a6('0xf')][_0x63a6('0x11')]);return _0x2ee50d(_0x25e27a[_0x63a6('0xf')][_0x63a6('0x11')]);}else{logger[_0x63a6('0x12')]('ServicenowField,\x20%s,\x20%s',_0x11761f,_0x63a6('0xb'));_0x2ee50d(_0x25e27a[_0x63a6('0x13')][_0x63a6('0x11')]);}})[_0x63a6('0x14')](function(_0x38b3f1){logger[_0x63a6('0xf')](_0x63a6('0xa'),_0x11761f,_0x38b3f1);_0x5973ab(_0x38b3f1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 512abcb..18c4310 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 _0x8e5a=['index','/:id','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated'];(function(_0x4e4aaf,_0x20dbb7){var _0x35f109=function(_0x3890a1){while(--_0x3890a1){_0x4e4aaf['push'](_0x4e4aaf['shift']());}};_0x35f109(++_0x20dbb7);}(_0x8e5a,0x113));var _0xa8e5=function(_0x4693b3,_0x3c6610){_0x4693b3=_0x4693b3-0x0;var _0xd7d291=_0x8e5a[_0x4693b3];return _0xd7d291;};'use strict';var multer=require(_0xa8e5('0x0'));var util=require(_0xa8e5('0x1'));var path=require(_0xa8e5('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8e5('0x3'));var router=express[_0xa8e5('0x4')]();var auth=require(_0xa8e5('0x5'));var interaction=require(_0xa8e5('0x6'));var config=require(_0xa8e5('0x7'));var controller=require(_0xa8e5('0x8'));router[_0xa8e5('0x9')]('/',auth[_0xa8e5('0xa')](),controller[_0xa8e5('0xb')]);router[_0xa8e5('0x9')](_0xa8e5('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa8e5('0x9')](_0xa8e5('0xd'),auth[_0xa8e5('0xa')](),controller['getConfigurations']);router[_0xa8e5('0x9')](_0xa8e5('0xe'),auth[_0xa8e5('0xa')](),controller[_0xa8e5('0xf')]);router[_0xa8e5('0x10')]('/',auth[_0xa8e5('0xa')](),controller['create']);router[_0xa8e5('0x10')](_0xa8e5('0xd'),auth[_0xa8e5('0xa')](),controller[_0xa8e5('0x11')]);router[_0xa8e5('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa8e5('0x13')]);router[_0xa8e5('0x14')](_0xa8e5('0xc'),auth[_0xa8e5('0xa')](),controller[_0xa8e5('0x15')]);module['exports']=router; \ No newline at end of file +var _0x65b3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x42a14d,_0xf9447c){var _0x4abece=function(_0x3b62a1){while(--_0x3b62a1){_0x42a14d['push'](_0x42a14d['shift']());}};_0x4abece(++_0xf9447c);}(_0x65b3,0xe4));var _0x365b=function(_0x54d49e,_0x5d9911){_0x54d49e=_0x54d49e-0x0;var _0x4af0f1=_0x65b3[_0x54d49e];return _0x4af0f1;};'use strict';var multer=require(_0x365b('0x0'));var util=require(_0x365b('0x1'));var path=require(_0x365b('0x2'));var timeout=require(_0x365b('0x3'));var express=require(_0x365b('0x4'));var router=express[_0x365b('0x5')]();var auth=require(_0x365b('0x6'));var interaction=require(_0x365b('0x7'));var config=require(_0x365b('0x8'));var controller=require(_0x365b('0x9'));router[_0x365b('0xa')]('/',auth[_0x365b('0xb')](),controller[_0x365b('0xc')]);router[_0x365b('0xa')](_0x365b('0xd'),auth[_0x365b('0xb')](),controller[_0x365b('0xe')]);router[_0x365b('0xa')]('/:id/configurations',auth[_0x365b('0xb')](),controller[_0x365b('0xf')]);router[_0x365b('0xa')](_0x365b('0x10'),auth['isAuthenticated'](),controller[_0x365b('0x11')]);router[_0x365b('0x12')]('/',auth[_0x365b('0xb')](),controller['create']);router[_0x365b('0x12')](_0x365b('0x13'),auth[_0x365b('0xb')](),controller[_0x365b('0x14')]);router[_0x365b('0x15')]('/:id',auth[_0x365b('0xb')](),controller[_0x365b('0x16')]);router[_0x365b('0x17')](_0x365b('0xd'),auth[_0x365b('0xb')](),controller[_0x365b('0x18')]);module[_0x365b('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 1318db0..4acbefd 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 _0x761e=['STRING','username','sequelize','exports'];(function(_0x70ec26,_0x177224){var _0x820d9c=function(_0xc81b77){while(--_0xc81b77){_0x70ec26['push'](_0x70ec26['shift']());}};_0x820d9c(++_0x177224);}(_0x761e,0x14e));var _0xe761=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x761e[_0x31b5b2];return _0x364f13;};'use strict';var Sequelize=require(_0xe761('0x0'));module[_0xe761('0x1')]={'name':{'type':Sequelize[_0xe761('0x2')]},'description':{'type':Sequelize[_0xe761('0x2')]},'username':{'type':Sequelize[_0xe761('0x2')],'unique':_0xe761('0x3')},'password':{'type':Sequelize[_0xe761('0x2')]},'remoteUri':{'type':Sequelize[_0xe761('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb041=['STRING','username','remoteUri'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb041,0x99));var _0x1b04=function(_0x3f9a46,_0x3a6d69){_0x3f9a46=_0x3f9a46-0x0;var _0x305841=_0xb041[_0x3f9a46];return _0x305841;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1b04('0x0')]},'description':{'type':Sequelize[_0x1b04('0x0')]},'username':{'type':Sequelize[_0x1b04('0x0')],'unique':_0x1b04('0x1')},'password':{'type':Sequelize[_0x1b04('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1b04('0x2')},'serverUrl':{'type':Sequelize[_0x1b04('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 9982cc9..1111d07 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 _0xbb74=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','count','offset','limit','set','json','save','update','destroy','stack','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','find','create','body','params','getConfigurations','SugarcrmConfiguration','hasOwnProperty','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_type','direction','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','format','get_module_fields','values','module_fields','remove','endsWith','value','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb74,0xf7));var _0x4bb7=function(_0x2f8c1e,_0x41ff15){_0x2f8c1e=_0x2f8c1e-0x0;var _0xdc6df1=_0xbb74[_0x2f8c1e];return _0xdc6df1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4bb7('0x0'));var zipdir=require(_0x4bb7('0x1'));var jsonpatch=require(_0x4bb7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4bb7('0x3'));var util=require(_0x4bb7('0x4'));var path=require(_0x4bb7('0x5'));var sox=require(_0x4bb7('0x6'));var csv=require('to-csv');var ejs=require(_0x4bb7('0x7'));var fs=require('fs');var _=require(_0x4bb7('0x8'));var squel=require(_0x4bb7('0x9'));var crypto=require(_0x4bb7('0xa'));var jsforce=require(_0x4bb7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4bb7('0xc'));var querystring=require(_0x4bb7('0xd'));var Papa=require(_0x4bb7('0xe'));var Redis=require('ioredis');var authService=require(_0x4bb7('0xf'));var qs=require(_0x4bb7('0x10'));var as=require(_0x4bb7('0x11'));var hardwareService=require(_0x4bb7('0x12'));var logger=require(_0x4bb7('0x13'))(_0x4bb7('0x14'));var utils=require(_0x4bb7('0x15'));var config=require(_0x4bb7('0x16'));var db=require(_0x4bb7('0x17'))['db'];var integrations=require(_0x4bb7('0x18'));var jayson=require(_0x4bb7('0x19'));var client=jayson['client'][_0x4bb7('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x332789,_0x49f138,_0x24b1e9){if(_0x24b1e9){var _0x394555=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x394555[_0x4bb7('0x1b')](_0x49f138)){return _0x332789;}else{throw new db[(_0x4bb7('0x1c'))][(_0x4bb7('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x332789;}}function respondWithRpcPromise(_0x41c544,_0xcc002,_0x10522c,_0x2bc88b){return new BPromise(function(_0x1d7335,_0x34cd09){var _0x98b8ff=_0x2bc88b||client;return _0x98b8ff[_0x4bb7('0x1e')](_0x41c544,_0x10522c)[_0x4bb7('0x1f')](function(_0x61c0be){logger[_0x4bb7('0x20')](_0x4bb7('0x21'),_0xcc002,'request\x20sent');logger[_0x4bb7('0x22')](_0x4bb7('0x23'),_0xcc002,'request\x20sent',JSON[_0x4bb7('0x24')](_0x61c0be));if(_0x61c0be[_0x4bb7('0x25')]){if(_0x61c0be[_0x4bb7('0x25')][_0x4bb7('0x26')]===0x1f4){logger[_0x4bb7('0x25')]('SugarcrmAccount,\x20%s,\x20%s',_0xcc002,_0x61c0be['error'][_0x4bb7('0x27')]);return _0x34cd09(_0x61c0be[_0x4bb7('0x25')][_0x4bb7('0x27')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0xcc002,_0x61c0be[_0x4bb7('0x25')][_0x4bb7('0x27')]);return _0x1d7335(_0x61c0be[_0x4bb7('0x25')][_0x4bb7('0x27')]);}else{logger[_0x4bb7('0x20')](_0x4bb7('0x21'),_0xcc002,_0x4bb7('0x28'));_0x1d7335(_0x61c0be[_0x4bb7('0x29')]['message']);}})[_0x4bb7('0x2a')](function(_0x43feab){logger[_0x4bb7('0x25')](_0x4bb7('0x21'),_0xcc002,_0x43feab);_0x34cd09(_0x43feab);});});}function respondWithStatusCode(_0x204301,_0x1a3d50){_0x1a3d50=_0x1a3d50||0xcc;return function(_0x53b3af){if(_0x53b3af){return _0x204301[_0x4bb7('0x2b')](_0x1a3d50);}return _0x204301[_0x4bb7('0x2c')](_0x1a3d50)[_0x4bb7('0x2d')]();};}function respondWithResult(_0x33afd4,_0x402f5e){_0x402f5e=_0x402f5e||0xc8;return function(_0x359bb9){if(_0x359bb9){return _0x33afd4[_0x4bb7('0x2c')](_0x402f5e)['json'](_0x359bb9);}};}function respondWithFilteredResult(_0x35bee1,_0x4ff94b){return function(_0x3ab5b8){if(_0x3ab5b8){var _0x2919bf=_0x3ab5b8[_0x4bb7('0x2e')],_0x4ef8c4=_0x4ff94b[_0x4bb7('0x2f')],_0x6e594b=_0x4ff94b[_0x4bb7('0x2f')]+_0x4ff94b[_0x4bb7('0x30')],_0x458df5;if(_0x6e594b>=_0x2919bf){_0x6e594b=_0x2919bf;_0x458df5=0xc8;}else{_0x458df5=0xce;}_0x35bee1[_0x4bb7('0x2c')](_0x458df5);return _0x35bee1[_0x4bb7('0x31')]('Content-Range',_0x4ef8c4+'-'+_0x6e594b+'/'+_0x2919bf)[_0x4bb7('0x32')](_0x3ab5b8);}return null;};}function patchUpdates(_0x4b6499){return function(_0x5f05b2){try{jsonpatch['apply'](_0x5f05b2,_0x4b6499,!![]);}catch(_0x4f470c){return BPromise['reject'](_0x4f470c);}return _0x5f05b2[_0x4bb7('0x33')]();};}function saveUpdates(_0xc449b0,_0x4adb42){return function(_0x49db4d){if(_0x49db4d){return _0x49db4d[_0x4bb7('0x34')](_0xc449b0)[_0x4bb7('0x1f')](function(_0x4eaa55){return _0x4eaa55;});}return null;};}function removeEntity(_0x4672c7,_0x1afff8){return function(_0x5eda1a){if(_0x5eda1a){return _0x5eda1a[_0x4bb7('0x35')]()['then'](function(){_0x4672c7[_0x4bb7('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46fb09,_0x4bbd25){return function(_0x4df1c9){if(!_0x4df1c9){_0x46fb09['sendStatus'](0x194);}return _0x4df1c9;};}function handleError(_0x33ee03,_0x1c64cc){_0x1c64cc=_0x1c64cc||0x1f4;return function(_0x32d09d){logger[_0x4bb7('0x25')](_0x32d09d[_0x4bb7('0x36')]);if(_0x32d09d[_0x4bb7('0x37')]){delete _0x32d09d[_0x4bb7('0x37')];}_0x33ee03[_0x4bb7('0x2c')](_0x1c64cc)[_0x4bb7('0x38')](_0x32d09d);};}exports[_0x4bb7('0x39')]=function(_0x53cd40,_0x2e7424){var _0x212a88={},_0xf51027={},_0x3df075={'count':0x0,'rows':[]};var _0x4f4609=_[_0x4bb7('0x3a')](db[_0x4bb7('0x3b')][_0x4bb7('0x3c')],function(_0x50eda){return{'name':_0x50eda['fieldName'],'type':_0x50eda[_0x4bb7('0x3d')][_0x4bb7('0x3e')]};});_0xf51027['model']=_[_0x4bb7('0x3a')](_0x4f4609,_0x4bb7('0x37'));_0xf51027['query']=_[_0x4bb7('0x3f')](_0x53cd40['query']);_0xf51027[_0x4bb7('0x40')]=_[_0x4bb7('0x41')](_0xf51027[_0x4bb7('0x42')],_0xf51027[_0x4bb7('0x43')]);_0x212a88[_0x4bb7('0x44')]=_['intersection'](_0xf51027['model'],qs[_0x4bb7('0x45')](_0x53cd40[_0x4bb7('0x43')][_0x4bb7('0x45')]));_0x212a88[_0x4bb7('0x44')]=_0x212a88[_0x4bb7('0x44')][_0x4bb7('0x46')]?_0x212a88[_0x4bb7('0x44')]:_0xf51027[_0x4bb7('0x42')];if(!_0x53cd40[_0x4bb7('0x43')]['hasOwnProperty'](_0x4bb7('0x47'))){_0x212a88[_0x4bb7('0x30')]=qs['limit'](_0x53cd40[_0x4bb7('0x43')][_0x4bb7('0x30')]);_0x212a88[_0x4bb7('0x2f')]=qs['offset'](_0x53cd40[_0x4bb7('0x43')][_0x4bb7('0x2f')]);}_0x212a88[_0x4bb7('0x48')]=qs[_0x4bb7('0x49')](_0x53cd40['query'][_0x4bb7('0x49')]);_0x212a88[_0x4bb7('0x4a')]=qs[_0x4bb7('0x40')](_[_0x4bb7('0x4b')](_0x53cd40['query'],_0xf51027[_0x4bb7('0x40')]));if(_0x53cd40[_0x4bb7('0x43')][_0x4bb7('0x4c')]){_0x212a88['where']=_[_0x4bb7('0x4d')](_0x212a88[_0x4bb7('0x4a')],{'$or':_['map'](_0x4f4609,function(_0x2cff73){if(_0x2cff73[_0x4bb7('0x3d')]!==_0x4bb7('0x4e')){var _0x1f284f={};_0x1f284f[_0x2cff73[_0x4bb7('0x37')]]={'$like':'%'+_0x53cd40['query'][_0x4bb7('0x4c')]+'%'};return _0x1f284f;}})});}_0x212a88=_[_0x4bb7('0x4d')]({},_0x212a88,_0x53cd40[_0x4bb7('0x4f')]);var _0x33c8af={'where':_0x212a88['where']};return db[_0x4bb7('0x3b')][_0x4bb7('0x2e')](_0x33c8af)[_0x4bb7('0x1f')](function(_0x498220){_0x3df075['count']=_0x498220;if(_0x53cd40[_0x4bb7('0x43')][_0x4bb7('0x50')]){_0x212a88[_0x4bb7('0x51')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x212a88);})[_0x4bb7('0x1f')](function(_0x416616){_0x3df075['rows']=_0x416616;return _0x3df075;})['then'](respondWithFilteredResult(_0x2e7424,_0x212a88))[_0x4bb7('0x2a')](handleError(_0x2e7424,null));};exports[_0x4bb7('0x52')]=function(_0x883d8f,_0x2692a1){var _0x4a8585={'raw':![],'where':{'id':_0x883d8f['params']['id']}},_0x3f45e2={};_0x3f45e2[_0x4bb7('0x42')]=_[_0x4bb7('0x3f')](db[_0x4bb7('0x3b')][_0x4bb7('0x3c')]);_0x3f45e2['query']=_['keys'](_0x883d8f[_0x4bb7('0x43')]);_0x3f45e2['filters']=_[_0x4bb7('0x41')](_0x3f45e2[_0x4bb7('0x42')],_0x3f45e2['query']);_0x4a8585[_0x4bb7('0x44')]=_[_0x4bb7('0x41')](_0x3f45e2[_0x4bb7('0x42')],qs[_0x4bb7('0x45')](_0x883d8f[_0x4bb7('0x43')][_0x4bb7('0x45')]));_0x4a8585[_0x4bb7('0x44')]=_0x4a8585[_0x4bb7('0x44')][_0x4bb7('0x46')]?_0x4a8585[_0x4bb7('0x44')]:_0x3f45e2['model'];if(_0x883d8f[_0x4bb7('0x43')][_0x4bb7('0x50')]){_0x4a8585[_0x4bb7('0x51')]=[{'all':!![]}];}_0x4a8585=_[_0x4bb7('0x4d')]({},_0x4a8585,_0x883d8f[_0x4bb7('0x4f')]);return db[_0x4bb7('0x3b')][_0x4bb7('0x53')](_0x4a8585)[_0x4bb7('0x1f')](handleEntityNotFound(_0x2692a1,null))[_0x4bb7('0x1f')](respondWithResult(_0x2692a1,null))[_0x4bb7('0x2a')](handleError(_0x2692a1,null));};exports[_0x4bb7('0x54')]=function(_0x1b1982,_0x599b88){return db[_0x4bb7('0x3b')][_0x4bb7('0x54')](_0x1b1982[_0x4bb7('0x55')],{})[_0x4bb7('0x1f')](respondWithResult(_0x599b88,0xc9))[_0x4bb7('0x2a')](handleError(_0x599b88,null));};exports[_0x4bb7('0x34')]=function(_0x27bff3,_0x2bbb7e){if(_0x27bff3[_0x4bb7('0x55')]['id']){delete _0x27bff3[_0x4bb7('0x55')]['id'];}return db[_0x4bb7('0x3b')][_0x4bb7('0x53')]({'where':{'id':_0x27bff3[_0x4bb7('0x56')]['id']}})[_0x4bb7('0x1f')](handleEntityNotFound(_0x2bbb7e,null))[_0x4bb7('0x1f')](saveUpdates(_0x27bff3['body'],null))['then'](respondWithResult(_0x2bbb7e,null))[_0x4bb7('0x2a')](handleError(_0x2bbb7e,null));};exports['destroy']=function(_0x235282,_0x168c1d){return db['SugarcrmAccount'][_0x4bb7('0x53')]({'where':{'id':_0x235282['params']['id']}})[_0x4bb7('0x1f')](handleEntityNotFound(_0x168c1d,null))[_0x4bb7('0x1f')](removeEntity(_0x168c1d,null))[_0x4bb7('0x2a')](handleError(_0x168c1d,null));};exports[_0x4bb7('0x57')]=function(_0x23db31,_0x1048bf,_0x33e236){var _0x5806df={};var _0x56d0d5={};var _0x3822d3;var _0x553a5d;return db[_0x4bb7('0x3b')]['findOne']({'where':{'id':_0x23db31['params']['id']}})[_0x4bb7('0x1f')](handleEntityNotFound(_0x1048bf,null))['then'](function(_0x1dbc7b){if(_0x1dbc7b){_0x3822d3=_0x1dbc7b;_0x56d0d5['model']=_[_0x4bb7('0x3f')](db[_0x4bb7('0x58')][_0x4bb7('0x3c')]);_0x56d0d5['query']=_['keys'](_0x23db31['query']);_0x56d0d5[_0x4bb7('0x40')]=_[_0x4bb7('0x41')](_0x56d0d5[_0x4bb7('0x42')],_0x56d0d5[_0x4bb7('0x43')]);_0x5806df['attributes']=_[_0x4bb7('0x41')](_0x56d0d5[_0x4bb7('0x42')],qs[_0x4bb7('0x45')](_0x23db31['query']['fields']));_0x5806df[_0x4bb7('0x44')]=_0x5806df[_0x4bb7('0x44')][_0x4bb7('0x46')]?_0x5806df[_0x4bb7('0x44')]:_0x56d0d5[_0x4bb7('0x42')];_0x5806df[_0x4bb7('0x48')]=qs[_0x4bb7('0x49')](_0x23db31[_0x4bb7('0x43')]['sort']);_0x5806df[_0x4bb7('0x4a')]=qs[_0x4bb7('0x40')](_[_0x4bb7('0x4b')](_0x23db31[_0x4bb7('0x43')],_0x56d0d5['filters']));if(_0x23db31['query'][_0x4bb7('0x4c')]){_0x5806df[_0x4bb7('0x4a')]=_['merge'](_0x5806df[_0x4bb7('0x4a')],{'$or':_[_0x4bb7('0x3a')](_0x5806df[_0x4bb7('0x44')],function(_0x1976b2){var _0x7a12a={};_0x7a12a[_0x1976b2]={'$like':'%'+_0x23db31['query'][_0x4bb7('0x4c')]+'%'};return _0x7a12a;})});}_0x5806df=_[_0x4bb7('0x4d')]({},_0x5806df,_0x23db31['options']);return _0x3822d3[_0x4bb7('0x57')](_0x5806df);}})['then'](function(_0x7866a9){if(_0x7866a9){_0x553a5d=_0x7866a9[_0x4bb7('0x46')];if(!_0x23db31[_0x4bb7('0x43')][_0x4bb7('0x59')]('nolimit')){_0x5806df['limit']=qs[_0x4bb7('0x30')](_0x23db31[_0x4bb7('0x43')]['limit']);_0x5806df[_0x4bb7('0x2f')]=qs['offset'](_0x23db31[_0x4bb7('0x43')][_0x4bb7('0x2f')]);}return _0x3822d3[_0x4bb7('0x57')](_0x5806df);}})['then'](function(_0x410565){if(_0x410565){return _0x410565?{'count':_0x553a5d,'rows':_0x410565}:null;}})[_0x4bb7('0x1f')](respondWithResult(_0x1048bf,null))['catch'](handleError(_0x1048bf,null));};exports[_0x4bb7('0x5a')]=function(_0x48df30,_0x17d684,_0x53e0a0){if(_0x48df30[_0x4bb7('0x55')]['id']){delete _0x48df30['body']['id'];}return db['SugarcrmAccount'][_0x4bb7('0x5b')]({'where':{'id':_0x48df30[_0x4bb7('0x56')]['id']}})[_0x4bb7('0x1f')](handleEntityNotFound(_0x17d684,null))[_0x4bb7('0x1f')](function(_0x4e6ff5){if(_0x4e6ff5){_0x48df30[_0x4bb7('0x55')]['AccountId']=_0x4e6ff5['id'];_0x48df30[_0x4bb7('0x55')][_0x4bb7('0x5c')]=integrations[_0x4bb7('0x5d')](_0x48df30['body'][_0x4bb7('0x5e')],_0x48df30[_0x4bb7('0x55')][_0x4bb7('0x3d')]);_0x48df30['body'][_0x4bb7('0x5f')]=integrations[_0x4bb7('0x60')](_0x48df30[_0x4bb7('0x55')][_0x4bb7('0x5e')],_0x48df30[_0x4bb7('0x55')][_0x4bb7('0x3d')]);return db[_0x4bb7('0x58')][_0x4bb7('0x54')](_0x48df30['body'],{'include':[{'model':db[_0x4bb7('0x61')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x17d684,null))[_0x4bb7('0x2a')](handleError(_0x17d684,null));};exports[_0x4bb7('0x62')]=function(_0x26cc6d,_0x28291a,_0x11ff11){var _0x3e9211='';var _0x529eff=['id',_0x4bb7('0x37'),_0x4bb7('0x63'),_0x4bb7('0x64'),_0x4bb7('0x65'),'date_start',_0x4bb7('0x66'),_0x4bb7('0x67'),_0x4bb7('0x68'),_0x4bb7('0x69'),'parent_name',_0x4bb7('0x6a')];return db[_0x4bb7('0x3b')]['findOne']({'where':{'id':_0x26cc6d['params']['id']},'attributes':['id','username',_0x4bb7('0x6b'),_0x4bb7('0x6c')]})['then'](handleEntityNotFound(_0x28291a,null))[_0x4bb7('0x1f')](function(_0x4bd854){if(_0x4bd854){_0x3e9211=_0x4bd854[_0x4bb7('0x6c')];var _0x14dc71=_0x3e9211[_0x4bb7('0x6d')](-0x1);if(_0x14dc71==='/'){_0x3e9211=_0x3e9211[_0x4bb7('0x6e')](0x0,_0x3e9211[_0x4bb7('0x6f')](_0x14dc71));}return rp({'method':_0x4bb7('0x70'),'uri':util['format'](_0x4bb7('0x71'),_0x3e9211,_0x4bb7('0x72')),'json':!![],'form':{'method':_0x4bb7('0x73'),'input_type':_0x4bb7('0x74'),'response_type':_0x4bb7('0x74'),'rest_data':JSON[_0x4bb7('0x24')]({'user_auth':{'user_name':_0x4bd854[_0x4bb7('0x75')],'password':_0x4bd854[_0x4bb7('0x6b')],'encryption':_0x4bb7('0x76')},'application':_0x4bb7('0x77')})}});}})[_0x4bb7('0x1f')](function(_0x52e6b2){if(_0x52e6b2&&_0x52e6b2['name']!==_0x4bb7('0x78')&&_0x52e6b2[_0x4bb7('0x37')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x4bb7('0x79')](_0x4bb7('0x71'),_0x3e9211,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x4bb7('0x7a'),'input_type':_0x4bb7('0x74'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x52e6b2['id'],'module_name':'Calls'})}})[_0x4bb7('0x1f')](function(_0x6a2b45){if(_0x6a2b45){var _0x10a2ec=_[_0x4bb7('0x7b')](_0x6a2b45[_0x4bb7('0x7c')]);_[_0x4bb7('0x7d')](_0x10a2ec,function(_0x4e3892){return _0x529eff['includes'](_0x4e3892['name']);});return{'count':_0x10a2ec[_0x4bb7('0x46')],'rows':_[_0x4bb7('0x3a')](_0x10a2ec,function(_0x414257){return{'id':_0x414257['name'],'name':_0x414257['label'],'custom':_[_0x4bb7('0x7e')](_0x414257[_0x4bb7('0x37')],'_c')?!![]:![],'options':_0x414257[_0x4bb7('0x4f')]?_[_0x4bb7('0x3a')](_[_0x4bb7('0x7b')](_0x414257[_0x4bb7('0x4f')]),function(_0xf3a94){return{'name':_0xf3a94[_0x4bb7('0x7f')],'value':_0xf3a94[_0x4bb7('0x37')]};}):[]};})};}})['then'](respondWithResult(_0x28291a,null))[_0x4bb7('0x2a')](function(_0x5ae21d){var _0x582acf=_0x26cc6d[_0x4bb7('0x43')][_0x4bb7('0x1b')]?0x1f4:_0x5ae21d['statusCode']||0x1f4;logger[_0x4bb7('0x25')](_0x4bb7('0x80'),_0x4bb7('0x62'),_0x582acf,JSON[_0x4bb7('0x24')](_0x5ae21d));delete _0x5ae21d[_0x4bb7('0x37')];if(_0x582acf===0x191){_0x582acf=0x190;}_0x28291a[_0x4bb7('0x2c')](_0x582acf)[_0x4bb7('0x38')](_0x26cc6d[_0x4bb7('0x43')][_0x4bb7('0x1b')]?{'message':_0x4bb7('0x81'),'statusCode':_0x5ae21d[_0x4bb7('0x82')]}:_0x5ae21d);});}else{var _0x47073d=0x1f4;_0x28291a[_0x4bb7('0x2c')](_0x47073d)[_0x4bb7('0x38')]({'message':_0x4bb7('0x81'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x2ac9=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','destroy','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmAccount','include','findAll','show','keys','rawAttributes','includeAll','create','body','find','params','findOne','getConfigurations','addConfiguration','Subjects','getSubjects','channel','getDescriptions','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','direction','password','remoteUri','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','username','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','values','module_fields','remove','endsWith','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format'];(function(_0x18313b,_0x5c914f){var _0x2ba97d=function(_0x41143d){while(--_0x41143d){_0x18313b['push'](_0x18313b['shift']());}};_0x2ba97d(++_0x5c914f);}(_0x2ac9,0x17b));var _0x92ac=function(_0x3987ae,_0x76b48f){_0x3987ae=_0x3987ae-0x0;var _0x1bfc97=_0x2ac9[_0x3987ae];return _0x1bfc97;};'use strict';var pdf=require(_0x92ac('0x0'));var emlformat=require(_0x92ac('0x1'));var rimraf=require(_0x92ac('0x2'));var zipdir=require(_0x92ac('0x3'));var jsonpatch=require(_0x92ac('0x4'));var rp=require(_0x92ac('0x5'));var moment=require(_0x92ac('0x6'));var BPromise=require(_0x92ac('0x7'));var Mustache=require(_0x92ac('0x8'));var util=require('util');var path=require('path');var sox=require(_0x92ac('0x9'));var csv=require(_0x92ac('0xa'));var ejs=require(_0x92ac('0xb'));var fs=require('fs');var _=require(_0x92ac('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x92ac('0xd'));var toCsv=require(_0x92ac('0xa'));var querystring=require(_0x92ac('0xe'));var Papa=require('papaparse');var Redis=require(_0x92ac('0xf'));var authService=require(_0x92ac('0x10'));var qs=require(_0x92ac('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92ac('0x12'));var logger=require(_0x92ac('0x13'))(_0x92ac('0x14'));var utils=require(_0x92ac('0x15'));var config=require(_0x92ac('0x16'));var db=require(_0x92ac('0x17'))['db'];var integrations=require(_0x92ac('0x18'));var jayson=require(_0x92ac('0x19'));var client=jayson[_0x92ac('0x1a')][_0x92ac('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x133b8f,_0x225fe5,_0x5c19ce){if(_0x5c19ce){var _0x33d807=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33d807[_0x92ac('0x1c')](_0x225fe5)){return _0x133b8f;}else{throw new db[(_0x92ac('0x1d'))][(_0x92ac('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x133b8f;}}function respondWithRpcPromise(_0x3a5628,_0x4b8d24,_0x8b2f62,_0x5032a3){return new BPromise(function(_0x49ddd5,_0x4beacf){var _0x4dcd9a=_0x5032a3||client;return _0x4dcd9a['request'](_0x3a5628,_0x8b2f62)[_0x92ac('0x1f')](function(_0x6306b1){logger[_0x92ac('0x20')](_0x92ac('0x21'),_0x4b8d24,_0x92ac('0x22'));logger[_0x92ac('0x23')](_0x92ac('0x24'),_0x4b8d24,_0x92ac('0x22'),JSON[_0x92ac('0x25')](_0x6306b1));if(_0x6306b1['error']){if(_0x6306b1[_0x92ac('0x26')][_0x92ac('0x27')]===0x1f4){logger[_0x92ac('0x26')](_0x92ac('0x21'),_0x4b8d24,_0x6306b1[_0x92ac('0x26')][_0x92ac('0x28')]);return _0x4beacf(_0x6306b1['error'][_0x92ac('0x28')]);}logger['error'](_0x92ac('0x21'),_0x4b8d24,_0x6306b1['error'][_0x92ac('0x28')]);return _0x49ddd5(_0x6306b1[_0x92ac('0x26')][_0x92ac('0x28')]);}else{logger[_0x92ac('0x20')](_0x92ac('0x21'),_0x4b8d24,_0x92ac('0x22'));_0x49ddd5(_0x6306b1['result']['message']);}})[_0x92ac('0x29')](function(_0x2a8d37){logger[_0x92ac('0x26')](_0x92ac('0x21'),_0x4b8d24,_0x2a8d37);_0x4beacf(_0x2a8d37);});});}function respondWithStatusCode(_0x47d37a,_0x104606){_0x104606=_0x104606||0xcc;return function(_0x821ab9){if(_0x821ab9){return _0x47d37a[_0x92ac('0x2a')](_0x104606);}return _0x47d37a[_0x92ac('0x2b')](_0x104606)[_0x92ac('0x2c')]();};}function respondWithResult(_0x6de829,_0x22c297){_0x22c297=_0x22c297||0xc8;return function(_0x1938ea){if(_0x1938ea){return _0x6de829[_0x92ac('0x2b')](_0x22c297)['json'](_0x1938ea);}};}function respondWithFilteredResult(_0x5eb029,_0x227240){return function(_0x503f58){if(_0x503f58){var _0x1a35fb=_0x503f58[_0x92ac('0x2d')],_0x5dc8ba=_0x227240['offset'],_0x178929=_0x227240[_0x92ac('0x2e')]+_0x227240[_0x92ac('0x2f')],_0x54e812;if(_0x178929>=_0x1a35fb){_0x178929=_0x1a35fb;_0x54e812=0xc8;}else{_0x54e812=0xce;}_0x5eb029[_0x92ac('0x2b')](_0x54e812);return _0x5eb029[_0x92ac('0x30')](_0x92ac('0x31'),_0x5dc8ba+'-'+_0x178929+'/'+_0x1a35fb)[_0x92ac('0x32')](_0x503f58);}return null;};}function patchUpdates(_0x3cfc33){return function(_0x495a29){try{jsonpatch[_0x92ac('0x33')](_0x495a29,_0x3cfc33,!![]);}catch(_0x1afea9){return BPromise['reject'](_0x1afea9);}return _0x495a29['save']();};}function saveUpdates(_0xed06e4,_0x40d92b){return function(_0x39c936){if(_0x39c936){return _0x39c936[_0x92ac('0x34')](_0xed06e4)[_0x92ac('0x1f')](function(_0x32addb){return _0x32addb;});}return null;};}function removeEntity(_0x7ab8b0,_0xae37b4){return function(_0x1cd4b3){if(_0x1cd4b3){return _0x1cd4b3[_0x92ac('0x35')]()['then'](function(){_0x7ab8b0[_0x92ac('0x2b')](0xcc)[_0x92ac('0x2c')]();});}};}function handleEntityNotFound(_0xfce3d3,_0x230816){return function(_0x4ddb29){if(!_0x4ddb29){_0xfce3d3['sendStatus'](0x194);}return _0x4ddb29;};}function handleError(_0x15d12f,_0x26bf53){_0x26bf53=_0x26bf53||0x1f4;return function(_0x5267f2){logger[_0x92ac('0x26')](_0x5267f2['stack']);if(_0x5267f2[_0x92ac('0x36')]){delete _0x5267f2[_0x92ac('0x36')];}_0x15d12f['status'](_0x26bf53)[_0x92ac('0x37')](_0x5267f2);};}exports[_0x92ac('0x38')]=function(_0x39f379,_0x535bca){var _0x4947a7={},_0x395faf={},_0x4a410f={'count':0x0,'rows':[]};var _0xa0716e=_[_0x92ac('0x39')](db['SugarcrmAccount']['rawAttributes'],function(_0x3f946a){return{'name':_0x3f946a[_0x92ac('0x3a')],'type':_0x3f946a[_0x92ac('0x3b')][_0x92ac('0x3c')]};});_0x395faf[_0x92ac('0x3d')]=_['map'](_0xa0716e,_0x92ac('0x36'));_0x395faf[_0x92ac('0x3e')]=_['keys'](_0x39f379[_0x92ac('0x3e')]);_0x395faf[_0x92ac('0x3f')]=_[_0x92ac('0x40')](_0x395faf[_0x92ac('0x3d')],_0x395faf[_0x92ac('0x3e')]);_0x4947a7['attributes']=_[_0x92ac('0x40')](_0x395faf['model'],qs['fields'](_0x39f379[_0x92ac('0x3e')][_0x92ac('0x41')]));_0x4947a7['attributes']=_0x4947a7[_0x92ac('0x42')][_0x92ac('0x43')]?_0x4947a7[_0x92ac('0x42')]:_0x395faf[_0x92ac('0x3d')];if(!_0x39f379[_0x92ac('0x3e')][_0x92ac('0x44')](_0x92ac('0x45'))){_0x4947a7[_0x92ac('0x2f')]=qs[_0x92ac('0x2f')](_0x39f379['query'][_0x92ac('0x2f')]);_0x4947a7[_0x92ac('0x2e')]=qs[_0x92ac('0x2e')](_0x39f379[_0x92ac('0x3e')][_0x92ac('0x2e')]);}_0x4947a7[_0x92ac('0x46')]=qs[_0x92ac('0x47')](_0x39f379[_0x92ac('0x3e')][_0x92ac('0x47')]);_0x4947a7[_0x92ac('0x48')]=qs[_0x92ac('0x3f')](_[_0x92ac('0x49')](_0x39f379[_0x92ac('0x3e')],_0x395faf['filters']));if(_0x39f379['query'][_0x92ac('0x4a')]){_0x4947a7['where']=_[_0x92ac('0x4b')](_0x4947a7['where'],{'$or':_['map'](_0xa0716e,function(_0x39ed94){if(_0x39ed94['type']!==_0x92ac('0x4c')){var _0x3ded22={};_0x3ded22[_0x39ed94[_0x92ac('0x36')]]={'$like':'%'+_0x39f379[_0x92ac('0x3e')][_0x92ac('0x4a')]+'%'};return _0x3ded22;}})});}_0x4947a7=_[_0x92ac('0x4b')]({},_0x4947a7,_0x39f379[_0x92ac('0x4d')]);var _0x13f593={'where':_0x4947a7['where']};return db[_0x92ac('0x4e')][_0x92ac('0x2d')](_0x13f593)['then'](function(_0x3453fb){_0x4a410f[_0x92ac('0x2d')]=_0x3453fb;if(_0x39f379[_0x92ac('0x3e')]['includeAll']){_0x4947a7[_0x92ac('0x4f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x92ac('0x50')](_0x4947a7);})[_0x92ac('0x1f')](function(_0xbe5a06){_0x4a410f['rows']=_0xbe5a06;return _0x4a410f;})[_0x92ac('0x1f')](respondWithFilteredResult(_0x535bca,_0x4947a7))['catch'](handleError(_0x535bca,null));};exports[_0x92ac('0x51')]=function(_0x32729a,_0x4e0bb1){var _0x307951={'raw':![],'where':{'id':_0x32729a['params']['id']}},_0x42a335={};_0x42a335[_0x92ac('0x3d')]=_[_0x92ac('0x52')](db[_0x92ac('0x4e')][_0x92ac('0x53')]);_0x42a335['query']=_['keys'](_0x32729a['query']);_0x42a335['filters']=_[_0x92ac('0x40')](_0x42a335[_0x92ac('0x3d')],_0x42a335['query']);_0x307951[_0x92ac('0x42')]=_[_0x92ac('0x40')](_0x42a335[_0x92ac('0x3d')],qs[_0x92ac('0x41')](_0x32729a[_0x92ac('0x3e')]['fields']));_0x307951[_0x92ac('0x42')]=_0x307951[_0x92ac('0x42')]['length']?_0x307951[_0x92ac('0x42')]:_0x42a335[_0x92ac('0x3d')];if(_0x32729a[_0x92ac('0x3e')][_0x92ac('0x54')]){_0x307951[_0x92ac('0x4f')]=[{'all':!![]}];}_0x307951=_[_0x92ac('0x4b')]({},_0x307951,_0x32729a[_0x92ac('0x4d')]);return db[_0x92ac('0x4e')]['find'](_0x307951)[_0x92ac('0x1f')](handleEntityNotFound(_0x4e0bb1,null))['then'](respondWithResult(_0x4e0bb1,null))[_0x92ac('0x29')](handleError(_0x4e0bb1,null));};exports[_0x92ac('0x55')]=function(_0x1ed323,_0x8dec81){return db[_0x92ac('0x4e')]['create'](_0x1ed323[_0x92ac('0x56')],{})['then'](respondWithResult(_0x8dec81,0xc9))['catch'](handleError(_0x8dec81,null));};exports[_0x92ac('0x34')]=function(_0x3c36e9,_0x1f9dc4){if(_0x3c36e9['body']['id']){delete _0x3c36e9[_0x92ac('0x56')]['id'];}return db[_0x92ac('0x4e')][_0x92ac('0x57')]({'where':{'id':_0x3c36e9[_0x92ac('0x58')]['id']}})[_0x92ac('0x1f')](handleEntityNotFound(_0x1f9dc4,null))['then'](saveUpdates(_0x3c36e9['body'],null))[_0x92ac('0x1f')](respondWithResult(_0x1f9dc4,null))[_0x92ac('0x29')](handleError(_0x1f9dc4,null));};exports[_0x92ac('0x35')]=function(_0x3e0a6a,_0x55c0f4){return db['SugarcrmAccount'][_0x92ac('0x57')]({'where':{'id':_0x3e0a6a['params']['id']}})[_0x92ac('0x1f')](handleEntityNotFound(_0x55c0f4,null))[_0x92ac('0x1f')](removeEntity(_0x55c0f4,null))[_0x92ac('0x29')](handleError(_0x55c0f4,null));};exports['getConfigurations']=function(_0x1c763d,_0x535952,_0x48f529){var _0x5f59f3={};var _0x1f0725={};var _0x4de7ec;var _0x294a8f;return db[_0x92ac('0x4e')][_0x92ac('0x59')]({'where':{'id':_0x1c763d[_0x92ac('0x58')]['id']}})[_0x92ac('0x1f')](handleEntityNotFound(_0x535952,null))['then'](function(_0x106bcc){if(_0x106bcc){_0x4de7ec=_0x106bcc;_0x1f0725[_0x92ac('0x3d')]=_['keys'](db['SugarcrmConfiguration'][_0x92ac('0x53')]);_0x1f0725[_0x92ac('0x3e')]=_[_0x92ac('0x52')](_0x1c763d['query']);_0x1f0725[_0x92ac('0x3f')]=_[_0x92ac('0x40')](_0x1f0725[_0x92ac('0x3d')],_0x1f0725[_0x92ac('0x3e')]);_0x5f59f3[_0x92ac('0x42')]=_['intersection'](_0x1f0725['model'],qs['fields'](_0x1c763d[_0x92ac('0x3e')][_0x92ac('0x41')]));_0x5f59f3[_0x92ac('0x42')]=_0x5f59f3[_0x92ac('0x42')][_0x92ac('0x43')]?_0x5f59f3[_0x92ac('0x42')]:_0x1f0725[_0x92ac('0x3d')];_0x5f59f3[_0x92ac('0x46')]=qs[_0x92ac('0x47')](_0x1c763d['query']['sort']);_0x5f59f3[_0x92ac('0x48')]=qs[_0x92ac('0x3f')](_[_0x92ac('0x49')](_0x1c763d['query'],_0x1f0725['filters']));if(_0x1c763d[_0x92ac('0x3e')][_0x92ac('0x4a')]){_0x5f59f3[_0x92ac('0x48')]=_['merge'](_0x5f59f3[_0x92ac('0x48')],{'$or':_['map'](_0x5f59f3[_0x92ac('0x42')],function(_0x455adb){var _0x264256={};_0x264256[_0x455adb]={'$like':'%'+_0x1c763d[_0x92ac('0x3e')][_0x92ac('0x4a')]+'%'};return _0x264256;})});}_0x5f59f3=_[_0x92ac('0x4b')]({},_0x5f59f3,_0x1c763d[_0x92ac('0x4d')]);return _0x4de7ec[_0x92ac('0x5a')](_0x5f59f3);}})[_0x92ac('0x1f')](function(_0x1b660e){if(_0x1b660e){_0x294a8f=_0x1b660e[_0x92ac('0x43')];if(!_0x1c763d['query'][_0x92ac('0x44')](_0x92ac('0x45'))){_0x5f59f3['limit']=qs['limit'](_0x1c763d['query'][_0x92ac('0x2f')]);_0x5f59f3[_0x92ac('0x2e')]=qs['offset'](_0x1c763d[_0x92ac('0x3e')]['offset']);}return _0x4de7ec[_0x92ac('0x5a')](_0x5f59f3);}})['then'](function(_0x4f96ec){if(_0x4f96ec){return _0x4f96ec?{'count':_0x294a8f,'rows':_0x4f96ec}:null;}})[_0x92ac('0x1f')](respondWithResult(_0x535952,null))[_0x92ac('0x29')](handleError(_0x535952,null));};exports[_0x92ac('0x5b')]=function(_0x3fffe2,_0x58fa08,_0x3b5969){if(_0x3fffe2[_0x92ac('0x56')]['id']){delete _0x3fffe2['body']['id'];}return db[_0x92ac('0x4e')]['findOne']({'where':{'id':_0x3fffe2[_0x92ac('0x58')]['id']}})['then'](handleEntityNotFound(_0x58fa08,null))['then'](function(_0x2ec308){if(_0x2ec308){_0x3fffe2[_0x92ac('0x56')]['AccountId']=_0x2ec308['id'];_0x3fffe2['body'][_0x92ac('0x5c')]=integrations[_0x92ac('0x5d')](_0x3fffe2['body'][_0x92ac('0x5e')],_0x3fffe2[_0x92ac('0x56')][_0x92ac('0x3b')]);_0x3fffe2[_0x92ac('0x56')]['Descriptions']=integrations[_0x92ac('0x5f')](_0x3fffe2['body'][_0x92ac('0x5e')],_0x3fffe2['body'][_0x92ac('0x3b')]);return db[_0x92ac('0x60')][_0x92ac('0x55')](_0x3fffe2['body'],{'include':[{'model':db[_0x92ac('0x61')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x92ac('0x62')}]});}return null;})[_0x92ac('0x1f')](respondWithResult(_0x58fa08,null))[_0x92ac('0x29')](handleError(_0x58fa08,null));};exports[_0x92ac('0x63')]=function(_0x10e26b,_0x5960b9,_0x2d17a2){var _0x5ddb46='';var _0xb61b83=['id',_0x92ac('0x36'),_0x92ac('0x64'),_0x92ac('0x65'),_0x92ac('0x66'),_0x92ac('0x67'),_0x92ac('0x68'),_0x92ac('0x69'),'parent_id','parent_type','parent_name',_0x92ac('0x6a')];return db[_0x92ac('0x4e')]['findOne']({'where':{'id':_0x10e26b[_0x92ac('0x58')]['id']},'attributes':['id','username',_0x92ac('0x6b'),_0x92ac('0x6c')]})['then'](handleEntityNotFound(_0x5960b9,null))[_0x92ac('0x1f')](function(_0x43a56c){if(_0x43a56c){_0x5ddb46=_0x43a56c['remoteUri'];var _0x487318=_0x5ddb46['slice'](-0x1);if(_0x487318==='/'){_0x5ddb46=_0x5ddb46['substring'](0x0,_0x5ddb46[_0x92ac('0x6d')](_0x487318));}return rp({'method':_0x92ac('0x6e'),'uri':util[_0x92ac('0x6f')]('%s%s',_0x5ddb46,_0x92ac('0x70')),'json':!![],'form':{'method':_0x92ac('0x71'),'input_type':'JSON','response_type':_0x92ac('0x72'),'rest_data':JSON[_0x92ac('0x25')]({'user_auth':{'user_name':_0x43a56c[_0x92ac('0x73')],'password':_0x43a56c[_0x92ac('0x6b')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x92ac('0x1f')](function(_0x4d0699){if(_0x4d0699&&_0x4d0699[_0x92ac('0x36')]!==_0x92ac('0x74')&&_0x4d0699['name']!==_0x92ac('0x75')){return rp({'method':'POST','uri':util[_0x92ac('0x6f')](_0x92ac('0x76'),_0x5ddb46,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x92ac('0x77'),'input_type':_0x92ac('0x72'),'response_type':'JSON','rest_data':JSON[_0x92ac('0x25')]({'session':_0x4d0699['id'],'module_name':_0x92ac('0x78')})}})[_0x92ac('0x1f')](function(_0x10efd9){if(_0x10efd9){var _0x1b031f=_[_0x92ac('0x79')](_0x10efd9[_0x92ac('0x7a')]);_[_0x92ac('0x7b')](_0x1b031f,function(_0x49c0a1){return _0xb61b83['includes'](_0x49c0a1[_0x92ac('0x36')]);});return{'count':_0x1b031f[_0x92ac('0x43')],'rows':_[_0x92ac('0x39')](_0x1b031f,function(_0x4f93e1){return{'id':_0x4f93e1[_0x92ac('0x36')],'name':_0x4f93e1['label'],'custom':_[_0x92ac('0x7c')](_0x4f93e1[_0x92ac('0x36')],'_c')?!![]:![],'options':_0x4f93e1[_0x92ac('0x4d')]?_[_0x92ac('0x39')](_['values'](_0x4f93e1['options']),function(_0x485b63){return{'name':_0x485b63['value'],'value':_0x485b63[_0x92ac('0x36')]};}):[]};})};}})[_0x92ac('0x1f')](respondWithResult(_0x5960b9,null))[_0x92ac('0x29')](function(_0x50293d){var _0x17e587=_0x10e26b[_0x92ac('0x3e')]['test']?0x1f4:_0x50293d[_0x92ac('0x7d')]||0x1f4;logger[_0x92ac('0x26')](_0x92ac('0x7e'),'getFields',_0x17e587,JSON[_0x92ac('0x25')](_0x50293d));delete _0x50293d[_0x92ac('0x36')];if(_0x17e587===0x191){_0x17e587=0x190;}_0x5960b9['status'](_0x17e587)[_0x92ac('0x37')](_0x10e26b['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x50293d[_0x92ac('0x7d')]}:_0x50293d);});}else{var _0x169741=0x1f4;_0x5960b9[_0x92ac('0x2b')](_0x169741)['send']({'message':'Wrong\x20credentials','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 1e5c16f..2dbd262 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 _0xdb2b=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5ea203,_0x3d3a98){var _0x53c0f2=function(_0x5ef088){while(--_0x5ef088){_0x5ea203['push'](_0x5ea203['shift']());}};_0x53c0f2(++_0x3d3a98);}(_0xdb2b,0xa2));var _0xbdb2=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0xdb2b[_0x45f4e9];return _0x559d8f;};'use strict';var _=require(_0xbdb2('0x0'));var util=require('util');var logger=require(_0xbdb2('0x1'))(_0xbdb2('0x2'));var moment=require(_0xbdb2('0x3'));var BPromise=require(_0xbdb2('0x4'));var rp=require(_0xbdb2('0x5'));var fs=require('fs');var path=require(_0xbdb2('0x6'));var rimraf=require(_0xbdb2('0x7'));var config=require(_0xbdb2('0x8'));var attributes=require(_0xbdb2('0x9'));var integrations=require(_0xbdb2('0xa'));module[_0xbdb2('0xb')]=function(_0xdabd3c,_0x5a4c37){return _0xdabd3c['define'](_0xbdb2('0xc'),attributes,{'tableName':_0xbdb2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2469=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x6cce5,_0x5bf877){var _0x5c4a94=function(_0x54e37a){while(--_0x54e37a){_0x6cce5['push'](_0x6cce5['shift']());}};_0x5c4a94(++_0x5bf877);}(_0x2469,0xaf));var _0x9246=function(_0xc6999a,_0x2c8e49){_0xc6999a=_0xc6999a-0x0;var _0x3c4974=_0x2469[_0xc6999a];return _0x3c4974;};'use strict';var _=require(_0x9246('0x0'));var util=require(_0x9246('0x1'));var logger=require(_0x9246('0x2'))(_0x9246('0x3'));var moment=require(_0x9246('0x4'));var BPromise=require(_0x9246('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9246('0x6'));var rimraf=require(_0x9246('0x7'));var config=require(_0x9246('0x8'));var attributes=require(_0x9246('0x9'));var integrations=require(_0x9246('0xa'));module['exports']=function(_0x131f26,_0x1c68a7){return _0x131f26[_0x9246('0xb')](_0x9246('0xc'),attributes,{'tableName':_0x9246('0xd'),'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 a34b63e..16f12c1 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 _0x3f43=['SugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','where','attributes','include','map','model','GetSugarcrmAccount','debug','ShowSugarcrmAccount'];(function(_0x4b79c7,_0x5b6e01){var _0x1a2efe=function(_0x3b68f1){while(--_0x3b68f1){_0x4b79c7['push'](_0x4b79c7['shift']());}};_0x1a2efe(++_0x5b6e01);}(_0x3f43,0xce));var _0x33f4=function(_0x340b97,_0x4bb60a){_0x340b97=_0x340b97-0x0;var _0x264e1d=_0x3f43[_0x340b97];return _0x264e1d;};'use strict';var _=require(_0x33f4('0x0'));var util=require(_0x33f4('0x1'));var moment=require(_0x33f4('0x2'));var BPromise=require(_0x33f4('0x3'));var rs=require(_0x33f4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33f4('0x5'))['db'];var utils=require(_0x33f4('0x6'));var logger=require(_0x33f4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x33f4('0x8'));var client=jayson[_0x33f4('0x9')][_0x33f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x377aa1,_0x53a470,_0x7bd67e){return new BPromise(function(_0x260d14,_0x3b94d2){return client[_0x33f4('0xb')](_0x377aa1,_0x7bd67e)[_0x33f4('0xc')](function(_0x3cc130){logger[_0x33f4('0xd')](_0x33f4('0xe'),_0x53a470,'request\x20sent');logger['debug'](_0x33f4('0xf'),_0x53a470,'request\x20sent',JSON[_0x33f4('0x10')](_0x3cc130));if(_0x3cc130['error']){if(_0x3cc130[_0x33f4('0x11')]['code']===0x1f4){logger[_0x33f4('0x11')](_0x33f4('0xe'),_0x53a470,_0x3cc130[_0x33f4('0x11')][_0x33f4('0x12')]);return _0x3b94d2(_0x3cc130[_0x33f4('0x11')][_0x33f4('0x12')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x53a470,_0x3cc130[_0x33f4('0x11')][_0x33f4('0x12')]);return _0x260d14(_0x3cc130['error']['message']);}else{logger[_0x33f4('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x53a470,'request\x20sent');_0x260d14(_0x3cc130[_0x33f4('0x13')][_0x33f4('0x12')]);}})[_0x33f4('0x14')](function(_0x1318f7){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x53a470,_0x1318f7);_0x3b94d2(_0x1318f7);});});}exports['GetSugarcrmAccount']=function(_0x27a21d){var _0x32022b=this;return new Promise(function(_0x42b3ec,_0x253ffc){return db['SugarcrmAccount'][_0x33f4('0x15')]({'raw':_0x27a21d[_0x33f4('0x16')]?_0x27a21d['options'][_0x33f4('0x17')]===undefined?!![]:![]:!![],'where':_0x27a21d[_0x33f4('0x16')]?_0x27a21d[_0x33f4('0x16')][_0x33f4('0x18')]||null:null,'attributes':_0x27a21d[_0x33f4('0x16')]?_0x27a21d[_0x33f4('0x16')][_0x33f4('0x19')]||null:null,'limit':_0x27a21d[_0x33f4('0x16')]?_0x27a21d[_0x33f4('0x16')]['limit']||null:null,'include':_0x27a21d['options']?_0x27a21d[_0x33f4('0x16')][_0x33f4('0x1a')]?_[_0x33f4('0x1b')](_0x27a21d['options'][_0x33f4('0x1a')],function(_0x4f23ea){return{'model':db[_0x4f23ea[_0x33f4('0x1c')]],'as':_0x4f23ea['as'],'attributes':_0x4f23ea[_0x33f4('0x19')],'include':_0x4f23ea['include']?_[_0x33f4('0x1b')](_0x4f23ea['include'],function(_0x3f143c){return{'model':db[_0x3f143c[_0x33f4('0x1c')]],'as':_0x3f143c['as'],'attributes':_0x3f143c['attributes'],'include':_0x3f143c[_0x33f4('0x1a')]?_[_0x33f4('0x1b')](_0x3f143c[_0x33f4('0x1a')],function(_0xf5eb11){return{'model':db[_0xf5eb11[_0x33f4('0x1c')]],'as':_0xf5eb11['as'],'attributes':_0xf5eb11[_0x33f4('0x19')]};}):[]};}):[]};}):[]:[]})[_0x33f4('0xc')](function(_0x4e337f){logger[_0x33f4('0xd')](_0x33f4('0x1d'),_0x27a21d);logger[_0x33f4('0x1e')](_0x33f4('0x1d'),_0x27a21d,JSON[_0x33f4('0x10')](_0x4e337f));_0x42b3ec(_0x4e337f);})['catch'](function(_0x3f8ade){logger[_0x33f4('0x11')](_0x33f4('0x1d'),_0x3f8ade['message'],_0x27a21d);_0x253ffc(_0x32022b[_0x33f4('0x11')](0x1f4,_0x3f8ade[_0x33f4('0x12')]));});});};exports[_0x33f4('0x1f')]=function(_0x2ae662){var _0x38cafa=this;return new Promise(function(_0x34be33,_0x4b6d14){return db[_0x33f4('0x20')][_0x33f4('0x21')]({'raw':_0x2ae662[_0x33f4('0x16')]?_0x2ae662[_0x33f4('0x16')][_0x33f4('0x17')]===undefined?!![]:![]:!![],'where':_0x2ae662[_0x33f4('0x16')]?_0x2ae662[_0x33f4('0x16')][_0x33f4('0x18')]||null:null,'attributes':_0x2ae662[_0x33f4('0x16')]?_0x2ae662[_0x33f4('0x16')]['attributes']||null:null,'include':_0x2ae662[_0x33f4('0x16')]?_0x2ae662['options'][_0x33f4('0x1a')]?_[_0x33f4('0x1b')](_0x2ae662['options'][_0x33f4('0x1a')],function(_0x51da22){return{'model':db[_0x51da22['model']],'as':_0x51da22['as'],'attributes':_0x51da22[_0x33f4('0x19')],'include':_0x51da22[_0x33f4('0x1a')]?_[_0x33f4('0x1b')](_0x51da22[_0x33f4('0x1a')],function(_0x56d93b){return{'model':db[_0x56d93b['model']],'as':_0x56d93b['as'],'attributes':_0x56d93b[_0x33f4('0x19')],'include':_0x56d93b[_0x33f4('0x1a')]?_[_0x33f4('0x1b')](_0x56d93b[_0x33f4('0x1a')],function(_0x2f6ee7){return{'model':db[_0x2f6ee7['model']],'as':_0x2f6ee7['as'],'attributes':_0x2f6ee7[_0x33f4('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2016ea){logger['info'](_0x33f4('0x1f'),_0x2ae662);logger['debug'](_0x33f4('0x1f'),_0x2ae662,JSON[_0x33f4('0x10')](_0x2016ea));_0x34be33(_0x2016ea);})['catch'](function(_0x2e9eee){logger[_0x33f4('0x11')]('ShowSugarcrmAccount',_0x2e9eee['message'],_0x2ae662);_0x4b6d14(_0x38cafa['error'](0x1f4,_0x2e9eee[_0x33f4('0x12')]));});});}; \ No newline at end of file +var _0x9011=['SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2b8aa2,_0x135781){var _0x909d02=function(_0x4dedfa){while(--_0x4dedfa){_0x2b8aa2['push'](_0x2b8aa2['shift']());}};_0x909d02(++_0x135781);}(_0x9011,0x151));var _0x1901=function(_0x13d453,_0x16e7d2){_0x13d453=_0x13d453-0x0;var _0x2a4f7a=_0x9011[_0x13d453];return _0x2a4f7a;};'use strict';var _=require(_0x1901('0x0'));var util=require(_0x1901('0x1'));var moment=require(_0x1901('0x2'));var BPromise=require(_0x1901('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1901('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1901('0x5'));var logger=require('../../config/logger')(_0x1901('0x6'));var config=require('../../config/environment');var jayson=require(_0x1901('0x7'));var client=jayson[_0x1901('0x8')][_0x1901('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcebb5f,_0x1ec1cb,_0x4c1b0d){return new BPromise(function(_0x1bfe6f,_0x3ad1e5){return client[_0x1901('0xa')](_0xcebb5f,_0x4c1b0d)[_0x1901('0xb')](function(_0x42053c){logger[_0x1901('0xc')](_0x1901('0xd'),_0x1ec1cb,'request\x20sent');logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1ec1cb,_0x1901('0xe'),JSON[_0x1901('0xf')](_0x42053c));if(_0x42053c[_0x1901('0x10')]){if(_0x42053c[_0x1901('0x10')][_0x1901('0x11')]===0x1f4){logger['error'](_0x1901('0xd'),_0x1ec1cb,_0x42053c[_0x1901('0x10')][_0x1901('0x12')]);return _0x3ad1e5(_0x42053c['error']['message']);}logger[_0x1901('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ec1cb,_0x42053c[_0x1901('0x10')][_0x1901('0x12')]);return _0x1bfe6f(_0x42053c[_0x1901('0x10')][_0x1901('0x12')]);}else{logger[_0x1901('0xc')](_0x1901('0xd'),_0x1ec1cb,_0x1901('0xe'));_0x1bfe6f(_0x42053c[_0x1901('0x13')][_0x1901('0x12')]);}})[_0x1901('0x14')](function(_0x1fc4bd){logger['error'](_0x1901('0xd'),_0x1ec1cb,_0x1fc4bd);_0x3ad1e5(_0x1fc4bd);});});}exports[_0x1901('0x15')]=function(_0xc9ef5){var _0x3c1298=this;return new Promise(function(_0x429231,_0x5523f2){return db[_0x1901('0x16')][_0x1901('0x17')]({'raw':_0xc9ef5[_0x1901('0x18')]?_0xc9ef5['options'][_0x1901('0x19')]===undefined?!![]:![]:!![],'where':_0xc9ef5[_0x1901('0x18')]?_0xc9ef5[_0x1901('0x18')][_0x1901('0x1a')]||null:null,'attributes':_0xc9ef5['options']?_0xc9ef5['options'][_0x1901('0x1b')]||null:null,'limit':_0xc9ef5['options']?_0xc9ef5['options'][_0x1901('0x1c')]||null:null,'include':_0xc9ef5[_0x1901('0x18')]?_0xc9ef5['options']['include']?_[_0x1901('0x1d')](_0xc9ef5[_0x1901('0x18')][_0x1901('0x1e')],function(_0x15b559){return{'model':db[_0x15b559[_0x1901('0x1f')]],'as':_0x15b559['as'],'attributes':_0x15b559[_0x1901('0x1b')],'include':_0x15b559['include']?_['map'](_0x15b559[_0x1901('0x1e')],function(_0x222c3c){return{'model':db[_0x222c3c[_0x1901('0x1f')]],'as':_0x222c3c['as'],'attributes':_0x222c3c['attributes'],'include':_0x222c3c[_0x1901('0x1e')]?_[_0x1901('0x1d')](_0x222c3c[_0x1901('0x1e')],function(_0x20be10){return{'model':db[_0x20be10['model']],'as':_0x20be10['as'],'attributes':_0x20be10[_0x1901('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1901('0xb')](function(_0x3c2701){logger[_0x1901('0xc')]('GetSugarcrmAccount',_0xc9ef5);logger[_0x1901('0x20')](_0x1901('0x15'),_0xc9ef5,JSON[_0x1901('0xf')](_0x3c2701));_0x429231(_0x3c2701);})[_0x1901('0x14')](function(_0x1582d2){logger[_0x1901('0x10')](_0x1901('0x15'),_0x1582d2[_0x1901('0x12')],_0xc9ef5);_0x5523f2(_0x3c1298[_0x1901('0x10')](0x1f4,_0x1582d2[_0x1901('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x2ff026){var _0xa102f0=this;return new Promise(function(_0x17f0b6,_0xd6231a){return db[_0x1901('0x16')][_0x1901('0x21')]({'raw':_0x2ff026[_0x1901('0x18')]?_0x2ff026[_0x1901('0x18')][_0x1901('0x19')]===undefined?!![]:![]:!![],'where':_0x2ff026['options']?_0x2ff026[_0x1901('0x18')][_0x1901('0x1a')]||null:null,'attributes':_0x2ff026['options']?_0x2ff026[_0x1901('0x18')][_0x1901('0x1b')]||null:null,'include':_0x2ff026[_0x1901('0x18')]?_0x2ff026[_0x1901('0x18')][_0x1901('0x1e')]?_[_0x1901('0x1d')](_0x2ff026['options'][_0x1901('0x1e')],function(_0xa37a6){return{'model':db[_0xa37a6[_0x1901('0x1f')]],'as':_0xa37a6['as'],'attributes':_0xa37a6[_0x1901('0x1b')],'include':_0xa37a6['include']?_['map'](_0xa37a6[_0x1901('0x1e')],function(_0x13c1ec){return{'model':db[_0x13c1ec[_0x1901('0x1f')]],'as':_0x13c1ec['as'],'attributes':_0x13c1ec[_0x1901('0x1b')],'include':_0x13c1ec[_0x1901('0x1e')]?_[_0x1901('0x1d')](_0x13c1ec[_0x1901('0x1e')],function(_0x1f6d83){return{'model':db[_0x1f6d83[_0x1901('0x1f')]],'as':_0x1f6d83['as'],'attributes':_0x1f6d83[_0x1901('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1901('0xb')](function(_0x5eabf0){logger[_0x1901('0xc')](_0x1901('0x22'),_0x2ff026);logger[_0x1901('0x20')]('ShowSugarcrmAccount',_0x2ff026,JSON['stringify'](_0x5eabf0));_0x17f0b6(_0x5eabf0);})['catch'](function(_0x4a8894){logger[_0x1901('0x10')]('ShowSugarcrmAccount',_0x4a8894[_0x1901('0x12')],_0x2ff026);_0xd6231a(_0xa102f0[_0x1901('0x10')](0x1f4,_0x4a8894['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 0587adf..e44d587 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 _0x03b3=['post','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x10891d,_0x461a61){var _0x46b28c=function(_0x41f3b5){while(--_0x41f3b5){_0x10891d['push'](_0x10891d['shift']());}};_0x46b28c(++_0x461a61);}(_0x03b3,0x167));var _0x303b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03b3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x303b('0x0'));var util=require('util');var path=require(_0x303b('0x1'));var timeout=require('connect-timeout');var express=require(_0x303b('0x2'));var router=express[_0x303b('0x3')]();var auth=require(_0x303b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x303b('0x5'));router['get']('/',auth[_0x303b('0x6')](),controller['index']);router[_0x303b('0x7')](_0x303b('0x8'),auth[_0x303b('0x6')](),controller[_0x303b('0x9')]);router[_0x303b('0x7')](_0x303b('0xa'),auth[_0x303b('0x6')](),controller[_0x303b('0xb')]);router[_0x303b('0x7')](_0x303b('0xc'),auth[_0x303b('0x6')](),controller['getSubjects']);router[_0x303b('0x7')](_0x303b('0xd'),auth[_0x303b('0x6')](),controller[_0x303b('0xe')]);router[_0x303b('0xf')]('/',auth['isAuthenticated'](),controller[_0x303b('0x10')]);router[_0x303b('0x11')](_0x303b('0x8'),auth[_0x303b('0x6')](),controller[_0x303b('0x12')]);router[_0x303b('0x13')](_0x303b('0x8'),auth['isAuthenticated'](),controller[_0x303b('0x14')]);module[_0x303b('0x15')]=router; \ No newline at end of file +var _0xd7f3=['get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller'];(function(_0x5a11be,_0x45c909){var _0x1a591b=function(_0x24dc45){while(--_0x24dc45){_0x5a11be['push'](_0x5a11be['shift']());}};_0x1a591b(++_0x45c909);}(_0xd7f3,0x151));var _0x3d7f=function(_0x3a4c07,_0x18440c){_0x3a4c07=_0x3a4c07-0x0;var _0x5a4943=_0xd7f3[_0x3a4c07];return _0x5a4943;};'use strict';var multer=require(_0x3d7f('0x0'));var util=require(_0x3d7f('0x1'));var path=require(_0x3d7f('0x2'));var timeout=require(_0x3d7f('0x3'));var express=require(_0x3d7f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3d7f('0x5'));var config=require(_0x3d7f('0x6'));var controller=require(_0x3d7f('0x7'));router[_0x3d7f('0x8')]('/',auth[_0x3d7f('0x9')](),controller[_0x3d7f('0xa')]);router[_0x3d7f('0x8')](_0x3d7f('0xb'),auth[_0x3d7f('0x9')](),controller[_0x3d7f('0xc')]);router[_0x3d7f('0x8')](_0x3d7f('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x3d7f('0x8')](_0x3d7f('0xe'),auth['isAuthenticated'](),controller[_0x3d7f('0xf')]);router[_0x3d7f('0x8')](_0x3d7f('0x10'),auth[_0x3d7f('0x9')](),controller[_0x3d7f('0x11')]);router[_0x3d7f('0x12')]('/',auth['isAuthenticated'](),controller[_0x3d7f('0x13')]);router[_0x3d7f('0x14')]('/:id',auth[_0x3d7f('0x9')](),controller['update']);router['delete'](_0x3d7f('0xb'),auth[_0x3d7f('0x9')](),controller[_0x3d7f('0x15')]);module[_0x3d7f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 9a7eadd..7e868cf 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 _0xb6df=['sequelize','exports','STRING'];(function(_0x213ac3,_0x4666b6){var _0x3a20b5=function(_0xf6d9c0){while(--_0xf6d9c0){_0x213ac3['push'](_0x213ac3['shift']());}};_0x3a20b5(++_0x4666b6);}(_0xb6df,0x8d));var _0xfb6d=function(_0xe836cc,_0x46bdc1){_0xe836cc=_0xe836cc-0x0;var _0x379263=_0xb6df[_0xe836cc];return _0x379263;};'use strict';var Sequelize=require(_0xfb6d('0x0'));module[_0xfb6d('0x1')]={'name':{'type':Sequelize[_0xfb6d('0x2')]},'description':{'type':Sequelize[_0xfb6d('0x2')]}}; \ No newline at end of file +var _0x854b=['STRING','sequelize','exports'];(function(_0x18166f,_0x5e44d0){var _0x19803e=function(_0x2ead60){while(--_0x2ead60){_0x18166f['push'](_0x18166f['shift']());}};_0x19803e(++_0x5e44d0);}(_0x854b,0x145));var _0xb854=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x854b[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0xb854('0x0'));module[_0xb854('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb854('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 37cd319..1463c25 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 _0xdfe3=['rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','SugarcrmField','nolimit','getSubjects','findOne','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','index','map','SugarcrmConfiguration'];(function(_0x51a6d6,_0x3c9c49){var _0x5ef1a8=function(_0x8ff84a){while(--_0x8ff84a){_0x51a6d6['push'](_0x51a6d6['shift']());}};_0x5ef1a8(++_0x3c9c49);}(_0xdfe3,0x1ad));var _0x3dfe=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xdfe3[_0x178e48];return _0x440d7e;};'use strict';var pdf=require(_0x3dfe('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3dfe('0x1'));var zipdir=require(_0x3dfe('0x2'));var jsonpatch=require(_0x3dfe('0x3'));var rp=require(_0x3dfe('0x4'));var moment=require(_0x3dfe('0x5'));var BPromise=require(_0x3dfe('0x6'));var Mustache=require(_0x3dfe('0x7'));var util=require('util');var path=require(_0x3dfe('0x8'));var sox=require(_0x3dfe('0x9'));var csv=require(_0x3dfe('0xa'));var ejs=require(_0x3dfe('0xb'));var fs=require('fs');var _=require(_0x3dfe('0xc'));var squel=require(_0x3dfe('0xd'));var crypto=require(_0x3dfe('0xe'));var jsforce=require(_0x3dfe('0xf'));var deskjs=require(_0x3dfe('0x10'));var toCsv=require(_0x3dfe('0xa'));var querystring=require(_0x3dfe('0x11'));var Papa=require(_0x3dfe('0x12'));var Redis=require(_0x3dfe('0x13'));var authService=require(_0x3dfe('0x14'));var qs=require(_0x3dfe('0x15'));var as=require(_0x3dfe('0x16'));var hardwareService=require(_0x3dfe('0x17'));var logger=require(_0x3dfe('0x18'))(_0x3dfe('0x19'));var utils=require(_0x3dfe('0x1a'));var config=require(_0x3dfe('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3dfe('0x1c'));var client=jayson[_0x3dfe('0x1d')][_0x3dfe('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x2fdd5e,_0xbcfc50,_0x23d3ed){if(_0x23d3ed){var _0x459642=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x459642[_0x3dfe('0x1f')](_0xbcfc50)){return _0x2fdd5e;}else{throw new db[(_0x3dfe('0x20'))][(_0x3dfe('0x21'))](_0x3dfe('0x22'));}}else{return _0x2fdd5e;}}function respondWithRpcPromise(_0x27bf32,_0x36c737,_0x42a401,_0x125cb0){return new BPromise(function(_0x3549c1,_0x5042b8){var _0x1bde86=_0x125cb0||client;return _0x1bde86[_0x3dfe('0x23')](_0x27bf32,_0x42a401)[_0x3dfe('0x24')](function(_0x547757){logger[_0x3dfe('0x25')](_0x3dfe('0x26'),_0x36c737,_0x3dfe('0x27'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x36c737,_0x3dfe('0x27'),JSON['stringify'](_0x547757));if(_0x547757[_0x3dfe('0x28')]){if(_0x547757[_0x3dfe('0x28')][_0x3dfe('0x29')]===0x1f4){logger[_0x3dfe('0x28')](_0x3dfe('0x26'),_0x36c737,_0x547757[_0x3dfe('0x28')]['message']);return _0x5042b8(_0x547757[_0x3dfe('0x28')][_0x3dfe('0x2a')]);}logger['error'](_0x3dfe('0x26'),_0x36c737,_0x547757[_0x3dfe('0x28')]['message']);return _0x3549c1(_0x547757[_0x3dfe('0x28')][_0x3dfe('0x2a')]);}else{logger[_0x3dfe('0x25')](_0x3dfe('0x26'),_0x36c737,_0x3dfe('0x27'));_0x3549c1(_0x547757[_0x3dfe('0x2b')][_0x3dfe('0x2a')]);}})['catch'](function(_0x3c027d){logger[_0x3dfe('0x28')](_0x3dfe('0x26'),_0x36c737,_0x3c027d);_0x5042b8(_0x3c027d);});});}function respondWithStatusCode(_0x842678,_0x413520){_0x413520=_0x413520||0xcc;return function(_0x4b5e11){if(_0x4b5e11){return _0x842678[_0x3dfe('0x2c')](_0x413520);}return _0x842678[_0x3dfe('0x2d')](_0x413520)[_0x3dfe('0x2e')]();};}function respondWithResult(_0x1915d2,_0x3c10b2){_0x3c10b2=_0x3c10b2||0xc8;return function(_0xcb70a0){if(_0xcb70a0){return _0x1915d2[_0x3dfe('0x2d')](_0x3c10b2)[_0x3dfe('0x2f')](_0xcb70a0);}};}function respondWithFilteredResult(_0x41631c,_0x2d3c1c){return function(_0x912553){if(_0x912553){var _0x21216e=_0x912553[_0x3dfe('0x30')],_0x354a55=_0x2d3c1c[_0x3dfe('0x31')],_0x463c31=_0x2d3c1c[_0x3dfe('0x31')]+_0x2d3c1c['limit'],_0xb88420;if(_0x463c31>=_0x21216e){_0x463c31=_0x21216e;_0xb88420=0xc8;}else{_0xb88420=0xce;}_0x41631c['status'](_0xb88420);return _0x41631c[_0x3dfe('0x32')](_0x3dfe('0x33'),_0x354a55+'-'+_0x463c31+'/'+_0x21216e)[_0x3dfe('0x2f')](_0x912553);}return null;};}function patchUpdates(_0x179ffe){return function(_0x220baa){try{jsonpatch[_0x3dfe('0x34')](_0x220baa,_0x179ffe,!![]);}catch(_0x572fe9){return BPromise['reject'](_0x572fe9);}return _0x220baa[_0x3dfe('0x35')]();};}function saveUpdates(_0xf6006f,_0x8901e8){return function(_0xcbcac5){if(_0xcbcac5){return _0xcbcac5[_0x3dfe('0x36')](_0xf6006f)[_0x3dfe('0x24')](function(_0x1edd76){return _0x1edd76;});}return null;};}function removeEntity(_0x463042,_0x154678){return function(_0x5e0c82){if(_0x5e0c82){return _0x5e0c82[_0x3dfe('0x37')]()[_0x3dfe('0x24')](function(){_0x463042[_0x3dfe('0x2d')](0xcc)[_0x3dfe('0x2e')]();});}};}function handleEntityNotFound(_0x22d4d6,_0x48b8c2){return function(_0x58598d){if(!_0x58598d){_0x22d4d6[_0x3dfe('0x2c')](0x194);}return _0x58598d;};}function handleError(_0x487ab1,_0x452500){_0x452500=_0x452500||0x1f4;return function(_0x22188f){logger[_0x3dfe('0x28')](_0x22188f[_0x3dfe('0x38')]);if(_0x22188f[_0x3dfe('0x39')]){delete _0x22188f['name'];}_0x487ab1[_0x3dfe('0x2d')](_0x452500)['send'](_0x22188f);};}exports[_0x3dfe('0x3a')]=function(_0x26658b,_0x26b95a){var _0x178d8c={},_0x27c0b8={},_0x216ab8={'count':0x0,'rows':[]};var _0x3fafb6=_[_0x3dfe('0x3b')](db[_0x3dfe('0x3c')][_0x3dfe('0x3d')],function(_0x3cc4a3){return{'name':_0x3cc4a3[_0x3dfe('0x3e')],'type':_0x3cc4a3[_0x3dfe('0x3f')]['key']};});_0x27c0b8[_0x3dfe('0x40')]=_[_0x3dfe('0x3b')](_0x3fafb6,_0x3dfe('0x39'));_0x27c0b8['query']=_[_0x3dfe('0x41')](_0x26658b[_0x3dfe('0x42')]);_0x27c0b8[_0x3dfe('0x43')]=_[_0x3dfe('0x44')](_0x27c0b8[_0x3dfe('0x40')],_0x27c0b8['query']);_0x178d8c['attributes']=_['intersection'](_0x27c0b8['model'],qs[_0x3dfe('0x45')](_0x26658b[_0x3dfe('0x42')][_0x3dfe('0x45')]));_0x178d8c['attributes']=_0x178d8c[_0x3dfe('0x46')][_0x3dfe('0x47')]?_0x178d8c[_0x3dfe('0x46')]:_0x27c0b8[_0x3dfe('0x40')];if(!_0x26658b[_0x3dfe('0x42')][_0x3dfe('0x48')]('nolimit')){_0x178d8c[_0x3dfe('0x49')]=qs[_0x3dfe('0x49')](_0x26658b[_0x3dfe('0x42')]['limit']);_0x178d8c[_0x3dfe('0x31')]=qs[_0x3dfe('0x31')](_0x26658b['query'][_0x3dfe('0x31')]);}_0x178d8c[_0x3dfe('0x4a')]=qs[_0x3dfe('0x4b')](_0x26658b[_0x3dfe('0x42')][_0x3dfe('0x4b')]);_0x178d8c[_0x3dfe('0x4c')]=qs[_0x3dfe('0x43')](_[_0x3dfe('0x4d')](_0x26658b[_0x3dfe('0x42')],_0x27c0b8['filters']));if(_0x26658b[_0x3dfe('0x42')][_0x3dfe('0x4e')]){_0x178d8c['where']=_[_0x3dfe('0x4f')](_0x178d8c[_0x3dfe('0x4c')],{'$or':_[_0x3dfe('0x3b')](_0x3fafb6,function(_0x260803){if(_0x260803[_0x3dfe('0x3f')]!==_0x3dfe('0x50')){var _0x722f0a={};_0x722f0a[_0x260803['name']]={'$like':'%'+_0x26658b[_0x3dfe('0x42')]['filter']+'%'};return _0x722f0a;}})});}_0x178d8c=_[_0x3dfe('0x4f')]({},_0x178d8c,_0x26658b[_0x3dfe('0x51')]);var _0x16140a={'where':_0x178d8c['where']};return db['SugarcrmConfiguration']['count'](_0x16140a)[_0x3dfe('0x24')](function(_0x4a3bbf){_0x216ab8[_0x3dfe('0x30')]=_0x4a3bbf;if(_0x26658b[_0x3dfe('0x42')][_0x3dfe('0x52')]){_0x178d8c[_0x3dfe('0x53')]=[{'all':!![]}];}return db[_0x3dfe('0x3c')][_0x3dfe('0x54')](_0x178d8c);})[_0x3dfe('0x24')](function(_0x454167){_0x216ab8[_0x3dfe('0x55')]=_0x454167;return _0x216ab8;})['then'](respondWithFilteredResult(_0x26b95a,_0x178d8c))[_0x3dfe('0x56')](handleError(_0x26b95a,null));};exports[_0x3dfe('0x57')]=function(_0x450628,_0x3c8680){var _0x25f94b={'raw':![],'where':{'id':_0x450628[_0x3dfe('0x58')]['id']}},_0x536e2e={};_0x536e2e['model']=_[_0x3dfe('0x41')](db[_0x3dfe('0x3c')][_0x3dfe('0x3d')]);_0x536e2e[_0x3dfe('0x42')]=_[_0x3dfe('0x41')](_0x450628['query']);_0x536e2e[_0x3dfe('0x43')]=_['intersection'](_0x536e2e[_0x3dfe('0x40')],_0x536e2e[_0x3dfe('0x42')]);_0x25f94b[_0x3dfe('0x46')]=_[_0x3dfe('0x44')](_0x536e2e[_0x3dfe('0x40')],qs[_0x3dfe('0x45')](_0x450628[_0x3dfe('0x42')][_0x3dfe('0x45')]));_0x25f94b['attributes']=_0x25f94b[_0x3dfe('0x46')][_0x3dfe('0x47')]?_0x25f94b[_0x3dfe('0x46')]:_0x536e2e['model'];if(_0x450628[_0x3dfe('0x42')]['includeAll']){_0x25f94b[_0x3dfe('0x53')]=[{'all':!![]}];}_0x25f94b=_[_0x3dfe('0x4f')]({},_0x25f94b,_0x450628[_0x3dfe('0x51')]);return db[_0x3dfe('0x3c')][_0x3dfe('0x59')](_0x25f94b)['then'](handleEntityNotFound(_0x3c8680,null))[_0x3dfe('0x24')](respondWithResult(_0x3c8680,null))[_0x3dfe('0x56')](handleError(_0x3c8680,null));};exports[_0x3dfe('0x5a')]=function(_0x34fdf4,_0x267d68){return db[_0x3dfe('0x3c')][_0x3dfe('0x5a')](_0x34fdf4[_0x3dfe('0x5b')],{})[_0x3dfe('0x24')](respondWithResult(_0x267d68,0xc9))['catch'](handleError(_0x267d68,null));};exports['update']=function(_0xa6db5f,_0xbf026e){if(_0xa6db5f[_0x3dfe('0x5b')]['id']){delete _0xa6db5f['body']['id'];}return db[_0x3dfe('0x3c')][_0x3dfe('0x59')]({'where':{'id':_0xa6db5f[_0x3dfe('0x58')]['id']}})[_0x3dfe('0x24')](handleEntityNotFound(_0xbf026e,null))['then'](saveUpdates(_0xa6db5f[_0x3dfe('0x5b')],null))[_0x3dfe('0x24')](respondWithResult(_0xbf026e,null))[_0x3dfe('0x56')](handleError(_0xbf026e,null));};exports[_0x3dfe('0x37')]=function(_0x21976d,_0x103815){return db[_0x3dfe('0x3c')][_0x3dfe('0x59')]({'where':{'id':_0x21976d[_0x3dfe('0x58')]['id']}})[_0x3dfe('0x24')](handleEntityNotFound(_0x103815,null))[_0x3dfe('0x24')](removeEntity(_0x103815,null))['catch'](handleError(_0x103815,null));};exports[_0x3dfe('0x5c')]=function(_0x2f025d,_0x157c28,_0x285619){var _0x1fb4b4={};var _0x5ebedf={};var _0x3580d9;var _0x16e87e;return db[_0x3dfe('0x3c')]['findOne']({'where':{'id':_0x2f025d[_0x3dfe('0x58')]['id']}})[_0x3dfe('0x24')](handleEntityNotFound(_0x157c28,null))[_0x3dfe('0x24')](function(_0x150511){if(_0x150511){_0x3580d9=_0x150511;_0x5ebedf['model']=_[_0x3dfe('0x41')](db[_0x3dfe('0x5d')]['rawAttributes']);_0x5ebedf['query']=_[_0x3dfe('0x41')](_0x2f025d[_0x3dfe('0x42')]);_0x5ebedf['filters']=_['intersection'](_0x5ebedf[_0x3dfe('0x40')],_0x5ebedf[_0x3dfe('0x42')]);_0x1fb4b4[_0x3dfe('0x46')]=_[_0x3dfe('0x44')](_0x5ebedf['model'],qs[_0x3dfe('0x45')](_0x2f025d[_0x3dfe('0x42')][_0x3dfe('0x45')]));_0x1fb4b4['attributes']=_0x1fb4b4[_0x3dfe('0x46')][_0x3dfe('0x47')]?_0x1fb4b4[_0x3dfe('0x46')]:_0x5ebedf['model'];_0x1fb4b4[_0x3dfe('0x4a')]=qs[_0x3dfe('0x4b')](_0x2f025d[_0x3dfe('0x42')][_0x3dfe('0x4b')]);_0x1fb4b4[_0x3dfe('0x4c')]=qs[_0x3dfe('0x43')](_[_0x3dfe('0x4d')](_0x2f025d[_0x3dfe('0x42')],_0x5ebedf[_0x3dfe('0x43')]));if(_0x2f025d[_0x3dfe('0x42')][_0x3dfe('0x4e')]){_0x1fb4b4['where']=_[_0x3dfe('0x4f')](_0x1fb4b4[_0x3dfe('0x4c')],{'$or':_[_0x3dfe('0x3b')](_0x1fb4b4[_0x3dfe('0x46')],function(_0x27a985){var _0x37f32b={};_0x37f32b[_0x27a985]={'$like':'%'+_0x2f025d[_0x3dfe('0x42')][_0x3dfe('0x4e')]+'%'};return _0x37f32b;})});}_0x1fb4b4=_['merge']({},_0x1fb4b4,_0x2f025d[_0x3dfe('0x51')]);return _0x3580d9['getFields'](_0x1fb4b4);}})[_0x3dfe('0x24')](function(_0x561323){if(_0x561323){_0x16e87e=_0x561323[_0x3dfe('0x47')];if(!_0x2f025d[_0x3dfe('0x42')][_0x3dfe('0x48')](_0x3dfe('0x5e'))){_0x1fb4b4[_0x3dfe('0x49')]=qs['limit'](_0x2f025d[_0x3dfe('0x42')][_0x3dfe('0x49')]);_0x1fb4b4['offset']=qs[_0x3dfe('0x31')](_0x2f025d[_0x3dfe('0x42')][_0x3dfe('0x31')]);}return _0x3580d9[_0x3dfe('0x5c')](_0x1fb4b4);}})[_0x3dfe('0x24')](function(_0x7fbe44){if(_0x7fbe44){return _0x7fbe44?{'count':_0x16e87e,'rows':_0x7fbe44}:null;}})[_0x3dfe('0x24')](respondWithResult(_0x157c28,null))[_0x3dfe('0x56')](handleError(_0x157c28,null));};exports[_0x3dfe('0x5f')]=function(_0x26d19e,_0x2d9a1d,_0x5431b1){var _0x241f6d={};var _0x200750={};var _0x3ae907;var _0x31f0e8;return db[_0x3dfe('0x3c')][_0x3dfe('0x60')]({'where':{'id':_0x26d19e[_0x3dfe('0x58')]['id']}})[_0x3dfe('0x24')](handleEntityNotFound(_0x2d9a1d,null))['then'](function(_0x5190fe){if(_0x5190fe){_0x3ae907=_0x5190fe;_0x200750['model']=_['keys'](db['SugarcrmField'][_0x3dfe('0x3d')]);_0x200750['query']=_[_0x3dfe('0x41')](_0x26d19e['query']);_0x200750['filters']=_[_0x3dfe('0x44')](_0x200750['model'],_0x200750[_0x3dfe('0x42')]);_0x241f6d[_0x3dfe('0x46')]=_[_0x3dfe('0x44')](_0x200750[_0x3dfe('0x40')],qs[_0x3dfe('0x45')](_0x26d19e[_0x3dfe('0x42')][_0x3dfe('0x45')]));_0x241f6d[_0x3dfe('0x46')]=_0x241f6d[_0x3dfe('0x46')]['length']?_0x241f6d[_0x3dfe('0x46')]:_0x200750[_0x3dfe('0x40')];_0x241f6d[_0x3dfe('0x4a')]=qs[_0x3dfe('0x4b')](_0x26d19e[_0x3dfe('0x42')]['sort']);_0x241f6d[_0x3dfe('0x4c')]=qs[_0x3dfe('0x43')](_[_0x3dfe('0x4d')](_0x26d19e[_0x3dfe('0x42')],_0x200750[_0x3dfe('0x43')]));if(_0x26d19e[_0x3dfe('0x42')][_0x3dfe('0x4e')]){_0x241f6d['where']=_['merge'](_0x241f6d[_0x3dfe('0x4c')],{'$or':_[_0x3dfe('0x3b')](_0x241f6d[_0x3dfe('0x46')],function(_0x299fcf){var _0x1785de={};_0x1785de[_0x299fcf]={'$like':'%'+_0x26d19e[_0x3dfe('0x42')][_0x3dfe('0x4e')]+'%'};return _0x1785de;})});}_0x241f6d=_['merge']({},_0x241f6d,_0x26d19e[_0x3dfe('0x51')]);return _0x3ae907[_0x3dfe('0x5f')](_0x241f6d);}})['then'](function(_0x2a8090){if(_0x2a8090){_0x31f0e8=_0x2a8090[_0x3dfe('0x47')];if(!_0x26d19e[_0x3dfe('0x42')]['hasOwnProperty']('nolimit')){_0x241f6d[_0x3dfe('0x49')]=qs[_0x3dfe('0x49')](_0x26d19e['query'][_0x3dfe('0x49')]);_0x241f6d[_0x3dfe('0x31')]=qs[_0x3dfe('0x31')](_0x26d19e[_0x3dfe('0x42')]['offset']);}return _0x3ae907[_0x3dfe('0x5f')](_0x241f6d);}})['then'](function(_0x2ab339){if(_0x2ab339){return _0x2ab339?{'count':_0x31f0e8,'rows':_0x2ab339}:null;}})[_0x3dfe('0x24')](respondWithResult(_0x2d9a1d,null))[_0x3dfe('0x56')](handleError(_0x2d9a1d,null));};exports[_0x3dfe('0x61')]=function(_0x477845,_0xdf15bc,_0x242ea1){var _0x34d91a={};var _0xe41ca1={};var _0x18dfa5;var _0x26fb12;return db[_0x3dfe('0x3c')][_0x3dfe('0x60')]({'where':{'id':_0x477845[_0x3dfe('0x58')]['id']}})[_0x3dfe('0x24')](handleEntityNotFound(_0xdf15bc,null))[_0x3dfe('0x24')](function(_0xc96c89){if(_0xc96c89){_0x18dfa5=_0xc96c89;_0xe41ca1['model']=_[_0x3dfe('0x41')](db[_0x3dfe('0x5d')][_0x3dfe('0x3d')]);_0xe41ca1[_0x3dfe('0x42')]=_[_0x3dfe('0x41')](_0x477845['query']);_0xe41ca1[_0x3dfe('0x43')]=_['intersection'](_0xe41ca1['model'],_0xe41ca1[_0x3dfe('0x42')]);_0x34d91a['attributes']=_[_0x3dfe('0x44')](_0xe41ca1[_0x3dfe('0x40')],qs[_0x3dfe('0x45')](_0x477845[_0x3dfe('0x42')][_0x3dfe('0x45')]));_0x34d91a[_0x3dfe('0x46')]=_0x34d91a['attributes'][_0x3dfe('0x47')]?_0x34d91a['attributes']:_0xe41ca1[_0x3dfe('0x40')];_0x34d91a[_0x3dfe('0x4a')]=qs[_0x3dfe('0x4b')](_0x477845['query'][_0x3dfe('0x4b')]);_0x34d91a[_0x3dfe('0x4c')]=qs[_0x3dfe('0x43')](_[_0x3dfe('0x4d')](_0x477845[_0x3dfe('0x42')],_0xe41ca1['filters']));if(_0x477845['query'][_0x3dfe('0x4e')]){_0x34d91a[_0x3dfe('0x4c')]=_['merge'](_0x34d91a['where'],{'$or':_[_0x3dfe('0x3b')](_0x34d91a[_0x3dfe('0x46')],function(_0x527e4e){var _0x24f71a={};_0x24f71a[_0x527e4e]={'$like':'%'+_0x477845[_0x3dfe('0x42')]['filter']+'%'};return _0x24f71a;})});}_0x34d91a=_[_0x3dfe('0x4f')]({},_0x34d91a,_0x477845[_0x3dfe('0x51')]);return _0x18dfa5[_0x3dfe('0x61')](_0x34d91a);}})[_0x3dfe('0x24')](function(_0x3aef08){if(_0x3aef08){_0x26fb12=_0x3aef08[_0x3dfe('0x47')];if(!_0x477845[_0x3dfe('0x42')][_0x3dfe('0x48')](_0x3dfe('0x5e'))){_0x34d91a['limit']=qs[_0x3dfe('0x49')](_0x477845['query'][_0x3dfe('0x49')]);_0x34d91a['offset']=qs[_0x3dfe('0x31')](_0x477845[_0x3dfe('0x42')][_0x3dfe('0x31')]);}return _0x18dfa5['getDescriptions'](_0x34d91a);}})[_0x3dfe('0x24')](function(_0x54e815){if(_0x54e815){return _0x54e815?{'count':_0x26fb12,'rows':_0x54e815}:null;}})['then'](respondWithResult(_0xdf15bc,null))[_0x3dfe('0x56')](handleError(_0xdf15bc,null));}; \ No newline at end of file +var _0x85ea=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','http','test','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','json','offset','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','options','count','includeAll','rows','show','include','merge','find','create','body','params','findOne','SugarcrmField','getFields','length','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x85ea,0xa8));var _0xa85e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x85ea[_0x4ae6ef];return _0x3cbb4e;};'use strict';var pdf=require(_0xa85e('0x0'));var emlformat=require(_0xa85e('0x1'));var rimraf=require(_0xa85e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa85e('0x3'));var rp=require(_0xa85e('0x4'));var moment=require(_0xa85e('0x5'));var BPromise=require(_0xa85e('0x6'));var Mustache=require(_0xa85e('0x7'));var util=require(_0xa85e('0x8'));var path=require('path');var sox=require(_0xa85e('0x9'));var csv=require(_0xa85e('0xa'));var ejs=require(_0xa85e('0xb'));var fs=require('fs');var _=require(_0xa85e('0xc'));var squel=require(_0xa85e('0xd'));var crypto=require(_0xa85e('0xe'));var jsforce=require(_0xa85e('0xf'));var deskjs=require(_0xa85e('0x10'));var toCsv=require(_0xa85e('0xa'));var querystring=require(_0xa85e('0x11'));var Papa=require(_0xa85e('0x12'));var Redis=require(_0xa85e('0x13'));var authService=require(_0xa85e('0x14'));var qs=require(_0xa85e('0x15'));var as=require(_0xa85e('0x16'));var hardwareService=require(_0xa85e('0x17'));var logger=require(_0xa85e('0x18'))(_0xa85e('0x19'));var utils=require('../../config/utils');var config=require(_0xa85e('0x1a'));var db=require(_0xa85e('0x1b'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa85e('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5ef96d,_0x1028ef,_0x3f0102){if(_0x3f0102){var _0x1ca51a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ca51a[_0xa85e('0x1d')](_0x1028ef)){return _0x5ef96d;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5ef96d;}}function respondWithRpcPromise(_0x217edb,_0x131a54,_0x38a618,_0xf175a5){return new BPromise(function(_0x4ebaf4,_0x4c0b2a){var _0x583e32=_0xf175a5||client;return _0x583e32[_0xa85e('0x1e')](_0x217edb,_0x38a618)[_0xa85e('0x1f')](function(_0x272b12){logger[_0xa85e('0x20')](_0xa85e('0x21'),_0x131a54,_0xa85e('0x22'));logger[_0xa85e('0x23')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x131a54,'request\x20sent',JSON[_0xa85e('0x24')](_0x272b12));if(_0x272b12[_0xa85e('0x25')]){if(_0x272b12[_0xa85e('0x25')]['code']===0x1f4){logger[_0xa85e('0x25')](_0xa85e('0x21'),_0x131a54,_0x272b12[_0xa85e('0x25')][_0xa85e('0x26')]);return _0x4c0b2a(_0x272b12['error']['message']);}logger['error'](_0xa85e('0x21'),_0x131a54,_0x272b12[_0xa85e('0x25')][_0xa85e('0x26')]);return _0x4ebaf4(_0x272b12[_0xa85e('0x25')][_0xa85e('0x26')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x131a54,_0xa85e('0x22'));_0x4ebaf4(_0x272b12[_0xa85e('0x27')][_0xa85e('0x26')]);}})[_0xa85e('0x28')](function(_0x3d31c9){logger[_0xa85e('0x25')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x131a54,_0x3d31c9);_0x4c0b2a(_0x3d31c9);});});}function respondWithStatusCode(_0x1918ce,_0x5487f5){_0x5487f5=_0x5487f5||0xcc;return function(_0x46ef61){if(_0x46ef61){return _0x1918ce['sendStatus'](_0x5487f5);}return _0x1918ce[_0xa85e('0x29')](_0x5487f5)[_0xa85e('0x2a')]();};}function respondWithResult(_0x17d33a,_0x390b75){_0x390b75=_0x390b75||0xc8;return function(_0x15befc){if(_0x15befc){return _0x17d33a[_0xa85e('0x29')](_0x390b75)[_0xa85e('0x2b')](_0x15befc);}};}function respondWithFilteredResult(_0x2383e0,_0x4b3950){return function(_0x334660){if(_0x334660){var _0x51347f=_0x334660['count'],_0x3fbbc1=_0x4b3950[_0xa85e('0x2c')],_0x23bc9c=_0x4b3950[_0xa85e('0x2c')]+_0x4b3950['limit'],_0x46f69b;if(_0x23bc9c>=_0x51347f){_0x23bc9c=_0x51347f;_0x46f69b=0xc8;}else{_0x46f69b=0xce;}_0x2383e0[_0xa85e('0x29')](_0x46f69b);return _0x2383e0[_0xa85e('0x2d')](_0xa85e('0x2e'),_0x3fbbc1+'-'+_0x23bc9c+'/'+_0x51347f)['json'](_0x334660);}return null;};}function patchUpdates(_0x2aa10f){return function(_0x4d89ff){try{jsonpatch[_0xa85e('0x2f')](_0x4d89ff,_0x2aa10f,!![]);}catch(_0x1335bb){return BPromise[_0xa85e('0x30')](_0x1335bb);}return _0x4d89ff['save']();};}function saveUpdates(_0xa8f58,_0x4ff98c){return function(_0x2da372){if(_0x2da372){return _0x2da372[_0xa85e('0x31')](_0xa8f58)[_0xa85e('0x1f')](function(_0x51ff69){return _0x51ff69;});}return null;};}function removeEntity(_0x5c9f28,_0x18e21a){return function(_0x57a3f0){if(_0x57a3f0){return _0x57a3f0[_0xa85e('0x32')]()['then'](function(){_0x5c9f28[_0xa85e('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21adca,_0x5d1c60){return function(_0x4f93e9){if(!_0x4f93e9){_0x21adca[_0xa85e('0x33')](0x194);}return _0x4f93e9;};}function handleError(_0x586ed1,_0x5d46cf){_0x5d46cf=_0x5d46cf||0x1f4;return function(_0x548cfa){logger['error'](_0x548cfa[_0xa85e('0x34')]);if(_0x548cfa[_0xa85e('0x35')]){delete _0x548cfa['name'];}_0x586ed1[_0xa85e('0x29')](_0x5d46cf)[_0xa85e('0x36')](_0x548cfa);};}exports[_0xa85e('0x37')]=function(_0x55537a,_0x3c6db5){var _0x1e6f64={},_0x486f4f={},_0xb5cd85={'count':0x0,'rows':[]};var _0x129cf7=_[_0xa85e('0x38')](db[_0xa85e('0x39')][_0xa85e('0x3a')],function(_0x2223f9){return{'name':_0x2223f9[_0xa85e('0x3b')],'type':_0x2223f9['type']['key']};});_0x486f4f[_0xa85e('0x3c')]=_['map'](_0x129cf7,_0xa85e('0x35'));_0x486f4f['query']=_[_0xa85e('0x3d')](_0x55537a[_0xa85e('0x3e')]);_0x486f4f[_0xa85e('0x3f')]=_[_0xa85e('0x40')](_0x486f4f[_0xa85e('0x3c')],_0x486f4f[_0xa85e('0x3e')]);_0x1e6f64[_0xa85e('0x41')]=_['intersection'](_0x486f4f[_0xa85e('0x3c')],qs['fields'](_0x55537a[_0xa85e('0x3e')][_0xa85e('0x42')]));_0x1e6f64[_0xa85e('0x41')]=_0x1e6f64[_0xa85e('0x41')]['length']?_0x1e6f64[_0xa85e('0x41')]:_0x486f4f[_0xa85e('0x3c')];if(!_0x55537a['query'][_0xa85e('0x43')](_0xa85e('0x44'))){_0x1e6f64[_0xa85e('0x45')]=qs[_0xa85e('0x45')](_0x55537a[_0xa85e('0x3e')][_0xa85e('0x45')]);_0x1e6f64['offset']=qs['offset'](_0x55537a[_0xa85e('0x3e')]['offset']);}_0x1e6f64[_0xa85e('0x46')]=qs[_0xa85e('0x47')](_0x55537a[_0xa85e('0x3e')][_0xa85e('0x47')]);_0x1e6f64[_0xa85e('0x48')]=qs[_0xa85e('0x3f')](_[_0xa85e('0x49')](_0x55537a[_0xa85e('0x3e')],_0x486f4f['filters']));if(_0x55537a[_0xa85e('0x3e')][_0xa85e('0x4a')]){_0x1e6f64['where']=_['merge'](_0x1e6f64[_0xa85e('0x48')],{'$or':_['map'](_0x129cf7,function(_0x5f2cee){if(_0x5f2cee[_0xa85e('0x4b')]!==_0xa85e('0x4c')){var _0x7903fb={};_0x7903fb[_0x5f2cee[_0xa85e('0x35')]]={'$like':'%'+_0x55537a['query'][_0xa85e('0x4a')]+'%'};return _0x7903fb;}})});}_0x1e6f64=_['merge']({},_0x1e6f64,_0x55537a[_0xa85e('0x4d')]);var _0x481106={'where':_0x1e6f64[_0xa85e('0x48')]};return db['SugarcrmConfiguration']['count'](_0x481106)[_0xa85e('0x1f')](function(_0x14f89b){_0xb5cd85[_0xa85e('0x4e')]=_0x14f89b;if(_0x55537a['query'][_0xa85e('0x4f')]){_0x1e6f64['include']=[{'all':!![]}];}return db[_0xa85e('0x39')]['findAll'](_0x1e6f64);})['then'](function(_0x2835f9){_0xb5cd85[_0xa85e('0x50')]=_0x2835f9;return _0xb5cd85;})['then'](respondWithFilteredResult(_0x3c6db5,_0x1e6f64))[_0xa85e('0x28')](handleError(_0x3c6db5,null));};exports[_0xa85e('0x51')]=function(_0x54ab46,_0x4f8463){var _0x2b3ba9={'raw':![],'where':{'id':_0x54ab46['params']['id']}},_0x152848={};_0x152848[_0xa85e('0x3c')]=_[_0xa85e('0x3d')](db[_0xa85e('0x39')]['rawAttributes']);_0x152848['query']=_[_0xa85e('0x3d')](_0x54ab46[_0xa85e('0x3e')]);_0x152848[_0xa85e('0x3f')]=_[_0xa85e('0x40')](_0x152848[_0xa85e('0x3c')],_0x152848[_0xa85e('0x3e')]);_0x2b3ba9[_0xa85e('0x41')]=_[_0xa85e('0x40')](_0x152848[_0xa85e('0x3c')],qs[_0xa85e('0x42')](_0x54ab46[_0xa85e('0x3e')]['fields']));_0x2b3ba9[_0xa85e('0x41')]=_0x2b3ba9[_0xa85e('0x41')]['length']?_0x2b3ba9[_0xa85e('0x41')]:_0x152848[_0xa85e('0x3c')];if(_0x54ab46['query'][_0xa85e('0x4f')]){_0x2b3ba9[_0xa85e('0x52')]=[{'all':!![]}];}_0x2b3ba9=_[_0xa85e('0x53')]({},_0x2b3ba9,_0x54ab46[_0xa85e('0x4d')]);return db[_0xa85e('0x39')][_0xa85e('0x54')](_0x2b3ba9)[_0xa85e('0x1f')](handleEntityNotFound(_0x4f8463,null))[_0xa85e('0x1f')](respondWithResult(_0x4f8463,null))[_0xa85e('0x28')](handleError(_0x4f8463,null));};exports['create']=function(_0x4de634,_0x5469dc){return db['SugarcrmConfiguration'][_0xa85e('0x55')](_0x4de634[_0xa85e('0x56')],{})['then'](respondWithResult(_0x5469dc,0xc9))[_0xa85e('0x28')](handleError(_0x5469dc,null));};exports[_0xa85e('0x31')]=function(_0x5629e1,_0x595f2f){if(_0x5629e1[_0xa85e('0x56')]['id']){delete _0x5629e1[_0xa85e('0x56')]['id'];}return db[_0xa85e('0x39')][_0xa85e('0x54')]({'where':{'id':_0x5629e1[_0xa85e('0x57')]['id']}})['then'](handleEntityNotFound(_0x595f2f,null))['then'](saveUpdates(_0x5629e1['body'],null))[_0xa85e('0x1f')](respondWithResult(_0x595f2f,null))[_0xa85e('0x28')](handleError(_0x595f2f,null));};exports[_0xa85e('0x32')]=function(_0x2ea171,_0x3a4c17){return db[_0xa85e('0x39')][_0xa85e('0x54')]({'where':{'id':_0x2ea171[_0xa85e('0x57')]['id']}})['then'](handleEntityNotFound(_0x3a4c17,null))[_0xa85e('0x1f')](removeEntity(_0x3a4c17,null))[_0xa85e('0x28')](handleError(_0x3a4c17,null));};exports['getFields']=function(_0x429f74,_0x314073,_0x105007){var _0x4fd9f2={};var _0x51042c={};var _0x49e199;var _0x10f04f;return db[_0xa85e('0x39')][_0xa85e('0x58')]({'where':{'id':_0x429f74['params']['id']}})[_0xa85e('0x1f')](handleEntityNotFound(_0x314073,null))[_0xa85e('0x1f')](function(_0x1822f7){if(_0x1822f7){_0x49e199=_0x1822f7;_0x51042c[_0xa85e('0x3c')]=_['keys'](db[_0xa85e('0x59')][_0xa85e('0x3a')]);_0x51042c[_0xa85e('0x3e')]=_[_0xa85e('0x3d')](_0x429f74[_0xa85e('0x3e')]);_0x51042c[_0xa85e('0x3f')]=_[_0xa85e('0x40')](_0x51042c[_0xa85e('0x3c')],_0x51042c[_0xa85e('0x3e')]);_0x4fd9f2[_0xa85e('0x41')]=_['intersection'](_0x51042c[_0xa85e('0x3c')],qs[_0xa85e('0x42')](_0x429f74['query'][_0xa85e('0x42')]));_0x4fd9f2[_0xa85e('0x41')]=_0x4fd9f2[_0xa85e('0x41')]['length']?_0x4fd9f2[_0xa85e('0x41')]:_0x51042c[_0xa85e('0x3c')];_0x4fd9f2['order']=qs[_0xa85e('0x47')](_0x429f74[_0xa85e('0x3e')][_0xa85e('0x47')]);_0x4fd9f2['where']=qs[_0xa85e('0x3f')](_[_0xa85e('0x49')](_0x429f74[_0xa85e('0x3e')],_0x51042c[_0xa85e('0x3f')]));if(_0x429f74['query'][_0xa85e('0x4a')]){_0x4fd9f2[_0xa85e('0x48')]=_['merge'](_0x4fd9f2[_0xa85e('0x48')],{'$or':_[_0xa85e('0x38')](_0x4fd9f2[_0xa85e('0x41')],function(_0x496e11){var _0x4c2c2b={};_0x4c2c2b[_0x496e11]={'$like':'%'+_0x429f74[_0xa85e('0x3e')][_0xa85e('0x4a')]+'%'};return _0x4c2c2b;})});}_0x4fd9f2=_[_0xa85e('0x53')]({},_0x4fd9f2,_0x429f74[_0xa85e('0x4d')]);return _0x49e199[_0xa85e('0x5a')](_0x4fd9f2);}})[_0xa85e('0x1f')](function(_0x1e3cb1){if(_0x1e3cb1){_0x10f04f=_0x1e3cb1[_0xa85e('0x5b')];if(!_0x429f74['query'][_0xa85e('0x43')](_0xa85e('0x44'))){_0x4fd9f2[_0xa85e('0x45')]=qs[_0xa85e('0x45')](_0x429f74[_0xa85e('0x3e')][_0xa85e('0x45')]);_0x4fd9f2['offset']=qs['offset'](_0x429f74[_0xa85e('0x3e')][_0xa85e('0x2c')]);}return _0x49e199[_0xa85e('0x5a')](_0x4fd9f2);}})[_0xa85e('0x1f')](function(_0x233f47){if(_0x233f47){return _0x233f47?{'count':_0x10f04f,'rows':_0x233f47}:null;}})['then'](respondWithResult(_0x314073,null))[_0xa85e('0x28')](handleError(_0x314073,null));};exports[_0xa85e('0x5c')]=function(_0x118078,_0x40af86,_0x4e4822){var _0x5cdc0c={};var _0x42ceb1={};var _0x129994;var _0x2d4629;return db[_0xa85e('0x39')]['findOne']({'where':{'id':_0x118078[_0xa85e('0x57')]['id']}})['then'](handleEntityNotFound(_0x40af86,null))[_0xa85e('0x1f')](function(_0x135aa0){if(_0x135aa0){_0x129994=_0x135aa0;_0x42ceb1[_0xa85e('0x3c')]=_[_0xa85e('0x3d')](db['SugarcrmField'][_0xa85e('0x3a')]);_0x42ceb1['query']=_[_0xa85e('0x3d')](_0x118078[_0xa85e('0x3e')]);_0x42ceb1[_0xa85e('0x3f')]=_[_0xa85e('0x40')](_0x42ceb1['model'],_0x42ceb1['query']);_0x5cdc0c[_0xa85e('0x41')]=_[_0xa85e('0x40')](_0x42ceb1[_0xa85e('0x3c')],qs[_0xa85e('0x42')](_0x118078[_0xa85e('0x3e')][_0xa85e('0x42')]));_0x5cdc0c['attributes']=_0x5cdc0c['attributes'][_0xa85e('0x5b')]?_0x5cdc0c[_0xa85e('0x41')]:_0x42ceb1['model'];_0x5cdc0c[_0xa85e('0x46')]=qs['sort'](_0x118078[_0xa85e('0x3e')]['sort']);_0x5cdc0c[_0xa85e('0x48')]=qs[_0xa85e('0x3f')](_[_0xa85e('0x49')](_0x118078[_0xa85e('0x3e')],_0x42ceb1[_0xa85e('0x3f')]));if(_0x118078['query']['filter']){_0x5cdc0c[_0xa85e('0x48')]=_['merge'](_0x5cdc0c[_0xa85e('0x48')],{'$or':_[_0xa85e('0x38')](_0x5cdc0c[_0xa85e('0x41')],function(_0x504f36){var _0x4337a2={};_0x4337a2[_0x504f36]={'$like':'%'+_0x118078[_0xa85e('0x3e')][_0xa85e('0x4a')]+'%'};return _0x4337a2;})});}_0x5cdc0c=_[_0xa85e('0x53')]({},_0x5cdc0c,_0x118078['options']);return _0x129994['getSubjects'](_0x5cdc0c);}})[_0xa85e('0x1f')](function(_0x1beff3){if(_0x1beff3){_0x2d4629=_0x1beff3[_0xa85e('0x5b')];if(!_0x118078[_0xa85e('0x3e')]['hasOwnProperty'](_0xa85e('0x44'))){_0x5cdc0c[_0xa85e('0x45')]=qs[_0xa85e('0x45')](_0x118078['query'][_0xa85e('0x45')]);_0x5cdc0c['offset']=qs[_0xa85e('0x2c')](_0x118078['query'][_0xa85e('0x2c')]);}return _0x129994[_0xa85e('0x5c')](_0x5cdc0c);}})['then'](function(_0x2db9a6){if(_0x2db9a6){return _0x2db9a6?{'count':_0x2d4629,'rows':_0x2db9a6}:null;}})[_0xa85e('0x1f')](respondWithResult(_0x40af86,null))['catch'](handleError(_0x40af86,null));};exports[_0xa85e('0x5d')]=function(_0x11ddc9,_0x5af84e,_0x2142a6){var _0x308a91={};var _0x3dc92a={};var _0x479e7a;var _0x4e3661;return db[_0xa85e('0x39')][_0xa85e('0x58')]({'where':{'id':_0x11ddc9[_0xa85e('0x57')]['id']}})['then'](handleEntityNotFound(_0x5af84e,null))[_0xa85e('0x1f')](function(_0xfef3af){if(_0xfef3af){_0x479e7a=_0xfef3af;_0x3dc92a[_0xa85e('0x3c')]=_[_0xa85e('0x3d')](db[_0xa85e('0x59')][_0xa85e('0x3a')]);_0x3dc92a['query']=_[_0xa85e('0x3d')](_0x11ddc9['query']);_0x3dc92a[_0xa85e('0x3f')]=_['intersection'](_0x3dc92a['model'],_0x3dc92a[_0xa85e('0x3e')]);_0x308a91[_0xa85e('0x41')]=_['intersection'](_0x3dc92a[_0xa85e('0x3c')],qs[_0xa85e('0x42')](_0x11ddc9[_0xa85e('0x3e')][_0xa85e('0x42')]));_0x308a91[_0xa85e('0x41')]=_0x308a91['attributes'][_0xa85e('0x5b')]?_0x308a91[_0xa85e('0x41')]:_0x3dc92a['model'];_0x308a91['order']=qs[_0xa85e('0x47')](_0x11ddc9['query']['sort']);_0x308a91['where']=qs['filters'](_[_0xa85e('0x49')](_0x11ddc9[_0xa85e('0x3e')],_0x3dc92a[_0xa85e('0x3f')]));if(_0x11ddc9[_0xa85e('0x3e')][_0xa85e('0x4a')]){_0x308a91[_0xa85e('0x48')]=_['merge'](_0x308a91['where'],{'$or':_[_0xa85e('0x38')](_0x308a91[_0xa85e('0x41')],function(_0x15f5f3){var _0x16cbd7={};_0x16cbd7[_0x15f5f3]={'$like':'%'+_0x11ddc9[_0xa85e('0x3e')][_0xa85e('0x4a')]+'%'};return _0x16cbd7;})});}_0x308a91=_[_0xa85e('0x53')]({},_0x308a91,_0x11ddc9[_0xa85e('0x4d')]);return _0x479e7a[_0xa85e('0x5d')](_0x308a91);}})[_0xa85e('0x1f')](function(_0x3f0d27){if(_0x3f0d27){_0x4e3661=_0x3f0d27[_0xa85e('0x5b')];if(!_0x11ddc9[_0xa85e('0x3e')][_0xa85e('0x43')](_0xa85e('0x44'))){_0x308a91[_0xa85e('0x45')]=qs[_0xa85e('0x45')](_0x11ddc9[_0xa85e('0x3e')]['limit']);_0x308a91[_0xa85e('0x2c')]=qs[_0xa85e('0x2c')](_0x11ddc9['query']['offset']);}return _0x479e7a[_0xa85e('0x5d')](_0x308a91);}})[_0xa85e('0x1f')](function(_0x666cce){if(_0x666cce){return _0x666cce?{'count':_0x4e3661,'rows':_0x666cce}:null;}})[_0xa85e('0x1f')](respondWithResult(_0x5af84e,null))[_0xa85e('0x28')](handleError(_0x5af84e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 87fb29f..126a2ae 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 _0xc087=['../../config/environment','define','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x294231,_0x1a3cc2){var _0x2d33df=function(_0x5bd78c){while(--_0x5bd78c){_0x294231['push'](_0x294231['shift']());}};_0x2d33df(++_0x1a3cc2);}(_0xc087,0x1cd));var _0x7c08=function(_0x4614eb,_0x5ee1de){_0x4614eb=_0x4614eb-0x0;var _0x123f27=_0xc087[_0x4614eb];return _0x123f27;};'use strict';var _=require(_0x7c08('0x0'));var util=require(_0x7c08('0x1'));var logger=require(_0x7c08('0x2'))('api');var moment=require(_0x7c08('0x3'));var BPromise=require('bluebird');var rp=require(_0x7c08('0x4'));var fs=require('fs');var path=require(_0x7c08('0x5'));var rimraf=require(_0x7c08('0x6'));var config=require(_0x7c08('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x5bd5e3,_0x17efb4){return _0x5bd5e3[_0x7c08('0x8')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c08=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x2c08,0x11e));var _0x82c0=function(_0x458837,_0x5ca8af){_0x458837=_0x458837-0x0;var _0x2d4c57=_0x2c08[_0x458837];return _0x2d4c57;};'use strict';var _=require(_0x82c0('0x0'));var util=require(_0x82c0('0x1'));var logger=require(_0x82c0('0x2'))(_0x82c0('0x3'));var moment=require(_0x82c0('0x4'));var BPromise=require(_0x82c0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x82c0('0x6'));var rimraf=require(_0x82c0('0x7'));var config=require(_0x82c0('0x8'));var attributes=require(_0x82c0('0x9'));module[_0x82c0('0xa')]=function(_0x455c3d,_0x4954cc){return _0x455c3d[_0x82c0('0xb')](_0x82c0('0xc'),attributes,{'tableName':_0x82c0('0xd'),'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 f111380..244c809 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 _0xe385=['request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe385,0xa9));var _0x5e38=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe385[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x5e38('0x0'));var util=require(_0x5e38('0x1'));var moment=require(_0x5e38('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e38('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e38('0x4'));var logger=require(_0x5e38('0x5'))(_0x5e38('0x6'));var config=require(_0x5e38('0x7'));var jayson=require(_0x5e38('0x8'));var client=jayson[_0x5e38('0x9')][_0x5e38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46feb6,_0xc47683,_0x2cf294){return new BPromise(function(_0x1ac0ce,_0x23f5aa){return client[_0x5e38('0xb')](_0x46feb6,_0x2cf294)[_0x5e38('0xc')](function(_0x3b50d2){logger[_0x5e38('0xd')](_0x5e38('0xe'),_0xc47683,_0x5e38('0xf'));logger[_0x5e38('0x10')](_0x5e38('0x11'),_0xc47683,_0x5e38('0xf'),JSON['stringify'](_0x3b50d2));if(_0x3b50d2['error']){if(_0x3b50d2[_0x5e38('0x12')][_0x5e38('0x13')]===0x1f4){logger['error'](_0x5e38('0xe'),_0xc47683,_0x3b50d2[_0x5e38('0x12')][_0x5e38('0x14')]);return _0x23f5aa(_0x3b50d2[_0x5e38('0x12')][_0x5e38('0x14')]);}logger[_0x5e38('0x12')](_0x5e38('0xe'),_0xc47683,_0x3b50d2['error'][_0x5e38('0x14')]);return _0x1ac0ce(_0x3b50d2[_0x5e38('0x12')]['message']);}else{logger[_0x5e38('0xd')](_0x5e38('0xe'),_0xc47683,_0x5e38('0xf'));_0x1ac0ce(_0x3b50d2[_0x5e38('0x15')][_0x5e38('0x14')]);}})[_0x5e38('0x16')](function(_0x5931d2){logger[_0x5e38('0x12')](_0x5e38('0xe'),_0xc47683,_0x5931d2);_0x23f5aa(_0x5931d2);});});} \ No newline at end of file +var _0x48e1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result'];(function(_0x159bea,_0xf2c151){var _0xfd58ae=function(_0x49eda4){while(--_0x49eda4){_0x159bea['push'](_0x159bea['shift']());}};_0xfd58ae(++_0xf2c151);}(_0x48e1,0x1e3));var _0x148e=function(_0x3306e7,_0x1505b3){_0x3306e7=_0x3306e7-0x0;var _0x465b84=_0x48e1[_0x3306e7];return _0x465b84;};'use strict';var _=require(_0x148e('0x0'));var util=require(_0x148e('0x1'));var moment=require(_0x148e('0x2'));var BPromise=require(_0x148e('0x3'));var rs=require(_0x148e('0x4'));var fs=require('fs');var Redis=require(_0x148e('0x5'));var db=require(_0x148e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x148e('0x7'));var config=require(_0x148e('0x8'));var jayson=require(_0x148e('0x9'));var client=jayson[_0x148e('0xa')][_0x148e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xac3983,_0x3ef5d1,_0x4168f7){return new BPromise(function(_0x578faf,_0x307054){return client[_0x148e('0xc')](_0xac3983,_0x4168f7)[_0x148e('0xd')](function(_0x27f3f6){logger[_0x148e('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3ef5d1,'request\x20sent');logger[_0x148e('0xf')](_0x148e('0x10'),_0x3ef5d1,_0x148e('0x11'),JSON[_0x148e('0x12')](_0x27f3f6));if(_0x27f3f6[_0x148e('0x13')]){if(_0x27f3f6['error']['code']===0x1f4){logger[_0x148e('0x13')](_0x148e('0x14'),_0x3ef5d1,_0x27f3f6[_0x148e('0x13')][_0x148e('0x15')]);return _0x307054(_0x27f3f6[_0x148e('0x13')][_0x148e('0x15')]);}logger[_0x148e('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3ef5d1,_0x27f3f6[_0x148e('0x13')]['message']);return _0x578faf(_0x27f3f6['error'][_0x148e('0x15')]);}else{logger[_0x148e('0xe')](_0x148e('0x14'),_0x3ef5d1,_0x148e('0x11'));_0x578faf(_0x27f3f6[_0x148e('0x16')][_0x148e('0x15')]);}})['catch'](function(_0x22847c){logger['error'](_0x148e('0x14'),_0x3ef5d1,_0x22847c);_0x307054(_0x22847c);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index cd1b7a1..58561f4 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 _0x4d39=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x2d796b,_0x44f8ce){var _0x4b820=function(_0x10ac88){while(--_0x10ac88){_0x2d796b['push'](_0x2d796b['shift']());}};_0x4b820(++_0x44f8ce);}(_0x4d39,0xc0));var _0x94d3=function(_0x3f615e,_0x3e0f98){_0x3f615e=_0x3f615e-0x0;var _0x21d5eb=_0x4d39[_0x3f615e];return _0x21d5eb;};'use strict';var multer=require('multer');var util=require(_0x94d3('0x0'));var path=require(_0x94d3('0x1'));var timeout=require(_0x94d3('0x2'));var express=require(_0x94d3('0x3'));var router=express['Router']();var auth=require(_0x94d3('0x4'));var interaction=require(_0x94d3('0x5'));var config=require(_0x94d3('0x6'));var controller=require(_0x94d3('0x7'));router[_0x94d3('0x8')]('/',auth[_0x94d3('0x9')](),controller[_0x94d3('0xa')]);router[_0x94d3('0x8')](_0x94d3('0xb'),auth[_0x94d3('0x9')](),controller[_0x94d3('0xc')]);router[_0x94d3('0xd')]('/',auth[_0x94d3('0x9')](),controller[_0x94d3('0xe')]);router['put'](_0x94d3('0xb'),auth['isAuthenticated'](),controller[_0x94d3('0xf')]);router[_0x94d3('0x10')]('/:id',auth[_0x94d3('0x9')](),controller[_0x94d3('0x11')]);module[_0x94d3('0x12')]=router; \ No newline at end of file +var _0x3815=['path','connect-timeout','Router','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util'];(function(_0x22cb86,_0x1e0be2){var _0x13f647=function(_0x5b6577){while(--_0x5b6577){_0x22cb86['push'](_0x22cb86['shift']());}};_0x13f647(++_0x1e0be2);}(_0x3815,0x14f));var _0x5381=function(_0x4af0b3,_0x1729d5){_0x4af0b3=_0x4af0b3-0x0;var _0x4ea8c0=_0x3815[_0x4af0b3];return _0x4ea8c0;};'use strict';var multer=require('multer');var util=require(_0x5381('0x0'));var path=require(_0x5381('0x1'));var timeout=require(_0x5381('0x2'));var express=require('express');var router=express[_0x5381('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5381('0x4'));var controller=require('./intSugarcrmField.controller');router[_0x5381('0x5')]('/',auth[_0x5381('0x6')](),controller[_0x5381('0x7')]);router[_0x5381('0x5')](_0x5381('0x8'),auth[_0x5381('0x6')](),controller[_0x5381('0x9')]);router[_0x5381('0xa')]('/',auth[_0x5381('0x6')](),controller[_0x5381('0xb')]);router[_0x5381('0xc')](_0x5381('0x8'),auth['isAuthenticated'](),controller[_0x5381('0xd')]);router['delete'](_0x5381('0x8'),auth[_0x5381('0x6')](),controller[_0x5381('0xe')]);module[_0x5381('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 59b8f2e..02e6738 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 _0xbfc0=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1b4fb1,_0x48d92c){var _0x1b58d7=function(_0x27317d){while(--_0x27317d){_0x1b4fb1['push'](_0x1b4fb1['shift']());}};_0x1b58d7(++_0x48d92c);}(_0xbfc0,0x125));var _0x0bfc=function(_0x30f87a,_0x2cce5a){_0x30f87a=_0x30f87a-0x0;var _0x3a8efc=_0xbfc0[_0x30f87a];return _0x3a8efc;};'use strict';var Sequelize=require(_0x0bfc('0x0'));module[_0x0bfc('0x1')]={'type':{'type':Sequelize[_0x0bfc('0x2')](_0x0bfc('0x3'),_0x0bfc('0x4'),_0x0bfc('0x5'),_0x0bfc('0x6')),'defaultValue':_0x0bfc('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0bfc('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x0bfc('0x3'),_0x0bfc('0x4'),_0x0bfc('0x5'))},'keyContent':{'type':Sequelize[_0x0bfc('0x7')]},'idField':{'type':Sequelize[_0x0bfc('0x7')]},'nameField':{'type':Sequelize[_0x0bfc('0x7')]},'customField':{'type':Sequelize[_0x0bfc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0bfc('0x7')]}}; \ No newline at end of file +var _0xafa5=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x58a3a4,_0x2df7a7){var _0x3c55dc=function(_0x204f3f){while(--_0x204f3f){_0x58a3a4['push'](_0x58a3a4['shift']());}};_0x3c55dc(++_0x2df7a7);}(_0xafa5,0x1af));var _0x5afa=function(_0x9a31cb,_0x58d4f9){_0x9a31cb=_0x9a31cb-0x0;var _0x489819=_0xafa5[_0x9a31cb];return _0x489819;};'use strict';var Sequelize=require('sequelize');module[_0x5afa('0x0')]={'type':{'type':Sequelize[_0x5afa('0x1')](_0x5afa('0x2'),_0x5afa('0x3'),_0x5afa('0x4'),_0x5afa('0x5')),'defaultValue':_0x5afa('0x2')},'content':{'type':Sequelize[_0x5afa('0x6')]},'key':{'type':Sequelize[_0x5afa('0x6')]},'keyType':{'type':Sequelize[_0x5afa('0x1')](_0x5afa('0x2'),'variable',_0x5afa('0x4'))},'keyContent':{'type':Sequelize[_0x5afa('0x6')]},'idField':{'type':Sequelize[_0x5afa('0x6')]},'nameField':{'type':Sequelize[_0x5afa('0x6')]},'customField':{'type':Sequelize[_0x5afa('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5afa('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 6b7135b..aa77b67 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 _0x4bce=['catch','show','keys','includeAll','include','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll'];(function(_0x484156,_0x6fe8a2){var _0x23b64a=function(_0x235811){while(--_0x235811){_0x484156['push'](_0x484156['shift']());}};_0x23b64a(++_0x6fe8a2);}(_0x4bce,0xe3));var _0xe4bc=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0x4bce[_0x3e182f];return _0x23edc9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe4bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4bc('0x1'));var jsonpatch=require(_0xe4bc('0x2'));var rp=require(_0xe4bc('0x3'));var moment=require('moment');var BPromise=require(_0xe4bc('0x4'));var Mustache=require(_0xe4bc('0x5'));var util=require(_0xe4bc('0x6'));var path=require('path');var sox=require(_0xe4bc('0x7'));var csv=require('to-csv');var ejs=require(_0xe4bc('0x8'));var fs=require('fs');var _=require(_0xe4bc('0x9'));var squel=require(_0xe4bc('0xa'));var crypto=require('crypto');var jsforce=require(_0xe4bc('0xb'));var deskjs=require(_0xe4bc('0xc'));var toCsv=require(_0xe4bc('0xd'));var querystring=require(_0xe4bc('0xe'));var Papa=require(_0xe4bc('0xf'));var Redis=require(_0xe4bc('0x10'));var authService=require(_0xe4bc('0x11'));var qs=require(_0xe4bc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4bc('0x13'));var logger=require(_0xe4bc('0x14'))(_0xe4bc('0x15'));var utils=require('../../config/utils');var config=require(_0xe4bc('0x16'));var db=require(_0xe4bc('0x17'))['db'];function respondWithStatusCode(_0x38531a,_0x26a39f){_0x26a39f=_0x26a39f||0xcc;return function(_0x1543aa){if(_0x1543aa){return _0x38531a['sendStatus'](_0x26a39f);}return _0x38531a[_0xe4bc('0x18')](_0x26a39f)[_0xe4bc('0x19')]();};}function respondWithResult(_0x584f9b,_0x59c707){_0x59c707=_0x59c707||0xc8;return function(_0xdad9d2){if(_0xdad9d2){return _0x584f9b[_0xe4bc('0x18')](_0x59c707)[_0xe4bc('0x1a')](_0xdad9d2);}};}function respondWithFilteredResult(_0x3f0b79,_0x468be5){return function(_0x53a384){if(_0x53a384){var _0x18cc61=_0x53a384[_0xe4bc('0x1b')],_0x4ed2c1=_0x468be5[_0xe4bc('0x1c')],_0x3c0be7=_0x468be5[_0xe4bc('0x1c')]+_0x468be5[_0xe4bc('0x1d')],_0x3114d7;if(_0x3c0be7>=_0x18cc61){_0x3c0be7=_0x18cc61;_0x3114d7=0xc8;}else{_0x3114d7=0xce;}_0x3f0b79[_0xe4bc('0x18')](_0x3114d7);return _0x3f0b79[_0xe4bc('0x1e')]('Content-Range',_0x4ed2c1+'-'+_0x3c0be7+'/'+_0x18cc61)[_0xe4bc('0x1a')](_0x53a384);}return null;};}function patchUpdates(_0x195eca){return function(_0xe720c9){try{jsonpatch[_0xe4bc('0x1f')](_0xe720c9,_0x195eca,!![]);}catch(_0x28da86){return BPromise[_0xe4bc('0x20')](_0x28da86);}return _0xe720c9[_0xe4bc('0x21')]();};}function saveUpdates(_0xcae933,_0x5816b5){return function(_0x2ff776){if(_0x2ff776){return _0x2ff776[_0xe4bc('0x22')](_0xcae933)[_0xe4bc('0x23')](function(_0xc3be41){return _0xc3be41;});}return null;};}function removeEntity(_0x560d7f,_0x53f668){return function(_0x1819d4){if(_0x1819d4){return _0x1819d4[_0xe4bc('0x24')]()[_0xe4bc('0x23')](function(){_0x560d7f['status'](0xcc)[_0xe4bc('0x19')]();});}};}function handleEntityNotFound(_0x22916d,_0x49bfec){return function(_0x1f38df){if(!_0x1f38df){_0x22916d[_0xe4bc('0x25')](0x194);}return _0x1f38df;};}function handleError(_0x496c83,_0x235b99){_0x235b99=_0x235b99||0x1f4;return function(_0x5003ca){logger[_0xe4bc('0x26')](_0x5003ca[_0xe4bc('0x27')]);if(_0x5003ca['name']){delete _0x5003ca[_0xe4bc('0x28')];}_0x496c83[_0xe4bc('0x18')](_0x235b99)[_0xe4bc('0x29')](_0x5003ca);};}exports[_0xe4bc('0x2a')]=function(_0x4772ea,_0x4613b5){var _0x388b3d={},_0x3f6b02={},_0x1f0618={'count':0x0,'rows':[]};var _0x798be5=_[_0xe4bc('0x2b')](db[_0xe4bc('0x2c')][_0xe4bc('0x2d')],function(_0x4bf6a7){return{'name':_0x4bf6a7[_0xe4bc('0x2e')],'type':_0x4bf6a7[_0xe4bc('0x2f')]['key']};});_0x3f6b02[_0xe4bc('0x30')]=_[_0xe4bc('0x2b')](_0x798be5,'name');_0x3f6b02[_0xe4bc('0x31')]=_['keys'](_0x4772ea[_0xe4bc('0x31')]);_0x3f6b02[_0xe4bc('0x32')]=_[_0xe4bc('0x33')](_0x3f6b02['model'],_0x3f6b02[_0xe4bc('0x31')]);_0x388b3d[_0xe4bc('0x34')]=_['intersection'](_0x3f6b02[_0xe4bc('0x30')],qs['fields'](_0x4772ea['query'][_0xe4bc('0x35')]));_0x388b3d[_0xe4bc('0x34')]=_0x388b3d[_0xe4bc('0x34')][_0xe4bc('0x36')]?_0x388b3d['attributes']:_0x3f6b02['model'];if(!_0x4772ea[_0xe4bc('0x31')][_0xe4bc('0x37')]('nolimit')){_0x388b3d[_0xe4bc('0x1d')]=qs[_0xe4bc('0x1d')](_0x4772ea[_0xe4bc('0x31')][_0xe4bc('0x1d')]);_0x388b3d[_0xe4bc('0x1c')]=qs[_0xe4bc('0x1c')](_0x4772ea[_0xe4bc('0x31')][_0xe4bc('0x1c')]);}_0x388b3d[_0xe4bc('0x38')]=qs[_0xe4bc('0x39')](_0x4772ea['query'][_0xe4bc('0x39')]);_0x388b3d[_0xe4bc('0x3a')]=qs[_0xe4bc('0x32')](_[_0xe4bc('0x3b')](_0x4772ea[_0xe4bc('0x31')],_0x3f6b02[_0xe4bc('0x32')]));if(_0x4772ea[_0xe4bc('0x31')][_0xe4bc('0x3c')]){_0x388b3d[_0xe4bc('0x3a')]=_[_0xe4bc('0x3d')](_0x388b3d[_0xe4bc('0x3a')],{'$or':_[_0xe4bc('0x2b')](_0x798be5,function(_0xd73899){if(_0xd73899['type']!==_0xe4bc('0x3e')){var _0x17f8ba={};_0x17f8ba[_0xd73899[_0xe4bc('0x28')]]={'$like':'%'+_0x4772ea[_0xe4bc('0x31')]['filter']+'%'};return _0x17f8ba;}})});}_0x388b3d=_[_0xe4bc('0x3d')]({},_0x388b3d,_0x4772ea[_0xe4bc('0x3f')]);var _0x56e0eb={'where':_0x388b3d[_0xe4bc('0x3a')]};return db[_0xe4bc('0x2c')][_0xe4bc('0x1b')](_0x56e0eb)[_0xe4bc('0x23')](function(_0x37d97e){_0x1f0618[_0xe4bc('0x1b')]=_0x37d97e;if(_0x4772ea['query']['includeAll']){_0x388b3d['include']=[{'all':!![]}];}return db[_0xe4bc('0x2c')][_0xe4bc('0x40')](_0x388b3d);})['then'](function(_0x38fad2){_0x1f0618['rows']=_0x38fad2;return _0x1f0618;})['then'](respondWithFilteredResult(_0x4613b5,_0x388b3d))[_0xe4bc('0x41')](handleError(_0x4613b5,null));};exports[_0xe4bc('0x42')]=function(_0x51d8aa,_0x4f8ddd){var _0x4d44c4={'raw':!![],'where':{'id':_0x51d8aa['params']['id']}},_0x5a3978={};_0x5a3978['model']=_[_0xe4bc('0x43')](db[_0xe4bc('0x2c')][_0xe4bc('0x2d')]);_0x5a3978[_0xe4bc('0x31')]=_['keys'](_0x51d8aa[_0xe4bc('0x31')]);_0x5a3978[_0xe4bc('0x32')]=_[_0xe4bc('0x33')](_0x5a3978[_0xe4bc('0x30')],_0x5a3978[_0xe4bc('0x31')]);_0x4d44c4[_0xe4bc('0x34')]=_[_0xe4bc('0x33')](_0x5a3978[_0xe4bc('0x30')],qs['fields'](_0x51d8aa[_0xe4bc('0x31')][_0xe4bc('0x35')]));_0x4d44c4['attributes']=_0x4d44c4['attributes'][_0xe4bc('0x36')]?_0x4d44c4[_0xe4bc('0x34')]:_0x5a3978[_0xe4bc('0x30')];if(_0x51d8aa[_0xe4bc('0x31')][_0xe4bc('0x44')]){_0x4d44c4[_0xe4bc('0x45')]=[{'all':!![]}];}_0x4d44c4=_[_0xe4bc('0x3d')]({},_0x4d44c4,_0x51d8aa[_0xe4bc('0x3f')]);return db[_0xe4bc('0x2c')]['find'](_0x4d44c4)[_0xe4bc('0x23')](handleEntityNotFound(_0x4f8ddd,null))[_0xe4bc('0x23')](respondWithResult(_0x4f8ddd,null))[_0xe4bc('0x41')](handleError(_0x4f8ddd,null));};exports['create']=function(_0x31557b,_0x38fce7){return db['SugarcrmField']['create'](_0x31557b['body'],{})[_0xe4bc('0x23')](respondWithResult(_0x38fce7,0xc9))[_0xe4bc('0x41')](handleError(_0x38fce7,null));};exports[_0xe4bc('0x22')]=function(_0x53a522,_0x580811){if(_0x53a522[_0xe4bc('0x46')]['id']){delete _0x53a522['body']['id'];}return db[_0xe4bc('0x2c')][_0xe4bc('0x47')]({'where':{'id':_0x53a522[_0xe4bc('0x48')]['id']}})[_0xe4bc('0x23')](handleEntityNotFound(_0x580811,null))['then'](saveUpdates(_0x53a522['body'],null))['then'](respondWithResult(_0x580811,null))[_0xe4bc('0x41')](handleError(_0x580811,null));};exports[_0xe4bc('0x24')]=function(_0x4e0af2,_0x447e29){return db['SugarcrmField']['find']({'where':{'id':_0x4e0af2[_0xe4bc('0x48')]['id']}})[_0xe4bc('0x23')](handleEntityNotFound(_0x447e29,null))[_0xe4bc('0x23')](removeEntity(_0x447e29,null))[_0xe4bc('0x41')](handleError(_0x447e29,null));}; \ No newline at end of file +var _0x9e11=['sendStatus','error','stack','name','send','index','map','SugarcrmField','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','count','include','findAll','catch','params','keys','intersection','length','includeAll','options','create','update','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','end','status','json','offset','set','Content-Range','apply','reject','save','then','destroy'];(function(_0x536ef8,_0x42f7a5){var _0x50e69c=function(_0x451645){while(--_0x451645){_0x536ef8['push'](_0x536ef8['shift']());}};_0x50e69c(++_0x42f7a5);}(_0x9e11,0x1e9));var _0x19e1=function(_0x1e857b,_0x539a01){_0x1e857b=_0x1e857b-0x0;var _0x15be42=_0x9e11[_0x1e857b];return _0x15be42;};'use strict';var pdf=require(_0x19e1('0x0'));var emlformat=require(_0x19e1('0x1'));var rimraf=require(_0x19e1('0x2'));var zipdir=require(_0x19e1('0x3'));var jsonpatch=require(_0x19e1('0x4'));var rp=require(_0x19e1('0x5'));var moment=require(_0x19e1('0x6'));var BPromise=require(_0x19e1('0x7'));var Mustache=require(_0x19e1('0x8'));var util=require('util');var path=require(_0x19e1('0x9'));var sox=require('sox');var csv=require(_0x19e1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x19e1('0xb'));var squel=require(_0x19e1('0xc'));var crypto=require(_0x19e1('0xd'));var jsforce=require(_0x19e1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x19e1('0xa'));var querystring=require(_0x19e1('0xf'));var Papa=require(_0x19e1('0x10'));var Redis=require(_0x19e1('0x11'));var authService=require(_0x19e1('0x12'));var qs=require(_0x19e1('0x13'));var as=require(_0x19e1('0x14'));var hardwareService=require(_0x19e1('0x15'));var logger=require('../../config/logger')(_0x19e1('0x16'));var utils=require(_0x19e1('0x17'));var config=require(_0x19e1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x465ac7,_0x3f71c9){_0x3f71c9=_0x3f71c9||0xcc;return function(_0x4645ed){if(_0x4645ed){return _0x465ac7['sendStatus'](_0x3f71c9);}return _0x465ac7['status'](_0x3f71c9)[_0x19e1('0x19')]();};}function respondWithResult(_0xf8cf4b,_0x4d2350){_0x4d2350=_0x4d2350||0xc8;return function(_0x479df5){if(_0x479df5){return _0xf8cf4b[_0x19e1('0x1a')](_0x4d2350)[_0x19e1('0x1b')](_0x479df5);}};}function respondWithFilteredResult(_0x5a791a,_0xdf5739){return function(_0x3c273d){if(_0x3c273d){var _0x479d8f=_0x3c273d['count'],_0x11daac=_0xdf5739[_0x19e1('0x1c')],_0x181fa3=_0xdf5739[_0x19e1('0x1c')]+_0xdf5739['limit'],_0x1a2a76;if(_0x181fa3>=_0x479d8f){_0x181fa3=_0x479d8f;_0x1a2a76=0xc8;}else{_0x1a2a76=0xce;}_0x5a791a['status'](_0x1a2a76);return _0x5a791a[_0x19e1('0x1d')](_0x19e1('0x1e'),_0x11daac+'-'+_0x181fa3+'/'+_0x479d8f)['json'](_0x3c273d);}return null;};}function patchUpdates(_0x4d1fb2){return function(_0x2deb22){try{jsonpatch[_0x19e1('0x1f')](_0x2deb22,_0x4d1fb2,!![]);}catch(_0x4275e1){return BPromise[_0x19e1('0x20')](_0x4275e1);}return _0x2deb22[_0x19e1('0x21')]();};}function saveUpdates(_0x4fc6bc,_0x455c2f){return function(_0x10dcf0){if(_0x10dcf0){return _0x10dcf0['update'](_0x4fc6bc)[_0x19e1('0x22')](function(_0x473549){return _0x473549;});}return null;};}function removeEntity(_0x105683,_0x334bc3){return function(_0x2b3c5d){if(_0x2b3c5d){return _0x2b3c5d[_0x19e1('0x23')]()[_0x19e1('0x22')](function(){_0x105683[_0x19e1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1881d8,_0x1f097c){return function(_0x16eb1c){if(!_0x16eb1c){_0x1881d8[_0x19e1('0x24')](0x194);}return _0x16eb1c;};}function handleError(_0x1a5c23,_0x8cd481){_0x8cd481=_0x8cd481||0x1f4;return function(_0x255081){logger[_0x19e1('0x25')](_0x255081[_0x19e1('0x26')]);if(_0x255081[_0x19e1('0x27')]){delete _0x255081[_0x19e1('0x27')];}_0x1a5c23[_0x19e1('0x1a')](_0x8cd481)[_0x19e1('0x28')](_0x255081);};}exports[_0x19e1('0x29')]=function(_0x1cf63b,_0x2cad57){var _0x579fad={},_0x105454={},_0x5a902a={'count':0x0,'rows':[]};var _0x5a9725=_[_0x19e1('0x2a')](db[_0x19e1('0x2b')][_0x19e1('0x2c')],function(_0x34825c){return{'name':_0x34825c['fieldName'],'type':_0x34825c[_0x19e1('0x2d')][_0x19e1('0x2e')]};});_0x105454[_0x19e1('0x2f')]=_['map'](_0x5a9725,_0x19e1('0x27'));_0x105454[_0x19e1('0x30')]=_['keys'](_0x1cf63b['query']);_0x105454[_0x19e1('0x31')]=_['intersection'](_0x105454[_0x19e1('0x2f')],_0x105454[_0x19e1('0x30')]);_0x579fad[_0x19e1('0x32')]=_['intersection'](_0x105454[_0x19e1('0x2f')],qs[_0x19e1('0x33')](_0x1cf63b[_0x19e1('0x30')][_0x19e1('0x33')]));_0x579fad[_0x19e1('0x32')]=_0x579fad[_0x19e1('0x32')]['length']?_0x579fad['attributes']:_0x105454[_0x19e1('0x2f')];if(!_0x1cf63b['query'][_0x19e1('0x34')]('nolimit')){_0x579fad['limit']=qs[_0x19e1('0x35')](_0x1cf63b[_0x19e1('0x30')]['limit']);_0x579fad[_0x19e1('0x1c')]=qs[_0x19e1('0x1c')](_0x1cf63b[_0x19e1('0x30')][_0x19e1('0x1c')]);}_0x579fad[_0x19e1('0x36')]=qs[_0x19e1('0x37')](_0x1cf63b[_0x19e1('0x30')][_0x19e1('0x37')]);_0x579fad['where']=qs[_0x19e1('0x31')](_[_0x19e1('0x38')](_0x1cf63b[_0x19e1('0x30')],_0x105454[_0x19e1('0x31')]));if(_0x1cf63b['query'][_0x19e1('0x39')]){_0x579fad[_0x19e1('0x3a')]=_[_0x19e1('0x3b')](_0x579fad[_0x19e1('0x3a')],{'$or':_['map'](_0x5a9725,function(_0x46046c){if(_0x46046c['type']!==_0x19e1('0x3c')){var _0x4d44e0={};_0x4d44e0[_0x46046c[_0x19e1('0x27')]]={'$like':'%'+_0x1cf63b[_0x19e1('0x30')]['filter']+'%'};return _0x4d44e0;}})});}_0x579fad=_[_0x19e1('0x3b')]({},_0x579fad,_0x1cf63b['options']);var _0x29cb31={'where':_0x579fad['where']};return db['SugarcrmField']['count'](_0x29cb31)[_0x19e1('0x22')](function(_0x2ae6d5){_0x5a902a[_0x19e1('0x3d')]=_0x2ae6d5;if(_0x1cf63b[_0x19e1('0x30')]['includeAll']){_0x579fad[_0x19e1('0x3e')]=[{'all':!![]}];}return db[_0x19e1('0x2b')][_0x19e1('0x3f')](_0x579fad);})[_0x19e1('0x22')](function(_0x1a096c){_0x5a902a['rows']=_0x1a096c;return _0x5a902a;})[_0x19e1('0x22')](respondWithFilteredResult(_0x2cad57,_0x579fad))[_0x19e1('0x40')](handleError(_0x2cad57,null));};exports['show']=function(_0x128133,_0xc2ffbd){var _0x9516c3={'raw':!![],'where':{'id':_0x128133[_0x19e1('0x41')]['id']}},_0x176732={};_0x176732['model']=_[_0x19e1('0x42')](db[_0x19e1('0x2b')][_0x19e1('0x2c')]);_0x176732[_0x19e1('0x30')]=_[_0x19e1('0x42')](_0x128133[_0x19e1('0x30')]);_0x176732[_0x19e1('0x31')]=_['intersection'](_0x176732['model'],_0x176732['query']);_0x9516c3[_0x19e1('0x32')]=_[_0x19e1('0x43')](_0x176732[_0x19e1('0x2f')],qs[_0x19e1('0x33')](_0x128133['query'][_0x19e1('0x33')]));_0x9516c3[_0x19e1('0x32')]=_0x9516c3[_0x19e1('0x32')][_0x19e1('0x44')]?_0x9516c3['attributes']:_0x176732['model'];if(_0x128133[_0x19e1('0x30')][_0x19e1('0x45')]){_0x9516c3[_0x19e1('0x3e')]=[{'all':!![]}];}_0x9516c3=_[_0x19e1('0x3b')]({},_0x9516c3,_0x128133[_0x19e1('0x46')]);return db[_0x19e1('0x2b')]['find'](_0x9516c3)[_0x19e1('0x22')](handleEntityNotFound(_0xc2ffbd,null))[_0x19e1('0x22')](respondWithResult(_0xc2ffbd,null))[_0x19e1('0x40')](handleError(_0xc2ffbd,null));};exports[_0x19e1('0x47')]=function(_0x1233ae,_0xa7f166){return db[_0x19e1('0x2b')]['create'](_0x1233ae['body'],{})[_0x19e1('0x22')](respondWithResult(_0xa7f166,0xc9))['catch'](handleError(_0xa7f166,null));};exports[_0x19e1('0x48')]=function(_0x567b5b,_0x8ca1de){if(_0x567b5b['body']['id']){delete _0x567b5b[_0x19e1('0x49')]['id'];}return db['SugarcrmField'][_0x19e1('0x4a')]({'where':{'id':_0x567b5b[_0x19e1('0x41')]['id']}})['then'](handleEntityNotFound(_0x8ca1de,null))[_0x19e1('0x22')](saveUpdates(_0x567b5b[_0x19e1('0x49')],null))[_0x19e1('0x22')](respondWithResult(_0x8ca1de,null))[_0x19e1('0x40')](handleError(_0x8ca1de,null));};exports[_0x19e1('0x23')]=function(_0x281144,_0x379f42){return db[_0x19e1('0x2b')][_0x19e1('0x4a')]({'where':{'id':_0x281144[_0x19e1('0x41')]['id']}})[_0x19e1('0x22')](handleEntityNotFound(_0x379f42,null))[_0x19e1('0x22')](removeEntity(_0x379f42,null))[_0x19e1('0x40')](handleError(_0x379f42,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 311ad2b..b645198 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 _0xc4fd=['exports','SugarcrmField','sugarcrm_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xc4fd,0x6d));var _0xdc4f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4fd[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xdc4f('0x0'));var util=require(_0xdc4f('0x1'));var logger=require(_0xdc4f('0x2'))(_0xdc4f('0x3'));var moment=require(_0xdc4f('0x4'));var BPromise=require(_0xdc4f('0x5'));var rp=require(_0xdc4f('0x6'));var fs=require('fs');var path=require(_0xdc4f('0x7'));var rimraf=require(_0xdc4f('0x8'));var config=require(_0xdc4f('0x9'));var attributes=require(_0xdc4f('0xa'));module[_0xdc4f('0xb')]=function(_0x421416,_0x2ff6a6){return _0x421416['define'](_0xdc4f('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xdc4f('0xd'),'fields':[_0xdc4f('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d9f=['rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','request-promise','path'];(function(_0x16d1f6,_0x170bbf){var _0x4798d1=function(_0x3d55e7){while(--_0x3d55e7){_0x16d1f6['push'](_0x16d1f6['shift']());}};_0x4798d1(++_0x170bbf);}(_0x6d9f,0xcd));var _0xf6d9=function(_0x428696,_0x4769c6){_0x428696=_0x428696-0x0;var _0x16135c=_0x6d9f[_0x428696];return _0x16135c;};'use strict';var _=require(_0xf6d9('0x0'));var util=require(_0xf6d9('0x1'));var logger=require(_0xf6d9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6d9('0x3'));var fs=require('fs');var path=require(_0xf6d9('0x4'));var rimraf=require(_0xf6d9('0x5'));var config=require(_0xf6d9('0x6'));var attributes=require(_0xf6d9('0x7'));module[_0xf6d9('0x8')]=function(_0x19c681,_0x1c4d24){return _0x19c681[_0xf6d9('0x9')](_0xf6d9('0xa'),attributes,{'tableName':_0xf6d9('0xb'),'paranoid':![],'indexes':[{'name':_0xf6d9('0xc'),'fields':[_0xf6d9('0xd'),_0xf6d9('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index a37c5c1..3301053 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 _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3f2ecf,_0x4ccad6){_0x3f2ecf=_0x3f2ecf-0x0;var _0xa6dd7e=_0x0b0e[_0x3f2ecf];return _0xa6dd7e;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5ae12b,_0x2637b7){var _0x5ccf68=function(_0x1a42b0){while(--_0x1a42b0){_0x5ae12b['push'](_0x5ae12b['shift']());}};_0x5ccf68(++_0x2637b7);}(_0xb10b,0x12a));var _0xbb10=function(_0x141908,_0x4e61dc){_0x141908=_0x141908-0x0;var _0x37e9c9=_0xb10b[_0x141908];return _0x37e9c9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index b49117b..900e021 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 _0xbcce=['/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index'];(function(_0x2204b2,_0x3b0895){var _0x47ea1d=function(_0x1a0907){while(--_0x1a0907){_0x2204b2['push'](_0x2204b2['shift']());}};_0x47ea1d(++_0x3b0895);}(_0xbcce,0x6d));var _0xebcc=function(_0x22aed5,_0x1aeef5){_0x22aed5=_0x22aed5-0x0;var _0x3fdedc=_0xbcce[_0x22aed5];return _0x3fdedc;};'use strict';var multer=require(_0xebcc('0x0'));var util=require(_0xebcc('0x1'));var path=require('path');var timeout=require(_0xebcc('0x2'));var express=require(_0xebcc('0x3'));var router=express[_0xebcc('0x4')]();var auth=require(_0xebcc('0x5'));var interaction=require(_0xebcc('0x6'));var config=require(_0xebcc('0x7'));var controller=require(_0xebcc('0x8'));router['get']('/',auth[_0xebcc('0x9')](),controller[_0xebcc('0xa')]);router['get'](_0xebcc('0xb'),auth[_0xebcc('0x9')](),controller[_0xebcc('0xc')]);router[_0xebcc('0xd')](_0xebcc('0xe'),auth['isAuthenticated'](),controller[_0xebcc('0xf')]);router['get'](_0xebcc('0x10'),auth[_0xebcc('0x9')](),controller[_0xebcc('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xebcc('0x12')]);router[_0xebcc('0x13')]('/:id/configurations',auth[_0xebcc('0x9')](),controller['addConfiguration']);router[_0xebcc('0x14')]('/:id',auth[_0xebcc('0x9')](),controller['update']);router[_0xebcc('0x15')]('/:id',auth[_0xebcc('0x9')](),controller[_0xebcc('0x16')]);module[_0xebcc('0x17')]=router; \ No newline at end of file +var _0x2568=['exports','multer','util','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','put','delete','destroy'];(function(_0x2d5f36,_0xb24d71){var _0x910218=function(_0x1c71ba){while(--_0x1c71ba){_0x2d5f36['push'](_0x2d5f36['shift']());}};_0x910218(++_0xb24d71);}(_0x2568,0x1a3));var _0x8256=function(_0x127fb5,_0x31aec4){_0x127fb5=_0x127fb5-0x0;var _0x4bff8a=_0x2568[_0x127fb5];return _0x4bff8a;};'use strict';var multer=require(_0x8256('0x0'));var util=require(_0x8256('0x1'));var path=require(_0x8256('0x2'));var timeout=require('connect-timeout');var express=require(_0x8256('0x3'));var router=express['Router']();var auth=require(_0x8256('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8256('0x5'));var controller=require('./intVtigerAccount.controller');router[_0x8256('0x6')]('/',auth[_0x8256('0x7')](),controller['index']);router[_0x8256('0x6')](_0x8256('0x8'),auth[_0x8256('0x7')](),controller[_0x8256('0x9')]);router[_0x8256('0x6')]('/:id/configurations',auth[_0x8256('0x7')](),controller[_0x8256('0xa')]);router[_0x8256('0x6')](_0x8256('0xb'),auth[_0x8256('0x7')](),controller[_0x8256('0xc')]);router[_0x8256('0xd')]('/',auth[_0x8256('0x7')](),controller['create']);router[_0x8256('0xd')](_0x8256('0xe'),auth[_0x8256('0x7')](),controller['addConfiguration']);router[_0x8256('0xf')](_0x8256('0x8'),auth[_0x8256('0x7')](),controller['update']);router[_0x8256('0x10')](_0x8256('0x8'),auth[_0x8256('0x7')](),controller[_0x8256('0x11')]);module[_0x8256('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 55fc668..2d487de 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 _0x8b63=['sequelize','exports','STRING'];(function(_0x100108,_0x27ee9c){var _0x1fa71d=function(_0x33a362){while(--_0x33a362){_0x100108['push'](_0x100108['shift']());}};_0x1fa71d(++_0x27ee9c);}(_0x8b63,0xb7));var _0x38b6=function(_0x135349,_0x178f86){_0x135349=_0x135349-0x0;var _0x249642=_0x8b63[_0x135349];return _0x249642;};'use strict';var Sequelize=require(_0x38b6('0x0'));module[_0x38b6('0x1')]={'name':{'type':Sequelize[_0x38b6('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x38b6('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x38b6('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x38b6('0x2')]},'accessKey':{'type':Sequelize[_0x38b6('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdbbf=['STRING','HelpDesk','sequelize','exports'];(function(_0x22aa61,_0x45e107){var _0x51500a=function(_0x16a73b){while(--_0x16a73b){_0x22aa61['push'](_0x22aa61['shift']());}};_0x51500a(++_0x45e107);}(_0xdbbf,0xc6));var _0xfdbb=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xdbbf[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0xfdbb('0x0'));module[_0xfdbb('0x1')]={'name':{'type':Sequelize[_0xfdbb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfdbb('0x2')]},'username':{'type':Sequelize[_0xfdbb('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xfdbb('0x2')],'allowNull':![],'defaultValue':_0xfdbb('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xfdbb('0x2')]},'accessKey':{'type':Sequelize[_0xfdbb('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index b863048..bd1d322 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 _0x084d=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','description','moduleName','remoteUri','accessKey','username','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','token','describe','sessionName','autogenerated','reference','remove','includes','editable','false','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','statusCode','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','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~!@#$%^&-_=+[{]}.','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','status','end','json','count','offset','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','nolimit','limit','order','sort','where','filters'];(function(_0x562a55,_0x268cdc){var _0x25a5a6=function(_0x5f10a1){while(--_0x5f10a1){_0x562a55['push'](_0x562a55['shift']());}};_0x25a5a6(++_0x268cdc);}(_0x084d,0x147));var _0xd084=function(_0x45534d,_0x40587b){_0x45534d=_0x45534d-0x0;var _0x2c8318=_0x084d[_0x45534d];return _0x2c8318;};'use strict';var pdf=require(_0xd084('0x0'));var emlformat=require(_0xd084('0x1'));var rimraf=require(_0xd084('0x2'));var zipdir=require(_0xd084('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd084('0x4'));var BPromise=require(_0xd084('0x5'));var Mustache=require(_0xd084('0x6'));var util=require(_0xd084('0x7'));var path=require(_0xd084('0x8'));var sox=require(_0xd084('0x9'));var csv=require(_0xd084('0xa'));var ejs=require(_0xd084('0xb'));var fs=require('fs');var _=require(_0xd084('0xc'));var squel=require(_0xd084('0xd'));var crypto=require(_0xd084('0xe'));var jsforce=require(_0xd084('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd084('0xa'));var querystring=require(_0xd084('0x10'));var Papa=require('papaparse');var Redis=require(_0xd084('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd084('0x12'));var as=require(_0xd084('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd084('0x14'))(_0xd084('0x15'));var utils=require(_0xd084('0x16'));var config=require(_0xd084('0x17'));var db=require(_0xd084('0x18'))['db'];var integrations=require(_0xd084('0x19'));var jayson=require('jayson/promise');var client=jayson[_0xd084('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x5f4ca3,_0x535289,_0x5e66b4){if(_0x5e66b4){var _0x3ea035=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ea035[_0xd084('0x1b')](_0x535289)){return _0x5f4ca3;}else{throw new db['Sequelize']['ValidationError'](_0xd084('0x1c'));}}else{return _0x5f4ca3;}}function respondWithRpcPromise(_0x5a0aa1,_0x304f38,_0x213eda,_0x54e748){return new BPromise(function(_0x380843,_0x44a705){var _0x118e18=_0x54e748||client;return _0x118e18[_0xd084('0x1d')](_0x5a0aa1,_0x213eda)[_0xd084('0x1e')](function(_0x4218a0){logger[_0xd084('0x1f')](_0xd084('0x20'),_0x304f38,'request\x20sent');logger[_0xd084('0x21')](_0xd084('0x22'),_0x304f38,'request\x20sent',JSON[_0xd084('0x23')](_0x4218a0));if(_0x4218a0[_0xd084('0x24')]){if(_0x4218a0[_0xd084('0x24')][_0xd084('0x25')]===0x1f4){logger[_0xd084('0x24')](_0xd084('0x20'),_0x304f38,_0x4218a0[_0xd084('0x24')]['message']);return _0x44a705(_0x4218a0['error'][_0xd084('0x26')]);}logger[_0xd084('0x24')](_0xd084('0x20'),_0x304f38,_0x4218a0[_0xd084('0x24')]['message']);return _0x380843(_0x4218a0[_0xd084('0x24')]['message']);}else{logger[_0xd084('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x304f38,_0xd084('0x27'));_0x380843(_0x4218a0[_0xd084('0x28')][_0xd084('0x26')]);}})['catch'](function(_0x114251){logger[_0xd084('0x24')](_0xd084('0x20'),_0x304f38,_0x114251);_0x44a705(_0x114251);});});}function respondWithStatusCode(_0xeb48cc,_0x58a7cf){_0x58a7cf=_0x58a7cf||0xcc;return function(_0x1f8f6b){if(_0x1f8f6b){return _0xeb48cc['sendStatus'](_0x58a7cf);}return _0xeb48cc[_0xd084('0x29')](_0x58a7cf)[_0xd084('0x2a')]();};}function respondWithResult(_0x2edd5e,_0x148397){_0x148397=_0x148397||0xc8;return function(_0x5ed69a){if(_0x5ed69a){return _0x2edd5e[_0xd084('0x29')](_0x148397)[_0xd084('0x2b')](_0x5ed69a);}};}function respondWithFilteredResult(_0x463441,_0x585ad7){return function(_0x83750e){if(_0x83750e){var _0x3800e1=_0x83750e[_0xd084('0x2c')],_0x2c5a04=_0x585ad7[_0xd084('0x2d')],_0x2a87a9=_0x585ad7[_0xd084('0x2d')]+_0x585ad7['limit'],_0x24fb79;if(_0x2a87a9>=_0x3800e1){_0x2a87a9=_0x3800e1;_0x24fb79=0xc8;}else{_0x24fb79=0xce;}_0x463441[_0xd084('0x29')](_0x24fb79);return _0x463441['set'](_0xd084('0x2e'),_0x2c5a04+'-'+_0x2a87a9+'/'+_0x3800e1)[_0xd084('0x2b')](_0x83750e);}return null;};}function patchUpdates(_0x22a10b){return function(_0x4b6f9a){try{jsonpatch[_0xd084('0x2f')](_0x4b6f9a,_0x22a10b,!![]);}catch(_0x1a9c8a){return BPromise[_0xd084('0x30')](_0x1a9c8a);}return _0x4b6f9a['save']();};}function saveUpdates(_0x22df51,_0x5d5252){return function(_0x25386a){if(_0x25386a){return _0x25386a[_0xd084('0x31')](_0x22df51)['then'](function(_0x238d96){return _0x238d96;});}return null;};}function removeEntity(_0x1a8ca4,_0x11d5b5){return function(_0x379602){if(_0x379602){return _0x379602[_0xd084('0x32')]()[_0xd084('0x1e')](function(){_0x1a8ca4['status'](0xcc)[_0xd084('0x2a')]();});}};}function handleEntityNotFound(_0x9b1e22,_0x387157){return function(_0x2812c3){if(!_0x2812c3){_0x9b1e22[_0xd084('0x33')](0x194);}return _0x2812c3;};}function handleError(_0x5445ee,_0x5d28e3){_0x5d28e3=_0x5d28e3||0x1f4;return function(_0x42a29a){logger[_0xd084('0x24')](_0x42a29a[_0xd084('0x34')]);if(_0x42a29a[_0xd084('0x35')]){delete _0x42a29a[_0xd084('0x35')];}_0x5445ee[_0xd084('0x29')](_0x5d28e3)['send'](_0x42a29a);};}exports[_0xd084('0x36')]=function(_0x532aa7,_0x4ab190){var _0x33a22e={},_0x15fa2c={},_0xd9fe9d={'count':0x0,'rows':[]};var _0x545d91=_[_0xd084('0x37')](db[_0xd084('0x38')][_0xd084('0x39')],function(_0x41518b){return{'name':_0x41518b[_0xd084('0x3a')],'type':_0x41518b[_0xd084('0x3b')][_0xd084('0x3c')]};});_0x15fa2c[_0xd084('0x3d')]=_[_0xd084('0x37')](_0x545d91,'name');_0x15fa2c[_0xd084('0x3e')]=_['keys'](_0x532aa7[_0xd084('0x3e')]);_0x15fa2c['filters']=_['intersection'](_0x15fa2c[_0xd084('0x3d')],_0x15fa2c[_0xd084('0x3e')]);_0x33a22e[_0xd084('0x3f')]=_['intersection'](_0x15fa2c[_0xd084('0x3d')],qs[_0xd084('0x40')](_0x532aa7[_0xd084('0x3e')]['fields']));_0x33a22e['attributes']=_0x33a22e[_0xd084('0x3f')][_0xd084('0x41')]?_0x33a22e[_0xd084('0x3f')]:_0x15fa2c[_0xd084('0x3d')];if(!_0x532aa7['query']['hasOwnProperty'](_0xd084('0x42'))){_0x33a22e['limit']=qs[_0xd084('0x43')](_0x532aa7[_0xd084('0x3e')][_0xd084('0x43')]);_0x33a22e[_0xd084('0x2d')]=qs[_0xd084('0x2d')](_0x532aa7[_0xd084('0x3e')]['offset']);}_0x33a22e[_0xd084('0x44')]=qs[_0xd084('0x45')](_0x532aa7['query'][_0xd084('0x45')]);_0x33a22e[_0xd084('0x46')]=qs[_0xd084('0x47')](_[_0xd084('0x48')](_0x532aa7[_0xd084('0x3e')],_0x15fa2c[_0xd084('0x47')]));if(_0x532aa7[_0xd084('0x3e')]['filter']){_0x33a22e[_0xd084('0x46')]=_[_0xd084('0x49')](_0x33a22e[_0xd084('0x46')],{'$or':_[_0xd084('0x37')](_0x545d91,function(_0x7aa61a){if(_0x7aa61a[_0xd084('0x3b')]!==_0xd084('0x4a')){var _0x46e945={};_0x46e945[_0x7aa61a[_0xd084('0x35')]]={'$like':'%'+_0x532aa7[_0xd084('0x3e')][_0xd084('0x4b')]+'%'};return _0x46e945;}})});}_0x33a22e=_[_0xd084('0x49')]({},_0x33a22e,_0x532aa7[_0xd084('0x4c')]);var _0x138224={'where':_0x33a22e[_0xd084('0x46')]};return db[_0xd084('0x38')][_0xd084('0x2c')](_0x138224)[_0xd084('0x1e')](function(_0x498ed9){_0xd9fe9d[_0xd084('0x2c')]=_0x498ed9;if(_0x532aa7[_0xd084('0x3e')][_0xd084('0x4d')]){_0x33a22e[_0xd084('0x4e')]=[{'all':!![]}];}return db['VtigerAccount'][_0xd084('0x4f')](_0x33a22e);})['then'](function(_0x66d69d){_0xd9fe9d[_0xd084('0x50')]=_0x66d69d;return _0xd9fe9d;})[_0xd084('0x1e')](respondWithFilteredResult(_0x4ab190,_0x33a22e))[_0xd084('0x51')](handleError(_0x4ab190,null));};exports[_0xd084('0x52')]=function(_0x473754,_0x5c87b5){var _0x54b622={'raw':![],'where':{'id':_0x473754[_0xd084('0x53')]['id']}},_0x459dc9={};_0x459dc9[_0xd084('0x3d')]=_[_0xd084('0x54')](db[_0xd084('0x38')][_0xd084('0x39')]);_0x459dc9[_0xd084('0x3e')]=_[_0xd084('0x54')](_0x473754['query']);_0x459dc9['filters']=_[_0xd084('0x55')](_0x459dc9[_0xd084('0x3d')],_0x459dc9[_0xd084('0x3e')]);_0x54b622[_0xd084('0x3f')]=_[_0xd084('0x55')](_0x459dc9[_0xd084('0x3d')],qs[_0xd084('0x40')](_0x473754[_0xd084('0x3e')][_0xd084('0x40')]));_0x54b622[_0xd084('0x3f')]=_0x54b622[_0xd084('0x3f')][_0xd084('0x41')]?_0x54b622[_0xd084('0x3f')]:_0x459dc9[_0xd084('0x3d')];if(_0x473754[_0xd084('0x3e')]['includeAll']){_0x54b622[_0xd084('0x4e')]=[{'all':!![]}];}_0x54b622=_[_0xd084('0x49')]({},_0x54b622,_0x473754[_0xd084('0x4c')]);return db[_0xd084('0x38')][_0xd084('0x56')](_0x54b622)[_0xd084('0x1e')](handleEntityNotFound(_0x5c87b5,null))[_0xd084('0x1e')](respondWithResult(_0x5c87b5,null))[_0xd084('0x51')](handleError(_0x5c87b5,null));};exports[_0xd084('0x57')]=function(_0x5235e1,_0x21c306){return db[_0xd084('0x38')]['create'](_0x5235e1[_0xd084('0x58')],{})[_0xd084('0x1e')](respondWithResult(_0x21c306,0xc9))[_0xd084('0x51')](handleError(_0x21c306,null));};exports[_0xd084('0x31')]=function(_0x3fa03f,_0x3b4886){if(_0x3fa03f['body']['id']){delete _0x3fa03f[_0xd084('0x58')]['id'];}return db[_0xd084('0x38')]['find']({'where':{'id':_0x3fa03f[_0xd084('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b4886,null))[_0xd084('0x1e')](saveUpdates(_0x3fa03f[_0xd084('0x58')],null))[_0xd084('0x1e')](respondWithResult(_0x3b4886,null))['catch'](handleError(_0x3b4886,null));};exports[_0xd084('0x32')]=function(_0x54d99e,_0x4dc1f8){return db[_0xd084('0x38')][_0xd084('0x56')]({'where':{'id':_0x54d99e['params']['id']}})['then'](handleEntityNotFound(_0x4dc1f8,null))[_0xd084('0x1e')](removeEntity(_0x4dc1f8,null))[_0xd084('0x51')](handleError(_0x4dc1f8,null));};exports[_0xd084('0x59')]=function(_0x52cbf3,_0xf49ae3,_0x5b561d){var _0x1f0a3c={};var _0xe77c4b={};var _0x2cbfa1;var _0x408a3c;return db['VtigerAccount'][_0xd084('0x5a')]({'where':{'id':_0x52cbf3['params']['id']}})[_0xd084('0x1e')](handleEntityNotFound(_0xf49ae3,null))[_0xd084('0x1e')](function(_0x54a564){if(_0x54a564){_0x2cbfa1=_0x54a564;_0xe77c4b['model']=_[_0xd084('0x54')](db[_0xd084('0x5b')]['rawAttributes']);_0xe77c4b[_0xd084('0x3e')]=_['keys'](_0x52cbf3[_0xd084('0x3e')]);_0xe77c4b[_0xd084('0x47')]=_[_0xd084('0x55')](_0xe77c4b[_0xd084('0x3d')],_0xe77c4b[_0xd084('0x3e')]);_0x1f0a3c[_0xd084('0x3f')]=_[_0xd084('0x55')](_0xe77c4b[_0xd084('0x3d')],qs['fields'](_0x52cbf3[_0xd084('0x3e')][_0xd084('0x40')]));_0x1f0a3c[_0xd084('0x3f')]=_0x1f0a3c['attributes'][_0xd084('0x41')]?_0x1f0a3c[_0xd084('0x3f')]:_0xe77c4b[_0xd084('0x3d')];_0x1f0a3c[_0xd084('0x44')]=qs[_0xd084('0x45')](_0x52cbf3[_0xd084('0x3e')][_0xd084('0x45')]);_0x1f0a3c[_0xd084('0x46')]=qs[_0xd084('0x47')](_['pick'](_0x52cbf3[_0xd084('0x3e')],_0xe77c4b[_0xd084('0x47')]));if(_0x52cbf3[_0xd084('0x3e')][_0xd084('0x4b')]){_0x1f0a3c['where']=_[_0xd084('0x49')](_0x1f0a3c[_0xd084('0x46')],{'$or':_[_0xd084('0x37')](_0x1f0a3c[_0xd084('0x3f')],function(_0x41b53d){var _0x888240={};_0x888240[_0x41b53d]={'$like':'%'+_0x52cbf3[_0xd084('0x3e')][_0xd084('0x4b')]+'%'};return _0x888240;})});}_0x1f0a3c=_[_0xd084('0x49')]({},_0x1f0a3c,_0x52cbf3[_0xd084('0x4c')]);return _0x2cbfa1['getConfigurations'](_0x1f0a3c);}})[_0xd084('0x1e')](function(_0x3b7c49){if(_0x3b7c49){_0x408a3c=_0x3b7c49[_0xd084('0x41')];if(!_0x52cbf3[_0xd084('0x3e')][_0xd084('0x5c')]('nolimit')){_0x1f0a3c['limit']=qs[_0xd084('0x43')](_0x52cbf3[_0xd084('0x3e')][_0xd084('0x43')]);_0x1f0a3c[_0xd084('0x2d')]=qs[_0xd084('0x2d')](_0x52cbf3[_0xd084('0x3e')][_0xd084('0x2d')]);}return _0x2cbfa1[_0xd084('0x59')](_0x1f0a3c);}})[_0xd084('0x1e')](function(_0x25ee73){if(_0x25ee73){return _0x25ee73?{'count':_0x408a3c,'rows':_0x25ee73}:null;}})[_0xd084('0x1e')](respondWithResult(_0xf49ae3,null))[_0xd084('0x51')](handleError(_0xf49ae3,null));};exports['addConfiguration']=function(_0x38fbad,_0x8af50d,_0x19184e){if(_0x38fbad[_0xd084('0x58')]['id']){delete _0x38fbad['body']['id'];}return db['VtigerAccount'][_0xd084('0x5a')]({'where':{'id':_0x38fbad[_0xd084('0x53')]['id']}})[_0xd084('0x1e')](handleEntityNotFound(_0x8af50d,null))[_0xd084('0x1e')](function(_0x396275){if(_0x396275){_0x38fbad[_0xd084('0x58')]['AccountId']=_0x396275['id'];_0x38fbad[_0xd084('0x58')][_0xd084('0x5d')]=integrations[_0xd084('0x5e')](_0x38fbad[_0xd084('0x58')][_0xd084('0x5f')],_0x38fbad[_0xd084('0x58')]['type']);_0x38fbad[_0xd084('0x58')][_0xd084('0x60')]=integrations[_0xd084('0x61')](_0x38fbad[_0xd084('0x58')][_0xd084('0x5f')],_0x38fbad[_0xd084('0x58')][_0xd084('0x3b')]);return db['VtigerConfiguration'][_0xd084('0x57')](_0x38fbad[_0xd084('0x58')],{'include':[{'model':db[_0xd084('0x62')],'as':_0xd084('0x5d')},{'model':db[_0xd084('0x62')],'as':_0xd084('0x60')}]});}return null;})[_0xd084('0x1e')](respondWithResult(_0x8af50d,null))[_0xd084('0x51')](handleError(_0x8af50d,null));};var md5=require(_0xd084('0x63'));exports['getFields']=function(_0xfbd169,_0x1de832,_0x158df0){var _0xd57436=null;var _0x407786=null;var _0x2409a1=null;var _0x2bb65f=null;var _0x6c2150='';return db[_0xd084('0x38')][_0xd084('0x5a')]({'where':{'id':_0xfbd169[_0xd084('0x53')]['id']},'attributes':['id',_0xd084('0x35'),'username',_0xd084('0x64'),_0xd084('0x65'),_0xd084('0x66'),'serverUrl',_0xd084('0x67')]})[_0xd084('0x1e')](handleEntityNotFound(_0x1de832,null))[_0xd084('0x1e')](function(_0x4ceab8){if(_0x4ceab8){_0xd57436=_0x4ceab8[_0xd084('0x68')];_0x407786=_0x4ceab8['accessKey'];_0x2409a1=_0x4ceab8[_0xd084('0x65')];_0x6c2150=_0x4ceab8[_0xd084('0x66')];var _0x2b0bc6=_0x6c2150[_0xd084('0x69')](-0x1);if(_0x2b0bc6==='/'){_0x6c2150=_0x6c2150[_0xd084('0x6a')](0x0,_0x6c2150[_0xd084('0x6b')](_0x2b0bc6));}_0x2bb65f=util[_0xd084('0x6c')](_0xd084('0x6d'),_0x6c2150);var _0x3740ef={'method':_0xd084('0x6e'),'uri':_0x2bb65f,'qs':{'operation':_0xd084('0x6f'),'username':_0x4ceab8[_0xd084('0x68')]},'json':!![]};return rp(_0x3740ef);}})['then'](function(_0x31a23f){if(_0x31a23f[_0xd084('0x70')]){var _0x18f5ac={'method':'POST','uri':_0x2bb65f,'form':{'operation':_0xd084('0x71'),'username':_0xd57436,'accessKey':md5(_0x31a23f[_0xd084('0x28')][_0xd084('0x72')]+_0x407786)},'json':!![]};return rp(_0x18f5ac);}})[_0xd084('0x1e')](function(_0x3d3e09){if(_0x3d3e09[_0xd084('0x70')]){var _0x434cd2={'method':_0xd084('0x6e'),'uri':_0x2bb65f,'qs':{'operation':_0xd084('0x73'),'username':_0xd57436,'sessionName':_0x3d3e09[_0xd084('0x28')][_0xd084('0x74')],'elementType':_0x2409a1},'json':!![]};return rp(_0x434cd2);}})[_0xd084('0x1e')](function(_0x10d1cc){if(_0x10d1cc[_0xd084('0x70')]){var _0x4038bc=[_0xd084('0x75'),_0xd084('0x76'),'owner'];_[_0xd084('0x77')](_0x10d1cc['result'][_0xd084('0x40')],function(_0x48c208){return _0x4038bc[_0xd084('0x78')](_0x48c208[_0xd084('0x3b')][_0xd084('0x35')]);});_['remove'](_0x10d1cc[_0xd084('0x28')][_0xd084('0x40')],function(_0x5322f){return _0x5322f[_0xd084('0x79')]===_0xd084('0x7a');});return{'count':_0x10d1cc[_0xd084('0x28')]['fields'][_0xd084('0x41')],'rows':_[_0xd084('0x37')](_0x10d1cc[_0xd084('0x28')][_0xd084('0x40')],function(_0x42d1b7){return{'id':_0x42d1b7[_0xd084('0x35')],'name':_0x42d1b7['label'],'custom':_['startsWith'](_0x42d1b7[_0xd084('0x35')],_0xd084('0x7b'))?!![]:![],'options':_0x42d1b7[_0xd084('0x3b')][_0xd084('0x35')]===_0xd084('0x7c')&&_0x42d1b7[_0xd084('0x3b')]['picklistValues'][_0xd084('0x41')]>0x0?_[_0xd084('0x37')](_0x42d1b7[_0xd084('0x3b')][_0xd084('0x7d')],function(_0x4664dd){return{'name':_0x4664dd[_0xd084('0x7e')],'value':_0x4664dd[_0xd084('0x7f')]};}):[]};})};}})[_0xd084('0x1e')](respondWithResult(_0x1de832,null))[_0xd084('0x51')](function(_0x29c81d){console[_0xd084('0x80')](_0xd084('0x81')+_0x29c81d);var _0x398a30=_0xfbd169[_0xd084('0x3e')]['test']?0x1f4:_0x29c81d[_0xd084('0x82')]||0x1f4;logger[_0xd084('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x398a30,JSON['stringify'](_0x29c81d));delete _0x29c81d[_0xd084('0x35')];if(_0x398a30===0x191){_0x398a30=0x190;}_0x1de832[_0xd084('0x29')](_0x398a30)[_0xd084('0x83')](_0xfbd169[_0xd084('0x3e')][_0xd084('0x1b')]?{'message':_0xd084('0x84'),'statusCode':_0x29c81d[_0xd084('0x82')]}:_0x29c81d);});}; \ No newline at end of file +var _0x1131=['rows','catch','show','options','find','body','update','getConfigurations','findOne','params','VtigerConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','create','VtigerField','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','format','%s/webservice.php','GET','getchallenge','success','token','describe','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VtigerAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1131,0x1c4));var _0x1113=function(_0x31af1b,_0x1d973a){_0x31af1b=_0x31af1b-0x0;var _0x298be9=_0x1131[_0x31af1b];return _0x298be9;};'use strict';var pdf=require(_0x1113('0x0'));var emlformat=require(_0x1113('0x1'));var rimraf=require(_0x1113('0x2'));var zipdir=require(_0x1113('0x3'));var jsonpatch=require(_0x1113('0x4'));var rp=require('request-promise');var moment=require(_0x1113('0x5'));var BPromise=require(_0x1113('0x6'));var Mustache=require(_0x1113('0x7'));var util=require(_0x1113('0x8'));var path=require(_0x1113('0x9'));var sox=require(_0x1113('0xa'));var csv=require(_0x1113('0xb'));var ejs=require(_0x1113('0xc'));var fs=require('fs');var _=require(_0x1113('0xd'));var squel=require(_0x1113('0xe'));var crypto=require(_0x1113('0xf'));var jsforce=require(_0x1113('0x10'));var deskjs=require(_0x1113('0x11'));var toCsv=require(_0x1113('0xb'));var querystring=require(_0x1113('0x12'));var Papa=require(_0x1113('0x13'));var Redis=require(_0x1113('0x14'));var authService=require(_0x1113('0x15'));var qs=require(_0x1113('0x16'));var as=require(_0x1113('0x17'));var hardwareService=require(_0x1113('0x18'));var logger=require(_0x1113('0x19'))(_0x1113('0x1a'));var utils=require('../../config/utils');var config=require(_0x1113('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1113('0x1c'));var jayson=require(_0x1113('0x1d'));var client=jayson[_0x1113('0x1e')][_0x1113('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x386aac,_0x1bc55d,_0x3ce9fa){if(_0x3ce9fa){var _0x2cb75c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2cb75c[_0x1113('0x20')](_0x1bc55d)){return _0x386aac;}else{throw new db[(_0x1113('0x21'))][(_0x1113('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x386aac;}}function respondWithRpcPromise(_0x3fb6e8,_0x3f2f3e,_0x3bdae4,_0x140750){return new BPromise(function(_0x4c17eb,_0x5dda1b){var _0x178507=_0x140750||client;return _0x178507[_0x1113('0x23')](_0x3fb6e8,_0x3bdae4)[_0x1113('0x24')](function(_0x249ec2){logger[_0x1113('0x25')]('VtigerAccount,\x20%s,\x20%s',_0x3f2f3e,'request\x20sent');logger[_0x1113('0x26')](_0x1113('0x27'),_0x3f2f3e,_0x1113('0x28'),JSON['stringify'](_0x249ec2));if(_0x249ec2[_0x1113('0x29')]){if(_0x249ec2['error'][_0x1113('0x2a')]===0x1f4){logger[_0x1113('0x29')](_0x1113('0x2b'),_0x3f2f3e,_0x249ec2[_0x1113('0x29')][_0x1113('0x2c')]);return _0x5dda1b(_0x249ec2['error'][_0x1113('0x2c')]);}logger['error'](_0x1113('0x2b'),_0x3f2f3e,_0x249ec2[_0x1113('0x29')][_0x1113('0x2c')]);return _0x4c17eb(_0x249ec2[_0x1113('0x29')][_0x1113('0x2c')]);}else{logger[_0x1113('0x25')](_0x1113('0x2b'),_0x3f2f3e,'request\x20sent');_0x4c17eb(_0x249ec2[_0x1113('0x2d')][_0x1113('0x2c')]);}})['catch'](function(_0x3d1cce){logger[_0x1113('0x29')](_0x1113('0x2b'),_0x3f2f3e,_0x3d1cce);_0x5dda1b(_0x3d1cce);});});}function respondWithStatusCode(_0xd2e3b1,_0x18afec){_0x18afec=_0x18afec||0xcc;return function(_0xcf153d){if(_0xcf153d){return _0xd2e3b1[_0x1113('0x2e')](_0x18afec);}return _0xd2e3b1[_0x1113('0x2f')](_0x18afec)[_0x1113('0x30')]();};}function respondWithResult(_0x5ef577,_0x574a24){_0x574a24=_0x574a24||0xc8;return function(_0x5c3459){if(_0x5c3459){return _0x5ef577[_0x1113('0x2f')](_0x574a24)[_0x1113('0x31')](_0x5c3459);}};}function respondWithFilteredResult(_0x3004f3,_0x49cdb5){return function(_0x1dff9e){if(_0x1dff9e){var _0x283cea=_0x1dff9e[_0x1113('0x32')],_0x528cfb=_0x49cdb5[_0x1113('0x33')],_0x1d95d2=_0x49cdb5['offset']+_0x49cdb5[_0x1113('0x34')],_0x1a5215;if(_0x1d95d2>=_0x283cea){_0x1d95d2=_0x283cea;_0x1a5215=0xc8;}else{_0x1a5215=0xce;}_0x3004f3[_0x1113('0x2f')](_0x1a5215);return _0x3004f3['set'](_0x1113('0x35'),_0x528cfb+'-'+_0x1d95d2+'/'+_0x283cea)[_0x1113('0x31')](_0x1dff9e);}return null;};}function patchUpdates(_0x39da76){return function(_0xd6b8a8){try{jsonpatch[_0x1113('0x36')](_0xd6b8a8,_0x39da76,!![]);}catch(_0x1a7318){return BPromise['reject'](_0x1a7318);}return _0xd6b8a8[_0x1113('0x37')]();};}function saveUpdates(_0x118d1f,_0xd48008){return function(_0x52babd){if(_0x52babd){return _0x52babd['update'](_0x118d1f)[_0x1113('0x24')](function(_0x34bc8b){return _0x34bc8b;});}return null;};}function removeEntity(_0x3aa251,_0x164a61){return function(_0x526eca){if(_0x526eca){return _0x526eca[_0x1113('0x38')]()[_0x1113('0x24')](function(){_0x3aa251[_0x1113('0x2f')](0xcc)[_0x1113('0x30')]();});}};}function handleEntityNotFound(_0x2b1e0b,_0x14f649){return function(_0x46fbc3){if(!_0x46fbc3){_0x2b1e0b['sendStatus'](0x194);}return _0x46fbc3;};}function handleError(_0x84ff66,_0x380b8a){_0x380b8a=_0x380b8a||0x1f4;return function(_0x23e6b6){logger[_0x1113('0x29')](_0x23e6b6[_0x1113('0x39')]);if(_0x23e6b6[_0x1113('0x3a')]){delete _0x23e6b6[_0x1113('0x3a')];}_0x84ff66[_0x1113('0x2f')](_0x380b8a)[_0x1113('0x3b')](_0x23e6b6);};}exports[_0x1113('0x3c')]=function(_0x3a7ab9,_0x43ea4e){var _0x2a7675={},_0x2e332a={},_0xb25e25={'count':0x0,'rows':[]};var _0x7ef03a=_[_0x1113('0x3d')](db[_0x1113('0x3e')][_0x1113('0x3f')],function(_0x7fa1ad){return{'name':_0x7fa1ad[_0x1113('0x40')],'type':_0x7fa1ad['type'][_0x1113('0x41')]};});_0x2e332a[_0x1113('0x42')]=_[_0x1113('0x3d')](_0x7ef03a,_0x1113('0x3a'));_0x2e332a[_0x1113('0x43')]=_[_0x1113('0x44')](_0x3a7ab9[_0x1113('0x43')]);_0x2e332a[_0x1113('0x45')]=_[_0x1113('0x46')](_0x2e332a['model'],_0x2e332a[_0x1113('0x43')]);_0x2a7675[_0x1113('0x47')]=_[_0x1113('0x46')](_0x2e332a[_0x1113('0x42')],qs[_0x1113('0x48')](_0x3a7ab9[_0x1113('0x43')][_0x1113('0x48')]));_0x2a7675['attributes']=_0x2a7675['attributes'][_0x1113('0x49')]?_0x2a7675[_0x1113('0x47')]:_0x2e332a[_0x1113('0x42')];if(!_0x3a7ab9['query']['hasOwnProperty'](_0x1113('0x4a'))){_0x2a7675[_0x1113('0x34')]=qs[_0x1113('0x34')](_0x3a7ab9['query'][_0x1113('0x34')]);_0x2a7675[_0x1113('0x33')]=qs[_0x1113('0x33')](_0x3a7ab9['query'][_0x1113('0x33')]);}_0x2a7675[_0x1113('0x4b')]=qs[_0x1113('0x4c')](_0x3a7ab9['query'][_0x1113('0x4c')]);_0x2a7675['where']=qs[_0x1113('0x45')](_[_0x1113('0x4d')](_0x3a7ab9[_0x1113('0x43')],_0x2e332a[_0x1113('0x45')]));if(_0x3a7ab9['query'][_0x1113('0x4e')]){_0x2a7675[_0x1113('0x4f')]=_['merge'](_0x2a7675['where'],{'$or':_['map'](_0x7ef03a,function(_0x383fd8){if(_0x383fd8['type']!=='VIRTUAL'){var _0x1d241a={};_0x1d241a[_0x383fd8[_0x1113('0x3a')]]={'$like':'%'+_0x3a7ab9['query'][_0x1113('0x4e')]+'%'};return _0x1d241a;}})});}_0x2a7675=_[_0x1113('0x50')]({},_0x2a7675,_0x3a7ab9['options']);var _0x561792={'where':_0x2a7675[_0x1113('0x4f')]};return db['VtigerAccount']['count'](_0x561792)[_0x1113('0x24')](function(_0x181683){_0xb25e25[_0x1113('0x32')]=_0x181683;if(_0x3a7ab9['query'][_0x1113('0x51')]){_0x2a7675[_0x1113('0x52')]=[{'all':!![]}];}return db['VtigerAccount'][_0x1113('0x53')](_0x2a7675);})[_0x1113('0x24')](function(_0x3886bc){_0xb25e25[_0x1113('0x54')]=_0x3886bc;return _0xb25e25;})['then'](respondWithFilteredResult(_0x43ea4e,_0x2a7675))[_0x1113('0x55')](handleError(_0x43ea4e,null));};exports[_0x1113('0x56')]=function(_0x54bfde,_0x2ce490){var _0x4eada8={'raw':![],'where':{'id':_0x54bfde['params']['id']}},_0x53c54e={};_0x53c54e[_0x1113('0x42')]=_[_0x1113('0x44')](db[_0x1113('0x3e')][_0x1113('0x3f')]);_0x53c54e[_0x1113('0x43')]=_[_0x1113('0x44')](_0x54bfde[_0x1113('0x43')]);_0x53c54e[_0x1113('0x45')]=_['intersection'](_0x53c54e['model'],_0x53c54e['query']);_0x4eada8[_0x1113('0x47')]=_['intersection'](_0x53c54e[_0x1113('0x42')],qs[_0x1113('0x48')](_0x54bfde['query'][_0x1113('0x48')]));_0x4eada8[_0x1113('0x47')]=_0x4eada8[_0x1113('0x47')][_0x1113('0x49')]?_0x4eada8[_0x1113('0x47')]:_0x53c54e['model'];if(_0x54bfde['query'][_0x1113('0x51')]){_0x4eada8[_0x1113('0x52')]=[{'all':!![]}];}_0x4eada8=_['merge']({},_0x4eada8,_0x54bfde[_0x1113('0x57')]);return db[_0x1113('0x3e')][_0x1113('0x58')](_0x4eada8)['then'](handleEntityNotFound(_0x2ce490,null))[_0x1113('0x24')](respondWithResult(_0x2ce490,null))[_0x1113('0x55')](handleError(_0x2ce490,null));};exports['create']=function(_0x300705,_0x289490){return db[_0x1113('0x3e')]['create'](_0x300705[_0x1113('0x59')],{})['then'](respondWithResult(_0x289490,0xc9))[_0x1113('0x55')](handleError(_0x289490,null));};exports[_0x1113('0x5a')]=function(_0x269575,_0x2639be){if(_0x269575[_0x1113('0x59')]['id']){delete _0x269575['body']['id'];}return db[_0x1113('0x3e')][_0x1113('0x58')]({'where':{'id':_0x269575['params']['id']}})[_0x1113('0x24')](handleEntityNotFound(_0x2639be,null))[_0x1113('0x24')](saveUpdates(_0x269575['body'],null))[_0x1113('0x24')](respondWithResult(_0x2639be,null))[_0x1113('0x55')](handleError(_0x2639be,null));};exports['destroy']=function(_0x55b98a,_0x19859a){return db['VtigerAccount']['find']({'where':{'id':_0x55b98a['params']['id']}})[_0x1113('0x24')](handleEntityNotFound(_0x19859a,null))[_0x1113('0x24')](removeEntity(_0x19859a,null))['catch'](handleError(_0x19859a,null));};exports[_0x1113('0x5b')]=function(_0x4e1d77,_0x579138,_0xbc4018){var _0x554ab7={};var _0x1c5ff5={};var _0x2e7155;var _0x59197d;return db[_0x1113('0x3e')][_0x1113('0x5c')]({'where':{'id':_0x4e1d77[_0x1113('0x5d')]['id']}})['then'](handleEntityNotFound(_0x579138,null))[_0x1113('0x24')](function(_0x13ed46){if(_0x13ed46){_0x2e7155=_0x13ed46;_0x1c5ff5[_0x1113('0x42')]=_[_0x1113('0x44')](db[_0x1113('0x5e')][_0x1113('0x3f')]);_0x1c5ff5['query']=_['keys'](_0x4e1d77[_0x1113('0x43')]);_0x1c5ff5['filters']=_['intersection'](_0x1c5ff5[_0x1113('0x42')],_0x1c5ff5[_0x1113('0x43')]);_0x554ab7[_0x1113('0x47')]=_['intersection'](_0x1c5ff5[_0x1113('0x42')],qs['fields'](_0x4e1d77[_0x1113('0x43')][_0x1113('0x48')]));_0x554ab7[_0x1113('0x47')]=_0x554ab7[_0x1113('0x47')][_0x1113('0x49')]?_0x554ab7[_0x1113('0x47')]:_0x1c5ff5['model'];_0x554ab7['order']=qs[_0x1113('0x4c')](_0x4e1d77['query'][_0x1113('0x4c')]);_0x554ab7[_0x1113('0x4f')]=qs[_0x1113('0x45')](_[_0x1113('0x4d')](_0x4e1d77[_0x1113('0x43')],_0x1c5ff5['filters']));if(_0x4e1d77[_0x1113('0x43')][_0x1113('0x4e')]){_0x554ab7[_0x1113('0x4f')]=_[_0x1113('0x50')](_0x554ab7['where'],{'$or':_['map'](_0x554ab7['attributes'],function(_0x416570){var _0x20c90f={};_0x20c90f[_0x416570]={'$like':'%'+_0x4e1d77[_0x1113('0x43')][_0x1113('0x4e')]+'%'};return _0x20c90f;})});}_0x554ab7=_['merge']({},_0x554ab7,_0x4e1d77['options']);return _0x2e7155[_0x1113('0x5b')](_0x554ab7);}})[_0x1113('0x24')](function(_0x3d43f0){if(_0x3d43f0){_0x59197d=_0x3d43f0[_0x1113('0x49')];if(!_0x4e1d77[_0x1113('0x43')][_0x1113('0x5f')](_0x1113('0x4a'))){_0x554ab7[_0x1113('0x34')]=qs[_0x1113('0x34')](_0x4e1d77[_0x1113('0x43')][_0x1113('0x34')]);_0x554ab7[_0x1113('0x33')]=qs[_0x1113('0x33')](_0x4e1d77[_0x1113('0x43')][_0x1113('0x33')]);}return _0x2e7155[_0x1113('0x5b')](_0x554ab7);}})['then'](function(_0x274768){if(_0x274768){return _0x274768?{'count':_0x59197d,'rows':_0x274768}:null;}})[_0x1113('0x24')](respondWithResult(_0x579138,null))[_0x1113('0x55')](handleError(_0x579138,null));};exports['addConfiguration']=function(_0x4caa89,_0x15964b,_0x4dcbd2){if(_0x4caa89[_0x1113('0x59')]['id']){delete _0x4caa89[_0x1113('0x59')]['id'];}return db[_0x1113('0x3e')][_0x1113('0x5c')]({'where':{'id':_0x4caa89['params']['id']}})['then'](handleEntityNotFound(_0x15964b,null))[_0x1113('0x24')](function(_0x3c1581){if(_0x3c1581){_0x4caa89[_0x1113('0x59')][_0x1113('0x60')]=_0x3c1581['id'];_0x4caa89[_0x1113('0x59')][_0x1113('0x61')]=integrations[_0x1113('0x62')](_0x4caa89[_0x1113('0x59')]['channel'],_0x4caa89[_0x1113('0x59')]['type']);_0x4caa89['body']['Descriptions']=integrations['getDescriptions'](_0x4caa89[_0x1113('0x59')][_0x1113('0x63')],_0x4caa89[_0x1113('0x59')]['type']);return db[_0x1113('0x5e')][_0x1113('0x64')](_0x4caa89[_0x1113('0x59')],{'include':[{'model':db['VtigerField'],'as':_0x1113('0x61')},{'model':db[_0x1113('0x65')],'as':_0x1113('0x66')}]});}return null;})[_0x1113('0x24')](respondWithResult(_0x15964b,null))[_0x1113('0x55')](handleError(_0x15964b,null));};var md5=require(_0x1113('0x67'));exports[_0x1113('0x68')]=function(_0x3bd2b5,_0x4374bc,_0x3089f9){var _0x1656a2=null;var _0x21a979=null;var _0x21022f=null;var _0x48ce70=null;var _0x4651ab='';return db[_0x1113('0x3e')]['findOne']({'where':{'id':_0x3bd2b5[_0x1113('0x5d')]['id']},'attributes':['id',_0x1113('0x3a'),_0x1113('0x69'),_0x1113('0x6a'),_0x1113('0x6b'),_0x1113('0x6c'),_0x1113('0x6d'),'accessKey']})['then'](handleEntityNotFound(_0x4374bc,null))[_0x1113('0x24')](function(_0x1413fc){if(_0x1413fc){_0x1656a2=_0x1413fc[_0x1113('0x69')];_0x21a979=_0x1413fc[_0x1113('0x6e')];_0x21022f=_0x1413fc[_0x1113('0x6b')];_0x4651ab=_0x1413fc['remoteUri'];var _0x1c54ef=_0x4651ab['slice'](-0x1);if(_0x1c54ef==='/'){_0x4651ab=_0x4651ab[_0x1113('0x6f')](0x0,_0x4651ab['lastIndexOf'](_0x1c54ef));}_0x48ce70=util[_0x1113('0x70')](_0x1113('0x71'),_0x4651ab);var _0x4084ff={'method':_0x1113('0x72'),'uri':_0x48ce70,'qs':{'operation':_0x1113('0x73'),'username':_0x1413fc[_0x1113('0x69')]},'json':!![]};return rp(_0x4084ff);}})[_0x1113('0x24')](function(_0x3589e3){if(_0x3589e3[_0x1113('0x74')]){var _0x175719={'method':'POST','uri':_0x48ce70,'form':{'operation':'login','username':_0x1656a2,'accessKey':md5(_0x3589e3[_0x1113('0x2d')][_0x1113('0x75')]+_0x21a979)},'json':!![]};return rp(_0x175719);}})[_0x1113('0x24')](function(_0x326d76){if(_0x326d76['success']){var _0x39e743={'method':_0x1113('0x72'),'uri':_0x48ce70,'qs':{'operation':_0x1113('0x76'),'username':_0x1656a2,'sessionName':_0x326d76[_0x1113('0x2d')]['sessionName'],'elementType':_0x21022f},'json':!![]};return rp(_0x39e743);}})[_0x1113('0x24')](function(_0x50f50f){if(_0x50f50f[_0x1113('0x74')]){var _0x1113eb=[_0x1113('0x77'),_0x1113('0x78'),_0x1113('0x79')];_[_0x1113('0x7a')](_0x50f50f[_0x1113('0x2d')]['fields'],function(_0x370228){return _0x1113eb[_0x1113('0x7b')](_0x370228['type']['name']);});_[_0x1113('0x7a')](_0x50f50f[_0x1113('0x2d')][_0x1113('0x48')],function(_0x4620b1){return _0x4620b1[_0x1113('0x7c')]===_0x1113('0x7d');});return{'count':_0x50f50f[_0x1113('0x2d')][_0x1113('0x48')][_0x1113('0x49')],'rows':_['map'](_0x50f50f[_0x1113('0x2d')][_0x1113('0x48')],function(_0x7a4b28){return{'id':_0x7a4b28['name'],'name':_0x7a4b28[_0x1113('0x7e')],'custom':_[_0x1113('0x7f')](_0x7a4b28['name'],_0x1113('0x80'))?!![]:![],'options':_0x7a4b28['type'][_0x1113('0x3a')]===_0x1113('0x81')&&_0x7a4b28['type']['picklistValues'][_0x1113('0x49')]>0x0?_[_0x1113('0x3d')](_0x7a4b28['type']['picklistValues'],function(_0x1e73bf){return{'name':_0x1e73bf[_0x1113('0x7e')],'value':_0x1e73bf[_0x1113('0x82')]};}):[]};})};}})[_0x1113('0x24')](respondWithResult(_0x4374bc,null))[_0x1113('0x55')](function(_0x2507a4){console['log']('vTiger\x20error:\x20'+_0x2507a4);var _0x8c9d4d=_0x3bd2b5[_0x1113('0x43')][_0x1113('0x20')]?0x1f4:_0x2507a4[_0x1113('0x83')]||0x1f4;logger[_0x1113('0x29')](_0x1113('0x84'),_0x1113('0x68'),_0x8c9d4d,JSON['stringify'](_0x2507a4));delete _0x2507a4['name'];if(_0x8c9d4d===0x191){_0x8c9d4d=0x190;}_0x4374bc[_0x1113('0x2f')](_0x8c9d4d)[_0x1113('0x3b')](_0x3bd2b5[_0x1113('0x43')][_0x1113('0x20')]?{'message':_0x1113('0x85'),'statusCode':_0x2507a4[_0x1113('0x83')]}:_0x2507a4);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 7d976ad..9bbe22c 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 _0x798e=['VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0xf4666e,_0x571140){var _0x1853f1=function(_0x5160a5){while(--_0x5160a5){_0xf4666e['push'](_0xf4666e['shift']());}};_0x1853f1(++_0x571140);}(_0x798e,0x106));var _0xe798=function(_0x2e9713,_0x17cbe3){_0x2e9713=_0x2e9713-0x0;var _0x55ce49=_0x798e[_0x2e9713];return _0x55ce49;};'use strict';var _=require('lodash');var util=require(_0xe798('0x0'));var logger=require(_0xe798('0x1'))(_0xe798('0x2'));var moment=require('moment');var BPromise=require(_0xe798('0x3'));var rp=require(_0xe798('0x4'));var fs=require('fs');var path=require(_0xe798('0x5'));var rimraf=require(_0xe798('0x6'));var config=require(_0xe798('0x7'));var attributes=require(_0xe798('0x8'));var integrations=require(_0xe798('0x9'));module[_0xe798('0xa')]=function(_0x4bd232,_0x25b3b9){return _0x4bd232['define'](_0xe798('0xb'),attributes,{'tableName':_0xe798('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa30e=['../../components/integrations/configuration','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes'];(function(_0x4c2f9a,_0x1c2407){var _0x27b9ad=function(_0x1eb14c){while(--_0x1eb14c){_0x4c2f9a['push'](_0x4c2f9a['shift']());}};_0x27b9ad(++_0x1c2407);}(_0xa30e,0x100));var _0xea30=function(_0xa76664,_0x5e32db){_0xa76664=_0xa76664-0x0;var _0x3f7743=_0xa30e[_0xa76664];return _0x3f7743;};'use strict';var _=require(_0xea30('0x0'));var util=require(_0xea30('0x1'));var logger=require(_0xea30('0x2'))('api');var moment=require('moment');var BPromise=require(_0xea30('0x3'));var rp=require(_0xea30('0x4'));var fs=require('fs');var path=require(_0xea30('0x5'));var rimraf=require(_0xea30('0x6'));var config=require('../../config/environment');var attributes=require(_0xea30('0x7'));var integrations=require(_0xea30('0x8'));module['exports']=function(_0x456791,_0x575827){return _0x456791['define'](_0xea30('0x9'),attributes,{'tableName':_0xea30('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 87e2aec..f853e20 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 _0xb342=['find','raw','where','debug','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVtigerAccount','VtigerAccount','options','limit','include','map','model','attributes','stringify','ShowVtigerAccount'];(function(_0x2468b2,_0x281ab4){var _0x48f86a=function(_0x48f466){while(--_0x48f466){_0x2468b2['push'](_0x2468b2['shift']());}};_0x48f86a(++_0x281ab4);}(_0xb342,0xd1));var _0x2b34=function(_0x5eb83e,_0x386039){_0x5eb83e=_0x5eb83e-0x0;var _0x2ba972=_0xb342[_0x5eb83e];return _0x2ba972;};'use strict';var _=require('lodash');var util=require(_0x2b34('0x0'));var moment=require(_0x2b34('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b34('0x2'));var fs=require('fs');var Redis=require(_0x2b34('0x3'));var db=require(_0x2b34('0x4'))['db'];var utils=require(_0x2b34('0x5'));var logger=require(_0x2b34('0x6'))('rpc');var config=require(_0x2b34('0x7'));var jayson=require(_0x2b34('0x8'));var client=jayson['client'][_0x2b34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5acb27,_0x157c01,_0x1f2f7e){return new BPromise(function(_0x53cebb,_0x541b1b){return client['request'](_0x5acb27,_0x1f2f7e)[_0x2b34('0xa')](function(_0x12c5e3){logger[_0x2b34('0xb')](_0x2b34('0xc'),_0x157c01,_0x2b34('0xd'));logger['debug'](_0x2b34('0xe'),_0x157c01,'request\x20sent',JSON['stringify'](_0x12c5e3));if(_0x12c5e3[_0x2b34('0xf')]){if(_0x12c5e3['error'][_0x2b34('0x10')]===0x1f4){logger[_0x2b34('0xf')](_0x2b34('0xc'),_0x157c01,_0x12c5e3[_0x2b34('0xf')][_0x2b34('0x11')]);return _0x541b1b(_0x12c5e3[_0x2b34('0xf')][_0x2b34('0x11')]);}logger[_0x2b34('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x157c01,_0x12c5e3[_0x2b34('0xf')]['message']);return _0x53cebb(_0x12c5e3['error'][_0x2b34('0x11')]);}else{logger[_0x2b34('0xb')](_0x2b34('0xc'),_0x157c01,_0x2b34('0xd'));_0x53cebb(_0x12c5e3[_0x2b34('0x12')][_0x2b34('0x11')]);}})['catch'](function(_0x1e8b14){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x157c01,_0x1e8b14);_0x541b1b(_0x1e8b14);});});}exports[_0x2b34('0x13')]=function(_0x7c908a){var _0x375806=this;return new Promise(function(_0x289cef,_0x5add03){return db[_0x2b34('0x14')]['findAll']({'raw':_0x7c908a['options']?_0x7c908a['options']['raw']===undefined?!![]:![]:!![],'where':_0x7c908a[_0x2b34('0x15')]?_0x7c908a[_0x2b34('0x15')]['where']||null:null,'attributes':_0x7c908a['options']?_0x7c908a[_0x2b34('0x15')]['attributes']||null:null,'limit':_0x7c908a[_0x2b34('0x15')]?_0x7c908a['options'][_0x2b34('0x16')]||null:null,'include':_0x7c908a[_0x2b34('0x15')]?_0x7c908a[_0x2b34('0x15')][_0x2b34('0x17')]?_[_0x2b34('0x18')](_0x7c908a['options']['include'],function(_0x4e7295){return{'model':db[_0x4e7295[_0x2b34('0x19')]],'as':_0x4e7295['as'],'attributes':_0x4e7295[_0x2b34('0x1a')],'include':_0x4e7295[_0x2b34('0x17')]?_['map'](_0x4e7295[_0x2b34('0x17')],function(_0x7eea6a){return{'model':db[_0x7eea6a['model']],'as':_0x7eea6a['as'],'attributes':_0x7eea6a[_0x2b34('0x1a')],'include':_0x7eea6a[_0x2b34('0x17')]?_[_0x2b34('0x18')](_0x7eea6a['include'],function(_0x343a2d){return{'model':db[_0x343a2d[_0x2b34('0x19')]],'as':_0x343a2d['as'],'attributes':_0x343a2d[_0x2b34('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2b34('0xa')](function(_0x1c3343){logger[_0x2b34('0xb')](_0x2b34('0x13'),_0x7c908a);logger['debug'](_0x2b34('0x13'),_0x7c908a,JSON[_0x2b34('0x1b')](_0x1c3343));_0x289cef(_0x1c3343);})['catch'](function(_0x503bb5){logger[_0x2b34('0xf')](_0x2b34('0x13'),_0x503bb5['message'],_0x7c908a);_0x5add03(_0x375806['error'](0x1f4,_0x503bb5[_0x2b34('0x11')]));});});};exports[_0x2b34('0x1c')]=function(_0x533241){var _0x1e992a=this;return new Promise(function(_0x3a8219,_0x2defda){return db[_0x2b34('0x14')][_0x2b34('0x1d')]({'raw':_0x533241[_0x2b34('0x15')]?_0x533241[_0x2b34('0x15')][_0x2b34('0x1e')]===undefined?!![]:![]:!![],'where':_0x533241[_0x2b34('0x15')]?_0x533241[_0x2b34('0x15')][_0x2b34('0x1f')]||null:null,'attributes':_0x533241['options']?_0x533241[_0x2b34('0x15')][_0x2b34('0x1a')]||null:null,'include':_0x533241[_0x2b34('0x15')]?_0x533241[_0x2b34('0x15')][_0x2b34('0x17')]?_[_0x2b34('0x18')](_0x533241[_0x2b34('0x15')][_0x2b34('0x17')],function(_0x1a6e5d){return{'model':db[_0x1a6e5d[_0x2b34('0x19')]],'as':_0x1a6e5d['as'],'attributes':_0x1a6e5d['attributes'],'include':_0x1a6e5d[_0x2b34('0x17')]?_[_0x2b34('0x18')](_0x1a6e5d[_0x2b34('0x17')],function(_0x55af90){return{'model':db[_0x55af90[_0x2b34('0x19')]],'as':_0x55af90['as'],'attributes':_0x55af90[_0x2b34('0x1a')],'include':_0x55af90[_0x2b34('0x17')]?_['map'](_0x55af90[_0x2b34('0x17')],function(_0x49b352){return{'model':db[_0x49b352[_0x2b34('0x19')]],'as':_0x49b352['as'],'attributes':_0x49b352[_0x2b34('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2b34('0xa')](function(_0x3d8f0d){logger['info'](_0x2b34('0x1c'),_0x533241);logger[_0x2b34('0x20')](_0x2b34('0x1c'),_0x533241,JSON['stringify'](_0x3d8f0d));_0x3a8219(_0x3d8f0d);})[_0x2b34('0x21')](function(_0x9fd3ac){logger[_0x2b34('0xf')](_0x2b34('0x1c'),_0x9fd3ac[_0x2b34('0x11')],_0x533241);_0x2defda(_0x1e992a[_0x2b34('0xf')](0x1f4,_0x9fd3ac['message']));});});}; \ No newline at end of file +var _0xca72=['VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x4cc66a,_0x473509){var _0x37cc0c=function(_0x5c2578){while(--_0x5c2578){_0x4cc66a['push'](_0x4cc66a['shift']());}};_0x37cc0c(++_0x473509);}(_0xca72,0x16d));var _0x2ca7=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0xca72[_0x4dbba7];return _0x43ef83;};'use strict';var _=require(_0x2ca7('0x0'));var util=require(_0x2ca7('0x1'));var moment=require(_0x2ca7('0x2'));var BPromise=require('bluebird');var rs=require(_0x2ca7('0x3'));var fs=require('fs');var Redis=require(_0x2ca7('0x4'));var db=require(_0x2ca7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ca7('0x6'))(_0x2ca7('0x7'));var config=require(_0x2ca7('0x8'));var jayson=require(_0x2ca7('0x9'));var client=jayson[_0x2ca7('0xa')][_0x2ca7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eee57,_0xa9588d,_0xc6fd7e){return new BPromise(function(_0x256c99,_0x2ab690){return client[_0x2ca7('0xc')](_0x1eee57,_0xc6fd7e)[_0x2ca7('0xd')](function(_0x3b1210){logger[_0x2ca7('0xe')]('VtigerAccount,\x20%s,\x20%s',_0xa9588d,_0x2ca7('0xf'));logger[_0x2ca7('0x10')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0xa9588d,_0x2ca7('0xf'),JSON[_0x2ca7('0x11')](_0x3b1210));if(_0x3b1210['error']){if(_0x3b1210[_0x2ca7('0x12')][_0x2ca7('0x13')]===0x1f4){logger[_0x2ca7('0x12')](_0x2ca7('0x14'),_0xa9588d,_0x3b1210[_0x2ca7('0x12')][_0x2ca7('0x15')]);return _0x2ab690(_0x3b1210[_0x2ca7('0x12')]['message']);}logger[_0x2ca7('0x12')](_0x2ca7('0x14'),_0xa9588d,_0x3b1210['error']['message']);return _0x256c99(_0x3b1210[_0x2ca7('0x12')][_0x2ca7('0x15')]);}else{logger[_0x2ca7('0xe')](_0x2ca7('0x14'),_0xa9588d,'request\x20sent');_0x256c99(_0x3b1210[_0x2ca7('0x16')][_0x2ca7('0x15')]);}})[_0x2ca7('0x17')](function(_0x176885){logger['error']('VtigerAccount,\x20%s,\x20%s',_0xa9588d,_0x176885);_0x2ab690(_0x176885);});});}exports[_0x2ca7('0x18')]=function(_0x322e49){var _0x322888=this;return new Promise(function(_0x3e342e,_0x4e11cd){return db[_0x2ca7('0x19')][_0x2ca7('0x1a')]({'raw':_0x322e49['options']?_0x322e49[_0x2ca7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x322e49['options']?_0x322e49[_0x2ca7('0x1b')][_0x2ca7('0x1c')]||null:null,'attributes':_0x322e49[_0x2ca7('0x1b')]?_0x322e49['options']['attributes']||null:null,'limit':_0x322e49[_0x2ca7('0x1b')]?_0x322e49[_0x2ca7('0x1b')][_0x2ca7('0x1d')]||null:null,'include':_0x322e49[_0x2ca7('0x1b')]?_0x322e49['options'][_0x2ca7('0x1e')]?_[_0x2ca7('0x1f')](_0x322e49[_0x2ca7('0x1b')]['include'],function(_0x29dbab){return{'model':db[_0x29dbab[_0x2ca7('0x20')]],'as':_0x29dbab['as'],'attributes':_0x29dbab[_0x2ca7('0x21')],'include':_0x29dbab['include']?_[_0x2ca7('0x1f')](_0x29dbab['include'],function(_0x45568d){return{'model':db[_0x45568d[_0x2ca7('0x20')]],'as':_0x45568d['as'],'attributes':_0x45568d[_0x2ca7('0x21')],'include':_0x45568d['include']?_[_0x2ca7('0x1f')](_0x45568d[_0x2ca7('0x1e')],function(_0x4aa5b5){return{'model':db[_0x4aa5b5[_0x2ca7('0x20')]],'as':_0x4aa5b5['as'],'attributes':_0x4aa5b5[_0x2ca7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2ca7('0xd')](function(_0x37c58e){logger[_0x2ca7('0xe')]('GetVtigerAccount',_0x322e49);logger[_0x2ca7('0x10')](_0x2ca7('0x18'),_0x322e49,JSON[_0x2ca7('0x11')](_0x37c58e));_0x3e342e(_0x37c58e);})[_0x2ca7('0x17')](function(_0x2a4ce1){logger[_0x2ca7('0x12')]('GetVtigerAccount',_0x2a4ce1[_0x2ca7('0x15')],_0x322e49);_0x4e11cd(_0x322888[_0x2ca7('0x12')](0x1f4,_0x2a4ce1[_0x2ca7('0x15')]));});});};exports[_0x2ca7('0x22')]=function(_0x11d7ce){var _0xe1ed43=this;return new Promise(function(_0x490b23,_0xb74d2b){return db[_0x2ca7('0x19')]['find']({'raw':_0x11d7ce[_0x2ca7('0x1b')]?_0x11d7ce[_0x2ca7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x11d7ce['options']?_0x11d7ce[_0x2ca7('0x1b')][_0x2ca7('0x1c')]||null:null,'attributes':_0x11d7ce[_0x2ca7('0x1b')]?_0x11d7ce[_0x2ca7('0x1b')]['attributes']||null:null,'include':_0x11d7ce[_0x2ca7('0x1b')]?_0x11d7ce[_0x2ca7('0x1b')]['include']?_[_0x2ca7('0x1f')](_0x11d7ce[_0x2ca7('0x1b')][_0x2ca7('0x1e')],function(_0xb3b635){return{'model':db[_0xb3b635[_0x2ca7('0x20')]],'as':_0xb3b635['as'],'attributes':_0xb3b635['attributes'],'include':_0xb3b635[_0x2ca7('0x1e')]?_[_0x2ca7('0x1f')](_0xb3b635[_0x2ca7('0x1e')],function(_0x57527d){return{'model':db[_0x57527d['model']],'as':_0x57527d['as'],'attributes':_0x57527d[_0x2ca7('0x21')],'include':_0x57527d[_0x2ca7('0x1e')]?_[_0x2ca7('0x1f')](_0x57527d[_0x2ca7('0x1e')],function(_0x29ea24){return{'model':db[_0x29ea24[_0x2ca7('0x20')]],'as':_0x29ea24['as'],'attributes':_0x29ea24[_0x2ca7('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x292aeb){logger['info'](_0x2ca7('0x22'),_0x11d7ce);logger[_0x2ca7('0x10')]('ShowVtigerAccount',_0x11d7ce,JSON['stringify'](_0x292aeb));_0x490b23(_0x292aeb);})[_0x2ca7('0x17')](function(_0x1ccf44){logger[_0x2ca7('0x12')](_0x2ca7('0x22'),_0x1ccf44[_0x2ca7('0x15')],_0x11d7ce);_0xb74d2b(_0xe1ed43[_0x2ca7('0x12')](0x1f4,_0x1ccf44[_0x2ca7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index f9a7760..2b6081c 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x403ab2,_0x3ec586){var _0x9717d4=function(_0x16b2c8){while(--_0x16b2c8){_0x403ab2['push'](_0x403ab2['shift']());}};_0x9717d4(++_0x3ec586);}(_0x5f2f,0x73));var _0xf5f2=function(_0x31ec57,_0x46907d){_0x31ec57=_0x31ec57-0x0;var _0xc0726c=_0x5f2f[_0x31ec57];return _0xc0726c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0xf')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file +var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index d5a3280..fe6817a 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 _0x4252=['STRING','sequelize','exports'];(function(_0x33fd74,_0x761764){var _0x4a17ea=function(_0x53768c){while(--_0x53768c){_0x33fd74['push'](_0x33fd74['shift']());}};_0x4a17ea(++_0x761764);}(_0x4252,0x178));var _0x2425=function(_0x301b67,_0x9e3e59){_0x301b67=_0x301b67-0x0;var _0x2de3d1=_0x4252[_0x301b67];return _0x2de3d1;};'use strict';var Sequelize=require(_0x2425('0x0'));module[_0x2425('0x1')]={'name':{'type':Sequelize[_0x2425('0x2')]},'description':{'type':Sequelize[_0x2425('0x2')]}}; \ No newline at end of file +var _0xf5cd=['STRING','exports'];(function(_0xb950a1,_0x366247){var _0x556813=function(_0x181668){while(--_0x181668){_0xb950a1['push'](_0xb950a1['shift']());}};_0x556813(++_0x366247);}(_0xf5cd,0x8b));var _0xdf5c=function(_0x5439ff,_0x3132d1){_0x5439ff=_0x5439ff-0x0;var _0x1e95bf=_0xf5cd[_0x5439ff];return _0x1e95bf;};'use strict';var Sequelize=require('sequelize');module[_0xdf5c('0x0')]={'name':{'type':Sequelize[_0xdf5c('0x1')]},'description':{'type':Sequelize[_0xdf5c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index add65a1..55ce865 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 _0x554c=['debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','update','then','end','name','VtigerConfiguration','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','findOne','VtigerField','order','pick','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','request','info'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x554c,0x14b));var _0xc554=function(_0x11d9a5,_0x55c859){_0x11d9a5=_0x11d9a5-0x0;var _0x29a668=_0x554c[_0x11d9a5];return _0x29a668;};'use strict';var pdf=require(_0xc554('0x0'));var emlformat=require(_0xc554('0x1'));var rimraf=require(_0xc554('0x2'));var zipdir=require(_0xc554('0x3'));var jsonpatch=require(_0xc554('0x4'));var rp=require(_0xc554('0x5'));var moment=require('moment');var BPromise=require(_0xc554('0x6'));var Mustache=require(_0xc554('0x7'));var util=require(_0xc554('0x8'));var path=require(_0xc554('0x9'));var sox=require(_0xc554('0xa'));var csv=require(_0xc554('0xb'));var ejs=require(_0xc554('0xc'));var fs=require('fs');var _=require(_0xc554('0xd'));var squel=require(_0xc554('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc554('0xf'));var toCsv=require(_0xc554('0xb'));var querystring=require(_0xc554('0x10'));var Papa=require(_0xc554('0x11'));var Redis=require(_0xc554('0x12'));var authService=require(_0xc554('0x13'));var qs=require(_0xc554('0x14'));var as=require(_0xc554('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc554('0x16'))(_0xc554('0x17'));var utils=require(_0xc554('0x18'));var config=require(_0xc554('0x19'));var db=require(_0xc554('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc554('0x1b')][_0xc554('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2b9a46,_0x108a36,_0x2daa85){if(_0x2daa85){var _0x4bff99=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bff99[_0xc554('0x1d')](_0x108a36)){return _0x2b9a46;}else{throw new db[(_0xc554('0x1e'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2b9a46;}}function respondWithRpcPromise(_0x3ff21f,_0x469e0b,_0x3a7175,_0x19b7b5){return new BPromise(function(_0x809b05,_0x9e3c5d){var _0x589bb5=_0x19b7b5||client;return _0x589bb5[_0xc554('0x1f')](_0x3ff21f,_0x3a7175)['then'](function(_0x561626){logger[_0xc554('0x20')]('VtigerConfiguration,\x20%s,\x20%s',_0x469e0b,'request\x20sent');logger[_0xc554('0x21')](_0xc554('0x22'),_0x469e0b,'request\x20sent',JSON[_0xc554('0x23')](_0x561626));if(_0x561626['error']){if(_0x561626[_0xc554('0x24')][_0xc554('0x25')]===0x1f4){logger[_0xc554('0x24')](_0xc554('0x26'),_0x469e0b,_0x561626[_0xc554('0x24')][_0xc554('0x27')]);return _0x9e3c5d(_0x561626['error'][_0xc554('0x27')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x469e0b,_0x561626[_0xc554('0x24')]['message']);return _0x809b05(_0x561626[_0xc554('0x24')][_0xc554('0x27')]);}else{logger['info'](_0xc554('0x26'),_0x469e0b,'request\x20sent');_0x809b05(_0x561626[_0xc554('0x28')]['message']);}})['catch'](function(_0x312b44){logger[_0xc554('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0x469e0b,_0x312b44);_0x9e3c5d(_0x312b44);});});}function respondWithStatusCode(_0x5a1fa0,_0x1f1855){_0x1f1855=_0x1f1855||0xcc;return function(_0x25fab4){if(_0x25fab4){return _0x5a1fa0[_0xc554('0x29')](_0x1f1855);}return _0x5a1fa0[_0xc554('0x2a')](_0x1f1855)['end']();};}function respondWithResult(_0xc19ef2,_0x46ae24){_0x46ae24=_0x46ae24||0xc8;return function(_0x2d9640){if(_0x2d9640){return _0xc19ef2[_0xc554('0x2a')](_0x46ae24)[_0xc554('0x2b')](_0x2d9640);}};}function respondWithFilteredResult(_0x7a7e9,_0x23789b){return function(_0x175f95){if(_0x175f95){var _0x2f6ef1=_0x175f95[_0xc554('0x2c')],_0x36316c=_0x23789b[_0xc554('0x2d')],_0x3af945=_0x23789b[_0xc554('0x2d')]+_0x23789b[_0xc554('0x2e')],_0x4047ff;if(_0x3af945>=_0x2f6ef1){_0x3af945=_0x2f6ef1;_0x4047ff=0xc8;}else{_0x4047ff=0xce;}_0x7a7e9[_0xc554('0x2a')](_0x4047ff);return _0x7a7e9[_0xc554('0x2f')](_0xc554('0x30'),_0x36316c+'-'+_0x3af945+'/'+_0x2f6ef1)[_0xc554('0x2b')](_0x175f95);}return null;};}function patchUpdates(_0x2a84a1){return function(_0x4b095c){try{jsonpatch['apply'](_0x4b095c,_0x2a84a1,!![]);}catch(_0x533898){return BPromise['reject'](_0x533898);}return _0x4b095c['save']();};}function saveUpdates(_0x289169,_0x56dceb){return function(_0x397823){if(_0x397823){return _0x397823[_0xc554('0x31')](_0x289169)[_0xc554('0x32')](function(_0x2e0866){return _0x2e0866;});}return null;};}function removeEntity(_0x1fb596,_0x4facb1){return function(_0xa340fc){if(_0xa340fc){return _0xa340fc['destroy']()[_0xc554('0x32')](function(){_0x1fb596[_0xc554('0x2a')](0xcc)[_0xc554('0x33')]();});}};}function handleEntityNotFound(_0x3fd444,_0x11c1ac){return function(_0x7b40b3){if(!_0x7b40b3){_0x3fd444[_0xc554('0x29')](0x194);}return _0x7b40b3;};}function handleError(_0x5b367a,_0x526584){_0x526584=_0x526584||0x1f4;return function(_0x576f28){logger[_0xc554('0x24')](_0x576f28['stack']);if(_0x576f28[_0xc554('0x34')]){delete _0x576f28[_0xc554('0x34')];}_0x5b367a['status'](_0x526584)['send'](_0x576f28);};}exports['index']=function(_0x5ec982,_0x5d78bf){var _0x4fe050={},_0x2e889b={},_0x48a29f={'count':0x0,'rows':[]};var _0x5a4a6c=_['map'](db[_0xc554('0x35')][_0xc554('0x36')],function(_0x2df8da){return{'name':_0x2df8da['fieldName'],'type':_0x2df8da[_0xc554('0x37')]['key']};});_0x2e889b[_0xc554('0x38')]=_[_0xc554('0x39')](_0x5a4a6c,_0xc554('0x34'));_0x2e889b[_0xc554('0x3a')]=_[_0xc554('0x3b')](_0x5ec982[_0xc554('0x3a')]);_0x2e889b[_0xc554('0x3c')]=_[_0xc554('0x3d')](_0x2e889b[_0xc554('0x38')],_0x2e889b['query']);_0x4fe050[_0xc554('0x3e')]=_[_0xc554('0x3d')](_0x2e889b[_0xc554('0x38')],qs[_0xc554('0x3f')](_0x5ec982['query'][_0xc554('0x3f')]));_0x4fe050['attributes']=_0x4fe050[_0xc554('0x3e')][_0xc554('0x40')]?_0x4fe050[_0xc554('0x3e')]:_0x2e889b[_0xc554('0x38')];if(!_0x5ec982[_0xc554('0x3a')][_0xc554('0x41')](_0xc554('0x42'))){_0x4fe050[_0xc554('0x2e')]=qs[_0xc554('0x2e')](_0x5ec982[_0xc554('0x3a')][_0xc554('0x2e')]);_0x4fe050[_0xc554('0x2d')]=qs[_0xc554('0x2d')](_0x5ec982[_0xc554('0x3a')][_0xc554('0x2d')]);}_0x4fe050['order']=qs['sort'](_0x5ec982[_0xc554('0x3a')][_0xc554('0x43')]);_0x4fe050['where']=qs['filters'](_['pick'](_0x5ec982['query'],_0x2e889b[_0xc554('0x3c')]));if(_0x5ec982['query'][_0xc554('0x44')]){_0x4fe050[_0xc554('0x45')]=_[_0xc554('0x46')](_0x4fe050[_0xc554('0x45')],{'$or':_[_0xc554('0x39')](_0x5a4a6c,function(_0x676ce5){if(_0x676ce5[_0xc554('0x37')]!==_0xc554('0x47')){var _0x5a160e={};_0x5a160e[_0x676ce5[_0xc554('0x34')]]={'$like':'%'+_0x5ec982[_0xc554('0x3a')]['filter']+'%'};return _0x5a160e;}})});}_0x4fe050=_[_0xc554('0x46')]({},_0x4fe050,_0x5ec982[_0xc554('0x48')]);var _0xa3c12c={'where':_0x4fe050['where']};return db[_0xc554('0x35')]['count'](_0xa3c12c)[_0xc554('0x32')](function(_0x32953c){_0x48a29f[_0xc554('0x2c')]=_0x32953c;if(_0x5ec982[_0xc554('0x3a')][_0xc554('0x49')]){_0x4fe050[_0xc554('0x4a')]=[{'all':!![]}];}return db[_0xc554('0x35')][_0xc554('0x4b')](_0x4fe050);})['then'](function(_0x645996){_0x48a29f[_0xc554('0x4c')]=_0x645996;return _0x48a29f;})[_0xc554('0x32')](respondWithFilteredResult(_0x5d78bf,_0x4fe050))[_0xc554('0x4d')](handleError(_0x5d78bf,null));};exports[_0xc554('0x4e')]=function(_0x4e5f33,_0x5389a3){var _0x17b02b={'raw':![],'where':{'id':_0x4e5f33[_0xc554('0x4f')]['id']}},_0x160a04={};_0x160a04[_0xc554('0x38')]=_[_0xc554('0x3b')](db[_0xc554('0x35')]['rawAttributes']);_0x160a04['query']=_[_0xc554('0x3b')](_0x4e5f33[_0xc554('0x3a')]);_0x160a04[_0xc554('0x3c')]=_['intersection'](_0x160a04[_0xc554('0x38')],_0x160a04['query']);_0x17b02b[_0xc554('0x3e')]=_[_0xc554('0x3d')](_0x160a04['model'],qs['fields'](_0x4e5f33['query']['fields']));_0x17b02b[_0xc554('0x3e')]=_0x17b02b[_0xc554('0x3e')][_0xc554('0x40')]?_0x17b02b[_0xc554('0x3e')]:_0x160a04['model'];if(_0x4e5f33[_0xc554('0x3a')][_0xc554('0x49')]){_0x17b02b[_0xc554('0x4a')]=[{'all':!![]}];}_0x17b02b=_[_0xc554('0x46')]({},_0x17b02b,_0x4e5f33[_0xc554('0x48')]);return db[_0xc554('0x35')][_0xc554('0x50')](_0x17b02b)['then'](handleEntityNotFound(_0x5389a3,null))[_0xc554('0x32')](respondWithResult(_0x5389a3,null))['catch'](handleError(_0x5389a3,null));};exports[_0xc554('0x51')]=function(_0x44b1d7,_0x54517a){return db['VtigerConfiguration'][_0xc554('0x51')](_0x44b1d7[_0xc554('0x52')],{})[_0xc554('0x32')](respondWithResult(_0x54517a,0xc9))['catch'](handleError(_0x54517a,null));};exports[_0xc554('0x31')]=function(_0x4b4567,_0x599231){if(_0x4b4567[_0xc554('0x52')]['id']){delete _0x4b4567[_0xc554('0x52')]['id'];}return db[_0xc554('0x35')]['find']({'where':{'id':_0x4b4567['params']['id']}})[_0xc554('0x32')](handleEntityNotFound(_0x599231,null))[_0xc554('0x32')](saveUpdates(_0x4b4567[_0xc554('0x52')],null))[_0xc554('0x32')](respondWithResult(_0x599231,null))['catch'](handleError(_0x599231,null));};exports[_0xc554('0x53')]=function(_0x40b647,_0x55e2f1){return db[_0xc554('0x35')]['find']({'where':{'id':_0x40b647[_0xc554('0x4f')]['id']}})[_0xc554('0x32')](handleEntityNotFound(_0x55e2f1,null))[_0xc554('0x32')](removeEntity(_0x55e2f1,null))[_0xc554('0x4d')](handleError(_0x55e2f1,null));};exports['getFields']=function(_0xb75ea1,_0x2d1107,_0x2537d5){var _0xbce375={};var _0x1a6667={};var _0x3a3236;var _0x288247;return db[_0xc554('0x35')][_0xc554('0x54')]({'where':{'id':_0xb75ea1['params']['id']}})[_0xc554('0x32')](handleEntityNotFound(_0x2d1107,null))[_0xc554('0x32')](function(_0x25151b){if(_0x25151b){_0x3a3236=_0x25151b;_0x1a6667[_0xc554('0x38')]=_[_0xc554('0x3b')](db[_0xc554('0x55')][_0xc554('0x36')]);_0x1a6667[_0xc554('0x3a')]=_['keys'](_0xb75ea1[_0xc554('0x3a')]);_0x1a6667['filters']=_[_0xc554('0x3d')](_0x1a6667[_0xc554('0x38')],_0x1a6667['query']);_0xbce375[_0xc554('0x3e')]=_[_0xc554('0x3d')](_0x1a6667[_0xc554('0x38')],qs[_0xc554('0x3f')](_0xb75ea1['query'][_0xc554('0x3f')]));_0xbce375[_0xc554('0x3e')]=_0xbce375[_0xc554('0x3e')][_0xc554('0x40')]?_0xbce375[_0xc554('0x3e')]:_0x1a6667[_0xc554('0x38')];_0xbce375[_0xc554('0x56')]=qs[_0xc554('0x43')](_0xb75ea1[_0xc554('0x3a')][_0xc554('0x43')]);_0xbce375[_0xc554('0x45')]=qs[_0xc554('0x3c')](_[_0xc554('0x57')](_0xb75ea1[_0xc554('0x3a')],_0x1a6667[_0xc554('0x3c')]));if(_0xb75ea1[_0xc554('0x3a')][_0xc554('0x44')]){_0xbce375[_0xc554('0x45')]=_[_0xc554('0x46')](_0xbce375[_0xc554('0x45')],{'$or':_['map'](_0xbce375[_0xc554('0x3e')],function(_0x57efbe){var _0x5722e7={};_0x5722e7[_0x57efbe]={'$like':'%'+_0xb75ea1[_0xc554('0x3a')][_0xc554('0x44')]+'%'};return _0x5722e7;})});}_0xbce375=_[_0xc554('0x46')]({},_0xbce375,_0xb75ea1['options']);return _0x3a3236['getFields'](_0xbce375);}})['then'](function(_0x3b8be2){if(_0x3b8be2){_0x288247=_0x3b8be2[_0xc554('0x40')];if(!_0xb75ea1[_0xc554('0x3a')][_0xc554('0x41')](_0xc554('0x42'))){_0xbce375[_0xc554('0x2e')]=qs[_0xc554('0x2e')](_0xb75ea1[_0xc554('0x3a')][_0xc554('0x2e')]);_0xbce375[_0xc554('0x2d')]=qs['offset'](_0xb75ea1[_0xc554('0x3a')][_0xc554('0x2d')]);}return _0x3a3236[_0xc554('0x58')](_0xbce375);}})[_0xc554('0x32')](function(_0x4d1e1a){if(_0x4d1e1a){return _0x4d1e1a?{'count':_0x288247,'rows':_0x4d1e1a}:null;}})[_0xc554('0x32')](respondWithResult(_0x2d1107,null))['catch'](handleError(_0x2d1107,null));};exports['getSubjects']=function(_0x31153e,_0x1667bd,_0x57d1a0){var _0x291f4c={};var _0x4c343b={};var _0x5c8270;var _0x523e70;return db[_0xc554('0x35')]['findOne']({'where':{'id':_0x31153e[_0xc554('0x4f')]['id']}})[_0xc554('0x32')](handleEntityNotFound(_0x1667bd,null))[_0xc554('0x32')](function(_0x27d6e1){if(_0x27d6e1){_0x5c8270=_0x27d6e1;_0x4c343b[_0xc554('0x38')]=_[_0xc554('0x3b')](db[_0xc554('0x55')]['rawAttributes']);_0x4c343b[_0xc554('0x3a')]=_[_0xc554('0x3b')](_0x31153e['query']);_0x4c343b[_0xc554('0x3c')]=_[_0xc554('0x3d')](_0x4c343b['model'],_0x4c343b[_0xc554('0x3a')]);_0x291f4c[_0xc554('0x3e')]=_[_0xc554('0x3d')](_0x4c343b[_0xc554('0x38')],qs['fields'](_0x31153e[_0xc554('0x3a')][_0xc554('0x3f')]));_0x291f4c[_0xc554('0x3e')]=_0x291f4c[_0xc554('0x3e')][_0xc554('0x40')]?_0x291f4c['attributes']:_0x4c343b[_0xc554('0x38')];_0x291f4c[_0xc554('0x56')]=qs[_0xc554('0x43')](_0x31153e[_0xc554('0x3a')][_0xc554('0x43')]);_0x291f4c[_0xc554('0x45')]=qs[_0xc554('0x3c')](_[_0xc554('0x57')](_0x31153e[_0xc554('0x3a')],_0x4c343b[_0xc554('0x3c')]));if(_0x31153e['query'][_0xc554('0x44')]){_0x291f4c[_0xc554('0x45')]=_['merge'](_0x291f4c[_0xc554('0x45')],{'$or':_[_0xc554('0x39')](_0x291f4c['attributes'],function(_0x51c64e){var _0x54d817={};_0x54d817[_0x51c64e]={'$like':'%'+_0x31153e[_0xc554('0x3a')]['filter']+'%'};return _0x54d817;})});}_0x291f4c=_[_0xc554('0x46')]({},_0x291f4c,_0x31153e[_0xc554('0x48')]);return _0x5c8270[_0xc554('0x59')](_0x291f4c);}})[_0xc554('0x32')](function(_0x1614ae){if(_0x1614ae){_0x523e70=_0x1614ae['length'];if(!_0x31153e['query'][_0xc554('0x41')](_0xc554('0x42'))){_0x291f4c[_0xc554('0x2e')]=qs[_0xc554('0x2e')](_0x31153e[_0xc554('0x3a')][_0xc554('0x2e')]);_0x291f4c[_0xc554('0x2d')]=qs[_0xc554('0x2d')](_0x31153e[_0xc554('0x3a')]['offset']);}return _0x5c8270[_0xc554('0x59')](_0x291f4c);}})[_0xc554('0x32')](function(_0x494ddd){if(_0x494ddd){return _0x494ddd?{'count':_0x523e70,'rows':_0x494ddd}:null;}})[_0xc554('0x32')](respondWithResult(_0x1667bd,null))[_0xc554('0x4d')](handleError(_0x1667bd,null));};exports[_0xc554('0x5a')]=function(_0x3728c9,_0xc26018,_0x3b2bee){var _0x454593={};var _0x4d2dde={};var _0x154340;var _0x14aacc;return db[_0xc554('0x35')]['findOne']({'where':{'id':_0x3728c9[_0xc554('0x4f')]['id']}})['then'](handleEntityNotFound(_0xc26018,null))['then'](function(_0x12cc47){if(_0x12cc47){_0x154340=_0x12cc47;_0x4d2dde[_0xc554('0x38')]=_[_0xc554('0x3b')](db['VtigerField'][_0xc554('0x36')]);_0x4d2dde[_0xc554('0x3a')]=_[_0xc554('0x3b')](_0x3728c9[_0xc554('0x3a')]);_0x4d2dde[_0xc554('0x3c')]=_['intersection'](_0x4d2dde[_0xc554('0x38')],_0x4d2dde[_0xc554('0x3a')]);_0x454593[_0xc554('0x3e')]=_['intersection'](_0x4d2dde['model'],qs[_0xc554('0x3f')](_0x3728c9['query'][_0xc554('0x3f')]));_0x454593['attributes']=_0x454593[_0xc554('0x3e')][_0xc554('0x40')]?_0x454593[_0xc554('0x3e')]:_0x4d2dde[_0xc554('0x38')];_0x454593['order']=qs[_0xc554('0x43')](_0x3728c9[_0xc554('0x3a')][_0xc554('0x43')]);_0x454593[_0xc554('0x45')]=qs[_0xc554('0x3c')](_['pick'](_0x3728c9['query'],_0x4d2dde['filters']));if(_0x3728c9['query']['filter']){_0x454593['where']=_[_0xc554('0x46')](_0x454593[_0xc554('0x45')],{'$or':_['map'](_0x454593[_0xc554('0x3e')],function(_0x176d8f){var _0x4ea024={};_0x4ea024[_0x176d8f]={'$like':'%'+_0x3728c9[_0xc554('0x3a')][_0xc554('0x44')]+'%'};return _0x4ea024;})});}_0x454593=_[_0xc554('0x46')]({},_0x454593,_0x3728c9[_0xc554('0x48')]);return _0x154340[_0xc554('0x5a')](_0x454593);}})[_0xc554('0x32')](function(_0x26db8c){if(_0x26db8c){_0x14aacc=_0x26db8c['length'];if(!_0x3728c9[_0xc554('0x3a')][_0xc554('0x41')]('nolimit')){_0x454593[_0xc554('0x2e')]=qs[_0xc554('0x2e')](_0x3728c9[_0xc554('0x3a')][_0xc554('0x2e')]);_0x454593[_0xc554('0x2d')]=qs[_0xc554('0x2d')](_0x3728c9[_0xc554('0x3a')][_0xc554('0x2d')]);}return _0x154340[_0xc554('0x5a')](_0x454593);}})[_0xc554('0x32')](function(_0x41776d){if(_0x41776d){return _0x41776d?{'count':_0x14aacc,'rows':_0x41776d}:null;}})[_0xc554('0x32')](respondWithResult(_0xc26018,null))[_0xc554('0x4d')](handleError(_0xc26018,null));}; \ No newline at end of file +var _0xb6cc=['offset','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','index','map','VtigerConfiguration','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','body','getFields','rawAttributes','getSubjects','findOne','params','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0xb6cc,0x14f));var _0xcb6c=function(_0x12c1d0,_0x4e6f6a){_0x12c1d0=_0x12c1d0-0x0;var _0x2b5a6c=_0xb6cc[_0x12c1d0];return _0x2b5a6c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcb6c('0x0'));var rimraf=require(_0xcb6c('0x1'));var zipdir=require(_0xcb6c('0x2'));var jsonpatch=require(_0xcb6c('0x3'));var rp=require(_0xcb6c('0x4'));var moment=require(_0xcb6c('0x5'));var BPromise=require(_0xcb6c('0x6'));var Mustache=require(_0xcb6c('0x7'));var util=require('util');var path=require(_0xcb6c('0x8'));var sox=require('sox');var csv=require(_0xcb6c('0x9'));var ejs=require(_0xcb6c('0xa'));var fs=require('fs');var _=require(_0xcb6c('0xb'));var squel=require(_0xcb6c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcb6c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb6c('0xe'));var Papa=require(_0xcb6c('0xf'));var Redis=require('ioredis');var authService=require(_0xcb6c('0x10'));var qs=require(_0xcb6c('0x11'));var as=require(_0xcb6c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb6c('0x13'))(_0xcb6c('0x14'));var utils=require(_0xcb6c('0x15'));var config=require(_0xcb6c('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xcb6c('0x17'));var client=jayson[_0xcb6c('0x18')][_0xcb6c('0x19')]({'port':0x232a});function checkPasswordPattern(_0x181c6d,_0x11b252,_0x23ab7d){if(_0x23ab7d){var _0x4ebae0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ebae0[_0xcb6c('0x1a')](_0x11b252)){return _0x181c6d;}else{throw new db['Sequelize'][(_0xcb6c('0x1b'))](_0xcb6c('0x1c'));}}else{return _0x181c6d;}}function respondWithRpcPromise(_0x59efd7,_0x51f918,_0x698d2,_0x31d19e){return new BPromise(function(_0x3ecaba,_0x4d290d){var _0x2f1b22=_0x31d19e||client;return _0x2f1b22[_0xcb6c('0x1d')](_0x59efd7,_0x698d2)[_0xcb6c('0x1e')](function(_0x194e3c){logger[_0xcb6c('0x1f')](_0xcb6c('0x20'),_0x51f918,_0xcb6c('0x21'));logger[_0xcb6c('0x22')](_0xcb6c('0x23'),_0x51f918,_0xcb6c('0x21'),JSON[_0xcb6c('0x24')](_0x194e3c));if(_0x194e3c[_0xcb6c('0x25')]){if(_0x194e3c['error'][_0xcb6c('0x26')]===0x1f4){logger[_0xcb6c('0x25')](_0xcb6c('0x20'),_0x51f918,_0x194e3c[_0xcb6c('0x25')][_0xcb6c('0x27')]);return _0x4d290d(_0x194e3c[_0xcb6c('0x25')][_0xcb6c('0x27')]);}logger[_0xcb6c('0x25')](_0xcb6c('0x20'),_0x51f918,_0x194e3c['error'][_0xcb6c('0x27')]);return _0x3ecaba(_0x194e3c[_0xcb6c('0x25')][_0xcb6c('0x27')]);}else{logger[_0xcb6c('0x1f')](_0xcb6c('0x20'),_0x51f918,_0xcb6c('0x21'));_0x3ecaba(_0x194e3c[_0xcb6c('0x28')][_0xcb6c('0x27')]);}})[_0xcb6c('0x29')](function(_0x919ad0){logger[_0xcb6c('0x25')](_0xcb6c('0x20'),_0x51f918,_0x919ad0);_0x4d290d(_0x919ad0);});});}function respondWithStatusCode(_0x2b7ab2,_0x5a24fd){_0x5a24fd=_0x5a24fd||0xcc;return function(_0x1c6f0d){if(_0x1c6f0d){return _0x2b7ab2['sendStatus'](_0x5a24fd);}return _0x2b7ab2['status'](_0x5a24fd)['end']();};}function respondWithResult(_0x24a15a,_0x4c807c){_0x4c807c=_0x4c807c||0xc8;return function(_0x558e41){if(_0x558e41){return _0x24a15a[_0xcb6c('0x2a')](_0x4c807c)[_0xcb6c('0x2b')](_0x558e41);}};}function respondWithFilteredResult(_0x2b5964,_0x4fbc64){return function(_0x4150b4){if(_0x4150b4){var _0x31f4bc=_0x4150b4[_0xcb6c('0x2c')],_0x4cb79b=_0x4fbc64[_0xcb6c('0x2d')],_0x465086=_0x4fbc64['offset']+_0x4fbc64['limit'],_0x36e5c1;if(_0x465086>=_0x31f4bc){_0x465086=_0x31f4bc;_0x36e5c1=0xc8;}else{_0x36e5c1=0xce;}_0x2b5964[_0xcb6c('0x2a')](_0x36e5c1);return _0x2b5964[_0xcb6c('0x2e')](_0xcb6c('0x2f'),_0x4cb79b+'-'+_0x465086+'/'+_0x31f4bc)['json'](_0x4150b4);}return null;};}function patchUpdates(_0x4d66f2){return function(_0xc5c3fa){try{jsonpatch[_0xcb6c('0x30')](_0xc5c3fa,_0x4d66f2,!![]);}catch(_0x1a82ca){return BPromise[_0xcb6c('0x31')](_0x1a82ca);}return _0xc5c3fa[_0xcb6c('0x32')]();};}function saveUpdates(_0x730f90,_0x5f2ec9){return function(_0x12f955){if(_0x12f955){return _0x12f955[_0xcb6c('0x33')](_0x730f90)[_0xcb6c('0x1e')](function(_0x25573b){return _0x25573b;});}return null;};}function removeEntity(_0x1d256e,_0xa30222){return function(_0x56d206){if(_0x56d206){return _0x56d206[_0xcb6c('0x34')]()['then'](function(){_0x1d256e[_0xcb6c('0x2a')](0xcc)[_0xcb6c('0x35')]();});}};}function handleEntityNotFound(_0x24fb3b,_0x1649ee){return function(_0xc9318a){if(!_0xc9318a){_0x24fb3b[_0xcb6c('0x36')](0x194);}return _0xc9318a;};}function handleError(_0x11eb4f,_0x4622ea){_0x4622ea=_0x4622ea||0x1f4;return function(_0x48c23d){logger[_0xcb6c('0x25')](_0x48c23d['stack']);if(_0x48c23d[_0xcb6c('0x37')]){delete _0x48c23d[_0xcb6c('0x37')];}_0x11eb4f[_0xcb6c('0x2a')](_0x4622ea)['send'](_0x48c23d);};}exports[_0xcb6c('0x38')]=function(_0x2ad8e9,_0x3553f6){var _0x58ce06={},_0x4ca67d={},_0xfb9098={'count':0x0,'rows':[]};var _0x388000=_[_0xcb6c('0x39')](db[_0xcb6c('0x3a')]['rawAttributes'],function(_0x181e14){return{'name':_0x181e14[_0xcb6c('0x3b')],'type':_0x181e14['type'][_0xcb6c('0x3c')]};});_0x4ca67d[_0xcb6c('0x3d')]=_[_0xcb6c('0x39')](_0x388000,_0xcb6c('0x37'));_0x4ca67d[_0xcb6c('0x3e')]=_['keys'](_0x2ad8e9[_0xcb6c('0x3e')]);_0x4ca67d[_0xcb6c('0x3f')]=_[_0xcb6c('0x40')](_0x4ca67d[_0xcb6c('0x3d')],_0x4ca67d['query']);_0x58ce06[_0xcb6c('0x41')]=_[_0xcb6c('0x40')](_0x4ca67d['model'],qs[_0xcb6c('0x42')](_0x2ad8e9['query'][_0xcb6c('0x42')]));_0x58ce06[_0xcb6c('0x41')]=_0x58ce06['attributes'][_0xcb6c('0x43')]?_0x58ce06[_0xcb6c('0x41')]:_0x4ca67d[_0xcb6c('0x3d')];if(!_0x2ad8e9[_0xcb6c('0x3e')][_0xcb6c('0x44')](_0xcb6c('0x45'))){_0x58ce06['limit']=qs['limit'](_0x2ad8e9[_0xcb6c('0x3e')][_0xcb6c('0x46')]);_0x58ce06['offset']=qs[_0xcb6c('0x2d')](_0x2ad8e9['query'][_0xcb6c('0x2d')]);}_0x58ce06[_0xcb6c('0x47')]=qs['sort'](_0x2ad8e9[_0xcb6c('0x3e')][_0xcb6c('0x48')]);_0x58ce06[_0xcb6c('0x49')]=qs[_0xcb6c('0x3f')](_[_0xcb6c('0x4a')](_0x2ad8e9[_0xcb6c('0x3e')],_0x4ca67d[_0xcb6c('0x3f')]));if(_0x2ad8e9[_0xcb6c('0x3e')][_0xcb6c('0x4b')]){_0x58ce06['where']=_[_0xcb6c('0x4c')](_0x58ce06['where'],{'$or':_[_0xcb6c('0x39')](_0x388000,function(_0x302530){if(_0x302530['type']!==_0xcb6c('0x4d')){var _0x4dfec6={};_0x4dfec6[_0x302530['name']]={'$like':'%'+_0x2ad8e9[_0xcb6c('0x3e')]['filter']+'%'};return _0x4dfec6;}})});}_0x58ce06=_[_0xcb6c('0x4c')]({},_0x58ce06,_0x2ad8e9[_0xcb6c('0x4e')]);var _0x458251={'where':_0x58ce06[_0xcb6c('0x49')]};return db[_0xcb6c('0x3a')][_0xcb6c('0x2c')](_0x458251)[_0xcb6c('0x1e')](function(_0x42e278){_0xfb9098[_0xcb6c('0x2c')]=_0x42e278;if(_0x2ad8e9[_0xcb6c('0x3e')][_0xcb6c('0x4f')]){_0x58ce06[_0xcb6c('0x50')]=[{'all':!![]}];}return db[_0xcb6c('0x3a')][_0xcb6c('0x51')](_0x58ce06);})[_0xcb6c('0x1e')](function(_0x4e41a2){_0xfb9098[_0xcb6c('0x52')]=_0x4e41a2;return _0xfb9098;})[_0xcb6c('0x1e')](respondWithFilteredResult(_0x3553f6,_0x58ce06))[_0xcb6c('0x29')](handleError(_0x3553f6,null));};exports[_0xcb6c('0x53')]=function(_0x2aac85,_0x3b93e5){var _0x568b78={'raw':![],'where':{'id':_0x2aac85['params']['id']}},_0x335bf1={};_0x335bf1[_0xcb6c('0x3d')]=_[_0xcb6c('0x54')](db['VtigerConfiguration']['rawAttributes']);_0x335bf1[_0xcb6c('0x3e')]=_[_0xcb6c('0x54')](_0x2aac85[_0xcb6c('0x3e')]);_0x335bf1[_0xcb6c('0x3f')]=_[_0xcb6c('0x40')](_0x335bf1['model'],_0x335bf1[_0xcb6c('0x3e')]);_0x568b78[_0xcb6c('0x41')]=_[_0xcb6c('0x40')](_0x335bf1['model'],qs['fields'](_0x2aac85['query']['fields']));_0x568b78['attributes']=_0x568b78[_0xcb6c('0x41')][_0xcb6c('0x43')]?_0x568b78[_0xcb6c('0x41')]:_0x335bf1['model'];if(_0x2aac85['query']['includeAll']){_0x568b78['include']=[{'all':!![]}];}_0x568b78=_['merge']({},_0x568b78,_0x2aac85[_0xcb6c('0x4e')]);return db[_0xcb6c('0x3a')][_0xcb6c('0x55')](_0x568b78)[_0xcb6c('0x1e')](handleEntityNotFound(_0x3b93e5,null))[_0xcb6c('0x1e')](respondWithResult(_0x3b93e5,null))[_0xcb6c('0x29')](handleError(_0x3b93e5,null));};exports['create']=function(_0x3914cd,_0x25b685){return db[_0xcb6c('0x3a')][_0xcb6c('0x56')](_0x3914cd[_0xcb6c('0x57')],{})['then'](respondWithResult(_0x25b685,0xc9))['catch'](handleError(_0x25b685,null));};exports[_0xcb6c('0x33')]=function(_0xc3efa6,_0x205f64){if(_0xc3efa6[_0xcb6c('0x57')]['id']){delete _0xc3efa6[_0xcb6c('0x57')]['id'];}return db[_0xcb6c('0x3a')]['find']({'where':{'id':_0xc3efa6['params']['id']}})[_0xcb6c('0x1e')](handleEntityNotFound(_0x205f64,null))[_0xcb6c('0x1e')](saveUpdates(_0xc3efa6['body'],null))[_0xcb6c('0x1e')](respondWithResult(_0x205f64,null))[_0xcb6c('0x29')](handleError(_0x205f64,null));};exports['destroy']=function(_0x525753,_0x1f283b){return db[_0xcb6c('0x3a')][_0xcb6c('0x55')]({'where':{'id':_0x525753['params']['id']}})[_0xcb6c('0x1e')](handleEntityNotFound(_0x1f283b,null))['then'](removeEntity(_0x1f283b,null))[_0xcb6c('0x29')](handleError(_0x1f283b,null));};exports[_0xcb6c('0x58')]=function(_0x5e7cdb,_0x3077c7,_0x33ff0c){var _0x4506d5={};var _0x3bf0d4={};var _0x3697b9;var _0x32b921;return db[_0xcb6c('0x3a')]['findOne']({'where':{'id':_0x5e7cdb['params']['id']}})[_0xcb6c('0x1e')](handleEntityNotFound(_0x3077c7,null))[_0xcb6c('0x1e')](function(_0x769d0c){if(_0x769d0c){_0x3697b9=_0x769d0c;_0x3bf0d4[_0xcb6c('0x3d')]=_[_0xcb6c('0x54')](db['VtigerField'][_0xcb6c('0x59')]);_0x3bf0d4[_0xcb6c('0x3e')]=_[_0xcb6c('0x54')](_0x5e7cdb['query']);_0x3bf0d4[_0xcb6c('0x3f')]=_[_0xcb6c('0x40')](_0x3bf0d4[_0xcb6c('0x3d')],_0x3bf0d4['query']);_0x4506d5['attributes']=_[_0xcb6c('0x40')](_0x3bf0d4[_0xcb6c('0x3d')],qs[_0xcb6c('0x42')](_0x5e7cdb[_0xcb6c('0x3e')][_0xcb6c('0x42')]));_0x4506d5[_0xcb6c('0x41')]=_0x4506d5[_0xcb6c('0x41')][_0xcb6c('0x43')]?_0x4506d5[_0xcb6c('0x41')]:_0x3bf0d4[_0xcb6c('0x3d')];_0x4506d5[_0xcb6c('0x47')]=qs['sort'](_0x5e7cdb[_0xcb6c('0x3e')][_0xcb6c('0x48')]);_0x4506d5['where']=qs[_0xcb6c('0x3f')](_['pick'](_0x5e7cdb['query'],_0x3bf0d4[_0xcb6c('0x3f')]));if(_0x5e7cdb[_0xcb6c('0x3e')][_0xcb6c('0x4b')]){_0x4506d5['where']=_[_0xcb6c('0x4c')](_0x4506d5[_0xcb6c('0x49')],{'$or':_[_0xcb6c('0x39')](_0x4506d5[_0xcb6c('0x41')],function(_0x2ae609){var _0x4a5a78={};_0x4a5a78[_0x2ae609]={'$like':'%'+_0x5e7cdb[_0xcb6c('0x3e')][_0xcb6c('0x4b')]+'%'};return _0x4a5a78;})});}_0x4506d5=_[_0xcb6c('0x4c')]({},_0x4506d5,_0x5e7cdb['options']);return _0x3697b9[_0xcb6c('0x58')](_0x4506d5);}})['then'](function(_0x99c0b4){if(_0x99c0b4){_0x32b921=_0x99c0b4['length'];if(!_0x5e7cdb['query'][_0xcb6c('0x44')](_0xcb6c('0x45'))){_0x4506d5[_0xcb6c('0x46')]=qs[_0xcb6c('0x46')](_0x5e7cdb[_0xcb6c('0x3e')]['limit']);_0x4506d5[_0xcb6c('0x2d')]=qs[_0xcb6c('0x2d')](_0x5e7cdb[_0xcb6c('0x3e')][_0xcb6c('0x2d')]);}return _0x3697b9[_0xcb6c('0x58')](_0x4506d5);}})[_0xcb6c('0x1e')](function(_0x378d29){if(_0x378d29){return _0x378d29?{'count':_0x32b921,'rows':_0x378d29}:null;}})['then'](respondWithResult(_0x3077c7,null))[_0xcb6c('0x29')](handleError(_0x3077c7,null));};exports[_0xcb6c('0x5a')]=function(_0x522118,_0x3b50f4,_0x1d2d4a){var _0x2ebcf7={};var _0x3e0db9={};var _0x20d532;var _0x367801;return db[_0xcb6c('0x3a')][_0xcb6c('0x5b')]({'where':{'id':_0x522118[_0xcb6c('0x5c')]['id']}})[_0xcb6c('0x1e')](handleEntityNotFound(_0x3b50f4,null))[_0xcb6c('0x1e')](function(_0x725fdb){if(_0x725fdb){_0x20d532=_0x725fdb;_0x3e0db9[_0xcb6c('0x3d')]=_[_0xcb6c('0x54')](db[_0xcb6c('0x5d')][_0xcb6c('0x59')]);_0x3e0db9['query']=_[_0xcb6c('0x54')](_0x522118['query']);_0x3e0db9['filters']=_[_0xcb6c('0x40')](_0x3e0db9[_0xcb6c('0x3d')],_0x3e0db9[_0xcb6c('0x3e')]);_0x2ebcf7['attributes']=_[_0xcb6c('0x40')](_0x3e0db9[_0xcb6c('0x3d')],qs['fields'](_0x522118['query'][_0xcb6c('0x42')]));_0x2ebcf7['attributes']=_0x2ebcf7[_0xcb6c('0x41')][_0xcb6c('0x43')]?_0x2ebcf7[_0xcb6c('0x41')]:_0x3e0db9[_0xcb6c('0x3d')];_0x2ebcf7[_0xcb6c('0x47')]=qs[_0xcb6c('0x48')](_0x522118['query'][_0xcb6c('0x48')]);_0x2ebcf7[_0xcb6c('0x49')]=qs[_0xcb6c('0x3f')](_[_0xcb6c('0x4a')](_0x522118['query'],_0x3e0db9[_0xcb6c('0x3f')]));if(_0x522118['query'][_0xcb6c('0x4b')]){_0x2ebcf7[_0xcb6c('0x49')]=_[_0xcb6c('0x4c')](_0x2ebcf7[_0xcb6c('0x49')],{'$or':_['map'](_0x2ebcf7[_0xcb6c('0x41')],function(_0x21ce46){var _0x22a4d8={};_0x22a4d8[_0x21ce46]={'$like':'%'+_0x522118[_0xcb6c('0x3e')]['filter']+'%'};return _0x22a4d8;})});}_0x2ebcf7=_[_0xcb6c('0x4c')]({},_0x2ebcf7,_0x522118[_0xcb6c('0x4e')]);return _0x20d532[_0xcb6c('0x5a')](_0x2ebcf7);}})[_0xcb6c('0x1e')](function(_0x435693){if(_0x435693){_0x367801=_0x435693['length'];if(!_0x522118[_0xcb6c('0x3e')]['hasOwnProperty']('nolimit')){_0x2ebcf7[_0xcb6c('0x46')]=qs[_0xcb6c('0x46')](_0x522118[_0xcb6c('0x3e')]['limit']);_0x2ebcf7[_0xcb6c('0x2d')]=qs[_0xcb6c('0x2d')](_0x522118[_0xcb6c('0x3e')]['offset']);}return _0x20d532[_0xcb6c('0x5a')](_0x2ebcf7);}})[_0xcb6c('0x1e')](function(_0x3232e2){if(_0x3232e2){return _0x3232e2?{'count':_0x367801,'rows':_0x3232e2}:null;}})[_0xcb6c('0x1e')](respondWithResult(_0x3b50f4,null))['catch'](handleError(_0x3b50f4,null));};exports['getDescriptions']=function(_0xec575e,_0x222216,_0x195ea1){var _0x915d03={};var _0x539dc4={};var _0x5e157a;var _0x31cea0;return db[_0xcb6c('0x3a')][_0xcb6c('0x5b')]({'where':{'id':_0xec575e[_0xcb6c('0x5c')]['id']}})[_0xcb6c('0x1e')](handleEntityNotFound(_0x222216,null))['then'](function(_0x32d44a){if(_0x32d44a){_0x5e157a=_0x32d44a;_0x539dc4[_0xcb6c('0x3d')]=_['keys'](db[_0xcb6c('0x5d')][_0xcb6c('0x59')]);_0x539dc4[_0xcb6c('0x3e')]=_[_0xcb6c('0x54')](_0xec575e[_0xcb6c('0x3e')]);_0x539dc4[_0xcb6c('0x3f')]=_[_0xcb6c('0x40')](_0x539dc4['model'],_0x539dc4[_0xcb6c('0x3e')]);_0x915d03[_0xcb6c('0x41')]=_[_0xcb6c('0x40')](_0x539dc4['model'],qs[_0xcb6c('0x42')](_0xec575e[_0xcb6c('0x3e')][_0xcb6c('0x42')]));_0x915d03[_0xcb6c('0x41')]=_0x915d03[_0xcb6c('0x41')]['length']?_0x915d03[_0xcb6c('0x41')]:_0x539dc4[_0xcb6c('0x3d')];_0x915d03[_0xcb6c('0x47')]=qs[_0xcb6c('0x48')](_0xec575e[_0xcb6c('0x3e')][_0xcb6c('0x48')]);_0x915d03['where']=qs[_0xcb6c('0x3f')](_[_0xcb6c('0x4a')](_0xec575e[_0xcb6c('0x3e')],_0x539dc4[_0xcb6c('0x3f')]));if(_0xec575e[_0xcb6c('0x3e')][_0xcb6c('0x4b')]){_0x915d03[_0xcb6c('0x49')]=_[_0xcb6c('0x4c')](_0x915d03[_0xcb6c('0x49')],{'$or':_['map'](_0x915d03[_0xcb6c('0x41')],function(_0x22113b){var _0x3715c1={};_0x3715c1[_0x22113b]={'$like':'%'+_0xec575e[_0xcb6c('0x3e')]['filter']+'%'};return _0x3715c1;})});}_0x915d03=_[_0xcb6c('0x4c')]({},_0x915d03,_0xec575e[_0xcb6c('0x4e')]);return _0x5e157a[_0xcb6c('0x5e')](_0x915d03);}})['then'](function(_0x3cf830){if(_0x3cf830){_0x31cea0=_0x3cf830[_0xcb6c('0x43')];if(!_0xec575e[_0xcb6c('0x3e')][_0xcb6c('0x44')](_0xcb6c('0x45'))){_0x915d03[_0xcb6c('0x46')]=qs[_0xcb6c('0x46')](_0xec575e[_0xcb6c('0x3e')][_0xcb6c('0x46')]);_0x915d03[_0xcb6c('0x2d')]=qs['offset'](_0xec575e[_0xcb6c('0x3e')][_0xcb6c('0x2d')]);}return _0x5e157a[_0xcb6c('0x5e')](_0x915d03);}})['then'](function(_0x317028){if(_0x317028){return _0x317028?{'count':_0x31cea0,'rows':_0x317028}:null;}})['then'](respondWithResult(_0x222216,null))[_0xcb6c('0x29')](handleError(_0x222216,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 871dbf9..211a445 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 _0xc5ab=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x454d24,_0x749d57){var _0x311b2c=function(_0x5b6392){while(--_0x5b6392){_0x454d24['push'](_0x454d24['shift']());}};_0x311b2c(++_0x749d57);}(_0xc5ab,0x10b));var _0xbc5a=function(_0x3b08c6,_0x39ad2d){_0x3b08c6=_0x3b08c6-0x0;var _0x370255=_0xc5ab[_0x3b08c6];return _0x370255;};'use strict';var _=require(_0xbc5a('0x0'));var util=require('util');var logger=require(_0xbc5a('0x1'))(_0xbc5a('0x2'));var moment=require(_0xbc5a('0x3'));var BPromise=require(_0xbc5a('0x4'));var rp=require(_0xbc5a('0x5'));var fs=require('fs');var path=require(_0xbc5a('0x6'));var rimraf=require(_0xbc5a('0x7'));var config=require(_0xbc5a('0x8'));var attributes=require(_0xbc5a('0x9'));module[_0xbc5a('0xa')]=function(_0x1ed0f4,_0x42af7d){return _0x1ed0f4[_0xbc5a('0xb')]('VtigerConfiguration',attributes,{'tableName':_0xbc5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1195=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','int_vtiger_configurations','util','api','moment','bluebird','request-promise'];(function(_0x26d86a,_0x4e2b45){var _0x2502a6=function(_0x3e9fec){while(--_0x3e9fec){_0x26d86a['push'](_0x26d86a['shift']());}};_0x2502a6(++_0x4e2b45);}(_0x1195,0x19d));var _0x5119=function(_0x45b625,_0x165113){_0x45b625=_0x45b625-0x0;var _0x2a1e5c=_0x1195[_0x45b625];return _0x2a1e5c;};'use strict';var _=require('lodash');var util=require(_0x5119('0x0'));var logger=require('../../config/logger')(_0x5119('0x1'));var moment=require(_0x5119('0x2'));var BPromise=require(_0x5119('0x3'));var rp=require(_0x5119('0x4'));var fs=require('fs');var path=require(_0x5119('0x5'));var rimraf=require(_0x5119('0x6'));var config=require(_0x5119('0x7'));var attributes=require(_0x5119('0x8'));module['exports']=function(_0x590c5e,_0x1d5d64){return _0x590c5e[_0x5119('0x9')]('VtigerConfiguration',attributes,{'tableName':_0x5119('0xa'),'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 cb1f862..fb3eb8d 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 _0x9e4a=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x6759ae,_0x112151){var _0x8c2682=function(_0x35d695){while(--_0x35d695){_0x6759ae['push'](_0x6759ae['shift']());}};_0x8c2682(++_0x112151);}(_0x9e4a,0x9b));var _0xa9e4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9e4a[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xa9e4('0x0'));var util=require(_0xa9e4('0x1'));var moment=require('moment');var BPromise=require(_0xa9e4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9e4('0x3'));var db=require(_0xa9e4('0x4'))['db'];var utils=require(_0xa9e4('0x5'));var logger=require(_0xa9e4('0x6'))(_0xa9e4('0x7'));var config=require(_0xa9e4('0x8'));var jayson=require(_0xa9e4('0x9'));var client=jayson[_0xa9e4('0xa')][_0xa9e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cde0b,_0x48d885,_0x22ccb6){return new BPromise(function(_0x2311ca,_0x2f29b6){return client['request'](_0x1cde0b,_0x22ccb6)[_0xa9e4('0xc')](function(_0x52a837){logger['info'](_0xa9e4('0xd'),_0x48d885,_0xa9e4('0xe'));logger[_0xa9e4('0xf')](_0xa9e4('0x10'),_0x48d885,'request\x20sent',JSON[_0xa9e4('0x11')](_0x52a837));if(_0x52a837[_0xa9e4('0x12')]){if(_0x52a837[_0xa9e4('0x12')][_0xa9e4('0x13')]===0x1f4){logger[_0xa9e4('0x12')](_0xa9e4('0xd'),_0x48d885,_0x52a837[_0xa9e4('0x12')][_0xa9e4('0x14')]);return _0x2f29b6(_0x52a837[_0xa9e4('0x12')][_0xa9e4('0x14')]);}logger[_0xa9e4('0x12')](_0xa9e4('0xd'),_0x48d885,_0x52a837['error'][_0xa9e4('0x14')]);return _0x2311ca(_0x52a837[_0xa9e4('0x12')][_0xa9e4('0x14')]);}else{logger[_0xa9e4('0x15')]('VtigerConfiguration,\x20%s,\x20%s',_0x48d885,_0xa9e4('0xe'));_0x2311ca(_0x52a837[_0xa9e4('0x16')][_0xa9e4('0x14')]);}})[_0xa9e4('0x17')](function(_0x1bed0e){logger[_0xa9e4('0x12')](_0xa9e4('0xd'),_0x48d885,_0x1bed0e);_0x2f29b6(_0x1bed0e);});});} \ No newline at end of file +var _0x1077=['moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1bf6ca,_0x2a054b){var _0x4c47ff=function(_0x41d24f){while(--_0x41d24f){_0x1bf6ca['push'](_0x1bf6ca['shift']());}};_0x4c47ff(++_0x2a054b);}(_0x1077,0x8b));var _0x7107=function(_0x454e4e,_0x52db86){_0x454e4e=_0x454e4e-0x0;var _0x5e7f00=_0x1077[_0x454e4e];return _0x5e7f00;};'use strict';var _=require(_0x7107('0x0'));var util=require('util');var moment=require(_0x7107('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7107('0x2'));var db=require(_0x7107('0x3'))['db'];var utils=require(_0x7107('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7107('0x5'));var jayson=require(_0x7107('0x6'));var client=jayson[_0x7107('0x7')][_0x7107('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c195c,_0x2fe469,_0xa537a9){return new BPromise(function(_0x885bf8,_0x5a9718){return client['request'](_0x4c195c,_0xa537a9)[_0x7107('0x9')](function(_0x104e6f){logger[_0x7107('0xa')](_0x7107('0xb'),_0x2fe469,_0x7107('0xc'));logger['debug'](_0x7107('0xd'),_0x2fe469,_0x7107('0xc'),JSON[_0x7107('0xe')](_0x104e6f));if(_0x104e6f['error']){if(_0x104e6f[_0x7107('0xf')][_0x7107('0x10')]===0x1f4){logger[_0x7107('0xf')](_0x7107('0xb'),_0x2fe469,_0x104e6f['error']['message']);return _0x5a9718(_0x104e6f[_0x7107('0xf')]['message']);}logger[_0x7107('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x2fe469,_0x104e6f['error']['message']);return _0x885bf8(_0x104e6f[_0x7107('0xf')][_0x7107('0x11')]);}else{logger[_0x7107('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x2fe469,_0x7107('0xc'));_0x885bf8(_0x104e6f[_0x7107('0x12')][_0x7107('0x11')]);}})[_0x7107('0x13')](function(_0x26a576){logger[_0x7107('0xf')](_0x7107('0xb'),_0x2fe469,_0x26a576);_0x5a9718(_0x26a576);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 0b97f41..2b2ad82 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 _0x1d48=['update','delete','destroy','util','path','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','get','/:id','show','post','create'];(function(_0x3487be,_0x5a5756){var _0x3d9f10=function(_0x194f16){while(--_0x194f16){_0x3487be['push'](_0x3487be['shift']());}};_0x3d9f10(++_0x5a5756);}(_0x1d48,0x6c));var _0x81d4=function(_0x154bc1,_0xca4a8e){_0x154bc1=_0x154bc1-0x0;var _0x11e0f9=_0x1d48[_0x154bc1];return _0x11e0f9;};'use strict';var multer=require('multer');var util=require(_0x81d4('0x0'));var path=require(_0x81d4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x81d4('0x2')]();var auth=require(_0x81d4('0x3'));var interaction=require(_0x81d4('0x4'));var config=require('../../config/environment');var controller=require(_0x81d4('0x5'));router['get']('/',auth[_0x81d4('0x6')](),controller['index']);router[_0x81d4('0x7')](_0x81d4('0x8'),auth[_0x81d4('0x6')](),controller[_0x81d4('0x9')]);router[_0x81d4('0xa')]('/',auth['isAuthenticated'](),controller[_0x81d4('0xb')]);router['put'](_0x81d4('0x8'),auth[_0x81d4('0x6')](),controller[_0x81d4('0xc')]);router[_0x81d4('0xd')](_0x81d4('0x8'),auth[_0x81d4('0x6')](),controller[_0x81d4('0xe')]);module['exports']=router; \ No newline at end of file +var _0x88c2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','isAuthenticated','show','post','create','put','update','/:id','destroy','multer','util','express','Router'];(function(_0x2a9ca1,_0xef84a3){var _0x1db314=function(_0x43405a){while(--_0x43405a){_0x2a9ca1['push'](_0x2a9ca1['shift']());}};_0x1db314(++_0xef84a3);}(_0x88c2,0x8c));var _0x288c=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x88c2[_0x12a2a6];return _0x1754ae;};'use strict';var multer=require(_0x288c('0x0'));var util=require(_0x288c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x288c('0x2'));var router=express[_0x288c('0x3')]();var auth=require(_0x288c('0x4'));var interaction=require(_0x288c('0x5'));var config=require(_0x288c('0x6'));var controller=require(_0x288c('0x7'));router[_0x288c('0x8')]('/',auth['isAuthenticated'](),controller[_0x288c('0x9')]);router['get']('/:id',auth[_0x288c('0xa')](),controller[_0x288c('0xb')]);router[_0x288c('0xc')]('/',auth[_0x288c('0xa')](),controller[_0x288c('0xd')]);router[_0x288c('0xe')]('/:id',auth[_0x288c('0xa')](),controller[_0x288c('0xf')]);router['delete'](_0x288c('0x10'),auth[_0x288c('0xa')](),controller[_0x288c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 15c7a9c..2768d7c 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 _0x3308=['BOOLEAN','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x4c6e4a,_0x263ab8){var _0x3d69f4=function(_0x356a11){while(--_0x356a11){_0x4c6e4a['push'](_0x4c6e4a['shift']());}};_0x3d69f4(++_0x263ab8);}(_0x3308,0x12e));var _0x8330=function(_0x3e80f7,_0x18b72d){_0x3e80f7=_0x3e80f7-0x0;var _0x36ed6b=_0x3308[_0x3e80f7];return _0x36ed6b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x8330('0x0'),_0x8330('0x1'),_0x8330('0x2'),_0x8330('0x3')),'defaultValue':_0x8330('0x0')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8330('0x4')]},'keyType':{'type':Sequelize[_0x8330('0x5')](_0x8330('0x0'),_0x8330('0x1'),_0x8330('0x2'))},'keyContent':{'type':Sequelize[_0x8330('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8330('0x4')]},'customField':{'type':Sequelize[_0x8330('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8330('0x4')]}}; \ No newline at end of file +var _0xdace=['STRING','ENUM','variable','customVariable','exports','keyValue','string'];(function(_0x1d0499,_0x23e22f){var _0x153fb3=function(_0x40c19c){while(--_0x40c19c){_0x1d0499['push'](_0x1d0499['shift']());}};_0x153fb3(++_0x23e22f);}(_0xdace,0xc1));var _0xedac=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xdace[_0x34843e];return _0x598f7f;};'use strict';var Sequelize=require('sequelize');module[_0xedac('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0xedac('0x1')),'defaultValue':_0xedac('0x2')},'content':{'type':Sequelize[_0xedac('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xedac('0x4')](_0xedac('0x2'),_0xedac('0x5'),_0xedac('0x6'))},'keyContent':{'type':Sequelize[_0xedac('0x3')]},'idField':{'type':Sequelize[_0xedac('0x3')]},'nameField':{'type':Sequelize[_0xedac('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xedac('0x3')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 3601ca2..f8bfcce 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 _0x9e40=['catch','params','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows'];(function(_0x44b73a,_0xc1c163){var _0x478725=function(_0x2d06a2){while(--_0x2d06a2){_0x44b73a['push'](_0x44b73a['shift']());}};_0x478725(++_0xc1c163);}(_0x9e40,0xe9));var _0x09e4=function(_0xbfcf07,_0x3dd6f0){_0xbfcf07=_0xbfcf07-0x0;var _0x2a7548=_0x9e40[_0xbfcf07];return _0x2a7548;};'use strict';var pdf=require(_0x09e4('0x0'));var emlformat=require(_0x09e4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x09e4('0x2'));var jsonpatch=require(_0x09e4('0x3'));var rp=require(_0x09e4('0x4'));var moment=require('moment');var BPromise=require(_0x09e4('0x5'));var Mustache=require(_0x09e4('0x6'));var util=require(_0x09e4('0x7'));var path=require(_0x09e4('0x8'));var sox=require(_0x09e4('0x9'));var csv=require('to-csv');var ejs=require(_0x09e4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x09e4('0xb'));var crypto=require(_0x09e4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x09e4('0xd'));var toCsv=require(_0x09e4('0xe'));var querystring=require('querystring');var Papa=require(_0x09e4('0xf'));var Redis=require(_0x09e4('0x10'));var authService=require(_0x09e4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x09e4('0x12'));var hardwareService=require(_0x09e4('0x13'));var logger=require(_0x09e4('0x14'))('api');var utils=require(_0x09e4('0x15'));var config=require(_0x09e4('0x16'));var db=require(_0x09e4('0x17'))['db'];function respondWithStatusCode(_0x2fe35a,_0x2fd983){_0x2fd983=_0x2fd983||0xcc;return function(_0x15196b){if(_0x15196b){return _0x2fe35a['sendStatus'](_0x2fd983);}return _0x2fe35a[_0x09e4('0x18')](_0x2fd983)[_0x09e4('0x19')]();};}function respondWithResult(_0x2a736e,_0x2ef4af){_0x2ef4af=_0x2ef4af||0xc8;return function(_0x4511af){if(_0x4511af){return _0x2a736e['status'](_0x2ef4af)['json'](_0x4511af);}};}function respondWithFilteredResult(_0x2db325,_0x3f066e){return function(_0x14c233){if(_0x14c233){var _0x21079e=_0x14c233[_0x09e4('0x1a')],_0x4c5805=_0x3f066e[_0x09e4('0x1b')],_0x2b668b=_0x3f066e[_0x09e4('0x1b')]+_0x3f066e[_0x09e4('0x1c')],_0x396064;if(_0x2b668b>=_0x21079e){_0x2b668b=_0x21079e;_0x396064=0xc8;}else{_0x396064=0xce;}_0x2db325['status'](_0x396064);return _0x2db325[_0x09e4('0x1d')](_0x09e4('0x1e'),_0x4c5805+'-'+_0x2b668b+'/'+_0x21079e)[_0x09e4('0x1f')](_0x14c233);}return null;};}function patchUpdates(_0x5e8ef5){return function(_0x589267){try{jsonpatch[_0x09e4('0x20')](_0x589267,_0x5e8ef5,!![]);}catch(_0x5778a7){return BPromise[_0x09e4('0x21')](_0x5778a7);}return _0x589267[_0x09e4('0x22')]();};}function saveUpdates(_0x376d30,_0x10e2c4){return function(_0x5b65e6){if(_0x5b65e6){return _0x5b65e6[_0x09e4('0x23')](_0x376d30)[_0x09e4('0x24')](function(_0x56a419){return _0x56a419;});}return null;};}function removeEntity(_0x4bd923,_0x303dd8){return function(_0x5309ba){if(_0x5309ba){return _0x5309ba[_0x09e4('0x25')]()[_0x09e4('0x24')](function(){_0x4bd923['status'](0xcc)[_0x09e4('0x19')]();});}};}function handleEntityNotFound(_0x10cb5f,_0x3cc1f8){return function(_0x2075f7){if(!_0x2075f7){_0x10cb5f[_0x09e4('0x26')](0x194);}return _0x2075f7;};}function handleError(_0x4e534a,_0x2c6a91){_0x2c6a91=_0x2c6a91||0x1f4;return function(_0xf0cf5f){logger[_0x09e4('0x27')](_0xf0cf5f[_0x09e4('0x28')]);if(_0xf0cf5f['name']){delete _0xf0cf5f[_0x09e4('0x29')];}_0x4e534a[_0x09e4('0x18')](_0x2c6a91)[_0x09e4('0x2a')](_0xf0cf5f);};}exports[_0x09e4('0x2b')]=function(_0x5ae418,_0x231c43){var _0x362b5c={},_0x2e2594={},_0x5d7caf={'count':0x0,'rows':[]};var _0xe805f2=_['map'](db[_0x09e4('0x2c')][_0x09e4('0x2d')],function(_0x379097){return{'name':_0x379097[_0x09e4('0x2e')],'type':_0x379097[_0x09e4('0x2f')][_0x09e4('0x30')]};});_0x2e2594['model']=_[_0x09e4('0x31')](_0xe805f2,'name');_0x2e2594[_0x09e4('0x32')]=_[_0x09e4('0x33')](_0x5ae418['query']);_0x2e2594[_0x09e4('0x34')]=_[_0x09e4('0x35')](_0x2e2594['model'],_0x2e2594[_0x09e4('0x32')]);_0x362b5c['attributes']=_['intersection'](_0x2e2594['model'],qs[_0x09e4('0x36')](_0x5ae418[_0x09e4('0x32')][_0x09e4('0x36')]));_0x362b5c[_0x09e4('0x37')]=_0x362b5c[_0x09e4('0x37')][_0x09e4('0x38')]?_0x362b5c[_0x09e4('0x37')]:_0x2e2594[_0x09e4('0x39')];if(!_0x5ae418[_0x09e4('0x32')][_0x09e4('0x3a')](_0x09e4('0x3b'))){_0x362b5c[_0x09e4('0x1c')]=qs[_0x09e4('0x1c')](_0x5ae418[_0x09e4('0x32')][_0x09e4('0x1c')]);_0x362b5c[_0x09e4('0x1b')]=qs[_0x09e4('0x1b')](_0x5ae418[_0x09e4('0x32')]['offset']);}_0x362b5c[_0x09e4('0x3c')]=qs[_0x09e4('0x3d')](_0x5ae418[_0x09e4('0x32')][_0x09e4('0x3d')]);_0x362b5c[_0x09e4('0x3e')]=qs[_0x09e4('0x34')](_['pick'](_0x5ae418[_0x09e4('0x32')],_0x2e2594[_0x09e4('0x34')]));if(_0x5ae418[_0x09e4('0x32')][_0x09e4('0x3f')]){_0x362b5c[_0x09e4('0x3e')]=_['merge'](_0x362b5c[_0x09e4('0x3e')],{'$or':_[_0x09e4('0x31')](_0xe805f2,function(_0x2e3b44){if(_0x2e3b44[_0x09e4('0x2f')]!==_0x09e4('0x40')){var _0x36f4ed={};_0x36f4ed[_0x2e3b44[_0x09e4('0x29')]]={'$like':'%'+_0x5ae418['query'][_0x09e4('0x3f')]+'%'};return _0x36f4ed;}})});}_0x362b5c=_[_0x09e4('0x41')]({},_0x362b5c,_0x5ae418[_0x09e4('0x42')]);var _0x5e4c8d={'where':_0x362b5c[_0x09e4('0x3e')]};return db['VtigerField']['count'](_0x5e4c8d)['then'](function(_0x501d19){_0x5d7caf['count']=_0x501d19;if(_0x5ae418['query'][_0x09e4('0x43')]){_0x362b5c[_0x09e4('0x44')]=[{'all':!![]}];}return db['VtigerField'][_0x09e4('0x45')](_0x362b5c);})['then'](function(_0x2d0c50){_0x5d7caf[_0x09e4('0x46')]=_0x2d0c50;return _0x5d7caf;})[_0x09e4('0x24')](respondWithFilteredResult(_0x231c43,_0x362b5c))[_0x09e4('0x47')](handleError(_0x231c43,null));};exports['show']=function(_0x5357d9,_0x44b848){var _0x5d6b7e={'raw':!![],'where':{'id':_0x5357d9[_0x09e4('0x48')]['id']}},_0x4eafa1={};_0x4eafa1[_0x09e4('0x39')]=_[_0x09e4('0x33')](db[_0x09e4('0x2c')][_0x09e4('0x2d')]);_0x4eafa1['query']=_[_0x09e4('0x33')](_0x5357d9['query']);_0x4eafa1[_0x09e4('0x34')]=_[_0x09e4('0x35')](_0x4eafa1['model'],_0x4eafa1['query']);_0x5d6b7e['attributes']=_[_0x09e4('0x35')](_0x4eafa1[_0x09e4('0x39')],qs[_0x09e4('0x36')](_0x5357d9[_0x09e4('0x32')]['fields']));_0x5d6b7e[_0x09e4('0x37')]=_0x5d6b7e[_0x09e4('0x37')]['length']?_0x5d6b7e['attributes']:_0x4eafa1['model'];if(_0x5357d9[_0x09e4('0x32')]['includeAll']){_0x5d6b7e[_0x09e4('0x44')]=[{'all':!![]}];}_0x5d6b7e=_[_0x09e4('0x41')]({},_0x5d6b7e,_0x5357d9['options']);return db['VtigerField']['find'](_0x5d6b7e)['then'](handleEntityNotFound(_0x44b848,null))[_0x09e4('0x24')](respondWithResult(_0x44b848,null))[_0x09e4('0x47')](handleError(_0x44b848,null));};exports[_0x09e4('0x49')]=function(_0x17315f,_0x1328fc){return db[_0x09e4('0x2c')]['create'](_0x17315f['body'],{})[_0x09e4('0x24')](respondWithResult(_0x1328fc,0xc9))[_0x09e4('0x47')](handleError(_0x1328fc,null));};exports[_0x09e4('0x23')]=function(_0x143f0c,_0x1673b5){if(_0x143f0c['body']['id']){delete _0x143f0c[_0x09e4('0x4a')]['id'];}return db[_0x09e4('0x2c')][_0x09e4('0x4b')]({'where':{'id':_0x143f0c['params']['id']}})[_0x09e4('0x24')](handleEntityNotFound(_0x1673b5,null))[_0x09e4('0x24')](saveUpdates(_0x143f0c['body'],null))[_0x09e4('0x24')](respondWithResult(_0x1673b5,null))[_0x09e4('0x47')](handleError(_0x1673b5,null));};exports[_0x09e4('0x25')]=function(_0x4c85ea,_0x5ea045){return db[_0x09e4('0x2c')][_0x09e4('0x4b')]({'where':{'id':_0x4c85ea['params']['id']}})[_0x09e4('0x24')](handleEntityNotFound(_0x5ea045,null))['then'](removeEntity(_0x5ea045,null))[_0x09e4('0x47')](handleError(_0x5ea045,null));}; \ No newline at end of file +var _0xa469=['intersection','find','create','body','update','destroy','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','limit','set','Content-Range','apply','reject','then','end','error','send','index','VtigerField','rawAttributes','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x373bee,_0x5e703d){var _0x5f1055=function(_0x8f1605){while(--_0x8f1605){_0x373bee['push'](_0x373bee['shift']());}};_0x5f1055(++_0x5e703d);}(_0xa469,0xe1));var _0x9a46=function(_0x3de573,_0x39b43d){_0x3de573=_0x3de573-0x0;var _0x221530=_0xa469[_0x3de573];return _0x221530;};'use strict';var pdf=require(_0x9a46('0x0'));var emlformat=require(_0x9a46('0x1'));var rimraf=require(_0x9a46('0x2'));var zipdir=require(_0x9a46('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9a46('0x4'));var BPromise=require(_0x9a46('0x5'));var Mustache=require(_0x9a46('0x6'));var util=require(_0x9a46('0x7'));var path=require('path');var sox=require(_0x9a46('0x8'));var csv=require(_0x9a46('0x9'));var ejs=require(_0x9a46('0xa'));var fs=require('fs');var _=require(_0x9a46('0xb'));var squel=require(_0x9a46('0xc'));var crypto=require(_0x9a46('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9a46('0xe'));var toCsv=require(_0x9a46('0x9'));var querystring=require(_0x9a46('0xf'));var Papa=require(_0x9a46('0x10'));var Redis=require(_0x9a46('0x11'));var authService=require(_0x9a46('0x12'));var qs=require(_0x9a46('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a46('0x14'));var logger=require(_0x9a46('0x15'))('api');var utils=require(_0x9a46('0x16'));var config=require(_0x9a46('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2088ef,_0x23308c){_0x23308c=_0x23308c||0xcc;return function(_0x3c1240){if(_0x3c1240){return _0x2088ef[_0x9a46('0x18')](_0x23308c);}return _0x2088ef[_0x9a46('0x19')](_0x23308c)['end']();};}function respondWithResult(_0x5c2eff,_0x2646d8){_0x2646d8=_0x2646d8||0xc8;return function(_0x52553c){if(_0x52553c){return _0x5c2eff['status'](_0x2646d8)[_0x9a46('0x1a')](_0x52553c);}};}function respondWithFilteredResult(_0x1a2404,_0x38af42){return function(_0x2384e8){if(_0x2384e8){var _0x30db33=_0x2384e8['count'],_0x5afa81=_0x38af42['offset'],_0x29c7fe=_0x38af42['offset']+_0x38af42[_0x9a46('0x1b')],_0x189210;if(_0x29c7fe>=_0x30db33){_0x29c7fe=_0x30db33;_0x189210=0xc8;}else{_0x189210=0xce;}_0x1a2404[_0x9a46('0x19')](_0x189210);return _0x1a2404[_0x9a46('0x1c')](_0x9a46('0x1d'),_0x5afa81+'-'+_0x29c7fe+'/'+_0x30db33)[_0x9a46('0x1a')](_0x2384e8);}return null;};}function patchUpdates(_0x42eb56){return function(_0x17f2fd){try{jsonpatch[_0x9a46('0x1e')](_0x17f2fd,_0x42eb56,!![]);}catch(_0x263a30){return BPromise[_0x9a46('0x1f')](_0x263a30);}return _0x17f2fd['save']();};}function saveUpdates(_0x528f35,_0x8e5a61){return function(_0x3a1860){if(_0x3a1860){return _0x3a1860['update'](_0x528f35)['then'](function(_0x4c13ae){return _0x4c13ae;});}return null;};}function removeEntity(_0x5d7b19,_0x1f6005){return function(_0x18360d){if(_0x18360d){return _0x18360d['destroy']()[_0x9a46('0x20')](function(){_0x5d7b19[_0x9a46('0x19')](0xcc)[_0x9a46('0x21')]();});}};}function handleEntityNotFound(_0x4de880,_0x539ecf){return function(_0x2927ff){if(!_0x2927ff){_0x4de880['sendStatus'](0x194);}return _0x2927ff;};}function handleError(_0x56e956,_0x3042e8){_0x3042e8=_0x3042e8||0x1f4;return function(_0x2648fc){logger[_0x9a46('0x22')](_0x2648fc['stack']);if(_0x2648fc['name']){delete _0x2648fc['name'];}_0x56e956[_0x9a46('0x19')](_0x3042e8)[_0x9a46('0x23')](_0x2648fc);};}exports[_0x9a46('0x24')]=function(_0x30e020,_0x33a1a8){var _0x3e8c27={},_0x330276={},_0x40a8a6={'count':0x0,'rows':[]};var _0x540df1=_['map'](db[_0x9a46('0x25')][_0x9a46('0x26')],function(_0x4a549b){return{'name':_0x4a549b['fieldName'],'type':_0x4a549b[_0x9a46('0x27')][_0x9a46('0x28')]};});_0x330276[_0x9a46('0x29')]=_[_0x9a46('0x2a')](_0x540df1,'name');_0x330276[_0x9a46('0x2b')]=_['keys'](_0x30e020['query']);_0x330276[_0x9a46('0x2c')]=_['intersection'](_0x330276['model'],_0x330276['query']);_0x3e8c27[_0x9a46('0x2d')]=_['intersection'](_0x330276[_0x9a46('0x29')],qs['fields'](_0x30e020['query'][_0x9a46('0x2e')]));_0x3e8c27[_0x9a46('0x2d')]=_0x3e8c27['attributes'][_0x9a46('0x2f')]?_0x3e8c27['attributes']:_0x330276[_0x9a46('0x29')];if(!_0x30e020[_0x9a46('0x2b')][_0x9a46('0x30')](_0x9a46('0x31'))){_0x3e8c27['limit']=qs[_0x9a46('0x1b')](_0x30e020['query'][_0x9a46('0x1b')]);_0x3e8c27[_0x9a46('0x32')]=qs['offset'](_0x30e020[_0x9a46('0x2b')][_0x9a46('0x32')]);}_0x3e8c27[_0x9a46('0x33')]=qs[_0x9a46('0x34')](_0x30e020[_0x9a46('0x2b')][_0x9a46('0x34')]);_0x3e8c27[_0x9a46('0x35')]=qs['filters'](_['pick'](_0x30e020['query'],_0x330276[_0x9a46('0x2c')]));if(_0x30e020['query'][_0x9a46('0x36')]){_0x3e8c27[_0x9a46('0x35')]=_[_0x9a46('0x37')](_0x3e8c27[_0x9a46('0x35')],{'$or':_['map'](_0x540df1,function(_0x309d16){if(_0x309d16[_0x9a46('0x27')]!==_0x9a46('0x38')){var _0x281e9a={};_0x281e9a[_0x309d16['name']]={'$like':'%'+_0x30e020['query']['filter']+'%'};return _0x281e9a;}})});}_0x3e8c27=_[_0x9a46('0x37')]({},_0x3e8c27,_0x30e020[_0x9a46('0x39')]);var _0x5bcf55={'where':_0x3e8c27['where']};return db[_0x9a46('0x25')][_0x9a46('0x3a')](_0x5bcf55)[_0x9a46('0x20')](function(_0x40149c){_0x40a8a6[_0x9a46('0x3a')]=_0x40149c;if(_0x30e020[_0x9a46('0x2b')][_0x9a46('0x3b')]){_0x3e8c27[_0x9a46('0x3c')]=[{'all':!![]}];}return db['VtigerField'][_0x9a46('0x3d')](_0x3e8c27);})[_0x9a46('0x20')](function(_0x3b9323){_0x40a8a6[_0x9a46('0x3e')]=_0x3b9323;return _0x40a8a6;})['then'](respondWithFilteredResult(_0x33a1a8,_0x3e8c27))[_0x9a46('0x3f')](handleError(_0x33a1a8,null));};exports[_0x9a46('0x40')]=function(_0x3923ed,_0xb2ec05){var _0x58043a={'raw':!![],'where':{'id':_0x3923ed[_0x9a46('0x41')]['id']}},_0x59e392={};_0x59e392['model']=_['keys'](db[_0x9a46('0x25')][_0x9a46('0x26')]);_0x59e392[_0x9a46('0x2b')]=_[_0x9a46('0x42')](_0x3923ed[_0x9a46('0x2b')]);_0x59e392[_0x9a46('0x2c')]=_[_0x9a46('0x43')](_0x59e392[_0x9a46('0x29')],_0x59e392[_0x9a46('0x2b')]);_0x58043a[_0x9a46('0x2d')]=_['intersection'](_0x59e392[_0x9a46('0x29')],qs[_0x9a46('0x2e')](_0x3923ed[_0x9a46('0x2b')][_0x9a46('0x2e')]));_0x58043a[_0x9a46('0x2d')]=_0x58043a[_0x9a46('0x2d')]['length']?_0x58043a[_0x9a46('0x2d')]:_0x59e392[_0x9a46('0x29')];if(_0x3923ed[_0x9a46('0x2b')][_0x9a46('0x3b')]){_0x58043a[_0x9a46('0x3c')]=[{'all':!![]}];}_0x58043a=_['merge']({},_0x58043a,_0x3923ed[_0x9a46('0x39')]);return db[_0x9a46('0x25')][_0x9a46('0x44')](_0x58043a)[_0x9a46('0x20')](handleEntityNotFound(_0xb2ec05,null))['then'](respondWithResult(_0xb2ec05,null))[_0x9a46('0x3f')](handleError(_0xb2ec05,null));};exports[_0x9a46('0x45')]=function(_0x153bd2,_0xe90605){return db[_0x9a46('0x25')][_0x9a46('0x45')](_0x153bd2[_0x9a46('0x46')],{})['then'](respondWithResult(_0xe90605,0xc9))[_0x9a46('0x3f')](handleError(_0xe90605,null));};exports[_0x9a46('0x47')]=function(_0x201fae,_0x2639f6){if(_0x201fae[_0x9a46('0x46')]['id']){delete _0x201fae[_0x9a46('0x46')]['id'];}return db[_0x9a46('0x25')][_0x9a46('0x44')]({'where':{'id':_0x201fae[_0x9a46('0x41')]['id']}})[_0x9a46('0x20')](handleEntityNotFound(_0x2639f6,null))[_0x9a46('0x20')](saveUpdates(_0x201fae[_0x9a46('0x46')],null))[_0x9a46('0x20')](respondWithResult(_0x2639f6,null))[_0x9a46('0x3f')](handleError(_0x2639f6,null));};exports[_0x9a46('0x48')]=function(_0x340c97,_0x41d547){return db['VtigerField'][_0x9a46('0x44')]({'where':{'id':_0x340c97[_0x9a46('0x41')]['id']}})[_0x9a46('0x20')](handleEntityNotFound(_0x41d547,null))['then'](removeEntity(_0x41d547,null))[_0x9a46('0x3f')](handleError(_0x41d547,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index ca5246e..4c76d4f 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x3694dc,_0x5863b0){var _0x1a13d4=function(_0xe56d0a){while(--_0xe56d0a){_0x3694dc['push'](_0x3694dc['shift']());}};_0x1a13d4(++_0x5863b0);}(_0x7a54,0x106));var _0x47a5=function(_0x4a9a95,_0x1dcafc){_0x4a9a95=_0x4a9a95-0x0;var _0x1ae816=_0x7a54[_0x4a9a95];return _0x1ae816;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index d617b3b..95c1dcf 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 _0x6629=['info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x5977f9,_0x1234cf){var _0x39b927=function(_0x2b18bd){while(--_0x2b18bd){_0x5977f9['push'](_0x5977f9['shift']());}};_0x39b927(++_0x1234cf);}(_0x6629,0x1c2));var _0x9662=function(_0x3e4fdb,_0x449224){_0x3e4fdb=_0x3e4fdb-0x0;var _0x1f6b9f=_0x6629[_0x3e4fdb];return _0x1f6b9f;};'use strict';var _=require(_0x9662('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9662('0x1'));var rs=require(_0x9662('0x2'));var fs=require('fs');var Redis=require(_0x9662('0x3'));var db=require(_0x9662('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9662('0x5'))(_0x9662('0x6'));var config=require(_0x9662('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9662('0x8')][_0x9662('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x457681,_0x5ec533,_0x1a1809){return new BPromise(function(_0x58e45a,_0xa866f2){return client[_0x9662('0xa')](_0x457681,_0x1a1809)[_0x9662('0xb')](function(_0x11ae91){logger[_0x9662('0xc')](_0x9662('0xd'),_0x5ec533,_0x9662('0xe'));logger[_0x9662('0xf')](_0x9662('0x10'),_0x5ec533,_0x9662('0xe'),JSON[_0x9662('0x11')](_0x11ae91));if(_0x11ae91['error']){if(_0x11ae91[_0x9662('0x12')]['code']===0x1f4){logger[_0x9662('0x12')](_0x9662('0xd'),_0x5ec533,_0x11ae91['error'][_0x9662('0x13')]);return _0xa866f2(_0x11ae91[_0x9662('0x12')][_0x9662('0x13')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x5ec533,_0x11ae91[_0x9662('0x12')]['message']);return _0x58e45a(_0x11ae91[_0x9662('0x12')][_0x9662('0x13')]);}else{logger[_0x9662('0xc')]('VtigerField,\x20%s,\x20%s',_0x5ec533,'request\x20sent');_0x58e45a(_0x11ae91['result'][_0x9662('0x13')]);}})[_0x9662('0x14')](function(_0x4930c5){logger[_0x9662('0x12')](_0x9662('0xd'),_0x5ec533,_0x4930c5);_0xa866f2(_0x4930c5);});});} \ No newline at end of file +var _0xb5fa=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x46b94a,_0x393f55){var _0x34369b=function(_0x4b660c){while(--_0x4b660c){_0x46b94a['push'](_0x46b94a['shift']());}};_0x34369b(++_0x393f55);}(_0xb5fa,0xf8));var _0xab5f=function(_0x2628c0,_0x491156){_0x2628c0=_0x2628c0-0x0;var _0x4fcbed=_0xb5fa[_0x2628c0];return _0x4fcbed;};'use strict';var _=require(_0xab5f('0x0'));var util=require(_0xab5f('0x1'));var moment=require(_0xab5f('0x2'));var BPromise=require(_0xab5f('0x3'));var rs=require(_0xab5f('0x4'));var fs=require('fs');var Redis=require(_0xab5f('0x5'));var db=require(_0xab5f('0x6'))['db'];var utils=require(_0xab5f('0x7'));var logger=require(_0xab5f('0x8'))(_0xab5f('0x9'));var config=require(_0xab5f('0xa'));var jayson=require(_0xab5f('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x489cd2,_0x1e5941,_0x401d4e){return new BPromise(function(_0x530a4a,_0x298d75){return client[_0xab5f('0xc')](_0x489cd2,_0x401d4e)[_0xab5f('0xd')](function(_0x177190){logger[_0xab5f('0xe')]('VtigerField,\x20%s,\x20%s',_0x1e5941,_0xab5f('0xf'));logger['debug'](_0xab5f('0x10'),_0x1e5941,'request\x20sent',JSON[_0xab5f('0x11')](_0x177190));if(_0x177190[_0xab5f('0x12')]){if(_0x177190['error']['code']===0x1f4){logger['error'](_0xab5f('0x13'),_0x1e5941,_0x177190[_0xab5f('0x12')]['message']);return _0x298d75(_0x177190[_0xab5f('0x12')][_0xab5f('0x14')]);}logger[_0xab5f('0x12')](_0xab5f('0x13'),_0x1e5941,_0x177190[_0xab5f('0x12')][_0xab5f('0x14')]);return _0x530a4a(_0x177190[_0xab5f('0x12')][_0xab5f('0x14')]);}else{logger[_0xab5f('0xe')](_0xab5f('0x13'),_0x1e5941,_0xab5f('0xf'));_0x530a4a(_0x177190[_0xab5f('0x15')][_0xab5f('0x14')]);}})[_0xab5f('0x16')](function(_0x3d5485){logger[_0xab5f('0x12')](_0xab5f('0x13'),_0x1e5941,_0x3d5485);_0x298d75(_0x3d5485);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 07a9388..9c7be7e 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 _0xb9e8=['delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0xb9e8,0x12f));var _0x8b9e=function(_0x4ac5c1,_0x12f4bc){_0x4ac5c1=_0x4ac5c1-0x0;var _0x17c632=_0xb9e8[_0x4ac5c1];return _0x17c632;};'use strict';var multer=require('multer');var util=require(_0x8b9e('0x0'));var path=require('path');var timeout=require(_0x8b9e('0x1'));var express=require('express');var router=express[_0x8b9e('0x2')]();var auth=require(_0x8b9e('0x3'));var interaction=require(_0x8b9e('0x4'));var config=require(_0x8b9e('0x5'));var controller=require('./intZendeskAccount.controller');router[_0x8b9e('0x6')]('/',auth[_0x8b9e('0x7')](),controller['index']);router[_0x8b9e('0x6')]('/:id',auth[_0x8b9e('0x7')](),controller[_0x8b9e('0x8')]);router[_0x8b9e('0x6')](_0x8b9e('0x9'),auth['isAuthenticated'](),controller[_0x8b9e('0xa')]);router['get']('/:id/fields',auth[_0x8b9e('0x7')](),controller[_0x8b9e('0xb')]);router[_0x8b9e('0xc')]('/',auth['isAuthenticated'](),controller[_0x8b9e('0xd')]);router['post']('/:id/configurations',auth[_0x8b9e('0x7')](),controller[_0x8b9e('0xe')]);router[_0x8b9e('0xf')](_0x8b9e('0x10'),auth[_0x8b9e('0x7')](),controller['update']);router[_0x8b9e('0x11')](_0x8b9e('0x10'),auth[_0x8b9e('0x7')](),controller[_0x8b9e('0x12')]);module[_0x8b9e('0x13')]=router; \ No newline at end of file +var _0xcd3b=['/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x125d11,_0xd33527){var _0xd77ef2=function(_0x238141){while(--_0x238141){_0x125d11['push'](_0x125d11['shift']());}};_0xd77ef2(++_0xd33527);}(_0xcd3b,0x176));var _0xbcd3=function(_0x4a7e16,_0x481461){_0x4a7e16=_0x4a7e16-0x0;var _0x1d52e1=_0xcd3b[_0x4a7e16];return _0x1d52e1;};'use strict';var multer=require(_0xbcd3('0x0'));var util=require(_0xbcd3('0x1'));var path=require(_0xbcd3('0x2'));var timeout=require(_0xbcd3('0x3'));var express=require(_0xbcd3('0x4'));var router=express['Router']();var auth=require(_0xbcd3('0x5'));var interaction=require(_0xbcd3('0x6'));var config=require(_0xbcd3('0x7'));var controller=require(_0xbcd3('0x8'));router[_0xbcd3('0x9')]('/',auth['isAuthenticated'](),controller[_0xbcd3('0xa')]);router[_0xbcd3('0x9')](_0xbcd3('0xb'),auth[_0xbcd3('0xc')](),controller[_0xbcd3('0xd')]);router[_0xbcd3('0x9')](_0xbcd3('0xe'),auth[_0xbcd3('0xc')](),controller[_0xbcd3('0xf')]);router[_0xbcd3('0x9')](_0xbcd3('0x10'),auth[_0xbcd3('0xc')](),controller[_0xbcd3('0x11')]);router[_0xbcd3('0x12')]('/',auth[_0xbcd3('0xc')](),controller[_0xbcd3('0x13')]);router[_0xbcd3('0x12')](_0xbcd3('0xe'),auth[_0xbcd3('0xc')](),controller[_0xbcd3('0x14')]);router[_0xbcd3('0x15')](_0xbcd3('0xb'),auth[_0xbcd3('0xc')](),controller[_0xbcd3('0x16')]);router[_0xbcd3('0x17')]('/:id',auth[_0xbcd3('0xc')](),controller[_0xbcd3('0x18')]);module[_0xbcd3('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index e00b93e..2f02c57 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 _0x228f=['username','ENUM','password','integrationTab','newTab','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x228f,0x1e8));var _0xf228=function(_0x112fb0,_0x2c377d){_0x112fb0=_0x112fb0-0x0;var _0x5aa3c8=_0x228f[_0x112fb0];return _0x5aa3c8;};'use strict';var Sequelize=require('sequelize');module[_0xf228('0x0')]={'name':{'type':Sequelize[_0xf228('0x1')]},'description':{'type':Sequelize[_0xf228('0x1')]},'username':{'type':Sequelize[_0xf228('0x1')],'unique':_0xf228('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xf228('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xf228('0x3')](_0xf228('0x4'),'token'),'defaultValue':_0xf228('0x4')},'serverUrl':{'type':Sequelize[_0xf228('0x1')]},'type':{'type':Sequelize['ENUM'](_0xf228('0x5'),_0xf228('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x9f62=['username','ENUM','password','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x9cf952,_0x563ff3){var _0x33ad98=function(_0x4860d4){while(--_0x4860d4){_0x9cf952['push'](_0x9cf952['shift']());}};_0x33ad98(++_0x563ff3);}(_0x9f62,0x115));var _0x29f6=function(_0x43b3e3,_0x142e3e){_0x43b3e3=_0x43b3e3-0x0;var _0x599bf5=_0x9f62[_0x43b3e3];return _0x599bf5;};'use strict';var Sequelize=require(_0x29f6('0x0'));module[_0x29f6('0x1')]={'name':{'type':Sequelize[_0x29f6('0x2')]},'description':{'type':Sequelize[_0x29f6('0x2')]},'username':{'type':Sequelize[_0x29f6('0x2')],'unique':_0x29f6('0x3')},'password':{'type':Sequelize[_0x29f6('0x2')]},'token':{'type':Sequelize[_0x29f6('0x2')]},'remoteUri':{'type':Sequelize[_0x29f6('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x29f6('0x4')](_0x29f6('0x5'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x29f6('0x4')](_0x29f6('0x6'),_0x29f6('0x7')),'defaultValue':_0x29f6('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 419ac7b..54dace2 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 _0xa4f4=['remoteUri','slice','substring','lastIndexOf','format','ticket_fields','authType','headers','%s:%s','username','toString','base64','token','Basic\x20%s','%s/token:%s','Unknown\x20authentication\x20type','subject','description','remove','includes','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','filters','filter','merge','options','count','include','ZendeskAccount','rows','show','params','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskField','password'];(function(_0x5837b1,_0x54229a){var _0x490d8b=function(_0x3af82d){while(--_0x3af82d){_0x5837b1['push'](_0x5837b1['shift']());}};_0x490d8b(++_0x54229a);}(_0xa4f4,0x9e));var _0x4a4f=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xa4f4[_0x4c12ec];return _0x3ae42c;};'use strict';var pdf=require(_0x4a4f('0x0'));var emlformat=require(_0x4a4f('0x1'));var rimraf=require(_0x4a4f('0x2'));var zipdir=require(_0x4a4f('0x3'));var jsonpatch=require(_0x4a4f('0x4'));var rp=require(_0x4a4f('0x5'));var moment=require(_0x4a4f('0x6'));var BPromise=require(_0x4a4f('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a4f('0x8'));var sox=require(_0x4a4f('0x9'));var csv=require(_0x4a4f('0xa'));var ejs=require(_0x4a4f('0xb'));var fs=require('fs');var _=require(_0x4a4f('0xc'));var squel=require(_0x4a4f('0xd'));var crypto=require(_0x4a4f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4a4f('0xf'));var toCsv=require(_0x4a4f('0xa'));var querystring=require(_0x4a4f('0x10'));var Papa=require(_0x4a4f('0x11'));var Redis=require('ioredis');var authService=require(_0x4a4f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4a4f('0x13'));var hardwareService=require(_0x4a4f('0x14'));var logger=require('../../config/logger')(_0x4a4f('0x15'));var utils=require(_0x4a4f('0x16'));var config=require('../../config/environment');var db=require(_0x4a4f('0x17'))['db'];var integrations=require(_0x4a4f('0x18'));var jayson=require(_0x4a4f('0x19'));var client=jayson[_0x4a4f('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x512f57,_0x3205c8,_0xaa7341){if(_0xaa7341){var _0x1b819e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b819e[_0x4a4f('0x1b')](_0x3205c8)){return _0x512f57;}else{throw new db[(_0x4a4f('0x1c'))][(_0x4a4f('0x1d'))](_0x4a4f('0x1e'));}}else{return _0x512f57;}}function respondWithRpcPromise(_0x72740b,_0x43d735,_0x1f6b25,_0x2d1e3e){return new BPromise(function(_0x4995b6,_0x389bc5){var _0x4eb3a7=_0x2d1e3e||client;return _0x4eb3a7[_0x4a4f('0x1f')](_0x72740b,_0x1f6b25)[_0x4a4f('0x20')](function(_0x4705c4){logger[_0x4a4f('0x21')](_0x4a4f('0x22'),_0x43d735,_0x4a4f('0x23'));logger[_0x4a4f('0x24')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x43d735,'request\x20sent',JSON[_0x4a4f('0x25')](_0x4705c4));if(_0x4705c4[_0x4a4f('0x26')]){if(_0x4705c4[_0x4a4f('0x26')][_0x4a4f('0x27')]===0x1f4){logger[_0x4a4f('0x26')](_0x4a4f('0x22'),_0x43d735,_0x4705c4[_0x4a4f('0x26')][_0x4a4f('0x28')]);return _0x389bc5(_0x4705c4[_0x4a4f('0x26')][_0x4a4f('0x28')]);}logger[_0x4a4f('0x26')](_0x4a4f('0x22'),_0x43d735,_0x4705c4[_0x4a4f('0x26')][_0x4a4f('0x28')]);return _0x4995b6(_0x4705c4[_0x4a4f('0x26')][_0x4a4f('0x28')]);}else{logger[_0x4a4f('0x21')]('ZendeskAccount,\x20%s,\x20%s',_0x43d735,_0x4a4f('0x23'));_0x4995b6(_0x4705c4[_0x4a4f('0x29')]['message']);}})['catch'](function(_0xc80b2){logger[_0x4a4f('0x26')]('ZendeskAccount,\x20%s,\x20%s',_0x43d735,_0xc80b2);_0x389bc5(_0xc80b2);});});}function respondWithStatusCode(_0x268625,_0x512641){_0x512641=_0x512641||0xcc;return function(_0xf04cf2){if(_0xf04cf2){return _0x268625[_0x4a4f('0x2a')](_0x512641);}return _0x268625[_0x4a4f('0x2b')](_0x512641)['end']();};}function respondWithResult(_0x52abb9,_0x501776){_0x501776=_0x501776||0xc8;return function(_0x3c0af5){if(_0x3c0af5){return _0x52abb9[_0x4a4f('0x2b')](_0x501776)[_0x4a4f('0x2c')](_0x3c0af5);}};}function respondWithFilteredResult(_0x4d7302,_0x6a5a3e){return function(_0x57a5e5){if(_0x57a5e5){var _0x8c6939=_0x57a5e5['count'],_0x486a31=_0x6a5a3e['offset'],_0x375cf3=_0x6a5a3e['offset']+_0x6a5a3e[_0x4a4f('0x2d')],_0x3ea721;if(_0x375cf3>=_0x8c6939){_0x375cf3=_0x8c6939;_0x3ea721=0xc8;}else{_0x3ea721=0xce;}_0x4d7302['status'](_0x3ea721);return _0x4d7302['set'](_0x4a4f('0x2e'),_0x486a31+'-'+_0x375cf3+'/'+_0x8c6939)['json'](_0x57a5e5);}return null;};}function patchUpdates(_0x20c03e){return function(_0x13567d){try{jsonpatch[_0x4a4f('0x2f')](_0x13567d,_0x20c03e,!![]);}catch(_0x4a014c){return BPromise[_0x4a4f('0x30')](_0x4a014c);}return _0x13567d[_0x4a4f('0x31')]();};}function saveUpdates(_0x29c1e1,_0x39ca18){return function(_0x592aec){if(_0x592aec){return _0x592aec[_0x4a4f('0x32')](_0x29c1e1)[_0x4a4f('0x20')](function(_0x3dacc4){return _0x3dacc4;});}return null;};}function removeEntity(_0x10b211,_0x215f9b){return function(_0x11b87d){if(_0x11b87d){return _0x11b87d[_0x4a4f('0x33')]()[_0x4a4f('0x20')](function(){_0x10b211['status'](0xcc)[_0x4a4f('0x34')]();});}};}function handleEntityNotFound(_0x7f6aa1,_0x39d401){return function(_0x1c0cea){if(!_0x1c0cea){_0x7f6aa1[_0x4a4f('0x2a')](0x194);}return _0x1c0cea;};}function handleError(_0x3d18b1,_0x570df7){_0x570df7=_0x570df7||0x1f4;return function(_0x2a38d6){logger[_0x4a4f('0x26')](_0x2a38d6[_0x4a4f('0x35')]);if(_0x2a38d6[_0x4a4f('0x36')]){delete _0x2a38d6['name'];}_0x3d18b1['status'](_0x570df7)['send'](_0x2a38d6);};}exports[_0x4a4f('0x37')]=function(_0x4d3396,_0x39e446){var _0x49eb38={},_0x247473={},_0x5134ce={'count':0x0,'rows':[]};var _0x54ee62=_[_0x4a4f('0x38')](db['ZendeskAccount'][_0x4a4f('0x39')],function(_0x262eb2){return{'name':_0x262eb2[_0x4a4f('0x3a')],'type':_0x262eb2[_0x4a4f('0x3b')][_0x4a4f('0x3c')]};});_0x247473[_0x4a4f('0x3d')]=_[_0x4a4f('0x38')](_0x54ee62,_0x4a4f('0x36'));_0x247473[_0x4a4f('0x3e')]=_[_0x4a4f('0x3f')](_0x4d3396[_0x4a4f('0x3e')]);_0x247473['filters']=_[_0x4a4f('0x40')](_0x247473[_0x4a4f('0x3d')],_0x247473[_0x4a4f('0x3e')]);_0x49eb38[_0x4a4f('0x41')]=_[_0x4a4f('0x40')](_0x247473[_0x4a4f('0x3d')],qs[_0x4a4f('0x42')](_0x4d3396[_0x4a4f('0x3e')][_0x4a4f('0x42')]));_0x49eb38[_0x4a4f('0x41')]=_0x49eb38[_0x4a4f('0x41')][_0x4a4f('0x43')]?_0x49eb38[_0x4a4f('0x41')]:_0x247473[_0x4a4f('0x3d')];if(!_0x4d3396['query'][_0x4a4f('0x44')]('nolimit')){_0x49eb38['limit']=qs[_0x4a4f('0x2d')](_0x4d3396['query'][_0x4a4f('0x2d')]);_0x49eb38[_0x4a4f('0x45')]=qs[_0x4a4f('0x45')](_0x4d3396[_0x4a4f('0x3e')]['offset']);}_0x49eb38[_0x4a4f('0x46')]=qs[_0x4a4f('0x47')](_0x4d3396[_0x4a4f('0x3e')][_0x4a4f('0x47')]);_0x49eb38[_0x4a4f('0x48')]=qs[_0x4a4f('0x49')](_['pick'](_0x4d3396[_0x4a4f('0x3e')],_0x247473[_0x4a4f('0x49')]));if(_0x4d3396[_0x4a4f('0x3e')]['filter']){_0x49eb38[_0x4a4f('0x48')]=_['merge'](_0x49eb38[_0x4a4f('0x48')],{'$or':_[_0x4a4f('0x38')](_0x54ee62,function(_0x322a75){if(_0x322a75[_0x4a4f('0x3b')]!=='VIRTUAL'){var _0x20ff6d={};_0x20ff6d[_0x322a75[_0x4a4f('0x36')]]={'$like':'%'+_0x4d3396[_0x4a4f('0x3e')][_0x4a4f('0x4a')]+'%'};return _0x20ff6d;}})});}_0x49eb38=_[_0x4a4f('0x4b')]({},_0x49eb38,_0x4d3396[_0x4a4f('0x4c')]);var _0xea761a={'where':_0x49eb38[_0x4a4f('0x48')]};return db['ZendeskAccount'][_0x4a4f('0x4d')](_0xea761a)['then'](function(_0x3f0028){_0x5134ce[_0x4a4f('0x4d')]=_0x3f0028;if(_0x4d3396[_0x4a4f('0x3e')]['includeAll']){_0x49eb38[_0x4a4f('0x4e')]=[{'all':!![]}];}return db[_0x4a4f('0x4f')]['findAll'](_0x49eb38);})[_0x4a4f('0x20')](function(_0x406add){_0x5134ce[_0x4a4f('0x50')]=_0x406add;return _0x5134ce;})[_0x4a4f('0x20')](respondWithFilteredResult(_0x39e446,_0x49eb38))['catch'](handleError(_0x39e446,null));};exports[_0x4a4f('0x51')]=function(_0x34dfc6,_0x326542){var _0x10123d={'raw':![],'where':{'id':_0x34dfc6[_0x4a4f('0x52')]['id']}},_0x151ae7={};_0x151ae7['model']=_[_0x4a4f('0x3f')](db[_0x4a4f('0x4f')][_0x4a4f('0x39')]);_0x151ae7[_0x4a4f('0x3e')]=_['keys'](_0x34dfc6[_0x4a4f('0x3e')]);_0x151ae7[_0x4a4f('0x49')]=_[_0x4a4f('0x40')](_0x151ae7[_0x4a4f('0x3d')],_0x151ae7[_0x4a4f('0x3e')]);_0x10123d['attributes']=_['intersection'](_0x151ae7[_0x4a4f('0x3d')],qs[_0x4a4f('0x42')](_0x34dfc6[_0x4a4f('0x3e')][_0x4a4f('0x42')]));_0x10123d[_0x4a4f('0x41')]=_0x10123d[_0x4a4f('0x41')]['length']?_0x10123d[_0x4a4f('0x41')]:_0x151ae7[_0x4a4f('0x3d')];if(_0x34dfc6[_0x4a4f('0x3e')]['includeAll']){_0x10123d[_0x4a4f('0x4e')]=[{'all':!![]}];}_0x10123d=_[_0x4a4f('0x4b')]({},_0x10123d,_0x34dfc6[_0x4a4f('0x4c')]);return db[_0x4a4f('0x4f')][_0x4a4f('0x53')](_0x10123d)[_0x4a4f('0x20')](handleEntityNotFound(_0x326542,null))[_0x4a4f('0x20')](respondWithResult(_0x326542,null))[_0x4a4f('0x54')](handleError(_0x326542,null));};exports[_0x4a4f('0x55')]=function(_0x442f5f,_0x210ea3){return db[_0x4a4f('0x4f')][_0x4a4f('0x55')](_0x442f5f[_0x4a4f('0x56')],{})[_0x4a4f('0x20')](respondWithResult(_0x210ea3,0xc9))[_0x4a4f('0x54')](handleError(_0x210ea3,null));};exports[_0x4a4f('0x32')]=function(_0x4662e4,_0xc16662){if(_0x4662e4[_0x4a4f('0x56')]['id']){delete _0x4662e4[_0x4a4f('0x56')]['id'];}return db[_0x4a4f('0x4f')][_0x4a4f('0x53')]({'where':{'id':_0x4662e4['params']['id']}})['then'](handleEntityNotFound(_0xc16662,null))['then'](saveUpdates(_0x4662e4[_0x4a4f('0x56')],null))[_0x4a4f('0x20')](respondWithResult(_0xc16662,null))[_0x4a4f('0x54')](handleError(_0xc16662,null));};exports[_0x4a4f('0x33')]=function(_0x1866a9,_0x56a723){return db[_0x4a4f('0x4f')]['find']({'where':{'id':_0x1866a9[_0x4a4f('0x52')]['id']}})[_0x4a4f('0x20')](handleEntityNotFound(_0x56a723,null))['then'](removeEntity(_0x56a723,null))['catch'](handleError(_0x56a723,null));};exports[_0x4a4f('0x57')]=function(_0x897fa5,_0x2d2de2,_0x387cc6){var _0x10df0c={};var _0x5c3138={};var _0x2d058f;var _0x3cf143;return db[_0x4a4f('0x4f')][_0x4a4f('0x58')]({'where':{'id':_0x897fa5[_0x4a4f('0x52')]['id']}})[_0x4a4f('0x20')](handleEntityNotFound(_0x2d2de2,null))[_0x4a4f('0x20')](function(_0x38368b){if(_0x38368b){_0x2d058f=_0x38368b;_0x5c3138[_0x4a4f('0x3d')]=_[_0x4a4f('0x3f')](db[_0x4a4f('0x59')][_0x4a4f('0x39')]);_0x5c3138[_0x4a4f('0x3e')]=_[_0x4a4f('0x3f')](_0x897fa5[_0x4a4f('0x3e')]);_0x5c3138[_0x4a4f('0x49')]=_[_0x4a4f('0x40')](_0x5c3138[_0x4a4f('0x3d')],_0x5c3138[_0x4a4f('0x3e')]);_0x10df0c['attributes']=_[_0x4a4f('0x40')](_0x5c3138[_0x4a4f('0x3d')],qs['fields'](_0x897fa5['query']['fields']));_0x10df0c[_0x4a4f('0x41')]=_0x10df0c['attributes']['length']?_0x10df0c[_0x4a4f('0x41')]:_0x5c3138[_0x4a4f('0x3d')];_0x10df0c[_0x4a4f('0x46')]=qs[_0x4a4f('0x47')](_0x897fa5[_0x4a4f('0x3e')][_0x4a4f('0x47')]);_0x10df0c['where']=qs[_0x4a4f('0x49')](_[_0x4a4f('0x5a')](_0x897fa5[_0x4a4f('0x3e')],_0x5c3138[_0x4a4f('0x49')]));if(_0x897fa5[_0x4a4f('0x3e')][_0x4a4f('0x4a')]){_0x10df0c[_0x4a4f('0x48')]=_[_0x4a4f('0x4b')](_0x10df0c['where'],{'$or':_[_0x4a4f('0x38')](_0x10df0c['attributes'],function(_0x3d8163){var _0x277c7d={};_0x277c7d[_0x3d8163]={'$like':'%'+_0x897fa5['query'][_0x4a4f('0x4a')]+'%'};return _0x277c7d;})});}_0x10df0c=_['merge']({},_0x10df0c,_0x897fa5[_0x4a4f('0x4c')]);return _0x2d058f['getConfigurations'](_0x10df0c);}})[_0x4a4f('0x20')](function(_0x37f5b9){if(_0x37f5b9){_0x3cf143=_0x37f5b9[_0x4a4f('0x43')];if(!_0x897fa5[_0x4a4f('0x3e')]['hasOwnProperty'](_0x4a4f('0x5b'))){_0x10df0c[_0x4a4f('0x2d')]=qs['limit'](_0x897fa5[_0x4a4f('0x3e')]['limit']);_0x10df0c[_0x4a4f('0x45')]=qs[_0x4a4f('0x45')](_0x897fa5['query'][_0x4a4f('0x45')]);}return _0x2d058f[_0x4a4f('0x57')](_0x10df0c);}})[_0x4a4f('0x20')](function(_0x41e981){if(_0x41e981){return _0x41e981?{'count':_0x3cf143,'rows':_0x41e981}:null;}})[_0x4a4f('0x20')](respondWithResult(_0x2d2de2,null))[_0x4a4f('0x54')](handleError(_0x2d2de2,null));};exports[_0x4a4f('0x5c')]=function(_0x25e06c,_0xaef810,_0x41951){if(_0x25e06c[_0x4a4f('0x56')]['id']){delete _0x25e06c[_0x4a4f('0x56')]['id'];}return db[_0x4a4f('0x4f')][_0x4a4f('0x58')]({'where':{'id':_0x25e06c[_0x4a4f('0x52')]['id']}})['then'](handleEntityNotFound(_0xaef810,null))['then'](function(_0x5928d9){if(_0x5928d9){_0x25e06c['body'][_0x4a4f('0x5d')]=_0x5928d9['id'];_0x25e06c['body'][_0x4a4f('0x5e')]=integrations[_0x4a4f('0x5f')](_0x25e06c[_0x4a4f('0x56')]['channel'],_0x25e06c[_0x4a4f('0x56')][_0x4a4f('0x3b')]);_0x25e06c['body'][_0x4a4f('0x60')]=integrations[_0x4a4f('0x61')](_0x25e06c[_0x4a4f('0x56')]['channel'],_0x25e06c[_0x4a4f('0x56')][_0x4a4f('0x3b')]);return db[_0x4a4f('0x59')][_0x4a4f('0x55')](_0x25e06c[_0x4a4f('0x56')],{'include':[{'model':db[_0x4a4f('0x62')],'as':_0x4a4f('0x5e')},{'model':db[_0x4a4f('0x62')],'as':_0x4a4f('0x60')}]});}return null;})[_0x4a4f('0x20')](respondWithResult(_0xaef810,null))[_0x4a4f('0x54')](handleError(_0xaef810,null));};exports['getFields']=function(_0x48c07b,_0x244730,_0x457a43){var _0x1cf751='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x48c07b[_0x4a4f('0x52')]['id']},'attributes':['id','username',_0x4a4f('0x63'),'token','authType',_0x4a4f('0x64')]})[_0x4a4f('0x20')](handleEntityNotFound(_0x244730,null))[_0x4a4f('0x20')](function(_0x40c048){if(_0x40c048){_0x1cf751=_0x40c048['remoteUri'];var _0x41792a=_0x1cf751[_0x4a4f('0x65')](-0x1);if(_0x41792a==='/'){_0x1cf751=_0x1cf751[_0x4a4f('0x66')](0x0,_0x1cf751[_0x4a4f('0x67')](_0x41792a));}var _0x66dcde={'method':'GET','uri':util[_0x4a4f('0x68')]('%s/%s',_0x1cf751,_0x4a4f('0x69')),'json':!![]};switch(_0x40c048[_0x4a4f('0x6a')]){case _0x4a4f('0x63'):_0x66dcde[_0x4a4f('0x6b')]={'Authorization':util[_0x4a4f('0x68')]('Basic\x20%s',new Buffer(util[_0x4a4f('0x68')](_0x4a4f('0x6c'),_0x40c048[_0x4a4f('0x6d')],_0x40c048['password']))[_0x4a4f('0x6e')](_0x4a4f('0x6f')))};break;case _0x4a4f('0x70'):_0x66dcde[_0x4a4f('0x6b')]={'Authorization':util[_0x4a4f('0x68')](_0x4a4f('0x71'),new Buffer(util[_0x4a4f('0x68')](_0x4a4f('0x72'),_0x40c048['username'],_0x40c048[_0x4a4f('0x70')]))[_0x4a4f('0x6e')](_0x4a4f('0x6f')))};break;default:throw new db[(_0x4a4f('0x1c'))][(_0x4a4f('0x1d'))](_0x4a4f('0x73'));}return rp(_0x66dcde);}})['then'](function(_0x4c09aa){if(_0x4c09aa){var _0x37dc2d=[_0x4a4f('0x74'),_0x4a4f('0x75'),'group','assignee'];_[_0x4a4f('0x76')](_0x4c09aa[_0x4a4f('0x69')],function(_0x68d7b0){return _0x37dc2d[_0x4a4f('0x77')](_0x68d7b0[_0x4a4f('0x3b')]);});return{'count':_0x4c09aa[_0x4a4f('0x69')][_0x4a4f('0x43')],'rows':_[_0x4a4f('0x38')](_0x4c09aa[_0x4a4f('0x69')],function(_0x4c11c1){return{'id':_0x4c11c1['id'],'name':_0x4c11c1[_0x4a4f('0x78')]>0x7?_0x4c11c1[_0x4a4f('0x79')]:_0x4c11c1[_0x4a4f('0x3b')],'custom':_0x4c11c1[_0x4a4f('0x78')]>0x7?!![]:![],'options':_0x4c11c1[_0x4a4f('0x7a')]?_0x4c11c1[_0x4a4f('0x7a')]:_0x4c11c1[_0x4a4f('0x7b')]?_0x4c11c1[_0x4a4f('0x7b')]:[]};})};}})[_0x4a4f('0x20')](respondWithResult(_0x244730,null))[_0x4a4f('0x54')](function(_0x5c09bf){var _0x56c3f6=_0x48c07b[_0x4a4f('0x3e')]['test']?0x1f4:_0x5c09bf['statusCode']||0x1f4;logger['error'](_0x4a4f('0x7c'),_0x4a4f('0x7d'),_0x56c3f6,JSON[_0x4a4f('0x25')](_0x5c09bf));delete _0x5c09bf[_0x4a4f('0x36')];if(_0x56c3f6===0x191){_0x56c3f6=0x190;}_0x244730['status'](_0x56c3f6)[_0x4a4f('0x7e')](_0x48c07b[_0x4a4f('0x3e')]['test']?{'message':_0x4a4f('0x7f'),'statusCode':_0x5c09bf[_0x4a4f('0x80')]}:_0x5c09bf);});}; \ No newline at end of file +var _0x7de7=['../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ZendeskAccount','includeAll','include','findAll','rows','show','length','find','create','body','params','findOne','order','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','Subjects','getFields','username','authType','remoteUri','slice','substring','lastIndexOf','ticket_fields','password','headers','format','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','includes','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x227b89,_0xc7bda6){var _0x2165bf=function(_0xa41f37){while(--_0xa41f37){_0x227b89['push'](_0x227b89['shift']());}};_0x2165bf(++_0xc7bda6);}(_0x7de7,0x1e5));var _0x77de=function(_0x120bc2,_0x57a253){_0x120bc2=_0x120bc2-0x0;var _0x454a41=_0x7de7[_0x120bc2];return _0x454a41;};'use strict';var pdf=require(_0x77de('0x0'));var emlformat=require(_0x77de('0x1'));var rimraf=require(_0x77de('0x2'));var zipdir=require(_0x77de('0x3'));var jsonpatch=require(_0x77de('0x4'));var rp=require('request-promise');var moment=require(_0x77de('0x5'));var BPromise=require(_0x77de('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x77de('0x7'));var sox=require(_0x77de('0x8'));var csv=require(_0x77de('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x77de('0xa'));var squel=require('squel');var crypto=require(_0x77de('0xb'));var jsforce=require(_0x77de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x77de('0x9'));var querystring=require(_0x77de('0xd'));var Papa=require(_0x77de('0xe'));var Redis=require(_0x77de('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x77de('0x10'));var as=require(_0x77de('0x11'));var hardwareService=require(_0x77de('0x12'));var logger=require('../../config/logger')(_0x77de('0x13'));var utils=require(_0x77de('0x14'));var config=require(_0x77de('0x15'));var db=require(_0x77de('0x16'))['db'];var integrations=require(_0x77de('0x17'));var jayson=require(_0x77de('0x18'));var client=jayson[_0x77de('0x19')][_0x77de('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2af340,_0x33d3bd,_0x1717d0){if(_0x1717d0){var _0x1ed621=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ed621[_0x77de('0x1b')](_0x33d3bd)){return _0x2af340;}else{throw new db[(_0x77de('0x1c'))]['ValidationError'](_0x77de('0x1d'));}}else{return _0x2af340;}}function respondWithRpcPromise(_0x99b126,_0x203d8b,_0x642c4f,_0x3260ce){return new BPromise(function(_0x58120a,_0x97e43a){var _0x5eca4e=_0x3260ce||client;return _0x5eca4e[_0x77de('0x1e')](_0x99b126,_0x642c4f)[_0x77de('0x1f')](function(_0x28dc6f){logger['info'](_0x77de('0x20'),_0x203d8b,_0x77de('0x21'));logger[_0x77de('0x22')](_0x77de('0x23'),_0x203d8b,_0x77de('0x21'),JSON[_0x77de('0x24')](_0x28dc6f));if(_0x28dc6f[_0x77de('0x25')]){if(_0x28dc6f[_0x77de('0x25')]['code']===0x1f4){logger[_0x77de('0x25')](_0x77de('0x20'),_0x203d8b,_0x28dc6f[_0x77de('0x25')][_0x77de('0x26')]);return _0x97e43a(_0x28dc6f[_0x77de('0x25')]['message']);}logger[_0x77de('0x25')](_0x77de('0x20'),_0x203d8b,_0x28dc6f[_0x77de('0x25')]['message']);return _0x58120a(_0x28dc6f[_0x77de('0x25')][_0x77de('0x26')]);}else{logger['info'](_0x77de('0x20'),_0x203d8b,_0x77de('0x21'));_0x58120a(_0x28dc6f['result'][_0x77de('0x26')]);}})[_0x77de('0x27')](function(_0x328d63){logger[_0x77de('0x25')](_0x77de('0x20'),_0x203d8b,_0x328d63);_0x97e43a(_0x328d63);});});}function respondWithStatusCode(_0xcf1a10,_0xe655a5){_0xe655a5=_0xe655a5||0xcc;return function(_0x4a75ae){if(_0x4a75ae){return _0xcf1a10[_0x77de('0x28')](_0xe655a5);}return _0xcf1a10[_0x77de('0x29')](_0xe655a5)[_0x77de('0x2a')]();};}function respondWithResult(_0x1e9943,_0x163364){_0x163364=_0x163364||0xc8;return function(_0x5bb6bb){if(_0x5bb6bb){return _0x1e9943['status'](_0x163364)[_0x77de('0x2b')](_0x5bb6bb);}};}function respondWithFilteredResult(_0x2d19b6,_0x35065c){return function(_0x35e5ee){if(_0x35e5ee){var _0x5ea672=_0x35e5ee[_0x77de('0x2c')],_0x148eda=_0x35065c[_0x77de('0x2d')],_0x5aef5e=_0x35065c[_0x77de('0x2d')]+_0x35065c[_0x77de('0x2e')],_0x5c4129;if(_0x5aef5e>=_0x5ea672){_0x5aef5e=_0x5ea672;_0x5c4129=0xc8;}else{_0x5c4129=0xce;}_0x2d19b6['status'](_0x5c4129);return _0x2d19b6[_0x77de('0x2f')]('Content-Range',_0x148eda+'-'+_0x5aef5e+'/'+_0x5ea672)[_0x77de('0x2b')](_0x35e5ee);}return null;};}function patchUpdates(_0xfc95ee){return function(_0x41a246){try{jsonpatch[_0x77de('0x30')](_0x41a246,_0xfc95ee,!![]);}catch(_0x546d20){return BPromise['reject'](_0x546d20);}return _0x41a246['save']();};}function saveUpdates(_0x29a3f3,_0x1a7c04){return function(_0x118e33){if(_0x118e33){return _0x118e33['update'](_0x29a3f3)[_0x77de('0x1f')](function(_0x36206d){return _0x36206d;});}return null;};}function removeEntity(_0x286635,_0x359c39){return function(_0x3a2865){if(_0x3a2865){return _0x3a2865[_0x77de('0x31')]()[_0x77de('0x1f')](function(){_0x286635['status'](0xcc)[_0x77de('0x2a')]();});}};}function handleEntityNotFound(_0x4903ba,_0x19f19e){return function(_0x586125){if(!_0x586125){_0x4903ba[_0x77de('0x28')](0x194);}return _0x586125;};}function handleError(_0x3a2b89,_0xd24b21){_0xd24b21=_0xd24b21||0x1f4;return function(_0x4d9de6){logger[_0x77de('0x25')](_0x4d9de6[_0x77de('0x32')]);if(_0x4d9de6[_0x77de('0x33')]){delete _0x4d9de6[_0x77de('0x33')];}_0x3a2b89[_0x77de('0x29')](_0xd24b21)[_0x77de('0x34')](_0x4d9de6);};}exports[_0x77de('0x35')]=function(_0xced5ef,_0x28cb78){var _0x9e9efc={},_0x569dda={},_0x28dfd9={'count':0x0,'rows':[]};var _0x1ee42a=_[_0x77de('0x36')](db['ZendeskAccount'][_0x77de('0x37')],function(_0x3507ff){return{'name':_0x3507ff[_0x77de('0x38')],'type':_0x3507ff[_0x77de('0x39')][_0x77de('0x3a')]};});_0x569dda[_0x77de('0x3b')]=_[_0x77de('0x36')](_0x1ee42a,'name');_0x569dda[_0x77de('0x3c')]=_[_0x77de('0x3d')](_0xced5ef[_0x77de('0x3c')]);_0x569dda[_0x77de('0x3e')]=_[_0x77de('0x3f')](_0x569dda[_0x77de('0x3b')],_0x569dda[_0x77de('0x3c')]);_0x9e9efc[_0x77de('0x40')]=_['intersection'](_0x569dda[_0x77de('0x3b')],qs[_0x77de('0x41')](_0xced5ef[_0x77de('0x3c')][_0x77de('0x41')]));_0x9e9efc['attributes']=_0x9e9efc[_0x77de('0x40')]['length']?_0x9e9efc[_0x77de('0x40')]:_0x569dda[_0x77de('0x3b')];if(!_0xced5ef['query'][_0x77de('0x42')](_0x77de('0x43'))){_0x9e9efc['limit']=qs[_0x77de('0x2e')](_0xced5ef[_0x77de('0x3c')][_0x77de('0x2e')]);_0x9e9efc[_0x77de('0x2d')]=qs[_0x77de('0x2d')](_0xced5ef[_0x77de('0x3c')][_0x77de('0x2d')]);}_0x9e9efc['order']=qs[_0x77de('0x44')](_0xced5ef[_0x77de('0x3c')][_0x77de('0x44')]);_0x9e9efc[_0x77de('0x45')]=qs[_0x77de('0x3e')](_[_0x77de('0x46')](_0xced5ef[_0x77de('0x3c')],_0x569dda[_0x77de('0x3e')]));if(_0xced5ef[_0x77de('0x3c')][_0x77de('0x47')]){_0x9e9efc[_0x77de('0x45')]=_['merge'](_0x9e9efc['where'],{'$or':_[_0x77de('0x36')](_0x1ee42a,function(_0x18aa43){if(_0x18aa43[_0x77de('0x39')]!==_0x77de('0x48')){var _0x2ed5b6={};_0x2ed5b6[_0x18aa43['name']]={'$like':'%'+_0xced5ef[_0x77de('0x3c')]['filter']+'%'};return _0x2ed5b6;}})});}_0x9e9efc=_[_0x77de('0x49')]({},_0x9e9efc,_0xced5ef[_0x77de('0x4a')]);var _0x11efca={'where':_0x9e9efc[_0x77de('0x45')]};return db[_0x77de('0x4b')]['count'](_0x11efca)[_0x77de('0x1f')](function(_0x122305){_0x28dfd9[_0x77de('0x2c')]=_0x122305;if(_0xced5ef[_0x77de('0x3c')][_0x77de('0x4c')]){_0x9e9efc[_0x77de('0x4d')]=[{'all':!![]}];}return db[_0x77de('0x4b')][_0x77de('0x4e')](_0x9e9efc);})['then'](function(_0x3a0a5b){_0x28dfd9[_0x77de('0x4f')]=_0x3a0a5b;return _0x28dfd9;})[_0x77de('0x1f')](respondWithFilteredResult(_0x28cb78,_0x9e9efc))[_0x77de('0x27')](handleError(_0x28cb78,null));};exports[_0x77de('0x50')]=function(_0x13bf44,_0x3b6c2a){var _0xd04b59={'raw':![],'where':{'id':_0x13bf44['params']['id']}},_0x1b34e5={};_0x1b34e5[_0x77de('0x3b')]=_[_0x77de('0x3d')](db[_0x77de('0x4b')][_0x77de('0x37')]);_0x1b34e5[_0x77de('0x3c')]=_['keys'](_0x13bf44['query']);_0x1b34e5[_0x77de('0x3e')]=_['intersection'](_0x1b34e5[_0x77de('0x3b')],_0x1b34e5[_0x77de('0x3c')]);_0xd04b59[_0x77de('0x40')]=_[_0x77de('0x3f')](_0x1b34e5[_0x77de('0x3b')],qs[_0x77de('0x41')](_0x13bf44[_0x77de('0x3c')][_0x77de('0x41')]));_0xd04b59[_0x77de('0x40')]=_0xd04b59[_0x77de('0x40')][_0x77de('0x51')]?_0xd04b59[_0x77de('0x40')]:_0x1b34e5[_0x77de('0x3b')];if(_0x13bf44['query'][_0x77de('0x4c')]){_0xd04b59['include']=[{'all':!![]}];}_0xd04b59=_['merge']({},_0xd04b59,_0x13bf44['options']);return db[_0x77de('0x4b')][_0x77de('0x52')](_0xd04b59)[_0x77de('0x1f')](handleEntityNotFound(_0x3b6c2a,null))[_0x77de('0x1f')](respondWithResult(_0x3b6c2a,null))[_0x77de('0x27')](handleError(_0x3b6c2a,null));};exports[_0x77de('0x53')]=function(_0x39e884,_0x53be79){return db[_0x77de('0x4b')][_0x77de('0x53')](_0x39e884[_0x77de('0x54')],{})[_0x77de('0x1f')](respondWithResult(_0x53be79,0xc9))[_0x77de('0x27')](handleError(_0x53be79,null));};exports['update']=function(_0x1c7b25,_0xaf1105){if(_0x1c7b25[_0x77de('0x54')]['id']){delete _0x1c7b25['body']['id'];}return db[_0x77de('0x4b')][_0x77de('0x52')]({'where':{'id':_0x1c7b25[_0x77de('0x55')]['id']}})[_0x77de('0x1f')](handleEntityNotFound(_0xaf1105,null))['then'](saveUpdates(_0x1c7b25[_0x77de('0x54')],null))[_0x77de('0x1f')](respondWithResult(_0xaf1105,null))['catch'](handleError(_0xaf1105,null));};exports[_0x77de('0x31')]=function(_0x364430,_0x55e183){return db['ZendeskAccount'][_0x77de('0x52')]({'where':{'id':_0x364430[_0x77de('0x55')]['id']}})[_0x77de('0x1f')](handleEntityNotFound(_0x55e183,null))[_0x77de('0x1f')](removeEntity(_0x55e183,null))[_0x77de('0x27')](handleError(_0x55e183,null));};exports['getConfigurations']=function(_0x26a3be,_0x399b3c,_0x380cb2){var _0x3fb7fe={};var _0x45aafc={};var _0x2caca1;var _0x389c25;return db['ZendeskAccount'][_0x77de('0x56')]({'where':{'id':_0x26a3be[_0x77de('0x55')]['id']}})[_0x77de('0x1f')](handleEntityNotFound(_0x399b3c,null))['then'](function(_0x178ef5){if(_0x178ef5){_0x2caca1=_0x178ef5;_0x45aafc[_0x77de('0x3b')]=_[_0x77de('0x3d')](db['ZendeskConfiguration'][_0x77de('0x37')]);_0x45aafc[_0x77de('0x3c')]=_['keys'](_0x26a3be['query']);_0x45aafc[_0x77de('0x3e')]=_[_0x77de('0x3f')](_0x45aafc[_0x77de('0x3b')],_0x45aafc[_0x77de('0x3c')]);_0x3fb7fe[_0x77de('0x40')]=_[_0x77de('0x3f')](_0x45aafc[_0x77de('0x3b')],qs['fields'](_0x26a3be[_0x77de('0x3c')][_0x77de('0x41')]));_0x3fb7fe[_0x77de('0x40')]=_0x3fb7fe[_0x77de('0x40')]['length']?_0x3fb7fe[_0x77de('0x40')]:_0x45aafc[_0x77de('0x3b')];_0x3fb7fe[_0x77de('0x57')]=qs[_0x77de('0x44')](_0x26a3be[_0x77de('0x3c')]['sort']);_0x3fb7fe['where']=qs[_0x77de('0x3e')](_[_0x77de('0x46')](_0x26a3be[_0x77de('0x3c')],_0x45aafc[_0x77de('0x3e')]));if(_0x26a3be['query'][_0x77de('0x47')]){_0x3fb7fe[_0x77de('0x45')]=_[_0x77de('0x49')](_0x3fb7fe[_0x77de('0x45')],{'$or':_[_0x77de('0x36')](_0x3fb7fe[_0x77de('0x40')],function(_0x2f0616){var _0x2d3795={};_0x2d3795[_0x2f0616]={'$like':'%'+_0x26a3be['query'][_0x77de('0x47')]+'%'};return _0x2d3795;})});}_0x3fb7fe=_['merge']({},_0x3fb7fe,_0x26a3be['options']);return _0x2caca1['getConfigurations'](_0x3fb7fe);}})['then'](function(_0x59573c){if(_0x59573c){_0x389c25=_0x59573c['length'];if(!_0x26a3be[_0x77de('0x3c')]['hasOwnProperty'](_0x77de('0x43'))){_0x3fb7fe['limit']=qs[_0x77de('0x2e')](_0x26a3be['query']['limit']);_0x3fb7fe['offset']=qs[_0x77de('0x2d')](_0x26a3be[_0x77de('0x3c')][_0x77de('0x2d')]);}return _0x2caca1[_0x77de('0x58')](_0x3fb7fe);}})[_0x77de('0x1f')](function(_0x498842){if(_0x498842){return _0x498842?{'count':_0x389c25,'rows':_0x498842}:null;}})[_0x77de('0x1f')](respondWithResult(_0x399b3c,null))[_0x77de('0x27')](handleError(_0x399b3c,null));};exports[_0x77de('0x59')]=function(_0x52a371,_0x33fc76,_0x11ea1b){if(_0x52a371['body']['id']){delete _0x52a371[_0x77de('0x54')]['id'];}return db['ZendeskAccount'][_0x77de('0x56')]({'where':{'id':_0x52a371[_0x77de('0x55')]['id']}})[_0x77de('0x1f')](handleEntityNotFound(_0x33fc76,null))[_0x77de('0x1f')](function(_0x33b518){if(_0x33b518){_0x52a371[_0x77de('0x54')][_0x77de('0x5a')]=_0x33b518['id'];_0x52a371[_0x77de('0x54')]['Subjects']=integrations[_0x77de('0x5b')](_0x52a371[_0x77de('0x54')][_0x77de('0x5c')],_0x52a371['body'][_0x77de('0x39')]);_0x52a371[_0x77de('0x54')][_0x77de('0x5d')]=integrations[_0x77de('0x5e')](_0x52a371['body'][_0x77de('0x5c')],_0x52a371[_0x77de('0x54')][_0x77de('0x39')]);return db[_0x77de('0x5f')][_0x77de('0x53')](_0x52a371[_0x77de('0x54')],{'include':[{'model':db[_0x77de('0x60')],'as':_0x77de('0x61')},{'model':db[_0x77de('0x60')],'as':_0x77de('0x5d')}]});}return null;})[_0x77de('0x1f')](respondWithResult(_0x33fc76,null))[_0x77de('0x27')](handleError(_0x33fc76,null));};exports[_0x77de('0x62')]=function(_0x40d416,_0x4aeddc,_0x19eaea){var _0x51a0ba='';return db['ZendeskAccount'][_0x77de('0x56')]({'where':{'id':_0x40d416['params']['id']},'attributes':['id',_0x77de('0x63'),'password','token',_0x77de('0x64'),'remoteUri']})['then'](handleEntityNotFound(_0x4aeddc,null))[_0x77de('0x1f')](function(_0x19a652){if(_0x19a652){_0x51a0ba=_0x19a652[_0x77de('0x65')];var _0x19a6be=_0x51a0ba[_0x77de('0x66')](-0x1);if(_0x19a6be==='/'){_0x51a0ba=_0x51a0ba[_0x77de('0x67')](0x0,_0x51a0ba[_0x77de('0x68')](_0x19a6be));}var _0x28b03c={'method':'GET','uri':util['format']('%s/%s',_0x51a0ba,_0x77de('0x69')),'json':!![]};switch(_0x19a652[_0x77de('0x64')]){case _0x77de('0x6a'):_0x28b03c[_0x77de('0x6b')]={'Authorization':util[_0x77de('0x6c')](_0x77de('0x6d'),new Buffer(util[_0x77de('0x6c')](_0x77de('0x6e'),_0x19a652[_0x77de('0x63')],_0x19a652[_0x77de('0x6a')]))[_0x77de('0x6f')](_0x77de('0x70')))};break;case _0x77de('0x71'):_0x28b03c[_0x77de('0x6b')]={'Authorization':util['format'](_0x77de('0x6d'),new Buffer(util[_0x77de('0x6c')](_0x77de('0x72'),_0x19a652[_0x77de('0x63')],_0x19a652[_0x77de('0x71')]))[_0x77de('0x6f')]('base64'))};break;default:throw new db[(_0x77de('0x1c'))][(_0x77de('0x73'))](_0x77de('0x74'));}return rp(_0x28b03c);}})[_0x77de('0x1f')](function(_0x494fc3){if(_0x494fc3){var _0x2861e7=[_0x77de('0x75'),'description',_0x77de('0x76'),'assignee'];_[_0x77de('0x77')](_0x494fc3['ticket_fields'],function(_0x364f4e){return _0x2861e7[_0x77de('0x78')](_0x364f4e[_0x77de('0x39')]);});return{'count':_0x494fc3[_0x77de('0x69')][_0x77de('0x51')],'rows':_[_0x77de('0x36')](_0x494fc3[_0x77de('0x69')],function(_0x5eaad7){return{'id':_0x5eaad7['id'],'name':_0x5eaad7[_0x77de('0x79')]>0x7?_0x5eaad7[_0x77de('0x7a')]:_0x5eaad7[_0x77de('0x39')],'custom':_0x5eaad7[_0x77de('0x79')]>0x7?!![]:![],'options':_0x5eaad7[_0x77de('0x7b')]?_0x5eaad7['system_field_options']:_0x5eaad7[_0x77de('0x7c')]?_0x5eaad7['custom_field_options']:[]};})};}})[_0x77de('0x1f')](respondWithResult(_0x4aeddc,null))[_0x77de('0x27')](function(_0x2bdfdf){var _0x32b98c=_0x40d416[_0x77de('0x3c')][_0x77de('0x1b')]?0x1f4:_0x2bdfdf['statusCode']||0x1f4;logger[_0x77de('0x25')](_0x77de('0x7d'),'getFields',_0x32b98c,JSON[_0x77de('0x24')](_0x2bdfdf));delete _0x2bdfdf['name'];if(_0x32b98c===0x191){_0x32b98c=0x190;}_0x4aeddc[_0x77de('0x29')](_0x32b98c)['send'](_0x40d416[_0x77de('0x3c')][_0x77de('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x2bdfdf[_0x77de('0x7e')]}:_0x2bdfdf);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 9669b79..6a8850f 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 _0x25f3=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','request-promise'];(function(_0x41588a,_0x39cb26){var _0x176492=function(_0x12924a){while(--_0x12924a){_0x41588a['push'](_0x41588a['shift']());}};_0x176492(++_0x39cb26);}(_0x25f3,0x127));var _0x325f=function(_0x5a1a32,_0x2a8d0c){_0x5a1a32=_0x5a1a32-0x0;var _0x1c8b7d=_0x25f3[_0x5a1a32];return _0x1c8b7d;};'use strict';var _=require(_0x325f('0x0'));var util=require('util');var logger=require(_0x325f('0x1'))(_0x325f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x325f('0x3'));var fs=require('fs');var path=require(_0x325f('0x4'));var rimraf=require(_0x325f('0x5'));var config=require(_0x325f('0x6'));var attributes=require(_0x325f('0x7'));var integrations=require(_0x325f('0x8'));module[_0x325f('0x9')]=function(_0x1e00ea,_0x47afb0){return _0x1e00ea[_0x325f('0xa')](_0x325f('0xb'),attributes,{'tableName':_0x325f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ce6=['api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','lodash','util','../../config/logger'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x4ce6,0x1b7));var _0x64ce=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x4ce6[_0x3a9661];return _0x5bb119;};'use strict';var _=require(_0x64ce('0x0'));var util=require(_0x64ce('0x1'));var logger=require(_0x64ce('0x2'))(_0x64ce('0x3'));var moment=require(_0x64ce('0x4'));var BPromise=require(_0x64ce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64ce('0x6'));var rimraf=require(_0x64ce('0x7'));var config=require(_0x64ce('0x8'));var attributes=require(_0x64ce('0x9'));var integrations=require(_0x64ce('0xa'));module[_0x64ce('0xb')]=function(_0x50835d,_0x29a98f){return _0x50835d['define']('ZendeskAccount',attributes,{'tableName':_0x64ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 58cdca6..515cedb 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowZendeskAccount','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1f98c5,_0x50136e){var _0x3a9421=function(_0x532bc2){while(--_0x532bc2){_0x1f98c5['push'](_0x1f98c5['shift']());}};_0x3a9421(++_0x50136e);}(_0x757a,0xde));var _0xa757=function(_0x31c6df,_0x1cad63){_0x31c6df=_0x31c6df-0x0;var _0x1f0ccd=_0x757a[_0x31c6df];return _0x1f0ccd;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetZendeskAccount',_0x4d9f58);logger['debug']('GetZendeskAccount',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetZendeskAccount',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});}; \ No newline at end of file +var _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x3c92a3,_0x467933){var _0x186082=function(_0x189cf1){while(--_0x189cf1){_0x3c92a3['push'](_0x3c92a3['shift']());}};_0x186082(++_0x467933);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetZendeskAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowZendeskAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 30aa791..1eb0759 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 _0x9850=['create','post','/:id/tags','setTags','/:id','update','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getTags'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x9850,0x68));var _0x0985=function(_0x204143,_0x7acd6b){_0x204143=_0x204143-0x0;var _0x385445=_0x9850[_0x204143];return _0x385445;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0985('0x0'));var timeout=require(_0x0985('0x1'));var express=require(_0x0985('0x2'));var router=express['Router']();var auth=require(_0x0985('0x3'));var interaction=require(_0x0985('0x4'));var config=require(_0x0985('0x5'));var controller=require(_0x0985('0x6'));router[_0x0985('0x7')]('/',auth[_0x0985('0x8')](),controller[_0x0985('0x9')]);router[_0x0985('0x7')]('/:id',auth[_0x0985('0x8')](),controller[_0x0985('0xa')]);router[_0x0985('0x7')](_0x0985('0xb'),auth[_0x0985('0x8')](),controller['getFields']);router['get'](_0x0985('0xc'),auth[_0x0985('0x8')](),controller[_0x0985('0xd')]);router[_0x0985('0x7')](_0x0985('0xe'),auth[_0x0985('0x8')](),controller['getDescriptions']);router[_0x0985('0x7')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0985('0xf')]);router['post']('/',auth[_0x0985('0x8')](),controller[_0x0985('0x10')]);router[_0x0985('0x11')](_0x0985('0x12'),auth['isAuthenticated'](),controller[_0x0985('0x13')]);router['put'](_0x0985('0x14'),auth[_0x0985('0x8')](),controller[_0x0985('0x15')]);router['delete'](_0x0985('0x14'),auth[_0x0985('0x8')](),controller[_0x0985('0x16')]);module[_0x0985('0x17')]=router; \ No newline at end of file +var _0xfa86=['create','/:id/tags','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x53f5d4,_0xfb8bdb){var _0x1431c5=function(_0x441576){while(--_0x441576){_0x53f5d4['push'](_0x53f5d4['shift']());}};_0x1431c5(++_0xfb8bdb);}(_0xfa86,0x17d));var _0x6fa8=function(_0xd2e2ab,_0x2440cf){_0xd2e2ab=_0xd2e2ab-0x0;var _0x1703a2=_0xfa86[_0xd2e2ab];return _0x1703a2;};'use strict';var multer=require(_0x6fa8('0x0'));var util=require('util');var path=require(_0x6fa8('0x1'));var timeout=require(_0x6fa8('0x2'));var express=require(_0x6fa8('0x3'));var router=express['Router']();var auth=require(_0x6fa8('0x4'));var interaction=require(_0x6fa8('0x5'));var config=require(_0x6fa8('0x6'));var controller=require(_0x6fa8('0x7'));router['get']('/',auth[_0x6fa8('0x8')](),controller[_0x6fa8('0x9')]);router[_0x6fa8('0xa')](_0x6fa8('0xb'),auth[_0x6fa8('0x8')](),controller[_0x6fa8('0xc')]);router[_0x6fa8('0xa')](_0x6fa8('0xd'),auth[_0x6fa8('0x8')](),controller[_0x6fa8('0xe')]);router[_0x6fa8('0xa')](_0x6fa8('0xf'),auth[_0x6fa8('0x8')](),controller[_0x6fa8('0x10')]);router[_0x6fa8('0xa')](_0x6fa8('0x11'),auth[_0x6fa8('0x8')](),controller['getDescriptions']);router[_0x6fa8('0xa')]('/:id/tags',auth[_0x6fa8('0x8')](),controller['getTags']);router[_0x6fa8('0x12')]('/',auth['isAuthenticated'](),controller[_0x6fa8('0x13')]);router[_0x6fa8('0x12')](_0x6fa8('0x14'),auth[_0x6fa8('0x8')](),controller['setTags']);router[_0x6fa8('0x15')](_0x6fa8('0xb'),auth[_0x6fa8('0x8')](),controller[_0x6fa8('0x16')]);router['delete'](_0x6fa8('0xb'),auth['isAuthenticated'](),controller[_0x6fa8('0x17')]);module[_0x6fa8('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index f532922..864f5a5 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 _0x09ce=['exports','STRING'];(function(_0x42a376,_0x54b447){var _0x1f8044=function(_0x7c9a27){while(--_0x7c9a27){_0x42a376['push'](_0x42a376['shift']());}};_0x1f8044(++_0x54b447);}(_0x09ce,0xdc));var _0xe09c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x09ce[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0xe09c('0x0')]={'name':{'type':Sequelize[_0xe09c('0x1')]},'description':{'type':Sequelize[_0xe09c('0x1')]}}; \ No newline at end of file +var _0xbe9e=['exports','STRING','sequelize'];(function(_0x409fa0,_0xeeee7b){var _0x33e30b=function(_0x8d1515){while(--_0x8d1515){_0x409fa0['push'](_0x409fa0['shift']());}};_0x33e30b(++_0xeeee7b);}(_0xbe9e,0xe3));var _0xebe9=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xbe9e[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xebe9('0x0'));module[_0xebe9('0x1')]={'name':{'type':Sequelize[_0xebe9('0x2')]},'description':{'type':Sequelize[_0xebe9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index f2c89fc..f172986 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','stack','send','index','map','ZendeskConfiguration','fieldName','type','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','options','count','includeAll','rows','show','rawAttributes','include','create','body','find','params','getFields','ZendeskField','getSubjects','hasOwnProperty','nolimit','getDescriptions','findOne','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];var jayson=require(_0xac4a('0x16'));var client=jayson[_0xac4a('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x21a79,_0x68424a,_0x247b78){if(_0x247b78){var _0x6e00d4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6e00d4[_0xac4a('0x18')](_0x68424a)){return _0x21a79;}else{throw new db[(_0xac4a('0x19'))][(_0xac4a('0x1a'))](_0xac4a('0x1b'));}}else{return _0x21a79;}}function respondWithRpcPromise(_0x190418,_0x42c7fc,_0x11e101,_0x26dbb8){return new BPromise(function(_0x4a2119,_0x402fff){var _0x34d797=_0x26dbb8||client;return _0x34d797[_0xac4a('0x1c')](_0x190418,_0x11e101)[_0xac4a('0x1d')](function(_0x3e88e3){logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x42c7fc,_0xac4a('0x20'),JSON[_0xac4a('0x21')](_0x3e88e3));if(_0x3e88e3[_0xac4a('0x22')]){if(_0x3e88e3['error'][_0xac4a('0x23')]===0x1f4){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x402fff(_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);}logger[_0xac4a('0x22')]('ZendeskConfiguration,\x20%s,\x20%s',_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x4a2119(_0x3e88e3['error'][_0xac4a('0x24')]);}else{logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));_0x4a2119(_0x3e88e3['result'][_0xac4a('0x24')]);}})[_0xac4a('0x25')](function(_0x15435c){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x15435c);_0x402fff(_0x15435c);});});}function respondWithStatusCode(_0x2b0dc2,_0x222507){_0x222507=_0x222507||0xcc;return function(_0x36054a){if(_0x36054a){return _0x2b0dc2[_0xac4a('0x26')](_0x222507);}return _0x2b0dc2[_0xac4a('0x27')](_0x222507)[_0xac4a('0x28')]();};}function respondWithResult(_0x215a31,_0x14832b){_0x14832b=_0x14832b||0xc8;return function(_0x472c57){if(_0x472c57){return _0x215a31[_0xac4a('0x27')](_0x14832b)[_0xac4a('0x29')](_0x472c57);}};}function respondWithFilteredResult(_0x4e17ce,_0x23b061){return function(_0x267a22){if(_0x267a22){var _0x42a33c=_0x267a22['count'],_0x2772fe=_0x23b061[_0xac4a('0x2a')],_0x116700=_0x23b061[_0xac4a('0x2a')]+_0x23b061[_0xac4a('0x2b')],_0x4a5a9e;if(_0x116700>=_0x42a33c){_0x116700=_0x42a33c;_0x4a5a9e=0xc8;}else{_0x4a5a9e=0xce;}_0x4e17ce['status'](_0x4a5a9e);return _0x4e17ce['set'](_0xac4a('0x2c'),_0x2772fe+'-'+_0x116700+'/'+_0x42a33c)[_0xac4a('0x29')](_0x267a22);}return null;};}function patchUpdates(_0x228629){return function(_0x432066){try{jsonpatch[_0xac4a('0x2d')](_0x432066,_0x228629,!![]);}catch(_0x53d3a5){return BPromise[_0xac4a('0x2e')](_0x53d3a5);}return _0x432066['save']();};}function saveUpdates(_0x30364b,_0x57adcf){return function(_0x17e6de){if(_0x17e6de){return _0x17e6de[_0xac4a('0x2f')](_0x30364b)[_0xac4a('0x1d')](function(_0x228aa7){return _0x228aa7;});}return null;};}function removeEntity(_0x34577f,_0x61e552){return function(_0xbd4591){if(_0xbd4591){return _0xbd4591[_0xac4a('0x30')]()[_0xac4a('0x1d')](function(){_0x34577f[_0xac4a('0x27')](0xcc)[_0xac4a('0x28')]();});}};}function handleEntityNotFound(_0x1634df,_0x1a9be2){return function(_0x1a9d4e){if(!_0x1a9d4e){_0x1634df['sendStatus'](0x194);}return _0x1a9d4e;};}function handleError(_0x30442d,_0x1c41fb){_0x1c41fb=_0x1c41fb||0x1f4;return function(_0x5a4e2b){logger[_0xac4a('0x22')](_0x5a4e2b[_0xac4a('0x31')]);if(_0x5a4e2b['name']){delete _0x5a4e2b['name'];}_0x30442d[_0xac4a('0x27')](_0x1c41fb)[_0xac4a('0x32')](_0x5a4e2b);};}exports[_0xac4a('0x33')]=function(_0x3de9e2,_0x4f5986){var _0x453d02={},_0x2e56c6={},_0x4e7630={'count':0x0,'rows':[]};var _0x37f2ee=_[_0xac4a('0x34')](db[_0xac4a('0x35')]['rawAttributes'],function(_0x121328){return{'name':_0x121328[_0xac4a('0x36')],'type':_0x121328[_0xac4a('0x37')]['key']};});_0x2e56c6[_0xac4a('0x38')]=_[_0xac4a('0x34')](_0x37f2ee,'name');_0x2e56c6['query']=_[_0xac4a('0x39')](_0x3de9e2['query']);_0x2e56c6['filters']=_['intersection'](_0x2e56c6['model'],_0x2e56c6[_0xac4a('0x3a')]);_0x453d02[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x2e56c6[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x453d02[_0xac4a('0x3b')]=_0x453d02[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x453d02[_0xac4a('0x3b')]:_0x2e56c6[_0xac4a('0x38')];if(!_0x3de9e2['query']['hasOwnProperty']('nolimit')){_0x453d02[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x453d02[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2a')]);}_0x453d02[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x3de9e2['query'][_0xac4a('0x40')]);_0x453d02[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x3de9e2[_0xac4a('0x3a')],_0x2e56c6['filters']));if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x453d02['where']=_[_0xac4a('0x45')](_0x453d02['where'],{'$or':_[_0xac4a('0x34')](_0x37f2ee,function(_0x65494e){if(_0x65494e[_0xac4a('0x37')]!==_0xac4a('0x46')){var _0x520e4a={};_0x520e4a[_0x65494e[_0xac4a('0x47')]]={'$like':'%'+_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x520e4a;}})});}_0x453d02=_[_0xac4a('0x45')]({},_0x453d02,_0x3de9e2[_0xac4a('0x48')]);var _0x4fa9eb={'where':_0x453d02[_0xac4a('0x41')]};return db['ZendeskConfiguration'][_0xac4a('0x49')](_0x4fa9eb)[_0xac4a('0x1d')](function(_0xeca4e9){_0x4e7630['count']=_0xeca4e9;if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x453d02['include']=[{'all':!![]}];}return db[_0xac4a('0x35')]['findAll'](_0x453d02);})[_0xac4a('0x1d')](function(_0xe620f6){_0x4e7630[_0xac4a('0x4b')]=_0xe620f6;return _0x4e7630;})['then'](respondWithFilteredResult(_0x4f5986,_0x453d02))['catch'](handleError(_0x4f5986,null));};exports[_0xac4a('0x4c')]=function(_0x4aaeff,_0x18ae96){var _0x566258={'raw':![],'where':{'id':_0x4aaeff['params']['id']}},_0x3d2aaf={};_0x3d2aaf[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x35')][_0xac4a('0x4d')]);_0x3d2aaf['query']=_[_0xac4a('0x39')](_0x4aaeff[_0xac4a('0x3a')]);_0x3d2aaf[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x3d2aaf[_0xac4a('0x38')],_0x3d2aaf[_0xac4a('0x3a')]);_0x566258[_0xac4a('0x3b')]=_['intersection'](_0x3d2aaf[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x4aaeff['query'][_0xac4a('0x3d')]));_0x566258[_0xac4a('0x3b')]=_0x566258[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x566258['attributes']:_0x3d2aaf[_0xac4a('0x38')];if(_0x4aaeff[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x566258[_0xac4a('0x4e')]=[{'all':!![]}];}_0x566258=_[_0xac4a('0x45')]({},_0x566258,_0x4aaeff['options']);return db[_0xac4a('0x35')]['find'](_0x566258)[_0xac4a('0x1d')](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x1d')](respondWithResult(_0x18ae96,null))['catch'](handleError(_0x18ae96,null));};exports['create']=function(_0x437466,_0x70fdc3){return db['ZendeskConfiguration'][_0xac4a('0x4f')](_0x437466[_0xac4a('0x50')],{})[_0xac4a('0x1d')](respondWithResult(_0x70fdc3,0xc9))[_0xac4a('0x25')](handleError(_0x70fdc3,null));};exports['update']=function(_0x3057d6,_0x108f7c){if(_0x3057d6[_0xac4a('0x50')]['id']){delete _0x3057d6[_0xac4a('0x50')]['id'];}return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x3057d6[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x108f7c,null))[_0xac4a('0x1d')](saveUpdates(_0x3057d6[_0xac4a('0x50')],null))[_0xac4a('0x1d')](respondWithResult(_0x108f7c,null))[_0xac4a('0x25')](handleError(_0x108f7c,null));};exports[_0xac4a('0x30')]=function(_0x2ac1e9,_0x213df2){return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x2ac1e9[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x213df2,null))[_0xac4a('0x1d')](removeEntity(_0x213df2,null))[_0xac4a('0x25')](handleError(_0x213df2,null));};exports[_0xac4a('0x53')]=function(_0x5222f3,_0x11c753,_0x492aae){var _0x13a577={};var _0x479ebc={};var _0x2d598e;var _0x4b7f79;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x5222f3[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x11c753,null))['then'](function(_0x52c957){if(_0x52c957){_0x2d598e=_0x52c957;_0x479ebc[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x54')][_0xac4a('0x4d')]);_0x479ebc[_0xac4a('0x3a')]=_['keys'](_0x5222f3[_0xac4a('0x3a')]);_0x479ebc['filters']=_[_0xac4a('0x3c')](_0x479ebc['model'],_0x479ebc[_0xac4a('0x3a')]);_0x13a577[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x479ebc[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x13a577[_0xac4a('0x3b')]=_0x13a577[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x13a577[_0xac4a('0x3b')]:_0x479ebc[_0xac4a('0x38')];_0x13a577[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x40')]);_0x13a577[_0xac4a('0x41')]=qs['filters'](_[_0xac4a('0x43')](_0x5222f3[_0xac4a('0x3a')],_0x479ebc['filters']));if(_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x13a577[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x13a577[_0xac4a('0x41')],{'$or':_['map'](_0x13a577['attributes'],function(_0x45f3c3){var _0x11bb54={};_0x11bb54[_0x45f3c3]={'$like':'%'+_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x11bb54;})});}_0x13a577=_[_0xac4a('0x45')]({},_0x13a577,_0x5222f3[_0xac4a('0x48')]);return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0x44c60b){if(_0x44c60b){_0x4b7f79=_0x44c60b[_0xac4a('0x3e')];if(!_0x5222f3[_0xac4a('0x3a')]['hasOwnProperty']('nolimit')){_0x13a577[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x13a577[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0xb09b89){if(_0xb09b89){return _0xb09b89?{'count':_0x4b7f79,'rows':_0xb09b89}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x11c753,null))['catch'](handleError(_0x11c753,null));};exports[_0xac4a('0x55')]=function(_0xc74ce8,_0x26bd31,_0x231932){var _0x513976={};var _0xc61e94={};var _0x5a30af;var _0xab4305;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0xc74ce8['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x26bd31,null))[_0xac4a('0x1d')](function(_0x13097f){if(_0x13097f){_0x5a30af=_0x13097f;_0xc61e94['model']=_[_0xac4a('0x39')](db['ZendeskField'][_0xac4a('0x4d')]);_0xc61e94['query']=_['keys'](_0xc74ce8[_0xac4a('0x3a')]);_0xc61e94['filters']=_[_0xac4a('0x3c')](_0xc61e94['model'],_0xc61e94[_0xac4a('0x3a')]);_0x513976[_0xac4a('0x3b')]=_['intersection'](_0xc61e94[_0xac4a('0x38')],qs['fields'](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x513976['attributes']=_0x513976[_0xac4a('0x3b')]['length']?_0x513976['attributes']:_0xc61e94[_0xac4a('0x38')];_0x513976['order']=qs[_0xac4a('0x40')](_0xc74ce8['query']['sort']);_0x513976[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0xc74ce8['query'],_0xc61e94['filters']));if(_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x513976['where']=_['merge'](_0x513976[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x513976[_0xac4a('0x3b')],function(_0x36df3d){var _0x1810f7={};_0x1810f7[_0x36df3d]={'$like':'%'+_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x1810f7;})});}_0x513976=_[_0xac4a('0x45')]({},_0x513976,_0xc74ce8[_0xac4a('0x48')]);return _0x5a30af['getSubjects'](_0x513976);}})[_0xac4a('0x1d')](function(_0x440dc4){if(_0x440dc4){_0xab4305=_0x440dc4[_0xac4a('0x3e')];if(!_0xc74ce8['query'][_0xac4a('0x56')](_0xac4a('0x57'))){_0x513976[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0xc74ce8[_0xac4a('0x3a')]['limit']);_0x513976[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x5a30af[_0xac4a('0x55')](_0x513976);}})[_0xac4a('0x1d')](function(_0xd7bdd6){if(_0xd7bdd6){return _0xd7bdd6?{'count':_0xab4305,'rows':_0xd7bdd6}:null;}})['then'](respondWithResult(_0x26bd31,null))[_0xac4a('0x25')](handleError(_0x26bd31,null));};exports[_0xac4a('0x58')]=function(_0x19bd6f,_0x35a97c,_0x1bb24d){var _0x171c47={};var _0x547eec={};var _0x318bee;var _0x29c772;return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x19bd6f['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x35a97c,null))['then'](function(_0x4447b5){if(_0x4447b5){_0x318bee=_0x4447b5;_0x547eec[_0xac4a('0x38')]=_['keys'](db['ZendeskField'][_0xac4a('0x4d')]);_0x547eec[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x19bd6f['query']);_0x547eec[_0xac4a('0x42')]=_['intersection'](_0x547eec[_0xac4a('0x38')],_0x547eec[_0xac4a('0x3a')]);_0x171c47[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x547eec[_0xac4a('0x38')],qs['fields'](_0x19bd6f['query'][_0xac4a('0x3d')]));_0x171c47[_0xac4a('0x3b')]=_0x171c47[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x171c47[_0xac4a('0x3b')]:_0x547eec[_0xac4a('0x38')];_0x171c47[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x19bd6f['query']['sort']);_0x171c47[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x19bd6f[_0xac4a('0x3a')],_0x547eec[_0xac4a('0x42')]));if(_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x171c47[_0xac4a('0x41')]=_['merge'](_0x171c47['where'],{'$or':_[_0xac4a('0x34')](_0x171c47[_0xac4a('0x3b')],function(_0x22804e){var _0x371e06={};_0x371e06[_0x22804e]={'$like':'%'+_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x371e06;})});}_0x171c47=_[_0xac4a('0x45')]({},_0x171c47,_0x19bd6f['options']);return _0x318bee[_0xac4a('0x58')](_0x171c47);}})[_0xac4a('0x1d')](function(_0x3439f3){if(_0x3439f3){_0x29c772=_0x3439f3['length'];if(!_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x56')](_0xac4a('0x57'))){_0x171c47[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x171c47[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x19bd6f['query'][_0xac4a('0x2a')]);}return _0x318bee['getDescriptions'](_0x171c47);}})[_0xac4a('0x1d')](function(_0x1199f6){if(_0x1199f6){return _0x1199f6?{'count':_0x29c772,'rows':_0x1199f6}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x35a97c,null))[_0xac4a('0x25')](handleError(_0x35a97c,null));};exports[_0xac4a('0x5a')]=function(_0x337da7,_0x19766a,_0x5266d3){var _0x2b883a={};var _0x42b3f7={};var _0x279f9b;var _0x3315e7;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x337da7[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x19766a,null))['then'](function(_0x55af32){if(_0x55af32){_0x279f9b=_0x55af32;_0x42b3f7[_0xac4a('0x38')]=_[_0xac4a('0x39')](db['Tag'][_0xac4a('0x4d')]);_0x42b3f7[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x337da7[_0xac4a('0x3a')]);_0x42b3f7[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],_0x42b3f7[_0xac4a('0x3a')]);_0x2b883a[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],qs[_0xac4a('0x3d')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x2b883a[_0xac4a('0x3b')]=_0x2b883a[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x2b883a['attributes']:_0x42b3f7[_0xac4a('0x38')];_0x2b883a[_0xac4a('0x3f')]=qs['sort'](_0x337da7[_0xac4a('0x3a')]['sort']);_0x2b883a[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_['pick'](_0x337da7[_0xac4a('0x3a')],_0x42b3f7['filters']));if(_0x337da7[_0xac4a('0x3a')]['filter']){_0x2b883a[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x2b883a[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x2b883a[_0xac4a('0x3b')],function(_0x36d8ff){var _0x7e403a={};_0x7e403a[_0x36d8ff]={'$like':'%'+_0x337da7[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x7e403a;})});}_0x2b883a=_[_0xac4a('0x45')]({},_0x2b883a,_0x337da7[_0xac4a('0x48')]);return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x4217df){if(_0x4217df){_0x3315e7=_0x4217df['length'];if(!_0x337da7[_0xac4a('0x3a')][_0xac4a('0x56')]('nolimit')){_0x2b883a[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x2b883a[_0xac4a('0x2a')]=qs['offset'](_0x337da7[_0xac4a('0x3a')]['offset']);}return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x240ff1){if(_0x240ff1){return _0x240ff1?{'count':_0x3315e7,'rows':_0x240ff1}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x19766a,null))['catch'](handleError(_0x19766a,null));};exports[_0xac4a('0x5b')]=function(_0x55866d,_0x277fd1,_0x40d363){if(_0x55866d[_0xac4a('0x50')]['id']){delete _0x55866d['body']['id'];}return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x55866d[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x277fd1,null))[_0xac4a('0x1d')](function(_0x25639a){if(_0x25639a){return _0x25639a[_0xac4a('0x5b')](_0x55866d[_0xac4a('0x50')][_0xac4a('0x5c')]||[]);}return null;})[_0xac4a('0x1d')](respondWithResult(_0x277fd1,null))[_0xac4a('0x25')](handleError(_0x277fd1,null));}; \ No newline at end of file +var _0x7217=['rawAttributes','keys','intersection','include','options','find','create','body','params','getFields','ZendeskField','getSubjects','hasOwnProperty','getDescriptions','findOne','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','then','stack','name','index','map','type','key','model','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ZendeskConfiguration','includeAll','rows','show'];(function(_0x2dfd28,_0x153b3c){var _0x49c016=function(_0x1cfb4d){while(--_0x1cfb4d){_0x2dfd28['push'](_0x2dfd28['shift']());}};_0x49c016(++_0x153b3c);}(_0x7217,0x19e));var _0x7721=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7217[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];var jayson=require(_0x7721('0x1b'));var client=jayson['client'][_0x7721('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199930,_0x57ff6d,_0x109900){if(_0x109900){var _0x30da54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30da54[_0x7721('0x1d')](_0x57ff6d)){return _0x199930;}else{throw new db[(_0x7721('0x1e'))]['ValidationError'](_0x7721('0x1f'));}}else{return _0x199930;}}function respondWithRpcPromise(_0x25b1c0,_0x534f1b,_0x4e199a,_0x4b183e){return new BPromise(function(_0x5ed54,_0x25a628){var _0x3cc909=_0x4b183e||client;return _0x3cc909[_0x7721('0x20')](_0x25b1c0,_0x4e199a)['then'](function(_0x20f669){logger['info'](_0x7721('0x21'),_0x534f1b,'request\x20sent');logger[_0x7721('0x22')](_0x7721('0x23'),_0x534f1b,_0x7721('0x24'),JSON[_0x7721('0x25')](_0x20f669));if(_0x20f669[_0x7721('0x26')]){if(_0x20f669[_0x7721('0x26')][_0x7721('0x27')]===0x1f4){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669[_0x7721('0x26')]['message']);return _0x25a628(_0x20f669[_0x7721('0x26')][_0x7721('0x28')]);}logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669['error'][_0x7721('0x28')]);return _0x5ed54(_0x20f669['error'][_0x7721('0x28')]);}else{logger[_0x7721('0x29')](_0x7721('0x21'),_0x534f1b,_0x7721('0x24'));_0x5ed54(_0x20f669[_0x7721('0x2a')][_0x7721('0x28')]);}})[_0x7721('0x2b')](function(_0x5b4d74){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x5b4d74);_0x25a628(_0x5b4d74);});});}function respondWithStatusCode(_0x125564,_0x1f67c7){_0x1f67c7=_0x1f67c7||0xcc;return function(_0x40d550){if(_0x40d550){return _0x125564[_0x7721('0x2c')](_0x1f67c7);}return _0x125564[_0x7721('0x2d')](_0x1f67c7)[_0x7721('0x2e')]();};}function respondWithResult(_0x40f367,_0x52316e){_0x52316e=_0x52316e||0xc8;return function(_0x258ddf){if(_0x258ddf){return _0x40f367['status'](_0x52316e)['json'](_0x258ddf);}};}function respondWithFilteredResult(_0x315202,_0x343c19){return function(_0x53c904){if(_0x53c904){var _0x158d98=_0x53c904[_0x7721('0x2f')],_0x1ea4d=_0x343c19['offset'],_0x37b9f0=_0x343c19[_0x7721('0x30')]+_0x343c19[_0x7721('0x31')],_0xd7d703;if(_0x37b9f0>=_0x158d98){_0x37b9f0=_0x158d98;_0xd7d703=0xc8;}else{_0xd7d703=0xce;}_0x315202['status'](_0xd7d703);return _0x315202['set'](_0x7721('0x32'),_0x1ea4d+'-'+_0x37b9f0+'/'+_0x158d98)[_0x7721('0x33')](_0x53c904);}return null;};}function patchUpdates(_0x48f329){return function(_0x46f772){try{jsonpatch[_0x7721('0x34')](_0x46f772,_0x48f329,!![]);}catch(_0x382821){return BPromise['reject'](_0x382821);}return _0x46f772[_0x7721('0x35')]();};}function saveUpdates(_0x1ff31b,_0x1492d4){return function(_0x3f15e2){if(_0x3f15e2){return _0x3f15e2[_0x7721('0x36')](_0x1ff31b)['then'](function(_0x195ffb){return _0x195ffb;});}return null;};}function removeEntity(_0x3e4e56,_0xb2386d){return function(_0x5c5b33){if(_0x5c5b33){return _0x5c5b33[_0x7721('0x37')]()[_0x7721('0x38')](function(){_0x3e4e56['status'](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x5ce026,_0x2d6ba0){return function(_0x326c50){if(!_0x326c50){_0x5ce026[_0x7721('0x2c')](0x194);}return _0x326c50;};}function handleError(_0x1d894b,_0x1c84c0){_0x1c84c0=_0x1c84c0||0x1f4;return function(_0x13c635){logger[_0x7721('0x26')](_0x13c635[_0x7721('0x39')]);if(_0x13c635[_0x7721('0x3a')]){delete _0x13c635[_0x7721('0x3a')];}_0x1d894b[_0x7721('0x2d')](_0x1c84c0)['send'](_0x13c635);};}exports[_0x7721('0x3b')]=function(_0x5e6663,_0x212384){var _0x35614c={},_0x7942f7={},_0x1d03de={'count':0x0,'rows':[]};var _0x3968f3=_[_0x7721('0x3c')](db['ZendeskConfiguration']['rawAttributes'],function(_0x4cadef){return{'name':_0x4cadef['fieldName'],'type':_0x4cadef[_0x7721('0x3d')][_0x7721('0x3e')]};});_0x7942f7[_0x7721('0x3f')]=_[_0x7721('0x3c')](_0x3968f3,'name');_0x7942f7[_0x7721('0x40')]=_['keys'](_0x5e6663[_0x7721('0x40')]);_0x7942f7[_0x7721('0x41')]=_['intersection'](_0x7942f7[_0x7721('0x3f')],_0x7942f7[_0x7721('0x40')]);_0x35614c['attributes']=_['intersection'](_0x7942f7[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x5e6663[_0x7721('0x40')][_0x7721('0x42')]));_0x35614c['attributes']=_0x35614c[_0x7721('0x43')][_0x7721('0x44')]?_0x35614c[_0x7721('0x43')]:_0x7942f7[_0x7721('0x3f')];if(!_0x5e6663[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x35614c['limit']=qs[_0x7721('0x31')](_0x5e6663['query'][_0x7721('0x31')]);_0x35614c[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e6663['query'][_0x7721('0x30')]);}_0x35614c[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e6663['query'][_0x7721('0x47')]);_0x35614c[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e6663[_0x7721('0x40')],_0x7942f7[_0x7721('0x41')]));if(_0x5e6663[_0x7721('0x40')]['filter']){_0x35614c['where']=_[_0x7721('0x4a')](_0x35614c[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x3968f3,function(_0x39a3ad){if(_0x39a3ad[_0x7721('0x3d')]!==_0x7721('0x4b')){var _0x1d2ea5={};_0x1d2ea5[_0x39a3ad[_0x7721('0x3a')]]={'$like':'%'+_0x5e6663[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1d2ea5;}})});}_0x35614c=_['merge']({},_0x35614c,_0x5e6663['options']);var _0x5ed70d={'where':_0x35614c[_0x7721('0x48')]};return db[_0x7721('0x4d')][_0x7721('0x2f')](_0x5ed70d)['then'](function(_0x30107e){_0x1d03de[_0x7721('0x2f')]=_0x30107e;if(_0x5e6663['query'][_0x7721('0x4e')]){_0x35614c['include']=[{'all':!![]}];}return db[_0x7721('0x4d')]['findAll'](_0x35614c);})[_0x7721('0x38')](function(_0x196be4){_0x1d03de[_0x7721('0x4f')]=_0x196be4;return _0x1d03de;})['then'](respondWithFilteredResult(_0x212384,_0x35614c))[_0x7721('0x2b')](handleError(_0x212384,null));};exports[_0x7721('0x50')]=function(_0x499381,_0x223d93){var _0x1196c2={'raw':![],'where':{'id':_0x499381['params']['id']}},_0xf88e8c={};_0xf88e8c[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x4d')][_0x7721('0x51')]);_0xf88e8c[_0x7721('0x40')]=_[_0x7721('0x52')](_0x499381[_0x7721('0x40')]);_0xf88e8c[_0x7721('0x41')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],_0xf88e8c[_0x7721('0x40')]);_0x1196c2[_0x7721('0x43')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x499381[_0x7721('0x40')][_0x7721('0x42')]));_0x1196c2['attributes']=_0x1196c2[_0x7721('0x43')][_0x7721('0x44')]?_0x1196c2[_0x7721('0x43')]:_0xf88e8c[_0x7721('0x3f')];if(_0x499381[_0x7721('0x40')][_0x7721('0x4e')]){_0x1196c2[_0x7721('0x54')]=[{'all':!![]}];}_0x1196c2=_['merge']({},_0x1196c2,_0x499381[_0x7721('0x55')]);return db[_0x7721('0x4d')][_0x7721('0x56')](_0x1196c2)[_0x7721('0x38')](handleEntityNotFound(_0x223d93,null))[_0x7721('0x38')](respondWithResult(_0x223d93,null))[_0x7721('0x2b')](handleError(_0x223d93,null));};exports[_0x7721('0x57')]=function(_0x33287d,_0x11b300){return db[_0x7721('0x4d')][_0x7721('0x57')](_0x33287d['body'],{})[_0x7721('0x38')](respondWithResult(_0x11b300,0xc9))[_0x7721('0x2b')](handleError(_0x11b300,null));};exports[_0x7721('0x36')]=function(_0x2ee3c0,_0x15ed3b){if(_0x2ee3c0[_0x7721('0x58')]['id']){delete _0x2ee3c0[_0x7721('0x58')]['id'];}return db[_0x7721('0x4d')][_0x7721('0x56')]({'where':{'id':_0x2ee3c0[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x15ed3b,null))[_0x7721('0x38')](saveUpdates(_0x2ee3c0[_0x7721('0x58')],null))[_0x7721('0x38')](respondWithResult(_0x15ed3b,null))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports['destroy']=function(_0x50e9e9,_0x4e112e){return db[_0x7721('0x4d')]['find']({'where':{'id':_0x50e9e9['params']['id']}})['then'](handleEntityNotFound(_0x4e112e,null))['then'](removeEntity(_0x4e112e,null))[_0x7721('0x2b')](handleError(_0x4e112e,null));};exports[_0x7721('0x5a')]=function(_0x13f254,_0x5343a1,_0x5181d7){var _0x5925b7={};var _0x51a3a2={};var _0x484b8e;var _0x24d1dc;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x13f254['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5343a1,null))[_0x7721('0x38')](function(_0x1ff090){if(_0x1ff090){_0x484b8e=_0x1ff090;_0x51a3a2['model']=_[_0x7721('0x52')](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x51a3a2[_0x7721('0x40')]=_[_0x7721('0x52')](_0x13f254[_0x7721('0x40')]);_0x51a3a2[_0x7721('0x41')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],_0x51a3a2[_0x7721('0x40')]);_0x5925b7[_0x7721('0x43')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x13f254[_0x7721('0x40')]['fields']));_0x5925b7[_0x7721('0x43')]=_0x5925b7[_0x7721('0x43')][_0x7721('0x44')]?_0x5925b7[_0x7721('0x43')]:_0x51a3a2['model'];_0x5925b7[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x13f254['query'][_0x7721('0x47')]);_0x5925b7['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x13f254[_0x7721('0x40')],_0x51a3a2[_0x7721('0x41')]));if(_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]){_0x5925b7[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5925b7[_0x7721('0x48')],{'$or':_['map'](_0x5925b7[_0x7721('0x43')],function(_0x24444f){var _0x112033={};_0x112033[_0x24444f]={'$like':'%'+_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x112033;})});}_0x5925b7=_[_0x7721('0x4a')]({},_0x5925b7,_0x13f254[_0x7721('0x55')]);return _0x484b8e['getFields'](_0x5925b7);}})[_0x7721('0x38')](function(_0xb19b84){if(_0xb19b84){_0x24d1dc=_0xb19b84['length'];if(!_0x13f254[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x5925b7[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x13f254[_0x7721('0x40')][_0x7721('0x31')]);_0x5925b7[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x13f254['query'][_0x7721('0x30')]);}return _0x484b8e[_0x7721('0x5a')](_0x5925b7);}})[_0x7721('0x38')](function(_0x5f08cc){if(_0x5f08cc){return _0x5f08cc?{'count':_0x24d1dc,'rows':_0x5f08cc}:null;}})['then'](respondWithResult(_0x5343a1,null))['catch'](handleError(_0x5343a1,null));};exports['getSubjects']=function(_0x5e966f,_0x1fc5f7,_0x2645dd){var _0x580473={};var _0x2d4b3a={};var _0x42f6e9;var _0xbbc86f;return db[_0x7721('0x4d')]['findOne']({'where':{'id':_0x5e966f[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x1fc5f7,null))[_0x7721('0x38')](function(_0x1bea13){if(_0x1bea13){_0x42f6e9=_0x1bea13;_0x2d4b3a[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x2d4b3a[_0x7721('0x40')]=_['keys'](_0x5e966f['query']);_0x2d4b3a[_0x7721('0x41')]=_[_0x7721('0x53')](_0x2d4b3a[_0x7721('0x3f')],_0x2d4b3a[_0x7721('0x40')]);_0x580473[_0x7721('0x43')]=_['intersection'](_0x2d4b3a['model'],qs[_0x7721('0x42')](_0x5e966f[_0x7721('0x40')][_0x7721('0x42')]));_0x580473[_0x7721('0x43')]=_0x580473[_0x7721('0x43')][_0x7721('0x44')]?_0x580473[_0x7721('0x43')]:_0x2d4b3a['model'];_0x580473[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e966f[_0x7721('0x40')]['sort']);_0x580473[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e966f[_0x7721('0x40')],_0x2d4b3a['filters']));if(_0x5e966f['query'][_0x7721('0x4c')]){_0x580473[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x580473[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x580473[_0x7721('0x43')],function(_0x59e80c){var _0x3855d5={};_0x3855d5[_0x59e80c]={'$like':'%'+_0x5e966f[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x3855d5;})});}_0x580473=_['merge']({},_0x580473,_0x5e966f[_0x7721('0x55')]);return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0xc20188){if(_0xc20188){_0xbbc86f=_0xc20188[_0x7721('0x44')];if(!_0x5e966f['query'][_0x7721('0x5d')]('nolimit')){_0x580473[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x5e966f[_0x7721('0x40')][_0x7721('0x31')]);_0x580473[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e966f[_0x7721('0x40')][_0x7721('0x30')]);}return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0x2c74d8){if(_0x2c74d8){return _0x2c74d8?{'count':_0xbbc86f,'rows':_0x2c74d8}:null;}})['then'](respondWithResult(_0x1fc5f7,null))[_0x7721('0x2b')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x5e')]=function(_0x39194e,_0x5eec29,_0x94af20){var _0x26b2cc={};var _0x139517={};var _0xc9761e;var _0xcd9f0d;return db['ZendeskConfiguration'][_0x7721('0x5f')]({'where':{'id':_0x39194e[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5eec29,null))[_0x7721('0x38')](function(_0x30326d){if(_0x30326d){_0xc9761e=_0x30326d;_0x139517[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x139517['query']=_[_0x7721('0x52')](_0x39194e['query']);_0x139517[_0x7721('0x41')]=_[_0x7721('0x53')](_0x139517['model'],_0x139517[_0x7721('0x40')]);_0x26b2cc['attributes']=_['intersection'](_0x139517['model'],qs[_0x7721('0x42')](_0x39194e[_0x7721('0x40')][_0x7721('0x42')]));_0x26b2cc['attributes']=_0x26b2cc['attributes']['length']?_0x26b2cc[_0x7721('0x43')]:_0x139517[_0x7721('0x3f')];_0x26b2cc[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x39194e[_0x7721('0x40')][_0x7721('0x47')]);_0x26b2cc['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x39194e[_0x7721('0x40')],_0x139517[_0x7721('0x41')]));if(_0x39194e[_0x7721('0x40')][_0x7721('0x4c')]){_0x26b2cc[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x26b2cc[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x26b2cc[_0x7721('0x43')],function(_0x368dbb){var _0x58429d={};_0x58429d[_0x368dbb]={'$like':'%'+_0x39194e['query'][_0x7721('0x4c')]+'%'};return _0x58429d;})});}_0x26b2cc=_[_0x7721('0x4a')]({},_0x26b2cc,_0x39194e['options']);return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x4e3c93){if(_0x4e3c93){_0xcd9f0d=_0x4e3c93[_0x7721('0x44')];if(!_0x39194e['query']['hasOwnProperty'](_0x7721('0x45'))){_0x26b2cc[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x39194e[_0x7721('0x40')][_0x7721('0x31')]);_0x26b2cc['offset']=qs[_0x7721('0x30')](_0x39194e[_0x7721('0x40')][_0x7721('0x30')]);}return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x52fcc1){if(_0x52fcc1){return _0x52fcc1?{'count':_0xcd9f0d,'rows':_0x52fcc1}:null;}})[_0x7721('0x38')](respondWithResult(_0x5eec29,null))[_0x7721('0x2b')](handleError(_0x5eec29,null));};exports['getTags']=function(_0x2005d1,_0x13dc8a,_0x58f7b1){var _0x5b76e3={};var _0x2dbb6d={};var _0x1b68a7;var _0x606b4b;return db[_0x7721('0x4d')][_0x7721('0x5f')]({'where':{'id':_0x2005d1[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x13dc8a,null))[_0x7721('0x38')](function(_0x59de30){if(_0x59de30){_0x1b68a7=_0x59de30;_0x2dbb6d[_0x7721('0x3f')]=_[_0x7721('0x52')](db[_0x7721('0x60')][_0x7721('0x51')]);_0x2dbb6d[_0x7721('0x40')]=_[_0x7721('0x52')](_0x2005d1[_0x7721('0x40')]);_0x2dbb6d['filters']=_[_0x7721('0x53')](_0x2dbb6d[_0x7721('0x3f')],_0x2dbb6d['query']);_0x5b76e3[_0x7721('0x43')]=_[_0x7721('0x53')](_0x2dbb6d[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x2005d1[_0x7721('0x40')][_0x7721('0x42')]));_0x5b76e3[_0x7721('0x43')]=_0x5b76e3[_0x7721('0x43')][_0x7721('0x44')]?_0x5b76e3[_0x7721('0x43')]:_0x2dbb6d['model'];_0x5b76e3[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x2005d1[_0x7721('0x40')][_0x7721('0x47')]);_0x5b76e3[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x2005d1[_0x7721('0x40')],_0x2dbb6d[_0x7721('0x41')]));if(_0x2005d1[_0x7721('0x40')][_0x7721('0x4c')]){_0x5b76e3[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5b76e3[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x5b76e3[_0x7721('0x43')],function(_0xea9824){var _0x1fb651={};_0x1fb651[_0xea9824]={'$like':'%'+_0x2005d1[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1fb651;})});}_0x5b76e3=_['merge']({},_0x5b76e3,_0x2005d1[_0x7721('0x55')]);return _0x1b68a7['getTags'](_0x5b76e3);}})[_0x7721('0x38')](function(_0x2af5f5){if(_0x2af5f5){_0x606b4b=_0x2af5f5[_0x7721('0x44')];if(!_0x2005d1[_0x7721('0x40')][_0x7721('0x5d')]('nolimit')){_0x5b76e3['limit']=qs['limit'](_0x2005d1['query'][_0x7721('0x31')]);_0x5b76e3[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x2005d1[_0x7721('0x40')][_0x7721('0x30')]);}return _0x1b68a7['getTags'](_0x5b76e3);}})[_0x7721('0x38')](function(_0x501a11){if(_0x501a11){return _0x501a11?{'count':_0x606b4b,'rows':_0x501a11}:null;}})[_0x7721('0x38')](respondWithResult(_0x13dc8a,null))[_0x7721('0x2b')](handleError(_0x13dc8a,null));};exports[_0x7721('0x61')]=function(_0x11d5a7,_0xf061eb,_0x2b0c22){if(_0x11d5a7['body']['id']){delete _0x11d5a7[_0x7721('0x58')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x11d5a7[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0xf061eb,null))[_0x7721('0x38')](function(_0x357b78){if(_0x357b78){return _0x357b78[_0x7721('0x61')](_0x11d5a7['body'][_0x7721('0x62')]||[]);}return null;})[_0x7721('0x38')](respondWithResult(_0xf061eb,null))[_0x7721('0x2b')](handleError(_0xf061eb,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index f9ad53e..e8b14a8 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 _0x7a4e=['request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','bluebird'];(function(_0x5986ad,_0x3745e9){var _0x42e923=function(_0x374215){while(--_0x374215){_0x5986ad['push'](_0x5986ad['shift']());}};_0x42e923(++_0x3745e9);}(_0x7a4e,0x14e));var _0xe7a4=function(_0x6d0c3e,_0xbc2aed){_0x6d0c3e=_0x6d0c3e-0x0;var _0x2895ce=_0x7a4e[_0x6d0c3e];return _0x2895ce;};'use strict';var _=require('lodash');var util=require(_0xe7a4('0x0'));var logger=require(_0xe7a4('0x1'))(_0xe7a4('0x2'));var moment=require('moment');var BPromise=require(_0xe7a4('0x3'));var rp=require(_0xe7a4('0x4'));var fs=require('fs');var path=require(_0xe7a4('0x5'));var rimraf=require(_0xe7a4('0x6'));var config=require(_0xe7a4('0x7'));var attributes=require(_0xe7a4('0x8'));module[_0xe7a4('0x9')]=function(_0xa4d01d,_0xe872fc){return _0xa4d01d[_0xe7a4('0xa')](_0xe7a4('0xb'),attributes,{'tableName':_0xe7a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3da6=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','api'];(function(_0x4d7c4e,_0x4b2605){var _0x470667=function(_0x1109a6){while(--_0x1109a6){_0x4d7c4e['push'](_0x4d7c4e['shift']());}};_0x470667(++_0x4b2605);}(_0x3da6,0xa6));var _0x63da=function(_0x22e690,_0x5f570e){_0x22e690=_0x22e690-0x0;var _0x2b515f=_0x3da6[_0x22e690];return _0x2b515f;};'use strict';var _=require(_0x63da('0x0'));var util=require('util');var logger=require(_0x63da('0x1'))(_0x63da('0x2'));var moment=require(_0x63da('0x3'));var BPromise=require(_0x63da('0x4'));var rp=require(_0x63da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63da('0x6'));var config=require(_0x63da('0x7'));var attributes=require(_0x63da('0x8'));module[_0x63da('0x9')]=function(_0x3e49f6,_0x243f38){return _0x3e49f6[_0x63da('0xa')](_0x63da('0xb'),attributes,{'tableName':_0x63da('0xc'),'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 335b05b..11c7bfc 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 _0x0c09=['message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1ddb32,_0x42f48b){var _0x5b5036=function(_0x51f50e){while(--_0x51f50e){_0x1ddb32['push'](_0x1ddb32['shift']());}};_0x5b5036(++_0x42f48b);}(_0x0c09,0xfe));var _0x90c0=function(_0x4c34f7,_0x343962){_0x4c34f7=_0x4c34f7-0x0;var _0x43f39d=_0x0c09[_0x4c34f7];return _0x43f39d;};'use strict';var _=require(_0x90c0('0x0'));var util=require(_0x90c0('0x1'));var moment=require('moment');var BPromise=require(_0x90c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90c0('0x3'));var db=require(_0x90c0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x90c0('0x5'))(_0x90c0('0x6'));var config=require(_0x90c0('0x7'));var jayson=require(_0x90c0('0x8'));var client=jayson[_0x90c0('0x9')][_0x90c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b3d02,_0x39dac7,_0x15611c){return new BPromise(function(_0x58de0a,_0x21d3ea){return client[_0x90c0('0xb')](_0x5b3d02,_0x15611c)[_0x90c0('0xc')](function(_0x36434f){logger[_0x90c0('0xd')](_0x90c0('0xe'),_0x39dac7,'request\x20sent');logger['debug'](_0x90c0('0xf'),_0x39dac7,'request\x20sent',JSON[_0x90c0('0x10')](_0x36434f));if(_0x36434f['error']){if(_0x36434f[_0x90c0('0x11')][_0x90c0('0x12')]===0x1f4){logger[_0x90c0('0x11')](_0x90c0('0xe'),_0x39dac7,_0x36434f[_0x90c0('0x11')]['message']);return _0x21d3ea(_0x36434f['error'][_0x90c0('0x13')]);}logger[_0x90c0('0x11')](_0x90c0('0xe'),_0x39dac7,_0x36434f['error']['message']);return _0x58de0a(_0x36434f[_0x90c0('0x11')][_0x90c0('0x13')]);}else{logger[_0x90c0('0xd')](_0x90c0('0xe'),_0x39dac7,'request\x20sent');_0x58de0a(_0x36434f[_0x90c0('0x14')][_0x90c0('0x13')]);}})['catch'](function(_0x54a13f){logger[_0x90c0('0x11')](_0x90c0('0xe'),_0x39dac7,_0x54a13f);_0x21d3ea(_0x54a13f);});});} \ No newline at end of file +var _0xfed6=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch'];(function(_0x1842db,_0x1b19ef){var _0x214337=function(_0x2e9faa){while(--_0x2e9faa){_0x1842db['push'](_0x1842db['shift']());}};_0x214337(++_0x1b19ef);}(_0xfed6,0x140));var _0x6fed=function(_0x1586c6,_0x59e7da){_0x1586c6=_0x1586c6-0x0;var _0x957ef1=_0xfed6[_0x1586c6];return _0x957ef1;};'use strict';var _=require('lodash');var util=require(_0x6fed('0x0'));var moment=require('moment');var BPromise=require(_0x6fed('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fed('0x2'))['db'];var utils=require(_0x6fed('0x3'));var logger=require(_0x6fed('0x4'))(_0x6fed('0x5'));var config=require(_0x6fed('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6fed('0x7')][_0x6fed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22726f,_0x2cbb77,_0x34b5e9){return new BPromise(function(_0x2ca5b4,_0x82785){return client[_0x6fed('0x9')](_0x22726f,_0x34b5e9)['then'](function(_0x4f8ef4){logger['info'](_0x6fed('0xa'),_0x2cbb77,_0x6fed('0xb'));logger[_0x6fed('0xc')](_0x6fed('0xd'),_0x2cbb77,_0x6fed('0xb'),JSON['stringify'](_0x4f8ef4));if(_0x4f8ef4['error']){if(_0x4f8ef4['error'][_0x6fed('0xe')]===0x1f4){logger[_0x6fed('0xf')](_0x6fed('0xa'),_0x2cbb77,_0x4f8ef4[_0x6fed('0xf')][_0x6fed('0x10')]);return _0x82785(_0x4f8ef4['error'][_0x6fed('0x10')]);}logger[_0x6fed('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2cbb77,_0x4f8ef4[_0x6fed('0xf')][_0x6fed('0x10')]);return _0x2ca5b4(_0x4f8ef4[_0x6fed('0xf')][_0x6fed('0x10')]);}else{logger[_0x6fed('0x11')](_0x6fed('0xa'),_0x2cbb77,_0x6fed('0xb'));_0x2ca5b4(_0x4f8ef4[_0x6fed('0x12')][_0x6fed('0x10')]);}})[_0x6fed('0x13')](function(_0x28e01a){logger['error'](_0x6fed('0xa'),_0x2cbb77,_0x28e01a);_0x82785(_0x28e01a);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index fbf0e60..83e2041 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 _0x6e48=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x18b52,_0xc55fed){var _0x4b1137=function(_0x526d14){while(--_0x526d14){_0x18b52['push'](_0x18b52['shift']());}};_0x4b1137(++_0xc55fed);}(_0x6e48,0x16e));var _0x86e4=function(_0x24d280,_0x2dcbf4){_0x24d280=_0x24d280-0x0;var _0x4028f6=_0x6e48[_0x24d280];return _0x4028f6;};'use strict';var multer=require('multer');var util=require(_0x86e4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x86e4('0x1'));var router=express[_0x86e4('0x2')]();var auth=require(_0x86e4('0x3'));var interaction=require(_0x86e4('0x4'));var config=require(_0x86e4('0x5'));var controller=require(_0x86e4('0x6'));router[_0x86e4('0x7')]('/',auth[_0x86e4('0x8')](),controller[_0x86e4('0x9')]);router[_0x86e4('0x7')](_0x86e4('0xa'),auth[_0x86e4('0x8')](),controller[_0x86e4('0xb')]);router[_0x86e4('0xc')]('/',auth[_0x86e4('0x8')](),controller[_0x86e4('0xd')]);router[_0x86e4('0xe')]('/:id',auth[_0x86e4('0x8')](),controller[_0x86e4('0xf')]);router['delete']('/:id',auth[_0x86e4('0x8')](),controller[_0x86e4('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6f5a=['express','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','update','delete','multer','util','path'];(function(_0x1f8a5a,_0x407a11){var _0x5543a4=function(_0x2d5ae6){while(--_0x2d5ae6){_0x1f8a5a['push'](_0x1f8a5a['shift']());}};_0x5543a4(++_0x407a11);}(_0x6f5a,0x1cb));var _0xa6f5=function(_0xb68a41,_0xc75eb0){_0xb68a41=_0xb68a41-0x0;var _0x3da451=_0x6f5a[_0xb68a41];return _0x3da451;};'use strict';var multer=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var path=require(_0xa6f5('0x2'));var timeout=require('connect-timeout');var express=require(_0xa6f5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa6f5('0x4'));var config=require(_0xa6f5('0x5'));var controller=require(_0xa6f5('0x6'));router[_0xa6f5('0x7')]('/',auth[_0xa6f5('0x8')](),controller['index']);router[_0xa6f5('0x7')](_0xa6f5('0x9'),auth['isAuthenticated'](),controller[_0xa6f5('0xa')]);router[_0xa6f5('0xb')]('/',auth[_0xa6f5('0x8')](),controller['create']);router['put'](_0xa6f5('0x9'),auth[_0xa6f5('0x8')](),controller[_0xa6f5('0xc')]);router[_0xa6f5('0xd')](_0xa6f5('0x9'),auth[_0xa6f5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index ba154d9..b885956 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 _0xeb0d=['ENUM','BOOLEAN','sequelize','variable','customVariable','string','STRING'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x4f03d6,_0x53ac1b){_0x4f03d6=_0x4f03d6-0x0;var _0x3be49e=_0xeb0d[_0x4f03d6];return _0x3be49e;};'use strict';var Sequelize=require(_0xdeb0('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xdeb0('0x1'),_0xdeb0('0x2'),'keyValue'),'defaultValue':_0xdeb0('0x3')},'content':{'type':Sequelize[_0xdeb0('0x4')]},'key':{'type':Sequelize[_0xdeb0('0x4')]},'keyType':{'type':Sequelize[_0xdeb0('0x5')](_0xdeb0('0x3'),_0xdeb0('0x1'),_0xdeb0('0x2'))},'keyContent':{'type':Sequelize[_0xdeb0('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdeb0('0x4')]},'customField':{'type':Sequelize[_0xdeb0('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf3cd=['customVariable','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0xf3cd[_0x3f59b1];return _0x11d2e8;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'type':{'type':Sequelize[_0xdf3c('0x2')](_0xdf3c('0x3'),_0xdf3c('0x4'),_0xdf3c('0x5'),'keyValue'),'defaultValue':_0xdf3c('0x3')},'content':{'type':Sequelize[_0xdf3c('0x6')]},'key':{'type':Sequelize[_0xdf3c('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xdf3c('0x3'),_0xdf3c('0x4'),_0xdf3c('0x5'))},'keyContent':{'type':Sequelize[_0xdf3c('0x6')]},'idField':{'type':Sequelize[_0xdf3c('0x6')]},'nameField':{'type':Sequelize[_0xdf3c('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdf3c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 85effef..8d7ed20 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 _0x1f35=['then','end','sendStatus','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','ZendeskField','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0x1f35,0xfc));var _0x51f3=function(_0x26c9d8,_0x4a4793){_0x26c9d8=_0x26c9d8-0x0;var _0x40fe6f=_0x1f35[_0x26c9d8];return _0x40fe6f;};'use strict';var pdf=require(_0x51f3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51f3('0x1'));var jsonpatch=require(_0x51f3('0x2'));var rp=require('request-promise');var moment=require(_0x51f3('0x3'));var BPromise=require(_0x51f3('0x4'));var Mustache=require(_0x51f3('0x5'));var util=require(_0x51f3('0x6'));var path=require(_0x51f3('0x7'));var sox=require(_0x51f3('0x8'));var csv=require(_0x51f3('0x9'));var ejs=require(_0x51f3('0xa'));var fs=require('fs');var _=require(_0x51f3('0xb'));var squel=require(_0x51f3('0xc'));var crypto=require(_0x51f3('0xd'));var jsforce=require(_0x51f3('0xe'));var deskjs=require(_0x51f3('0xf'));var toCsv=require(_0x51f3('0x9'));var querystring=require(_0x51f3('0x10'));var Papa=require(_0x51f3('0x11'));var Redis=require(_0x51f3('0x12'));var authService=require(_0x51f3('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51f3('0x14'));var logger=require(_0x51f3('0x15'))(_0x51f3('0x16'));var utils=require(_0x51f3('0x17'));var config=require('../../config/environment');var db=require(_0x51f3('0x18'))['db'];function respondWithStatusCode(_0xf4ada1,_0xaaf80f){_0xaaf80f=_0xaaf80f||0xcc;return function(_0xa94e5b){if(_0xa94e5b){return _0xf4ada1['sendStatus'](_0xaaf80f);}return _0xf4ada1['status'](_0xaaf80f)['end']();};}function respondWithResult(_0xa05919,_0x252794){_0x252794=_0x252794||0xc8;return function(_0x23322e){if(_0x23322e){return _0xa05919[_0x51f3('0x19')](_0x252794)[_0x51f3('0x1a')](_0x23322e);}};}function respondWithFilteredResult(_0x3f691d,_0x433bfc){return function(_0x4adf35){if(_0x4adf35){var _0x2c6d05=_0x4adf35[_0x51f3('0x1b')],_0x376864=_0x433bfc[_0x51f3('0x1c')],_0x327a63=_0x433bfc[_0x51f3('0x1c')]+_0x433bfc[_0x51f3('0x1d')],_0x2a4d02;if(_0x327a63>=_0x2c6d05){_0x327a63=_0x2c6d05;_0x2a4d02=0xc8;}else{_0x2a4d02=0xce;}_0x3f691d[_0x51f3('0x19')](_0x2a4d02);return _0x3f691d[_0x51f3('0x1e')](_0x51f3('0x1f'),_0x376864+'-'+_0x327a63+'/'+_0x2c6d05)[_0x51f3('0x1a')](_0x4adf35);}return null;};}function patchUpdates(_0x5eed1a){return function(_0xbaaaf0){try{jsonpatch[_0x51f3('0x20')](_0xbaaaf0,_0x5eed1a,!![]);}catch(_0x2c13a1){return BPromise['reject'](_0x2c13a1);}return _0xbaaaf0[_0x51f3('0x21')]();};}function saveUpdates(_0x287b9d,_0xdda69b){return function(_0x57fb8d){if(_0x57fb8d){return _0x57fb8d[_0x51f3('0x22')](_0x287b9d)['then'](function(_0x4e4a68){return _0x4e4a68;});}return null;};}function removeEntity(_0x7a8b9a,_0x1a77c5){return function(_0x46df65){if(_0x46df65){return _0x46df65[_0x51f3('0x23')]()[_0x51f3('0x24')](function(){_0x7a8b9a[_0x51f3('0x19')](0xcc)[_0x51f3('0x25')]();});}};}function handleEntityNotFound(_0xf5ca44,_0x1431a3){return function(_0x46056a){if(!_0x46056a){_0xf5ca44[_0x51f3('0x26')](0x194);}return _0x46056a;};}function handleError(_0x175280,_0x21757c){_0x21757c=_0x21757c||0x1f4;return function(_0x5bd7ce){logger['error'](_0x5bd7ce['stack']);if(_0x5bd7ce[_0x51f3('0x27')]){delete _0x5bd7ce[_0x51f3('0x27')];}_0x175280['status'](_0x21757c)[_0x51f3('0x28')](_0x5bd7ce);};}exports[_0x51f3('0x29')]=function(_0x44fc9e,_0x28afe5){var _0x46e6a7={},_0x41f3c1={},_0x5ad7a4={'count':0x0,'rows':[]};var _0x207159=_[_0x51f3('0x2a')](db['ZendeskField'][_0x51f3('0x2b')],function(_0xc77a95){return{'name':_0xc77a95['fieldName'],'type':_0xc77a95[_0x51f3('0x2c')]['key']};});_0x41f3c1[_0x51f3('0x2d')]=_[_0x51f3('0x2a')](_0x207159,_0x51f3('0x27'));_0x41f3c1[_0x51f3('0x2e')]=_[_0x51f3('0x2f')](_0x44fc9e['query']);_0x41f3c1[_0x51f3('0x30')]=_[_0x51f3('0x31')](_0x41f3c1[_0x51f3('0x2d')],_0x41f3c1[_0x51f3('0x2e')]);_0x46e6a7[_0x51f3('0x32')]=_['intersection'](_0x41f3c1[_0x51f3('0x2d')],qs[_0x51f3('0x33')](_0x44fc9e[_0x51f3('0x2e')]['fields']));_0x46e6a7['attributes']=_0x46e6a7[_0x51f3('0x32')][_0x51f3('0x34')]?_0x46e6a7[_0x51f3('0x32')]:_0x41f3c1[_0x51f3('0x2d')];if(!_0x44fc9e['query'][_0x51f3('0x35')](_0x51f3('0x36'))){_0x46e6a7[_0x51f3('0x1d')]=qs[_0x51f3('0x1d')](_0x44fc9e[_0x51f3('0x2e')][_0x51f3('0x1d')]);_0x46e6a7[_0x51f3('0x1c')]=qs['offset'](_0x44fc9e[_0x51f3('0x2e')][_0x51f3('0x1c')]);}_0x46e6a7[_0x51f3('0x37')]=qs['sort'](_0x44fc9e[_0x51f3('0x2e')]['sort']);_0x46e6a7[_0x51f3('0x38')]=qs['filters'](_['pick'](_0x44fc9e[_0x51f3('0x2e')],_0x41f3c1[_0x51f3('0x30')]));if(_0x44fc9e[_0x51f3('0x2e')][_0x51f3('0x39')]){_0x46e6a7[_0x51f3('0x38')]=_[_0x51f3('0x3a')](_0x46e6a7[_0x51f3('0x38')],{'$or':_[_0x51f3('0x2a')](_0x207159,function(_0x4b068a){if(_0x4b068a[_0x51f3('0x2c')]!==_0x51f3('0x3b')){var _0x41c109={};_0x41c109[_0x4b068a[_0x51f3('0x27')]]={'$like':'%'+_0x44fc9e[_0x51f3('0x2e')][_0x51f3('0x39')]+'%'};return _0x41c109;}})});}_0x46e6a7=_[_0x51f3('0x3a')]({},_0x46e6a7,_0x44fc9e['options']);var _0x42ae61={'where':_0x46e6a7['where']};return db[_0x51f3('0x3c')][_0x51f3('0x1b')](_0x42ae61)[_0x51f3('0x24')](function(_0x2d20b1){_0x5ad7a4[_0x51f3('0x1b')]=_0x2d20b1;if(_0x44fc9e[_0x51f3('0x2e')]['includeAll']){_0x46e6a7[_0x51f3('0x3d')]=[{'all':!![]}];}return db[_0x51f3('0x3c')][_0x51f3('0x3e')](_0x46e6a7);})[_0x51f3('0x24')](function(_0x1317fa){_0x5ad7a4[_0x51f3('0x3f')]=_0x1317fa;return _0x5ad7a4;})['then'](respondWithFilteredResult(_0x28afe5,_0x46e6a7))[_0x51f3('0x40')](handleError(_0x28afe5,null));};exports[_0x51f3('0x41')]=function(_0x26c2c7,_0x4ef454){var _0x112989={'raw':!![],'where':{'id':_0x26c2c7[_0x51f3('0x42')]['id']}},_0xf58427={};_0xf58427[_0x51f3('0x2d')]=_[_0x51f3('0x2f')](db[_0x51f3('0x3c')][_0x51f3('0x2b')]);_0xf58427[_0x51f3('0x2e')]=_[_0x51f3('0x2f')](_0x26c2c7[_0x51f3('0x2e')]);_0xf58427['filters']=_[_0x51f3('0x31')](_0xf58427['model'],_0xf58427['query']);_0x112989[_0x51f3('0x32')]=_[_0x51f3('0x31')](_0xf58427[_0x51f3('0x2d')],qs[_0x51f3('0x33')](_0x26c2c7['query'][_0x51f3('0x33')]));_0x112989[_0x51f3('0x32')]=_0x112989[_0x51f3('0x32')][_0x51f3('0x34')]?_0x112989[_0x51f3('0x32')]:_0xf58427['model'];if(_0x26c2c7[_0x51f3('0x2e')][_0x51f3('0x43')]){_0x112989[_0x51f3('0x3d')]=[{'all':!![]}];}_0x112989=_[_0x51f3('0x3a')]({},_0x112989,_0x26c2c7[_0x51f3('0x44')]);return db[_0x51f3('0x3c')][_0x51f3('0x45')](_0x112989)['then'](handleEntityNotFound(_0x4ef454,null))[_0x51f3('0x24')](respondWithResult(_0x4ef454,null))['catch'](handleError(_0x4ef454,null));};exports[_0x51f3('0x46')]=function(_0x33d631,_0x2121e0){return db[_0x51f3('0x3c')][_0x51f3('0x46')](_0x33d631['body'],{})[_0x51f3('0x24')](respondWithResult(_0x2121e0,0xc9))[_0x51f3('0x40')](handleError(_0x2121e0,null));};exports['update']=function(_0x134d5e,_0x51d30d){if(_0x134d5e['body']['id']){delete _0x134d5e[_0x51f3('0x47')]['id'];}return db[_0x51f3('0x3c')]['find']({'where':{'id':_0x134d5e['params']['id']}})[_0x51f3('0x24')](handleEntityNotFound(_0x51d30d,null))[_0x51f3('0x24')](saveUpdates(_0x134d5e[_0x51f3('0x47')],null))[_0x51f3('0x24')](respondWithResult(_0x51d30d,null))[_0x51f3('0x40')](handleError(_0x51d30d,null));};exports[_0x51f3('0x23')]=function(_0x5edc00,_0x3ada95){return db[_0x51f3('0x3c')]['find']({'where':{'id':_0x5edc00[_0x51f3('0x42')]['id']}})[_0x51f3('0x24')](handleEntityNotFound(_0x3ada95,null))[_0x51f3('0x24')](removeEntity(_0x3ada95,null))[_0x51f3('0x40')](handleError(_0x3ada95,null));}; \ No newline at end of file +var _0x048f=['options','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','apply','reject','save','update','then','destroy','stack','name','index','ZendeskField','fieldName','type','key','map','keys','query','model','fields','attributes','hasOwnProperty','nolimit','offset','order','pick','filters','filter','where','includeAll','include','findAll','rows','show','rawAttributes','intersection','length'];(function(_0x1b8635,_0x96184e){var _0x257528=function(_0x49a1b9){while(--_0x49a1b9){_0x1b8635['push'](_0x1b8635['shift']());}};_0x257528(++_0x96184e);}(_0x048f,0x12e));var _0xf048=function(_0xf0e043,_0x2ee4ab){_0xf0e043=_0xf0e043-0x0;var _0x50aa76=_0x048f[_0xf0e043];return _0x50aa76;};'use strict';var pdf=require(_0xf048('0x0'));var emlformat=require(_0xf048('0x1'));var rimraf=require(_0xf048('0x2'));var zipdir=require(_0xf048('0x3'));var jsonpatch=require(_0xf048('0x4'));var rp=require(_0xf048('0x5'));var moment=require(_0xf048('0x6'));var BPromise=require(_0xf048('0x7'));var Mustache=require(_0xf048('0x8'));var util=require(_0xf048('0x9'));var path=require(_0xf048('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf048('0xb'));var fs=require('fs');var _=require(_0xf048('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf048('0xd'));var deskjs=require(_0xf048('0xe'));var toCsv=require(_0xf048('0xf'));var querystring=require('querystring');var Papa=require(_0xf048('0x10'));var Redis=require(_0xf048('0x11'));var authService=require(_0xf048('0x12'));var qs=require(_0xf048('0x13'));var as=require(_0xf048('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf048('0x15'))(_0xf048('0x16'));var utils=require(_0xf048('0x17'));var config=require(_0xf048('0x18'));var db=require(_0xf048('0x19'))['db'];function respondWithStatusCode(_0x29f52c,_0x45c4ed){_0x45c4ed=_0x45c4ed||0xcc;return function(_0x496836){if(_0x496836){return _0x29f52c[_0xf048('0x1a')](_0x45c4ed);}return _0x29f52c[_0xf048('0x1b')](_0x45c4ed)[_0xf048('0x1c')]();};}function respondWithResult(_0xed1888,_0x413b28){_0x413b28=_0x413b28||0xc8;return function(_0x54116f){if(_0x54116f){return _0xed1888['status'](_0x413b28)[_0xf048('0x1d')](_0x54116f);}};}function respondWithFilteredResult(_0x3d38c4,_0x18346f){return function(_0xf2ebd2){if(_0xf2ebd2){var _0x4b4270=_0xf2ebd2[_0xf048('0x1e')],_0x504f13=_0x18346f['offset'],_0x7db177=_0x18346f['offset']+_0x18346f[_0xf048('0x1f')],_0x498e07;if(_0x7db177>=_0x4b4270){_0x7db177=_0x4b4270;_0x498e07=0xc8;}else{_0x498e07=0xce;}_0x3d38c4[_0xf048('0x1b')](_0x498e07);return _0x3d38c4[_0xf048('0x20')]('Content-Range',_0x504f13+'-'+_0x7db177+'/'+_0x4b4270)[_0xf048('0x1d')](_0xf2ebd2);}return null;};}function patchUpdates(_0x50e2a4){return function(_0xc40bb8){try{jsonpatch[_0xf048('0x21')](_0xc40bb8,_0x50e2a4,!![]);}catch(_0x424fbb){return BPromise[_0xf048('0x22')](_0x424fbb);}return _0xc40bb8[_0xf048('0x23')]();};}function saveUpdates(_0x27f3ff,_0x663c49){return function(_0x1f8bd9){if(_0x1f8bd9){return _0x1f8bd9[_0xf048('0x24')](_0x27f3ff)[_0xf048('0x25')](function(_0x111c63){return _0x111c63;});}return null;};}function removeEntity(_0xedc668,_0x1ba7ba){return function(_0x2824f5){if(_0x2824f5){return _0x2824f5[_0xf048('0x26')]()[_0xf048('0x25')](function(){_0xedc668[_0xf048('0x1b')](0xcc)[_0xf048('0x1c')]();});}};}function handleEntityNotFound(_0x5b0e32,_0x25c688){return function(_0x5f5d23){if(!_0x5f5d23){_0x5b0e32['sendStatus'](0x194);}return _0x5f5d23;};}function handleError(_0x4c3aac,_0x318575){_0x318575=_0x318575||0x1f4;return function(_0x4ef4c5){logger['error'](_0x4ef4c5[_0xf048('0x27')]);if(_0x4ef4c5['name']){delete _0x4ef4c5[_0xf048('0x28')];}_0x4c3aac[_0xf048('0x1b')](_0x318575)['send'](_0x4ef4c5);};}exports[_0xf048('0x29')]=function(_0x16292a,_0x2ea98a){var _0x3b36f5={},_0x216e41={},_0x452222={'count':0x0,'rows':[]};var _0x2dc48d=_['map'](db[_0xf048('0x2a')]['rawAttributes'],function(_0x2b7c45){return{'name':_0x2b7c45[_0xf048('0x2b')],'type':_0x2b7c45[_0xf048('0x2c')][_0xf048('0x2d')]};});_0x216e41['model']=_[_0xf048('0x2e')](_0x2dc48d,_0xf048('0x28'));_0x216e41['query']=_[_0xf048('0x2f')](_0x16292a[_0xf048('0x30')]);_0x216e41['filters']=_['intersection'](_0x216e41[_0xf048('0x31')],_0x216e41[_0xf048('0x30')]);_0x3b36f5['attributes']=_['intersection'](_0x216e41['model'],qs['fields'](_0x16292a[_0xf048('0x30')][_0xf048('0x32')]));_0x3b36f5[_0xf048('0x33')]=_0x3b36f5[_0xf048('0x33')]['length']?_0x3b36f5[_0xf048('0x33')]:_0x216e41[_0xf048('0x31')];if(!_0x16292a[_0xf048('0x30')][_0xf048('0x34')](_0xf048('0x35'))){_0x3b36f5['limit']=qs['limit'](_0x16292a[_0xf048('0x30')][_0xf048('0x1f')]);_0x3b36f5[_0xf048('0x36')]=qs[_0xf048('0x36')](_0x16292a[_0xf048('0x30')][_0xf048('0x36')]);}_0x3b36f5[_0xf048('0x37')]=qs['sort'](_0x16292a[_0xf048('0x30')]['sort']);_0x3b36f5['where']=qs['filters'](_[_0xf048('0x38')](_0x16292a[_0xf048('0x30')],_0x216e41[_0xf048('0x39')]));if(_0x16292a[_0xf048('0x30')][_0xf048('0x3a')]){_0x3b36f5[_0xf048('0x3b')]=_['merge'](_0x3b36f5['where'],{'$or':_[_0xf048('0x2e')](_0x2dc48d,function(_0xe918e){if(_0xe918e[_0xf048('0x2c')]!=='VIRTUAL'){var _0x4c8b10={};_0x4c8b10[_0xe918e['name']]={'$like':'%'+_0x16292a[_0xf048('0x30')]['filter']+'%'};return _0x4c8b10;}})});}_0x3b36f5=_['merge']({},_0x3b36f5,_0x16292a['options']);var _0x177b32={'where':_0x3b36f5['where']};return db[_0xf048('0x2a')][_0xf048('0x1e')](_0x177b32)[_0xf048('0x25')](function(_0x5cb076){_0x452222[_0xf048('0x1e')]=_0x5cb076;if(_0x16292a[_0xf048('0x30')][_0xf048('0x3c')]){_0x3b36f5[_0xf048('0x3d')]=[{'all':!![]}];}return db['ZendeskField'][_0xf048('0x3e')](_0x3b36f5);})[_0xf048('0x25')](function(_0x19dcef){_0x452222[_0xf048('0x3f')]=_0x19dcef;return _0x452222;})[_0xf048('0x25')](respondWithFilteredResult(_0x2ea98a,_0x3b36f5))['catch'](handleError(_0x2ea98a,null));};exports[_0xf048('0x40')]=function(_0x30c332,_0x4f3e3d){var _0x595bda={'raw':!![],'where':{'id':_0x30c332['params']['id']}},_0x570205={};_0x570205['model']=_['keys'](db[_0xf048('0x2a')][_0xf048('0x41')]);_0x570205[_0xf048('0x30')]=_['keys'](_0x30c332[_0xf048('0x30')]);_0x570205[_0xf048('0x39')]=_[_0xf048('0x42')](_0x570205[_0xf048('0x31')],_0x570205['query']);_0x595bda[_0xf048('0x33')]=_[_0xf048('0x42')](_0x570205[_0xf048('0x31')],qs[_0xf048('0x32')](_0x30c332['query'][_0xf048('0x32')]));_0x595bda[_0xf048('0x33')]=_0x595bda[_0xf048('0x33')][_0xf048('0x43')]?_0x595bda['attributes']:_0x570205[_0xf048('0x31')];if(_0x30c332['query'][_0xf048('0x3c')]){_0x595bda['include']=[{'all':!![]}];}_0x595bda=_['merge']({},_0x595bda,_0x30c332[_0xf048('0x44')]);return db[_0xf048('0x2a')][_0xf048('0x45')](_0x595bda)['then'](handleEntityNotFound(_0x4f3e3d,null))[_0xf048('0x25')](respondWithResult(_0x4f3e3d,null))[_0xf048('0x46')](handleError(_0x4f3e3d,null));};exports[_0xf048('0x47')]=function(_0x220c4b,_0x4f81db){return db[_0xf048('0x2a')][_0xf048('0x47')](_0x220c4b['body'],{})[_0xf048('0x25')](respondWithResult(_0x4f81db,0xc9))[_0xf048('0x46')](handleError(_0x4f81db,null));};exports['update']=function(_0x34d94a,_0x7c1f42){if(_0x34d94a[_0xf048('0x48')]['id']){delete _0x34d94a['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x34d94a[_0xf048('0x49')]['id']}})['then'](handleEntityNotFound(_0x7c1f42,null))[_0xf048('0x25')](saveUpdates(_0x34d94a[_0xf048('0x48')],null))[_0xf048('0x25')](respondWithResult(_0x7c1f42,null))['catch'](handleError(_0x7c1f42,null));};exports[_0xf048('0x26')]=function(_0x4c32ad,_0x469b5d){return db[_0xf048('0x2a')][_0xf048('0x45')]({'where':{'id':_0x4c32ad[_0xf048('0x49')]['id']}})[_0xf048('0x25')](handleEntityNotFound(_0x469b5d,null))[_0xf048('0x25')](removeEntity(_0x469b5d,null))[_0xf048('0x46')](handleError(_0x469b5d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5585e19..58ffcc9 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 _0x66d3=['moment','bluebird','path','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x66d3,0x10f));var _0x366d=function(_0x5595d0,_0x187b3f){_0x5595d0=_0x5595d0-0x0;var _0x2eac8b=_0x66d3[_0x5595d0];return _0x2eac8b;};'use strict';var _=require(_0x366d('0x0'));var util=require('util');var logger=require(_0x366d('0x1'))('api');var moment=require(_0x366d('0x2'));var BPromise=require(_0x366d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x366d('0x4'));var rimraf=require('rimraf');var config=require(_0x366d('0x5'));var attributes=require('./intZendeskField.attributes');module[_0x366d('0x6')]=function(_0x7c355e,_0x316f53){return _0x7c355e[_0x366d('0x7')](_0x366d('0x8'),attributes,{'tableName':_0x366d('0x9'),'paranoid':![],'indexes':[{'name':_0x366d('0xa'),'fields':[_0x366d('0xb'),_0x366d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe130=['bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','idField','FieldId','lodash','util','api','moment'];(function(_0x3df781,_0x232e7d){var _0x31df38=function(_0x198ffa){while(--_0x198ffa){_0x3df781['push'](_0x3df781['shift']());}};_0x31df38(++_0x232e7d);}(_0xe130,0x127));var _0x0e13=function(_0x4b5dfa,_0x2e2e52){_0x4b5dfa=_0x4b5dfa-0x0;var _0x49247c=_0xe130[_0x4b5dfa];return _0x49247c;};'use strict';var _=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var logger=require('../../config/logger')(_0x0e13('0x2'));var moment=require(_0x0e13('0x3'));var BPromise=require(_0x0e13('0x4'));var rp=require(_0x0e13('0x5'));var fs=require('fs');var path=require(_0x0e13('0x6'));var rimraf=require('rimraf');var config=require(_0x0e13('0x7'));var attributes=require(_0x0e13('0x8'));module[_0x0e13('0x9')]=function(_0xcd92e,_0x50a80e){return _0xcd92e[_0x0e13('0xa')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x0e13('0xb'),_0x0e13('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 374adaa..2c95352 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 _0x63df=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x63df,0x111));var _0xf63d=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x63df[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xf63d('0x0'));var util=require(_0xf63d('0x1'));var moment=require('moment');var BPromise=require(_0xf63d('0x2'));var rs=require(_0xf63d('0x3'));var fs=require('fs');var Redis=require(_0xf63d('0x4'));var db=require(_0xf63d('0x5'))['db'];var utils=require(_0xf63d('0x6'));var logger=require(_0xf63d('0x7'))(_0xf63d('0x8'));var config=require(_0xf63d('0x9'));var jayson=require(_0xf63d('0xa'));var client=jayson['client'][_0xf63d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x279ba8,_0x197545,_0x5f5a89){return new BPromise(function(_0x2ebd8d,_0x5a6d87){return client[_0xf63d('0xc')](_0x279ba8,_0x5f5a89)['then'](function(_0x570724){logger['info'](_0xf63d('0xd'),_0x197545,_0xf63d('0xe'));logger[_0xf63d('0xf')](_0xf63d('0x10'),_0x197545,_0xf63d('0xe'),JSON[_0xf63d('0x11')](_0x570724));if(_0x570724[_0xf63d('0x12')]){if(_0x570724['error'][_0xf63d('0x13')]===0x1f4){logger[_0xf63d('0x12')](_0xf63d('0xd'),_0x197545,_0x570724[_0xf63d('0x12')]['message']);return _0x5a6d87(_0x570724[_0xf63d('0x12')][_0xf63d('0x14')]);}logger[_0xf63d('0x12')](_0xf63d('0xd'),_0x197545,_0x570724['error'][_0xf63d('0x14')]);return _0x2ebd8d(_0x570724[_0xf63d('0x12')][_0xf63d('0x14')]);}else{logger['info'](_0xf63d('0xd'),_0x197545,_0xf63d('0xe'));_0x2ebd8d(_0x570724[_0xf63d('0x15')][_0xf63d('0x14')]);}})[_0xf63d('0x16')](function(_0x5b8b71){logger[_0xf63d('0x12')](_0xf63d('0xd'),_0x197545,_0x5b8b71);_0x5a6d87(_0x5b8b71);});});} \ No newline at end of file +var _0x56b9=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x28d38d,_0x55bae2){var _0x46fe9e=function(_0x3bfb4b){while(--_0x3bfb4b){_0x28d38d['push'](_0x28d38d['shift']());}};_0x46fe9e(++_0x55bae2);}(_0x56b9,0x10b));var _0x956b=function(_0x223d4a,_0x250d67){_0x223d4a=_0x223d4a-0x0;var _0x3f19ae=_0x56b9[_0x223d4a];return _0x3f19ae;};'use strict';var _=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var moment=require(_0x956b('0x2'));var BPromise=require(_0x956b('0x3'));var rs=require(_0x956b('0x4'));var fs=require('fs');var Redis=require(_0x956b('0x5'));var db=require(_0x956b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x956b('0x7'))(_0x956b('0x8'));var config=require('../../config/environment');var jayson=require(_0x956b('0x9'));var client=jayson[_0x956b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc6a3e8,_0x21839b,_0x4b5020){return new BPromise(function(_0x46d31c,_0xae3d2){return client[_0x956b('0xb')](_0xc6a3e8,_0x4b5020)[_0x956b('0xc')](function(_0x552493){logger[_0x956b('0xd')](_0x956b('0xe'),_0x21839b,_0x956b('0xf'));logger['debug'](_0x956b('0x10'),_0x21839b,_0x956b('0xf'),JSON['stringify'](_0x552493));if(_0x552493[_0x956b('0x11')]){if(_0x552493[_0x956b('0x11')][_0x956b('0x12')]===0x1f4){logger['error'](_0x956b('0xe'),_0x21839b,_0x552493[_0x956b('0x11')]['message']);return _0xae3d2(_0x552493['error'][_0x956b('0x13')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x21839b,_0x552493['error']['message']);return _0x46d31c(_0x552493['error'][_0x956b('0x13')]);}else{logger[_0x956b('0xd')](_0x956b('0xe'),_0x21839b,_0x956b('0xf'));_0x46d31c(_0x552493[_0x956b('0x14')]['message']);}})[_0x956b('0x15')](function(_0x4c4ca4){logger[_0x956b('0x11')](_0x956b('0xe'),_0x21839b,_0x4c4ca4);_0xae3d2(_0x4c4ca4);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 53463b5..dda63d8 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 _0xf6de=['path','Router','../../components/auth/service','./intZohoAccount.controller','isAuthenticated','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0xc20cc0,_0x94b355){var _0x538980=function(_0x1eb98b){while(--_0x1eb98b){_0xc20cc0['push'](_0xc20cc0['shift']());}};_0x538980(++_0x94b355);}(_0xf6de,0x1e2));var _0xef6d=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0xf6de[_0x59342a];return _0x17abc9;};'use strict';var multer=require(_0xef6d('0x0'));var util=require(_0xef6d('0x1'));var path=require(_0xef6d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xef6d('0x3')]();var auth=require(_0xef6d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef6d('0x5'));router['get']('/',auth[_0xef6d('0x6')](),controller['index']);router[_0xef6d('0x7')]('/:id',auth[_0xef6d('0x6')](),controller[_0xef6d('0x8')]);router['get'](_0xef6d('0x9'),auth[_0xef6d('0x6')](),controller[_0xef6d('0xa')]);router[_0xef6d('0x7')](_0xef6d('0xb'),auth[_0xef6d('0x6')](),controller[_0xef6d('0xc')]);router[_0xef6d('0xd')]('/',auth[_0xef6d('0x6')](),controller[_0xef6d('0xe')]);router[_0xef6d('0xd')](_0xef6d('0x9'),auth[_0xef6d('0x6')](),controller[_0xef6d('0xf')]);router[_0xef6d('0x10')](_0xef6d('0x11'),auth[_0xef6d('0x6')](),controller[_0xef6d('0x12')]);router[_0xef6d('0x13')]('/:id',auth[_0xef6d('0x6')](),controller[_0xef6d('0x14')]);module[_0xef6d('0x15')]=router; \ No newline at end of file +var _0x2e3d=['../../config/environment','./intZohoAccount.controller','get','/:id','isAuthenticated','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x15038d,_0x588926){var _0x21c047=function(_0x55211b){while(--_0x55211b){_0x15038d['push'](_0x15038d['shift']());}};_0x21c047(++_0x588926);}(_0x2e3d,0x1b2));var _0xd2e3=function(_0x1e80e3,_0x41356b){_0x1e80e3=_0x1e80e3-0x0;var _0x52f30a=_0x2e3d[_0x1e80e3];return _0x52f30a;};'use strict';var multer=require(_0xd2e3('0x0'));var util=require(_0xd2e3('0x1'));var path=require('path');var timeout=require(_0xd2e3('0x2'));var express=require(_0xd2e3('0x3'));var router=express[_0xd2e3('0x4')]();var auth=require(_0xd2e3('0x5'));var interaction=require(_0xd2e3('0x6'));var config=require(_0xd2e3('0x7'));var controller=require(_0xd2e3('0x8'));router[_0xd2e3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd2e3('0xa'),auth[_0xd2e3('0xb')](),controller['show']);router[_0xd2e3('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd2e3('0xc')]);router[_0xd2e3('0x9')]('/:id/fields',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0xd')]);router[_0xd2e3('0xe')]('/',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0xf')]);router[_0xd2e3('0xe')](_0xd2e3('0x10'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x11')]);router['put'](_0xd2e3('0xa'),auth['isAuthenticated'](),controller[_0xd2e3('0x12')]);router['delete'](_0xd2e3('0xa'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x13')]);module[_0xd2e3('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 53929f5..01ff6d9 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 _0x9ec6=['STRING','sequelize','exports'];(function(_0x20f496,_0x22005a){var _0x46b703=function(_0x4264b6){while(--_0x4264b6){_0x20f496['push'](_0x20f496['shift']());}};_0x46b703(++_0x22005a);}(_0x9ec6,0x10c));var _0x69ec=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0x9ec6[_0x548d7d];return _0xb1c878;};'use strict';var Sequelize=require(_0x69ec('0x0'));module[_0x69ec('0x1')]={'name':{'type':Sequelize[_0x69ec('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x69ec('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x69ec('0x2')]},'clientSecret':{'type':Sequelize[_0x69ec('0x2')]},'serverUrl':{'type':Sequelize[_0x69ec('0x2')]},'code':{'type':Sequelize[_0x69ec('0x2')]},'refreshToken':{'type':Sequelize[_0x69ec('0x2')]}}; \ No newline at end of file +var _0x8bec=['STRING','sequelize'];(function(_0x388fac,_0x51346c){var _0x330c29=function(_0x1a4731){while(--_0x1a4731){_0x388fac['push'](_0x388fac['shift']());}};_0x330c29(++_0x51346c);}(_0x8bec,0x157));var _0xc8be=function(_0x329ca6,_0x444edb){_0x329ca6=_0x329ca6-0x0;var _0x3b3a57=_0x8bec[_0x329ca6];return _0x3b3a57;};'use strict';var Sequelize=require(_0xc8be('0x0'));module['exports']={'name':{'type':Sequelize[_0xc8be('0x1')]},'description':{'type':Sequelize[_0xc8be('0x1')]},'host':{'type':Sequelize[_0xc8be('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc8be('0x1')]},'clientSecret':{'type':Sequelize[_0xc8be('0x1')]},'serverUrl':{'type':Sequelize[_0xc8be('0x1')]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index d348531..13712d3 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 _0x99b9=['request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','stack','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','find','create','update','body','params','destroy','getConfigurations','findOne','ZohoConfiguration','rawAttributes','sort','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientId','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','Owner','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoAccount,\x20%s,\x20%s'];(function(_0x40e8e7,_0x5892a0){var _0x3adfe4=function(_0x1c31be){while(--_0x1c31be){_0x40e8e7['push'](_0x40e8e7['shift']());}};_0x3adfe4(++_0x5892a0);}(_0x99b9,0x18c));var _0x999b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x99b9[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x999b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x999b('0x1'));var zipdir=require(_0x999b('0x2'));var jsonpatch=require(_0x999b('0x3'));var rp=require(_0x999b('0x4'));var moment=require(_0x999b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x999b('0x6'));var util=require(_0x999b('0x7'));var path=require(_0x999b('0x8'));var sox=require(_0x999b('0x9'));var csv=require(_0x999b('0xa'));var ejs=require(_0x999b('0xb'));var fs=require('fs');var _=require(_0x999b('0xc'));var squel=require(_0x999b('0xd'));var crypto=require('crypto');var jsforce=require(_0x999b('0xe'));var deskjs=require(_0x999b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x999b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x999b('0x11'));var qs=require(_0x999b('0x12'));var as=require(_0x999b('0x13'));var hardwareService=require(_0x999b('0x14'));var logger=require(_0x999b('0x15'))(_0x999b('0x16'));var utils=require('../../config/utils');var config=require(_0x999b('0x17'));var db=require(_0x999b('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client'][_0x999b('0x19')]({'port':0x232a});function checkPasswordPattern(_0x317c30,_0x17914d,_0x118fdd){if(_0x118fdd){var _0x2fe07d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2fe07d[_0x999b('0x1a')](_0x17914d)){return _0x317c30;}else{throw new db[(_0x999b('0x1b'))][(_0x999b('0x1c'))](_0x999b('0x1d'));}}else{return _0x317c30;}}function respondWithRpcPromise(_0x711dd0,_0x148e6f,_0x428bc6,_0x525a92){return new BPromise(function(_0x235528,_0x35dd06){var _0x10d047=_0x525a92||client;return _0x10d047[_0x999b('0x1e')](_0x711dd0,_0x428bc6)[_0x999b('0x1f')](function(_0x510bc3){logger['info'](_0x999b('0x20'),_0x148e6f,_0x999b('0x21'));logger[_0x999b('0x22')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x148e6f,_0x999b('0x21'),JSON[_0x999b('0x23')](_0x510bc3));if(_0x510bc3[_0x999b('0x24')]){if(_0x510bc3['error'][_0x999b('0x25')]===0x1f4){logger[_0x999b('0x24')](_0x999b('0x20'),_0x148e6f,_0x510bc3['error'][_0x999b('0x26')]);return _0x35dd06(_0x510bc3[_0x999b('0x24')]['message']);}logger[_0x999b('0x24')](_0x999b('0x20'),_0x148e6f,_0x510bc3[_0x999b('0x24')][_0x999b('0x26')]);return _0x235528(_0x510bc3[_0x999b('0x24')]['message']);}else{logger[_0x999b('0x27')](_0x999b('0x20'),_0x148e6f,_0x999b('0x21'));_0x235528(_0x510bc3[_0x999b('0x28')][_0x999b('0x26')]);}})['catch'](function(_0x537e23){logger[_0x999b('0x24')](_0x999b('0x20'),_0x148e6f,_0x537e23);_0x35dd06(_0x537e23);});});}function respondWithStatusCode(_0x3bd7fa,_0x1e0dca){_0x1e0dca=_0x1e0dca||0xcc;return function(_0xa2b082){if(_0xa2b082){return _0x3bd7fa[_0x999b('0x29')](_0x1e0dca);}return _0x3bd7fa['status'](_0x1e0dca)[_0x999b('0x2a')]();};}function respondWithResult(_0x26915f,_0x34a228){_0x34a228=_0x34a228||0xc8;return function(_0xf8616a){if(_0xf8616a){return _0x26915f[_0x999b('0x2b')](_0x34a228)[_0x999b('0x2c')](_0xf8616a);}};}function respondWithFilteredResult(_0x376a21,_0x1e4732){return function(_0x107a9a){if(_0x107a9a){var _0x1d24f0=_0x107a9a['count'],_0x50e0fe=_0x1e4732['offset'],_0xa3a3a8=_0x1e4732[_0x999b('0x2d')]+_0x1e4732[_0x999b('0x2e')],_0x257a54;if(_0xa3a3a8>=_0x1d24f0){_0xa3a3a8=_0x1d24f0;_0x257a54=0xc8;}else{_0x257a54=0xce;}_0x376a21['status'](_0x257a54);return _0x376a21[_0x999b('0x2f')](_0x999b('0x30'),_0x50e0fe+'-'+_0xa3a3a8+'/'+_0x1d24f0)[_0x999b('0x2c')](_0x107a9a);}return null;};}function patchUpdates(_0x496892){return function(_0x3bf86c){try{jsonpatch[_0x999b('0x31')](_0x3bf86c,_0x496892,!![]);}catch(_0x2fefb9){return BPromise[_0x999b('0x32')](_0x2fefb9);}return _0x3bf86c[_0x999b('0x33')]();};}function saveUpdates(_0x2ca396,_0x26c1b2){return function(_0x4db4d5){if(_0x4db4d5){return _0x4db4d5['update'](_0x2ca396)[_0x999b('0x1f')](function(_0x59284e){return _0x59284e;});}return null;};}function removeEntity(_0x310df4,_0x16b04a){return function(_0x32090f){if(_0x32090f){return _0x32090f['destroy']()[_0x999b('0x1f')](function(){_0x310df4['status'](0xcc)[_0x999b('0x2a')]();});}};}function handleEntityNotFound(_0x348d79,_0x1815d1){return function(_0x67247b){if(!_0x67247b){_0x348d79[_0x999b('0x29')](0x194);}return _0x67247b;};}function handleError(_0x6ff83d,_0x528bd5){_0x528bd5=_0x528bd5||0x1f4;return function(_0x201d47){logger[_0x999b('0x24')](_0x201d47[_0x999b('0x34')]);if(_0x201d47[_0x999b('0x35')]){delete _0x201d47['name'];}_0x6ff83d[_0x999b('0x2b')](_0x528bd5)[_0x999b('0x36')](_0x201d47);};}exports[_0x999b('0x37')]=function(_0x542bac,_0x48db18){var _0x4f4cfa={},_0x188db1={},_0x380efd={'count':0x0,'rows':[]};var _0x577010=_[_0x999b('0x38')](db[_0x999b('0x39')]['rawAttributes'],function(_0x2dfa6d){return{'name':_0x2dfa6d[_0x999b('0x3a')],'type':_0x2dfa6d[_0x999b('0x3b')][_0x999b('0x3c')]};});_0x188db1[_0x999b('0x3d')]=_[_0x999b('0x38')](_0x577010,_0x999b('0x35'));_0x188db1[_0x999b('0x3e')]=_[_0x999b('0x3f')](_0x542bac[_0x999b('0x3e')]);_0x188db1['filters']=_[_0x999b('0x40')](_0x188db1[_0x999b('0x3d')],_0x188db1[_0x999b('0x3e')]);_0x4f4cfa[_0x999b('0x41')]=_[_0x999b('0x40')](_0x188db1['model'],qs[_0x999b('0x42')](_0x542bac[_0x999b('0x3e')][_0x999b('0x42')]));_0x4f4cfa[_0x999b('0x41')]=_0x4f4cfa[_0x999b('0x41')][_0x999b('0x43')]?_0x4f4cfa[_0x999b('0x41')]:_0x188db1['model'];if(!_0x542bac[_0x999b('0x3e')][_0x999b('0x44')](_0x999b('0x45'))){_0x4f4cfa[_0x999b('0x2e')]=qs[_0x999b('0x2e')](_0x542bac['query']['limit']);_0x4f4cfa[_0x999b('0x2d')]=qs[_0x999b('0x2d')](_0x542bac[_0x999b('0x3e')]['offset']);}_0x4f4cfa[_0x999b('0x46')]=qs['sort'](_0x542bac['query']['sort']);_0x4f4cfa[_0x999b('0x47')]=qs[_0x999b('0x48')](_['pick'](_0x542bac['query'],_0x188db1['filters']));if(_0x542bac[_0x999b('0x3e')][_0x999b('0x49')]){_0x4f4cfa[_0x999b('0x47')]=_['merge'](_0x4f4cfa['where'],{'$or':_[_0x999b('0x38')](_0x577010,function(_0x3b723a){if(_0x3b723a[_0x999b('0x3b')]!==_0x999b('0x4a')){var _0x4a09d4={};_0x4a09d4[_0x3b723a[_0x999b('0x35')]]={'$like':'%'+_0x542bac['query'][_0x999b('0x49')]+'%'};return _0x4a09d4;}})});}_0x4f4cfa=_[_0x999b('0x4b')]({},_0x4f4cfa,_0x542bac[_0x999b('0x4c')]);var _0x27767e={'where':_0x4f4cfa[_0x999b('0x47')]};return db[_0x999b('0x39')]['count'](_0x27767e)[_0x999b('0x1f')](function(_0x3e8843){_0x380efd[_0x999b('0x4d')]=_0x3e8843;if(_0x542bac['query'][_0x999b('0x4e')]){_0x4f4cfa[_0x999b('0x4f')]=[{'all':!![]}];}return db['ZohoAccount'][_0x999b('0x50')](_0x4f4cfa);})['then'](function(_0x4618f5){_0x380efd[_0x999b('0x51')]=_0x4618f5;return _0x380efd;})[_0x999b('0x1f')](respondWithFilteredResult(_0x48db18,_0x4f4cfa))[_0x999b('0x52')](handleError(_0x48db18,null));};exports['show']=function(_0x105bd1,_0x166a15){var _0x3e0d5f={'raw':![],'where':{'id':_0x105bd1['params']['id']}},_0x5071be={};_0x5071be[_0x999b('0x3d')]=_[_0x999b('0x3f')](db[_0x999b('0x39')]['rawAttributes']);_0x5071be[_0x999b('0x3e')]=_['keys'](_0x105bd1[_0x999b('0x3e')]);_0x5071be[_0x999b('0x48')]=_[_0x999b('0x40')](_0x5071be[_0x999b('0x3d')],_0x5071be['query']);_0x3e0d5f[_0x999b('0x41')]=_[_0x999b('0x40')](_0x5071be[_0x999b('0x3d')],qs['fields'](_0x105bd1[_0x999b('0x3e')][_0x999b('0x42')]));_0x3e0d5f[_0x999b('0x41')]=_0x3e0d5f[_0x999b('0x41')]['length']?_0x3e0d5f[_0x999b('0x41')]:_0x5071be[_0x999b('0x3d')];if(_0x105bd1[_0x999b('0x3e')][_0x999b('0x4e')]){_0x3e0d5f['include']=[{'all':!![]}];}_0x3e0d5f=_[_0x999b('0x4b')]({},_0x3e0d5f,_0x105bd1['options']);return db[_0x999b('0x39')][_0x999b('0x53')](_0x3e0d5f)['then'](handleEntityNotFound(_0x166a15,null))[_0x999b('0x1f')](respondWithResult(_0x166a15,null))[_0x999b('0x52')](handleError(_0x166a15,null));};exports[_0x999b('0x54')]=function(_0x132a93,_0x55dd44){return db[_0x999b('0x39')][_0x999b('0x54')](_0x132a93['body'],{})['then'](respondWithResult(_0x55dd44,0xc9))[_0x999b('0x52')](handleError(_0x55dd44,null));};exports[_0x999b('0x55')]=function(_0x24cea8,_0x404a7e){if(_0x24cea8['body']['id']){delete _0x24cea8[_0x999b('0x56')]['id'];}return db[_0x999b('0x39')]['find']({'where':{'id':_0x24cea8[_0x999b('0x57')]['id']}})[_0x999b('0x1f')](handleEntityNotFound(_0x404a7e,null))[_0x999b('0x1f')](saveUpdates(_0x24cea8[_0x999b('0x56')],null))[_0x999b('0x1f')](respondWithResult(_0x404a7e,null))['catch'](handleError(_0x404a7e,null));};exports[_0x999b('0x58')]=function(_0x2fd5ce,_0x48cf3d){return db['ZohoAccount'][_0x999b('0x53')]({'where':{'id':_0x2fd5ce['params']['id']}})['then'](handleEntityNotFound(_0x48cf3d,null))['then'](removeEntity(_0x48cf3d,null))[_0x999b('0x52')](handleError(_0x48cf3d,null));};exports[_0x999b('0x59')]=function(_0x4d46d2,_0xb2bc46,_0x53fdce){var _0x391d7a={};var _0x727a2={};var _0x29f5d6;var _0x3af43c;return db[_0x999b('0x39')][_0x999b('0x5a')]({'where':{'id':_0x4d46d2[_0x999b('0x57')]['id']}})[_0x999b('0x1f')](handleEntityNotFound(_0xb2bc46,null))[_0x999b('0x1f')](function(_0x24bb30){if(_0x24bb30){_0x29f5d6=_0x24bb30;_0x727a2[_0x999b('0x3d')]=_[_0x999b('0x3f')](db[_0x999b('0x5b')][_0x999b('0x5c')]);_0x727a2[_0x999b('0x3e')]=_['keys'](_0x4d46d2[_0x999b('0x3e')]);_0x727a2[_0x999b('0x48')]=_[_0x999b('0x40')](_0x727a2[_0x999b('0x3d')],_0x727a2[_0x999b('0x3e')]);_0x391d7a[_0x999b('0x41')]=_[_0x999b('0x40')](_0x727a2[_0x999b('0x3d')],qs[_0x999b('0x42')](_0x4d46d2[_0x999b('0x3e')][_0x999b('0x42')]));_0x391d7a[_0x999b('0x41')]=_0x391d7a['attributes'][_0x999b('0x43')]?_0x391d7a['attributes']:_0x727a2[_0x999b('0x3d')];_0x391d7a[_0x999b('0x46')]=qs[_0x999b('0x5d')](_0x4d46d2['query'][_0x999b('0x5d')]);_0x391d7a[_0x999b('0x47')]=qs['filters'](_[_0x999b('0x5e')](_0x4d46d2[_0x999b('0x3e')],_0x727a2['filters']));if(_0x4d46d2[_0x999b('0x3e')]['filter']){_0x391d7a['where']=_[_0x999b('0x4b')](_0x391d7a['where'],{'$or':_['map'](_0x391d7a['attributes'],function(_0x5c2bb0){var _0x41e51d={};_0x41e51d[_0x5c2bb0]={'$like':'%'+_0x4d46d2[_0x999b('0x3e')][_0x999b('0x49')]+'%'};return _0x41e51d;})});}_0x391d7a=_[_0x999b('0x4b')]({},_0x391d7a,_0x4d46d2[_0x999b('0x4c')]);return _0x29f5d6[_0x999b('0x59')](_0x391d7a);}})[_0x999b('0x1f')](function(_0x4f3449){if(_0x4f3449){_0x3af43c=_0x4f3449[_0x999b('0x43')];if(!_0x4d46d2[_0x999b('0x3e')][_0x999b('0x44')](_0x999b('0x45'))){_0x391d7a[_0x999b('0x2e')]=qs[_0x999b('0x2e')](_0x4d46d2[_0x999b('0x3e')][_0x999b('0x2e')]);_0x391d7a['offset']=qs[_0x999b('0x2d')](_0x4d46d2[_0x999b('0x3e')]['offset']);}return _0x29f5d6[_0x999b('0x59')](_0x391d7a);}})[_0x999b('0x1f')](function(_0xdd37ce){if(_0xdd37ce){return _0xdd37ce?{'count':_0x3af43c,'rows':_0xdd37ce}:null;}})[_0x999b('0x1f')](respondWithResult(_0xb2bc46,null))[_0x999b('0x52')](handleError(_0xb2bc46,null));};exports[_0x999b('0x5f')]=function(_0x58a0a8,_0x513e52,_0x3ba75f){if(_0x58a0a8[_0x999b('0x56')]['id']){delete _0x58a0a8[_0x999b('0x56')]['id'];}return db[_0x999b('0x39')][_0x999b('0x5a')]({'where':{'id':_0x58a0a8[_0x999b('0x57')]['id']}})['then'](handleEntityNotFound(_0x513e52,null))['then'](function(_0x2dd2d2){if(_0x2dd2d2){_0x58a0a8['body'][_0x999b('0x60')]=_0x2dd2d2['id'];_0x58a0a8[_0x999b('0x56')]['Subjects']=integrations[_0x999b('0x61')](_0x58a0a8[_0x999b('0x56')][_0x999b('0x62')],_0x58a0a8[_0x999b('0x56')][_0x999b('0x3b')]);_0x58a0a8['body'][_0x999b('0x63')]=integrations['getDescriptions'](_0x58a0a8[_0x999b('0x56')][_0x999b('0x62')],_0x58a0a8[_0x999b('0x56')][_0x999b('0x3b')]);return db['ZohoConfiguration']['create'](_0x58a0a8['body'],{'include':[{'model':db[_0x999b('0x64')],'as':_0x999b('0x65')},{'model':db[_0x999b('0x64')],'as':_0x999b('0x63')}]});}return null;})['then'](respondWithResult(_0x513e52,null))[_0x999b('0x52')](handleError(_0x513e52,null));};function getAccessToken(_0x267888){return new Promise(function(_0x53fdb7,_0x140fa8){var _0x9ead2d;switch(_0x267888[_0x999b('0x66')]){case'US':_0x9ead2d=_0x999b('0x67');break;case'AU':_0x9ead2d='https://accounts.zoho.com.au';break;case'EU':_0x9ead2d=_0x999b('0x68');break;case'IN':_0x9ead2d='https://accounts.zoho.in';break;case'CN':_0x9ead2d=_0x999b('0x69');break;default:_0x9ead2d='https://accounts.zoho.eu';break;}var _0x3ff113={'method':_0x999b('0x6a'),'uri':_0x9ead2d+'/oauth/v2/token','qs':{'refresh_token':_0x267888[_0x999b('0x6b')],'client_id':_0x267888['clientId'],'client_secret':_0x267888[_0x999b('0x6c')],'grant_type':_0x999b('0x6d')},'json':!![]};return rp(_0x3ff113)[_0x999b('0x1f')](function(_0x44cdae){if(_0x44cdae['access_token']){_0x53fdb7(_0x44cdae[_0x999b('0x6e')]);}else{_0x140fa8(_0x999b('0x6f'));}})[_0x999b('0x52')](function(_0x11f808){_0x140fa8(_0x11f808);});});}exports['getFields']=function(_0x52d205,_0x200c57,_0x3957b9){var _0x1213d9,_0x16a5b8,_0x4667d1,_0x3d69d5,_0x43908b;return db[_0x999b('0x39')][_0x999b('0x5a')]({'where':{'id':_0x52d205['params']['id']},'attributes':['id',_0x999b('0x70'),_0x999b('0x66'),_0x999b('0x71'),_0x999b('0x6c'),_0x999b('0x72'),_0x999b('0x25'),'refreshToken']})['then'](handleEntityNotFound(_0x200c57,null))[_0x999b('0x1f')](function(_0xa42d6c){_0x43908b=_0xa42d6c;_0x1213d9=_0x43908b[_0x999b('0x70')];_0x16a5b8=_0x1213d9===_0x999b('0x73')?'eu':_0x999b('0x74');_0x4667d1=_0x43908b[_0x999b('0x72')];var _0x2cf31d=_0x4667d1[_0x999b('0x75')](-0x1);if(_0x2cf31d==='/'||_0x2cf31d==='\x5c'||_0x2cf31d===':'){_0x4667d1=_0x4667d1[_0x999b('0x76')](0x0,_0x4667d1[_0x999b('0x77')](_0x2cf31d));}if(!_0x43908b[_0x999b('0x6b')]){throw new Error(_0x999b('0x78'));}return getAccessToken(_0x43908b);})[_0x999b('0x1f')](function(_0x1e9fd9){if(_0x1e9fd9){return rp({'method':_0x999b('0x79'),'uri':util[_0x999b('0x7a')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x16a5b8),'qs':{'module':'Calls'},'headers':{'Authorization':_0x999b('0x7b')+_0x1e9fd9},'json':!![]});}})[_0x999b('0x1f')](function(_0x4ca16e){if(_0x4ca16e){if(_0x4ca16e[_0x999b('0x7c')]&&_0x4ca16e['response']['error']){throw new Error(_0x4ca16e[_0x999b('0x7c')][_0x999b('0x24')]['message']);}var _0x33c737=[];var _0x354e30=[];var _0x17070b=[_0x999b('0x7d'),'Subject','Description','WhoId',_0x999b('0x7e'),_0x999b('0x7f'),_0x999b('0x80'),_0x999b('0x81')];_0x354e30=_[_0x999b('0x82')](_0x4ca16e[_0x999b('0x42')],function(_0x6f238f){return _0x17070b[_0x999b('0x83')](_0x6f238f[_0x999b('0x84')]);});for(var _0x5245b2=0x0;_0x5245b2<_0x354e30['length'];_0x5245b2++){if(_0x354e30[_0x5245b2]['system_mandatory']===![]){_0x33c737[_0x999b('0x85')]({'id':_0x354e30[_0x5245b2]['id'],'name':_0x354e30[_0x5245b2][_0x999b('0x86')],'custom':_0x354e30[_0x5245b2][_0x999b('0x87')],'options':_0x354e30[_0x5245b2][_0x999b('0x88')]===_0x999b('0x89')&&_0x354e30[_0x5245b2][_0x999b('0x8a')][_0x999b('0x43')]>-0x1?_['map'](_0x354e30[_0x5245b2][_0x999b('0x8a')],function(_0x3086c3){return{'name':_0x3086c3,'value':_0x3086c3};}):[]});}}return{'count':_0x33c737[_0x999b('0x43')],'rows':_0x33c737};}else{return{'count':0x0,'rows':[]};}})[_0x999b('0x1f')](respondWithResult(_0x200c57,null))[_0x999b('0x52')](function(_0x278cb7){var _0x41b233=_0x52d205[_0x999b('0x3e')]['test']?0x1f4:_0x278cb7[_0x999b('0x8b')]||0x1f4;logger['error'](_0x999b('0x8c'),_0x999b('0x8d'),_0x41b233,JSON[_0x999b('0x23')](_0x278cb7));delete _0x278cb7['name'];if(_0x41b233===0x191){_0x41b233=0x190;}_0x200c57[_0x999b('0x2b')](_0x41b233)['send'](_0x52d205[_0x999b('0x3e')]['test']?{'message':_0x999b('0x8e'),'statusCode':_0x278cb7[_0x999b('0x8b')]}:_0x278cb7);});}; \ No newline at end of file +var _0x4677=['AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientSecret','serverUrl','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','count','ZohoAccount','findAll','show','params','keys','includeAll','include','find','create','body','getConfigurations','findOne','filter','addConfiguration'];(function(_0x5605ed,_0x26cf32){var _0x3b564b=function(_0x43a99d){while(--_0x43a99d){_0x5605ed['push'](_0x5605ed['shift']());}};_0x3b564b(++_0x26cf32);}(_0x4677,0x155));var _0x7467=function(_0x52e7a0,_0x1f77eb){_0x52e7a0=_0x52e7a0-0x0;var _0x586b4e=_0x4677[_0x52e7a0];return _0x586b4e;};'use strict';var pdf=require(_0x7467('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7467('0x1'));var zipdir=require(_0x7467('0x2'));var jsonpatch=require(_0x7467('0x3'));var rp=require('request-promise');var moment=require(_0x7467('0x4'));var BPromise=require(_0x7467('0x5'));var Mustache=require(_0x7467('0x6'));var util=require(_0x7467('0x7'));var path=require(_0x7467('0x8'));var sox=require(_0x7467('0x9'));var csv=require(_0x7467('0xa'));var ejs=require(_0x7467('0xb'));var fs=require('fs');var _=require(_0x7467('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7467('0xd'));var deskjs=require(_0x7467('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7467('0xf'));var Papa=require(_0x7467('0x10'));var Redis=require('ioredis');var authService=require(_0x7467('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7467('0x12'));var hardwareService=require(_0x7467('0x13'));var logger=require(_0x7467('0x14'))('api');var utils=require(_0x7467('0x15'));var config=require(_0x7467('0x16'));var db=require(_0x7467('0x17'))['db'];var integrations=require(_0x7467('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x7467('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0xca879c,_0x40fe23,_0x44ed82){if(_0x44ed82){var _0x3bf3d3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bf3d3['test'](_0x40fe23)){return _0xca879c;}else{throw new db[(_0x7467('0x1a'))][(_0x7467('0x1b'))](_0x7467('0x1c'));}}else{return _0xca879c;}}function respondWithRpcPromise(_0x535b34,_0x1b0a19,_0x221438,_0x2c4bf9){return new BPromise(function(_0x5ae723,_0x31247c){var _0x1df628=_0x2c4bf9||client;return _0x1df628[_0x7467('0x1d')](_0x535b34,_0x221438)['then'](function(_0x3c2471){logger['info'](_0x7467('0x1e'),_0x1b0a19,_0x7467('0x1f'));logger[_0x7467('0x20')](_0x7467('0x21'),_0x1b0a19,_0x7467('0x1f'),JSON[_0x7467('0x22')](_0x3c2471));if(_0x3c2471[_0x7467('0x23')]){if(_0x3c2471[_0x7467('0x23')][_0x7467('0x24')]===0x1f4){logger[_0x7467('0x23')](_0x7467('0x1e'),_0x1b0a19,_0x3c2471[_0x7467('0x23')][_0x7467('0x25')]);return _0x31247c(_0x3c2471[_0x7467('0x23')]['message']);}logger[_0x7467('0x23')](_0x7467('0x1e'),_0x1b0a19,_0x3c2471[_0x7467('0x23')][_0x7467('0x25')]);return _0x5ae723(_0x3c2471[_0x7467('0x23')]['message']);}else{logger[_0x7467('0x26')]('ZohoAccount,\x20%s,\x20%s',_0x1b0a19,_0x7467('0x1f'));_0x5ae723(_0x3c2471[_0x7467('0x27')][_0x7467('0x25')]);}})[_0x7467('0x28')](function(_0x3359a3){logger[_0x7467('0x23')]('ZohoAccount,\x20%s,\x20%s',_0x1b0a19,_0x3359a3);_0x31247c(_0x3359a3);});});}function respondWithStatusCode(_0xb54680,_0x59ad1){_0x59ad1=_0x59ad1||0xcc;return function(_0x4d7d80){if(_0x4d7d80){return _0xb54680['sendStatus'](_0x59ad1);}return _0xb54680[_0x7467('0x29')](_0x59ad1)[_0x7467('0x2a')]();};}function respondWithResult(_0x13b35d,_0x719795){_0x719795=_0x719795||0xc8;return function(_0x4dfb99){if(_0x4dfb99){return _0x13b35d[_0x7467('0x29')](_0x719795)[_0x7467('0x2b')](_0x4dfb99);}};}function respondWithFilteredResult(_0x56cec8,_0x1e6cbb){return function(_0x1b9c9a){if(_0x1b9c9a){var _0x1e80ab=_0x1b9c9a['count'],_0x219c32=_0x1e6cbb['offset'],_0x3753c6=_0x1e6cbb[_0x7467('0x2c')]+_0x1e6cbb[_0x7467('0x2d')],_0x4fe944;if(_0x3753c6>=_0x1e80ab){_0x3753c6=_0x1e80ab;_0x4fe944=0xc8;}else{_0x4fe944=0xce;}_0x56cec8['status'](_0x4fe944);return _0x56cec8[_0x7467('0x2e')](_0x7467('0x2f'),_0x219c32+'-'+_0x3753c6+'/'+_0x1e80ab)[_0x7467('0x2b')](_0x1b9c9a);}return null;};}function patchUpdates(_0xf013a3){return function(_0x1d7d7){try{jsonpatch[_0x7467('0x30')](_0x1d7d7,_0xf013a3,!![]);}catch(_0x539d50){return BPromise[_0x7467('0x31')](_0x539d50);}return _0x1d7d7[_0x7467('0x32')]();};}function saveUpdates(_0x283e2e,_0x547afb){return function(_0x2ee746){if(_0x2ee746){return _0x2ee746[_0x7467('0x33')](_0x283e2e)[_0x7467('0x34')](function(_0x18676b){return _0x18676b;});}return null;};}function removeEntity(_0x240b61,_0x2e0612){return function(_0x3b36dc){if(_0x3b36dc){return _0x3b36dc[_0x7467('0x35')]()['then'](function(){_0x240b61[_0x7467('0x29')](0xcc)[_0x7467('0x2a')]();});}};}function handleEntityNotFound(_0x1a995e,_0x41a485){return function(_0x2e6dad){if(!_0x2e6dad){_0x1a995e[_0x7467('0x36')](0x194);}return _0x2e6dad;};}function handleError(_0x327c68,_0x2328cd){_0x2328cd=_0x2328cd||0x1f4;return function(_0x1890d1){logger[_0x7467('0x23')](_0x1890d1[_0x7467('0x37')]);if(_0x1890d1[_0x7467('0x38')]){delete _0x1890d1[_0x7467('0x38')];}_0x327c68[_0x7467('0x29')](_0x2328cd)[_0x7467('0x39')](_0x1890d1);};}exports[_0x7467('0x3a')]=function(_0x369c9f,_0x400691){var _0x2ff181={},_0x58ae5b={},_0x25ee35={'count':0x0,'rows':[]};var _0x52a8e4=_[_0x7467('0x3b')](db['ZohoAccount'][_0x7467('0x3c')],function(_0x2a8055){return{'name':_0x2a8055['fieldName'],'type':_0x2a8055['type'][_0x7467('0x3d')]};});_0x58ae5b[_0x7467('0x3e')]=_[_0x7467('0x3b')](_0x52a8e4,_0x7467('0x38'));_0x58ae5b[_0x7467('0x3f')]=_['keys'](_0x369c9f[_0x7467('0x3f')]);_0x58ae5b[_0x7467('0x40')]=_[_0x7467('0x41')](_0x58ae5b[_0x7467('0x3e')],_0x58ae5b[_0x7467('0x3f')]);_0x2ff181[_0x7467('0x42')]=_[_0x7467('0x41')](_0x58ae5b[_0x7467('0x3e')],qs[_0x7467('0x43')](_0x369c9f[_0x7467('0x3f')][_0x7467('0x43')]));_0x2ff181['attributes']=_0x2ff181[_0x7467('0x42')][_0x7467('0x44')]?_0x2ff181[_0x7467('0x42')]:_0x58ae5b['model'];if(!_0x369c9f[_0x7467('0x3f')][_0x7467('0x45')](_0x7467('0x46'))){_0x2ff181[_0x7467('0x2d')]=qs['limit'](_0x369c9f[_0x7467('0x3f')]['limit']);_0x2ff181['offset']=qs[_0x7467('0x2c')](_0x369c9f[_0x7467('0x3f')]['offset']);}_0x2ff181[_0x7467('0x47')]=qs['sort'](_0x369c9f['query'][_0x7467('0x48')]);_0x2ff181[_0x7467('0x49')]=qs['filters'](_[_0x7467('0x4a')](_0x369c9f[_0x7467('0x3f')],_0x58ae5b[_0x7467('0x40')]));if(_0x369c9f[_0x7467('0x3f')]['filter']){_0x2ff181[_0x7467('0x49')]=_[_0x7467('0x4b')](_0x2ff181[_0x7467('0x49')],{'$or':_[_0x7467('0x3b')](_0x52a8e4,function(_0x5442a7){if(_0x5442a7[_0x7467('0x4c')]!==_0x7467('0x4d')){var _0xa08a0a={};_0xa08a0a[_0x5442a7[_0x7467('0x38')]]={'$like':'%'+_0x369c9f['query']['filter']+'%'};return _0xa08a0a;}})});}_0x2ff181=_[_0x7467('0x4b')]({},_0x2ff181,_0x369c9f[_0x7467('0x4e')]);var _0x27ce78={'where':_0x2ff181[_0x7467('0x49')]};return db['ZohoAccount'][_0x7467('0x4f')](_0x27ce78)[_0x7467('0x34')](function(_0x154e52){_0x25ee35[_0x7467('0x4f')]=_0x154e52;if(_0x369c9f[_0x7467('0x3f')]['includeAll']){_0x2ff181['include']=[{'all':!![]}];}return db[_0x7467('0x50')][_0x7467('0x51')](_0x2ff181);})['then'](function(_0x1174b6){_0x25ee35['rows']=_0x1174b6;return _0x25ee35;})[_0x7467('0x34')](respondWithFilteredResult(_0x400691,_0x2ff181))['catch'](handleError(_0x400691,null));};exports[_0x7467('0x52')]=function(_0x963830,_0x2ea1fd){var _0x16a7df={'raw':![],'where':{'id':_0x963830[_0x7467('0x53')]['id']}},_0xd2e9ac={};_0xd2e9ac['model']=_['keys'](db[_0x7467('0x50')][_0x7467('0x3c')]);_0xd2e9ac[_0x7467('0x3f')]=_[_0x7467('0x54')](_0x963830['query']);_0xd2e9ac[_0x7467('0x40')]=_[_0x7467('0x41')](_0xd2e9ac[_0x7467('0x3e')],_0xd2e9ac[_0x7467('0x3f')]);_0x16a7df[_0x7467('0x42')]=_['intersection'](_0xd2e9ac[_0x7467('0x3e')],qs['fields'](_0x963830['query']['fields']));_0x16a7df['attributes']=_0x16a7df[_0x7467('0x42')]['length']?_0x16a7df[_0x7467('0x42')]:_0xd2e9ac[_0x7467('0x3e')];if(_0x963830[_0x7467('0x3f')][_0x7467('0x55')]){_0x16a7df[_0x7467('0x56')]=[{'all':!![]}];}_0x16a7df=_[_0x7467('0x4b')]({},_0x16a7df,_0x963830['options']);return db[_0x7467('0x50')][_0x7467('0x57')](_0x16a7df)[_0x7467('0x34')](handleEntityNotFound(_0x2ea1fd,null))[_0x7467('0x34')](respondWithResult(_0x2ea1fd,null))[_0x7467('0x28')](handleError(_0x2ea1fd,null));};exports['create']=function(_0x575a3e,_0x5c7bf5){return db[_0x7467('0x50')][_0x7467('0x58')](_0x575a3e['body'],{})[_0x7467('0x34')](respondWithResult(_0x5c7bf5,0xc9))['catch'](handleError(_0x5c7bf5,null));};exports[_0x7467('0x33')]=function(_0x24acf3,_0x16e149){if(_0x24acf3[_0x7467('0x59')]['id']){delete _0x24acf3['body']['id'];}return db[_0x7467('0x50')][_0x7467('0x57')]({'where':{'id':_0x24acf3['params']['id']}})[_0x7467('0x34')](handleEntityNotFound(_0x16e149,null))[_0x7467('0x34')](saveUpdates(_0x24acf3['body'],null))[_0x7467('0x34')](respondWithResult(_0x16e149,null))['catch'](handleError(_0x16e149,null));};exports[_0x7467('0x35')]=function(_0x4525ec,_0x2a5d30){return db[_0x7467('0x50')][_0x7467('0x57')]({'where':{'id':_0x4525ec[_0x7467('0x53')]['id']}})[_0x7467('0x34')](handleEntityNotFound(_0x2a5d30,null))[_0x7467('0x34')](removeEntity(_0x2a5d30,null))[_0x7467('0x28')](handleError(_0x2a5d30,null));};exports[_0x7467('0x5a')]=function(_0x276557,_0x4d3e0a,_0x3fc2fd){var _0x403933={};var _0x50229d={};var _0x29d323;var _0x40a562;return db['ZohoAccount'][_0x7467('0x5b')]({'where':{'id':_0x276557[_0x7467('0x53')]['id']}})[_0x7467('0x34')](handleEntityNotFound(_0x4d3e0a,null))[_0x7467('0x34')](function(_0x1909f1){if(_0x1909f1){_0x29d323=_0x1909f1;_0x50229d['model']=_[_0x7467('0x54')](db['ZohoConfiguration'][_0x7467('0x3c')]);_0x50229d[_0x7467('0x3f')]=_[_0x7467('0x54')](_0x276557[_0x7467('0x3f')]);_0x50229d[_0x7467('0x40')]=_[_0x7467('0x41')](_0x50229d['model'],_0x50229d[_0x7467('0x3f')]);_0x403933[_0x7467('0x42')]=_['intersection'](_0x50229d[_0x7467('0x3e')],qs[_0x7467('0x43')](_0x276557[_0x7467('0x3f')][_0x7467('0x43')]));_0x403933['attributes']=_0x403933[_0x7467('0x42')][_0x7467('0x44')]?_0x403933[_0x7467('0x42')]:_0x50229d[_0x7467('0x3e')];_0x403933[_0x7467('0x47')]=qs[_0x7467('0x48')](_0x276557['query'][_0x7467('0x48')]);_0x403933['where']=qs[_0x7467('0x40')](_[_0x7467('0x4a')](_0x276557[_0x7467('0x3f')],_0x50229d[_0x7467('0x40')]));if(_0x276557[_0x7467('0x3f')][_0x7467('0x5c')]){_0x403933['where']=_[_0x7467('0x4b')](_0x403933[_0x7467('0x49')],{'$or':_[_0x7467('0x3b')](_0x403933['attributes'],function(_0x48a9b4){var _0x229089={};_0x229089[_0x48a9b4]={'$like':'%'+_0x276557[_0x7467('0x3f')][_0x7467('0x5c')]+'%'};return _0x229089;})});}_0x403933=_[_0x7467('0x4b')]({},_0x403933,_0x276557[_0x7467('0x4e')]);return _0x29d323['getConfigurations'](_0x403933);}})[_0x7467('0x34')](function(_0x135ee7){if(_0x135ee7){_0x40a562=_0x135ee7[_0x7467('0x44')];if(!_0x276557['query'][_0x7467('0x45')]('nolimit')){_0x403933[_0x7467('0x2d')]=qs[_0x7467('0x2d')](_0x276557[_0x7467('0x3f')][_0x7467('0x2d')]);_0x403933[_0x7467('0x2c')]=qs[_0x7467('0x2c')](_0x276557[_0x7467('0x3f')][_0x7467('0x2c')]);}return _0x29d323[_0x7467('0x5a')](_0x403933);}})[_0x7467('0x34')](function(_0x485a3d){if(_0x485a3d){return _0x485a3d?{'count':_0x40a562,'rows':_0x485a3d}:null;}})[_0x7467('0x34')](respondWithResult(_0x4d3e0a,null))[_0x7467('0x28')](handleError(_0x4d3e0a,null));};exports[_0x7467('0x5d')]=function(_0x311d92,_0x14339b,_0x15a86a){if(_0x311d92[_0x7467('0x59')]['id']){delete _0x311d92['body']['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x311d92[_0x7467('0x53')]['id']}})[_0x7467('0x34')](handleEntityNotFound(_0x14339b,null))['then'](function(_0x4cfd15){if(_0x4cfd15){_0x311d92[_0x7467('0x59')][_0x7467('0x5e')]=_0x4cfd15['id'];_0x311d92[_0x7467('0x59')][_0x7467('0x5f')]=integrations[_0x7467('0x60')](_0x311d92['body'][_0x7467('0x61')],_0x311d92[_0x7467('0x59')][_0x7467('0x4c')]);_0x311d92[_0x7467('0x59')][_0x7467('0x62')]=integrations[_0x7467('0x63')](_0x311d92[_0x7467('0x59')][_0x7467('0x61')],_0x311d92[_0x7467('0x59')][_0x7467('0x4c')]);return db[_0x7467('0x64')][_0x7467('0x58')](_0x311d92['body'],{'include':[{'model':db[_0x7467('0x65')],'as':_0x7467('0x5f')},{'model':db[_0x7467('0x65')],'as':'Descriptions'}]});}return null;})[_0x7467('0x34')](respondWithResult(_0x14339b,null))['catch'](handleError(_0x14339b,null));};function getAccessToken(_0x44950b){return new Promise(function(_0x831370,_0x2c1b9e){var _0x4a6682;switch(_0x44950b['zone']){case'US':_0x4a6682=_0x7467('0x66');break;case'AU':_0x4a6682='https://accounts.zoho.com.au';break;case'EU':_0x4a6682=_0x7467('0x67');break;case'IN':_0x4a6682=_0x7467('0x68');break;case'CN':_0x4a6682=_0x7467('0x69');break;default:_0x4a6682='https://accounts.zoho.eu';break;}var _0x31f6eb={'method':_0x7467('0x6a'),'uri':_0x4a6682+_0x7467('0x6b'),'qs':{'refresh_token':_0x44950b['refreshToken'],'client_id':_0x44950b[_0x7467('0x6c')],'client_secret':_0x44950b['clientSecret'],'grant_type':_0x7467('0x6d')},'json':!![]};return rp(_0x31f6eb)['then'](function(_0x7e1545){if(_0x7e1545[_0x7467('0x6e')]){_0x831370(_0x7e1545[_0x7467('0x6e')]);}else{_0x2c1b9e(_0x7467('0x6f'));}})[_0x7467('0x28')](function(_0x2fafa7){_0x2c1b9e(_0x2fafa7);});});}exports[_0x7467('0x70')]=function(_0x3bfca5,_0x221d10,_0x6bd4bd){var _0x54c367,_0x1c2e34,_0x3efbbe,_0x15cb74,_0x49ddab;return db[_0x7467('0x50')][_0x7467('0x5b')]({'where':{'id':_0x3bfca5[_0x7467('0x53')]['id']},'attributes':['id',_0x7467('0x71'),_0x7467('0x72'),'clientId',_0x7467('0x73'),_0x7467('0x74'),_0x7467('0x24'),_0x7467('0x75')]})['then'](handleEntityNotFound(_0x221d10,null))[_0x7467('0x34')](function(_0x6595fa){_0x49ddab=_0x6595fa;_0x54c367=_0x49ddab['host'];_0x1c2e34=_0x54c367===_0x7467('0x76')?'eu':_0x7467('0x77');_0x3efbbe=_0x49ddab['serverUrl'];var _0x904e5=_0x3efbbe[_0x7467('0x78')](-0x1);if(_0x904e5==='/'||_0x904e5==='\x5c'||_0x904e5===':'){_0x3efbbe=_0x3efbbe[_0x7467('0x79')](0x0,_0x3efbbe[_0x7467('0x7a')](_0x904e5));}if(!_0x49ddab[_0x7467('0x75')]){throw new Error(_0x7467('0x7b'));}return getAccessToken(_0x49ddab);})[_0x7467('0x34')](function(_0x233724){if(_0x233724){return rp({'method':'GET','uri':util[_0x7467('0x7c')](_0x7467('0x7d'),_0x1c2e34),'qs':{'module':'Calls'},'headers':{'Authorization':_0x7467('0x7e')+_0x233724},'json':!![]});}})['then'](function(_0x262171){if(_0x262171){if(_0x262171[_0x7467('0x7f')]&&_0x262171[_0x7467('0x7f')][_0x7467('0x23')]){throw new Error(_0x262171[_0x7467('0x7f')][_0x7467('0x23')][_0x7467('0x25')]);}var _0xb27d79=[];var _0x458157=[];var _0x16e515=[_0x7467('0x80'),_0x7467('0x81'),_0x7467('0x82'),_0x7467('0x83'),_0x7467('0x84'),_0x7467('0x85'),_0x7467('0x86'),'Call_Type'];_0x458157=_[_0x7467('0x87')](_0x262171[_0x7467('0x43')],function(_0x39d378){return _0x16e515[_0x7467('0x88')](_0x39d378[_0x7467('0x89')]);});for(var _0x3d7792=0x0;_0x3d7792<_0x458157[_0x7467('0x44')];_0x3d7792++){if(_0x458157[_0x3d7792]['system_mandatory']===![]){_0xb27d79[_0x7467('0x8a')]({'id':_0x458157[_0x3d7792]['id'],'name':_0x458157[_0x3d7792][_0x7467('0x8b')],'custom':_0x458157[_0x3d7792][_0x7467('0x8c')],'options':_0x458157[_0x3d7792][_0x7467('0x8d')]===_0x7467('0x8e')&&_0x458157[_0x3d7792]['pick_list_values'][_0x7467('0x44')]>-0x1?_[_0x7467('0x3b')](_0x458157[_0x3d7792][_0x7467('0x8f')],function(_0x26b756){return{'name':_0x26b756,'value':_0x26b756};}):[]});}}return{'count':_0xb27d79[_0x7467('0x44')],'rows':_0xb27d79};}else{return{'count':0x0,'rows':[]};}})[_0x7467('0x34')](respondWithResult(_0x221d10,null))[_0x7467('0x28')](function(_0x1e93d6){var _0x5cf45f=_0x3bfca5[_0x7467('0x3f')]['test']?0x1f4:_0x1e93d6['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5cf45f,JSON['stringify'](_0x1e93d6));delete _0x1e93d6[_0x7467('0x38')];if(_0x5cf45f===0x191){_0x5cf45f=0x190;}_0x221d10[_0x7467('0x29')](_0x5cf45f)[_0x7467('0x39')](_0x3bfca5[_0x7467('0x3f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1e93d6[_0x7467('0x90')]}:_0x1e93d6);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 835c4ce..8bf99a0 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 _0xe7bd=['https://accounts.zoho.com.cn','application/x-www-form-urlencoded','catch','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','clientId','clientSecret','code','serverUrl','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','name','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host'];(function(_0x24d1c8,_0x17558f){var _0x1cd1ce=function(_0x5b5e76){while(--_0x5b5e76){_0x24d1c8['push'](_0x24d1c8['shift']());}};_0x1cd1ce(++_0x17558f);}(_0xe7bd,0x15b));var _0xde7b=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0xe7bd[_0x4fa438];return _0x4e3958;};'use strict';var _=require(_0xde7b('0x0'));var util=require(_0xde7b('0x1'));var logger=require('../../config/logger')(_0xde7b('0x2'));var moment=require('moment');var BPromise=require(_0xde7b('0x3'));var rp=require(_0xde7b('0x4'));var fs=require('fs');var path=require(_0xde7b('0x5'));var rimraf=require(_0xde7b('0x6'));var config=require(_0xde7b('0x7'));var attributes=require(_0xde7b('0x8'));var integrations=require(_0xde7b('0x9'));module[_0xde7b('0xa')]=function(_0x299900,_0x44d1e4){return _0x299900[_0xde7b('0xb')](_0xde7b('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4430d2,_0x177ed9,_0x9d9edd){if(_0x4430d2[_0xde7b('0xd')](_0xde7b('0xe'))||_0x4430d2[_0xde7b('0xd')]('serverUrl')||_0x4430d2[_0xde7b('0xd')](_0xde7b('0xf'))||_0x4430d2[_0xde7b('0xd')](_0xde7b('0x10'))||_0x4430d2[_0xde7b('0xd')](_0xde7b('0x11'))||_0x4430d2[_0xde7b('0xd')]('host')){var _0x599f7c,_0x53f073;_0x599f7c=_0x4430d2[_0xde7b('0x12')];var _0x250c4a=_0x599f7c['slice'](-0x1);if(_0x250c4a==='/'||_0x250c4a==='\x5c'||_0x250c4a===':'){_0x599f7c=_0x599f7c[_0xde7b('0x13')](0x0,_0x599f7c[_0xde7b('0x14')](_0x250c4a));}switch(_0x4430d2['zone']){case'US':_0x53f073=_0xde7b('0x15');break;case'AU':_0x53f073=_0xde7b('0x16');break;case'IN':_0x53f073=_0xde7b('0x17');break;case'CN':_0x53f073='https://accounts.zoho.com.cn';break;default:_0x53f073=_0xde7b('0x18');break;}var _0x4bc618={'method':_0xde7b('0x19'),'uri':_0x53f073+_0xde7b('0x1a'),'form':{'grant_type':_0xde7b('0x1b'),'client_id':_0x4430d2['clientId'],'client_secret':_0x4430d2[_0xde7b('0x10')],'redirect_uri':_0x4430d2['serverUrl'],'code':_0x4430d2[_0xde7b('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4bc618)[_0xde7b('0x1c')](function(_0x390d2d){var _0x3e0a7c=JSON[_0xde7b('0x1d')](_0x390d2d);if(_0x3e0a7c[_0xde7b('0x1e')]){_0x4430d2[_0xde7b('0x1f')]=_0x3e0a7c[_0xde7b('0x1e')];logger[_0xde7b('0x20')](util[_0xde7b('0x21')](_0xde7b('0x22'),_0x4430d2['name'],_0x4430d2['id']));}else{logger[_0xde7b('0x23')](util[_0xde7b('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4430d2[_0xde7b('0x24')],_0x4430d2['id']),util[_0xde7b('0x25')](_0x3e0a7c,{'showHidden':![],'depth':null}));}return _0x9d9edd(null,_0x177ed9);})['catch'](function(_0x498d2d){logger[_0xde7b('0x23')](util[_0xde7b('0x21')](_0xde7b('0x26'),_0x4430d2[_0xde7b('0x24')],_0x4430d2['id']),util[_0xde7b('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x9d9edd(_0x498d2d);});}else{return _0x9d9edd(null,_0x177ed9);}},'beforeUpdate':function(_0x2cfefd,_0x2e755a,_0x1847ed){if(_0x2cfefd['changed'](_0xde7b('0xe'))||_0x2cfefd['changed'](_0xde7b('0x12'))||_0x2cfefd[_0xde7b('0xd')](_0xde7b('0xf'))||_0x2cfefd[_0xde7b('0xd')]('clientSecret')||_0x2cfefd[_0xde7b('0xd')](_0xde7b('0x11'))||_0x2cfefd[_0xde7b('0xd')](_0xde7b('0x27'))){var _0xf39ab7,_0x3d1523;_0xf39ab7=_0x2cfefd[_0xde7b('0x12')];var _0x1b397d=_0xf39ab7['slice'](-0x1);if(_0x1b397d==='/'||_0x1b397d==='\x5c'||_0x1b397d===':'){_0xf39ab7=_0xf39ab7[_0xde7b('0x13')](0x0,_0xf39ab7[_0xde7b('0x14')](_0x1b397d));}switch(_0x2cfefd[_0xde7b('0xe')]){case'US':_0x3d1523=_0xde7b('0x15');break;case'AU':_0x3d1523='https://accounts.zoho.com.au';break;case'IN':_0x3d1523=_0xde7b('0x17');break;case'CN':_0x3d1523=_0xde7b('0x28');break;default:_0x3d1523=_0xde7b('0x18');break;}var _0x4304c7={'method':'POST','uri':_0x3d1523+_0xde7b('0x1a'),'form':{'grant_type':_0xde7b('0x1b'),'client_id':_0x2cfefd[_0xde7b('0xf')],'client_secret':_0x2cfefd[_0xde7b('0x10')],'redirect_uri':_0x2cfefd['serverUrl'],'code':_0x2cfefd[_0xde7b('0x11')]},'headers':{'Content-Type':_0xde7b('0x29')}};return rp(_0x4304c7)['then'](function(_0x5f3bec){var _0x570d28=JSON['parse'](_0x5f3bec);if(_0x570d28[_0xde7b('0x1e')]){_0x2cfefd[_0xde7b('0x1f')]=_0x570d28[_0xde7b('0x1e')];logger['info'](util['format'](_0xde7b('0x22'),_0x2cfefd[_0xde7b('0x24')],_0x2cfefd['id']));}else{logger[_0xde7b('0x23')](util[_0xde7b('0x21')](_0xde7b('0x26'),_0x2cfefd[_0xde7b('0x24')],_0x2cfefd['id']),util[_0xde7b('0x25')](_0x570d28,{'showHidden':![],'depth':null}));}return _0x1847ed(null,_0x2e755a);})[_0xde7b('0x2a')](function(_0x509e17){logger[_0xde7b('0x23')](util[_0xde7b('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2cfefd[_0xde7b('0x24')],_0x2cfefd['id']),util[_0xde7b('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1847ed(_0x509e17);});}else{return _0x1847ed(null,_0x2e755a);}}}});}; \ No newline at end of file +var _0x7384=['rimraf','exports','define','ZohoAccount','changed','zone','clientId','clientSecret','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','application/x-www-form-urlencoded','then','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','code','POST','/oauth/v2/token','authorization_code','lodash','util','../../config/logger','bluebird','path'];(function(_0x203c8c,_0x2728e5){var _0x1e5322=function(_0x4f2814){while(--_0x4f2814){_0x203c8c['push'](_0x203c8c['shift']());}};_0x1e5322(++_0x2728e5);}(_0x7384,0x133));var _0x4738=function(_0x309dbe,_0x5dcda8){_0x309dbe=_0x309dbe-0x0;var _0xa555df=_0x7384[_0x309dbe];return _0xa555df;};'use strict';var _=require(_0x4738('0x0'));var util=require(_0x4738('0x1'));var logger=require(_0x4738('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4738('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4738('0x4'));var rimraf=require(_0x4738('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x4738('0x6')]=function(_0x9b8faa,_0x37a956){return _0x9b8faa[_0x4738('0x7')](_0x4738('0x8'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a28ad,_0x4e5b23,_0x377328){if(_0x4a28ad[_0x4738('0x9')](_0x4738('0xa'))||_0x4a28ad['changed']('serverUrl')||_0x4a28ad[_0x4738('0x9')](_0x4738('0xb'))||_0x4a28ad[_0x4738('0x9')](_0x4738('0xc'))||_0x4a28ad['changed']('code')||_0x4a28ad[_0x4738('0x9')](_0x4738('0xd'))){var _0x4a1085,_0x3df81e;_0x4a1085=_0x4a28ad[_0x4738('0xe')];var _0x201254=_0x4a1085[_0x4738('0xf')](-0x1);if(_0x201254==='/'||_0x201254==='\x5c'||_0x201254===':'){_0x4a1085=_0x4a1085[_0x4738('0x10')](0x0,_0x4a1085[_0x4738('0x11')](_0x201254));}switch(_0x4a28ad[_0x4738('0xa')]){case'US':_0x3df81e=_0x4738('0x12');break;case'AU':_0x3df81e=_0x4738('0x13');break;case'IN':_0x3df81e=_0x4738('0x14');break;case'CN':_0x3df81e=_0x4738('0x15');break;default:_0x3df81e=_0x4738('0x16');break;}var _0x4cd9cb={'method':'POST','uri':_0x3df81e+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x4a28ad[_0x4738('0xb')],'client_secret':_0x4a28ad[_0x4738('0xc')],'redirect_uri':_0x4a28ad[_0x4738('0xe')],'code':_0x4a28ad['code']},'headers':{'Content-Type':_0x4738('0x17')}};return rp(_0x4cd9cb)[_0x4738('0x18')](function(_0x12d764){var _0x4100bf=JSON['parse'](_0x12d764);if(_0x4100bf['refresh_token']){_0x4a28ad[_0x4738('0x19')]=_0x4100bf[_0x4738('0x1a')];logger[_0x4738('0x1b')](util[_0x4738('0x1c')](_0x4738('0x1d'),_0x4a28ad[_0x4738('0x1e')],_0x4a28ad['id']));}else{logger[_0x4738('0x1f')](util[_0x4738('0x1c')](_0x4738('0x20'),_0x4a28ad[_0x4738('0x1e')],_0x4a28ad['id']),util['inspect'](_0x4100bf,{'showHidden':![],'depth':null}));}return _0x377328(null,_0x4e5b23);})[_0x4738('0x21')](function(_0x1ff7ab){logger[_0x4738('0x1f')](util[_0x4738('0x1c')](_0x4738('0x20'),_0x4a28ad[_0x4738('0x1e')],_0x4a28ad['id']),util[_0x4738('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x377328(_0x1ff7ab);});}else{return _0x377328(null,_0x4e5b23);}},'beforeUpdate':function(_0x2c79ce,_0x415f40,_0x4fda28){if(_0x2c79ce['changed'](_0x4738('0xa'))||_0x2c79ce[_0x4738('0x9')]('serverUrl')||_0x2c79ce[_0x4738('0x9')](_0x4738('0xb'))||_0x2c79ce[_0x4738('0x9')](_0x4738('0xc'))||_0x2c79ce['changed'](_0x4738('0x23'))||_0x2c79ce['changed'](_0x4738('0xd'))){var _0x33d1ff,_0x2e26ac;_0x33d1ff=_0x2c79ce[_0x4738('0xe')];var _0x2e7754=_0x33d1ff['slice'](-0x1);if(_0x2e7754==='/'||_0x2e7754==='\x5c'||_0x2e7754===':'){_0x33d1ff=_0x33d1ff[_0x4738('0x10')](0x0,_0x33d1ff[_0x4738('0x11')](_0x2e7754));}switch(_0x2c79ce[_0x4738('0xa')]){case'US':_0x2e26ac=_0x4738('0x12');break;case'AU':_0x2e26ac=_0x4738('0x13');break;case'IN':_0x2e26ac=_0x4738('0x14');break;case'CN':_0x2e26ac=_0x4738('0x15');break;default:_0x2e26ac=_0x4738('0x16');break;}var _0x1f2940={'method':_0x4738('0x24'),'uri':_0x2e26ac+_0x4738('0x25'),'form':{'grant_type':_0x4738('0x26'),'client_id':_0x2c79ce[_0x4738('0xb')],'client_secret':_0x2c79ce[_0x4738('0xc')],'redirect_uri':_0x2c79ce[_0x4738('0xe')],'code':_0x2c79ce['code']},'headers':{'Content-Type':_0x4738('0x17')}};return rp(_0x1f2940)[_0x4738('0x18')](function(_0xd25547){var _0x3b8cd3=JSON['parse'](_0xd25547);if(_0x3b8cd3['refresh_token']){_0x2c79ce[_0x4738('0x19')]=_0x3b8cd3[_0x4738('0x1a')];logger[_0x4738('0x1b')](util[_0x4738('0x1c')](_0x4738('0x1d'),_0x2c79ce[_0x4738('0x1e')],_0x2c79ce['id']));}else{logger[_0x4738('0x1f')](util[_0x4738('0x1c')](_0x4738('0x20'),_0x2c79ce['name'],_0x2c79ce['id']),util[_0x4738('0x22')](_0x3b8cd3,{'showHidden':![],'depth':null}));}return _0x4fda28(null,_0x415f40);})['catch'](function(_0x148cab){logger[_0x4738('0x1f')](util[_0x4738('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2c79ce['name'],_0x2c79ce['id']),util[_0x4738('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x4fda28(_0x148cab);});}else{return _0x4fda28(null,_0x415f40);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 1545f91..02e4e97 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 _0x56bf=['include','model','GetZohoAccount','ShowZohoAccount','find','where','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZohoAccount','options','raw','attributes','limit','map'];(function(_0x46de76,_0xe99c27){var _0x2d8b7b=function(_0x31c360){while(--_0x31c360){_0x46de76['push'](_0x46de76['shift']());}};_0x2d8b7b(++_0xe99c27);}(_0x56bf,0x8e));var _0xf56b=function(_0x183b97,_0x2d297c){_0x183b97=_0x183b97-0x0;var _0x629cf7=_0x56bf[_0x183b97];return _0x629cf7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf56b('0x0'));var rs=require(_0xf56b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf56b('0x2'))['db'];var utils=require(_0xf56b('0x3'));var logger=require('../../config/logger')(_0xf56b('0x4'));var config=require(_0xf56b('0x5'));var jayson=require(_0xf56b('0x6'));var client=jayson[_0xf56b('0x7')][_0xf56b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5dd920,_0x4c99b1,_0x3e8bf7){return new BPromise(function(_0x2ccc03,_0x4e0c95){return client[_0xf56b('0x9')](_0x5dd920,_0x3e8bf7)[_0xf56b('0xa')](function(_0x446ff2){logger[_0xf56b('0xb')](_0xf56b('0xc'),_0x4c99b1,_0xf56b('0xd'));logger[_0xf56b('0xe')](_0xf56b('0xf'),_0x4c99b1,_0xf56b('0xd'),JSON[_0xf56b('0x10')](_0x446ff2));if(_0x446ff2[_0xf56b('0x11')]){if(_0x446ff2['error'][_0xf56b('0x12')]===0x1f4){logger['error'](_0xf56b('0xc'),_0x4c99b1,_0x446ff2['error']['message']);return _0x4e0c95(_0x446ff2[_0xf56b('0x11')][_0xf56b('0x13')]);}logger[_0xf56b('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x4c99b1,_0x446ff2['error'][_0xf56b('0x13')]);return _0x2ccc03(_0x446ff2[_0xf56b('0x11')][_0xf56b('0x13')]);}else{logger[_0xf56b('0xb')](_0xf56b('0xc'),_0x4c99b1,'request\x20sent');_0x2ccc03(_0x446ff2[_0xf56b('0x14')][_0xf56b('0x13')]);}})[_0xf56b('0x15')](function(_0x1da06b){logger[_0xf56b('0x11')](_0xf56b('0xc'),_0x4c99b1,_0x1da06b);_0x4e0c95(_0x1da06b);});});}exports['GetZohoAccount']=function(_0x16aecf){var _0x4ef63a=this;return new Promise(function(_0x5a6d2a,_0x232791){return db[_0xf56b('0x16')]['findAll']({'raw':_0x16aecf['options']?_0x16aecf[_0xf56b('0x17')][_0xf56b('0x18')]===undefined?!![]:![]:!![],'where':_0x16aecf[_0xf56b('0x17')]?_0x16aecf[_0xf56b('0x17')]['where']||null:null,'attributes':_0x16aecf['options']?_0x16aecf[_0xf56b('0x17')][_0xf56b('0x19')]||null:null,'limit':_0x16aecf[_0xf56b('0x17')]?_0x16aecf['options'][_0xf56b('0x1a')]||null:null,'include':_0x16aecf[_0xf56b('0x17')]?_0x16aecf[_0xf56b('0x17')]['include']?_[_0xf56b('0x1b')](_0x16aecf['options'][_0xf56b('0x1c')],function(_0x3cb4c7){return{'model':db[_0x3cb4c7[_0xf56b('0x1d')]],'as':_0x3cb4c7['as'],'attributes':_0x3cb4c7[_0xf56b('0x19')],'include':_0x3cb4c7[_0xf56b('0x1c')]?_[_0xf56b('0x1b')](_0x3cb4c7[_0xf56b('0x1c')],function(_0x92c005){return{'model':db[_0x92c005[_0xf56b('0x1d')]],'as':_0x92c005['as'],'attributes':_0x92c005[_0xf56b('0x19')],'include':_0x92c005[_0xf56b('0x1c')]?_['map'](_0x92c005[_0xf56b('0x1c')],function(_0x12f38f){return{'model':db[_0x12f38f[_0xf56b('0x1d')]],'as':_0x12f38f['as'],'attributes':_0x12f38f[_0xf56b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf56b('0xa')](function(_0x31c5fe){logger[_0xf56b('0xb')](_0xf56b('0x1e'),_0x16aecf);logger[_0xf56b('0xe')](_0xf56b('0x1e'),_0x16aecf,JSON[_0xf56b('0x10')](_0x31c5fe));_0x5a6d2a(_0x31c5fe);})[_0xf56b('0x15')](function(_0x21bef6){logger[_0xf56b('0x11')]('GetZohoAccount',_0x21bef6[_0xf56b('0x13')],_0x16aecf);_0x232791(_0x4ef63a[_0xf56b('0x11')](0x1f4,_0x21bef6['message']));});});};exports[_0xf56b('0x1f')]=function(_0x198927){var _0x2736ee=this;return new Promise(function(_0xea72fc,_0x3d1e47){return db[_0xf56b('0x16')][_0xf56b('0x20')]({'raw':_0x198927['options']?_0x198927[_0xf56b('0x17')][_0xf56b('0x18')]===undefined?!![]:![]:!![],'where':_0x198927[_0xf56b('0x17')]?_0x198927[_0xf56b('0x17')][_0xf56b('0x21')]||null:null,'attributes':_0x198927['options']?_0x198927['options'][_0xf56b('0x19')]||null:null,'include':_0x198927[_0xf56b('0x17')]?_0x198927[_0xf56b('0x17')][_0xf56b('0x1c')]?_[_0xf56b('0x1b')](_0x198927[_0xf56b('0x17')][_0xf56b('0x1c')],function(_0x358a37){return{'model':db[_0x358a37[_0xf56b('0x1d')]],'as':_0x358a37['as'],'attributes':_0x358a37[_0xf56b('0x19')],'include':_0x358a37[_0xf56b('0x1c')]?_[_0xf56b('0x1b')](_0x358a37[_0xf56b('0x1c')],function(_0x229593){return{'model':db[_0x229593['model']],'as':_0x229593['as'],'attributes':_0x229593[_0xf56b('0x19')],'include':_0x229593[_0xf56b('0x1c')]?_[_0xf56b('0x1b')](_0x229593[_0xf56b('0x1c')],function(_0x108e00){return{'model':db[_0x108e00[_0xf56b('0x1d')]],'as':_0x108e00['as'],'attributes':_0x108e00[_0xf56b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf56b('0xa')](function(_0x1e23aa){logger[_0xf56b('0xb')](_0xf56b('0x1f'),_0x198927);logger[_0xf56b('0xe')](_0xf56b('0x1f'),_0x198927,JSON[_0xf56b('0x10')](_0x1e23aa));_0xea72fc(_0x1e23aa);})['catch'](function(_0x53dacf){logger['error']('ShowZohoAccount',_0x53dacf[_0xf56b('0x13')],_0x198927);_0x3d1e47(_0x2736ee[_0xf56b('0x11')](0x1f4,_0x53dacf[_0xf56b('0x13')]));});});}; \ No newline at end of file +var _0xc248=['findAll','options','raw','attributes','include','map','model','ShowZohoAccount','ZohoAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetZohoAccount'];(function(_0x23b1dd,_0x2f562e){var _0x4881a0=function(_0x311f56){while(--_0x311f56){_0x23b1dd['push'](_0x23b1dd['shift']());}};_0x4881a0(++_0x2f562e);}(_0xc248,0x176));var _0x8c24=function(_0x1e3570,_0x20332e){_0x1e3570=_0x1e3570-0x0;var _0x1addaa=_0xc248[_0x1e3570];return _0x1addaa;};'use strict';var _=require(_0x8c24('0x0'));var util=require('util');var moment=require(_0x8c24('0x1'));var BPromise=require(_0x8c24('0x2'));var rs=require(_0x8c24('0x3'));var fs=require('fs');var Redis=require(_0x8c24('0x4'));var db=require(_0x8c24('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c24('0x6'))(_0x8c24('0x7'));var config=require(_0x8c24('0x8'));var jayson=require(_0x8c24('0x9'));var client=jayson['client'][_0x8c24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3afcd3,_0x5d7306,_0x216341){return new BPromise(function(_0x4d867b,_0x286027){return client[_0x8c24('0xb')](_0x3afcd3,_0x216341)[_0x8c24('0xc')](function(_0x54d4e8){logger[_0x8c24('0xd')](_0x8c24('0xe'),_0x5d7306,_0x8c24('0xf'));logger[_0x8c24('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5d7306,_0x8c24('0xf'),JSON[_0x8c24('0x11')](_0x54d4e8));if(_0x54d4e8[_0x8c24('0x12')]){if(_0x54d4e8['error']['code']===0x1f4){logger[_0x8c24('0x12')](_0x8c24('0xe'),_0x5d7306,_0x54d4e8[_0x8c24('0x12')][_0x8c24('0x13')]);return _0x286027(_0x54d4e8[_0x8c24('0x12')]['message']);}logger['error'](_0x8c24('0xe'),_0x5d7306,_0x54d4e8[_0x8c24('0x12')][_0x8c24('0x13')]);return _0x4d867b(_0x54d4e8[_0x8c24('0x12')][_0x8c24('0x13')]);}else{logger['info'](_0x8c24('0xe'),_0x5d7306,_0x8c24('0xf'));_0x4d867b(_0x54d4e8['result']['message']);}})[_0x8c24('0x14')](function(_0x11c7fe){logger[_0x8c24('0x12')](_0x8c24('0xe'),_0x5d7306,_0x11c7fe);_0x286027(_0x11c7fe);});});}exports[_0x8c24('0x15')]=function(_0x27c62e){var _0x9728a=this;return new Promise(function(_0x296618,_0x3a94e3){return db['ZohoAccount'][_0x8c24('0x16')]({'raw':_0x27c62e[_0x8c24('0x17')]?_0x27c62e['options'][_0x8c24('0x18')]===undefined?!![]:![]:!![],'where':_0x27c62e[_0x8c24('0x17')]?_0x27c62e['options']['where']||null:null,'attributes':_0x27c62e[_0x8c24('0x17')]?_0x27c62e[_0x8c24('0x17')][_0x8c24('0x19')]||null:null,'limit':_0x27c62e[_0x8c24('0x17')]?_0x27c62e['options']['limit']||null:null,'include':_0x27c62e['options']?_0x27c62e[_0x8c24('0x17')][_0x8c24('0x1a')]?_[_0x8c24('0x1b')](_0x27c62e['options'][_0x8c24('0x1a')],function(_0x3bdd93){return{'model':db[_0x3bdd93[_0x8c24('0x1c')]],'as':_0x3bdd93['as'],'attributes':_0x3bdd93[_0x8c24('0x19')],'include':_0x3bdd93[_0x8c24('0x1a')]?_[_0x8c24('0x1b')](_0x3bdd93[_0x8c24('0x1a')],function(_0x342aee){return{'model':db[_0x342aee[_0x8c24('0x1c')]],'as':_0x342aee['as'],'attributes':_0x342aee[_0x8c24('0x19')],'include':_0x342aee['include']?_[_0x8c24('0x1b')](_0x342aee[_0x8c24('0x1a')],function(_0x12bbf9){return{'model':db[_0x12bbf9[_0x8c24('0x1c')]],'as':_0x12bbf9['as'],'attributes':_0x12bbf9[_0x8c24('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8c24('0xc')](function(_0xa3ef1e){logger[_0x8c24('0xd')]('GetZohoAccount',_0x27c62e);logger[_0x8c24('0x10')](_0x8c24('0x15'),_0x27c62e,JSON[_0x8c24('0x11')](_0xa3ef1e));_0x296618(_0xa3ef1e);})[_0x8c24('0x14')](function(_0x1fc0e0){logger[_0x8c24('0x12')](_0x8c24('0x15'),_0x1fc0e0['message'],_0x27c62e);_0x3a94e3(_0x9728a[_0x8c24('0x12')](0x1f4,_0x1fc0e0[_0x8c24('0x13')]));});});};exports[_0x8c24('0x1d')]=function(_0x457f4d){var _0x3d44f1=this;return new Promise(function(_0x2e9ec0,_0xf11407){return db[_0x8c24('0x1e')][_0x8c24('0x1f')]({'raw':_0x457f4d['options']?_0x457f4d[_0x8c24('0x17')][_0x8c24('0x18')]===undefined?!![]:![]:!![],'where':_0x457f4d[_0x8c24('0x17')]?_0x457f4d[_0x8c24('0x17')][_0x8c24('0x20')]||null:null,'attributes':_0x457f4d['options']?_0x457f4d['options']['attributes']||null:null,'include':_0x457f4d[_0x8c24('0x17')]?_0x457f4d[_0x8c24('0x17')][_0x8c24('0x1a')]?_[_0x8c24('0x1b')](_0x457f4d[_0x8c24('0x17')][_0x8c24('0x1a')],function(_0x3086ab){return{'model':db[_0x3086ab[_0x8c24('0x1c')]],'as':_0x3086ab['as'],'attributes':_0x3086ab['attributes'],'include':_0x3086ab[_0x8c24('0x1a')]?_[_0x8c24('0x1b')](_0x3086ab[_0x8c24('0x1a')],function(_0x1c0937){return{'model':db[_0x1c0937['model']],'as':_0x1c0937['as'],'attributes':_0x1c0937[_0x8c24('0x19')],'include':_0x1c0937[_0x8c24('0x1a')]?_[_0x8c24('0x1b')](_0x1c0937[_0x8c24('0x1a')],function(_0x50686a){return{'model':db[_0x50686a[_0x8c24('0x1c')]],'as':_0x50686a['as'],'attributes':_0x50686a['attributes']};}):[]};}):[]};}):[]:[]})[_0x8c24('0xc')](function(_0x1ed402){logger[_0x8c24('0xd')](_0x8c24('0x1d'),_0x457f4d);logger[_0x8c24('0x10')]('ShowZohoAccount',_0x457f4d,JSON[_0x8c24('0x11')](_0x1ed402));_0x2e9ec0(_0x1ed402);})[_0x8c24('0x14')](function(_0xbc7b9){logger[_0x8c24('0x12')](_0x8c24('0x1d'),_0xbc7b9[_0x8c24('0x13')],_0x457f4d);_0xf11407(_0x3d44f1[_0x8c24('0x12')](0x1f4,_0xbc7b9[_0x8c24('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index e999d88..48ea354 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 _0x112a=['getDescriptions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x505a9c,_0x259283){var _0x5baeba=function(_0x59dcbc){while(--_0x59dcbc){_0x505a9c['push'](_0x505a9c['shift']());}};_0x5baeba(++_0x259283);}(_0x112a,0x115));var _0xa112=function(_0x2aac0b,_0x45294d){_0x2aac0b=_0x2aac0b-0x0;var _0x17b126=_0x112a[_0x2aac0b];return _0x17b126;};'use strict';var multer=require(_0xa112('0x0'));var util=require(_0xa112('0x1'));var path=require(_0xa112('0x2'));var timeout=require(_0xa112('0x3'));var express=require(_0xa112('0x4'));var router=express[_0xa112('0x5')]();var auth=require(_0xa112('0x6'));var interaction=require(_0xa112('0x7'));var config=require(_0xa112('0x8'));var controller=require(_0xa112('0x9'));router[_0xa112('0xa')]('/',auth[_0xa112('0xb')](),controller[_0xa112('0xc')]);router[_0xa112('0xa')](_0xa112('0xd'),auth[_0xa112('0xb')](),controller[_0xa112('0xe')]);router[_0xa112('0xa')](_0xa112('0xf'),auth[_0xa112('0xb')](),controller[_0xa112('0x10')]);router[_0xa112('0xa')](_0xa112('0x11'),auth['isAuthenticated'](),controller[_0xa112('0x12')]);router['get'](_0xa112('0x13'),auth[_0xa112('0xb')](),controller[_0xa112('0x14')]);router[_0xa112('0x15')]('/',auth[_0xa112('0xb')](),controller[_0xa112('0x16')]);router[_0xa112('0x17')](_0xa112('0xd'),auth[_0xa112('0xb')](),controller[_0xa112('0x18')]);router[_0xa112('0x19')](_0xa112('0xd'),auth[_0xa112('0xb')](),controller[_0xa112('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x38d0=['create','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','./intZohoConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post'];(function(_0x355515,_0x52573e){var _0x1d829c=function(_0x4a1ad2){while(--_0x4a1ad2){_0x355515['push'](_0x355515['shift']());}};_0x1d829c(++_0x52573e);}(_0x38d0,0x123));var _0x038d=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x38d0[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require(_0x038d('0x0'));var path=require(_0x038d('0x1'));var timeout=require(_0x038d('0x2'));var express=require('express');var router=express[_0x038d('0x3')]();var auth=require(_0x038d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x038d('0x5'));router['get']('/',auth[_0x038d('0x6')](),controller[_0x038d('0x7')]);router['get'](_0x038d('0x8'),auth[_0x038d('0x6')](),controller[_0x038d('0x9')]);router[_0x038d('0xa')](_0x038d('0xb'),auth[_0x038d('0x6')](),controller[_0x038d('0xc')]);router[_0x038d('0xa')](_0x038d('0xd'),auth[_0x038d('0x6')](),controller[_0x038d('0xe')]);router[_0x038d('0xa')]('/:id/descriptions',auth[_0x038d('0x6')](),controller[_0x038d('0xf')]);router[_0x038d('0x10')]('/',auth['isAuthenticated'](),controller[_0x038d('0x11')]);router[_0x038d('0x12')](_0x038d('0x8'),auth[_0x038d('0x6')](),controller[_0x038d('0x13')]);router[_0x038d('0x14')](_0x038d('0x8'),auth[_0x038d('0x6')](),controller[_0x038d('0x15')]);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 7ca8fd7..b3e9bd2 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 _0xcb0f=['ENUM','lead','contact','nothing','contact_lead','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb0f,0x18d));var _0xfcb0=function(_0x5bda4f,_0x22b15f){_0x5bda4f=_0x5bda4f-0x0;var _0x11f675=_0xcb0f[_0x5bda4f];return _0x11f675;};'use strict';var Sequelize=require(_0xfcb0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfcb0('0x1')]},'moduleCreate':{'type':Sequelize[_0xfcb0('0x2')](_0xfcb0('0x3'),_0xfcb0('0x4'),_0xfcb0('0x5')),'defaultValue':_0xfcb0('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xfcb0('0x6'),'contact',_0xfcb0('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xfcb0('0x1')]}}; \ No newline at end of file +var _0xd723=['nothing','contact_lead','sequelize','exports','STRING','ENUM','lead','contact'];(function(_0x5a836f,_0x48a129){var _0x2e0ac2=function(_0x48e439){while(--_0x48e439){_0x5a836f['push'](_0x5a836f['shift']());}};_0x2e0ac2(++_0x48a129);}(_0xd723,0x152));var _0x3d72=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xd723[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x3d72('0x0'));module[_0x3d72('0x1')]={'name':{'type':Sequelize[_0x3d72('0x2')]},'moduleCreate':{'type':Sequelize[_0x3d72('0x3')](_0x3d72('0x4'),_0x3d72('0x5'),_0x3d72('0x6')),'defaultValue':_0x3d72('0x4')},'moduleSearch':{'type':Sequelize[_0x3d72('0x3')](_0x3d72('0x7'),_0x3d72('0x5'),_0x3d72('0x4')),'defaultValue':_0x3d72('0x7')},'description':{'type':Sequelize[_0x3d72('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 6316c78..983ce2d 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','map','ZohoConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','getFields','findOne','ZohoField','order','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then'];(function(_0x1a0322,_0x2802d4){var _0x391779=function(_0x3d3c7c){while(--_0x3d3c7c){_0x1a0322['push'](_0x1a0322['shift']());}};_0x391779(++_0x2802d4);}(_0xe14b,0x93));var _0xbe14=function(_0x145d05,_0xfa7441){_0x145d05=_0x145d05-0x0;var _0x39710d=_0xe14b[_0x145d05];return _0x39710d;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var jayson=require(_0xbe14('0x15'));var client=jayson[_0xbe14('0x16')][_0xbe14('0x17')]({'port':0x232a});function checkPasswordPattern(_0x23a730,_0x2850cb,_0x16893f){if(_0x16893f){var _0xa2cf72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa2cf72[_0xbe14('0x18')](_0x2850cb)){return _0x23a730;}else{throw new db[(_0xbe14('0x19'))][(_0xbe14('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x23a730;}}function respondWithRpcPromise(_0x55b3a7,_0x3f58f5,_0x3dc4a9,_0xf4ac9){return new BPromise(function(_0x37ce4e,_0x4e8f34){var _0x21c789=_0xf4ac9||client;return _0x21c789[_0xbe14('0x1b')](_0x55b3a7,_0x3dc4a9)[_0xbe14('0x1c')](function(_0x123ede){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));logger['debug'](_0xbe14('0x20'),_0x3f58f5,_0xbe14('0x1f'),JSON[_0xbe14('0x21')](_0x123ede));if(_0x123ede[_0xbe14('0x22')]){if(_0x123ede[_0xbe14('0x22')][_0xbe14('0x23')]===0x1f4){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);return _0x4e8f34(_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);}logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede['error'][_0xbe14('0x24')]);return _0x37ce4e(_0x123ede['error'][_0xbe14('0x24')]);}else{logger['info'](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));_0x37ce4e(_0x123ede['result'][_0xbe14('0x24')]);}})['catch'](function(_0x4587a8){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x4587a8);_0x4e8f34(_0x4587a8);});});}function respondWithStatusCode(_0x5fa043,_0x1ee9c1){_0x1ee9c1=_0x1ee9c1||0xcc;return function(_0x39cc81){if(_0x39cc81){return _0x5fa043[_0xbe14('0x25')](_0x1ee9c1);}return _0x5fa043[_0xbe14('0x26')](_0x1ee9c1)['end']();};}function respondWithResult(_0x1822e0,_0x1ba46a){_0x1ba46a=_0x1ba46a||0xc8;return function(_0x391556){if(_0x391556){return _0x1822e0[_0xbe14('0x26')](_0x1ba46a)['json'](_0x391556);}};}function respondWithFilteredResult(_0x16f884,_0x29fc64){return function(_0x59bf34){if(_0x59bf34){var _0x3c3613=_0x59bf34[_0xbe14('0x27')],_0x3b3e84=_0x29fc64[_0xbe14('0x28')],_0x1c7cc7=_0x29fc64[_0xbe14('0x28')]+_0x29fc64[_0xbe14('0x29')],_0x19252f;if(_0x1c7cc7>=_0x3c3613){_0x1c7cc7=_0x3c3613;_0x19252f=0xc8;}else{_0x19252f=0xce;}_0x16f884[_0xbe14('0x26')](_0x19252f);return _0x16f884[_0xbe14('0x2a')](_0xbe14('0x2b'),_0x3b3e84+'-'+_0x1c7cc7+'/'+_0x3c3613)[_0xbe14('0x2c')](_0x59bf34);}return null;};}function patchUpdates(_0x39dc0a){return function(_0x10ae36){try{jsonpatch[_0xbe14('0x2d')](_0x10ae36,_0x39dc0a,!![]);}catch(_0xe6feb2){return BPromise[_0xbe14('0x2e')](_0xe6feb2);}return _0x10ae36[_0xbe14('0x2f')]();};}function saveUpdates(_0x29e76a,_0x14e7c4){return function(_0x581e86){if(_0x581e86){return _0x581e86[_0xbe14('0x30')](_0x29e76a)['then'](function(_0x58f8de){return _0x58f8de;});}return null;};}function removeEntity(_0x46c2d1,_0x4c1e7e){return function(_0x243524){if(_0x243524){return _0x243524[_0xbe14('0x31')]()['then'](function(){_0x46c2d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412ad5,_0xa3d24){return function(_0x5f27b6){if(!_0x5f27b6){_0x412ad5[_0xbe14('0x25')](0x194);}return _0x5f27b6;};}function handleError(_0x1faf3e,_0x452635){_0x452635=_0x452635||0x1f4;return function(_0x1aa849){logger[_0xbe14('0x22')](_0x1aa849['stack']);if(_0x1aa849['name']){delete _0x1aa849[_0xbe14('0x32')];}_0x1faf3e['status'](_0x452635)['send'](_0x1aa849);};}exports['index']=function(_0x163ef7,_0x393f6b){var _0x2bb45={},_0x3dbacb={},_0x172e79={'count':0x0,'rows':[]};var _0x29356f=_[_0xbe14('0x33')](db[_0xbe14('0x34')][_0xbe14('0x35')],function(_0x2dfd5a){return{'name':_0x2dfd5a[_0xbe14('0x36')],'type':_0x2dfd5a[_0xbe14('0x37')]['key']};});_0x3dbacb['model']=_[_0xbe14('0x33')](_0x29356f,_0xbe14('0x32'));_0x3dbacb[_0xbe14('0x38')]=_['keys'](_0x163ef7[_0xbe14('0x38')]);_0x3dbacb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],_0x3dbacb[_0xbe14('0x38')]);_0x2bb45[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x163ef7['query'][_0xbe14('0x3d')]));_0x2bb45[_0xbe14('0x3c')]=_0x2bb45[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x2bb45[_0xbe14('0x3c')]:_0x3dbacb[_0xbe14('0x3b')];if(!_0x163ef7['query'][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x2bb45[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x163ef7['query']['limit']);_0x2bb45[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x163ef7[_0xbe14('0x38')]['offset']);}_0x2bb45['order']=qs[_0xbe14('0x41')](_0x163ef7['query']['sort']);_0x2bb45[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x163ef7['query'],_0x3dbacb['filters']));if(_0x163ef7['query'][_0xbe14('0x44')]){_0x2bb45[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x2bb45['where'],{'$or':_[_0xbe14('0x33')](_0x29356f,function(_0xcb0680){if(_0xcb0680[_0xbe14('0x37')]!==_0xbe14('0x46')){var _0x58351f={};_0x58351f[_0xcb0680['name']]={'$like':'%'+_0x163ef7[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x58351f;}})});}_0x2bb45=_[_0xbe14('0x45')]({},_0x2bb45,_0x163ef7[_0xbe14('0x47')]);var _0x2550dc={'where':_0x2bb45['where']};return db['ZohoConfiguration'][_0xbe14('0x27')](_0x2550dc)[_0xbe14('0x1c')](function(_0x238c60){_0x172e79[_0xbe14('0x27')]=_0x238c60;if(_0x163ef7['query'][_0xbe14('0x48')]){_0x2bb45[_0xbe14('0x49')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xbe14('0x4a')](_0x2bb45);})[_0xbe14('0x1c')](function(_0x2d6ee8){_0x172e79[_0xbe14('0x4b')]=_0x2d6ee8;return _0x172e79;})['then'](respondWithFilteredResult(_0x393f6b,_0x2bb45))['catch'](handleError(_0x393f6b,null));};exports[_0xbe14('0x4c')]=function(_0x29564b,_0x4a1a37){var _0x5acf90={'raw':![],'where':{'id':_0x29564b[_0xbe14('0x4d')]['id']}},_0xca8cdb={};_0xca8cdb[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x34')][_0xbe14('0x35')]);_0xca8cdb[_0xbe14('0x38')]=_['keys'](_0x29564b[_0xbe14('0x38')]);_0xca8cdb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],_0xca8cdb[_0xbe14('0x38')]);_0x5acf90['attributes']=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x29564b[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x5acf90[_0xbe14('0x3c')]=_0x5acf90['attributes']['length']?_0x5acf90[_0xbe14('0x3c')]:_0xca8cdb[_0xbe14('0x3b')];if(_0x29564b[_0xbe14('0x38')]['includeAll']){_0x5acf90['include']=[{'all':!![]}];}_0x5acf90=_[_0xbe14('0x45')]({},_0x5acf90,_0x29564b[_0xbe14('0x47')]);return db['ZohoConfiguration'][_0xbe14('0x4f')](_0x5acf90)[_0xbe14('0x1c')](handleEntityNotFound(_0x4a1a37,null))['then'](respondWithResult(_0x4a1a37,null))[_0xbe14('0x50')](handleError(_0x4a1a37,null));};exports['create']=function(_0x41ba58,_0x410c59){return db[_0xbe14('0x34')]['create'](_0x41ba58[_0xbe14('0x51')],{})[_0xbe14('0x1c')](respondWithResult(_0x410c59,0xc9))['catch'](handleError(_0x410c59,null));};exports[_0xbe14('0x30')]=function(_0x42ca15,_0x2210cc){if(_0x42ca15[_0xbe14('0x51')]['id']){delete _0x42ca15[_0xbe14('0x51')]['id'];}return db['ZohoConfiguration'][_0xbe14('0x4f')]({'where':{'id':_0x42ca15[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x2210cc,null))[_0xbe14('0x1c')](saveUpdates(_0x42ca15[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x2210cc,null))[_0xbe14('0x50')](handleError(_0x2210cc,null));};exports['destroy']=function(_0x72c875,_0x1b47a4){return db[_0xbe14('0x34')][_0xbe14('0x4f')]({'where':{'id':_0x72c875[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x1b47a4,null))[_0xbe14('0x1c')](removeEntity(_0x1b47a4,null))[_0xbe14('0x50')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x52')]=function(_0xc61103,_0x358950,_0x4bccfc){var _0x56bcd3={};var _0x58dd79={};var _0x10c0bc;var _0x1bfcbf;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0xc61103[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x358950,null))[_0xbe14('0x1c')](function(_0x22bf69){if(_0x22bf69){_0x10c0bc=_0x22bf69;_0x58dd79[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x58dd79[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0xc61103[_0xbe14('0x38')]);_0x58dd79[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x58dd79[_0xbe14('0x3b')],_0x58dd79[_0xbe14('0x38')]);_0x56bcd3[_0xbe14('0x3c')]=_['intersection'](_0x58dd79[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x56bcd3[_0xbe14('0x3c')]=_0x56bcd3[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x56bcd3[_0xbe14('0x3c')]:_0x58dd79[_0xbe14('0x3b')];_0x56bcd3[_0xbe14('0x55')]=qs['sort'](_0xc61103[_0xbe14('0x38')][_0xbe14('0x41')]);_0x56bcd3[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0xc61103['query'],_0x58dd79[_0xbe14('0x39')]));if(_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]){_0x56bcd3[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x56bcd3['where'],{'$or':_[_0xbe14('0x33')](_0x56bcd3[_0xbe14('0x3c')],function(_0x7ea146){var _0x29bb26={};_0x29bb26[_0x7ea146]={'$like':'%'+_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x29bb26;})});}_0x56bcd3=_[_0xbe14('0x45')]({},_0x56bcd3,_0xc61103[_0xbe14('0x47')]);return _0x10c0bc['getFields'](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x33c309){if(_0x33c309){_0x1bfcbf=_0x33c309[_0xbe14('0x3e')];if(!_0xc61103[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x56bcd3[_0xbe14('0x29')]=qs['limit'](_0xc61103['query'][_0xbe14('0x29')]);_0x56bcd3[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x10c0bc[_0xbe14('0x52')](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x43511e){if(_0x43511e){return _0x43511e?{'count':_0x1bfcbf,'rows':_0x43511e}:null;}})['then'](respondWithResult(_0x358950,null))['catch'](handleError(_0x358950,null));};exports[_0xbe14('0x56')]=function(_0x1c18b6,_0x29aa52,_0x57729f){var _0x76e91e={};var _0x16bca1={};var _0x105be0;var _0x1797dd;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0x1c18b6[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29aa52,null))[_0xbe14('0x1c')](function(_0x3b6ef5){if(_0x3b6ef5){_0x105be0=_0x3b6ef5;_0x16bca1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x16bca1[_0xbe14('0x38')]=_['keys'](_0x1c18b6[_0xbe14('0x38')]);_0x16bca1[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],_0x16bca1[_0xbe14('0x38')]);_0x76e91e[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],qs['fields'](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x76e91e[_0xbe14('0x3c')]=_0x76e91e[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x76e91e[_0xbe14('0x3c')]:_0x16bca1['model'];_0x76e91e[_0xbe14('0x55')]=qs[_0xbe14('0x41')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x41')]);_0x76e91e['where']=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x1c18b6[_0xbe14('0x38')],_0x16bca1[_0xbe14('0x39')]));if(_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]){_0x76e91e[_0xbe14('0x42')]=_['merge'](_0x76e91e[_0xbe14('0x42')],{'$or':_['map'](_0x76e91e[_0xbe14('0x3c')],function(_0x5d85d3){var _0x389822={};_0x389822[_0x5d85d3]={'$like':'%'+_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x389822;})});}_0x76e91e=_['merge']({},_0x76e91e,_0x1c18b6[_0xbe14('0x47')]);return _0x105be0[_0xbe14('0x56')](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x546f22){if(_0x546f22){_0x1797dd=_0x546f22[_0xbe14('0x3e')];if(!_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x76e91e['limit']=qs[_0xbe14('0x29')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x29')]);_0x76e91e[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x105be0['getSubjects'](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x123f4f){if(_0x123f4f){return _0x123f4f?{'count':_0x1797dd,'rows':_0x123f4f}:null;}})[_0xbe14('0x1c')](respondWithResult(_0x29aa52,null))['catch'](handleError(_0x29aa52,null));};exports[_0xbe14('0x57')]=function(_0x420467,_0x1ea305,_0x5bc52b){var _0xa53262={};var _0x1205d1={};var _0x47d7bb;var _0x2be969;return db['ZohoConfiguration'][_0xbe14('0x53')]({'where':{'id':_0x420467[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ea305,null))['then'](function(_0x54045e){if(_0x54045e){_0x47d7bb=_0x54045e;_0x1205d1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db['ZohoField'][_0xbe14('0x35')]);_0x1205d1[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0x420467[_0xbe14('0x38')]);_0x1205d1['filters']=_['intersection'](_0x1205d1[_0xbe14('0x3b')],_0x1205d1[_0xbe14('0x38')]);_0xa53262[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x1205d1[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x420467[_0xbe14('0x38')]['fields']));_0xa53262[_0xbe14('0x3c')]=_0xa53262['attributes'][_0xbe14('0x3e')]?_0xa53262[_0xbe14('0x3c')]:_0x1205d1[_0xbe14('0x3b')];_0xa53262[_0xbe14('0x55')]=qs['sort'](_0x420467[_0xbe14('0x38')][_0xbe14('0x41')]);_0xa53262[_0xbe14('0x42')]=qs['filters'](_[_0xbe14('0x43')](_0x420467[_0xbe14('0x38')],_0x1205d1[_0xbe14('0x39')]));if(_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]){_0xa53262[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0xa53262[_0xbe14('0x42')],{'$or':_[_0xbe14('0x33')](_0xa53262[_0xbe14('0x3c')],function(_0x2bf94c){var _0x49497e={};_0x49497e[_0x2bf94c]={'$like':'%'+_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x49497e;})});}_0xa53262=_[_0xbe14('0x45')]({},_0xa53262,_0x420467[_0xbe14('0x47')]);return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x1679bd){if(_0x1679bd){_0x2be969=_0x1679bd[_0xbe14('0x3e')];if(!_0x420467['query'][_0xbe14('0x3f')]('nolimit')){_0xa53262[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x420467[_0xbe14('0x38')][_0xbe14('0x29')]);_0xa53262[_0xbe14('0x28')]=qs['offset'](_0x420467['query'][_0xbe14('0x28')]);}return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x42b849){if(_0x42b849){return _0x42b849?{'count':_0x2be969,'rows':_0x42b849}:null;}})['then'](respondWithResult(_0x1ea305,null))[_0xbe14('0x50')](handleError(_0x1ea305,null));}; \ No newline at end of file +var _0x34e8=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','end','sendStatus','stack','name','send','index','map','ZohoConfiguration','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','findAll','rows','show','params','keys','rawAttributes','includeAll','include','find','body','getFields','findOne','ZohoField','pick','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf'];(function(_0x17ae7f,_0x63befb){var _0x422eb6=function(_0x31a12a){while(--_0x31a12a){_0x17ae7f['push'](_0x17ae7f['shift']());}};_0x422eb6(++_0x63befb);}(_0x34e8,0x12c));var _0x834e=function(_0x3b04fd,_0x34425d){_0x3b04fd=_0x3b04fd-0x0;var _0x1530ef=_0x34e8[_0x3b04fd];return _0x1530ef;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x834e('0x1d')][_0x834e('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x58a27e,_0x23848e,_0x2d95f2){if(_0x2d95f2){var _0x28e659=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28e659[_0x834e('0x1f')](_0x23848e)){return _0x58a27e;}else{throw new db['Sequelize'][(_0x834e('0x20'))](_0x834e('0x21'));}}else{return _0x58a27e;}}function respondWithRpcPromise(_0x57274a,_0x316205,_0x4a9cdc,_0x38a8cd){return new BPromise(function(_0x36d443,_0x478afe){var _0x43ac41=_0x38a8cd||client;return _0x43ac41[_0x834e('0x22')](_0x57274a,_0x4a9cdc)[_0x834e('0x23')](function(_0x50b3f6){logger[_0x834e('0x24')](_0x834e('0x25'),_0x316205,_0x834e('0x26'));logger[_0x834e('0x27')](_0x834e('0x28'),_0x316205,_0x834e('0x26'),JSON[_0x834e('0x29')](_0x50b3f6));if(_0x50b3f6['error']){if(_0x50b3f6[_0x834e('0x2a')][_0x834e('0x2b')]===0x1f4){logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6['error'][_0x834e('0x2c')]);return _0x478afe(_0x50b3f6[_0x834e('0x2a')]['message']);}logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6[_0x834e('0x2a')]['message']);return _0x36d443(_0x50b3f6['error'][_0x834e('0x2c')]);}else{logger[_0x834e('0x24')]('ZohoConfiguration,\x20%s,\x20%s',_0x316205,_0x834e('0x26'));_0x36d443(_0x50b3f6[_0x834e('0x2d')]['message']);}})[_0x834e('0x2e')](function(_0x2e1983){logger[_0x834e('0x2a')]('ZohoConfiguration,\x20%s,\x20%s',_0x316205,_0x2e1983);_0x478afe(_0x2e1983);});});}function respondWithStatusCode(_0x24fcf7,_0x3e310f){_0x3e310f=_0x3e310f||0xcc;return function(_0x5e1cc5){if(_0x5e1cc5){return _0x24fcf7['sendStatus'](_0x3e310f);}return _0x24fcf7[_0x834e('0x2f')](_0x3e310f)['end']();};}function respondWithResult(_0x2826ec,_0x3f1b0b){_0x3f1b0b=_0x3f1b0b||0xc8;return function(_0x3db026){if(_0x3db026){return _0x2826ec[_0x834e('0x2f')](_0x3f1b0b)[_0x834e('0x30')](_0x3db026);}};}function respondWithFilteredResult(_0x130cc5,_0x491919){return function(_0x510780){if(_0x510780){var _0x4dc64a=_0x510780[_0x834e('0x31')],_0x58c1d7=_0x491919['offset'],_0x2c7a8d=_0x491919[_0x834e('0x32')]+_0x491919[_0x834e('0x33')],_0x567cea;if(_0x2c7a8d>=_0x4dc64a){_0x2c7a8d=_0x4dc64a;_0x567cea=0xc8;}else{_0x567cea=0xce;}_0x130cc5[_0x834e('0x2f')](_0x567cea);return _0x130cc5[_0x834e('0x34')](_0x834e('0x35'),_0x58c1d7+'-'+_0x2c7a8d+'/'+_0x4dc64a)[_0x834e('0x30')](_0x510780);}return null;};}function patchUpdates(_0x3d149d){return function(_0xfaf716){try{jsonpatch[_0x834e('0x36')](_0xfaf716,_0x3d149d,!![]);}catch(_0x493289){return BPromise[_0x834e('0x37')](_0x493289);}return _0xfaf716['save']();};}function saveUpdates(_0x2c75c2,_0x3787b0){return function(_0x9ab921){if(_0x9ab921){return _0x9ab921[_0x834e('0x38')](_0x2c75c2)[_0x834e('0x23')](function(_0x4689c2){return _0x4689c2;});}return null;};}function removeEntity(_0x4696a1,_0x38cd29){return function(_0x358c31){if(_0x358c31){return _0x358c31[_0x834e('0x39')]()['then'](function(){_0x4696a1[_0x834e('0x2f')](0xcc)[_0x834e('0x3a')]();});}};}function handleEntityNotFound(_0x24a9df,_0xaf01f4){return function(_0x595cc0){if(!_0x595cc0){_0x24a9df[_0x834e('0x3b')](0x194);}return _0x595cc0;};}function handleError(_0x379d60,_0x4b12f5){_0x4b12f5=_0x4b12f5||0x1f4;return function(_0x496533){logger['error'](_0x496533[_0x834e('0x3c')]);if(_0x496533[_0x834e('0x3d')]){delete _0x496533[_0x834e('0x3d')];}_0x379d60[_0x834e('0x2f')](_0x4b12f5)[_0x834e('0x3e')](_0x496533);};}exports[_0x834e('0x3f')]=function(_0x4c2ef6,_0x2c2d94){var _0x513f36={},_0xe103fe={},_0x6a3ac={'count':0x0,'rows':[]};var _0x47abed=_[_0x834e('0x40')](db[_0x834e('0x41')]['rawAttributes'],function(_0x481f70){return{'name':_0x481f70[_0x834e('0x42')],'type':_0x481f70[_0x834e('0x43')][_0x834e('0x44')]};});_0xe103fe[_0x834e('0x45')]=_[_0x834e('0x40')](_0x47abed,'name');_0xe103fe[_0x834e('0x46')]=_['keys'](_0x4c2ef6['query']);_0xe103fe[_0x834e('0x47')]=_['intersection'](_0xe103fe[_0x834e('0x45')],_0xe103fe[_0x834e('0x46')]);_0x513f36[_0x834e('0x48')]=_[_0x834e('0x49')](_0xe103fe[_0x834e('0x45')],qs['fields'](_0x4c2ef6[_0x834e('0x46')][_0x834e('0x4a')]));_0x513f36[_0x834e('0x48')]=_0x513f36['attributes'][_0x834e('0x4b')]?_0x513f36[_0x834e('0x48')]:_0xe103fe['model'];if(!_0x4c2ef6[_0x834e('0x46')]['hasOwnProperty'](_0x834e('0x4c'))){_0x513f36[_0x834e('0x33')]=qs['limit'](_0x4c2ef6['query'][_0x834e('0x33')]);_0x513f36[_0x834e('0x32')]=qs[_0x834e('0x32')](_0x4c2ef6[_0x834e('0x46')][_0x834e('0x32')]);}_0x513f36[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x4c2ef6['query'][_0x834e('0x4e')]);_0x513f36['where']=qs[_0x834e('0x47')](_['pick'](_0x4c2ef6[_0x834e('0x46')],_0xe103fe['filters']));if(_0x4c2ef6[_0x834e('0x46')][_0x834e('0x4f')]){_0x513f36['where']=_[_0x834e('0x50')](_0x513f36[_0x834e('0x51')],{'$or':_[_0x834e('0x40')](_0x47abed,function(_0xd55cc3){if(_0xd55cc3[_0x834e('0x43')]!==_0x834e('0x52')){var _0xfa28da={};_0xfa28da[_0xd55cc3[_0x834e('0x3d')]]={'$like':'%'+_0x4c2ef6[_0x834e('0x46')][_0x834e('0x4f')]+'%'};return _0xfa28da;}})});}_0x513f36=_['merge']({},_0x513f36,_0x4c2ef6[_0x834e('0x53')]);var _0x6fff27={'where':_0x513f36['where']};return db[_0x834e('0x41')][_0x834e('0x31')](_0x6fff27)[_0x834e('0x23')](function(_0x2112d5){_0x6a3ac[_0x834e('0x31')]=_0x2112d5;if(_0x4c2ef6[_0x834e('0x46')]['includeAll']){_0x513f36['include']=[{'all':!![]}];}return db[_0x834e('0x41')][_0x834e('0x54')](_0x513f36);})[_0x834e('0x23')](function(_0x40ff5a){_0x6a3ac[_0x834e('0x55')]=_0x40ff5a;return _0x6a3ac;})[_0x834e('0x23')](respondWithFilteredResult(_0x2c2d94,_0x513f36))[_0x834e('0x2e')](handleError(_0x2c2d94,null));};exports[_0x834e('0x56')]=function(_0x1419eb,_0x390c45){var _0xf02f0d={'raw':![],'where':{'id':_0x1419eb[_0x834e('0x57')]['id']}},_0x385435={};_0x385435[_0x834e('0x45')]=_[_0x834e('0x58')](db[_0x834e('0x41')][_0x834e('0x59')]);_0x385435[_0x834e('0x46')]=_[_0x834e('0x58')](_0x1419eb[_0x834e('0x46')]);_0x385435['filters']=_[_0x834e('0x49')](_0x385435[_0x834e('0x45')],_0x385435['query']);_0xf02f0d[_0x834e('0x48')]=_[_0x834e('0x49')](_0x385435['model'],qs[_0x834e('0x4a')](_0x1419eb[_0x834e('0x46')][_0x834e('0x4a')]));_0xf02f0d[_0x834e('0x48')]=_0xf02f0d[_0x834e('0x48')][_0x834e('0x4b')]?_0xf02f0d[_0x834e('0x48')]:_0x385435['model'];if(_0x1419eb[_0x834e('0x46')][_0x834e('0x5a')]){_0xf02f0d[_0x834e('0x5b')]=[{'all':!![]}];}_0xf02f0d=_[_0x834e('0x50')]({},_0xf02f0d,_0x1419eb[_0x834e('0x53')]);return db[_0x834e('0x41')][_0x834e('0x5c')](_0xf02f0d)[_0x834e('0x23')](handleEntityNotFound(_0x390c45,null))['then'](respondWithResult(_0x390c45,null))[_0x834e('0x2e')](handleError(_0x390c45,null));};exports['create']=function(_0x2f4bde,_0x53a9ee){return db[_0x834e('0x41')]['create'](_0x2f4bde['body'],{})[_0x834e('0x23')](respondWithResult(_0x53a9ee,0xc9))[_0x834e('0x2e')](handleError(_0x53a9ee,null));};exports['update']=function(_0x5be43d,_0x2c8155){if(_0x5be43d[_0x834e('0x5d')]['id']){delete _0x5be43d[_0x834e('0x5d')]['id'];}return db[_0x834e('0x41')][_0x834e('0x5c')]({'where':{'id':_0x5be43d[_0x834e('0x57')]['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x2c8155,null))[_0x834e('0x23')](saveUpdates(_0x5be43d['body'],null))[_0x834e('0x23')](respondWithResult(_0x2c8155,null))[_0x834e('0x2e')](handleError(_0x2c8155,null));};exports['destroy']=function(_0x281342,_0x4e2b22){return db[_0x834e('0x41')][_0x834e('0x5c')]({'where':{'id':_0x281342['params']['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x4e2b22,null))[_0x834e('0x23')](removeEntity(_0x4e2b22,null))[_0x834e('0x2e')](handleError(_0x4e2b22,null));};exports[_0x834e('0x5e')]=function(_0x5a2924,_0xe35ded,_0x438f75){var _0x1dfd5f={};var _0x5925ef={};var _0x246b8e;var _0x1fcae9;return db[_0x834e('0x41')][_0x834e('0x5f')]({'where':{'id':_0x5a2924[_0x834e('0x57')]['id']}})[_0x834e('0x23')](handleEntityNotFound(_0xe35ded,null))[_0x834e('0x23')](function(_0x1def00){if(_0x1def00){_0x246b8e=_0x1def00;_0x5925ef[_0x834e('0x45')]=_[_0x834e('0x58')](db[_0x834e('0x60')][_0x834e('0x59')]);_0x5925ef[_0x834e('0x46')]=_[_0x834e('0x58')](_0x5a2924[_0x834e('0x46')]);_0x5925ef[_0x834e('0x47')]=_[_0x834e('0x49')](_0x5925ef[_0x834e('0x45')],_0x5925ef[_0x834e('0x46')]);_0x1dfd5f[_0x834e('0x48')]=_[_0x834e('0x49')](_0x5925ef[_0x834e('0x45')],qs['fields'](_0x5a2924[_0x834e('0x46')][_0x834e('0x4a')]));_0x1dfd5f[_0x834e('0x48')]=_0x1dfd5f[_0x834e('0x48')]['length']?_0x1dfd5f[_0x834e('0x48')]:_0x5925ef['model'];_0x1dfd5f['order']=qs[_0x834e('0x4e')](_0x5a2924[_0x834e('0x46')][_0x834e('0x4e')]);_0x1dfd5f[_0x834e('0x51')]=qs[_0x834e('0x47')](_[_0x834e('0x61')](_0x5a2924[_0x834e('0x46')],_0x5925ef[_0x834e('0x47')]));if(_0x5a2924['query'][_0x834e('0x4f')]){_0x1dfd5f['where']=_[_0x834e('0x50')](_0x1dfd5f[_0x834e('0x51')],{'$or':_['map'](_0x1dfd5f['attributes'],function(_0x4a4def){var _0x82f2a7={};_0x82f2a7[_0x4a4def]={'$like':'%'+_0x5a2924[_0x834e('0x46')][_0x834e('0x4f')]+'%'};return _0x82f2a7;})});}_0x1dfd5f=_[_0x834e('0x50')]({},_0x1dfd5f,_0x5a2924['options']);return _0x246b8e[_0x834e('0x5e')](_0x1dfd5f);}})[_0x834e('0x23')](function(_0x2df64f){if(_0x2df64f){_0x1fcae9=_0x2df64f[_0x834e('0x4b')];if(!_0x5a2924[_0x834e('0x46')][_0x834e('0x62')](_0x834e('0x4c'))){_0x1dfd5f[_0x834e('0x33')]=qs[_0x834e('0x33')](_0x5a2924[_0x834e('0x46')]['limit']);_0x1dfd5f[_0x834e('0x32')]=qs[_0x834e('0x32')](_0x5a2924[_0x834e('0x46')][_0x834e('0x32')]);}return _0x246b8e['getFields'](_0x1dfd5f);}})[_0x834e('0x23')](function(_0x4ac5f2){if(_0x4ac5f2){return _0x4ac5f2?{'count':_0x1fcae9,'rows':_0x4ac5f2}:null;}})['then'](respondWithResult(_0xe35ded,null))['catch'](handleError(_0xe35ded,null));};exports[_0x834e('0x63')]=function(_0x332d8f,_0x514aac,_0x2645df){var _0x1b200d={};var _0x4d4477={};var _0x353246;var _0x18ccb2;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x332d8f[_0x834e('0x57')]['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x514aac,null))[_0x834e('0x23')](function(_0x44c909){if(_0x44c909){_0x353246=_0x44c909;_0x4d4477[_0x834e('0x45')]=_['keys'](db[_0x834e('0x60')]['rawAttributes']);_0x4d4477[_0x834e('0x46')]=_[_0x834e('0x58')](_0x332d8f[_0x834e('0x46')]);_0x4d4477['filters']=_[_0x834e('0x49')](_0x4d4477[_0x834e('0x45')],_0x4d4477['query']);_0x1b200d[_0x834e('0x48')]=_[_0x834e('0x49')](_0x4d4477[_0x834e('0x45')],qs['fields'](_0x332d8f[_0x834e('0x46')][_0x834e('0x4a')]));_0x1b200d[_0x834e('0x48')]=_0x1b200d[_0x834e('0x48')][_0x834e('0x4b')]?_0x1b200d[_0x834e('0x48')]:_0x4d4477[_0x834e('0x45')];_0x1b200d[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x332d8f[_0x834e('0x46')]['sort']);_0x1b200d['where']=qs['filters'](_[_0x834e('0x61')](_0x332d8f[_0x834e('0x46')],_0x4d4477[_0x834e('0x47')]));if(_0x332d8f[_0x834e('0x46')][_0x834e('0x4f')]){_0x1b200d['where']=_['merge'](_0x1b200d[_0x834e('0x51')],{'$or':_[_0x834e('0x40')](_0x1b200d[_0x834e('0x48')],function(_0x18ddac){var _0x40a705={};_0x40a705[_0x18ddac]={'$like':'%'+_0x332d8f['query'][_0x834e('0x4f')]+'%'};return _0x40a705;})});}_0x1b200d=_[_0x834e('0x50')]({},_0x1b200d,_0x332d8f[_0x834e('0x53')]);return _0x353246['getSubjects'](_0x1b200d);}})[_0x834e('0x23')](function(_0x18fde1){if(_0x18fde1){_0x18ccb2=_0x18fde1[_0x834e('0x4b')];if(!_0x332d8f[_0x834e('0x46')][_0x834e('0x62')]('nolimit')){_0x1b200d['limit']=qs[_0x834e('0x33')](_0x332d8f[_0x834e('0x46')]['limit']);_0x1b200d[_0x834e('0x32')]=qs['offset'](_0x332d8f[_0x834e('0x46')][_0x834e('0x32')]);}return _0x353246[_0x834e('0x63')](_0x1b200d);}})['then'](function(_0x155c0f){if(_0x155c0f){return _0x155c0f?{'count':_0x18ccb2,'rows':_0x155c0f}:null;}})['then'](respondWithResult(_0x514aac,null))['catch'](handleError(_0x514aac,null));};exports['getDescriptions']=function(_0x6735e6,_0x4627ac,_0x1d7bab){var _0x1d76c6={};var _0x3b18d0={};var _0x2dad55;var _0x3aa388;return db[_0x834e('0x41')][_0x834e('0x5f')]({'where':{'id':_0x6735e6['params']['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x4627ac,null))['then'](function(_0x11a9f7){if(_0x11a9f7){_0x2dad55=_0x11a9f7;_0x3b18d0[_0x834e('0x45')]=_[_0x834e('0x58')](db[_0x834e('0x60')][_0x834e('0x59')]);_0x3b18d0[_0x834e('0x46')]=_['keys'](_0x6735e6['query']);_0x3b18d0[_0x834e('0x47')]=_[_0x834e('0x49')](_0x3b18d0['model'],_0x3b18d0[_0x834e('0x46')]);_0x1d76c6[_0x834e('0x48')]=_[_0x834e('0x49')](_0x3b18d0[_0x834e('0x45')],qs[_0x834e('0x4a')](_0x6735e6['query'][_0x834e('0x4a')]));_0x1d76c6[_0x834e('0x48')]=_0x1d76c6['attributes']['length']?_0x1d76c6['attributes']:_0x3b18d0[_0x834e('0x45')];_0x1d76c6[_0x834e('0x4d')]=qs['sort'](_0x6735e6[_0x834e('0x46')][_0x834e('0x4e')]);_0x1d76c6['where']=qs[_0x834e('0x47')](_['pick'](_0x6735e6['query'],_0x3b18d0[_0x834e('0x47')]));if(_0x6735e6[_0x834e('0x46')][_0x834e('0x4f')]){_0x1d76c6[_0x834e('0x51')]=_['merge'](_0x1d76c6[_0x834e('0x51')],{'$or':_[_0x834e('0x40')](_0x1d76c6[_0x834e('0x48')],function(_0x1b0b41){var _0x46aabf={};_0x46aabf[_0x1b0b41]={'$like':'%'+_0x6735e6[_0x834e('0x46')][_0x834e('0x4f')]+'%'};return _0x46aabf;})});}_0x1d76c6=_[_0x834e('0x50')]({},_0x1d76c6,_0x6735e6[_0x834e('0x53')]);return _0x2dad55[_0x834e('0x64')](_0x1d76c6);}})[_0x834e('0x23')](function(_0x261e3d){if(_0x261e3d){_0x3aa388=_0x261e3d[_0x834e('0x4b')];if(!_0x6735e6[_0x834e('0x46')][_0x834e('0x62')](_0x834e('0x4c'))){_0x1d76c6[_0x834e('0x33')]=qs[_0x834e('0x33')](_0x6735e6[_0x834e('0x46')][_0x834e('0x33')]);_0x1d76c6[_0x834e('0x32')]=qs[_0x834e('0x32')](_0x6735e6['query'][_0x834e('0x32')]);}return _0x2dad55[_0x834e('0x64')](_0x1d76c6);}})[_0x834e('0x23')](function(_0x2dab75){if(_0x2dab75){return _0x2dab75?{'count':_0x3aa388,'rows':_0x2dab75}:null;}})[_0x834e('0x23')](respondWithResult(_0x4627ac,null))[_0x834e('0x2e')](handleError(_0x4627ac,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 90c00e8..397eed2 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 _0x6126=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','lodash','util','../../config/logger'];(function(_0x4ca6f2,_0x45a24a){var _0x2e0d81=function(_0x54fe07){while(--_0x54fe07){_0x4ca6f2['push'](_0x4ca6f2['shift']());}};_0x2e0d81(++_0x45a24a);}(_0x6126,0x1a1));var _0x6612=function(_0x480a07,_0x2147f2){_0x480a07=_0x480a07-0x0;var _0xed5d11=_0x6126[_0x480a07];return _0xed5d11;};'use strict';var _=require(_0x6612('0x0'));var util=require(_0x6612('0x1'));var logger=require(_0x6612('0x2'))(_0x6612('0x3'));var moment=require(_0x6612('0x4'));var BPromise=require(_0x6612('0x5'));var rp=require(_0x6612('0x6'));var fs=require('fs');var path=require(_0x6612('0x7'));var rimraf=require(_0x6612('0x8'));var config=require(_0x6612('0x9'));var attributes=require(_0x6612('0xa'));module['exports']=function(_0x169423,_0x31771f){return _0x169423[_0x6612('0xb')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3dfb=['bluebird','rimraf','../../config/environment','exports','define','lodash','api','moment'];(function(_0x11dd75,_0x340f1c){var _0x21bd9b=function(_0x22f10f){while(--_0x22f10f){_0x11dd75['push'](_0x11dd75['shift']());}};_0x21bd9b(++_0x340f1c);}(_0x3dfb,0x1ed));var _0xb3df=function(_0x1fc70d,_0x270e32){_0x1fc70d=_0x1fc70d-0x0;var _0x42d78a=_0x3dfb[_0x1fc70d];return _0x42d78a;};'use strict';var _=require(_0xb3df('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb3df('0x1'));var moment=require(_0xb3df('0x2'));var BPromise=require(_0xb3df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb3df('0x4'));var config=require(_0xb3df('0x5'));var attributes=require('./intZohoConfiguration.attributes');module[_0xb3df('0x6')]=function(_0x59ed48,_0x389f9f){return _0x59ed48[_0xb3df('0x7')]('ZohoConfiguration',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 7c8ddba..0c2efdb 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 _0x90b1=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x50032d,_0x5bc969){var _0xb92fd6=function(_0x4b3200){while(--_0x4b3200){_0x50032d['push'](_0x50032d['shift']());}};_0xb92fd6(++_0x5bc969);}(_0x90b1,0x1b6));var _0x190b=function(_0x38e370,_0x2f9d10){_0x38e370=_0x38e370-0x0;var _0x53a265=_0x90b1[_0x38e370];return _0x53a265;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require('moment');var BPromise=require(_0x190b('0x2'));var rs=require(_0x190b('0x3'));var fs=require('fs');var Redis=require(_0x190b('0x4'));var db=require(_0x190b('0x5'))['db'];var utils=require(_0x190b('0x6'));var logger=require(_0x190b('0x7'))(_0x190b('0x8'));var config=require(_0x190b('0x9'));var jayson=require(_0x190b('0xa'));var client=jayson[_0x190b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4895a4,_0x50fa92,_0x724a1c){return new BPromise(function(_0xe4fac8,_0x5a459e){return client[_0x190b('0xc')](_0x4895a4,_0x724a1c)[_0x190b('0xd')](function(_0x3b44fc){logger[_0x190b('0xe')](_0x190b('0xf'),_0x50fa92,_0x190b('0x10'));logger[_0x190b('0x11')](_0x190b('0x12'),_0x50fa92,_0x190b('0x10'),JSON['stringify'](_0x3b44fc));if(_0x3b44fc[_0x190b('0x13')]){if(_0x3b44fc['error'][_0x190b('0x14')]===0x1f4){logger[_0x190b('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x50fa92,_0x3b44fc[_0x190b('0x13')][_0x190b('0x15')]);return _0x5a459e(_0x3b44fc[_0x190b('0x13')]['message']);}logger[_0x190b('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x50fa92,_0x3b44fc['error']['message']);return _0xe4fac8(_0x3b44fc[_0x190b('0x13')]['message']);}else{logger[_0x190b('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x50fa92,'request\x20sent');_0xe4fac8(_0x3b44fc[_0x190b('0x16')][_0x190b('0x15')]);}})['catch'](function(_0x406f86){logger[_0x190b('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x50fa92,_0x406f86);_0x5a459e(_0x406f86);});});} \ No newline at end of file +var _0xd519=['http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3bc667,_0x3928d8){var _0x417552=function(_0x5cf446){while(--_0x5cf446){_0x3bc667['push'](_0x3bc667['shift']());}};_0x417552(++_0x3928d8);}(_0xd519,0x96));var _0x9d51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd519[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d51('0x0'));var util=require('util');var moment=require(_0x9d51('0x1'));var BPromise=require(_0x9d51('0x2'));var rs=require(_0x9d51('0x3'));var fs=require('fs');var Redis=require(_0x9d51('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d51('0x5'));var logger=require(_0x9d51('0x6'))(_0x9d51('0x7'));var config=require(_0x9d51('0x8'));var jayson=require(_0x9d51('0x9'));var client=jayson['client'][_0x9d51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f2f1c,_0x537220,_0x542d4e){return new BPromise(function(_0x35042d,_0x1bcf39){return client[_0x9d51('0xb')](_0x1f2f1c,_0x542d4e)[_0x9d51('0xc')](function(_0x16141c){logger[_0x9d51('0xd')](_0x9d51('0xe'),_0x537220,_0x9d51('0xf'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x537220,'request\x20sent',JSON['stringify'](_0x16141c));if(_0x16141c[_0x9d51('0x10')]){if(_0x16141c[_0x9d51('0x10')][_0x9d51('0x11')]===0x1f4){logger['error'](_0x9d51('0xe'),_0x537220,_0x16141c[_0x9d51('0x10')][_0x9d51('0x12')]);return _0x1bcf39(_0x16141c['error'][_0x9d51('0x12')]);}logger[_0x9d51('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x537220,_0x16141c[_0x9d51('0x10')][_0x9d51('0x12')]);return _0x35042d(_0x16141c[_0x9d51('0x10')]['message']);}else{logger[_0x9d51('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x537220,'request\x20sent');_0x35042d(_0x16141c['result']['message']);}})[_0x9d51('0x13')](function(_0x2c6dd2){logger['error'](_0x9d51('0xe'),_0x537220,_0x2c6dd2);_0x1bcf39(_0x2c6dd2);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 1dc520c..817bf2a 100644 --- a/server/api/intZohoField/index.js +++ b/server/api/intZohoField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4213=['../../config/environment','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x4213,0x77));var _0x3421=function(_0x1f1586,_0x4aa259){_0x1f1586=_0x1f1586-0x0;var _0x52f4b8=_0x4213[_0x1f1586];return _0x52f4b8;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var auth=require(_0x3421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3421('0x7'));var controller=require('./intZohoField.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0xc')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xd')]);router['put'](_0x3421('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x3421('0xf')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0x10')]);module[_0x3421('0x11')]=router; \ No newline at end of file +var _0x627e=['show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated'];(function(_0x10d583,_0x3804ae){var _0x2ae059=function(_0x2cdc1a){while(--_0x2cdc1a){_0x10d583['push'](_0x10d583['shift']());}};_0x2ae059(++_0x3804ae);}(_0x627e,0x14a));var _0xe627=function(_0x1db07a,_0x1ffa54){_0x1db07a=_0x1db07a-0x0;var _0x29ddfc=_0x627e[_0x1db07a];return _0x29ddfc;};'use strict';var multer=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var path=require(_0xe627('0x2'));var timeout=require(_0xe627('0x3'));var express=require(_0xe627('0x4'));var router=express['Router']();var auth=require(_0xe627('0x5'));var interaction=require(_0xe627('0x6'));var config=require(_0xe627('0x7'));var controller=require('./intZohoField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe627('0x8')]);router[_0xe627('0x9')](_0xe627('0xa'),auth[_0xe627('0xb')](),controller[_0xe627('0xc')]);router[_0xe627('0xd')]('/',auth['isAuthenticated'](),controller[_0xe627('0xe')]);router['put']('/:id',auth[_0xe627('0xb')](),controller[_0xe627('0xf')]);router['delete']('/:id',auth[_0xe627('0xb')](),controller[_0xe627('0x10')]);module[_0xe627('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 8413ac1..308c4c0 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 _0x28a0=['STRING','BOOLEAN','sequelize','ENUM','string','variable','keyValue','customVariable'];(function(_0x20bf62,_0x3af0d9){var _0x50e077=function(_0x46b7f0){while(--_0x46b7f0){_0x20bf62['push'](_0x20bf62['shift']());}};_0x50e077(++_0x3af0d9);}(_0x28a0,0x8a));var _0x028a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x28a0[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x028a('0x0'));module['exports']={'type':{'type':Sequelize[_0x028a('0x1')](_0x028a('0x2'),_0x028a('0x3'),'customVariable',_0x028a('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x028a('0x1')]('string',_0x028a('0x3'),_0x028a('0x5'))},'keyContent':{'type':Sequelize[_0x028a('0x6')]},'idField':{'type':Sequelize[_0x028a('0x6')]},'nameField':{'type':Sequelize[_0x028a('0x6')]},'customField':{'type':Sequelize[_0x028a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x028a('0x6')]}}; \ No newline at end of file +var _0xff98=['keyValue','STRING','customVariable','BOOLEAN','exports','ENUM','string','variable'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0xff98,0x9c));var _0x8ff9=function(_0x427826,_0x25719a){_0x427826=_0x427826-0x0;var _0x2a6bfd=_0xff98[_0x427826];return _0x2a6bfd;};'use strict';var Sequelize=require('sequelize');module[_0x8ff9('0x0')]={'type':{'type':Sequelize[_0x8ff9('0x1')](_0x8ff9('0x2'),_0x8ff9('0x3'),'customVariable',_0x8ff9('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8ff9('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8ff9('0x1')]('string',_0x8ff9('0x3'),_0x8ff9('0x6'))},'keyContent':{'type':Sequelize[_0x8ff9('0x5')]},'idField':{'type':Sequelize[_0x8ff9('0x5')]},'nameField':{'type':Sequelize[_0x8ff9('0x5')]},'customField':{'type':Sequelize[_0x8ff9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8ff9('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 1164d9e..8a7f93a 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 _0x9a8a=['filters','pick','where','VIRTUAL','merge','options','ZohoField','includeAll','include','findAll','rows','catch','keys','create','body','find','params','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0xf26e77,_0x429091){var _0x3256fe=function(_0x3e6a51){while(--_0x3e6a51){_0xf26e77['push'](_0xf26e77['shift']());}};_0x3256fe(++_0x429091);}(_0x9a8a,0x1f4));var _0xa9a8=function(_0x455f6a,_0x5d6830){_0x455f6a=_0x455f6a-0x0;var _0x27cb9f=_0x9a8a[_0x455f6a];return _0x27cb9f;};'use strict';var pdf=require(_0xa9a8('0x0'));var emlformat=require(_0xa9a8('0x1'));var rimraf=require(_0xa9a8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa9a8('0x3'));var moment=require('moment');var BPromise=require(_0xa9a8('0x4'));var Mustache=require(_0xa9a8('0x5'));var util=require(_0xa9a8('0x6'));var path=require(_0xa9a8('0x7'));var sox=require(_0xa9a8('0x8'));var csv=require(_0xa9a8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa9a8('0xa'));var squel=require(_0xa9a8('0xb'));var crypto=require(_0xa9a8('0xc'));var jsforce=require(_0xa9a8('0xd'));var deskjs=require(_0xa9a8('0xe'));var toCsv=require(_0xa9a8('0x9'));var querystring=require(_0xa9a8('0xf'));var Papa=require('papaparse');var Redis=require(_0xa9a8('0x10'));var authService=require(_0xa9a8('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9a8('0x12'))(_0xa9a8('0x13'));var utils=require(_0xa9a8('0x14'));var config=require(_0xa9a8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2135d0,_0x129881){_0x129881=_0x129881||0xcc;return function(_0x55fe0e){if(_0x55fe0e){return _0x2135d0[_0xa9a8('0x16')](_0x129881);}return _0x2135d0[_0xa9a8('0x17')](_0x129881)[_0xa9a8('0x18')]();};}function respondWithResult(_0x4a96e6,_0x55d2ee){_0x55d2ee=_0x55d2ee||0xc8;return function(_0x32962c){if(_0x32962c){return _0x4a96e6[_0xa9a8('0x17')](_0x55d2ee)['json'](_0x32962c);}};}function respondWithFilteredResult(_0xb160a1,_0x246c83){return function(_0x4f89d1){if(_0x4f89d1){var _0x26f23b=_0x4f89d1[_0xa9a8('0x19')],_0xe2e74f=_0x246c83[_0xa9a8('0x1a')],_0x4d2def=_0x246c83[_0xa9a8('0x1a')]+_0x246c83[_0xa9a8('0x1b')],_0x4d4198;if(_0x4d2def>=_0x26f23b){_0x4d2def=_0x26f23b;_0x4d4198=0xc8;}else{_0x4d4198=0xce;}_0xb160a1['status'](_0x4d4198);return _0xb160a1[_0xa9a8('0x1c')](_0xa9a8('0x1d'),_0xe2e74f+'-'+_0x4d2def+'/'+_0x26f23b)['json'](_0x4f89d1);}return null;};}function patchUpdates(_0x42cc08){return function(_0x41fdb0){try{jsonpatch['apply'](_0x41fdb0,_0x42cc08,!![]);}catch(_0x56438d){return BPromise['reject'](_0x56438d);}return _0x41fdb0[_0xa9a8('0x1e')]();};}function saveUpdates(_0x2cc5d1,_0xff90bc){return function(_0x15ce50){if(_0x15ce50){return _0x15ce50[_0xa9a8('0x1f')](_0x2cc5d1)[_0xa9a8('0x20')](function(_0xf49904){return _0xf49904;});}return null;};}function removeEntity(_0x3ba53d,_0x4e298c){return function(_0x2c64f8){if(_0x2c64f8){return _0x2c64f8[_0xa9a8('0x21')]()[_0xa9a8('0x20')](function(){_0x3ba53d['status'](0xcc)[_0xa9a8('0x18')]();});}};}function handleEntityNotFound(_0x4e3622,_0x348e9f){return function(_0x9108da){if(!_0x9108da){_0x4e3622[_0xa9a8('0x16')](0x194);}return _0x9108da;};}function handleError(_0x2da423,_0x44c52f){_0x44c52f=_0x44c52f||0x1f4;return function(_0x1a12cb){logger[_0xa9a8('0x22')](_0x1a12cb['stack']);if(_0x1a12cb[_0xa9a8('0x23')]){delete _0x1a12cb[_0xa9a8('0x23')];}_0x2da423[_0xa9a8('0x17')](_0x44c52f)[_0xa9a8('0x24')](_0x1a12cb);};}exports['index']=function(_0x4f9821,_0x479dac){var _0x2ea6c9={},_0x572578={},_0x131f64={'count':0x0,'rows':[]};var _0xe6897e=_[_0xa9a8('0x25')](db['ZohoField'][_0xa9a8('0x26')],function(_0xa31da){return{'name':_0xa31da[_0xa9a8('0x27')],'type':_0xa31da[_0xa9a8('0x28')][_0xa9a8('0x29')]};});_0x572578['model']=_[_0xa9a8('0x25')](_0xe6897e,_0xa9a8('0x23'));_0x572578['query']=_['keys'](_0x4f9821[_0xa9a8('0x2a')]);_0x572578['filters']=_[_0xa9a8('0x2b')](_0x572578[_0xa9a8('0x2c')],_0x572578['query']);_0x2ea6c9['attributes']=_[_0xa9a8('0x2b')](_0x572578['model'],qs[_0xa9a8('0x2d')](_0x4f9821[_0xa9a8('0x2a')][_0xa9a8('0x2d')]));_0x2ea6c9['attributes']=_0x2ea6c9[_0xa9a8('0x2e')][_0xa9a8('0x2f')]?_0x2ea6c9['attributes']:_0x572578['model'];if(!_0x4f9821[_0xa9a8('0x2a')][_0xa9a8('0x30')](_0xa9a8('0x31'))){_0x2ea6c9[_0xa9a8('0x1b')]=qs[_0xa9a8('0x1b')](_0x4f9821[_0xa9a8('0x2a')]['limit']);_0x2ea6c9[_0xa9a8('0x1a')]=qs[_0xa9a8('0x1a')](_0x4f9821['query']['offset']);}_0x2ea6c9[_0xa9a8('0x32')]=qs[_0xa9a8('0x33')](_0x4f9821['query'][_0xa9a8('0x33')]);_0x2ea6c9['where']=qs[_0xa9a8('0x34')](_[_0xa9a8('0x35')](_0x4f9821['query'],_0x572578['filters']));if(_0x4f9821['query']['filter']){_0x2ea6c9[_0xa9a8('0x36')]=_['merge'](_0x2ea6c9[_0xa9a8('0x36')],{'$or':_[_0xa9a8('0x25')](_0xe6897e,function(_0x423ace){if(_0x423ace[_0xa9a8('0x28')]!==_0xa9a8('0x37')){var _0x55c34a={};_0x55c34a[_0x423ace[_0xa9a8('0x23')]]={'$like':'%'+_0x4f9821[_0xa9a8('0x2a')]['filter']+'%'};return _0x55c34a;}})});}_0x2ea6c9=_[_0xa9a8('0x38')]({},_0x2ea6c9,_0x4f9821[_0xa9a8('0x39')]);var _0x3efc57={'where':_0x2ea6c9['where']};return db[_0xa9a8('0x3a')][_0xa9a8('0x19')](_0x3efc57)[_0xa9a8('0x20')](function(_0x2d7854){_0x131f64[_0xa9a8('0x19')]=_0x2d7854;if(_0x4f9821['query'][_0xa9a8('0x3b')]){_0x2ea6c9[_0xa9a8('0x3c')]=[{'all':!![]}];}return db[_0xa9a8('0x3a')][_0xa9a8('0x3d')](_0x2ea6c9);})[_0xa9a8('0x20')](function(_0x3b7fdd){_0x131f64[_0xa9a8('0x3e')]=_0x3b7fdd;return _0x131f64;})['then'](respondWithFilteredResult(_0x479dac,_0x2ea6c9))[_0xa9a8('0x3f')](handleError(_0x479dac,null));};exports['show']=function(_0x3439c2,_0x50ddec){var _0x45bc08={'raw':!![],'where':{'id':_0x3439c2['params']['id']}},_0x19c58d={};_0x19c58d[_0xa9a8('0x2c')]=_['keys'](db[_0xa9a8('0x3a')][_0xa9a8('0x26')]);_0x19c58d['query']=_[_0xa9a8('0x40')](_0x3439c2[_0xa9a8('0x2a')]);_0x19c58d['filters']=_[_0xa9a8('0x2b')](_0x19c58d[_0xa9a8('0x2c')],_0x19c58d[_0xa9a8('0x2a')]);_0x45bc08['attributes']=_[_0xa9a8('0x2b')](_0x19c58d[_0xa9a8('0x2c')],qs[_0xa9a8('0x2d')](_0x3439c2[_0xa9a8('0x2a')][_0xa9a8('0x2d')]));_0x45bc08['attributes']=_0x45bc08[_0xa9a8('0x2e')][_0xa9a8('0x2f')]?_0x45bc08[_0xa9a8('0x2e')]:_0x19c58d[_0xa9a8('0x2c')];if(_0x3439c2['query'][_0xa9a8('0x3b')]){_0x45bc08[_0xa9a8('0x3c')]=[{'all':!![]}];}_0x45bc08=_[_0xa9a8('0x38')]({},_0x45bc08,_0x3439c2[_0xa9a8('0x39')]);return db[_0xa9a8('0x3a')]['find'](_0x45bc08)[_0xa9a8('0x20')](handleEntityNotFound(_0x50ddec,null))['then'](respondWithResult(_0x50ddec,null))[_0xa9a8('0x3f')](handleError(_0x50ddec,null));};exports['create']=function(_0x153417,_0x3b8bab){return db[_0xa9a8('0x3a')][_0xa9a8('0x41')](_0x153417[_0xa9a8('0x42')],{})[_0xa9a8('0x20')](respondWithResult(_0x3b8bab,0xc9))['catch'](handleError(_0x3b8bab,null));};exports[_0xa9a8('0x1f')]=function(_0x52b83c,_0xf9d9cb){if(_0x52b83c[_0xa9a8('0x42')]['id']){delete _0x52b83c['body']['id'];}return db[_0xa9a8('0x3a')][_0xa9a8('0x43')]({'where':{'id':_0x52b83c[_0xa9a8('0x44')]['id']}})[_0xa9a8('0x20')](handleEntityNotFound(_0xf9d9cb,null))[_0xa9a8('0x20')](saveUpdates(_0x52b83c[_0xa9a8('0x42')],null))['then'](respondWithResult(_0xf9d9cb,null))['catch'](handleError(_0xf9d9cb,null));};exports[_0xa9a8('0x21')]=function(_0x130c7c,_0x19803e){return db[_0xa9a8('0x3a')][_0xa9a8('0x43')]({'where':{'id':_0x130c7c[_0xa9a8('0x44')]['id']}})[_0xa9a8('0x20')](handleEntityNotFound(_0x19803e,null))['then'](removeEntity(_0x19803e,null))['catch'](handleError(_0x19803e,null));}; \ No newline at end of file +var _0x26ec=['../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','index','map','ZohoField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','include','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x1700ee,_0x39e9c6){var _0x3d4754=function(_0x4b8517){while(--_0x4b8517){_0x1700ee['push'](_0x1700ee['shift']());}};_0x3d4754(++_0x39e9c6);}(_0x26ec,0x155));var _0xc26e=function(_0x147fb4,_0x53d29a){_0x147fb4=_0x147fb4-0x0;var _0x5d27e4=_0x26ec[_0x147fb4];return _0x5d27e4;};'use strict';var pdf=require(_0xc26e('0x0'));var emlformat=require(_0xc26e('0x1'));var rimraf=require(_0xc26e('0x2'));var zipdir=require(_0xc26e('0x3'));var jsonpatch=require(_0xc26e('0x4'));var rp=require(_0xc26e('0x5'));var moment=require(_0xc26e('0x6'));var BPromise=require(_0xc26e('0x7'));var Mustache=require(_0xc26e('0x8'));var util=require(_0xc26e('0x9'));var path=require('path');var sox=require(_0xc26e('0xa'));var csv=require(_0xc26e('0xb'));var ejs=require(_0xc26e('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc26e('0xd'));var crypto=require('crypto');var jsforce=require(_0xc26e('0xe'));var deskjs=require(_0xc26e('0xf'));var toCsv=require(_0xc26e('0xb'));var querystring=require(_0xc26e('0x10'));var Papa=require('papaparse');var Redis=require(_0xc26e('0x11'));var authService=require(_0xc26e('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc26e('0x13'));var logger=require(_0xc26e('0x14'))(_0xc26e('0x15'));var utils=require(_0xc26e('0x16'));var config=require(_0xc26e('0x17'));var db=require(_0xc26e('0x18'))['db'];function respondWithStatusCode(_0x48126c,_0x2881f2){_0x2881f2=_0x2881f2||0xcc;return function(_0xba0067){if(_0xba0067){return _0x48126c[_0xc26e('0x19')](_0x2881f2);}return _0x48126c[_0xc26e('0x1a')](_0x2881f2)['end']();};}function respondWithResult(_0x5140b4,_0x3fa505){_0x3fa505=_0x3fa505||0xc8;return function(_0x569e19){if(_0x569e19){return _0x5140b4[_0xc26e('0x1a')](_0x3fa505)['json'](_0x569e19);}};}function respondWithFilteredResult(_0x5a12cf,_0xa29347){return function(_0x2fd33e){if(_0x2fd33e){var _0x3700af=_0x2fd33e[_0xc26e('0x1b')],_0x526e03=_0xa29347['offset'],_0x53b5cf=_0xa29347[_0xc26e('0x1c')]+_0xa29347[_0xc26e('0x1d')],_0x37b306;if(_0x53b5cf>=_0x3700af){_0x53b5cf=_0x3700af;_0x37b306=0xc8;}else{_0x37b306=0xce;}_0x5a12cf['status'](_0x37b306);return _0x5a12cf[_0xc26e('0x1e')](_0xc26e('0x1f'),_0x526e03+'-'+_0x53b5cf+'/'+_0x3700af)[_0xc26e('0x20')](_0x2fd33e);}return null;};}function patchUpdates(_0x297126){return function(_0x24b44d){try{jsonpatch[_0xc26e('0x21')](_0x24b44d,_0x297126,!![]);}catch(_0x446697){return BPromise[_0xc26e('0x22')](_0x446697);}return _0x24b44d[_0xc26e('0x23')]();};}function saveUpdates(_0x1cd0c0,_0x1074f5){return function(_0x47cadc){if(_0x47cadc){return _0x47cadc[_0xc26e('0x24')](_0x1cd0c0)[_0xc26e('0x25')](function(_0x543c43){return _0x543c43;});}return null;};}function removeEntity(_0x271b76,_0x59d3ae){return function(_0x38c6ad){if(_0x38c6ad){return _0x38c6ad[_0xc26e('0x26')]()['then'](function(){_0x271b76[_0xc26e('0x1a')](0xcc)[_0xc26e('0x27')]();});}};}function handleEntityNotFound(_0x44f869,_0x49a23b){return function(_0x49324a){if(!_0x49324a){_0x44f869['sendStatus'](0x194);}return _0x49324a;};}function handleError(_0x3954be,_0x55b5d8){_0x55b5d8=_0x55b5d8||0x1f4;return function(_0x112d67){logger[_0xc26e('0x28')](_0x112d67['stack']);if(_0x112d67[_0xc26e('0x29')]){delete _0x112d67[_0xc26e('0x29')];}_0x3954be[_0xc26e('0x1a')](_0x55b5d8)['send'](_0x112d67);};}exports[_0xc26e('0x2a')]=function(_0x4572ac,_0x2c5d19){var _0x1d3ece={},_0x1dd793={},_0x2c17ce={'count':0x0,'rows':[]};var _0x345710=_[_0xc26e('0x2b')](db[_0xc26e('0x2c')][_0xc26e('0x2d')],function(_0x50ef12){return{'name':_0x50ef12[_0xc26e('0x2e')],'type':_0x50ef12[_0xc26e('0x2f')][_0xc26e('0x30')]};});_0x1dd793[_0xc26e('0x31')]=_[_0xc26e('0x2b')](_0x345710,_0xc26e('0x29'));_0x1dd793['query']=_[_0xc26e('0x32')](_0x4572ac[_0xc26e('0x33')]);_0x1dd793[_0xc26e('0x34')]=_[_0xc26e('0x35')](_0x1dd793['model'],_0x1dd793[_0xc26e('0x33')]);_0x1d3ece[_0xc26e('0x36')]=_[_0xc26e('0x35')](_0x1dd793[_0xc26e('0x31')],qs[_0xc26e('0x37')](_0x4572ac[_0xc26e('0x33')][_0xc26e('0x37')]));_0x1d3ece[_0xc26e('0x36')]=_0x1d3ece[_0xc26e('0x36')][_0xc26e('0x38')]?_0x1d3ece[_0xc26e('0x36')]:_0x1dd793[_0xc26e('0x31')];if(!_0x4572ac[_0xc26e('0x33')][_0xc26e('0x39')]('nolimit')){_0x1d3ece['limit']=qs[_0xc26e('0x1d')](_0x4572ac['query'][_0xc26e('0x1d')]);_0x1d3ece[_0xc26e('0x1c')]=qs['offset'](_0x4572ac['query'][_0xc26e('0x1c')]);}_0x1d3ece['order']=qs[_0xc26e('0x3a')](_0x4572ac['query']['sort']);_0x1d3ece['where']=qs['filters'](_[_0xc26e('0x3b')](_0x4572ac[_0xc26e('0x33')],_0x1dd793[_0xc26e('0x34')]));if(_0x4572ac[_0xc26e('0x33')][_0xc26e('0x3c')]){_0x1d3ece[_0xc26e('0x3d')]=_[_0xc26e('0x3e')](_0x1d3ece[_0xc26e('0x3d')],{'$or':_[_0xc26e('0x2b')](_0x345710,function(_0x3c1510){if(_0x3c1510[_0xc26e('0x2f')]!==_0xc26e('0x3f')){var _0x2a08d5={};_0x2a08d5[_0x3c1510[_0xc26e('0x29')]]={'$like':'%'+_0x4572ac['query']['filter']+'%'};return _0x2a08d5;}})});}_0x1d3ece=_[_0xc26e('0x3e')]({},_0x1d3ece,_0x4572ac['options']);var _0x3d65f3={'where':_0x1d3ece[_0xc26e('0x3d')]};return db['ZohoField'][_0xc26e('0x1b')](_0x3d65f3)[_0xc26e('0x25')](function(_0x2e4667){_0x2c17ce[_0xc26e('0x1b')]=_0x2e4667;if(_0x4572ac['query'][_0xc26e('0x40')]){_0x1d3ece['include']=[{'all':!![]}];}return db[_0xc26e('0x2c')]['findAll'](_0x1d3ece);})[_0xc26e('0x25')](function(_0x4a4e7e){_0x2c17ce[_0xc26e('0x41')]=_0x4a4e7e;return _0x2c17ce;})['then'](respondWithFilteredResult(_0x2c5d19,_0x1d3ece))[_0xc26e('0x42')](handleError(_0x2c5d19,null));};exports[_0xc26e('0x43')]=function(_0x5b900a,_0x184424){var _0x293c0c={'raw':!![],'where':{'id':_0x5b900a[_0xc26e('0x44')]['id']}},_0x5e366e={};_0x5e366e[_0xc26e('0x31')]=_['keys'](db[_0xc26e('0x2c')][_0xc26e('0x2d')]);_0x5e366e[_0xc26e('0x33')]=_[_0xc26e('0x32')](_0x5b900a[_0xc26e('0x33')]);_0x5e366e[_0xc26e('0x34')]=_[_0xc26e('0x35')](_0x5e366e['model'],_0x5e366e[_0xc26e('0x33')]);_0x293c0c[_0xc26e('0x36')]=_[_0xc26e('0x35')](_0x5e366e['model'],qs[_0xc26e('0x37')](_0x5b900a[_0xc26e('0x33')][_0xc26e('0x37')]));_0x293c0c[_0xc26e('0x36')]=_0x293c0c['attributes']['length']?_0x293c0c['attributes']:_0x5e366e[_0xc26e('0x31')];if(_0x5b900a[_0xc26e('0x33')][_0xc26e('0x40')]){_0x293c0c[_0xc26e('0x45')]=[{'all':!![]}];}_0x293c0c=_[_0xc26e('0x3e')]({},_0x293c0c,_0x5b900a['options']);return db[_0xc26e('0x2c')]['find'](_0x293c0c)['then'](handleEntityNotFound(_0x184424,null))[_0xc26e('0x25')](respondWithResult(_0x184424,null))[_0xc26e('0x42')](handleError(_0x184424,null));};exports['create']=function(_0x378634,_0x35e5c7){return db[_0xc26e('0x2c')][_0xc26e('0x46')](_0x378634[_0xc26e('0x47')],{})[_0xc26e('0x25')](respondWithResult(_0x35e5c7,0xc9))[_0xc26e('0x42')](handleError(_0x35e5c7,null));};exports[_0xc26e('0x24')]=function(_0xead61a,_0x1658a4){if(_0xead61a[_0xc26e('0x47')]['id']){delete _0xead61a[_0xc26e('0x47')]['id'];}return db[_0xc26e('0x2c')]['find']({'where':{'id':_0xead61a[_0xc26e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1658a4,null))[_0xc26e('0x25')](saveUpdates(_0xead61a[_0xc26e('0x47')],null))['then'](respondWithResult(_0x1658a4,null))[_0xc26e('0x42')](handleError(_0x1658a4,null));};exports[_0xc26e('0x26')]=function(_0x9647a3,_0x58f5e6){return db[_0xc26e('0x2c')][_0xc26e('0x48')]({'where':{'id':_0x9647a3[_0xc26e('0x44')]['id']}})['then'](handleEntityNotFound(_0x58f5e6,null))['then'](removeEntity(_0x58f5e6,null))[_0xc26e('0x42')](handleError(_0x58f5e6,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b332974..172423b 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 _0xf5b4=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./intZohoField.attributes','exports','define'];(function(_0x19e4c1,_0x6422a7){var _0xd40b76=function(_0x27a212){while(--_0x27a212){_0x19e4c1['push'](_0x19e4c1['shift']());}};_0xd40b76(++_0x6422a7);}(_0xf5b4,0x16d));var _0x4f5b=function(_0x2445e2,_0xc4a747){_0x2445e2=_0x2445e2-0x0;var _0x1e5736=_0xf5b4[_0x2445e2];return _0x1e5736;};'use strict';var _=require(_0x4f5b('0x0'));var util=require('util');var logger=require(_0x4f5b('0x1'))(_0x4f5b('0x2'));var moment=require(_0x4f5b('0x3'));var BPromise=require(_0x4f5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f5b('0x5'));var rimraf=require(_0x4f5b('0x6'));var config=require('../../config/environment');var attributes=require(_0x4f5b('0x7'));module[_0x4f5b('0x8')]=function(_0x5aec0d,_0x4d5dcf){return _0x5aec0d[_0x4f5b('0x9')](_0x4f5b('0xa'),attributes,{'tableName':_0x4f5b('0xb'),'paranoid':![],'indexes':[{'name':_0x4f5b('0xc'),'fields':[_0x4f5b('0xd'),_0x4f5b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdab4=['FieldId','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index'];(function(_0x2a65b6,_0x1fa02d){var _0x472677=function(_0x4751ab){while(--_0x4751ab){_0x2a65b6['push'](_0x2a65b6['shift']());}};_0x472677(++_0x1fa02d);}(_0xdab4,0x17a));var _0x4dab=function(_0x5e1921,_0x20a04e){_0x5e1921=_0x5e1921-0x0;var _0xc6c848=_0xdab4[_0x5e1921];return _0xc6c848;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4dab('0x0'))('api');var moment=require(_0x4dab('0x1'));var BPromise=require(_0x4dab('0x2'));var rp=require(_0x4dab('0x3'));var fs=require('fs');var path=require(_0x4dab('0x4'));var rimraf=require(_0x4dab('0x5'));var config=require(_0x4dab('0x6'));var attributes=require('./intZohoField.attributes');module[_0x4dab('0x7')]=function(_0x3cb65b,_0x4ba2f3){return _0x3cb65b[_0x4dab('0x8')](_0x4dab('0x9'),attributes,{'tableName':_0x4dab('0xa'),'paranoid':![],'indexes':[{'name':_0x4dab('0xb'),'fields':['idField',_0x4dab('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 2bb1f4f..8295a81 100644 --- a/server/api/intZohoField/intZohoField.rpc.js +++ b/server/api/intZohoField/intZohoField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed1f=['request','then','info','ZohoField,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x43d512,_0x2ea24c){var _0x3461d3=function(_0x2f5d43){while(--_0x2f5d43){_0x43d512['push'](_0x43d512['shift']());}};_0x3461d3(++_0x2ea24c);}(_0xed1f,0x6a));var _0xfed1=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xed1f[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('ZohoField,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('ZohoField,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('ZohoField,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0xac31=['code','ZohoField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3d007f,_0x52f761){var _0x341999=function(_0x414676){while(--_0x414676){_0x3d007f['push'](_0x3d007f['shift']());}};_0x341999(++_0x52f761);}(_0xac31,0xca));var _0x1ac3=function(_0x525bf1,_0x56a6dd){_0x525bf1=_0x525bf1-0x0;var _0x52f822=_0xac31[_0x525bf1];return _0x52f822;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('ZohoField,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 65b261c..28f4507 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 _0x54bb=['../../config/environment','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x122633,_0x22057b){var _0x2d02e5=function(_0x420024){while(--_0x420024){_0x122633['push'](_0x122633['shift']());}};_0x2d02e5(++_0x22057b);}(_0x54bb,0x161));var _0xb54b=function(_0xd67723,_0x1e576f){_0xd67723=_0xd67723-0x0;var _0x53b62b=_0x54bb[_0xd67723];return _0x53b62b;};'use strict';var multer=require(_0xb54b('0x0'));var util=require(_0xb54b('0x1'));var path=require(_0xb54b('0x2'));var timeout=require(_0xb54b('0x3'));var express=require('express');var router=express[_0xb54b('0x4')]();var auth=require(_0xb54b('0x5'));var interaction=require(_0xb54b('0x6'));var config=require(_0xb54b('0x7'));module['exports']=router; \ No newline at end of file +var _0xfcc2=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x47a2a9,_0x115119){var _0x3c5347=function(_0xf3eb06){while(--_0xf3eb06){_0x47a2a9['push'](_0x47a2a9['shift']());}};_0x3c5347(++_0x115119);}(_0xfcc2,0x1db));var _0x2fcc=function(_0x3e3da5,_0x4de4eb){_0x3e3da5=_0x3e3da5-0x0;var _0x363860=_0xfcc2[_0x3e3da5];return _0x363860;};'use strict';var multer=require(_0x2fcc('0x0'));var util=require(_0x2fcc('0x1'));var path=require(_0x2fcc('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fcc('0x3'));var router=express[_0x2fcc('0x4')]();var auth=require(_0x2fcc('0x5'));var interaction=require(_0x2fcc('0x6'));var config=require(_0x2fcc('0x7'));module[_0x2fcc('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 02d5723..56682b1 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 _0x39c6=['app.js','INTEGER','BOOLEAN','state','STRING','unique_name_and_version'];(function(_0x161921,_0x291298){var _0x3f812e=function(_0x289cb4){while(--_0x289cb4){_0x161921['push'](_0x161921['shift']());}};_0x3f812e(++_0x291298);}(_0x39c6,0x154));var _0x639c=function(_0x2f27a4,_0x25e9ae){_0x2f27a4=_0x2f27a4-0x0;var _0x2602d4=_0x39c6[_0x2f27a4];return _0x2602d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x639c('0x0')],'allowNull':![],'unique':_0x639c('0x1')},'version':{'type':Sequelize[_0x639c('0x0')],'allowNull':![],'unique':_0x639c('0x1')},'main':{'type':Sequelize[_0x639c('0x0')],'defaultValue':_0x639c('0x2')},'filename':{'type':Sequelize[_0x639c('0x0')]},'path':{'type':Sequelize[_0x639c('0x0')]},'type':{'type':Sequelize[_0x639c('0x0')]},'size':{'type':Sequelize[_0x639c('0x3')]},'active':{'type':Sequelize[_0x639c('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x639c('0x0')]},'logo':{'type':Sequelize[_0x639c('0x0')]},'state':{'type':Sequelize[_0x639c('0x0')],'unique':_0x639c('0x5')},'description':{'type':Sequelize[_0x639c('0x0')]},'title':{'type':Sequelize[_0x639c('0x0')]},'remoteUri':{'type':Sequelize[_0x639c('0x0')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x775d=['sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x297ef7,_0x586c34){var _0x4938e1=function(_0x3609c4){while(--_0x3609c4){_0x297ef7['push'](_0x297ef7['shift']());}};_0x4938e1(++_0x586c34);}(_0x775d,0xf5));var _0xd775=function(_0x572d3,_0x5d4b4b){_0x572d3=_0x572d3-0x0;var _0x1a6faa=_0x775d[_0x572d3];return _0x1a6faa;};'use strict';var Sequelize=require(_0xd775('0x0'));module[_0xd775('0x1')]={'name':{'type':Sequelize[_0xd775('0x2')],'allowNull':![],'unique':_0xd775('0x3')},'version':{'type':Sequelize[_0xd775('0x2')],'allowNull':![],'unique':_0xd775('0x3')},'main':{'type':Sequelize[_0xd775('0x2')],'defaultValue':_0xd775('0x4')},'filename':{'type':Sequelize[_0xd775('0x2')]},'path':{'type':Sequelize[_0xd775('0x2')]},'type':{'type':Sequelize[_0xd775('0x2')]},'size':{'type':Sequelize[_0xd775('0x5')]},'active':{'type':Sequelize[_0xd775('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xd775('0x2')]},'logo':{'type':Sequelize[_0xd775('0x2')]},'state':{'type':Sequelize[_0xd775('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xd775('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd775('0x2')]},'link':{'type':Sequelize[_0xd775('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 97d51bc..d39c73e 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 _0x20e5=['limit','set','Content-Range','json','reject','save','update','then','error','stack','name','map','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','Integration','includeAll','include','show','params','rawAttributes','merge','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','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','../../mysqldb','sendStatus','status','end','count','offset'];(function(_0x113532,_0x4c85ce){var _0x532054=function(_0x144030){while(--_0x144030){_0x113532['push'](_0x113532['shift']());}};_0x532054(++_0x4c85ce);}(_0x20e5,0x149));var _0x520e=function(_0x1b9ba5,_0x44b731){_0x1b9ba5=_0x1b9ba5-0x0;var _0x55bc1a=_0x20e5[_0x1b9ba5];return _0x55bc1a;};'use strict';var pdf=require(_0x520e('0x0'));var emlformat=require(_0x520e('0x1'));var rimraf=require(_0x520e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x520e('0x3'));var rp=require(_0x520e('0x4'));var moment=require(_0x520e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x520e('0x6'));var util=require(_0x520e('0x7'));var path=require(_0x520e('0x8'));var sox=require(_0x520e('0x9'));var csv=require(_0x520e('0xa'));var ejs=require(_0x520e('0xb'));var fs=require('fs');var _=require(_0x520e('0xc'));var squel=require(_0x520e('0xd'));var crypto=require(_0x520e('0xe'));var jsforce=require(_0x520e('0xf'));var deskjs=require(_0x520e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x520e('0x11'));var Papa=require(_0x520e('0x12'));var Redis=require(_0x520e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x520e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x520e('0x15'));var logger=require(_0x520e('0x16'))('api');var utils=require(_0x520e('0x17'));var config=require(_0x520e('0x18'));var db=require(_0x520e('0x19'))['db'];function respondWithStatusCode(_0x1d0a07,_0x2794aa){_0x2794aa=_0x2794aa||0xcc;return function(_0x46aef0){if(_0x46aef0){return _0x1d0a07[_0x520e('0x1a')](_0x2794aa);}return _0x1d0a07[_0x520e('0x1b')](_0x2794aa)[_0x520e('0x1c')]();};}function respondWithResult(_0x4cea38,_0x3c9ea4){_0x3c9ea4=_0x3c9ea4||0xc8;return function(_0x3fd0ee){if(_0x3fd0ee){return _0x4cea38['status'](_0x3c9ea4)['json'](_0x3fd0ee);}};}function respondWithFilteredResult(_0x4f03bf,_0x3161d9){return function(_0x3f7fb6){if(_0x3f7fb6){var _0x5a3f60=_0x3f7fb6[_0x520e('0x1d')],_0x6d2817=_0x3161d9[_0x520e('0x1e')],_0x1ba5a5=_0x3161d9[_0x520e('0x1e')]+_0x3161d9[_0x520e('0x1f')],_0x5bf875;if(_0x1ba5a5>=_0x5a3f60){_0x1ba5a5=_0x5a3f60;_0x5bf875=0xc8;}else{_0x5bf875=0xce;}_0x4f03bf['status'](_0x5bf875);return _0x4f03bf[_0x520e('0x20')](_0x520e('0x21'),_0x6d2817+'-'+_0x1ba5a5+'/'+_0x5a3f60)[_0x520e('0x22')](_0x3f7fb6);}return null;};}function patchUpdates(_0xc9cc8c){return function(_0x387763){try{jsonpatch['apply'](_0x387763,_0xc9cc8c,!![]);}catch(_0x4abd60){return BPromise[_0x520e('0x23')](_0x4abd60);}return _0x387763[_0x520e('0x24')]();};}function saveUpdates(_0x2ab4e7,_0x599693){return function(_0xf0c9ff){if(_0xf0c9ff){return _0xf0c9ff[_0x520e('0x25')](_0x2ab4e7)[_0x520e('0x26')](function(_0x2b2bf2){return _0x2b2bf2;});}return null;};}function removeEntity(_0x52530f,_0xc7f56b){return function(_0x560cf0){if(_0x560cf0){return _0x560cf0['destroy']()['then'](function(){_0x52530f[_0x520e('0x1b')](0xcc)[_0x520e('0x1c')]();});}};}function handleEntityNotFound(_0x1aae7e,_0x39d68d){return function(_0x282961){if(!_0x282961){_0x1aae7e[_0x520e('0x1a')](0x194);}return _0x282961;};}function handleError(_0x47af0b,_0x539c6a){_0x539c6a=_0x539c6a||0x1f4;return function(_0x11c1bc){logger[_0x520e('0x27')](_0x11c1bc[_0x520e('0x28')]);if(_0x11c1bc[_0x520e('0x29')]){delete _0x11c1bc[_0x520e('0x29')];}_0x47af0b[_0x520e('0x1b')](_0x539c6a)['send'](_0x11c1bc);};}exports['index']=function(_0x431e32,_0x31e07a){var _0x5ca08d={},_0x6b8fc9={},_0x4ca3ff={'count':0x0,'rows':[]};var _0x5cdc7c=_[_0x520e('0x2a')](db['Integration']['rawAttributes'],function(_0x444232){return{'name':_0x444232['fieldName'],'type':_0x444232['type']['key']};});_0x6b8fc9['model']=_['map'](_0x5cdc7c,_0x520e('0x29'));_0x6b8fc9['query']=_[_0x520e('0x2b')](_0x431e32['query']);_0x6b8fc9[_0x520e('0x2c')]=_[_0x520e('0x2d')](_0x6b8fc9[_0x520e('0x2e')],_0x6b8fc9[_0x520e('0x2f')]);_0x5ca08d['attributes']=_[_0x520e('0x2d')](_0x6b8fc9[_0x520e('0x2e')],qs[_0x520e('0x30')](_0x431e32[_0x520e('0x2f')][_0x520e('0x30')]));_0x5ca08d[_0x520e('0x31')]=_0x5ca08d[_0x520e('0x31')][_0x520e('0x32')]?_0x5ca08d[_0x520e('0x31')]:_0x6b8fc9[_0x520e('0x2e')];if(!_0x431e32['query'][_0x520e('0x33')](_0x520e('0x34'))){_0x5ca08d[_0x520e('0x1f')]=qs[_0x520e('0x1f')](_0x431e32[_0x520e('0x2f')][_0x520e('0x1f')]);_0x5ca08d[_0x520e('0x1e')]=qs[_0x520e('0x1e')](_0x431e32[_0x520e('0x2f')]['offset']);}_0x5ca08d[_0x520e('0x35')]=qs[_0x520e('0x36')](_0x431e32['query'][_0x520e('0x36')]);_0x5ca08d[_0x520e('0x37')]=qs[_0x520e('0x2c')](_[_0x520e('0x38')](_0x431e32[_0x520e('0x2f')],_0x6b8fc9['filters']));if(_0x431e32[_0x520e('0x2f')]['filter']){_0x5ca08d[_0x520e('0x37')]=_['merge'](_0x5ca08d[_0x520e('0x37')],{'$or':_['map'](_0x5cdc7c,function(_0x3ecc44){if(_0x3ecc44[_0x520e('0x39')]!=='VIRTUAL'){var _0x19a0ad={};_0x19a0ad[_0x3ecc44[_0x520e('0x29')]]={'$like':'%'+_0x431e32[_0x520e('0x2f')][_0x520e('0x3a')]+'%'};return _0x19a0ad;}})});}_0x5ca08d=_['merge']({},_0x5ca08d,_0x431e32[_0x520e('0x3b')]);var _0x38f404={'where':_0x5ca08d[_0x520e('0x37')]};return db[_0x520e('0x3c')]['count'](_0x38f404)[_0x520e('0x26')](function(_0x66a766){_0x4ca3ff['count']=_0x66a766;if(_0x431e32[_0x520e('0x2f')][_0x520e('0x3d')]){_0x5ca08d[_0x520e('0x3e')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x5ca08d);})[_0x520e('0x26')](function(_0xdceca9){_0x4ca3ff['rows']=_0xdceca9;return _0x4ca3ff;})[_0x520e('0x26')](respondWithFilteredResult(_0x31e07a,_0x5ca08d))['catch'](handleError(_0x31e07a,null));};exports[_0x520e('0x3f')]=function(_0x359fdb,_0x52bffe){var _0x587fd1={'raw':![],'where':{'id':_0x359fdb[_0x520e('0x40')]['id']}},_0x4e7f74={};_0x4e7f74[_0x520e('0x2e')]=_[_0x520e('0x2b')](db[_0x520e('0x3c')][_0x520e('0x41')]);_0x4e7f74[_0x520e('0x2f')]=_[_0x520e('0x2b')](_0x359fdb[_0x520e('0x2f')]);_0x4e7f74[_0x520e('0x2c')]=_[_0x520e('0x2d')](_0x4e7f74[_0x520e('0x2e')],_0x4e7f74['query']);_0x587fd1[_0x520e('0x31')]=_['intersection'](_0x4e7f74[_0x520e('0x2e')],qs['fields'](_0x359fdb[_0x520e('0x2f')][_0x520e('0x30')]));_0x587fd1['attributes']=_0x587fd1[_0x520e('0x31')][_0x520e('0x32')]?_0x587fd1[_0x520e('0x31')]:_0x4e7f74['model'];if(_0x359fdb['query'][_0x520e('0x3d')]){_0x587fd1['include']=[{'all':!![]}];}_0x587fd1=_[_0x520e('0x42')]({},_0x587fd1,_0x359fdb[_0x520e('0x3b')]);return db[_0x520e('0x3c')][_0x520e('0x43')](_0x587fd1)[_0x520e('0x26')](handleEntityNotFound(_0x52bffe,null))[_0x520e('0x26')](respondWithResult(_0x52bffe,null))[_0x520e('0x44')](handleError(_0x52bffe,null));};exports[_0x520e('0x45')]=function(_0x5222d3,_0x2bb749){return db['Integration'][_0x520e('0x45')](_0x5222d3['body'],{})[_0x520e('0x26')](respondWithResult(_0x2bb749,0xc9))[_0x520e('0x44')](handleError(_0x2bb749,null));};exports[_0x520e('0x25')]=function(_0x1937bd,_0x15d48f){if(_0x1937bd[_0x520e('0x46')]['id']){delete _0x1937bd[_0x520e('0x46')]['id'];}return db[_0x520e('0x3c')][_0x520e('0x43')]({'where':{'id':_0x1937bd[_0x520e('0x40')]['id']}})[_0x520e('0x26')](handleEntityNotFound(_0x15d48f,null))[_0x520e('0x26')](saveUpdates(_0x1937bd[_0x520e('0x46')],null))[_0x520e('0x26')](respondWithResult(_0x15d48f,null))['catch'](handleError(_0x15d48f,null));};exports[_0x520e('0x47')]=function(_0x39ce5c,_0x442e4e){return db[_0x520e('0x3c')]['find']({'where':{'id':_0x39ce5c[_0x520e('0x40')]['id']}})[_0x520e('0x26')](handleEntityNotFound(_0x442e4e,null))[_0x520e('0x26')](removeEntity(_0x442e4e,null))[_0x520e('0x44')](handleError(_0x442e4e,null));}; \ No newline at end of file +var _0x2c26=['body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','update','destroy','then','error','stack','name','send','map','Integration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x2c26,0x169));var _0x62c2=function(_0x8fb63c,_0x47f785){_0x8fb63c=_0x8fb63c-0x0;var _0x20ab52=_0x2c26[_0x8fb63c];return _0x20ab52;};'use strict';var pdf=require(_0x62c2('0x0'));var emlformat=require(_0x62c2('0x1'));var rimraf=require(_0x62c2('0x2'));var zipdir=require(_0x62c2('0x3'));var jsonpatch=require(_0x62c2('0x4'));var rp=require('request-promise');var moment=require(_0x62c2('0x5'));var BPromise=require(_0x62c2('0x6'));var Mustache=require('mustache');var util=require(_0x62c2('0x7'));var path=require(_0x62c2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x62c2('0x9'));var fs=require('fs');var _=require(_0x62c2('0xa'));var squel=require(_0x62c2('0xb'));var crypto=require(_0x62c2('0xc'));var jsforce=require(_0x62c2('0xd'));var deskjs=require(_0x62c2('0xe'));var toCsv=require(_0x62c2('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x62c2('0x10'));var authService=require(_0x62c2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x62c2('0x12'));var hardwareService=require(_0x62c2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x62c2('0x14'));var config=require(_0x62c2('0x15'));var db=require(_0x62c2('0x16'))['db'];function respondWithStatusCode(_0x1aeae7,_0x18fcef){_0x18fcef=_0x18fcef||0xcc;return function(_0x9064f5){if(_0x9064f5){return _0x1aeae7[_0x62c2('0x17')](_0x18fcef);}return _0x1aeae7[_0x62c2('0x18')](_0x18fcef)[_0x62c2('0x19')]();};}function respondWithResult(_0x4e8f41,_0x2239db){_0x2239db=_0x2239db||0xc8;return function(_0x3b4ceb){if(_0x3b4ceb){return _0x4e8f41[_0x62c2('0x18')](_0x2239db)['json'](_0x3b4ceb);}};}function respondWithFilteredResult(_0x17bbc3,_0x356e30){return function(_0x168b55){if(_0x168b55){var _0x716477=_0x168b55[_0x62c2('0x1a')],_0x58b979=_0x356e30[_0x62c2('0x1b')],_0x984f61=_0x356e30[_0x62c2('0x1b')]+_0x356e30['limit'],_0x37213d;if(_0x984f61>=_0x716477){_0x984f61=_0x716477;_0x37213d=0xc8;}else{_0x37213d=0xce;}_0x17bbc3[_0x62c2('0x18')](_0x37213d);return _0x17bbc3[_0x62c2('0x1c')](_0x62c2('0x1d'),_0x58b979+'-'+_0x984f61+'/'+_0x716477)[_0x62c2('0x1e')](_0x168b55);}return null;};}function patchUpdates(_0x316563){return function(_0xdfe30e){try{jsonpatch['apply'](_0xdfe30e,_0x316563,!![]);}catch(_0x4217ac){return BPromise['reject'](_0x4217ac);}return _0xdfe30e['save']();};}function saveUpdates(_0x1bf6b5,_0x3e25ba){return function(_0x2f0191){if(_0x2f0191){return _0x2f0191[_0x62c2('0x1f')](_0x1bf6b5)['then'](function(_0x2add2e){return _0x2add2e;});}return null;};}function removeEntity(_0x406c10,_0x3c660e){return function(_0x1d2fb9){if(_0x1d2fb9){return _0x1d2fb9[_0x62c2('0x20')]()[_0x62c2('0x21')](function(){_0x406c10[_0x62c2('0x18')](0xcc)[_0x62c2('0x19')]();});}};}function handleEntityNotFound(_0x19fa65,_0xf3978a){return function(_0x21a5ef){if(!_0x21a5ef){_0x19fa65[_0x62c2('0x17')](0x194);}return _0x21a5ef;};}function handleError(_0x1efbf0,_0x4699f3){_0x4699f3=_0x4699f3||0x1f4;return function(_0x4e45b3){logger[_0x62c2('0x22')](_0x4e45b3[_0x62c2('0x23')]);if(_0x4e45b3[_0x62c2('0x24')]){delete _0x4e45b3[_0x62c2('0x24')];}_0x1efbf0[_0x62c2('0x18')](_0x4699f3)[_0x62c2('0x25')](_0x4e45b3);};}exports['index']=function(_0x3fc462,_0x4f229a){var _0x54f063={},_0x166b62={},_0x82107c={'count':0x0,'rows':[]};var _0x12b616=_[_0x62c2('0x26')](db[_0x62c2('0x27')]['rawAttributes'],function(_0x4fef72){return{'name':_0x4fef72[_0x62c2('0x28')],'type':_0x4fef72[_0x62c2('0x29')][_0x62c2('0x2a')]};});_0x166b62[_0x62c2('0x2b')]=_['map'](_0x12b616,_0x62c2('0x24'));_0x166b62[_0x62c2('0x2c')]=_[_0x62c2('0x2d')](_0x3fc462[_0x62c2('0x2c')]);_0x166b62[_0x62c2('0x2e')]=_[_0x62c2('0x2f')](_0x166b62[_0x62c2('0x2b')],_0x166b62[_0x62c2('0x2c')]);_0x54f063['attributes']=_[_0x62c2('0x2f')](_0x166b62[_0x62c2('0x2b')],qs[_0x62c2('0x30')](_0x3fc462[_0x62c2('0x2c')][_0x62c2('0x30')]));_0x54f063[_0x62c2('0x31')]=_0x54f063[_0x62c2('0x31')][_0x62c2('0x32')]?_0x54f063[_0x62c2('0x31')]:_0x166b62[_0x62c2('0x2b')];if(!_0x3fc462[_0x62c2('0x2c')][_0x62c2('0x33')](_0x62c2('0x34'))){_0x54f063[_0x62c2('0x35')]=qs[_0x62c2('0x35')](_0x3fc462['query']['limit']);_0x54f063['offset']=qs[_0x62c2('0x1b')](_0x3fc462[_0x62c2('0x2c')][_0x62c2('0x1b')]);}_0x54f063[_0x62c2('0x36')]=qs['sort'](_0x3fc462[_0x62c2('0x2c')]['sort']);_0x54f063[_0x62c2('0x37')]=qs[_0x62c2('0x2e')](_[_0x62c2('0x38')](_0x3fc462[_0x62c2('0x2c')],_0x166b62[_0x62c2('0x2e')]));if(_0x3fc462[_0x62c2('0x2c')][_0x62c2('0x39')]){_0x54f063['where']=_[_0x62c2('0x3a')](_0x54f063[_0x62c2('0x37')],{'$or':_[_0x62c2('0x26')](_0x12b616,function(_0x12a853){if(_0x12a853[_0x62c2('0x29')]!==_0x62c2('0x3b')){var _0x28821f={};_0x28821f[_0x12a853['name']]={'$like':'%'+_0x3fc462['query'][_0x62c2('0x39')]+'%'};return _0x28821f;}})});}_0x54f063=_[_0x62c2('0x3a')]({},_0x54f063,_0x3fc462['options']);var _0x24894d={'where':_0x54f063[_0x62c2('0x37')]};return db[_0x62c2('0x27')][_0x62c2('0x1a')](_0x24894d)[_0x62c2('0x21')](function(_0x51f971){_0x82107c[_0x62c2('0x1a')]=_0x51f971;if(_0x3fc462[_0x62c2('0x2c')][_0x62c2('0x3c')]){_0x54f063['include']=[{'all':!![]}];}return db[_0x62c2('0x27')][_0x62c2('0x3d')](_0x54f063);})[_0x62c2('0x21')](function(_0x1bc6e0){_0x82107c[_0x62c2('0x3e')]=_0x1bc6e0;return _0x82107c;})[_0x62c2('0x21')](respondWithFilteredResult(_0x4f229a,_0x54f063))[_0x62c2('0x3f')](handleError(_0x4f229a,null));};exports[_0x62c2('0x40')]=function(_0x234acc,_0x515403){var _0x516669={'raw':![],'where':{'id':_0x234acc[_0x62c2('0x41')]['id']}},_0x32bfe2={};_0x32bfe2['model']=_[_0x62c2('0x2d')](db[_0x62c2('0x27')][_0x62c2('0x42')]);_0x32bfe2['query']=_[_0x62c2('0x2d')](_0x234acc[_0x62c2('0x2c')]);_0x32bfe2[_0x62c2('0x2e')]=_[_0x62c2('0x2f')](_0x32bfe2[_0x62c2('0x2b')],_0x32bfe2[_0x62c2('0x2c')]);_0x516669[_0x62c2('0x31')]=_[_0x62c2('0x2f')](_0x32bfe2['model'],qs[_0x62c2('0x30')](_0x234acc[_0x62c2('0x2c')][_0x62c2('0x30')]));_0x516669[_0x62c2('0x31')]=_0x516669['attributes'][_0x62c2('0x32')]?_0x516669[_0x62c2('0x31')]:_0x32bfe2[_0x62c2('0x2b')];if(_0x234acc[_0x62c2('0x2c')][_0x62c2('0x3c')]){_0x516669[_0x62c2('0x43')]=[{'all':!![]}];}_0x516669=_['merge']({},_0x516669,_0x234acc[_0x62c2('0x44')]);return db[_0x62c2('0x27')][_0x62c2('0x45')](_0x516669)[_0x62c2('0x21')](handleEntityNotFound(_0x515403,null))[_0x62c2('0x21')](respondWithResult(_0x515403,null))[_0x62c2('0x3f')](handleError(_0x515403,null));};exports[_0x62c2('0x46')]=function(_0x31f7ee,_0x1886d9){return db[_0x62c2('0x27')][_0x62c2('0x46')](_0x31f7ee['body'],{})['then'](respondWithResult(_0x1886d9,0xc9))[_0x62c2('0x3f')](handleError(_0x1886d9,null));};exports[_0x62c2('0x1f')]=function(_0x3edf93,_0x155700){if(_0x3edf93[_0x62c2('0x47')]['id']){delete _0x3edf93[_0x62c2('0x47')]['id'];}return db[_0x62c2('0x27')][_0x62c2('0x45')]({'where':{'id':_0x3edf93['params']['id']}})['then'](handleEntityNotFound(_0x155700,null))[_0x62c2('0x21')](saveUpdates(_0x3edf93[_0x62c2('0x47')],null))[_0x62c2('0x21')](respondWithResult(_0x155700,null))[_0x62c2('0x3f')](handleError(_0x155700,null));};exports[_0x62c2('0x20')]=function(_0x5aee63,_0x4449a4){return db[_0x62c2('0x27')][_0x62c2('0x45')]({'where':{'id':_0x5aee63[_0x62c2('0x41')]['id']}})[_0x62c2('0x21')](handleEntityNotFound(_0x4449a4,null))['then'](removeEntity(_0x4449a4,null))[_0x62c2('0x3f')](handleError(_0x4449a4,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index a3ff2d4..6d3b106 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 _0x3ef6=['bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','define','lodash','util','api'];(function(_0x49b589,_0x493825){var _0x183d05=function(_0xa006c7){while(--_0xa006c7){_0x49b589['push'](_0x49b589['shift']());}};_0x183d05(++_0x493825);}(_0x3ef6,0x115));var _0x63ef=function(_0x9f3e89,_0x39b12c){_0x9f3e89=_0x9f3e89-0x0;var _0x12d365=_0x3ef6[_0x9f3e89];return _0x12d365;};'use strict';var _=require(_0x63ef('0x0'));var util=require(_0x63ef('0x1'));var logger=require('../../config/logger')(_0x63ef('0x2'));var moment=require('moment');var BPromise=require(_0x63ef('0x3'));var rp=require(_0x63ef('0x4'));var fs=require('fs');var path=require(_0x63ef('0x5'));var rimraf=require('rimraf');var config=require(_0x63ef('0x6'));var attributes=require(_0x63ef('0x7'));module[_0x63ef('0x8')]=function(_0x1820c3,_0x5eb6eb){return _0x1820c3[_0x63ef('0x9')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07fe=['rimraf','./integration.attributes','exports','define','Integration','integrations','util','api','moment','bluebird','path'];(function(_0x277174,_0xed33b5){var _0x19320e=function(_0x1cc212){while(--_0x1cc212){_0x277174['push'](_0x277174['shift']());}};_0x19320e(++_0xed33b5);}(_0x07fe,0x150));var _0xe07f=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x07fe[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require(_0xe07f('0x0'));var logger=require('../../config/logger')(_0xe07f('0x1'));var moment=require(_0xe07f('0x2'));var BPromise=require(_0xe07f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe07f('0x4'));var rimraf=require(_0xe07f('0x5'));var config=require('../../config/environment');var attributes=require(_0xe07f('0x6'));module[_0xe07f('0x7')]=function(_0x42e62e,_0x348ad6){return _0x42e62e[_0xe07f('0x8')](_0xe07f('0x9'),attributes,{'tableName':_0xe07f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 5a221a5..ccbcffb 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 _0x84cb=['debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent'];(function(_0x319de9,_0x4de1c5){var _0x556feb=function(_0x7e11ef){while(--_0x7e11ef){_0x319de9['push'](_0x319de9['shift']());}};_0x556feb(++_0x4de1c5);}(_0x84cb,0xf8));var _0xb84c=function(_0x4dca99,_0x9f7cb2){_0x4dca99=_0x4dca99-0x0;var _0x54fa6a=_0x84cb[_0x4dca99];return _0x54fa6a;};'use strict';var _=require(_0xb84c('0x0'));var util=require('util');var moment=require(_0xb84c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb84c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84c('0x3'))['db'];var utils=require(_0xb84c('0x4'));var logger=require(_0xb84c('0x5'))(_0xb84c('0x6'));var config=require(_0xb84c('0x7'));var jayson=require(_0xb84c('0x8'));var client=jayson[_0xb84c('0x9')][_0xb84c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a69a9,_0x149c6b,_0x471717){return new BPromise(function(_0x282fa1,_0x2bad70){return client[_0xb84c('0xb')](_0x5a69a9,_0x471717)[_0xb84c('0xc')](function(_0x2c6e0b){logger[_0xb84c('0xd')](_0xb84c('0xe'),_0x149c6b,_0xb84c('0xf'));logger[_0xb84c('0x10')](_0xb84c('0x11'),_0x149c6b,'request\x20sent',JSON[_0xb84c('0x12')](_0x2c6e0b));if(_0x2c6e0b[_0xb84c('0x13')]){if(_0x2c6e0b[_0xb84c('0x13')][_0xb84c('0x14')]===0x1f4){logger[_0xb84c('0x13')](_0xb84c('0xe'),_0x149c6b,_0x2c6e0b[_0xb84c('0x13')]['message']);return _0x2bad70(_0x2c6e0b['error'][_0xb84c('0x15')]);}logger['error'](_0xb84c('0xe'),_0x149c6b,_0x2c6e0b[_0xb84c('0x13')][_0xb84c('0x15')]);return _0x282fa1(_0x2c6e0b[_0xb84c('0x13')]['message']);}else{logger[_0xb84c('0xd')]('Integration,\x20%s,\x20%s',_0x149c6b,_0xb84c('0xf'));_0x282fa1(_0x2c6e0b[_0xb84c('0x16')]['message']);}})[_0xb84c('0x17')](function(_0x165d11){logger[_0xb84c('0x13')](_0xb84c('0xe'),_0x149c6b,_0x165d11);_0x2bad70(_0x165d11);});});} \ No newline at end of file +var _0xdd0c=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x24d2db,_0x18983c){var _0x42de43=function(_0x784dfd){while(--_0x784dfd){_0x24d2db['push'](_0x24d2db['shift']());}};_0x42de43(++_0x18983c);}(_0xdd0c,0x165));var _0xcdd0=function(_0x466173,_0x2e8110){_0x466173=_0x466173-0x0;var _0x366ca2=_0xdd0c[_0x466173];return _0x366ca2;};'use strict';var _=require('lodash');var util=require(_0xcdd0('0x0'));var moment=require(_0xcdd0('0x1'));var BPromise=require(_0xcdd0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdd0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdd0('0x4'));var logger=require(_0xcdd0('0x5'))(_0xcdd0('0x6'));var config=require(_0xcdd0('0x7'));var jayson=require(_0xcdd0('0x8'));var client=jayson['client'][_0xcdd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b6f5d,_0x1fd3f6,_0x15c402){return new BPromise(function(_0x337496,_0x557a65){return client[_0xcdd0('0xa')](_0x1b6f5d,_0x15c402)['then'](function(_0x5db720){logger[_0xcdd0('0xb')](_0xcdd0('0xc'),_0x1fd3f6,_0xcdd0('0xd'));logger[_0xcdd0('0xe')](_0xcdd0('0xf'),_0x1fd3f6,_0xcdd0('0xd'),JSON[_0xcdd0('0x10')](_0x5db720));if(_0x5db720[_0xcdd0('0x11')]){if(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x12')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x557a65(_0x5db720['error'][_0xcdd0('0x13')]);}logger[_0xcdd0('0x11')]('Integration,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x337496(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);}else{logger[_0xcdd0('0xb')]('Integration,\x20%s,\x20%s',_0x1fd3f6,'request\x20sent');_0x337496(_0x5db720[_0xcdd0('0x14')][_0xcdd0('0x13')]);}})[_0xcdd0('0x15')](function(_0xf7af04){logger[_0xcdd0('0x11')](_0xcdd0('0xc'),_0x1fd3f6,_0xf7af04);_0x557a65(_0xf7af04);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 8e9ecde..3f1be65 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 _0x2ca3=['delete','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x1f89c8,_0x1cb7f3){var _0x3cf81c=function(_0x249308){while(--_0x249308){_0x1f89c8['push'](_0x1f89c8['shift']());}};_0x3cf81c(++_0x1cb7f3);}(_0x2ca3,0xb5));var _0x32ca=function(_0x386366,_0x29c5a8){_0x386366=_0x386366-0x0;var _0x230dbb=_0x2ca3[_0x386366];return _0x230dbb;};'use strict';var multer=require(_0x32ca('0x0'));var util=require(_0x32ca('0x1'));var path=require('path');var timeout=require(_0x32ca('0x2'));var express=require('express');var router=express[_0x32ca('0x3')]();var auth=require(_0x32ca('0x4'));var interaction=require(_0x32ca('0x5'));var config=require(_0x32ca('0x6'));var controller=require('./integrationReport.controller');router[_0x32ca('0x7')]('/',auth[_0x32ca('0x8')](),controller[_0x32ca('0x9')]);router[_0x32ca('0x7')](_0x32ca('0xa'),auth[_0x32ca('0x8')](),controller[_0x32ca('0xb')]);router[_0x32ca('0x7')](_0x32ca('0xc'),auth[_0x32ca('0x8')](),controller[_0x32ca('0xd')]);router[_0x32ca('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ca('0xf')](_0x32ca('0xc'),auth[_0x32ca('0x8')](),controller[_0x32ca('0x10')]);router[_0x32ca('0x11')](_0x32ca('0xc'),auth[_0x32ca('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x38a5=['../../config/environment','get','index','describe','isAuthenticated','post','create','put','/:id','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4061d2,_0x3735be){var _0x1e5ecb=function(_0x1c0246){while(--_0x1c0246){_0x4061d2['push'](_0x4061d2['shift']());}};_0x1e5ecb(++_0x3735be);}(_0x38a5,0x1da));var _0x538a=function(_0x416daa,_0x4a9249){_0x416daa=_0x416daa-0x0;var _0x54ef28=_0x38a5[_0x416daa];return _0x54ef28;};'use strict';var multer=require(_0x538a('0x0'));var util=require(_0x538a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x538a('0x2'));var router=express[_0x538a('0x3')]();var auth=require(_0x538a('0x4'));var interaction=require(_0x538a('0x5'));var config=require(_0x538a('0x6'));var controller=require('./integrationReport.controller');router[_0x538a('0x7')]('/',auth['isAuthenticated'](),controller[_0x538a('0x8')]);router[_0x538a('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x538a('0x9')]);router[_0x538a('0x7')]('/:id',auth[_0x538a('0xa')](),controller['show']);router[_0x538a('0xb')]('/',auth[_0x538a('0xa')](),controller[_0x538a('0xc')]);router[_0x538a('0xd')]('/:id',auth[_0x538a('0xa')](),controller['update']);router['delete'](_0x538a('0xe'),auth[_0x538a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 4e2a04b..d11aa74 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 _0xa92d=['STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','FAILED','sequelize'];(function(_0x1c11bb,_0xaa8fa0){var _0x4512ce=function(_0x597d51){while(--_0x597d51){_0x1c11bb['push'](_0x1c11bb['shift']());}};_0x4512ce(++_0xaa8fa0);}(_0xa92d,0x104));var _0xda92=function(_0x3ba334,_0x5ea6d2){_0x3ba334=_0x3ba334-0x0;var _0x5ad52c=_0xa92d[_0x3ba334];return _0x5ad52c;};'use strict';var Sequelize=require(_0xda92('0x0'));module['exports']={'integration':{'type':Sequelize[_0xda92('0x1')]},'eventChannel':{'type':Sequelize[_0xda92('0x1')]},'exitStatus':{'type':Sequelize[_0xda92('0x1')]},'ticketId':{'type':Sequelize[_0xda92('0x1')]},'integrationId':{'type':Sequelize[_0xda92('0x2')]},'contacts':{'type':Sequelize[_0xda92('0x1')]},'uniqueid':{'type':Sequelize[_0xda92('0x1')]},'calleridnum':{'type':Sequelize[_0xda92('0x1')]},'calleridname':{'type':Sequelize[_0xda92('0x1')]},'queue':{'type':Sequelize[_0xda92('0x1')]},'interface':{'type':Sequelize[_0xda92('0x1')]},'membername':{'type':Sequelize[_0xda92('0x1')]},'agentcalledAt':{'type':Sequelize[_0xda92('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xda92('0x2')]},'agentcomplete':{'type':Sequelize[_0xda92('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xda92('0x3')]},'talktime':{'type':Sequelize[_0xda92('0x2')]},'agentacw':{'type':Sequelize[_0xda92('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xda92('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xda92('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xda92('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xda92('0x3')]},'lastevent':{'type':Sequelize[_0xda92('0x1')]},'channel':{'type':Sequelize[_0xda92('0x1')]},'channelstate':{'type':Sequelize[_0xda92('0x2')]},'channelstatedesc':{'type':Sequelize[_0xda92('0x1')]},'connectedlinenum':{'type':Sequelize[_0xda92('0x1')]},'connectedlinename':{'type':Sequelize[_0xda92('0x1')]},'language':{'type':Sequelize[_0xda92('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xda92('0x1')]},'destchannel':{'type':Sequelize[_0xda92('0x1')]},'destchannelstate':{'type':Sequelize[_0xda92('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xda92('0x1')]},'destcalleridnum':{'type':Sequelize[_0xda92('0x1')]},'destcalleridname':{'type':Sequelize[_0xda92('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xda92('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xda92('0x1')]},'destlanguage':{'type':Sequelize[_0xda92('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xda92('0x1')]},'destexten':{'type':Sequelize[_0xda92('0x1')]},'destpriority':{'type':Sequelize[_0xda92('0x1')]},'destuniqueid':{'type':Sequelize[_0xda92('0x1')]},'messageId':{'type':Sequelize[_0xda92('0x1')]},'inReplyTo':{'type':Sequelize[_0xda92('0x1')]},'subject':{'type':Sequelize[_0xda92('0x1')]},'from':{'type':Sequelize[_0xda92('0x1')]},'to':{'type':Sequelize[_0xda92('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xda92('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0xda92('0x6'),_0xda92('0x7'),'RECEIVED',_0xda92('0x8'))},'url':{'type':Sequelize[_0xda92('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xda92('0x1')]},'projectId':{'type':Sequelize[_0xda92('0x2')]}}; \ No newline at end of file +var _0xcf82=['STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT','SENDING','FAILED','exports'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xcf82,0x10d));var _0x2cf8=function(_0x47fa5f,_0x4daef9){_0x47fa5f=_0x47fa5f-0x0;var _0xc485a5=_0xcf82[_0x47fa5f];return _0xc485a5;};'use strict';var Sequelize=require('sequelize');module[_0x2cf8('0x0')]={'integration':{'type':Sequelize[_0x2cf8('0x1')]},'eventChannel':{'type':Sequelize[_0x2cf8('0x1')]},'exitStatus':{'type':Sequelize[_0x2cf8('0x1')]},'ticketId':{'type':Sequelize[_0x2cf8('0x1')]},'integrationId':{'type':Sequelize[_0x2cf8('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2cf8('0x1')]},'calleridnum':{'type':Sequelize[_0x2cf8('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2cf8('0x1')]},'interface':{'type':Sequelize[_0x2cf8('0x1')]},'membername':{'type':Sequelize[_0x2cf8('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x2cf8('0x2')]},'agentcomplete':{'type':Sequelize[_0x2cf8('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x2cf8('0x2')]},'agentacw':{'type':Sequelize[_0x2cf8('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2cf8('0x2')]},'reason':{'type':Sequelize[_0x2cf8('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x2cf8('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x2cf8('0x4')]},'agentdump':{'type':Sequelize[_0x2cf8('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2cf8('0x4')]},'lastevent':{'type':Sequelize[_0x2cf8('0x1')]},'channel':{'type':Sequelize[_0x2cf8('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x2cf8('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2cf8('0x1')]},'connectedlinename':{'type':Sequelize[_0x2cf8('0x1')]},'language':{'type':Sequelize[_0x2cf8('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2cf8('0x1')]},'priority':{'type':Sequelize[_0x2cf8('0x1')]},'destchannel':{'type':Sequelize[_0x2cf8('0x1')]},'destchannelstate':{'type':Sequelize[_0x2cf8('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x2cf8('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2cf8('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x2cf8('0x1')]},'destlanguage':{'type':Sequelize[_0x2cf8('0x1')]},'destaccountcode':{'type':Sequelize[_0x2cf8('0x1')]},'destcontext':{'type':Sequelize[_0x2cf8('0x1')]},'destexten':{'type':Sequelize[_0x2cf8('0x1')]},'destpriority':{'type':Sequelize[_0x2cf8('0x1')]},'destuniqueid':{'type':Sequelize[_0x2cf8('0x1')]},'messageId':{'type':Sequelize[_0x2cf8('0x1')]},'inReplyTo':{'type':Sequelize[_0x2cf8('0x1')]},'subject':{'type':Sequelize[_0x2cf8('0x1')]},'from':{'type':Sequelize[_0x2cf8('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x2cf8('0x1')]},'attachment':{'type':Sequelize[_0x2cf8('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x2cf8('0x6')](_0x2cf8('0x7'),_0x2cf8('0x8'),'RECEIVED',_0x2cf8('0x9'))},'url':{'type':Sequelize[_0x2cf8('0x1')]},'app':{'type':Sequelize[_0x2cf8('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x2cf8('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 46569d9..21692a0 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 _0x07a2=['key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','name','send','IntegrationReport','rawAttributes','type'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x07a2,0x12c));var _0x207a=function(_0x1ac562,_0x270a2d){_0x1ac562=_0x1ac562-0x0;var _0x483610=_0x07a2[_0x1ac562];return _0x483610;};'use strict';var pdf=require(_0x207a('0x0'));var emlformat=require(_0x207a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x207a('0x2'));var jsonpatch=require(_0x207a('0x3'));var rp=require(_0x207a('0x4'));var moment=require(_0x207a('0x5'));var BPromise=require(_0x207a('0x6'));var Mustache=require(_0x207a('0x7'));var util=require(_0x207a('0x8'));var path=require(_0x207a('0x9'));var sox=require(_0x207a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x207a('0xb'));var squel=require(_0x207a('0xc'));var crypto=require(_0x207a('0xd'));var jsforce=require(_0x207a('0xe'));var deskjs=require(_0x207a('0xf'));var toCsv=require(_0x207a('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x207a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x207a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x207a('0x13'));var utils=require(_0x207a('0x14'));var config=require(_0x207a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18d39f,_0x20ce67){_0x20ce67=_0x20ce67||0xcc;return function(_0x39e886){if(_0x39e886){return _0x18d39f['sendStatus'](_0x20ce67);}return _0x18d39f[_0x207a('0x16')](_0x20ce67)[_0x207a('0x17')]();};}function respondWithResult(_0xae35ec,_0x3f161f){_0x3f161f=_0x3f161f||0xc8;return function(_0x2865cd){if(_0x2865cd){return _0xae35ec['status'](_0x3f161f)[_0x207a('0x18')](_0x2865cd);}};}function respondWithFilteredResult(_0x5ed660,_0x201f87){return function(_0x2fbafd){if(_0x2fbafd){var _0x2edadb=_0x2fbafd[_0x207a('0x19')],_0x2ab68=_0x201f87[_0x207a('0x1a')],_0x4cfe8c=_0x201f87[_0x207a('0x1a')]+_0x201f87[_0x207a('0x1b')],_0x3e8db5;if(_0x4cfe8c>=_0x2edadb){_0x4cfe8c=_0x2edadb;_0x3e8db5=0xc8;}else{_0x3e8db5=0xce;}_0x5ed660['status'](_0x3e8db5);return _0x5ed660[_0x207a('0x1c')]('Content-Range',_0x2ab68+'-'+_0x4cfe8c+'/'+_0x2edadb)[_0x207a('0x18')](_0x2fbafd);}return null;};}function patchUpdates(_0x28246e){return function(_0x108c0c){try{jsonpatch[_0x207a('0x1d')](_0x108c0c,_0x28246e,!![]);}catch(_0x35150b){return BPromise[_0x207a('0x1e')](_0x35150b);}return _0x108c0c['save']();};}function saveUpdates(_0x104593,_0x30ff20){return function(_0x4ab87d){if(_0x4ab87d){return _0x4ab87d[_0x207a('0x1f')](_0x104593)[_0x207a('0x20')](function(_0x4734db){return _0x4734db;});}return null;};}function removeEntity(_0x30fe52,_0x215467){return function(_0x2d904a){if(_0x2d904a){return _0x2d904a[_0x207a('0x21')]()[_0x207a('0x20')](function(){_0x30fe52[_0x207a('0x16')](0xcc)[_0x207a('0x17')]();});}};}function handleEntityNotFound(_0x391cff,_0x3d793d){return function(_0x8ffe88){if(!_0x8ffe88){_0x391cff['sendStatus'](0x194);}return _0x8ffe88;};}function handleError(_0x9003c0,_0x1ac358){_0x1ac358=_0x1ac358||0x1f4;return function(_0x85233e){logger[_0x207a('0x22')](_0x85233e['stack']);if(_0x85233e[_0x207a('0x23')]){delete _0x85233e[_0x207a('0x23')];}_0x9003c0['status'](_0x1ac358)[_0x207a('0x24')](_0x85233e);};}exports['index']=function(_0x4f09c1,_0x3c81bd){var _0x5a378e={},_0x29b4cc={},_0x2df192={'count':0x0,'rows':[]};var _0x5e540f=_['map'](db[_0x207a('0x25')][_0x207a('0x26')],function(_0x5eb403){return{'name':_0x5eb403['fieldName'],'type':_0x5eb403[_0x207a('0x27')][_0x207a('0x28')]};});_0x29b4cc[_0x207a('0x29')]=_[_0x207a('0x2a')](_0x5e540f,_0x207a('0x23'));_0x29b4cc[_0x207a('0x2b')]=_[_0x207a('0x2c')](_0x4f09c1['query']);_0x29b4cc[_0x207a('0x2d')]=_[_0x207a('0x2e')](_0x29b4cc[_0x207a('0x29')],_0x29b4cc['query']);_0x5a378e['attributes']=_['intersection'](_0x29b4cc['model'],qs[_0x207a('0x2f')](_0x4f09c1[_0x207a('0x2b')][_0x207a('0x2f')]));_0x5a378e[_0x207a('0x30')]=_0x5a378e[_0x207a('0x30')][_0x207a('0x31')]?_0x5a378e[_0x207a('0x30')]:_0x29b4cc[_0x207a('0x29')];if(!_0x4f09c1[_0x207a('0x2b')][_0x207a('0x32')]('nolimit')){_0x5a378e[_0x207a('0x1b')]=qs[_0x207a('0x1b')](_0x4f09c1[_0x207a('0x2b')]['limit']);_0x5a378e['offset']=qs[_0x207a('0x1a')](_0x4f09c1[_0x207a('0x2b')]['offset']);}_0x5a378e[_0x207a('0x33')]=qs[_0x207a('0x34')](_0x4f09c1['query'][_0x207a('0x34')]);_0x5a378e[_0x207a('0x35')]=qs[_0x207a('0x2d')](_['pick'](_0x4f09c1[_0x207a('0x2b')],_0x29b4cc['filters']));if(_0x4f09c1['query'][_0x207a('0x36')]){_0x5a378e[_0x207a('0x35')]=_['merge'](_0x5a378e[_0x207a('0x35')],{'$or':_[_0x207a('0x2a')](_0x5e540f,function(_0x5d4df4){if(_0x5d4df4[_0x207a('0x27')]!==_0x207a('0x37')){var _0x1b100b={};_0x1b100b[_0x5d4df4[_0x207a('0x23')]]={'$like':'%'+_0x4f09c1[_0x207a('0x2b')]['filter']+'%'};return _0x1b100b;}})});}_0x5a378e=_[_0x207a('0x38')]({},_0x5a378e,_0x4f09c1[_0x207a('0x39')]);var _0xd24dc6={'where':_0x5a378e[_0x207a('0x35')]};return db[_0x207a('0x25')][_0x207a('0x19')](_0xd24dc6)[_0x207a('0x20')](function(_0x54b21c){_0x2df192[_0x207a('0x19')]=_0x54b21c;if(_0x4f09c1['query'][_0x207a('0x3a')]){_0x5a378e[_0x207a('0x3b')]=[{'all':!![]}];}return db['IntegrationReport'][_0x207a('0x3c')](_0x5a378e);})['then'](function(_0x1dde4f){_0x2df192[_0x207a('0x3d')]=_0x1dde4f;return _0x2df192;})[_0x207a('0x20')](respondWithFilteredResult(_0x3c81bd,_0x5a378e))[_0x207a('0x3e')](handleError(_0x3c81bd,null));};exports['show']=function(_0x798a62,_0x3cb5a9){var _0x3287e2={'raw':![],'where':{'id':_0x798a62[_0x207a('0x3f')]['id']}},_0xf7999f={};_0xf7999f[_0x207a('0x29')]=_['keys'](db[_0x207a('0x25')]['rawAttributes']);_0xf7999f['query']=_[_0x207a('0x2c')](_0x798a62['query']);_0xf7999f['filters']=_[_0x207a('0x2e')](_0xf7999f['model'],_0xf7999f[_0x207a('0x2b')]);_0x3287e2[_0x207a('0x30')]=_[_0x207a('0x2e')](_0xf7999f[_0x207a('0x29')],qs[_0x207a('0x2f')](_0x798a62[_0x207a('0x2b')][_0x207a('0x2f')]));_0x3287e2[_0x207a('0x30')]=_0x3287e2[_0x207a('0x30')]['length']?_0x3287e2['attributes']:_0xf7999f[_0x207a('0x29')];if(_0x798a62[_0x207a('0x2b')][_0x207a('0x3a')]){_0x3287e2[_0x207a('0x3b')]=[{'all':!![]}];}_0x3287e2=_[_0x207a('0x38')]({},_0x3287e2,_0x798a62[_0x207a('0x39')]);return db[_0x207a('0x25')][_0x207a('0x40')](_0x3287e2)[_0x207a('0x20')](handleEntityNotFound(_0x3cb5a9,null))[_0x207a('0x20')](respondWithResult(_0x3cb5a9,null))[_0x207a('0x3e')](handleError(_0x3cb5a9,null));};exports[_0x207a('0x41')]=function(_0x246237,_0x41738c){return db[_0x207a('0x25')][_0x207a('0x41')](_0x246237[_0x207a('0x42')],{})[_0x207a('0x20')](respondWithResult(_0x41738c,0xc9))[_0x207a('0x3e')](handleError(_0x41738c,null));};exports[_0x207a('0x1f')]=function(_0x1c743c,_0x1191ce){if(_0x1c743c[_0x207a('0x42')]['id']){delete _0x1c743c['body']['id'];}return db[_0x207a('0x25')][_0x207a('0x40')]({'where':{'id':_0x1c743c['params']['id']}})['then'](handleEntityNotFound(_0x1191ce,null))['then'](saveUpdates(_0x1c743c['body'],null))['then'](respondWithResult(_0x1191ce,null))[_0x207a('0x3e')](handleError(_0x1191ce,null));};exports['destroy']=function(_0x37c22d,_0xa6097){return db[_0x207a('0x25')][_0x207a('0x40')]({'where':{'id':_0x37c22d[_0x207a('0x3f')]['id']}})[_0x207a('0x20')](handleEntityNotFound(_0xa6097,null))['then'](removeEntity(_0xa6097,null))['catch'](handleError(_0xa6097,null));};exports[_0x207a('0x43')]=function(_0x24c1b2,_0x1bb615){return db[_0x207a('0x25')]['describe']()[_0x207a('0x20')](respondWithResult(_0x1bb615,null))[_0x207a('0x3e')](handleError(_0x1bb615,null));}; \ No newline at end of file +var _0x9f0e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','IntegrationReport','includeAll','include','findAll','rows','catch','options','find','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x374ade,_0x4b8e9a){var _0xe6232=function(_0x6a310e){while(--_0x6a310e){_0x374ade['push'](_0x374ade['shift']());}};_0xe6232(++_0x4b8e9a);}(_0x9f0e,0x116));var _0xe9f0=function(_0x2b9f5b,_0xbc220c){_0x2b9f5b=_0x2b9f5b-0x0;var _0x4e59f4=_0x9f0e[_0x2b9f5b];return _0x4e59f4;};'use strict';var pdf=require(_0xe9f0('0x0'));var emlformat=require(_0xe9f0('0x1'));var rimraf=require(_0xe9f0('0x2'));var zipdir=require(_0xe9f0('0x3'));var jsonpatch=require(_0xe9f0('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe9f0('0x5'));var Mustache=require(_0xe9f0('0x6'));var util=require(_0xe9f0('0x7'));var path=require(_0xe9f0('0x8'));var sox=require(_0xe9f0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0xe'));var querystring=require(_0xe9f0('0xf'));var Papa=require(_0xe9f0('0x10'));var Redis=require(_0xe9f0('0x11'));var authService=require(_0xe9f0('0x12'));var qs=require(_0xe9f0('0x13'));var as=require(_0xe9f0('0x14'));var hardwareService=require(_0xe9f0('0x15'));var logger=require('../../config/logger')(_0xe9f0('0x16'));var utils=require(_0xe9f0('0x17'));var config=require(_0xe9f0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207fac,_0x586763){_0x586763=_0x586763||0xcc;return function(_0x367545){if(_0x367545){return _0x207fac[_0xe9f0('0x19')](_0x586763);}return _0x207fac[_0xe9f0('0x1a')](_0x586763)[_0xe9f0('0x1b')]();};}function respondWithResult(_0x55a388,_0x2cf75d){_0x2cf75d=_0x2cf75d||0xc8;return function(_0x5a10c6){if(_0x5a10c6){return _0x55a388[_0xe9f0('0x1a')](_0x2cf75d)[_0xe9f0('0x1c')](_0x5a10c6);}};}function respondWithFilteredResult(_0x3800e8,_0x59320d){return function(_0x28bfac){if(_0x28bfac){var _0x33e9e4=_0x28bfac[_0xe9f0('0x1d')],_0x2e68ef=_0x59320d[_0xe9f0('0x1e')],_0x598eee=_0x59320d[_0xe9f0('0x1e')]+_0x59320d[_0xe9f0('0x1f')],_0xaa7aa6;if(_0x598eee>=_0x33e9e4){_0x598eee=_0x33e9e4;_0xaa7aa6=0xc8;}else{_0xaa7aa6=0xce;}_0x3800e8[_0xe9f0('0x1a')](_0xaa7aa6);return _0x3800e8[_0xe9f0('0x20')]('Content-Range',_0x2e68ef+'-'+_0x598eee+'/'+_0x33e9e4)[_0xe9f0('0x1c')](_0x28bfac);}return null;};}function patchUpdates(_0x19e090){return function(_0x232f2c){try{jsonpatch['apply'](_0x232f2c,_0x19e090,!![]);}catch(_0x35e841){return BPromise[_0xe9f0('0x21')](_0x35e841);}return _0x232f2c[_0xe9f0('0x22')]();};}function saveUpdates(_0x43f399,_0x5ba788){return function(_0x33f143){if(_0x33f143){return _0x33f143[_0xe9f0('0x23')](_0x43f399)['then'](function(_0x51e03f){return _0x51e03f;});}return null;};}function removeEntity(_0x4cc403,_0x12fe9f){return function(_0xa1ddc){if(_0xa1ddc){return _0xa1ddc[_0xe9f0('0x24')]()[_0xe9f0('0x25')](function(){_0x4cc403[_0xe9f0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(!_0x437d43){_0x229fe0[_0xe9f0('0x19')](0x194);}return _0x437d43;};}function handleError(_0x3ca991,_0x372ffd){_0x372ffd=_0x372ffd||0x1f4;return function(_0x37c0fc){logger[_0xe9f0('0x26')](_0x37c0fc[_0xe9f0('0x27')]);if(_0x37c0fc[_0xe9f0('0x28')]){delete _0x37c0fc['name'];}_0x3ca991[_0xe9f0('0x1a')](_0x372ffd)[_0xe9f0('0x29')](_0x37c0fc);};}exports[_0xe9f0('0x2a')]=function(_0x1a8478,_0x4cf1b1){var _0x212a38={},_0x2613fd={},_0x856ac8={'count':0x0,'rows':[]};var _0x1f98a7=_[_0xe9f0('0x2b')](db['IntegrationReport'][_0xe9f0('0x2c')],function(_0xdc16bc){return{'name':_0xdc16bc[_0xe9f0('0x2d')],'type':_0xdc16bc[_0xe9f0('0x2e')][_0xe9f0('0x2f')]};});_0x2613fd[_0xe9f0('0x30')]=_[_0xe9f0('0x2b')](_0x1f98a7,_0xe9f0('0x28'));_0x2613fd[_0xe9f0('0x31')]=_[_0xe9f0('0x32')](_0x1a8478[_0xe9f0('0x31')]);_0x2613fd[_0xe9f0('0x33')]=_[_0xe9f0('0x34')](_0x2613fd[_0xe9f0('0x30')],_0x2613fd[_0xe9f0('0x31')]);_0x212a38[_0xe9f0('0x35')]=_[_0xe9f0('0x34')](_0x2613fd[_0xe9f0('0x30')],qs[_0xe9f0('0x36')](_0x1a8478[_0xe9f0('0x31')][_0xe9f0('0x36')]));_0x212a38[_0xe9f0('0x35')]=_0x212a38[_0xe9f0('0x35')][_0xe9f0('0x37')]?_0x212a38['attributes']:_0x2613fd['model'];if(!_0x1a8478['query'][_0xe9f0('0x38')]('nolimit')){_0x212a38[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x1a8478['query'][_0xe9f0('0x1f')]);_0x212a38['offset']=qs['offset'](_0x1a8478['query'][_0xe9f0('0x1e')]);}_0x212a38[_0xe9f0('0x39')]=qs['sort'](_0x1a8478[_0xe9f0('0x31')][_0xe9f0('0x3a')]);_0x212a38[_0xe9f0('0x3b')]=qs['filters'](_['pick'](_0x1a8478[_0xe9f0('0x31')],_0x2613fd[_0xe9f0('0x33')]));if(_0x1a8478[_0xe9f0('0x31')]['filter']){_0x212a38[_0xe9f0('0x3b')]=_[_0xe9f0('0x3c')](_0x212a38[_0xe9f0('0x3b')],{'$or':_[_0xe9f0('0x2b')](_0x1f98a7,function(_0x2b38de){if(_0x2b38de['type']!==_0xe9f0('0x3d')){var _0x3a2b23={};_0x3a2b23[_0x2b38de[_0xe9f0('0x28')]]={'$like':'%'+_0x1a8478['query'][_0xe9f0('0x3e')]+'%'};return _0x3a2b23;}})});}_0x212a38=_[_0xe9f0('0x3c')]({},_0x212a38,_0x1a8478['options']);var _0x317278={'where':_0x212a38['where']};return db[_0xe9f0('0x3f')]['count'](_0x317278)['then'](function(_0x51eda3){_0x856ac8['count']=_0x51eda3;if(_0x1a8478['query'][_0xe9f0('0x40')]){_0x212a38[_0xe9f0('0x41')]=[{'all':!![]}];}return db[_0xe9f0('0x3f')][_0xe9f0('0x42')](_0x212a38);})[_0xe9f0('0x25')](function(_0xd9b61b){_0x856ac8[_0xe9f0('0x43')]=_0xd9b61b;return _0x856ac8;})[_0xe9f0('0x25')](respondWithFilteredResult(_0x4cf1b1,_0x212a38))[_0xe9f0('0x44')](handleError(_0x4cf1b1,null));};exports['show']=function(_0x1e2016,_0x3eeea3){var _0x36b00a={'raw':![],'where':{'id':_0x1e2016['params']['id']}},_0x571366={};_0x571366[_0xe9f0('0x30')]=_['keys'](db[_0xe9f0('0x3f')][_0xe9f0('0x2c')]);_0x571366[_0xe9f0('0x31')]=_[_0xe9f0('0x32')](_0x1e2016['query']);_0x571366[_0xe9f0('0x33')]=_[_0xe9f0('0x34')](_0x571366[_0xe9f0('0x30')],_0x571366[_0xe9f0('0x31')]);_0x36b00a[_0xe9f0('0x35')]=_['intersection'](_0x571366[_0xe9f0('0x30')],qs[_0xe9f0('0x36')](_0x1e2016[_0xe9f0('0x31')][_0xe9f0('0x36')]));_0x36b00a[_0xe9f0('0x35')]=_0x36b00a['attributes'][_0xe9f0('0x37')]?_0x36b00a['attributes']:_0x571366['model'];if(_0x1e2016[_0xe9f0('0x31')][_0xe9f0('0x40')]){_0x36b00a['include']=[{'all':!![]}];}_0x36b00a=_[_0xe9f0('0x3c')]({},_0x36b00a,_0x1e2016[_0xe9f0('0x45')]);return db[_0xe9f0('0x3f')][_0xe9f0('0x46')](_0x36b00a)[_0xe9f0('0x25')](handleEntityNotFound(_0x3eeea3,null))[_0xe9f0('0x25')](respondWithResult(_0x3eeea3,null))[_0xe9f0('0x44')](handleError(_0x3eeea3,null));};exports['create']=function(_0x8b8da3,_0x4a6e2a){return db[_0xe9f0('0x3f')]['create'](_0x8b8da3[_0xe9f0('0x47')],{})['then'](respondWithResult(_0x4a6e2a,0xc9))[_0xe9f0('0x44')](handleError(_0x4a6e2a,null));};exports[_0xe9f0('0x23')]=function(_0x422324,_0x4c94e9){if(_0x422324[_0xe9f0('0x47')]['id']){delete _0x422324[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x3f')][_0xe9f0('0x46')]({'where':{'id':_0x422324[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x25')](handleEntityNotFound(_0x4c94e9,null))[_0xe9f0('0x25')](saveUpdates(_0x422324[_0xe9f0('0x47')],null))[_0xe9f0('0x25')](respondWithResult(_0x4c94e9,null))[_0xe9f0('0x44')](handleError(_0x4c94e9,null));};exports[_0xe9f0('0x24')]=function(_0x1325a2,_0x57beee){return db['IntegrationReport'][_0xe9f0('0x46')]({'where':{'id':_0x1325a2[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x25')](handleEntityNotFound(_0x57beee,null))['then'](removeEntity(_0x57beee,null))[_0xe9f0('0x44')](handleError(_0x57beee,null));};exports['describe']=function(_0x323e1e,_0x3c69c0){return db[_0xe9f0('0x3f')][_0xe9f0('0x49')]()['then'](respondWithResult(_0x3c69c0,null))[_0xe9f0('0x44')](handleError(_0x3c69c0,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index e166416..2c981f7 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 _0xb04a=['rimraf','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3b7b8a,_0x52c3b0){var _0x441206=function(_0x5d34d3){while(--_0x5d34d3){_0x3b7b8a['push'](_0x3b7b8a['shift']());}};_0x441206(++_0x52c3b0);}(_0xb04a,0x72));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab04('0x0'));var util=require(_0xab04('0x1'));var logger=require('../../config/logger')(_0xab04('0x2'));var moment=require(_0xab04('0x3'));var BPromise=require(_0xab04('0x4'));var rp=require(_0xab04('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab04('0x6'));var config=require('../../config/environment');var attributes=require(_0xab04('0x7'));module[_0xab04('0x8')]=function(_0x5016fc,_0x48ed5b){return _0x5016fc[_0xab04('0x9')](_0xab04('0xa'),attributes,{'tableName':_0xab04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0762=['request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','util','../../config/logger','api'];(function(_0x5854a6,_0x4111dd){var _0x32c7ee=function(_0x4a28dd){while(--_0x4a28dd){_0x5854a6['push'](_0x5854a6['shift']());}};_0x32c7ee(++_0x4111dd);}(_0x0762,0x151));var _0x2076=function(_0x1c33f8,_0x27759c){_0x1c33f8=_0x1c33f8-0x0;var _0x13ab65=_0x0762[_0x1c33f8];return _0x13ab65;};'use strict';var _=require('lodash');var util=require(_0x2076('0x0'));var logger=require(_0x2076('0x1'))(_0x2076('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2076('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2076('0x4'));var config=require(_0x2076('0x5'));var attributes=require(_0x2076('0x6'));module[_0x2076('0x7')]=function(_0x5d0dbc,_0x5588c8){return _0x5d0dbc[_0x2076('0x8')]('IntegrationReport',attributes,{'tableName':_0x2076('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 2dd0c41..ecc7ff7 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x30ebcc,_0x307cf4){var _0x19b3d8=function(_0x315965){while(--_0x315965){_0x30ebcc['push'](_0x30ebcc['shift']());}};_0x19b3d8(++_0x307cf4);}(_0x14a0,0x8e));var _0x014a=function(_0x53bd74,_0x28c110){_0x53bd74=_0x53bd74-0x0;var _0x5a8731=_0x14a0[_0x53bd74];return _0x5a8731;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index ba65eb6..b302bda 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x161327,_0x2938fc){var _0x229483=function(_0xd1bca9){while(--_0xd1bca9){_0x161327['push'](_0x161327['shift']());}};_0x229483(++_0x2938fc);}(_0x34e8,0x12c));var _0x834e=function(_0x1124df,_0x29002f){_0x1124df=_0x1124df-0x0;var _0x18d92b=_0x34e8[_0x1124df];return _0x18d92b;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0xe')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0xe')](_0x834e('0x11'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);router['put'](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['update']);router[_0x834e('0x14')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller[_0x834e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xedd9=['getIntervals','post','addInterval','addIntervals','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sub_intervals'];(function(_0x5590f5,_0x152c02){var _0x181159=function(_0x62b0e7){while(--_0x62b0e7){_0x5590f5['push'](_0x5590f5['shift']());}};_0x181159(++_0x152c02);}(_0xedd9,0xfc));var _0x9edd=function(_0x295716,_0x491834){_0x295716=_0x295716-0x0;var _0x3f2d9e=_0xedd9[_0x295716];return _0x3f2d9e;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./interval.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['post']('/',auth[_0x9edd('0x9')](),controller['create']);router[_0x9edd('0xd')](_0x9edd('0xb'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xd')]('/:id/sub_intervals/create_many',auth[_0x9edd('0x9')](),controller[_0x9edd('0xf')]);router[_0x9edd('0x10')](_0x9edd('0x11'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')](_0x9edd('0x11'),auth['isAuthenticated'](),controller[_0x9edd('0x14')]);module[_0x9edd('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index a12217f..029e607 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 _0x2154=['exports','STRING','sequelize'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x2154,0x128));var _0x4215=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x2154[_0x34bf97];return _0x292719;};'use strict';var Sequelize=require(_0x4215('0x0'));module[_0x4215('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4215('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x6df3=['exports','STRING','sequelize'];(function(_0x429688,_0x375c2a){var _0x45b505=function(_0x1e2605){while(--_0x1e2605){_0x429688['push'](_0x429688['shift']());}};_0x45b505(++_0x375c2a);}(_0x6df3,0x7d));var _0x36df=function(_0x173918,_0x264677){_0x173918=_0x173918-0x0;var _0x13b99f=_0x6df3[_0x173918];return _0x13b99f;};'use strict';var Sequelize=require(_0x36df('0x0'));module[_0x36df('0x1')]={'name':{'type':Sequelize[_0x36df('0x2')]},'description':{'type':Sequelize[_0x36df('0x2')]},'interval':{'type':Sequelize[_0x36df('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index ace3f15..7117416 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 _0xedd9=['sequelize','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','limit','set','save','update','then','get','Intervals','destroy','end','name','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','userProfileId','UserProfileResource','error','getIntervals','addIntervals'];(function(_0xe2e0e1,_0x441d92){var _0x1a2785=function(_0x3817aa){while(--_0x3817aa){_0xe2e0e1['push'](_0xe2e0e1['shift']());}};_0x1a2785(++_0x441d92);}(_0xedd9,0xfc));var _0x9edd=function(_0x66dc78,_0x4f7ce1){_0x66dc78=_0x66dc78-0x0;var _0x6da2f7=_0xedd9[_0x66dc78];return _0x6da2f7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var db=require(_0x9edd('0x16'))['db'];var extensions=require(_0x9edd('0x17'));function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=_0x75a4ab['count'],_0x5f5bf4=_0x1042aa[_0x9edd('0x1b')],_0x448996=_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1c')],_0x449cee;if(_0x448996>=_0x4ea60f){_0x448996=_0x4ea60f;_0x449cee=0xc8;}else{_0x449cee=0xce;}_0x338f3c['status'](_0x449cee);return _0x338f3c[_0x9edd('0x1d')]('Content-Range',_0x5f5bf4+'-'+_0x448996+'/'+_0x4ea60f)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x1083e4){return function(_0x4bdb88){try{jsonpatch['apply'](_0x4bdb88,_0x1083e4,!![]);}catch(_0x45c3ab){return BPromise['reject'](_0x45c3ab);}return _0x4bdb88[_0x9edd('0x1e')]();};}function saveUpdates(_0x54a03f,_0x535f37){return function(_0x356751){if(_0x356751){return _0x356751[_0x9edd('0x1f')](_0x54a03f)['then'](function(_0x5823bc){return _0x5823bc;});}return null;};}function removeEntity(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['destroy']()[_0x9edd('0x20')](function(){var _0x1dca43=_0x477878[_0x9edd('0x21')]({'plain':!![]});var _0x2ca65f=_0x9edd('0x22');return db['UserProfileResource'][_0x9edd('0x23')]({'where':{'type':_0x2ca65f,'resourceId':_0x1dca43['id']}})[_0x9edd('0x20')](function(){return _0x477878;});})[_0x9edd('0x20')](function(){_0x341d67[_0x9edd('0x19')](0xcc)[_0x9edd('0x24')]();});}};}function handleEntityNotFound(_0x4d507f,_0x4b3d1b){return function(_0x3276ee){if(!_0x3276ee){_0x4d507f[_0x9edd('0x18')](0x194);}return _0x3276ee;};}function handleError(_0x8d67aa,_0x25e135){_0x25e135=_0x25e135||0x1f4;return function(_0x3c2227){logger['error'](_0x3c2227['stack']);if(_0x3c2227[_0x9edd('0x25')]){delete _0x3c2227[_0x9edd('0x25')];}_0x8d67aa[_0x9edd('0x19')](_0x25e135)['send'](_0x3c2227);};}exports[_0x9edd('0x26')]=function(_0x28cfae,_0x2ae8dd){var _0x41af53={},_0x5eccfb={},_0x2155a1={'count':0x0,'rows':[]};var _0x3fb556=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x42e664){return{'name':_0x42e664[_0x9edd('0x2a')],'type':_0x42e664[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x5eccfb[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x3fb556,_0x9edd('0x25'));_0x5eccfb[_0x9edd('0x2e')]=_[_0x9edd('0x2f')](_0x28cfae[_0x9edd('0x2e')]);_0x5eccfb['filters']=_[_0x9edd('0x30')](_0x5eccfb[_0x9edd('0x2d')],_0x5eccfb[_0x9edd('0x2e')]);_0x41af53['attributes']=_[_0x9edd('0x30')](_0x5eccfb[_0x9edd('0x2d')],qs[_0x9edd('0x31')](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x31')]));_0x41af53[_0x9edd('0x32')]=_0x41af53[_0x9edd('0x32')][_0x9edd('0x33')]?_0x41af53[_0x9edd('0x32')]:_0x5eccfb[_0x9edd('0x2d')];if(!_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x34')](_0x9edd('0x35'))){_0x41af53[_0x9edd('0x1c')]=qs['limit'](_0x28cfae[_0x9edd('0x2e')]['limit']);_0x41af53[_0x9edd('0x1b')]=qs[_0x9edd('0x1b')](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x1b')]);}_0x41af53[_0x9edd('0x36')]=qs['sort'](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x37')]);_0x41af53[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_[_0x9edd('0x3a')](_0x28cfae[_0x9edd('0x2e')],_0x5eccfb[_0x9edd('0x39')]));if(_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x3b')]){_0x41af53[_0x9edd('0x38')]=_['merge'](_0x41af53[_0x9edd('0x38')],{'$or':_['map'](_0x3fb556,function(_0x3ef1d5){if(_0x3ef1d5['type']!==_0x9edd('0x3c')){var _0x2858b5={};_0x2858b5[_0x3ef1d5[_0x9edd('0x25')]]={'$like':'%'+_0x28cfae['query'][_0x9edd('0x3b')]+'%'};return _0x2858b5;}})});}_0x41af53=_[_0x9edd('0x3d')]({},_0x41af53,_0x28cfae[_0x9edd('0x3e')]);var _0x48958a={'where':_0x41af53[_0x9edd('0x38')]};return db['Interval'][_0x9edd('0x3f')](_0x48958a)[_0x9edd('0x20')](function(_0x50be2c){_0x2155a1[_0x9edd('0x3f')]=_0x50be2c;if(_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x40')]){_0x41af53[_0x9edd('0x41')]=[{'all':!![]}];}return db['Interval'][_0x9edd('0x42')](_0x41af53);})['then'](function(_0x2bdb3f){_0x2155a1[_0x9edd('0x43')]=_0x2bdb3f;return _0x2155a1;})['then'](respondWithFilteredResult(_0x2ae8dd,_0x41af53))[_0x9edd('0x44')](handleError(_0x2ae8dd,null));};exports['show']=function(_0x548299,_0x369b69){var _0x9cab86={'raw':!![],'where':{'id':_0x548299[_0x9edd('0x45')]['id']}},_0x1f276b={};_0x1f276b[_0x9edd('0x2d')]=_[_0x9edd('0x2f')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x1f276b[_0x9edd('0x2e')]=_[_0x9edd('0x2f')](_0x548299[_0x9edd('0x2e')]);_0x1f276b[_0x9edd('0x39')]=_[_0x9edd('0x30')](_0x1f276b[_0x9edd('0x2d')],_0x1f276b[_0x9edd('0x2e')]);_0x9cab86['attributes']=_[_0x9edd('0x30')](_0x1f276b[_0x9edd('0x2d')],qs[_0x9edd('0x31')](_0x548299[_0x9edd('0x2e')][_0x9edd('0x31')]));_0x9cab86[_0x9edd('0x32')]=_0x9cab86[_0x9edd('0x32')]['length']?_0x9cab86['attributes']:_0x1f276b['model'];if(_0x548299[_0x9edd('0x2e')]['includeAll']){_0x9cab86[_0x9edd('0x41')]=[{'all':!![]}];}_0x9cab86=_[_0x9edd('0x3d')]({},_0x9cab86,_0x548299[_0x9edd('0x3e')]);return db[_0x9edd('0x28')][_0x9edd('0x46')](_0x9cab86)['then'](handleEntityNotFound(_0x369b69,null))[_0x9edd('0x20')](respondWithResult(_0x369b69,null))[_0x9edd('0x44')](handleError(_0x369b69,null));};exports[_0x9edd('0x47')]=function(_0x4a89ae,_0x3626bc){return db[_0x9edd('0x28')][_0x9edd('0x47')](_0x4a89ae[_0x9edd('0x48')],{})[_0x9edd('0x20')](function(_0x35bdec){var _0x4d4f33=_0x4a89ae[_0x9edd('0x49')][_0x9edd('0x21')]({'plain':!![]});if(!_0x4d4f33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d4f33[_0x9edd('0x4a')]===_0x9edd('0x49')){var _0x4bb324=_0x35bdec[_0x9edd('0x21')]({'plain':!![]});var _0x8134cd=_0x9edd('0x22');return db['UserProfileSection'][_0x9edd('0x46')]({'where':{'name':_0x8134cd,'userProfileId':_0x4d4f33[_0x9edd('0x4b')]},'raw':!![]})[_0x9edd('0x20')](function(_0x28c7bd){if(_0x28c7bd&&_0x28c7bd['autoAssociation']===0x0){return db[_0x9edd('0x4c')][_0x9edd('0x47')]({'name':_0x4bb324[_0x9edd('0x25')],'resourceId':_0x4bb324['id'],'type':_0x28c7bd['name'],'sectionId':_0x28c7bd['id']},{})[_0x9edd('0x20')](function(){return _0x35bdec;});}else{return _0x35bdec;}})[_0x9edd('0x44')](function(_0x57db43){logger[_0x9edd('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57db43);throw _0x57db43;});}return _0x35bdec;})[_0x9edd('0x20')](respondWithResult(_0x3626bc,0xc9))[_0x9edd('0x44')](handleError(_0x3626bc,null));};exports[_0x9edd('0x1f')]=function(_0x3fcdf5,_0x1e3c19){if(_0x3fcdf5[_0x9edd('0x48')]['id']){delete _0x3fcdf5[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x46')]({'where':{'id':_0x3fcdf5[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x1e3c19,null))['then'](saveUpdates(_0x3fcdf5[_0x9edd('0x48')],null))[_0x9edd('0x20')](respondWithResult(_0x1e3c19,null))[_0x9edd('0x44')](handleError(_0x1e3c19,null));};exports['destroy']=function(_0xe96d6a,_0x54a704){return db['Interval']['find']({'where':{'id':_0xe96d6a[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x54a704,null))[_0x9edd('0x20')](removeEntity(_0x54a704,null))[_0x9edd('0x44')](handleError(_0x54a704,null));};exports['addInterval']=function(_0x56b38b,_0x4e3c3e,_0x71820f){if(_0x56b38b[_0x9edd('0x48')]['id']){delete _0x56b38b[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x46')]({'where':{'id':_0x56b38b[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x4e3c3e,null))[_0x9edd('0x20')](function(_0x4eb780){if(_0x4eb780){_0x56b38b[_0x9edd('0x48')]['IntervalId']=_0x4eb780['id'];return db[_0x9edd('0x28')][_0x9edd('0x47')](_0x56b38b['body']);}})[_0x9edd('0x20')](respondWithResult(_0x4e3c3e,null))[_0x9edd('0x44')](handleError(_0x4e3c3e,null));};exports[_0x9edd('0x4e')]=function(_0x5ec9af,_0xc648c4,_0x2e1ce3){var _0x430eb4={};var _0x15ebfa={};var _0x1720b1;var _0x2c3173;return db['Interval']['findOne']({'where':{'id':_0x5ec9af[_0x9edd('0x45')]['id']}})['then'](handleEntityNotFound(_0xc648c4,null))[_0x9edd('0x20')](function(_0x3e9a3e){if(_0x3e9a3e){_0x1720b1=_0x3e9a3e;_0x15ebfa[_0x9edd('0x2d')]=_[_0x9edd('0x2f')](db['Interval'][_0x9edd('0x29')]);_0x15ebfa['query']=_[_0x9edd('0x2f')](_0x5ec9af[_0x9edd('0x2e')]);_0x15ebfa[_0x9edd('0x39')]=_['intersection'](_0x15ebfa[_0x9edd('0x2d')],_0x15ebfa['query']);_0x430eb4[_0x9edd('0x32')]=_[_0x9edd('0x30')](_0x15ebfa['model'],qs[_0x9edd('0x31')](_0x5ec9af['query'][_0x9edd('0x31')]));_0x430eb4[_0x9edd('0x32')]=_0x430eb4[_0x9edd('0x32')]['length']?_0x430eb4[_0x9edd('0x32')]:_0x15ebfa[_0x9edd('0x2d')];_0x430eb4[_0x9edd('0x36')]=qs[_0x9edd('0x37')](_0x5ec9af[_0x9edd('0x2e')]['sort']);_0x430eb4['where']=qs[_0x9edd('0x39')](_[_0x9edd('0x3a')](_0x5ec9af['query'],_0x15ebfa['filters']));if(_0x5ec9af['query'][_0x9edd('0x3b')]){_0x430eb4['where']=_['merge'](_0x430eb4[_0x9edd('0x38')],{'$or':_[_0x9edd('0x27')](_0x430eb4['attributes'],function(_0xb9ebeb){var _0x11e082={};_0x11e082[_0xb9ebeb]={'$like':'%'+_0x5ec9af[_0x9edd('0x2e')]['filter']+'%'};return _0x11e082;})});}_0x430eb4=_[_0x9edd('0x3d')]({},_0x430eb4,_0x5ec9af['options']);return _0x1720b1[_0x9edd('0x4e')](_0x430eb4);}})[_0x9edd('0x20')](function(_0x4c8d06){if(_0x4c8d06){_0x2c3173=_0x4c8d06[_0x9edd('0x33')];if(!_0x5ec9af[_0x9edd('0x2e')]['hasOwnProperty'](_0x9edd('0x35'))){_0x430eb4[_0x9edd('0x1c')]=qs[_0x9edd('0x1c')](_0x5ec9af[_0x9edd('0x2e')]['limit']);_0x430eb4[_0x9edd('0x1b')]=qs['offset'](_0x5ec9af[_0x9edd('0x2e')][_0x9edd('0x1b')]);}return _0x1720b1[_0x9edd('0x4e')](_0x430eb4);}})['then'](function(_0x106a67){if(_0x106a67){return _0x106a67?{'count':_0x2c3173,'rows':_0x106a67}:null;}})[_0x9edd('0x20')](respondWithResult(_0xc648c4,null))[_0x9edd('0x44')](handleError(_0xc648c4,null));};exports[_0x9edd('0x4f')]=function(_0x25626a,_0x14e2e5,_0x3fa4a9){return db['Interval']['findOne']({'where':{'id':_0x25626a[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x14e2e5,null))[_0x9edd('0x20')](function(_0x171403){if(_0x171403){return db[_0x9edd('0x50')]['transaction'](function(_0x2e40c8){return db[_0x9edd('0x28')][_0x9edd('0x23')]({'where':{'IntervalId':_0x25626a['params']['id']},'transaction':_0x2e40c8})[_0x9edd('0x20')](function(_0x29d70d){var _0x4b1c12=_[_0x9edd('0x27')](_0x25626a[_0x9edd('0x48')],function(_0x58c839){delete _0x58c839['id'];_0x58c839[_0x9edd('0x51')]=_0x25626a[_0x9edd('0x45')]['id'];return _0x58c839;});return db['Interval'][_0x9edd('0x52')](_0x4b1c12,{'transaction':_0x2e40c8});});})['then'](function(){return db['Interval'][_0x9edd('0x42')]({'where':{'IntervalId':_0x25626a[_0x9edd('0x45')]['id']}});});}})[_0x9edd('0x20')](respondWithResult(_0x14e2e5,null))['catch'](handleError(_0x14e2e5,null));}; \ No newline at end of file +var _0x70e0=['findAll','rows','catch','show','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals','findOne','order','hasOwnProperty','addIntervals','transaction','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','offset','limit','set','apply','update','destroy','then','get','Intervals','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','map','intersection','query','attributes','fields','length','sort','pick','filters','filter','merge','where','type','VIRTUAL','options','Interval','count'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0x70e0,0x17b));var _0x070e=function(_0x37b8a9,_0x247148){_0x37b8a9=_0x37b8a9-0x0;var _0x16ea44=_0x70e0[_0x37b8a9];return _0x16ea44;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];var extensions=require(_0x070e('0x16'));function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x17')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x18')](_0x4a33d2)[_0x070e('0x19')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=_0x373d86['count'],_0x180897=_0x5d3a38[_0x070e('0x1a')],_0x19d9da=_0x5d3a38[_0x070e('0x1a')]+_0x5d3a38[_0x070e('0x1b')],_0x5bc71e;if(_0x19d9da>=_0xeae1a5){_0x19d9da=_0xeae1a5;_0x5bc71e=0xc8;}else{_0x5bc71e=0xce;}_0x51d14d[_0x070e('0x18')](_0x5bc71e);return _0x51d14d[_0x070e('0x1c')]('Content-Range',_0x180897+'-'+_0x19d9da+'/'+_0xeae1a5)[_0x070e('0x19')](_0x373d86);}return null;};}function patchUpdates(_0x168dc6){return function(_0x1ad3de){try{jsonpatch[_0x070e('0x1d')](_0x1ad3de,_0x168dc6,!![]);}catch(_0x259893){return BPromise['reject'](_0x259893);}return _0x1ad3de['save']();};}function saveUpdates(_0x4e958f,_0x9907cf){return function(_0x3004f0){if(_0x3004f0){return _0x3004f0[_0x070e('0x1e')](_0x4e958f)['then'](function(_0x5b184){return _0x5b184;});}return null;};}function removeEntity(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x1f')]()[_0x070e('0x20')](function(){var _0x28a1c3=_0x3f6985[_0x070e('0x21')]({'plain':!![]});var _0xe405e=_0x070e('0x22');return db['UserProfileResource'][_0x070e('0x1f')]({'where':{'type':_0xe405e,'resourceId':_0x28a1c3['id']}})[_0x070e('0x20')](function(){return _0x3f6985;});})[_0x070e('0x20')](function(){_0x5dc5d2['status'](0xcc)[_0x070e('0x17')]();});}};}function handleEntityNotFound(_0x5f3e9d,_0x4a2dbd){return function(_0x2ccbd7){if(!_0x2ccbd7){_0x5f3e9d[_0x070e('0x23')](0x194);}return _0x2ccbd7;};}function handleError(_0x41deb1,_0x1743cc){_0x1743cc=_0x1743cc||0x1f4;return function(_0x4763c6){logger['error'](_0x4763c6[_0x070e('0x24')]);if(_0x4763c6[_0x070e('0x25')]){delete _0x4763c6[_0x070e('0x25')];}_0x41deb1[_0x070e('0x18')](_0x1743cc)[_0x070e('0x26')](_0x4763c6);};}exports[_0x070e('0x27')]=function(_0x1a1892,_0x26373b){var _0x5e8326={},_0x282344={},_0x351641={'count':0x0,'rows':[]};var _0x3a16d0=_['map'](db['Interval'][_0x070e('0x28')],function(_0x46065c){return{'name':_0x46065c[_0x070e('0x29')],'type':_0x46065c['type'][_0x070e('0x2a')]};});_0x282344[_0x070e('0x2b')]=_[_0x070e('0x2c')](_0x3a16d0,_0x070e('0x25'));_0x282344['query']=_['keys'](_0x1a1892['query']);_0x282344['filters']=_[_0x070e('0x2d')](_0x282344['model'],_0x282344[_0x070e('0x2e')]);_0x5e8326[_0x070e('0x2f')]=_['intersection'](_0x282344['model'],qs[_0x070e('0x30')](_0x1a1892[_0x070e('0x2e')]['fields']));_0x5e8326['attributes']=_0x5e8326[_0x070e('0x2f')][_0x070e('0x31')]?_0x5e8326[_0x070e('0x2f')]:_0x282344[_0x070e('0x2b')];if(!_0x1a1892[_0x070e('0x2e')]['hasOwnProperty']('nolimit')){_0x5e8326[_0x070e('0x1b')]=qs[_0x070e('0x1b')](_0x1a1892[_0x070e('0x2e')][_0x070e('0x1b')]);_0x5e8326[_0x070e('0x1a')]=qs['offset'](_0x1a1892[_0x070e('0x2e')][_0x070e('0x1a')]);}_0x5e8326['order']=qs[_0x070e('0x32')](_0x1a1892[_0x070e('0x2e')]['sort']);_0x5e8326['where']=qs['filters'](_[_0x070e('0x33')](_0x1a1892[_0x070e('0x2e')],_0x282344[_0x070e('0x34')]));if(_0x1a1892[_0x070e('0x2e')][_0x070e('0x35')]){_0x5e8326['where']=_[_0x070e('0x36')](_0x5e8326[_0x070e('0x37')],{'$or':_[_0x070e('0x2c')](_0x3a16d0,function(_0x487276){if(_0x487276[_0x070e('0x38')]!==_0x070e('0x39')){var _0x165c16={};_0x165c16[_0x487276['name']]={'$like':'%'+_0x1a1892[_0x070e('0x2e')][_0x070e('0x35')]+'%'};return _0x165c16;}})});}_0x5e8326=_['merge']({},_0x5e8326,_0x1a1892[_0x070e('0x3a')]);var _0x5d689b={'where':_0x5e8326[_0x070e('0x37')]};return db[_0x070e('0x3b')][_0x070e('0x3c')](_0x5d689b)[_0x070e('0x20')](function(_0xd03404){_0x351641['count']=_0xd03404;if(_0x1a1892[_0x070e('0x2e')]['includeAll']){_0x5e8326['include']=[{'all':!![]}];}return db[_0x070e('0x3b')][_0x070e('0x3d')](_0x5e8326);})[_0x070e('0x20')](function(_0x4d52ff){_0x351641[_0x070e('0x3e')]=_0x4d52ff;return _0x351641;})[_0x070e('0x20')](respondWithFilteredResult(_0x26373b,_0x5e8326))[_0x070e('0x3f')](handleError(_0x26373b,null));};exports[_0x070e('0x40')]=function(_0x4a4ee3,_0x13e4e0){var _0x5851ab={'raw':!![],'where':{'id':_0x4a4ee3['params']['id']}},_0x544b53={};_0x544b53[_0x070e('0x2b')]=_[_0x070e('0x41')](db[_0x070e('0x3b')][_0x070e('0x28')]);_0x544b53[_0x070e('0x2e')]=_['keys'](_0x4a4ee3[_0x070e('0x2e')]);_0x544b53['filters']=_[_0x070e('0x2d')](_0x544b53[_0x070e('0x2b')],_0x544b53[_0x070e('0x2e')]);_0x5851ab['attributes']=_['intersection'](_0x544b53[_0x070e('0x2b')],qs['fields'](_0x4a4ee3[_0x070e('0x2e')][_0x070e('0x30')]));_0x5851ab[_0x070e('0x2f')]=_0x5851ab['attributes'][_0x070e('0x31')]?_0x5851ab[_0x070e('0x2f')]:_0x544b53['model'];if(_0x4a4ee3['query'][_0x070e('0x42')]){_0x5851ab[_0x070e('0x43')]=[{'all':!![]}];}_0x5851ab=_[_0x070e('0x36')]({},_0x5851ab,_0x4a4ee3[_0x070e('0x3a')]);return db[_0x070e('0x3b')]['find'](_0x5851ab)[_0x070e('0x20')](handleEntityNotFound(_0x13e4e0,null))[_0x070e('0x20')](respondWithResult(_0x13e4e0,null))[_0x070e('0x3f')](handleError(_0x13e4e0,null));};exports[_0x070e('0x44')]=function(_0x79eaa0,_0xcd1c61){return db[_0x070e('0x3b')][_0x070e('0x44')](_0x79eaa0[_0x070e('0x45')],{})[_0x070e('0x20')](function(_0x210c4d){var _0x3be553=_0x79eaa0[_0x070e('0x46')][_0x070e('0x21')]({'plain':!![]});if(!_0x3be553)throw new Error(_0x070e('0x47'));if(_0x3be553['role']===_0x070e('0x46')){var _0xa7a41b=_0x210c4d[_0x070e('0x21')]({'plain':!![]});var _0x249e3f=_0x070e('0x22');return db[_0x070e('0x48')][_0x070e('0x49')]({'where':{'name':_0x249e3f,'userProfileId':_0x3be553[_0x070e('0x4a')]},'raw':!![]})[_0x070e('0x20')](function(_0x5744c5){if(_0x5744c5&&_0x5744c5[_0x070e('0x4b')]===0x0){return db['UserProfileResource'][_0x070e('0x44')]({'name':_0xa7a41b[_0x070e('0x25')],'resourceId':_0xa7a41b['id'],'type':_0x5744c5['name'],'sectionId':_0x5744c5['id']},{})[_0x070e('0x20')](function(){return _0x210c4d;});}else{return _0x210c4d;}})[_0x070e('0x3f')](function(_0x25466f){logger[_0x070e('0x4c')](_0x070e('0x4d'),_0x25466f);throw _0x25466f;});}return _0x210c4d;})[_0x070e('0x20')](respondWithResult(_0xcd1c61,0xc9))[_0x070e('0x3f')](handleError(_0xcd1c61,null));};exports['update']=function(_0x296978,_0x5bacbd){if(_0x296978['body']['id']){delete _0x296978[_0x070e('0x45')]['id'];}return db[_0x070e('0x3b')][_0x070e('0x49')]({'where':{'id':_0x296978[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x5bacbd,null))[_0x070e('0x20')](saveUpdates(_0x296978[_0x070e('0x45')],null))[_0x070e('0x20')](respondWithResult(_0x5bacbd,null))['catch'](handleError(_0x5bacbd,null));};exports[_0x070e('0x1f')]=function(_0x51d27d,_0x564d82){return db[_0x070e('0x3b')][_0x070e('0x49')]({'where':{'id':_0x51d27d['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x564d82,null))[_0x070e('0x20')](removeEntity(_0x564d82,null))[_0x070e('0x3f')](handleError(_0x564d82,null));};exports[_0x070e('0x4f')]=function(_0x1aacfc,_0x382ce3,_0x1b36cd){if(_0x1aacfc['body']['id']){delete _0x1aacfc['body']['id'];}return db['Interval'][_0x070e('0x49')]({'where':{'id':_0x1aacfc[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x382ce3,null))[_0x070e('0x20')](function(_0x5ac0b5){if(_0x5ac0b5){_0x1aacfc[_0x070e('0x45')]['IntervalId']=_0x5ac0b5['id'];return db[_0x070e('0x3b')][_0x070e('0x44')](_0x1aacfc[_0x070e('0x45')]);}})[_0x070e('0x20')](respondWithResult(_0x382ce3,null))[_0x070e('0x3f')](handleError(_0x382ce3,null));};exports[_0x070e('0x50')]=function(_0x5561ed,_0x20ff87,_0x18e8d0){var _0x8aaf00={};var _0x533431={};var _0x1d7873;var _0x1da803;return db['Interval'][_0x070e('0x51')]({'where':{'id':_0x5561ed['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x20ff87,null))['then'](function(_0x4cb86f){if(_0x4cb86f){_0x1d7873=_0x4cb86f;_0x533431['model']=_[_0x070e('0x41')](db[_0x070e('0x3b')][_0x070e('0x28')]);_0x533431[_0x070e('0x2e')]=_[_0x070e('0x41')](_0x5561ed[_0x070e('0x2e')]);_0x533431['filters']=_[_0x070e('0x2d')](_0x533431['model'],_0x533431[_0x070e('0x2e')]);_0x8aaf00['attributes']=_[_0x070e('0x2d')](_0x533431[_0x070e('0x2b')],qs['fields'](_0x5561ed[_0x070e('0x2e')]['fields']));_0x8aaf00[_0x070e('0x2f')]=_0x8aaf00[_0x070e('0x2f')][_0x070e('0x31')]?_0x8aaf00[_0x070e('0x2f')]:_0x533431[_0x070e('0x2b')];_0x8aaf00[_0x070e('0x52')]=qs[_0x070e('0x32')](_0x5561ed[_0x070e('0x2e')][_0x070e('0x32')]);_0x8aaf00[_0x070e('0x37')]=qs[_0x070e('0x34')](_[_0x070e('0x33')](_0x5561ed[_0x070e('0x2e')],_0x533431[_0x070e('0x34')]));if(_0x5561ed['query'][_0x070e('0x35')]){_0x8aaf00[_0x070e('0x37')]=_[_0x070e('0x36')](_0x8aaf00[_0x070e('0x37')],{'$or':_['map'](_0x8aaf00[_0x070e('0x2f')],function(_0x4e8e58){var _0x398f54={};_0x398f54[_0x4e8e58]={'$like':'%'+_0x5561ed[_0x070e('0x2e')][_0x070e('0x35')]+'%'};return _0x398f54;})});}_0x8aaf00=_[_0x070e('0x36')]({},_0x8aaf00,_0x5561ed['options']);return _0x1d7873[_0x070e('0x50')](_0x8aaf00);}})[_0x070e('0x20')](function(_0x240ec9){if(_0x240ec9){_0x1da803=_0x240ec9[_0x070e('0x31')];if(!_0x5561ed['query'][_0x070e('0x53')]('nolimit')){_0x8aaf00[_0x070e('0x1b')]=qs[_0x070e('0x1b')](_0x5561ed[_0x070e('0x2e')][_0x070e('0x1b')]);_0x8aaf00[_0x070e('0x1a')]=qs['offset'](_0x5561ed[_0x070e('0x2e')][_0x070e('0x1a')]);}return _0x1d7873[_0x070e('0x50')](_0x8aaf00);}})[_0x070e('0x20')](function(_0x5591dd){if(_0x5591dd){return _0x5591dd?{'count':_0x1da803,'rows':_0x5591dd}:null;}})[_0x070e('0x20')](respondWithResult(_0x20ff87,null))['catch'](handleError(_0x20ff87,null));};exports[_0x070e('0x54')]=function(_0x44e465,_0x1214d2,_0x57585e){return db[_0x070e('0x3b')]['findOne']({'where':{'id':_0x44e465[_0x070e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1214d2,null))[_0x070e('0x20')](function(_0x17b28c){if(_0x17b28c){return db['sequelize'][_0x070e('0x55')](function(_0x53f9a8){return db[_0x070e('0x3b')][_0x070e('0x1f')]({'where':{'IntervalId':_0x44e465['params']['id']},'transaction':_0x53f9a8})['then'](function(_0x29ee66){var _0x3022cd=_[_0x070e('0x2c')](_0x44e465[_0x070e('0x45')],function(_0x25f1d0){delete _0x25f1d0['id'];_0x25f1d0[_0x070e('0x56')]=_0x44e465[_0x070e('0x4e')]['id'];return _0x25f1d0;});return db[_0x070e('0x3b')][_0x070e('0x57')](_0x3022cd,{'transaction':_0x53f9a8});});})[_0x070e('0x20')](function(){return db[_0x070e('0x3b')][_0x070e('0x3d')]({'where':{'IntervalId':_0x44e465[_0x070e('0x4e')]['id']}});});}})['then'](respondWithResult(_0x1214d2,null))[_0x070e('0x3f')](handleError(_0x1214d2,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 6e57a50..09ef8d3 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 _0xe80c=['rimraf','../../config/environment','./interval.attributes','exports','Interval','rewrite','util','../../config/logger','api','moment','bluebird','path'];(function(_0x52df1e,_0x5228d5){var _0x12bb1c=function(_0x60199d){while(--_0x60199d){_0x52df1e['push'](_0x52df1e['shift']());}};_0x12bb1c(++_0x5228d5);}(_0xe80c,0x1c2));var _0xce80=function(_0x44abe0,_0x27b28f){_0x44abe0=_0x44abe0-0x0;var _0x2a6af9=_0xe80c[_0x44abe0];return _0x2a6af9;};'use strict';var _=require('lodash');var util=require(_0xce80('0x0'));var logger=require(_0xce80('0x1'))(_0xce80('0x2'));var moment=require(_0xce80('0x3'));var BPromise=require(_0xce80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce80('0x5'));var rimraf=require(_0xce80('0x6'));var config=require(_0xce80('0x7'));var attributes=require(_0xce80('0x8'));var extensions=require('../../components/extensions/rewrite');module[_0xce80('0x9')]=function(_0x150f6a,_0xd8b88e){return _0x150f6a['define'](_0xce80('0xa'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x40ee29,_0x58543e){extensions[_0xce80('0xb')](_0x150f6a,_0x40ee29);},'afterBulkCreate':function(_0x3331d6,_0x51f349,_0x58894d){_0x58894d();extensions[_0xce80('0xb')](_0x150f6a,_0x3331d6[0x0]);},'afterUpdate':function(_0x159969,_0x490265){extensions[_0xce80('0xb')](_0x150f6a,_0x159969);},'afterDestroy':function(_0x1737ac,_0x2441d5){extensions[_0xce80('0xb')](_0x150f6a,_0x1737ac);}}});}; \ No newline at end of file +var _0xbbfa=['bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','rewrite','lodash','../../config/logger','moment'];(function(_0x2544b8,_0x32b04b){var _0x14d7bf=function(_0x279cba){while(--_0x279cba){_0x2544b8['push'](_0x2544b8['shift']());}};_0x14d7bf(++_0x32b04b);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x566667,_0x3f99c2){_0x566667=_0x566667-0x0;var _0x277136=_0xbbfa[_0x566667];return _0x277136;};'use strict';var _=require(_0xabbf('0x0'));var util=require('util');var logger=require(_0xabbf('0x1'))('api');var moment=require(_0xabbf('0x2'));var BPromise=require(_0xabbf('0x3'));var rp=require(_0xabbf('0x4'));var fs=require('fs');var path=require(_0xabbf('0x5'));var rimraf=require(_0xabbf('0x6'));var config=require(_0xabbf('0x7'));var attributes=require(_0xabbf('0x8'));var extensions=require(_0xabbf('0x9'));module[_0xabbf('0xa')]=function(_0x7d0c02,_0x45b7d6){return _0x7d0c02['define']('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1380cd,_0x260181){extensions['rewrite'](_0x7d0c02,_0x1380cd);},'afterBulkCreate':function(_0x5f35ee,_0x2f1d5d,_0x5a6955){_0x5a6955();extensions[_0xabbf('0xb')](_0x7d0c02,_0x5f35ee[0x0]);},'afterUpdate':function(_0x4f5cf1,_0x31e77b){extensions['rewrite'](_0x7d0c02,_0x4f5cf1);},'afterDestroy':function(_0x5df6a8,_0xb8c3d9){extensions[_0xabbf('0xb')](_0x7d0c02,_0x5df6a8);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 66240cf..6f93ee0 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 _0xbbc0=['Interval,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetInterval','raw','options','where','attributes','limit','include','model','map','catch','Interval','ShowInterval','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','Interval,\x20%s,\x20%s','debug'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0xbbc0,0x133));var _0x0bbc=function(_0x503699,_0x152145){_0x503699=_0x503699-0x0;var _0xd66c82=_0xbbc0[_0x503699];return _0xd66c82;};'use strict';var _=require(_0x0bbc('0x0'));var util=require('util');var moment=require(_0x0bbc('0x1'));var BPromise=require(_0x0bbc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bbc('0x3'));var db=require(_0x0bbc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bbc('0x5'))(_0x0bbc('0x6'));var config=require('../../config/environment');var jayson=require(_0x0bbc('0x7'));var client=jayson[_0x0bbc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a91f6,_0x2b5758,_0x395334){return new BPromise(function(_0xb61a28,_0x42d7bc){return client['request'](_0x1a91f6,_0x395334)[_0x0bbc('0x9')](function(_0x342090){logger[_0x0bbc('0xa')](_0x0bbc('0xb'),_0x2b5758,'request\x20sent');logger[_0x0bbc('0xc')](_0x0bbc('0xd'),_0x2b5758,_0x0bbc('0xe'),JSON[_0x0bbc('0xf')](_0x342090));if(_0x342090[_0x0bbc('0x10')]){if(_0x342090['error'][_0x0bbc('0x11')]===0x1f4){logger[_0x0bbc('0x10')]('Interval,\x20%s,\x20%s',_0x2b5758,_0x342090[_0x0bbc('0x10')][_0x0bbc('0x12')]);return _0x42d7bc(_0x342090[_0x0bbc('0x10')]['message']);}logger[_0x0bbc('0x10')]('Interval,\x20%s,\x20%s',_0x2b5758,_0x342090['error'][_0x0bbc('0x12')]);return _0xb61a28(_0x342090['error'][_0x0bbc('0x12')]);}else{logger[_0x0bbc('0xa')]('Interval,\x20%s,\x20%s',_0x2b5758,'request\x20sent');_0xb61a28(_0x342090[_0x0bbc('0x13')][_0x0bbc('0x12')]);}})['catch'](function(_0x4de0d1){logger[_0x0bbc('0x10')](_0x0bbc('0xb'),_0x2b5758,_0x4de0d1);_0x42d7bc(_0x4de0d1);});});}exports[_0x0bbc('0x14')]=function(_0x32bcfd){var _0x546432=this;return new Promise(function(_0x1272b7,_0x4ebabf){return db['Interval']['findAll']({'raw':_0x32bcfd['options']?_0x32bcfd['options'][_0x0bbc('0x15')]===undefined?!![]:![]:!![],'where':_0x32bcfd['options']?_0x32bcfd[_0x0bbc('0x16')][_0x0bbc('0x17')]||null:null,'attributes':_0x32bcfd[_0x0bbc('0x16')]?_0x32bcfd['options'][_0x0bbc('0x18')]||null:null,'limit':_0x32bcfd[_0x0bbc('0x16')]?_0x32bcfd[_0x0bbc('0x16')][_0x0bbc('0x19')]||null:null,'include':_0x32bcfd[_0x0bbc('0x16')]?_0x32bcfd[_0x0bbc('0x16')][_0x0bbc('0x1a')]?_['map'](_0x32bcfd[_0x0bbc('0x16')]['include'],function(_0x404a5c){return{'model':db[_0x404a5c[_0x0bbc('0x1b')]],'as':_0x404a5c['as'],'attributes':_0x404a5c[_0x0bbc('0x18')],'include':_0x404a5c[_0x0bbc('0x1a')]?_[_0x0bbc('0x1c')](_0x404a5c[_0x0bbc('0x1a')],function(_0x17ea60){return{'model':db[_0x17ea60['model']],'as':_0x17ea60['as'],'attributes':_0x17ea60[_0x0bbc('0x18')],'include':_0x17ea60[_0x0bbc('0x1a')]?_[_0x0bbc('0x1c')](_0x17ea60[_0x0bbc('0x1a')],function(_0x3892c6){return{'model':db[_0x3892c6['model']],'as':_0x3892c6['as'],'attributes':_0x3892c6[_0x0bbc('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0bbc('0x9')](function(_0x700883){logger['info']('GetInterval',_0x32bcfd);logger[_0x0bbc('0xc')](_0x0bbc('0x14'),_0x32bcfd,JSON[_0x0bbc('0xf')](_0x700883));_0x1272b7(_0x700883);})[_0x0bbc('0x1d')](function(_0x503123){logger[_0x0bbc('0x10')](_0x0bbc('0x14'),_0x503123[_0x0bbc('0x12')],_0x32bcfd);_0x4ebabf(_0x546432[_0x0bbc('0x10')](0x1f4,_0x503123[_0x0bbc('0x12')]));});});};exports['ShowInterval']=function(_0x6fe912){var _0x2e5697=this;return new Promise(function(_0x1a285f,_0x4d89bf){return db[_0x0bbc('0x1e')]['find']({'raw':_0x6fe912['options']?_0x6fe912[_0x0bbc('0x16')][_0x0bbc('0x15')]===undefined?!![]:![]:!![],'where':_0x6fe912[_0x0bbc('0x16')]?_0x6fe912[_0x0bbc('0x16')][_0x0bbc('0x17')]||null:null,'attributes':_0x6fe912[_0x0bbc('0x16')]?_0x6fe912[_0x0bbc('0x16')]['attributes']||null:null,'include':_0x6fe912[_0x0bbc('0x16')]?_0x6fe912['options'][_0x0bbc('0x1a')]?_['map'](_0x6fe912[_0x0bbc('0x16')]['include'],function(_0x383f88){return{'model':db[_0x383f88['model']],'as':_0x383f88['as'],'attributes':_0x383f88[_0x0bbc('0x18')],'include':_0x383f88['include']?_[_0x0bbc('0x1c')](_0x383f88[_0x0bbc('0x1a')],function(_0x522b99){return{'model':db[_0x522b99[_0x0bbc('0x1b')]],'as':_0x522b99['as'],'attributes':_0x522b99['attributes'],'include':_0x522b99[_0x0bbc('0x1a')]?_['map'](_0x522b99['include'],function(_0x3d1288){return{'model':db[_0x3d1288[_0x0bbc('0x1b')]],'as':_0x3d1288['as'],'attributes':_0x3d1288[_0x0bbc('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x369ad8){logger[_0x0bbc('0xa')]('ShowInterval',_0x6fe912);logger['debug'](_0x0bbc('0x1f'),_0x6fe912,JSON[_0x0bbc('0xf')](_0x369ad8));_0x1a285f(_0x369ad8);})['catch'](function(_0x265bcd){logger[_0x0bbc('0x10')]('ShowInterval',_0x265bcd[_0x0bbc('0x12')],_0x6fe912);_0x4d89bf(_0x2e5697[_0x0bbc('0x10')](0x1f4,_0x265bcd[_0x0bbc('0x12')]));});});}; \ No newline at end of file +var _0x1dcc=['ShowInterval','where','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','Interval','findAll','options','raw','attributes','limit','include','map','model','GetInterval'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x1dcc,0x72));var _0xc1dc=function(_0x5180d6,_0x47cda5){_0x5180d6=_0x5180d6-0x0;var _0x131508=_0x1dcc[_0x5180d6];return _0x131508;};'use strict';var _=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var moment=require(_0xc1dc('0x2'));var BPromise=require(_0xc1dc('0x3'));var rs=require(_0xc1dc('0x4'));var fs=require('fs');var Redis=require(_0xc1dc('0x5'));var db=require(_0xc1dc('0x6'))['db'];var utils=require(_0xc1dc('0x7'));var logger=require(_0xc1dc('0x8'))(_0xc1dc('0x9'));var config=require('../../config/environment');var jayson=require(_0xc1dc('0xa'));var client=jayson[_0xc1dc('0xb')][_0xc1dc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe4980,_0x1a2692,_0x1e4bbb){return new BPromise(function(_0x864fd9,_0x1b3c23){return client[_0xc1dc('0xd')](_0xe4980,_0x1e4bbb)[_0xc1dc('0xe')](function(_0x57542e){logger[_0xc1dc('0xf')](_0xc1dc('0x10'),_0x1a2692,'request\x20sent');logger[_0xc1dc('0x11')]('Interval,\x20%s,\x20%s,\x20%s',_0x1a2692,_0xc1dc('0x12'),JSON[_0xc1dc('0x13')](_0x57542e));if(_0x57542e[_0xc1dc('0x14')]){if(_0x57542e['error'][_0xc1dc('0x15')]===0x1f4){logger['error']('Interval,\x20%s,\x20%s',_0x1a2692,_0x57542e['error'][_0xc1dc('0x16')]);return _0x1b3c23(_0x57542e[_0xc1dc('0x14')][_0xc1dc('0x16')]);}logger[_0xc1dc('0x14')](_0xc1dc('0x10'),_0x1a2692,_0x57542e[_0xc1dc('0x14')][_0xc1dc('0x16')]);return _0x864fd9(_0x57542e[_0xc1dc('0x14')][_0xc1dc('0x16')]);}else{logger[_0xc1dc('0xf')](_0xc1dc('0x10'),_0x1a2692,'request\x20sent');_0x864fd9(_0x57542e[_0xc1dc('0x17')][_0xc1dc('0x16')]);}})['catch'](function(_0x36674a){logger[_0xc1dc('0x14')](_0xc1dc('0x10'),_0x1a2692,_0x36674a);_0x1b3c23(_0x36674a);});});}exports['GetInterval']=function(_0x3d0655){var _0x2a3f6e=this;return new Promise(function(_0x30f805,_0xd5925b){return db[_0xc1dc('0x18')][_0xc1dc('0x19')]({'raw':_0x3d0655[_0xc1dc('0x1a')]?_0x3d0655[_0xc1dc('0x1a')][_0xc1dc('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d0655[_0xc1dc('0x1a')]?_0x3d0655['options']['where']||null:null,'attributes':_0x3d0655[_0xc1dc('0x1a')]?_0x3d0655[_0xc1dc('0x1a')][_0xc1dc('0x1c')]||null:null,'limit':_0x3d0655[_0xc1dc('0x1a')]?_0x3d0655[_0xc1dc('0x1a')][_0xc1dc('0x1d')]||null:null,'include':_0x3d0655[_0xc1dc('0x1a')]?_0x3d0655['options'][_0xc1dc('0x1e')]?_[_0xc1dc('0x1f')](_0x3d0655['options']['include'],function(_0x229bce){return{'model':db[_0x229bce[_0xc1dc('0x20')]],'as':_0x229bce['as'],'attributes':_0x229bce[_0xc1dc('0x1c')],'include':_0x229bce[_0xc1dc('0x1e')]?_[_0xc1dc('0x1f')](_0x229bce[_0xc1dc('0x1e')],function(_0x101405){return{'model':db[_0x101405[_0xc1dc('0x20')]],'as':_0x101405['as'],'attributes':_0x101405[_0xc1dc('0x1c')],'include':_0x101405['include']?_[_0xc1dc('0x1f')](_0x101405[_0xc1dc('0x1e')],function(_0x5e213e){return{'model':db[_0x5e213e[_0xc1dc('0x20')]],'as':_0x5e213e['as'],'attributes':_0x5e213e[_0xc1dc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc1dc('0xe')](function(_0x182afd){logger[_0xc1dc('0xf')](_0xc1dc('0x21'),_0x3d0655);logger[_0xc1dc('0x11')](_0xc1dc('0x21'),_0x3d0655,JSON[_0xc1dc('0x13')](_0x182afd));_0x30f805(_0x182afd);})['catch'](function(_0x2759ab){logger['error'](_0xc1dc('0x21'),_0x2759ab[_0xc1dc('0x16')],_0x3d0655);_0xd5925b(_0x2a3f6e[_0xc1dc('0x14')](0x1f4,_0x2759ab[_0xc1dc('0x16')]));});});};exports[_0xc1dc('0x22')]=function(_0x5edc0c){var _0x515c8a=this;return new Promise(function(_0x583936,_0x1b1819){return db[_0xc1dc('0x18')]['find']({'raw':_0x5edc0c[_0xc1dc('0x1a')]?_0x5edc0c[_0xc1dc('0x1a')][_0xc1dc('0x1b')]===undefined?!![]:![]:!![],'where':_0x5edc0c[_0xc1dc('0x1a')]?_0x5edc0c['options'][_0xc1dc('0x23')]||null:null,'attributes':_0x5edc0c[_0xc1dc('0x1a')]?_0x5edc0c['options'][_0xc1dc('0x1c')]||null:null,'include':_0x5edc0c[_0xc1dc('0x1a')]?_0x5edc0c[_0xc1dc('0x1a')][_0xc1dc('0x1e')]?_[_0xc1dc('0x1f')](_0x5edc0c[_0xc1dc('0x1a')][_0xc1dc('0x1e')],function(_0x36d81b){return{'model':db[_0x36d81b[_0xc1dc('0x20')]],'as':_0x36d81b['as'],'attributes':_0x36d81b[_0xc1dc('0x1c')],'include':_0x36d81b['include']?_[_0xc1dc('0x1f')](_0x36d81b['include'],function(_0x403aea){return{'model':db[_0x403aea['model']],'as':_0x403aea['as'],'attributes':_0x403aea[_0xc1dc('0x1c')],'include':_0x403aea[_0xc1dc('0x1e')]?_['map'](_0x403aea['include'],function(_0x498b98){return{'model':db[_0x498b98[_0xc1dc('0x20')]],'as':_0x498b98['as'],'attributes':_0x498b98[_0xc1dc('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x333017){logger[_0xc1dc('0xf')](_0xc1dc('0x22'),_0x5edc0c);logger[_0xc1dc('0x11')](_0xc1dc('0x22'),_0x5edc0c,JSON['stringify'](_0x333017));_0x583936(_0x333017);})[_0xc1dc('0x24')](function(_0x2c366b){logger[_0xc1dc('0x14')](_0xc1dc('0x22'),_0x2c366b['message'],_0x5edc0c);_0x1b1819(_0x515c8a['error'](0x1f4,_0x2c366b['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index ea2e6a0..7096d3b 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 _0xc88b=['Router','./jira.controller','post'];(function(_0x32e758,_0x13c271){var _0x349316=function(_0x27a9da){while(--_0x27a9da){_0x32e758['push'](_0x32e758['shift']());}};_0x349316(++_0x13c271);}(_0xc88b,0x7e));var _0xbc88=function(_0xb90eaa,_0x4adb8d){_0xb90eaa=_0xb90eaa-0x0;var _0x40b327=_0xc88b[_0xb90eaa];return _0x40b327;};'use strict';var express=require('express');var router=express[_0xbc88('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xbc88('0x1'));router[_0xbc88('0x2')]('/',auth['isAuthenticated'](),controller['send']);module['exports']=router; \ No newline at end of file +var _0xbb9d=['../../components/auth/service','./jira.controller','isAuthenticated','send','exports','express','Router'];(function(_0x23d35d,_0x39c88e){var _0x15e742=function(_0x207d62){while(--_0x207d62){_0x23d35d['push'](_0x23d35d['shift']());}};_0x15e742(++_0x39c88e);}(_0xbb9d,0x1d3));var _0xdbb9=function(_0x17ed46,_0x5042dd){_0x17ed46=_0x17ed46-0x0;var _0x59fd55=_0xbb9d[_0x17ed46];return _0x59fd55;};'use strict';var express=require(_0xdbb9('0x0'));var router=express[_0xdbb9('0x1')]();var auth=require(_0xdbb9('0x2'));var controller=require(_0xdbb9('0x3'));router['post']('/',auth[_0xdbb9('0x4')](),controller[_0xdbb9('0x5')]);module[_0xdbb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index f7192e6..484dfcf 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 _0xe0f5=['toString','base64','request','setEncoding','utf8','end','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','https','api','support','MOTGUI','\x20from\x20','description','stringify','issuetype','Bug','fields','email','newToken','customfield_11503','customfield_11504','reason','track.xcallymotion.com','POST','application/json','Basic\x20'];(function(_0x408d59,_0x43860b){var _0x555ca8=function(_0x18fe8e){while(--_0x18fe8e){_0x408d59['push'](_0x408d59['shift']());}};_0x555ca8(++_0x43860b);}(_0xe0f5,0x135));var _0x5e0f=function(_0x4c7998,_0x489acc){_0x4c7998=_0x4c7998-0x0;var _0x15f6bc=_0xe0f5[_0x4c7998];return _0x15f6bc;};'use strict';var BPromise=require('bluebird');var https=require(_0x5e0f('0x0'));var logger=require('../../config/logger')(_0x5e0f('0x1'));var USERNAME=_0x5e0f('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x5eeb07,_0x43fe33){var _0x3c23cc={'fields':{'project':{'key':_0x5eeb07['key']||_0x5e0f('0x3')},'summary':(_0x5eeb07['summary']||'Report')+_0x5e0f('0x4')+_0x5eeb07['ip'],'description':_0x5eeb07[_0x5e0f('0x5')]||JSON[_0x5e0f('0x6')](_0x5eeb07),'issuetype':{'name':_0x5eeb07[_0x5e0f('0x7')]||_0x5e0f('0x8')}}};_0x3c23cc[_0x5e0f('0x9')]['customfield_11500']=_0x5eeb07[_0x5e0f('0xa')];_0x3c23cc[_0x5e0f('0x9')]['customfield_11501']=_0x5eeb07['oldToken'];_0x3c23cc[_0x5e0f('0x9')]['customfield_11502']=_0x5eeb07[_0x5e0f('0xb')];_0x3c23cc[_0x5e0f('0x9')][_0x5e0f('0xc')]=_0x5eeb07['name'];_0x3c23cc[_0x5e0f('0x9')][_0x5e0f('0xd')]=_0x5eeb07[_0x5e0f('0xe')];_0x3c23cc[_0x5e0f('0x9')]['customfield_10102']=_0x5eeb07['ip'];var _0x1d3c03={'host':_0x5e0f('0xf'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x5e0f('0x10'),'timeout':0x4e20,'headers':{'Content-Type':_0x5e0f('0x11'),'Authorization':_0x5e0f('0x12')+new Buffer(USERNAME+':'+PASSWORD)[_0x5e0f('0x13')](_0x5e0f('0x14'))}};var _0x1a2705=JSON['stringify'](_0x3c23cc);var _0x5f9f76=https[_0x5e0f('0x15')](_0x1d3c03,function(_0x3956f3){_0x3956f3[_0x5e0f('0x16')](_0x5e0f('0x17'));var _0x1312c2='';_0x3956f3['on']('data',function(_0x25aa32){_0x1312c2+=_0x25aa32;});_0x3956f3['on'](_0x5e0f('0x18'),function(){if(_0x43fe33){return _0x43fe33[_0x5e0f('0x19')](_0x3956f3[_0x5e0f('0x1a')])['json'](JSON[_0x5e0f('0x1b')](_0x1312c2));}});});_0x5f9f76['on'](_0x5e0f('0x1c'),function(_0x3394b0){if(_0x43fe33){return _0x43fe33[_0x5e0f('0x19')](0x1f4)[_0x5e0f('0x1d')]({'errors':[{'message':_0x5e0f('0x1e'),'type':_0x5e0f('0x1f')}]});}});_0x5f9f76[_0x5e0f('0x20')](_0x1a2705);_0x5f9f76[_0x5e0f('0x18')]();}exports[_0x5e0f('0x21')]=openIssue;exports[_0x5e0f('0x22')]=function(_0x59fda6,_0x39bc21){_0x59fda6['body']['ip']=_0x59fda6[_0x5e0f('0x23')][_0x5e0f('0x24')]||_0x59fda6[_0x5e0f('0x25')][_0x5e0f('0x26')]||_0x59fda6['socket'][_0x5e0f('0x26')]||_0x59fda6[_0x5e0f('0x25')][_0x5e0f('0x27')][_0x5e0f('0x26')];return openIssue(_0x59fda6[_0x5e0f('0x28')],_0x39bc21);}; \ No newline at end of file +var _0x9eeb=['oldToken','customfield_11502','newToken','customfield_11503','reason','track.xcallymotion.com','/rest/api/2/issue','application/json','toString','base64','request','setEncoding','utf8','data','status','statusCode','parse','error','json','api.jira','write','end','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','api','support','3eAmWpBVP0','MOTGUI','summary','\x20from\x20','stringify','Bug','fields','customfield_11500','email','customfield_11501'];(function(_0x26261b,_0x3d2516){var _0xc2c9aa=function(_0x4af72f){while(--_0x4af72f){_0x26261b['push'](_0x26261b['shift']());}};_0xc2c9aa(++_0x3d2516);}(_0x9eeb,0x16c));var _0xb9ee=function(_0x22bd24,_0x46462c){_0x22bd24=_0x22bd24-0x0;var _0x49b264=_0x9eeb[_0x22bd24];return _0x49b264;};'use strict';var BPromise=require(_0xb9ee('0x0'));var https=require(_0xb9ee('0x1'));var logger=require('../../config/logger')(_0xb9ee('0x2'));var USERNAME=_0xb9ee('0x3');var PASSWORD=_0xb9ee('0x4');function openIssue(_0x53fcc2,_0x5a9c91){var _0x7815d1={'fields':{'project':{'key':_0x53fcc2['key']||_0xb9ee('0x5')},'summary':(_0x53fcc2[_0xb9ee('0x6')]||'Report')+_0xb9ee('0x7')+_0x53fcc2['ip'],'description':_0x53fcc2['description']||JSON[_0xb9ee('0x8')](_0x53fcc2),'issuetype':{'name':_0x53fcc2['issuetype']||_0xb9ee('0x9')}}};_0x7815d1[_0xb9ee('0xa')][_0xb9ee('0xb')]=_0x53fcc2[_0xb9ee('0xc')];_0x7815d1[_0xb9ee('0xa')][_0xb9ee('0xd')]=_0x53fcc2[_0xb9ee('0xe')];_0x7815d1[_0xb9ee('0xa')][_0xb9ee('0xf')]=_0x53fcc2[_0xb9ee('0x10')];_0x7815d1[_0xb9ee('0xa')][_0xb9ee('0x11')]=_0x53fcc2['name'];_0x7815d1[_0xb9ee('0xa')]['customfield_11504']=_0x53fcc2[_0xb9ee('0x12')];_0x7815d1[_0xb9ee('0xa')]['customfield_10102']=_0x53fcc2['ip'];var _0x1e2020={'host':_0xb9ee('0x13'),'port':0x1bb,'path':_0xb9ee('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xb9ee('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xb9ee('0x16')](_0xb9ee('0x17'))}};var _0x1db460=JSON['stringify'](_0x7815d1);var _0x3cb152=https[_0xb9ee('0x18')](_0x1e2020,function(_0x3f61de){_0x3f61de[_0xb9ee('0x19')](_0xb9ee('0x1a'));var _0x2a67ab='';_0x3f61de['on'](_0xb9ee('0x1b'),function(_0x2c96d5){_0x2a67ab+=_0x2c96d5;});_0x3f61de['on']('end',function(){if(_0x5a9c91){return _0x5a9c91[_0xb9ee('0x1c')](_0x3f61de[_0xb9ee('0x1d')])['json'](JSON[_0xb9ee('0x1e')](_0x2a67ab));}});});_0x3cb152['on'](_0xb9ee('0x1f'),function(_0xd2d8b8){if(_0x5a9c91){return _0x5a9c91[_0xb9ee('0x1c')](0x1f4)[_0xb9ee('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xb9ee('0x21')}]});}});_0x3cb152[_0xb9ee('0x22')](_0x1db460);_0x3cb152[_0xb9ee('0x23')]();}exports['openIssue']=openIssue;exports['send']=function(_0x4046ff,_0x560baa){_0x4046ff[_0xb9ee('0x24')]['ip']=_0x4046ff[_0xb9ee('0x25')][_0xb9ee('0x26')]||_0x4046ff[_0xb9ee('0x27')][_0xb9ee('0x28')]||_0x4046ff[_0xb9ee('0x29')]['remoteAddress']||_0x4046ff['connection']['socket'][_0xb9ee('0x28')];return openIssue(_0x4046ff[_0xb9ee('0x24')],_0x560baa);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index a58c656..f03996e 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 _0xae41=['/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','get'];(function(_0x30c52d,_0x4aac47){var _0x491fdf=function(_0x200e2e){while(--_0x200e2e){_0x30c52d['push'](_0x30c52d['shift']());}};_0x491fdf(++_0x4aac47);}(_0xae41,0x183));var _0x1ae4=function(_0x41d6f9,_0x1e1613){_0x41d6f9=_0x41d6f9-0x0;var _0x5bfa11=_0xae41[_0x41d6f9];return _0x5bfa11;};'use strict';var multer=require(_0x1ae4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1ae4('0x1'));var express=require('express');var router=express[_0x1ae4('0x2')]();var auth=require(_0x1ae4('0x3'));var interaction=require(_0x1ae4('0x4'));var config=require(_0x1ae4('0x5'));var controller=require(_0x1ae4('0x6'));router['get']('/',auth[_0x1ae4('0x7')](),controller['index']);router[_0x1ae4('0x8')](_0x1ae4('0x9'),auth[_0x1ae4('0x7')](),controller[_0x1ae4('0xa')]);router[_0x1ae4('0x8')](_0x1ae4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1ae4('0xc')]('/',auth[_0x1ae4('0x7')](),controller[_0x1ae4('0xd')]);router[_0x1ae4('0xe')](_0x1ae4('0xb'),auth[_0x1ae4('0x7')](),controller['update']);router[_0x1ae4('0xf')]('/:id',auth[_0x1ae4('0x7')](),controller[_0x1ae4('0x10')]);module[_0x1ae4('0x11')]=router; \ No newline at end of file +var _0x6ade=['create','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x44bc64,_0x32ce0b){var _0xf8a082=function(_0x402615){while(--_0x402615){_0x44bc64['push'](_0x44bc64['shift']());}};_0xf8a082(++_0x32ce0b);}(_0x6ade,0x130));var _0xe6ad=function(_0x36b7f7,_0x290e02){_0x36b7f7=_0x36b7f7-0x0;var _0xb46476=_0x6ade[_0x36b7f7];return _0xb46476;};'use strict';var multer=require(_0xe6ad('0x0'));var util=require(_0xe6ad('0x1'));var path=require('path');var timeout=require(_0xe6ad('0x2'));var express=require(_0xe6ad('0x3'));var router=express[_0xe6ad('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe6ad('0x5'));var config=require(_0xe6ad('0x6'));var controller=require(_0xe6ad('0x7'));router[_0xe6ad('0x8')]('/',auth[_0xe6ad('0x9')](),controller[_0xe6ad('0xa')]);router[_0xe6ad('0x8')](_0xe6ad('0xb'),auth[_0xe6ad('0x9')](),controller[_0xe6ad('0xc')]);router[_0xe6ad('0x8')](_0xe6ad('0xd'),auth[_0xe6ad('0x9')](),controller[_0xe6ad('0xe')]);router[_0xe6ad('0xf')]('/',auth[_0xe6ad('0x9')](),controller[_0xe6ad('0x10')]);router['put'](_0xe6ad('0xd'),auth[_0xe6ad('0x9')](),controller[_0xe6ad('0x11')]);router[_0xe6ad('0x12')]('/:id',auth[_0xe6ad('0x9')](),controller['destroy']);module[_0xe6ad('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 45f78b1..b8fe4a3 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 _0x6d0a=['STRING','TEXT','long','exports'];(function(_0x4abf27,_0x33add3){var _0x1dd213=function(_0x5c9682){while(--_0x5c9682){_0x4abf27['push'](_0x4abf27['shift']());}};_0x1dd213(++_0x33add3);}(_0x6d0a,0x19f));var _0xa6d0=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x6d0a[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module[_0xa6d0('0x0')]={'question':{'type':Sequelize[_0xa6d0('0x1')]},'answer':{'type':Sequelize[_0xa6d0('0x2')](_0xa6d0('0x3'))},'membername':{'type':Sequelize[_0xa6d0('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa6d0('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa6d0('0x1')]},'questionId':{'type':Sequelize[_0xa6d0('0x1')]}}; \ No newline at end of file +var _0xbf4c=['long','exports','STRING'];(function(_0xa79986,_0x2f7afa){var _0x186ad5=function(_0x5b8a20){while(--_0x5b8a20){_0xa79986['push'](_0xa79986['shift']());}};_0x186ad5(++_0x2f7afa);}(_0xbf4c,0x124));var _0xcbf4=function(_0x466963,_0xdc49){_0x466963=_0x466963-0x0;var _0x1f46a8=_0xbf4c[_0x466963];return _0x1f46a8;};'use strict';var Sequelize=require('sequelize');module[_0xcbf4('0x0')]={'question':{'type':Sequelize[_0xcbf4('0x1')]},'answer':{'type':Sequelize['TEXT'](_0xcbf4('0x2'))},'membername':{'type':Sequelize[_0xcbf4('0x1')]},'projectname':{'type':Sequelize[_0xcbf4('0x1')]},'queue':{'type':Sequelize[_0xcbf4('0x1')]},'uniqueid':{'type':Sequelize[_0xcbf4('0x1')]},'calleridname':{'type':Sequelize[_0xcbf4('0x1')]},'calleridnum':{'type':Sequelize[_0xcbf4('0x1')]},'questionId':{'type':Sequelize[_0xcbf4('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index d443ae8..ca0c2d7 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 _0x6f8e=['error','name','send','index','map','JscriptyAnswerReport','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','save','update','then','destroy'];(function(_0x344c3d,_0x56aec9){var _0x4c425d=function(_0x4b9c06){while(--_0x4b9c06){_0x344c3d['push'](_0x344c3d['shift']());}};_0x4c425d(++_0x56aec9);}(_0x6f8e,0x15a));var _0xe6f8=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6f8e[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0xe6f8('0x0'));var emlformat=require(_0xe6f8('0x1'));var rimraf=require(_0xe6f8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6f8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe6f8('0x4'));var Mustache=require(_0xe6f8('0x5'));var util=require(_0xe6f8('0x6'));var path=require(_0xe6f8('0x7'));var sox=require(_0xe6f8('0x8'));var csv=require(_0xe6f8('0x9'));var ejs=require(_0xe6f8('0xa'));var fs=require('fs');var _=require(_0xe6f8('0xb'));var squel=require('squel');var crypto=require(_0xe6f8('0xc'));var jsforce=require(_0xe6f8('0xd'));var deskjs=require(_0xe6f8('0xe'));var toCsv=require(_0xe6f8('0x9'));var querystring=require('querystring');var Papa=require(_0xe6f8('0xf'));var Redis=require(_0xe6f8('0x10'));var authService=require(_0xe6f8('0x11'));var qs=require(_0xe6f8('0x12'));var as=require(_0xe6f8('0x13'));var hardwareService=require(_0xe6f8('0x14'));var logger=require(_0xe6f8('0x15'))(_0xe6f8('0x16'));var utils=require(_0xe6f8('0x17'));var config=require(_0xe6f8('0x18'));var db=require(_0xe6f8('0x19'))['db'];function respondWithStatusCode(_0x227be7,_0x4d7669){_0x4d7669=_0x4d7669||0xcc;return function(_0xa7df3c){if(_0xa7df3c){return _0x227be7[_0xe6f8('0x1a')](_0x4d7669);}return _0x227be7[_0xe6f8('0x1b')](_0x4d7669)[_0xe6f8('0x1c')]();};}function respondWithResult(_0x5db186,_0x57f652){_0x57f652=_0x57f652||0xc8;return function(_0x75f70b){if(_0x75f70b){return _0x5db186[_0xe6f8('0x1b')](_0x57f652)['json'](_0x75f70b);}};}function respondWithFilteredResult(_0xb0eefe,_0x44cd9f){return function(_0x3b9faa){if(_0x3b9faa){var _0x46d6b5=_0x3b9faa[_0xe6f8('0x1d')],_0x39d8de=_0x44cd9f[_0xe6f8('0x1e')],_0x2397a6=_0x44cd9f[_0xe6f8('0x1e')]+_0x44cd9f[_0xe6f8('0x1f')],_0x3947e9;if(_0x2397a6>=_0x46d6b5){_0x2397a6=_0x46d6b5;_0x3947e9=0xc8;}else{_0x3947e9=0xce;}_0xb0eefe[_0xe6f8('0x1b')](_0x3947e9);return _0xb0eefe[_0xe6f8('0x20')]('Content-Range',_0x39d8de+'-'+_0x2397a6+'/'+_0x46d6b5)[_0xe6f8('0x21')](_0x3b9faa);}return null;};}function patchUpdates(_0x5b6d8f){return function(_0x4a3478){try{jsonpatch[_0xe6f8('0x22')](_0x4a3478,_0x5b6d8f,!![]);}catch(_0x420b6d){return BPromise['reject'](_0x420b6d);}return _0x4a3478[_0xe6f8('0x23')]();};}function saveUpdates(_0x1a1acf,_0x33bd72){return function(_0x2ccaec){if(_0x2ccaec){return _0x2ccaec[_0xe6f8('0x24')](_0x1a1acf)[_0xe6f8('0x25')](function(_0x4005f7){return _0x4005f7;});}return null;};}function removeEntity(_0x582dcc,_0x37ab06){return function(_0x438014){if(_0x438014){return _0x438014[_0xe6f8('0x26')]()[_0xe6f8('0x25')](function(){_0x582dcc[_0xe6f8('0x1b')](0xcc)[_0xe6f8('0x1c')]();});}};}function handleEntityNotFound(_0x24d8c1,_0x1cf345){return function(_0x19bf11){if(!_0x19bf11){_0x24d8c1['sendStatus'](0x194);}return _0x19bf11;};}function handleError(_0x52c810,_0x2a4ad6){_0x2a4ad6=_0x2a4ad6||0x1f4;return function(_0x410840){logger[_0xe6f8('0x27')](_0x410840['stack']);if(_0x410840[_0xe6f8('0x28')]){delete _0x410840[_0xe6f8('0x28')];}_0x52c810[_0xe6f8('0x1b')](_0x2a4ad6)[_0xe6f8('0x29')](_0x410840);};}exports[_0xe6f8('0x2a')]=function(_0x2abe5d,_0x4fc462){var _0x2df4db={},_0x1f204c={},_0x131957={'count':0x0,'rows':[]};var _0x540b87=_[_0xe6f8('0x2b')](db[_0xe6f8('0x2c')]['rawAttributes'],function(_0x5250ed){return{'name':_0x5250ed['fieldName'],'type':_0x5250ed['type'][_0xe6f8('0x2d')]};});_0x1f204c[_0xe6f8('0x2e')]=_['map'](_0x540b87,_0xe6f8('0x28'));_0x1f204c[_0xe6f8('0x2f')]=_[_0xe6f8('0x30')](_0x2abe5d['query']);_0x1f204c['filters']=_[_0xe6f8('0x31')](_0x1f204c[_0xe6f8('0x2e')],_0x1f204c['query']);_0x2df4db[_0xe6f8('0x32')]=_['intersection'](_0x1f204c[_0xe6f8('0x2e')],qs[_0xe6f8('0x33')](_0x2abe5d[_0xe6f8('0x2f')]['fields']));_0x2df4db[_0xe6f8('0x32')]=_0x2df4db['attributes'][_0xe6f8('0x34')]?_0x2df4db['attributes']:_0x1f204c['model'];if(!_0x2abe5d[_0xe6f8('0x2f')][_0xe6f8('0x35')](_0xe6f8('0x36'))){_0x2df4db[_0xe6f8('0x1f')]=qs[_0xe6f8('0x1f')](_0x2abe5d[_0xe6f8('0x2f')]['limit']);_0x2df4db[_0xe6f8('0x1e')]=qs[_0xe6f8('0x1e')](_0x2abe5d['query']['offset']);}_0x2df4db[_0xe6f8('0x37')]=qs['sort'](_0x2abe5d[_0xe6f8('0x2f')][_0xe6f8('0x38')]);_0x2df4db[_0xe6f8('0x39')]=qs[_0xe6f8('0x3a')](_[_0xe6f8('0x3b')](_0x2abe5d['query'],_0x1f204c[_0xe6f8('0x3a')]));if(_0x2abe5d['query'][_0xe6f8('0x3c')]){_0x2df4db[_0xe6f8('0x39')]=_['merge'](_0x2df4db['where'],{'$or':_[_0xe6f8('0x2b')](_0x540b87,function(_0x346635){if(_0x346635[_0xe6f8('0x3d')]!==_0xe6f8('0x3e')){var _0x24bbc3={};_0x24bbc3[_0x346635[_0xe6f8('0x28')]]={'$like':'%'+_0x2abe5d['query'][_0xe6f8('0x3c')]+'%'};return _0x24bbc3;}})});}_0x2df4db=_[_0xe6f8('0x3f')]({},_0x2df4db,_0x2abe5d[_0xe6f8('0x40')]);var _0x2cd8a2={'where':_0x2df4db[_0xe6f8('0x39')]};return db[_0xe6f8('0x2c')]['count'](_0x2cd8a2)[_0xe6f8('0x25')](function(_0x3a989e){_0x131957[_0xe6f8('0x1d')]=_0x3a989e;if(_0x2abe5d[_0xe6f8('0x2f')][_0xe6f8('0x41')]){_0x2df4db[_0xe6f8('0x42')]=[{'all':!![]}];}return db[_0xe6f8('0x2c')][_0xe6f8('0x43')](_0x2df4db);})[_0xe6f8('0x25')](function(_0x14f5b6){_0x131957[_0xe6f8('0x44')]=_0x14f5b6;return _0x131957;})['then'](respondWithFilteredResult(_0x4fc462,_0x2df4db))[_0xe6f8('0x45')](handleError(_0x4fc462,null));};exports[_0xe6f8('0x46')]=function(_0x238976,_0x2c5cea){var _0x378b4c={'raw':!![],'where':{'id':_0x238976[_0xe6f8('0x47')]['id']}},_0x3f395c={};_0x3f395c[_0xe6f8('0x2e')]=_[_0xe6f8('0x30')](db['JscriptyAnswerReport'][_0xe6f8('0x48')]);_0x3f395c[_0xe6f8('0x2f')]=_[_0xe6f8('0x30')](_0x238976[_0xe6f8('0x2f')]);_0x3f395c[_0xe6f8('0x3a')]=_[_0xe6f8('0x31')](_0x3f395c[_0xe6f8('0x2e')],_0x3f395c[_0xe6f8('0x2f')]);_0x378b4c[_0xe6f8('0x32')]=_[_0xe6f8('0x31')](_0x3f395c[_0xe6f8('0x2e')],qs[_0xe6f8('0x33')](_0x238976['query']['fields']));_0x378b4c[_0xe6f8('0x32')]=_0x378b4c[_0xe6f8('0x32')][_0xe6f8('0x34')]?_0x378b4c['attributes']:_0x3f395c[_0xe6f8('0x2e')];if(_0x238976[_0xe6f8('0x2f')][_0xe6f8('0x41')]){_0x378b4c[_0xe6f8('0x42')]=[{'all':!![]}];}_0x378b4c=_[_0xe6f8('0x3f')]({},_0x378b4c,_0x238976['options']);return db[_0xe6f8('0x2c')][_0xe6f8('0x49')](_0x378b4c)[_0xe6f8('0x25')](handleEntityNotFound(_0x2c5cea,null))[_0xe6f8('0x25')](respondWithResult(_0x2c5cea,null))[_0xe6f8('0x45')](handleError(_0x2c5cea,null));};exports[_0xe6f8('0x4a')]=function(_0x3bcc09,_0x2c250f){return db[_0xe6f8('0x2c')][_0xe6f8('0x4a')](_0x3bcc09['body'],{})['then'](respondWithResult(_0x2c250f,0xc9))[_0xe6f8('0x45')](handleError(_0x2c250f,null));};exports[_0xe6f8('0x24')]=function(_0x290145,_0x226b2c){if(_0x290145[_0xe6f8('0x4b')]['id']){delete _0x290145[_0xe6f8('0x4b')]['id'];}return db['JscriptyAnswerReport'][_0xe6f8('0x49')]({'where':{'id':_0x290145[_0xe6f8('0x47')]['id']}})[_0xe6f8('0x25')](handleEntityNotFound(_0x226b2c,null))['then'](saveUpdates(_0x290145[_0xe6f8('0x4b')],null))[_0xe6f8('0x25')](respondWithResult(_0x226b2c,null))[_0xe6f8('0x45')](handleError(_0x226b2c,null));};exports[_0xe6f8('0x26')]=function(_0xc5a505,_0x5d9532){return db[_0xe6f8('0x2c')][_0xe6f8('0x49')]({'where':{'id':_0xc5a505['params']['id']}})['then'](handleEntityNotFound(_0x5d9532,null))[_0xe6f8('0x25')](removeEntity(_0x5d9532,null))['catch'](handleError(_0x5d9532,null));};exports[_0xe6f8('0x4c')]=function(_0x213ca1,_0x12d1fb){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x12d1fb,null))[_0xe6f8('0x45')](handleError(_0x12d1fb,null));}; \ No newline at end of file +var _0xa30a=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','apply','update','then','destroy','error','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','describe','html-pdf'];(function(_0x3f87eb,_0x44596e){var _0x2d7ef1=function(_0x18ae41){while(--_0x18ae41){_0x3f87eb['push'](_0x3f87eb['shift']());}};_0x2d7ef1(++_0x44596e);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xaa30('0x0'));var emlformat=require(_0xaa30('0x1'));var rimraf=require(_0xaa30('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa30('0x3'));var rp=require(_0xaa30('0x4'));var moment=require(_0xaa30('0x5'));var BPromise=require(_0xaa30('0x6'));var Mustache=require(_0xaa30('0x7'));var util=require(_0xaa30('0x8'));var path=require(_0xaa30('0x9'));var sox=require('sox');var csv=require(_0xaa30('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xa'));var querystring=require(_0xaa30('0xf'));var Papa=require(_0xaa30('0x10'));var Redis=require(_0xaa30('0x11'));var authService=require(_0xaa30('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x13'));var logger=require('../../config/logger')(_0xaa30('0x14'));var utils=require(_0xaa30('0x15'));var config=require(_0xaa30('0x16'));var db=require(_0xaa30('0x17'))['db'];function respondWithStatusCode(_0x589229,_0xec992f){_0xec992f=_0xec992f||0xcc;return function(_0x3de2d1){if(_0x3de2d1){return _0x589229[_0xaa30('0x18')](_0xec992f);}return _0x589229['status'](_0xec992f)[_0xaa30('0x19')]();};}function respondWithResult(_0xdea23a,_0x25c02e){_0x25c02e=_0x25c02e||0xc8;return function(_0x14de74){if(_0x14de74){return _0xdea23a[_0xaa30('0x1a')](_0x25c02e)[_0xaa30('0x1b')](_0x14de74);}};}function respondWithFilteredResult(_0x3240e9,_0x3b8095){return function(_0x2e37af){if(_0x2e37af){var _0xfae724=_0x2e37af['count'],_0x519518=_0x3b8095[_0xaa30('0x1c')],_0x91839d=_0x3b8095[_0xaa30('0x1c')]+_0x3b8095[_0xaa30('0x1d')],_0x591478;if(_0x91839d>=_0xfae724){_0x91839d=_0xfae724;_0x591478=0xc8;}else{_0x591478=0xce;}_0x3240e9['status'](_0x591478);return _0x3240e9['set']('Content-Range',_0x519518+'-'+_0x91839d+'/'+_0xfae724)[_0xaa30('0x1b')](_0x2e37af);}return null;};}function patchUpdates(_0x4acdfa){return function(_0xfb02ab){try{jsonpatch[_0xaa30('0x1e')](_0xfb02ab,_0x4acdfa,!![]);}catch(_0x48561d){return BPromise['reject'](_0x48561d);}return _0xfb02ab['save']();};}function saveUpdates(_0x3cbf92,_0x3e4f1d){return function(_0x61b85){if(_0x61b85){return _0x61b85[_0xaa30('0x1f')](_0x3cbf92)[_0xaa30('0x20')](function(_0x4aacfd){return _0x4aacfd;});}return null;};}function removeEntity(_0x3f6295,_0x24bb25){return function(_0x2e16e7){if(_0x2e16e7){return _0x2e16e7[_0xaa30('0x21')]()[_0xaa30('0x20')](function(){_0x3f6295['status'](0xcc)[_0xaa30('0x19')]();});}};}function handleEntityNotFound(_0x13128a,_0x2fecdd){return function(_0x326f84){if(!_0x326f84){_0x13128a['sendStatus'](0x194);}return _0x326f84;};}function handleError(_0x14d7fa,_0x1be54c){_0x1be54c=_0x1be54c||0x1f4;return function(_0x19ba52){logger[_0xaa30('0x22')](_0x19ba52[_0xaa30('0x23')]);if(_0x19ba52[_0xaa30('0x24')]){delete _0x19ba52['name'];}_0x14d7fa[_0xaa30('0x1a')](_0x1be54c)[_0xaa30('0x25')](_0x19ba52);};}exports['index']=function(_0xb043e4,_0x5b3efb){var _0x2da4da={},_0x33a0c9={},_0x2aabf8={'count':0x0,'rows':[]};var _0xd1eb3a=_[_0xaa30('0x26')](db[_0xaa30('0x27')][_0xaa30('0x28')],function(_0x39f708){return{'name':_0x39f708[_0xaa30('0x29')],'type':_0x39f708[_0xaa30('0x2a')][_0xaa30('0x2b')]};});_0x33a0c9[_0xaa30('0x2c')]=_[_0xaa30('0x26')](_0xd1eb3a,_0xaa30('0x24'));_0x33a0c9[_0xaa30('0x2d')]=_[_0xaa30('0x2e')](_0xb043e4[_0xaa30('0x2d')]);_0x33a0c9[_0xaa30('0x2f')]=_['intersection'](_0x33a0c9[_0xaa30('0x2c')],_0x33a0c9[_0xaa30('0x2d')]);_0x2da4da[_0xaa30('0x30')]=_[_0xaa30('0x31')](_0x33a0c9[_0xaa30('0x2c')],qs[_0xaa30('0x32')](_0xb043e4['query']['fields']));_0x2da4da['attributes']=_0x2da4da[_0xaa30('0x30')][_0xaa30('0x33')]?_0x2da4da[_0xaa30('0x30')]:_0x33a0c9[_0xaa30('0x2c')];if(!_0xb043e4[_0xaa30('0x2d')]['hasOwnProperty']('nolimit')){_0x2da4da[_0xaa30('0x1d')]=qs[_0xaa30('0x1d')](_0xb043e4['query'][_0xaa30('0x1d')]);_0x2da4da['offset']=qs[_0xaa30('0x1c')](_0xb043e4['query'][_0xaa30('0x1c')]);}_0x2da4da[_0xaa30('0x34')]=qs['sort'](_0xb043e4[_0xaa30('0x2d')][_0xaa30('0x35')]);_0x2da4da[_0xaa30('0x36')]=qs[_0xaa30('0x2f')](_[_0xaa30('0x37')](_0xb043e4[_0xaa30('0x2d')],_0x33a0c9['filters']));if(_0xb043e4[_0xaa30('0x2d')][_0xaa30('0x38')]){_0x2da4da['where']=_[_0xaa30('0x39')](_0x2da4da[_0xaa30('0x36')],{'$or':_[_0xaa30('0x26')](_0xd1eb3a,function(_0x557012){if(_0x557012['type']!==_0xaa30('0x3a')){var _0x21ffb0={};_0x21ffb0[_0x557012[_0xaa30('0x24')]]={'$like':'%'+_0xb043e4[_0xaa30('0x2d')][_0xaa30('0x38')]+'%'};return _0x21ffb0;}})});}_0x2da4da=_[_0xaa30('0x39')]({},_0x2da4da,_0xb043e4['options']);var _0x5ca1b0={'where':_0x2da4da[_0xaa30('0x36')]};return db[_0xaa30('0x27')][_0xaa30('0x3b')](_0x5ca1b0)['then'](function(_0x244bca){_0x2aabf8[_0xaa30('0x3b')]=_0x244bca;if(_0xb043e4[_0xaa30('0x2d')][_0xaa30('0x3c')]){_0x2da4da['include']=[{'all':!![]}];}return db[_0xaa30('0x27')][_0xaa30('0x3d')](_0x2da4da);})[_0xaa30('0x20')](function(_0x480795){_0x2aabf8[_0xaa30('0x3e')]=_0x480795;return _0x2aabf8;})['then'](respondWithFilteredResult(_0x5b3efb,_0x2da4da))[_0xaa30('0x3f')](handleError(_0x5b3efb,null));};exports[_0xaa30('0x40')]=function(_0x22dfa5,_0x7b6a6b){var _0x13f08f={'raw':!![],'where':{'id':_0x22dfa5[_0xaa30('0x41')]['id']}},_0x4478cc={};_0x4478cc[_0xaa30('0x2c')]=_['keys'](db['JscriptyAnswerReport'][_0xaa30('0x28')]);_0x4478cc['query']=_['keys'](_0x22dfa5['query']);_0x4478cc[_0xaa30('0x2f')]=_['intersection'](_0x4478cc[_0xaa30('0x2c')],_0x4478cc['query']);_0x13f08f[_0xaa30('0x30')]=_[_0xaa30('0x31')](_0x4478cc[_0xaa30('0x2c')],qs[_0xaa30('0x32')](_0x22dfa5[_0xaa30('0x2d')][_0xaa30('0x32')]));_0x13f08f[_0xaa30('0x30')]=_0x13f08f[_0xaa30('0x30')][_0xaa30('0x33')]?_0x13f08f[_0xaa30('0x30')]:_0x4478cc[_0xaa30('0x2c')];if(_0x22dfa5['query'][_0xaa30('0x3c')]){_0x13f08f[_0xaa30('0x42')]=[{'all':!![]}];}_0x13f08f=_[_0xaa30('0x39')]({},_0x13f08f,_0x22dfa5[_0xaa30('0x43')]);return db[_0xaa30('0x27')]['find'](_0x13f08f)['then'](handleEntityNotFound(_0x7b6a6b,null))[_0xaa30('0x20')](respondWithResult(_0x7b6a6b,null))['catch'](handleError(_0x7b6a6b,null));};exports[_0xaa30('0x44')]=function(_0xbf9edd,_0xef3564){return db[_0xaa30('0x27')][_0xaa30('0x44')](_0xbf9edd[_0xaa30('0x45')],{})[_0xaa30('0x20')](respondWithResult(_0xef3564,0xc9))['catch'](handleError(_0xef3564,null));};exports[_0xaa30('0x1f')]=function(_0x6c9da6,_0xfa14bf){if(_0x6c9da6['body']['id']){delete _0x6c9da6[_0xaa30('0x45')]['id'];}return db[_0xaa30('0x27')]['find']({'where':{'id':_0x6c9da6[_0xaa30('0x41')]['id']}})['then'](handleEntityNotFound(_0xfa14bf,null))[_0xaa30('0x20')](saveUpdates(_0x6c9da6['body'],null))['then'](respondWithResult(_0xfa14bf,null))[_0xaa30('0x3f')](handleError(_0xfa14bf,null));};exports['destroy']=function(_0x56389c,_0xf6a737){return db[_0xaa30('0x27')][_0xaa30('0x46')]({'where':{'id':_0x56389c[_0xaa30('0x41')]['id']}})[_0xaa30('0x20')](handleEntityNotFound(_0xf6a737,null))[_0xaa30('0x20')](removeEntity(_0xf6a737,null))['catch'](handleError(_0xf6a737,null));};exports[_0xaa30('0x47')]=function(_0x17868d,_0x4531b7){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x4531b7,null))['catch'](handleError(_0x4531b7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 0bc863c..37c47ba 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 _0x4c93=['api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x4c93,0x1a1));var _0x34c9=function(_0x304013,_0x48eb1f){_0x304013=_0x304013-0x0;var _0xc2fb2c=_0x4c93[_0x304013];return _0xc2fb2c;};'use strict';var _=require(_0x34c9('0x0'));var util=require(_0x34c9('0x1'));var logger=require(_0x34c9('0x2'))(_0x34c9('0x3'));var moment=require(_0x34c9('0x4'));var BPromise=require(_0x34c9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34c9('0x6'));var rimraf=require(_0x34c9('0x7'));var config=require(_0x34c9('0x8'));var attributes=require(_0x34c9('0x9'));module[_0x34c9('0xa')]=function(_0xe63e5a,_0x14137a){return _0xe63e5a[_0x34c9('0xb')](_0x34c9('0xc'),attributes,{'tableName':_0x34c9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4f2=['rimraf','../../config/environment','define','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x177a04,_0x433bc8){var _0x269b44=function(_0x23eafc){while(--_0x23eafc){_0x177a04['push'](_0x177a04['shift']());}};_0x269b44(++_0x433bc8);}(_0xd4f2,0xdc));var _0x2d4f=function(_0x4fdc93,_0x1ce6bc){_0x4fdc93=_0x4fdc93-0x0;var _0x2b0d7c=_0xd4f2[_0x4fdc93];return _0x2b0d7c;};'use strict';var _=require(_0x2d4f('0x0'));var util=require(_0x2d4f('0x1'));var logger=require(_0x2d4f('0x2'))(_0x2d4f('0x3'));var moment=require(_0x2d4f('0x4'));var BPromise=require(_0x2d4f('0x5'));var rp=require(_0x2d4f('0x6'));var fs=require('fs');var path=require(_0x2d4f('0x7'));var rimraf=require(_0x2d4f('0x8'));var config=require(_0x2d4f('0x9'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x56a451,_0x2f7995){return _0x56a451[_0x2d4f('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0x2d4f('0xb'),'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 e5a4d69..67fbcae 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 _0x6738=['code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x5b6717,_0x1e132b){var _0x371aaf=function(_0x43c7c8){while(--_0x43c7c8){_0x5b6717['push'](_0x5b6717['shift']());}};_0x371aaf(++_0x1e132b);}(_0x6738,0x194));var _0x8673=function(_0x728641,_0x530fd1){_0x728641=_0x728641-0x0;var _0x4dc354=_0x6738[_0x728641];return _0x4dc354;};'use strict';var _=require(_0x8673('0x0'));var util=require('util');var moment=require(_0x8673('0x1'));var BPromise=require(_0x8673('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8673('0x3'));var db=require(_0x8673('0x4'))['db'];var utils=require(_0x8673('0x5'));var logger=require(_0x8673('0x6'))('rpc');var config=require(_0x8673('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8673('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e24e4,_0x2bb3ea,_0x4765ed){return new BPromise(function(_0x2790f6,_0x5072de){return client[_0x8673('0x9')](_0x2e24e4,_0x4765ed)[_0x8673('0xa')](function(_0x53b3f8){logger[_0x8673('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2bb3ea,_0x8673('0xc'));logger[_0x8673('0xd')](_0x8673('0xe'),_0x2bb3ea,_0x8673('0xc'),JSON['stringify'](_0x53b3f8));if(_0x53b3f8[_0x8673('0xf')]){if(_0x53b3f8[_0x8673('0xf')][_0x8673('0x10')]===0x1f4){logger[_0x8673('0xf')](_0x8673('0x11'),_0x2bb3ea,_0x53b3f8[_0x8673('0xf')][_0x8673('0x12')]);return _0x5072de(_0x53b3f8[_0x8673('0xf')]['message']);}logger['error'](_0x8673('0x11'),_0x2bb3ea,_0x53b3f8[_0x8673('0xf')][_0x8673('0x12')]);return _0x2790f6(_0x53b3f8['error'][_0x8673('0x12')]);}else{logger[_0x8673('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2bb3ea,_0x8673('0xc'));_0x2790f6(_0x53b3f8[_0x8673('0x13')]['message']);}})[_0x8673('0x14')](function(_0x4c2dc4){logger[_0x8673('0xf')](_0x8673('0x11'),_0x2bb3ea,_0x4c2dc4);_0x5072de(_0x4c2dc4);});});} \ No newline at end of file +var _0x9dc7=['client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x10b19e,_0x459dda){var _0x47ee58=function(_0x29a951){while(--_0x29a951){_0x10b19e['push'](_0x10b19e['shift']());}};_0x47ee58(++_0x459dda);}(_0x9dc7,0x198));var _0x79dc=function(_0x5be1d1,_0x55d93b){_0x5be1d1=_0x5be1d1-0x0;var _0x36d5b3=_0x9dc7[_0x5be1d1];return _0x36d5b3;};'use strict';var _=require(_0x79dc('0x0'));var util=require('util');var moment=require(_0x79dc('0x1'));var BPromise=require('bluebird');var rs=require(_0x79dc('0x2'));var fs=require('fs');var Redis=require(_0x79dc('0x3'));var db=require(_0x79dc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x79dc('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x79dc('0x6')][_0x79dc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ef5c8,_0x275e5f,_0xdb17ab){return new BPromise(function(_0x1b89cf,_0x588152){return client[_0x79dc('0x8')](_0x1ef5c8,_0xdb17ab)[_0x79dc('0x9')](function(_0xa5f112){logger['info'](_0x79dc('0xa'),_0x275e5f,_0x79dc('0xb'));logger['debug'](_0x79dc('0xc'),_0x275e5f,_0x79dc('0xb'),JSON[_0x79dc('0xd')](_0xa5f112));if(_0xa5f112[_0x79dc('0xe')]){if(_0xa5f112[_0x79dc('0xe')][_0x79dc('0xf')]===0x1f4){logger[_0x79dc('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x275e5f,_0xa5f112['error'][_0x79dc('0x10')]);return _0x588152(_0xa5f112[_0x79dc('0xe')][_0x79dc('0x10')]);}logger[_0x79dc('0xe')](_0x79dc('0xa'),_0x275e5f,_0xa5f112[_0x79dc('0xe')][_0x79dc('0x10')]);return _0x1b89cf(_0xa5f112['error']['message']);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x275e5f,_0x79dc('0xb'));_0x1b89cf(_0xa5f112['result'][_0x79dc('0x10')]);}})[_0x79dc('0x11')](function(_0x1c7f11){logger[_0x79dc('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x275e5f,_0x1c7f11);_0x588152(_0x1c7f11);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 6bee9c7..018b3db 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 _0x2f8f=['isAuthenticated','getAnswers','/:id/summary','30s','/:id/clone','clone','update','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/sessions','getSessions','/:id/answers'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x2f8f,0x13c));var _0xf2f8=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x2f8f[_0x13606d];return _0x1b85b0;};'use strict';var multer=require(_0xf2f8('0x0'));var util=require(_0xf2f8('0x1'));var path=require(_0xf2f8('0x2'));var timeout=require('connect-timeout');var express=require(_0xf2f8('0x3'));var router=express[_0xf2f8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf2f8('0x5'));var config=require(_0xf2f8('0x6'));var controller=require('./jscriptyProject.controller');router[_0xf2f8('0x7')]('/',auth['isAuthenticated'](),controller[_0xf2f8('0x8')]);router[_0xf2f8('0x7')](_0xf2f8('0x9'),auth['isAuthenticated'](),controller[_0xf2f8('0xa')]);router[_0xf2f8('0x7')](_0xf2f8('0xb'),auth['isAuthenticated'](),controller[_0xf2f8('0xc')]);router[_0xf2f8('0x7')](_0xf2f8('0xd'),auth[_0xf2f8('0xe')](),controller[_0xf2f8('0xf')]);router[_0xf2f8('0x7')](_0xf2f8('0x10'),auth[_0xf2f8('0xe')](),timeout(_0xf2f8('0x11')),controller['getSummary']);router['post']('/',auth[_0xf2f8('0xe')](),controller['create']);router['post'](_0xf2f8('0x12'),auth[_0xf2f8('0xe')](),controller[_0xf2f8('0x13')]);router['put'](_0xf2f8('0x9'),auth['isAuthenticated'](),controller[_0xf2f8('0x14')]);router['delete'](_0xf2f8('0x9'),auth[_0xf2f8('0xe')](),controller['destroy']);module[_0xf2f8('0x15')]=router; \ No newline at end of file +var _0x93f2=['update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','put'];(function(_0x1d5342,_0x4407cb){var _0x51b365=function(_0x57fb10){while(--_0x57fb10){_0x1d5342['push'](_0x1d5342['shift']());}};_0x51b365(++_0x4407cb);}(_0x93f2,0x15d));var _0x293f=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x93f2[_0x3740fe];return _0x55492b;};'use strict';var multer=require(_0x293f('0x0'));var util=require('util');var path=require(_0x293f('0x1'));var timeout=require(_0x293f('0x2'));var express=require(_0x293f('0x3'));var router=express[_0x293f('0x4')]();var auth=require(_0x293f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x293f('0x6'));var controller=require('./jscriptyProject.controller');router[_0x293f('0x7')]('/',auth[_0x293f('0x8')](),controller[_0x293f('0x9')]);router[_0x293f('0x7')]('/:id',auth[_0x293f('0x8')](),controller['show']);router[_0x293f('0x7')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x293f('0xa')]);router[_0x293f('0x7')]('/:id/answers',auth[_0x293f('0x8')](),controller[_0x293f('0xb')]);router[_0x293f('0x7')](_0x293f('0xc'),auth[_0x293f('0x8')](),timeout(_0x293f('0xd')),controller[_0x293f('0xe')]);router[_0x293f('0xf')]('/',auth[_0x293f('0x8')](),controller[_0x293f('0x10')]);router[_0x293f('0xf')](_0x293f('0x11'),auth[_0x293f('0x8')](),controller['clone']);router[_0x293f('0x12')]('/:id',auth[_0x293f('0x8')](),controller[_0x293f('0x13')]);router[_0x293f('0x14')](_0x293f('0x15'),auth[_0x293f('0x8')](),controller[_0x293f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index d97e033..4d02fd3 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 _0xd29c=['formData','format','getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','isObjectLike','stringify','isString','setDataValue'];(function(_0x27da01,_0x366873){var _0x6339bf=function(_0x558e8d){while(--_0x558e8d){_0x27da01['push'](_0x27da01['shift']());}};_0x6339bf(++_0x366873);}(_0xd29c,0x85));var _0xcd29=function(_0xdac38,_0x4693f9){_0xdac38=_0xdac38-0x0;var _0x1a4c78=_0xd29c[_0xdac38];return _0x1a4c78;};'use strict';var Sequelize=require(_0xcd29('0x0'));var _=require('lodash');var util=require(_0xcd29('0x1'));module[_0xcd29('0x2')]={'name':{'type':Sequelize[_0xcd29('0x3')],'unique':_0xcd29('0x4')},'description':{'type':Sequelize[_0xcd29('0x3')]},'formData':{'type':Sequelize[_0xcd29('0x5')](_0xcd29('0x6')),'set':function(_0x38d465){if(_[_0xcd29('0x7')](_0x38d465)){this['setDataValue']('formData',JSON[_0xcd29('0x8')](_0x38d465));}else if(_[_0xcd29('0x9')](_0x38d465)){this[_0xcd29('0xa')](_0xcd29('0xb'),_0x38d465);}else{this[_0xcd29('0xa')](_0xcd29('0xb'),util[_0xcd29('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xcd29('0xd')](_0xcd29('0x4'))||'',this[_0xcd29('0xd')](_0xcd29('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xcd29('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xcd29('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x2600=['exports','name','STRING','TEXT','long','isObjectLike','setDataValue','isString','formData','format','getDataValue','description','BOOLEAN','lodash','util'];(function(_0x10dff8,_0x4b5ba4){var _0x21d5ad=function(_0x4f083c){while(--_0x4f083c){_0x10dff8['push'](_0x10dff8['shift']());}};_0x21d5ad(++_0x4b5ba4);}(_0x2600,0xa3));var _0x0260=function(_0x5d9fba,_0x1361da){_0x5d9fba=_0x5d9fba-0x0;var _0x1bedf1=_0x2600[_0x5d9fba];return _0x1bedf1;};'use strict';var Sequelize=require('sequelize');var _=require(_0x0260('0x0'));var util=require(_0x0260('0x1'));module[_0x0260('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x0260('0x3')},'description':{'type':Sequelize[_0x0260('0x4')]},'formData':{'type':Sequelize[_0x0260('0x5')](_0x0260('0x6')),'set':function(_0x39c4f3){if(_[_0x0260('0x7')](_0x39c4f3)){this[_0x0260('0x8')]('formData',JSON['stringify'](_0x39c4f3));}else if(_[_0x0260('0x9')](_0x39c4f3)){this[_0x0260('0x8')](_0x0260('0xa'),_0x39c4f3);}else{this[_0x0260('0x8')](_0x0260('0xa'),util[_0x0260('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue']('name')||'',this[_0x0260('0xc')](_0x0260('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0260('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 22f03b3..cea9238 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 _0x9f43=['nolimit','limit','sort','filter','merge','where','includeAll','include','rows','catch','show','params','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getSessions','JscriptySessionReport','hasOwnProperty','order','pick','ProjectId','findOne','JscriptyAnswerReport','findAll','number','fromCharCode','toString','indexOf','replace','startTime','starttime','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','then','destroy','get','Projects','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f43,0xae));var _0x39f4=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0x9f43[_0x40d8d7];return _0x3454cc;};'use strict';var pdf=require(_0x39f4('0x0'));var emlformat=require(_0x39f4('0x1'));var rimraf=require(_0x39f4('0x2'));var zipdir=require(_0x39f4('0x3'));var jsonpatch=require(_0x39f4('0x4'));var rp=require('request-promise');var moment=require(_0x39f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x39f4('0x6'));var util=require(_0x39f4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x39f4('0x8'));var ejs=require(_0x39f4('0x9'));var fs=require('fs');var _=require(_0x39f4('0xa'));var squel=require(_0x39f4('0xb'));var crypto=require('crypto');var jsforce=require(_0x39f4('0xc'));var deskjs=require(_0x39f4('0xd'));var toCsv=require(_0x39f4('0x8'));var querystring=require(_0x39f4('0xe'));var Papa=require(_0x39f4('0xf'));var Redis=require(_0x39f4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x39f4('0x11'));var as=require(_0x39f4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39f4('0x13'))(_0x39f4('0x14'));var utils=require('../../config/utils');var config=require(_0x39f4('0x15'));var db=require(_0x39f4('0x16'))['db'];function respondWithStatusCode(_0x497f71,_0x2f801f){_0x2f801f=_0x2f801f||0xcc;return function(_0x333598){if(_0x333598){return _0x497f71[_0x39f4('0x17')](_0x2f801f);}return _0x497f71[_0x39f4('0x18')](_0x2f801f)[_0x39f4('0x19')]();};}function respondWithResult(_0x4e66cd,_0x4f138c){_0x4f138c=_0x4f138c||0xc8;return function(_0x2d1035){if(_0x2d1035){return _0x4e66cd[_0x39f4('0x18')](_0x4f138c)[_0x39f4('0x1a')](_0x2d1035);}};}function respondWithFilteredResult(_0x5eb110,_0x349f6a){return function(_0x2f9a0f){if(_0x2f9a0f){var _0x4399c8=_0x2f9a0f[_0x39f4('0x1b')],_0x453912=_0x349f6a[_0x39f4('0x1c')],_0x54eefa=_0x349f6a[_0x39f4('0x1c')]+_0x349f6a['limit'],_0x58fc2b;if(_0x54eefa>=_0x4399c8){_0x54eefa=_0x4399c8;_0x58fc2b=0xc8;}else{_0x58fc2b=0xce;}_0x5eb110[_0x39f4('0x18')](_0x58fc2b);return _0x5eb110[_0x39f4('0x1d')](_0x39f4('0x1e'),_0x453912+'-'+_0x54eefa+'/'+_0x4399c8)[_0x39f4('0x1a')](_0x2f9a0f);}return null;};}function patchUpdates(_0x698d58){return function(_0x304424){try{jsonpatch[_0x39f4('0x1f')](_0x304424,_0x698d58,!![]);}catch(_0x59f2b0){return BPromise[_0x39f4('0x20')](_0x59f2b0);}return _0x304424['save']();};}function saveUpdates(_0x59f09e,_0x457828){return function(_0x262e0a){if(_0x262e0a){return _0x262e0a['update'](_0x59f09e)[_0x39f4('0x21')](function(_0x5f4e79){return _0x5f4e79;});}return null;};}function removeEntity(_0x2754b9,_0x224794){return function(_0x4d52e4){if(_0x4d52e4){return _0x4d52e4[_0x39f4('0x22')]()['then'](function(){var _0x5d1114=_0x4d52e4[_0x39f4('0x23')]({'plain':!![]});var _0x436bd9=_0x39f4('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x436bd9,'resourceId':_0x5d1114['id']}})[_0x39f4('0x21')](function(){return _0x4d52e4;});})[_0x39f4('0x21')](function(){_0x2754b9[_0x39f4('0x18')](0xcc)[_0x39f4('0x19')]();});}};}function handleEntityNotFound(_0x2b3c91,_0xc2d7be){return function(_0x40e0cb){if(!_0x40e0cb){_0x2b3c91['sendStatus'](0x194);}return _0x40e0cb;};}function handleError(_0x2a2db3,_0x1bdbed){_0x1bdbed=_0x1bdbed||0x1f4;return function(_0x1e8371){logger[_0x39f4('0x25')](_0x1e8371[_0x39f4('0x26')]);if(_0x1e8371['name']){delete _0x1e8371[_0x39f4('0x27')];}_0x2a2db3[_0x39f4('0x18')](_0x1bdbed)[_0x39f4('0x28')](_0x1e8371);};}exports[_0x39f4('0x29')]=function(_0xd660c2,_0x1a0d23){var _0x469e5b={},_0x39669c={},_0x49ad87={'count':0x0,'rows':[]};var _0x1afa78=_[_0x39f4('0x2a')](db[_0x39f4('0x2b')][_0x39f4('0x2c')],function(_0x11d40f){return{'name':_0x11d40f[_0x39f4('0x2d')],'type':_0x11d40f[_0x39f4('0x2e')][_0x39f4('0x2f')]};});_0x39669c['model']=_[_0x39f4('0x2a')](_0x1afa78,_0x39f4('0x27'));_0x39669c[_0x39f4('0x30')]=_[_0x39f4('0x31')](_0xd660c2[_0x39f4('0x30')]);_0x39669c[_0x39f4('0x32')]=_[_0x39f4('0x33')](_0x39669c['model'],_0x39669c['query']);_0x469e5b[_0x39f4('0x34')]=_['intersection'](_0x39669c[_0x39f4('0x35')],qs['fields'](_0xd660c2[_0x39f4('0x30')][_0x39f4('0x36')]));_0x469e5b['attributes']=_0x469e5b[_0x39f4('0x34')][_0x39f4('0x37')]?_0x469e5b['attributes']:_0x39669c[_0x39f4('0x35')];if(!_0xd660c2[_0x39f4('0x30')]['hasOwnProperty'](_0x39f4('0x38'))){_0x469e5b['limit']=qs[_0x39f4('0x39')](_0xd660c2['query'][_0x39f4('0x39')]);_0x469e5b[_0x39f4('0x1c')]=qs[_0x39f4('0x1c')](_0xd660c2[_0x39f4('0x30')][_0x39f4('0x1c')]);}_0x469e5b['order']=qs[_0x39f4('0x3a')](_0xd660c2[_0x39f4('0x30')][_0x39f4('0x3a')]);_0x469e5b['where']=qs['filters'](_['pick'](_0xd660c2[_0x39f4('0x30')],_0x39669c[_0x39f4('0x32')]));if(_0xd660c2[_0x39f4('0x30')][_0x39f4('0x3b')]){_0x469e5b['where']=_[_0x39f4('0x3c')](_0x469e5b[_0x39f4('0x3d')],{'$or':_[_0x39f4('0x2a')](_0x1afa78,function(_0x2bf1a9){if(_0x2bf1a9[_0x39f4('0x2e')]!=='VIRTUAL'){var _0x2036d9={};_0x2036d9[_0x2bf1a9[_0x39f4('0x27')]]={'$like':'%'+_0xd660c2[_0x39f4('0x30')][_0x39f4('0x3b')]+'%'};return _0x2036d9;}})});}_0x469e5b=_['merge']({},_0x469e5b,_0xd660c2['options']);var _0x2464f7={'where':_0x469e5b[_0x39f4('0x3d')]};return db[_0x39f4('0x2b')]['count'](_0x2464f7)[_0x39f4('0x21')](function(_0x18a351){_0x49ad87['count']=_0x18a351;if(_0xd660c2[_0x39f4('0x30')][_0x39f4('0x3e')]){_0x469e5b[_0x39f4('0x3f')]=[{'all':!![]}];}return db[_0x39f4('0x2b')]['findAll'](_0x469e5b);})[_0x39f4('0x21')](function(_0x36fd14){_0x49ad87[_0x39f4('0x40')]=_0x36fd14;return _0x49ad87;})[_0x39f4('0x21')](respondWithFilteredResult(_0x1a0d23,_0x469e5b))[_0x39f4('0x41')](handleError(_0x1a0d23,null));};exports[_0x39f4('0x42')]=function(_0x352315,_0x1556ab){var _0x4332f6={'raw':![],'where':{'id':_0x352315[_0x39f4('0x43')]['id']}},_0x3d4edd={};_0x3d4edd['model']=_[_0x39f4('0x31')](db['JscriptyProject'][_0x39f4('0x2c')]);_0x3d4edd['query']=_[_0x39f4('0x31')](_0x352315['query']);_0x3d4edd[_0x39f4('0x32')]=_[_0x39f4('0x33')](_0x3d4edd[_0x39f4('0x35')],_0x3d4edd['query']);_0x4332f6[_0x39f4('0x34')]=_[_0x39f4('0x33')](_0x3d4edd['model'],qs[_0x39f4('0x36')](_0x352315[_0x39f4('0x30')]['fields']));_0x4332f6[_0x39f4('0x34')]=_0x4332f6['attributes'][_0x39f4('0x37')]?_0x4332f6['attributes']:_0x3d4edd[_0x39f4('0x35')];if(_0x352315[_0x39f4('0x30')][_0x39f4('0x3e')]){_0x4332f6[_0x39f4('0x3f')]=[{'all':!![]}];}_0x4332f6=_[_0x39f4('0x3c')]({},_0x4332f6,_0x352315[_0x39f4('0x44')]);return db['JscriptyProject']['find'](_0x4332f6)['then'](handleEntityNotFound(_0x1556ab,null))[_0x39f4('0x21')](respondWithResult(_0x1556ab,null))[_0x39f4('0x41')](handleError(_0x1556ab,null));};exports['create']=function(_0x439474,_0x1d764b){return db['JscriptyProject']['create'](_0x439474[_0x39f4('0x45')],{})[_0x39f4('0x21')](function(_0x579666){var _0x10e3e4=_0x439474[_0x39f4('0x46')][_0x39f4('0x23')]({'plain':!![]});if(!_0x10e3e4)throw new Error(_0x39f4('0x47'));if(_0x10e3e4[_0x39f4('0x48')]==='user'){var _0x530bb2=_0x579666[_0x39f4('0x23')]({'plain':!![]});var _0x52602a=_0x39f4('0x24');return db[_0x39f4('0x49')][_0x39f4('0x4a')]({'where':{'name':_0x52602a,'userProfileId':_0x10e3e4['userProfileId']},'raw':!![]})['then'](function(_0x3c912d){if(_0x3c912d&&_0x3c912d[_0x39f4('0x4b')]===0x0){return db[_0x39f4('0x4c')][_0x39f4('0x4d')]({'name':_0x530bb2[_0x39f4('0x27')],'resourceId':_0x530bb2['id'],'type':_0x3c912d[_0x39f4('0x27')],'sectionId':_0x3c912d['id']},{})[_0x39f4('0x21')](function(){return _0x579666;});}else{return _0x579666;}})[_0x39f4('0x41')](function(_0x1d3786){logger['error'](_0x39f4('0x4e'),_0x1d3786);throw _0x1d3786;});}return _0x579666;})[_0x39f4('0x21')](respondWithResult(_0x1d764b,0xc9))['catch'](handleError(_0x1d764b,null));};exports[_0x39f4('0x4f')]=function(_0xb2cbb7,_0x3f6592){var _0x51a78a={'where':{'id':_0xb2cbb7['params']['id']}},_0x17bbf6={};_0x17bbf6[_0x39f4('0x35')]=_[_0x39f4('0x31')](db[_0x39f4('0x2b')][_0x39f4('0x2c')]);_0x51a78a[_0x39f4('0x34')]=_['intersection'](_0x17bbf6[_0x39f4('0x35')],qs[_0x39f4('0x36')](_0xb2cbb7[_0x39f4('0x30')][_0x39f4('0x36')]));_0x51a78a['attributes']=_0x51a78a['attributes'][_0x39f4('0x37')]?_0x51a78a[_0x39f4('0x34')]:_0x17bbf6[_0x39f4('0x35')];if(_0xb2cbb7[_0x39f4('0x30')]['includeAll']){_0x51a78a['include']=[{'all':!![]}];}_0x51a78a=_[_0x39f4('0x3c')]({},_0x51a78a,_0xb2cbb7[_0x39f4('0x44')]);return db[_0x39f4('0x2b')][_0x39f4('0x4a')](_0x51a78a)[_0x39f4('0x21')](handleEntityNotFound(_0x3f6592,null))[_0x39f4('0x21')](function(_0x44e166){if(_0x44e166){var _0x41e82a=_0x44e166[_0x39f4('0x23')]({'plain':!![]});_0x41e82a=qs[_0x39f4('0x50')](_0x41e82a,['id',_0x39f4('0x51'),_0x39f4('0x52')]);_0xb2cbb7[_0x39f4('0x45')]=_['omit'](_0xb2cbb7[_0x39f4('0x45')],['id',_0x39f4('0x51'),_0x39f4('0x52')]);return db['JscriptyProject'][_0x39f4('0x4d')](_[_0x39f4('0x3c')](_0x41e82a,_0xb2cbb7[_0x39f4('0x45')]),{'include':_0xb2cbb7[_0x39f4('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x39f4('0x21')](function(_0x2fbf32){var _0x492399=_0xb2cbb7[_0x39f4('0x46')][_0x39f4('0x23')]({'plain':!![]});if(!_0x492399)throw new Error(_0x39f4('0x47'));if(_0x492399[_0x39f4('0x48')]===_0x39f4('0x46')){var _0x1ef088=_0x2fbf32['get']({'plain':!![]});var _0x4d8b2e=_0x39f4('0x24');return db['UserProfileSection'][_0x39f4('0x4a')]({'where':{'name':_0x4d8b2e,'userProfileId':_0x492399[_0x39f4('0x53')]},'raw':!![]})[_0x39f4('0x21')](function(_0x31b137){if(_0x31b137&&_0x31b137[_0x39f4('0x4b')]===0x0){return db[_0x39f4('0x4c')][_0x39f4('0x4d')]({'name':_0x1ef088[_0x39f4('0x27')],'resourceId':_0x1ef088['id'],'type':_0x31b137[_0x39f4('0x27')],'sectionId':_0x31b137['id']},{})[_0x39f4('0x21')](function(){return _0x2fbf32;});}else{return _0x2fbf32;}})[_0x39f4('0x41')](function(_0x1f01e6){logger['error'](_0x39f4('0x4e'),_0x1f01e6);throw _0x1f01e6;});}return _0x2fbf32;});}})[_0x39f4('0x21')](respondWithResult(_0x3f6592,0xc9))[_0x39f4('0x41')](handleError(_0x3f6592,null));};exports['update']=function(_0x3476d7,_0x10fb40){if(_0x3476d7[_0x39f4('0x45')]['id']){delete _0x3476d7[_0x39f4('0x45')]['id'];}return db['JscriptyProject'][_0x39f4('0x4a')]({'where':{'id':_0x3476d7[_0x39f4('0x43')]['id']}})['then'](handleEntityNotFound(_0x10fb40,null))[_0x39f4('0x21')](saveUpdates(_0x3476d7[_0x39f4('0x45')],null))[_0x39f4('0x21')](respondWithResult(_0x10fb40,null))[_0x39f4('0x41')](handleError(_0x10fb40,null));};exports[_0x39f4('0x22')]=function(_0x215c14,_0xc04acc){return db['JscriptyProject'][_0x39f4('0x4a')]({'where':{'id':_0x215c14[_0x39f4('0x43')]['id']}})[_0x39f4('0x21')](handleEntityNotFound(_0xc04acc,null))[_0x39f4('0x21')](removeEntity(_0xc04acc,null))[_0x39f4('0x41')](handleError(_0xc04acc,null));};exports[_0x39f4('0x54')]=function(_0x37b02e,_0x1855aa,_0x19703a){var _0xefd1c7={'raw':!![],'where':{}};var _0x2db1d7={};var _0x5ea14c={'count':0x0,'rows':[]};return db[_0x39f4('0x2b')]['findOne']({'where':{'id':_0x37b02e[_0x39f4('0x43')]['id']}})[_0x39f4('0x21')](handleEntityNotFound(_0x1855aa,null))[_0x39f4('0x21')](function(_0x1558bc){if(_0x1558bc){_0x2db1d7[_0x39f4('0x35')]=_[_0x39f4('0x31')](db[_0x39f4('0x55')][_0x39f4('0x2c')]);_0x2db1d7[_0x39f4('0x30')]=_['keys'](_0x37b02e[_0x39f4('0x30')]);_0x2db1d7[_0x39f4('0x32')]=_['intersection'](_0x2db1d7[_0x39f4('0x35')],_0x2db1d7[_0x39f4('0x30')]);_0xefd1c7[_0x39f4('0x34')]=_[_0x39f4('0x33')](_0x2db1d7[_0x39f4('0x35')],qs[_0x39f4('0x36')](_0x37b02e[_0x39f4('0x30')][_0x39f4('0x36')]));_0xefd1c7[_0x39f4('0x34')]=_0xefd1c7[_0x39f4('0x34')]['length']?_0xefd1c7[_0x39f4('0x34')]:_0x2db1d7['model'];if(!_0x37b02e[_0x39f4('0x30')][_0x39f4('0x56')](_0x39f4('0x38'))){_0xefd1c7['limit']=qs[_0x39f4('0x39')](_0x37b02e[_0x39f4('0x30')][_0x39f4('0x39')]);_0xefd1c7['offset']=qs[_0x39f4('0x1c')](_0x37b02e['query'][_0x39f4('0x1c')]);}_0xefd1c7[_0x39f4('0x57')]=qs[_0x39f4('0x3a')](_0x37b02e[_0x39f4('0x30')]['sort']);_0xefd1c7[_0x39f4('0x3d')]=qs[_0x39f4('0x32')](_[_0x39f4('0x58')](_0x37b02e[_0x39f4('0x30')],_0x2db1d7[_0x39f4('0x32')]));_0xefd1c7[_0x39f4('0x3d')][_0x39f4('0x59')]=_0x1558bc['id'];if(_0x37b02e[_0x39f4('0x30')][_0x39f4('0x3b')]){_0xefd1c7[_0x39f4('0x3d')]=_[_0x39f4('0x3c')](_0xefd1c7[_0x39f4('0x3d')],{'$or':_[_0x39f4('0x2a')](_0xefd1c7['attributes'],function(_0xa5b0dd){var _0x25c051={};_0x25c051[_0xa5b0dd]={'$like':'%'+_0x37b02e[_0x39f4('0x30')][_0x39f4('0x3b')]+'%'};return _0x25c051;})});}_0xefd1c7=_[_0x39f4('0x3c')]({},_0xefd1c7,_0x37b02e[_0x39f4('0x44')]);return db['JscriptySessionReport'][_0x39f4('0x1b')]({'where':_0xefd1c7[_0x39f4('0x3d')]})['then'](function(_0x1492f7){_0x5ea14c[_0x39f4('0x1b')]=_0x1492f7;if(_0x37b02e[_0x39f4('0x30')][_0x39f4('0x3e')]){_0xefd1c7[_0x39f4('0x3f')]=[{'all':!![]}];}return db[_0x39f4('0x55')]['findAll'](_0xefd1c7);})[_0x39f4('0x21')](function(_0x41d794){_0x5ea14c[_0x39f4('0x40')]=_0x41d794;return _0x5ea14c;});}})[_0x39f4('0x21')](respondWithFilteredResult(_0x1855aa,_0xefd1c7))[_0x39f4('0x41')](handleError(_0x1855aa,null));};exports['getAnswers']=function(_0x18ba14,_0x28f13f,_0xb6d588){var _0x5e578d={'raw':!![],'where':{}};var _0x32c605={};var _0x100e0b={'count':0x0,'rows':[]};return db[_0x39f4('0x2b')][_0x39f4('0x5a')]({'where':{'id':_0x18ba14[_0x39f4('0x43')]['id']}})[_0x39f4('0x21')](handleEntityNotFound(_0x28f13f,null))[_0x39f4('0x21')](function(_0x3a3240){if(_0x3a3240){_0x32c605[_0x39f4('0x35')]=_[_0x39f4('0x31')](db['JscriptyAnswerReport'][_0x39f4('0x2c')]);_0x32c605['query']=_[_0x39f4('0x31')](_0x18ba14[_0x39f4('0x30')]);_0x32c605[_0x39f4('0x32')]=_['intersection'](_0x32c605['model'],_0x32c605[_0x39f4('0x30')]);_0x5e578d[_0x39f4('0x34')]=_[_0x39f4('0x33')](_0x32c605[_0x39f4('0x35')],qs[_0x39f4('0x36')](_0x18ba14[_0x39f4('0x30')][_0x39f4('0x36')]));_0x5e578d[_0x39f4('0x34')]=_0x5e578d['attributes']['length']?_0x5e578d[_0x39f4('0x34')]:_0x32c605['model'];if(!_0x18ba14[_0x39f4('0x30')]['hasOwnProperty']('nolimit')){_0x5e578d['limit']=qs['limit'](_0x18ba14['query'][_0x39f4('0x39')]);_0x5e578d[_0x39f4('0x1c')]=qs[_0x39f4('0x1c')](_0x18ba14[_0x39f4('0x30')][_0x39f4('0x1c')]);}_0x5e578d['order']=qs[_0x39f4('0x3a')](_0x18ba14[_0x39f4('0x30')]['sort']);_0x5e578d[_0x39f4('0x3d')]=qs[_0x39f4('0x32')](_[_0x39f4('0x58')](_0x18ba14[_0x39f4('0x30')],_0x32c605[_0x39f4('0x32')]));_0x5e578d['where'][_0x39f4('0x59')]=_0x3a3240['id'];if(_0x18ba14[_0x39f4('0x30')][_0x39f4('0x3b')]){_0x5e578d[_0x39f4('0x3d')]=_[_0x39f4('0x3c')](_0x5e578d[_0x39f4('0x3d')],{'$or':_[_0x39f4('0x2a')](_0x5e578d[_0x39f4('0x34')],function(_0x27b83d){var _0x54b8ee={};_0x54b8ee[_0x27b83d]={'$like':'%'+_0x18ba14['query'][_0x39f4('0x3b')]+'%'};return _0x54b8ee;})});}_0x5e578d=_[_0x39f4('0x3c')]({},_0x5e578d,_0x18ba14[_0x39f4('0x44')]);return db[_0x39f4('0x5b')][_0x39f4('0x1b')]({'where':_0x5e578d[_0x39f4('0x3d')]})[_0x39f4('0x21')](function(_0x34075b){_0x100e0b[_0x39f4('0x1b')]=_0x34075b;if(_0x18ba14[_0x39f4('0x30')][_0x39f4('0x3e')]){_0x5e578d[_0x39f4('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x39f4('0x5c')](_0x5e578d);})[_0x39f4('0x21')](function(_0x45f0b9){_0x100e0b[_0x39f4('0x40')]=_0x45f0b9;return _0x100e0b;});}})['then'](respondWithFilteredResult(_0x28f13f,_0x5e578d))[_0x39f4('0x41')](handleError(_0x28f13f,null));};function char(_0x52c6d4){return _0x39f4('0x5d')===typeof _0x52c6d4?String[_0x39f4('0x5e')][_0x39f4('0x1f')](null,arguments):_0x52c6d4;}function needsEncapsulation(_0x5378da){return!!_0x5378da&&(_0x5378da[_0x39f4('0x5f')]()['indexOf'](char(0xd))>=0x0||_0x5378da[_0x39f4('0x5f')]()[_0x39f4('0x60')](char(0xa))>=0x0||_0x5378da[_0x39f4('0x5f')]()[_0x39f4('0x60')](char(0x2c))>=0x0||_0x5378da[_0x39f4('0x5f')]()[_0x39f4('0x60')](char(0x22))>=0x0);}function encapsulate(_0x4ad610){var _0x8d16e=char(0x22),_0x5695d9='\x5c'+char(0x22),_0xbd0e7e=_0x4ad610[_0x39f4('0x5f')]()[_0x39f4('0x61')](new RegExp(_0x8d16e,'g'),_0x5695d9);return _0x8d16e+_0xbd0e7e+_0x8d16e;}exports['getSummary']=function(_0x44a671,_0x23cdc8,_0x3538e3){var _0xe3d10,_0x1abe7f;var _0x166283={'where':{'ProjectId':_0x44a671[_0x39f4('0x43')]['id']}};if(_0x44a671[_0x39f4('0x30')][_0x39f4('0x62')]){_0x166283['where'][_0x39f4('0x63')]=JSON['parse'](_0x44a671[_0x39f4('0x30')]['startTime']);}return db['JscriptySessionReport'][_0x39f4('0x5c')](_0x166283)['then'](handleEntityNotFound(_0x23cdc8,null))[_0x39f4('0x21')](function(_0x3e4799){if(_0x3e4799){_0xe3d10=_0x3e4799;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_['map'](_0xe3d10,'id')},'ProjectId':_0x44a671[_0x39f4('0x43')]['id']},'order':'-createdAt'});}})[_0x39f4('0x21')](handleEntityNotFound(_0x23cdc8,null))[_0x39f4('0x21')](function(_0x5af2c5){if(_0x5af2c5){_0x1abe7f=_0x5af2c5;var _0x497c57={};for(var _0x347606=0x0,_0x480227=_0x1abe7f[_0x39f4('0x37')];_0x347606<_0x480227;_0x347606++){if(!_0x497c57[_0x39f4('0x56')](_0x1abe7f[_0x347606]['questionId'])){_0x497c57[_0x1abe7f[_0x347606][_0x39f4('0x64')]]=needsEncapsulation(_0x1abe7f[_0x347606][_0x39f4('0x65')])?encapsulate(_0x1abe7f[_0x347606][_0x39f4('0x65')]):_0x1abe7f[_0x347606]['question'];}}var _0x135586=[],_0x2011e7={};for(var _0x177705=0x0,_0x354531=_0xe3d10[_0x39f4('0x37')];_0x177705<_0x354531;_0x177705++){_0x2011e7={'ProjectId':_0x44a671[_0x39f4('0x43')]['id'],'SessionId':_0xe3d10[_0x177705]['id'],'StartTime':moment(_0xe3d10[_0x177705]['starttime'])['format'](_0x39f4('0x66'))};for(var _0x4a09ce=0x0,_0x531f4f=_0x1abe7f[_0x39f4('0x37')];_0x4a09ce<_0x531f4f;_0x4a09ce++){if(_0x1abe7f[_0x4a09ce][_0x39f4('0x67')]==_0xe3d10[_0x177705]['id']&&_0x497c57[_0x39f4('0x56')](_0x1abe7f[_0x4a09ce][_0x39f4('0x64')])){_0x2011e7[_0x497c57[_0x1abe7f[_0x4a09ce][_0x39f4('0x64')]]]=_0x1abe7f[_0x4a09ce][_0x39f4('0x68')];}}for(var _0x3c70c9 in _0x497c57){if(!_0x2011e7[_0x39f4('0x56')](_0x497c57[_0x3c70c9])){_0x2011e7[_0x497c57[_0x3c70c9]]=null;}}_0x135586[_0x39f4('0x69')](_0x2011e7);}return _0x135586;}})['then'](function(_0x5f407f){if(!_[_0x39f4('0x6a')](_0x5f407f)){var _0xa7dba9=toCsv(_0x5f407f);var _0x18c18a=Date[_0x39f4('0x6b')]();fs[_0x39f4('0x6c')](util[_0x39f4('0x6d')](_0x39f4('0x6e'),_0x44a671[_0x39f4('0x43')]['id'],_0x18c18a),_0xa7dba9);_0x23cdc8[_0x39f4('0x6f')](_0x39f4('0x70'),'attachment;\x20filename='+util[_0x39f4('0x6d')]('Jscripty_Project_%d_Summary_%s.csv',_0x44a671[_0x39f4('0x43')]['id'],_0x18c18a));_0x23cdc8['setHeader']('Content-type',_0x39f4('0x71'));return _0x23cdc8[_0x39f4('0x72')](util['format'](_0x39f4('0x6e'),_0x44a671[_0x39f4('0x43')]['id'],_0x18c18a));}else{return _0x23cdc8[_0x39f4('0x17')](0xcc);}})['catch'](handleError(_0x23cdc8,null));}; \ No newline at end of file +var _0x7745=['update','then','destroy','Projects','end','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','keys','fields','include','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','UserProfileSection','autoAssociation','getSessions','JscriptySessionReport','hasOwnProperty','pick','getAnswers','findOne','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x35651a,_0x397386){var _0x3e0f15=function(_0x138fc6){while(--_0x138fc6){_0x35651a['push'](_0x35651a['shift']());}};_0x3e0f15(++_0x397386);}(_0x7745,0x1c8));var _0x5774=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x7745[_0x484c03];return _0x294127;};'use strict';var pdf=require(_0x5774('0x0'));var emlformat=require(_0x5774('0x1'));var rimraf=require(_0x5774('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5774('0x3'));var rp=require(_0x5774('0x4'));var moment=require(_0x5774('0x5'));var BPromise=require(_0x5774('0x6'));var Mustache=require(_0x5774('0x7'));var util=require(_0x5774('0x8'));var path=require(_0x5774('0x9'));var sox=require(_0x5774('0xa'));var csv=require(_0x5774('0xb'));var ejs=require(_0x5774('0xc'));var fs=require('fs');var _=require(_0x5774('0xd'));var squel=require(_0x5774('0xe'));var crypto=require(_0x5774('0xf'));var jsforce=require(_0x5774('0x10'));var deskjs=require(_0x5774('0x11'));var toCsv=require(_0x5774('0xb'));var querystring=require(_0x5774('0x12'));var Papa=require(_0x5774('0x13'));var Redis=require(_0x5774('0x14'));var authService=require(_0x5774('0x15'));var qs=require(_0x5774('0x16'));var as=require(_0x5774('0x17'));var hardwareService=require(_0x5774('0x18'));var logger=require(_0x5774('0x19'))(_0x5774('0x1a'));var utils=require(_0x5774('0x1b'));var config=require(_0x5774('0x1c'));var db=require(_0x5774('0x1d'))['db'];function respondWithStatusCode(_0x580242,_0x594363){_0x594363=_0x594363||0xcc;return function(_0x5a0617){if(_0x5a0617){return _0x580242[_0x5774('0x1e')](_0x594363);}return _0x580242[_0x5774('0x1f')](_0x594363)['end']();};}function respondWithResult(_0x1eaade,_0x22908a){_0x22908a=_0x22908a||0xc8;return function(_0x3fcabd){if(_0x3fcabd){return _0x1eaade[_0x5774('0x1f')](_0x22908a)[_0x5774('0x20')](_0x3fcabd);}};}function respondWithFilteredResult(_0x5cdfb0,_0x141441){return function(_0x26ae1c){if(_0x26ae1c){var _0x5845a7=_0x26ae1c['count'],_0x3530b2=_0x141441[_0x5774('0x21')],_0x137505=_0x141441[_0x5774('0x21')]+_0x141441[_0x5774('0x22')],_0x5a8ed2;if(_0x137505>=_0x5845a7){_0x137505=_0x5845a7;_0x5a8ed2=0xc8;}else{_0x5a8ed2=0xce;}_0x5cdfb0[_0x5774('0x1f')](_0x5a8ed2);return _0x5cdfb0[_0x5774('0x23')](_0x5774('0x24'),_0x3530b2+'-'+_0x137505+'/'+_0x5845a7)[_0x5774('0x20')](_0x26ae1c);}return null;};}function patchUpdates(_0x28b473){return function(_0x310cfb){try{jsonpatch[_0x5774('0x25')](_0x310cfb,_0x28b473,!![]);}catch(_0x1cf2c9){return BPromise[_0x5774('0x26')](_0x1cf2c9);}return _0x310cfb[_0x5774('0x27')]();};}function saveUpdates(_0x4fcda3,_0xd13d42){return function(_0x420fd6){if(_0x420fd6){return _0x420fd6[_0x5774('0x28')](_0x4fcda3)[_0x5774('0x29')](function(_0x189e49){return _0x189e49;});}return null;};}function removeEntity(_0x2fc934,_0x5b0f8f){return function(_0x24fc83){if(_0x24fc83){return _0x24fc83[_0x5774('0x2a')]()[_0x5774('0x29')](function(){var _0x2510ce=_0x24fc83['get']({'plain':!![]});var _0x854db1=_0x5774('0x2b');return db['UserProfileResource'][_0x5774('0x2a')]({'where':{'type':_0x854db1,'resourceId':_0x2510ce['id']}})[_0x5774('0x29')](function(){return _0x24fc83;});})[_0x5774('0x29')](function(){_0x2fc934[_0x5774('0x1f')](0xcc)[_0x5774('0x2c')]();});}};}function handleEntityNotFound(_0x46d2ea,_0x38b377){return function(_0x217ff5){if(!_0x217ff5){_0x46d2ea['sendStatus'](0x194);}return _0x217ff5;};}function handleError(_0x2e233e,_0x51b330){_0x51b330=_0x51b330||0x1f4;return function(_0x1bc26b){logger[_0x5774('0x2d')](_0x1bc26b[_0x5774('0x2e')]);if(_0x1bc26b[_0x5774('0x2f')]){delete _0x1bc26b[_0x5774('0x2f')];}_0x2e233e['status'](_0x51b330)[_0x5774('0x30')](_0x1bc26b);};}exports[_0x5774('0x31')]=function(_0x420e2e,_0x3d7b95){var _0x2c370f={},_0x683605={},_0x918977={'count':0x0,'rows':[]};var _0x2dc951=_[_0x5774('0x32')](db[_0x5774('0x33')][_0x5774('0x34')],function(_0x5456fc){return{'name':_0x5456fc[_0x5774('0x35')],'type':_0x5456fc[_0x5774('0x36')]['key']};});_0x683605[_0x5774('0x37')]=_[_0x5774('0x32')](_0x2dc951,_0x5774('0x2f'));_0x683605[_0x5774('0x38')]=_['keys'](_0x420e2e['query']);_0x683605[_0x5774('0x39')]=_['intersection'](_0x683605[_0x5774('0x37')],_0x683605[_0x5774('0x38')]);_0x2c370f[_0x5774('0x3a')]=_[_0x5774('0x3b')](_0x683605[_0x5774('0x37')],qs['fields'](_0x420e2e[_0x5774('0x38')]['fields']));_0x2c370f['attributes']=_0x2c370f['attributes'][_0x5774('0x3c')]?_0x2c370f[_0x5774('0x3a')]:_0x683605[_0x5774('0x37')];if(!_0x420e2e[_0x5774('0x38')]['hasOwnProperty'](_0x5774('0x3d'))){_0x2c370f['limit']=qs['limit'](_0x420e2e[_0x5774('0x38')][_0x5774('0x22')]);_0x2c370f[_0x5774('0x21')]=qs[_0x5774('0x21')](_0x420e2e[_0x5774('0x38')][_0x5774('0x21')]);}_0x2c370f[_0x5774('0x3e')]=qs[_0x5774('0x3f')](_0x420e2e[_0x5774('0x38')][_0x5774('0x3f')]);_0x2c370f[_0x5774('0x40')]=qs[_0x5774('0x39')](_['pick'](_0x420e2e[_0x5774('0x38')],_0x683605['filters']));if(_0x420e2e[_0x5774('0x38')][_0x5774('0x41')]){_0x2c370f['where']=_[_0x5774('0x42')](_0x2c370f[_0x5774('0x40')],{'$or':_[_0x5774('0x32')](_0x2dc951,function(_0xae993a){if(_0xae993a[_0x5774('0x36')]!==_0x5774('0x43')){var _0x171daa={};_0x171daa[_0xae993a[_0x5774('0x2f')]]={'$like':'%'+_0x420e2e[_0x5774('0x38')][_0x5774('0x41')]+'%'};return _0x171daa;}})});}_0x2c370f=_[_0x5774('0x42')]({},_0x2c370f,_0x420e2e[_0x5774('0x44')]);var _0x20713b={'where':_0x2c370f['where']};return db[_0x5774('0x33')]['count'](_0x20713b)[_0x5774('0x29')](function(_0x2170b7){_0x918977[_0x5774('0x45')]=_0x2170b7;if(_0x420e2e['query'][_0x5774('0x46')]){_0x2c370f['include']=[{'all':!![]}];}return db[_0x5774('0x33')][_0x5774('0x47')](_0x2c370f);})[_0x5774('0x29')](function(_0x1689cd){_0x918977[_0x5774('0x48')]=_0x1689cd;return _0x918977;})[_0x5774('0x29')](respondWithFilteredResult(_0x3d7b95,_0x2c370f))[_0x5774('0x49')](handleError(_0x3d7b95,null));};exports['show']=function(_0x4c5cd3,_0x4eae87){var _0x5d155a={'raw':![],'where':{'id':_0x4c5cd3['params']['id']}},_0x332514={};_0x332514['model']=_[_0x5774('0x4a')](db['JscriptyProject'][_0x5774('0x34')]);_0x332514[_0x5774('0x38')]=_[_0x5774('0x4a')](_0x4c5cd3[_0x5774('0x38')]);_0x332514[_0x5774('0x39')]=_[_0x5774('0x3b')](_0x332514[_0x5774('0x37')],_0x332514[_0x5774('0x38')]);_0x5d155a[_0x5774('0x3a')]=_['intersection'](_0x332514[_0x5774('0x37')],qs[_0x5774('0x4b')](_0x4c5cd3[_0x5774('0x38')]['fields']));_0x5d155a[_0x5774('0x3a')]=_0x5d155a[_0x5774('0x3a')]['length']?_0x5d155a[_0x5774('0x3a')]:_0x332514[_0x5774('0x37')];if(_0x4c5cd3[_0x5774('0x38')][_0x5774('0x46')]){_0x5d155a[_0x5774('0x4c')]=[{'all':!![]}];}_0x5d155a=_['merge']({},_0x5d155a,_0x4c5cd3['options']);return db[_0x5774('0x33')]['find'](_0x5d155a)[_0x5774('0x29')](handleEntityNotFound(_0x4eae87,null))[_0x5774('0x29')](respondWithResult(_0x4eae87,null))[_0x5774('0x49')](handleError(_0x4eae87,null));};exports['create']=function(_0x12a444,_0x39bd85){return db[_0x5774('0x33')]['create'](_0x12a444[_0x5774('0x4d')],{})[_0x5774('0x29')](function(_0x5bde93){var _0x4e1e71=_0x12a444[_0x5774('0x4e')][_0x5774('0x4f')]({'plain':!![]});if(!_0x4e1e71)throw new Error(_0x5774('0x50'));if(_0x4e1e71[_0x5774('0x51')]==='user'){var _0x1da1e2=_0x5bde93['get']({'plain':!![]});var _0x5c1ede=_0x5774('0x2b');return db['UserProfileSection'][_0x5774('0x52')]({'where':{'name':_0x5c1ede,'userProfileId':_0x4e1e71[_0x5774('0x53')]},'raw':!![]})['then'](function(_0x599a23){if(_0x599a23&&_0x599a23['autoAssociation']===0x0){return db[_0x5774('0x54')][_0x5774('0x55')]({'name':_0x1da1e2[_0x5774('0x2f')],'resourceId':_0x1da1e2['id'],'type':_0x599a23['name'],'sectionId':_0x599a23['id']},{})[_0x5774('0x29')](function(){return _0x5bde93;});}else{return _0x5bde93;}})[_0x5774('0x49')](function(_0x54e31e){logger['error'](_0x5774('0x56'),_0x54e31e);throw _0x54e31e;});}return _0x5bde93;})['then'](respondWithResult(_0x39bd85,0xc9))[_0x5774('0x49')](handleError(_0x39bd85,null));};exports[_0x5774('0x57')]=function(_0x27586b,_0x54bd89){var _0x484e6e={'where':{'id':_0x27586b[_0x5774('0x58')]['id']}},_0x32bcf1={};_0x32bcf1[_0x5774('0x37')]=_['keys'](db[_0x5774('0x33')]['rawAttributes']);_0x484e6e[_0x5774('0x3a')]=_['intersection'](_0x32bcf1['model'],qs[_0x5774('0x4b')](_0x27586b['query'][_0x5774('0x4b')]));_0x484e6e[_0x5774('0x3a')]=_0x484e6e[_0x5774('0x3a')][_0x5774('0x3c')]?_0x484e6e[_0x5774('0x3a')]:_0x32bcf1[_0x5774('0x37')];if(_0x27586b['query'][_0x5774('0x46')]){_0x484e6e[_0x5774('0x4c')]=[{'all':!![]}];}_0x484e6e=_[_0x5774('0x42')]({},_0x484e6e,_0x27586b[_0x5774('0x44')]);return db[_0x5774('0x33')][_0x5774('0x52')](_0x484e6e)[_0x5774('0x29')](handleEntityNotFound(_0x54bd89,null))['then'](function(_0x2ab49e){if(_0x2ab49e){var _0x2fc02d=_0x2ab49e[_0x5774('0x4f')]({'plain':!![]});_0x2fc02d=qs['omit'](_0x2fc02d,['id',_0x5774('0x59'),_0x5774('0x5a')]);_0x27586b['body']=_[_0x5774('0x5b')](_0x27586b[_0x5774('0x4d')],['id',_0x5774('0x59'),_0x5774('0x5a')]);return db[_0x5774('0x33')]['create'](_['merge'](_0x2fc02d,_0x27586b[_0x5774('0x4d')]),{'include':_0x27586b[_0x5774('0x38')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x43bfa9){var _0x3009dd=_0x27586b[_0x5774('0x4e')][_0x5774('0x4f')]({'plain':!![]});if(!_0x3009dd)throw new Error(_0x5774('0x50'));if(_0x3009dd[_0x5774('0x51')]===_0x5774('0x4e')){var _0x4bab7b=_0x43bfa9[_0x5774('0x4f')]({'plain':!![]});var _0x3a186a=_0x5774('0x2b');return db[_0x5774('0x5c')][_0x5774('0x52')]({'where':{'name':_0x3a186a,'userProfileId':_0x3009dd[_0x5774('0x53')]},'raw':!![]})[_0x5774('0x29')](function(_0x2a0705){if(_0x2a0705&&_0x2a0705[_0x5774('0x5d')]===0x0){return db[_0x5774('0x54')][_0x5774('0x55')]({'name':_0x4bab7b['name'],'resourceId':_0x4bab7b['id'],'type':_0x2a0705[_0x5774('0x2f')],'sectionId':_0x2a0705['id']},{})[_0x5774('0x29')](function(){return _0x43bfa9;});}else{return _0x43bfa9;}})['catch'](function(_0x5db1dd){logger[_0x5774('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5db1dd);throw _0x5db1dd;});}return _0x43bfa9;});}})[_0x5774('0x29')](respondWithResult(_0x54bd89,0xc9))[_0x5774('0x49')](handleError(_0x54bd89,null));};exports[_0x5774('0x28')]=function(_0xe6bab5,_0x4f75ba){if(_0xe6bab5[_0x5774('0x4d')]['id']){delete _0xe6bab5['body']['id'];}return db[_0x5774('0x33')]['find']({'where':{'id':_0xe6bab5['params']['id']}})[_0x5774('0x29')](handleEntityNotFound(_0x4f75ba,null))[_0x5774('0x29')](saveUpdates(_0xe6bab5[_0x5774('0x4d')],null))[_0x5774('0x29')](respondWithResult(_0x4f75ba,null))[_0x5774('0x49')](handleError(_0x4f75ba,null));};exports[_0x5774('0x2a')]=function(_0x2c57af,_0x44f874){return db[_0x5774('0x33')]['find']({'where':{'id':_0x2c57af[_0x5774('0x58')]['id']}})[_0x5774('0x29')](handleEntityNotFound(_0x44f874,null))[_0x5774('0x29')](removeEntity(_0x44f874,null))[_0x5774('0x49')](handleError(_0x44f874,null));};exports[_0x5774('0x5e')]=function(_0x4f6e10,_0x5d4b3d,_0x23717a){var _0x13612c={'raw':!![],'where':{}};var _0x37cb01={};var _0x1db27c={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x4f6e10[_0x5774('0x58')]['id']}})[_0x5774('0x29')](handleEntityNotFound(_0x5d4b3d,null))[_0x5774('0x29')](function(_0x147dd5){if(_0x147dd5){_0x37cb01['model']=_['keys'](db[_0x5774('0x5f')]['rawAttributes']);_0x37cb01['query']=_[_0x5774('0x4a')](_0x4f6e10[_0x5774('0x38')]);_0x37cb01[_0x5774('0x39')]=_[_0x5774('0x3b')](_0x37cb01['model'],_0x37cb01['query']);_0x13612c[_0x5774('0x3a')]=_[_0x5774('0x3b')](_0x37cb01[_0x5774('0x37')],qs[_0x5774('0x4b')](_0x4f6e10[_0x5774('0x38')][_0x5774('0x4b')]));_0x13612c[_0x5774('0x3a')]=_0x13612c[_0x5774('0x3a')][_0x5774('0x3c')]?_0x13612c['attributes']:_0x37cb01[_0x5774('0x37')];if(!_0x4f6e10[_0x5774('0x38')][_0x5774('0x60')](_0x5774('0x3d'))){_0x13612c[_0x5774('0x22')]=qs['limit'](_0x4f6e10['query'][_0x5774('0x22')]);_0x13612c[_0x5774('0x21')]=qs[_0x5774('0x21')](_0x4f6e10[_0x5774('0x38')][_0x5774('0x21')]);}_0x13612c[_0x5774('0x3e')]=qs['sort'](_0x4f6e10[_0x5774('0x38')]['sort']);_0x13612c[_0x5774('0x40')]=qs[_0x5774('0x39')](_[_0x5774('0x61')](_0x4f6e10[_0x5774('0x38')],_0x37cb01[_0x5774('0x39')]));_0x13612c['where']['ProjectId']=_0x147dd5['id'];if(_0x4f6e10[_0x5774('0x38')][_0x5774('0x41')]){_0x13612c[_0x5774('0x40')]=_[_0x5774('0x42')](_0x13612c[_0x5774('0x40')],{'$or':_[_0x5774('0x32')](_0x13612c[_0x5774('0x3a')],function(_0x156bbb){var _0x37fca6={};_0x37fca6[_0x156bbb]={'$like':'%'+_0x4f6e10[_0x5774('0x38')][_0x5774('0x41')]+'%'};return _0x37fca6;})});}_0x13612c=_[_0x5774('0x42')]({},_0x13612c,_0x4f6e10[_0x5774('0x44')]);return db[_0x5774('0x5f')][_0x5774('0x45')]({'where':_0x13612c['where']})['then'](function(_0x47556e){_0x1db27c[_0x5774('0x45')]=_0x47556e;if(_0x4f6e10[_0x5774('0x38')]['includeAll']){_0x13612c[_0x5774('0x4c')]=[{'all':!![]}];}return db[_0x5774('0x5f')][_0x5774('0x47')](_0x13612c);})[_0x5774('0x29')](function(_0x314005){_0x1db27c[_0x5774('0x48')]=_0x314005;return _0x1db27c;});}})[_0x5774('0x29')](respondWithFilteredResult(_0x5d4b3d,_0x13612c))[_0x5774('0x49')](handleError(_0x5d4b3d,null));};exports[_0x5774('0x62')]=function(_0xf8c9d6,_0x2dcca3,_0x27cff7){var _0x1d29e3={'raw':!![],'where':{}};var _0x4725c0={};var _0x240633={'count':0x0,'rows':[]};return db[_0x5774('0x33')][_0x5774('0x63')]({'where':{'id':_0xf8c9d6[_0x5774('0x58')]['id']}})['then'](handleEntityNotFound(_0x2dcca3,null))['then'](function(_0x422ff2){if(_0x422ff2){_0x4725c0[_0x5774('0x37')]=_['keys'](db['JscriptyAnswerReport'][_0x5774('0x34')]);_0x4725c0[_0x5774('0x38')]=_[_0x5774('0x4a')](_0xf8c9d6[_0x5774('0x38')]);_0x4725c0[_0x5774('0x39')]=_['intersection'](_0x4725c0['model'],_0x4725c0[_0x5774('0x38')]);_0x1d29e3[_0x5774('0x3a')]=_['intersection'](_0x4725c0[_0x5774('0x37')],qs[_0x5774('0x4b')](_0xf8c9d6['query'][_0x5774('0x4b')]));_0x1d29e3['attributes']=_0x1d29e3[_0x5774('0x3a')]['length']?_0x1d29e3[_0x5774('0x3a')]:_0x4725c0['model'];if(!_0xf8c9d6[_0x5774('0x38')][_0x5774('0x60')](_0x5774('0x3d'))){_0x1d29e3[_0x5774('0x22')]=qs[_0x5774('0x22')](_0xf8c9d6['query'][_0x5774('0x22')]);_0x1d29e3[_0x5774('0x21')]=qs['offset'](_0xf8c9d6[_0x5774('0x38')][_0x5774('0x21')]);}_0x1d29e3[_0x5774('0x3e')]=qs[_0x5774('0x3f')](_0xf8c9d6[_0x5774('0x38')][_0x5774('0x3f')]);_0x1d29e3[_0x5774('0x40')]=qs[_0x5774('0x39')](_[_0x5774('0x61')](_0xf8c9d6['query'],_0x4725c0[_0x5774('0x39')]));_0x1d29e3[_0x5774('0x40')]['ProjectId']=_0x422ff2['id'];if(_0xf8c9d6[_0x5774('0x38')][_0x5774('0x41')]){_0x1d29e3[_0x5774('0x40')]=_[_0x5774('0x42')](_0x1d29e3[_0x5774('0x40')],{'$or':_[_0x5774('0x32')](_0x1d29e3[_0x5774('0x3a')],function(_0x350bbf){var _0x17b806={};_0x17b806[_0x350bbf]={'$like':'%'+_0xf8c9d6[_0x5774('0x38')][_0x5774('0x41')]+'%'};return _0x17b806;})});}_0x1d29e3=_[_0x5774('0x42')]({},_0x1d29e3,_0xf8c9d6[_0x5774('0x44')]);return db[_0x5774('0x64')]['count']({'where':_0x1d29e3[_0x5774('0x40')]})[_0x5774('0x29')](function(_0x24ddd0){_0x240633[_0x5774('0x45')]=_0x24ddd0;if(_0xf8c9d6[_0x5774('0x38')][_0x5774('0x46')]){_0x1d29e3[_0x5774('0x4c')]=[{'all':!![]}];}return db[_0x5774('0x64')]['findAll'](_0x1d29e3);})['then'](function(_0x882cfd){_0x240633[_0x5774('0x48')]=_0x882cfd;return _0x240633;});}})[_0x5774('0x29')](respondWithFilteredResult(_0x2dcca3,_0x1d29e3))[_0x5774('0x49')](handleError(_0x2dcca3,null));};function char(_0x27b8e6){return _0x5774('0x65')===typeof _0x27b8e6?String['fromCharCode']['apply'](null,arguments):_0x27b8e6;}function needsEncapsulation(_0x2c6108){return!!_0x2c6108&&(_0x2c6108[_0x5774('0x66')]()[_0x5774('0x67')](char(0xd))>=0x0||_0x2c6108[_0x5774('0x66')]()[_0x5774('0x67')](char(0xa))>=0x0||_0x2c6108[_0x5774('0x66')]()[_0x5774('0x67')](char(0x2c))>=0x0||_0x2c6108[_0x5774('0x66')]()[_0x5774('0x67')](char(0x22))>=0x0);}function encapsulate(_0x169ab3){var _0x5238bd=char(0x22),_0x19cc40='\x5c'+char(0x22),_0x231fce=_0x169ab3[_0x5774('0x66')]()[_0x5774('0x68')](new RegExp(_0x5238bd,'g'),_0x19cc40);return _0x5238bd+_0x231fce+_0x5238bd;}exports[_0x5774('0x69')]=function(_0x42b37d,_0x433268,_0x1a9a4d){var _0x2adf33,_0x5c680f;var _0x4c029d={'where':{'ProjectId':_0x42b37d[_0x5774('0x58')]['id']}};if(_0x42b37d[_0x5774('0x38')][_0x5774('0x6a')]){_0x4c029d[_0x5774('0x40')][_0x5774('0x6b')]=JSON['parse'](_0x42b37d[_0x5774('0x38')][_0x5774('0x6a')]);}return db[_0x5774('0x5f')][_0x5774('0x47')](_0x4c029d)[_0x5774('0x29')](handleEntityNotFound(_0x433268,null))[_0x5774('0x29')](function(_0x45ba6f){if(_0x45ba6f){_0x2adf33=_0x45ba6f;return db[_0x5774('0x6c')]['findAll']({'where':{'SessionId':{'$in':_[_0x5774('0x32')](_0x2adf33,'id')},'ProjectId':_0x42b37d['params']['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x433268,null))[_0x5774('0x29')](function(_0x35abc5){if(_0x35abc5){_0x5c680f=_0x35abc5;var _0x5336e9={};for(var _0x1d26fe=0x0,_0x36d2bb=_0x5c680f[_0x5774('0x3c')];_0x1d26fe<_0x36d2bb;_0x1d26fe++){if(!_0x5336e9[_0x5774('0x60')](_0x5c680f[_0x1d26fe]['questionId'])){_0x5336e9[_0x5c680f[_0x1d26fe][_0x5774('0x6d')]]=needsEncapsulation(_0x5c680f[_0x1d26fe][_0x5774('0x6e')])?encapsulate(_0x5c680f[_0x1d26fe][_0x5774('0x6e')]):_0x5c680f[_0x1d26fe][_0x5774('0x6e')];}}var _0x25c2e4=[],_0xda33f4={};for(var _0x1449e9=0x0,_0x525861=_0x2adf33[_0x5774('0x3c')];_0x1449e9<_0x525861;_0x1449e9++){_0xda33f4={'ProjectId':_0x42b37d[_0x5774('0x58')]['id'],'SessionId':_0x2adf33[_0x1449e9]['id'],'StartTime':moment(_0x2adf33[_0x1449e9]['starttime'])[_0x5774('0x6f')](_0x5774('0x70'))};for(var _0x137f18=0x0,_0x15c0e0=_0x5c680f['length'];_0x137f18<_0x15c0e0;_0x137f18++){if(_0x5c680f[_0x137f18][_0x5774('0x71')]==_0x2adf33[_0x1449e9]['id']&&_0x5336e9['hasOwnProperty'](_0x5c680f[_0x137f18][_0x5774('0x6d')])){_0xda33f4[_0x5336e9[_0x5c680f[_0x137f18][_0x5774('0x6d')]]]=_0x5c680f[_0x137f18][_0x5774('0x72')];}}for(var _0x30a658 in _0x5336e9){if(!_0xda33f4[_0x5774('0x60')](_0x5336e9[_0x30a658])){_0xda33f4[_0x5336e9[_0x30a658]]=null;}}_0x25c2e4['push'](_0xda33f4);}return _0x25c2e4;}})[_0x5774('0x29')](function(_0x4996df){if(!_[_0x5774('0x73')](_0x4996df)){var _0x5d5587=toCsv(_0x4996df);var _0x1ae498=Date['now']();fs[_0x5774('0x74')](util[_0x5774('0x6f')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x42b37d[_0x5774('0x58')]['id'],_0x1ae498),_0x5d5587);_0x433268[_0x5774('0x75')](_0x5774('0x76'),_0x5774('0x77')+util['format'](_0x5774('0x78'),_0x42b37d['params']['id'],_0x1ae498));_0x433268[_0x5774('0x75')](_0x5774('0x79'),'text/csv');return _0x433268[_0x5774('0x7a')](util[_0x5774('0x6f')](_0x5774('0x7b'),_0x42b37d['params']['id'],_0x1ae498));}else{return _0x433268[_0x5774('0x1e')](0xcc);}})[_0x5774('0x49')](handleError(_0x433268,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 3b99261..86813f5 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 _0x201e=['exports','JscriptyProject','jscripty_projects','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x201e,0x1c3));var _0xe201=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x201e[_0x3bab09];return _0x164376;};'use strict';var _=require(_0xe201('0x0'));var util=require(_0xe201('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe201('0x2'));var BPromise=require(_0xe201('0x3'));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('./jscriptyProject.attributes');module[_0xe201('0x4')]=function(_0x2ff68c,_0x5c4c2a){return _0x2ff68c['define'](_0xe201('0x5'),attributes,{'tableName':_0xe201('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14ab=['bluebird','request-promise','path','rimraf','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment'];(function(_0x12da2f,_0x359dfd){var _0x57e117=function(_0x3821a2){while(--_0x3821a2){_0x12da2f['push'](_0x12da2f['shift']());}};_0x57e117(++_0x359dfd);}(_0x14ab,0xd4));var _0xb14a=function(_0x17b87f,_0x5e024c){_0x17b87f=_0x17b87f-0x0;var _0x12414d=_0x14ab[_0x17b87f];return _0x12414d;};'use strict';var _=require('lodash');var util=require(_0xb14a('0x0'));var logger=require(_0xb14a('0x1'))(_0xb14a('0x2'));var moment=require(_0xb14a('0x3'));var BPromise=require(_0xb14a('0x4'));var rp=require(_0xb14a('0x5'));var fs=require('fs');var path=require(_0xb14a('0x6'));var rimraf=require(_0xb14a('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0xb14a('0x8')]=function(_0x3527ab,_0x1f5e04){return _0x3527ab[_0xb14a('0x9')](_0xb14a('0xa'),attributes,{'tableName':_0xb14a('0xb'),'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 60bea40..fdbb785 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 _0x4e5d=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyProject,\x20%s,\x20%s','message','info','result','catch'];(function(_0x537d20,_0x374302){var _0x3d6a12=function(_0x3c41be){while(--_0x3c41be){_0x537d20['push'](_0x537d20['shift']());}};_0x3d6a12(++_0x374302);}(_0x4e5d,0x13b));var _0xd4e5=function(_0x1c238f,_0x36012b){_0x1c238f=_0x1c238f-0x0;var _0x344288=_0x4e5d[_0x1c238f];return _0x344288;};'use strict';var _=require(_0xd4e5('0x0'));var util=require(_0xd4e5('0x1'));var moment=require(_0xd4e5('0x2'));var BPromise=require(_0xd4e5('0x3'));var rs=require(_0xd4e5('0x4'));var fs=require('fs');var Redis=require(_0xd4e5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd4e5('0x6'))(_0xd4e5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd4e5('0x8')][_0xd4e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fe3db,_0x359b8c,_0x27ba16){return new BPromise(function(_0x5cf03f,_0x2e807f){return client['request'](_0x1fe3db,_0x27ba16)['then'](function(_0x373a60){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x359b8c,_0xd4e5('0xa'));logger[_0xd4e5('0xb')](_0xd4e5('0xc'),_0x359b8c,_0xd4e5('0xa'),JSON[_0xd4e5('0xd')](_0x373a60));if(_0x373a60[_0xd4e5('0xe')]){if(_0x373a60[_0xd4e5('0xe')][_0xd4e5('0xf')]===0x1f4){logger[_0xd4e5('0xe')](_0xd4e5('0x10'),_0x359b8c,_0x373a60[_0xd4e5('0xe')][_0xd4e5('0x11')]);return _0x2e807f(_0x373a60[_0xd4e5('0xe')][_0xd4e5('0x11')]);}logger[_0xd4e5('0xe')](_0xd4e5('0x10'),_0x359b8c,_0x373a60[_0xd4e5('0xe')][_0xd4e5('0x11')]);return _0x5cf03f(_0x373a60[_0xd4e5('0xe')][_0xd4e5('0x11')]);}else{logger[_0xd4e5('0x12')](_0xd4e5('0x10'),_0x359b8c,_0xd4e5('0xa'));_0x5cf03f(_0x373a60[_0xd4e5('0x13')]['message']);}})[_0xd4e5('0x14')](function(_0x221da7){logger[_0xd4e5('0xe')](_0xd4e5('0x10'),_0x359b8c,_0x221da7);_0x2e807f(_0x221da7);});});} \ No newline at end of file +var _0xdf8b=['request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x229605,_0x23a67b){var _0x4e5255=function(_0x18ef4b){while(--_0x18ef4b){_0x229605['push'](_0x229605['shift']());}};_0x4e5255(++_0x23a67b);}(_0xdf8b,0xb5));var _0xbdf8=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0xdf8b[_0x4f8f3b];return _0x4c250c;};'use strict';var _=require(_0xbdf8('0x0'));var util=require(_0xbdf8('0x1'));var moment=require(_0xbdf8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdf8('0x3'));var db=require(_0xbdf8('0x4'))['db'];var utils=require(_0xbdf8('0x5'));var logger=require(_0xbdf8('0x6'))('rpc');var config=require(_0xbdf8('0x7'));var jayson=require(_0xbdf8('0x8'));var client=jayson[_0xbdf8('0x9')][_0xbdf8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2353eb,_0x1f5195,_0x222ae5){return new BPromise(function(_0x2b1860,_0x3e6b26){return client[_0xbdf8('0xb')](_0x2353eb,_0x222ae5)[_0xbdf8('0xc')](function(_0x3d1529){logger[_0xbdf8('0xd')](_0xbdf8('0xe'),_0x1f5195,_0xbdf8('0xf'));logger[_0xbdf8('0x10')](_0xbdf8('0x11'),_0x1f5195,_0xbdf8('0xf'),JSON[_0xbdf8('0x12')](_0x3d1529));if(_0x3d1529[_0xbdf8('0x13')]){if(_0x3d1529[_0xbdf8('0x13')][_0xbdf8('0x14')]===0x1f4){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x1f5195,_0x3d1529['error'][_0xbdf8('0x15')]);return _0x3e6b26(_0x3d1529['error'][_0xbdf8('0x15')]);}logger[_0xbdf8('0x13')](_0xbdf8('0xe'),_0x1f5195,_0x3d1529[_0xbdf8('0x13')][_0xbdf8('0x15')]);return _0x2b1860(_0x3d1529[_0xbdf8('0x13')][_0xbdf8('0x15')]);}else{logger[_0xbdf8('0xd')](_0xbdf8('0xe'),_0x1f5195,'request\x20sent');_0x2b1860(_0x3d1529[_0xbdf8('0x16')][_0xbdf8('0x15')]);}})[_0xbdf8('0x17')](function(_0x415178){logger[_0xbdf8('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x1f5195,_0x415178);_0x3e6b26(_0x415178);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 28d1555..8c45b85 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 _0xa512=['describe','/:id','isAuthenticated','show','post','create','update','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x3c4ec6,_0x2b3094){var _0x11b86c=function(_0x4535fb){while(--_0x4535fb){_0x3c4ec6['push'](_0x3c4ec6['shift']());}};_0x11b86c(++_0x2b3094);}(_0xa512,0xcf));var _0x2a51=function(_0x440064,_0x15230d){_0x440064=_0x440064-0x0;var _0x4f32c7=_0xa512[_0x440064];return _0x4f32c7;};'use strict';var multer=require(_0x2a51('0x0'));var util=require(_0x2a51('0x1'));var path=require('path');var timeout=require(_0x2a51('0x2'));var express=require(_0x2a51('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2a51('0x4'));var config=require(_0x2a51('0x5'));var controller=require('./jscriptyQuestionReport.controller');router[_0x2a51('0x6')]('/',auth['isAuthenticated'](),controller[_0x2a51('0x7')]);router[_0x2a51('0x6')](_0x2a51('0x8'),auth['isAuthenticated'](),controller[_0x2a51('0x9')]);router[_0x2a51('0x6')](_0x2a51('0xa'),auth[_0x2a51('0xb')](),controller[_0x2a51('0xc')]);router[_0x2a51('0xd')]('/',auth[_0x2a51('0xb')](),controller[_0x2a51('0xe')]);router['put'](_0x2a51('0xa'),auth[_0x2a51('0xb')](),controller[_0x2a51('0xf')]);router[_0x2a51('0x10')](_0x2a51('0xa'),auth['isAuthenticated'](),controller[_0x2a51('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3408=['update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put'];(function(_0x454d94,_0x2d5642){var _0x1389b0=function(_0x1202ad){while(--_0x1202ad){_0x454d94['push'](_0x454d94['shift']());}};_0x1389b0(++_0x2d5642);}(_0x3408,0xfe));var _0x8340=function(_0x14c844,_0x45f150){_0x14c844=_0x14c844-0x0;var _0x57fb01=_0x3408[_0x14c844];return _0x57fb01;};'use strict';var multer=require('multer');var util=require(_0x8340('0x0'));var path=require(_0x8340('0x1'));var timeout=require(_0x8340('0x2'));var express=require(_0x8340('0x3'));var router=express[_0x8340('0x4')]();var auth=require(_0x8340('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8340('0x6'));var controller=require(_0x8340('0x7'));router[_0x8340('0x8')]('/',auth[_0x8340('0x9')](),controller[_0x8340('0xa')]);router[_0x8340('0x8')](_0x8340('0xb'),auth[_0x8340('0x9')](),controller['describe']);router[_0x8340('0x8')](_0x8340('0xc'),auth[_0x8340('0x9')](),controller['show']);router[_0x8340('0xd')]('/',auth[_0x8340('0x9')](),controller[_0x8340('0xe')]);router[_0x8340('0xf')]('/:id',auth[_0x8340('0x9')](),controller[_0x8340('0x10')]);router['delete']('/:id',auth[_0x8340('0x9')](),controller['destroy']);module[_0x8340('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index e65ea38..8a5806a 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 _0xca20=['long','STRING','sequelize','exports','TEXT'];(function(_0x299e1e,_0x20eab5){var _0x3757dc=function(_0x211535){while(--_0x211535){_0x299e1e['push'](_0x299e1e['shift']());}};_0x3757dc(++_0x20eab5);}(_0xca20,0x1ce));var _0x0ca2=function(_0x43b487,_0x21893a){_0x43b487=_0x43b487-0x0;var _0x2f707a=_0xca20[_0x43b487];return _0x2f707a;};'use strict';var Sequelize=require(_0x0ca2('0x0'));module[_0x0ca2('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x0ca2('0x2')](_0x0ca2('0x3'))},'membername':{'type':Sequelize[_0x0ca2('0x4')]},'projectname':{'type':Sequelize[_0x0ca2('0x4')]},'queue':{'type':Sequelize[_0x0ca2('0x4')]},'uniqueid':{'type':Sequelize[_0x0ca2('0x4')]},'calleridname':{'type':Sequelize[_0x0ca2('0x4')]},'calleridnum':{'type':Sequelize[_0x0ca2('0x4')]},'questionId':{'type':Sequelize[_0x0ca2('0x4')]}}; \ No newline at end of file +var _0x910e=['sequelize','STRING','TEXT','long'];(function(_0x4626e1,_0x49ebbf){var _0x13f974=function(_0x3e6ca2){while(--_0x3e6ca2){_0x4626e1['push'](_0x4626e1['shift']());}};_0x13f974(++_0x49ebbf);}(_0x910e,0xc0));var _0xe910=function(_0x2b63d2,_0x2a58c1){_0x2b63d2=_0x2b63d2-0x0;var _0x168b0b=_0x910e[_0x2b63d2];return _0x168b0b;};'use strict';var Sequelize=require(_0xe910('0x0'));module['exports']={'question':{'type':Sequelize[_0xe910('0x1')]},'answer':{'type':Sequelize[_0xe910('0x2')](_0xe910('0x3'))},'membername':{'type':Sequelize[_0xe910('0x1')]},'projectname':{'type':Sequelize[_0xe910('0x1')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe910('0x1')]},'calleridnum':{'type':Sequelize[_0xe910('0x1')]},'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 94e7511..29c13ae 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 _0xa8a3=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','options','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','reject','update','destroy','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes'];(function(_0x2583e3,_0x1ddb75){var _0x2b1747=function(_0x3fd5aa){while(--_0x3fd5aa){_0x2583e3['push'](_0x2583e3['shift']());}};_0x2b1747(++_0x1ddb75);}(_0xa8a3,0xf7));var _0x3a8a=function(_0x1af7c3,_0x5cd4b5){_0x1af7c3=_0x1af7c3-0x0;var _0x302dd3=_0xa8a3[_0x1af7c3];return _0x302dd3;};'use strict';var pdf=require(_0x3a8a('0x0'));var emlformat=require(_0x3a8a('0x1'));var rimraf=require(_0x3a8a('0x2'));var zipdir=require(_0x3a8a('0x3'));var jsonpatch=require(_0x3a8a('0x4'));var rp=require(_0x3a8a('0x5'));var moment=require(_0x3a8a('0x6'));var BPromise=require(_0x3a8a('0x7'));var Mustache=require(_0x3a8a('0x8'));var util=require(_0x3a8a('0x9'));var path=require(_0x3a8a('0xa'));var sox=require(_0x3a8a('0xb'));var csv=require(_0x3a8a('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3a8a('0xd'));var crypto=require(_0x3a8a('0xe'));var jsforce=require(_0x3a8a('0xf'));var deskjs=require(_0x3a8a('0x10'));var toCsv=require(_0x3a8a('0xc'));var querystring=require(_0x3a8a('0x11'));var Papa=require(_0x3a8a('0x12'));var Redis=require(_0x3a8a('0x13'));var authService=require(_0x3a8a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3a8a('0x15'));var hardwareService=require(_0x3a8a('0x16'));var logger=require(_0x3a8a('0x17'))(_0x3a8a('0x18'));var utils=require(_0x3a8a('0x19'));var config=require('../../config/environment');var db=require(_0x3a8a('0x1a'))['db'];function respondWithStatusCode(_0x20b659,_0x2bb8ee){_0x2bb8ee=_0x2bb8ee||0xcc;return function(_0x1314d0){if(_0x1314d0){return _0x20b659[_0x3a8a('0x1b')](_0x2bb8ee);}return _0x20b659[_0x3a8a('0x1c')](_0x2bb8ee)[_0x3a8a('0x1d')]();};}function respondWithResult(_0x1ecc1d,_0x3dd34c){_0x3dd34c=_0x3dd34c||0xc8;return function(_0x564a4a){if(_0x564a4a){return _0x1ecc1d[_0x3a8a('0x1c')](_0x3dd34c)['json'](_0x564a4a);}};}function respondWithFilteredResult(_0x508edf,_0x1bf0de){return function(_0x2b357a){if(_0x2b357a){var _0x15d43b=_0x2b357a[_0x3a8a('0x1e')],_0x5de4c4=_0x1bf0de[_0x3a8a('0x1f')],_0x5cd916=_0x1bf0de['offset']+_0x1bf0de[_0x3a8a('0x20')],_0x102055;if(_0x5cd916>=_0x15d43b){_0x5cd916=_0x15d43b;_0x102055=0xc8;}else{_0x102055=0xce;}_0x508edf['status'](_0x102055);return _0x508edf['set']('Content-Range',_0x5de4c4+'-'+_0x5cd916+'/'+_0x15d43b)['json'](_0x2b357a);}return null;};}function patchUpdates(_0x2fe436){return function(_0xb5aa98){try{jsonpatch['apply'](_0xb5aa98,_0x2fe436,!![]);}catch(_0x173d56){return BPromise[_0x3a8a('0x21')](_0x173d56);}return _0xb5aa98['save']();};}function saveUpdates(_0x5bb2f5,_0x2d295e){return function(_0x5c1485){if(_0x5c1485){return _0x5c1485[_0x3a8a('0x22')](_0x5bb2f5)['then'](function(_0x15ca99){return _0x15ca99;});}return null;};}function removeEntity(_0x426a06,_0x5e6b7d){return function(_0x4c3938){if(_0x4c3938){return _0x4c3938[_0x3a8a('0x23')]()[_0x3a8a('0x24')](function(){_0x426a06[_0x3a8a('0x1c')](0xcc)[_0x3a8a('0x1d')]();});}};}function handleEntityNotFound(_0x224ad3,_0x3ebaf3){return function(_0x2c01d8){if(!_0x2c01d8){_0x224ad3['sendStatus'](0x194);}return _0x2c01d8;};}function handleError(_0x5a47ec,_0x259e7a){_0x259e7a=_0x259e7a||0x1f4;return function(_0xeb32b5){logger[_0x3a8a('0x25')](_0xeb32b5[_0x3a8a('0x26')]);if(_0xeb32b5[_0x3a8a('0x27')]){delete _0xeb32b5[_0x3a8a('0x27')];}_0x5a47ec[_0x3a8a('0x1c')](_0x259e7a)[_0x3a8a('0x28')](_0xeb32b5);};}exports[_0x3a8a('0x29')]=function(_0x1fc8f7,_0x24c46f){var _0xb2e0a8={},_0x35f28a={},_0x5aaa0b={'count':0x0,'rows':[]};var _0x16edb5=_[_0x3a8a('0x2a')](db[_0x3a8a('0x2b')][_0x3a8a('0x2c')],function(_0x2c457b){return{'name':_0x2c457b[_0x3a8a('0x2d')],'type':_0x2c457b[_0x3a8a('0x2e')][_0x3a8a('0x2f')]};});_0x35f28a[_0x3a8a('0x30')]=_['map'](_0x16edb5,_0x3a8a('0x27'));_0x35f28a[_0x3a8a('0x31')]=_['keys'](_0x1fc8f7[_0x3a8a('0x31')]);_0x35f28a['filters']=_[_0x3a8a('0x32')](_0x35f28a[_0x3a8a('0x30')],_0x35f28a['query']);_0xb2e0a8['attributes']=_[_0x3a8a('0x32')](_0x35f28a[_0x3a8a('0x30')],qs[_0x3a8a('0x33')](_0x1fc8f7[_0x3a8a('0x31')]['fields']));_0xb2e0a8[_0x3a8a('0x34')]=_0xb2e0a8['attributes'][_0x3a8a('0x35')]?_0xb2e0a8['attributes']:_0x35f28a[_0x3a8a('0x30')];if(!_0x1fc8f7['query'][_0x3a8a('0x36')](_0x3a8a('0x37'))){_0xb2e0a8[_0x3a8a('0x20')]=qs[_0x3a8a('0x20')](_0x1fc8f7['query']['limit']);_0xb2e0a8['offset']=qs['offset'](_0x1fc8f7[_0x3a8a('0x31')][_0x3a8a('0x1f')]);}_0xb2e0a8[_0x3a8a('0x38')]=qs['sort'](_0x1fc8f7[_0x3a8a('0x31')][_0x3a8a('0x39')]);_0xb2e0a8[_0x3a8a('0x3a')]=qs[_0x3a8a('0x3b')](_[_0x3a8a('0x3c')](_0x1fc8f7[_0x3a8a('0x31')],_0x35f28a[_0x3a8a('0x3b')]));if(_0x1fc8f7[_0x3a8a('0x31')][_0x3a8a('0x3d')]){_0xb2e0a8[_0x3a8a('0x3a')]=_[_0x3a8a('0x3e')](_0xb2e0a8[_0x3a8a('0x3a')],{'$or':_[_0x3a8a('0x2a')](_0x16edb5,function(_0x5821b7){if(_0x5821b7[_0x3a8a('0x2e')]!==_0x3a8a('0x3f')){var _0x456407={};_0x456407[_0x5821b7[_0x3a8a('0x27')]]={'$like':'%'+_0x1fc8f7[_0x3a8a('0x31')][_0x3a8a('0x3d')]+'%'};return _0x456407;}})});}_0xb2e0a8=_[_0x3a8a('0x3e')]({},_0xb2e0a8,_0x1fc8f7['options']);var _0x48b239={'where':_0xb2e0a8[_0x3a8a('0x3a')]};return db[_0x3a8a('0x2b')]['count'](_0x48b239)['then'](function(_0x334102){_0x5aaa0b[_0x3a8a('0x1e')]=_0x334102;if(_0x1fc8f7[_0x3a8a('0x31')][_0x3a8a('0x40')]){_0xb2e0a8[_0x3a8a('0x41')]=[{'all':!![]}];}return db[_0x3a8a('0x2b')][_0x3a8a('0x42')](_0xb2e0a8);})[_0x3a8a('0x24')](function(_0x54c314){_0x5aaa0b['rows']=_0x54c314;return _0x5aaa0b;})['then'](respondWithFilteredResult(_0x24c46f,_0xb2e0a8))[_0x3a8a('0x43')](handleError(_0x24c46f,null));};exports[_0x3a8a('0x44')]=function(_0x235402,_0x10f4b7){var _0x357577={'raw':!![],'where':{'id':_0x235402['params']['id']}},_0x345972={};_0x345972[_0x3a8a('0x30')]=_[_0x3a8a('0x45')](db[_0x3a8a('0x2b')]['rawAttributes']);_0x345972[_0x3a8a('0x31')]=_[_0x3a8a('0x45')](_0x235402[_0x3a8a('0x31')]);_0x345972[_0x3a8a('0x3b')]=_['intersection'](_0x345972[_0x3a8a('0x30')],_0x345972[_0x3a8a('0x31')]);_0x357577[_0x3a8a('0x34')]=_[_0x3a8a('0x32')](_0x345972[_0x3a8a('0x30')],qs[_0x3a8a('0x33')](_0x235402[_0x3a8a('0x31')]['fields']));_0x357577[_0x3a8a('0x34')]=_0x357577[_0x3a8a('0x34')][_0x3a8a('0x35')]?_0x357577['attributes']:_0x345972['model'];if(_0x235402[_0x3a8a('0x31')][_0x3a8a('0x40')]){_0x357577[_0x3a8a('0x41')]=[{'all':!![]}];}_0x357577=_[_0x3a8a('0x3e')]({},_0x357577,_0x235402[_0x3a8a('0x46')]);return db['JscriptyQuestionReport'][_0x3a8a('0x47')](_0x357577)[_0x3a8a('0x24')](handleEntityNotFound(_0x10f4b7,null))[_0x3a8a('0x24')](respondWithResult(_0x10f4b7,null))[_0x3a8a('0x43')](handleError(_0x10f4b7,null));};exports[_0x3a8a('0x48')]=function(_0x1dc91e,_0x325e6a){return db[_0x3a8a('0x2b')]['create'](_0x1dc91e[_0x3a8a('0x49')],{})['then'](respondWithResult(_0x325e6a,0xc9))[_0x3a8a('0x43')](handleError(_0x325e6a,null));};exports[_0x3a8a('0x22')]=function(_0x4f7a4f,_0x1b5f2b){if(_0x4f7a4f[_0x3a8a('0x49')]['id']){delete _0x4f7a4f[_0x3a8a('0x49')]['id'];}return db[_0x3a8a('0x2b')][_0x3a8a('0x47')]({'where':{'id':_0x4f7a4f[_0x3a8a('0x4a')]['id']}})[_0x3a8a('0x24')](handleEntityNotFound(_0x1b5f2b,null))['then'](saveUpdates(_0x4f7a4f[_0x3a8a('0x49')],null))[_0x3a8a('0x24')](respondWithResult(_0x1b5f2b,null))[_0x3a8a('0x43')](handleError(_0x1b5f2b,null));};exports['destroy']=function(_0x324d0a,_0x7e743a){return db[_0x3a8a('0x2b')][_0x3a8a('0x47')]({'where':{'id':_0x324d0a[_0x3a8a('0x4a')]['id']}})[_0x3a8a('0x24')](handleEntityNotFound(_0x7e743a,null))[_0x3a8a('0x24')](removeEntity(_0x7e743a,null))[_0x3a8a('0x43')](handleError(_0x7e743a,null));};exports['describe']=function(_0x55c685,_0x40e960){return db[_0x3a8a('0x2b')]['describe']()[_0x3a8a('0x24')](respondWithResult(_0x40e960,null))[_0x3a8a('0x43')](handleError(_0x40e960,null));}; \ No newline at end of file +var _0x7e76=['destroy','then','end','error','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','JscriptyQuestionReport','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','json','reject','save','update'];(function(_0x46b5d6,_0x24f276){var _0x25e2b4=function(_0x503053){while(--_0x503053){_0x46b5d6['push'](_0x46b5d6['shift']());}};_0x25e2b4(++_0x24f276);}(_0x7e76,0x19a));var _0x67e7=function(_0x1f264a,_0xab6862){_0x1f264a=_0x1f264a-0x0;var _0x9804d4=_0x7e76[_0x1f264a];return _0x9804d4;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x67e7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x67e7('0x1'));var rp=require(_0x67e7('0x2'));var moment=require(_0x67e7('0x3'));var BPromise=require(_0x67e7('0x4'));var Mustache=require(_0x67e7('0x5'));var util=require(_0x67e7('0x6'));var path=require(_0x67e7('0x7'));var sox=require(_0x67e7('0x8'));var csv=require('to-csv');var ejs=require(_0x67e7('0x9'));var fs=require('fs');var _=require(_0x67e7('0xa'));var squel=require(_0x67e7('0xb'));var crypto=require('crypto');var jsforce=require(_0x67e7('0xc'));var deskjs=require(_0x67e7('0xd'));var toCsv=require(_0x67e7('0xe'));var querystring=require(_0x67e7('0xf'));var Papa=require(_0x67e7('0x10'));var Redis=require(_0x67e7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x67e7('0x12'));var as=require(_0x67e7('0x13'));var hardwareService=require(_0x67e7('0x14'));var logger=require(_0x67e7('0x15'))(_0x67e7('0x16'));var utils=require(_0x67e7('0x17'));var config=require('../../config/environment');var db=require(_0x67e7('0x18'))['db'];function respondWithStatusCode(_0x425743,_0x5b791b){_0x5b791b=_0x5b791b||0xcc;return function(_0x16e45c){if(_0x16e45c){return _0x425743[_0x67e7('0x19')](_0x5b791b);}return _0x425743['status'](_0x5b791b)['end']();};}function respondWithResult(_0x334bc4,_0x58f50e){_0x58f50e=_0x58f50e||0xc8;return function(_0x46f582){if(_0x46f582){return _0x334bc4[_0x67e7('0x1a')](_0x58f50e)['json'](_0x46f582);}};}function respondWithFilteredResult(_0x6869fa,_0x15f2cf){return function(_0x47d576){if(_0x47d576){var _0x614d50=_0x47d576[_0x67e7('0x1b')],_0x597c1c=_0x15f2cf[_0x67e7('0x1c')],_0x28e20f=_0x15f2cf['offset']+_0x15f2cf[_0x67e7('0x1d')],_0x1ad57d;if(_0x28e20f>=_0x614d50){_0x28e20f=_0x614d50;_0x1ad57d=0xc8;}else{_0x1ad57d=0xce;}_0x6869fa[_0x67e7('0x1a')](_0x1ad57d);return _0x6869fa['set']('Content-Range',_0x597c1c+'-'+_0x28e20f+'/'+_0x614d50)[_0x67e7('0x1e')](_0x47d576);}return null;};}function patchUpdates(_0x4cf261){return function(_0x484931){try{jsonpatch['apply'](_0x484931,_0x4cf261,!![]);}catch(_0x1e9a51){return BPromise[_0x67e7('0x1f')](_0x1e9a51);}return _0x484931[_0x67e7('0x20')]();};}function saveUpdates(_0x3df1bd,_0x4053d6){return function(_0x701cc6){if(_0x701cc6){return _0x701cc6[_0x67e7('0x21')](_0x3df1bd)['then'](function(_0x3b8c45){return _0x3b8c45;});}return null;};}function removeEntity(_0x53e86d,_0x10b996){return function(_0x7c7348){if(_0x7c7348){return _0x7c7348[_0x67e7('0x22')]()[_0x67e7('0x23')](function(){_0x53e86d['status'](0xcc)[_0x67e7('0x24')]();});}};}function handleEntityNotFound(_0x3708bc,_0x2bd5c6){return function(_0x3b5b2a){if(!_0x3b5b2a){_0x3708bc[_0x67e7('0x19')](0x194);}return _0x3b5b2a;};}function handleError(_0x548529,_0x209860){_0x209860=_0x209860||0x1f4;return function(_0x3bd9bc){logger[_0x67e7('0x25')](_0x3bd9bc['stack']);if(_0x3bd9bc[_0x67e7('0x26')]){delete _0x3bd9bc[_0x67e7('0x26')];}_0x548529[_0x67e7('0x1a')](_0x209860)[_0x67e7('0x27')](_0x3bd9bc);};}exports['index']=function(_0x25fff8,_0x46efeb){var _0x37b824={},_0x1d226f={},_0x45d440={'count':0x0,'rows':[]};var _0x346879=_[_0x67e7('0x28')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x590561){return{'name':_0x590561[_0x67e7('0x29')],'type':_0x590561[_0x67e7('0x2a')][_0x67e7('0x2b')]};});_0x1d226f[_0x67e7('0x2c')]=_[_0x67e7('0x28')](_0x346879,_0x67e7('0x26'));_0x1d226f[_0x67e7('0x2d')]=_[_0x67e7('0x2e')](_0x25fff8[_0x67e7('0x2d')]);_0x1d226f[_0x67e7('0x2f')]=_[_0x67e7('0x30')](_0x1d226f['model'],_0x1d226f['query']);_0x37b824['attributes']=_[_0x67e7('0x30')](_0x1d226f[_0x67e7('0x2c')],qs[_0x67e7('0x31')](_0x25fff8[_0x67e7('0x2d')][_0x67e7('0x31')]));_0x37b824[_0x67e7('0x32')]=_0x37b824[_0x67e7('0x32')][_0x67e7('0x33')]?_0x37b824[_0x67e7('0x32')]:_0x1d226f['model'];if(!_0x25fff8[_0x67e7('0x2d')][_0x67e7('0x34')](_0x67e7('0x35'))){_0x37b824[_0x67e7('0x1d')]=qs['limit'](_0x25fff8[_0x67e7('0x2d')]['limit']);_0x37b824[_0x67e7('0x1c')]=qs['offset'](_0x25fff8[_0x67e7('0x2d')][_0x67e7('0x1c')]);}_0x37b824['order']=qs[_0x67e7('0x36')](_0x25fff8[_0x67e7('0x2d')]['sort']);_0x37b824[_0x67e7('0x37')]=qs[_0x67e7('0x2f')](_[_0x67e7('0x38')](_0x25fff8[_0x67e7('0x2d')],_0x1d226f[_0x67e7('0x2f')]));if(_0x25fff8['query'][_0x67e7('0x39')]){_0x37b824[_0x67e7('0x37')]=_[_0x67e7('0x3a')](_0x37b824['where'],{'$or':_[_0x67e7('0x28')](_0x346879,function(_0x4a7f5a){if(_0x4a7f5a[_0x67e7('0x2a')]!==_0x67e7('0x3b')){var _0x1c760a={};_0x1c760a[_0x4a7f5a[_0x67e7('0x26')]]={'$like':'%'+_0x25fff8[_0x67e7('0x2d')]['filter']+'%'};return _0x1c760a;}})});}_0x37b824=_[_0x67e7('0x3a')]({},_0x37b824,_0x25fff8['options']);var _0x4f46be={'where':_0x37b824[_0x67e7('0x37')]};return db['JscriptyQuestionReport'][_0x67e7('0x1b')](_0x4f46be)[_0x67e7('0x23')](function(_0x39cbcd){_0x45d440[_0x67e7('0x1b')]=_0x39cbcd;if(_0x25fff8[_0x67e7('0x2d')][_0x67e7('0x3c')]){_0x37b824[_0x67e7('0x3d')]=[{'all':!![]}];}return db[_0x67e7('0x3e')][_0x67e7('0x3f')](_0x37b824);})[_0x67e7('0x23')](function(_0x3a74b8){_0x45d440[_0x67e7('0x40')]=_0x3a74b8;return _0x45d440;})[_0x67e7('0x23')](respondWithFilteredResult(_0x46efeb,_0x37b824))['catch'](handleError(_0x46efeb,null));};exports[_0x67e7('0x41')]=function(_0x21e43c,_0xbebf94){var _0x85874a={'raw':!![],'where':{'id':_0x21e43c[_0x67e7('0x42')]['id']}},_0x5dac0e={};_0x5dac0e[_0x67e7('0x2c')]=_[_0x67e7('0x2e')](db['JscriptyQuestionReport'][_0x67e7('0x43')]);_0x5dac0e[_0x67e7('0x2d')]=_[_0x67e7('0x2e')](_0x21e43c[_0x67e7('0x2d')]);_0x5dac0e['filters']=_[_0x67e7('0x30')](_0x5dac0e['model'],_0x5dac0e[_0x67e7('0x2d')]);_0x85874a['attributes']=_[_0x67e7('0x30')](_0x5dac0e[_0x67e7('0x2c')],qs[_0x67e7('0x31')](_0x21e43c[_0x67e7('0x2d')][_0x67e7('0x31')]));_0x85874a['attributes']=_0x85874a[_0x67e7('0x32')][_0x67e7('0x33')]?_0x85874a['attributes']:_0x5dac0e['model'];if(_0x21e43c['query'][_0x67e7('0x3c')]){_0x85874a[_0x67e7('0x3d')]=[{'all':!![]}];}_0x85874a=_[_0x67e7('0x3a')]({},_0x85874a,_0x21e43c[_0x67e7('0x44')]);return db['JscriptyQuestionReport'][_0x67e7('0x45')](_0x85874a)['then'](handleEntityNotFound(_0xbebf94,null))['then'](respondWithResult(_0xbebf94,null))[_0x67e7('0x46')](handleError(_0xbebf94,null));};exports['create']=function(_0x462fa0,_0xfe2b31){return db[_0x67e7('0x3e')][_0x67e7('0x47')](_0x462fa0['body'],{})[_0x67e7('0x23')](respondWithResult(_0xfe2b31,0xc9))['catch'](handleError(_0xfe2b31,null));};exports[_0x67e7('0x21')]=function(_0x2a3f49,_0x3dc3e2){if(_0x2a3f49[_0x67e7('0x48')]['id']){delete _0x2a3f49[_0x67e7('0x48')]['id'];}return db[_0x67e7('0x3e')][_0x67e7('0x45')]({'where':{'id':_0x2a3f49['params']['id']}})[_0x67e7('0x23')](handleEntityNotFound(_0x3dc3e2,null))[_0x67e7('0x23')](saveUpdates(_0x2a3f49[_0x67e7('0x48')],null))['then'](respondWithResult(_0x3dc3e2,null))['catch'](handleError(_0x3dc3e2,null));};exports[_0x67e7('0x22')]=function(_0x542a1c,_0x2dc89a){return db[_0x67e7('0x3e')][_0x67e7('0x45')]({'where':{'id':_0x542a1c[_0x67e7('0x42')]['id']}})[_0x67e7('0x23')](handleEntityNotFound(_0x2dc89a,null))['then'](removeEntity(_0x2dc89a,null))[_0x67e7('0x46')](handleError(_0x2dc89a,null));};exports[_0x67e7('0x49')]=function(_0x55ef71,_0x4568a2){return db['JscriptyQuestionReport'][_0x67e7('0x49')]()['then'](respondWithResult(_0x4568a2,null))['catch'](handleError(_0x4568a2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index d54081b..f654ae8 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 _0x8eed=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./jscriptyQuestionReport.attributes','exports'];(function(_0x97573a,_0x20f2dc){var _0x560971=function(_0x5d4a29){while(--_0x5d4a29){_0x97573a['push'](_0x97573a['shift']());}};_0x560971(++_0x20f2dc);}(_0x8eed,0x1ef));var _0xd8ee=function(_0x5c7c6a,_0x6dd61a){_0x5c7c6a=_0x5c7c6a-0x0;var _0x4ac07c=_0x8eed[_0x5c7c6a];return _0x4ac07c;};'use strict';var _=require(_0xd8ee('0x0'));var util=require(_0xd8ee('0x1'));var logger=require(_0xd8ee('0x2'))(_0xd8ee('0x3'));var moment=require(_0xd8ee('0x4'));var BPromise=require(_0xd8ee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd8ee('0x6'));var config=require('../../config/environment');var attributes=require(_0xd8ee('0x7'));module[_0xd8ee('0x8')]=function(_0x3d5eff,_0x50cc88){return _0x3d5eff[_0xd8ee('0x9')](_0xd8ee('0xa'),attributes,{'tableName':_0xd8ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbee6=['../../config/logger','api','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','lodash'];(function(_0x3fa1e1,_0x4e39f0){var _0x1cc2ad=function(_0x3f6d4d){while(--_0x3f6d4d){_0x3fa1e1['push'](_0x3fa1e1['shift']());}};_0x1cc2ad(++_0x4e39f0);}(_0xbee6,0x1a6));var _0x6bee=function(_0x34092e,_0x4e36ef){_0x34092e=_0x34092e-0x0;var _0x2815bd=_0xbee6[_0x34092e];return _0x2815bd;};'use strict';var _=require(_0x6bee('0x0'));var util=require('util');var logger=require(_0x6bee('0x1'))(_0x6bee('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bee('0x3'));var rimraf=require(_0x6bee('0x4'));var config=require(_0x6bee('0x5'));var attributes=require(_0x6bee('0x6'));module[_0x6bee('0x7')]=function(_0x5d44b0,_0x4317dc){return _0x5d44b0['define'](_0x6bee('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 524cde1..56101db 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 _0x3bd9=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird'];(function(_0x4147ff,_0x154530){var _0x1e71e6=function(_0x21f992){while(--_0x21f992){_0x4147ff['push'](_0x4147ff['shift']());}};_0x1e71e6(++_0x154530);}(_0x3bd9,0xd9));var _0x93bd=function(_0x5b3b0d,_0x242816){_0x5b3b0d=_0x5b3b0d-0x0;var _0x2676fe=_0x3bd9[_0x5b3b0d];return _0x2676fe;};'use strict';var _=require(_0x93bd('0x0'));var util=require('util');var moment=require(_0x93bd('0x1'));var BPromise=require(_0x93bd('0x2'));var rs=require(_0x93bd('0x3'));var fs=require('fs');var Redis=require(_0x93bd('0x4'));var db=require(_0x93bd('0x5'))['db'];var utils=require(_0x93bd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x93bd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x93bd('0x8')][_0x93bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10d62c,_0x352c91,_0x4b3fa3){return new BPromise(function(_0x1ab654,_0x3c9522){return client['request'](_0x10d62c,_0x4b3fa3)[_0x93bd('0xa')](function(_0x28c5b5){logger[_0x93bd('0xb')](_0x93bd('0xc'),_0x352c91,_0x93bd('0xd'));logger[_0x93bd('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x352c91,_0x93bd('0xd'),JSON[_0x93bd('0xf')](_0x28c5b5));if(_0x28c5b5['error']){if(_0x28c5b5[_0x93bd('0x10')][_0x93bd('0x11')]===0x1f4){logger[_0x93bd('0x10')](_0x93bd('0xc'),_0x352c91,_0x28c5b5[_0x93bd('0x10')][_0x93bd('0x12')]);return _0x3c9522(_0x28c5b5[_0x93bd('0x10')][_0x93bd('0x12')]);}logger[_0x93bd('0x10')](_0x93bd('0xc'),_0x352c91,_0x28c5b5[_0x93bd('0x10')][_0x93bd('0x12')]);return _0x1ab654(_0x28c5b5[_0x93bd('0x10')][_0x93bd('0x12')]);}else{logger[_0x93bd('0xb')](_0x93bd('0xc'),_0x352c91,_0x93bd('0xd'));_0x1ab654(_0x28c5b5['result'][_0x93bd('0x12')]);}})[_0x93bd('0x13')](function(_0x32af77){logger[_0x93bd('0x10')](_0x93bd('0xc'),_0x352c91,_0x32af77);_0x3c9522(_0x32af77);});});} \ No newline at end of file +var _0xd11e=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xd11e,0xbf));var _0xed11=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0xd11e[_0x3bb5b4];return _0x586c60;};'use strict';var _=require(_0xed11('0x0'));var util=require(_0xed11('0x1'));var moment=require('moment');var BPromise=require(_0xed11('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed11('0x3'));var db=require(_0xed11('0x4'))['db'];var utils=require(_0xed11('0x5'));var logger=require(_0xed11('0x6'))(_0xed11('0x7'));var config=require(_0xed11('0x8'));var jayson=require(_0xed11('0x9'));var client=jayson[_0xed11('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x528ebc,_0x563539,_0xe320ef){return new BPromise(function(_0x1b0fb0,_0x42b3b3){return client[_0xed11('0xb')](_0x528ebc,_0xe320ef)[_0xed11('0xc')](function(_0x13aa51){logger['info'](_0xed11('0xd'),_0x563539,'request\x20sent');logger[_0xed11('0xe')](_0xed11('0xf'),_0x563539,_0xed11('0x10'),JSON[_0xed11('0x11')](_0x13aa51));if(_0x13aa51['error']){if(_0x13aa51[_0xed11('0x12')][_0xed11('0x13')]===0x1f4){logger[_0xed11('0x12')](_0xed11('0xd'),_0x563539,_0x13aa51[_0xed11('0x12')][_0xed11('0x14')]);return _0x42b3b3(_0x13aa51[_0xed11('0x12')][_0xed11('0x14')]);}logger[_0xed11('0x12')](_0xed11('0xd'),_0x563539,_0x13aa51[_0xed11('0x12')][_0xed11('0x14')]);return _0x1b0fb0(_0x13aa51[_0xed11('0x12')][_0xed11('0x14')]);}else{logger[_0xed11('0x15')](_0xed11('0xd'),_0x563539,'request\x20sent');_0x1b0fb0(_0x13aa51[_0xed11('0x16')][_0xed11('0x14')]);}})[_0xed11('0x17')](function(_0x5eda94){logger[_0xed11('0x12')](_0xed11('0xd'),_0x563539,_0x5eda94);_0x42b3b3(_0x5eda94);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index d772b08..1d3a480 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 _0xb66c=['get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','getQuestions','create','put','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller'];(function(_0xd545bd,_0x358d4c){var _0x53a088=function(_0x277e93){while(--_0x277e93){_0xd545bd['push'](_0xd545bd['shift']());}};_0x53a088(++_0x358d4c);}(_0xb66c,0x175));var _0xcb66=function(_0x408b0d,_0x23ccac){_0x408b0d=_0x408b0d-0x0;var _0x1d134d=_0xb66c[_0x408b0d];return _0x1d134d;};'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['post']('/',auth[_0xcb66('0x8')](),controller[_0xcb66('0xf')]);router[_0xcb66('0x10')](_0xcb66('0xb'),auth['isAuthenticated'](),controller[_0xcb66('0x11')]);router[_0xcb66('0x12')](_0xcb66('0xb'),auth[_0xcb66('0x8')](),controller['destroy']);module[_0xcb66('0x13')]=router; \ No newline at end of file +var _0x9224=['../../components/auth/service','get','index','/describe','isAuthenticated','describe','show','/:id/questions','getQuestions','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x962878,_0x571620){var _0x53ce21=function(_0xecd192){while(--_0xecd192){_0x962878['push'](_0x962878['shift']());}};_0x53ce21(++_0x571620);}(_0x9224,0xa3));var _0x4922=function(_0x5dbcd8,_0x305b87){_0x5dbcd8=_0x5dbcd8-0x0;var _0x168c4e=_0x9224[_0x5dbcd8];return _0x168c4e;};'use strict';var multer=require('multer');var util=require(_0x4922('0x0'));var path=require(_0x4922('0x1'));var timeout=require(_0x4922('0x2'));var express=require(_0x4922('0x3'));var router=express[_0x4922('0x4')]();var auth=require(_0x4922('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0x4922('0x6')]('/',auth['isAuthenticated'](),controller[_0x4922('0x7')]);router[_0x4922('0x6')](_0x4922('0x8'),auth[_0x4922('0x9')](),controller[_0x4922('0xa')]);router[_0x4922('0x6')]('/:id',auth[_0x4922('0x9')](),controller[_0x4922('0xb')]);router['get'](_0x4922('0xc'),auth[_0x4922('0x9')](),controller[_0x4922('0xd')]);router[_0x4922('0xe')]('/',auth[_0x4922('0x9')](),controller[_0x4922('0xf')]);router[_0x4922('0x10')](_0x4922('0x11'),auth['isAuthenticated'](),controller[_0x4922('0x12')]);router['delete'](_0x4922('0x11'),auth[_0x4922('0x9')](),controller[_0x4922('0x13')]);module[_0x4922('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index acfc959..c951d93 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 _0x4bde=['DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bde,0x1b7));var _0xe4bd=function(_0xaae604,_0x36b762){_0xaae604=_0xaae604-0x0;var _0x12f1af=_0x4bde[_0xaae604];return _0x12f1af;};'use strict';var moment=require(_0xe4bd('0x0'));var Sequelize=require(_0xe4bd('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xe4bd('0x2')],'set':function(_0x241922){this[_0xe4bd('0x3')](_0xe4bd('0x4'),_0x241922);this['setDataValue'](_0xe4bd('0x5'),moment()[_0xe4bd('0x6')](_0xe4bd('0x7')));}},'endtime':{'type':Sequelize[_0xe4bd('0x2')]},'membername':{'type':Sequelize[_0xe4bd('0x8')]},'projectname':{'type':Sequelize[_0xe4bd('0x8')]},'queue':{'type':Sequelize[_0xe4bd('0x8')]},'uniqueid':{'type':Sequelize[_0xe4bd('0x8')]},'calleridname':{'type':Sequelize[_0xe4bd('0x8')]},'calleridnum':{'type':Sequelize[_0xe4bd('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x456f=['sequelize','DATE','setDataValue','starttime','format','STRING','BOOLEAN'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x456f,0x1ce));var _0xf456=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x456f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0xf456('0x0'));module['exports']={'starttime':{'type':Sequelize[_0xf456('0x1')],'set':function(_0x4f67a4){this[_0xf456('0x2')](_0xf456('0x3'),_0x4f67a4);this[_0xf456('0x2')]('endtime',moment()[_0xf456('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xf456('0x5')]},'projectname':{'type':Sequelize[_0xf456('0x5')]},'queue':{'type':Sequelize[_0xf456('0x5')]},'uniqueid':{'type':Sequelize[_0xf456('0x5')]},'calleridname':{'type':Sequelize[_0xf456('0x5')]},'calleridnum':{'type':Sequelize[_0xf456('0x5')]},'completed':{'type':Sequelize[_0xf456('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index dcc7f9d..beb54ed 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 _0xb82a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','destroy','end','error','stack','name','send','JscriptySessionReport','rawAttributes','type','key','map','query','filters','model','attributes','intersection','fields','nolimit','limit','order','where','pick','filter','merge','options','then','includeAll','rows','catch','show','keys','length','include','find','create','body','update','params','describe','getQuestions','findOne','hasOwnProperty','sort','SessionId','JscriptyQuestionReport','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x3299ea,_0x1bfb53){var _0x13f7cc=function(_0x565b69){while(--_0x565b69){_0x3299ea['push'](_0x3299ea['shift']());}};_0x13f7cc(++_0x1bfb53);}(_0xb82a,0x1d7));var _0xab82=function(_0xea8bcc,_0x3dfd20){_0xea8bcc=_0xea8bcc-0x0;var _0x109e89=_0xb82a[_0xea8bcc];return _0x109e89;};'use strict';var pdf=require(_0xab82('0x0'));var emlformat=require(_0xab82('0x1'));var rimraf=require(_0xab82('0x2'));var zipdir=require(_0xab82('0x3'));var jsonpatch=require(_0xab82('0x4'));var rp=require('request-promise');var moment=require(_0xab82('0x5'));var BPromise=require(_0xab82('0x6'));var Mustache=require(_0xab82('0x7'));var util=require(_0xab82('0x8'));var path=require(_0xab82('0x9'));var sox=require(_0xab82('0xa'));var csv=require(_0xab82('0xb'));var ejs=require(_0xab82('0xc'));var fs=require('fs');var _=require(_0xab82('0xd'));var squel=require(_0xab82('0xe'));var crypto=require(_0xab82('0xf'));var jsforce=require(_0xab82('0x10'));var deskjs=require(_0xab82('0x11'));var toCsv=require('to-csv');var querystring=require(_0xab82('0x12'));var Papa=require('papaparse');var Redis=require(_0xab82('0x13'));var authService=require(_0xab82('0x14'));var qs=require(_0xab82('0x15'));var as=require(_0xab82('0x16'));var hardwareService=require(_0xab82('0x17'));var logger=require('../../config/logger')(_0xab82('0x18'));var utils=require(_0xab82('0x19'));var config=require(_0xab82('0x1a'));var db=require(_0xab82('0x1b'))['db'];function respondWithStatusCode(_0x144c93,_0x1ae267){_0x1ae267=_0x1ae267||0xcc;return function(_0x555c34){if(_0x555c34){return _0x144c93[_0xab82('0x1c')](_0x1ae267);}return _0x144c93['status'](_0x1ae267)['end']();};}function respondWithResult(_0x56f24f,_0x3d9f3d){_0x3d9f3d=_0x3d9f3d||0xc8;return function(_0x340aab){if(_0x340aab){return _0x56f24f[_0xab82('0x1d')](_0x3d9f3d)['json'](_0x340aab);}};}function respondWithFilteredResult(_0x4ac392,_0x3b4e02){return function(_0x13480b){if(_0x13480b){var _0xbb4160=_0x13480b[_0xab82('0x1e')],_0x2e7ef7=_0x3b4e02[_0xab82('0x1f')],_0x4bbfa1=_0x3b4e02['offset']+_0x3b4e02['limit'],_0x2c1c76;if(_0x4bbfa1>=_0xbb4160){_0x4bbfa1=_0xbb4160;_0x2c1c76=0xc8;}else{_0x2c1c76=0xce;}_0x4ac392[_0xab82('0x1d')](_0x2c1c76);return _0x4ac392[_0xab82('0x20')](_0xab82('0x21'),_0x2e7ef7+'-'+_0x4bbfa1+'/'+_0xbb4160)[_0xab82('0x22')](_0x13480b);}return null;};}function patchUpdates(_0xcd1083){return function(_0x4cfc8c){try{jsonpatch[_0xab82('0x23')](_0x4cfc8c,_0xcd1083,!![]);}catch(_0x4f6498){return BPromise[_0xab82('0x24')](_0x4f6498);}return _0x4cfc8c['save']();};}function saveUpdates(_0x451ff0,_0x227562){return function(_0x2fe3a0){if(_0x2fe3a0){return _0x2fe3a0['update'](_0x451ff0)['then'](function(_0x151376){return _0x151376;});}return null;};}function removeEntity(_0x364787,_0x3ccec8){return function(_0x19bfd0){if(_0x19bfd0){return _0x19bfd0[_0xab82('0x25')]()['then'](function(){_0x364787['status'](0xcc)[_0xab82('0x26')]();});}};}function handleEntityNotFound(_0x46d00b,_0x31d805){return function(_0x431205){if(!_0x431205){_0x46d00b[_0xab82('0x1c')](0x194);}return _0x431205;};}function handleError(_0x1d08e7,_0x172237){_0x172237=_0x172237||0x1f4;return function(_0x4acc82){logger[_0xab82('0x27')](_0x4acc82[_0xab82('0x28')]);if(_0x4acc82[_0xab82('0x29')]){delete _0x4acc82[_0xab82('0x29')];}_0x1d08e7[_0xab82('0x1d')](_0x172237)[_0xab82('0x2a')](_0x4acc82);};}exports['index']=function(_0x347058,_0x3db542){var _0x17a503={},_0x513399={},_0x5d0fff={'count':0x0,'rows':[]};var _0x11e5c8=_['map'](db[_0xab82('0x2b')][_0xab82('0x2c')],function(_0x3bc8ae){return{'name':_0x3bc8ae['fieldName'],'type':_0x3bc8ae[_0xab82('0x2d')][_0xab82('0x2e')]};});_0x513399['model']=_[_0xab82('0x2f')](_0x11e5c8,'name');_0x513399['query']=_['keys'](_0x347058[_0xab82('0x30')]);_0x513399[_0xab82('0x31')]=_['intersection'](_0x513399[_0xab82('0x32')],_0x513399[_0xab82('0x30')]);_0x17a503[_0xab82('0x33')]=_[_0xab82('0x34')](_0x513399[_0xab82('0x32')],qs[_0xab82('0x35')](_0x347058[_0xab82('0x30')][_0xab82('0x35')]));_0x17a503[_0xab82('0x33')]=_0x17a503[_0xab82('0x33')]['length']?_0x17a503[_0xab82('0x33')]:_0x513399[_0xab82('0x32')];if(!_0x347058[_0xab82('0x30')]['hasOwnProperty'](_0xab82('0x36'))){_0x17a503[_0xab82('0x37')]=qs[_0xab82('0x37')](_0x347058['query']['limit']);_0x17a503[_0xab82('0x1f')]=qs[_0xab82('0x1f')](_0x347058[_0xab82('0x30')][_0xab82('0x1f')]);}_0x17a503[_0xab82('0x38')]=qs['sort'](_0x347058[_0xab82('0x30')]['sort']);_0x17a503[_0xab82('0x39')]=qs['filters'](_[_0xab82('0x3a')](_0x347058[_0xab82('0x30')],_0x513399[_0xab82('0x31')]));if(_0x347058['query'][_0xab82('0x3b')]){_0x17a503[_0xab82('0x39')]=_[_0xab82('0x3c')](_0x17a503[_0xab82('0x39')],{'$or':_['map'](_0x11e5c8,function(_0x1b3544){if(_0x1b3544[_0xab82('0x2d')]!=='VIRTUAL'){var _0x4b5e99={};_0x4b5e99[_0x1b3544[_0xab82('0x29')]]={'$like':'%'+_0x347058[_0xab82('0x30')][_0xab82('0x3b')]+'%'};return _0x4b5e99;}})});}_0x17a503=_[_0xab82('0x3c')]({},_0x17a503,_0x347058[_0xab82('0x3d')]);var _0x3c55aa={'where':_0x17a503[_0xab82('0x39')]};return db[_0xab82('0x2b')][_0xab82('0x1e')](_0x3c55aa)[_0xab82('0x3e')](function(_0x5bf359){_0x5d0fff['count']=_0x5bf359;if(_0x347058[_0xab82('0x30')][_0xab82('0x3f')]){_0x17a503['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x17a503);})[_0xab82('0x3e')](function(_0x518875){_0x5d0fff[_0xab82('0x40')]=_0x518875;return _0x5d0fff;})['then'](respondWithFilteredResult(_0x3db542,_0x17a503))[_0xab82('0x41')](handleError(_0x3db542,null));};exports[_0xab82('0x42')]=function(_0x548faf,_0x4676b0){var _0x14e85f={'raw':!![],'where':{'id':_0x548faf['params']['id']}},_0x89526={};_0x89526['model']=_[_0xab82('0x43')](db[_0xab82('0x2b')][_0xab82('0x2c')]);_0x89526['query']=_[_0xab82('0x43')](_0x548faf['query']);_0x89526[_0xab82('0x31')]=_[_0xab82('0x34')](_0x89526[_0xab82('0x32')],_0x89526[_0xab82('0x30')]);_0x14e85f[_0xab82('0x33')]=_['intersection'](_0x89526['model'],qs[_0xab82('0x35')](_0x548faf[_0xab82('0x30')][_0xab82('0x35')]));_0x14e85f[_0xab82('0x33')]=_0x14e85f[_0xab82('0x33')][_0xab82('0x44')]?_0x14e85f['attributes']:_0x89526['model'];if(_0x548faf['query']['includeAll']){_0x14e85f[_0xab82('0x45')]=[{'all':!![]}];}_0x14e85f=_['merge']({},_0x14e85f,_0x548faf[_0xab82('0x3d')]);return db[_0xab82('0x2b')][_0xab82('0x46')](_0x14e85f)[_0xab82('0x3e')](handleEntityNotFound(_0x4676b0,null))[_0xab82('0x3e')](respondWithResult(_0x4676b0,null))[_0xab82('0x41')](handleError(_0x4676b0,null));};exports['create']=function(_0x328d74,_0x15606c){return db['JscriptySessionReport'][_0xab82('0x47')](_0x328d74[_0xab82('0x48')],{})[_0xab82('0x3e')](respondWithResult(_0x15606c,0xc9))[_0xab82('0x41')](handleError(_0x15606c,null));};exports[_0xab82('0x49')]=function(_0x1f36be,_0x931a59){if(_0x1f36be[_0xab82('0x48')]['id']){delete _0x1f36be[_0xab82('0x48')]['id'];}return db[_0xab82('0x2b')][_0xab82('0x46')]({'where':{'id':_0x1f36be[_0xab82('0x4a')]['id']}})[_0xab82('0x3e')](handleEntityNotFound(_0x931a59,null))[_0xab82('0x3e')](saveUpdates(_0x1f36be[_0xab82('0x48')],null))[_0xab82('0x3e')](respondWithResult(_0x931a59,null))[_0xab82('0x41')](handleError(_0x931a59,null));};exports['destroy']=function(_0x5dfca8,_0x30dc8a){return db['JscriptySessionReport']['find']({'where':{'id':_0x5dfca8['params']['id']}})[_0xab82('0x3e')](handleEntityNotFound(_0x30dc8a,null))[_0xab82('0x3e')](removeEntity(_0x30dc8a,null))['catch'](handleError(_0x30dc8a,null));};exports[_0xab82('0x4b')]=function(_0x4e5287,_0x3b6446){return db[_0xab82('0x2b')][_0xab82('0x4b')]()[_0xab82('0x3e')](respondWithResult(_0x3b6446,null))[_0xab82('0x41')](handleError(_0x3b6446,null));};exports[_0xab82('0x4c')]=function(_0x24c3f4,_0x5089d0,_0x4c239b){var _0x3534ed={'raw':!![],'where':{}};var _0x325bbe={};var _0xb36829={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xab82('0x4d')]({'where':{'id':_0x24c3f4[_0xab82('0x4a')]['id']}})[_0xab82('0x3e')](handleEntityNotFound(_0x5089d0,null))[_0xab82('0x3e')](function(_0x29b35b){if(_0x29b35b){_0x325bbe['model']=_[_0xab82('0x43')](db['JscriptyQuestionReport']['rawAttributes']);_0x325bbe[_0xab82('0x30')]=_['keys'](_0x24c3f4[_0xab82('0x30')]);_0x325bbe[_0xab82('0x31')]=_[_0xab82('0x34')](_0x325bbe['model'],_0x325bbe['query']);_0x3534ed[_0xab82('0x33')]=_[_0xab82('0x34')](_0x325bbe[_0xab82('0x32')],qs[_0xab82('0x35')](_0x24c3f4[_0xab82('0x30')]['fields']));_0x3534ed[_0xab82('0x33')]=_0x3534ed[_0xab82('0x33')]['length']?_0x3534ed['attributes']:_0x325bbe[_0xab82('0x32')];if(!_0x24c3f4['query'][_0xab82('0x4e')](_0xab82('0x36'))){_0x3534ed['limit']=qs[_0xab82('0x37')](_0x24c3f4[_0xab82('0x30')][_0xab82('0x37')]);_0x3534ed[_0xab82('0x1f')]=qs['offset'](_0x24c3f4[_0xab82('0x30')]['offset']);}_0x3534ed[_0xab82('0x38')]=qs[_0xab82('0x4f')](_0x24c3f4[_0xab82('0x30')]['sort']);_0x3534ed[_0xab82('0x39')]=qs[_0xab82('0x31')](_[_0xab82('0x3a')](_0x24c3f4[_0xab82('0x30')],_0x325bbe[_0xab82('0x31')]));_0x3534ed['where'][_0xab82('0x50')]=_0x29b35b['id'];if(_0x24c3f4['query']['filter']){_0x3534ed['where']=_[_0xab82('0x3c')](_0x3534ed[_0xab82('0x39')],{'$or':_[_0xab82('0x2f')](_0x3534ed[_0xab82('0x33')],function(_0x186c49){var _0x332aac={};_0x332aac[_0x186c49]={'$like':'%'+_0x24c3f4[_0xab82('0x30')][_0xab82('0x3b')]+'%'};return _0x332aac;})});}_0x3534ed=_[_0xab82('0x3c')]({},_0x3534ed,_0x24c3f4[_0xab82('0x3d')]);return db[_0xab82('0x51')]['count']({'where':_0x3534ed[_0xab82('0x39')]})[_0xab82('0x3e')](function(_0x17ff07){_0xb36829[_0xab82('0x1e')]=_0x17ff07;if(_0x24c3f4['query']['includeAll']){_0x3534ed[_0xab82('0x45')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x3534ed);})[_0xab82('0x3e')](function(_0xfabf9){_0xb36829[_0xab82('0x40')]=_0xfabf9;return _0xb36829;});}})[_0xab82('0x3e')](respondWithFilteredResult(_0x5089d0,_0x3534ed))[_0xab82('0x41')](handleError(_0x5089d0,null));}; \ No newline at end of file +var _0x753d=['eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','name','send','JscriptySessionReport','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','catch','update','body','describe','getQuestions','findOne','JscriptyQuestionReport','html-pdf'];(function(_0x291fb1,_0x77bfa5){var _0x316962=function(_0x10d055){while(--_0x10d055){_0x291fb1['push'](_0x291fb1['shift']());}};_0x316962(++_0x77bfa5);}(_0x753d,0x9b));var _0xd753=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x753d[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xd753('0x0'));var emlformat=require(_0xd753('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd753('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd753('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd753('0x4'));var util=require(_0xd753('0x5'));var path=require(_0xd753('0x6'));var sox=require(_0xd753('0x7'));var csv=require(_0xd753('0x8'));var ejs=require(_0xd753('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd753('0xa'));var crypto=require(_0xd753('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd753('0xc'));var toCsv=require(_0xd753('0x8'));var querystring=require(_0xd753('0xd'));var Papa=require(_0xd753('0xe'));var Redis=require(_0xd753('0xf'));var authService=require(_0xd753('0x10'));var qs=require(_0xd753('0x11'));var as=require(_0xd753('0x12'));var hardwareService=require(_0xd753('0x13'));var logger=require(_0xd753('0x14'))(_0xd753('0x15'));var utils=require('../../config/utils');var config=require(_0xd753('0x16'));var db=require(_0xd753('0x17'))['db'];function respondWithStatusCode(_0x813943,_0x4768cd){_0x4768cd=_0x4768cd||0xcc;return function(_0x4df8d8){if(_0x4df8d8){return _0x813943['sendStatus'](_0x4768cd);}return _0x813943[_0xd753('0x18')](_0x4768cd)['end']();};}function respondWithResult(_0x5d7c10,_0x5d969f){_0x5d969f=_0x5d969f||0xc8;return function(_0x4b2e61){if(_0x4b2e61){return _0x5d7c10[_0xd753('0x18')](_0x5d969f)['json'](_0x4b2e61);}};}function respondWithFilteredResult(_0x7fcaa9,_0x3ad11d){return function(_0x599eb6){if(_0x599eb6){var _0x439c23=_0x599eb6[_0xd753('0x19')],_0x3f4a90=_0x3ad11d[_0xd753('0x1a')],_0x31eec8=_0x3ad11d['offset']+_0x3ad11d[_0xd753('0x1b')],_0x84d0f3;if(_0x31eec8>=_0x439c23){_0x31eec8=_0x439c23;_0x84d0f3=0xc8;}else{_0x84d0f3=0xce;}_0x7fcaa9[_0xd753('0x18')](_0x84d0f3);return _0x7fcaa9[_0xd753('0x1c')](_0xd753('0x1d'),_0x3f4a90+'-'+_0x31eec8+'/'+_0x439c23)[_0xd753('0x1e')](_0x599eb6);}return null;};}function patchUpdates(_0x453960){return function(_0x4d1b91){try{jsonpatch[_0xd753('0x1f')](_0x4d1b91,_0x453960,!![]);}catch(_0x57b704){return BPromise[_0xd753('0x20')](_0x57b704);}return _0x4d1b91[_0xd753('0x21')]();};}function saveUpdates(_0xee7c4c,_0xc6bda5){return function(_0x519580){if(_0x519580){return _0x519580['update'](_0xee7c4c)[_0xd753('0x22')](function(_0x33ec61){return _0x33ec61;});}return null;};}function removeEntity(_0x122b9e,_0x2bbf64){return function(_0x14d617){if(_0x14d617){return _0x14d617[_0xd753('0x23')]()[_0xd753('0x22')](function(){_0x122b9e[_0xd753('0x18')](0xcc)[_0xd753('0x24')]();});}};}function handleEntityNotFound(_0x4d325d,_0x11648e){return function(_0x28a0d9){if(!_0x28a0d9){_0x4d325d[_0xd753('0x25')](0x194);}return _0x28a0d9;};}function handleError(_0x17b79e,_0x19d029){_0x19d029=_0x19d029||0x1f4;return function(_0x4a7838){logger['error'](_0x4a7838['stack']);if(_0x4a7838['name']){delete _0x4a7838[_0xd753('0x26')];}_0x17b79e[_0xd753('0x18')](_0x19d029)[_0xd753('0x27')](_0x4a7838);};}exports['index']=function(_0x3e719c,_0x3f412d){var _0x253a07={},_0x228300={},_0x1823f6={'count':0x0,'rows':[]};var _0x346c21=_['map'](db[_0xd753('0x28')]['rawAttributes'],function(_0x3fd954){return{'name':_0x3fd954[_0xd753('0x29')],'type':_0x3fd954[_0xd753('0x2a')][_0xd753('0x2b')]};});_0x228300[_0xd753('0x2c')]=_[_0xd753('0x2d')](_0x346c21,_0xd753('0x26'));_0x228300[_0xd753('0x2e')]=_['keys'](_0x3e719c[_0xd753('0x2e')]);_0x228300[_0xd753('0x2f')]=_['intersection'](_0x228300[_0xd753('0x2c')],_0x228300[_0xd753('0x2e')]);_0x253a07[_0xd753('0x30')]=_[_0xd753('0x31')](_0x228300[_0xd753('0x2c')],qs['fields'](_0x3e719c[_0xd753('0x2e')][_0xd753('0x32')]));_0x253a07[_0xd753('0x30')]=_0x253a07[_0xd753('0x30')][_0xd753('0x33')]?_0x253a07[_0xd753('0x30')]:_0x228300['model'];if(!_0x3e719c['query'][_0xd753('0x34')](_0xd753('0x35'))){_0x253a07[_0xd753('0x1b')]=qs[_0xd753('0x1b')](_0x3e719c[_0xd753('0x2e')][_0xd753('0x1b')]);_0x253a07[_0xd753('0x1a')]=qs[_0xd753('0x1a')](_0x3e719c[_0xd753('0x2e')][_0xd753('0x1a')]);}_0x253a07[_0xd753('0x36')]=qs['sort'](_0x3e719c['query'][_0xd753('0x37')]);_0x253a07['where']=qs['filters'](_[_0xd753('0x38')](_0x3e719c[_0xd753('0x2e')],_0x228300['filters']));if(_0x3e719c['query'][_0xd753('0x39')]){_0x253a07['where']=_[_0xd753('0x3a')](_0x253a07[_0xd753('0x3b')],{'$or':_[_0xd753('0x2d')](_0x346c21,function(_0x5d6716){if(_0x5d6716[_0xd753('0x2a')]!==_0xd753('0x3c')){var _0x417764={};_0x417764[_0x5d6716[_0xd753('0x26')]]={'$like':'%'+_0x3e719c[_0xd753('0x2e')][_0xd753('0x39')]+'%'};return _0x417764;}})});}_0x253a07=_[_0xd753('0x3a')]({},_0x253a07,_0x3e719c[_0xd753('0x3d')]);var _0x422435={'where':_0x253a07[_0xd753('0x3b')]};return db[_0xd753('0x28')][_0xd753('0x19')](_0x422435)[_0xd753('0x22')](function(_0x5da22e){_0x1823f6['count']=_0x5da22e;if(_0x3e719c['query'][_0xd753('0x3e')]){_0x253a07[_0xd753('0x3f')]=[{'all':!![]}];}return db[_0xd753('0x28')][_0xd753('0x40')](_0x253a07);})['then'](function(_0x20f296){_0x1823f6[_0xd753('0x41')]=_0x20f296;return _0x1823f6;})['then'](respondWithFilteredResult(_0x3f412d,_0x253a07))['catch'](handleError(_0x3f412d,null));};exports[_0xd753('0x42')]=function(_0x4f3642,_0x283929){var _0x1527b0={'raw':!![],'where':{'id':_0x4f3642[_0xd753('0x43')]['id']}},_0x5a7fbb={};_0x5a7fbb['model']=_['keys'](db[_0xd753('0x28')][_0xd753('0x44')]);_0x5a7fbb[_0xd753('0x2e')]=_[_0xd753('0x45')](_0x4f3642[_0xd753('0x2e')]);_0x5a7fbb[_0xd753('0x2f')]=_['intersection'](_0x5a7fbb[_0xd753('0x2c')],_0x5a7fbb[_0xd753('0x2e')]);_0x1527b0[_0xd753('0x30')]=_[_0xd753('0x31')](_0x5a7fbb[_0xd753('0x2c')],qs[_0xd753('0x32')](_0x4f3642[_0xd753('0x2e')]['fields']));_0x1527b0['attributes']=_0x1527b0['attributes']['length']?_0x1527b0[_0xd753('0x30')]:_0x5a7fbb['model'];if(_0x4f3642[_0xd753('0x2e')]['includeAll']){_0x1527b0['include']=[{'all':!![]}];}_0x1527b0=_[_0xd753('0x3a')]({},_0x1527b0,_0x4f3642[_0xd753('0x3d')]);return db[_0xd753('0x28')][_0xd753('0x46')](_0x1527b0)[_0xd753('0x22')](handleEntityNotFound(_0x283929,null))[_0xd753('0x22')](respondWithResult(_0x283929,null))[_0xd753('0x47')](handleError(_0x283929,null));};exports['create']=function(_0x3aeb48,_0x520c2f){return db[_0xd753('0x28')]['create'](_0x3aeb48['body'],{})['then'](respondWithResult(_0x520c2f,0xc9))[_0xd753('0x47')](handleError(_0x520c2f,null));};exports[_0xd753('0x48')]=function(_0x2dec6b,_0x2454a0){if(_0x2dec6b[_0xd753('0x49')]['id']){delete _0x2dec6b['body']['id'];}return db[_0xd753('0x28')][_0xd753('0x46')]({'where':{'id':_0x2dec6b[_0xd753('0x43')]['id']}})[_0xd753('0x22')](handleEntityNotFound(_0x2454a0,null))['then'](saveUpdates(_0x2dec6b[_0xd753('0x49')],null))['then'](respondWithResult(_0x2454a0,null))[_0xd753('0x47')](handleError(_0x2454a0,null));};exports[_0xd753('0x23')]=function(_0x3de2b6,_0x1d2d5a){return db['JscriptySessionReport'][_0xd753('0x46')]({'where':{'id':_0x3de2b6[_0xd753('0x43')]['id']}})[_0xd753('0x22')](handleEntityNotFound(_0x1d2d5a,null))[_0xd753('0x22')](removeEntity(_0x1d2d5a,null))[_0xd753('0x47')](handleError(_0x1d2d5a,null));};exports['describe']=function(_0xd9e869,_0x120995){return db['JscriptySessionReport'][_0xd753('0x4a')]()['then'](respondWithResult(_0x120995,null))[_0xd753('0x47')](handleError(_0x120995,null));};exports[_0xd753('0x4b')]=function(_0x4ba36b,_0x4859ac,_0x52842b){var _0x4fa6d9={'raw':!![],'where':{}};var _0x2be4cb={};var _0x4bbe54={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xd753('0x4c')]({'where':{'id':_0x4ba36b['params']['id']}})[_0xd753('0x22')](handleEntityNotFound(_0x4859ac,null))[_0xd753('0x22')](function(_0x477c5a){if(_0x477c5a){_0x2be4cb[_0xd753('0x2c')]=_[_0xd753('0x45')](db[_0xd753('0x4d')][_0xd753('0x44')]);_0x2be4cb[_0xd753('0x2e')]=_[_0xd753('0x45')](_0x4ba36b[_0xd753('0x2e')]);_0x2be4cb[_0xd753('0x2f')]=_[_0xd753('0x31')](_0x2be4cb[_0xd753('0x2c')],_0x2be4cb[_0xd753('0x2e')]);_0x4fa6d9[_0xd753('0x30')]=_[_0xd753('0x31')](_0x2be4cb[_0xd753('0x2c')],qs['fields'](_0x4ba36b[_0xd753('0x2e')][_0xd753('0x32')]));_0x4fa6d9[_0xd753('0x30')]=_0x4fa6d9['attributes'][_0xd753('0x33')]?_0x4fa6d9['attributes']:_0x2be4cb[_0xd753('0x2c')];if(!_0x4ba36b[_0xd753('0x2e')][_0xd753('0x34')](_0xd753('0x35'))){_0x4fa6d9[_0xd753('0x1b')]=qs[_0xd753('0x1b')](_0x4ba36b[_0xd753('0x2e')][_0xd753('0x1b')]);_0x4fa6d9[_0xd753('0x1a')]=qs[_0xd753('0x1a')](_0x4ba36b[_0xd753('0x2e')][_0xd753('0x1a')]);}_0x4fa6d9['order']=qs[_0xd753('0x37')](_0x4ba36b[_0xd753('0x2e')][_0xd753('0x37')]);_0x4fa6d9[_0xd753('0x3b')]=qs[_0xd753('0x2f')](_['pick'](_0x4ba36b[_0xd753('0x2e')],_0x2be4cb[_0xd753('0x2f')]));_0x4fa6d9['where']['SessionId']=_0x477c5a['id'];if(_0x4ba36b[_0xd753('0x2e')]['filter']){_0x4fa6d9[_0xd753('0x3b')]=_['merge'](_0x4fa6d9['where'],{'$or':_[_0xd753('0x2d')](_0x4fa6d9[_0xd753('0x30')],function(_0x274406){var _0x14da2a={};_0x14da2a[_0x274406]={'$like':'%'+_0x4ba36b[_0xd753('0x2e')][_0xd753('0x39')]+'%'};return _0x14da2a;})});}_0x4fa6d9=_[_0xd753('0x3a')]({},_0x4fa6d9,_0x4ba36b[_0xd753('0x3d')]);return db[_0xd753('0x4d')]['count']({'where':_0x4fa6d9[_0xd753('0x3b')]})[_0xd753('0x22')](function(_0x36c2e1){_0x4bbe54[_0xd753('0x19')]=_0x36c2e1;if(_0x4ba36b[_0xd753('0x2e')][_0xd753('0x3e')]){_0x4fa6d9[_0xd753('0x3f')]=[{'all':!![]}];}return db[_0xd753('0x4d')]['findAll'](_0x4fa6d9);})['then'](function(_0xfe871b){_0x4bbe54['rows']=_0xfe871b;return _0x4bbe54;});}})['then'](respondWithFilteredResult(_0x4859ac,_0x4fa6d9))[_0xd753('0x47')](handleError(_0x4859ac,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index ed6e1b0..34a8adf 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 _0x550c=['bluebird','request-promise','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment'];(function(_0xfa5e44,_0x1a279e){var _0x114baa=function(_0x3d48e0){while(--_0x3d48e0){_0xfa5e44['push'](_0xfa5e44['shift']());}};_0x114baa(++_0x1a279e);}(_0x550c,0xd8));var _0xc550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc550('0x0'));var util=require(_0xc550('0x1'));var logger=require(_0xc550('0x2'))(_0xc550('0x3'));var moment=require(_0xc550('0x4'));var BPromise=require(_0xc550('0x5'));var rp=require(_0xc550('0x6'));var fs=require('fs');var path=require(_0xc550('0x7'));var rimraf=require(_0xc550('0x8'));var config=require('../../config/environment');var attributes=require(_0xc550('0x9'));module[_0xc550('0xa')]=function(_0x51c514,_0x5edb02){return _0x51c514[_0xc550('0xb')](_0xc550('0xc'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4698=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','report_jscripty_sessions'];(function(_0x39d76b,_0x41d1e4){var _0x545f4c=function(_0x263d4d){while(--_0x263d4d){_0x39d76b['push'](_0x39d76b['shift']());}};_0x545f4c(++_0x41d1e4);}(_0x4698,0x1ef));var _0x8469=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x4698[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x8469('0x0'));var util=require(_0x8469('0x1'));var logger=require(_0x8469('0x2'))('api');var moment=require(_0x8469('0x3'));var BPromise=require('bluebird');var rp=require(_0x8469('0x4'));var fs=require('fs');var path=require(_0x8469('0x5'));var rimraf=require(_0x8469('0x6'));var config=require(_0x8469('0x7'));var attributes=require('./jscriptySessionReport.attributes');module[_0x8469('0x8')]=function(_0x3a5b81,_0xb9d79c){return _0x3a5b81[_0x8469('0x9')]('JscriptySessionReport',attributes,{'tableName':_0x8469('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index f861cfc..ce1aeaa 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 _0x27af=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x380730,_0x13da62){var _0x3723f3=function(_0x22dd07){while(--_0x22dd07){_0x380730['push'](_0x380730['shift']());}};_0x3723f3(++_0x13da62);}(_0x27af,0x123));var _0xf27a=function(_0xa0b673,_0x2029c0){_0xa0b673=_0xa0b673-0x0;var _0x49507b=_0x27af[_0xa0b673];return _0x49507b;};'use strict';var _=require(_0xf27a('0x0'));var util=require(_0xf27a('0x1'));var moment=require('moment');var BPromise=require(_0xf27a('0x2'));var rs=require(_0xf27a('0x3'));var fs=require('fs');var Redis=require(_0xf27a('0x4'));var db=require(_0xf27a('0x5'))['db'];var utils=require(_0xf27a('0x6'));var logger=require('../../config/logger')(_0xf27a('0x7'));var config=require(_0xf27a('0x8'));var jayson=require(_0xf27a('0x9'));var client=jayson['client'][_0xf27a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35380c,_0x8eb929,_0x2979cb){return new BPromise(function(_0x5a0b7f,_0x571954){return client[_0xf27a('0xb')](_0x35380c,_0x2979cb)[_0xf27a('0xc')](function(_0x5e59d1){logger['info'](_0xf27a('0xd'),_0x8eb929,_0xf27a('0xe'));logger[_0xf27a('0xf')](_0xf27a('0x10'),_0x8eb929,'request\x20sent',JSON[_0xf27a('0x11')](_0x5e59d1));if(_0x5e59d1[_0xf27a('0x12')]){if(_0x5e59d1[_0xf27a('0x12')][_0xf27a('0x13')]===0x1f4){logger[_0xf27a('0x12')](_0xf27a('0xd'),_0x8eb929,_0x5e59d1['error']['message']);return _0x571954(_0x5e59d1[_0xf27a('0x12')][_0xf27a('0x14')]);}logger['error'](_0xf27a('0xd'),_0x8eb929,_0x5e59d1[_0xf27a('0x12')][_0xf27a('0x14')]);return _0x5a0b7f(_0x5e59d1[_0xf27a('0x12')][_0xf27a('0x14')]);}else{logger[_0xf27a('0x15')](_0xf27a('0xd'),_0x8eb929,_0xf27a('0xe'));_0x5a0b7f(_0x5e59d1[_0xf27a('0x16')][_0xf27a('0x14')]);}})[_0xf27a('0x17')](function(_0x2fada6){logger[_0xf27a('0x12')](_0xf27a('0xd'),_0x8eb929,_0x2fada6);_0x571954(_0x2fada6);});});} \ No newline at end of file +var _0xbc8d=['rpc','jayson/promise','client','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x52329e,_0x2f7d14){var _0x562052=function(_0x2fdf8e){while(--_0x2fdf8e){_0x52329e['push'](_0x52329e['shift']());}};_0x562052(++_0x2f7d14);}(_0xbc8d,0x7d));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdbc8('0x0'));var util=require('util');var moment=require(_0xdbc8('0x1'));var BPromise=require('bluebird');var rs=require(_0xdbc8('0x2'));var fs=require('fs');var Redis=require(_0xdbc8('0x3'));var db=require(_0xdbc8('0x4'))['db'];var utils=require(_0xdbc8('0x5'));var logger=require(_0xdbc8('0x6'))(_0xdbc8('0x7'));var config=require('../../config/environment');var jayson=require(_0xdbc8('0x8'));var client=jayson[_0xdbc8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fca8a,_0x4b9ca8,_0x488d28){return new BPromise(function(_0x38fc82,_0x265c03){return client[_0xdbc8('0xa')](_0x3fca8a,_0x488d28)['then'](function(_0x2d6d75){logger[_0xdbc8('0xb')](_0xdbc8('0xc'),_0x4b9ca8,_0xdbc8('0xd'));logger[_0xdbc8('0xe')](_0xdbc8('0xf'),_0x4b9ca8,_0xdbc8('0xd'),JSON[_0xdbc8('0x10')](_0x2d6d75));if(_0x2d6d75['error']){if(_0x2d6d75[_0xdbc8('0x11')][_0xdbc8('0x12')]===0x1f4){logger[_0xdbc8('0x11')](_0xdbc8('0xc'),_0x4b9ca8,_0x2d6d75[_0xdbc8('0x11')][_0xdbc8('0x13')]);return _0x265c03(_0x2d6d75[_0xdbc8('0x11')][_0xdbc8('0x13')]);}logger['error'](_0xdbc8('0xc'),_0x4b9ca8,_0x2d6d75[_0xdbc8('0x11')][_0xdbc8('0x13')]);return _0x38fc82(_0x2d6d75[_0xdbc8('0x11')][_0xdbc8('0x13')]);}else{logger[_0xdbc8('0xb')](_0xdbc8('0xc'),_0x4b9ca8,'request\x20sent');_0x38fc82(_0x2d6d75[_0xdbc8('0x14')][_0xdbc8('0x13')]);}})[_0xdbc8('0x15')](function(_0x4a292a){logger[_0xdbc8('0x11')](_0xdbc8('0xc'),_0x4b9ca8,_0x4a292a);_0x265c03(_0x4a292a);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index c77c703..e81d9a7 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 _0x5510=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put','/:id','update'];(function(_0x4f72f3,_0x5a0e3a){var _0x2384cb=function(_0x436e55){while(--_0x436e55){_0x4f72f3['push'](_0x4f72f3['shift']());}};_0x2384cb(++_0x5a0e3a);}(_0x5510,0x8d));var _0x0551=function(_0x2bb3f6,_0x25fde0){_0x2bb3f6=_0x2bb3f6-0x0;var _0x62b339=_0x5510[_0x2bb3f6];return _0x62b339;};'use strict';var multer=require(_0x0551('0x0'));var util=require(_0x0551('0x1'));var path=require(_0x0551('0x2'));var timeout=require(_0x0551('0x3'));var express=require(_0x0551('0x4'));var router=express[_0x0551('0x5')]();var auth=require(_0x0551('0x6'));var interaction=require(_0x0551('0x7'));var config=require(_0x0551('0x8'));var controller=require('./license.controller');router['get']('/',controller[_0x0551('0x9')]);router[_0x0551('0xa')](_0x0551('0xb'),auth['isAuthenticated'](),controller[_0x0551('0xc')]);module[_0x0551('0xd')]=router; \ No newline at end of file +var _0x758b=['connect-timeout','express','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','multer','util','path'];(function(_0x19d83d,_0x237e57){var _0xf5b44=function(_0x2ded82){while(--_0x2ded82){_0x19d83d['push'](_0x19d83d['shift']());}};_0xf5b44(++_0x237e57);}(_0x758b,0x1dd));var _0xb758=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x758b[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0xb758('0x0'));var util=require(_0xb758('0x1'));var path=require(_0xb758('0x2'));var timeout=require(_0xb758('0x3'));var express=require(_0xb758('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb758('0x5'));var config=require(_0xb758('0x6'));var controller=require(_0xb758('0x7'));router[_0xb758('0x8')]('/',controller[_0xb758('0x9')]);router['put'](_0xb758('0xa'),auth[_0xb758('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index d002df7..82acbc6 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 _0xc6ac=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0xfad617,_0x463f40){var _0x56d65a=function(_0x21da35){while(--_0x21da35){_0xfad617['push'](_0xfad617['shift']());}};_0x56d65a(++_0x463f40);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4d3c02,_0x385216){_0x4d3c02=_0x4d3c02-0x0;var _0x3c6f04=_0xc6ac[_0x4d3c02];return _0x3c6f04;};'use strict';var Sequelize=require(_0xcc6a('0x0'));module[_0xcc6a('0x1')]={'license':{'type':Sequelize[_0xcc6a('0x2')]},'data1':{'type':Sequelize[_0xcc6a('0x3')]},'data2':{'type':Sequelize[_0xcc6a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xcc6a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7a54=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0x7a54,0x106));var _0x47a5=function(_0x1434b9,_0x277046){_0x1434b9=_0x1434b9-0x0;var _0x7efdf8=_0x7a54[_0x1434b9];return _0x7efdf8;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'license':{'type':Sequelize[_0x47a5('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x47a5('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 5c5f1fe..388a6ee 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 _0x2750=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','../../config/license/util','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','catch','body','params','get','checkLicense','key','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x332456,_0xe92667){var _0x3efd6d=function(_0x48cd73){while(--_0x48cd73){_0x332456['push'](_0x332456['shift']());}};_0x3efd6d(++_0xe92667);}(_0x2750,0xd0));var _0x0275=function(_0x1fa332,_0x28a3cc){_0x1fa332=_0x1fa332-0x0;var _0x2aa705=_0x2750[_0x1fa332];return _0x2aa705;};'use strict';var pdf=require(_0x0275('0x0'));var emlformat=require(_0x0275('0x1'));var rimraf=require(_0x0275('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0275('0x3'));var rp=require(_0x0275('0x4'));var moment=require(_0x0275('0x5'));var BPromise=require(_0x0275('0x6'));var Mustache=require(_0x0275('0x7'));var util=require(_0x0275('0x8'));var path=require('path');var sox=require(_0x0275('0x9'));var csv=require(_0x0275('0xa'));var ejs=require(_0x0275('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0275('0xc'));var crypto=require('crypto');var jsforce=require(_0x0275('0xd'));var deskjs=require(_0x0275('0xe'));var toCsv=require(_0x0275('0xa'));var querystring=require(_0x0275('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0275('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0275('0x11'));var logger=require('../../config/logger')(_0x0275('0x12'));var utils=require(_0x0275('0x13'));var config=require(_0x0275('0x14'));var db=require(_0x0275('0x15'))['db'];function respondWithStatusCode(_0x293d02,_0x26da92){_0x26da92=_0x26da92||0xcc;return function(_0x2adad5){if(_0x2adad5){return _0x293d02['sendStatus'](_0x26da92);}return _0x293d02[_0x0275('0x16')](_0x26da92)[_0x0275('0x17')]();};}function respondWithResult(_0x1d4d50,_0xa4f99c){_0xa4f99c=_0xa4f99c||0xc8;return function(_0x11abcd){if(_0x11abcd){return _0x1d4d50[_0x0275('0x16')](_0xa4f99c)[_0x0275('0x18')](_0x11abcd);}};}function respondWithFilteredResult(_0x1b33ae,_0x4cc1dd){return function(_0xea5b24){if(_0xea5b24){var _0x1eb2fb=_0xea5b24[_0x0275('0x19')],_0x7f81e7=_0x4cc1dd[_0x0275('0x1a')],_0x3bbe93=_0x4cc1dd[_0x0275('0x1a')]+_0x4cc1dd['limit'],_0x3f136d;if(_0x3bbe93>=_0x1eb2fb){_0x3bbe93=_0x1eb2fb;_0x3f136d=0xc8;}else{_0x3f136d=0xce;}_0x1b33ae[_0x0275('0x16')](_0x3f136d);return _0x1b33ae[_0x0275('0x1b')](_0x0275('0x1c'),_0x7f81e7+'-'+_0x3bbe93+'/'+_0x1eb2fb)[_0x0275('0x18')](_0xea5b24);}return null;};}function patchUpdates(_0x16a944){return function(_0x27a2a8){try{jsonpatch[_0x0275('0x1d')](_0x27a2a8,_0x16a944,!![]);}catch(_0x31acbf){return BPromise['reject'](_0x31acbf);}return _0x27a2a8['save']();};}function saveUpdates(_0x3de1fd,_0x26f72b){return function(_0x2e5df0){if(_0x2e5df0){return _0x2e5df0[_0x0275('0x1e')](_0x3de1fd)[_0x0275('0x1f')](function(_0x4808ca){return _0x4808ca;});}return null;};}function removeEntity(_0x49669d,_0x48b6c1){return function(_0x2e4846){if(_0x2e4846){return _0x2e4846[_0x0275('0x20')]()['then'](function(){_0x49669d[_0x0275('0x16')](0xcc)[_0x0275('0x17')]();});}};}function handleEntityNotFound(_0x18e536,_0x206ca7){return function(_0x934259){if(!_0x934259){_0x18e536[_0x0275('0x21')](0x194);}return _0x934259;};}function handleError(_0x38ce4b,_0x55e0a5){_0x55e0a5=_0x55e0a5||0x1f4;return function(_0x16cbb4){logger[_0x0275('0x22')](_0x16cbb4[_0x0275('0x23')]);if(_0x16cbb4[_0x0275('0x24')]){delete _0x16cbb4[_0x0275('0x24')];}_0x38ce4b['status'](_0x55e0a5)['send'](_0x16cbb4);};}var utilLicense=require(_0x0275('0x25'));exports['index']=function(_0x2bd084,_0x1e8d68){var _0x528f83={'raw':!![],'where':{'id':0x1}},_0x232f43={};_0x232f43[_0x0275('0x26')]=_[_0x0275('0x27')](db[_0x0275('0x28')][_0x0275('0x29')]);_0x232f43[_0x0275('0x2a')]=_[_0x0275('0x27')](_0x2bd084[_0x0275('0x2a')]);_0x232f43['filters']=_[_0x0275('0x2b')](_0x232f43[_0x0275('0x26')],_0x232f43[_0x0275('0x2a')]);_0x528f83[_0x0275('0x2c')]=_[_0x0275('0x2b')](_0x232f43[_0x0275('0x26')],qs[_0x0275('0x2d')](_0x2bd084[_0x0275('0x2a')][_0x0275('0x2d')]));_0x528f83[_0x0275('0x2c')]=_0x528f83[_0x0275('0x2c')]['length']?_0x528f83[_0x0275('0x2c')]:_0x232f43[_0x0275('0x26')];_0x528f83=_[_0x0275('0x2e')]({},_0x528f83,_0x2bd084['options']);return utilLicense['getLicense'](_0x528f83)['then'](respondWithResult(_0x1e8d68,null))[_0x0275('0x2f')](handleError(_0x1e8d68,null));};exports[_0x0275('0x1e')]=function(_0xe5dfa7,_0x14eb1a){if(_0xe5dfa7['body']['id']){delete _0xe5dfa7[_0x0275('0x30')]['id'];}return db[_0x0275('0x28')]['find']({'where':{'id':_0xe5dfa7[_0x0275('0x31')]['id']}})[_0x0275('0x1f')](handleEntityNotFound(_0x14eb1a,null))[_0x0275('0x1f')](function(_0x3c4cf9){var _0x3bb79d=_0x3c4cf9[_0x0275('0x32')]({'plain':!![]});return utilLicense[_0x0275('0x33')](_0x3bb79d,_0xe5dfa7[_0x0275('0x30')][_0x0275('0x34')]);})[_0x0275('0x1f')](function(_0x13a109){if(!_0x13a109['demo']){return saveUpdates(_0xe5dfa7[_0x0275('0x30')],null);}return _0x13a109;})[_0x0275('0x1f')](respondWithResult(_0x14eb1a,null))[_0x0275('0x2f')](handleError(_0x14eb1a,null));}; \ No newline at end of file +var _0xe8b1=['../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','../../config/license/util','index','model','keys','rawAttributes','query','intersection','attributes','fields','length','merge','getLicense','catch','body','params','get','checkLicense','key','demo','html-pdf','eml-format','zip-dir','moment','util','path','to-csv','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x23bc85,_0x2314e8){var _0x414661=function(_0xe0ac93){while(--_0xe0ac93){_0x23bc85['push'](_0x23bc85['shift']());}};_0x414661(++_0x2314e8);}(_0xe8b1,0x1ee));var _0x1e8b=function(_0x5a69ab,_0x610049){_0x5a69ab=_0x5a69ab-0x0;var _0x27f2f7=_0xe8b1[_0x5a69ab];return _0x27f2f7;};'use strict';var pdf=require(_0x1e8b('0x0'));var emlformat=require(_0x1e8b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1e8b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1e8b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1e8b('0x4'));var path=require(_0x1e8b('0x5'));var sox=require('sox');var csv=require(_0x1e8b('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1e8b('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e8b('0x8'));var deskjs=require(_0x1e8b('0x9'));var toCsv=require(_0x1e8b('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1e8b('0xa'));var authService=require(_0x1e8b('0xb'));var qs=require(_0x1e8b('0xc'));var as=require(_0x1e8b('0xd'));var hardwareService=require(_0x1e8b('0xe'));var logger=require(_0x1e8b('0xf'))(_0x1e8b('0x10'));var utils=require(_0x1e8b('0x11'));var config=require(_0x1e8b('0x12'));var db=require(_0x1e8b('0x13'))['db'];function respondWithStatusCode(_0x53d327,_0x278153){_0x278153=_0x278153||0xcc;return function(_0x5f131a){if(_0x5f131a){return _0x53d327['sendStatus'](_0x278153);}return _0x53d327[_0x1e8b('0x14')](_0x278153)[_0x1e8b('0x15')]();};}function respondWithResult(_0x15cb44,_0x54720c){_0x54720c=_0x54720c||0xc8;return function(_0x4d7a4e){if(_0x4d7a4e){return _0x15cb44[_0x1e8b('0x14')](_0x54720c)[_0x1e8b('0x16')](_0x4d7a4e);}};}function respondWithFilteredResult(_0x30c4b8,_0x597a6a){return function(_0xa38105){if(_0xa38105){var _0x1fc18c=_0xa38105[_0x1e8b('0x17')],_0x8e5237=_0x597a6a[_0x1e8b('0x18')],_0x5c5ef4=_0x597a6a[_0x1e8b('0x18')]+_0x597a6a['limit'],_0x395343;if(_0x5c5ef4>=_0x1fc18c){_0x5c5ef4=_0x1fc18c;_0x395343=0xc8;}else{_0x395343=0xce;}_0x30c4b8[_0x1e8b('0x14')](_0x395343);return _0x30c4b8[_0x1e8b('0x19')](_0x1e8b('0x1a'),_0x8e5237+'-'+_0x5c5ef4+'/'+_0x1fc18c)[_0x1e8b('0x16')](_0xa38105);}return null;};}function patchUpdates(_0xd53f62){return function(_0x4d8dba){try{jsonpatch[_0x1e8b('0x1b')](_0x4d8dba,_0xd53f62,!![]);}catch(_0x12b1d4){return BPromise[_0x1e8b('0x1c')](_0x12b1d4);}return _0x4d8dba[_0x1e8b('0x1d')]();};}function saveUpdates(_0x27ad9b,_0x2aa307){return function(_0xe600c7){if(_0xe600c7){return _0xe600c7[_0x1e8b('0x1e')](_0x27ad9b)['then'](function(_0x19bfc){return _0x19bfc;});}return null;};}function removeEntity(_0x4dc697,_0x194a1b){return function(_0x4e0da7){if(_0x4e0da7){return _0x4e0da7[_0x1e8b('0x1f')]()[_0x1e8b('0x20')](function(){_0x4dc697[_0x1e8b('0x14')](0xcc)[_0x1e8b('0x15')]();});}};}function handleEntityNotFound(_0x532a55,_0x3214db){return function(_0x416fa7){if(!_0x416fa7){_0x532a55[_0x1e8b('0x21')](0x194);}return _0x416fa7;};}function handleError(_0x591aef,_0x5a2bbb){_0x5a2bbb=_0x5a2bbb||0x1f4;return function(_0x19606f){logger[_0x1e8b('0x22')](_0x19606f[_0x1e8b('0x23')]);if(_0x19606f['name']){delete _0x19606f[_0x1e8b('0x24')];}_0x591aef['status'](_0x5a2bbb)[_0x1e8b('0x25')](_0x19606f);};}var utilLicense=require(_0x1e8b('0x26'));exports[_0x1e8b('0x27')]=function(_0x4de2e7,_0x4a865d){var _0x5e8e1c={'raw':!![],'where':{'id':0x1}},_0x40525a={};_0x40525a[_0x1e8b('0x28')]=_[_0x1e8b('0x29')](db['License'][_0x1e8b('0x2a')]);_0x40525a[_0x1e8b('0x2b')]=_[_0x1e8b('0x29')](_0x4de2e7['query']);_0x40525a['filters']=_[_0x1e8b('0x2c')](_0x40525a[_0x1e8b('0x28')],_0x40525a[_0x1e8b('0x2b')]);_0x5e8e1c[_0x1e8b('0x2d')]=_['intersection'](_0x40525a[_0x1e8b('0x28')],qs['fields'](_0x4de2e7[_0x1e8b('0x2b')][_0x1e8b('0x2e')]));_0x5e8e1c['attributes']=_0x5e8e1c[_0x1e8b('0x2d')][_0x1e8b('0x2f')]?_0x5e8e1c['attributes']:_0x40525a['model'];_0x5e8e1c=_[_0x1e8b('0x30')]({},_0x5e8e1c,_0x4de2e7['options']);return utilLicense[_0x1e8b('0x31')](_0x5e8e1c)[_0x1e8b('0x20')](respondWithResult(_0x4a865d,null))[_0x1e8b('0x32')](handleError(_0x4a865d,null));};exports[_0x1e8b('0x1e')]=function(_0x5003be,_0x33358b){if(_0x5003be[_0x1e8b('0x33')]['id']){delete _0x5003be[_0x1e8b('0x33')]['id'];}return db['License']['find']({'where':{'id':_0x5003be[_0x1e8b('0x34')]['id']}})[_0x1e8b('0x20')](handleEntityNotFound(_0x33358b,null))[_0x1e8b('0x20')](function(_0x357e82){var _0x36ba4f=_0x357e82[_0x1e8b('0x35')]({'plain':!![]});return utilLicense[_0x1e8b('0x36')](_0x36ba4f,_0x5003be[_0x1e8b('0x33')][_0x1e8b('0x37')]);})[_0x1e8b('0x20')](function(_0x2f2150){if(!_0x2f2150[_0x1e8b('0x38')]){return saveUpdates(_0x5003be[_0x1e8b('0x33')],null);}return _0x2f2150;})[_0x1e8b('0x20')](respondWithResult(_0x33358b,null))[_0x1e8b('0x32')](handleError(_0x33358b,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 685dd54..6725ee0 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 _0x10c4=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define','License','license','lodash'];(function(_0x1974ff,_0x45df50){var _0x12b7db=function(_0x4e9844){while(--_0x4e9844){_0x1974ff['push'](_0x1974ff['shift']());}};_0x12b7db(++_0x45df50);}(_0x10c4,0x16b));var _0x410c=function(_0x49b32e,_0x3d9ad2){_0x49b32e=_0x49b32e-0x0;var _0x4023eb=_0x10c4[_0x49b32e];return _0x4023eb;};'use strict';var _=require(_0x410c('0x0'));var util=require('util');var logger=require(_0x410c('0x1'))(_0x410c('0x2'));var moment=require(_0x410c('0x3'));var BPromise=require(_0x410c('0x4'));var rp=require(_0x410c('0x5'));var fs=require('fs');var path=require(_0x410c('0x6'));var rimraf=require('rimraf');var config=require(_0x410c('0x7'));var attributes=require(_0x410c('0x8'));module[_0x410c('0x9')]=function(_0xff4178,_0xa9bd5d){return _0xff4178[_0x410c('0xa')](_0x410c('0xb'),attributes,{'tableName':_0x410c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83f3=['api','path','rimraf','./license.attributes','exports','define','License','license','lodash','util','../../config/logger'];(function(_0x5876ad,_0x2150c0){var _0x4d46f7=function(_0x23e6af){while(--_0x23e6af){_0x5876ad['push'](_0x5876ad['shift']());}};_0x4d46f7(++_0x2150c0);}(_0x83f3,0x15d));var _0x383f=function(_0x4d5247,_0x5eb1d1){_0x4d5247=_0x4d5247-0x0;var _0x13b424=_0x83f3[_0x4d5247];return _0x13b424;};'use strict';var _=require(_0x383f('0x0'));var util=require(_0x383f('0x1'));var logger=require(_0x383f('0x2'))(_0x383f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x383f('0x4'));var rimraf=require(_0x383f('0x5'));var config=require('../../config/environment');var attributes=require(_0x383f('0x6'));module[_0x383f('0x7')]=function(_0x8929d7,_0x2fdd2c){return _0x8929d7[_0x383f('0x8')](_0x383f('0x9'),attributes,{'tableName':_0x383f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index b78c60c..f25a0ad 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 _0xe3ed=['message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x12907d,_0x4e4525){var _0x5c140e=function(_0x49ad02){while(--_0x49ad02){_0x12907d['push'](_0x12907d['shift']());}};_0x5c140e(++_0x4e4525);}(_0xe3ed,0x8d));var _0xde3e=function(_0x472d5b,_0x7c2dd8){_0x472d5b=_0x472d5b-0x0;var _0x4ae340=_0xe3ed[_0x472d5b];return _0x4ae340;};'use strict';var _=require(_0xde3e('0x0'));var util=require(_0xde3e('0x1'));var moment=require(_0xde3e('0x2'));var BPromise=require(_0xde3e('0x3'));var rs=require(_0xde3e('0x4'));var fs=require('fs');var Redis=require(_0xde3e('0x5'));var db=require(_0xde3e('0x6'))['db'];var utils=require(_0xde3e('0x7'));var logger=require('../../config/logger')(_0xde3e('0x8'));var config=require(_0xde3e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xde3e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x184b02,_0x4c4ac6,_0x47e97f){return new BPromise(function(_0x3e0bb4,_0x3b1597){return client[_0xde3e('0xb')](_0x184b02,_0x47e97f)[_0xde3e('0xc')](function(_0x76daf5){logger['info'](_0xde3e('0xd'),_0x4c4ac6,_0xde3e('0xe'));logger[_0xde3e('0xf')](_0xde3e('0x10'),_0x4c4ac6,'request\x20sent',JSON[_0xde3e('0x11')](_0x76daf5));if(_0x76daf5[_0xde3e('0x12')]){if(_0x76daf5['error'][_0xde3e('0x13')]===0x1f4){logger[_0xde3e('0x12')]('License,\x20%s,\x20%s',_0x4c4ac6,_0x76daf5[_0xde3e('0x12')]['message']);return _0x3b1597(_0x76daf5[_0xde3e('0x12')][_0xde3e('0x14')]);}logger[_0xde3e('0x12')]('License,\x20%s,\x20%s',_0x4c4ac6,_0x76daf5[_0xde3e('0x12')][_0xde3e('0x14')]);return _0x3e0bb4(_0x76daf5['error']['message']);}else{logger[_0xde3e('0x15')](_0xde3e('0xd'),_0x4c4ac6,_0xde3e('0xe'));_0x3e0bb4(_0x76daf5['result']['message']);}})[_0xde3e('0x16')](function(_0x5e041a){logger['error'](_0xde3e('0xd'),_0x4c4ac6,_0x5e041a);_0x3b1597(_0x5e041a);});});} \ No newline at end of file +var _0x8369=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8369,0x10b));var _0x9836=function(_0x188d6b,_0x21f508){_0x188d6b=_0x188d6b-0x0;var _0xed9b9c=_0x8369[_0x188d6b];return _0xed9b9c;};'use strict';var _=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var moment=require(_0x9836('0x2'));var BPromise=require(_0x9836('0x3'));var rs=require(_0x9836('0x4'));var fs=require('fs');var Redis=require(_0x9836('0x5'));var db=require(_0x9836('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9836('0x7'))('rpc');var config=require(_0x9836('0x8'));var jayson=require(_0x9836('0x9'));var client=jayson['client'][_0x9836('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e4979,_0x52ae78,_0x37214e){return new BPromise(function(_0x3007ed,_0x16db95){return client[_0x9836('0xb')](_0x2e4979,_0x37214e)['then'](function(_0x30bc66){logger[_0x9836('0xc')](_0x9836('0xd'),_0x52ae78,_0x9836('0xe'));logger['debug'](_0x9836('0xf'),_0x52ae78,_0x9836('0xe'),JSON[_0x9836('0x10')](_0x30bc66));if(_0x30bc66[_0x9836('0x11')]){if(_0x30bc66[_0x9836('0x11')]['code']===0x1f4){logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);return _0x16db95(_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);}logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x30bc66['error'][_0x9836('0x12')]);return _0x3007ed(_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);}else{logger['info'](_0x9836('0xd'),_0x52ae78,'request\x20sent');_0x3007ed(_0x30bc66[_0x9836('0x13')]['message']);}})[_0x9836('0x14')](function(_0x22f9b5){logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x22f9b5);_0x16db95(_0x22f9b5);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 518e511..617868f 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 _0xc1e5=['post','addDisposition','addAnswer','create','/:id/in_servers','addImap','addApplications','put','/:id','update','delete','removeAnswers','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents'];(function(_0x14f89e,_0x139fce){var _0x26092d=function(_0x2bdc20){while(--_0x2bdc20){_0x14f89e['push'](_0x14f89e['shift']());}};_0x26092d(++_0x139fce);}(_0xc1e5,0x12d));var _0x5c1e=function(_0x57d5dc,_0x41d9e2){_0x57d5dc=_0x57d5dc-0x0;var _0x30fe01=_0xc1e5[_0x57d5dc];return _0x30fe01;};'use strict';var multer=require(_0x5c1e('0x0'));var util=require('util');var path=require(_0x5c1e('0x1'));var timeout=require(_0x5c1e('0x2'));var express=require('express');var router=express[_0x5c1e('0x3')]();var auth=require(_0x5c1e('0x4'));var interaction=require(_0x5c1e('0x5'));var config=require(_0x5c1e('0x6'));var controller=require('./mailAccount.controller');router[_0x5c1e('0x7')]('/',auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x9')]);router[_0x5c1e('0x7')]('/describe',auth[_0x5c1e('0x8')](),controller[_0x5c1e('0xa')]);router[_0x5c1e('0x7')]('/:id',auth[_0x5c1e('0x8')](),controller['show']);router[_0x5c1e('0x7')](_0x5c1e('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x5c1e('0xc'),auth[_0x5c1e('0x8')](),controller[_0x5c1e('0xd')]);router[_0x5c1e('0x7')]('/:id/in_servers',auth[_0x5c1e('0x8')](),controller[_0x5c1e('0xe')]);router[_0x5c1e('0x7')](_0x5c1e('0xf'),auth['isAuthenticated'](),controller[_0x5c1e('0x10')]);router[_0x5c1e('0x7')](_0x5c1e('0x11'),auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x12')]);router[_0x5c1e('0x7')](_0x5c1e('0x13'),auth['isAuthenticated'](),controller[_0x5c1e('0x14')]);router[_0x5c1e('0x7')](_0x5c1e('0x15'),auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x16')]);router['get'](_0x5c1e('0x17'),auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x18')]);router['get'](_0x5c1e('0x19'),auth['isAuthenticated'](),controller[_0x5c1e('0x1a')]);router[_0x5c1e('0x1b')](_0x5c1e('0xb'),auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x1c')]);router[_0x5c1e('0x1b')](_0x5c1e('0xc'),auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x1d')]);router['post']('/',auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x1e')]);router[_0x5c1e('0x1b')](_0x5c1e('0x1f'),auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x20')]);router[_0x5c1e('0x1b')](_0x5c1e('0xf'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x5c1e('0x1b')](_0x5c1e('0x11'),auth[_0x5c1e('0x8')](),controller['addInteraction']);router['post'](_0x5c1e('0x13'),auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x21')]);router[_0x5c1e('0x1b')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x5c1e('0x1b')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x5c1e('0x22')](_0x5c1e('0x23'),auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x24')]);router[_0x5c1e('0x25')](_0x5c1e('0xb'),auth[_0x5c1e('0x8')](),controller['removeDispositions']);router[_0x5c1e('0x25')](_0x5c1e('0xc'),auth['isAuthenticated'](),controller[_0x5c1e('0x26')]);router['delete'](_0x5c1e('0x1f'),auth[_0x5c1e('0x8')](),controller['removeImap']);router[_0x5c1e('0x25')]('/:id/out_servers',auth[_0x5c1e('0x8')](),controller['removeSmtp']);router[_0x5c1e('0x25')]('/:id',auth[_0x5c1e('0x8')](),controller[_0x5c1e('0x27')]);router[_0x5c1e('0x25')](_0x5c1e('0x19'),auth[_0x5c1e('0x8')](),controller['removeAgents']);module[_0x5c1e('0x28')]=router; \ No newline at end of file +var _0xcd6d=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','/describe','describe','/:id','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','addAnswer','create','/:id/in_servers','addSmtp','addInteraction','/:id/send','send','addAgents','put','delete','removeAnswers','removeImap','destroy','removeAgents','exports','multer'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xcd6d,0x147));var _0xdcd6=function(_0x52f823,_0x1710be){_0x52f823=_0x52f823-0x0;var _0xbeed7a=_0xcd6d[_0x52f823];return _0xbeed7a;};'use strict';var multer=require(_0xdcd6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdcd6('0x1'));var express=require(_0xdcd6('0x2'));var router=express[_0xdcd6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xdcd6('0x4'));var config=require(_0xdcd6('0x5'));var controller=require(_0xdcd6('0x6'));router[_0xdcd6('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdcd6('0x7')](_0xdcd6('0x8'),auth['isAuthenticated'](),controller[_0xdcd6('0x9')]);router[_0xdcd6('0x7')](_0xdcd6('0xa'),auth[_0xdcd6('0xb')](),controller['show']);router[_0xdcd6('0x7')](_0xdcd6('0xc'),auth[_0xdcd6('0xb')](),controller[_0xdcd6('0xd')]);router[_0xdcd6('0x7')](_0xdcd6('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router['get']('/:id/in_servers',auth[_0xdcd6('0xb')](),controller[_0xdcd6('0xf')]);router[_0xdcd6('0x7')](_0xdcd6('0x10'),auth[_0xdcd6('0xb')](),controller[_0xdcd6('0x11')]);router[_0xdcd6('0x7')](_0xdcd6('0x12'),auth[_0xdcd6('0xb')](),controller[_0xdcd6('0x13')]);router[_0xdcd6('0x7')](_0xdcd6('0x14'),auth[_0xdcd6('0xb')](),controller[_0xdcd6('0x15')]);router['get'](_0xdcd6('0x16'),auth['isAuthenticated'](),controller[_0xdcd6('0x17')]);router[_0xdcd6('0x7')]('/:id/verify',auth[_0xdcd6('0xb')](),controller['verifySmtp']);router[_0xdcd6('0x7')](_0xdcd6('0x18'),auth['isAuthenticated'](),controller['getAgents']);router[_0xdcd6('0x19')](_0xdcd6('0xc'),auth[_0xdcd6('0xb')](),controller['addDisposition']);router[_0xdcd6('0x19')]('/:id/canned_answers',auth[_0xdcd6('0xb')](),controller[_0xdcd6('0x1a')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdcd6('0x1b')]);router[_0xdcd6('0x19')](_0xdcd6('0x1c'),auth[_0xdcd6('0xb')](),controller['addImap']);router[_0xdcd6('0x19')]('/:id/out_servers',auth[_0xdcd6('0xb')](),controller[_0xdcd6('0x1d')]);router[_0xdcd6('0x19')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xdcd6('0x1e')]);router[_0xdcd6('0x19')](_0xdcd6('0x14'),auth[_0xdcd6('0xb')](),controller['addApplications']);router[_0xdcd6('0x19')](_0xdcd6('0x1f'),auth[_0xdcd6('0xb')](),controller[_0xdcd6('0x20')]);router[_0xdcd6('0x19')](_0xdcd6('0x18'),auth[_0xdcd6('0xb')](),controller[_0xdcd6('0x21')]);router[_0xdcd6('0x22')](_0xdcd6('0xa'),auth[_0xdcd6('0xb')](),controller['update']);router['delete'](_0xdcd6('0xc'),auth[_0xdcd6('0xb')](),controller['removeDispositions']);router[_0xdcd6('0x23')](_0xdcd6('0xe'),auth['isAuthenticated'](),controller[_0xdcd6('0x24')]);router[_0xdcd6('0x23')](_0xdcd6('0x1c'),auth[_0xdcd6('0xb')](),controller[_0xdcd6('0x25')]);router[_0xdcd6('0x23')](_0xdcd6('0x10'),auth['isAuthenticated'](),controller['removeSmtp']);router[_0xdcd6('0x23')](_0xdcd6('0xa'),auth[_0xdcd6('0xb')](),controller[_0xdcd6('0x26')]);router[_0xdcd6('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0xdcd6('0x27')]);module[_0xdcd6('0x28')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 32a464d..0ad95ad 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 _0xc3e7=['sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x212fcd,_0x2fccc6){var _0x3c0f7b=function(_0x273176){while(--_0x273176){_0x212fcd['push'](_0x212fcd['shift']());}};_0x3c0f7b(++_0x2fccc6);}(_0xc3e7,0x104));var _0x7c3e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xc3e7[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0x7c3e('0x0'));module[_0x7c3e('0x1')]={'description':{'type':Sequelize[_0x7c3e('0x2')]},'name':{'type':Sequelize[_0x7c3e('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x7c3e('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x7c3e('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7c3e('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x7c3e('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x7c3e('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7c3e('0x2')],'allowNull':![],'defaultValue':_0x7c3e('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x7c3e('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7c3e('0x4')],'defaultValue':function(){return _0x7c3e('0x7');}},'notificationSound':{'type':Sequelize[_0x7c3e('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7c3e('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7c3e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7c3e('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7c3e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7c3e('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7c3e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7c3e('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x7c3e('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x215add){if(!_0x215add)this[_0x7c3e('0xa')](_0x7c3e('0xb'),null);this[_0x7c3e('0xa')](_0x7c3e('0xc'),_0x215add);}}}; \ No newline at end of file +var _0x5645=['sequelize','exports','STRING','BOOLEAN','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x4ffb73,_0x5a1c27){var _0x3dc7e4=function(_0xb2dab3){while(--_0xb2dab3){_0x4ffb73['push'](_0x4ffb73['shift']());}};_0x3dc7e4(++_0x5a1c27);}(_0x5645,0xbb));var _0x5564=function(_0x286147,_0x3f6f1e){_0x286147=_0x286147-0x0;var _0x1dd53e=_0x5645[_0x286147];return _0x1dd53e;};'use strict';var Sequelize=require(_0x5564('0x0'));module[_0x5564('0x1')]={'description':{'type':Sequelize[_0x5564('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x5564('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5564('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x5564('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5564('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x5564('0x4')](0x2)[_0x5564('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5564('0x6')],'defaultValue':function(){return _0x5564('0x7');}},'notificationSound':{'type':Sequelize[_0x5564('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5564('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5564('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5564('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5564('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5564('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5564('0x3')],'defaultValue':![],'comment':_0x5564('0x8'),'set':function(_0x339ec1){if(!_0x339ec1)this[_0x5564('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x5564('0xa'),_0x339ec1);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2353ebe..aadb172 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 _0x782b=['List','defaults','messageId','subject','attach','out','Interaction','VerifySmtp','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','Sequelize','ValidationError','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','count','offset','limit','set','apply','reject','MailAccounts','UserProfileResource','destroy','status','end','name','send','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','Imap','Smtp','keys','includeAll','include','find','update','body','params','describe','addDisposition','create','getDispositions','findOne','nolimit','MailAccountId','Disposition','rows','removeDispositions','ids','CannedAnswer','getAnswers','length','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','pass','cpassword','authentication','host','port','service','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','secure','auth','SendMail','sendMail','List\x20not\x20found'];(function(_0x5d2475,_0x2e64d8){var _0x4ba8b6=function(_0x3fbf63){while(--_0x3fbf63){_0x5d2475['push'](_0x5d2475['shift']());}};_0x4ba8b6(++_0x2e64d8);}(_0x782b,0x18b));var _0xb782=function(_0x4c85ca,_0x2086d9){_0x4c85ca=_0x4c85ca-0x0;var _0xe08ce3=_0x782b[_0x4c85ca];return _0xe08ce3;};'use strict';var pdf=require(_0xb782('0x0'));var emlformat=require(_0xb782('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb782('0x2'));var jsonpatch=require(_0xb782('0x3'));var rp=require(_0xb782('0x4'));var moment=require(_0xb782('0x5'));var BPromise=require(_0xb782('0x6'));var Mustache=require(_0xb782('0x7'));var util=require(_0xb782('0x8'));var path=require(_0xb782('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb782('0xa'));var crypto=require(_0xb782('0xb'));var jsforce=require(_0xb782('0xc'));var deskjs=require(_0xb782('0xd'));var toCsv=require(_0xb782('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb782('0xf'));var qs=require(_0xb782('0x10'));var as=require(_0xb782('0x11'));var hardwareService=require(_0xb782('0x12'));var logger=require('../../config/logger')(_0xb782('0x13'));var utils=require('../../config/utils');var config=require(_0xb782('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xb782('0x15')],{'host':_0xb782('0x16'),'port':0x18eb});var socket=require(_0xb782('0x17'))(new Redis(config['redis']));require(_0xb782('0x18'))[_0xb782('0x19')](socket);var jayson=require(_0xb782('0x1a'));var client=jayson['client']['http']({'port':0x232b});function checkPasswordPattern(_0x241806,_0xc12644,_0x3c2b55){if(_0x3c2b55){var _0x56f34a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56f34a['test'](_0xc12644)){return _0x241806;}else{throw new db[(_0xb782('0x1b'))][(_0xb782('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x241806;}}function respondWithRpcPromise(_0x49403b,_0x495d88,_0x514675,_0x13e457){return new BPromise(function(_0x2e1cac,_0x536fc1){var _0xa931bf=_0x13e457||client;return _0xa931bf[_0xb782('0x1d')](_0x49403b,_0x514675)[_0xb782('0x1e')](function(_0x331727){logger[_0xb782('0x1f')](_0xb782('0x20'),_0x495d88,_0xb782('0x21'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x495d88,_0xb782('0x21'),JSON[_0xb782('0x22')](_0x331727));if(_0x331727[_0xb782('0x23')]){if(_0x331727[_0xb782('0x23')][_0xb782('0x24')]===0x1f4){logger[_0xb782('0x23')](_0xb782('0x20'),_0x495d88,_0x331727['error'][_0xb782('0x25')]);return _0x536fc1(_0x331727[_0xb782('0x23')][_0xb782('0x25')]);}logger[_0xb782('0x23')](_0xb782('0x20'),_0x495d88,_0x331727['error']['message']);return _0x2e1cac(_0x331727['error'][_0xb782('0x25')]);}else{logger[_0xb782('0x1f')](_0xb782('0x20'),_0x495d88,_0xb782('0x21'));_0x2e1cac(_0x331727[_0xb782('0x26')][_0xb782('0x25')]);}})[_0xb782('0x27')](function(_0x17ee89){logger[_0xb782('0x23')]('MailAccount,\x20%s,\x20%s',_0x495d88,_0x17ee89);_0x536fc1(_0x17ee89);});});}function respondWithStatusCode(_0x4434d2,_0x41b280){_0x41b280=_0x41b280||0xcc;return function(_0x446cd1){if(_0x446cd1){return _0x4434d2[_0xb782('0x28')](_0x41b280);}return _0x4434d2['status'](_0x41b280)['end']();};}function respondWithResult(_0x47581f,_0x54119b){_0x54119b=_0x54119b||0xc8;return function(_0x326c99){if(_0x326c99){return _0x47581f['status'](_0x54119b)['json'](_0x326c99);}};}function respondWithFilteredResult(_0x407660,_0x4fc6ed){return function(_0x3d411f){if(_0x3d411f){var _0x3b6e9c=_0x3d411f[_0xb782('0x29')],_0x4988a9=_0x4fc6ed[_0xb782('0x2a')],_0x5c88dc=_0x4fc6ed[_0xb782('0x2a')]+_0x4fc6ed[_0xb782('0x2b')],_0x416727;if(_0x5c88dc>=_0x3b6e9c){_0x5c88dc=_0x3b6e9c;_0x416727=0xc8;}else{_0x416727=0xce;}_0x407660['status'](_0x416727);return _0x407660[_0xb782('0x2c')]('Content-Range',_0x4988a9+'-'+_0x5c88dc+'/'+_0x3b6e9c)['json'](_0x3d411f);}return null;};}function patchUpdates(_0x3e2abb){return function(_0x525b66){try{jsonpatch[_0xb782('0x2d')](_0x525b66,_0x3e2abb,!![]);}catch(_0x3bf7bf){return BPromise[_0xb782('0x2e')](_0x3bf7bf);}return _0x525b66['save']();};}function saveUpdates(_0x5b2a,_0x4104ae){return function(_0x3d4b63){if(_0x3d4b63){return _0x3d4b63['update'](_0x5b2a)[_0xb782('0x1e')](function(_0x540d5a){return _0x540d5a;});}return null;};}function removeEntity(_0x4e5f6c,_0x2136f3){return function(_0x35fca1){if(_0x35fca1){return _0x35fca1['destroy']()[_0xb782('0x1e')](function(){var _0xd8ac6c=_0x35fca1['get']({'plain':!![]});var _0x13d064=_0xb782('0x2f');return db[_0xb782('0x30')][_0xb782('0x31')]({'where':{'type':_0x13d064,'resourceId':_0xd8ac6c['id']}})[_0xb782('0x1e')](function(){return _0x35fca1;});})['then'](function(){_0x4e5f6c[_0xb782('0x32')](0xcc)[_0xb782('0x33')]();});}};}function handleEntityNotFound(_0x5d7fbb,_0x400a59){return function(_0x41bcd6){if(!_0x41bcd6){_0x5d7fbb['sendStatus'](0x194);}return _0x41bcd6;};}function handleError(_0x3dbb10,_0x4bc2d1){_0x4bc2d1=_0x4bc2d1||0x1f4;return function(_0x3c95c8){logger[_0xb782('0x23')](_0x3c95c8['stack']);if(_0x3c95c8[_0xb782('0x34')]){delete _0x3c95c8['name'];}_0x3dbb10[_0xb782('0x32')](_0x4bc2d1)[_0xb782('0x35')](_0x3c95c8);};}exports[_0xb782('0x36')]=function(_0x24bf87,_0x419cfd){var _0x252806={'include':[{'model':db[_0xb782('0x37')],'as':'Imap'},{'model':db[_0xb782('0x38')],'as':'Smtp'},{'model':db[_0xb782('0x39')],'as':_0xb782('0x3a')}]},_0xde6139={},_0x31f8c9={'count':0x0,'rows':[]};var _0x44d2d0=_[_0xb782('0x3b')](db[_0xb782('0x3c')][_0xb782('0x3d')],function(_0x2ec7a0){return{'name':_0x2ec7a0[_0xb782('0x3e')],'type':_0x2ec7a0[_0xb782('0x3f')][_0xb782('0x40')]};});_0xde6139[_0xb782('0x41')]=_[_0xb782('0x3b')](_0x44d2d0,_0xb782('0x34'));_0xde6139[_0xb782('0x42')]=_['keys'](_0x24bf87[_0xb782('0x42')]);_0xde6139[_0xb782('0x43')]=_['intersection'](_0xde6139[_0xb782('0x41')],_0xde6139[_0xb782('0x42')]);_0x252806[_0xb782('0x44')]=_[_0xb782('0x45')](_0xde6139[_0xb782('0x41')],qs[_0xb782('0x46')](_0x24bf87[_0xb782('0x42')][_0xb782('0x46')]));_0x252806[_0xb782('0x44')]=_0x252806[_0xb782('0x44')]['length']?_0x252806['attributes']:_0xde6139['model'];if(!_0x24bf87[_0xb782('0x42')][_0xb782('0x47')]('nolimit')){_0x252806[_0xb782('0x2b')]=qs[_0xb782('0x2b')](_0x24bf87[_0xb782('0x42')][_0xb782('0x2b')]);_0x252806[_0xb782('0x2a')]=qs[_0xb782('0x2a')](_0x24bf87['query']['offset']);}_0x252806[_0xb782('0x48')]=qs['sort'](_0x24bf87[_0xb782('0x42')][_0xb782('0x49')]);_0x252806[_0xb782('0x4a')]=qs[_0xb782('0x43')](_[_0xb782('0x4b')](_0x24bf87[_0xb782('0x42')],_0xde6139[_0xb782('0x43')]));if(_0x24bf87[_0xb782('0x42')][_0xb782('0x4c')]){_0x252806[_0xb782('0x4a')]=_[_0xb782('0x4d')](_0x252806[_0xb782('0x4a')],{'$or':_[_0xb782('0x3b')](_0x44d2d0,function(_0x1de009){if(_0x1de009[_0xb782('0x3f')]!==_0xb782('0x4e')){var _0x17fa8b={};_0x17fa8b[_0x1de009[_0xb782('0x34')]]={'$like':'%'+_0x24bf87[_0xb782('0x42')][_0xb782('0x4c')]+'%'};return _0x17fa8b;}})});}_0x252806=_[_0xb782('0x4d')]({},_0x252806,_0x24bf87[_0xb782('0x4f')]);var _0x459ed6={'where':_0x252806['where']};return db['MailAccount'][_0xb782('0x29')](_0x459ed6)[_0xb782('0x1e')](function(_0x1a9ee6){_0x31f8c9[_0xb782('0x29')]=_0x1a9ee6;if(_0x24bf87[_0xb782('0x42')]['includeAll']){_0x252806['include']=[{'all':!![]}];}return db[_0xb782('0x3c')][_0xb782('0x50')](_0x252806);})[_0xb782('0x1e')](function(_0x1f5d88){_0x31f8c9['rows']=_0x1f5d88;return _0x31f8c9;})[_0xb782('0x1e')](respondWithFilteredResult(_0x419cfd,_0x252806))[_0xb782('0x27')](handleError(_0x419cfd,null));};exports[_0xb782('0x51')]=function(_0x5d7a77,_0x9a6e65){var _0x6a3e94={'raw':![],'where':{'id':_0x5d7a77['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xb782('0x52')},{'model':db[_0xb782('0x38')],'as':_0xb782('0x53')},{'model':db['Pause'],'as':_0xb782('0x3a')}]},_0x8bdc9={};_0x8bdc9[_0xb782('0x41')]=_[_0xb782('0x54')](db[_0xb782('0x3c')]['rawAttributes']);_0x8bdc9[_0xb782('0x42')]=_[_0xb782('0x54')](_0x5d7a77['query']);_0x8bdc9[_0xb782('0x43')]=_[_0xb782('0x45')](_0x8bdc9[_0xb782('0x41')],_0x8bdc9[_0xb782('0x42')]);_0x6a3e94[_0xb782('0x44')]=_[_0xb782('0x45')](_0x8bdc9['model'],qs['fields'](_0x5d7a77[_0xb782('0x42')][_0xb782('0x46')]));_0x6a3e94[_0xb782('0x44')]=_0x6a3e94[_0xb782('0x44')]['length']?_0x6a3e94[_0xb782('0x44')]:_0x8bdc9[_0xb782('0x41')];if(_0x5d7a77[_0xb782('0x42')][_0xb782('0x55')]){_0x6a3e94[_0xb782('0x56')]=[{'all':!![]}];}_0x6a3e94=_[_0xb782('0x4d')]({},_0x6a3e94,_0x5d7a77[_0xb782('0x4f')]);return db['MailAccount'][_0xb782('0x57')](_0x6a3e94)[_0xb782('0x1e')](handleEntityNotFound(_0x9a6e65,null))['then'](respondWithResult(_0x9a6e65,null))[_0xb782('0x27')](handleError(_0x9a6e65,null));};exports[_0xb782('0x58')]=function(_0x4a31bf,_0x36247d){if(_0x4a31bf[_0xb782('0x59')]['id']){delete _0x4a31bf['body']['id'];}return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x4a31bf[_0xb782('0x5a')]['id']},'include':[{'model':db[_0xb782('0x37')],'as':_0xb782('0x52')},{'model':db['MailServerOut'],'as':_0xb782('0x53')},{'model':db['Pause'],'as':_0xb782('0x3a')}]})[_0xb782('0x1e')](handleEntityNotFound(_0x36247d,null))['then'](saveUpdates(_0x4a31bf[_0xb782('0x59')],null))['then'](function(_0xc23176){if(_0xc23176&&_0x4a31bf[_0xb782('0x59')][_0xb782('0x52')]){return db['MailServerIn'][_0xb782('0x58')](_0x4a31bf[_0xb782('0x59')][_0xb782('0x52')],{'where':{'MailAccountId':_0xc23176['id']}})['then'](function(){return _0xc23176;});}return _0xc23176;})[_0xb782('0x1e')](function(_0x4ba074){if(_0x4ba074&&_0x4a31bf[_0xb782('0x59')][_0xb782('0x53')]){return db[_0xb782('0x38')][_0xb782('0x58')](_0x4a31bf[_0xb782('0x59')][_0xb782('0x53')],{'where':{'MailAccountId':_0x4ba074['id']}})[_0xb782('0x1e')](function(){return _0x4ba074;});}return _0x4ba074;})[_0xb782('0x1e')](respondWithResult(_0x36247d,null))[_0xb782('0x27')](handleError(_0x36247d,null));};exports[_0xb782('0x5b')]=function(_0x5ce369,_0x57406c){return db['MailAccount'][_0xb782('0x5b')]()[_0xb782('0x1e')](respondWithResult(_0x57406c,null))[_0xb782('0x27')](handleError(_0x57406c,null));};exports[_0xb782('0x5c')]=function(_0x45c6e0,_0x13c6c4,_0x4a71ac){if(_0x45c6e0[_0xb782('0x59')]['id']){delete _0x45c6e0[_0xb782('0x59')]['id'];}return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x45c6e0[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x13c6c4,null))[_0xb782('0x1e')](function(_0x5f1c84){if(_0x5f1c84){_0x45c6e0[_0xb782('0x59')]['MailAccountId']=_0x5f1c84['id'];return db['Disposition'][_0xb782('0x5d')](_0x45c6e0[_0xb782('0x59')]);}})['then'](respondWithResult(_0x13c6c4,null))[_0xb782('0x27')](handleError(_0x13c6c4,null));};exports[_0xb782('0x5e')]=function(_0x2cab8b,_0x1e9f5f,_0x31650d){var _0x575b74={'raw':![],'where':{}};var _0x1768ba={};var _0x306436={'count':0x0,'rows':[]};return db[_0xb782('0x3c')][_0xb782('0x5f')]({'where':{'id':_0x2cab8b['params']['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x1e9f5f,null))['then'](function(_0x362772){if(_0x362772){_0x1768ba[_0xb782('0x41')]=_[_0xb782('0x54')](db['Disposition'][_0xb782('0x3d')]);_0x1768ba['query']=_[_0xb782('0x54')](_0x2cab8b[_0xb782('0x42')]);_0x1768ba['filters']=_['intersection'](_0x1768ba[_0xb782('0x41')],_0x1768ba[_0xb782('0x42')]);_0x575b74[_0xb782('0x44')]=_[_0xb782('0x45')](_0x1768ba[_0xb782('0x41')],qs['fields'](_0x2cab8b[_0xb782('0x42')][_0xb782('0x46')]));_0x575b74['attributes']=_0x575b74[_0xb782('0x44')]['length']?_0x575b74[_0xb782('0x44')]:_0x1768ba['model'];if(!_0x2cab8b[_0xb782('0x42')]['hasOwnProperty'](_0xb782('0x60'))){_0x575b74[_0xb782('0x2b')]=qs['limit'](_0x2cab8b[_0xb782('0x42')]['limit']);_0x575b74[_0xb782('0x2a')]=qs[_0xb782('0x2a')](_0x2cab8b[_0xb782('0x42')][_0xb782('0x2a')]);}_0x575b74[_0xb782('0x48')]=qs[_0xb782('0x49')](_0x2cab8b[_0xb782('0x42')][_0xb782('0x49')]);_0x575b74[_0xb782('0x4a')]=qs[_0xb782('0x43')](_['pick'](_0x2cab8b[_0xb782('0x42')],_0x1768ba[_0xb782('0x43')]));_0x575b74[_0xb782('0x4a')][_0xb782('0x61')]=_0x362772['id'];if(_0x2cab8b['query']['filter']){_0x575b74[_0xb782('0x4a')]=_[_0xb782('0x4d')](_0x575b74['where'],{'$or':_[_0xb782('0x3b')](_0x575b74['attributes'],function(_0xe4791){var _0x399fc0={};_0x399fc0[_0xe4791]={'$like':'%'+_0x2cab8b[_0xb782('0x42')]['filter']+'%'};return _0x399fc0;})});}_0x575b74=_[_0xb782('0x4d')]({},_0x575b74,_0x2cab8b[_0xb782('0x4f')]);return db['Disposition'][_0xb782('0x29')]({'where':_0x575b74[_0xb782('0x4a')]})[_0xb782('0x1e')](function(_0x427cd5){_0x306436[_0xb782('0x29')]=_0x427cd5;if(_0x2cab8b[_0xb782('0x42')][_0xb782('0x55')]){_0x575b74[_0xb782('0x56')]=[{'all':!![]}];}return db[_0xb782('0x62')][_0xb782('0x50')](_0x575b74);})[_0xb782('0x1e')](function(_0x254a7c){_0x306436[_0xb782('0x63')]=_0x254a7c;return _0x306436;});}})[_0xb782('0x1e')](respondWithFilteredResult(_0x1e9f5f,_0x575b74))[_0xb782('0x27')](handleError(_0x1e9f5f,null));};exports[_0xb782('0x64')]=function(_0x1a9e1e,_0x28065e,_0x3274db){return db['MailAccount']['find']({'where':{'id':_0x1a9e1e[_0xb782('0x5a')]['id']}})['then'](handleEntityNotFound(_0x28065e,null))[_0xb782('0x1e')](function(_0x33227d){if(_0x33227d){return _0x33227d[_0xb782('0x64')](_0x1a9e1e[_0xb782('0x42')][_0xb782('0x65')]);}})['then'](respondWithStatusCode(_0x28065e,null))[_0xb782('0x27')](handleError(_0x28065e,null));};exports['addAnswer']=function(_0x234f62,_0x8bce0c,_0x1ed8f1){if(_0x234f62[_0xb782('0x59')]['id']){delete _0x234f62[_0xb782('0x59')]['id'];}return db['MailAccount'][_0xb782('0x57')]({'where':{'id':_0x234f62[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x8bce0c,null))['then'](function(_0x11a9ce){if(_0x11a9ce){_0x234f62[_0xb782('0x59')][_0xb782('0x61')]=_0x11a9ce['id'];return db[_0xb782('0x66')][_0xb782('0x5d')](_0x234f62[_0xb782('0x59')]);}})[_0xb782('0x1e')](respondWithResult(_0x8bce0c,null))[_0xb782('0x27')](handleError(_0x8bce0c,null));};exports[_0xb782('0x67')]=function(_0x856cf,_0x3ac94f,_0x154c10){var _0x3fd56e={'raw':![],'where':{}};var _0x41afdc={};var _0x49a101={'count':0x0,'rows':[]};return db[_0xb782('0x3c')][_0xb782('0x5f')]({'where':{'id':_0x856cf[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x3ac94f,null))[_0xb782('0x1e')](function(_0x483d67){if(_0x483d67){_0x41afdc[_0xb782('0x41')]=_[_0xb782('0x54')](db[_0xb782('0x66')]['rawAttributes']);_0x41afdc[_0xb782('0x42')]=_[_0xb782('0x54')](_0x856cf['query']);_0x41afdc[_0xb782('0x43')]=_[_0xb782('0x45')](_0x41afdc['model'],_0x41afdc[_0xb782('0x42')]);_0x3fd56e['attributes']=_['intersection'](_0x41afdc[_0xb782('0x41')],qs[_0xb782('0x46')](_0x856cf[_0xb782('0x42')][_0xb782('0x46')]));_0x3fd56e['attributes']=_0x3fd56e[_0xb782('0x44')][_0xb782('0x68')]?_0x3fd56e[_0xb782('0x44')]:_0x41afdc[_0xb782('0x41')];if(!_0x856cf['query'][_0xb782('0x47')]('nolimit')){_0x3fd56e[_0xb782('0x2b')]=qs[_0xb782('0x2b')](_0x856cf['query']['limit']);_0x3fd56e['offset']=qs['offset'](_0x856cf[_0xb782('0x42')][_0xb782('0x2a')]);}_0x3fd56e[_0xb782('0x48')]=qs[_0xb782('0x49')](_0x856cf[_0xb782('0x42')][_0xb782('0x49')]);_0x3fd56e[_0xb782('0x4a')]=qs[_0xb782('0x43')](_[_0xb782('0x4b')](_0x856cf[_0xb782('0x42')],_0x41afdc[_0xb782('0x43')]));_0x3fd56e[_0xb782('0x4a')][_0xb782('0x61')]=_0x483d67['id'];if(_0x856cf['query'][_0xb782('0x4c')]){_0x3fd56e[_0xb782('0x4a')]=_['merge'](_0x3fd56e[_0xb782('0x4a')],{'$or':_[_0xb782('0x3b')](_0x3fd56e[_0xb782('0x44')],function(_0xae3330){var _0x292c10={};_0x292c10[_0xae3330]={'$like':'%'+_0x856cf[_0xb782('0x42')][_0xb782('0x4c')]+'%'};return _0x292c10;})});}_0x3fd56e=_[_0xb782('0x4d')]({},_0x3fd56e,_0x856cf[_0xb782('0x4f')]);return db[_0xb782('0x66')][_0xb782('0x29')]({'where':_0x3fd56e['where']})['then'](function(_0x2a438a){_0x49a101[_0xb782('0x29')]=_0x2a438a;if(_0x856cf[_0xb782('0x42')][_0xb782('0x55')]){_0x3fd56e['include']=[{'all':!![]}];}return db[_0xb782('0x66')]['findAll'](_0x3fd56e);})[_0xb782('0x1e')](function(_0x539ff0){_0x49a101[_0xb782('0x63')]=_0x539ff0;return _0x49a101;});}})[_0xb782('0x1e')](respondWithFilteredResult(_0x3ac94f,_0x3fd56e))[_0xb782('0x27')](handleError(_0x3ac94f,null));};exports[_0xb782('0x69')]=function(_0x2d6a42,_0x3aa2a8,_0xd1285b){return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x2d6a42['params']['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x3aa2a8,null))[_0xb782('0x1e')](function(_0x42e72f){if(_0x42e72f){return _0x42e72f[_0xb782('0x69')](_0x2d6a42['query'][_0xb782('0x65')]);}})[_0xb782('0x1e')](respondWithStatusCode(_0x3aa2a8,null))[_0xb782('0x27')](handleError(_0x3aa2a8,null));};exports[_0xb782('0x5d')]=function(_0x10718b,_0x901e04){var _0x42c6ca={'name':_0x10718b['body'][_0xb782('0x34')],'key':_0x10718b[_0xb782('0x59')][_0xb782('0x40')],'email':_0x10718b['body'][_0xb782('0x6a')],'ListId':_0x10718b[_0xb782('0x59')][_0xb782('0x6b')],'active':!_[_0xb782('0x6c')](_0x10718b[_0xb782('0x59')][_0xb782('0x6d')])?_0x10718b[_0xb782('0x59')][_0xb782('0x6d')]:!![],'description':_0x10718b[_0xb782('0x59')][_0xb782('0x6e')]||null,'Imap':{},'Smtp':{}};if(_[_0xb782('0x6c')](_0x10718b[_0xb782('0x59')][_0xb782('0x6f')])){if(_0x10718b['body'][_0xb782('0x70')]){_0x42c6ca[_0xb782('0x52')][_0xb782('0x71')]=_0x42c6ca[_0xb782('0x53')][_0xb782('0x71')]=_0x10718b['body']['cuser'];_0x42c6ca['Imap']['password']=_0x42c6ca[_0xb782('0x53')][_0xb782('0x72')]=_0x10718b[_0xb782('0x59')][_0xb782('0x73')];}else{_0x42c6ca[_0xb782('0x52')]['authentication']=_0x42c6ca[_0xb782('0x53')][_0xb782('0x74')]=![];}_0x42c6ca[_0xb782('0x52')][_0xb782('0x75')]=_0x10718b[_0xb782('0x59')][_0xb782('0x52')]['host'];_0x42c6ca['Imap']['port']=_0x10718b[_0xb782('0x59')][_0xb782('0x52')][_0xb782('0x76')];_0x42c6ca[_0xb782('0x53')][_0xb782('0x75')]=_0x10718b[_0xb782('0x59')][_0xb782('0x53')][_0xb782('0x75')];_0x42c6ca[_0xb782('0x53')][_0xb782('0x76')]=_0x10718b['body'][_0xb782('0x53')]['port'];}else{_0x42c6ca['Imap'][_0xb782('0x77')]=_0x42c6ca[_0xb782('0x53')][_0xb782('0x77')]=_0x10718b[_0xb782('0x59')][_0xb782('0x6f')];_0x42c6ca['Imap']['user']=_0x42c6ca[_0xb782('0x53')]['user']=_0x10718b['body'][_0xb782('0x78')];_0x42c6ca[_0xb782('0x52')]['password']=_0x42c6ca[_0xb782('0x53')][_0xb782('0x72')]=_0x10718b['body'][_0xb782('0x73')];}return db['MailAccount']['create'](_0x42c6ca,{'include':[{'model':db[_0xb782('0x38')],'as':_0xb782('0x53')},{'model':db[_0xb782('0x37')],'as':_0xb782('0x52')}]})['then'](function(_0x37fae1){var _0x3f174d=_0x10718b[_0xb782('0x71')]['get']({'plain':!![]});if(!_0x3f174d)throw new Error(_0xb782('0x79'));if(_0x3f174d[_0xb782('0x7a')]===_0xb782('0x71')){var _0x16b909=_0x37fae1['get']({'plain':!![]});return db[_0xb782('0x7b')][_0xb782('0x57')]({'where':{'name':_0xb782('0x2f'),'userProfileId':_0x3f174d['userProfileId']},'raw':!![]})['then'](function(_0x10d96e){if(_0x10d96e&&_0x10d96e[_0xb782('0x7c')]===0x0){return db[_0xb782('0x30')][_0xb782('0x5d')]({'name':_0x16b909[_0xb782('0x34')],'resourceId':_0x16b909['id'],'type':_0x10d96e[_0xb782('0x34')],'sectionId':_0x10d96e['id']},{})[_0xb782('0x1e')](function(){return _0x37fae1;});}else{return _0x37fae1;}})[_0xb782('0x27')](function(_0x382c57){logger['error'](_0xb782('0x7d'),_0x382c57);throw _0x382c57;});}return _0x37fae1;})[_0xb782('0x1e')](respondWithResult(_0x901e04,0xc9))['catch'](handleError(_0x901e04,null));};exports['getImap']=function(_0x5c94cc,_0x5d77d0,_0x1a2e10){return db[_0xb782('0x3c')]['findOne']({'where':{'id':_0x5c94cc[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x5d77d0,null))[_0xb782('0x1e')](function(_0x3d1369){if(_0x3d1369){return _0x3d1369[_0xb782('0x7e')]();}return null;})[_0xb782('0x1e')](respondWithResult(_0x5d77d0,null))['catch'](handleError(_0x5d77d0,null));};exports['addImap']=function(_0x5e8d1d,_0x57987a,_0x3859e4){if(_0x5e8d1d[_0xb782('0x59')]['id']){delete _0x5e8d1d[_0xb782('0x59')]['id'];}return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x5e8d1d[_0xb782('0x5a')]['id']}})['then'](handleEntityNotFound(_0x57987a,null))[_0xb782('0x1e')](function(_0x55a8f9){if(_0x55a8f9){_0x5e8d1d[_0xb782('0x59')][_0xb782('0x61')]=_0x55a8f9['id'];return db[_0xb782('0x37')][_0xb782('0x5d')](_0x5e8d1d[_0xb782('0x59')]);}})[_0xb782('0x1e')](respondWithResult(_0x57987a,null))[_0xb782('0x27')](handleError(_0x57987a,null));};exports['removeImap']=function(_0x1332a7,_0x36889d,_0x237071){return db[_0xb782('0x3c')][_0xb782('0x5f')]({'where':{'id':_0x1332a7[_0xb782('0x5a')]['id']}})['then'](handleEntityNotFound(_0x36889d,null))[_0xb782('0x1e')](function(_0x3bb573){if(_0x3bb573){return _0x3bb573[_0xb782('0x7f')](null);}return null;})['then'](respondWithStatusCode(_0x36889d,null))[_0xb782('0x27')](handleError(_0x36889d,null));};exports[_0xb782('0x80')]=function(_0x2911bf,_0x82a3c8,_0x1d7ca3){return db[_0xb782('0x3c')]['findOne']({'where':{'id':_0x2911bf['params']['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x82a3c8,null))[_0xb782('0x1e')](function(_0x418c26){if(_0x418c26){return _0x418c26[_0xb782('0x80')]();}return null;})[_0xb782('0x1e')](respondWithResult(_0x82a3c8,null))['catch'](handleError(_0x82a3c8,null));};exports[_0xb782('0x81')]=function(_0x49f503,_0x56f514,_0x45836b){if(_0x49f503['body']['id']){delete _0x49f503[_0xb782('0x59')]['id'];}return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x49f503['params']['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x56f514,null))[_0xb782('0x1e')](function(_0x1357e5){if(_0x1357e5){_0x49f503[_0xb782('0x59')][_0xb782('0x61')]=_0x1357e5['id'];return db[_0xb782('0x38')]['create'](_0x49f503[_0xb782('0x59')]);}})[_0xb782('0x1e')](respondWithResult(_0x56f514,null))[_0xb782('0x27')](handleError(_0x56f514,null));};exports['removeSmtp']=function(_0x24724b,_0x16540f,_0x3c0a84){return db[_0xb782('0x3c')]['findOne']({'where':{'id':_0x24724b[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x16540f,null))[_0xb782('0x1e')](function(_0x3d745d){if(_0x3d745d){return _0x3d745d[_0xb782('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x16540f,null))[_0xb782('0x27')](handleError(_0x16540f,null));};exports[_0xb782('0x83')]=function(_0x4ca72,_0xa7d614,_0x7f247a){return db[_0xb782('0x84')]['find']({'where':{'id':_0x4ca72[_0xb782('0x5a')]['id']}})['then'](handleEntityNotFound(_0xa7d614,null))[_0xb782('0x1e')](function(_0x403537){if(_0x403537){return _0x403537[_0xb782('0x83')](_0x4ca72['body'][_0xb782('0x65')],_[_0xb782('0x85')](_0x4ca72[_0xb782('0x59')],['ids','id'])||{});}})[_0xb782('0x1e')](respondWithResult(_0xa7d614,null))[_0xb782('0x27')](handleError(_0xa7d614,null));};exports[_0xb782('0x86')]=function(_0x36ee83,_0x166dc3,_0x300511){var _0x228b48={'raw':![],'where':{}};var _0x43e126={};var _0x48cd97={'count':0x0,'rows':[]};return db[_0xb782('0x3c')][_0xb782('0x5f')]({'where':{'id':_0x36ee83[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x166dc3,null))[_0xb782('0x1e')](function(_0x286d67){if(_0x286d67){_0x43e126['model']=_[_0xb782('0x54')](db[_0xb782('0x84')][_0xb782('0x3d')]);_0x43e126[_0xb782('0x42')]=_[_0xb782('0x54')](_0x36ee83[_0xb782('0x42')]);_0x43e126[_0xb782('0x43')]=_[_0xb782('0x45')](_0x43e126['model'],_0x43e126[_0xb782('0x42')]);_0x228b48[_0xb782('0x44')]=_[_0xb782('0x45')](_0x43e126[_0xb782('0x41')],qs[_0xb782('0x46')](_0x36ee83['query']['fields']));_0x228b48[_0xb782('0x44')]=_0x228b48[_0xb782('0x44')][_0xb782('0x68')]?_0x228b48[_0xb782('0x44')]:_0x43e126[_0xb782('0x41')];if(!_0x36ee83['query'][_0xb782('0x47')]('nolimit')){_0x228b48[_0xb782('0x2b')]=qs[_0xb782('0x2b')](_0x36ee83['query'][_0xb782('0x2b')]);_0x228b48[_0xb782('0x2a')]=qs['offset'](_0x36ee83['query'][_0xb782('0x2a')]);}_0x228b48[_0xb782('0x48')]=qs[_0xb782('0x49')](_0x36ee83[_0xb782('0x42')][_0xb782('0x49')]);_0x228b48[_0xb782('0x4a')]=qs['filters'](_[_0xb782('0x4b')](_0x36ee83[_0xb782('0x42')],_0x43e126[_0xb782('0x43')]));_0x228b48[_0xb782('0x4a')][_0xb782('0x61')]=_0x286d67['id'];if(_0x36ee83[_0xb782('0x42')][_0xb782('0x4c')]){_0x228b48[_0xb782('0x4a')]=_[_0xb782('0x4d')](_0x228b48[_0xb782('0x4a')],{'$or':_[_0xb782('0x3b')](_0x228b48[_0xb782('0x44')],function(_0x5162cb){var _0x736a95={};_0x736a95[_0x5162cb]={'$like':'%'+_0x36ee83[_0xb782('0x42')][_0xb782('0x4c')]+'%'};return _0x736a95;})});}_0x228b48=_[_0xb782('0x4d')]({},_0x228b48,_0x36ee83['options']);return db[_0xb782('0x84')][_0xb782('0x29')]({'where':_0x228b48[_0xb782('0x4a')]})[_0xb782('0x1e')](function(_0x27c25f){_0x48cd97['count']=_0x27c25f;if(_0x36ee83[_0xb782('0x42')][_0xb782('0x55')]){_0x228b48[_0xb782('0x56')]=[{'model':db[_0xb782('0x87')],'as':'Contact','required':![]},{'model':db[_0xb782('0x88')],'as':_0xb782('0x89'),'attributes':['name',_0xb782('0x8a'),_0xb782('0x8b')],'required':![]},{'model':db[_0xb782('0x8c')],'as':'Tags','attributes':['id',_0xb782('0x34'),_0xb782('0x8d')],'where':_0x36ee83[_0xb782('0x42')][_0xb782('0x8e')]?{'id':_0x36ee83[_0xb782('0x42')]['tag']}:undefined,'required':_0x36ee83[_0xb782('0x42')]['tag']?!![]:![]}];}return db['MailInteraction'][_0xb782('0x50')](_0x228b48);})[_0xb782('0x1e')](function(_0x1df0ef){_0x48cd97[_0xb782('0x63')]=_0x1df0ef;return _0x48cd97;});}})[_0xb782('0x1e')](respondWithFilteredResult(_0x166dc3,_0x228b48))['catch'](handleError(_0x166dc3,null));};exports[_0xb782('0x8f')]=function(_0x3986e3,_0x47b97e,_0x4d7776){return db['MailAccount'][_0xb782('0x5f')]({'where':{'id':_0x3986e3[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x47b97e,null))['then'](function(_0x359ddb){if(_0x359ddb){return db[_0xb782('0x90')][_0xb782('0x91')](function(_0x4479ef){return db['MailApplication'][_0xb782('0x31')]({'where':{'MailAccountId':_0x3986e3[_0xb782('0x5a')]['id']},'transaction':_0x4479ef})[_0xb782('0x1e')](function(_0x4e1470){var _0x3423c9=_[_0xb782('0x3b')](_0x3986e3[_0xb782('0x59')],function(_0xd3d977){_0xd3d977['MailAccountId']=_0x3986e3['params']['id'];return _0xd3d977;});return db[_0xb782('0x92')][_0xb782('0x93')](_0x3423c9,{'transaction':_0x4479ef});});})['then'](function(){return db['MailApplication'][_0xb782('0x94')]({'where':{'MailAccountId':_0x3986e3['params']['id']},'order':_0xb782('0x95')});});}})['then'](respondWithResult(_0x47b97e,null))['catch'](handleError(_0x47b97e,null));};exports['getApplications']=function(_0x4c0433,_0x2edc0d,_0x3b7836){var _0x189d39={};var _0x45b9b4={};var _0x53d2ca;var _0x568a42;return db[_0xb782('0x3c')][_0xb782('0x5f')]({'where':{'id':_0x4c0433[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x2edc0d,null))['then'](function(_0x3ef4aa){if(_0x3ef4aa){_0x53d2ca=_0x3ef4aa;_0x45b9b4[_0xb782('0x41')]=_[_0xb782('0x54')](db[_0xb782('0x92')][_0xb782('0x3d')]);_0x45b9b4['query']=_['keys'](_0x4c0433[_0xb782('0x42')]);_0x45b9b4[_0xb782('0x43')]=_[_0xb782('0x45')](_0x45b9b4[_0xb782('0x41')],_0x45b9b4['query']);_0x189d39[_0xb782('0x44')]=_[_0xb782('0x45')](_0x45b9b4[_0xb782('0x41')],qs[_0xb782('0x46')](_0x4c0433['query']['fields']));_0x189d39[_0xb782('0x44')]=_0x189d39[_0xb782('0x44')]['length']?_0x189d39[_0xb782('0x44')]:_0x45b9b4['model'];_0x189d39['order']=qs['sort'](_0x4c0433['query'][_0xb782('0x49')]);_0x189d39[_0xb782('0x4a')]=qs[_0xb782('0x43')](_[_0xb782('0x4b')](_0x4c0433[_0xb782('0x42')],_0x45b9b4['filters']));if(_0x4c0433['query'][_0xb782('0x4c')]){_0x189d39['where']=_[_0xb782('0x4d')](_0x189d39[_0xb782('0x4a')],{'$or':_['map'](_0x189d39[_0xb782('0x44')],function(_0x20cd57){var _0x2d59f6={};_0x2d59f6[_0x20cd57]={'$like':'%'+_0x4c0433[_0xb782('0x42')]['filter']+'%'};return _0x2d59f6;})});}_0x189d39=_['merge']({},_0x189d39,_0x4c0433[_0xb782('0x4f')]);return _0x53d2ca[_0xb782('0x96')](_0x189d39);}})[_0xb782('0x1e')](function(_0x591a77){if(_0x591a77){_0x568a42=_0x591a77[_0xb782('0x68')];if(!_0x4c0433[_0xb782('0x42')][_0xb782('0x47')]('nolimit')){_0x189d39[_0xb782('0x2b')]=qs[_0xb782('0x2b')](_0x4c0433['query'][_0xb782('0x2b')]);_0x189d39[_0xb782('0x2a')]=qs[_0xb782('0x2a')](_0x4c0433['query']['offset']);}return _0x53d2ca[_0xb782('0x96')](_0x189d39);}})[_0xb782('0x1e')](function(_0x3b8e64){if(_0x3b8e64){return _0x3b8e64?{'count':_0x568a42,'rows':_0x3b8e64}:null;}})[_0xb782('0x1e')](respondWithResult(_0x2edc0d,null))[_0xb782('0x27')](handleError(_0x2edc0d,null));};exports[_0xb782('0x97')]=function(_0x416702,_0x44d853,_0x508dd3){var _0x4e4309={'raw':!![],'where':{}};var _0x388e4b={};var _0x5201e5={'count':0x0,'rows':[]};return db[_0xb782('0x3c')][_0xb782('0x5f')]({'where':{'id':_0x416702[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x44d853,null))[_0xb782('0x1e')](function(_0x130217){if(_0x130217){_0x388e4b[_0xb782('0x41')]=_[_0xb782('0x54')](db['MailMessage']['rawAttributes']);_0x388e4b[_0xb782('0x42')]=_[_0xb782('0x54')](_0x416702['query']);_0x388e4b[_0xb782('0x43')]=_[_0xb782('0x45')](_0x388e4b[_0xb782('0x41')],_0x388e4b[_0xb782('0x42')]);_0x4e4309[_0xb782('0x44')]=_[_0xb782('0x45')](_0x388e4b['model'],qs['fields'](_0x416702[_0xb782('0x42')][_0xb782('0x46')]));_0x4e4309[_0xb782('0x44')]=_0x4e4309['attributes'][_0xb782('0x68')]?_0x4e4309['attributes']:_0x388e4b['model'];if(!_0x416702['query'][_0xb782('0x47')](_0xb782('0x60'))){_0x4e4309[_0xb782('0x2b')]=qs[_0xb782('0x2b')](_0x416702['query']['limit']);_0x4e4309['offset']=qs[_0xb782('0x2a')](_0x416702[_0xb782('0x42')]['offset']);}_0x4e4309[_0xb782('0x48')]=qs[_0xb782('0x49')](_0x416702[_0xb782('0x42')][_0xb782('0x49')]);_0x4e4309[_0xb782('0x4a')]=qs[_0xb782('0x43')](_[_0xb782('0x4b')](_0x416702['query'],_0x388e4b['filters']));_0x4e4309[_0xb782('0x4a')][_0xb782('0x61')]=_0x130217['id'];if(_0x416702[_0xb782('0x42')]['filter']){_0x4e4309[_0xb782('0x4a')]=_['merge'](_0x4e4309['where'],{'$or':_[_0xb782('0x3b')](_0x4e4309[_0xb782('0x44')],function(_0x31e82b){var _0x183937={};_0x183937[_0x31e82b]={'$like':'%'+_0x416702[_0xb782('0x42')]['filter']+'%'};return _0x183937;})});}if(_0x416702[_0xb782('0x42')][_0xb782('0x98')]){var _0x21ae51=_0x416702['query'][_0xb782('0x98')][_0xb782('0x99')](',');var _0x2398fe={};_0x2398fe[_0x21ae51[0x0]]={'$gte':moment(_0x21ae51[0x1])[_0xb782('0x9a')](_0xb782('0x9b'))};_0x4e4309['where']=_[_0xb782('0x4d')](_0x4e4309['where'],_0x2398fe);}_0x4e4309=_[_0xb782('0x4d')]({},_0x4e4309,_0x416702[_0xb782('0x4f')]);return db[_0xb782('0x9c')][_0xb782('0x29')]({'where':_0x4e4309['where']})['then'](function(_0x1f238f){_0x5201e5[_0xb782('0x29')]=_0x1f238f;if(_0x416702['query']['includeAll']){_0x4e4309[_0xb782('0x56')]=[{'all':!![]}];}return db[_0xb782('0x9c')][_0xb782('0x50')](_0x4e4309);})[_0xb782('0x1e')](function(_0x139f60){_0x5201e5[_0xb782('0x63')]=_0x139f60;return _0x5201e5;});}})[_0xb782('0x1e')](respondWithFilteredResult(_0x44d853,_0x4e4309))['catch'](handleError(_0x44d853,null));};exports['send']=function(_0x5ece8e,_0x528fac,_0x43a1d4){var _0x179a2a,_0x4519a2={},_0x32cbe6;if(_0x5ece8e[_0xb782('0x59')]['to']){_0x32cbe6=_0x5ece8e['body']['to'][_0xb782('0x99')](',')[0x0];}return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x5ece8e['params']['id']},'include':[{'model':db[_0xb782('0x9d')],'as':'List','include':[{'model':db[_0xb782('0x87')],'as':_0xb782('0x9e'),'where':{'email':_0x32cbe6},'limit':0x1,'order':[[_0xb782('0x9f'),_0xb782('0xa0')]]}]},{'model':db[_0xb782('0x38')],'as':_0xb782('0x53'),'raw':!![]}]})[_0xb782('0x1e')](handleEntityNotFound(_0x528fac,null))[_0xb782('0x1e')](function(_0x33bd40){if(_0x33bd40){_0x179a2a=_0x33bd40;if(_0x33bd40[_0xb782('0x53')]){if(_[_0xb782('0x6c')](_0x5ece8e['body'][_0xb782('0xa1')])){_0x5ece8e[_0xb782('0x59')][_0xb782('0xa1')]=util[_0xb782('0x9a')](_0xb782('0xa2'),_0x33bd40['name'],_0x33bd40['email']||_0x33bd40[_0xb782('0x53')][_0xb782('0x71')]);}if(_0x5ece8e[_0xb782('0x59')][_0xb782('0xa3')]&&_0x5ece8e[_0xb782('0x59')][_0xb782('0xa3')]['length']){for(var _0x4db8ac=0x0;_0x4db8ac<_0x5ece8e[_0xb782('0x59')]['attachments']['length'];_0x4db8ac+=0x1){_0x5ece8e['body']['attachments'][_0x4db8ac]={'filename':_0x5ece8e['body'][_0xb782('0xa3')][_0x4db8ac]['name'],'path':path['join'](config[_0xb782('0xa4')],_0xb782('0xa5'),_0x5ece8e[_0xb782('0x59')][_0xb782('0xa3')][_0x4db8ac][_0xb782('0xa6')])};}}var _0x5edcd8={'tls':{'rejectUnauthorized':![]}};if(_[_0xb782('0x6c')](_0x33bd40['Smtp'][_0xb782('0x77')])){if(_0x33bd40[_0xb782('0x53')]['authentication']){_0x5edcd8['auth']={'user':_0x33bd40[_0xb782('0x53')][_0xb782('0x71')],'pass':_0x33bd40['Smtp'][_0xb782('0x72')]};}_0x5edcd8[_0xb782('0x75')]=_0x33bd40[_0xb782('0x53')][_0xb782('0x75')];_0x5edcd8[_0xb782('0x76')]=_0x33bd40[_0xb782('0x53')][_0xb782('0x76')];_0x5edcd8[_0xb782('0xa7')]=_0x33bd40['Smtp']['secure'];}else{_0x5edcd8[_0xb782('0x77')]=_0x33bd40[_0xb782('0x53')][_0xb782('0x77')];_0x5edcd8[_0xb782('0xa8')]={'user':_0x33bd40[_0xb782('0x53')][_0xb782('0x71')],'pass':_0x33bd40[_0xb782('0x53')][_0xb782('0x72')]};}return respondWithRpcPromise(_0xb782('0xa9'),_0xb782('0xaa'),{'account':_0x5edcd8,'message':_0x5ece8e[_0xb782('0x59')]});}else{throw new Error(_0xb782('0xab'));}}})[_0xb782('0x1e')](function(_0x2507a7){if(_0x2507a7){_0x4519a2=_0x2507a7;if(_0x179a2a[_0xb782('0xac')]){if(_0x179a2a[_0xb782('0xac')][_0xb782('0x9e')]['length']){return _0x179a2a[_0xb782('0xac')][_0xb782('0x9e')][0x0];}else{return db[_0xb782('0x87')][_0xb782('0x5d')](_[_0xb782('0xad')](_0x5ece8e[_0xb782('0x59')],{'firstName':_0x5ece8e[_0xb782('0x59')]['to'],'email':_0x5ece8e[_0xb782('0x59')]['to'],'phone':_0x5ece8e['body']['to'],'ListId':_0x179a2a[_0xb782('0x6b')]}));}}else{throw new Error(_0xb782('0xab'));}}})[_0xb782('0x1e')](function(_0x13f2e7){if(_0x13f2e7){var _0x21ff81={'UserId':_0x5ece8e[_0xb782('0x71')]['id'],'ContactId':_0x13f2e7['id'],'MailAccountId':_0x179a2a['id'],'inReplyTo':_0x4519a2[_0xb782('0xae')],'to':_0x5ece8e[_0xb782('0x59')][_0xb782('0xa1')],'cc':_0x5ece8e[_0xb782('0x59')]['cc'],'subject':_0x5ece8e[_0xb782('0x59')][_0xb782('0xaf')],'attach':_0x5ece8e[_0xb782('0x59')][_0xb782('0xb0')],'firstMsgDirection':_0xb782('0xb1'),'lastMsgAt':moment()[_0xb782('0x9a')](_0xb782('0x9b')),'lastMsgDirection':_0xb782('0xb1'),'lastMsgBody':_0x5ece8e['body'][_0xb782('0x59')],'Messages':[_['merge'](_0x5ece8e['body'],{'messageId':_0x4519a2[_0xb782('0xae')],'sentAt':moment()[_0xb782('0x9a')](_0xb782('0x9b')),'read':!![],'MailAccountId':_0x179a2a['id'],'UserId':_0x5ece8e[_0xb782('0x71')]['id'],'ContactId':_0x13f2e7['id']})]};if(_0x5ece8e[_0xb782('0x59')][_0xb782('0xb2')]){_0x21ff81=_[_0xb782('0x4d')](_0x21ff81,_0x5ece8e[_0xb782('0x59')][_0xb782('0xb2')]);}return db[_0xb782('0x84')][_0xb782('0x5d')](_0x21ff81,{'include':[{'model':db[_0xb782('0x9c')],'as':'Messages'}]});}})[_0xb782('0x1e')](respondWithResult(_0x528fac,null))[_0xb782('0x27')](handleError(_0x528fac,null));};exports['verifySmtp']=function(_0x57b91f,_0x117149,_0x6fe9f4){return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x57b91f[_0xb782('0x5a')]['id']},'include':[{'model':db[_0xb782('0x38')],'as':'Smtp','raw':!![]}]})[_0xb782('0x1e')](handleEntityNotFound(_0x117149,null))['then'](function(_0xd19f99){if(_0xd19f99&&_0xd19f99['Smtp']){var _0x5d67bd={'id':_0xd19f99['id'],'tls':{'rejectUnauthorized':![]}};if(_0xd19f99[_0xb782('0x53')][_0xb782('0x77')]){_0x5d67bd[_0xb782('0x77')]=_0xd19f99[_0xb782('0x53')][_0xb782('0x77')];}else{_0x5d67bd[_0xb782('0x75')]=_0xd19f99[_0xb782('0x53')][_0xb782('0x75')];_0x5d67bd['port']=_0xd19f99[_0xb782('0x53')]['port'];_0x5d67bd[_0xb782('0xa7')]=_0xd19f99['Smtp'][_0xb782('0xa7')];}if(_0xd19f99[_0xb782('0x53')]['authentication']){_0x5d67bd[_0xb782('0xa8')]={'user':_0xd19f99[_0xb782('0x53')][_0xb782('0x71')],'pass':_0xd19f99['Smtp']['pass']};}return respondWithRpcPromise(_0xb782('0xb3'),_0xb782('0xb4'),{'account':_0x5d67bd});}})[_0xb782('0x1e')](respondWithResult(_0x117149,null))[_0xb782('0x27')](handleError(_0x117149,null));};exports['destroy']=function(_0x29eebd,_0x340f40){return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x29eebd[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x340f40,null))[_0xb782('0x1e')](function(_0x3f20a0){if(_0x3f20a0&&_0x3f20a0[_0xb782('0x77')]){throw new db[(_0xb782('0x1b'))][(_0xb782('0x1c'))](_0xb782('0xb5'));}return _0x3f20a0;})[_0xb782('0x1e')](removeEntity(_0x340f40,null))[_0xb782('0x27')](handleError(_0x340f40,null));};exports[_0xb782('0xb6')]=function(_0x1dabb6,_0x5ecbba,_0x33fd62){return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x1dabb6[_0xb782('0x5a')]['id']}})[_0xb782('0x1e')](handleEntityNotFound(_0x5ecbba,null))['then'](function(_0x21f4a9){if(_0x21f4a9){return _0x21f4a9[_0xb782('0xb6')](_0x1dabb6[_0xb782('0x59')][_0xb782('0x65')],_[_0xb782('0x85')](_0x1dabb6[_0xb782('0x59')],[_0xb782('0x65'),'id'])||{})['spread'](function(_0x3d1fcc){for(var _0x6f4981=0x0;_0x6f4981<_0x1dabb6['body'][_0xb782('0x65')][_0xb782('0x68')];_0x6f4981+=0x1){socket[_0xb782('0xb7')](_0xb782('0xb8'),{'UserId':_0x1dabb6[_0xb782('0x59')][_0xb782('0x65')][_0x6f4981],'MailAccountId':_0x1dabb6['params']['id']});}return _0x3d1fcc;});}})['then'](respondWithResult(_0x5ecbba,null))[_0xb782('0x27')](handleError(_0x5ecbba,null));};exports['removeAgents']=function(_0x56fb05,_0x5c2600,_0x4427e7){return db[_0xb782('0x3c')][_0xb782('0x57')]({'where':{'id':_0x56fb05['params']['id']}})['then'](handleEntityNotFound(_0x5c2600,null))[_0xb782('0x1e')](function(_0x5e350d){if(_0x5e350d){return _0x5e350d[_0xb782('0xb9')](_0x56fb05[_0xb782('0x42')][_0xb782('0x65')])['then'](function(){if(_[_0xb782('0xba')](_0x56fb05[_0xb782('0x42')][_0xb782('0x65')])){for(var _0x4e53c2=0x0;_0x4e53c2<_0x56fb05['query'][_0xb782('0x65')]['length'];_0x4e53c2+=0x1){socket[_0xb782('0xb7')](_0xb782('0xbb'),{'UserId':Number(_0x56fb05['query'][_0xb782('0x65')][_0x4e53c2]),'MailAccountId':Number(_0x56fb05['params']['id'])});}}else{socket[_0xb782('0xb7')](_0xb782('0xbb'),{'UserId':Number(_0x56fb05['query']['ids']),'MailAccountId':Number(_0x56fb05[_0xb782('0x5a')]['id'])});}});}})[_0xb782('0x1e')](respondWithStatusCode(_0x5c2600,null))[_0xb782('0x27')](handleError(_0x5c2600,null));};exports[_0xb782('0xbc')]=function(_0x12e6dc,_0x5826da,_0x3961e8){var _0x5f3ad7={};var _0x52b46e={};var _0x39eb46;var _0x24d65b;return db['MailAccount'][_0xb782('0x5f')]({'where':{'id':_0x12e6dc[_0xb782('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5826da,null))[_0xb782('0x1e')](function(_0x2aad57){if(_0x2aad57){_0x39eb46=_0x2aad57;_0x52b46e[_0xb782('0x41')]=_[_0xb782('0x54')](db['User'][_0xb782('0x3d')]);_0x52b46e[_0xb782('0x42')]=_['keys'](_0x12e6dc[_0xb782('0x42')]);_0x52b46e['filters']=_[_0xb782('0x45')](_0x52b46e[_0xb782('0x41')],_0x52b46e[_0xb782('0x42')]);_0x5f3ad7[_0xb782('0x44')]=_[_0xb782('0x45')](_0x52b46e[_0xb782('0x41')],qs[_0xb782('0x46')](_0x12e6dc[_0xb782('0x42')]['fields']));_0x5f3ad7[_0xb782('0x44')]=_0x5f3ad7[_0xb782('0x44')][_0xb782('0x68')]?_0x5f3ad7[_0xb782('0x44')]:_0x52b46e[_0xb782('0x41')];_0x5f3ad7[_0xb782('0x48')]=qs[_0xb782('0x49')](_0x12e6dc[_0xb782('0x42')][_0xb782('0x49')]);_0x5f3ad7[_0xb782('0x4a')]=qs['filters'](_['pick'](_0x12e6dc[_0xb782('0x42')],_0x52b46e[_0xb782('0x43')]));if(_0x12e6dc[_0xb782('0x42')][_0xb782('0x4c')]){_0x5f3ad7[_0xb782('0x4a')]=_['merge'](_0x5f3ad7[_0xb782('0x4a')],{'$or':_[_0xb782('0x3b')](_0x5f3ad7['attributes'],function(_0x3211be){var _0x2b3a56={};_0x2b3a56[_0x3211be]={'$like':'%'+_0x12e6dc[_0xb782('0x42')][_0xb782('0x4c')]+'%'};return _0x2b3a56;})});}_0x5f3ad7=_['merge']({},_0x5f3ad7,_0x12e6dc['options']);return _0x39eb46['getAgents'](_0x5f3ad7);}})['then'](function(_0x5e499e){if(_0x5e499e){_0x24d65b=_0x5e499e[_0xb782('0x68')];if(!_0x12e6dc[_0xb782('0x42')][_0xb782('0x47')](_0xb782('0x60'))){_0x5f3ad7['limit']=qs[_0xb782('0x2b')](_0x12e6dc[_0xb782('0x42')]['limit']);_0x5f3ad7['offset']=qs[_0xb782('0x2a')](_0x12e6dc[_0xb782('0x42')][_0xb782('0x2a')]);}return _0x39eb46[_0xb782('0xbc')](_0x5f3ad7);}})[_0xb782('0x1e')](function(_0x4a0d17){if(_0x4a0d17){return _0x4a0d17?{'count':_0x24d65b,'rows':_0x4a0d17}:null;}})['then'](respondWithResult(_0x5826da,null))['catch'](handleError(_0x5826da,null));}; \ No newline at end of file +var _0x3964=['info','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','name','send','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','keys','body','find','describe','addDisposition','MailAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','pick','key','ListId','isNil','active','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','cservice','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','from','email','attachments','join','root','server/files/attachments','secure','auth','SendMail','sendMail','defaults','List\x20not\x20found','messageId','subject','Interaction','Messages','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x3964,0x9a));var _0x4396=function(_0x266578,_0x232e71){_0x266578=_0x266578-0x0;var _0x285e0d=_0x3964[_0x266578];return _0x285e0d;};'use strict';var pdf=require(_0x4396('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4396('0x1'));var zipdir=require(_0x4396('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4396('0x3'));var Mustache=require(_0x4396('0x4'));var util=require('util');var path=require(_0x4396('0x5'));var sox=require(_0x4396('0x6'));var csv=require(_0x4396('0x7'));var ejs=require(_0x4396('0x8'));var fs=require('fs');var _=require(_0x4396('0x9'));var squel=require(_0x4396('0xa'));var crypto=require('crypto');var jsforce=require(_0x4396('0xb'));var deskjs=require(_0x4396('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4396('0xd'));var Redis=require(_0x4396('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4396('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4396('0x10'));var logger=require('../../config/logger')(_0x4396('0x11'));var utils=require(_0x4396('0x12'));var config=require(_0x4396('0x13'));var db=require('../../mysqldb')['db'];config[_0x4396('0x14')]=_['defaults'](config['redis'],{'host':_0x4396('0x15'),'port':0x18eb});var socket=require(_0x4396('0x16'))(new Redis(config[_0x4396('0x14')]));require(_0x4396('0x17'))[_0x4396('0x18')](socket);var jayson=require(_0x4396('0x19'));var client=jayson[_0x4396('0x1a')][_0x4396('0x1b')]({'port':0x232b});function checkPasswordPattern(_0xeb398,_0x488bdf,_0x5ba71b){if(_0x5ba71b){var _0x4742e2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4742e2[_0x4396('0x1c')](_0x488bdf)){return _0xeb398;}else{throw new db[(_0x4396('0x1d'))][(_0x4396('0x1e'))](_0x4396('0x1f'));}}else{return _0xeb398;}}function respondWithRpcPromise(_0x33fbe7,_0x26873f,_0x2d1baf,_0x3c65c2){return new BPromise(function(_0x9db3f8,_0x179f7c){var _0xa48a4a=_0x3c65c2||client;return _0xa48a4a[_0x4396('0x20')](_0x33fbe7,_0x2d1baf)[_0x4396('0x21')](function(_0x1300a0){logger['info'](_0x4396('0x22'),_0x26873f,_0x4396('0x23'));logger[_0x4396('0x24')](_0x4396('0x25'),_0x26873f,_0x4396('0x23'),JSON[_0x4396('0x26')](_0x1300a0));if(_0x1300a0[_0x4396('0x27')]){if(_0x1300a0[_0x4396('0x27')]['code']===0x1f4){logger[_0x4396('0x27')](_0x4396('0x22'),_0x26873f,_0x1300a0[_0x4396('0x27')][_0x4396('0x28')]);return _0x179f7c(_0x1300a0[_0x4396('0x27')][_0x4396('0x28')]);}logger[_0x4396('0x27')](_0x4396('0x22'),_0x26873f,_0x1300a0['error']['message']);return _0x9db3f8(_0x1300a0[_0x4396('0x27')][_0x4396('0x28')]);}else{logger[_0x4396('0x29')](_0x4396('0x22'),_0x26873f,_0x4396('0x23'));_0x9db3f8(_0x1300a0[_0x4396('0x2a')]['message']);}})[_0x4396('0x2b')](function(_0x1e6b84){logger[_0x4396('0x27')](_0x4396('0x22'),_0x26873f,_0x1e6b84);_0x179f7c(_0x1e6b84);});});}function respondWithStatusCode(_0x1c5060,_0x3db6d1){_0x3db6d1=_0x3db6d1||0xcc;return function(_0x46e4c4){if(_0x46e4c4){return _0x1c5060[_0x4396('0x2c')](_0x3db6d1);}return _0x1c5060['status'](_0x3db6d1)[_0x4396('0x2d')]();};}function respondWithResult(_0x37b1cd,_0x3fd611){_0x3fd611=_0x3fd611||0xc8;return function(_0x573cfb){if(_0x573cfb){return _0x37b1cd[_0x4396('0x2e')](_0x3fd611)[_0x4396('0x2f')](_0x573cfb);}};}function respondWithFilteredResult(_0x52b364,_0x553a2d){return function(_0x31e39d){if(_0x31e39d){var _0x5bb066=_0x31e39d[_0x4396('0x30')],_0x18db6d=_0x553a2d[_0x4396('0x31')],_0x1c93c1=_0x553a2d[_0x4396('0x31')]+_0x553a2d[_0x4396('0x32')],_0x1fe1e9;if(_0x1c93c1>=_0x5bb066){_0x1c93c1=_0x5bb066;_0x1fe1e9=0xc8;}else{_0x1fe1e9=0xce;}_0x52b364[_0x4396('0x2e')](_0x1fe1e9);return _0x52b364[_0x4396('0x33')](_0x4396('0x34'),_0x18db6d+'-'+_0x1c93c1+'/'+_0x5bb066)[_0x4396('0x2f')](_0x31e39d);}return null;};}function patchUpdates(_0x13f093){return function(_0x3789e7){try{jsonpatch[_0x4396('0x35')](_0x3789e7,_0x13f093,!![]);}catch(_0x48f0d4){return BPromise[_0x4396('0x36')](_0x48f0d4);}return _0x3789e7[_0x4396('0x37')]();};}function saveUpdates(_0x4dbe09,_0x3e6152){return function(_0x52e9b3){if(_0x52e9b3){return _0x52e9b3[_0x4396('0x38')](_0x4dbe09)['then'](function(_0x4cbc4b){return _0x4cbc4b;});}return null;};}function removeEntity(_0x5b6f73,_0x5ea404){return function(_0x5bd628){if(_0x5bd628){return _0x5bd628[_0x4396('0x39')]()[_0x4396('0x21')](function(){var _0x10ddfe=_0x5bd628[_0x4396('0x3a')]({'plain':!![]});var _0x3b2333=_0x4396('0x3b');return db[_0x4396('0x3c')][_0x4396('0x39')]({'where':{'type':_0x3b2333,'resourceId':_0x10ddfe['id']}})[_0x4396('0x21')](function(){return _0x5bd628;});})[_0x4396('0x21')](function(){_0x5b6f73[_0x4396('0x2e')](0xcc)[_0x4396('0x2d')]();});}};}function handleEntityNotFound(_0x12074c,_0x423776){return function(_0x2793b8){if(!_0x2793b8){_0x12074c[_0x4396('0x2c')](0x194);}return _0x2793b8;};}function handleError(_0x1733af,_0x552e90){_0x552e90=_0x552e90||0x1f4;return function(_0x2ce99d){logger['error'](_0x2ce99d['stack']);if(_0x2ce99d[_0x4396('0x3d')]){delete _0x2ce99d[_0x4396('0x3d')];}_0x1733af[_0x4396('0x2e')](_0x552e90)[_0x4396('0x3e')](_0x2ce99d);};}exports['index']=function(_0x582e2d,_0x5aa677){var _0x5739af={'include':[{'model':db[_0x4396('0x3f')],'as':_0x4396('0x40')},{'model':db[_0x4396('0x41')],'as':_0x4396('0x42')},{'model':db['Pause'],'as':_0x4396('0x43')}]},_0x2ae32a={},_0x34b5f2={'count':0x0,'rows':[]};var _0x22f422=_[_0x4396('0x44')](db[_0x4396('0x45')][_0x4396('0x46')],function(_0x356a23){return{'name':_0x356a23['fieldName'],'type':_0x356a23[_0x4396('0x47')]['key']};});_0x2ae32a['model']=_[_0x4396('0x44')](_0x22f422,_0x4396('0x3d'));_0x2ae32a[_0x4396('0x48')]=_['keys'](_0x582e2d['query']);_0x2ae32a[_0x4396('0x49')]=_['intersection'](_0x2ae32a['model'],_0x2ae32a['query']);_0x5739af[_0x4396('0x4a')]=_[_0x4396('0x4b')](_0x2ae32a[_0x4396('0x4c')],qs[_0x4396('0x4d')](_0x582e2d['query']['fields']));_0x5739af[_0x4396('0x4a')]=_0x5739af[_0x4396('0x4a')][_0x4396('0x4e')]?_0x5739af[_0x4396('0x4a')]:_0x2ae32a[_0x4396('0x4c')];if(!_0x582e2d['query'][_0x4396('0x4f')](_0x4396('0x50'))){_0x5739af[_0x4396('0x32')]=qs[_0x4396('0x32')](_0x582e2d[_0x4396('0x48')][_0x4396('0x32')]);_0x5739af[_0x4396('0x31')]=qs[_0x4396('0x31')](_0x582e2d[_0x4396('0x48')][_0x4396('0x31')]);}_0x5739af[_0x4396('0x51')]=qs[_0x4396('0x52')](_0x582e2d[_0x4396('0x48')]['sort']);_0x5739af[_0x4396('0x53')]=qs['filters'](_['pick'](_0x582e2d[_0x4396('0x48')],_0x2ae32a[_0x4396('0x49')]));if(_0x582e2d[_0x4396('0x48')][_0x4396('0x54')]){_0x5739af[_0x4396('0x53')]=_[_0x4396('0x55')](_0x5739af['where'],{'$or':_['map'](_0x22f422,function(_0xdf6d45){if(_0xdf6d45[_0x4396('0x47')]!==_0x4396('0x56')){var _0x2e4a55={};_0x2e4a55[_0xdf6d45[_0x4396('0x3d')]]={'$like':'%'+_0x582e2d[_0x4396('0x48')][_0x4396('0x54')]+'%'};return _0x2e4a55;}})});}_0x5739af=_['merge']({},_0x5739af,_0x582e2d[_0x4396('0x57')]);var _0x4ee85a={'where':_0x5739af[_0x4396('0x53')]};return db['MailAccount'][_0x4396('0x30')](_0x4ee85a)[_0x4396('0x21')](function(_0x1b0545){_0x34b5f2[_0x4396('0x30')]=_0x1b0545;if(_0x582e2d[_0x4396('0x48')][_0x4396('0x58')]){_0x5739af[_0x4396('0x59')]=[{'all':!![]}];}return db['MailAccount'][_0x4396('0x5a')](_0x5739af);})[_0x4396('0x21')](function(_0x14d2fd){_0x34b5f2[_0x4396('0x5b')]=_0x14d2fd;return _0x34b5f2;})[_0x4396('0x21')](respondWithFilteredResult(_0x5aa677,_0x5739af))['catch'](handleError(_0x5aa677,null));};exports[_0x4396('0x5c')]=function(_0x493a50,_0x267d4b){var _0x4c395b={'raw':![],'where':{'id':_0x493a50[_0x4396('0x5d')]['id']},'include':[{'model':db[_0x4396('0x3f')],'as':'Imap'},{'model':db[_0x4396('0x41')],'as':_0x4396('0x42')},{'model':db[_0x4396('0x5e')],'as':'mandatoryDispositionPause'}]},_0x41801e={};_0x41801e[_0x4396('0x4c')]=_[_0x4396('0x5f')](db[_0x4396('0x45')][_0x4396('0x46')]);_0x41801e[_0x4396('0x48')]=_[_0x4396('0x5f')](_0x493a50[_0x4396('0x48')]);_0x41801e[_0x4396('0x49')]=_['intersection'](_0x41801e[_0x4396('0x4c')],_0x41801e[_0x4396('0x48')]);_0x4c395b[_0x4396('0x4a')]=_[_0x4396('0x4b')](_0x41801e['model'],qs['fields'](_0x493a50[_0x4396('0x48')][_0x4396('0x4d')]));_0x4c395b['attributes']=_0x4c395b[_0x4396('0x4a')][_0x4396('0x4e')]?_0x4c395b['attributes']:_0x41801e[_0x4396('0x4c')];if(_0x493a50[_0x4396('0x48')]['includeAll']){_0x4c395b[_0x4396('0x59')]=[{'all':!![]}];}_0x4c395b=_['merge']({},_0x4c395b,_0x493a50['options']);return db['MailAccount']['find'](_0x4c395b)[_0x4396('0x21')](handleEntityNotFound(_0x267d4b,null))['then'](respondWithResult(_0x267d4b,null))[_0x4396('0x2b')](handleError(_0x267d4b,null));};exports[_0x4396('0x38')]=function(_0x12acff,_0xb1cdcc){if(_0x12acff[_0x4396('0x60')]['id']){delete _0x12acff[_0x4396('0x60')]['id'];}return db[_0x4396('0x45')][_0x4396('0x61')]({'where':{'id':_0x12acff[_0x4396('0x5d')]['id']},'include':[{'model':db[_0x4396('0x3f')],'as':_0x4396('0x40')},{'model':db[_0x4396('0x41')],'as':_0x4396('0x42')},{'model':db[_0x4396('0x5e')],'as':_0x4396('0x43')}]})[_0x4396('0x21')](handleEntityNotFound(_0xb1cdcc,null))[_0x4396('0x21')](saveUpdates(_0x12acff[_0x4396('0x60')],null))[_0x4396('0x21')](function(_0x5ea659){if(_0x5ea659&&_0x12acff[_0x4396('0x60')][_0x4396('0x40')]){return db[_0x4396('0x3f')]['update'](_0x12acff['body'][_0x4396('0x40')],{'where':{'MailAccountId':_0x5ea659['id']}})[_0x4396('0x21')](function(){return _0x5ea659;});}return _0x5ea659;})[_0x4396('0x21')](function(_0x73424){if(_0x73424&&_0x12acff[_0x4396('0x60')][_0x4396('0x42')]){return db[_0x4396('0x41')]['update'](_0x12acff['body'][_0x4396('0x42')],{'where':{'MailAccountId':_0x73424['id']}})[_0x4396('0x21')](function(){return _0x73424;});}return _0x73424;})[_0x4396('0x21')](respondWithResult(_0xb1cdcc,null))[_0x4396('0x2b')](handleError(_0xb1cdcc,null));};exports[_0x4396('0x62')]=function(_0xbbdf41,_0xa0c9c7){return db[_0x4396('0x45')][_0x4396('0x62')]()[_0x4396('0x21')](respondWithResult(_0xa0c9c7,null))[_0x4396('0x2b')](handleError(_0xa0c9c7,null));};exports[_0x4396('0x63')]=function(_0x4e85ab,_0x149be8,_0x1c1687){if(_0x4e85ab[_0x4396('0x60')]['id']){delete _0x4e85ab[_0x4396('0x60')]['id'];}return db[_0x4396('0x45')]['find']({'where':{'id':_0x4e85ab[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x149be8,null))[_0x4396('0x21')](function(_0x21c5f4){if(_0x21c5f4){_0x4e85ab[_0x4396('0x60')][_0x4396('0x64')]=_0x21c5f4['id'];return db['Disposition']['create'](_0x4e85ab[_0x4396('0x60')]);}})[_0x4396('0x21')](respondWithResult(_0x149be8,null))['catch'](handleError(_0x149be8,null));};exports[_0x4396('0x65')]=function(_0xb86c28,_0xb57a3d,_0x473601){var _0x4fe094={'raw':![],'where':{}};var _0x1cb196={};var _0x49b3db={'count':0x0,'rows':[]};return db[_0x4396('0x45')][_0x4396('0x66')]({'where':{'id':_0xb86c28[_0x4396('0x5d')]['id']}})['then'](handleEntityNotFound(_0xb57a3d,null))[_0x4396('0x21')](function(_0x5a1e03){if(_0x5a1e03){_0x1cb196[_0x4396('0x4c')]=_[_0x4396('0x5f')](db[_0x4396('0x67')][_0x4396('0x46')]);_0x1cb196[_0x4396('0x48')]=_[_0x4396('0x5f')](_0xb86c28[_0x4396('0x48')]);_0x1cb196[_0x4396('0x49')]=_[_0x4396('0x4b')](_0x1cb196[_0x4396('0x4c')],_0x1cb196[_0x4396('0x48')]);_0x4fe094[_0x4396('0x4a')]=_[_0x4396('0x4b')](_0x1cb196[_0x4396('0x4c')],qs[_0x4396('0x4d')](_0xb86c28['query'][_0x4396('0x4d')]));_0x4fe094[_0x4396('0x4a')]=_0x4fe094[_0x4396('0x4a')]['length']?_0x4fe094['attributes']:_0x1cb196[_0x4396('0x4c')];if(!_0xb86c28['query']['hasOwnProperty'](_0x4396('0x50'))){_0x4fe094['limit']=qs[_0x4396('0x32')](_0xb86c28['query'][_0x4396('0x32')]);_0x4fe094[_0x4396('0x31')]=qs['offset'](_0xb86c28[_0x4396('0x48')]['offset']);}_0x4fe094[_0x4396('0x51')]=qs[_0x4396('0x52')](_0xb86c28['query'][_0x4396('0x52')]);_0x4fe094[_0x4396('0x53')]=qs[_0x4396('0x49')](_['pick'](_0xb86c28[_0x4396('0x48')],_0x1cb196['filters']));_0x4fe094[_0x4396('0x53')]['MailAccountId']=_0x5a1e03['id'];if(_0xb86c28[_0x4396('0x48')][_0x4396('0x54')]){_0x4fe094['where']=_[_0x4396('0x55')](_0x4fe094[_0x4396('0x53')],{'$or':_['map'](_0x4fe094['attributes'],function(_0x1ff249){var _0x5ca430={};_0x5ca430[_0x1ff249]={'$like':'%'+_0xb86c28[_0x4396('0x48')][_0x4396('0x54')]+'%'};return _0x5ca430;})});}_0x4fe094=_[_0x4396('0x55')]({},_0x4fe094,_0xb86c28[_0x4396('0x57')]);return db['Disposition']['count']({'where':_0x4fe094[_0x4396('0x53')]})[_0x4396('0x21')](function(_0x455738){_0x49b3db['count']=_0x455738;if(_0xb86c28[_0x4396('0x48')][_0x4396('0x58')]){_0x4fe094[_0x4396('0x59')]=[{'all':!![]}];}return db[_0x4396('0x67')]['findAll'](_0x4fe094);})[_0x4396('0x21')](function(_0x531415){_0x49b3db[_0x4396('0x5b')]=_0x531415;return _0x49b3db;});}})['then'](respondWithFilteredResult(_0xb57a3d,_0x4fe094))[_0x4396('0x2b')](handleError(_0xb57a3d,null));};exports[_0x4396('0x68')]=function(_0x3ff72c,_0xb6578c,_0x1b2994){return db['MailAccount'][_0x4396('0x61')]({'where':{'id':_0x3ff72c[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0xb6578c,null))[_0x4396('0x21')](function(_0x577db9){if(_0x577db9){return _0x577db9['removeDispositions'](_0x3ff72c[_0x4396('0x48')][_0x4396('0x69')]);}})['then'](respondWithStatusCode(_0xb6578c,null))[_0x4396('0x2b')](handleError(_0xb6578c,null));};exports[_0x4396('0x6a')]=function(_0x536380,_0x4f0ebe,_0x3256a0){if(_0x536380['body']['id']){delete _0x536380[_0x4396('0x60')]['id'];}return db[_0x4396('0x45')][_0x4396('0x61')]({'where':{'id':_0x536380[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x4f0ebe,null))[_0x4396('0x21')](function(_0x8532e8){if(_0x8532e8){_0x536380['body']['MailAccountId']=_0x8532e8['id'];return db[_0x4396('0x6b')][_0x4396('0x6c')](_0x536380[_0x4396('0x60')]);}})['then'](respondWithResult(_0x4f0ebe,null))[_0x4396('0x2b')](handleError(_0x4f0ebe,null));};exports[_0x4396('0x6d')]=function(_0x47e28c,_0x511be3,_0x51aacb){var _0x58e480={'raw':![],'where':{}};var _0x519661={};var _0x47cb04={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x47e28c[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x511be3,null))[_0x4396('0x21')](function(_0x26210e){if(_0x26210e){_0x519661[_0x4396('0x4c')]=_['keys'](db[_0x4396('0x6b')][_0x4396('0x46')]);_0x519661['query']=_[_0x4396('0x5f')](_0x47e28c[_0x4396('0x48')]);_0x519661[_0x4396('0x49')]=_[_0x4396('0x4b')](_0x519661[_0x4396('0x4c')],_0x519661[_0x4396('0x48')]);_0x58e480['attributes']=_[_0x4396('0x4b')](_0x519661[_0x4396('0x4c')],qs[_0x4396('0x4d')](_0x47e28c[_0x4396('0x48')][_0x4396('0x4d')]));_0x58e480['attributes']=_0x58e480[_0x4396('0x4a')][_0x4396('0x4e')]?_0x58e480[_0x4396('0x4a')]:_0x519661[_0x4396('0x4c')];if(!_0x47e28c[_0x4396('0x48')][_0x4396('0x4f')](_0x4396('0x50'))){_0x58e480[_0x4396('0x32')]=qs['limit'](_0x47e28c[_0x4396('0x48')][_0x4396('0x32')]);_0x58e480['offset']=qs[_0x4396('0x31')](_0x47e28c[_0x4396('0x48')]['offset']);}_0x58e480[_0x4396('0x51')]=qs['sort'](_0x47e28c[_0x4396('0x48')][_0x4396('0x52')]);_0x58e480['where']=qs[_0x4396('0x49')](_[_0x4396('0x6e')](_0x47e28c[_0x4396('0x48')],_0x519661[_0x4396('0x49')]));_0x58e480[_0x4396('0x53')][_0x4396('0x64')]=_0x26210e['id'];if(_0x47e28c[_0x4396('0x48')][_0x4396('0x54')]){_0x58e480[_0x4396('0x53')]=_[_0x4396('0x55')](_0x58e480[_0x4396('0x53')],{'$or':_[_0x4396('0x44')](_0x58e480[_0x4396('0x4a')],function(_0x1bdd76){var _0x10349f={};_0x10349f[_0x1bdd76]={'$like':'%'+_0x47e28c['query'][_0x4396('0x54')]+'%'};return _0x10349f;})});}_0x58e480=_[_0x4396('0x55')]({},_0x58e480,_0x47e28c[_0x4396('0x57')]);return db[_0x4396('0x6b')][_0x4396('0x30')]({'where':_0x58e480[_0x4396('0x53')]})[_0x4396('0x21')](function(_0x3566a7){_0x47cb04[_0x4396('0x30')]=_0x3566a7;if(_0x47e28c[_0x4396('0x48')]['includeAll']){_0x58e480[_0x4396('0x59')]=[{'all':!![]}];}return db[_0x4396('0x6b')][_0x4396('0x5a')](_0x58e480);})['then'](function(_0x43b3ee){_0x47cb04[_0x4396('0x5b')]=_0x43b3ee;return _0x47cb04;});}})[_0x4396('0x21')](respondWithFilteredResult(_0x511be3,_0x58e480))[_0x4396('0x2b')](handleError(_0x511be3,null));};exports['removeAnswers']=function(_0x3688ca,_0x2edea7,_0x3e3e81){return db[_0x4396('0x45')][_0x4396('0x61')]({'where':{'id':_0x3688ca[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x2edea7,null))['then'](function(_0x342830){if(_0x342830){return _0x342830['removeAnswers'](_0x3688ca[_0x4396('0x48')]['ids']);}})[_0x4396('0x21')](respondWithStatusCode(_0x2edea7,null))[_0x4396('0x2b')](handleError(_0x2edea7,null));};exports['create']=function(_0x579530,_0x4f614c){var _0x5dc060={'name':_0x579530[_0x4396('0x60')]['name'],'key':_0x579530[_0x4396('0x60')][_0x4396('0x6f')],'email':_0x579530[_0x4396('0x60')]['email'],'ListId':_0x579530[_0x4396('0x60')][_0x4396('0x70')],'active':!_[_0x4396('0x71')](_0x579530[_0x4396('0x60')][_0x4396('0x72')])?_0x579530['body'][_0x4396('0x72')]:!![],'description':_0x579530[_0x4396('0x60')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x4396('0x71')](_0x579530[_0x4396('0x60')]['cservice'])){if(_0x579530[_0x4396('0x60')][_0x4396('0x73')]){_0x5dc060[_0x4396('0x40')][_0x4396('0x74')]=_0x5dc060[_0x4396('0x42')][_0x4396('0x74')]=_0x579530['body'][_0x4396('0x75')];_0x5dc060[_0x4396('0x40')][_0x4396('0x76')]=_0x5dc060[_0x4396('0x42')][_0x4396('0x77')]=_0x579530[_0x4396('0x60')][_0x4396('0x78')];}else{_0x5dc060[_0x4396('0x40')][_0x4396('0x79')]=_0x5dc060[_0x4396('0x42')][_0x4396('0x79')]=![];}_0x5dc060[_0x4396('0x40')]['host']=_0x579530[_0x4396('0x60')][_0x4396('0x40')][_0x4396('0x7a')];_0x5dc060[_0x4396('0x40')][_0x4396('0x7b')]=_0x579530[_0x4396('0x60')]['Imap']['port'];_0x5dc060[_0x4396('0x42')]['host']=_0x579530[_0x4396('0x60')][_0x4396('0x42')][_0x4396('0x7a')];_0x5dc060[_0x4396('0x42')]['port']=_0x579530[_0x4396('0x60')][_0x4396('0x42')][_0x4396('0x7b')];}else{_0x5dc060[_0x4396('0x40')][_0x4396('0x7c')]=_0x5dc060[_0x4396('0x42')][_0x4396('0x7c')]=_0x579530[_0x4396('0x60')][_0x4396('0x7d')];_0x5dc060[_0x4396('0x40')][_0x4396('0x74')]=_0x5dc060['Smtp'][_0x4396('0x74')]=_0x579530[_0x4396('0x60')][_0x4396('0x75')];_0x5dc060['Imap'][_0x4396('0x76')]=_0x5dc060[_0x4396('0x42')][_0x4396('0x77')]=_0x579530[_0x4396('0x60')]['cpassword'];}return db['MailAccount']['create'](_0x5dc060,{'include':[{'model':db[_0x4396('0x41')],'as':_0x4396('0x42')},{'model':db[_0x4396('0x3f')],'as':'Imap'}]})[_0x4396('0x21')](function(_0x2a642c){var _0x1d7a63=_0x579530[_0x4396('0x74')]['get']({'plain':!![]});if(!_0x1d7a63)throw new Error(_0x4396('0x7e'));if(_0x1d7a63[_0x4396('0x7f')]===_0x4396('0x74')){var _0x5b0a38=_0x2a642c[_0x4396('0x3a')]({'plain':!![]});return db[_0x4396('0x80')][_0x4396('0x61')]({'where':{'name':_0x4396('0x3b'),'userProfileId':_0x1d7a63[_0x4396('0x81')]},'raw':!![]})['then'](function(_0x66321f){if(_0x66321f&&_0x66321f[_0x4396('0x82')]===0x0){return db[_0x4396('0x3c')]['create']({'name':_0x5b0a38['name'],'resourceId':_0x5b0a38['id'],'type':_0x66321f[_0x4396('0x3d')],'sectionId':_0x66321f['id']},{})[_0x4396('0x21')](function(){return _0x2a642c;});}else{return _0x2a642c;}})[_0x4396('0x2b')](function(_0x4d14f6){logger['error'](_0x4396('0x83'),_0x4d14f6);throw _0x4d14f6;});}return _0x2a642c;})[_0x4396('0x21')](respondWithResult(_0x4f614c,0xc9))[_0x4396('0x2b')](handleError(_0x4f614c,null));};exports[_0x4396('0x84')]=function(_0x5a2e4f,_0x284a1c,_0x2cb1fa){return db[_0x4396('0x45')][_0x4396('0x66')]({'where':{'id':_0x5a2e4f['params']['id']}})['then'](handleEntityNotFound(_0x284a1c,null))[_0x4396('0x21')](function(_0x48fd3c){if(_0x48fd3c){return _0x48fd3c[_0x4396('0x84')]();}return null;})[_0x4396('0x21')](respondWithResult(_0x284a1c,null))['catch'](handleError(_0x284a1c,null));};exports[_0x4396('0x85')]=function(_0x4764d9,_0x2d20bb,_0x332b76){if(_0x4764d9['body']['id']){delete _0x4764d9[_0x4396('0x60')]['id'];}return db[_0x4396('0x45')][_0x4396('0x61')]({'where':{'id':_0x4764d9[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x2d20bb,null))[_0x4396('0x21')](function(_0x27c48f){if(_0x27c48f){_0x4764d9['body']['MailAccountId']=_0x27c48f['id'];return db['MailServerIn'][_0x4396('0x6c')](_0x4764d9['body']);}})[_0x4396('0x21')](respondWithResult(_0x2d20bb,null))[_0x4396('0x2b')](handleError(_0x2d20bb,null));};exports[_0x4396('0x86')]=function(_0x2e1fff,_0x47035d,_0x1f5872){return db['MailAccount'][_0x4396('0x66')]({'where':{'id':_0x2e1fff[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x47035d,null))['then'](function(_0x4f7966){if(_0x4f7966){return _0x4f7966[_0x4396('0x87')](null);}return null;})[_0x4396('0x21')](respondWithStatusCode(_0x47035d,null))[_0x4396('0x2b')](handleError(_0x47035d,null));};exports[_0x4396('0x88')]=function(_0x4e2a50,_0xbe8fa,_0x46a89b){return db[_0x4396('0x45')][_0x4396('0x66')]({'where':{'id':_0x4e2a50[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0xbe8fa,null))[_0x4396('0x21')](function(_0x5d1eb1){if(_0x5d1eb1){return _0x5d1eb1[_0x4396('0x88')]();}return null;})[_0x4396('0x21')](respondWithResult(_0xbe8fa,null))[_0x4396('0x2b')](handleError(_0xbe8fa,null));};exports[_0x4396('0x89')]=function(_0x2c0332,_0x3fd188,_0x1db7f6){if(_0x2c0332['body']['id']){delete _0x2c0332[_0x4396('0x60')]['id'];}return db[_0x4396('0x45')][_0x4396('0x61')]({'where':{'id':_0x2c0332[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x3fd188,null))[_0x4396('0x21')](function(_0x3e4946){if(_0x3e4946){_0x2c0332[_0x4396('0x60')][_0x4396('0x64')]=_0x3e4946['id'];return db['MailServerOut'][_0x4396('0x6c')](_0x2c0332[_0x4396('0x60')]);}})[_0x4396('0x21')](respondWithResult(_0x3fd188,null))[_0x4396('0x2b')](handleError(_0x3fd188,null));};exports[_0x4396('0x8a')]=function(_0x43f847,_0x1c7c3b,_0x4d9267){return db[_0x4396('0x45')][_0x4396('0x66')]({'where':{'id':_0x43f847[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x1c7c3b,null))[_0x4396('0x21')](function(_0x1052b){if(_0x1052b){return _0x1052b[_0x4396('0x8b')](null);}return null;})[_0x4396('0x21')](respondWithStatusCode(_0x1c7c3b,null))[_0x4396('0x2b')](handleError(_0x1c7c3b,null));};exports['addInteraction']=function(_0x56832a,_0x4a70d6,_0x5625c9){return db['MailInteraction'][_0x4396('0x61')]({'where':{'id':_0x56832a['params']['id']}})['then'](handleEntityNotFound(_0x4a70d6,null))[_0x4396('0x21')](function(_0x12386a){if(_0x12386a){return _0x12386a[_0x4396('0x8c')](_0x56832a[_0x4396('0x60')][_0x4396('0x69')],_[_0x4396('0x8d')](_0x56832a['body'],[_0x4396('0x69'),'id'])||{});}})[_0x4396('0x21')](respondWithResult(_0x4a70d6,null))[_0x4396('0x2b')](handleError(_0x4a70d6,null));};exports[_0x4396('0x8e')]=function(_0x554476,_0x235809,_0x2234e8){var _0x18fd67={'raw':![],'where':{}};var _0x3e5461={};var _0x4f113b={'count':0x0,'rows':[]};return db[_0x4396('0x45')]['findOne']({'where':{'id':_0x554476[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x235809,null))[_0x4396('0x21')](function(_0x57f056){if(_0x57f056){_0x3e5461[_0x4396('0x4c')]=_[_0x4396('0x5f')](db['MailInteraction']['rawAttributes']);_0x3e5461['query']=_['keys'](_0x554476[_0x4396('0x48')]);_0x3e5461[_0x4396('0x49')]=_[_0x4396('0x4b')](_0x3e5461[_0x4396('0x4c')],_0x3e5461[_0x4396('0x48')]);_0x18fd67[_0x4396('0x4a')]=_[_0x4396('0x4b')](_0x3e5461[_0x4396('0x4c')],qs[_0x4396('0x4d')](_0x554476[_0x4396('0x48')]['fields']));_0x18fd67['attributes']=_0x18fd67[_0x4396('0x4a')][_0x4396('0x4e')]?_0x18fd67[_0x4396('0x4a')]:_0x3e5461['model'];if(!_0x554476[_0x4396('0x48')][_0x4396('0x4f')](_0x4396('0x50'))){_0x18fd67[_0x4396('0x32')]=qs[_0x4396('0x32')](_0x554476[_0x4396('0x48')][_0x4396('0x32')]);_0x18fd67['offset']=qs[_0x4396('0x31')](_0x554476['query'][_0x4396('0x31')]);}_0x18fd67[_0x4396('0x51')]=qs[_0x4396('0x52')](_0x554476[_0x4396('0x48')]['sort']);_0x18fd67[_0x4396('0x53')]=qs[_0x4396('0x49')](_[_0x4396('0x6e')](_0x554476[_0x4396('0x48')],_0x3e5461[_0x4396('0x49')]));_0x18fd67[_0x4396('0x53')][_0x4396('0x64')]=_0x57f056['id'];if(_0x554476[_0x4396('0x48')][_0x4396('0x54')]){_0x18fd67['where']=_['merge'](_0x18fd67[_0x4396('0x53')],{'$or':_[_0x4396('0x44')](_0x18fd67[_0x4396('0x4a')],function(_0xd3e791){var _0x50005c={};_0x50005c[_0xd3e791]={'$like':'%'+_0x554476[_0x4396('0x48')][_0x4396('0x54')]+'%'};return _0x50005c;})});}_0x18fd67=_[_0x4396('0x55')]({},_0x18fd67,_0x554476['options']);return db[_0x4396('0x8f')][_0x4396('0x30')]({'where':_0x18fd67['where']})['then'](function(_0x3dd060){_0x4f113b['count']=_0x3dd060;if(_0x554476[_0x4396('0x48')][_0x4396('0x58')]){_0x18fd67['include']=[{'model':db[_0x4396('0x90')],'as':_0x4396('0x91'),'required':![]},{'model':db[_0x4396('0x92')],'as':_0x4396('0x93'),'attributes':[_0x4396('0x3d'),_0x4396('0x94'),_0x4396('0x95')],'required':![]},{'model':db[_0x4396('0x96')],'as':'Tags','attributes':['id',_0x4396('0x3d'),'color'],'where':_0x554476[_0x4396('0x48')][_0x4396('0x97')]?{'id':_0x554476[_0x4396('0x48')]['tag']}:undefined,'required':_0x554476[_0x4396('0x48')]['tag']?!![]:![]}];}return db[_0x4396('0x8f')][_0x4396('0x5a')](_0x18fd67);})[_0x4396('0x21')](function(_0x564ff1){_0x4f113b[_0x4396('0x5b')]=_0x564ff1;return _0x4f113b;});}})[_0x4396('0x21')](respondWithFilteredResult(_0x235809,_0x18fd67))[_0x4396('0x2b')](handleError(_0x235809,null));};exports[_0x4396('0x98')]=function(_0x5f5cfe,_0x3d2147,_0xdb4f8f){return db[_0x4396('0x45')][_0x4396('0x66')]({'where':{'id':_0x5f5cfe[_0x4396('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3d2147,null))[_0x4396('0x21')](function(_0x515fe8){if(_0x515fe8){return db['sequelize'][_0x4396('0x99')](function(_0x506c0f){return db['MailApplication'][_0x4396('0x39')]({'where':{'MailAccountId':_0x5f5cfe[_0x4396('0x5d')]['id']},'transaction':_0x506c0f})['then'](function(_0x30f837){var _0x1af84d=_[_0x4396('0x44')](_0x5f5cfe[_0x4396('0x60')],function(_0x89edfb){_0x89edfb[_0x4396('0x64')]=_0x5f5cfe[_0x4396('0x5d')]['id'];return _0x89edfb;});return db[_0x4396('0x9a')][_0x4396('0x9b')](_0x1af84d,{'transaction':_0x506c0f});});})['then'](function(){return db[_0x4396('0x9a')][_0x4396('0x9c')]({'where':{'MailAccountId':_0x5f5cfe[_0x4396('0x5d')]['id']},'order':_0x4396('0x9d')});});}})[_0x4396('0x21')](respondWithResult(_0x3d2147,null))[_0x4396('0x2b')](handleError(_0x3d2147,null));};exports[_0x4396('0x9e')]=function(_0x17e1dc,_0x2990f4,_0xceda26){var _0x42535b={};var _0x41602f={};var _0x7dfc5f;var _0x3a3191;return db[_0x4396('0x45')][_0x4396('0x66')]({'where':{'id':_0x17e1dc[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x2990f4,null))[_0x4396('0x21')](function(_0x2c6982){if(_0x2c6982){_0x7dfc5f=_0x2c6982;_0x41602f[_0x4396('0x4c')]=_[_0x4396('0x5f')](db[_0x4396('0x9a')]['rawAttributes']);_0x41602f[_0x4396('0x48')]=_[_0x4396('0x5f')](_0x17e1dc[_0x4396('0x48')]);_0x41602f[_0x4396('0x49')]=_[_0x4396('0x4b')](_0x41602f[_0x4396('0x4c')],_0x41602f[_0x4396('0x48')]);_0x42535b[_0x4396('0x4a')]=_['intersection'](_0x41602f[_0x4396('0x4c')],qs['fields'](_0x17e1dc['query'][_0x4396('0x4d')]));_0x42535b[_0x4396('0x4a')]=_0x42535b[_0x4396('0x4a')][_0x4396('0x4e')]?_0x42535b['attributes']:_0x41602f['model'];_0x42535b['order']=qs['sort'](_0x17e1dc[_0x4396('0x48')][_0x4396('0x52')]);_0x42535b[_0x4396('0x53')]=qs['filters'](_[_0x4396('0x6e')](_0x17e1dc[_0x4396('0x48')],_0x41602f['filters']));if(_0x17e1dc['query'][_0x4396('0x54')]){_0x42535b[_0x4396('0x53')]=_[_0x4396('0x55')](_0x42535b[_0x4396('0x53')],{'$or':_['map'](_0x42535b[_0x4396('0x4a')],function(_0x1a164d){var _0x2080b7={};_0x2080b7[_0x1a164d]={'$like':'%'+_0x17e1dc[_0x4396('0x48')][_0x4396('0x54')]+'%'};return _0x2080b7;})});}_0x42535b=_[_0x4396('0x55')]({},_0x42535b,_0x17e1dc['options']);return _0x7dfc5f['getApplications'](_0x42535b);}})['then'](function(_0x2f677d){if(_0x2f677d){_0x3a3191=_0x2f677d['length'];if(!_0x17e1dc['query']['hasOwnProperty'](_0x4396('0x50'))){_0x42535b[_0x4396('0x32')]=qs[_0x4396('0x32')](_0x17e1dc['query'][_0x4396('0x32')]);_0x42535b[_0x4396('0x31')]=qs[_0x4396('0x31')](_0x17e1dc['query']['offset']);}return _0x7dfc5f[_0x4396('0x9e')](_0x42535b);}})['then'](function(_0x350e3e){if(_0x350e3e){return _0x350e3e?{'count':_0x3a3191,'rows':_0x350e3e}:null;}})[_0x4396('0x21')](respondWithResult(_0x2990f4,null))['catch'](handleError(_0x2990f4,null));};exports[_0x4396('0x9f')]=function(_0x2be5c4,_0x1bf053,_0x281b26){var _0xe8b85d={'raw':!![],'where':{}};var _0x225160={};var _0x14b696={'count':0x0,'rows':[]};return db[_0x4396('0x45')][_0x4396('0x66')]({'where':{'id':_0x2be5c4[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x1bf053,null))['then'](function(_0x4bacfd){if(_0x4bacfd){_0x225160[_0x4396('0x4c')]=_[_0x4396('0x5f')](db[_0x4396('0xa0')][_0x4396('0x46')]);_0x225160['query']=_['keys'](_0x2be5c4['query']);_0x225160['filters']=_[_0x4396('0x4b')](_0x225160[_0x4396('0x4c')],_0x225160[_0x4396('0x48')]);_0xe8b85d[_0x4396('0x4a')]=_[_0x4396('0x4b')](_0x225160[_0x4396('0x4c')],qs[_0x4396('0x4d')](_0x2be5c4[_0x4396('0x48')][_0x4396('0x4d')]));_0xe8b85d['attributes']=_0xe8b85d[_0x4396('0x4a')]['length']?_0xe8b85d['attributes']:_0x225160[_0x4396('0x4c')];if(!_0x2be5c4[_0x4396('0x48')][_0x4396('0x4f')](_0x4396('0x50'))){_0xe8b85d[_0x4396('0x32')]=qs[_0x4396('0x32')](_0x2be5c4[_0x4396('0x48')]['limit']);_0xe8b85d[_0x4396('0x31')]=qs[_0x4396('0x31')](_0x2be5c4['query'][_0x4396('0x31')]);}_0xe8b85d[_0x4396('0x51')]=qs[_0x4396('0x52')](_0x2be5c4['query'][_0x4396('0x52')]);_0xe8b85d['where']=qs[_0x4396('0x49')](_[_0x4396('0x6e')](_0x2be5c4[_0x4396('0x48')],_0x225160[_0x4396('0x49')]));_0xe8b85d[_0x4396('0x53')][_0x4396('0x64')]=_0x4bacfd['id'];if(_0x2be5c4[_0x4396('0x48')][_0x4396('0x54')]){_0xe8b85d['where']=_['merge'](_0xe8b85d[_0x4396('0x53')],{'$or':_['map'](_0xe8b85d[_0x4396('0x4a')],function(_0x30c6a4){var _0x1ba3fd={};_0x1ba3fd[_0x30c6a4]={'$like':'%'+_0x2be5c4[_0x4396('0x48')][_0x4396('0x54')]+'%'};return _0x1ba3fd;})});}if(_0x2be5c4[_0x4396('0x48')][_0x4396('0xa1')]){var _0x181230=_0x2be5c4['query']['$gte'][_0x4396('0xa2')](',');var _0x5137a2={};_0x5137a2[_0x181230[0x0]]={'$gte':moment(_0x181230[0x1])[_0x4396('0xa3')](_0x4396('0xa4'))};_0xe8b85d['where']=_[_0x4396('0x55')](_0xe8b85d[_0x4396('0x53')],_0x5137a2);}_0xe8b85d=_[_0x4396('0x55')]({},_0xe8b85d,_0x2be5c4['options']);return db[_0x4396('0xa0')][_0x4396('0x30')]({'where':_0xe8b85d['where']})['then'](function(_0x291b42){_0x14b696[_0x4396('0x30')]=_0x291b42;if(_0x2be5c4[_0x4396('0x48')][_0x4396('0x58')]){_0xe8b85d[_0x4396('0x59')]=[{'all':!![]}];}return db[_0x4396('0xa0')]['findAll'](_0xe8b85d);})[_0x4396('0x21')](function(_0x41724e){_0x14b696['rows']=_0x41724e;return _0x14b696;});}})['then'](respondWithFilteredResult(_0x1bf053,_0xe8b85d))[_0x4396('0x2b')](handleError(_0x1bf053,null));};exports['send']=function(_0x103199,_0x4abc4a,_0x5a2413){var _0xf9cd12,_0x3c0ab7={},_0x223493;if(_0x103199[_0x4396('0x60')]['to']){_0x223493=_0x103199['body']['to'][_0x4396('0xa2')](',')[0x0];}return db[_0x4396('0x45')]['find']({'where':{'id':_0x103199[_0x4396('0x5d')]['id']},'include':[{'model':db[_0x4396('0xa5')],'as':_0x4396('0xa6'),'include':[{'model':db['CmContact'],'as':_0x4396('0xa7'),'where':{'email':_0x223493},'limit':0x1,'order':[[_0x4396('0xa8'),'DESC']]}]},{'model':db[_0x4396('0x41')],'as':_0x4396('0x42'),'raw':!![]}]})['then'](handleEntityNotFound(_0x4abc4a,null))[_0x4396('0x21')](function(_0xd7d5b5){if(_0xd7d5b5){_0xf9cd12=_0xd7d5b5;if(_0xd7d5b5[_0x4396('0x42')]){if(_[_0x4396('0x71')](_0x103199[_0x4396('0x60')][_0x4396('0xa9')])){_0x103199[_0x4396('0x60')]['from']=util[_0x4396('0xa3')]('%s\x20<%s>',_0xd7d5b5[_0x4396('0x3d')],_0xd7d5b5[_0x4396('0xaa')]||_0xd7d5b5[_0x4396('0x42')][_0x4396('0x74')]);}if(_0x103199[_0x4396('0x60')][_0x4396('0xab')]&&_0x103199[_0x4396('0x60')][_0x4396('0xab')][_0x4396('0x4e')]){for(var _0x26ab5a=0x0;_0x26ab5a<_0x103199[_0x4396('0x60')][_0x4396('0xab')][_0x4396('0x4e')];_0x26ab5a+=0x1){_0x103199['body'][_0x4396('0xab')][_0x26ab5a]={'filename':_0x103199[_0x4396('0x60')]['attachments'][_0x26ab5a][_0x4396('0x3d')],'path':path[_0x4396('0xac')](config[_0x4396('0xad')],_0x4396('0xae'),_0x103199[_0x4396('0x60')][_0x4396('0xab')][_0x26ab5a]['basename'])};}}var _0x2defde={'tls':{'rejectUnauthorized':![]}};if(_[_0x4396('0x71')](_0xd7d5b5[_0x4396('0x42')][_0x4396('0x7c')])){if(_0xd7d5b5['Smtp']['authentication']){_0x2defde['auth']={'user':_0xd7d5b5[_0x4396('0x42')][_0x4396('0x74')],'pass':_0xd7d5b5[_0x4396('0x42')]['pass']};}_0x2defde[_0x4396('0x7a')]=_0xd7d5b5[_0x4396('0x42')][_0x4396('0x7a')];_0x2defde[_0x4396('0x7b')]=_0xd7d5b5[_0x4396('0x42')]['port'];_0x2defde[_0x4396('0xaf')]=_0xd7d5b5[_0x4396('0x42')][_0x4396('0xaf')];}else{_0x2defde[_0x4396('0x7c')]=_0xd7d5b5[_0x4396('0x42')][_0x4396('0x7c')];_0x2defde[_0x4396('0xb0')]={'user':_0xd7d5b5[_0x4396('0x42')][_0x4396('0x74')],'pass':_0xd7d5b5['Smtp'][_0x4396('0x77')]};}return respondWithRpcPromise(_0x4396('0xb1'),_0x4396('0xb2'),{'account':_0x2defde,'message':_0x103199[_0x4396('0x60')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x24804e){if(_0x24804e){_0x3c0ab7=_0x24804e;if(_0xf9cd12[_0x4396('0xa6')]){if(_0xf9cd12[_0x4396('0xa6')][_0x4396('0xa7')][_0x4396('0x4e')]){return _0xf9cd12[_0x4396('0xa6')]['Contacts'][0x0];}else{return db[_0x4396('0x90')][_0x4396('0x6c')](_[_0x4396('0xb3')](_0x103199[_0x4396('0x60')],{'firstName':_0x103199['body']['to'],'email':_0x103199[_0x4396('0x60')]['to'],'phone':_0x103199[_0x4396('0x60')]['to'],'ListId':_0xf9cd12[_0x4396('0x70')]}));}}else{throw new Error(_0x4396('0xb4'));}}})[_0x4396('0x21')](function(_0x3435e2){if(_0x3435e2){var _0x18d991={'UserId':_0x103199[_0x4396('0x74')]['id'],'ContactId':_0x3435e2['id'],'MailAccountId':_0xf9cd12['id'],'inReplyTo':_0x3c0ab7[_0x4396('0xb5')],'to':_0x103199[_0x4396('0x60')]['from'],'cc':_0x103199[_0x4396('0x60')]['cc'],'subject':_0x103199[_0x4396('0x60')][_0x4396('0xb6')],'attach':_0x103199[_0x4396('0x60')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','lastMsgBody':_0x103199[_0x4396('0x60')][_0x4396('0x60')],'Messages':[_['merge'](_0x103199[_0x4396('0x60')],{'messageId':_0x3c0ab7[_0x4396('0xb5')],'sentAt':moment()[_0x4396('0xa3')](_0x4396('0xa4')),'read':!![],'MailAccountId':_0xf9cd12['id'],'UserId':_0x103199[_0x4396('0x74')]['id'],'ContactId':_0x3435e2['id']})]};if(_0x103199[_0x4396('0x60')][_0x4396('0xb7')]){_0x18d991=_[_0x4396('0x55')](_0x18d991,_0x103199[_0x4396('0x60')][_0x4396('0xb7')]);}return db[_0x4396('0x8f')][_0x4396('0x6c')](_0x18d991,{'include':[{'model':db[_0x4396('0xa0')],'as':_0x4396('0xb8')}]});}})[_0x4396('0x21')](respondWithResult(_0x4abc4a,null))[_0x4396('0x2b')](handleError(_0x4abc4a,null));};exports[_0x4396('0xb9')]=function(_0x1672c1,_0x27b75e,_0x327ab1){return db['MailAccount'][_0x4396('0x61')]({'where':{'id':_0x1672c1[_0x4396('0x5d')]['id']},'include':[{'model':db[_0x4396('0x41')],'as':_0x4396('0x42'),'raw':!![]}]})[_0x4396('0x21')](handleEntityNotFound(_0x27b75e,null))[_0x4396('0x21')](function(_0x26870b){if(_0x26870b&&_0x26870b[_0x4396('0x42')]){var _0x41997e={'id':_0x26870b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x26870b[_0x4396('0x42')][_0x4396('0x7c')]){_0x41997e[_0x4396('0x7c')]=_0x26870b[_0x4396('0x42')][_0x4396('0x7c')];}else{_0x41997e['host']=_0x26870b[_0x4396('0x42')][_0x4396('0x7a')];_0x41997e['port']=_0x26870b[_0x4396('0x42')][_0x4396('0x7b')];_0x41997e[_0x4396('0xaf')]=_0x26870b['Smtp'][_0x4396('0xaf')];}if(_0x26870b[_0x4396('0x42')][_0x4396('0x79')]){_0x41997e[_0x4396('0xb0')]={'user':_0x26870b[_0x4396('0x42')]['user'],'pass':_0x26870b[_0x4396('0x42')][_0x4396('0x77')]};}return respondWithRpcPromise(_0x4396('0xba'),_0x4396('0xb9'),{'account':_0x41997e});}})[_0x4396('0x21')](respondWithResult(_0x27b75e,null))['catch'](handleError(_0x27b75e,null));};exports[_0x4396('0x39')]=function(_0x530a35,_0x20ad88){return db['MailAccount']['find']({'where':{'id':_0x530a35[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x20ad88,null))['then'](function(_0xfcb352){if(_0xfcb352&&_0xfcb352['service']){throw new db[(_0x4396('0x1d'))][(_0x4396('0x1e'))](_0x4396('0xbb'));}return _0xfcb352;})[_0x4396('0x21')](removeEntity(_0x20ad88,null))[_0x4396('0x2b')](handleError(_0x20ad88,null));};exports[_0x4396('0xbc')]=function(_0x5816fd,_0x93edd0,_0xe752df){return db[_0x4396('0x45')][_0x4396('0x61')]({'where':{'id':_0x5816fd['params']['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x93edd0,null))[_0x4396('0x21')](function(_0x15d525){if(_0x15d525){return _0x15d525[_0x4396('0xbc')](_0x5816fd[_0x4396('0x60')][_0x4396('0x69')],_['omit'](_0x5816fd[_0x4396('0x60')],[_0x4396('0x69'),'id'])||{})['spread'](function(_0x1567db){for(var _0x586827=0x0;_0x586827<_0x5816fd['body'][_0x4396('0x69')][_0x4396('0x4e')];_0x586827+=0x1){socket[_0x4396('0xbd')](_0x4396('0xbe'),{'UserId':_0x5816fd['body']['ids'][_0x586827],'MailAccountId':_0x5816fd[_0x4396('0x5d')]['id']});}return _0x1567db;});}})[_0x4396('0x21')](respondWithResult(_0x93edd0,null))[_0x4396('0x2b')](handleError(_0x93edd0,null));};exports[_0x4396('0xbf')]=function(_0x3476b9,_0x5a0e56,_0x1958f7){return db[_0x4396('0x45')][_0x4396('0x61')]({'where':{'id':_0x3476b9[_0x4396('0x5d')]['id']}})[_0x4396('0x21')](handleEntityNotFound(_0x5a0e56,null))[_0x4396('0x21')](function(_0x1c3d75){if(_0x1c3d75){return _0x1c3d75['removeAgents'](_0x3476b9['query'][_0x4396('0x69')])[_0x4396('0x21')](function(){if(_[_0x4396('0xc0')](_0x3476b9[_0x4396('0x48')][_0x4396('0x69')])){for(var _0x34b14c=0x0;_0x34b14c<_0x3476b9['query'][_0x4396('0x69')][_0x4396('0x4e')];_0x34b14c+=0x1){socket[_0x4396('0xbd')](_0x4396('0xc1'),{'UserId':Number(_0x3476b9[_0x4396('0x48')][_0x4396('0x69')][_0x34b14c]),'MailAccountId':Number(_0x3476b9['params']['id'])});}}else{socket['emit'](_0x4396('0xc1'),{'UserId':Number(_0x3476b9[_0x4396('0x48')][_0x4396('0x69')]),'MailAccountId':Number(_0x3476b9[_0x4396('0x5d')]['id'])});}});}})[_0x4396('0x21')](respondWithStatusCode(_0x5a0e56,null))[_0x4396('0x2b')](handleError(_0x5a0e56,null));};exports[_0x4396('0xc2')]=function(_0x412f1b,_0x559cdd,_0x4f9154){var _0x1c65a9={};var _0x84b07d={};var _0x4fda57;var _0x48e37a;return db[_0x4396('0x45')]['findOne']({'where':{'id':_0x412f1b['params']['id']}})['then'](handleEntityNotFound(_0x559cdd,null))[_0x4396('0x21')](function(_0x160b51){if(_0x160b51){_0x4fda57=_0x160b51;_0x84b07d[_0x4396('0x4c')]=_[_0x4396('0x5f')](db[_0x4396('0x92')][_0x4396('0x46')]);_0x84b07d['query']=_[_0x4396('0x5f')](_0x412f1b['query']);_0x84b07d[_0x4396('0x49')]=_['intersection'](_0x84b07d[_0x4396('0x4c')],_0x84b07d[_0x4396('0x48')]);_0x1c65a9[_0x4396('0x4a')]=_[_0x4396('0x4b')](_0x84b07d[_0x4396('0x4c')],qs['fields'](_0x412f1b[_0x4396('0x48')][_0x4396('0x4d')]));_0x1c65a9['attributes']=_0x1c65a9[_0x4396('0x4a')]['length']?_0x1c65a9['attributes']:_0x84b07d[_0x4396('0x4c')];_0x1c65a9['order']=qs[_0x4396('0x52')](_0x412f1b[_0x4396('0x48')][_0x4396('0x52')]);_0x1c65a9[_0x4396('0x53')]=qs[_0x4396('0x49')](_[_0x4396('0x6e')](_0x412f1b[_0x4396('0x48')],_0x84b07d[_0x4396('0x49')]));if(_0x412f1b[_0x4396('0x48')]['filter']){_0x1c65a9[_0x4396('0x53')]=_[_0x4396('0x55')](_0x1c65a9[_0x4396('0x53')],{'$or':_[_0x4396('0x44')](_0x1c65a9['attributes'],function(_0x1e4a8c){var _0x17ebb9={};_0x17ebb9[_0x1e4a8c]={'$like':'%'+_0x412f1b[_0x4396('0x48')][_0x4396('0x54')]+'%'};return _0x17ebb9;})});}_0x1c65a9=_['merge']({},_0x1c65a9,_0x412f1b[_0x4396('0x57')]);return _0x4fda57['getAgents'](_0x1c65a9);}})[_0x4396('0x21')](function(_0x42704d){if(_0x42704d){_0x48e37a=_0x42704d['length'];if(!_0x412f1b[_0x4396('0x48')]['hasOwnProperty'](_0x4396('0x50'))){_0x1c65a9[_0x4396('0x32')]=qs[_0x4396('0x32')](_0x412f1b[_0x4396('0x48')][_0x4396('0x32')]);_0x1c65a9[_0x4396('0x31')]=qs['offset'](_0x412f1b[_0x4396('0x48')][_0x4396('0x31')]);}return _0x4fda57[_0x4396('0xc2')](_0x1c65a9);}})[_0x4396('0x21')](function(_0x47c445){if(_0x47c445){return _0x47c445?{'count':_0x48e37a,'rows':_0x47c445}:null;}})[_0x4396('0x21')](respondWithResult(_0x559cdd,null))[_0x4396('0x2b')](handleError(_0x559cdd,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 9d8f9fa..3a3087b 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 _0xc15a=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0xc15a,0x12e));var _0xac15=function(_0x21f957,_0x1aaaa9){_0x21f957=_0x21f957-0x0;var _0x32ba15=_0xc15a[_0x21f957];return _0x32ba15;};'use strict';var EventEmitter=require(_0xac15('0x0'));var MailAccount=require(_0xac15('0x1'))['db'][_0xac15('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xac15('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xac15('0x4'),'afterDestroy':_0xac15('0x5')};function emitEvent(_0x14eadb){return function(_0x542b4d,_0x2d5876,_0xb056f4){MailAccountEvents[_0xac15('0x6')](_0x14eadb+':'+_0x542b4d['id'],_0x542b4d);MailAccountEvents['emit'](_0x14eadb,_0x542b4d);_0xb056f4(null);};}for(var e in events){if(events[_0xac15('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xac15('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xaded=['hook','exports','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x3dd50a,_0x2db0cb){var _0x5f06f4=function(_0x4ad834){while(--_0x4ad834){_0x3dd50a['push'](_0x3dd50a['shift']());}};_0x5f06f4(++_0x2db0cb);}(_0xaded,0x175));var _0xdade=function(_0x321b5b,_0x2aea93){_0x321b5b=_0x321b5b-0x0;var _0x559fc7=_0xaded[_0x321b5b];return _0x559fc7;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xdade('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xdade('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdade('0x2'),'afterDestroy':'remove'};function emitEvent(_0x40de5c){return function(_0x92a11c,_0x2239a7,_0x4b67ce){MailAccountEvents[_0xdade('0x3')](_0x40de5c+':'+_0x92a11c['id'],_0x92a11c);MailAccountEvents[_0xdade('0x3')](_0x40de5c,_0x92a11c);_0x4b67ce(null);};}for(var e in events){if(events[_0xdade('0x4')](e)){var event=events[e];MailAccount[_0xdade('0x5')](e,emitEvent(event));}}module[_0xdade('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 93e6715..1ebbdaf 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 _0x336d=['path','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x336d,0xae));var _0xd336=function(_0x41ca94,_0xbb2714){_0x41ca94=_0x41ca94-0x0;var _0x30fee0=_0x336d[_0x41ca94];return _0x30fee0;};'use strict';var _=require('lodash');var util=require(_0xd336('0x0'));var logger=require(_0xd336('0x1'))(_0xd336('0x2'));var moment=require(_0xd336('0x3'));var BPromise=require(_0xd336('0x4'));var rp=require(_0xd336('0x5'));var fs=require('fs');var path=require(_0xd336('0x6'));var rimraf=require(_0xd336('0x7'));var config=require(_0xd336('0x8'));var attributes=require(_0xd336('0x9'));module['exports']=function(_0x5e202d,_0x176983){return _0x5e202d[_0xd336('0xa')](_0xd336('0xb'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc4c=['MailAccount','mail_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./mailAccount.attributes'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0xfc4c,0xca));var _0xcfc4=function(_0x424e7b,_0x59dbea){_0x424e7b=_0x424e7b-0x0;var _0x5395bc=_0xfc4c[_0x424e7b];return _0x5395bc;};'use strict';var _=require(_0xcfc4('0x0'));var util=require(_0xcfc4('0x1'));var logger=require(_0xcfc4('0x2'))('api');var moment=require(_0xcfc4('0x3'));var BPromise=require(_0xcfc4('0x4'));var rp=require(_0xcfc4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcfc4('0x6'));var attributes=require(_0xcfc4('0x7'));module['exports']=function(_0x4a4db3,_0x30b6d4){return _0x4a4db3['define'](_0xcfc4('0x8'),attributes,{'tableName':_0xcfc4('0x9'),'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 82e4951..2ac49bd 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 _0x0565=['priority','asc','autoclose','push','length','close','*,*,*,*','defaults','create','List\x20not\x20found','contact','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','find','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','format','interaction','get','attachments','originTo','originCc','bcc','Attachments','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','GetMailAccount','MailAccount','options','where','attributes','limit','include','model','map','stringify','ShowMailAccount','debug','NotifyMailAccount','body','mail','difference','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','account','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','omit','applications','Applications','orderBy'];(function(_0x31c29b,_0xce8e0d){var _0x2c12ce=function(_0x2661b2){while(--_0x2661b2){_0x31c29b['push'](_0x31c29b['shift']());}};_0x2c12ce(++_0xce8e0d);}(_0x0565,0xf2));var _0x5056=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x0565[_0x307d86];return _0x361745;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232c});config[_0x5056('0xd')]=_['defaults'](config['redis'],{'host':_0x5056('0xe'),'port':0x18eb});var socket=require(_0x5056('0xf'))(new Redis(config[_0x5056('0xd')]));require(_0x5056('0x10'))[_0x5056('0x11')](socket);function respondWithRpcPromise(_0x68efb2,_0x1fa531,_0x332cd7){return new BPromise(function(_0x5d2e60,_0x78f7e4){return client[_0x5056('0x12')](_0x68efb2,_0x332cd7)[_0x5056('0x13')](function(_0x5ab4b2){logger['info'](_0x5056('0x14'),_0x1fa531,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x1fa531,_0x5056('0x15'),JSON['stringify'](_0x5ab4b2));if(_0x5ab4b2[_0x5056('0x16')]){if(_0x5ab4b2[_0x5056('0x16')][_0x5056('0x17')]===0x1f4){logger['error'](_0x5056('0x14'),_0x1fa531,_0x5ab4b2[_0x5056('0x16')][_0x5056('0x18')]);return _0x78f7e4(_0x5ab4b2[_0x5056('0x16')][_0x5056('0x18')]);}logger[_0x5056('0x16')]('MailAccount,\x20%s,\x20%s',_0x1fa531,_0x5ab4b2[_0x5056('0x16')]['message']);return _0x5d2e60(_0x5ab4b2[_0x5056('0x16')][_0x5056('0x18')]);}else{logger[_0x5056('0x19')](_0x5056('0x14'),_0x1fa531,_0x5056('0x15'));_0x5d2e60(_0x5ab4b2['result'][_0x5056('0x18')]);}})[_0x5056('0x1a')](function(_0x4f8fa7){logger['error'](_0x5056('0x14'),_0x1fa531,_0x4f8fa7);_0x78f7e4(_0x4f8fa7);});});}exports[_0x5056('0x1b')]=function(_0x14d60e){var _0x250276=this;return new Promise(function(_0x210c6f,_0xf04e08){return db[_0x5056('0x1c')]['findAll']({'raw':_0x14d60e[_0x5056('0x1d')]?_0x14d60e[_0x5056('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x14d60e[_0x5056('0x1d')]?_0x14d60e[_0x5056('0x1d')][_0x5056('0x1e')]||null:null,'attributes':_0x14d60e['options']?_0x14d60e[_0x5056('0x1d')][_0x5056('0x1f')]||null:null,'limit':_0x14d60e['options']?_0x14d60e['options'][_0x5056('0x20')]||null:null,'include':_0x14d60e[_0x5056('0x1d')]?_0x14d60e[_0x5056('0x1d')][_0x5056('0x21')]?_['map'](_0x14d60e[_0x5056('0x1d')][_0x5056('0x21')],function(_0x5d1656){return{'model':db[_0x5d1656[_0x5056('0x22')]],'as':_0x5d1656['as'],'attributes':_0x5d1656['attributes'],'include':_0x5d1656[_0x5056('0x21')]?_[_0x5056('0x23')](_0x5d1656[_0x5056('0x21')],function(_0x2b8fab){return{'model':db[_0x2b8fab[_0x5056('0x22')]],'as':_0x2b8fab['as'],'attributes':_0x2b8fab['attributes'],'include':_0x2b8fab[_0x5056('0x21')]?_[_0x5056('0x23')](_0x2b8fab[_0x5056('0x21')],function(_0x2ac79a){return{'model':db[_0x2ac79a['model']],'as':_0x2ac79a['as'],'attributes':_0x2ac79a[_0x5056('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x70246c){logger['info']('GetMailAccount',_0x14d60e);logger['debug'](_0x5056('0x1b'),_0x14d60e,JSON[_0x5056('0x24')](_0x70246c));_0x210c6f(_0x70246c);})['catch'](function(_0x27f4be){logger[_0x5056('0x16')](_0x5056('0x1b'),_0x27f4be[_0x5056('0x18')],_0x14d60e);_0xf04e08(_0x250276[_0x5056('0x16')](0x1f4,_0x27f4be[_0x5056('0x18')]));});});};exports[_0x5056('0x25')]=function(_0x3f292e){var _0xd1aa24=this;return new Promise(function(_0x2f66d3,_0x138867){return db['MailAccount']['find']({'raw':_0x3f292e[_0x5056('0x1d')]?_0x3f292e[_0x5056('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3f292e[_0x5056('0x1d')]?_0x3f292e[_0x5056('0x1d')]['where']||null:null,'attributes':_0x3f292e[_0x5056('0x1d')]?_0x3f292e[_0x5056('0x1d')][_0x5056('0x1f')]||null:null,'include':_0x3f292e[_0x5056('0x1d')]?_0x3f292e[_0x5056('0x1d')][_0x5056('0x21')]?_[_0x5056('0x23')](_0x3f292e[_0x5056('0x1d')][_0x5056('0x21')],function(_0x2fee6e){return{'model':db[_0x2fee6e[_0x5056('0x22')]],'as':_0x2fee6e['as'],'attributes':_0x2fee6e[_0x5056('0x1f')],'include':_0x2fee6e[_0x5056('0x21')]?_[_0x5056('0x23')](_0x2fee6e[_0x5056('0x21')],function(_0x55a400){return{'model':db[_0x55a400[_0x5056('0x22')]],'as':_0x55a400['as'],'attributes':_0x55a400['attributes'],'include':_0x55a400[_0x5056('0x21')]?_[_0x5056('0x23')](_0x55a400[_0x5056('0x21')],function(_0x286d64){return{'model':db[_0x286d64['model']],'as':_0x286d64['as'],'attributes':_0x286d64[_0x5056('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5056('0x13')](function(_0x50d494){logger[_0x5056('0x19')]('ShowMailAccount',_0x3f292e);logger[_0x5056('0x26')](_0x5056('0x25'),_0x3f292e,JSON[_0x5056('0x24')](_0x50d494));_0x2f66d3(_0x50d494);})['catch'](function(_0x185489){logger[_0x5056('0x16')](_0x5056('0x25'),_0x185489[_0x5056('0x18')],_0x3f292e);_0x138867(_0xd1aa24[_0x5056('0x16')](0x1f4,_0x185489[_0x5056('0x18')]));});});};exports[_0x5056('0x27')]=function(_0x21aa75){var _0x15553e=this;return new Promise(function(_0x430db0,_0x1db20e){var _0x252a19={'body':_0x21aa75[_0x5056('0x28')],'channel':_0x5056('0x29')};var _0x238e77=_[_0x5056('0x2a')](_['keys'](db['CmContact'][_0x5056('0x2b')]),[_0x5056('0x2c'),_0x5056('0x2d'),_0x5056('0x2e'),_0x5056('0x2f')]);var _0x1e2693=![];if(_0x21aa75[_0x5056('0x28')]['id']){delete _0x21aa75[_0x5056('0x28')]['id'];}if(_['isNil'](_0x21aa75['body'][_0x5056('0x30')])){return _0x1db20e(_0x15553e[_0x5056('0x16')](0x1f4,_0x5056('0x31')));}if(_['isNil'](_0x21aa75[_0x5056('0x28')]['body'])||_0x21aa75[_0x5056('0x28')][_0x5056('0x28')]===''){return _0x1db20e(_0x15553e[_0x5056('0x16')](0x1f4,_0x5056('0x32')));}if(_[_0x5056('0x33')](_0x21aa75[_0x5056('0x28')]['mapKey'])){return _0x1db20e(_0x15553e[_0x5056('0x16')](0x1f4,_0x5056('0x34')+_0x238e77));}if(!_[_0x5056('0x35')](_0x238e77,_0x21aa75['body']['mapKey'])){return _0x1db20e(_0x15553e['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x238e77));}var _0x4553eb={};_0x4553eb[_0x21aa75[_0x5056('0x28')][_0x5056('0x36')]]=_0x21aa75[_0x5056('0x28')][_0x5056('0x30')];return db['MailAccount']['find']({'where':{'id':_0x21aa75[_0x5056('0x37')]['id']},'include':[{'model':db[_0x5056('0x38')],'as':_0x5056('0x39'),'include':[{'model':db[_0x5056('0x3a')],'as':_0x5056('0x3b'),'where':_0x4553eb,'limit':0x1,'order':[[_0x5056('0x2d'),_0x5056('0x3c')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x5056('0x3d')],'as':_0x5056('0x3e')}]})['then'](function(_0x21ee40){if(_0x21ee40&&_0x21ee40[_0x5056('0x39')]){var _0x4c2384=_0x21ee40['get']({'plain':!![]});_0x252a19[_0x5056('0x37')]=_[_0x5056('0x3f')](_0x4c2384,['Applications','List']);_0x252a19[_0x5056('0x40')]=_0x4c2384[_0x5056('0x41')];_0x252a19['list']=_0x4c2384['List'];_0x252a19[_0x5056('0x40')]=_[_0x5056('0x42')](_0x252a19[_0x5056('0x40')],[_0x5056('0x43')],[_0x5056('0x44')]);if(_0x252a19[_0x5056('0x37')]&&_0x252a19[_0x5056('0x37')][_0x5056('0x45')]){_0x252a19[_0x5056('0x40')][_0x5056('0x46')]({'id':0x0,'priority':_0x252a19[_0x5056('0x40')][_0x5056('0x47')]+0x1,'app':_0x5056('0x48'),'appdata':_0x5056('0x45'),'interval':_0x5056('0x49')});}if(_0x252a19['account']['Applications']){delete _0x252a19[_0x5056('0x37')][_0x5056('0x41')];}if(_0x252a19[_0x5056('0x37')][_0x5056('0x39')]){delete _0x252a19[_0x5056('0x37')][_0x5056('0x39')];}if(_0x4c2384['List'][_0x5056('0x3b')][_0x5056('0x47')]){return _0x4c2384[_0x5056('0x39')][_0x5056('0x3b')][0x0];}var _0x1ff74a=_[_0x5056('0x4a')](_0x21aa75[_0x5056('0x28')],{'firstName':_0x21aa75[_0x5056('0x28')][_0x5056('0x30')],'ListId':_0x4c2384[_0x5056('0x2f')]});_0x1ff74a[_0x21aa75[_0x5056('0x28')][_0x5056('0x36')]]=_0x21aa75[_0x5056('0x28')]['from'];return db[_0x5056('0x3a')][_0x5056('0x4b')](_0x1ff74a);}else{throw new Error(_0x5056('0x4c'));}})['then'](function(_0x1d4fe2){_0x252a19[_0x5056('0x4d')]=_0x1d4fe2;if(_0x1d4fe2){if(!_0x21aa75[_0x5056('0x28')][_0x5056('0x18')]['messageId']){_0x21aa75['body']['message'][_0x5056('0x4e')]=rs['generate']()+'\x20'+_0x21aa75[_0x5056('0x28')][_0x5056('0x18')][_0x5056('0x30')];}var _0x352cd8={'ContactId':_0x1d4fe2['id'],'MailAccountId':_0x21aa75[_0x5056('0x37')]['id'],'inReplyTo':_0x21aa75[_0x5056('0x28')]['message']['messageId'],'to':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')]['from'],'cc':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')]['cc'],'subject':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')][_0x5056('0x4f')],'attach':_0x21aa75['body'][_0x5056('0x18')][_0x5056('0x50')],'lastMsgAt':moment()['format'](_0x5056('0x51')),'lastMsgDirection':'in','lastMsgBody':_0x21aa75[_0x5056('0x28')][_0x5056('0x28')]};return db[_0x5056('0x52')][_0x5056('0x53')]({'where':{'closed':![],'MailAccountId':_0x21aa75[_0x5056('0x37')]['id']},'include':[{'model':db[_0x5056('0x54')],'as':_0x5056('0x55'),'attributes':[_0x5056('0x4e')],'where':{'messageId':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')][_0x5056('0x56')]}}]})[_0x5056('0x13')](function(_0x4a0587){if(_0x4a0587){return[_0x4a0587,![]];}return db[_0x5056('0x52')][_0x5056('0x4b')](_0x352cd8)[_0x5056('0x13')](function(_0x47203d){return[_0x47203d,!![]];});});}else{throw new Error(_0x5056('0x57'));}})[_0x5056('0x58')](function(_0x5635a4,_0x1159fd){if(_0x5635a4){_0x1e2693=_0x1159fd;if(!_0x1159fd){return _0x5635a4['update']({'inReplyTo':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')]['messageId'],'to':_0x21aa75['body'][_0x5056('0x18')][_0x5056('0x30')],'cc':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')]['cc'],'subject':_0x21aa75['body']['message'][_0x5056('0x4f')],'attach':_0x5635a4[_0x5056('0x50')]?_0x5635a4[_0x5056('0x50')]:_0x21aa75['body'][_0x5056('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0x5056('0x59')](_0x5056('0x51')),'lastMsgAt':moment()[_0x5056('0x59')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x21aa75[_0x5056('0x28')][_0x5056('0x28')]});}else{return _0x5635a4;}}})[_0x5056('0x13')](function(_0x20ccc6){_0x252a19[_0x5056('0x5a')]=_0x20ccc6[_0x5056('0x5b')]({'plain':!![]});_0x252a19[_0x5056('0x5a')]['created']=_0x1e2693;return db[_0x5056('0x54')][_0x5056('0x4b')]({'body':_0x21aa75[_0x5056('0x28')]['body'],'MailAccountId':_0x21aa75[_0x5056('0x37')]['id'],'MailInteractionId':_0x20ccc6['id'],'direction':'in','ContactId':_0x252a19['contact']['id'],'messageId':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')][_0x5056('0x4e')],'from':_0x21aa75[_0x5056('0x28')]['message'][_0x5056('0x30')],'to':_0x21aa75[_0x5056('0x28')]['message']['to'],'cc':_0x21aa75[_0x5056('0x28')]['message']['cc'],'subject':_0x21aa75['body'][_0x5056('0x18')][_0x5056('0x4f')],'attach':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')][_0x5056('0x50')],'Attachments':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')][_0x5056('0x5c')],'originTo':_0x21aa75[_0x5056('0x28')][_0x5056('0x18')][_0x5056('0x5d')],'originCc':_0x21aa75[_0x5056('0x28')]['message'][_0x5056('0x5e')],'bcc':_0x21aa75['body'][_0x5056('0x18')][_0x5056('0x5f')]},{'include':[{'model':db['Attachment'],'as':_0x5056('0x60')}]});})[_0x5056('0x13')](function(_0x122fe0){_0x252a19[_0x5056('0x18')]=_0x122fe0;if(_0x252a19[_0x5056('0x5a')][_0x5056('0x61')]){return db[_0x5056('0x62')][_0x5056('0x53')]({'attributes':['id','name'],'where':{'id':_0x252a19[_0x5056('0x5a')][_0x5056('0x61')]}})[_0x5056('0x13')](function(_0x23cf3d){if(_0x23cf3d){_0x252a19[_0x5056('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5056('0x63'),'appdata':_0x23cf3d['name']+','+(_0x252a19[_0x5056('0x37')][_0x5056('0x64')]||0xa),'interval':_0x5056('0x49')});}return respondWithRpcPromise(_0x5056('0x65'),_0x5056('0x66'),_0x252a19);});}return respondWithRpcPromise(_0x5056('0x65'),_0x5056('0x66'),_0x252a19);})['then'](function(_0x3df04b){_0x430db0(_0x3df04b);})[_0x5056('0x1a')](function(_0x2d5b59){_0x1db20e(_0x15553e[_0x5056('0x16')](0x1f4,_0x2d5b59[_0x5056('0x18')]));});});}; \ No newline at end of file +var _0x7070=['include','map','model','then','catch','ShowMailAccount','find','where','NotifyMailAccount','body','mail','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','List','get','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','bcc','Attachments','UserId','name','agent','waitForTheAssignedAgent','Start','startRouting','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','socket.io-emitter','redis','./mailAccount.socket','register','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetMailAccount','MailAccount','raw','options','attributes','limit'];(function(_0x587ba6,_0x50a5a0){var _0x28e03f=function(_0x477f4b){while(--_0x477f4b){_0x587ba6['push'](_0x587ba6['shift']());}};_0x28e03f(++_0x50a5a0);}(_0x7070,0x1d7));var _0x0707=function(_0x254840,_0xabeed6){_0x254840=_0x254840-0x0;var _0x425b43=_0x7070[_0x254840];return _0x425b43;};'use strict';var _=require('lodash');var util=require(_0x0707('0x0'));var moment=require('moment');var BPromise=require(_0x0707('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0707('0x2'))['db'];var utils=require(_0x0707('0x3'));var logger=require(_0x0707('0x4'))(_0x0707('0x5'));var config=require('../../config/environment');var jayson=require(_0x0707('0x6'));var client=jayson[_0x0707('0x7')]['http']({'port':0x232c});config['redis']=_[_0x0707('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0707('0x9'))(new Redis(config[_0x0707('0xa')]));require(_0x0707('0xb'))[_0x0707('0xc')](socket);function respondWithRpcPromise(_0x8aa149,_0x36c69d,_0x31e735){return new BPromise(function(_0x3ad4f7,_0x403877){return client[_0x0707('0xd')](_0x8aa149,_0x31e735)['then'](function(_0x124c41){logger['info'](_0x0707('0xe'),_0x36c69d,'request\x20sent');logger[_0x0707('0xf')](_0x0707('0x10'),_0x36c69d,_0x0707('0x11'),JSON[_0x0707('0x12')](_0x124c41));if(_0x124c41[_0x0707('0x13')]){if(_0x124c41[_0x0707('0x13')][_0x0707('0x14')]===0x1f4){logger[_0x0707('0x13')](_0x0707('0xe'),_0x36c69d,_0x124c41[_0x0707('0x13')]['message']);return _0x403877(_0x124c41['error'][_0x0707('0x15')]);}logger[_0x0707('0x13')](_0x0707('0xe'),_0x36c69d,_0x124c41[_0x0707('0x13')]['message']);return _0x3ad4f7(_0x124c41[_0x0707('0x13')][_0x0707('0x15')]);}else{logger[_0x0707('0x16')]('MailAccount,\x20%s,\x20%s',_0x36c69d,_0x0707('0x11'));_0x3ad4f7(_0x124c41['result'][_0x0707('0x15')]);}})['catch'](function(_0x244b97){logger[_0x0707('0x13')](_0x0707('0xe'),_0x36c69d,_0x244b97);_0x403877(_0x244b97);});});}exports[_0x0707('0x17')]=function(_0x2a3ece){var _0x5ab0f8=this;return new Promise(function(_0x44a6a5,_0x360caf){return db[_0x0707('0x18')]['findAll']({'raw':_0x2a3ece['options']?_0x2a3ece['options'][_0x0707('0x19')]===undefined?!![]:![]:!![],'where':_0x2a3ece[_0x0707('0x1a')]?_0x2a3ece[_0x0707('0x1a')]['where']||null:null,'attributes':_0x2a3ece['options']?_0x2a3ece[_0x0707('0x1a')][_0x0707('0x1b')]||null:null,'limit':_0x2a3ece[_0x0707('0x1a')]?_0x2a3ece[_0x0707('0x1a')][_0x0707('0x1c')]||null:null,'include':_0x2a3ece[_0x0707('0x1a')]?_0x2a3ece[_0x0707('0x1a')][_0x0707('0x1d')]?_[_0x0707('0x1e')](_0x2a3ece[_0x0707('0x1a')][_0x0707('0x1d')],function(_0x373bca){return{'model':db[_0x373bca['model']],'as':_0x373bca['as'],'attributes':_0x373bca[_0x0707('0x1b')],'include':_0x373bca[_0x0707('0x1d')]?_[_0x0707('0x1e')](_0x373bca[_0x0707('0x1d')],function(_0x4d4666){return{'model':db[_0x4d4666[_0x0707('0x1f')]],'as':_0x4d4666['as'],'attributes':_0x4d4666[_0x0707('0x1b')],'include':_0x4d4666[_0x0707('0x1d')]?_[_0x0707('0x1e')](_0x4d4666[_0x0707('0x1d')],function(_0x599090){return{'model':db[_0x599090[_0x0707('0x1f')]],'as':_0x599090['as'],'attributes':_0x599090[_0x0707('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0707('0x20')](function(_0x2d7c68){logger['info'](_0x0707('0x17'),_0x2a3ece);logger[_0x0707('0xf')](_0x0707('0x17'),_0x2a3ece,JSON[_0x0707('0x12')](_0x2d7c68));_0x44a6a5(_0x2d7c68);})[_0x0707('0x21')](function(_0x2eeddb){logger[_0x0707('0x13')]('GetMailAccount',_0x2eeddb['message'],_0x2a3ece);_0x360caf(_0x5ab0f8[_0x0707('0x13')](0x1f4,_0x2eeddb[_0x0707('0x15')]));});});};exports[_0x0707('0x22')]=function(_0x1d8708){var _0x515bea=this;return new Promise(function(_0x43c49e,_0x2e219c){return db['MailAccount'][_0x0707('0x23')]({'raw':_0x1d8708[_0x0707('0x1a')]?_0x1d8708['options'][_0x0707('0x19')]===undefined?!![]:![]:!![],'where':_0x1d8708[_0x0707('0x1a')]?_0x1d8708['options'][_0x0707('0x24')]||null:null,'attributes':_0x1d8708[_0x0707('0x1a')]?_0x1d8708['options'][_0x0707('0x1b')]||null:null,'include':_0x1d8708[_0x0707('0x1a')]?_0x1d8708[_0x0707('0x1a')][_0x0707('0x1d')]?_[_0x0707('0x1e')](_0x1d8708[_0x0707('0x1a')][_0x0707('0x1d')],function(_0x5e5b1a){return{'model':db[_0x5e5b1a[_0x0707('0x1f')]],'as':_0x5e5b1a['as'],'attributes':_0x5e5b1a[_0x0707('0x1b')],'include':_0x5e5b1a[_0x0707('0x1d')]?_['map'](_0x5e5b1a[_0x0707('0x1d')],function(_0x658221){return{'model':db[_0x658221['model']],'as':_0x658221['as'],'attributes':_0x658221[_0x0707('0x1b')],'include':_0x658221[_0x0707('0x1d')]?_[_0x0707('0x1e')](_0x658221['include'],function(_0x362d24){return{'model':db[_0x362d24['model']],'as':_0x362d24['as'],'attributes':_0x362d24[_0x0707('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0707('0x20')](function(_0xf593b){logger[_0x0707('0x16')](_0x0707('0x22'),_0x1d8708);logger[_0x0707('0xf')](_0x0707('0x22'),_0x1d8708,JSON[_0x0707('0x12')](_0xf593b));_0x43c49e(_0xf593b);})[_0x0707('0x21')](function(_0x1ec918){logger[_0x0707('0x13')](_0x0707('0x22'),_0x1ec918[_0x0707('0x15')],_0x1d8708);_0x2e219c(_0x515bea[_0x0707('0x13')](0x1f4,_0x1ec918[_0x0707('0x15')]));});});};exports[_0x0707('0x25')]=function(_0x374e21){var _0x28403=this;return new Promise(function(_0x1e3d16,_0x507f5b){var _0x15530a={'body':_0x374e21[_0x0707('0x26')],'channel':_0x0707('0x27')};var _0x4d9988=_['difference'](_[_0x0707('0x28')](db[_0x0707('0x29')]['rawAttributes']),[_0x0707('0x2a'),_0x0707('0x2b'),_0x0707('0x2c'),_0x0707('0x2d')]);var _0x2bcae4=![];if(_0x374e21['body']['id']){delete _0x374e21[_0x0707('0x26')]['id'];}if(_[_0x0707('0x2e')](_0x374e21[_0x0707('0x26')]['from'])){return _0x507f5b(_0x28403[_0x0707('0x13')](0x1f4,_0x0707('0x2f')));}if(_[_0x0707('0x2e')](_0x374e21[_0x0707('0x26')][_0x0707('0x26')])||_0x374e21[_0x0707('0x26')]['body']===''){return _0x507f5b(_0x28403[_0x0707('0x13')](0x1f4,_0x0707('0x30')));}if(_[_0x0707('0x2e')](_0x374e21[_0x0707('0x26')]['mapKey'])){return _0x507f5b(_0x28403['error'](0x1f4,_0x0707('0x31')+_0x4d9988));}if(!_[_0x0707('0x32')](_0x4d9988,_0x374e21[_0x0707('0x26')][_0x0707('0x33')])){return _0x507f5b(_0x28403[_0x0707('0x13')](0x1f4,_0x0707('0x34')+_0x4d9988));}var _0x3643ff={};_0x3643ff[_0x374e21[_0x0707('0x26')][_0x0707('0x33')]]=_0x374e21[_0x0707('0x26')][_0x0707('0x35')];return db['MailAccount'][_0x0707('0x23')]({'where':{'id':_0x374e21[_0x0707('0x36')]['id']},'include':[{'model':db[_0x0707('0x37')],'as':'List','include':[{'model':db[_0x0707('0x29')],'as':_0x0707('0x38'),'where':_0x3643ff,'limit':0x1,'order':[[_0x0707('0x2b'),_0x0707('0x39')]]}]},{'model':db[_0x0707('0x3a')],'as':_0x0707('0x3b')},{'model':db[_0x0707('0x3c')],'as':_0x0707('0x3d')}]})['then'](function(_0xd94ef8){if(_0xd94ef8&&_0xd94ef8[_0x0707('0x3e')]){var _0x40830a=_0xd94ef8[_0x0707('0x3f')]({'plain':!![]});_0x15530a[_0x0707('0x36')]=_['omit'](_0x40830a,[_0x0707('0x3b'),_0x0707('0x3e')]);_0x15530a[_0x0707('0x40')]=_0x40830a[_0x0707('0x3b')];_0x15530a['list']=_0x40830a[_0x0707('0x3e')];_0x15530a['applications']=_[_0x0707('0x41')](_0x15530a[_0x0707('0x40')],[_0x0707('0x42')],[_0x0707('0x43')]);if(_0x15530a['account']&&_0x15530a[_0x0707('0x36')][_0x0707('0x44')]){_0x15530a[_0x0707('0x40')][_0x0707('0x45')]({'id':0x0,'priority':_0x15530a[_0x0707('0x40')][_0x0707('0x46')]+0x1,'app':'close','appdata':_0x0707('0x44'),'interval':_0x0707('0x47')});}if(_0x15530a[_0x0707('0x36')][_0x0707('0x3b')]){delete _0x15530a[_0x0707('0x36')][_0x0707('0x3b')];}if(_0x15530a['account'][_0x0707('0x3e')]){delete _0x15530a[_0x0707('0x36')][_0x0707('0x3e')];}if(_0x40830a[_0x0707('0x3e')][_0x0707('0x38')][_0x0707('0x46')]){return _0x40830a['List'][_0x0707('0x38')][0x0];}var _0x768e45=_[_0x0707('0x8')](_0x374e21['body'],{'firstName':_0x374e21[_0x0707('0x26')][_0x0707('0x35')],'ListId':_0x40830a['ListId']});_0x768e45[_0x374e21['body'][_0x0707('0x33')]]=_0x374e21[_0x0707('0x26')]['from'];return db[_0x0707('0x29')][_0x0707('0x48')](_0x768e45);}else{throw new Error(_0x0707('0x49'));}})[_0x0707('0x20')](function(_0x9ea902){_0x15530a[_0x0707('0x4a')]=_0x9ea902;if(_0x9ea902){if(!_0x374e21['body'][_0x0707('0x15')][_0x0707('0x4b')]){_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x4b')]=rs[_0x0707('0x4c')]()+'\x20'+_0x374e21['body']['message'][_0x0707('0x35')];}var _0x8826f3={'ContactId':_0x9ea902['id'],'MailAccountId':_0x374e21[_0x0707('0x36')]['id'],'inReplyTo':_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x4b')],'to':_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x35')],'cc':_0x374e21[_0x0707('0x26')][_0x0707('0x15')]['cc'],'subject':_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x4d')],'attach':_0x374e21['body'][_0x0707('0x15')][_0x0707('0x4e')],'lastMsgAt':moment()[_0x0707('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x374e21['body']['body']};return db['MailInteraction'][_0x0707('0x23')]({'where':{'closed':![],'MailAccountId':_0x374e21['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x0707('0x50'),'attributes':['messageId'],'where':{'messageId':_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x51')]}}]})[_0x0707('0x20')](function(_0x3d00ff){if(_0x3d00ff){return[_0x3d00ff,![]];}return db[_0x0707('0x52')][_0x0707('0x48')](_0x8826f3)[_0x0707('0x20')](function(_0x540f6a){return[_0x540f6a,!![]];});});}else{throw new Error(_0x0707('0x53'));}})[_0x0707('0x54')](function(_0x1e743b,_0x3cefe4){if(_0x1e743b){_0x2bcae4=_0x3cefe4;if(!_0x3cefe4){return _0x1e743b[_0x0707('0x55')]({'inReplyTo':_0x374e21[_0x0707('0x26')]['message'][_0x0707('0x4b')],'to':_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x35')],'cc':_0x374e21[_0x0707('0x26')][_0x0707('0x15')]['cc'],'subject':_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x4d')],'attach':_0x1e743b[_0x0707('0x4e')]?_0x1e743b['attach']:_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x4e')],'substatus':null,'substatusAt':moment()[_0x0707('0x4f')](_0x0707('0x56')),'lastMsgAt':moment()[_0x0707('0x4f')](_0x0707('0x56')),'lastMsgDirection':'in','lastMsgBody':_0x374e21[_0x0707('0x26')][_0x0707('0x26')]});}else{return _0x1e743b;}}})['then'](function(_0x5956d2){_0x15530a[_0x0707('0x57')]=_0x5956d2['get']({'plain':!![]});_0x15530a[_0x0707('0x57')][_0x0707('0x58')]=_0x2bcae4;return db['MailMessage'][_0x0707('0x48')]({'body':_0x374e21[_0x0707('0x26')]['body'],'MailAccountId':_0x374e21[_0x0707('0x36')]['id'],'MailInteractionId':_0x5956d2['id'],'direction':'in','ContactId':_0x15530a[_0x0707('0x4a')]['id'],'messageId':_0x374e21[_0x0707('0x26')][_0x0707('0x15')]['messageId'],'from':_0x374e21[_0x0707('0x26')]['message'][_0x0707('0x35')],'to':_0x374e21[_0x0707('0x26')][_0x0707('0x15')]['to'],'cc':_0x374e21['body'][_0x0707('0x15')]['cc'],'subject':_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x4d')],'attach':_0x374e21[_0x0707('0x26')]['message'][_0x0707('0x4e')],'Attachments':_0x374e21['body']['message'][_0x0707('0x59')],'originTo':_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x5a')],'originCc':_0x374e21[_0x0707('0x26')]['message'][_0x0707('0x5b')],'bcc':_0x374e21[_0x0707('0x26')][_0x0707('0x15')][_0x0707('0x5c')]},{'include':[{'model':db['Attachment'],'as':_0x0707('0x5d')}]});})[_0x0707('0x20')](function(_0xab635a){_0x15530a[_0x0707('0x15')]=_0xab635a;if(_0x15530a[_0x0707('0x57')][_0x0707('0x5e')]){return db['User']['find']({'attributes':['id',_0x0707('0x5f')],'where':{'id':_0x15530a[_0x0707('0x57')][_0x0707('0x5e')]}})[_0x0707('0x20')](function(_0x5e6295){if(_0x5e6295){_0x15530a[_0x0707('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0707('0x60'),'appdata':_0x5e6295[_0x0707('0x5f')]+','+(_0x15530a[_0x0707('0x36')][_0x0707('0x61')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0707('0x62'),'startRouting',_0x15530a);});}return respondWithRpcPromise(_0x0707('0x62'),_0x0707('0x63'),_0x15530a);})[_0x0707('0x20')](function(_0x2242a4){_0x1e3d16(_0x2242a4);})[_0x0707('0x21')](function(_0x41a471){_0x507f5b(_0x28403['error'](0x1f4,_0x41a471['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 307a2b1..c0d0ef2 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 _0x78e0=['remove','update','emit','removeListener','register','mailAccount:','./mailAccount.events','save'];(function(_0x11c3d7,_0x4d9e67){var _0x4d37b0=function(_0x4d373e){while(--_0x4d373e){_0x11c3d7['push'](_0x11c3d7['shift']());}};_0x4d37b0(++_0x4d9e67);}(_0x78e0,0x13e));var _0x078e=function(_0x33f0e4,_0x2d414a){_0x33f0e4=_0x33f0e4-0x0;var _0x543c2e=_0x78e0[_0x33f0e4];return _0x543c2e;};'use strict';var MailAccountEvents=require(_0x078e('0x0'));var events=[_0x078e('0x1'),_0x078e('0x2'),_0x078e('0x3')];function createListener(_0xb67870,_0x2af398){return function(_0x2d5210){_0x2af398[_0x078e('0x4')](_0xb67870,_0x2d5210);};}function removeListener(_0x5c0c80,_0x4dabce){return function(){MailAccountEvents[_0x078e('0x5')](_0x5c0c80,_0x4dabce);};}exports[_0x078e('0x6')]=function(_0x8e71c){for(var _0x35578b=0x0,_0x117087=events['length'];_0x35578b<_0x117087;_0x35578b++){var _0x2e5eed=events[_0x35578b];var _0x1eec5c=createListener(_0x078e('0x7')+_0x2e5eed,_0x8e71c);MailAccountEvents['on'](_0x2e5eed,_0x1eec5c);}}; \ No newline at end of file +var _0x6dac=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0xa98d02,_0x5423e2){var _0x198262=function(_0x3124ec){while(--_0x3124ec){_0xa98d02['push'](_0xa98d02['shift']());}};_0x198262(++_0x5423e2);}(_0x6dac,0x16e));var _0xc6da=function(_0x1fecff,_0x429379){_0x1fecff=_0x1fecff-0x0;var _0xf3ebad=_0x6dac[_0x1fecff];return _0xf3ebad;};'use strict';var MailAccountEvents=require(_0xc6da('0x0'));var events=[_0xc6da('0x1'),_0xc6da('0x2'),_0xc6da('0x3')];function createListener(_0x133ecc,_0x224a52){return function(_0x3391f5){_0x224a52[_0xc6da('0x4')](_0x133ecc,_0x3391f5);};}function removeListener(_0x28663f,_0x338470){return function(){MailAccountEvents[_0xc6da('0x5')](_0x28663f,_0x338470);};}exports[_0xc6da('0x6')]=function(_0x325f49){for(var _0x5caf49=0x0,_0x1ebd11=events[_0xc6da('0x7')];_0x5caf49<_0x1ebd11;_0x5caf49++){var _0x5a0d8d=events[_0x5caf49];var _0x3047d3=createListener(_0xc6da('0x8')+_0x5a0d8d,_0x325f49);MailAccountEvents['on'](_0x5a0d8d,_0x3047d3);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index af9623c..71231a1 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 _0xe706=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x3b2d93,_0x326183){var _0x158bcb=function(_0x8aa6d5){while(--_0x8aa6d5){_0x3b2d93['push'](_0x3b2d93['shift']());}};_0x158bcb(++_0x326183);}(_0xe706,0xa3));var _0x6e70=function(_0x2bd0dd,_0x167fb0){_0x2bd0dd=_0x2bd0dd-0x0;var _0x4637bb=_0xe706[_0x2bd0dd];return _0x4637bb;};'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')](_0x6e70('0xa'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xd')](_0x6e70('0xa'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xf')](_0x6e70('0xa'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);module[_0x6e70('0x11')]=router; \ No newline at end of file +var _0x3c81=['connect-timeout','express','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util'];(function(_0x1ce22d,_0x1c214a){var _0x4903e0=function(_0x1e5bc5){while(--_0x1e5bc5){_0x1ce22d['push'](_0x1ce22d['shift']());}};_0x4903e0(++_0x1c214a);}(_0x3c81,0x102));var _0x13c8=function(_0xaa8c5a,_0x25bd79){_0xaa8c5a=_0xaa8c5a-0x0;var _0x43a855=_0x3c81[_0xaa8c5a];return _0x43a855;};'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')](_0x13c8('0x6'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x9')](_0x13c8('0x6'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['delete'](_0x13c8('0x6'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xb')]);module[_0x13c8('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 8100683..af894e4 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 _0x27bb=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x5484f4,_0x4f2c3a){var _0x7f7dc9=function(_0x491bcd){while(--_0x491bcd){_0x5484f4['push'](_0x5484f4['shift']());}};_0x7f7dc9(++_0x4f2c3a);}(_0x27bb,0xa4));var _0xb27b=function(_0x1aeadf,_0x591ebc){_0x1aeadf=_0x1aeadf-0x0;var _0x380d02=_0x27bb[_0x1aeadf];return _0x380d02;};'use strict';var Sequelize=require(_0xb27b('0x0'));module[_0xb27b('0x1')]={'priority':{'type':Sequelize[_0xb27b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb27b('0x3')],'allowNull':![],'defaultValue':_0xb27b('0x4')},'appdata':{'type':Sequelize[_0xb27b('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb27b('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1dbc=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x3ceab0,_0xc1c5f7){var _0x465a47=function(_0x1d0813){while(--_0x1d0813){_0x3ceab0['push'](_0x3ceab0['shift']());}};_0x465a47(++_0xc1c5f7);}(_0x1dbc,0x16f));var _0xc1db=function(_0x468dac,_0x1ffdb3){_0x468dac=_0x468dac-0x0;var _0x62391=_0x1dbc[_0x468dac];return _0x62391;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xc1db('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xc1db('0x1')],'allowNull':![],'defaultValue':_0xc1db('0x2')},'appdata':{'type':Sequelize[_0xc1db('0x3')]()},'description':{'type':Sequelize[_0xc1db('0x1')]},'interval':{'type':Sequelize[_0xc1db('0x1')],'defaultValue':_0xc1db('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 9654b87..2033f46 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 _0xa265=['send','show','params','model','keys','MailApplication','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','reject','save','update','then','error','stack','name'];(function(_0x2492e4,_0x3e7c56){var _0x2c5aef=function(_0x3f9404){while(--_0x3f9404){_0x2492e4['push'](_0x2492e4['shift']());}};_0x2c5aef(++_0x3e7c56);}(_0xa265,0xe6));var _0x5a26=function(_0x2786b2,_0x4f122d){_0x2786b2=_0x2786b2-0x0;var _0x5734a1=_0xa265[_0x2786b2];return _0x5734a1;};'use strict';var pdf=require(_0x5a26('0x0'));var emlformat=require(_0x5a26('0x1'));var rimraf=require(_0x5a26('0x2'));var zipdir=require(_0x5a26('0x3'));var jsonpatch=require(_0x5a26('0x4'));var rp=require(_0x5a26('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5a26('0x6'));var sox=require(_0x5a26('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5a26('0x8'));var crypto=require(_0x5a26('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5a26('0xa'));var toCsv=require(_0x5a26('0xb'));var querystring=require(_0x5a26('0xc'));var Papa=require('papaparse');var Redis=require(_0x5a26('0xd'));var authService=require(_0x5a26('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5a26('0xf'));var hardwareService=require(_0x5a26('0x10'));var logger=require('../../config/logger')(_0x5a26('0x11'));var utils=require(_0x5a26('0x12'));var config=require(_0x5a26('0x13'));var db=require(_0x5a26('0x14'))['db'];function respondWithStatusCode(_0xaa8cb5,_0x318ee8){_0x318ee8=_0x318ee8||0xcc;return function(_0x11e29c){if(_0x11e29c){return _0xaa8cb5[_0x5a26('0x15')](_0x318ee8);}return _0xaa8cb5[_0x5a26('0x16')](_0x318ee8)[_0x5a26('0x17')]();};}function respondWithResult(_0x1a738e,_0x4be4c4){_0x4be4c4=_0x4be4c4||0xc8;return function(_0x2228e9){if(_0x2228e9){return _0x1a738e[_0x5a26('0x16')](_0x4be4c4)['json'](_0x2228e9);}};}function respondWithFilteredResult(_0x2cef7e,_0x59212a){return function(_0x180934){if(_0x180934){var _0x5eb6b2=_0x180934[_0x5a26('0x18')],_0xd9c36=_0x59212a['offset'],_0x4f438f=_0x59212a[_0x5a26('0x19')]+_0x59212a['limit'],_0x22791a;if(_0x4f438f>=_0x5eb6b2){_0x4f438f=_0x5eb6b2;_0x22791a=0xc8;}else{_0x22791a=0xce;}_0x2cef7e[_0x5a26('0x16')](_0x22791a);return _0x2cef7e['set'](_0x5a26('0x1a'),_0xd9c36+'-'+_0x4f438f+'/'+_0x5eb6b2)[_0x5a26('0x1b')](_0x180934);}return null;};}function patchUpdates(_0x280480){return function(_0x55f20c){try{jsonpatch['apply'](_0x55f20c,_0x280480,!![]);}catch(_0x2c6c05){return BPromise[_0x5a26('0x1c')](_0x2c6c05);}return _0x55f20c[_0x5a26('0x1d')]();};}function saveUpdates(_0x5337c4,_0xfdbd6a){return function(_0x503161){if(_0x503161){return _0x503161[_0x5a26('0x1e')](_0x5337c4)[_0x5a26('0x1f')](function(_0x47f39a){return _0x47f39a;});}return null;};}function removeEntity(_0x13b27d,_0x177b4a){return function(_0x29be5a){if(_0x29be5a){return _0x29be5a['destroy']()['then'](function(){_0x13b27d[_0x5a26('0x16')](0xcc)[_0x5a26('0x17')]();});}};}function handleEntityNotFound(_0x4e82e2,_0x4d7082){return function(_0xa34886){if(!_0xa34886){_0x4e82e2['sendStatus'](0x194);}return _0xa34886;};}function handleError(_0x4b8c5b,_0x326867){_0x326867=_0x326867||0x1f4;return function(_0x2e6aa3){logger[_0x5a26('0x20')](_0x2e6aa3[_0x5a26('0x21')]);if(_0x2e6aa3[_0x5a26('0x22')]){delete _0x2e6aa3['name'];}_0x4b8c5b[_0x5a26('0x16')](_0x326867)[_0x5a26('0x23')](_0x2e6aa3);};}exports[_0x5a26('0x24')]=function(_0x15d172,_0x51a318){var _0x403a78={'raw':!![],'where':{'id':_0x15d172[_0x5a26('0x25')]['id']}},_0x4b06f8={};_0x4b06f8[_0x5a26('0x26')]=_[_0x5a26('0x27')](db[_0x5a26('0x28')]['rawAttributes']);_0x4b06f8[_0x5a26('0x29')]=_[_0x5a26('0x27')](_0x15d172[_0x5a26('0x29')]);_0x4b06f8['filters']=_[_0x5a26('0x2a')](_0x4b06f8['model'],_0x4b06f8['query']);_0x403a78['attributes']=_[_0x5a26('0x2a')](_0x4b06f8['model'],qs[_0x5a26('0x2b')](_0x15d172[_0x5a26('0x29')][_0x5a26('0x2b')]));_0x403a78[_0x5a26('0x2c')]=_0x403a78[_0x5a26('0x2c')][_0x5a26('0x2d')]?_0x403a78[_0x5a26('0x2c')]:_0x4b06f8[_0x5a26('0x26')];if(_0x15d172[_0x5a26('0x29')][_0x5a26('0x2e')]){_0x403a78[_0x5a26('0x2f')]=[{'all':!![]}];}_0x403a78=_[_0x5a26('0x30')]({},_0x403a78,_0x15d172[_0x5a26('0x31')]);return db[_0x5a26('0x28')][_0x5a26('0x32')](_0x403a78)[_0x5a26('0x1f')](handleEntityNotFound(_0x51a318,null))[_0x5a26('0x1f')](respondWithResult(_0x51a318,null))['catch'](handleError(_0x51a318,null));};exports['update']=function(_0x454aab,_0x45f111){if(_0x454aab[_0x5a26('0x33')]['id']){delete _0x454aab[_0x5a26('0x33')]['id'];}return db['MailApplication']['find']({'where':{'id':_0x454aab[_0x5a26('0x25')]['id']}})[_0x5a26('0x1f')](handleEntityNotFound(_0x45f111,null))[_0x5a26('0x1f')](saveUpdates(_0x454aab[_0x5a26('0x33')],null))[_0x5a26('0x1f')](respondWithResult(_0x45f111,null))[_0x5a26('0x34')](handleError(_0x45f111,null));};exports['destroy']=function(_0x5564d4,_0x414cc8){return db[_0x5a26('0x28')]['find']({'where':{'id':_0x5564d4[_0x5a26('0x25')]['id']}})[_0x5a26('0x1f')](handleEntityNotFound(_0x414cc8,null))[_0x5a26('0x1f')](removeEntity(_0x414cc8,null))[_0x5a26('0x34')](handleError(_0x414cc8,null));}; \ No newline at end of file +var _0x6d0f=['json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','model','MailApplication','rawAttributes','query','keys','filters','intersection','length','attributes','includeAll','include','merge','options','find','catch','body','params','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d0f,0x96));var _0xf6d0=function(_0x25a5fc,_0x3d2f93){_0x25a5fc=_0x25a5fc-0x0;var _0x45eaec=_0x6d0f[_0x25a5fc];return _0x45eaec;};'use strict';var pdf=require(_0xf6d0('0x0'));var emlformat=require(_0xf6d0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf6d0('0x2'));var rp=require(_0xf6d0('0x3'));var moment=require(_0xf6d0('0x4'));var BPromise=require(_0xf6d0('0x5'));var Mustache=require(_0xf6d0('0x6'));var util=require('util');var path=require(_0xf6d0('0x7'));var sox=require(_0xf6d0('0x8'));var csv=require('to-csv');var ejs=require(_0xf6d0('0x9'));var fs=require('fs');var _=require(_0xf6d0('0xa'));var squel=require(_0xf6d0('0xb'));var crypto=require(_0xf6d0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf6d0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf6d0('0xe'));var Papa=require(_0xf6d0('0xf'));var Redis=require(_0xf6d0('0x10'));var authService=require(_0xf6d0('0x11'));var qs=require(_0xf6d0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6d0('0x13'))(_0xf6d0('0x14'));var utils=require(_0xf6d0('0x15'));var config=require(_0xf6d0('0x16'));var db=require(_0xf6d0('0x17'))['db'];function respondWithStatusCode(_0x26f221,_0x20bd5c){_0x20bd5c=_0x20bd5c||0xcc;return function(_0x5da142){if(_0x5da142){return _0x26f221[_0xf6d0('0x18')](_0x20bd5c);}return _0x26f221[_0xf6d0('0x19')](_0x20bd5c)[_0xf6d0('0x1a')]();};}function respondWithResult(_0x32dd70,_0x1efed5){_0x1efed5=_0x1efed5||0xc8;return function(_0x418a31){if(_0x418a31){return _0x32dd70[_0xf6d0('0x19')](_0x1efed5)[_0xf6d0('0x1b')](_0x418a31);}};}function respondWithFilteredResult(_0x81b265,_0x261404){return function(_0x454a03){if(_0x454a03){var _0x3cfe29=_0x454a03[_0xf6d0('0x1c')],_0x21bdf3=_0x261404['offset'],_0x10b0dc=_0x261404['offset']+_0x261404[_0xf6d0('0x1d')],_0x339bf3;if(_0x10b0dc>=_0x3cfe29){_0x10b0dc=_0x3cfe29;_0x339bf3=0xc8;}else{_0x339bf3=0xce;}_0x81b265[_0xf6d0('0x19')](_0x339bf3);return _0x81b265[_0xf6d0('0x1e')](_0xf6d0('0x1f'),_0x21bdf3+'-'+_0x10b0dc+'/'+_0x3cfe29)['json'](_0x454a03);}return null;};}function patchUpdates(_0xc0e348){return function(_0x225bbc){try{jsonpatch[_0xf6d0('0x20')](_0x225bbc,_0xc0e348,!![]);}catch(_0xc91b55){return BPromise[_0xf6d0('0x21')](_0xc91b55);}return _0x225bbc[_0xf6d0('0x22')]();};}function saveUpdates(_0x507e0c,_0x1d796c){return function(_0x47c7a0){if(_0x47c7a0){return _0x47c7a0[_0xf6d0('0x23')](_0x507e0c)[_0xf6d0('0x24')](function(_0x1118ed){return _0x1118ed;});}return null;};}function removeEntity(_0x187041,_0x5ed0cb){return function(_0x5d664a){if(_0x5d664a){return _0x5d664a[_0xf6d0('0x25')]()['then'](function(){_0x187041[_0xf6d0('0x19')](0xcc)[_0xf6d0('0x1a')]();});}};}function handleEntityNotFound(_0x41cee5,_0x6b0e41){return function(_0x2c571f){if(!_0x2c571f){_0x41cee5[_0xf6d0('0x18')](0x194);}return _0x2c571f;};}function handleError(_0x2220db,_0x1b8c29){_0x1b8c29=_0x1b8c29||0x1f4;return function(_0xf0da7a){logger['error'](_0xf0da7a[_0xf6d0('0x26')]);if(_0xf0da7a[_0xf6d0('0x27')]){delete _0xf0da7a['name'];}_0x2220db[_0xf6d0('0x19')](_0x1b8c29)[_0xf6d0('0x28')](_0xf0da7a);};}exports[_0xf6d0('0x29')]=function(_0x10ad22,_0x40c879){var _0x4edd85={'raw':!![],'where':{'id':_0x10ad22['params']['id']}},_0x3efbb6={};_0x3efbb6[_0xf6d0('0x2a')]=_['keys'](db[_0xf6d0('0x2b')][_0xf6d0('0x2c')]);_0x3efbb6[_0xf6d0('0x2d')]=_[_0xf6d0('0x2e')](_0x10ad22[_0xf6d0('0x2d')]);_0x3efbb6[_0xf6d0('0x2f')]=_['intersection'](_0x3efbb6[_0xf6d0('0x2a')],_0x3efbb6[_0xf6d0('0x2d')]);_0x4edd85['attributes']=_[_0xf6d0('0x30')](_0x3efbb6[_0xf6d0('0x2a')],qs['fields'](_0x10ad22[_0xf6d0('0x2d')]['fields']));_0x4edd85['attributes']=_0x4edd85['attributes'][_0xf6d0('0x31')]?_0x4edd85[_0xf6d0('0x32')]:_0x3efbb6[_0xf6d0('0x2a')];if(_0x10ad22[_0xf6d0('0x2d')][_0xf6d0('0x33')]){_0x4edd85[_0xf6d0('0x34')]=[{'all':!![]}];}_0x4edd85=_[_0xf6d0('0x35')]({},_0x4edd85,_0x10ad22[_0xf6d0('0x36')]);return db[_0xf6d0('0x2b')][_0xf6d0('0x37')](_0x4edd85)[_0xf6d0('0x24')](handleEntityNotFound(_0x40c879,null))[_0xf6d0('0x24')](respondWithResult(_0x40c879,null))[_0xf6d0('0x38')](handleError(_0x40c879,null));};exports[_0xf6d0('0x23')]=function(_0xf82a22,_0x2d724d){if(_0xf82a22['body']['id']){delete _0xf82a22[_0xf6d0('0x39')]['id'];}return db[_0xf6d0('0x2b')]['find']({'where':{'id':_0xf82a22[_0xf6d0('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2d724d,null))[_0xf6d0('0x24')](saveUpdates(_0xf82a22['body'],null))[_0xf6d0('0x24')](respondWithResult(_0x2d724d,null))[_0xf6d0('0x38')](handleError(_0x2d724d,null));};exports[_0xf6d0('0x25')]=function(_0x228299,_0x136503){return db[_0xf6d0('0x2b')][_0xf6d0('0x37')]({'where':{'id':_0x228299[_0xf6d0('0x3a')]['id']}})[_0xf6d0('0x24')](handleEntityNotFound(_0x136503,null))[_0xf6d0('0x24')](removeEntity(_0x136503,null))['catch'](handleError(_0x136503,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 9f7fc38..36a768f 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 _0x215d=['request-promise','path','../../config/environment','exports','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x57766c,_0x2fd768){var _0x3c8e18=function(_0x11308e){while(--_0x11308e){_0x57766c['push'](_0x57766c['shift']());}};_0x3c8e18(++_0x2fd768);}(_0x215d,0x187));var _0xd215=function(_0x9f106d,_0xda5eb1){_0x9f106d=_0x9f106d-0x0;var _0x308598=_0x215d[_0x9f106d];return _0x308598;};'use strict';var _=require(_0xd215('0x0'));var util=require('util');var logger=require(_0xd215('0x1'))(_0xd215('0x2'));var moment=require(_0xd215('0x3'));var BPromise=require(_0xd215('0x4'));var rp=require(_0xd215('0x5'));var fs=require('fs');var path=require(_0xd215('0x6'));var rimraf=require('rimraf');var config=require(_0xd215('0x7'));var attributes=require('./mailApplication.attributes');module[_0xd215('0x8')]=function(_0x1c1356,_0x269e38){return _0x1c1356['define'](_0xd215('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd215('0xa'),'collate':_0xd215('0xb')});}; \ No newline at end of file +var _0x5ae9=['utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','../../config/environment','exports','define','MailApplication'];(function(_0x208b9d,_0x2a7bcb){var _0x3673ee=function(_0x3c1219){while(--_0x3c1219){_0x208b9d['push'](_0x208b9d['shift']());}};_0x3673ee(++_0x2a7bcb);}(_0x5ae9,0x19b));var _0x95ae=function(_0x185fce,_0x4d45cf){_0x185fce=_0x185fce-0x0;var _0x3065d0=_0x5ae9[_0x185fce];return _0x3065d0;};'use strict';var _=require(_0x95ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x95ae('0x1'));var moment=require(_0x95ae('0x2'));var BPromise=require('bluebird');var rp=require(_0x95ae('0x3'));var fs=require('fs');var path=require(_0x95ae('0x4'));var rimraf=require('rimraf');var config=require(_0x95ae('0x5'));var attributes=require('./mailApplication.attributes');module[_0x95ae('0x6')]=function(_0x3c4464,_0xa51307){return _0x3c4464[_0x95ae('0x7')](_0x95ae('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x95ae('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 3998377..acf5013 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 _0xbadb=['then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','limit','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x31dd70,_0x101887){var _0x96651c=function(_0x18663a){while(--_0x18663a){_0x31dd70['push'](_0x31dd70['shift']());}};_0x96651c(++_0x101887);}(_0xbadb,0x70));var _0xbbad=function(_0x5b6c8a,_0x39a80c){_0x5b6c8a=_0x5b6c8a-0x0;var _0xa042da=_0xbadb[_0x5b6c8a];return _0xa042da;};'use strict';var _=require(_0xbbad('0x0'));var util=require(_0xbbad('0x1'));var moment=require('moment');var BPromise=require(_0xbbad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbad('0x3'));var db=require(_0xbbad('0x4'))['db'];var utils=require(_0xbbad('0x5'));var logger=require(_0xbbad('0x6'))(_0xbbad('0x7'));var config=require(_0xbbad('0x8'));var jayson=require(_0xbbad('0x9'));var client=jayson['client'][_0xbbad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x568be2,_0x540d44,_0x2dca89){return new BPromise(function(_0x55d73b,_0x36286b){return client[_0xbbad('0xb')](_0x568be2,_0x2dca89)[_0xbbad('0xc')](function(_0x7afb2a){logger[_0xbbad('0xd')](_0xbbad('0xe'),_0x540d44,_0xbbad('0xf'));logger['debug'](_0xbbad('0x10'),_0x540d44,'request\x20sent',JSON[_0xbbad('0x11')](_0x7afb2a));if(_0x7afb2a['error']){if(_0x7afb2a[_0xbbad('0x12')][_0xbbad('0x13')]===0x1f4){logger[_0xbbad('0x12')]('MailApplication,\x20%s,\x20%s',_0x540d44,_0x7afb2a[_0xbbad('0x12')][_0xbbad('0x14')]);return _0x36286b(_0x7afb2a[_0xbbad('0x12')][_0xbbad('0x14')]);}logger[_0xbbad('0x12')](_0xbbad('0xe'),_0x540d44,_0x7afb2a['error'][_0xbbad('0x14')]);return _0x55d73b(_0x7afb2a[_0xbbad('0x12')][_0xbbad('0x14')]);}else{logger[_0xbbad('0xd')]('MailApplication,\x20%s,\x20%s',_0x540d44,'request\x20sent');_0x55d73b(_0x7afb2a[_0xbbad('0x15')]['message']);}})[_0xbbad('0x16')](function(_0x4747fd){logger[_0xbbad('0x12')]('MailApplication,\x20%s,\x20%s',_0x540d44,_0x4747fd);_0x36286b(_0x4747fd);});});}exports[_0xbbad('0x17')]=function(_0x510308){var _0x1d4d66=this;return new Promise(function(_0x2a4ff5,_0x2f49cf){return db[_0xbbad('0x18')][_0xbbad('0x19')](_0x510308[_0xbbad('0x1a')],{'raw':_0x510308['options']?_0x510308[_0xbbad('0x1b')][_0xbbad('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x510308[_0xbbad('0x1b')]?_0x510308[_0xbbad('0x1b')]['where']||null:null,'attributes':_0x510308[_0xbbad('0x1b')]?_0x510308[_0xbbad('0x1b')]['attributes']||null:null,'limit':_0x510308['options']?_0x510308[_0xbbad('0x1b')][_0xbbad('0x1d')]||null:null})[_0xbbad('0xc')](function(_0x39fa84){logger[_0xbbad('0xd')](_0xbbad('0x17'),_0x510308);logger[_0xbbad('0x1e')](_0xbbad('0x17'),_0x510308,JSON['stringify'](_0x39fa84));_0x2a4ff5(_0x39fa84);})['catch'](function(_0x1c3007){logger[_0xbbad('0x12')](_0xbbad('0x17'),_0x1c3007[_0xbbad('0x14')],_0x510308);_0x2f49cf(_0x1d4d66[_0xbbad('0x12')](0x1f4,_0x1c3007[_0xbbad('0x14')]));});});}; \ No newline at end of file +var _0x4e77=['update','body','options','raw','where','attributes','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','MailApplication'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4e77,0x127));var _0x74e7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4e77[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x74e7('0x0'));var util=require(_0x74e7('0x1'));var moment=require(_0x74e7('0x2'));var BPromise=require(_0x74e7('0x3'));var rs=require(_0x74e7('0x4'));var fs=require('fs');var Redis=require(_0x74e7('0x5'));var db=require(_0x74e7('0x6'))['db'];var utils=require(_0x74e7('0x7'));var logger=require(_0x74e7('0x8'))(_0x74e7('0x9'));var config=require(_0x74e7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x74e7('0xb')][_0x74e7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2133de,_0x5bc3bd,_0x292fe3){return new BPromise(function(_0x12ae63,_0x1a5186){return client[_0x74e7('0xd')](_0x2133de,_0x292fe3)[_0x74e7('0xe')](function(_0x25cd01){logger[_0x74e7('0xf')](_0x74e7('0x10'),_0x5bc3bd,_0x74e7('0x11'));logger[_0x74e7('0x12')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5bc3bd,'request\x20sent',JSON['stringify'](_0x25cd01));if(_0x25cd01[_0x74e7('0x13')]){if(_0x25cd01[_0x74e7('0x13')][_0x74e7('0x14')]===0x1f4){logger[_0x74e7('0x13')]('MailApplication,\x20%s,\x20%s',_0x5bc3bd,_0x25cd01[_0x74e7('0x13')][_0x74e7('0x15')]);return _0x1a5186(_0x25cd01[_0x74e7('0x13')][_0x74e7('0x15')]);}logger[_0x74e7('0x13')]('MailApplication,\x20%s,\x20%s',_0x5bc3bd,_0x25cd01[_0x74e7('0x13')]['message']);return _0x12ae63(_0x25cd01['error']['message']);}else{logger[_0x74e7('0xf')](_0x74e7('0x10'),_0x5bc3bd,'request\x20sent');_0x12ae63(_0x25cd01[_0x74e7('0x16')][_0x74e7('0x15')]);}})[_0x74e7('0x17')](function(_0x23e204){logger[_0x74e7('0x13')](_0x74e7('0x10'),_0x5bc3bd,_0x23e204);_0x1a5186(_0x23e204);});});}exports['UpdateMailApplication']=function(_0x34d9f4){var _0x1dfea1=this;return new Promise(function(_0x459ead,_0x4440ef){return db[_0x74e7('0x18')][_0x74e7('0x19')](_0x34d9f4[_0x74e7('0x1a')],{'raw':_0x34d9f4[_0x74e7('0x1b')]?_0x34d9f4['options'][_0x74e7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34d9f4['options']?_0x34d9f4['options'][_0x74e7('0x1d')]||null:null,'attributes':_0x34d9f4[_0x74e7('0x1b')]?_0x34d9f4[_0x74e7('0x1b')][_0x74e7('0x1e')]||null:null,'limit':_0x34d9f4[_0x74e7('0x1b')]?_0x34d9f4[_0x74e7('0x1b')]['limit']||null:null})[_0x74e7('0xe')](function(_0x3e509a){logger['info'](_0x74e7('0x1f'),_0x34d9f4);logger[_0x74e7('0x12')](_0x74e7('0x1f'),_0x34d9f4,JSON['stringify'](_0x3e509a));_0x459ead(_0x3e509a);})[_0x74e7('0x17')](function(_0x26832a){logger['error']('UpdateMailApplication',_0x26832a[_0x74e7('0x15')],_0x34d9f4);_0x4440ef(_0x1dfea1[_0x74e7('0x13')](0x1f4,_0x26832a[_0x74e7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index be0c3eb..cb6cb38 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 _0xb4c9=['destroy','delete','util','express','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','mailinteraction:destroy'];(function(_0x387583,_0x127b08){var _0x45d2f9=function(_0x1d82ac){while(--_0x1d82ac){_0x387583['push'](_0x387583['shift']());}};_0x45d2f9(++_0x127b08);}(_0xb4c9,0xbf));var _0x9b4c=function(_0x39cba7,_0x3a6d29){_0x39cba7=_0x39cba7-0x0;var _0x32439b=_0xb4c9[_0x39cba7];return _0x32439b;};'use strict';var multer=require('multer');var util=require(_0x9b4c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9b4c('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9b4c('0x2'));var config=require(_0x9b4c('0x3'));var controller=require(_0x9b4c('0x4'));router[_0x9b4c('0x5')]('/',auth[_0x9b4c('0x6')](),controller[_0x9b4c('0x7')]);router[_0x9b4c('0x5')](_0x9b4c('0x8'),auth[_0x9b4c('0x6')](),controller[_0x9b4c('0x9')]);router[_0x9b4c('0x5')](_0x9b4c('0xa'),auth[_0x9b4c('0x6')](),controller['show']);router[_0x9b4c('0x5')](_0x9b4c('0xb'),auth[_0x9b4c('0x6')](),controller[_0x9b4c('0xc')]);router[_0x9b4c('0x5')](_0x9b4c('0xd'),auth[_0x9b4c('0x6')](),controller[_0x9b4c('0xe')]);router[_0x9b4c('0xf')]('/',auth[_0x9b4c('0x6')](),controller['create']);router[_0x9b4c('0xf')](_0x9b4c('0xb'),auth['isAuthenticated'](),controller[_0x9b4c('0x10')]);router['post'](_0x9b4c('0x11'),auth['isAuthenticated'](),interaction[_0x9b4c('0x12')](_0x9b4c('0x13'),_0x9b4c('0x14')),controller[_0x9b4c('0x15')]);router[_0x9b4c('0x16')](_0x9b4c('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0x9b4c('0x13'),_0x9b4c('0x17')),controller['update']);router['delete'](_0x9b4c('0xa'),auth['isAuthenticated'](),interaction[_0x9b4c('0x12')](_0x9b4c('0x13'),_0x9b4c('0x18')),controller[_0x9b4c('0x19')]);router[_0x9b4c('0x1a')](_0x9b4c('0x11'),auth[_0x9b4c('0x6')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x91a7=['get','isAuthenticated','describe','/:id','show','getMessages','download','post','create','/:id/messages','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','destroy','/:id/tags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x35a781,_0x2c38c6){var _0x48ed30=function(_0x5de777){while(--_0x5de777){_0x35a781['push'](_0x35a781['shift']());}};_0x48ed30(++_0x2c38c6);}(_0x91a7,0x6c));var _0x791a=function(_0x128b88,_0x1cf449){_0x128b88=_0x128b88-0x0;var _0x3ce64c=_0x91a7[_0x128b88];return _0x3ce64c;};'use strict';var multer=require(_0x791a('0x0'));var util=require(_0x791a('0x1'));var path=require(_0x791a('0x2'));var timeout=require('connect-timeout');var express=require(_0x791a('0x3'));var router=express[_0x791a('0x4')]();var auth=require(_0x791a('0x5'));var interaction=require(_0x791a('0x6'));var config=require(_0x791a('0x7'));var controller=require('./mailInteraction.controller');router[_0x791a('0x8')]('/',auth[_0x791a('0x9')](),controller['index']);router[_0x791a('0x8')]('/describe',auth[_0x791a('0x9')](),controller[_0x791a('0xa')]);router[_0x791a('0x8')](_0x791a('0xb'),auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router[_0x791a('0x8')]('/:id/messages',auth[_0x791a('0x9')](),controller[_0x791a('0xd')]);router[_0x791a('0x8')]('/:id/download',auth[_0x791a('0x9')](),controller[_0x791a('0xe')]);router[_0x791a('0xf')]('/',auth[_0x791a('0x9')](),controller[_0x791a('0x10')]);router[_0x791a('0xf')](_0x791a('0x11'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);router[_0x791a('0xf')]('/:id/tags',auth[_0x791a('0x9')](),interaction[_0x791a('0x13')](_0x791a('0x14'),_0x791a('0x15')),controller[_0x791a('0x16')]);router[_0x791a('0x17')]('/:id',auth[_0x791a('0x9')](),interaction[_0x791a('0x13')]('mail','mailinteraction:update'),controller[_0x791a('0x18')]);router[_0x791a('0x19')](_0x791a('0xb'),auth[_0x791a('0x9')](),interaction[_0x791a('0x13')]('mail','mailinteraction:destroy'),controller[_0x791a('0x1a')]);router[_0x791a('0x19')](_0x791a('0x1b'),auth[_0x791a('0x9')](),controller['removeTags']);module[_0x791a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 5ec8fb6..a979a68 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 _0xee3c=['sequelize','iconv','exports','DATE','STRING','TEXT','BOOLEAN','ENUM','out','long'];(function(_0x1bbca3,_0x2bb676){var _0x1b6a9b=function(_0x504d2e){while(--_0x504d2e){_0x1bbca3['push'](_0x1bbca3['shift']());}};_0x1b6a9b(++_0x2bb676);}(_0xee3c,0x140));var _0xcee3=function(_0x3aefda,_0x22b20f){_0x3aefda=_0x3aefda-0x0;var _0x5b0bbf=_0xee3c[_0x3aefda];return _0x5b0bbf;};'use strict';var Sequelize=require(_0xcee3('0x0'));var iconv=require(_0xcee3('0x1'));module[_0xcee3('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcee3('0x3')]},'disposition':{'type':Sequelize[_0xcee3('0x4')]},'note':{'type':Sequelize[_0xcee3('0x4')]},'inReplyTo':{'type':Sequelize[_0xcee3('0x4')](0x1fe)},'to':{'type':Sequelize[_0xcee3('0x4')]},'cc':{'type':Sequelize[_0xcee3('0x5')]('long')},'subject':{'type':Sequelize[_0xcee3('0x5')]()},'attach':{'type':Sequelize[_0xcee3('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xcee3('0x3')]},'substatus':{'type':Sequelize[_0xcee3('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xcee3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcee3('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcee3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcee3('0x7')]('in',_0xcee3('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xcee3('0x5')](_0xcee3('0x9'))},'lastMsgText':{'type':Sequelize[_0xcee3('0x5')](_0xcee3('0x9'))}}; \ No newline at end of file +var _0x29e8=['STRING','long','TEXT','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x29e8,0xc3));var _0x829e=function(_0x52b5ef,_0x45c828){_0x52b5ef=_0x52b5ef-0x0;var _0x1f8845=_0x29e8[_0x52b5ef];return _0x1f8845;};'use strict';var Sequelize=require(_0x829e('0x0'));var iconv=require(_0x829e('0x1'));module[_0x829e('0x2')]={'closed':{'type':Sequelize[_0x829e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x829e('0x4')]},'disposition':{'type':Sequelize[_0x829e('0x5')]},'note':{'type':Sequelize[_0x829e('0x5')]},'inReplyTo':{'type':Sequelize[_0x829e('0x5')](0x1fe)},'to':{'type':Sequelize[_0x829e('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x829e('0x6'))},'subject':{'type':Sequelize[_0x829e('0x7')]()},'attach':{'type':Sequelize[_0x829e('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x829e('0x4')]},'substatus':{'type':Sequelize[_0x829e('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x829e('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x829e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x829e('0x8')]('in',_0x829e('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x829e('0x7')](_0x829e('0x6'))},'lastMsgText':{'type':Sequelize[_0x829e('0x7')](_0x829e('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 9b71c80..832e0ab 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 _0x51c3=['omit','getMessages','rawAttributes','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','findAll','emit','mailInteractionTags:save','removeTags','download','unix','root','server','files','join','attachments','transcript-%d-%s.zip','Attachment','bcc','subject','Messages','get','mkdirSync','each','headers','Attachments','basename','existsSync','readFileSync','message%d.eml','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','html-to-text','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','Users','fullname','Tags','split','forEach','push','TagIds','findOne','lastMsgBody','lastMsgText','fromString','catch','map','MailInteraction','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','field','color','from','tools_tags','select','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','plainBody','some','compact','i.MailAccountId\x20IN\x20?','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','MailAccountId','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','isEmpty','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.mandatoryDisposition','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','show','params','include','options','body','describe','addMessage','MailMessage','ids'];(function(_0x400d52,_0x1b6375){var _0x3ade84=function(_0x39c477){while(--_0x39c477){_0x400d52['push'](_0x400d52['shift']());}};_0x3ade84(++_0x1b6375);}(_0x51c3,0x10d));var _0x351c=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x51c3[_0x6cf19c];return _0xce14f3;};'use strict';var pdf=require(_0x351c('0x0'));var emlformat=require(_0x351c('0x1'));var rimraf=require(_0x351c('0x2'));var zipdir=require(_0x351c('0x3'));var jsonpatch=require(_0x351c('0x4'));var rp=require(_0x351c('0x5'));var moment=require('moment');var BPromise=require(_0x351c('0x6'));var Mustache=require(_0x351c('0x7'));var util=require(_0x351c('0x8'));var path=require(_0x351c('0x9'));var sox=require('sox');var csv=require(_0x351c('0xa'));var ejs=require(_0x351c('0xb'));var fs=require('fs');var _=require(_0x351c('0xc'));var squel=require(_0x351c('0xd'));var crypto=require('crypto');var jsforce=require(_0x351c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x351c('0xa'));var querystring=require(_0x351c('0xf'));var Papa=require(_0x351c('0x10'));var htmlToText=require(_0x351c('0x11'));var Redis=require(_0x351c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x351c('0x13'));var as=require(_0x351c('0x14'));var hardwareService=require(_0x351c('0x15'));var logger=require('../../config/logger')(_0x351c('0x16'));var utils=require(_0x351c('0x17'));var config=require(_0x351c('0x18'));var db=require(_0x351c('0x19'))['db'];config[_0x351c('0x1a')]=_[_0x351c('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x351c('0x1c'))(new Redis(config[_0x351c('0x1a')]));require(_0x351c('0x1d'))['register'](socket);function respondWithStatusCode(_0x40c5a3,_0x13bbf1){_0x13bbf1=_0x13bbf1||0xcc;return function(_0x3a1eae){if(_0x3a1eae){return _0x40c5a3[_0x351c('0x1e')](_0x13bbf1);}return _0x40c5a3[_0x351c('0x1f')](_0x13bbf1)[_0x351c('0x20')]();};}function respondWithResult(_0x3f2d72,_0x7cccc1){_0x7cccc1=_0x7cccc1||0xc8;return function(_0x3b9584){if(_0x3b9584){return _0x3f2d72[_0x351c('0x1f')](_0x7cccc1)[_0x351c('0x21')](_0x3b9584);}};}function respondWithFilteredResult(_0x4d56a7,_0x371a6f){return function(_0x8e147f){if(_0x8e147f){var _0xd5d028=_0x8e147f[_0x351c('0x22')],_0x497334=_0x371a6f['offset'],_0x4d47bd=_0x371a6f[_0x351c('0x23')]+_0x371a6f['limit'],_0x489d52;if(_0x4d47bd>=_0xd5d028){_0x4d47bd=_0xd5d028;_0x489d52=0xc8;}else{_0x489d52=0xce;}_0x4d56a7[_0x351c('0x1f')](_0x489d52);return _0x4d56a7[_0x351c('0x24')](_0x351c('0x25'),_0x497334+'-'+_0x4d47bd+'/'+_0xd5d028)[_0x351c('0x21')](_0x8e147f);}return null;};}function patchUpdates(_0x28fd31){return function(_0x33629a){try{jsonpatch['apply'](_0x33629a,_0x28fd31,!![]);}catch(_0x460b4c){return BPromise[_0x351c('0x26')](_0x460b4c);}return _0x33629a[_0x351c('0x27')]();};}function saveUpdates(_0x50a177,_0x39e839){return function(_0x4b10ca){if(_0x4b10ca){return _0x4b10ca[_0x351c('0x28')](_0x50a177)[_0x351c('0x29')](function(_0x201497){return _0x201497;});}return null;};}function removeEntity(_0x2230df,_0x539c0f){return function(_0x2edc43){if(_0x2edc43){return _0x2edc43[_0x351c('0x2a')]()[_0x351c('0x29')](function(){_0x2230df[_0x351c('0x1f')](0xcc)[_0x351c('0x20')]();});}};}function handleEntityNotFound(_0x458c7e,_0x4670ce){return function(_0x2cff62){if(!_0x2cff62){_0x458c7e[_0x351c('0x1e')](0x194);}return _0x2cff62;};}function handleError(_0x54cdc9,_0x444318){_0x444318=_0x444318||0x1f4;return function(_0x26e922){logger[_0x351c('0x2b')](_0x26e922[_0x351c('0x2c')]);if(_0x26e922[_0x351c('0x2d')]){delete _0x26e922['name'];}_0x54cdc9[_0x351c('0x1f')](_0x444318)['send'](_0x26e922);};}function getInteractionUsers(_0x58158d,_0x5aca1c){return new BPromise(function(_0xe7ab87,_0xcf74a){try{if(_0x5aca1c[_0x58158d['id']]){_0x58158d[_0x351c('0x2e')]=_['map'](_0x5aca1c[_0x58158d['id']],function(_0x33d907){return{'id':_0x33d907['id'],'fullname':_0x33d907[_0x351c('0x2f')]};});}}catch(_0x2522a3){_0xcf74a(_0x2522a3);}_0xe7ab87(_0x58158d);});}function getInteractionTags(_0x29a53d,_0x3ad19b){return new BPromise(function(_0x19d610,_0x1d2dcf){try{if(_0x29a53d['TagIds']){_0x29a53d[_0x351c('0x30')]=[];_0x29a53d['TagIds'][_0x351c('0x31')](',')[_0x351c('0x32')](function(_0x220d5d){_0x29a53d['Tags'][_0x351c('0x33')](_0x3ad19b[_0x220d5d]);});}delete _0x29a53d[_0x351c('0x34')];}catch(_0x5751b9){_0x1d2dcf(_0x5751b9);}_0x19d610(_0x29a53d);});}function getLastMessageText(_0x5a256b){return new BPromise(function(_0x2b0faa,_0x1ecbb8){return db['MailInteraction'][_0x351c('0x35')]({'where':{'id':_0x5a256b['id']},'attributes':[_0x351c('0x36'),_0x351c('0x37')],'raw':!![]})['then'](function(_0x35087c){if(!_0x35087c[_0x351c('0x37')]){_0x5a256b[_0x351c('0x37')]=_['trimStart'](htmlToText[_0x351c('0x38')](_0x35087c[_0x351c('0x36')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x5a256b[_0x351c('0x37')]=_0x35087c['lastMsgText'];}_0x2b0faa(_0x5a256b);})[_0x351c('0x39')](function(_0xb92993){_0x1ecbb8(_0xb92993);});});}function updateMailInteraction(_0x272dd5,_0x1675c7,_0x563d68,_0x3a5144){return new BPromise(function(_0x500a37,_0x2ade54){return getInteractionUsers(_0x272dd5,_0x563d68)[_0x351c('0x29')](function(_0x229d36){return getInteractionTags(_0x229d36,_0x1675c7);})[_0x351c('0x29')](function(_0x49d671){if(_0x3a5144){_0x500a37(getLastMessageText(_0x49d671));}else{_0x500a37(_0x49d671);}})[_0x351c('0x39')](function(_0x37a414){_0x2ade54(_0x37a414);});});}exports['index']=function(_0x1ecbeb,_0x215787){var _0x3a20c4={},_0x29d4c8={},_0x1abbc2={'count':0x0,'rows':[]};var _0xd5036c=_[_0x351c('0x3a')](db[_0x351c('0x3b')]['rawAttributes'],function(_0x1aedc2){return{'name':_0x1aedc2[_0x351c('0x3c')],'type':_0x1aedc2['type']['key']};});_0x29d4c8[_0x351c('0x3d')]=_[_0x351c('0x3a')](_0xd5036c,_0x351c('0x2d'));_0x29d4c8[_0x351c('0x3e')]=_[_0x351c('0x3f')](_0x1ecbeb[_0x351c('0x3e')]);_0x29d4c8[_0x351c('0x40')]=_[_0x351c('0x41')](_0x29d4c8[_0x351c('0x3d')],_0x29d4c8[_0x351c('0x3e')]);_0x3a20c4[_0x351c('0x42')]=_[_0x351c('0x41')](_0x29d4c8['model'],qs[_0x351c('0x43')](_0x1ecbeb['query'][_0x351c('0x43')]));_0x3a20c4[_0x351c('0x42')]=_0x3a20c4['attributes'][_0x351c('0x44')]?_0x3a20c4['attributes']:_0x29d4c8['model'];if(!_0x1ecbeb[_0x351c('0x3e')][_0x351c('0x45')]('nolimit')){_0x3a20c4[_0x351c('0x46')]=qs['limit'](_0x1ecbeb['query'][_0x351c('0x46')]);_0x3a20c4[_0x351c('0x23')]=qs[_0x351c('0x23')](_0x1ecbeb['query'][_0x351c('0x23')]);}_0x3a20c4['order']=qs[_0x351c('0x47')](_0x1ecbeb['query'][_0x351c('0x47')]);_0x3a20c4[_0x351c('0x48')]=qs[_0x351c('0x40')](_[_0x351c('0x49')](_0x1ecbeb[_0x351c('0x3e')],_0x29d4c8['filters']));var _0x465f22=[];var _0x34e7e4=squel['select']()[_0x351c('0x4a')]('id')['field'](_0x351c('0x2d'))[_0x351c('0x4a')](_0x351c('0x4b'))[_0x351c('0x4c')](_0x351c('0x4d'));var _0x14a989=squel[_0x351c('0x4e')]()[_0x351c('0x4a')]('u.id')[_0x351c('0x4a')]('u.fullname')['field'](_0x351c('0x4f'))[_0x351c('0x4c')](_0x351c('0x50'),'ui')[_0x351c('0x51')]('users','u',_0x351c('0x52'));var _0x28123a=squel[_0x351c('0x4e')]()['from'](_0x351c('0x53'),'i')['left_join'](_0x351c('0x54'),'c',_0x351c('0x55'))[_0x351c('0x51')]('users','o',_0x351c('0x56'))[_0x351c('0x51')](_0x351c('0x57'),'a',_0x351c('0x58'))[_0x351c('0x51')]('mail_messages','me','me.MailInteractionId\x20=\x20i.id')[_0x351c('0x51')](_0x351c('0x59'),'it',_0x351c('0x5a'))[_0x351c('0x51')](_0x351c('0x4d'),'t',_0x351c('0x5b'));var _0x4d8a6d=squel[_0x351c('0x5c')]();var _0x2d9337=[];var _0x24cf7d=squel['expr']();var _0xbdeb92;if(_0x1ecbeb[_0x351c('0x3e')]['search']){_0xbdeb92=as['parseSearch'](_0x1ecbeb['query']['search']);var _0x1e5ce7=_0xbdeb92['sqlOperator'];for(var _0x58c078=0x0;_0x58c078<_0xbdeb92[_0x351c('0x5d')][_0x351c('0x44')];_0x58c078++){var _0xeec8a7=_0xbdeb92[_0x351c('0x5d')][_0x58c078];var _0x5b13d0='i';var _0x1de354=_[_0x351c('0x5e')](_0xd5036c,['name',_0xeec8a7[_0x351c('0x4a')]]);if(!_0x1de354){switch(_0xeec8a7['field']){case _0x351c('0x5f'):if(_0xeec8a7[_0x351c('0x60')]==0x1){_0x28123a['having']('`'+_0xeec8a7[_0x351c('0x4a')]+_0x351c('0x61'));}else{_0x28123a[_0x351c('0x62')]('`'+_0xeec8a7[_0x351c('0x4a')]+'`\x20>\x200');}break;case _0x351c('0x63'):if(_0xeec8a7[_0x351c('0x64')]===_0x351c('0x65')){if(_0xeec8a7[_0x351c('0x60')][_0x351c('0x31')]('\x20')[_0x351c('0x44')]>0x1){_0x4d8a6d[_0x1e5ce7](_0x351c('0x66'),qs[_0x351c('0x67')](_0xeec8a7[_0x351c('0x60')]),null);}else{var _0x10d77c='%'+_0xeec8a7[_0x351c('0x60')]+'%';_0x4d8a6d[_0x1e5ce7](_0x351c('0x68'),_0x10d77c,_0x10d77c,_0x10d77c);}}else{_0x1de354=_[_0x351c('0x5e')](_0xd5036c,['name',_0x351c('0x69')]);_0xeec8a7[_0x351c('0x4a')]=_0x351c('0x69');_0x171179=as[_0x351c('0x6a')](_0x5b13d0,_0x1de354['type'],_0xeec8a7);_0x4d8a6d[_0x1e5ce7](_0x171179[_0x351c('0x6b')],_0x171179[_0x351c('0x60')][_0x351c('0x6c')],_0x171179[_0x351c('0x60')]['end']);}break;case _0x351c('0x6d'):var _0x20aa1c=_0xeec8a7[_0x351c('0x60')][_0x351c('0x31')](',')[_0x351c('0x3a')](function(_0x86845a){return Number(_0x86845a);});_0x20aa1c['forEach'](function(_0x4729f0){_0x24cf7d['or'](_0x351c('0x6e'),'%,'+_0x4729f0+',%');});_0x2d9337=_[_0x351c('0x6f')](_0x2d9337,_0x20aa1c);break;case _0x351c('0x70'):if(_0xeec8a7[_0x351c('0x64')]===_0x351c('0x65')){_0x4d8a6d[_0x1e5ce7](_0x351c('0x71'),'%'+_0xeec8a7[_0x351c('0x60')]+'%',null);}else{_0x1de354=_['find'](_0xd5036c,[_0x351c('0x2d'),_0x351c('0x72')]);_0xeec8a7[_0x351c('0x4a')]=_0x351c('0x72');_0x171179=as[_0x351c('0x6a')](_0x5b13d0,_0x1de354[_0x351c('0x73')],_0xeec8a7);_0x4d8a6d[_0x1e5ce7](_0x171179['text'],_0x171179[_0x351c('0x60')]['start'],_0x171179[_0x351c('0x60')][_0x351c('0x20')]);}break;case _0x351c('0x74'):_0x171179=as[_0x351c('0x6a')]('me',null,_0xeec8a7);_0x4d8a6d[_0x1e5ce7](_0x171179[_0x351c('0x6b')],_0x171179[_0x351c('0x60')][_0x351c('0x6c')],_0x171179[_0x351c('0x60')][_0x351c('0x20')]);break;}}else{var _0x171179=as[_0x351c('0x6a')](_0x5b13d0,_0x1de354[_0x351c('0x73')],_0xeec8a7);_0x4d8a6d[_0x1e5ce7](_0x171179['text'],_0x171179['value']['start'],_0x171179[_0x351c('0x60')][_0x351c('0x20')]);}}}else{var _0x47db8b=_(_0x1ecbeb[_0x351c('0x3e')])[_0x351c('0x3f')]()['map'](function(_0x231de3){return _[_0x351c('0x75')](_0xd5036c,[_0x351c('0x2d'),_0x231de3])?_0x231de3:undefined;})[_0x351c('0x76')]()['value']();if(!_['isEmpty'](_0x47db8b)){_0x47db8b[_0x351c('0x32')](function(_0x5943ed){if(_0x5943ed==='MailAccountId'){_0x28123a[_0x351c('0x48')](_0x351c('0x77'),[]['concat'](_0x1ecbeb[_0x351c('0x3e')][_0x5943ed]));}else if(_0x5943ed===_0x351c('0x78')){var _0x4acdc0=JSON[_0x351c('0x79')](_0x1ecbeb[_0x351c('0x3e')][_0x5943ed])[_0x351c('0x7a')];var _0x485344=JSON['parse'](_0x1ecbeb[_0x351c('0x3e')][_0x5943ed])['$lte'];_0x28123a[_0x351c('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4acdc0,_0x485344);}else{if(_0x1ecbeb['query'][_0x5943ed]===_0x351c('0x7b')){_0x28123a[_0x351c('0x48')]('i.'+_0x5943ed+_0x351c('0x7c'));}else{_0x28123a[_0x351c('0x48')]('i.'+_0x5943ed+_0x351c('0x7d'),_0x1ecbeb['query'][_0x5943ed]);}}});}if(_0x1ecbeb[_0x351c('0x3e')][_0x351c('0x7e')]){if(_0x1ecbeb[_0x351c('0x3e')][_0x351c('0x7e')]==0x1){_0x28123a[_0x351c('0x62')](_0x351c('0x7f'));}else{_0x28123a[_0x351c('0x62')](_0x351c('0x80'));}}if(_0x1ecbeb[_0x351c('0x3e')][_0x351c('0x81')]){_0x2d9337=_[_0x351c('0x82')](_0x1ecbeb['query'][_0x351c('0x81')])?_0x1ecbeb[_0x351c('0x3e')]['tag']:new Array(_0x1ecbeb[_0x351c('0x3e')]['tag']);_0x2d9337[_0x351c('0x32')](function(_0x13cb4f){_0x24cf7d['or'](_0x351c('0x6e'),'%,'+_0x13cb4f+',%');});}if(_0x1ecbeb[_0x351c('0x3e')][_0x351c('0x83')]){var _0x345c5d=_0x1ecbeb[_0x351c('0x3e')][_0x351c('0x83')][_0x351c('0x84')]('\x5c','\x5c\x5c')[_0x351c('0x84')]('\x27\x27',_0x351c('0x85'));if(qs[_0x351c('0x86')](_0x345c5d)){_0x4d8a6d['or'](_0x351c('0x87'),_0x345c5d+'%');}else if(qs['isEmail'](_0x345c5d)){_0x4d8a6d['or']('c.email\x20LIKE\x20?',_0x345c5d+'%');}else{_0x4d8a6d['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x351c('0x67')](_0x345c5d))['or'](_0x351c('0x88'),qs[_0x351c('0x67')](_0x345c5d));}}}_0x28123a[_0x351c('0x48')](_0x4d8a6d);_0x28123a[_0x351c('0x89')]('i.id');var _0x558248={'type':db[_0x351c('0x8a')][_0x351c('0x8b')]['SELECT'],'raw':!![]};var _0x3776e6=_0x28123a['clone']();_0x3776e6[_0x351c('0x4a')]('i.id');_0x3776e6[_0x351c('0x4a')](_0x351c('0x8c'),'unreadMessages');if(_0x3a20c4[_0x351c('0x8d')]){_0x3a20c4[_0x351c('0x8d')][_0x351c('0x32')](function(_0x493898){_0x28123a[_0x351c('0x8d')]('i.'+_0x493898[0x0],_0x493898[0x1]===_0x351c('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x2d9337)){_0x28123a[_0x351c('0x62')](_0x24cf7d);_0x3776e6[_0x351c('0x48')](_0x351c('0x8f'),_0x2d9337);}BPromise[_0x351c('0x90')]()[_0x351c('0x29')](function(){if(!_0xbdeb92){if(_0x1ecbeb['query'][_0x351c('0x91')]||_0x1ecbeb[_0x351c('0x3e')][_0x351c('0x92')])return;_0x3776e6['where'](_0x351c('0x93'));_0x28123a[_0x351c('0x48')](_0x351c('0x93'));return;}return _0x1ecbeb[_0x351c('0x94')][_0x351c('0x95')]({'attributes':['id'],'raw':!![]})[_0x351c('0x29')](function(_0x1a7ddb){if(_[_0x351c('0x96')](_0x1a7ddb)){_0x3776e6[_0x351c('0x48')](_0x351c('0x97'));_0x28123a['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x3776e6[_0x351c('0x48')](_0x351c('0x77'),_[_0x351c('0x3a')](_0x1a7ddb,'id'));_0x28123a[_0x351c('0x48')](_0x351c('0x77'),_[_0x351c('0x3a')](_0x1a7ddb,'id'));}});})[_0x351c('0x29')](function(){db[_0x351c('0x98')][_0x351c('0x3e')](_0x3776e6[_0x351c('0x99')](),_0x558248)[_0x351c('0x29')](function(_0x5a7bea){_0x1abbc2['count']=_0x5a7bea[_0x351c('0x44')];if(_0x1abbc2[_0x351c('0x22')]===0x0)return[];return db[_0x351c('0x98')][_0x351c('0x3e')](_0x34e7e4['toString'](),_0x558248)[_0x351c('0x29')](function(_0x3525c3){_0x465f22=_[_0x351c('0x9a')](_0x3525c3,'id');_0x558248=_[_0x351c('0x9b')](_0x558248,{'model':db[_0x351c('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ecbeb[_0x351c('0x3e')][_0x351c('0x43')]){_0x3a20c4['attributes']['forEach'](function(_0x51b37c){_0x28123a[_0x351c('0x4a')]('i.'+_0x51b37c);});}else{_0x28123a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x351c('0x5f'));_0x28123a[_0x351c('0x4a')]('a.key','Account.key');_0x28123a[_0x351c('0x4a')]('a.mandatoryDisposition',_0x351c('0x9c'));_0x28123a[_0x351c('0x4a')]('i.id');_0x28123a[_0x351c('0x4a')](_0x351c('0x9d'));_0x28123a[_0x351c('0x4a')]('i.updatedAt');_0x28123a[_0x351c('0x4a')](_0x351c('0x9e'));_0x28123a[_0x351c('0x4a')](_0x351c('0x9f'));_0x28123a[_0x351c('0x4a')](_0x351c('0xa0'));_0x28123a[_0x351c('0x4a')]('i.lastMsgAt');_0x28123a[_0x351c('0x4a')](_0x351c('0xa1'));_0x28123a[_0x351c('0x4a')](_0x351c('0xa2'));_0x28123a[_0x351c('0x4a')](_0x351c('0xa3'));_0x28123a[_0x351c('0x4a')](_0x351c('0xa4'));_0x28123a[_0x351c('0x4a')](_0x351c('0xa5'));_0x28123a[_0x351c('0x4a')]('i.ContactId');_0x28123a[_0x351c('0x4a')](_0x351c('0xa6'));_0x28123a[_0x351c('0x4a')](_0x351c('0xa7'));_0x28123a['field']('c.firstName',_0x351c('0xa8'));_0x28123a[_0x351c('0x4a')](_0x351c('0xa9'),_0x351c('0xaa'));_0x28123a['field'](_0x351c('0xab'),'Contact.email');_0x28123a[_0x351c('0x4a')](_0x351c('0xac'),'Contact.phone');_0x28123a['field'](_0x351c('0xad'),_0x351c('0xae'));_0x28123a[_0x351c('0x4a')](_0x351c('0xaf'),_0x351c('0xb0'));_0x28123a[_0x351c('0x4a')]('o.fullname',_0x351c('0xb1'));_0x28123a[_0x351c('0x4a')]('o.internal',_0x351c('0xb2'));_0x28123a[_0x351c('0x4a')](_0x351c('0xb3'),_0x351c('0x34'));}_0x28123a[_0x351c('0x46')](_0x3a20c4[_0x351c('0x46')]);_0x28123a[_0x351c('0x23')](_0x3a20c4['offset']);return db[_0x351c('0x98')][_0x351c('0x3e')](_0x28123a[_0x351c('0x99')](),_0x558248);})[_0x351c('0x29')](function(_0xb8d07){_0x14a989[_0x351c('0x48')](_0x351c('0xb4'),_[_0x351c('0x3a')](_0xb8d07,'id'));return db['sequelize'][_0x351c('0x3e')](_0x14a989[_0x351c('0x99')](),_0x558248)[_0x351c('0x29')](function(_0x48625a){var _0x6db590=_[_0x351c('0xb5')](_0x48625a,_0x351c('0xb6'));var _0x440096=[];return db[_0x351c('0xb7')]['findOne']({'attributes':[_0x351c('0xb8')],'raw':!![]})[_0x351c('0x29')](function(_0x339434){var _0x2625f6=_0x339434['enableEmailPreview'];_0xb8d07[_0x351c('0x32')](function(_0x23ffbc){_0x440096[_0x351c('0x33')](updateMailInteraction(_0x23ffbc,_0x465f22,_0x6db590,_0x2625f6));});return BPromise[_0x351c('0xb9')](_0x440096);});});});})['then'](function(_0xf28540){_0x1abbc2['rows']=_0xf28540;return _0x1abbc2;})[_0x351c('0x29')](respondWithFilteredResult(_0x215787,_0x3a20c4));})[_0x351c('0x39')](handleError(_0x215787,null));};exports[_0x351c('0xba')]=function(_0x185880,_0x48555c){var _0x43329c={'raw':![],'where':{'id':_0x185880[_0x351c('0xbb')]['id']}},_0xb589d1={};_0xb589d1['model']=_[_0x351c('0x3f')](db[_0x351c('0x3b')]['rawAttributes']);_0xb589d1['query']=_['keys'](_0x185880[_0x351c('0x3e')]);_0xb589d1[_0x351c('0x40')]=_[_0x351c('0x41')](_0xb589d1['model'],_0xb589d1[_0x351c('0x3e')]);_0x43329c[_0x351c('0x42')]=_[_0x351c('0x41')](_0xb589d1['model'],qs[_0x351c('0x43')](_0x185880[_0x351c('0x3e')][_0x351c('0x43')]));_0x43329c[_0x351c('0x42')]=_0x43329c[_0x351c('0x42')][_0x351c('0x44')]?_0x43329c['attributes']:_0xb589d1['model'];if(_0x185880[_0x351c('0x3e')]['includeAll']){_0x43329c[_0x351c('0xbc')]=[{'all':!![]}];}_0x43329c=_[_0x351c('0x9b')]({},_0x43329c,_0x185880[_0x351c('0xbd')]);return db[_0x351c('0x3b')][_0x351c('0x5e')](_0x43329c)[_0x351c('0x29')](handleEntityNotFound(_0x48555c,null))[_0x351c('0x29')](respondWithResult(_0x48555c,null))[_0x351c('0x39')](handleError(_0x48555c,null));};exports['create']=function(_0x341198,_0x5bec48){return db[_0x351c('0x3b')]['create'](_0x341198[_0x351c('0xbe')],{})['then'](respondWithResult(_0x5bec48,0xc9))['catch'](handleError(_0x5bec48,null));};exports[_0x351c('0x28')]=function(_0x18ace4,_0x4971a9){if(_0x18ace4[_0x351c('0xbe')]['id']){delete _0x18ace4['body']['id'];}return db[_0x351c('0x3b')][_0x351c('0x5e')]({'where':{'id':_0x18ace4[_0x351c('0xbb')]['id']}})[_0x351c('0x29')](handleEntityNotFound(_0x4971a9,null))[_0x351c('0x29')](saveUpdates(_0x18ace4[_0x351c('0xbe')],null))[_0x351c('0x29')](respondWithResult(_0x4971a9,null))[_0x351c('0x39')](handleError(_0x4971a9,null));};exports['destroy']=function(_0x3d5e82,_0x479322){return db[_0x351c('0x3b')][_0x351c('0x5e')]({'where':{'id':_0x3d5e82[_0x351c('0xbb')]['id']}})[_0x351c('0x29')](handleEntityNotFound(_0x479322,null))['then'](removeEntity(_0x479322,null))[_0x351c('0x39')](handleError(_0x479322,null));};exports[_0x351c('0xbf')]=function(_0x15d5c9,_0xc6a977){return db['MailInteraction'][_0x351c('0xbf')]()[_0x351c('0x29')](respondWithResult(_0xc6a977,null))['catch'](handleError(_0xc6a977,null));};exports[_0x351c('0xc0')]=function(_0x2be132,_0x602188,_0x29cf31){return db[_0x351c('0xc1')][_0x351c('0x5e')]({'where':{'id':_0x2be132[_0x351c('0xbb')]['id']}})[_0x351c('0x29')](handleEntityNotFound(_0x602188,null))['then'](function(_0x254b1c){if(_0x254b1c){return _0x254b1c[_0x351c('0xc0')](_0x2be132['body'][_0x351c('0xc2')],_[_0x351c('0xc3')](_0x2be132['body'],['ids','id'])||{});}})[_0x351c('0x29')](respondWithResult(_0x602188,null))[_0x351c('0x39')](handleError(_0x602188,null));};exports[_0x351c('0xc4')]=function(_0x5dbd27,_0x378d43,_0x271957){var _0x107d52={'raw':![],'where':{}};var _0xf290a3={};var _0x19c208={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x5dbd27[_0x351c('0xbb')]['id']}})['then'](handleEntityNotFound(_0x378d43,null))[_0x351c('0x29')](function(_0x1ef234){if(_0x1ef234){_0xf290a3[_0x351c('0x3d')]=_['keys'](db['MailMessage'][_0x351c('0xc5')]);_0xf290a3[_0x351c('0x3e')]=_['keys'](_0x5dbd27[_0x351c('0x3e')]);_0xf290a3[_0x351c('0x40')]=_['intersection'](_0xf290a3['model'],_0xf290a3[_0x351c('0x3e')]);_0x107d52['attributes']=_[_0x351c('0x41')](_0xf290a3['model'],qs[_0x351c('0x43')](_0x5dbd27[_0x351c('0x3e')][_0x351c('0x43')]));_0x107d52[_0x351c('0x42')]=_0x107d52[_0x351c('0x42')]['length']?_0x107d52[_0x351c('0x42')]:_0xf290a3[_0x351c('0x3d')];if(!_0x5dbd27[_0x351c('0x3e')][_0x351c('0x45')](_0x351c('0xc6'))){_0x107d52[_0x351c('0x46')]=qs['limit'](_0x5dbd27[_0x351c('0x3e')][_0x351c('0x46')]);_0x107d52['offset']=qs[_0x351c('0x23')](_0x5dbd27[_0x351c('0x3e')][_0x351c('0x23')]);}_0x107d52[_0x351c('0x8d')]=qs[_0x351c('0x47')](_0x5dbd27[_0x351c('0x3e')][_0x351c('0x47')]);_0x107d52['where']=qs[_0x351c('0x40')](_[_0x351c('0x49')](_0x5dbd27[_0x351c('0x3e')],_0xf290a3[_0x351c('0x40')]));_0x107d52[_0x351c('0x48')][_0x351c('0xb6')]=_0x1ef234['id'];if(_0x5dbd27[_0x351c('0x3e')]['filter']){_0x107d52[_0x351c('0x48')]=_[_0x351c('0x9b')](_0x107d52[_0x351c('0x48')],{'$or':_[_0x351c('0x3a')](_0x107d52[_0x351c('0x42')],function(_0x2fcf69){var _0x13f756={};_0x13f756[_0x2fcf69]={'$like':'%'+_0x5dbd27[_0x351c('0x3e')][_0x351c('0x83')]+'%'};return _0x13f756;})});}if(_0x5dbd27['query'][_0x351c('0x7a')]){var _0xca3e2c=_0x5dbd27[_0x351c('0x3e')]['$gte'][_0x351c('0x31')](',');var _0x3f2ca6={};_0x3f2ca6[_0xca3e2c[0x0]]={'$gte':moment(_0xca3e2c[0x1])[_0x351c('0xc7')](_0x351c('0xc8'))};_0x107d52[_0x351c('0x48')]=_[_0x351c('0x9b')](_0x107d52[_0x351c('0x48')],_0x3f2ca6);}_0x107d52=_[_0x351c('0x9b')]({},_0x107d52,_0x5dbd27[_0x351c('0xbd')]);return db[_0x351c('0xc1')][_0x351c('0x22')]({'where':_0x107d52[_0x351c('0x48')]})[_0x351c('0x29')](function(_0x4282c6){_0x19c208[_0x351c('0x22')]=_0x4282c6;if(_0x5dbd27[_0x351c('0x3e')][_0x351c('0xc9')]){_0x107d52[_0x351c('0xbc')]=[{'all':!![]}];}return db[_0x351c('0xc1')]['findAll'](_0x107d52);})[_0x351c('0x29')](function(_0x26a896){_0x19c208[_0x351c('0xca')]=_0x26a896;return _0x19c208;});}})[_0x351c('0x29')](respondWithFilteredResult(_0x378d43,_0x107d52))[_0x351c('0x39')](handleError(_0x378d43,null));};exports[_0x351c('0xcb')]=function(_0x1acefa,_0x5d0811,_0x2ce050){return db['MailInteraction']['find']({'where':{'id':_0x1acefa[_0x351c('0xbb')]['id']}})[_0x351c('0x29')](handleEntityNotFound(_0x5d0811,null))[_0x351c('0x29')](function(_0x5b3da3){if(_0x5b3da3){return _0x5b3da3[_0x351c('0xcc')](_0x1acefa[_0x351c('0xbe')][_0x351c('0xc2')],_['omit'](_0x1acefa[_0x351c('0xbe')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x351c('0xcd')]({'attributes':['id',_0x351c('0x2d'),_0x351c('0x4b')],'where':{'id':_0x1acefa['body'][_0x351c('0xc2')]}});})['then'](function(_0x704452){socket[_0x351c('0xce')](_0x351c('0xcf'),{'id':Number(_0x1acefa['params']['id']),'tags':_0x704452||[]});return{'id':Number(_0x1acefa[_0x351c('0xbb')]['id']),'tags':_0x704452||[]};});}})[_0x351c('0x29')](respondWithResult(_0x5d0811,null))[_0x351c('0x39')](handleError(_0x5d0811,null));};exports[_0x351c('0xd0')]=function(_0x4ea9fc,_0xe28d75,_0x577ad2){return db['MailInteraction'][_0x351c('0x5e')]({'where':{'id':_0x4ea9fc['params']['id']}})['then'](handleEntityNotFound(_0xe28d75,null))[_0x351c('0x29')](function(_0x494f3e){if(_0x494f3e){return _0x494f3e[_0x351c('0xd0')](_0x4ea9fc[_0x351c('0x3e')][_0x351c('0xc2')]);}})[_0x351c('0x29')](respondWithStatusCode(_0xe28d75,null))[_0x351c('0x39')](handleError(_0xe28d75,null));};exports[_0x351c('0xd1')]=function(_0x4d1228,_0x2097aa){var _0x37b0d6=moment()[_0x351c('0xd2')]()['toString']();var _0x179e02=path['join'](config[_0x351c('0xd3')],_0x351c('0xd4'),_0x351c('0xd5'),'tmp');var _0x34e982=path[_0x351c('0xd6')](config[_0x351c('0xd3')],_0x351c('0xd4'),'files',_0x351c('0xd7'));var _0x17050e=path[_0x351c('0xd6')](_0x179e02,_0x37b0d6);var _0x545208=util[_0x351c('0xc7')](_0x351c('0xd8'),_0x4d1228[_0x351c('0xbb')]['id'],_0x37b0d6);var _0x74f312=path[_0x351c('0xd6')](_0x179e02,_0x545208);var _0x45423d=[];if(_0x4d1228[_0x351c('0x3e')][_0x351c('0xd7')]){_0x45423d[_0x351c('0x33')]({'model':db[_0x351c('0xd9')],'as':'Attachments','raw':!![]});}var _0x498f61=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x351c('0xbe'),'from','to','cc',_0x351c('0xda'),_0x351c('0xdb'),_0x351c('0x78')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x45423d}];return db[_0x351c('0x3b')][_0x351c('0x5e')]({'where':{'id':_0x4d1228[_0x351c('0xbb')]['id']},'include':_0x498f61})['then'](handleEntityNotFound(_0x2097aa,null))[_0x351c('0x29')](function(_0x55c72e){if(_0x55c72e&&_0x55c72e[_0x351c('0xdc')]){var _0x3c2273=_0x55c72e[_0x351c('0xdd')]({'plain':!![]});fs[_0x351c('0xde')](_0x17050e);return BPromise[_0x351c('0xdf')](_0x3c2273[_0x351c('0xdc')],function(_0x5d275e,_0xd12baa){var _0x22683c={'from':_0x5d275e[_0x351c('0x4c')],'to':_0x5d275e['to'],'subject':_0x5d275e[_0x351c('0xdb')],'html':_0x5d275e[_0x351c('0xbe')],'headers':{'Date':moment(_0x5d275e[_0x351c('0x78')])[_0x351c('0xc7')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5d275e['cc']){_0x22683c[_0x351c('0xe0')]['Cc']=_0x5d275e['cc'];}if(_0x5d275e[_0x351c('0xda')]){_0x22683c['headers']['Bcc']=_0x5d275e[_0x351c('0xda')];}return new BPromise(function(_0x15db2b,_0x305edb){if(_0x5d275e[_0x351c('0xe1')]){for(var _0x2bb316=0x0;_0x2bb316<_0x5d275e[_0x351c('0xe1')][_0x351c('0x44')];_0x2bb316++){var _0x23db4a=_0x5d275e[_0x351c('0xe1')][_0x2bb316];var _0xccc931=path['join'](_0x34e982,_0x23db4a[_0x351c('0xe2')]);if(fs[_0x351c('0xe3')](_0xccc931)){_0x22683c[_0x351c('0xd7')]['push']({'name':_0x23db4a['name'],'contentType':_0x23db4a[_0x351c('0x73')],'data':fs[_0x351c('0xe4')](_0xccc931)});}}}emlformat['build'](_0x22683c,function(_0x2275e5,_0x3e2fcb){if(_0x2275e5)return _0x305edb(_0x2275e5);fs['writeFileSync'](path[_0x351c('0xd6')](_0x17050e,util[_0x351c('0xc7')](_0x351c('0xe5'),_0xd12baa)),_0x3e2fcb);return _0x15db2b(_0x3e2fcb);});});})[_0x351c('0x29')](function(){return new BPromise(function(_0x19d93e,_0x37a5cd){zipdir(_0x17050e,{'saveTo':_0x74f312},function(_0x25ef8a,_0x254dbf){if(_0x25ef8a)return _0x37a5cd(_0x25ef8a);return _0x19d93e(_0x254dbf);});})['then'](function(){return new BPromise(function(_0x1f7e68,_0x4d24cb){rimraf(_0x17050e,function(_0x49cc20){if(_0x49cc20)_0x4d24cb(_0x49cc20);return _0x1f7e68();});});})[_0x351c('0x29')](function(){return _0x2097aa[_0x351c('0xd1')](_0x74f312,_0x545208,function(_0x1e8db2){if(_0x1e8db2){console[_0x351c('0xe6')]('err',_0x1e8db2);}else{fs[_0x351c('0xe7')](_0x74f312);}});});});}else{return _0x2097aa[_0x351c('0x1e')](0xc8);}})[_0x351c('0x39')](handleError(_0x2097aa,null));}; \ No newline at end of file +var _0x5b04=['Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','resolve','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.substatus','i.to','i.UserId','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','enableEmailPreview','all','rows','show','params','includeAll','include','merge','options','create','update','body','destroy','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','pick','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','mailInteractionTags:save','removeTags','unix','join','files','tmp','root','server','Attachment','Messages','bcc','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','basename','existsSync','attachments','readFileSync','build','writeFileSync','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','json','count','offset','set','Content-Range','apply','reject','save','then','end','sendStatus','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','MailInteraction','lastMsgText','fromString','lastMsgBody','catch','index','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','select','field','color','from','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200'];(function(_0x22d503,_0x21e3b7){var _0x1ef65a=function(_0x16c3e1){while(--_0x16c3e1){_0x22d503['push'](_0x22d503['shift']());}};_0x1ef65a(++_0x21e3b7);}(_0x5b04,0x17a));var _0x45b0=function(_0x1dab75,_0x584b43){_0x1dab75=_0x1dab75-0x0;var _0x59df44=_0x5b04[_0x1dab75];return _0x59df44;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x45b0('0x0'));var rimraf=require(_0x45b0('0x1'));var zipdir=require(_0x45b0('0x2'));var jsonpatch=require(_0x45b0('0x3'));var rp=require(_0x45b0('0x4'));var moment=require(_0x45b0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x45b0('0x6'));var util=require(_0x45b0('0x7'));var path=require(_0x45b0('0x8'));var sox=require(_0x45b0('0x9'));var csv=require(_0x45b0('0xa'));var ejs=require(_0x45b0('0xb'));var fs=require('fs');var _=require(_0x45b0('0xc'));var squel=require(_0x45b0('0xd'));var crypto=require(_0x45b0('0xe'));var jsforce=require(_0x45b0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x45b0('0xa'));var querystring=require(_0x45b0('0x10'));var Papa=require('papaparse');var htmlToText=require('html-to-text');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x45b0('0x11'));var as=require(_0x45b0('0x12'));var hardwareService=require(_0x45b0('0x13'));var logger=require(_0x45b0('0x14'))(_0x45b0('0x15'));var utils=require(_0x45b0('0x16'));var config=require(_0x45b0('0x17'));var db=require(_0x45b0('0x18'))['db'];config['redis']=_[_0x45b0('0x19')](config[_0x45b0('0x1a')],{'host':_0x45b0('0x1b'),'port':0x18eb});var socket=require(_0x45b0('0x1c'))(new Redis(config[_0x45b0('0x1a')]));require(_0x45b0('0x1d'))[_0x45b0('0x1e')](socket);function respondWithStatusCode(_0x3ec88,_0x404202){_0x404202=_0x404202||0xcc;return function(_0x55d326){if(_0x55d326){return _0x3ec88['sendStatus'](_0x404202);}return _0x3ec88['status'](_0x404202)['end']();};}function respondWithResult(_0x5c09a1,_0x534f76){_0x534f76=_0x534f76||0xc8;return function(_0xd80cdf){if(_0xd80cdf){return _0x5c09a1[_0x45b0('0x1f')](_0x534f76)[_0x45b0('0x20')](_0xd80cdf);}};}function respondWithFilteredResult(_0x2bf82d,_0xe11708){return function(_0x8fbdc9){if(_0x8fbdc9){var _0x310c60=_0x8fbdc9[_0x45b0('0x21')],_0xb80932=_0xe11708[_0x45b0('0x22')],_0x35da75=_0xe11708[_0x45b0('0x22')]+_0xe11708['limit'],_0x5142a6;if(_0x35da75>=_0x310c60){_0x35da75=_0x310c60;_0x5142a6=0xc8;}else{_0x5142a6=0xce;}_0x2bf82d[_0x45b0('0x1f')](_0x5142a6);return _0x2bf82d[_0x45b0('0x23')](_0x45b0('0x24'),_0xb80932+'-'+_0x35da75+'/'+_0x310c60)[_0x45b0('0x20')](_0x8fbdc9);}return null;};}function patchUpdates(_0x412b96){return function(_0x387727){try{jsonpatch[_0x45b0('0x25')](_0x387727,_0x412b96,!![]);}catch(_0x2ecf45){return BPromise[_0x45b0('0x26')](_0x2ecf45);}return _0x387727[_0x45b0('0x27')]();};}function saveUpdates(_0x42ccfe,_0x57c033){return function(_0x5b96b3){if(_0x5b96b3){return _0x5b96b3['update'](_0x42ccfe)[_0x45b0('0x28')](function(_0x25f36c){return _0x25f36c;});}return null;};}function removeEntity(_0x20eee1,_0x1a0024){return function(_0x2017f6){if(_0x2017f6){return _0x2017f6['destroy']()[_0x45b0('0x28')](function(){_0x20eee1[_0x45b0('0x1f')](0xcc)[_0x45b0('0x29')]();});}};}function handleEntityNotFound(_0x7acb9b,_0x5491ae){return function(_0x10c6e4){if(!_0x10c6e4){_0x7acb9b[_0x45b0('0x2a')](0x194);}return _0x10c6e4;};}function handleError(_0x269b22,_0x569d7){_0x569d7=_0x569d7||0x1f4;return function(_0x372421){logger[_0x45b0('0x2b')](_0x372421[_0x45b0('0x2c')]);if(_0x372421[_0x45b0('0x2d')]){delete _0x372421['name'];}_0x269b22[_0x45b0('0x1f')](_0x569d7)[_0x45b0('0x2e')](_0x372421);};}function getInteractionUsers(_0x5e848c,_0x288bef){return new BPromise(function(_0x107186,_0x2d3889){try{if(_0x288bef[_0x5e848c['id']]){_0x5e848c[_0x45b0('0x2f')]=_[_0x45b0('0x30')](_0x288bef[_0x5e848c['id']],function(_0x4a9c52){return{'id':_0x4a9c52['id'],'fullname':_0x4a9c52['fullname']};});}}catch(_0x21bf0c){_0x2d3889(_0x21bf0c);}_0x107186(_0x5e848c);});}function getInteractionTags(_0x56c49c,_0x5ac185){return new BPromise(function(_0x41a77f,_0x5f2c38){try{if(_0x56c49c[_0x45b0('0x31')]){_0x56c49c[_0x45b0('0x32')]=[];_0x56c49c['TagIds'][_0x45b0('0x33')](',')[_0x45b0('0x34')](function(_0x2a7f8e){_0x56c49c[_0x45b0('0x32')][_0x45b0('0x35')](_0x5ac185[_0x2a7f8e]);});}delete _0x56c49c[_0x45b0('0x31')];}catch(_0x425cde){_0x5f2c38(_0x425cde);}_0x41a77f(_0x56c49c);});}function getLastMessageText(_0x458943){return new BPromise(function(_0x214256,_0x5e1281){return db[_0x45b0('0x36')]['findOne']({'where':{'id':_0x458943['id']},'attributes':['lastMsgBody','lastMsgText'],'raw':!![]})[_0x45b0('0x28')](function(_0x46e5a4){if(!_0x46e5a4[_0x45b0('0x37')]){_0x458943[_0x45b0('0x37')]=_['trimStart'](htmlToText[_0x45b0('0x38')](_0x46e5a4[_0x45b0('0x39')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x458943['lastMsgText']=_0x46e5a4[_0x45b0('0x37')];}_0x214256(_0x458943);})[_0x45b0('0x3a')](function(_0x5da4b0){_0x5e1281(_0x5da4b0);});});}function updateMailInteraction(_0x201747,_0x140f03,_0x332770,_0x523e46){return new BPromise(function(_0x4a3495,_0x500677){return getInteractionUsers(_0x201747,_0x332770)[_0x45b0('0x28')](function(_0x29d142){return getInteractionTags(_0x29d142,_0x140f03);})[_0x45b0('0x28')](function(_0x4c080b){if(_0x523e46){_0x4a3495(getLastMessageText(_0x4c080b));}else{_0x4a3495(_0x4c080b);}})[_0x45b0('0x3a')](function(_0x482a4d){_0x500677(_0x482a4d);});});}exports[_0x45b0('0x3b')]=function(_0x2cfa0e,_0x31fe0e){var _0x4b775e={},_0x360d98={},_0xc914aa={'count':0x0,'rows':[]};var _0x1abc79=_[_0x45b0('0x30')](db[_0x45b0('0x36')][_0x45b0('0x3c')],function(_0x528297){return{'name':_0x528297[_0x45b0('0x3d')],'type':_0x528297['type'][_0x45b0('0x3e')]};});_0x360d98['model']=_['map'](_0x1abc79,'name');_0x360d98[_0x45b0('0x3f')]=_[_0x45b0('0x40')](_0x2cfa0e['query']);_0x360d98[_0x45b0('0x41')]=_['intersection'](_0x360d98[_0x45b0('0x42')],_0x360d98[_0x45b0('0x3f')]);_0x4b775e[_0x45b0('0x43')]=_[_0x45b0('0x44')](_0x360d98[_0x45b0('0x42')],qs['fields'](_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x45')]));_0x4b775e[_0x45b0('0x43')]=_0x4b775e[_0x45b0('0x43')]['length']?_0x4b775e[_0x45b0('0x43')]:_0x360d98['model'];if(!_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x46')](_0x45b0('0x47'))){_0x4b775e['limit']=qs[_0x45b0('0x48')](_0x2cfa0e['query'][_0x45b0('0x48')]);_0x4b775e[_0x45b0('0x22')]=qs['offset'](_0x2cfa0e[_0x45b0('0x3f')]['offset']);}_0x4b775e[_0x45b0('0x49')]=qs[_0x45b0('0x4a')](_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x4a')]);_0x4b775e[_0x45b0('0x4b')]=qs[_0x45b0('0x41')](_['pick'](_0x2cfa0e['query'],_0x360d98[_0x45b0('0x41')]));var _0x3f7eca=[];var _0x201274=squel[_0x45b0('0x4c')]()['field']('id')[_0x45b0('0x4d')](_0x45b0('0x2d'))['field'](_0x45b0('0x4e'))[_0x45b0('0x4f')]('tools_tags');var _0x256c5d=squel[_0x45b0('0x4c')]()[_0x45b0('0x4d')](_0x45b0('0x50'))[_0x45b0('0x4d')](_0x45b0('0x51'))[_0x45b0('0x4d')](_0x45b0('0x52'))[_0x45b0('0x4f')](_0x45b0('0x53'),'ui')[_0x45b0('0x54')](_0x45b0('0x55'),'u',_0x45b0('0x56'));var _0x587fb8=squel[_0x45b0('0x4c')]()[_0x45b0('0x4f')](_0x45b0('0x57'),'i')['left_join']('cm_contacts','c',_0x45b0('0x58'))[_0x45b0('0x54')]('users','o',_0x45b0('0x59'))['left_join'](_0x45b0('0x5a'),'a',_0x45b0('0x5b'))[_0x45b0('0x54')](_0x45b0('0x5c'),'me',_0x45b0('0x5d'))[_0x45b0('0x54')]('mail_interaction_has_tags','it',_0x45b0('0x5e'))[_0x45b0('0x54')](_0x45b0('0x5f'),'t',_0x45b0('0x60'));var _0x5e455d=squel[_0x45b0('0x61')]();var _0x35050c=[];var _0x6d6b0=squel[_0x45b0('0x61')]();var _0x4db12e;if(_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x62')]){_0x4db12e=as['parseSearch'](_0x2cfa0e['query'][_0x45b0('0x62')]);var _0x2b6e43=_0x4db12e['sqlOperator'];for(var _0x112262=0x0;_0x112262<_0x4db12e[_0x45b0('0x63')][_0x45b0('0x64')];_0x112262++){var _0x1d8cf1=_0x4db12e[_0x45b0('0x63')][_0x112262];var _0x580be7='i';var _0xba4c42=_['find'](_0x1abc79,[_0x45b0('0x2d'),_0x1d8cf1[_0x45b0('0x4d')]]);if(!_0xba4c42){switch(_0x1d8cf1['field']){case _0x45b0('0x65'):if(_0x1d8cf1[_0x45b0('0x66')]==0x1){_0x587fb8[_0x45b0('0x67')]('`'+_0x1d8cf1[_0x45b0('0x4d')]+_0x45b0('0x68'));}else{_0x587fb8[_0x45b0('0x67')]('`'+_0x1d8cf1['field']+_0x45b0('0x69'));}break;case _0x45b0('0x6a'):if(_0x1d8cf1[_0x45b0('0x6b')]===_0x45b0('0x6c')){if(_0x1d8cf1['value'][_0x45b0('0x33')]('\x20')['length']>0x1){_0x5e455d[_0x2b6e43]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x45b0('0x6d')](_0x1d8cf1[_0x45b0('0x66')]),null);}else{var _0x2517bd='%'+_0x1d8cf1['value']+'%';_0x5e455d[_0x2b6e43](_0x45b0('0x6e'),_0x2517bd,_0x2517bd,_0x2517bd);}}else{_0xba4c42=_[_0x45b0('0x6f')](_0x1abc79,['name',_0x45b0('0x70')]);_0x1d8cf1['field']=_0x45b0('0x70');_0x424eba=as[_0x45b0('0x71')](_0x580be7,_0xba4c42[_0x45b0('0x72')],_0x1d8cf1);_0x5e455d[_0x2b6e43](_0x424eba[_0x45b0('0x73')],_0x424eba[_0x45b0('0x66')][_0x45b0('0x74')],_0x424eba[_0x45b0('0x66')][_0x45b0('0x29')]);}break;case _0x45b0('0x75'):var _0x3eb3e4=_0x1d8cf1[_0x45b0('0x66')]['split'](',')[_0x45b0('0x30')](function(_0x385242){return Number(_0x385242);});_0x3eb3e4[_0x45b0('0x34')](function(_0xbd182d){_0x6d6b0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xbd182d+',%');});_0x35050c=_[_0x45b0('0x76')](_0x35050c,_0x3eb3e4);break;case _0x45b0('0x77'):if(_0x1d8cf1['operator']==='$substring'){_0x5e455d[_0x2b6e43](_0x45b0('0x78'),'%'+_0x1d8cf1[_0x45b0('0x66')]+'%',null);}else{_0xba4c42=_['find'](_0x1abc79,[_0x45b0('0x2d'),_0x45b0('0x79')]);_0x1d8cf1[_0x45b0('0x4d')]=_0x45b0('0x79');_0x424eba=as[_0x45b0('0x71')](_0x580be7,_0xba4c42[_0x45b0('0x72')],_0x1d8cf1);_0x5e455d[_0x2b6e43](_0x424eba[_0x45b0('0x73')],_0x424eba[_0x45b0('0x66')][_0x45b0('0x74')],_0x424eba['value']['end']);}break;case _0x45b0('0x7a'):_0x424eba=as[_0x45b0('0x71')]('me',null,_0x1d8cf1);_0x5e455d[_0x2b6e43](_0x424eba[_0x45b0('0x73')],_0x424eba[_0x45b0('0x66')][_0x45b0('0x74')],_0x424eba['value'][_0x45b0('0x29')]);break;}}else{var _0x424eba=as[_0x45b0('0x71')](_0x580be7,_0xba4c42[_0x45b0('0x72')],_0x1d8cf1);_0x5e455d[_0x2b6e43](_0x424eba[_0x45b0('0x73')],_0x424eba[_0x45b0('0x66')][_0x45b0('0x74')],_0x424eba['value']['end']);}}}else{var _0x28aad3=_(_0x2cfa0e[_0x45b0('0x3f')])[_0x45b0('0x40')]()['map'](function(_0x519b61){return _['some'](_0x1abc79,['name',_0x519b61])?_0x519b61:undefined;})[_0x45b0('0x7b')]()['value']();if(!_[_0x45b0('0x7c')](_0x28aad3)){_0x28aad3[_0x45b0('0x34')](function(_0x1715c9){if(_0x1715c9===_0x45b0('0x7d')){_0x587fb8[_0x45b0('0x4b')](_0x45b0('0x7e'),[]['concat'](_0x2cfa0e[_0x45b0('0x3f')][_0x1715c9]));}else if(_0x1715c9===_0x45b0('0x7f')){var _0x5de9e3=JSON[_0x45b0('0x80')](_0x2cfa0e['query'][_0x1715c9])[_0x45b0('0x81')];var _0x1f5092=JSON[_0x45b0('0x80')](_0x2cfa0e[_0x45b0('0x3f')][_0x1715c9])[_0x45b0('0x82')];_0x587fb8[_0x45b0('0x4b')](_0x45b0('0x83'),_0x5de9e3,_0x1f5092);}else{if(_0x2cfa0e[_0x45b0('0x3f')][_0x1715c9]===_0x45b0('0x84')){_0x587fb8[_0x45b0('0x4b')]('i.'+_0x1715c9+'\x20IS\x20NULL');}else{_0x587fb8['where']('i.'+_0x1715c9+'\x20=\x20?',_0x2cfa0e['query'][_0x1715c9]);}}});}if(_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x85')]){if(_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x85')]==0x1){_0x587fb8['having'](_0x45b0('0x86'));}else{_0x587fb8[_0x45b0('0x67')]('`unreadMessages`\x20>\x200');}}if(_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x87')]){_0x35050c=_[_0x45b0('0x88')](_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x87')])?_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x87')]:new Array(_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x87')]);_0x35050c[_0x45b0('0x34')](function(_0x304bea){_0x6d6b0['or'](_0x45b0('0x89'),'%,'+_0x304bea+',%');});}if(_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x8a')]){var _0xecda9a=_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x8a')][_0x45b0('0x8b')]('\x5c','\x5c\x5c')[_0x45b0('0x8b')]('\x27\x27',_0x45b0('0x8c'));if(qs[_0x45b0('0x8d')](_0xecda9a)){_0x5e455d['or'](_0x45b0('0x8e'),_0xecda9a+'%');}else if(qs[_0x45b0('0x8f')](_0xecda9a)){_0x5e455d['or'](_0x45b0('0x90'),_0xecda9a+'%');}else{_0x5e455d['or'](_0x45b0('0x91'),qs[_0x45b0('0x6d')](_0xecda9a))['or'](_0x45b0('0x92'),qs['getFullTextValue'](_0xecda9a));}}}_0x587fb8['where'](_0x5e455d);_0x587fb8[_0x45b0('0x93')](_0x45b0('0x94'));var _0x30fb62={'type':db[_0x45b0('0x95')][_0x45b0('0x96')][_0x45b0('0x97')],'raw':!![]};var _0x1cbb51=_0x587fb8['clone']();_0x1cbb51[_0x45b0('0x4d')](_0x45b0('0x94'));_0x1cbb51[_0x45b0('0x4d')](_0x45b0('0x98'),_0x45b0('0x65'));if(_0x4b775e[_0x45b0('0x49')]){_0x4b775e[_0x45b0('0x49')][_0x45b0('0x34')](function(_0x1f2a35){_0x587fb8[_0x45b0('0x49')]('i.'+_0x1f2a35[0x0],_0x1f2a35[0x1]==='DESC'?![]:!![]);});}if(!_[_0x45b0('0x7c')](_0x35050c)){_0x587fb8[_0x45b0('0x67')](_0x6d6b0);_0x1cbb51[_0x45b0('0x4b')]('t.id\x20IN\x20?',_0x35050c);}BPromise[_0x45b0('0x99')]()[_0x45b0('0x28')](function(){if(!_0x4db12e){if(_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x7d')]||_0x2cfa0e[_0x45b0('0x3f')][_0x45b0('0x9a')])return;_0x1cbb51[_0x45b0('0x4b')](_0x45b0('0x9b'));_0x587fb8['where'](_0x45b0('0x9b'));return;}return _0x2cfa0e[_0x45b0('0x9c')][_0x45b0('0x9d')]({'attributes':['id'],'raw':!![]})[_0x45b0('0x28')](function(_0x21b575){if(_[_0x45b0('0x7c')](_0x21b575)){_0x1cbb51[_0x45b0('0x4b')](_0x45b0('0x9e'));_0x587fb8[_0x45b0('0x4b')](_0x45b0('0x9e'));}else{_0x1cbb51[_0x45b0('0x4b')](_0x45b0('0x7e'),_[_0x45b0('0x30')](_0x21b575,'id'));_0x587fb8[_0x45b0('0x4b')](_0x45b0('0x7e'),_['map'](_0x21b575,'id'));}});})[_0x45b0('0x28')](function(){db[_0x45b0('0x9f')]['query'](_0x1cbb51[_0x45b0('0xa0')](),_0x30fb62)['then'](function(_0xf4a012){_0xc914aa['count']=_0xf4a012['length'];if(_0xc914aa['count']===0x0)return[];return db[_0x45b0('0x9f')]['query'](_0x201274[_0x45b0('0xa0')](),_0x30fb62)['then'](function(_0x34d7bb){_0x3f7eca=_[_0x45b0('0xa1')](_0x34d7bb,'id');_0x30fb62=_['merge'](_0x30fb62,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2cfa0e['query'][_0x45b0('0x45')]){_0x4b775e[_0x45b0('0x43')]['forEach'](function(_0x4aac63){_0x587fb8[_0x45b0('0x4d')]('i.'+_0x4aac63);});}else{_0x587fb8['field'](_0x45b0('0x98'),_0x45b0('0x65'));_0x587fb8['field'](_0x45b0('0xa2'),'Account.key');_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xa3'),'Account.mandatoryDisposition');_0x587fb8[_0x45b0('0x4d')](_0x45b0('0x94'));_0x587fb8['field'](_0x45b0('0xa4'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xa5'));_0x587fb8[_0x45b0('0x4d')]('i.closed');_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xa6'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xa7'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xa8'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xa9'));_0x587fb8[_0x45b0('0x4d')]('i.subject');_0x587fb8['field'](_0x45b0('0xaa'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xab'));_0x587fb8['field'](_0x45b0('0xac'));_0x587fb8[_0x45b0('0x4d')]('i.ContactId');_0x587fb8[_0x45b0('0x4d')]('i.MailAccountId');_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xad'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xae'),'Contact.firstName');_0x587fb8['field'](_0x45b0('0xaf'),_0x45b0('0xb0'));_0x587fb8[_0x45b0('0x4d')]('c.email',_0x45b0('0xb1'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xb2'),_0x45b0('0xb3'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xb4'),_0x45b0('0xb5'));_0x587fb8[_0x45b0('0x4d')]('c.fax',_0x45b0('0xb6'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xb7'),_0x45b0('0xb8'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xb9'),_0x45b0('0xba'));_0x587fb8[_0x45b0('0x4d')](_0x45b0('0xbb'),'TagIds');}_0x587fb8[_0x45b0('0x48')](_0x4b775e[_0x45b0('0x48')]);_0x587fb8['offset'](_0x4b775e[_0x45b0('0x22')]);return db['sequelize']['query'](_0x587fb8['toString'](),_0x30fb62);})['then'](function(_0x22ad9a){_0x256c5d['where']('ui.MailInteractionId\x20IN\x20?',_[_0x45b0('0x30')](_0x22ad9a,'id'));return db[_0x45b0('0x9f')][_0x45b0('0x3f')](_0x256c5d[_0x45b0('0xa0')](),_0x30fb62)[_0x45b0('0x28')](function(_0x2e9309){var _0x39ce35=_['groupBy'](_0x2e9309,'MailInteractionId');var _0x26c2c9=[];return db['Setting']['findOne']({'attributes':[_0x45b0('0xbc')],'raw':!![]})[_0x45b0('0x28')](function(_0x52d479){var _0x9044a=_0x52d479[_0x45b0('0xbc')];_0x22ad9a[_0x45b0('0x34')](function(_0x5dfbce){_0x26c2c9['push'](updateMailInteraction(_0x5dfbce,_0x3f7eca,_0x39ce35,_0x9044a));});return BPromise[_0x45b0('0xbd')](_0x26c2c9);});});});})[_0x45b0('0x28')](function(_0x3d9c96){_0xc914aa[_0x45b0('0xbe')]=_0x3d9c96;return _0xc914aa;})[_0x45b0('0x28')](respondWithFilteredResult(_0x31fe0e,_0x4b775e));})['catch'](handleError(_0x31fe0e,null));};exports[_0x45b0('0xbf')]=function(_0x2b2e91,_0x28cc2c){var _0x45a794={'raw':![],'where':{'id':_0x2b2e91[_0x45b0('0xc0')]['id']}},_0x9177ab={};_0x9177ab['model']=_['keys'](db[_0x45b0('0x36')][_0x45b0('0x3c')]);_0x9177ab[_0x45b0('0x3f')]=_[_0x45b0('0x40')](_0x2b2e91[_0x45b0('0x3f')]);_0x9177ab['filters']=_[_0x45b0('0x44')](_0x9177ab[_0x45b0('0x42')],_0x9177ab[_0x45b0('0x3f')]);_0x45a794[_0x45b0('0x43')]=_[_0x45b0('0x44')](_0x9177ab[_0x45b0('0x42')],qs['fields'](_0x2b2e91['query'][_0x45b0('0x45')]));_0x45a794[_0x45b0('0x43')]=_0x45a794[_0x45b0('0x43')][_0x45b0('0x64')]?_0x45a794[_0x45b0('0x43')]:_0x9177ab[_0x45b0('0x42')];if(_0x2b2e91[_0x45b0('0x3f')][_0x45b0('0xc1')]){_0x45a794[_0x45b0('0xc2')]=[{'all':!![]}];}_0x45a794=_[_0x45b0('0xc3')]({},_0x45a794,_0x2b2e91[_0x45b0('0xc4')]);return db['MailInteraction']['find'](_0x45a794)[_0x45b0('0x28')](handleEntityNotFound(_0x28cc2c,null))[_0x45b0('0x28')](respondWithResult(_0x28cc2c,null))[_0x45b0('0x3a')](handleError(_0x28cc2c,null));};exports[_0x45b0('0xc5')]=function(_0x308839,_0x57a84){return db[_0x45b0('0x36')]['create'](_0x308839['body'],{})['then'](respondWithResult(_0x57a84,0xc9))[_0x45b0('0x3a')](handleError(_0x57a84,null));};exports[_0x45b0('0xc6')]=function(_0x3bffce,_0x5e5a34){if(_0x3bffce[_0x45b0('0xc7')]['id']){delete _0x3bffce[_0x45b0('0xc7')]['id'];}return db[_0x45b0('0x36')][_0x45b0('0x6f')]({'where':{'id':_0x3bffce[_0x45b0('0xc0')]['id']}})[_0x45b0('0x28')](handleEntityNotFound(_0x5e5a34,null))['then'](saveUpdates(_0x3bffce[_0x45b0('0xc7')],null))['then'](respondWithResult(_0x5e5a34,null))['catch'](handleError(_0x5e5a34,null));};exports[_0x45b0('0xc8')]=function(_0x448fd2,_0x222a65){return db[_0x45b0('0x36')][_0x45b0('0x6f')]({'where':{'id':_0x448fd2[_0x45b0('0xc0')]['id']}})[_0x45b0('0x28')](handleEntityNotFound(_0x222a65,null))[_0x45b0('0x28')](removeEntity(_0x222a65,null))[_0x45b0('0x3a')](handleError(_0x222a65,null));};exports[_0x45b0('0xc9')]=function(_0x473d24,_0x4ece1c){return db['MailInteraction'][_0x45b0('0xc9')]()[_0x45b0('0x28')](respondWithResult(_0x4ece1c,null))[_0x45b0('0x3a')](handleError(_0x4ece1c,null));};exports[_0x45b0('0xca')]=function(_0x47d75a,_0x23bfe0,_0x5e869d){return db[_0x45b0('0xcb')][_0x45b0('0x6f')]({'where':{'id':_0x47d75a[_0x45b0('0xc0')]['id']}})[_0x45b0('0x28')](handleEntityNotFound(_0x23bfe0,null))[_0x45b0('0x28')](function(_0x581ca5){if(_0x581ca5){return _0x581ca5[_0x45b0('0xca')](_0x47d75a['body'][_0x45b0('0xcc')],_[_0x45b0('0xcd')](_0x47d75a['body'],['ids','id'])||{});}})[_0x45b0('0x28')](respondWithResult(_0x23bfe0,null))[_0x45b0('0x3a')](handleError(_0x23bfe0,null));};exports[_0x45b0('0xce')]=function(_0x3c6650,_0x57a839,_0x59ffd6){var _0x17cd54={'raw':![],'where':{}};var _0xc64edf={};var _0xbe3c7a={'count':0x0,'rows':[]};return db[_0x45b0('0x36')][_0x45b0('0xcf')]({'where':{'id':_0x3c6650[_0x45b0('0xc0')]['id']}})['then'](handleEntityNotFound(_0x57a839,null))[_0x45b0('0x28')](function(_0x380161){if(_0x380161){_0xc64edf[_0x45b0('0x42')]=_[_0x45b0('0x40')](db[_0x45b0('0xcb')][_0x45b0('0x3c')]);_0xc64edf[_0x45b0('0x3f')]=_[_0x45b0('0x40')](_0x3c6650[_0x45b0('0x3f')]);_0xc64edf[_0x45b0('0x41')]=_[_0x45b0('0x44')](_0xc64edf[_0x45b0('0x42')],_0xc64edf[_0x45b0('0x3f')]);_0x17cd54[_0x45b0('0x43')]=_[_0x45b0('0x44')](_0xc64edf[_0x45b0('0x42')],qs[_0x45b0('0x45')](_0x3c6650[_0x45b0('0x3f')]['fields']));_0x17cd54['attributes']=_0x17cd54[_0x45b0('0x43')]['length']?_0x17cd54[_0x45b0('0x43')]:_0xc64edf['model'];if(!_0x3c6650['query'][_0x45b0('0x46')](_0x45b0('0x47'))){_0x17cd54[_0x45b0('0x48')]=qs[_0x45b0('0x48')](_0x3c6650['query'][_0x45b0('0x48')]);_0x17cd54['offset']=qs[_0x45b0('0x22')](_0x3c6650[_0x45b0('0x3f')][_0x45b0('0x22')]);}_0x17cd54[_0x45b0('0x49')]=qs[_0x45b0('0x4a')](_0x3c6650[_0x45b0('0x3f')][_0x45b0('0x4a')]);_0x17cd54[_0x45b0('0x4b')]=qs[_0x45b0('0x41')](_[_0x45b0('0xd0')](_0x3c6650[_0x45b0('0x3f')],_0xc64edf[_0x45b0('0x41')]));_0x17cd54[_0x45b0('0x4b')][_0x45b0('0xd1')]=_0x380161['id'];if(_0x3c6650['query'][_0x45b0('0x8a')]){_0x17cd54[_0x45b0('0x4b')]=_[_0x45b0('0xc3')](_0x17cd54['where'],{'$or':_[_0x45b0('0x30')](_0x17cd54[_0x45b0('0x43')],function(_0x3ccddc){var _0x6ff16={};_0x6ff16[_0x3ccddc]={'$like':'%'+_0x3c6650[_0x45b0('0x3f')][_0x45b0('0x8a')]+'%'};return _0x6ff16;})});}if(_0x3c6650['query'][_0x45b0('0x81')]){var _0xebd2ce=_0x3c6650['query'][_0x45b0('0x81')][_0x45b0('0x33')](',');var _0x41ce7b={};_0x41ce7b[_0xebd2ce[0x0]]={'$gte':moment(_0xebd2ce[0x1])[_0x45b0('0xd2')](_0x45b0('0xd3'))};_0x17cd54['where']=_[_0x45b0('0xc3')](_0x17cd54[_0x45b0('0x4b')],_0x41ce7b);}_0x17cd54=_[_0x45b0('0xc3')]({},_0x17cd54,_0x3c6650[_0x45b0('0xc4')]);return db[_0x45b0('0xcb')][_0x45b0('0x21')]({'where':_0x17cd54[_0x45b0('0x4b')]})['then'](function(_0x59f917){_0xbe3c7a[_0x45b0('0x21')]=_0x59f917;if(_0x3c6650[_0x45b0('0x3f')][_0x45b0('0xc1')]){_0x17cd54['include']=[{'all':!![]}];}return db[_0x45b0('0xcb')][_0x45b0('0xd4')](_0x17cd54);})['then'](function(_0x216716){_0xbe3c7a[_0x45b0('0xbe')]=_0x216716;return _0xbe3c7a;});}})[_0x45b0('0x28')](respondWithFilteredResult(_0x57a839,_0x17cd54))[_0x45b0('0x3a')](handleError(_0x57a839,null));};exports[_0x45b0('0xd5')]=function(_0x2f2e91,_0x14765a,_0x3a5865){return db[_0x45b0('0x36')][_0x45b0('0x6f')]({'where':{'id':_0x2f2e91[_0x45b0('0xc0')]['id']}})[_0x45b0('0x28')](handleEntityNotFound(_0x14765a,null))[_0x45b0('0x28')](function(_0x2c7493){if(_0x2c7493){return _0x2c7493[_0x45b0('0xd6')](_0x2f2e91['body'][_0x45b0('0xcc')],_['omit'](_0x2f2e91[_0x45b0('0xc7')],[_0x45b0('0xcc'),'id'])||{})['spread'](function(){return db[_0x45b0('0x75')]['findAll']({'attributes':['id','name',_0x45b0('0x4e')],'where':{'id':_0x2f2e91['body'][_0x45b0('0xcc')]}});})[_0x45b0('0x28')](function(_0x1e02c4){socket['emit'](_0x45b0('0xd7'),{'id':Number(_0x2f2e91['params']['id']),'tags':_0x1e02c4||[]});return{'id':Number(_0x2f2e91[_0x45b0('0xc0')]['id']),'tags':_0x1e02c4||[]};});}})['then'](respondWithResult(_0x14765a,null))[_0x45b0('0x3a')](handleError(_0x14765a,null));};exports[_0x45b0('0xd8')]=function(_0x5839a5,_0xda7b62,_0xa17a59){return db[_0x45b0('0x36')][_0x45b0('0x6f')]({'where':{'id':_0x5839a5[_0x45b0('0xc0')]['id']}})[_0x45b0('0x28')](handleEntityNotFound(_0xda7b62,null))[_0x45b0('0x28')](function(_0x5f0cde){if(_0x5f0cde){return _0x5f0cde[_0x45b0('0xd8')](_0x5839a5[_0x45b0('0x3f')][_0x45b0('0xcc')]);}})['then'](respondWithStatusCode(_0xda7b62,null))[_0x45b0('0x3a')](handleError(_0xda7b62,null));};exports['download']=function(_0x123658,_0x1e1d02){var _0x5a9260=moment()[_0x45b0('0xd9')]()[_0x45b0('0xa0')]();var _0xa86e8f=path[_0x45b0('0xda')](config['root'],'server',_0x45b0('0xdb'),_0x45b0('0xdc'));var _0x4d45ef=path[_0x45b0('0xda')](config[_0x45b0('0xdd')],_0x45b0('0xde'),_0x45b0('0xdb'),'attachments');var _0x3d8026=path[_0x45b0('0xda')](_0xa86e8f,_0x5a9260);var _0x17e89e=util[_0x45b0('0xd2')]('transcript-%d-%s.zip',_0x123658[_0x45b0('0xc0')]['id'],_0x5a9260);var _0x33fa8e=path['join'](_0xa86e8f,_0x17e89e);var _0x3c192b=[];if(_0x123658[_0x45b0('0x3f')]['attachments']){_0x3c192b['push']({'model':db[_0x45b0('0xdf')],'as':'Attachments','raw':!![]});}var _0x46b0e4=[{'model':db[_0x45b0('0xcb')],'as':_0x45b0('0xe0'),'attributes':['id',_0x45b0('0xc7'),'from','to','cc',_0x45b0('0xe1'),_0x45b0('0xe2'),'createdAt'],'where':{'secret':![]},'order':qs[_0x45b0('0x4a')]('id'),'include':_0x3c192b}];return db['MailInteraction'][_0x45b0('0x6f')]({'where':{'id':_0x123658[_0x45b0('0xc0')]['id']},'include':_0x46b0e4})[_0x45b0('0x28')](handleEntityNotFound(_0x1e1d02,null))[_0x45b0('0x28')](function(_0x4e82e9){if(_0x4e82e9&&_0x4e82e9['Messages']){var _0x17668f=_0x4e82e9[_0x45b0('0xe3')]({'plain':!![]});fs['mkdirSync'](_0x3d8026);return BPromise[_0x45b0('0xe4')](_0x17668f['Messages'],function(_0x56b30b,_0x5c89d8){var _0x5ef546={'from':_0x56b30b['from'],'to':_0x56b30b['to'],'subject':_0x56b30b[_0x45b0('0xe2')],'html':_0x56b30b[_0x45b0('0xc7')],'headers':{'Date':moment(_0x56b30b['createdAt'])[_0x45b0('0xd2')](_0x45b0('0xe5'))},'attachments':[]};if(_0x56b30b['cc']){_0x5ef546[_0x45b0('0xe6')]['Cc']=_0x56b30b['cc'];}if(_0x56b30b[_0x45b0('0xe1')]){_0x5ef546[_0x45b0('0xe6')]['Bcc']=_0x56b30b[_0x45b0('0xe1')];}return new BPromise(function(_0xd5c7ac,_0x2320ef){if(_0x56b30b[_0x45b0('0xe7')]){for(var _0x3c996a=0x0;_0x3c996a<_0x56b30b[_0x45b0('0xe7')][_0x45b0('0x64')];_0x3c996a++){var _0x26f4da=_0x56b30b[_0x45b0('0xe7')][_0x3c996a];var _0x2f4c67=path[_0x45b0('0xda')](_0x4d45ef,_0x26f4da[_0x45b0('0xe8')]);if(fs[_0x45b0('0xe9')](_0x2f4c67)){_0x5ef546[_0x45b0('0xea')][_0x45b0('0x35')]({'name':_0x26f4da[_0x45b0('0x2d')],'contentType':_0x26f4da[_0x45b0('0x72')],'data':fs[_0x45b0('0xeb')](_0x2f4c67)});}}}emlformat[_0x45b0('0xec')](_0x5ef546,function(_0x3f41b6,_0xf58224){if(_0x3f41b6)return _0x2320ef(_0x3f41b6);fs[_0x45b0('0xed')](path[_0x45b0('0xda')](_0x3d8026,util[_0x45b0('0xd2')]('message%d.eml',_0x5c89d8)),_0xf58224);return _0xd5c7ac(_0xf58224);});});})[_0x45b0('0x28')](function(){return new BPromise(function(_0x3d8a47,_0x54fa95){zipdir(_0x3d8026,{'saveTo':_0x33fa8e},function(_0x380d83,_0x508e2f){if(_0x380d83)return _0x54fa95(_0x380d83);return _0x3d8a47(_0x508e2f);});})[_0x45b0('0x28')](function(){return new BPromise(function(_0x23b4ae,_0x52b725){rimraf(_0x3d8026,function(_0x196dc9){if(_0x196dc9)_0x52b725(_0x196dc9);return _0x23b4ae();});});})['then'](function(){return _0x1e1d02[_0x45b0('0xee')](_0x33fa8e,_0x17e89e,function(_0x37d029){if(_0x37d029){console[_0x45b0('0xef')](_0x45b0('0xf0'),_0x37d029);}else{fs[_0x45b0('0xf1')](_0x33fa8e);}});});});}else{return _0x1e1d02[_0x45b0('0x2a')](0xc8);}})[_0x45b0('0x3a')](handleError(_0x1e1d02,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 28c7c07..2b66bc4 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 _0xbb3e=['MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction'];(function(_0x1c3765,_0xc3b431){var _0x3ab003=function(_0x470393){while(--_0x470393){_0x1c3765['push'](_0x1c3765['shift']());}};_0x3ab003(++_0xc3b431);}(_0xbb3e,0x165));var _0xebb3=function(_0x18d1ff,_0x16cddc){_0x18d1ff=_0x18d1ff-0x0;var _0x25807f=_0xbb3e[_0x18d1ff];return _0x25807f;};'use strict';var EventEmitter=require(_0xebb3('0x0'));var MailInteraction=require(_0xebb3('0x1'))['db'][_0xebb3('0x2')];var MailMessage=require(_0xebb3('0x1'))['db'][_0xebb3('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xebb3('0x4')](0x0);var events={'afterCreate':_0xebb3('0x5'),'afterUpdate':_0xebb3('0x6'),'afterDestroy':_0xebb3('0x7')};function emitEvent(_0x43f1cf){return function(_0xc320b5,_0x5179f8,_0x4a3c00){_0xc320b5[_0xebb3('0x8')]({'attributes':['id'],'raw':!![]})[_0xebb3('0x9')](function(_0x5781dd){_0xc320b5[_0xebb3('0xa')](_0xebb3('0xb'),_0x5781dd[_0xebb3('0xc')](function(_0x9493a5){return{'id':_0x9493a5['id']};}));return MailMessage[_0xebb3('0xd')]({'where':{'MailInteractionId':_0xc320b5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xebb3('0x9')](function(_0x562f5b){_0xc320b5[_0xebb3('0xa')]('unreadMessages',_0x562f5b['length']);MailInteractionEvents[_0xebb3('0xe')](_0x43f1cf+':'+_0xc320b5['id'],_0xc320b5);MailInteractionEvents[_0xebb3('0xe')](_0x43f1cf,_0xc320b5);_0x4a3c00(null);})['catch'](_0x4a3c00(null));};}for(var e in events){if(events[_0xebb3('0xf')](e)){var event=events[e];MailInteraction[_0xebb3('0x10')](e,emitEvent(event));}}module[_0xebb3('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x2a6e=['findAll','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','update','remove','getUsers','then','setDataValue','Users'];(function(_0x28162d,_0x1b4787){var _0x598267=function(_0xa0bdc3){while(--_0xa0bdc3){_0x28162d['push'](_0x28162d['shift']());}};_0x598267(++_0x1b4787);}(_0x2a6e,0x176));var _0xe2a6=function(_0x5cb71b,_0x14fdc1){_0x5cb71b=_0x5cb71b-0x0;var _0x14c5a2=_0x2a6e[_0x5cb71b];return _0x14c5a2;};'use strict';var EventEmitter=require(_0xe2a6('0x0'));var MailInteraction=require(_0xe2a6('0x1'))['db'][_0xe2a6('0x2')];var MailMessage=require(_0xe2a6('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xe2a6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe2a6('0x4'),'afterDestroy':_0xe2a6('0x5')};function emitEvent(_0x1746da){return function(_0x4410a0,_0x4ea4a4,_0xd7dfce){_0x4410a0[_0xe2a6('0x6')]({'attributes':['id'],'raw':!![]})[_0xe2a6('0x7')](function(_0x2c747f){_0x4410a0[_0xe2a6('0x8')](_0xe2a6('0x9'),_0x2c747f['map'](function(_0x1fa4d5){return{'id':_0x1fa4d5['id']};}));return MailMessage[_0xe2a6('0xa')]({'where':{'MailInteractionId':_0x4410a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe2a6('0x7')](function(_0x528e83){_0x4410a0['setDataValue']('unreadMessages',_0x528e83[_0xe2a6('0xb')]);MailInteractionEvents[_0xe2a6('0xc')](_0x1746da+':'+_0x4410a0['id'],_0x4410a0);MailInteractionEvents['emit'](_0x1746da,_0x4410a0);_0xd7dfce(null);})['catch'](_0xd7dfce(null));};}for(var e in events){if(events[_0xe2a6('0xd')](e)){var event=events[e];MailInteraction[_0xe2a6('0xe')](e,emitEvent(event));}}module[_0xe2a6('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 9074450..472c1ad 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 _0xca5a=['mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','closed','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction'];(function(_0x485038,_0x3e26e8){var _0xa87ace=function(_0x1cf247){while(--_0x1cf247){_0x485038['push'](_0x485038['shift']());}};_0xa87ace(++_0x3e26e8);}(_0xca5a,0x82));var _0xaca5=function(_0x211312,_0x53cd82){_0x211312=_0x211312-0x0;var _0x249168=_0xca5a[_0x211312];return _0x249168;};'use strict';var _=require('lodash');var util=require(_0xaca5('0x0'));var logger=require('../../config/logger')(_0xaca5('0x1'));var moment=require(_0xaca5('0x2'));var BPromise=require(_0xaca5('0x3'));var rp=require(_0xaca5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaca5('0x5'));var config=require(_0xaca5('0x6'));var attributes=require(_0xaca5('0x7'));module['exports']=function(_0x46904a,_0x273091){return _0x46904a[_0xaca5('0x8')](_0xaca5('0x9'),attributes,{'tableName':_0xaca5('0xa'),'paranoid':![],'indexes':[{'name':_0xaca5('0xb'),'fields':['subject','to'],'type':_0xaca5('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x50a6c8,_0x367b3f,_0x29b966){if(_0x50a6c8['substatus']){_0x50a6c8[_0xaca5('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x50a6c8['closed']){_0x50a6c8[_0xaca5('0xe')]=moment()[_0xaca5('0xf')](_0xaca5('0x10'));}_0x29b966(null,_0x367b3f);},'beforeUpdate':function(_0x15091d,_0x4e5b90,_0x27b10a){if(_0x15091d[_0xaca5('0x11')](_0xaca5('0x12'))){_0x15091d[_0xaca5('0xd')]=_0x15091d[_0xaca5('0x12')]?moment()['format'](_0xaca5('0x10')):null;}if(_0x15091d['changed'](_0xaca5('0x13'))){_0x15091d[_0xaca5('0xe')]=moment()[_0xaca5('0xf')](_0xaca5('0x10'));_0x15091d[_0xaca5('0x12')]=null;_0x15091d[_0xaca5('0xd')]=null;}_0x27b10a(null,_0x15091d);},'afterUpdate':function(_0x24fe81,_0xd11a5c,_0x2a2684){var _0x418cef=_0x46904a[_0xaca5('0x14')];var _0x3c17a3=_0x24fe81[_0xaca5('0x15')]({'plain':!![]});if(_0x3c17a3[_0xaca5('0x13')]){return _0x418cef[_0xaca5('0x16')][_0xaca5('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x3c17a3['id']}})[_0xaca5('0x18')](function(){_0x2a2684();})[_0xaca5('0x19')](function(_0xf4ed86){_0x2a2684(_0xf4ed86);});}else{_0x2a2684();}}},'charset':_0xaca5('0x1a'),'collate':_0xaca5('0x1b')});}; \ No newline at end of file +var _0xc678=['format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','get','closed','MailMessage','then','catch','utf8mb4','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt'];(function(_0x8a4d1b,_0x523634){var _0x642aad=function(_0x162e41){while(--_0x162e41){_0x8a4d1b['push'](_0x8a4d1b['shift']());}};_0x642aad(++_0x523634);}(_0xc678,0x1b4));var _0x8c67=function(_0x544cbe,_0x414e7c){_0x544cbe=_0x544cbe-0x0;var _0x732aa4=_0xc678[_0x544cbe];return _0x732aa4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c67('0x0'))(_0x8c67('0x1'));var moment=require(_0x8c67('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c67('0x3'));var fs=require('fs');var path=require(_0x8c67('0x4'));var rimraf=require(_0x8c67('0x5'));var config=require(_0x8c67('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x8c67('0x7')]=function(_0x5cdb40,_0x351c21){return _0x5cdb40[_0x8c67('0x8')]('MailInteraction',attributes,{'tableName':_0x8c67('0x9'),'paranoid':![],'indexes':[{'name':_0x8c67('0xa'),'fields':[_0x8c67('0xb'),'to'],'type':_0x8c67('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f516c,_0x5bac97,_0x2c0eba){if(_0x3f516c['substatus']){_0x3f516c[_0x8c67('0xd')]=moment()[_0x8c67('0xe')](_0x8c67('0xf'));}if(_0x3f516c['closed']){_0x3f516c[_0x8c67('0x10')]=moment()[_0x8c67('0xe')](_0x8c67('0xf'));}_0x2c0eba(null,_0x5bac97);},'beforeUpdate':function(_0x2685f1,_0x48e1ca,_0x2feeb5){if(_0x2685f1['changed']('substatus')){_0x2685f1['substatusAt']=_0x2685f1['substatus']?moment()[_0x8c67('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2685f1[_0x8c67('0x11')]('closed')){_0x2685f1[_0x8c67('0x10')]=moment()[_0x8c67('0xe')](_0x8c67('0xf'));_0x2685f1[_0x8c67('0x12')]=null;_0x2685f1['substatusAt']=null;}_0x2feeb5(null,_0x2685f1);},'afterUpdate':function(_0x3be259,_0x34e195,_0x29af25){var _0x1bae2f=_0x5cdb40['models'];var _0x4dbd5c=_0x3be259[_0x8c67('0x13')]({'plain':!![]});if(_0x4dbd5c[_0x8c67('0x14')]){return _0x1bae2f[_0x8c67('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x4dbd5c['id']}})[_0x8c67('0x16')](function(){_0x29af25();})[_0x8c67('0x17')](function(_0x4ded50){_0x29af25(_0x4ded50);});}else{_0x29af25();}}},'charset':_0x8c67('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index fd10609..1261bde 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 _0xcab6=['then','MailInteraction,\x20%s,\x20%s','debug','error','code','message','info','result','catch','UpdateMailInteraction','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','ids','spread','AddTags','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcab6,0xd4));var _0x6cab=function(_0x3d1981,_0x24dd7e){_0x3d1981=_0x3d1981-0x0;var _0x27c27d=_0xcab6[_0x3d1981];return _0x27c27d;};'use strict';var _=require(_0x6cab('0x0'));var util=require('util');var moment=require(_0x6cab('0x1'));var BPromise=require(_0x6cab('0x2'));var rs=require(_0x6cab('0x3'));var fs=require('fs');var Redis=require(_0x6cab('0x4'));var db=require(_0x6cab('0x5'))['db'];var utils=require(_0x6cab('0x6'));var logger=require('../../config/logger')(_0x6cab('0x7'));var config=require('../../config/environment');var jayson=require(_0x6cab('0x8'));var client=jayson[_0x6cab('0x9')][_0x6cab('0xa')]({'port':0x232a});config['redis']=_[_0x6cab('0xb')](config[_0x6cab('0xc')],{'host':_0x6cab('0xd'),'port':0x18eb});var socket=require(_0x6cab('0xe'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x6cab('0xf')](socket);function respondWithRpcPromise(_0x37f00d,_0x2aa304,_0x3ff1c6){return new BPromise(function(_0x161b9c,_0xe1e146){return client['request'](_0x37f00d,_0x3ff1c6)[_0x6cab('0x10')](function(_0x52acfe){logger['info'](_0x6cab('0x11'),_0x2aa304,'request\x20sent');logger[_0x6cab('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x2aa304,'request\x20sent',JSON['stringify'](_0x52acfe));if(_0x52acfe['error']){if(_0x52acfe[_0x6cab('0x13')][_0x6cab('0x14')]===0x1f4){logger[_0x6cab('0x13')](_0x6cab('0x11'),_0x2aa304,_0x52acfe[_0x6cab('0x13')][_0x6cab('0x15')]);return _0xe1e146(_0x52acfe[_0x6cab('0x13')][_0x6cab('0x15')]);}logger[_0x6cab('0x13')](_0x6cab('0x11'),_0x2aa304,_0x52acfe[_0x6cab('0x13')][_0x6cab('0x15')]);return _0x161b9c(_0x52acfe[_0x6cab('0x13')]['message']);}else{logger[_0x6cab('0x16')](_0x6cab('0x11'),_0x2aa304,'request\x20sent');_0x161b9c(_0x52acfe[_0x6cab('0x17')][_0x6cab('0x15')]);}})[_0x6cab('0x18')](function(_0x12f120){logger['error']('MailInteraction,\x20%s,\x20%s',_0x2aa304,_0x12f120);_0xe1e146(_0x12f120);});});}exports[_0x6cab('0x19')]=function(_0x1320c3){var _0x1b5565=this;return new Promise(function(_0x2986e6,_0xa36dad){return db['MailInteraction']['update'](_0x1320c3[_0x6cab('0x1a')],{'raw':_0x1320c3['options']?_0x1320c3[_0x6cab('0x1b')][_0x6cab('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1320c3[_0x6cab('0x1b')]?_0x1320c3[_0x6cab('0x1b')][_0x6cab('0x1d')]||null:null,'attributes':_0x1320c3[_0x6cab('0x1b')]?_0x1320c3[_0x6cab('0x1b')][_0x6cab('0x1e')]||null:null,'limit':_0x1320c3[_0x6cab('0x1b')]?_0x1320c3[_0x6cab('0x1b')][_0x6cab('0x1f')]||null:null})[_0x6cab('0x10')](function(_0xbfbeca){logger['info']('UpdateMailInteraction',_0x1320c3);logger['debug']('UpdateMailInteraction',_0x1320c3,JSON['stringify'](_0xbfbeca));_0x2986e6(_0xbfbeca);})[_0x6cab('0x18')](function(_0x27a6b5){logger[_0x6cab('0x13')]('UpdateMailInteraction',_0x27a6b5[_0x6cab('0x15')],_0x1320c3);_0xa36dad(_0x1b5565[_0x6cab('0x13')](0x1f4,_0x27a6b5[_0x6cab('0x15')]));});});};exports[_0x6cab('0x20')]=function(_0x5ed564){return new Promise(function(_0x3b2690,_0x3c5de1){return db['MailInteraction'][_0x6cab('0x21')]({'where':_0x5ed564['options']?_0x5ed564[_0x6cab('0x1b')]['where']||null:null})['then'](function(_0x3e485e){if(_0x3e485e){return _0x3e485e['addTags'](_0x5ed564[_0x6cab('0x1a')][_0x6cab('0x22')],_['omit'](_0x5ed564['body'],[_0x6cab('0x22'),'id'])||{});}})[_0x6cab('0x23')](function(_0xd4a4c4){logger['info']('AddTags',_0x5ed564);logger[_0x6cab('0x12')](_0x6cab('0x24'),_0x5ed564,JSON[_0x6cab('0x25')](_0xd4a4c4));_0x3b2690(_0xd4a4c4);})[_0x6cab('0x18')](function(_0x61b4c8){logger[_0x6cab('0x13')](_0x6cab('0x24'),_0x61b4c8[_0x6cab('0x15')],_0x5ed564);_0x3c5de1(_this['error'](0x1f4,_0x61b4c8['message']));});});}; \ No newline at end of file +var _0xaf1d=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','update','body','options','raw','where','limit','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0x23acf3,_0x3f4b12){var _0x46e46a=function(_0x4f37de){while(--_0x4f37de){_0x23acf3['push'](_0x23acf3['shift']());}};_0x46e46a(++_0x3f4b12);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x55d561,_0x13ff73){_0x55d561=_0x55d561-0x0;var _0x5b3703=_0xaf1d[_0x55d561];return _0x5b3703;};'use strict';var _=require(_0xdaf1('0x0'));var util=require(_0xdaf1('0x1'));var moment=require(_0xdaf1('0x2'));var BPromise=require(_0xdaf1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdaf1('0x4'));var db=require(_0xdaf1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaf1('0x6'))(_0xdaf1('0x7'));var config=require(_0xdaf1('0x8'));var jayson=require(_0xdaf1('0x9'));var client=jayson[_0xdaf1('0xa')][_0xdaf1('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdaf1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdaf1('0xd'))[_0xdaf1('0xe')](socket);function respondWithRpcPromise(_0x119ba5,_0x2b42d7,_0x5eba76){return new BPromise(function(_0xe8e6e9,_0x42e2bc){return client[_0xdaf1('0xf')](_0x119ba5,_0x5eba76)[_0xdaf1('0x10')](function(_0x1eb10d){logger['info'](_0xdaf1('0x11'),_0x2b42d7,_0xdaf1('0x12'));logger[_0xdaf1('0x13')](_0xdaf1('0x14'),_0x2b42d7,_0xdaf1('0x12'),JSON[_0xdaf1('0x15')](_0x1eb10d));if(_0x1eb10d[_0xdaf1('0x16')]){if(_0x1eb10d[_0xdaf1('0x16')][_0xdaf1('0x17')]===0x1f4){logger[_0xdaf1('0x16')](_0xdaf1('0x11'),_0x2b42d7,_0x1eb10d[_0xdaf1('0x16')][_0xdaf1('0x18')]);return _0x42e2bc(_0x1eb10d['error'][_0xdaf1('0x18')]);}logger[_0xdaf1('0x16')]('MailInteraction,\x20%s,\x20%s',_0x2b42d7,_0x1eb10d[_0xdaf1('0x16')]['message']);return _0xe8e6e9(_0x1eb10d[_0xdaf1('0x16')][_0xdaf1('0x18')]);}else{logger[_0xdaf1('0x19')]('MailInteraction,\x20%s,\x20%s',_0x2b42d7,_0xdaf1('0x12'));_0xe8e6e9(_0x1eb10d['result']['message']);}})[_0xdaf1('0x1a')](function(_0x10ed1f){logger[_0xdaf1('0x16')](_0xdaf1('0x11'),_0x2b42d7,_0x10ed1f);_0x42e2bc(_0x10ed1f);});});}exports['UpdateMailInteraction']=function(_0x548a86){var _0x214265=this;return new Promise(function(_0xdedca2,_0x37b377){return db['MailInteraction'][_0xdaf1('0x1b')](_0x548a86[_0xdaf1('0x1c')],{'raw':_0x548a86[_0xdaf1('0x1d')]?_0x548a86[_0xdaf1('0x1d')][_0xdaf1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x548a86[_0xdaf1('0x1d')]?_0x548a86[_0xdaf1('0x1d')][_0xdaf1('0x1f')]||null:null,'attributes':_0x548a86[_0xdaf1('0x1d')]?_0x548a86[_0xdaf1('0x1d')]['attributes']||null:null,'limit':_0x548a86[_0xdaf1('0x1d')]?_0x548a86[_0xdaf1('0x1d')][_0xdaf1('0x20')]||null:null})['then'](function(_0x4b12a9){logger['info']('UpdateMailInteraction',_0x548a86);logger[_0xdaf1('0x13')](_0xdaf1('0x21'),_0x548a86,JSON['stringify'](_0x4b12a9));_0xdedca2(_0x4b12a9);})[_0xdaf1('0x1a')](function(_0x3c2166){logger[_0xdaf1('0x16')]('UpdateMailInteraction',_0x3c2166[_0xdaf1('0x18')],_0x548a86);_0x37b377(_0x214265[_0xdaf1('0x16')](0x1f4,_0x3c2166['message']));});});};exports[_0xdaf1('0x22')]=function(_0xb26499){return new Promise(function(_0x40ad41,_0x3892ae){return db[_0xdaf1('0x23')][_0xdaf1('0x24')]({'where':_0xb26499['options']?_0xb26499[_0xdaf1('0x1d')][_0xdaf1('0x1f')]||null:null})['then'](function(_0x4c043f){if(_0x4c043f){return _0x4c043f[_0xdaf1('0x25')](_0xb26499[_0xdaf1('0x1c')][_0xdaf1('0x26')],_['omit'](_0xb26499[_0xdaf1('0x1c')],[_0xdaf1('0x26'),'id'])||{});}})[_0xdaf1('0x27')](function(_0x415a28){logger[_0xdaf1('0x19')]('AddTags',_0xb26499);logger[_0xdaf1('0x13')](_0xdaf1('0x28'),_0xb26499,JSON[_0xdaf1('0x15')](_0x415a28));_0x40ad41(_0x415a28);})['catch'](function(_0x47ee37){logger[_0xdaf1('0x16')]('AddTags',_0x47ee37[_0xdaf1('0x18')],_0xb26499);_0x3892ae(_this[_0xdaf1('0x16')](0x1f4,_0x47ee37[_0xdaf1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 0dc7b41..a543ce9 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 _0xe6a5=['./mailInteraction.events','remove','emit','register','length','mailInteraction:'];(function(_0x51942a,_0x3bd294){var _0x2ad705=function(_0x111eaf){while(--_0x111eaf){_0x51942a['push'](_0x51942a['shift']());}};_0x2ad705(++_0x3bd294);}(_0xe6a5,0x102));var _0x5e6a=function(_0x515fe7,_0x56e851){_0x515fe7=_0x515fe7-0x0;var _0x33f45f=_0xe6a5[_0x515fe7];return _0x33f45f;};'use strict';var MailInteractionEvents=require(_0x5e6a('0x0'));var events=['save',_0x5e6a('0x1'),'update'];function createListener(_0x1bcb41,_0xd7a33e){return function(_0x47dc10){_0xd7a33e[_0x5e6a('0x2')](_0x1bcb41,_0x47dc10);};}function removeListener(_0x2e55f3,_0x34a18e){return function(){MailInteractionEvents['removeListener'](_0x2e55f3,_0x34a18e);};}exports[_0x5e6a('0x3')]=function(_0x154076){for(var _0x23dbd8=0x0,_0x4c376b=events[_0x5e6a('0x4')];_0x23dbd8<_0x4c376b;_0x23dbd8++){var _0x5c33ad=events[_0x23dbd8];var _0x1bdfd2=createListener(_0x5e6a('0x5')+_0x5c33ad,_0x154076);MailInteractionEvents['on'](_0x5c33ad,_0x1bdfd2);}}; \ No newline at end of file +var _0x9e92=['removeListener','register','length','./mailInteraction.events','save','remove'];(function(_0x5d23d5,_0x252dcd){var _0x588b2a=function(_0xe059cf){while(--_0xe059cf){_0x5d23d5['push'](_0x5d23d5['shift']());}};_0x588b2a(++_0x252dcd);}(_0x9e92,0x129));var _0x29e9=function(_0x32d3d0,_0x264a20){_0x32d3d0=_0x32d3d0-0x0;var _0x1725c4=_0x9e92[_0x32d3d0];return _0x1725c4;};'use strict';var MailInteractionEvents=require(_0x29e9('0x0'));var events=[_0x29e9('0x1'),_0x29e9('0x2'),'update'];function createListener(_0x2233c4,_0x34033a){return function(_0x3746ea){_0x34033a['emit'](_0x2233c4,_0x3746ea);};}function removeListener(_0x1b88ec,_0x2146ae){return function(){MailInteractionEvents[_0x29e9('0x3')](_0x1b88ec,_0x2146ae);};}exports[_0x29e9('0x4')]=function(_0x4d0f3a){for(var _0xf7eab1=0x0,_0x479c96=events[_0x29e9('0x5')];_0xf7eab1<_0x479c96;_0xf7eab1++){var _0x131a77=events[_0xf7eab1];var _0x3594df=createListener('mailInteraction:'+_0x131a77,_0x4d0f3a);MailInteractionEvents['on'](_0x131a77,_0x3594df);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d6366d1..c74f910 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 _0xbec5=['/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','put','/:id/accept','accept'];(function(_0x3acf30,_0x423b34){var _0x3d4fac=function(_0x2201de){while(--_0x2201de){_0x3acf30['push'](_0x3acf30['shift']());}};_0x3d4fac(++_0x423b34);}(_0xbec5,0xe5));var _0x5bec=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0xbec5[_0x509273];return _0x38ef40;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var auth=require(_0x5bec('0x5'));var interaction=require(_0x5bec('0x6'));var config=require('../../config/environment');var controller=require(_0x5bec('0x7'));router[_0x5bec('0x8')]('/',auth[_0x5bec('0x9')](),controller['index']);router[_0x5bec('0x8')](_0x5bec('0xa'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xb')]);router[_0x5bec('0x8')](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xd')]);router['get'](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0xf')]);router[_0x5bec('0x10')]('/',auth[_0x5bec('0x9')](),interaction['tracked'](_0x5bec('0x11'),_0x5bec('0x12')),controller[_0x5bec('0x13')]);router['put'](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller['update']);router[_0x5bec('0x14')](_0x5bec('0x15'),auth[_0x5bec('0x9')](),controller[_0x5bec('0x16')]);router[_0x5bec('0x14')](_0x5bec('0x17'),auth[_0x5bec('0x9')](),controller[_0x5bec('0x18')]);router[_0x5bec('0x19')](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller[_0x5bec('0x1a')]);module[_0x5bec('0x1b')]=router; \ No newline at end of file +var _0x9957=['download','post','mail','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./mailMessage.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),interaction['tracked'](_0x7995('0x11'),_0x7995('0x12')),controller['create']);router[_0x7995('0x13')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x13')](_0x7995('0x15'),auth[_0x7995('0x9')](),controller['accept']);router['put'](_0x7995('0x16'),auth[_0x7995('0x9')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x19')]);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 3094e2b..9b08f33 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 _0x49c1=['exports','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49c1,0xef));var _0x149c=function(_0x41ad60,_0x29377f){_0x41ad60=_0x41ad60-0x0;var _0x5dd814=_0x49c1[_0x41ad60];return _0x5dd814;};'use strict';var Sequelize=require(_0x149c('0x0'));var _=require('lodash');module[_0x149c('0x1')]={'body':{'type':Sequelize[_0x149c('0x2')](_0x149c('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x149c('0x4'))},'read':{'type':Sequelize[_0x149c('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x149c('0x6')),'defaultValue':_0x149c('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x149c('0x7')]},'to':{'type':Sequelize['TEXT'](_0x149c('0x3'))},'cc':{'type':Sequelize[_0x149c('0x2')]('long')},'bcc':{'type':Sequelize[_0x149c('0x2')](_0x149c('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x149c('0x8')]},'attach':{'type':Sequelize[_0x149c('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x149c('0x8')]},'originTo':{'type':Sequelize[_0x149c('0x2')](_0x149c('0x3'))},'originCc':{'type':Sequelize[_0x149c('0x2')]('long')}}; \ No newline at end of file +var _0x0f97=['lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','DATE','INTEGER','sequelize'];(function(_0x4ef11c,_0x387510){var _0x1c3026=function(_0x582d43){while(--_0x582d43){_0x4ef11c['push'](_0x4ef11c['shift']());}};_0x1c3026(++_0x387510);}(_0x0f97,0x196));var _0x70f9=function(_0x40570e,_0x53df30){_0x40570e=_0x40570e-0x0;var _0x16336a=_0x0f97[_0x40570e];return _0x16336a;};'use strict';var Sequelize=require(_0x70f9('0x0'));var _=require(_0x70f9('0x1'));module[_0x70f9('0x2')]={'body':{'type':Sequelize[_0x70f9('0x3')](_0x70f9('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x70f9('0x3')](_0x70f9('0x5'))},'read':{'type':Sequelize[_0x70f9('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x70f9('0x7')]('in',_0x70f9('0x8')),'defaultValue':_0x70f9('0x8'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x70f9('0x3')](_0x70f9('0x4'))},'cc':{'type':Sequelize[_0x70f9('0x3')](_0x70f9('0x4'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x70f9('0x3')]},'sentAt':{'type':Sequelize[_0x70f9('0x9')]},'attach':{'type':Sequelize[_0x70f9('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x70f9('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize['TEXT'](_0x70f9('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 8887611..bfada89 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 _0x67f5=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','test','Sequelize','ValidationError','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','stack','name','MailMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','body','find','params','create','direction','out','secret','split','findOne','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','server/files/attachments','basename','List','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail-interactions','accept','mail','read','UserId','Contact','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','role','AcceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','agent','get','event','rejectmessage','download','unix','server','files','message-%s.eml','bcc','createdAt','Attachment','Attachments','from','subject','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x9579a9,_0x3bbac4){var _0x3d31fb=function(_0x254466){while(--_0x254466){_0x9579a9['push'](_0x9579a9['shift']());}};_0x3d31fb(++_0x3bbac4);}(_0x67f5,0x99));var _0x567f=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x67f5[_0x12d033];return _0x3b4e80;};'use strict';var pdf=require(_0x567f('0x0'));var emlformat=require(_0x567f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x567f('0x2'));var rp=require(_0x567f('0x3'));var moment=require(_0x567f('0x4'));var BPromise=require(_0x567f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x567f('0x6'));var sox=require(_0x567f('0x7'));var csv=require('to-csv');var ejs=require(_0x567f('0x8'));var fs=require('fs');var _=require(_0x567f('0x9'));var squel=require(_0x567f('0xa'));var crypto=require('crypto');var jsforce=require(_0x567f('0xb'));var deskjs=require(_0x567f('0xc'));var toCsv=require(_0x567f('0xd'));var querystring=require(_0x567f('0xe'));var Papa=require(_0x567f('0xf'));var Redis=require(_0x567f('0x10'));var authService=require(_0x567f('0x11'));var qs=require(_0x567f('0x12'));var as=require(_0x567f('0x13'));var hardwareService=require(_0x567f('0x14'));var logger=require(_0x567f('0x15'))(_0x567f('0x16'));var utils=require(_0x567f('0x17'));var config=require(_0x567f('0x18'));var db=require(_0x567f('0x19'))['db'];config[_0x567f('0x1a')]=_[_0x567f('0x1b')](config[_0x567f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x567f('0x1c'))(new Redis(config[_0x567f('0x1a')]));require(_0x567f('0x1d'))[_0x567f('0x1e')](socket);var jayson=require(_0x567f('0x1f'));var client=jayson['client'][_0x567f('0x20')]({'port':0x232c});var client9003=jayson[_0x567f('0x21')]['http']({'port':0x232b});var client9002=jayson[_0x567f('0x21')]['http']({'port':0x232a});function checkPasswordPattern(_0x395d6c,_0xf0fb55,_0x3322eb){if(_0x3322eb){var _0x1ed15e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ed15e[_0x567f('0x22')](_0xf0fb55)){return _0x395d6c;}else{throw new db[(_0x567f('0x23'))][(_0x567f('0x24'))]('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 _0x395d6c;}}function respondWithRpcPromise(_0xf27b39,_0x41897c,_0x56a24c,_0x1dcd5a){return new BPromise(function(_0x53f9a9,_0x37bf2c){var _0x59fe7c=_0x1dcd5a||client;return _0x59fe7c[_0x567f('0x25')](_0xf27b39,_0x56a24c)[_0x567f('0x26')](function(_0x194f35){logger[_0x567f('0x27')](_0x567f('0x28'),_0x41897c,'request\x20sent');logger[_0x567f('0x29')](_0x567f('0x2a'),_0x41897c,_0x567f('0x2b'),JSON['stringify'](_0x194f35));if(_0x194f35['error']){if(_0x194f35['error'][_0x567f('0x2c')]===0x1f4){logger[_0x567f('0x2d')](_0x567f('0x28'),_0x41897c,_0x194f35[_0x567f('0x2d')][_0x567f('0x2e')]);return _0x37bf2c(_0x194f35[_0x567f('0x2d')][_0x567f('0x2e')]);}logger['error'](_0x567f('0x28'),_0x41897c,_0x194f35['error'][_0x567f('0x2e')]);return _0x53f9a9(_0x194f35[_0x567f('0x2d')][_0x567f('0x2e')]);}else{logger[_0x567f('0x27')](_0x567f('0x28'),_0x41897c,_0x567f('0x2b'));_0x53f9a9(_0x194f35[_0x567f('0x2f')][_0x567f('0x2e')]);}})['catch'](function(_0x311625){logger['error'](_0x567f('0x28'),_0x41897c,_0x311625);_0x37bf2c(_0x311625);});});}function respondWithStatusCode(_0x5d3a5d,_0x606d51){_0x606d51=_0x606d51||0xcc;return function(_0x406a36){if(_0x406a36){return _0x5d3a5d[_0x567f('0x30')](_0x606d51);}return _0x5d3a5d[_0x567f('0x31')](_0x606d51)[_0x567f('0x32')]();};}function respondWithResult(_0x20d5cc,_0x5371e6){_0x5371e6=_0x5371e6||0xc8;return function(_0x5710a8){if(_0x5710a8){return _0x20d5cc['status'](_0x5371e6)[_0x567f('0x33')](_0x5710a8);}};}function respondWithFilteredResult(_0x4fd3e7,_0x1e1952){return function(_0x1c20d9){if(_0x1c20d9){var _0x36c49c=_0x1c20d9[_0x567f('0x34')],_0x5bb4df=_0x1e1952[_0x567f('0x35')],_0x3f422c=_0x1e1952[_0x567f('0x35')]+_0x1e1952['limit'],_0x2f308f;if(_0x3f422c>=_0x36c49c){_0x3f422c=_0x36c49c;_0x2f308f=0xc8;}else{_0x2f308f=0xce;}_0x4fd3e7[_0x567f('0x31')](_0x2f308f);return _0x4fd3e7[_0x567f('0x36')](_0x567f('0x37'),_0x5bb4df+'-'+_0x3f422c+'/'+_0x36c49c)[_0x567f('0x33')](_0x1c20d9);}return null;};}function patchUpdates(_0x1cea6a){return function(_0x517eae){try{jsonpatch[_0x567f('0x38')](_0x517eae,_0x1cea6a,!![]);}catch(_0x327318){return BPromise[_0x567f('0x39')](_0x327318);}return _0x517eae['save']();};}function saveUpdates(_0x51e130,_0x5bac3b){return function(_0x294d12){if(_0x294d12){return _0x294d12[_0x567f('0x3a')](_0x51e130)['then'](function(_0x429b0f){return _0x429b0f;});}return null;};}function removeEntity(_0x4faae,_0x5e31d3){return function(_0x175839){if(_0x175839){return _0x175839[_0x567f('0x3b')]()[_0x567f('0x26')](function(){_0x4faae['status'](0xcc)[_0x567f('0x32')]();});}};}function handleEntityNotFound(_0x28a44f,_0x2d9be3){return function(_0x303420){if(!_0x303420){_0x28a44f[_0x567f('0x30')](0x194);}return _0x303420;};}function handleError(_0x54ab3d,_0x5ae4fd){_0x5ae4fd=_0x5ae4fd||0x1f4;return function(_0x52fb13){logger[_0x567f('0x2d')](_0x52fb13[_0x567f('0x3c')]);if(_0x52fb13[_0x567f('0x3d')]){delete _0x52fb13[_0x567f('0x3d')];}_0x54ab3d[_0x567f('0x31')](_0x5ae4fd)['send'](_0x52fb13);};}exports['index']=function(_0x56979e,_0x46fa74){var _0x5c999c={},_0x2fb5d5={},_0x1e70c8={'count':0x0,'rows':[]};var _0x183eb1=_['map'](db[_0x567f('0x3e')][_0x567f('0x3f')],function(_0x2539bd){return{'name':_0x2539bd[_0x567f('0x40')],'type':_0x2539bd[_0x567f('0x41')][_0x567f('0x42')]};});_0x2fb5d5['model']=_[_0x567f('0x43')](_0x183eb1,'name');_0x2fb5d5[_0x567f('0x44')]=_[_0x567f('0x45')](_0x56979e[_0x567f('0x44')]);_0x2fb5d5[_0x567f('0x46')]=_[_0x567f('0x47')](_0x2fb5d5[_0x567f('0x48')],_0x2fb5d5[_0x567f('0x44')]);_0x5c999c[_0x567f('0x49')]=_[_0x567f('0x47')](_0x2fb5d5[_0x567f('0x48')],qs[_0x567f('0x4a')](_0x56979e[_0x567f('0x44')][_0x567f('0x4a')]));_0x5c999c[_0x567f('0x49')]=_0x5c999c[_0x567f('0x49')][_0x567f('0x4b')]?_0x5c999c['attributes']:_0x2fb5d5[_0x567f('0x48')];if(!_0x56979e[_0x567f('0x44')][_0x567f('0x4c')](_0x567f('0x4d'))){_0x5c999c[_0x567f('0x4e')]=qs['limit'](_0x56979e[_0x567f('0x44')][_0x567f('0x4e')]);_0x5c999c[_0x567f('0x35')]=qs[_0x567f('0x35')](_0x56979e[_0x567f('0x44')][_0x567f('0x35')]);}_0x5c999c[_0x567f('0x4f')]=qs['sort'](_0x56979e[_0x567f('0x44')]['sort']);_0x5c999c['where']=qs['filters'](_[_0x567f('0x50')](_0x56979e['query'],_0x2fb5d5[_0x567f('0x46')]));if(_0x56979e[_0x567f('0x44')][_0x567f('0x51')]){_0x5c999c['where']=_[_0x567f('0x52')](_0x5c999c[_0x567f('0x53')],{'$or':_[_0x567f('0x43')](_0x183eb1,function(_0x390ed7){if(_0x390ed7[_0x567f('0x41')]!==_0x567f('0x54')){var _0x30d23f={};_0x30d23f[_0x390ed7[_0x567f('0x3d')]]={'$like':'%'+_0x56979e[_0x567f('0x44')][_0x567f('0x51')]+'%'};return _0x30d23f;}})});}_0x5c999c=_[_0x567f('0x52')]({},_0x5c999c,_0x56979e[_0x567f('0x55')]);var _0x4df926={'where':_0x5c999c['where']};return db[_0x567f('0x3e')][_0x567f('0x34')](_0x4df926)['then'](function(_0xe1a42e){_0x1e70c8[_0x567f('0x34')]=_0xe1a42e;if(_0x56979e[_0x567f('0x44')][_0x567f('0x56')]){_0x5c999c[_0x567f('0x57')]=[{'all':!![]}];}return db[_0x567f('0x3e')][_0x567f('0x58')](_0x5c999c);})[_0x567f('0x26')](function(_0x396119){_0x1e70c8['rows']=_0x396119;return _0x1e70c8;})[_0x567f('0x26')](respondWithFilteredResult(_0x46fa74,_0x5c999c))['catch'](handleError(_0x46fa74,null));};exports['show']=function(_0x288e0d,_0x166330){var _0x43b264={'raw':!![],'where':{'id':_0x288e0d['params']['id']}},_0x3449dc={};_0x3449dc['model']=_['keys'](db[_0x567f('0x3e')][_0x567f('0x3f')]);_0x3449dc[_0x567f('0x44')]=_['keys'](_0x288e0d[_0x567f('0x44')]);_0x3449dc[_0x567f('0x46')]=_['intersection'](_0x3449dc['model'],_0x3449dc[_0x567f('0x44')]);_0x43b264[_0x567f('0x49')]=_[_0x567f('0x47')](_0x3449dc['model'],qs[_0x567f('0x4a')](_0x288e0d[_0x567f('0x44')]['fields']));_0x43b264['attributes']=_0x43b264[_0x567f('0x49')][_0x567f('0x4b')]?_0x43b264['attributes']:_0x3449dc['model'];if(_0x288e0d[_0x567f('0x44')][_0x567f('0x56')]){_0x43b264[_0x567f('0x57')]=[{'all':!![]}];}_0x43b264=_[_0x567f('0x52')]({},_0x43b264,_0x288e0d[_0x567f('0x55')]);return db['MailMessage']['find'](_0x43b264)[_0x567f('0x26')](handleEntityNotFound(_0x166330,null))['then'](respondWithResult(_0x166330,null))[_0x567f('0x59')](handleError(_0x166330,null));};exports[_0x567f('0x3a')]=function(_0x4f7b08,_0x180ea7){if(_0x4f7b08[_0x567f('0x5a')]['id']){delete _0x4f7b08['body']['id'];}return db['MailMessage'][_0x567f('0x5b')]({'where':{'id':_0x4f7b08[_0x567f('0x5c')]['id']}})[_0x567f('0x26')](handleEntityNotFound(_0x180ea7,null))[_0x567f('0x26')](saveUpdates(_0x4f7b08[_0x567f('0x5a')],null))[_0x567f('0x26')](respondWithResult(_0x180ea7,null))['catch'](handleError(_0x180ea7,null));};exports[_0x567f('0x3b')]=function(_0x455134,_0x1a0d6a){return db[_0x567f('0x3e')][_0x567f('0x5b')]({'where':{'id':_0x455134[_0x567f('0x5c')]['id']}})[_0x567f('0x26')](handleEntityNotFound(_0x1a0d6a,null))['then'](removeEntity(_0x1a0d6a,null))[_0x567f('0x59')](handleError(_0x1a0d6a,null));};exports['describe']=function(_0x69fb54,_0x517a2b){return db[_0x567f('0x3e')]['describe']()[_0x567f('0x26')](respondWithResult(_0x517a2b,null))[_0x567f('0x59')](handleError(_0x517a2b,null));};exports[_0x567f('0x5d')]=function(_0x4793fe,_0x44f7e6){return db[_0x567f('0x3e')][_0x567f('0x5d')](_0x4793fe[_0x567f('0x5a')])['then'](function(_0x4ed258){if(_0x4ed258){if(_0x4ed258[_0x567f('0x5e')]===_0x567f('0x5f')&&!_0x4ed258[_0x567f('0x60')]){var _0x1bf3ac,_0xbe79e7,_0x9dcfe;if(_0x4793fe['body']['to']){_0xbe79e7=_0x4793fe[_0x567f('0x5a')]['to'][_0x567f('0x61')](',')[0x0];}return db['MailAccount'][_0x567f('0x62')]({'where':{'id':_0x4ed258['MailAccountId']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x567f('0x63')],'as':_0x567f('0x64'),'where':{'email':_0xbe79e7},'limit':0x1,'order':[[_0x567f('0x65'),_0x567f('0x66')]]}]},{'model':db[_0x567f('0x67')],'as':'Smtp','raw':!![]}]})[_0x567f('0x26')](function(_0x8483d){_0x1bf3ac=_0x8483d;if(_0x1bf3ac&&_0x1bf3ac[_0x567f('0x68')]){var _0x466189={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1bf3ac[_0x567f('0x68')][_0x567f('0x69')])){_0x466189[_0x567f('0x6a')]=_0x1bf3ac[_0x567f('0x68')][_0x567f('0x6a')];_0x466189[_0x567f('0x6b')]=_0x1bf3ac[_0x567f('0x68')][_0x567f('0x6b')];_0x466189['secure']=_0x1bf3ac[_0x567f('0x68')][_0x567f('0x6c')];if(_0x1bf3ac['Smtp'][_0x567f('0x6d')]){_0x466189[_0x567f('0x6e')]={'user':_0x1bf3ac[_0x567f('0x68')][_0x567f('0x6f')],'pass':_0x1bf3ac[_0x567f('0x68')][_0x567f('0x70')]};}}else{_0x466189['service']=_0x1bf3ac[_0x567f('0x68')][_0x567f('0x69')];_0x466189['auth']={'user':_0x1bf3ac['Smtp'][_0x567f('0x6f')],'pass':_0x1bf3ac[_0x567f('0x68')][_0x567f('0x70')]};_0x466189[_0x567f('0x6c')]=_0x1bf3ac['Smtp']['secure'];}if(_0x4793fe['body'][_0x567f('0x71')]&&_0x4793fe[_0x567f('0x5a')][_0x567f('0x71')][_0x567f('0x4b')]){for(var _0x99cf20=0x0;_0x99cf20<_0x4793fe['body'][_0x567f('0x71')][_0x567f('0x4b')];_0x99cf20+=0x1){_0x4793fe[_0x567f('0x5a')][_0x567f('0x71')][_0x99cf20]={'filename':_0x4793fe[_0x567f('0x5a')][_0x567f('0x71')][_0x99cf20][_0x567f('0x3d')],'path':path[_0x567f('0x72')](config['root'],_0x567f('0x73'),_0x4793fe[_0x567f('0x5a')]['attachments'][_0x99cf20][_0x567f('0x74')])};}}_0x9dcfe={'account':_0x466189,'message':_0x4793fe[_0x567f('0x5a')]};return;}})[_0x567f('0x26')](function(){if(_0x1bf3ac['List']){if(_0x1bf3ac['List'][_0x567f('0x64')][_0x567f('0x4b')]){return _0x1bf3ac[_0x567f('0x75')]['Contacts'][0x0];}else{return db[_0x567f('0x63')]['create'](_[_0x567f('0x1b')](_0x4793fe[_0x567f('0x5a')],{'firstName':_0x4793fe[_0x567f('0x5a')]['to'],'email':_0x4793fe[_0x567f('0x5a')]['to'],'phone':_0x4793fe[_0x567f('0x5a')]['to'],'ListId':_0x1bf3ac[_0x567f('0x76')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x9dcfe){return respondWithRpcPromise(_0x567f('0x77'),_0x567f('0x78'),_0x9dcfe,client9003)[_0x567f('0x26')](function(_0x414024){return _0x4ed258[_0x567f('0x3a')]({'read':!![],'messageId':_0x414024[_0x567f('0x79')],'sentAt':moment()[_0x567f('0x7a')](_0x567f('0x7b'))});})[_0x567f('0x59')](function(_0x5a04c9){logger[_0x567f('0x2d')]('%s',JSON[_0x567f('0x7c')](_0x5a04c9));return _0x4ed258;});}return _0x4ed258;});}return _0x4ed258;}})['then'](respondWithResult(_0x44f7e6,0xc9))[_0x567f('0x59')](handleError(_0x44f7e6,null));};var interaction_log=require(_0x567f('0x15'))(_0x567f('0x7d'));exports[_0x567f('0x7e')]=function(_0x188d32,_0x5bb2cc,_0x2d361c){var _0x25ef51={'channel':_0x567f('0x7f')};if(_0x188d32['body']['id']){delete _0x188d32[_0x567f('0x5a')]['id'];}_0x188d32['body'][_0x567f('0x80')]=!![];_0x188d32[_0x567f('0x5a')]['readAt']=moment()[_0x567f('0x7a')](_0x567f('0x7b'));_0x188d32[_0x567f('0x5a')][_0x567f('0x81')]=_0x188d32[_0x567f('0x5a')][_0x567f('0x81')]||_0x188d32[_0x567f('0x6f')]['id'];return db[_0x567f('0x3e')][_0x567f('0x5b')]({'where':{'id':_0x188d32['params']['id'],'UserId':null},'include':[{'model':db[_0x567f('0x63')],'as':_0x567f('0x82')}]})[_0x567f('0x26')](handleEntityNotFound(_0x5bb2cc,null))['then'](saveUpdates(_0x188d32[_0x567f('0x5a')],null))[_0x567f('0x26')](function(_0xd0377c){if(_0xd0377c){_0x25ef51[_0x567f('0x2e')]=_0xd0377c['get']({'plain':!![]});return db[_0x567f('0x83')][_0x567f('0x5b')]({'where':{'id':_0xd0377c[_0x567f('0x84')]}});}return null;})[_0x567f('0x26')](handleEntityNotFound(_0x5bb2cc,null))[_0x567f('0x26')](function(_0x4533e4){if(_0x4533e4){return _0x4533e4[_0x567f('0x3a')]({'UserId':_0x188d32['body']['UserId'],'read1stAt':_[_0x567f('0x85')](_0x4533e4[_0x567f('0x86')])?moment()[_0x567f('0x7a')](_0x567f('0x7b')):undefined});}return null;})[_0x567f('0x26')](function(_0x2f3203){if(_0x2f3203){_0x25ef51[_0x567f('0x87')]=_0x2f3203['get']({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x188d32[_0x567f('0x6f')]['id'],_0x188d32[_0x567f('0x6f')][_0x567f('0x3d')],_0x188d32[_0x567f('0x6f')][_0x567f('0x88')],_0x25ef51[_0x567f('0x87')]['id'],_0x188d32['body']?JSON[_0x567f('0x7c')](_0x188d32['body']):'null');return respondWithRpcPromise(_0x567f('0x89'),'acceptMessage',_0x25ef51);}return null;})['then'](function(_0x249f4f){if(_0x249f4f){if(_0x188d32[_0x567f('0x5a')][_0x567f('0x8a')]){_0x25ef51[_0x567f('0x2e')][_0x567f('0x8b')]=util[_0x567f('0x7a')](_0x567f('0x8c'),_0x188d32[_0x567f('0x6f')]['name']);_0x25ef51[_0x567f('0x2e')][_0x567f('0x8d')]=_0x25ef51[_0x567f('0x8d')];_0x25ef51['message']['event']='accept';return respondWithRpcPromise(_0x567f('0x8e'),'EventManager',{'event':_0x567f('0x8f'),'message':_0x25ef51[_0x567f('0x2e')]},client9002)[_0x567f('0x26')](function(){return _0x25ef51;});}return _0x25ef51;}return null;})['then'](respondWithResult(_0x5bb2cc,null))['catch'](handleError(_0x5bb2cc,null));};var interaction_log=require('../../config/logger')(_0x567f('0x7d'));exports[_0x567f('0x39')]=function(_0x2f2c63,_0x1f1b31,_0x6210a7){var _0x567b76={'agent':{},'channel':'mail'};if(_0x2f2c63[_0x567f('0x5a')]['id']){delete _0x2f2c63[_0x567f('0x5a')]['id'];}_0x2f2c63['body'][_0x567f('0x81')]=_0x2f2c63[_0x567f('0x5a')]['UserId']||_0x2f2c63[_0x567f('0x6f')]['id'];_0x567b76[_0x567f('0x90')]['id']=_0x2f2c63[_0x567f('0x5a')][_0x567f('0x81')];return db[_0x567f('0x3e')][_0x567f('0x5b')]({'where':{'id':_0x2f2c63[_0x567f('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1f1b31,null))[_0x567f('0x26')](function(_0x343422){if(_0x343422){_0x567b76[_0x567f('0x2e')]=_0x343422[_0x567f('0x91')]({'plain':!![]});return db['MailInteraction'][_0x567f('0x5b')]({'where':{'id':_0x343422[_0x567f('0x84')]}});}return null;})['then'](handleEntityNotFound(_0x1f1b31,null))['then'](function(_0x56b948){if(_0x56b948){_0x567b76[_0x567f('0x87')]=_0x56b948[_0x567f('0x91')]({'plain':!![]});interaction_log[_0x567f('0x27')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2f2c63[_0x567f('0x6f')]['id'],_0x2f2c63[_0x567f('0x6f')][_0x567f('0x3d')],_0x2f2c63['user'][_0x567f('0x88')],_0x567b76[_0x567f('0x87')]['id'],_0x2f2c63[_0x567f('0x5a')]?JSON[_0x567f('0x7c')](_0x2f2c63[_0x567f('0x5a')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x567b76);}return null;})[_0x567f('0x26')](function(_0x35208d){if(_0x35208d){_0x35208d['message'][_0x567f('0x8b')]=util[_0x567f('0x7a')](_0x567f('0x8c'),_0x2f2c63['user'][_0x567f('0x3d')]);_0x35208d[_0x567f('0x2e')]['channel']=_0x567b76[_0x567f('0x8d')];_0x35208d['message'][_0x567f('0x92')]=_0x567f('0x39');respondWithRpcPromise(_0x567f('0x8e'),_0x567f('0x8e'),{'event':_0x567f('0x93'),'message':_0x35208d[_0x567f('0x2e')]},client9002);return _0x567b76;}return null;})['then'](respondWithResult(_0x1f1b31,null))[_0x567f('0x59')](handleError(_0x1f1b31,null));};exports[_0x567f('0x94')]=function(_0x2167ef,_0x175f81){var _0x251683=moment()[_0x567f('0x95')]()['toString']();var _0x44a41e=path[_0x567f('0x72')](config['root'],_0x567f('0x96'),_0x567f('0x97'),'tmp');var _0x249a75=path[_0x567f('0x72')](config['root'],_0x567f('0x96'),_0x567f('0x97'),'attachments');var _0x2f0e13=util[_0x567f('0x7a')](_0x567f('0x98'),_0x251683);return db[_0x567f('0x3e')][_0x567f('0x5b')]({'where':{'id':_0x2167ef[_0x567f('0x5c')]['id']},'attributes':['id',_0x567f('0x5a'),'from','to','cc',_0x567f('0x99'),'subject',_0x567f('0x9a')],'include':_0x2167ef[_0x567f('0x44')][_0x567f('0x71')]?[{'model':db[_0x567f('0x9b')],'as':_0x567f('0x9c')}]:undefined})[_0x567f('0x26')](handleEntityNotFound(_0x175f81,null))['then'](function(_0x23a2dd){if(_0x23a2dd){var _0x11f834=_0x23a2dd;var _0x3477a6={'from':_0x11f834[_0x567f('0x9d')],'to':_0x11f834['to'],'subject':_0x11f834[_0x567f('0x9e')],'html':_0x11f834[_0x567f('0x5a')],'headers':{'Date':moment(_0x11f834[_0x567f('0x9a')])[_0x567f('0x7a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x23a2dd['cc']){_0x3477a6[_0x567f('0x9f')]['Cc']=_0x23a2dd['cc'];}if(_0x23a2dd[_0x567f('0x99')]){_0x3477a6[_0x567f('0x9f')][_0x567f('0xa0')]=_0x23a2dd['bcc'];}return new BPromise(function(_0xd7ae2b,_0xbb4f35){if(_0x23a2dd['Attachments']){for(var _0x2e9b50=0x0;_0x2e9b50<_0x23a2dd[_0x567f('0x9c')]['length'];_0x2e9b50++){var _0x327a05=_0x23a2dd[_0x567f('0x9c')][_0x2e9b50];var _0x9ea631=path[_0x567f('0x72')](_0x249a75,_0x327a05[_0x567f('0x74')]);if(fs[_0x567f('0xa1')](_0x9ea631)){_0x3477a6[_0x567f('0x71')][_0x567f('0xa2')]({'name':_0x327a05[_0x567f('0x3d')],'contentType':_0x327a05[_0x567f('0x41')],'data':fs[_0x567f('0xa3')](_0x9ea631)});}}}emlformat[_0x567f('0xa4')](_0x3477a6,function(_0x204996,_0x49a5dd){if(_0x204996)return _0xbb4f35(_0x204996);fs[_0x567f('0xa5')](path[_0x567f('0x72')](_0x44a41e,_0x2f0e13),_0x49a5dd);return _0xd7ae2b(_0x49a5dd);});});}})[_0x567f('0x26')](function(_0x2d84b7){if(_0x2d84b7){return _0x175f81[_0x567f('0x94')](path['join'](_0x44a41e,_0x2f0e13),_0x2f0e13,function(_0x356f16){if(_0x356f16){console[_0x567f('0xa6')](_0x567f('0xa7'),_0x356f16);}else{fs[_0x567f('0xa8')](path[_0x567f('0x72')](_0x44a41e,_0x2f0e13));}});}})['catch'](handleError(_0x175f81,null));}; \ No newline at end of file +var _0xd529=['direction','split','MailAccount','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','pass','service','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','format','UserId','CmContact','Contact','MailInteraction','MailInteractionId','interaction','get','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','agent','RejectMessage','rejectMessage','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','log','err','unlinkSync','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','client','http','test','Sequelize','ValidationError','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','name','send','index','map','MailMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','options','find','body','params','describe','create'];(function(_0xae98d9,_0x5426b7){var _0x12c790=function(_0x1e0724){while(--_0x1e0724){_0xae98d9['push'](_0xae98d9['shift']());}};_0x12c790(++_0x5426b7);}(_0xd529,0xfd));var _0x9d52=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd529[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x9d52('0x0'));var emlformat=require(_0x9d52('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9d52('0x2'));var rp=require(_0x9d52('0x3'));var moment=require(_0x9d52('0x4'));var BPromise=require(_0x9d52('0x5'));var Mustache=require(_0x9d52('0x6'));var util=require(_0x9d52('0x7'));var path=require(_0x9d52('0x8'));var sox=require(_0x9d52('0x9'));var csv=require(_0x9d52('0xa'));var ejs=require(_0x9d52('0xb'));var fs=require('fs');var _=require(_0x9d52('0xc'));var squel=require(_0x9d52('0xd'));var crypto=require(_0x9d52('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9d52('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9d52('0x10'));var Papa=require(_0x9d52('0x11'));var Redis=require(_0x9d52('0x12'));var authService=require(_0x9d52('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9d52('0x14'));var hardwareService=require(_0x9d52('0x15'));var logger=require(_0x9d52('0x16'))(_0x9d52('0x17'));var utils=require('../../config/utils');var config=require(_0x9d52('0x18'));var db=require(_0x9d52('0x19'))['db'];config['redis']=_[_0x9d52('0x1a')](config[_0x9d52('0x1b')],{'host':_0x9d52('0x1c'),'port':0x18eb});var socket=require(_0x9d52('0x1d'))(new Redis(config[_0x9d52('0x1b')]));require('./mailMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9d52('0x1e')]['http']({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x9d52('0x1e')][_0x9d52('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x17ad05,_0x59a188,_0xc002f0){if(_0xc002f0){var _0x116bb2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x116bb2[_0x9d52('0x20')](_0x59a188)){return _0x17ad05;}else{throw new db[(_0x9d52('0x21'))][(_0x9d52('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x17ad05;}}function respondWithRpcPromise(_0x321a7b,_0x2107d1,_0x1452b6,_0x4f0896){return new BPromise(function(_0x1e200c,_0x1de66d){var _0x37b6f9=_0x4f0896||client;return _0x37b6f9['request'](_0x321a7b,_0x1452b6)[_0x9d52('0x23')](function(_0x398360){logger['info'](_0x9d52('0x24'),_0x2107d1,_0x9d52('0x25'));logger[_0x9d52('0x26')](_0x9d52('0x27'),_0x2107d1,_0x9d52('0x25'),JSON[_0x9d52('0x28')](_0x398360));if(_0x398360['error']){if(_0x398360[_0x9d52('0x29')][_0x9d52('0x2a')]===0x1f4){logger[_0x9d52('0x29')]('MailMessage,\x20%s,\x20%s',_0x2107d1,_0x398360[_0x9d52('0x29')]['message']);return _0x1de66d(_0x398360[_0x9d52('0x29')][_0x9d52('0x2b')]);}logger[_0x9d52('0x29')](_0x9d52('0x24'),_0x2107d1,_0x398360[_0x9d52('0x29')]['message']);return _0x1e200c(_0x398360[_0x9d52('0x29')][_0x9d52('0x2b')]);}else{logger[_0x9d52('0x2c')](_0x9d52('0x24'),_0x2107d1,_0x9d52('0x25'));_0x1e200c(_0x398360[_0x9d52('0x2d')][_0x9d52('0x2b')]);}})['catch'](function(_0x536cb8){logger['error'](_0x9d52('0x24'),_0x2107d1,_0x536cb8);_0x1de66d(_0x536cb8);});});}function respondWithStatusCode(_0x226c73,_0x3f29ec){_0x3f29ec=_0x3f29ec||0xcc;return function(_0x1679c5){if(_0x1679c5){return _0x226c73[_0x9d52('0x2e')](_0x3f29ec);}return _0x226c73['status'](_0x3f29ec)[_0x9d52('0x2f')]();};}function respondWithResult(_0x5305bb,_0x306e73){_0x306e73=_0x306e73||0xc8;return function(_0x220cf5){if(_0x220cf5){return _0x5305bb[_0x9d52('0x30')](_0x306e73)[_0x9d52('0x31')](_0x220cf5);}};}function respondWithFilteredResult(_0x42e12c,_0x39d27a){return function(_0x4c0ec5){if(_0x4c0ec5){var _0x5e9da2=_0x4c0ec5[_0x9d52('0x32')],_0x5515e7=_0x39d27a['offset'],_0x1d2c17=_0x39d27a[_0x9d52('0x33')]+_0x39d27a[_0x9d52('0x34')],_0xeb4d61;if(_0x1d2c17>=_0x5e9da2){_0x1d2c17=_0x5e9da2;_0xeb4d61=0xc8;}else{_0xeb4d61=0xce;}_0x42e12c[_0x9d52('0x30')](_0xeb4d61);return _0x42e12c[_0x9d52('0x35')](_0x9d52('0x36'),_0x5515e7+'-'+_0x1d2c17+'/'+_0x5e9da2)[_0x9d52('0x31')](_0x4c0ec5);}return null;};}function patchUpdates(_0x395732){return function(_0x112158){try{jsonpatch['apply'](_0x112158,_0x395732,!![]);}catch(_0x1116da){return BPromise[_0x9d52('0x37')](_0x1116da);}return _0x112158[_0x9d52('0x38')]();};}function saveUpdates(_0x483d1f,_0x4397e7){return function(_0x3cfbf3){if(_0x3cfbf3){return _0x3cfbf3[_0x9d52('0x39')](_0x483d1f)[_0x9d52('0x23')](function(_0x593719){return _0x593719;});}return null;};}function removeEntity(_0x2ecee3,_0x4d318b){return function(_0x3bbfb6){if(_0x3bbfb6){return _0x3bbfb6[_0x9d52('0x3a')]()[_0x9d52('0x23')](function(){_0x2ecee3['status'](0xcc)[_0x9d52('0x2f')]();});}};}function handleEntityNotFound(_0x3127c6,_0x5be409){return function(_0x40f9af){if(!_0x40f9af){_0x3127c6[_0x9d52('0x2e')](0x194);}return _0x40f9af;};}function handleError(_0x5654d8,_0x2b6e22){_0x2b6e22=_0x2b6e22||0x1f4;return function(_0x25328f){logger[_0x9d52('0x29')](_0x25328f['stack']);if(_0x25328f['name']){delete _0x25328f[_0x9d52('0x3b')];}_0x5654d8[_0x9d52('0x30')](_0x2b6e22)[_0x9d52('0x3c')](_0x25328f);};}exports[_0x9d52('0x3d')]=function(_0x4680e9,_0x120667){var _0x1e6698={},_0x364948={},_0x3be05e={'count':0x0,'rows':[]};var _0x5b3cf2=_[_0x9d52('0x3e')](db[_0x9d52('0x3f')][_0x9d52('0x40')],function(_0x2d42ad){return{'name':_0x2d42ad[_0x9d52('0x41')],'type':_0x2d42ad['type'][_0x9d52('0x42')]};});_0x364948[_0x9d52('0x43')]=_['map'](_0x5b3cf2,_0x9d52('0x3b'));_0x364948[_0x9d52('0x44')]=_[_0x9d52('0x45')](_0x4680e9[_0x9d52('0x44')]);_0x364948[_0x9d52('0x46')]=_[_0x9d52('0x47')](_0x364948['model'],_0x364948[_0x9d52('0x44')]);_0x1e6698['attributes']=_['intersection'](_0x364948[_0x9d52('0x43')],qs[_0x9d52('0x48')](_0x4680e9[_0x9d52('0x44')][_0x9d52('0x48')]));_0x1e6698[_0x9d52('0x49')]=_0x1e6698[_0x9d52('0x49')][_0x9d52('0x4a')]?_0x1e6698[_0x9d52('0x49')]:_0x364948['model'];if(!_0x4680e9[_0x9d52('0x44')][_0x9d52('0x4b')](_0x9d52('0x4c'))){_0x1e6698[_0x9d52('0x34')]=qs[_0x9d52('0x34')](_0x4680e9[_0x9d52('0x44')]['limit']);_0x1e6698[_0x9d52('0x33')]=qs['offset'](_0x4680e9['query'][_0x9d52('0x33')]);}_0x1e6698[_0x9d52('0x4d')]=qs[_0x9d52('0x4e')](_0x4680e9[_0x9d52('0x44')]['sort']);_0x1e6698[_0x9d52('0x4f')]=qs['filters'](_['pick'](_0x4680e9[_0x9d52('0x44')],_0x364948[_0x9d52('0x46')]));if(_0x4680e9[_0x9d52('0x44')]['filter']){_0x1e6698[_0x9d52('0x4f')]=_[_0x9d52('0x50')](_0x1e6698[_0x9d52('0x4f')],{'$or':_[_0x9d52('0x3e')](_0x5b3cf2,function(_0x3b0f8a){if(_0x3b0f8a[_0x9d52('0x51')]!==_0x9d52('0x52')){var _0x53790a={};_0x53790a[_0x3b0f8a[_0x9d52('0x3b')]]={'$like':'%'+_0x4680e9[_0x9d52('0x44')][_0x9d52('0x53')]+'%'};return _0x53790a;}})});}_0x1e6698=_[_0x9d52('0x50')]({},_0x1e6698,_0x4680e9['options']);var _0x50ff7={'where':_0x1e6698[_0x9d52('0x4f')]};return db[_0x9d52('0x3f')][_0x9d52('0x32')](_0x50ff7)[_0x9d52('0x23')](function(_0x5807e4){_0x3be05e[_0x9d52('0x32')]=_0x5807e4;if(_0x4680e9[_0x9d52('0x44')][_0x9d52('0x54')]){_0x1e6698[_0x9d52('0x55')]=[{'all':!![]}];}return db[_0x9d52('0x3f')]['findAll'](_0x1e6698);})[_0x9d52('0x23')](function(_0x1480a9){_0x3be05e[_0x9d52('0x56')]=_0x1480a9;return _0x3be05e;})[_0x9d52('0x23')](respondWithFilteredResult(_0x120667,_0x1e6698))[_0x9d52('0x57')](handleError(_0x120667,null));};exports[_0x9d52('0x58')]=function(_0x326599,_0x49e74d){var _0x1a40d2={'raw':!![],'where':{'id':_0x326599['params']['id']}},_0x14f9c4={};_0x14f9c4[_0x9d52('0x43')]=_[_0x9d52('0x45')](db['MailMessage'][_0x9d52('0x40')]);_0x14f9c4[_0x9d52('0x44')]=_['keys'](_0x326599[_0x9d52('0x44')]);_0x14f9c4['filters']=_[_0x9d52('0x47')](_0x14f9c4[_0x9d52('0x43')],_0x14f9c4[_0x9d52('0x44')]);_0x1a40d2[_0x9d52('0x49')]=_[_0x9d52('0x47')](_0x14f9c4[_0x9d52('0x43')],qs[_0x9d52('0x48')](_0x326599[_0x9d52('0x44')][_0x9d52('0x48')]));_0x1a40d2[_0x9d52('0x49')]=_0x1a40d2['attributes']['length']?_0x1a40d2[_0x9d52('0x49')]:_0x14f9c4[_0x9d52('0x43')];if(_0x326599[_0x9d52('0x44')][_0x9d52('0x54')]){_0x1a40d2[_0x9d52('0x55')]=[{'all':!![]}];}_0x1a40d2=_[_0x9d52('0x50')]({},_0x1a40d2,_0x326599[_0x9d52('0x59')]);return db[_0x9d52('0x3f')][_0x9d52('0x5a')](_0x1a40d2)[_0x9d52('0x23')](handleEntityNotFound(_0x49e74d,null))[_0x9d52('0x23')](respondWithResult(_0x49e74d,null))['catch'](handleError(_0x49e74d,null));};exports[_0x9d52('0x39')]=function(_0x4e481a,_0x1c0cae){if(_0x4e481a[_0x9d52('0x5b')]['id']){delete _0x4e481a[_0x9d52('0x5b')]['id'];}return db[_0x9d52('0x3f')][_0x9d52('0x5a')]({'where':{'id':_0x4e481a[_0x9d52('0x5c')]['id']}})[_0x9d52('0x23')](handleEntityNotFound(_0x1c0cae,null))[_0x9d52('0x23')](saveUpdates(_0x4e481a[_0x9d52('0x5b')],null))[_0x9d52('0x23')](respondWithResult(_0x1c0cae,null))['catch'](handleError(_0x1c0cae,null));};exports[_0x9d52('0x3a')]=function(_0x3bfd6f,_0x140467){return db[_0x9d52('0x3f')]['find']({'where':{'id':_0x3bfd6f[_0x9d52('0x5c')]['id']}})[_0x9d52('0x23')](handleEntityNotFound(_0x140467,null))[_0x9d52('0x23')](removeEntity(_0x140467,null))['catch'](handleError(_0x140467,null));};exports[_0x9d52('0x5d')]=function(_0x434a52,_0x1d6a85){return db[_0x9d52('0x3f')][_0x9d52('0x5d')]()[_0x9d52('0x23')](respondWithResult(_0x1d6a85,null))[_0x9d52('0x57')](handleError(_0x1d6a85,null));};exports[_0x9d52('0x5e')]=function(_0x26ee8d,_0x325218){return db[_0x9d52('0x3f')][_0x9d52('0x5e')](_0x26ee8d[_0x9d52('0x5b')])[_0x9d52('0x23')](function(_0x5515e5){if(_0x5515e5){if(_0x5515e5[_0x9d52('0x5f')]==='out'&&!_0x5515e5['secret']){var _0x96ded6,_0xd36962,_0x3d83c1;if(_0x26ee8d['body']['to']){_0xd36962=_0x26ee8d[_0x9d52('0x5b')]['to'][_0x9d52('0x60')](',')[0x0];}return db[_0x9d52('0x61')]['findOne']({'where':{'id':_0x5515e5[_0x9d52('0x62')]},'include':[{'model':db[_0x9d52('0x63')],'as':_0x9d52('0x64'),'include':[{'model':db['CmContact'],'as':_0x9d52('0x65'),'where':{'email':_0xd36962},'limit':0x1,'order':[[_0x9d52('0x66'),_0x9d52('0x67')]]}]},{'model':db[_0x9d52('0x68')],'as':_0x9d52('0x69'),'raw':!![]}]})[_0x9d52('0x23')](function(_0x457fe5){_0x96ded6=_0x457fe5;if(_0x96ded6&&_0x96ded6['Smtp']){var _0x2a3e08={'tls':{'rejectUnauthorized':![]}};if(_[_0x9d52('0x6a')](_0x96ded6['Smtp']['service'])){_0x2a3e08['host']=_0x96ded6['Smtp'][_0x9d52('0x6b')];_0x2a3e08[_0x9d52('0x6c')]=_0x96ded6[_0x9d52('0x69')][_0x9d52('0x6c')];_0x2a3e08['secure']=_0x96ded6[_0x9d52('0x69')][_0x9d52('0x6d')];if(_0x96ded6['Smtp'][_0x9d52('0x6e')]){_0x2a3e08[_0x9d52('0x6f')]={'user':_0x96ded6[_0x9d52('0x69')][_0x9d52('0x70')],'pass':_0x96ded6[_0x9d52('0x69')][_0x9d52('0x71')]};}}else{_0x2a3e08[_0x9d52('0x72')]=_0x96ded6['Smtp'][_0x9d52('0x72')];_0x2a3e08[_0x9d52('0x6f')]={'user':_0x96ded6['Smtp']['user'],'pass':_0x96ded6['Smtp'][_0x9d52('0x71')]};_0x2a3e08['secure']=_0x96ded6[_0x9d52('0x69')][_0x9d52('0x6d')];}if(_0x26ee8d['body']['attachments']&&_0x26ee8d[_0x9d52('0x5b')][_0x9d52('0x73')]['length']){for(var _0x3ae955=0x0;_0x3ae955<_0x26ee8d[_0x9d52('0x5b')][_0x9d52('0x73')][_0x9d52('0x4a')];_0x3ae955+=0x1){_0x26ee8d[_0x9d52('0x5b')][_0x9d52('0x73')][_0x3ae955]={'filename':_0x26ee8d[_0x9d52('0x5b')]['attachments'][_0x3ae955][_0x9d52('0x3b')],'path':path[_0x9d52('0x74')](config[_0x9d52('0x75')],_0x9d52('0x76'),_0x26ee8d[_0x9d52('0x5b')]['attachments'][_0x3ae955][_0x9d52('0x77')])};}}_0x3d83c1={'account':_0x2a3e08,'message':_0x26ee8d[_0x9d52('0x5b')]};return;}})[_0x9d52('0x23')](function(){if(_0x96ded6[_0x9d52('0x64')]){if(_0x96ded6[_0x9d52('0x64')][_0x9d52('0x65')]['length']){return _0x96ded6['List'][_0x9d52('0x65')][0x0];}else{return db['CmContact'][_0x9d52('0x5e')](_['defaults'](_0x26ee8d[_0x9d52('0x5b')],{'firstName':_0x26ee8d[_0x9d52('0x5b')]['to'],'email':_0x26ee8d[_0x9d52('0x5b')]['to'],'phone':_0x26ee8d[_0x9d52('0x5b')]['to'],'ListId':_0x96ded6[_0x9d52('0x78')]}));}}else{throw new Error(_0x9d52('0x79'));}})[_0x9d52('0x23')](function(){if(_0x3d83c1){return respondWithRpcPromise(_0x9d52('0x7a'),_0x9d52('0x7b'),_0x3d83c1,client9003)['then'](function(_0x1b00c0){return _0x5515e5['update']({'read':!![],'messageId':_0x1b00c0['messageId'],'sentAt':moment()['format'](_0x9d52('0x7c'))});})[_0x9d52('0x57')](function(_0x4bbaf4){logger[_0x9d52('0x29')]('%s',JSON[_0x9d52('0x28')](_0x4bbaf4));return _0x5515e5;});}return _0x5515e5;});}return _0x5515e5;}})['then'](respondWithResult(_0x325218,0xc9))[_0x9d52('0x57')](handleError(_0x325218,null));};var interaction_log=require(_0x9d52('0x16'))(_0x9d52('0x7d'));exports[_0x9d52('0x7e')]=function(_0x4e25bb,_0x1c6bd6,_0x3cb4db){var _0x12b24c={'channel':_0x9d52('0x7f')};if(_0x4e25bb[_0x9d52('0x5b')]['id']){delete _0x4e25bb[_0x9d52('0x5b')]['id'];}_0x4e25bb[_0x9d52('0x5b')][_0x9d52('0x80')]=!![];_0x4e25bb[_0x9d52('0x5b')][_0x9d52('0x81')]=moment()[_0x9d52('0x82')](_0x9d52('0x7c'));_0x4e25bb[_0x9d52('0x5b')]['UserId']=_0x4e25bb[_0x9d52('0x5b')][_0x9d52('0x83')]||_0x4e25bb[_0x9d52('0x70')]['id'];return db[_0x9d52('0x3f')][_0x9d52('0x5a')]({'where':{'id':_0x4e25bb['params']['id'],'UserId':null},'include':[{'model':db[_0x9d52('0x84')],'as':_0x9d52('0x85')}]})[_0x9d52('0x23')](handleEntityNotFound(_0x1c6bd6,null))[_0x9d52('0x23')](saveUpdates(_0x4e25bb[_0x9d52('0x5b')],null))[_0x9d52('0x23')](function(_0x81edc0){if(_0x81edc0){_0x12b24c[_0x9d52('0x2b')]=_0x81edc0['get']({'plain':!![]});return db[_0x9d52('0x86')][_0x9d52('0x5a')]({'where':{'id':_0x81edc0[_0x9d52('0x87')]}});}return null;})['then'](handleEntityNotFound(_0x1c6bd6,null))[_0x9d52('0x23')](function(_0x405859){if(_0x405859){return _0x405859[_0x9d52('0x39')]({'UserId':_0x4e25bb[_0x9d52('0x5b')][_0x9d52('0x83')],'read1stAt':_[_0x9d52('0x6a')](_0x405859['read1stAt'])?moment()[_0x9d52('0x82')](_0x9d52('0x7c')):undefined});}return null;})[_0x9d52('0x23')](function(_0x49d68a){if(_0x49d68a){_0x12b24c[_0x9d52('0x88')]=_0x49d68a[_0x9d52('0x89')]({'plain':!![]});interaction_log[_0x9d52('0x2c')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e25bb[_0x9d52('0x70')]['id'],_0x4e25bb[_0x9d52('0x70')][_0x9d52('0x3b')],_0x4e25bb[_0x9d52('0x70')][_0x9d52('0x8a')],_0x12b24c['interaction']['id'],_0x4e25bb['body']?JSON[_0x9d52('0x28')](_0x4e25bb[_0x9d52('0x5b')]):_0x9d52('0x8b'));return respondWithRpcPromise(_0x9d52('0x8c'),_0x9d52('0x8d'),_0x12b24c);}return null;})[_0x9d52('0x23')](function(_0x5532d6){if(_0x5532d6){if(_0x4e25bb['body'][_0x9d52('0x8e')]){_0x12b24c['message'][_0x9d52('0x8f')]=util['format'](_0x9d52('0x90'),_0x4e25bb[_0x9d52('0x70')]['name']);_0x12b24c[_0x9d52('0x2b')][_0x9d52('0x91')]=_0x12b24c[_0x9d52('0x91')];_0x12b24c[_0x9d52('0x2b')][_0x9d52('0x92')]=_0x9d52('0x7e');return respondWithRpcPromise('EventManager',_0x9d52('0x93'),{'event':'acceptmessage','message':_0x12b24c[_0x9d52('0x2b')]},client9002)[_0x9d52('0x23')](function(){return _0x12b24c;});}return _0x12b24c;}return null;})[_0x9d52('0x23')](respondWithResult(_0x1c6bd6,null))[_0x9d52('0x57')](handleError(_0x1c6bd6,null));};var interaction_log=require(_0x9d52('0x16'))(_0x9d52('0x7d'));exports[_0x9d52('0x37')]=function(_0x4c33b6,_0x5447ef,_0x1d02a1){var _0x409fbb={'agent':{},'channel':'mail'};if(_0x4c33b6[_0x9d52('0x5b')]['id']){delete _0x4c33b6[_0x9d52('0x5b')]['id'];}_0x4c33b6[_0x9d52('0x5b')]['UserId']=_0x4c33b6[_0x9d52('0x5b')][_0x9d52('0x83')]||_0x4c33b6[_0x9d52('0x70')]['id'];_0x409fbb[_0x9d52('0x94')]['id']=_0x4c33b6[_0x9d52('0x5b')]['UserId'];return db[_0x9d52('0x3f')][_0x9d52('0x5a')]({'where':{'id':_0x4c33b6['params']['id'],'UserId':null}})[_0x9d52('0x23')](handleEntityNotFound(_0x5447ef,null))[_0x9d52('0x23')](function(_0x59dafd){if(_0x59dafd){_0x409fbb[_0x9d52('0x2b')]=_0x59dafd[_0x9d52('0x89')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x59dafd[_0x9d52('0x87')]}});}return null;})[_0x9d52('0x23')](handleEntityNotFound(_0x5447ef,null))['then'](function(_0x1786cd){if(_0x1786cd){_0x409fbb[_0x9d52('0x88')]=_0x1786cd[_0x9d52('0x89')]({'plain':!![]});interaction_log[_0x9d52('0x2c')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c33b6[_0x9d52('0x70')]['id'],_0x4c33b6[_0x9d52('0x70')][_0x9d52('0x3b')],_0x4c33b6[_0x9d52('0x70')][_0x9d52('0x8a')],_0x409fbb[_0x9d52('0x88')]['id'],_0x4c33b6[_0x9d52('0x5b')]?JSON[_0x9d52('0x28')](_0x4c33b6[_0x9d52('0x5b')]):_0x9d52('0x8b'));return respondWithRpcPromise(_0x9d52('0x95'),_0x9d52('0x96'),_0x409fbb);}return null;})['then'](function(_0x293b6f){if(_0x293b6f){_0x293b6f[_0x9d52('0x2b')][_0x9d52('0x8f')]=util[_0x9d52('0x82')](_0x9d52('0x90'),_0x4c33b6[_0x9d52('0x70')][_0x9d52('0x3b')]);_0x293b6f[_0x9d52('0x2b')][_0x9d52('0x91')]=_0x409fbb[_0x9d52('0x91')];_0x293b6f[_0x9d52('0x2b')]['event']='reject';respondWithRpcPromise(_0x9d52('0x93'),_0x9d52('0x93'),{'event':_0x9d52('0x97'),'message':_0x293b6f['message']},client9002);return _0x409fbb;}return null;})[_0x9d52('0x23')](respondWithResult(_0x5447ef,null))[_0x9d52('0x57')](handleError(_0x5447ef,null));};exports['download']=function(_0x48b6be,_0x3c7d69){var _0x213121=moment()[_0x9d52('0x98')]()[_0x9d52('0x99')]();var _0x21cca1=path['join'](config['root'],_0x9d52('0x9a'),_0x9d52('0x9b'),_0x9d52('0x9c'));var _0x26e5ae=path['join'](config[_0x9d52('0x75')],_0x9d52('0x9a'),_0x9d52('0x9b'),'attachments');var _0x2eac5b=util[_0x9d52('0x82')](_0x9d52('0x9d'),_0x213121);return db['MailMessage'][_0x9d52('0x5a')]({'where':{'id':_0x48b6be['params']['id']},'attributes':['id',_0x9d52('0x5b'),_0x9d52('0x9e'),'to','cc',_0x9d52('0x9f'),_0x9d52('0xa0'),'createdAt'],'include':_0x48b6be[_0x9d52('0x44')][_0x9d52('0x73')]?[{'model':db[_0x9d52('0xa1')],'as':_0x9d52('0xa2')}]:undefined})[_0x9d52('0x23')](handleEntityNotFound(_0x3c7d69,null))[_0x9d52('0x23')](function(_0x131899){if(_0x131899){var _0x227daa=_0x131899;var _0x3b5298={'from':_0x227daa[_0x9d52('0x9e')],'to':_0x227daa['to'],'subject':_0x227daa['subject'],'html':_0x227daa[_0x9d52('0x5b')],'headers':{'Date':moment(_0x227daa[_0x9d52('0xa3')])[_0x9d52('0x82')](_0x9d52('0xa4'))},'attachments':[]};if(_0x131899['cc']){_0x3b5298[_0x9d52('0xa5')]['Cc']=_0x131899['cc'];}if(_0x131899[_0x9d52('0x9f')]){_0x3b5298[_0x9d52('0xa5')][_0x9d52('0xa6')]=_0x131899['bcc'];}return new BPromise(function(_0x25128f,_0x1b5e51){if(_0x131899[_0x9d52('0xa2')]){for(var _0x1327d2=0x0;_0x1327d2<_0x131899[_0x9d52('0xa2')][_0x9d52('0x4a')];_0x1327d2++){var _0x17d109=_0x131899[_0x9d52('0xa2')][_0x1327d2];var _0x8d9927=path[_0x9d52('0x74')](_0x26e5ae,_0x17d109[_0x9d52('0x77')]);if(fs[_0x9d52('0xa7')](_0x8d9927)){_0x3b5298[_0x9d52('0x73')][_0x9d52('0xa8')]({'name':_0x17d109['name'],'contentType':_0x17d109[_0x9d52('0x51')],'data':fs[_0x9d52('0xa9')](_0x8d9927)});}}}emlformat[_0x9d52('0xaa')](_0x3b5298,function(_0x49c483,_0x3da025){if(_0x49c483)return _0x1b5e51(_0x49c483);fs['writeFileSync'](path[_0x9d52('0x74')](_0x21cca1,_0x2eac5b),_0x3da025);return _0x25128f(_0x3da025);});});}})[_0x9d52('0x23')](function(_0x4b47c7){if(_0x4b47c7){return _0x3c7d69['download'](path[_0x9d52('0x74')](_0x21cca1,_0x2eac5b),_0x2eac5b,function(_0x59fbe9){if(_0x59fbe9){console[_0x9d52('0xab')](_0x9d52('0xac'),_0x59fbe9);}else{fs[_0x9d52('0xad')](path['join'](_0x21cca1,_0x2eac5b));}});}})[_0x9d52('0x57')](handleError(_0x3c7d69,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 242683c..bf0c2e1 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 _0x7536=['hasOwnProperty','hook','exports','events','../../mysqldb','save','remove','emit'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0x7536,0x193));var _0x6753=function(_0x606fe8,_0x10b084){_0x606fe8=_0x606fe8-0x0;var _0x28b517=_0x7536[_0x606fe8];return _0x28b517;};'use strict';var EventEmitter=require(_0x6753('0x0'));var MailMessage=require(_0x6753('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6753('0x2'),'afterUpdate':'update','afterDestroy':_0x6753('0x3')};function emitEvent(_0x48a301){return function(_0x37a4df,_0x4cc2f6,_0x7d9673){MailMessageEvents[_0x6753('0x4')](_0x48a301+':'+_0x37a4df['id'],_0x37a4df);MailMessageEvents[_0x6753('0x4')](_0x48a301,_0x37a4df);_0x7d9673(null);};}for(var e in events){if(events[_0x6753('0x5')](e)){var event=events[e];MailMessage[_0x6753('0x6')](e,emitEvent(event));}}module[_0x6753('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xacf4=['update','emit','hasOwnProperty','hook','exports','events','MailMessage','setMaxListeners'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0xacf4,0xd5));var _0x4acf=function(_0x3604a8,_0xe81cd1){_0x3604a8=_0x3604a8-0x0;var _0x2c5a5b=_0xacf4[_0x3604a8];return _0x2c5a5b;};'use strict';var EventEmitter=require(_0x4acf('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x4acf('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x4acf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4acf('0x3'),'afterDestroy':'remove'};function emitEvent(_0xa45eb4){return function(_0x42f2ba,_0x1d2f14,_0x5c995d){MailMessageEvents[_0x4acf('0x4')](_0xa45eb4+':'+_0x42f2ba['id'],_0x42f2ba);MailMessageEvents[_0x4acf('0x4')](_0xa45eb4,_0x42f2ba);_0x5c995d(null);};}for(var e in events){if(events[_0x4acf('0x5')](e)){var event=events[e];MailMessage[_0x4acf('0x6')](e,emitEvent(event));}}module[_0x4acf('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index edab62c..a718122 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 _0x7646=['utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','subject','FULLTEXT','body','plainBody','fromString','models','toLowerCase','secret','UserId','findOne','update','createdAt','direction','error'];(function(_0x3bd1bd,_0x4a6a33){var _0x46bca6=function(_0x585022){while(--_0x585022){_0x3bd1bd['push'](_0x3bd1bd['shift']());}};_0x46bca6(++_0x4a6a33);}(_0x7646,0xb0));var _0x6764=function(_0x3c1a6e,_0x1e1c07){_0x3c1a6e=_0x3c1a6e-0x0;var _0xb308ec=_0x7646[_0x3c1a6e];return _0xb308ec;};'use strict';var _=require(_0x6764('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6764('0x1'));var BPromise=require(_0x6764('0x2'));var rp=require(_0x6764('0x3'));var htmlToText=require(_0x6764('0x4'));var fs=require('fs');var path=require(_0x6764('0x5'));var rimraf=require(_0x6764('0x6'));var config=require('../../config/environment');var attributes=require(_0x6764('0x7'));module[_0x6764('0x8')]=function(_0x6a8a91,_0x5814aa){return _0x6a8a91[_0x6764('0x9')](_0x6764('0xa'),attributes,{'tableName':_0x6764('0xb'),'paranoid':![],'indexes':[{'name':_0x6764('0xc'),'fields':[_0x6764('0xc')]},{'name':'fti_mail_messages','fields':['plainBody',_0x6764('0xd')],'type':_0x6764('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4def78,_0x5063fb,_0x446c05){if(_0x4def78[_0x6764('0xf')]){_0x4def78[_0x6764('0x10')]=htmlToText[_0x6764('0x11')](_0x4def78['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x446c05(null,_0x5063fb);},'afterCreate':function(_0xacb73,_0x5a215f,_0x2fd8bb){var _0x39ce78=_0x6a8a91[_0x6764('0x12')];var _0x3fde3a=_0xacb73['get']({'plain':!![]});if(_0x3fde3a['direction'][_0x6764('0x13')]()==='in'||_0x3fde3a['direction']['toLowerCase']()==='out'&&!_0x3fde3a[_0x6764('0x14')]&&!_['isNil'](_0x3fde3a[_0x6764('0x15')])){_0x39ce78['MailInteraction'][_0x6764('0x16')]({'where':{'id':_0x3fde3a['MailInteractionId']}})['then'](function(_0x28f161){if(_0x28f161){_0x28f161[_0x6764('0x17')]({'lastMsgAt':_0x3fde3a[_0x6764('0x18')],'lastMsgDirection':_0x3fde3a[_0x6764('0x19')]['toLowerCase'](),'lastMsgBody':_0x3fde3a[_0x6764('0xf')]});}})['catch'](function(_0x4ea907){console[_0x6764('0x1a')](_0x4ea907);});}_0x2fd8bb();}},'charset':_0x6764('0x1b'),'collate':_0x6764('0x1c')});}; \ No newline at end of file +var _0xee09=['lodash','util','../../config/logger','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','define','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0xee09,0x1cb));var _0x9ee0=function(_0x12d0a4,_0x4aaa5d){_0x12d0a4=_0x12d0a4-0x0;var _0x13ce16=_0xee09[_0x12d0a4];return _0x13ce16;};'use strict';var _=require(_0x9ee0('0x0'));var util=require(_0x9ee0('0x1'));var logger=require(_0x9ee0('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9ee0('0x3'));var htmlToText=require(_0x9ee0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ee0('0x5'));var config=require(_0x9ee0('0x6'));var attributes=require(_0x9ee0('0x7'));module['exports']=function(_0x1d4d73,_0x272129){return _0x1d4d73[_0x9ee0('0x8')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x9ee0('0x9'),'fields':[_0x9ee0('0xa'),'subject'],'type':_0x9ee0('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f574f,_0x190fc9,_0x2e8a6d){if(_0x3f574f[_0x9ee0('0xc')]){_0x3f574f[_0x9ee0('0xa')]=htmlToText['fromString'](_0x3f574f[_0x9ee0('0xc')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2e8a6d(null,_0x190fc9);},'afterCreate':function(_0x7b41c2,_0x5c9e0c,_0x3637e5){var _0x560c43=_0x1d4d73[_0x9ee0('0xd')];var _0x1c6a8b=_0x7b41c2[_0x9ee0('0xe')]({'plain':!![]});if(_0x1c6a8b[_0x9ee0('0xf')][_0x9ee0('0x10')]()==='in'||_0x1c6a8b['direction'][_0x9ee0('0x10')]()==='out'&&!_0x1c6a8b[_0x9ee0('0x11')]&&!_['isNil'](_0x1c6a8b[_0x9ee0('0x12')])){_0x560c43[_0x9ee0('0x13')][_0x9ee0('0x14')]({'where':{'id':_0x1c6a8b[_0x9ee0('0x15')]}})[_0x9ee0('0x16')](function(_0x569841){if(_0x569841){_0x569841[_0x9ee0('0x17')]({'lastMsgAt':_0x1c6a8b['createdAt'],'lastMsgDirection':_0x1c6a8b[_0x9ee0('0xf')][_0x9ee0('0x10')](),'lastMsgBody':_0x1c6a8b[_0x9ee0('0xc')]});}})['catch'](function(_0x478073){console[_0x9ee0('0x18')](_0x478073);});}_0x3637e5();}},'charset':_0x9ee0('0x19'),'collate':_0x9ee0('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 440f749..abdedaf 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 _0x8ad5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','lodash','util','moment','bluebird'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x8ad5,0xf1));var _0x58ad=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x8ad5[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var moment=require(_0x58ad('0x2'));var BPromise=require(_0x58ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58ad('0x4'))['db'];var utils=require(_0x58ad('0x5'));var logger=require(_0x58ad('0x6'))(_0x58ad('0x7'));var config=require(_0x58ad('0x8'));var jayson=require(_0x58ad('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x58ad('0xa')]=_[_0x58ad('0xb')](config[_0x58ad('0xa')],{'host':_0x58ad('0xc'),'port':0x18eb});var socket=require(_0x58ad('0xd'))(new Redis(config[_0x58ad('0xa')]));require(_0x58ad('0xe'))[_0x58ad('0xf')](socket);function respondWithRpcPromise(_0x6035c7,_0x4da7e4,_0xd8b943){return new BPromise(function(_0x127aea,_0x3d2e5a){return client[_0x58ad('0x10')](_0x6035c7,_0xd8b943)[_0x58ad('0x11')](function(_0x3f1c00){logger[_0x58ad('0x12')](_0x58ad('0x13'),_0x4da7e4,'request\x20sent');logger[_0x58ad('0x14')](_0x58ad('0x15'),_0x4da7e4,_0x58ad('0x16'),JSON[_0x58ad('0x17')](_0x3f1c00));if(_0x3f1c00[_0x58ad('0x18')]){if(_0x3f1c00[_0x58ad('0x18')][_0x58ad('0x19')]===0x1f4){logger[_0x58ad('0x18')]('MailMessage,\x20%s,\x20%s',_0x4da7e4,_0x3f1c00['error']['message']);return _0x3d2e5a(_0x3f1c00['error'][_0x58ad('0x1a')]);}logger['error'](_0x58ad('0x13'),_0x4da7e4,_0x3f1c00[_0x58ad('0x18')][_0x58ad('0x1a')]);return _0x127aea(_0x3f1c00[_0x58ad('0x18')][_0x58ad('0x1a')]);}else{logger['info'](_0x58ad('0x13'),_0x4da7e4,_0x58ad('0x16'));_0x127aea(_0x3f1c00[_0x58ad('0x1b')][_0x58ad('0x1a')]);}})[_0x58ad('0x1c')](function(_0x38de51){logger[_0x58ad('0x18')](_0x58ad('0x13'),_0x4da7e4,_0x38de51);_0x3d2e5a(_0x38de51);});});}exports['CreateMailMessage']=function(_0x3266d9){var _0x422ee4=this;return new Promise(function(_0x40f899,_0x5e4ff8){return db[_0x58ad('0x1d')][_0x58ad('0x1e')](_0x3266d9[_0x58ad('0x1f')],{'raw':_0x3266d9['options']?_0x3266d9[_0x58ad('0x20')][_0x58ad('0x21')]===undefined?!![]:![]:!![]})[_0x58ad('0x11')](function(_0xf2129c){logger['info'](_0x58ad('0x22'),_0x3266d9);logger[_0x58ad('0x14')](_0x58ad('0x22'),_0x3266d9,JSON[_0x58ad('0x17')](_0xf2129c));_0x40f899(_0xf2129c);})[_0x58ad('0x1c')](function(_0x150a2b){logger[_0x58ad('0x18')](_0x58ad('0x22'),_0x150a2b['message'],_0x3266d9);_0x5e4ff8(_0x422ee4[_0x58ad('0x18')](0x1f4,_0x150a2b['message']));});});}; \ No newline at end of file +var _0x5d58=['register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateMailMessage','create','body','raw','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x5d58,0x187));var _0x85d5=function(_0x1855db,_0x19dea2){_0x1855db=_0x1855db-0x0;var _0x4c07ec=_0x5d58[_0x1855db];return _0x4c07ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});config[_0x85d5('0x7')]=_['defaults'](config[_0x85d5('0x7')],{'host':_0x85d5('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85d5('0x7')]));require('./mailMessage.socket')[_0x85d5('0x9')](socket);function respondWithRpcPromise(_0x2ce6b9,_0x258f0c,_0x488dcb){return new BPromise(function(_0x499b36,_0x4e147a){return client[_0x85d5('0xa')](_0x2ce6b9,_0x488dcb)[_0x85d5('0xb')](function(_0xde1063){logger[_0x85d5('0xc')](_0x85d5('0xd'),_0x258f0c,_0x85d5('0xe'));logger[_0x85d5('0xf')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x258f0c,'request\x20sent',JSON['stringify'](_0xde1063));if(_0xde1063[_0x85d5('0x10')]){if(_0xde1063[_0x85d5('0x10')][_0x85d5('0x11')]===0x1f4){logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);return _0x4e147a(_0xde1063['error'][_0x85d5('0x12')]);}logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);return _0x499b36(_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);}else{logger[_0x85d5('0xc')](_0x85d5('0xd'),_0x258f0c,_0x85d5('0xe'));_0x499b36(_0xde1063[_0x85d5('0x13')][_0x85d5('0x12')]);}})[_0x85d5('0x14')](function(_0x3df634){logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0x3df634);_0x4e147a(_0x3df634);});});}exports[_0x85d5('0x15')]=function(_0x1d6134){var _0x53bd11=this;return new Promise(function(_0xc56ad1,_0x133fa9){return db['MailMessage'][_0x85d5('0x16')](_0x1d6134[_0x85d5('0x17')],{'raw':_0x1d6134['options']?_0x1d6134['options'][_0x85d5('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2f2bae){logger['info'](_0x85d5('0x15'),_0x1d6134);logger[_0x85d5('0xf')]('CreateMailMessage',_0x1d6134,JSON['stringify'](_0x2f2bae));_0xc56ad1(_0x2f2bae);})['catch'](function(_0x5f0268){logger[_0x85d5('0x10')](_0x85d5('0x15'),_0x5f0268[_0x85d5('0x12')],_0x1d6134);_0x133fa9(_0x53bd11[_0x85d5('0x10')](0x1f4,_0x5f0268[_0x85d5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 2e19ddc..dad908c 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 _0x3826=['./mailMessage.events','save','update','emit','removeListener','register','length','mailMessage:'];(function(_0x274909,_0x4d99e5){var _0x253240=function(_0x194733){while(--_0x194733){_0x274909['push'](_0x274909['shift']());}};_0x253240(++_0x4d99e5);}(_0x3826,0x190));var _0x6382=function(_0xc72a72,_0xfaaf35){_0xc72a72=_0xc72a72-0x0;var _0x20f9a9=_0x3826[_0xc72a72];return _0x20f9a9;};'use strict';var MailMessageEvents=require(_0x6382('0x0'));var events=[_0x6382('0x1'),'remove',_0x6382('0x2')];function createListener(_0x1fa178,_0x2c5cbc){return function(_0x1861a2){_0x2c5cbc[_0x6382('0x3')](_0x1fa178,_0x1861a2);};}function removeListener(_0x26b9af,_0x5384b5){return function(){MailMessageEvents[_0x6382('0x4')](_0x26b9af,_0x5384b5);};}exports[_0x6382('0x5')]=function(_0x38359d){for(var _0x2c34ef=0x0,_0x357b87=events[_0x6382('0x6')];_0x2c34ef<_0x357b87;_0x2c34ef++){var _0x3be9b9=events[_0x2c34ef];var _0x4f5e31=createListener(_0x6382('0x7')+_0x3be9b9,_0x38359d);MailMessageEvents['on'](_0x3be9b9,_0x4f5e31);}}; \ No newline at end of file +var _0xba6e=['update','emit','register','mailMessage:','./mailMessage.events','save'];(function(_0x3e8697,_0x22f12d){var _0x282b69=function(_0x196ad3){while(--_0x196ad3){_0x3e8697['push'](_0x3e8697['shift']());}};_0x282b69(++_0x22f12d);}(_0xba6e,0x12a));var _0xeba6=function(_0x3082ae,_0x504deb){_0x3082ae=_0x3082ae-0x0;var _0x4d42fc=_0xba6e[_0x3082ae];return _0x4d42fc;};'use strict';var MailMessageEvents=require(_0xeba6('0x0'));var events=[_0xeba6('0x1'),'remove',_0xeba6('0x2')];function createListener(_0xd32c64,_0x12eb1f){return function(_0x3c1418){_0x12eb1f[_0xeba6('0x3')](_0xd32c64,_0x3c1418);};}function removeListener(_0x2be9b8,_0x56ad15){return function(){MailMessageEvents['removeListener'](_0x2be9b8,_0x56ad15);};}exports[_0xeba6('0x4')]=function(_0x1ff200){for(var _0x535485=0x0,_0x2ca5b5=events['length'];_0x535485<_0x2ca5b5;_0x535485++){var _0x4be89c=events[_0x535485];var _0x590f26=createListener(_0xeba6('0x5')+_0x4be89c,_0x1ff200);MailMessageEvents['on'](_0x4be89c,_0x590f26);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index db92913..fe63b15 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 _0xd1b3=['addTeams','/:id/users','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','post'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd1b3,0x1e4));var _0x3d1b=function(_0x3cbc58,_0x29ef77){_0x3cbc58=_0x3cbc58-0x0;var _0xd1d8e1=_0xd1b3[_0x3cbc58];return _0xd1d8e1;};'use strict';var multer=require(_0x3d1b('0x0'));var util=require(_0x3d1b('0x1'));var path=require(_0x3d1b('0x2'));var timeout=require(_0x3d1b('0x3'));var express=require(_0x3d1b('0x4'));var router=express[_0x3d1b('0x5')]();var auth=require(_0x3d1b('0x6'));var interaction=require(_0x3d1b('0x7'));var config=require('../../config/environment');var controller=require(_0x3d1b('0x8'));router[_0x3d1b('0x9')]('/',auth[_0x3d1b('0xa')](),controller[_0x3d1b('0xb')]);router[_0x3d1b('0x9')](_0x3d1b('0xc'),auth[_0x3d1b('0xa')](),controller['describe']);router[_0x3d1b('0x9')](_0x3d1b('0xd'),auth[_0x3d1b('0xa')](),controller[_0x3d1b('0xe')]);router['get'](_0x3d1b('0xf'),auth[_0x3d1b('0xa')](),controller['getMembers']);router['get'](_0x3d1b('0x10'),auth[_0x3d1b('0xa')](),controller[_0x3d1b('0x11')]);router[_0x3d1b('0x9')]('/:id/users',auth[_0x3d1b('0xa')](),controller[_0x3d1b('0x12')]);router[_0x3d1b('0x13')]('/',auth[_0x3d1b('0xa')](),controller['create']);router[_0x3d1b('0x13')]('/:id/teams',auth[_0x3d1b('0xa')](),controller[_0x3d1b('0x14')]);router[_0x3d1b('0x13')](_0x3d1b('0x15'),auth[_0x3d1b('0xa')](),controller[_0x3d1b('0x16')]);router[_0x3d1b('0x17')](_0x3d1b('0xd'),auth[_0x3d1b('0xa')](),controller['update']);router[_0x3d1b('0x18')](_0x3d1b('0xd'),auth[_0x3d1b('0xa')](),controller['destroy']);router[_0x3d1b('0x18')](_0x3d1b('0x10'),auth[_0x3d1b('0xa')](),controller[_0x3d1b('0x19')]);router[_0x3d1b('0x18')](_0x3d1b('0x15'),auth[_0x3d1b('0xa')](),controller[_0x3d1b('0x1a')]);module[_0x3d1b('0x1b')]=router; \ No newline at end of file +var _0x7d01=['../../components/auth/service','../../components/interaction/service','isAuthenticated','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','exports','multer','util','path','express','Router'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x7d01,0x1a4));var _0x17d0=function(_0x545794,_0x475d13){_0x545794=_0x545794-0x0;var _0x318028=_0x7d01[_0x545794];return _0x318028;};'use strict';var multer=require(_0x17d0('0x0'));var util=require(_0x17d0('0x1'));var path=require(_0x17d0('0x2'));var timeout=require('connect-timeout');var express=require(_0x17d0('0x3'));var router=express[_0x17d0('0x4')]();var auth=require(_0x17d0('0x5'));var interaction=require(_0x17d0('0x6'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router['get']('/',auth[_0x17d0('0x7')](),controller['index']);router[_0x17d0('0x8')]('/describe',auth[_0x17d0('0x7')](),controller[_0x17d0('0x9')]);router[_0x17d0('0x8')](_0x17d0('0xa'),auth['isAuthenticated'](),controller[_0x17d0('0xb')]);router[_0x17d0('0x8')](_0x17d0('0xc'),auth[_0x17d0('0x7')](),controller[_0x17d0('0xd')]);router[_0x17d0('0x8')](_0x17d0('0xe'),auth[_0x17d0('0x7')](),controller[_0x17d0('0xf')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x17d0('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x17d0('0x10')](_0x17d0('0xe'),auth[_0x17d0('0x7')](),controller[_0x17d0('0x11')]);router[_0x17d0('0x10')](_0x17d0('0x12'),auth[_0x17d0('0x7')](),controller[_0x17d0('0x13')]);router[_0x17d0('0x14')](_0x17d0('0xa'),auth[_0x17d0('0x7')](),controller[_0x17d0('0x15')]);router[_0x17d0('0x16')](_0x17d0('0xa'),auth[_0x17d0('0x7')](),controller['destroy']);router[_0x17d0('0x16')](_0x17d0('0xe'),auth[_0x17d0('0x7')](),controller[_0x17d0('0x17')]);router['delete']('/:id/users',auth[_0x17d0('0x7')](),controller['removeAgents']);module[_0x17d0('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 8bb37f3..eeeca72 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 _0xeaec=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0xeaec,0xde));var _0xceae=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xeaec[_0x5c4f6b];return _0x104c4e;};'use strict';var Sequelize=require(_0xceae('0x0'));module[_0xceae('0x1')]={'name':{'type':Sequelize[_0xceae('0x2')],'unique':_0xceae('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xceae('0x2')]},'timeout':{'type':Sequelize[_0xceae('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xceae('0x5')](_0xceae('0x6'),_0xceae('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x813b=['sequelize','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x418432,_0x537680){var _0x3023a9=function(_0x1c42d0){while(--_0x1c42d0){_0x418432['push'](_0x418432['shift']());}};_0x3023a9(++_0x537680);}(_0x813b,0x126));var _0xb813=function(_0x6124ef,_0x3be19d){_0x6124ef=_0x6124ef-0x0;var _0x5b5448=_0x813b[_0x6124ef];return _0x5b5448;};'use strict';var Sequelize=require(_0xb813('0x0'));module['exports']={'name':{'type':Sequelize[_0xb813('0x1')],'unique':_0xb813('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb813('0x1')]},'timeout':{'type':Sequelize[_0xb813('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb813('0x4')]('rrmemory',_0xb813('0x5'),_0xb813('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 96f2405..117e283 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 _0x1b31=['findAll','rows','catch','show','params','include','merge','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','MailQueueId','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','SIP','Team','getTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','UserMailQueue','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','ids','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','get','MailQueues','UserProfileResource','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','MailQueue','includeAll'];(function(_0x17b4b8,_0x45c731){var _0x124ce1=function(_0x21ec37){while(--_0x21ec37){_0x17b4b8['push'](_0x17b4b8['shift']());}};_0x124ce1(++_0x45c731);}(_0x1b31,0xd5));var _0x11b3=function(_0x14a3a2,_0x5801f3){_0x14a3a2=_0x14a3a2-0x0;var _0x210e3b=_0x1b31[_0x14a3a2];return _0x210e3b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x11b3('0x0'));var rimraf=require(_0x11b3('0x1'));var zipdir=require(_0x11b3('0x2'));var jsonpatch=require(_0x11b3('0x3'));var rp=require(_0x11b3('0x4'));var moment=require(_0x11b3('0x5'));var BPromise=require(_0x11b3('0x6'));var Mustache=require(_0x11b3('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x11b3('0x8'));var ejs=require(_0x11b3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x11b3('0xa'));var crypto=require(_0x11b3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x11b3('0xc'));var toCsv=require(_0x11b3('0x8'));var querystring=require(_0x11b3('0xd'));var Papa=require(_0x11b3('0xe'));var Redis=require(_0x11b3('0xf'));var authService=require(_0x11b3('0x10'));var qs=require(_0x11b3('0x11'));var as=require(_0x11b3('0x12'));var hardwareService=require(_0x11b3('0x13'));var logger=require(_0x11b3('0x14'))(_0x11b3('0x15'));var utils=require(_0x11b3('0x16'));var config=require(_0x11b3('0x17'));var db=require(_0x11b3('0x18'))['db'];config[_0x11b3('0x19')]=_[_0x11b3('0x1a')](config[_0x11b3('0x19')],{'host':_0x11b3('0x1b'),'port':0x18eb});var socket=require(_0x11b3('0x1c'))(new Redis(config['redis']));require(_0x11b3('0x1d'))['register'](socket);function respondWithStatusCode(_0x3d6673,_0x36ef68){_0x36ef68=_0x36ef68||0xcc;return function(_0x170e7c){if(_0x170e7c){return _0x3d6673['sendStatus'](_0x36ef68);}return _0x3d6673[_0x11b3('0x1e')](_0x36ef68)[_0x11b3('0x1f')]();};}function respondWithResult(_0x512650,_0x5c9157){_0x5c9157=_0x5c9157||0xc8;return function(_0x518061){if(_0x518061){return _0x512650[_0x11b3('0x1e')](_0x5c9157)[_0x11b3('0x20')](_0x518061);}};}function respondWithFilteredResult(_0x35187d,_0x66401b){return function(_0x40c0d7){if(_0x40c0d7){var _0x56d25f=_0x40c0d7[_0x11b3('0x21')],_0x115e67=_0x66401b['offset'],_0x56d9b8=_0x66401b[_0x11b3('0x22')]+_0x66401b[_0x11b3('0x23')],_0x18f132;if(_0x56d9b8>=_0x56d25f){_0x56d9b8=_0x56d25f;_0x18f132=0xc8;}else{_0x18f132=0xce;}_0x35187d['status'](_0x18f132);return _0x35187d['set'](_0x11b3('0x24'),_0x115e67+'-'+_0x56d9b8+'/'+_0x56d25f)[_0x11b3('0x20')](_0x40c0d7);}return null;};}function patchUpdates(_0x161608){return function(_0x3f3c09){try{jsonpatch[_0x11b3('0x25')](_0x3f3c09,_0x161608,!![]);}catch(_0x59f24b){return BPromise[_0x11b3('0x26')](_0x59f24b);}return _0x3f3c09[_0x11b3('0x27')]();};}function saveUpdates(_0x5b1b7f,_0x56ee99){return function(_0x189945){if(_0x189945){return _0x189945['update'](_0x5b1b7f)['then'](function(_0x5891d1){return _0x5891d1;});}return null;};}function removeEntity(_0x4e9626,_0x1fe8e5){return function(_0x2acbe4){if(_0x2acbe4){return _0x2acbe4[_0x11b3('0x28')]()['then'](function(){var _0x1c297e=_0x2acbe4[_0x11b3('0x29')]({'plain':!![]});var _0x47cc0f=_0x11b3('0x2a');return db[_0x11b3('0x2b')][_0x11b3('0x28')]({'where':{'type':_0x47cc0f,'resourceId':_0x1c297e['id']}})[_0x11b3('0x2c')](function(){return _0x2acbe4;});})['then'](function(){_0x4e9626[_0x11b3('0x1e')](0xcc)[_0x11b3('0x1f')]();});}};}function handleEntityNotFound(_0x43d5db,_0x1daf2e){return function(_0x5ae2d2){if(!_0x5ae2d2){_0x43d5db['sendStatus'](0x194);}return _0x5ae2d2;};}function handleError(_0x51a0ed,_0x3959a7){_0x3959a7=_0x3959a7||0x1f4;return function(_0x598cae){logger['error'](_0x598cae[_0x11b3('0x2d')]);if(_0x598cae['name']){delete _0x598cae[_0x11b3('0x2e')];}_0x51a0ed[_0x11b3('0x1e')](_0x3959a7)[_0x11b3('0x2f')](_0x598cae);};}exports[_0x11b3('0x30')]=function(_0x4074bd,_0x63d19){var _0x2172ce={},_0x4c02be={},_0x24af59={'count':0x0,'rows':[]};var _0x30468e=_[_0x11b3('0x31')](db['MailQueue'][_0x11b3('0x32')],function(_0x78f197){return{'name':_0x78f197[_0x11b3('0x33')],'type':_0x78f197[_0x11b3('0x34')][_0x11b3('0x35')]};});_0x4c02be['model']=_[_0x11b3('0x31')](_0x30468e,_0x11b3('0x2e'));_0x4c02be[_0x11b3('0x36')]=_[_0x11b3('0x37')](_0x4074bd[_0x11b3('0x36')]);_0x4c02be[_0x11b3('0x38')]=_[_0x11b3('0x39')](_0x4c02be[_0x11b3('0x3a')],_0x4c02be[_0x11b3('0x36')]);_0x2172ce[_0x11b3('0x3b')]=_[_0x11b3('0x39')](_0x4c02be[_0x11b3('0x3a')],qs['fields'](_0x4074bd[_0x11b3('0x36')][_0x11b3('0x3c')]));_0x2172ce[_0x11b3('0x3b')]=_0x2172ce[_0x11b3('0x3b')][_0x11b3('0x3d')]?_0x2172ce[_0x11b3('0x3b')]:_0x4c02be[_0x11b3('0x3a')];if(!_0x4074bd[_0x11b3('0x36')][_0x11b3('0x3e')](_0x11b3('0x3f'))){_0x2172ce[_0x11b3('0x23')]=qs[_0x11b3('0x23')](_0x4074bd[_0x11b3('0x36')][_0x11b3('0x23')]);_0x2172ce['offset']=qs['offset'](_0x4074bd[_0x11b3('0x36')][_0x11b3('0x22')]);}_0x2172ce[_0x11b3('0x40')]=qs['sort'](_0x4074bd[_0x11b3('0x36')][_0x11b3('0x41')]);_0x2172ce[_0x11b3('0x42')]=qs[_0x11b3('0x38')](_[_0x11b3('0x43')](_0x4074bd[_0x11b3('0x36')],_0x4c02be[_0x11b3('0x38')]));if(_0x4074bd['query']['filter']){_0x2172ce[_0x11b3('0x42')]=_['merge'](_0x2172ce[_0x11b3('0x42')],{'$or':_[_0x11b3('0x31')](_0x30468e,function(_0x5ac892){if(_0x5ac892[_0x11b3('0x34')]!==_0x11b3('0x44')){var _0x1cbd78={};_0x1cbd78[_0x5ac892[_0x11b3('0x2e')]]={'$like':'%'+_0x4074bd[_0x11b3('0x36')][_0x11b3('0x45')]+'%'};return _0x1cbd78;}})});}_0x2172ce=_['merge']({},_0x2172ce,_0x4074bd[_0x11b3('0x46')]);var _0x44c96b={'where':_0x2172ce[_0x11b3('0x42')]};return db[_0x11b3('0x47')]['count'](_0x44c96b)[_0x11b3('0x2c')](function(_0x39a379){_0x24af59[_0x11b3('0x21')]=_0x39a379;if(_0x4074bd[_0x11b3('0x36')][_0x11b3('0x48')]){_0x2172ce['include']=[{'all':!![]}];}return db['MailQueue'][_0x11b3('0x49')](_0x2172ce);})[_0x11b3('0x2c')](function(_0x29aa76){_0x24af59[_0x11b3('0x4a')]=_0x29aa76;return _0x24af59;})[_0x11b3('0x2c')](respondWithFilteredResult(_0x63d19,_0x2172ce))[_0x11b3('0x4b')](handleError(_0x63d19,null));};exports[_0x11b3('0x4c')]=function(_0x333b99,_0x131c30){var _0x34e030={'raw':!![],'where':{'id':_0x333b99[_0x11b3('0x4d')]['id']}},_0x331121={};_0x331121[_0x11b3('0x3a')]=_[_0x11b3('0x37')](db[_0x11b3('0x47')]['rawAttributes']);_0x331121['query']=_['keys'](_0x333b99[_0x11b3('0x36')]);_0x331121['filters']=_['intersection'](_0x331121[_0x11b3('0x3a')],_0x331121[_0x11b3('0x36')]);_0x34e030[_0x11b3('0x3b')]=_['intersection'](_0x331121['model'],qs[_0x11b3('0x3c')](_0x333b99[_0x11b3('0x36')][_0x11b3('0x3c')]));_0x34e030[_0x11b3('0x3b')]=_0x34e030[_0x11b3('0x3b')][_0x11b3('0x3d')]?_0x34e030[_0x11b3('0x3b')]:_0x331121[_0x11b3('0x3a')];if(_0x333b99[_0x11b3('0x36')][_0x11b3('0x48')]){_0x34e030[_0x11b3('0x4e')]=[{'all':!![]}];}_0x34e030=_[_0x11b3('0x4f')]({},_0x34e030,_0x333b99['options']);return db['MailQueue'][_0x11b3('0x50')](_0x34e030)[_0x11b3('0x2c')](handleEntityNotFound(_0x131c30,null))[_0x11b3('0x2c')](respondWithResult(_0x131c30,null))[_0x11b3('0x4b')](handleError(_0x131c30,null));};exports[_0x11b3('0x51')]=function(_0xa2c567,_0x272759){return db['MailQueue']['create'](_0xa2c567[_0x11b3('0x52')],{})['then'](function(_0x856507){var _0x34bf76=_0xa2c567[_0x11b3('0x53')][_0x11b3('0x29')]({'plain':!![]});if(!_0x34bf76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34bf76['role']===_0x11b3('0x53')){var _0x26ed0c=_0x856507['get']({'plain':!![]});var _0x390778=_0x11b3('0x2a');return db[_0x11b3('0x54')]['find']({'where':{'name':_0x390778,'userProfileId':_0x34bf76[_0x11b3('0x55')]},'raw':!![]})[_0x11b3('0x2c')](function(_0x552c81){if(_0x552c81&&_0x552c81[_0x11b3('0x56')]===0x0){return db[_0x11b3('0x2b')][_0x11b3('0x51')]({'name':_0x26ed0c[_0x11b3('0x2e')],'resourceId':_0x26ed0c['id'],'type':_0x552c81[_0x11b3('0x2e')],'sectionId':_0x552c81['id']},{})[_0x11b3('0x2c')](function(){return _0x856507;});}else{return _0x856507;}})[_0x11b3('0x4b')](function(_0x1c3141){logger[_0x11b3('0x57')](_0x11b3('0x58'),_0x1c3141);throw _0x1c3141;});}return _0x856507;})[_0x11b3('0x2c')](respondWithResult(_0x272759,0xc9))[_0x11b3('0x4b')](handleError(_0x272759,null));};exports['update']=function(_0x39d544,_0x4cd0f1){if(_0x39d544[_0x11b3('0x52')]['id']){delete _0x39d544[_0x11b3('0x52')]['id'];}return db[_0x11b3('0x47')]['find']({'where':{'id':_0x39d544['params']['id']}})[_0x11b3('0x2c')](handleEntityNotFound(_0x4cd0f1,null))[_0x11b3('0x2c')](saveUpdates(_0x39d544[_0x11b3('0x52')],null))['then'](respondWithResult(_0x4cd0f1,null))['catch'](handleError(_0x4cd0f1,null));};exports[_0x11b3('0x28')]=function(_0x14a853,_0x1ee891){return db[_0x11b3('0x47')][_0x11b3('0x50')]({'where':{'id':_0x14a853['params']['id']}})[_0x11b3('0x2c')](handleEntityNotFound(_0x1ee891,null))[_0x11b3('0x2c')](removeEntity(_0x1ee891,null))[_0x11b3('0x4b')](handleError(_0x1ee891,null));};exports[_0x11b3('0x59')]=function(_0x494a34,_0x5a1613){return db['MailQueue'][_0x11b3('0x59')]()[_0x11b3('0x2c')](respondWithResult(_0x5a1613,null))['catch'](handleError(_0x5a1613,null));};exports[_0x11b3('0x5a')]=function(_0x2860f5,_0x21ce77,_0xdc5465){var _0x291b79={'raw':!![],'where':{}},_0x174288={},_0x5d2ead;return db[_0x11b3('0x47')][_0x11b3('0x5b')]({'where':{'id':_0x2860f5[_0x11b3('0x4d')]['id']}})[_0x11b3('0x2c')](handleEntityNotFound(_0x21ce77,null))['then'](function(_0x446b6f){if(_0x446b6f){_0x5d2ead=_0x446b6f[_0x11b3('0x29')]({'plain':!![]});_0x174288[_0x11b3('0x3a')]=_[_0x11b3('0x37')](db['UserMailQueue'][_0x11b3('0x32')]);_0x174288['query']=_[_0x11b3('0x37')](_0x2860f5[_0x11b3('0x36')]);_0x174288['filters']=_[_0x11b3('0x39')](_0x174288['model'],_0x174288[_0x11b3('0x36')]);_0x291b79[_0x11b3('0x3b')]=_['intersection'](_0x174288['model'],qs['fields'](_0x2860f5[_0x11b3('0x36')][_0x11b3('0x3c')]));_0x291b79[_0x11b3('0x3b')]=_0x291b79[_0x11b3('0x3b')][_0x11b3('0x3d')]?_0x291b79[_0x11b3('0x3b')]:_0x174288['model'];if(!_0x2860f5[_0x11b3('0x36')][_0x11b3('0x3e')]('nolimit')){_0x291b79['limit']=qs[_0x11b3('0x23')](_0x2860f5[_0x11b3('0x36')][_0x11b3('0x23')]);_0x291b79[_0x11b3('0x22')]=qs[_0x11b3('0x22')](_0x2860f5[_0x11b3('0x36')][_0x11b3('0x22')]);}_0x291b79[_0x11b3('0x40')]=qs[_0x11b3('0x41')](_0x2860f5['query'][_0x11b3('0x41')]);_0x291b79[_0x11b3('0x42')]=qs['filters'](_['pick'](_0x2860f5[_0x11b3('0x36')],_0x174288[_0x11b3('0x38')]));_0x291b79[_0x11b3('0x42')][_0x11b3('0x5c')]=_0x446b6f['id'];if(_0x2860f5[_0x11b3('0x36')][_0x11b3('0x45')]){_0x291b79['where']=_[_0x11b3('0x4f')](_0x291b79[_0x11b3('0x42')],{'$or':_[_0x11b3('0x31')](_0x291b79[_0x11b3('0x3b')],function(_0x468216){var _0x5994ff={};_0x5994ff[_0x468216]={'$like':'%'+_0x2860f5[_0x11b3('0x36')][_0x11b3('0x45')]+'%'};return _0x5994ff;})});}_0x291b79=_[_0x11b3('0x4f')]({},_0x291b79,_0x2860f5['options']);return db['UserMailQueue'][_0x11b3('0x49')](_0x291b79);}})['then'](function(_0x11e1e7){if(_0x11e1e7){return db['User'][_0x11b3('0x5d')]({'where':{'id':_[_0x11b3('0x31')](_0x11e1e7,_0x11b3('0x5e')),'role':_0x11b3('0x5f')},'attributes':['id','name',_0x11b3('0x60'),_0x11b3('0x61'),_0x11b3('0x62')]});}})[_0x11b3('0x2c')](function(_0x5960db){if(_0x5960db){return{'count':_0x5960db[_0x11b3('0x21')],'rows':_[_0x11b3('0x31')](_0x5960db[_0x11b3('0x4a')],function(_0x474ea5){return{'membername':_0x474ea5[_0x11b3('0x2e')],'UserId':_0x474ea5['id'],'queue_name':_0x5d2ead[_0x11b3('0x2e')],'MailQueueId':_0x5d2ead['id'],'interface':util['format']('%s/%s',_0x11b3('0x63'),_0x474ea5['name']),'penalty':0x0,'paused':_0x474ea5[_0x11b3('0x60')],'createdAt':_0x474ea5['createdAt'],'updatedAt':_0x474ea5[_0x11b3('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x11b3('0x2c')](respondWithFilteredResult(_0x21ce77,_0x291b79))[_0x11b3('0x4b')](handleError(_0x21ce77,null));};exports['getTeams']=function(_0x20d35a,_0xbbe184,_0x483be5){var _0x4cbfc4={};var _0x35705f={};var _0x188d52;var _0x5f69de;return db[_0x11b3('0x47')][_0x11b3('0x5b')]({'where':{'id':_0x20d35a[_0x11b3('0x4d')]['id']}})[_0x11b3('0x2c')](handleEntityNotFound(_0xbbe184,null))[_0x11b3('0x2c')](function(_0x3b0af4){if(_0x3b0af4){_0x188d52=_0x3b0af4;_0x35705f[_0x11b3('0x3a')]=_[_0x11b3('0x37')](db[_0x11b3('0x64')][_0x11b3('0x32')]);_0x35705f[_0x11b3('0x36')]=_[_0x11b3('0x37')](_0x20d35a[_0x11b3('0x36')]);_0x35705f[_0x11b3('0x38')]=_['intersection'](_0x35705f[_0x11b3('0x3a')],_0x35705f['query']);_0x4cbfc4['attributes']=_[_0x11b3('0x39')](_0x35705f['model'],qs['fields'](_0x20d35a[_0x11b3('0x36')][_0x11b3('0x3c')]));_0x4cbfc4[_0x11b3('0x3b')]=_0x4cbfc4[_0x11b3('0x3b')]['length']?_0x4cbfc4[_0x11b3('0x3b')]:_0x35705f[_0x11b3('0x3a')];_0x4cbfc4[_0x11b3('0x40')]=qs[_0x11b3('0x41')](_0x20d35a['query'][_0x11b3('0x41')]);_0x4cbfc4[_0x11b3('0x42')]=qs[_0x11b3('0x38')](_['pick'](_0x20d35a[_0x11b3('0x36')],_0x35705f[_0x11b3('0x38')]));if(_0x20d35a[_0x11b3('0x36')][_0x11b3('0x45')]){_0x4cbfc4[_0x11b3('0x42')]=_[_0x11b3('0x4f')](_0x4cbfc4[_0x11b3('0x42')],{'$or':_[_0x11b3('0x31')](_0x4cbfc4[_0x11b3('0x3b')],function(_0x58d759){var _0x332828={};_0x332828[_0x58d759]={'$like':'%'+_0x20d35a[_0x11b3('0x36')]['filter']+'%'};return _0x332828;})});}_0x4cbfc4=_[_0x11b3('0x4f')]({},_0x4cbfc4,_0x20d35a['options']);return _0x188d52[_0x11b3('0x65')](_0x4cbfc4);}})[_0x11b3('0x2c')](function(_0x2cebac){if(_0x2cebac){_0x5f69de=_0x2cebac['length'];if(!_0x20d35a[_0x11b3('0x36')][_0x11b3('0x3e')](_0x11b3('0x3f'))){_0x4cbfc4[_0x11b3('0x23')]=qs[_0x11b3('0x23')](_0x20d35a[_0x11b3('0x36')][_0x11b3('0x23')]);_0x4cbfc4[_0x11b3('0x22')]=qs[_0x11b3('0x22')](_0x20d35a['query'][_0x11b3('0x22')]);}return _0x188d52[_0x11b3('0x65')](_0x4cbfc4);}})[_0x11b3('0x2c')](function(_0x151bb9){if(_0x151bb9){return _0x151bb9?{'count':_0x5f69de,'rows':_0x151bb9}:null;}})[_0x11b3('0x2c')](respondWithResult(_0xbbe184,null))[_0x11b3('0x4b')](handleError(_0xbbe184,null));};exports['addTeams']=function(_0x4dc72d,_0x3f488f,_0x41180a){var _0x4e2ece=_0x4dc72d['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x4e2ece},'attributes':['id'],'include':[{'model':db[_0x11b3('0x66')],'as':_0x11b3('0x67'),'attributes':['id',_0x11b3('0x2e'),_0x11b3('0x68'),_0x11b3('0x69'),_0x11b3('0x6a')],'raw':!![]}]})[_0x11b3('0x2c')](function(_0x5ec913){if(_0x5ec913){var _0x484750=_[_0x11b3('0x6b')](_0x5ec913,function(_0x5b4b73){var _0x4639fe=_0x5b4b73[_0x11b3('0x29')]({'plain':!![]});return _0x4639fe['Agents'];});return db[_0x11b3('0x47')][_0x11b3('0x50')]({'where':{'id':_0x4dc72d[_0x11b3('0x4d')]['id']}})[_0x11b3('0x2c')](function(_0x2305c0){return db[_0x11b3('0x6c')][_0x11b3('0x6d')](function(_0x380ad9){return _0x2305c0['addTeams'](_0x4e2ece,{'transaction':_0x380ad9})[_0x11b3('0x2c')](function(){return BPromise['each'](_0x484750,function(_0x3d1f16){return db[_0x11b3('0x6e')][_0x11b3('0x6f')]({'where':{'UserId':_0x3d1f16['id'],'MailQueueId':_0x4dc72d[_0x11b3('0x4d')]['id']},'transaction':_0x380ad9});});})['then'](function(){_0x484750['forEach'](function(_0x61f976){socket[_0x11b3('0x70')](_0x11b3('0x71'),{'UserId':_0x61f976['id'],'MailQueueId':_0x2305c0['id']});});});});});}})[_0x11b3('0x2c')](respondWithStatusCode(_0x3f488f,null))[_0x11b3('0x4b')](handleError(_0x3f488f,null));};exports[_0x11b3('0x72')]=function(_0x4c0af9,_0x5fb376,_0x27b3b9){return db[_0x11b3('0x64')][_0x11b3('0x49')]({'where':{'id':_0x4c0af9['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x11b3('0x66')],'as':_0x11b3('0x67'),'attributes':['id'],'raw':!![]}]})[_0x11b3('0x2c')](handleEntityNotFound(_0x5fb376,null))[_0x11b3('0x2c')](function(_0x5ad5c5){var _0x360d16=_[_0x11b3('0x31')](_0x5ad5c5,'id');var _0x461d3e=[];var _0x44a7dd=[];var _0x28a177=squel[_0x11b3('0x73')]();_0x28a177[_0x11b3('0x74')](_0x11b3('0x75'))[_0x11b3('0x76')](_0x11b3('0x77'),'tq')[_0x11b3('0x78')](_0x11b3('0x79'),'ut',_0x11b3('0x7a'))[_0x11b3('0x42')](_0x11b3('0x7b'),_0x4c0af9[_0x11b3('0x4d')]['id']);for(var _0xae2ea9=0x0;_0xae2ea9<_0x5ad5c5[_0x11b3('0x3d')];_0xae2ea9+=0x1){let _0x3f5a6f=_0x5ad5c5[_0xae2ea9];for(var _0x218bef=0x0;_0x218bef<_0x3f5a6f[_0x11b3('0x67')][_0x11b3('0x3d')];_0x218bef+=0x1){let _0x51364f=_0x3f5a6f[_0x11b3('0x67')][_0x218bef];var _0x59e4db=_0x28a177['clone']();_0x59e4db[_0x11b3('0x42')](_0x11b3('0x7c'),_0x51364f['id']);_0x44a7dd[_0x11b3('0x7d')](db[_0x11b3('0x6c')][_0x11b3('0x36')](_0x59e4db[_0x11b3('0x7e')](),{'type':db[_0x11b3('0x6c')][_0x11b3('0x7f')][_0x11b3('0x80')]})[_0x11b3('0x2c')](function(_0x2cfc48){if(_0x2cfc48[_0x11b3('0x3d')]===0x1){return _0x51364f['id'];}else{var _0x1d49c2=_[_0x11b3('0x81')](_['map'](_0x2cfc48,_0x11b3('0x82')),function(_0x3b0b30){return _[_0x11b3('0x83')](_0x360d16,_0x3b0b30);});if(_0x1d49c2){return _0x51364f['id'];}}}));}}return BPromise[_0x11b3('0x84')](_0x44a7dd)[_0x11b3('0x2c')](function(_0xafe3a2){_0x461d3e=_(_0x461d3e)['union'](_0xafe3a2)[_0x11b3('0x85')]()[_0x11b3('0x86')]();return db[_0x11b3('0x47')][_0x11b3('0x50')]({'where':{'id':_0x4c0af9[_0x11b3('0x4d')]['id']}})[_0x11b3('0x2c')](function(_0x55e312){return db['sequelize']['transaction'](function(_0x166515){return _0x55e312[_0x11b3('0x72')](_0x4c0af9[_0x11b3('0x36')][_0x11b3('0x87')],{'transaction':_0x166515})[_0x11b3('0x2c')](function(){if(!_[_0x11b3('0x88')](_0x461d3e)){return _0x55e312[_0x11b3('0x89')](_0x461d3e,{'transaction':_0x166515});}})[_0x11b3('0x2c')](function(){_0x461d3e[_0x11b3('0x8a')](function(_0x2e40b7){socket['emit'](_0x11b3('0x8b'),{'UserId':_0x2e40b7,'MailQueueId':_0x55e312['id']});});});});});});})['then'](respondWithStatusCode(_0x5fb376,null))[_0x11b3('0x4b')](handleError(_0x5fb376,null));};exports[_0x11b3('0x8c')]=function(_0x370512,_0x4b9852,_0x14a127){return db[_0x11b3('0x47')][_0x11b3('0x50')]({'where':{'id':_0x370512[_0x11b3('0x4d')]['id']}})[_0x11b3('0x2c')](handleEntityNotFound(_0x4b9852,null))[_0x11b3('0x2c')](function(_0x382f92){if(_0x382f92){return _0x382f92['addAgents'](_0x370512[_0x11b3('0x52')][_0x11b3('0x87')],_['omit'](_0x370512['body'],[_0x11b3('0x87'),'id'])||{})[_0x11b3('0x8d')](function(_0x149237){for(var _0x45081d=0x0;_0x45081d<_0x370512[_0x11b3('0x52')][_0x11b3('0x87')][_0x11b3('0x3d')];_0x45081d+=0x1){socket[_0x11b3('0x70')](_0x11b3('0x71'),{'UserId':_0x370512[_0x11b3('0x52')][_0x11b3('0x87')][_0x45081d],'MailQueueId':_0x370512[_0x11b3('0x4d')]['id']});}return _0x149237;});}})[_0x11b3('0x2c')](respondWithResult(_0x4b9852,null))[_0x11b3('0x4b')](handleError(_0x4b9852,null));};exports[_0x11b3('0x89')]=function(_0x53ad59,_0x4907d8,_0x59604f){return db['MailQueue'][_0x11b3('0x50')]({'where':{'id':_0x53ad59['params']['id']}})[_0x11b3('0x2c')](handleEntityNotFound(_0x4907d8,null))['then'](function(_0x59bc4b){if(_0x59bc4b){return _0x59bc4b[_0x11b3('0x89')](_0x53ad59['query'][_0x11b3('0x87')])['then'](function(){if(_['isArray'](_0x53ad59[_0x11b3('0x36')][_0x11b3('0x87')])){for(var _0x90cd8a=0x0;_0x90cd8a<_0x53ad59[_0x11b3('0x36')][_0x11b3('0x87')][_0x11b3('0x3d')];_0x90cd8a+=0x1){socket['emit'](_0x11b3('0x8b'),{'UserId':Number(_0x53ad59[_0x11b3('0x36')][_0x11b3('0x87')][_0x90cd8a]),'MailQueueId':Number(_0x53ad59[_0x11b3('0x4d')]['id'])});}}else{socket[_0x11b3('0x70')](_0x11b3('0x8b'),{'UserId':Number(_0x53ad59[_0x11b3('0x36')][_0x11b3('0x87')]),'MailQueueId':Number(_0x53ad59[_0x11b3('0x4d')]['id'])});}});}})[_0x11b3('0x2c')](respondWithStatusCode(_0x4907d8,null))[_0x11b3('0x4b')](handleError(_0x4907d8,null));};exports[_0x11b3('0x8e')]=function(_0x499100,_0x371056,_0x65b9dd){var _0x2f3a39={};var _0x1379f3={};var _0x46d5b6;var _0x51f25a;return db[_0x11b3('0x47')][_0x11b3('0x5b')]({'where':{'id':_0x499100[_0x11b3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x371056,null))[_0x11b3('0x2c')](function(_0x52b9ca){if(_0x52b9ca){_0x46d5b6=_0x52b9ca;_0x1379f3[_0x11b3('0x3a')]=_[_0x11b3('0x37')](db['User']['rawAttributes']);_0x1379f3['query']=_[_0x11b3('0x37')](_0x499100[_0x11b3('0x36')]);_0x1379f3[_0x11b3('0x38')]=_['intersection'](_0x1379f3[_0x11b3('0x3a')],_0x1379f3[_0x11b3('0x36')]);_0x2f3a39['attributes']=_['intersection'](_0x1379f3[_0x11b3('0x3a')],qs[_0x11b3('0x3c')](_0x499100[_0x11b3('0x36')][_0x11b3('0x3c')]));_0x2f3a39[_0x11b3('0x3b')]=_0x2f3a39[_0x11b3('0x3b')]['length']?_0x2f3a39[_0x11b3('0x3b')]:_0x1379f3[_0x11b3('0x3a')];_0x2f3a39[_0x11b3('0x40')]=qs[_0x11b3('0x41')](_0x499100[_0x11b3('0x36')][_0x11b3('0x41')]);_0x2f3a39['where']=qs['filters'](_[_0x11b3('0x43')](_0x499100[_0x11b3('0x36')],_0x1379f3[_0x11b3('0x38')]));if(_0x499100['query'][_0x11b3('0x45')]){_0x2f3a39[_0x11b3('0x42')]=_[_0x11b3('0x4f')](_0x2f3a39[_0x11b3('0x42')],{'$or':_[_0x11b3('0x31')](_0x2f3a39[_0x11b3('0x3b')],function(_0xad8ccf){var _0x4847bf={};_0x4847bf[_0xad8ccf]={'$like':'%'+_0x499100[_0x11b3('0x36')]['filter']+'%'};return _0x4847bf;})});}_0x2f3a39=_[_0x11b3('0x4f')]({},_0x2f3a39,_0x499100[_0x11b3('0x46')]);return _0x46d5b6['getAgents'](_0x2f3a39);}})[_0x11b3('0x2c')](function(_0x330b5e){if(_0x330b5e){_0x51f25a=_0x330b5e[_0x11b3('0x3d')];if(!_0x499100[_0x11b3('0x36')][_0x11b3('0x3e')]('nolimit')){_0x2f3a39[_0x11b3('0x23')]=qs[_0x11b3('0x23')](_0x499100['query'][_0x11b3('0x23')]);_0x2f3a39[_0x11b3('0x22')]=qs['offset'](_0x499100[_0x11b3('0x36')]['offset']);}return _0x46d5b6[_0x11b3('0x8e')](_0x2f3a39);}})[_0x11b3('0x2c')](function(_0x2a4fa0){if(_0x2a4fa0){return _0x2a4fa0?{'count':_0x51f25a,'rows':_0x2a4fa0}:null;}})[_0x11b3('0x2c')](respondWithResult(_0x371056,null))['catch'](handleError(_0x371056,null));}; \ No newline at end of file +var _0x19e9=['pick','MailQueueId','filter','UserMailQueue','findAll','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','rows','format','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','localhost','register','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','options','includeAll','catch','params','keys','length','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne'];(function(_0x8a13bc,_0x1f743c){var _0x3d1e3d=function(_0xf6c8d2){while(--_0xf6c8d2){_0x8a13bc['push'](_0x8a13bc['shift']());}};_0x3d1e3d(++_0x1f743c);}(_0x19e9,0xcb));var _0x919e=function(_0x5d886a,_0x33e4e2){_0x5d886a=_0x5d886a-0x0;var _0x258a2d=_0x19e9[_0x5d886a];return _0x258a2d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x919e('0x0'));var rimraf=require(_0x919e('0x1'));var zipdir=require(_0x919e('0x2'));var jsonpatch=require(_0x919e('0x3'));var rp=require(_0x919e('0x4'));var moment=require(_0x919e('0x5'));var BPromise=require(_0x919e('0x6'));var Mustache=require(_0x919e('0x7'));var util=require(_0x919e('0x8'));var path=require(_0x919e('0x9'));var sox=require(_0x919e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x919e('0xb'));var crypto=require(_0x919e('0xc'));var jsforce=require(_0x919e('0xd'));var deskjs=require(_0x919e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x919e('0xf'));var Papa=require(_0x919e('0x10'));var Redis=require(_0x919e('0x11'));var authService=require(_0x919e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x919e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x919e('0x14'));var utils=require(_0x919e('0x15'));var config=require(_0x919e('0x16'));var db=require('../../mysqldb')['db'];config[_0x919e('0x17')]=_[_0x919e('0x18')](config[_0x919e('0x17')],{'host':_0x919e('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x919e('0x17')]));require('./mailQueue.socket')[_0x919e('0x1a')](socket);function respondWithStatusCode(_0x401219,_0x525cb7){_0x525cb7=_0x525cb7||0xcc;return function(_0xe51d11){if(_0xe51d11){return _0x401219[_0x919e('0x1b')](_0x525cb7);}return _0x401219['status'](_0x525cb7)[_0x919e('0x1c')]();};}function respondWithResult(_0x293375,_0x168212){_0x168212=_0x168212||0xc8;return function(_0x4b1d92){if(_0x4b1d92){return _0x293375[_0x919e('0x1d')](_0x168212)[_0x919e('0x1e')](_0x4b1d92);}};}function respondWithFilteredResult(_0x214fab,_0x1006a1){return function(_0x31aeeb){if(_0x31aeeb){var _0x279efb=_0x31aeeb[_0x919e('0x1f')],_0x11cc8d=_0x1006a1['offset'],_0x56eb91=_0x1006a1[_0x919e('0x20')]+_0x1006a1[_0x919e('0x21')],_0x41a509;if(_0x56eb91>=_0x279efb){_0x56eb91=_0x279efb;_0x41a509=0xc8;}else{_0x41a509=0xce;}_0x214fab[_0x919e('0x1d')](_0x41a509);return _0x214fab[_0x919e('0x22')]('Content-Range',_0x11cc8d+'-'+_0x56eb91+'/'+_0x279efb)[_0x919e('0x1e')](_0x31aeeb);}return null;};}function patchUpdates(_0x4087e0){return function(_0x34e291){try{jsonpatch[_0x919e('0x23')](_0x34e291,_0x4087e0,!![]);}catch(_0x138437){return BPromise[_0x919e('0x24')](_0x138437);}return _0x34e291[_0x919e('0x25')]();};}function saveUpdates(_0x32fa81,_0x5bef15){return function(_0x158d8d){if(_0x158d8d){return _0x158d8d[_0x919e('0x26')](_0x32fa81)['then'](function(_0x40f3e5){return _0x40f3e5;});}return null;};}function removeEntity(_0x153638,_0xa14e2b){return function(_0x29a30f){if(_0x29a30f){return _0x29a30f[_0x919e('0x27')]()[_0x919e('0x28')](function(){var _0x3cd7bb=_0x29a30f[_0x919e('0x29')]({'plain':!![]});var _0x593070=_0x919e('0x2a');return db[_0x919e('0x2b')][_0x919e('0x27')]({'where':{'type':_0x593070,'resourceId':_0x3cd7bb['id']}})[_0x919e('0x28')](function(){return _0x29a30f;});})['then'](function(){_0x153638[_0x919e('0x1d')](0xcc)[_0x919e('0x1c')]();});}};}function handleEntityNotFound(_0x2728bd,_0x497d17){return function(_0x362835){if(!_0x362835){_0x2728bd[_0x919e('0x1b')](0x194);}return _0x362835;};}function handleError(_0x532017,_0x21fd2e){_0x21fd2e=_0x21fd2e||0x1f4;return function(_0x6c3fef){logger[_0x919e('0x2c')](_0x6c3fef[_0x919e('0x2d')]);if(_0x6c3fef[_0x919e('0x2e')]){delete _0x6c3fef['name'];}_0x532017[_0x919e('0x1d')](_0x21fd2e)[_0x919e('0x2f')](_0x6c3fef);};}exports[_0x919e('0x30')]=function(_0x55c335,_0xfd0891){var _0x14af80={},_0x3e128d={},_0x262091={'count':0x0,'rows':[]};var _0x601380=_[_0x919e('0x31')](db[_0x919e('0x32')][_0x919e('0x33')],function(_0x34afd8){return{'name':_0x34afd8[_0x919e('0x34')],'type':_0x34afd8[_0x919e('0x35')]['key']};});_0x3e128d[_0x919e('0x36')]=_['map'](_0x601380,_0x919e('0x2e'));_0x3e128d[_0x919e('0x37')]=_['keys'](_0x55c335[_0x919e('0x37')]);_0x3e128d['filters']=_[_0x919e('0x38')](_0x3e128d[_0x919e('0x36')],_0x3e128d[_0x919e('0x37')]);_0x14af80[_0x919e('0x39')]=_[_0x919e('0x38')](_0x3e128d[_0x919e('0x36')],qs[_0x919e('0x3a')](_0x55c335[_0x919e('0x37')][_0x919e('0x3a')]));_0x14af80[_0x919e('0x39')]=_0x14af80['attributes']['length']?_0x14af80[_0x919e('0x39')]:_0x3e128d[_0x919e('0x36')];if(!_0x55c335[_0x919e('0x37')][_0x919e('0x3b')](_0x919e('0x3c'))){_0x14af80[_0x919e('0x21')]=qs['limit'](_0x55c335[_0x919e('0x37')]['limit']);_0x14af80['offset']=qs[_0x919e('0x20')](_0x55c335[_0x919e('0x37')][_0x919e('0x20')]);}_0x14af80[_0x919e('0x3d')]=qs[_0x919e('0x3e')](_0x55c335[_0x919e('0x37')][_0x919e('0x3e')]);_0x14af80['where']=qs[_0x919e('0x3f')](_['pick'](_0x55c335['query'],_0x3e128d[_0x919e('0x3f')]));if(_0x55c335[_0x919e('0x37')]['filter']){_0x14af80[_0x919e('0x40')]=_[_0x919e('0x41')](_0x14af80[_0x919e('0x40')],{'$or':_['map'](_0x601380,function(_0x528d70){if(_0x528d70['type']!==_0x919e('0x42')){var _0x53b81f={};_0x53b81f[_0x528d70[_0x919e('0x2e')]]={'$like':'%'+_0x55c335[_0x919e('0x37')]['filter']+'%'};return _0x53b81f;}})});}_0x14af80=_[_0x919e('0x41')]({},_0x14af80,_0x55c335[_0x919e('0x43')]);var _0x3ee911={'where':_0x14af80['where']};return db[_0x919e('0x32')][_0x919e('0x1f')](_0x3ee911)['then'](function(_0x559c91){_0x262091[_0x919e('0x1f')]=_0x559c91;if(_0x55c335[_0x919e('0x37')][_0x919e('0x44')]){_0x14af80['include']=[{'all':!![]}];}return db[_0x919e('0x32')]['findAll'](_0x14af80);})[_0x919e('0x28')](function(_0x330fb0){_0x262091['rows']=_0x330fb0;return _0x262091;})[_0x919e('0x28')](respondWithFilteredResult(_0xfd0891,_0x14af80))[_0x919e('0x45')](handleError(_0xfd0891,null));};exports['show']=function(_0x30331d,_0x97ea5c){var _0x32cce1={'raw':!![],'where':{'id':_0x30331d[_0x919e('0x46')]['id']}},_0xb78648={};_0xb78648[_0x919e('0x36')]=_['keys'](db[_0x919e('0x32')]['rawAttributes']);_0xb78648[_0x919e('0x37')]=_[_0x919e('0x47')](_0x30331d[_0x919e('0x37')]);_0xb78648['filters']=_[_0x919e('0x38')](_0xb78648[_0x919e('0x36')],_0xb78648[_0x919e('0x37')]);_0x32cce1[_0x919e('0x39')]=_[_0x919e('0x38')](_0xb78648[_0x919e('0x36')],qs[_0x919e('0x3a')](_0x30331d['query'][_0x919e('0x3a')]));_0x32cce1[_0x919e('0x39')]=_0x32cce1[_0x919e('0x39')][_0x919e('0x48')]?_0x32cce1[_0x919e('0x39')]:_0xb78648['model'];if(_0x30331d[_0x919e('0x37')][_0x919e('0x44')]){_0x32cce1[_0x919e('0x49')]=[{'all':!![]}];}_0x32cce1=_[_0x919e('0x41')]({},_0x32cce1,_0x30331d[_0x919e('0x43')]);return db[_0x919e('0x32')]['find'](_0x32cce1)[_0x919e('0x28')](handleEntityNotFound(_0x97ea5c,null))['then'](respondWithResult(_0x97ea5c,null))[_0x919e('0x45')](handleError(_0x97ea5c,null));};exports[_0x919e('0x4a')]=function(_0x5789f9,_0x56c98b){return db[_0x919e('0x32')][_0x919e('0x4a')](_0x5789f9['body'],{})[_0x919e('0x28')](function(_0x4c8cc3){var _0x3b3875=_0x5789f9[_0x919e('0x4b')]['get']({'plain':!![]});if(!_0x3b3875)throw new Error(_0x919e('0x4c'));if(_0x3b3875[_0x919e('0x4d')]===_0x919e('0x4b')){var _0x4f67a5=_0x4c8cc3['get']({'plain':!![]});var _0x145f92=_0x919e('0x2a');return db[_0x919e('0x4e')][_0x919e('0x4f')]({'where':{'name':_0x145f92,'userProfileId':_0x3b3875[_0x919e('0x50')]},'raw':!![]})[_0x919e('0x28')](function(_0x4b0723){if(_0x4b0723&&_0x4b0723[_0x919e('0x51')]===0x0){return db[_0x919e('0x2b')][_0x919e('0x4a')]({'name':_0x4f67a5[_0x919e('0x2e')],'resourceId':_0x4f67a5['id'],'type':_0x4b0723[_0x919e('0x2e')],'sectionId':_0x4b0723['id']},{})[_0x919e('0x28')](function(){return _0x4c8cc3;});}else{return _0x4c8cc3;}})['catch'](function(_0x4c1cb0){logger[_0x919e('0x2c')](_0x919e('0x52'),_0x4c1cb0);throw _0x4c1cb0;});}return _0x4c8cc3;})['then'](respondWithResult(_0x56c98b,0xc9))[_0x919e('0x45')](handleError(_0x56c98b,null));};exports[_0x919e('0x26')]=function(_0x5f3c06,_0x3be947){if(_0x5f3c06[_0x919e('0x53')]['id']){delete _0x5f3c06[_0x919e('0x53')]['id'];}return db['MailQueue'][_0x919e('0x4f')]({'where':{'id':_0x5f3c06[_0x919e('0x46')]['id']}})[_0x919e('0x28')](handleEntityNotFound(_0x3be947,null))[_0x919e('0x28')](saveUpdates(_0x5f3c06[_0x919e('0x53')],null))['then'](respondWithResult(_0x3be947,null))[_0x919e('0x45')](handleError(_0x3be947,null));};exports[_0x919e('0x27')]=function(_0x4eaacc,_0xaacaa6){return db[_0x919e('0x32')][_0x919e('0x4f')]({'where':{'id':_0x4eaacc[_0x919e('0x46')]['id']}})[_0x919e('0x28')](handleEntityNotFound(_0xaacaa6,null))['then'](removeEntity(_0xaacaa6,null))[_0x919e('0x45')](handleError(_0xaacaa6,null));};exports[_0x919e('0x54')]=function(_0x2f6896,_0x56eb76){return db['MailQueue']['describe']()[_0x919e('0x28')](respondWithResult(_0x56eb76,null))['catch'](handleError(_0x56eb76,null));};exports[_0x919e('0x55')]=function(_0x3a05e7,_0x484e66,_0x130b5a){var _0x5e8592={'raw':!![],'where':{}},_0x1ecf50={},_0x19a8ae;return db[_0x919e('0x32')][_0x919e('0x56')]({'where':{'id':_0x3a05e7[_0x919e('0x46')]['id']}})['then'](handleEntityNotFound(_0x484e66,null))['then'](function(_0x271a44){if(_0x271a44){_0x19a8ae=_0x271a44[_0x919e('0x29')]({'plain':!![]});_0x1ecf50[_0x919e('0x36')]=_[_0x919e('0x47')](db['UserMailQueue'][_0x919e('0x33')]);_0x1ecf50[_0x919e('0x37')]=_[_0x919e('0x47')](_0x3a05e7[_0x919e('0x37')]);_0x1ecf50['filters']=_[_0x919e('0x38')](_0x1ecf50['model'],_0x1ecf50[_0x919e('0x37')]);_0x5e8592['attributes']=_[_0x919e('0x38')](_0x1ecf50['model'],qs[_0x919e('0x3a')](_0x3a05e7[_0x919e('0x37')][_0x919e('0x3a')]));_0x5e8592[_0x919e('0x39')]=_0x5e8592[_0x919e('0x39')][_0x919e('0x48')]?_0x5e8592['attributes']:_0x1ecf50['model'];if(!_0x3a05e7['query'][_0x919e('0x3b')](_0x919e('0x3c'))){_0x5e8592[_0x919e('0x21')]=qs[_0x919e('0x21')](_0x3a05e7['query'][_0x919e('0x21')]);_0x5e8592[_0x919e('0x20')]=qs[_0x919e('0x20')](_0x3a05e7[_0x919e('0x37')][_0x919e('0x20')]);}_0x5e8592[_0x919e('0x3d')]=qs[_0x919e('0x3e')](_0x3a05e7[_0x919e('0x37')][_0x919e('0x3e')]);_0x5e8592['where']=qs[_0x919e('0x3f')](_[_0x919e('0x57')](_0x3a05e7[_0x919e('0x37')],_0x1ecf50['filters']));_0x5e8592[_0x919e('0x40')][_0x919e('0x58')]=_0x271a44['id'];if(_0x3a05e7['query'][_0x919e('0x59')]){_0x5e8592['where']=_[_0x919e('0x41')](_0x5e8592[_0x919e('0x40')],{'$or':_[_0x919e('0x31')](_0x5e8592[_0x919e('0x39')],function(_0x1fcdd1){var _0x208435={};_0x208435[_0x1fcdd1]={'$like':'%'+_0x3a05e7[_0x919e('0x37')][_0x919e('0x59')]+'%'};return _0x208435;})});}_0x5e8592=_['merge']({},_0x5e8592,_0x3a05e7[_0x919e('0x43')]);return db[_0x919e('0x5a')][_0x919e('0x5b')](_0x5e8592);}})[_0x919e('0x28')](function(_0x9d5559){if(_0x9d5559){return db[_0x919e('0x5c')][_0x919e('0x5d')]({'where':{'id':_[_0x919e('0x31')](_0x9d5559,_0x919e('0x5e')),'role':'agent'},'attributes':['id',_0x919e('0x2e'),_0x919e('0x5f'),_0x919e('0x60'),_0x919e('0x61')]});}})['then'](function(_0x838b48){if(_0x838b48){return{'count':_0x838b48[_0x919e('0x1f')],'rows':_['map'](_0x838b48[_0x919e('0x62')],function(_0x14a1c4){return{'membername':_0x14a1c4[_0x919e('0x2e')],'UserId':_0x14a1c4['id'],'queue_name':_0x19a8ae[_0x919e('0x2e')],'MailQueueId':_0x19a8ae['id'],'interface':util[_0x919e('0x63')]('%s/%s',_0x919e('0x64'),_0x14a1c4[_0x919e('0x2e')]),'penalty':0x0,'paused':_0x14a1c4[_0x919e('0x5f')],'createdAt':_0x14a1c4[_0x919e('0x61')],'updatedAt':_0x14a1c4[_0x919e('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x919e('0x28')](respondWithFilteredResult(_0x484e66,_0x5e8592))[_0x919e('0x45')](handleError(_0x484e66,null));};exports[_0x919e('0x65')]=function(_0x56cde9,_0x13f648,_0x127390){var _0x58c2f4={};var _0x5e4a96={};var _0x5ace83;var _0x1ab6ab;return db[_0x919e('0x32')][_0x919e('0x56')]({'where':{'id':_0x56cde9[_0x919e('0x46')]['id']}})[_0x919e('0x28')](handleEntityNotFound(_0x13f648,null))[_0x919e('0x28')](function(_0x176ab1){if(_0x176ab1){_0x5ace83=_0x176ab1;_0x5e4a96[_0x919e('0x36')]=_[_0x919e('0x47')](db[_0x919e('0x66')][_0x919e('0x33')]);_0x5e4a96[_0x919e('0x37')]=_[_0x919e('0x47')](_0x56cde9['query']);_0x5e4a96[_0x919e('0x3f')]=_[_0x919e('0x38')](_0x5e4a96[_0x919e('0x36')],_0x5e4a96[_0x919e('0x37')]);_0x58c2f4['attributes']=_['intersection'](_0x5e4a96[_0x919e('0x36')],qs[_0x919e('0x3a')](_0x56cde9['query'][_0x919e('0x3a')]));_0x58c2f4[_0x919e('0x39')]=_0x58c2f4['attributes'][_0x919e('0x48')]?_0x58c2f4[_0x919e('0x39')]:_0x5e4a96[_0x919e('0x36')];_0x58c2f4[_0x919e('0x3d')]=qs[_0x919e('0x3e')](_0x56cde9[_0x919e('0x37')]['sort']);_0x58c2f4[_0x919e('0x40')]=qs[_0x919e('0x3f')](_[_0x919e('0x57')](_0x56cde9['query'],_0x5e4a96[_0x919e('0x3f')]));if(_0x56cde9[_0x919e('0x37')][_0x919e('0x59')]){_0x58c2f4[_0x919e('0x40')]=_[_0x919e('0x41')](_0x58c2f4['where'],{'$or':_['map'](_0x58c2f4[_0x919e('0x39')],function(_0x2e93a4){var _0x111ad9={};_0x111ad9[_0x2e93a4]={'$like':'%'+_0x56cde9['query'][_0x919e('0x59')]+'%'};return _0x111ad9;})});}_0x58c2f4=_[_0x919e('0x41')]({},_0x58c2f4,_0x56cde9[_0x919e('0x43')]);return _0x5ace83[_0x919e('0x65')](_0x58c2f4);}})[_0x919e('0x28')](function(_0x409731){if(_0x409731){_0x1ab6ab=_0x409731[_0x919e('0x48')];if(!_0x56cde9[_0x919e('0x37')][_0x919e('0x3b')](_0x919e('0x3c'))){_0x58c2f4[_0x919e('0x21')]=qs[_0x919e('0x21')](_0x56cde9[_0x919e('0x37')][_0x919e('0x21')]);_0x58c2f4[_0x919e('0x20')]=qs['offset'](_0x56cde9[_0x919e('0x37')][_0x919e('0x20')]);}return _0x5ace83['getTeams'](_0x58c2f4);}})[_0x919e('0x28')](function(_0x5ca044){if(_0x5ca044){return _0x5ca044?{'count':_0x1ab6ab,'rows':_0x5ca044}:null;}})[_0x919e('0x28')](respondWithResult(_0x13f648,null))[_0x919e('0x45')](handleError(_0x13f648,null));};exports[_0x919e('0x67')]=function(_0x17550a,_0x1fd4ee,_0x228bbb){var _0x2f11b3=_0x17550a[_0x919e('0x53')][_0x919e('0x68')];return db['Team'][_0x919e('0x5b')]({'where':{'id':_0x2f11b3},'attributes':['id'],'include':[{'model':db[_0x919e('0x5c')],'as':_0x919e('0x69'),'attributes':['id','name',_0x919e('0x6a'),_0x919e('0x6b'),_0x919e('0x6c')],'raw':!![]}]})[_0x919e('0x28')](function(_0x347e3f){if(_0x347e3f){var _0x5ad613=_[_0x919e('0x6d')](_0x347e3f,function(_0x4c86a5){var _0x518ee2=_0x4c86a5[_0x919e('0x29')]({'plain':!![]});return _0x518ee2['Agents'];});return db[_0x919e('0x32')][_0x919e('0x4f')]({'where':{'id':_0x17550a[_0x919e('0x46')]['id']}})[_0x919e('0x28')](function(_0x300054){return db[_0x919e('0x6e')][_0x919e('0x6f')](function(_0x59efff){return _0x300054[_0x919e('0x67')](_0x2f11b3,{'transaction':_0x59efff})[_0x919e('0x28')](function(){return BPromise[_0x919e('0x70')](_0x5ad613,function(_0x3a1bdb){return db[_0x919e('0x5a')]['findOrCreate']({'where':{'UserId':_0x3a1bdb['id'],'MailQueueId':_0x17550a[_0x919e('0x46')]['id']},'transaction':_0x59efff});});})[_0x919e('0x28')](function(){_0x5ad613['forEach'](function(_0x1a8db5){socket[_0x919e('0x71')](_0x919e('0x72'),{'UserId':_0x1a8db5['id'],'MailQueueId':_0x300054['id']});});});});});}})[_0x919e('0x28')](respondWithStatusCode(_0x1fd4ee,null))[_0x919e('0x45')](handleError(_0x1fd4ee,null));};exports[_0x919e('0x73')]=function(_0x832a0c,_0x33b8aa,_0x1dca54){return db[_0x919e('0x66')][_0x919e('0x5b')]({'where':{'id':_0x832a0c[_0x919e('0x37')][_0x919e('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x919e('0x69'),'attributes':['id'],'raw':!![]}]})[_0x919e('0x28')](handleEntityNotFound(_0x33b8aa,null))['then'](function(_0x2d241d){var _0x4a1230=_[_0x919e('0x31')](_0x2d241d,'id');var _0x2558f4=[];var _0xfc729c=[];var _0x506458=squel[_0x919e('0x74')]();_0x506458[_0x919e('0x75')](_0x919e('0x76'))[_0x919e('0x77')](_0x919e('0x78'),'tq')[_0x919e('0x79')]('user_has_teams','ut',_0x919e('0x7a'))[_0x919e('0x40')](_0x919e('0x7b'),_0x832a0c[_0x919e('0x46')]['id']);for(var _0x30ebf1=0x0;_0x30ebf1<_0x2d241d['length'];_0x30ebf1+=0x1){let _0x5a3148=_0x2d241d[_0x30ebf1];for(var _0x4455d1=0x0;_0x4455d1<_0x5a3148[_0x919e('0x69')]['length'];_0x4455d1+=0x1){let _0x1dff96=_0x5a3148[_0x919e('0x69')][_0x4455d1];var _0x13ec0b=_0x506458[_0x919e('0x7c')]();_0x13ec0b[_0x919e('0x40')](_0x919e('0x7d'),_0x1dff96['id']);_0xfc729c[_0x919e('0x7e')](db['sequelize']['query'](_0x13ec0b[_0x919e('0x7f')](),{'type':db['sequelize'][_0x919e('0x80')][_0x919e('0x81')]})[_0x919e('0x28')](function(_0x32646f){if(_0x32646f[_0x919e('0x48')]===0x1){return _0x1dff96['id'];}else{var _0x1f09a2=_[_0x919e('0x82')](_[_0x919e('0x31')](_0x32646f,_0x919e('0x83')),function(_0x57ea61){return _[_0x919e('0x84')](_0x4a1230,_0x57ea61);});if(_0x1f09a2){return _0x1dff96['id'];}}}));}}return BPromise[_0x919e('0x85')](_0xfc729c)[_0x919e('0x28')](function(_0x18c0d4){_0x2558f4=_(_0x2558f4)[_0x919e('0x86')](_0x18c0d4)['compact']()[_0x919e('0x87')]();return db[_0x919e('0x32')]['find']({'where':{'id':_0x832a0c[_0x919e('0x46')]['id']}})[_0x919e('0x28')](function(_0x2020ba){return db[_0x919e('0x6e')][_0x919e('0x6f')](function(_0x3008bf){return _0x2020ba[_0x919e('0x73')](_0x832a0c['query'][_0x919e('0x68')],{'transaction':_0x3008bf})['then'](function(){if(!_[_0x919e('0x88')](_0x2558f4)){return _0x2020ba[_0x919e('0x89')](_0x2558f4,{'transaction':_0x3008bf});}})[_0x919e('0x28')](function(){_0x2558f4[_0x919e('0x8a')](function(_0x224d14){socket[_0x919e('0x71')](_0x919e('0x8b'),{'UserId':_0x224d14,'MailQueueId':_0x2020ba['id']});});});});});});})[_0x919e('0x28')](respondWithStatusCode(_0x33b8aa,null))['catch'](handleError(_0x33b8aa,null));};exports[_0x919e('0x8c')]=function(_0xf5cbb8,_0x143d72,_0xffc604){return db['MailQueue'][_0x919e('0x4f')]({'where':{'id':_0xf5cbb8[_0x919e('0x46')]['id']}})[_0x919e('0x28')](handleEntityNotFound(_0x143d72,null))[_0x919e('0x28')](function(_0x287f53){if(_0x287f53){return _0x287f53['addAgents'](_0xf5cbb8[_0x919e('0x53')][_0x919e('0x68')],_[_0x919e('0x8d')](_0xf5cbb8[_0x919e('0x53')],[_0x919e('0x68'),'id'])||{})[_0x919e('0x8e')](function(_0xb4fb2c){for(var _0xcbec68=0x0;_0xcbec68<_0xf5cbb8[_0x919e('0x53')][_0x919e('0x68')]['length'];_0xcbec68+=0x1){socket[_0x919e('0x71')](_0x919e('0x72'),{'UserId':_0xf5cbb8['body']['ids'][_0xcbec68],'MailQueueId':_0xf5cbb8['params']['id']});}return _0xb4fb2c;});}})[_0x919e('0x28')](respondWithResult(_0x143d72,null))[_0x919e('0x45')](handleError(_0x143d72,null));};exports[_0x919e('0x89')]=function(_0x17aea2,_0x11bb84,_0x3db275){return db['MailQueue']['find']({'where':{'id':_0x17aea2[_0x919e('0x46')]['id']}})[_0x919e('0x28')](handleEntityNotFound(_0x11bb84,null))[_0x919e('0x28')](function(_0x3680c7){if(_0x3680c7){return _0x3680c7[_0x919e('0x89')](_0x17aea2['query'][_0x919e('0x68')])[_0x919e('0x28')](function(){if(_[_0x919e('0x8f')](_0x17aea2[_0x919e('0x37')][_0x919e('0x68')])){for(var _0x57fbbd=0x0;_0x57fbbd<_0x17aea2['query'][_0x919e('0x68')][_0x919e('0x48')];_0x57fbbd+=0x1){socket['emit'](_0x919e('0x8b'),{'UserId':Number(_0x17aea2[_0x919e('0x37')][_0x919e('0x68')][_0x57fbbd]),'MailQueueId':Number(_0x17aea2['params']['id'])});}}else{socket['emit'](_0x919e('0x8b'),{'UserId':Number(_0x17aea2[_0x919e('0x37')]['ids']),'MailQueueId':Number(_0x17aea2[_0x919e('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x11bb84,null))[_0x919e('0x45')](handleError(_0x11bb84,null));};exports[_0x919e('0x90')]=function(_0x4d7d6f,_0x43fe5d,_0x57c78e){var _0x5ed6e8={};var _0xbd4ee={};var _0x2c56ba;var _0x1c82bd;return db[_0x919e('0x32')][_0x919e('0x56')]({'where':{'id':_0x4d7d6f['params']['id']}})[_0x919e('0x28')](handleEntityNotFound(_0x43fe5d,null))['then'](function(_0x19630b){if(_0x19630b){_0x2c56ba=_0x19630b;_0xbd4ee[_0x919e('0x36')]=_[_0x919e('0x47')](db['User'][_0x919e('0x33')]);_0xbd4ee[_0x919e('0x37')]=_[_0x919e('0x47')](_0x4d7d6f[_0x919e('0x37')]);_0xbd4ee[_0x919e('0x3f')]=_[_0x919e('0x38')](_0xbd4ee[_0x919e('0x36')],_0xbd4ee['query']);_0x5ed6e8[_0x919e('0x39')]=_[_0x919e('0x38')](_0xbd4ee['model'],qs[_0x919e('0x3a')](_0x4d7d6f[_0x919e('0x37')]['fields']));_0x5ed6e8['attributes']=_0x5ed6e8[_0x919e('0x39')][_0x919e('0x48')]?_0x5ed6e8['attributes']:_0xbd4ee['model'];_0x5ed6e8[_0x919e('0x3d')]=qs[_0x919e('0x3e')](_0x4d7d6f['query']['sort']);_0x5ed6e8[_0x919e('0x40')]=qs[_0x919e('0x3f')](_[_0x919e('0x57')](_0x4d7d6f[_0x919e('0x37')],_0xbd4ee['filters']));if(_0x4d7d6f[_0x919e('0x37')][_0x919e('0x59')]){_0x5ed6e8[_0x919e('0x40')]=_[_0x919e('0x41')](_0x5ed6e8[_0x919e('0x40')],{'$or':_[_0x919e('0x31')](_0x5ed6e8[_0x919e('0x39')],function(_0x3c6f61){var _0xb9678b={};_0xb9678b[_0x3c6f61]={'$like':'%'+_0x4d7d6f[_0x919e('0x37')][_0x919e('0x59')]+'%'};return _0xb9678b;})});}_0x5ed6e8=_[_0x919e('0x41')]({},_0x5ed6e8,_0x4d7d6f['options']);return _0x2c56ba[_0x919e('0x90')](_0x5ed6e8);}})[_0x919e('0x28')](function(_0x37134b){if(_0x37134b){_0x1c82bd=_0x37134b[_0x919e('0x48')];if(!_0x4d7d6f[_0x919e('0x37')][_0x919e('0x3b')](_0x919e('0x3c'))){_0x5ed6e8[_0x919e('0x21')]=qs[_0x919e('0x21')](_0x4d7d6f[_0x919e('0x37')][_0x919e('0x21')]);_0x5ed6e8[_0x919e('0x20')]=qs[_0x919e('0x20')](_0x4d7d6f[_0x919e('0x37')][_0x919e('0x20')]);}return _0x2c56ba['getAgents'](_0x5ed6e8);}})[_0x919e('0x28')](function(_0x109acb){if(_0x109acb){return _0x109acb?{'count':_0x1c82bd,'rows':_0x109acb}:null;}})[_0x919e('0x28')](respondWithResult(_0x43fe5d,null))['catch'](handleError(_0x43fe5d,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 45b6067..31f4a60 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 _0x0e74=['remove','emit','hasOwnProperty','hook','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x0e74,0x67));var _0x40e7=function(_0x37c407,_0x40fa75){_0x37c407=_0x37c407-0x0;var _0x2fda50=_0x0e74[_0x37c407];return _0x2fda50;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x40e7('0x0'))['db'][_0x40e7('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x40e7('0x2')](0x0);var events={'afterCreate':_0x40e7('0x3'),'afterUpdate':_0x40e7('0x4'),'afterDestroy':_0x40e7('0x5')};function emitEvent(_0x28aa2e){return function(_0x427b81,_0x1019db,_0xbecc21){MailQueueEvents[_0x40e7('0x6')](_0x28aa2e+':'+_0x427b81['id'],_0x427b81);MailQueueEvents['emit'](_0x28aa2e,_0x427b81);_0xbecc21(null);};}for(var e in events){if(events[_0x40e7('0x7')](e)){var event=events[e];MailQueue[_0x40e7('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x7c07=['emit','hasOwnProperty','hook','exports','events','MailQueue','setMaxListeners','update','remove'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x7c07,0x124));var _0x77c0=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x7c07[_0x1e3c16];return _0x47a0c9;};'use strict';var EventEmitter=require(_0x77c0('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x77c0('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x77c0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77c0('0x3'),'afterDestroy':_0x77c0('0x4')};function emitEvent(_0xb07da8){return function(_0xffa8bb,_0x528260,_0x4429c4){MailQueueEvents[_0x77c0('0x5')](_0xb07da8+':'+_0xffa8bb['id'],_0xffa8bb);MailQueueEvents[_0x77c0('0x5')](_0xb07da8,_0xffa8bb);_0x4429c4(null);};}for(var e in events){if(events[_0x77c0('0x6')](e)){var event=events[e];MailQueue[_0x77c0('0x7')](e,emitEvent(event));}}module[_0x77c0('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index c58e6af..1a73c58 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 _0xbe46=['path','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x41c5da,_0x3b77aa){var _0x10d868=function(_0x7e9365){while(--_0x7e9365){_0x41c5da['push'](_0x41c5da['shift']());}};_0x10d868(++_0x3b77aa);}(_0xbe46,0xec));var _0x6be4=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xbe46[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x6be4('0x0'));var util=require(_0x6be4('0x1'));var logger=require(_0x6be4('0x2'))('api');var moment=require(_0x6be4('0x3'));var BPromise=require(_0x6be4('0x4'));var rp=require(_0x6be4('0x5'));var fs=require('fs');var path=require(_0x6be4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x6be4('0x7')]=function(_0x13105a,_0x1a5942){return _0x13105a[_0x6be4('0x8')](_0x6be4('0x9'),attributes,{'tableName':_0x6be4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd18b=['exports','define','MailQueue','mail_queues','util','../../config/logger','api','moment','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0xc86e20,_0x29cac0){var _0x571f4b=function(_0x39e863){while(--_0x39e863){_0xc86e20['push'](_0xc86e20['shift']());}};_0x571f4b(++_0x29cac0);}(_0xd18b,0xbf));var _0xbd18=function(_0x5f5b62,_0x2dfdfb){_0x5f5b62=_0x5f5b62-0x0;var _0x220946=_0xd18b[_0x5f5b62];return _0x220946;};'use strict';var _=require('lodash');var util=require(_0xbd18('0x0'));var logger=require(_0xbd18('0x1'))(_0xbd18('0x2'));var moment=require(_0xbd18('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd18('0x4'));var config=require(_0xbd18('0x5'));var attributes=require(_0xbd18('0x6'));module[_0xbd18('0x7')]=function(_0x3cb1d3,_0x2d769c){return _0x3cb1d3[_0xbd18('0x8')](_0xbd18('0x9'),attributes,{'tableName':_0xbd18('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index fe42cb6..960b9aa 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 _0xded4=['include','debug','ShowMailQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','model','map'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0xded4,0x19c));var _0x4ded=function(_0x3e9d14,_0x329fa0){_0x3e9d14=_0x3e9d14-0x0;var _0x349754=_0xded4[_0x3e9d14];return _0x349754;};'use strict';var _=require(_0x4ded('0x0'));var util=require(_0x4ded('0x1'));var moment=require(_0x4ded('0x2'));var BPromise=require(_0x4ded('0x3'));var rs=require(_0x4ded('0x4'));var fs=require('fs');var Redis=require(_0x4ded('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ded('0x6'))('rpc');var config=require(_0x4ded('0x7'));var jayson=require(_0x4ded('0x8'));var client=jayson[_0x4ded('0x9')]['http']({'port':0x232a});config[_0x4ded('0xa')]=_['defaults'](config[_0x4ded('0xa')],{'host':_0x4ded('0xb'),'port':0x18eb});var socket=require(_0x4ded('0xc'))(new Redis(config['redis']));require(_0x4ded('0xd'))['register'](socket);function respondWithRpcPromise(_0x4fd912,_0x19d86b,_0x534846){return new BPromise(function(_0x42c8d6,_0x3c36cb){return client[_0x4ded('0xe')](_0x4fd912,_0x534846)[_0x4ded('0xf')](function(_0x47008b){logger[_0x4ded('0x10')](_0x4ded('0x11'),_0x19d86b,_0x4ded('0x12'));logger['debug'](_0x4ded('0x13'),_0x19d86b,_0x4ded('0x12'),JSON[_0x4ded('0x14')](_0x47008b));if(_0x47008b['error']){if(_0x47008b[_0x4ded('0x15')]['code']===0x1f4){logger['error'](_0x4ded('0x11'),_0x19d86b,_0x47008b[_0x4ded('0x15')][_0x4ded('0x16')]);return _0x3c36cb(_0x47008b[_0x4ded('0x15')][_0x4ded('0x16')]);}logger[_0x4ded('0x15')](_0x4ded('0x11'),_0x19d86b,_0x47008b[_0x4ded('0x15')][_0x4ded('0x16')]);return _0x42c8d6(_0x47008b['error']['message']);}else{logger[_0x4ded('0x10')](_0x4ded('0x11'),_0x19d86b,_0x4ded('0x12'));_0x42c8d6(_0x47008b['result'][_0x4ded('0x16')]);}})[_0x4ded('0x17')](function(_0x2f63af){logger['error'](_0x4ded('0x11'),_0x19d86b,_0x2f63af);_0x3c36cb(_0x2f63af);});});}exports[_0x4ded('0x18')]=function(_0x3a01fb){var _0x3bab42=this;return new Promise(function(_0x162cc4,_0x428616){return db[_0x4ded('0x19')][_0x4ded('0x1a')]({'raw':_0x3a01fb['options']?_0x3a01fb[_0x4ded('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3a01fb[_0x4ded('0x1b')]?_0x3a01fb['options'][_0x4ded('0x1c')]||null:null,'attributes':_0x3a01fb[_0x4ded('0x1b')]?_0x3a01fb[_0x4ded('0x1b')][_0x4ded('0x1d')]||null:null,'limit':_0x3a01fb[_0x4ded('0x1b')]?_0x3a01fb[_0x4ded('0x1b')]['limit']||null:null,'include':_0x3a01fb['options']?_0x3a01fb[_0x4ded('0x1b')]['include']?_['map'](_0x3a01fb[_0x4ded('0x1b')]['include'],function(_0x194d73){return{'model':db[_0x194d73[_0x4ded('0x1e')]],'as':_0x194d73['as'],'attributes':_0x194d73[_0x4ded('0x1d')],'include':_0x194d73['include']?_[_0x4ded('0x1f')](_0x194d73[_0x4ded('0x20')],function(_0x2f386a){return{'model':db[_0x2f386a[_0x4ded('0x1e')]],'as':_0x2f386a['as'],'attributes':_0x2f386a[_0x4ded('0x1d')],'include':_0x2f386a['include']?_['map'](_0x2f386a[_0x4ded('0x20')],function(_0x2a944){return{'model':db[_0x2a944[_0x4ded('0x1e')]],'as':_0x2a944['as'],'attributes':_0x2a944[_0x4ded('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4ded('0xf')](function(_0x3f532e){logger['info'](_0x4ded('0x18'),_0x3a01fb);logger[_0x4ded('0x21')]('GetMailQueue',_0x3a01fb,JSON[_0x4ded('0x14')](_0x3f532e));_0x162cc4(_0x3f532e);})['catch'](function(_0x353f30){logger['error'](_0x4ded('0x18'),_0x353f30[_0x4ded('0x16')],_0x3a01fb);_0x428616(_0x3bab42[_0x4ded('0x15')](0x1f4,_0x353f30['message']));});});};exports[_0x4ded('0x22')]=function(_0x3cffb0){var _0x10e8ed=this;return new Promise(function(_0x4c3740,_0x20784c){return db[_0x4ded('0x19')][_0x4ded('0x23')]({'raw':_0x3cffb0[_0x4ded('0x1b')]?_0x3cffb0[_0x4ded('0x1b')][_0x4ded('0x24')]===undefined?!![]:![]:!![],'where':_0x3cffb0[_0x4ded('0x1b')]?_0x3cffb0[_0x4ded('0x1b')][_0x4ded('0x1c')]||null:null,'attributes':_0x3cffb0['options']?_0x3cffb0['options'][_0x4ded('0x1d')]||null:null,'include':_0x3cffb0[_0x4ded('0x1b')]?_0x3cffb0['options'][_0x4ded('0x20')]?_['map'](_0x3cffb0['options']['include'],function(_0x55a667){return{'model':db[_0x55a667[_0x4ded('0x1e')]],'as':_0x55a667['as'],'attributes':_0x55a667[_0x4ded('0x1d')],'include':_0x55a667[_0x4ded('0x20')]?_['map'](_0x55a667['include'],function(_0x62c8b6){return{'model':db[_0x62c8b6[_0x4ded('0x1e')]],'as':_0x62c8b6['as'],'attributes':_0x62c8b6['attributes'],'include':_0x62c8b6[_0x4ded('0x20')]?_['map'](_0x62c8b6[_0x4ded('0x20')],function(_0x475c6e){return{'model':db[_0x475c6e['model']],'as':_0x475c6e['as'],'attributes':_0x475c6e[_0x4ded('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb5f4a9){logger[_0x4ded('0x10')](_0x4ded('0x22'),_0x3cffb0);logger[_0x4ded('0x21')](_0x4ded('0x22'),_0x3cffb0,JSON[_0x4ded('0x14')](_0xb5f4a9));_0x4c3740(_0xb5f4a9);})['catch'](function(_0x30dc7d){logger[_0x4ded('0x15')]('ShowMailQueue',_0x30dc7d[_0x4ded('0x16')],_0x3cffb0);_0x20784c(_0x10e8ed[_0x4ded('0x15')](0x1f4,_0x30dc7d[_0x4ded('0x16')]));});});}; \ No newline at end of file +var _0x55cf=['stringify','error','message','result','GetMailQueue','options','raw','where','attributes','limit','include','map','then','catch','ShowMailQueue','MailQueue','find','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x404a17,_0x5f3b64){var _0x47d4ec=function(_0x560e64){while(--_0x560e64){_0x404a17['push'](_0x404a17['shift']());}};_0x47d4ec(++_0x5f3b64);}(_0x55cf,0x8a));var _0xf55c=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x55cf[_0x4d1ee9];return _0x9a5456;};'use strict';var _=require(_0xf55c('0x0'));var util=require('util');var moment=require(_0xf55c('0x1'));var BPromise=require(_0xf55c('0x2'));var rs=require(_0xf55c('0x3'));var fs=require('fs');var Redis=require(_0xf55c('0x4'));var db=require(_0xf55c('0x5'))['db'];var utils=require(_0xf55c('0x6'));var logger=require('../../config/logger')(_0xf55c('0x7'));var config=require(_0xf55c('0x8'));var jayson=require(_0xf55c('0x9'));var client=jayson[_0xf55c('0xa')]['http']({'port':0x232a});config[_0xf55c('0xb')]=_[_0xf55c('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf55c('0xd'))(new Redis(config[_0xf55c('0xb')]));require(_0xf55c('0xe'))[_0xf55c('0xf')](socket);function respondWithRpcPromise(_0x4f9f4e,_0x3f2ef6,_0x161434){return new BPromise(function(_0x315170,_0x23b0bf){return client[_0xf55c('0x10')](_0x4f9f4e,_0x161434)['then'](function(_0x4508d1){logger[_0xf55c('0x11')](_0xf55c('0x12'),_0x3f2ef6,_0xf55c('0x13'));logger[_0xf55c('0x14')](_0xf55c('0x15'),_0x3f2ef6,_0xf55c('0x13'),JSON[_0xf55c('0x16')](_0x4508d1));if(_0x4508d1[_0xf55c('0x17')]){if(_0x4508d1['error']['code']===0x1f4){logger[_0xf55c('0x17')](_0xf55c('0x12'),_0x3f2ef6,_0x4508d1['error'][_0xf55c('0x18')]);return _0x23b0bf(_0x4508d1['error'][_0xf55c('0x18')]);}logger[_0xf55c('0x17')](_0xf55c('0x12'),_0x3f2ef6,_0x4508d1[_0xf55c('0x17')][_0xf55c('0x18')]);return _0x315170(_0x4508d1[_0xf55c('0x17')][_0xf55c('0x18')]);}else{logger[_0xf55c('0x11')]('MailQueue,\x20%s,\x20%s',_0x3f2ef6,_0xf55c('0x13'));_0x315170(_0x4508d1[_0xf55c('0x19')][_0xf55c('0x18')]);}})['catch'](function(_0x463dee){logger['error'](_0xf55c('0x12'),_0x3f2ef6,_0x463dee);_0x23b0bf(_0x463dee);});});}exports[_0xf55c('0x1a')]=function(_0x1b89f9){var _0x758852=this;return new Promise(function(_0x4dcdb8,_0x3bd8a3){return db['MailQueue']['findAll']({'raw':_0x1b89f9[_0xf55c('0x1b')]?_0x1b89f9[_0xf55c('0x1b')][_0xf55c('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b89f9[_0xf55c('0x1b')]?_0x1b89f9[_0xf55c('0x1b')][_0xf55c('0x1d')]||null:null,'attributes':_0x1b89f9[_0xf55c('0x1b')]?_0x1b89f9[_0xf55c('0x1b')][_0xf55c('0x1e')]||null:null,'limit':_0x1b89f9[_0xf55c('0x1b')]?_0x1b89f9[_0xf55c('0x1b')][_0xf55c('0x1f')]||null:null,'include':_0x1b89f9['options']?_0x1b89f9['options'][_0xf55c('0x20')]?_['map'](_0x1b89f9[_0xf55c('0x1b')]['include'],function(_0x410f66){return{'model':db[_0x410f66['model']],'as':_0x410f66['as'],'attributes':_0x410f66[_0xf55c('0x1e')],'include':_0x410f66[_0xf55c('0x20')]?_[_0xf55c('0x21')](_0x410f66[_0xf55c('0x20')],function(_0x3144e6){return{'model':db[_0x3144e6['model']],'as':_0x3144e6['as'],'attributes':_0x3144e6[_0xf55c('0x1e')],'include':_0x3144e6[_0xf55c('0x20')]?_['map'](_0x3144e6[_0xf55c('0x20')],function(_0x514033){return{'model':db[_0x514033['model']],'as':_0x514033['as'],'attributes':_0x514033[_0xf55c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf55c('0x22')](function(_0x27faa8){logger[_0xf55c('0x11')](_0xf55c('0x1a'),_0x1b89f9);logger[_0xf55c('0x14')](_0xf55c('0x1a'),_0x1b89f9,JSON[_0xf55c('0x16')](_0x27faa8));_0x4dcdb8(_0x27faa8);})[_0xf55c('0x23')](function(_0x519d50){logger[_0xf55c('0x17')](_0xf55c('0x1a'),_0x519d50[_0xf55c('0x18')],_0x1b89f9);_0x3bd8a3(_0x758852[_0xf55c('0x17')](0x1f4,_0x519d50[_0xf55c('0x18')]));});});};exports[_0xf55c('0x24')]=function(_0x1ffd45){var _0x579854=this;return new Promise(function(_0x5d9f13,_0x48d9f5){return db[_0xf55c('0x25')][_0xf55c('0x26')]({'raw':_0x1ffd45[_0xf55c('0x1b')]?_0x1ffd45[_0xf55c('0x1b')][_0xf55c('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ffd45[_0xf55c('0x1b')]?_0x1ffd45[_0xf55c('0x1b')][_0xf55c('0x1d')]||null:null,'attributes':_0x1ffd45['options']?_0x1ffd45[_0xf55c('0x1b')][_0xf55c('0x1e')]||null:null,'include':_0x1ffd45['options']?_0x1ffd45['options'][_0xf55c('0x20')]?_['map'](_0x1ffd45[_0xf55c('0x1b')][_0xf55c('0x20')],function(_0x11e2ea){return{'model':db[_0x11e2ea[_0xf55c('0x27')]],'as':_0x11e2ea['as'],'attributes':_0x11e2ea[_0xf55c('0x1e')],'include':_0x11e2ea[_0xf55c('0x20')]?_[_0xf55c('0x21')](_0x11e2ea[_0xf55c('0x20')],function(_0x1f254e){return{'model':db[_0x1f254e[_0xf55c('0x27')]],'as':_0x1f254e['as'],'attributes':_0x1f254e['attributes'],'include':_0x1f254e[_0xf55c('0x20')]?_[_0xf55c('0x21')](_0x1f254e[_0xf55c('0x20')],function(_0x5d706d){return{'model':db[_0x5d706d[_0xf55c('0x27')]],'as':_0x5d706d['as'],'attributes':_0x5d706d[_0xf55c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf55c('0x22')](function(_0x56c523){logger['info'](_0xf55c('0x24'),_0x1ffd45);logger[_0xf55c('0x14')]('ShowMailQueue',_0x1ffd45,JSON['stringify'](_0x56c523));_0x5d9f13(_0x56c523);})[_0xf55c('0x23')](function(_0x1c9267){logger[_0xf55c('0x17')]('ShowMailQueue',_0x1c9267['message'],_0x1ffd45);_0x48d9f5(_0x579854[_0xf55c('0x17')](0x1f4,_0x1c9267[_0xf55c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 01c00a5..5c37021 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 _0x0a3d=['removeListener','register','length','mailQueue:','remove','emit'];(function(_0x49944a,_0x1a3723){var _0x2567fc=function(_0x2aa79e){while(--_0x2aa79e){_0x49944a['push'](_0x49944a['shift']());}};_0x2567fc(++_0x1a3723);}(_0x0a3d,0x94));var _0xd0a3=function(_0x19baef,_0x3f349b){_0x19baef=_0x19baef-0x0;var _0x393696=_0x0a3d[_0x19baef];return _0x393696;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xd0a3('0x0'),'update'];function createListener(_0x38a84e,_0x2d509a){return function(_0x997c3f){_0x2d509a[_0xd0a3('0x1')](_0x38a84e,_0x997c3f);};}function removeListener(_0x3f6b6f,_0x5b3a17){return function(){MailQueueEvents[_0xd0a3('0x2')](_0x3f6b6f,_0x5b3a17);};}exports[_0xd0a3('0x3')]=function(_0x306da8){for(var _0x2aa4f5=0x0,_0x3c269a=events[_0xd0a3('0x4')];_0x2aa4f5<_0x3c269a;_0x2aa4f5++){var _0x332e70=events[_0x2aa4f5];var _0x1174ac=createListener(_0xd0a3('0x5')+_0x332e70,_0x306da8);MailQueueEvents['on'](_0x332e70,_0x1174ac);}}; \ No newline at end of file +var _0x4094=['register','mailQueue:','./mailQueue.events','save','update','emit','removeListener'];(function(_0x137cea,_0x20e60d){var _0x480882=function(_0x280975){while(--_0x280975){_0x137cea['push'](_0x137cea['shift']());}};_0x480882(++_0x20e60d);}(_0x4094,0xf7));var _0x4409=function(_0x2d45a3,_0x5c52b2){_0x2d45a3=_0x2d45a3-0x0;var _0x20258d=_0x4094[_0x2d45a3];return _0x20258d;};'use strict';var MailQueueEvents=require(_0x4409('0x0'));var events=[_0x4409('0x1'),'remove',_0x4409('0x2')];function createListener(_0x1a1363,_0x4cec4c){return function(_0x468e15){_0x4cec4c[_0x4409('0x3')](_0x1a1363,_0x468e15);};}function removeListener(_0x39d5b2,_0x279295){return function(){MailQueueEvents[_0x4409('0x4')](_0x39d5b2,_0x279295);};}exports[_0x4409('0x5')]=function(_0x3abbcb){for(var _0x2ffa44=0x0,_0x337a9b=events['length'];_0x2ffa44<_0x337a9b;_0x2ffa44++){var _0x40e5b7=events[_0x2ffa44];var _0x1953e1=createListener(_0x4409('0x6')+_0x40e5b7,_0x3abbcb);MailQueueEvents['on'](_0x40e5b7,_0x1953e1);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 2456ff3..ba2cf41 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 _0xb0ab=['get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller'];(function(_0x4f3056,_0xe685f6){var _0x2b8af0=function(_0x3e04c2){while(--_0x3e04c2){_0x4f3056['push'](_0x4f3056['shift']());}};_0x2b8af0(++_0xe685f6);}(_0xb0ab,0xb4));var _0xbb0a=function(_0x57f8d9,_0x4776f1){_0x57f8d9=_0x57f8d9-0x0;var _0x6cc788=_0xb0ab[_0x57f8d9];return _0x6cc788;};'use strict';var multer=require(_0xbb0a('0x0'));var util=require(_0xbb0a('0x1'));var path=require(_0xbb0a('0x2'));var timeout=require(_0xbb0a('0x3'));var express=require(_0xbb0a('0x4'));var router=express[_0xbb0a('0x5')]();var auth=require(_0xbb0a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbb0a('0x7'));var controller=require(_0xbb0a('0x8'));router[_0xbb0a('0x9')]('/',auth[_0xbb0a('0xa')](),controller['index']);router[_0xbb0a('0x9')](_0xbb0a('0xb'),auth[_0xbb0a('0xa')](),controller[_0xbb0a('0xc')]);router[_0xbb0a('0x9')]('/:id',auth[_0xbb0a('0xa')](),controller[_0xbb0a('0xd')]);router[_0xbb0a('0xe')]('/',auth[_0xbb0a('0xa')](),controller[_0xbb0a('0xf')]);router[_0xbb0a('0x10')](_0xbb0a('0x11'),auth[_0xbb0a('0xa')](),controller['update']);router[_0xbb0a('0x12')](_0xbb0a('0x11'),auth['isAuthenticated'](),controller[_0xbb0a('0x13')]);module[_0xbb0a('0x14')]=router; \ No newline at end of file +var _0xb18b=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x560f93,_0x57b31c){var _0x3903f0=function(_0x36f018){while(--_0x36f018){_0x560f93['push'](_0x560f93['shift']());}};_0x3903f0(++_0x57b31c);}(_0xb18b,0xce));var _0xbb18=function(_0x2022ba,_0x1cee00){_0x2022ba=_0x2022ba-0x0;var _0x58d704=_0xb18b[_0x2022ba];return _0x58d704;};'use strict';var multer=require('multer');var util=require(_0xbb18('0x0'));var path=require(_0xbb18('0x1'));var timeout=require(_0xbb18('0x2'));var express=require(_0xbb18('0x3'));var router=express[_0xbb18('0x4')]();var auth=require(_0xbb18('0x5'));var interaction=require(_0xbb18('0x6'));var config=require(_0xbb18('0x7'));var controller=require(_0xbb18('0x8'));router['get']('/',auth[_0xbb18('0x9')](),controller[_0xbb18('0xa')]);router[_0xbb18('0xb')]('/describe',auth[_0xbb18('0x9')](),controller[_0xbb18('0xc')]);router[_0xbb18('0xb')](_0xbb18('0xd'),auth[_0xbb18('0x9')](),controller['show']);router[_0xbb18('0xe')]('/',auth[_0xbb18('0x9')](),controller[_0xbb18('0xf')]);router[_0xbb18('0x10')]('/:id',auth[_0xbb18('0x9')](),controller[_0xbb18('0x11')]);router['delete'](_0xbb18('0xd'),auth[_0xbb18('0x9')](),controller[_0xbb18('0x12')]);module[_0xbb18('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 69e46a5..dd38eac 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 _0xea53=['moment','sequelize','exports','STRING','DATE'];(function(_0x60952e,_0x47ce2e){var _0x174304=function(_0x21d07e){while(--_0x21d07e){_0x60952e['push'](_0x60952e['shift']());}};_0x174304(++_0x47ce2e);}(_0xea53,0x190));var _0x3ea5=function(_0x2482d0,_0x5860b6){_0x2482d0=_0x2482d0-0x0;var _0x40e4c3=_0xea53[_0x2482d0];return _0x40e4c3;};'use strict';var moment=require(_0x3ea5('0x0'));var Sequelize=require(_0x3ea5('0x1'));module[_0x3ea5('0x2')]={'uniqueid':{'type':Sequelize[_0x3ea5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3ea5('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3ea5('0x4')]},'acceptAt':{'type':Sequelize[_0x3ea5('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3ea5('0x3')]}}; \ No newline at end of file +var _0xc504=['sequelize','exports','STRING','DATE','moment'];(function(_0x4c9191,_0xe10c76){var _0x593642=function(_0x11e43b){while(--_0x11e43b){_0x4c9191['push'](_0x4c9191['shift']());}};_0x593642(++_0xe10c76);}(_0xc504,0x68));var _0x4c50=function(_0x3255e8,_0x1d9506){_0x3255e8=_0x3255e8-0x0;var _0x150962=_0xc504[_0x3255e8];return _0x150962;};'use strict';var moment=require(_0x4c50('0x0'));var Sequelize=require(_0x4c50('0x1'));module[_0x4c50('0x2')]={'uniqueid':{'type':Sequelize[_0x4c50('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4c50('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4c50('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4c50('0x4')]},'reason':{'type':Sequelize[_0x4c50('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index cf9c54a..0bab85a 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 _0x63f8=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','type','key','model','filters','intersection','query','attributes','fields','length','order','sort','where','filter','merge','count','include','findAll','rows','show','params','keys','rawAttributes','includeAll','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0x63f8,0x12c));var _0x863f=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x63f8[_0x3ab9ee];return _0x82ee88;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x863f('0x0'));var rimraf=require(_0x863f('0x1'));var zipdir=require(_0x863f('0x2'));var jsonpatch=require(_0x863f('0x3'));var rp=require(_0x863f('0x4'));var moment=require(_0x863f('0x5'));var BPromise=require(_0x863f('0x6'));var Mustache=require(_0x863f('0x7'));var util=require(_0x863f('0x8'));var path=require(_0x863f('0x9'));var sox=require(_0x863f('0xa'));var csv=require(_0x863f('0xb'));var ejs=require(_0x863f('0xc'));var fs=require('fs');var _=require(_0x863f('0xd'));var squel=require('squel');var crypto=require(_0x863f('0xe'));var jsforce=require(_0x863f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x863f('0xb'));var querystring=require(_0x863f('0x10'));var Papa=require('papaparse');var Redis=require(_0x863f('0x11'));var authService=require(_0x863f('0x12'));var qs=require(_0x863f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x863f('0x14'));var logger=require(_0x863f('0x15'))(_0x863f('0x16'));var utils=require(_0x863f('0x17'));var config=require(_0x863f('0x18'));var db=require(_0x863f('0x19'))['db'];function respondWithStatusCode(_0x380821,_0xb39e68){_0xb39e68=_0xb39e68||0xcc;return function(_0x22b516){if(_0x22b516){return _0x380821[_0x863f('0x1a')](_0xb39e68);}return _0x380821[_0x863f('0x1b')](_0xb39e68)[_0x863f('0x1c')]();};}function respondWithResult(_0x3b243a,_0x5b5044){_0x5b5044=_0x5b5044||0xc8;return function(_0x5b2eba){if(_0x5b2eba){return _0x3b243a[_0x863f('0x1b')](_0x5b5044)[_0x863f('0x1d')](_0x5b2eba);}};}function respondWithFilteredResult(_0x185e1b,_0x2cb761){return function(_0x3c11de){if(_0x3c11de){var _0x482708=_0x3c11de['count'],_0x2abf96=_0x2cb761[_0x863f('0x1e')],_0x237f6e=_0x2cb761['offset']+_0x2cb761[_0x863f('0x1f')],_0x1beb37;if(_0x237f6e>=_0x482708){_0x237f6e=_0x482708;_0x1beb37=0xc8;}else{_0x1beb37=0xce;}_0x185e1b[_0x863f('0x1b')](_0x1beb37);return _0x185e1b[_0x863f('0x20')](_0x863f('0x21'),_0x2abf96+'-'+_0x237f6e+'/'+_0x482708)[_0x863f('0x1d')](_0x3c11de);}return null;};}function patchUpdates(_0xc5e098){return function(_0x3b61c2){try{jsonpatch[_0x863f('0x22')](_0x3b61c2,_0xc5e098,!![]);}catch(_0x3e1d21){return BPromise[_0x863f('0x23')](_0x3e1d21);}return _0x3b61c2[_0x863f('0x24')]();};}function saveUpdates(_0x1d91c5,_0x3fbc37){return function(_0xa68038){if(_0xa68038){return _0xa68038[_0x863f('0x25')](_0x1d91c5)[_0x863f('0x26')](function(_0x5af2a5){return _0x5af2a5;});}return null;};}function removeEntity(_0x1f9f4c,_0x5e4e59){return function(_0x57a60e){if(_0x57a60e){return _0x57a60e[_0x863f('0x27')]()[_0x863f('0x26')](function(){_0x1f9f4c[_0x863f('0x1b')](0xcc)[_0x863f('0x1c')]();});}};}function handleEntityNotFound(_0x332e7d,_0x5bdc0b){return function(_0x520f5d){if(!_0x520f5d){_0x332e7d[_0x863f('0x1a')](0x194);}return _0x520f5d;};}function handleError(_0x51e1b1,_0x4c90ef){_0x4c90ef=_0x4c90ef||0x1f4;return function(_0x5e1bd0){logger[_0x863f('0x28')](_0x5e1bd0[_0x863f('0x29')]);if(_0x5e1bd0[_0x863f('0x2a')]){delete _0x5e1bd0[_0x863f('0x2a')];}_0x51e1b1[_0x863f('0x1b')](_0x4c90ef)[_0x863f('0x2b')](_0x5e1bd0);};}exports[_0x863f('0x2c')]=function(_0x41b10f,_0x1d72d1){var _0x479422={},_0x25c167={},_0x440e32={'count':0x0,'rows':[]};var _0x195081=_[_0x863f('0x2d')](db[_0x863f('0x2e')]['rawAttributes'],function(_0x5d3b74){return{'name':_0x5d3b74['fieldName'],'type':_0x5d3b74[_0x863f('0x2f')][_0x863f('0x30')]};});_0x25c167[_0x863f('0x31')]=_[_0x863f('0x2d')](_0x195081,_0x863f('0x2a'));_0x25c167['query']=_['keys'](_0x41b10f['query']);_0x25c167[_0x863f('0x32')]=_[_0x863f('0x33')](_0x25c167[_0x863f('0x31')],_0x25c167[_0x863f('0x34')]);_0x479422[_0x863f('0x35')]=_[_0x863f('0x33')](_0x25c167['model'],qs[_0x863f('0x36')](_0x41b10f[_0x863f('0x34')][_0x863f('0x36')]));_0x479422[_0x863f('0x35')]=_0x479422[_0x863f('0x35')][_0x863f('0x37')]?_0x479422[_0x863f('0x35')]:_0x25c167[_0x863f('0x31')];if(!_0x41b10f['query']['hasOwnProperty']('nolimit')){_0x479422[_0x863f('0x1f')]=qs[_0x863f('0x1f')](_0x41b10f['query'][_0x863f('0x1f')]);_0x479422[_0x863f('0x1e')]=qs['offset'](_0x41b10f['query'][_0x863f('0x1e')]);}_0x479422[_0x863f('0x38')]=qs['sort'](_0x41b10f['query'][_0x863f('0x39')]);_0x479422[_0x863f('0x3a')]=qs[_0x863f('0x32')](_['pick'](_0x41b10f['query'],_0x25c167[_0x863f('0x32')]));if(_0x41b10f[_0x863f('0x34')][_0x863f('0x3b')]){_0x479422['where']=_[_0x863f('0x3c')](_0x479422[_0x863f('0x3a')],{'$or':_[_0x863f('0x2d')](_0x195081,function(_0x33cb69){if(_0x33cb69[_0x863f('0x2f')]!=='VIRTUAL'){var _0x19c8de={};_0x19c8de[_0x33cb69[_0x863f('0x2a')]]={'$like':'%'+_0x41b10f['query']['filter']+'%'};return _0x19c8de;}})});}_0x479422=_['merge']({},_0x479422,_0x41b10f['options']);var _0x27be43={'where':_0x479422[_0x863f('0x3a')]};return db['MailQueueReport'][_0x863f('0x3d')](_0x27be43)['then'](function(_0x18b10e){_0x440e32[_0x863f('0x3d')]=_0x18b10e;if(_0x41b10f[_0x863f('0x34')]['includeAll']){_0x479422[_0x863f('0x3e')]=[{'all':!![]}];}return db[_0x863f('0x2e')][_0x863f('0x3f')](_0x479422);})[_0x863f('0x26')](function(_0x549cc1){_0x440e32[_0x863f('0x40')]=_0x549cc1;return _0x440e32;})[_0x863f('0x26')](respondWithFilteredResult(_0x1d72d1,_0x479422))['catch'](handleError(_0x1d72d1,null));};exports[_0x863f('0x41')]=function(_0x64406,_0x13c54a){var _0x56645d={'raw':!![],'where':{'id':_0x64406[_0x863f('0x42')]['id']}},_0x344956={};_0x344956[_0x863f('0x31')]=_[_0x863f('0x43')](db[_0x863f('0x2e')][_0x863f('0x44')]);_0x344956[_0x863f('0x34')]=_[_0x863f('0x43')](_0x64406[_0x863f('0x34')]);_0x344956[_0x863f('0x32')]=_[_0x863f('0x33')](_0x344956[_0x863f('0x31')],_0x344956[_0x863f('0x34')]);_0x56645d[_0x863f('0x35')]=_['intersection'](_0x344956['model'],qs[_0x863f('0x36')](_0x64406['query'][_0x863f('0x36')]));_0x56645d[_0x863f('0x35')]=_0x56645d[_0x863f('0x35')][_0x863f('0x37')]?_0x56645d[_0x863f('0x35')]:_0x344956['model'];if(_0x64406[_0x863f('0x34')][_0x863f('0x45')]){_0x56645d[_0x863f('0x3e')]=[{'all':!![]}];}_0x56645d=_[_0x863f('0x3c')]({},_0x56645d,_0x64406[_0x863f('0x46')]);return db[_0x863f('0x2e')][_0x863f('0x47')](_0x56645d)[_0x863f('0x26')](handleEntityNotFound(_0x13c54a,null))[_0x863f('0x26')](respondWithResult(_0x13c54a,null))[_0x863f('0x48')](handleError(_0x13c54a,null));};exports[_0x863f('0x49')]=function(_0x2feb5b,_0x1bd81b){return db[_0x863f('0x2e')]['create'](_0x2feb5b[_0x863f('0x4a')],{})[_0x863f('0x26')](respondWithResult(_0x1bd81b,0xc9))[_0x863f('0x48')](handleError(_0x1bd81b,null));};exports[_0x863f('0x25')]=function(_0x54eebc,_0x277b93){if(_0x54eebc[_0x863f('0x4a')]['id']){delete _0x54eebc[_0x863f('0x4a')]['id'];}return db[_0x863f('0x2e')]['find']({'where':{'id':_0x54eebc[_0x863f('0x42')]['id']}})[_0x863f('0x26')](handleEntityNotFound(_0x277b93,null))[_0x863f('0x26')](saveUpdates(_0x54eebc['body'],null))['then'](respondWithResult(_0x277b93,null))[_0x863f('0x48')](handleError(_0x277b93,null));};exports['destroy']=function(_0x1af97b,_0x2d0c5a){return db['MailQueueReport'][_0x863f('0x47')]({'where':{'id':_0x1af97b[_0x863f('0x42')]['id']}})[_0x863f('0x26')](handleEntityNotFound(_0x2d0c5a,null))[_0x863f('0x26')](removeEntity(_0x2d0c5a,null))[_0x863f('0x48')](handleError(_0x2d0c5a,null));};exports[_0x863f('0x4b')]=function(_0x560c47,_0x22204c){return db[_0x863f('0x2e')][_0x863f('0x4b')]()[_0x863f('0x26')](respondWithResult(_0x22204c,null))[_0x863f('0x48')](handleError(_0x22204c,null));}; \ No newline at end of file +var _0xa1ed=['update','then','destroy','error','send','map','rawAttributes','key','model','name','query','filters','attributes','intersection','fields','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','MailQueueReport','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save'];(function(_0x21ce79,_0x216254){var _0x55d519=function(_0x3dbb56){while(--_0x3dbb56){_0x21ce79['push'](_0x21ce79['shift']());}};_0x55d519(++_0x216254);}(_0xa1ed,0xf0));var _0xda1e=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xa1ed[_0x39cf70];return _0x580424;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xda1e('0x0'));var rimraf=require(_0xda1e('0x1'));var zipdir=require(_0xda1e('0x2'));var jsonpatch=require(_0xda1e('0x3'));var rp=require(_0xda1e('0x4'));var moment=require(_0xda1e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xda1e('0x6'));var util=require('util');var path=require(_0xda1e('0x7'));var sox=require('sox');var csv=require(_0xda1e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xda1e('0x9'));var squel=require(_0xda1e('0xa'));var crypto=require(_0xda1e('0xb'));var jsforce=require(_0xda1e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xda1e('0x8'));var querystring=require(_0xda1e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda1e('0xe'));var qs=require(_0xda1e('0xf'));var as=require(_0xda1e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda1e('0x11'))('api');var utils=require(_0xda1e('0x12'));var config=require(_0xda1e('0x13'));var db=require(_0xda1e('0x14'))['db'];function respondWithStatusCode(_0x46ee4e,_0x45fd88){_0x45fd88=_0x45fd88||0xcc;return function(_0x310d2d){if(_0x310d2d){return _0x46ee4e[_0xda1e('0x15')](_0x45fd88);}return _0x46ee4e[_0xda1e('0x16')](_0x45fd88)[_0xda1e('0x17')]();};}function respondWithResult(_0x46e0d4,_0x9a9a7f){_0x9a9a7f=_0x9a9a7f||0xc8;return function(_0xf98e3f){if(_0xf98e3f){return _0x46e0d4[_0xda1e('0x16')](_0x9a9a7f)[_0xda1e('0x18')](_0xf98e3f);}};}function respondWithFilteredResult(_0x21279e,_0x66195c){return function(_0x8e6b71){if(_0x8e6b71){var _0x11a8a5=_0x8e6b71[_0xda1e('0x19')],_0x302f6a=_0x66195c[_0xda1e('0x1a')],_0x168d04=_0x66195c[_0xda1e('0x1a')]+_0x66195c[_0xda1e('0x1b')],_0x2be3cb;if(_0x168d04>=_0x11a8a5){_0x168d04=_0x11a8a5;_0x2be3cb=0xc8;}else{_0x2be3cb=0xce;}_0x21279e[_0xda1e('0x16')](_0x2be3cb);return _0x21279e[_0xda1e('0x1c')](_0xda1e('0x1d'),_0x302f6a+'-'+_0x168d04+'/'+_0x11a8a5)[_0xda1e('0x18')](_0x8e6b71);}return null;};}function patchUpdates(_0x31a6df){return function(_0xa55a9d){try{jsonpatch['apply'](_0xa55a9d,_0x31a6df,!![]);}catch(_0x309eb9){return BPromise[_0xda1e('0x1e')](_0x309eb9);}return _0xa55a9d[_0xda1e('0x1f')]();};}function saveUpdates(_0x51965e,_0x40e826){return function(_0x3dcb41){if(_0x3dcb41){return _0x3dcb41[_0xda1e('0x20')](_0x51965e)[_0xda1e('0x21')](function(_0x3890c8){return _0x3890c8;});}return null;};}function removeEntity(_0x13687f,_0x205fb9){return function(_0x4e167b){if(_0x4e167b){return _0x4e167b[_0xda1e('0x22')]()[_0xda1e('0x21')](function(){_0x13687f[_0xda1e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa7f8a2,_0x21ac03){return function(_0x3aa554){if(!_0x3aa554){_0xa7f8a2['sendStatus'](0x194);}return _0x3aa554;};}function handleError(_0x32a5fd,_0x6d8c2d){_0x6d8c2d=_0x6d8c2d||0x1f4;return function(_0x102ece){logger[_0xda1e('0x23')](_0x102ece['stack']);if(_0x102ece['name']){delete _0x102ece['name'];}_0x32a5fd[_0xda1e('0x16')](_0x6d8c2d)[_0xda1e('0x24')](_0x102ece);};}exports['index']=function(_0x51aea4,_0x4db363){var _0x2991f1={},_0x22dd7a={},_0x20e140={'count':0x0,'rows':[]};var _0x4fe8a3=_[_0xda1e('0x25')](db['MailQueueReport'][_0xda1e('0x26')],function(_0x30bb85){return{'name':_0x30bb85['fieldName'],'type':_0x30bb85['type'][_0xda1e('0x27')]};});_0x22dd7a[_0xda1e('0x28')]=_['map'](_0x4fe8a3,_0xda1e('0x29'));_0x22dd7a[_0xda1e('0x2a')]=_['keys'](_0x51aea4[_0xda1e('0x2a')]);_0x22dd7a[_0xda1e('0x2b')]=_['intersection'](_0x22dd7a[_0xda1e('0x28')],_0x22dd7a[_0xda1e('0x2a')]);_0x2991f1[_0xda1e('0x2c')]=_[_0xda1e('0x2d')](_0x22dd7a[_0xda1e('0x28')],qs[_0xda1e('0x2e')](_0x51aea4[_0xda1e('0x2a')][_0xda1e('0x2e')]));_0x2991f1[_0xda1e('0x2c')]=_0x2991f1[_0xda1e('0x2c')]['length']?_0x2991f1[_0xda1e('0x2c')]:_0x22dd7a[_0xda1e('0x28')];if(!_0x51aea4[_0xda1e('0x2a')]['hasOwnProperty'](_0xda1e('0x2f'))){_0x2991f1[_0xda1e('0x1b')]=qs[_0xda1e('0x1b')](_0x51aea4['query']['limit']);_0x2991f1[_0xda1e('0x1a')]=qs[_0xda1e('0x1a')](_0x51aea4[_0xda1e('0x2a')]['offset']);}_0x2991f1[_0xda1e('0x30')]=qs[_0xda1e('0x31')](_0x51aea4[_0xda1e('0x2a')][_0xda1e('0x31')]);_0x2991f1['where']=qs[_0xda1e('0x2b')](_['pick'](_0x51aea4[_0xda1e('0x2a')],_0x22dd7a[_0xda1e('0x2b')]));if(_0x51aea4[_0xda1e('0x2a')][_0xda1e('0x32')]){_0x2991f1[_0xda1e('0x33')]=_['merge'](_0x2991f1['where'],{'$or':_[_0xda1e('0x25')](_0x4fe8a3,function(_0x124255){if(_0x124255['type']!==_0xda1e('0x34')){var _0x53988f={};_0x53988f[_0x124255['name']]={'$like':'%'+_0x51aea4[_0xda1e('0x2a')][_0xda1e('0x32')]+'%'};return _0x53988f;}})});}_0x2991f1=_['merge']({},_0x2991f1,_0x51aea4[_0xda1e('0x35')]);var _0x2dc7fe={'where':_0x2991f1[_0xda1e('0x33')]};return db['MailQueueReport']['count'](_0x2dc7fe)[_0xda1e('0x21')](function(_0x3fdd5c){_0x20e140[_0xda1e('0x19')]=_0x3fdd5c;if(_0x51aea4['query'][_0xda1e('0x36')]){_0x2991f1[_0xda1e('0x37')]=[{'all':!![]}];}return db[_0xda1e('0x38')][_0xda1e('0x39')](_0x2991f1);})[_0xda1e('0x21')](function(_0x59a61a){_0x20e140[_0xda1e('0x3a')]=_0x59a61a;return _0x20e140;})['then'](respondWithFilteredResult(_0x4db363,_0x2991f1))[_0xda1e('0x3b')](handleError(_0x4db363,null));};exports[_0xda1e('0x3c')]=function(_0x2d44cd,_0x109b95){var _0x38e86b={'raw':!![],'where':{'id':_0x2d44cd[_0xda1e('0x3d')]['id']}},_0x37aafc={};_0x37aafc[_0xda1e('0x28')]=_[_0xda1e('0x3e')](db['MailQueueReport']['rawAttributes']);_0x37aafc[_0xda1e('0x2a')]=_[_0xda1e('0x3e')](_0x2d44cd[_0xda1e('0x2a')]);_0x37aafc['filters']=_[_0xda1e('0x2d')](_0x37aafc[_0xda1e('0x28')],_0x37aafc[_0xda1e('0x2a')]);_0x38e86b[_0xda1e('0x2c')]=_[_0xda1e('0x2d')](_0x37aafc[_0xda1e('0x28')],qs[_0xda1e('0x2e')](_0x2d44cd[_0xda1e('0x2a')][_0xda1e('0x2e')]));_0x38e86b[_0xda1e('0x2c')]=_0x38e86b[_0xda1e('0x2c')][_0xda1e('0x3f')]?_0x38e86b['attributes']:_0x37aafc[_0xda1e('0x28')];if(_0x2d44cd[_0xda1e('0x2a')][_0xda1e('0x36')]){_0x38e86b[_0xda1e('0x37')]=[{'all':!![]}];}_0x38e86b=_['merge']({},_0x38e86b,_0x2d44cd['options']);return db[_0xda1e('0x38')][_0xda1e('0x40')](_0x38e86b)[_0xda1e('0x21')](handleEntityNotFound(_0x109b95,null))[_0xda1e('0x21')](respondWithResult(_0x109b95,null))['catch'](handleError(_0x109b95,null));};exports[_0xda1e('0x41')]=function(_0x5cbe3c,_0x373cc8){return db[_0xda1e('0x38')][_0xda1e('0x41')](_0x5cbe3c['body'],{})[_0xda1e('0x21')](respondWithResult(_0x373cc8,0xc9))[_0xda1e('0x3b')](handleError(_0x373cc8,null));};exports['update']=function(_0x235a6c,_0x646ef2){if(_0x235a6c[_0xda1e('0x42')]['id']){delete _0x235a6c[_0xda1e('0x42')]['id'];}return db[_0xda1e('0x38')][_0xda1e('0x40')]({'where':{'id':_0x235a6c[_0xda1e('0x3d')]['id']}})[_0xda1e('0x21')](handleEntityNotFound(_0x646ef2,null))[_0xda1e('0x21')](saveUpdates(_0x235a6c[_0xda1e('0x42')],null))[_0xda1e('0x21')](respondWithResult(_0x646ef2,null))[_0xda1e('0x3b')](handleError(_0x646ef2,null));};exports[_0xda1e('0x22')]=function(_0x4e4663,_0x313ebf){return db[_0xda1e('0x38')][_0xda1e('0x40')]({'where':{'id':_0x4e4663[_0xda1e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x313ebf,null))['then'](removeEntity(_0x313ebf,null))[_0xda1e('0x3b')](handleError(_0x313ebf,null));};exports['describe']=function(_0x268d76,_0x228bd4){return db[_0xda1e('0x38')][_0xda1e('0x43')]()[_0xda1e('0x21')](respondWithResult(_0x228bd4,null))[_0xda1e('0x3b')](handleError(_0x228bd4,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 7faef9b..37cb1da 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 _0x76d5=['define','MailQueueReport','uniqueid','../../config/logger','api','path','rimraf','../../config/environment','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x76d5,0x108));var _0x576d=function(_0x1c3e63,_0x147ea9){_0x1c3e63=_0x1c3e63-0x0;var _0x464055=_0x76d5[_0x1c3e63];return _0x464055;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x576d('0x0'))(_0x576d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x576d('0x2'));var rimraf=require(_0x576d('0x3'));var config=require(_0x576d('0x4'));var attributes=require('./mailQueueReport.attributes');module[_0x576d('0x5')]=function(_0xbce837,_0x25bfb4){return _0xbce837[_0x576d('0x6')](_0x576d('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x576d('0x8'),'fields':[_0x576d('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xff9e=['report_mail_queue','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x5ca042,_0x6d6134){var _0xfd9238=function(_0x234697){while(--_0x234697){_0x5ca042['push'](_0x5ca042['shift']());}};_0xfd9238(++_0x6d6134);}(_0xff9e,0xc6));var _0xeff9=function(_0x2c99de,_0x11a4bd){_0x2c99de=_0x2c99de-0x0;var _0x11c40d=_0xff9e[_0x2c99de];return _0x11c40d;};'use strict';var _=require('lodash');var util=require(_0xeff9('0x0'));var logger=require(_0xeff9('0x1'))('api');var moment=require(_0xeff9('0x2'));var BPromise=require(_0xeff9('0x3'));var rp=require(_0xeff9('0x4'));var fs=require('fs');var path=require(_0xeff9('0x5'));var rimraf=require(_0xeff9('0x6'));var config=require(_0xeff9('0x7'));var attributes=require(_0xeff9('0x8'));module[_0xeff9('0x9')]=function(_0x1e5738,_0x2e3b20){return _0x1e5738[_0xeff9('0xa')](_0xeff9('0xb'),attributes,{'tableName':_0xeff9('0xc'),'paranoid':![],'indexes':[{'name':_0xeff9('0xd'),'fields':[_0xeff9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 789fd8e..05487ba 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 _0x7880=['body','options','then','stringify','update','raw','where','attributes','limit','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateMailQueueReport','create'];(function(_0x1618e5,_0x5d9572){var _0xa4b71a=function(_0x1f1edd){while(--_0x1f1edd){_0x1618e5['push'](_0x1618e5['shift']());}};_0xa4b71a(++_0x5d9572);}(_0x7880,0x1f4));var _0x0788=function(_0x399a68,_0x32b703){_0x399a68=_0x399a68-0x0;var _0x283d8c=_0x7880[_0x399a68];return _0x283d8c;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});}exports[_0x0788('0x17')]=function(_0x5b2bdc){var _0x654e4b=this;return new Promise(function(_0x415f19,_0x17ae59){return db['MailQueueReport'][_0x0788('0x18')](_0x5b2bdc[_0x0788('0x19')],{'raw':_0x5b2bdc['options']?_0x5b2bdc[_0x0788('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0788('0x1b')](function(_0x48bc5f){logger[_0x0788('0x14')](_0x0788('0x17'),_0x5b2bdc);logger[_0x0788('0xf')](_0x0788('0x17'),_0x5b2bdc,JSON[_0x0788('0x1c')](_0x48bc5f));_0x415f19(_0x48bc5f);})['catch'](function(_0x48ec43){logger[_0x0788('0x11')](_0x0788('0x17'),_0x48ec43[_0x0788('0x13')],_0x5b2bdc);_0x17ae59(_0x654e4b[_0x0788('0x11')](0x1f4,_0x48ec43['message']));});});};exports['UpdateMailQueueReport']=function(_0x79204e){var _0x18cc33=this;return new Promise(function(_0x40309d,_0x50b65c){return db['MailQueueReport'][_0x0788('0x1d')](_0x79204e[_0x0788('0x19')],{'raw':_0x79204e['options']?_0x79204e['options'][_0x0788('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x79204e[_0x0788('0x1a')]?_0x79204e['options'][_0x0788('0x1f')]||null:null,'attributes':_0x79204e[_0x0788('0x1a')]?_0x79204e[_0x0788('0x1a')][_0x0788('0x20')]||null:null,'limit':_0x79204e[_0x0788('0x1a')]?_0x79204e[_0x0788('0x1a')][_0x0788('0x21')]||null:null})[_0x0788('0x1b')](function(_0x5b7594){logger['info'](_0x0788('0x22'),_0x79204e);logger[_0x0788('0xf')]('UpdateMailQueueReport',_0x79204e,JSON['stringify'](_0x5b7594));_0x40309d(_0x5b7594);})[_0x0788('0x16')](function(_0x68658a){logger[_0x0788('0x11')](_0x0788('0x22'),_0x68658a[_0x0788('0x13')],_0x79204e);_0x50b65c(_0x18cc33[_0x0788('0x11')](0x1f4,_0x68658a[_0x0788('0x13')]));});});}; \ No newline at end of file +var _0xd117=['request\x20sent','catch','MailQueueReport','body','options','raw','then','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x2b4eb0,_0x145855){var _0x3e9e10=function(_0xfe417a){while(--_0xfe417a){_0x2b4eb0['push'](_0x2b4eb0['shift']());}};_0x3e9e10(++_0x145855);}(_0xd117,0x182));var _0x7d11=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0xd117[_0x1f5a63];return _0x30bb7a;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});}exports['CreateMailQueueReport']=function(_0x456cb9){var _0x49a34b=this;return new Promise(function(_0x4d1306,_0x5459df){return db[_0x7d11('0x18')]['create'](_0x456cb9[_0x7d11('0x19')],{'raw':_0x456cb9['options']?_0x456cb9[_0x7d11('0x1a')][_0x7d11('0x1b')]===undefined?!![]:![]:!![]})[_0x7d11('0x1c')](function(_0x46f662){logger[_0x7d11('0xf')](_0x7d11('0x1d'),_0x456cb9);logger[_0x7d11('0x11')](_0x7d11('0x1d'),_0x456cb9,JSON['stringify'](_0x46f662));_0x4d1306(_0x46f662);})[_0x7d11('0x17')](function(_0x4a34f4){logger['error']('CreateMailQueueReport',_0x4a34f4[_0x7d11('0x15')],_0x456cb9);_0x5459df(_0x49a34b[_0x7d11('0x14')](0x1f4,_0x4a34f4[_0x7d11('0x15')]));});});};exports[_0x7d11('0x1e')]=function(_0x355d14){var _0xd938df=this;return new Promise(function(_0x282e5c,_0x1c1edd){return db['MailQueueReport'][_0x7d11('0x1f')](_0x355d14['body'],{'raw':_0x355d14['options']?_0x355d14['options'][_0x7d11('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x355d14['options']?_0x355d14[_0x7d11('0x1a')][_0x7d11('0x20')]||null:null,'attributes':_0x355d14[_0x7d11('0x1a')]?_0x355d14['options'][_0x7d11('0x21')]||null:null,'limit':_0x355d14[_0x7d11('0x1a')]?_0x355d14[_0x7d11('0x1a')]['limit']||null:null})[_0x7d11('0x1c')](function(_0x35a789){logger[_0x7d11('0xf')](_0x7d11('0x1e'),_0x355d14);logger['debug'](_0x7d11('0x1e'),_0x355d14,JSON['stringify'](_0x35a789));_0x282e5c(_0x35a789);})[_0x7d11('0x17')](function(_0x509164){logger[_0x7d11('0x14')](_0x7d11('0x1e'),_0x509164[_0x7d11('0x15')],_0x355d14);_0x1c1edd(_0xd938df['error'](0x1f4,_0x509164['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 27e0bee..65ea7f4 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 _0x48ea=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','path'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x48ea,0x11d));var _0xa48e=function(_0x18be1d,_0x58d330){_0x18be1d=_0x18be1d-0x0;var _0x2cdcd3=_0x48ea[_0x18be1d];return _0x2cdcd3;};'use strict';var multer=require(_0xa48e('0x0'));var util=require('util');var path=require(_0xa48e('0x1'));var timeout=require(_0xa48e('0x2'));var express=require('express');var router=express[_0xa48e('0x3')]();var auth=require(_0xa48e('0x4'));var interaction=require(_0xa48e('0x5'));var config=require(_0xa48e('0x6'));module['exports']=router; \ No newline at end of file +var _0xb2b0=['../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb2b0,0x72));var _0x0b2b=function(_0xf5a4bf,_0x2d57b4){_0xf5a4bf=_0xf5a4bf-0x0;var _0x1fced8=_0xb2b0[_0xf5a4bf];return _0x1fced8;};'use strict';var multer=require(_0x0b2b('0x0'));var util=require(_0x0b2b('0x1'));var path=require(_0x0b2b('0x2'));var timeout=require(_0x0b2b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0b2b('0x4'));var interaction=require(_0x0b2b('0x5'));var config=require(_0x0b2b('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 0c6f93d..46ea4f6 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 _0xd6a4=['STRING','BOOLEAN','username','INTEGER','INBOX','sequelize','exports'];(function(_0x12c3d1,_0x3c6ae7){var _0x282840=function(_0x4ae0d2){while(--_0x4ae0d2){_0x12c3d1['push'](_0x12c3d1['shift']());}};_0x282840(++_0x3c6ae7);}(_0xd6a4,0x91));var _0x4d6a=function(_0x166fca,_0x27ea4d){_0x166fca=_0x166fca-0x0;var _0x1e3b36=_0xd6a4[_0x166fca];return _0x1e3b36;};'use strict';var Sequelize=require(_0x4d6a('0x0'));module[_0x4d6a('0x1')]={'description':{'type':Sequelize[_0x4d6a('0x2')]},'host':{'type':Sequelize[_0x4d6a('0x2')]},'authentication':{'type':Sequelize[_0x4d6a('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x4d6a('0x2')],'unique':_0x4d6a('0x4')},'password':{'type':Sequelize[_0x4d6a('0x2')]},'port':{'type':Sequelize[_0x4d6a('0x5')]},'tls':{'type':Sequelize[_0x4d6a('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x4d6a('0x6')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4d6a('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4d6a('0x2')]}}; \ No newline at end of file +var _0x8ff6=['exports','STRING','BOOLEAN','username','INTEGER','INBOX','sequelize'];(function(_0xa51e80,_0xd9e6af){var _0x5a5eac=function(_0x1afa7f){while(--_0x1afa7f){_0xa51e80['push'](_0xa51e80['shift']());}};_0x5a5eac(++_0xd9e6af);}(_0x8ff6,0x84));var _0x68ff=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x8ff6[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x68ff('0x0'));module[_0x68ff('0x1')]={'description':{'type':Sequelize[_0x68ff('0x2')]},'host':{'type':Sequelize[_0x68ff('0x2')]},'authentication':{'type':Sequelize[_0x68ff('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x68ff('0x2')],'unique':_0x68ff('0x4')},'password':{'type':Sequelize[_0x68ff('0x2')]},'port':{'type':Sequelize[_0x68ff('0x5')]},'tls':{'type':Sequelize[_0x68ff('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x68ff('0x2')],'defaultValue':_0x68ff('0x6')},'connTimeout':{'type':Sequelize[_0x68ff('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x68ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d341fc8..45a7fdd 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 _0xd757=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd757,0x1e5));var _0x7d75=function(_0x29d842,_0x38fcf){_0x29d842=_0x29d842-0x0;var _0x482400=_0xd757[_0x29d842];return _0x482400;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require(_0x7d75('0x2'))(_0x7d75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x4'));var fs=require('fs');var path=require(_0x7d75('0x5'));var rimraf=require('rimraf');var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x52bb43,_0x5d6128){return _0x52bb43[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4024=['define','mail_servers_in','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3530f3,_0x54b84a){var _0x1c3022=function(_0x83906c){while(--_0x83906c){_0x3530f3['push'](_0x3530f3['shift']());}};_0x1c3022(++_0x54b84a);}(_0x4024,0x89));var _0x4402=function(_0x334774,_0x4ac032){_0x334774=_0x334774-0x0;var _0x4b8b02=_0x4024[_0x334774];return _0x4b8b02;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var logger=require('../../config/logger')(_0x4402('0x2'));var moment=require(_0x4402('0x3'));var BPromise=require('bluebird');var rp=require(_0x4402('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x17699b,_0x346ddc){return _0x17699b[_0x4402('0x7')]('MailServerIn',attributes,{'tableName':_0x4402('0x8'),'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 d891ac2..99e4ebd 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 _0x9a2e=['randomstring','../../config/utils','rpc','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','map','include','model','stringify','util','moment'];(function(_0x5c5e8d,_0x15397c){var _0x8d7668=function(_0x2da349){while(--_0x2da349){_0x5c5e8d['push'](_0x5c5e8d['shift']());}};_0x8d7668(++_0x15397c);}(_0x9a2e,0x12a));var _0xe9a2=function(_0x549895,_0x568c2e){_0x549895=_0x549895-0x0;var _0x5f2251=_0x9a2e[_0x549895];return _0x5f2251;};'use strict';var _=require('lodash');var util=require(_0xe9a2('0x0'));var moment=require(_0xe9a2('0x1'));var BPromise=require('bluebird');var rs=require(_0xe9a2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9a2('0x3'));var logger=require('../../config/logger')(_0xe9a2('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe9a2('0x5')][_0xe9a2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x247563,_0x19e1c2,_0x560541){return new BPromise(function(_0x43333d,_0x2f22ba){return client[_0xe9a2('0x7')](_0x247563,_0x560541)[_0xe9a2('0x8')](function(_0x2a7aee){logger[_0xe9a2('0x9')](_0xe9a2('0xa'),_0x19e1c2,_0xe9a2('0xb'));logger[_0xe9a2('0xc')](_0xe9a2('0xd'),_0x19e1c2,_0xe9a2('0xb'),JSON['stringify'](_0x2a7aee));if(_0x2a7aee[_0xe9a2('0xe')]){if(_0x2a7aee[_0xe9a2('0xe')][_0xe9a2('0xf')]===0x1f4){logger[_0xe9a2('0xe')](_0xe9a2('0xa'),_0x19e1c2,_0x2a7aee['error']['message']);return _0x2f22ba(_0x2a7aee[_0xe9a2('0xe')]['message']);}logger[_0xe9a2('0xe')](_0xe9a2('0xa'),_0x19e1c2,_0x2a7aee[_0xe9a2('0xe')][_0xe9a2('0x10')]);return _0x43333d(_0x2a7aee[_0xe9a2('0xe')][_0xe9a2('0x10')]);}else{logger[_0xe9a2('0x9')]('MailServerIn,\x20%s,\x20%s',_0x19e1c2,'request\x20sent');_0x43333d(_0x2a7aee['result']['message']);}})[_0xe9a2('0x11')](function(_0x269db6){logger[_0xe9a2('0xe')](_0xe9a2('0xa'),_0x19e1c2,_0x269db6);_0x2f22ba(_0x269db6);});});}exports[_0xe9a2('0x12')]=function(_0x36c1a0){var _0x46a328=this;return new Promise(function(_0x303504,_0x43aaf9){return db[_0xe9a2('0x13')][_0xe9a2('0x14')]({'raw':_0x36c1a0[_0xe9a2('0x15')]?_0x36c1a0[_0xe9a2('0x15')][_0xe9a2('0x16')]===undefined?!![]:![]:!![],'where':_0x36c1a0[_0xe9a2('0x15')]?_0x36c1a0[_0xe9a2('0x15')][_0xe9a2('0x17')]||null:null,'attributes':_0x36c1a0[_0xe9a2('0x15')]?_0x36c1a0['options'][_0xe9a2('0x18')]||null:null,'limit':_0x36c1a0[_0xe9a2('0x15')]?_0x36c1a0[_0xe9a2('0x15')][_0xe9a2('0x19')]||null:null,'include':_0x36c1a0[_0xe9a2('0x15')]?_0x36c1a0[_0xe9a2('0x15')]['include']?_[_0xe9a2('0x1a')](_0x36c1a0[_0xe9a2('0x15')][_0xe9a2('0x1b')],function(_0x216f7e){return{'model':db[_0x216f7e[_0xe9a2('0x1c')]],'as':_0x216f7e['as'],'attributes':_0x216f7e[_0xe9a2('0x18')],'include':_0x216f7e['include']?_[_0xe9a2('0x1a')](_0x216f7e[_0xe9a2('0x1b')],function(_0x5b30d1){return{'model':db[_0x5b30d1['model']],'as':_0x5b30d1['as'],'attributes':_0x5b30d1[_0xe9a2('0x18')],'include':_0x5b30d1[_0xe9a2('0x1b')]?_[_0xe9a2('0x1a')](_0x5b30d1[_0xe9a2('0x1b')],function(_0x4724c8){return{'model':db[_0x4724c8['model']],'as':_0x4724c8['as'],'attributes':_0x4724c8['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9a2('0x8')](function(_0x11d7d6){logger['info'](_0xe9a2('0x12'),_0x36c1a0);logger[_0xe9a2('0xc')](_0xe9a2('0x12'),_0x36c1a0,JSON[_0xe9a2('0x1d')](_0x11d7d6));_0x303504(_0x11d7d6);})[_0xe9a2('0x11')](function(_0x2ad982){logger[_0xe9a2('0xe')](_0xe9a2('0x12'),_0x2ad982[_0xe9a2('0x10')],_0x36c1a0);_0x43aaf9(_0x46a328[_0xe9a2('0xe')](0x1f4,_0x2ad982['message']));});});}; \ No newline at end of file +var _0x2d0c=['stringify','error','code','message','catch','GetMailServerIn','MailServerIn','options','where','attributes','limit','map','include','model','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x38a6b5,_0x5b6002){var _0x1ce21c=function(_0x541671){while(--_0x541671){_0x38a6b5['push'](_0x38a6b5['shift']());}};_0x1ce21c(++_0x5b6002);}(_0x2d0c,0x11c));var _0xc2d0=function(_0x2918e1,_0x9613bc){_0x2918e1=_0x2918e1-0x0;var _0x2f5165=_0x2d0c[_0x2918e1];return _0x2f5165;};'use strict';var _=require(_0xc2d0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc2d0('0x1'));var rs=require(_0xc2d0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc2d0('0x3'));var logger=require(_0xc2d0('0x4'))(_0xc2d0('0x5'));var config=require(_0xc2d0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc2d0('0x7')][_0xc2d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc25b8,_0x19d95c,_0x10897f){return new BPromise(function(_0x25889b,_0x2aa771){return client[_0xc2d0('0x9')](_0xc25b8,_0x10897f)[_0xc2d0('0xa')](function(_0x49e7b7){logger[_0xc2d0('0xb')](_0xc2d0('0xc'),_0x19d95c,_0xc2d0('0xd'));logger[_0xc2d0('0xe')](_0xc2d0('0xf'),_0x19d95c,_0xc2d0('0xd'),JSON[_0xc2d0('0x10')](_0x49e7b7));if(_0x49e7b7[_0xc2d0('0x11')]){if(_0x49e7b7[_0xc2d0('0x11')][_0xc2d0('0x12')]===0x1f4){logger[_0xc2d0('0x11')](_0xc2d0('0xc'),_0x19d95c,_0x49e7b7[_0xc2d0('0x11')][_0xc2d0('0x13')]);return _0x2aa771(_0x49e7b7[_0xc2d0('0x11')]['message']);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x19d95c,_0x49e7b7[_0xc2d0('0x11')]['message']);return _0x25889b(_0x49e7b7['error']['message']);}else{logger[_0xc2d0('0xb')](_0xc2d0('0xc'),_0x19d95c,'request\x20sent');_0x25889b(_0x49e7b7['result'][_0xc2d0('0x13')]);}})[_0xc2d0('0x14')](function(_0x4d3daf){logger[_0xc2d0('0x11')]('MailServerIn,\x20%s,\x20%s',_0x19d95c,_0x4d3daf);_0x2aa771(_0x4d3daf);});});}exports[_0xc2d0('0x15')]=function(_0x4753d0){var _0x83ba5f=this;return new Promise(function(_0x23806b,_0x4212c4){return db[_0xc2d0('0x16')]['findAll']({'raw':_0x4753d0[_0xc2d0('0x17')]?_0x4753d0['options']['raw']===undefined?!![]:![]:!![],'where':_0x4753d0['options']?_0x4753d0[_0xc2d0('0x17')][_0xc2d0('0x18')]||null:null,'attributes':_0x4753d0['options']?_0x4753d0[_0xc2d0('0x17')][_0xc2d0('0x19')]||null:null,'limit':_0x4753d0[_0xc2d0('0x17')]?_0x4753d0[_0xc2d0('0x17')][_0xc2d0('0x1a')]||null:null,'include':_0x4753d0[_0xc2d0('0x17')]?_0x4753d0[_0xc2d0('0x17')]['include']?_[_0xc2d0('0x1b')](_0x4753d0['options']['include'],function(_0x13037b){return{'model':db[_0x13037b['model']],'as':_0x13037b['as'],'attributes':_0x13037b['attributes'],'include':_0x13037b[_0xc2d0('0x1c')]?_['map'](_0x13037b[_0xc2d0('0x1c')],function(_0x352cb8){return{'model':db[_0x352cb8[_0xc2d0('0x1d')]],'as':_0x352cb8['as'],'attributes':_0x352cb8[_0xc2d0('0x19')],'include':_0x352cb8[_0xc2d0('0x1c')]?_[_0xc2d0('0x1b')](_0x352cb8['include'],function(_0x45559b){return{'model':db[_0x45559b['model']],'as':_0x45559b['as'],'attributes':_0x45559b[_0xc2d0('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc2d0('0xa')](function(_0x286688){logger['info']('GetMailServerIn',_0x4753d0);logger[_0xc2d0('0xe')](_0xc2d0('0x15'),_0x4753d0,JSON[_0xc2d0('0x10')](_0x286688));_0x23806b(_0x286688);})[_0xc2d0('0x14')](function(_0x51f550){logger[_0xc2d0('0x11')](_0xc2d0('0x15'),_0x51f550[_0xc2d0('0x13')],_0x4753d0);_0x4212c4(_0x83ba5f[_0xc2d0('0x11')](0x1f4,_0x51f550['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ff60dca..04a58d2 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 _0x089f=['util','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','post','create','put','update','delete','destroy','exports'];(function(_0x4de2e3,_0x572882){var _0x4d6f3f=function(_0x44316c){while(--_0x44316c){_0x4de2e3['push'](_0x4de2e3['shift']());}};_0x4d6f3f(++_0x572882);}(_0x089f,0x1a4));var _0xf089=function(_0x525577,_0x4b739f){_0x525577=_0x525577-0x0;var _0x1c9a52=_0x089f[_0x525577];return _0x1c9a52;};'use strict';var multer=require('multer');var util=require(_0xf089('0x0'));var path=require('path');var timeout=require(_0xf089('0x1'));var express=require('express');var router=express[_0xf089('0x2')]();var auth=require(_0xf089('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf089('0x4'));var controller=require(_0xf089('0x5'));router[_0xf089('0x6')]('/',auth[_0xf089('0x7')](),controller['index']);router[_0xf089('0x6')]('/:id',auth[_0xf089('0x7')](),controller['show']);router[_0xf089('0x8')]('/',auth[_0xf089('0x7')](),controller[_0xf089('0x9')]);router[_0xf089('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf089('0xb')]);router[_0xf089('0xc')]('/:id',auth[_0xf089('0x7')](),controller[_0xf089('0xd')]);module[_0xf089('0xe')]=router; \ No newline at end of file +var _0xd1a4=['index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated'];(function(_0x3bc725,_0x181231){var _0x3bdd25=function(_0x539e7c){while(--_0x539e7c){_0x3bc725['push'](_0x3bc725['shift']());}};_0x3bdd25(++_0x181231);}(_0xd1a4,0x1ad));var _0x4d1a=function(_0x3d17ff,_0x424498){_0x3d17ff=_0x3d17ff-0x0;var _0x4fe6e2=_0xd1a4[_0x3d17ff];return _0x4fe6e2;};'use strict';var multer=require(_0x4d1a('0x0'));var util=require(_0x4d1a('0x1'));var path=require(_0x4d1a('0x2'));var timeout=require(_0x4d1a('0x3'));var express=require(_0x4d1a('0x4'));var router=express[_0x4d1a('0x5')]();var auth=require(_0x4d1a('0x6'));var interaction=require(_0x4d1a('0x7'));var config=require(_0x4d1a('0x8'));var controller=require(_0x4d1a('0x9'));router[_0x4d1a('0xa')]('/',auth[_0x4d1a('0xb')](),controller[_0x4d1a('0xc')]);router['get'](_0x4d1a('0xd'),auth[_0x4d1a('0xb')](),controller[_0x4d1a('0xe')]);router[_0x4d1a('0xf')]('/',auth[_0x4d1a('0xb')](),controller[_0x4d1a('0x10')]);router[_0x4d1a('0x11')](_0x4d1a('0xd'),auth[_0x4d1a('0xb')](),controller[_0x4d1a('0x12')]);router[_0x4d1a('0x13')]('/:id',auth[_0x4d1a('0xb')](),controller[_0x4d1a('0x14')]);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 3a4527b..10e83cf 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 _0x3f96=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0x3f96,0x1d3));var _0x63f9=function(_0x49ea73,_0x53edee){_0x49ea73=_0x49ea73-0x0;var _0x34af85=_0x3f96[_0x49ea73];return _0x34af85;};'use strict';var Sequelize=require(_0x63f9('0x0'));module[_0x63f9('0x1')]={'description':{'type':Sequelize[_0x63f9('0x2')]},'host':{'type':Sequelize[_0x63f9('0x2')]},'user':{'type':Sequelize[_0x63f9('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x63f9('0x3')]},'secure':{'type':Sequelize[_0x63f9('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x63f9('0x2')]},'authentication':{'type':Sequelize[_0x63f9('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9432=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x36b26b,_0x3e717c){var _0x49b7df=function(_0x34ca4f){while(--_0x34ca4f){_0x36b26b['push'](_0x36b26b['shift']());}};_0x49b7df(++_0x3e717c);}(_0x9432,0x1e3));var _0x2943=function(_0x3f4199,_0x481a5c){_0x3f4199=_0x3f4199-0x0;var _0x5c5d0b=_0x9432[_0x3f4199];return _0x5c5d0b;};'use strict';var Sequelize=require(_0x2943('0x0'));module[_0x2943('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x2943('0x2')]},'user':{'type':Sequelize[_0x2943('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2943('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x2943('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index f8d4b11..86f1d4b 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 _0x52be=['path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','merge','where','VIRTUAL','filter','options','MailServerOut','count','includeAll','include','rows','params','catch','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x23651b,_0x5741ae){var _0xd5c714=function(_0x1d5b0d){while(--_0x1d5b0d){_0x23651b['push'](_0x23651b['shift']());}};_0xd5c714(++_0x5741ae);}(_0x52be,0x7f));var _0xe52b=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x52be[_0x3e6729];return _0x535bcd;};'use strict';var pdf=require(_0xe52b('0x0'));var emlformat=require(_0xe52b('0x1'));var rimraf=require(_0xe52b('0x2'));var zipdir=require(_0xe52b('0x3'));var jsonpatch=require(_0xe52b('0x4'));var rp=require(_0xe52b('0x5'));var moment=require('moment');var BPromise=require(_0xe52b('0x6'));var Mustache=require(_0xe52b('0x7'));var util=require(_0xe52b('0x8'));var path=require(_0xe52b('0x9'));var sox=require(_0xe52b('0xa'));var csv=require(_0xe52b('0xb'));var ejs=require(_0xe52b('0xc'));var fs=require('fs');var _=require(_0xe52b('0xd'));var squel=require(_0xe52b('0xe'));var crypto=require(_0xe52b('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe52b('0xb'));var querystring=require('querystring');var Papa=require(_0xe52b('0x10'));var Redis=require('ioredis');var authService=require(_0xe52b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe52b('0x12'));var hardwareService=require(_0xe52b('0x13'));var logger=require(_0xe52b('0x14'))('api');var utils=require(_0xe52b('0x15'));var config=require(_0xe52b('0x16'));var db=require(_0xe52b('0x17'))['db'];function respondWithStatusCode(_0x43473a,_0x3e495c){_0x3e495c=_0x3e495c||0xcc;return function(_0xdf822d){if(_0xdf822d){return _0x43473a[_0xe52b('0x18')](_0x3e495c);}return _0x43473a[_0xe52b('0x19')](_0x3e495c)[_0xe52b('0x1a')]();};}function respondWithResult(_0x4bf42e,_0x444363){_0x444363=_0x444363||0xc8;return function(_0x3ea9ea){if(_0x3ea9ea){return _0x4bf42e[_0xe52b('0x19')](_0x444363)['json'](_0x3ea9ea);}};}function respondWithFilteredResult(_0x44172f,_0x3dca4f){return function(_0x685dd5){if(_0x685dd5){var _0x5b8788=_0x685dd5['count'],_0x42037b=_0x3dca4f[_0xe52b('0x1b')],_0x5e8ca4=_0x3dca4f[_0xe52b('0x1b')]+_0x3dca4f[_0xe52b('0x1c')],_0x1865e2;if(_0x5e8ca4>=_0x5b8788){_0x5e8ca4=_0x5b8788;_0x1865e2=0xc8;}else{_0x1865e2=0xce;}_0x44172f['status'](_0x1865e2);return _0x44172f[_0xe52b('0x1d')](_0xe52b('0x1e'),_0x42037b+'-'+_0x5e8ca4+'/'+_0x5b8788)['json'](_0x685dd5);}return null;};}function patchUpdates(_0x44e34c){return function(_0x3ea00b){try{jsonpatch['apply'](_0x3ea00b,_0x44e34c,!![]);}catch(_0x1c3eaa){return BPromise[_0xe52b('0x1f')](_0x1c3eaa);}return _0x3ea00b[_0xe52b('0x20')]();};}function saveUpdates(_0x4317e0,_0x17f34f){return function(_0xfdf6b2){if(_0xfdf6b2){return _0xfdf6b2[_0xe52b('0x21')](_0x4317e0)[_0xe52b('0x22')](function(_0x5f3e39){return _0x5f3e39;});}return null;};}function removeEntity(_0x1ae304,_0x368333){return function(_0x375db6){if(_0x375db6){return _0x375db6[_0xe52b('0x23')]()[_0xe52b('0x22')](function(){_0x1ae304[_0xe52b('0x19')](0xcc)[_0xe52b('0x1a')]();});}};}function handleEntityNotFound(_0x36fc92,_0x55ad3a){return function(_0x3fca1f){if(!_0x3fca1f){_0x36fc92['sendStatus'](0x194);}return _0x3fca1f;};}function handleError(_0xb2fa8f,_0x482360){_0x482360=_0x482360||0x1f4;return function(_0x11e82b){logger[_0xe52b('0x24')](_0x11e82b['stack']);if(_0x11e82b[_0xe52b('0x25')]){delete _0x11e82b[_0xe52b('0x25')];}_0xb2fa8f[_0xe52b('0x19')](_0x482360)[_0xe52b('0x26')](_0x11e82b);};}exports[_0xe52b('0x27')]=function(_0x43b80f,_0x247bfe){var _0x428c57={},_0x19c235={},_0xcc303c={'count':0x0,'rows':[]};var _0x5a320d=_[_0xe52b('0x28')](db['MailServerOut'][_0xe52b('0x29')],function(_0x123bba){return{'name':_0x123bba['fieldName'],'type':_0x123bba[_0xe52b('0x2a')]['key']};});_0x19c235[_0xe52b('0x2b')]=_[_0xe52b('0x28')](_0x5a320d,_0xe52b('0x25'));_0x19c235[_0xe52b('0x2c')]=_[_0xe52b('0x2d')](_0x43b80f[_0xe52b('0x2c')]);_0x19c235[_0xe52b('0x2e')]=_[_0xe52b('0x2f')](_0x19c235[_0xe52b('0x2b')],_0x19c235[_0xe52b('0x2c')]);_0x428c57[_0xe52b('0x30')]=_['intersection'](_0x19c235['model'],qs[_0xe52b('0x31')](_0x43b80f['query'][_0xe52b('0x31')]));_0x428c57[_0xe52b('0x30')]=_0x428c57[_0xe52b('0x30')][_0xe52b('0x32')]?_0x428c57[_0xe52b('0x30')]:_0x19c235[_0xe52b('0x2b')];if(!_0x43b80f[_0xe52b('0x2c')][_0xe52b('0x33')]('nolimit')){_0x428c57[_0xe52b('0x1c')]=qs['limit'](_0x43b80f[_0xe52b('0x2c')][_0xe52b('0x1c')]);_0x428c57[_0xe52b('0x1b')]=qs[_0xe52b('0x1b')](_0x43b80f[_0xe52b('0x2c')][_0xe52b('0x1b')]);}_0x428c57['order']=qs[_0xe52b('0x34')](_0x43b80f[_0xe52b('0x2c')][_0xe52b('0x34')]);_0x428c57['where']=qs['filters'](_['pick'](_0x43b80f['query'],_0x19c235[_0xe52b('0x2e')]));if(_0x43b80f[_0xe52b('0x2c')]['filter']){_0x428c57['where']=_[_0xe52b('0x35')](_0x428c57[_0xe52b('0x36')],{'$or':_[_0xe52b('0x28')](_0x5a320d,function(_0x15b764){if(_0x15b764[_0xe52b('0x2a')]!==_0xe52b('0x37')){var _0x29abbe={};_0x29abbe[_0x15b764[_0xe52b('0x25')]]={'$like':'%'+_0x43b80f['query'][_0xe52b('0x38')]+'%'};return _0x29abbe;}})});}_0x428c57=_['merge']({},_0x428c57,_0x43b80f[_0xe52b('0x39')]);var _0xe3e986={'where':_0x428c57['where']};return db[_0xe52b('0x3a')][_0xe52b('0x3b')](_0xe3e986)['then'](function(_0x5262a5){_0xcc303c['count']=_0x5262a5;if(_0x43b80f['query'][_0xe52b('0x3c')]){_0x428c57[_0xe52b('0x3d')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x428c57);})[_0xe52b('0x22')](function(_0x1bd346){_0xcc303c[_0xe52b('0x3e')]=_0x1bd346;return _0xcc303c;})[_0xe52b('0x22')](respondWithFilteredResult(_0x247bfe,_0x428c57))['catch'](handleError(_0x247bfe,null));};exports['show']=function(_0x583629,_0x493293){var _0x14cd7e={'raw':!![],'where':{'id':_0x583629[_0xe52b('0x3f')]['id']}},_0x1951e3={};_0x1951e3[_0xe52b('0x2b')]=_[_0xe52b('0x2d')](db[_0xe52b('0x3a')][_0xe52b('0x29')]);_0x1951e3[_0xe52b('0x2c')]=_['keys'](_0x583629[_0xe52b('0x2c')]);_0x1951e3[_0xe52b('0x2e')]=_[_0xe52b('0x2f')](_0x1951e3[_0xe52b('0x2b')],_0x1951e3[_0xe52b('0x2c')]);_0x14cd7e['attributes']=_[_0xe52b('0x2f')](_0x1951e3['model'],qs[_0xe52b('0x31')](_0x583629[_0xe52b('0x2c')][_0xe52b('0x31')]));_0x14cd7e['attributes']=_0x14cd7e['attributes'][_0xe52b('0x32')]?_0x14cd7e[_0xe52b('0x30')]:_0x1951e3[_0xe52b('0x2b')];if(_0x583629[_0xe52b('0x2c')][_0xe52b('0x3c')]){_0x14cd7e[_0xe52b('0x3d')]=[{'all':!![]}];}_0x14cd7e=_[_0xe52b('0x35')]({},_0x14cd7e,_0x583629[_0xe52b('0x39')]);return db[_0xe52b('0x3a')]['find'](_0x14cd7e)['then'](handleEntityNotFound(_0x493293,null))[_0xe52b('0x22')](respondWithResult(_0x493293,null))[_0xe52b('0x40')](handleError(_0x493293,null));};exports[_0xe52b('0x41')]=function(_0x5ee17e,_0x5de058){return db[_0xe52b('0x3a')][_0xe52b('0x41')](_0x5ee17e[_0xe52b('0x42')],{})['then'](respondWithResult(_0x5de058,0xc9))[_0xe52b('0x40')](handleError(_0x5de058,null));};exports[_0xe52b('0x21')]=function(_0x536153,_0x5557fd){if(_0x536153['body']['id']){delete _0x536153[_0xe52b('0x42')]['id'];}return db[_0xe52b('0x3a')][_0xe52b('0x43')]({'where':{'id':_0x536153[_0xe52b('0x3f')]['id']}})[_0xe52b('0x22')](handleEntityNotFound(_0x5557fd,null))['then'](saveUpdates(_0x536153[_0xe52b('0x42')],null))[_0xe52b('0x22')](respondWithResult(_0x5557fd,null))[_0xe52b('0x40')](handleError(_0x5557fd,null));};exports[_0xe52b('0x23')]=function(_0xbcb0af,_0x40f474){return db[_0xe52b('0x3a')][_0xe52b('0x43')]({'where':{'id':_0xbcb0af['params']['id']}})['then'](handleEntityNotFound(_0x40f474,null))[_0xe52b('0x22')](removeEntity(_0x40f474,null))[_0xe52b('0x40')](handleError(_0x40f474,null));}; \ No newline at end of file +var _0x9c41=['../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','MailServerOut','count','includeAll','include','catch','show','params','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9c41,0xfc));var _0x19c4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9c41[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x19c4('0x0'));var zipdir=require(_0x19c4('0x1'));var jsonpatch=require(_0x19c4('0x2'));var rp=require(_0x19c4('0x3'));var moment=require(_0x19c4('0x4'));var BPromise=require(_0x19c4('0x5'));var Mustache=require(_0x19c4('0x6'));var util=require(_0x19c4('0x7'));var path=require(_0x19c4('0x8'));var sox=require('sox');var csv=require(_0x19c4('0x9'));var ejs=require(_0x19c4('0xa'));var fs=require('fs');var _=require(_0x19c4('0xb'));var squel=require('squel');var crypto=require(_0x19c4('0xc'));var jsforce=require(_0x19c4('0xd'));var deskjs=require(_0x19c4('0xe'));var toCsv=require(_0x19c4('0x9'));var querystring=require(_0x19c4('0xf'));var Papa=require(_0x19c4('0x10'));var Redis=require(_0x19c4('0x11'));var authService=require(_0x19c4('0x12'));var qs=require(_0x19c4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19c4('0x14'));var logger=require(_0x19c4('0x15'))('api');var utils=require(_0x19c4('0x16'));var config=require('../../config/environment');var db=require(_0x19c4('0x17'))['db'];function respondWithStatusCode(_0x30498d,_0x4c7644){_0x4c7644=_0x4c7644||0xcc;return function(_0x4abf76){if(_0x4abf76){return _0x30498d[_0x19c4('0x18')](_0x4c7644);}return _0x30498d[_0x19c4('0x19')](_0x4c7644)[_0x19c4('0x1a')]();};}function respondWithResult(_0x539039,_0x182e14){_0x182e14=_0x182e14||0xc8;return function(_0x3277a5){if(_0x3277a5){return _0x539039['status'](_0x182e14)[_0x19c4('0x1b')](_0x3277a5);}};}function respondWithFilteredResult(_0x298c95,_0x20de9b){return function(_0x528026){if(_0x528026){var _0x46595a=_0x528026['count'],_0x31c89c=_0x20de9b[_0x19c4('0x1c')],_0x4d9269=_0x20de9b[_0x19c4('0x1c')]+_0x20de9b[_0x19c4('0x1d')],_0x132852;if(_0x4d9269>=_0x46595a){_0x4d9269=_0x46595a;_0x132852=0xc8;}else{_0x132852=0xce;}_0x298c95[_0x19c4('0x19')](_0x132852);return _0x298c95['set']('Content-Range',_0x31c89c+'-'+_0x4d9269+'/'+_0x46595a)[_0x19c4('0x1b')](_0x528026);}return null;};}function patchUpdates(_0x34178d){return function(_0x5a3633){try{jsonpatch['apply'](_0x5a3633,_0x34178d,!![]);}catch(_0x16045e){return BPromise['reject'](_0x16045e);}return _0x5a3633['save']();};}function saveUpdates(_0x1abb2c,_0x5ac5a4){return function(_0x42ffdf){if(_0x42ffdf){return _0x42ffdf['update'](_0x1abb2c)[_0x19c4('0x1e')](function(_0x3c5b36){return _0x3c5b36;});}return null;};}function removeEntity(_0x3c06d8,_0x257786){return function(_0x5de774){if(_0x5de774){return _0x5de774[_0x19c4('0x1f')]()[_0x19c4('0x1e')](function(){_0x3c06d8[_0x19c4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x517b35,_0xce4016){return function(_0x2b4b28){if(!_0x2b4b28){_0x517b35[_0x19c4('0x18')](0x194);}return _0x2b4b28;};}function handleError(_0x3e56b4,_0x46428a){_0x46428a=_0x46428a||0x1f4;return function(_0x14bdf7){logger[_0x19c4('0x20')](_0x14bdf7[_0x19c4('0x21')]);if(_0x14bdf7[_0x19c4('0x22')]){delete _0x14bdf7[_0x19c4('0x22')];}_0x3e56b4[_0x19c4('0x19')](_0x46428a)[_0x19c4('0x23')](_0x14bdf7);};}exports[_0x19c4('0x24')]=function(_0x599712,_0xddf657){var _0x1234fb={},_0x2df697={},_0x404e48={'count':0x0,'rows':[]};var _0x1d6dc6=_[_0x19c4('0x25')](db['MailServerOut']['rawAttributes'],function(_0x1ddf46){return{'name':_0x1ddf46[_0x19c4('0x26')],'type':_0x1ddf46[_0x19c4('0x27')][_0x19c4('0x28')]};});_0x2df697[_0x19c4('0x29')]=_[_0x19c4('0x25')](_0x1d6dc6,_0x19c4('0x22'));_0x2df697[_0x19c4('0x2a')]=_['keys'](_0x599712[_0x19c4('0x2a')]);_0x2df697[_0x19c4('0x2b')]=_[_0x19c4('0x2c')](_0x2df697[_0x19c4('0x29')],_0x2df697['query']);_0x1234fb['attributes']=_[_0x19c4('0x2c')](_0x2df697[_0x19c4('0x29')],qs[_0x19c4('0x2d')](_0x599712[_0x19c4('0x2a')][_0x19c4('0x2d')]));_0x1234fb['attributes']=_0x1234fb[_0x19c4('0x2e')][_0x19c4('0x2f')]?_0x1234fb['attributes']:_0x2df697[_0x19c4('0x29')];if(!_0x599712[_0x19c4('0x2a')][_0x19c4('0x30')](_0x19c4('0x31'))){_0x1234fb[_0x19c4('0x1d')]=qs['limit'](_0x599712['query'][_0x19c4('0x1d')]);_0x1234fb[_0x19c4('0x1c')]=qs[_0x19c4('0x1c')](_0x599712['query'][_0x19c4('0x1c')]);}_0x1234fb['order']=qs[_0x19c4('0x32')](_0x599712['query']['sort']);_0x1234fb[_0x19c4('0x33')]=qs[_0x19c4('0x2b')](_[_0x19c4('0x34')](_0x599712[_0x19c4('0x2a')],_0x2df697[_0x19c4('0x2b')]));if(_0x599712[_0x19c4('0x2a')][_0x19c4('0x35')]){_0x1234fb[_0x19c4('0x33')]=_['merge'](_0x1234fb['where'],{'$or':_[_0x19c4('0x25')](_0x1d6dc6,function(_0x104f99){if(_0x104f99[_0x19c4('0x27')]!==_0x19c4('0x36')){var _0x5ecfdd={};_0x5ecfdd[_0x104f99[_0x19c4('0x22')]]={'$like':'%'+_0x599712[_0x19c4('0x2a')][_0x19c4('0x35')]+'%'};return _0x5ecfdd;}})});}_0x1234fb=_[_0x19c4('0x37')]({},_0x1234fb,_0x599712[_0x19c4('0x38')]);var _0xca6904={'where':_0x1234fb[_0x19c4('0x33')]};return db[_0x19c4('0x39')][_0x19c4('0x3a')](_0xca6904)['then'](function(_0x7dccff){_0x404e48['count']=_0x7dccff;if(_0x599712[_0x19c4('0x2a')][_0x19c4('0x3b')]){_0x1234fb[_0x19c4('0x3c')]=[{'all':!![]}];}return db[_0x19c4('0x39')]['findAll'](_0x1234fb);})[_0x19c4('0x1e')](function(_0x48686d){_0x404e48['rows']=_0x48686d;return _0x404e48;})[_0x19c4('0x1e')](respondWithFilteredResult(_0xddf657,_0x1234fb))[_0x19c4('0x3d')](handleError(_0xddf657,null));};exports[_0x19c4('0x3e')]=function(_0xbcd87a,_0xdda782){var _0x236989={'raw':!![],'where':{'id':_0xbcd87a[_0x19c4('0x3f')]['id']}},_0xd99bdd={};_0xd99bdd[_0x19c4('0x29')]=_['keys'](db[_0x19c4('0x39')]['rawAttributes']);_0xd99bdd[_0x19c4('0x2a')]=_['keys'](_0xbcd87a[_0x19c4('0x2a')]);_0xd99bdd[_0x19c4('0x2b')]=_[_0x19c4('0x2c')](_0xd99bdd[_0x19c4('0x29')],_0xd99bdd['query']);_0x236989[_0x19c4('0x2e')]=_[_0x19c4('0x2c')](_0xd99bdd[_0x19c4('0x29')],qs[_0x19c4('0x2d')](_0xbcd87a['query'][_0x19c4('0x2d')]));_0x236989[_0x19c4('0x2e')]=_0x236989['attributes'][_0x19c4('0x2f')]?_0x236989[_0x19c4('0x2e')]:_0xd99bdd[_0x19c4('0x29')];if(_0xbcd87a[_0x19c4('0x2a')][_0x19c4('0x3b')]){_0x236989[_0x19c4('0x3c')]=[{'all':!![]}];}_0x236989=_[_0x19c4('0x37')]({},_0x236989,_0xbcd87a[_0x19c4('0x38')]);return db[_0x19c4('0x39')][_0x19c4('0x40')](_0x236989)[_0x19c4('0x1e')](handleEntityNotFound(_0xdda782,null))[_0x19c4('0x1e')](respondWithResult(_0xdda782,null))['catch'](handleError(_0xdda782,null));};exports[_0x19c4('0x41')]=function(_0x16f888,_0xa6ad3a){return db[_0x19c4('0x39')]['create'](_0x16f888[_0x19c4('0x42')],{})[_0x19c4('0x1e')](respondWithResult(_0xa6ad3a,0xc9))['catch'](handleError(_0xa6ad3a,null));};exports[_0x19c4('0x43')]=function(_0x2b0910,_0xe0147b){if(_0x2b0910['body']['id']){delete _0x2b0910[_0x19c4('0x42')]['id'];}return db[_0x19c4('0x39')]['find']({'where':{'id':_0x2b0910['params']['id']}})[_0x19c4('0x1e')](handleEntityNotFound(_0xe0147b,null))[_0x19c4('0x1e')](saveUpdates(_0x2b0910[_0x19c4('0x42')],null))[_0x19c4('0x1e')](respondWithResult(_0xe0147b,null))['catch'](handleError(_0xe0147b,null));};exports[_0x19c4('0x1f')]=function(_0x3e9f37,_0x40cf21){return db[_0x19c4('0x39')][_0x19c4('0x40')]({'where':{'id':_0x3e9f37['params']['id']}})[_0x19c4('0x1e')](handleEntityNotFound(_0x40cf21,null))[_0x19c4('0x1e')](removeEntity(_0x40cf21,null))['catch'](handleError(_0x40cf21,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 8d46ace..bc04c99 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 _0x53ec=['bluebird','path','../../config/environment','./mailServerOut.attributes','define','MailServerOut','lodash','util','../../config/logger','api','moment'];(function(_0x534c76,_0x169233){var _0x3a0de2=function(_0x18b3bf){while(--_0x18b3bf){_0x534c76['push'](_0x534c76['shift']());}};_0x3a0de2(++_0x169233);}(_0x53ec,0x192));var _0xc53e=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0x53ec[_0x33ebf5];return _0x66957b;};'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':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','MailServerOut'];(function(_0x2565bc,_0x3a3ac4){var _0x19acfd=function(_0x353166){while(--_0x353166){_0x2565bc['push'](_0x2565bc['shift']());}};_0x19acfd(++_0x3a3ac4);}(_0x4819,0xcd));var _0x9481=function(_0x28da10,_0x29470c){_0x28da10=_0x28da10-0x0;var _0x298372=_0x4819[_0x28da10];return _0x298372;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 29714d7..d6729a2 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 _0x569a=['../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x284f55,_0x1cd50c){var _0x501d7f=function(_0x5f4563){while(--_0x5f4563){_0x284f55['push'](_0x284f55['shift']());}};_0x501d7f(++_0x1cd50c);}(_0x569a,0x15a));var _0xa569=function(_0x3a94e1,_0x22e4fd){_0x3a94e1=_0x3a94e1-0x0;var _0x6a09d5=_0x569a[_0x3a94e1];return _0x6a09d5;};'use strict';var _=require(_0xa569('0x0'));var util=require(_0xa569('0x1'));var moment=require(_0xa569('0x2'));var BPromise=require(_0xa569('0x3'));var rs=require(_0xa569('0x4'));var fs=require('fs');var Redis=require(_0xa569('0x5'));var db=require(_0xa569('0x6'))['db'];var utils=require(_0xa569('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa569('0x8'));var client=jayson[_0xa569('0x9')][_0xa569('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x806972,_0x22125e,_0x10b02d){return new BPromise(function(_0x2b1a6a,_0x214926){return client[_0xa569('0xb')](_0x806972,_0x10b02d)['then'](function(_0xa1b758){logger[_0xa569('0xc')](_0xa569('0xd'),_0x22125e,_0xa569('0xe'));logger['debug'](_0xa569('0xf'),_0x22125e,'request\x20sent',JSON[_0xa569('0x10')](_0xa1b758));if(_0xa1b758['error']){if(_0xa1b758[_0xa569('0x11')][_0xa569('0x12')]===0x1f4){logger[_0xa569('0x11')](_0xa569('0xd'),_0x22125e,_0xa1b758[_0xa569('0x11')][_0xa569('0x13')]);return _0x214926(_0xa1b758['error'][_0xa569('0x13')]);}logger[_0xa569('0x11')](_0xa569('0xd'),_0x22125e,_0xa1b758[_0xa569('0x11')]['message']);return _0x2b1a6a(_0xa1b758[_0xa569('0x11')][_0xa569('0x13')]);}else{logger['info'](_0xa569('0xd'),_0x22125e,_0xa569('0xe'));_0x2b1a6a(_0xa1b758[_0xa569('0x14')]['message']);}})[_0xa569('0x15')](function(_0x3be584){logger[_0xa569('0x11')](_0xa569('0xd'),_0x22125e,_0x3be584);_0x214926(_0x3be584);});});} \ No newline at end of file +var _0x2b3f=['../../config/logger','rpc','client','http','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2406ac,_0x1df6c9){var _0x354704=function(_0x4d416b){while(--_0x4d416b){_0x2406ac['push'](_0x2406ac['shift']());}};_0x354704(++_0x1df6c9);}(_0x2b3f,0x1c7));var _0xf2b3=function(_0x4bfe4a,_0x43022c){_0x4bfe4a=_0x4bfe4a-0x0;var _0x4fa9c9=_0x2b3f[_0x4bfe4a];return _0x4fa9c9;};'use strict';var _=require(_0xf2b3('0x0'));var util=require('util');var moment=require(_0xf2b3('0x1'));var BPromise=require(_0xf2b3('0x2'));var rs=require(_0xf2b3('0x3'));var fs=require('fs');var Redis=require(_0xf2b3('0x4'));var db=require(_0xf2b3('0x5'))['db'];var utils=require(_0xf2b3('0x6'));var logger=require(_0xf2b3('0x7'))(_0xf2b3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf2b3('0x9')][_0xf2b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a2b4c,_0x2ff4a1,_0x26a88c){return new BPromise(function(_0x1fdded,_0x20fb58){return client['request'](_0x5a2b4c,_0x26a88c)[_0xf2b3('0xb')](function(_0x4b7989){logger[_0xf2b3('0xc')](_0xf2b3('0xd'),_0x2ff4a1,_0xf2b3('0xe'));logger[_0xf2b3('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x2ff4a1,'request\x20sent',JSON[_0xf2b3('0x10')](_0x4b7989));if(_0x4b7989[_0xf2b3('0x11')]){if(_0x4b7989['error'][_0xf2b3('0x12')]===0x1f4){logger[_0xf2b3('0x11')]('MailServerOut,\x20%s,\x20%s',_0x2ff4a1,_0x4b7989['error'][_0xf2b3('0x13')]);return _0x20fb58(_0x4b7989[_0xf2b3('0x11')][_0xf2b3('0x13')]);}logger[_0xf2b3('0x11')](_0xf2b3('0xd'),_0x2ff4a1,_0x4b7989['error'][_0xf2b3('0x13')]);return _0x1fdded(_0x4b7989[_0xf2b3('0x11')][_0xf2b3('0x13')]);}else{logger['info'](_0xf2b3('0xd'),_0x2ff4a1,_0xf2b3('0xe'));_0x1fdded(_0x4b7989['result'][_0xf2b3('0x13')]);}})[_0xf2b3('0x14')](function(_0x2adc4d){logger[_0xf2b3('0x11')](_0xf2b3('0xd'),_0x2ff4a1,_0x2adc4d);_0x20fb58(_0x2adc4d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index c86fba8..fee27e0 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 _0x6dbb=['update','delete','exports','multer','../../components/auth/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','get','/describe','describe','/:id','create','put'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6dbb,0xab));var _0xb6db=function(_0x4aee42,_0x2d4113){_0x4aee42=_0x4aee42-0x0;var _0x2b97b8=_0x6dbb[_0x4aee42];return _0x2b97b8;};'use strict';var multer=require(_0xb6db('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xb6db('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0xb6db('0x2'));var controller=require(_0xb6db('0x3'));router['get']('/',auth[_0xb6db('0x4')](),controller['index']);router[_0xb6db('0x5')](_0xb6db('0x6'),auth['isAuthenticated'](),controller[_0xb6db('0x7')]);router[_0xb6db('0x5')](_0xb6db('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb6db('0x9')]);router[_0xb6db('0xa')](_0xb6db('0x8'),auth[_0xb6db('0x4')](),controller[_0xb6db('0xb')]);router[_0xb6db('0xc')](_0xb6db('0x8'),auth[_0xb6db('0x4')](),controller['destroy']);module[_0xb6db('0xd')]=router; \ No newline at end of file +var _0xd336=['describe','/:id','post','create','update','delete','destroy','multer','util','path','express','../../components/interaction/service','./mailSubstatus.controller','get','index','/describe','isAuthenticated'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xd336,0xc2));var _0x6d33=function(_0xb65e77,_0x238c3d){_0xb65e77=_0xb65e77-0x0;var _0x38134b=_0xd336[_0xb65e77];return _0x38134b;};'use strict';var multer=require(_0x6d33('0x0'));var util=require(_0x6d33('0x1'));var path=require(_0x6d33('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d33('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6d33('0x4'));var config=require('../../config/environment');var controller=require(_0x6d33('0x5'));router[_0x6d33('0x6')]('/',auth['isAuthenticated'](),controller[_0x6d33('0x7')]);router['get'](_0x6d33('0x8'),auth[_0x6d33('0x9')](),controller[_0x6d33('0xa')]);router[_0x6d33('0x6')](_0x6d33('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6d33('0xc')]('/',auth['isAuthenticated'](),controller[_0x6d33('0xd')]);router['put'](_0x6d33('0xb'),auth['isAuthenticated'](),controller[_0x6d33('0xe')]);router[_0x6d33('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6d33('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index f914f76..6f1c295 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 _0xfb0b=['STRING','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xfb0b,0x94));var _0xbfb0=function(_0xcdd9ee,_0x555042){_0xcdd9ee=_0xcdd9ee-0x0;var _0x185589=_0xfb0b[_0xcdd9ee];return _0x185589;};'use strict';var Sequelize=require(_0xbfb0('0x0'));module[_0xbfb0('0x1')]={'name':{'type':Sequelize[_0xbfb0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbfb0('0x2')]}}; \ No newline at end of file +var _0xb114=['STRING','name','sequelize'];(function(_0x1b4923,_0x41c600){var _0x2bb822=function(_0x340ab4){while(--_0x340ab4){_0x1b4923['push'](_0x1b4923['shift']());}};_0x2bb822(++_0x41c600);}(_0xb114,0x11f));var _0x4b11=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xb114[_0x101e7b];return _0x4995c0;};'use strict';var Sequelize=require(_0x4b11('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b11('0x1')],'unique':_0x4b11('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 2f5bded..e977155 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 _0xee14=['show','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','MailSubstatus','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x5f2947,_0x529552){var _0x513f2d=function(_0x22e92e){while(--_0x22e92e){_0x5f2947['push'](_0x5f2947['shift']());}};_0x513f2d(++_0x529552);}(_0xee14,0x13a));var _0x4ee1=function(_0x27ae1b,_0x58ac5c){_0x27ae1b=_0x27ae1b-0x0;var _0x1c7e69=_0xee14[_0x27ae1b];return _0x1c7e69;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4ee1('0x0'));var zipdir=require(_0x4ee1('0x1'));var jsonpatch=require(_0x4ee1('0x2'));var rp=require(_0x4ee1('0x3'));var moment=require(_0x4ee1('0x4'));var BPromise=require(_0x4ee1('0x5'));var Mustache=require(_0x4ee1('0x6'));var util=require(_0x4ee1('0x7'));var path=require(_0x4ee1('0x8'));var sox=require('sox');var csv=require(_0x4ee1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0x9'));var querystring=require('querystring');var Papa=require(_0x4ee1('0xf'));var Redis=require(_0x4ee1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x11'));var as=require(_0x4ee1('0x12'));var hardwareService=require(_0x4ee1('0x13'));var logger=require(_0x4ee1('0x14'))('api');var utils=require(_0x4ee1('0x15'));var config=require(_0x4ee1('0x16'));var db=require(_0x4ee1('0x17'))['db'];function respondWithStatusCode(_0x2d5d3c,_0x2f864e){_0x2f864e=_0x2f864e||0xcc;return function(_0x174427){if(_0x174427){return _0x2d5d3c['sendStatus'](_0x2f864e);}return _0x2d5d3c[_0x4ee1('0x18')](_0x2f864e)[_0x4ee1('0x19')]();};}function respondWithResult(_0x1096a5,_0x24a915){_0x24a915=_0x24a915||0xc8;return function(_0x46d2c2){if(_0x46d2c2){return _0x1096a5[_0x4ee1('0x18')](_0x24a915)[_0x4ee1('0x1a')](_0x46d2c2);}};}function respondWithFilteredResult(_0x359bab,_0xb7eafd){return function(_0x4e3490){if(_0x4e3490){var _0x2f9194=_0x4e3490[_0x4ee1('0x1b')],_0x38008f=_0xb7eafd[_0x4ee1('0x1c')],_0x34651b=_0xb7eafd[_0x4ee1('0x1c')]+_0xb7eafd[_0x4ee1('0x1d')],_0x1b1e0e;if(_0x34651b>=_0x2f9194){_0x34651b=_0x2f9194;_0x1b1e0e=0xc8;}else{_0x1b1e0e=0xce;}_0x359bab[_0x4ee1('0x18')](_0x1b1e0e);return _0x359bab[_0x4ee1('0x1e')](_0x4ee1('0x1f'),_0x38008f+'-'+_0x34651b+'/'+_0x2f9194)['json'](_0x4e3490);}return null;};}function patchUpdates(_0x236215){return function(_0x3db827){try{jsonpatch[_0x4ee1('0x20')](_0x3db827,_0x236215,!![]);}catch(_0x1034fb){return BPromise[_0x4ee1('0x21')](_0x1034fb);}return _0x3db827[_0x4ee1('0x22')]();};}function saveUpdates(_0x48a959,_0x8a631f){return function(_0x333e96){if(_0x333e96){return _0x333e96[_0x4ee1('0x23')](_0x48a959)[_0x4ee1('0x24')](function(_0x160a26){return _0x160a26;});}return null;};}function removeEntity(_0x224b54,_0x328f21){return function(_0x40fd98){if(_0x40fd98){return _0x40fd98[_0x4ee1('0x25')]()[_0x4ee1('0x24')](function(){_0x224b54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(!_0xaf87e7){_0x14110c[_0x4ee1('0x26')](0x194);}return _0xaf87e7;};}function handleError(_0x1e9a50,_0x28efdc){_0x28efdc=_0x28efdc||0x1f4;return function(_0x57d45d){logger['error'](_0x57d45d[_0x4ee1('0x27')]);if(_0x57d45d[_0x4ee1('0x28')]){delete _0x57d45d['name'];}_0x1e9a50[_0x4ee1('0x18')](_0x28efdc)[_0x4ee1('0x29')](_0x57d45d);};}exports[_0x4ee1('0x2a')]=function(_0x215949,_0x2d699c){var _0x3c7b2a={},_0x45bd0d={},_0x56c4d3={'count':0x0,'rows':[]};var _0x1f7b74=_['map'](db[_0x4ee1('0x2b')]['rawAttributes'],function(_0x3dc870){return{'name':_0x3dc870[_0x4ee1('0x2c')],'type':_0x3dc870[_0x4ee1('0x2d')][_0x4ee1('0x2e')]};});_0x45bd0d[_0x4ee1('0x2f')]=_['map'](_0x1f7b74,_0x4ee1('0x28'));_0x45bd0d['query']=_[_0x4ee1('0x30')](_0x215949[_0x4ee1('0x31')]);_0x45bd0d[_0x4ee1('0x32')]=_[_0x4ee1('0x33')](_0x45bd0d[_0x4ee1('0x2f')],_0x45bd0d['query']);_0x3c7b2a[_0x4ee1('0x34')]=_[_0x4ee1('0x33')](_0x45bd0d[_0x4ee1('0x2f')],qs[_0x4ee1('0x35')](_0x215949[_0x4ee1('0x31')][_0x4ee1('0x35')]));_0x3c7b2a['attributes']=_0x3c7b2a['attributes'][_0x4ee1('0x36')]?_0x3c7b2a[_0x4ee1('0x34')]:_0x45bd0d[_0x4ee1('0x2f')];if(!_0x215949['query'][_0x4ee1('0x37')](_0x4ee1('0x38'))){_0x3c7b2a[_0x4ee1('0x1d')]=qs[_0x4ee1('0x1d')](_0x215949[_0x4ee1('0x31')][_0x4ee1('0x1d')]);_0x3c7b2a[_0x4ee1('0x1c')]=qs[_0x4ee1('0x1c')](_0x215949[_0x4ee1('0x31')][_0x4ee1('0x1c')]);}_0x3c7b2a[_0x4ee1('0x39')]=qs[_0x4ee1('0x3a')](_0x215949[_0x4ee1('0x31')]['sort']);_0x3c7b2a[_0x4ee1('0x3b')]=qs[_0x4ee1('0x32')](_[_0x4ee1('0x3c')](_0x215949['query'],_0x45bd0d['filters']));if(_0x215949[_0x4ee1('0x31')][_0x4ee1('0x3d')]){_0x3c7b2a[_0x4ee1('0x3b')]=_[_0x4ee1('0x3e')](_0x3c7b2a['where'],{'$or':_[_0x4ee1('0x3f')](_0x1f7b74,function(_0x2ed16f){if(_0x2ed16f[_0x4ee1('0x2d')]!==_0x4ee1('0x40')){var _0x2653c4={};_0x2653c4[_0x2ed16f[_0x4ee1('0x28')]]={'$like':'%'+_0x215949[_0x4ee1('0x31')][_0x4ee1('0x3d')]+'%'};return _0x2653c4;}})});}_0x3c7b2a=_['merge']({},_0x3c7b2a,_0x215949[_0x4ee1('0x41')]);var _0x1116b4={'where':_0x3c7b2a[_0x4ee1('0x3b')]};return db[_0x4ee1('0x2b')][_0x4ee1('0x1b')](_0x1116b4)[_0x4ee1('0x24')](function(_0x543b2e){_0x56c4d3[_0x4ee1('0x1b')]=_0x543b2e;if(_0x215949[_0x4ee1('0x31')][_0x4ee1('0x42')]){_0x3c7b2a[_0x4ee1('0x43')]=[{'all':!![]}];}return db[_0x4ee1('0x2b')][_0x4ee1('0x44')](_0x3c7b2a);})[_0x4ee1('0x24')](function(_0xaac883){_0x56c4d3[_0x4ee1('0x45')]=_0xaac883;return _0x56c4d3;})[_0x4ee1('0x24')](respondWithFilteredResult(_0x2d699c,_0x3c7b2a))[_0x4ee1('0x46')](handleError(_0x2d699c,null));};exports[_0x4ee1('0x47')]=function(_0x34fc7a,_0x51fd40){var _0x3b3bed={'raw':!![],'where':{'id':_0x34fc7a['params']['id']}},_0x40a3e3={};_0x40a3e3[_0x4ee1('0x2f')]=_['keys'](db[_0x4ee1('0x2b')]['rawAttributes']);_0x40a3e3[_0x4ee1('0x31')]=_[_0x4ee1('0x30')](_0x34fc7a['query']);_0x40a3e3[_0x4ee1('0x32')]=_[_0x4ee1('0x33')](_0x40a3e3[_0x4ee1('0x2f')],_0x40a3e3[_0x4ee1('0x31')]);_0x3b3bed['attributes']=_[_0x4ee1('0x33')](_0x40a3e3[_0x4ee1('0x2f')],qs[_0x4ee1('0x35')](_0x34fc7a['query']['fields']));_0x3b3bed[_0x4ee1('0x34')]=_0x3b3bed[_0x4ee1('0x34')][_0x4ee1('0x36')]?_0x3b3bed[_0x4ee1('0x34')]:_0x40a3e3[_0x4ee1('0x2f')];if(_0x34fc7a['query']['includeAll']){_0x3b3bed[_0x4ee1('0x43')]=[{'all':!![]}];}_0x3b3bed=_[_0x4ee1('0x3e')]({},_0x3b3bed,_0x34fc7a[_0x4ee1('0x41')]);return db[_0x4ee1('0x2b')]['find'](_0x3b3bed)[_0x4ee1('0x24')](handleEntityNotFound(_0x51fd40,null))[_0x4ee1('0x24')](respondWithResult(_0x51fd40,null))['catch'](handleError(_0x51fd40,null));};exports[_0x4ee1('0x48')]=function(_0x16dc20,_0x21edeb){return db[_0x4ee1('0x2b')][_0x4ee1('0x48')](_0x16dc20[_0x4ee1('0x49')],{})[_0x4ee1('0x24')](respondWithResult(_0x21edeb,0xc9))[_0x4ee1('0x46')](handleError(_0x21edeb,null));};exports[_0x4ee1('0x23')]=function(_0x4ebb28,_0x49b667){if(_0x4ebb28[_0x4ee1('0x49')]['id']){delete _0x4ebb28[_0x4ee1('0x49')]['id'];}return db[_0x4ee1('0x2b')][_0x4ee1('0x4a')]({'where':{'id':_0x4ebb28['params']['id']}})[_0x4ee1('0x24')](handleEntityNotFound(_0x49b667,null))[_0x4ee1('0x24')](saveUpdates(_0x4ebb28[_0x4ee1('0x49')],null))[_0x4ee1('0x24')](respondWithResult(_0x49b667,null))[_0x4ee1('0x46')](handleError(_0x49b667,null));};exports['destroy']=function(_0x1c71ba,_0x4ae560){return db[_0x4ee1('0x2b')]['find']({'where':{'id':_0x1c71ba[_0x4ee1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ae560,null))[_0x4ee1('0x24')](removeEntity(_0x4ae560,null))['catch'](handleError(_0x4ae560,null));};exports[_0x4ee1('0x4c')]=function(_0x480796,_0xd19964){return db['MailSubstatus'][_0x4ee1('0x4c')]()[_0x4ee1('0x24')](respondWithResult(_0xd19964,null))[_0x4ee1('0x46')](handleError(_0xd19964,null));}; \ No newline at end of file +var _0x46ed=['sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','MailSubstatus','includeAll','create','body','find','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x477eb2,_0xc6313d){var _0x30e019=function(_0x1074da){while(--_0x1074da){_0x477eb2['push'](_0x477eb2['shift']());}};_0x30e019(++_0xc6313d);}(_0x46ed,0x168));var _0xd46e=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x46ed[_0x36ed48];return _0x51c63a;};'use strict';var pdf=require(_0xd46e('0x0'));var emlformat=require(_0xd46e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd46e('0x2'));var jsonpatch=require(_0xd46e('0x3'));var rp=require(_0xd46e('0x4'));var moment=require('moment');var BPromise=require(_0xd46e('0x5'));var Mustache=require(_0xd46e('0x6'));var util=require('util');var path=require(_0xd46e('0x7'));var sox=require(_0xd46e('0x8'));var csv=require(_0xd46e('0x9'));var ejs=require(_0xd46e('0xa'));var fs=require('fs');var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x9'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24c54b,_0x5bc1da){_0x5bc1da=_0x5bc1da||0xcc;return function(_0x48550b){if(_0x48550b){return _0x24c54b[_0xd46e('0x19')](_0x5bc1da);}return _0x24c54b[_0xd46e('0x1a')](_0x5bc1da)['end']();};}function respondWithResult(_0x5a3076,_0xacd799){_0xacd799=_0xacd799||0xc8;return function(_0x4688ae){if(_0x4688ae){return _0x5a3076[_0xd46e('0x1a')](_0xacd799)[_0xd46e('0x1b')](_0x4688ae);}};}function respondWithFilteredResult(_0x50c7c3,_0x3b6d25){return function(_0x44a620){if(_0x44a620){var _0x417402=_0x44a620[_0xd46e('0x1c')],_0x3d72ce=_0x3b6d25[_0xd46e('0x1d')],_0x36a317=_0x3b6d25[_0xd46e('0x1d')]+_0x3b6d25['limit'],_0x47fa8f;if(_0x36a317>=_0x417402){_0x36a317=_0x417402;_0x47fa8f=0xc8;}else{_0x47fa8f=0xce;}_0x50c7c3['status'](_0x47fa8f);return _0x50c7c3[_0xd46e('0x1e')](_0xd46e('0x1f'),_0x3d72ce+'-'+_0x36a317+'/'+_0x417402)['json'](_0x44a620);}return null;};}function patchUpdates(_0x4fd1f2){return function(_0x2d6f2c){try{jsonpatch[_0xd46e('0x20')](_0x2d6f2c,_0x4fd1f2,!![]);}catch(_0x362885){return BPromise[_0xd46e('0x21')](_0x362885);}return _0x2d6f2c[_0xd46e('0x22')]();};}function saveUpdates(_0x312d6f,_0x3b5fa4){return function(_0x327b7e){if(_0x327b7e){return _0x327b7e[_0xd46e('0x23')](_0x312d6f)[_0xd46e('0x24')](function(_0x468aba){return _0x468aba;});}return null;};}function removeEntity(_0x5ba94d,_0x259072){return function(_0x1c83fa){if(_0x1c83fa){return _0x1c83fa[_0xd46e('0x25')]()[_0xd46e('0x24')](function(){_0x5ba94d[_0xd46e('0x1a')](0xcc)[_0xd46e('0x26')]();});}};}function handleEntityNotFound(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(!_0x62dea5){_0x33c2e0['sendStatus'](0x194);}return _0x62dea5;};}function handleError(_0x314570,_0x5424e5){_0x5424e5=_0x5424e5||0x1f4;return function(_0x4b8f6a){logger[_0xd46e('0x27')](_0x4b8f6a[_0xd46e('0x28')]);if(_0x4b8f6a[_0xd46e('0x29')]){delete _0x4b8f6a[_0xd46e('0x29')];}_0x314570[_0xd46e('0x1a')](_0x5424e5)[_0xd46e('0x2a')](_0x4b8f6a);};}exports[_0xd46e('0x2b')]=function(_0x4dab6a,_0x45d789){var _0x3c301a={},_0xddbce9={},_0x17db79={'count':0x0,'rows':[]};var _0x96f15c=_[_0xd46e('0x2c')](db['MailSubstatus'][_0xd46e('0x2d')],function(_0x3a1ced){return{'name':_0x3a1ced[_0xd46e('0x2e')],'type':_0x3a1ced[_0xd46e('0x2f')][_0xd46e('0x30')]};});_0xddbce9[_0xd46e('0x31')]=_[_0xd46e('0x2c')](_0x96f15c,_0xd46e('0x29'));_0xddbce9[_0xd46e('0x32')]=_[_0xd46e('0x33')](_0x4dab6a[_0xd46e('0x32')]);_0xddbce9[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0xddbce9['model'],_0xddbce9[_0xd46e('0x32')]);_0x3c301a[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0xddbce9[_0xd46e('0x31')],qs['fields'](_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x37')]));_0x3c301a['attributes']=_0x3c301a[_0xd46e('0x36')][_0xd46e('0x38')]?_0x3c301a['attributes']:_0xddbce9[_0xd46e('0x31')];if(!_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x39')]('nolimit')){_0x3c301a['limit']=qs[_0xd46e('0x3a')](_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x3a')]);_0x3c301a[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x1d')]);}_0x3c301a[_0xd46e('0x3b')]=qs['sort'](_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x3c')]);_0x3c301a[_0xd46e('0x3d')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3e')](_0x4dab6a[_0xd46e('0x32')],_0xddbce9[_0xd46e('0x34')]));if(_0x4dab6a['query'][_0xd46e('0x3f')]){_0x3c301a[_0xd46e('0x3d')]=_['merge'](_0x3c301a[_0xd46e('0x3d')],{'$or':_[_0xd46e('0x2c')](_0x96f15c,function(_0x12ccf8){if(_0x12ccf8[_0xd46e('0x2f')]!=='VIRTUAL'){var _0x3ab607={};_0x3ab607[_0x12ccf8[_0xd46e('0x29')]]={'$like':'%'+_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x3f')]+'%'};return _0x3ab607;}})});}_0x3c301a=_[_0xd46e('0x40')]({},_0x3c301a,_0x4dab6a[_0xd46e('0x41')]);var _0x220c57={'where':_0x3c301a[_0xd46e('0x3d')]};return db['MailSubstatus'][_0xd46e('0x1c')](_0x220c57)[_0xd46e('0x24')](function(_0xc83ea1){_0x17db79[_0xd46e('0x1c')]=_0xc83ea1;if(_0x4dab6a[_0xd46e('0x32')]['includeAll']){_0x3c301a[_0xd46e('0x42')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x3c301a);})['then'](function(_0x55098d){_0x17db79[_0xd46e('0x43')]=_0x55098d;return _0x17db79;})['then'](respondWithFilteredResult(_0x45d789,_0x3c301a))[_0xd46e('0x44')](handleError(_0x45d789,null));};exports[_0xd46e('0x45')]=function(_0x57f803,_0x462477){var _0x4114e6={'raw':!![],'where':{'id':_0x57f803[_0xd46e('0x46')]['id']}},_0x3bd5e9={};_0x3bd5e9[_0xd46e('0x31')]=_[_0xd46e('0x33')](db[_0xd46e('0x47')][_0xd46e('0x2d')]);_0x3bd5e9[_0xd46e('0x32')]=_[_0xd46e('0x33')](_0x57f803[_0xd46e('0x32')]);_0x3bd5e9['filters']=_['intersection'](_0x3bd5e9['model'],_0x3bd5e9[_0xd46e('0x32')]);_0x4114e6['attributes']=_[_0xd46e('0x35')](_0x3bd5e9[_0xd46e('0x31')],qs[_0xd46e('0x37')](_0x57f803[_0xd46e('0x32')][_0xd46e('0x37')]));_0x4114e6[_0xd46e('0x36')]=_0x4114e6[_0xd46e('0x36')][_0xd46e('0x38')]?_0x4114e6['attributes']:_0x3bd5e9[_0xd46e('0x31')];if(_0x57f803['query'][_0xd46e('0x48')]){_0x4114e6[_0xd46e('0x42')]=[{'all':!![]}];}_0x4114e6=_[_0xd46e('0x40')]({},_0x4114e6,_0x57f803[_0xd46e('0x41')]);return db[_0xd46e('0x47')]['find'](_0x4114e6)[_0xd46e('0x24')](handleEntityNotFound(_0x462477,null))[_0xd46e('0x24')](respondWithResult(_0x462477,null))[_0xd46e('0x44')](handleError(_0x462477,null));};exports[_0xd46e('0x49')]=function(_0x2f1278,_0x587784){return db[_0xd46e('0x47')][_0xd46e('0x49')](_0x2f1278[_0xd46e('0x4a')],{})[_0xd46e('0x24')](respondWithResult(_0x587784,0xc9))[_0xd46e('0x44')](handleError(_0x587784,null));};exports['update']=function(_0x341d9f,_0x3ea9e6){if(_0x341d9f[_0xd46e('0x4a')]['id']){delete _0x341d9f[_0xd46e('0x4a')]['id'];}return db[_0xd46e('0x47')][_0xd46e('0x4b')]({'where':{'id':_0x341d9f[_0xd46e('0x46')]['id']}})[_0xd46e('0x24')](handleEntityNotFound(_0x3ea9e6,null))['then'](saveUpdates(_0x341d9f[_0xd46e('0x4a')],null))[_0xd46e('0x24')](respondWithResult(_0x3ea9e6,null))[_0xd46e('0x44')](handleError(_0x3ea9e6,null));};exports[_0xd46e('0x25')]=function(_0x1f1941,_0x4e84c8){return db['MailSubstatus'][_0xd46e('0x4b')]({'where':{'id':_0x1f1941[_0xd46e('0x46')]['id']}})[_0xd46e('0x24')](handleEntityNotFound(_0x4e84c8,null))['then'](removeEntity(_0x4e84c8,null))['catch'](handleError(_0x4e84c8,null));};exports[_0xd46e('0x4c')]=function(_0x9d8638,_0x52354f){return db[_0xd46e('0x47')][_0xd46e('0x4c')]()[_0xd46e('0x24')](respondWithResult(_0x52354f,null))[_0xd46e('0x44')](handleError(_0x52354f,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 2de1674..393e3fe 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 _0x7292=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger'];(function(_0x562267,_0x2024f6){var _0x3f59f6=function(_0x283872){while(--_0x283872){_0x562267['push'](_0x562267['shift']());}};_0x3f59f6(++_0x2024f6);}(_0x7292,0x107));var _0x2729=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7292[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x2729('0x0'));var util=require(_0x2729('0x1'));var logger=require(_0x2729('0x2'))(_0x2729('0x3'));var moment=require(_0x2729('0x4'));var BPromise=require(_0x2729('0x5'));var rp=require(_0x2729('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2729('0x7'));var config=require(_0x2729('0x8'));var attributes=require(_0x2729('0x9'));module[_0x2729('0xa')]=function(_0x26a3dc,_0x176a7c){return _0x26a3dc[_0x2729('0xb')](_0x2729('0xc'),attributes,{'tableName':_0x2729('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a2d=['define','MailSubstatus','mail_substatuses','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports'];(function(_0x41d88c,_0xe2ec44){var _0x53d0fd=function(_0xe8977c){while(--_0xe8977c){_0x41d88c['push'](_0x41d88c['shift']());}};_0x53d0fd(++_0xe2ec44);}(_0x9a2d,0x123));var _0xd9a2=function(_0x5e52c4,_0x2bdb6a){_0x5e52c4=_0x5e52c4-0x0;var _0x94d87b=_0x9a2d[_0x5e52c4];return _0x94d87b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd9a2('0x0'))('api');var moment=require(_0xd9a2('0x1'));var BPromise=require(_0xd9a2('0x2'));var rp=require(_0xd9a2('0x3'));var fs=require('fs');var path=require(_0xd9a2('0x4'));var rimraf=require(_0xd9a2('0x5'));var config=require(_0xd9a2('0x6'));var attributes=require(_0xd9a2('0x7'));module[_0xd9a2('0x8')]=function(_0x2ff138,_0x11bc70){return _0x2ff138[_0xd9a2('0x9')](_0xd9a2('0xa'),attributes,{'tableName':_0xd9a2('0xb'),'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 3c9ea46..d8dbbf1 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 _0x4ea3=['MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4ea3,0x70));var _0x34ea=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x4ea3[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});} \ No newline at end of file +var _0xb903=['http','request','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','MailSubstatus,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2e9f87,_0x2d3be7){var _0x1bce73=function(_0xe3ea29){while(--_0xe3ea29){_0x2e9f87['push'](_0x2e9f87['shift']());}};_0x1bce73(++_0x2d3be7);}(_0xb903,0x185));var _0x3b90=function(_0x5363c7,_0x430731){_0x5363c7=_0x5363c7-0x0;var _0x309063=_0xb903[_0x5363c7];return _0x309063;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index f6e3edb..a1d0bfb 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 _0xe271=['get','/describe','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x17fe34,_0x4e1984){var _0x4c863d=function(_0x242af2){while(--_0x242af2){_0x17fe34['push'](_0x17fe34['shift']());}};_0x4c863d(++_0x4e1984);}(_0xe271,0x6d));var _0x1e27=function(_0x465268,_0x4b8784){_0x465268=_0x465268-0x0;var _0x2b2058=_0xe271[_0x465268];return _0x2b2058;};'use strict';var multer=require(_0x1e27('0x0'));var util=require(_0x1e27('0x1'));var path=require(_0x1e27('0x2'));var timeout=require(_0x1e27('0x3'));var express=require(_0x1e27('0x4'));var router=express[_0x1e27('0x5')]();var auth=require(_0x1e27('0x6'));var interaction=require(_0x1e27('0x7'));var config=require(_0x1e27('0x8'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x1e27('0x9')](),controller[_0x1e27('0xa')]);router[_0x1e27('0xb')](_0x1e27('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x1e27('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1e27('0xd')]('/',auth[_0x1e27('0x9')](),controller[_0x1e27('0xe')]);router['put'](_0x1e27('0xf'),auth[_0x1e27('0x9')](),controller[_0x1e27('0x10')]);router[_0x1e27('0x11')](_0x1e27('0xf'),auth[_0x1e27('0x9')](),controller[_0x1e27('0x12')]);module[_0x1e27('0x13')]=router; \ No newline at end of file +var _0xbf32=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated','post','create','put'];(function(_0x5a9322,_0x530de5){var _0x29392c=function(_0x14afca){while(--_0x14afca){_0x5a9322['push'](_0x5a9322['shift']());}};_0x29392c(++_0x530de5);}(_0xbf32,0x191));var _0x2bf3=function(_0x24ca0f,_0x1c7535){_0x24ca0f=_0x24ca0f-0x0;var _0xb5c5b7=_0xbf32[_0x24ca0f];return _0xb5c5b7;};'use strict';var multer=require(_0x2bf3('0x0'));var util=require('util');var path=require(_0x2bf3('0x1'));var timeout=require(_0x2bf3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2bf3('0x3'));var interaction=require(_0x2bf3('0x4'));var config=require(_0x2bf3('0x5'));var controller=require('./mailTransferReport.controller');router[_0x2bf3('0x6')]('/',auth['isAuthenticated'](),controller[_0x2bf3('0x7')]);router[_0x2bf3('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x2bf3('0x8')]);router['get']('/:id',auth[_0x2bf3('0x9')](),controller['show']);router[_0x2bf3('0xa')]('/',auth[_0x2bf3('0x9')](),controller[_0x2bf3('0xb')]);router[_0x2bf3('0xc')](_0x2bf3('0xd'),auth[_0x2bf3('0x9')](),controller[_0x2bf3('0xe')]);router[_0x2bf3('0xf')](_0x2bf3('0xd'),auth[_0x2bf3('0x9')](),controller[_0x2bf3('0x10')]);module[_0x2bf3('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 ffe3a80..fabf815 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 _0x358b=['ENUM','agent','queue','NOW','moment','sequelize','exports','STRING'];(function(_0x54cc70,_0x4854e0){var _0xad9c3a=function(_0x3ff85c){while(--_0x3ff85c){_0x54cc70['push'](_0x54cc70['shift']());}};_0xad9c3a(++_0x4854e0);}(_0x358b,0xe4));var _0xb358=function(_0x70b561,_0x21df44){_0x70b561=_0x70b561-0x0;var _0x56b88f=_0x358b[_0x70b561];return _0x56b88f;};'use strict';var moment=require(_0xb358('0x0'));var Sequelize=require(_0xb358('0x1'));module[_0xb358('0x2')]={'uniqueid':{'type':Sequelize[_0xb358('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb358('0x4')]('account',_0xb358('0x5'),_0xb358('0x6')),'allowNull':![],'defaultValue':_0xb358('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xb358('0x7')]}}; \ No newline at end of file +var _0xe04f=['agent','queue','DATE','NOW','sequelize','exports'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0xe04f,0xdc));var _0xfe04=function(_0x28c939,_0x110e29){_0x28c939=_0x28c939-0x0;var _0x527fe9=_0xe04f[_0x28c939];return _0x527fe9;};'use strict';var moment=require('moment');var Sequelize=require(_0xfe04('0x0'));module[_0xfe04('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xfe04('0x2'),_0xfe04('0x3')),'allowNull':![],'defaultValue':_0xfe04('0x3')},'transferredAt':{'type':Sequelize[_0xfe04('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xfe04('0x5')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 609c2b6..9bee587 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x3182b4,_0x4eb43e){var _0x2f789f=function(_0x35d725){while(--_0x35d725){_0x3182b4['push'](_0x3182b4['shift']());}};_0x2f789f(++_0x4eb43e);}(_0x7a54,0x106));var _0x47a5=function(_0x259ef5,_0x11563c){_0x259ef5=_0x259ef5-0x0;var _0x1ed38d=_0x7a54[_0x259ef5];return _0x1ed38d;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x191029,_0x1a23fe){var _0x45d0dc=function(_0x54b8c6){while(--_0x54b8c6){_0x191029['push'](_0x191029['shift']());}};_0x45d0dc(++_0x1a23fe);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['MailTransferReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 14df512..50b266a 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 _0xf76d=['util','../../config/logger','moment','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf76d,0x96));var _0xdf76=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0xf76d[_0x7b5cdd];return _0x3a29ae;};'use strict';var _=require('lodash');var util=require(_0xdf76('0x0'));var logger=require(_0xdf76('0x1'))('api');var moment=require(_0xdf76('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf76('0x3'));var rimraf=require(_0xdf76('0x4'));var config=require(_0xdf76('0x5'));var attributes=require(_0xdf76('0x6'));module[_0xdf76('0x7')]=function(_0x594269,_0x295a6f){return _0x594269['define'](_0xdf76('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdf76('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2c84=['report_mail_transfer','uniqueid','lodash','../../config/logger','api','request-promise','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x4f19ba,_0x2e73d2){var _0x1cf423=function(_0x1d1a3c){while(--_0x1d1a3c){_0x4f19ba['push'](_0x4f19ba['shift']());}};_0x1cf423(++_0x2e73d2);}(_0x2c84,0x1ce));var _0x42c8=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2c84[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x42c8('0x0'));var util=require('util');var logger=require(_0x42c8('0x1'))(_0x42c8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x42c8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x42c8('0x4'));module[_0x42c8('0x5')]=function(_0x4fac64,_0x337656){return _0x4fac64[_0x42c8('0x6')](_0x42c8('0x7'),attributes,{'tableName':_0x42c8('0x8'),'paranoid':![],'indexes':[{'name':_0x42c8('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index adbba3c..0fdcc32 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 _0xea48=['MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MailTransferReport,\x20%s,\x20%s','debug'];(function(_0x29a823,_0x21b9fe){var _0x22afe1=function(_0x5a86da){while(--_0x5a86da){_0x29a823['push'](_0x29a823['shift']());}};_0x22afe1(++_0x21b9fe);}(_0xea48,0x1ea));var _0x8ea4=function(_0x401bc0,_0x37a6ce){_0x401bc0=_0x401bc0-0x0;var _0x5116bb=_0xea48[_0x401bc0];return _0x5116bb;};'use strict';var _=require(_0x8ea4('0x0'));var util=require(_0x8ea4('0x1'));var moment=require('moment');var BPromise=require(_0x8ea4('0x2'));var rs=require(_0x8ea4('0x3'));var fs=require('fs');var Redis=require(_0x8ea4('0x4'));var db=require(_0x8ea4('0x5'))['db'];var utils=require(_0x8ea4('0x6'));var logger=require(_0x8ea4('0x7'))(_0x8ea4('0x8'));var config=require(_0x8ea4('0x9'));var jayson=require(_0x8ea4('0xa'));var client=jayson[_0x8ea4('0xb')][_0x8ea4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f2303,_0x436f2f,_0x2764e4){return new BPromise(function(_0x491afb,_0x1d66ef){return client['request'](_0x2f2303,_0x2764e4)[_0x8ea4('0xd')](function(_0x2faaf9){logger['info'](_0x8ea4('0xe'),_0x436f2f,'request\x20sent');logger[_0x8ea4('0xf')](_0x8ea4('0x10'),_0x436f2f,_0x8ea4('0x11'),JSON[_0x8ea4('0x12')](_0x2faaf9));if(_0x2faaf9[_0x8ea4('0x13')]){if(_0x2faaf9[_0x8ea4('0x13')][_0x8ea4('0x14')]===0x1f4){logger[_0x8ea4('0x13')](_0x8ea4('0xe'),_0x436f2f,_0x2faaf9[_0x8ea4('0x13')]['message']);return _0x1d66ef(_0x2faaf9[_0x8ea4('0x13')]['message']);}logger[_0x8ea4('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x436f2f,_0x2faaf9[_0x8ea4('0x13')][_0x8ea4('0x15')]);return _0x491afb(_0x2faaf9[_0x8ea4('0x13')][_0x8ea4('0x15')]);}else{logger['info'](_0x8ea4('0xe'),_0x436f2f,_0x8ea4('0x11'));_0x491afb(_0x2faaf9['result']['message']);}})[_0x8ea4('0x16')](function(_0x5a4545){logger[_0x8ea4('0x13')](_0x8ea4('0xe'),_0x436f2f,_0x5a4545);_0x1d66ef(_0x5a4545);});});} \ No newline at end of file +var _0x472a=['client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x472a,0x98));var _0xa472=function(_0x2c087f,_0x22ef50){_0x2c087f=_0x2c087f-0x0;var _0xcacad0=_0x472a[_0x2c087f];return _0xcacad0;};'use strict';var _=require(_0xa472('0x0'));var util=require('util');var moment=require(_0xa472('0x1'));var BPromise=require('bluebird');var rs=require(_0xa472('0x2'));var fs=require('fs');var Redis=require(_0xa472('0x3'));var db=require(_0xa472('0x4'))['db'];var utils=require(_0xa472('0x5'));var logger=require('../../config/logger')(_0xa472('0x6'));var config=require(_0xa472('0x7'));var jayson=require(_0xa472('0x8'));var client=jayson[_0xa472('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x333b0d,_0xd362b6,_0x42a65f){return new BPromise(function(_0x2ab6a6,_0x34c820){return client[_0xa472('0xa')](_0x333b0d,_0x42a65f)[_0xa472('0xb')](function(_0x46dafa){logger[_0xa472('0xc')](_0xa472('0xd'),_0xd362b6,_0xa472('0xe'));logger[_0xa472('0xf')](_0xa472('0x10'),_0xd362b6,_0xa472('0xe'),JSON[_0xa472('0x11')](_0x46dafa));if(_0x46dafa[_0xa472('0x12')]){if(_0x46dafa[_0xa472('0x12')][_0xa472('0x13')]===0x1f4){logger[_0xa472('0x12')]('MailTransferReport,\x20%s,\x20%s',_0xd362b6,_0x46dafa[_0xa472('0x12')]['message']);return _0x34c820(_0x46dafa[_0xa472('0x12')][_0xa472('0x14')]);}logger[_0xa472('0x12')](_0xa472('0xd'),_0xd362b6,_0x46dafa[_0xa472('0x12')][_0xa472('0x14')]);return _0x2ab6a6(_0x46dafa[_0xa472('0x12')]['message']);}else{logger[_0xa472('0xc')]('MailTransferReport,\x20%s,\x20%s',_0xd362b6,_0xa472('0xe'));_0x2ab6a6(_0x46dafa[_0xa472('0x15')]['message']);}})[_0xa472('0x16')](function(_0x1463a9){logger[_0xa472('0x12')](_0xa472('0xd'),_0xd362b6,_0x1463a9);_0x34c820(_0x1463a9);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 0078893..f173d83 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 _0xb9a9=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','show','post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0xb9a9,0xf0));var _0x9b9a=function(_0x10622e,_0x50121c){_0x10622e=_0x10622e-0x0;var _0x10840=_0xb9a9[_0x10622e];return _0x10840;};'use strict';var multer=require(_0x9b9a('0x0'));var util=require(_0x9b9a('0x1'));var path=require('path');var timeout=require(_0x9b9a('0x2'));var express=require(_0x9b9a('0x3'));var router=express[_0x9b9a('0x4')]();var auth=require(_0x9b9a('0x5'));var interaction=require(_0x9b9a('0x6'));var config=require(_0x9b9a('0x7'));var controller=require(_0x9b9a('0x8'));router[_0x9b9a('0x9')]('/',auth[_0x9b9a('0xa')](),controller[_0x9b9a('0xb')]);router[_0x9b9a('0x9')]('/describe',auth[_0x9b9a('0xa')](),controller[_0x9b9a('0xc')]);router[_0x9b9a('0x9')]('/:id',auth[_0x9b9a('0xa')](),controller[_0x9b9a('0xd')]);router[_0x9b9a('0xe')]('/',auth[_0x9b9a('0xa')](),controller[_0x9b9a('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9b9a('0x10')]('/:id',auth[_0x9b9a('0xa')](),controller[_0x9b9a('0x11')]);module[_0x9b9a('0x12')]=router; \ No newline at end of file +var _0x04e6=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x5c7184,_0x2261b7){var _0x201f97=function(_0x13a4fd){while(--_0x13a4fd){_0x5c7184['push'](_0x5c7184['shift']());}};_0x201f97(++_0x2261b7);}(_0x04e6,0xa7));var _0x604e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x04e6[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x604e('0x0'));var util=require(_0x604e('0x1'));var path=require(_0x604e('0x2'));var timeout=require(_0x604e('0x3'));var express=require(_0x604e('0x4'));var router=express['Router']();var auth=require(_0x604e('0x5'));var interaction=require(_0x604e('0x6'));var config=require(_0x604e('0x7'));var controller=require(_0x604e('0x8'));router[_0x604e('0x9')]('/',auth[_0x604e('0xa')](),controller[_0x604e('0xb')]);router[_0x604e('0x9')](_0x604e('0xc'),auth[_0x604e('0xa')](),controller['describe']);router['get'](_0x604e('0xd'),auth[_0x604e('0xa')](),controller[_0x604e('0xe')]);router[_0x604e('0xf')]('/',auth[_0x604e('0xa')](),controller[_0x604e('0x10')]);router['put'](_0x604e('0xd'),auth[_0x604e('0xa')](),controller[_0x604e('0x11')]);router[_0x604e('0x12')](_0x604e('0xd'),auth['isAuthenticated'](),controller[_0x604e('0x13')]);module[_0x604e('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 91f8e26..52af8de 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 _0x3604=['getDataValue','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE'];(function(_0xf8e2fc,_0x2b3dfa){var _0x426ff8=function(_0x2b6613){while(--_0x2b6613){_0xf8e2fc['push'](_0xf8e2fc['shift']());}};_0x426ff8(++_0x2b3dfa);}(_0x3604,0x10b));var _0x4360=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3604[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x4360('0x0'));var moment=require('moment');module[_0x4360('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4360('0x2')]},'interface':{'type':Sequelize[_0x4360('0x2')]},'type':{'type':Sequelize[_0x4360('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x4360('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x4360('0x4')]},'exitAt':{'type':Sequelize[_0x4360('0x4')],'set':function(_0x24b05a){var _0x3056a4=moment(_0x24b05a);var _0x3b3bcd=moment(this[_0x4360('0x5')]('enterAt'));var _0x202bac=_0x3056a4['diff'](_0x3b3bcd,_0x4360('0x6'));this[_0x4360('0x7')](_0x4360('0x8'),_0x24b05a);this[_0x4360('0x7')](_0x4360('0x9'),_0x202bac||null);}},'data1':{'type':Sequelize[_0x4360('0x2')],'comment':_0x4360('0xa')},'data2':{'type':Sequelize[_0x4360('0x2')],'comment':_0x4360('0xb')},'data3':{'type':Sequelize[_0x4360('0x2')],'comment':_0x4360('0xc')},'data4':{'type':Sequelize[_0x4360('0x2')],'comment':_0x4360('0xd')},'data5':{'type':Sequelize[_0x4360('0x2')],'comment':_0x4360('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x4360('0xf')]},'uniqueid':{'type':Sequelize[_0x4360('0x2')]}}; \ No newline at end of file +var _0x6edf=['moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize'];(function(_0x2f0435,_0x5593be){var _0x55b14f=function(_0x2d197d){while(--_0x2d197d){_0x2f0435['push'](_0x2f0435['shift']());}};_0x55b14f(++_0x5593be);}(_0x6edf,0x12f));var _0xf6ed=function(_0x276d4d,_0x46aeb1){_0x276d4d=_0x276d4d-0x0;var _0x2b1ae6=_0x6edf[_0x276d4d];return _0x2b1ae6;};'use strict';var Sequelize=require(_0xf6ed('0x0'));var moment=require(_0xf6ed('0x1'));module[_0xf6ed('0x2')]={'channel':{'type':Sequelize[_0xf6ed('0x3')]},'membername':{'type':Sequelize[_0xf6ed('0x3')]},'interface':{'type':Sequelize[_0xf6ed('0x3')]},'type':{'type':Sequelize[_0xf6ed('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xf6ed('0x4')},'duration':{'type':Sequelize[_0xf6ed('0x5')]},'enterAt':{'type':Sequelize[_0xf6ed('0x6')]},'exitAt':{'type':Sequelize[_0xf6ed('0x6')],'set':function(_0x311c3c){var _0x3f6fc5=moment(_0x311c3c);var _0x386e9f=moment(this['getDataValue']('enterAt'));var _0x2e98ad=_0x3f6fc5[_0xf6ed('0x7')](_0x386e9f,_0xf6ed('0x8'));this['setDataValue'](_0xf6ed('0x9'),_0x311c3c);this[_0xf6ed('0xa')](_0xf6ed('0xb'),_0x2e98ad||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xf6ed('0xc')},'data2':{'type':Sequelize[_0xf6ed('0x3')],'comment':_0xf6ed('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0xf6ed('0xe')},'data4':{'type':Sequelize[_0xf6ed('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0xf6ed('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xf6ed('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 9f8618e..871c168 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 _0x7f7b=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','name','map','MemberReport','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order'];(function(_0x3824d3,_0x5005be){var _0xb91dfa=function(_0x42f7e5){while(--_0x42f7e5){_0x3824d3['push'](_0x3824d3['shift']());}};_0xb91dfa(++_0x5005be);}(_0x7f7b,0x127));var _0xb7f7=function(_0x3a8617,_0x3a0491){_0x3a8617=_0x3a8617-0x0;var _0x3907e7=_0x7f7b[_0x3a8617];return _0x3907e7;};'use strict';var pdf=require(_0xb7f7('0x0'));var emlformat=require(_0xb7f7('0x1'));var rimraf=require(_0xb7f7('0x2'));var zipdir=require(_0xb7f7('0x3'));var jsonpatch=require(_0xb7f7('0x4'));var rp=require(_0xb7f7('0x5'));var moment=require(_0xb7f7('0x6'));var BPromise=require(_0xb7f7('0x7'));var Mustache=require(_0xb7f7('0x8'));var util=require(_0xb7f7('0x9'));var path=require('path');var sox=require(_0xb7f7('0xa'));var csv=require(_0xb7f7('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb7f7('0xc'));var squel=require(_0xb7f7('0xd'));var crypto=require(_0xb7f7('0xe'));var jsforce=require(_0xb7f7('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb7f7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb7f7('0x11'));var qs=require(_0xb7f7('0x12'));var as=require(_0xb7f7('0x13'));var hardwareService=require(_0xb7f7('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb7f7('0x15'));var config=require(_0xb7f7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48d5de,_0x38a7cc){_0x38a7cc=_0x38a7cc||0xcc;return function(_0x5669f6){if(_0x5669f6){return _0x48d5de['sendStatus'](_0x38a7cc);}return _0x48d5de[_0xb7f7('0x17')](_0x38a7cc)[_0xb7f7('0x18')]();};}function respondWithResult(_0x3ce040,_0x4ed6ca){_0x4ed6ca=_0x4ed6ca||0xc8;return function(_0x16a34e){if(_0x16a34e){return _0x3ce040[_0xb7f7('0x17')](_0x4ed6ca)[_0xb7f7('0x19')](_0x16a34e);}};}function respondWithFilteredResult(_0xbb3cf5,_0x4c32c8){return function(_0x133ee7){if(_0x133ee7){var _0x1fcc2e=_0x133ee7[_0xb7f7('0x1a')],_0x3f972a=_0x4c32c8[_0xb7f7('0x1b')],_0x34bdda=_0x4c32c8['offset']+_0x4c32c8[_0xb7f7('0x1c')],_0x4ff3cb;if(_0x34bdda>=_0x1fcc2e){_0x34bdda=_0x1fcc2e;_0x4ff3cb=0xc8;}else{_0x4ff3cb=0xce;}_0xbb3cf5['status'](_0x4ff3cb);return _0xbb3cf5[_0xb7f7('0x1d')](_0xb7f7('0x1e'),_0x3f972a+'-'+_0x34bdda+'/'+_0x1fcc2e)[_0xb7f7('0x19')](_0x133ee7);}return null;};}function patchUpdates(_0x3897d9){return function(_0x1f9666){try{jsonpatch[_0xb7f7('0x1f')](_0x1f9666,_0x3897d9,!![]);}catch(_0x155792){return BPromise['reject'](_0x155792);}return _0x1f9666[_0xb7f7('0x20')]();};}function saveUpdates(_0x3a916a,_0x3d6772){return function(_0x27f1a3){if(_0x27f1a3){return _0x27f1a3['update'](_0x3a916a)[_0xb7f7('0x21')](function(_0x3cd34e){return _0x3cd34e;});}return null;};}function removeEntity(_0x10df35,_0xf2bc78){return function(_0xb61724){if(_0xb61724){return _0xb61724[_0xb7f7('0x22')]()[_0xb7f7('0x21')](function(){_0x10df35[_0xb7f7('0x17')](0xcc)[_0xb7f7('0x18')]();});}};}function handleEntityNotFound(_0x2f3221,_0x35981c){return function(_0x2e7730){if(!_0x2e7730){_0x2f3221['sendStatus'](0x194);}return _0x2e7730;};}function handleError(_0x35761f,_0x1274b6){_0x1274b6=_0x1274b6||0x1f4;return function(_0x538877){logger[_0xb7f7('0x23')](_0x538877['stack']);if(_0x538877['name']){delete _0x538877[_0xb7f7('0x24')];}_0x35761f[_0xb7f7('0x17')](_0x1274b6)['send'](_0x538877);};}exports['index']=function(_0x49f661,_0x2d94d9){var _0x35a316={},_0x206b90={},_0x1b3398={'count':0x0,'rows':[]};var _0x1dd9de=_[_0xb7f7('0x25')](db[_0xb7f7('0x26')]['rawAttributes'],function(_0x281d40){return{'name':_0x281d40[_0xb7f7('0x27')],'type':_0x281d40['type'][_0xb7f7('0x28')]};});_0x206b90['model']=_[_0xb7f7('0x25')](_0x1dd9de,_0xb7f7('0x24'));_0x206b90[_0xb7f7('0x29')]=_[_0xb7f7('0x2a')](_0x49f661['query']);_0x206b90[_0xb7f7('0x2b')]=_[_0xb7f7('0x2c')](_0x206b90[_0xb7f7('0x2d')],_0x206b90['query']);_0x35a316['attributes']=_[_0xb7f7('0x2c')](_0x206b90[_0xb7f7('0x2d')],qs[_0xb7f7('0x2e')](_0x49f661[_0xb7f7('0x29')]['fields']));_0x35a316[_0xb7f7('0x2f')]=_0x35a316[_0xb7f7('0x2f')]['length']?_0x35a316[_0xb7f7('0x2f')]:_0x206b90[_0xb7f7('0x2d')];if(!_0x49f661['query'][_0xb7f7('0x30')]('nolimit')){_0x35a316[_0xb7f7('0x1c')]=qs[_0xb7f7('0x1c')](_0x49f661[_0xb7f7('0x29')]['limit']);_0x35a316[_0xb7f7('0x1b')]=qs[_0xb7f7('0x1b')](_0x49f661[_0xb7f7('0x29')][_0xb7f7('0x1b')]);}_0x35a316[_0xb7f7('0x31')]=qs[_0xb7f7('0x32')](_0x49f661[_0xb7f7('0x29')][_0xb7f7('0x32')]);_0x35a316[_0xb7f7('0x33')]=qs['filters'](_[_0xb7f7('0x34')](_0x49f661[_0xb7f7('0x29')],_0x206b90['filters']));if(_0x49f661[_0xb7f7('0x29')][_0xb7f7('0x35')]){_0x35a316['where']=_[_0xb7f7('0x36')](_0x35a316[_0xb7f7('0x33')],{'$or':_[_0xb7f7('0x25')](_0x1dd9de,function(_0x8285a){if(_0x8285a['type']!==_0xb7f7('0x37')){var _0x16012e={};_0x16012e[_0x8285a[_0xb7f7('0x24')]]={'$like':'%'+_0x49f661[_0xb7f7('0x29')][_0xb7f7('0x35')]+'%'};return _0x16012e;}})});}_0x35a316=_[_0xb7f7('0x36')]({},_0x35a316,_0x49f661[_0xb7f7('0x38')]);var _0x58978f={'where':_0x35a316['where']};return db[_0xb7f7('0x26')][_0xb7f7('0x1a')](_0x58978f)[_0xb7f7('0x21')](function(_0x5dded8){_0x1b3398['count']=_0x5dded8;if(_0x49f661[_0xb7f7('0x29')][_0xb7f7('0x39')]){_0x35a316[_0xb7f7('0x3a')]=[{'all':!![]}];}return db[_0xb7f7('0x26')][_0xb7f7('0x3b')](_0x35a316);})[_0xb7f7('0x21')](function(_0x4dd60f){_0x1b3398[_0xb7f7('0x3c')]=_0x4dd60f;return _0x1b3398;})[_0xb7f7('0x21')](respondWithFilteredResult(_0x2d94d9,_0x35a316))[_0xb7f7('0x3d')](handleError(_0x2d94d9,null));};exports[_0xb7f7('0x3e')]=function(_0x423c2a,_0x2d992b){var _0x3a7bdf={'raw':!![],'where':{'id':_0x423c2a[_0xb7f7('0x3f')]['id']}},_0x32e50d={};_0x32e50d['model']=_[_0xb7f7('0x2a')](db['MemberReport']['rawAttributes']);_0x32e50d[_0xb7f7('0x29')]=_[_0xb7f7('0x2a')](_0x423c2a[_0xb7f7('0x29')]);_0x32e50d[_0xb7f7('0x2b')]=_[_0xb7f7('0x2c')](_0x32e50d[_0xb7f7('0x2d')],_0x32e50d['query']);_0x3a7bdf[_0xb7f7('0x2f')]=_['intersection'](_0x32e50d[_0xb7f7('0x2d')],qs[_0xb7f7('0x2e')](_0x423c2a[_0xb7f7('0x29')][_0xb7f7('0x2e')]));_0x3a7bdf[_0xb7f7('0x2f')]=_0x3a7bdf['attributes'][_0xb7f7('0x40')]?_0x3a7bdf[_0xb7f7('0x2f')]:_0x32e50d[_0xb7f7('0x2d')];if(_0x423c2a[_0xb7f7('0x29')][_0xb7f7('0x39')]){_0x3a7bdf['include']=[{'all':!![]}];}_0x3a7bdf=_['merge']({},_0x3a7bdf,_0x423c2a[_0xb7f7('0x38')]);return db[_0xb7f7('0x26')]['find'](_0x3a7bdf)[_0xb7f7('0x21')](handleEntityNotFound(_0x2d992b,null))[_0xb7f7('0x21')](respondWithResult(_0x2d992b,null))[_0xb7f7('0x3d')](handleError(_0x2d992b,null));};exports[_0xb7f7('0x41')]=function(_0x55a4fc,_0xc72c03){return db['MemberReport'][_0xb7f7('0x41')](_0x55a4fc['body'],{})[_0xb7f7('0x21')](respondWithResult(_0xc72c03,0xc9))[_0xb7f7('0x3d')](handleError(_0xc72c03,null));};exports[_0xb7f7('0x42')]=function(_0x22d040,_0x1042ba){if(_0x22d040[_0xb7f7('0x43')]['id']){delete _0x22d040['body']['id'];}return db[_0xb7f7('0x26')]['find']({'where':{'id':_0x22d040[_0xb7f7('0x3f')]['id']}})[_0xb7f7('0x21')](handleEntityNotFound(_0x1042ba,null))[_0xb7f7('0x21')](saveUpdates(_0x22d040['body'],null))[_0xb7f7('0x21')](respondWithResult(_0x1042ba,null))[_0xb7f7('0x3d')](handleError(_0x1042ba,null));};exports['destroy']=function(_0x2e8cdb,_0x1e794c){return db[_0xb7f7('0x26')]['find']({'where':{'id':_0x2e8cdb[_0xb7f7('0x3f')]['id']}})[_0xb7f7('0x21')](handleEntityNotFound(_0x1e794c,null))[_0xb7f7('0x21')](removeEntity(_0x1e794c,null))[_0xb7f7('0x3d')](handleError(_0x1e794c,null));};exports[_0xb7f7('0x44')]=function(_0x15794b,_0x503384){return db['MemberReport']['describe']()[_0xb7f7('0x21')](respondWithResult(_0x503384,null))[_0xb7f7('0x3d')](handleError(_0x503384,null));}; \ No newline at end of file +var _0xb31f=['rimraf','request-promise','bluebird','mustache','path','sox','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','count','include','rows','catch','params','length','includeAll','options','find','create','body','destroy','describe','html-pdf'];(function(_0x3cc8ca,_0x2eea84){var _0xabbd56=function(_0x47fdcd){while(--_0x47fdcd){_0x3cc8ca['push'](_0x3cc8ca['shift']());}};_0xabbd56(++_0x2eea84);}(_0xb31f,0x10b));var _0xfb31=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0xb31f[_0x4e5552];return _0x60a338;};'use strict';var pdf=require(_0xfb31('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfb31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfb31('0x2'));var moment=require('moment');var BPromise=require(_0xfb31('0x3'));var Mustache=require(_0xfb31('0x4'));var util=require('util');var path=require(_0xfb31('0x5'));var sox=require(_0xfb31('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfb31('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xfb31('0x8'));var toCsv=require(_0xfb31('0x9'));var querystring=require(_0xfb31('0xa'));var Papa=require(_0xfb31('0xb'));var Redis=require(_0xfb31('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xfb31('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb31('0xe'));var logger=require(_0xfb31('0xf'))('api');var utils=require(_0xfb31('0x10'));var config=require(_0xfb31('0x11'));var db=require(_0xfb31('0x12'))['db'];function respondWithStatusCode(_0x3b666a,_0x181948){_0x181948=_0x181948||0xcc;return function(_0x121634){if(_0x121634){return _0x3b666a[_0xfb31('0x13')](_0x181948);}return _0x3b666a[_0xfb31('0x14')](_0x181948)['end']();};}function respondWithResult(_0x2960df,_0x21f5ec){_0x21f5ec=_0x21f5ec||0xc8;return function(_0x1d7752){if(_0x1d7752){return _0x2960df[_0xfb31('0x14')](_0x21f5ec)[_0xfb31('0x15')](_0x1d7752);}};}function respondWithFilteredResult(_0x531917,_0x2537e5){return function(_0x1a37bd){if(_0x1a37bd){var _0x55ae5d=_0x1a37bd['count'],_0x33fdd9=_0x2537e5[_0xfb31('0x16')],_0x7f4eec=_0x2537e5['offset']+_0x2537e5[_0xfb31('0x17')],_0x5ee536;if(_0x7f4eec>=_0x55ae5d){_0x7f4eec=_0x55ae5d;_0x5ee536=0xc8;}else{_0x5ee536=0xce;}_0x531917[_0xfb31('0x14')](_0x5ee536);return _0x531917[_0xfb31('0x18')](_0xfb31('0x19'),_0x33fdd9+'-'+_0x7f4eec+'/'+_0x55ae5d)['json'](_0x1a37bd);}return null;};}function patchUpdates(_0x5683eb){return function(_0x4441bb){try{jsonpatch['apply'](_0x4441bb,_0x5683eb,!![]);}catch(_0x2dd625){return BPromise[_0xfb31('0x1a')](_0x2dd625);}return _0x4441bb[_0xfb31('0x1b')]();};}function saveUpdates(_0x42ed65,_0xdc1f42){return function(_0x204187){if(_0x204187){return _0x204187[_0xfb31('0x1c')](_0x42ed65)[_0xfb31('0x1d')](function(_0x52db61){return _0x52db61;});}return null;};}function removeEntity(_0x47888b,_0x3555c6){return function(_0x4c3110){if(_0x4c3110){return _0x4c3110['destroy']()['then'](function(){_0x47888b[_0xfb31('0x14')](0xcc)[_0xfb31('0x1e')]();});}};}function handleEntityNotFound(_0x190777,_0x4e2e0a){return function(_0x7a7ee3){if(!_0x7a7ee3){_0x190777[_0xfb31('0x13')](0x194);}return _0x7a7ee3;};}function handleError(_0x55963a,_0x4714d9){_0x4714d9=_0x4714d9||0x1f4;return function(_0x56bf56){logger[_0xfb31('0x1f')](_0x56bf56[_0xfb31('0x20')]);if(_0x56bf56[_0xfb31('0x21')]){delete _0x56bf56[_0xfb31('0x21')];}_0x55963a[_0xfb31('0x14')](_0x4714d9)[_0xfb31('0x22')](_0x56bf56);};}exports[_0xfb31('0x23')]=function(_0x52f9df,_0x1cb0d2){var _0x3f134b={},_0x514c6f={},_0xb43367={'count':0x0,'rows':[]};var _0x405297=_[_0xfb31('0x24')](db[_0xfb31('0x25')]['rawAttributes'],function(_0x3af276){return{'name':_0x3af276['fieldName'],'type':_0x3af276[_0xfb31('0x26')][_0xfb31('0x27')]};});_0x514c6f[_0xfb31('0x28')]=_[_0xfb31('0x24')](_0x405297,'name');_0x514c6f[_0xfb31('0x29')]=_[_0xfb31('0x2a')](_0x52f9df[_0xfb31('0x29')]);_0x514c6f[_0xfb31('0x2b')]=_['intersection'](_0x514c6f[_0xfb31('0x28')],_0x514c6f[_0xfb31('0x29')]);_0x3f134b[_0xfb31('0x2c')]=_[_0xfb31('0x2d')](_0x514c6f['model'],qs['fields'](_0x52f9df[_0xfb31('0x29')][_0xfb31('0x2e')]));_0x3f134b[_0xfb31('0x2c')]=_0x3f134b['attributes']['length']?_0x3f134b[_0xfb31('0x2c')]:_0x514c6f['model'];if(!_0x52f9df[_0xfb31('0x29')][_0xfb31('0x2f')](_0xfb31('0x30'))){_0x3f134b[_0xfb31('0x17')]=qs[_0xfb31('0x17')](_0x52f9df['query'][_0xfb31('0x17')]);_0x3f134b[_0xfb31('0x16')]=qs[_0xfb31('0x16')](_0x52f9df[_0xfb31('0x29')][_0xfb31('0x16')]);}_0x3f134b[_0xfb31('0x31')]=qs['sort'](_0x52f9df[_0xfb31('0x29')][_0xfb31('0x32')]);_0x3f134b[_0xfb31('0x33')]=qs['filters'](_[_0xfb31('0x34')](_0x52f9df[_0xfb31('0x29')],_0x514c6f[_0xfb31('0x2b')]));if(_0x52f9df[_0xfb31('0x29')]['filter']){_0x3f134b[_0xfb31('0x33')]=_[_0xfb31('0x35')](_0x3f134b['where'],{'$or':_[_0xfb31('0x24')](_0x405297,function(_0x20677e){if(_0x20677e[_0xfb31('0x26')]!=='VIRTUAL'){var _0x47f452={};_0x47f452[_0x20677e[_0xfb31('0x21')]]={'$like':'%'+_0x52f9df['query']['filter']+'%'};return _0x47f452;}})});}_0x3f134b=_[_0xfb31('0x35')]({},_0x3f134b,_0x52f9df['options']);var _0x3667c7={'where':_0x3f134b[_0xfb31('0x33')]};return db[_0xfb31('0x25')][_0xfb31('0x36')](_0x3667c7)[_0xfb31('0x1d')](function(_0x310cd4){_0xb43367[_0xfb31('0x36')]=_0x310cd4;if(_0x52f9df[_0xfb31('0x29')]['includeAll']){_0x3f134b[_0xfb31('0x37')]=[{'all':!![]}];}return db[_0xfb31('0x25')]['findAll'](_0x3f134b);})['then'](function(_0x104be9){_0xb43367[_0xfb31('0x38')]=_0x104be9;return _0xb43367;})[_0xfb31('0x1d')](respondWithFilteredResult(_0x1cb0d2,_0x3f134b))[_0xfb31('0x39')](handleError(_0x1cb0d2,null));};exports['show']=function(_0x196c42,_0x219b97){var _0x17bca1={'raw':!![],'where':{'id':_0x196c42[_0xfb31('0x3a')]['id']}},_0x2aa700={};_0x2aa700[_0xfb31('0x28')]=_[_0xfb31('0x2a')](db[_0xfb31('0x25')]['rawAttributes']);_0x2aa700[_0xfb31('0x29')]=_[_0xfb31('0x2a')](_0x196c42[_0xfb31('0x29')]);_0x2aa700[_0xfb31('0x2b')]=_[_0xfb31('0x2d')](_0x2aa700[_0xfb31('0x28')],_0x2aa700[_0xfb31('0x29')]);_0x17bca1['attributes']=_[_0xfb31('0x2d')](_0x2aa700['model'],qs[_0xfb31('0x2e')](_0x196c42[_0xfb31('0x29')][_0xfb31('0x2e')]));_0x17bca1[_0xfb31('0x2c')]=_0x17bca1[_0xfb31('0x2c')][_0xfb31('0x3b')]?_0x17bca1[_0xfb31('0x2c')]:_0x2aa700[_0xfb31('0x28')];if(_0x196c42[_0xfb31('0x29')][_0xfb31('0x3c')]){_0x17bca1[_0xfb31('0x37')]=[{'all':!![]}];}_0x17bca1=_[_0xfb31('0x35')]({},_0x17bca1,_0x196c42[_0xfb31('0x3d')]);return db[_0xfb31('0x25')][_0xfb31('0x3e')](_0x17bca1)[_0xfb31('0x1d')](handleEntityNotFound(_0x219b97,null))[_0xfb31('0x1d')](respondWithResult(_0x219b97,null))[_0xfb31('0x39')](handleError(_0x219b97,null));};exports[_0xfb31('0x3f')]=function(_0xf8dd22,_0x4310e2){return db[_0xfb31('0x25')][_0xfb31('0x3f')](_0xf8dd22[_0xfb31('0x40')],{})[_0xfb31('0x1d')](respondWithResult(_0x4310e2,0xc9))[_0xfb31('0x39')](handleError(_0x4310e2,null));};exports[_0xfb31('0x1c')]=function(_0x59b5a6,_0x3be149){if(_0x59b5a6[_0xfb31('0x40')]['id']){delete _0x59b5a6['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x59b5a6[_0xfb31('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3be149,null))['then'](saveUpdates(_0x59b5a6[_0xfb31('0x40')],null))[_0xfb31('0x1d')](respondWithResult(_0x3be149,null))[_0xfb31('0x39')](handleError(_0x3be149,null));};exports[_0xfb31('0x41')]=function(_0x207015,_0x131a70){return db[_0xfb31('0x25')]['find']({'where':{'id':_0x207015[_0xfb31('0x3a')]['id']}})['then'](handleEntityNotFound(_0x131a70,null))[_0xfb31('0x1d')](removeEntity(_0x131a70,null))[_0xfb31('0x39')](handleError(_0x131a70,null));};exports[_0xfb31('0x42')]=function(_0xb09d6a,_0x1ffd22){return db[_0xfb31('0x25')][_0xfb31('0x42')]()['then'](respondWithResult(_0x1ffd22,null))[_0xfb31('0x39')](handleError(_0x1ffd22,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 99aee2d..f15541e 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 _0x6090=['bluebird','request-promise','path','rimraf','exports','MemberReport','report_member','interface','lodash','util','../../config/logger','api','moment'];(function(_0x5732d6,_0x2c9500){var _0x3a1a0f=function(_0x5ae05e){while(--_0x5ae05e){_0x5732d6['push'](_0x5732d6['shift']());}};_0x3a1a0f(++_0x2c9500);}(_0x6090,0x1cf));var _0x0609=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6090[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0609('0x0'));var util=require(_0x0609('0x1'));var logger=require(_0x0609('0x2'))(_0x0609('0x3'));var moment=require(_0x0609('0x4'));var BPromise=require(_0x0609('0x5'));var rp=require(_0x0609('0x6'));var fs=require('fs');var path=require(_0x0609('0x7'));var rimraf=require(_0x0609('0x8'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x0609('0x9')]=function(_0x3cf870,_0x26ed79){return _0x3cf870['define'](_0x0609('0xa'),attributes,{'tableName':_0x0609('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x0609('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdfe5=['exports','define','MemberReport','report_member','membername_interface','interface','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x532d86,_0x2067ff){var _0x152b27=function(_0xa9c796){while(--_0xa9c796){_0x532d86['push'](_0x532d86['shift']());}};_0x152b27(++_0x2067ff);}(_0xdfe5,0x76));var _0x5dfe=function(_0x1b091f,_0x1ffb0e){_0x1b091f=_0x1b091f-0x0;var _0xa8de26=_0xdfe5[_0x1b091f];return _0xa8de26;};'use strict';var _=require(_0x5dfe('0x0'));var util=require(_0x5dfe('0x1'));var logger=require(_0x5dfe('0x2'))(_0x5dfe('0x3'));var moment=require(_0x5dfe('0x4'));var BPromise=require('bluebird');var rp=require(_0x5dfe('0x5'));var fs=require('fs');var path=require(_0x5dfe('0x6'));var rimraf=require(_0x5dfe('0x7'));var config=require(_0x5dfe('0x8'));var attributes=require(_0x5dfe('0x9'));module[_0x5dfe('0xa')]=function(_0x22b1e4,_0x9a4571){return _0x22b1e4[_0x5dfe('0xb')](_0x5dfe('0xc'),attributes,{'tableName':_0x5dfe('0xd'),'paranoid':![],'indexes':[{'name':_0x5dfe('0xe'),'fields':['membername',_0x5dfe('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 8ed30bf..08ba4d7 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 _0xc81e=['options','raw','where','limit','map','include','model','attributes','GetMemberReport','stringify','catch','CreateMemberReport','create','UpdateMemberReport','body','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message','MemberReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc81e,0x12f));var _0xec81=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0xc81e[_0x7abd7];return _0x3a2577;};'use strict';var _=require(_0xec81('0x0'));var util=require(_0xec81('0x1'));var moment=require(_0xec81('0x2'));var BPromise=require(_0xec81('0x3'));var rs=require(_0xec81('0x4'));var fs=require('fs');var Redis=require(_0xec81('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xec81('0x6'));var logger=require(_0xec81('0x7'))(_0xec81('0x8'));var config=require(_0xec81('0x9'));var jayson=require(_0xec81('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48dfb1,_0x15914c,_0x4ecb41){return new BPromise(function(_0xe825d0,_0x4463b8){return client[_0xec81('0xb')](_0x48dfb1,_0x4ecb41)[_0xec81('0xc')](function(_0x1713c5){logger[_0xec81('0xd')](_0xec81('0xe'),_0x15914c,_0xec81('0xf'));logger[_0xec81('0x10')](_0xec81('0x11'),_0x15914c,_0xec81('0xf'),JSON['stringify'](_0x1713c5));if(_0x1713c5[_0xec81('0x12')]){if(_0x1713c5['error']['code']===0x1f4){logger[_0xec81('0x12')](_0xec81('0xe'),_0x15914c,_0x1713c5[_0xec81('0x12')][_0xec81('0x13')]);return _0x4463b8(_0x1713c5[_0xec81('0x12')][_0xec81('0x13')]);}logger[_0xec81('0x12')](_0xec81('0xe'),_0x15914c,_0x1713c5[_0xec81('0x12')]['message']);return _0xe825d0(_0x1713c5['error']['message']);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x15914c,_0xec81('0xf'));_0xe825d0(_0x1713c5['result'][_0xec81('0x13')]);}})['catch'](function(_0x230be1){logger[_0xec81('0x12')](_0xec81('0xe'),_0x15914c,_0x230be1);_0x4463b8(_0x230be1);});});}exports['GetMemberReport']=function(_0x53fcfc){var _0x264cf8=this;return new Promise(function(_0x2812f3,_0x2f5c84){return db[_0xec81('0x14')]['findAll']({'raw':_0x53fcfc[_0xec81('0x15')]?_0x53fcfc[_0xec81('0x15')][_0xec81('0x16')]===undefined?!![]:![]:!![],'where':_0x53fcfc[_0xec81('0x15')]?_0x53fcfc[_0xec81('0x15')][_0xec81('0x17')]||null:null,'attributes':_0x53fcfc[_0xec81('0x15')]?_0x53fcfc[_0xec81('0x15')]['attributes']||null:null,'limit':_0x53fcfc[_0xec81('0x15')]?_0x53fcfc[_0xec81('0x15')][_0xec81('0x18')]||null:null,'include':_0x53fcfc['options']?_0x53fcfc[_0xec81('0x15')]['include']?_[_0xec81('0x19')](_0x53fcfc['options'][_0xec81('0x1a')],function(_0x461552){return{'model':db[_0x461552[_0xec81('0x1b')]],'as':_0x461552['as'],'attributes':_0x461552['attributes'],'include':_0x461552[_0xec81('0x1a')]?_[_0xec81('0x19')](_0x461552[_0xec81('0x1a')],function(_0x1c3e1f){return{'model':db[_0x1c3e1f[_0xec81('0x1b')]],'as':_0x1c3e1f['as'],'attributes':_0x1c3e1f[_0xec81('0x1c')],'include':_0x1c3e1f[_0xec81('0x1a')]?_[_0xec81('0x19')](_0x1c3e1f[_0xec81('0x1a')],function(_0x3541f5){return{'model':db[_0x3541f5[_0xec81('0x1b')]],'as':_0x3541f5['as'],'attributes':_0x3541f5['attributes']};}):[]};}):[]};}):[]:[]})[_0xec81('0xc')](function(_0x5b8d63){logger['info'](_0xec81('0x1d'),_0x53fcfc);logger[_0xec81('0x10')](_0xec81('0x1d'),_0x53fcfc,JSON[_0xec81('0x1e')](_0x5b8d63));_0x2812f3(_0x5b8d63);})[_0xec81('0x1f')](function(_0x36a43f){logger[_0xec81('0x12')](_0xec81('0x1d'),_0x36a43f[_0xec81('0x13')],_0x53fcfc);_0x2f5c84(_0x264cf8['error'](0x1f4,_0x36a43f[_0xec81('0x13')]));});});};exports[_0xec81('0x20')]=function(_0x22dc52){var _0x4e1a8e=this;return new Promise(function(_0x3705ac,_0x4a4a31){return db[_0xec81('0x14')][_0xec81('0x21')](_0x22dc52['body'],{'raw':_0x22dc52[_0xec81('0x15')]?_0x22dc52['options'][_0xec81('0x16')]===undefined?!![]:![]:!![]})[_0xec81('0xc')](function(_0xbd7e5){logger[_0xec81('0xd')]('CreateMemberReport',_0x22dc52);logger[_0xec81('0x10')]('CreateMemberReport',_0x22dc52,JSON['stringify'](_0xbd7e5));_0x3705ac(_0xbd7e5);})[_0xec81('0x1f')](function(_0x5d9140){logger[_0xec81('0x12')](_0xec81('0x20'),_0x5d9140[_0xec81('0x13')],_0x22dc52);_0x4a4a31(_0x4e1a8e[_0xec81('0x12')](0x1f4,_0x5d9140['message']));});});};exports[_0xec81('0x22')]=function(_0x4c7b40){var _0x8bc7ab=this;return new Promise(function(_0x148d97,_0x1809c1){return db[_0xec81('0x14')]['update'](_0x4c7b40[_0xec81('0x23')],{'raw':_0x4c7b40['options']?_0x4c7b40[_0xec81('0x15')][_0xec81('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c7b40[_0xec81('0x15')]?_0x4c7b40['options'][_0xec81('0x17')]||null:null,'attributes':_0x4c7b40[_0xec81('0x15')]?_0x4c7b40[_0xec81('0x15')][_0xec81('0x1c')]||null:null,'limit':_0x4c7b40[_0xec81('0x15')]?_0x4c7b40['options'][_0xec81('0x18')]||null:null})[_0xec81('0xc')](function(_0x5c27d0){logger['info'](_0xec81('0x22'),_0x4c7b40);logger[_0xec81('0x10')](_0xec81('0x22'),_0x4c7b40,JSON[_0xec81('0x1e')](_0x5c27d0));_0x148d97(_0x5c27d0);})[_0xec81('0x1f')](function(_0x23673c){logger[_0xec81('0x12')](_0xec81('0x22'),_0x23673c[_0xec81('0x13')],_0x4c7b40);_0x1809c1(_0x8bc7ab[_0xec81('0x12')](0x1f4,_0x23673c[_0xec81('0x13')]));});});}; \ No newline at end of file +var _0xa050=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','then','GetMemberReport','debug','CreateMemberReport','create','body','UpdateMemberReport'];(function(_0x56d1c4,_0x4fc717){var _0x55bf55=function(_0x5d5de6){while(--_0x5d5de6){_0x56d1c4['push'](_0x56d1c4['shift']());}};_0x55bf55(++_0x4fc717);}(_0xa050,0x148));var _0x0a05=function(_0x3cc914,_0x41fa00){_0x3cc914=_0x3cc914-0x0;var _0xd99ae0=_0xa050[_0x3cc914];return _0xd99ae0;};'use strict';var _=require(_0x0a05('0x0'));var util=require(_0x0a05('0x1'));var moment=require(_0x0a05('0x2'));var BPromise=require(_0x0a05('0x3'));var rs=require(_0x0a05('0x4'));var fs=require('fs');var Redis=require(_0x0a05('0x5'));var db=require(_0x0a05('0x6'))['db'];var utils=require(_0x0a05('0x7'));var logger=require(_0x0a05('0x8'))(_0x0a05('0x9'));var config=require(_0x0a05('0xa'));var jayson=require(_0x0a05('0xb'));var client=jayson[_0x0a05('0xc')][_0x0a05('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1373c0,_0x4b7694,_0x283e54){return new BPromise(function(_0x40d6d4,_0x1f41d0){return client[_0x0a05('0xe')](_0x1373c0,_0x283e54)['then'](function(_0x1c1218){logger['info'](_0x0a05('0xf'),_0x4b7694,'request\x20sent');logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x4b7694,_0x0a05('0x10'),JSON[_0x0a05('0x11')](_0x1c1218));if(_0x1c1218[_0x0a05('0x12')]){if(_0x1c1218[_0x0a05('0x12')][_0x0a05('0x13')]===0x1f4){logger[_0x0a05('0x12')](_0x0a05('0xf'),_0x4b7694,_0x1c1218[_0x0a05('0x12')][_0x0a05('0x14')]);return _0x1f41d0(_0x1c1218[_0x0a05('0x12')]['message']);}logger[_0x0a05('0x12')](_0x0a05('0xf'),_0x4b7694,_0x1c1218[_0x0a05('0x12')]['message']);return _0x40d6d4(_0x1c1218[_0x0a05('0x12')][_0x0a05('0x14')]);}else{logger[_0x0a05('0x15')](_0x0a05('0xf'),_0x4b7694,_0x0a05('0x10'));_0x40d6d4(_0x1c1218[_0x0a05('0x16')][_0x0a05('0x14')]);}})[_0x0a05('0x17')](function(_0x2ff30d){logger[_0x0a05('0x12')](_0x0a05('0xf'),_0x4b7694,_0x2ff30d);_0x1f41d0(_0x2ff30d);});});}exports['GetMemberReport']=function(_0x3bf489){var _0x36f796=this;return new Promise(function(_0x35283d,_0x36ef7f){return db[_0x0a05('0x18')][_0x0a05('0x19')]({'raw':_0x3bf489['options']?_0x3bf489[_0x0a05('0x1a')][_0x0a05('0x1b')]===undefined?!![]:![]:!![],'where':_0x3bf489[_0x0a05('0x1a')]?_0x3bf489['options'][_0x0a05('0x1c')]||null:null,'attributes':_0x3bf489[_0x0a05('0x1a')]?_0x3bf489[_0x0a05('0x1a')]['attributes']||null:null,'limit':_0x3bf489[_0x0a05('0x1a')]?_0x3bf489['options'][_0x0a05('0x1d')]||null:null,'include':_0x3bf489[_0x0a05('0x1a')]?_0x3bf489[_0x0a05('0x1a')][_0x0a05('0x1e')]?_[_0x0a05('0x1f')](_0x3bf489[_0x0a05('0x1a')]['include'],function(_0x54c73e){return{'model':db[_0x54c73e[_0x0a05('0x20')]],'as':_0x54c73e['as'],'attributes':_0x54c73e[_0x0a05('0x21')],'include':_0x54c73e[_0x0a05('0x1e')]?_[_0x0a05('0x1f')](_0x54c73e[_0x0a05('0x1e')],function(_0x89952f){return{'model':db[_0x89952f[_0x0a05('0x20')]],'as':_0x89952f['as'],'attributes':_0x89952f[_0x0a05('0x21')],'include':_0x89952f[_0x0a05('0x1e')]?_[_0x0a05('0x1f')](_0x89952f[_0x0a05('0x1e')],function(_0x586e99){return{'model':db[_0x586e99['model']],'as':_0x586e99['as'],'attributes':_0x586e99[_0x0a05('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0a05('0x22')](function(_0x254089){logger[_0x0a05('0x15')](_0x0a05('0x23'),_0x3bf489);logger[_0x0a05('0x24')](_0x0a05('0x23'),_0x3bf489,JSON[_0x0a05('0x11')](_0x254089));_0x35283d(_0x254089);})['catch'](function(_0x121b94){logger[_0x0a05('0x12')](_0x0a05('0x23'),_0x121b94[_0x0a05('0x14')],_0x3bf489);_0x36ef7f(_0x36f796[_0x0a05('0x12')](0x1f4,_0x121b94[_0x0a05('0x14')]));});});};exports[_0x0a05('0x25')]=function(_0x45208b){var _0x45b377=this;return new Promise(function(_0xdd9431,_0x37596a){return db['MemberReport'][_0x0a05('0x26')](_0x45208b[_0x0a05('0x27')],{'raw':_0x45208b[_0x0a05('0x1a')]?_0x45208b[_0x0a05('0x1a')][_0x0a05('0x1b')]===undefined?!![]:![]:!![]})[_0x0a05('0x22')](function(_0x4eaabe){logger[_0x0a05('0x15')](_0x0a05('0x25'),_0x45208b);logger[_0x0a05('0x24')]('CreateMemberReport',_0x45208b,JSON[_0x0a05('0x11')](_0x4eaabe));_0xdd9431(_0x4eaabe);})[_0x0a05('0x17')](function(_0x16cd05){logger['error']('CreateMemberReport',_0x16cd05[_0x0a05('0x14')],_0x45208b);_0x37596a(_0x45b377[_0x0a05('0x12')](0x1f4,_0x16cd05[_0x0a05('0x14')]));});});};exports[_0x0a05('0x28')]=function(_0x2e99be){var _0x206ecc=this;return new Promise(function(_0x3951cd,_0x38d86a){return db['MemberReport']['update'](_0x2e99be[_0x0a05('0x27')],{'raw':_0x2e99be[_0x0a05('0x1a')]?_0x2e99be[_0x0a05('0x1a')][_0x0a05('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e99be['options']?_0x2e99be['options']['where']||null:null,'attributes':_0x2e99be[_0x0a05('0x1a')]?_0x2e99be[_0x0a05('0x1a')][_0x0a05('0x21')]||null:null,'limit':_0x2e99be['options']?_0x2e99be['options'][_0x0a05('0x1d')]||null:null})[_0x0a05('0x22')](function(_0x100f42){logger[_0x0a05('0x15')](_0x0a05('0x28'),_0x2e99be);logger[_0x0a05('0x24')](_0x0a05('0x28'),_0x2e99be,JSON[_0x0a05('0x11')](_0x100f42));_0x3951cd(_0x100f42);})['catch'](function(_0x163b3d){logger['error'](_0x0a05('0x28'),_0x163b3d['message'],_0x2e99be);_0x38d86a(_0x206ecc[_0x0a05('0x12')](0x1f4,_0x163b3d[_0x0a05('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 415d40e..a44c4cb 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 _0x7334=['path','Router','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0x196bfe,_0x197d27){var _0x46e617=function(_0x9d88f1){while(--_0x9d88f1){_0x196bfe['push'](_0x196bfe['shift']());}};_0x46e617(++_0x197d27);}(_0x7334,0x184));var _0x4733=function(_0x1a53a1,_0x409e3d){_0x1a53a1=_0x1a53a1-0x0;var _0x50481a=_0x7334[_0x1a53a1];return _0x50481a;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4733('0x4'));var config=require(_0x4733('0x5'));var controller=require(_0x4733('0x6'));router[_0x4733('0x7')]('/',controller[_0x4733('0x8')]);module[_0x4733('0x9')]=router; \ No newline at end of file +var _0x3de3=['../../config/environment','get','index','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1d035f,_0x2bdc7c){var _0xadd6b7=function(_0x102faa){while(--_0x102faa){_0x1d035f['push'](_0x1d035f['shift']());}};_0xadd6b7(++_0x2bdc7c);}(_0x3de3,0x1ce));var _0x33de=function(_0x1aaa1b,_0x5c8351){_0x1aaa1b=_0x1aaa1b-0x0;var _0x2d91cc=_0x3de3[_0x1aaa1b];return _0x2d91cc;};'use strict';var multer=require(_0x33de('0x0'));var util=require('util');var path=require(_0x33de('0x1'));var timeout=require(_0x33de('0x2'));var express=require('express');var router=express[_0x33de('0x3')]();var auth=require(_0x33de('0x4'));var interaction=require(_0x33de('0x5'));var config=require(_0x33de('0x6'));var controller=require('./migration.controller');router[_0x33de('0x7')]('/',controller[_0x33de('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index a76e9e4..a668aba 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 _0x6673=['sequelize','STRING','version'];(function(_0x3df574,_0x59e7ff){var _0xb45f47=function(_0x7d4723){while(--_0x7d4723){_0x3df574['push'](_0x3df574['shift']());}};_0xb45f47(++_0x59e7ff);}(_0x6673,0x153));var _0x3667=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x6673[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0x3667('0x0'));module['exports']={'version':{'type':Sequelize[_0x3667('0x1')],'unique':_0x3667('0x2')}}; \ No newline at end of file +var _0x9e67=['sequelize','exports','version'];(function(_0x1bf490,_0x40484b){var _0x315e45=function(_0x5abcd9){while(--_0x5abcd9){_0x1bf490['push'](_0x1bf490['shift']());}};_0x315e45(++_0x40484b);}(_0x9e67,0x168));var _0x79e6=function(_0x38ad61,_0x27d904){_0x38ad61=_0x38ad61-0x0;var _0x32efff=_0x9e67[_0x38ad61];return _0x32efff;};'use strict';var Sequelize=require(_0x79e6('0x0'));module[_0x79e6('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x79e6('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index d51c0e5..195e011 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 _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x2db635,_0x30b8dd){var _0x484376=function(_0x32ad05){while(--_0x32ad05){_0x2db635['push'](_0x2db635['shift']());}};_0x484376(++_0x30b8dd);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4aed6b,_0x54b865){_0x4aed6b=_0x4aed6b-0x0;var _0x175d7b=_0x5f2f[_0x4aed6b];return _0x175d7b;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file +var _0x7a54=['filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1d3e8f,_0x4f58c3){var _0x527a2a=function(_0x20b057){while(--_0x20b057){_0x1d3e8f['push'](_0x1d3e8f['shift']());}};_0x527a2a(++_0x4f58c3);}(_0x7a54,0x106));var _0x47a5=function(_0x362209,_0x27ee6c){_0x362209=_0x362209-0x0;var _0x9f6adc=_0x7a54[_0x362209];return _0x9f6adc;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['Migration'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a1e9097..b24a4eb 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 _0x8f74=['request-promise','path','rimraf','../../config/environment','exports','define','migrations','lodash','../../config/logger','moment','bluebird'];(function(_0x3f872a,_0x3ec864){var _0x13e5fd=function(_0x1db5a6){while(--_0x1db5a6){_0x3f872a['push'](_0x3f872a['shift']());}};_0x13e5fd(++_0x3ec864);}(_0x8f74,0xf9));var _0x48f7=function(_0x5c84b3,_0x20fd99){_0x5c84b3=_0x5c84b3-0x0;var _0x1b07b4=_0x8f74[_0x5c84b3];return _0x1b07b4;};'use strict';var _=require(_0x48f7('0x0'));var util=require('util');var logger=require(_0x48f7('0x1'))('api');var moment=require(_0x48f7('0x2'));var BPromise=require(_0x48f7('0x3'));var rp=require(_0x48f7('0x4'));var fs=require('fs');var path=require(_0x48f7('0x5'));var rimraf=require(_0x48f7('0x6'));var config=require(_0x48f7('0x7'));var attributes=require('./migration.attributes');module[_0x48f7('0x8')]=function(_0x4c4819,_0x2b5d15){return _0x4c4819[_0x48f7('0x9')]('Migration',attributes,{'tableName':_0x48f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4092=['lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','exports','define','Migration','migrations'];(function(_0x24b192,_0x7bd7f6){var _0x569037=function(_0x2bafad){while(--_0x2bafad){_0x24b192['push'](_0x24b192['shift']());}};_0x569037(++_0x7bd7f6);}(_0x4092,0x160));var _0x2409=function(_0x423dd4,_0x287532){_0x423dd4=_0x423dd4-0x0;var _0xb29406=_0x4092[_0x423dd4];return _0xb29406;};'use strict';var _=require(_0x2409('0x0'));var util=require(_0x2409('0x1'));var logger=require(_0x2409('0x2'))('api');var moment=require(_0x2409('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2409('0x4'));var rimraf=require(_0x2409('0x5'));var config=require(_0x2409('0x6'));var attributes=require('./migration.attributes');module[_0x2409('0x7')]=function(_0x2ed3a5,_0x464b7c){return _0x2ed3a5[_0x2409('0x8')](_0x2409('0x9'),attributes,{'tableName':_0x2409('0xa'),'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 93677c1..482f9bd 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 _0xcee9=['rpc','../../config/environment','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x1528a0,_0x5d05a1){var _0x11750e=function(_0x13e7c7){while(--_0x13e7c7){_0x1528a0['push'](_0x1528a0['shift']());}};_0x11750e(++_0x5d05a1);}(_0xcee9,0xbf));var _0x9cee=function(_0x5bbe5a,_0x53199c){_0x5bbe5a=_0x5bbe5a-0x0;var _0x56d602=_0xcee9[_0x5bbe5a];return _0x56d602;};'use strict';var _=require(_0x9cee('0x0'));var util=require(_0x9cee('0x1'));var moment=require(_0x9cee('0x2'));var BPromise=require(_0x9cee('0x3'));var rs=require(_0x9cee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9cee('0x6'))(_0x9cee('0x7'));var config=require(_0x9cee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9cee('0x9')][_0x9cee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x590a61,_0x299c39,_0x3198d0){return new BPromise(function(_0x5142bf,_0x2c5665){return client[_0x9cee('0xb')](_0x590a61,_0x3198d0)[_0x9cee('0xc')](function(_0x35cea3){logger['info'](_0x9cee('0xd'),_0x299c39,_0x9cee('0xe'));logger[_0x9cee('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x299c39,'request\x20sent',JSON[_0x9cee('0x10')](_0x35cea3));if(_0x35cea3[_0x9cee('0x11')]){if(_0x35cea3['error'][_0x9cee('0x12')]===0x1f4){logger[_0x9cee('0x11')](_0x9cee('0xd'),_0x299c39,_0x35cea3[_0x9cee('0x11')][_0x9cee('0x13')]);return _0x2c5665(_0x35cea3[_0x9cee('0x11')][_0x9cee('0x13')]);}logger[_0x9cee('0x11')]('Migration,\x20%s,\x20%s',_0x299c39,_0x35cea3[_0x9cee('0x11')]['message']);return _0x5142bf(_0x35cea3[_0x9cee('0x11')][_0x9cee('0x13')]);}else{logger[_0x9cee('0x14')]('Migration,\x20%s,\x20%s',_0x299c39,'request\x20sent');_0x5142bf(_0x35cea3[_0x9cee('0x15')]['message']);}})['catch'](function(_0xf7eed7){logger['error'](_0x9cee('0xd'),_0x299c39,_0xf7eed7);_0x2c5665(_0xf7eed7);});});} \ No newline at end of file +var _0x6e2a=['../../config/environment','jayson/promise','client','http','then','info','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5d7a0a,_0x48df67){var _0x472cff=function(_0x1e1f80){while(--_0x1e1f80){_0x5d7a0a['push'](_0x5d7a0a['shift']());}};_0x472cff(++_0x48df67);}(_0x6e2a,0x18f));var _0xa6e2=function(_0x17ec37,_0x2c3cb8){_0x17ec37=_0x17ec37-0x0;var _0x13cc2b=_0x6e2a[_0x17ec37];return _0x13cc2b;};'use strict';var _=require(_0xa6e2('0x0'));var util=require(_0xa6e2('0x1'));var moment=require(_0xa6e2('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6e2('0x3'));var fs=require('fs');var Redis=require(_0xa6e2('0x4'));var db=require(_0xa6e2('0x5'))['db'];var utils=require(_0xa6e2('0x6'));var logger=require(_0xa6e2('0x7'))(_0xa6e2('0x8'));var config=require(_0xa6e2('0x9'));var jayson=require(_0xa6e2('0xa'));var client=jayson[_0xa6e2('0xb')][_0xa6e2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xff2332,_0x307e6c,_0x36989e){return new BPromise(function(_0x23c3d3,_0x5d3cea){return client['request'](_0xff2332,_0x36989e)[_0xa6e2('0xd')](function(_0xbb6245){logger[_0xa6e2('0xe')]('Migration,\x20%s,\x20%s',_0x307e6c,'request\x20sent');logger['debug'](_0xa6e2('0xf'),_0x307e6c,_0xa6e2('0x10'),JSON[_0xa6e2('0x11')](_0xbb6245));if(_0xbb6245['error']){if(_0xbb6245[_0xa6e2('0x12')][_0xa6e2('0x13')]===0x1f4){logger[_0xa6e2('0x12')](_0xa6e2('0x14'),_0x307e6c,_0xbb6245[_0xa6e2('0x12')]['message']);return _0x5d3cea(_0xbb6245[_0xa6e2('0x12')][_0xa6e2('0x15')]);}logger[_0xa6e2('0x12')](_0xa6e2('0x14'),_0x307e6c,_0xbb6245['error'][_0xa6e2('0x15')]);return _0x23c3d3(_0xbb6245[_0xa6e2('0x12')][_0xa6e2('0x15')]);}else{logger[_0xa6e2('0xe')](_0xa6e2('0x14'),_0x307e6c,_0xa6e2('0x10'));_0x23c3d3(_0xbb6245[_0xa6e2('0x16')]['message']);}})[_0xa6e2('0x17')](function(_0x467399){logger[_0xa6e2('0x12')](_0xa6e2('0x14'),_0x307e6c,_0x467399);_0x5d3cea(_0x467399);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 1df7836..78a3cb9 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 _0x3a0b=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','./network.controller'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3a0b,0x7a));var _0xb3a0=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x3a0b[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0xb3a0('0x0'));var util=require(_0xb3a0('0x1'));var path=require(_0xb3a0('0x2'));var timeout=require(_0xb3a0('0x3'));var express=require(_0xb3a0('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb3a0('0x5'));router[_0xb3a0('0x6')]('/',auth['isAuthenticated'](),controller[_0xb3a0('0x7')]);router[_0xb3a0('0x6')](_0xb3a0('0x8'),auth[_0xb3a0('0x9')](),controller[_0xb3a0('0xa')]);router[_0xb3a0('0xb')]('/',auth[_0xb3a0('0x9')](),controller[_0xb3a0('0xc')]);router[_0xb3a0('0xd')](_0xb3a0('0x8'),auth[_0xb3a0('0x9')](),controller[_0xb3a0('0xe')]);router[_0xb3a0('0xf')](_0xb3a0('0x8'),auth[_0xb3a0('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8e34=['path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','post','put','update','delete','destroy','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8e34,0x1bf));var _0x48e3=function(_0x35294d,_0x2295a1){_0x35294d=_0x35294d-0x0;var _0x3a31d8=_0x8e34[_0x35294d];return _0x3a31d8;};'use strict';var multer=require(_0x48e3('0x0'));var util=require('util');var path=require(_0x48e3('0x1'));var timeout=require('connect-timeout');var express=require(_0x48e3('0x2'));var router=express[_0x48e3('0x3')]();var auth=require(_0x48e3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x48e3('0x5'));var controller=require('./network.controller');router['get']('/',auth[_0x48e3('0x6')](),controller[_0x48e3('0x7')]);router[_0x48e3('0x8')](_0x48e3('0x9'),auth[_0x48e3('0x6')](),controller['show']);router[_0x48e3('0xa')]('/',auth[_0x48e3('0x6')](),controller['create']);router[_0x48e3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x48e3('0xc')]);router[_0x48e3('0xd')](_0x48e3('0x9'),auth[_0x48e3('0x6')](),controller[_0x48e3('0xe')]);module[_0x48e3('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 8ada8e1..61eabf6 100644 --- a/server/api/network/network.attributes.js +++ b/server/api/network/network.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x388794,_0x28e3bd){var _0xdb5d27=function(_0x12192c){while(--_0x12192c){_0x388794['push'](_0x388794['shift']());}};_0xdb5d27(++_0x28e3bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x3f147f,_0x3c7b21){var _0x2c29f3=function(_0x82270c){while(--_0x82270c){_0x3f147f['push'](_0x3f147f['shift']());}};_0x2c29f3(++_0x3c7b21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 3b36226..3b09774 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 _0x9874=['params','keys','intersection','options','find','create','transaction','body','STUN','readFileSync','join','root','utf8','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','server/files/templates/turn_multiple.ejs','render','server/files/templates/network.ejs','writeFileSync','format','TURN','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','server/files/templates/stun_multiple.ejs','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','status','json','count','offset','Content-Range','apply','reject','update','destroy','end','sendStatus','stack','name','send','index','Network','rawAttributes','fieldName','type','model','query','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','filter','map','merge','includeAll','include','findAll','catch'];(function(_0x4b8968,_0x5c9b44){var _0x3a0ab7=function(_0x4dade2){while(--_0x4dade2){_0x4b8968['push'](_0x4b8968['shift']());}};_0x3a0ab7(++_0x5c9b44);}(_0x9874,0x7d));var _0x4987=function(_0x55b1eb,_0x279639){_0x55b1eb=_0x55b1eb-0x0;var _0x37b255=_0x9874[_0x55b1eb];return _0x37b255;};'use strict';var pdf=require(_0x4987('0x0'));var emlformat=require(_0x4987('0x1'));var rimraf=require(_0x4987('0x2'));var zipdir=require(_0x4987('0x3'));var jsonpatch=require(_0x4987('0x4'));var rp=require('request-promise');var moment=require(_0x4987('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4987('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4987('0x7'));var crypto=require(_0x4987('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x4987('0x9'));var toCsv=require('to-csv');var querystring=require(_0x4987('0xa'));var Papa=require(_0x4987('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4987('0xc'));var as=require(_0x4987('0xd'));var hardwareService=require(_0x4987('0xe'));var logger=require('../../config/logger')(_0x4987('0xf'));var utils=require('../../config/utils');var config=require(_0x4987('0x10'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4987('0x11'));var client=jayson[_0x4987('0x12')][_0x4987('0x13')]({'port':0x232a});function checkPasswordPattern(_0x5d08f5,_0x233dd0,_0x146e95){if(_0x146e95){var _0x522cfc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x522cfc['test'](_0x233dd0)){return _0x5d08f5;}else{throw new db['Sequelize'][(_0x4987('0x14'))](_0x4987('0x15'));}}else{return _0x5d08f5;}}function respondWithRpcPromise(_0x225358,_0x2f4073,_0x5f433f,_0x31d500){return new BPromise(function(_0x1b4d0e,_0x26c0c9){var _0x4e1963=_0x31d500||client;return _0x4e1963[_0x4987('0x16')](_0x225358,_0x5f433f)[_0x4987('0x17')](function(_0x4cb9b9){logger[_0x4987('0x18')](_0x4987('0x19'),_0x2f4073,'request\x20sent');logger[_0x4987('0x1a')]('Network,\x20%s,\x20%s,\x20%s',_0x2f4073,'request\x20sent',JSON[_0x4987('0x1b')](_0x4cb9b9));if(_0x4cb9b9[_0x4987('0x1c')]){if(_0x4cb9b9[_0x4987('0x1c')][_0x4987('0x1d')]===0x1f4){logger[_0x4987('0x1c')]('Network,\x20%s,\x20%s',_0x2f4073,_0x4cb9b9[_0x4987('0x1c')][_0x4987('0x1e')]);return _0x26c0c9(_0x4cb9b9[_0x4987('0x1c')][_0x4987('0x1e')]);}logger[_0x4987('0x1c')](_0x4987('0x19'),_0x2f4073,_0x4cb9b9['error'][_0x4987('0x1e')]);return _0x1b4d0e(_0x4cb9b9['error'][_0x4987('0x1e')]);}else{logger[_0x4987('0x18')](_0x4987('0x19'),_0x2f4073,_0x4987('0x1f'));_0x1b4d0e(_0x4cb9b9[_0x4987('0x20')][_0x4987('0x1e')]);}})['catch'](function(_0x464427){logger['error'](_0x4987('0x19'),_0x2f4073,_0x464427);_0x26c0c9(_0x464427);});});}function respondWithStatusCode(_0xf2e8c1,_0x2512ff){_0x2512ff=_0x2512ff||0xcc;return function(_0x3abd7a){if(_0x3abd7a){return _0xf2e8c1['sendStatus'](_0x2512ff);}return _0xf2e8c1[_0x4987('0x21')](_0x2512ff)['end']();};}function respondWithResult(_0x55ffe3,_0x36f70e){_0x36f70e=_0x36f70e||0xc8;return function(_0x4e78d6){if(_0x4e78d6){return _0x55ffe3[_0x4987('0x21')](_0x36f70e)[_0x4987('0x22')](_0x4e78d6);}};}function respondWithFilteredResult(_0xc0fbeb,_0x2cdc8c){return function(_0x5a3b2b){if(_0x5a3b2b){var _0x474768=_0x5a3b2b[_0x4987('0x23')],_0x1b4f88=_0x2cdc8c[_0x4987('0x24')],_0x32ec0b=_0x2cdc8c['offset']+_0x2cdc8c['limit'],_0x50fc2e;if(_0x32ec0b>=_0x474768){_0x32ec0b=_0x474768;_0x50fc2e=0xc8;}else{_0x50fc2e=0xce;}_0xc0fbeb[_0x4987('0x21')](_0x50fc2e);return _0xc0fbeb['set'](_0x4987('0x25'),_0x1b4f88+'-'+_0x32ec0b+'/'+_0x474768)[_0x4987('0x22')](_0x5a3b2b);}return null;};}function patchUpdates(_0x5d7eaf){return function(_0xf45733){try{jsonpatch[_0x4987('0x26')](_0xf45733,_0x5d7eaf,!![]);}catch(_0x2fa8e9){return BPromise[_0x4987('0x27')](_0x2fa8e9);}return _0xf45733['save']();};}function saveUpdates(_0x2e738f,_0x3c5fc8){return function(_0x599cb4){if(_0x599cb4){return _0x599cb4[_0x4987('0x28')](_0x2e738f)[_0x4987('0x17')](function(_0x299d46){return _0x299d46;});}return null;};}function removeEntity(_0x4e79bc,_0x11001f){return function(_0x4f54aa){if(_0x4f54aa){return _0x4f54aa[_0x4987('0x29')]()[_0x4987('0x17')](function(){_0x4e79bc['status'](0xcc)[_0x4987('0x2a')]();});}};}function handleEntityNotFound(_0x63f5e7,_0xd98b4e){return function(_0x5c5174){if(!_0x5c5174){_0x63f5e7[_0x4987('0x2b')](0x194);}return _0x5c5174;};}function handleError(_0x129426,_0x4441f5){_0x4441f5=_0x4441f5||0x1f4;return function(_0x2189cd){logger['error'](_0x2189cd[_0x4987('0x2c')]);if(_0x2189cd[_0x4987('0x2d')]){delete _0x2189cd[_0x4987('0x2d')];}_0x129426[_0x4987('0x21')](_0x4441f5)[_0x4987('0x2e')](_0x2189cd);};}exports[_0x4987('0x2f')]=function(_0x5ba5cd,_0x2f2468){var _0x195365={},_0x779ed9={},_0x1afe71={'count':0x0,'rows':[]};var _0x4871ce=_['map'](db[_0x4987('0x30')][_0x4987('0x31')],function(_0x55bea4){return{'name':_0x55bea4[_0x4987('0x32')],'type':_0x55bea4[_0x4987('0x33')]['key']};});_0x779ed9[_0x4987('0x34')]=_['map'](_0x4871ce,_0x4987('0x2d'));_0x779ed9[_0x4987('0x35')]=_['keys'](_0x5ba5cd[_0x4987('0x35')]);_0x779ed9['filters']=_['intersection'](_0x779ed9['model'],_0x779ed9[_0x4987('0x35')]);_0x195365[_0x4987('0x36')]=_['intersection'](_0x779ed9[_0x4987('0x34')],qs[_0x4987('0x37')](_0x5ba5cd[_0x4987('0x35')][_0x4987('0x37')]));_0x195365[_0x4987('0x36')]=_0x195365[_0x4987('0x36')][_0x4987('0x38')]?_0x195365[_0x4987('0x36')]:_0x779ed9[_0x4987('0x34')];if(!_0x5ba5cd[_0x4987('0x35')][_0x4987('0x39')]('nolimit')){_0x195365[_0x4987('0x3a')]=qs[_0x4987('0x3a')](_0x5ba5cd['query']['limit']);_0x195365[_0x4987('0x24')]=qs[_0x4987('0x24')](_0x5ba5cd[_0x4987('0x35')]['offset']);}_0x195365['order']=qs[_0x4987('0x3b')](_0x5ba5cd['query'][_0x4987('0x3b')]);_0x195365[_0x4987('0x3c')]=qs[_0x4987('0x3d')](_['pick'](_0x5ba5cd['query'],_0x779ed9['filters']));if(_0x5ba5cd[_0x4987('0x35')][_0x4987('0x3e')]){_0x195365[_0x4987('0x3c')]=_['merge'](_0x195365[_0x4987('0x3c')],{'$or':_[_0x4987('0x3f')](_0x4871ce,function(_0x4078f5){if(_0x4078f5[_0x4987('0x33')]!=='VIRTUAL'){var _0x522a0a={};_0x522a0a[_0x4078f5['name']]={'$like':'%'+_0x5ba5cd[_0x4987('0x35')][_0x4987('0x3e')]+'%'};return _0x522a0a;}})});}_0x195365=_[_0x4987('0x40')]({},_0x195365,_0x5ba5cd['options']);var _0x1e10f5={'where':_0x195365['where']};return db[_0x4987('0x30')]['count'](_0x1e10f5)[_0x4987('0x17')](function(_0x27c7b0){_0x1afe71['count']=_0x27c7b0;if(_0x5ba5cd[_0x4987('0x35')][_0x4987('0x41')]){_0x195365[_0x4987('0x42')]=[{'all':!![]}];}return db[_0x4987('0x30')][_0x4987('0x43')](_0x195365);})[_0x4987('0x17')](function(_0x326d7d){_0x1afe71['rows']=_0x326d7d;return _0x1afe71;})[_0x4987('0x17')](respondWithFilteredResult(_0x2f2468,_0x195365))[_0x4987('0x44')](handleError(_0x2f2468,null));};exports['show']=function(_0x13ad17,_0x1d9972){var _0x14b6b0={'raw':!![],'where':{'id':_0x13ad17[_0x4987('0x45')]['id']}},_0x38141e={};_0x38141e[_0x4987('0x34')]=_['keys'](db[_0x4987('0x30')]['rawAttributes']);_0x38141e[_0x4987('0x35')]=_[_0x4987('0x46')](_0x13ad17['query']);_0x38141e[_0x4987('0x3d')]=_[_0x4987('0x47')](_0x38141e[_0x4987('0x34')],_0x38141e[_0x4987('0x35')]);_0x14b6b0[_0x4987('0x36')]=_[_0x4987('0x47')](_0x38141e[_0x4987('0x34')],qs['fields'](_0x13ad17[_0x4987('0x35')][_0x4987('0x37')]));_0x14b6b0[_0x4987('0x36')]=_0x14b6b0[_0x4987('0x36')][_0x4987('0x38')]?_0x14b6b0['attributes']:_0x38141e[_0x4987('0x34')];if(_0x13ad17['query'][_0x4987('0x41')]){_0x14b6b0['include']=[{'all':!![]}];}_0x14b6b0=_[_0x4987('0x40')]({},_0x14b6b0,_0x13ad17[_0x4987('0x48')]);return db[_0x4987('0x30')][_0x4987('0x49')](_0x14b6b0)[_0x4987('0x17')](handleEntityNotFound(_0x1d9972,null))[_0x4987('0x17')](respondWithResult(_0x1d9972,null))[_0x4987('0x44')](handleError(_0x1d9972,null));};exports[_0x4987('0x4a')]=function(_0x4fc439,_0x3c5415,_0x4dc782){var _0x49fc0c;return db['sequelize'][_0x4987('0x4b')](function(_0x5b2f79){return db[_0x4987('0x30')]['create'](_0x4fc439[_0x4987('0x4c')],{'raw':!![]})['then'](function(_0x5aa730){_0x49fc0c=_0x5aa730;return db['Network'][_0x4987('0x43')]({'where':{'type':_0x4fc439[_0x4987('0x4c')][_0x4987('0x33')]},'raw':!![]});})[_0x4987('0x17')](function(_0x5e2491){if(_0x49fc0c['type']['toUpperCase']()==_0x4987('0x4d')){var _0x54eae0=fs[_0x4987('0x4e')](path[_0x4987('0x4f')](config[_0x4987('0x50')],'server/files/templates/stun_multiple.ejs'),_0x4987('0x51'));var _0x39c1a3=ejs['render'](_0x54eae0,{'networks':_0x5e2491||[]});fs['writeFileSync'](_0x4987('0x52'),_0x39c1a3);return respondWithRpcPromise(_0x4987('0x53'),'create',{'module':_0x4987('0x54')});}else if(_0x49fc0c['type'][_0x4987('0x55')]()=='TURN'){var _0x2c875a=fs['readFileSync'](path[_0x4987('0x4f')](config[_0x4987('0x50')],_0x4987('0x56')),_0x4987('0x51'));var _0x157cb8=ejs[_0x4987('0x57')](_0x2c875a,{'networks':_0x5e2491||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x157cb8);return respondWithRpcPromise('Reload',_0x4987('0x4a'),{'module':_0x4987('0x54')});}else{var _0x33edce=fs[_0x4987('0x4e')](path[_0x4987('0x4f')](config[_0x4987('0x50')],_0x4987('0x58')),'utf8');var _0x3c97c8=ejs[_0x4987('0x57')](_0x33edce,{'networks':_0x5e2491||[]});fs[_0x4987('0x59')](util[_0x4987('0x5a')]('/etc/asterisk/sip_xcally_%s.conf',_0x4fc439[_0x4987('0x4c')][_0x4987('0x33')]['toLowerCase']()),_0x3c97c8);return respondWithRpcPromise(_0x4987('0x53'),_0x4987('0x4a'),{'module':'chan_sip.so'});}return null;})[_0x4987('0x17')](function(){return _0x49fc0c;});})[_0x4987('0x17')](respondWithResult(_0x3c5415,0xc9))[_0x4987('0x44')](handleError(_0x3c5415,null));};exports['update']=function(_0x59370a,_0x4aa867,_0x167c98){var _0x3544cc;return db['sequelize'][_0x4987('0x4b')](function(_0x5474e5){return db['Network']['find']({'where':{'id':_0x59370a[_0x4987('0x45')]['id']}})[_0x4987('0x17')](handleEntityNotFound(_0x4aa867,null))[_0x4987('0x17')](saveUpdates(_0x59370a[_0x4987('0x4c')],null))[_0x4987('0x17')](function(_0x22a7e3){if(_0x22a7e3){_0x3544cc=_0x22a7e3;return db[_0x4987('0x30')][_0x4987('0x43')]({'where':{'type':_0x3544cc[_0x4987('0x33')]},'raw':!![]});}return null;})[_0x4987('0x17')](function(_0x2528cf){if(_0x3544cc['type'][_0x4987('0x55')]()==_0x4987('0x4d')){var _0x4e54e2=fs['readFileSync'](path[_0x4987('0x4f')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x4987('0x51'));var _0x57a20a=ejs[_0x4987('0x57')](_0x4e54e2,{'networks':_0x2528cf||[]});fs['writeFileSync'](_0x4987('0x52'),_0x57a20a);return respondWithRpcPromise(_0x4987('0x53'),'update',{'module':_0x4987('0x54')});}else if(_0x3544cc[_0x4987('0x33')][_0x4987('0x55')]()==_0x4987('0x5b')){var _0x3e3f65=fs['readFileSync'](path[_0x4987('0x4f')](config[_0x4987('0x50')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x31a56a=ejs[_0x4987('0x57')](_0x3e3f65,{'networks':_0x2528cf||[]});fs[_0x4987('0x59')](_0x4987('0x5c'),_0x31a56a);return respondWithRpcPromise(_0x4987('0x53'),_0x4987('0x28'),{'module':'res_stun_monitor.so'});}else{var _0x1e3bf7=fs[_0x4987('0x4e')](path[_0x4987('0x4f')](config[_0x4987('0x50')],_0x4987('0x58')),'utf8');var _0x109c6c=ejs[_0x4987('0x57')](_0x1e3bf7,{'networks':_0x2528cf||[]});fs[_0x4987('0x59')](util['format'](_0x4987('0x5d'),_0x59370a['body'][_0x4987('0x33')][_0x4987('0x5e')]()),_0x109c6c);return respondWithRpcPromise('Reload','update',{'module':_0x4987('0x5f')});}return null;})[_0x4987('0x17')](function(_0x2375eb){if(_0x2375eb){return _0x3544cc;}return null;});})[_0x4987('0x17')](respondWithResult(_0x4aa867,null))['catch'](handleError(_0x4aa867,null));};exports[_0x4987('0x29')]=function(_0x4cee2b,_0x1ccd54,_0x517d67){var _0x28c833;return db[_0x4987('0x30')]['find']({'where':{'id':_0x4cee2b[_0x4987('0x45')]['id']}})[_0x4987('0x17')](function(_0x170022){_0x28c833=_0x170022;return _0x170022;})['then'](handleEntityNotFound(_0x1ccd54,null))['then'](removeEntity(_0x1ccd54,null))[_0x4987('0x17')](function(){if(_0x28c833){return db[_0x4987('0x30')][_0x4987('0x43')]({'where':{'type':_0x28c833[_0x4987('0x33')]},'raw':!![]});}})[_0x4987('0x17')](function(_0xefe780){if(_0x28c833[_0x4987('0x33')][_0x4987('0x55')]()==_0x4987('0x4d')){var _0x46f311=fs[_0x4987('0x4e')](path[_0x4987('0x4f')](config[_0x4987('0x50')],_0x4987('0x60')),_0x4987('0x51'));var _0x1279e4=ejs[_0x4987('0x57')](_0x46f311,{'networks':_0xefe780||[]});fs[_0x4987('0x59')]('/etc/asterisk/stun_xcally.conf',_0x1279e4);return respondWithRpcPromise(_0x4987('0x53'),_0x4987('0x29'),{'module':_0x4987('0x54')});}else if(_0x28c833['type']['toUpperCase']()==_0x4987('0x5b')){var _0x456214=fs[_0x4987('0x4e')](path[_0x4987('0x4f')](config[_0x4987('0x50')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x4e11ad=ejs[_0x4987('0x57')](_0x456214,{'networks':_0xefe780||[]});fs[_0x4987('0x59')](_0x4987('0x5c'),_0x4e11ad);return respondWithRpcPromise(_0x4987('0x53'),_0x4987('0x29'),{'module':_0x4987('0x54')});}else{var _0x127b72=fs[_0x4987('0x4e')](path[_0x4987('0x4f')](config[_0x4987('0x50')],_0x4987('0x58')),'utf8');var _0x4e13e4=ejs[_0x4987('0x57')](_0x127b72,{'networks':_0xefe780||[]});fs[_0x4987('0x59')](util['format'](_0x4987('0x5d'),_0x4cee2b[_0x4987('0x4c')][_0x4987('0x33')]['toLowerCase']()),_0x4e13e4);return respondWithRpcPromise('Reload',_0x4987('0x29'),{'module':_0x4987('0x5f')});}return null;})[_0x4987('0x44')](handleError(_0x1ccd54,null));}; \ No newline at end of file +var _0x78f2=['offset','limit','set','Content-Range','update','stack','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','show','params','find','create','sequelize','body','toUpperCase','STUN','readFileSync','root','utf8','render','Reload','TURN','join','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','transaction','/etc/asterisk/stun_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','destroy','server/files/templates/stun_multiple.ejs','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Network,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count'];(function(_0x8c3c55,_0x5ea3aa){var _0x113983=function(_0x58c175){while(--_0x58c175){_0x8c3c55['push'](_0x8c3c55['shift']());}};_0x113983(++_0x5ea3aa);}(_0x78f2,0x174));var _0x278f=function(_0x549aab,_0x41c434){_0x549aab=_0x549aab-0x0;var _0x2b663e=_0x78f2[_0x549aab];return _0x2b663e;};'use strict';var pdf=require(_0x278f('0x0'));var emlformat=require(_0x278f('0x1'));var rimraf=require(_0x278f('0x2'));var zipdir=require(_0x278f('0x3'));var jsonpatch=require(_0x278f('0x4'));var rp=require('request-promise');var moment=require(_0x278f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x278f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x278f('0x7'));var csv=require(_0x278f('0x8'));var ejs=require(_0x278f('0x9'));var fs=require('fs');var _=require(_0x278f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x278f('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x278f('0xc'));var qs=require(_0x278f('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x278f('0xe'));var logger=require(_0x278f('0xf'))('api');var utils=require(_0x278f('0x10'));var config=require(_0x278f('0x11'));var db=require(_0x278f('0x12'))['db'];var jayson=require(_0x278f('0x13'));var client=jayson[_0x278f('0x14')][_0x278f('0x15')]({'port':0x232a});function checkPasswordPattern(_0xe9e7d9,_0x2efcf3,_0x43da6f){if(_0x43da6f){var _0x296824=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x296824['test'](_0x2efcf3)){return _0xe9e7d9;}else{throw new db[(_0x278f('0x16'))][(_0x278f('0x17'))](_0x278f('0x18'));}}else{return _0xe9e7d9;}}function respondWithRpcPromise(_0x12d0e0,_0x290370,_0x277902,_0x22306c){return new BPromise(function(_0x4cf55b,_0x27f4bd){var _0x331b50=_0x22306c||client;return _0x331b50['request'](_0x12d0e0,_0x277902)[_0x278f('0x19')](function(_0x48e30a){logger['info']('Network,\x20%s,\x20%s',_0x290370,'request\x20sent');logger[_0x278f('0x1a')](_0x278f('0x1b'),_0x290370,_0x278f('0x1c'),JSON[_0x278f('0x1d')](_0x48e30a));if(_0x48e30a['error']){if(_0x48e30a[_0x278f('0x1e')]['code']===0x1f4){logger[_0x278f('0x1e')]('Network,\x20%s,\x20%s',_0x290370,_0x48e30a[_0x278f('0x1e')]['message']);return _0x27f4bd(_0x48e30a[_0x278f('0x1e')][_0x278f('0x1f')]);}logger[_0x278f('0x1e')](_0x278f('0x20'),_0x290370,_0x48e30a[_0x278f('0x1e')][_0x278f('0x1f')]);return _0x4cf55b(_0x48e30a['error'][_0x278f('0x1f')]);}else{logger['info'](_0x278f('0x20'),_0x290370,'request\x20sent');_0x4cf55b(_0x48e30a[_0x278f('0x21')][_0x278f('0x1f')]);}})[_0x278f('0x22')](function(_0x1a3968){logger['error'](_0x278f('0x20'),_0x290370,_0x1a3968);_0x27f4bd(_0x1a3968);});});}function respondWithStatusCode(_0x3e36e0,_0x20c19d){_0x20c19d=_0x20c19d||0xcc;return function(_0x4cf199){if(_0x4cf199){return _0x3e36e0[_0x278f('0x23')](_0x20c19d);}return _0x3e36e0[_0x278f('0x24')](_0x20c19d)[_0x278f('0x25')]();};}function respondWithResult(_0x3c74b4,_0x53458c){_0x53458c=_0x53458c||0xc8;return function(_0x20c53f){if(_0x20c53f){return _0x3c74b4['status'](_0x53458c)[_0x278f('0x26')](_0x20c53f);}};}function respondWithFilteredResult(_0x1c947f,_0x3d82e7){return function(_0x5888d5){if(_0x5888d5){var _0x56d079=_0x5888d5[_0x278f('0x27')],_0x323de6=_0x3d82e7['offset'],_0x2e271c=_0x3d82e7[_0x278f('0x28')]+_0x3d82e7[_0x278f('0x29')],_0x3c6972;if(_0x2e271c>=_0x56d079){_0x2e271c=_0x56d079;_0x3c6972=0xc8;}else{_0x3c6972=0xce;}_0x1c947f['status'](_0x3c6972);return _0x1c947f[_0x278f('0x2a')](_0x278f('0x2b'),_0x323de6+'-'+_0x2e271c+'/'+_0x56d079)[_0x278f('0x26')](_0x5888d5);}return null;};}function patchUpdates(_0x37365d){return function(_0x7a2be3){try{jsonpatch['apply'](_0x7a2be3,_0x37365d,!![]);}catch(_0x21ea13){return BPromise['reject'](_0x21ea13);}return _0x7a2be3['save']();};}function saveUpdates(_0x29e031,_0x5a61b4){return function(_0x273924){if(_0x273924){return _0x273924[_0x278f('0x2c')](_0x29e031)[_0x278f('0x19')](function(_0x46b5ff){return _0x46b5ff;});}return null;};}function removeEntity(_0x32e238,_0x12989b){return function(_0x5009f9){if(_0x5009f9){return _0x5009f9['destroy']()[_0x278f('0x19')](function(){_0x32e238[_0x278f('0x24')](0xcc)[_0x278f('0x25')]();});}};}function handleEntityNotFound(_0x202df7,_0x2faa68){return function(_0x38b8b9){if(!_0x38b8b9){_0x202df7[_0x278f('0x23')](0x194);}return _0x38b8b9;};}function handleError(_0x1ddc34,_0xeb6dd){_0xeb6dd=_0xeb6dd||0x1f4;return function(_0x1cbd84){logger[_0x278f('0x1e')](_0x1cbd84[_0x278f('0x2d')]);if(_0x1cbd84['name']){delete _0x1cbd84['name'];}_0x1ddc34[_0x278f('0x24')](_0xeb6dd)[_0x278f('0x2e')](_0x1cbd84);};}exports[_0x278f('0x2f')]=function(_0x46793f,_0x26f874){var _0x5da025={},_0x336949={},_0x404a8b={'count':0x0,'rows':[]};var _0x4e4282=_[_0x278f('0x30')](db[_0x278f('0x31')][_0x278f('0x32')],function(_0x2767e6){return{'name':_0x2767e6[_0x278f('0x33')],'type':_0x2767e6[_0x278f('0x34')][_0x278f('0x35')]};});_0x336949[_0x278f('0x36')]=_[_0x278f('0x30')](_0x4e4282,'name');_0x336949[_0x278f('0x37')]=_[_0x278f('0x38')](_0x46793f[_0x278f('0x37')]);_0x336949[_0x278f('0x39')]=_['intersection'](_0x336949['model'],_0x336949[_0x278f('0x37')]);_0x5da025[_0x278f('0x3a')]=_[_0x278f('0x3b')](_0x336949[_0x278f('0x36')],qs[_0x278f('0x3c')](_0x46793f['query']['fields']));_0x5da025[_0x278f('0x3a')]=_0x5da025[_0x278f('0x3a')][_0x278f('0x3d')]?_0x5da025[_0x278f('0x3a')]:_0x336949['model'];if(!_0x46793f[_0x278f('0x37')][_0x278f('0x3e')]('nolimit')){_0x5da025[_0x278f('0x29')]=qs[_0x278f('0x29')](_0x46793f[_0x278f('0x37')]['limit']);_0x5da025[_0x278f('0x28')]=qs[_0x278f('0x28')](_0x46793f[_0x278f('0x37')][_0x278f('0x28')]);}_0x5da025[_0x278f('0x3f')]=qs[_0x278f('0x40')](_0x46793f[_0x278f('0x37')][_0x278f('0x40')]);_0x5da025[_0x278f('0x41')]=qs[_0x278f('0x39')](_[_0x278f('0x42')](_0x46793f[_0x278f('0x37')],_0x336949['filters']));if(_0x46793f[_0x278f('0x37')][_0x278f('0x43')]){_0x5da025[_0x278f('0x41')]=_[_0x278f('0x44')](_0x5da025['where'],{'$or':_[_0x278f('0x30')](_0x4e4282,function(_0x5c9347){if(_0x5c9347[_0x278f('0x34')]!==_0x278f('0x45')){var _0x587062={};_0x587062[_0x5c9347[_0x278f('0x46')]]={'$like':'%'+_0x46793f[_0x278f('0x37')][_0x278f('0x43')]+'%'};return _0x587062;}})});}_0x5da025=_[_0x278f('0x44')]({},_0x5da025,_0x46793f[_0x278f('0x47')]);var _0x254eac={'where':_0x5da025[_0x278f('0x41')]};return db[_0x278f('0x31')]['count'](_0x254eac)[_0x278f('0x19')](function(_0x51cf7d){_0x404a8b[_0x278f('0x27')]=_0x51cf7d;if(_0x46793f[_0x278f('0x37')][_0x278f('0x48')]){_0x5da025[_0x278f('0x49')]=[{'all':!![]}];}return db['Network'][_0x278f('0x4a')](_0x5da025);})[_0x278f('0x19')](function(_0x5c00cb){_0x404a8b['rows']=_0x5c00cb;return _0x404a8b;})['then'](respondWithFilteredResult(_0x26f874,_0x5da025))[_0x278f('0x22')](handleError(_0x26f874,null));};exports[_0x278f('0x4b')]=function(_0x12834f,_0x23848c){var _0x366a06={'raw':!![],'where':{'id':_0x12834f[_0x278f('0x4c')]['id']}},_0x4fd420={};_0x4fd420['model']=_[_0x278f('0x38')](db[_0x278f('0x31')][_0x278f('0x32')]);_0x4fd420['query']=_[_0x278f('0x38')](_0x12834f[_0x278f('0x37')]);_0x4fd420['filters']=_[_0x278f('0x3b')](_0x4fd420[_0x278f('0x36')],_0x4fd420[_0x278f('0x37')]);_0x366a06[_0x278f('0x3a')]=_['intersection'](_0x4fd420['model'],qs[_0x278f('0x3c')](_0x12834f[_0x278f('0x37')][_0x278f('0x3c')]));_0x366a06[_0x278f('0x3a')]=_0x366a06[_0x278f('0x3a')][_0x278f('0x3d')]?_0x366a06[_0x278f('0x3a')]:_0x4fd420[_0x278f('0x36')];if(_0x12834f[_0x278f('0x37')][_0x278f('0x48')]){_0x366a06[_0x278f('0x49')]=[{'all':!![]}];}_0x366a06=_[_0x278f('0x44')]({},_0x366a06,_0x12834f[_0x278f('0x47')]);return db['Network'][_0x278f('0x4d')](_0x366a06)['then'](handleEntityNotFound(_0x23848c,null))[_0x278f('0x19')](respondWithResult(_0x23848c,null))[_0x278f('0x22')](handleError(_0x23848c,null));};exports[_0x278f('0x4e')]=function(_0x33eaad,_0x311b11,_0x411d89){var _0x1e3d5b;return db[_0x278f('0x4f')]['transaction'](function(_0x179458){return db[_0x278f('0x31')][_0x278f('0x4e')](_0x33eaad[_0x278f('0x50')],{'raw':!![]})[_0x278f('0x19')](function(_0x28518d){_0x1e3d5b=_0x28518d;return db['Network'][_0x278f('0x4a')]({'where':{'type':_0x33eaad[_0x278f('0x50')][_0x278f('0x34')]},'raw':!![]});})[_0x278f('0x19')](function(_0x408d58){if(_0x1e3d5b['type'][_0x278f('0x51')]()==_0x278f('0x52')){var _0x2fc15a=fs[_0x278f('0x53')](path['join'](config[_0x278f('0x54')],'server/files/templates/stun_multiple.ejs'),_0x278f('0x55'));var _0x2cc56b=ejs[_0x278f('0x56')](_0x2fc15a,{'networks':_0x408d58||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x2cc56b);return respondWithRpcPromise(_0x278f('0x57'),_0x278f('0x4e'),{'module':'res_stun_monitor.so'});}else if(_0x1e3d5b[_0x278f('0x34')][_0x278f('0x51')]()==_0x278f('0x58')){var _0x46ab87=fs[_0x278f('0x53')](path[_0x278f('0x59')](config[_0x278f('0x54')],_0x278f('0x5a')),_0x278f('0x55'));var _0x3716b1=ejs[_0x278f('0x56')](_0x46ab87,{'networks':_0x408d58||[]});fs[_0x278f('0x5b')](_0x278f('0x5c'),_0x3716b1);return respondWithRpcPromise(_0x278f('0x57'),_0x278f('0x4e'),{'module':_0x278f('0x5d')});}else{var _0x43147d=fs['readFileSync'](path[_0x278f('0x59')](config[_0x278f('0x54')],_0x278f('0x5e')),_0x278f('0x55'));var _0x1d53c4=ejs[_0x278f('0x56')](_0x43147d,{'networks':_0x408d58||[]});fs[_0x278f('0x5b')](util[_0x278f('0x5f')]('/etc/asterisk/sip_xcally_%s.conf',_0x33eaad[_0x278f('0x50')][_0x278f('0x34')][_0x278f('0x60')]()),_0x1d53c4);return respondWithRpcPromise('Reload','create',{'module':_0x278f('0x61')});}return null;})[_0x278f('0x19')](function(){return _0x1e3d5b;});})[_0x278f('0x19')](respondWithResult(_0x311b11,0xc9))[_0x278f('0x22')](handleError(_0x311b11,null));};exports['update']=function(_0x16c928,_0x2cd4c8,_0x30098d){var _0x48a523;return db[_0x278f('0x4f')][_0x278f('0x62')](function(_0x8041d){return db[_0x278f('0x31')][_0x278f('0x4d')]({'where':{'id':_0x16c928[_0x278f('0x4c')]['id']}})[_0x278f('0x19')](handleEntityNotFound(_0x2cd4c8,null))['then'](saveUpdates(_0x16c928[_0x278f('0x50')],null))[_0x278f('0x19')](function(_0x5b99a0){if(_0x5b99a0){_0x48a523=_0x5b99a0;return db[_0x278f('0x31')][_0x278f('0x4a')]({'where':{'type':_0x48a523[_0x278f('0x34')]},'raw':!![]});}return null;})['then'](function(_0x188c29){if(_0x48a523[_0x278f('0x34')][_0x278f('0x51')]()==_0x278f('0x52')){var _0x3ea8f0=fs['readFileSync'](path[_0x278f('0x59')](config[_0x278f('0x54')],'server/files/templates/stun_multiple.ejs'),_0x278f('0x55'));var _0x2eb3bc=ejs['render'](_0x3ea8f0,{'networks':_0x188c29||[]});fs[_0x278f('0x5b')](_0x278f('0x63'),_0x2eb3bc);return respondWithRpcPromise(_0x278f('0x57'),_0x278f('0x2c'),{'module':_0x278f('0x5d')});}else if(_0x48a523['type'][_0x278f('0x51')]()=='TURN'){var _0x37915d=fs[_0x278f('0x53')](path[_0x278f('0x59')](config[_0x278f('0x54')],_0x278f('0x5a')),_0x278f('0x55'));var _0x277186=ejs[_0x278f('0x56')](_0x37915d,{'networks':_0x188c29||[]});fs[_0x278f('0x5b')]('/etc/asterisk/turn_xcally.conf',_0x277186);return respondWithRpcPromise(_0x278f('0x57'),_0x278f('0x2c'),{'module':_0x278f('0x5d')});}else{var _0x419f2f=fs['readFileSync'](path['join'](config['root'],_0x278f('0x5e')),_0x278f('0x55'));var _0x8ee53f=ejs[_0x278f('0x56')](_0x419f2f,{'networks':_0x188c29||[]});fs[_0x278f('0x5b')](util[_0x278f('0x5f')](_0x278f('0x64'),_0x16c928[_0x278f('0x50')][_0x278f('0x34')]['toLowerCase']()),_0x8ee53f);return respondWithRpcPromise(_0x278f('0x57'),'update',{'module':_0x278f('0x61')});}return null;})[_0x278f('0x19')](function(_0x5a9d49){if(_0x5a9d49){return _0x48a523;}return null;});})[_0x278f('0x19')](respondWithResult(_0x2cd4c8,null))[_0x278f('0x22')](handleError(_0x2cd4c8,null));};exports[_0x278f('0x65')]=function(_0x36a21c,_0xa8b498,_0x5d7234){var _0x4fcd3a;return db[_0x278f('0x31')]['find']({'where':{'id':_0x36a21c[_0x278f('0x4c')]['id']}})['then'](function(_0x14b180){_0x4fcd3a=_0x14b180;return _0x14b180;})['then'](handleEntityNotFound(_0xa8b498,null))[_0x278f('0x19')](removeEntity(_0xa8b498,null))[_0x278f('0x19')](function(){if(_0x4fcd3a){return db[_0x278f('0x31')]['findAll']({'where':{'type':_0x4fcd3a[_0x278f('0x34')]},'raw':!![]});}})['then'](function(_0x30f4d8){if(_0x4fcd3a[_0x278f('0x34')][_0x278f('0x51')]()==_0x278f('0x52')){var _0x234d63=fs[_0x278f('0x53')](path[_0x278f('0x59')](config['root'],_0x278f('0x66')),_0x278f('0x55'));var _0x477ceb=ejs[_0x278f('0x56')](_0x234d63,{'networks':_0x30f4d8||[]});fs['writeFileSync'](_0x278f('0x63'),_0x477ceb);return respondWithRpcPromise(_0x278f('0x57'),_0x278f('0x65'),{'module':_0x278f('0x5d')});}else if(_0x4fcd3a[_0x278f('0x34')]['toUpperCase']()==_0x278f('0x58')){var _0x4b6c08=fs[_0x278f('0x53')](path[_0x278f('0x59')](config[_0x278f('0x54')],'server/files/templates/turn_multiple.ejs'),_0x278f('0x55'));var _0x18f115=ejs[_0x278f('0x56')](_0x4b6c08,{'networks':_0x30f4d8||[]});fs[_0x278f('0x5b')](_0x278f('0x5c'),_0x18f115);return respondWithRpcPromise(_0x278f('0x57'),_0x278f('0x65'),{'module':'res_stun_monitor.so'});}else{var _0x56421a=fs[_0x278f('0x53')](path[_0x278f('0x59')](config[_0x278f('0x54')],_0x278f('0x5e')),_0x278f('0x55'));var _0x390fe2=ejs[_0x278f('0x56')](_0x56421a,{'networks':_0x30f4d8||[]});fs[_0x278f('0x5b')](util[_0x278f('0x5f')](_0x278f('0x64'),_0x36a21c[_0x278f('0x50')][_0x278f('0x34')]['toLowerCase']()),_0x390fe2);return respondWithRpcPromise(_0x278f('0x57'),_0x278f('0x65'),{'module':'chan_sip.so'});}return null;})[_0x278f('0x22')](handleError(_0xa8b498,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 1fdd497..74b1158 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 _0xe51c=['./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe51c,0x1e1));var _0xce51=function(_0x37b999,_0x10aa46){_0x37b999=_0x37b999-0x0;var _0x20db5d=_0xe51c[_0x37b999];return _0x20db5d;};'use strict';var _=require(_0xce51('0x0'));var util=require(_0xce51('0x1'));var logger=require(_0xce51('0x2'))(_0xce51('0x3'));var moment=require(_0xce51('0x4'));var BPromise=require(_0xce51('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce51('0x6'));var rimraf=require(_0xce51('0x7'));var config=require(_0xce51('0x8'));var attributes=require(_0xce51('0x9'));module[_0xce51('0xa')]=function(_0x517926,_0x30a8fd){return _0x517926[_0xce51('0xb')](_0xce51('0xc'),attributes,{'tableName':_0xce51('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7489=['moment','request-promise','path','rimraf','../../config/environment','./network.attributes','define','network','lodash','../../config/logger','api'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x7489,0xfa));var _0x9748=function(_0x437620,_0x74fc19){_0x437620=_0x437620-0x0;var _0x66bca=_0x7489[_0x437620];return _0x66bca;};'use strict';var _=require(_0x9748('0x0'));var util=require('util');var logger=require(_0x9748('0x1'))(_0x9748('0x2'));var moment=require(_0x9748('0x3'));var BPromise=require('bluebird');var rp=require(_0x9748('0x4'));var fs=require('fs');var path=require(_0x9748('0x5'));var rimraf=require(_0x9748('0x6'));var config=require(_0x9748('0x7'));var attributes=require(_0x9748('0x8'));module['exports']=function(_0x21c435,_0x226c78){return _0x21c435[_0x9748('0x9')]('Network',attributes,{'tableName':_0x9748('0xa'),'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 4452a3e..94b8bff 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 _0x2e26=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x288b32,_0xe24431){var _0x28fbc4=function(_0x424f84){while(--_0x424f84){_0x288b32['push'](_0x288b32['shift']());}};_0x28fbc4(++_0xe24431);}(_0x2e26,0x80));var _0x62e2=function(_0x2390cc,_0x52baaa){_0x2390cc=_0x2390cc-0x0;var _0x227be9=_0x2e26[_0x2390cc];return _0x227be9;};'use strict';var _=require(_0x62e2('0x0'));var util=require(_0x62e2('0x1'));var moment=require(_0x62e2('0x2'));var BPromise=require(_0x62e2('0x3'));var rs=require(_0x62e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62e2('0x5'))['db'];var utils=require(_0x62e2('0x6'));var logger=require(_0x62e2('0x7'))('rpc');var config=require(_0x62e2('0x8'));var jayson=require(_0x62e2('0x9'));var client=jayson[_0x62e2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bd964,_0x29f3ac,_0x20805f){return new BPromise(function(_0x6ed82,_0x4b6e02){return client['request'](_0x3bd964,_0x20805f)[_0x62e2('0xb')](function(_0x28b7f4){logger[_0x62e2('0xc')](_0x62e2('0xd'),_0x29f3ac,_0x62e2('0xe'));logger['debug'](_0x62e2('0xf'),_0x29f3ac,_0x62e2('0xe'),JSON[_0x62e2('0x10')](_0x28b7f4));if(_0x28b7f4[_0x62e2('0x11')]){if(_0x28b7f4[_0x62e2('0x11')][_0x62e2('0x12')]===0x1f4){logger['error'](_0x62e2('0xd'),_0x29f3ac,_0x28b7f4[_0x62e2('0x11')]['message']);return _0x4b6e02(_0x28b7f4[_0x62e2('0x11')][_0x62e2('0x13')]);}logger['error'](_0x62e2('0xd'),_0x29f3ac,_0x28b7f4[_0x62e2('0x11')][_0x62e2('0x13')]);return _0x6ed82(_0x28b7f4[_0x62e2('0x11')][_0x62e2('0x13')]);}else{logger[_0x62e2('0xc')](_0x62e2('0xd'),_0x29f3ac,_0x62e2('0xe'));_0x6ed82(_0x28b7f4[_0x62e2('0x14')]['message']);}})['catch'](function(_0x19481f){logger[_0x62e2('0x11')]('Network,\x20%s,\x20%s',_0x29f3ac,_0x19481f);_0x4b6e02(_0x19481f);});});} \ No newline at end of file +var _0x918e=['randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird'];(function(_0xee2e7a,_0x58354d){var _0x319dd3=function(_0xa99240){while(--_0xa99240){_0xee2e7a['push'](_0xee2e7a['shift']());}};_0x319dd3(++_0x58354d);}(_0x918e,0xed));var _0xe918=function(_0x42337d,_0x571068){_0x42337d=_0x42337d-0x0;var _0x3d8990=_0x918e[_0x42337d];return _0x3d8990;};'use strict';var _=require('lodash');var util=require(_0xe918('0x0'));var moment=require(_0xe918('0x1'));var BPromise=require(_0xe918('0x2'));var rs=require(_0xe918('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe918('0x4'));var logger=require(_0xe918('0x5'))('rpc');var config=require(_0xe918('0x6'));var jayson=require(_0xe918('0x7'));var client=jayson[_0xe918('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2afc4c,_0x706b6d,_0x9885ef){return new BPromise(function(_0x5771d7,_0x5bb31a){return client['request'](_0x2afc4c,_0x9885ef)['then'](function(_0x1c4484){logger['info']('Network,\x20%s,\x20%s',_0x706b6d,'request\x20sent');logger[_0xe918('0x9')](_0xe918('0xa'),_0x706b6d,_0xe918('0xb'),JSON[_0xe918('0xc')](_0x1c4484));if(_0x1c4484[_0xe918('0xd')]){if(_0x1c4484[_0xe918('0xd')][_0xe918('0xe')]===0x1f4){logger[_0xe918('0xd')](_0xe918('0xf'),_0x706b6d,_0x1c4484['error'][_0xe918('0x10')]);return _0x5bb31a(_0x1c4484[_0xe918('0xd')][_0xe918('0x10')]);}logger[_0xe918('0xd')](_0xe918('0xf'),_0x706b6d,_0x1c4484[_0xe918('0xd')]['message']);return _0x5771d7(_0x1c4484[_0xe918('0xd')][_0xe918('0x10')]);}else{logger[_0xe918('0x11')]('Network,\x20%s,\x20%s',_0x706b6d,_0xe918('0xb'));_0x5771d7(_0x1c4484[_0xe918('0x12')][_0xe918('0x10')]);}})[_0xe918('0x13')](function(_0x4a972f){logger[_0xe918('0xd')](_0xe918('0xf'),_0x706b6d,_0x4a972f);_0x5bb31a(_0x4a972f);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 5e6f44a..39e1c22 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 _0x66d5=['/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','/:id/notify','notify','addAgents','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','describe','show','getDispositions'];(function(_0x5bc0a4,_0x54c07c){var _0x572a87=function(_0x200cd4){while(--_0x200cd4){_0x5bc0a4['push'](_0x5bc0a4['shift']());}};_0x572a87(++_0x54c07c);}(_0x66d5,0x1f4));var _0x566d=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0x66d5[_0x4c9f6a];return _0x5df5b9;};'use strict';var multer=require(_0x566d('0x0'));var util=require(_0x566d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x566d('0x2'));var router=express[_0x566d('0x3')]();var auth=require(_0x566d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x566d('0x5'));var controller=require(_0x566d('0x6'));router[_0x566d('0x7')]('/',auth[_0x566d('0x8')](),controller['index']);router[_0x566d('0x7')]('/describe',auth[_0x566d('0x8')](),controller[_0x566d('0x9')]);router[_0x566d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x566d('0xa')]);router[_0x566d('0x7')]('/:id/dispositions',auth[_0x566d('0x8')](),controller[_0x566d('0xb')]);router[_0x566d('0x7')](_0x566d('0xc'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x566d('0x7')](_0x566d('0xd'),auth[_0x566d('0x8')](),controller[_0x566d('0xe')]);router[_0x566d('0x7')](_0x566d('0xf'),auth[_0x566d('0x8')](),controller['getInteractions']);router[_0x566d('0x7')](_0x566d('0x10'),auth['isAuthenticated'](),controller[_0x566d('0x11')]);router[_0x566d('0x12')]('/',auth['isAuthenticated'](),controller[_0x566d('0x13')]);router['post'](_0x566d('0x14'),auth[_0x566d('0x8')](),controller['addDisposition']);router[_0x566d('0x12')](_0x566d('0xc'),auth['isAuthenticated'](),controller[_0x566d('0x15')]);router[_0x566d('0x12')](_0x566d('0x16'),controller[_0x566d('0x17')]);router['post'](_0x566d('0xd'),auth[_0x566d('0x8')](),controller['addApplications']);router['post'](_0x566d('0x10'),auth[_0x566d('0x8')](),controller[_0x566d('0x18')]);router[_0x566d('0x12')]('/:id/send',auth[_0x566d('0x8')](),controller['send']);router['put']('/:id',auth[_0x566d('0x8')](),controller['update']);router[_0x566d('0x19')](_0x566d('0x1a'),auth[_0x566d('0x8')](),controller[_0x566d('0x1b')]);router[_0x566d('0x19')](_0x566d('0x14'),auth['isAuthenticated'](),controller[_0x566d('0x1c')]);router['delete'](_0x566d('0xc'),auth['isAuthenticated'](),controller[_0x566d('0x1d')]);router['delete']('/:id/users',auth[_0x566d('0x8')](),controller[_0x566d('0x1e')]);module[_0x566d('0x1f')]=router; \ No newline at end of file +var _0x41b3=['multer','express','Router','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getAnswers','getApplications','/:id/interactions','post','create','addDisposition','/:id/canned_answers','addAnswer','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','update','delete','removeAnswers','/:id/users','removeAgents','exports'];(function(_0x417b5d,_0x521fcb){var _0x342a0a=function(_0xa5413e){while(--_0xa5413e){_0x417b5d['push'](_0x417b5d['shift']());}};_0x342a0a(++_0x521fcb);}(_0x41b3,0x1e0));var _0x341b=function(_0x16cc38,_0x70a85e){_0x16cc38=_0x16cc38-0x0;var _0x4839d9=_0x41b3[_0x16cc38];return _0x4839d9;};'use strict';var multer=require(_0x341b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x341b('0x1'));var router=express[_0x341b('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x341b('0x3'));var config=require('../../config/environment');var controller=require(_0x341b('0x4'));router[_0x341b('0x5')]('/',auth[_0x341b('0x6')](),controller[_0x341b('0x7')]);router[_0x341b('0x5')]('/describe',auth[_0x341b('0x6')](),controller['describe']);router[_0x341b('0x5')](_0x341b('0x8'),auth[_0x341b('0x6')](),controller[_0x341b('0x9')]);router[_0x341b('0x5')](_0x341b('0xa'),auth[_0x341b('0x6')](),controller['getDispositions']);router[_0x341b('0x5')]('/:id/canned_answers',auth[_0x341b('0x6')](),controller[_0x341b('0xb')]);router[_0x341b('0x5')]('/:id/applications',auth[_0x341b('0x6')](),controller[_0x341b('0xc')]);router['get'](_0x341b('0xd'),auth[_0x341b('0x6')](),controller['getInteractions']);router[_0x341b('0x5')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x341b('0xe')]('/',auth[_0x341b('0x6')](),controller[_0x341b('0xf')]);router[_0x341b('0xe')](_0x341b('0xa'),auth['isAuthenticated'](),controller[_0x341b('0x10')]);router[_0x341b('0xe')](_0x341b('0x11'),auth[_0x341b('0x6')](),controller[_0x341b('0x12')]);router[_0x341b('0xe')]('/:id/notify',controller[_0x341b('0x13')]);router[_0x341b('0xe')](_0x341b('0x14'),auth[_0x341b('0x6')](),controller[_0x341b('0x15')]);router['post']('/:id/users',auth[_0x341b('0x6')](),controller[_0x341b('0x16')]);router[_0x341b('0xe')](_0x341b('0x17'),auth[_0x341b('0x6')](),controller[_0x341b('0x18')]);router[_0x341b('0x19')](_0x341b('0x8'),auth['isAuthenticated'](),controller[_0x341b('0x1a')]);router[_0x341b('0x1b')](_0x341b('0x8'),auth[_0x341b('0x6')](),controller['destroy']);router[_0x341b('0x1b')](_0x341b('0xa'),auth[_0x341b('0x6')](),controller['removeDispositions']);router[_0x341b('0x1b')](_0x341b('0x11'),auth[_0x341b('0x6')](),controller[_0x341b('0x1c')]);router['delete'](_0x341b('0x1d'),auth[_0x341b('0x6')](),controller[_0x341b('0x1e')]);module[_0x341b('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index e004432..965ab40 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 _0x7c2f=['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','mandatoryDisposition','sequelize','randomstring','STRING','name','generate'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7c2f,0x119));var _0xf7c2=function(_0x3b6baf,_0xa0f21){_0x3b6baf=_0x3b6baf-0x0;var _0x3d4dd2=_0x7c2f[_0x3b6baf];return _0x3d4dd2;};'use strict';var Sequelize=require(_0xf7c2('0x0'));var rs=require(_0xf7c2('0x1'));module['exports']={'name':{'type':Sequelize[_0xf7c2('0x2')],'unique':_0xf7c2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xf7c2('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf7c2('0x4')]();}},'replyUri':{'type':Sequelize[_0xf7c2('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf7c2('0x5')],'defaultValue':function(){return _0xf7c2('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf7c2('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf7c2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf7c2('0x2')]},'queueTransfer':{'type':Sequelize[_0xf7c2('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf7c2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf7c2('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf7c2('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xf7c2('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xf7c2('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b8721){if(!_0x1b8721)this[_0xf7c2('0xa')](_0xf7c2('0xb'),null);this['setDataValue'](_0xf7c2('0xc'),_0x1b8721);}}}; \ No newline at end of file +var _0x1de8=['generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x43ddee,_0x12859b){var _0x301c72=function(_0x4c582b){while(--_0x4c582b){_0x43ddee['push'](_0x43ddee['shift']());}};_0x301c72(++_0x12859b);}(_0x1de8,0x70));var _0x81de=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0x1de8[_0x1a8bbc];return _0x212fc2;};'use strict';var Sequelize=require(_0x81de('0x0'));var rs=require(_0x81de('0x1'));module[_0x81de('0x2')]={'name':{'type':Sequelize[_0x81de('0x3')],'unique':_0x81de('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x81de('0x3')]},'token':{'type':Sequelize[_0x81de('0x3')],'defaultValue':function(){return rs[_0x81de('0x5')]();}},'replyUri':{'type':Sequelize[_0x81de('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x81de('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x81de('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x81de('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x81de('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x81de('0x3')]},'queueTransfer':{'type':Sequelize[_0x81de('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x81de('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x81de('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x81de('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x81de('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x81de('0x6')],'defaultValue':![],'comment':_0x81de('0x9'),'set':function(_0x332837){if(!_0x332837)this[_0x81de('0xa')](_0x81de('0xb'),null);this[_0x81de('0xa')](_0x81de('0xc'),_0x332837);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 2c870f8..2979ce5 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 _0xb40b=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','removeAnswers','openchannel','difference','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','priority','asc','from','firstName','threadId','externalUrl','ContactId','messageId','interaction','created','autoclose','push','contact','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','EventManager','notify','addApplications','transaction','OpenchannelAccountId','bulkCreate','findAndCountAll','getApplications','getInteractions','OpenchannelInteraction','Contact','internal','Tag','color','tag','addAgents','omit','spread','emit','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','get','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x5dc7e8,_0x57674f){var _0x544471=function(_0x13b03e){while(--_0x13b03e){_0x5dc7e8['push'](_0x5dc7e8['shift']());}};_0x544471(++_0x57674f);}(_0xb40b,0x1da));var _0xbb40=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb40b[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbb40('0x0'));var rimraf=require(_0xbb40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb40('0x2'));var moment=require(_0xbb40('0x3'));var BPromise=require(_0xbb40('0x4'));var Mustache=require(_0xbb40('0x5'));var util=require(_0xbb40('0x6'));var path=require('path');var sox=require(_0xbb40('0x7'));var csv=require(_0xbb40('0x8'));var ejs=require(_0xbb40('0x9'));var fs=require('fs');var _=require(_0xbb40('0xa'));var squel=require(_0xbb40('0xb'));var crypto=require(_0xbb40('0xc'));var jsforce=require(_0xbb40('0xd'));var deskjs=require(_0xbb40('0xe'));var toCsv=require(_0xbb40('0x8'));var querystring=require(_0xbb40('0xf'));var Papa=require('papaparse');var Redis=require(_0xbb40('0x10'));var authService=require(_0xbb40('0x11'));var qs=require(_0xbb40('0x12'));var as=require(_0xbb40('0x13'));var hardwareService=require(_0xbb40('0x14'));var logger=require('../../config/logger')(_0xbb40('0x15'));var utils=require(_0xbb40('0x16'));var config=require(_0xbb40('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb40('0x18')]=_[_0xbb40('0x19')](config[_0xbb40('0x18')],{'host':_0xbb40('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb40('0x18')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xbb40('0x1b'));var client=jayson[_0xbb40('0x1c')][_0xbb40('0x1d')]({'port':0x232c});var client9002=jayson[_0xbb40('0x1c')][_0xbb40('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x17b0eb,_0x327c66,_0x5be5c6){if(_0x5be5c6){var _0x171b15=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x171b15[_0xbb40('0x1e')](_0x327c66)){return _0x17b0eb;}else{throw new db[(_0xbb40('0x1f'))][(_0xbb40('0x20'))](_0xbb40('0x21'));}}else{return _0x17b0eb;}}function respondWithRpcPromise(_0x37f74d,_0x2e5269,_0x226972,_0x35bd30){return new BPromise(function(_0x4a6251,_0x53743b){var _0x413c73=_0x35bd30||client;return _0x413c73[_0xbb40('0x22')](_0x37f74d,_0x226972)['then'](function(_0x14d976){logger[_0xbb40('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x2e5269,_0xbb40('0x24'));logger[_0xbb40('0x25')](_0xbb40('0x26'),_0x2e5269,'request\x20sent',JSON[_0xbb40('0x27')](_0x14d976));if(_0x14d976[_0xbb40('0x28')]){if(_0x14d976[_0xbb40('0x28')][_0xbb40('0x29')]===0x1f4){logger[_0xbb40('0x28')](_0xbb40('0x2a'),_0x2e5269,_0x14d976[_0xbb40('0x28')]['message']);return _0x53743b(_0x14d976[_0xbb40('0x28')]['message']);}logger['error'](_0xbb40('0x2a'),_0x2e5269,_0x14d976[_0xbb40('0x28')][_0xbb40('0x2b')]);return _0x4a6251(_0x14d976[_0xbb40('0x28')][_0xbb40('0x2b')]);}else{logger[_0xbb40('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x2e5269,_0xbb40('0x24'));_0x4a6251(_0x14d976['result'][_0xbb40('0x2b')]);}})['catch'](function(_0x4ecf6f){logger[_0xbb40('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x2e5269,_0x4ecf6f);_0x53743b(_0x4ecf6f);});});}function respondWithStatusCode(_0x275a36,_0x9aa497){_0x9aa497=_0x9aa497||0xcc;return function(_0x46b3a2){if(_0x46b3a2){return _0x275a36[_0xbb40('0x2c')](_0x9aa497);}return _0x275a36[_0xbb40('0x2d')](_0x9aa497)[_0xbb40('0x2e')]();};}function respondWithResult(_0x3fe024,_0x2a9161){_0x2a9161=_0x2a9161||0xc8;return function(_0x586050){if(_0x586050){return _0x3fe024[_0xbb40('0x2d')](_0x2a9161)[_0xbb40('0x2f')](_0x586050);}};}function respondWithFilteredResult(_0x3915a5,_0x571926){return function(_0x1919ed){if(_0x1919ed){var _0x48954f=_0x1919ed[_0xbb40('0x30')],_0x27015c=_0x571926[_0xbb40('0x31')],_0x347ee2=_0x571926['offset']+_0x571926[_0xbb40('0x32')],_0x5c1477;if(_0x347ee2>=_0x48954f){_0x347ee2=_0x48954f;_0x5c1477=0xc8;}else{_0x5c1477=0xce;}_0x3915a5[_0xbb40('0x2d')](_0x5c1477);return _0x3915a5[_0xbb40('0x33')]('Content-Range',_0x27015c+'-'+_0x347ee2+'/'+_0x48954f)[_0xbb40('0x2f')](_0x1919ed);}return null;};}function patchUpdates(_0x375f35){return function(_0x3cee0d){try{jsonpatch['apply'](_0x3cee0d,_0x375f35,!![]);}catch(_0x20be04){return BPromise[_0xbb40('0x34')](_0x20be04);}return _0x3cee0d[_0xbb40('0x35')]();};}function saveUpdates(_0x4370f4,_0x57fa71){return function(_0x37e4b2){if(_0x37e4b2){return _0x37e4b2[_0xbb40('0x36')](_0x4370f4)['then'](function(_0x29237e){return _0x29237e;});}return null;};}function removeEntity(_0x270bd8,_0x12b16d){return function(_0x4fe26b){if(_0x4fe26b){return _0x4fe26b['destroy']()[_0xbb40('0x37')](function(){var _0x5cb631=_0x4fe26b[_0xbb40('0x38')]({'plain':!![]});var _0x15cfa1='OpenchannelAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x15cfa1,'resourceId':_0x5cb631['id']}})[_0xbb40('0x37')](function(){return _0x4fe26b;});})[_0xbb40('0x37')](function(){_0x270bd8[_0xbb40('0x2d')](0xcc)[_0xbb40('0x2e')]();});}};}function handleEntityNotFound(_0x55f012,_0x15c7ae){return function(_0x58ee06){if(!_0x58ee06){_0x55f012[_0xbb40('0x2c')](0x194);}return _0x58ee06;};}function handleError(_0x511041,_0x2fb340){_0x2fb340=_0x2fb340||0x1f4;return function(_0x195f58){logger['error'](_0x195f58['stack']);if(_0x195f58['name']){delete _0x195f58[_0xbb40('0x39')];}_0x511041[_0xbb40('0x2d')](_0x2fb340)[_0xbb40('0x3a')](_0x195f58);};}exports[_0xbb40('0x3b')]=function(_0x46a2dc,_0xd34b8d){var _0x51212a={'include':[{'model':db[_0xbb40('0x3c')],'as':_0xbb40('0x3d')}]},_0x4b2194={},_0x30c6ef={'count':0x0,'rows':[]};var _0x26eb79=_[_0xbb40('0x3e')](db[_0xbb40('0x3f')][_0xbb40('0x40')],function(_0x29a8bc){return{'name':_0x29a8bc['fieldName'],'type':_0x29a8bc[_0xbb40('0x41')][_0xbb40('0x42')]};});_0x4b2194[_0xbb40('0x43')]=_['map'](_0x26eb79,_0xbb40('0x39'));_0x4b2194[_0xbb40('0x44')]=_[_0xbb40('0x45')](_0x46a2dc[_0xbb40('0x44')]);_0x4b2194[_0xbb40('0x46')]=_[_0xbb40('0x47')](_0x4b2194[_0xbb40('0x43')],_0x4b2194['query']);_0x51212a[_0xbb40('0x48')]=_['intersection'](_0x4b2194['model'],qs[_0xbb40('0x49')](_0x46a2dc['query'][_0xbb40('0x49')]));_0x51212a['attributes']=_0x51212a[_0xbb40('0x48')][_0xbb40('0x4a')]?_0x51212a['attributes']:_0x4b2194['model'];if(!_0x46a2dc[_0xbb40('0x44')][_0xbb40('0x4b')](_0xbb40('0x4c'))){_0x51212a['limit']=qs[_0xbb40('0x32')](_0x46a2dc['query']['limit']);_0x51212a[_0xbb40('0x31')]=qs[_0xbb40('0x31')](_0x46a2dc[_0xbb40('0x44')][_0xbb40('0x31')]);}_0x51212a[_0xbb40('0x4d')]=qs[_0xbb40('0x4e')](_0x46a2dc['query'][_0xbb40('0x4e')]);_0x51212a['where']=qs['filters'](_[_0xbb40('0x4f')](_0x46a2dc[_0xbb40('0x44')],_0x4b2194['filters']));if(_0x46a2dc[_0xbb40('0x44')][_0xbb40('0x50')]){_0x51212a['where']=_[_0xbb40('0x51')](_0x51212a[_0xbb40('0x52')],{'$or':_[_0xbb40('0x3e')](_0x26eb79,function(_0x20d714){if(_0x20d714[_0xbb40('0x41')]!=='VIRTUAL'){var _0x2da33c={};_0x2da33c[_0x20d714['name']]={'$like':'%'+_0x46a2dc[_0xbb40('0x44')][_0xbb40('0x50')]+'%'};return _0x2da33c;}})});}_0x51212a=_[_0xbb40('0x51')]({},_0x51212a,_0x46a2dc['options']);var _0x2f50d1={'where':_0x51212a[_0xbb40('0x52')]};return db[_0xbb40('0x3f')][_0xbb40('0x30')](_0x2f50d1)[_0xbb40('0x37')](function(_0x1c8c37){_0x30c6ef[_0xbb40('0x30')]=_0x1c8c37;if(_0x46a2dc['query'][_0xbb40('0x53')]){_0x51212a[_0xbb40('0x54')]=[{'all':!![]}];}return db[_0xbb40('0x3f')][_0xbb40('0x55')](_0x51212a);})['then'](function(_0x57bc23){_0x30c6ef[_0xbb40('0x56')]=_0x57bc23;return _0x30c6ef;})[_0xbb40('0x37')](respondWithFilteredResult(_0xd34b8d,_0x51212a))[_0xbb40('0x57')](handleError(_0xd34b8d,null));};exports[_0xbb40('0x58')]=function(_0x50498e,_0x5e0894){var _0x3f79fe={'raw':![],'where':{'id':_0x50498e[_0xbb40('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xbb40('0x3d')}]},_0x2e17f1={};_0x2e17f1[_0xbb40('0x43')]=_['keys'](db[_0xbb40('0x3f')][_0xbb40('0x40')]);_0x2e17f1[_0xbb40('0x44')]=_[_0xbb40('0x45')](_0x50498e[_0xbb40('0x44')]);_0x2e17f1[_0xbb40('0x46')]=_[_0xbb40('0x47')](_0x2e17f1[_0xbb40('0x43')],_0x2e17f1[_0xbb40('0x44')]);_0x3f79fe[_0xbb40('0x48')]=_['intersection'](_0x2e17f1[_0xbb40('0x43')],qs[_0xbb40('0x49')](_0x50498e[_0xbb40('0x44')]['fields']));_0x3f79fe['attributes']=_0x3f79fe[_0xbb40('0x48')][_0xbb40('0x4a')]?_0x3f79fe[_0xbb40('0x48')]:_0x2e17f1[_0xbb40('0x43')];if(_0x50498e[_0xbb40('0x44')]['includeAll']){_0x3f79fe['include']=[{'all':!![]}];}_0x3f79fe=_['merge']({},_0x3f79fe,_0x50498e[_0xbb40('0x5a')]);return db[_0xbb40('0x3f')]['find'](_0x3f79fe)[_0xbb40('0x37')](handleEntityNotFound(_0x5e0894,null))[_0xbb40('0x37')](respondWithResult(_0x5e0894,null))[_0xbb40('0x57')](handleError(_0x5e0894,null));};exports[_0xbb40('0x5b')]=function(_0x27167c,_0x12c2f4){return db[_0xbb40('0x3f')]['create'](_0x27167c[_0xbb40('0x5c')],{})['then'](function(_0x1871fa){var _0x13f7af=_0x27167c[_0xbb40('0x5d')][_0xbb40('0x38')]({'plain':!![]});if(!_0x13f7af)throw new Error(_0xbb40('0x5e'));if(_0x13f7af[_0xbb40('0x5f')]===_0xbb40('0x5d')){var _0x3a5e11=_0x1871fa[_0xbb40('0x38')]({'plain':!![]});var _0x1f57fe=_0xbb40('0x60');return db[_0xbb40('0x61')]['find']({'where':{'name':_0x1f57fe,'userProfileId':_0x13f7af[_0xbb40('0x62')]},'raw':!![]})[_0xbb40('0x37')](function(_0x2c85fe){if(_0x2c85fe&&_0x2c85fe['autoAssociation']===0x0){return db[_0xbb40('0x63')][_0xbb40('0x5b')]({'name':_0x3a5e11[_0xbb40('0x39')],'resourceId':_0x3a5e11['id'],'type':_0x2c85fe['name'],'sectionId':_0x2c85fe['id']},{})[_0xbb40('0x37')](function(){return _0x1871fa;});}else{return _0x1871fa;}})[_0xbb40('0x57')](function(_0x51d9a4){logger[_0xbb40('0x28')](_0xbb40('0x64'),_0x51d9a4);throw _0x51d9a4;});}return _0x1871fa;})[_0xbb40('0x37')](respondWithResult(_0x12c2f4,0xc9))[_0xbb40('0x57')](handleError(_0x12c2f4,null));};exports['update']=function(_0x364d42,_0x1ade12){if(_0x364d42[_0xbb40('0x5c')]['id']){delete _0x364d42['body']['id'];}return db[_0xbb40('0x3f')][_0xbb40('0x65')]({'where':{'id':_0x364d42[_0xbb40('0x59')]['id']},'include':[{'model':db[_0xbb40('0x3c')],'as':_0xbb40('0x3d')}]})[_0xbb40('0x37')](handleEntityNotFound(_0x1ade12,null))['then'](saveUpdates(_0x364d42['body'],null))[_0xbb40('0x37')](respondWithResult(_0x1ade12,null))['catch'](handleError(_0x1ade12,null));};exports[_0xbb40('0x66')]=function(_0x5bb3a4,_0x1eae89){return db[_0xbb40('0x3f')][_0xbb40('0x65')]({'where':{'id':_0x5bb3a4[_0xbb40('0x59')]['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x1eae89,null))[_0xbb40('0x37')](removeEntity(_0x1eae89,null))[_0xbb40('0x57')](handleError(_0x1eae89,null));};exports[_0xbb40('0x67')]=function(_0x547a81,_0x4ca6f5){return db[_0xbb40('0x3f')][_0xbb40('0x67')]()[_0xbb40('0x37')](respondWithResult(_0x4ca6f5,null))[_0xbb40('0x57')](handleError(_0x4ca6f5,null));};exports[_0xbb40('0x68')]=function(_0x43222e,_0x29f39c,_0x40a216){if(_0x43222e[_0xbb40('0x5c')]['id']){delete _0x43222e['body']['id'];}return db['OpenchannelAccount'][_0xbb40('0x65')]({'where':{'id':_0x43222e['params']['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x29f39c,null))[_0xbb40('0x37')](function(_0x520011){if(_0x520011){_0x43222e['body'][_0xbb40('0x69')]=_0x520011['id'];return db[_0xbb40('0x6a')][_0xbb40('0x5b')](_0x43222e[_0xbb40('0x5c')]);}})['then'](respondWithResult(_0x29f39c,null))[_0xbb40('0x57')](handleError(_0x29f39c,null));};exports[_0xbb40('0x6b')]=function(_0x3f2172,_0x279a9c,_0x4cd8ad){var _0x705b9b={'raw':![],'where':{}};var _0x461a15={};var _0x153051={'count':0x0,'rows':[]};return db[_0xbb40('0x3f')][_0xbb40('0x6c')]({'where':{'id':_0x3f2172[_0xbb40('0x59')]['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x279a9c,null))[_0xbb40('0x37')](function(_0x10dbf9){if(_0x10dbf9){_0x461a15['model']=_['keys'](db['Disposition'][_0xbb40('0x40')]);_0x461a15['query']=_[_0xbb40('0x45')](_0x3f2172[_0xbb40('0x44')]);_0x461a15[_0xbb40('0x46')]=_['intersection'](_0x461a15[_0xbb40('0x43')],_0x461a15[_0xbb40('0x44')]);_0x705b9b[_0xbb40('0x48')]=_[_0xbb40('0x47')](_0x461a15[_0xbb40('0x43')],qs['fields'](_0x3f2172[_0xbb40('0x44')][_0xbb40('0x49')]));_0x705b9b[_0xbb40('0x48')]=_0x705b9b[_0xbb40('0x48')][_0xbb40('0x4a')]?_0x705b9b['attributes']:_0x461a15[_0xbb40('0x43')];if(!_0x3f2172[_0xbb40('0x44')]['hasOwnProperty'](_0xbb40('0x4c'))){_0x705b9b['limit']=qs[_0xbb40('0x32')](_0x3f2172[_0xbb40('0x44')][_0xbb40('0x32')]);_0x705b9b['offset']=qs[_0xbb40('0x31')](_0x3f2172[_0xbb40('0x44')]['offset']);}_0x705b9b[_0xbb40('0x4d')]=qs[_0xbb40('0x4e')](_0x3f2172[_0xbb40('0x44')]['sort']);_0x705b9b[_0xbb40('0x52')]=qs[_0xbb40('0x46')](_['pick'](_0x3f2172[_0xbb40('0x44')],_0x461a15[_0xbb40('0x46')]));_0x705b9b[_0xbb40('0x52')]['OpenchannelAccountId']=_0x10dbf9['id'];if(_0x3f2172[_0xbb40('0x44')][_0xbb40('0x50')]){_0x705b9b[_0xbb40('0x52')]=_[_0xbb40('0x51')](_0x705b9b[_0xbb40('0x52')],{'$or':_['map'](_0x705b9b['attributes'],function(_0x342287){var _0x24d48b={};_0x24d48b[_0x342287]={'$like':'%'+_0x3f2172[_0xbb40('0x44')]['filter']+'%'};return _0x24d48b;})});}_0x705b9b=_['merge']({},_0x705b9b,_0x3f2172['options']);return db['Disposition']['count']({'where':_0x705b9b['where']})[_0xbb40('0x37')](function(_0x1e9e0a){_0x153051[_0xbb40('0x30')]=_0x1e9e0a;if(_0x3f2172[_0xbb40('0x44')]['includeAll']){_0x705b9b['include']=[{'all':!![]}];}return db[_0xbb40('0x6a')]['findAll'](_0x705b9b);})['then'](function(_0x3ba0f5){_0x153051[_0xbb40('0x56')]=_0x3ba0f5;return _0x153051;});}})[_0xbb40('0x37')](respondWithFilteredResult(_0x279a9c,_0x705b9b))['catch'](handleError(_0x279a9c,null));};exports[_0xbb40('0x6d')]=function(_0x1876a9,_0x61f65a,_0x3905a9){return db[_0xbb40('0x3f')]['find']({'where':{'id':_0x1876a9[_0xbb40('0x59')]['id']}})['then'](handleEntityNotFound(_0x61f65a,null))['then'](function(_0x566687){if(_0x566687){return _0x566687[_0xbb40('0x6d')](_0x1876a9['query'][_0xbb40('0x6e')]);}})[_0xbb40('0x37')](respondWithStatusCode(_0x61f65a,null))['catch'](handleError(_0x61f65a,null));};exports['addAnswer']=function(_0x486e11,_0x4e7b2c,_0x3b8f71){if(_0x486e11[_0xbb40('0x5c')]['id']){delete _0x486e11['body']['id'];}return db[_0xbb40('0x3f')]['find']({'where':{'id':_0x486e11['params']['id']}})['then'](handleEntityNotFound(_0x4e7b2c,null))[_0xbb40('0x37')](function(_0x5261ea){if(_0x5261ea){_0x486e11['body']['OpenchannelAccountId']=_0x5261ea['id'];return db['CannedAnswer']['create'](_0x486e11['body']);}})['then'](respondWithResult(_0x4e7b2c,null))[_0xbb40('0x57')](handleError(_0x4e7b2c,null));};exports['getAnswers']=function(_0x4025ef,_0x1d004f,_0x370ade){var _0x5675bf={'raw':![],'where':{}};var _0x564f7b={};var _0x2e8595={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xbb40('0x6c')]({'where':{'id':_0x4025ef[_0xbb40('0x59')]['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x1d004f,null))['then'](function(_0x31494c){if(_0x31494c){_0x564f7b[_0xbb40('0x43')]=_[_0xbb40('0x45')](db[_0xbb40('0x6f')][_0xbb40('0x40')]);_0x564f7b[_0xbb40('0x44')]=_[_0xbb40('0x45')](_0x4025ef['query']);_0x564f7b['filters']=_['intersection'](_0x564f7b['model'],_0x564f7b[_0xbb40('0x44')]);_0x5675bf['attributes']=_[_0xbb40('0x47')](_0x564f7b['model'],qs[_0xbb40('0x49')](_0x4025ef['query']['fields']));_0x5675bf[_0xbb40('0x48')]=_0x5675bf[_0xbb40('0x48')]['length']?_0x5675bf[_0xbb40('0x48')]:_0x564f7b[_0xbb40('0x43')];if(!_0x4025ef[_0xbb40('0x44')][_0xbb40('0x4b')](_0xbb40('0x4c'))){_0x5675bf[_0xbb40('0x32')]=qs[_0xbb40('0x32')](_0x4025ef[_0xbb40('0x44')][_0xbb40('0x32')]);_0x5675bf[_0xbb40('0x31')]=qs[_0xbb40('0x31')](_0x4025ef[_0xbb40('0x44')][_0xbb40('0x31')]);}_0x5675bf[_0xbb40('0x4d')]=qs[_0xbb40('0x4e')](_0x4025ef[_0xbb40('0x44')]['sort']);_0x5675bf[_0xbb40('0x52')]=qs['filters'](_[_0xbb40('0x4f')](_0x4025ef['query'],_0x564f7b[_0xbb40('0x46')]));_0x5675bf[_0xbb40('0x52')]['OpenchannelAccountId']=_0x31494c['id'];if(_0x4025ef[_0xbb40('0x44')]['filter']){_0x5675bf['where']=_['merge'](_0x5675bf['where'],{'$or':_[_0xbb40('0x3e')](_0x5675bf[_0xbb40('0x48')],function(_0x4745f5){var _0x3a7225={};_0x3a7225[_0x4745f5]={'$like':'%'+_0x4025ef['query'][_0xbb40('0x50')]+'%'};return _0x3a7225;})});}_0x5675bf=_[_0xbb40('0x51')]({},_0x5675bf,_0x4025ef[_0xbb40('0x5a')]);return db[_0xbb40('0x6f')][_0xbb40('0x30')]({'where':_0x5675bf[_0xbb40('0x52')]})['then'](function(_0xed5d10){_0x2e8595['count']=_0xed5d10;if(_0x4025ef[_0xbb40('0x44')]['includeAll']){_0x5675bf[_0xbb40('0x54')]=[{'all':!![]}];}return db[_0xbb40('0x6f')]['findAll'](_0x5675bf);})[_0xbb40('0x37')](function(_0x16a988){_0x2e8595[_0xbb40('0x56')]=_0x16a988;return _0x2e8595;});}})[_0xbb40('0x37')](respondWithFilteredResult(_0x1d004f,_0x5675bf))[_0xbb40('0x57')](handleError(_0x1d004f,null));};exports[_0xbb40('0x70')]=function(_0xf8a434,_0x1705c7,_0x170ca0){return db['OpenchannelAccount'][_0xbb40('0x65')]({'where':{'id':_0xf8a434[_0xbb40('0x59')]['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x1705c7,null))[_0xbb40('0x37')](function(_0x141e59){if(_0x141e59){return _0x141e59[_0xbb40('0x70')](_0xf8a434[_0xbb40('0x44')][_0xbb40('0x6e')]);}})[_0xbb40('0x37')](respondWithStatusCode(_0x1705c7,null))[_0xbb40('0x57')](handleError(_0x1705c7,null));};exports['notify']=function(_0x3829ab,_0x56a43a,_0x44c2a2){var _0x128126={'body':_0x3829ab[_0xbb40('0x5c')],'channel':_0xbb40('0x71')};var _0x4a6b18=[];var _0xd87a72=[];var _0x4c784d={};var _0x255eac=![];return db['CmContact'][_0xbb40('0x67')]()[_0xbb40('0x37')](function(_0x3697e1){if(!_0x3697e1){throw new db[(_0xbb40('0x1f'))][(_0xbb40('0x20'))]('no\x20available\x20attributes');}_0x4a6b18=_[_0xbb40('0x72')](_['keys'](_0x3697e1),['createdAt','updatedAt']);_0xd87a72=_[_0xbb40('0x72')](_[_0xbb40('0x45')](_0x3697e1),['createdAt',_0xbb40('0x73'),_0xbb40('0x74'),_0xbb40('0x75')]);if(_0x3829ab[_0xbb40('0x5c')]['id']){delete _0x3829ab['body']['id'];}if(_['isNil'](_0x3829ab[_0xbb40('0x5c')]['from'])){throw new db[(_0xbb40('0x1f'))][(_0xbb40('0x20'))](_0xbb40('0x76'));}if(_['isNil'](_0x3829ab[_0xbb40('0x5c')][_0xbb40('0x5c')])||_0x3829ab[_0xbb40('0x5c')][_0xbb40('0x5c')]===''){throw new db[(_0xbb40('0x1f'))][(_0xbb40('0x20'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbb40('0x77')](_0x3829ab['body'][_0xbb40('0x78')])){throw new db[(_0xbb40('0x1f'))][(_0xbb40('0x20'))](_0xbb40('0x79')+_0xd87a72);}if(!_[_0xbb40('0x7a')](_0xd87a72,_0x3829ab[_0xbb40('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0xbb40('0x20'))](_0xbb40('0x7b')+_0xd87a72);}_0x4c784d[_0x3829ab[_0xbb40('0x5c')]['mapKey']]=_0x3829ab[_0xbb40('0x5c')]['from'];})[_0xbb40('0x37')](function(){return db[_0xbb40('0x3f')][_0xbb40('0x65')]({'where':{'id':_0x3829ab[_0xbb40('0x59')]['id']},'include':[{'model':db[_0xbb40('0x7c')],'as':_0xbb40('0x7d'),'include':[{'model':db[_0xbb40('0x7e')],'as':_0xbb40('0x7f'),'where':_0x4c784d,'limit':0x1,'order':[[_0xbb40('0x73'),_0xbb40('0x80')]]}]},{'model':db[_0xbb40('0x81')],'as':_0xbb40('0x82')}]});})[_0xbb40('0x37')](handleEntityNotFound(_0x56a43a,null))[_0xbb40('0x37')](function(_0x9cd62c){if(_0x9cd62c&&_0x9cd62c['List']){_0x128126[_0xbb40('0x83')]=_0x9cd62c;_0x128126[_0xbb40('0x84')]=_0x9cd62c['Applications'];_0x128126['list']=_0x9cd62c[_0xbb40('0x7d')];_0x128126['applications']=_['orderBy'](_0x128126[_0xbb40('0x84')],[_0xbb40('0x85')],[_0xbb40('0x86')]);if(_0x128126['account'][_0xbb40('0x82')]){delete _0x128126[_0xbb40('0x83')]['Applications'];}if(_0x128126['account'][_0xbb40('0x7d')]&&_0x128126['account'][_0xbb40('0x7d')][_0xbb40('0x7f')][_0xbb40('0x4a')]){return _0x128126[_0xbb40('0x83')][_0xbb40('0x7d')][_0xbb40('0x7f')][0x0];}var _0x456e72=_[_0xbb40('0x19')](_0x3829ab[_0xbb40('0x5c')],{'firstName':_0x3829ab['body'][_0xbb40('0x87')],'ListId':_0x9cd62c[_0xbb40('0x75')]});_0x456e72[_0x3829ab[_0xbb40('0x5c')]['mapKey']]=_0x3829ab[_0xbb40('0x5c')]['from'];return db[_0xbb40('0x7e')]['create'](_0x456e72,{'fields':_0x4a6b18,'raw':!![]});}})[_0xbb40('0x37')](handleEntityNotFound(_0x56a43a,null))['then'](function(_0x39a750){_0x128126['contact']=_0x39a750;if(_0x39a750){var _0x1d9bbc={'ContactId':_0x39a750['id'],'OpenchannelAccountId':_0x3829ab[_0xbb40('0x59')]['id'],'from':(_0x39a750[_0xbb40('0x88')]||'')+'\x20'+(_0x39a750['lastName']||'')};var _0x1ced67={'OpenchannelAccountId':_0x3829ab[_0xbb40('0x59')]['id'],'closed':![]};if(_0x3829ab[_0xbb40('0x5c')]['threadId']){_0x1ced67[_0xbb40('0x89')]=_0x3829ab[_0xbb40('0x5c')]['threadId'];return db['OpenchannelInteraction'][_0xbb40('0x65')]({'where':_0x1ced67})[_0xbb40('0x37')](function(_0x240746){if(_0x240746){return[_0x240746,![]];}_0x1d9bbc[_0xbb40('0x89')]=_0x3829ab[_0xbb40('0x5c')]['threadId'];_0x1d9bbc['externalUrl']=_0x3829ab[_0xbb40('0x5c')][_0xbb40('0x8a')];return db['OpenchannelInteraction'][_0xbb40('0x5b')](_0x1d9bbc)[_0xbb40('0x37')](function(_0x58e29b){return[_0x58e29b,!![]];});});}else{_0x1ced67[_0xbb40('0x89')]=null;}_0x1ced67[_0xbb40('0x8b')]=_0x39a750['id'];return db['OpenchannelInteraction'][_0xbb40('0x65')]({'where':_0x1ced67})[_0xbb40('0x37')](function(_0x31885c){if(_0x31885c){return[_0x31885c,![]];}return db['OpenchannelInteraction'][_0xbb40('0x5b')](_0x1d9bbc)[_0xbb40('0x37')](function(_0x45a97f){return[_0x45a97f,!![]];});});}})['spread'](function(_0x2205f0,_0x3ab3db){if(_0x2205f0){_0x255eac=_0x3ab3db;if(!_0x3ab3db){var _0x3a5f0e={'from':(_0x128126['contact'][_0xbb40('0x88')]||'')+'\x20'+(_0x128126['contact']['lastName']||'')};if(_0x3829ab[_0xbb40('0x5c')]['threadId']&&_0x3829ab[_0xbb40('0x5c')][_0xbb40('0x8c')]&&_0x3829ab[_0xbb40('0x5c')][_0xbb40('0x89')]!=_0x3829ab[_0xbb40('0x5c')][_0xbb40('0x8c')]){_0x3a5f0e['threadId']=_0x3829ab[_0xbb40('0x5c')][_0xbb40('0x8c')];}return _0x2205f0[_0xbb40('0x36')](_0x3a5f0e);}else{return _0x2205f0;}}})[_0xbb40('0x37')](function(_0x1a018a){_0x128126[_0xbb40('0x8d')]=_0x1a018a[_0xbb40('0x38')]({'plain':!![]});_0x128126[_0xbb40('0x8d')]['created']=_0x255eac;if(_0x128126['interaction'][_0xbb40('0x8e')]){if(_0x128126[_0xbb40('0x83')][_0xbb40('0x8f')]){_0x128126[_0xbb40('0x84')][_0xbb40('0x90')]({'id':0x0,'priority':_0x128126['applications'][_0xbb40('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0xbb40('0x5b')]({'body':_0x3829ab[_0xbb40('0x5c')]['body'],'OpenchannelAccountId':_0x3829ab['params']['id'],'OpenchannelInteractionId':_0x1a018a['id'],'direction':'in','ContactId':_0x128126[_0xbb40('0x91')]['id'],'AttachmentId':_0x3829ab[_0xbb40('0x5c')][_0xbb40('0x92')]});})['then'](function(_0x571609){_0x128126[_0xbb40('0x2b')]=_0x571609;if(_0x128126[_0xbb40('0x8d')][_0xbb40('0x93')]){return db[_0xbb40('0x94')][_0xbb40('0x65')]({'attributes':['id',_0xbb40('0x39')],'where':{'id':_0x128126[_0xbb40('0x8d')]['UserId']}})['then'](function(_0xa8b17){if(_0xa8b17){_0x128126[_0xbb40('0x84')][_0xbb40('0x95')]({'id':0x0,'priority':0x0,'app':_0xbb40('0x96'),'appdata':_0xa8b17[_0xbb40('0x39')]+','+(_0x128126[_0xbb40('0x83')][_0xbb40('0x97')]||0xa),'interval':_0xbb40('0x98')});_0x128126['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0xbb40('0x99'),_0x128126);});}return respondWithRpcPromise(_0xbb40('0x9a'),'startRouting',_0x128126);})[_0xbb40('0x37')](function(_0x36539c){respondWithRpcPromise(_0xbb40('0x9b'),_0xbb40('0x9b'),{'event':_0xbb40('0x9c'),'message':_0x36539c},client9002);return _0x36539c;})[_0xbb40('0x37')](respondWithResult(_0x56a43a,null))['catch'](handleError(_0x56a43a,null));};exports[_0xbb40('0x9d')]=function(_0x15d99c,_0x4aaf2d,_0x4ccb64){return db[_0xbb40('0x3f')]['findOne']({'where':{'id':_0x15d99c[_0xbb40('0x59')]['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x4aaf2d,null))[_0xbb40('0x37')](function(_0x310ffa){if(_0x310ffa){return db['sequelize'][_0xbb40('0x9e')](function(_0x57cc9b){return db[_0xbb40('0x81')][_0xbb40('0x66')]({'where':{'OpenchannelAccountId':_0x15d99c[_0xbb40('0x59')]['id']},'transaction':_0x57cc9b})[_0xbb40('0x37')](function(_0x2491c3){var _0x2dd180=_['map'](_0x15d99c[_0xbb40('0x5c')],function(_0x2cb950){_0x2cb950[_0xbb40('0x9f')]=_0x15d99c['params']['id'];return _0x2cb950;});return db[_0xbb40('0x81')][_0xbb40('0xa0')](_0x2dd180,{'transaction':_0x57cc9b});});})['then'](function(){return db[_0xbb40('0x81')][_0xbb40('0xa1')]({'where':{'OpenchannelAccountId':_0x15d99c['params']['id']},'order':_0xbb40('0x85')});});}})[_0xbb40('0x37')](respondWithResult(_0x4aaf2d,null))[_0xbb40('0x57')](handleError(_0x4aaf2d,null));};exports[_0xbb40('0xa2')]=function(_0x67f1db,_0x15520b,_0x3f80bc){var _0x59af90={};var _0x29c406={};var _0x18bf50;var _0x10fc2e;return db[_0xbb40('0x3f')][_0xbb40('0x6c')]({'where':{'id':_0x67f1db[_0xbb40('0x59')]['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x15520b,null))[_0xbb40('0x37')](function(_0x58f420){if(_0x58f420){_0x18bf50=_0x58f420;_0x29c406[_0xbb40('0x43')]=_[_0xbb40('0x45')](db[_0xbb40('0x81')][_0xbb40('0x40')]);_0x29c406[_0xbb40('0x44')]=_[_0xbb40('0x45')](_0x67f1db['query']);_0x29c406[_0xbb40('0x46')]=_[_0xbb40('0x47')](_0x29c406[_0xbb40('0x43')],_0x29c406[_0xbb40('0x44')]);_0x59af90[_0xbb40('0x48')]=_[_0xbb40('0x47')](_0x29c406['model'],qs[_0xbb40('0x49')](_0x67f1db[_0xbb40('0x44')][_0xbb40('0x49')]));_0x59af90[_0xbb40('0x48')]=_0x59af90[_0xbb40('0x48')]['length']?_0x59af90[_0xbb40('0x48')]:_0x29c406[_0xbb40('0x43')];_0x59af90['order']=qs[_0xbb40('0x4e')](_0x67f1db[_0xbb40('0x44')][_0xbb40('0x4e')]);_0x59af90['where']=qs['filters'](_['pick'](_0x67f1db[_0xbb40('0x44')],_0x29c406[_0xbb40('0x46')]));if(_0x67f1db['query'][_0xbb40('0x50')]){_0x59af90[_0xbb40('0x52')]=_[_0xbb40('0x51')](_0x59af90[_0xbb40('0x52')],{'$or':_[_0xbb40('0x3e')](_0x59af90[_0xbb40('0x48')],function(_0xa70975){var _0x333cb1={};_0x333cb1[_0xa70975]={'$like':'%'+_0x67f1db[_0xbb40('0x44')][_0xbb40('0x50')]+'%'};return _0x333cb1;})});}_0x59af90=_[_0xbb40('0x51')]({},_0x59af90,_0x67f1db[_0xbb40('0x5a')]);return _0x18bf50[_0xbb40('0xa2')](_0x59af90);}})[_0xbb40('0x37')](function(_0x312983){if(_0x312983){_0x10fc2e=_0x312983[_0xbb40('0x4a')];if(!_0x67f1db['query']['hasOwnProperty']('nolimit')){_0x59af90[_0xbb40('0x32')]=qs['limit'](_0x67f1db[_0xbb40('0x44')]['limit']);_0x59af90[_0xbb40('0x31')]=qs[_0xbb40('0x31')](_0x67f1db['query'][_0xbb40('0x31')]);}return _0x18bf50[_0xbb40('0xa2')](_0x59af90);}})[_0xbb40('0x37')](function(_0x3b2faf){if(_0x3b2faf){return _0x3b2faf?{'count':_0x10fc2e,'rows':_0x3b2faf}:null;}})['then'](respondWithResult(_0x15520b,null))[_0xbb40('0x57')](handleError(_0x15520b,null));};exports[_0xbb40('0xa3')]=function(_0x233d34,_0x3efab7,_0x1b4b59){var _0x162ef1={'raw':![],'where':{}};var _0x34b7d6={};var _0x1bf2b2={'count':0x0,'rows':[]};return db[_0xbb40('0x3f')][_0xbb40('0x6c')]({'where':{'id':_0x233d34[_0xbb40('0x59')]['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x3efab7,null))['then'](function(_0x24333a){if(_0x24333a){_0x34b7d6[_0xbb40('0x43')]=_['keys'](db[_0xbb40('0xa4')]['rawAttributes']);_0x34b7d6[_0xbb40('0x44')]=_[_0xbb40('0x45')](_0x233d34[_0xbb40('0x44')]);_0x34b7d6[_0xbb40('0x46')]=_[_0xbb40('0x47')](_0x34b7d6[_0xbb40('0x43')],_0x34b7d6[_0xbb40('0x44')]);_0x162ef1['attributes']=_[_0xbb40('0x47')](_0x34b7d6[_0xbb40('0x43')],qs[_0xbb40('0x49')](_0x233d34[_0xbb40('0x44')][_0xbb40('0x49')]));_0x162ef1['attributes']=_0x162ef1['attributes'][_0xbb40('0x4a')]?_0x162ef1[_0xbb40('0x48')]:_0x34b7d6[_0xbb40('0x43')];if(!_0x233d34[_0xbb40('0x44')][_0xbb40('0x4b')](_0xbb40('0x4c'))){_0x162ef1[_0xbb40('0x32')]=qs[_0xbb40('0x32')](_0x233d34[_0xbb40('0x44')][_0xbb40('0x32')]);_0x162ef1['offset']=qs[_0xbb40('0x31')](_0x233d34[_0xbb40('0x44')][_0xbb40('0x31')]);}_0x162ef1[_0xbb40('0x4d')]=qs[_0xbb40('0x4e')](_0x233d34[_0xbb40('0x44')][_0xbb40('0x4e')]);_0x162ef1[_0xbb40('0x52')]=qs['filters'](_['pick'](_0x233d34['query'],_0x34b7d6[_0xbb40('0x46')]));_0x162ef1[_0xbb40('0x52')]['OpenchannelAccountId']=_0x24333a['id'];if(_0x233d34['query']['filter']){_0x162ef1[_0xbb40('0x52')]=_[_0xbb40('0x51')](_0x162ef1[_0xbb40('0x52')],{'$or':_[_0xbb40('0x3e')](_0x162ef1[_0xbb40('0x48')],function(_0x268ee5){var _0x96db42={};_0x96db42[_0x268ee5]={'$like':'%'+_0x233d34[_0xbb40('0x44')][_0xbb40('0x50')]+'%'};return _0x96db42;})});}_0x162ef1=_['merge']({},_0x162ef1,_0x233d34['options']);return db['OpenchannelInteraction'][_0xbb40('0x30')]({'where':_0x162ef1[_0xbb40('0x52')]})[_0xbb40('0x37')](function(_0x47c9ad){_0x1bf2b2['count']=_0x47c9ad;if(_0x233d34[_0xbb40('0x44')][_0xbb40('0x53')]){_0x162ef1[_0xbb40('0x54')]=[{'model':db[_0xbb40('0x7e')],'as':_0xbb40('0xa5'),'required':![]},{'model':db[_0xbb40('0x94')],'as':'Owner','attributes':[_0xbb40('0x39'),'fullname',_0xbb40('0xa6')],'required':![]},{'model':db[_0xbb40('0xa7')],'as':'Tags','attributes':['id',_0xbb40('0x39'),_0xbb40('0xa8')],'where':_0x233d34[_0xbb40('0x44')][_0xbb40('0xa9')]?{'id':_0x233d34[_0xbb40('0x44')][_0xbb40('0xa9')]}:undefined,'required':_0x233d34[_0xbb40('0x44')][_0xbb40('0xa9')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xbb40('0x55')](_0x162ef1);})[_0xbb40('0x37')](function(_0x4a20c9){_0x1bf2b2[_0xbb40('0x56')]=_0x4a20c9;return _0x1bf2b2;});}})[_0xbb40('0x37')](respondWithFilteredResult(_0x3efab7,_0x162ef1))[_0xbb40('0x57')](handleError(_0x3efab7,null));};exports['addAgents']=function(_0x51863d,_0x898621,_0x45d1e2){return db['OpenchannelAccount'][_0xbb40('0x65')]({'where':{'id':_0x51863d['params']['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x898621,null))[_0xbb40('0x37')](function(_0x310a2a){if(_0x310a2a){return _0x310a2a[_0xbb40('0xaa')](_0x51863d[_0xbb40('0x5c')][_0xbb40('0x6e')],_[_0xbb40('0xab')](_0x51863d['body'],[_0xbb40('0x6e'),'id'])||{})[_0xbb40('0xac')](function(_0x434a88){for(var _0x4cb478=0x0;_0x4cb478<_0x51863d[_0xbb40('0x5c')]['ids']['length'];_0x4cb478+=0x1){socket[_0xbb40('0xad')]('userOpenchannelAccount:save',{'UserId':_0x51863d[_0xbb40('0x5c')][_0xbb40('0x6e')][_0x4cb478],'OpenchannelAccountId':_0x51863d[_0xbb40('0x59')]['id']});}return _0x434a88;});}})['then'](respondWithResult(_0x898621,null))['catch'](handleError(_0x898621,null));};exports[_0xbb40('0xae')]=function(_0x3ee000,_0x2019e3,_0x4a8bc7){return db[_0xbb40('0x3f')][_0xbb40('0x65')]({'where':{'id':_0x3ee000['params']['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x2019e3,null))[_0xbb40('0x37')](function(_0x3f36ae){if(_0x3f36ae){return _0x3f36ae[_0xbb40('0xae')](_0x3ee000['query']['ids'])['then'](function(){if(_['isArray'](_0x3ee000[_0xbb40('0x44')][_0xbb40('0x6e')])){for(var _0x3f40f0=0x0;_0x3f40f0<_0x3ee000[_0xbb40('0x44')]['ids']['length'];_0x3f40f0+=0x1){socket[_0xbb40('0xad')](_0xbb40('0xaf'),{'UserId':Number(_0x3ee000[_0xbb40('0x44')][_0xbb40('0x6e')][_0x3f40f0]),'OpenchannelAccountId':Number(_0x3ee000['params']['id'])});}}else{socket[_0xbb40('0xad')](_0xbb40('0xaf'),{'UserId':Number(_0x3ee000[_0xbb40('0x44')]['ids']),'OpenchannelAccountId':Number(_0x3ee000['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2019e3,null))[_0xbb40('0x57')](handleError(_0x2019e3,null));};exports[_0xbb40('0xb0')]=function(_0x1b50ad,_0x33445c,_0x2af438){var _0x301342={};var _0x4d3384={};var _0x5af0cd;var _0x4383bd;return db[_0xbb40('0x3f')][_0xbb40('0x6c')]({'where':{'id':_0x1b50ad[_0xbb40('0x59')]['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x33445c,null))[_0xbb40('0x37')](function(_0x6cbf0a){if(_0x6cbf0a){_0x5af0cd=_0x6cbf0a;_0x4d3384[_0xbb40('0x43')]=_['keys'](db['User'][_0xbb40('0x40')]);_0x4d3384['query']=_[_0xbb40('0x45')](_0x1b50ad['query']);_0x4d3384['filters']=_[_0xbb40('0x47')](_0x4d3384[_0xbb40('0x43')],_0x4d3384[_0xbb40('0x44')]);_0x301342['attributes']=_['intersection'](_0x4d3384[_0xbb40('0x43')],qs[_0xbb40('0x49')](_0x1b50ad[_0xbb40('0x44')]['fields']));_0x301342['attributes']=_0x301342['attributes'][_0xbb40('0x4a')]?_0x301342[_0xbb40('0x48')]:_0x4d3384['model'];_0x301342[_0xbb40('0x4d')]=qs[_0xbb40('0x4e')](_0x1b50ad[_0xbb40('0x44')][_0xbb40('0x4e')]);_0x301342[_0xbb40('0x52')]=qs['filters'](_[_0xbb40('0x4f')](_0x1b50ad[_0xbb40('0x44')],_0x4d3384[_0xbb40('0x46')]));if(_0x1b50ad[_0xbb40('0x44')][_0xbb40('0x50')]){_0x301342[_0xbb40('0x52')]=_[_0xbb40('0x51')](_0x301342['where'],{'$or':_['map'](_0x301342[_0xbb40('0x48')],function(_0x19b7a6){var _0x3d371e={};_0x3d371e[_0x19b7a6]={'$like':'%'+_0x1b50ad['query']['filter']+'%'};return _0x3d371e;})});}_0x301342=_[_0xbb40('0x51')]({},_0x301342,_0x1b50ad[_0xbb40('0x5a')]);return _0x5af0cd[_0xbb40('0xb0')](_0x301342);}})[_0xbb40('0x37')](function(_0x1ae657){if(_0x1ae657){_0x4383bd=_0x1ae657[_0xbb40('0x4a')];if(!_0x1b50ad[_0xbb40('0x44')][_0xbb40('0x4b')]('nolimit')){_0x301342['limit']=qs[_0xbb40('0x32')](_0x1b50ad[_0xbb40('0x44')][_0xbb40('0x32')]);_0x301342[_0xbb40('0x31')]=qs[_0xbb40('0x31')](_0x1b50ad[_0xbb40('0x44')][_0xbb40('0x31')]);}return _0x5af0cd[_0xbb40('0xb0')](_0x301342);}})[_0xbb40('0x37')](function(_0x90428d){if(_0x90428d){return _0x90428d?{'count':_0x4383bd,'rows':_0x90428d}:null;}})[_0xbb40('0x37')](respondWithResult(_0x33445c,null))['catch'](handleError(_0x33445c,null));};exports[_0xbb40('0x3a')]=function(_0x8d5fad,_0x252d0a,_0x3cffa5){var _0x220122,_0x1aec52,_0xadd1a9;if(_[_0xbb40('0x77')](_0x8d5fad[_0xbb40('0x5c')][_0xbb40('0x5c')])||_0x8d5fad[_0xbb40('0x5c')]['body']===''){throw new db[(_0xbb40('0x1f'))]['ValidationError'](_0xbb40('0xb1'));}if(_['isNil'](_0x8d5fad[_0xbb40('0x5c')]['to'])){}_0x220122=_0x8d5fad[_0xbb40('0x5c')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x8d5fad[_0xbb40('0x59')]['id']}})[_0xbb40('0x37')](handleEntityNotFound(_0x252d0a,null))[_0xbb40('0x37')](function(_0x1eb4ff){if(_0x1eb4ff){return db['OpenchannelAccount'][_0xbb40('0x65')]({'where':{'id':_0x1eb4ff['id']},'include':[{'model':db['CmList'],'as':_0xbb40('0x7d'),'include':[{'model':db[_0xbb40('0x7e')],'as':_0xbb40('0x7f'),'where':{[_0x1eb4ff['mapKey']]:_0x220122},'limit':0x1,'order':[[_0xbb40('0x73'),'DESC']]}]}]})[_0xbb40('0x37')](handleEntityNotFound(_0x252d0a,null))[_0xbb40('0x37')](function(_0x440c92){if(_0x440c92&&_0x440c92['List']){_0x1aec52=_0x440c92[_0xbb40('0x38')]({'plain':!![]});if(_0x1aec52['List']&&_0x1aec52['List']['Contacts']['length']){return _0x1aec52[_0xbb40('0x7d')][_0xbb40('0x7f')][0x0];}return db['CmContact'][_0xbb40('0x5b')](_[_0xbb40('0x19')](_0x8d5fad[_0xbb40('0x5c')],{'firstName':_0x220122,[_0x440c92[_0xbb40('0x78')]]:_0x220122,'phone':_0x220122,'ListId':_0x1aec52[_0xbb40('0x75')]}));}})[_0xbb40('0x37')](handleEntityNotFound(_0x252d0a,null))[_0xbb40('0x37')](function(_0x2dd54a){if(_0x2dd54a){_0xadd1a9=_0x2dd54a;return db[_0xbb40('0xa4')][_0xbb40('0x65')]({'where':{'ContactId':_0xadd1a9['id'],'closed':![],'OpenchannelAccountId':_0x1aec52['id']}})[_0xbb40('0x37')](function(_0x3949fa){if(_0x3949fa){return[_0x3949fa,![]];}return db['OpenchannelInteraction'][_0xbb40('0x5b')]({'UserId':_0x8d5fad[_0xbb40('0x5d')]['id'],'ContactId':_0xadd1a9['id'],'OpenchannelAccountId':_0x1aec52['id'],'lastMsgDirection':_0xbb40('0xb2'),'Messages':[_[_0xbb40('0x51')](_0x8d5fad[_0xbb40('0x5c')],{'read':![],'body':_0x8d5fad[_0xbb40('0x5c')][_0xbb40('0x5c')],'OpenchannelAccountId':_0x1aec52['id'],'UserId':_0x8d5fad[_0xbb40('0x5d')]['id'],'ContactId':_0xadd1a9['id']})]},{'include':[{'model':db[_0xbb40('0xb3')],'as':_0xbb40('0xb4')}]})[_0xbb40('0x37')](function(_0x1d4ede){return[_0x1d4ede,!![]];});});}})[_0xbb40('0xac')](function(_0x2f0908,_0x2b73e3){if(_0x2b73e3){return _0x2f0908;}return db[_0xbb40('0xb3')][_0xbb40('0x5b')](_['merge'](_0x8d5fad[_0xbb40('0x5c')],{'read':![],'body':_0x8d5fad['body'][_0xbb40('0x5c')],'OpenchannelAccountId':_0x1aec52['id'],'OpenchannelInteractionId':_0x2f0908['id'],'UserId':_0x8d5fad['user']['id'],'ContactId':_0xadd1a9['id']}))[_0xbb40('0x37')](function(_0x670688){_0x2f0908[_0xbb40('0xb5')][_0xbb40('0xb4')]=[];_0x2f0908[_0xbb40('0xb5')]['Messages']['push'](_0x670688[_0xbb40('0xb5')]);return _0x2f0908;});});}})[_0xbb40('0x37')](respondWithResult(_0x252d0a,null))['catch'](handleError(_0x252d0a,null));}; \ No newline at end of file +var _0x1e69=['json','OpenchannelAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','params','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','OpnechannelAccountId','getDispositions','findOne','Disposition','hasOwnProperty','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','from','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','unmanaged','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','addApplications','sequelize','transaction','destroy','bulkCreate','findAndCountAll','pick','getApplications','Contact','fullname','Tag','Tags','tag','findAll','addAgents','omit','spread','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','OpenchannelMessage','Messages','dataValues','push','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','Sequelize','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','sendStatus','end','status','count','offset','limit','set','Content-Range'];(function(_0x26f1cf,_0x3ed15f){var _0x6674e8=function(_0x1ed975){while(--_0x1ed975){_0x26f1cf['push'](_0x26f1cf['shift']());}};_0x6674e8(++_0x3ed15f);}(_0x1e69,0x13b));var _0x91e6=function(_0x43997b,_0x17bd44){_0x43997b=_0x43997b-0x0;var _0x4ac8c1=_0x1e69[_0x43997b];return _0x4ac8c1;};'use strict';var pdf=require(_0x91e6('0x0'));var emlformat=require(_0x91e6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x91e6('0x2'));var jsonpatch=require(_0x91e6('0x3'));var rp=require(_0x91e6('0x4'));var moment=require('moment');var BPromise=require(_0x91e6('0x5'));var Mustache=require('mustache');var util=require(_0x91e6('0x6'));var path=require(_0x91e6('0x7'));var sox=require('sox');var csv=require(_0x91e6('0x8'));var ejs=require(_0x91e6('0x9'));var fs=require('fs');var _=require(_0x91e6('0xa'));var squel=require(_0x91e6('0xb'));var crypto=require(_0x91e6('0xc'));var jsforce=require(_0x91e6('0xd'));var deskjs=require(_0x91e6('0xe'));var toCsv=require(_0x91e6('0x8'));var querystring=require(_0x91e6('0xf'));var Papa=require(_0x91e6('0x10'));var Redis=require('ioredis');var authService=require(_0x91e6('0x11'));var qs=require(_0x91e6('0x12'));var as=require(_0x91e6('0x13'));var hardwareService=require(_0x91e6('0x14'));var logger=require(_0x91e6('0x15'))(_0x91e6('0x16'));var utils=require(_0x91e6('0x17'));var config=require(_0x91e6('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x91e6('0x19')](config['redis'],{'host':_0x91e6('0x1a'),'port':0x18eb});var socket=require(_0x91e6('0x1b'))(new Redis(config['redis']));require(_0x91e6('0x1c'))[_0x91e6('0x1d')](socket);var jayson=require(_0x91e6('0x1e'));var client=jayson[_0x91e6('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x91e6('0x1f')][_0x91e6('0x20')]({'port':0x232a});function checkPasswordPattern(_0x1d1fec,_0x34d364,_0x155fa5){if(_0x155fa5){var _0x4c5706=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c5706[_0x91e6('0x21')](_0x34d364)){return _0x1d1fec;}else{throw new db[(_0x91e6('0x22'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1d1fec;}}function respondWithRpcPromise(_0x8d12fe,_0x40b1e5,_0x14bd61,_0x314cf8){return new BPromise(function(_0x46270e,_0x119e2b){var _0x2f589f=_0x314cf8||client;return _0x2f589f['request'](_0x8d12fe,_0x14bd61)[_0x91e6('0x23')](function(_0x1da2d4){logger[_0x91e6('0x24')](_0x91e6('0x25'),_0x40b1e5,'request\x20sent');logger[_0x91e6('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x40b1e5,'request\x20sent',JSON[_0x91e6('0x27')](_0x1da2d4));if(_0x1da2d4['error']){if(_0x1da2d4[_0x91e6('0x28')][_0x91e6('0x29')]===0x1f4){logger[_0x91e6('0x28')](_0x91e6('0x25'),_0x40b1e5,_0x1da2d4[_0x91e6('0x28')]['message']);return _0x119e2b(_0x1da2d4[_0x91e6('0x28')][_0x91e6('0x2a')]);}logger[_0x91e6('0x28')](_0x91e6('0x25'),_0x40b1e5,_0x1da2d4[_0x91e6('0x28')]['message']);return _0x46270e(_0x1da2d4[_0x91e6('0x28')][_0x91e6('0x2a')]);}else{logger[_0x91e6('0x24')](_0x91e6('0x25'),_0x40b1e5,_0x91e6('0x2b'));_0x46270e(_0x1da2d4['result'][_0x91e6('0x2a')]);}})[_0x91e6('0x2c')](function(_0x44d033){logger[_0x91e6('0x28')](_0x91e6('0x25'),_0x40b1e5,_0x44d033);_0x119e2b(_0x44d033);});});}function respondWithStatusCode(_0x1ebf73,_0x3a0c15){_0x3a0c15=_0x3a0c15||0xcc;return function(_0x24eb13){if(_0x24eb13){return _0x1ebf73[_0x91e6('0x2d')](_0x3a0c15);}return _0x1ebf73['status'](_0x3a0c15)[_0x91e6('0x2e')]();};}function respondWithResult(_0x20da3b,_0x2324b5){_0x2324b5=_0x2324b5||0xc8;return function(_0x5f3ffd){if(_0x5f3ffd){return _0x20da3b[_0x91e6('0x2f')](_0x2324b5)['json'](_0x5f3ffd);}};}function respondWithFilteredResult(_0x19ba0c,_0x3b73ec){return function(_0x1167d1){if(_0x1167d1){var _0x288cb0=_0x1167d1[_0x91e6('0x30')],_0x403ce7=_0x3b73ec[_0x91e6('0x31')],_0x58ad46=_0x3b73ec[_0x91e6('0x31')]+_0x3b73ec[_0x91e6('0x32')],_0x20543f;if(_0x58ad46>=_0x288cb0){_0x58ad46=_0x288cb0;_0x20543f=0xc8;}else{_0x20543f=0xce;}_0x19ba0c[_0x91e6('0x2f')](_0x20543f);return _0x19ba0c[_0x91e6('0x33')](_0x91e6('0x34'),_0x403ce7+'-'+_0x58ad46+'/'+_0x288cb0)[_0x91e6('0x35')](_0x1167d1);}return null;};}function patchUpdates(_0x1dc98c){return function(_0x57bb98){try{jsonpatch['apply'](_0x57bb98,_0x1dc98c,!![]);}catch(_0x5aadb6){return BPromise['reject'](_0x5aadb6);}return _0x57bb98['save']();};}function saveUpdates(_0x2b4f50,_0x57396a){return function(_0x57d7da){if(_0x57d7da){return _0x57d7da['update'](_0x2b4f50)[_0x91e6('0x23')](function(_0x3679a3){return _0x3679a3;});}return null;};}function removeEntity(_0x4e3824,_0x55a7ac){return function(_0x521f69){if(_0x521f69){return _0x521f69['destroy']()[_0x91e6('0x23')](function(){var _0x55a698=_0x521f69['get']({'plain':!![]});var _0x163088=_0x91e6('0x36');return db[_0x91e6('0x37')]['destroy']({'where':{'type':_0x163088,'resourceId':_0x55a698['id']}})[_0x91e6('0x23')](function(){return _0x521f69;});})[_0x91e6('0x23')](function(){_0x4e3824[_0x91e6('0x2f')](0xcc)[_0x91e6('0x2e')]();});}};}function handleEntityNotFound(_0x361f62,_0xa8ea30){return function(_0x225e1b){if(!_0x225e1b){_0x361f62[_0x91e6('0x2d')](0x194);}return _0x225e1b;};}function handleError(_0x176ce6,_0xb3e724){_0xb3e724=_0xb3e724||0x1f4;return function(_0x47ee28){logger[_0x91e6('0x28')](_0x47ee28[_0x91e6('0x38')]);if(_0x47ee28[_0x91e6('0x39')]){delete _0x47ee28[_0x91e6('0x39')];}_0x176ce6[_0x91e6('0x2f')](_0xb3e724)[_0x91e6('0x3a')](_0x47ee28);};}exports['index']=function(_0x8c6039,_0x40627f){var _0x1c8c49={'include':[{'model':db[_0x91e6('0x3b')],'as':_0x91e6('0x3c')}]},_0x486902={},_0x24bdd1={'count':0x0,'rows':[]};var _0x20eb49=_[_0x91e6('0x3d')](db['OpenchannelAccount'][_0x91e6('0x3e')],function(_0x5c2dfe){return{'name':_0x5c2dfe[_0x91e6('0x3f')],'type':_0x5c2dfe[_0x91e6('0x40')][_0x91e6('0x41')]};});_0x486902[_0x91e6('0x42')]=_[_0x91e6('0x3d')](_0x20eb49,'name');_0x486902[_0x91e6('0x43')]=_[_0x91e6('0x44')](_0x8c6039[_0x91e6('0x43')]);_0x486902[_0x91e6('0x45')]=_[_0x91e6('0x46')](_0x486902['model'],_0x486902[_0x91e6('0x43')]);_0x1c8c49[_0x91e6('0x47')]=_[_0x91e6('0x46')](_0x486902[_0x91e6('0x42')],qs[_0x91e6('0x48')](_0x8c6039[_0x91e6('0x43')]['fields']));_0x1c8c49[_0x91e6('0x47')]=_0x1c8c49[_0x91e6('0x47')][_0x91e6('0x49')]?_0x1c8c49[_0x91e6('0x47')]:_0x486902[_0x91e6('0x42')];if(!_0x8c6039[_0x91e6('0x43')]['hasOwnProperty'](_0x91e6('0x4a'))){_0x1c8c49[_0x91e6('0x32')]=qs['limit'](_0x8c6039[_0x91e6('0x43')][_0x91e6('0x32')]);_0x1c8c49[_0x91e6('0x31')]=qs[_0x91e6('0x31')](_0x8c6039[_0x91e6('0x43')][_0x91e6('0x31')]);}_0x1c8c49[_0x91e6('0x4b')]=qs['sort'](_0x8c6039[_0x91e6('0x43')][_0x91e6('0x4c')]);_0x1c8c49[_0x91e6('0x4d')]=qs[_0x91e6('0x45')](_['pick'](_0x8c6039[_0x91e6('0x43')],_0x486902[_0x91e6('0x45')]));if(_0x8c6039['query'][_0x91e6('0x4e')]){_0x1c8c49[_0x91e6('0x4d')]=_[_0x91e6('0x4f')](_0x1c8c49['where'],{'$or':_[_0x91e6('0x3d')](_0x20eb49,function(_0x2d1b0d){if(_0x2d1b0d[_0x91e6('0x40')]!==_0x91e6('0x50')){var _0x1fbe8d={};_0x1fbe8d[_0x2d1b0d['name']]={'$like':'%'+_0x8c6039[_0x91e6('0x43')]['filter']+'%'};return _0x1fbe8d;}})});}_0x1c8c49=_[_0x91e6('0x4f')]({},_0x1c8c49,_0x8c6039[_0x91e6('0x51')]);var _0x1ba502={'where':_0x1c8c49['where']};return db[_0x91e6('0x52')]['count'](_0x1ba502)[_0x91e6('0x23')](function(_0x47d025){_0x24bdd1[_0x91e6('0x30')]=_0x47d025;if(_0x8c6039[_0x91e6('0x43')][_0x91e6('0x53')]){_0x1c8c49[_0x91e6('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x1c8c49);})['then'](function(_0x75aaa3){_0x24bdd1['rows']=_0x75aaa3;return _0x24bdd1;})['then'](respondWithFilteredResult(_0x40627f,_0x1c8c49))['catch'](handleError(_0x40627f,null));};exports['show']=function(_0x50f287,_0x558eb8){var _0x18e75b={'raw':![],'where':{'id':_0x50f287[_0x91e6('0x55')]['id']},'include':[{'model':db[_0x91e6('0x3b')],'as':_0x91e6('0x3c')}]},_0x4ffc12={};_0x4ffc12[_0x91e6('0x42')]=_[_0x91e6('0x44')](db[_0x91e6('0x52')][_0x91e6('0x3e')]);_0x4ffc12['query']=_[_0x91e6('0x44')](_0x50f287[_0x91e6('0x43')]);_0x4ffc12['filters']=_[_0x91e6('0x46')](_0x4ffc12['model'],_0x4ffc12[_0x91e6('0x43')]);_0x18e75b[_0x91e6('0x47')]=_[_0x91e6('0x46')](_0x4ffc12[_0x91e6('0x42')],qs[_0x91e6('0x48')](_0x50f287[_0x91e6('0x43')][_0x91e6('0x48')]));_0x18e75b[_0x91e6('0x47')]=_0x18e75b['attributes'][_0x91e6('0x49')]?_0x18e75b['attributes']:_0x4ffc12[_0x91e6('0x42')];if(_0x50f287['query'][_0x91e6('0x53')]){_0x18e75b[_0x91e6('0x54')]=[{'all':!![]}];}_0x18e75b=_[_0x91e6('0x4f')]({},_0x18e75b,_0x50f287[_0x91e6('0x51')]);return db['OpenchannelAccount'][_0x91e6('0x56')](_0x18e75b)['then'](handleEntityNotFound(_0x558eb8,null))[_0x91e6('0x23')](respondWithResult(_0x558eb8,null))['catch'](handleError(_0x558eb8,null));};exports[_0x91e6('0x57')]=function(_0x5d2f88,_0x2e1ecf){return db[_0x91e6('0x52')][_0x91e6('0x57')](_0x5d2f88[_0x91e6('0x58')],{})[_0x91e6('0x23')](function(_0x4958dd){var _0x50970d=_0x5d2f88[_0x91e6('0x59')][_0x91e6('0x5a')]({'plain':!![]});if(!_0x50970d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50970d['role']===_0x91e6('0x59')){var _0x2b48f1=_0x4958dd[_0x91e6('0x5a')]({'plain':!![]});var _0x12dc49=_0x91e6('0x36');return db[_0x91e6('0x5b')][_0x91e6('0x56')]({'where':{'name':_0x12dc49,'userProfileId':_0x50970d[_0x91e6('0x5c')]},'raw':!![]})[_0x91e6('0x23')](function(_0x147e98){if(_0x147e98&&_0x147e98[_0x91e6('0x5d')]===0x0){return db[_0x91e6('0x37')]['create']({'name':_0x2b48f1[_0x91e6('0x39')],'resourceId':_0x2b48f1['id'],'type':_0x147e98[_0x91e6('0x39')],'sectionId':_0x147e98['id']},{})[_0x91e6('0x23')](function(){return _0x4958dd;});}else{return _0x4958dd;}})[_0x91e6('0x2c')](function(_0x284b15){logger[_0x91e6('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x284b15);throw _0x284b15;});}return _0x4958dd;})[_0x91e6('0x23')](respondWithResult(_0x2e1ecf,0xc9))['catch'](handleError(_0x2e1ecf,null));};exports[_0x91e6('0x5e')]=function(_0x2dbdad,_0x574941){if(_0x2dbdad[_0x91e6('0x58')]['id']){delete _0x2dbdad[_0x91e6('0x58')]['id'];}return db[_0x91e6('0x52')]['find']({'where':{'id':_0x2dbdad[_0x91e6('0x55')]['id']},'include':[{'model':db[_0x91e6('0x3b')],'as':_0x91e6('0x3c')}]})[_0x91e6('0x23')](handleEntityNotFound(_0x574941,null))[_0x91e6('0x23')](saveUpdates(_0x2dbdad[_0x91e6('0x58')],null))[_0x91e6('0x23')](respondWithResult(_0x574941,null))[_0x91e6('0x2c')](handleError(_0x574941,null));};exports['destroy']=function(_0x2bf439,_0x43c7d3){return db[_0x91e6('0x52')]['find']({'where':{'id':_0x2bf439[_0x91e6('0x55')]['id']}})[_0x91e6('0x23')](handleEntityNotFound(_0x43c7d3,null))['then'](removeEntity(_0x43c7d3,null))['catch'](handleError(_0x43c7d3,null));};exports['describe']=function(_0x31d2d6,_0x3f98e1){return db[_0x91e6('0x52')][_0x91e6('0x5f')]()['then'](respondWithResult(_0x3f98e1,null))[_0x91e6('0x2c')](handleError(_0x3f98e1,null));};exports[_0x91e6('0x60')]=function(_0x512e36,_0x2a5879,_0x1d4c85){if(_0x512e36['body']['id']){delete _0x512e36[_0x91e6('0x58')]['id'];}return db['OpenchannelAccount'][_0x91e6('0x56')]({'where':{'id':_0x512e36[_0x91e6('0x55')]['id']}})['then'](handleEntityNotFound(_0x2a5879,null))[_0x91e6('0x23')](function(_0x500cf1){if(_0x500cf1){_0x512e36[_0x91e6('0x58')][_0x91e6('0x61')]=_0x500cf1['id'];return db['Disposition'][_0x91e6('0x57')](_0x512e36[_0x91e6('0x58')]);}})[_0x91e6('0x23')](respondWithResult(_0x2a5879,null))[_0x91e6('0x2c')](handleError(_0x2a5879,null));};exports[_0x91e6('0x62')]=function(_0x4d1fa5,_0x188a82,_0x56a155){var _0x2d4ad2={'raw':![],'where':{}};var _0x4296={};var _0x4f577f={'count':0x0,'rows':[]};return db[_0x91e6('0x52')][_0x91e6('0x63')]({'where':{'id':_0x4d1fa5['params']['id']}})['then'](handleEntityNotFound(_0x188a82,null))[_0x91e6('0x23')](function(_0x256fac){if(_0x256fac){_0x4296[_0x91e6('0x42')]=_[_0x91e6('0x44')](db[_0x91e6('0x64')][_0x91e6('0x3e')]);_0x4296['query']=_[_0x91e6('0x44')](_0x4d1fa5['query']);_0x4296[_0x91e6('0x45')]=_['intersection'](_0x4296[_0x91e6('0x42')],_0x4296[_0x91e6('0x43')]);_0x2d4ad2['attributes']=_['intersection'](_0x4296[_0x91e6('0x42')],qs[_0x91e6('0x48')](_0x4d1fa5[_0x91e6('0x43')][_0x91e6('0x48')]));_0x2d4ad2[_0x91e6('0x47')]=_0x2d4ad2[_0x91e6('0x47')][_0x91e6('0x49')]?_0x2d4ad2[_0x91e6('0x47')]:_0x4296[_0x91e6('0x42')];if(!_0x4d1fa5[_0x91e6('0x43')][_0x91e6('0x65')]('nolimit')){_0x2d4ad2['limit']=qs[_0x91e6('0x32')](_0x4d1fa5[_0x91e6('0x43')][_0x91e6('0x32')]);_0x2d4ad2['offset']=qs[_0x91e6('0x31')](_0x4d1fa5['query'][_0x91e6('0x31')]);}_0x2d4ad2['order']=qs[_0x91e6('0x4c')](_0x4d1fa5[_0x91e6('0x43')][_0x91e6('0x4c')]);_0x2d4ad2[_0x91e6('0x4d')]=qs[_0x91e6('0x45')](_['pick'](_0x4d1fa5['query'],_0x4296['filters']));_0x2d4ad2[_0x91e6('0x4d')][_0x91e6('0x66')]=_0x256fac['id'];if(_0x4d1fa5[_0x91e6('0x43')][_0x91e6('0x4e')]){_0x2d4ad2[_0x91e6('0x4d')]=_[_0x91e6('0x4f')](_0x2d4ad2[_0x91e6('0x4d')],{'$or':_['map'](_0x2d4ad2[_0x91e6('0x47')],function(_0x3ba733){var _0x18058c={};_0x18058c[_0x3ba733]={'$like':'%'+_0x4d1fa5[_0x91e6('0x43')][_0x91e6('0x4e')]+'%'};return _0x18058c;})});}_0x2d4ad2=_[_0x91e6('0x4f')]({},_0x2d4ad2,_0x4d1fa5[_0x91e6('0x51')]);return db[_0x91e6('0x64')]['count']({'where':_0x2d4ad2[_0x91e6('0x4d')]})[_0x91e6('0x23')](function(_0x49dcdf){_0x4f577f[_0x91e6('0x30')]=_0x49dcdf;if(_0x4d1fa5['query'][_0x91e6('0x53')]){_0x2d4ad2['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2d4ad2);})[_0x91e6('0x23')](function(_0x5350d7){_0x4f577f[_0x91e6('0x67')]=_0x5350d7;return _0x4f577f;});}})['then'](respondWithFilteredResult(_0x188a82,_0x2d4ad2))[_0x91e6('0x2c')](handleError(_0x188a82,null));};exports[_0x91e6('0x68')]=function(_0x59fd57,_0x21c9ab,_0xbf386d){return db[_0x91e6('0x52')][_0x91e6('0x56')]({'where':{'id':_0x59fd57[_0x91e6('0x55')]['id']}})[_0x91e6('0x23')](handleEntityNotFound(_0x21c9ab,null))[_0x91e6('0x23')](function(_0x3edc74){if(_0x3edc74){return _0x3edc74[_0x91e6('0x68')](_0x59fd57[_0x91e6('0x43')][_0x91e6('0x69')]);}})[_0x91e6('0x23')](respondWithStatusCode(_0x21c9ab,null))[_0x91e6('0x2c')](handleError(_0x21c9ab,null));};exports[_0x91e6('0x6a')]=function(_0x4d86b9,_0x56dd76,_0x5a0da4){if(_0x4d86b9[_0x91e6('0x58')]['id']){delete _0x4d86b9['body']['id'];}return db['OpenchannelAccount'][_0x91e6('0x56')]({'where':{'id':_0x4d86b9[_0x91e6('0x55')]['id']}})[_0x91e6('0x23')](handleEntityNotFound(_0x56dd76,null))['then'](function(_0x384fed){if(_0x384fed){_0x4d86b9[_0x91e6('0x58')][_0x91e6('0x66')]=_0x384fed['id'];return db[_0x91e6('0x6b')][_0x91e6('0x57')](_0x4d86b9['body']);}})['then'](respondWithResult(_0x56dd76,null))[_0x91e6('0x2c')](handleError(_0x56dd76,null));};exports[_0x91e6('0x6c')]=function(_0x574ead,_0x98ea74,_0x54c6fa){var _0x3673e0={'raw':![],'where':{}};var _0x37c6be={};var _0x3a06b2={'count':0x0,'rows':[]};return db[_0x91e6('0x52')][_0x91e6('0x63')]({'where':{'id':_0x574ead['params']['id']}})['then'](handleEntityNotFound(_0x98ea74,null))[_0x91e6('0x23')](function(_0x5a8db9){if(_0x5a8db9){_0x37c6be[_0x91e6('0x42')]=_[_0x91e6('0x44')](db[_0x91e6('0x6b')][_0x91e6('0x3e')]);_0x37c6be[_0x91e6('0x43')]=_[_0x91e6('0x44')](_0x574ead[_0x91e6('0x43')]);_0x37c6be[_0x91e6('0x45')]=_[_0x91e6('0x46')](_0x37c6be['model'],_0x37c6be[_0x91e6('0x43')]);_0x3673e0[_0x91e6('0x47')]=_['intersection'](_0x37c6be[_0x91e6('0x42')],qs[_0x91e6('0x48')](_0x574ead[_0x91e6('0x43')][_0x91e6('0x48')]));_0x3673e0[_0x91e6('0x47')]=_0x3673e0[_0x91e6('0x47')][_0x91e6('0x49')]?_0x3673e0[_0x91e6('0x47')]:_0x37c6be[_0x91e6('0x42')];if(!_0x574ead[_0x91e6('0x43')][_0x91e6('0x65')](_0x91e6('0x4a'))){_0x3673e0[_0x91e6('0x32')]=qs[_0x91e6('0x32')](_0x574ead['query'][_0x91e6('0x32')]);_0x3673e0[_0x91e6('0x31')]=qs[_0x91e6('0x31')](_0x574ead['query']['offset']);}_0x3673e0['order']=qs[_0x91e6('0x4c')](_0x574ead[_0x91e6('0x43')]['sort']);_0x3673e0[_0x91e6('0x4d')]=qs[_0x91e6('0x45')](_['pick'](_0x574ead[_0x91e6('0x43')],_0x37c6be[_0x91e6('0x45')]));_0x3673e0[_0x91e6('0x4d')]['OpenchannelAccountId']=_0x5a8db9['id'];if(_0x574ead['query']['filter']){_0x3673e0[_0x91e6('0x4d')]=_['merge'](_0x3673e0[_0x91e6('0x4d')],{'$or':_[_0x91e6('0x3d')](_0x3673e0[_0x91e6('0x47')],function(_0x3b0972){var _0x124eda={};_0x124eda[_0x3b0972]={'$like':'%'+_0x574ead['query'][_0x91e6('0x4e')]+'%'};return _0x124eda;})});}_0x3673e0=_['merge']({},_0x3673e0,_0x574ead[_0x91e6('0x51')]);return db[_0x91e6('0x6b')][_0x91e6('0x30')]({'where':_0x3673e0[_0x91e6('0x4d')]})[_0x91e6('0x23')](function(_0x43cb72){_0x3a06b2[_0x91e6('0x30')]=_0x43cb72;if(_0x574ead['query'][_0x91e6('0x53')]){_0x3673e0['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3673e0);})[_0x91e6('0x23')](function(_0x46a308){_0x3a06b2[_0x91e6('0x67')]=_0x46a308;return _0x3a06b2;});}})[_0x91e6('0x23')](respondWithFilteredResult(_0x98ea74,_0x3673e0))[_0x91e6('0x2c')](handleError(_0x98ea74,null));};exports[_0x91e6('0x6d')]=function(_0x39e5f3,_0x409617,_0x24c376){return db['OpenchannelAccount'][_0x91e6('0x56')]({'where':{'id':_0x39e5f3[_0x91e6('0x55')]['id']}})[_0x91e6('0x23')](handleEntityNotFound(_0x409617,null))['then'](function(_0x34befe){if(_0x34befe){return _0x34befe[_0x91e6('0x6d')](_0x39e5f3[_0x91e6('0x43')][_0x91e6('0x69')]);}})[_0x91e6('0x23')](respondWithStatusCode(_0x409617,null))[_0x91e6('0x2c')](handleError(_0x409617,null));};exports['notify']=function(_0x593496,_0x54ee2a,_0x2ad9dc){var _0x59acb3={'body':_0x593496['body'],'channel':_0x91e6('0x6e')};var _0x4e2910=[];var _0x2a9f5b=[];var _0x5bf5fd={};var _0x2bbe2b=![];return db[_0x91e6('0x6f')][_0x91e6('0x5f')]()[_0x91e6('0x23')](function(_0xfcdc06){if(!_0xfcdc06){throw new db[(_0x91e6('0x22'))][(_0x91e6('0x70'))](_0x91e6('0x71'));}_0x4e2910=_[_0x91e6('0x72')](_[_0x91e6('0x44')](_0xfcdc06),['createdAt','updatedAt']);_0x2a9f5b=_[_0x91e6('0x72')](_[_0x91e6('0x44')](_0xfcdc06),[_0x91e6('0x73'),_0x91e6('0x74'),_0x91e6('0x75'),_0x91e6('0x76')]);if(_0x593496[_0x91e6('0x58')]['id']){delete _0x593496['body']['id'];}if(_[_0x91e6('0x77')](_0x593496['body']['from'])){throw new db[(_0x91e6('0x22'))][(_0x91e6('0x70'))](_0x91e6('0x78'));}if(_[_0x91e6('0x77')](_0x593496[_0x91e6('0x58')][_0x91e6('0x58')])||_0x593496['body']['body']===''){throw new db[(_0x91e6('0x22'))][(_0x91e6('0x70'))](_0x91e6('0x79'));}if(_[_0x91e6('0x77')](_0x593496[_0x91e6('0x58')][_0x91e6('0x7a')])){throw new db['Sequelize'][(_0x91e6('0x70'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a9f5b);}if(!_[_0x91e6('0x7b')](_0x2a9f5b,_0x593496[_0x91e6('0x58')][_0x91e6('0x7a')])){throw new db[(_0x91e6('0x22'))][(_0x91e6('0x70'))](_0x91e6('0x7c')+_0x2a9f5b);}_0x5bf5fd[_0x593496[_0x91e6('0x58')][_0x91e6('0x7a')]]=_0x593496['body']['from'];})[_0x91e6('0x23')](function(){return db[_0x91e6('0x52')]['find']({'where':{'id':_0x593496[_0x91e6('0x55')]['id']},'include':[{'model':db[_0x91e6('0x7d')],'as':_0x91e6('0x7e'),'include':[{'model':db[_0x91e6('0x6f')],'as':_0x91e6('0x7f'),'where':_0x5bf5fd,'limit':0x1,'order':[[_0x91e6('0x74'),_0x91e6('0x80')]]}]},{'model':db[_0x91e6('0x81')],'as':_0x91e6('0x82')}]});})[_0x91e6('0x23')](handleEntityNotFound(_0x54ee2a,null))[_0x91e6('0x23')](function(_0x1e80aa){if(_0x1e80aa&&_0x1e80aa['List']){_0x59acb3[_0x91e6('0x83')]=_0x1e80aa;_0x59acb3[_0x91e6('0x84')]=_0x1e80aa[_0x91e6('0x82')];_0x59acb3[_0x91e6('0x85')]=_0x1e80aa[_0x91e6('0x7e')];_0x59acb3[_0x91e6('0x84')]=_[_0x91e6('0x86')](_0x59acb3[_0x91e6('0x84')],[_0x91e6('0x87')],[_0x91e6('0x88')]);if(_0x59acb3['account']['Applications']){delete _0x59acb3[_0x91e6('0x83')][_0x91e6('0x82')];}if(_0x59acb3[_0x91e6('0x83')][_0x91e6('0x7e')]&&_0x59acb3[_0x91e6('0x83')][_0x91e6('0x7e')]['Contacts'][_0x91e6('0x49')]){return _0x59acb3[_0x91e6('0x83')][_0x91e6('0x7e')][_0x91e6('0x7f')][0x0];}var _0x505cea=_['defaults'](_0x593496[_0x91e6('0x58')],{'firstName':_0x593496[_0x91e6('0x58')][_0x91e6('0x89')],'ListId':_0x1e80aa['ListId']});_0x505cea[_0x593496[_0x91e6('0x58')][_0x91e6('0x7a')]]=_0x593496[_0x91e6('0x58')][_0x91e6('0x89')];return db['CmContact'][_0x91e6('0x57')](_0x505cea,{'fields':_0x4e2910,'raw':!![]});}})[_0x91e6('0x23')](handleEntityNotFound(_0x54ee2a,null))[_0x91e6('0x23')](function(_0x31ea93){_0x59acb3[_0x91e6('0x8a')]=_0x31ea93;if(_0x31ea93){var _0x2ec498={'ContactId':_0x31ea93['id'],'OpenchannelAccountId':_0x593496[_0x91e6('0x55')]['id'],'from':(_0x31ea93[_0x91e6('0x8b')]||'')+'\x20'+(_0x31ea93[_0x91e6('0x8c')]||'')};var _0x3e6503={'OpenchannelAccountId':_0x593496[_0x91e6('0x55')]['id'],'closed':![]};if(_0x593496['body'][_0x91e6('0x8d')]){_0x3e6503[_0x91e6('0x8d')]=_0x593496['body'][_0x91e6('0x8d')];return db[_0x91e6('0x8e')][_0x91e6('0x56')]({'where':_0x3e6503})['then'](function(_0xe4bd10){if(_0xe4bd10){return[_0xe4bd10,![]];}_0x2ec498['threadId']=_0x593496[_0x91e6('0x58')][_0x91e6('0x8d')];_0x2ec498[_0x91e6('0x8f')]=_0x593496[_0x91e6('0x58')][_0x91e6('0x8f')];return db['OpenchannelInteraction']['create'](_0x2ec498)['then'](function(_0x520538){return[_0x520538,!![]];});});}else{_0x3e6503[_0x91e6('0x8d')]=null;}_0x3e6503[_0x91e6('0x90')]=_0x31ea93['id'];return db[_0x91e6('0x8e')][_0x91e6('0x56')]({'where':_0x3e6503})[_0x91e6('0x23')](function(_0x4460fb){if(_0x4460fb){return[_0x4460fb,![]];}return db[_0x91e6('0x8e')]['create'](_0x2ec498)[_0x91e6('0x23')](function(_0x10e969){return[_0x10e969,!![]];});});}})['spread'](function(_0x4db21c,_0x29a1fb){if(_0x4db21c){_0x2bbe2b=_0x29a1fb;if(!_0x29a1fb){var _0x5a88cf={'from':(_0x59acb3['contact']['firstName']||'')+'\x20'+(_0x59acb3[_0x91e6('0x8a')][_0x91e6('0x8c')]||'')};if(_0x593496[_0x91e6('0x58')][_0x91e6('0x8d')]&&_0x593496[_0x91e6('0x58')][_0x91e6('0x91')]&&_0x593496[_0x91e6('0x58')][_0x91e6('0x8d')]!=_0x593496[_0x91e6('0x58')][_0x91e6('0x91')]){_0x5a88cf[_0x91e6('0x8d')]=_0x593496['body'][_0x91e6('0x91')];}return _0x4db21c[_0x91e6('0x5e')](_0x5a88cf);}else{return _0x4db21c;}}})[_0x91e6('0x23')](function(_0x26b7bb){_0x59acb3[_0x91e6('0x92')]=_0x26b7bb[_0x91e6('0x5a')]({'plain':!![]});_0x59acb3[_0x91e6('0x92')]['created']=_0x2bbe2b;if(_0x59acb3[_0x91e6('0x92')][_0x91e6('0x93')]){if(_0x59acb3[_0x91e6('0x83')][_0x91e6('0x94')]){_0x59acb3[_0x91e6('0x84')]['push']({'id':0x0,'priority':_0x59acb3[_0x91e6('0x84')][_0x91e6('0x49')]+0x1,'app':'close','appdata':_0x91e6('0x95'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x91e6('0x57')]({'body':_0x593496[_0x91e6('0x58')][_0x91e6('0x58')],'OpenchannelAccountId':_0x593496[_0x91e6('0x55')]['id'],'OpenchannelInteractionId':_0x26b7bb['id'],'direction':'in','ContactId':_0x59acb3[_0x91e6('0x8a')]['id'],'AttachmentId':_0x593496[_0x91e6('0x58')][_0x91e6('0x96')]});})[_0x91e6('0x23')](function(_0xbf654b){_0x59acb3[_0x91e6('0x2a')]=_0xbf654b;if(_0x59acb3['interaction'][_0x91e6('0x97')]){return db[_0x91e6('0x98')]['find']({'attributes':['id','name'],'where':{'id':_0x59acb3[_0x91e6('0x92')][_0x91e6('0x97')]}})['then'](function(_0x52dc48){if(_0x52dc48){_0x59acb3[_0x91e6('0x84')][_0x91e6('0x99')]({'id':0x0,'priority':0x0,'app':_0x91e6('0x9a'),'appdata':_0x52dc48[_0x91e6('0x39')]+','+(_0x59acb3[_0x91e6('0x83')][_0x91e6('0x9b')]||0xa),'interval':_0x91e6('0x9c')});_0x59acb3['forcedOwnership']=![];}return respondWithRpcPromise(_0x91e6('0x9d'),_0x91e6('0x9e'),_0x59acb3);});}return respondWithRpcPromise(_0x91e6('0x9d'),_0x91e6('0x9e'),_0x59acb3);})[_0x91e6('0x23')](function(_0x14d0ff){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x14d0ff},client9002);return _0x14d0ff;})[_0x91e6('0x23')](respondWithResult(_0x54ee2a,null))[_0x91e6('0x2c')](handleError(_0x54ee2a,null));};exports[_0x91e6('0x9f')]=function(_0x5dc7d4,_0x300ca2,_0x4fa99b){return db[_0x91e6('0x52')][_0x91e6('0x63')]({'where':{'id':_0x5dc7d4['params']['id']}})[_0x91e6('0x23')](handleEntityNotFound(_0x300ca2,null))[_0x91e6('0x23')](function(_0x124579){if(_0x124579){return db[_0x91e6('0xa0')][_0x91e6('0xa1')](function(_0x2eb58c){return db[_0x91e6('0x81')][_0x91e6('0xa2')]({'where':{'OpenchannelAccountId':_0x5dc7d4[_0x91e6('0x55')]['id']},'transaction':_0x2eb58c})[_0x91e6('0x23')](function(_0x5e5766){var _0x42d905=_[_0x91e6('0x3d')](_0x5dc7d4[_0x91e6('0x58')],function(_0x50a213){_0x50a213[_0x91e6('0x66')]=_0x5dc7d4['params']['id'];return _0x50a213;});return db['OpenchannelApplication'][_0x91e6('0xa3')](_0x42d905,{'transaction':_0x2eb58c});});})[_0x91e6('0x23')](function(){return db['OpenchannelApplication'][_0x91e6('0xa4')]({'where':{'OpenchannelAccountId':_0x5dc7d4[_0x91e6('0x55')]['id']},'order':'priority'});});}})[_0x91e6('0x23')](respondWithResult(_0x300ca2,null))[_0x91e6('0x2c')](handleError(_0x300ca2,null));};exports['getApplications']=function(_0x51c058,_0x40f13e,_0x31661f){var _0x224890={};var _0x2405da={};var _0x22fd27;var _0x2ae995;return db['OpenchannelAccount'][_0x91e6('0x63')]({'where':{'id':_0x51c058[_0x91e6('0x55')]['id']}})[_0x91e6('0x23')](handleEntityNotFound(_0x40f13e,null))[_0x91e6('0x23')](function(_0x1be13f){if(_0x1be13f){_0x22fd27=_0x1be13f;_0x2405da['model']=_[_0x91e6('0x44')](db['OpenchannelApplication'][_0x91e6('0x3e')]);_0x2405da['query']=_[_0x91e6('0x44')](_0x51c058['query']);_0x2405da[_0x91e6('0x45')]=_[_0x91e6('0x46')](_0x2405da[_0x91e6('0x42')],_0x2405da['query']);_0x224890[_0x91e6('0x47')]=_[_0x91e6('0x46')](_0x2405da[_0x91e6('0x42')],qs[_0x91e6('0x48')](_0x51c058[_0x91e6('0x43')][_0x91e6('0x48')]));_0x224890[_0x91e6('0x47')]=_0x224890[_0x91e6('0x47')][_0x91e6('0x49')]?_0x224890['attributes']:_0x2405da[_0x91e6('0x42')];_0x224890['order']=qs['sort'](_0x51c058[_0x91e6('0x43')][_0x91e6('0x4c')]);_0x224890['where']=qs[_0x91e6('0x45')](_[_0x91e6('0xa5')](_0x51c058[_0x91e6('0x43')],_0x2405da[_0x91e6('0x45')]));if(_0x51c058['query'][_0x91e6('0x4e')]){_0x224890[_0x91e6('0x4d')]=_['merge'](_0x224890[_0x91e6('0x4d')],{'$or':_['map'](_0x224890[_0x91e6('0x47')],function(_0x54c568){var _0x48da10={};_0x48da10[_0x54c568]={'$like':'%'+_0x51c058[_0x91e6('0x43')][_0x91e6('0x4e')]+'%'};return _0x48da10;})});}_0x224890=_['merge']({},_0x224890,_0x51c058[_0x91e6('0x51')]);return _0x22fd27[_0x91e6('0xa6')](_0x224890);}})[_0x91e6('0x23')](function(_0x4e63bb){if(_0x4e63bb){_0x2ae995=_0x4e63bb[_0x91e6('0x49')];if(!_0x51c058[_0x91e6('0x43')]['hasOwnProperty'](_0x91e6('0x4a'))){_0x224890['limit']=qs[_0x91e6('0x32')](_0x51c058['query'][_0x91e6('0x32')]);_0x224890[_0x91e6('0x31')]=qs['offset'](_0x51c058[_0x91e6('0x43')][_0x91e6('0x31')]);}return _0x22fd27[_0x91e6('0xa6')](_0x224890);}})[_0x91e6('0x23')](function(_0xee22bb){if(_0xee22bb){return _0xee22bb?{'count':_0x2ae995,'rows':_0xee22bb}:null;}})['then'](respondWithResult(_0x40f13e,null))[_0x91e6('0x2c')](handleError(_0x40f13e,null));};exports['getInteractions']=function(_0x2b7578,_0x3827dd,_0x42df21){var _0x3eaada={'raw':![],'where':{}};var _0x50064e={};var _0x277cd5={'count':0x0,'rows':[]};return db[_0x91e6('0x52')][_0x91e6('0x63')]({'where':{'id':_0x2b7578[_0x91e6('0x55')]['id']}})['then'](handleEntityNotFound(_0x3827dd,null))[_0x91e6('0x23')](function(_0x41adcd){if(_0x41adcd){_0x50064e['model']=_['keys'](db[_0x91e6('0x8e')]['rawAttributes']);_0x50064e[_0x91e6('0x43')]=_['keys'](_0x2b7578[_0x91e6('0x43')]);_0x50064e[_0x91e6('0x45')]=_['intersection'](_0x50064e['model'],_0x50064e['query']);_0x3eaada['attributes']=_['intersection'](_0x50064e[_0x91e6('0x42')],qs[_0x91e6('0x48')](_0x2b7578[_0x91e6('0x43')][_0x91e6('0x48')]));_0x3eaada[_0x91e6('0x47')]=_0x3eaada[_0x91e6('0x47')][_0x91e6('0x49')]?_0x3eaada[_0x91e6('0x47')]:_0x50064e['model'];if(!_0x2b7578[_0x91e6('0x43')][_0x91e6('0x65')]('nolimit')){_0x3eaada['limit']=qs['limit'](_0x2b7578[_0x91e6('0x43')][_0x91e6('0x32')]);_0x3eaada['offset']=qs[_0x91e6('0x31')](_0x2b7578[_0x91e6('0x43')][_0x91e6('0x31')]);}_0x3eaada['order']=qs[_0x91e6('0x4c')](_0x2b7578[_0x91e6('0x43')][_0x91e6('0x4c')]);_0x3eaada['where']=qs[_0x91e6('0x45')](_[_0x91e6('0xa5')](_0x2b7578['query'],_0x50064e[_0x91e6('0x45')]));_0x3eaada[_0x91e6('0x4d')]['OpenchannelAccountId']=_0x41adcd['id'];if(_0x2b7578[_0x91e6('0x43')]['filter']){_0x3eaada[_0x91e6('0x4d')]=_[_0x91e6('0x4f')](_0x3eaada[_0x91e6('0x4d')],{'$or':_[_0x91e6('0x3d')](_0x3eaada[_0x91e6('0x47')],function(_0x7d8505){var _0xa9958f={};_0xa9958f[_0x7d8505]={'$like':'%'+_0x2b7578[_0x91e6('0x43')]['filter']+'%'};return _0xa9958f;})});}_0x3eaada=_['merge']({},_0x3eaada,_0x2b7578[_0x91e6('0x51')]);return db[_0x91e6('0x8e')][_0x91e6('0x30')]({'where':_0x3eaada[_0x91e6('0x4d')]})['then'](function(_0x163718){_0x277cd5[_0x91e6('0x30')]=_0x163718;if(_0x2b7578['query'][_0x91e6('0x53')]){_0x3eaada[_0x91e6('0x54')]=[{'model':db[_0x91e6('0x6f')],'as':_0x91e6('0xa7'),'required':![]},{'model':db[_0x91e6('0x98')],'as':'Owner','attributes':[_0x91e6('0x39'),_0x91e6('0xa8'),'internal'],'required':![]},{'model':db[_0x91e6('0xa9')],'as':_0x91e6('0xaa'),'attributes':['id','name','color'],'where':_0x2b7578[_0x91e6('0x43')]['tag']?{'id':_0x2b7578[_0x91e6('0x43')][_0x91e6('0xab')]}:undefined,'required':_0x2b7578['query']['tag']?!![]:![]}];}return db[_0x91e6('0x8e')][_0x91e6('0xac')](_0x3eaada);})[_0x91e6('0x23')](function(_0x36e661){_0x277cd5[_0x91e6('0x67')]=_0x36e661;return _0x277cd5;});}})['then'](respondWithFilteredResult(_0x3827dd,_0x3eaada))[_0x91e6('0x2c')](handleError(_0x3827dd,null));};exports[_0x91e6('0xad')]=function(_0x125389,_0x96ae33,_0x5884c3){return db['OpenchannelAccount']['find']({'where':{'id':_0x125389[_0x91e6('0x55')]['id']}})[_0x91e6('0x23')](handleEntityNotFound(_0x96ae33,null))[_0x91e6('0x23')](function(_0xd8b223){if(_0xd8b223){return _0xd8b223[_0x91e6('0xad')](_0x125389[_0x91e6('0x58')][_0x91e6('0x69')],_[_0x91e6('0xae')](_0x125389[_0x91e6('0x58')],[_0x91e6('0x69'),'id'])||{})[_0x91e6('0xaf')](function(_0x7e692e){for(var _0x361103=0x0;_0x361103<_0x125389[_0x91e6('0x58')]['ids'][_0x91e6('0x49')];_0x361103+=0x1){socket['emit'](_0x91e6('0xb0'),{'UserId':_0x125389[_0x91e6('0x58')][_0x91e6('0x69')][_0x361103],'OpenchannelAccountId':_0x125389['params']['id']});}return _0x7e692e;});}})['then'](respondWithResult(_0x96ae33,null))[_0x91e6('0x2c')](handleError(_0x96ae33,null));};exports['removeAgents']=function(_0x39c056,_0x4448f6,_0x14ea83){return db['OpenchannelAccount']['find']({'where':{'id':_0x39c056[_0x91e6('0x55')]['id']}})[_0x91e6('0x23')](handleEntityNotFound(_0x4448f6,null))[_0x91e6('0x23')](function(_0x3ff8da){if(_0x3ff8da){return _0x3ff8da[_0x91e6('0xb1')](_0x39c056[_0x91e6('0x43')][_0x91e6('0x69')])[_0x91e6('0x23')](function(){if(_['isArray'](_0x39c056[_0x91e6('0x43')][_0x91e6('0x69')])){for(var _0x381ac4=0x0;_0x381ac4<_0x39c056[_0x91e6('0x43')]['ids'][_0x91e6('0x49')];_0x381ac4+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x39c056[_0x91e6('0x43')]['ids'][_0x381ac4]),'OpenchannelAccountId':Number(_0x39c056[_0x91e6('0x55')]['id'])});}}else{socket['emit'](_0x91e6('0xb2'),{'UserId':Number(_0x39c056[_0x91e6('0x43')][_0x91e6('0x69')]),'OpenchannelAccountId':Number(_0x39c056[_0x91e6('0x55')]['id'])});}});}})[_0x91e6('0x23')](respondWithStatusCode(_0x4448f6,null))[_0x91e6('0x2c')](handleError(_0x4448f6,null));};exports['getAgents']=function(_0xec4d08,_0x289e5e,_0x3f16f3){var _0x1ced1d={};var _0x290c24={};var _0xb7471b;var _0xb1c3ba;return db[_0x91e6('0x52')][_0x91e6('0x63')]({'where':{'id':_0xec4d08[_0x91e6('0x55')]['id']}})['then'](handleEntityNotFound(_0x289e5e,null))['then'](function(_0x297d27){if(_0x297d27){_0xb7471b=_0x297d27;_0x290c24[_0x91e6('0x42')]=_['keys'](db[_0x91e6('0x98')][_0x91e6('0x3e')]);_0x290c24['query']=_['keys'](_0xec4d08[_0x91e6('0x43')]);_0x290c24[_0x91e6('0x45')]=_[_0x91e6('0x46')](_0x290c24['model'],_0x290c24[_0x91e6('0x43')]);_0x1ced1d[_0x91e6('0x47')]=_[_0x91e6('0x46')](_0x290c24[_0x91e6('0x42')],qs[_0x91e6('0x48')](_0xec4d08[_0x91e6('0x43')][_0x91e6('0x48')]));_0x1ced1d['attributes']=_0x1ced1d['attributes']['length']?_0x1ced1d[_0x91e6('0x47')]:_0x290c24[_0x91e6('0x42')];_0x1ced1d[_0x91e6('0x4b')]=qs[_0x91e6('0x4c')](_0xec4d08[_0x91e6('0x43')]['sort']);_0x1ced1d['where']=qs[_0x91e6('0x45')](_[_0x91e6('0xa5')](_0xec4d08[_0x91e6('0x43')],_0x290c24[_0x91e6('0x45')]));if(_0xec4d08[_0x91e6('0x43')]['filter']){_0x1ced1d[_0x91e6('0x4d')]=_['merge'](_0x1ced1d[_0x91e6('0x4d')],{'$or':_[_0x91e6('0x3d')](_0x1ced1d[_0x91e6('0x47')],function(_0x492684){var _0x355cd1={};_0x355cd1[_0x492684]={'$like':'%'+_0xec4d08[_0x91e6('0x43')][_0x91e6('0x4e')]+'%'};return _0x355cd1;})});}_0x1ced1d=_[_0x91e6('0x4f')]({},_0x1ced1d,_0xec4d08[_0x91e6('0x51')]);return _0xb7471b[_0x91e6('0xb3')](_0x1ced1d);}})[_0x91e6('0x23')](function(_0x3ca68d){if(_0x3ca68d){_0xb1c3ba=_0x3ca68d[_0x91e6('0x49')];if(!_0xec4d08['query'][_0x91e6('0x65')](_0x91e6('0x4a'))){_0x1ced1d[_0x91e6('0x32')]=qs[_0x91e6('0x32')](_0xec4d08[_0x91e6('0x43')][_0x91e6('0x32')]);_0x1ced1d[_0x91e6('0x31')]=qs[_0x91e6('0x31')](_0xec4d08[_0x91e6('0x43')]['offset']);}return _0xb7471b[_0x91e6('0xb3')](_0x1ced1d);}})[_0x91e6('0x23')](function(_0x394305){if(_0x394305){return _0x394305?{'count':_0xb1c3ba,'rows':_0x394305}:null;}})['then'](respondWithResult(_0x289e5e,null))[_0x91e6('0x2c')](handleError(_0x289e5e,null));};exports[_0x91e6('0x3a')]=function(_0x415963,_0x43f147,_0x4e9fec){var _0xc226c3,_0x34d6f0,_0x5c01ab;if(_[_0x91e6('0x77')](_0x415963[_0x91e6('0x58')][_0x91e6('0x58')])||_0x415963[_0x91e6('0x58')][_0x91e6('0x58')]===''){throw new db[(_0x91e6('0x22'))][(_0x91e6('0x70'))](_0x91e6('0x79'));}if(_[_0x91e6('0x77')](_0x415963[_0x91e6('0x58')]['to'])){}_0xc226c3=_0x415963[_0x91e6('0x58')]['to'];return db[_0x91e6('0x52')][_0x91e6('0x63')]({'where':{'id':_0x415963[_0x91e6('0x55')]['id']}})[_0x91e6('0x23')](handleEntityNotFound(_0x43f147,null))[_0x91e6('0x23')](function(_0x565869){if(_0x565869){return db[_0x91e6('0x52')]['find']({'where':{'id':_0x565869['id']},'include':[{'model':db[_0x91e6('0x7d')],'as':_0x91e6('0x7e'),'include':[{'model':db[_0x91e6('0x6f')],'as':'Contacts','where':{[_0x565869[_0x91e6('0x7a')]]:_0xc226c3},'limit':0x1,'order':[[_0x91e6('0x74'),'DESC']]}]}]})[_0x91e6('0x23')](handleEntityNotFound(_0x43f147,null))['then'](function(_0x2037b0){if(_0x2037b0&&_0x2037b0['List']){_0x34d6f0=_0x2037b0['get']({'plain':!![]});if(_0x34d6f0[_0x91e6('0x7e')]&&_0x34d6f0[_0x91e6('0x7e')][_0x91e6('0x7f')][_0x91e6('0x49')]){return _0x34d6f0['List'][_0x91e6('0x7f')][0x0];}return db[_0x91e6('0x6f')][_0x91e6('0x57')](_[_0x91e6('0x19')](_0x415963[_0x91e6('0x58')],{'firstName':_0xc226c3,[_0x2037b0[_0x91e6('0x7a')]]:_0xc226c3,'phone':_0xc226c3,'ListId':_0x34d6f0[_0x91e6('0x76')]}));}})[_0x91e6('0x23')](handleEntityNotFound(_0x43f147,null))[_0x91e6('0x23')](function(_0x12f3f8){if(_0x12f3f8){_0x5c01ab=_0x12f3f8;return db[_0x91e6('0x8e')][_0x91e6('0x56')]({'where':{'ContactId':_0x5c01ab['id'],'closed':![],'OpenchannelAccountId':_0x34d6f0['id']}})['then'](function(_0x3eee5f){if(_0x3eee5f){return[_0x3eee5f,![]];}return db[_0x91e6('0x8e')][_0x91e6('0x57')]({'UserId':_0x415963[_0x91e6('0x59')]['id'],'ContactId':_0x5c01ab['id'],'OpenchannelAccountId':_0x34d6f0['id'],'lastMsgDirection':'out','Messages':[_[_0x91e6('0x4f')](_0x415963[_0x91e6('0x58')],{'read':![],'body':_0x415963[_0x91e6('0x58')]['body'],'OpenchannelAccountId':_0x34d6f0['id'],'UserId':_0x415963['user']['id'],'ContactId':_0x5c01ab['id']})]},{'include':[{'model':db[_0x91e6('0xb4')],'as':_0x91e6('0xb5')}]})[_0x91e6('0x23')](function(_0x2e998b){return[_0x2e998b,!![]];});});}})[_0x91e6('0xaf')](function(_0x2d231a,_0x581c39){if(_0x581c39){return _0x2d231a;}return db[_0x91e6('0xb4')][_0x91e6('0x57')](_['merge'](_0x415963[_0x91e6('0x58')],{'read':![],'body':_0x415963[_0x91e6('0x58')][_0x91e6('0x58')],'OpenchannelAccountId':_0x34d6f0['id'],'OpenchannelInteractionId':_0x2d231a['id'],'UserId':_0x415963['user']['id'],'ContactId':_0x5c01ab['id']}))[_0x91e6('0x23')](function(_0x15e2f6){_0x2d231a[_0x91e6('0xb6')][_0x91e6('0xb5')]=[];_0x2d231a[_0x91e6('0xb6')][_0x91e6('0xb5')][_0x91e6('0xb7')](_0x15e2f6[_0x91e6('0xb6')]);return _0x2d231a;});});}})[_0x91e6('0x23')](respondWithResult(_0x43f147,null))[_0x91e6('0x2c')](handleError(_0x43f147,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index fc746f0..7c9330e 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 _0x5207=['emit','hasOwnProperty','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update'];(function(_0xbae74f,_0x38ef30){var _0x41c9b7=function(_0x1d54dc){while(--_0x1d54dc){_0xbae74f['push'](_0xbae74f['shift']());}};_0x41c9b7(++_0x38ef30);}(_0x5207,0xdb));var _0x7520=function(_0x12e7da,_0xde02cb){_0x12e7da=_0x12e7da-0x0;var _0xe03607=_0x5207[_0x12e7da];return _0xe03607;};'use strict';var EventEmitter=require(_0x7520('0x0'));var OpenchannelAccount=require(_0x7520('0x1'))['db'][_0x7520('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7520('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7520('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1f6516){return function(_0x321911,_0x4d1117,_0x1ed0a9){OpenchannelAccountEvents[_0x7520('0x5')](_0x1f6516+':'+_0x321911['id'],_0x321911);OpenchannelAccountEvents['emit'](_0x1f6516,_0x321911);_0x1ed0a9(null);};}for(var e in events){if(events[_0x7520('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x8565=['remove','emit','exports','events','../../mysqldb','OpenchannelAccount','save','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8565,0xab));var _0x5856=function(_0xa8a3d2,_0x49b0c3){_0xa8a3d2=_0xa8a3d2-0x0;var _0x4b4f2b=_0x8565[_0xa8a3d2];return _0x4b4f2b;};'use strict';var EventEmitter=require(_0x5856('0x0'));var OpenchannelAccount=require(_0x5856('0x1'))['db'][_0x5856('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5856('0x3'),'afterUpdate':_0x5856('0x4'),'afterDestroy':_0x5856('0x5')};function emitEvent(_0x3a9e23){return function(_0x5498ee,_0x43d09e,_0x494d9){OpenchannelAccountEvents[_0x5856('0x6')](_0x3a9e23+':'+_0x5498ee['id'],_0x5498ee);OpenchannelAccountEvents['emit'](_0x3a9e23,_0x5498ee);_0x494d9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x5856('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 24efdfd..c6f8c89 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 _0x26d3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define'];(function(_0x4de936,_0x1c4a26){var _0x119fd0=function(_0x4a6134){while(--_0x4a6134){_0x4de936['push'](_0x4de936['shift']());}};_0x119fd0(++_0x1c4a26);}(_0x26d3,0x16c));var _0x326d=function(_0x25fb75,_0x45cab4){_0x25fb75=_0x25fb75-0x0;var _0x2a2887=_0x26d3[_0x25fb75];return _0x2a2887;};'use strict';var _=require(_0x326d('0x0'));var util=require(_0x326d('0x1'));var logger=require(_0x326d('0x2'))(_0x326d('0x3'));var moment=require(_0x326d('0x4'));var BPromise=require(_0x326d('0x5'));var rp=require(_0x326d('0x6'));var fs=require('fs');var path=require(_0x326d('0x7'));var rimraf=require(_0x326d('0x8'));var config=require(_0x326d('0x9'));var attributes=require(_0x326d('0xa'));module[_0x326d('0xb')]=function(_0x34b69b,_0x41cace){return _0x34b69b[_0x326d('0xc')]('OpenchannelAccount',attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd73e=['rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x19b351,_0x547358){var _0x104803=function(_0x412161){while(--_0x412161){_0x19b351['push'](_0x19b351['shift']());}};_0x104803(++_0x547358);}(_0xd73e,0x165));var _0xed73=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd73e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xed73('0x0'));var util=require(_0xed73('0x1'));var logger=require(_0xed73('0x2'))(_0xed73('0x3'));var moment=require(_0xed73('0x4'));var BPromise=require('bluebird');var rp=require(_0xed73('0x5'));var fs=require('fs');var path=require(_0xed73('0x6'));var rimraf=require(_0xed73('0x7'));var config=require(_0xed73('0x8'));var attributes=require(_0xed73('0x9'));module[_0xed73('0xa')]=function(_0x5b2049,_0x7b862d){return _0x5b2049[_0xed73('0xb')](_0xed73('0xc'),attributes,{'tableName':_0xed73('0xd'),'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 8d0b351..219115d 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 _0x73d3=['defaults','localhost','socket.io-emitter','./openchannelAccount.socket','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','lodash','util','moment','bluebird','ioredis','../../config/logger','client','http','redis'];(function(_0x110a77,_0x2003a8){var _0xdce10=function(_0x3ec251){while(--_0x3ec251){_0x110a77['push'](_0x110a77['shift']());}};_0xdce10(++_0x2003a8);}(_0x73d3,0x147));var _0x373d=function(_0x1bd190,_0x229bec){_0x1bd190=_0x1bd190-0x0;var _0x3314c5=_0x73d3[_0x1bd190];return _0x3314c5;};'use strict';var _=require(_0x373d('0x0'));var util=require(_0x373d('0x1'));var moment=require(_0x373d('0x2'));var BPromise=require(_0x373d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x373d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x373d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x373d('0x6')][_0x373d('0x7')]({'port':0x232a});config[_0x373d('0x8')]=_[_0x373d('0x9')](config[_0x373d('0x8')],{'host':_0x373d('0xa'),'port':0x18eb});var socket=require(_0x373d('0xb'))(new Redis(config['redis']));require(_0x373d('0xc'))['register'](socket);function respondWithRpcPromise(_0x4f62ba,_0x10918c,_0x3e52fa){return new BPromise(function(_0x1cc735,_0x156cde){return client['request'](_0x4f62ba,_0x3e52fa)['then'](function(_0x8aff8c){logger[_0x373d('0xd')]('OpenchannelAccount,\x20%s,\x20%s',_0x10918c,'request\x20sent');logger[_0x373d('0xe')](_0x373d('0xf'),_0x10918c,'request\x20sent',JSON[_0x373d('0x10')](_0x8aff8c));if(_0x8aff8c[_0x373d('0x11')]){if(_0x8aff8c[_0x373d('0x11')]['code']===0x1f4){logger['error'](_0x373d('0x12'),_0x10918c,_0x8aff8c[_0x373d('0x11')]['message']);return _0x156cde(_0x8aff8c['error'][_0x373d('0x13')]);}logger[_0x373d('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x10918c,_0x8aff8c[_0x373d('0x11')]['message']);return _0x1cc735(_0x8aff8c[_0x373d('0x11')][_0x373d('0x13')]);}else{logger[_0x373d('0xd')](_0x373d('0x12'),_0x10918c,_0x373d('0x14'));_0x1cc735(_0x8aff8c['result'][_0x373d('0x13')]);}})['catch'](function(_0x1493dd){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x10918c,_0x1493dd);_0x156cde(_0x1493dd);});});} \ No newline at end of file +var _0x12e8=['info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then'];(function(_0xe74c41,_0x587661){var _0x13a6dc=function(_0x2ad813){while(--_0x2ad813){_0xe74c41['push'](_0xe74c41['shift']());}};_0x13a6dc(++_0x587661);}(_0x12e8,0x175));var _0x812e=function(_0x69928,_0x1b56b8){_0x69928=_0x69928-0x0;var _0xd112e6=_0x12e8[_0x69928];return _0xd112e6;};'use strict';var _=require(_0x812e('0x0'));var util=require(_0x812e('0x1'));var moment=require(_0x812e('0x2'));var BPromise=require(_0x812e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x812e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x812e('0x5'));var logger=require(_0x812e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x812e('0x7')][_0x812e('0x8')]({'port':0x232a});config[_0x812e('0x9')]=_[_0x812e('0xa')](config[_0x812e('0x9')],{'host':_0x812e('0xb'),'port':0x18eb});var socket=require(_0x812e('0xc'))(new Redis(config[_0x812e('0x9')]));require(_0x812e('0xd'))[_0x812e('0xe')](socket);function respondWithRpcPromise(_0x2bcb4a,_0x206256,_0x49532f){return new BPromise(function(_0x208866,_0x191420){return client[_0x812e('0xf')](_0x2bcb4a,_0x49532f)[_0x812e('0x10')](function(_0x66237d){logger[_0x812e('0x11')](_0x812e('0x12'),_0x206256,_0x812e('0x13'));logger[_0x812e('0x14')](_0x812e('0x15'),_0x206256,_0x812e('0x13'),JSON[_0x812e('0x16')](_0x66237d));if(_0x66237d[_0x812e('0x17')]){if(_0x66237d['error']['code']===0x1f4){logger['error'](_0x812e('0x12'),_0x206256,_0x66237d[_0x812e('0x17')]['message']);return _0x191420(_0x66237d[_0x812e('0x17')]['message']);}logger[_0x812e('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x206256,_0x66237d[_0x812e('0x17')][_0x812e('0x18')]);return _0x208866(_0x66237d['error'][_0x812e('0x18')]);}else{logger[_0x812e('0x11')](_0x812e('0x12'),_0x206256,_0x812e('0x13'));_0x208866(_0x66237d[_0x812e('0x19')][_0x812e('0x18')]);}})['catch'](function(_0x35552b){logger[_0x812e('0x17')](_0x812e('0x12'),_0x206256,_0x35552b);_0x191420(_0x35552b);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9e5ba9b..71d3d37 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 _0xbd02=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener','length'];(function(_0x45e9c0,_0x8634af){var _0x31cb6e=function(_0x54f0ea){while(--_0x54f0ea){_0x45e9c0['push'](_0x45e9c0['shift']());}};_0x31cb6e(++_0x8634af);}(_0xbd02,0x69));var _0x2bd0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xbd02[_0x465a0c];return _0x1e202e;};'use strict';var OpenchannelAccountEvents=require(_0x2bd0('0x0'));var events=[_0x2bd0('0x1'),_0x2bd0('0x2'),_0x2bd0('0x3')];function createListener(_0x49b044,_0xce8737){return function(_0xb64801){_0xce8737[_0x2bd0('0x4')](_0x49b044,_0xb64801);};}function removeListener(_0x2d1c22,_0x244b65){return function(){OpenchannelAccountEvents[_0x2bd0('0x5')](_0x2d1c22,_0x244b65);};}exports['register']=function(_0x1de717){for(var _0x11d859=0x0,_0xf81804=events[_0x2bd0('0x6')];_0x11d859<_0xf81804;_0x11d859++){var _0x1430fa=events[_0x11d859];var _0x5cb428=createListener(_0x2bd0('0x7')+_0x1430fa,_0x1de717);OpenchannelAccountEvents['on'](_0x1430fa,_0x5cb428);}}; \ No newline at end of file +var _0xd147=['register','length','openchannelAccount:','./openchannelAccount.events','remove','update','emit','removeListener'];(function(_0x48b554,_0x454aac){var _0x25dcdf=function(_0x5a7011){while(--_0x5a7011){_0x48b554['push'](_0x48b554['shift']());}};_0x25dcdf(++_0x454aac);}(_0xd147,0x17b));var _0x7d14=function(_0x938f02,_0x189e55){_0x938f02=_0x938f02-0x0;var _0x3935da=_0xd147[_0x938f02];return _0x3935da;};'use strict';var OpenchannelAccountEvents=require(_0x7d14('0x0'));var events=['save',_0x7d14('0x1'),_0x7d14('0x2')];function createListener(_0x512f49,_0x3b8269){return function(_0xbc486a){_0x3b8269[_0x7d14('0x3')](_0x512f49,_0xbc486a);};}function removeListener(_0x57cf92,_0x38e646){return function(){OpenchannelAccountEvents[_0x7d14('0x4')](_0x57cf92,_0x38e646);};}exports[_0x7d14('0x5')]=function(_0x4be7fe){for(var _0x28903f=0x0,_0x34ad91=events[_0x7d14('0x6')];_0x28903f<_0x34ad91;_0x28903f++){var _0x2654f6=events[_0x28903f];var _0x454e49=createListener(_0x7d14('0x7')+_0x2654f6,_0x4be7fe);OpenchannelAccountEvents['on'](_0x2654f6,_0x454e49);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 60647aa..2146e6d 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 _0x2cb1=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','create','/:id','update','destroy','exports','multer','path'];(function(_0x36feb2,_0x53abef){var _0x292b43=function(_0x52a460){while(--_0x52a460){_0x36feb2['push'](_0x36feb2['shift']());}};_0x292b43(++_0x53abef);}(_0x2cb1,0x1a7));var _0x12cb=function(_0x470cd7,_0x474f17){_0x470cd7=_0x470cd7-0x0;var _0xa527b8=_0x2cb1[_0x470cd7];return _0xa527b8;};'use strict';var multer=require(_0x12cb('0x0'));var util=require('util');var path=require(_0x12cb('0x1'));var timeout=require(_0x12cb('0x2'));var express=require(_0x12cb('0x3'));var router=express[_0x12cb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x12cb('0x5'));var config=require(_0x12cb('0x6'));var controller=require(_0x12cb('0x7'));router[_0x12cb('0x8')]('/',auth[_0x12cb('0x9')](),controller[_0x12cb('0xa')]);router['get']('/:id',auth[_0x12cb('0x9')](),controller[_0x12cb('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x12cb('0xc')]);router['put'](_0x12cb('0xd'),auth[_0x12cb('0x9')](),controller[_0x12cb('0xe')]);router['delete'](_0x12cb('0xd'),auth[_0x12cb('0x9')](),controller[_0x12cb('0xf')]);module[_0x12cb('0x10')]=router; \ No newline at end of file +var _0x40be=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','get','show','create','put','delete','/:id','destroy','exports','multer','util'];(function(_0x5dfc90,_0x505c8a){var _0x51101e=function(_0x261333){while(--_0x261333){_0x5dfc90['push'](_0x5dfc90['shift']());}};_0x51101e(++_0x505c8a);}(_0x40be,0x12e));var _0xe40b=function(_0x489c30,_0x3be56e){_0x489c30=_0x489c30-0x0;var _0x2b5b59=_0x40be[_0x489c30];return _0x2b5b59;};'use strict';var multer=require(_0xe40b('0x0'));var util=require(_0xe40b('0x1'));var path=require(_0xe40b('0x2'));var timeout=require(_0xe40b('0x3'));var express=require(_0xe40b('0x4'));var router=express[_0xe40b('0x5')]();var auth=require(_0xe40b('0x6'));var interaction=require(_0xe40b('0x7'));var config=require(_0xe40b('0x8'));var controller=require(_0xe40b('0x9'));router['get']('/',auth[_0xe40b('0xa')](),controller['index']);router[_0xe40b('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe40b('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe40b('0xd')]);router[_0xe40b('0xe')]('/:id',auth[_0xe40b('0xa')](),controller['update']);router[_0xe40b('0xf')](_0xe40b('0x10'),auth['isAuthenticated'](),controller[_0xe40b('0x11')]);module[_0xe40b('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index d6cb190..861b6c4 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 _0xfa6a=['INTEGER','noop','*,*,*,*','sequelize'];(function(_0x5c8627,_0x5e65ff){var _0x77fd34=function(_0xf0abe7){while(--_0xf0abe7){_0x5c8627['push'](_0x5c8627['shift']());}};_0x77fd34(++_0x5e65ff);}(_0xfa6a,0x1a3));var _0xafa6=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xfa6a[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0xafa6('0x0'));module['exports']={'priority':{'type':Sequelize[_0xafa6('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xafa6('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xafa6('0x3')}}; \ No newline at end of file +var _0x6093=['TEXT','STRING','sequelize','exports','INTEGER','noop'];(function(_0x4fca99,_0x45f5ed){var _0x8c47a2=function(_0x1d3ffe){while(--_0x1d3ffe){_0x4fca99['push'](_0x4fca99['shift']());}};_0x8c47a2(++_0x45f5ed);}(_0x6093,0xe0));var _0x3609=function(_0x19bceb,_0x2504ac){_0x19bceb=_0x19bceb-0x0;var _0x433cc8=_0x6093[_0x19bceb];return _0x433cc8;};'use strict';var Sequelize=require(_0x3609('0x0'));module[_0x3609('0x1')]={'priority':{'type':Sequelize[_0x3609('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3609('0x3')},'appdata':{'type':Sequelize[_0x3609('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3609('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 654ea0d..b0a51a8 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 _0xc572=['order','sort','filter','where','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','OpenchannelApplication','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xc572,0x177));var _0x2c57=function(_0x471c97,_0x2fd86f){_0x471c97=_0x471c97-0x0;var _0xce6cf9=_0xc572[_0x471c97];return _0xce6cf9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2c57('0x0'));var rimraf=require(_0x2c57('0x1'));var zipdir=require(_0x2c57('0x2'));var jsonpatch=require(_0x2c57('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2c57('0x4'));var Mustache=require(_0x2c57('0x5'));var util=require(_0x2c57('0x6'));var path=require('path');var sox=require(_0x2c57('0x7'));var csv=require(_0x2c57('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2c57('0x9'));var crypto=require(_0x2c57('0xa'));var jsforce=require(_0x2c57('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2c57('0x8'));var querystring=require(_0x2c57('0xc'));var Papa=require(_0x2c57('0xd'));var Redis=require('ioredis');var authService=require(_0x2c57('0xe'));var qs=require(_0x2c57('0xf'));var as=require(_0x2c57('0x10'));var hardwareService=require(_0x2c57('0x11'));var logger=require(_0x2c57('0x12'))(_0x2c57('0x13'));var utils=require(_0x2c57('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x445816,_0x48da2d){_0x48da2d=_0x48da2d||0xcc;return function(_0x45819d){if(_0x45819d){return _0x445816[_0x2c57('0x15')](_0x48da2d);}return _0x445816[_0x2c57('0x16')](_0x48da2d)[_0x2c57('0x17')]();};}function respondWithResult(_0x8e4fd1,_0x33ecf4){_0x33ecf4=_0x33ecf4||0xc8;return function(_0x5e8607){if(_0x5e8607){return _0x8e4fd1[_0x2c57('0x16')](_0x33ecf4)[_0x2c57('0x18')](_0x5e8607);}};}function respondWithFilteredResult(_0x2bd4ce,_0xbebf4b){return function(_0x19e4d9){if(_0x19e4d9){var _0x38f7a2=_0x19e4d9[_0x2c57('0x19')],_0x5a389a=_0xbebf4b[_0x2c57('0x1a')],_0x1f43e2=_0xbebf4b['offset']+_0xbebf4b[_0x2c57('0x1b')],_0x341496;if(_0x1f43e2>=_0x38f7a2){_0x1f43e2=_0x38f7a2;_0x341496=0xc8;}else{_0x341496=0xce;}_0x2bd4ce[_0x2c57('0x16')](_0x341496);return _0x2bd4ce[_0x2c57('0x1c')](_0x2c57('0x1d'),_0x5a389a+'-'+_0x1f43e2+'/'+_0x38f7a2)['json'](_0x19e4d9);}return null;};}function patchUpdates(_0x4bb372){return function(_0x24c127){try{jsonpatch[_0x2c57('0x1e')](_0x24c127,_0x4bb372,!![]);}catch(_0x2930f1){return BPromise[_0x2c57('0x1f')](_0x2930f1);}return _0x24c127[_0x2c57('0x20')]();};}function saveUpdates(_0x1279b6,_0x3a43ec){return function(_0x130090){if(_0x130090){return _0x130090['update'](_0x1279b6)[_0x2c57('0x21')](function(_0x4667f3){return _0x4667f3;});}return null;};}function removeEntity(_0x261edc,_0x272ff9){return function(_0x4ddf6e){if(_0x4ddf6e){return _0x4ddf6e[_0x2c57('0x22')]()[_0x2c57('0x21')](function(){_0x261edc[_0x2c57('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353dd9,_0x6c63bd){return function(_0x1f081f){if(!_0x1f081f){_0x353dd9[_0x2c57('0x15')](0x194);}return _0x1f081f;};}function handleError(_0x243935,_0x12ad09){_0x12ad09=_0x12ad09||0x1f4;return function(_0x4c642d){logger[_0x2c57('0x23')](_0x4c642d['stack']);if(_0x4c642d['name']){delete _0x4c642d[_0x2c57('0x24')];}_0x243935[_0x2c57('0x16')](_0x12ad09)[_0x2c57('0x25')](_0x4c642d);};}exports['index']=function(_0x26e252,_0x31ecde){var _0x277051={},_0x27d123={},_0xba5d7a={'count':0x0,'rows':[]};var _0x2adee=_['map'](db[_0x2c57('0x26')][_0x2c57('0x27')],function(_0x49222f){return{'name':_0x49222f[_0x2c57('0x28')],'type':_0x49222f['type']['key']};});_0x27d123[_0x2c57('0x29')]=_['map'](_0x2adee,_0x2c57('0x24'));_0x27d123[_0x2c57('0x2a')]=_[_0x2c57('0x2b')](_0x26e252[_0x2c57('0x2a')]);_0x27d123[_0x2c57('0x2c')]=_[_0x2c57('0x2d')](_0x27d123[_0x2c57('0x29')],_0x27d123[_0x2c57('0x2a')]);_0x277051[_0x2c57('0x2e')]=_[_0x2c57('0x2d')](_0x27d123[_0x2c57('0x29')],qs['fields'](_0x26e252['query'][_0x2c57('0x2f')]));_0x277051[_0x2c57('0x2e')]=_0x277051[_0x2c57('0x2e')][_0x2c57('0x30')]?_0x277051['attributes']:_0x27d123[_0x2c57('0x29')];if(!_0x26e252[_0x2c57('0x2a')][_0x2c57('0x31')](_0x2c57('0x32'))){_0x277051[_0x2c57('0x1b')]=qs[_0x2c57('0x1b')](_0x26e252['query'][_0x2c57('0x1b')]);_0x277051[_0x2c57('0x1a')]=qs[_0x2c57('0x1a')](_0x26e252[_0x2c57('0x2a')][_0x2c57('0x1a')]);}_0x277051[_0x2c57('0x33')]=qs['sort'](_0x26e252[_0x2c57('0x2a')][_0x2c57('0x34')]);_0x277051['where']=qs[_0x2c57('0x2c')](_['pick'](_0x26e252[_0x2c57('0x2a')],_0x27d123[_0x2c57('0x2c')]));if(_0x26e252['query'][_0x2c57('0x35')]){_0x277051[_0x2c57('0x36')]=_[_0x2c57('0x37')](_0x277051['where'],{'$or':_[_0x2c57('0x38')](_0x2adee,function(_0x5bada1){if(_0x5bada1[_0x2c57('0x39')]!==_0x2c57('0x3a')){var _0x558f87={};_0x558f87[_0x5bada1['name']]={'$like':'%'+_0x26e252[_0x2c57('0x2a')][_0x2c57('0x35')]+'%'};return _0x558f87;}})});}_0x277051=_[_0x2c57('0x37')]({},_0x277051,_0x26e252['options']);var _0x5f576c={'where':_0x277051[_0x2c57('0x36')]};return db[_0x2c57('0x26')][_0x2c57('0x19')](_0x5f576c)[_0x2c57('0x21')](function(_0x318788){_0xba5d7a[_0x2c57('0x19')]=_0x318788;if(_0x26e252[_0x2c57('0x2a')][_0x2c57('0x3b')]){_0x277051[_0x2c57('0x3c')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x2c57('0x3d')](_0x277051);})[_0x2c57('0x21')](function(_0x207941){_0xba5d7a[_0x2c57('0x3e')]=_0x207941;return _0xba5d7a;})[_0x2c57('0x21')](respondWithFilteredResult(_0x31ecde,_0x277051))[_0x2c57('0x3f')](handleError(_0x31ecde,null));};exports[_0x2c57('0x40')]=function(_0x2880c9,_0x2fc2f1){var _0x5bb8b4={'raw':!![],'where':{'id':_0x2880c9['params']['id']}},_0x5e3c3a={};_0x5e3c3a['model']=_[_0x2c57('0x2b')](db[_0x2c57('0x26')][_0x2c57('0x27')]);_0x5e3c3a[_0x2c57('0x2a')]=_[_0x2c57('0x2b')](_0x2880c9[_0x2c57('0x2a')]);_0x5e3c3a['filters']=_['intersection'](_0x5e3c3a[_0x2c57('0x29')],_0x5e3c3a[_0x2c57('0x2a')]);_0x5bb8b4['attributes']=_[_0x2c57('0x2d')](_0x5e3c3a['model'],qs[_0x2c57('0x2f')](_0x2880c9['query']['fields']));_0x5bb8b4[_0x2c57('0x2e')]=_0x5bb8b4['attributes'][_0x2c57('0x30')]?_0x5bb8b4['attributes']:_0x5e3c3a[_0x2c57('0x29')];if(_0x2880c9['query'][_0x2c57('0x3b')]){_0x5bb8b4['include']=[{'all':!![]}];}_0x5bb8b4=_[_0x2c57('0x37')]({},_0x5bb8b4,_0x2880c9[_0x2c57('0x41')]);return db[_0x2c57('0x26')][_0x2c57('0x42')](_0x5bb8b4)[_0x2c57('0x21')](handleEntityNotFound(_0x2fc2f1,null))['then'](respondWithResult(_0x2fc2f1,null))['catch'](handleError(_0x2fc2f1,null));};exports[_0x2c57('0x43')]=function(_0x50caea,_0x43348e){return db[_0x2c57('0x26')][_0x2c57('0x43')](_0x50caea[_0x2c57('0x44')],{})[_0x2c57('0x21')](respondWithResult(_0x43348e,0xc9))[_0x2c57('0x3f')](handleError(_0x43348e,null));};exports[_0x2c57('0x45')]=function(_0x1433e3,_0x5c9bb2){if(_0x1433e3[_0x2c57('0x44')]['id']){delete _0x1433e3[_0x2c57('0x44')]['id'];}return db[_0x2c57('0x26')]['find']({'where':{'id':_0x1433e3[_0x2c57('0x46')]['id']}})[_0x2c57('0x21')](handleEntityNotFound(_0x5c9bb2,null))[_0x2c57('0x21')](saveUpdates(_0x1433e3[_0x2c57('0x44')],null))[_0x2c57('0x21')](respondWithResult(_0x5c9bb2,null))[_0x2c57('0x3f')](handleError(_0x5c9bb2,null));};exports['destroy']=function(_0x551301,_0xc6b3d2){return db['OpenchannelApplication'][_0x2c57('0x42')]({'where':{'id':_0x551301[_0x2c57('0x46')]['id']}})[_0x2c57('0x21')](handleEntityNotFound(_0xc6b3d2,null))['then'](removeEntity(_0xc6b3d2,null))[_0x2c57('0x3f')](handleError(_0xc6b3d2,null));}; \ No newline at end of file +var _0xcc70=['create','body','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','options','findAll','catch','params','length','includeAll','include','find'];(function(_0x10c5d0,_0x79a2cd){var _0x37dd63=function(_0x37116d){while(--_0x37116d){_0x10c5d0['push'](_0x10c5d0['shift']());}};_0x37dd63(++_0x79a2cd);}(_0xcc70,0x11e));var _0x0cc7=function(_0x5ab238,_0x4ddda9){_0x5ab238=_0x5ab238-0x0;var _0x236db6=_0xcc70[_0x5ab238];return _0x236db6;};'use strict';var pdf=require(_0x0cc7('0x0'));var emlformat=require(_0x0cc7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0cc7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0cc7('0x3'));var moment=require(_0x0cc7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0cc7('0x5'));var util=require(_0x0cc7('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0cc7('0x7'));var fs=require('fs');var _=require(_0x0cc7('0x8'));var squel=require(_0x0cc7('0x9'));var crypto=require(_0x0cc7('0xa'));var jsforce=require(_0x0cc7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0cc7('0xc'));var querystring=require(_0x0cc7('0xd'));var Papa=require('papaparse');var Redis=require(_0x0cc7('0xe'));var authService=require(_0x0cc7('0xf'));var qs=require(_0x0cc7('0x10'));var as=require(_0x0cc7('0x11'));var hardwareService=require(_0x0cc7('0x12'));var logger=require(_0x0cc7('0x13'))(_0x0cc7('0x14'));var utils=require(_0x0cc7('0x15'));var config=require(_0x0cc7('0x16'));var db=require(_0x0cc7('0x17'))['db'];function respondWithStatusCode(_0xf5be63,_0x4222b5){_0x4222b5=_0x4222b5||0xcc;return function(_0x59ed80){if(_0x59ed80){return _0xf5be63[_0x0cc7('0x18')](_0x4222b5);}return _0xf5be63[_0x0cc7('0x19')](_0x4222b5)[_0x0cc7('0x1a')]();};}function respondWithResult(_0xe55cf2,_0x5d8509){_0x5d8509=_0x5d8509||0xc8;return function(_0x1734d1){if(_0x1734d1){return _0xe55cf2[_0x0cc7('0x19')](_0x5d8509)['json'](_0x1734d1);}};}function respondWithFilteredResult(_0x3ac96d,_0x138ae5){return function(_0x4b83c6){if(_0x4b83c6){var _0x5da683=_0x4b83c6[_0x0cc7('0x1b')],_0x40c1b6=_0x138ae5[_0x0cc7('0x1c')],_0x3a132b=_0x138ae5['offset']+_0x138ae5['limit'],_0xf14f63;if(_0x3a132b>=_0x5da683){_0x3a132b=_0x5da683;_0xf14f63=0xc8;}else{_0xf14f63=0xce;}_0x3ac96d[_0x0cc7('0x19')](_0xf14f63);return _0x3ac96d[_0x0cc7('0x1d')](_0x0cc7('0x1e'),_0x40c1b6+'-'+_0x3a132b+'/'+_0x5da683)['json'](_0x4b83c6);}return null;};}function patchUpdates(_0x3fa430){return function(_0xa9f0e2){try{jsonpatch[_0x0cc7('0x1f')](_0xa9f0e2,_0x3fa430,!![]);}catch(_0x3b2367){return BPromise['reject'](_0x3b2367);}return _0xa9f0e2[_0x0cc7('0x20')]();};}function saveUpdates(_0x48b417,_0x125631){return function(_0x31ddf3){if(_0x31ddf3){return _0x31ddf3[_0x0cc7('0x21')](_0x48b417)[_0x0cc7('0x22')](function(_0x4b5b18){return _0x4b5b18;});}return null;};}function removeEntity(_0x13fe1d,_0x4c9266){return function(_0x34d92e){if(_0x34d92e){return _0x34d92e[_0x0cc7('0x23')]()[_0x0cc7('0x22')](function(){_0x13fe1d[_0x0cc7('0x19')](0xcc)[_0x0cc7('0x1a')]();});}};}function handleEntityNotFound(_0xd797c6,_0x2dfe3d){return function(_0x35d2cc){if(!_0x35d2cc){_0xd797c6[_0x0cc7('0x18')](0x194);}return _0x35d2cc;};}function handleError(_0x3ef96c,_0x3ada5d){_0x3ada5d=_0x3ada5d||0x1f4;return function(_0x2578f7){logger[_0x0cc7('0x24')](_0x2578f7[_0x0cc7('0x25')]);if(_0x2578f7[_0x0cc7('0x26')]){delete _0x2578f7['name'];}_0x3ef96c[_0x0cc7('0x19')](_0x3ada5d)['send'](_0x2578f7);};}exports['index']=function(_0x3ddc1b,_0x5955b4){var _0x294fd4={},_0x4755ed={},_0xdc7cbd={'count':0x0,'rows':[]};var _0x29b2c4=_[_0x0cc7('0x27')](db[_0x0cc7('0x28')][_0x0cc7('0x29')],function(_0x5b0d5f){return{'name':_0x5b0d5f[_0x0cc7('0x2a')],'type':_0x5b0d5f[_0x0cc7('0x2b')][_0x0cc7('0x2c')]};});_0x4755ed[_0x0cc7('0x2d')]=_[_0x0cc7('0x27')](_0x29b2c4,_0x0cc7('0x26'));_0x4755ed[_0x0cc7('0x2e')]=_[_0x0cc7('0x2f')](_0x3ddc1b['query']);_0x4755ed[_0x0cc7('0x30')]=_['intersection'](_0x4755ed[_0x0cc7('0x2d')],_0x4755ed['query']);_0x294fd4[_0x0cc7('0x31')]=_[_0x0cc7('0x32')](_0x4755ed[_0x0cc7('0x2d')],qs['fields'](_0x3ddc1b[_0x0cc7('0x2e')][_0x0cc7('0x33')]));_0x294fd4[_0x0cc7('0x31')]=_0x294fd4['attributes']['length']?_0x294fd4[_0x0cc7('0x31')]:_0x4755ed['model'];if(!_0x3ddc1b[_0x0cc7('0x2e')][_0x0cc7('0x34')](_0x0cc7('0x35'))){_0x294fd4[_0x0cc7('0x36')]=qs[_0x0cc7('0x36')](_0x3ddc1b[_0x0cc7('0x2e')]['limit']);_0x294fd4[_0x0cc7('0x1c')]=qs[_0x0cc7('0x1c')](_0x3ddc1b[_0x0cc7('0x2e')][_0x0cc7('0x1c')]);}_0x294fd4['order']=qs[_0x0cc7('0x37')](_0x3ddc1b['query']['sort']);_0x294fd4['where']=qs[_0x0cc7('0x30')](_[_0x0cc7('0x38')](_0x3ddc1b['query'],_0x4755ed[_0x0cc7('0x30')]));if(_0x3ddc1b[_0x0cc7('0x2e')][_0x0cc7('0x39')]){_0x294fd4['where']=_['merge'](_0x294fd4[_0x0cc7('0x3a')],{'$or':_['map'](_0x29b2c4,function(_0x50581b){if(_0x50581b[_0x0cc7('0x2b')]!==_0x0cc7('0x3b')){var _0x341c98={};_0x341c98[_0x50581b[_0x0cc7('0x26')]]={'$like':'%'+_0x3ddc1b[_0x0cc7('0x2e')][_0x0cc7('0x39')]+'%'};return _0x341c98;}})});}_0x294fd4=_[_0x0cc7('0x3c')]({},_0x294fd4,_0x3ddc1b[_0x0cc7('0x3d')]);var _0xe5a5e0={'where':_0x294fd4[_0x0cc7('0x3a')]};return db[_0x0cc7('0x28')][_0x0cc7('0x1b')](_0xe5a5e0)[_0x0cc7('0x22')](function(_0x39d060){_0xdc7cbd['count']=_0x39d060;if(_0x3ddc1b[_0x0cc7('0x2e')]['includeAll']){_0x294fd4['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x0cc7('0x3e')](_0x294fd4);})[_0x0cc7('0x22')](function(_0x351fea){_0xdc7cbd['rows']=_0x351fea;return _0xdc7cbd;})['then'](respondWithFilteredResult(_0x5955b4,_0x294fd4))[_0x0cc7('0x3f')](handleError(_0x5955b4,null));};exports['show']=function(_0x3e2fda,_0x5187c1){var _0x51a7f9={'raw':!![],'where':{'id':_0x3e2fda[_0x0cc7('0x40')]['id']}},_0x35fc7b={};_0x35fc7b['model']=_[_0x0cc7('0x2f')](db['OpenchannelApplication'][_0x0cc7('0x29')]);_0x35fc7b[_0x0cc7('0x2e')]=_[_0x0cc7('0x2f')](_0x3e2fda[_0x0cc7('0x2e')]);_0x35fc7b[_0x0cc7('0x30')]=_[_0x0cc7('0x32')](_0x35fc7b[_0x0cc7('0x2d')],_0x35fc7b['query']);_0x51a7f9[_0x0cc7('0x31')]=_[_0x0cc7('0x32')](_0x35fc7b[_0x0cc7('0x2d')],qs[_0x0cc7('0x33')](_0x3e2fda[_0x0cc7('0x2e')]['fields']));_0x51a7f9[_0x0cc7('0x31')]=_0x51a7f9[_0x0cc7('0x31')][_0x0cc7('0x41')]?_0x51a7f9[_0x0cc7('0x31')]:_0x35fc7b[_0x0cc7('0x2d')];if(_0x3e2fda['query'][_0x0cc7('0x42')]){_0x51a7f9[_0x0cc7('0x43')]=[{'all':!![]}];}_0x51a7f9=_[_0x0cc7('0x3c')]({},_0x51a7f9,_0x3e2fda[_0x0cc7('0x3d')]);return db[_0x0cc7('0x28')][_0x0cc7('0x44')](_0x51a7f9)[_0x0cc7('0x22')](handleEntityNotFound(_0x5187c1,null))[_0x0cc7('0x22')](respondWithResult(_0x5187c1,null))[_0x0cc7('0x3f')](handleError(_0x5187c1,null));};exports[_0x0cc7('0x45')]=function(_0x10c9d2,_0x452e14){return db[_0x0cc7('0x28')]['create'](_0x10c9d2['body'],{})['then'](respondWithResult(_0x452e14,0xc9))['catch'](handleError(_0x452e14,null));};exports[_0x0cc7('0x21')]=function(_0x3d2a20,_0x374473){if(_0x3d2a20[_0x0cc7('0x46')]['id']){delete _0x3d2a20['body']['id'];}return db[_0x0cc7('0x28')][_0x0cc7('0x44')]({'where':{'id':_0x3d2a20['params']['id']}})['then'](handleEntityNotFound(_0x374473,null))[_0x0cc7('0x22')](saveUpdates(_0x3d2a20[_0x0cc7('0x46')],null))[_0x0cc7('0x22')](respondWithResult(_0x374473,null))['catch'](handleError(_0x374473,null));};exports[_0x0cc7('0x23')]=function(_0x1b31bf,_0xf94052){return db[_0x0cc7('0x28')][_0x0cc7('0x44')]({'where':{'id':_0x1b31bf[_0x0cc7('0x40')]['id']}})['then'](handleEntityNotFound(_0xf94052,null))['then'](removeEntity(_0xf94052,null))[_0x0cc7('0x3f')](handleError(_0xf94052,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 595f1ad..b13f159 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 _0xa426=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','rimraf','./openchannelApplication.attributes','define','OpenchannelApplication'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0xa426,0x199));var _0x6a42=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xa426[_0x342baa];return _0x1208f3;};'use strict';var _=require('lodash');var util=require(_0x6a42('0x0'));var logger=require(_0x6a42('0x1'))(_0x6a42('0x2'));var moment=require(_0x6a42('0x3'));var BPromise=require('bluebird');var rp=require(_0x6a42('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a42('0x5'));var config=require('../../config/environment');var attributes=require(_0x6a42('0x6'));module['exports']=function(_0x22980d,_0x5f082a){return _0x22980d[_0x6a42('0x7')](_0x6a42('0x8'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a42('0x9'),'collate':_0x6a42('0xa')});}; \ No newline at end of file +var _0x2c20=['../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','rimraf'];(function(_0xac56e0,_0x31c873){var _0x2b9309=function(_0x1c1f9e){while(--_0x1c1f9e){_0xac56e0['push'](_0xac56e0['shift']());}};_0x2b9309(++_0x31c873);}(_0x2c20,0x188));var _0x02c2=function(_0x56a7dd,_0x3fd9ae){_0x56a7dd=_0x56a7dd-0x0;var _0xc7b980=_0x2c20[_0x56a7dd];return _0xc7b980;};'use strict';var _=require(_0x02c2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x02c2('0x1'));var BPromise=require(_0x02c2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x02c2('0x3'));var config=require(_0x02c2('0x4'));var attributes=require(_0x02c2('0x5'));module['exports']=function(_0x115e7c,_0xa0f3e5){return _0x115e7c[_0x02c2('0x6')](_0x02c2('0x7'),attributes,{'tableName':_0x02c2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x02c2('0x9'),'collate':_0x02c2('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5f685ab..5d43496 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_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')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});}; \ No newline at end of file +var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x272179,_0x2d53ea){var _0x581fa6=function(_0x28237e){while(--_0x28237e){_0x272179['push'](_0x272179['shift']());}};_0x581fa6(++_0x2d53ea);}(_0xb10b,0x12a));var _0xbb10=function(_0x40ca0c,_0x1d3ce0){_0x40ca0c=_0x40ca0c-0x0;var _0x5a1c45=_0xb10b[_0x40ca0c];return _0x5a1c45;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 38526bd..4a92a55 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 _0x3c71=['express','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','exports','multer','util','path','connect-timeout'];(function(_0x2ed7d9,_0x3e0125){var _0x473fa5=function(_0x1fbbd2){while(--_0x1fbbd2){_0x2ed7d9['push'](_0x2ed7d9['shift']());}};_0x473fa5(++_0x3e0125);}(_0x3c71,0x1dc));var _0x13c7=function(_0x569ff8,_0x524311){_0x569ff8=_0x569ff8-0x0;var _0x227a70=_0x3c71[_0x569ff8];return _0x227a70;};'use strict';var multer=require(_0x13c7('0x0'));var util=require(_0x13c7('0x1'));var path=require(_0x13c7('0x2'));var timeout=require(_0x13c7('0x3'));var express=require(_0x13c7('0x4'));var router=express[_0x13c7('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x13c7('0x6'));var config=require(_0x13c7('0x7'));var controller=require(_0x13c7('0x8'));router[_0x13c7('0x9')]('/',auth['isAuthenticated'](),controller[_0x13c7('0xa')]);router[_0x13c7('0x9')](_0x13c7('0xb'),auth['isAuthenticated'](),controller[_0x13c7('0xc')]);router[_0x13c7('0x9')](_0x13c7('0xd'),auth[_0x13c7('0xe')](),controller[_0x13c7('0xf')]);router['get'](_0x13c7('0x10'),auth[_0x13c7('0xe')](),controller['getMessages']);router[_0x13c7('0x9')]('/:id/download',auth[_0x13c7('0xe')](),controller[_0x13c7('0x11')]);router[_0x13c7('0x12')]('/',auth[_0x13c7('0xe')](),controller[_0x13c7('0x13')]);router[_0x13c7('0x12')](_0x13c7('0x10'),auth[_0x13c7('0xe')](),controller[_0x13c7('0x14')]);router[_0x13c7('0x12')](_0x13c7('0x15'),auth[_0x13c7('0xe')](),interaction[_0x13c7('0x16')](_0x13c7('0x17'),'openchannelinteraction:addtags'),controller[_0x13c7('0x18')]);router[_0x13c7('0x19')](_0x13c7('0xd'),auth['isAuthenticated'](),interaction[_0x13c7('0x16')](_0x13c7('0x17'),_0x13c7('0x1a')),controller[_0x13c7('0x1b')]);router['delete']('/:id',auth[_0x13c7('0xe')](),interaction[_0x13c7('0x16')](_0x13c7('0x17'),_0x13c7('0x1c')),controller['destroy']);router['delete'](_0x13c7('0x15'),auth[_0x13c7('0xe')](),controller['removeTags']);module[_0x13c7('0x1d')]=router; \ No newline at end of file +var _0x1865=['update','delete','openchannelinteraction:destroy','removeTags','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','/describe','get','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags','openchannel','openchannelinteraction:update'];(function(_0x5d14a0,_0x5ee921){var _0x331d51=function(_0x563252){while(--_0x563252){_0x5d14a0['push'](_0x5d14a0['shift']());}};_0x331d51(++_0x5ee921);}(_0x1865,0x130));var _0x5186=function(_0x518f72,_0x433a11){_0x518f72=_0x518f72-0x0;var _0x5e8b94=_0x1865[_0x518f72];return _0x5e8b94;};'use strict';var multer=require(_0x5186('0x0'));var util=require(_0x5186('0x1'));var path=require(_0x5186('0x2'));var timeout=require('connect-timeout');var express=require(_0x5186('0x3'));var router=express[_0x5186('0x4')]();var auth=require(_0x5186('0x5'));var interaction=require(_0x5186('0x6'));var config=require(_0x5186('0x7'));var controller=require(_0x5186('0x8'));router['get']('/',auth[_0x5186('0x9')](),controller[_0x5186('0xa')]);router['get'](_0x5186('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x5186('0xc')](_0x5186('0xd'),auth[_0x5186('0x9')](),controller['show']);router[_0x5186('0xc')](_0x5186('0xe'),auth[_0x5186('0x9')](),controller[_0x5186('0xf')]);router[_0x5186('0xc')](_0x5186('0x10'),auth[_0x5186('0x9')](),controller[_0x5186('0x11')]);router[_0x5186('0x12')]('/',auth[_0x5186('0x9')](),controller[_0x5186('0x13')]);router[_0x5186('0x12')](_0x5186('0xe'),auth[_0x5186('0x9')](),controller[_0x5186('0x14')]);router[_0x5186('0x12')](_0x5186('0x15'),auth[_0x5186('0x9')](),interaction[_0x5186('0x16')]('openchannel','openchannelinteraction:addtags'),controller[_0x5186('0x17')]);router['put'](_0x5186('0xd'),auth[_0x5186('0x9')](),interaction[_0x5186('0x16')](_0x5186('0x18'),_0x5186('0x19')),controller[_0x5186('0x1a')]);router[_0x5186('0x1b')](_0x5186('0xd'),auth[_0x5186('0x9')](),interaction['tracked'](_0x5186('0x18'),_0x5186('0x1c')),controller['destroy']);router[_0x5186('0x1b')](_0x5186('0x15'),auth[_0x5186('0x9')](),controller[_0x5186('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 382d679..bd08054 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 _0x9146=['STRING','DATE','ENUM','out','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9146,0xe0));var _0x6914=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0x9146[_0x12ca5f];return _0xfc3ae9;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x6914('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6914('0x1')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x6914('0x1')]},'externalUrl':{'type':Sequelize[_0x6914('0x1')]},'lastMsgAt':{'type':Sequelize[_0x6914('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6914('0x3')]('in',_0x6914('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf1f5=['DATE','STRING','ENUM','out','sequelize'];(function(_0x308434,_0x1f6353){var _0x28e379=function(_0x5b0cc1){while(--_0x5b0cc1){_0x308434['push'](_0x308434['shift']());}};_0x28e379(++_0x1f6353);}(_0xf1f5,0x167));var _0x5f1f=function(_0x204628,_0x128a53){_0x204628=_0x204628-0x0;var _0x38cedd=_0xf1f5[_0x204628];return _0x38cedd;};'use strict';var Sequelize=require(_0x5f1f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5f1f('0x1')]},'disposition':{'type':Sequelize[_0x5f1f('0x2')]},'note':{'type':Sequelize[_0x5f1f('0x2')]},'read1stAt':{'type':Sequelize[_0x5f1f('0x1')]},'threadId':{'type':Sequelize[_0x5f1f('0x2')]},'externalUrl':{'type':Sequelize[_0x5f1f('0x2')]},'lastMsgAt':{'type':Sequelize[_0x5f1f('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x5f1f('0x3')]('in',_0x5f1f('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5f1f('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index ed9acfb..ae84c22 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 _0xe0d2=['c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','OpenchannelInteractionId','all','rows','show','params','keys','include','options','create','body','describe','addMessage','OpenchannelMessage','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','spread','color','emit','removeTags','download','root','server','join','files','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','YYYY-MM-DD','N.A.','closed','closedAt','disposition','Public','Private','basename','existsSync','createReadStream','createWriteStream','direction','out','System','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','fullname','TagIds','Tags','split','forEach','push','catch','index','map','OpenchannelInteraction','rawAttributes','fieldName','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filters','select','field','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','o.id\x20=\x20i.UserId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','having','`\x20=\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','buildExpression','some','compact','OpenchannelAccountId','where','concat','parse','$gte','$lte','null','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','isEmpty','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','count','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.lastName','Contact.lastName','c.email','Contact.email'];(function(_0x232773,_0x8ef697){var _0x26135b=function(_0x2aed4e){while(--_0x2aed4e){_0x232773['push'](_0x232773['shift']());}};_0x26135b(++_0x8ef697);}(_0xe0d2,0x137));var _0x2e0d=function(_0x5209e8,_0xa99f4d){_0x5209e8=_0x5209e8-0x0;var _0xae516b=_0xe0d2[_0x5209e8];return _0xae516b;};'use strict';var pdf=require(_0x2e0d('0x0'));var emlformat=require(_0x2e0d('0x1'));var rimraf=require(_0x2e0d('0x2'));var zipdir=require(_0x2e0d('0x3'));var jsonpatch=require(_0x2e0d('0x4'));var rp=require(_0x2e0d('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e0d('0x6'));var util=require(_0x2e0d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2e0d('0x8'));var ejs=require(_0x2e0d('0x9'));var fs=require('fs');var _=require(_0x2e0d('0xa'));var squel=require('squel');var crypto=require(_0x2e0d('0xb'));var jsforce=require(_0x2e0d('0xc'));var deskjs=require(_0x2e0d('0xd'));var toCsv=require(_0x2e0d('0x8'));var querystring=require(_0x2e0d('0xe'));var Papa=require(_0x2e0d('0xf'));var Redis=require(_0x2e0d('0x10'));var authService=require(_0x2e0d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2e0d('0x12'));var hardwareService=require(_0x2e0d('0x13'));var logger=require(_0x2e0d('0x14'))('api');var utils=require(_0x2e0d('0x15'));var config=require('../../config/environment');var db=require(_0x2e0d('0x16'))['db'];config[_0x2e0d('0x17')]=_[_0x2e0d('0x18')](config[_0x2e0d('0x17')],{'host':_0x2e0d('0x19'),'port':0x18eb});var socket=require(_0x2e0d('0x1a'))(new Redis(config[_0x2e0d('0x17')]));require(_0x2e0d('0x1b'))[_0x2e0d('0x1c')](socket);function respondWithStatusCode(_0x365b91,_0x4b2168){_0x4b2168=_0x4b2168||0xcc;return function(_0x2f01ae){if(_0x2f01ae){return _0x365b91[_0x2e0d('0x1d')](_0x4b2168);}return _0x365b91['status'](_0x4b2168)[_0x2e0d('0x1e')]();};}function respondWithResult(_0x414a14,_0x5e8186){_0x5e8186=_0x5e8186||0xc8;return function(_0x503c4c){if(_0x503c4c){return _0x414a14[_0x2e0d('0x1f')](_0x5e8186)[_0x2e0d('0x20')](_0x503c4c);}};}function respondWithFilteredResult(_0x37d543,_0x58b2a7){return function(_0x2f071c){if(_0x2f071c){var _0x3b37ec=_0x2f071c['count'],_0x38082d=_0x58b2a7[_0x2e0d('0x21')],_0xf1bd24=_0x58b2a7[_0x2e0d('0x21')]+_0x58b2a7[_0x2e0d('0x22')],_0x186214;if(_0xf1bd24>=_0x3b37ec){_0xf1bd24=_0x3b37ec;_0x186214=0xc8;}else{_0x186214=0xce;}_0x37d543[_0x2e0d('0x1f')](_0x186214);return _0x37d543[_0x2e0d('0x23')](_0x2e0d('0x24'),_0x38082d+'-'+_0xf1bd24+'/'+_0x3b37ec)[_0x2e0d('0x20')](_0x2f071c);}return null;};}function patchUpdates(_0xab55ee){return function(_0xe0e3bc){try{jsonpatch['apply'](_0xe0e3bc,_0xab55ee,!![]);}catch(_0x5520bd){return BPromise[_0x2e0d('0x25')](_0x5520bd);}return _0xe0e3bc[_0x2e0d('0x26')]();};}function saveUpdates(_0x1cc17d,_0x59afe3){return function(_0x5ede06){if(_0x5ede06){return _0x5ede06[_0x2e0d('0x27')](_0x1cc17d)[_0x2e0d('0x28')](function(_0x31ec40){return _0x31ec40;});}return null;};}function removeEntity(_0x5ea6ae,_0x4f25e5){return function(_0x1feca2){if(_0x1feca2){return _0x1feca2[_0x2e0d('0x29')]()['then'](function(){_0x5ea6ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fe027,_0x4a00d4){return function(_0x3cc3b0){if(!_0x3cc3b0){_0x4fe027['sendStatus'](0x194);}return _0x3cc3b0;};}function handleError(_0x1c98dc,_0xd072d9){_0xd072d9=_0xd072d9||0x1f4;return function(_0x1c83aa){logger[_0x2e0d('0x2a')](_0x1c83aa[_0x2e0d('0x2b')]);if(_0x1c83aa[_0x2e0d('0x2c')]){delete _0x1c83aa[_0x2e0d('0x2c')];}_0x1c98dc[_0x2e0d('0x1f')](_0xd072d9)['send'](_0x1c83aa);};}function getInteractionUsers(_0x343cee,_0x39d0e8){return new BPromise(function(_0x5a5d32,_0x500cf0){try{if(_0x39d0e8[_0x343cee['id']]){_0x343cee['Users']=_['map'](_0x39d0e8[_0x343cee['id']],function(_0x2c7ba9){return{'id':_0x2c7ba9['id'],'fullname':_0x2c7ba9[_0x2e0d('0x2d')]};});}}catch(_0x2949bb){_0x500cf0(_0x2949bb);}_0x5a5d32(_0x343cee);});}function getInteractionTags(_0x3e45a9,_0x59cda4){return new BPromise(function(_0x4e5a87,_0x4ce07c){try{if(_0x3e45a9[_0x2e0d('0x2e')]){_0x3e45a9[_0x2e0d('0x2f')]=[];_0x3e45a9[_0x2e0d('0x2e')][_0x2e0d('0x30')](',')[_0x2e0d('0x31')](function(_0x2619e1){_0x3e45a9[_0x2e0d('0x2f')][_0x2e0d('0x32')](_0x59cda4[_0x2619e1]);});}delete _0x3e45a9[_0x2e0d('0x2e')];}catch(_0x5928d3){_0x4ce07c(_0x5928d3);}_0x4e5a87(_0x3e45a9);});}function updateOpenchannelInteraction(_0x13c8b8,_0x1517cd,_0x25cdc3){return new BPromise(function(_0x1f0304,_0x5b4302){return getInteractionUsers(_0x13c8b8,_0x25cdc3)[_0x2e0d('0x28')](function(_0x1670cf){return getInteractionTags(_0x1670cf,_0x1517cd);})[_0x2e0d('0x28')](function(_0x50d2d9){_0x1f0304(_0x50d2d9);})[_0x2e0d('0x33')](function(_0x1201c2){_0x5b4302(_0x1201c2);});});}exports[_0x2e0d('0x34')]=function(_0x1b16de,_0x58224c){var _0x2c873b={},_0x3c7436={},_0x47cebf={'count':0x0,'rows':[]};var _0x33a53e=_[_0x2e0d('0x35')](db[_0x2e0d('0x36')][_0x2e0d('0x37')],function(_0x33e0f0){return{'name':_0x33e0f0[_0x2e0d('0x38')],'type':_0x33e0f0['type'][_0x2e0d('0x39')]};});_0x3c7436['model']=_[_0x2e0d('0x35')](_0x33a53e,_0x2e0d('0x2c'));_0x3c7436[_0x2e0d('0x3a')]=_['keys'](_0x1b16de[_0x2e0d('0x3a')]);_0x3c7436['filters']=_[_0x2e0d('0x3b')](_0x3c7436[_0x2e0d('0x3c')],_0x3c7436[_0x2e0d('0x3a')]);_0x2c873b['attributes']=_[_0x2e0d('0x3b')](_0x3c7436[_0x2e0d('0x3c')],qs[_0x2e0d('0x3d')](_0x1b16de[_0x2e0d('0x3a')][_0x2e0d('0x3d')]));_0x2c873b['attributes']=_0x2c873b[_0x2e0d('0x3e')][_0x2e0d('0x3f')]?_0x2c873b[_0x2e0d('0x3e')]:_0x3c7436[_0x2e0d('0x3c')];if(!_0x1b16de[_0x2e0d('0x3a')][_0x2e0d('0x40')](_0x2e0d('0x41'))){_0x2c873b[_0x2e0d('0x22')]=qs['limit'](_0x1b16de[_0x2e0d('0x3a')][_0x2e0d('0x22')]);_0x2c873b[_0x2e0d('0x21')]=qs[_0x2e0d('0x21')](_0x1b16de['query'][_0x2e0d('0x21')]);}_0x2c873b[_0x2e0d('0x42')]=qs['sort'](_0x1b16de[_0x2e0d('0x3a')]['sort']);_0x2c873b['where']=qs['filters'](_[_0x2e0d('0x43')](_0x1b16de[_0x2e0d('0x3a')],_0x3c7436[_0x2e0d('0x44')]));var _0x4d3dc6=[];var _0x3cfe74=squel[_0x2e0d('0x45')]()[_0x2e0d('0x46')]('id')[_0x2e0d('0x46')](_0x2e0d('0x2c'))[_0x2e0d('0x46')]('color')[_0x2e0d('0x47')](_0x2e0d('0x48'));var _0x4ae17b=squel[_0x2e0d('0x45')]()['field'](_0x2e0d('0x49'))[_0x2e0d('0x46')](_0x2e0d('0x4a'))[_0x2e0d('0x46')]('ui.OpenchannelInteractionId')[_0x2e0d('0x47')](_0x2e0d('0x4b'),'ui')['left_join'](_0x2e0d('0x4c'),'u',_0x2e0d('0x4d'));var _0x172785=squel[_0x2e0d('0x45')]()['from']('openchannel_interactions','i')[_0x2e0d('0x4e')](_0x2e0d('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2e0d('0x4e')](_0x2e0d('0x4c'),'o',_0x2e0d('0x50'))[_0x2e0d('0x4e')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0x2e0d('0x4e')](_0x2e0d('0x51'),'me',_0x2e0d('0x52'))[_0x2e0d('0x4e')](_0x2e0d('0x53'),'it',_0x2e0d('0x54'))['left_join']('tools_tags','t',_0x2e0d('0x55'));var _0xa4dd7e=squel[_0x2e0d('0x56')]();var _0x406a9a=[];var _0x17d2f5=squel[_0x2e0d('0x56')]();var _0x1ab974;if(_0x1b16de[_0x2e0d('0x3a')]['search']){_0x1ab974=as[_0x2e0d('0x57')](_0x1b16de[_0x2e0d('0x3a')][_0x2e0d('0x58')]);var _0x566158=_0x1ab974[_0x2e0d('0x59')];for(var _0x595f25=0x0;_0x595f25<_0x1ab974[_0x2e0d('0x5a')][_0x2e0d('0x3f')];_0x595f25++){var _0x555753=_0x1ab974[_0x2e0d('0x5a')][_0x595f25];var _0x15f2b3='i';var _0x4b72f6=_[_0x2e0d('0x5b')](_0x33a53e,[_0x2e0d('0x2c'),_0x555753[_0x2e0d('0x46')]]);if(!_0x4b72f6){switch(_0x555753['field']){case'unreadMessages':if(_0x555753['value']==0x1){_0x172785[_0x2e0d('0x5c')]('`'+_0x555753[_0x2e0d('0x46')]+_0x2e0d('0x5d'));}else{_0x172785[_0x2e0d('0x5c')]('`'+_0x555753['field']+'`\x20>\x200');}break;case'Contact':if(_0x555753[_0x2e0d('0x5e')]===_0x2e0d('0x5f')){if(_0x555753[_0x2e0d('0x60')][_0x2e0d('0x30')]('\x20')[_0x2e0d('0x3f')]>0x1){_0xa4dd7e[_0x566158](_0x2e0d('0x61'),qs[_0x2e0d('0x62')](_0x555753['value']),null);}else{var _0x335726='%'+_0x555753[_0x2e0d('0x60')]+'%';_0xa4dd7e[_0x566158](_0x2e0d('0x63'),_0x335726,_0x335726,_0x335726);}}else{_0x4b72f6=_[_0x2e0d('0x5b')](_0x33a53e,[_0x2e0d('0x2c'),_0x2e0d('0x64')]);_0x555753['field']=_0x2e0d('0x64');_0x79a00e=as['buildExpression'](_0x15f2b3,_0x4b72f6[_0x2e0d('0x65')],_0x555753);_0xa4dd7e[_0x566158](_0x79a00e['text'],_0x79a00e['value'][_0x2e0d('0x66')],_0x79a00e['value'][_0x2e0d('0x1e')]);}break;case _0x2e0d('0x67'):var _0x32f012=_0x555753[_0x2e0d('0x60')][_0x2e0d('0x30')](',')[_0x2e0d('0x35')](function(_0x465f0f){return Number(_0x465f0f);});_0x32f012[_0x2e0d('0x31')](function(_0x502e4a){_0x17d2f5['or'](_0x2e0d('0x68'),'%,'+_0x502e4a+',%');});_0x406a9a=_[_0x2e0d('0x69')](_0x406a9a,_0x32f012);break;case _0x2e0d('0x6a'):if(_0x555753[_0x2e0d('0x5e')]===_0x2e0d('0x5f')){_0xa4dd7e[_0x566158](_0x2e0d('0x6b'),'%'+_0x555753[_0x2e0d('0x60')]+'%',null);}else{_0x4b72f6=_[_0x2e0d('0x5b')](_0x33a53e,[_0x2e0d('0x2c'),_0x2e0d('0x6c')]);_0x555753[_0x2e0d('0x46')]='UserId';_0x79a00e=as['buildExpression'](_0x15f2b3,_0x4b72f6['type'],_0x555753);_0xa4dd7e[_0x566158](_0x79a00e[_0x2e0d('0x6d')],_0x79a00e['value'][_0x2e0d('0x66')],_0x79a00e['value'][_0x2e0d('0x1e')]);}break;case'body':_0x79a00e=as['buildExpression']('me',null,_0x555753);_0xa4dd7e[_0x566158](_0x79a00e['text'],_0x79a00e[_0x2e0d('0x60')][_0x2e0d('0x66')],_0x79a00e[_0x2e0d('0x60')]['end']);break;}}else{var _0x79a00e=as[_0x2e0d('0x6e')](_0x15f2b3,_0x4b72f6[_0x2e0d('0x65')],_0x555753);_0xa4dd7e[_0x566158](_0x79a00e[_0x2e0d('0x6d')],_0x79a00e[_0x2e0d('0x60')][_0x2e0d('0x66')],_0x79a00e['value']['end']);}}}else{var _0x462c10=_(_0x1b16de[_0x2e0d('0x3a')])['keys']()['map'](function(_0x43c813){return _[_0x2e0d('0x6f')](_0x33a53e,['name',_0x43c813])?_0x43c813:undefined;})[_0x2e0d('0x70')]()[_0x2e0d('0x60')]();if(!_['isEmpty'](_0x462c10)){_0x462c10['forEach'](function(_0x4c8632){if(_0x4c8632===_0x2e0d('0x71')){_0x172785[_0x2e0d('0x72')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x2e0d('0x73')](_0x1b16de['query'][_0x4c8632]));}else if(_0x4c8632==='createdAt'){var _0x174974=JSON[_0x2e0d('0x74')](_0x1b16de[_0x2e0d('0x3a')][_0x4c8632])[_0x2e0d('0x75')];var _0x112d2a=JSON[_0x2e0d('0x74')](_0x1b16de['query'][_0x4c8632])[_0x2e0d('0x76')];_0x172785['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x174974,_0x112d2a);}else{if(_0x1b16de[_0x2e0d('0x3a')][_0x4c8632]===_0x2e0d('0x77')){_0x172785['where']('i.'+_0x4c8632+'\x20IS\x20NULL');}else{_0x172785[_0x2e0d('0x72')]('i.'+_0x4c8632+'\x20=\x20?',_0x1b16de[_0x2e0d('0x3a')][_0x4c8632]);}}});}if(_0x1b16de[_0x2e0d('0x3a')][_0x2e0d('0x78')]){if(_0x1b16de[_0x2e0d('0x3a')][_0x2e0d('0x78')]==0x1){_0x172785[_0x2e0d('0x5c')](_0x2e0d('0x79'));}else{_0x172785[_0x2e0d('0x5c')]('`unreadMessages`\x20>\x200');}}if(_0x1b16de[_0x2e0d('0x3a')][_0x2e0d('0x7a')]){_0x406a9a=_[_0x2e0d('0x7b')](_0x1b16de['query']['tag'])?_0x1b16de[_0x2e0d('0x3a')]['tag']:new Array(_0x1b16de[_0x2e0d('0x3a')]['tag']);_0x406a9a[_0x2e0d('0x31')](function(_0x2727ed){_0x17d2f5['or'](_0x2e0d('0x68'),'%,'+_0x2727ed+',%');});}if(_0x1b16de['query']['filter']){var _0x2dd960=_0x1b16de['query'][_0x2e0d('0x7c')][_0x2e0d('0x7d')]('\x5c','\x5c\x5c')[_0x2e0d('0x7d')]('\x27\x27',_0x2e0d('0x7e'));if(qs[_0x2e0d('0x7f')](_0x2dd960)){_0xa4dd7e['or']('i.id\x20LIKE\x20?',_0x2dd960+'%');}else{_0xa4dd7e['or'](_0x2e0d('0x80'),qs[_0x2e0d('0x62')](_0x2dd960))['or'](_0x2e0d('0x81'),_0x2dd960+'%')['or'](_0x2e0d('0x82'),_0x2dd960+'%');}}}_0x172785['where'](_0xa4dd7e);_0x172785['group'](_0x2e0d('0x83'));var _0x12814b={'type':db['Sequelize'][_0x2e0d('0x84')][_0x2e0d('0x85')],'raw':!![]};var _0x4527e1=_0x172785['clone']();_0x4527e1['field']('i.id');_0x4527e1[_0x2e0d('0x46')](_0x2e0d('0x86'),_0x2e0d('0x87'));if(_0x2c873b[_0x2e0d('0x42')]){_0x2c873b['order'][_0x2e0d('0x31')](function(_0x10fdf7){_0x172785['order']('i.'+_0x10fdf7[0x0],_0x10fdf7[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2e0d('0x88')](_0x406a9a)){_0x172785[_0x2e0d('0x5c')](_0x17d2f5);_0x4527e1[_0x2e0d('0x72')](_0x2e0d('0x89'),_0x406a9a);}BPromise[_0x2e0d('0x8a')]()[_0x2e0d('0x28')](function(){if(!_0x1ab974){if(_0x1b16de[_0x2e0d('0x3a')][_0x2e0d('0x71')]||_0x1b16de['query'][_0x2e0d('0x8b')])return;_0x4527e1[_0x2e0d('0x72')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x172785[_0x2e0d('0x72')](_0x2e0d('0x8c'));return;}return _0x1b16de['user'][_0x2e0d('0x8d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x150130){if(_[_0x2e0d('0x88')](_0x150130)){_0x4527e1[_0x2e0d('0x72')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x172785[_0x2e0d('0x72')](_0x2e0d('0x8e'));}else{_0x4527e1[_0x2e0d('0x72')](_0x2e0d('0x8f'),_[_0x2e0d('0x35')](_0x150130,'id'));_0x172785[_0x2e0d('0x72')](_0x2e0d('0x8f'),_[_0x2e0d('0x35')](_0x150130,'id'));}});})[_0x2e0d('0x28')](function(){db['sequelize'][_0x2e0d('0x3a')](_0x4527e1[_0x2e0d('0x90')](),_0x12814b)[_0x2e0d('0x28')](function(_0x4bff05){_0x47cebf[_0x2e0d('0x91')]=_0x4bff05[_0x2e0d('0x3f')];if(_0x47cebf[_0x2e0d('0x91')]===0x0)return[];return db['sequelize'][_0x2e0d('0x3a')](_0x3cfe74['toString'](),_0x12814b)['then'](function(_0x56b176){_0x4d3dc6=_['keyBy'](_0x56b176,'id');_0x12814b=_[_0x2e0d('0x92')](_0x12814b,{'model':db[_0x2e0d('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1b16de['query']['fields']){_0x2c873b[_0x2e0d('0x3e')][_0x2e0d('0x31')](function(_0x1dab50){_0x172785['field']('i.'+_0x1dab50);});}else{_0x172785['field'](_0x2e0d('0x86'),'unreadMessages');_0x172785[_0x2e0d('0x46')]('a.key',_0x2e0d('0x93'));_0x172785[_0x2e0d('0x46')](_0x2e0d('0x94'),_0x2e0d('0x95'));_0x172785[_0x2e0d('0x46')](_0x2e0d('0x96'));_0x172785['field']('c.firstName','Contact.firstName');_0x172785[_0x2e0d('0x46')](_0x2e0d('0x97'),_0x2e0d('0x98'));_0x172785[_0x2e0d('0x46')](_0x2e0d('0x99'),_0x2e0d('0x9a'));_0x172785[_0x2e0d('0x46')](_0x2e0d('0x9b'),_0x2e0d('0x9c'));_0x172785[_0x2e0d('0x46')]('c.mobile',_0x2e0d('0x9d'));_0x172785[_0x2e0d('0x46')](_0x2e0d('0x9e'),_0x2e0d('0x9f'));_0x172785[_0x2e0d('0x46')]('o.fullname',_0x2e0d('0xa0'));_0x172785[_0x2e0d('0x46')](_0x2e0d('0xa1'),'Owner.internal');_0x172785[_0x2e0d('0x46')](_0x2e0d('0xa2'),_0x2e0d('0x2e'));}_0x172785[_0x2e0d('0x22')](_0x2c873b[_0x2e0d('0x22')]);_0x172785['offset'](_0x2c873b['offset']);return db[_0x2e0d('0xa3')][_0x2e0d('0x3a')](_0x172785[_0x2e0d('0x90')](),_0x12814b);})[_0x2e0d('0x28')](function(_0x3a1353){_0x4ae17b[_0x2e0d('0x72')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x3a1353,'id'));return db['sequelize']['query'](_0x4ae17b[_0x2e0d('0x90')](),_0x12814b)[_0x2e0d('0x28')](function(_0x4ec248){var _0x3267e1=_['groupBy'](_0x4ec248,_0x2e0d('0xa4'));var _0x48d5b2=[];_0x3a1353[_0x2e0d('0x31')](function(_0x11dbe6){_0x48d5b2['push'](updateOpenchannelInteraction(_0x11dbe6,_0x4d3dc6,_0x3267e1));});return BPromise[_0x2e0d('0xa5')](_0x48d5b2);});});})[_0x2e0d('0x28')](function(_0x57c36b){_0x47cebf[_0x2e0d('0xa6')]=_0x57c36b;return _0x47cebf;})[_0x2e0d('0x28')](respondWithFilteredResult(_0x58224c,_0x2c873b));})[_0x2e0d('0x33')](handleError(_0x58224c,null));};exports[_0x2e0d('0xa7')]=function(_0x3ee54d,_0x467f7a){var _0x119719={'raw':![],'where':{'id':_0x3ee54d[_0x2e0d('0xa8')]['id']}},_0x2a1a3b={};_0x2a1a3b['model']=_[_0x2e0d('0xa9')](db[_0x2e0d('0x36')][_0x2e0d('0x37')]);_0x2a1a3b[_0x2e0d('0x3a')]=_[_0x2e0d('0xa9')](_0x3ee54d['query']);_0x2a1a3b['filters']=_['intersection'](_0x2a1a3b[_0x2e0d('0x3c')],_0x2a1a3b[_0x2e0d('0x3a')]);_0x119719[_0x2e0d('0x3e')]=_['intersection'](_0x2a1a3b[_0x2e0d('0x3c')],qs[_0x2e0d('0x3d')](_0x3ee54d[_0x2e0d('0x3a')][_0x2e0d('0x3d')]));_0x119719[_0x2e0d('0x3e')]=_0x119719[_0x2e0d('0x3e')]['length']?_0x119719[_0x2e0d('0x3e')]:_0x2a1a3b[_0x2e0d('0x3c')];if(_0x3ee54d[_0x2e0d('0x3a')]['includeAll']){_0x119719[_0x2e0d('0xaa')]=[{'all':!![]}];}_0x119719=_[_0x2e0d('0x92')]({},_0x119719,_0x3ee54d[_0x2e0d('0xab')]);return db['OpenchannelInteraction'][_0x2e0d('0x5b')](_0x119719)['then'](handleEntityNotFound(_0x467f7a,null))['then'](respondWithResult(_0x467f7a,null))[_0x2e0d('0x33')](handleError(_0x467f7a,null));};exports[_0x2e0d('0xac')]=function(_0x11e1dd,_0x1e5a0f){return db[_0x2e0d('0x36')][_0x2e0d('0xac')](_0x11e1dd[_0x2e0d('0xad')],{})['then'](respondWithResult(_0x1e5a0f,0xc9))[_0x2e0d('0x33')](handleError(_0x1e5a0f,null));};exports[_0x2e0d('0x27')]=function(_0x47a1ff,_0x20d0e8){if(_0x47a1ff['body']['id']){delete _0x47a1ff[_0x2e0d('0xad')]['id'];}return db[_0x2e0d('0x36')][_0x2e0d('0x5b')]({'where':{'id':_0x47a1ff[_0x2e0d('0xa8')]['id']}})[_0x2e0d('0x28')](handleEntityNotFound(_0x20d0e8,null))[_0x2e0d('0x28')](saveUpdates(_0x47a1ff[_0x2e0d('0xad')],null))[_0x2e0d('0x28')](respondWithResult(_0x20d0e8,null))['catch'](handleError(_0x20d0e8,null));};exports['destroy']=function(_0x49c041,_0x4eab62){return db[_0x2e0d('0x36')][_0x2e0d('0x5b')]({'where':{'id':_0x49c041[_0x2e0d('0xa8')]['id']}})[_0x2e0d('0x28')](handleEntityNotFound(_0x4eab62,null))[_0x2e0d('0x28')](removeEntity(_0x4eab62,null))[_0x2e0d('0x33')](handleError(_0x4eab62,null));};exports[_0x2e0d('0xae')]=function(_0x4903d4,_0xb5f3a2){return db[_0x2e0d('0x36')][_0x2e0d('0xae')]()[_0x2e0d('0x28')](respondWithResult(_0xb5f3a2,null))[_0x2e0d('0x33')](handleError(_0xb5f3a2,null));};exports[_0x2e0d('0xaf')]=function(_0x5713fe,_0x590560,_0xc63253){return db[_0x2e0d('0xb0')]['find']({'where':{'id':_0x5713fe[_0x2e0d('0xa8')]['id']}})[_0x2e0d('0x28')](handleEntityNotFound(_0x590560,null))[_0x2e0d('0x28')](function(_0x44ef60){if(_0x44ef60){return _0x44ef60[_0x2e0d('0xaf')](_0x5713fe[_0x2e0d('0xad')][_0x2e0d('0xb1')],_[_0x2e0d('0xb2')](_0x5713fe[_0x2e0d('0xad')],['ids','id'])||{});}})[_0x2e0d('0x28')](respondWithResult(_0x590560,null))[_0x2e0d('0x33')](handleError(_0x590560,null));};exports['getMessages']=function(_0x27dbd9,_0x39d982,_0x499abd){var _0x3d6fdb={'raw':![],'where':{}};var _0x398088={};var _0x25e33d={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x2e0d('0xb3')]({'where':{'id':_0x27dbd9[_0x2e0d('0xa8')]['id']}})[_0x2e0d('0x28')](handleEntityNotFound(_0x39d982,null))[_0x2e0d('0x28')](function(_0x140a86){if(_0x140a86){_0x398088[_0x2e0d('0x3c')]=_[_0x2e0d('0xa9')](db[_0x2e0d('0xb0')]['rawAttributes']);_0x398088[_0x2e0d('0x3a')]=_[_0x2e0d('0xa9')](_0x27dbd9[_0x2e0d('0x3a')]);_0x398088[_0x2e0d('0x44')]=_[_0x2e0d('0x3b')](_0x398088['model'],_0x398088[_0x2e0d('0x3a')]);_0x3d6fdb[_0x2e0d('0x3e')]=_[_0x2e0d('0x3b')](_0x398088['model'],qs['fields'](_0x27dbd9[_0x2e0d('0x3a')][_0x2e0d('0x3d')]));_0x3d6fdb['attributes']=_0x3d6fdb[_0x2e0d('0x3e')][_0x2e0d('0x3f')]?_0x3d6fdb['attributes']:_0x398088['model'];if(!_0x27dbd9[_0x2e0d('0x3a')]['hasOwnProperty'](_0x2e0d('0x41'))){_0x3d6fdb['limit']=qs[_0x2e0d('0x22')](_0x27dbd9[_0x2e0d('0x3a')][_0x2e0d('0x22')]);_0x3d6fdb[_0x2e0d('0x21')]=qs[_0x2e0d('0x21')](_0x27dbd9['query']['offset']);}_0x3d6fdb[_0x2e0d('0x42')]=qs['sort'](_0x27dbd9[_0x2e0d('0x3a')]['sort']);_0x3d6fdb[_0x2e0d('0x72')]=qs['filters'](_['pick'](_0x27dbd9['query'],_0x398088[_0x2e0d('0x44')]));_0x3d6fdb['where'][_0x2e0d('0xa4')]=_0x140a86['id'];if(_0x27dbd9[_0x2e0d('0x3a')][_0x2e0d('0x7c')]){_0x3d6fdb['where']=_['merge'](_0x3d6fdb[_0x2e0d('0x72')],{'$or':_[_0x2e0d('0x35')](_0x3d6fdb[_0x2e0d('0x3e')],function(_0x6f3594){var _0x274805={};_0x274805[_0x6f3594]={'$like':'%'+_0x27dbd9[_0x2e0d('0x3a')]['filter']+'%'};return _0x274805;})});}if(_0x27dbd9[_0x2e0d('0x3a')]['$gte']){var _0x2c827b=_0x27dbd9[_0x2e0d('0x3a')][_0x2e0d('0x75')][_0x2e0d('0x30')](',');var _0x42109d={};_0x42109d[_0x2c827b[0x0]]={'$gte':moment(_0x2c827b[0x1])[_0x2e0d('0xb4')](_0x2e0d('0xb5'))};_0x3d6fdb['where']=_[_0x2e0d('0x92')](_0x3d6fdb['where'],_0x42109d);}_0x3d6fdb=_[_0x2e0d('0x92')]({},_0x3d6fdb,_0x27dbd9['options']);return db[_0x2e0d('0xb0')][_0x2e0d('0x91')]({'where':_0x3d6fdb[_0x2e0d('0x72')]})['then'](function(_0x38d4a6){_0x25e33d[_0x2e0d('0x91')]=_0x38d4a6;if(_0x27dbd9[_0x2e0d('0x3a')][_0x2e0d('0xb6')]){_0x3d6fdb[_0x2e0d('0xaa')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x3d6fdb);})['then'](function(_0x55073b){_0x25e33d[_0x2e0d('0xa6')]=_0x55073b;return _0x25e33d;});}})[_0x2e0d('0x28')](respondWithFilteredResult(_0x39d982,_0x3d6fdb))[_0x2e0d('0x33')](handleError(_0x39d982,null));};exports[_0x2e0d('0xb7')]=function(_0x146844,_0x2ea653,_0x33b505){return db[_0x2e0d('0x36')][_0x2e0d('0x5b')]({'where':{'id':_0x146844[_0x2e0d('0xa8')]['id']}})[_0x2e0d('0x28')](handleEntityNotFound(_0x2ea653,null))[_0x2e0d('0x28')](function(_0xba545e){if(_0xba545e){return _0xba545e['setTags'](_0x146844[_0x2e0d('0xad')][_0x2e0d('0xb1')],_[_0x2e0d('0xb2')](_0x146844['body'],[_0x2e0d('0xb1'),'id'])||{})[_0x2e0d('0xb8')](function(){return db[_0x2e0d('0x67')]['findAll']({'attributes':['id',_0x2e0d('0x2c'),_0x2e0d('0xb9')],'where':{'id':_0x146844[_0x2e0d('0xad')][_0x2e0d('0xb1')]}});})[_0x2e0d('0x28')](function(_0x49f741){socket[_0x2e0d('0xba')]('openchannelInteractionTags:save',{'id':Number(_0x146844[_0x2e0d('0xa8')]['id']),'tags':_0x49f741||[]});return{'id':Number(_0x146844[_0x2e0d('0xa8')]['id']),'tags':_0x49f741||[]};});}})[_0x2e0d('0x28')](respondWithResult(_0x2ea653,null))[_0x2e0d('0x33')](handleError(_0x2ea653,null));};exports[_0x2e0d('0xbb')]=function(_0x1545c6,_0x38298e,_0x469d1c){return db[_0x2e0d('0x36')][_0x2e0d('0x5b')]({'where':{'id':_0x1545c6['params']['id']}})[_0x2e0d('0x28')](handleEntityNotFound(_0x38298e,null))[_0x2e0d('0x28')](function(_0x14a819){if(_0x14a819){return _0x14a819[_0x2e0d('0xbb')](_0x1545c6[_0x2e0d('0x3a')]['ids']);}})[_0x2e0d('0x28')](respondWithStatusCode(_0x38298e,null))['catch'](handleError(_0x38298e,null));};exports[_0x2e0d('0xbc')]=function(_0x1e2916,_0x4ccf7a){var _0x4bd6d6=moment()['unix']()['toString']();var _0x2da8ba=path['join'](config[_0x2e0d('0xbd')],_0x2e0d('0xbe'),'files','tmp');var _0x57facd=path[_0x2e0d('0xbf')](config[_0x2e0d('0xbd')],_0x2e0d('0xbe'),_0x2e0d('0xc0'),_0x2e0d('0xc1'));var _0x1e6dde=path[_0x2e0d('0xbf')](_0x2da8ba,_0x4bd6d6);var _0x58dd67=util[_0x2e0d('0xb4')](_0x2e0d('0xc2'),_0x1e2916['params']['id'],_0x4bd6d6);var _0x1d80bf=path[_0x2e0d('0xbf')](_0x2da8ba,_0x58dd67);var _0x53f6a6=[];_0x53f6a6[_0x2e0d('0x32')]({'model':db[_0x2e0d('0x6a')],'as':_0x2e0d('0x6a'),'attributes':['id','fullname'],'raw':!![]});_0x53f6a6[_0x2e0d('0x32')]({'model':db[_0x2e0d('0xc3')],'as':_0x2e0d('0xc4'),'attributes':['id',_0x2e0d('0xc5'),_0x2e0d('0xc6')],'raw':!![]});if(_0x1e2916[_0x2e0d('0x3a')][_0x2e0d('0xc1')]){_0x53f6a6['push']({'model':db[_0x2e0d('0xc7')],'as':'Attachment','raw':!![]});}var _0xcfe2a6=[{'model':db[_0x2e0d('0xb0')],'as':_0x2e0d('0xc8'),'attributes':['id','body',_0x2e0d('0xc9'),'direction',_0x2e0d('0xca'),_0x2e0d('0x78')],'include':_0x53f6a6}];_0xcfe2a6[_0x2e0d('0x32')]({'model':db[_0x2e0d('0xcb')],'as':_0x2e0d('0xcc'),'attributes':['id',_0x2e0d('0x2c')]});_0xcfe2a6['push']({'model':db['User'],'as':_0x2e0d('0xcd'),'attributes':['id','fullname']});return db[_0x2e0d('0x36')][_0x2e0d('0x5b')]({'where':{'id':_0x1e2916[_0x2e0d('0xa8')]['id']},'include':_0xcfe2a6})[_0x2e0d('0x28')](handleEntityNotFound(_0x4ccf7a,null))[_0x2e0d('0x28')](function(_0x54204e){if(_0x54204e){var _0x20ae8d=_0x54204e[_0x2e0d('0xce')]({'plain':!![]});fs[_0x2e0d('0xcf')](_0x1e6dde);var _0x317692={'format':'A4','border':'10px','header':{'height':_0x2e0d('0xd0'),'contents':{'first':_0x2e0d('0xd1')}},'footer':{'height':'30px','contents':{'default':util[_0x2e0d('0xb4')](_0x2e0d('0xd2'),util[_0x2e0d('0xb4')]('%s\x20#%d','Openchannel',_0x20ae8d['id']),moment()[_0x2e0d('0xb4')](_0x2e0d('0xd3'))[_0x2e0d('0x90')]())}}};var _0x5a2962={'channel':'Openchannel','account':_0x20ae8d[_0x2e0d('0xcc')]['name'],'agent':_0x20ae8d[_0x2e0d('0xcd')]?_0x20ae8d[_0x2e0d('0xcd')][_0x2e0d('0x2d')]:_0x2e0d('0xd4'),'createdAt':moment(_0x20ae8d[_0x2e0d('0xc9')])[_0x2e0d('0xb4')](_0x2e0d('0xb5'))[_0x2e0d('0x90')](),'closedAt':_0x20ae8d[_0x2e0d('0xd5')]?moment(_0x20ae8d[_0x2e0d('0xd6')])[_0x2e0d('0xb4')](_0x2e0d('0xb5'))[_0x2e0d('0x90')]():'','disposition':_0x20ae8d[_0x2e0d('0xd7')],'visibility':_0x20ae8d['threadId']?_0x2e0d('0xd8'):_0x2e0d('0xd9'),'messages':_(_0x20ae8d[_0x2e0d('0xc8')])['filter']({'secret':![]})[_0x2e0d('0x35')](function(_0x1cdb92){if(_0x1cdb92[_0x2e0d('0xc7')]){var _0x1e9770=path['join'](_0x57facd,_0x1cdb92[_0x2e0d('0xc7')][_0x2e0d('0xda')]);if(fs[_0x2e0d('0xdb')](_0x1e9770)){fs[_0x2e0d('0xdc')](_0x1e9770)['pipe'](fs[_0x2e0d('0xdd')](path[_0x2e0d('0xbf')](_0x1e6dde,_0x1cdb92[_0x2e0d('0xc7')][_0x2e0d('0xda')])));}}return{'date':moment(_0x1cdb92[_0x2e0d('0xc9')])[_0x2e0d('0xb4')](_0x2e0d('0xb5'))['toString'](),'sender':_0x1cdb92[_0x2e0d('0xde')]===_0x2e0d('0xdf')?_0x1cdb92[_0x2e0d('0x6a')]?_0x1cdb92[_0x2e0d('0x6a')][_0x2e0d('0x2d')]:_0x2e0d('0xe0'):_0x1cdb92['Contact'][_0x2e0d('0xc5')]+(_0x1cdb92[_0x2e0d('0xc4')][_0x2e0d('0xc6')]?'\x20'+_0x1cdb92[_0x2e0d('0xc4')][_0x2e0d('0xc6')]:''),'body':_0x1cdb92[_0x2e0d('0xc7')]?_0x1cdb92['Attachment'][_0x2e0d('0xda')]:_0x1cdb92[_0x2e0d('0xad')],'direction':_0x1cdb92[_0x2e0d('0xde')]===_0x2e0d('0xdf')?'A':'C','secret':_0x1cdb92[_0x2e0d('0xca')],'read':_0x1cdb92['read'],'attachment':_0x1cdb92['Attachment']};})[_0x2e0d('0x60')]()};return ejs['renderFile'](path[_0x2e0d('0xbf')](config[_0x2e0d('0xbd')],_0x2e0d('0xbe'),_0x2e0d('0xe1'),_0x2e0d('0xe2')),{'interaction':_0x5a2962})[_0x2e0d('0x28')](function(_0x331173){return new BPromise(function(_0x4e90b9,_0x3b4382){pdf[_0x2e0d('0xac')](_0x331173,_0x317692)[_0x2e0d('0xe3')](path['join'](_0x1e6dde,_0x2e0d('0xe4')+_0x20ae8d['id']+'-'+_0x4bd6d6+_0x2e0d('0xe5')),function(_0x215a35,_0x22de72){if(_0x215a35)return _0x3b4382(_0x215a35);_0x4e90b9(_0x22de72);});});})[_0x2e0d('0x28')](function(){return new BPromise(function(_0x3f8ac7,_0x3d99e6){zipdir(_0x1e6dde,{'saveTo':_0x1d80bf},function(_0x12fd19,_0x5e1ab7){if(_0x12fd19)return _0x3d99e6(_0x12fd19);return _0x3f8ac7(_0x5e1ab7);});})[_0x2e0d('0x28')](function(){return new BPromise(function(_0x1f7bf6,_0x3567a1){rimraf(_0x1e6dde,function(_0x1df28e){if(_0x1df28e)_0x3567a1(_0x1df28e);return _0x1f7bf6();});});})[_0x2e0d('0x28')](function(){return _0x4ccf7a[_0x2e0d('0xbc')](_0x1d80bf,_0x58dd67,function(_0x30523b){if(_0x30523b){console[_0x2e0d('0xe6')](_0x2e0d('0xe7'),_0x30523b);}else{fs[_0x2e0d('0xe8')](_0x1d80bf);}});});});}else{return _0x4ccf7a[_0x2e0d('0x1d')](0xc8);}})[_0x2e0d('0x33')](handleError(_0x4ccf7a,null));}; \ No newline at end of file +var _0x9dcd=['unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','fullname','Tags','TagIds','split','forEach','catch','index','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','left_join','o.id\x20=\x20i.UserId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','type','keys','some','compact','isEmpty','OpenchannelAccountId','concat','$gte','parse','$lte','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','merge','OpenchannelInteraction','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','push','all','show','params','includeAll','include','create','describe','addMessage','OpenchannelMessage','ids','findOne','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','omit','emit','openchannelInteractionTags:save','removeTags','download','unix','server','join','root','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','Account','Owner','createdAt','closed','threadId','Private','basename','System','out','secret','views','downloadInteraction.html','toFile','transcript-','log'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x9dcd,0xe4));var _0xd9dc=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0x9dcd[_0x49c68e];return _0x33032b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd9dc('0x0'));var rimraf=require(_0xd9dc('0x1'));var zipdir=require(_0xd9dc('0x2'));var jsonpatch=require(_0xd9dc('0x3'));var rp=require(_0xd9dc('0x4'));var moment=require('moment');var BPromise=require(_0xd9dc('0x5'));var Mustache=require(_0xd9dc('0x6'));var util=require(_0xd9dc('0x7'));var path=require(_0xd9dc('0x8'));var sox=require('sox');var csv=require(_0xd9dc('0x9'));var ejs=require(_0xd9dc('0xa'));var fs=require('fs');var _=require(_0xd9dc('0xb'));var squel=require(_0xd9dc('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd9dc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd9dc('0xe'));var Papa=require(_0xd9dc('0xf'));var Redis=require(_0xd9dc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9dc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9dc('0x12'))(_0xd9dc('0x13'));var utils=require(_0xd9dc('0x14'));var config=require(_0xd9dc('0x15'));var db=require('../../mysqldb')['db'];config[_0xd9dc('0x16')]=_[_0xd9dc('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd9dc('0x18'))(new Redis(config[_0xd9dc('0x16')]));require(_0xd9dc('0x19'))[_0xd9dc('0x1a')](socket);function respondWithStatusCode(_0x275bef,_0x1cb5c9){_0x1cb5c9=_0x1cb5c9||0xcc;return function(_0x451a57){if(_0x451a57){return _0x275bef[_0xd9dc('0x1b')](_0x1cb5c9);}return _0x275bef[_0xd9dc('0x1c')](_0x1cb5c9)[_0xd9dc('0x1d')]();};}function respondWithResult(_0x4b3002,_0x35e45a){_0x35e45a=_0x35e45a||0xc8;return function(_0x573b65){if(_0x573b65){return _0x4b3002['status'](_0x35e45a)[_0xd9dc('0x1e')](_0x573b65);}};}function respondWithFilteredResult(_0x524eab,_0x202a0d){return function(_0x3aada5){if(_0x3aada5){var _0x383165=_0x3aada5[_0xd9dc('0x1f')],_0x179c71=_0x202a0d['offset'],_0x4d86e9=_0x202a0d['offset']+_0x202a0d[_0xd9dc('0x20')],_0x20fe3c;if(_0x4d86e9>=_0x383165){_0x4d86e9=_0x383165;_0x20fe3c=0xc8;}else{_0x20fe3c=0xce;}_0x524eab[_0xd9dc('0x1c')](_0x20fe3c);return _0x524eab[_0xd9dc('0x21')](_0xd9dc('0x22'),_0x179c71+'-'+_0x4d86e9+'/'+_0x383165)[_0xd9dc('0x1e')](_0x3aada5);}return null;};}function patchUpdates(_0x34d75e){return function(_0x5e746a){try{jsonpatch[_0xd9dc('0x23')](_0x5e746a,_0x34d75e,!![]);}catch(_0xeaabe){return BPromise['reject'](_0xeaabe);}return _0x5e746a[_0xd9dc('0x24')]();};}function saveUpdates(_0x1ef93e,_0x161950){return function(_0x296090){if(_0x296090){return _0x296090[_0xd9dc('0x25')](_0x1ef93e)[_0xd9dc('0x26')](function(_0x1e0f61){return _0x1e0f61;});}return null;};}function removeEntity(_0x454cb6,_0x49460f){return function(_0x57559f){if(_0x57559f){return _0x57559f[_0xd9dc('0x27')]()[_0xd9dc('0x26')](function(){_0x454cb6[_0xd9dc('0x1c')](0xcc)[_0xd9dc('0x1d')]();});}};}function handleEntityNotFound(_0x2f96ad,_0x54ed1b){return function(_0x1203d8){if(!_0x1203d8){_0x2f96ad[_0xd9dc('0x1b')](0x194);}return _0x1203d8;};}function handleError(_0x489b58,_0x5f120d){_0x5f120d=_0x5f120d||0x1f4;return function(_0x16c5ac){logger[_0xd9dc('0x28')](_0x16c5ac[_0xd9dc('0x29')]);if(_0x16c5ac[_0xd9dc('0x2a')]){delete _0x16c5ac['name'];}_0x489b58[_0xd9dc('0x1c')](_0x5f120d)[_0xd9dc('0x2b')](_0x16c5ac);};}function getInteractionUsers(_0x69f847,_0x54a5e8){return new BPromise(function(_0x49815c,_0x10d5a0){try{if(_0x54a5e8[_0x69f847['id']]){_0x69f847['Users']=_[_0xd9dc('0x2c')](_0x54a5e8[_0x69f847['id']],function(_0x2a0458){return{'id':_0x2a0458['id'],'fullname':_0x2a0458[_0xd9dc('0x2d')]};});}}catch(_0x1380e0){_0x10d5a0(_0x1380e0);}_0x49815c(_0x69f847);});}function getInteractionTags(_0x1addd0,_0x2c5950){return new BPromise(function(_0x507b60,_0x30937c){try{if(_0x1addd0['TagIds']){_0x1addd0[_0xd9dc('0x2e')]=[];_0x1addd0[_0xd9dc('0x2f')][_0xd9dc('0x30')](',')[_0xd9dc('0x31')](function(_0x5abaf3){_0x1addd0[_0xd9dc('0x2e')]['push'](_0x2c5950[_0x5abaf3]);});}delete _0x1addd0[_0xd9dc('0x2f')];}catch(_0x454548){_0x30937c(_0x454548);}_0x507b60(_0x1addd0);});}function updateOpenchannelInteraction(_0x331523,_0x509971,_0x3d962b){return new BPromise(function(_0x59ac02,_0x5b716e){return getInteractionUsers(_0x331523,_0x3d962b)[_0xd9dc('0x26')](function(_0x3355d8){return getInteractionTags(_0x3355d8,_0x509971);})[_0xd9dc('0x26')](function(_0x319965){_0x59ac02(_0x319965);})[_0xd9dc('0x32')](function(_0x39aa5c){_0x5b716e(_0x39aa5c);});});}exports[_0xd9dc('0x33')]=function(_0x12588b,_0x16e5e0){var _0x363cc6={},_0x2dd996={},_0x24dd49={'count':0x0,'rows':[]};var _0x2fe728=_[_0xd9dc('0x2c')](db['OpenchannelInteraction'][_0xd9dc('0x34')],function(_0x413ef8){return{'name':_0x413ef8[_0xd9dc('0x35')],'type':_0x413ef8['type'][_0xd9dc('0x36')]};});_0x2dd996['model']=_[_0xd9dc('0x2c')](_0x2fe728,_0xd9dc('0x2a'));_0x2dd996['query']=_['keys'](_0x12588b[_0xd9dc('0x37')]);_0x2dd996[_0xd9dc('0x38')]=_[_0xd9dc('0x39')](_0x2dd996[_0xd9dc('0x3a')],_0x2dd996['query']);_0x363cc6[_0xd9dc('0x3b')]=_[_0xd9dc('0x39')](_0x2dd996[_0xd9dc('0x3a')],qs[_0xd9dc('0x3c')](_0x12588b[_0xd9dc('0x37')]['fields']));_0x363cc6['attributes']=_0x363cc6[_0xd9dc('0x3b')][_0xd9dc('0x3d')]?_0x363cc6[_0xd9dc('0x3b')]:_0x2dd996[_0xd9dc('0x3a')];if(!_0x12588b['query'][_0xd9dc('0x3e')](_0xd9dc('0x3f'))){_0x363cc6[_0xd9dc('0x20')]=qs[_0xd9dc('0x20')](_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x20')]);_0x363cc6[_0xd9dc('0x40')]=qs[_0xd9dc('0x40')](_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x40')]);}_0x363cc6[_0xd9dc('0x41')]=qs[_0xd9dc('0x42')](_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x42')]);_0x363cc6[_0xd9dc('0x43')]=qs['filters'](_[_0xd9dc('0x44')](_0x12588b[_0xd9dc('0x37')],_0x2dd996[_0xd9dc('0x38')]));var _0xf0e9d4=[];var _0x44f86a=squel[_0xd9dc('0x45')]()[_0xd9dc('0x46')]('id')[_0xd9dc('0x46')](_0xd9dc('0x2a'))['field'](_0xd9dc('0x47'))[_0xd9dc('0x48')]('tools_tags');var _0x4f8872=squel['select']()[_0xd9dc('0x46')](_0xd9dc('0x49'))['field'](_0xd9dc('0x4a'))[_0xd9dc('0x46')](_0xd9dc('0x4b'))[_0xd9dc('0x48')](_0xd9dc('0x4c'),'ui')['left_join'](_0xd9dc('0x4d'),'u',_0xd9dc('0x4e'));var _0x48cbab=squel[_0xd9dc('0x45')]()[_0xd9dc('0x48')]('openchannel_interactions','i')[_0xd9dc('0x4f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd9dc('0x4f')](_0xd9dc('0x4d'),'o',_0xd9dc('0x50'))[_0xd9dc('0x4f')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0xd9dc('0x51'),'me',_0xd9dc('0x52'))[_0xd9dc('0x4f')](_0xd9dc('0x53'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xd9dc('0x4f')](_0xd9dc('0x54'),'t',_0xd9dc('0x55'));var _0x2ccbcc=squel['expr']();var _0x2d3499=[];var _0x3deb0e=squel['expr']();var _0x250bcb;if(_0x12588b[_0xd9dc('0x37')]['search']){_0x250bcb=as[_0xd9dc('0x56')](_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x57')]);var _0x46648d=_0x250bcb['sqlOperator'];for(var _0x441a4e=0x0;_0x441a4e<_0x250bcb[_0xd9dc('0x58')]['length'];_0x441a4e++){var _0xf95ac1=_0x250bcb[_0xd9dc('0x58')][_0x441a4e];var _0x5eb5ba='i';var _0x58a1b2=_[_0xd9dc('0x59')](_0x2fe728,[_0xd9dc('0x2a'),_0xf95ac1[_0xd9dc('0x46')]]);if(!_0x58a1b2){switch(_0xf95ac1[_0xd9dc('0x46')]){case _0xd9dc('0x5a'):if(_0xf95ac1[_0xd9dc('0x5b')]==0x1){_0x48cbab[_0xd9dc('0x5c')]('`'+_0xf95ac1[_0xd9dc('0x46')]+_0xd9dc('0x5d'));}else{_0x48cbab[_0xd9dc('0x5c')]('`'+_0xf95ac1['field']+_0xd9dc('0x5e'));}break;case _0xd9dc('0x5f'):if(_0xf95ac1['operator']===_0xd9dc('0x60')){if(_0xf95ac1[_0xd9dc('0x5b')][_0xd9dc('0x30')]('\x20')[_0xd9dc('0x3d')]>0x1){_0x2ccbcc[_0x46648d](_0xd9dc('0x61'),qs['getFullTextValue'](_0xf95ac1[_0xd9dc('0x5b')]),null);}else{var _0x12b39c='%'+_0xf95ac1['value']+'%';_0x2ccbcc[_0x46648d](_0xd9dc('0x62'),_0x12b39c,_0x12b39c,_0x12b39c);}}else{_0x58a1b2=_[_0xd9dc('0x59')](_0x2fe728,[_0xd9dc('0x2a'),_0xd9dc('0x63')]);_0xf95ac1[_0xd9dc('0x46')]=_0xd9dc('0x63');_0x4d2b3c=as[_0xd9dc('0x64')](_0x5eb5ba,_0x58a1b2['type'],_0xf95ac1);_0x2ccbcc[_0x46648d](_0x4d2b3c[_0xd9dc('0x65')],_0x4d2b3c[_0xd9dc('0x5b')]['start'],_0x4d2b3c[_0xd9dc('0x5b')]['end']);}break;case _0xd9dc('0x66'):var _0x364b5a=_0xf95ac1[_0xd9dc('0x5b')]['split'](',')[_0xd9dc('0x2c')](function(_0x4a5d34){return Number(_0x4a5d34);});_0x364b5a[_0xd9dc('0x31')](function(_0x5a57bc){_0x3deb0e['or'](_0xd9dc('0x67'),'%,'+_0x5a57bc+',%');});_0x2d3499=_['union'](_0x2d3499,_0x364b5a);break;case _0xd9dc('0x68'):if(_0xf95ac1[_0xd9dc('0x69')]==='$substring'){_0x2ccbcc[_0x46648d](_0xd9dc('0x6a'),'%'+_0xf95ac1['value']+'%',null);}else{_0x58a1b2=_['find'](_0x2fe728,[_0xd9dc('0x2a'),_0xd9dc('0x6b')]);_0xf95ac1[_0xd9dc('0x46')]=_0xd9dc('0x6b');_0x4d2b3c=as[_0xd9dc('0x64')](_0x5eb5ba,_0x58a1b2['type'],_0xf95ac1);_0x2ccbcc[_0x46648d](_0x4d2b3c['text'],_0x4d2b3c[_0xd9dc('0x5b')][_0xd9dc('0x6c')],_0x4d2b3c[_0xd9dc('0x5b')][_0xd9dc('0x1d')]);}break;case _0xd9dc('0x6d'):_0x4d2b3c=as['buildExpression']('me',null,_0xf95ac1);_0x2ccbcc[_0x46648d](_0x4d2b3c[_0xd9dc('0x65')],_0x4d2b3c[_0xd9dc('0x5b')][_0xd9dc('0x6c')],_0x4d2b3c[_0xd9dc('0x5b')][_0xd9dc('0x1d')]);break;}}else{var _0x4d2b3c=as['buildExpression'](_0x5eb5ba,_0x58a1b2[_0xd9dc('0x6e')],_0xf95ac1);_0x2ccbcc[_0x46648d](_0x4d2b3c[_0xd9dc('0x65')],_0x4d2b3c[_0xd9dc('0x5b')][_0xd9dc('0x6c')],_0x4d2b3c['value'][_0xd9dc('0x1d')]);}}}else{var _0x3f3c7d=_(_0x12588b[_0xd9dc('0x37')])[_0xd9dc('0x6f')]()[_0xd9dc('0x2c')](function(_0xde4fc7){return _[_0xd9dc('0x70')](_0x2fe728,[_0xd9dc('0x2a'),_0xde4fc7])?_0xde4fc7:undefined;})[_0xd9dc('0x71')]()[_0xd9dc('0x5b')]();if(!_[_0xd9dc('0x72')](_0x3f3c7d)){_0x3f3c7d[_0xd9dc('0x31')](function(_0x1507a4){if(_0x1507a4===_0xd9dc('0x73')){_0x48cbab[_0xd9dc('0x43')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xd9dc('0x74')](_0x12588b['query'][_0x1507a4]));}else if(_0x1507a4==='createdAt'){var _0x2849bc=JSON['parse'](_0x12588b[_0xd9dc('0x37')][_0x1507a4])[_0xd9dc('0x75')];var _0x3613e6=JSON[_0xd9dc('0x76')](_0x12588b['query'][_0x1507a4])[_0xd9dc('0x77')];_0x48cbab[_0xd9dc('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2849bc,_0x3613e6);}else{if(_0x12588b[_0xd9dc('0x37')][_0x1507a4]==='null'){_0x48cbab['where']('i.'+_0x1507a4+_0xd9dc('0x78'));}else{_0x48cbab[_0xd9dc('0x43')]('i.'+_0x1507a4+_0xd9dc('0x79'),_0x12588b[_0xd9dc('0x37')][_0x1507a4]);}}});}if(_0x12588b[_0xd9dc('0x37')]['read']){if(_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x7a')]==0x1){_0x48cbab[_0xd9dc('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x48cbab['having']('`unreadMessages`\x20>\x200');}}if(_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x7b')]){_0x2d3499=_[_0xd9dc('0x7c')](_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x7b')])?_0x12588b[_0xd9dc('0x37')]['tag']:new Array(_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x7b')]);_0x2d3499[_0xd9dc('0x31')](function(_0x325514){_0x3deb0e['or'](_0xd9dc('0x67'),'%,'+_0x325514+',%');});}if(_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x7d')]){var _0x443c25=_0x12588b['query'][_0xd9dc('0x7d')][_0xd9dc('0x7e')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xd9dc('0x7f'));if(qs['isNumeric'](_0x443c25)){_0x2ccbcc['or'](_0xd9dc('0x80'),_0x443c25+'%');}else{_0x2ccbcc['or'](_0xd9dc('0x81'),qs['getFullTextValue'](_0x443c25))['or'](_0xd9dc('0x82'),_0x443c25+'%')['or'](_0xd9dc('0x83'),_0x443c25+'%');}}}_0x48cbab[_0xd9dc('0x43')](_0x2ccbcc);_0x48cbab[_0xd9dc('0x84')](_0xd9dc('0x85'));var _0x35608c={'type':db[_0xd9dc('0x86')][_0xd9dc('0x87')][_0xd9dc('0x88')],'raw':!![]};var _0x2fa391=_0x48cbab['clone']();_0x2fa391[_0xd9dc('0x46')]('i.id');_0x2fa391[_0xd9dc('0x46')](_0xd9dc('0x89'),'unreadMessages');if(_0x363cc6[_0xd9dc('0x41')]){_0x363cc6[_0xd9dc('0x41')]['forEach'](function(_0x14b133){_0x48cbab['order']('i.'+_0x14b133[0x0],_0x14b133[0x1]===_0xd9dc('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x2d3499)){_0x48cbab['having'](_0x3deb0e);_0x2fa391[_0xd9dc('0x43')](_0xd9dc('0x8b'),_0x2d3499);}BPromise[_0xd9dc('0x8c')]()['then'](function(){if(!_0x250bcb){if(_0x12588b['query'][_0xd9dc('0x73')]||_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x8d')])return;_0x2fa391['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x48cbab[_0xd9dc('0x43')](_0xd9dc('0x8e'));return;}return _0x12588b[_0xd9dc('0x8f')][_0xd9dc('0x90')]({'attributes':['id'],'raw':!![]})[_0xd9dc('0x26')](function(_0x53c017){if(_['isEmpty'](_0x53c017)){_0x2fa391[_0xd9dc('0x43')](_0xd9dc('0x91'));_0x48cbab['where'](_0xd9dc('0x91'));}else{_0x2fa391[_0xd9dc('0x43')](_0xd9dc('0x92'),_[_0xd9dc('0x2c')](_0x53c017,'id'));_0x48cbab[_0xd9dc('0x43')](_0xd9dc('0x92'),_[_0xd9dc('0x2c')](_0x53c017,'id'));}});})[_0xd9dc('0x26')](function(){db[_0xd9dc('0x93')][_0xd9dc('0x37')](_0x2fa391[_0xd9dc('0x94')](),_0x35608c)[_0xd9dc('0x26')](function(_0x103180){_0x24dd49['count']=_0x103180[_0xd9dc('0x3d')];if(_0x24dd49[_0xd9dc('0x1f')]===0x0)return[];return db[_0xd9dc('0x93')][_0xd9dc('0x37')](_0x44f86a[_0xd9dc('0x94')](),_0x35608c)['then'](function(_0x23974a){_0xf0e9d4=_['keyBy'](_0x23974a,'id');_0x35608c=_[_0xd9dc('0x95')](_0x35608c,{'model':db[_0xd9dc('0x96')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x12588b[_0xd9dc('0x37')][_0xd9dc('0x3c')]){_0x363cc6['attributes'][_0xd9dc('0x31')](function(_0xe06d2c){_0x48cbab[_0xd9dc('0x46')]('i.'+_0xe06d2c);});}else{_0x48cbab[_0xd9dc('0x46')](_0xd9dc('0x89'),_0xd9dc('0x5a'));_0x48cbab[_0xd9dc('0x46')]('a.key',_0xd9dc('0x97'));_0x48cbab[_0xd9dc('0x46')](_0xd9dc('0x98'),_0xd9dc('0x99'));_0x48cbab[_0xd9dc('0x46')](_0xd9dc('0x9a'));_0x48cbab[_0xd9dc('0x46')](_0xd9dc('0x9b'),'Contact.firstName');_0x48cbab[_0xd9dc('0x46')]('c.lastName',_0xd9dc('0x9c'));_0x48cbab['field'](_0xd9dc('0x9d'),_0xd9dc('0x9e'));_0x48cbab[_0xd9dc('0x46')](_0xd9dc('0x9f'),'Contact.phone');_0x48cbab['field'](_0xd9dc('0xa0'),_0xd9dc('0xa1'));_0x48cbab[_0xd9dc('0x46')](_0xd9dc('0xa2'),_0xd9dc('0xa3'));_0x48cbab[_0xd9dc('0x46')](_0xd9dc('0xa4'),_0xd9dc('0xa5'));_0x48cbab[_0xd9dc('0x46')]('o.internal',_0xd9dc('0xa6'));_0x48cbab['field'](_0xd9dc('0xa7'),'TagIds');}_0x48cbab['limit'](_0x363cc6[_0xd9dc('0x20')]);_0x48cbab['offset'](_0x363cc6['offset']);return db['sequelize']['query'](_0x48cbab[_0xd9dc('0x94')](),_0x35608c);})[_0xd9dc('0x26')](function(_0x1ee339){_0x4f8872[_0xd9dc('0x43')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xd9dc('0x2c')](_0x1ee339,'id'));return db['sequelize'][_0xd9dc('0x37')](_0x4f8872[_0xd9dc('0x94')](),_0x35608c)[_0xd9dc('0x26')](function(_0xa2bab){var _0x1c3388=_[_0xd9dc('0xa8')](_0xa2bab,_0xd9dc('0xa9'));var _0x2f3d0e=[];_0x1ee339[_0xd9dc('0x31')](function(_0x5ce34a){_0x2f3d0e[_0xd9dc('0xaa')](updateOpenchannelInteraction(_0x5ce34a,_0xf0e9d4,_0x1c3388));});return BPromise[_0xd9dc('0xab')](_0x2f3d0e);});});})[_0xd9dc('0x26')](function(_0x5a246d){_0x24dd49['rows']=_0x5a246d;return _0x24dd49;})[_0xd9dc('0x26')](respondWithFilteredResult(_0x16e5e0,_0x363cc6));})[_0xd9dc('0x32')](handleError(_0x16e5e0,null));};exports[_0xd9dc('0xac')]=function(_0x80e814,_0x2192ab){var _0x1082d7={'raw':![],'where':{'id':_0x80e814[_0xd9dc('0xad')]['id']}},_0x9efcb2={};_0x9efcb2[_0xd9dc('0x3a')]=_[_0xd9dc('0x6f')](db[_0xd9dc('0x96')][_0xd9dc('0x34')]);_0x9efcb2['query']=_[_0xd9dc('0x6f')](_0x80e814['query']);_0x9efcb2[_0xd9dc('0x38')]=_[_0xd9dc('0x39')](_0x9efcb2[_0xd9dc('0x3a')],_0x9efcb2[_0xd9dc('0x37')]);_0x1082d7['attributes']=_[_0xd9dc('0x39')](_0x9efcb2['model'],qs['fields'](_0x80e814[_0xd9dc('0x37')]['fields']));_0x1082d7[_0xd9dc('0x3b')]=_0x1082d7['attributes']['length']?_0x1082d7[_0xd9dc('0x3b')]:_0x9efcb2[_0xd9dc('0x3a')];if(_0x80e814[_0xd9dc('0x37')][_0xd9dc('0xae')]){_0x1082d7[_0xd9dc('0xaf')]=[{'all':!![]}];}_0x1082d7=_[_0xd9dc('0x95')]({},_0x1082d7,_0x80e814['options']);return db[_0xd9dc('0x96')][_0xd9dc('0x59')](_0x1082d7)[_0xd9dc('0x26')](handleEntityNotFound(_0x2192ab,null))['then'](respondWithResult(_0x2192ab,null))[_0xd9dc('0x32')](handleError(_0x2192ab,null));};exports[_0xd9dc('0xb0')]=function(_0x916d45,_0x35f92c){return db[_0xd9dc('0x96')][_0xd9dc('0xb0')](_0x916d45[_0xd9dc('0x6d')],{})['then'](respondWithResult(_0x35f92c,0xc9))[_0xd9dc('0x32')](handleError(_0x35f92c,null));};exports[_0xd9dc('0x25')]=function(_0x1f4a60,_0x4e0ae8){if(_0x1f4a60['body']['id']){delete _0x1f4a60['body']['id'];}return db['OpenchannelInteraction'][_0xd9dc('0x59')]({'where':{'id':_0x1f4a60[_0xd9dc('0xad')]['id']}})[_0xd9dc('0x26')](handleEntityNotFound(_0x4e0ae8,null))[_0xd9dc('0x26')](saveUpdates(_0x1f4a60[_0xd9dc('0x6d')],null))[_0xd9dc('0x26')](respondWithResult(_0x4e0ae8,null))['catch'](handleError(_0x4e0ae8,null));};exports['destroy']=function(_0x45edce,_0x17be8f){return db[_0xd9dc('0x96')]['find']({'where':{'id':_0x45edce['params']['id']}})['then'](handleEntityNotFound(_0x17be8f,null))[_0xd9dc('0x26')](removeEntity(_0x17be8f,null))[_0xd9dc('0x32')](handleError(_0x17be8f,null));};exports[_0xd9dc('0xb1')]=function(_0x54fbf0,_0x4d3963){return db[_0xd9dc('0x96')]['describe']()['then'](respondWithResult(_0x4d3963,null))[_0xd9dc('0x32')](handleError(_0x4d3963,null));};exports[_0xd9dc('0xb2')]=function(_0xccb539,_0xd95c6c,_0x5a5e9e){return db[_0xd9dc('0xb3')][_0xd9dc('0x59')]({'where':{'id':_0xccb539['params']['id']}})[_0xd9dc('0x26')](handleEntityNotFound(_0xd95c6c,null))[_0xd9dc('0x26')](function(_0x459e10){if(_0x459e10){return _0x459e10[_0xd9dc('0xb2')](_0xccb539[_0xd9dc('0x6d')][_0xd9dc('0xb4')],_['omit'](_0xccb539['body'],[_0xd9dc('0xb4'),'id'])||{});}})[_0xd9dc('0x26')](respondWithResult(_0xd95c6c,null))[_0xd9dc('0x32')](handleError(_0xd95c6c,null));};exports['getMessages']=function(_0x16b0b0,_0x5d1b6d,_0x250774){var _0x46de5b={'raw':![],'where':{}};var _0x53faa3={};var _0x4cdd13={'count':0x0,'rows':[]};return db[_0xd9dc('0x96')][_0xd9dc('0xb5')]({'where':{'id':_0x16b0b0[_0xd9dc('0xad')]['id']}})['then'](handleEntityNotFound(_0x5d1b6d,null))[_0xd9dc('0x26')](function(_0x57122d){if(_0x57122d){_0x53faa3[_0xd9dc('0x3a')]=_[_0xd9dc('0x6f')](db[_0xd9dc('0xb3')][_0xd9dc('0x34')]);_0x53faa3[_0xd9dc('0x37')]=_[_0xd9dc('0x6f')](_0x16b0b0[_0xd9dc('0x37')]);_0x53faa3[_0xd9dc('0x38')]=_[_0xd9dc('0x39')](_0x53faa3[_0xd9dc('0x3a')],_0x53faa3['query']);_0x46de5b[_0xd9dc('0x3b')]=_['intersection'](_0x53faa3[_0xd9dc('0x3a')],qs[_0xd9dc('0x3c')](_0x16b0b0['query'][_0xd9dc('0x3c')]));_0x46de5b[_0xd9dc('0x3b')]=_0x46de5b['attributes'][_0xd9dc('0x3d')]?_0x46de5b['attributes']:_0x53faa3[_0xd9dc('0x3a')];if(!_0x16b0b0['query'][_0xd9dc('0x3e')]('nolimit')){_0x46de5b[_0xd9dc('0x20')]=qs['limit'](_0x16b0b0[_0xd9dc('0x37')][_0xd9dc('0x20')]);_0x46de5b['offset']=qs[_0xd9dc('0x40')](_0x16b0b0[_0xd9dc('0x37')]['offset']);}_0x46de5b[_0xd9dc('0x41')]=qs[_0xd9dc('0x42')](_0x16b0b0['query'][_0xd9dc('0x42')]);_0x46de5b['where']=qs[_0xd9dc('0x38')](_['pick'](_0x16b0b0[_0xd9dc('0x37')],_0x53faa3[_0xd9dc('0x38')]));_0x46de5b[_0xd9dc('0x43')]['OpenchannelInteractionId']=_0x57122d['id'];if(_0x16b0b0[_0xd9dc('0x37')]['filter']){_0x46de5b[_0xd9dc('0x43')]=_['merge'](_0x46de5b[_0xd9dc('0x43')],{'$or':_['map'](_0x46de5b[_0xd9dc('0x3b')],function(_0x4bf4b2){var _0x27dbe4={};_0x27dbe4[_0x4bf4b2]={'$like':'%'+_0x16b0b0['query'][_0xd9dc('0x7d')]+'%'};return _0x27dbe4;})});}if(_0x16b0b0[_0xd9dc('0x37')]['$gte']){var _0x3b08d8=_0x16b0b0['query'][_0xd9dc('0x75')][_0xd9dc('0x30')](',');var _0x42e4a5={};_0x42e4a5[_0x3b08d8[0x0]]={'$gte':moment(_0x3b08d8[0x1])[_0xd9dc('0xb6')](_0xd9dc('0xb7'))};_0x46de5b[_0xd9dc('0x43')]=_[_0xd9dc('0x95')](_0x46de5b['where'],_0x42e4a5);}_0x46de5b=_[_0xd9dc('0x95')]({},_0x46de5b,_0x16b0b0['options']);return db[_0xd9dc('0xb3')][_0xd9dc('0x1f')]({'where':_0x46de5b['where']})[_0xd9dc('0x26')](function(_0x15371c){_0x4cdd13[_0xd9dc('0x1f')]=_0x15371c;if(_0x16b0b0[_0xd9dc('0x37')][_0xd9dc('0xae')]){_0x46de5b['include']=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x46de5b);})[_0xd9dc('0x26')](function(_0x1312ab){_0x4cdd13[_0xd9dc('0xb8')]=_0x1312ab;return _0x4cdd13;});}})[_0xd9dc('0x26')](respondWithFilteredResult(_0x5d1b6d,_0x46de5b))[_0xd9dc('0x32')](handleError(_0x5d1b6d,null));};exports[_0xd9dc('0xb9')]=function(_0x1cac42,_0xf834c2,_0x92fbf1){return db[_0xd9dc('0x96')][_0xd9dc('0x59')]({'where':{'id':_0x1cac42['params']['id']}})[_0xd9dc('0x26')](handleEntityNotFound(_0xf834c2,null))['then'](function(_0x4620b8){if(_0x4620b8){return _0x4620b8['setTags'](_0x1cac42[_0xd9dc('0x6d')]['ids'],_[_0xd9dc('0xba')](_0x1cac42['body'],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xd9dc('0x47')],'where':{'id':_0x1cac42[_0xd9dc('0x6d')][_0xd9dc('0xb4')]}});})['then'](function(_0x11fa80){socket[_0xd9dc('0xbb')](_0xd9dc('0xbc'),{'id':Number(_0x1cac42[_0xd9dc('0xad')]['id']),'tags':_0x11fa80||[]});return{'id':Number(_0x1cac42[_0xd9dc('0xad')]['id']),'tags':_0x11fa80||[]};});}})[_0xd9dc('0x26')](respondWithResult(_0xf834c2,null))[_0xd9dc('0x32')](handleError(_0xf834c2,null));};exports[_0xd9dc('0xbd')]=function(_0x1b0a93,_0x3b4fa4,_0x557d59){return db[_0xd9dc('0x96')][_0xd9dc('0x59')]({'where':{'id':_0x1b0a93[_0xd9dc('0xad')]['id']}})['then'](handleEntityNotFound(_0x3b4fa4,null))[_0xd9dc('0x26')](function(_0x3fa265){if(_0x3fa265){return _0x3fa265[_0xd9dc('0xbd')](_0x1b0a93['query'][_0xd9dc('0xb4')]);}})['then'](respondWithStatusCode(_0x3b4fa4,null))[_0xd9dc('0x32')](handleError(_0x3b4fa4,null));};exports[_0xd9dc('0xbe')]=function(_0x2aa4d7,_0x5ef9df){var _0x2c24a2=moment()[_0xd9dc('0xbf')]()[_0xd9dc('0x94')]();var _0xf39714=path['join'](config['root'],_0xd9dc('0xc0'),'files','tmp');var _0x3dab45=path[_0xd9dc('0xc1')](config[_0xd9dc('0xc2')],_0xd9dc('0xc0'),'files',_0xd9dc('0xc3'));var _0x510393=path[_0xd9dc('0xc1')](_0xf39714,_0x2c24a2);var _0x124dfd=util[_0xd9dc('0xb6')](_0xd9dc('0xc4'),_0x2aa4d7[_0xd9dc('0xad')]['id'],_0x2c24a2);var _0x21cfd2=path[_0xd9dc('0xc1')](_0xf39714,_0x124dfd);var _0x2730f4=[];_0x2730f4[_0xd9dc('0xaa')]({'model':db['User'],'as':_0xd9dc('0x68'),'attributes':['id',_0xd9dc('0x2d')],'raw':!![]});_0x2730f4['push']({'model':db[_0xd9dc('0xc5')],'as':_0xd9dc('0x5f'),'attributes':['id',_0xd9dc('0xc6'),_0xd9dc('0xc7')],'raw':!![]});if(_0x2aa4d7['query'][_0xd9dc('0xc3')]){_0x2730f4[_0xd9dc('0xaa')]({'model':db[_0xd9dc('0xc8')],'as':_0xd9dc('0xc8'),'raw':!![]});}var _0x15a3cd=[{'model':db[_0xd9dc('0xb3')],'as':_0xd9dc('0xc9'),'attributes':['id','body','createdAt',_0xd9dc('0xca'),'secret',_0xd9dc('0x7a')],'include':_0x2730f4}];_0x15a3cd[_0xd9dc('0xaa')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xd9dc('0x2a')]});_0x15a3cd[_0xd9dc('0xaa')]({'model':db[_0xd9dc('0x68')],'as':'Owner','attributes':['id',_0xd9dc('0x2d')]});return db[_0xd9dc('0x96')][_0xd9dc('0x59')]({'where':{'id':_0x2aa4d7[_0xd9dc('0xad')]['id']},'include':_0x15a3cd})[_0xd9dc('0x26')](handleEntityNotFound(_0x5ef9df,null))[_0xd9dc('0x26')](function(_0x241f13){if(_0x241f13){var _0xf8eb5c=_0x241f13[_0xd9dc('0xcb')]({'plain':!![]});fs['mkdirSync'](_0x510393);var _0x20a69e={'format':'A4','border':_0xd9dc('0xcc'),'header':{'height':_0xd9dc('0xcd'),'contents':{'first':_0xd9dc('0xce')}},'footer':{'height':_0xd9dc('0xcf'),'contents':{'default':util[_0xd9dc('0xb6')](_0xd9dc('0xd0'),util[_0xd9dc('0xb6')](_0xd9dc('0xd1'),_0xd9dc('0xd2'),_0xf8eb5c['id']),moment()[_0xd9dc('0xb6')]('YYYY-MM-DD')['toString']())}}};var _0x2b2b90={'channel':'Openchannel','account':_0xf8eb5c[_0xd9dc('0xd3')][_0xd9dc('0x2a')],'agent':_0xf8eb5c[_0xd9dc('0xd4')]?_0xf8eb5c['Owner'][_0xd9dc('0x2d')]:'N.A.','createdAt':moment(_0xf8eb5c[_0xd9dc('0xd5')])[_0xd9dc('0xb6')](_0xd9dc('0xb7'))['toString'](),'closedAt':_0xf8eb5c[_0xd9dc('0xd6')]?moment(_0xf8eb5c['closedAt'])[_0xd9dc('0xb6')](_0xd9dc('0xb7'))[_0xd9dc('0x94')]():'','disposition':_0xf8eb5c['disposition'],'visibility':_0xf8eb5c[_0xd9dc('0xd7')]?'Public':_0xd9dc('0xd8'),'messages':_(_0xf8eb5c[_0xd9dc('0xc9')])[_0xd9dc('0x7d')]({'secret':![]})[_0xd9dc('0x2c')](function(_0x3c36c9){if(_0x3c36c9[_0xd9dc('0xc8')]){var _0x333b33=path[_0xd9dc('0xc1')](_0x3dab45,_0x3c36c9[_0xd9dc('0xc8')][_0xd9dc('0xd9')]);if(fs['existsSync'](_0x333b33)){fs['createReadStream'](_0x333b33)['pipe'](fs['createWriteStream'](path[_0xd9dc('0xc1')](_0x510393,_0x3c36c9[_0xd9dc('0xc8')][_0xd9dc('0xd9')])));}}return{'date':moment(_0x3c36c9[_0xd9dc('0xd5')])[_0xd9dc('0xb6')](_0xd9dc('0xb7'))['toString'](),'sender':_0x3c36c9[_0xd9dc('0xca')]==='out'?_0x3c36c9['User']?_0x3c36c9[_0xd9dc('0x68')]['fullname']:_0xd9dc('0xda'):_0x3c36c9[_0xd9dc('0x5f')][_0xd9dc('0xc6')]+(_0x3c36c9[_0xd9dc('0x5f')][_0xd9dc('0xc7')]?'\x20'+_0x3c36c9[_0xd9dc('0x5f')][_0xd9dc('0xc7')]:''),'body':_0x3c36c9[_0xd9dc('0xc8')]?_0x3c36c9[_0xd9dc('0xc8')]['basename']:_0x3c36c9[_0xd9dc('0x6d')],'direction':_0x3c36c9[_0xd9dc('0xca')]===_0xd9dc('0xdb')?'A':'C','secret':_0x3c36c9[_0xd9dc('0xdc')],'read':_0x3c36c9[_0xd9dc('0x7a')],'attachment':_0x3c36c9['Attachment']};})[_0xd9dc('0x5b')]()};return ejs['renderFile'](path[_0xd9dc('0xc1')](config[_0xd9dc('0xc2')],_0xd9dc('0xc0'),_0xd9dc('0xdd'),_0xd9dc('0xde')),{'interaction':_0x2b2b90})[_0xd9dc('0x26')](function(_0x1cb86c){return new BPromise(function(_0x791f6,_0xc66be5){pdf[_0xd9dc('0xb0')](_0x1cb86c,_0x20a69e)[_0xd9dc('0xdf')](path[_0xd9dc('0xc1')](_0x510393,_0xd9dc('0xe0')+_0xf8eb5c['id']+'-'+_0x2c24a2+'.pdf'),function(_0x527c46,_0x21faee){if(_0x527c46)return _0xc66be5(_0x527c46);_0x791f6(_0x21faee);});});})[_0xd9dc('0x26')](function(){return new BPromise(function(_0x3d39e0,_0x51906d){zipdir(_0x510393,{'saveTo':_0x21cfd2},function(_0x36da5b,_0x1d3a43){if(_0x36da5b)return _0x51906d(_0x36da5b);return _0x3d39e0(_0x1d3a43);});})['then'](function(){return new BPromise(function(_0x58f0a6,_0xc1257b){rimraf(_0x510393,function(_0x31aa4d){if(_0x31aa4d)_0xc1257b(_0x31aa4d);return _0x58f0a6();});});})[_0xd9dc('0x26')](function(){return _0x5ef9df['download'](_0x21cfd2,_0x124dfd,function(_0x1374c1){if(_0x1374c1){console[_0xd9dc('0xe1')]('err',_0x1374c1);}else{fs[_0xd9dc('0xe2')](_0x21cfd2);}});});});}else{return _0x5ef9df[_0xd9dc('0x1b')](0xc8);}})[_0xd9dc('0x32')](handleError(_0x5ef9df,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index feafe42..eec78d9 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 _0x2ea4=['then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners','update','getUsers'];(function(_0x135d2a,_0x546cd1){var _0xae488=function(_0x3e8ba0){while(--_0x3e8ba0){_0x135d2a['push'](_0x135d2a['shift']());}};_0xae488(++_0x546cd1);}(_0x2ea4,0x1ea));var _0x42ea=function(_0x3ae73f,_0xcaa580){_0x3ae73f=_0x3ae73f-0x0;var _0x76d70a=_0x2ea4[_0x3ae73f];return _0x76d70a;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x42ea('0x0'))['db'][_0x42ea('0x1')];var OpenchannelMessage=require(_0x42ea('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x42ea('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x42ea('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3972b5){return function(_0x579d83,_0x4086c3,_0x547dfe){_0x579d83[_0x42ea('0x4')]({'attributes':['id'],'raw':!![]})[_0x42ea('0x5')](function(_0x947a8f){_0x579d83[_0x42ea('0x6')](_0x42ea('0x7'),_0x947a8f[_0x42ea('0x8')](function(_0x43778a){return{'id':_0x43778a['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x579d83['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x15cba7){_0x579d83[_0x42ea('0x6')](_0x42ea('0x9'),_0x15cba7[_0x42ea('0xa')]);OpenchannelInteractionEvents[_0x42ea('0xb')](_0x3972b5+':'+_0x579d83['id'],_0x579d83);OpenchannelInteractionEvents[_0x42ea('0xb')](_0x3972b5,_0x579d83);_0x547dfe(null);})[_0x42ea('0xc')](_0x547dfe(null));};}for(var e in events){if(events[_0x42ea('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x42ea('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x805b=['getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x56ca04,_0x1b2827){var _0x12028c=function(_0x53d7f7){while(--_0x53d7f7){_0x56ca04['push'](_0x56ca04['shift']());}};_0x12028c(++_0x1b2827);}(_0x805b,0xfa));var _0xb805=function(_0x52e563,_0x5155d0){_0x52e563=_0x52e563-0x0;var _0x3e0203=_0x805b[_0x52e563];return _0x3e0203;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xb805('0x0'))['db'][_0xb805('0x1')];var OpenchannelMessage=require(_0xb805('0x0'))['db'][_0xb805('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb805('0x3')](0x0);var events={'afterCreate':_0xb805('0x4'),'afterUpdate':_0xb805('0x5'),'afterDestroy':'remove'};function emitEvent(_0x31f755){return function(_0x577b09,_0x30361c,_0x444cfb){_0x577b09[_0xb805('0x6')]({'attributes':['id'],'raw':!![]})[_0xb805('0x7')](function(_0x5532f4){_0x577b09[_0xb805('0x8')](_0xb805('0x9'),_0x5532f4[_0xb805('0xa')](function(_0x2436d8){return{'id':_0x2436d8['id']};}));return OpenchannelMessage[_0xb805('0xb')]({'where':{'OpenchannelInteractionId':_0x577b09['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1de013){_0x577b09[_0xb805('0x8')]('unreadMessages',_0x1de013[_0xb805('0xc')]);OpenchannelInteractionEvents[_0xb805('0xd')](_0x31f755+':'+_0x577b09['id'],_0x577b09);OpenchannelInteractionEvents['emit'](_0x31f755,_0x577b09);_0x444cfb(null);})[_0xb805('0xe')](_0x444cfb(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xb805('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 495bf99..06e1b46 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 _0x236d=['request-promise','path','rimraf','exports','define','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var logger=require('../../config/logger')(_0xd236('0x2'));var moment=require('moment');var BPromise=require(_0xd236('0x3'));var rp=require(_0xd236('0x4'));var fs=require('fs');var path=require(_0xd236('0x5'));var rimraf=require(_0xd236('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xd236('0x7')]=function(_0x29a67c,_0x75d84c){return _0x29a67c[_0xd236('0x8')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d9025,_0x18d969,_0x4e0460){if(_0x2d9025[_0xd236('0x9')](_0xd236('0xa'))){_0x2d9025['closedAt']=moment()[_0xd236('0xb')](_0xd236('0xc'));}_0x4e0460(null,_0x2d9025);}}});}; \ No newline at end of file +var _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','format','lodash','../../config/logger'];(function(_0xd29b14,_0x3d541e){var _0x286aef=function(_0x58e4fe){while(--_0x58e4fe){_0xd29b14['push'](_0xd29b14['shift']());}};_0x286aef(++_0x3d541e);}(_0x7217,0x19e));var _0x7721=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x7217[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x225610,_0x2f99ed,_0x3e6368){if(_0x225610[_0x7721('0xc')](_0x7721('0xd'))){_0x225610[_0x7721('0xe')]=moment()[_0x7721('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3e6368(null,_0x225610);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index adf51de..50e4ab4 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 _0x9296=['OpenchannelInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','limit','debug','where','body','ids','spread','AddTags','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','defaults','redis','localhost','./openchannelInteraction.socket','register','request','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x267dee,_0x789793){var _0x2d2ac7=function(_0x25c08e){while(--_0x25c08e){_0x267dee['push'](_0x267dee['shift']());}};_0x2d2ac7(++_0x789793);}(_0x9296,0x10d));var _0x6929=function(_0x588bb5,_0xa48d27){_0x588bb5=_0x588bb5-0x0;var _0x261e7c=_0x9296[_0x588bb5];return _0x261e7c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6929('0x0'));var BPromise=require('bluebird');var rs=require(_0x6929('0x1'));var fs=require('fs');var Redis=require(_0x6929('0x2'));var db=require(_0x6929('0x3'))['db'];var utils=require(_0x6929('0x4'));var logger=require('../../config/logger')(_0x6929('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6929('0x6')][_0x6929('0x7')]({'port':0x232a});config['redis']=_[_0x6929('0x8')](config[_0x6929('0x9')],{'host':_0x6929('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6929('0x9')]));require(_0x6929('0xb'))[_0x6929('0xc')](socket);function respondWithRpcPromise(_0x547b91,_0x57116e,_0x533770){return new BPromise(function(_0x4a4312,_0x208e1a){return client[_0x6929('0xd')](_0x547b91,_0x533770)['then'](function(_0x24a46e){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x57116e,_0x6929('0xe'));logger['debug'](_0x6929('0xf'),_0x57116e,'request\x20sent',JSON[_0x6929('0x10')](_0x24a46e));if(_0x24a46e[_0x6929('0x11')]){if(_0x24a46e[_0x6929('0x11')][_0x6929('0x12')]===0x1f4){logger[_0x6929('0x11')](_0x6929('0x13'),_0x57116e,_0x24a46e[_0x6929('0x11')][_0x6929('0x14')]);return _0x208e1a(_0x24a46e[_0x6929('0x11')]['message']);}logger[_0x6929('0x11')](_0x6929('0x13'),_0x57116e,_0x24a46e['error']['message']);return _0x4a4312(_0x24a46e['error']['message']);}else{logger[_0x6929('0x15')](_0x6929('0x13'),_0x57116e,'request\x20sent');_0x4a4312(_0x24a46e[_0x6929('0x16')][_0x6929('0x14')]);}})[_0x6929('0x17')](function(_0x3ee05b){logger[_0x6929('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x57116e,_0x3ee05b);_0x208e1a(_0x3ee05b);});});}exports[_0x6929('0x18')]=function(_0x1be926){var _0x284ad2=this;return new Promise(function(_0x3e74c8,_0x267d15){return db[_0x6929('0x19')][_0x6929('0x1a')](_0x1be926['body'],{'raw':_0x1be926[_0x6929('0x1b')]?_0x1be926[_0x6929('0x1b')][_0x6929('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1be926[_0x6929('0x1b')]?_0x1be926['options']['where']||null:null,'attributes':_0x1be926[_0x6929('0x1b')]?_0x1be926['options']['attributes']||null:null,'limit':_0x1be926[_0x6929('0x1b')]?_0x1be926[_0x6929('0x1b')][_0x6929('0x1d')]||null:null})['then'](function(_0xa7225f){logger['info'](_0x6929('0x18'),_0x1be926);logger[_0x6929('0x1e')](_0x6929('0x18'),_0x1be926,JSON[_0x6929('0x10')](_0xa7225f));_0x3e74c8(_0xa7225f);})[_0x6929('0x17')](function(_0x475a46){logger[_0x6929('0x11')](_0x6929('0x18'),_0x475a46[_0x6929('0x14')],_0x1be926);_0x267d15(_0x284ad2[_0x6929('0x11')](0x1f4,_0x475a46[_0x6929('0x14')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x39edff){return new Promise(function(_0xc66f1c,_0x7bec9e){return db[_0x6929('0x19')]['find']({'where':_0x39edff[_0x6929('0x1b')]?_0x39edff['options'][_0x6929('0x1f')]||null:null})['then'](function(_0x5c1454){if(_0x5c1454){return _0x5c1454['addTags'](_0x39edff[_0x6929('0x20')]['ids'],_['omit'](_0x39edff[_0x6929('0x20')],[_0x6929('0x21'),'id'])||{});}})[_0x6929('0x22')](function(_0x3b1030){logger[_0x6929('0x15')](_0x6929('0x23'),_0x39edff);logger['debug'](_0x6929('0x23'),_0x39edff,JSON['stringify'](_0x3b1030));_0xc66f1c(_0x3b1030);})[_0x6929('0x17')](function(_0x34abe3){logger[_0x6929('0x11')](_0x6929('0x23'),_0x34abe3['message'],_0x39edff);_0x7bec9e(_this[_0x6929('0x11')](0x1f4,_0x34abe3[_0x6929('0x14')]));});});}; \ No newline at end of file +var _0x6d6b=['redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','OpenchannelInteraction','update','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','find','addTags','body','ids','omit','AddTags','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','defaults'];(function(_0x5ee1ef,_0x8d83d5){var _0x601cdc=function(_0xf3f658){while(--_0xf3f658){_0x5ee1ef['push'](_0x5ee1ef['shift']());}};_0x601cdc(++_0x8d83d5);}(_0x6d6b,0x137));var _0xb6d6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6d6b[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb6d6('0x0'));var BPromise=require(_0xb6d6('0x1'));var rs=require(_0xb6d6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6d6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6d6('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb6d6('0x5'));var client=jayson[_0xb6d6('0x6')][_0xb6d6('0x7')]({'port':0x232a});config['redis']=_[_0xb6d6('0x8')](config[_0xb6d6('0x9')],{'host':_0xb6d6('0xa'),'port':0x18eb});var socket=require(_0xb6d6('0xb'))(new Redis(config[_0xb6d6('0x9')]));require(_0xb6d6('0xc'))[_0xb6d6('0xd')](socket);function respondWithRpcPromise(_0x3fc6cc,_0x49e9be,_0x52e4a4){return new BPromise(function(_0x229029,_0x4655ec){return client['request'](_0x3fc6cc,_0x52e4a4)[_0xb6d6('0xe')](function(_0x34704b){logger[_0xb6d6('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x49e9be,_0xb6d6('0x10'));logger[_0xb6d6('0x11')](_0xb6d6('0x12'),_0x49e9be,'request\x20sent',JSON[_0xb6d6('0x13')](_0x34704b));if(_0x34704b[_0xb6d6('0x14')]){if(_0x34704b[_0xb6d6('0x14')][_0xb6d6('0x15')]===0x1f4){logger['error'](_0xb6d6('0x16'),_0x49e9be,_0x34704b[_0xb6d6('0x14')][_0xb6d6('0x17')]);return _0x4655ec(_0x34704b[_0xb6d6('0x14')][_0xb6d6('0x17')]);}logger[_0xb6d6('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x49e9be,_0x34704b['error'][_0xb6d6('0x17')]);return _0x229029(_0x34704b['error']['message']);}else{logger[_0xb6d6('0xf')](_0xb6d6('0x16'),_0x49e9be,_0xb6d6('0x10'));_0x229029(_0x34704b[_0xb6d6('0x18')][_0xb6d6('0x17')]);}})[_0xb6d6('0x19')](function(_0x579435){logger[_0xb6d6('0x14')](_0xb6d6('0x16'),_0x49e9be,_0x579435);_0x4655ec(_0x579435);});});}exports['UpdateOpenchannelInteraction']=function(_0x46e66d){var _0x44a6f3=this;return new Promise(function(_0x5d9b52,_0x5c05b3){return db[_0xb6d6('0x1a')][_0xb6d6('0x1b')](_0x46e66d['body'],{'raw':_0x46e66d['options']?_0x46e66d[_0xb6d6('0x1c')][_0xb6d6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46e66d[_0xb6d6('0x1c')]?_0x46e66d[_0xb6d6('0x1c')][_0xb6d6('0x1e')]||null:null,'attributes':_0x46e66d[_0xb6d6('0x1c')]?_0x46e66d['options'][_0xb6d6('0x1f')]||null:null,'limit':_0x46e66d[_0xb6d6('0x1c')]?_0x46e66d['options'][_0xb6d6('0x20')]||null:null})['then'](function(_0xcb1a13){logger[_0xb6d6('0xf')](_0xb6d6('0x21'),_0x46e66d);logger['debug'](_0xb6d6('0x21'),_0x46e66d,JSON['stringify'](_0xcb1a13));_0x5d9b52(_0xcb1a13);})[_0xb6d6('0x19')](function(_0x11134d){logger[_0xb6d6('0x14')](_0xb6d6('0x21'),_0x11134d[_0xb6d6('0x17')],_0x46e66d);_0x5c05b3(_0x44a6f3[_0xb6d6('0x14')](0x1f4,_0x11134d[_0xb6d6('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0xaee7d7){return new Promise(function(_0x1a29f4,_0x5ed240){return db[_0xb6d6('0x1a')][_0xb6d6('0x22')]({'where':_0xaee7d7[_0xb6d6('0x1c')]?_0xaee7d7['options'][_0xb6d6('0x1e')]||null:null})[_0xb6d6('0xe')](function(_0x1f5103){if(_0x1f5103){return _0x1f5103[_0xb6d6('0x23')](_0xaee7d7[_0xb6d6('0x24')][_0xb6d6('0x25')],_[_0xb6d6('0x26')](_0xaee7d7[_0xb6d6('0x24')],[_0xb6d6('0x25'),'id'])||{});}})['spread'](function(_0x94d979){logger[_0xb6d6('0xf')](_0xb6d6('0x27'),_0xaee7d7);logger[_0xb6d6('0x11')]('AddTags',_0xaee7d7,JSON[_0xb6d6('0x13')](_0x94d979));_0x1a29f4(_0x94d979);})['catch'](function(_0x4cde5a){logger[_0xb6d6('0x14')](_0xb6d6('0x27'),_0x4cde5a['message'],_0xaee7d7);_0x5ed240(_this[_0xb6d6('0x14')](0x1f4,_0x4cde5a[_0xb6d6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index d539e2f..8b6fd96 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 _0x5c5f=['length','save','remove','update','emit','removeListener','register'];(function(_0x162a33,_0xffee6e){var _0x5e7178=function(_0x39403b){while(--_0x39403b){_0x162a33['push'](_0x162a33['shift']());}};_0x5e7178(++_0xffee6e);}(_0x5c5f,0x112));var _0xf5c5=function(_0x354532,_0x5d4883){_0x354532=_0x354532-0x0;var _0x50f867=_0x5c5f[_0x354532];return _0x50f867;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xf5c5('0x0'),_0xf5c5('0x1'),_0xf5c5('0x2')];function createListener(_0x486a01,_0x46152b){return function(_0x184c40){_0x46152b[_0xf5c5('0x3')](_0x486a01,_0x184c40);};}function removeListener(_0x1a667e,_0x249c72){return function(){OpenchannelInteractionEvents[_0xf5c5('0x4')](_0x1a667e,_0x249c72);};}exports[_0xf5c5('0x5')]=function(_0x2b5345){for(var _0x7b5bef=0x0,_0x28624c=events[_0xf5c5('0x6')];_0x7b5bef<_0x28624c;_0x7b5bef++){var _0x2e209a=events[_0x7b5bef];var _0x3bb36a=createListener('openchannelInteraction:'+_0x2e209a,_0x2b5345);OpenchannelInteractionEvents['on'](_0x2e209a,_0x3bb36a);}}; \ No newline at end of file +var _0x9093=['length','openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','register'];(function(_0x4fbd61,_0x4d0605){var _0x579ea5=function(_0x112512){while(--_0x112512){_0x4fbd61['push'](_0x4fbd61['shift']());}};_0x579ea5(++_0x4d0605);}(_0x9093,0x87));var _0x3909=function(_0x2e3c48,_0x56cfce){_0x2e3c48=_0x2e3c48-0x0;var _0x3265ac=_0x9093[_0x2e3c48];return _0x3265ac;};'use strict';var OpenchannelInteractionEvents=require(_0x3909('0x0'));var events=['save',_0x3909('0x1'),_0x3909('0x2')];function createListener(_0x2c5fd0,_0x45959e){return function(_0x4a2428){_0x45959e[_0x3909('0x3')](_0x2c5fd0,_0x4a2428);};}function removeListener(_0x51cc63,_0x18919c){return function(){OpenchannelInteractionEvents['removeListener'](_0x51cc63,_0x18919c);};}exports[_0x3909('0x4')]=function(_0x179bc7){for(var _0x172203=0x0,_0x2d0e11=events[_0x3909('0x5')];_0x172203<_0x2d0e11;_0x172203++){var _0x3dfd8b=events[_0x172203];var _0xd2f4aa=createListener(_0x3909('0x6')+_0x3dfd8b,_0x179bc7);OpenchannelInteractionEvents['on'](_0x3dfd8b,_0xd2f4aa);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a85f19a..83e38b5 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 _0xc5d1=['post','tracked','openchannelmessage:create','create','put','/:id','update','accept','reject','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0xcc41fb,_0x2079e7){var _0x42a0d5=function(_0x2bb1a6){while(--_0x2bb1a6){_0xcc41fb['push'](_0xcc41fb['shift']());}};_0x42a0d5(++_0x2079e7);}(_0xc5d1,0x181));var _0x1c5d=function(_0x551fdb,_0x4f24a9){_0x551fdb=_0x551fdb-0x0;var _0x54e6a2=_0xc5d1[_0x551fdb];return _0x54e6a2;};'use strict';var multer=require('multer');var util=require(_0x1c5d('0x0'));var path=require(_0x1c5d('0x1'));var timeout=require(_0x1c5d('0x2'));var express=require(_0x1c5d('0x3'));var router=express[_0x1c5d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1c5d('0x5'));var config=require(_0x1c5d('0x6'));var controller=require('./openchannelMessage.controller');router[_0x1c5d('0x7')]('/',auth[_0x1c5d('0x8')](),controller[_0x1c5d('0x9')]);router[_0x1c5d('0x7')]('/describe',auth[_0x1c5d('0x8')](),controller[_0x1c5d('0xa')]);router[_0x1c5d('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1c5d('0xb')]('/',auth[_0x1c5d('0x8')](),interaction[_0x1c5d('0xc')]('openchannel',_0x1c5d('0xd')),controller[_0x1c5d('0xe')]);router[_0x1c5d('0xf')](_0x1c5d('0x10'),auth[_0x1c5d('0x8')](),controller[_0x1c5d('0x11')]);router[_0x1c5d('0xf')]('/:id/accept',auth[_0x1c5d('0x8')](),controller[_0x1c5d('0x12')]);router[_0x1c5d('0xf')]('/:id/reject',auth['isAuthenticated'](),controller[_0x1c5d('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1c5d('0x14')]);module[_0x1c5d('0x15')]=router; \ No newline at end of file +var _0x68d4=['reject','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','index','/describe','isAuthenticated','/:id','show','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x4c6fe4,_0x50812e){var _0xf87fe4=function(_0x156fd6){while(--_0x156fd6){_0x4c6fe4['push'](_0x4c6fe4['shift']());}};_0xf87fe4(++_0x50812e);}(_0x68d4,0x86));var _0x468d=function(_0x177c8d,_0x15a8af){_0x177c8d=_0x177c8d-0x0;var _0x2a771b=_0x68d4[_0x177c8d];return _0x2a771b;};'use strict';var multer=require(_0x468d('0x0'));var util=require(_0x468d('0x1'));var path=require('path');var timeout=require(_0x468d('0x2'));var express=require('express');var router=express[_0x468d('0x3')]();var auth=require(_0x468d('0x4'));var interaction=require(_0x468d('0x5'));var config=require(_0x468d('0x6'));var controller=require(_0x468d('0x7'));router[_0x468d('0x8')]('/',auth['isAuthenticated'](),controller[_0x468d('0x9')]);router[_0x468d('0x8')](_0x468d('0xa'),auth[_0x468d('0xb')](),controller['describe']);router[_0x468d('0x8')](_0x468d('0xc'),auth[_0x468d('0xb')](),controller[_0x468d('0xd')]);router['post']('/',auth[_0x468d('0xb')](),interaction[_0x468d('0xe')](_0x468d('0xf'),'openchannelmessage:create'),controller[_0x468d('0x10')]);router[_0x468d('0x11')](_0x468d('0xc'),auth[_0x468d('0xb')](),controller[_0x468d('0x12')]);router['put'](_0x468d('0x13'),auth[_0x468d('0xb')](),controller[_0x468d('0x14')]);router[_0x468d('0x11')](_0x468d('0x15'),auth[_0x468d('0xb')](),controller[_0x468d('0x16')]);router[_0x468d('0x17')](_0x468d('0xc'),auth['isAuthenticated'](),controller[_0x468d('0x18')]);module[_0x468d('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 68781db..15f4fc8 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 _0xe7bf=['DATE','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x18a9d5,_0x4ca7c4){var _0x10b503=function(_0x4b83b8){while(--_0x4b83b8){_0x18a9d5['push'](_0x18a9d5['shift']());}};_0x10b503(++_0x4ca7c4);}(_0xe7bf,0xf6));var _0xfe7b=function(_0x49c6ed,_0x52363b){_0x49c6ed=_0x49c6ed-0x0;var _0xf83921=_0xe7bf[_0x49c6ed];return _0xf83921;};'use strict';var Sequelize=require(_0xfe7b('0x0'));module[_0xfe7b('0x1')]={'body':{'type':Sequelize['TEXT'](_0xfe7b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfe7b('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xfe7b('0x4')]('in',_0xfe7b('0x5')),'defaultValue':_0xfe7b('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfe7b('0x6')]}}; \ No newline at end of file +var _0xd102=['sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xd102,0x15c));var _0x2d10=function(_0x4749f7,_0x535137){_0x4749f7=_0x4749f7-0x0;var _0xaabbd9=_0xd102[_0x4749f7];return _0xaabbd9;};'use strict';var Sequelize=require(_0x2d10('0x0'));module['exports']={'body':{'type':Sequelize[_0x2d10('0x1')](_0x2d10('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2d10('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2d10('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2d10('0x4')]('in',_0x2d10('0x5')),'defaultValue':_0x2d10('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 70aceb7..f3b1077 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 _0x6475=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','update','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteraction','isNil','read1stAt','info','interaction','stringify','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','event','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','map','OpenchannelMessage','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x3996e2,_0x5a4ed5){var _0x586f0c=function(_0x45a867){while(--_0x45a867){_0x3996e2['push'](_0x3996e2['shift']());}};_0x586f0c(++_0x5a4ed5);}(_0x6475,0xb3));var _0x5647=function(_0x316efa,_0x20a1e1){_0x316efa=_0x316efa-0x0;var _0x4d96cc=_0x6475[_0x316efa];return _0x4d96cc;};'use strict';var pdf=require(_0x5647('0x0'));var emlformat=require(_0x5647('0x1'));var rimraf=require(_0x5647('0x2'));var zipdir=require(_0x5647('0x3'));var jsonpatch=require(_0x5647('0x4'));var rp=require(_0x5647('0x5'));var moment=require(_0x5647('0x6'));var BPromise=require(_0x5647('0x7'));var Mustache=require(_0x5647('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5647('0x9'));var ejs=require(_0x5647('0xa'));var fs=require('fs');var _=require(_0x5647('0xb'));var squel=require(_0x5647('0xc'));var crypto=require(_0x5647('0xd'));var jsforce=require(_0x5647('0xe'));var deskjs=require(_0x5647('0xf'));var toCsv=require(_0x5647('0x9'));var querystring=require(_0x5647('0x10'));var Papa=require(_0x5647('0x11'));var Redis=require(_0x5647('0x12'));var authService=require(_0x5647('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5647('0x14'));var hardwareService=require(_0x5647('0x15'));var logger=require(_0x5647('0x16'))('api');var utils=require(_0x5647('0x17'));var config=require(_0x5647('0x18'));var db=require(_0x5647('0x19'))['db'];config['redis']=_[_0x5647('0x1a')](config['redis'],{'host':_0x5647('0x1b'),'port':0x18eb});var socket=require(_0x5647('0x1c'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x5647('0x1d'));var client=jayson['client'][_0x5647('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x29be72,_0x2661ee,_0x21246e){if(_0x21246e){var _0x5d29d8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d29d8[_0x5647('0x1f')](_0x2661ee)){return _0x29be72;}else{throw new db[(_0x5647('0x20'))][(_0x5647('0x21'))](_0x5647('0x22'));}}else{return _0x29be72;}}function respondWithRpcPromise(_0x845183,_0x2054c3,_0x1d6933,_0x4aa251){return new BPromise(function(_0x5dc962,_0x44b697){var _0x57d7c3=_0x4aa251||client;return _0x57d7c3[_0x5647('0x23')](_0x845183,_0x1d6933)[_0x5647('0x24')](function(_0x22cdcf){logger['info'](_0x5647('0x25'),_0x2054c3,_0x5647('0x26'));logger['debug'](_0x5647('0x27'),_0x2054c3,_0x5647('0x26'),JSON['stringify'](_0x22cdcf));if(_0x22cdcf[_0x5647('0x28')]){if(_0x22cdcf[_0x5647('0x28')][_0x5647('0x29')]===0x1f4){logger['error'](_0x5647('0x25'),_0x2054c3,_0x22cdcf['error'][_0x5647('0x2a')]);return _0x44b697(_0x22cdcf['error']['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2054c3,_0x22cdcf['error'][_0x5647('0x2a')]);return _0x5dc962(_0x22cdcf[_0x5647('0x28')][_0x5647('0x2a')]);}else{logger['info'](_0x5647('0x25'),_0x2054c3,_0x5647('0x26'));_0x5dc962(_0x22cdcf[_0x5647('0x2b')][_0x5647('0x2a')]);}})['catch'](function(_0x3f8328){logger[_0x5647('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x2054c3,_0x3f8328);_0x44b697(_0x3f8328);});});}function respondWithStatusCode(_0x2c0189,_0x20a0bb){_0x20a0bb=_0x20a0bb||0xcc;return function(_0x1679ed){if(_0x1679ed){return _0x2c0189['sendStatus'](_0x20a0bb);}return _0x2c0189[_0x5647('0x2c')](_0x20a0bb)[_0x5647('0x2d')]();};}function respondWithResult(_0xc80630,_0x14df58){_0x14df58=_0x14df58||0xc8;return function(_0x2e2dde){if(_0x2e2dde){return _0xc80630[_0x5647('0x2c')](_0x14df58)[_0x5647('0x2e')](_0x2e2dde);}};}function respondWithFilteredResult(_0x485632,_0x5c5446){return function(_0x44055d){if(_0x44055d){var _0x5a3aa0=_0x44055d[_0x5647('0x2f')],_0x3bdec5=_0x5c5446['offset'],_0x4b7f9b=_0x5c5446[_0x5647('0x30')]+_0x5c5446[_0x5647('0x31')],_0x5933f2;if(_0x4b7f9b>=_0x5a3aa0){_0x4b7f9b=_0x5a3aa0;_0x5933f2=0xc8;}else{_0x5933f2=0xce;}_0x485632[_0x5647('0x2c')](_0x5933f2);return _0x485632['set'](_0x5647('0x32'),_0x3bdec5+'-'+_0x4b7f9b+'/'+_0x5a3aa0)[_0x5647('0x2e')](_0x44055d);}return null;};}function patchUpdates(_0x242dac){return function(_0x396a16){try{jsonpatch[_0x5647('0x33')](_0x396a16,_0x242dac,!![]);}catch(_0x4a2b78){return BPromise[_0x5647('0x34')](_0x4a2b78);}return _0x396a16[_0x5647('0x35')]();};}function saveUpdates(_0x6be43e,_0x1ed6f9){return function(_0xb57831){if(_0xb57831){return _0xb57831['update'](_0x6be43e)[_0x5647('0x24')](function(_0x364d3c){return _0x364d3c;});}return null;};}function removeEntity(_0x25dd9f,_0x28c563){return function(_0x516c67){if(_0x516c67){return _0x516c67[_0x5647('0x36')]()[_0x5647('0x24')](function(){_0x25dd9f['status'](0xcc)[_0x5647('0x2d')]();});}};}function handleEntityNotFound(_0x3ce1f9,_0x13d0f1){return function(_0x53e6cc){if(!_0x53e6cc){_0x3ce1f9[_0x5647('0x37')](0x194);}return _0x53e6cc;};}function handleError(_0xa5f229,_0x49c59a){_0x49c59a=_0x49c59a||0x1f4;return function(_0x609657){logger['error'](_0x609657[_0x5647('0x38')]);if(_0x609657[_0x5647('0x39')]){delete _0x609657['name'];}_0xa5f229[_0x5647('0x2c')](_0x49c59a)[_0x5647('0x3a')](_0x609657);};}exports['index']=function(_0x3f579d,_0x26c6af){var _0x1bd6eb={},_0x553dce={},_0x5680e3={'count':0x0,'rows':[]};var _0x4c7250=_[_0x5647('0x3b')](db[_0x5647('0x3c')]['rawAttributes'],function(_0x4df438){return{'name':_0x4df438[_0x5647('0x3d')],'type':_0x4df438[_0x5647('0x3e')][_0x5647('0x3f')]};});_0x553dce[_0x5647('0x40')]=_[_0x5647('0x3b')](_0x4c7250,'name');_0x553dce[_0x5647('0x41')]=_[_0x5647('0x42')](_0x3f579d[_0x5647('0x41')]);_0x553dce[_0x5647('0x43')]=_[_0x5647('0x44')](_0x553dce['model'],_0x553dce[_0x5647('0x41')]);_0x1bd6eb[_0x5647('0x45')]=_[_0x5647('0x44')](_0x553dce['model'],qs[_0x5647('0x46')](_0x3f579d[_0x5647('0x41')][_0x5647('0x46')]));_0x1bd6eb[_0x5647('0x45')]=_0x1bd6eb[_0x5647('0x45')][_0x5647('0x47')]?_0x1bd6eb[_0x5647('0x45')]:_0x553dce[_0x5647('0x40')];if(!_0x3f579d[_0x5647('0x41')][_0x5647('0x48')](_0x5647('0x49'))){_0x1bd6eb[_0x5647('0x31')]=qs[_0x5647('0x31')](_0x3f579d[_0x5647('0x41')][_0x5647('0x31')]);_0x1bd6eb['offset']=qs[_0x5647('0x30')](_0x3f579d[_0x5647('0x41')][_0x5647('0x30')]);}_0x1bd6eb[_0x5647('0x4a')]=qs[_0x5647('0x4b')](_0x3f579d['query'][_0x5647('0x4b')]);_0x1bd6eb[_0x5647('0x4c')]=qs[_0x5647('0x43')](_['pick'](_0x3f579d[_0x5647('0x41')],_0x553dce['filters']));if(_0x3f579d['query'][_0x5647('0x4d')]){_0x1bd6eb[_0x5647('0x4c')]=_[_0x5647('0x4e')](_0x1bd6eb['where'],{'$or':_[_0x5647('0x3b')](_0x4c7250,function(_0xe51d48){if(_0xe51d48['type']!==_0x5647('0x4f')){var _0x7acbb1={};_0x7acbb1[_0xe51d48[_0x5647('0x39')]]={'$like':'%'+_0x3f579d[_0x5647('0x41')][_0x5647('0x4d')]+'%'};return _0x7acbb1;}})});}_0x1bd6eb=_[_0x5647('0x4e')]({},_0x1bd6eb,_0x3f579d[_0x5647('0x50')]);var _0xe5508f={'where':_0x1bd6eb['where']};return db['OpenchannelMessage']['count'](_0xe5508f)[_0x5647('0x24')](function(_0x214af5){_0x5680e3[_0x5647('0x2f')]=_0x214af5;if(_0x3f579d[_0x5647('0x41')][_0x5647('0x51')]){_0x1bd6eb[_0x5647('0x52')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x1bd6eb);})[_0x5647('0x24')](function(_0xd0b9ac){_0x5680e3['rows']=_0xd0b9ac;return _0x5680e3;})['then'](respondWithFilteredResult(_0x26c6af,_0x1bd6eb))[_0x5647('0x53')](handleError(_0x26c6af,null));};exports[_0x5647('0x54')]=function(_0x4f599e,_0x5a1024){var _0x5b408d={'raw':!![],'where':{'id':_0x4f599e[_0x5647('0x55')]['id']}},_0x1de98c={};_0x1de98c[_0x5647('0x40')]=_[_0x5647('0x42')](db[_0x5647('0x3c')][_0x5647('0x56')]);_0x1de98c['query']=_[_0x5647('0x42')](_0x4f599e[_0x5647('0x41')]);_0x1de98c[_0x5647('0x43')]=_[_0x5647('0x44')](_0x1de98c[_0x5647('0x40')],_0x1de98c[_0x5647('0x41')]);_0x5b408d[_0x5647('0x45')]=_[_0x5647('0x44')](_0x1de98c['model'],qs[_0x5647('0x46')](_0x4f599e[_0x5647('0x41')][_0x5647('0x46')]));_0x5b408d[_0x5647('0x45')]=_0x5b408d[_0x5647('0x45')][_0x5647('0x47')]?_0x5b408d[_0x5647('0x45')]:_0x1de98c[_0x5647('0x40')];if(_0x4f599e[_0x5647('0x41')][_0x5647('0x51')]){_0x5b408d[_0x5647('0x52')]=[{'all':!![]}];}_0x5b408d=_[_0x5647('0x4e')]({},_0x5b408d,_0x4f599e[_0x5647('0x50')]);return db[_0x5647('0x3c')][_0x5647('0x57')](_0x5b408d)[_0x5647('0x24')](handleEntityNotFound(_0x5a1024,null))['then'](respondWithResult(_0x5a1024,null))['catch'](handleError(_0x5a1024,null));};exports[_0x5647('0x58')]=function(_0x59cf18,_0x17fb6b){return db['OpenchannelMessage'][_0x5647('0x58')](_0x59cf18[_0x5647('0x59')],{})[_0x5647('0x24')](respondWithResult(_0x17fb6b,0xc9))[_0x5647('0x53')](handleError(_0x17fb6b,null));};exports[_0x5647('0x5a')]=function(_0x27cd28,_0x3f87f1){if(_0x27cd28['body']['id']){delete _0x27cd28['body']['id'];}return db[_0x5647('0x3c')][_0x5647('0x57')]({'where':{'id':_0x27cd28[_0x5647('0x55')]['id']}})[_0x5647('0x24')](handleEntityNotFound(_0x3f87f1,null))[_0x5647('0x24')](saveUpdates(_0x27cd28['body'],null))[_0x5647('0x24')](respondWithResult(_0x3f87f1,null))[_0x5647('0x53')](handleError(_0x3f87f1,null));};exports['destroy']=function(_0x88d3d5,_0x5eff8c){return db[_0x5647('0x3c')][_0x5647('0x57')]({'where':{'id':_0x88d3d5[_0x5647('0x55')]['id']}})[_0x5647('0x24')](handleEntityNotFound(_0x5eff8c,null))['then'](removeEntity(_0x5eff8c,null))[_0x5647('0x53')](handleError(_0x5eff8c,null));};exports['describe']=function(_0x4e580f,_0x14ae49){return db[_0x5647('0x3c')][_0x5647('0x5b')]()['then'](respondWithResult(_0x14ae49,null))['catch'](handleError(_0x14ae49,null));};var interaction_log=require(_0x5647('0x16'))(_0x5647('0x5c'));exports['accept']=function(_0xca3d57,_0x4cdbf3,_0x57f721){var _0x3c0607={'channel':_0x5647('0x5d')};if(_0xca3d57[_0x5647('0x59')]['id']){delete _0xca3d57[_0x5647('0x59')]['id'];}_0xca3d57[_0x5647('0x59')][_0x5647('0x5e')]=!![];_0xca3d57[_0x5647('0x59')][_0x5647('0x5f')]=moment()[_0x5647('0x60')](_0x5647('0x61'));_0xca3d57['body'][_0x5647('0x62')]=_0xca3d57[_0x5647('0x59')][_0x5647('0x62')]||_0xca3d57[_0x5647('0x63')]['id'];return db['OpenchannelMessage'][_0x5647('0x57')]({'where':{'id':_0xca3d57[_0x5647('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x5647('0x64')],'as':_0x5647('0x65')}]})['then'](handleEntityNotFound(_0x4cdbf3,null))[_0x5647('0x24')](saveUpdates(_0xca3d57['body'],null))[_0x5647('0x24')](function(_0x51d31a){if(_0x51d31a){_0x3c0607['message']=_0x51d31a[_0x5647('0x66')]({'plain':!![]});return db[_0x5647('0x67')][_0x5647('0x57')]({'where':{'id':_0x51d31a['OpenchannelInteractionId']}});}return null;})[_0x5647('0x24')](handleEntityNotFound(_0x4cdbf3,null))[_0x5647('0x24')](function(_0x473953){if(_0x473953){return _0x473953[_0x5647('0x5a')]({'UserId':_0xca3d57[_0x5647('0x59')][_0x5647('0x62')],'read1stAt':_[_0x5647('0x68')](_0x473953[_0x5647('0x69')])?moment()[_0x5647('0x60')](_0x5647('0x61')):undefined});}return null;})[_0x5647('0x24')](function(_0x58c157){if(_0x58c157){_0x3c0607['interaction']=_0x58c157[_0x5647('0x66')]({'plain':!![]});interaction_log[_0x5647('0x6a')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xca3d57[_0x5647('0x63')]['id'],_0xca3d57[_0x5647('0x63')][_0x5647('0x39')],_0xca3d57[_0x5647('0x63')]['role'],_0x3c0607[_0x5647('0x6b')]['id'],_0xca3d57[_0x5647('0x59')]?JSON[_0x5647('0x6c')](_0xca3d57['body']):'null');return respondWithRpcPromise(_0x5647('0x6d'),_0x5647('0x6e'),_0x3c0607);}return null;})[_0x5647('0x24')](function(_0x385dc5){if(_0x385dc5){if(_0xca3d57[_0x5647('0x59')][_0x5647('0x6f')]){_0x3c0607[_0x5647('0x2a')][_0x5647('0x70')]=util['format'](_0x5647('0x71'),_0xca3d57[_0x5647('0x63')][_0x5647('0x39')]);_0x3c0607['message'][_0x5647('0x72')]=_0x3c0607['channel'];_0x3c0607[_0x5647('0x2a')]['event']='accept';return respondWithRpcPromise(_0x5647('0x73'),_0x5647('0x73'),{'event':_0x5647('0x74'),'message':_0x3c0607[_0x5647('0x2a')]},client9002)[_0x5647('0x24')](function(){return _0x3c0607;});}return _0x3c0607;}return null;})[_0x5647('0x24')](respondWithResult(_0x4cdbf3,null))['catch'](handleError(_0x4cdbf3,null));};var interaction_log=require(_0x5647('0x16'))(_0x5647('0x5c'));exports['reject']=function(_0x464f52,_0x4f1f40,_0x46b53e){var _0x58ea80={'agent':{},'channel':'openchannel'};if(_0x464f52['body']['id']){delete _0x464f52[_0x5647('0x59')]['id'];}_0x464f52['body']['UserId']=_0x464f52[_0x5647('0x59')][_0x5647('0x62')]||_0x464f52[_0x5647('0x63')]['id'];_0x58ea80['agent']['id']=_0x464f52[_0x5647('0x59')]['UserId'];return db[_0x5647('0x3c')][_0x5647('0x57')]({'where':{'id':_0x464f52[_0x5647('0x55')]['id'],'UserId':null}})[_0x5647('0x24')](handleEntityNotFound(_0x4f1f40,null))[_0x5647('0x24')](function(_0x623965){if(_0x623965){_0x58ea80[_0x5647('0x2a')]=_0x623965[_0x5647('0x66')]({'plain':!![]});return db[_0x5647('0x67')][_0x5647('0x57')]({'where':{'id':_0x623965['OpenchannelInteractionId']}});}return null;})[_0x5647('0x24')](handleEntityNotFound(_0x4f1f40,null))[_0x5647('0x24')](function(_0x54801c){if(_0x54801c){_0x58ea80[_0x5647('0x6b')]=_0x54801c[_0x5647('0x66')]({'plain':!![]});interaction_log['info'](_0x5647('0x75'),_0x464f52[_0x5647('0x63')]['id'],_0x464f52[_0x5647('0x63')][_0x5647('0x39')],_0x464f52['user'][_0x5647('0x76')],_0x58ea80['interaction']['id'],_0x464f52['body']?JSON['stringify'](_0x464f52[_0x5647('0x59')]):_0x5647('0x77'));return respondWithRpcPromise(_0x5647('0x78'),_0x5647('0x79'),_0x58ea80);}return null;})[_0x5647('0x24')](function(_0x570b21){if(_0x570b21){_0x570b21[_0x5647('0x2a')][_0x5647('0x70')]=util['format'](_0x5647('0x71'),_0x464f52[_0x5647('0x63')][_0x5647('0x39')]);_0x570b21[_0x5647('0x2a')][_0x5647('0x72')]=_0x58ea80[_0x5647('0x72')];_0x570b21[_0x5647('0x2a')][_0x5647('0x7a')]='reject';respondWithRpcPromise(_0x5647('0x73'),_0x5647('0x73'),{'event':_0x5647('0x7b'),'message':_0x570b21[_0x5647('0x2a')]},client9002);return _0x58ea80;}return null;})[_0x5647('0x24')](respondWithResult(_0x4f1f40,null))[_0x5647('0x53')](handleError(_0x4f1f40,null));}; \ No newline at end of file +var _0xcf65=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','http','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','limit','set','reject','update','destroy','sendStatus','stack','name','index','map','OpenchannelMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','show','params','keys','rawAttributes','create','body','find','describe','openchannel-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','OpenchannelInteractionId','read1stAt','interaction','stringify','acceptMessage','manual','SIP/%s','accept','EventManager','openchannel','agent','get','role','null','rejectMessage','channel','event','rejectmessage','html-pdf','eml-format'];(function(_0xd70bb8,_0x20596d){var _0x4ed942=function(_0x47bb2c){while(--_0x47bb2c){_0xd70bb8['push'](_0xd70bb8['shift']());}};_0x4ed942(++_0x20596d);}(_0xcf65,0x74));var _0x5cf6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcf65[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require(_0x5cf6('0x0'));var emlformat=require(_0x5cf6('0x1'));var rimraf=require(_0x5cf6('0x2'));var zipdir=require(_0x5cf6('0x3'));var jsonpatch=require(_0x5cf6('0x4'));var rp=require('request-promise');var moment=require(_0x5cf6('0x5'));var BPromise=require(_0x5cf6('0x6'));var Mustache=require(_0x5cf6('0x7'));var util=require(_0x5cf6('0x8'));var path=require(_0x5cf6('0x9'));var sox=require(_0x5cf6('0xa'));var csv=require(_0x5cf6('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5cf6('0xc'));var squel=require('squel');var crypto=require(_0x5cf6('0xd'));var jsforce=require(_0x5cf6('0xe'));var deskjs=require(_0x5cf6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5cf6('0x10'));var Papa=require(_0x5cf6('0x11'));var Redis=require(_0x5cf6('0x12'));var authService=require(_0x5cf6('0x13'));var qs=require(_0x5cf6('0x14'));var as=require(_0x5cf6('0x15'));var hardwareService=require(_0x5cf6('0x16'));var logger=require(_0x5cf6('0x17'))(_0x5cf6('0x18'));var utils=require('../../config/utils');var config=require(_0x5cf6('0x19'));var db=require(_0x5cf6('0x1a'))['db'];config[_0x5cf6('0x1b')]=_[_0x5cf6('0x1c')](config[_0x5cf6('0x1b')],{'host':_0x5cf6('0x1d'),'port':0x18eb});var socket=require(_0x5cf6('0x1e'))(new Redis(config['redis']));require(_0x5cf6('0x1f'))['register'](socket);var jayson=require(_0x5cf6('0x20'));var client=jayson['client'][_0x5cf6('0x21')]({'port':0x232c});var client9002=jayson[_0x5cf6('0x22')][_0x5cf6('0x21')]({'port':0x232a});function checkPasswordPattern(_0x158bc7,_0x1ef6f4,_0x4ce45c){if(_0x4ce45c){var _0x22bbd7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22bbd7[_0x5cf6('0x23')](_0x1ef6f4)){return _0x158bc7;}else{throw new db[(_0x5cf6('0x24'))]['ValidationError'](_0x5cf6('0x25'));}}else{return _0x158bc7;}}function respondWithRpcPromise(_0x43c97a,_0x121564,_0x44e74d,_0x34f899){return new BPromise(function(_0x1f7113,_0x2c47a8){var _0x43331c=_0x34f899||client;return _0x43331c[_0x5cf6('0x26')](_0x43c97a,_0x44e74d)[_0x5cf6('0x27')](function(_0x250566){logger[_0x5cf6('0x28')](_0x5cf6('0x29'),_0x121564,_0x5cf6('0x2a'));logger[_0x5cf6('0x2b')](_0x5cf6('0x2c'),_0x121564,_0x5cf6('0x2a'),JSON['stringify'](_0x250566));if(_0x250566[_0x5cf6('0x2d')]){if(_0x250566['error'][_0x5cf6('0x2e')]===0x1f4){logger[_0x5cf6('0x2d')]('OpenchannelMessage,\x20%s,\x20%s',_0x121564,_0x250566['error']['message']);return _0x2c47a8(_0x250566[_0x5cf6('0x2d')]['message']);}logger[_0x5cf6('0x2d')](_0x5cf6('0x29'),_0x121564,_0x250566[_0x5cf6('0x2d')][_0x5cf6('0x2f')]);return _0x1f7113(_0x250566['error'][_0x5cf6('0x2f')]);}else{logger[_0x5cf6('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x121564,_0x5cf6('0x2a'));_0x1f7113(_0x250566['result'][_0x5cf6('0x2f')]);}})[_0x5cf6('0x30')](function(_0x4e4b1d){logger[_0x5cf6('0x2d')](_0x5cf6('0x29'),_0x121564,_0x4e4b1d);_0x2c47a8(_0x4e4b1d);});});}function respondWithStatusCode(_0x3a52c5,_0x5b1e98){_0x5b1e98=_0x5b1e98||0xcc;return function(_0x1785a1){if(_0x1785a1){return _0x3a52c5['sendStatus'](_0x5b1e98);}return _0x3a52c5[_0x5cf6('0x31')](_0x5b1e98)[_0x5cf6('0x32')]();};}function respondWithResult(_0x2ba1c8,_0x5d9d7e){_0x5d9d7e=_0x5d9d7e||0xc8;return function(_0x587a88){if(_0x587a88){return _0x2ba1c8[_0x5cf6('0x31')](_0x5d9d7e)[_0x5cf6('0x33')](_0x587a88);}};}function respondWithFilteredResult(_0x1a10f9,_0x3fcb40){return function(_0x461db2){if(_0x461db2){var _0x35a317=_0x461db2['count'],_0x6b17f9=_0x3fcb40['offset'],_0x7c359a=_0x3fcb40[_0x5cf6('0x34')]+_0x3fcb40[_0x5cf6('0x35')],_0x5283aa;if(_0x7c359a>=_0x35a317){_0x7c359a=_0x35a317;_0x5283aa=0xc8;}else{_0x5283aa=0xce;}_0x1a10f9['status'](_0x5283aa);return _0x1a10f9[_0x5cf6('0x36')]('Content-Range',_0x6b17f9+'-'+_0x7c359a+'/'+_0x35a317)[_0x5cf6('0x33')](_0x461db2);}return null;};}function patchUpdates(_0x41055b){return function(_0x357238){try{jsonpatch['apply'](_0x357238,_0x41055b,!![]);}catch(_0x25ef2d){return BPromise[_0x5cf6('0x37')](_0x25ef2d);}return _0x357238['save']();};}function saveUpdates(_0x4eeadc,_0x2a8e1a){return function(_0x272f97){if(_0x272f97){return _0x272f97[_0x5cf6('0x38')](_0x4eeadc)['then'](function(_0x34a0f5){return _0x34a0f5;});}return null;};}function removeEntity(_0x1c3ce5,_0x589eb3){return function(_0x408542){if(_0x408542){return _0x408542[_0x5cf6('0x39')]()[_0x5cf6('0x27')](function(){_0x1c3ce5['status'](0xcc)[_0x5cf6('0x32')]();});}};}function handleEntityNotFound(_0x25b717,_0x1b043a){return function(_0xe583d3){if(!_0xe583d3){_0x25b717[_0x5cf6('0x3a')](0x194);}return _0xe583d3;};}function handleError(_0x3ddfd2,_0x186fdc){_0x186fdc=_0x186fdc||0x1f4;return function(_0x33866a){logger[_0x5cf6('0x2d')](_0x33866a[_0x5cf6('0x3b')]);if(_0x33866a['name']){delete _0x33866a[_0x5cf6('0x3c')];}_0x3ddfd2[_0x5cf6('0x31')](_0x186fdc)['send'](_0x33866a);};}exports[_0x5cf6('0x3d')]=function(_0x2cfca4,_0x198630){var _0x21b2e3={},_0x2d9485={},_0x3fcd97={'count':0x0,'rows':[]};var _0x4c897a=_[_0x5cf6('0x3e')](db[_0x5cf6('0x3f')]['rawAttributes'],function(_0x3d0490){return{'name':_0x3d0490[_0x5cf6('0x40')],'type':_0x3d0490[_0x5cf6('0x41')][_0x5cf6('0x42')]};});_0x2d9485[_0x5cf6('0x43')]=_[_0x5cf6('0x3e')](_0x4c897a,_0x5cf6('0x3c'));_0x2d9485[_0x5cf6('0x44')]=_['keys'](_0x2cfca4[_0x5cf6('0x44')]);_0x2d9485[_0x5cf6('0x45')]=_[_0x5cf6('0x46')](_0x2d9485[_0x5cf6('0x43')],_0x2d9485[_0x5cf6('0x44')]);_0x21b2e3[_0x5cf6('0x47')]=_[_0x5cf6('0x46')](_0x2d9485['model'],qs[_0x5cf6('0x48')](_0x2cfca4[_0x5cf6('0x44')][_0x5cf6('0x48')]));_0x21b2e3[_0x5cf6('0x47')]=_0x21b2e3[_0x5cf6('0x47')][_0x5cf6('0x49')]?_0x21b2e3[_0x5cf6('0x47')]:_0x2d9485['model'];if(!_0x2cfca4[_0x5cf6('0x44')]['hasOwnProperty'](_0x5cf6('0x4a'))){_0x21b2e3['limit']=qs[_0x5cf6('0x35')](_0x2cfca4[_0x5cf6('0x44')]['limit']);_0x21b2e3['offset']=qs['offset'](_0x2cfca4[_0x5cf6('0x44')]['offset']);}_0x21b2e3[_0x5cf6('0x4b')]=qs[_0x5cf6('0x4c')](_0x2cfca4[_0x5cf6('0x44')][_0x5cf6('0x4c')]);_0x21b2e3[_0x5cf6('0x4d')]=qs[_0x5cf6('0x45')](_[_0x5cf6('0x4e')](_0x2cfca4[_0x5cf6('0x44')],_0x2d9485['filters']));if(_0x2cfca4[_0x5cf6('0x44')][_0x5cf6('0x4f')]){_0x21b2e3[_0x5cf6('0x4d')]=_['merge'](_0x21b2e3['where'],{'$or':_[_0x5cf6('0x3e')](_0x4c897a,function(_0x18e17c){if(_0x18e17c[_0x5cf6('0x41')]!=='VIRTUAL'){var _0x1c7458={};_0x1c7458[_0x18e17c['name']]={'$like':'%'+_0x2cfca4['query'][_0x5cf6('0x4f')]+'%'};return _0x1c7458;}})});}_0x21b2e3=_[_0x5cf6('0x50')]({},_0x21b2e3,_0x2cfca4[_0x5cf6('0x51')]);var _0x23bc8a={'where':_0x21b2e3['where']};return db[_0x5cf6('0x3f')][_0x5cf6('0x52')](_0x23bc8a)[_0x5cf6('0x27')](function(_0x3e97c2){_0x3fcd97[_0x5cf6('0x52')]=_0x3e97c2;if(_0x2cfca4[_0x5cf6('0x44')][_0x5cf6('0x53')]){_0x21b2e3[_0x5cf6('0x54')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x21b2e3);})[_0x5cf6('0x27')](function(_0xacbf6d){_0x3fcd97['rows']=_0xacbf6d;return _0x3fcd97;})[_0x5cf6('0x27')](respondWithFilteredResult(_0x198630,_0x21b2e3))['catch'](handleError(_0x198630,null));};exports[_0x5cf6('0x55')]=function(_0x1022b7,_0x5b6fd1){var _0x17a8b5={'raw':!![],'where':{'id':_0x1022b7[_0x5cf6('0x56')]['id']}},_0x4b24bc={};_0x4b24bc[_0x5cf6('0x43')]=_[_0x5cf6('0x57')](db[_0x5cf6('0x3f')][_0x5cf6('0x58')]);_0x4b24bc[_0x5cf6('0x44')]=_[_0x5cf6('0x57')](_0x1022b7[_0x5cf6('0x44')]);_0x4b24bc['filters']=_[_0x5cf6('0x46')](_0x4b24bc[_0x5cf6('0x43')],_0x4b24bc[_0x5cf6('0x44')]);_0x17a8b5[_0x5cf6('0x47')]=_[_0x5cf6('0x46')](_0x4b24bc[_0x5cf6('0x43')],qs[_0x5cf6('0x48')](_0x1022b7[_0x5cf6('0x44')][_0x5cf6('0x48')]));_0x17a8b5[_0x5cf6('0x47')]=_0x17a8b5[_0x5cf6('0x47')][_0x5cf6('0x49')]?_0x17a8b5[_0x5cf6('0x47')]:_0x4b24bc['model'];if(_0x1022b7['query']['includeAll']){_0x17a8b5[_0x5cf6('0x54')]=[{'all':!![]}];}_0x17a8b5=_[_0x5cf6('0x50')]({},_0x17a8b5,_0x1022b7[_0x5cf6('0x51')]);return db[_0x5cf6('0x3f')]['find'](_0x17a8b5)[_0x5cf6('0x27')](handleEntityNotFound(_0x5b6fd1,null))[_0x5cf6('0x27')](respondWithResult(_0x5b6fd1,null))[_0x5cf6('0x30')](handleError(_0x5b6fd1,null));};exports[_0x5cf6('0x59')]=function(_0x27073b,_0x2ebd65){return db[_0x5cf6('0x3f')][_0x5cf6('0x59')](_0x27073b[_0x5cf6('0x5a')],{})[_0x5cf6('0x27')](respondWithResult(_0x2ebd65,0xc9))[_0x5cf6('0x30')](handleError(_0x2ebd65,null));};exports[_0x5cf6('0x38')]=function(_0x58a067,_0x29fdf9){if(_0x58a067[_0x5cf6('0x5a')]['id']){delete _0x58a067[_0x5cf6('0x5a')]['id'];}return db['OpenchannelMessage'][_0x5cf6('0x5b')]({'where':{'id':_0x58a067[_0x5cf6('0x56')]['id']}})['then'](handleEntityNotFound(_0x29fdf9,null))[_0x5cf6('0x27')](saveUpdates(_0x58a067[_0x5cf6('0x5a')],null))[_0x5cf6('0x27')](respondWithResult(_0x29fdf9,null))[_0x5cf6('0x30')](handleError(_0x29fdf9,null));};exports['destroy']=function(_0x31c193,_0x459e34){return db[_0x5cf6('0x3f')][_0x5cf6('0x5b')]({'where':{'id':_0x31c193[_0x5cf6('0x56')]['id']}})['then'](handleEntityNotFound(_0x459e34,null))['then'](removeEntity(_0x459e34,null))[_0x5cf6('0x30')](handleError(_0x459e34,null));};exports['describe']=function(_0x3b8856,_0xace615){return db[_0x5cf6('0x3f')][_0x5cf6('0x5c')]()['then'](respondWithResult(_0xace615,null))[_0x5cf6('0x30')](handleError(_0xace615,null));};var interaction_log=require(_0x5cf6('0x17'))(_0x5cf6('0x5d'));exports['accept']=function(_0x206943,_0x5a3a6a,_0x2aae13){var _0x503689={'channel':'openchannel'};if(_0x206943['body']['id']){delete _0x206943[_0x5cf6('0x5a')]['id'];}_0x206943[_0x5cf6('0x5a')]['read']=!![];_0x206943['body'][_0x5cf6('0x5e')]=moment()[_0x5cf6('0x5f')](_0x5cf6('0x60'));_0x206943['body'][_0x5cf6('0x61')]=_0x206943[_0x5cf6('0x5a')][_0x5cf6('0x61')]||_0x206943[_0x5cf6('0x62')]['id'];return db[_0x5cf6('0x3f')][_0x5cf6('0x5b')]({'where':{'id':_0x206943[_0x5cf6('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x5cf6('0x63')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x5a3a6a,null))['then'](saveUpdates(_0x206943[_0x5cf6('0x5a')],null))[_0x5cf6('0x27')](function(_0xa1213){if(_0xa1213){_0x503689['message']=_0xa1213['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x5cf6('0x5b')]({'where':{'id':_0xa1213[_0x5cf6('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x5a3a6a,null))['then'](function(_0x3a67c7){if(_0x3a67c7){return _0x3a67c7[_0x5cf6('0x38')]({'UserId':_0x206943[_0x5cf6('0x5a')][_0x5cf6('0x61')],'read1stAt':_['isNil'](_0x3a67c7[_0x5cf6('0x65')])?moment()[_0x5cf6('0x5f')](_0x5cf6('0x60')):undefined});}return null;})[_0x5cf6('0x27')](function(_0x51fa83){if(_0x51fa83){_0x503689[_0x5cf6('0x66')]=_0x51fa83['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x206943[_0x5cf6('0x62')]['id'],_0x206943[_0x5cf6('0x62')][_0x5cf6('0x3c')],_0x206943[_0x5cf6('0x62')]['role'],_0x503689[_0x5cf6('0x66')]['id'],_0x206943['body']?JSON[_0x5cf6('0x67')](_0x206943[_0x5cf6('0x5a')]):'null');return respondWithRpcPromise('AcceptMessage',_0x5cf6('0x68'),_0x503689);}return null;})['then'](function(_0x16daae){if(_0x16daae){if(_0x206943[_0x5cf6('0x5a')][_0x5cf6('0x69')]){_0x503689[_0x5cf6('0x2f')]['interface']=util[_0x5cf6('0x5f')](_0x5cf6('0x6a'),_0x206943['user'][_0x5cf6('0x3c')]);_0x503689[_0x5cf6('0x2f')]['channel']=_0x503689['channel'];_0x503689['message']['event']=_0x5cf6('0x6b');return respondWithRpcPromise(_0x5cf6('0x6c'),_0x5cf6('0x6c'),{'event':'acceptmessage','message':_0x503689[_0x5cf6('0x2f')]},client9002)['then'](function(){return _0x503689;});}return _0x503689;}return null;})[_0x5cf6('0x27')](respondWithResult(_0x5a3a6a,null))[_0x5cf6('0x30')](handleError(_0x5a3a6a,null));};var interaction_log=require(_0x5cf6('0x17'))(_0x5cf6('0x5d'));exports[_0x5cf6('0x37')]=function(_0x399791,_0x64ad4e,_0x217543){var _0x123f20={'agent':{},'channel':_0x5cf6('0x6d')};if(_0x399791[_0x5cf6('0x5a')]['id']){delete _0x399791[_0x5cf6('0x5a')]['id'];}_0x399791['body'][_0x5cf6('0x61')]=_0x399791['body'][_0x5cf6('0x61')]||_0x399791[_0x5cf6('0x62')]['id'];_0x123f20[_0x5cf6('0x6e')]['id']=_0x399791['body']['UserId'];return db[_0x5cf6('0x3f')]['find']({'where':{'id':_0x399791['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x64ad4e,null))[_0x5cf6('0x27')](function(_0x55c0b1){if(_0x55c0b1){_0x123f20['message']=_0x55c0b1[_0x5cf6('0x6f')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x55c0b1[_0x5cf6('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x64ad4e,null))[_0x5cf6('0x27')](function(_0x152fab){if(_0x152fab){_0x123f20[_0x5cf6('0x66')]=_0x152fab[_0x5cf6('0x6f')]({'plain':!![]});interaction_log[_0x5cf6('0x28')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x399791[_0x5cf6('0x62')]['id'],_0x399791[_0x5cf6('0x62')][_0x5cf6('0x3c')],_0x399791[_0x5cf6('0x62')][_0x5cf6('0x70')],_0x123f20[_0x5cf6('0x66')]['id'],_0x399791[_0x5cf6('0x5a')]?JSON[_0x5cf6('0x67')](_0x399791['body']):_0x5cf6('0x71'));return respondWithRpcPromise('RejectMessage',_0x5cf6('0x72'),_0x123f20);}return null;})[_0x5cf6('0x27')](function(_0x510117){if(_0x510117){_0x510117[_0x5cf6('0x2f')]['interface']=util[_0x5cf6('0x5f')](_0x5cf6('0x6a'),_0x399791[_0x5cf6('0x62')][_0x5cf6('0x3c')]);_0x510117[_0x5cf6('0x2f')][_0x5cf6('0x73')]=_0x123f20[_0x5cf6('0x73')];_0x510117[_0x5cf6('0x2f')][_0x5cf6('0x74')]=_0x5cf6('0x37');respondWithRpcPromise(_0x5cf6('0x6c'),'EventManager',{'event':_0x5cf6('0x75'),'message':_0x510117['message']},client9002);return _0x123f20;}return null;})[_0x5cf6('0x27')](respondWithResult(_0x64ad4e,null))[_0x5cf6('0x30')](handleError(_0x64ad4e,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 2b19763..2b608f6 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 _0x4d90=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x2f1714,_0x19205d){var _0x2097a4=function(_0x37e105){while(--_0x37e105){_0x2f1714['push'](_0x2f1714['shift']());}};_0x2097a4(++_0x19205d);}(_0x4d90,0xbd));var _0x04d9=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x4d90[_0x424a9a];return _0xa7831c;};'use strict';var EventEmitter=require(_0x04d9('0x0'));var OpenchannelMessage=require(_0x04d9('0x1'))['db'][_0x04d9('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x04d9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x04d9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e65dc){return function(_0x14da00,_0x4604fa,_0x1497b8){OpenchannelMessageEvents[_0x04d9('0x5')](_0x5e65dc+':'+_0x14da00['id'],_0x14da00);OpenchannelMessageEvents['emit'](_0x5e65dc,_0x14da00);_0x1497b8(null);};}for(var e in events){if(events[_0x04d9('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xb652=['OpenchannelMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x27ecd4,_0x488c69){var _0xe6d9b2=function(_0x370337){while(--_0x370337){_0x27ecd4['push'](_0x27ecd4['shift']());}};_0xe6d9b2(++_0x488c69);}(_0xb652,0x11f));var _0x2b65=function(_0x19d27b,_0xa415e4){_0x19d27b=_0x19d27b-0x0;var _0x484643=_0xb652[_0x19d27b];return _0x484643;};'use strict';var EventEmitter=require(_0x2b65('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x2b65('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2b65('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2b65('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4b0632){return function(_0x59d746,_0x1f8ce0,_0x13dad1){OpenchannelMessageEvents[_0x2b65('0x4')](_0x4b0632+':'+_0x59d746['id'],_0x59d746);OpenchannelMessageEvents[_0x2b65('0x4')](_0x4b0632,_0x59d746);_0x13dad1(null);};}for(var e in events){if(events[_0x2b65('0x5')](e)){var event=events[e];OpenchannelMessage[_0x2b65('0x6')](e,emitEvent(event));}}module[_0x2b65('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 f3781c3..1e35c88 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 _0x0029=['OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','keys','replyUri','info','format','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','inspect','finally','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','createdAt','catch','error','out','describe','OpenchannelAccount','find'];(function(_0x166b27,_0x28c63f){var _0x2ba757=function(_0x3332fa){while(--_0x3332fa){_0x166b27['push'](_0x166b27['shift']());}};_0x2ba757(++_0x28c63f);}(_0x0029,0x82));var _0x9002=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x0029[_0x363ef8];return _0x148822;};'use strict';var _=require(_0x9002('0x0'));var util=require(_0x9002('0x1'));var logger=require(_0x9002('0x2'))('api');var moment=require(_0x9002('0x3'));var BPromise=require(_0x9002('0x4'));var rp=require(_0x9002('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9002('0x6'));var config=require(_0x9002('0x7'));var attributes=require(_0x9002('0x8'));module[_0x9002('0x9')]=function(_0xcb816c,_0x578e32){return _0xcb816c[_0x9002('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x9002('0xb'),'paranoid':![],'indexes':[{'name':_0x9002('0xc'),'fields':[_0x9002('0xd')],'type':_0x9002('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x166fef,_0x370017,_0x58c05b){var _0x3b0804=_0xcb816c[_0x9002('0xf')];var _0x16d095=_0x166fef[_0x9002('0x10')]({'plain':!![]});if(_0x16d095[_0x9002('0x11')][_0x9002('0x12')]()==='in'||_0x16d095[_0x9002('0x11')]['toLowerCase']()==='out'&&!_0x16d095[_0x9002('0x13')]&&!_[_0x9002('0x14')](_0x16d095[_0x9002('0x15')])){_0x3b0804['OpenchannelInteraction'][_0x9002('0x16')]({'where':{'id':_0x16d095[_0x9002('0x17')]}})[_0x9002('0x18')](function(_0x3ec22b){if(_0x3ec22b){_0x3ec22b['update']({'lastMsgAt':_0x16d095[_0x9002('0x19')],'lastMsgDirection':_0x16d095[_0x9002('0x11')][_0x9002('0x12')]()});}})[_0x9002('0x1a')](function(_0x4c8ac5){console[_0x9002('0x1b')](_0x4c8ac5);});}if(_0x16d095[_0x9002('0x11')]===_0x9002('0x1c')&&!_0x16d095[_0x9002('0x13')]){var _0x183f62;_0x3b0804['CmContact'][_0x9002('0x1d')]()['then'](function(_0x23e76d){return _0x3b0804[_0x9002('0x1e')][_0x9002('0x1f')]({'where':{'id':_0x16d095[_0x9002('0x20')]},'include':[{'model':_0x3b0804[_0x9002('0x21')],'as':_0x9002('0x22'),'where':{'id':_0x16d095['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x3b0804[_0x9002('0x23')],'as':_0x9002('0x24'),'attributes':_[_0x9002('0x25')](_0x23e76d)}]}]});})[_0x9002('0x18')](function(_0x537493){_0x183f62=_0x537493['get']({'plain':!![]});if(_0x183f62&&_0x183f62[_0x9002('0x26')]){logger[_0x9002('0x27')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x9002('0x28')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x16d095['id'],_0x183f62[_0x9002('0x26')]));if(_0x183f62[_0x9002('0x22')]&&_0x183f62[_0x9002('0x22')]['length']){_0x16d095['Interaction']=_[_0x9002('0x29')](_0x183f62[_0x9002('0x22')][0x0],_0x9002('0x24'));_0x16d095['Contact']=_0x183f62[_0x9002('0x22')][0x0][_0x9002('0x24')];}var _0x370017={'method':_0x9002('0x2a'),'uri':encodeURI(_0x183f62[_0x9002('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x370017[_0x9002('0x2b')]){case _0x9002('0x2c'):_0x370017['qs']=_0x16d095;break;case _0x9002('0x2a'):_0x370017['body']=_0x16d095;break;}return rp(_0x370017)[_0x9002('0x18')](function(_0x563f17){logger[_0x9002('0x27')](_0x9002('0x2d'),_0x9002('0x2e'),util[_0x9002('0x28')](_0x9002('0x2f'),_0x16d095['id'],_0x183f62['replyUri']));if(_0x563f17['body'][_0x9002('0x30')]&&_0x563f17[_0x9002('0xd')][_0x9002('0x30')]!=_0x16d095[_0x9002('0x31')][_0x9002('0x30')]){return _0x3b0804[_0x9002('0x21')][_0x9002('0x32')]({'threadId':_0x563f17[_0x9002('0xd')][_0x9002('0x30')]},{'logging':!![],'where':{'id':_0x16d095[_0x9002('0x31')]['id']}});}else{return;}})[_0x9002('0x18')](function(){return _0x166fef[_0x9002('0x32')]({'read':!![]});})[_0x9002('0x1a')](function(_0x2c145f){logger[_0x9002('0x1b')](_0x9002('0x2d'),_0x9002('0x2e'),util[_0x9002('0x33')](_0x2c145f,{'showHidden':![],'depth':null}));_0x58c05b();});}else{_0x58c05b();}})[_0x9002('0x34')](function(){_0x58c05b();});}else{_0x58c05b();}}},'charset':_0x9002('0x35'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8da9=['find','Interactions','Contact','then','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','createdAt','error','CmContact','OpenchannelAccount'];(function(_0x1d1e75,_0x18e529){var _0x57c0f7=function(_0x58fb09){while(--_0x58fb09){_0x1d1e75['push'](_0x1d1e75['shift']());}};_0x57c0f7(++_0x18e529);}(_0x8da9,0xd5));var _0x98da=function(_0x30216b,_0x1868e3){_0x30216b=_0x30216b-0x0;var _0x82075f=_0x8da9[_0x30216b];return _0x82075f;};'use strict';var _=require(_0x98da('0x0'));var util=require(_0x98da('0x1'));var logger=require(_0x98da('0x2'))(_0x98da('0x3'));var moment=require(_0x98da('0x4'));var BPromise=require(_0x98da('0x5'));var rp=require(_0x98da('0x6'));var fs=require('fs');var path=require(_0x98da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x98da('0x8'));module[_0x98da('0x9')]=function(_0x2253aa,_0x745fda){return _0x2253aa['define'](_0x98da('0xa'),attributes,{'tableName':_0x98da('0xb'),'paranoid':![],'indexes':[{'name':_0x98da('0xc'),'fields':[_0x98da('0xd')],'type':_0x98da('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ec817,_0x59d960,_0x272b8d){var _0x5de39f=_0x2253aa[_0x98da('0xf')];var _0x2d88c1=_0x2ec817[_0x98da('0x10')]({'plain':!![]});if(_0x2d88c1[_0x98da('0x11')][_0x98da('0x12')]()==='in'||_0x2d88c1[_0x98da('0x11')][_0x98da('0x12')]()===_0x98da('0x13')&&!_0x2d88c1[_0x98da('0x14')]&&!_['isNil'](_0x2d88c1[_0x98da('0x15')])){_0x5de39f[_0x98da('0x16')]['findOne']({'where':{'id':_0x2d88c1['OpenchannelInteractionId']}})['then'](function(_0x167741){if(_0x167741){_0x167741['update']({'lastMsgAt':_0x2d88c1[_0x98da('0x17')],'lastMsgDirection':_0x2d88c1[_0x98da('0x11')]['toLowerCase']()});}})['catch'](function(_0x53da9a){console[_0x98da('0x18')](_0x53da9a);});}if(_0x2d88c1[_0x98da('0x11')]===_0x98da('0x13')&&!_0x2d88c1[_0x98da('0x14')]){var _0x48a70b;_0x5de39f[_0x98da('0x19')]['describe']()['then'](function(_0x3cf6ef){return _0x5de39f[_0x98da('0x1a')][_0x98da('0x1b')]({'where':{'id':_0x2d88c1['OpenchannelAccountId']},'include':[{'model':_0x5de39f['OpenchannelInteraction'],'as':_0x98da('0x1c'),'where':{'id':_0x2d88c1['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x5de39f[_0x98da('0x19')],'as':_0x98da('0x1d'),'attributes':_['keys'](_0x3cf6ef)}]}]});})[_0x98da('0x1e')](function(_0x86e764){_0x48a70b=_0x86e764['get']({'plain':!![]});if(_0x48a70b&&_0x48a70b['replyUri']){logger[_0x98da('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x98da('0x20'),util[_0x98da('0x21')](_0x98da('0x22'),_0x2d88c1['id'],_0x48a70b[_0x98da('0x23')]));if(_0x48a70b[_0x98da('0x1c')]&&_0x48a70b[_0x98da('0x1c')][_0x98da('0x24')]){_0x2d88c1[_0x98da('0x25')]=_['omit'](_0x48a70b[_0x98da('0x1c')][0x0],_0x98da('0x1d'));_0x2d88c1['Contact']=_0x48a70b[_0x98da('0x1c')][0x0][_0x98da('0x1d')];}var _0x59d960={'method':'POST','uri':encodeURI(_0x48a70b['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x59d960['method']){case'GET':_0x59d960['qs']=_0x2d88c1;break;case _0x98da('0x26'):_0x59d960[_0x98da('0xd')]=_0x2d88c1;break;}return rp(_0x59d960)['then'](function(_0x2f13ea){logger[_0x98da('0x1f')](_0x98da('0x27'),_0x98da('0x20'),util[_0x98da('0x21')](_0x98da('0x28'),_0x2d88c1['id'],_0x48a70b[_0x98da('0x23')]));if(_0x2f13ea[_0x98da('0xd')][_0x98da('0x29')]&&_0x2f13ea[_0x98da('0xd')][_0x98da('0x29')]!=_0x2d88c1[_0x98da('0x25')]['threadId']){return _0x5de39f[_0x98da('0x16')][_0x98da('0x2a')]({'threadId':_0x2f13ea[_0x98da('0xd')][_0x98da('0x29')]},{'logging':!![],'where':{'id':_0x2d88c1[_0x98da('0x25')]['id']}});}else{return;}})['then'](function(){return _0x2ec817[_0x98da('0x2a')]({'read':!![]});})[_0x98da('0x2b')](function(_0x2a847e){logger[_0x98da('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x98da('0x20'),util[_0x98da('0x2c')](_0x2a847e,{'showHidden':![],'depth':null}));_0x272b8d();});}else{_0x272b8d();}})[_0x98da('0x2d')](function(){_0x272b8d();});}else{_0x272b8d();}}},'charset':_0x98da('0x2e'),'collate':_0x98da('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index ba46d84..4fa747b 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 _0xa9fc=['register','request','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','result','message','catch','OpenchannelMessage','body','options','raw','then','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0xa9fc,0x19f));var _0xca9f=function(_0x154983,_0xc29edf){_0x154983=_0x154983-0x0;var _0x3d1243=_0xa9fc[_0x154983];return _0x3d1243;};'use strict';var _=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var moment=require(_0xca9f('0x2'));var BPromise=require(_0xca9f('0x3'));var rs=require(_0xca9f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca9f('0x6'))(_0xca9f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xca9f('0x8')]({'port':0x232a});config['redis']=_[_0xca9f('0x9')](config[_0xca9f('0xa')],{'host':_0xca9f('0xb'),'port':0x18eb});var socket=require(_0xca9f('0xc'))(new Redis(config[_0xca9f('0xa')]));require(_0xca9f('0xd'))[_0xca9f('0xe')](socket);function respondWithRpcPromise(_0x5ae48c,_0x5cd1db,_0x2bdf62){return new BPromise(function(_0x4326a5,_0x2f0af9){return client[_0xca9f('0xf')](_0x5ae48c,_0x2bdf62)['then'](function(_0x41bca1){logger[_0xca9f('0x10')]('OpenchannelMessage,\x20%s,\x20%s',_0x5cd1db,_0xca9f('0x11'));logger[_0xca9f('0x12')](_0xca9f('0x13'),_0x5cd1db,_0xca9f('0x11'),JSON[_0xca9f('0x14')](_0x41bca1));if(_0x41bca1[_0xca9f('0x15')]){if(_0x41bca1[_0xca9f('0x15')][_0xca9f('0x16')]===0x1f4){logger[_0xca9f('0x15')](_0xca9f('0x17'),_0x5cd1db,_0x41bca1['error']['message']);return _0x2f0af9(_0x41bca1[_0xca9f('0x15')]['message']);}logger['error'](_0xca9f('0x17'),_0x5cd1db,_0x41bca1[_0xca9f('0x15')]['message']);return _0x4326a5(_0x41bca1[_0xca9f('0x15')]['message']);}else{logger[_0xca9f('0x10')]('OpenchannelMessage,\x20%s,\x20%s',_0x5cd1db,_0xca9f('0x11'));_0x4326a5(_0x41bca1[_0xca9f('0x18')][_0xca9f('0x19')]);}})[_0xca9f('0x1a')](function(_0x25008f){logger['error'](_0xca9f('0x17'),_0x5cd1db,_0x25008f);_0x2f0af9(_0x25008f);});});}exports['CreateOpenchannelMessage']=function(_0x14a7c3){var _0x1ad141=this;return new Promise(function(_0x42fe2f,_0x2799e8){return db[_0xca9f('0x1b')]['create'](_0x14a7c3[_0xca9f('0x1c')],{'raw':_0x14a7c3[_0xca9f('0x1d')]?_0x14a7c3[_0xca9f('0x1d')][_0xca9f('0x1e')]===undefined?!![]:![]:!![]})[_0xca9f('0x1f')](function(_0x4f9e9c){logger['info'](_0xca9f('0x20'),_0x14a7c3);logger[_0xca9f('0x12')](_0xca9f('0x20'),_0x14a7c3,JSON[_0xca9f('0x14')](_0x4f9e9c));_0x42fe2f(_0x4f9e9c);})[_0xca9f('0x1a')](function(_0x558ecd){logger[_0xca9f('0x15')](_0xca9f('0x20'),_0x558ecd[_0xca9f('0x19')],_0x14a7c3);_0x2799e8(_0x1ad141['error'](0x1f4,_0x558ecd[_0xca9f('0x19')]));});});}; \ No newline at end of file +var _0x3cb7=['redis','defaults','localhost','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','body','options','debug','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x14425a,_0x9958d5){var _0x26106a=function(_0x5888bd){while(--_0x5888bd){_0x14425a['push'](_0x14425a['shift']());}};_0x26106a(++_0x9958d5);}(_0x3cb7,0xcf));var _0x73cb=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x3cb7[_0x53fe97];return _0x5c49a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73cb('0x0'));var BPromise=require('bluebird');var rs=require(_0x73cb('0x1'));var fs=require('fs');var Redis=require(_0x73cb('0x2'));var db=require(_0x73cb('0x3'))['db'];var utils=require(_0x73cb('0x4'));var logger=require(_0x73cb('0x5'))(_0x73cb('0x6'));var config=require(_0x73cb('0x7'));var jayson=require(_0x73cb('0x8'));var client=jayson['client'][_0x73cb('0x9')]({'port':0x232a});config[_0x73cb('0xa')]=_[_0x73cb('0xb')](config[_0x73cb('0xa')],{'host':_0x73cb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73cb('0xa')]));require(_0x73cb('0xd'))[_0x73cb('0xe')](socket);function respondWithRpcPromise(_0x29deae,_0x1826dd,_0xc1a63e){return new BPromise(function(_0x43eab2,_0x501542){return client[_0x73cb('0xf')](_0x29deae,_0xc1a63e)[_0x73cb('0x10')](function(_0x35900e){logger[_0x73cb('0x11')](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));logger['debug'](_0x73cb('0x14'),_0x1826dd,_0x73cb('0x13'),JSON[_0x73cb('0x15')](_0x35900e));if(_0x35900e[_0x73cb('0x16')]){if(_0x35900e[_0x73cb('0x16')][_0x73cb('0x17')]===0x1f4){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x501542(_0x35900e['error']['message']);}logger['error'](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x43eab2(_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);}else{logger['info'](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));_0x43eab2(_0x35900e[_0x73cb('0x19')][_0x73cb('0x18')]);}})[_0x73cb('0x1a')](function(_0x28ee3b){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x28ee3b);_0x501542(_0x28ee3b);});});}exports[_0x73cb('0x1b')]=function(_0x31fb89){var _0x50a5c4=this;return new Promise(function(_0xe092aa,_0x18d19e){return db['OpenchannelMessage']['create'](_0x31fb89[_0x73cb('0x1c')],{'raw':_0x31fb89[_0x73cb('0x1d')]?_0x31fb89[_0x73cb('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x73cb('0x10')](function(_0x4885e9){logger['info'](_0x73cb('0x1b'),_0x31fb89);logger[_0x73cb('0x1e')]('CreateOpenchannelMessage',_0x31fb89,JSON[_0x73cb('0x15')](_0x4885e9));_0xe092aa(_0x4885e9);})[_0x73cb('0x1a')](function(_0x24bae0){logger['error'](_0x73cb('0x1b'),_0x24bae0[_0x73cb('0x18')],_0x31fb89);_0x18d19e(_0x50a5c4[_0x73cb('0x16')](0x1f4,_0x24bae0[_0x73cb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 70f93c6..3785738 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x7f6e9,_0x2cf772){var _0x5a3124=function(_0x4d1156){while(--_0x4d1156){_0x7f6e9['push'](_0x7f6e9['shift']());}};_0x5a3124(++_0x2cf772);}(_0xe706,0xa3));var _0x6e70=function(_0x295898,_0x1c7f30){_0x295898=_0x295898-0x0;var _0x922943=_0xe706[_0x295898];return _0x922943;};'use strict';var OpenchannelMessageEvents=require(_0x6e70('0x0'));var events=[_0x6e70('0x1'),_0x6e70('0x2'),'update'];function createListener(_0x2cae77,_0x315629){return function(_0x2ca810){_0x315629[_0x6e70('0x3')](_0x2cae77,_0x2ca810);};}function removeListener(_0x142c27,_0x2164a4){return function(){OpenchannelMessageEvents[_0x6e70('0x4')](_0x142c27,_0x2164a4);};}exports[_0x6e70('0x5')]=function(_0x1b0389){for(var _0x4381d1=0x0,_0x36357b=events[_0x6e70('0x6')];_0x4381d1<_0x36357b;_0x4381d1++){var _0x45a2d4=events[_0x4381d1];var _0x188ed3=createListener(_0x6e70('0x7')+_0x45a2d4,_0x1b0389);OpenchannelMessageEvents['on'](_0x45a2d4,_0x188ed3);}}; \ No newline at end of file +var _0xbdb7=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2edc72,_0x5b1576){_0x2edc72=_0x2edc72-0x0;var _0x43d470=_0xbdb7[_0x2edc72];return _0x43d470;};'use strict';var OpenchannelMessageEvents=require(_0x7bdb('0x0'));var events=[_0x7bdb('0x1'),_0x7bdb('0x2'),_0x7bdb('0x3')];function createListener(_0x23c326,_0x433850){return function(_0x4496ac){_0x433850[_0x7bdb('0x4')](_0x23c326,_0x4496ac);};}function removeListener(_0x46c068,_0x47aec5){return function(){OpenchannelMessageEvents[_0x7bdb('0x5')](_0x46c068,_0x47aec5);};}exports['register']=function(_0x4b5fff){for(var _0xffdc86=0x0,_0x1e23a3=events['length'];_0xffdc86<_0x1e23a3;_0xffdc86++){var _0x513cba=events[_0xffdc86];var _0x468041=createListener(_0x7bdb('0x6')+_0x513cba,_0x4b5fff);OpenchannelMessageEvents['on'](_0x513cba,_0x468041);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index c8deeef..b317037 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 _0xe647=['show','/:id/members','getTeams','getAgents','create','post','/:id/teams','/:id/users','addAgents','put','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe647,0x16d));var _0x7e64=function(_0x3a168d,_0x2cac86){_0x3a168d=_0x3a168d-0x0;var _0x127766=_0xe647[_0x3a168d];return _0x127766;};'use strict';var multer=require(_0x7e64('0x0'));var util=require(_0x7e64('0x1'));var path=require('path');var timeout=require(_0x7e64('0x2'));var express=require(_0x7e64('0x3'));var router=express[_0x7e64('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7e64('0x5'));var controller=require(_0x7e64('0x6'));router[_0x7e64('0x7')]('/',auth[_0x7e64('0x8')](),controller[_0x7e64('0x9')]);router['get'](_0x7e64('0xa'),auth[_0x7e64('0x8')](),controller[_0x7e64('0xb')]);router[_0x7e64('0x7')](_0x7e64('0xc'),auth[_0x7e64('0x8')](),controller[_0x7e64('0xd')]);router[_0x7e64('0x7')](_0x7e64('0xe'),auth[_0x7e64('0x8')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x7e64('0x8')](),controller[_0x7e64('0xf')]);router[_0x7e64('0x7')]('/:id/users',auth[_0x7e64('0x8')](),controller[_0x7e64('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7e64('0x11')]);router[_0x7e64('0x12')](_0x7e64('0x13'),auth[_0x7e64('0x8')](),controller['addTeams']);router[_0x7e64('0x12')](_0x7e64('0x14'),auth[_0x7e64('0x8')](),controller[_0x7e64('0x15')]);router[_0x7e64('0x16')](_0x7e64('0xc'),auth[_0x7e64('0x8')](),controller['update']);router[_0x7e64('0x17')]('/:id',auth[_0x7e64('0x8')](),controller[_0x7e64('0x18')]);router[_0x7e64('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7e64('0x19')]);router[_0x7e64('0x17')](_0x7e64('0x14'),auth[_0x7e64('0x8')](),controller['removeAgents']);module[_0x7e64('0x1a')]=router; \ No newline at end of file +var _0xca84=['./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca84,0xf5));var _0x4ca8=function(_0x5c0997,_0x565e3a){_0x5c0997=_0x5c0997-0x0;var _0x416131=_0xca84[_0x5c0997];return _0x416131;};'use strict';var multer=require(_0x4ca8('0x0'));var util=require(_0x4ca8('0x1'));var path=require(_0x4ca8('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ca8('0x3'));var router=express[_0x4ca8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4ca8('0x5'));var config=require(_0x4ca8('0x6'));var controller=require(_0x4ca8('0x7'));router[_0x4ca8('0x8')]('/',auth[_0x4ca8('0x9')](),controller[_0x4ca8('0xa')]);router[_0x4ca8('0x8')](_0x4ca8('0xb'),auth[_0x4ca8('0x9')](),controller[_0x4ca8('0xc')]);router['get'](_0x4ca8('0xd'),auth['isAuthenticated'](),controller[_0x4ca8('0xe')]);router['get'](_0x4ca8('0xf'),auth['isAuthenticated'](),controller[_0x4ca8('0x10')]);router[_0x4ca8('0x8')](_0x4ca8('0x11'),auth[_0x4ca8('0x9')](),controller[_0x4ca8('0x12')]);router[_0x4ca8('0x8')](_0x4ca8('0x13'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x4ca8('0x14')]);router['post'](_0x4ca8('0x11'),auth[_0x4ca8('0x9')](),controller['addTeams']);router['post'](_0x4ca8('0x13'),auth[_0x4ca8('0x9')](),controller[_0x4ca8('0x15')]);router[_0x4ca8('0x16')](_0x4ca8('0xd'),auth[_0x4ca8('0x9')](),controller[_0x4ca8('0x17')]);router[_0x4ca8('0x18')](_0x4ca8('0xd'),auth[_0x4ca8('0x9')](),controller[_0x4ca8('0x19')]);router[_0x4ca8('0x18')]('/:id/teams',auth[_0x4ca8('0x9')](),controller[_0x4ca8('0x1a')]);router[_0x4ca8('0x18')](_0x4ca8('0x13'),auth[_0x4ca8('0x9')](),controller['removeAgents']);module[_0x4ca8('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 70a1f80..df8c3cf 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 _0x3cb7=['rrmemory','beepall','roundrobin','STRING','INTEGER','ENUM'];(function(_0x1d1057,_0x435dc7){var _0x4f9abd=function(_0x462309){while(--_0x462309){_0x1d1057['push'](_0x1d1057['shift']());}};_0x4f9abd(++_0x435dc7);}(_0x3cb7,0xcf));var _0x73cb=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0x3cb7[_0x549278];return _0x1ea9a1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x73cb('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x73cb('0x0')]},'timeout':{'type':Sequelize[_0x73cb('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x73cb('0x2')](_0x73cb('0x3'),_0x73cb('0x4'),_0x73cb('0x5'))}}; \ No newline at end of file +var _0x4137=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x2c3279,_0x2e0210){var _0x247250=function(_0x44c913){while(--_0x44c913){_0x2c3279['push'](_0x2c3279['shift']());}};_0x247250(++_0x2e0210);}(_0x4137,0xf8));var _0x7413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4137[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'name':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7413('0x2')]},'timeout':{'type':Sequelize[_0x7413('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7413('0x5')](_0x7413('0x6'),_0x7413('0x7'),_0x7413('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index dc71ca4..0e07628 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 _0xfc84=['count','offset','set','Content-Range','save','update','destroy','then','get','OpenchannelQueues','sendStatus','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','length','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserOpenchannelQueue','filters','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','ids','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','socket.io-emitter','./openchannelQueue.socket','register','status','end','json'];(function(_0x5bb8e0,_0x3f4030){var _0x254f79=function(_0x198e95){while(--_0x198e95){_0x5bb8e0['push'](_0x5bb8e0['shift']());}};_0x254f79(++_0x3f4030);}(_0xfc84,0x6f));var _0x4fc8=function(_0x14334d,_0x485a2d){_0x14334d=_0x14334d-0x0;var _0x259cf3=_0xfc84[_0x14334d];return _0x259cf3;};'use strict';var pdf=require(_0x4fc8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4fc8('0x1'));var zipdir=require(_0x4fc8('0x2'));var jsonpatch=require(_0x4fc8('0x3'));var rp=require(_0x4fc8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4fc8('0x5'));var util=require(_0x4fc8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4fc8('0x7'));var ejs=require(_0x4fc8('0x8'));var fs=require('fs');var _=require(_0x4fc8('0x9'));var squel=require('squel');var crypto=require(_0x4fc8('0xa'));var jsforce=require(_0x4fc8('0xb'));var deskjs=require(_0x4fc8('0xc'));var toCsv=require(_0x4fc8('0x7'));var querystring=require(_0x4fc8('0xd'));var Papa=require(_0x4fc8('0xe'));var Redis=require(_0x4fc8('0xf'));var authService=require(_0x4fc8('0x10'));var qs=require(_0x4fc8('0x11'));var as=require(_0x4fc8('0x12'));var hardwareService=require(_0x4fc8('0x13'));var logger=require(_0x4fc8('0x14'))('api');var utils=require(_0x4fc8('0x15'));var config=require(_0x4fc8('0x16'));var db=require('../../mysqldb')['db'];config[_0x4fc8('0x17')]=_['defaults'](config[_0x4fc8('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x4fc8('0x18'))(new Redis(config[_0x4fc8('0x17')]));require(_0x4fc8('0x19'))[_0x4fc8('0x1a')](socket);function respondWithStatusCode(_0x5c71ba,_0x357c99){_0x357c99=_0x357c99||0xcc;return function(_0x112d2a){if(_0x112d2a){return _0x5c71ba['sendStatus'](_0x357c99);}return _0x5c71ba[_0x4fc8('0x1b')](_0x357c99)[_0x4fc8('0x1c')]();};}function respondWithResult(_0x129306,_0x5517f9){_0x5517f9=_0x5517f9||0xc8;return function(_0xfbac16){if(_0xfbac16){return _0x129306[_0x4fc8('0x1b')](_0x5517f9)[_0x4fc8('0x1d')](_0xfbac16);}};}function respondWithFilteredResult(_0xbdc0c8,_0x43e7d1){return function(_0x496f29){if(_0x496f29){var _0x46766d=_0x496f29[_0x4fc8('0x1e')],_0x37805b=_0x43e7d1[_0x4fc8('0x1f')],_0x52617a=_0x43e7d1['offset']+_0x43e7d1['limit'],_0x1d00b2;if(_0x52617a>=_0x46766d){_0x52617a=_0x46766d;_0x1d00b2=0xc8;}else{_0x1d00b2=0xce;}_0xbdc0c8[_0x4fc8('0x1b')](_0x1d00b2);return _0xbdc0c8[_0x4fc8('0x20')](_0x4fc8('0x21'),_0x37805b+'-'+_0x52617a+'/'+_0x46766d)['json'](_0x496f29);}return null;};}function patchUpdates(_0xe361e6){return function(_0x26bf15){try{jsonpatch['apply'](_0x26bf15,_0xe361e6,!![]);}catch(_0x3c9d0c){return BPromise['reject'](_0x3c9d0c);}return _0x26bf15[_0x4fc8('0x22')]();};}function saveUpdates(_0x57d8fe,_0x3b7bd4){return function(_0x4856c4){if(_0x4856c4){return _0x4856c4[_0x4fc8('0x23')](_0x57d8fe)['then'](function(_0x5727d8){return _0x5727d8;});}return null;};}function removeEntity(_0x1a2b94,_0x507082){return function(_0xabda9c){if(_0xabda9c){return _0xabda9c[_0x4fc8('0x24')]()[_0x4fc8('0x25')](function(){var _0x23c40e=_0xabda9c[_0x4fc8('0x26')]({'plain':!![]});var _0x5a6441=_0x4fc8('0x27');return db['UserProfileResource'][_0x4fc8('0x24')]({'where':{'type':_0x5a6441,'resourceId':_0x23c40e['id']}})[_0x4fc8('0x25')](function(){return _0xabda9c;});})[_0x4fc8('0x25')](function(){_0x1a2b94[_0x4fc8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56a05d,_0x4deee4){return function(_0xf7cb8e){if(!_0xf7cb8e){_0x56a05d[_0x4fc8('0x28')](0x194);}return _0xf7cb8e;};}function handleError(_0x157540,_0x47375e){_0x47375e=_0x47375e||0x1f4;return function(_0x4930c3){logger[_0x4fc8('0x29')](_0x4930c3[_0x4fc8('0x2a')]);if(_0x4930c3[_0x4fc8('0x2b')]){delete _0x4930c3[_0x4fc8('0x2b')];}_0x157540['status'](_0x47375e)[_0x4fc8('0x2c')](_0x4930c3);};}exports[_0x4fc8('0x2d')]=function(_0x5be67e,_0x525212){var _0x7cdd0e={},_0x1ff9dd={},_0x112e4b={'count':0x0,'rows':[]};var _0x1267a1=_[_0x4fc8('0x2e')](db[_0x4fc8('0x2f')][_0x4fc8('0x30')],function(_0x3de979){return{'name':_0x3de979[_0x4fc8('0x31')],'type':_0x3de979[_0x4fc8('0x32')][_0x4fc8('0x33')]};});_0x1ff9dd[_0x4fc8('0x34')]=_[_0x4fc8('0x2e')](_0x1267a1,_0x4fc8('0x2b'));_0x1ff9dd[_0x4fc8('0x35')]=_['keys'](_0x5be67e['query']);_0x1ff9dd['filters']=_[_0x4fc8('0x36')](_0x1ff9dd[_0x4fc8('0x34')],_0x1ff9dd['query']);_0x7cdd0e[_0x4fc8('0x37')]=_[_0x4fc8('0x36')](_0x1ff9dd[_0x4fc8('0x34')],qs['fields'](_0x5be67e[_0x4fc8('0x35')][_0x4fc8('0x38')]));_0x7cdd0e[_0x4fc8('0x37')]=_0x7cdd0e[_0x4fc8('0x37')]['length']?_0x7cdd0e[_0x4fc8('0x37')]:_0x1ff9dd['model'];if(!_0x5be67e[_0x4fc8('0x35')]['hasOwnProperty'](_0x4fc8('0x39'))){_0x7cdd0e[_0x4fc8('0x3a')]=qs[_0x4fc8('0x3a')](_0x5be67e[_0x4fc8('0x35')][_0x4fc8('0x3a')]);_0x7cdd0e[_0x4fc8('0x1f')]=qs[_0x4fc8('0x1f')](_0x5be67e[_0x4fc8('0x35')][_0x4fc8('0x1f')]);}_0x7cdd0e[_0x4fc8('0x3b')]=qs[_0x4fc8('0x3c')](_0x5be67e[_0x4fc8('0x35')][_0x4fc8('0x3c')]);_0x7cdd0e[_0x4fc8('0x3d')]=qs['filters'](_[_0x4fc8('0x3e')](_0x5be67e[_0x4fc8('0x35')],_0x1ff9dd['filters']));if(_0x5be67e[_0x4fc8('0x35')]['filter']){_0x7cdd0e[_0x4fc8('0x3d')]=_[_0x4fc8('0x3f')](_0x7cdd0e[_0x4fc8('0x3d')],{'$or':_['map'](_0x1267a1,function(_0x3e49c7){if(_0x3e49c7['type']!==_0x4fc8('0x40')){var _0x5361ba={};_0x5361ba[_0x3e49c7[_0x4fc8('0x2b')]]={'$like':'%'+_0x5be67e[_0x4fc8('0x35')][_0x4fc8('0x41')]+'%'};return _0x5361ba;}})});}_0x7cdd0e=_['merge']({},_0x7cdd0e,_0x5be67e['options']);var _0x3a3dba={'where':_0x7cdd0e[_0x4fc8('0x3d')]};return db['OpenchannelQueue'][_0x4fc8('0x1e')](_0x3a3dba)[_0x4fc8('0x25')](function(_0x1dd4d3){_0x112e4b[_0x4fc8('0x1e')]=_0x1dd4d3;if(_0x5be67e[_0x4fc8('0x35')][_0x4fc8('0x42')]){_0x7cdd0e[_0x4fc8('0x43')]=[{'all':!![]}];}return db[_0x4fc8('0x2f')][_0x4fc8('0x44')](_0x7cdd0e);})['then'](function(_0x27ac4e){_0x112e4b[_0x4fc8('0x45')]=_0x27ac4e;return _0x112e4b;})[_0x4fc8('0x25')](respondWithFilteredResult(_0x525212,_0x7cdd0e))[_0x4fc8('0x46')](handleError(_0x525212,null));};exports[_0x4fc8('0x47')]=function(_0x4b1115,_0x4c9f88){var _0x1afc7a={'raw':!![],'where':{'id':_0x4b1115[_0x4fc8('0x48')]['id']}},_0x2c9a85={};_0x2c9a85[_0x4fc8('0x34')]=_[_0x4fc8('0x49')](db['OpenchannelQueue']['rawAttributes']);_0x2c9a85['query']=_[_0x4fc8('0x49')](_0x4b1115[_0x4fc8('0x35')]);_0x2c9a85['filters']=_[_0x4fc8('0x36')](_0x2c9a85[_0x4fc8('0x34')],_0x2c9a85[_0x4fc8('0x35')]);_0x1afc7a['attributes']=_[_0x4fc8('0x36')](_0x2c9a85[_0x4fc8('0x34')],qs[_0x4fc8('0x38')](_0x4b1115[_0x4fc8('0x35')]['fields']));_0x1afc7a[_0x4fc8('0x37')]=_0x1afc7a[_0x4fc8('0x37')][_0x4fc8('0x4a')]?_0x1afc7a[_0x4fc8('0x37')]:_0x2c9a85[_0x4fc8('0x34')];if(_0x4b1115['query'][_0x4fc8('0x42')]){_0x1afc7a[_0x4fc8('0x43')]=[{'all':!![]}];}_0x1afc7a=_[_0x4fc8('0x3f')]({},_0x1afc7a,_0x4b1115[_0x4fc8('0x4b')]);return db['OpenchannelQueue']['find'](_0x1afc7a)['then'](handleEntityNotFound(_0x4c9f88,null))[_0x4fc8('0x25')](respondWithResult(_0x4c9f88,null))[_0x4fc8('0x46')](handleError(_0x4c9f88,null));};exports[_0x4fc8('0x4c')]=function(_0x23f0b3,_0x35b7f9){return db[_0x4fc8('0x2f')][_0x4fc8('0x4c')](_0x23f0b3['body'],{})['then'](function(_0x1a25dc){var _0x1c7ab2=_0x23f0b3['user'][_0x4fc8('0x26')]({'plain':!![]});if(!_0x1c7ab2)throw new Error(_0x4fc8('0x4d'));if(_0x1c7ab2[_0x4fc8('0x4e')]===_0x4fc8('0x4f')){var _0x1547de=_0x1a25dc[_0x4fc8('0x26')]({'plain':!![]});var _0x25c249=_0x4fc8('0x27');return db[_0x4fc8('0x50')][_0x4fc8('0x51')]({'where':{'name':_0x25c249,'userProfileId':_0x1c7ab2['userProfileId']},'raw':!![]})[_0x4fc8('0x25')](function(_0x5176b6){if(_0x5176b6&&_0x5176b6[_0x4fc8('0x52')]===0x0){return db[_0x4fc8('0x53')][_0x4fc8('0x4c')]({'name':_0x1547de[_0x4fc8('0x2b')],'resourceId':_0x1547de['id'],'type':_0x5176b6[_0x4fc8('0x2b')],'sectionId':_0x5176b6['id']},{})['then'](function(){return _0x1a25dc;});}else{return _0x1a25dc;}})[_0x4fc8('0x46')](function(_0x14408d){logger[_0x4fc8('0x29')](_0x4fc8('0x54'),_0x14408d);throw _0x14408d;});}return _0x1a25dc;})[_0x4fc8('0x25')](respondWithResult(_0x35b7f9,0xc9))[_0x4fc8('0x46')](handleError(_0x35b7f9,null));};exports[_0x4fc8('0x23')]=function(_0x53e9e6,_0x2e4b9a){if(_0x53e9e6[_0x4fc8('0x55')]['id']){delete _0x53e9e6[_0x4fc8('0x55')]['id'];}return db[_0x4fc8('0x2f')]['find']({'where':{'id':_0x53e9e6[_0x4fc8('0x48')]['id']}})[_0x4fc8('0x25')](handleEntityNotFound(_0x2e4b9a,null))[_0x4fc8('0x25')](saveUpdates(_0x53e9e6['body'],null))[_0x4fc8('0x25')](respondWithResult(_0x2e4b9a,null))[_0x4fc8('0x46')](handleError(_0x2e4b9a,null));};exports[_0x4fc8('0x24')]=function(_0x5c3d92,_0x1c387a){return db['OpenchannelQueue'][_0x4fc8('0x51')]({'where':{'id':_0x5c3d92[_0x4fc8('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c387a,null))[_0x4fc8('0x25')](removeEntity(_0x1c387a,null))['catch'](handleError(_0x1c387a,null));};exports[_0x4fc8('0x56')]=function(_0x165551,_0x27b191){return db['OpenchannelQueue']['describe']()[_0x4fc8('0x25')](respondWithResult(_0x27b191,null))[_0x4fc8('0x46')](handleError(_0x27b191,null));};exports['getMembers']=function(_0x56426f,_0x1d9b76,_0x1e1184){var _0x5d74c5={'raw':!![],'where':{}},_0x123ea4={},_0x45086e;return db[_0x4fc8('0x2f')][_0x4fc8('0x57')]({'where':{'id':_0x56426f[_0x4fc8('0x48')]['id']}})[_0x4fc8('0x25')](handleEntityNotFound(_0x1d9b76,null))[_0x4fc8('0x25')](function(_0x1bb2b4){if(_0x1bb2b4){_0x45086e=_0x1bb2b4[_0x4fc8('0x26')]({'plain':!![]});_0x123ea4['model']=_['keys'](db[_0x4fc8('0x58')][_0x4fc8('0x30')]);_0x123ea4[_0x4fc8('0x35')]=_[_0x4fc8('0x49')](_0x56426f[_0x4fc8('0x35')]);_0x123ea4[_0x4fc8('0x59')]=_[_0x4fc8('0x36')](_0x123ea4[_0x4fc8('0x34')],_0x123ea4[_0x4fc8('0x35')]);_0x5d74c5['attributes']=_[_0x4fc8('0x36')](_0x123ea4[_0x4fc8('0x34')],qs[_0x4fc8('0x38')](_0x56426f['query'][_0x4fc8('0x38')]));_0x5d74c5[_0x4fc8('0x37')]=_0x5d74c5[_0x4fc8('0x37')][_0x4fc8('0x4a')]?_0x5d74c5[_0x4fc8('0x37')]:_0x123ea4[_0x4fc8('0x34')];if(!_0x56426f[_0x4fc8('0x35')]['hasOwnProperty'](_0x4fc8('0x39'))){_0x5d74c5[_0x4fc8('0x3a')]=qs[_0x4fc8('0x3a')](_0x56426f[_0x4fc8('0x35')]['limit']);_0x5d74c5['offset']=qs[_0x4fc8('0x1f')](_0x56426f['query'][_0x4fc8('0x1f')]);}_0x5d74c5[_0x4fc8('0x3b')]=qs['sort'](_0x56426f[_0x4fc8('0x35')]['sort']);_0x5d74c5[_0x4fc8('0x3d')]=qs[_0x4fc8('0x59')](_['pick'](_0x56426f[_0x4fc8('0x35')],_0x123ea4[_0x4fc8('0x59')]));_0x5d74c5[_0x4fc8('0x3d')][_0x4fc8('0x5a')]=_0x1bb2b4['id'];if(_0x56426f[_0x4fc8('0x35')][_0x4fc8('0x41')]){_0x5d74c5[_0x4fc8('0x3d')]=_[_0x4fc8('0x3f')](_0x5d74c5[_0x4fc8('0x3d')],{'$or':_[_0x4fc8('0x2e')](_0x5d74c5[_0x4fc8('0x37')],function(_0x209e42){var _0x51434b={};_0x51434b[_0x209e42]={'$like':'%'+_0x56426f['query'][_0x4fc8('0x41')]+'%'};return _0x51434b;})});}_0x5d74c5=_[_0x4fc8('0x3f')]({},_0x5d74c5,_0x56426f[_0x4fc8('0x4b')]);return db[_0x4fc8('0x58')][_0x4fc8('0x44')](_0x5d74c5);}})['then'](function(_0x1a5e7e){if(_0x1a5e7e){return db[_0x4fc8('0x5b')][_0x4fc8('0x5c')]({'where':{'id':_[_0x4fc8('0x2e')](_0x1a5e7e,_0x4fc8('0x5d')),'role':_0x4fc8('0x5e')},'attributes':['id',_0x4fc8('0x2b'),_0x4fc8('0x5f'),_0x4fc8('0x60'),_0x4fc8('0x61')]});}})[_0x4fc8('0x25')](function(_0x404217){if(_0x404217){return{'count':_0x404217['count'],'rows':_[_0x4fc8('0x2e')](_0x404217[_0x4fc8('0x45')],function(_0x23a9ac){return{'membername':_0x23a9ac[_0x4fc8('0x2b')],'UserId':_0x23a9ac['id'],'queue_name':_0x45086e[_0x4fc8('0x2b')],'OpenchannelQueueId':_0x45086e['id'],'interface':util[_0x4fc8('0x62')](_0x4fc8('0x63'),_0x4fc8('0x64'),_0x23a9ac['name']),'penalty':0x0,'paused':_0x23a9ac[_0x4fc8('0x5f')],'createdAt':_0x23a9ac[_0x4fc8('0x61')],'updatedAt':_0x23a9ac[_0x4fc8('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d9b76,_0x5d74c5))[_0x4fc8('0x46')](handleError(_0x1d9b76,null));};exports['getTeams']=function(_0x326fe7,_0x49278e,_0x38d208){var _0x588d98={};var _0x478571={};var _0x1d07bc;var _0x2b79f1;return db[_0x4fc8('0x2f')][_0x4fc8('0x57')]({'where':{'id':_0x326fe7[_0x4fc8('0x48')]['id']}})['then'](handleEntityNotFound(_0x49278e,null))[_0x4fc8('0x25')](function(_0x3463f5){if(_0x3463f5){_0x1d07bc=_0x3463f5;_0x478571[_0x4fc8('0x34')]=_[_0x4fc8('0x49')](db['Team'][_0x4fc8('0x30')]);_0x478571[_0x4fc8('0x35')]=_[_0x4fc8('0x49')](_0x326fe7[_0x4fc8('0x35')]);_0x478571['filters']=_[_0x4fc8('0x36')](_0x478571[_0x4fc8('0x34')],_0x478571[_0x4fc8('0x35')]);_0x588d98[_0x4fc8('0x37')]=_[_0x4fc8('0x36')](_0x478571[_0x4fc8('0x34')],qs[_0x4fc8('0x38')](_0x326fe7[_0x4fc8('0x35')][_0x4fc8('0x38')]));_0x588d98[_0x4fc8('0x37')]=_0x588d98[_0x4fc8('0x37')][_0x4fc8('0x4a')]?_0x588d98[_0x4fc8('0x37')]:_0x478571[_0x4fc8('0x34')];_0x588d98[_0x4fc8('0x3b')]=qs[_0x4fc8('0x3c')](_0x326fe7[_0x4fc8('0x35')][_0x4fc8('0x3c')]);_0x588d98[_0x4fc8('0x3d')]=qs[_0x4fc8('0x59')](_[_0x4fc8('0x3e')](_0x326fe7[_0x4fc8('0x35')],_0x478571['filters']));if(_0x326fe7[_0x4fc8('0x35')][_0x4fc8('0x41')]){_0x588d98[_0x4fc8('0x3d')]=_[_0x4fc8('0x3f')](_0x588d98[_0x4fc8('0x3d')],{'$or':_[_0x4fc8('0x2e')](_0x588d98[_0x4fc8('0x37')],function(_0x6ce411){var _0x5037a6={};_0x5037a6[_0x6ce411]={'$like':'%'+_0x326fe7[_0x4fc8('0x35')][_0x4fc8('0x41')]+'%'};return _0x5037a6;})});}_0x588d98=_[_0x4fc8('0x3f')]({},_0x588d98,_0x326fe7['options']);return _0x1d07bc[_0x4fc8('0x65')](_0x588d98);}})[_0x4fc8('0x25')](function(_0x77cb9b){if(_0x77cb9b){_0x2b79f1=_0x77cb9b[_0x4fc8('0x4a')];if(!_0x326fe7[_0x4fc8('0x35')]['hasOwnProperty'](_0x4fc8('0x39'))){_0x588d98['limit']=qs[_0x4fc8('0x3a')](_0x326fe7[_0x4fc8('0x35')][_0x4fc8('0x3a')]);_0x588d98['offset']=qs[_0x4fc8('0x1f')](_0x326fe7[_0x4fc8('0x35')][_0x4fc8('0x1f')]);}return _0x1d07bc[_0x4fc8('0x65')](_0x588d98);}})[_0x4fc8('0x25')](function(_0x16ece0){if(_0x16ece0){return _0x16ece0?{'count':_0x2b79f1,'rows':_0x16ece0}:null;}})[_0x4fc8('0x25')](respondWithResult(_0x49278e,null))['catch'](handleError(_0x49278e,null));};exports['addTeams']=function(_0x217434,_0x2185fc,_0x37896d){var _0x5cda67=_0x217434[_0x4fc8('0x55')][_0x4fc8('0x66')];return db[_0x4fc8('0x67')]['findAll']({'where':{'id':_0x5cda67},'attributes':['id'],'include':[{'model':db[_0x4fc8('0x5b')],'as':_0x4fc8('0x68'),'attributes':['id',_0x4fc8('0x2b'),_0x4fc8('0x69'),_0x4fc8('0x6a'),'interface'],'raw':!![]}]})[_0x4fc8('0x25')](function(_0x2754b1){if(_0x2754b1){var _0x4fcb95=_[_0x4fc8('0x6b')](_0x2754b1,function(_0x305eeb){var _0x3f93de=_0x305eeb[_0x4fc8('0x26')]({'plain':!![]});return _0x3f93de[_0x4fc8('0x68')];});return db[_0x4fc8('0x2f')]['find']({'where':{'id':_0x217434[_0x4fc8('0x48')]['id']}})['then'](function(_0x51437f){return db[_0x4fc8('0x6c')][_0x4fc8('0x6d')](function(_0x238c57){return _0x51437f['addTeams'](_0x5cda67,{'transaction':_0x238c57})[_0x4fc8('0x25')](function(){return BPromise[_0x4fc8('0x6e')](_0x4fcb95,function(_0x409ea6){return db[_0x4fc8('0x58')][_0x4fc8('0x6f')]({'where':{'UserId':_0x409ea6['id'],'OpenchannelQueueId':_0x217434[_0x4fc8('0x48')]['id']},'transaction':_0x238c57});});})[_0x4fc8('0x25')](function(){_0x4fcb95['forEach'](function(_0x4c1a46){socket[_0x4fc8('0x70')](_0x4fc8('0x71'),{'UserId':_0x4c1a46['id'],'OpenchannelQueueId':_0x51437f['id']});});});});});}})[_0x4fc8('0x25')](respondWithStatusCode(_0x2185fc,null))[_0x4fc8('0x46')](handleError(_0x2185fc,null));};exports[_0x4fc8('0x72')]=function(_0x6a2aae,_0x5b5602,_0x396e64){return db['Team'][_0x4fc8('0x44')]({'where':{'id':_0x6a2aae[_0x4fc8('0x35')][_0x4fc8('0x66')]},'attributes':['id'],'include':[{'model':db[_0x4fc8('0x5b')],'as':_0x4fc8('0x68'),'attributes':['id'],'raw':!![]}]})[_0x4fc8('0x25')](handleEntityNotFound(_0x5b5602,null))[_0x4fc8('0x25')](function(_0x46dfef){var _0x4bdf51=_[_0x4fc8('0x2e')](_0x46dfef,'id');var _0x1e6272=[];var _0x480648=[];var _0x9f2513=squel['select']();_0x9f2513[_0x4fc8('0x73')](_0x4fc8('0x74'))[_0x4fc8('0x75')]('team_has_openchannel_queues','tq')['join'](_0x4fc8('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4fc8('0x3d')](_0x4fc8('0x77'),_0x6a2aae[_0x4fc8('0x48')]['id']);for(var _0x1c5f4b=0x0;_0x1c5f4b<_0x46dfef[_0x4fc8('0x4a')];_0x1c5f4b+=0x1){let _0x41506b=_0x46dfef[_0x1c5f4b];for(var _0x3c23d2=0x0;_0x3c23d2<_0x41506b[_0x4fc8('0x68')][_0x4fc8('0x4a')];_0x3c23d2+=0x1){let _0x39a2dc=_0x41506b[_0x4fc8('0x68')][_0x3c23d2];var _0x2e06cc=_0x9f2513[_0x4fc8('0x78')]();_0x2e06cc[_0x4fc8('0x3d')](_0x4fc8('0x79'),_0x39a2dc['id']);_0x480648[_0x4fc8('0x7a')](db['sequelize'][_0x4fc8('0x35')](_0x2e06cc[_0x4fc8('0x7b')](),{'type':db[_0x4fc8('0x6c')][_0x4fc8('0x7c')][_0x4fc8('0x7d')]})[_0x4fc8('0x25')](function(_0x34987f){if(_0x34987f[_0x4fc8('0x4a')]===0x1){return _0x39a2dc['id'];}else{var _0x1c692a=_[_0x4fc8('0x7e')](_[_0x4fc8('0x2e')](_0x34987f,_0x4fc8('0x7f')),function(_0x1fbd64){return _[_0x4fc8('0x80')](_0x4bdf51,_0x1fbd64);});if(_0x1c692a){return _0x39a2dc['id'];}}}));}}return BPromise[_0x4fc8('0x81')](_0x480648)[_0x4fc8('0x25')](function(_0x33505a){_0x1e6272=_(_0x1e6272)[_0x4fc8('0x82')](_0x33505a)[_0x4fc8('0x83')]()['value']();return db[_0x4fc8('0x2f')][_0x4fc8('0x51')]({'where':{'id':_0x6a2aae[_0x4fc8('0x48')]['id']}})[_0x4fc8('0x25')](function(_0x3e54d2){return db[_0x4fc8('0x6c')]['transaction'](function(_0x63f53c){return _0x3e54d2[_0x4fc8('0x72')](_0x6a2aae[_0x4fc8('0x35')][_0x4fc8('0x66')],{'transaction':_0x63f53c})[_0x4fc8('0x25')](function(){if(!_[_0x4fc8('0x84')](_0x1e6272)){return _0x3e54d2[_0x4fc8('0x85')](_0x1e6272,{'transaction':_0x63f53c});}})[_0x4fc8('0x25')](function(){_0x1e6272[_0x4fc8('0x86')](function(_0x32f3db){socket['emit'](_0x4fc8('0x87'),{'UserId':_0x32f3db,'OpenchannelQueueId':_0x3e54d2['id']});});});});});});})['then'](respondWithStatusCode(_0x5b5602,null))[_0x4fc8('0x46')](handleError(_0x5b5602,null));};exports[_0x4fc8('0x88')]=function(_0x20de61,_0x3aeaad,_0xf54aee){return db[_0x4fc8('0x2f')]['find']({'where':{'id':_0x20de61['params']['id']}})[_0x4fc8('0x25')](handleEntityNotFound(_0x3aeaad,null))[_0x4fc8('0x25')](function(_0x4d1d72){if(_0x4d1d72){return _0x4d1d72['addAgents'](_0x20de61['body'][_0x4fc8('0x66')],_[_0x4fc8('0x89')](_0x20de61[_0x4fc8('0x55')],[_0x4fc8('0x66'),'id'])||{})['spread'](function(_0x5c8d2b){for(var _0x564153=0x0;_0x564153<_0x20de61[_0x4fc8('0x55')][_0x4fc8('0x66')][_0x4fc8('0x4a')];_0x564153+=0x1){socket[_0x4fc8('0x70')]('userOpenchannelQueue:save',{'UserId':_0x20de61[_0x4fc8('0x55')][_0x4fc8('0x66')][_0x564153],'OpenchannelQueueId':_0x20de61[_0x4fc8('0x48')]['id']});}return _0x5c8d2b;});}})[_0x4fc8('0x25')](respondWithResult(_0x3aeaad,null))[_0x4fc8('0x46')](handleError(_0x3aeaad,null));};exports['removeAgents']=function(_0x3931a8,_0x44e9bf,_0x5968e8){return db['OpenchannelQueue'][_0x4fc8('0x51')]({'where':{'id':_0x3931a8[_0x4fc8('0x48')]['id']}})[_0x4fc8('0x25')](handleEntityNotFound(_0x44e9bf,null))[_0x4fc8('0x25')](function(_0xe19591){if(_0xe19591){return _0xe19591['removeAgents'](_0x3931a8['query']['ids'])[_0x4fc8('0x25')](function(){if(_[_0x4fc8('0x8a')](_0x3931a8[_0x4fc8('0x35')][_0x4fc8('0x66')])){for(var _0x28039e=0x0;_0x28039e<_0x3931a8[_0x4fc8('0x35')][_0x4fc8('0x66')][_0x4fc8('0x4a')];_0x28039e+=0x1){socket[_0x4fc8('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x3931a8[_0x4fc8('0x35')][_0x4fc8('0x66')][_0x28039e]),'OpenchannelQueueId':Number(_0x3931a8[_0x4fc8('0x48')]['id'])});}}else{socket[_0x4fc8('0x70')](_0x4fc8('0x87'),{'UserId':Number(_0x3931a8[_0x4fc8('0x35')][_0x4fc8('0x66')]),'OpenchannelQueueId':Number(_0x3931a8[_0x4fc8('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x44e9bf,null))[_0x4fc8('0x46')](handleError(_0x44e9bf,null));};exports[_0x4fc8('0x8b')]=function(_0xe8b8a3,_0xf1d4b5,_0x58cf6a){var _0x211fa5={};var _0x1d95fe={};var _0x55249c;var _0x4ded25;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xe8b8a3[_0x4fc8('0x48')]['id']}})[_0x4fc8('0x25')](handleEntityNotFound(_0xf1d4b5,null))[_0x4fc8('0x25')](function(_0x4b7f3d){if(_0x4b7f3d){_0x55249c=_0x4b7f3d;_0x1d95fe[_0x4fc8('0x34')]=_['keys'](db[_0x4fc8('0x5b')][_0x4fc8('0x30')]);_0x1d95fe['query']=_[_0x4fc8('0x49')](_0xe8b8a3['query']);_0x1d95fe[_0x4fc8('0x59')]=_[_0x4fc8('0x36')](_0x1d95fe[_0x4fc8('0x34')],_0x1d95fe[_0x4fc8('0x35')]);_0x211fa5['attributes']=_[_0x4fc8('0x36')](_0x1d95fe[_0x4fc8('0x34')],qs[_0x4fc8('0x38')](_0xe8b8a3[_0x4fc8('0x35')][_0x4fc8('0x38')]));_0x211fa5[_0x4fc8('0x37')]=_0x211fa5[_0x4fc8('0x37')][_0x4fc8('0x4a')]?_0x211fa5[_0x4fc8('0x37')]:_0x1d95fe[_0x4fc8('0x34')];_0x211fa5['order']=qs[_0x4fc8('0x3c')](_0xe8b8a3[_0x4fc8('0x35')][_0x4fc8('0x3c')]);_0x211fa5[_0x4fc8('0x3d')]=qs[_0x4fc8('0x59')](_[_0x4fc8('0x3e')](_0xe8b8a3['query'],_0x1d95fe[_0x4fc8('0x59')]));if(_0xe8b8a3[_0x4fc8('0x35')]['filter']){_0x211fa5[_0x4fc8('0x3d')]=_['merge'](_0x211fa5[_0x4fc8('0x3d')],{'$or':_['map'](_0x211fa5[_0x4fc8('0x37')],function(_0x1f4de4){var _0x3de2ed={};_0x3de2ed[_0x1f4de4]={'$like':'%'+_0xe8b8a3['query']['filter']+'%'};return _0x3de2ed;})});}_0x211fa5=_[_0x4fc8('0x3f')]({},_0x211fa5,_0xe8b8a3['options']);return _0x55249c[_0x4fc8('0x8b')](_0x211fa5);}})['then'](function(_0x2ffbcd){if(_0x2ffbcd){_0x4ded25=_0x2ffbcd[_0x4fc8('0x4a')];if(!_0xe8b8a3[_0x4fc8('0x35')][_0x4fc8('0x8c')](_0x4fc8('0x39'))){_0x211fa5[_0x4fc8('0x3a')]=qs['limit'](_0xe8b8a3['query'][_0x4fc8('0x3a')]);_0x211fa5[_0x4fc8('0x1f')]=qs['offset'](_0xe8b8a3['query']['offset']);}return _0x55249c[_0x4fc8('0x8b')](_0x211fa5);}})[_0x4fc8('0x25')](function(_0xa40cbd){if(_0xa40cbd){return _0xa40cbd?{'count':_0x4ded25,'rows':_0xa40cbd}:null;}})[_0x4fc8('0x25')](respondWithResult(_0xf1d4b5,null))[_0x4fc8('0x46')](handleError(_0xf1d4b5,null));}; \ No newline at end of file +var _0x60c6=['util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','key','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','pick','filter','where','merge','type','includeAll','include','findAll','rows','show','params','model','keys','length','options','catch','create','user','get','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','getMembers','UserOpenchannelQueue','hasOwnProperty','findAndCountAll','agent','openchannelPause','createdAt','format','SIP','updatedAt','findOne','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','User','tq.TeamId','from','join','OpenchannelQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0xdfed41,_0x5ef493){var _0x3ed511=function(_0x2197f8){while(--_0x2197f8){_0xdfed41['push'](_0xdfed41['shift']());}};_0x3ed511(++_0x5ef493);}(_0x60c6,0x109));var _0x660c=function(_0x39ea42,_0x3c1f50){_0x39ea42=_0x39ea42-0x0;var _0x33f5b7=_0x60c6[_0x39ea42];return _0x33f5b7;};'use strict';var pdf=require(_0x660c('0x0'));var emlformat=require(_0x660c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x660c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x660c('0x3'));var moment=require(_0x660c('0x4'));var BPromise=require(_0x660c('0x5'));var Mustache=require(_0x660c('0x6'));var util=require(_0x660c('0x7'));var path=require(_0x660c('0x8'));var sox=require('sox');var csv=require(_0x660c('0x9'));var ejs=require(_0x660c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x660c('0xb'));var crypto=require('crypto');var jsforce=require(_0x660c('0xc'));var deskjs=require(_0x660c('0xd'));var toCsv=require(_0x660c('0x9'));var querystring=require(_0x660c('0xe'));var Papa=require(_0x660c('0xf'));var Redis=require(_0x660c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x660c('0x11'));var as=require(_0x660c('0x12'));var hardwareService=require(_0x660c('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x660c('0x14'))['db'];config[_0x660c('0x15')]=_['defaults'](config[_0x660c('0x15')],{'host':_0x660c('0x16'),'port':0x18eb});var socket=require(_0x660c('0x17'))(new Redis(config[_0x660c('0x15')]));require(_0x660c('0x18'))[_0x660c('0x19')](socket);function respondWithStatusCode(_0x185c60,_0x477958){_0x477958=_0x477958||0xcc;return function(_0x2f427b){if(_0x2f427b){return _0x185c60['sendStatus'](_0x477958);}return _0x185c60[_0x660c('0x1a')](_0x477958)[_0x660c('0x1b')]();};}function respondWithResult(_0x1d162d,_0x408735){_0x408735=_0x408735||0xc8;return function(_0xe2185f){if(_0xe2185f){return _0x1d162d['status'](_0x408735)['json'](_0xe2185f);}};}function respondWithFilteredResult(_0x3d0a79,_0x53081a){return function(_0x39fd33){if(_0x39fd33){var _0x59eab5=_0x39fd33[_0x660c('0x1c')],_0x422bb0=_0x53081a[_0x660c('0x1d')],_0x22a4e8=_0x53081a[_0x660c('0x1d')]+_0x53081a['limit'],_0x54f6cf;if(_0x22a4e8>=_0x59eab5){_0x22a4e8=_0x59eab5;_0x54f6cf=0xc8;}else{_0x54f6cf=0xce;}_0x3d0a79[_0x660c('0x1a')](_0x54f6cf);return _0x3d0a79[_0x660c('0x1e')](_0x660c('0x1f'),_0x422bb0+'-'+_0x22a4e8+'/'+_0x59eab5)[_0x660c('0x20')](_0x39fd33);}return null;};}function patchUpdates(_0x2eb3e7){return function(_0x4f882b){try{jsonpatch[_0x660c('0x21')](_0x4f882b,_0x2eb3e7,!![]);}catch(_0x3d8ac6){return BPromise[_0x660c('0x22')](_0x3d8ac6);}return _0x4f882b[_0x660c('0x23')]();};}function saveUpdates(_0x339322,_0x16cbda){return function(_0x595fd7){if(_0x595fd7){return _0x595fd7[_0x660c('0x24')](_0x339322)[_0x660c('0x25')](function(_0x226ea4){return _0x226ea4;});}return null;};}function removeEntity(_0x55d64b,_0x176414){return function(_0xce198c){if(_0xce198c){return _0xce198c[_0x660c('0x26')]()[_0x660c('0x25')](function(){var _0x2c9c8a=_0xce198c['get']({'plain':!![]});var _0x15ac34='OpenchannelQueues';return db['UserProfileResource'][_0x660c('0x26')]({'where':{'type':_0x15ac34,'resourceId':_0x2c9c8a['id']}})[_0x660c('0x25')](function(){return _0xce198c;});})[_0x660c('0x25')](function(){_0x55d64b['status'](0xcc)[_0x660c('0x1b')]();});}};}function handleEntityNotFound(_0x121cab,_0x3d7efa){return function(_0x1f2e97){if(!_0x1f2e97){_0x121cab[_0x660c('0x27')](0x194);}return _0x1f2e97;};}function handleError(_0x5f0384,_0x5eaeef){_0x5eaeef=_0x5eaeef||0x1f4;return function(_0x570de){logger[_0x660c('0x28')](_0x570de[_0x660c('0x29')]);if(_0x570de['name']){delete _0x570de[_0x660c('0x2a')];}_0x5f0384['status'](_0x5eaeef)['send'](_0x570de);};}exports[_0x660c('0x2b')]=function(_0x4ff230,_0xfaf2df){var _0x420087={},_0x4c93b0={},_0xf01f06={'count':0x0,'rows':[]};var _0x1ec0aa=_[_0x660c('0x2c')](db[_0x660c('0x2d')][_0x660c('0x2e')],function(_0x5e0684){return{'name':_0x5e0684[_0x660c('0x2f')],'type':_0x5e0684['type'][_0x660c('0x30')]};});_0x4c93b0['model']=_[_0x660c('0x2c')](_0x1ec0aa,_0x660c('0x2a'));_0x4c93b0[_0x660c('0x31')]=_['keys'](_0x4ff230[_0x660c('0x31')]);_0x4c93b0[_0x660c('0x32')]=_[_0x660c('0x33')](_0x4c93b0['model'],_0x4c93b0[_0x660c('0x31')]);_0x420087['attributes']=_[_0x660c('0x33')](_0x4c93b0['model'],qs[_0x660c('0x34')](_0x4ff230[_0x660c('0x31')][_0x660c('0x34')]));_0x420087[_0x660c('0x35')]=_0x420087[_0x660c('0x35')]['length']?_0x420087[_0x660c('0x35')]:_0x4c93b0['model'];if(!_0x4ff230[_0x660c('0x31')]['hasOwnProperty'](_0x660c('0x36'))){_0x420087[_0x660c('0x37')]=qs[_0x660c('0x37')](_0x4ff230[_0x660c('0x31')][_0x660c('0x37')]);_0x420087[_0x660c('0x1d')]=qs['offset'](_0x4ff230[_0x660c('0x31')][_0x660c('0x1d')]);}_0x420087[_0x660c('0x38')]=qs[_0x660c('0x39')](_0x4ff230['query'][_0x660c('0x39')]);_0x420087['where']=qs[_0x660c('0x32')](_[_0x660c('0x3a')](_0x4ff230[_0x660c('0x31')],_0x4c93b0[_0x660c('0x32')]));if(_0x4ff230['query'][_0x660c('0x3b')]){_0x420087[_0x660c('0x3c')]=_[_0x660c('0x3d')](_0x420087[_0x660c('0x3c')],{'$or':_[_0x660c('0x2c')](_0x1ec0aa,function(_0x3e6847){if(_0x3e6847[_0x660c('0x3e')]!=='VIRTUAL'){var _0x16dea6={};_0x16dea6[_0x3e6847[_0x660c('0x2a')]]={'$like':'%'+_0x4ff230[_0x660c('0x31')][_0x660c('0x3b')]+'%'};return _0x16dea6;}})});}_0x420087=_[_0x660c('0x3d')]({},_0x420087,_0x4ff230['options']);var _0x2e74f8={'where':_0x420087[_0x660c('0x3c')]};return db[_0x660c('0x2d')][_0x660c('0x1c')](_0x2e74f8)[_0x660c('0x25')](function(_0x5b5d49){_0xf01f06[_0x660c('0x1c')]=_0x5b5d49;if(_0x4ff230[_0x660c('0x31')][_0x660c('0x3f')]){_0x420087[_0x660c('0x40')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x660c('0x41')](_0x420087);})[_0x660c('0x25')](function(_0xf10c90){_0xf01f06[_0x660c('0x42')]=_0xf10c90;return _0xf01f06;})[_0x660c('0x25')](respondWithFilteredResult(_0xfaf2df,_0x420087))['catch'](handleError(_0xfaf2df,null));};exports[_0x660c('0x43')]=function(_0x3b6018,_0x37054d){var _0x2496b8={'raw':!![],'where':{'id':_0x3b6018[_0x660c('0x44')]['id']}},_0x3273b1={};_0x3273b1[_0x660c('0x45')]=_[_0x660c('0x46')](db[_0x660c('0x2d')][_0x660c('0x2e')]);_0x3273b1[_0x660c('0x31')]=_[_0x660c('0x46')](_0x3b6018[_0x660c('0x31')]);_0x3273b1[_0x660c('0x32')]=_[_0x660c('0x33')](_0x3273b1['model'],_0x3273b1[_0x660c('0x31')]);_0x2496b8[_0x660c('0x35')]=_['intersection'](_0x3273b1[_0x660c('0x45')],qs[_0x660c('0x34')](_0x3b6018['query'][_0x660c('0x34')]));_0x2496b8[_0x660c('0x35')]=_0x2496b8['attributes'][_0x660c('0x47')]?_0x2496b8[_0x660c('0x35')]:_0x3273b1[_0x660c('0x45')];if(_0x3b6018[_0x660c('0x31')]['includeAll']){_0x2496b8[_0x660c('0x40')]=[{'all':!![]}];}_0x2496b8=_[_0x660c('0x3d')]({},_0x2496b8,_0x3b6018[_0x660c('0x48')]);return db[_0x660c('0x2d')]['find'](_0x2496b8)['then'](handleEntityNotFound(_0x37054d,null))[_0x660c('0x25')](respondWithResult(_0x37054d,null))[_0x660c('0x49')](handleError(_0x37054d,null));};exports[_0x660c('0x4a')]=function(_0x55a50d,_0x575282){return db['OpenchannelQueue'][_0x660c('0x4a')](_0x55a50d['body'],{})['then'](function(_0x2f9961){var _0x295815=_0x55a50d[_0x660c('0x4b')][_0x660c('0x4c')]({'plain':!![]});if(!_0x295815)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x295815[_0x660c('0x4d')]===_0x660c('0x4b')){var _0x80449c=_0x2f9961['get']({'plain':!![]});var _0x29226e=_0x660c('0x4e');return db[_0x660c('0x4f')]['find']({'where':{'name':_0x29226e,'userProfileId':_0x295815[_0x660c('0x50')]},'raw':!![]})['then'](function(_0x34e470){if(_0x34e470&&_0x34e470[_0x660c('0x51')]===0x0){return db['UserProfileResource'][_0x660c('0x4a')]({'name':_0x80449c['name'],'resourceId':_0x80449c['id'],'type':_0x34e470['name'],'sectionId':_0x34e470['id']},{})[_0x660c('0x25')](function(){return _0x2f9961;});}else{return _0x2f9961;}})[_0x660c('0x49')](function(_0x707f01){logger[_0x660c('0x28')](_0x660c('0x52'),_0x707f01);throw _0x707f01;});}return _0x2f9961;})[_0x660c('0x25')](respondWithResult(_0x575282,0xc9))[_0x660c('0x49')](handleError(_0x575282,null));};exports[_0x660c('0x24')]=function(_0x172d7a,_0x3361fa){if(_0x172d7a[_0x660c('0x53')]['id']){delete _0x172d7a['body']['id'];}return db[_0x660c('0x2d')][_0x660c('0x54')]({'where':{'id':_0x172d7a[_0x660c('0x44')]['id']}})[_0x660c('0x25')](handleEntityNotFound(_0x3361fa,null))['then'](saveUpdates(_0x172d7a['body'],null))[_0x660c('0x25')](respondWithResult(_0x3361fa,null))[_0x660c('0x49')](handleError(_0x3361fa,null));};exports[_0x660c('0x26')]=function(_0x1cf000,_0xf18891){return db[_0x660c('0x2d')]['find']({'where':{'id':_0x1cf000[_0x660c('0x44')]['id']}})[_0x660c('0x25')](handleEntityNotFound(_0xf18891,null))[_0x660c('0x25')](removeEntity(_0xf18891,null))[_0x660c('0x49')](handleError(_0xf18891,null));};exports['describe']=function(_0x1113fc,_0x158fc8){return db[_0x660c('0x2d')]['describe']()[_0x660c('0x25')](respondWithResult(_0x158fc8,null))[_0x660c('0x49')](handleError(_0x158fc8,null));};exports[_0x660c('0x55')]=function(_0x343f4f,_0x71000c,_0x4c5628){var _0x383f12={'raw':!![],'where':{}},_0x5d2fc2={},_0x2c5b6d;return db[_0x660c('0x2d')]['findOne']({'where':{'id':_0x343f4f['params']['id']}})[_0x660c('0x25')](handleEntityNotFound(_0x71000c,null))['then'](function(_0x538a7a){if(_0x538a7a){_0x2c5b6d=_0x538a7a['get']({'plain':!![]});_0x5d2fc2[_0x660c('0x45')]=_['keys'](db[_0x660c('0x56')][_0x660c('0x2e')]);_0x5d2fc2[_0x660c('0x31')]=_[_0x660c('0x46')](_0x343f4f[_0x660c('0x31')]);_0x5d2fc2['filters']=_[_0x660c('0x33')](_0x5d2fc2['model'],_0x5d2fc2[_0x660c('0x31')]);_0x383f12[_0x660c('0x35')]=_[_0x660c('0x33')](_0x5d2fc2[_0x660c('0x45')],qs['fields'](_0x343f4f['query'][_0x660c('0x34')]));_0x383f12['attributes']=_0x383f12[_0x660c('0x35')][_0x660c('0x47')]?_0x383f12['attributes']:_0x5d2fc2['model'];if(!_0x343f4f[_0x660c('0x31')][_0x660c('0x57')]('nolimit')){_0x383f12[_0x660c('0x37')]=qs['limit'](_0x343f4f['query'][_0x660c('0x37')]);_0x383f12[_0x660c('0x1d')]=qs[_0x660c('0x1d')](_0x343f4f[_0x660c('0x31')]['offset']);}_0x383f12[_0x660c('0x38')]=qs['sort'](_0x343f4f[_0x660c('0x31')][_0x660c('0x39')]);_0x383f12[_0x660c('0x3c')]=qs[_0x660c('0x32')](_[_0x660c('0x3a')](_0x343f4f[_0x660c('0x31')],_0x5d2fc2[_0x660c('0x32')]));_0x383f12[_0x660c('0x3c')]['OpenchannelQueueId']=_0x538a7a['id'];if(_0x343f4f[_0x660c('0x31')][_0x660c('0x3b')]){_0x383f12[_0x660c('0x3c')]=_[_0x660c('0x3d')](_0x383f12[_0x660c('0x3c')],{'$or':_[_0x660c('0x2c')](_0x383f12[_0x660c('0x35')],function(_0x2b31aa){var _0x17b6df={};_0x17b6df[_0x2b31aa]={'$like':'%'+_0x343f4f[_0x660c('0x31')][_0x660c('0x3b')]+'%'};return _0x17b6df;})});}_0x383f12=_[_0x660c('0x3d')]({},_0x383f12,_0x343f4f[_0x660c('0x48')]);return db[_0x660c('0x56')][_0x660c('0x41')](_0x383f12);}})[_0x660c('0x25')](function(_0x121faa){if(_0x121faa){return db['User'][_0x660c('0x58')]({'where':{'id':_[_0x660c('0x2c')](_0x121faa,'UserId'),'role':_0x660c('0x59')},'attributes':['id',_0x660c('0x2a'),_0x660c('0x5a'),'updatedAt',_0x660c('0x5b')]});}})[_0x660c('0x25')](function(_0x2b08ab){if(_0x2b08ab){return{'count':_0x2b08ab['count'],'rows':_[_0x660c('0x2c')](_0x2b08ab[_0x660c('0x42')],function(_0x144927){return{'membername':_0x144927['name'],'UserId':_0x144927['id'],'queue_name':_0x2c5b6d[_0x660c('0x2a')],'OpenchannelQueueId':_0x2c5b6d['id'],'interface':util[_0x660c('0x5c')]('%s/%s',_0x660c('0x5d'),_0x144927[_0x660c('0x2a')]),'penalty':0x0,'paused':_0x144927[_0x660c('0x5a')],'createdAt':_0x144927['createdAt'],'updatedAt':_0x144927[_0x660c('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x71000c,_0x383f12))[_0x660c('0x49')](handleError(_0x71000c,null));};exports['getTeams']=function(_0x226ccc,_0x51631e,_0x4e409f){var _0x1a7bd0={};var _0x489820={};var _0x1ea0e1;var _0x3d567c;return db[_0x660c('0x2d')][_0x660c('0x5f')]({'where':{'id':_0x226ccc[_0x660c('0x44')]['id']}})[_0x660c('0x25')](handleEntityNotFound(_0x51631e,null))[_0x660c('0x25')](function(_0xb275e){if(_0xb275e){_0x1ea0e1=_0xb275e;_0x489820['model']=_[_0x660c('0x46')](db[_0x660c('0x60')][_0x660c('0x2e')]);_0x489820['query']=_[_0x660c('0x46')](_0x226ccc[_0x660c('0x31')]);_0x489820['filters']=_[_0x660c('0x33')](_0x489820['model'],_0x489820[_0x660c('0x31')]);_0x1a7bd0['attributes']=_[_0x660c('0x33')](_0x489820[_0x660c('0x45')],qs['fields'](_0x226ccc[_0x660c('0x31')]['fields']));_0x1a7bd0['attributes']=_0x1a7bd0['attributes']['length']?_0x1a7bd0[_0x660c('0x35')]:_0x489820['model'];_0x1a7bd0[_0x660c('0x38')]=qs['sort'](_0x226ccc[_0x660c('0x31')][_0x660c('0x39')]);_0x1a7bd0[_0x660c('0x3c')]=qs[_0x660c('0x32')](_['pick'](_0x226ccc[_0x660c('0x31')],_0x489820[_0x660c('0x32')]));if(_0x226ccc[_0x660c('0x31')][_0x660c('0x3b')]){_0x1a7bd0[_0x660c('0x3c')]=_[_0x660c('0x3d')](_0x1a7bd0['where'],{'$or':_[_0x660c('0x2c')](_0x1a7bd0[_0x660c('0x35')],function(_0x3f72d1){var _0xc3c79e={};_0xc3c79e[_0x3f72d1]={'$like':'%'+_0x226ccc[_0x660c('0x31')][_0x660c('0x3b')]+'%'};return _0xc3c79e;})});}_0x1a7bd0=_['merge']({},_0x1a7bd0,_0x226ccc[_0x660c('0x48')]);return _0x1ea0e1[_0x660c('0x61')](_0x1a7bd0);}})[_0x660c('0x25')](function(_0x2e06c3){if(_0x2e06c3){_0x3d567c=_0x2e06c3[_0x660c('0x47')];if(!_0x226ccc[_0x660c('0x31')]['hasOwnProperty'](_0x660c('0x36'))){_0x1a7bd0[_0x660c('0x37')]=qs['limit'](_0x226ccc[_0x660c('0x31')][_0x660c('0x37')]);_0x1a7bd0[_0x660c('0x1d')]=qs[_0x660c('0x1d')](_0x226ccc[_0x660c('0x31')]['offset']);}return _0x1ea0e1[_0x660c('0x61')](_0x1a7bd0);}})['then'](function(_0x38a330){if(_0x38a330){return _0x38a330?{'count':_0x3d567c,'rows':_0x38a330}:null;}})[_0x660c('0x25')](respondWithResult(_0x51631e,null))[_0x660c('0x49')](handleError(_0x51631e,null));};exports[_0x660c('0x62')]=function(_0x54fa61,_0x2abe60,_0x3ac4a6){var _0x38bee5=_0x54fa61[_0x660c('0x53')]['ids'];return db[_0x660c('0x60')][_0x660c('0x41')]({'where':{'id':_0x38bee5},'attributes':['id'],'include':[{'model':db['User'],'as':_0x660c('0x63'),'attributes':['id',_0x660c('0x2a'),_0x660c('0x64'),_0x660c('0x65'),_0x660c('0x66')],'raw':!![]}]})[_0x660c('0x25')](function(_0x280e6e){if(_0x280e6e){var _0x4b40a0=_[_0x660c('0x67')](_0x280e6e,function(_0xed4907){var _0x147216=_0xed4907['get']({'plain':!![]});return _0x147216[_0x660c('0x63')];});return db[_0x660c('0x2d')][_0x660c('0x54')]({'where':{'id':_0x54fa61[_0x660c('0x44')]['id']}})['then'](function(_0x3ddc6e){return db[_0x660c('0x68')][_0x660c('0x69')](function(_0x317200){return _0x3ddc6e[_0x660c('0x62')](_0x38bee5,{'transaction':_0x317200})[_0x660c('0x25')](function(){return BPromise[_0x660c('0x6a')](_0x4b40a0,function(_0x2f7929){return db[_0x660c('0x56')][_0x660c('0x6b')]({'where':{'UserId':_0x2f7929['id'],'OpenchannelQueueId':_0x54fa61[_0x660c('0x44')]['id']},'transaction':_0x317200});});})[_0x660c('0x25')](function(){_0x4b40a0[_0x660c('0x6c')](function(_0x6dac8b){socket[_0x660c('0x6d')](_0x660c('0x6e'),{'UserId':_0x6dac8b['id'],'OpenchannelQueueId':_0x3ddc6e['id']});});});});});}})['then'](respondWithStatusCode(_0x2abe60,null))[_0x660c('0x49')](handleError(_0x2abe60,null));};exports[_0x660c('0x6f')]=function(_0xcdda17,_0xb064d3,_0x31c09e){return db[_0x660c('0x60')][_0x660c('0x41')]({'where':{'id':_0xcdda17[_0x660c('0x31')][_0x660c('0x70')]},'attributes':['id'],'include':[{'model':db[_0x660c('0x71')],'as':_0x660c('0x63'),'attributes':['id'],'raw':!![]}]})[_0x660c('0x25')](handleEntityNotFound(_0xb064d3,null))[_0x660c('0x25')](function(_0x1fef49){var _0x2b7753=_[_0x660c('0x2c')](_0x1fef49,'id');var _0x39d3c9=[];var _0xaeb10f=[];var _0x4fd32e=squel['select']();_0x4fd32e['field'](_0x660c('0x72'))[_0x660c('0x73')]('team_has_openchannel_queues','tq')[_0x660c('0x74')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x660c('0x3c')](_0x660c('0x75'),_0xcdda17[_0x660c('0x44')]['id']);for(var _0x1174e1=0x0;_0x1174e1<_0x1fef49['length'];_0x1174e1+=0x1){let _0x5dfb66=_0x1fef49[_0x1174e1];for(var _0x149ed0=0x0;_0x149ed0<_0x5dfb66[_0x660c('0x63')]['length'];_0x149ed0+=0x1){let _0x9c3a8=_0x5dfb66[_0x660c('0x63')][_0x149ed0];var _0x5f01bf=_0x4fd32e[_0x660c('0x76')]();_0x5f01bf[_0x660c('0x3c')]('ut.UserId\x20=\x20?',_0x9c3a8['id']);_0xaeb10f['push'](db[_0x660c('0x68')]['query'](_0x5f01bf[_0x660c('0x77')](),{'type':db[_0x660c('0x68')][_0x660c('0x78')][_0x660c('0x79')]})[_0x660c('0x25')](function(_0x5d09e8){if(_0x5d09e8[_0x660c('0x47')]===0x1){return _0x9c3a8['id'];}else{var _0x304f11=_['every'](_['map'](_0x5d09e8,_0x660c('0x7a')),function(_0x30261d){return _[_0x660c('0x7b')](_0x2b7753,_0x30261d);});if(_0x304f11){return _0x9c3a8['id'];}}}));}}return BPromise[_0x660c('0x7c')](_0xaeb10f)['then'](function(_0x3c6879){_0x39d3c9=_(_0x39d3c9)[_0x660c('0x7d')](_0x3c6879)[_0x660c('0x7e')]()[_0x660c('0x7f')]();return db['OpenchannelQueue'][_0x660c('0x54')]({'where':{'id':_0xcdda17[_0x660c('0x44')]['id']}})['then'](function(_0x31d781){return db['sequelize'][_0x660c('0x69')](function(_0x3c5c5c){return _0x31d781['removeTeams'](_0xcdda17[_0x660c('0x31')][_0x660c('0x70')],{'transaction':_0x3c5c5c})[_0x660c('0x25')](function(){if(!_[_0x660c('0x80')](_0x39d3c9)){return _0x31d781[_0x660c('0x81')](_0x39d3c9,{'transaction':_0x3c5c5c});}})[_0x660c('0x25')](function(){_0x39d3c9[_0x660c('0x6c')](function(_0x33e9de){socket[_0x660c('0x6d')]('userOpenchannelQueue:remove',{'UserId':_0x33e9de,'OpenchannelQueueId':_0x31d781['id']});});});});});});})[_0x660c('0x25')](respondWithStatusCode(_0xb064d3,null))[_0x660c('0x49')](handleError(_0xb064d3,null));};exports[_0x660c('0x82')]=function(_0x542857,_0x37ecda,_0x4c740b){return db[_0x660c('0x2d')][_0x660c('0x54')]({'where':{'id':_0x542857[_0x660c('0x44')]['id']}})[_0x660c('0x25')](handleEntityNotFound(_0x37ecda,null))[_0x660c('0x25')](function(_0x2fd0e8){if(_0x2fd0e8){return _0x2fd0e8[_0x660c('0x82')](_0x542857[_0x660c('0x53')][_0x660c('0x70')],_[_0x660c('0x83')](_0x542857[_0x660c('0x53')],[_0x660c('0x70'),'id'])||{})[_0x660c('0x84')](function(_0x2ed17b){for(var _0x14fb21=0x0;_0x14fb21<_0x542857['body'][_0x660c('0x70')][_0x660c('0x47')];_0x14fb21+=0x1){socket[_0x660c('0x6d')](_0x660c('0x6e'),{'UserId':_0x542857[_0x660c('0x53')]['ids'][_0x14fb21],'OpenchannelQueueId':_0x542857['params']['id']});}return _0x2ed17b;});}})[_0x660c('0x25')](respondWithResult(_0x37ecda,null))['catch'](handleError(_0x37ecda,null));};exports[_0x660c('0x81')]=function(_0x5063c0,_0x48e314,_0x1aff20){return db['OpenchannelQueue'][_0x660c('0x54')]({'where':{'id':_0x5063c0[_0x660c('0x44')]['id']}})[_0x660c('0x25')](handleEntityNotFound(_0x48e314,null))[_0x660c('0x25')](function(_0x206ae7){if(_0x206ae7){return _0x206ae7[_0x660c('0x81')](_0x5063c0['query'][_0x660c('0x70')])[_0x660c('0x25')](function(){if(_[_0x660c('0x85')](_0x5063c0[_0x660c('0x31')][_0x660c('0x70')])){for(var _0x5680ab=0x0;_0x5680ab<_0x5063c0[_0x660c('0x31')][_0x660c('0x70')]['length'];_0x5680ab+=0x1){socket[_0x660c('0x6d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5063c0[_0x660c('0x31')][_0x660c('0x70')][_0x5680ab]),'OpenchannelQueueId':Number(_0x5063c0[_0x660c('0x44')]['id'])});}}else{socket[_0x660c('0x6d')](_0x660c('0x86'),{'UserId':Number(_0x5063c0[_0x660c('0x31')]['ids']),'OpenchannelQueueId':Number(_0x5063c0[_0x660c('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x48e314,null))[_0x660c('0x49')](handleError(_0x48e314,null));};exports[_0x660c('0x87')]=function(_0x396d76,_0xb898f1,_0x25a047){var _0x2e7581={};var _0xc38533={};var _0x4765d5;var _0x30c523;return db['OpenchannelQueue'][_0x660c('0x5f')]({'where':{'id':_0x396d76['params']['id']}})[_0x660c('0x25')](handleEntityNotFound(_0xb898f1,null))['then'](function(_0x52ef80){if(_0x52ef80){_0x4765d5=_0x52ef80;_0xc38533[_0x660c('0x45')]=_[_0x660c('0x46')](db['User'][_0x660c('0x2e')]);_0xc38533[_0x660c('0x31')]=_[_0x660c('0x46')](_0x396d76['query']);_0xc38533[_0x660c('0x32')]=_['intersection'](_0xc38533[_0x660c('0x45')],_0xc38533[_0x660c('0x31')]);_0x2e7581[_0x660c('0x35')]=_[_0x660c('0x33')](_0xc38533[_0x660c('0x45')],qs['fields'](_0x396d76['query'][_0x660c('0x34')]));_0x2e7581[_0x660c('0x35')]=_0x2e7581['attributes']['length']?_0x2e7581[_0x660c('0x35')]:_0xc38533[_0x660c('0x45')];_0x2e7581['order']=qs[_0x660c('0x39')](_0x396d76[_0x660c('0x31')][_0x660c('0x39')]);_0x2e7581['where']=qs[_0x660c('0x32')](_['pick'](_0x396d76[_0x660c('0x31')],_0xc38533[_0x660c('0x32')]));if(_0x396d76[_0x660c('0x31')]['filter']){_0x2e7581[_0x660c('0x3c')]=_[_0x660c('0x3d')](_0x2e7581[_0x660c('0x3c')],{'$or':_[_0x660c('0x2c')](_0x2e7581[_0x660c('0x35')],function(_0x3dbda1){var _0x36c856={};_0x36c856[_0x3dbda1]={'$like':'%'+_0x396d76[_0x660c('0x31')][_0x660c('0x3b')]+'%'};return _0x36c856;})});}_0x2e7581=_[_0x660c('0x3d')]({},_0x2e7581,_0x396d76['options']);return _0x4765d5['getAgents'](_0x2e7581);}})[_0x660c('0x25')](function(_0x24f256){if(_0x24f256){_0x30c523=_0x24f256[_0x660c('0x47')];if(!_0x396d76[_0x660c('0x31')][_0x660c('0x57')](_0x660c('0x36'))){_0x2e7581[_0x660c('0x37')]=qs[_0x660c('0x37')](_0x396d76[_0x660c('0x31')][_0x660c('0x37')]);_0x2e7581[_0x660c('0x1d')]=qs[_0x660c('0x1d')](_0x396d76['query'][_0x660c('0x1d')]);}return _0x4765d5[_0x660c('0x87')](_0x2e7581);}})[_0x660c('0x25')](function(_0x382063){if(_0x382063){return _0x382063?{'count':_0x30c523,'rows':_0x382063}:null;}})[_0x660c('0x25')](respondWithResult(_0xb898f1,null))['catch'](handleError(_0xb898f1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1bb1aae..c601ed9 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 _0x5975=['OpenchannelQueue','setMaxListeners','update','emit','hook','exports','events','../../mysqldb'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x5975,0x186));var _0x5597=function(_0x29b199,_0x514f79){_0x29b199=_0x29b199-0x0;var _0x117a67=_0x5975[_0x29b199];return _0x117a67;};'use strict';var EventEmitter=require(_0x5597('0x0'));var OpenchannelQueue=require(_0x5597('0x1'))['db'][_0x5597('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5597('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5597('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a8fd0){return function(_0x566990,_0x56784c,_0x24cfad){OpenchannelQueueEvents['emit'](_0x5a8fd0+':'+_0x566990['id'],_0x566990);OpenchannelQueueEvents[_0x5597('0x5')](_0x5a8fd0,_0x566990);_0x24cfad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x5597('0x6')](e,emitEvent(event));}}module[_0x5597('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xfdd6=['emit','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove'];(function(_0xcb1432,_0x9cfff8){var _0x432dc5=function(_0x17943f){while(--_0x17943f){_0xcb1432['push'](_0xcb1432['shift']());}};_0x432dc5(++_0x9cfff8);}(_0xfdd6,0x193));var _0x6fdd=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0xfdd6[_0x21cb7f];return _0x5a079a;};'use strict';var EventEmitter=require(_0x6fdd('0x0'));var OpenchannelQueue=require(_0x6fdd('0x1'))['db'][_0x6fdd('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6fdd('0x3')](0x0);var events={'afterCreate':_0x6fdd('0x4'),'afterUpdate':_0x6fdd('0x5'),'afterDestroy':_0x6fdd('0x6')};function emitEvent(_0xa0d576){return function(_0x3718a2,_0x1172ba,_0x4a439c){OpenchannelQueueEvents[_0x6fdd('0x7')](_0xa0d576+':'+_0x3718a2['id'],_0x3718a2);OpenchannelQueueEvents['emit'](_0xa0d576,_0x3718a2);_0x4a439c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x6fdd('0x8')](e,emitEvent(event));}}module[_0x6fdd('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index fe85df3..7de8931 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 _0x7ff9=['exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes'];(function(_0x380a94,_0x33b3db){var _0x22c6a0=function(_0x277bae){while(--_0x277bae){_0x380a94['push'](_0x380a94['shift']());}};_0x22c6a0(++_0x33b3db);}(_0x7ff9,0x78));var _0x97ff=function(_0x5e25a0,_0x3ac5ad){_0x5e25a0=_0x5e25a0-0x0;var _0x883528=_0x7ff9[_0x5e25a0];return _0x883528;};'use strict';var _=require(_0x97ff('0x0'));var util=require(_0x97ff('0x1'));var logger=require(_0x97ff('0x2'))(_0x97ff('0x3'));var moment=require(_0x97ff('0x4'));var BPromise=require(_0x97ff('0x5'));var rp=require(_0x97ff('0x6'));var fs=require('fs');var path=require(_0x97ff('0x7'));var rimraf=require(_0x97ff('0x8'));var config=require('../../config/environment');var attributes=require(_0x97ff('0x9'));module[_0x97ff('0xa')]=function(_0x5d71a6,_0x54c03f){return _0x5d71a6['define'](_0x97ff('0xb'),attributes,{'tableName':_0x97ff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6868=['openchannel_queues','lodash','../../config/logger','api','bluebird','request-promise','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x544bd9,_0x16e3c4){var _0x4c7e56=function(_0x4e402b){while(--_0x4e402b){_0x544bd9['push'](_0x544bd9['shift']());}};_0x4c7e56(++_0x16e3c4);}(_0x6868,0xdd));var _0x8686=function(_0x33e231,_0x4485f0){_0x33e231=_0x33e231-0x0;var _0xcfa938=_0x6868[_0x33e231];return _0xcfa938;};'use strict';var _=require(_0x8686('0x0'));var util=require('util');var logger=require(_0x8686('0x1'))(_0x8686('0x2'));var moment=require('moment');var BPromise=require(_0x8686('0x3'));var rp=require(_0x8686('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8686('0x5'));var config=require('../../config/environment');var attributes=require(_0x8686('0x6'));module[_0x8686('0x7')]=function(_0x238830,_0x3253fb){return _0x238830[_0x8686('0x8')](_0x8686('0x9'),attributes,{'tableName':_0x8686('0xa'),'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 50d1fe1..c0f3421 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 _0x4345=['request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','attributes','limit','include','map','model','ShowOpenchannelQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','request','then','info','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x2e50e3,_0x5f34f3){var _0x3f8c1c=function(_0xae806f){while(--_0xae806f){_0x2e50e3['push'](_0x2e50e3['shift']());}};_0x3f8c1c(++_0x5f34f3);}(_0x4345,0xeb));var _0x5434=function(_0x139d85,_0x4be590){_0x139d85=_0x139d85-0x0;var _0x1301c0=_0x4345[_0x139d85];return _0x1301c0;};'use strict';var _=require('lodash');var util=require(_0x5434('0x0'));var moment=require(_0x5434('0x1'));var BPromise=require(_0x5434('0x2'));var rs=require(_0x5434('0x3'));var fs=require('fs');var Redis=require(_0x5434('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5434('0x5'))(_0x5434('0x6'));var config=require('../../config/environment');var jayson=require(_0x5434('0x7'));var client=jayson[_0x5434('0x8')][_0x5434('0x9')]({'port':0x232a});config[_0x5434('0xa')]=_[_0x5434('0xb')](config[_0x5434('0xa')],{'host':_0x5434('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5434('0xa')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1f9694,_0x30ce14,_0x1834d2){return new BPromise(function(_0x5c4591,_0x39760e){return client[_0x5434('0xd')](_0x1f9694,_0x1834d2)[_0x5434('0xe')](function(_0x1fabcb){logger[_0x5434('0xf')](_0x5434('0x10'),_0x30ce14,_0x5434('0x11'));logger[_0x5434('0x12')](_0x5434('0x13'),_0x30ce14,_0x5434('0x11'),JSON[_0x5434('0x14')](_0x1fabcb));if(_0x1fabcb['error']){if(_0x1fabcb[_0x5434('0x15')][_0x5434('0x16')]===0x1f4){logger[_0x5434('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x30ce14,_0x1fabcb[_0x5434('0x15')][_0x5434('0x17')]);return _0x39760e(_0x1fabcb[_0x5434('0x15')][_0x5434('0x17')]);}logger[_0x5434('0x15')](_0x5434('0x10'),_0x30ce14,_0x1fabcb['error'][_0x5434('0x17')]);return _0x5c4591(_0x1fabcb[_0x5434('0x15')]['message']);}else{logger[_0x5434('0xf')](_0x5434('0x10'),_0x30ce14,_0x5434('0x11'));_0x5c4591(_0x1fabcb['result'][_0x5434('0x17')]);}})[_0x5434('0x18')](function(_0x2c4c7f){logger[_0x5434('0x15')](_0x5434('0x10'),_0x30ce14,_0x2c4c7f);_0x39760e(_0x2c4c7f);});});}exports[_0x5434('0x19')]=function(_0x348618){var _0x2a4098=this;return new Promise(function(_0x5ec049,_0x1bd92d){return db[_0x5434('0x1a')][_0x5434('0x1b')]({'raw':_0x348618[_0x5434('0x1c')]?_0x348618[_0x5434('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x348618[_0x5434('0x1c')]?_0x348618['options']['where']||null:null,'attributes':_0x348618[_0x5434('0x1c')]?_0x348618[_0x5434('0x1c')][_0x5434('0x1d')]||null:null,'limit':_0x348618[_0x5434('0x1c')]?_0x348618[_0x5434('0x1c')][_0x5434('0x1e')]||null:null,'include':_0x348618[_0x5434('0x1c')]?_0x348618['options'][_0x5434('0x1f')]?_[_0x5434('0x20')](_0x348618[_0x5434('0x1c')]['include'],function(_0x5d5f23){return{'model':db[_0x5d5f23[_0x5434('0x21')]],'as':_0x5d5f23['as'],'attributes':_0x5d5f23['attributes'],'include':_0x5d5f23['include']?_[_0x5434('0x20')](_0x5d5f23[_0x5434('0x1f')],function(_0x34ad57){return{'model':db[_0x34ad57['model']],'as':_0x34ad57['as'],'attributes':_0x34ad57['attributes'],'include':_0x34ad57['include']?_[_0x5434('0x20')](_0x34ad57['include'],function(_0xa3fbfc){return{'model':db[_0xa3fbfc['model']],'as':_0xa3fbfc['as'],'attributes':_0xa3fbfc[_0x5434('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5434('0xe')](function(_0x16e07a){logger['info']('GetOpenchannelQueue',_0x348618);logger[_0x5434('0x12')](_0x5434('0x19'),_0x348618,JSON[_0x5434('0x14')](_0x16e07a));_0x5ec049(_0x16e07a);})[_0x5434('0x18')](function(_0x5afdc0){logger[_0x5434('0x15')](_0x5434('0x19'),_0x5afdc0[_0x5434('0x17')],_0x348618);_0x1bd92d(_0x2a4098[_0x5434('0x15')](0x1f4,_0x5afdc0[_0x5434('0x17')]));});});};exports[_0x5434('0x22')]=function(_0x39a6a8){var _0x43ca77=this;return new Promise(function(_0x1af193,_0x22b234){return db['OpenchannelQueue'][_0x5434('0x23')]({'raw':_0x39a6a8[_0x5434('0x1c')]?_0x39a6a8[_0x5434('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x39a6a8[_0x5434('0x1c')]?_0x39a6a8['options']['where']||null:null,'attributes':_0x39a6a8[_0x5434('0x1c')]?_0x39a6a8[_0x5434('0x1c')][_0x5434('0x1d')]||null:null,'include':_0x39a6a8['options']?_0x39a6a8[_0x5434('0x1c')][_0x5434('0x1f')]?_[_0x5434('0x20')](_0x39a6a8[_0x5434('0x1c')]['include'],function(_0x12060a){return{'model':db[_0x12060a['model']],'as':_0x12060a['as'],'attributes':_0x12060a[_0x5434('0x1d')],'include':_0x12060a[_0x5434('0x1f')]?_['map'](_0x12060a[_0x5434('0x1f')],function(_0x267d30){return{'model':db[_0x267d30['model']],'as':_0x267d30['as'],'attributes':_0x267d30[_0x5434('0x1d')],'include':_0x267d30[_0x5434('0x1f')]?_[_0x5434('0x20')](_0x267d30[_0x5434('0x1f')],function(_0x2344a8){return{'model':db[_0x2344a8[_0x5434('0x21')]],'as':_0x2344a8['as'],'attributes':_0x2344a8[_0x5434('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5434('0xe')](function(_0x185e2a){logger[_0x5434('0xf')](_0x5434('0x22'),_0x39a6a8);logger[_0x5434('0x12')](_0x5434('0x22'),_0x39a6a8,JSON['stringify'](_0x185e2a));_0x1af193(_0x185e2a);})[_0x5434('0x18')](function(_0x1faa12){logger[_0x5434('0x15')](_0x5434('0x22'),_0x1faa12[_0x5434('0x17')],_0x39a6a8);_0x22b234(_0x43ca77['error'](0x1f4,_0x1faa12['message']));});});}; \ No newline at end of file +var _0x35d5=['socket.io-emitter','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','debug','find','model','ShowOpenchannelQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost'];(function(_0x4dfb58,_0x5e158a){var _0x56edb0=function(_0x1cdbc5){while(--_0x1cdbc5){_0x4dfb58['push'](_0x4dfb58['shift']());}};_0x56edb0(++_0x5e158a);}(_0x35d5,0x1aa));var _0x535d=function(_0x22534a,_0x57e519){_0x22534a=_0x22534a-0x0;var _0x3b76f4=_0x35d5[_0x22534a];return _0x3b76f4;};'use strict';var _=require(_0x535d('0x0'));var util=require(_0x535d('0x1'));var moment=require('moment');var BPromise=require(_0x535d('0x2'));var rs=require(_0x535d('0x3'));var fs=require('fs');var Redis=require(_0x535d('0x4'));var db=require(_0x535d('0x5'))['db'];var utils=require(_0x535d('0x6'));var logger=require(_0x535d('0x7'))(_0x535d('0x8'));var config=require('../../config/environment');var jayson=require(_0x535d('0x9'));var client=jayson['client'][_0x535d('0xa')]({'port':0x232a});config[_0x535d('0xb')]=_[_0x535d('0xc')](config[_0x535d('0xb')],{'host':_0x535d('0xd'),'port':0x18eb});var socket=require(_0x535d('0xe'))(new Redis(config[_0x535d('0xb')]));require(_0x535d('0xf'))[_0x535d('0x10')](socket);function respondWithRpcPromise(_0x42c47b,_0x18e444,_0x3a40ec){return new BPromise(function(_0x2bf80f,_0x5c2ea9){return client['request'](_0x42c47b,_0x3a40ec)['then'](function(_0x36a39c){logger[_0x535d('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x18e444,'request\x20sent');logger['debug'](_0x535d('0x12'),_0x18e444,_0x535d('0x13'),JSON[_0x535d('0x14')](_0x36a39c));if(_0x36a39c[_0x535d('0x15')]){if(_0x36a39c[_0x535d('0x15')][_0x535d('0x16')]===0x1f4){logger[_0x535d('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x18e444,_0x36a39c['error'][_0x535d('0x17')]);return _0x5c2ea9(_0x36a39c[_0x535d('0x15')]['message']);}logger[_0x535d('0x15')](_0x535d('0x18'),_0x18e444,_0x36a39c[_0x535d('0x15')]['message']);return _0x2bf80f(_0x36a39c[_0x535d('0x15')][_0x535d('0x17')]);}else{logger[_0x535d('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x18e444,_0x535d('0x13'));_0x2bf80f(_0x36a39c[_0x535d('0x19')]['message']);}})[_0x535d('0x1a')](function(_0x100e5c){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x18e444,_0x100e5c);_0x5c2ea9(_0x100e5c);});});}exports[_0x535d('0x1b')]=function(_0x7ce168){var _0x941ab4=this;return new Promise(function(_0x51e947,_0x34b37a){return db[_0x535d('0x1c')][_0x535d('0x1d')]({'raw':_0x7ce168[_0x535d('0x1e')]?_0x7ce168[_0x535d('0x1e')][_0x535d('0x1f')]===undefined?!![]:![]:!![],'where':_0x7ce168[_0x535d('0x1e')]?_0x7ce168[_0x535d('0x1e')][_0x535d('0x20')]||null:null,'attributes':_0x7ce168[_0x535d('0x1e')]?_0x7ce168[_0x535d('0x1e')][_0x535d('0x21')]||null:null,'limit':_0x7ce168[_0x535d('0x1e')]?_0x7ce168['options']['limit']||null:null,'include':_0x7ce168[_0x535d('0x1e')]?_0x7ce168[_0x535d('0x1e')][_0x535d('0x22')]?_[_0x535d('0x23')](_0x7ce168[_0x535d('0x1e')][_0x535d('0x22')],function(_0x3be373){return{'model':db[_0x3be373['model']],'as':_0x3be373['as'],'attributes':_0x3be373[_0x535d('0x21')],'include':_0x3be373[_0x535d('0x22')]?_['map'](_0x3be373[_0x535d('0x22')],function(_0x583bfa){return{'model':db[_0x583bfa['model']],'as':_0x583bfa['as'],'attributes':_0x583bfa[_0x535d('0x21')],'include':_0x583bfa[_0x535d('0x22')]?_['map'](_0x583bfa[_0x535d('0x22')],function(_0xb60528){return{'model':db[_0xb60528['model']],'as':_0xb60528['as'],'attributes':_0xb60528[_0x535d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21ef6a){logger[_0x535d('0x11')](_0x535d('0x1b'),_0x7ce168);logger[_0x535d('0x24')]('GetOpenchannelQueue',_0x7ce168,JSON[_0x535d('0x14')](_0x21ef6a));_0x51e947(_0x21ef6a);})[_0x535d('0x1a')](function(_0x328045){logger[_0x535d('0x15')](_0x535d('0x1b'),_0x328045[_0x535d('0x17')],_0x7ce168);_0x34b37a(_0x941ab4[_0x535d('0x15')](0x1f4,_0x328045[_0x535d('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x462c85){var _0xa399d0=this;return new Promise(function(_0x1632c3,_0x297079){return db[_0x535d('0x1c')][_0x535d('0x25')]({'raw':_0x462c85['options']?_0x462c85[_0x535d('0x1e')][_0x535d('0x1f')]===undefined?!![]:![]:!![],'where':_0x462c85[_0x535d('0x1e')]?_0x462c85[_0x535d('0x1e')][_0x535d('0x20')]||null:null,'attributes':_0x462c85['options']?_0x462c85[_0x535d('0x1e')]['attributes']||null:null,'include':_0x462c85['options']?_0x462c85[_0x535d('0x1e')][_0x535d('0x22')]?_['map'](_0x462c85[_0x535d('0x1e')]['include'],function(_0xa7794c){return{'model':db[_0xa7794c[_0x535d('0x26')]],'as':_0xa7794c['as'],'attributes':_0xa7794c['attributes'],'include':_0xa7794c['include']?_[_0x535d('0x23')](_0xa7794c[_0x535d('0x22')],function(_0x58bfb4){return{'model':db[_0x58bfb4[_0x535d('0x26')]],'as':_0x58bfb4['as'],'attributes':_0x58bfb4[_0x535d('0x21')],'include':_0x58bfb4[_0x535d('0x22')]?_[_0x535d('0x23')](_0x58bfb4['include'],function(_0x2da6ae){return{'model':db[_0x2da6ae[_0x535d('0x26')]],'as':_0x2da6ae['as'],'attributes':_0x2da6ae[_0x535d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51ca89){logger[_0x535d('0x11')]('ShowOpenchannelQueue',_0x462c85);logger[_0x535d('0x24')](_0x535d('0x27'),_0x462c85,JSON[_0x535d('0x14')](_0x51ca89));_0x1632c3(_0x51ca89);})[_0x535d('0x1a')](function(_0x4c0ee){logger['error'](_0x535d('0x27'),_0x4c0ee['message'],_0x462c85);_0x297079(_0xa399d0[_0x535d('0x15')](0x1f4,_0x4c0ee[_0x535d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index cccfb51..1b40795 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 _0x8925=['remove','update','emit','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x521da0,_0x4986a4){var _0x159674=function(_0x59ae8a){while(--_0x59ae8a){_0x521da0['push'](_0x521da0['shift']());}};_0x159674(++_0x4986a4);}(_0x8925,0x101));var _0x5892=function(_0x45a5a3,_0x4bbd82){_0x45a5a3=_0x45a5a3-0x0;var _0x5ba07c=_0x8925[_0x45a5a3];return _0x5ba07c;};'use strict';var OpenchannelQueueEvents=require(_0x5892('0x0'));var events=[_0x5892('0x1'),_0x5892('0x2'),_0x5892('0x3')];function createListener(_0x18dde9,_0x8b154c){return function(_0x5b1137){_0x8b154c[_0x5892('0x4')](_0x18dde9,_0x5b1137);};}function removeListener(_0x281b5c,_0x3a8a5b){return function(){OpenchannelQueueEvents['removeListener'](_0x281b5c,_0x3a8a5b);};}exports['register']=function(_0x1aba60){for(var _0x514b0a=0x0,_0x44ee83=events[_0x5892('0x5')];_0x514b0a<_0x44ee83;_0x514b0a++){var _0x38e40f=events[_0x514b0a];var _0x3417b6=createListener(_0x5892('0x6')+_0x38e40f,_0x1aba60);OpenchannelQueueEvents['on'](_0x38e40f,_0x3417b6);}}; \ No newline at end of file +var _0xc45a=['remove','emit','removeListener','register','length','openchannelQueue:','save'];(function(_0x443043,_0x5f0ebb){var _0x50ae1f=function(_0x1a57d7){while(--_0x1a57d7){_0x443043['push'](_0x443043['shift']());}};_0x50ae1f(++_0x5f0ebb);}(_0xc45a,0x1b1));var _0xac45=function(_0x36e56d,_0x35fb4a){_0x36e56d=_0x36e56d-0x0;var _0x1dbcfc=_0xc45a[_0x36e56d];return _0x1dbcfc;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xac45('0x0'),_0xac45('0x1'),'update'];function createListener(_0x2a3481,_0xbba078){return function(_0x4a8e2b){_0xbba078[_0xac45('0x2')](_0x2a3481,_0x4a8e2b);};}function removeListener(_0x19ccfd,_0x57de50){return function(){OpenchannelQueueEvents[_0xac45('0x3')](_0x19ccfd,_0x57de50);};}exports[_0xac45('0x4')]=function(_0x2ed182){for(var _0x482ed9=0x0,_0x14c30f=events[_0xac45('0x5')];_0x482ed9<_0x14c30f;_0x482ed9++){var _0x56e4b4=events[_0x482ed9];var _0x3135c9=createListener(_0xac45('0x6')+_0x56e4b4,_0x2ed182);OpenchannelQueueEvents['on'](_0x56e4b4,_0x3135c9);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 6b7ed9c..407dbf9 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 _0x9a4c=['../../components/interaction/service','./openchannelQueueReport.controller','get','/describe','describe','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x14013d,_0x1e4375){var _0x2b5fb4=function(_0x568d70){while(--_0x568d70){_0x14013d['push'](_0x14013d['shift']());}};_0x2b5fb4(++_0x1e4375);}(_0x9a4c,0x1ac));var _0xc9a4=function(_0x2f4ea9,_0x195a39){_0x2f4ea9=_0x2f4ea9-0x0;var _0x2b1b8d=_0x9a4c[_0x2f4ea9];return _0x2b1b8d;};'use strict';var multer=require(_0xc9a4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc9a4('0x1'));var express=require('express');var router=express[_0xc9a4('0x2')]();var auth=require(_0xc9a4('0x3'));var interaction=require(_0xc9a4('0x4'));var config=require('../../config/environment');var controller=require(_0xc9a4('0x5'));router[_0xc9a4('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc9a4('0x6')](_0xc9a4('0x7'),auth['isAuthenticated'](),controller[_0xc9a4('0x8')]);router[_0xc9a4('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xc9a4('0x9')]);router[_0xc9a4('0xa')]('/',auth[_0xc9a4('0xb')](),controller[_0xc9a4('0xc')]);router[_0xc9a4('0xd')](_0xc9a4('0xe'),auth['isAuthenticated'](),controller[_0xc9a4('0xf')]);router[_0xc9a4('0x10')](_0xc9a4('0xe'),auth[_0xc9a4('0xb')](),controller[_0xc9a4('0x11')]);module['exports']=router; \ No newline at end of file +var _0xdb66=['express','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','util','connect-timeout'];(function(_0x295b2f,_0x526857){var _0x3b4fba=function(_0x2a8e9f){while(--_0x2a8e9f){_0x295b2f['push'](_0x295b2f['shift']());}};_0x3b4fba(++_0x526857);}(_0xdb66,0x10c));var _0x6db6=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xdb66[_0x24259d];return _0x5a701;};'use strict';var multer=require('multer');var util=require(_0x6db6('0x0'));var path=require('path');var timeout=require(_0x6db6('0x1'));var express=require(_0x6db6('0x2'));var router=express[_0x6db6('0x3')]();var auth=require(_0x6db6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6db6('0x5'));var controller=require('./openchannelQueueReport.controller');router[_0x6db6('0x6')]('/',auth['isAuthenticated'](),controller[_0x6db6('0x7')]);router[_0x6db6('0x6')](_0x6db6('0x8'),auth[_0x6db6('0x9')](),controller[_0x6db6('0xa')]);router[_0x6db6('0x6')](_0x6db6('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6db6('0xc')]('/',auth[_0x6db6('0x9')](),controller[_0x6db6('0xd')]);router[_0x6db6('0xe')]('/:id',auth[_0x6db6('0x9')](),controller[_0x6db6('0xf')]);router['delete'](_0x6db6('0xb'),auth[_0x6db6('0x9')](),controller[_0x6db6('0x10')]);module[_0x6db6('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a5258dc..3fafe05 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 _0xdd4d=['DATE','moment','sequelize','exports','STRING'];(function(_0x29db71,_0x306de1){var _0x2c8a07=function(_0x38f0f9){while(--_0x38f0f9){_0x29db71['push'](_0x29db71['shift']());}};_0x2c8a07(++_0x306de1);}(_0xdd4d,0x1be));var _0xddd4=function(_0x5de30c,_0x13f5f8){_0x5de30c=_0x5de30c-0x0;var _0x4e7ddc=_0xdd4d[_0x5de30c];return _0x4e7ddc;};'use strict';var moment=require(_0xddd4('0x0'));var Sequelize=require(_0xddd4('0x1'));module[_0xddd4('0x2')]={'uniqueid':{'type':Sequelize[_0xddd4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xddd4('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xddd4('0x4')]},'acceptAt':{'type':Sequelize[_0xddd4('0x4')]},'exitAt':{'type':Sequelize[_0xddd4('0x4')]},'reason':{'type':Sequelize[_0xddd4('0x3')]}}; \ No newline at end of file +var _0x5c0a=['exports','STRING','DATE','moment'];(function(_0x4eab11,_0x420bfb){var _0x417a63=function(_0x35f378){while(--_0x35f378){_0x4eab11['push'](_0x4eab11['shift']());}};_0x417a63(++_0x420bfb);}(_0x5c0a,0x6f));var _0xa5c0=function(_0x579042,_0x5a356f){_0x579042=_0x579042-0x0;var _0x3546af=_0x5c0a[_0x579042];return _0x3546af;};'use strict';var moment=require(_0xa5c0('0x0'));var Sequelize=require('sequelize');module[_0xa5c0('0x1')]={'uniqueid':{'type':Sequelize[_0xa5c0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa5c0('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa5c0('0x3')]},'exitAt':{'type':Sequelize[_0xa5c0('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 7678895..6ff7113 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 _0x1122=['query','filters','intersection','model','fields','attributes','length','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','status','apply','reject','save','update','then','destroy','error','stack','name','index','map','OpenchannelQueueReport','fieldName','type','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2112('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2112('0x1'));var zipdir=require(_0x2112('0x2'));var jsonpatch=require(_0x2112('0x3'));var rp=require(_0x2112('0x4'));var moment=require(_0x2112('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2112('0x6'));var path=require('path');var sox=require(_0x2112('0x7'));var csv=require(_0x2112('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2112('0x9'));var squel=require(_0x2112('0xa'));var crypto=require(_0x2112('0xb'));var jsforce=require(_0x2112('0xc'));var deskjs=require(_0x2112('0xd'));var toCsv=require(_0x2112('0x8'));var querystring=require(_0x2112('0xe'));var Papa=require(_0x2112('0xf'));var Redis=require(_0x2112('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2112('0x11'));var as=require(_0x2112('0x12'));var hardwareService=require(_0x2112('0x13'));var logger=require(_0x2112('0x14'))('api');var utils=require(_0x2112('0x15'));var config=require(_0x2112('0x16'));var db=require(_0x2112('0x17'))['db'];function respondWithStatusCode(_0x3ae3af,_0x450ef8){_0x450ef8=_0x450ef8||0xcc;return function(_0x15d062){if(_0x15d062){return _0x3ae3af[_0x2112('0x18')](_0x450ef8);}return _0x3ae3af['status'](_0x450ef8)[_0x2112('0x19')]();};}function respondWithResult(_0x4be0f8,_0x33e4c3){_0x33e4c3=_0x33e4c3||0xc8;return function(_0x1f76c2){if(_0x1f76c2){return _0x4be0f8['status'](_0x33e4c3)[_0x2112('0x1a')](_0x1f76c2);}};}function respondWithFilteredResult(_0x526fe7,_0x1d5afe){return function(_0x5e5e55){if(_0x5e5e55){var _0xc961a=_0x5e5e55['count'],_0xc1f5d1=_0x1d5afe[_0x2112('0x1b')],_0x4ff183=_0x1d5afe['offset']+_0x1d5afe['limit'],_0xd7fe31;if(_0x4ff183>=_0xc961a){_0x4ff183=_0xc961a;_0xd7fe31=0xc8;}else{_0xd7fe31=0xce;}_0x526fe7[_0x2112('0x1c')](_0xd7fe31);return _0x526fe7['set']('Content-Range',_0xc1f5d1+'-'+_0x4ff183+'/'+_0xc961a)[_0x2112('0x1a')](_0x5e5e55);}return null;};}function patchUpdates(_0x28d498){return function(_0x365df7){try{jsonpatch[_0x2112('0x1d')](_0x365df7,_0x28d498,!![]);}catch(_0xe613a3){return BPromise[_0x2112('0x1e')](_0xe613a3);}return _0x365df7[_0x2112('0x1f')]();};}function saveUpdates(_0x514d50,_0x5b7e84){return function(_0x154e10){if(_0x154e10){return _0x154e10[_0x2112('0x20')](_0x514d50)[_0x2112('0x21')](function(_0x5d901f){return _0x5d901f;});}return null;};}function removeEntity(_0x2bdde1,_0xd17981){return function(_0x2b5c50){if(_0x2b5c50){return _0x2b5c50[_0x2112('0x22')]()[_0x2112('0x21')](function(){_0x2bdde1[_0x2112('0x1c')](0xcc)[_0x2112('0x19')]();});}};}function handleEntityNotFound(_0x35a49a,_0x89db6d){return function(_0x51431d){if(!_0x51431d){_0x35a49a[_0x2112('0x18')](0x194);}return _0x51431d;};}function handleError(_0x1b94ff,_0x1eb6ae){_0x1eb6ae=_0x1eb6ae||0x1f4;return function(_0x2893bb){logger[_0x2112('0x23')](_0x2893bb[_0x2112('0x24')]);if(_0x2893bb[_0x2112('0x25')]){delete _0x2893bb[_0x2112('0x25')];}_0x1b94ff[_0x2112('0x1c')](_0x1eb6ae)['send'](_0x2893bb);};}exports[_0x2112('0x26')]=function(_0x41969f,_0x59ac26){var _0x3a6528={},_0x358dd9={},_0x5ba8e7={'count':0x0,'rows':[]};var _0x3f5317=_[_0x2112('0x27')](db[_0x2112('0x28')]['rawAttributes'],function(_0x19d559){return{'name':_0x19d559[_0x2112('0x29')],'type':_0x19d559[_0x2112('0x2a')]['key']};});_0x358dd9['model']=_['map'](_0x3f5317,_0x2112('0x25'));_0x358dd9['query']=_[_0x2112('0x2b')](_0x41969f[_0x2112('0x2c')]);_0x358dd9[_0x2112('0x2d')]=_[_0x2112('0x2e')](_0x358dd9[_0x2112('0x2f')],_0x358dd9[_0x2112('0x2c')]);_0x3a6528['attributes']=_['intersection'](_0x358dd9[_0x2112('0x2f')],qs[_0x2112('0x30')](_0x41969f[_0x2112('0x2c')]['fields']));_0x3a6528[_0x2112('0x31')]=_0x3a6528[_0x2112('0x31')][_0x2112('0x32')]?_0x3a6528[_0x2112('0x31')]:_0x358dd9['model'];if(!_0x41969f['query']['hasOwnProperty'](_0x2112('0x33'))){_0x3a6528['limit']=qs[_0x2112('0x34')](_0x41969f[_0x2112('0x2c')]['limit']);_0x3a6528[_0x2112('0x1b')]=qs['offset'](_0x41969f[_0x2112('0x2c')]['offset']);}_0x3a6528['order']=qs[_0x2112('0x35')](_0x41969f[_0x2112('0x2c')][_0x2112('0x35')]);_0x3a6528['where']=qs[_0x2112('0x2d')](_[_0x2112('0x36')](_0x41969f['query'],_0x358dd9[_0x2112('0x2d')]));if(_0x41969f[_0x2112('0x2c')][_0x2112('0x37')]){_0x3a6528[_0x2112('0x38')]=_[_0x2112('0x39')](_0x3a6528[_0x2112('0x38')],{'$or':_['map'](_0x3f5317,function(_0x520a17){if(_0x520a17['type']!==_0x2112('0x3a')){var _0xb5fd46={};_0xb5fd46[_0x520a17[_0x2112('0x25')]]={'$like':'%'+_0x41969f[_0x2112('0x2c')][_0x2112('0x37')]+'%'};return _0xb5fd46;}})});}_0x3a6528=_[_0x2112('0x39')]({},_0x3a6528,_0x41969f[_0x2112('0x3b')]);var _0x40bd78={'where':_0x3a6528[_0x2112('0x38')]};return db[_0x2112('0x28')][_0x2112('0x3c')](_0x40bd78)['then'](function(_0x10d49a){_0x5ba8e7[_0x2112('0x3c')]=_0x10d49a;if(_0x41969f[_0x2112('0x2c')][_0x2112('0x3d')]){_0x3a6528[_0x2112('0x3e')]=[{'all':!![]}];}return db[_0x2112('0x28')][_0x2112('0x3f')](_0x3a6528);})[_0x2112('0x21')](function(_0x2a149a){_0x5ba8e7['rows']=_0x2a149a;return _0x5ba8e7;})[_0x2112('0x21')](respondWithFilteredResult(_0x59ac26,_0x3a6528))[_0x2112('0x40')](handleError(_0x59ac26,null));};exports[_0x2112('0x41')]=function(_0x33f850,_0x405ad3){var _0x43d6c7={'raw':!![],'where':{'id':_0x33f850[_0x2112('0x42')]['id']}},_0x48aa23={};_0x48aa23[_0x2112('0x2f')]=_['keys'](db[_0x2112('0x28')][_0x2112('0x43')]);_0x48aa23[_0x2112('0x2c')]=_[_0x2112('0x2b')](_0x33f850[_0x2112('0x2c')]);_0x48aa23[_0x2112('0x2d')]=_['intersection'](_0x48aa23[_0x2112('0x2f')],_0x48aa23[_0x2112('0x2c')]);_0x43d6c7['attributes']=_[_0x2112('0x2e')](_0x48aa23[_0x2112('0x2f')],qs[_0x2112('0x30')](_0x33f850[_0x2112('0x2c')]['fields']));_0x43d6c7[_0x2112('0x31')]=_0x43d6c7[_0x2112('0x31')][_0x2112('0x32')]?_0x43d6c7[_0x2112('0x31')]:_0x48aa23[_0x2112('0x2f')];if(_0x33f850[_0x2112('0x2c')][_0x2112('0x3d')]){_0x43d6c7['include']=[{'all':!![]}];}_0x43d6c7=_[_0x2112('0x39')]({},_0x43d6c7,_0x33f850['options']);return db[_0x2112('0x28')]['find'](_0x43d6c7)[_0x2112('0x21')](handleEntityNotFound(_0x405ad3,null))[_0x2112('0x21')](respondWithResult(_0x405ad3,null))[_0x2112('0x40')](handleError(_0x405ad3,null));};exports[_0x2112('0x44')]=function(_0x1e4b29,_0xb920b7){return db[_0x2112('0x28')][_0x2112('0x44')](_0x1e4b29[_0x2112('0x45')],{})[_0x2112('0x21')](respondWithResult(_0xb920b7,0xc9))[_0x2112('0x40')](handleError(_0xb920b7,null));};exports[_0x2112('0x20')]=function(_0x52428e,_0xcc2955){if(_0x52428e[_0x2112('0x45')]['id']){delete _0x52428e['body']['id'];}return db[_0x2112('0x28')][_0x2112('0x46')]({'where':{'id':_0x52428e['params']['id']}})[_0x2112('0x21')](handleEntityNotFound(_0xcc2955,null))[_0x2112('0x21')](saveUpdates(_0x52428e[_0x2112('0x45')],null))[_0x2112('0x21')](respondWithResult(_0xcc2955,null))[_0x2112('0x40')](handleError(_0xcc2955,null));};exports['destroy']=function(_0x20aec5,_0x3e4548){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x20aec5[_0x2112('0x42')]['id']}})[_0x2112('0x21')](handleEntityNotFound(_0x3e4548,null))[_0x2112('0x21')](removeEntity(_0x3e4548,null))[_0x2112('0x40')](handleError(_0x3e4548,null));};exports[_0x2112('0x47')]=function(_0xf5a339,_0x2042e7){return db[_0x2112('0x28')]['describe']()['then'](respondWithResult(_0x2042e7,null))['catch'](handleError(_0x2042e7,null));}; \ No newline at end of file +var _0x8374=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','intersection','find','create','body','params','destroy','catch','describe','html-pdf','eml-format','rimraf'];(function(_0x37018d,_0x2ce605){var _0x454418=function(_0x29076e){while(--_0x29076e){_0x37018d['push'](_0x37018d['shift']());}};_0x454418(++_0x2ce605);}(_0x8374,0x174));var _0x4837=function(_0x221506,_0x41a804){_0x221506=_0x221506-0x0;var _0x28551b=_0x8374[_0x221506];return _0x28551b;};'use strict';var pdf=require(_0x4837('0x0'));var emlformat=require(_0x4837('0x1'));var rimraf=require(_0x4837('0x2'));var zipdir=require(_0x4837('0x3'));var jsonpatch=require(_0x4837('0x4'));var rp=require(_0x4837('0x5'));var moment=require(_0x4837('0x6'));var BPromise=require(_0x4837('0x7'));var Mustache=require(_0x4837('0x8'));var util=require(_0x4837('0x9'));var path=require(_0x4837('0xa'));var sox=require(_0x4837('0xb'));var csv=require(_0x4837('0xc'));var ejs=require(_0x4837('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4837('0xe'));var crypto=require('crypto');var jsforce=require(_0x4837('0xf'));var deskjs=require(_0x4837('0x10'));var toCsv=require(_0x4837('0xc'));var querystring=require(_0x4837('0x11'));var Papa=require(_0x4837('0x12'));var Redis=require(_0x4837('0x13'));var authService=require(_0x4837('0x14'));var qs=require(_0x4837('0x15'));var as=require(_0x4837('0x16'));var hardwareService=require(_0x4837('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x4837('0x18'));var config=require('../../config/environment');var db=require(_0x4837('0x19'))['db'];function respondWithStatusCode(_0x1a33ab,_0x5338cf){_0x5338cf=_0x5338cf||0xcc;return function(_0x55c6da){if(_0x55c6da){return _0x1a33ab['sendStatus'](_0x5338cf);}return _0x1a33ab[_0x4837('0x1a')](_0x5338cf)[_0x4837('0x1b')]();};}function respondWithResult(_0x1c01a9,_0x1a31d8){_0x1a31d8=_0x1a31d8||0xc8;return function(_0x4b18c5){if(_0x4b18c5){return _0x1c01a9[_0x4837('0x1a')](_0x1a31d8)[_0x4837('0x1c')](_0x4b18c5);}};}function respondWithFilteredResult(_0x39e5f6,_0x52a82c){return function(_0x1685ee){if(_0x1685ee){var _0xae4f01=_0x1685ee[_0x4837('0x1d')],_0x5d49b6=_0x52a82c[_0x4837('0x1e')],_0x216899=_0x52a82c[_0x4837('0x1e')]+_0x52a82c[_0x4837('0x1f')],_0x3a6cd1;if(_0x216899>=_0xae4f01){_0x216899=_0xae4f01;_0x3a6cd1=0xc8;}else{_0x3a6cd1=0xce;}_0x39e5f6['status'](_0x3a6cd1);return _0x39e5f6[_0x4837('0x20')](_0x4837('0x21'),_0x5d49b6+'-'+_0x216899+'/'+_0xae4f01)[_0x4837('0x1c')](_0x1685ee);}return null;};}function patchUpdates(_0x3c4d53){return function(_0x41f86c){try{jsonpatch[_0x4837('0x22')](_0x41f86c,_0x3c4d53,!![]);}catch(_0x3af7e0){return BPromise['reject'](_0x3af7e0);}return _0x41f86c['save']();};}function saveUpdates(_0xdb5a0d,_0x133e9d){return function(_0x36603e){if(_0x36603e){return _0x36603e[_0x4837('0x23')](_0xdb5a0d)['then'](function(_0x2c123c){return _0x2c123c;});}return null;};}function removeEntity(_0x595c3d,_0x208943){return function(_0x5f5631){if(_0x5f5631){return _0x5f5631['destroy']()[_0x4837('0x24')](function(){_0x595c3d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57d48a,_0x40bebd){return function(_0x2d820a){if(!_0x2d820a){_0x57d48a['sendStatus'](0x194);}return _0x2d820a;};}function handleError(_0x36b841,_0xa10b75){_0xa10b75=_0xa10b75||0x1f4;return function(_0x4c73a4){logger[_0x4837('0x25')](_0x4c73a4[_0x4837('0x26')]);if(_0x4c73a4['name']){delete _0x4c73a4[_0x4837('0x27')];}_0x36b841[_0x4837('0x1a')](_0xa10b75)[_0x4837('0x28')](_0x4c73a4);};}exports[_0x4837('0x29')]=function(_0x2b2e48,_0x5c07db){var _0x2a7dfd={},_0x153bc7={},_0x39b61b={'count':0x0,'rows':[]};var _0x314bee=_[_0x4837('0x2a')](db[_0x4837('0x2b')][_0x4837('0x2c')],function(_0x107a5f){return{'name':_0x107a5f['fieldName'],'type':_0x107a5f[_0x4837('0x2d')][_0x4837('0x2e')]};});_0x153bc7[_0x4837('0x2f')]=_[_0x4837('0x2a')](_0x314bee,_0x4837('0x27'));_0x153bc7[_0x4837('0x30')]=_[_0x4837('0x31')](_0x2b2e48[_0x4837('0x30')]);_0x153bc7[_0x4837('0x32')]=_['intersection'](_0x153bc7[_0x4837('0x2f')],_0x153bc7['query']);_0x2a7dfd[_0x4837('0x33')]=_['intersection'](_0x153bc7[_0x4837('0x2f')],qs[_0x4837('0x34')](_0x2b2e48[_0x4837('0x30')]['fields']));_0x2a7dfd['attributes']=_0x2a7dfd[_0x4837('0x33')][_0x4837('0x35')]?_0x2a7dfd[_0x4837('0x33')]:_0x153bc7[_0x4837('0x2f')];if(!_0x2b2e48[_0x4837('0x30')]['hasOwnProperty'](_0x4837('0x36'))){_0x2a7dfd[_0x4837('0x1f')]=qs['limit'](_0x2b2e48[_0x4837('0x30')]['limit']);_0x2a7dfd[_0x4837('0x1e')]=qs['offset'](_0x2b2e48['query'][_0x4837('0x1e')]);}_0x2a7dfd[_0x4837('0x37')]=qs[_0x4837('0x38')](_0x2b2e48['query'][_0x4837('0x38')]);_0x2a7dfd[_0x4837('0x39')]=qs['filters'](_[_0x4837('0x3a')](_0x2b2e48['query'],_0x153bc7[_0x4837('0x32')]));if(_0x2b2e48[_0x4837('0x30')][_0x4837('0x3b')]){_0x2a7dfd[_0x4837('0x39')]=_['merge'](_0x2a7dfd[_0x4837('0x39')],{'$or':_[_0x4837('0x2a')](_0x314bee,function(_0x33a455){if(_0x33a455[_0x4837('0x2d')]!==_0x4837('0x3c')){var _0x12af2a={};_0x12af2a[_0x33a455['name']]={'$like':'%'+_0x2b2e48[_0x4837('0x30')]['filter']+'%'};return _0x12af2a;}})});}_0x2a7dfd=_[_0x4837('0x3d')]({},_0x2a7dfd,_0x2b2e48[_0x4837('0x3e')]);var _0x5dcc13={'where':_0x2a7dfd['where']};return db[_0x4837('0x2b')][_0x4837('0x1d')](_0x5dcc13)[_0x4837('0x24')](function(_0x24c14a){_0x39b61b[_0x4837('0x1d')]=_0x24c14a;if(_0x2b2e48[_0x4837('0x30')][_0x4837('0x3f')]){_0x2a7dfd[_0x4837('0x40')]=[{'all':!![]}];}return db[_0x4837('0x2b')][_0x4837('0x41')](_0x2a7dfd);})[_0x4837('0x24')](function(_0x1f7cf3){_0x39b61b[_0x4837('0x42')]=_0x1f7cf3;return _0x39b61b;})[_0x4837('0x24')](respondWithFilteredResult(_0x5c07db,_0x2a7dfd))['catch'](handleError(_0x5c07db,null));};exports['show']=function(_0x346fe8,_0x10d3d0){var _0x4d2b7e={'raw':!![],'where':{'id':_0x346fe8['params']['id']}},_0x5eeb09={};_0x5eeb09['model']=_[_0x4837('0x31')](db['OpenchannelQueueReport']['rawAttributes']);_0x5eeb09[_0x4837('0x30')]=_[_0x4837('0x31')](_0x346fe8[_0x4837('0x30')]);_0x5eeb09['filters']=_[_0x4837('0x43')](_0x5eeb09[_0x4837('0x2f')],_0x5eeb09['query']);_0x4d2b7e[_0x4837('0x33')]=_[_0x4837('0x43')](_0x5eeb09[_0x4837('0x2f')],qs[_0x4837('0x34')](_0x346fe8[_0x4837('0x30')][_0x4837('0x34')]));_0x4d2b7e[_0x4837('0x33')]=_0x4d2b7e[_0x4837('0x33')][_0x4837('0x35')]?_0x4d2b7e[_0x4837('0x33')]:_0x5eeb09[_0x4837('0x2f')];if(_0x346fe8[_0x4837('0x30')][_0x4837('0x3f')]){_0x4d2b7e[_0x4837('0x40')]=[{'all':!![]}];}_0x4d2b7e=_[_0x4837('0x3d')]({},_0x4d2b7e,_0x346fe8['options']);return db[_0x4837('0x2b')][_0x4837('0x44')](_0x4d2b7e)[_0x4837('0x24')](handleEntityNotFound(_0x10d3d0,null))[_0x4837('0x24')](respondWithResult(_0x10d3d0,null))['catch'](handleError(_0x10d3d0,null));};exports[_0x4837('0x45')]=function(_0x3f2995,_0x5b59d0){return db['OpenchannelQueueReport'][_0x4837('0x45')](_0x3f2995[_0x4837('0x46')],{})[_0x4837('0x24')](respondWithResult(_0x5b59d0,0xc9))['catch'](handleError(_0x5b59d0,null));};exports[_0x4837('0x23')]=function(_0x130441,_0x1e0b10){if(_0x130441[_0x4837('0x46')]['id']){delete _0x130441[_0x4837('0x46')]['id'];}return db[_0x4837('0x2b')][_0x4837('0x44')]({'where':{'id':_0x130441[_0x4837('0x47')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x1e0b10,null))['then'](saveUpdates(_0x130441['body'],null))[_0x4837('0x24')](respondWithResult(_0x1e0b10,null))['catch'](handleError(_0x1e0b10,null));};exports[_0x4837('0x48')]=function(_0x3a7a09,_0x3072fb){return db[_0x4837('0x2b')][_0x4837('0x44')]({'where':{'id':_0x3a7a09[_0x4837('0x47')]['id']}})['then'](handleEntityNotFound(_0x3072fb,null))[_0x4837('0x24')](removeEntity(_0x3072fb,null))[_0x4837('0x49')](handleError(_0x3072fb,null));};exports[_0x4837('0x4a')]=function(_0xb0517a,_0x4b2782){return db[_0x4837('0x2b')][_0x4837('0x4a')]()[_0x4837('0x24')](respondWithResult(_0x4b2782,null))[_0x4837('0x49')](handleError(_0x4b2782,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index cf79cfc..67367c6 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 _0x28a0=['api','moment','request-promise','./openchannelQueueReport.attributes','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','../../config/logger'];(function(_0x5d58ff,_0x893d00){var _0x22c12e=function(_0x588109){while(--_0x588109){_0x5d58ff['push'](_0x5d58ff['shift']());}};_0x22c12e(++_0x893d00);}(_0x28a0,0x8a));var _0x028a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x28a0[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x028a('0x0'));var util=require('util');var logger=require(_0x028a('0x1'))(_0x028a('0x2'));var moment=require(_0x028a('0x3'));var BPromise=require('bluebird');var rp=require(_0x028a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x028a('0x5'));module['exports']=function(_0x132a95,_0x43e0e5){return _0x132a95[_0x028a('0x6')](_0x028a('0x7'),attributes,{'tableName':_0x028a('0x8'),'paranoid':![],'indexes':[{'name':_0x028a('0x9'),'fields':[_0x028a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e0f=['bluebird','request-promise','rimraf','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x50c499,_0x381c57){_0x50c499=_0x50c499-0x0;var _0x7fe7c1=_0x8e0f[_0x50c499];return _0x7fe7c1;};'use strict';var _=require(_0xf8e0('0x0'));var util=require(_0xf8e0('0x1'));var logger=require(_0xf8e0('0x2'))(_0xf8e0('0x3'));var moment=require(_0xf8e0('0x4'));var BPromise=require(_0xf8e0('0x5'));var rp=require(_0xf8e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e0('0x7'));var config=require('../../config/environment');var attributes=require(_0xf8e0('0x8'));module[_0xf8e0('0x9')]=function(_0x4f3b30,_0x2921b3){return _0x4f3b30[_0xf8e0('0xa')](_0xf8e0('0xb'),attributes,{'tableName':_0xf8e0('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf8e0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 2bd6e80..30161d3 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 _0xb7f0=['info','result','catch','CreateOpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message'];(function(_0x2afccc,_0x443a1a){var _0x485666=function(_0x3ce6a8){while(--_0x3ce6a8){_0x2afccc['push'](_0x2afccc['shift']());}};_0x485666(++_0x443a1a);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x5677b1,_0x4cfe89){_0x5677b1=_0x5677b1-0x0;var _0x3324e5=_0xb7f0[_0x5677b1];return _0x3324e5;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var moment=require(_0x0b7f('0x2'));var BPromise=require(_0x0b7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b7f('0x4'))['db'];var utils=require(_0x0b7f('0x5'));var logger=require(_0x0b7f('0x6'))(_0x0b7f('0x7'));var config=require(_0x0b7f('0x8'));var jayson=require(_0x0b7f('0x9'));var client=jayson[_0x0b7f('0xa')][_0x0b7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10dc6c,_0x36ff5c,_0x53f9a5){return new BPromise(function(_0x98065a,_0x65287){return client['request'](_0x10dc6c,_0x53f9a5)[_0x0b7f('0xc')](function(_0x3b44bd){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x36ff5c,'request\x20sent');logger[_0x0b7f('0xd')](_0x0b7f('0xe'),_0x36ff5c,_0x0b7f('0xf'),JSON[_0x0b7f('0x10')](_0x3b44bd));if(_0x3b44bd[_0x0b7f('0x11')]){if(_0x3b44bd[_0x0b7f('0x11')][_0x0b7f('0x12')]===0x1f4){logger[_0x0b7f('0x11')](_0x0b7f('0x13'),_0x36ff5c,_0x3b44bd[_0x0b7f('0x11')][_0x0b7f('0x14')]);return _0x65287(_0x3b44bd['error'][_0x0b7f('0x14')]);}logger[_0x0b7f('0x11')](_0x0b7f('0x13'),_0x36ff5c,_0x3b44bd[_0x0b7f('0x11')][_0x0b7f('0x14')]);return _0x98065a(_0x3b44bd[_0x0b7f('0x11')][_0x0b7f('0x14')]);}else{logger[_0x0b7f('0x15')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x36ff5c,_0x0b7f('0xf'));_0x98065a(_0x3b44bd[_0x0b7f('0x16')][_0x0b7f('0x14')]);}})[_0x0b7f('0x17')](function(_0x58c901){logger[_0x0b7f('0x11')](_0x0b7f('0x13'),_0x36ff5c,_0x58c901);_0x65287(_0x58c901);});});}exports[_0x0b7f('0x18')]=function(_0x168e7e){var _0x166520=this;return new Promise(function(_0x50cee2,_0x4545aa){return db['OpenchannelQueueReport']['create'](_0x168e7e[_0x0b7f('0x19')],{'raw':_0x168e7e[_0x0b7f('0x1a')]?_0x168e7e[_0x0b7f('0x1a')][_0x0b7f('0x1b')]===undefined?!![]:![]:!![]})[_0x0b7f('0xc')](function(_0x52abc6){logger['info'](_0x0b7f('0x18'),_0x168e7e);logger[_0x0b7f('0xd')](_0x0b7f('0x18'),_0x168e7e,JSON['stringify'](_0x52abc6));_0x50cee2(_0x52abc6);})[_0x0b7f('0x17')](function(_0x1ec1d3){logger[_0x0b7f('0x11')](_0x0b7f('0x18'),_0x1ec1d3[_0x0b7f('0x14')],_0x168e7e);_0x4545aa(_0x166520[_0x0b7f('0x11')](0x1f4,_0x1ec1d3[_0x0b7f('0x14')]));});});};exports[_0x0b7f('0x1c')]=function(_0xc74a5d){var _0x4c9237=this;return new Promise(function(_0x1ad2f4,_0x2ce9fa){return db['OpenchannelQueueReport']['update'](_0xc74a5d['body'],{'raw':_0xc74a5d[_0x0b7f('0x1a')]?_0xc74a5d[_0x0b7f('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc74a5d[_0x0b7f('0x1a')]?_0xc74a5d[_0x0b7f('0x1a')][_0x0b7f('0x1d')]||null:null,'attributes':_0xc74a5d[_0x0b7f('0x1a')]?_0xc74a5d[_0x0b7f('0x1a')][_0x0b7f('0x1e')]||null:null,'limit':_0xc74a5d[_0x0b7f('0x1a')]?_0xc74a5d[_0x0b7f('0x1a')][_0x0b7f('0x1f')]||null:null})['then'](function(_0x599bae){logger['info'](_0x0b7f('0x1c'),_0xc74a5d);logger['debug'](_0x0b7f('0x1c'),_0xc74a5d,JSON[_0x0b7f('0x10')](_0x599bae));_0x1ad2f4(_0x599bae);})[_0x0b7f('0x17')](function(_0xe06fa9){logger[_0x0b7f('0x11')](_0x0b7f('0x1c'),_0xe06fa9[_0x0b7f('0x14')],_0xc74a5d);_0x2ce9fa(_0x4c9237['error'](0x1f4,_0xe06fa9['message']));});});}; \ No newline at end of file +var _0xdf55=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelQueueReport','create','options','raw','debug','stringify','body','where','attributes','limit','UpdateOpenchannelQueueReport','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdf55,0x83));var _0x5df5=function(_0x4bb5d5,_0xdbdf58){_0x4bb5d5=_0x4bb5d5-0x0;var _0x7b0473=_0xdf55[_0x4bb5d5];return _0x7b0473;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});}exports[_0x5df5('0x16')]=function(_0xb7e1c2){var _0x44f700=this;return new Promise(function(_0x215d59,_0x4b499d){return db['OpenchannelQueueReport'][_0x5df5('0x17')](_0xb7e1c2['body'],{'raw':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x19')]===undefined?!![]:![]:!![]})[_0x5df5('0xc')](function(_0x1deae7){logger['info'](_0x5df5('0x16'),_0xb7e1c2);logger[_0x5df5('0x1a')](_0x5df5('0x16'),_0xb7e1c2,JSON[_0x5df5('0x1b')](_0x1deae7));_0x215d59(_0x1deae7);})[_0x5df5('0x15')](function(_0x382999){logger['error'](_0x5df5('0x16'),_0x382999[_0x5df5('0x12')],_0xb7e1c2);_0x4b499d(_0x44f700[_0x5df5('0xf')](0x1f4,_0x382999[_0x5df5('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x4358ba){var _0x13369c=this;return new Promise(function(_0x395f3e,_0x4a544b){return db['OpenchannelQueueReport']['update'](_0x4358ba[_0x5df5('0x1c')],{'raw':_0x4358ba[_0x5df5('0x18')]?_0x4358ba[_0x5df5('0x18')][_0x5df5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4358ba[_0x5df5('0x18')]?_0x4358ba[_0x5df5('0x18')][_0x5df5('0x1d')]||null:null,'attributes':_0x4358ba[_0x5df5('0x18')]?_0x4358ba['options'][_0x5df5('0x1e')]||null:null,'limit':_0x4358ba['options']?_0x4358ba[_0x5df5('0x18')][_0x5df5('0x1f')]||null:null})['then'](function(_0x3854d0){logger['info'](_0x5df5('0x20'),_0x4358ba);logger['debug'](_0x5df5('0x20'),_0x4358ba,JSON['stringify'](_0x3854d0));_0x395f3e(_0x3854d0);})[_0x5df5('0x15')](function(_0x5793f5){logger[_0x5df5('0xf')](_0x5df5('0x20'),_0x5793f5[_0x5df5('0x12')],_0x4358ba);_0x4a544b(_0x13369c['error'](0x1f4,_0x5793f5[_0x5df5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 65590f2..deb80c9 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2bf888,_0x374f0b){var _0x3038d6=function(_0xe1b6d9){while(--_0xe1b6d9){_0x2bf888['push'](_0x2bf888['shift']());}};_0x3038d6(++_0x374f0b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_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['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b2e751c..be89df4 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 _0x53f8=['ENUM','account','agent','queue','DATE','NOW','exports'];(function(_0x3322d0,_0x13842a){var _0x4f3af8=function(_0x2b568d){while(--_0x2b568d){_0x3322d0['push'](_0x3322d0['shift']());}};_0x4f3af8(++_0x13842a);}(_0x53f8,0x1d4));var _0x853f=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x53f8[_0x160c73];return _0xd9302;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x853f('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x853f('0x1')](_0x853f('0x2'),_0x853f('0x3'),'queue'),'allowNull':![],'defaultValue':_0x853f('0x4')},'transferredAt':{'type':Sequelize[_0x853f('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x853f('0x6')]}}; \ No newline at end of file +var _0x2762=['STRING','ENUM','account','agent','queue','DATE','moment','exports'];(function(_0x5d6006,_0x4381c1){var _0x32ce15=function(_0x573cb2){while(--_0x573cb2){_0x5d6006['push'](_0x5d6006['shift']());}};_0x32ce15(++_0x4381c1);}(_0x2762,0x1de));var _0x2276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2762[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x2276('0x0'));var Sequelize=require('sequelize');module[_0x2276('0x1')]={'uniqueid':{'type':Sequelize[_0x2276('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2276('0x3')](_0x2276('0x4'),_0x2276('0x5'),_0x2276('0x6')),'allowNull':![],'defaultValue':_0x2276('0x6')},'transferredAt':{'type':Sequelize[_0x2276('0x7')],'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 ca539ce..68baea2 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 _0x5365=['error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','VIRTUAL','filter','merge','include','rows','catch','show','includeAll','options','create','body','update','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','then','destroy'];(function(_0x2e69f3,_0x10931c){var _0x359e51=function(_0x5a52a4){while(--_0x5a52a4){_0x2e69f3['push'](_0x2e69f3['shift']());}};_0x359e51(++_0x10931c);}(_0x5365,0x187));var _0x5536=function(_0x226390,_0x1ae1f6){_0x226390=_0x226390-0x0;var _0x7aba2e=_0x5365[_0x226390];return _0x7aba2e;};'use strict';var pdf=require(_0x5536('0x0'));var emlformat=require(_0x5536('0x1'));var rimraf=require(_0x5536('0x2'));var zipdir=require(_0x5536('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5536('0x4'));var path=require(_0x5536('0x5'));var sox=require(_0x5536('0x6'));var csv=require(_0x5536('0x7'));var ejs=require(_0x5536('0x8'));var fs=require('fs');var _=require(_0x5536('0x9'));var squel=require('squel');var crypto=require(_0x5536('0xa'));var jsforce=require(_0x5536('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5536('0xc'));var Papa=require(_0x5536('0xd'));var Redis=require(_0x5536('0xe'));var authService=require(_0x5536('0xf'));var qs=require(_0x5536('0x10'));var as=require(_0x5536('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5536('0x12'))(_0x5536('0x13'));var utils=require(_0x5536('0x14'));var config=require(_0x5536('0x15'));var db=require(_0x5536('0x16'))['db'];function respondWithStatusCode(_0x255b34,_0x5e4747){_0x5e4747=_0x5e4747||0xcc;return function(_0x30daf2){if(_0x30daf2){return _0x255b34[_0x5536('0x17')](_0x5e4747);}return _0x255b34[_0x5536('0x18')](_0x5e4747)[_0x5536('0x19')]();};}function respondWithResult(_0x14cd08,_0x320b1d){_0x320b1d=_0x320b1d||0xc8;return function(_0x4da9de){if(_0x4da9de){return _0x14cd08[_0x5536('0x18')](_0x320b1d)[_0x5536('0x1a')](_0x4da9de);}};}function respondWithFilteredResult(_0xf105de,_0x171d0b){return function(_0x2b5728){if(_0x2b5728){var _0x2a5bf7=_0x2b5728[_0x5536('0x1b')],_0x300122=_0x171d0b[_0x5536('0x1c')],_0xc0813b=_0x171d0b['offset']+_0x171d0b['limit'],_0x34b1d5;if(_0xc0813b>=_0x2a5bf7){_0xc0813b=_0x2a5bf7;_0x34b1d5=0xc8;}else{_0x34b1d5=0xce;}_0xf105de[_0x5536('0x18')](_0x34b1d5);return _0xf105de[_0x5536('0x1d')](_0x5536('0x1e'),_0x300122+'-'+_0xc0813b+'/'+_0x2a5bf7)[_0x5536('0x1a')](_0x2b5728);}return null;};}function patchUpdates(_0x5cb432){return function(_0xb0f690){try{jsonpatch[_0x5536('0x1f')](_0xb0f690,_0x5cb432,!![]);}catch(_0x374d32){return BPromise[_0x5536('0x20')](_0x374d32);}return _0xb0f690['save']();};}function saveUpdates(_0x59d961,_0x5656e8){return function(_0x36a1c0){if(_0x36a1c0){return _0x36a1c0['update'](_0x59d961)[_0x5536('0x21')](function(_0x244d85){return _0x244d85;});}return null;};}function removeEntity(_0x4110f7,_0x1bc66b){return function(_0x29b692){if(_0x29b692){return _0x29b692[_0x5536('0x22')]()['then'](function(){_0x4110f7['status'](0xcc)[_0x5536('0x19')]();});}};}function handleEntityNotFound(_0x30bf76,_0x41345b){return function(_0x50ca0d){if(!_0x50ca0d){_0x30bf76[_0x5536('0x17')](0x194);}return _0x50ca0d;};}function handleError(_0x18280e,_0x2ff241){_0x2ff241=_0x2ff241||0x1f4;return function(_0x3d1ddb){logger[_0x5536('0x23')](_0x3d1ddb[_0x5536('0x24')]);if(_0x3d1ddb[_0x5536('0x25')]){delete _0x3d1ddb['name'];}_0x18280e[_0x5536('0x18')](_0x2ff241)[_0x5536('0x26')](_0x3d1ddb);};}exports['index']=function(_0x2c41af,_0x1a15c2){var _0x25721f={},_0x14c18a={},_0x70c223={'count':0x0,'rows':[]};var _0x596090=_[_0x5536('0x27')](db[_0x5536('0x28')][_0x5536('0x29')],function(_0x1acccb){return{'name':_0x1acccb['fieldName'],'type':_0x1acccb[_0x5536('0x2a')]['key']};});_0x14c18a['model']=_[_0x5536('0x27')](_0x596090,_0x5536('0x25'));_0x14c18a[_0x5536('0x2b')]=_[_0x5536('0x2c')](_0x2c41af[_0x5536('0x2b')]);_0x14c18a[_0x5536('0x2d')]=_[_0x5536('0x2e')](_0x14c18a[_0x5536('0x2f')],_0x14c18a[_0x5536('0x2b')]);_0x25721f['attributes']=_[_0x5536('0x2e')](_0x14c18a[_0x5536('0x2f')],qs[_0x5536('0x30')](_0x2c41af[_0x5536('0x2b')][_0x5536('0x30')]));_0x25721f['attributes']=_0x25721f[_0x5536('0x31')][_0x5536('0x32')]?_0x25721f[_0x5536('0x31')]:_0x14c18a[_0x5536('0x2f')];if(!_0x2c41af[_0x5536('0x2b')][_0x5536('0x33')]('nolimit')){_0x25721f[_0x5536('0x34')]=qs[_0x5536('0x34')](_0x2c41af['query']['limit']);_0x25721f['offset']=qs[_0x5536('0x1c')](_0x2c41af[_0x5536('0x2b')]['offset']);}_0x25721f['order']=qs[_0x5536('0x35')](_0x2c41af[_0x5536('0x2b')][_0x5536('0x35')]);_0x25721f[_0x5536('0x36')]=qs[_0x5536('0x2d')](_[_0x5536('0x37')](_0x2c41af['query'],_0x14c18a[_0x5536('0x2d')]));if(_0x2c41af['query']['filter']){_0x25721f[_0x5536('0x36')]=_['merge'](_0x25721f[_0x5536('0x36')],{'$or':_[_0x5536('0x27')](_0x596090,function(_0x19f8dd){if(_0x19f8dd[_0x5536('0x2a')]!==_0x5536('0x38')){var _0x234f8a={};_0x234f8a[_0x19f8dd[_0x5536('0x25')]]={'$like':'%'+_0x2c41af[_0x5536('0x2b')][_0x5536('0x39')]+'%'};return _0x234f8a;}})});}_0x25721f=_[_0x5536('0x3a')]({},_0x25721f,_0x2c41af['options']);var _0x27957e={'where':_0x25721f[_0x5536('0x36')]};return db[_0x5536('0x28')][_0x5536('0x1b')](_0x27957e)[_0x5536('0x21')](function(_0x52cf51){_0x70c223[_0x5536('0x1b')]=_0x52cf51;if(_0x2c41af[_0x5536('0x2b')]['includeAll']){_0x25721f[_0x5536('0x3b')]=[{'all':!![]}];}return db[_0x5536('0x28')]['findAll'](_0x25721f);})[_0x5536('0x21')](function(_0x488c0d){_0x70c223[_0x5536('0x3c')]=_0x488c0d;return _0x70c223;})['then'](respondWithFilteredResult(_0x1a15c2,_0x25721f))[_0x5536('0x3d')](handleError(_0x1a15c2,null));};exports[_0x5536('0x3e')]=function(_0x472842,_0x4b028){var _0xc3b129={'raw':!![],'where':{'id':_0x472842['params']['id']}},_0x4814ec={};_0x4814ec[_0x5536('0x2f')]=_['keys'](db[_0x5536('0x28')][_0x5536('0x29')]);_0x4814ec['query']=_[_0x5536('0x2c')](_0x472842[_0x5536('0x2b')]);_0x4814ec[_0x5536('0x2d')]=_[_0x5536('0x2e')](_0x4814ec[_0x5536('0x2f')],_0x4814ec[_0x5536('0x2b')]);_0xc3b129['attributes']=_['intersection'](_0x4814ec[_0x5536('0x2f')],qs[_0x5536('0x30')](_0x472842[_0x5536('0x2b')][_0x5536('0x30')]));_0xc3b129[_0x5536('0x31')]=_0xc3b129[_0x5536('0x31')][_0x5536('0x32')]?_0xc3b129[_0x5536('0x31')]:_0x4814ec['model'];if(_0x472842[_0x5536('0x2b')][_0x5536('0x3f')]){_0xc3b129[_0x5536('0x3b')]=[{'all':!![]}];}_0xc3b129=_[_0x5536('0x3a')]({},_0xc3b129,_0x472842[_0x5536('0x40')]);return db[_0x5536('0x28')]['find'](_0xc3b129)[_0x5536('0x21')](handleEntityNotFound(_0x4b028,null))[_0x5536('0x21')](respondWithResult(_0x4b028,null))[_0x5536('0x3d')](handleError(_0x4b028,null));};exports['create']=function(_0x2917ce,_0x24de0b){return db[_0x5536('0x28')][_0x5536('0x41')](_0x2917ce[_0x5536('0x42')],{})[_0x5536('0x21')](respondWithResult(_0x24de0b,0xc9))['catch'](handleError(_0x24de0b,null));};exports[_0x5536('0x43')]=function(_0x524dcc,_0x75ae2c){if(_0x524dcc[_0x5536('0x42')]['id']){delete _0x524dcc['body']['id'];}return db['OpenchannelTransferReport'][_0x5536('0x44')]({'where':{'id':_0x524dcc[_0x5536('0x45')]['id']}})[_0x5536('0x21')](handleEntityNotFound(_0x75ae2c,null))['then'](saveUpdates(_0x524dcc[_0x5536('0x42')],null))[_0x5536('0x21')](respondWithResult(_0x75ae2c,null))['catch'](handleError(_0x75ae2c,null));};exports['destroy']=function(_0x538915,_0x29d681){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x538915['params']['id']}})['then'](handleEntityNotFound(_0x29d681,null))['then'](removeEntity(_0x29d681,null))[_0x5536('0x3d')](handleError(_0x29d681,null));};exports[_0x5536('0x46')]=function(_0x2d7497,_0x5e7e32){return db[_0x5536('0x28')][_0x5536('0x46')]()[_0x5536('0x21')](respondWithResult(_0x5e7e32,null))[_0x5536('0x3d')](handleError(_0x5e7e32,null));}; \ No newline at end of file +var _0x8615=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','length','options','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','save','update','then','end','sendStatus','error','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','map'];(function(_0x3d5449,_0x52095e){var _0x4a7e94=function(_0x4238fa){while(--_0x4238fa){_0x3d5449['push'](_0x3d5449['shift']());}};_0x4a7e94(++_0x52095e);}(_0x8615,0xae));var _0x5861=function(_0x2d44e2,_0x3c31b2){_0x2d44e2=_0x2d44e2-0x0;var _0x45d176=_0x8615[_0x2d44e2];return _0x45d176;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5861('0x0'));var rimraf=require(_0x5861('0x1'));var zipdir=require(_0x5861('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5861('0x3'));var moment=require(_0x5861('0x4'));var BPromise=require(_0x5861('0x5'));var Mustache=require(_0x5861('0x6'));var util=require(_0x5861('0x7'));var path=require(_0x5861('0x8'));var sox=require(_0x5861('0x9'));var csv=require('to-csv');var ejs=require(_0x5861('0xa'));var fs=require('fs');var _=require(_0x5861('0xb'));var squel=require(_0x5861('0xc'));var crypto=require(_0x5861('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5861('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5861('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5861('0x10'));var hardwareService=require(_0x5861('0x11'));var logger=require(_0x5861('0x12'))(_0x5861('0x13'));var utils=require(_0x5861('0x14'));var config=require(_0x5861('0x15'));var db=require(_0x5861('0x16'))['db'];function respondWithStatusCode(_0xc57630,_0x26a446){_0x26a446=_0x26a446||0xcc;return function(_0x2f44b7){if(_0x2f44b7){return _0xc57630['sendStatus'](_0x26a446);}return _0xc57630['status'](_0x26a446)['end']();};}function respondWithResult(_0x164794,_0x5067b1){_0x5067b1=_0x5067b1||0xc8;return function(_0x50a7e7){if(_0x50a7e7){return _0x164794[_0x5861('0x17')](_0x5067b1)[_0x5861('0x18')](_0x50a7e7);}};}function respondWithFilteredResult(_0x2e0c42,_0x4653cf){return function(_0x56c679){if(_0x56c679){var _0x57f4c9=_0x56c679[_0x5861('0x19')],_0x400011=_0x4653cf['offset'],_0x366ede=_0x4653cf[_0x5861('0x1a')]+_0x4653cf[_0x5861('0x1b')],_0x20a157;if(_0x366ede>=_0x57f4c9){_0x366ede=_0x57f4c9;_0x20a157=0xc8;}else{_0x20a157=0xce;}_0x2e0c42['status'](_0x20a157);return _0x2e0c42[_0x5861('0x1c')]('Content-Range',_0x400011+'-'+_0x366ede+'/'+_0x57f4c9)[_0x5861('0x18')](_0x56c679);}return null;};}function patchUpdates(_0x2100fc){return function(_0x3b9998){try{jsonpatch['apply'](_0x3b9998,_0x2100fc,!![]);}catch(_0x1e37b4){return BPromise['reject'](_0x1e37b4);}return _0x3b9998[_0x5861('0x1d')]();};}function saveUpdates(_0x575007,_0x22cf86){return function(_0x513213){if(_0x513213){return _0x513213[_0x5861('0x1e')](_0x575007)[_0x5861('0x1f')](function(_0x17c6f9){return _0x17c6f9;});}return null;};}function removeEntity(_0x3433b4,_0x16b8eb){return function(_0x19dedc){if(_0x19dedc){return _0x19dedc['destroy']()[_0x5861('0x1f')](function(){_0x3433b4['status'](0xcc)[_0x5861('0x20')]();});}};}function handleEntityNotFound(_0x4b05df,_0x24862d){return function(_0xed056c){if(!_0xed056c){_0x4b05df[_0x5861('0x21')](0x194);}return _0xed056c;};}function handleError(_0x457d44,_0x2cf92e){_0x2cf92e=_0x2cf92e||0x1f4;return function(_0x5eaad6){logger[_0x5861('0x22')](_0x5eaad6['stack']);if(_0x5eaad6[_0x5861('0x23')]){delete _0x5eaad6[_0x5861('0x23')];}_0x457d44[_0x5861('0x17')](_0x2cf92e)[_0x5861('0x24')](_0x5eaad6);};}exports[_0x5861('0x25')]=function(_0x2203ba,_0x3206b2){var _0x19f050={},_0x3ba1d3={},_0x3a231b={'count':0x0,'rows':[]};var _0xf59637=_['map'](db[_0x5861('0x26')][_0x5861('0x27')],function(_0x81ba1){return{'name':_0x81ba1[_0x5861('0x28')],'type':_0x81ba1[_0x5861('0x29')][_0x5861('0x2a')]};});_0x3ba1d3[_0x5861('0x2b')]=_[_0x5861('0x2c')](_0xf59637,_0x5861('0x23'));_0x3ba1d3[_0x5861('0x2d')]=_['keys'](_0x2203ba[_0x5861('0x2d')]);_0x3ba1d3[_0x5861('0x2e')]=_[_0x5861('0x2f')](_0x3ba1d3[_0x5861('0x2b')],_0x3ba1d3[_0x5861('0x2d')]);_0x19f050[_0x5861('0x30')]=_['intersection'](_0x3ba1d3[_0x5861('0x2b')],qs[_0x5861('0x31')](_0x2203ba['query'][_0x5861('0x31')]));_0x19f050[_0x5861('0x30')]=_0x19f050[_0x5861('0x30')]['length']?_0x19f050[_0x5861('0x30')]:_0x3ba1d3[_0x5861('0x2b')];if(!_0x2203ba[_0x5861('0x2d')][_0x5861('0x32')](_0x5861('0x33'))){_0x19f050[_0x5861('0x1b')]=qs[_0x5861('0x1b')](_0x2203ba[_0x5861('0x2d')]['limit']);_0x19f050[_0x5861('0x1a')]=qs['offset'](_0x2203ba[_0x5861('0x2d')]['offset']);}_0x19f050['order']=qs[_0x5861('0x34')](_0x2203ba['query'][_0x5861('0x34')]);_0x19f050[_0x5861('0x35')]=qs[_0x5861('0x2e')](_[_0x5861('0x36')](_0x2203ba[_0x5861('0x2d')],_0x3ba1d3['filters']));if(_0x2203ba[_0x5861('0x2d')][_0x5861('0x37')]){_0x19f050[_0x5861('0x35')]=_[_0x5861('0x38')](_0x19f050[_0x5861('0x35')],{'$or':_[_0x5861('0x2c')](_0xf59637,function(_0x27064f){if(_0x27064f[_0x5861('0x29')]!==_0x5861('0x39')){var _0x5c2237={};_0x5c2237[_0x27064f[_0x5861('0x23')]]={'$like':'%'+_0x2203ba['query'][_0x5861('0x37')]+'%'};return _0x5c2237;}})});}_0x19f050=_[_0x5861('0x38')]({},_0x19f050,_0x2203ba['options']);var _0x4f66ba={'where':_0x19f050[_0x5861('0x35')]};return db[_0x5861('0x26')]['count'](_0x4f66ba)[_0x5861('0x1f')](function(_0x1f787f){_0x3a231b[_0x5861('0x19')]=_0x1f787f;if(_0x2203ba['query'][_0x5861('0x3a')]){_0x19f050[_0x5861('0x3b')]=[{'all':!![]}];}return db[_0x5861('0x26')][_0x5861('0x3c')](_0x19f050);})['then'](function(_0x267c66){_0x3a231b[_0x5861('0x3d')]=_0x267c66;return _0x3a231b;})['then'](respondWithFilteredResult(_0x3206b2,_0x19f050))['catch'](handleError(_0x3206b2,null));};exports[_0x5861('0x3e')]=function(_0x2fb543,_0x1f8412){var _0x5f5df7={'raw':!![],'where':{'id':_0x2fb543[_0x5861('0x3f')]['id']}},_0xa9868d={};_0xa9868d['model']=_[_0x5861('0x40')](db[_0x5861('0x26')][_0x5861('0x27')]);_0xa9868d[_0x5861('0x2d')]=_[_0x5861('0x40')](_0x2fb543['query']);_0xa9868d['filters']=_['intersection'](_0xa9868d[_0x5861('0x2b')],_0xa9868d[_0x5861('0x2d')]);_0x5f5df7['attributes']=_[_0x5861('0x2f')](_0xa9868d[_0x5861('0x2b')],qs[_0x5861('0x31')](_0x2fb543['query'][_0x5861('0x31')]));_0x5f5df7['attributes']=_0x5f5df7['attributes'][_0x5861('0x41')]?_0x5f5df7[_0x5861('0x30')]:_0xa9868d['model'];if(_0x2fb543[_0x5861('0x2d')][_0x5861('0x3a')]){_0x5f5df7[_0x5861('0x3b')]=[{'all':!![]}];}_0x5f5df7=_[_0x5861('0x38')]({},_0x5f5df7,_0x2fb543[_0x5861('0x42')]);return db['OpenchannelTransferReport'][_0x5861('0x43')](_0x5f5df7)[_0x5861('0x1f')](handleEntityNotFound(_0x1f8412,null))[_0x5861('0x1f')](respondWithResult(_0x1f8412,null))[_0x5861('0x44')](handleError(_0x1f8412,null));};exports['create']=function(_0x2bf836,_0x599ca0){return db[_0x5861('0x26')][_0x5861('0x45')](_0x2bf836[_0x5861('0x46')],{})[_0x5861('0x1f')](respondWithResult(_0x599ca0,0xc9))[_0x5861('0x44')](handleError(_0x599ca0,null));};exports[_0x5861('0x1e')]=function(_0x4fbe42,_0xf06871){if(_0x4fbe42[_0x5861('0x46')]['id']){delete _0x4fbe42['body']['id'];}return db[_0x5861('0x26')][_0x5861('0x43')]({'where':{'id':_0x4fbe42[_0x5861('0x3f')]['id']}})[_0x5861('0x1f')](handleEntityNotFound(_0xf06871,null))[_0x5861('0x1f')](saveUpdates(_0x4fbe42[_0x5861('0x46')],null))[_0x5861('0x1f')](respondWithResult(_0xf06871,null))[_0x5861('0x44')](handleError(_0xf06871,null));};exports[_0x5861('0x47')]=function(_0x12c35a,_0x49b4eb){return db[_0x5861('0x26')][_0x5861('0x43')]({'where':{'id':_0x12c35a[_0x5861('0x3f')]['id']}})[_0x5861('0x1f')](handleEntityNotFound(_0x49b4eb,null))[_0x5861('0x1f')](removeEntity(_0x49b4eb,null))[_0x5861('0x44')](handleError(_0x49b4eb,null));};exports[_0x5861('0x48')]=function(_0x957853,_0x3acc5b){return db['OpenchannelTransferReport'][_0x5861('0x48')]()[_0x5861('0x1f')](respondWithResult(_0x3acc5b,null))[_0x5861('0x44')](handleError(_0x3acc5b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index ccc97ed..5e2d6e5 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 _0x979b=['uniqueid','lodash','../../config/logger','api','request-promise','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x19b421,_0x3daa42){var _0x57472e=function(_0x4cbbc5){while(--_0x4cbbc5){_0x19b421['push'](_0x19b421['shift']());}};_0x57472e(++_0x3daa42);}(_0x979b,0xbf));var _0xb979=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x979b[_0x52085a];return _0x5afc1a;};'use strict';var _=require(_0xb979('0x0'));var util=require('util');var logger=require(_0xb979('0x1'))(_0xb979('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb979('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb979('0x4'));module[_0xb979('0x5')]=function(_0x5a8201,_0x65fca8){return _0x5a8201[_0xb979('0x6')](_0xb979('0x7'),attributes,{'tableName':_0xb979('0x8'),'paranoid':![],'indexes':[{'name':_0xb979('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x63b7=['exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes'];(function(_0x46f8bd,_0x2729ff){var _0x76f616=function(_0xf3a15f){while(--_0xf3a15f){_0x46f8bd['push'](_0x46f8bd['shift']());}};_0x76f616(++_0x2729ff);}(_0x63b7,0x1ee));var _0x763b=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x63b7[_0xb99421];return _0x4b3ec7;};'use strict';var _=require(_0x763b('0x0'));var util=require(_0x763b('0x1'));var logger=require(_0x763b('0x2'))(_0x763b('0x3'));var moment=require(_0x763b('0x4'));var BPromise=require(_0x763b('0x5'));var rp=require(_0x763b('0x6'));var fs=require('fs');var path=require(_0x763b('0x7'));var rimraf=require(_0x763b('0x8'));var config=require('../../config/environment');var attributes=require(_0x763b('0x9'));module[_0x763b('0xa')]=function(_0x54e25b,_0x433482){return _0x54e25b[_0x763b('0xb')]('OpenchannelTransferReport',attributes,{'tableName':_0x763b('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x763b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 209a161..2826d25 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 _0xf1e9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x58397d,_0x4d15bf){var _0x15296c=function(_0x3d2f45){while(--_0x3d2f45){_0x58397d['push'](_0x58397d['shift']());}};_0x15296c(++_0x4d15bf);}(_0xf1e9,0xc3));var _0x9f1e=function(_0x59f258,_0x16dc0b){_0x59f258=_0x59f258-0x0;var _0x364b35=_0xf1e9[_0x59f258];return _0x364b35;};'use strict';var _=require(_0x9f1e('0x0'));var util=require('util');var moment=require(_0x9f1e('0x1'));var BPromise=require(_0x9f1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f1e('0x3'));var db=require(_0x9f1e('0x4'))['db'];var utils=require(_0x9f1e('0x5'));var logger=require(_0x9f1e('0x6'))(_0x9f1e('0x7'));var config=require(_0x9f1e('0x8'));var jayson=require(_0x9f1e('0x9'));var client=jayson[_0x9f1e('0xa')][_0x9f1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c2a58,_0x1f2657,_0x4e4c6b){return new BPromise(function(_0x3faf94,_0x439820){return client['request'](_0x1c2a58,_0x4e4c6b)[_0x9f1e('0xc')](function(_0x27ae54){logger[_0x9f1e('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f2657,_0x9f1e('0xe'));logger[_0x9f1e('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x1f2657,_0x9f1e('0xe'),JSON['stringify'](_0x27ae54));if(_0x27ae54['error']){if(_0x27ae54[_0x9f1e('0x10')][_0x9f1e('0x11')]===0x1f4){logger[_0x9f1e('0x10')](_0x9f1e('0x12'),_0x1f2657,_0x27ae54[_0x9f1e('0x10')]['message']);return _0x439820(_0x27ae54['error']['message']);}logger[_0x9f1e('0x10')](_0x9f1e('0x12'),_0x1f2657,_0x27ae54['error'][_0x9f1e('0x13')]);return _0x3faf94(_0x27ae54[_0x9f1e('0x10')][_0x9f1e('0x13')]);}else{logger[_0x9f1e('0xd')](_0x9f1e('0x12'),_0x1f2657,_0x9f1e('0xe'));_0x3faf94(_0x27ae54[_0x9f1e('0x14')][_0x9f1e('0x13')]);}})[_0x9f1e('0x15')](function(_0x2b8901){logger[_0x9f1e('0x10')](_0x9f1e('0x12'),_0x1f2657,_0x2b8901);_0x439820(_0x2b8901);});});} \ No newline at end of file +var _0x0b36=['error','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21476d,_0x5a68a6){var _0x85281d=function(_0x942744){while(--_0x942744){_0x21476d['push'](_0x21476d['shift']());}};_0x85281d(++_0x5a68a6);}(_0x0b36,0x80));var _0x60b3=function(_0x5bc787,_0x3ed610){_0x5bc787=_0x5bc787-0x0;var _0x3634e0=_0x0b36[_0x5bc787];return _0x3634e0;};'use strict';var _=require('lodash');var util=require(_0x60b3('0x0'));var moment=require(_0x60b3('0x1'));var BPromise=require('bluebird');var rs=require(_0x60b3('0x2'));var fs=require('fs');var Redis=require(_0x60b3('0x3'));var db=require(_0x60b3('0x4'))['db'];var utils=require(_0x60b3('0x5'));var logger=require(_0x60b3('0x6'))(_0x60b3('0x7'));var config=require(_0x60b3('0x8'));var jayson=require(_0x60b3('0x9'));var client=jayson[_0x60b3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ae96c,_0x3598d4,_0x592665){return new BPromise(function(_0x4cb438,_0x417201){return client[_0x60b3('0xb')](_0x1ae96c,_0x592665)[_0x60b3('0xc')](function(_0x109ebb){logger[_0x60b3('0xd')](_0x60b3('0xe'),_0x3598d4,_0x60b3('0xf'));logger[_0x60b3('0x10')](_0x60b3('0x11'),_0x3598d4,_0x60b3('0xf'),JSON[_0x60b3('0x12')](_0x109ebb));if(_0x109ebb[_0x60b3('0x13')]){if(_0x109ebb['error']['code']===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3598d4,_0x109ebb[_0x60b3('0x13')][_0x60b3('0x14')]);return _0x417201(_0x109ebb[_0x60b3('0x13')][_0x60b3('0x14')]);}logger['error'](_0x60b3('0xe'),_0x3598d4,_0x109ebb[_0x60b3('0x13')]['message']);return _0x4cb438(_0x109ebb[_0x60b3('0x13')][_0x60b3('0x14')]);}else{logger[_0x60b3('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3598d4,'request\x20sent');_0x4cb438(_0x109ebb['result'][_0x60b3('0x14')]);}})['catch'](function(_0x4be434){logger[_0x60b3('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3598d4,_0x4be434);_0x417201(_0x4be434);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index c21707f..edde647 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 _0xf62b=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','multer'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0xf62b,0xfe));var _0xbf62=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xf62b[_0x22c684];return _0x39fcbb;};'use strict';var multer=require(_0xbf62('0x0'));var util=require(_0xbf62('0x1'));var path=require(_0xbf62('0x2'));var timeout=require(_0xbf62('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xbf62('0x4'));var interaction=require(_0xbf62('0x5'));var config=require(_0xbf62('0x6'));var controller=require(_0xbf62('0x7'));router[_0xbf62('0x8')]('/',auth[_0xbf62('0x9')](),controller[_0xbf62('0xa')]);router[_0xbf62('0x8')](_0xbf62('0xb'),auth[_0xbf62('0x9')](),controller['show']);router[_0xbf62('0xc')]('/',auth[_0xbf62('0x9')](),controller[_0xbf62('0xd')]);router['put'](_0xbf62('0xb'),auth[_0xbf62('0x9')](),controller[_0xbf62('0xe')]);router[_0xbf62('0xf')](_0xbf62('0xb'),auth[_0xbf62('0x9')](),controller[_0xbf62('0x10')]);module['exports']=router; \ No newline at end of file +var _0x11df=['multer','util','express','Router','../../components/interaction/service','../../config/environment','./pause.controller','get','/:id','isAuthenticated','post','create','update','delete','destroy','exports'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x11df,0x1d0));var _0xf11d=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x11df[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0xf11d('0x0'));var util=require(_0xf11d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf11d('0x2'));var router=express[_0xf11d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf11d('0x4'));var config=require(_0xf11d('0x5'));var controller=require(_0xf11d('0x6'));router[_0xf11d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf11d('0x7')](_0xf11d('0x8'),auth[_0xf11d('0x9')](),controller['show']);router[_0xf11d('0xa')]('/',auth[_0xf11d('0x9')](),controller[_0xf11d('0xb')]);router['put'](_0xf11d('0x8'),auth[_0xf11d('0x9')](),controller[_0xf11d('0xc')]);router[_0xf11d('0xd')]('/:id',auth[_0xf11d('0x9')](),controller[_0xf11d('0xe')]);module[_0xf11d('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 99b920f..ac7144f 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 _0x413f=['STRING','sequelize'];(function(_0x5c9d18,_0xaeef50){var _0x4e626d=function(_0x1247cb){while(--_0x1247cb){_0x5c9d18['push'](_0x5c9d18['shift']());}};_0x4e626d(++_0xaeef50);}(_0x413f,0x79));var _0xf413=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x413f[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xf413('0x0'));module['exports']={'name':{'type':Sequelize[_0xf413('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf413('0x1')]}}; \ No newline at end of file +var _0x393a=['exports','STRING','name','sequelize'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x393a,0xf7));var _0xa393=function(_0x4bc56e,_0x4f2fc0){_0x4bc56e=_0x4bc56e-0x0;var _0x29c230=_0x393a[_0x4bc56e];return _0x29c230;};'use strict';var Sequelize=require(_0xa393('0x0'));module[_0xa393('0x1')]={'name':{'type':Sequelize[_0xa393('0x2')],'unique':_0xa393('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xa393('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index bb31cc6..6053807 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 _0xcf8e=['find','params','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','then','destroy','get','Pauses','UserProfileResource','error','name','index','map','Pause','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0xcf8e,0x160));var _0xecf8=function(_0x4e04d3,_0x2f28c5){_0x4e04d3=_0x4e04d3-0x0;var _0x5e7c9e=_0xcf8e[_0x4e04d3];return _0x5e7c9e;};'use strict';var pdf=require(_0xecf8('0x0'));var emlformat=require(_0xecf8('0x1'));var rimraf=require(_0xecf8('0x2'));var zipdir=require(_0xecf8('0x3'));var jsonpatch=require(_0xecf8('0x4'));var rp=require(_0xecf8('0x5'));var moment=require(_0xecf8('0x6'));var BPromise=require(_0xecf8('0x7'));var Mustache=require(_0xecf8('0x8'));var util=require(_0xecf8('0x9'));var path=require(_0xecf8('0xa'));var sox=require(_0xecf8('0xb'));var csv=require(_0xecf8('0xc'));var ejs=require(_0xecf8('0xd'));var fs=require('fs');var _=require(_0xecf8('0xe'));var squel=require(_0xecf8('0xf'));var crypto=require(_0xecf8('0x10'));var jsforce=require(_0xecf8('0x11'));var deskjs=require(_0xecf8('0x12'));var toCsv=require(_0xecf8('0xc'));var querystring=require(_0xecf8('0x13'));var Papa=require(_0xecf8('0x14'));var Redis=require(_0xecf8('0x15'));var authService=require(_0xecf8('0x16'));var qs=require(_0xecf8('0x17'));var as=require(_0xecf8('0x18'));var hardwareService=require(_0xecf8('0x19'));var logger=require(_0xecf8('0x1a'))(_0xecf8('0x1b'));var utils=require(_0xecf8('0x1c'));var config=require(_0xecf8('0x1d'));var db=require(_0xecf8('0x1e'))['db'];function respondWithStatusCode(_0x51a070,_0x5a0bc7){_0x5a0bc7=_0x5a0bc7||0xcc;return function(_0x178c79){if(_0x178c79){return _0x51a070[_0xecf8('0x1f')](_0x5a0bc7);}return _0x51a070[_0xecf8('0x20')](_0x5a0bc7)[_0xecf8('0x21')]();};}function respondWithResult(_0x2634bd,_0x2ed024){_0x2ed024=_0x2ed024||0xc8;return function(_0x5d4403){if(_0x5d4403){return _0x2634bd['status'](_0x2ed024)['json'](_0x5d4403);}};}function respondWithFilteredResult(_0x5ac6d9,_0x2dbc5c){return function(_0x5f2986){if(_0x5f2986){var _0x46cb7b=_0x5f2986[_0xecf8('0x22')],_0x3d4ea4=_0x2dbc5c[_0xecf8('0x23')],_0xeb5be5=_0x2dbc5c[_0xecf8('0x23')]+_0x2dbc5c[_0xecf8('0x24')],_0x4a4c27;if(_0xeb5be5>=_0x46cb7b){_0xeb5be5=_0x46cb7b;_0x4a4c27=0xc8;}else{_0x4a4c27=0xce;}_0x5ac6d9[_0xecf8('0x20')](_0x4a4c27);return _0x5ac6d9['set'](_0xecf8('0x25'),_0x3d4ea4+'-'+_0xeb5be5+'/'+_0x46cb7b)[_0xecf8('0x26')](_0x5f2986);}return null;};}function patchUpdates(_0xcb97bc){return function(_0x45f3ca){try{jsonpatch[_0xecf8('0x27')](_0x45f3ca,_0xcb97bc,!![]);}catch(_0x12da7d){return BPromise['reject'](_0x12da7d);}return _0x45f3ca[_0xecf8('0x28')]();};}function saveUpdates(_0x2a79e6,_0x5b4b38){return function(_0x292512){if(_0x292512){return _0x292512['update'](_0x2a79e6)[_0xecf8('0x29')](function(_0x5e7004){return _0x5e7004;});}return null;};}function removeEntity(_0x33f773,_0x1c3746){return function(_0x9b98e8){if(_0x9b98e8){return _0x9b98e8[_0xecf8('0x2a')]()[_0xecf8('0x29')](function(){var _0x17bb5f=_0x9b98e8[_0xecf8('0x2b')]({'plain':!![]});var _0xe787d8=_0xecf8('0x2c');return db[_0xecf8('0x2d')][_0xecf8('0x2a')]({'where':{'type':_0xe787d8,'resourceId':_0x17bb5f['id']}})[_0xecf8('0x29')](function(){return _0x9b98e8;});})[_0xecf8('0x29')](function(){_0x33f773['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x124776,_0x2af851){return function(_0x507b5f){if(!_0x507b5f){_0x124776[_0xecf8('0x1f')](0x194);}return _0x507b5f;};}function handleError(_0x2c2762,_0x325a40){_0x325a40=_0x325a40||0x1f4;return function(_0x1a1874){logger[_0xecf8('0x2e')](_0x1a1874['stack']);if(_0x1a1874[_0xecf8('0x2f')]){delete _0x1a1874[_0xecf8('0x2f')];}_0x2c2762[_0xecf8('0x20')](_0x325a40)['send'](_0x1a1874);};}exports[_0xecf8('0x30')]=function(_0x59b329,_0x4f5420){var _0x4731b6={},_0x1698d5={},_0x142fb4={'count':0x0,'rows':[]};var _0x5ced41=_[_0xecf8('0x31')](db[_0xecf8('0x32')][_0xecf8('0x33')],function(_0x7d60f){return{'name':_0x7d60f['fieldName'],'type':_0x7d60f[_0xecf8('0x34')][_0xecf8('0x35')]};});_0x1698d5['model']=_[_0xecf8('0x31')](_0x5ced41,'name');_0x1698d5[_0xecf8('0x36')]=_[_0xecf8('0x37')](_0x59b329[_0xecf8('0x36')]);_0x1698d5[_0xecf8('0x38')]=_[_0xecf8('0x39')](_0x1698d5['model'],_0x1698d5[_0xecf8('0x36')]);_0x4731b6['attributes']=_[_0xecf8('0x39')](_0x1698d5[_0xecf8('0x3a')],qs[_0xecf8('0x3b')](_0x59b329['query'][_0xecf8('0x3b')]));_0x4731b6[_0xecf8('0x3c')]=_0x4731b6['attributes'][_0xecf8('0x3d')]?_0x4731b6[_0xecf8('0x3c')]:_0x1698d5[_0xecf8('0x3a')];if(!_0x59b329[_0xecf8('0x36')][_0xecf8('0x3e')](_0xecf8('0x3f'))){_0x4731b6[_0xecf8('0x24')]=qs[_0xecf8('0x24')](_0x59b329[_0xecf8('0x36')]['limit']);_0x4731b6[_0xecf8('0x23')]=qs[_0xecf8('0x23')](_0x59b329[_0xecf8('0x36')][_0xecf8('0x23')]);}_0x4731b6[_0xecf8('0x40')]=qs[_0xecf8('0x41')](_0x59b329[_0xecf8('0x36')][_0xecf8('0x41')]);_0x4731b6[_0xecf8('0x42')]=qs[_0xecf8('0x38')](_['pick'](_0x59b329[_0xecf8('0x36')],_0x1698d5['filters']));if(_0x59b329[_0xecf8('0x36')][_0xecf8('0x43')]){_0x4731b6[_0xecf8('0x42')]=_[_0xecf8('0x44')](_0x4731b6[_0xecf8('0x42')],{'$or':_[_0xecf8('0x31')](_0x5ced41,function(_0x4e28fd){if(_0x4e28fd[_0xecf8('0x34')]!==_0xecf8('0x45')){var _0x295b4e={};_0x295b4e[_0x4e28fd[_0xecf8('0x2f')]]={'$like':'%'+_0x59b329[_0xecf8('0x36')]['filter']+'%'};return _0x295b4e;}})});}_0x4731b6=_[_0xecf8('0x44')]({},_0x4731b6,_0x59b329[_0xecf8('0x46')]);var _0x59bbae={'where':_0x4731b6[_0xecf8('0x42')]};return db[_0xecf8('0x32')][_0xecf8('0x22')](_0x59bbae)[_0xecf8('0x29')](function(_0x299d94){_0x142fb4[_0xecf8('0x22')]=_0x299d94;if(_0x59b329[_0xecf8('0x36')][_0xecf8('0x47')]){_0x4731b6['include']=[{'all':!![]}];}return db['Pause'][_0xecf8('0x48')](_0x4731b6);})[_0xecf8('0x29')](function(_0x5d3425){_0x142fb4[_0xecf8('0x49')]=_0x5d3425;return _0x142fb4;})[_0xecf8('0x29')](respondWithFilteredResult(_0x4f5420,_0x4731b6))['catch'](handleError(_0x4f5420,null));};exports[_0xecf8('0x4a')]=function(_0x47feb2,_0x4d2218){var _0x1617b7={'raw':!![],'where':{'id':_0x47feb2['params']['id']}},_0x2ca4d9={};_0x2ca4d9[_0xecf8('0x3a')]=_[_0xecf8('0x37')](db[_0xecf8('0x32')][_0xecf8('0x33')]);_0x2ca4d9[_0xecf8('0x36')]=_[_0xecf8('0x37')](_0x47feb2[_0xecf8('0x36')]);_0x2ca4d9[_0xecf8('0x38')]=_[_0xecf8('0x39')](_0x2ca4d9[_0xecf8('0x3a')],_0x2ca4d9[_0xecf8('0x36')]);_0x1617b7[_0xecf8('0x3c')]=_[_0xecf8('0x39')](_0x2ca4d9[_0xecf8('0x3a')],qs[_0xecf8('0x3b')](_0x47feb2[_0xecf8('0x36')][_0xecf8('0x3b')]));_0x1617b7[_0xecf8('0x3c')]=_0x1617b7[_0xecf8('0x3c')]['length']?_0x1617b7[_0xecf8('0x3c')]:_0x2ca4d9[_0xecf8('0x3a')];if(_0x47feb2[_0xecf8('0x36')]['includeAll']){_0x1617b7[_0xecf8('0x4b')]=[{'all':!![]}];}_0x1617b7=_[_0xecf8('0x44')]({},_0x1617b7,_0x47feb2[_0xecf8('0x46')]);return db[_0xecf8('0x32')]['find'](_0x1617b7)[_0xecf8('0x29')](handleEntityNotFound(_0x4d2218,null))[_0xecf8('0x29')](respondWithResult(_0x4d2218,null))['catch'](handleError(_0x4d2218,null));};exports['create']=function(_0x56c045,_0x43f31f){return db['Pause']['create'](_0x56c045['body'],{})['then'](function(_0x5a09be){var _0x1d677f=_0x56c045[_0xecf8('0x4c')][_0xecf8('0x2b')]({'plain':!![]});if(!_0x1d677f)throw new Error(_0xecf8('0x4d'));if(_0x1d677f[_0xecf8('0x4e')]===_0xecf8('0x4c')){var _0x350b0d=_0x5a09be[_0xecf8('0x2b')]({'plain':!![]});var _0x92a63f=_0xecf8('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x92a63f,'userProfileId':_0x1d677f[_0xecf8('0x4f')]},'raw':!![]})[_0xecf8('0x29')](function(_0x204854){if(_0x204854&&_0x204854[_0xecf8('0x50')]===0x0){return db[_0xecf8('0x2d')][_0xecf8('0x51')]({'name':_0x350b0d[_0xecf8('0x2f')],'resourceId':_0x350b0d['id'],'type':_0x204854[_0xecf8('0x2f')],'sectionId':_0x204854['id']},{})[_0xecf8('0x29')](function(){return _0x5a09be;});}else{return _0x5a09be;}})['catch'](function(_0x4f8aa7){logger[_0xecf8('0x2e')](_0xecf8('0x52'),_0x4f8aa7);throw _0x4f8aa7;});}return _0x5a09be;})['then'](respondWithResult(_0x43f31f,0xc9))['catch'](handleError(_0x43f31f,null));};exports['update']=function(_0xcfe06f,_0x4c11b9){if(_0xcfe06f['body']['id']){delete _0xcfe06f['body']['id'];}return db[_0xecf8('0x32')][_0xecf8('0x53')]({'where':{'id':_0xcfe06f[_0xecf8('0x54')]['id']}})[_0xecf8('0x29')](handleEntityNotFound(_0x4c11b9,null))['then'](saveUpdates(_0xcfe06f[_0xecf8('0x55')],null))[_0xecf8('0x29')](respondWithResult(_0x4c11b9,null))[_0xecf8('0x56')](handleError(_0x4c11b9,null));};exports[_0xecf8('0x2a')]=function(_0x304af4,_0x898afe){return db[_0xecf8('0x32')][_0xecf8('0x53')]({'where':{'id':_0x304af4[_0xecf8('0x54')]['id']}})['then'](handleEntityNotFound(_0x898afe,null))[_0xecf8('0x29')](removeEntity(_0x898afe,null))['catch'](handleError(_0x898afe,null));}; \ No newline at end of file +var _0xa541=['keys','filters','intersection','model','attributes','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','Pause','rawAttributes','fieldName','key','query'];(function(_0x420d8d,_0x78b67f){var _0x4865d7=function(_0x2965df){while(--_0x2965df){_0x420d8d['push'](_0x420d8d['shift']());}};_0x4865d7(++_0x78b67f);}(_0xa541,0xc5));var _0x1a54=function(_0xcaf4d0,_0x5cc449){_0xcaf4d0=_0xcaf4d0-0x0;var _0x26699e=_0xa541[_0xcaf4d0];return _0x26699e;};'use strict';var pdf=require(_0x1a54('0x0'));var emlformat=require(_0x1a54('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1a54('0x2'));var jsonpatch=require(_0x1a54('0x3'));var rp=require(_0x1a54('0x4'));var moment=require(_0x1a54('0x5'));var BPromise=require(_0x1a54('0x6'));var Mustache=require('mustache');var util=require(_0x1a54('0x7'));var path=require('path');var sox=require(_0x1a54('0x8'));var csv=require(_0x1a54('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1a54('0xa'));var squel=require('squel');var crypto=require(_0x1a54('0xb'));var jsforce=require(_0x1a54('0xc'));var deskjs=require(_0x1a54('0xd'));var toCsv=require(_0x1a54('0x9'));var querystring=require(_0x1a54('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a54('0xf'));var authService=require(_0x1a54('0x10'));var qs=require(_0x1a54('0x11'));var as=require(_0x1a54('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a54('0x13'))(_0x1a54('0x14'));var utils=require(_0x1a54('0x15'));var config=require(_0x1a54('0x16'));var db=require(_0x1a54('0x17'))['db'];function respondWithStatusCode(_0x2143d3,_0x461759){_0x461759=_0x461759||0xcc;return function(_0x9e6975){if(_0x9e6975){return _0x2143d3[_0x1a54('0x18')](_0x461759);}return _0x2143d3[_0x1a54('0x19')](_0x461759)[_0x1a54('0x1a')]();};}function respondWithResult(_0x292178,_0x692775){_0x692775=_0x692775||0xc8;return function(_0x59cbbc){if(_0x59cbbc){return _0x292178['status'](_0x692775)['json'](_0x59cbbc);}};}function respondWithFilteredResult(_0x345197,_0x55e5d){return function(_0x13916e){if(_0x13916e){var _0x42cae0=_0x13916e['count'],_0x9ab795=_0x55e5d[_0x1a54('0x1b')],_0x107473=_0x55e5d[_0x1a54('0x1b')]+_0x55e5d[_0x1a54('0x1c')],_0x1195dc;if(_0x107473>=_0x42cae0){_0x107473=_0x42cae0;_0x1195dc=0xc8;}else{_0x1195dc=0xce;}_0x345197[_0x1a54('0x19')](_0x1195dc);return _0x345197[_0x1a54('0x1d')]('Content-Range',_0x9ab795+'-'+_0x107473+'/'+_0x42cae0)[_0x1a54('0x1e')](_0x13916e);}return null;};}function patchUpdates(_0x48e00d){return function(_0x491ca9){try{jsonpatch[_0x1a54('0x1f')](_0x491ca9,_0x48e00d,!![]);}catch(_0x485e8b){return BPromise[_0x1a54('0x20')](_0x485e8b);}return _0x491ca9[_0x1a54('0x21')]();};}function saveUpdates(_0x4190ca,_0x36bac8){return function(_0x2f90f9){if(_0x2f90f9){return _0x2f90f9[_0x1a54('0x22')](_0x4190ca)[_0x1a54('0x23')](function(_0xfa0d0f){return _0xfa0d0f;});}return null;};}function removeEntity(_0x5a3895,_0x5f21f){return function(_0x53a39a){if(_0x53a39a){return _0x53a39a['destroy']()[_0x1a54('0x23')](function(){var _0x221473=_0x53a39a[_0x1a54('0x24')]({'plain':!![]});var _0x4f949e='Pauses';return db[_0x1a54('0x25')][_0x1a54('0x26')]({'where':{'type':_0x4f949e,'resourceId':_0x221473['id']}})['then'](function(){return _0x53a39a;});})[_0x1a54('0x23')](function(){_0x5a3895['status'](0xcc)[_0x1a54('0x1a')]();});}};}function handleEntityNotFound(_0x11ef5c,_0x511534){return function(_0x1d39a6){if(!_0x1d39a6){_0x11ef5c['sendStatus'](0x194);}return _0x1d39a6;};}function handleError(_0x3ae292,_0x4a79e8){_0x4a79e8=_0x4a79e8||0x1f4;return function(_0x4a3ef2){logger[_0x1a54('0x27')](_0x4a3ef2[_0x1a54('0x28')]);if(_0x4a3ef2[_0x1a54('0x29')]){delete _0x4a3ef2[_0x1a54('0x29')];}_0x3ae292[_0x1a54('0x19')](_0x4a79e8)['send'](_0x4a3ef2);};}exports[_0x1a54('0x2a')]=function(_0xdbf0b3,_0x1c0008){var _0x419bb1={},_0x337b33={},_0x580d05={'count':0x0,'rows':[]};var _0x32e3a7=_[_0x1a54('0x2b')](db[_0x1a54('0x2c')][_0x1a54('0x2d')],function(_0x38b49d){return{'name':_0x38b49d[_0x1a54('0x2e')],'type':_0x38b49d['type'][_0x1a54('0x2f')]};});_0x337b33['model']=_[_0x1a54('0x2b')](_0x32e3a7,_0x1a54('0x29'));_0x337b33[_0x1a54('0x30')]=_[_0x1a54('0x31')](_0xdbf0b3[_0x1a54('0x30')]);_0x337b33[_0x1a54('0x32')]=_[_0x1a54('0x33')](_0x337b33[_0x1a54('0x34')],_0x337b33[_0x1a54('0x30')]);_0x419bb1[_0x1a54('0x35')]=_[_0x1a54('0x33')](_0x337b33[_0x1a54('0x34')],qs['fields'](_0xdbf0b3[_0x1a54('0x30')]['fields']));_0x419bb1[_0x1a54('0x35')]=_0x419bb1['attributes']['length']?_0x419bb1['attributes']:_0x337b33[_0x1a54('0x34')];if(!_0xdbf0b3[_0x1a54('0x30')][_0x1a54('0x36')]('nolimit')){_0x419bb1[_0x1a54('0x1c')]=qs[_0x1a54('0x1c')](_0xdbf0b3[_0x1a54('0x30')]['limit']);_0x419bb1[_0x1a54('0x1b')]=qs[_0x1a54('0x1b')](_0xdbf0b3[_0x1a54('0x30')][_0x1a54('0x1b')]);}_0x419bb1[_0x1a54('0x37')]=qs[_0x1a54('0x38')](_0xdbf0b3[_0x1a54('0x30')]['sort']);_0x419bb1[_0x1a54('0x39')]=qs['filters'](_[_0x1a54('0x3a')](_0xdbf0b3[_0x1a54('0x30')],_0x337b33[_0x1a54('0x32')]));if(_0xdbf0b3['query']['filter']){_0x419bb1[_0x1a54('0x39')]=_[_0x1a54('0x3b')](_0x419bb1[_0x1a54('0x39')],{'$or':_[_0x1a54('0x2b')](_0x32e3a7,function(_0x3e81dd){if(_0x3e81dd[_0x1a54('0x3c')]!==_0x1a54('0x3d')){var _0x107c86={};_0x107c86[_0x3e81dd[_0x1a54('0x29')]]={'$like':'%'+_0xdbf0b3['query'][_0x1a54('0x3e')]+'%'};return _0x107c86;}})});}_0x419bb1=_['merge']({},_0x419bb1,_0xdbf0b3[_0x1a54('0x3f')]);var _0x3d6a80={'where':_0x419bb1[_0x1a54('0x39')]};return db['Pause'][_0x1a54('0x40')](_0x3d6a80)[_0x1a54('0x23')](function(_0x2cd84c){_0x580d05[_0x1a54('0x40')]=_0x2cd84c;if(_0xdbf0b3[_0x1a54('0x30')][_0x1a54('0x41')]){_0x419bb1[_0x1a54('0x42')]=[{'all':!![]}];}return db[_0x1a54('0x2c')][_0x1a54('0x43')](_0x419bb1);})[_0x1a54('0x23')](function(_0x351fd4){_0x580d05[_0x1a54('0x44')]=_0x351fd4;return _0x580d05;})[_0x1a54('0x23')](respondWithFilteredResult(_0x1c0008,_0x419bb1))[_0x1a54('0x45')](handleError(_0x1c0008,null));};exports[_0x1a54('0x46')]=function(_0x45a33b,_0x4eed12){var _0xcd77f8={'raw':!![],'where':{'id':_0x45a33b[_0x1a54('0x47')]['id']}},_0x198c7b={};_0x198c7b[_0x1a54('0x34')]=_['keys'](db[_0x1a54('0x2c')][_0x1a54('0x2d')]);_0x198c7b['query']=_[_0x1a54('0x31')](_0x45a33b['query']);_0x198c7b[_0x1a54('0x32')]=_[_0x1a54('0x33')](_0x198c7b[_0x1a54('0x34')],_0x198c7b[_0x1a54('0x30')]);_0xcd77f8[_0x1a54('0x35')]=_['intersection'](_0x198c7b[_0x1a54('0x34')],qs[_0x1a54('0x48')](_0x45a33b[_0x1a54('0x30')]['fields']));_0xcd77f8['attributes']=_0xcd77f8[_0x1a54('0x35')][_0x1a54('0x49')]?_0xcd77f8['attributes']:_0x198c7b[_0x1a54('0x34')];if(_0x45a33b[_0x1a54('0x30')][_0x1a54('0x41')]){_0xcd77f8[_0x1a54('0x42')]=[{'all':!![]}];}_0xcd77f8=_[_0x1a54('0x3b')]({},_0xcd77f8,_0x45a33b[_0x1a54('0x3f')]);return db[_0x1a54('0x2c')][_0x1a54('0x4a')](_0xcd77f8)[_0x1a54('0x23')](handleEntityNotFound(_0x4eed12,null))[_0x1a54('0x23')](respondWithResult(_0x4eed12,null))[_0x1a54('0x45')](handleError(_0x4eed12,null));};exports['create']=function(_0x3f46e1,_0x4b7d36){return db[_0x1a54('0x2c')][_0x1a54('0x4b')](_0x3f46e1[_0x1a54('0x4c')],{})[_0x1a54('0x23')](function(_0x3b7555){var _0x5440ca=_0x3f46e1[_0x1a54('0x4d')]['get']({'plain':!![]});if(!_0x5440ca)throw new Error(_0x1a54('0x4e'));if(_0x5440ca['role']===_0x1a54('0x4d')){var _0xf09f6a=_0x3b7555[_0x1a54('0x24')]({'plain':!![]});var _0x376e83='Pauses';return db[_0x1a54('0x4f')][_0x1a54('0x4a')]({'where':{'name':_0x376e83,'userProfileId':_0x5440ca[_0x1a54('0x50')]},'raw':!![]})[_0x1a54('0x23')](function(_0x2700c7){if(_0x2700c7&&_0x2700c7[_0x1a54('0x51')]===0x0){return db[_0x1a54('0x25')][_0x1a54('0x4b')]({'name':_0xf09f6a[_0x1a54('0x29')],'resourceId':_0xf09f6a['id'],'type':_0x2700c7[_0x1a54('0x29')],'sectionId':_0x2700c7['id']},{})[_0x1a54('0x23')](function(){return _0x3b7555;});}else{return _0x3b7555;}})[_0x1a54('0x45')](function(_0x36f4fd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36f4fd);throw _0x36f4fd;});}return _0x3b7555;})['then'](respondWithResult(_0x4b7d36,0xc9))['catch'](handleError(_0x4b7d36,null));};exports[_0x1a54('0x22')]=function(_0x2b4060,_0x2a4722){if(_0x2b4060['body']['id']){delete _0x2b4060[_0x1a54('0x4c')]['id'];}return db[_0x1a54('0x2c')][_0x1a54('0x4a')]({'where':{'id':_0x2b4060[_0x1a54('0x47')]['id']}})[_0x1a54('0x23')](handleEntityNotFound(_0x2a4722,null))[_0x1a54('0x23')](saveUpdates(_0x2b4060[_0x1a54('0x4c')],null))['then'](respondWithResult(_0x2a4722,null))[_0x1a54('0x45')](handleError(_0x2a4722,null));};exports[_0x1a54('0x26')]=function(_0x512a40,_0xf1c26){return db['Pause'][_0x1a54('0x4a')]({'where':{'id':_0x512a40[_0x1a54('0x47')]['id']}})[_0x1a54('0x23')](handleEntityNotFound(_0xf1c26,null))['then'](removeEntity(_0xf1c26,null))[_0x1a54('0x45')](handleError(_0xf1c26,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 2cfc622..48b7cd4 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 _0x5713=['exports','define','Pause','tools_pauses','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x5c2748,_0x564960){var _0x59761d=function(_0x1ccb1a){while(--_0x1ccb1a){_0x5c2748['push'](_0x5c2748['shift']());}};_0x59761d(++_0x564960);}(_0x5713,0x1c7));var _0x3571=function(_0x432278,_0x1c73ec){_0x432278=_0x432278-0x0;var _0x5c3076=_0x5713[_0x432278];return _0x5c3076;};'use strict';var _=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var logger=require('../../config/logger')(_0x3571('0x2'));var moment=require('moment');var BPromise=require(_0x3571('0x3'));var rp=require(_0x3571('0x4'));var fs=require('fs');var path=require(_0x3571('0x5'));var rimraf=require(_0x3571('0x6'));var config=require('../../config/environment');var attributes=require('./pause.attributes');module[_0x3571('0x7')]=function(_0x415378,_0x3e114a){return _0x415378[_0x3571('0x8')](_0x3571('0x9'),attributes,{'tableName':_0x3571('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x288a=['define','Pause','util','../../config/logger','api','moment','path','../../config/environment','./pause.attributes','exports'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x288a,0x188));var _0xa288=function(_0x22d3dd,_0x10c009){_0x22d3dd=_0x22d3dd-0x0;var _0x19f5d9=_0x288a[_0x22d3dd];return _0x19f5d9;};'use strict';var _=require('lodash');var util=require(_0xa288('0x0'));var logger=require(_0xa288('0x1'))(_0xa288('0x2'));var moment=require(_0xa288('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa288('0x4'));var rimraf=require('rimraf');var config=require(_0xa288('0x5'));var attributes=require(_0xa288('0x6'));module[_0xa288('0x7')]=function(_0x4ad8fb,_0x1e2c4b){return _0x4ad8fb[_0xa288('0x8')](_0xa288('0x9'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 1de5567..5567ec2 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 _0xf378=['include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','ShowPause','Pause','find','options','where','attributes'];(function(_0x4c0d2b,_0x2ff906){var _0x58c4fe=function(_0x21c39a){while(--_0x21c39a){_0x4c0d2b['push'](_0x4c0d2b['shift']());}};_0x58c4fe(++_0x2ff906);}(_0xf378,0x18a));var _0x8f37=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xf378[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x8f37('0x0'));var util=require('util');var moment=require(_0x8f37('0x1'));var BPromise=require(_0x8f37('0x2'));var rs=require(_0x8f37('0x3'));var fs=require('fs');var Redis=require(_0x8f37('0x4'));var db=require(_0x8f37('0x5'))['db'];var utils=require(_0x8f37('0x6'));var logger=require(_0x8f37('0x7'))(_0x8f37('0x8'));var config=require('../../config/environment');var jayson=require(_0x8f37('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50712e,_0x1a792e,_0x409022){return new BPromise(function(_0x286c8d,_0x440409){return client[_0x8f37('0xa')](_0x50712e,_0x409022)[_0x8f37('0xb')](function(_0x2800a8){logger[_0x8f37('0xc')](_0x8f37('0xd'),_0x1a792e,'request\x20sent');logger['debug'](_0x8f37('0xe'),_0x1a792e,_0x8f37('0xf'),JSON['stringify'](_0x2800a8));if(_0x2800a8[_0x8f37('0x10')]){if(_0x2800a8[_0x8f37('0x10')][_0x8f37('0x11')]===0x1f4){logger[_0x8f37('0x10')](_0x8f37('0xd'),_0x1a792e,_0x2800a8[_0x8f37('0x10')][_0x8f37('0x12')]);return _0x440409(_0x2800a8[_0x8f37('0x10')][_0x8f37('0x12')]);}logger[_0x8f37('0x10')](_0x8f37('0xd'),_0x1a792e,_0x2800a8[_0x8f37('0x10')][_0x8f37('0x12')]);return _0x286c8d(_0x2800a8['error'][_0x8f37('0x12')]);}else{logger[_0x8f37('0xc')](_0x8f37('0xd'),_0x1a792e,_0x8f37('0xf'));_0x286c8d(_0x2800a8[_0x8f37('0x13')][_0x8f37('0x12')]);}})['catch'](function(_0x122d15){logger[_0x8f37('0x10')](_0x8f37('0xd'),_0x1a792e,_0x122d15);_0x440409(_0x122d15);});});}exports[_0x8f37('0x14')]=function(_0x1be5c6){var _0x476d32=this;return new Promise(function(_0x2fd9fb,_0x28f63a){return db[_0x8f37('0x15')][_0x8f37('0x16')]({'raw':_0x1be5c6['options']?_0x1be5c6[_0x8f37('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1be5c6[_0x8f37('0x17')]?_0x1be5c6[_0x8f37('0x17')][_0x8f37('0x18')]||null:null,'attributes':_0x1be5c6[_0x8f37('0x17')]?_0x1be5c6[_0x8f37('0x17')][_0x8f37('0x19')]||null:null,'include':_0x1be5c6['options']?_0x1be5c6['options'][_0x8f37('0x1a')]?_[_0x8f37('0x1b')](_0x1be5c6[_0x8f37('0x17')]['include'],function(_0x13ad87){return{'model':db[_0x13ad87[_0x8f37('0x1c')]],'as':_0x13ad87['as'],'attributes':_0x13ad87['attributes'],'include':_0x13ad87[_0x8f37('0x1a')]?_[_0x8f37('0x1b')](_0x13ad87['include'],function(_0x21f5de){return{'model':db[_0x21f5de['model']],'as':_0x21f5de['as'],'attributes':_0x21f5de[_0x8f37('0x19')],'include':_0x21f5de[_0x8f37('0x1a')]?_[_0x8f37('0x1b')](_0x21f5de[_0x8f37('0x1a')],function(_0x2da1c7){return{'model':db[_0x2da1c7[_0x8f37('0x1c')]],'as':_0x2da1c7['as'],'attributes':_0x2da1c7[_0x8f37('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8f37('0xb')](function(_0xf5aaff){logger[_0x8f37('0xc')](_0x8f37('0x14'),_0x1be5c6);logger['debug']('ShowPause',_0x1be5c6,JSON['stringify'](_0xf5aaff));_0x2fd9fb(_0xf5aaff);})[_0x8f37('0x1d')](function(_0x38d071){logger[_0x8f37('0x10')]('ShowPause',_0x38d071['message'],_0x1be5c6);_0x28f63a(_0x476d32['error'](0x1f4,_0x38d071[_0x8f37('0x12')]));});});}; \ No newline at end of file +var _0xeec3=['error','code','message','result','catch','Pause,\x20%s,\x20%s','ShowPause','Pause','options','raw','where','include','model','attributes','map','debug','lodash','util','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xe37cad,_0x9fcbdd){var _0x24593e=function(_0x4170bb){while(--_0x4170bb){_0xe37cad['push'](_0xe37cad['shift']());}};_0x24593e(++_0x9fcbdd);}(_0xeec3,0x1c3));var _0x3eec=function(_0x21508,_0x367837){_0x21508=_0x21508-0x0;var _0x2d089d=_0xeec3[_0x21508];return _0x2d089d;};'use strict';var _=require(_0x3eec('0x0'));var util=require(_0x3eec('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3eec('0x2'));var logger=require(_0x3eec('0x3'))('rpc');var config=require(_0x3eec('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x3eec('0x5')][_0x3eec('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x57be71,_0x3a019f,_0x3b8171){return new BPromise(function(_0xa6821e,_0x3dcfdb){return client[_0x3eec('0x7')](_0x57be71,_0x3b8171)[_0x3eec('0x8')](function(_0xd06d6c){logger[_0x3eec('0x9')]('Pause,\x20%s,\x20%s',_0x3a019f,_0x3eec('0xa'));logger['debug'](_0x3eec('0xb'),_0x3a019f,_0x3eec('0xa'),JSON[_0x3eec('0xc')](_0xd06d6c));if(_0xd06d6c[_0x3eec('0xd')]){if(_0xd06d6c['error'][_0x3eec('0xe')]===0x1f4){logger['error']('Pause,\x20%s,\x20%s',_0x3a019f,_0xd06d6c['error'][_0x3eec('0xf')]);return _0x3dcfdb(_0xd06d6c[_0x3eec('0xd')][_0x3eec('0xf')]);}logger[_0x3eec('0xd')]('Pause,\x20%s,\x20%s',_0x3a019f,_0xd06d6c[_0x3eec('0xd')]['message']);return _0xa6821e(_0xd06d6c['error']['message']);}else{logger[_0x3eec('0x9')]('Pause,\x20%s,\x20%s',_0x3a019f,'request\x20sent');_0xa6821e(_0xd06d6c[_0x3eec('0x10')][_0x3eec('0xf')]);}})[_0x3eec('0x11')](function(_0x48b170){logger['error'](_0x3eec('0x12'),_0x3a019f,_0x48b170);_0x3dcfdb(_0x48b170);});});}exports[_0x3eec('0x13')]=function(_0x500109){var _0x1c1251=this;return new Promise(function(_0x497d60,_0x140639){return db[_0x3eec('0x14')]['find']({'raw':_0x500109[_0x3eec('0x15')]?_0x500109['options'][_0x3eec('0x16')]===undefined?!![]:![]:!![],'where':_0x500109['options']?_0x500109[_0x3eec('0x15')][_0x3eec('0x17')]||null:null,'attributes':_0x500109['options']?_0x500109[_0x3eec('0x15')]['attributes']||null:null,'include':_0x500109['options']?_0x500109[_0x3eec('0x15')][_0x3eec('0x18')]?_['map'](_0x500109[_0x3eec('0x15')]['include'],function(_0x37e5af){return{'model':db[_0x37e5af[_0x3eec('0x19')]],'as':_0x37e5af['as'],'attributes':_0x37e5af[_0x3eec('0x1a')],'include':_0x37e5af[_0x3eec('0x18')]?_[_0x3eec('0x1b')](_0x37e5af[_0x3eec('0x18')],function(_0x34fbe4){return{'model':db[_0x34fbe4[_0x3eec('0x19')]],'as':_0x34fbe4['as'],'attributes':_0x34fbe4[_0x3eec('0x1a')],'include':_0x34fbe4[_0x3eec('0x18')]?_[_0x3eec('0x1b')](_0x34fbe4[_0x3eec('0x18')],function(_0x1d998e){return{'model':db[_0x1d998e['model']],'as':_0x1d998e['as'],'attributes':_0x1d998e[_0x3eec('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x206b9d){logger[_0x3eec('0x9')](_0x3eec('0x13'),_0x500109);logger[_0x3eec('0x1c')](_0x3eec('0x13'),_0x500109,JSON[_0x3eec('0xc')](_0x206b9d));_0x497d60(_0x206b9d);})[_0x3eec('0x11')](function(_0x17c896){logger[_0x3eec('0xd')](_0x3eec('0x13'),_0x17c896[_0x3eec('0xf')],_0x500109);_0x140639(_0x1c1251[_0x3eec('0xd')](0x1f4,_0x17c896[_0x3eec('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 911fed1..832b4e6 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 _0xbaae=['join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','upload','post','isAuthenticated','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./plugin.controller','index','get','/webhook','/:id','show','/:id/download','download','diskStorage'];(function(_0x50ff33,_0x256ea5){var _0x1714df=function(_0xbc6c9c){while(--_0xbc6c9c){_0x50ff33['push'](_0x50ff33['shift']());}};_0x1714df(++_0x256ea5);}(_0xbaae,0x145));var _0xebaa=function(_0x3af2e8,_0x93c5d6){_0x3af2e8=_0x3af2e8-0x0;var _0x64d28e=_0xbaae[_0x3af2e8];return _0x64d28e;};'use strict';var multer=require(_0xebaa('0x0'));var util=require(_0xebaa('0x1'));var path=require(_0xebaa('0x2'));var timeout=require(_0xebaa('0x3'));var express=require(_0xebaa('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xebaa('0x5'));var config=require(_0xebaa('0x6'));var controller=require(_0xebaa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xebaa('0x8')]);router[_0xebaa('0x9')](_0xebaa('0xa'),controller['webhookGet']);router[_0xebaa('0x9')](_0xebaa('0xb'),auth['isAuthenticated'](),controller[_0xebaa('0xc')]);router[_0xebaa('0x9')](_0xebaa('0xd'),auth['isAuthenticated'](),controller[_0xebaa('0xe')]);var upload=multer({'storage':multer[_0xebaa('0xf')]({'destination':function(_0x101230,_0x40a139,_0xc20e01){_0xc20e01(null,path[_0xebaa('0x10')](config['root'],_0xebaa('0x11')));},'filename':function(_0x1e141e,_0x4de89a,_0x48a45d){_0x4de89a['originalname']=_0x4de89a[_0xebaa('0x12')][_0xebaa('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x48a45d(null,util[_0xebaa('0x14')](_0xebaa('0x15'),path[_0xebaa('0x16')](_0x4de89a['originalname'],path[_0xebaa('0x17')](_0x4de89a['originalname'])),Date[_0xebaa('0x18')](),path[_0xebaa('0x17')](_0x4de89a[_0xebaa('0x12')])));}})});router['post']('/',upload[_0xebaa('0x19')]('file'),controller[_0xebaa('0x1a')]);router[_0xebaa('0x1b')](_0xebaa('0xa'),controller['webhookPost']);router['put']('/:id',auth[_0xebaa('0x1c')](),controller['update']);router[_0xebaa('0x1d')](_0xebaa('0xb'),auth[_0xebaa('0x1c')](),controller[_0xebaa('0x1d')]);module[_0xebaa('0x1e')]=router; \ No newline at end of file +var _0x9b68=['root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','single','file','post','webhookPost','put','/:id','update','delete','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','show','/:id/download','download','join'];(function(_0x144503,_0x3924a7){var _0x32ac61=function(_0x15a1b3){while(--_0x15a1b3){_0x144503['push'](_0x144503['shift']());}};_0x32ac61(++_0x3924a7);}(_0x9b68,0x131));var _0x89b6=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0x9b68[_0x91d019];return _0x19de1f;};'use strict';var multer=require(_0x89b6('0x0'));var util=require('util');var path=require(_0x89b6('0x1'));var timeout=require('connect-timeout');var express=require(_0x89b6('0x2'));var router=express['Router']();var auth=require(_0x89b6('0x3'));var interaction=require(_0x89b6('0x4'));var config=require(_0x89b6('0x5'));var controller=require('./plugin.controller');router[_0x89b6('0x6')]('/',auth[_0x89b6('0x7')](),controller[_0x89b6('0x8')]);router[_0x89b6('0x6')](_0x89b6('0x9'),controller['webhookGet']);router[_0x89b6('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x89b6('0xa')]);router[_0x89b6('0x6')](_0x89b6('0xb'),auth['isAuthenticated'](),controller[_0x89b6('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e50c8,_0x14f151,_0x31f654){_0x31f654(null,path[_0x89b6('0xd')](config[_0x89b6('0xe')],_0x89b6('0xf')));},'filename':function(_0x29f806,_0x2b9605,_0x53620f){_0x2b9605[_0x89b6('0x10')]=_0x2b9605['originalname'][_0x89b6('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x53620f(null,util['format'](_0x89b6('0x12'),path[_0x89b6('0x13')](_0x2b9605[_0x89b6('0x10')],path[_0x89b6('0x14')](_0x2b9605[_0x89b6('0x10')])),Date['now'](),path['extname'](_0x2b9605[_0x89b6('0x10')])));}})});router['post']('/',upload[_0x89b6('0x15')](_0x89b6('0x16')),controller['upload']);router[_0x89b6('0x17')](_0x89b6('0x9'),controller[_0x89b6('0x18')]);router[_0x89b6('0x19')](_0x89b6('0x1a'),auth['isAuthenticated'](),controller[_0x89b6('0x1b')]);router[_0x89b6('0x1c')](_0x89b6('0x1a'),auth[_0x89b6('0x7')](),controller['delete']);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 f99adec..b8df115 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 _0xdbb6=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x5d8388,_0x166cd7){var _0x3aa743=function(_0x29c02f){while(--_0x29c02f){_0x5d8388['push'](_0x5d8388['shift']());}};_0x3aa743(++_0x166cd7);}(_0xdbb6,0x1f3));var _0x6dbb=function(_0xcfed23,_0x2718e7){_0xcfed23=_0xcfed23-0x0;var _0x33a8a0=_0xdbb6[_0xcfed23];return _0x33a8a0;};'use strict';var Sequelize=require('sequelize');module[_0x6dbb('0x0')]={'name':{'type':Sequelize[_0x6dbb('0x1')]},'type':{'type':Sequelize[_0x6dbb('0x2')]('html',_0x6dbb('0x3'))},'description':{'type':Sequelize[_0x6dbb('0x4')]},'version':{'type':Sequelize[_0x6dbb('0x4')]},'path':{'type':Sequelize[_0x6dbb('0x1')],'comment':_0x6dbb('0x5')},'active':{'type':Sequelize[_0x6dbb('0x6')],'defaultValue':0x0,'comment':_0x6dbb('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x6dbb('0x8'),_0x6dbb('0x9'),'always',_0x6dbb('0xa')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x6dbb('0x1')]},'adminUrl':{'type':Sequelize[_0x6dbb('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x6dbb('0x1')]},'scriptPath':{'type':Sequelize[_0x6dbb('0x1')]}}; \ No newline at end of file +var _0xeddd=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script'];(function(_0x283e45,_0x4e7e8b){var _0x1dad54=function(_0x2f47e5){while(--_0x2f47e5){_0x283e45['push'](_0x283e45['shift']());}};_0x1dad54(++_0x4e7e8b);}(_0xeddd,0x10f));var _0xdedd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xeddd[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xdedd('0x0'));module[_0xdedd('0x1')]={'name':{'type':Sequelize[_0xdedd('0x2')]},'type':{'type':Sequelize[_0xdedd('0x3')]('html',_0xdedd('0x4'))},'description':{'type':Sequelize[_0xdedd('0x5')]},'version':{'type':Sequelize[_0xdedd('0x5')]},'path':{'type':Sequelize[_0xdedd('0x2')],'comment':_0xdedd('0x6')},'active':{'type':Sequelize[_0xdedd('0x7')],'defaultValue':0x0,'comment':_0xdedd('0x8')},'sidebar':{'type':Sequelize[_0xdedd('0x3')]('adminOnly','agentOnly',_0xdedd('0x9'),_0xdedd('0xa')),'defaultValue':_0xdedd('0x9'),'comment':_0xdedd('0xb')},'icon':{'type':Sequelize[_0xdedd('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xdedd('0x2')]},'scriptName':{'type':Sequelize[_0xdedd('0x2')]},'scriptPath':{'type':Sequelize[_0xdedd('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5e3dce9..3642379 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 _0xac63=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','%s%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','update','then','get','Plugins','UserProfileResource','destroy','error','stack','name','send','index','map','Plugin','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','download','find','params','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','join','server/files/plugins','dirname','attachments/**/*','finalize','close','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','autoAssociation'];(function(_0x13366a,_0x160e15){var _0x394bf8=function(_0x3475f8){while(--_0x3475f8){_0x13366a['push'](_0x13366a['shift']());}};_0x394bf8(++_0x160e15);}(_0xac63,0xbd));var _0x3ac6=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0xac63[_0x2fee96];return _0x2e6ad1;};'use strict';var pdf=require(_0x3ac6('0x0'));var emlformat=require(_0x3ac6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3ac6('0x2'));var jsonpatch=require(_0x3ac6('0x3'));var rp=require(_0x3ac6('0x4'));var moment=require(_0x3ac6('0x5'));var BPromise=require(_0x3ac6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3ac6('0x7'));var sox=require(_0x3ac6('0x8'));var csv=require('to-csv');var ejs=require(_0x3ac6('0x9'));var fs=require('fs');var _=require(_0x3ac6('0xa'));var squel=require('squel');var crypto=require(_0x3ac6('0xb'));var jsforce=require(_0x3ac6('0xc'));var deskjs=require(_0x3ac6('0xd'));var toCsv=require(_0x3ac6('0xe'));var querystring=require('querystring');var Papa=require(_0x3ac6('0xf'));var extract=require(_0x3ac6('0x10'));var rimraf=require(_0x3ac6('0x11'));var archiver=require(_0x3ac6('0x12'));var Redis=require(_0x3ac6('0x13'));var authService=require(_0x3ac6('0x14'));var qs=require(_0x3ac6('0x15'));var as=require(_0x3ac6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3ac6('0x17'));var utils=require(_0x3ac6('0x18'));var config=require(_0x3ac6('0x19'));var db=require(_0x3ac6('0x1a'))['db'];config[_0x3ac6('0x1b')]=_[_0x3ac6('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3ac6('0x1d'))(new Redis(config[_0x3ac6('0x1b')]));require('./plugin.socket')[_0x3ac6('0x1e')](socket);function respondWithStatusCode(_0xf8607c,_0x418b98){_0x418b98=_0x418b98||0xcc;return function(_0x37d40d){if(_0x37d40d){return _0xf8607c[_0x3ac6('0x1f')](_0x418b98);}return _0xf8607c['status'](_0x418b98)[_0x3ac6('0x20')]();};}function respondWithResult(_0x444aae,_0x12b5b8){_0x12b5b8=_0x12b5b8||0xc8;return function(_0x4a96f3){if(_0x4a96f3){return _0x444aae[_0x3ac6('0x21')](_0x12b5b8)['json'](_0x4a96f3);}};}function respondWithFilteredResult(_0x2837b8,_0x51910a){return function(_0x48329c){if(_0x48329c){var _0x5160dc=_0x48329c[_0x3ac6('0x22')],_0x3e9792=_0x51910a[_0x3ac6('0x23')],_0x48aec7=_0x51910a[_0x3ac6('0x23')]+_0x51910a[_0x3ac6('0x24')],_0x1ffd33;if(_0x48aec7>=_0x5160dc){_0x48aec7=_0x5160dc;_0x1ffd33=0xc8;}else{_0x1ffd33=0xce;}_0x2837b8['status'](_0x1ffd33);return _0x2837b8[_0x3ac6('0x25')](_0x3ac6('0x26'),_0x3e9792+'-'+_0x48aec7+'/'+_0x5160dc)[_0x3ac6('0x27')](_0x48329c);}return null;};}function patchUpdates(_0x46ac66){return function(_0x5598ec){try{jsonpatch[_0x3ac6('0x28')](_0x5598ec,_0x46ac66,!![]);}catch(_0x5075ee){return BPromise['reject'](_0x5075ee);}return _0x5598ec['save']();};}function saveUpdates(_0x59ec86,_0x3d7931){return function(_0x2e873c){if(_0x2e873c){return _0x2e873c[_0x3ac6('0x29')](_0x59ec86)[_0x3ac6('0x2a')](function(_0x46884b){return _0x46884b;});}return null;};}function removeEntity(_0x3a361e,_0x48225e){return function(_0x240c33){if(_0x240c33){return _0x240c33['destroy']()['then'](function(){var _0x253241=_0x240c33[_0x3ac6('0x2b')]({'plain':!![]});var _0x4bd4ed=_0x3ac6('0x2c');return db[_0x3ac6('0x2d')][_0x3ac6('0x2e')]({'where':{'type':_0x4bd4ed,'resourceId':_0x253241['id']}})[_0x3ac6('0x2a')](function(){return _0x240c33;});})['then'](function(){_0x3a361e[_0x3ac6('0x21')](0xcc)[_0x3ac6('0x20')]();});}};}function handleEntityNotFound(_0xc6a6b5,_0x5d9c6f){return function(_0x1db60c){if(!_0x1db60c){_0xc6a6b5[_0x3ac6('0x1f')](0x194);}return _0x1db60c;};}function handleError(_0x317337,_0x4ab95b){_0x4ab95b=_0x4ab95b||0x1f4;return function(_0x22b7ce){logger[_0x3ac6('0x2f')](_0x22b7ce[_0x3ac6('0x30')]);if(_0x22b7ce[_0x3ac6('0x31')]){delete _0x22b7ce['name'];}_0x317337[_0x3ac6('0x21')](_0x4ab95b)[_0x3ac6('0x32')](_0x22b7ce);};}exports[_0x3ac6('0x33')]=function(_0x26dba4,_0x2d6221){var _0xbda473={},_0x216f8d={},_0x1c158b={'count':0x0,'rows':[]};var _0x5baaa8=_[_0x3ac6('0x34')](db[_0x3ac6('0x35')]['rawAttributes'],function(_0x1eacfa){return{'name':_0x1eacfa[_0x3ac6('0x36')],'type':_0x1eacfa[_0x3ac6('0x37')][_0x3ac6('0x38')]};});_0x216f8d[_0x3ac6('0x39')]=_[_0x3ac6('0x34')](_0x5baaa8,_0x3ac6('0x31'));_0x216f8d[_0x3ac6('0x3a')]=_[_0x3ac6('0x3b')](_0x26dba4[_0x3ac6('0x3a')]);_0x216f8d[_0x3ac6('0x3c')]=_[_0x3ac6('0x3d')](_0x216f8d[_0x3ac6('0x39')],_0x216f8d[_0x3ac6('0x3a')]);_0xbda473[_0x3ac6('0x3e')]=_[_0x3ac6('0x3d')](_0x216f8d[_0x3ac6('0x39')],qs[_0x3ac6('0x3f')](_0x26dba4[_0x3ac6('0x3a')][_0x3ac6('0x3f')]));_0xbda473['attributes']=_0xbda473[_0x3ac6('0x3e')][_0x3ac6('0x40')]?_0xbda473['attributes']:_0x216f8d[_0x3ac6('0x39')];if(!_0x26dba4[_0x3ac6('0x3a')][_0x3ac6('0x41')](_0x3ac6('0x42'))){_0xbda473['limit']=qs[_0x3ac6('0x24')](_0x26dba4[_0x3ac6('0x3a')][_0x3ac6('0x24')]);_0xbda473[_0x3ac6('0x23')]=qs[_0x3ac6('0x23')](_0x26dba4[_0x3ac6('0x3a')][_0x3ac6('0x23')]);}_0xbda473[_0x3ac6('0x43')]=qs['sort'](_0x26dba4[_0x3ac6('0x3a')][_0x3ac6('0x44')]);_0xbda473[_0x3ac6('0x45')]=qs[_0x3ac6('0x3c')](_['pick'](_0x26dba4['query'],_0x216f8d[_0x3ac6('0x3c')]));if(_0x26dba4[_0x3ac6('0x3a')][_0x3ac6('0x46')]){_0xbda473[_0x3ac6('0x45')]=_[_0x3ac6('0x47')](_0xbda473[_0x3ac6('0x45')],{'$or':_[_0x3ac6('0x34')](_0x5baaa8,function(_0x38be8a){if(_0x38be8a['type']!==_0x3ac6('0x48')){var _0x1434ed={};_0x1434ed[_0x38be8a['name']]={'$like':'%'+_0x26dba4[_0x3ac6('0x3a')]['filter']+'%'};return _0x1434ed;}})});}_0xbda473=_['merge']({},_0xbda473,_0x26dba4[_0x3ac6('0x49')]);var _0x1dcfb0={'where':_0xbda473[_0x3ac6('0x45')]};return db[_0x3ac6('0x35')][_0x3ac6('0x22')](_0x1dcfb0)[_0x3ac6('0x2a')](function(_0x228a1f){_0x1c158b[_0x3ac6('0x22')]=_0x228a1f;if(_0x26dba4[_0x3ac6('0x3a')][_0x3ac6('0x4a')]){_0xbda473[_0x3ac6('0x4b')]=[{'all':!![]}];}return db[_0x3ac6('0x35')][_0x3ac6('0x4c')](_0xbda473);})[_0x3ac6('0x2a')](function(_0x581a94){_0x1c158b[_0x3ac6('0x4d')]=_0x581a94;return _0x1c158b;})[_0x3ac6('0x2a')](respondWithFilteredResult(_0x2d6221,_0xbda473))[_0x3ac6('0x4e')](handleError(_0x2d6221,null));};exports[_0x3ac6('0x4f')]=function(_0x13217b,_0x36368b){var _0x24cdd6={'raw':!![],'where':{'id':_0x13217b['params']['id']}},_0x460b80={};_0x460b80['model']=_['keys'](db[_0x3ac6('0x35')][_0x3ac6('0x50')]);_0x460b80[_0x3ac6('0x3a')]=_[_0x3ac6('0x3b')](_0x13217b[_0x3ac6('0x3a')]);_0x460b80[_0x3ac6('0x3c')]=_[_0x3ac6('0x3d')](_0x460b80['model'],_0x460b80[_0x3ac6('0x3a')]);_0x24cdd6[_0x3ac6('0x3e')]=_[_0x3ac6('0x3d')](_0x460b80[_0x3ac6('0x39')],qs[_0x3ac6('0x3f')](_0x13217b[_0x3ac6('0x3a')][_0x3ac6('0x3f')]));_0x24cdd6[_0x3ac6('0x3e')]=_0x24cdd6[_0x3ac6('0x3e')][_0x3ac6('0x40')]?_0x24cdd6[_0x3ac6('0x3e')]:_0x460b80['model'];if(_0x13217b['query'][_0x3ac6('0x4a')]){_0x24cdd6[_0x3ac6('0x4b')]=[{'all':!![]}];}_0x24cdd6=_[_0x3ac6('0x47')]({},_0x24cdd6,_0x13217b[_0x3ac6('0x49')]);return db[_0x3ac6('0x35')]['find'](_0x24cdd6)[_0x3ac6('0x2a')](handleEntityNotFound(_0x36368b,null))[_0x3ac6('0x2a')](respondWithResult(_0x36368b,null))['catch'](handleError(_0x36368b,null));};exports[_0x3ac6('0x51')]=function(_0x3bc183,_0x3d9227,_0xf3338f){return db[_0x3ac6('0x35')][_0x3ac6('0x52')]({'where':{'id':_0x3bc183[_0x3ac6('0x53')]['id']},'attributes':['name',_0x3ac6('0x7')],'raw':!![]})[_0x3ac6('0x2a')](handleEntityNotFound(_0x3d9227,null))[_0x3ac6('0x2a')](function(_0x52a34f){if(_0x52a34f){var _0xa23eb8=path['join'](config[_0x3ac6('0x54')],'server/files/plugins',util[_0x3ac6('0x55')](_0x3ac6('0x56'),path[_0x3ac6('0x57')](_0x52a34f[_0x3ac6('0x7')])));var _0x3f0c97=fs[_0x3ac6('0x58')](_0xa23eb8);var _0x21807d=archiver(_0x3ac6('0x59'),{'zlib':{'level':0x9}});_0x21807d['on'](_0x3ac6('0x5a'),function(_0x4406d3){if(_0x4406d3[_0x3ac6('0x5b')]===_0x3ac6('0x5c')){logger['error'](_0x4406d3);}else{throw new db[(_0x3ac6('0x5d'))][(_0x3ac6('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x21807d['on']('error',function(_0x3f2b80){throw new db[(_0x3ac6('0x5d'))][(_0x3ac6('0x5e'))](_0x3ac6('0x5f'));});_0x21807d[_0x3ac6('0x60')](_0x3f0c97);_0x21807d[_0x3ac6('0x61')]('**/*',{'cwd':path[_0x3ac6('0x62')](config[_0x3ac6('0x54')],_0x3ac6('0x63'),path[_0x3ac6('0x64')](_0x52a34f[_0x3ac6('0x7')])),'ignore':[path[_0x3ac6('0x62')](path[_0x3ac6('0x57')](_0x52a34f['path']),'node_modules/**/*'),path['join'](path[_0x3ac6('0x57')](_0x52a34f['path']),_0x3ac6('0x65'))],'nodir':!![]})[_0x3ac6('0x66')]();_0x3f0c97['on'](_0x3ac6('0x67'),function(){if(!fs['existsSync'](_0xa23eb8)){throw new db[(_0x3ac6('0x5d'))][(_0x3ac6('0x5e'))]('Plugin\x20not\x20found');}return _0x3d9227[_0x3ac6('0x51')](_0xa23eb8,util[_0x3ac6('0x55')]('%s.zip',path[_0x3ac6('0x57')](_0x52a34f['path'])),function(_0x1c16f8){if(_0x1c16f8){throw new db['Sequelize'][(_0x3ac6('0x5e'))](_0x3ac6('0x68'));}fs[_0x3ac6('0x69')](_0xa23eb8);logger[_0x3ac6('0x6a')]('Download\x20completed');logger[_0x3ac6('0x6a')](_0x3ac6('0x6b'));});});}return null;})[_0x3ac6('0x4e')](handleError(_0x3d9227,null));};exports[_0x3ac6('0x6c')]=function(_0x81c5bf,_0x50c342,_0x49775e){var _0x13477d=path[_0x3ac6('0x57')](_0x81c5bf[_0x3ac6('0x6d')][_0x3ac6('0x6e')],path['extname'](_0x81c5bf[_0x3ac6('0x6d')][_0x3ac6('0x6e')]));var _0x3749d9=path[_0x3ac6('0x62')](config['root'],_0x3ac6('0x63'),_0x81c5bf['file'][_0x3ac6('0x6e')]);var _0xe68a4=path['join'](config[_0x3ac6('0x54')],_0x3ac6('0x63'),_0x13477d);logger[_0x3ac6('0x6a')](_0x3ac6('0x6f'),_0x3749d9);logger[_0x3ac6('0x6a')](_0x3ac6('0x70'),_0xe68a4);try{fs[_0x3ac6('0x71')](_0x3749d9,parseInt(_0x3ac6('0x72'),0x8));extract(_0x3749d9,{'dir':_0xe68a4},function(_0x253923){if(_0x253923){logger[_0x3ac6('0x2f')](_0x253923);handleError(_0x253923,!![]);};var _0x502e8b=fs[_0x3ac6('0x73')](_0xe68a4);if(_0x502e8b[_0x3ac6('0x40')]>0x1){removeReferences(_0x3749d9,_0xe68a4);logger[_0x3ac6('0x2f')](_0x3ac6('0x74'));return _0x49775e(new Error(_0x3ac6('0x74')));}var _0x595157=fs[_0x3ac6('0x75')](path[_0x3ac6('0x62')](_0xe68a4,_0x502e8b[0x0]));if(_0x595157[_0x3ac6('0x76')]()){removeReferences(_0x3749d9,_0xe68a4);logger['error'](_0x3ac6('0x74'));return _0x49775e(new Error(_0x3ac6('0x74')));}if(_0x595157[_0x3ac6('0x77')]()){var _0x3415da=fs[_0x3ac6('0x73')](path[_0x3ac6('0x62')](_0xe68a4,_0x502e8b[0x0]));if(_0x3415da[_0x3ac6('0x40')]===0x0){removeReferences(_0x3749d9,_0xe68a4);logger[_0x3ac6('0x2f')](_0x3ac6('0x74'));return _0x49775e(new Error('Invalid\x20plugin\x20structure'));}var _0x237776=_0x3415da[_0x3ac6('0x78')](function(_0x3f1f27){return _0x3f1f27===_0x3ac6('0x79');});if(!_0x237776){return _0x49775e(new Error(_0x3ac6('0x7a')));}var _0x15dac3=fs['readFileSync'](path[_0x3ac6('0x62')](_0xe68a4,_0x502e8b[0x0],'manifest.json'));var _0x320f4e=JSON[_0x3ac6('0x7b')](_0x15dac3);if(_0x3ac6('0x7c')==typeof _0x320f4e[_0x3ac6('0x31')]){return _0x49775e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x320f4e[_0x3ac6('0x37')]){return _0x49775e(new Error(_0x3ac6('0x7d')));}if(_0x3ac6('0x7c')==typeof _0x320f4e['version']){return _0x49775e(new Error(_0x3ac6('0x7e')));}if(_0x3ac6('0x7c')==typeof _0x320f4e[_0x3ac6('0x7f')]){return _0x49775e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x320f4e['type']===_0x3ac6('0x80')){if(_0x3ac6('0x7c')==typeof _0x320f4e[_0x3ac6('0x7f')]['views']){return _0x49775e(new Error(_0x3ac6('0x81')));}if(_0x3ac6('0x7c')==typeof _0x320f4e[_0x3ac6('0x7f')][_0x3ac6('0x82')][_0x3ac6('0x83')]&&_0x3ac6('0x7c')==typeof _0x320f4e[_0x3ac6('0x7f')]['views'][_0x3ac6('0x84')]){return _0x49775e(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x320f4e['type']===_0x3ac6('0x85')){if(_0x3ac6('0x7c')==typeof _0x320f4e[_0x3ac6('0x7f')]['scriptName']){return _0x49775e(new Error(_0x3ac6('0x86')));}if('undefined'==typeof _0x320f4e[_0x3ac6('0x7f')][_0x3ac6('0x87')]){return _0x49775e(new Error(_0x3ac6('0x88')));}}else{return _0x49775e(new Error(_0x3ac6('0x89')));}var _0x3ccc2e=_0x320f4e[_0x3ac6('0x31')];var _0x4123a5=_0x320f4e['description'];var _0x41e80a=_0x320f4e['type'];var _0x4982b1=_0x320f4e[_0x3ac6('0x8a')]?_0x320f4e['sidebar']:_0x3ac6('0x8b');var _0x22bc24=_0x320f4e['icon']?_0x320f4e[_0x3ac6('0x8c')]:'icon-apps';var _0x3234d0='';var _0x4e2861='';var _0x3554a2='';var _0x388aa8='';var _0x908907=_0x320f4e[_0x3ac6('0x8d')];if(_0x41e80a==='html'){if(_0x3ac6('0x7c')!=typeof _0x320f4e['parameters'][_0x3ac6('0x82')][_0x3ac6('0x83')]){var _0x43b621=_0x320f4e[_0x3ac6('0x7f')][_0x3ac6('0x82')][_0x3ac6('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x3ac6('0x8e')](_0x43b621)){_0x3234d0=path['join'](_0x3ac6('0x8f'),_0x13477d,_0x502e8b[0x0],_0x43b621);}else{_0x3234d0=_0x43b621;}}else{logger[_0x3ac6('0x6a')](_0x3ac6('0x90'));}if(_0x3ac6('0x7c')!=typeof _0x320f4e['parameters']['views'][_0x3ac6('0x84')]){var _0x13e5cf=_0x320f4e[_0x3ac6('0x7f')][_0x3ac6('0x82')][_0x3ac6('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x3ac6('0x8e')](_0x13e5cf)){_0x4e2861=path[_0x3ac6('0x62')](_0x3ac6('0x8f'),_0x13477d,_0x502e8b[0x0],_0x13e5cf);}else{_0x4e2861=_0x13e5cf;}}else{logger['info'](_0x3ac6('0x91'));}}else if(_0x41e80a===_0x3ac6('0x85')){_0x3554a2=_0x320f4e['parameters']['scriptName'];_0x388aa8=_0x320f4e[_0x3ac6('0x7f')][_0x3ac6('0x87')];if(_0x3ac6('0x7c')!=typeof _0x320f4e[_0x3ac6('0x7f')]['views']){if('undefined'!=typeof _0x320f4e[_0x3ac6('0x7f')][_0x3ac6('0x82')][_0x3ac6('0x83')]){var _0x43b621=_0x320f4e[_0x3ac6('0x7f')][_0x3ac6('0x82')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x3ac6('0x8e')](_0x43b621)){_0x3234d0=path[_0x3ac6('0x62')]('plugins',_0x13477d,_0x502e8b[0x0],_0x43b621);}else{_0x3234d0=_0x43b621;}}if('undefined'!=typeof _0x320f4e[_0x3ac6('0x7f')][_0x3ac6('0x82')][_0x3ac6('0x84')]){var _0x13e5cf=_0x320f4e[_0x3ac6('0x7f')]['views'][_0x3ac6('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x3ac6('0x8e')](_0x13e5cf)){_0x4e2861=path[_0x3ac6('0x62')](_0x3ac6('0x8f'),_0x13477d,_0x502e8b[0x0],_0x13e5cf);}else{_0x4e2861=_0x13e5cf;}}}}var _0x25d95c={'name':_0x3ccc2e,'description':_0x4123a5,'path':path['join'](_0x13477d,_0x502e8b[0x0]),'type':_0x41e80a,'sidebar':_0x4982b1,'icon':_0x22bc24,'adminUrl':_0x3234d0,'agentUrl':_0x4e2861,'scriptName':_0x3554a2,'scriptPath':_0x388aa8,'version':_0x908907};removeReferences(_0x3749d9,null);return db['Plugin'][_0x3ac6('0x92')](_0x25d95c)[_0x3ac6('0x2a')](function(_0xa3cb62){var _0x1f647e={'role':_0x81c5bf[_0x3ac6('0x93')][_0x3ac6('0x94')],'userProfileId':_0x81c5bf[_0x3ac6('0x93')]['userProfileId']};if(!_0x1f647e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f647e['role']==='user'){var _0x2c500d=_0xa3cb62['get']({'plain':!![]});return db['UserProfileSection'][_0x3ac6('0x52')]({'where':{'name':'Plugins','userProfileId':_0x1f647e[_0x3ac6('0x95')]},'raw':!![]})['then'](function(_0x39317c){if(_0x39317c&&_0x39317c[_0x3ac6('0x96')]===0x0){return db['UserProfileResource'][_0x3ac6('0x92')]({'name':_0x2c500d[_0x3ac6('0x31')],'resourceId':_0x2c500d['id'],'type':_0x39317c['name'],'sectionId':_0x39317c['id']},{})[_0x3ac6('0x2a')](function(){return _0xa3cb62;});}else{return _0xa3cb62;}})['catch'](function(_0x5b4871){logger[_0x3ac6('0x2f')](_0x3ac6('0x97'),_0x5b4871);throw _0x5b4871;});}return _0xa3cb62;})['then'](respondWithResult(_0x50c342,null))[_0x3ac6('0x4e')](handleError(_0x50c342,null));}});}catch(_0x43dd0c){_0x50c342[_0x3ac6('0x21')](0x1f4)[_0x3ac6('0x32')](_0x43dd0c);}};function removeReferences(_0x4eac09,_0x46d84b){try{if(_0x4eac09){fs[_0x3ac6('0x69')](_0x4eac09);logger['info'](_0x3ac6('0x98'));}if(_0x46d84b){rimraf(_0x46d84b,function(){});logger[_0x3ac6('0x6a')]('Extracted\x20folder\x20removed');}}catch(_0x516764){logger[_0x3ac6('0x2f')](_0x516764);}}exports[_0x3ac6('0x29')]=function(_0x2bd3d5,_0x485b7a,_0x419c69){return db['Plugin']['find']({'where':{'id':_0x2bd3d5['params']['id']}})[_0x3ac6('0x2a')](handleEntityNotFound(_0x485b7a,null))[_0x3ac6('0x2a')](saveUpdates(_0x2bd3d5['body'],null))[_0x3ac6('0x2a')](respondWithResult(_0x485b7a,null))[_0x3ac6('0x4e')](handleError(_0x485b7a,null));};exports[_0x3ac6('0x99')]=function(_0xb02da3,_0x42ff9d,_0x1d5129){return db[_0x3ac6('0x35')]['find']({'where':{'id':_0xb02da3['params']['id']}})['then'](function(_0x4b00ee){if(_0x4b00ee){return _0x4b00ee[_0x3ac6('0x2e')]();}})[_0x3ac6('0x2a')](function(_0xc4b197){rimraf(path[_0x3ac6('0x62')](config[_0x3ac6('0x54')],'server/files/plugins',path[_0x3ac6('0x64')](_0xc4b197['path'])),function(){});return _0xc4b197;})[_0x3ac6('0x2a')](handleEntityNotFound(_0x42ff9d,null))[_0x3ac6('0x2a')](respondWithStatusCode(_0x42ff9d,null))[_0x3ac6('0x4e')](handleError(_0x42ff9d,null));};exports[_0x3ac6('0x9a')]=function(_0xb84909,_0x49c064,_0xa06499){return BPromise[_0x3ac6('0x9b')]()[_0x3ac6('0x2a')](function(){if(!_0xb84909[_0x3ac6('0x3a')][_0x3ac6('0x7')]){throw new Error(_0x3ac6('0x9c'));}if(!_0xb84909[_0x3ac6('0x3a')]['port']){throw new Error(_0x3ac6('0x9d'));}var _0x197960=_0xb84909['query']['hostname']?_0xb84909[_0x3ac6('0x3a')][_0x3ac6('0x9e')]+':'+_0xb84909[_0x3ac6('0x3a')][_0x3ac6('0x9f')]:_0x3ac6('0xa0')+_0xb84909['query'][_0x3ac6('0x9f')];var _0x1f2d69=_0xb84909[_0x3ac6('0x3a')][_0x3ac6('0x27')]?_0xb84909['query'][_0x3ac6('0x27')]:!![];var _0x219b1f=_0xb84909[_0x3ac6('0x3a')][_0x3ac6('0xa1')]?_0xb84909[_0x3ac6('0x3a')][_0x3ac6('0xa1')]:null;var _0x820d02={'method':_0xb84909[_0x3ac6('0xa2')],'uri':util['format']('%s%s',_0x197960,_0xb84909[_0x3ac6('0x3a')][_0x3ac6('0x7')]),'json':_0x1f2d69,'resolveWithFullResponse':!![],'encoding':_0x219b1f,'qs':_0xb84909[_0x3ac6('0x3a')]};if(_0xb84909[_0x3ac6('0xa3')]){_0x820d02['headers']=_0xb84909[_0x3ac6('0xa3')];if(_0x820d02[_0x3ac6('0xa3')][_0x3ac6('0xa4')]){delete _0x820d02[_0x3ac6('0xa3')][_0x3ac6('0xa4')];}}if(_0x820d02[_0x3ac6('0xa3')][_0x3ac6('0xa5')]){delete _0x820d02[_0x3ac6('0xa3')][_0x3ac6('0xa5')];}return rp(_0x820d02);})['then'](function(_0x17c9ad){if(_0x17c9ad){_0x49c064[_0x3ac6('0x25')](_0x17c9ad['headers']);logger['info'](_0x17c9ad[_0x3ac6('0x93')]);if(_[_0x3ac6('0xa6')](_0xb84909[_0x3ac6('0x3a')][_0x3ac6('0x7')],'download')&&_0x17c9ad['statusCode']==0x1f4){return _0x49c064[_0x3ac6('0x1f')](_0x17c9ad['statusCode']);}else{return _0x49c064[_0x3ac6('0x21')](_0x17c9ad[_0x3ac6('0xa7')])[_0x3ac6('0x32')](_0x17c9ad[_0x3ac6('0x93')]);}}else{return _0x49c064['sendStatus'](0xc8);}})[_0x3ac6('0x4e')](handleError(_0x49c064,null));};exports[_0x3ac6('0xa8')]=function(_0x47618b,_0x1f1503,_0x43c550){return BPromise['resolve']()[_0x3ac6('0x2a')](function(){if(!_0x47618b['query'][_0x3ac6('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x47618b[_0x3ac6('0x3a')]['port']){throw new Error(_0x3ac6('0x9d'));}var _0x1fbae8=_0x47618b[_0x3ac6('0x3a')][_0x3ac6('0x9e')]?_0x47618b[_0x3ac6('0x3a')][_0x3ac6('0x9e')]+':'+_0x47618b['query'][_0x3ac6('0x9f')]:'http://localhost:'+_0x47618b[_0x3ac6('0x3a')]['port'];var _0x449016=_0x47618b[_0x3ac6('0x3a')]['json']?_0x47618b[_0x3ac6('0x3a')][_0x3ac6('0x27')]:!![];var _0x508468=_0x47618b[_0x3ac6('0x3a')]['encoding']?_0x47618b[_0x3ac6('0x3a')][_0x3ac6('0xa1')]:null;var _0x54898b={'method':_0x47618b['method'],'uri':util[_0x3ac6('0x55')](_0x3ac6('0xa9'),_0x1fbae8,_0x47618b[_0x3ac6('0x3a')][_0x3ac6('0x7')]),'json':_0x449016,'resolveWithFullResponse':!![],'encoding':_0x508468,'body':_0x47618b['body']};if(_0x47618b[_0x3ac6('0xa3')]){_0x54898b[_0x3ac6('0xa3')]=_0x47618b[_0x3ac6('0xa3')];if(_0x54898b['headers'][_0x3ac6('0xa4')]){delete _0x54898b[_0x3ac6('0xa3')][_0x3ac6('0xa4')];}}if(_0x54898b[_0x3ac6('0xa3')][_0x3ac6('0xa5')]){delete _0x54898b['headers'][_0x3ac6('0xa5')];}return rp(_0x54898b);})['then'](function(_0x297b10){if(_0x297b10){_0x1f1503[_0x3ac6('0x25')](_0x297b10['headers']);logger['info'](_0x297b10['body']);return _0x1f1503['status'](_0x297b10[_0x3ac6('0xa7')])[_0x3ac6('0x32')](_0x297b10[_0x3ac6('0x93')]);}else{return _0x1f1503[_0x3ac6('0x1f')](0xc8);}})[_0x3ac6('0x4e')](handleError(_0x1f1503,null));}; \ No newline at end of file +var _0x0f63=['0777','readdirSync','Invalid\x20plugin\x20structure','isFile','manifest.json','readFileSync','undefined','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','type','views','Invalid\x20manifest:\x20views\x20missing','admin','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','update','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','status','end','json','count','offset','limit','apply','save','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','map','Plugin','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','params','find','catch','download','join','root','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','server/files/plugins','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync'];(function(_0x23eef6,_0x476f63){var _0x45b0dd=function(_0x578260){while(--_0x578260){_0x23eef6['push'](_0x23eef6['shift']());}};_0x45b0dd(++_0x476f63);}(_0x0f63,0xe0));var _0x30f6=function(_0x3f6a51,_0x123741){_0x3f6a51=_0x3f6a51-0x0;var _0x503fa9=_0x0f63[_0x3f6a51];return _0x503fa9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x30f6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x30f6('0x1'));var BPromise=require(_0x30f6('0x2'));var Mustache=require(_0x30f6('0x3'));var util=require(_0x30f6('0x4'));var path=require(_0x30f6('0x5'));var sox=require(_0x30f6('0x6'));var csv=require(_0x30f6('0x7'));var ejs=require(_0x30f6('0x8'));var fs=require('fs');var _=require(_0x30f6('0x9'));var squel=require('squel');var crypto=require(_0x30f6('0xa'));var jsforce=require(_0x30f6('0xb'));var deskjs=require(_0x30f6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x30f6('0xd'));var Papa=require(_0x30f6('0xe'));var extract=require(_0x30f6('0xf'));var rimraf=require(_0x30f6('0x10'));var archiver=require(_0x30f6('0x11'));var Redis=require(_0x30f6('0x12'));var authService=require(_0x30f6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x30f6('0x14'));var hardwareService=require(_0x30f6('0x15'));var logger=require(_0x30f6('0x16'))('api');var utils=require(_0x30f6('0x17'));var config=require(_0x30f6('0x18'));var db=require('../../mysqldb')['db'];config[_0x30f6('0x19')]=_[_0x30f6('0x1a')](config[_0x30f6('0x19')],{'host':_0x30f6('0x1b'),'port':0x18eb});var socket=require(_0x30f6('0x1c'))(new Redis(config[_0x30f6('0x19')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x29d3a1,_0x3365f1){_0x3365f1=_0x3365f1||0xcc;return function(_0x3a6eb7){if(_0x3a6eb7){return _0x29d3a1['sendStatus'](_0x3365f1);}return _0x29d3a1[_0x30f6('0x1d')](_0x3365f1)[_0x30f6('0x1e')]();};}function respondWithResult(_0x1c50a3,_0x378c42){_0x378c42=_0x378c42||0xc8;return function(_0x2b2730){if(_0x2b2730){return _0x1c50a3[_0x30f6('0x1d')](_0x378c42)[_0x30f6('0x1f')](_0x2b2730);}};}function respondWithFilteredResult(_0x1af51e,_0x20e955){return function(_0x4b44d0){if(_0x4b44d0){var _0x56f56b=_0x4b44d0[_0x30f6('0x20')],_0x2d739d=_0x20e955[_0x30f6('0x21')],_0x15cfef=_0x20e955[_0x30f6('0x21')]+_0x20e955[_0x30f6('0x22')],_0x57245e;if(_0x15cfef>=_0x56f56b){_0x15cfef=_0x56f56b;_0x57245e=0xc8;}else{_0x57245e=0xce;}_0x1af51e[_0x30f6('0x1d')](_0x57245e);return _0x1af51e['set']('Content-Range',_0x2d739d+'-'+_0x15cfef+'/'+_0x56f56b)[_0x30f6('0x1f')](_0x4b44d0);}return null;};}function patchUpdates(_0x256a73){return function(_0x9efe2d){try{jsonpatch[_0x30f6('0x23')](_0x9efe2d,_0x256a73,!![]);}catch(_0x2e94aa){return BPromise['reject'](_0x2e94aa);}return _0x9efe2d[_0x30f6('0x24')]();};}function saveUpdates(_0x387874,_0x1b724f){return function(_0x1931de){if(_0x1931de){return _0x1931de['update'](_0x387874)[_0x30f6('0x25')](function(_0x3ecdd1){return _0x3ecdd1;});}return null;};}function removeEntity(_0x24e49b,_0x5ae818){return function(_0x2c4f9b){if(_0x2c4f9b){return _0x2c4f9b[_0x30f6('0x26')]()[_0x30f6('0x25')](function(){var _0x27ea04=_0x2c4f9b[_0x30f6('0x27')]({'plain':!![]});var _0x1e3915=_0x30f6('0x28');return db[_0x30f6('0x29')]['destroy']({'where':{'type':_0x1e3915,'resourceId':_0x27ea04['id']}})[_0x30f6('0x25')](function(){return _0x2c4f9b;});})[_0x30f6('0x25')](function(){_0x24e49b['status'](0xcc)[_0x30f6('0x1e')]();});}};}function handleEntityNotFound(_0x244528,_0x353adf){return function(_0x29b4e0){if(!_0x29b4e0){_0x244528[_0x30f6('0x2a')](0x194);}return _0x29b4e0;};}function handleError(_0x512fe8,_0xec3927){_0xec3927=_0xec3927||0x1f4;return function(_0x9e6023){logger[_0x30f6('0x2b')](_0x9e6023[_0x30f6('0x2c')]);if(_0x9e6023[_0x30f6('0x2d')]){delete _0x9e6023['name'];}_0x512fe8[_0x30f6('0x1d')](_0xec3927)[_0x30f6('0x2e')](_0x9e6023);};}exports[_0x30f6('0x2f')]=function(_0x59ab6e,_0xed575f){var _0x4b39d7={},_0x78e729={},_0x3f6306={'count':0x0,'rows':[]};var _0x42f2d0=_[_0x30f6('0x30')](db[_0x30f6('0x31')]['rawAttributes'],function(_0x4563f3){return{'name':_0x4563f3['fieldName'],'type':_0x4563f3['type'][_0x30f6('0x32')]};});_0x78e729['model']=_[_0x30f6('0x30')](_0x42f2d0,_0x30f6('0x2d'));_0x78e729[_0x30f6('0x33')]=_[_0x30f6('0x34')](_0x59ab6e[_0x30f6('0x33')]);_0x78e729[_0x30f6('0x35')]=_['intersection'](_0x78e729[_0x30f6('0x36')],_0x78e729[_0x30f6('0x33')]);_0x4b39d7['attributes']=_[_0x30f6('0x37')](_0x78e729['model'],qs[_0x30f6('0x38')](_0x59ab6e['query'][_0x30f6('0x38')]));_0x4b39d7['attributes']=_0x4b39d7[_0x30f6('0x39')][_0x30f6('0x3a')]?_0x4b39d7['attributes']:_0x78e729[_0x30f6('0x36')];if(!_0x59ab6e['query'][_0x30f6('0x3b')](_0x30f6('0x3c'))){_0x4b39d7[_0x30f6('0x22')]=qs[_0x30f6('0x22')](_0x59ab6e[_0x30f6('0x33')]['limit']);_0x4b39d7[_0x30f6('0x21')]=qs['offset'](_0x59ab6e[_0x30f6('0x33')]['offset']);}_0x4b39d7[_0x30f6('0x3d')]=qs[_0x30f6('0x3e')](_0x59ab6e['query'][_0x30f6('0x3e')]);_0x4b39d7['where']=qs[_0x30f6('0x35')](_['pick'](_0x59ab6e[_0x30f6('0x33')],_0x78e729[_0x30f6('0x35')]));if(_0x59ab6e[_0x30f6('0x33')]['filter']){_0x4b39d7[_0x30f6('0x3f')]=_['merge'](_0x4b39d7['where'],{'$or':_['map'](_0x42f2d0,function(_0x25cc62){if(_0x25cc62['type']!==_0x30f6('0x40')){var _0x19cab3={};_0x19cab3[_0x25cc62[_0x30f6('0x2d')]]={'$like':'%'+_0x59ab6e[_0x30f6('0x33')][_0x30f6('0x41')]+'%'};return _0x19cab3;}})});}_0x4b39d7=_[_0x30f6('0x42')]({},_0x4b39d7,_0x59ab6e[_0x30f6('0x43')]);var _0x4bb5e2={'where':_0x4b39d7[_0x30f6('0x3f')]};return db['Plugin'][_0x30f6('0x20')](_0x4bb5e2)[_0x30f6('0x25')](function(_0x12886e){_0x3f6306[_0x30f6('0x20')]=_0x12886e;if(_0x59ab6e[_0x30f6('0x33')][_0x30f6('0x44')]){_0x4b39d7[_0x30f6('0x45')]=[{'all':!![]}];}return db[_0x30f6('0x31')]['findAll'](_0x4b39d7);})[_0x30f6('0x25')](function(_0x353a4a){_0x3f6306['rows']=_0x353a4a;return _0x3f6306;})[_0x30f6('0x25')](respondWithFilteredResult(_0xed575f,_0x4b39d7))['catch'](handleError(_0xed575f,null));};exports['show']=function(_0x131aa7,_0x27b94f){var _0xe5eff5={'raw':!![],'where':{'id':_0x131aa7[_0x30f6('0x46')]['id']}},_0x2c5a74={};_0x2c5a74[_0x30f6('0x36')]=_[_0x30f6('0x34')](db['Plugin']['rawAttributes']);_0x2c5a74['query']=_[_0x30f6('0x34')](_0x131aa7['query']);_0x2c5a74[_0x30f6('0x35')]=_[_0x30f6('0x37')](_0x2c5a74[_0x30f6('0x36')],_0x2c5a74[_0x30f6('0x33')]);_0xe5eff5[_0x30f6('0x39')]=_[_0x30f6('0x37')](_0x2c5a74[_0x30f6('0x36')],qs[_0x30f6('0x38')](_0x131aa7[_0x30f6('0x33')]['fields']));_0xe5eff5['attributes']=_0xe5eff5['attributes'][_0x30f6('0x3a')]?_0xe5eff5[_0x30f6('0x39')]:_0x2c5a74[_0x30f6('0x36')];if(_0x131aa7['query'][_0x30f6('0x44')]){_0xe5eff5['include']=[{'all':!![]}];}_0xe5eff5=_['merge']({},_0xe5eff5,_0x131aa7[_0x30f6('0x43')]);return db[_0x30f6('0x31')][_0x30f6('0x47')](_0xe5eff5)[_0x30f6('0x25')](handleEntityNotFound(_0x27b94f,null))[_0x30f6('0x25')](respondWithResult(_0x27b94f,null))[_0x30f6('0x48')](handleError(_0x27b94f,null));};exports[_0x30f6('0x49')]=function(_0x57bc82,_0x325d51,_0x4cfe19){return db[_0x30f6('0x31')][_0x30f6('0x47')]({'where':{'id':_0x57bc82[_0x30f6('0x46')]['id']},'attributes':[_0x30f6('0x2d'),_0x30f6('0x5')],'raw':!![]})['then'](handleEntityNotFound(_0x325d51,null))[_0x30f6('0x25')](function(_0x493260){if(_0x493260){var _0x48ff55=path[_0x30f6('0x4a')](config[_0x30f6('0x4b')],'server/files/plugins',util[_0x30f6('0x4c')](_0x30f6('0x4d'),path[_0x30f6('0x4e')](_0x493260['path'])));var _0x27b35f=fs[_0x30f6('0x4f')](_0x48ff55);var _0x143727=archiver(_0x30f6('0x50'),{'zlib':{'level':0x9}});_0x143727['on'](_0x30f6('0x51'),function(_0x2be66b){if(_0x2be66b['code']===_0x30f6('0x52')){logger[_0x30f6('0x2b')](_0x2be66b);}else{throw new db['Sequelize'][(_0x30f6('0x53'))](_0x30f6('0x54'));}});_0x143727['on'](_0x30f6('0x2b'),function(_0x4ae732){throw new db[(_0x30f6('0x55'))][(_0x30f6('0x53'))](_0x30f6('0x54'));});_0x143727[_0x30f6('0x56')](_0x27b35f);_0x143727[_0x30f6('0x57')](_0x30f6('0x58'),{'cwd':path[_0x30f6('0x4a')](config['root'],_0x30f6('0x59'),path['dirname'](_0x493260['path'])),'ignore':[path[_0x30f6('0x4a')](path['basename'](_0x493260[_0x30f6('0x5')]),'node_modules/**/*'),path[_0x30f6('0x4a')](path[_0x30f6('0x4e')](_0x493260[_0x30f6('0x5')]),_0x30f6('0x5a'))],'nodir':!![]})[_0x30f6('0x5b')]();_0x27b35f['on']('close',function(){if(!fs[_0x30f6('0x5c')](_0x48ff55)){throw new db[(_0x30f6('0x55'))]['Error'](_0x30f6('0x5d'));}return _0x325d51[_0x30f6('0x49')](_0x48ff55,util[_0x30f6('0x4c')](_0x30f6('0x4d'),path[_0x30f6('0x4e')](_0x493260[_0x30f6('0x5')])),function(_0x595704){if(_0x595704){throw new db[(_0x30f6('0x55'))]['Error'](_0x30f6('0x5e'));}fs['unlinkSync'](_0x48ff55);logger[_0x30f6('0x5f')](_0x30f6('0x60'));logger[_0x30f6('0x5f')](_0x30f6('0x61'));});});}return null;})[_0x30f6('0x48')](handleError(_0x325d51,null));};exports[_0x30f6('0x62')]=function(_0x51c1a1,_0x4a4bcf,_0x5f2c6f){var _0x1fb45d=path[_0x30f6('0x4e')](_0x51c1a1[_0x30f6('0x63')][_0x30f6('0x64')],path[_0x30f6('0x65')](_0x51c1a1[_0x30f6('0x63')]['filename']));var _0x25e14f=path['join'](config[_0x30f6('0x4b')],_0x30f6('0x59'),_0x51c1a1[_0x30f6('0x63')][_0x30f6('0x64')]);var _0x4b4b1b=path[_0x30f6('0x4a')](config[_0x30f6('0x4b')],_0x30f6('0x59'),_0x1fb45d);logger[_0x30f6('0x5f')]('Plugin\x20upload\x20filepath:\x20%s',_0x25e14f);logger[_0x30f6('0x5f')](_0x30f6('0x66'),_0x4b4b1b);try{fs[_0x30f6('0x67')](_0x25e14f,parseInt(_0x30f6('0x68'),0x8));extract(_0x25e14f,{'dir':_0x4b4b1b},function(_0x48d18c){if(_0x48d18c){logger['error'](_0x48d18c);handleError(_0x48d18c,!![]);};var _0x3d2664=fs[_0x30f6('0x69')](_0x4b4b1b);if(_0x3d2664['length']>0x1){removeReferences(_0x25e14f,_0x4b4b1b);logger[_0x30f6('0x2b')](_0x30f6('0x6a'));return _0x5f2c6f(new Error(_0x30f6('0x6a')));}var _0x4bd044=fs['lstatSync'](path['join'](_0x4b4b1b,_0x3d2664[0x0]));if(_0x4bd044[_0x30f6('0x6b')]()){removeReferences(_0x25e14f,_0x4b4b1b);logger['error'](_0x30f6('0x6a'));return _0x5f2c6f(new Error(_0x30f6('0x6a')));}if(_0x4bd044['isDirectory']()){var _0x47ef20=fs[_0x30f6('0x69')](path[_0x30f6('0x4a')](_0x4b4b1b,_0x3d2664[0x0]));if(_0x47ef20[_0x30f6('0x3a')]===0x0){removeReferences(_0x25e14f,_0x4b4b1b);logger['error']('Invalid\x20plugin\x20structure');return _0x5f2c6f(new Error('Invalid\x20plugin\x20structure'));}var _0x33805c=_0x47ef20['some'](function(_0x5cbebe){return _0x5cbebe===_0x30f6('0x6c');});if(!_0x33805c){return _0x5f2c6f(new Error('Plugin\x20manifest\x20missing'));}var _0x24c8ae=fs[_0x30f6('0x6d')](path[_0x30f6('0x4a')](_0x4b4b1b,_0x3d2664[0x0],_0x30f6('0x6c')));var _0x6adc6e=JSON['parse'](_0x24c8ae);if(_0x30f6('0x6e')==typeof _0x6adc6e[_0x30f6('0x2d')]){return _0x5f2c6f(new Error(_0x30f6('0x6f')));}if(_0x30f6('0x6e')==typeof _0x6adc6e['type']){return _0x5f2c6f(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x30f6('0x6e')==typeof _0x6adc6e[_0x30f6('0x70')]){return _0x5f2c6f(new Error(_0x30f6('0x71')));}if(_0x30f6('0x6e')==typeof _0x6adc6e[_0x30f6('0x72')]){return _0x5f2c6f(new Error(_0x30f6('0x73')));}if(_0x6adc6e[_0x30f6('0x74')]==='html'){if('undefined'==typeof _0x6adc6e['parameters'][_0x30f6('0x75')]){return _0x5f2c6f(new Error(_0x30f6('0x76')));}if(_0x30f6('0x6e')==typeof _0x6adc6e['parameters']['views'][_0x30f6('0x77')]&&'undefined'==typeof _0x6adc6e[_0x30f6('0x72')][_0x30f6('0x75')]['agent']){return _0x5f2c6f(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x6adc6e[_0x30f6('0x74')]===_0x30f6('0x78')){if(_0x30f6('0x6e')==typeof _0x6adc6e[_0x30f6('0x72')]['scriptName']){return _0x5f2c6f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x30f6('0x6e')==typeof _0x6adc6e[_0x30f6('0x72')][_0x30f6('0x79')]){return _0x5f2c6f(new Error(_0x30f6('0x7a')));}}else{return _0x5f2c6f(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2182a7=_0x6adc6e[_0x30f6('0x2d')];var _0x1c2ac0=_0x6adc6e['description'];var _0x4fa641=_0x6adc6e['type'];var _0xd46c9a=_0x6adc6e[_0x30f6('0x7b')]?_0x6adc6e['sidebar']:_0x30f6('0x7c');var _0x2d152a=_0x6adc6e[_0x30f6('0x7d')]?_0x6adc6e[_0x30f6('0x7d')]:_0x30f6('0x7e');var _0x4be16d='';var _0x22f0c6='';var _0x375901='';var _0x525ab9='';var _0x132c5b=_0x6adc6e[_0x30f6('0x70')];if(_0x4fa641===_0x30f6('0x7f')){if('undefined'!=typeof _0x6adc6e['parameters'][_0x30f6('0x75')]['admin']){var _0x364946=_0x6adc6e[_0x30f6('0x72')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x30f6('0x80')](_0x364946)){_0x4be16d=path['join'](_0x30f6('0x81'),_0x1fb45d,_0x3d2664[0x0],_0x364946);}else{_0x4be16d=_0x364946;}}else{logger[_0x30f6('0x5f')](_0x30f6('0x82'));}if(_0x30f6('0x6e')!=typeof _0x6adc6e[_0x30f6('0x72')]['views'][_0x30f6('0x83')]){var _0x3091ec=_0x6adc6e[_0x30f6('0x72')][_0x30f6('0x75')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x30f6('0x80')](_0x3091ec)){_0x22f0c6=path[_0x30f6('0x4a')](_0x30f6('0x81'),_0x1fb45d,_0x3d2664[0x0],_0x3091ec);}else{_0x22f0c6=_0x3091ec;}}else{logger['info'](_0x30f6('0x84'));}}else if(_0x4fa641===_0x30f6('0x78')){_0x375901=_0x6adc6e[_0x30f6('0x72')][_0x30f6('0x85')];_0x525ab9=_0x6adc6e[_0x30f6('0x72')][_0x30f6('0x79')];if(_0x30f6('0x6e')!=typeof _0x6adc6e[_0x30f6('0x72')]['views']){if(_0x30f6('0x6e')!=typeof _0x6adc6e[_0x30f6('0x72')][_0x30f6('0x75')][_0x30f6('0x77')]){var _0x364946=_0x6adc6e[_0x30f6('0x72')]['views'][_0x30f6('0x77')];if(!/^(f|ht)tps?:\/\//i[_0x30f6('0x80')](_0x364946)){_0x4be16d=path[_0x30f6('0x4a')]('plugins',_0x1fb45d,_0x3d2664[0x0],_0x364946);}else{_0x4be16d=_0x364946;}}if('undefined'!=typeof _0x6adc6e[_0x30f6('0x72')]['views']['agent']){var _0x3091ec=_0x6adc6e['parameters'][_0x30f6('0x75')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x30f6('0x80')](_0x3091ec)){_0x22f0c6=path[_0x30f6('0x4a')](_0x30f6('0x81'),_0x1fb45d,_0x3d2664[0x0],_0x3091ec);}else{_0x22f0c6=_0x3091ec;}}}}var _0x21bddb={'name':_0x2182a7,'description':_0x1c2ac0,'path':path['join'](_0x1fb45d,_0x3d2664[0x0]),'type':_0x4fa641,'sidebar':_0xd46c9a,'icon':_0x2d152a,'adminUrl':_0x4be16d,'agentUrl':_0x22f0c6,'scriptName':_0x375901,'scriptPath':_0x525ab9,'version':_0x132c5b};removeReferences(_0x25e14f,null);return db['Plugin'][_0x30f6('0x86')](_0x21bddb)[_0x30f6('0x25')](function(_0x5a880f){var _0x2b2866={'role':_0x51c1a1[_0x30f6('0x87')][_0x30f6('0x88')],'userProfileId':_0x51c1a1[_0x30f6('0x87')][_0x30f6('0x89')]};if(!_0x2b2866)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2866['role']===_0x30f6('0x8a')){var _0x57861b=_0x5a880f[_0x30f6('0x27')]({'plain':!![]});return db[_0x30f6('0x8b')][_0x30f6('0x47')]({'where':{'name':_0x30f6('0x28'),'userProfileId':_0x2b2866[_0x30f6('0x89')]},'raw':!![]})['then'](function(_0x22c83a){if(_0x22c83a&&_0x22c83a[_0x30f6('0x8c')]===0x0){return db['UserProfileResource'][_0x30f6('0x86')]({'name':_0x57861b[_0x30f6('0x2d')],'resourceId':_0x57861b['id'],'type':_0x22c83a[_0x30f6('0x2d')],'sectionId':_0x22c83a['id']},{})[_0x30f6('0x25')](function(){return _0x5a880f;});}else{return _0x5a880f;}})[_0x30f6('0x48')](function(_0x421f96){logger['error'](_0x30f6('0x8d'),_0x421f96);throw _0x421f96;});}return _0x5a880f;})[_0x30f6('0x25')](respondWithResult(_0x4a4bcf,null))[_0x30f6('0x48')](handleError(_0x4a4bcf,null));}});}catch(_0x175c35){_0x4a4bcf['status'](0x1f4)[_0x30f6('0x2e')](_0x175c35);}};function removeReferences(_0x1b9300,_0xf3819b){try{if(_0x1b9300){fs[_0x30f6('0x8e')](_0x1b9300);logger[_0x30f6('0x5f')](_0x30f6('0x8f'));}if(_0xf3819b){rimraf(_0xf3819b,function(){});logger[_0x30f6('0x5f')]('Extracted\x20folder\x20removed');}}catch(_0x31e0a7){logger[_0x30f6('0x2b')](_0x31e0a7);}}exports[_0x30f6('0x90')]=function(_0x33f647,_0x20373f,_0x3457ac){return db['Plugin'][_0x30f6('0x47')]({'where':{'id':_0x33f647[_0x30f6('0x46')]['id']}})[_0x30f6('0x25')](handleEntityNotFound(_0x20373f,null))[_0x30f6('0x25')](saveUpdates(_0x33f647['body'],null))[_0x30f6('0x25')](respondWithResult(_0x20373f,null))[_0x30f6('0x48')](handleError(_0x20373f,null));};exports[_0x30f6('0x91')]=function(_0x44008c,_0x4a27b3,_0x1c8bee){return db[_0x30f6('0x31')][_0x30f6('0x47')]({'where':{'id':_0x44008c[_0x30f6('0x46')]['id']}})[_0x30f6('0x25')](function(_0x4798c1){if(_0x4798c1){return _0x4798c1['destroy']();}})[_0x30f6('0x25')](function(_0x29bd24){rimraf(path[_0x30f6('0x4a')](config['root'],_0x30f6('0x59'),path[_0x30f6('0x92')](_0x29bd24[_0x30f6('0x5')])),function(){});return _0x29bd24;})['then'](handleEntityNotFound(_0x4a27b3,null))[_0x30f6('0x25')](respondWithStatusCode(_0x4a27b3,null))['catch'](handleError(_0x4a27b3,null));};exports[_0x30f6('0x93')]=function(_0xcb1a1a,_0x2c90b4,_0x6fbfe2){return BPromise[_0x30f6('0x94')]()[_0x30f6('0x25')](function(){if(!_0xcb1a1a[_0x30f6('0x33')]['path']){throw new Error(_0x30f6('0x95'));}if(!_0xcb1a1a['query'][_0x30f6('0x96')]){throw new Error(_0x30f6('0x97'));}var _0x35ecfe=_0xcb1a1a['query'][_0x30f6('0x98')]?_0xcb1a1a[_0x30f6('0x33')][_0x30f6('0x98')]+':'+_0xcb1a1a[_0x30f6('0x33')]['port']:_0x30f6('0x99')+_0xcb1a1a[_0x30f6('0x33')][_0x30f6('0x96')];var _0x42a9bb=_0xcb1a1a[_0x30f6('0x33')][_0x30f6('0x1f')]?_0xcb1a1a['query'][_0x30f6('0x1f')]:!![];var _0x579d07=_0xcb1a1a['query']['encoding']?_0xcb1a1a[_0x30f6('0x33')][_0x30f6('0x9a')]:null;var _0x44a774={'method':_0xcb1a1a[_0x30f6('0x9b')],'uri':util[_0x30f6('0x4c')](_0x30f6('0x9c'),_0x35ecfe,_0xcb1a1a[_0x30f6('0x33')][_0x30f6('0x5')]),'json':_0x42a9bb,'resolveWithFullResponse':!![],'encoding':_0x579d07,'qs':_0xcb1a1a[_0x30f6('0x33')]};if(_0xcb1a1a[_0x30f6('0x9d')]){_0x44a774[_0x30f6('0x9d')]=_0xcb1a1a['headers'];if(_0x44a774[_0x30f6('0x9d')][_0x30f6('0x9e')]){delete _0x44a774[_0x30f6('0x9d')][_0x30f6('0x9e')];}}if(_0x44a774['headers'][_0x30f6('0x9f')]){delete _0x44a774[_0x30f6('0x9d')][_0x30f6('0x9f')];}return rp(_0x44a774);})['then'](function(_0x2f552e){if(_0x2f552e){_0x2c90b4[_0x30f6('0xa0')](_0x2f552e[_0x30f6('0x9d')]);logger[_0x30f6('0x5f')](_0x2f552e[_0x30f6('0x87')]);if(_[_0x30f6('0xa1')](_0xcb1a1a[_0x30f6('0x33')]['path'],_0x30f6('0x49'))&&_0x2f552e[_0x30f6('0xa2')]==0x1f4){return _0x2c90b4['sendStatus'](_0x2f552e[_0x30f6('0xa2')]);}else{return _0x2c90b4[_0x30f6('0x1d')](_0x2f552e[_0x30f6('0xa2')])['send'](_0x2f552e[_0x30f6('0x87')]);}}else{return _0x2c90b4[_0x30f6('0x2a')](0xc8);}})[_0x30f6('0x48')](handleError(_0x2c90b4,null));};exports[_0x30f6('0xa3')]=function(_0x41e880,_0xa12211,_0x45389b){return BPromise[_0x30f6('0x94')]()[_0x30f6('0x25')](function(){if(!_0x41e880[_0x30f6('0x33')][_0x30f6('0x5')]){throw new Error(_0x30f6('0x95'));}if(!_0x41e880['query'][_0x30f6('0x96')]){throw new Error(_0x30f6('0x97'));}var _0x5d4d77=_0x41e880[_0x30f6('0x33')][_0x30f6('0x98')]?_0x41e880[_0x30f6('0x33')][_0x30f6('0x98')]+':'+_0x41e880['query']['port']:_0x30f6('0x99')+_0x41e880[_0x30f6('0x33')][_0x30f6('0x96')];var _0x32e4cd=_0x41e880[_0x30f6('0x33')][_0x30f6('0x1f')]?_0x41e880['query'][_0x30f6('0x1f')]:!![];var _0x26045a=_0x41e880[_0x30f6('0x33')][_0x30f6('0x9a')]?_0x41e880['query'][_0x30f6('0x9a')]:null;var _0x4fac04={'method':_0x41e880[_0x30f6('0x9b')],'uri':util['format'](_0x30f6('0x9c'),_0x5d4d77,_0x41e880[_0x30f6('0x33')]['path']),'json':_0x32e4cd,'resolveWithFullResponse':!![],'encoding':_0x26045a,'body':_0x41e880[_0x30f6('0x87')]};if(_0x41e880[_0x30f6('0x9d')]){_0x4fac04[_0x30f6('0x9d')]=_0x41e880[_0x30f6('0x9d')];if(_0x4fac04[_0x30f6('0x9d')]['content-length']){delete _0x4fac04[_0x30f6('0x9d')]['content-length'];}}if(_0x4fac04[_0x30f6('0x9d')][_0x30f6('0x9f')]){delete _0x4fac04[_0x30f6('0x9d')][_0x30f6('0x9f')];}return rp(_0x4fac04);})[_0x30f6('0x25')](function(_0x3b52d8){if(_0x3b52d8){_0xa12211[_0x30f6('0xa0')](_0x3b52d8[_0x30f6('0x9d')]);logger[_0x30f6('0x5f')](_0x3b52d8[_0x30f6('0x87')]);return _0xa12211[_0x30f6('0x1d')](_0x3b52d8[_0x30f6('0xa2')])[_0x30f6('0x2e')](_0x3b52d8[_0x30f6('0x87')]);}else{return _0xa12211[_0x30f6('0x2a')](0xc8);}})['catch'](handleError(_0xa12211,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 33bfd9e..03c39c9 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 _0x627e=['events','../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0x627e,0x14a));var _0xe627=function(_0x24a4e1,_0x439806){_0x24a4e1=_0x24a4e1-0x0;var _0x19eecb=_0x627e[_0x24a4e1];return _0x19eecb;};'use strict';var EventEmitter=require(_0xe627('0x0'));var Plugin=require(_0xe627('0x1'))['db'][_0xe627('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xe627('0x3')](0x0);var events={'afterCreate':_0xe627('0x4'),'afterUpdate':'update','afterDestroy':_0xe627('0x5')};function emitEvent(_0x328881){return function(_0x2abdc7,_0x59a2c8,_0x52923f){PluginEvents['emit'](_0x328881+':'+_0x2abdc7['id'],_0x2abdc7);PluginEvents[_0xe627('0x6')](_0x328881,_0x2abdc7);_0x52923f(null);};}for(var e in events){if(events[_0xe627('0x7')](e)){var event=events[e];Plugin[_0xe627('0x8')](e,emitEvent(event));}}module[_0xe627('0x9')]=PluginEvents; \ No newline at end of file +var _0x2ef3=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','Plugin'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0x2ef3,0xba));var _0x32ef=function(_0x1810c7,_0x1ad306){_0x1810c7=_0x1810c7-0x0;var _0x3d4b7a=_0x2ef3[_0x1810c7];return _0x3d4b7a;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var Plugin=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x32ef('0x3')](0x0);var events={'afterCreate':_0x32ef('0x4'),'afterUpdate':_0x32ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38f865){return function(_0x38b7f3,_0x524ab6,_0x402857){PluginEvents[_0x32ef('0x6')](_0x38f865+':'+_0x38b7f3['id'],_0x38b7f3);PluginEvents['emit'](_0x38f865,_0x38b7f3);_0x402857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x32ef('0x7')](e,emitEvent(event));}}module[_0x32ef('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 6262e3a..7935f59 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 _0x9c5a=['define','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x46946b,_0x513b6f){var _0x5ee409=function(_0x56899f){while(--_0x56899f){_0x46946b['push'](_0x46946b['shift']());}};_0x5ee409(++_0x513b6f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x409239,_0x5d38e1){_0x409239=_0x409239-0x0;var _0x1ae93f=_0x9c5a[_0x409239];return _0x1ae93f;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./plugin.attributes');module[_0xa9c5('0x8')]=function(_0x4d9c7a,_0x394d84){return _0x4d9c7a[_0xa9c5('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','plugins','lodash'];(function(_0x48e492,_0x2b7217){var _0x29b343=function(_0x13edaf){while(--_0x13edaf){_0x48e492['push'](_0x48e492['shift']());}};_0x29b343(++_0x2b7217);}(_0x7da7,0x10d));var _0x77da=function(_0x36d703,_0x55b354){_0x36d703=_0x36d703-0x0;var _0x12c909=_0x7da7[_0x36d703];return _0x12c909;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./plugin.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('Plugin',attributes,{'tableName':_0x77da('0x9'),'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 1f3558c..223b567 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 _0x83c9=['./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreatePlugin','Plugin','create','body','options','raw','then','debug','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','redis','defaults','socket.io-emitter'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x83c9,0xaa));var _0x983c=function(_0x22df9f,_0x9ec477){_0x22df9f=_0x22df9f-0x0;var _0x4ed906=_0x83c9[_0x22df9f];return _0x4ed906;};'use strict';var _=require('lodash');var util=require(_0x983c('0x0'));var moment=require(_0x983c('0x1'));var BPromise=require('bluebird');var rs=require(_0x983c('0x2'));var fs=require('fs');var Redis=require(_0x983c('0x3'));var db=require(_0x983c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x983c('0x5'));var config=require(_0x983c('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x983c('0x7')]=_[_0x983c('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x983c('0x9'))(new Redis(config[_0x983c('0x7')]));require(_0x983c('0xa'))[_0x983c('0xb')](socket);function respondWithRpcPromise(_0x5879a1,_0x2b2463,_0x2e8ab1){return new BPromise(function(_0x43ed01,_0x34d1fc){return client[_0x983c('0xc')](_0x5879a1,_0x2e8ab1)['then'](function(_0x2d337d){logger[_0x983c('0xd')](_0x983c('0xe'),_0x2b2463,'request\x20sent');logger['debug'](_0x983c('0xf'),_0x2b2463,_0x983c('0x10'),JSON[_0x983c('0x11')](_0x2d337d));if(_0x2d337d[_0x983c('0x12')]){if(_0x2d337d[_0x983c('0x12')][_0x983c('0x13')]===0x1f4){logger[_0x983c('0x12')](_0x983c('0xe'),_0x2b2463,_0x2d337d[_0x983c('0x12')]['message']);return _0x34d1fc(_0x2d337d[_0x983c('0x12')][_0x983c('0x14')]);}logger[_0x983c('0x12')](_0x983c('0xe'),_0x2b2463,_0x2d337d[_0x983c('0x12')]['message']);return _0x43ed01(_0x2d337d['error'][_0x983c('0x14')]);}else{logger['info'](_0x983c('0xe'),_0x2b2463,_0x983c('0x10'));_0x43ed01(_0x2d337d['result'][_0x983c('0x14')]);}})[_0x983c('0x15')](function(_0x53b037){logger[_0x983c('0x12')](_0x983c('0xe'),_0x2b2463,_0x53b037);_0x34d1fc(_0x53b037);});});}exports[_0x983c('0x16')]=function(_0x3c95e2){var _0x15b3f3=this;return new Promise(function(_0x152b1b,_0x4e6230){return db[_0x983c('0x17')][_0x983c('0x18')](_0x3c95e2[_0x983c('0x19')],{'raw':_0x3c95e2[_0x983c('0x1a')]?_0x3c95e2[_0x983c('0x1a')][_0x983c('0x1b')]===undefined?!![]:![]:!![]})[_0x983c('0x1c')](function(_0x1959b9){logger[_0x983c('0xd')](_0x983c('0x16'),_0x3c95e2);logger[_0x983c('0x1d')]('CreatePlugin',_0x3c95e2,JSON[_0x983c('0x11')](_0x1959b9));_0x152b1b(_0x1959b9);})[_0x983c('0x15')](function(_0x3613ab){logger[_0x983c('0x12')](_0x983c('0x16'),_0x3613ab['message'],_0x3c95e2);_0x4e6230(_0x15b3f3[_0x983c('0x12')](0x1f4,_0x3613ab['message']));});});}; \ No newline at end of file +var _0xdabc=['CreatePlugin','Plugin','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x1172fc,_0x5afd98){var _0x30e282=function(_0x17bbb9){while(--_0x17bbb9){_0x1172fc['push'](_0x1172fc['shift']());}};_0x30e282(++_0x5afd98);}(_0xdabc,0x126));var _0xcdab=function(_0x397396,_0x4f2b10){_0x397396=_0x397396-0x0;var _0x3c1c53=_0xdabc[_0x397396];return _0x3c1c53;};'use strict';var _=require(_0xcdab('0x0'));var util=require(_0xcdab('0x1'));var moment=require(_0xcdab('0x2'));var BPromise=require(_0xcdab('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdab('0x4'));var db=require(_0xcdab('0x5'))['db'];var utils=require(_0xcdab('0x6'));var logger=require(_0xcdab('0x7'))(_0xcdab('0x8'));var config=require(_0xcdab('0x9'));var jayson=require(_0xcdab('0xa'));var client=jayson[_0xcdab('0xb')][_0xcdab('0xc')]({'port':0x232a});config[_0xcdab('0xd')]=_[_0xcdab('0xe')](config[_0xcdab('0xd')],{'host':_0xcdab('0xf'),'port':0x18eb});var socket=require(_0xcdab('0x10'))(new Redis(config['redis']));require(_0xcdab('0x11'))[_0xcdab('0x12')](socket);function respondWithRpcPromise(_0x2bada1,_0x996deb,_0x212a08){return new BPromise(function(_0x29b0f3,_0x50d955){return client['request'](_0x2bada1,_0x212a08)[_0xcdab('0x13')](function(_0x59925f){logger[_0xcdab('0x14')](_0xcdab('0x15'),_0x996deb,'request\x20sent');logger[_0xcdab('0x16')]('Plugin,\x20%s,\x20%s,\x20%s',_0x996deb,_0xcdab('0x17'),JSON[_0xcdab('0x18')](_0x59925f));if(_0x59925f[_0xcdab('0x19')]){if(_0x59925f[_0xcdab('0x19')][_0xcdab('0x1a')]===0x1f4){logger[_0xcdab('0x19')]('Plugin,\x20%s,\x20%s',_0x996deb,_0x59925f[_0xcdab('0x19')]['message']);return _0x50d955(_0x59925f[_0xcdab('0x19')]['message']);}logger['error'](_0xcdab('0x15'),_0x996deb,_0x59925f[_0xcdab('0x19')][_0xcdab('0x1b')]);return _0x29b0f3(_0x59925f[_0xcdab('0x19')][_0xcdab('0x1b')]);}else{logger['info'](_0xcdab('0x15'),_0x996deb,'request\x20sent');_0x29b0f3(_0x59925f[_0xcdab('0x1c')][_0xcdab('0x1b')]);}})[_0xcdab('0x1d')](function(_0x18a7da){logger[_0xcdab('0x19')](_0xcdab('0x15'),_0x996deb,_0x18a7da);_0x50d955(_0x18a7da);});});}exports[_0xcdab('0x1e')]=function(_0x4802bf){var _0x1080ae=this;return new Promise(function(_0x3f2391,_0x2d606f){return db[_0xcdab('0x1f')][_0xcdab('0x20')](_0x4802bf[_0xcdab('0x21')],{'raw':_0x4802bf['options']?_0x4802bf[_0xcdab('0x22')][_0xcdab('0x23')]===undefined?!![]:![]:!![]})[_0xcdab('0x13')](function(_0x75b538){logger['info'](_0xcdab('0x1e'),_0x4802bf);logger[_0xcdab('0x16')](_0xcdab('0x1e'),_0x4802bf,JSON[_0xcdab('0x18')](_0x75b538));_0x3f2391(_0x75b538);})[_0xcdab('0x1d')](function(_0x5067bf){logger[_0xcdab('0x19')](_0xcdab('0x1e'),_0x5067bf[_0xcdab('0x1b')],_0x4802bf);_0x2d606f(_0x1080ae[_0xcdab('0x19')](0x1f4,_0x5067bf['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 1d641d4..53750d5 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 _0xdddf=['save','update','emit','register','plugin:','./plugin.events'];(function(_0x5e45de,_0x56bc62){var _0x3eb652=function(_0x29deb5){while(--_0x29deb5){_0x5e45de['push'](_0x5e45de['shift']());}};_0x3eb652(++_0x56bc62);}(_0xdddf,0x9b));var _0xfddd=function(_0x1b5472,_0xff6ac2){_0x1b5472=_0x1b5472-0x0;var _0x5bd9b9=_0xdddf[_0x1b5472];return _0x5bd9b9;};'use strict';var PluginEvents=require(_0xfddd('0x0'));var events=[_0xfddd('0x1'),'remove',_0xfddd('0x2')];function createListener(_0x44fde5,_0x4b6a88){return function(_0x3d70fe){_0x4b6a88[_0xfddd('0x3')](_0x44fde5,_0x3d70fe);};}function removeListener(_0x1a424e,_0x17f9f8){return function(){PluginEvents['removeListener'](_0x1a424e,_0x17f9f8);};}exports[_0xfddd('0x4')]=function(_0x5c50bd){for(var _0x86a8a4=0x0,_0x47388c=events['length'];_0x86a8a4<_0x47388c;_0x86a8a4++){var _0x4be2be=events[_0x86a8a4];var _0x505c4e=createListener(_0xfddd('0x5')+_0x4be2be,_0x5c50bd);PluginEvents['on'](_0x4be2be,_0x505c4e);}}; \ No newline at end of file +var _0xfd2e=['emit','removeListener','register','length','plugin:','./plugin.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd2e,0x1a3));var _0xefd2=function(_0x1ea74c,_0x5251fe){_0x1ea74c=_0x1ea74c-0x0;var _0x48712f=_0xfd2e[_0x1ea74c];return _0x48712f;};'use strict';var PluginEvents=require(_0xefd2('0x0'));var events=[_0xefd2('0x1'),_0xefd2('0x2'),_0xefd2('0x3')];function createListener(_0x125422,_0x3be5ee){return function(_0x1e317f){_0x3be5ee[_0xefd2('0x4')](_0x125422,_0x1e317f);};}function removeListener(_0x234462,_0x488918){return function(){PluginEvents[_0xefd2('0x5')](_0x234462,_0x488918);};}exports[_0xefd2('0x6')]=function(_0x3d539c){for(var _0xa7869f=0x0,_0x254310=events[_0xefd2('0x7')];_0xa7869f<_0x254310;_0xa7869f++){var _0x5594d4=events[_0xa7869f];var _0x3c1cf2=createListener(_0xefd2('0x8')+_0x5594d4,_0x3d539c);PluginEvents['on'](_0x5594d4,_0x3c1cf2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index f5c9345..9c89c8f 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 _0x42fe=['express','Router','../../components/auth/service','./pm2.controller','get','isAuthenticated','show','create','/:id','update','delete','destroy','exports'];(function(_0x307bf7,_0x315dce){var _0x578e59=function(_0x2214c3){while(--_0x2214c3){_0x307bf7['push'](_0x307bf7['shift']());}};_0x578e59(++_0x315dce);}(_0x42fe,0x111));var _0xe42f=function(_0x315a89,_0x360084){_0x315a89=_0x315a89-0x0;var _0x222ba3=_0x42fe[_0x315a89];return _0x222ba3;};'use strict';var express=require(_0xe42f('0x0'));var router=express[_0xe42f('0x1')]();var auth=require(_0xe42f('0x2'));var controller=require(_0xe42f('0x3'));router[_0xe42f('0x4')]('/',auth[_0xe42f('0x5')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe42f('0x6')]);router['post']('/',auth[_0xe42f('0x5')](),controller[_0xe42f('0x7')]);router['put'](_0xe42f('0x8'),auth[_0xe42f('0x5')](),controller[_0xe42f('0x9')]);router[_0xe42f('0xa')](_0xe42f('0x8'),auth[_0xe42f('0x5')](),controller[_0xe42f('0xb')]);module[_0xe42f('0xc')]=router; \ No newline at end of file +var _0xd204=['update','destroy','exports','express','Router','get','isAuthenticated','/:id','show','post','put'];(function(_0x2db637,_0x3d5742){var _0x2aa2a8=function(_0x179d7b){while(--_0x179d7b){_0x2db637['push'](_0x2db637['shift']());}};_0x2aa2a8(++_0x3d5742);}(_0xd204,0x1c6));var _0x4d20=function(_0x505837,_0x2460ef){_0x505837=_0x505837-0x0;var _0x3a8fe4=_0xd204[_0x505837];return _0x3a8fe4;};'use strict';var express=require(_0x4d20('0x0'));var router=express[_0x4d20('0x1')]();var auth=require('../../components/auth/service');var controller=require('./pm2.controller');router[_0x4d20('0x2')]('/',auth[_0x4d20('0x3')](),controller['index']);router['get'](_0x4d20('0x4'),auth[_0x4d20('0x3')](),controller[_0x4d20('0x5')]);router[_0x4d20('0x6')]('/',auth[_0x4d20('0x3')](),controller['create']);router[_0x4d20('0x7')](_0x4d20('0x4'),auth[_0x4d20('0x3')](),controller[_0x4d20('0x8')]);router['delete']('/:id',auth[_0x4d20('0x3')](),controller[_0x4d20('0x9')]);module[_0x4d20('0xa')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 199c14f..0f7c15c 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 _0x277c=['api','path','child_process','exec','bluebird','stack','name','status','send','npm\x20install','info','error','list','then','reject','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','stop','hasOwnProperty','Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','../../config/logger'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0x277c,0x125));var _0xc277=function(_0x3d1ae4,_0x31cb82){_0x3d1ae4=_0x3d1ae4-0x0;var _0xb058c7=_0x277c[_0x3d1ae4];return _0xb058c7;};'use strict';var _=require(_0xc277('0x0'));var pm2=require(_0xc277('0x1'));var logger=require(_0xc277('0x2'))(_0xc277('0x3'));var path=require(_0xc277('0x4'));var exec=require(_0xc277('0x5'))[_0xc277('0x6')];var BPromise=require(_0xc277('0x7'));function handleEntityNotFound(_0x49464a,_0x442a42){return function(_0x7722){if(!_0x7722){_0x49464a['sendStatus'](0x194);;}return _0x7722;};}function respondWithResult(_0x4db5ca,_0x413551){_0x413551=_0x413551||0xc8;return function(_0x32aedc){if(_0x32aedc){return _0x4db5ca['status'](_0x413551)['json'](_0x32aedc);}return null;};}function handleError(_0x2015c9,_0x247aad){_0x247aad=_0x247aad||0x1f4;return function(_0x3af281){logger['error'](_0x3af281[_0xc277('0x8')]);if(_0x3af281[_0xc277('0x9')]){delete _0x3af281['name'];}_0x2015c9[_0xc277('0xa')](_0x247aad)[_0xc277('0xb')](_0x3af281);};}function execChildProcess(){return new BPromise(function(_0x17f383,_0x4b8bb7){exec(_0xc277('0xc'),function(_0x270c15,_0x2d5485,_0x44ede2){logger['info'](_0x2d5485);logger[_0xc277('0xd')](_0x44ede2);if(_0x270c15){logger[_0xc277('0xe')](_0x270c15);return _0x4b8bb7(_0x270c15);}return _0x17f383(_0x2d5485);});});}exports['index']=function(_0x446afe,_0x136eb4){return pm2[_0xc277('0xf')]()[_0xc277('0x10')](function(_0x4a0923){if(_0x4a0923){var _0x169c17=_[_0xc277('0x11')](_0x4a0923,function(_0x415c91){return _0x415c91[_0xc277('0x9')]==='express'||_0x415c91['name']===_0xc277('0x12');});return{'rows':_0x169c17,'count':_0x169c17[_0xc277('0x13')]};}return null;})['then'](respondWithResult(_0x136eb4,null))[_0xc277('0x14')](handleError(_0x136eb4,null));};exports[_0xc277('0x15')]=function(_0x1453e7,_0x3cb7ac){return pm2[_0xc277('0x16')](_0x1453e7[_0xc277('0x17')]['id'])['then'](respondWithResult(_0x3cb7ac,null))[_0xc277('0x10')](handleEntityNotFound(_0x3cb7ac,null))[_0xc277('0x14')](handleError(_0x3cb7ac,null));};exports[_0xc277('0x18')]=function(_0x437e97,_0x2b002a){if(_0x437e97['body'][_0xc277('0x9')]&&_0x437e97[_0xc277('0x19')][_0xc277('0x1a')]){var _0x3b2b14=path[_0xc277('0x1b')](__dirname,_0xc277('0x1c'),_0x437e97[_0xc277('0x19')][_0xc277('0x1a')]);var _0x47f284=process[_0xc277('0x1d')]();process[_0xc277('0x1e')](path[_0xc277('0x1f')](_0x3b2b14));return execChildProcess()[_0xc277('0x10')](function(_0x4ae0e7){process['chdir'](_0x47f284);return pm2['start']({'name':_0x437e97['body'][_0xc277('0x9')],'script':_0x3b2b14});})[_0xc277('0x10')](function(_0x3e4b0b){pm2[_0xc277('0x20')]();return _0x3e4b0b[0x0];})[_0xc277('0x10')](respondWithResult(_0x2b002a,0xc9))[_0xc277('0x14')](handleError(_0x2b002a,null));}else{return _0x2b002a['status'](0x1f4)[_0xc277('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x43aac,_0xba8f4d){if(_0x43aac['body']['id']){delete _0x43aac['body']['id'];}var _0x256589={'online':'restart','stopped':_0xc277('0x21')};if(_0x256589[_0xc277('0x22')](_0x43aac[_0xc277('0x19')][_0xc277('0xa')])){return pm2[_0x256589[_0x43aac[_0xc277('0x19')]['status']]](_0x43aac['params']['id'])[_0xc277('0x10')](respondWithResult(_0xba8f4d,0xc8))[_0xc277('0x14')](handleError(_0xba8f4d,null));}else{return _0xba8f4d['status'](0x1f4)[_0xc277('0xb')]({'message':_0xc277('0x23')});}};exports['destroy']=function(_0x3c3d30,_0x3d3e90){if(_0x3c3d30[_0xc277('0x19')]['id']){delete _0x3c3d30[_0xc277('0x19')]['id'];}if(_0x3c3d30[_0xc277('0x17')]['id']){return pm2['delete'](_0x3c3d30[_0xc277('0x17')]['id'])[_0xc277('0x10')](function(_0x193d0e){pm2[_0xc277('0x20')]();return _0x193d0e[0x0];})[_0xc277('0x10')](respondWithResult(_0x3d3e90,null))[_0xc277('0x14')](handleError(_0x3d3e90,null));}else{return _0x3d3e90['status'](0x1f4)[_0xc277('0xb')]({'message':_0xc277('0x24')});}}; \ No newline at end of file +var _0xc35b=['delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','bluebird','sendStatus','status','json','error','stack','name','send','info','index','reject','express','motion2','length','catch','show','describe','params','then','create','body','script','join','cwd','dirname','chdir','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy'];(function(_0x41a5ed,_0x46ef04){var _0x2a062d=function(_0x4e67a7){while(--_0x4e67a7){_0x41a5ed['push'](_0x41a5ed['shift']());}};_0x2a062d(++_0x46ef04);}(_0xc35b,0x1a6));var _0xbc35=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xc35b[_0x363ef8];return _0x148822;};'use strict';var _=require(_0xbc35('0x0'));var pm2=require(_0xbc35('0x1'));var logger=require(_0xbc35('0x2'))(_0xbc35('0x3'));var path=require(_0xbc35('0x4'));var exec=require(_0xbc35('0x5'))['exec'];var BPromise=require(_0xbc35('0x6'));function handleEntityNotFound(_0x1952d8,_0x78bbf1){return function(_0x48345e){if(!_0x48345e){_0x1952d8[_0xbc35('0x7')](0x194);;}return _0x48345e;};}function respondWithResult(_0x3895c9,_0x552a2b){_0x552a2b=_0x552a2b||0xc8;return function(_0x1eb0fc){if(_0x1eb0fc){return _0x3895c9[_0xbc35('0x8')](_0x552a2b)[_0xbc35('0x9')](_0x1eb0fc);}return null;};}function handleError(_0x467fd2,_0xdbbd13){_0xdbbd13=_0xdbbd13||0x1f4;return function(_0x49ea9f){logger[_0xbc35('0xa')](_0x49ea9f[_0xbc35('0xb')]);if(_0x49ea9f[_0xbc35('0xc')]){delete _0x49ea9f['name'];}_0x467fd2['status'](_0xdbbd13)[_0xbc35('0xd')](_0x49ea9f);};}function execChildProcess(){return new BPromise(function(_0x35e151,_0x255763){exec('npm\x20install',function(_0x523f51,_0x231a28,_0x2ce523){logger[_0xbc35('0xe')](_0x231a28);logger[_0xbc35('0xe')](_0x2ce523);if(_0x523f51){logger[_0xbc35('0xa')](_0x523f51);return _0x255763(_0x523f51);}return _0x35e151(_0x231a28);});});}exports[_0xbc35('0xf')]=function(_0x34a267,_0x39072c){return pm2['list']()['then'](function(_0x1a41c7){if(_0x1a41c7){var _0xe6a487=_[_0xbc35('0x10')](_0x1a41c7,function(_0x54a787){return _0x54a787[_0xbc35('0xc')]===_0xbc35('0x11')||_0x54a787[_0xbc35('0xc')]===_0xbc35('0x12');});return{'rows':_0xe6a487,'count':_0xe6a487[_0xbc35('0x13')]};}return null;})['then'](respondWithResult(_0x39072c,null))[_0xbc35('0x14')](handleError(_0x39072c,null));};exports[_0xbc35('0x15')]=function(_0x23d505,_0x11f363){return pm2[_0xbc35('0x16')](_0x23d505[_0xbc35('0x17')]['id'])[_0xbc35('0x18')](respondWithResult(_0x11f363,null))['then'](handleEntityNotFound(_0x11f363,null))[_0xbc35('0x14')](handleError(_0x11f363,null));};exports[_0xbc35('0x19')]=function(_0x1be0ad,_0x4e1cee){if(_0x1be0ad['body']['name']&&_0x1be0ad[_0xbc35('0x1a')][_0xbc35('0x1b')]){var _0x495419=path[_0xbc35('0x1c')](__dirname,'../../files/plugins',_0x1be0ad[_0xbc35('0x1a')][_0xbc35('0x1b')]);var _0x7efca4=process[_0xbc35('0x1d')]();process['chdir'](path[_0xbc35('0x1e')](_0x495419));return execChildProcess()[_0xbc35('0x18')](function(_0x3649b0){process[_0xbc35('0x1f')](_0x7efca4);return pm2[_0xbc35('0x20')]({'name':_0x1be0ad[_0xbc35('0x1a')]['name'],'script':_0x495419});})[_0xbc35('0x18')](function(_0x2a0131){pm2['dump']();return _0x2a0131[0x0];})[_0xbc35('0x18')](respondWithResult(_0x4e1cee,0xc9))[_0xbc35('0x14')](handleError(_0x4e1cee,null));}else{return _0x4e1cee[_0xbc35('0x8')](0x1f4)[_0xbc35('0xd')]({'message':_0xbc35('0x21')});}};exports[_0xbc35('0x22')]=function(_0x246315,_0x139c2c){if(_0x246315['body']['id']){delete _0x246315[_0xbc35('0x1a')]['id'];}var _0x28e928={'online':_0xbc35('0x23'),'stopped':_0xbc35('0x24')};if(_0x28e928[_0xbc35('0x25')](_0x246315[_0xbc35('0x1a')][_0xbc35('0x8')])){return pm2[_0x28e928[_0x246315[_0xbc35('0x1a')][_0xbc35('0x8')]]](_0x246315[_0xbc35('0x17')]['id'])[_0xbc35('0x18')](respondWithResult(_0x139c2c,0xc8))[_0xbc35('0x14')](handleError(_0x139c2c,null));}else{return _0x139c2c[_0xbc35('0x8')](0x1f4)[_0xbc35('0xd')]({'message':_0xbc35('0x26')});}};exports[_0xbc35('0x27')]=function(_0x22739e,_0x6b1ac8){if(_0x22739e[_0xbc35('0x1a')]['id']){delete _0x22739e[_0xbc35('0x1a')]['id'];}if(_0x22739e['params']['id']){return pm2[_0xbc35('0x28')](_0x22739e[_0xbc35('0x17')]['id'])['then'](function(_0x4cbae8){pm2['dump']();return _0x4cbae8[0x0];})[_0xbc35('0x18')](respondWithResult(_0x6b1ac8,null))[_0xbc35('0x14')](handleError(_0x6b1ac8,null));}else{return _0x6b1ac8[_0xbc35('0x8')](0x1f4)[_0xbc35('0xd')]({'message':_0xbc35('0x29')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 9e34f67..efb48a0 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 _0x6477=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout','express','Router'];(function(_0x22bc48,_0x59b5ee){var _0x545e3a=function(_0x2c07ec){while(--_0x2c07ec){_0x22bc48['push'](_0x22bc48['shift']());}};_0x545e3a(++_0x59b5ee);}(_0x6477,0xff));var _0x7647=function(_0x2197c3,_0x310b38){_0x2197c3=_0x2197c3-0x0;var _0x120c87=_0x6477[_0x2197c3];return _0x120c87;};'use strict';var multer=require(_0x7647('0x0'));var util=require(_0x7647('0x1'));var path=require(_0x7647('0x2'));var timeout=require(_0x7647('0x3'));var express=require(_0x7647('0x4'));var router=express[_0x7647('0x5')]();var auth=require(_0x7647('0x6'));var interaction=require(_0x7647('0x7'));var config=require(_0x7647('0x8'));module['exports']=router; \ No newline at end of file +var _0x5afb=['../../components/auth/service','multer','util','path','connect-timeout','Router'];(function(_0x3f5cce,_0xd1c330){var _0x2592b2=function(_0x554a35){while(--_0x554a35){_0x3f5cce['push'](_0x3f5cce['shift']());}};_0x2592b2(++_0xd1c330);}(_0x5afb,0xcd));var _0xb5af=function(_0x426a37,_0x1d32df){_0x426a37=_0x426a37-0x0;var _0x4e9e28=_0x5afb[_0x426a37];return _0x4e9e28;};'use strict';var multer=require(_0xb5af('0x0'));var util=require(_0xb5af('0x1'));var path=require(_0xb5af('0x2'));var timeout=require(_0xb5af('0x3'));var express=require('express');var router=express[_0xb5af('0x4')]();var auth=require(_0xb5af('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 5de9497..02e4bd0 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 _0x669b=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0xec4877,_0x5d0a67){var _0x73e55e=function(_0xe13912){while(--_0xe13912){_0xec4877['push'](_0xec4877['shift']());}};_0x73e55e(++_0x5d0a67);}(_0x669b,0x179));var _0xb669=function(_0x2640bf,_0x36dc01){_0x2640bf=_0x2640bf-0x0;var _0x3e4751=_0x669b[_0x2640bf];return _0x3e4751;};'use strict';var Sequelize=require(_0xb669('0x0'));module[_0xb669('0x1')]={'state':{'type':Sequelize[_0xb669('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb669('0x3')]},'scheduledat':{'type':Sequelize[_0xb669('0x4')]},'uniqueid':{'type':Sequelize[_0xb669('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb669('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb669('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf84b=['INTEGER','STRING','DATE','exports'];(function(_0xfc100f,_0x145ebe){var _0x3ef740=function(_0x5c1e8c){while(--_0x5c1e8c){_0xfc100f['push'](_0xfc100f['shift']());}};_0x3ef740(++_0x145ebe);}(_0xf84b,0x9f));var _0xbf84=function(_0x548d16,_0x1b5d0f){_0x548d16=_0x548d16-0x0;var _0x31a437=_0xf84b[_0x548d16];return _0x31a437;};'use strict';var Sequelize=require('sequelize');module[_0xbf84('0x0')]={'state':{'type':Sequelize[_0xbf84('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xbf84('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xbf84('0x2')]},'starttime':{'type':Sequelize[_0xbf84('0x3')]},'responsetime':{'type':Sequelize[_0xbf84('0x3')]},'ringtime':{'type':Sequelize[_0xbf84('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xbf84('0x2')]},'campaigntype':{'type':Sequelize[_0xbf84('0x2')]},'membername':{'type':Sequelize[_0xbf84('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 3467d8a..daff092 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 _0x46bf=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','util','../../config/logger','api','moment','bluebird'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x46bf,0x1a8));var _0xf46b=function(_0x2af009,_0x5432ee){_0x2af009=_0x2af009-0x0;var _0x46d15f=_0x46bf[_0x2af009];return _0x46d15f;};'use strict';var _=require('lodash');var util=require(_0xf46b('0x0'));var logger=require(_0xf46b('0x1'))(_0xf46b('0x2'));var moment=require(_0xf46b('0x3'));var BPromise=require(_0xf46b('0x4'));var rp=require(_0xf46b('0x5'));var fs=require('fs');var path=require(_0xf46b('0x6'));var rimraf=require(_0xf46b('0x7'));var config=require(_0xf46b('0x8'));var attributes=require(_0xf46b('0x9'));module[_0xf46b('0xa')]=function(_0x19de43,_0x4f20da){return _0x19de43[_0xf46b('0xb')]('ReportAgentPreview',attributes,{'tableName':_0xf46b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb02c=['define','ReportAgentPreview','lodash','util','moment','bluebird','rimraf','../../config/environment','./reportAgentPreview.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb02c,0xd4));var _0xcb02=function(_0x255a6e,_0x2be4a8){_0x255a6e=_0x255a6e-0x0;var _0x1338d2=_0xb02c[_0x255a6e];return _0x1338d2;};'use strict';var _=require(_0xcb02('0x0'));var util=require(_0xcb02('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcb02('0x2'));var BPromise=require(_0xcb02('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcb02('0x4'));var config=require(_0xcb02('0x5'));var attributes=require(_0xcb02('0x6'));module[_0xcb02('0x7')]=function(_0x2023c7,_0x1d670c){return _0x2023c7[_0xcb02('0x8')](_0xcb02('0x9'),attributes,{'tableName':'report_agent_preview','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 97cb7b6..47d94cd 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 _0x8ce3=['ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info'];(function(_0x3d60e4,_0x2a4db3){var _0x5c927d=function(_0x500232){while(--_0x500232){_0x3d60e4['push'](_0x3d60e4['shift']());}};_0x5c927d(++_0x2a4db3);}(_0x8ce3,0x78));var _0x38ce=function(_0x44449b,_0x5e16ea){_0x44449b=_0x44449b-0x0;var _0x1dde55=_0x8ce3[_0x44449b];return _0x1dde55;};'use strict';var _=require(_0x38ce('0x0'));var util=require('util');var moment=require(_0x38ce('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38ce('0x2'))['db'];var utils=require(_0x38ce('0x3'));var logger=require(_0x38ce('0x4'))(_0x38ce('0x5'));var config=require(_0x38ce('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b4ac4,_0x181b1d,_0x2332e3){return new BPromise(function(_0x2313ba,_0xa343c4){return client['request'](_0x5b4ac4,_0x2332e3)[_0x38ce('0x8')](function(_0x581386){logger[_0x38ce('0x9')]('ReportAgentPreview,\x20%s,\x20%s',_0x181b1d,'request\x20sent');logger['debug'](_0x38ce('0xa'),_0x181b1d,_0x38ce('0xb'),JSON[_0x38ce('0xc')](_0x581386));if(_0x581386[_0x38ce('0xd')]){if(_0x581386[_0x38ce('0xd')][_0x38ce('0xe')]===0x1f4){logger[_0x38ce('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x181b1d,_0x581386[_0x38ce('0xd')]['message']);return _0xa343c4(_0x581386['error'][_0x38ce('0xf')]);}logger[_0x38ce('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x181b1d,_0x581386[_0x38ce('0xd')][_0x38ce('0xf')]);return _0x2313ba(_0x581386['error'][_0x38ce('0xf')]);}else{logger[_0x38ce('0x9')](_0x38ce('0x10'),_0x181b1d,_0x38ce('0xb'));_0x2313ba(_0x581386[_0x38ce('0x11')][_0x38ce('0xf')]);}})[_0x38ce('0x12')](function(_0x101b27){logger[_0x38ce('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x181b1d,_0x101b27);_0xa343c4(_0x101b27);});});}exports[_0x38ce('0x13')]=function(_0x130d10){var _0x12ad0a=this;return new Promise(function(_0x66feb8,_0x2796a0){return db[_0x38ce('0x14')][_0x38ce('0x15')](_0x130d10[_0x38ce('0x16')],{'raw':_0x130d10['options']?_0x130d10[_0x38ce('0x17')][_0x38ce('0x18')]===undefined?!![]:![]:!![]})[_0x38ce('0x8')](function(_0x43d5cc){logger[_0x38ce('0x9')](_0x38ce('0x13'),_0x130d10);logger[_0x38ce('0x19')](_0x38ce('0x13'),_0x130d10,JSON[_0x38ce('0xc')](_0x43d5cc));_0x66feb8(_0x43d5cc);})[_0x38ce('0x12')](function(_0x413399){logger['error'](_0x38ce('0x13'),_0x413399[_0x38ce('0xf')],_0x130d10);_0x2796a0(_0x12ad0a['error'](0x1f4,_0x413399[_0x38ce('0xf')]));});});}; \ No newline at end of file +var _0x5ce3=['../../config/logger','rpc','../../config/environment','client','http','request','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5ce3,0xa8));var _0x35ce=function(_0x1cee55,_0xe75188){_0x1cee55=_0x1cee55-0x0;var _0x4f640a=_0x5ce3[_0x1cee55];return _0x4f640a;};'use strict';var _=require(_0x35ce('0x0'));var util=require(_0x35ce('0x1'));var moment=require(_0x35ce('0x2'));var BPromise=require(_0x35ce('0x3'));var rs=require(_0x35ce('0x4'));var fs=require('fs');var Redis=require(_0x35ce('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35ce('0x6'))(_0x35ce('0x7'));var config=require(_0x35ce('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x35ce('0x9')][_0x35ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x749e1a,_0x18cb52,_0x52d2e7){return new BPromise(function(_0x686316,_0xe5d534){return client[_0x35ce('0xb')](_0x749e1a,_0x52d2e7)['then'](function(_0x4cce8e){logger['info'](_0x35ce('0xc'),_0x18cb52,'request\x20sent');logger['debug'](_0x35ce('0xd'),_0x18cb52,'request\x20sent',JSON[_0x35ce('0xe')](_0x4cce8e));if(_0x4cce8e[_0x35ce('0xf')]){if(_0x4cce8e['error'][_0x35ce('0x10')]===0x1f4){logger[_0x35ce('0xf')](_0x35ce('0xc'),_0x18cb52,_0x4cce8e[_0x35ce('0xf')][_0x35ce('0x11')]);return _0xe5d534(_0x4cce8e[_0x35ce('0xf')][_0x35ce('0x11')]);}logger[_0x35ce('0xf')](_0x35ce('0xc'),_0x18cb52,_0x4cce8e['error'][_0x35ce('0x11')]);return _0x686316(_0x4cce8e[_0x35ce('0xf')][_0x35ce('0x11')]);}else{logger[_0x35ce('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x18cb52,_0x35ce('0x13'));_0x686316(_0x4cce8e[_0x35ce('0x14')][_0x35ce('0x11')]);}})[_0x35ce('0x15')](function(_0x1c9bd0){logger[_0x35ce('0xf')](_0x35ce('0xc'),_0x18cb52,_0x1c9bd0);_0xe5d534(_0x1c9bd0);});});}exports[_0x35ce('0x16')]=function(_0x556bb2){var _0x1d8bb8=this;return new Promise(function(_0x1550aa,_0x4b2d0b){return db[_0x35ce('0x17')]['create'](_0x556bb2[_0x35ce('0x18')],{'raw':_0x556bb2['options']?_0x556bb2[_0x35ce('0x19')][_0x35ce('0x1a')]===undefined?!![]:![]:!![]})[_0x35ce('0x1b')](function(_0x22b66a){logger[_0x35ce('0x12')](_0x35ce('0x16'),_0x556bb2);logger[_0x35ce('0x1c')]('CreateReportAgentPreview',_0x556bb2,JSON['stringify'](_0x22b66a));_0x1550aa(_0x22b66a);})['catch'](function(_0x267d32){logger[_0x35ce('0xf')]('CreateReportAgentPreview',_0x267d32[_0x35ce('0x11')],_0x556bb2);_0x4b2d0b(_0x1d8bb8[_0x35ce('0xf')](0x1f4,_0x267d32['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1ced0f1..c9e3f97 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 _0xe2a0=['/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','/outbound/channels','/agents','agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','post','queueNotify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','multer','express','./rpc.controller','get'];(function(_0x225da2,_0x4be0bd){var _0x1cdefe=function(_0xdae9a0){while(--_0xdae9a0){_0x225da2['push'](_0x225da2['shift']());}};_0x1cdefe(++_0x4be0bd);}(_0xe2a0,0x1d1));var _0x0e2a=function(_0x2dc4e6,_0xdea9d2){_0x2dc4e6=_0x2dc4e6-0x0;var _0xeda09=_0xe2a0[_0x2dc4e6];return _0xeda09;};'use strict';var multer=require(_0x0e2a('0x0'));var util=require('util');var path=require('path');var express=require(_0x0e2a('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x0e2a('0x2'));router[_0x0e2a('0x3')](_0x0e2a('0x4'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x6')]);router[_0x0e2a('0x3')](_0x0e2a('0x7'),auth[_0x0e2a('0x5')](),controller['voiceChannelMixMonitor']);router[_0x0e2a('0x3')](_0x0e2a('0x8'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x9')]);router[_0x0e2a('0x3')](_0x0e2a('0xa'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0xb')]);router[_0x0e2a('0x3')]('/chat/queues',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0xc')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router['get']('/mail/accounts',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0xd')]);router['get']('/openchannel/queues',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0xe')]);router[_0x0e2a('0x3')](_0x0e2a('0xf'),auth['isAuthenticated'](),controller[_0x0e2a('0x10')]);router['get'](_0x0e2a('0x11'),auth[_0x0e2a('0x5')](),controller['faxQueues']);router[_0x0e2a('0x3')](_0x0e2a('0x12'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x13')]);router[_0x0e2a('0x3')](_0x0e2a('0x14'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x15')]);router['get'](_0x0e2a('0x16'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x17')]);router[_0x0e2a('0x3')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x0e2a('0x5')](),controller['voiceQueuesChannelHangup']);router[_0x0e2a('0x3')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x18')]);router[_0x0e2a('0x3')](_0x0e2a('0x19'),auth[_0x0e2a('0x5')](),controller['showVoiceQueues']);router['get'](_0x0e2a('0x1a'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x1b')]);router[_0x0e2a('0x3')](_0x0e2a('0x1c'),auth[_0x0e2a('0x5')](),controller['outboundChannels']);router[_0x0e2a('0x3')](_0x0e2a('0x1d'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x1e')]);router[_0x0e2a('0x1f')]('/agents/:id/capacity',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x20')]);router['get'](_0x0e2a('0x21'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x22')]);router[_0x0e2a('0x3')](_0x0e2a('0x23'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x24')]);router[_0x0e2a('0x3')](_0x0e2a('0x25'),auth['isAuthenticated'](),controller[_0x0e2a('0x26')]);router[_0x0e2a('0x3')](_0x0e2a('0x27'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x28')]);router[_0x0e2a('0x3')](_0x0e2a('0x29'),auth[_0x0e2a('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0x0e2a('0x3')]('/mail/queues/waitinginteractions',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x2a')]);router[_0x0e2a('0x3')](_0x0e2a('0x2b'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x2c')]);router[_0x0e2a('0x3')](_0x0e2a('0x2d'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x2e')]);router[_0x0e2a('0x3')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x0e2a('0x2f')]);router['post'](_0x0e2a('0x30'),auth[_0x0e2a('0x5')](),controller['queueNotify'](_0x0e2a('0x31')));router['get'](_0x0e2a('0x32'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x33')]);router[_0x0e2a('0x34')]('/chat/queues/:id/notify',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x35')](_0x0e2a('0x36')));router[_0x0e2a('0x3')]('/chat/queues/:id',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x37')]);router[_0x0e2a('0x34')](_0x0e2a('0x38'),auth['isAuthenticated'](),controller[_0x0e2a('0x35')](_0x0e2a('0x39')));router[_0x0e2a('0x3')](_0x0e2a('0x3a'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x3b')]);router[_0x0e2a('0x34')](_0x0e2a('0x3c'),auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x35')](_0x0e2a('0x3d')));router[_0x0e2a('0x3')]('/openchannel/queues/:id',auth[_0x0e2a('0x5')](),controller['showOpenchannelQueues']);router['post']('/sms/queues/:id/notify',auth[_0x0e2a('0x5')](),controller[_0x0e2a('0x35')](_0x0e2a('0x3e')));router['get'](_0x0e2a('0x3f'),auth['isAuthenticated'](),controller[_0x0e2a('0x40')]);router[_0x0e2a('0x34')](_0x0e2a('0x41'),auth[_0x0e2a('0x5')](),controller['agentNotify']);module[_0x0e2a('0x42')]=router; \ No newline at end of file +var _0x6890=['showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id'];(function(_0x2e24db,_0x206418){var _0x5622fb=function(_0x442edc){while(--_0x442edc){_0x2e24db['push'](_0x2e24db['shift']());}};_0x5622fb(++_0x206418);}(_0x6890,0xf7));var _0x0689=function(_0x8a5e8d,_0x31efe7){_0x8a5e8d=_0x8a5e8d-0x0;var _0x104c8f=_0x6890[_0x8a5e8d];return _0x104c8f;};'use strict';var multer=require(_0x0689('0x0'));var util=require(_0x0689('0x1'));var path=require(_0x0689('0x2'));var express=require(_0x0689('0x3'));var router=express['Router']();var auth=require(_0x0689('0x4'));var controller=require(_0x0689('0x5'));router[_0x0689('0x6')](_0x0689('0x7'),auth['isAuthenticated'](),controller[_0x0689('0x8')]);router[_0x0689('0x6')](_0x0689('0x9'),auth[_0x0689('0xa')](),controller[_0x0689('0xb')]);router[_0x0689('0x6')](_0x0689('0xc'),auth[_0x0689('0xa')](),controller['voiceChannelStopMixMonitor']);router[_0x0689('0x6')](_0x0689('0xd'),auth[_0x0689('0xa')](),controller[_0x0689('0xe')]);router['get'](_0x0689('0xf'),auth[_0x0689('0xa')](),controller[_0x0689('0x10')]);router['get'](_0x0689('0x11'),auth[_0x0689('0xa')](),controller[_0x0689('0x12')]);router[_0x0689('0x6')](_0x0689('0x13'),auth[_0x0689('0xa')](),controller[_0x0689('0x14')]);router['get'](_0x0689('0x15'),auth['isAuthenticated'](),controller[_0x0689('0x16')]);router[_0x0689('0x6')](_0x0689('0x17'),auth[_0x0689('0xa')](),controller[_0x0689('0x18')]);router['get'](_0x0689('0x19'),auth[_0x0689('0xa')](),controller[_0x0689('0x1a')]);router[_0x0689('0x6')]('/voice/queues/preview/:id',auth[_0x0689('0xa')](),controller[_0x0689('0x1b')]);router[_0x0689('0x6')](_0x0689('0x1c'),auth['isAuthenticated'](),controller[_0x0689('0x1d')]);router['get'](_0x0689('0x1e'),auth[_0x0689('0xa')](),controller[_0x0689('0x1f')]);router[_0x0689('0x6')](_0x0689('0x20'),auth['isAuthenticated'](),controller[_0x0689('0x21')]);router[_0x0689('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x0689('0xa')](),controller[_0x0689('0x22')]);router[_0x0689('0x6')](_0x0689('0x23'),auth[_0x0689('0xa')](),controller[_0x0689('0x24')]);router[_0x0689('0x6')]('/outbound',auth[_0x0689('0xa')](),controller[_0x0689('0x25')]);router['get'](_0x0689('0x26'),auth['isAuthenticated'](),controller[_0x0689('0x27')]);router[_0x0689('0x6')](_0x0689('0x28'),auth[_0x0689('0xa')](),controller[_0x0689('0x29')]);router[_0x0689('0x2a')](_0x0689('0x2b'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0x0689('0x6')](_0x0689('0x2c'),auth[_0x0689('0xa')](),controller[_0x0689('0x2d')]);router[_0x0689('0x6')](_0x0689('0x2e'),auth[_0x0689('0xa')](),controller[_0x0689('0x2f')]);router['get'](_0x0689('0x30'),auth['isAuthenticated'](),controller['campaigns']);router['get'](_0x0689('0x31'),auth[_0x0689('0xa')](),controller[_0x0689('0x32')]);router[_0x0689('0x6')](_0x0689('0x33'),auth[_0x0689('0xa')](),controller[_0x0689('0x34')]);router[_0x0689('0x6')]('/mail/queues/waitinginteractions',auth[_0x0689('0xa')](),controller[_0x0689('0x35')]);router[_0x0689('0x6')]('/openchannel/queues/waitinginteractions',auth[_0x0689('0xa')](),controller[_0x0689('0x36')]);router['get'](_0x0689('0x37'),auth[_0x0689('0xa')](),controller[_0x0689('0x38')]);router[_0x0689('0x6')](_0x0689('0x39'),auth[_0x0689('0xa')](),controller[_0x0689('0x3a')]);router[_0x0689('0x3b')](_0x0689('0x3c'),auth[_0x0689('0xa')](),controller[_0x0689('0x3d')]('mail'));router[_0x0689('0x6')](_0x0689('0x3e'),auth[_0x0689('0xa')](),controller[_0x0689('0x3f')]);router[_0x0689('0x3b')](_0x0689('0x40'),auth[_0x0689('0xa')](),controller[_0x0689('0x3d')](_0x0689('0x41')));router[_0x0689('0x6')](_0x0689('0x42'),auth['isAuthenticated'](),controller[_0x0689('0x43')]);router[_0x0689('0x3b')]('/fax/queues/:id/notify',auth[_0x0689('0xa')](),controller[_0x0689('0x3d')](_0x0689('0x44')));router[_0x0689('0x6')](_0x0689('0x45'),auth[_0x0689('0xa')](),controller['showFaxQueues']);router[_0x0689('0x3b')](_0x0689('0x46'),auth[_0x0689('0xa')](),controller['queueNotify'](_0x0689('0x47')));router[_0x0689('0x6')](_0x0689('0x48'),auth['isAuthenticated'](),controller[_0x0689('0x49')]);router[_0x0689('0x3b')](_0x0689('0x4a'),auth['isAuthenticated'](),controller[_0x0689('0x3d')](_0x0689('0x4b')));router[_0x0689('0x6')](_0x0689('0x4c'),auth[_0x0689('0xa')](),controller['showSmsQueues']);router[_0x0689('0x3b')](_0x0689('0x4d'),auth[_0x0689('0xa')](),controller[_0x0689('0x4e')]);module[_0x0689('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index e5f3e83..6e5063d 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 _0xbe47=['isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','internal','AgentCapacity','capacity','telephones','Telephones','campaigns','Campaigns','chatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','update','queue','MessageId','From','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','capitalize','User','agent','Agent\x20not\x20found','\x20Message\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','status','stack','name','send'];(function(_0x20948a,_0x4b8cd6){var _0xfca912=function(_0x5851c4){while(--_0x5851c4){_0x20948a['push'](_0x20948a['shift']());}};_0xfca912(++_0x4b8cd6);}(_0xbe47,0xd1));var _0x7be4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe47[_0x167cc1];return _0x10bc4b;};'use strict';var BPromise=require(_0x7be4('0x0'));var moment=require(_0x7be4('0x1'));var _=require(_0x7be4('0x2'));var util=require(_0x7be4('0x3'));var db=require(_0x7be4('0x4'))['db'];var logger=require(_0x7be4('0x5'))(_0x7be4('0x6'));var jayson=require(_0x7be4('0x7'));var amiClient=jayson[_0x7be4('0x8')][_0x7be4('0x9')]({'port':0x232a});var mailClient=jayson[_0x7be4('0x8')][_0x7be4('0x9')]({'port':0x232b});var routingClient=jayson[_0x7be4('0x8')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4af445,_0x20e202,_0x1bd8c1){return new BPromise(function(_0x35f590,_0x500ccc){var _0x1ba6c5=_0x1bd8c1?_0x1bd8c1:amiClient;return _0x1ba6c5[_0x7be4('0xa')](_0x4af445,_0x20e202)[_0x7be4('0xb')](function(_0x3cc78a){if(_0x3cc78a[_0x7be4('0xc')]){if(_0x3cc78a[_0x7be4('0xc')][_0x7be4('0xd')]===0x1f4){return _0x500ccc(_0x3cc78a[_0x7be4('0xc')][_0x7be4('0xe')]);}return _0x35f590(_0x3cc78a[_0x7be4('0xc')]['message']);}else{_0x35f590(_0x3cc78a['result']);}})['catch'](function(_0x5635f6){_0x500ccc(_0x5635f6);});});}function respondWithResult(_0x646005,_0x1f37f2){_0x1f37f2=_0x1f37f2||0xc8;return function(_0x5b41d9){if(_0x5b41d9){return _0x646005[_0x7be4('0xf')](_0x1f37f2)['json'](_0x5b41d9);}return _0x646005['sendStatus'](0x194);};}function handleError(_0x604b1,_0x5d9c78){_0x5d9c78=_0x5d9c78||0x1f4;return function(_0x5a57cc){logger['error'](_0x5a57cc[_0x7be4('0x10')]);if(_0x5a57cc[_0x7be4('0x11')]){delete _0x5a57cc[_0x7be4('0x11')];}_0x604b1[_0x7be4('0xf')](_0x5d9c78)[_0x7be4('0x12')](_0x5a57cc);};}function findById(_0x3ca1e1){return function(_0x3b1292){if(!_[_0x7be4('0x13')](_0x3ca1e1)&&!_[_0x7be4('0x13')](_0x3b1292)&&!_[_0x7be4('0x13')](_0x3b1292[_0x7be4('0x14')])){return _[_0x7be4('0x15')](_0x3b1292['rows'],function(_0x344f4d){return _0x344f4d['id']==_0x3ca1e1;});}return null;};}exports[_0x7be4('0x16')]=function(_0x13a38e,_0x5717e7){return respondWithRpcPromise(_0x7be4('0x17'),_0x13a38e[_0x7be4('0x18')])[_0x7be4('0xb')](respondWithResult(_0x5717e7,null))[_0x7be4('0x19')](handleError(_0x5717e7,null));};exports[_0x7be4('0x1a')]=function(_0x59bc74,_0x5aea77){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x7be4('0x1b')](_0x59bc74[_0x7be4('0x18')],_0x59bc74[_0x7be4('0x1c')]))[_0x7be4('0xb')](respondWithResult(_0x5aea77,null))['catch'](handleError(_0x5aea77,null));};exports[_0x7be4('0x1d')]=function(_0x486d7a,_0x14fa4f){return respondWithRpcPromise(_0x7be4('0x1e'),_['merge'](_0x486d7a[_0x7be4('0x18')],_0x486d7a[_0x7be4('0x1c')]))[_0x7be4('0xb')](respondWithResult(_0x14fa4f,null))[_0x7be4('0x19')](handleError(_0x14fa4f,null));};exports[_0x7be4('0x1f')]=function(_0x12aa4a,_0x900fff){return respondWithRpcPromise(_0x7be4('0x20'),_0x12aa4a[_0x7be4('0x18')])[_0x7be4('0xb')](respondWithResult(_0x900fff,null))[_0x7be4('0x19')](handleError(_0x900fff,null));};exports[_0x7be4('0x21')]=function(_0x32c30d,_0x46dd6a){return respondWithRpcPromise(_0x7be4('0x20'),_0x32c30d['query'])[_0x7be4('0xb')](findById(_0x32c30d[_0x7be4('0x1c')]['id']))['then'](respondWithResult(_0x46dd6a,null))[_0x7be4('0x19')](handleError(_0x46dd6a,null));};exports[_0x7be4('0x22')]=function(_0x444605,_0x5756a0){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x7be4('0x1b')](_0x444605['query'],_0x444605[_0x7be4('0x1c')]))[_0x7be4('0xb')](respondWithResult(_0x5756a0,null))['catch'](handleError(_0x5756a0,null));};exports['voiceQueuesChannels']=function(_0x2ca10b,_0x197983){return respondWithRpcPromise('VoiceQueuesChannels',_0x2ca10b['query'])['then'](respondWithResult(_0x197983,null))[_0x7be4('0x19')](handleError(_0x197983,null));};exports[_0x7be4('0x23')]=function(_0x214c6b,_0x2f7ca1){return respondWithRpcPromise(_0x7be4('0x24'),_[_0x7be4('0x1b')](_0x214c6b[_0x7be4('0x18')],_0x214c6b[_0x7be4('0x1c')]))[_0x7be4('0xb')](respondWithResult(_0x2f7ca1,null))['catch'](handleError(_0x2f7ca1,null));};exports['voiceQueuesChannelHangup']=function(_0x1f6419,_0x55369e){return respondWithRpcPromise(_0x7be4('0x25'),_['merge'](_0x1f6419[_0x7be4('0x18')],_0x1f6419[_0x7be4('0x1c')]))['then'](respondWithResult(_0x55369e,null))[_0x7be4('0x19')](handleError(_0x55369e,null));};exports[_0x7be4('0x26')]=function(_0x411933,_0x3c3367){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x411933[_0x7be4('0x18')],_0x411933[_0x7be4('0x1c')]))[_0x7be4('0xb')](respondWithResult(_0x3c3367,null))[_0x7be4('0x19')](handleError(_0x3c3367,null));};exports['outbound']=function(_0x4a393b,_0x515d51){return respondWithRpcPromise(_0x7be4('0x27'),_0x4a393b[_0x7be4('0x18')])[_0x7be4('0xb')](respondWithResult(_0x515d51,null))['catch'](handleError(_0x515d51,null));};exports[_0x7be4('0x28')]=function(_0x5d29c6,_0x37fd40){return respondWithRpcPromise(_0x7be4('0x29'),_0x5d29c6[_0x7be4('0x18')])[_0x7be4('0xb')](respondWithResult(_0x37fd40,null))[_0x7be4('0x19')](handleError(_0x37fd40,null));};exports[_0x7be4('0x2a')]=function(_0xab6ec0,_0x4ac282){var _0x563d95;return respondWithRpcPromise(_0x7be4('0x2b'),_0xab6ec0['query'])[_0x7be4('0xb')](function(_0xb15ac9){_0x563d95=_0xb15ac9;return respondWithRpcPromise(_0x7be4('0x2b'),_0xab6ec0[_0x7be4('0x18')],routingClient);})[_0x7be4('0xb')](function(_0x384496){return _[_0x7be4('0x1b')]({},_0x384496,_0x563d95);})[_0x7be4('0xb')](respondWithResult(_0x4ac282,null))[_0x7be4('0x19')](handleError(_0x4ac282,null));};exports[_0x7be4('0x2c')]=function(_0x1e4b35,_0x5e18b8){if(_0x1e4b35[_0x7be4('0x2d')]&&_0x1e4b35[_0x7be4('0x2d')]['interaction']&&_0x1e4b35[_0x7be4('0x2e')]&&_0x1e4b35[_0x7be4('0x2e')]['name']){for(var _0x5688ed in _0x1e4b35[_0x7be4('0x2d')]['interaction']){if(_0x1e4b35[_0x7be4('0x2d')][_0x7be4('0x2f')][_0x7be4('0x30')](_0x5688ed)){db['MemberReport'][_0x7be4('0x31')]({'where':{'channel':_0x5688ed,'membername':_0x1e4b35[_0x7be4('0x2e')][_0x7be4('0x11')],'type':_0x7be4('0x32'),'exitAt':null,'uniqueid':_0x1e4b35[_0x7be4('0x2d')][_0x7be4('0x2f')][_0x5688ed]&&_0x1e4b35[_0x7be4('0x2d')][_0x7be4('0x2f')][_0x5688ed][_0x7be4('0x33')]?{'$notIn':_0x1e4b35['body'][_0x7be4('0x2f')][_0x5688ed]}:{'$ne':null}}})[_0x7be4('0xb')](function(_0x55d161){var _0x3a05c2=moment()[_0x7be4('0x34')](_0x7be4('0x35'));for(var _0x2c36b5=0x0,_0x1aa6a9=_0x55d161[_0x7be4('0x33')];_0x2c36b5<_0x1aa6a9;_0x2c36b5+=0x1){_0x55d161[_0x2c36b5][_0x7be4('0x36')]({'exitAt':_0x3a05c2});}});for(var _0x28c578=0x0;_0x28c578<_0x1e4b35[_0x7be4('0x2d')][_0x7be4('0x2f')][_0x5688ed]['length'];_0x28c578+=0x1){db[_0x7be4('0x37')][_0x7be4('0x38')]({'where':{'channel':_0x5688ed,'membername':_0x1e4b35[_0x7be4('0x2e')][_0x7be4('0x11')],'type':'INTERACTION','uniqueid':_0x1e4b35[_0x7be4('0x2d')][_0x7be4('0x2f')][_0x5688ed][_0x28c578],'exitAt':null},'defaults':{'channel':_0x5688ed,'membername':_0x1e4b35[_0x7be4('0x2e')]['name'],'interface':_['isNil'](_0x1e4b35['user'][_0x7be4('0x39')])?util[_0x7be4('0x34')](_0x7be4('0x3a'),_0x1e4b35[_0x7be4('0x2e')][_0x7be4('0x11')]):_0x1e4b35[_0x7be4('0x2e')][_0x7be4('0x39')],'type':_0x7be4('0x32'),'enterAt':moment()[_0x7be4('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x1e4b35['user'][_0x7be4('0x3b')],'uniqueid':_0x1e4b35[_0x7be4('0x2d')]['interaction'][_0x5688ed][_0x28c578]}});}}}}return respondWithRpcPromise(_0x7be4('0x3c'),{'id':_0x1e4b35['params']['id'],'capacity':_0x1e4b35['body'][_0x7be4('0x3d')]},routingClient)[_0x7be4('0xb')](respondWithResult(_0x5e18b8,null))[_0x7be4('0x19')](handleError(_0x5e18b8,null));};exports[_0x7be4('0x3e')]=function(_0x59487d,_0x47112a){return respondWithRpcPromise(_0x7be4('0x3f'),_0x59487d[_0x7be4('0x18')])[_0x7be4('0xb')](respondWithResult(_0x47112a,null))['catch'](handleError(_0x47112a,null));};exports['trunks']=function(_0x17107c,_0x2b581c){return respondWithRpcPromise('Trunks',_0x17107c[_0x7be4('0x18')])[_0x7be4('0xb')](respondWithResult(_0x2b581c,null))[_0x7be4('0x19')](handleError(_0x2b581c,null));};exports[_0x7be4('0x40')]=function(_0x4a9f37,_0x594dd0){return respondWithRpcPromise(_0x7be4('0x41'),_0x4a9f37[_0x7be4('0x18')])[_0x7be4('0xb')](respondWithResult(_0x594dd0,null))['catch'](handleError(_0x594dd0,null));};exports[_0x7be4('0x42')]=function(_0x3e8f94,_0x34f0e0){return respondWithRpcPromise(_0x7be4('0x43'),_0x3e8f94[_0x7be4('0x18')],routingClient)[_0x7be4('0xb')](respondWithResult(_0x34f0e0,null))[_0x7be4('0x19')](handleError(_0x34f0e0,null));};exports['showChatQueues']=function(_0x58c63d,_0x2ac3de){return respondWithRpcPromise('ChatQueues',_0x58c63d[_0x7be4('0x18')],routingClient)['then'](findById(_0x58c63d[_0x7be4('0x1c')]['id']))[_0x7be4('0xb')](respondWithResult(_0x2ac3de,null))['catch'](handleError(_0x2ac3de,null));};exports['mailQueues']=function(_0x49277b,_0x220acd){return respondWithRpcPromise(_0x7be4('0x44'),_0x49277b['query'],routingClient)[_0x7be4('0xb')](respondWithResult(_0x220acd,null))[_0x7be4('0x19')](handleError(_0x220acd,null));};exports[_0x7be4('0x45')]=function(_0x836175,_0x5b3390){return respondWithRpcPromise(_0x7be4('0x44'),_0x836175[_0x7be4('0x18')],routingClient)[_0x7be4('0xb')](findById(_0x836175[_0x7be4('0x1c')]['id']))[_0x7be4('0xb')](respondWithResult(_0x5b3390,null))[_0x7be4('0x19')](handleError(_0x5b3390,null));};exports[_0x7be4('0x46')]=function(_0xe4a759,_0x587c04){return respondWithRpcPromise(_0x7be4('0x47'),_0xe4a759[_0x7be4('0x18')],mailClient)[_0x7be4('0xb')](respondWithResult(_0x587c04,null))['catch'](handleError(_0x587c04,null));};exports[_0x7be4('0x48')]=function(_0x4cd20b,_0x1408d0){return respondWithRpcPromise(_0x7be4('0x49'),_0x4cd20b[_0x7be4('0x18')],routingClient)['then'](respondWithResult(_0x1408d0,null))[_0x7be4('0x19')](handleError(_0x1408d0,null));};exports[_0x7be4('0x4a')]=function(_0x342ba0,_0x17ac98){return respondWithRpcPromise(_0x7be4('0x49'),_0x342ba0['query'],routingClient)['then'](findById(_0x342ba0['params']['id']))[_0x7be4('0xb')](respondWithResult(_0x17ac98,null))[_0x7be4('0x19')](handleError(_0x17ac98,null));};exports[_0x7be4('0x4b')]=function(_0x23795a,_0x485081){return respondWithRpcPromise(_0x7be4('0x4c'),_0x23795a[_0x7be4('0x18')],routingClient)[_0x7be4('0xb')](respondWithResult(_0x485081,null))[_0x7be4('0x19')](handleError(_0x485081,null));};exports['showSmsQueues']=function(_0x105b27,_0x5ea516){return respondWithRpcPromise(_0x7be4('0x4c'),_0x105b27[_0x7be4('0x18')],routingClient)['then'](findById(_0x105b27[_0x7be4('0x1c')]['id']))[_0x7be4('0xb')](respondWithResult(_0x5ea516,null))[_0x7be4('0x19')](handleError(_0x5ea516,null));};exports[_0x7be4('0x4d')]=function(_0x3f0bd4,_0x2d9e79){return respondWithRpcPromise(_0x7be4('0x4e'),_0x3f0bd4['query'],routingClient)[_0x7be4('0xb')](respondWithResult(_0x2d9e79,null))[_0x7be4('0x19')](handleError(_0x2d9e79,null));};exports[_0x7be4('0x4f')]=function(_0x35f0d1,_0x130fd5){return respondWithRpcPromise(_0x7be4('0x4e'),_0x35f0d1[_0x7be4('0x18')],routingClient)['then'](findById(_0x35f0d1[_0x7be4('0x1c')]['id']))[_0x7be4('0xb')](respondWithResult(_0x130fd5,null))[_0x7be4('0x19')](handleError(_0x130fd5,null));};exports[_0x7be4('0x50')]=function(_0x5d40c3,_0x3926fc){return respondWithRpcPromise('FaxAccounts',_0x5d40c3[_0x7be4('0x18')])[_0x7be4('0xb')](respondWithResult(_0x3926fc,null))[_0x7be4('0x19')](handleError(_0x3926fc,null));};exports['chatQueuesWaitingInteractions']=function(_0x1907af,_0x5999f4){return respondWithRpcPromise(_0x7be4('0x51'),_0x1907af['query'],routingClient)[_0x7be4('0xb')](respondWithResult(_0x5999f4,null))['catch'](handleError(_0x5999f4,null));};exports['mailQueuesWaitingInteractions']=function(_0x12bc0d,_0x32d8f3){return respondWithRpcPromise(_0x7be4('0x52'),_0x12bc0d[_0x7be4('0x18')],routingClient)[_0x7be4('0xb')](respondWithResult(_0x32d8f3,null))[_0x7be4('0x19')](handleError(_0x32d8f3,null));};exports[_0x7be4('0x53')]=function(_0x15b031,_0x1da10f){return respondWithRpcPromise(_0x7be4('0x54'),_0x15b031[_0x7be4('0x18')],routingClient)[_0x7be4('0xb')](respondWithResult(_0x1da10f,null))[_0x7be4('0x19')](handleError(_0x1da10f,null));};exports[_0x7be4('0x55')]=function(_0xab1f3f,_0x1daf7f){return respondWithRpcPromise(_0x7be4('0x56'),_0xab1f3f[_0x7be4('0x18')],routingClient)[_0x7be4('0xb')](respondWithResult(_0x1daf7f,null))[_0x7be4('0x19')](handleError(_0x1daf7f,null));};exports[_0x7be4('0x57')]=function(_0x199a0d,_0x5a8b49){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x199a0d[_0x7be4('0x18')],routingClient)[_0x7be4('0xb')](respondWithResult(_0x5a8b49,null))[_0x7be4('0x19')](handleError(_0x5a8b49,null));};exports[_0x7be4('0x58')]=function(_0x5a1aeb){return function(_0x62477c,_0x5d0a21){var _0x1dfd39,_0x40aa79;var _0x471d0f=_['capitalize'](_0x5a1aeb);var _0x7f610c=_0x5a1aeb===_0x7be4('0x59')?'Website':_0x7be4('0x5a');return db[_0x471d0f+_0x7be4('0x5b')][_0x7be4('0x5c')]({'raw':!![],'where':{'id':_0x62477c[_0x7be4('0x1c')]['id']}})[_0x7be4('0xb')](function(_0x4c40d3){if(_[_0x7be4('0x13')](_0x4c40d3)){throw new Error(_0x471d0f+_0x7be4('0x5d'));}_0x1dfd39=_0x4c40d3;return db[_0x471d0f+_0x7be4('0x5e')][_0x7be4('0x5c')]({'where':{'id':_0x62477c[_0x7be4('0x2d')][_0x7be4('0x5f')]},'include':[{'model':db[_0x471d0f+_0x7be4('0x60')],'as':_0x7be4('0x60')},{'model':db[_0x471d0f+_0x7f610c],'as':_0x7be4('0x5a')}]});})[_0x7be4('0xb')](function(_0x339ebc){if(_[_0x7be4('0x13')](_0x339ebc)){throw new Error(_0x471d0f+'\x20Message\x20not\x20found');}_0x40aa79=_0x339ebc;return _0x339ebc[_0x7be4('0x61')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7be4('0xb')](function(){var _0x5516dc={'uniqueid':_0x5a1aeb+'.'+_0x40aa79['id']+'.'+_0x40aa79['Interaction']['id'],'FromUserId':_0x62477c[_0x7be4('0x2e')]['id'],'type':_0x7be4('0x62')};_0x5516dc[_0x471d0f+_0x7be4('0x63')]=_0x40aa79['id'];_0x5516dc[_0x471d0f+'InteractionId']=_0x40aa79[_0x7be4('0x60')]['id'];_0x5516dc[_0x7be4('0x64')+_0x471d0f+_0x7f610c+'Id']=_0x40aa79['Account']['id'];_0x5516dc['To'+_0x471d0f+'QueueId']=_0x1dfd39['id'];return db[_0x471d0f+_0x7be4('0x65')][_0x7be4('0x66')](_0x5516dc);})[_0x7be4('0xb')](function(){return respondWithRpcPromise(_0x7be4('0x67'),{'channel':_0x5a1aeb,'interaction':_0x40aa79['Interaction'],'message':_0x40aa79,'account':_0x40aa79['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x7be4('0x62'),'appdata':_0x1dfd39[_0x7be4('0x11')]+','+(_0x40aa79[_0x7be4('0x5a')][_0x7be4('0x68')]||0x12c),'interval':_0x7be4('0x69')}]},routingClient);})[_0x7be4('0xb')](respondWithResult(_0x5d0a21,null))[_0x7be4('0x19')](handleError(_0x5d0a21,null));};};exports['agentNotify']=function(_0x2e6f6d,_0x34dce7){var _0x32f3fa,_0x56a78a;if(_['isNil'](_0x2e6f6d[_0x7be4('0x2d')][_0x7be4('0x6a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x4314b1=_0x2e6f6d['body'][_0x7be4('0x6a')];var _0x3191c9=_[_0x7be4('0x6b')](_0x4314b1);var _0xdcf69b=_0x4314b1===_0x7be4('0x59')?'Website':_0x7be4('0x5a');return db[_0x7be4('0x6c')][_0x7be4('0x5c')]({'raw':!![],'where':{'id':_0x2e6f6d['params']['id'],'role':_0x7be4('0x6d')}})[_0x7be4('0xb')](function(_0x529f87){if(_[_0x7be4('0x13')](_0x529f87)){throw new Error(_0x7be4('0x6e'));}_0x32f3fa=_0x529f87;return db[_0x3191c9+'Message'][_0x7be4('0x5c')]({'where':{'id':_0x2e6f6d[_0x7be4('0x2d')][_0x7be4('0x5f')]},'include':[{'model':db[_0x3191c9+_0x7be4('0x60')],'as':'Interaction'},{'model':db[_0x3191c9+_0xdcf69b],'as':_0x7be4('0x5a')}]});})[_0x7be4('0xb')](function(_0x4bb795){if(_[_0x7be4('0x13')](_0x4bb795)){throw new Error(_0x3191c9+_0x7be4('0x6f'));}_0x56a78a=_0x4bb795;return _0x4bb795[_0x7be4('0x61')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4c44b0={'uniqueid':_0x4314b1+'.'+_0x56a78a['id']+'.'+_0x56a78a[_0x7be4('0x60')]['id'],'FromUserId':_0x2e6f6d[_0x7be4('0x2e')]['id'],'type':'queue','ToUserId':_0x32f3fa['id']};_0x4c44b0[_0x3191c9+_0x7be4('0x63')]=_0x56a78a['id'];_0x4c44b0[_0x3191c9+_0x7be4('0x70')]=_0x56a78a[_0x7be4('0x60')]['id'];_0x4c44b0[_0x7be4('0x64')+_0x3191c9+_0xdcf69b+'Id']=_0x56a78a[_0x7be4('0x5a')]['id'];return db[_0x3191c9+'TransferReport'][_0x7be4('0x66')](_0x4c44b0);})['then'](function(){return respondWithRpcPromise(_0x7be4('0x67'),{'channel':_0x4314b1,'interaction':_0x56a78a['Interaction'],'message':_0x56a78a,'account':_0x56a78a['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x7be4('0x6d'),'appdata':_0x32f3fa[_0x7be4('0x11')]+','+(_0x56a78a[_0x7be4('0x5a')][_0x7be4('0x71')]||0x12c),'interval':_0x7be4('0x69')}]},routingClient);})['then'](respondWithResult(_0x34dce7,null))['catch'](handleError(_0x34dce7,null));}; \ No newline at end of file +var _0xcf11=['VoiceChannels','query','voiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','length','format','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','telephones','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Agent\x20not\x20found','update','create','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','http','client','then','error','code','message','result','catch','status','json','name','isNil','rows','find','voiceChannels'];(function(_0x4c7985,_0x517cf7){var _0x14c7fa=function(_0x2fe1a6){while(--_0x2fe1a6){_0x4c7985['push'](_0x4c7985['shift']());}};_0x14c7fa(++_0x517cf7);}(_0xcf11,0x1b2));var _0x1cf1=function(_0x197767,_0x400276){_0x197767=_0x197767-0x0;var _0x5422c6=_0xcf11[_0x197767];return _0x5422c6;};'use strict';var BPromise=require(_0x1cf1('0x0'));var moment=require(_0x1cf1('0x1'));var _=require(_0x1cf1('0x2'));var util=require(_0x1cf1('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x1cf1('0x4'))(_0x1cf1('0x5'));var jayson=require(_0x1cf1('0x6'));var amiClient=jayson['client'][_0x1cf1('0x7')]({'port':0x232a});var mailClient=jayson[_0x1cf1('0x8')]['http']({'port':0x232b});var routingClient=jayson[_0x1cf1('0x8')]['http']({'port':0x232c});function respondWithRpcPromise(_0x49eba3,_0x40f520,_0x6c663d){return new BPromise(function(_0x5c19d7,_0x179bae){var _0x1ef168=_0x6c663d?_0x6c663d:amiClient;return _0x1ef168['request'](_0x49eba3,_0x40f520)[_0x1cf1('0x9')](function(_0x1058a2){if(_0x1058a2[_0x1cf1('0xa')]){if(_0x1058a2[_0x1cf1('0xa')][_0x1cf1('0xb')]===0x1f4){return _0x179bae(_0x1058a2[_0x1cf1('0xa')][_0x1cf1('0xc')]);}return _0x5c19d7(_0x1058a2[_0x1cf1('0xa')][_0x1cf1('0xc')]);}else{_0x5c19d7(_0x1058a2[_0x1cf1('0xd')]);}})[_0x1cf1('0xe')](function(_0x3f4e27){_0x179bae(_0x3f4e27);});});}function respondWithResult(_0x2d1c78,_0x107b37){_0x107b37=_0x107b37||0xc8;return function(_0x86bc92){if(_0x86bc92){return _0x2d1c78[_0x1cf1('0xf')](_0x107b37)[_0x1cf1('0x10')](_0x86bc92);}return _0x2d1c78['sendStatus'](0x194);};}function handleError(_0x1e4aea,_0x2dc682){_0x2dc682=_0x2dc682||0x1f4;return function(_0x26ead1){logger['error'](_0x26ead1['stack']);if(_0x26ead1[_0x1cf1('0x11')]){delete _0x26ead1[_0x1cf1('0x11')];}_0x1e4aea[_0x1cf1('0xf')](_0x2dc682)['send'](_0x26ead1);};}function findById(_0x108efd){return function(_0x10c157){if(!_[_0x1cf1('0x12')](_0x108efd)&&!_[_0x1cf1('0x12')](_0x10c157)&&!_[_0x1cf1('0x12')](_0x10c157[_0x1cf1('0x13')])){return _[_0x1cf1('0x14')](_0x10c157[_0x1cf1('0x13')],function(_0x204a46){return _0x204a46['id']==_0x108efd;});}return null;};}exports[_0x1cf1('0x15')]=function(_0x4bb8cf,_0x1b17dc){return respondWithRpcPromise(_0x1cf1('0x16'),_0x4bb8cf[_0x1cf1('0x17')])[_0x1cf1('0x9')](respondWithResult(_0x1b17dc,null))[_0x1cf1('0xe')](handleError(_0x1b17dc,null));};exports[_0x1cf1('0x18')]=function(_0x583f9f,_0x5eacf4){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x583f9f[_0x1cf1('0x17')],_0x583f9f['params']))[_0x1cf1('0x9')](respondWithResult(_0x5eacf4,null))[_0x1cf1('0xe')](handleError(_0x5eacf4,null));};exports[_0x1cf1('0x19')]=function(_0xad5fcf,_0x31d4f6){return respondWithRpcPromise(_0x1cf1('0x1a'),_[_0x1cf1('0x1b')](_0xad5fcf[_0x1cf1('0x17')],_0xad5fcf[_0x1cf1('0x1c')]))['then'](respondWithResult(_0x31d4f6,null))[_0x1cf1('0xe')](handleError(_0x31d4f6,null));};exports[_0x1cf1('0x1d')]=function(_0x5b65c6,_0x5c74f5){return respondWithRpcPromise(_0x1cf1('0x1e'),_0x5b65c6[_0x1cf1('0x17')])['then'](respondWithResult(_0x5c74f5,null))[_0x1cf1('0xe')](handleError(_0x5c74f5,null));};exports[_0x1cf1('0x1f')]=function(_0x2a33cd,_0x5dc2c6){return respondWithRpcPromise('VoiceQueues',_0x2a33cd[_0x1cf1('0x17')])[_0x1cf1('0x9')](findById(_0x2a33cd[_0x1cf1('0x1c')]['id']))[_0x1cf1('0x9')](respondWithResult(_0x5dc2c6,null))[_0x1cf1('0xe')](handleError(_0x5dc2c6,null));};exports['voiceQueuesPreview']=function(_0xf5f4b2,_0x586957){return respondWithRpcPromise(_0x1cf1('0x20'),_[_0x1cf1('0x1b')](_0xf5f4b2['query'],_0xf5f4b2[_0x1cf1('0x1c')]))[_0x1cf1('0x9')](respondWithResult(_0x586957,null))[_0x1cf1('0xe')](handleError(_0x586957,null));};exports['voiceQueuesChannels']=function(_0x44c22a,_0x44822e){return respondWithRpcPromise(_0x1cf1('0x21'),_0x44c22a[_0x1cf1('0x17')])[_0x1cf1('0x9')](respondWithResult(_0x44822e,null))[_0x1cf1('0xe')](handleError(_0x44822e,null));};exports['voiceQueuesChannel']=function(_0x181c7f,_0x2dda81){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x1cf1('0x1b')](_0x181c7f[_0x1cf1('0x17')],_0x181c7f[_0x1cf1('0x1c')]))[_0x1cf1('0x9')](respondWithResult(_0x2dda81,null))[_0x1cf1('0xe')](handleError(_0x2dda81,null));};exports[_0x1cf1('0x22')]=function(_0x5668d4,_0x2688a7){return respondWithRpcPromise(_0x1cf1('0x23'),_[_0x1cf1('0x1b')](_0x5668d4[_0x1cf1('0x17')],_0x5668d4['params']))['then'](respondWithResult(_0x2688a7,null))['catch'](handleError(_0x2688a7,null));};exports[_0x1cf1('0x24')]=function(_0x5d533b,_0x4df159){return respondWithRpcPromise(_0x1cf1('0x25'),_[_0x1cf1('0x1b')](_0x5d533b[_0x1cf1('0x17')],_0x5d533b[_0x1cf1('0x1c')]))[_0x1cf1('0x9')](respondWithResult(_0x4df159,null))[_0x1cf1('0xe')](handleError(_0x4df159,null));};exports[_0x1cf1('0x26')]=function(_0x295ee9,_0x2ad39a){return respondWithRpcPromise(_0x1cf1('0x27'),_0x295ee9[_0x1cf1('0x17')])[_0x1cf1('0x9')](respondWithResult(_0x2ad39a,null))[_0x1cf1('0xe')](handleError(_0x2ad39a,null));};exports[_0x1cf1('0x28')]=function(_0x1195d0,_0x187929){return respondWithRpcPromise('OutboundChannels',_0x1195d0[_0x1cf1('0x17')])[_0x1cf1('0x9')](respondWithResult(_0x187929,null))[_0x1cf1('0xe')](handleError(_0x187929,null));};exports[_0x1cf1('0x29')]=function(_0xd2efdb,_0x17089b){var _0x273375;return respondWithRpcPromise('Agents',_0xd2efdb['query'])['then'](function(_0x3be7d4){_0x273375=_0x3be7d4;return respondWithRpcPromise(_0x1cf1('0x2a'),_0xd2efdb[_0x1cf1('0x17')],routingClient);})['then'](function(_0x12bc17){return _[_0x1cf1('0x1b')]({},_0x12bc17,_0x273375);})[_0x1cf1('0x9')](respondWithResult(_0x17089b,null))[_0x1cf1('0xe')](handleError(_0x17089b,null));};exports[_0x1cf1('0x2b')]=function(_0x16cb17,_0x1e1d45){if(_0x16cb17[_0x1cf1('0x2c')]&&_0x16cb17[_0x1cf1('0x2c')]['interaction']&&_0x16cb17[_0x1cf1('0x2d')]&&_0x16cb17[_0x1cf1('0x2d')][_0x1cf1('0x11')]){for(var _0x46e76a in _0x16cb17['body'][_0x1cf1('0x2e')]){if(_0x16cb17[_0x1cf1('0x2c')][_0x1cf1('0x2e')][_0x1cf1('0x2f')](_0x46e76a)){db[_0x1cf1('0x30')][_0x1cf1('0x31')]({'where':{'channel':_0x46e76a,'membername':_0x16cb17['user'][_0x1cf1('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x16cb17['body'][_0x1cf1('0x2e')][_0x46e76a]&&_0x16cb17['body'][_0x1cf1('0x2e')][_0x46e76a][_0x1cf1('0x32')]?{'$notIn':_0x16cb17[_0x1cf1('0x2c')][_0x1cf1('0x2e')][_0x46e76a]}:{'$ne':null}}})[_0x1cf1('0x9')](function(_0x537b69){var _0x4de060=moment()[_0x1cf1('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x393f35=0x0,_0x1bc31e=_0x537b69[_0x1cf1('0x32')];_0x393f35<_0x1bc31e;_0x393f35+=0x1){_0x537b69[_0x393f35]['updateAttributes']({'exitAt':_0x4de060});}});for(var _0x498bbd=0x0;_0x498bbd<_0x16cb17['body'][_0x1cf1('0x2e')][_0x46e76a][_0x1cf1('0x32')];_0x498bbd+=0x1){db[_0x1cf1('0x30')][_0x1cf1('0x34')]({'where':{'channel':_0x46e76a,'membername':_0x16cb17[_0x1cf1('0x2d')]['name'],'type':_0x1cf1('0x35'),'uniqueid':_0x16cb17[_0x1cf1('0x2c')][_0x1cf1('0x2e')][_0x46e76a][_0x498bbd],'exitAt':null},'defaults':{'channel':_0x46e76a,'membername':_0x16cb17[_0x1cf1('0x2d')][_0x1cf1('0x11')],'interface':_[_0x1cf1('0x12')](_0x16cb17[_0x1cf1('0x2d')][_0x1cf1('0x36')])?util['format'](_0x1cf1('0x37'),_0x16cb17[_0x1cf1('0x2d')][_0x1cf1('0x11')]):_0x16cb17['user'][_0x1cf1('0x36')],'type':_0x1cf1('0x35'),'enterAt':moment()[_0x1cf1('0x33')](_0x1cf1('0x38')),'role':_0x1cf1('0x39'),'internal':_0x16cb17[_0x1cf1('0x2d')][_0x1cf1('0x3a')],'uniqueid':_0x16cb17[_0x1cf1('0x2c')][_0x1cf1('0x2e')][_0x46e76a][_0x498bbd]}});}}}}return respondWithRpcPromise(_0x1cf1('0x3b'),{'id':_0x16cb17[_0x1cf1('0x1c')]['id'],'capacity':_0x16cb17['body']['capacity']},routingClient)[_0x1cf1('0x9')](respondWithResult(_0x1e1d45,null))[_0x1cf1('0xe')](handleError(_0x1e1d45,null));};exports[_0x1cf1('0x3c')]=function(_0x9e7e9,_0x438949){return respondWithRpcPromise('Telephones',_0x9e7e9[_0x1cf1('0x17')])[_0x1cf1('0x9')](respondWithResult(_0x438949,null))[_0x1cf1('0xe')](handleError(_0x438949,null));};exports['trunks']=function(_0x17eb13,_0x11c1b6){return respondWithRpcPromise(_0x1cf1('0x3d'),_0x17eb13[_0x1cf1('0x17')])['then'](respondWithResult(_0x11c1b6,null))['catch'](handleError(_0x11c1b6,null));};exports[_0x1cf1('0x3e')]=function(_0x1192dd,_0x447a79){return respondWithRpcPromise(_0x1cf1('0x3f'),_0x1192dd[_0x1cf1('0x17')])[_0x1cf1('0x9')](respondWithResult(_0x447a79,null))[_0x1cf1('0xe')](handleError(_0x447a79,null));};exports['chatQueues']=function(_0x33d1ec,_0x1b2762){return respondWithRpcPromise(_0x1cf1('0x40'),_0x33d1ec['query'],routingClient)['then'](respondWithResult(_0x1b2762,null))[_0x1cf1('0xe')](handleError(_0x1b2762,null));};exports['showChatQueues']=function(_0x390f1b,_0x4f803b){return respondWithRpcPromise(_0x1cf1('0x40'),_0x390f1b[_0x1cf1('0x17')],routingClient)[_0x1cf1('0x9')](findById(_0x390f1b[_0x1cf1('0x1c')]['id']))[_0x1cf1('0x9')](respondWithResult(_0x4f803b,null))[_0x1cf1('0xe')](handleError(_0x4f803b,null));};exports[_0x1cf1('0x41')]=function(_0x20e608,_0x504ff8){return respondWithRpcPromise('MailQueues',_0x20e608[_0x1cf1('0x17')],routingClient)[_0x1cf1('0x9')](respondWithResult(_0x504ff8,null))[_0x1cf1('0xe')](handleError(_0x504ff8,null));};exports[_0x1cf1('0x42')]=function(_0x249fd,_0x220515){return respondWithRpcPromise(_0x1cf1('0x43'),_0x249fd[_0x1cf1('0x17')],routingClient)[_0x1cf1('0x9')](findById(_0x249fd[_0x1cf1('0x1c')]['id']))[_0x1cf1('0x9')](respondWithResult(_0x220515,null))[_0x1cf1('0xe')](handleError(_0x220515,null));};exports[_0x1cf1('0x44')]=function(_0x406299,_0x5ee71a){return respondWithRpcPromise('MailAccounts',_0x406299[_0x1cf1('0x17')],mailClient)[_0x1cf1('0x9')](respondWithResult(_0x5ee71a,null))['catch'](handleError(_0x5ee71a,null));};exports['openchannelQueues']=function(_0x57989f,_0x1cfc6b){return respondWithRpcPromise(_0x1cf1('0x45'),_0x57989f[_0x1cf1('0x17')],routingClient)[_0x1cf1('0x9')](respondWithResult(_0x1cfc6b,null))[_0x1cf1('0xe')](handleError(_0x1cfc6b,null));};exports['showOpenchannelQueues']=function(_0x3f3e6f,_0x58974d){return respondWithRpcPromise(_0x1cf1('0x45'),_0x3f3e6f['query'],routingClient)['then'](findById(_0x3f3e6f[_0x1cf1('0x1c')]['id']))[_0x1cf1('0x9')](respondWithResult(_0x58974d,null))[_0x1cf1('0xe')](handleError(_0x58974d,null));};exports[_0x1cf1('0x46')]=function(_0x5231f3,_0x968db3){return respondWithRpcPromise('SmsQueues',_0x5231f3[_0x1cf1('0x17')],routingClient)[_0x1cf1('0x9')](respondWithResult(_0x968db3,null))['catch'](handleError(_0x968db3,null));};exports[_0x1cf1('0x47')]=function(_0x29839c,_0x5bcefa){return respondWithRpcPromise(_0x1cf1('0x48'),_0x29839c[_0x1cf1('0x17')],routingClient)['then'](findById(_0x29839c['params']['id']))[_0x1cf1('0x9')](respondWithResult(_0x5bcefa,null))['catch'](handleError(_0x5bcefa,null));};exports[_0x1cf1('0x49')]=function(_0x3bca63,_0x4fd44d){return respondWithRpcPromise('FaxQueues',_0x3bca63[_0x1cf1('0x17')],routingClient)[_0x1cf1('0x9')](respondWithResult(_0x4fd44d,null))['catch'](handleError(_0x4fd44d,null));};exports[_0x1cf1('0x4a')]=function(_0x1c87c8,_0x3eb8d2){return respondWithRpcPromise(_0x1cf1('0x4b'),_0x1c87c8[_0x1cf1('0x17')],routingClient)[_0x1cf1('0x9')](findById(_0x1c87c8[_0x1cf1('0x1c')]['id']))[_0x1cf1('0x9')](respondWithResult(_0x3eb8d2,null))[_0x1cf1('0xe')](handleError(_0x3eb8d2,null));};exports[_0x1cf1('0x4c')]=function(_0x476d16,_0x4bd64f){return respondWithRpcPromise(_0x1cf1('0x4d'),_0x476d16[_0x1cf1('0x17')])[_0x1cf1('0x9')](respondWithResult(_0x4bd64f,null))['catch'](handleError(_0x4bd64f,null));};exports[_0x1cf1('0x4e')]=function(_0x213d07,_0x4aa402){return respondWithRpcPromise(_0x1cf1('0x4f'),_0x213d07[_0x1cf1('0x17')],routingClient)[_0x1cf1('0x9')](respondWithResult(_0x4aa402,null))[_0x1cf1('0xe')](handleError(_0x4aa402,null));};exports[_0x1cf1('0x50')]=function(_0x3be72a,_0x4db961){return respondWithRpcPromise(_0x1cf1('0x51'),_0x3be72a['query'],routingClient)['then'](respondWithResult(_0x4db961,null))[_0x1cf1('0xe')](handleError(_0x4db961,null));};exports[_0x1cf1('0x52')]=function(_0x587053,_0x5b2fae){return respondWithRpcPromise(_0x1cf1('0x53'),_0x587053['query'],routingClient)['then'](respondWithResult(_0x5b2fae,null))[_0x1cf1('0xe')](handleError(_0x5b2fae,null));};exports[_0x1cf1('0x54')]=function(_0x59eab0,_0x430d25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59eab0['query'],routingClient)[_0x1cf1('0x9')](respondWithResult(_0x430d25,null))[_0x1cf1('0xe')](handleError(_0x430d25,null));};exports[_0x1cf1('0x55')]=function(_0x5a8b91,_0x35e20d){return respondWithRpcPromise(_0x1cf1('0x56'),_0x5a8b91[_0x1cf1('0x17')],routingClient)[_0x1cf1('0x9')](respondWithResult(_0x35e20d,null))[_0x1cf1('0xe')](handleError(_0x35e20d,null));};exports[_0x1cf1('0x57')]=function(_0x6e502){return function(_0x38cf8c,_0x42f23a){var _0x2483f8,_0x59ce44;var _0x12fb3f=_[_0x1cf1('0x58')](_0x6e502);var _0x40dd31=_0x6e502===_0x1cf1('0x59')?_0x1cf1('0x5a'):_0x1cf1('0x5b');return db[_0x12fb3f+_0x1cf1('0x5c')][_0x1cf1('0x5d')]({'raw':!![],'where':{'id':_0x38cf8c[_0x1cf1('0x1c')]['id']}})['then'](function(_0x5749cd){if(_['isNil'](_0x5749cd)){throw new Error(_0x12fb3f+_0x1cf1('0x5e'));}_0x2483f8=_0x5749cd;return db[_0x12fb3f+_0x1cf1('0x5f')]['findOne']({'where':{'id':_0x38cf8c[_0x1cf1('0x2c')][_0x1cf1('0x60')]},'include':[{'model':db[_0x12fb3f+_0x1cf1('0x61')],'as':_0x1cf1('0x61')},{'model':db[_0x12fb3f+_0x40dd31],'as':_0x1cf1('0x5b')}]});})[_0x1cf1('0x9')](function(_0x428dfc){if(_[_0x1cf1('0x12')](_0x428dfc)){throw new Error(_0x12fb3f+_0x1cf1('0x62'));}_0x59ce44=_0x428dfc;return _0x428dfc['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1bfacb={'uniqueid':_0x6e502+'.'+_0x59ce44['id']+'.'+_0x59ce44[_0x1cf1('0x61')]['id'],'FromUserId':_0x38cf8c[_0x1cf1('0x2d')]['id'],'type':_0x1cf1('0x63')};_0x1bfacb[_0x12fb3f+_0x1cf1('0x64')]=_0x59ce44['id'];_0x1bfacb[_0x12fb3f+_0x1cf1('0x65')]=_0x59ce44[_0x1cf1('0x61')]['id'];_0x1bfacb[_0x1cf1('0x66')+_0x12fb3f+_0x40dd31+'Id']=_0x59ce44[_0x1cf1('0x5b')]['id'];_0x1bfacb['To'+_0x12fb3f+_0x1cf1('0x67')]=_0x2483f8['id'];return db[_0x12fb3f+_0x1cf1('0x68')]['create'](_0x1bfacb);})['then'](function(){return respondWithRpcPromise(_0x1cf1('0x69'),{'channel':_0x6e502,'interaction':_0x59ce44[_0x1cf1('0x61')],'message':_0x59ce44,'account':_0x59ce44[_0x1cf1('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x1cf1('0x63'),'appdata':_0x2483f8[_0x1cf1('0x11')]+','+(_0x59ce44[_0x1cf1('0x5b')][_0x1cf1('0x6a')]||0x12c),'interval':_0x1cf1('0x6b')}]},routingClient);})[_0x1cf1('0x9')](respondWithResult(_0x42f23a,null))[_0x1cf1('0xe')](handleError(_0x42f23a,null));};};exports[_0x1cf1('0x6c')]=function(_0x56cce7,_0x384fe7){var _0x1098ed,_0x554983;if(_[_0x1cf1('0x12')](_0x56cce7[_0x1cf1('0x2c')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x4f0a51=_0x56cce7[_0x1cf1('0x2c')][_0x1cf1('0x6d')];var _0x47b01e=_[_0x1cf1('0x58')](_0x4f0a51);var _0x5800bf=_0x4f0a51==='chat'?'Website':_0x1cf1('0x5b');return db['User'][_0x1cf1('0x5d')]({'raw':!![],'where':{'id':_0x56cce7[_0x1cf1('0x1c')]['id'],'role':'agent'}})['then'](function(_0x304919){if(_['isNil'](_0x304919)){throw new Error(_0x1cf1('0x6e'));}_0x1098ed=_0x304919;return db[_0x47b01e+_0x1cf1('0x5f')][_0x1cf1('0x5d')]({'where':{'id':_0x56cce7[_0x1cf1('0x2c')][_0x1cf1('0x60')]},'include':[{'model':db[_0x47b01e+'Interaction'],'as':_0x1cf1('0x61')},{'model':db[_0x47b01e+_0x5800bf],'as':'Account'}]});})[_0x1cf1('0x9')](function(_0x4cb262){if(_[_0x1cf1('0x12')](_0x4cb262)){throw new Error(_0x47b01e+_0x1cf1('0x62'));}_0x554983=_0x4cb262;return _0x4cb262[_0x1cf1('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4b6a30={'uniqueid':_0x4f0a51+'.'+_0x554983['id']+'.'+_0x554983[_0x1cf1('0x61')]['id'],'FromUserId':_0x56cce7['user']['id'],'type':'queue','ToUserId':_0x1098ed['id']};_0x4b6a30[_0x47b01e+_0x1cf1('0x64')]=_0x554983['id'];_0x4b6a30[_0x47b01e+_0x1cf1('0x65')]=_0x554983[_0x1cf1('0x61')]['id'];_0x4b6a30[_0x1cf1('0x66')+_0x47b01e+_0x5800bf+'Id']=_0x554983['Account']['id'];return db[_0x47b01e+'TransferReport'][_0x1cf1('0x70')](_0x4b6a30);})['then'](function(){return respondWithRpcPromise(_0x1cf1('0x69'),{'channel':_0x4f0a51,'interaction':_0x554983['Interaction'],'message':_0x554983,'account':_0x554983[_0x1cf1('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1098ed[_0x1cf1('0x11')]+','+(_0x554983['Account'][_0x1cf1('0x71')]||0x12c),'interval':_0x1cf1('0x6b')}]},routingClient);})[_0x1cf1('0x9')](respondWithResult(_0x384fe7,null))['catch'](handleError(_0x384fe7,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 579035d..57d8e63 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 _0xffb6=['Router','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','/:id/run','run','create','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x5523be,_0x1de3d7){var _0x410688=function(_0xcda4dd){while(--_0xcda4dd){_0x5523be['push'](_0x5523be['shift']());}};_0x410688(++_0x1de3d7);}(_0xffb6,0x1d9));var _0x6ffb=function(_0x514098,_0x11fb68){_0x514098=_0x514098-0x0;var _0x4a9089=_0xffb6[_0x514098];return _0x4a9089;};'use strict';var multer=require(_0x6ffb('0x0'));var util=require('util');var path=require(_0x6ffb('0x1'));var timeout=require(_0x6ffb('0x2'));var express=require('express');var router=express[_0x6ffb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6ffb('0x4'));var config=require(_0x6ffb('0x5'));var controller=require(_0x6ffb('0x6'));router[_0x6ffb('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6ffb('0x8'),auth[_0x6ffb('0x9')](),controller['show']);router['get'](_0x6ffb('0xa'),auth['isAuthenticated'](),controller[_0x6ffb('0xb')]);router['post']('/',auth[_0x6ffb('0x9')](),controller[_0x6ffb('0xc')]);router[_0x6ffb('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6ffb('0xe')]('/:id',auth[_0x6ffb('0x9')](),controller[_0x6ffb('0xf')]);module[_0x6ffb('0x10')]=router; \ No newline at end of file +var _0x640e=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','/:id','show','get','run','post','create','put','delete','destroy'];(function(_0x49bdc4,_0x1e2507){var _0x1f7437=function(_0x25a9f9){while(--_0x25a9f9){_0x49bdc4['push'](_0x49bdc4['shift']());}};_0x1f7437(++_0x1e2507);}(_0x640e,0x190));var _0xe640=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x640e[_0x50e40b];return _0x2608b7;};'use strict';var multer=require(_0xe640('0x0'));var util=require(_0xe640('0x1'));var path=require(_0xe640('0x2'));var timeout=require(_0xe640('0x3'));var express=require(_0xe640('0x4'));var router=express[_0xe640('0x5')]();var auth=require(_0xe640('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe640('0x7'));var controller=require('./schedule.controller');router['get']('/',auth[_0xe640('0x8')](),controller['index']);router['get'](_0xe640('0x9'),auth[_0xe640('0x8')](),controller[_0xe640('0xa')]);router[_0xe640('0xb')]('/:id/run',auth[_0xe640('0x8')](),controller[_0xe640('0xc')]);router[_0xe640('0xd')]('/',auth[_0xe640('0x8')](),controller[_0xe640('0xe')]);router[_0xe640('0xf')](_0xe640('0x9'),auth[_0xe640('0x8')](),controller['update']);router[_0xe640('0x10')](_0xe640('0x9'),auth['isAuthenticated'](),controller[_0xe640('0x11')]);module[_0xe640('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 1b9308e..7babc9e 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 _0x5a93=['STRING','BOOLEAN','DATE','INTEGER','years','quarters','months','weeks','days','hours','minutes','ENUM','csv','pdf','xlsx','custom','default','TEXT','exports'];(function(_0x13f4f8,_0x1442df){var _0x37245d=function(_0x1bbbb9){while(--_0x1bbbb9){_0x13f4f8['push'](_0x13f4f8['shift']());}};_0x37245d(++_0x1442df);}(_0x5a93,0xf6));var _0x35a9=function(_0x2a416a,_0x2f0660){_0x2a416a=_0x2a416a-0x0;var _0x52bb59=_0x5a93[_0x2a416a];return _0x52bb59;};'use strict';var Sequelize=require('sequelize');module[_0x35a9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35a9('0x1')]},'active':{'type':Sequelize[_0x35a9('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x35a9('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x35a9('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x35a9('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x35a9('0x5'),_0x35a9('0x6'),_0x35a9('0x7'),_0x35a9('0x8'),_0x35a9('0x9'),_0x35a9('0xa'),_0x35a9('0xb')),'allowNull':![],'defaultValue':_0x35a9('0x9')},'output':{'type':Sequelize[_0x35a9('0xc')](_0x35a9('0xd'),_0x35a9('0xe'),_0x35a9('0xf')),'allowNull':![],'defaultValue':_0x35a9('0xd')},'type':{'type':Sequelize[_0x35a9('0xc')](_0x35a9('0x10'),_0x35a9('0x11')),'allowNull':![],'defaultValue':_0x35a9('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x35a9('0x1')]},'cc':{'type':Sequelize[_0x35a9('0x12')]},'bcc':{'type':Sequelize[_0x35a9('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x35a9('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9e8a=['xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','months','weeks','days','hours','minutes','ENUM','csv','pdf'];(function(_0x2a5b28,_0x22bbdc){var _0x5be01f=function(_0x3ece9b){while(--_0x3ece9b){_0x2a5b28['push'](_0x2a5b28['shift']());}};_0x5be01f(++_0x22bbdc);}(_0x9e8a,0x112));var _0xa9e8=function(_0x291501,_0x177f28){_0x291501=_0x291501-0x0;var _0xfa89f2=_0x9e8a[_0x291501];return _0xfa89f2;};'use strict';var Sequelize=require(_0xa9e8('0x0'));module[_0xa9e8('0x1')]={'name':{'type':Sequelize[_0xa9e8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa9e8('0x2')]},'active':{'type':Sequelize[_0xa9e8('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xa9e8('0x2')],'allowNull':![],'defaultValue':_0xa9e8('0x4')},'startAt':{'type':Sequelize[_0xa9e8('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xa9e8('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years','quarters',_0xa9e8('0x6'),_0xa9e8('0x7'),_0xa9e8('0x8'),_0xa9e8('0x9'),_0xa9e8('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xa9e8('0xb')](_0xa9e8('0xc'),_0xa9e8('0xd'),_0xa9e8('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xa9e8('0xb')](_0xa9e8('0xf'),_0xa9e8('0x10')),'allowNull':![],'defaultValue':_0xa9e8('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xa9e8('0x2')]},'cc':{'type':Sequelize[_0xa9e8('0x11')]},'bcc':{'type':Sequelize[_0xa9e8('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xa9e8('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 f7b6eb1..4e33ecd 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 _0x7875=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','limit','status','Content-Range','reject','update','destroy','then','Scheduler','end','error','stack','name','send','index','fieldName','type','key','map','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','offset','order','sort','filter','where','merge','VIRTUAL','options','Schedule','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4597e2,_0x47ff66){var _0x4b6eeb=function(_0x5de2bd){while(--_0x5de2bd){_0x4597e2['push'](_0x4597e2['shift']());}};_0x4b6eeb(++_0x47ff66);}(_0x7875,0x18e));var _0x5787=function(_0x36617c,_0x12b879){_0x36617c=_0x36617c-0x0;var _0x26e24d=_0x7875[_0x36617c];return _0x26e24d;};'use strict';var pdf=require(_0x5787('0x0'));var emlformat=require(_0x5787('0x1'));var rimraf=require(_0x5787('0x2'));var zipdir=require(_0x5787('0x3'));var jsonpatch=require(_0x5787('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5787('0x5'));var util=require(_0x5787('0x6'));var path=require(_0x5787('0x7'));var sox=require(_0x5787('0x8'));var csv=require(_0x5787('0x9'));var ejs=require(_0x5787('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5787('0xb'));var crypto=require(_0x5787('0xc'));var jsforce=require(_0x5787('0xd'));var deskjs=require(_0x5787('0xe'));var toCsv=require(_0x5787('0x9'));var querystring=require(_0x5787('0xf'));var Papa=require('papaparse');var Redis=require(_0x5787('0x10'));var authService=require(_0x5787('0x11'));var qs=require(_0x5787('0x12'));var as=require(_0x5787('0x13'));var hardwareService=require(_0x5787('0x14'));var logger=require(_0x5787('0x15'))('api');var utils=require(_0x5787('0x16'));var config=require(_0x5787('0x17'));var db=require(_0x5787('0x18'))['db'];function respondWithStatusCode(_0x53f861,_0x56b06a){_0x56b06a=_0x56b06a||0xcc;return function(_0x38ddb3){if(_0x38ddb3){return _0x53f861[_0x5787('0x19')](_0x56b06a);}return _0x53f861['status'](_0x56b06a)['end']();};}function respondWithResult(_0x2060dc,_0x472b52){_0x472b52=_0x472b52||0xc8;return function(_0x373e9e){if(_0x373e9e){return _0x2060dc['status'](_0x472b52)[_0x5787('0x1a')](_0x373e9e);}};}function respondWithFilteredResult(_0x458cd0,_0x1e3b2a){return function(_0x3e4d3a){if(_0x3e4d3a){var _0x15df88=_0x3e4d3a[_0x5787('0x1b')],_0x17486c=_0x1e3b2a['offset'],_0x2cd1cc=_0x1e3b2a['offset']+_0x1e3b2a[_0x5787('0x1c')],_0x4d9014;if(_0x2cd1cc>=_0x15df88){_0x2cd1cc=_0x15df88;_0x4d9014=0xc8;}else{_0x4d9014=0xce;}_0x458cd0[_0x5787('0x1d')](_0x4d9014);return _0x458cd0['set'](_0x5787('0x1e'),_0x17486c+'-'+_0x2cd1cc+'/'+_0x15df88)[_0x5787('0x1a')](_0x3e4d3a);}return null;};}function patchUpdates(_0x4684cb){return function(_0x2572e0){try{jsonpatch['apply'](_0x2572e0,_0x4684cb,!![]);}catch(_0x337ab2){return BPromise[_0x5787('0x1f')](_0x337ab2);}return _0x2572e0['save']();};}function saveUpdates(_0x2a90d2,_0x36dfb4){return function(_0x4b27af){if(_0x4b27af){return _0x4b27af[_0x5787('0x20')](_0x2a90d2)['then'](function(_0x28dd72){return _0x28dd72;});}return null;};}function removeEntity(_0x32c721,_0x4cb4ab){return function(_0xfef18e){if(_0xfef18e){return _0xfef18e[_0x5787('0x21')]()[_0x5787('0x22')](function(){var _0x4658bb=_0xfef18e['get']({'plain':!![]});var _0x180708=_0x5787('0x23');return db['UserProfileResource'][_0x5787('0x21')]({'where':{'type':_0x180708,'resourceId':_0x4658bb['id']}})[_0x5787('0x22')](function(){return _0xfef18e;});})[_0x5787('0x22')](function(){_0x32c721[_0x5787('0x1d')](0xcc)[_0x5787('0x24')]();});}};}function handleEntityNotFound(_0x7d6851,_0x29dee1){return function(_0x4a8d00){if(!_0x4a8d00){_0x7d6851[_0x5787('0x19')](0x194);}return _0x4a8d00;};}function handleError(_0x1328ba,_0x489dcb){_0x489dcb=_0x489dcb||0x1f4;return function(_0x5b43ca){logger[_0x5787('0x25')](_0x5b43ca[_0x5787('0x26')]);if(_0x5b43ca[_0x5787('0x27')]){delete _0x5b43ca[_0x5787('0x27')];}_0x1328ba[_0x5787('0x1d')](_0x489dcb)[_0x5787('0x28')](_0x5b43ca);};}exports[_0x5787('0x29')]=function(_0x4548a0,_0x49ace2){var _0x4939c5={},_0x1baac5={},_0x77174a={'count':0x0,'rows':[]};var _0x174361=_['map'](db['Schedule']['rawAttributes'],function(_0x50819c){return{'name':_0x50819c[_0x5787('0x2a')],'type':_0x50819c[_0x5787('0x2b')][_0x5787('0x2c')]};});_0x1baac5['model']=_[_0x5787('0x2d')](_0x174361,_0x5787('0x27'));_0x1baac5['query']=_[_0x5787('0x2e')](_0x4548a0[_0x5787('0x2f')]);_0x1baac5[_0x5787('0x30')]=_['intersection'](_0x1baac5[_0x5787('0x31')],_0x1baac5[_0x5787('0x2f')]);_0x4939c5[_0x5787('0x32')]=_[_0x5787('0x33')](_0x1baac5[_0x5787('0x31')],qs[_0x5787('0x34')](_0x4548a0['query'][_0x5787('0x34')]));_0x4939c5[_0x5787('0x32')]=_0x4939c5[_0x5787('0x32')]['length']?_0x4939c5[_0x5787('0x32')]:_0x1baac5[_0x5787('0x31')];if(!_0x4548a0['query'][_0x5787('0x35')]('nolimit')){_0x4939c5[_0x5787('0x1c')]=qs[_0x5787('0x1c')](_0x4548a0['query'][_0x5787('0x1c')]);_0x4939c5[_0x5787('0x36')]=qs[_0x5787('0x36')](_0x4548a0[_0x5787('0x2f')][_0x5787('0x36')]);}_0x4939c5[_0x5787('0x37')]=qs[_0x5787('0x38')](_0x4548a0[_0x5787('0x2f')][_0x5787('0x38')]);_0x4939c5['where']=qs[_0x5787('0x30')](_['pick'](_0x4548a0[_0x5787('0x2f')],_0x1baac5[_0x5787('0x30')]));if(_0x4548a0[_0x5787('0x2f')][_0x5787('0x39')]){_0x4939c5[_0x5787('0x3a')]=_[_0x5787('0x3b')](_0x4939c5[_0x5787('0x3a')],{'$or':_[_0x5787('0x2d')](_0x174361,function(_0x3e658a){if(_0x3e658a[_0x5787('0x2b')]!==_0x5787('0x3c')){var _0x2872f7={};_0x2872f7[_0x3e658a[_0x5787('0x27')]]={'$like':'%'+_0x4548a0[_0x5787('0x2f')][_0x5787('0x39')]+'%'};return _0x2872f7;}})});}_0x4939c5=_[_0x5787('0x3b')]({},_0x4939c5,_0x4548a0[_0x5787('0x3d')]);var _0x3d8525={'where':_0x4939c5[_0x5787('0x3a')]};return db[_0x5787('0x3e')][_0x5787('0x1b')](_0x3d8525)[_0x5787('0x22')](function(_0x14bf90){_0x77174a[_0x5787('0x1b')]=_0x14bf90;if(_0x4548a0[_0x5787('0x2f')]['includeAll']){_0x4939c5['include']=[{'all':!![]}];}return db['Schedule'][_0x5787('0x3f')](_0x4939c5);})[_0x5787('0x22')](function(_0x30f8cd){_0x77174a[_0x5787('0x40')]=_0x30f8cd;return _0x77174a;})['then'](respondWithFilteredResult(_0x49ace2,_0x4939c5))[_0x5787('0x41')](handleError(_0x49ace2,null));};exports[_0x5787('0x42')]=function(_0x3810a0,_0x74a9fc){var _0x11cb18={'raw':![],'where':{'id':_0x3810a0[_0x5787('0x43')]['id']}},_0x5d7e5f={};_0x5d7e5f[_0x5787('0x31')]=_['keys'](db['Schedule'][_0x5787('0x44')]);_0x5d7e5f[_0x5787('0x2f')]=_[_0x5787('0x2e')](_0x3810a0['query']);_0x5d7e5f[_0x5787('0x30')]=_[_0x5787('0x33')](_0x5d7e5f[_0x5787('0x31')],_0x5d7e5f[_0x5787('0x2f')]);_0x11cb18['attributes']=_[_0x5787('0x33')](_0x5d7e5f[_0x5787('0x31')],qs[_0x5787('0x34')](_0x3810a0[_0x5787('0x2f')][_0x5787('0x34')]));_0x11cb18[_0x5787('0x32')]=_0x11cb18[_0x5787('0x32')][_0x5787('0x45')]?_0x11cb18[_0x5787('0x32')]:_0x5d7e5f[_0x5787('0x31')];if(_0x3810a0[_0x5787('0x2f')][_0x5787('0x46')]){_0x11cb18['include']=[{'all':!![]}];}_0x11cb18=_[_0x5787('0x3b')]({},_0x11cb18,_0x3810a0[_0x5787('0x3d')]);return db['Schedule'][_0x5787('0x47')](_0x11cb18)[_0x5787('0x22')](handleEntityNotFound(_0x74a9fc,null))[_0x5787('0x22')](respondWithResult(_0x74a9fc,null))[_0x5787('0x41')](handleError(_0x74a9fc,null));};exports[_0x5787('0x48')]=function(_0x44b16e,_0x289bfb){return db['Schedule'][_0x5787('0x48')](_0x44b16e[_0x5787('0x49')],{})['then'](function(_0x5d9781){var _0x2dfa27=_0x44b16e[_0x5787('0x4a')]['get']({'plain':!![]});if(!_0x2dfa27)throw new Error(_0x5787('0x4b'));if(_0x2dfa27[_0x5787('0x4c')]==='user'){var _0x37c8c9=_0x5d9781[_0x5787('0x4d')]({'plain':!![]});var _0x4cfdb=_0x5787('0x23');return db[_0x5787('0x4e')]['find']({'where':{'name':_0x4cfdb,'userProfileId':_0x2dfa27[_0x5787('0x4f')]},'raw':!![]})[_0x5787('0x22')](function(_0x4a43df){if(_0x4a43df&&_0x4a43df[_0x5787('0x50')]===0x0){return db[_0x5787('0x51')][_0x5787('0x48')]({'name':_0x37c8c9[_0x5787('0x27')],'resourceId':_0x37c8c9['id'],'type':_0x4a43df['name'],'sectionId':_0x4a43df['id']},{})[_0x5787('0x22')](function(){return _0x5d9781;});}else{return _0x5d9781;}})[_0x5787('0x41')](function(_0x210a3b){logger[_0x5787('0x25')](_0x5787('0x52'),_0x210a3b);throw _0x210a3b;});}return _0x5d9781;})[_0x5787('0x22')](respondWithResult(_0x289bfb,0xc9))[_0x5787('0x41')](handleError(_0x289bfb,null));};exports[_0x5787('0x20')]=function(_0x1377e2,_0x3fa4fc){if(_0x1377e2['body']['id']){delete _0x1377e2[_0x5787('0x49')]['id'];}return db[_0x5787('0x3e')][_0x5787('0x47')]({'where':{'id':_0x1377e2['params']['id']}})[_0x5787('0x22')](handleEntityNotFound(_0x3fa4fc,null))[_0x5787('0x22')](saveUpdates(_0x1377e2[_0x5787('0x49')],null))[_0x5787('0x22')](respondWithResult(_0x3fa4fc,null))['catch'](handleError(_0x3fa4fc,null));};exports[_0x5787('0x21')]=function(_0x42ffe9,_0x2d169a){return db[_0x5787('0x3e')][_0x5787('0x47')]({'where':{'id':_0x42ffe9[_0x5787('0x43')]['id']}})[_0x5787('0x22')](handleEntityNotFound(_0x2d169a,null))['then'](removeEntity(_0x2d169a,null))[_0x5787('0x41')](handleError(_0x2d169a,null));};exports[_0x5787('0x53')]=function(_0x176f07,_0x324e70,_0x3a08d2){var _0x4ccdd3=require('../../config/schedule');return db['Schedule'][_0x5787('0x47')]({'where':{'id':_0x176f07[_0x5787('0x43')]['id']},'raw':!![]})[_0x5787('0x22')](handleEntityNotFound(_0x324e70,null))[_0x5787('0x22')](function(){_0x4ccdd3[_0x5787('0x53')](_0x176f07[_0x5787('0x43')]['id']);})['then'](respondWithStatusCode(_0x324e70,null))[_0x5787('0x41')](handleError(_0x324e70,null));}; \ No newline at end of file +var _0xc21b=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','VIRTUAL','filter','options','count','include','findAll','catch','show','keys','includeAll','merge','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','length'];(function(_0x4fbbda,_0x1d0220){var _0x2840c8=function(_0x4f64a7){while(--_0x4f64a7){_0x4fbbda['push'](_0x4fbbda['shift']());}};_0x2840c8(++_0x1d0220);}(_0xc21b,0x1cb));var _0xbc21=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0xc21b[_0x3b1b23];return _0x1efc85;};'use strict';var pdf=require(_0xbc21('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbc21('0x1'));var zipdir=require(_0xbc21('0x2'));var jsonpatch=require(_0xbc21('0x3'));var rp=require(_0xbc21('0x4'));var moment=require(_0xbc21('0x5'));var BPromise=require(_0xbc21('0x6'));var Mustache=require('mustache');var util=require(_0xbc21('0x7'));var path=require(_0xbc21('0x8'));var sox=require(_0xbc21('0x9'));var csv=require(_0xbc21('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbc21('0xb'));var squel=require(_0xbc21('0xc'));var crypto=require(_0xbc21('0xd'));var jsforce=require(_0xbc21('0xe'));var deskjs=require(_0xbc21('0xf'));var toCsv=require(_0xbc21('0xa'));var querystring=require(_0xbc21('0x10'));var Papa=require(_0xbc21('0x11'));var Redis=require(_0xbc21('0x12'));var authService=require(_0xbc21('0x13'));var qs=require(_0xbc21('0x14'));var as=require(_0xbc21('0x15'));var hardwareService=require(_0xbc21('0x16'));var logger=require(_0xbc21('0x17'))(_0xbc21('0x18'));var utils=require(_0xbc21('0x19'));var config=require('../../config/environment');var db=require(_0xbc21('0x1a'))['db'];function respondWithStatusCode(_0x388278,_0x550368){_0x550368=_0x550368||0xcc;return function(_0x3abee8){if(_0x3abee8){return _0x388278['sendStatus'](_0x550368);}return _0x388278[_0xbc21('0x1b')](_0x550368)[_0xbc21('0x1c')]();};}function respondWithResult(_0x5153d9,_0x4abbf0){_0x4abbf0=_0x4abbf0||0xc8;return function(_0xbf0212){if(_0xbf0212){return _0x5153d9['status'](_0x4abbf0)[_0xbc21('0x1d')](_0xbf0212);}};}function respondWithFilteredResult(_0x337133,_0x1049f4){return function(_0x112178){if(_0x112178){var _0xad38db=_0x112178['count'],_0x5e799f=_0x1049f4[_0xbc21('0x1e')],_0x158d6c=_0x1049f4[_0xbc21('0x1e')]+_0x1049f4['limit'],_0x366570;if(_0x158d6c>=_0xad38db){_0x158d6c=_0xad38db;_0x366570=0xc8;}else{_0x366570=0xce;}_0x337133[_0xbc21('0x1b')](_0x366570);return _0x337133[_0xbc21('0x1f')](_0xbc21('0x20'),_0x5e799f+'-'+_0x158d6c+'/'+_0xad38db)['json'](_0x112178);}return null;};}function patchUpdates(_0x5abe99){return function(_0x1c137d){try{jsonpatch[_0xbc21('0x21')](_0x1c137d,_0x5abe99,!![]);}catch(_0x3765ed){return BPromise['reject'](_0x3765ed);}return _0x1c137d[_0xbc21('0x22')]();};}function saveUpdates(_0x375e05,_0x3e7a83){return function(_0x8f6c9a){if(_0x8f6c9a){return _0x8f6c9a[_0xbc21('0x23')](_0x375e05)['then'](function(_0x57bd75){return _0x57bd75;});}return null;};}function removeEntity(_0x234c97,_0x558a13){return function(_0xbf2af){if(_0xbf2af){return _0xbf2af['destroy']()[_0xbc21('0x24')](function(){var _0x851dd0=_0xbf2af[_0xbc21('0x25')]({'plain':!![]});var _0x174efa='Scheduler';return db[_0xbc21('0x26')][_0xbc21('0x27')]({'where':{'type':_0x174efa,'resourceId':_0x851dd0['id']}})['then'](function(){return _0xbf2af;});})[_0xbc21('0x24')](function(){_0x234c97[_0xbc21('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ee9c8,_0x109569){return function(_0x5688ae){if(!_0x5688ae){_0x3ee9c8[_0xbc21('0x28')](0x194);}return _0x5688ae;};}function handleError(_0x2c8ff9,_0x4ff4b2){_0x4ff4b2=_0x4ff4b2||0x1f4;return function(_0x46ff3c){logger[_0xbc21('0x29')](_0x46ff3c[_0xbc21('0x2a')]);if(_0x46ff3c[_0xbc21('0x2b')]){delete _0x46ff3c[_0xbc21('0x2b')];}_0x2c8ff9[_0xbc21('0x1b')](_0x4ff4b2)[_0xbc21('0x2c')](_0x46ff3c);};}exports[_0xbc21('0x2d')]=function(_0x1fa643,_0xe64ae8){var _0x13b951={},_0x2cd11f={},_0x149577={'count':0x0,'rows':[]};var _0xc669e8=_[_0xbc21('0x2e')](db[_0xbc21('0x2f')][_0xbc21('0x30')],function(_0x56f252){return{'name':_0x56f252[_0xbc21('0x31')],'type':_0x56f252[_0xbc21('0x32')]['key']};});_0x2cd11f['model']=_[_0xbc21('0x2e')](_0xc669e8,'name');_0x2cd11f['query']=_['keys'](_0x1fa643[_0xbc21('0x33')]);_0x2cd11f['filters']=_[_0xbc21('0x34')](_0x2cd11f[_0xbc21('0x35')],_0x2cd11f[_0xbc21('0x33')]);_0x13b951['attributes']=_[_0xbc21('0x34')](_0x2cd11f[_0xbc21('0x35')],qs['fields'](_0x1fa643['query'][_0xbc21('0x36')]));_0x13b951[_0xbc21('0x37')]=_0x13b951['attributes'][_0xbc21('0x38')]?_0x13b951[_0xbc21('0x37')]:_0x2cd11f['model'];if(!_0x1fa643[_0xbc21('0x33')][_0xbc21('0x39')](_0xbc21('0x3a'))){_0x13b951[_0xbc21('0x3b')]=qs[_0xbc21('0x3b')](_0x1fa643[_0xbc21('0x33')][_0xbc21('0x3b')]);_0x13b951[_0xbc21('0x1e')]=qs[_0xbc21('0x1e')](_0x1fa643[_0xbc21('0x33')][_0xbc21('0x1e')]);}_0x13b951[_0xbc21('0x3c')]=qs[_0xbc21('0x3d')](_0x1fa643[_0xbc21('0x33')][_0xbc21('0x3d')]);_0x13b951[_0xbc21('0x3e')]=qs['filters'](_[_0xbc21('0x3f')](_0x1fa643['query'],_0x2cd11f[_0xbc21('0x40')]));if(_0x1fa643[_0xbc21('0x33')]['filter']){_0x13b951[_0xbc21('0x3e')]=_['merge'](_0x13b951[_0xbc21('0x3e')],{'$or':_[_0xbc21('0x2e')](_0xc669e8,function(_0x4a02a4){if(_0x4a02a4[_0xbc21('0x32')]!==_0xbc21('0x41')){var _0x35f029={};_0x35f029[_0x4a02a4['name']]={'$like':'%'+_0x1fa643[_0xbc21('0x33')][_0xbc21('0x42')]+'%'};return _0x35f029;}})});}_0x13b951=_['merge']({},_0x13b951,_0x1fa643[_0xbc21('0x43')]);var _0x275fe2={'where':_0x13b951[_0xbc21('0x3e')]};return db[_0xbc21('0x2f')]['count'](_0x275fe2)[_0xbc21('0x24')](function(_0x42ae4e){_0x149577[_0xbc21('0x44')]=_0x42ae4e;if(_0x1fa643[_0xbc21('0x33')]['includeAll']){_0x13b951[_0xbc21('0x45')]=[{'all':!![]}];}return db[_0xbc21('0x2f')][_0xbc21('0x46')](_0x13b951);})[_0xbc21('0x24')](function(_0xe699b3){_0x149577['rows']=_0xe699b3;return _0x149577;})[_0xbc21('0x24')](respondWithFilteredResult(_0xe64ae8,_0x13b951))[_0xbc21('0x47')](handleError(_0xe64ae8,null));};exports[_0xbc21('0x48')]=function(_0x24978e,_0x252224){var _0x2f9f1c={'raw':![],'where':{'id':_0x24978e['params']['id']}},_0x22060c={};_0x22060c[_0xbc21('0x35')]=_['keys'](db[_0xbc21('0x2f')][_0xbc21('0x30')]);_0x22060c[_0xbc21('0x33')]=_[_0xbc21('0x49')](_0x24978e[_0xbc21('0x33')]);_0x22060c['filters']=_['intersection'](_0x22060c[_0xbc21('0x35')],_0x22060c[_0xbc21('0x33')]);_0x2f9f1c[_0xbc21('0x37')]=_[_0xbc21('0x34')](_0x22060c[_0xbc21('0x35')],qs[_0xbc21('0x36')](_0x24978e['query'][_0xbc21('0x36')]));_0x2f9f1c[_0xbc21('0x37')]=_0x2f9f1c[_0xbc21('0x37')][_0xbc21('0x38')]?_0x2f9f1c[_0xbc21('0x37')]:_0x22060c['model'];if(_0x24978e[_0xbc21('0x33')][_0xbc21('0x4a')]){_0x2f9f1c['include']=[{'all':!![]}];}_0x2f9f1c=_[_0xbc21('0x4b')]({},_0x2f9f1c,_0x24978e[_0xbc21('0x43')]);return db[_0xbc21('0x2f')]['find'](_0x2f9f1c)[_0xbc21('0x24')](handleEntityNotFound(_0x252224,null))[_0xbc21('0x24')](respondWithResult(_0x252224,null))[_0xbc21('0x47')](handleError(_0x252224,null));};exports[_0xbc21('0x4c')]=function(_0x16fe49,_0x487ba2){return db[_0xbc21('0x2f')][_0xbc21('0x4c')](_0x16fe49[_0xbc21('0x4d')],{})[_0xbc21('0x24')](function(_0x164412){var _0x4a0f81=_0x16fe49[_0xbc21('0x4e')][_0xbc21('0x25')]({'plain':!![]});if(!_0x4a0f81)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a0f81['role']===_0xbc21('0x4e')){var _0x28f12b=_0x164412['get']({'plain':!![]});var _0x18a61a='Scheduler';return db[_0xbc21('0x4f')][_0xbc21('0x50')]({'where':{'name':_0x18a61a,'userProfileId':_0x4a0f81[_0xbc21('0x51')]},'raw':!![]})[_0xbc21('0x24')](function(_0x3b0983){if(_0x3b0983&&_0x3b0983[_0xbc21('0x52')]===0x0){return db['UserProfileResource'][_0xbc21('0x4c')]({'name':_0x28f12b[_0xbc21('0x2b')],'resourceId':_0x28f12b['id'],'type':_0x3b0983[_0xbc21('0x2b')],'sectionId':_0x3b0983['id']},{})[_0xbc21('0x24')](function(){return _0x164412;});}else{return _0x164412;}})['catch'](function(_0x56d79d){logger[_0xbc21('0x29')](_0xbc21('0x53'),_0x56d79d);throw _0x56d79d;});}return _0x164412;})[_0xbc21('0x24')](respondWithResult(_0x487ba2,0xc9))['catch'](handleError(_0x487ba2,null));};exports[_0xbc21('0x23')]=function(_0x19dc23,_0x54f65c){if(_0x19dc23['body']['id']){delete _0x19dc23[_0xbc21('0x4d')]['id'];}return db['Schedule'][_0xbc21('0x50')]({'where':{'id':_0x19dc23[_0xbc21('0x54')]['id']}})[_0xbc21('0x24')](handleEntityNotFound(_0x54f65c,null))[_0xbc21('0x24')](saveUpdates(_0x19dc23['body'],null))[_0xbc21('0x24')](respondWithResult(_0x54f65c,null))[_0xbc21('0x47')](handleError(_0x54f65c,null));};exports[_0xbc21('0x27')]=function(_0x5a22df,_0x13741e){return db[_0xbc21('0x2f')][_0xbc21('0x50')]({'where':{'id':_0x5a22df['params']['id']}})[_0xbc21('0x24')](handleEntityNotFound(_0x13741e,null))[_0xbc21('0x24')](removeEntity(_0x13741e,null))[_0xbc21('0x47')](handleError(_0x13741e,null));};exports[_0xbc21('0x55')]=function(_0x4ad77b,_0x5b4906,_0x215b31){var _0x207f4b=require('../../config/schedule');return db[_0xbc21('0x2f')]['find']({'where':{'id':_0x4ad77b[_0xbc21('0x54')]['id']},'raw':!![]})[_0xbc21('0x24')](handleEntityNotFound(_0x5b4906,null))[_0xbc21('0x24')](function(){_0x207f4b[_0xbc21('0x55')](_0x4ad77b['params']['id']);})[_0xbc21('0x24')](respondWithStatusCode(_0x5b4906,null))[_0xbc21('0x47')](handleError(_0x5b4906,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 56396e0..5360e04 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 _0x3bab=['../../config/logger','api','moment','bluebird','./schedule.attributes','exports','define','tools_schedules','lodash','util'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x3bab,0x13e));var _0xb3ba=function(_0x2389f5,_0x5205bc){_0x2389f5=_0x2389f5-0x0;var _0x4653af=_0x3bab[_0x2389f5];return _0x4653af;};'use strict';var _=require(_0xb3ba('0x0'));var util=require(_0xb3ba('0x1'));var logger=require(_0xb3ba('0x2'))(_0xb3ba('0x3'));var moment=require(_0xb3ba('0x4'));var BPromise=require(_0xb3ba('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(_0xb3ba('0x6'));module[_0xb3ba('0x7')]=function(_0x3e185a,_0x4c663c){return _0x3e185a[_0xb3ba('0x8')]('Schedule',attributes,{'tableName':_0xb3ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc031=['path','../../config/environment','./schedule.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0xc031,0xf5));var _0x1c03=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0xc031[_0x1221e8];return _0x3f3041;};'use strict';var _=require(_0x1c03('0x0'));var util=require(_0x1c03('0x1'));var logger=require(_0x1c03('0x2'))(_0x1c03('0x3'));var moment=require(_0x1c03('0x4'));var BPromise=require(_0x1c03('0x5'));var rp=require(_0x1c03('0x6'));var fs=require('fs');var path=require(_0x1c03('0x7'));var rimraf=require('rimraf');var config=require(_0x1c03('0x8'));var attributes=require(_0x1c03('0x9'));module[_0x1c03('0xa')]=function(_0x49e89e,_0x429beb){return _0x49e89e[_0x1c03('0xb')]('Schedule',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 562bf6f..140eef1 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 _0x9091=['../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x552cf8,_0x493a58){var _0x5b0eca=function(_0xbc6b6d){while(--_0xbc6b6d){_0x552cf8['push'](_0x552cf8['shift']());}};_0x5b0eca(++_0x493a58);}(_0x9091,0x1f3));var _0x1909=function(_0x5c2cd3,_0x1e23fb){_0x5c2cd3=_0x5c2cd3-0x0;var _0x26b691=_0x9091[_0x5c2cd3];return _0x26b691;};'use strict';var _=require(_0x1909('0x0'));var util=require(_0x1909('0x1'));var moment=require(_0x1909('0x2'));var BPromise=require(_0x1909('0x3'));var rs=require(_0x1909('0x4'));var fs=require('fs');var Redis=require(_0x1909('0x5'));var db=require(_0x1909('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1909('0x7'))(_0x1909('0x8'));var config=require(_0x1909('0x9'));var jayson=require(_0x1909('0xa'));var client=jayson[_0x1909('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x147f4a,_0x2da183,_0x1a6db6){return new BPromise(function(_0x49fd3e,_0x5abd6f){return client['request'](_0x147f4a,_0x1a6db6)['then'](function(_0x40419b){logger[_0x1909('0xc')](_0x1909('0xd'),_0x2da183,_0x1909('0xe'));logger[_0x1909('0xf')](_0x1909('0x10'),_0x2da183,_0x1909('0xe'),JSON[_0x1909('0x11')](_0x40419b));if(_0x40419b[_0x1909('0x12')]){if(_0x40419b[_0x1909('0x12')][_0x1909('0x13')]===0x1f4){logger[_0x1909('0x12')]('Schedule,\x20%s,\x20%s',_0x2da183,_0x40419b['error'][_0x1909('0x14')]);return _0x5abd6f(_0x40419b[_0x1909('0x12')][_0x1909('0x14')]);}logger[_0x1909('0x12')](_0x1909('0xd'),_0x2da183,_0x40419b[_0x1909('0x12')][_0x1909('0x14')]);return _0x49fd3e(_0x40419b[_0x1909('0x12')]['message']);}else{logger[_0x1909('0xc')](_0x1909('0xd'),_0x2da183,_0x1909('0xe'));_0x49fd3e(_0x40419b['result'][_0x1909('0x14')]);}})[_0x1909('0x15')](function(_0xb3e72d){logger['error'](_0x1909('0xd'),_0x2da183,_0xb3e72d);_0x5abd6f(_0xb3e72d);});});} \ No newline at end of file +var _0x5a68=['Schedule,\x20%s,\x20%s,\x20%s','stringify','code','error','message','Schedule,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','jayson/promise','http','request','then','request\x20sent','debug'];(function(_0x5472cd,_0x3ba345){var _0x32ba56=function(_0x3b1293){while(--_0x3b1293){_0x5472cd['push'](_0x5472cd['shift']());}};_0x32ba56(++_0x3ba345);}(_0x5a68,0x87));var _0x85a6=function(_0x37867d,_0x4617b9){_0x37867d=_0x37867d-0x0;var _0x56ca65=_0x5a68[_0x37867d];return _0x56ca65;};'use strict';var _=require('lodash');var util=require(_0x85a6('0x0'));var moment=require(_0x85a6('0x1'));var BPromise=require(_0x85a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x85a6('0x3'));var client=jayson['client'][_0x85a6('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x478249,_0x464965,_0x590bc7){return new BPromise(function(_0x12b4b0,_0x42e9dc){return client[_0x85a6('0x5')](_0x478249,_0x590bc7)[_0x85a6('0x6')](function(_0x186b67){logger['info']('Schedule,\x20%s,\x20%s',_0x464965,_0x85a6('0x7'));logger[_0x85a6('0x8')](_0x85a6('0x9'),_0x464965,_0x85a6('0x7'),JSON[_0x85a6('0xa')](_0x186b67));if(_0x186b67['error']){if(_0x186b67['error'][_0x85a6('0xb')]===0x1f4){logger[_0x85a6('0xc')]('Schedule,\x20%s,\x20%s',_0x464965,_0x186b67['error'][_0x85a6('0xd')]);return _0x42e9dc(_0x186b67['error']['message']);}logger[_0x85a6('0xc')](_0x85a6('0xe'),_0x464965,_0x186b67[_0x85a6('0xc')][_0x85a6('0xd')]);return _0x12b4b0(_0x186b67['error'][_0x85a6('0xd')]);}else{logger[_0x85a6('0xf')](_0x85a6('0xe'),_0x464965,_0x85a6('0x7'));_0x12b4b0(_0x186b67[_0x85a6('0x10')][_0x85a6('0xd')]);}})[_0x85a6('0x11')](function(_0x309ace){logger[_0x85a6('0xc')]('Schedule,\x20%s,\x20%s',_0x464965,_0x309ace);_0x42e9dc(_0x309ace);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ea6365d..0a06b31 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 _0xb940=['show','post','put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','describe'];(function(_0x396b3e,_0x4b1c28){var _0x44d6f9=function(_0x20239e){while(--_0x20239e){_0x396b3e['push'](_0x396b3e['shift']());}};_0x44d6f9(++_0x4b1c28);}(_0xb940,0x1a0));var _0x0b94=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0xb940[_0x329664];return _0x4e346e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0b94('0x0'));var express=require(_0x0b94('0x1'));var router=express[_0x0b94('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x0b94('0x3'));var config=require(_0x0b94('0x4'));var controller=require(_0x0b94('0x5'));router[_0x0b94('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0b94('0x6')]('/describe',auth[_0x0b94('0x7')](),controller[_0x0b94('0x8')]);router[_0x0b94('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x0b94('0x9')]);router['get']('/:id/download',auth[_0x0b94('0x7')](),controller['download']);router[_0x0b94('0xa')]('/',auth[_0x0b94('0x7')](),controller['create']);router[_0x0b94('0xb')](_0x0b94('0xc'),auth['isAuthenticated'](),controller[_0x0b94('0xd')]);router[_0x0b94('0xe')](_0x0b94('0xc'),auth['isAuthenticated'](),controller[_0x0b94('0xf')]);module[_0x0b94('0x10')]=router; \ No newline at end of file +var _0xafbd=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe','describe','show','/:id/download','/:id','update','delete','destroy','exports','multer'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0xafbd,0x13f));var _0xdafb=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xafbd[_0x4ed520];return _0x4415a6;};'use strict';var multer=require(_0xdafb('0x0'));var util=require(_0xdafb('0x1'));var path=require(_0xdafb('0x2'));var timeout=require(_0xdafb('0x3'));var express=require('express');var router=express[_0xdafb('0x4')]();var auth=require(_0xdafb('0x5'));var interaction=require(_0xdafb('0x6'));var config=require(_0xdafb('0x7'));var controller=require(_0xdafb('0x8'));router[_0xdafb('0x9')]('/',auth[_0xdafb('0xa')](),controller['index']);router[_0xdafb('0x9')](_0xdafb('0xb'),auth['isAuthenticated'](),controller[_0xdafb('0xc')]);router['get']('/:id',auth[_0xdafb('0xa')](),controller[_0xdafb('0xd')]);router[_0xdafb('0x9')](_0xdafb('0xe'),auth[_0xdafb('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xdafb('0xf'),auth['isAuthenticated'](),controller[_0xdafb('0x10')]);router[_0xdafb('0x11')](_0xdafb('0xf'),auth[_0xdafb('0xa')](),controller[_0xdafb('0x12')]);module[_0xdafb('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 670fa09..df5c432 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 _0xa41a=['toString','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','MM-DD-YYYY\x20HH:mm','format','createdAt'];(function(_0x5f383b,_0x6f8f8){var _0x230ec5=function(_0x3fd7b1){while(--_0x3fd7b1){_0x5f383b['push'](_0x5f383b['shift']());}};_0x230ec5(++_0x6f8f8);}(_0xa41a,0x6b));var _0xaa41=function(_0x3f4d08,_0x5d5870){_0x3f4d08=_0x3f4d08-0x0;var _0x530d61=_0xa41a[_0x3f4d08];return _0x530d61;};'use strict';var Sequelize=require(_0xaa41('0x0'));var moment=require(_0xaa41('0x1'));var path=require('path');var config=require(_0xaa41('0x2'));module[_0xaa41('0x3')]={'format':{'type':Sequelize[_0xaa41('0x4')],'get':function(){return this[_0xaa41('0x5')](_0xaa41('0x6'))?path[_0xaa41('0x7')](this[_0xaa41('0x5')](_0xaa41('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x8')]},'value':{'type':Sequelize[_0xaa41('0x8')],'set':function(_0x54bc5a){var _0x5b1fff=_0x54bc5a[_0xaa41('0x9')](/\\/g,'/');this[_0xaa41('0xa')]('value',_0x5b1fff);}},'rating':{'type':Sequelize[_0xaa41('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xaa41('0xb')],'set':function(_0x409dab){this[_0xaa41('0xa')](_0xaa41('0xc'),moment()[_0xaa41('0xd')](_0x409dab,'ms'));this[_0xaa41('0xa')](_0xaa41('0xe'),moment());this[_0xaa41('0xa')]('duration',_0x409dab);}},'startedAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this[_0xaa41('0x5')]('startedAt'))['format'](_0xaa41('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this[_0xaa41('0x5')](_0xaa41('0xe')))[_0xaa41('0x11')](_0xaa41('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this[_0xaa41('0x5')](_0xaa41('0x12')))[_0xaa41('0x11')](_0xaa41('0x10'))[_0xaa41('0x13')]();}},'updatedAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this['getDataValue'](_0xaa41('0x14')))[_0xaa41('0x11')](_0xaa41('0x10'))[_0xaa41('0x13')]();}}}; \ No newline at end of file +var _0x6f47=['updatedAt','moment','path','exports','getDataValue','extname','value','STRING','setDataValue','INTEGER','subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt'];(function(_0x3712e2,_0x32d752){var _0x1faff4=function(_0x550dc0){while(--_0x550dc0){_0x3712e2['push'](_0x3712e2['shift']());}};_0x1faff4(++_0x32d752);}(_0x6f47,0xc7));var _0x76f4=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x6f47[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var config=require('../../config/environment');module[_0x76f4('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x76f4('0x3')]('value')?path[_0x76f4('0x4')](this[_0x76f4('0x3')](_0x76f4('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x76f4('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x76f4('0x6')],'set':function(_0xfc2405){var _0x2176a7=_0xfc2405['replace'](/\\/g,'/');this[_0x76f4('0x7')](_0x76f4('0x5'),_0x2176a7);}},'rating':{'type':Sequelize[_0x76f4('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x76f4('0x8')],'set':function(_0x101f55){this['setDataValue']('startedAt',moment()[_0x76f4('0x9')](_0x101f55,'ms'));this[_0x76f4('0x7')]('closedAt',moment());this['setDataValue'](_0x76f4('0xa'),_0x101f55);}},'startedAt':{'type':Sequelize[_0x76f4('0xb')],'get':function(){return moment(this[_0x76f4('0x3')](_0x76f4('0xc')))[_0x76f4('0xd')](_0x76f4('0xe'))[_0x76f4('0xf')]();}},'closedAt':{'type':Sequelize[_0x76f4('0xb')],'get':function(){return moment(this[_0x76f4('0x3')]('closedAt'))[_0x76f4('0xd')](_0x76f4('0xe'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x76f4('0x10')))[_0x76f4('0xd')](_0x76f4('0xe'))[_0x76f4('0xf')]();}},'updatedAt':{'type':Sequelize[_0x76f4('0xb')],'get':function(){return moment(this[_0x76f4('0x3')](_0x76f4('0x11')))[_0x76f4('0xd')](_0x76f4('0xe'))[_0x76f4('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b78c7fc..d00f43a 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 _0xb09b=['includeAll','include','findAll','catch','show','params','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','join','filename','extname','message','Entity\x20not\x20found','root','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ScreenRecording','rawAttributes','fieldName','type','model','differenceBy','format','keys','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','filter','merge','map','VIRTUAL','options'];(function(_0x2a737d,_0x10f74a){var _0x404185=function(_0x434081){while(--_0x434081){_0x2a737d['push'](_0x2a737d['shift']());}};_0x404185(++_0x10f74a);}(_0xb09b,0x1af));var _0xbb09=function(_0x52a45c,_0x331b52){_0x52a45c=_0x52a45c-0x0;var _0x4ac4be=_0xb09b[_0x52a45c];return _0x4ac4be;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbb09('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb09('0x1'));var jsonpatch=require(_0xbb09('0x2'));var rp=require(_0xbb09('0x3'));var moment=require('moment');var BPromise=require(_0xbb09('0x4'));var Mustache=require('mustache');var util=require(_0xbb09('0x5'));var path=require('path');var sox=require(_0xbb09('0x6'));var csv=require(_0xbb09('0x7'));var ejs=require(_0xbb09('0x8'));var fs=require('fs');var _=require(_0xbb09('0x9'));var squel=require(_0xbb09('0xa'));var crypto=require(_0xbb09('0xb'));var jsforce=require(_0xbb09('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbb09('0x7'));var querystring=require(_0xbb09('0xd'));var Papa=require(_0xbb09('0xe'));var Redis=require(_0xbb09('0xf'));var authService=require(_0xbb09('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbb09('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb09('0x12'))('api');var utils=require(_0xbb09('0x13'));var config=require('../../config/environment');var db=require(_0xbb09('0x14'))['db'];function respondWithStatusCode(_0x52e6bf,_0x18b574){_0x18b574=_0x18b574||0xcc;return function(_0x243e44){if(_0x243e44){return _0x52e6bf[_0xbb09('0x15')](_0x18b574);}return _0x52e6bf['status'](_0x18b574)[_0xbb09('0x16')]();};}function respondWithResult(_0x2f68c0,_0x5bb331){_0x5bb331=_0x5bb331||0xc8;return function(_0x32646b){if(_0x32646b){return _0x2f68c0[_0xbb09('0x17')](_0x5bb331)[_0xbb09('0x18')](_0x32646b);}};}function respondWithFilteredResult(_0x225a1a,_0x3160ff){return function(_0x23cf98){if(_0x23cf98){var _0x5c7858=_0x23cf98[_0xbb09('0x19')],_0x2189ed=_0x3160ff['offset'],_0x3d29c4=_0x3160ff[_0xbb09('0x1a')]+_0x3160ff['limit'],_0x134440;if(_0x3d29c4>=_0x5c7858){_0x3d29c4=_0x5c7858;_0x134440=0xc8;}else{_0x134440=0xce;}_0x225a1a['status'](_0x134440);return _0x225a1a[_0xbb09('0x1b')](_0xbb09('0x1c'),_0x2189ed+'-'+_0x3d29c4+'/'+_0x5c7858)[_0xbb09('0x18')](_0x23cf98);}return null;};}function patchUpdates(_0x1b8d38){return function(_0x1aabec){try{jsonpatch[_0xbb09('0x1d')](_0x1aabec,_0x1b8d38,!![]);}catch(_0xd70cd0){return BPromise[_0xbb09('0x1e')](_0xd70cd0);}return _0x1aabec[_0xbb09('0x1f')]();};}function saveUpdates(_0x2adfd3,_0x20409d){return function(_0x523d18){if(_0x523d18){return _0x523d18[_0xbb09('0x20')](_0x2adfd3)[_0xbb09('0x21')](function(_0x36c1bf){return _0x36c1bf;});}return null;};}function removeEntity(_0x3ef7ec,_0x40f69f){return function(_0x39eb0d){if(_0x39eb0d){return _0x39eb0d[_0xbb09('0x22')]()[_0xbb09('0x21')](function(){_0x3ef7ec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44892f,_0x2f1150){return function(_0x542948){if(!_0x542948){_0x44892f[_0xbb09('0x15')](0x194);}return _0x542948;};}function handleError(_0x2bee88,_0x39e6be){_0x39e6be=_0x39e6be||0x1f4;return function(_0x1bf54d){logger[_0xbb09('0x23')](_0x1bf54d[_0xbb09('0x24')]);if(_0x1bf54d[_0xbb09('0x25')]){delete _0x1bf54d['name'];}_0x2bee88[_0xbb09('0x17')](_0x39e6be)[_0xbb09('0x26')](_0x1bf54d);};}exports[_0xbb09('0x27')]=function(_0x2709e6,_0x26bc78){var _0x571d5a={},_0x5ad62d={},_0x4842a1={'count':0x0,'rows':[]};var _0x4e238b=_['map'](db[_0xbb09('0x28')][_0xbb09('0x29')],function(_0x43d2d0){return{'name':_0x43d2d0[_0xbb09('0x2a')],'type':_0x43d2d0[_0xbb09('0x2b')]['key']};});_0x5ad62d[_0xbb09('0x2c')]=_[_0xbb09('0x2d')](_['map'](_0x4e238b,'name'),[_0xbb09('0x2e')]);_0x5ad62d['query']=_[_0xbb09('0x2f')](_0x2709e6[_0xbb09('0x30')]);_0x5ad62d['filters']=_[_0xbb09('0x31')](_0x5ad62d[_0xbb09('0x2c')],_0x5ad62d[_0xbb09('0x30')]);_0x571d5a[_0xbb09('0x32')]=_[_0xbb09('0x31')](_0x5ad62d[_0xbb09('0x2c')],qs[_0xbb09('0x33')](_0x2709e6['query'][_0xbb09('0x33')]));_0x571d5a[_0xbb09('0x32')]=_0x571d5a[_0xbb09('0x32')][_0xbb09('0x34')]?_0x571d5a[_0xbb09('0x32')]:_0x5ad62d[_0xbb09('0x2c')];if(!_0x2709e6[_0xbb09('0x30')]['hasOwnProperty'](_0xbb09('0x35'))){_0x571d5a[_0xbb09('0x36')]=qs[_0xbb09('0x36')](_0x2709e6[_0xbb09('0x30')][_0xbb09('0x36')]);_0x571d5a['offset']=qs[_0xbb09('0x1a')](_0x2709e6[_0xbb09('0x30')][_0xbb09('0x1a')]);}_0x571d5a[_0xbb09('0x37')]=qs[_0xbb09('0x38')](_0x2709e6['query']['sort']);_0x571d5a[_0xbb09('0x39')]=qs[_0xbb09('0x3a')](_['pick'](_0x2709e6[_0xbb09('0x30')],_0x5ad62d[_0xbb09('0x3a')]));if(_0x2709e6[_0xbb09('0x30')][_0xbb09('0x3b')]){_0x571d5a[_0xbb09('0x39')]=_[_0xbb09('0x3c')](_0x571d5a['where'],{'$or':_[_0xbb09('0x3d')](_0x4e238b,function(_0x2b44a3){if(_0x2b44a3[_0xbb09('0x2b')]!==_0xbb09('0x3e')){var _0x36ea95={};_0x36ea95[_0x2b44a3['name']]={'$like':'%'+_0x2709e6['query']['filter']+'%'};return _0x36ea95;}})});}_0x571d5a=_[_0xbb09('0x3c')]({},_0x571d5a,_0x2709e6[_0xbb09('0x3f')]);var _0x26af06={'where':_0x571d5a[_0xbb09('0x39')]};return db[_0xbb09('0x28')][_0xbb09('0x19')](_0x26af06)['then'](function(_0x14b0a5){_0x4842a1[_0xbb09('0x19')]=_0x14b0a5;if(_0x2709e6[_0xbb09('0x30')][_0xbb09('0x40')]){_0x571d5a[_0xbb09('0x41')]=[{'all':!![]}];}return db[_0xbb09('0x28')][_0xbb09('0x42')](_0x571d5a);})[_0xbb09('0x21')](function(_0x30172c){_0x4842a1['rows']=_0x30172c;return _0x4842a1;})[_0xbb09('0x21')](respondWithFilteredResult(_0x26bc78,_0x571d5a))[_0xbb09('0x43')](handleError(_0x26bc78,null));};exports[_0xbb09('0x44')]=function(_0x295841,_0x1d1812){var _0x566c59={'raw':![],'where':{'id':_0x295841[_0xbb09('0x45')]['id']}},_0x383b6a={};_0x383b6a[_0xbb09('0x2c')]=_[_0xbb09('0x2f')](db['ScreenRecording'][_0xbb09('0x29')]);_0x383b6a[_0xbb09('0x30')]=_['keys'](_0x295841[_0xbb09('0x30')]);_0x383b6a[_0xbb09('0x3a')]=_[_0xbb09('0x31')](_0x383b6a[_0xbb09('0x2c')],_0x383b6a[_0xbb09('0x30')]);_0x566c59[_0xbb09('0x32')]=_['intersection'](_0x383b6a['model'],qs[_0xbb09('0x33')](_0x295841[_0xbb09('0x30')][_0xbb09('0x33')]));_0x566c59[_0xbb09('0x32')]=_0x566c59[_0xbb09('0x32')][_0xbb09('0x34')]?_0x566c59['attributes']:_0x383b6a[_0xbb09('0x2c')];if(_0x295841[_0xbb09('0x30')][_0xbb09('0x40')]){_0x566c59[_0xbb09('0x41')]=[{'all':!![]}];}_0x566c59=_[_0xbb09('0x3c')]({},_0x566c59,_0x295841[_0xbb09('0x3f')]);return db[_0xbb09('0x28')][_0xbb09('0x46')](_0x566c59)[_0xbb09('0x21')](handleEntityNotFound(_0x1d1812,null))[_0xbb09('0x21')](respondWithResult(_0x1d1812,null))[_0xbb09('0x43')](handleError(_0x1d1812,null));};exports[_0xbb09('0x47')]=function(_0x163fd5,_0x5ba45a){return db[_0xbb09('0x28')][_0xbb09('0x47')](_0x163fd5[_0xbb09('0x48')],{})['then'](respondWithResult(_0x5ba45a,0xc9))[_0xbb09('0x43')](handleError(_0x5ba45a,null));};exports[_0xbb09('0x20')]=function(_0x3e1afc,_0x3e7e6b){if(_0x3e1afc[_0xbb09('0x48')]['id']){delete _0x3e1afc[_0xbb09('0x48')]['id'];}delete _0x3e1afc['body'][_0xbb09('0x49')];delete _0x3e1afc[_0xbb09('0x48')][_0xbb09('0x4a')];delete _0x3e1afc[_0xbb09('0x48')][_0xbb09('0x4b')];delete _0x3e1afc['body'][_0xbb09('0x4c')];return db[_0xbb09('0x28')][_0xbb09('0x46')]({'where':{'id':_0x3e1afc[_0xbb09('0x45')]['id']}})[_0xbb09('0x21')](handleEntityNotFound(_0x3e7e6b,null))[_0xbb09('0x21')](saveUpdates(_0x3e1afc[_0xbb09('0x48')],null))[_0xbb09('0x21')](respondWithResult(_0x3e7e6b,null))[_0xbb09('0x43')](handleError(_0x3e7e6b,null));};exports[_0xbb09('0x4d')]=function(_0x42ac7f,_0x51aabf){return db[_0xbb09('0x28')][_0xbb09('0x4d')]()['then'](respondWithResult(_0x51aabf,null))[_0xbb09('0x43')](handleError(_0x51aabf,null));};exports[_0xbb09('0x4e')]=function(_0x25e930,_0x33e2f8,_0x46ed44){var _0x2b2d33=require(_0xbb09('0x4f'));var _0x108e1f=![];var _0x37347f={};if(_0x25e930[_0xbb09('0x30')][_0xbb09('0x2b')]&&_0x25e930[_0xbb09('0x30')]['type']===_0xbb09('0x50')){_0x37347f[_0xbb09('0x50')]=_0x25e930[_0xbb09('0x45')]['id'];}else{_0x37347f['id']=_0x25e930['params']['id'];}return db['ScreenRecording'][_0xbb09('0x46')]({'where':_0x37347f,'attributes':['id',_0xbb09('0x4c')],'raw':!![]})[_0xbb09('0x21')](handleEntityNotFound(_0x33e2f8,null))[_0xbb09('0x21')](function(_0x4655a2){if(_0x4655a2){var _0x3dadaf=path['join'](config['root'],_0xbb09('0x51'),_0x4655a2['value']);var _0x57fea7=util[_0xbb09('0x2e')](_0xbb09('0x52'),_0x3dadaf);if(fs[_0xbb09('0x53')](_0x57fea7)){_0x108e1f=!![];return _0x2b2d33[_0xbb09('0x54')](_0x57fea7,_0x3dadaf,config[_0xbb09('0x55')][_0xbb09('0x56')])[_0xbb09('0x21')](function(){return _0x4655a2;});}return _0x4655a2;}})[_0xbb09('0x21')](function(_0x3fe369){if(_0x3fe369){var _0x515359=path[_0xbb09('0x57')](config['root'],_0xbb09('0x51'),_0x3fe369[_0xbb09('0x4c')]);if(!fs['existsSync'](_0x515359)){throw new db['Sequelize']['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x3fe369[_0xbb09('0x58')]){return _0x33e2f8['download'](_0x515359,_0x3fe369['filename']+path[_0xbb09('0x59')](_0x515359),function(){if(_0x108e1f){fs['unlink'](_0x515359);}});}else{return _0x33e2f8['download'](_0x515359,function(_0x704a73){if(_0x108e1f){fs['unlink'](_0x515359);}});}}})[_0xbb09('0x43')](function(_0x19f12b){if(_0x19f12b[_0xbb09('0x5a')]==='ScreenRecording\x20not\x20found'){_0x33e2f8[_0xbb09('0x17')](0x194)[_0xbb09('0x26')]('Not\x20found');}else{return handleError(_0x33e2f8,null);}});};exports[_0xbb09('0x22')]=function(_0x350de0,_0x2511bd){return db['ScreenRecording'][_0xbb09('0x46')]({'where':{'id':_0x350de0[_0xbb09('0x45')]['id']}})[_0xbb09('0x21')](function(_0x5babc1){if(!_0x5babc1)throw new ReferenceError(_0xbb09('0x5b'));return _0x5babc1;})['then'](function(_0x11329b){var _0x23e6dc=path[_0xbb09('0x57')](config[_0xbb09('0x5c')],'server/files/screen_recordings',_0x11329b['value']);logger[_0xbb09('0x5d')](_0xbb09('0x5e'),_0x23e6dc);if(!_[_0xbb09('0x5f')](_0x11329b[_0xbb09('0x4c')])&&fs[_0xbb09('0x53')](_0x23e6dc)){logger[_0xbb09('0x5d')](_0xbb09('0x60')+_0x23e6dc+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbb09('0x61')](_0x23e6dc);}_0x23e6dc=_0x23e6dc+'.cypher';if(!_[_0xbb09('0x5f')](_0x11329b[_0xbb09('0x4c')])&&fs[_0xbb09('0x53')](_0x23e6dc)){logger[_0xbb09('0x5d')](_0xbb09('0x60')+_0x23e6dc+_0xbb09('0x62'));fs[_0xbb09('0x61')](_0x23e6dc);}return _0x11329b;})[_0xbb09('0x21')](function(_0xe9125d){if(!_0xe9125d)throw new InternalError();return _0xe9125d['destroy']();})[_0xbb09('0x21')](function(){_0x2511bd[_0xbb09('0x17')](0xcc)['end']();})[_0xbb09('0x43')](handleError(_0x2511bd,null));}; \ No newline at end of file +var _0x800d=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','root','format','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','send','Entity\x20not\x20found','info','isNil','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields'];(function(_0x161e82,_0x24fdf2){var _0x276905=function(_0x25f6c1){while(--_0x25f6c1){_0x161e82['push'](_0x161e82['shift']());}};_0x276905(++_0x24fdf2);}(_0x800d,0x103));var _0xd800=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x800d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd800('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd800('0x1'));var jsonpatch=require(_0xd800('0x2'));var rp=require('request-promise');var moment=require(_0xd800('0x3'));var BPromise=require(_0xd800('0x4'));var Mustache=require('mustache');var util=require(_0xd800('0x5'));var path=require(_0xd800('0x6'));var sox=require(_0xd800('0x7'));var csv=require(_0xd800('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd800('0x9'));var squel=require(_0xd800('0xa'));var crypto=require(_0xd800('0xb'));var jsforce=require(_0xd800('0xc'));var deskjs=require(_0xd800('0xd'));var toCsv=require(_0xd800('0x8'));var querystring=require(_0xd800('0xe'));var Papa=require(_0xd800('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd800('0x10'));var as=require(_0xd800('0x11'));var hardwareService=require(_0xd800('0x12'));var logger=require('../../config/logger')(_0xd800('0x13'));var utils=require(_0xd800('0x14'));var config=require(_0xd800('0x15'));var db=require(_0xd800('0x16'))['db'];function respondWithStatusCode(_0x13630e,_0x4f0be8){_0x4f0be8=_0x4f0be8||0xcc;return function(_0x63a9ed){if(_0x63a9ed){return _0x13630e[_0xd800('0x17')](_0x4f0be8);}return _0x13630e['status'](_0x4f0be8)[_0xd800('0x18')]();};}function respondWithResult(_0x568e39,_0x91415f){_0x91415f=_0x91415f||0xc8;return function(_0x3bc2ee){if(_0x3bc2ee){return _0x568e39[_0xd800('0x19')](_0x91415f)[_0xd800('0x1a')](_0x3bc2ee);}};}function respondWithFilteredResult(_0x431745,_0x23ca2f){return function(_0x484068){if(_0x484068){var _0x249db6=_0x484068['count'],_0x3d84ac=_0x23ca2f[_0xd800('0x1b')],_0x4afeed=_0x23ca2f[_0xd800('0x1b')]+_0x23ca2f['limit'],_0x10a23d;if(_0x4afeed>=_0x249db6){_0x4afeed=_0x249db6;_0x10a23d=0xc8;}else{_0x10a23d=0xce;}_0x431745[_0xd800('0x19')](_0x10a23d);return _0x431745[_0xd800('0x1c')](_0xd800('0x1d'),_0x3d84ac+'-'+_0x4afeed+'/'+_0x249db6)[_0xd800('0x1a')](_0x484068);}return null;};}function patchUpdates(_0x4ae312){return function(_0x238b84){try{jsonpatch[_0xd800('0x1e')](_0x238b84,_0x4ae312,!![]);}catch(_0x190024){return BPromise[_0xd800('0x1f')](_0x190024);}return _0x238b84[_0xd800('0x20')]();};}function saveUpdates(_0x25d444,_0x454964){return function(_0x13f2ca){if(_0x13f2ca){return _0x13f2ca[_0xd800('0x21')](_0x25d444)[_0xd800('0x22')](function(_0x3321f9){return _0x3321f9;});}return null;};}function removeEntity(_0x2c3426,_0x5c2ea8){return function(_0x596266){if(_0x596266){return _0x596266[_0xd800('0x23')]()['then'](function(){_0x2c3426[_0xd800('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x342b41,_0x403326){return function(_0xbc366e){if(!_0xbc366e){_0x342b41['sendStatus'](0x194);}return _0xbc366e;};}function handleError(_0x1418c0,_0x5c0b68){_0x5c0b68=_0x5c0b68||0x1f4;return function(_0x350d73){logger['error'](_0x350d73[_0xd800('0x24')]);if(_0x350d73['name']){delete _0x350d73[_0xd800('0x25')];}_0x1418c0['status'](_0x5c0b68)['send'](_0x350d73);};}exports[_0xd800('0x26')]=function(_0xf4a608,_0x3a70cc){var _0x4b7157={},_0x33cdd9={},_0x2b9287={'count':0x0,'rows':[]};var _0x4f6653=_[_0xd800('0x27')](db[_0xd800('0x28')][_0xd800('0x29')],function(_0x2fd284){return{'name':_0x2fd284[_0xd800('0x2a')],'type':_0x2fd284[_0xd800('0x2b')][_0xd800('0x2c')]};});_0x33cdd9['model']=_[_0xd800('0x2d')](_[_0xd800('0x27')](_0x4f6653,_0xd800('0x25')),['format']);_0x33cdd9[_0xd800('0x2e')]=_[_0xd800('0x2f')](_0xf4a608[_0xd800('0x2e')]);_0x33cdd9[_0xd800('0x30')]=_[_0xd800('0x31')](_0x33cdd9[_0xd800('0x32')],_0x33cdd9[_0xd800('0x2e')]);_0x4b7157[_0xd800('0x33')]=_['intersection'](_0x33cdd9[_0xd800('0x32')],qs[_0xd800('0x34')](_0xf4a608['query'][_0xd800('0x34')]));_0x4b7157[_0xd800('0x33')]=_0x4b7157[_0xd800('0x33')]['length']?_0x4b7157['attributes']:_0x33cdd9[_0xd800('0x32')];if(!_0xf4a608[_0xd800('0x2e')][_0xd800('0x35')](_0xd800('0x36'))){_0x4b7157[_0xd800('0x37')]=qs[_0xd800('0x37')](_0xf4a608[_0xd800('0x2e')]['limit']);_0x4b7157[_0xd800('0x1b')]=qs[_0xd800('0x1b')](_0xf4a608[_0xd800('0x2e')][_0xd800('0x1b')]);}_0x4b7157[_0xd800('0x38')]=qs[_0xd800('0x39')](_0xf4a608[_0xd800('0x2e')]['sort']);_0x4b7157[_0xd800('0x3a')]=qs['filters'](_[_0xd800('0x3b')](_0xf4a608[_0xd800('0x2e')],_0x33cdd9[_0xd800('0x30')]));if(_0xf4a608['query'][_0xd800('0x3c')]){_0x4b7157[_0xd800('0x3a')]=_[_0xd800('0x3d')](_0x4b7157[_0xd800('0x3a')],{'$or':_[_0xd800('0x27')](_0x4f6653,function(_0x5d374a){if(_0x5d374a[_0xd800('0x2b')]!==_0xd800('0x3e')){var _0x4f8f8d={};_0x4f8f8d[_0x5d374a['name']]={'$like':'%'+_0xf4a608[_0xd800('0x2e')][_0xd800('0x3c')]+'%'};return _0x4f8f8d;}})});}_0x4b7157=_['merge']({},_0x4b7157,_0xf4a608[_0xd800('0x3f')]);var _0x419d6e={'where':_0x4b7157[_0xd800('0x3a')]};return db[_0xd800('0x28')][_0xd800('0x40')](_0x419d6e)[_0xd800('0x22')](function(_0x8dbc01){_0x2b9287['count']=_0x8dbc01;if(_0xf4a608[_0xd800('0x2e')][_0xd800('0x41')]){_0x4b7157[_0xd800('0x42')]=[{'all':!![]}];}return db[_0xd800('0x28')][_0xd800('0x43')](_0x4b7157);})[_0xd800('0x22')](function(_0x95d2c){_0x2b9287[_0xd800('0x44')]=_0x95d2c;return _0x2b9287;})['then'](respondWithFilteredResult(_0x3a70cc,_0x4b7157))[_0xd800('0x45')](handleError(_0x3a70cc,null));};exports[_0xd800('0x46')]=function(_0x411470,_0x32c7d6){var _0x54599f={'raw':![],'where':{'id':_0x411470[_0xd800('0x47')]['id']}},_0x39ec72={};_0x39ec72[_0xd800('0x32')]=_[_0xd800('0x2f')](db['ScreenRecording']['rawAttributes']);_0x39ec72['query']=_[_0xd800('0x2f')](_0x411470[_0xd800('0x2e')]);_0x39ec72[_0xd800('0x30')]=_['intersection'](_0x39ec72[_0xd800('0x32')],_0x39ec72['query']);_0x54599f[_0xd800('0x33')]=_[_0xd800('0x31')](_0x39ec72['model'],qs['fields'](_0x411470[_0xd800('0x2e')][_0xd800('0x34')]));_0x54599f[_0xd800('0x33')]=_0x54599f[_0xd800('0x33')]['length']?_0x54599f[_0xd800('0x33')]:_0x39ec72[_0xd800('0x32')];if(_0x411470[_0xd800('0x2e')][_0xd800('0x41')]){_0x54599f[_0xd800('0x42')]=[{'all':!![]}];}_0x54599f=_[_0xd800('0x3d')]({},_0x54599f,_0x411470[_0xd800('0x3f')]);return db[_0xd800('0x28')][_0xd800('0x48')](_0x54599f)[_0xd800('0x22')](handleEntityNotFound(_0x32c7d6,null))[_0xd800('0x22')](respondWithResult(_0x32c7d6,null))[_0xd800('0x45')](handleError(_0x32c7d6,null));};exports['create']=function(_0x191744,_0x2fc48b){return db[_0xd800('0x28')][_0xd800('0x49')](_0x191744[_0xd800('0x4a')],{})[_0xd800('0x22')](respondWithResult(_0x2fc48b,0xc9))[_0xd800('0x45')](handleError(_0x2fc48b,null));};exports['update']=function(_0x5c9206,_0x571564){if(_0x5c9206[_0xd800('0x4a')]['id']){delete _0x5c9206[_0xd800('0x4a')]['id'];}delete _0x5c9206[_0xd800('0x4a')][_0xd800('0x4b')];delete _0x5c9206['body'][_0xd800('0x4c')];delete _0x5c9206[_0xd800('0x4a')][_0xd800('0x4d')];delete _0x5c9206[_0xd800('0x4a')]['value'];return db[_0xd800('0x28')][_0xd800('0x48')]({'where':{'id':_0x5c9206[_0xd800('0x47')]['id']}})[_0xd800('0x22')](handleEntityNotFound(_0x571564,null))[_0xd800('0x22')](saveUpdates(_0x5c9206[_0xd800('0x4a')],null))['then'](respondWithResult(_0x571564,null))['catch'](handleError(_0x571564,null));};exports['describe']=function(_0x213385,_0x1c7790){return db['ScreenRecording'][_0xd800('0x4e')]()[_0xd800('0x22')](respondWithResult(_0x1c7790,null))['catch'](handleError(_0x1c7790,null));};exports[_0xd800('0x4f')]=function(_0x66102a,_0x5c985a,_0x11a8ab){var _0xb77f7e=require(_0xd800('0x50'));var _0x41a545=![];var _0x3a88af={};if(_0x66102a['query'][_0xd800('0x2b')]&&_0x66102a['query']['type']===_0xd800('0x51')){_0x3a88af[_0xd800('0x51')]=_0x66102a[_0xd800('0x47')]['id'];}else{_0x3a88af['id']=_0x66102a['params']['id'];}return db['ScreenRecording']['find']({'where':_0x3a88af,'attributes':['id',_0xd800('0x52')],'raw':!![]})[_0xd800('0x22')](handleEntityNotFound(_0x5c985a,null))[_0xd800('0x22')](function(_0x38994c){if(_0x38994c){var _0x2800f8=path[_0xd800('0x53')](config[_0xd800('0x54')],'server/files/screen_recordings',_0x38994c[_0xd800('0x52')]);var _0x1ec873=util[_0xd800('0x55')]('%s.cypher',_0x2800f8);if(fs['existsSync'](_0x1ec873)){_0x41a545=!![];return _0xb77f7e[_0xd800('0x56')](_0x1ec873,_0x2800f8,config[_0xd800('0x57')][_0xd800('0x58')])[_0xd800('0x22')](function(){return _0x38994c;});}return _0x38994c;}})[_0xd800('0x22')](function(_0x1f5f31){if(_0x1f5f31){var _0x3464d4=path[_0xd800('0x53')](config['root'],_0xd800('0x59'),_0x1f5f31[_0xd800('0x52')]);if(!fs['existsSync'](_0x3464d4)){throw new db[(_0xd800('0x5a'))][(_0xd800('0x5b'))](_0xd800('0x5c'));}if(_0x1f5f31[_0xd800('0x5d')]){return _0x5c985a[_0xd800('0x4f')](_0x3464d4,_0x1f5f31[_0xd800('0x5d')]+path['extname'](_0x3464d4),function(){if(_0x41a545){fs[_0xd800('0x5e')](_0x3464d4);}});}else{return _0x5c985a[_0xd800('0x4f')](_0x3464d4,function(_0x905e0a){if(_0x41a545){fs['unlink'](_0x3464d4);}});}}})[_0xd800('0x45')](function(_0x12a4d2){if(_0x12a4d2[_0xd800('0x5f')]==='ScreenRecording\x20not\x20found'){_0x5c985a[_0xd800('0x19')](0x194)[_0xd800('0x60')]('Not\x20found');}else{return handleError(_0x5c985a,null);}});};exports['destroy']=function(_0x446bac,_0xa83a07){return db['ScreenRecording'][_0xd800('0x48')]({'where':{'id':_0x446bac[_0xd800('0x47')]['id']}})['then'](function(_0x3748df){if(!_0x3748df)throw new ReferenceError(_0xd800('0x61'));return _0x3748df;})[_0xd800('0x22')](function(_0x1353eb){var _0x3bfa96=path[_0xd800('0x53')](config['root'],_0xd800('0x59'),_0x1353eb[_0xd800('0x52')]);logger[_0xd800('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0x3bfa96);if(!_[_0xd800('0x63')](_0x1353eb[_0xd800('0x52')])&&fs[_0xd800('0x64')](_0x3bfa96)){logger[_0xd800('0x62')](_0xd800('0x65')+_0x3bfa96+_0xd800('0x66'));fs['unlinkSync'](_0x3bfa96);}_0x3bfa96=_0x3bfa96+'.cypher';if(!_['isNil'](_0x1353eb['value'])&&fs['existsSync'](_0x3bfa96)){logger[_0xd800('0x62')](_0xd800('0x65')+_0x3bfa96+_0xd800('0x66'));fs[_0xd800('0x67')](_0x3bfa96);}return _0x1353eb;})[_0xd800('0x22')](function(_0x867628){if(!_0x867628)throw new InternalError();return _0x867628[_0xd800('0x23')]();})[_0xd800('0x22')](function(){_0xa83a07[_0xd800('0x19')](0xcc)[_0xd800('0x18')]();})[_0xd800('0x45')](handleError(_0xa83a07,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index bf2e5a7..47425e4 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 _0x1d45=['api','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger'];(function(_0x53c89b,_0x137cab){var _0x547fc9=function(_0x3cbf0){while(--_0x3cbf0){_0x53c89b['push'](_0x53c89b['shift']());}};_0x547fc9(++_0x137cab);}(_0x1d45,0x97));var _0x51d4=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x1d45[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x51d4('0x0'));var util=require(_0x51d4('0x1'));var logger=require(_0x51d4('0x2'))(_0x51d4('0x3'));var moment=require('moment');var BPromise=require(_0x51d4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x51d4('0x5'));var rimraf=require(_0x51d4('0x6'));var config=require(_0x51d4('0x7'));var attributes=require(_0x51d4('0x8'));module[_0x51d4('0x9')]=function(_0x2442bc,_0x16c08f){return _0x2442bc[_0x51d4('0xa')](_0x51d4('0xb'),attributes,{'tableName':_0x51d4('0xc'),'paranoid':![],'indexes':[{'name':_0x51d4('0xd'),'fields':[_0x51d4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e62=['moment','request-promise','rimraf','../../config/environment','./screenRecording.attributes','define','screen_recordings','interactionid','lodash'];(function(_0x533d14,_0x35b412){var _0x2e32a2=function(_0x47d72c){while(--_0x47d72c){_0x533d14['push'](_0x533d14['shift']());}};_0x2e32a2(++_0x35b412);}(_0x2e62,0xce));var _0x22e6=function(_0x4e341e,_0x2453b7){_0x4e341e=_0x4e341e-0x0;var _0x9c4db4=_0x2e62[_0x4e341e];return _0x9c4db4;};'use strict';var _=require(_0x22e6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x22e6('0x1'));var BPromise=require('bluebird');var rp=require(_0x22e6('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22e6('0x3'));var config=require(_0x22e6('0x4'));var attributes=require(_0x22e6('0x5'));module['exports']=function(_0x5449e4,_0x4ae012){return _0x5449e4[_0x22e6('0x6')]('ScreenRecording',attributes,{'tableName':_0x22e6('0x7'),'paranoid':![],'indexes':[{'name':_0x22e6('0x8'),'fields':[_0x22e6('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 050ef94..473c67e 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4edede,_0x4c628d){var _0x5569cb=function(_0x1f00a2){while(--_0x1f00a2){_0x4edede['push'](_0x4edede['shift']());}};_0x5569cb(++_0x4c628d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x572349,_0x5dcccd){var _0x122f75=function(_0x5c84db){while(--_0x5c84db){_0x572349['push'](_0x572349['shift']());}};_0x122f75(++_0x5dcccd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 3233b18..77e5710 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 _0xcec8=['update','util','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s','extname','post','file','addLogo','root','single','addLogoLogin','originalname','addPreferred','favicon','addFavicon','put'];(function(_0x3562f5,_0x8931a1){var _0x1e4a28=function(_0x148977){while(--_0x148977){_0x3562f5['push'](_0x3562f5['shift']());}};_0x1e4a28(++_0x8931a1);}(_0xcec8,0x18d));var _0x8cec=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xcec8[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require('multer');var util=require(_0x8cec('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8cec('0x1'));var router=express[_0x8cec('0x2')]();var auth=require(_0x8cec('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8cec('0x4'));var controller=require('./setting.controller');router[_0x8cec('0x5')]('/',auth[_0x8cec('0x6')](),controller[_0x8cec('0x7')]);router['get'](_0x8cec('0x8'),controller['show']);router['get'](_0x8cec('0x9'),controller['getLogo']);router[_0x8cec('0x5')](_0x8cec('0xa'),controller[_0x8cec('0xb')]);router[_0x8cec('0x5')](_0x8cec('0xc'),controller[_0x8cec('0xd')]);router[_0x8cec('0x5')](_0x8cec('0xe'),controller[_0x8cec('0xf')]);router['get'](_0x8cec('0x10'),controller[_0x8cec('0x11')]);var upload=multer({'storage':multer[_0x8cec('0x12')]({'destination':function(_0x54f351,_0x72054c,_0x2c87ca){_0x2c87ca(null,path[_0x8cec('0x13')](config['root'],_0x8cec('0x14')));},'filename':function(_0x283f76,_0x2bb3c9,_0x5d3ede){_0x5d3ede(null,util[_0x8cec('0x15')](_0x8cec('0x16'),'logo',path[_0x8cec('0x17')](_0x2bb3c9['originalname'])));}})});router[_0x8cec('0x18')](_0x8cec('0x9'),upload['single'](_0x8cec('0x19')),controller[_0x8cec('0x1a')]);var upload=multer({'storage':multer[_0x8cec('0x12')]({'destination':function(_0x49b34a,_0x1bfb78,_0x42fc54){_0x42fc54(null,path[_0x8cec('0x13')](config[_0x8cec('0x1b')],_0x8cec('0x14')));},'filename':function(_0x4fe5d6,_0x270481,_0x19a8b6){_0x19a8b6(null,util['format'](_0x8cec('0x16'),'logologin',path[_0x8cec('0x17')](_0x270481['originalname'])));}})});router[_0x8cec('0x18')](_0x8cec('0xa'),upload[_0x8cec('0x1c')](_0x8cec('0x19')),controller[_0x8cec('0x1d')]);var upload=multer({'storage':multer[_0x8cec('0x12')]({'destination':function(_0x494ea5,_0xfa204,_0x2a9aa0){_0x2a9aa0(null,path['join'](config[_0x8cec('0x1b')],_0x8cec('0x14')));},'filename':function(_0x2037e1,_0x4f7e96,_0x4366ee){_0x4366ee(null,util['format'](_0x8cec('0x16'),'preferred',path[_0x8cec('0x17')](_0x4f7e96[_0x8cec('0x1e')])));}})});router['post'](_0x8cec('0xe'),upload[_0x8cec('0x1c')]('file'),controller[_0x8cec('0x1f')]);var upload=multer({'storage':multer[_0x8cec('0x12')]({'destination':function(_0x583a67,_0x18b9fa,_0x40cb87){_0x40cb87(null,path[_0x8cec('0x13')](config[_0x8cec('0x1b')],_0x8cec('0x14')));},'filename':function(_0xc00f4,_0xa22e84,_0x3bf26e){_0x3bf26e(null,util[_0x8cec('0x15')](_0x8cec('0x16'),_0x8cec('0x20'),path[_0x8cec('0x17')](_0xa22e84[_0x8cec('0x1e')])));}})});router['post'](_0x8cec('0x10'),upload['single'](_0x8cec('0x19')),controller[_0x8cec('0x21')]);router[_0x8cec('0x22')](_0x8cec('0x8'),auth[_0x8cec('0x6')](),controller[_0x8cec('0x23')]);module['exports']=router; \ No newline at end of file +var _0x0fbe=['update','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','logo','originalname','single','addLogo','post','file','preferred','extname','addPreferred','diskStorage','favicon','addFavicon','put'];(function(_0x428c4e,_0xe705b){var _0x26a009=function(_0x610bec){while(--_0x610bec){_0x428c4e['push'](_0x428c4e['shift']());}};_0x26a009(++_0xe705b);}(_0x0fbe,0x152));var _0xe0fb=function(_0x2b4f2d,_0x170d09){_0x2b4f2d=_0x2b4f2d-0x0;var _0xc077e=_0x0fbe[_0x2b4f2d];return _0xc077e;};'use strict';var multer=require(_0xe0fb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe0fb('0x1'));var express=require(_0xe0fb('0x2'));var router=express[_0xe0fb('0x3')]();var auth=require(_0xe0fb('0x4'));var interaction=require(_0xe0fb('0x5'));var config=require(_0xe0fb('0x6'));var controller=require(_0xe0fb('0x7'));router[_0xe0fb('0x8')]('/',auth[_0xe0fb('0x9')](),controller['index']);router['get'](_0xe0fb('0xa'),controller[_0xe0fb('0xb')]);router[_0xe0fb('0x8')](_0xe0fb('0xc'),controller[_0xe0fb('0xd')]);router[_0xe0fb('0x8')](_0xe0fb('0xe'),controller[_0xe0fb('0xf')]);router[_0xe0fb('0x8')](_0xe0fb('0x10'),controller[_0xe0fb('0x11')]);router[_0xe0fb('0x8')](_0xe0fb('0x12'),controller[_0xe0fb('0x13')]);router[_0xe0fb('0x8')](_0xe0fb('0x14'),controller[_0xe0fb('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x31449c,_0x53f0eb,_0x2af856){_0x2af856(null,path[_0xe0fb('0x16')](config[_0xe0fb('0x17')],_0xe0fb('0x18')));},'filename':function(_0x383e7a,_0x434b56,_0x59db95){_0x59db95(null,util[_0xe0fb('0x19')](_0xe0fb('0x1a'),_0xe0fb('0x1b'),path['extname'](_0x434b56[_0xe0fb('0x1c')])));}})});router['post']('/:id/logo',upload[_0xe0fb('0x1d')]('file'),controller[_0xe0fb('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x904f3e,_0x51a95c,_0x573b4b){_0x573b4b(null,path[_0xe0fb('0x16')](config[_0xe0fb('0x17')],'server/files/images/logos/'));},'filename':function(_0x922320,_0x9814ce,_0x55fe43){_0x55fe43(null,util[_0xe0fb('0x19')](_0xe0fb('0x1a'),'logologin',path['extname'](_0x9814ce[_0xe0fb('0x1c')])));}})});router[_0xe0fb('0x1f')](_0xe0fb('0xe'),upload[_0xe0fb('0x1d')](_0xe0fb('0x20')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3345b8,_0x4a9c44,_0x1b6222){_0x1b6222(null,path[_0xe0fb('0x16')](config['root'],_0xe0fb('0x18')));},'filename':function(_0x48c3e1,_0x4d14ea,_0x34499f){_0x34499f(null,util[_0xe0fb('0x19')](_0xe0fb('0x1a'),_0xe0fb('0x21'),path[_0xe0fb('0x22')](_0x4d14ea['originalname'])));}})});router[_0xe0fb('0x1f')]('/:id/preferred',upload[_0xe0fb('0x1d')](_0xe0fb('0x20')),controller[_0xe0fb('0x23')]);var upload=multer({'storage':multer[_0xe0fb('0x24')]({'destination':function(_0x197419,_0x386d7e,_0x1055f5){_0x1055f5(null,path[_0xe0fb('0x16')](config[_0xe0fb('0x17')],'server/files/images/logos/'));},'filename':function(_0x27d22d,_0x1a79c2,_0x3c3970){_0x3c3970(null,util[_0xe0fb('0x19')](_0xe0fb('0x1a'),_0xe0fb('0x25'),path[_0xe0fb('0x22')](_0x1a79c2[_0xe0fb('0x1c')])));}})});router['post']('/:id/favicon',upload[_0xe0fb('0x1d')]('file'),controller[_0xe0fb('0x26')]);router[_0xe0fb('0x27')](_0xe0fb('0xa'),auth[_0xe0fb('0x9')](),controller[_0xe0fb('0x28')]);module[_0xe0fb('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 18f4977..621e2a1 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 _0xa852=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','sequelize','exports','INTEGER','min_internal'];(function(_0x4f4d5f,_0x6d3210){var _0x51d83e=function(_0x4d439f){while(--_0x4d439f){_0x4f4d5f['push'](_0x4f4d5f['shift']());}};_0x51d83e(++_0x6d3210);}(_0xa852,0x1bc));var _0x2a85=function(_0xb9e184,_0x1879fc){_0xb9e184=_0xb9e184-0x0;var _0x17eb2b=_0xa852[_0xb9e184];return _0x17eb2b;};'use strict';var Sequelize=require(_0x2a85('0x0'));module[_0x2a85('0x1')]={'min_internal':{'type':Sequelize[_0x2a85('0x2')](0xb),'unique':_0x2a85('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2a85('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x2a85('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x2a85('0x4')],'defaultValue':_0x2a85('0x5')},'logo':{'type':Sequelize[_0x2a85('0x4')]},'defaultLogo':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2a85('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x2a85('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x2a85('0x4')]},'turnpassword':{'type':Sequelize[_0x2a85('0x4')]},'pageTitle':{'type':Sequelize[_0x2a85('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x2a85('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2a85('0x4')],'defaultValue':_0x2a85('0x7')},'chatTimeout':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x2a85('0x4')]},'defaultPreferred':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x2a85('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x2a85('0x4')]},'defaultFavicon':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize[_0x2a85('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x0b3a=['min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b3a,0x178));var _0xa0b3=function(_0x50e0b4,_0x1057f7){_0x50e0b4=_0x50e0b4-0x0;var _0x2fa8b0=_0x0b3a[_0x50e0b4];return _0x2fa8b0;};'use strict';var Sequelize=require('sequelize');module[_0xa0b3('0x0')]={'min_internal':{'type':Sequelize[_0xa0b3('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xa0b3('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xa0b3('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xa0b3('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xa0b3('0x3')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xa0b3('0x3')]},'turnaddr':{'type':Sequelize[_0xa0b3('0x3')]},'turnusername':{'type':Sequelize[_0xa0b3('0x3')]},'turnpassword':{'type':Sequelize[_0xa0b3('0x3')]},'pageTitle':{'type':Sequelize[_0xa0b3('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xa0b3('0x5')},'enableEmailPreview':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xa0b3('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xa0b3('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xa0b3('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xa0b3('0x3')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xa0b3('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xa0b3('0x3')]},'defaultPreferred':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xa0b3('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xa0b3('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xa0b3('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xa0b3('0x3')]},'defaultFavicon':{'type':Sequelize[_0xa0b3('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xa0b3('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 84c9e8c..8e5e3f0 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 _0xed05=['message','result','status','end','json','count','offset','limit','apply','reject','update','destroy','sendStatus','stack','name','send','map','Setting','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','fields','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','join','default_logo.png','default','upperFirst','\x20not\x20found','download','getLogoLogin','defaultFavicon','default_loginLogo.png','gdpr','getPreferred','default_preferred.png','custom','getFavicon','default_favicon.ico','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x18b0e3,_0x205202){var _0x49e8e5=function(_0x1f6a83){while(--_0x1f6a83){_0x18b0e3['push'](_0x18b0e3['shift']());}};_0x49e8e5(++_0x205202);}(_0xed05,0xca));var _0x5ed0=function(_0xacabda,_0x73a33b){_0xacabda=_0xacabda-0x0;var _0x38cb39=_0xed05[_0xacabda];return _0x38cb39;};'use strict';var pdf=require(_0x5ed0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5ed0('0x1'));var zipdir=require(_0x5ed0('0x2'));var jsonpatch=require(_0x5ed0('0x3'));var rp=require(_0x5ed0('0x4'));var moment=require(_0x5ed0('0x5'));var BPromise=require(_0x5ed0('0x6'));var Mustache=require(_0x5ed0('0x7'));var util=require('util');var path=require(_0x5ed0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5ed0('0x9'));var fs=require('fs');var _=require(_0x5ed0('0xa'));var squel=require(_0x5ed0('0xb'));var crypto=require(_0x5ed0('0xc'));var jsforce=require(_0x5ed0('0xd'));var deskjs=require(_0x5ed0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5ed0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ed0('0x10'));var qs=require(_0x5ed0('0x11'));var as=require(_0x5ed0('0x12'));var hardwareService=require(_0x5ed0('0x13'));var logger=require(_0x5ed0('0x14'))(_0x5ed0('0x15'));var utils=require(_0x5ed0('0x16'));var config=require(_0x5ed0('0x17'));var db=require(_0x5ed0('0x18'))['db'];var jayson=require(_0x5ed0('0x19'));var client=jayson[_0x5ed0('0x1a')][_0x5ed0('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2e1252,_0x1770f7,_0x480144){if(_0x480144){var _0x4312af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4312af[_0x5ed0('0x1c')](_0x1770f7)){return _0x2e1252;}else{throw new db[(_0x5ed0('0x1d'))][(_0x5ed0('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2e1252;}}function respondWithRpcPromise(_0x52113b,_0x4086ce,_0x1df060,_0x2cb990){return new BPromise(function(_0x153af2,_0x118ed0){var _0x2eac4c=_0x2cb990||client;return _0x2eac4c[_0x5ed0('0x1f')](_0x52113b,_0x1df060)[_0x5ed0('0x20')](function(_0x4abe0f){logger[_0x5ed0('0x21')](_0x5ed0('0x22'),_0x4086ce,_0x5ed0('0x23'));logger['debug'](_0x5ed0('0x24'),_0x4086ce,_0x5ed0('0x23'),JSON[_0x5ed0('0x25')](_0x4abe0f));if(_0x4abe0f[_0x5ed0('0x26')]){if(_0x4abe0f[_0x5ed0('0x26')][_0x5ed0('0x27')]===0x1f4){logger[_0x5ed0('0x26')]('Setting,\x20%s,\x20%s',_0x4086ce,_0x4abe0f[_0x5ed0('0x26')][_0x5ed0('0x28')]);return _0x118ed0(_0x4abe0f['error'][_0x5ed0('0x28')]);}logger['error'](_0x5ed0('0x22'),_0x4086ce,_0x4abe0f['error'][_0x5ed0('0x28')]);return _0x153af2(_0x4abe0f[_0x5ed0('0x26')]['message']);}else{logger['info'](_0x5ed0('0x22'),_0x4086ce,_0x5ed0('0x23'));_0x153af2(_0x4abe0f[_0x5ed0('0x29')]['message']);}})['catch'](function(_0x5f2028){logger[_0x5ed0('0x26')](_0x5ed0('0x22'),_0x4086ce,_0x5f2028);_0x118ed0(_0x5f2028);});});}function respondWithStatusCode(_0x2ef9cf,_0x4d8cbf){_0x4d8cbf=_0x4d8cbf||0xcc;return function(_0x156c38){if(_0x156c38){return _0x2ef9cf['sendStatus'](_0x4d8cbf);}return _0x2ef9cf[_0x5ed0('0x2a')](_0x4d8cbf)[_0x5ed0('0x2b')]();};}function respondWithResult(_0x1d8718,_0x49e26f){_0x49e26f=_0x49e26f||0xc8;return function(_0x3d3108){if(_0x3d3108){return _0x1d8718[_0x5ed0('0x2a')](_0x49e26f)[_0x5ed0('0x2c')](_0x3d3108);}};}function respondWithFilteredResult(_0x26f62c,_0x4e65c4){return function(_0x422b67){if(_0x422b67){var _0x57695a=_0x422b67[_0x5ed0('0x2d')],_0x34f586=_0x4e65c4[_0x5ed0('0x2e')],_0x2c97c5=_0x4e65c4[_0x5ed0('0x2e')]+_0x4e65c4[_0x5ed0('0x2f')],_0x4425d1;if(_0x2c97c5>=_0x57695a){_0x2c97c5=_0x57695a;_0x4425d1=0xc8;}else{_0x4425d1=0xce;}_0x26f62c[_0x5ed0('0x2a')](_0x4425d1);return _0x26f62c['set']('Content-Range',_0x34f586+'-'+_0x2c97c5+'/'+_0x57695a)[_0x5ed0('0x2c')](_0x422b67);}return null;};}function patchUpdates(_0x147833){return function(_0x1c0911){try{jsonpatch[_0x5ed0('0x30')](_0x1c0911,_0x147833,!![]);}catch(_0x57e76b){return BPromise[_0x5ed0('0x31')](_0x57e76b);}return _0x1c0911['save']();};}function saveUpdates(_0x49cc82,_0x292282){return function(_0x31eee9){if(_0x31eee9){return _0x31eee9[_0x5ed0('0x32')](_0x49cc82)['then'](function(_0xf08e94){return _0xf08e94;});}return null;};}function removeEntity(_0x301386,_0xe430a8){return function(_0x5bdb2d){if(_0x5bdb2d){return _0x5bdb2d[_0x5ed0('0x33')]()[_0x5ed0('0x20')](function(){_0x301386['status'](0xcc)[_0x5ed0('0x2b')]();});}};}function handleEntityNotFound(_0x473a7c,_0x127585){return function(_0x269087){if(!_0x269087){_0x473a7c[_0x5ed0('0x34')](0x194);}return _0x269087;};}function handleError(_0x5e7693,_0x4fab99){_0x4fab99=_0x4fab99||0x1f4;return function(_0xa83d15){logger[_0x5ed0('0x26')](_0xa83d15[_0x5ed0('0x35')]);if(_0xa83d15['name']){delete _0xa83d15[_0x5ed0('0x36')];}_0x5e7693[_0x5ed0('0x2a')](_0x4fab99)[_0x5ed0('0x37')](_0xa83d15);};}exports['index']=function(_0x121bfc,_0x26570f){var _0x4ee71a={},_0x2ea033={},_0x58eb73={'count':0x0,'rows':[]};var _0x25c29b=_[_0x5ed0('0x38')](db[_0x5ed0('0x39')][_0x5ed0('0x3a')],function(_0x3df88b){return{'name':_0x3df88b['fieldName'],'type':_0x3df88b[_0x5ed0('0x3b')][_0x5ed0('0x3c')]};});_0x2ea033['model']=_[_0x5ed0('0x38')](_0x25c29b,_0x5ed0('0x36'));_0x2ea033['query']=_[_0x5ed0('0x3d')](_0x121bfc[_0x5ed0('0x3e')]);_0x2ea033[_0x5ed0('0x3f')]=_[_0x5ed0('0x40')](_0x2ea033[_0x5ed0('0x41')],_0x2ea033['query']);_0x4ee71a['attributes']=_[_0x5ed0('0x40')](_0x2ea033[_0x5ed0('0x41')],qs['fields'](_0x121bfc['query']['fields']));_0x4ee71a['attributes']=_0x4ee71a[_0x5ed0('0x42')][_0x5ed0('0x43')]?_0x4ee71a[_0x5ed0('0x42')]:_0x2ea033['model'];if(!_0x121bfc[_0x5ed0('0x3e')][_0x5ed0('0x44')](_0x5ed0('0x45'))){_0x4ee71a[_0x5ed0('0x2f')]=qs[_0x5ed0('0x2f')](_0x121bfc[_0x5ed0('0x3e')][_0x5ed0('0x2f')]);_0x4ee71a[_0x5ed0('0x2e')]=qs[_0x5ed0('0x2e')](_0x121bfc[_0x5ed0('0x3e')][_0x5ed0('0x2e')]);}_0x4ee71a[_0x5ed0('0x46')]=qs[_0x5ed0('0x47')](_0x121bfc[_0x5ed0('0x3e')][_0x5ed0('0x47')]);_0x4ee71a[_0x5ed0('0x48')]=qs[_0x5ed0('0x3f')](_[_0x5ed0('0x49')](_0x121bfc[_0x5ed0('0x3e')],_0x2ea033[_0x5ed0('0x3f')]));if(_0x121bfc[_0x5ed0('0x3e')][_0x5ed0('0x4a')]){_0x4ee71a[_0x5ed0('0x48')]=_['merge'](_0x4ee71a['where'],{'$or':_['map'](_0x25c29b,function(_0x897c0){if(_0x897c0['type']!==_0x5ed0('0x4b')){var _0x686d07={};_0x686d07[_0x897c0[_0x5ed0('0x36')]]={'$like':'%'+_0x121bfc[_0x5ed0('0x3e')][_0x5ed0('0x4a')]+'%'};return _0x686d07;}})});}_0x4ee71a=_[_0x5ed0('0x4c')]({},_0x4ee71a,_0x121bfc[_0x5ed0('0x4d')]);var _0x386d87={'where':_0x4ee71a[_0x5ed0('0x48')]};return db[_0x5ed0('0x39')]['count'](_0x386d87)[_0x5ed0('0x20')](function(_0xfac825){_0x58eb73[_0x5ed0('0x2d')]=_0xfac825;if(_0x121bfc['query'][_0x5ed0('0x4e')]){_0x4ee71a[_0x5ed0('0x4f')]=[{'all':!![]}];}return db[_0x5ed0('0x39')][_0x5ed0('0x50')](_0x4ee71a);})[_0x5ed0('0x20')](function(_0x52d906){_0x58eb73[_0x5ed0('0x51')]=_0x52d906;return _0x58eb73;})[_0x5ed0('0x20')](respondWithFilteredResult(_0x26570f,_0x4ee71a))[_0x5ed0('0x52')](handleError(_0x26570f,null));};exports[_0x5ed0('0x53')]=function(_0x2b326c,_0x535477){var _0x1557b3={'raw':![],'where':{'id':_0x2b326c['params']['id']}},_0x503368={};_0x503368[_0x5ed0('0x41')]=_[_0x5ed0('0x3d')](db[_0x5ed0('0x39')]['rawAttributes']);_0x503368[_0x5ed0('0x3e')]=_['keys'](_0x2b326c[_0x5ed0('0x3e')]);_0x503368[_0x5ed0('0x3f')]=_[_0x5ed0('0x40')](_0x503368[_0x5ed0('0x41')],_0x503368[_0x5ed0('0x3e')]);_0x1557b3[_0x5ed0('0x42')]=_[_0x5ed0('0x40')](_0x503368[_0x5ed0('0x41')],qs[_0x5ed0('0x54')](_0x2b326c[_0x5ed0('0x3e')][_0x5ed0('0x54')]));_0x1557b3['attributes']=_0x1557b3[_0x5ed0('0x42')][_0x5ed0('0x43')]?_0x1557b3[_0x5ed0('0x42')]:_0x503368['model'];if(_0x2b326c[_0x5ed0('0x3e')][_0x5ed0('0x4e')]){_0x1557b3[_0x5ed0('0x4f')]=[{'all':!![]}];}_0x1557b3=_[_0x5ed0('0x4c')]({},_0x1557b3,_0x2b326c['options']);return db['Setting'][_0x5ed0('0x55')](_0x1557b3)[_0x5ed0('0x20')](handleEntityNotFound(_0x535477,null))[_0x5ed0('0x20')](respondWithResult(_0x535477,null))[_0x5ed0('0x52')](handleError(_0x535477,null));};exports[_0x5ed0('0x32')]=function(_0xdecc4b,_0x3b1241){if(_0xdecc4b[_0x5ed0('0x56')]['id']){delete _0xdecc4b['body']['id'];}return db[_0x5ed0('0x39')][_0x5ed0('0x55')]({'where':{'id':_0xdecc4b[_0x5ed0('0x57')]['id']}})[_0x5ed0('0x20')](handleEntityNotFound(_0x3b1241,null))[_0x5ed0('0x20')](saveUpdates(_0xdecc4b[_0x5ed0('0x56')],null))[_0x5ed0('0x20')](respondWithResult(_0x3b1241,null))['catch'](handleError(_0x3b1241,null));};exports[_0x5ed0('0x58')]=function(_0x6117e6,_0x49e39b,_0x849b89){if(_0x6117e6[_0x5ed0('0x59')]&&_0x6117e6['file'][_0x5ed0('0x5a')]){_0x6117e6[_0x5ed0('0x56')][_0x5ed0('0x5b')]=_0x6117e6['file'][_0x5ed0('0x5a')];}return db[_0x5ed0('0x39')][_0x5ed0('0x55')]({'where':{'id':_0x6117e6[_0x5ed0('0x57')]['id']}})['then'](handleEntityNotFound(_0x49e39b,null))['then'](saveUpdates(_0x6117e6['body'],null))[_0x5ed0('0x20')](respondWithResult(_0x49e39b,null))['catch'](handleError(_0x49e39b,null));};exports[_0x5ed0('0x5c')]=function(_0x26ae3c,_0x1706f1,_0x5e10ff){if(_0x26ae3c['file']&&_0x26ae3c[_0x5ed0('0x59')][_0x5ed0('0x5a')]){_0x26ae3c['body'][_0x5ed0('0x5d')]=_0x26ae3c[_0x5ed0('0x59')][_0x5ed0('0x5a')];}return db['Setting'][_0x5ed0('0x55')]({'where':{'id':_0x26ae3c['params']['id']}})['then'](handleEntityNotFound(_0x1706f1,null))[_0x5ed0('0x20')](saveUpdates(_0x26ae3c[_0x5ed0('0x56')],null))[_0x5ed0('0x20')](respondWithResult(_0x1706f1,null))[_0x5ed0('0x52')](handleError(_0x1706f1,null));};var utilLicense=require(_0x5ed0('0x5e'));exports[_0x5ed0('0x5f')]=function(_0x3af194,_0x2d86a1,_0x4732e7){var _0x479bd8=_0x5ed0('0x60');var _0x44dc1e={'custom':![]};return utilLicense[_0x5ed0('0x61')]()[_0x5ed0('0x20')](function(_0x566139){if(_0x566139){_0x44dc1e=_0x566139;}return db['Setting'][_0x5ed0('0x55')]({'where':{'id':_0x3af194[_0x5ed0('0x57')]['id']},'attributes':['logo',_0x5ed0('0x5d'),_0x5ed0('0x62'),_0x5ed0('0x63'),_0x5ed0('0x64'),_0x5ed0('0x65'),_0x5ed0('0x66'),'defaultFavicon'],'raw':!![]});})[_0x5ed0('0x20')](handleEntityNotFound(_0x2d86a1,null))[_0x5ed0('0x20')](function(_0x596b4a){if(_0x596b4a){var _0x436193=_0x596b4a[_0x5ed0('0x5b')]&&fs[_0x5ed0('0x67')](path['join'](config[_0x5ed0('0x68')],_0x479bd8,_[_0x5ed0('0x69')](_0x596b4a['logo'])))?path[_0x5ed0('0x6a')](config['root'],_0x479bd8,_[_0x5ed0('0x69')](_0x596b4a[_0x5ed0('0x5b')])):path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x479bd8,_[_0x5ed0('0x69')](_0x5ed0('0x6b')));var _0x14c74e=_0x5ed0('0x6c')+_[_0x5ed0('0x6d')]('logo');if(_0x596b4a[_0x14c74e]||!_0x44dc1e['custom']){_0x436193=path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x479bd8,_['toLower'](_0x5ed0('0x6b')));}if(!fs[_0x5ed0('0x67')](_0x436193)){throw new db[(_0x5ed0('0x1d'))][(_0x5ed0('0x1e'))](_[_0x5ed0('0x6d')](_0x5ed0('0x5b'))+_0x5ed0('0x6e'));}return _0x2d86a1[_0x5ed0('0x6f')](_0x436193);}})[_0x5ed0('0x52')](handleError(_0x2d86a1,null));};var utilLicense=require(_0x5ed0('0x5e'));exports[_0x5ed0('0x70')]=function(_0xae34be,_0xec092d,_0x51e10a){var _0x54973d='server/files/images/logos';var _0x5376f8={'custom':![]};return utilLicense[_0x5ed0('0x61')]()[_0x5ed0('0x20')](function(_0x263c7d){if(_0x263c7d){_0x5376f8=_0x263c7d;}return db['Setting']['find']({'where':{'id':_0xae34be[_0x5ed0('0x57')]['id']},'attributes':['logo',_0x5ed0('0x5d'),_0x5ed0('0x62'),'favicon','defaultLogo',_0x5ed0('0x65'),_0x5ed0('0x66'),_0x5ed0('0x71')],'raw':!![]});})[_0x5ed0('0x20')](handleEntityNotFound(_0xec092d,null))[_0x5ed0('0x20')](function(_0x137537){if(_0x137537){var _0x1d988=_0x137537[_0x5ed0('0x5d')]&&fs['existsSync'](path['join'](config[_0x5ed0('0x68')],_0x54973d,_[_0x5ed0('0x69')](_0x137537[_0x5ed0('0x5d')])))?path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x54973d,_[_0x5ed0('0x69')](_0x137537['loginLogo'])):path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x54973d,_[_0x5ed0('0x69')](_0x5ed0('0x72')));var _0x5f3a19=_0x5ed0('0x6c')+_[_0x5ed0('0x6d')](_0x5ed0('0x5d'));if(_0x137537[_0x5f3a19]||!_0x5376f8['custom']){_0x1d988=path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x54973d,_[_0x5ed0('0x69')](_0x5ed0('0x72')));}if(!fs[_0x5ed0('0x67')](_0x1d988)){throw new db[(_0x5ed0('0x1d'))][(_0x5ed0('0x1e'))](_[_0x5ed0('0x6d')](_0x5ed0('0x5d'))+_0x5ed0('0x6e'));}return _0xec092d[_0x5ed0('0x6f')](_0x1d988);}})[_0x5ed0('0x52')](handleError(_0xec092d,null));};exports[_0x5ed0('0x73')]=function(_0x14a224,_0x5c478b){return db[_0x5ed0('0x39')][_0x5ed0('0x55')]({'where':{'id':_0x14a224[_0x5ed0('0x57')]['id']},'attributes':['securePassword']})[_0x5ed0('0x20')](respondWithResult(_0x5c478b,null))[_0x5ed0('0x52')](handleError(_0x5c478b,null));};exports['addPreferred']=function(_0x360707,_0x2606a9,_0x1c3ccd){if(_0x360707[_0x5ed0('0x59')]&&_0x360707['file']['filename']){_0x360707[_0x5ed0('0x56')][_0x5ed0('0x62')]=_0x360707[_0x5ed0('0x59')][_0x5ed0('0x5a')];}return db[_0x5ed0('0x39')][_0x5ed0('0x55')]({'where':{'id':_0x360707[_0x5ed0('0x57')]['id']}})[_0x5ed0('0x20')](handleEntityNotFound(_0x2606a9,null))['then'](saveUpdates(_0x360707[_0x5ed0('0x56')],null))[_0x5ed0('0x20')](respondWithResult(_0x2606a9,null))['catch'](handleError(_0x2606a9,null));};var utilLicense=require(_0x5ed0('0x5e'));exports[_0x5ed0('0x74')]=function(_0x39a13f,_0x54499f,_0x4d7306){var _0x3b9cdf=_0x5ed0('0x60');var _0x281af2={'custom':![]};return utilLicense[_0x5ed0('0x61')]()[_0x5ed0('0x20')](function(_0x1867db){if(_0x1867db){_0x281af2=_0x1867db;}return db[_0x5ed0('0x39')]['find']({'where':{'id':_0x39a13f[_0x5ed0('0x57')]['id']},'attributes':['logo',_0x5ed0('0x5d'),'preferred',_0x5ed0('0x63'),_0x5ed0('0x64'),_0x5ed0('0x65'),_0x5ed0('0x66'),_0x5ed0('0x71')],'raw':!![]});})[_0x5ed0('0x20')](handleEntityNotFound(_0x54499f,null))['then'](function(_0x3f9124){if(_0x3f9124){var _0x354a6e=_0x3f9124[_0x5ed0('0x62')]&&fs[_0x5ed0('0x67')](path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x3b9cdf,_[_0x5ed0('0x69')](_0x3f9124['preferred'])))?path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x3b9cdf,_[_0x5ed0('0x69')](_0x3f9124['preferred'])):path['join'](config[_0x5ed0('0x68')],_0x3b9cdf,_[_0x5ed0('0x69')](_0x5ed0('0x75')));var _0x5e8707=_0x5ed0('0x6c')+_['upperFirst']('preferred');if(_0x3f9124[_0x5e8707]||!_0x281af2[_0x5ed0('0x76')]||!_0x281af2[_0x5ed0('0x62')]){_0x354a6e=path[_0x5ed0('0x6a')](config['root'],_0x3b9cdf,_[_0x5ed0('0x69')](_0x5ed0('0x75')));}if(!fs[_0x5ed0('0x67')](_0x354a6e)){throw new db[(_0x5ed0('0x1d'))]['ValidationError'](_['upperFirst'](_0x5ed0('0x62'))+_0x5ed0('0x6e'));}return _0x54499f[_0x5ed0('0x6f')](_0x354a6e);}})['catch'](handleError(_0x54499f,null));};exports['addFavicon']=function(_0x3a57f7,_0x296c51,_0x4671c1){if(_0x3a57f7[_0x5ed0('0x59')]&&_0x3a57f7['file'][_0x5ed0('0x5a')]){_0x3a57f7[_0x5ed0('0x56')][_0x5ed0('0x63')]=_0x3a57f7[_0x5ed0('0x59')][_0x5ed0('0x5a')];}return db[_0x5ed0('0x39')][_0x5ed0('0x55')]({'where':{'id':_0x3a57f7['params']['id']}})[_0x5ed0('0x20')](handleEntityNotFound(_0x296c51,null))[_0x5ed0('0x20')](saveUpdates(_0x3a57f7['body'],null))[_0x5ed0('0x20')](respondWithResult(_0x296c51,null))[_0x5ed0('0x52')](handleError(_0x296c51,null));};var utilLicense=require('../../config/license/util');exports[_0x5ed0('0x77')]=function(_0x878c8a,_0xcbd843,_0x18837f){var _0x5275ef=_0x5ed0('0x60');var _0x399d13={'custom':![]};return utilLicense[_0x5ed0('0x61')]()[_0x5ed0('0x20')](function(_0x21cb7e){if(_0x21cb7e){_0x399d13=_0x21cb7e;}return db['Setting'][_0x5ed0('0x55')]({'where':{'id':_0x878c8a[_0x5ed0('0x57')]['id']},'attributes':['logo',_0x5ed0('0x5d'),_0x5ed0('0x62'),_0x5ed0('0x63'),_0x5ed0('0x64'),'defaultLoginLogo',_0x5ed0('0x66'),_0x5ed0('0x71')],'raw':!![]});})[_0x5ed0('0x20')](handleEntityNotFound(_0xcbd843,null))['then'](function(_0x28a5cb){if(_0x28a5cb){var _0x4bd6a6=_0x28a5cb[_0x5ed0('0x63')]&&fs[_0x5ed0('0x67')](path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x5275ef,_[_0x5ed0('0x69')](_0x28a5cb[_0x5ed0('0x63')])))?path[_0x5ed0('0x6a')](config['root'],_0x5275ef,_['toLower'](_0x28a5cb['favicon'])):path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x5275ef,_[_0x5ed0('0x69')](_0x5ed0('0x78')));var _0x27dbdd='default'+_[_0x5ed0('0x6d')](_0x5ed0('0x63'));if(_0x28a5cb[_0x27dbdd]||!_0x399d13[_0x5ed0('0x76')]){_0x4bd6a6=path[_0x5ed0('0x6a')](config[_0x5ed0('0x68')],_0x5275ef,_[_0x5ed0('0x69')](_0x5ed0('0x78')));}if(!fs[_0x5ed0('0x67')](_0x4bd6a6)){throw new db[(_0x5ed0('0x1d'))]['ValidationError'](_[_0x5ed0('0x6d')](_0x5ed0('0x63'))+_0x5ed0('0x6e'));}return _0xcbd843[_0x5ed0('0x6f')](_0x4bd6a6);}})[_0x5ed0('0x52')](handleError(_0xcbd843,null));}; \ No newline at end of file +var _0x4494=['sort','where','filter','merge','type','options','include','findAll','rows','show','params','find','body','file','logo','addLogoLogin','filename','loginLogo','getLogo','getLicense','favicon','defaultLogo','defaultLoginLogo','existsSync','join','root','toLower','default','upperFirst','default_logo.png','ValidationError','download','../../config/license/util','getLogoLogin','server/files/images/logos','preferred','defaultPreferred','defaultFavicon','default_loginLogo.png','custom','Sequelize','gdpr','addPreferred','getPreferred','addFavicon','getFavicon','default_favicon.ico','\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../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','then','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','info','result','catch','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','send','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x4494,0x19b));var _0x4449=function(_0x23f46a,_0x101afb){_0x23f46a=_0x23f46a-0x0;var _0x2458ef=_0x4494[_0x23f46a];return _0x2458ef;};'use strict';var pdf=require(_0x4449('0x0'));var emlformat=require(_0x4449('0x1'));var rimraf=require(_0x4449('0x2'));var zipdir=require(_0x4449('0x3'));var jsonpatch=require(_0x4449('0x4'));var rp=require(_0x4449('0x5'));var moment=require(_0x4449('0x6'));var BPromise=require(_0x4449('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4449('0x8'));var sox=require(_0x4449('0x9'));var csv=require(_0x4449('0xa'));var ejs=require(_0x4449('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4449('0xc'));var crypto=require(_0x4449('0xd'));var jsforce=require(_0x4449('0xe'));var deskjs=require(_0x4449('0xf'));var toCsv=require(_0x4449('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4449('0x10'));var qs=require(_0x4449('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4449('0x12'));var logger=require(_0x4449('0x13'))(_0x4449('0x14'));var utils=require(_0x4449('0x15'));var config=require(_0x4449('0x16'));var db=require(_0x4449('0x17'))['db'];var jayson=require(_0x4449('0x18'));var client=jayson[_0x4449('0x19')][_0x4449('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x50ffd7,_0x2ea56d,_0x5951d5){if(_0x5951d5){var _0x54f24a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54f24a[_0x4449('0x1b')](_0x2ea56d)){return _0x50ffd7;}else{throw new db['Sequelize']['ValidationError'](_0x4449('0x1c'));}}else{return _0x50ffd7;}}function respondWithRpcPromise(_0x1738cd,_0x405f14,_0x586ddd,_0x3b67c9){return new BPromise(function(_0x3f506b,_0x461a40){var _0x56c4c7=_0x3b67c9||client;return _0x56c4c7[_0x4449('0x1d')](_0x1738cd,_0x586ddd)[_0x4449('0x1e')](function(_0x4b62b2){logger['info']('Setting,\x20%s,\x20%s',_0x405f14,_0x4449('0x1f'));logger['debug'](_0x4449('0x20'),_0x405f14,_0x4449('0x1f'),JSON[_0x4449('0x21')](_0x4b62b2));if(_0x4b62b2[_0x4449('0x22')]){if(_0x4b62b2[_0x4449('0x22')]['code']===0x1f4){logger['error'](_0x4449('0x23'),_0x405f14,_0x4b62b2[_0x4449('0x22')]['message']);return _0x461a40(_0x4b62b2[_0x4449('0x22')][_0x4449('0x24')]);}logger[_0x4449('0x22')]('Setting,\x20%s,\x20%s',_0x405f14,_0x4b62b2[_0x4449('0x22')][_0x4449('0x24')]);return _0x3f506b(_0x4b62b2[_0x4449('0x22')][_0x4449('0x24')]);}else{logger[_0x4449('0x25')]('Setting,\x20%s,\x20%s',_0x405f14,_0x4449('0x1f'));_0x3f506b(_0x4b62b2[_0x4449('0x26')][_0x4449('0x24')]);}})[_0x4449('0x27')](function(_0x59e32e){logger[_0x4449('0x22')](_0x4449('0x23'),_0x405f14,_0x59e32e);_0x461a40(_0x59e32e);});});}function respondWithStatusCode(_0x12a61c,_0x1489d1){_0x1489d1=_0x1489d1||0xcc;return function(_0x41e07b){if(_0x41e07b){return _0x12a61c['sendStatus'](_0x1489d1);}return _0x12a61c[_0x4449('0x28')](_0x1489d1)['end']();};}function respondWithResult(_0x410076,_0x535494){_0x535494=_0x535494||0xc8;return function(_0x14bd36){if(_0x14bd36){return _0x410076['status'](_0x535494)['json'](_0x14bd36);}};}function respondWithFilteredResult(_0xe0f4f5,_0xc87a68){return function(_0x33a911){if(_0x33a911){var _0x1c20d0=_0x33a911[_0x4449('0x29')],_0xf02ee6=_0xc87a68[_0x4449('0x2a')],_0x25220f=_0xc87a68[_0x4449('0x2a')]+_0xc87a68[_0x4449('0x2b')],_0x2c25a2;if(_0x25220f>=_0x1c20d0){_0x25220f=_0x1c20d0;_0x2c25a2=0xc8;}else{_0x2c25a2=0xce;}_0xe0f4f5[_0x4449('0x28')](_0x2c25a2);return _0xe0f4f5[_0x4449('0x2c')](_0x4449('0x2d'),_0xf02ee6+'-'+_0x25220f+'/'+_0x1c20d0)[_0x4449('0x2e')](_0x33a911);}return null;};}function patchUpdates(_0x1a680c){return function(_0x4a59c9){try{jsonpatch[_0x4449('0x2f')](_0x4a59c9,_0x1a680c,!![]);}catch(_0x980921){return BPromise[_0x4449('0x30')](_0x980921);}return _0x4a59c9[_0x4449('0x31')]();};}function saveUpdates(_0xba8c4f,_0x213419){return function(_0x262c4b){if(_0x262c4b){return _0x262c4b[_0x4449('0x32')](_0xba8c4f)[_0x4449('0x1e')](function(_0x302072){return _0x302072;});}return null;};}function removeEntity(_0x5f24c7,_0x558442){return function(_0x3cf80e){if(_0x3cf80e){return _0x3cf80e[_0x4449('0x33')]()['then'](function(){_0x5f24c7[_0x4449('0x28')](0xcc)[_0x4449('0x34')]();});}};}function handleEntityNotFound(_0x118b24,_0x502f88){return function(_0x27f736){if(!_0x27f736){_0x118b24['sendStatus'](0x194);}return _0x27f736;};}function handleError(_0x3b8006,_0x18ade3){_0x18ade3=_0x18ade3||0x1f4;return function(_0x430cca){logger[_0x4449('0x22')](_0x430cca[_0x4449('0x35')]);if(_0x430cca[_0x4449('0x36')]){delete _0x430cca[_0x4449('0x36')];}_0x3b8006[_0x4449('0x28')](_0x18ade3)[_0x4449('0x37')](_0x430cca);};}exports[_0x4449('0x38')]=function(_0x2d92f3,_0x277713){var _0x1de0f9={},_0x46a8ef={},_0x128172={'count':0x0,'rows':[]};var _0x81f626=_[_0x4449('0x39')](db[_0x4449('0x3a')][_0x4449('0x3b')],function(_0x11e747){return{'name':_0x11e747[_0x4449('0x3c')],'type':_0x11e747['type'][_0x4449('0x3d')]};});_0x46a8ef[_0x4449('0x3e')]=_['map'](_0x81f626,_0x4449('0x36'));_0x46a8ef[_0x4449('0x3f')]=_[_0x4449('0x40')](_0x2d92f3[_0x4449('0x3f')]);_0x46a8ef[_0x4449('0x41')]=_[_0x4449('0x42')](_0x46a8ef['model'],_0x46a8ef[_0x4449('0x3f')]);_0x1de0f9['attributes']=_[_0x4449('0x42')](_0x46a8ef[_0x4449('0x3e')],qs[_0x4449('0x43')](_0x2d92f3[_0x4449('0x3f')]['fields']));_0x1de0f9[_0x4449('0x44')]=_0x1de0f9[_0x4449('0x44')][_0x4449('0x45')]?_0x1de0f9[_0x4449('0x44')]:_0x46a8ef[_0x4449('0x3e')];if(!_0x2d92f3[_0x4449('0x3f')][_0x4449('0x46')](_0x4449('0x47'))){_0x1de0f9[_0x4449('0x2b')]=qs['limit'](_0x2d92f3['query'][_0x4449('0x2b')]);_0x1de0f9[_0x4449('0x2a')]=qs['offset'](_0x2d92f3[_0x4449('0x3f')][_0x4449('0x2a')]);}_0x1de0f9[_0x4449('0x48')]=qs[_0x4449('0x49')](_0x2d92f3[_0x4449('0x3f')][_0x4449('0x49')]);_0x1de0f9[_0x4449('0x4a')]=qs[_0x4449('0x41')](_['pick'](_0x2d92f3[_0x4449('0x3f')],_0x46a8ef['filters']));if(_0x2d92f3['query'][_0x4449('0x4b')]){_0x1de0f9[_0x4449('0x4a')]=_[_0x4449('0x4c')](_0x1de0f9[_0x4449('0x4a')],{'$or':_['map'](_0x81f626,function(_0x279610){if(_0x279610[_0x4449('0x4d')]!=='VIRTUAL'){var _0x4b9a3b={};_0x4b9a3b[_0x279610['name']]={'$like':'%'+_0x2d92f3[_0x4449('0x3f')][_0x4449('0x4b')]+'%'};return _0x4b9a3b;}})});}_0x1de0f9=_[_0x4449('0x4c')]({},_0x1de0f9,_0x2d92f3[_0x4449('0x4e')]);var _0x5e6f27={'where':_0x1de0f9[_0x4449('0x4a')]};return db['Setting'][_0x4449('0x29')](_0x5e6f27)[_0x4449('0x1e')](function(_0x55f560){_0x128172[_0x4449('0x29')]=_0x55f560;if(_0x2d92f3[_0x4449('0x3f')]['includeAll']){_0x1de0f9[_0x4449('0x4f')]=[{'all':!![]}];}return db['Setting'][_0x4449('0x50')](_0x1de0f9);})[_0x4449('0x1e')](function(_0x2d7406){_0x128172[_0x4449('0x51')]=_0x2d7406;return _0x128172;})[_0x4449('0x1e')](respondWithFilteredResult(_0x277713,_0x1de0f9))[_0x4449('0x27')](handleError(_0x277713,null));};exports[_0x4449('0x52')]=function(_0x9bab58,_0x3da3b2){var _0x36ccd2={'raw':![],'where':{'id':_0x9bab58[_0x4449('0x53')]['id']}},_0x3457d2={};_0x3457d2[_0x4449('0x3e')]=_['keys'](db[_0x4449('0x3a')][_0x4449('0x3b')]);_0x3457d2[_0x4449('0x3f')]=_[_0x4449('0x40')](_0x9bab58[_0x4449('0x3f')]);_0x3457d2[_0x4449('0x41')]=_[_0x4449('0x42')](_0x3457d2[_0x4449('0x3e')],_0x3457d2[_0x4449('0x3f')]);_0x36ccd2['attributes']=_['intersection'](_0x3457d2[_0x4449('0x3e')],qs[_0x4449('0x43')](_0x9bab58[_0x4449('0x3f')][_0x4449('0x43')]));_0x36ccd2['attributes']=_0x36ccd2[_0x4449('0x44')][_0x4449('0x45')]?_0x36ccd2['attributes']:_0x3457d2['model'];if(_0x9bab58['query']['includeAll']){_0x36ccd2['include']=[{'all':!![]}];}_0x36ccd2=_['merge']({},_0x36ccd2,_0x9bab58[_0x4449('0x4e')]);return db[_0x4449('0x3a')][_0x4449('0x54')](_0x36ccd2)[_0x4449('0x1e')](handleEntityNotFound(_0x3da3b2,null))[_0x4449('0x1e')](respondWithResult(_0x3da3b2,null))[_0x4449('0x27')](handleError(_0x3da3b2,null));};exports[_0x4449('0x32')]=function(_0x34c4fd,_0x251f98){if(_0x34c4fd[_0x4449('0x55')]['id']){delete _0x34c4fd[_0x4449('0x55')]['id'];}return db[_0x4449('0x3a')][_0x4449('0x54')]({'where':{'id':_0x34c4fd[_0x4449('0x53')]['id']}})[_0x4449('0x1e')](handleEntityNotFound(_0x251f98,null))[_0x4449('0x1e')](saveUpdates(_0x34c4fd[_0x4449('0x55')],null))['then'](respondWithResult(_0x251f98,null))[_0x4449('0x27')](handleError(_0x251f98,null));};exports['addLogo']=function(_0x316a51,_0x392299,_0xeb9da){if(_0x316a51[_0x4449('0x56')]&&_0x316a51[_0x4449('0x56')]['filename']){_0x316a51[_0x4449('0x55')][_0x4449('0x57')]=_0x316a51[_0x4449('0x56')]['filename'];}return db[_0x4449('0x3a')][_0x4449('0x54')]({'where':{'id':_0x316a51['params']['id']}})[_0x4449('0x1e')](handleEntityNotFound(_0x392299,null))[_0x4449('0x1e')](saveUpdates(_0x316a51[_0x4449('0x55')],null))['then'](respondWithResult(_0x392299,null))[_0x4449('0x27')](handleError(_0x392299,null));};exports[_0x4449('0x58')]=function(_0x5f42f5,_0x4a1e82,_0x2b6ce7){if(_0x5f42f5[_0x4449('0x56')]&&_0x5f42f5[_0x4449('0x56')][_0x4449('0x59')]){_0x5f42f5[_0x4449('0x55')][_0x4449('0x5a')]=_0x5f42f5[_0x4449('0x56')][_0x4449('0x59')];}return db[_0x4449('0x3a')][_0x4449('0x54')]({'where':{'id':_0x5f42f5[_0x4449('0x53')]['id']}})[_0x4449('0x1e')](handleEntityNotFound(_0x4a1e82,null))[_0x4449('0x1e')](saveUpdates(_0x5f42f5[_0x4449('0x55')],null))['then'](respondWithResult(_0x4a1e82,null))[_0x4449('0x27')](handleError(_0x4a1e82,null));};var utilLicense=require('../../config/license/util');exports[_0x4449('0x5b')]=function(_0x289ff7,_0x5edfa3,_0x2c28c6){var _0x11620e='server/files/images/logos';var _0x51a990={'custom':![]};return utilLicense[_0x4449('0x5c')]()[_0x4449('0x1e')](function(_0x59feaa){if(_0x59feaa){_0x51a990=_0x59feaa;}return db[_0x4449('0x3a')]['find']({'where':{'id':_0x289ff7[_0x4449('0x53')]['id']},'attributes':[_0x4449('0x57'),_0x4449('0x5a'),'preferred',_0x4449('0x5d'),_0x4449('0x5e'),_0x4449('0x5f'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x4449('0x1e')](handleEntityNotFound(_0x5edfa3,null))[_0x4449('0x1e')](function(_0x4c7b93){if(_0x4c7b93){var _0x2709dc=_0x4c7b93['logo']&&fs[_0x4449('0x60')](path[_0x4449('0x61')](config[_0x4449('0x62')],_0x11620e,_[_0x4449('0x63')](_0x4c7b93[_0x4449('0x57')])))?path[_0x4449('0x61')](config[_0x4449('0x62')],_0x11620e,_[_0x4449('0x63')](_0x4c7b93[_0x4449('0x57')])):path[_0x4449('0x61')](config[_0x4449('0x62')],_0x11620e,_['toLower']('default_logo.png'));var _0x2de1df=_0x4449('0x64')+_[_0x4449('0x65')](_0x4449('0x57'));if(_0x4c7b93[_0x2de1df]||!_0x51a990['custom']){_0x2709dc=path[_0x4449('0x61')](config['root'],_0x11620e,_[_0x4449('0x63')](_0x4449('0x66')));}if(!fs[_0x4449('0x60')](_0x2709dc)){throw new db['Sequelize'][(_0x4449('0x67'))](_[_0x4449('0x65')](_0x4449('0x57'))+'\x20not\x20found');}return _0x5edfa3[_0x4449('0x68')](_0x2709dc);}})[_0x4449('0x27')](handleError(_0x5edfa3,null));};var utilLicense=require(_0x4449('0x69'));exports[_0x4449('0x6a')]=function(_0x45e9f7,_0x4ba379,_0x5cd55a){var _0x5e13c9=_0x4449('0x6b');var _0x2ceaa8={'custom':![]};return utilLicense[_0x4449('0x5c')]()[_0x4449('0x1e')](function(_0x91917){if(_0x91917){_0x2ceaa8=_0x91917;}return db['Setting'][_0x4449('0x54')]({'where':{'id':_0x45e9f7[_0x4449('0x53')]['id']},'attributes':[_0x4449('0x57'),_0x4449('0x5a'),_0x4449('0x6c'),_0x4449('0x5d'),_0x4449('0x5e'),_0x4449('0x5f'),_0x4449('0x6d'),_0x4449('0x6e')],'raw':!![]});})[_0x4449('0x1e')](handleEntityNotFound(_0x4ba379,null))[_0x4449('0x1e')](function(_0x569acb){if(_0x569acb){var _0x2baf37=_0x569acb[_0x4449('0x5a')]&&fs[_0x4449('0x60')](path[_0x4449('0x61')](config[_0x4449('0x62')],_0x5e13c9,_[_0x4449('0x63')](_0x569acb[_0x4449('0x5a')])))?path[_0x4449('0x61')](config[_0x4449('0x62')],_0x5e13c9,_[_0x4449('0x63')](_0x569acb[_0x4449('0x5a')])):path[_0x4449('0x61')](config[_0x4449('0x62')],_0x5e13c9,_[_0x4449('0x63')](_0x4449('0x6f')));var _0x43b0c3='default'+_[_0x4449('0x65')]('loginLogo');if(_0x569acb[_0x43b0c3]||!_0x2ceaa8[_0x4449('0x70')]){_0x2baf37=path['join'](config[_0x4449('0x62')],_0x5e13c9,_[_0x4449('0x63')](_0x4449('0x6f')));}if(!fs[_0x4449('0x60')](_0x2baf37)){throw new db[(_0x4449('0x71'))][(_0x4449('0x67'))](_[_0x4449('0x65')](_0x4449('0x5a'))+'\x20not\x20found');}return _0x4ba379[_0x4449('0x68')](_0x2baf37);}})[_0x4449('0x27')](handleError(_0x4ba379,null));};exports[_0x4449('0x72')]=function(_0x54128e,_0x5566ce){return db[_0x4449('0x3a')][_0x4449('0x54')]({'where':{'id':_0x54128e[_0x4449('0x53')]['id']},'attributes':['securePassword']})[_0x4449('0x1e')](respondWithResult(_0x5566ce,null))['catch'](handleError(_0x5566ce,null));};exports[_0x4449('0x73')]=function(_0x5ca5d6,_0x315b15,_0x761e1){if(_0x5ca5d6[_0x4449('0x56')]&&_0x5ca5d6[_0x4449('0x56')][_0x4449('0x59')]){_0x5ca5d6[_0x4449('0x55')][_0x4449('0x6c')]=_0x5ca5d6[_0x4449('0x56')][_0x4449('0x59')];}return db[_0x4449('0x3a')]['find']({'where':{'id':_0x5ca5d6[_0x4449('0x53')]['id']}})[_0x4449('0x1e')](handleEntityNotFound(_0x315b15,null))[_0x4449('0x1e')](saveUpdates(_0x5ca5d6[_0x4449('0x55')],null))['then'](respondWithResult(_0x315b15,null))['catch'](handleError(_0x315b15,null));};var utilLicense=require(_0x4449('0x69'));exports[_0x4449('0x74')]=function(_0x235af7,_0x11232a,_0x28ff0c){var _0x5db0f9=_0x4449('0x6b');var _0x3565fe={'custom':![]};return utilLicense[_0x4449('0x5c')]()[_0x4449('0x1e')](function(_0x3fa880){if(_0x3fa880){_0x3565fe=_0x3fa880;}return db[_0x4449('0x3a')][_0x4449('0x54')]({'where':{'id':_0x235af7[_0x4449('0x53')]['id']},'attributes':[_0x4449('0x57'),'loginLogo',_0x4449('0x6c'),_0x4449('0x5d'),_0x4449('0x5e'),'defaultLoginLogo',_0x4449('0x6d'),_0x4449('0x6e')],'raw':!![]});})[_0x4449('0x1e')](handleEntityNotFound(_0x11232a,null))[_0x4449('0x1e')](function(_0xdffd61){if(_0xdffd61){var _0x509e17=_0xdffd61[_0x4449('0x6c')]&&fs[_0x4449('0x60')](path['join'](config[_0x4449('0x62')],_0x5db0f9,_[_0x4449('0x63')](_0xdffd61[_0x4449('0x6c')])))?path[_0x4449('0x61')](config[_0x4449('0x62')],_0x5db0f9,_[_0x4449('0x63')](_0xdffd61['preferred'])):path[_0x4449('0x61')](config['root'],_0x5db0f9,_['toLower']('default_preferred.png'));var _0xf87336=_0x4449('0x64')+_['upperFirst'](_0x4449('0x6c'));if(_0xdffd61[_0xf87336]||!_0x3565fe[_0x4449('0x70')]||!_0x3565fe[_0x4449('0x6c')]){_0x509e17=path[_0x4449('0x61')](config[_0x4449('0x62')],_0x5db0f9,_[_0x4449('0x63')]('default_preferred.png'));}if(!fs[_0x4449('0x60')](_0x509e17)){throw new db[(_0x4449('0x71'))][(_0x4449('0x67'))](_[_0x4449('0x65')](_0x4449('0x6c'))+'\x20not\x20found');}return _0x11232a['download'](_0x509e17);}})[_0x4449('0x27')](handleError(_0x11232a,null));};exports[_0x4449('0x75')]=function(_0x879541,_0x277449,_0x1dbea8){if(_0x879541[_0x4449('0x56')]&&_0x879541[_0x4449('0x56')][_0x4449('0x59')]){_0x879541[_0x4449('0x55')]['favicon']=_0x879541[_0x4449('0x56')][_0x4449('0x59')];}return db[_0x4449('0x3a')][_0x4449('0x54')]({'where':{'id':_0x879541['params']['id']}})[_0x4449('0x1e')](handleEntityNotFound(_0x277449,null))[_0x4449('0x1e')](saveUpdates(_0x879541['body'],null))[_0x4449('0x1e')](respondWithResult(_0x277449,null))['catch'](handleError(_0x277449,null));};var utilLicense=require(_0x4449('0x69'));exports[_0x4449('0x76')]=function(_0x315822,_0x5e230b,_0x441c19){var _0x1d6967=_0x4449('0x6b');var _0x1c53e3={'custom':![]};return utilLicense['getLicense']()[_0x4449('0x1e')](function(_0x42b87c){if(_0x42b87c){_0x1c53e3=_0x42b87c;}return db[_0x4449('0x3a')]['find']({'where':{'id':_0x315822[_0x4449('0x53')]['id']},'attributes':[_0x4449('0x57'),_0x4449('0x5a'),'preferred',_0x4449('0x5d'),'defaultLogo',_0x4449('0x5f'),_0x4449('0x6d'),_0x4449('0x6e')],'raw':!![]});})[_0x4449('0x1e')](handleEntityNotFound(_0x5e230b,null))['then'](function(_0x2f0d7e){if(_0x2f0d7e){var _0x1c2868=_0x2f0d7e['favicon']&&fs[_0x4449('0x60')](path[_0x4449('0x61')](config[_0x4449('0x62')],_0x1d6967,_['toLower'](_0x2f0d7e['favicon'])))?path[_0x4449('0x61')](config[_0x4449('0x62')],_0x1d6967,_[_0x4449('0x63')](_0x2f0d7e[_0x4449('0x5d')])):path[_0x4449('0x61')](config[_0x4449('0x62')],_0x1d6967,_[_0x4449('0x63')](_0x4449('0x77')));var _0x40b2fc=_0x4449('0x64')+_[_0x4449('0x65')](_0x4449('0x5d'));if(_0x2f0d7e[_0x40b2fc]||!_0x1c53e3[_0x4449('0x70')]){_0x1c2868=path[_0x4449('0x61')](config[_0x4449('0x62')],_0x1d6967,_[_0x4449('0x63')](_0x4449('0x77')));}if(!fs['existsSync'](_0x1c2868)){throw new db['Sequelize'][(_0x4449('0x67'))](_['upperFirst'](_0x4449('0x5d'))+_0x4449('0x78'));}return _0x5e230b[_0x4449('0x68')](_0x1c2868);}})[_0x4449('0x27')](handleError(_0x5e230b,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b0b8877..7cd0ff7 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 _0x49cc=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./setting.attributes','settings'];(function(_0x34e830,_0x3c3620){var _0x462e4b=function(_0x113845){while(--_0x113845){_0x34e830['push'](_0x34e830['shift']());}};_0x462e4b(++_0x3c3620);}(_0x49cc,0x17a));var _0xc49c=function(_0x45da57,_0x1a5b15){_0x45da57=_0x45da57-0x0;var _0x173251=_0x49cc[_0x45da57];return _0x173251;};'use strict';var _=require(_0xc49c('0x0'));var util=require(_0xc49c('0x1'));var logger=require(_0xc49c('0x2'))(_0xc49c('0x3'));var moment=require(_0xc49c('0x4'));var BPromise=require(_0xc49c('0x5'));var rp=require(_0xc49c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc49c('0x7'));module['exports']=function(_0x5ba534,_0x2d52fa){return _0x5ba534['define']('Setting',attributes,{'tableName':_0xc49c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32b1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','define','Setting','settings','../../config/logger','api'];(function(_0x38b2d9,_0x19fd42){var _0x23a3e1=function(_0xd8192f){while(--_0xd8192f){_0x38b2d9['push'](_0x38b2d9['shift']());}};_0x23a3e1(++_0x19fd42);}(_0x32b1,0x1d2));var _0x132b=function(_0x904b82,_0x24786f){_0x904b82=_0x904b82-0x0;var _0x1e072d=_0x32b1[_0x904b82];return _0x1e072d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x132b('0x0'))(_0x132b('0x1'));var moment=require(_0x132b('0x2'));var BPromise=require(_0x132b('0x3'));var rp=require(_0x132b('0x4'));var fs=require('fs');var path=require(_0x132b('0x5'));var rimraf=require(_0x132b('0x6'));var config=require(_0x132b('0x7'));var attributes=require(_0x132b('0x8'));module['exports']=function(_0x10508a,_0x4d731c){return _0x10508a[_0x132b('0x9')](_0x132b('0xa'),attributes,{'tableName':_0x132b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 487724a..9b5cf96 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 _0x203a=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x203a,0x1ef));var _0xa203=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x203a[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xa203('0x0'));var util=require(_0xa203('0x1'));var moment=require(_0xa203('0x2'));var BPromise=require(_0xa203('0x3'));var rs=require(_0xa203('0x4'));var fs=require('fs');var Redis=require(_0xa203('0x5'));var db=require(_0xa203('0x6'))['db'];var utils=require(_0xa203('0x7'));var logger=require('../../config/logger')(_0xa203('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa203('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x796582,_0xe3f246,_0xf8cbef){return new BPromise(function(_0x3f1894,_0x438c0c){return client['request'](_0x796582,_0xf8cbef)[_0xa203('0xa')](function(_0x4c7278){logger[_0xa203('0xb')](_0xa203('0xc'),_0xe3f246,'request\x20sent');logger['debug'](_0xa203('0xd'),_0xe3f246,_0xa203('0xe'),JSON['stringify'](_0x4c7278));if(_0x4c7278[_0xa203('0xf')]){if(_0x4c7278[_0xa203('0xf')]['code']===0x1f4){logger[_0xa203('0xf')](_0xa203('0xc'),_0xe3f246,_0x4c7278[_0xa203('0xf')][_0xa203('0x10')]);return _0x438c0c(_0x4c7278[_0xa203('0xf')][_0xa203('0x10')]);}logger['error'](_0xa203('0xc'),_0xe3f246,_0x4c7278['error'][_0xa203('0x10')]);return _0x3f1894(_0x4c7278[_0xa203('0xf')][_0xa203('0x10')]);}else{logger['info'](_0xa203('0xc'),_0xe3f246,_0xa203('0xe'));_0x3f1894(_0x4c7278[_0xa203('0x11')][_0xa203('0x10')]);}})[_0xa203('0x12')](function(_0x5157c2){logger[_0xa203('0xf')](_0xa203('0xc'),_0xe3f246,_0x5157c2);_0x438c0c(_0x5157c2);});});} \ No newline at end of file +var _0xb988=['error','code','Setting,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','stringify'];(function(_0x21fc96,_0x2df0fe){var _0x2e00b0=function(_0x439cde){while(--_0x439cde){_0x21fc96['push'](_0x21fc96['shift']());}};_0x2e00b0(++_0x2df0fe);}(_0xb988,0x1bf));var _0x8b98=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb988[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x8b98('0x0'));var moment=require(_0x8b98('0x1'));var BPromise=require(_0x8b98('0x2'));var rs=require(_0x8b98('0x3'));var fs=require('fs');var Redis=require(_0x8b98('0x4'));var db=require(_0x8b98('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b98('0x6'))(_0x8b98('0x7'));var config=require(_0x8b98('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b98('0x9')][_0x8b98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cc098,_0x22dcaf,_0x54d67c){return new BPromise(function(_0x2d5249,_0x506d36){return client[_0x8b98('0xb')](_0x2cc098,_0x54d67c)['then'](function(_0x2b9405){logger[_0x8b98('0xc')]('Setting,\x20%s,\x20%s',_0x22dcaf,_0x8b98('0xd'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x22dcaf,_0x8b98('0xd'),JSON[_0x8b98('0xe')](_0x2b9405));if(_0x2b9405[_0x8b98('0xf')]){if(_0x2b9405['error'][_0x8b98('0x10')]===0x1f4){logger[_0x8b98('0xf')](_0x8b98('0x11'),_0x22dcaf,_0x2b9405[_0x8b98('0xf')][_0x8b98('0x12')]);return _0x506d36(_0x2b9405[_0x8b98('0xf')][_0x8b98('0x12')]);}logger[_0x8b98('0xf')]('Setting,\x20%s,\x20%s',_0x22dcaf,_0x2b9405[_0x8b98('0xf')][_0x8b98('0x12')]);return _0x2d5249(_0x2b9405[_0x8b98('0xf')]['message']);}else{logger[_0x8b98('0xc')](_0x8b98('0x11'),_0x22dcaf,'request\x20sent');_0x2d5249(_0x2b9405[_0x8b98('0x13')][_0x8b98('0x12')]);}})[_0x8b98('0x14')](function(_0x107d13){logger['error'](_0x8b98('0x11'),_0x22dcaf,_0x107d13);_0x506d36(_0x107d13);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 03a2d7d..815e4f1 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 _0xe95b=['post','create','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','/:id/status','status','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','getAgents'];(function(_0x116817,_0x581838){var _0x3f5a79=function(_0x25494f){while(--_0x25494f){_0x116817['push'](_0x116817['shift']());}};_0x3f5a79(++_0x581838);}(_0xe95b,0x107));var _0xbe95=function(_0x4ff3bf,_0x14651f){_0x4ff3bf=_0x4ff3bf-0x0;var _0x52af55=_0xe95b[_0x4ff3bf];return _0x52af55;};'use strict';var multer=require(_0xbe95('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbe95('0x1'));var express=require(_0xbe95('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbe95('0x3'));var config=require(_0xbe95('0x4'));var controller=require('./smsAccount.controller');router[_0xbe95('0x5')]('/',auth[_0xbe95('0x6')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xbe95('0x7')]);router[_0xbe95('0x5')](_0xbe95('0x8'),auth[_0xbe95('0x6')](),controller[_0xbe95('0x9')]);router[_0xbe95('0x5')](_0xbe95('0xa'),auth[_0xbe95('0x6')](),controller[_0xbe95('0xb')]);router['get'](_0xbe95('0xc'),auth[_0xbe95('0x6')](),controller['getAnswers']);router[_0xbe95('0x5')](_0xbe95('0xd'),auth[_0xbe95('0x6')](),controller[_0xbe95('0xe')]);router[_0xbe95('0x5')]('/:id/interactions',auth[_0xbe95('0x6')](),controller[_0xbe95('0xf')]);router[_0xbe95('0x5')]('/:id/status',controller['statusGet']);router[_0xbe95('0x5')]('/:id/users',auth[_0xbe95('0x6')](),controller[_0xbe95('0x10')]);router[_0xbe95('0x11')]('/',auth[_0xbe95('0x6')](),controller[_0xbe95('0x12')]);router[_0xbe95('0x11')](_0xbe95('0xa'),auth[_0xbe95('0x6')](),controller['addDisposition']);router[_0xbe95('0x11')](_0xbe95('0xc'),auth['isAuthenticated'](),controller[_0xbe95('0x13')]);router[_0xbe95('0x11')](_0xbe95('0x14'),controller[_0xbe95('0x15')]);router[_0xbe95('0x11')]('/:id/applications',auth[_0xbe95('0x6')](),controller[_0xbe95('0x16')]);router[_0xbe95('0x11')](_0xbe95('0x17'),auth[_0xbe95('0x6')](),controller[_0xbe95('0x18')]);router[_0xbe95('0x11')](_0xbe95('0x19'),controller[_0xbe95('0x1a')]);router[_0xbe95('0x11')]('/:id/users',auth[_0xbe95('0x6')](),controller['addAgents']);router['put']('/:id',auth[_0xbe95('0x6')](),controller[_0xbe95('0x1b')]);router[_0xbe95('0x1c')](_0xbe95('0x8'),auth[_0xbe95('0x6')](),controller[_0xbe95('0x1d')]);router[_0xbe95('0x1c')](_0xbe95('0xa'),auth['isAuthenticated'](),controller[_0xbe95('0x1e')]);router[_0xbe95('0x1c')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xbe95('0x1f')]);router['delete'](_0xbe95('0x20'),auth['isAuthenticated'](),controller[_0xbe95('0x21')]);module[_0xbe95('0x22')]=router; \ No newline at end of file +var _0x83a0=['describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','create','post','addDisposition','/:id/notify','addApplications','/:id/send','send','status','addAgents','put','update','delete','removeAnswers','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x83a0,0x86));var _0x083a=function(_0x90eab0,_0x343ea2){_0x90eab0=_0x90eab0-0x0;var _0x21e6c2=_0x83a0[_0x90eab0];return _0x21e6c2;};'use strict';var multer=require(_0x083a('0x0'));var util=require(_0x083a('0x1'));var path=require('path');var timeout=require(_0x083a('0x2'));var express=require(_0x083a('0x3'));var router=express[_0x083a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x083a('0x5'));var config=require(_0x083a('0x6'));var controller=require('./smsAccount.controller');router[_0x083a('0x7')]('/',auth['isAuthenticated'](),controller[_0x083a('0x8')]);router[_0x083a('0x7')]('/describe',auth[_0x083a('0x9')](),controller[_0x083a('0xa')]);router[_0x083a('0x7')](_0x083a('0xb'),auth[_0x083a('0x9')](),controller['show']);router['get'](_0x083a('0xc'),auth[_0x083a('0x9')](),controller['getDispositions']);router[_0x083a('0x7')](_0x083a('0xd'),auth[_0x083a('0x9')](),controller['getAnswers']);router[_0x083a('0x7')](_0x083a('0xe'),auth['isAuthenticated'](),controller['getApplications']);router[_0x083a('0x7')](_0x083a('0xf'),auth[_0x083a('0x9')](),controller[_0x083a('0x10')]);router[_0x083a('0x7')](_0x083a('0x11'),controller[_0x083a('0x12')]);router[_0x083a('0x7')]('/:id/users',auth[_0x083a('0x9')](),controller[_0x083a('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x083a('0x14')]);router[_0x083a('0x15')](_0x083a('0xc'),auth[_0x083a('0x9')](),controller[_0x083a('0x16')]);router['post'](_0x083a('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x083a('0x15')](_0x083a('0x17'),controller['notify']);router[_0x083a('0x15')](_0x083a('0xe'),auth[_0x083a('0x9')](),controller[_0x083a('0x18')]);router[_0x083a('0x15')](_0x083a('0x19'),auth[_0x083a('0x9')](),controller[_0x083a('0x1a')]);router[_0x083a('0x15')](_0x083a('0x11'),controller[_0x083a('0x1b')]);router[_0x083a('0x15')]('/:id/users',auth[_0x083a('0x9')](),controller[_0x083a('0x1c')]);router[_0x083a('0x1d')](_0x083a('0xb'),auth['isAuthenticated'](),controller[_0x083a('0x1e')]);router[_0x083a('0x1f')](_0x083a('0xb'),auth[_0x083a('0x9')](),controller['destroy']);router[_0x083a('0x1f')](_0x083a('0xc'),auth[_0x083a('0x9')](),controller['removeDispositions']);router[_0x083a('0x1f')]('/:id/canned_answers',auth[_0x083a('0x9')](),controller[_0x083a('0x20')]);router[_0x083a('0x1f')](_0x083a('0x21'),auth['isAuthenticated'](),controller[_0x083a('0x22')]);module[_0x083a('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 7df7a65..1ff28b1 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 _0x6790=['STRING','name','generate','ENUM','skebby','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x513483,_0x105ccd){var _0x384a1e=function(_0x47bb41){while(--_0x47bb41){_0x513483['push'](_0x513483['shift']());}};_0x384a1e(++_0x105ccd);}(_0x6790,0x152));var _0x0679=function(_0x20a485,_0x1ea89d){_0x20a485=_0x20a485-0x0;var _0xfc4650=_0x6790[_0x20a485];return _0xfc4650;};'use strict';var Sequelize=require(_0x0679('0x0'));var rs=require('randomstring');module[_0x0679('0x1')]={'name':{'type':Sequelize[_0x0679('0x2')],'unique':_0x0679('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x0679('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x0679('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x0679('0x2')],'defaultValue':function(){return rs[_0x0679('0x4')]();}},'phone':{'type':Sequelize[_0x0679('0x2')]},'type':{'type':Sequelize[_0x0679('0x5')]('twilio',_0x0679('0x6'),'connectel','clicksend','plivo',_0x0679('0x7'),_0x0679('0x8'),_0x0679('0x9'),_0x0679('0xa'))},'accountSid':{'type':Sequelize[_0x0679('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x0679('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x0679('0x2')]},'senderString':{'type':Sequelize[_0x0679('0x2')]},'deliveryReport':{'type':Sequelize[_0x0679('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x0679('0x2')]},'notificationTemplate':{'type':Sequelize[_0x0679('0xc')],'defaultValue':function(){return _0x0679('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0679('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0679('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0679('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0679('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0679('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0679('0xe')],'comment':_0x0679('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x0679('0xb')],'defaultValue':![],'comment':_0x0679('0x10'),'set':function(_0x59adc1){if(!_0x59adc1)this[_0x0679('0x11')](_0x0679('0x12'),null);this[_0x0679('0x11')](_0x0679('0x13'),_0x59adc1);}}}; \ No newline at end of file +var _0xa1db=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio','connectel','clicksend','clickatell','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'];(function(_0x2d8057,_0x1f8584){var _0x39f4b3=function(_0x2fe281){while(--_0x2fe281){_0x2d8057['push'](_0x2d8057['shift']());}};_0x39f4b3(++_0x1f8584);}(_0xa1db,0x15a));var _0xba1d=function(_0x40bcf9,_0x409033){_0x40bcf9=_0x40bcf9-0x0;var _0x10ab13=_0xa1db[_0x40bcf9];return _0x10ab13;};'use strict';var Sequelize=require(_0xba1d('0x0'));var rs=require('randomstring');module[_0xba1d('0x1')]={'name':{'type':Sequelize[_0xba1d('0x2')],'unique':_0xba1d('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xba1d('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xba1d('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xba1d('0x2')],'defaultValue':function(){return rs[_0xba1d('0x4')]();}},'phone':{'type':Sequelize[_0xba1d('0x2')]},'type':{'type':Sequelize[_0xba1d('0x5')](_0xba1d('0x6'),'skebby',_0xba1d('0x7'),_0xba1d('0x8'),'plivo',_0xba1d('0x9'),'csc','infobip',_0xba1d('0xa'))},'accountSid':{'type':Sequelize[_0xba1d('0x2')]},'authId':{'type':Sequelize[_0xba1d('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xba1d('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xba1d('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xba1d('0x2')]},'senderString':{'type':Sequelize[_0xba1d('0x2')]},'deliveryReport':{'type':Sequelize[_0xba1d('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xba1d('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xba1d('0xc');}},'notificationSound':{'type':Sequelize[_0xba1d('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xba1d('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xba1d('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xba1d('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xba1d('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xba1d('0xd')],'comment':_0xba1d('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xba1d('0xb')],'defaultValue':![],'comment':_0xba1d('0xf'),'set':function(_0x4c2eab){if(!_0x4c2eab)this[_0xba1d('0x10')](_0xba1d('0x11'),null);this['setDataValue'](_0xba1d('0x12'),_0x4c2eab);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index bf26ffc..617d9ea 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 _0xd5fc=['count','offset','limit','status','set','Content-Range','apply','save','update','destroy','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','body','params','describe','addDisposition','SmsAccountId','getDispositions','Disposition','pick','findAll','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','notify','sms','Applications','account','applications','orderBy','priority','asc','CmContact','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','MessageSid','skebby','sender','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','results','text','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','sequelize','transaction','SmsApplication','getApplications','getInteractions','Contact','User','internal','Tags','color','tag','to\x20is\x20mandatory','List','SmsMessage','Messages','dataValues','push','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','infobip','groupName','DELIVERED','error_code','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SmsAccount,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch','sendStatus','end','json'];(function(_0x38da51,_0x5afe64){var _0x2397c3=function(_0x403eea){while(--_0x403eea){_0x38da51['push'](_0x38da51['shift']());}};_0x2397c3(++_0x5afe64);}(_0xd5fc,0xae));var _0xcd5f=function(_0x269ab7,_0x1190c0){_0x269ab7=_0x269ab7-0x0;var _0x430d30=_0xd5fc[_0x269ab7];return _0x430d30;};'use strict';var pdf=require(_0xcd5f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcd5f('0x1'));var rp=require(_0xcd5f('0x2'));var moment=require(_0xcd5f('0x3'));var BPromise=require(_0xcd5f('0x4'));var Mustache=require(_0xcd5f('0x5'));var util=require(_0xcd5f('0x6'));var path=require('path');var sox=require(_0xcd5f('0x7'));var csv=require('to-csv');var ejs=require(_0xcd5f('0x8'));var fs=require('fs');var _=require(_0xcd5f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcd5f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xcd5f('0xb'));var Papa=require(_0xcd5f('0xc'));var Redis=require('ioredis');var authService=require(_0xcd5f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcd5f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd5f('0xf'))(_0xcd5f('0x10'));var utils=require(_0xcd5f('0x11'));var config=require(_0xcd5f('0x12'));var db=require('../../mysqldb')['db'];config[_0xcd5f('0x13')]=_[_0xcd5f('0x14')](config['redis'],{'host':_0xcd5f('0x15'),'port':0x18eb});var socket=require(_0xcd5f('0x16'))(new Redis(config[_0xcd5f('0x13')]));require(_0xcd5f('0x17'))[_0xcd5f('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcd5f('0x19')][_0xcd5f('0x1a')]({'port':0x232c});function checkPasswordPattern(_0xc088a3,_0x4242db,_0x18581d){if(_0x18581d){var _0xb4503d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb4503d[_0xcd5f('0x1b')](_0x4242db)){return _0xc088a3;}else{throw new db['Sequelize'][(_0xcd5f('0x1c'))](_0xcd5f('0x1d'));}}else{return _0xc088a3;}}function respondWithRpcPromise(_0x4174d9,_0x14da31,_0x566200,_0x1a4cb6){return new BPromise(function(_0x56a874,_0xb23761){var _0x36c60c=_0x1a4cb6||client;return _0x36c60c['request'](_0x4174d9,_0x566200)[_0xcd5f('0x1e')](function(_0x2e8fde){logger['info'](_0xcd5f('0x1f'),_0x14da31,'request\x20sent');logger[_0xcd5f('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x14da31,'request\x20sent',JSON[_0xcd5f('0x21')](_0x2e8fde));if(_0x2e8fde['error']){if(_0x2e8fde['error']['code']===0x1f4){logger[_0xcd5f('0x22')]('SmsAccount,\x20%s,\x20%s',_0x14da31,_0x2e8fde[_0xcd5f('0x22')][_0xcd5f('0x23')]);return _0xb23761(_0x2e8fde[_0xcd5f('0x22')][_0xcd5f('0x23')]);}logger[_0xcd5f('0x22')]('SmsAccount,\x20%s,\x20%s',_0x14da31,_0x2e8fde[_0xcd5f('0x22')][_0xcd5f('0x23')]);return _0x56a874(_0x2e8fde[_0xcd5f('0x22')][_0xcd5f('0x23')]);}else{logger[_0xcd5f('0x24')](_0xcd5f('0x1f'),_0x14da31,_0xcd5f('0x25'));_0x56a874(_0x2e8fde[_0xcd5f('0x26')][_0xcd5f('0x23')]);}})[_0xcd5f('0x27')](function(_0x41f682){logger[_0xcd5f('0x22')](_0xcd5f('0x1f'),_0x14da31,_0x41f682);_0xb23761(_0x41f682);});});}function respondWithStatusCode(_0x36d100,_0x237331){_0x237331=_0x237331||0xcc;return function(_0x1051c3){if(_0x1051c3){return _0x36d100[_0xcd5f('0x28')](_0x237331);}return _0x36d100['status'](_0x237331)[_0xcd5f('0x29')]();};}function respondWithResult(_0x3ae2f1,_0x561414){_0x561414=_0x561414||0xc8;return function(_0xd7f50f){if(_0xd7f50f){return _0x3ae2f1['status'](_0x561414)[_0xcd5f('0x2a')](_0xd7f50f);}};}function respondWithFilteredResult(_0x139b5a,_0xcb88b8){return function(_0xd3bf23){if(_0xd3bf23){var _0xb56143=_0xd3bf23[_0xcd5f('0x2b')],_0x22e87e=_0xcb88b8[_0xcd5f('0x2c')],_0x57e5cf=_0xcb88b8[_0xcd5f('0x2c')]+_0xcb88b8[_0xcd5f('0x2d')],_0x5955bb;if(_0x57e5cf>=_0xb56143){_0x57e5cf=_0xb56143;_0x5955bb=0xc8;}else{_0x5955bb=0xce;}_0x139b5a[_0xcd5f('0x2e')](_0x5955bb);return _0x139b5a[_0xcd5f('0x2f')](_0xcd5f('0x30'),_0x22e87e+'-'+_0x57e5cf+'/'+_0xb56143)['json'](_0xd3bf23);}return null;};}function patchUpdates(_0x4237db){return function(_0x28f65a){try{jsonpatch[_0xcd5f('0x31')](_0x28f65a,_0x4237db,!![]);}catch(_0x4742d4){return BPromise['reject'](_0x4742d4);}return _0x28f65a[_0xcd5f('0x32')]();};}function saveUpdates(_0x37ee12,_0x30c60b){return function(_0x5ea824){if(_0x5ea824){return _0x5ea824[_0xcd5f('0x33')](_0x37ee12)[_0xcd5f('0x1e')](function(_0x362bf7){return _0x362bf7;});}return null;};}function removeEntity(_0x177f14,_0xc6673b){return function(_0x391bd2){if(_0x391bd2){return _0x391bd2[_0xcd5f('0x34')]()[_0xcd5f('0x1e')](function(){var _0x5dff3a=_0x391bd2['get']({'plain':!![]});var _0x440706='SmsAccounts';return db[_0xcd5f('0x35')][_0xcd5f('0x34')]({'where':{'type':_0x440706,'resourceId':_0x5dff3a['id']}})[_0xcd5f('0x1e')](function(){return _0x391bd2;});})['then'](function(){_0x177f14[_0xcd5f('0x2e')](0xcc)[_0xcd5f('0x29')]();});}};}function handleEntityNotFound(_0x368a41,_0x285d97){return function(_0x4b5713){if(!_0x4b5713){_0x368a41[_0xcd5f('0x28')](0x194);}return _0x4b5713;};}function handleError(_0x505dfa,_0x2b6523){_0x2b6523=_0x2b6523||0x1f4;return function(_0x3ebe00){logger[_0xcd5f('0x22')](_0x3ebe00[_0xcd5f('0x36')]);if(_0x3ebe00[_0xcd5f('0x37')]){delete _0x3ebe00[_0xcd5f('0x37')];}_0x505dfa['status'](_0x2b6523)[_0xcd5f('0x38')](_0x3ebe00);};}exports['index']=function(_0x162eac,_0x6b5174){var _0x5bc9a3={'include':[{'model':db[_0xcd5f('0x39')],'as':_0xcd5f('0x3a')}]},_0x51a12e={},_0x38c7c2={'count':0x0,'rows':[]};var _0x118881=_[_0xcd5f('0x3b')](db[_0xcd5f('0x3c')][_0xcd5f('0x3d')],function(_0x4e2474){return{'name':_0x4e2474[_0xcd5f('0x3e')],'type':_0x4e2474[_0xcd5f('0x3f')][_0xcd5f('0x40')]};});_0x51a12e['model']=_['map'](_0x118881,_0xcd5f('0x37'));_0x51a12e['query']=_[_0xcd5f('0x41')](_0x162eac[_0xcd5f('0x42')]);_0x51a12e[_0xcd5f('0x43')]=_[_0xcd5f('0x44')](_0x51a12e['model'],_0x51a12e[_0xcd5f('0x42')]);_0x5bc9a3['attributes']=_[_0xcd5f('0x44')](_0x51a12e[_0xcd5f('0x45')],qs[_0xcd5f('0x46')](_0x162eac['query'][_0xcd5f('0x46')]));_0x5bc9a3[_0xcd5f('0x47')]=_0x5bc9a3[_0xcd5f('0x47')][_0xcd5f('0x48')]?_0x5bc9a3[_0xcd5f('0x47')]:_0x51a12e[_0xcd5f('0x45')];if(!_0x162eac[_0xcd5f('0x42')][_0xcd5f('0x49')](_0xcd5f('0x4a'))){_0x5bc9a3[_0xcd5f('0x2d')]=qs['limit'](_0x162eac['query'][_0xcd5f('0x2d')]);_0x5bc9a3[_0xcd5f('0x2c')]=qs[_0xcd5f('0x2c')](_0x162eac[_0xcd5f('0x42')]['offset']);}_0x5bc9a3[_0xcd5f('0x4b')]=qs['sort'](_0x162eac[_0xcd5f('0x42')][_0xcd5f('0x4c')]);_0x5bc9a3[_0xcd5f('0x4d')]=qs['filters'](_['pick'](_0x162eac[_0xcd5f('0x42')],_0x51a12e[_0xcd5f('0x43')]));if(_0x162eac[_0xcd5f('0x42')][_0xcd5f('0x4e')]){_0x5bc9a3[_0xcd5f('0x4d')]=_[_0xcd5f('0x4f')](_0x5bc9a3[_0xcd5f('0x4d')],{'$or':_[_0xcd5f('0x3b')](_0x118881,function(_0x1df321){if(_0x1df321['type']!=='VIRTUAL'){var _0x3de234={};_0x3de234[_0x1df321[_0xcd5f('0x37')]]={'$like':'%'+_0x162eac[_0xcd5f('0x42')]['filter']+'%'};return _0x3de234;}})});}_0x5bc9a3=_[_0xcd5f('0x4f')]({},_0x5bc9a3,_0x162eac[_0xcd5f('0x50')]);var _0x1027a5={'where':_0x5bc9a3[_0xcd5f('0x4d')]};return db[_0xcd5f('0x3c')]['count'](_0x1027a5)[_0xcd5f('0x1e')](function(_0x3ce855){_0x38c7c2[_0xcd5f('0x2b')]=_0x3ce855;if(_0x162eac[_0xcd5f('0x42')][_0xcd5f('0x51')]){_0x5bc9a3[_0xcd5f('0x52')]=[{'all':!![]}];}return db[_0xcd5f('0x3c')]['findAll'](_0x5bc9a3);})['then'](function(_0x3632f8){_0x38c7c2['rows']=_0x3632f8;return _0x38c7c2;})[_0xcd5f('0x1e')](respondWithFilteredResult(_0x6b5174,_0x5bc9a3))['catch'](handleError(_0x6b5174,null));};exports[_0xcd5f('0x53')]=function(_0x3d05a9,_0x3c06f3){var _0x332d42={'raw':![],'where':{'id':_0x3d05a9['params']['id']},'include':[{'model':db[_0xcd5f('0x39')],'as':_0xcd5f('0x3a')}]},_0x3c92b1={};_0x3c92b1[_0xcd5f('0x45')]=_[_0xcd5f('0x41')](db[_0xcd5f('0x3c')]['rawAttributes']);_0x3c92b1[_0xcd5f('0x42')]=_[_0xcd5f('0x41')](_0x3d05a9[_0xcd5f('0x42')]);_0x3c92b1[_0xcd5f('0x43')]=_[_0xcd5f('0x44')](_0x3c92b1[_0xcd5f('0x45')],_0x3c92b1['query']);_0x332d42[_0xcd5f('0x47')]=_[_0xcd5f('0x44')](_0x3c92b1[_0xcd5f('0x45')],qs[_0xcd5f('0x46')](_0x3d05a9[_0xcd5f('0x42')][_0xcd5f('0x46')]));_0x332d42[_0xcd5f('0x47')]=_0x332d42[_0xcd5f('0x47')][_0xcd5f('0x48')]?_0x332d42[_0xcd5f('0x47')]:_0x3c92b1[_0xcd5f('0x45')];if(_0x3d05a9[_0xcd5f('0x42')][_0xcd5f('0x51')]){_0x332d42['include']=[{'all':!![]}];}_0x332d42=_['merge']({},_0x332d42,_0x3d05a9[_0xcd5f('0x50')]);return db['SmsAccount']['find'](_0x332d42)[_0xcd5f('0x1e')](handleEntityNotFound(_0x3c06f3,null))['then'](respondWithResult(_0x3c06f3,null))[_0xcd5f('0x27')](handleError(_0x3c06f3,null));};exports[_0xcd5f('0x54')]=function(_0x199a9e,_0x524ca4){return db[_0xcd5f('0x3c')]['create'](_0x199a9e['body'],{})['then'](function(_0x473e75){var _0x8790e6=_0x199a9e[_0xcd5f('0x55')]['get']({'plain':!![]});if(!_0x8790e6)throw new Error(_0xcd5f('0x56'));if(_0x8790e6['role']==='user'){var _0x5e57f4=_0x473e75[_0xcd5f('0x57')]({'plain':!![]});var _0x750866='SmsAccounts';return db[_0xcd5f('0x58')][_0xcd5f('0x59')]({'where':{'name':_0x750866,'userProfileId':_0x8790e6[_0xcd5f('0x5a')]},'raw':!![]})[_0xcd5f('0x1e')](function(_0x40336b){if(_0x40336b&&_0x40336b[_0xcd5f('0x5b')]===0x0){return db[_0xcd5f('0x35')][_0xcd5f('0x54')]({'name':_0x5e57f4[_0xcd5f('0x37')],'resourceId':_0x5e57f4['id'],'type':_0x40336b[_0xcd5f('0x37')],'sectionId':_0x40336b['id']},{})[_0xcd5f('0x1e')](function(){return _0x473e75;});}else{return _0x473e75;}})['catch'](function(_0x267b08){logger[_0xcd5f('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x267b08);throw _0x267b08;});}return _0x473e75;})[_0xcd5f('0x1e')](respondWithResult(_0x524ca4,0xc9))[_0xcd5f('0x27')](handleError(_0x524ca4,null));};exports[_0xcd5f('0x33')]=function(_0x2e4b12,_0x1bd948){if(_0x2e4b12[_0xcd5f('0x5c')]['id']){delete _0x2e4b12[_0xcd5f('0x5c')]['id'];}return db[_0xcd5f('0x3c')][_0xcd5f('0x59')]({'where':{'id':_0x2e4b12[_0xcd5f('0x5d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xcd5f('0x1e')](handleEntityNotFound(_0x1bd948,null))[_0xcd5f('0x1e')](saveUpdates(_0x2e4b12[_0xcd5f('0x5c')],null))[_0xcd5f('0x1e')](respondWithResult(_0x1bd948,null))[_0xcd5f('0x27')](handleError(_0x1bd948,null));};exports[_0xcd5f('0x34')]=function(_0x127ebb,_0x3ec425){return db[_0xcd5f('0x3c')][_0xcd5f('0x59')]({'where':{'id':_0x127ebb[_0xcd5f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3ec425,null))[_0xcd5f('0x1e')](removeEntity(_0x3ec425,null))[_0xcd5f('0x27')](handleError(_0x3ec425,null));};exports[_0xcd5f('0x5e')]=function(_0x441bfb,_0xcd97ec){return db[_0xcd5f('0x3c')][_0xcd5f('0x5e')]()['then'](respondWithResult(_0xcd97ec,null))[_0xcd5f('0x27')](handleError(_0xcd97ec,null));};exports[_0xcd5f('0x5f')]=function(_0x16b4dc,_0x5dcfb4,_0x41fe95){if(_0x16b4dc[_0xcd5f('0x5c')]['id']){delete _0x16b4dc[_0xcd5f('0x5c')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x16b4dc[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x5dcfb4,null))[_0xcd5f('0x1e')](function(_0x1d121a){if(_0x1d121a){_0x16b4dc['body'][_0xcd5f('0x60')]=_0x1d121a['id'];return db['Disposition'][_0xcd5f('0x54')](_0x16b4dc[_0xcd5f('0x5c')]);}})['then'](respondWithResult(_0x5dcfb4,null))[_0xcd5f('0x27')](handleError(_0x5dcfb4,null));};exports[_0xcd5f('0x61')]=function(_0x1605f4,_0x132dd4,_0x2aac60){var _0x3ae89c={'raw':![],'where':{}};var _0x442095={};var _0x590fa7={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x1605f4[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x132dd4,null))[_0xcd5f('0x1e')](function(_0xccd5da){if(_0xccd5da){_0x442095[_0xcd5f('0x45')]=_[_0xcd5f('0x41')](db[_0xcd5f('0x62')][_0xcd5f('0x3d')]);_0x442095[_0xcd5f('0x42')]=_[_0xcd5f('0x41')](_0x1605f4[_0xcd5f('0x42')]);_0x442095['filters']=_[_0xcd5f('0x44')](_0x442095[_0xcd5f('0x45')],_0x442095[_0xcd5f('0x42')]);_0x3ae89c[_0xcd5f('0x47')]=_[_0xcd5f('0x44')](_0x442095['model'],qs[_0xcd5f('0x46')](_0x1605f4[_0xcd5f('0x42')]['fields']));_0x3ae89c[_0xcd5f('0x47')]=_0x3ae89c[_0xcd5f('0x47')][_0xcd5f('0x48')]?_0x3ae89c[_0xcd5f('0x47')]:_0x442095['model'];if(!_0x1605f4['query'][_0xcd5f('0x49')](_0xcd5f('0x4a'))){_0x3ae89c[_0xcd5f('0x2d')]=qs[_0xcd5f('0x2d')](_0x1605f4[_0xcd5f('0x42')][_0xcd5f('0x2d')]);_0x3ae89c[_0xcd5f('0x2c')]=qs[_0xcd5f('0x2c')](_0x1605f4[_0xcd5f('0x42')][_0xcd5f('0x2c')]);}_0x3ae89c['order']=qs[_0xcd5f('0x4c')](_0x1605f4['query'][_0xcd5f('0x4c')]);_0x3ae89c[_0xcd5f('0x4d')]=qs[_0xcd5f('0x43')](_[_0xcd5f('0x63')](_0x1605f4[_0xcd5f('0x42')],_0x442095['filters']));_0x3ae89c[_0xcd5f('0x4d')][_0xcd5f('0x60')]=_0xccd5da['id'];if(_0x1605f4[_0xcd5f('0x42')][_0xcd5f('0x4e')]){_0x3ae89c[_0xcd5f('0x4d')]=_[_0xcd5f('0x4f')](_0x3ae89c[_0xcd5f('0x4d')],{'$or':_[_0xcd5f('0x3b')](_0x3ae89c[_0xcd5f('0x47')],function(_0x1f9d1c){var _0xaf911d={};_0xaf911d[_0x1f9d1c]={'$like':'%'+_0x1605f4[_0xcd5f('0x42')][_0xcd5f('0x4e')]+'%'};return _0xaf911d;})});}_0x3ae89c=_[_0xcd5f('0x4f')]({},_0x3ae89c,_0x1605f4[_0xcd5f('0x50')]);return db[_0xcd5f('0x62')][_0xcd5f('0x2b')]({'where':_0x3ae89c['where']})[_0xcd5f('0x1e')](function(_0x45ea22){_0x590fa7['count']=_0x45ea22;if(_0x1605f4[_0xcd5f('0x42')][_0xcd5f('0x51')]){_0x3ae89c['include']=[{'all':!![]}];}return db['Disposition'][_0xcd5f('0x64')](_0x3ae89c);})['then'](function(_0x32404c){_0x590fa7['rows']=_0x32404c;return _0x590fa7;});}})[_0xcd5f('0x1e')](respondWithFilteredResult(_0x132dd4,_0x3ae89c))['catch'](handleError(_0x132dd4,null));};exports[_0xcd5f('0x65')]=function(_0xc22a65,_0x4d4f70,_0x5aaece){return db[_0xcd5f('0x3c')]['find']({'where':{'id':_0xc22a65[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x4d4f70,null))[_0xcd5f('0x1e')](function(_0x53d4eb){if(_0x53d4eb){return _0x53d4eb[_0xcd5f('0x65')](_0xc22a65[_0xcd5f('0x42')][_0xcd5f('0x66')]);}})['then'](respondWithStatusCode(_0x4d4f70,null))['catch'](handleError(_0x4d4f70,null));};exports[_0xcd5f('0x67')]=function(_0xa3fde9,_0x4acc5f,_0x42bc06){if(_0xa3fde9[_0xcd5f('0x5c')]['id']){delete _0xa3fde9[_0xcd5f('0x5c')]['id'];}return db[_0xcd5f('0x3c')][_0xcd5f('0x59')]({'where':{'id':_0xa3fde9[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x4acc5f,null))[_0xcd5f('0x1e')](function(_0x2c78fd){if(_0x2c78fd){_0xa3fde9[_0xcd5f('0x5c')][_0xcd5f('0x60')]=_0x2c78fd['id'];return db['CannedAnswer'][_0xcd5f('0x54')](_0xa3fde9[_0xcd5f('0x5c')]);}})[_0xcd5f('0x1e')](respondWithResult(_0x4acc5f,null))['catch'](handleError(_0x4acc5f,null));};exports['getAnswers']=function(_0xcffa50,_0x14eda1,_0x23d0a8){var _0xe0573e={'raw':![],'where':{}};var _0x47ec0e={};var _0x1a6e8c={'count':0x0,'rows':[]};return db[_0xcd5f('0x3c')][_0xcd5f('0x68')]({'where':{'id':_0xcffa50[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x14eda1,null))[_0xcd5f('0x1e')](function(_0x5e0fb3){if(_0x5e0fb3){_0x47ec0e[_0xcd5f('0x45')]=_['keys'](db[_0xcd5f('0x69')][_0xcd5f('0x3d')]);_0x47ec0e[_0xcd5f('0x42')]=_['keys'](_0xcffa50[_0xcd5f('0x42')]);_0x47ec0e['filters']=_[_0xcd5f('0x44')](_0x47ec0e[_0xcd5f('0x45')],_0x47ec0e[_0xcd5f('0x42')]);_0xe0573e['attributes']=_['intersection'](_0x47ec0e[_0xcd5f('0x45')],qs['fields'](_0xcffa50[_0xcd5f('0x42')]['fields']));_0xe0573e[_0xcd5f('0x47')]=_0xe0573e[_0xcd5f('0x47')][_0xcd5f('0x48')]?_0xe0573e[_0xcd5f('0x47')]:_0x47ec0e[_0xcd5f('0x45')];if(!_0xcffa50[_0xcd5f('0x42')][_0xcd5f('0x49')](_0xcd5f('0x4a'))){_0xe0573e[_0xcd5f('0x2d')]=qs[_0xcd5f('0x2d')](_0xcffa50[_0xcd5f('0x42')][_0xcd5f('0x2d')]);_0xe0573e[_0xcd5f('0x2c')]=qs['offset'](_0xcffa50['query'][_0xcd5f('0x2c')]);}_0xe0573e[_0xcd5f('0x4b')]=qs[_0xcd5f('0x4c')](_0xcffa50[_0xcd5f('0x42')][_0xcd5f('0x4c')]);_0xe0573e[_0xcd5f('0x4d')]=qs[_0xcd5f('0x43')](_[_0xcd5f('0x63')](_0xcffa50[_0xcd5f('0x42')],_0x47ec0e['filters']));_0xe0573e[_0xcd5f('0x4d')][_0xcd5f('0x60')]=_0x5e0fb3['id'];if(_0xcffa50[_0xcd5f('0x42')]['filter']){_0xe0573e[_0xcd5f('0x4d')]=_[_0xcd5f('0x4f')](_0xe0573e[_0xcd5f('0x4d')],{'$or':_[_0xcd5f('0x3b')](_0xe0573e['attributes'],function(_0x36fa9a){var _0x27d8e0={};_0x27d8e0[_0x36fa9a]={'$like':'%'+_0xcffa50[_0xcd5f('0x42')][_0xcd5f('0x4e')]+'%'};return _0x27d8e0;})});}_0xe0573e=_[_0xcd5f('0x4f')]({},_0xe0573e,_0xcffa50[_0xcd5f('0x50')]);return db['CannedAnswer'][_0xcd5f('0x2b')]({'where':_0xe0573e[_0xcd5f('0x4d')]})[_0xcd5f('0x1e')](function(_0x5431f4){_0x1a6e8c['count']=_0x5431f4;if(_0xcffa50['query'][_0xcd5f('0x51')]){_0xe0573e[_0xcd5f('0x52')]=[{'all':!![]}];}return db[_0xcd5f('0x69')][_0xcd5f('0x64')](_0xe0573e);})[_0xcd5f('0x1e')](function(_0x11ade7){_0x1a6e8c['rows']=_0x11ade7;return _0x1a6e8c;});}})[_0xcd5f('0x1e')](respondWithFilteredResult(_0x14eda1,_0xe0573e))['catch'](handleError(_0x14eda1,null));};exports[_0xcd5f('0x6a')]=function(_0xa902fd,_0x34770c,_0x329dde){return db['SmsAccount']['find']({'where':{'id':_0xa902fd[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x34770c,null))[_0xcd5f('0x1e')](function(_0x27b2a4){if(_0x27b2a4){return _0x27b2a4[_0xcd5f('0x6a')](_0xa902fd['query'][_0xcd5f('0x66')]);}})[_0xcd5f('0x1e')](respondWithStatusCode(_0x34770c,null))[_0xcd5f('0x27')](handleError(_0x34770c,null));};exports[_0xcd5f('0x6b')]=function(_0x9ec973,_0x25622d,_0x293e3b){var _0x2b96c7={'channel':_0xcd5f('0x6c')};var _0x2d2bd9=[];var _0x5dc343=[];var _0x50f68b={};return db[_0xcd5f('0x3c')][_0xcd5f('0x59')]({'where':{'id':_0x9ec973[_0xcd5f('0x5d')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xcd5f('0x6d')}]})[_0xcd5f('0x1e')](handleEntityNotFound(_0x25622d,null))[_0xcd5f('0x1e')](function(_0x203534){_0x2b96c7[_0xcd5f('0x6e')]=_0x203534;_0x2b96c7[_0xcd5f('0x6f')]=_[_0xcd5f('0x70')](_0x203534['Applications'],[_0xcd5f('0x71')],[_0xcd5f('0x72')]);if(_0x2b96c7[_0xcd5f('0x6e')][_0xcd5f('0x6d')]){delete _0x2b96c7[_0xcd5f('0x6e')][_0xcd5f('0x6d')];}return db[_0xcd5f('0x73')][_0xcd5f('0x5e')]();})[_0xcd5f('0x1e')](function(_0x30ec9c){if(!_0x30ec9c){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x2d2bd9=_[_0xcd5f('0x74')](_[_0xcd5f('0x41')](_0x30ec9c),[_0xcd5f('0x75'),_0xcd5f('0x76')]);_0x5dc343=_[_0xcd5f('0x74')](_[_0xcd5f('0x41')](_0x30ec9c),[_0xcd5f('0x75'),_0xcd5f('0x76'),_0xcd5f('0x77'),_0xcd5f('0x78')]);_0x2b96c7[_0xcd5f('0x5c')]={'mapKey':_0xcd5f('0x79')};if(_0x2b96c7['account']['type']){switch(_0x2b96c7[_0xcd5f('0x6e')][_0xcd5f('0x3f')]){case _0xcd5f('0x7a'):_0x2b96c7['body'][_0xcd5f('0x7b')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x7c')];_0x2b96c7['body'][_0xcd5f('0x5c')]=_0x9ec973['body'][_0xcd5f('0x7d')];_0x2b96c7['body']['messageId']=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x7e')];break;case _0xcd5f('0x7f'):_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')]='+'+_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x80')];_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x5c')]=_0x9ec973['body']['text'];break;case _0xcd5f('0x81'):_0x2b96c7[_0xcd5f('0x5c')]['from']=_0x9ec973['body'][_0xcd5f('0x7b')];_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x5c')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x23')];break;case _0xcd5f('0x82'):_0x2b96c7[_0xcd5f('0x5c')]['from']=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x7b')];_0x2b96c7['body']['body']=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x5c')];_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x83')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x84')];break;case _0xcd5f('0x85'):_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')]=_0x9ec973[_0xcd5f('0x5c')]['From'];_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x5c')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x86')];_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x83')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x87')];break;case'infobip':_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')]='+'+_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x88')][0x0]['from'];_0x2b96c7['body']['body']=_0x9ec973[_0xcd5f('0x5c')]['results'][0x0][_0xcd5f('0x89')];_0x2b96c7['body'][_0xcd5f('0x83')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x88')][0x0]['messageId'];break;case _0xcd5f('0x8a'):_0x2b96c7[_0xcd5f('0x5c')]['from']=_0x9ec973['body']['originatingAddress'];_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x5c')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x8b')][_0xcd5f('0x23')];break;case _0xcd5f('0x8c'):_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x8d')];_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x5c')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x89')];_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x83')]=_0x9ec973['body'][_0xcd5f('0x8e')];break;case _0xcd5f('0x8f'):_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')]=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x7b')];_0x2b96c7[_0xcd5f('0x5c')]['body']=_0x9ec973[_0xcd5f('0x5c')][_0xcd5f('0x23')];_0x2b96c7['body'][_0xcd5f('0x83')]=_0x9ec973[_0xcd5f('0x5c')]['refid'];break;}}if(_0x2b96c7[_0xcd5f('0x5c')]['id']){delete _0x2b96c7[_0xcd5f('0x5c')]['id'];}if(_[_0xcd5f('0x90')](_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')])){throw new db[(_0xcd5f('0x91'))][(_0xcd5f('0x1c'))](_0xcd5f('0x92'));}if(_[_0xcd5f('0x90')](_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x5c')])||_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x5c')]===''){throw new db['Sequelize'][(_0xcd5f('0x1c'))](_0xcd5f('0x93'));}if(_[_0xcd5f('0x90')](_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x94')])){throw new db[(_0xcd5f('0x91'))][(_0xcd5f('0x1c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5dc343);}if(!_['includes'](_0x5dc343,_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x94')])){throw new db['Sequelize'][(_0xcd5f('0x1c'))](_0xcd5f('0x95')+_0x5dc343);}_0x50f68b[_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x94')]]=_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')];return db[_0xcd5f('0x96')]['find']({'where':{'id':_0x2b96c7[_0xcd5f('0x6e')]['ListId']},'include':[{'model':db[_0xcd5f('0x73')],'as':_0xcd5f('0x97'),'where':_0x50f68b,'limit':0x1,'order':[[_0xcd5f('0x76'),_0xcd5f('0x98')]]}]});})[_0xcd5f('0x1e')](handleEntityNotFound(_0x25622d,null))[_0xcd5f('0x1e')](function(_0x19952e){if(_0x19952e){_0x2b96c7[_0xcd5f('0x99')]=_['omit'](_0x19952e,[_0xcd5f('0x97')]);if(_0x19952e[_0xcd5f('0x97')][_0xcd5f('0x48')]){return _0x19952e[_0xcd5f('0x97')][0x0];}var _0x4a9b05=_[_0xcd5f('0x14')](_0x2b96c7['body'],{'firstName':_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')],'ListId':_0x19952e['id']});_0x4a9b05[_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x94')]]=_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')];return db[_0xcd5f('0x73')]['create'](_0x4a9b05,{'fields':_0x2d2bd9,'raw':!![]});}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x25622d,null))[_0xcd5f('0x1e')](function(_0x118a5c){if(_0x118a5c){_0x2b96c7[_0xcd5f('0x9a')]=_0x118a5c;var _0x347e89={'ContactId':_0x118a5c['id'],'phone':_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x7b')],'SmsAccountId':_0x9ec973['params']['id']};var _0x192dc9={'ContactId':_0x118a5c['id'],'SmsAccountId':_0x9ec973[_0xcd5f('0x5d')]['id'],'closed':![]};return db['SmsInteraction'][_0xcd5f('0x59')]({'where':_0x192dc9})[_0xcd5f('0x1e')](function(_0x214ddc){if(_0x214ddc){return[_0x214ddc,![]];}return db[_0xcd5f('0x9b')]['create'](_0x347e89)[_0xcd5f('0x1e')](function(_0x476391){return[_0x476391,!![]];});});}})[_0xcd5f('0x9c')](function(_0x472c13,_0x40dd3e){_0x2b96c7[_0xcd5f('0x9d')]=_0x472c13['get']({'plain':!![]});_0x2b96c7[_0xcd5f('0x9d')][_0xcd5f('0x9e')]=![];if(_0x40dd3e){if(_0x2b96c7[_0xcd5f('0x6e')][_0xcd5f('0x9f')]){_0x2b96c7[_0xcd5f('0x6f')]['push']({'id':0x0,'priority':_0x2b96c7[_0xcd5f('0x6f')]['length']+0x1,'app':_0xcd5f('0xa0'),'appdata':_0xcd5f('0xa1'),'interval':'*,*,*,*'});}_0x2b96c7[_0xcd5f('0x9d')][_0xcd5f('0x9e')]=!![];}return db['SmsMessage'][_0xcd5f('0x54')]({'phone':_0x2b96c7[_0xcd5f('0x5c')]['from'],'messageId':_0x2b96c7['body'][_0xcd5f('0x83')],'body':_0x2b96c7[_0xcd5f('0x5c')][_0xcd5f('0x5c')],'SmsAccountId':_0x9ec973[_0xcd5f('0x5d')]['id'],'SmsInteractionId':_0x472c13['id'],'direction':'in','ContactId':_0x472c13[_0xcd5f('0xa2')],'AttachmentId':_0x2b96c7['body'][_0xcd5f('0xa3')]});})[_0xcd5f('0x1e')](function(_0x5c42d5){_0x2b96c7[_0xcd5f('0x23')]=_0x5c42d5;if(_0x2b96c7[_0xcd5f('0x9d')][_0xcd5f('0xa4')]){return db['User']['find']({'attributes':['id',_0xcd5f('0x37')],'where':{'id':_0x2b96c7[_0xcd5f('0x9d')]['UserId']}})['then'](function(_0x5cc9f1){if(_0x5cc9f1){_0x2b96c7['applications'][_0xcd5f('0xa5')]({'id':0x0,'priority':0x0,'app':_0xcd5f('0xa6'),'appdata':_0x5cc9f1[_0xcd5f('0x37')]+','+(_0x2b96c7['account'][_0xcd5f('0xa7')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xcd5f('0xa8'),_0xcd5f('0xa9'),_0x2b96c7);});}return respondWithRpcPromise(_0xcd5f('0xa8'),_0xcd5f('0xa9'),_0x2b96c7);})[_0xcd5f('0x1e')](function(_0x316e81){if(_0x316e81){var _0x21269c=0xc8;var _0x363039=_0xcd5f('0xaa');logger['info'](_0xcd5f('0xab'),_0x363039,_0x21269c,_0xcd5f('0xac'));logger[_0xcd5f('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x363039,_0x21269c,_0xcd5f('0xac'),JSON['stringify'](_0x316e81));if(_0x2b96c7['account'][_0xcd5f('0x3f')]===_0xcd5f('0x7a')){return _0x25622d[_0xcd5f('0x2e')](_0x21269c)['set'](_0xcd5f('0xad'),_0xcd5f('0xae'))[_0xcd5f('0x38')]('\x0a');}else{return _0x25622d[_0xcd5f('0x2e')](_0x21269c)[_0xcd5f('0x2a')](_0x316e81);}}})[_0xcd5f('0x27')](handleError(_0x25622d,null));};exports['addApplications']=function(_0x5238b3,_0x4c8a0b,_0x20c7a2){return db['SmsAccount'][_0xcd5f('0x68')]({'where':{'id':_0x5238b3[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x4c8a0b,null))[_0xcd5f('0x1e')](function(_0xebb02b){if(_0xebb02b){return db[_0xcd5f('0xaf')][_0xcd5f('0xb0')](function(_0xac1c08){return db[_0xcd5f('0xb1')][_0xcd5f('0x34')]({'where':{'SmsAccountId':_0x5238b3[_0xcd5f('0x5d')]['id']},'transaction':_0xac1c08})[_0xcd5f('0x1e')](function(_0x41a5fb){var _0x4eee10=_[_0xcd5f('0x3b')](_0x5238b3['body'],function(_0x5a0379){_0x5a0379[_0xcd5f('0x60')]=_0x5238b3[_0xcd5f('0x5d')]['id'];return _0x5a0379;});return db['SmsApplication']['bulkCreate'](_0x4eee10,{'transaction':_0xac1c08});});})['then'](function(){return db[_0xcd5f('0xb1')]['findAndCountAll']({'where':{'SmsAccountId':_0x5238b3[_0xcd5f('0x5d')]['id']},'order':_0xcd5f('0x71')});});}})[_0xcd5f('0x1e')](respondWithResult(_0x4c8a0b,null))[_0xcd5f('0x27')](handleError(_0x4c8a0b,null));};exports['getApplications']=function(_0x29c08c,_0x51b99f,_0x5291f5){var _0x67664c={};var _0x5b316a={};var _0x46d639;var _0x132637;return db['SmsAccount']['findOne']({'where':{'id':_0x29c08c[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x51b99f,null))[_0xcd5f('0x1e')](function(_0x19a9fd){if(_0x19a9fd){_0x46d639=_0x19a9fd;_0x5b316a[_0xcd5f('0x45')]=_['keys'](db[_0xcd5f('0xb1')][_0xcd5f('0x3d')]);_0x5b316a[_0xcd5f('0x42')]=_[_0xcd5f('0x41')](_0x29c08c['query']);_0x5b316a[_0xcd5f('0x43')]=_[_0xcd5f('0x44')](_0x5b316a[_0xcd5f('0x45')],_0x5b316a[_0xcd5f('0x42')]);_0x67664c[_0xcd5f('0x47')]=_['intersection'](_0x5b316a[_0xcd5f('0x45')],qs[_0xcd5f('0x46')](_0x29c08c['query']['fields']));_0x67664c[_0xcd5f('0x47')]=_0x67664c['attributes'][_0xcd5f('0x48')]?_0x67664c[_0xcd5f('0x47')]:_0x5b316a[_0xcd5f('0x45')];_0x67664c[_0xcd5f('0x4b')]=qs[_0xcd5f('0x4c')](_0x29c08c[_0xcd5f('0x42')][_0xcd5f('0x4c')]);_0x67664c[_0xcd5f('0x4d')]=qs['filters'](_[_0xcd5f('0x63')](_0x29c08c[_0xcd5f('0x42')],_0x5b316a[_0xcd5f('0x43')]));if(_0x29c08c['query']['filter']){_0x67664c[_0xcd5f('0x4d')]=_[_0xcd5f('0x4f')](_0x67664c[_0xcd5f('0x4d')],{'$or':_['map'](_0x67664c[_0xcd5f('0x47')],function(_0xf88f){var _0x226f1e={};_0x226f1e[_0xf88f]={'$like':'%'+_0x29c08c[_0xcd5f('0x42')][_0xcd5f('0x4e')]+'%'};return _0x226f1e;})});}_0x67664c=_[_0xcd5f('0x4f')]({},_0x67664c,_0x29c08c[_0xcd5f('0x50')]);return _0x46d639['getApplications'](_0x67664c);}})[_0xcd5f('0x1e')](function(_0x321a9f){if(_0x321a9f){_0x132637=_0x321a9f['length'];if(!_0x29c08c[_0xcd5f('0x42')][_0xcd5f('0x49')](_0xcd5f('0x4a'))){_0x67664c[_0xcd5f('0x2d')]=qs[_0xcd5f('0x2d')](_0x29c08c[_0xcd5f('0x42')][_0xcd5f('0x2d')]);_0x67664c['offset']=qs['offset'](_0x29c08c[_0xcd5f('0x42')][_0xcd5f('0x2c')]);}return _0x46d639[_0xcd5f('0xb2')](_0x67664c);}})[_0xcd5f('0x1e')](function(_0x43100e){if(_0x43100e){return _0x43100e?{'count':_0x132637,'rows':_0x43100e}:null;}})[_0xcd5f('0x1e')](respondWithResult(_0x51b99f,null))[_0xcd5f('0x27')](handleError(_0x51b99f,null));};exports[_0xcd5f('0xb3')]=function(_0x34dded,_0x34c5ce,_0x399953){var _0x28bbb3={'raw':![],'where':{}};var _0xaa7724={};var _0x3fd74d={'count':0x0,'rows':[]};return db[_0xcd5f('0x3c')][_0xcd5f('0x68')]({'where':{'id':_0x34dded[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x34c5ce,null))[_0xcd5f('0x1e')](function(_0x4f8bac){if(_0x4f8bac){_0xaa7724['model']=_['keys'](db[_0xcd5f('0x9b')][_0xcd5f('0x3d')]);_0xaa7724['query']=_[_0xcd5f('0x41')](_0x34dded[_0xcd5f('0x42')]);_0xaa7724['filters']=_[_0xcd5f('0x44')](_0xaa7724['model'],_0xaa7724[_0xcd5f('0x42')]);_0x28bbb3['attributes']=_['intersection'](_0xaa7724[_0xcd5f('0x45')],qs['fields'](_0x34dded[_0xcd5f('0x42')][_0xcd5f('0x46')]));_0x28bbb3['attributes']=_0x28bbb3['attributes'][_0xcd5f('0x48')]?_0x28bbb3[_0xcd5f('0x47')]:_0xaa7724[_0xcd5f('0x45')];if(!_0x34dded[_0xcd5f('0x42')][_0xcd5f('0x49')](_0xcd5f('0x4a'))){_0x28bbb3[_0xcd5f('0x2d')]=qs[_0xcd5f('0x2d')](_0x34dded[_0xcd5f('0x42')][_0xcd5f('0x2d')]);_0x28bbb3[_0xcd5f('0x2c')]=qs[_0xcd5f('0x2c')](_0x34dded[_0xcd5f('0x42')][_0xcd5f('0x2c')]);}_0x28bbb3['order']=qs[_0xcd5f('0x4c')](_0x34dded[_0xcd5f('0x42')][_0xcd5f('0x4c')]);_0x28bbb3[_0xcd5f('0x4d')]=qs[_0xcd5f('0x43')](_[_0xcd5f('0x63')](_0x34dded['query'],_0xaa7724[_0xcd5f('0x43')]));_0x28bbb3[_0xcd5f('0x4d')]['SmsAccountId']=_0x4f8bac['id'];if(_0x34dded[_0xcd5f('0x42')][_0xcd5f('0x4e')]){_0x28bbb3[_0xcd5f('0x4d')]=_['merge'](_0x28bbb3[_0xcd5f('0x4d')],{'$or':_[_0xcd5f('0x3b')](_0x28bbb3[_0xcd5f('0x47')],function(_0x5f201e){var _0x18446b={};_0x18446b[_0x5f201e]={'$like':'%'+_0x34dded['query'][_0xcd5f('0x4e')]+'%'};return _0x18446b;})});}_0x28bbb3=_[_0xcd5f('0x4f')]({},_0x28bbb3,_0x34dded[_0xcd5f('0x50')]);return db[_0xcd5f('0x9b')][_0xcd5f('0x2b')]({'where':_0x28bbb3[_0xcd5f('0x4d')]})[_0xcd5f('0x1e')](function(_0x16e9d5){_0x3fd74d[_0xcd5f('0x2b')]=_0x16e9d5;if(_0x34dded['query']['includeAll']){_0x28bbb3['include']=[{'model':db[_0xcd5f('0x73')],'as':_0xcd5f('0xb4'),'required':![]},{'model':db[_0xcd5f('0xb5')],'as':'Owner','attributes':[_0xcd5f('0x37'),'fullname',_0xcd5f('0xb6')],'required':![]},{'model':db['Tag'],'as':_0xcd5f('0xb7'),'attributes':['id',_0xcd5f('0x37'),_0xcd5f('0xb8')],'where':_0x34dded[_0xcd5f('0x42')][_0xcd5f('0xb9')]?{'id':_0x34dded[_0xcd5f('0x42')][_0xcd5f('0xb9')]}:undefined,'required':_0x34dded[_0xcd5f('0x42')]['tag']?!![]:![]}];}return db[_0xcd5f('0x9b')][_0xcd5f('0x64')](_0x28bbb3);})['then'](function(_0xe45913){_0x3fd74d['rows']=_0xe45913;return _0x3fd74d;});}})[_0xcd5f('0x1e')](respondWithFilteredResult(_0x34c5ce,_0x28bbb3))['catch'](handleError(_0x34c5ce,null));};exports[_0xcd5f('0x38')]=function(_0x1b5ebf,_0x26f49d,_0x430278){var _0xe9ae48,_0x56d1ec,_0x4cc70e;if(_[_0xcd5f('0x90')](_0x1b5ebf[_0xcd5f('0x5c')][_0xcd5f('0x5c')])||_0x1b5ebf[_0xcd5f('0x5c')]['body']===''){throw new db['Sequelize'][(_0xcd5f('0x1c'))](_0xcd5f('0x93'));}if(_[_0xcd5f('0x90')](_0x1b5ebf['body']['to'])){throw new db['Sequelize'][(_0xcd5f('0x1c'))](_0xcd5f('0xba'));}_0xe9ae48=_0x1b5ebf[_0xcd5f('0x5c')]['to'];return db[_0xcd5f('0x3c')]['find']({'where':{'id':_0x1b5ebf[_0xcd5f('0x5d')]['id']},'include':[{'model':db[_0xcd5f('0x96')],'as':_0xcd5f('0xbb'),'include':[{'model':db[_0xcd5f('0x73')],'as':_0xcd5f('0x97'),'where':{'mobile':_0xe9ae48},'limit':0x1,'order':[[_0xcd5f('0x76'),_0xcd5f('0x98')]]}]}]})[_0xcd5f('0x1e')](handleEntityNotFound(_0x26f49d,null))[_0xcd5f('0x1e')](function(_0xa5c692){if(_0xa5c692&&_0xa5c692[_0xcd5f('0xbb')]){_0x56d1ec=_0xa5c692[_0xcd5f('0x57')]({'plain':!![]});if(_0x56d1ec['List']&&_0x56d1ec[_0xcd5f('0xbb')][_0xcd5f('0x97')]['length']){return _0x56d1ec[_0xcd5f('0xbb')][_0xcd5f('0x97')][0x0];}return db[_0xcd5f('0x73')][_0xcd5f('0x54')](_[_0xcd5f('0x14')](_0x1b5ebf[_0xcd5f('0x5c')],{'firstName':_0xe9ae48,'mobile':_0xe9ae48,'phone':_0xe9ae48,'ListId':_0x56d1ec['ListId']}));}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x26f49d,null))[_0xcd5f('0x1e')](function(_0x3b5536){if(_0x3b5536){_0x4cc70e=_0x3b5536;return db[_0xcd5f('0x9b')]['find']({'where':{'ContactId':_0x4cc70e['id'],'closed':![],'SmsAccountId':_0x56d1ec['id']}})['then'](function(_0x34a0de){if(_0x34a0de){return[_0x34a0de,![]];}return db['SmsInteraction'][_0xcd5f('0x54')]({'UserId':_0x1b5ebf[_0xcd5f('0x55')]['id'],'ContactId':_0x4cc70e['id'],'SmsAccountId':_0x56d1ec['id'],'phone':_0xe9ae48,'firstMsgDirection':'out','Messages':[_[_0xcd5f('0x4f')](_0x1b5ebf['body'],{'read':![],'body':_0x1b5ebf[_0xcd5f('0x5c')][_0xcd5f('0x5c')],'phone':_0xe9ae48,'SmsAccountId':_0x56d1ec['id'],'UserId':_0x1b5ebf[_0xcd5f('0x55')]['id'],'ContactId':_0x4cc70e['id']})]},{'include':[{'model':db[_0xcd5f('0xbc')],'as':_0xcd5f('0xbd')}]})[_0xcd5f('0x1e')](function(_0x5af83c){return[_0x5af83c,!![]];});});}})[_0xcd5f('0x9c')](function(_0x3a33e8,_0x3cda4f){if(_0x3cda4f){return _0x3a33e8;}return db[_0xcd5f('0xbc')][_0xcd5f('0x54')](_[_0xcd5f('0x4f')](_0x1b5ebf[_0xcd5f('0x5c')],{'read':![],'body':_0x1b5ebf[_0xcd5f('0x5c')][_0xcd5f('0x5c')],'phone':_0xe9ae48,'SmsAccountId':_0x56d1ec['id'],'SmsInteractionId':_0x3a33e8['id'],'UserId':_0x1b5ebf[_0xcd5f('0x55')]['id'],'ContactId':_0x4cc70e['id']}))['then'](function(_0xc58c5){_0x3a33e8['dataValues']['Messages']=[];_0x3a33e8[_0xcd5f('0xbe')][_0xcd5f('0xbd')][_0xcd5f('0xbf')](_0xc58c5[_0xcd5f('0xbe')]);return _0x3a33e8;});})[_0xcd5f('0x1e')](respondWithResult(_0x26f49d,null))[_0xcd5f('0x27')](handleError(_0x26f49d,null));};exports['status']=function(_0x342a14,_0x25f81a,_0x420a05){if(_0x342a14[_0xcd5f('0x5c')]['id']){delete _0x342a14[_0xcd5f('0x5c')]['id'];}console[_0xcd5f('0xc0')](_0xcd5f('0xc1'),_0x342a14['body']);var _0x4dbc61,_0x47324b,_0x3276ee;return db['SmsAccount'][_0xcd5f('0x59')]({'where':{'id':_0x342a14['params']['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x25f81a,null))[_0xcd5f('0x1e')](function(_0x43c9e9){if(_0x43c9e9){_0x3276ee=_0x43c9e9;logger[_0xcd5f('0x20')](_0xcd5f('0xab'),_0xcd5f('0x2e'),_0xcd5f('0xc2'),_0x43c9e9[_0xcd5f('0x3f')],util[_0xcd5f('0xc3')](_0x342a14[_0xcd5f('0x5c')],{'showHidden':![],'depth':null}));switch(_0x43c9e9[_0xcd5f('0x3f')]){case'skebby':if(_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0xc4')]&&_0x342a14['body'][_0xcd5f('0x2e')]){_0x47324b=_0x342a14[_0xcd5f('0x5c')]['status'];return db[_0xcd5f('0xbc')][_0xcd5f('0x59')]({'where':{'messageId':_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0xc4')]}});}break;case _0xcd5f('0x81'):if(_0x342a14[_0xcd5f('0x5c')]['requestid']&&_0x342a14[_0xcd5f('0x5c')]['statusInt']){_0x47324b=_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0xc5')];return db['SmsMessage'][_0xcd5f('0x59')]({'where':{'messageId':_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0xc6')]}});}break;case _0xcd5f('0x82'):if(_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0x84')]&&_0x342a14['body'][_0xcd5f('0xc7')]){_0x47324b=_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0xc7')];return db[_0xcd5f('0xbc')][_0xcd5f('0x59')]({'where':{'messageId':_0x342a14[_0xcd5f('0x5c')]['message_id']}});}break;case _0xcd5f('0xc8'):var _0x40d5bd=_0x342a14['body']['results'][0x0];if(_0x40d5bd[_0xcd5f('0x83')]&&_0x40d5bd[_0xcd5f('0x2e')][_0xcd5f('0xc9')]===_0xcd5f('0xca')){_0x47324b=_0x40d5bd[_0xcd5f('0x2e')][_0xcd5f('0xc9')];return db['SmsMessage'][_0xcd5f('0x59')]({'where':{'messageId':_0x40d5bd['messageId']}});}break;case'clickatell':if(_0x342a14[_0xcd5f('0x5c')]['messageId']&&_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0x2e')]){_0x47324b=_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0x2e')];return db['SmsMessage'][_0xcd5f('0x59')]({'where':{'messageId':_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0x83')]}});}break;case _0xcd5f('0x8f'):if(_0x342a14[_0xcd5f('0x5c')]['redif']&&_0x342a14[_0xcd5f('0x5c')]['status']){_0x47324b=_0x342a14[_0xcd5f('0x5c')][_0xcd5f('0x2e')];return db[_0xcd5f('0xbc')][_0xcd5f('0x59')]({'where':{'messageId':_0x342a14[_0xcd5f('0x5c')]['redif']}});}break;}}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x25f81a,null))[_0xcd5f('0x1e')](function(_0x1066dd){if(_0x1066dd){_0x4dbc61=_0x1066dd;switch(_0x3276ee[_0xcd5f('0x3f')]){case _0xcd5f('0x7f'):if(_0x47324b===_0xcd5f('0xca')){return _0x4dbc61['update']({'read':!![]});}else{logger[_0xcd5f('0x22')](_0xcd5f('0xab'),_0xcd5f('0x2e'),_0xcd5f('0x7f'),util['inspect'](_0x342a14[_0xcd5f('0x5c')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x47324b==='1'){return _0x4dbc61[_0xcd5f('0x33')]({'read':!![]});}else{logger[_0xcd5f('0x22')](_0xcd5f('0xab'),_0xcd5f('0x2e'),_0xcd5f('0x7f'),util[_0xcd5f('0xc3')](_0x342a14[_0xcd5f('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xcd5f('0x82'):if(!_0x342a14['body'][_0xcd5f('0xcb')]&&_0x47324b>=0xc8&&_0x47324b<=0xce){return _0x4dbc61[_0xcd5f('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xcd5f('0x2e'),_0xcd5f('0x82'),util[_0xcd5f('0xc3')](_0x342a14[_0xcd5f('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x17e755=_0x342a14['body'][_0xcd5f('0x88')][0x0];if(_0x17e755[_0xcd5f('0x2e')][_0xcd5f('0xc9')]===_0xcd5f('0xca')){return _0x4dbc61['update']({'read':!![]});}else{logger[_0xcd5f('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xcd5f('0xc8'),util[_0xcd5f('0xc3')](_0x342a14[_0xcd5f('0x5c')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x47324b==_0xcd5f('0xcc')||_0x47324b=='RECEIVED_BY_RECIPIENT'){return _0x4dbc61['update']({'read':!![]});}else{logger[_0xcd5f('0x22')](_0xcd5f('0xab'),'status',_0xcd5f('0x8c'),util[_0xcd5f('0xc3')](_0x342a14[_0xcd5f('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xcd5f('0x8f'):if(_0x47324b===_0xcd5f('0xcd')||_0x47324b===_0xcd5f('0xce')){return _0x4dbc61[_0xcd5f('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xcd5f('0x2e'),_0xcd5f('0x8f'),util[_0xcd5f('0xc3')](_0x342a14[_0xcd5f('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x4dbc61;}})[_0xcd5f('0x1e')](respondWithResult(_0x25f81a,null))[_0xcd5f('0x27')](handleError(_0x25f81a,null));};exports[_0xcd5f('0xcf')]=function(_0x1876d7,_0x2fa272,_0x927371){var _0x3249f1,_0x5cf9f5,_0x5de3f3;return db[_0xcd5f('0x3c')][_0xcd5f('0x59')]({'where':{'id':_0x1876d7[_0xcd5f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2fa272,null))[_0xcd5f('0x1e')](function(_0x2d0046){if(_0x2d0046){_0x5de3f3=_0x2d0046;logger[_0xcd5f('0x20')](_0xcd5f('0xab'),'status',_0xcd5f('0xc2'),_0x2d0046[_0xcd5f('0x3f')],util[_0xcd5f('0xc3')](_0x1876d7[_0xcd5f('0x42')],{'showHidden':![],'depth':null}));switch(_0x2d0046[_0xcd5f('0x3f')]){case _0xcd5f('0x8a'):if(_0x1876d7[_0xcd5f('0x42')][_0xcd5f('0xd0')]&&_0x1876d7[_0xcd5f('0x42')]['state']){_0x5cf9f5=_0x1876d7[_0xcd5f('0x42')][_0xcd5f('0xd1')];return db[_0xcd5f('0xbc')][_0xcd5f('0x59')]({'where':{'messageId':_0x1876d7[_0xcd5f('0x42')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x2fa272,null))['then'](function(_0x251232){if(_0x251232){_0x3249f1=_0x251232;switch(_0x5de3f3['type']){case _0xcd5f('0x8a'):if(_0x5cf9f5==='2'||_0x5cf9f5==='6'){return _0x3249f1[_0xcd5f('0x33')]({'read':!![]});}else{logger[_0xcd5f('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xcd5f('0x8a'),util[_0xcd5f('0xc3')](_0x1876d7[_0xcd5f('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x3249f1;}})[_0xcd5f('0x1e')](respondWithResult(_0x2fa272,null))['catch'](handleError(_0x2fa272,null));};exports['addAgents']=function(_0x2d042a,_0x2acce6,_0x440a83){return db['SmsAccount'][_0xcd5f('0x59')]({'where':{'id':_0x2d042a[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x2acce6,null))['then'](function(_0x1229a9){if(_0x1229a9){return _0x1229a9[_0xcd5f('0xd2')](_0x2d042a['body'][_0xcd5f('0x66')],_[_0xcd5f('0xd3')](_0x2d042a[_0xcd5f('0x5c')],[_0xcd5f('0x66'),'id'])||{})['spread'](function(_0x2f011d){for(var _0x161a14=0x0;_0x161a14<_0x2d042a[_0xcd5f('0x5c')][_0xcd5f('0x66')]['length'];_0x161a14+=0x1){socket['emit']('userSmsAccount:save',{'UserId':_0x2d042a[_0xcd5f('0x5c')]['ids'][_0x161a14],'SmsAccountId':_0x2d042a[_0xcd5f('0x5d')]['id']});}return _0x2f011d;});}})[_0xcd5f('0x1e')](respondWithResult(_0x2acce6,null))[_0xcd5f('0x27')](handleError(_0x2acce6,null));};exports[_0xcd5f('0xd4')]=function(_0x3c158c,_0x5bdb09,_0x35fad7){return db[_0xcd5f('0x3c')][_0xcd5f('0x59')]({'where':{'id':_0x3c158c[_0xcd5f('0x5d')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x5bdb09,null))[_0xcd5f('0x1e')](function(_0x4e1bb8){if(_0x4e1bb8){return _0x4e1bb8[_0xcd5f('0xd4')](_0x3c158c[_0xcd5f('0x42')][_0xcd5f('0x66')])[_0xcd5f('0x1e')](function(){if(_[_0xcd5f('0xd5')](_0x3c158c[_0xcd5f('0x42')][_0xcd5f('0x66')])){for(var _0x463c7c=0x0;_0x463c7c<_0x3c158c[_0xcd5f('0x42')][_0xcd5f('0x66')][_0xcd5f('0x48')];_0x463c7c+=0x1){socket[_0xcd5f('0xd6')](_0xcd5f('0xd7'),{'UserId':Number(_0x3c158c[_0xcd5f('0x42')][_0xcd5f('0x66')][_0x463c7c]),'SmsAccountId':Number(_0x3c158c['params']['id'])});}}else{socket['emit'](_0xcd5f('0xd7'),{'UserId':Number(_0x3c158c[_0xcd5f('0x42')]['ids']),'SmsAccountId':Number(_0x3c158c['params']['id'])});}});}})[_0xcd5f('0x1e')](respondWithStatusCode(_0x5bdb09,null))[_0xcd5f('0x27')](handleError(_0x5bdb09,null));};exports[_0xcd5f('0xd8')]=function(_0x169fc8,_0x303995,_0x2976e4){var _0x62146b={};var _0x1bdb2f={};var _0x675eab;var _0x3b598c;return db[_0xcd5f('0x3c')][_0xcd5f('0x68')]({'where':{'id':_0x169fc8['params']['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x303995,null))['then'](function(_0x535468){if(_0x535468){_0x675eab=_0x535468;_0x1bdb2f['model']=_[_0xcd5f('0x41')](db['User'][_0xcd5f('0x3d')]);_0x1bdb2f[_0xcd5f('0x42')]=_[_0xcd5f('0x41')](_0x169fc8[_0xcd5f('0x42')]);_0x1bdb2f[_0xcd5f('0x43')]=_[_0xcd5f('0x44')](_0x1bdb2f['model'],_0x1bdb2f[_0xcd5f('0x42')]);_0x62146b[_0xcd5f('0x47')]=_[_0xcd5f('0x44')](_0x1bdb2f['model'],qs[_0xcd5f('0x46')](_0x169fc8[_0xcd5f('0x42')][_0xcd5f('0x46')]));_0x62146b[_0xcd5f('0x47')]=_0x62146b[_0xcd5f('0x47')][_0xcd5f('0x48')]?_0x62146b[_0xcd5f('0x47')]:_0x1bdb2f[_0xcd5f('0x45')];_0x62146b[_0xcd5f('0x4b')]=qs['sort'](_0x169fc8[_0xcd5f('0x42')]['sort']);_0x62146b[_0xcd5f('0x4d')]=qs['filters'](_[_0xcd5f('0x63')](_0x169fc8[_0xcd5f('0x42')],_0x1bdb2f[_0xcd5f('0x43')]));if(_0x169fc8[_0xcd5f('0x42')][_0xcd5f('0x4e')]){_0x62146b['where']=_['merge'](_0x62146b[_0xcd5f('0x4d')],{'$or':_['map'](_0x62146b[_0xcd5f('0x47')],function(_0x176b7b){var _0xea1243={};_0xea1243[_0x176b7b]={'$like':'%'+_0x169fc8['query'][_0xcd5f('0x4e')]+'%'};return _0xea1243;})});}_0x62146b=_[_0xcd5f('0x4f')]({},_0x62146b,_0x169fc8[_0xcd5f('0x50')]);return _0x675eab['getAgents'](_0x62146b);}})[_0xcd5f('0x1e')](function(_0x335866){if(_0x335866){_0x3b598c=_0x335866[_0xcd5f('0x48')];if(!_0x169fc8[_0xcd5f('0x42')][_0xcd5f('0x49')](_0xcd5f('0x4a'))){_0x62146b[_0xcd5f('0x2d')]=qs[_0xcd5f('0x2d')](_0x169fc8['query'][_0xcd5f('0x2d')]);_0x62146b['offset']=qs[_0xcd5f('0x2c')](_0x169fc8['query'][_0xcd5f('0x2c')]);}return _0x675eab[_0xcd5f('0xd8')](_0x62146b);}})[_0xcd5f('0x1e')](function(_0x5e28f7){if(_0x5e28f7){return _0x5e28f7?{'count':_0x3b598c,'rows':_0x5e28f7}:null;}})['then'](respondWithResult(_0x303995,null))[_0xcd5f('0x27')](handleError(_0x303995,null));}; \ No newline at end of file +var _0x3cae=['\x0a','json','addApplications','sequelize','transaction','findAndCountAll','getApplications','Contact','Owner','fullname','Tag','Tags','color','tag','List','DESC','out','Messages','dataValues','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','redif','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','spread','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','count','offset','limit','set','apply','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','findOne','order','pick','findAll','removeDispositions','ids','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','priority','account','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','Body','skebby','from','sender','text','clicksend','messageId','message_id','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','refid','from\x20is\x20mandatory','isNil','Sequelize','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','Contacts','omit','defaults','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','text/xml','send'];(function(_0x4a32b7,_0x50c1cb){var _0x5eb715=function(_0x354f37){while(--_0x354f37){_0x4a32b7['push'](_0x4a32b7['shift']());}};_0x5eb715(++_0x50c1cb);}(_0x3cae,0x117));var _0xe3ca=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x3cae[_0x54d4fe];return _0x1ab5bb;};'use strict';var pdf=require(_0xe3ca('0x0'));var emlformat=require(_0xe3ca('0x1'));var rimraf=require(_0xe3ca('0x2'));var zipdir=require(_0xe3ca('0x3'));var jsonpatch=require(_0xe3ca('0x4'));var rp=require(_0xe3ca('0x5'));var moment=require(_0xe3ca('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xe3ca('0x7'));var util=require(_0xe3ca('0x8'));var path=require('path');var sox=require(_0xe3ca('0x9'));var csv=require('to-csv');var ejs=require(_0xe3ca('0xa'));var fs=require('fs');var _=require(_0xe3ca('0xb'));var squel=require(_0xe3ca('0xc'));var crypto=require('crypto');var jsforce=require(_0xe3ca('0xd'));var deskjs=require(_0xe3ca('0xe'));var toCsv=require(_0xe3ca('0xf'));var querystring=require(_0xe3ca('0x10'));var Papa=require(_0xe3ca('0x11'));var Redis=require(_0xe3ca('0x12'));var authService=require(_0xe3ca('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe3ca('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3ca('0x15'))(_0xe3ca('0x16'));var utils=require(_0xe3ca('0x17'));var config=require(_0xe3ca('0x18'));var db=require(_0xe3ca('0x19'))['db'];config['redis']=_['defaults'](config[_0xe3ca('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3ca('0x1b'))(new Redis(config[_0xe3ca('0x1a')]));require('./smsAccount.socket')[_0xe3ca('0x1c')](socket);var jayson=require(_0xe3ca('0x1d'));var client=jayson[_0xe3ca('0x1e')][_0xe3ca('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x9ef773,_0x292251,_0x884795){if(_0x884795){var _0x337b6c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x337b6c['test'](_0x292251)){return _0x9ef773;}else{throw new db['Sequelize'][(_0xe3ca('0x20'))](_0xe3ca('0x21'));}}else{return _0x9ef773;}}function respondWithRpcPromise(_0x8c2e12,_0x3dae55,_0x1dd153,_0x2d73d9){return new BPromise(function(_0x5bb8d8,_0x2eafde){var _0xda5841=_0x2d73d9||client;return _0xda5841[_0xe3ca('0x22')](_0x8c2e12,_0x1dd153)['then'](function(_0x4b7b9f){logger['info'](_0xe3ca('0x23'),_0x3dae55,'request\x20sent');logger['debug'](_0xe3ca('0x24'),_0x3dae55,_0xe3ca('0x25'),JSON[_0xe3ca('0x26')](_0x4b7b9f));if(_0x4b7b9f[_0xe3ca('0x27')]){if(_0x4b7b9f[_0xe3ca('0x27')]['code']===0x1f4){logger[_0xe3ca('0x27')](_0xe3ca('0x23'),_0x3dae55,_0x4b7b9f['error'][_0xe3ca('0x28')]);return _0x2eafde(_0x4b7b9f[_0xe3ca('0x27')][_0xe3ca('0x28')]);}logger[_0xe3ca('0x27')](_0xe3ca('0x23'),_0x3dae55,_0x4b7b9f[_0xe3ca('0x27')][_0xe3ca('0x28')]);return _0x5bb8d8(_0x4b7b9f[_0xe3ca('0x27')][_0xe3ca('0x28')]);}else{logger[_0xe3ca('0x29')](_0xe3ca('0x23'),_0x3dae55,'request\x20sent');_0x5bb8d8(_0x4b7b9f[_0xe3ca('0x2a')]['message']);}})[_0xe3ca('0x2b')](function(_0x2fffe4){logger[_0xe3ca('0x27')](_0xe3ca('0x23'),_0x3dae55,_0x2fffe4);_0x2eafde(_0x2fffe4);});});}function respondWithStatusCode(_0x576491,_0x4c01c8){_0x4c01c8=_0x4c01c8||0xcc;return function(_0x2e1636){if(_0x2e1636){return _0x576491[_0xe3ca('0x2c')](_0x4c01c8);}return _0x576491[_0xe3ca('0x2d')](_0x4c01c8)['end']();};}function respondWithResult(_0x1dbd98,_0x39dd6e){_0x39dd6e=_0x39dd6e||0xc8;return function(_0x1d28a2){if(_0x1d28a2){return _0x1dbd98[_0xe3ca('0x2d')](_0x39dd6e)['json'](_0x1d28a2);}};}function respondWithFilteredResult(_0x4dd07f,_0xf90c19){return function(_0x571052){if(_0x571052){var _0x24d40a=_0x571052[_0xe3ca('0x2e')],_0x5cf384=_0xf90c19[_0xe3ca('0x2f')],_0x5576b4=_0xf90c19[_0xe3ca('0x2f')]+_0xf90c19[_0xe3ca('0x30')],_0xd5e714;if(_0x5576b4>=_0x24d40a){_0x5576b4=_0x24d40a;_0xd5e714=0xc8;}else{_0xd5e714=0xce;}_0x4dd07f['status'](_0xd5e714);return _0x4dd07f[_0xe3ca('0x31')]('Content-Range',_0x5cf384+'-'+_0x5576b4+'/'+_0x24d40a)['json'](_0x571052);}return null;};}function patchUpdates(_0x5bf12f){return function(_0x1acc28){try{jsonpatch[_0xe3ca('0x32')](_0x1acc28,_0x5bf12f,!![]);}catch(_0x2f0cb9){return BPromise[_0xe3ca('0x33')](_0x2f0cb9);}return _0x1acc28[_0xe3ca('0x34')]();};}function saveUpdates(_0x1e8145,_0x4417d9){return function(_0x1b9931){if(_0x1b9931){return _0x1b9931[_0xe3ca('0x35')](_0x1e8145)[_0xe3ca('0x36')](function(_0x14c97d){return _0x14c97d;});}return null;};}function removeEntity(_0x50379d,_0x1dcf38){return function(_0x8c7a49){if(_0x8c7a49){return _0x8c7a49[_0xe3ca('0x37')]()[_0xe3ca('0x36')](function(){var _0xdf7c28=_0x8c7a49[_0xe3ca('0x38')]({'plain':!![]});var _0x59413d=_0xe3ca('0x39');return db[_0xe3ca('0x3a')][_0xe3ca('0x37')]({'where':{'type':_0x59413d,'resourceId':_0xdf7c28['id']}})[_0xe3ca('0x36')](function(){return _0x8c7a49;});})[_0xe3ca('0x36')](function(){_0x50379d[_0xe3ca('0x2d')](0xcc)[_0xe3ca('0x3b')]();});}};}function handleEntityNotFound(_0x3ab78c,_0x12714c){return function(_0x54e155){if(!_0x54e155){_0x3ab78c[_0xe3ca('0x2c')](0x194);}return _0x54e155;};}function handleError(_0x1effdb,_0x498c1c){_0x498c1c=_0x498c1c||0x1f4;return function(_0x34da03){logger[_0xe3ca('0x27')](_0x34da03[_0xe3ca('0x3c')]);if(_0x34da03['name']){delete _0x34da03[_0xe3ca('0x3d')];}_0x1effdb[_0xe3ca('0x2d')](_0x498c1c)['send'](_0x34da03);};}exports[_0xe3ca('0x3e')]=function(_0x5afeeb,_0x4efb4c){var _0x14e94a={'include':[{'model':db[_0xe3ca('0x3f')],'as':_0xe3ca('0x40')}]},_0x3a0d95={},_0x53e2c0={'count':0x0,'rows':[]};var _0xa1b3fa=_[_0xe3ca('0x41')](db[_0xe3ca('0x42')][_0xe3ca('0x43')],function(_0x3082ea){return{'name':_0x3082ea[_0xe3ca('0x44')],'type':_0x3082ea[_0xe3ca('0x45')]['key']};});_0x3a0d95[_0xe3ca('0x46')]=_[_0xe3ca('0x41')](_0xa1b3fa,_0xe3ca('0x3d'));_0x3a0d95[_0xe3ca('0x47')]=_[_0xe3ca('0x48')](_0x5afeeb[_0xe3ca('0x47')]);_0x3a0d95[_0xe3ca('0x49')]=_[_0xe3ca('0x4a')](_0x3a0d95[_0xe3ca('0x46')],_0x3a0d95[_0xe3ca('0x47')]);_0x14e94a[_0xe3ca('0x4b')]=_[_0xe3ca('0x4a')](_0x3a0d95[_0xe3ca('0x46')],qs['fields'](_0x5afeeb[_0xe3ca('0x47')][_0xe3ca('0x4c')]));_0x14e94a['attributes']=_0x14e94a[_0xe3ca('0x4b')][_0xe3ca('0x4d')]?_0x14e94a[_0xe3ca('0x4b')]:_0x3a0d95[_0xe3ca('0x46')];if(!_0x5afeeb[_0xe3ca('0x47')][_0xe3ca('0x4e')](_0xe3ca('0x4f'))){_0x14e94a[_0xe3ca('0x30')]=qs[_0xe3ca('0x30')](_0x5afeeb[_0xe3ca('0x47')][_0xe3ca('0x30')]);_0x14e94a['offset']=qs[_0xe3ca('0x2f')](_0x5afeeb[_0xe3ca('0x47')]['offset']);}_0x14e94a['order']=qs[_0xe3ca('0x50')](_0x5afeeb[_0xe3ca('0x47')]['sort']);_0x14e94a[_0xe3ca('0x51')]=qs[_0xe3ca('0x49')](_['pick'](_0x5afeeb['query'],_0x3a0d95[_0xe3ca('0x49')]));if(_0x5afeeb[_0xe3ca('0x47')][_0xe3ca('0x52')]){_0x14e94a[_0xe3ca('0x51')]=_[_0xe3ca('0x53')](_0x14e94a['where'],{'$or':_[_0xe3ca('0x41')](_0xa1b3fa,function(_0x8c99e5){if(_0x8c99e5[_0xe3ca('0x45')]!==_0xe3ca('0x54')){var _0x396555={};_0x396555[_0x8c99e5[_0xe3ca('0x3d')]]={'$like':'%'+_0x5afeeb[_0xe3ca('0x47')][_0xe3ca('0x52')]+'%'};return _0x396555;}})});}_0x14e94a=_[_0xe3ca('0x53')]({},_0x14e94a,_0x5afeeb['options']);var _0x5cc30e={'where':_0x14e94a['where']};return db[_0xe3ca('0x42')][_0xe3ca('0x2e')](_0x5cc30e)[_0xe3ca('0x36')](function(_0x58b87a){_0x53e2c0['count']=_0x58b87a;if(_0x5afeeb[_0xe3ca('0x47')][_0xe3ca('0x55')]){_0x14e94a[_0xe3ca('0x56')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x14e94a);})[_0xe3ca('0x36')](function(_0x550573){_0x53e2c0[_0xe3ca('0x57')]=_0x550573;return _0x53e2c0;})[_0xe3ca('0x36')](respondWithFilteredResult(_0x4efb4c,_0x14e94a))[_0xe3ca('0x2b')](handleError(_0x4efb4c,null));};exports[_0xe3ca('0x58')]=function(_0xc088fd,_0xf6502a){var _0x32a135={'raw':![],'where':{'id':_0xc088fd[_0xe3ca('0x59')]['id']},'include':[{'model':db[_0xe3ca('0x3f')],'as':_0xe3ca('0x40')}]},_0x1f5d44={};_0x1f5d44['model']=_[_0xe3ca('0x48')](db[_0xe3ca('0x42')]['rawAttributes']);_0x1f5d44[_0xe3ca('0x47')]=_[_0xe3ca('0x48')](_0xc088fd[_0xe3ca('0x47')]);_0x1f5d44[_0xe3ca('0x49')]=_['intersection'](_0x1f5d44['model'],_0x1f5d44[_0xe3ca('0x47')]);_0x32a135[_0xe3ca('0x4b')]=_[_0xe3ca('0x4a')](_0x1f5d44['model'],qs[_0xe3ca('0x4c')](_0xc088fd[_0xe3ca('0x47')][_0xe3ca('0x4c')]));_0x32a135['attributes']=_0x32a135[_0xe3ca('0x4b')][_0xe3ca('0x4d')]?_0x32a135[_0xe3ca('0x4b')]:_0x1f5d44[_0xe3ca('0x46')];if(_0xc088fd[_0xe3ca('0x47')][_0xe3ca('0x55')]){_0x32a135[_0xe3ca('0x56')]=[{'all':!![]}];}_0x32a135=_[_0xe3ca('0x53')]({},_0x32a135,_0xc088fd[_0xe3ca('0x5a')]);return db['SmsAccount'][_0xe3ca('0x5b')](_0x32a135)[_0xe3ca('0x36')](handleEntityNotFound(_0xf6502a,null))[_0xe3ca('0x36')](respondWithResult(_0xf6502a,null))[_0xe3ca('0x2b')](handleError(_0xf6502a,null));};exports[_0xe3ca('0x5c')]=function(_0x304ce3,_0x1161b9){return db['SmsAccount'][_0xe3ca('0x5c')](_0x304ce3[_0xe3ca('0x5d')],{})['then'](function(_0x15682e){var _0x31b46a=_0x304ce3['user']['get']({'plain':!![]});if(!_0x31b46a)throw new Error(_0xe3ca('0x5e'));if(_0x31b46a[_0xe3ca('0x5f')]===_0xe3ca('0x60')){var _0x5ca9a4=_0x15682e['get']({'plain':!![]});var _0xae6d39='SmsAccounts';return db[_0xe3ca('0x61')][_0xe3ca('0x5b')]({'where':{'name':_0xae6d39,'userProfileId':_0x31b46a[_0xe3ca('0x62')]},'raw':!![]})[_0xe3ca('0x36')](function(_0x309ce0){if(_0x309ce0&&_0x309ce0[_0xe3ca('0x63')]===0x0){return db[_0xe3ca('0x3a')][_0xe3ca('0x5c')]({'name':_0x5ca9a4[_0xe3ca('0x3d')],'resourceId':_0x5ca9a4['id'],'type':_0x309ce0[_0xe3ca('0x3d')],'sectionId':_0x309ce0['id']},{})['then'](function(){return _0x15682e;});}else{return _0x15682e;}})[_0xe3ca('0x2b')](function(_0x223899){logger[_0xe3ca('0x27')](_0xe3ca('0x64'),_0x223899);throw _0x223899;});}return _0x15682e;})[_0xe3ca('0x36')](respondWithResult(_0x1161b9,0xc9))['catch'](handleError(_0x1161b9,null));};exports[_0xe3ca('0x35')]=function(_0x26a544,_0x442781){if(_0x26a544[_0xe3ca('0x5d')]['id']){delete _0x26a544[_0xe3ca('0x5d')]['id'];}return db[_0xe3ca('0x42')][_0xe3ca('0x5b')]({'where':{'id':_0x26a544[_0xe3ca('0x59')]['id']},'include':[{'model':db[_0xe3ca('0x3f')],'as':_0xe3ca('0x40')}]})[_0xe3ca('0x36')](handleEntityNotFound(_0x442781,null))['then'](saveUpdates(_0x26a544['body'],null))[_0xe3ca('0x36')](respondWithResult(_0x442781,null))['catch'](handleError(_0x442781,null));};exports[_0xe3ca('0x37')]=function(_0x138285,_0x225fbf){return db[_0xe3ca('0x42')]['find']({'where':{'id':_0x138285[_0xe3ca('0x59')]['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x225fbf,null))['then'](removeEntity(_0x225fbf,null))['catch'](handleError(_0x225fbf,null));};exports[_0xe3ca('0x65')]=function(_0x369a7a,_0x121383){return db[_0xe3ca('0x42')][_0xe3ca('0x65')]()[_0xe3ca('0x36')](respondWithResult(_0x121383,null))[_0xe3ca('0x2b')](handleError(_0x121383,null));};exports['addDisposition']=function(_0x1082e2,_0x38b797,_0x451505){if(_0x1082e2[_0xe3ca('0x5d')]['id']){delete _0x1082e2['body']['id'];}return db['SmsAccount'][_0xe3ca('0x5b')]({'where':{'id':_0x1082e2[_0xe3ca('0x59')]['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x38b797,null))[_0xe3ca('0x36')](function(_0x172e34){if(_0x172e34){_0x1082e2['body'][_0xe3ca('0x66')]=_0x172e34['id'];return db[_0xe3ca('0x67')][_0xe3ca('0x5c')](_0x1082e2[_0xe3ca('0x5d')]);}})[_0xe3ca('0x36')](respondWithResult(_0x38b797,null))[_0xe3ca('0x2b')](handleError(_0x38b797,null));};exports[_0xe3ca('0x68')]=function(_0x7c1f3a,_0x51c996,_0x1d2cd2){var _0x141ea9={'raw':![],'where':{}};var _0x27034c={};var _0x330216={'count':0x0,'rows':[]};return db[_0xe3ca('0x42')][_0xe3ca('0x69')]({'where':{'id':_0x7c1f3a['params']['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x51c996,null))[_0xe3ca('0x36')](function(_0x3cb361){if(_0x3cb361){_0x27034c['model']=_[_0xe3ca('0x48')](db[_0xe3ca('0x67')]['rawAttributes']);_0x27034c[_0xe3ca('0x47')]=_[_0xe3ca('0x48')](_0x7c1f3a[_0xe3ca('0x47')]);_0x27034c[_0xe3ca('0x49')]=_[_0xe3ca('0x4a')](_0x27034c['model'],_0x27034c[_0xe3ca('0x47')]);_0x141ea9[_0xe3ca('0x4b')]=_['intersection'](_0x27034c[_0xe3ca('0x46')],qs[_0xe3ca('0x4c')](_0x7c1f3a['query'][_0xe3ca('0x4c')]));_0x141ea9[_0xe3ca('0x4b')]=_0x141ea9['attributes'][_0xe3ca('0x4d')]?_0x141ea9[_0xe3ca('0x4b')]:_0x27034c[_0xe3ca('0x46')];if(!_0x7c1f3a[_0xe3ca('0x47')][_0xe3ca('0x4e')](_0xe3ca('0x4f'))){_0x141ea9[_0xe3ca('0x30')]=qs['limit'](_0x7c1f3a['query'][_0xe3ca('0x30')]);_0x141ea9[_0xe3ca('0x2f')]=qs[_0xe3ca('0x2f')](_0x7c1f3a[_0xe3ca('0x47')]['offset']);}_0x141ea9[_0xe3ca('0x6a')]=qs['sort'](_0x7c1f3a[_0xe3ca('0x47')][_0xe3ca('0x50')]);_0x141ea9[_0xe3ca('0x51')]=qs[_0xe3ca('0x49')](_[_0xe3ca('0x6b')](_0x7c1f3a[_0xe3ca('0x47')],_0x27034c[_0xe3ca('0x49')]));_0x141ea9[_0xe3ca('0x51')][_0xe3ca('0x66')]=_0x3cb361['id'];if(_0x7c1f3a['query']['filter']){_0x141ea9['where']=_[_0xe3ca('0x53')](_0x141ea9['where'],{'$or':_[_0xe3ca('0x41')](_0x141ea9['attributes'],function(_0xf33d8a){var _0x54001e={};_0x54001e[_0xf33d8a]={'$like':'%'+_0x7c1f3a[_0xe3ca('0x47')][_0xe3ca('0x52')]+'%'};return _0x54001e;})});}_0x141ea9=_[_0xe3ca('0x53')]({},_0x141ea9,_0x7c1f3a[_0xe3ca('0x5a')]);return db['Disposition']['count']({'where':_0x141ea9[_0xe3ca('0x51')]})[_0xe3ca('0x36')](function(_0x5f3a6a){_0x330216[_0xe3ca('0x2e')]=_0x5f3a6a;if(_0x7c1f3a[_0xe3ca('0x47')][_0xe3ca('0x55')]){_0x141ea9[_0xe3ca('0x56')]=[{'all':!![]}];}return db[_0xe3ca('0x67')][_0xe3ca('0x6c')](_0x141ea9);})[_0xe3ca('0x36')](function(_0x4d1906){_0x330216[_0xe3ca('0x57')]=_0x4d1906;return _0x330216;});}})[_0xe3ca('0x36')](respondWithFilteredResult(_0x51c996,_0x141ea9))[_0xe3ca('0x2b')](handleError(_0x51c996,null));};exports[_0xe3ca('0x6d')]=function(_0x7aad69,_0x5df0ab,_0x22685d){return db[_0xe3ca('0x42')][_0xe3ca('0x5b')]({'where':{'id':_0x7aad69[_0xe3ca('0x59')]['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x5df0ab,null))['then'](function(_0x52ae61){if(_0x52ae61){return _0x52ae61[_0xe3ca('0x6d')](_0x7aad69[_0xe3ca('0x47')][_0xe3ca('0x6e')]);}})[_0xe3ca('0x36')](respondWithStatusCode(_0x5df0ab,null))[_0xe3ca('0x2b')](handleError(_0x5df0ab,null));};exports['addAnswer']=function(_0x3b16df,_0x2767a3,_0x8237dc){if(_0x3b16df[_0xe3ca('0x5d')]['id']){delete _0x3b16df['body']['id'];}return db[_0xe3ca('0x42')][_0xe3ca('0x5b')]({'where':{'id':_0x3b16df['params']['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x2767a3,null))[_0xe3ca('0x36')](function(_0x1d074c){if(_0x1d074c){_0x3b16df[_0xe3ca('0x5d')]['SmsAccountId']=_0x1d074c['id'];return db[_0xe3ca('0x6f')]['create'](_0x3b16df['body']);}})['then'](respondWithResult(_0x2767a3,null))['catch'](handleError(_0x2767a3,null));};exports['getAnswers']=function(_0x513ed0,_0x1105ad,_0x5ed8a1){var _0x1f244f={'raw':![],'where':{}};var _0x42cf41={};var _0x40440f={'count':0x0,'rows':[]};return db[_0xe3ca('0x42')][_0xe3ca('0x69')]({'where':{'id':_0x513ed0[_0xe3ca('0x59')]['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x1105ad,null))[_0xe3ca('0x36')](function(_0x400347){if(_0x400347){_0x42cf41['model']=_['keys'](db[_0xe3ca('0x6f')][_0xe3ca('0x43')]);_0x42cf41[_0xe3ca('0x47')]=_[_0xe3ca('0x48')](_0x513ed0[_0xe3ca('0x47')]);_0x42cf41[_0xe3ca('0x49')]=_[_0xe3ca('0x4a')](_0x42cf41[_0xe3ca('0x46')],_0x42cf41[_0xe3ca('0x47')]);_0x1f244f[_0xe3ca('0x4b')]=_['intersection'](_0x42cf41['model'],qs[_0xe3ca('0x4c')](_0x513ed0[_0xe3ca('0x47')][_0xe3ca('0x4c')]));_0x1f244f[_0xe3ca('0x4b')]=_0x1f244f[_0xe3ca('0x4b')][_0xe3ca('0x4d')]?_0x1f244f[_0xe3ca('0x4b')]:_0x42cf41['model'];if(!_0x513ed0[_0xe3ca('0x47')][_0xe3ca('0x4e')]('nolimit')){_0x1f244f[_0xe3ca('0x30')]=qs[_0xe3ca('0x30')](_0x513ed0[_0xe3ca('0x47')][_0xe3ca('0x30')]);_0x1f244f[_0xe3ca('0x2f')]=qs['offset'](_0x513ed0[_0xe3ca('0x47')][_0xe3ca('0x2f')]);}_0x1f244f['order']=qs[_0xe3ca('0x50')](_0x513ed0[_0xe3ca('0x47')][_0xe3ca('0x50')]);_0x1f244f['where']=qs[_0xe3ca('0x49')](_[_0xe3ca('0x6b')](_0x513ed0[_0xe3ca('0x47')],_0x42cf41[_0xe3ca('0x49')]));_0x1f244f[_0xe3ca('0x51')]['SmsAccountId']=_0x400347['id'];if(_0x513ed0['query'][_0xe3ca('0x52')]){_0x1f244f[_0xe3ca('0x51')]=_[_0xe3ca('0x53')](_0x1f244f[_0xe3ca('0x51')],{'$or':_[_0xe3ca('0x41')](_0x1f244f[_0xe3ca('0x4b')],function(_0x2c18a7){var _0x5d10ec={};_0x5d10ec[_0x2c18a7]={'$like':'%'+_0x513ed0['query']['filter']+'%'};return _0x5d10ec;})});}_0x1f244f=_[_0xe3ca('0x53')]({},_0x1f244f,_0x513ed0[_0xe3ca('0x5a')]);return db['CannedAnswer'][_0xe3ca('0x2e')]({'where':_0x1f244f[_0xe3ca('0x51')]})[_0xe3ca('0x36')](function(_0x29c598){_0x40440f[_0xe3ca('0x2e')]=_0x29c598;if(_0x513ed0['query'][_0xe3ca('0x55')]){_0x1f244f['include']=[{'all':!![]}];}return db[_0xe3ca('0x6f')][_0xe3ca('0x6c')](_0x1f244f);})[_0xe3ca('0x36')](function(_0x30addd){_0x40440f['rows']=_0x30addd;return _0x40440f;});}})[_0xe3ca('0x36')](respondWithFilteredResult(_0x1105ad,_0x1f244f))[_0xe3ca('0x2b')](handleError(_0x1105ad,null));};exports['removeAnswers']=function(_0x490f44,_0x509628,_0x5c8468){return db[_0xe3ca('0x42')][_0xe3ca('0x5b')]({'where':{'id':_0x490f44[_0xe3ca('0x59')]['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x509628,null))[_0xe3ca('0x36')](function(_0x408773){if(_0x408773){return _0x408773[_0xe3ca('0x70')](_0x490f44['query'][_0xe3ca('0x6e')]);}})[_0xe3ca('0x36')](respondWithStatusCode(_0x509628,null))[_0xe3ca('0x2b')](handleError(_0x509628,null));};exports[_0xe3ca('0x71')]=function(_0xa4aa44,_0x3f7754,_0x175d22){var _0x2ea0eb={'channel':_0xe3ca('0x72')};var _0x2e0672=[];var _0x260f9e=[];var _0x405ce1={};return db[_0xe3ca('0x42')][_0xe3ca('0x5b')]({'where':{'id':_0xa4aa44['params']['id']},'include':[{'model':db[_0xe3ca('0x73')],'as':_0xe3ca('0x74')}]})['then'](handleEntityNotFound(_0x3f7754,null))[_0xe3ca('0x36')](function(_0x92f8e9){_0x2ea0eb['account']=_0x92f8e9;_0x2ea0eb[_0xe3ca('0x75')]=_[_0xe3ca('0x76')](_0x92f8e9['Applications'],[_0xe3ca('0x77')],['asc']);if(_0x2ea0eb['account'][_0xe3ca('0x74')]){delete _0x2ea0eb[_0xe3ca('0x78')][_0xe3ca('0x74')];}return db[_0xe3ca('0x79')]['describe']();})['then'](function(_0x395be4){if(!_0x395be4){throw new db['Sequelize'][(_0xe3ca('0x20'))](_0xe3ca('0x7a'));}_0x2e0672=_[_0xe3ca('0x7b')](_[_0xe3ca('0x48')](_0x395be4),[_0xe3ca('0x7c'),_0xe3ca('0x7d')]);_0x260f9e=_[_0xe3ca('0x7b')](_[_0xe3ca('0x48')](_0x395be4),[_0xe3ca('0x7c'),_0xe3ca('0x7d'),_0xe3ca('0x7e'),_0xe3ca('0x7f')]);_0x2ea0eb[_0xe3ca('0x5d')]={'mapKey':_0xe3ca('0x80')};if(_0x2ea0eb['account'][_0xe3ca('0x45')]){switch(_0x2ea0eb[_0xe3ca('0x78')][_0xe3ca('0x45')]){case _0xe3ca('0x81'):_0x2ea0eb[_0xe3ca('0x5d')]['from']=_0xa4aa44['body']['From'];_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x5d')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x82')];_0x2ea0eb[_0xe3ca('0x5d')]['messageId']=_0xa4aa44['body']['MessageSid'];break;case _0xe3ca('0x83'):_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')]='+'+_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x85')];_0x2ea0eb['body'][_0xe3ca('0x5d')]=_0xa4aa44['body'][_0xe3ca('0x86')];break;case'connectel':_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x84')];_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x5d')]=_0xa4aa44['body'][_0xe3ca('0x28')];break;case _0xe3ca('0x87'):_0x2ea0eb[_0xe3ca('0x5d')]['from']=_0xa4aa44[_0xe3ca('0x5d')]['from'];_0x2ea0eb['body'][_0xe3ca('0x5d')]=_0xa4aa44['body'][_0xe3ca('0x5d')];_0x2ea0eb['body'][_0xe3ca('0x88')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x89')];break;case _0xe3ca('0x8a'):_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x8b')];_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x5d')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x8c')];_0x2ea0eb['body'][_0xe3ca('0x88')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x8d')];break;case _0xe3ca('0x8e'):_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')]='+'+_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x8f')][0x0][_0xe3ca('0x84')];_0x2ea0eb['body'][_0xe3ca('0x5d')]=_0xa4aa44['body']['results'][0x0][_0xe3ca('0x86')];_0x2ea0eb['body']['messageId']=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x8f')][0x0][_0xe3ca('0x88')];break;case _0xe3ca('0x90'):_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x91')];_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x5d')]=_0xa4aa44[_0xe3ca('0x5d')]['segmentedMessage'][_0xe3ca('0x28')];break;case _0xe3ca('0x92'):_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x93')];_0x2ea0eb[_0xe3ca('0x5d')]['body']=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x86')];_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x88')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x94')];break;case _0xe3ca('0x95'):_0x2ea0eb[_0xe3ca('0x5d')]['from']=_0xa4aa44['body']['from'];_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x5d')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x28')];_0x2ea0eb['body'][_0xe3ca('0x88')]=_0xa4aa44[_0xe3ca('0x5d')][_0xe3ca('0x96')];break;}}if(_0x2ea0eb[_0xe3ca('0x5d')]['id']){delete _0x2ea0eb[_0xe3ca('0x5d')]['id'];}if(_['isNil'](_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')])){throw new db['Sequelize'][(_0xe3ca('0x20'))](_0xe3ca('0x97'));}if(_[_0xe3ca('0x98')](_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x5d')])||_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x5d')]===''){throw new db[(_0xe3ca('0x99'))][(_0xe3ca('0x20'))](_0xe3ca('0x9a'));}if(_['isNil'](_0x2ea0eb['body']['mapKey'])){throw new db['Sequelize'][(_0xe3ca('0x20'))](_0xe3ca('0x9b')+_0x260f9e);}if(!_[_0xe3ca('0x9c')](_0x260f9e,_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x9d')])){throw new db['Sequelize'][(_0xe3ca('0x20'))](_0xe3ca('0x9e')+_0x260f9e);}_0x405ce1[_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x9d')]]=_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')];return db[_0xe3ca('0x9f')][_0xe3ca('0x5b')]({'where':{'id':_0x2ea0eb[_0xe3ca('0x78')][_0xe3ca('0x7f')]},'include':[{'model':db['CmContact'],'as':_0xe3ca('0xa0'),'where':_0x405ce1,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xe3ca('0x36')](handleEntityNotFound(_0x3f7754,null))[_0xe3ca('0x36')](function(_0x2d026e){if(_0x2d026e){_0x2ea0eb['list']=_[_0xe3ca('0xa1')](_0x2d026e,[_0xe3ca('0xa0')]);if(_0x2d026e[_0xe3ca('0xa0')][_0xe3ca('0x4d')]){return _0x2d026e[_0xe3ca('0xa0')][0x0];}var _0x1361c2=_[_0xe3ca('0xa2')](_0x2ea0eb['body'],{'firstName':_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')],'ListId':_0x2d026e['id']});_0x1361c2[_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x9d')]]=_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')];return db[_0xe3ca('0x79')][_0xe3ca('0x5c')](_0x1361c2,{'fields':_0x2e0672,'raw':!![]});}})[_0xe3ca('0x36')](handleEntityNotFound(_0x3f7754,null))[_0xe3ca('0x36')](function(_0x5dad90){if(_0x5dad90){_0x2ea0eb[_0xe3ca('0xa3')]=_0x5dad90;var _0x580ee4={'ContactId':_0x5dad90['id'],'phone':_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x84')],'SmsAccountId':_0xa4aa44[_0xe3ca('0x59')]['id']};var _0x4d5812={'ContactId':_0x5dad90['id'],'SmsAccountId':_0xa4aa44[_0xe3ca('0x59')]['id'],'closed':![]};return db[_0xe3ca('0xa4')][_0xe3ca('0x5b')]({'where':_0x4d5812})['then'](function(_0x85b84d){if(_0x85b84d){return[_0x85b84d,![]];}return db[_0xe3ca('0xa4')][_0xe3ca('0x5c')](_0x580ee4)[_0xe3ca('0x36')](function(_0x28a5ba){return[_0x28a5ba,!![]];});});}})['spread'](function(_0x52190d,_0x3d3463){_0x2ea0eb[_0xe3ca('0xa5')]=_0x52190d['get']({'plain':!![]});_0x2ea0eb['interaction'][_0xe3ca('0xa6')]=![];if(_0x3d3463){if(_0x2ea0eb[_0xe3ca('0x78')][_0xe3ca('0xa7')]){_0x2ea0eb[_0xe3ca('0x75')][_0xe3ca('0xa8')]({'id':0x0,'priority':_0x2ea0eb[_0xe3ca('0x75')][_0xe3ca('0x4d')]+0x1,'app':_0xe3ca('0xa9'),'appdata':_0xe3ca('0xaa'),'interval':_0xe3ca('0xab')});}_0x2ea0eb[_0xe3ca('0xa5')][_0xe3ca('0xa6')]=!![];}return db[_0xe3ca('0xac')][_0xe3ca('0x5c')]({'phone':_0x2ea0eb['body'][_0xe3ca('0x84')],'messageId':_0x2ea0eb[_0xe3ca('0x5d')][_0xe3ca('0x88')],'body':_0x2ea0eb[_0xe3ca('0x5d')]['body'],'SmsAccountId':_0xa4aa44[_0xe3ca('0x59')]['id'],'SmsInteractionId':_0x52190d['id'],'direction':'in','ContactId':_0x52190d['ContactId'],'AttachmentId':_0x2ea0eb['body'][_0xe3ca('0xad')]});})['then'](function(_0x14db4e){_0x2ea0eb['message']=_0x14db4e;if(_0x2ea0eb['interaction'][_0xe3ca('0xae')]){return db[_0xe3ca('0xaf')]['find']({'attributes':['id','name'],'where':{'id':_0x2ea0eb['interaction'][_0xe3ca('0xae')]}})[_0xe3ca('0x36')](function(_0x2c36fc){if(_0x2c36fc){_0x2ea0eb[_0xe3ca('0x75')][_0xe3ca('0xb0')]({'id':0x0,'priority':0x0,'app':_0xe3ca('0xb1'),'appdata':_0x2c36fc[_0xe3ca('0x3d')]+','+(_0x2ea0eb['account'][_0xe3ca('0xb2')]||0xa),'interval':_0xe3ca('0xab')});}return respondWithRpcPromise(_0xe3ca('0xb3'),'startRouting',_0x2ea0eb);});}return respondWithRpcPromise(_0xe3ca('0xb3'),_0xe3ca('0xb4'),_0x2ea0eb);})[_0xe3ca('0x36')](function(_0x24e3dd){if(_0x24e3dd){var _0x36fbd8=0xc8;var _0x2ea465=_0xe3ca('0xb5');logger[_0xe3ca('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2ea465,_0x36fbd8,_0xe3ca('0xb6'));logger[_0xe3ca('0xb7')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2ea465,_0x36fbd8,_0xe3ca('0xb6'),JSON[_0xe3ca('0x26')](_0x24e3dd));if(_0x2ea0eb['account'][_0xe3ca('0x45')]===_0xe3ca('0x81')){return _0x3f7754['status'](_0x36fbd8)[_0xe3ca('0x31')](_0xe3ca('0xb8'),_0xe3ca('0xb9'))[_0xe3ca('0xba')](_0xe3ca('0xbb'));}else{return _0x3f7754[_0xe3ca('0x2d')](_0x36fbd8)[_0xe3ca('0xbc')](_0x24e3dd);}}})['catch'](handleError(_0x3f7754,null));};exports[_0xe3ca('0xbd')]=function(_0x21f031,_0x5da0ce,_0x2b99aa){return db['SmsAccount']['findOne']({'where':{'id':_0x21f031['params']['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x5da0ce,null))[_0xe3ca('0x36')](function(_0x19f044){if(_0x19f044){return db[_0xe3ca('0xbe')][_0xe3ca('0xbf')](function(_0x2c3529){return db[_0xe3ca('0x73')]['destroy']({'where':{'SmsAccountId':_0x21f031[_0xe3ca('0x59')]['id']},'transaction':_0x2c3529})['then'](function(_0x4a4537){var _0x5e86b7=_[_0xe3ca('0x41')](_0x21f031[_0xe3ca('0x5d')],function(_0x575ee5){_0x575ee5[_0xe3ca('0x66')]=_0x21f031[_0xe3ca('0x59')]['id'];return _0x575ee5;});return db[_0xe3ca('0x73')]['bulkCreate'](_0x5e86b7,{'transaction':_0x2c3529});});})['then'](function(){return db['SmsApplication'][_0xe3ca('0xc0')]({'where':{'SmsAccountId':_0x21f031[_0xe3ca('0x59')]['id']},'order':_0xe3ca('0x77')});});}})[_0xe3ca('0x36')](respondWithResult(_0x5da0ce,null))['catch'](handleError(_0x5da0ce,null));};exports[_0xe3ca('0xc1')]=function(_0x5a3edc,_0x452a32,_0x454ca3){var _0x18753f={};var _0x3bde7a={};var _0x4d3ac9;var _0x23a1c1;return db[_0xe3ca('0x42')][_0xe3ca('0x69')]({'where':{'id':_0x5a3edc[_0xe3ca('0x59')]['id']}})['then'](handleEntityNotFound(_0x452a32,null))[_0xe3ca('0x36')](function(_0x13cc89){if(_0x13cc89){_0x4d3ac9=_0x13cc89;_0x3bde7a[_0xe3ca('0x46')]=_[_0xe3ca('0x48')](db['SmsApplication']['rawAttributes']);_0x3bde7a[_0xe3ca('0x47')]=_[_0xe3ca('0x48')](_0x5a3edc['query']);_0x3bde7a[_0xe3ca('0x49')]=_['intersection'](_0x3bde7a[_0xe3ca('0x46')],_0x3bde7a[_0xe3ca('0x47')]);_0x18753f['attributes']=_[_0xe3ca('0x4a')](_0x3bde7a[_0xe3ca('0x46')],qs[_0xe3ca('0x4c')](_0x5a3edc['query']['fields']));_0x18753f[_0xe3ca('0x4b')]=_0x18753f['attributes'][_0xe3ca('0x4d')]?_0x18753f[_0xe3ca('0x4b')]:_0x3bde7a[_0xe3ca('0x46')];_0x18753f['order']=qs[_0xe3ca('0x50')](_0x5a3edc['query']['sort']);_0x18753f['where']=qs['filters'](_[_0xe3ca('0x6b')](_0x5a3edc[_0xe3ca('0x47')],_0x3bde7a[_0xe3ca('0x49')]));if(_0x5a3edc[_0xe3ca('0x47')][_0xe3ca('0x52')]){_0x18753f[_0xe3ca('0x51')]=_[_0xe3ca('0x53')](_0x18753f[_0xe3ca('0x51')],{'$or':_[_0xe3ca('0x41')](_0x18753f[_0xe3ca('0x4b')],function(_0x12fd46){var _0x2d218a={};_0x2d218a[_0x12fd46]={'$like':'%'+_0x5a3edc[_0xe3ca('0x47')][_0xe3ca('0x52')]+'%'};return _0x2d218a;})});}_0x18753f=_['merge']({},_0x18753f,_0x5a3edc[_0xe3ca('0x5a')]);return _0x4d3ac9['getApplications'](_0x18753f);}})[_0xe3ca('0x36')](function(_0x452632){if(_0x452632){_0x23a1c1=_0x452632[_0xe3ca('0x4d')];if(!_0x5a3edc[_0xe3ca('0x47')][_0xe3ca('0x4e')]('nolimit')){_0x18753f[_0xe3ca('0x30')]=qs[_0xe3ca('0x30')](_0x5a3edc[_0xe3ca('0x47')]['limit']);_0x18753f[_0xe3ca('0x2f')]=qs[_0xe3ca('0x2f')](_0x5a3edc[_0xe3ca('0x47')][_0xe3ca('0x2f')]);}return _0x4d3ac9[_0xe3ca('0xc1')](_0x18753f);}})['then'](function(_0x2590cd){if(_0x2590cd){return _0x2590cd?{'count':_0x23a1c1,'rows':_0x2590cd}:null;}})[_0xe3ca('0x36')](respondWithResult(_0x452a32,null))[_0xe3ca('0x2b')](handleError(_0x452a32,null));};exports['getInteractions']=function(_0x585b1c,_0x59982d,_0x1f8e60){var _0x1dd6cb={'raw':![],'where':{}};var _0x33f930={};var _0x4672e3={'count':0x0,'rows':[]};return db[_0xe3ca('0x42')][_0xe3ca('0x69')]({'where':{'id':_0x585b1c[_0xe3ca('0x59')]['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x59982d,null))[_0xe3ca('0x36')](function(_0x6bdf43){if(_0x6bdf43){_0x33f930[_0xe3ca('0x46')]=_['keys'](db[_0xe3ca('0xa4')]['rawAttributes']);_0x33f930[_0xe3ca('0x47')]=_['keys'](_0x585b1c['query']);_0x33f930[_0xe3ca('0x49')]=_['intersection'](_0x33f930[_0xe3ca('0x46')],_0x33f930['query']);_0x1dd6cb[_0xe3ca('0x4b')]=_[_0xe3ca('0x4a')](_0x33f930['model'],qs[_0xe3ca('0x4c')](_0x585b1c[_0xe3ca('0x47')]['fields']));_0x1dd6cb['attributes']=_0x1dd6cb['attributes'][_0xe3ca('0x4d')]?_0x1dd6cb[_0xe3ca('0x4b')]:_0x33f930['model'];if(!_0x585b1c[_0xe3ca('0x47')][_0xe3ca('0x4e')](_0xe3ca('0x4f'))){_0x1dd6cb[_0xe3ca('0x30')]=qs[_0xe3ca('0x30')](_0x585b1c['query'][_0xe3ca('0x30')]);_0x1dd6cb[_0xe3ca('0x2f')]=qs[_0xe3ca('0x2f')](_0x585b1c[_0xe3ca('0x47')][_0xe3ca('0x2f')]);}_0x1dd6cb[_0xe3ca('0x6a')]=qs[_0xe3ca('0x50')](_0x585b1c['query'][_0xe3ca('0x50')]);_0x1dd6cb['where']=qs[_0xe3ca('0x49')](_[_0xe3ca('0x6b')](_0x585b1c[_0xe3ca('0x47')],_0x33f930[_0xe3ca('0x49')]));_0x1dd6cb['where'][_0xe3ca('0x66')]=_0x6bdf43['id'];if(_0x585b1c[_0xe3ca('0x47')]['filter']){_0x1dd6cb[_0xe3ca('0x51')]=_['merge'](_0x1dd6cb['where'],{'$or':_['map'](_0x1dd6cb[_0xe3ca('0x4b')],function(_0x4cdc83){var _0x26deed={};_0x26deed[_0x4cdc83]={'$like':'%'+_0x585b1c[_0xe3ca('0x47')][_0xe3ca('0x52')]+'%'};return _0x26deed;})});}_0x1dd6cb=_[_0xe3ca('0x53')]({},_0x1dd6cb,_0x585b1c[_0xe3ca('0x5a')]);return db[_0xe3ca('0xa4')][_0xe3ca('0x2e')]({'where':_0x1dd6cb[_0xe3ca('0x51')]})[_0xe3ca('0x36')](function(_0x218c29){_0x4672e3[_0xe3ca('0x2e')]=_0x218c29;if(_0x585b1c[_0xe3ca('0x47')][_0xe3ca('0x55')]){_0x1dd6cb[_0xe3ca('0x56')]=[{'model':db[_0xe3ca('0x79')],'as':_0xe3ca('0xc2'),'required':![]},{'model':db['User'],'as':_0xe3ca('0xc3'),'attributes':[_0xe3ca('0x3d'),_0xe3ca('0xc4'),'internal'],'required':![]},{'model':db[_0xe3ca('0xc5')],'as':_0xe3ca('0xc6'),'attributes':['id','name',_0xe3ca('0xc7')],'where':_0x585b1c['query'][_0xe3ca('0xc8')]?{'id':_0x585b1c[_0xe3ca('0x47')]['tag']}:undefined,'required':_0x585b1c['query']['tag']?!![]:![]}];}return db[_0xe3ca('0xa4')][_0xe3ca('0x6c')](_0x1dd6cb);})['then'](function(_0x5aecff){_0x4672e3[_0xe3ca('0x57')]=_0x5aecff;return _0x4672e3;});}})[_0xe3ca('0x36')](respondWithFilteredResult(_0x59982d,_0x1dd6cb))['catch'](handleError(_0x59982d,null));};exports[_0xe3ca('0xba')]=function(_0x357bea,_0x27703e,_0x599921){var _0x36a36a,_0xcd8f08,_0x3cd6f9;if(_[_0xe3ca('0x98')](_0x357bea[_0xe3ca('0x5d')]['body'])||_0x357bea[_0xe3ca('0x5d')]['body']===''){throw new db[(_0xe3ca('0x99'))][(_0xe3ca('0x20'))](_0xe3ca('0x9a'));}if(_[_0xe3ca('0x98')](_0x357bea[_0xe3ca('0x5d')]['to'])){throw new db[(_0xe3ca('0x99'))][(_0xe3ca('0x20'))]('to\x20is\x20mandatory');}_0x36a36a=_0x357bea['body']['to'];return db[_0xe3ca('0x42')][_0xe3ca('0x5b')]({'where':{'id':_0x357bea[_0xe3ca('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xe3ca('0xc9'),'include':[{'model':db[_0xe3ca('0x79')],'as':_0xe3ca('0xa0'),'where':{'mobile':_0x36a36a},'limit':0x1,'order':[['updatedAt',_0xe3ca('0xca')]]}]}]})['then'](handleEntityNotFound(_0x27703e,null))['then'](function(_0x4bb674){if(_0x4bb674&&_0x4bb674[_0xe3ca('0xc9')]){_0xcd8f08=_0x4bb674['get']({'plain':!![]});if(_0xcd8f08['List']&&_0xcd8f08['List'][_0xe3ca('0xa0')]['length']){return _0xcd8f08[_0xe3ca('0xc9')][_0xe3ca('0xa0')][0x0];}return db[_0xe3ca('0x79')]['create'](_[_0xe3ca('0xa2')](_0x357bea[_0xe3ca('0x5d')],{'firstName':_0x36a36a,'mobile':_0x36a36a,'phone':_0x36a36a,'ListId':_0xcd8f08[_0xe3ca('0x7f')]}));}})[_0xe3ca('0x36')](handleEntityNotFound(_0x27703e,null))[_0xe3ca('0x36')](function(_0x20cca2){if(_0x20cca2){_0x3cd6f9=_0x20cca2;return db['SmsInteraction']['find']({'where':{'ContactId':_0x3cd6f9['id'],'closed':![],'SmsAccountId':_0xcd8f08['id']}})[_0xe3ca('0x36')](function(_0x520697){if(_0x520697){return[_0x520697,![]];}return db['SmsInteraction'][_0xe3ca('0x5c')]({'UserId':_0x357bea['user']['id'],'ContactId':_0x3cd6f9['id'],'SmsAccountId':_0xcd8f08['id'],'phone':_0x36a36a,'firstMsgDirection':_0xe3ca('0xcb'),'Messages':[_[_0xe3ca('0x53')](_0x357bea['body'],{'read':![],'body':_0x357bea[_0xe3ca('0x5d')][_0xe3ca('0x5d')],'phone':_0x36a36a,'SmsAccountId':_0xcd8f08['id'],'UserId':_0x357bea['user']['id'],'ContactId':_0x3cd6f9['id']})]},{'include':[{'model':db[_0xe3ca('0xac')],'as':_0xe3ca('0xcc')}]})[_0xe3ca('0x36')](function(_0x296cdd){return[_0x296cdd,!![]];});});}})['spread'](function(_0x2dd719,_0x375185){if(_0x375185){return _0x2dd719;}return db[_0xe3ca('0xac')][_0xe3ca('0x5c')](_[_0xe3ca('0x53')](_0x357bea[_0xe3ca('0x5d')],{'read':![],'body':_0x357bea['body'][_0xe3ca('0x5d')],'phone':_0x36a36a,'SmsAccountId':_0xcd8f08['id'],'SmsInteractionId':_0x2dd719['id'],'UserId':_0x357bea['user']['id'],'ContactId':_0x3cd6f9['id']}))['then'](function(_0x132c7a){_0x2dd719[_0xe3ca('0xcd')][_0xe3ca('0xcc')]=[];_0x2dd719[_0xe3ca('0xcd')][_0xe3ca('0xcc')][_0xe3ca('0xa8')](_0x132c7a['dataValues']);return _0x2dd719;});})['then'](respondWithResult(_0x27703e,null))[_0xe3ca('0x2b')](handleError(_0x27703e,null));};exports['status']=function(_0x58f901,_0x42f8eb,_0x1d1504){if(_0x58f901[_0xe3ca('0x5d')]['id']){delete _0x58f901[_0xe3ca('0x5d')]['id'];}console['log'](_0xe3ca('0xce'),_0x58f901[_0xe3ca('0x5d')]);var _0x12a8ac,_0x3f61c9,_0xa97683;return db['SmsAccount']['find']({'where':{'id':_0x58f901['params']['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x42f8eb,null))['then'](function(_0x4d4893){if(_0x4d4893){_0xa97683=_0x4d4893;logger[_0xe3ca('0xb7')](_0xe3ca('0x24'),_0xe3ca('0x2d'),_0xe3ca('0xcf'),_0x4d4893[_0xe3ca('0x45')],util[_0xe3ca('0xd0')](_0x58f901[_0xe3ca('0x5d')],{'showHidden':![],'depth':null}));switch(_0x4d4893[_0xe3ca('0x45')]){case _0xe3ca('0x83'):if(_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd1')]&&_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0x2d')]){_0x3f61c9=_0x58f901['body'][_0xe3ca('0x2d')];return db[_0xe3ca('0xac')]['find']({'where':{'messageId':_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd1')]}});}break;case _0xe3ca('0xd2'):if(_0x58f901['body'][_0xe3ca('0xd3')]&&_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd4')]){_0x3f61c9=_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd4')];return db[_0xe3ca('0xac')][_0xe3ca('0x5b')]({'where':{'messageId':_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd3')]}});}break;case _0xe3ca('0x87'):if(_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0x89')]&&_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd5')]){_0x3f61c9=_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd5')];return db[_0xe3ca('0xac')][_0xe3ca('0x5b')]({'where':{'messageId':_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0x89')]}});}break;case _0xe3ca('0x8e'):var _0x29bebc=_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0x8f')][0x0];if(_0x29bebc[_0xe3ca('0x88')]&&_0x29bebc[_0xe3ca('0x2d')][_0xe3ca('0xd6')]==='DELIVERED'){_0x3f61c9=_0x29bebc[_0xe3ca('0x2d')]['groupName'];return db[_0xe3ca('0xac')][_0xe3ca('0x5b')]({'where':{'messageId':_0x29bebc['messageId']}});}break;case'clickatell':if(_0x58f901['body'][_0xe3ca('0x88')]&&_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0x2d')]){_0x3f61c9=_0x58f901['body']['status'];return db[_0xe3ca('0xac')][_0xe3ca('0x5b')]({'where':{'messageId':_0x58f901[_0xe3ca('0x5d')]['messageId']}});}break;case'intelepeer':if(_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd7')]&&_0x58f901[_0xe3ca('0x5d')]['status']){_0x3f61c9=_0x58f901[_0xe3ca('0x5d')]['status'];return db[_0xe3ca('0xac')]['find']({'where':{'messageId':_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd7')]}});}break;}}})[_0xe3ca('0x36')](handleEntityNotFound(_0x42f8eb,null))['then'](function(_0x248b7d){if(_0x248b7d){_0x12a8ac=_0x248b7d;switch(_0xa97683[_0xe3ca('0x45')]){case'skebby':if(_0x3f61c9==='DELIVERED'){return _0x12a8ac[_0xe3ca('0x35')]({'read':!![]});}else{logger[_0xe3ca('0x27')](_0xe3ca('0x24'),'status',_0xe3ca('0x83'),util[_0xe3ca('0xd0')](_0x58f901[_0xe3ca('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xe3ca('0xd2'):if(_0x3f61c9==='1'){return _0x12a8ac[_0xe3ca('0x35')]({'read':!![]});}else{logger['error'](_0xe3ca('0x24'),_0xe3ca('0x2d'),_0xe3ca('0x83'),util[_0xe3ca('0xd0')](_0x58f901[_0xe3ca('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xe3ca('0x87'):if(!_0x58f901[_0xe3ca('0x5d')][_0xe3ca('0xd8')]&&_0x3f61c9>=0xc8&&_0x3f61c9<=0xce){return _0x12a8ac['update']({'read':!![]});}else{logger['error'](_0xe3ca('0x24'),_0xe3ca('0x2d'),'clicksend',util[_0xe3ca('0xd0')](_0x58f901[_0xe3ca('0x5d')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5f2c97=_0x58f901['body'][_0xe3ca('0x8f')][0x0];if(_0x5f2c97[_0xe3ca('0x2d')][_0xe3ca('0xd6')]===_0xe3ca('0xd9')){return _0x12a8ac['update']({'read':!![]});}else{logger[_0xe3ca('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe3ca('0x2d'),'infobip',util[_0xe3ca('0xd0')](_0x58f901[_0xe3ca('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xe3ca('0x92'):if(_0x3f61c9==_0xe3ca('0xda')||_0x3f61c9==_0xe3ca('0xdb')){return _0x12a8ac[_0xe3ca('0x35')]({'read':!![]});}else{logger[_0xe3ca('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe3ca('0x92'),util[_0xe3ca('0xd0')](_0x58f901['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3f61c9===_0xe3ca('0xdc')||_0x3f61c9===_0xe3ca('0xdd')){return _0x12a8ac[_0xe3ca('0x35')]({'read':!![]});}else{logger[_0xe3ca('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe3ca('0x2d'),_0xe3ca('0x95'),util[_0xe3ca('0xd0')](_0x58f901['body'],{'showHidden':![],'depth':null}));}break;}return _0x12a8ac;}})[_0xe3ca('0x36')](respondWithResult(_0x42f8eb,null))[_0xe3ca('0x2b')](handleError(_0x42f8eb,null));};exports[_0xe3ca('0xde')]=function(_0x1b3650,_0x4a166e,_0x4645d2){var _0x478980,_0x4f7540,_0x35e681;return db[_0xe3ca('0x42')][_0xe3ca('0x5b')]({'where':{'id':_0x1b3650[_0xe3ca('0x59')]['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x4a166e,null))[_0xe3ca('0x36')](function(_0x554a7a){if(_0x554a7a){_0x35e681=_0x554a7a;logger[_0xe3ca('0xb7')](_0xe3ca('0x24'),_0xe3ca('0x2d'),_0xe3ca('0xcf'),_0x554a7a[_0xe3ca('0x45')],util[_0xe3ca('0xd0')](_0x1b3650[_0xe3ca('0x47')],{'showHidden':![],'depth':null}));switch(_0x554a7a[_0xe3ca('0x45')]){case'csc':if(_0x1b3650[_0xe3ca('0x47')][_0xe3ca('0xdf')]&&_0x1b3650['query'][_0xe3ca('0xe0')]){_0x4f7540=_0x1b3650[_0xe3ca('0x47')]['state'];return db[_0xe3ca('0xac')][_0xe3ca('0x5b')]({'where':{'messageId':_0x1b3650['query'][_0xe3ca('0xdf')]}});}break;}}})[_0xe3ca('0x36')](handleEntityNotFound(_0x4a166e,null))[_0xe3ca('0x36')](function(_0x1b3276){if(_0x1b3276){_0x478980=_0x1b3276;switch(_0x35e681[_0xe3ca('0x45')]){case _0xe3ca('0x90'):if(_0x4f7540==='2'||_0x4f7540==='6'){return _0x478980['update']({'read':!![]});}else{logger[_0xe3ca('0x27')](_0xe3ca('0x24'),_0xe3ca('0x2d'),_0xe3ca('0x90'),util[_0xe3ca('0xd0')](_0x1b3650[_0xe3ca('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x478980;}})[_0xe3ca('0x36')](respondWithResult(_0x4a166e,null))[_0xe3ca('0x2b')](handleError(_0x4a166e,null));};exports[_0xe3ca('0xe1')]=function(_0x5f4478,_0x17168e,_0x50e4e3){return db[_0xe3ca('0x42')][_0xe3ca('0x5b')]({'where':{'id':_0x5f4478[_0xe3ca('0x59')]['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x17168e,null))[_0xe3ca('0x36')](function(_0x57a932){if(_0x57a932){return _0x57a932[_0xe3ca('0xe1')](_0x5f4478[_0xe3ca('0x5d')][_0xe3ca('0x6e')],_[_0xe3ca('0xa1')](_0x5f4478['body'],['ids','id'])||{})[_0xe3ca('0xe2')](function(_0x2e8622){for(var _0x52ba0c=0x0;_0x52ba0c<_0x5f4478[_0xe3ca('0x5d')][_0xe3ca('0x6e')][_0xe3ca('0x4d')];_0x52ba0c+=0x1){socket[_0xe3ca('0xe3')](_0xe3ca('0xe4'),{'UserId':_0x5f4478[_0xe3ca('0x5d')][_0xe3ca('0x6e')][_0x52ba0c],'SmsAccountId':_0x5f4478['params']['id']});}return _0x2e8622;});}})['then'](respondWithResult(_0x17168e,null))[_0xe3ca('0x2b')](handleError(_0x17168e,null));};exports[_0xe3ca('0xe5')]=function(_0x472a55,_0x2811a3,_0x510518){return db[_0xe3ca('0x42')][_0xe3ca('0x5b')]({'where':{'id':_0x472a55['params']['id']}})['then'](handleEntityNotFound(_0x2811a3,null))[_0xe3ca('0x36')](function(_0x37292f){if(_0x37292f){return _0x37292f[_0xe3ca('0xe5')](_0x472a55['query'][_0xe3ca('0x6e')])[_0xe3ca('0x36')](function(){if(_[_0xe3ca('0xe6')](_0x472a55['query'][_0xe3ca('0x6e')])){for(var _0x5f4cc8=0x0;_0x5f4cc8<_0x472a55[_0xe3ca('0x47')]['ids'][_0xe3ca('0x4d')];_0x5f4cc8+=0x1){socket[_0xe3ca('0xe3')](_0xe3ca('0xe7'),{'UserId':Number(_0x472a55[_0xe3ca('0x47')]['ids'][_0x5f4cc8]),'SmsAccountId':Number(_0x472a55[_0xe3ca('0x59')]['id'])});}}else{socket[_0xe3ca('0xe3')](_0xe3ca('0xe7'),{'UserId':Number(_0x472a55[_0xe3ca('0x47')][_0xe3ca('0x6e')]),'SmsAccountId':Number(_0x472a55[_0xe3ca('0x59')]['id'])});}});}})[_0xe3ca('0x36')](respondWithStatusCode(_0x2811a3,null))[_0xe3ca('0x2b')](handleError(_0x2811a3,null));};exports[_0xe3ca('0xe8')]=function(_0x5f591a,_0x41b638,_0x223196){var _0x598f4f={};var _0x5a7a7d={};var _0xd9427b;var _0x6c6767;return db['SmsAccount']['findOne']({'where':{'id':_0x5f591a[_0xe3ca('0x59')]['id']}})[_0xe3ca('0x36')](handleEntityNotFound(_0x41b638,null))[_0xe3ca('0x36')](function(_0x4240b5){if(_0x4240b5){_0xd9427b=_0x4240b5;_0x5a7a7d[_0xe3ca('0x46')]=_[_0xe3ca('0x48')](db[_0xe3ca('0xaf')][_0xe3ca('0x43')]);_0x5a7a7d[_0xe3ca('0x47')]=_['keys'](_0x5f591a[_0xe3ca('0x47')]);_0x5a7a7d[_0xe3ca('0x49')]=_[_0xe3ca('0x4a')](_0x5a7a7d[_0xe3ca('0x46')],_0x5a7a7d[_0xe3ca('0x47')]);_0x598f4f[_0xe3ca('0x4b')]=_[_0xe3ca('0x4a')](_0x5a7a7d['model'],qs['fields'](_0x5f591a['query'][_0xe3ca('0x4c')]));_0x598f4f[_0xe3ca('0x4b')]=_0x598f4f[_0xe3ca('0x4b')][_0xe3ca('0x4d')]?_0x598f4f[_0xe3ca('0x4b')]:_0x5a7a7d[_0xe3ca('0x46')];_0x598f4f[_0xe3ca('0x6a')]=qs['sort'](_0x5f591a['query']['sort']);_0x598f4f[_0xe3ca('0x51')]=qs[_0xe3ca('0x49')](_['pick'](_0x5f591a['query'],_0x5a7a7d[_0xe3ca('0x49')]));if(_0x5f591a[_0xe3ca('0x47')][_0xe3ca('0x52')]){_0x598f4f[_0xe3ca('0x51')]=_[_0xe3ca('0x53')](_0x598f4f[_0xe3ca('0x51')],{'$or':_[_0xe3ca('0x41')](_0x598f4f[_0xe3ca('0x4b')],function(_0x11884e){var _0x610d89={};_0x610d89[_0x11884e]={'$like':'%'+_0x5f591a[_0xe3ca('0x47')][_0xe3ca('0x52')]+'%'};return _0x610d89;})});}_0x598f4f=_['merge']({},_0x598f4f,_0x5f591a[_0xe3ca('0x5a')]);return _0xd9427b['getAgents'](_0x598f4f);}})[_0xe3ca('0x36')](function(_0x2cc327){if(_0x2cc327){_0x6c6767=_0x2cc327['length'];if(!_0x5f591a[_0xe3ca('0x47')][_0xe3ca('0x4e')](_0xe3ca('0x4f'))){_0x598f4f[_0xe3ca('0x30')]=qs[_0xe3ca('0x30')](_0x5f591a[_0xe3ca('0x47')][_0xe3ca('0x30')]);_0x598f4f[_0xe3ca('0x2f')]=qs[_0xe3ca('0x2f')](_0x5f591a['query']['offset']);}return _0xd9427b[_0xe3ca('0xe8')](_0x598f4f);}})['then'](function(_0x4627be){if(_0x4627be){return _0x4627be?{'count':_0x6c6767,'rows':_0x4627be}:null;}})[_0xe3ca('0x36')](respondWithResult(_0x41b638,null))[_0xe3ca('0x2b')](handleError(_0x41b638,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 7aa5698..9461f4a 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 _0x2092=['remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2bd6c2,_0x1ad392){var _0x59d791=function(_0x38bb47){while(--_0x38bb47){_0x2bd6c2['push'](_0x2bd6c2['shift']());}};_0x59d791(++_0x1ad392);}(_0x2092,0x12b));var _0x2209=function(_0x57962b,_0x5642a6){_0x57962b=_0x57962b-0x0;var _0xc558d5=_0x2092[_0x57962b];return _0xc558d5;};'use strict';var EventEmitter=require(_0x2209('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2209('0x1')};function emitEvent(_0x12af04){return function(_0x544d42,_0x311c68,_0x278fe0){SmsAccountEvents[_0x2209('0x2')](_0x12af04+':'+_0x544d42['id'],_0x544d42);SmsAccountEvents[_0x2209('0x2')](_0x12af04,_0x544d42);_0x278fe0(null);};}for(var e in events){if(events[_0x2209('0x3')](e)){var event=events[e];SmsAccount[_0x2209('0x4')](e,emitEvent(event));}}module[_0x2209('0x5')]=SmsAccountEvents; \ No newline at end of file +var _0x9014=['emit','hasOwnProperty','exports','events','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x9014,0xdb));var _0x4901=function(_0x41493d,_0xd714b9){_0x41493d=_0x41493d-0x0;var _0x512b33=_0x9014[_0x41493d];return _0x512b33;};'use strict';var EventEmitter=require(_0x4901('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x4901('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4901('0x2')](0x0);var events={'afterCreate':_0x4901('0x3'),'afterUpdate':_0x4901('0x4'),'afterDestroy':_0x4901('0x5')};function emitEvent(_0x2a3ea2){return function(_0x54c03e,_0x44578b,_0x5e629b){SmsAccountEvents[_0x4901('0x6')](_0x2a3ea2+':'+_0x54c03e['id'],_0x54c03e);SmsAccountEvents[_0x4901('0x6')](_0x2a3ea2,_0x54c03e);_0x5e629b(null);};}for(var e in events){if(events[_0x4901('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x4901('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5a0f0df..16fcf67 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 _0x9a19=['api','bluebird','request-promise','path','rimraf','./smsAccount.attributes','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x9a19,0x1ec));var _0x99a1=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x9a19[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))(_0x99a1('0x3'));var moment=require('moment');var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require('../../config/environment');var attributes=require(_0x99a1('0x8'));module['exports']=function(_0x2b5f07,_0x25ed20){return _0x2b5f07['define'](_0x99a1('0x9'),attributes,{'tableName':_0x99a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4804=['../../config/environment','./smsAccount.attributes','exports','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x30098e,_0x346104){var _0x41aa5d=function(_0x5cae24){while(--_0x5cae24){_0x30098e['push'](_0x30098e['shift']());}};_0x41aa5d(++_0x346104);}(_0x4804,0x184));var _0x4480=function(_0x574a88,_0x2ff8d8){_0x574a88=_0x574a88-0x0;var _0x614a16=_0x4804[_0x574a88];return _0x614a16;};'use strict';var _=require(_0x4480('0x0'));var util=require(_0x4480('0x1'));var logger=require(_0x4480('0x2'))(_0x4480('0x3'));var moment=require(_0x4480('0x4'));var BPromise=require(_0x4480('0x5'));var rp=require(_0x4480('0x6'));var fs=require('fs');var path=require(_0x4480('0x7'));var rimraf=require('rimraf');var config=require(_0x4480('0x8'));var attributes=require(_0x4480('0x9'));module[_0x4480('0xa')]=function(_0x3b1b7f,_0x53a53b){return _0x3b1b7f['define']('SmsAccount',attributes,{'tableName':_0x4480('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 6ce4a15..e4624d7 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 _0x6297=['SmsAccount','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount'];(function(_0x428b2a,_0x422832){var _0x2eba9b=function(_0x4abd83){while(--_0x4abd83){_0x428b2a['push'](_0x428b2a['shift']());}};_0x2eba9b(++_0x422832);}(_0x6297,0x7d));var _0x7629=function(_0x3a8674,_0x2ca894){_0x3a8674=_0x3a8674-0x0;var _0x5c396c=_0x6297[_0x3a8674];return _0x5c396c;};'use strict';var _=require(_0x7629('0x0'));var util=require(_0x7629('0x1'));var moment=require(_0x7629('0x2'));var BPromise=require(_0x7629('0x3'));var rs=require(_0x7629('0x4'));var fs=require('fs');var Redis=require(_0x7629('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7629('0x6'));var logger=require('../../config/logger')(_0x7629('0x7'));var config=require(_0x7629('0x8'));var jayson=require(_0x7629('0x9'));var client=jayson[_0x7629('0xa')][_0x7629('0xb')]({'port':0x232a});config[_0x7629('0xc')]=_[_0x7629('0xd')](config[_0x7629('0xc')],{'host':_0x7629('0xe'),'port':0x18eb});var socket=require(_0x7629('0xf'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x7629('0x10')](socket);function respondWithRpcPromise(_0x34c20c,_0x192cf3,_0x332db5){return new BPromise(function(_0x35eea7,_0xb1d80b){return client[_0x7629('0x11')](_0x34c20c,_0x332db5)[_0x7629('0x12')](function(_0x312f19){logger[_0x7629('0x13')]('SmsAccount,\x20%s,\x20%s',_0x192cf3,_0x7629('0x14'));logger[_0x7629('0x15')](_0x7629('0x16'),_0x192cf3,_0x7629('0x14'),JSON[_0x7629('0x17')](_0x312f19));if(_0x312f19['error']){if(_0x312f19[_0x7629('0x18')][_0x7629('0x19')]===0x1f4){logger[_0x7629('0x18')](_0x7629('0x1a'),_0x192cf3,_0x312f19['error'][_0x7629('0x1b')]);return _0xb1d80b(_0x312f19['error']['message']);}logger['error'](_0x7629('0x1a'),_0x192cf3,_0x312f19[_0x7629('0x18')]['message']);return _0x35eea7(_0x312f19[_0x7629('0x18')][_0x7629('0x1b')]);}else{logger[_0x7629('0x13')]('SmsAccount,\x20%s,\x20%s',_0x192cf3,'request\x20sent');_0x35eea7(_0x312f19[_0x7629('0x1c')][_0x7629('0x1b')]);}})[_0x7629('0x1d')](function(_0x141e1a){logger['error'](_0x7629('0x1a'),_0x192cf3,_0x141e1a);_0xb1d80b(_0x141e1a);});});}exports[_0x7629('0x1e')]=function(_0x26b20f){var _0x574a70=this;return new Promise(function(_0x1752fd,_0x559f10){return db[_0x7629('0x1f')][_0x7629('0x20')]({'raw':_0x26b20f[_0x7629('0x21')]?_0x26b20f[_0x7629('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x26b20f[_0x7629('0x21')]?_0x26b20f[_0x7629('0x21')][_0x7629('0x22')]||null:null,'attributes':_0x26b20f[_0x7629('0x21')]?_0x26b20f[_0x7629('0x21')][_0x7629('0x23')]||null:null,'include':_0x26b20f[_0x7629('0x21')]?_0x26b20f['options'][_0x7629('0x24')]?_[_0x7629('0x25')](_0x26b20f[_0x7629('0x21')][_0x7629('0x24')],function(_0x4e2d07){return{'model':db[_0x4e2d07['model']],'as':_0x4e2d07['as'],'attributes':_0x4e2d07['attributes'],'include':_0x4e2d07[_0x7629('0x24')]?_[_0x7629('0x25')](_0x4e2d07['include'],function(_0x48b8e9){return{'model':db[_0x48b8e9[_0x7629('0x26')]],'as':_0x48b8e9['as'],'attributes':_0x48b8e9[_0x7629('0x23')],'include':_0x48b8e9[_0x7629('0x24')]?_[_0x7629('0x25')](_0x48b8e9[_0x7629('0x24')],function(_0x3191eb){return{'model':db[_0x3191eb[_0x7629('0x26')]],'as':_0x3191eb['as'],'attributes':_0x3191eb[_0x7629('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7629('0x12')](function(_0x411743){logger[_0x7629('0x13')]('ShowSmsAccount',_0x26b20f);logger[_0x7629('0x15')]('ShowSmsAccount',_0x26b20f,JSON[_0x7629('0x17')](_0x411743));_0x1752fd(_0x411743);})[_0x7629('0x1d')](function(_0x2a3d7d){logger['error']('ShowSmsAccount',_0x2a3d7d[_0x7629('0x1b')],_0x26b20f);_0x559f10(_0x574a70[_0x7629('0x18')](0x1f4,_0x2a3d7d[_0x7629('0x1b')]));});});}; \ No newline at end of file +var _0x88a4=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSmsAccount','find','options','raw','where','attributes','include','map','model','debug','catch'];(function(_0x43963e,_0x28f9a1){var _0x41a0e0=function(_0x59e7b3){while(--_0x59e7b3){_0x43963e['push'](_0x43963e['shift']());}};_0x41a0e0(++_0x28f9a1);}(_0x88a4,0x108));var _0x488a=function(_0x15c07a,_0x40f5d6){_0x15c07a=_0x15c07a-0x0;var _0x4e1506=_0x88a4[_0x15c07a];return _0x4e1506;};'use strict';var _=require('lodash');var util=require(_0x488a('0x0'));var moment=require('moment');var BPromise=require(_0x488a('0x1'));var rs=require(_0x488a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x488a('0x3'))['db'];var utils=require(_0x488a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x488a('0x5'));var jayson=require(_0x488a('0x6'));var client=jayson[_0x488a('0x7')][_0x488a('0x8')]({'port':0x232a});config[_0x488a('0x9')]=_[_0x488a('0xa')](config[_0x488a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x488a('0xb'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x248122,_0x1eee9e,_0x58850f){return new BPromise(function(_0x5b0860,_0x32e4ed){return client[_0x488a('0xc')](_0x248122,_0x58850f)[_0x488a('0xd')](function(_0x5d37ac){logger[_0x488a('0xe')](_0x488a('0xf'),_0x1eee9e,_0x488a('0x10'));logger['debug'](_0x488a('0x11'),_0x1eee9e,_0x488a('0x10'),JSON[_0x488a('0x12')](_0x5d37ac));if(_0x5d37ac[_0x488a('0x13')]){if(_0x5d37ac[_0x488a('0x13')][_0x488a('0x14')]===0x1f4){logger[_0x488a('0x13')](_0x488a('0xf'),_0x1eee9e,_0x5d37ac[_0x488a('0x13')]['message']);return _0x32e4ed(_0x5d37ac[_0x488a('0x13')]['message']);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x1eee9e,_0x5d37ac[_0x488a('0x13')][_0x488a('0x15')]);return _0x5b0860(_0x5d37ac[_0x488a('0x13')][_0x488a('0x15')]);}else{logger[_0x488a('0xe')]('SmsAccount,\x20%s,\x20%s',_0x1eee9e,_0x488a('0x10'));_0x5b0860(_0x5d37ac['result'][_0x488a('0x15')]);}})['catch'](function(_0x3ddd72){logger[_0x488a('0x13')](_0x488a('0xf'),_0x1eee9e,_0x3ddd72);_0x32e4ed(_0x3ddd72);});});}exports[_0x488a('0x16')]=function(_0x2c95f4){var _0x55af38=this;return new Promise(function(_0x52cbca,_0x2da2be){return db['SmsAccount'][_0x488a('0x17')]({'raw':_0x2c95f4[_0x488a('0x18')]?_0x2c95f4[_0x488a('0x18')][_0x488a('0x19')]===undefined?!![]:![]:!![],'where':_0x2c95f4['options']?_0x2c95f4[_0x488a('0x18')][_0x488a('0x1a')]||null:null,'attributes':_0x2c95f4[_0x488a('0x18')]?_0x2c95f4['options'][_0x488a('0x1b')]||null:null,'include':_0x2c95f4[_0x488a('0x18')]?_0x2c95f4[_0x488a('0x18')][_0x488a('0x1c')]?_[_0x488a('0x1d')](_0x2c95f4['options'][_0x488a('0x1c')],function(_0x4ef122){return{'model':db[_0x4ef122['model']],'as':_0x4ef122['as'],'attributes':_0x4ef122['attributes'],'include':_0x4ef122[_0x488a('0x1c')]?_[_0x488a('0x1d')](_0x4ef122['include'],function(_0x174a39){return{'model':db[_0x174a39[_0x488a('0x1e')]],'as':_0x174a39['as'],'attributes':_0x174a39[_0x488a('0x1b')],'include':_0x174a39['include']?_['map'](_0x174a39['include'],function(_0x478400){return{'model':db[_0x478400[_0x488a('0x1e')]],'as':_0x478400['as'],'attributes':_0x478400[_0x488a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x488a('0xd')](function(_0x3415a1){logger[_0x488a('0xe')](_0x488a('0x16'),_0x2c95f4);logger[_0x488a('0x1f')]('ShowSmsAccount',_0x2c95f4,JSON[_0x488a('0x12')](_0x3415a1));_0x52cbca(_0x3415a1);})[_0x488a('0x20')](function(_0x6c86f2){logger['error'](_0x488a('0x16'),_0x6c86f2[_0x488a('0x15')],_0x2c95f4);_0x2da2be(_0x55af38[_0x488a('0x13')](0x1f4,_0x6c86f2[_0x488a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 42cf832..2f09520 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 _0xb2e6=['update','emit','removeListener','register','length','./smsAccount.events','save'];(function(_0x3fb8e9,_0x20cf4b){var _0x32f229=function(_0x33cd04){while(--_0x33cd04){_0x3fb8e9['push'](_0x3fb8e9['shift']());}};_0x32f229(++_0x20cf4b);}(_0xb2e6,0x1da));var _0x6b2e=function(_0x440dad,_0x40dfd3){_0x440dad=_0x440dad-0x0;var _0x3da043=_0xb2e6[_0x440dad];return _0x3da043;};'use strict';var SmsAccountEvents=require(_0x6b2e('0x0'));var events=[_0x6b2e('0x1'),'remove',_0x6b2e('0x2')];function createListener(_0x2e2108,_0x4374ca){return function(_0x162f41){_0x4374ca[_0x6b2e('0x3')](_0x2e2108,_0x162f41);};}function removeListener(_0x1ae474,_0x39321f){return function(){SmsAccountEvents[_0x6b2e('0x4')](_0x1ae474,_0x39321f);};}exports[_0x6b2e('0x5')]=function(_0x28b0c5){for(var _0x2dda6b=0x0,_0x121c3a=events[_0x6b2e('0x6')];_0x2dda6b<_0x121c3a;_0x2dda6b++){var _0x184691=events[_0x2dda6b];var _0x1045bc=createListener('smsAccount:'+_0x184691,_0x28b0c5);SmsAccountEvents['on'](_0x184691,_0x1045bc);}}; \ No newline at end of file +var _0xc68e=['smsAccount:','./smsAccount.events','save','remove','update','removeListener','register'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc68e,0x104));var _0xec68=function(_0x4c2de0,_0x1c6623){_0x4c2de0=_0x4c2de0-0x0;var _0x400af6=_0xc68e[_0x4c2de0];return _0x400af6;};'use strict';var SmsAccountEvents=require(_0xec68('0x0'));var events=[_0xec68('0x1'),_0xec68('0x2'),_0xec68('0x3')];function createListener(_0x7e9785,_0x1511b1){return function(_0x2f64bc){_0x1511b1['emit'](_0x7e9785,_0x2f64bc);};}function removeListener(_0x3494f4,_0x14babc){return function(){SmsAccountEvents[_0xec68('0x4')](_0x3494f4,_0x14babc);};}exports[_0xec68('0x5')]=function(_0x1857cf){for(var _0x513f73=0x0,_0x9d527a=events['length'];_0x513f73<_0x9d527a;_0x513f73++){var _0x4349bd=events[_0x513f73];var _0x41b570=createListener(_0xec68('0x6')+_0x4349bd,_0x1857cf);SmsAccountEvents['on'](_0x4349bd,_0x41b570);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 0b2a899..ab98e91 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 _0xc27f=['/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./smsApplication.controller','get'];(function(_0x19411e,_0x9c719d){var _0x3bbccb=function(_0x556fa6){while(--_0x556fa6){_0x19411e['push'](_0x19411e['shift']());}};_0x3bbccb(++_0x9c719d);}(_0xc27f,0x1e8));var _0xfc27=function(_0x5ebf00,_0x1a87af){_0x5ebf00=_0x5ebf00-0x0;var _0x4a661f=_0xc27f[_0x5ebf00];return _0x4a661f;};'use strict';var multer=require(_0xfc27('0x0'));var util=require(_0xfc27('0x1'));var path=require(_0xfc27('0x2'));var timeout=require(_0xfc27('0x3'));var express=require(_0xfc27('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfc27('0x5'));var config=require('../../config/environment');var controller=require(_0xfc27('0x6'));router[_0xfc27('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfc27('0x7')](_0xfc27('0x8'),auth[_0xfc27('0x9')](),controller[_0xfc27('0xa')]);router[_0xfc27('0xb')]('/',auth[_0xfc27('0x9')](),controller['create']);router[_0xfc27('0xc')](_0xfc27('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xfc27('0xd')]('/:id',auth[_0xfc27('0x9')](),controller[_0xfc27('0xe')]);module[_0xfc27('0xf')]=router; \ No newline at end of file +var _0x9278=['express','../../components/auth/service','../../config/environment','./smsApplication.controller','isAuthenticated','index','get','/:id','post','put','update','exports','util'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x9278,0x1ed));var _0x8927=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9278[_0x413feb];return _0x40ee88;};'use strict';var multer=require('multer');var util=require(_0x8927('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8927('0x1'));var router=express['Router']();var auth=require(_0x8927('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x8927('0x3'));var controller=require(_0x8927('0x4'));router['get']('/',auth[_0x8927('0x5')](),controller[_0x8927('0x6')]);router[_0x8927('0x7')](_0x8927('0x8'),auth[_0x8927('0x5')](),controller['show']);router[_0x8927('0x9')]('/',auth[_0x8927('0x5')](),controller['create']);router[_0x8927('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x8927('0xb')]);router['delete'](_0x8927('0x8'),auth[_0x8927('0x5')](),controller['destroy']);module[_0x8927('0xc')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 3ca5d84..f77d071 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 _0x4fd1=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x3b6320,_0x43164f){var _0x5c70a4=function(_0x148997){while(--_0x148997){_0x3b6320['push'](_0x3b6320['shift']());}};_0x5c70a4(++_0x43164f);}(_0x4fd1,0x17f));var _0x14fd=function(_0x131969,_0x2df277){_0x131969=_0x131969-0x0;var _0x1ef9dc=_0x4fd1[_0x131969];return _0x1ef9dc;};'use strict';var Sequelize=require(_0x14fd('0x0'));module[_0x14fd('0x1')]={'priority':{'type':Sequelize[_0x14fd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x14fd('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x14fd('0x4')]()},'description':{'type':Sequelize[_0x14fd('0x3')]},'interval':{'type':Sequelize[_0x14fd('0x3')],'defaultValue':_0x14fd('0x5')}}; \ No newline at end of file +var _0x1fee=['sequelize','exports','STRING','noop','*,*,*,*'];(function(_0x3a779f,_0x543748){var _0x5574a3=function(_0x17e865){while(--_0x17e865){_0x3a779f['push'](_0x3a779f['shift']());}};_0x5574a3(++_0x543748);}(_0x1fee,0xb9));var _0xe1fe=function(_0x564852,_0x108342){_0x564852=_0x564852-0x0;var _0x35a727=_0x1fee[_0x564852];return _0x35a727;};'use strict';var Sequelize=require(_0xe1fe('0x0'));module[_0xe1fe('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe1fe('0x2')],'allowNull':![],'defaultValue':_0xe1fe('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe1fe('0x2')]},'interval':{'type':Sequelize[_0xe1fe('0x2')],'defaultValue':_0xe1fe('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index f846e93..b8e1d09 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 _0x8c6b=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','SmsApplication','rawAttributes','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','offset','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','params','fields','include','find','catch','create','body'];(function(_0x7d0066,_0x1462bd){var _0x124bd6=function(_0x47ab17){while(--_0x47ab17){_0x7d0066['push'](_0x7d0066['shift']());}};_0x124bd6(++_0x1462bd);}(_0x8c6b,0x16d));var _0xb8c6=function(_0x15b945,_0x41eb69){_0x15b945=_0x15b945-0x0;var _0x15c78d=_0x8c6b[_0x15b945];return _0x15c78d;};'use strict';var pdf=require(_0xb8c6('0x0'));var emlformat=require(_0xb8c6('0x1'));var rimraf=require(_0xb8c6('0x2'));var zipdir=require(_0xb8c6('0x3'));var jsonpatch=require(_0xb8c6('0x4'));var rp=require(_0xb8c6('0x5'));var moment=require(_0xb8c6('0x6'));var BPromise=require(_0xb8c6('0x7'));var Mustache=require(_0xb8c6('0x8'));var util=require(_0xb8c6('0x9'));var path=require(_0xb8c6('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb8c6('0xb'));var squel=require(_0xb8c6('0xc'));var crypto=require(_0xb8c6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb8c6('0xe'));var querystring=require(_0xb8c6('0xf'));var Papa=require(_0xb8c6('0x10'));var Redis=require(_0xb8c6('0x11'));var authService=require(_0xb8c6('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb8c6('0x13'));var logger=require(_0xb8c6('0x14'))(_0xb8c6('0x15'));var utils=require(_0xb8c6('0x16'));var config=require(_0xb8c6('0x17'));var db=require(_0xb8c6('0x18'))['db'];function respondWithStatusCode(_0xa781d9,_0x20ffc1){_0x20ffc1=_0x20ffc1||0xcc;return function(_0x5ba9dc){if(_0x5ba9dc){return _0xa781d9[_0xb8c6('0x19')](_0x20ffc1);}return _0xa781d9[_0xb8c6('0x1a')](_0x20ffc1)['end']();};}function respondWithResult(_0xb42701,_0x4e32af){_0x4e32af=_0x4e32af||0xc8;return function(_0x35f28c){if(_0x35f28c){return _0xb42701[_0xb8c6('0x1a')](_0x4e32af)['json'](_0x35f28c);}};}function respondWithFilteredResult(_0x2d839f,_0x468e88){return function(_0x2e2154){if(_0x2e2154){var _0x5cdadb=_0x2e2154[_0xb8c6('0x1b')],_0x1bc9b2=_0x468e88['offset'],_0x4d27ae=_0x468e88['offset']+_0x468e88[_0xb8c6('0x1c')],_0x3260a7;if(_0x4d27ae>=_0x5cdadb){_0x4d27ae=_0x5cdadb;_0x3260a7=0xc8;}else{_0x3260a7=0xce;}_0x2d839f[_0xb8c6('0x1a')](_0x3260a7);return _0x2d839f[_0xb8c6('0x1d')]('Content-Range',_0x1bc9b2+'-'+_0x4d27ae+'/'+_0x5cdadb)[_0xb8c6('0x1e')](_0x2e2154);}return null;};}function patchUpdates(_0x3d187d){return function(_0x21b913){try{jsonpatch[_0xb8c6('0x1f')](_0x21b913,_0x3d187d,!![]);}catch(_0x3907ba){return BPromise[_0xb8c6('0x20')](_0x3907ba);}return _0x21b913[_0xb8c6('0x21')]();};}function saveUpdates(_0x422656,_0x5d8665){return function(_0x86fc36){if(_0x86fc36){return _0x86fc36[_0xb8c6('0x22')](_0x422656)[_0xb8c6('0x23')](function(_0x277a6f){return _0x277a6f;});}return null;};}function removeEntity(_0x506599,_0x19a453){return function(_0xb0a6fa){if(_0xb0a6fa){return _0xb0a6fa[_0xb8c6('0x24')]()[_0xb8c6('0x23')](function(){_0x506599['status'](0xcc)[_0xb8c6('0x25')]();});}};}function handleEntityNotFound(_0x3ee0c6,_0x32bfaf){return function(_0x26d67b){if(!_0x26d67b){_0x3ee0c6[_0xb8c6('0x19')](0x194);}return _0x26d67b;};}function handleError(_0x590f53,_0x3d0b93){_0x3d0b93=_0x3d0b93||0x1f4;return function(_0x1c4df3){logger[_0xb8c6('0x26')](_0x1c4df3['stack']);if(_0x1c4df3['name']){delete _0x1c4df3[_0xb8c6('0x27')];}_0x590f53[_0xb8c6('0x1a')](_0x3d0b93)[_0xb8c6('0x28')](_0x1c4df3);};}exports[_0xb8c6('0x29')]=function(_0x4dfc06,_0x2870c3){var _0x2a8bb8={},_0x1a990b={},_0x57e425={'count':0x0,'rows':[]};var _0x1cd87f=_[_0xb8c6('0x2a')](db[_0xb8c6('0x2b')][_0xb8c6('0x2c')],function(_0x5d9bf6){return{'name':_0x5d9bf6['fieldName'],'type':_0x5d9bf6[_0xb8c6('0x2d')][_0xb8c6('0x2e')]};});_0x1a990b[_0xb8c6('0x2f')]=_['map'](_0x1cd87f,_0xb8c6('0x27'));_0x1a990b[_0xb8c6('0x30')]=_['keys'](_0x4dfc06[_0xb8c6('0x30')]);_0x1a990b[_0xb8c6('0x31')]=_['intersection'](_0x1a990b[_0xb8c6('0x2f')],_0x1a990b[_0xb8c6('0x30')]);_0x2a8bb8[_0xb8c6('0x32')]=_[_0xb8c6('0x33')](_0x1a990b['model'],qs['fields'](_0x4dfc06[_0xb8c6('0x30')]['fields']));_0x2a8bb8[_0xb8c6('0x32')]=_0x2a8bb8[_0xb8c6('0x32')][_0xb8c6('0x34')]?_0x2a8bb8[_0xb8c6('0x32')]:_0x1a990b[_0xb8c6('0x2f')];if(!_0x4dfc06[_0xb8c6('0x30')][_0xb8c6('0x35')](_0xb8c6('0x36'))){_0x2a8bb8[_0xb8c6('0x1c')]=qs['limit'](_0x4dfc06[_0xb8c6('0x30')][_0xb8c6('0x1c')]);_0x2a8bb8[_0xb8c6('0x37')]=qs[_0xb8c6('0x37')](_0x4dfc06[_0xb8c6('0x30')][_0xb8c6('0x37')]);}_0x2a8bb8['order']=qs[_0xb8c6('0x38')](_0x4dfc06[_0xb8c6('0x30')]['sort']);_0x2a8bb8['where']=qs[_0xb8c6('0x31')](_[_0xb8c6('0x39')](_0x4dfc06[_0xb8c6('0x30')],_0x1a990b[_0xb8c6('0x31')]));if(_0x4dfc06[_0xb8c6('0x30')][_0xb8c6('0x3a')]){_0x2a8bb8['where']=_[_0xb8c6('0x3b')](_0x2a8bb8[_0xb8c6('0x3c')],{'$or':_['map'](_0x1cd87f,function(_0x478522){if(_0x478522[_0xb8c6('0x2d')]!==_0xb8c6('0x3d')){var _0x483e07={};_0x483e07[_0x478522[_0xb8c6('0x27')]]={'$like':'%'+_0x4dfc06['query'][_0xb8c6('0x3a')]+'%'};return _0x483e07;}})});}_0x2a8bb8=_[_0xb8c6('0x3b')]({},_0x2a8bb8,_0x4dfc06[_0xb8c6('0x3e')]);var _0x29663d={'where':_0x2a8bb8[_0xb8c6('0x3c')]};return db[_0xb8c6('0x2b')]['count'](_0x29663d)[_0xb8c6('0x23')](function(_0x301ed3){_0x57e425[_0xb8c6('0x1b')]=_0x301ed3;if(_0x4dfc06[_0xb8c6('0x30')][_0xb8c6('0x3f')]){_0x2a8bb8['include']=[{'all':!![]}];}return db[_0xb8c6('0x2b')][_0xb8c6('0x40')](_0x2a8bb8);})[_0xb8c6('0x23')](function(_0x2c9452){_0x57e425[_0xb8c6('0x41')]=_0x2c9452;return _0x57e425;})[_0xb8c6('0x23')](respondWithFilteredResult(_0x2870c3,_0x2a8bb8))['catch'](handleError(_0x2870c3,null));};exports['show']=function(_0x356a57,_0x368b3d){var _0x337c2a={'raw':!![],'where':{'id':_0x356a57[_0xb8c6('0x42')]['id']}},_0x758fba={};_0x758fba['model']=_['keys'](db[_0xb8c6('0x2b')][_0xb8c6('0x2c')]);_0x758fba[_0xb8c6('0x30')]=_['keys'](_0x356a57[_0xb8c6('0x30')]);_0x758fba[_0xb8c6('0x31')]=_[_0xb8c6('0x33')](_0x758fba[_0xb8c6('0x2f')],_0x758fba[_0xb8c6('0x30')]);_0x337c2a[_0xb8c6('0x32')]=_[_0xb8c6('0x33')](_0x758fba[_0xb8c6('0x2f')],qs[_0xb8c6('0x43')](_0x356a57[_0xb8c6('0x30')][_0xb8c6('0x43')]));_0x337c2a['attributes']=_0x337c2a[_0xb8c6('0x32')]['length']?_0x337c2a[_0xb8c6('0x32')]:_0x758fba['model'];if(_0x356a57['query'][_0xb8c6('0x3f')]){_0x337c2a[_0xb8c6('0x44')]=[{'all':!![]}];}_0x337c2a=_[_0xb8c6('0x3b')]({},_0x337c2a,_0x356a57[_0xb8c6('0x3e')]);return db[_0xb8c6('0x2b')][_0xb8c6('0x45')](_0x337c2a)[_0xb8c6('0x23')](handleEntityNotFound(_0x368b3d,null))['then'](respondWithResult(_0x368b3d,null))[_0xb8c6('0x46')](handleError(_0x368b3d,null));};exports['create']=function(_0x28bd81,_0xb8e584){return db['SmsApplication'][_0xb8c6('0x47')](_0x28bd81['body'],{})[_0xb8c6('0x23')](respondWithResult(_0xb8e584,0xc9))[_0xb8c6('0x46')](handleError(_0xb8e584,null));};exports['update']=function(_0x45cfb2,_0x1a57e1){if(_0x45cfb2[_0xb8c6('0x48')]['id']){delete _0x45cfb2[_0xb8c6('0x48')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x45cfb2[_0xb8c6('0x42')]['id']}})[_0xb8c6('0x23')](handleEntityNotFound(_0x1a57e1,null))[_0xb8c6('0x23')](saveUpdates(_0x45cfb2['body'],null))[_0xb8c6('0x23')](respondWithResult(_0x1a57e1,null))[_0xb8c6('0x46')](handleError(_0x1a57e1,null));};exports[_0xb8c6('0x24')]=function(_0x2244cf,_0x34eacc){return db[_0xb8c6('0x2b')][_0xb8c6('0x45')]({'where':{'id':_0x2244cf['params']['id']}})[_0xb8c6('0x23')](handleEntityNotFound(_0x34eacc,null))['then'](removeEntity(_0x34eacc,null))['catch'](handleError(_0x34eacc,null));}; \ No newline at end of file +var _0x9ac2=['catch','create','body','find','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','SmsApplication','fieldName','model','map','keys','query','filters','intersection','fields','length','attributes','nolimit','limit','order','where','filter','type','VIRTUAL','merge','options','rows','show','params','rawAttributes','includeAll','include'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x9ac2,0x1a8));var _0x29ac=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0x9ac2[_0x4d521e];return _0x3beb42;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x29ac('0x0'));var jsonpatch=require(_0x29ac('0x1'));var rp=require(_0x29ac('0x2'));var moment=require(_0x29ac('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x29ac('0x4'));var util=require('util');var path=require(_0x29ac('0x5'));var sox=require(_0x29ac('0x6'));var csv=require('to-csv');var ejs=require(_0x29ac('0x7'));var fs=require('fs');var _=require(_0x29ac('0x8'));var squel=require(_0x29ac('0x9'));var crypto=require(_0x29ac('0xa'));var jsforce=require(_0x29ac('0xb'));var deskjs=require(_0x29ac('0xc'));var toCsv=require(_0x29ac('0xd'));var querystring=require(_0x29ac('0xe'));var Papa=require(_0x29ac('0xf'));var Redis=require(_0x29ac('0x10'));var authService=require(_0x29ac('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29ac('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x29ac('0x13'));var db=require(_0x29ac('0x14'))['db'];function respondWithStatusCode(_0x197d19,_0x2990cd){_0x2990cd=_0x2990cd||0xcc;return function(_0xc99eed){if(_0xc99eed){return _0x197d19['sendStatus'](_0x2990cd);}return _0x197d19[_0x29ac('0x15')](_0x2990cd)[_0x29ac('0x16')]();};}function respondWithResult(_0x5ed128,_0x5eda0f){_0x5eda0f=_0x5eda0f||0xc8;return function(_0x8cb5e2){if(_0x8cb5e2){return _0x5ed128[_0x29ac('0x15')](_0x5eda0f)[_0x29ac('0x17')](_0x8cb5e2);}};}function respondWithFilteredResult(_0x2cb051,_0x1af058){return function(_0x3ff0be){if(_0x3ff0be){var _0x4c49ce=_0x3ff0be[_0x29ac('0x18')],_0x154957=_0x1af058['offset'],_0x36c36d=_0x1af058[_0x29ac('0x19')]+_0x1af058['limit'],_0x50ea3c;if(_0x36c36d>=_0x4c49ce){_0x36c36d=_0x4c49ce;_0x50ea3c=0xc8;}else{_0x50ea3c=0xce;}_0x2cb051[_0x29ac('0x15')](_0x50ea3c);return _0x2cb051[_0x29ac('0x1a')](_0x29ac('0x1b'),_0x154957+'-'+_0x36c36d+'/'+_0x4c49ce)[_0x29ac('0x17')](_0x3ff0be);}return null;};}function patchUpdates(_0x2887da){return function(_0x37aadd){try{jsonpatch[_0x29ac('0x1c')](_0x37aadd,_0x2887da,!![]);}catch(_0x46c764){return BPromise[_0x29ac('0x1d')](_0x46c764);}return _0x37aadd[_0x29ac('0x1e')]();};}function saveUpdates(_0x5aaa28,_0x5dfa61){return function(_0x395538){if(_0x395538){return _0x395538[_0x29ac('0x1f')](_0x5aaa28)[_0x29ac('0x20')](function(_0xae2e97){return _0xae2e97;});}return null;};}function removeEntity(_0x4c3126,_0x572f4d){return function(_0x5dd049){if(_0x5dd049){return _0x5dd049[_0x29ac('0x21')]()[_0x29ac('0x20')](function(){_0x4c3126[_0x29ac('0x15')](0xcc)[_0x29ac('0x16')]();});}};}function handleEntityNotFound(_0x20a7e7,_0x29f67c){return function(_0x13105c){if(!_0x13105c){_0x20a7e7[_0x29ac('0x22')](0x194);}return _0x13105c;};}function handleError(_0x454855,_0x426eea){_0x426eea=_0x426eea||0x1f4;return function(_0x3519d6){logger[_0x29ac('0x23')](_0x3519d6[_0x29ac('0x24')]);if(_0x3519d6['name']){delete _0x3519d6[_0x29ac('0x25')];}_0x454855['status'](_0x426eea)[_0x29ac('0x26')](_0x3519d6);};}exports[_0x29ac('0x27')]=function(_0xac0a5b,_0x23620e){var _0x4a8ece={},_0x1c4137={},_0x37cf38={'count':0x0,'rows':[]};var _0x330676=_['map'](db[_0x29ac('0x28')]['rawAttributes'],function(_0x4efcad){return{'name':_0x4efcad[_0x29ac('0x29')],'type':_0x4efcad['type']['key']};});_0x1c4137[_0x29ac('0x2a')]=_[_0x29ac('0x2b')](_0x330676,'name');_0x1c4137['query']=_[_0x29ac('0x2c')](_0xac0a5b[_0x29ac('0x2d')]);_0x1c4137[_0x29ac('0x2e')]=_[_0x29ac('0x2f')](_0x1c4137['model'],_0x1c4137[_0x29ac('0x2d')]);_0x4a8ece['attributes']=_[_0x29ac('0x2f')](_0x1c4137[_0x29ac('0x2a')],qs['fields'](_0xac0a5b[_0x29ac('0x2d')][_0x29ac('0x30')]));_0x4a8ece['attributes']=_0x4a8ece['attributes'][_0x29ac('0x31')]?_0x4a8ece[_0x29ac('0x32')]:_0x1c4137[_0x29ac('0x2a')];if(!_0xac0a5b['query']['hasOwnProperty'](_0x29ac('0x33'))){_0x4a8ece[_0x29ac('0x34')]=qs['limit'](_0xac0a5b[_0x29ac('0x2d')]['limit']);_0x4a8ece['offset']=qs['offset'](_0xac0a5b[_0x29ac('0x2d')][_0x29ac('0x19')]);}_0x4a8ece[_0x29ac('0x35')]=qs['sort'](_0xac0a5b[_0x29ac('0x2d')]['sort']);_0x4a8ece[_0x29ac('0x36')]=qs[_0x29ac('0x2e')](_['pick'](_0xac0a5b[_0x29ac('0x2d')],_0x1c4137[_0x29ac('0x2e')]));if(_0xac0a5b[_0x29ac('0x2d')][_0x29ac('0x37')]){_0x4a8ece[_0x29ac('0x36')]=_['merge'](_0x4a8ece['where'],{'$or':_['map'](_0x330676,function(_0x34be5e){if(_0x34be5e[_0x29ac('0x38')]!==_0x29ac('0x39')){var _0x117373={};_0x117373[_0x34be5e[_0x29ac('0x25')]]={'$like':'%'+_0xac0a5b[_0x29ac('0x2d')][_0x29ac('0x37')]+'%'};return _0x117373;}})});}_0x4a8ece=_[_0x29ac('0x3a')]({},_0x4a8ece,_0xac0a5b[_0x29ac('0x3b')]);var _0xb43baf={'where':_0x4a8ece[_0x29ac('0x36')]};return db[_0x29ac('0x28')]['count'](_0xb43baf)[_0x29ac('0x20')](function(_0x20a9c6){_0x37cf38[_0x29ac('0x18')]=_0x20a9c6;if(_0xac0a5b[_0x29ac('0x2d')]['includeAll']){_0x4a8ece['include']=[{'all':!![]}];}return db[_0x29ac('0x28')]['findAll'](_0x4a8ece);})[_0x29ac('0x20')](function(_0x2eb208){_0x37cf38[_0x29ac('0x3c')]=_0x2eb208;return _0x37cf38;})[_0x29ac('0x20')](respondWithFilteredResult(_0x23620e,_0x4a8ece))['catch'](handleError(_0x23620e,null));};exports[_0x29ac('0x3d')]=function(_0x191c39,_0x7c759){var _0x4f7030={'raw':!![],'where':{'id':_0x191c39[_0x29ac('0x3e')]['id']}},_0x116e49={};_0x116e49[_0x29ac('0x2a')]=_[_0x29ac('0x2c')](db['SmsApplication'][_0x29ac('0x3f')]);_0x116e49['query']=_['keys'](_0x191c39[_0x29ac('0x2d')]);_0x116e49[_0x29ac('0x2e')]=_[_0x29ac('0x2f')](_0x116e49['model'],_0x116e49[_0x29ac('0x2d')]);_0x4f7030[_0x29ac('0x32')]=_['intersection'](_0x116e49[_0x29ac('0x2a')],qs['fields'](_0x191c39[_0x29ac('0x2d')][_0x29ac('0x30')]));_0x4f7030[_0x29ac('0x32')]=_0x4f7030[_0x29ac('0x32')][_0x29ac('0x31')]?_0x4f7030[_0x29ac('0x32')]:_0x116e49['model'];if(_0x191c39[_0x29ac('0x2d')][_0x29ac('0x40')]){_0x4f7030[_0x29ac('0x41')]=[{'all':!![]}];}_0x4f7030=_[_0x29ac('0x3a')]({},_0x4f7030,_0x191c39[_0x29ac('0x3b')]);return db['SmsApplication']['find'](_0x4f7030)[_0x29ac('0x20')](handleEntityNotFound(_0x7c759,null))[_0x29ac('0x20')](respondWithResult(_0x7c759,null))[_0x29ac('0x42')](handleError(_0x7c759,null));};exports[_0x29ac('0x43')]=function(_0x3a586a,_0x2ce793){return db[_0x29ac('0x28')]['create'](_0x3a586a[_0x29ac('0x44')],{})[_0x29ac('0x20')](respondWithResult(_0x2ce793,0xc9))['catch'](handleError(_0x2ce793,null));};exports['update']=function(_0x2f03c3,_0x5a92f1){if(_0x2f03c3[_0x29ac('0x44')]['id']){delete _0x2f03c3[_0x29ac('0x44')]['id'];}return db['SmsApplication'][_0x29ac('0x45')]({'where':{'id':_0x2f03c3['params']['id']}})[_0x29ac('0x20')](handleEntityNotFound(_0x5a92f1,null))[_0x29ac('0x20')](saveUpdates(_0x2f03c3['body'],null))['then'](respondWithResult(_0x5a92f1,null))['catch'](handleError(_0x5a92f1,null));};exports[_0x29ac('0x21')]=function(_0x5d00c6,_0x365042){return db[_0x29ac('0x28')]['find']({'where':{'id':_0x5d00c6[_0x29ac('0x3e')]['id']}})['then'](handleEntityNotFound(_0x365042,null))[_0x29ac('0x20')](removeEntity(_0x365042,null))[_0x29ac('0x42')](handleError(_0x365042,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 53a0d1a..963f60f 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 _0xe17e=['api','request-promise','path','rimraf','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xc40376,_0x2f3385){var _0x1dc62a=function(_0x5bdc5c){while(--_0x5bdc5c){_0xc40376['push'](_0xc40376['shift']());}};_0x1dc62a(++_0x2f3385);}(_0xe17e,0x1de));var _0xee17=function(_0x23f5df,_0x482242){_0x23f5df=_0x23f5df-0x0;var _0x48dd6b=_0xe17e[_0x23f5df];return _0x48dd6b;};'use strict';var _=require(_0xee17('0x0'));var util=require(_0xee17('0x1'));var logger=require('../../config/logger')(_0xee17('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xee17('0x3'));var fs=require('fs');var path=require(_0xee17('0x4'));var rimraf=require(_0xee17('0x5'));var config=require('../../config/environment');var attributes=require(_0xee17('0x6'));module[_0xee17('0x7')]=function(_0x41288a,_0x4cb640){return _0x41288a['define'](_0xee17('0x8'),attributes,{'tableName':_0xee17('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee17('0xa'),'collate':_0xee17('0xb')});}; \ No newline at end of file +var _0x347a=['../../config/environment','exports','define','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x46b057,_0x25aa56){var _0x25cf84=function(_0x324ba6){while(--_0x324ba6){_0x46b057['push'](_0x46b057['shift']());}};_0x25cf84(++_0x25aa56);}(_0x347a,0x17b));var _0xa347=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0x347a[_0x5f5cce];return _0x705ecf;};'use strict';var _=require(_0xa347('0x0'));var util=require(_0xa347('0x1'));var logger=require(_0xa347('0x2'))('api');var moment=require(_0xa347('0x3'));var BPromise=require('bluebird');var rp=require(_0xa347('0x4'));var fs=require('fs');var path=require(_0xa347('0x5'));var rimraf=require('rimraf');var config=require(_0xa347('0x6'));var attributes=require('./smsApplication.attributes');module[_0xa347('0x7')]=function(_0x3506f8,_0xcc3ede){return _0x3506f8[_0xa347('0x8')]('SmsApplication',attributes,{'tableName':_0xa347('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa347('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 439e292..048fece 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 _0x6f47=['request\x20sent','debug','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x6f47,0xc7));var _0x76f4=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x6f47[_0x468b0f];return _0x3e74d9;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x76f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76f4('0x4'))(_0x76f4('0x5'));var config=require(_0x76f4('0x6'));var jayson=require(_0x76f4('0x7'));var client=jayson['client'][_0x76f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){return client[_0x76f4('0x9')](_0xfc2405,_0x497f99)[_0x76f4('0xa')](function(_0x101f55){logger['info']('SmsApplication,\x20%s,\x20%s',_0x2176a7,_0x76f4('0xb'));logger[_0x76f4('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x2176a7,'request\x20sent',JSON[_0x76f4('0xd')](_0x101f55));if(_0x101f55[_0x76f4('0xe')]){if(_0x101f55[_0x76f4('0xe')][_0x76f4('0xf')]===0x1f4){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55[_0x76f4('0xe')][_0x76f4('0x11')]);return _0x25656d(_0x101f55[_0x76f4('0xe')]['message']);}logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55['error']['message']);return _0x1a3172(_0x101f55['error'][_0x76f4('0x11')]);}else{logger[_0x76f4('0x12')](_0x76f4('0x10'),_0x2176a7,_0x76f4('0xb'));_0x1a3172(_0x101f55[_0x76f4('0x13')][_0x76f4('0x11')]);}})[_0x76f4('0x14')](function(_0x981a87){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x981a87);_0x25656d(_0x981a87);});});} \ No newline at end of file +var _0x0bde=['request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x556cfb,_0x25a96f){var _0x23da8e=function(_0x4d3933){while(--_0x4d3933){_0x556cfb['push'](_0x556cfb['shift']());}};_0x23da8e(++_0x25a96f);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe0bd('0x0'));var moment=require('moment');var BPromise=require(_0xe0bd('0x1'));var rs=require(_0xe0bd('0x2'));var fs=require('fs');var Redis=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];var utils=require(_0xe0bd('0x5'));var logger=require('../../config/logger')(_0xe0bd('0x6'));var config=require(_0xe0bd('0x7'));var jayson=require(_0xe0bd('0x8'));var client=jayson[_0xe0bd('0x9')][_0xe0bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26393f,_0x217145,_0x491dc7){return new BPromise(function(_0x40b36a,_0x44cb0b){return client[_0xe0bd('0xb')](_0x26393f,_0x491dc7)[_0xe0bd('0xc')](function(_0x393379){logger[_0xe0bd('0xd')](_0xe0bd('0xe'),_0x217145,_0xe0bd('0xf'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x217145,'request\x20sent',JSON[_0xe0bd('0x10')](_0x393379));if(_0x393379['error']){if(_0x393379['error'][_0xe0bd('0x11')]===0x1f4){logger[_0xe0bd('0x12')]('SmsApplication,\x20%s,\x20%s',_0x217145,_0x393379[_0xe0bd('0x12')]['message']);return _0x44cb0b(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}logger[_0xe0bd('0x12')](_0xe0bd('0xe'),_0x217145,_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);return _0x40b36a(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x217145,'request\x20sent');_0x40b36a(_0x393379[_0xe0bd('0x14')][_0xe0bd('0x13')]);}})[_0xe0bd('0x15')](function(_0x379ea2){logger[_0xe0bd('0x12')]('SmsApplication,\x20%s,\x20%s',_0x217145,_0x379ea2);_0x44cb0b(_0x379ea2);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 21d23f4..51a1cdf 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 _0x57e9=['describe','get','/:id','/:id/messages','getMessages','post','create','/:id/tags','put','tracked','sms','smsinteraction:update','update','destroy','delete','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0x57e9,0xce));var _0x957e=function(_0x4d87ea,_0x733870){_0x4d87ea=_0x4d87ea-0x0;var _0x40bf0=_0x57e9[_0x4d87ea];return _0x40bf0;};'use strict';var multer=require(_0x957e('0x0'));var util=require(_0x957e('0x1'));var path=require(_0x957e('0x2'));var timeout=require('connect-timeout');var express=require(_0x957e('0x3'));var router=express[_0x957e('0x4')]();var auth=require(_0x957e('0x5'));var interaction=require(_0x957e('0x6'));var config=require(_0x957e('0x7'));var controller=require(_0x957e('0x8'));router['get']('/',auth[_0x957e('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x957e('0xa')]);router[_0x957e('0xb')](_0x957e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x957e('0xb')](_0x957e('0xd'),auth[_0x957e('0x9')](),controller[_0x957e('0xe')]);router[_0x957e('0xb')]('/:id/download',auth[_0x957e('0x9')](),controller['download']);router[_0x957e('0xf')]('/',auth[_0x957e('0x9')](),controller[_0x957e('0x10')]);router[_0x957e('0xf')](_0x957e('0xd'),auth['isAuthenticated'](),controller['addMessage']);router[_0x957e('0xf')](_0x957e('0x11'),auth[_0x957e('0x9')](),interaction['tracked']('sms','smsinteraction:addtags'),controller['addTags']);router[_0x957e('0x12')](_0x957e('0xc'),auth[_0x957e('0x9')](),interaction[_0x957e('0x13')](_0x957e('0x14'),_0x957e('0x15')),controller[_0x957e('0x16')]);router['delete']('/:id',auth[_0x957e('0x9')](),interaction[_0x957e('0x13')]('sms','smsinteraction:destroy'),controller[_0x957e('0x17')]);router[_0x957e('0x18')](_0x957e('0x11'),auth[_0x957e('0x9')](),controller[_0x957e('0x19')]);module[_0x957e('0x1a')]=router; \ No newline at end of file +var _0xfa25=['../../config/environment','isAuthenticated','index','get','/:id','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','smsinteraction:destroy','delete','removeTags','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfa25,0xd1));var _0x5fa2=function(_0x147232,_0xf9894d){_0x147232=_0x147232-0x0;var _0x3ef0e8=_0xfa25[_0x147232];return _0x3ef0e8;};'use strict';var multer=require('multer');var util=require(_0x5fa2('0x0'));var path=require(_0x5fa2('0x1'));var timeout=require(_0x5fa2('0x2'));var express=require(_0x5fa2('0x3'));var router=express[_0x5fa2('0x4')]();var auth=require(_0x5fa2('0x5'));var interaction=require(_0x5fa2('0x6'));var config=require(_0x5fa2('0x7'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0x5fa2('0x8')](),controller[_0x5fa2('0x9')]);router['get']('/describe',auth[_0x5fa2('0x8')](),controller['describe']);router[_0x5fa2('0xa')](_0x5fa2('0xb'),auth[_0x5fa2('0x8')](),controller['show']);router[_0x5fa2('0xa')](_0x5fa2('0xc'),auth[_0x5fa2('0x8')](),controller['getMessages']);router[_0x5fa2('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x5fa2('0xd')]);router[_0x5fa2('0xe')]('/',auth['isAuthenticated'](),controller[_0x5fa2('0xf')]);router[_0x5fa2('0xe')](_0x5fa2('0xc'),auth[_0x5fa2('0x8')](),controller[_0x5fa2('0x10')]);router[_0x5fa2('0xe')](_0x5fa2('0x11'),auth[_0x5fa2('0x8')](),interaction[_0x5fa2('0x12')](_0x5fa2('0x13'),_0x5fa2('0x14')),controller[_0x5fa2('0x15')]);router[_0x5fa2('0x16')](_0x5fa2('0xb'),auth['isAuthenticated'](),interaction[_0x5fa2('0x12')](_0x5fa2('0x13'),_0x5fa2('0x17')),controller['update']);router['delete'](_0x5fa2('0xb'),auth[_0x5fa2('0x8')](),interaction[_0x5fa2('0x12')]('sms',_0x5fa2('0x18')),controller['destroy']);router[_0x5fa2('0x19')]('/:id/tags',auth[_0x5fa2('0x8')](),controller[_0x5fa2('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 52d3514..0434dd7 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 _0x757a=['moment','exports','STRING','DATE','ENUM','out'];(function(_0x225d44,_0x399b52){var _0x4aa98a=function(_0xeffa74){while(--_0xeffa74){_0x225d44['push'](_0x225d44['shift']());}};_0x4aa98a(++_0x399b52);}(_0x757a,0xde));var _0xa757=function(_0x4eaafa,_0x48796d){_0x4eaafa=_0x4eaafa-0x0;var _0x41fc25=_0x757a[_0x4eaafa];return _0x41fc25;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa757('0x0'));module[_0xa757('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa757('0x2')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'read1stAt':{'type':Sequelize[_0xa757('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa757('0x4')]('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa757('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb7e7=['out','sequelize','exports','DATE','STRING','ENUM'];(function(_0x46caea,_0x6317fa){var _0x59b13f=function(_0x102f42){while(--_0x102f42){_0x46caea['push'](_0x46caea['shift']());}};_0x59b13f(++_0x6317fa);}(_0xb7e7,0x121));var _0x7b7e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb7e7[_0x68ee8b];return _0x5148f7;};'use strict';var Sequelize=require(_0x7b7e('0x0'));var moment=require('moment');module[_0x7b7e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b7e('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7b7e('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7b7e('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x7b7e('0x4')]('in',_0x7b7e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7b7e('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index b193d95..ef72f27 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 _0x7880=['addTags','setTags','omit','findAll','smsInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','User','CmContact','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','10px','40px','30px','Sms','YYYY-MM-DD','N.A.','closed','closedAt','disposition','out','System','firstName','downloadInteraction.html','toFile','.pdf','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','status','end','offset','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','Users','fullname','TagIds','Tags','split','push','index','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','UserId','text','body','keys','compact','SmsAccountId','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','forEach','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','count','merge','SmsInteraction','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','catch','show','params','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2a7212,_0x612ca1){var _0x1ad58f=function(_0x5a18d8){while(--_0x5a18d8){_0x2a7212['push'](_0x2a7212['shift']());}};_0x1ad58f(++_0x612ca1);}(_0x7880,0x1f4));var _0x0788=function(_0x465d8c,_0x101ece){_0x465d8c=_0x465d8c-0x0;var _0x28f93e=_0x7880[_0x465d8c];return _0x28f93e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0788('0x0'));var rimraf=require(_0x0788('0x1'));var zipdir=require(_0x0788('0x2'));var jsonpatch=require(_0x0788('0x3'));var rp=require(_0x0788('0x4'));var moment=require(_0x0788('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0788('0x6'));var util=require(_0x0788('0x7'));var path=require(_0x0788('0x8'));var sox=require(_0x0788('0x9'));var csv=require(_0x0788('0xa'));var ejs=require(_0x0788('0xb'));var fs=require('fs');var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0xa'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var db=require(_0x0788('0x18'))['db'];config[_0x0788('0x19')]=_[_0x0788('0x1a')](config[_0x0788('0x19')],{'host':_0x0788('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0788('0x19')]));require(_0x0788('0x1c'))[_0x0788('0x1d')](socket);function respondWithStatusCode(_0x13cf07,_0x51e5d3){_0x51e5d3=_0x51e5d3||0xcc;return function(_0x43ca01){if(_0x43ca01){return _0x13cf07['sendStatus'](_0x51e5d3);}return _0x13cf07[_0x0788('0x1e')](_0x51e5d3)[_0x0788('0x1f')]();};}function respondWithResult(_0x3fd1e4,_0xb406fb){_0xb406fb=_0xb406fb||0xc8;return function(_0x2ddd1a){if(_0x2ddd1a){return _0x3fd1e4[_0x0788('0x1e')](_0xb406fb)['json'](_0x2ddd1a);}};}function respondWithFilteredResult(_0x573822,_0x17d805){return function(_0x461d9d){if(_0x461d9d){var _0x5b2bdc=_0x461d9d['count'],_0x654e4b=_0x17d805[_0x0788('0x20')],_0x415f19=_0x17d805[_0x0788('0x20')]+_0x17d805['limit'],_0x17ae59;if(_0x415f19>=_0x5b2bdc){_0x415f19=_0x5b2bdc;_0x17ae59=0xc8;}else{_0x17ae59=0xce;}_0x573822[_0x0788('0x1e')](_0x17ae59);return _0x573822['set'](_0x0788('0x21'),_0x654e4b+'-'+_0x415f19+'/'+_0x5b2bdc)['json'](_0x461d9d);}return null;};}function patchUpdates(_0x17cca3){return function(_0x3c37ca){try{jsonpatch[_0x0788('0x22')](_0x3c37ca,_0x17cca3,!![]);}catch(_0x3cd197){return BPromise[_0x0788('0x23')](_0x3cd197);}return _0x3c37ca['save']();};}function saveUpdates(_0x48ec43,_0x2270d4){return function(_0x2a1460){if(_0x2a1460){return _0x2a1460[_0x0788('0x24')](_0x48ec43)[_0x0788('0x25')](function(_0x5ba1da){return _0x5ba1da;});}return null;};}function removeEntity(_0x4d5c93,_0x79204e){return function(_0x18cc33){if(_0x18cc33){return _0x18cc33[_0x0788('0x26')]()['then'](function(){_0x4d5c93['status'](0xcc)[_0x0788('0x1f')]();});}};}function handleEntityNotFound(_0xa1f7dc,_0x5f2dda){return function(_0x48816a){if(!_0x48816a){_0xa1f7dc[_0x0788('0x27')](0x194);}return _0x48816a;};}function handleError(_0x44798c,_0x57fda1){_0x57fda1=_0x57fda1||0x1f4;return function(_0x286730){logger[_0x0788('0x28')](_0x286730[_0x0788('0x29')]);if(_0x286730[_0x0788('0x2a')]){delete _0x286730[_0x0788('0x2a')];}_0x44798c[_0x0788('0x1e')](_0x57fda1)[_0x0788('0x2b')](_0x286730);};}function getInteractionUsers(_0x3ffe4f,_0x5b7594){return new BPromise(function(_0x5a5178,_0x3c5246){try{if(_0x5b7594[_0x3ffe4f['id']]){_0x3ffe4f[_0x0788('0x2c')]=_['map'](_0x5b7594[_0x3ffe4f['id']],function(_0x4aa48b){return{'id':_0x4aa48b['id'],'fullname':_0x4aa48b[_0x0788('0x2d')]};});}}catch(_0x68658a){_0x3c5246(_0x68658a);}_0x5a5178(_0x3ffe4f);});}function getInteractionTags(_0x20fcd8,_0x436031){return new BPromise(function(_0x44cbfb,_0x44bff2){try{if(_0x20fcd8[_0x0788('0x2e')]){_0x20fcd8[_0x0788('0x2f')]=[];_0x20fcd8[_0x0788('0x2e')][_0x0788('0x30')](',')['forEach'](function(_0x2a08b7){_0x20fcd8[_0x0788('0x2f')][_0x0788('0x31')](_0x436031[_0x2a08b7]);});}delete _0x20fcd8[_0x0788('0x2e')];}catch(_0xce4534){_0x44bff2(_0xce4534);}_0x44cbfb(_0x20fcd8);});}function updateSmsInteraction(_0x458193,_0x26f584,_0x15d67a){return new BPromise(function(_0x1cb6c0,_0xaed27e){return getInteractionUsers(_0x458193,_0x15d67a)['then'](function(_0x4ae132){return getInteractionTags(_0x4ae132,_0x26f584);})['then'](function(_0x5633da){_0x1cb6c0(_0x5633da);})['catch'](function(_0x586a06){_0xaed27e(_0x586a06);});});}exports[_0x0788('0x32')]=function(_0x38a4ae,_0x2130e3){var _0x574576={},_0xe80dba={},_0x3369a1={'count':0x0,'rows':[]};var _0x112476=_[_0x0788('0x33')](db['SmsInteraction'][_0x0788('0x34')],function(_0x4a4a2b){return{'name':_0x4a4a2b[_0x0788('0x35')],'type':_0x4a4a2b['type'][_0x0788('0x36')]};});_0xe80dba[_0x0788('0x37')]=_['map'](_0x112476,_0x0788('0x2a'));_0xe80dba[_0x0788('0x38')]=_['keys'](_0x38a4ae[_0x0788('0x38')]);_0xe80dba['filters']=_[_0x0788('0x39')](_0xe80dba['model'],_0xe80dba[_0x0788('0x38')]);_0x574576['attributes']=_[_0x0788('0x39')](_0xe80dba['model'],qs['fields'](_0x38a4ae[_0x0788('0x38')][_0x0788('0x3a')]));_0x574576[_0x0788('0x3b')]=_0x574576[_0x0788('0x3b')][_0x0788('0x3c')]?_0x574576['attributes']:_0xe80dba['model'];if(!_0x38a4ae['query']['hasOwnProperty'](_0x0788('0x3d'))){_0x574576[_0x0788('0x3e')]=qs[_0x0788('0x3e')](_0x38a4ae[_0x0788('0x38')][_0x0788('0x3e')]);_0x574576['offset']=qs['offset'](_0x38a4ae[_0x0788('0x38')][_0x0788('0x20')]);}_0x574576[_0x0788('0x3f')]=qs[_0x0788('0x40')](_0x38a4ae[_0x0788('0x38')][_0x0788('0x40')]);_0x574576[_0x0788('0x41')]=qs[_0x0788('0x42')](_[_0x0788('0x43')](_0x38a4ae['query'],_0xe80dba['filters']));var _0x441aec=[];var _0x1d579d=squel[_0x0788('0x44')]()['field']('id')['field']('name')[_0x0788('0x45')](_0x0788('0x46'))[_0x0788('0x47')](_0x0788('0x48'));var _0x2737d8=squel[_0x0788('0x44')]()[_0x0788('0x45')](_0x0788('0x49'))['field'](_0x0788('0x4a'))[_0x0788('0x45')](_0x0788('0x4b'))[_0x0788('0x47')]('user_has_sms_interactions','ui')[_0x0788('0x4c')](_0x0788('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x5b5481=squel['select']()[_0x0788('0x47')]('sms_interactions','i')[_0x0788('0x4c')](_0x0788('0x4e'),'c',_0x0788('0x4f'))[_0x0788('0x4c')](_0x0788('0x4d'),'o',_0x0788('0x50'))[_0x0788('0x4c')](_0x0788('0x51'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0x0788('0x52'),'me',_0x0788('0x53'))[_0x0788('0x4c')]('sms_interaction_has_tags','it',_0x0788('0x54'))[_0x0788('0x4c')](_0x0788('0x48'),'t',_0x0788('0x55'));var _0x2395ad=squel['expr']();var _0x5c436a=[];var _0x45bcbf=squel[_0x0788('0x56')]();var _0x5f1542;if(_0x38a4ae[_0x0788('0x38')]['search']){_0x5f1542=as[_0x0788('0x57')](_0x38a4ae[_0x0788('0x38')][_0x0788('0x58')]);var _0xf0db5b=_0x5f1542[_0x0788('0x59')];for(var _0x379928=0x0;_0x379928<_0x5f1542[_0x0788('0x5a')][_0x0788('0x3c')];_0x379928++){var _0x5f3bda=_0x5f1542[_0x0788('0x5a')][_0x379928];var _0x363ab9='i';var _0x3f2f1b=_['find'](_0x112476,[_0x0788('0x2a'),_0x5f3bda[_0x0788('0x45')]]);if(!_0x3f2f1b){switch(_0x5f3bda['field']){case _0x0788('0x5b'):if(_0x5f3bda[_0x0788('0x5c')]==0x1){_0x5b5481[_0x0788('0x5d')]('`'+_0x5f3bda[_0x0788('0x45')]+_0x0788('0x5e'));}else{_0x5b5481[_0x0788('0x5d')]('`'+_0x5f3bda['field']+'`\x20>\x200');}break;case _0x0788('0x5f'):if(_0x5f3bda[_0x0788('0x60')]==='$substring'){if(_0x5f3bda[_0x0788('0x5c')][_0x0788('0x30')]('\x20')[_0x0788('0x3c')]>0x1){_0x2395ad[_0xf0db5b](_0x0788('0x61'),qs[_0x0788('0x62')](_0x5f3bda[_0x0788('0x5c')]),null);}else{var _0x112870='%'+_0x5f3bda[_0x0788('0x5c')]+'%';_0x2395ad[_0xf0db5b](_0x0788('0x63'),_0x112870,_0x112870,_0x112870);}}else{_0x3f2f1b=_[_0x0788('0x64')](_0x112476,[_0x0788('0x2a'),_0x0788('0x65')]);_0x5f3bda['field']=_0x0788('0x65');_0x5a353f=as[_0x0788('0x66')](_0x363ab9,_0x3f2f1b[_0x0788('0x67')],_0x5f3bda);_0x2395ad[_0xf0db5b](_0x5a353f['text'],_0x5a353f[_0x0788('0x5c')][_0x0788('0x68')],_0x5a353f['value']['end']);}break;case _0x0788('0x69'):var _0x26826a=_0x5f3bda[_0x0788('0x5c')][_0x0788('0x30')](',')[_0x0788('0x33')](function(_0x4c08f9){return Number(_0x4c08f9);});_0x26826a['forEach'](function(_0x336d30){_0x45bcbf['or'](_0x0788('0x6a'),'%,'+_0x336d30+',%');});_0x5c436a=_[_0x0788('0x6b')](_0x5c436a,_0x26826a);break;case'User':if(_0x5f3bda['operator']===_0x0788('0x6c')){_0x2395ad[_0xf0db5b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5f3bda[_0x0788('0x5c')]+'%',null);}else{_0x3f2f1b=_[_0x0788('0x64')](_0x112476,[_0x0788('0x2a'),_0x0788('0x6d')]);_0x5f3bda[_0x0788('0x45')]=_0x0788('0x6d');_0x5a353f=as[_0x0788('0x66')](_0x363ab9,_0x3f2f1b[_0x0788('0x67')],_0x5f3bda);_0x2395ad[_0xf0db5b](_0x5a353f[_0x0788('0x6e')],_0x5a353f[_0x0788('0x5c')]['start'],_0x5a353f[_0x0788('0x5c')][_0x0788('0x1f')]);}break;case _0x0788('0x6f'):_0x5a353f=as[_0x0788('0x66')]('me',null,_0x5f3bda);_0x2395ad[_0xf0db5b](_0x5a353f['text'],_0x5a353f[_0x0788('0x5c')][_0x0788('0x68')],_0x5a353f[_0x0788('0x5c')][_0x0788('0x1f')]);break;}}else{var _0x5a353f=as['buildExpression'](_0x363ab9,_0x3f2f1b[_0x0788('0x67')],_0x5f3bda);_0x2395ad[_0xf0db5b](_0x5a353f['text'],_0x5a353f[_0x0788('0x5c')][_0x0788('0x68')],_0x5a353f[_0x0788('0x5c')][_0x0788('0x1f')]);}}}else{var _0x3baf23=_(_0x38a4ae[_0x0788('0x38')])[_0x0788('0x70')]()[_0x0788('0x33')](function(_0x17266c){return _['some'](_0x112476,[_0x0788('0x2a'),_0x17266c])?_0x17266c:undefined;})[_0x0788('0x71')]()[_0x0788('0x5c')]();if(!_['isEmpty'](_0x3baf23)){_0x3baf23['forEach'](function(_0x6d255b){if(_0x6d255b===_0x0788('0x72')){_0x5b5481[_0x0788('0x41')]('i.SmsAccountId\x20IN\x20?',[][_0x0788('0x73')](_0x38a4ae[_0x0788('0x38')][_0x6d255b]));}else if(_0x6d255b===_0x0788('0x74')){var _0x2851cf=JSON['parse'](_0x38a4ae['query'][_0x6d255b])['$gte'];var _0x3d9ee0=JSON[_0x0788('0x75')](_0x38a4ae[_0x0788('0x38')][_0x6d255b])['$lte'];_0x5b5481['where'](_0x0788('0x76'),_0x2851cf,_0x3d9ee0);}else{if(_0x38a4ae['query'][_0x6d255b]===_0x0788('0x77')){_0x5b5481[_0x0788('0x41')]('i.'+_0x6d255b+_0x0788('0x78'));}else{_0x5b5481[_0x0788('0x41')]('i.'+_0x6d255b+_0x0788('0x79'),_0x38a4ae[_0x0788('0x38')][_0x6d255b]);}}});}if(_0x38a4ae[_0x0788('0x38')][_0x0788('0x7a')]){if(_0x38a4ae[_0x0788('0x38')][_0x0788('0x7a')]==0x1){_0x5b5481['having'](_0x0788('0x7b'));}else{_0x5b5481[_0x0788('0x5d')]('`unreadMessages`\x20>\x200');}}if(_0x38a4ae['query'][_0x0788('0x7c')]){_0x5c436a=_[_0x0788('0x7d')](_0x38a4ae[_0x0788('0x38')][_0x0788('0x7c')])?_0x38a4ae[_0x0788('0x38')][_0x0788('0x7c')]:new Array(_0x38a4ae['query'][_0x0788('0x7c')]);_0x5c436a[_0x0788('0x7e')](function(_0x30a9ba){_0x45bcbf['or'](_0x0788('0x6a'),'%,'+_0x30a9ba+',%');});}if(_0x38a4ae['query'][_0x0788('0x7f')]){var _0x2272e2=_0x38a4ae[_0x0788('0x38')][_0x0788('0x7f')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0788('0x80'));if(qs[_0x0788('0x81')](_0x2272e2)){_0x2395ad['or'](_0x0788('0x82'),_0x2272e2+'%')['or'](_0x0788('0x83'),_0x2272e2+'%');}else{_0x2395ad['or'](_0x0788('0x84'),qs[_0x0788('0x62')](_0x2272e2))['or'](_0x0788('0x85'),_0x2272e2+'%');}}}_0x5b5481[_0x0788('0x41')](_0x2395ad);_0x5b5481[_0x0788('0x86')]('i.id');var _0x11dbf9={'type':db[_0x0788('0x87')][_0x0788('0x88')]['SELECT'],'raw':!![]};var _0x534a21=_0x5b5481[_0x0788('0x89')]();_0x534a21['field'](_0x0788('0x8a'));_0x534a21[_0x0788('0x45')](_0x0788('0x8b'),_0x0788('0x5b'));if(_0x574576[_0x0788('0x3f')]){_0x574576[_0x0788('0x3f')][_0x0788('0x7e')](function(_0x216ea9){_0x5b5481[_0x0788('0x3f')]('i.'+_0x216ea9[0x0],_0x216ea9[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0788('0x8c')](_0x5c436a)){_0x5b5481[_0x0788('0x5d')](_0x45bcbf);_0x534a21[_0x0788('0x41')]('t.id\x20IN\x20?',_0x5c436a);}BPromise[_0x0788('0x8d')]()[_0x0788('0x25')](function(){if(!_0x5f1542){if(_0x38a4ae[_0x0788('0x38')]['SmsAccountId']||_0x38a4ae[_0x0788('0x38')][_0x0788('0x8e')])return;_0x534a21[_0x0788('0x41')](_0x0788('0x8f'));_0x5b5481[_0x0788('0x41')](_0x0788('0x8f'));return;}return _0x38a4ae[_0x0788('0x90')][_0x0788('0x91')]({'attributes':['id'],'raw':!![]})[_0x0788('0x25')](function(_0x5d8ddb){if(_[_0x0788('0x8c')](_0x5d8ddb)){_0x534a21[_0x0788('0x41')](_0x0788('0x92'));_0x5b5481[_0x0788('0x41')](_0x0788('0x92'));}else{_0x534a21['where'](_0x0788('0x93'),_[_0x0788('0x33')](_0x5d8ddb,'id'));_0x5b5481[_0x0788('0x41')]('i.SmsAccountId\x20IN\x20?',_[_0x0788('0x33')](_0x5d8ddb,'id'));}});})[_0x0788('0x25')](function(){db[_0x0788('0x94')][_0x0788('0x38')](_0x534a21[_0x0788('0x95')](),_0x11dbf9)['then'](function(_0x243965){_0x3369a1[_0x0788('0x96')]=_0x243965['length'];if(_0x3369a1[_0x0788('0x96')]===0x0)return[];return db[_0x0788('0x94')]['query'](_0x1d579d[_0x0788('0x95')](),_0x11dbf9)[_0x0788('0x25')](function(_0x9a0ef){_0x441aec=_['keyBy'](_0x9a0ef,'id');_0x11dbf9=_[_0x0788('0x97')](_0x11dbf9,{'model':db[_0x0788('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38a4ae[_0x0788('0x38')]['fields']){_0x574576[_0x0788('0x3b')][_0x0788('0x7e')](function(_0x197e1a){_0x5b5481[_0x0788('0x45')]('i.'+_0x197e1a);});}else{_0x5b5481[_0x0788('0x45')](_0x0788('0x8b'),_0x0788('0x5b'));_0x5b5481[_0x0788('0x45')]('a.key',_0x0788('0x99'));_0x5b5481[_0x0788('0x45')](_0x0788('0x9a'),_0x0788('0x9b'));_0x5b5481['field']('i.*');_0x5b5481[_0x0788('0x45')](_0x0788('0x9c'),'Contact.firstName');_0x5b5481[_0x0788('0x45')](_0x0788('0x9d'),_0x0788('0x9e'));_0x5b5481['field']('c.email',_0x0788('0x9f'));_0x5b5481[_0x0788('0x45')]('c.phone','Contact.phone');_0x5b5481['field'](_0x0788('0xa0'),_0x0788('0xa1'));_0x5b5481['field'](_0x0788('0xa2'),_0x0788('0xa3'));_0x5b5481[_0x0788('0x45')](_0x0788('0xa4'),_0x0788('0xa5'));_0x5b5481['field'](_0x0788('0xa6'),'Owner.internal');_0x5b5481[_0x0788('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0788('0x2e'));}_0x5b5481[_0x0788('0x3e')](_0x574576[_0x0788('0x3e')]);_0x5b5481[_0x0788('0x20')](_0x574576[_0x0788('0x20')]);return db[_0x0788('0x94')][_0x0788('0x38')](_0x5b5481[_0x0788('0x95')](),_0x11dbf9);})[_0x0788('0x25')](function(_0x183936){_0x2737d8[_0x0788('0x41')](_0x0788('0xa7'),_[_0x0788('0x33')](_0x183936,'id'));return db['sequelize']['query'](_0x2737d8['toString'](),_0x11dbf9)[_0x0788('0x25')](function(_0x120435){var _0x10276e=_[_0x0788('0xa8')](_0x120435,_0x0788('0xa9'));var _0x31b46e=[];_0x183936[_0x0788('0x7e')](function(_0x16838d){_0x31b46e[_0x0788('0x31')](updateSmsInteraction(_0x16838d,_0x441aec,_0x10276e));});return BPromise[_0x0788('0xaa')](_0x31b46e);});});})[_0x0788('0x25')](function(_0x4a4ad4){_0x3369a1['rows']=_0x4a4ad4;return _0x3369a1;})[_0x0788('0x25')](respondWithFilteredResult(_0x2130e3,_0x574576));})[_0x0788('0xab')](handleError(_0x2130e3,null));};exports[_0x0788('0xac')]=function(_0x1a3f4d,_0x45e33c){var _0x14ac26={'raw':![],'where':{'id':_0x1a3f4d[_0x0788('0xad')]['id']}},_0x37d04b={};_0x37d04b['model']=_['keys'](db[_0x0788('0x98')][_0x0788('0x34')]);_0x37d04b[_0x0788('0x38')]=_[_0x0788('0x70')](_0x1a3f4d[_0x0788('0x38')]);_0x37d04b[_0x0788('0x42')]=_['intersection'](_0x37d04b[_0x0788('0x37')],_0x37d04b[_0x0788('0x38')]);_0x14ac26[_0x0788('0x3b')]=_[_0x0788('0x39')](_0x37d04b[_0x0788('0x37')],qs[_0x0788('0x3a')](_0x1a3f4d[_0x0788('0x38')][_0x0788('0x3a')]));_0x14ac26[_0x0788('0x3b')]=_0x14ac26['attributes'][_0x0788('0x3c')]?_0x14ac26[_0x0788('0x3b')]:_0x37d04b[_0x0788('0x37')];if(_0x1a3f4d[_0x0788('0x38')][_0x0788('0xae')]){_0x14ac26[_0x0788('0xaf')]=[{'all':!![]}];}_0x14ac26=_['merge']({},_0x14ac26,_0x1a3f4d[_0x0788('0xb0')]);return db[_0x0788('0x98')][_0x0788('0x64')](_0x14ac26)[_0x0788('0x25')](handleEntityNotFound(_0x45e33c,null))[_0x0788('0x25')](respondWithResult(_0x45e33c,null))[_0x0788('0xab')](handleError(_0x45e33c,null));};exports[_0x0788('0xb1')]=function(_0x3d3779,_0x15da7a){return db[_0x0788('0x98')]['create'](_0x3d3779[_0x0788('0x6f')],{})['then'](respondWithResult(_0x15da7a,0xc9))[_0x0788('0xab')](handleError(_0x15da7a,null));};exports['update']=function(_0x223ff3,_0x5cb648){if(_0x223ff3[_0x0788('0x6f')]['id']){delete _0x223ff3[_0x0788('0x6f')]['id'];}return db[_0x0788('0x98')][_0x0788('0x64')]({'where':{'id':_0x223ff3['params']['id']}})[_0x0788('0x25')](handleEntityNotFound(_0x5cb648,null))[_0x0788('0x25')](saveUpdates(_0x223ff3[_0x0788('0x6f')],null))['then'](respondWithResult(_0x5cb648,null))[_0x0788('0xab')](handleError(_0x5cb648,null));};exports[_0x0788('0x26')]=function(_0x4be239,_0x172df1){return db[_0x0788('0x98')][_0x0788('0x64')]({'where':{'id':_0x4be239[_0x0788('0xad')]['id']}})[_0x0788('0x25')](handleEntityNotFound(_0x172df1,null))[_0x0788('0x25')](removeEntity(_0x172df1,null))[_0x0788('0xab')](handleError(_0x172df1,null));};exports['describe']=function(_0x983cb,_0x25105a){return db[_0x0788('0x98')][_0x0788('0xb2')]()[_0x0788('0x25')](respondWithResult(_0x25105a,null))[_0x0788('0xab')](handleError(_0x25105a,null));};exports[_0x0788('0xb3')]=function(_0x1a094b,_0x5761b1,_0x5130c4){return db[_0x0788('0xb4')][_0x0788('0x64')]({'where':{'id':_0x1a094b[_0x0788('0xad')]['id']}})[_0x0788('0x25')](handleEntityNotFound(_0x5761b1,null))[_0x0788('0x25')](function(_0xbedb18){if(_0xbedb18){return _0xbedb18[_0x0788('0xb3')](_0x1a094b['body'][_0x0788('0xb5')],_['omit'](_0x1a094b['body'],[_0x0788('0xb5'),'id'])||{});}})[_0x0788('0x25')](respondWithResult(_0x5761b1,null))['catch'](handleError(_0x5761b1,null));};exports[_0x0788('0xb6')]=function(_0x66474b,_0x28d0f8,_0x16a035){var _0x3b7f9c={'raw':![],'where':{}};var _0x328606={};var _0x5323d4={'count':0x0,'rows':[]};return db[_0x0788('0x98')][_0x0788('0xb7')]({'where':{'id':_0x66474b['params']['id']}})[_0x0788('0x25')](handleEntityNotFound(_0x28d0f8,null))[_0x0788('0x25')](function(_0x4c59c4){if(_0x4c59c4){_0x328606[_0x0788('0x37')]=_[_0x0788('0x70')](db[_0x0788('0xb4')][_0x0788('0x34')]);_0x328606[_0x0788('0x38')]=_[_0x0788('0x70')](_0x66474b[_0x0788('0x38')]);_0x328606['filters']=_[_0x0788('0x39')](_0x328606[_0x0788('0x37')],_0x328606[_0x0788('0x38')]);_0x3b7f9c[_0x0788('0x3b')]=_['intersection'](_0x328606[_0x0788('0x37')],qs[_0x0788('0x3a')](_0x66474b['query']['fields']));_0x3b7f9c[_0x0788('0x3b')]=_0x3b7f9c[_0x0788('0x3b')][_0x0788('0x3c')]?_0x3b7f9c[_0x0788('0x3b')]:_0x328606[_0x0788('0x37')];if(!_0x66474b[_0x0788('0x38')]['hasOwnProperty'](_0x0788('0x3d'))){_0x3b7f9c[_0x0788('0x3e')]=qs[_0x0788('0x3e')](_0x66474b[_0x0788('0x38')][_0x0788('0x3e')]);_0x3b7f9c[_0x0788('0x20')]=qs[_0x0788('0x20')](_0x66474b[_0x0788('0x38')][_0x0788('0x20')]);}_0x3b7f9c[_0x0788('0x3f')]=qs[_0x0788('0x40')](_0x66474b[_0x0788('0x38')][_0x0788('0x40')]);_0x3b7f9c[_0x0788('0x41')]=qs[_0x0788('0x42')](_[_0x0788('0x43')](_0x66474b[_0x0788('0x38')],_0x328606['filters']));_0x3b7f9c[_0x0788('0x41')][_0x0788('0xa9')]=_0x4c59c4['id'];if(_0x66474b[_0x0788('0x38')][_0x0788('0x7f')]){_0x3b7f9c['where']=_[_0x0788('0x97')](_0x3b7f9c['where'],{'$or':_[_0x0788('0x33')](_0x3b7f9c['attributes'],function(_0x51da2c){var _0x34a12a={};_0x34a12a[_0x51da2c]={'$like':'%'+_0x66474b[_0x0788('0x38')]['filter']+'%'};return _0x34a12a;})});}if(_0x66474b[_0x0788('0x38')]['$gte']){var _0x5b69fd=_0x66474b['query'][_0x0788('0xb8')][_0x0788('0x30')](',');var _0x23083d={};_0x23083d[_0x5b69fd[0x0]]={'$gte':moment(_0x5b69fd[0x1])[_0x0788('0xb9')](_0x0788('0xba'))};_0x3b7f9c[_0x0788('0x41')]=_['merge'](_0x3b7f9c[_0x0788('0x41')],_0x23083d);}_0x3b7f9c=_['merge']({},_0x3b7f9c,_0x66474b[_0x0788('0xb0')]);return db[_0x0788('0xb4')]['count']({'where':_0x3b7f9c['where']})['then'](function(_0xf115d){_0x5323d4['count']=_0xf115d;if(_0x66474b['query']['includeAll']){_0x3b7f9c['include']=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x3b7f9c);})[_0x0788('0x25')](function(_0x3c2aa3){_0x5323d4['rows']=_0x3c2aa3;return _0x5323d4;});}})[_0x0788('0x25')](respondWithFilteredResult(_0x28d0f8,_0x3b7f9c))['catch'](handleError(_0x28d0f8,null));};exports[_0x0788('0xbb')]=function(_0x57a090,_0x1c505e,_0xeac33){return db[_0x0788('0x98')][_0x0788('0x64')]({'where':{'id':_0x57a090[_0x0788('0xad')]['id']}})[_0x0788('0x25')](handleEntityNotFound(_0x1c505e,null))[_0x0788('0x25')](function(_0x37439f){if(_0x37439f){return _0x37439f[_0x0788('0xbc')](_0x57a090[_0x0788('0x6f')]['ids'],_[_0x0788('0xbd')](_0x57a090['body'],[_0x0788('0xb5'),'id'])||{})['spread'](function(){return db['Tag'][_0x0788('0xbe')]({'attributes':['id',_0x0788('0x2a'),_0x0788('0x46')],'where':{'id':_0x57a090['body'][_0x0788('0xb5')]}});})[_0x0788('0x25')](function(_0x5be647){socket['emit'](_0x0788('0xbf'),{'id':Number(_0x57a090[_0x0788('0xad')]['id']),'tags':_0x5be647||[]});return{'id':Number(_0x57a090[_0x0788('0xad')]['id']),'tags':_0x5be647||[]};});}})['then'](respondWithResult(_0x1c505e,null))['catch'](handleError(_0x1c505e,null));};exports[_0x0788('0xc0')]=function(_0xfcb10a,_0x32fce6,_0xe288b6){return db[_0x0788('0x98')][_0x0788('0x64')]({'where':{'id':_0xfcb10a[_0x0788('0xad')]['id']}})[_0x0788('0x25')](handleEntityNotFound(_0x32fce6,null))[_0x0788('0x25')](function(_0x51f01b){if(_0x51f01b){return _0x51f01b[_0x0788('0xc0')](_0xfcb10a['query'][_0x0788('0xb5')]);}})[_0x0788('0x25')](respondWithStatusCode(_0x32fce6,null))[_0x0788('0xab')](handleError(_0x32fce6,null));};exports[_0x0788('0xc1')]=function(_0x140468,_0x4ab792){var _0x6f1a32=moment()[_0x0788('0xc2')]()['toString']();var _0x10d641=path[_0x0788('0xc3')](config['root'],_0x0788('0xc4'),'files',_0x0788('0xc5'));var _0xc257be=path['join'](config[_0x0788('0xc6')],_0x0788('0xc4'),_0x0788('0xc7'),_0x0788('0xc8'));var _0x2aaceb=path[_0x0788('0xc3')](_0x10d641,_0x6f1a32);var _0x2fd121=util[_0x0788('0xb9')]('transcript-%d-%s.zip',_0x140468[_0x0788('0xad')]['id'],_0x6f1a32);var _0xc9855c=path[_0x0788('0xc3')](_0x10d641,_0x2fd121);var _0x5d3d04=[];_0x5d3d04['push']({'model':db[_0x0788('0xc9')],'as':_0x0788('0xc9'),'attributes':['id',_0x0788('0x2d')],'raw':!![]});_0x5d3d04[_0x0788('0x31')]({'model':db[_0x0788('0xca')],'as':_0x0788('0x5f'),'attributes':['id','firstName',_0x0788('0xcb')],'raw':!![]});var _0x227eaf=[{'model':db[_0x0788('0xb4')],'as':_0x0788('0xcc'),'attributes':['id',_0x0788('0x6f'),_0x0788('0x74'),_0x0788('0xcd'),_0x0788('0xce'),_0x0788('0x7a')],'include':_0x5d3d04}];_0x227eaf[_0x0788('0x31')]({'model':db[_0x0788('0xcf')],'as':_0x0788('0xd0'),'attributes':['id',_0x0788('0x2a')]});_0x227eaf[_0x0788('0x31')]({'model':db[_0x0788('0xc9')],'as':_0x0788('0xd1'),'attributes':['id',_0x0788('0x2d')]});return db[_0x0788('0x98')][_0x0788('0x64')]({'where':{'id':_0x140468[_0x0788('0xad')]['id']},'include':_0x227eaf})[_0x0788('0x25')](handleEntityNotFound(_0x4ab792,null))['then'](function(_0xfe5bae){if(_0xfe5bae){var _0x2e244c=_0xfe5bae[_0x0788('0xd2')]({'plain':!![]});fs[_0x0788('0xd3')](_0x2aaceb);var _0x47f5bc={'format':'A4','border':_0x0788('0xd4'),'header':{'height':_0x0788('0xd5'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x0788('0xd6'),'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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util['format']('%s\x20#%d',_0x0788('0xd7'),_0x2e244c['id']),moment()[_0x0788('0xb9')](_0x0788('0xd8'))[_0x0788('0x95')]())}}};var _0x463d51={'channel':_0x0788('0xd7'),'account':_0x2e244c[_0x0788('0xd0')][_0x0788('0x2a')],'agent':_0x2e244c[_0x0788('0xd1')]?_0x2e244c[_0x0788('0xd1')][_0x0788('0x2d')]:_0x0788('0xd9'),'createdAt':moment(_0x2e244c['createdAt'])[_0x0788('0xb9')](_0x0788('0xba'))['toString'](),'closedAt':_0x2e244c[_0x0788('0xda')]?moment(_0x2e244c[_0x0788('0xdb')])[_0x0788('0xb9')](_0x0788('0xba'))[_0x0788('0x95')]():'','disposition':_0x2e244c[_0x0788('0xdc')],'messages':_(_0x2e244c[_0x0788('0xcc')])[_0x0788('0x7f')]({'secret':![]})[_0x0788('0x33')](function(_0x2f5d4b){return{'date':moment(_0x2f5d4b[_0x0788('0x74')])[_0x0788('0xb9')](_0x0788('0xba'))['toString'](),'sender':_0x2f5d4b[_0x0788('0xcd')]===_0x0788('0xdd')?_0x2f5d4b['User']?_0x2f5d4b['User'][_0x0788('0x2d')]:_0x0788('0xde'):_0x2f5d4b['Contact'][_0x0788('0xdf')]+(_0x2f5d4b[_0x0788('0x5f')][_0x0788('0xcb')]?'\x20'+_0x2f5d4b['Contact']['lastName']:''),'body':_0x2f5d4b[_0x0788('0x6f')],'direction':_0x2f5d4b[_0x0788('0xcd')]==='out'?'A':'C','secret':_0x2f5d4b['secret'],'read':_0x2f5d4b[_0x0788('0x7a')]};})[_0x0788('0x5c')]()};return ejs['renderFile'](path['join'](config[_0x0788('0xc6')],_0x0788('0xc4'),'views',_0x0788('0xe0')),{'interaction':_0x463d51})[_0x0788('0x25')](function(_0x5cf69e){return new BPromise(function(_0x3cfcc5,_0x21be45){pdf[_0x0788('0xb1')](_0x5cf69e,_0x47f5bc)[_0x0788('0xe1')](path[_0x0788('0xc3')](_0x2aaceb,'transcript-'+_0x2e244c['id']+'-'+_0x6f1a32+_0x0788('0xe2')),function(_0x5f5eba,_0x13b782){if(_0x5f5eba)return _0x21be45(_0x5f5eba);_0x3cfcc5(_0x13b782);});});})[_0x0788('0x25')](function(){return new BPromise(function(_0x11e5d8,_0x569b4d){zipdir(_0x2aaceb,{'saveTo':_0xc9855c},function(_0x31ffc7,_0x59aece){if(_0x31ffc7)return _0x569b4d(_0x31ffc7);return _0x11e5d8(_0x59aece);});})['then'](function(){return new BPromise(function(_0x3c1c2f,_0x456810){rimraf(_0x2aaceb,function(_0x3787d3){if(_0x3787d3)_0x456810(_0x3787d3);return _0x3c1c2f();});});})[_0x0788('0x25')](function(){return _0x4ab792['download'](_0xc9855c,_0x2fd121,function(_0x32a067){if(_0x32a067){console[_0x0788('0xe3')](_0x0788('0xe4'),_0x32a067);}else{fs['unlinkSync'](_0xc9855c);}});});});}else{return _0x4ab792[_0x0788('0x27')](0xc8);}})[_0x0788('0xab')](handleError(_0x4ab792,null));}; \ No newline at end of file +var _0x2da6=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','error','name','map','fullname','Tags','TagIds','split','forEach','catch','SmsInteraction','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','field','from','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','select','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','UserId','body','keys','some','compact','concat','createdAt','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','resolve','SmsAccountId','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','rows','show','options','create','destroy','describe','addMessage','params','ids','omit','getMessages','findOne','SmsMessage','pick','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','addTags','setTags','findAll','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','User','Owner','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','N.A.','closed','closedAt','disposition','out','renderFile','toFile','transcript-','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x346e50,_0x3a1c58){var _0x45a63b=function(_0x42c57e){while(--_0x42c57e){_0x346e50['push'](_0x346e50['shift']());}};_0x45a63b(++_0x3a1c58);}(_0x2da6,0x1dd));var _0x62da=function(_0xb0a08c,_0x11dcb7){_0xb0a08c=_0xb0a08c-0x0;var _0x12dea7=_0x2da6[_0xb0a08c];return _0x12dea7;};'use strict';var pdf=require(_0x62da('0x0'));var emlformat=require(_0x62da('0x1'));var rimraf=require(_0x62da('0x2'));var zipdir=require(_0x62da('0x3'));var jsonpatch=require(_0x62da('0x4'));var rp=require(_0x62da('0x5'));var moment=require(_0x62da('0x6'));var BPromise=require(_0x62da('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x62da('0x8'));var sox=require(_0x62da('0x9'));var csv=require(_0x62da('0xa'));var ejs=require(_0x62da('0xb'));var fs=require('fs');var _=require(_0x62da('0xc'));var squel=require(_0x62da('0xd'));var crypto=require(_0x62da('0xe'));var jsforce=require(_0x62da('0xf'));var deskjs=require(_0x62da('0x10'));var toCsv=require('to-csv');var querystring=require(_0x62da('0x11'));var Papa=require(_0x62da('0x12'));var Redis=require(_0x62da('0x13'));var authService=require(_0x62da('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x62da('0x15'));var hardwareService=require(_0x62da('0x16'));var logger=require(_0x62da('0x17'))(_0x62da('0x18'));var utils=require(_0x62da('0x19'));var config=require('../../config/environment');var db=require(_0x62da('0x1a'))['db'];config[_0x62da('0x1b')]=_[_0x62da('0x1c')](config[_0x62da('0x1b')],{'host':_0x62da('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x62da('0x1e'))[_0x62da('0x1f')](socket);function respondWithStatusCode(_0x1bd7f9,_0x191ed5){_0x191ed5=_0x191ed5||0xcc;return function(_0x23240e){if(_0x23240e){return _0x1bd7f9[_0x62da('0x20')](_0x191ed5);}return _0x1bd7f9[_0x62da('0x21')](_0x191ed5)[_0x62da('0x22')]();};}function respondWithResult(_0x2cbdf6,_0xcc1a25){_0xcc1a25=_0xcc1a25||0xc8;return function(_0x33ec53){if(_0x33ec53){return _0x2cbdf6[_0x62da('0x21')](_0xcc1a25)[_0x62da('0x23')](_0x33ec53);}};}function respondWithFilteredResult(_0x1aa4f3,_0x4bdab9){return function(_0x4ad626){if(_0x4ad626){var _0xa7050b=_0x4ad626[_0x62da('0x24')],_0x4ae4fb=_0x4bdab9['offset'],_0x4d6482=_0x4bdab9[_0x62da('0x25')]+_0x4bdab9['limit'],_0x264366;if(_0x4d6482>=_0xa7050b){_0x4d6482=_0xa7050b;_0x264366=0xc8;}else{_0x264366=0xce;}_0x1aa4f3[_0x62da('0x21')](_0x264366);return _0x1aa4f3[_0x62da('0x26')](_0x62da('0x27'),_0x4ae4fb+'-'+_0x4d6482+'/'+_0xa7050b)[_0x62da('0x23')](_0x4ad626);}return null;};}function patchUpdates(_0x3d015f){return function(_0x267cef){try{jsonpatch[_0x62da('0x28')](_0x267cef,_0x3d015f,!![]);}catch(_0x2f2b66){return BPromise[_0x62da('0x29')](_0x2f2b66);}return _0x267cef['save']();};}function saveUpdates(_0x13bf6d,_0x866a76){return function(_0x2fd925){if(_0x2fd925){return _0x2fd925[_0x62da('0x2a')](_0x13bf6d)[_0x62da('0x2b')](function(_0x54b936){return _0x54b936;});}return null;};}function removeEntity(_0x24298a,_0x50ed6b){return function(_0x55fd3b){if(_0x55fd3b){return _0x55fd3b['destroy']()[_0x62da('0x2b')](function(){_0x24298a[_0x62da('0x21')](0xcc)[_0x62da('0x22')]();});}};}function handleEntityNotFound(_0x3f6fc9,_0x4b1237){return function(_0x2b7daa){if(!_0x2b7daa){_0x3f6fc9[_0x62da('0x20')](0x194);}return _0x2b7daa;};}function handleError(_0x5f0a9c,_0x3ccf96){_0x3ccf96=_0x3ccf96||0x1f4;return function(_0x195dc4){logger[_0x62da('0x2c')](_0x195dc4['stack']);if(_0x195dc4[_0x62da('0x2d')]){delete _0x195dc4[_0x62da('0x2d')];}_0x5f0a9c[_0x62da('0x21')](_0x3ccf96)['send'](_0x195dc4);};}function getInteractionUsers(_0x4f5657,_0x3c6274){return new BPromise(function(_0x301e3d,_0x220ffc){try{if(_0x3c6274[_0x4f5657['id']]){_0x4f5657['Users']=_[_0x62da('0x2e')](_0x3c6274[_0x4f5657['id']],function(_0x2a4681){return{'id':_0x2a4681['id'],'fullname':_0x2a4681[_0x62da('0x2f')]};});}}catch(_0x1f841c){_0x220ffc(_0x1f841c);}_0x301e3d(_0x4f5657);});}function getInteractionTags(_0xd8cf3b,_0x1cf765){return new BPromise(function(_0x592c6c,_0xbe398f){try{if(_0xd8cf3b['TagIds']){_0xd8cf3b[_0x62da('0x30')]=[];_0xd8cf3b[_0x62da('0x31')][_0x62da('0x32')](',')[_0x62da('0x33')](function(_0x10dd0d){_0xd8cf3b[_0x62da('0x30')]['push'](_0x1cf765[_0x10dd0d]);});}delete _0xd8cf3b[_0x62da('0x31')];}catch(_0x25dc6d){_0xbe398f(_0x25dc6d);}_0x592c6c(_0xd8cf3b);});}function updateSmsInteraction(_0x3b392b,_0x5107b1,_0x1af659){return new BPromise(function(_0x47c900,_0x3dd06e){return getInteractionUsers(_0x3b392b,_0x1af659)['then'](function(_0x3a65dc){return getInteractionTags(_0x3a65dc,_0x5107b1);})[_0x62da('0x2b')](function(_0x55eda7){_0x47c900(_0x55eda7);})[_0x62da('0x34')](function(_0x2db44e){_0x3dd06e(_0x2db44e);});});}exports['index']=function(_0x440f1e,_0x210e15){var _0x11bf73={},_0x2541b9={},_0x557b6a={'count':0x0,'rows':[]};var _0x35aa2e=_[_0x62da('0x2e')](db[_0x62da('0x35')][_0x62da('0x36')],function(_0x3d2a6e){return{'name':_0x3d2a6e[_0x62da('0x37')],'type':_0x3d2a6e[_0x62da('0x38')][_0x62da('0x39')]};});_0x2541b9[_0x62da('0x3a')]=_[_0x62da('0x2e')](_0x35aa2e,_0x62da('0x2d'));_0x2541b9[_0x62da('0x3b')]=_['keys'](_0x440f1e[_0x62da('0x3b')]);_0x2541b9['filters']=_[_0x62da('0x3c')](_0x2541b9[_0x62da('0x3a')],_0x2541b9[_0x62da('0x3b')]);_0x11bf73['attributes']=_[_0x62da('0x3c')](_0x2541b9[_0x62da('0x3a')],qs[_0x62da('0x3d')](_0x440f1e[_0x62da('0x3b')]['fields']));_0x11bf73[_0x62da('0x3e')]=_0x11bf73[_0x62da('0x3e')][_0x62da('0x3f')]?_0x11bf73[_0x62da('0x3e')]:_0x2541b9[_0x62da('0x3a')];if(!_0x440f1e[_0x62da('0x3b')][_0x62da('0x40')](_0x62da('0x41'))){_0x11bf73[_0x62da('0x42')]=qs['limit'](_0x440f1e[_0x62da('0x3b')][_0x62da('0x42')]);_0x11bf73['offset']=qs[_0x62da('0x25')](_0x440f1e[_0x62da('0x3b')][_0x62da('0x25')]);}_0x11bf73[_0x62da('0x43')]=qs[_0x62da('0x44')](_0x440f1e[_0x62da('0x3b')][_0x62da('0x44')]);_0x11bf73[_0x62da('0x45')]=qs['filters'](_['pick'](_0x440f1e['query'],_0x2541b9[_0x62da('0x46')]));var _0x54b49c=[];var _0x86f5a8=squel['select']()['field']('id')['field'](_0x62da('0x2d'))[_0x62da('0x47')]('color')[_0x62da('0x48')]('tools_tags');var _0x17dc9f=squel['select']()['field'](_0x62da('0x49'))[_0x62da('0x47')](_0x62da('0x4a'))['field'](_0x62da('0x4b'))[_0x62da('0x48')](_0x62da('0x4c'),'ui')[_0x62da('0x4d')](_0x62da('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x55a8ef=squel[_0x62da('0x4f')]()[_0x62da('0x48')](_0x62da('0x50'),'i')[_0x62da('0x4d')](_0x62da('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x62da('0x4e'),'o',_0x62da('0x52'))['left_join'](_0x62da('0x53'),'a',_0x62da('0x54'))[_0x62da('0x4d')](_0x62da('0x55'),'me',_0x62da('0x56'))['left_join'](_0x62da('0x57'),'it',_0x62da('0x58'))[_0x62da('0x4d')](_0x62da('0x59'),'t',_0x62da('0x5a'));var _0x1f2ab5=squel[_0x62da('0x5b')]();var _0x294bfc=[];var _0x2e7f05=squel['expr']();var _0x3571b2;if(_0x440f1e[_0x62da('0x3b')]['search']){_0x3571b2=as['parseSearch'](_0x440f1e['query'][_0x62da('0x5c')]);var _0x9c316d=_0x3571b2[_0x62da('0x5d')];for(var _0x5cd1a9=0x0;_0x5cd1a9<_0x3571b2[_0x62da('0x5e')][_0x62da('0x3f')];_0x5cd1a9++){var _0x301595=_0x3571b2['conditions'][_0x5cd1a9];var _0x1fff5c='i';var _0x442e3d=_[_0x62da('0x5f')](_0x35aa2e,[_0x62da('0x2d'),_0x301595['field']]);if(!_0x442e3d){switch(_0x301595[_0x62da('0x47')]){case _0x62da('0x60'):if(_0x301595[_0x62da('0x61')]==0x1){_0x55a8ef[_0x62da('0x62')]('`'+_0x301595[_0x62da('0x47')]+_0x62da('0x63'));}else{_0x55a8ef[_0x62da('0x62')]('`'+_0x301595[_0x62da('0x47')]+_0x62da('0x64'));}break;case'Contact':if(_0x301595['operator']===_0x62da('0x65')){if(_0x301595['value']['split']('\x20')['length']>0x1){_0x1f2ab5[_0x9c316d](_0x62da('0x66'),qs[_0x62da('0x67')](_0x301595[_0x62da('0x61')]),null);}else{var _0x56c18e='%'+_0x301595[_0x62da('0x61')]+'%';_0x1f2ab5[_0x9c316d](_0x62da('0x68'),_0x56c18e,_0x56c18e,_0x56c18e);}}else{_0x442e3d=_[_0x62da('0x5f')](_0x35aa2e,[_0x62da('0x2d'),'ContactId']);_0x301595[_0x62da('0x47')]=_0x62da('0x69');_0x54f527=as[_0x62da('0x6a')](_0x1fff5c,_0x442e3d['type'],_0x301595);_0x1f2ab5[_0x9c316d](_0x54f527[_0x62da('0x6b')],_0x54f527['value'][_0x62da('0x6c')],_0x54f527['value'][_0x62da('0x22')]);}break;case _0x62da('0x6d'):var _0x30ba92=_0x301595[_0x62da('0x61')][_0x62da('0x32')](',')[_0x62da('0x2e')](function(_0x2b62ad){return Number(_0x2b62ad);});_0x30ba92['forEach'](function(_0x1b484c){_0x2e7f05['or'](_0x62da('0x6e'),'%,'+_0x1b484c+',%');});_0x294bfc=_['union'](_0x294bfc,_0x30ba92);break;case'User':if(_0x301595[_0x62da('0x6f')]==='$substring'){_0x1f2ab5[_0x9c316d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x301595[_0x62da('0x61')]+'%',null);}else{_0x442e3d=_[_0x62da('0x5f')](_0x35aa2e,[_0x62da('0x2d'),_0x62da('0x70')]);_0x301595[_0x62da('0x47')]=_0x62da('0x70');_0x54f527=as[_0x62da('0x6a')](_0x1fff5c,_0x442e3d[_0x62da('0x38')],_0x301595);_0x1f2ab5[_0x9c316d](_0x54f527[_0x62da('0x6b')],_0x54f527[_0x62da('0x61')][_0x62da('0x6c')],_0x54f527['value']['end']);}break;case _0x62da('0x71'):_0x54f527=as[_0x62da('0x6a')]('me',null,_0x301595);_0x1f2ab5[_0x9c316d](_0x54f527['text'],_0x54f527[_0x62da('0x61')][_0x62da('0x6c')],_0x54f527['value']['end']);break;}}else{var _0x54f527=as[_0x62da('0x6a')](_0x1fff5c,_0x442e3d[_0x62da('0x38')],_0x301595);_0x1f2ab5[_0x9c316d](_0x54f527['text'],_0x54f527[_0x62da('0x61')]['start'],_0x54f527[_0x62da('0x61')][_0x62da('0x22')]);}}}else{var _0x3b59de=_(_0x440f1e[_0x62da('0x3b')])[_0x62da('0x72')]()['map'](function(_0x50600a){return _[_0x62da('0x73')](_0x35aa2e,['name',_0x50600a])?_0x50600a:undefined;})[_0x62da('0x74')]()[_0x62da('0x61')]();if(!_['isEmpty'](_0x3b59de)){_0x3b59de[_0x62da('0x33')](function(_0x533bbc){if(_0x533bbc==='SmsAccountId'){_0x55a8ef['where']('i.SmsAccountId\x20IN\x20?',[][_0x62da('0x75')](_0x440f1e[_0x62da('0x3b')][_0x533bbc]));}else if(_0x533bbc===_0x62da('0x76')){var _0x2debcc=JSON[_0x62da('0x77')](_0x440f1e[_0x62da('0x3b')][_0x533bbc])[_0x62da('0x78')];var _0x586e31=JSON['parse'](_0x440f1e[_0x62da('0x3b')][_0x533bbc])[_0x62da('0x79')];_0x55a8ef[_0x62da('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2debcc,_0x586e31);}else{if(_0x440f1e[_0x62da('0x3b')][_0x533bbc]===_0x62da('0x7a')){_0x55a8ef['where']('i.'+_0x533bbc+'\x20IS\x20NULL');}else{_0x55a8ef[_0x62da('0x45')]('i.'+_0x533bbc+_0x62da('0x7b'),_0x440f1e[_0x62da('0x3b')][_0x533bbc]);}}});}if(_0x440f1e['query']['read']){if(_0x440f1e[_0x62da('0x3b')][_0x62da('0x7c')]==0x1){_0x55a8ef[_0x62da('0x62')]('`unreadMessages`\x20=\x200');}else{_0x55a8ef[_0x62da('0x62')](_0x62da('0x7d'));}}if(_0x440f1e['query'][_0x62da('0x7e')]){_0x294bfc=_[_0x62da('0x7f')](_0x440f1e[_0x62da('0x3b')][_0x62da('0x7e')])?_0x440f1e[_0x62da('0x3b')][_0x62da('0x7e')]:new Array(_0x440f1e[_0x62da('0x3b')][_0x62da('0x7e')]);_0x294bfc[_0x62da('0x33')](function(_0x238bc8){_0x2e7f05['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x238bc8+',%');});}if(_0x440f1e[_0x62da('0x3b')][_0x62da('0x80')]){var _0x48f059=_0x440f1e['query'][_0x62da('0x80')][_0x62da('0x81')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x62da('0x82'));if(qs[_0x62da('0x83')](_0x48f059)){_0x1f2ab5['or'](_0x62da('0x84'),_0x48f059+'%')['or'](_0x62da('0x85'),_0x48f059+'%');}else{_0x1f2ab5['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x62da('0x67')](_0x48f059))['or'](_0x62da('0x86'),_0x48f059+'%');}}}_0x55a8ef[_0x62da('0x45')](_0x1f2ab5);_0x55a8ef[_0x62da('0x87')](_0x62da('0x88'));var _0x12e56a={'type':db[_0x62da('0x89')][_0x62da('0x8a')][_0x62da('0x8b')],'raw':!![]};var _0x177861=_0x55a8ef[_0x62da('0x8c')]();_0x177861[_0x62da('0x47')](_0x62da('0x88'));_0x177861[_0x62da('0x47')](_0x62da('0x8d'),_0x62da('0x60'));if(_0x11bf73[_0x62da('0x43')]){_0x11bf73[_0x62da('0x43')]['forEach'](function(_0x5a4497){_0x55a8ef[_0x62da('0x43')]('i.'+_0x5a4497[0x0],_0x5a4497[0x1]===_0x62da('0x8e')?![]:!![]);});}if(!_[_0x62da('0x8f')](_0x294bfc)){_0x55a8ef[_0x62da('0x62')](_0x2e7f05);_0x177861['where']('t.id\x20IN\x20?',_0x294bfc);}BPromise[_0x62da('0x90')]()[_0x62da('0x2b')](function(){if(!_0x3571b2){if(_0x440f1e[_0x62da('0x3b')][_0x62da('0x91')]||_0x440f1e[_0x62da('0x3b')][_0x62da('0x92')])return;_0x177861[_0x62da('0x45')](_0x62da('0x93'));_0x55a8ef[_0x62da('0x45')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}return _0x440f1e[_0x62da('0x94')][_0x62da('0x95')]({'attributes':['id'],'raw':!![]})[_0x62da('0x2b')](function(_0x265c56){if(_[_0x62da('0x8f')](_0x265c56)){_0x177861['where'](_0x62da('0x96'));_0x55a8ef['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x177861['where'](_0x62da('0x97'),_[_0x62da('0x2e')](_0x265c56,'id'));_0x55a8ef['where'](_0x62da('0x97'),_[_0x62da('0x2e')](_0x265c56,'id'));}});})['then'](function(){db['sequelize']['query'](_0x177861[_0x62da('0x98')](),_0x12e56a)[_0x62da('0x2b')](function(_0x4653c3){_0x557b6a[_0x62da('0x24')]=_0x4653c3[_0x62da('0x3f')];if(_0x557b6a['count']===0x0)return[];return db['sequelize']['query'](_0x86f5a8[_0x62da('0x98')](),_0x12e56a)[_0x62da('0x2b')](function(_0x2171d8){_0x54b49c=_[_0x62da('0x99')](_0x2171d8,'id');_0x12e56a=_[_0x62da('0x9a')](_0x12e56a,{'model':db[_0x62da('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x440f1e[_0x62da('0x3b')][_0x62da('0x3d')]){_0x11bf73[_0x62da('0x3e')]['forEach'](function(_0x46be25){_0x55a8ef['field']('i.'+_0x46be25);});}else{_0x55a8ef[_0x62da('0x47')](_0x62da('0x8d'),_0x62da('0x60'));_0x55a8ef[_0x62da('0x47')](_0x62da('0x9b'),_0x62da('0x9c'));_0x55a8ef[_0x62da('0x47')](_0x62da('0x9d'),'Account.mandatoryDisposition');_0x55a8ef[_0x62da('0x47')](_0x62da('0x9e'));_0x55a8ef['field']('c.firstName',_0x62da('0x9f'));_0x55a8ef[_0x62da('0x47')](_0x62da('0xa0'),'Contact.lastName');_0x55a8ef[_0x62da('0x47')](_0x62da('0xa1'),_0x62da('0xa2'));_0x55a8ef[_0x62da('0x47')](_0x62da('0xa3'),_0x62da('0xa4'));_0x55a8ef['field'](_0x62da('0xa5'),_0x62da('0xa6'));_0x55a8ef[_0x62da('0x47')](_0x62da('0xa7'),_0x62da('0xa8'));_0x55a8ef[_0x62da('0x47')](_0x62da('0xa9'),_0x62da('0xaa'));_0x55a8ef['field'](_0x62da('0xab'),_0x62da('0xac'));_0x55a8ef[_0x62da('0x47')](_0x62da('0xad'),_0x62da('0x31'));}_0x55a8ef[_0x62da('0x42')](_0x11bf73[_0x62da('0x42')]);_0x55a8ef['offset'](_0x11bf73[_0x62da('0x25')]);return db[_0x62da('0xae')][_0x62da('0x3b')](_0x55a8ef[_0x62da('0x98')](),_0x12e56a);})[_0x62da('0x2b')](function(_0x5dd792){_0x17dc9f[_0x62da('0x45')](_0x62da('0xaf'),_[_0x62da('0x2e')](_0x5dd792,'id'));return db['sequelize']['query'](_0x17dc9f[_0x62da('0x98')](),_0x12e56a)[_0x62da('0x2b')](function(_0x54f1d0){var _0x568fbc=_[_0x62da('0xb0')](_0x54f1d0,_0x62da('0xb1'));var _0x576c99=[];_0x5dd792[_0x62da('0x33')](function(_0x2c6a5d){_0x576c99[_0x62da('0xb2')](updateSmsInteraction(_0x2c6a5d,_0x54b49c,_0x568fbc));});return BPromise[_0x62da('0xb3')](_0x576c99);});});})['then'](function(_0xe77a9e){_0x557b6a[_0x62da('0xb4')]=_0xe77a9e;return _0x557b6a;})[_0x62da('0x2b')](respondWithFilteredResult(_0x210e15,_0x11bf73));})[_0x62da('0x34')](handleError(_0x210e15,null));};exports[_0x62da('0xb5')]=function(_0x1938a5,_0xeb81f4){var _0x10e0a3={'raw':![],'where':{'id':_0x1938a5['params']['id']}},_0x14c03f={};_0x14c03f['model']=_[_0x62da('0x72')](db[_0x62da('0x35')]['rawAttributes']);_0x14c03f[_0x62da('0x3b')]=_[_0x62da('0x72')](_0x1938a5[_0x62da('0x3b')]);_0x14c03f[_0x62da('0x46')]=_['intersection'](_0x14c03f[_0x62da('0x3a')],_0x14c03f[_0x62da('0x3b')]);_0x10e0a3[_0x62da('0x3e')]=_['intersection'](_0x14c03f[_0x62da('0x3a')],qs[_0x62da('0x3d')](_0x1938a5['query'][_0x62da('0x3d')]));_0x10e0a3[_0x62da('0x3e')]=_0x10e0a3[_0x62da('0x3e')][_0x62da('0x3f')]?_0x10e0a3['attributes']:_0x14c03f['model'];if(_0x1938a5['query']['includeAll']){_0x10e0a3['include']=[{'all':!![]}];}_0x10e0a3=_['merge']({},_0x10e0a3,_0x1938a5[_0x62da('0xb6')]);return db[_0x62da('0x35')][_0x62da('0x5f')](_0x10e0a3)[_0x62da('0x2b')](handleEntityNotFound(_0xeb81f4,null))[_0x62da('0x2b')](respondWithResult(_0xeb81f4,null))[_0x62da('0x34')](handleError(_0xeb81f4,null));};exports[_0x62da('0xb7')]=function(_0x31666c,_0x433519){return db[_0x62da('0x35')][_0x62da('0xb7')](_0x31666c[_0x62da('0x71')],{})[_0x62da('0x2b')](respondWithResult(_0x433519,0xc9))['catch'](handleError(_0x433519,null));};exports[_0x62da('0x2a')]=function(_0x510407,_0x51c3fc){if(_0x510407[_0x62da('0x71')]['id']){delete _0x510407['body']['id'];}return db[_0x62da('0x35')][_0x62da('0x5f')]({'where':{'id':_0x510407['params']['id']}})[_0x62da('0x2b')](handleEntityNotFound(_0x51c3fc,null))['then'](saveUpdates(_0x510407[_0x62da('0x71')],null))[_0x62da('0x2b')](respondWithResult(_0x51c3fc,null))[_0x62da('0x34')](handleError(_0x51c3fc,null));};exports[_0x62da('0xb8')]=function(_0x118470,_0x5e32e5){return db[_0x62da('0x35')][_0x62da('0x5f')]({'where':{'id':_0x118470['params']['id']}})[_0x62da('0x2b')](handleEntityNotFound(_0x5e32e5,null))[_0x62da('0x2b')](removeEntity(_0x5e32e5,null))['catch'](handleError(_0x5e32e5,null));};exports['describe']=function(_0x5eaba2,_0x482567){return db[_0x62da('0x35')][_0x62da('0xb9')]()['then'](respondWithResult(_0x482567,null))[_0x62da('0x34')](handleError(_0x482567,null));};exports[_0x62da('0xba')]=function(_0x4be148,_0x3dd386,_0x3541bf){return db['SmsMessage'][_0x62da('0x5f')]({'where':{'id':_0x4be148[_0x62da('0xbb')]['id']}})['then'](handleEntityNotFound(_0x3dd386,null))[_0x62da('0x2b')](function(_0x539d21){if(_0x539d21){return _0x539d21[_0x62da('0xba')](_0x4be148[_0x62da('0x71')][_0x62da('0xbc')],_[_0x62da('0xbd')](_0x4be148[_0x62da('0x71')],[_0x62da('0xbc'),'id'])||{});}})[_0x62da('0x2b')](respondWithResult(_0x3dd386,null))['catch'](handleError(_0x3dd386,null));};exports[_0x62da('0xbe')]=function(_0x4b40d4,_0x3126e9,_0xf3e7a0){var _0x2b096f={'raw':![],'where':{}};var _0x259f4a={};var _0x572325={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x62da('0xbf')]({'where':{'id':_0x4b40d4['params']['id']}})[_0x62da('0x2b')](handleEntityNotFound(_0x3126e9,null))[_0x62da('0x2b')](function(_0x2bf638){if(_0x2bf638){_0x259f4a['model']=_[_0x62da('0x72')](db[_0x62da('0xc0')][_0x62da('0x36')]);_0x259f4a[_0x62da('0x3b')]=_['keys'](_0x4b40d4[_0x62da('0x3b')]);_0x259f4a['filters']=_['intersection'](_0x259f4a[_0x62da('0x3a')],_0x259f4a['query']);_0x2b096f[_0x62da('0x3e')]=_[_0x62da('0x3c')](_0x259f4a['model'],qs[_0x62da('0x3d')](_0x4b40d4[_0x62da('0x3b')]['fields']));_0x2b096f[_0x62da('0x3e')]=_0x2b096f[_0x62da('0x3e')][_0x62da('0x3f')]?_0x2b096f[_0x62da('0x3e')]:_0x259f4a['model'];if(!_0x4b40d4[_0x62da('0x3b')]['hasOwnProperty'](_0x62da('0x41'))){_0x2b096f[_0x62da('0x42')]=qs[_0x62da('0x42')](_0x4b40d4[_0x62da('0x3b')][_0x62da('0x42')]);_0x2b096f[_0x62da('0x25')]=qs['offset'](_0x4b40d4[_0x62da('0x3b')][_0x62da('0x25')]);}_0x2b096f[_0x62da('0x43')]=qs[_0x62da('0x44')](_0x4b40d4[_0x62da('0x3b')][_0x62da('0x44')]);_0x2b096f[_0x62da('0x45')]=qs[_0x62da('0x46')](_[_0x62da('0xc1')](_0x4b40d4['query'],_0x259f4a['filters']));_0x2b096f[_0x62da('0x45')][_0x62da('0xb1')]=_0x2bf638['id'];if(_0x4b40d4['query'][_0x62da('0x80')]){_0x2b096f['where']=_[_0x62da('0x9a')](_0x2b096f[_0x62da('0x45')],{'$or':_[_0x62da('0x2e')](_0x2b096f[_0x62da('0x3e')],function(_0x5b91a2){var _0x242038={};_0x242038[_0x5b91a2]={'$like':'%'+_0x4b40d4['query'][_0x62da('0x80')]+'%'};return _0x242038;})});}if(_0x4b40d4[_0x62da('0x3b')][_0x62da('0x78')]){var _0x54bd34=_0x4b40d4[_0x62da('0x3b')]['$gte']['split'](',');var _0x2becdb={};_0x2becdb[_0x54bd34[0x0]]={'$gte':moment(_0x54bd34[0x1])[_0x62da('0xc2')](_0x62da('0xc3'))};_0x2b096f['where']=_[_0x62da('0x9a')](_0x2b096f['where'],_0x2becdb);}_0x2b096f=_['merge']({},_0x2b096f,_0x4b40d4['options']);return db[_0x62da('0xc0')][_0x62da('0x24')]({'where':_0x2b096f[_0x62da('0x45')]})[_0x62da('0x2b')](function(_0x78f3e5){_0x572325[_0x62da('0x24')]=_0x78f3e5;if(_0x4b40d4[_0x62da('0x3b')][_0x62da('0xc4')]){_0x2b096f[_0x62da('0xc5')]=[{'all':!![]}];}return db[_0x62da('0xc0')]['findAll'](_0x2b096f);})[_0x62da('0x2b')](function(_0x1bba2f){_0x572325[_0x62da('0xb4')]=_0x1bba2f;return _0x572325;});}})['then'](respondWithFilteredResult(_0x3126e9,_0x2b096f))['catch'](handleError(_0x3126e9,null));};exports[_0x62da('0xc6')]=function(_0x5dbb29,_0x454b5f,_0x3ba024){return db[_0x62da('0x35')]['find']({'where':{'id':_0x5dbb29[_0x62da('0xbb')]['id']}})[_0x62da('0x2b')](handleEntityNotFound(_0x454b5f,null))[_0x62da('0x2b')](function(_0x21fc0b){if(_0x21fc0b){return _0x21fc0b[_0x62da('0xc7')](_0x5dbb29[_0x62da('0x71')]['ids'],_['omit'](_0x5dbb29[_0x62da('0x71')],[_0x62da('0xbc'),'id'])||{})['spread'](function(){return db[_0x62da('0x6d')][_0x62da('0xc8')]({'attributes':['id',_0x62da('0x2d'),_0x62da('0xc9')],'where':{'id':_0x5dbb29['body'][_0x62da('0xbc')]}});})[_0x62da('0x2b')](function(_0xf194a6){socket[_0x62da('0xca')](_0x62da('0xcb'),{'id':Number(_0x5dbb29[_0x62da('0xbb')]['id']),'tags':_0xf194a6||[]});return{'id':Number(_0x5dbb29[_0x62da('0xbb')]['id']),'tags':_0xf194a6||[]};});}})[_0x62da('0x2b')](respondWithResult(_0x454b5f,null))['catch'](handleError(_0x454b5f,null));};exports[_0x62da('0xcc')]=function(_0x22463c,_0x51eafc,_0x2355f5){return db[_0x62da('0x35')][_0x62da('0x5f')]({'where':{'id':_0x22463c[_0x62da('0xbb')]['id']}})[_0x62da('0x2b')](handleEntityNotFound(_0x51eafc,null))[_0x62da('0x2b')](function(_0x264750){if(_0x264750){return _0x264750[_0x62da('0xcc')](_0x22463c[_0x62da('0x3b')][_0x62da('0xbc')]);}})['then'](respondWithStatusCode(_0x51eafc,null))[_0x62da('0x34')](handleError(_0x51eafc,null));};exports[_0x62da('0xcd')]=function(_0x4677ff,_0xe950f){var _0x5afb92=moment()[_0x62da('0xce')]()[_0x62da('0x98')]();var _0x495112=path[_0x62da('0xcf')](config[_0x62da('0xd0')],_0x62da('0xd1'),_0x62da('0xd2'),_0x62da('0xd3'));var _0x3e57fb=path['join'](config[_0x62da('0xd0')],_0x62da('0xd1'),'files',_0x62da('0xd4'));var _0x5977c4=path['join'](_0x495112,_0x5afb92);var _0x3338cc=util[_0x62da('0xc2')](_0x62da('0xd5'),_0x4677ff['params']['id'],_0x5afb92);var _0x5c597d=path[_0x62da('0xcf')](_0x495112,_0x3338cc);var _0x152798=[];_0x152798[_0x62da('0xb2')]({'model':db['User'],'as':'User','attributes':['id',_0x62da('0x2f')],'raw':!![]});_0x152798[_0x62da('0xb2')]({'model':db[_0x62da('0xd6')],'as':_0x62da('0xd7'),'attributes':['id',_0x62da('0xd8'),_0x62da('0xd9')],'raw':!![]});var _0x50270d=[{'model':db[_0x62da('0xc0')],'as':_0x62da('0xda'),'attributes':['id','body',_0x62da('0x76'),_0x62da('0xdb'),_0x62da('0xdc'),_0x62da('0x7c')],'include':_0x152798}];_0x50270d[_0x62da('0xb2')]({'model':db[_0x62da('0xdd')],'as':_0x62da('0xde'),'attributes':['id',_0x62da('0x2d')]});_0x50270d['push']({'model':db[_0x62da('0xdf')],'as':_0x62da('0xe0'),'attributes':['id',_0x62da('0x2f')]});return db['SmsInteraction'][_0x62da('0x5f')]({'where':{'id':_0x4677ff['params']['id']},'include':_0x50270d})[_0x62da('0x2b')](handleEntityNotFound(_0xe950f,null))[_0x62da('0x2b')](function(_0xd7d605){if(_0xd7d605){var _0x3783d9=_0xd7d605[_0x62da('0xe1')]({'plain':!![]});fs[_0x62da('0xe2')](_0x5977c4);var _0x27652={'format':'A4','border':_0x62da('0xe3'),'header':{'height':'40px','contents':{'first':_0x62da('0xe4')}},'footer':{'height':_0x62da('0xe5'),'contents':{'default':util[_0x62da('0xc2')](_0x62da('0xe6'),util[_0x62da('0xc2')](_0x62da('0xe7'),'Sms',_0x3783d9['id']),moment()['format']('YYYY-MM-DD')[_0x62da('0x98')]())}}};var _0x5d5359={'channel':_0x62da('0xe8'),'account':_0x3783d9['Account'][_0x62da('0x2d')],'agent':_0x3783d9[_0x62da('0xe0')]?_0x3783d9['Owner'][_0x62da('0x2f')]:_0x62da('0xe9'),'createdAt':moment(_0x3783d9['createdAt'])[_0x62da('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x62da('0x98')](),'closedAt':_0x3783d9[_0x62da('0xea')]?moment(_0x3783d9[_0x62da('0xeb')])[_0x62da('0xc2')](_0x62da('0xc3'))[_0x62da('0x98')]():'','disposition':_0x3783d9[_0x62da('0xec')],'messages':_(_0x3783d9[_0x62da('0xda')])[_0x62da('0x80')]({'secret':![]})['map'](function(_0x1044c3){return{'date':moment(_0x1044c3[_0x62da('0x76')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x62da('0x98')](),'sender':_0x1044c3['direction']==='out'?_0x1044c3[_0x62da('0xdf')]?_0x1044c3[_0x62da('0xdf')][_0x62da('0x2f')]:'System':_0x1044c3[_0x62da('0xd7')][_0x62da('0xd8')]+(_0x1044c3['Contact'][_0x62da('0xd9')]?'\x20'+_0x1044c3['Contact']['lastName']:''),'body':_0x1044c3[_0x62da('0x71')],'direction':_0x1044c3[_0x62da('0xdb')]===_0x62da('0xed')?'A':'C','secret':_0x1044c3[_0x62da('0xdc')],'read':_0x1044c3[_0x62da('0x7c')]};})[_0x62da('0x61')]()};return ejs[_0x62da('0xee')](path[_0x62da('0xcf')](config[_0x62da('0xd0')],_0x62da('0xd1'),'views','downloadInteraction.html'),{'interaction':_0x5d5359})[_0x62da('0x2b')](function(_0x3bcf4b){return new BPromise(function(_0x3f0e93,_0x30ed2a){pdf[_0x62da('0xb7')](_0x3bcf4b,_0x27652)[_0x62da('0xef')](path[_0x62da('0xcf')](_0x5977c4,_0x62da('0xf0')+_0x3783d9['id']+'-'+_0x5afb92+'.pdf'),function(_0x95a20b,_0x4840cc){if(_0x95a20b)return _0x30ed2a(_0x95a20b);_0x3f0e93(_0x4840cc);});});})['then'](function(){return new BPromise(function(_0x3b4620,_0x4b6aee){zipdir(_0x5977c4,{'saveTo':_0x5c597d},function(_0x355c94,_0x1ca60d){if(_0x355c94)return _0x4b6aee(_0x355c94);return _0x3b4620(_0x1ca60d);});})[_0x62da('0x2b')](function(){return new BPromise(function(_0x47b451,_0x5e5252){rimraf(_0x5977c4,function(_0x1a6637){if(_0x1a6637)_0x5e5252(_0x1a6637);return _0x47b451();});});})[_0x62da('0x2b')](function(){return _0xe950f[_0x62da('0xcd')](_0x5c597d,_0x3338cc,function(_0x3351b4){if(_0x3351b4){console[_0x62da('0xf1')]('err',_0x3351b4);}else{fs[_0x62da('0xf2')](_0x5c597d);}});});});}else{return _0xe950f[_0x62da('0x20')](0xc8);}})[_0x62da('0x34')](handleError(_0xe950f,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index c47d2a9..21445be 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 _0xb205=['events','../../mysqldb','SmsInteraction','SmsMessage','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x52cded,_0x2556c3){var _0x1237ca=function(_0x5816f3){while(--_0x5816f3){_0x52cded['push'](_0x52cded['shift']());}};_0x1237ca(++_0x2556c3);}(_0xb205,0xf0));var _0x5b20=function(_0x28b622,_0x51ba36){_0x28b622=_0x28b622-0x0;var _0x1352ba=_0xb205[_0x28b622];return _0x1352ba;};'use strict';var EventEmitter=require(_0x5b20('0x0'));var SmsInteraction=require(_0x5b20('0x1'))['db'][_0x5b20('0x2')];var SmsMessage=require(_0x5b20('0x1'))['db'][_0x5b20('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5b20('0x4'),'afterDestroy':'remove'};function emitEvent(_0x17046a){return function(_0x36473a,_0x5a4526,_0x3206cd){_0x36473a[_0x5b20('0x5')]({'attributes':['id'],'raw':!![]})[_0x5b20('0x6')](function(_0x5c1ff9){_0x36473a[_0x5b20('0x7')](_0x5b20('0x8'),_0x5c1ff9['map'](function(_0x4f19b2){return{'id':_0x4f19b2['id']};}));return SmsMessage[_0x5b20('0x9')]({'where':{'SmsInteractionId':_0x36473a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5b20('0x6')](function(_0x36ef1b){_0x36473a[_0x5b20('0x7')](_0x5b20('0xa'),_0x36ef1b[_0x5b20('0xb')]);SmsInteractionEvents[_0x5b20('0xc')](_0x17046a+':'+_0x36473a['id'],_0x36473a);SmsInteractionEvents['emit'](_0x17046a,_0x36473a);_0x3206cd(null);})[_0x5b20('0xd')](_0x3206cd(null));};}for(var e in events){if(events[_0x5b20('0xe')](e)){var event=events[e];SmsInteraction[_0x5b20('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xe0c3=['findAll','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x231d4f,_0x5d3b12){var _0xb70bd3=function(_0x33d296){while(--_0x33d296){_0x231d4f['push'](_0x231d4f['shift']());}};_0xb70bd3(++_0x5d3b12);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x3e0c('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x3e0c('0x1')];var SmsMessage=require(_0x3e0c('0x2'))['db'][_0x3e0c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3e0c('0x4')](0x0);var events={'afterCreate':_0x3e0c('0x5'),'afterUpdate':_0x3e0c('0x6'),'afterDestroy':_0x3e0c('0x7')};function emitEvent(_0x26c964){return function(_0x1a026f,_0x511cfa,_0x530ebf){_0x1a026f[_0x3e0c('0x8')]({'attributes':['id'],'raw':!![]})[_0x3e0c('0x9')](function(_0x3f6607){_0x1a026f[_0x3e0c('0xa')](_0x3e0c('0xb'),_0x3f6607[_0x3e0c('0xc')](function(_0x1dbe0f){return{'id':_0x1dbe0f['id']};}));return SmsMessage[_0x3e0c('0xd')]({'where':{'SmsInteractionId':_0x1a026f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3e0c('0x9')](function(_0x35d56f){_0x1a026f[_0x3e0c('0xa')]('unreadMessages',_0x35d56f['length']);SmsInteractionEvents[_0x3e0c('0xe')](_0x26c964+':'+_0x1a026f['id'],_0x1a026f);SmsInteractionEvents[_0x3e0c('0xe')](_0x26c964,_0x1a026f);_0x530ebf(null);})[_0x3e0c('0xf')](_0x530ebf(null));};}for(var e in events){if(events[_0x3e0c('0x10')](e)){var event=events[e];SmsInteraction[_0x3e0c('0x11')](e,emitEvent(event));}}module[_0x3e0c('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 388008b..1aa2c6e 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 _0x4a52=['changed','closed','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions'];(function(_0x25d414,_0x1ce454){var _0x560f0d=function(_0x58564d){while(--_0x58564d){_0x25d414['push'](_0x25d414['shift']());}};_0x560f0d(++_0x1ce454);}(_0x4a52,0x102));var _0x24a5=function(_0x502b0c,_0x402290){_0x502b0c=_0x502b0c-0x0;var _0x54a349=_0x4a52[_0x502b0c];return _0x54a349;};'use strict';var _=require('lodash');var util=require(_0x24a5('0x0'));var logger=require(_0x24a5('0x1'))(_0x24a5('0x2'));var moment=require(_0x24a5('0x3'));var BPromise=require(_0x24a5('0x4'));var rp=require(_0x24a5('0x5'));var fs=require('fs');var path=require(_0x24a5('0x6'));var rimraf=require(_0x24a5('0x7'));var config=require(_0x24a5('0x8'));var attributes=require(_0x24a5('0x9'));module[_0x24a5('0xa')]=function(_0x3a1f23,_0x5f151d){return _0x3a1f23[_0x24a5('0xb')](_0x24a5('0xc'),attributes,{'tableName':_0x24a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20c268,_0x44fa84,_0x3af29d){if(_0x20c268[_0x24a5('0xe')](_0x24a5('0xf'))){_0x20c268['closedAt']=moment()['format'](_0x24a5('0x10'));}_0x3af29d(null,_0x20c268);}}});}; \ No newline at end of file +var _0xee15=['../../config/environment','exports','define','SmsInteraction','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','moment','bluebird','rimraf'];(function(_0x1519e4,_0x3f3f74){var _0x3841ad=function(_0x22ede0){while(--_0x22ede0){_0x1519e4['push'](_0x1519e4['shift']());}};_0x3841ad(++_0x3f3f74);}(_0xee15,0x7e));var _0x5ee1=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0xee15[_0x2a558d];return _0xa7bc9c;};'use strict';var _=require('lodash');var util=require(_0x5ee1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5ee1('0x1'));var BPromise=require(_0x5ee1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5ee1('0x3'));var config=require(_0x5ee1('0x4'));var attributes=require('./smsInteraction.attributes');module[_0x5ee1('0x5')]=function(_0x1ffd75,_0x107196){return _0x1ffd75[_0x5ee1('0x6')](_0x5ee1('0x7'),attributes,{'tableName':_0x5ee1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x281c25,_0x1d5339,_0x2e90c0){if(_0x281c25['changed'](_0x5ee1('0x9'))){_0x281c25[_0x5ee1('0xa')]=moment()[_0x5ee1('0xb')](_0x5ee1('0xc'));}_0x2e90c0(null,_0x281c25);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index fb3fb75..25ca1e9 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 _0x3d56=['find','body','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','options','where','attributes','limit','debug','stringify','AddTagsToSmsInteraction'];(function(_0x48f011,_0x4f4a87){var _0x47824e=function(_0x1a6233){while(--_0x1a6233){_0x48f011['push'](_0x48f011['shift']());}};_0x47824e(++_0x4f4a87);}(_0x3d56,0x1f2));var _0x63d5=function(_0x47a11b,_0xb30c27){_0x47a11b=_0x47a11b-0x0;var _0x3cf2d3=_0x3d56[_0x47a11b];return _0x3cf2d3;};'use strict';var _=require(_0x63d5('0x0'));var util=require(_0x63d5('0x1'));var moment=require('moment');var BPromise=require(_0x63d5('0x2'));var rs=require(_0x63d5('0x3'));var fs=require('fs');var Redis=require(_0x63d5('0x4'));var db=require(_0x63d5('0x5'))['db'];var utils=require(_0x63d5('0x6'));var logger=require('../../config/logger')(_0x63d5('0x7'));var config=require(_0x63d5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x63d5('0x9')][_0x63d5('0xa')]({'port':0x232a});config['redis']=_[_0x63d5('0xb')](config[_0x63d5('0xc')],{'host':_0x63d5('0xd'),'port':0x18eb});var socket=require(_0x63d5('0xe'))(new Redis(config['redis']));require(_0x63d5('0xf'))['register'](socket);function respondWithRpcPromise(_0x12bc75,_0x282689,_0x5aeacf){return new BPromise(function(_0x67225,_0x235dc3){return client[_0x63d5('0x10')](_0x12bc75,_0x5aeacf)[_0x63d5('0x11')](function(_0x380b8a){logger[_0x63d5('0x12')](_0x63d5('0x13'),_0x282689,_0x63d5('0x14'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x282689,_0x63d5('0x14'),JSON['stringify'](_0x380b8a));if(_0x380b8a['error']){if(_0x380b8a[_0x63d5('0x15')]['code']===0x1f4){logger[_0x63d5('0x15')](_0x63d5('0x13'),_0x282689,_0x380b8a['error']['message']);return _0x235dc3(_0x380b8a[_0x63d5('0x15')][_0x63d5('0x16')]);}logger[_0x63d5('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x282689,_0x380b8a[_0x63d5('0x15')][_0x63d5('0x16')]);return _0x67225(_0x380b8a[_0x63d5('0x15')][_0x63d5('0x16')]);}else{logger[_0x63d5('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x282689,_0x63d5('0x14'));_0x67225(_0x380b8a[_0x63d5('0x17')][_0x63d5('0x16')]);}})[_0x63d5('0x18')](function(_0x33332e){logger[_0x63d5('0x15')](_0x63d5('0x13'),_0x282689,_0x33332e);_0x235dc3(_0x33332e);});});}exports[_0x63d5('0x19')]=function(_0x3d7886){var _0x1ddbbd=this;return new Promise(function(_0x5edb73,_0x11267e){return db[_0x63d5('0x1a')]['update'](_0x3d7886['body'],{'raw':_0x3d7886[_0x63d5('0x1b')]?_0x3d7886[_0x63d5('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d7886[_0x63d5('0x1b')]?_0x3d7886['options'][_0x63d5('0x1c')]||null:null,'attributes':_0x3d7886[_0x63d5('0x1b')]?_0x3d7886[_0x63d5('0x1b')][_0x63d5('0x1d')]||null:null,'limit':_0x3d7886[_0x63d5('0x1b')]?_0x3d7886[_0x63d5('0x1b')][_0x63d5('0x1e')]||null:null})[_0x63d5('0x11')](function(_0x43c666){logger[_0x63d5('0x12')](_0x63d5('0x19'),_0x3d7886);logger[_0x63d5('0x1f')]('UpdateSmsInteraction',_0x3d7886,JSON[_0x63d5('0x20')](_0x43c666));_0x5edb73(_0x43c666);})[_0x63d5('0x18')](function(_0x27e554){logger[_0x63d5('0x15')](_0x63d5('0x19'),_0x27e554[_0x63d5('0x16')],_0x3d7886);_0x11267e(_0x1ddbbd[_0x63d5('0x15')](0x1f4,_0x27e554[_0x63d5('0x16')]));});});};exports[_0x63d5('0x21')]=function(_0x5990d2){return new Promise(function(_0x1e03ac,_0x5c39d4){return db['SmsInteraction'][_0x63d5('0x22')]({'where':_0x5990d2['options']?_0x5990d2['options']['where']||null:null})[_0x63d5('0x11')](function(_0x2e3852){if(_0x2e3852){return _0x2e3852['addTags'](_0x5990d2[_0x63d5('0x23')][_0x63d5('0x24')],_['omit'](_0x5990d2[_0x63d5('0x23')],[_0x63d5('0x24'),'id'])||{});}})['spread'](function(_0x10a060){logger[_0x63d5('0x12')](_0x63d5('0x25'),_0x5990d2);logger[_0x63d5('0x1f')](_0x63d5('0x25'),_0x5990d2,JSON[_0x63d5('0x20')](_0x10a060));_0x1e03ac(_0x10a060);})['catch'](function(_0x13dd9f){logger[_0x63d5('0x15')](_0x63d5('0x25'),_0x13dd9f[_0x63d5('0x16')],_0x5990d2);_0x5c39d4(_this[_0x63d5('0x15')](0x1f4,_0x13dd9f[_0x63d5('0x16')]));});});}; \ No newline at end of file +var _0xeaac=['lodash','moment','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','body','options','raw','where','attributes','limit','debug','AddTagsToSmsInteraction','find','ids','omit','AddTags'];(function(_0x4e3ae7,_0x39573b){var _0x1b6191=function(_0x2bc279){while(--_0x2bc279){_0x4e3ae7['push'](_0x4e3ae7['shift']());}};_0x1b6191(++_0x39573b);}(_0xeaac,0xf5));var _0xceaa=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xeaac[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xceaa('0x0'));var util=require('util');var moment=require(_0xceaa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xceaa('0x2'));var db=require(_0xceaa('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xceaa('0x4'));var jayson=require(_0xceaa('0x5'));var client=jayson['client'][_0xceaa('0x6')]({'port':0x232a});config[_0xceaa('0x7')]=_[_0xceaa('0x8')](config['redis'],{'host':_0xceaa('0x9'),'port':0x18eb});var socket=require(_0xceaa('0xa'))(new Redis(config[_0xceaa('0x7')]));require('./smsInteraction.socket')[_0xceaa('0xb')](socket);function respondWithRpcPromise(_0x213f92,_0x201074,_0x486324){return new BPromise(function(_0x5c1abe,_0x57812b){return client['request'](_0x213f92,_0x486324)[_0xceaa('0xc')](function(_0x566904){logger['info'](_0xceaa('0xd'),_0x201074,_0xceaa('0xe'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x201074,_0xceaa('0xe'),JSON[_0xceaa('0xf')](_0x566904));if(_0x566904['error']){if(_0x566904[_0xceaa('0x10')][_0xceaa('0x11')]===0x1f4){logger[_0xceaa('0x10')](_0xceaa('0xd'),_0x201074,_0x566904[_0xceaa('0x10')][_0xceaa('0x12')]);return _0x57812b(_0x566904[_0xceaa('0x10')][_0xceaa('0x12')]);}logger[_0xceaa('0x10')](_0xceaa('0xd'),_0x201074,_0x566904[_0xceaa('0x10')][_0xceaa('0x12')]);return _0x5c1abe(_0x566904[_0xceaa('0x10')][_0xceaa('0x12')]);}else{logger[_0xceaa('0x13')](_0xceaa('0xd'),_0x201074,'request\x20sent');_0x5c1abe(_0x566904[_0xceaa('0x14')][_0xceaa('0x12')]);}})[_0xceaa('0x15')](function(_0x31f71e){logger['error'](_0xceaa('0xd'),_0x201074,_0x31f71e);_0x57812b(_0x31f71e);});});}exports[_0xceaa('0x16')]=function(_0x13b335){var _0x518976=this;return new Promise(function(_0x4eb2b5,_0x1221c4){return db['SmsInteraction']['update'](_0x13b335[_0xceaa('0x17')],{'raw':_0x13b335[_0xceaa('0x18')]?_0x13b335[_0xceaa('0x18')][_0xceaa('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13b335[_0xceaa('0x18')]?_0x13b335[_0xceaa('0x18')][_0xceaa('0x1a')]||null:null,'attributes':_0x13b335[_0xceaa('0x18')]?_0x13b335[_0xceaa('0x18')][_0xceaa('0x1b')]||null:null,'limit':_0x13b335[_0xceaa('0x18')]?_0x13b335[_0xceaa('0x18')][_0xceaa('0x1c')]||null:null})['then'](function(_0xa1d2d7){logger['info'](_0xceaa('0x16'),_0x13b335);logger[_0xceaa('0x1d')](_0xceaa('0x16'),_0x13b335,JSON['stringify'](_0xa1d2d7));_0x4eb2b5(_0xa1d2d7);})['catch'](function(_0x200b7d){logger[_0xceaa('0x10')](_0xceaa('0x16'),_0x200b7d[_0xceaa('0x12')],_0x13b335);_0x1221c4(_0x518976[_0xceaa('0x10')](0x1f4,_0x200b7d['message']));});});};exports[_0xceaa('0x1e')]=function(_0x32aefd){return new Promise(function(_0x596a09,_0x1a9857){return db['SmsInteraction'][_0xceaa('0x1f')]({'where':_0x32aefd[_0xceaa('0x18')]?_0x32aefd[_0xceaa('0x18')][_0xceaa('0x1a')]||null:null})['then'](function(_0x537106){if(_0x537106){return _0x537106['addTags'](_0x32aefd[_0xceaa('0x17')][_0xceaa('0x20')],_[_0xceaa('0x21')](_0x32aefd[_0xceaa('0x17')],['ids','id'])||{});}})['spread'](function(_0x5748c7){logger[_0xceaa('0x13')](_0xceaa('0x22'),_0x32aefd);logger[_0xceaa('0x1d')]('AddTags',_0x32aefd,JSON['stringify'](_0x5748c7));_0x596a09(_0x5748c7);})['catch'](function(_0x14af35){logger['error'](_0xceaa('0x22'),_0x14af35[_0xceaa('0x12')],_0x32aefd);_0x1a9857(_this['error'](0x1f4,_0x14af35[_0xceaa('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 107ea90..b143808 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 _0xd8b0=['save','emit','./smsInteraction.events'];(function(_0x30c7a2,_0x36dc0b){var _0x3f3d55=function(_0x203abb){while(--_0x203abb){_0x30c7a2['push'](_0x30c7a2['shift']());}};_0x3f3d55(++_0x36dc0b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var SmsInteractionEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){SmsInteractionEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('smsInteraction:'+_0x413284,_0x3f8b6f);SmsInteractionEvents['on'](_0x413284,_0x284169);}}; \ No newline at end of file +var _0xbaf0=['removeListener','register','length','smsInteraction:','save','remove','update'];(function(_0x5cfc45,_0x46b765){var _0x45321d=function(_0x2a229d){while(--_0x2a229d){_0x5cfc45['push'](_0x5cfc45['shift']());}};_0x45321d(++_0x46b765);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0baf('0x0'),_0x0baf('0x1'),_0x0baf('0x2')];function createListener(_0x263f79,_0x1688bc){return function(_0x4d2e72){_0x1688bc['emit'](_0x263f79,_0x4d2e72);};}function removeListener(_0x232cc7,_0x1c383e){return function(){SmsInteractionEvents[_0x0baf('0x3')](_0x232cc7,_0x1c383e);};}exports[_0x0baf('0x4')]=function(_0xe4c3c4){for(var _0x335e24=0x0,_0x1a10b1=events[_0x0baf('0x5')];_0x335e24<_0x1a10b1;_0x335e24++){var _0x1d0a0d=events[_0x335e24];var _0x5f5030=createListener(_0x0baf('0x6')+_0x1d0a0d,_0xe4c3c4);SmsInteractionEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index fd7c3b7..3818205 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 _0xed21=['smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','tracked'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xed21,0x173));var _0x1ed2=function(_0x31b56d,_0x1dfde7){_0x31b56d=_0x31b56d-0x0;var _0x301b82=_0xed21[_0x31b56d];return _0x301b82;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1ed2('0x0'));var timeout=require(_0x1ed2('0x1'));var express=require('express');var router=express[_0x1ed2('0x2')]();var auth=require(_0x1ed2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1ed2('0x4'));var controller=require('./smsMessage.controller');router[_0x1ed2('0x5')]('/',auth[_0x1ed2('0x6')](),controller[_0x1ed2('0x7')]);router['get'](_0x1ed2('0x8'),auth[_0x1ed2('0x6')](),controller['describe']);router[_0x1ed2('0x5')](_0x1ed2('0x9'),auth[_0x1ed2('0x6')](),controller[_0x1ed2('0xa')]);router[_0x1ed2('0xb')]('/',auth[_0x1ed2('0x6')](),interaction[_0x1ed2('0xc')]('sms',_0x1ed2('0xd')),controller[_0x1ed2('0xe')]);router[_0x1ed2('0xb')](_0x1ed2('0xf'),controller[_0x1ed2('0x10')]);router[_0x1ed2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1ed2('0x12')]);router[_0x1ed2('0x11')](_0x1ed2('0x13'),auth[_0x1ed2('0x6')](),controller[_0x1ed2('0x14')]);router[_0x1ed2('0x11')]('/:id/reject',auth[_0x1ed2('0x6')](),controller['reject']);router[_0x1ed2('0x15')](_0x1ed2('0x9'),auth[_0x1ed2('0x6')](),controller[_0x1ed2('0x16')]);module[_0x1ed2('0x17')]=router; \ No newline at end of file +var _0x1f44=['put','/:id/accept','accept','reject','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','show','post','isAuthenticated','sms','smsmessage:create','create','/:id/status','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f44,0x155));var _0x41f4=function(_0xdc0730,_0xf5989b){_0xdc0730=_0xdc0730-0x0;var _0x1cbf28=_0x1f44[_0xdc0730];return _0x1cbf28;};'use strict';var multer=require('multer');var util=require(_0x41f4('0x0'));var path=require(_0x41f4('0x1'));var timeout=require(_0x41f4('0x2'));var express=require(_0x41f4('0x3'));var router=express[_0x41f4('0x4')]();var auth=require(_0x41f4('0x5'));var interaction=require(_0x41f4('0x6'));var config=require(_0x41f4('0x7'));var controller=require('./smsMessage.controller');router[_0x41f4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x41f4('0x8')](_0x41f4('0x9'),auth['isAuthenticated'](),controller[_0x41f4('0xa')]);router[_0x41f4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x41f4('0xb')]);router[_0x41f4('0xc')]('/',auth[_0x41f4('0xd')](),interaction['tracked'](_0x41f4('0xe'),_0x41f4('0xf')),controller[_0x41f4('0x10')]);router['post'](_0x41f4('0x11'),controller[_0x41f4('0x12')]);router[_0x41f4('0x13')]('/:id',auth[_0x41f4('0xd')](),controller['update']);router[_0x41f4('0x13')](_0x41f4('0x14'),auth[_0x41f4('0xd')](),controller[_0x41f4('0x15')]);router[_0x41f4('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0x41f4('0x16')]);router['delete']('/:id',auth[_0x41f4('0xd')](),controller[_0x41f4('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 26da484..d3257cd 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 _0x1c4f=['ENUM','out','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x2603c,_0x17bf7f){var _0x1d7d75=function(_0x43aa6d){while(--_0x43aa6d){_0x2603c['push'](_0x2603c['shift']());}};_0x1d7d75(++_0x17bf7f);}(_0x1c4f,0x1f4));var _0xf1c4=function(_0x2dd639,_0x1ad059){_0x2dd639=_0x2dd639-0x0;var _0x1692fa=_0x1c4f[_0x2dd639];return _0x1692fa;};'use strict';var Sequelize=require(_0xf1c4('0x0'));module[_0xf1c4('0x1')]={'body':{'type':Sequelize[_0xf1c4('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf1c4('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf1c4('0x4')]('in','out'),'defaultValue':_0xf1c4('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf1c4('0x6')](0xbe)},'phone':{'type':Sequelize[_0xf1c4('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xf1c4('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6b20=['BOOLEAN','sequelize','exports','medium','ENUM','out','STRING','DATE'];(function(_0x3d0016,_0x4a37e0){var _0x1dcb28=function(_0x57bef9){while(--_0x57bef9){_0x3d0016['push'](_0x3d0016['shift']());}};_0x1dcb28(++_0x4a37e0);}(_0x6b20,0xd1));var _0x06b2=function(_0x1d0087,_0x15a74e){_0x1d0087=_0x1d0087-0x0;var _0x1cf429=_0x6b20[_0x1d0087];return _0x1cf429;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'body':{'type':Sequelize['TEXT'](_0x06b2('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x06b2('0x3')]('in',_0x06b2('0x4')),'defaultValue':_0x06b2('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x06b2('0x5')]},'readAt':{'type':Sequelize[_0x06b2('0x6')]},'secret':{'type':Sequelize[_0x06b2('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 28b0908..6c65acf 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 _0x0d49=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','destroy','stack','name','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','SmsMessage','includeAll','include','findAll','rows','params','rawAttributes','length','merge','find','create','body','update','describe','accept','sms','readAt','format','UserId','user','CmContact','get','SmsInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','agent','RejectMessage','rejectMessage','SmsAccount','received\x20delivery\x20report\x20from','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','plivo','MessageUUID','delivered','Status','plivio','infobip','groupName','DELIVERED','eml-format','zip-dir'];(function(_0x378909,_0x574825){var _0x1344c9=function(_0x156b11){while(--_0x156b11){_0x378909['push'](_0x378909['shift']());}};_0x1344c9(++_0x574825);}(_0x0d49,0x19c));var _0x90d4=function(_0x1943a8,_0x1d16c0){_0x1943a8=_0x1943a8-0x0;var _0x3d9419=_0x0d49[_0x1943a8];return _0x3d9419;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x90d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90d4('0x1'));var jsonpatch=require(_0x90d4('0x2'));var rp=require(_0x90d4('0x3'));var moment=require(_0x90d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x90d4('0x5'));var util=require(_0x90d4('0x6'));var path=require(_0x90d4('0x7'));var sox=require(_0x90d4('0x8'));var csv=require(_0x90d4('0x9'));var ejs=require(_0x90d4('0xa'));var fs=require('fs');var _=require(_0x90d4('0xb'));var squel=require(_0x90d4('0xc'));var crypto=require(_0x90d4('0xd'));var jsforce=require(_0x90d4('0xe'));var deskjs=require(_0x90d4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x90d4('0x10'));var Papa=require(_0x90d4('0x11'));var Redis=require('ioredis');var authService=require(_0x90d4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x90d4('0x13'));var hardwareService=require(_0x90d4('0x14'));var logger=require(_0x90d4('0x15'))(_0x90d4('0x16'));var utils=require(_0x90d4('0x17'));var config=require(_0x90d4('0x18'));var db=require(_0x90d4('0x19'))['db'];config[_0x90d4('0x1a')]=_[_0x90d4('0x1b')](config[_0x90d4('0x1a')],{'host':_0x90d4('0x1c'),'port':0x18eb});var socket=require(_0x90d4('0x1d'))(new Redis(config[_0x90d4('0x1a')]));require(_0x90d4('0x1e'))[_0x90d4('0x1f')](socket);var jayson=require(_0x90d4('0x20'));var client=jayson[_0x90d4('0x21')][_0x90d4('0x22')]({'port':0x232c});var client9002=jayson[_0x90d4('0x21')][_0x90d4('0x22')]({'port':0x232a});function checkPasswordPattern(_0xb44d66,_0xab7598,_0x47f53e){if(_0x47f53e){var _0x122603=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x122603['test'](_0xab7598)){return _0xb44d66;}else{throw new db['Sequelize'][(_0x90d4('0x23'))](_0x90d4('0x24'));}}else{return _0xb44d66;}}function respondWithRpcPromise(_0x17d214,_0x39ddcc,_0x327bbc,_0x2d88a1){return new BPromise(function(_0x3be119,_0x2e8141){var _0x5c7234=_0x2d88a1||client;return _0x5c7234[_0x90d4('0x25')](_0x17d214,_0x327bbc)[_0x90d4('0x26')](function(_0x212ceb){logger[_0x90d4('0x27')](_0x90d4('0x28'),_0x39ddcc,'request\x20sent');logger[_0x90d4('0x29')](_0x90d4('0x2a'),_0x39ddcc,_0x90d4('0x2b'),JSON[_0x90d4('0x2c')](_0x212ceb));if(_0x212ceb[_0x90d4('0x2d')]){if(_0x212ceb[_0x90d4('0x2d')]['code']===0x1f4){logger[_0x90d4('0x2d')](_0x90d4('0x28'),_0x39ddcc,_0x212ceb[_0x90d4('0x2d')][_0x90d4('0x2e')]);return _0x2e8141(_0x212ceb['error'][_0x90d4('0x2e')]);}logger[_0x90d4('0x2d')](_0x90d4('0x28'),_0x39ddcc,_0x212ceb[_0x90d4('0x2d')][_0x90d4('0x2e')]);return _0x3be119(_0x212ceb['error'][_0x90d4('0x2e')]);}else{logger['info'](_0x90d4('0x28'),_0x39ddcc,'request\x20sent');_0x3be119(_0x212ceb[_0x90d4('0x2f')][_0x90d4('0x2e')]);}})[_0x90d4('0x30')](function(_0x215e0f){logger[_0x90d4('0x2d')]('SmsMessage,\x20%s,\x20%s',_0x39ddcc,_0x215e0f);_0x2e8141(_0x215e0f);});});}function respondWithStatusCode(_0x48b4c7,_0x5f5802){_0x5f5802=_0x5f5802||0xcc;return function(_0x3ae887){if(_0x3ae887){return _0x48b4c7[_0x90d4('0x31')](_0x5f5802);}return _0x48b4c7[_0x90d4('0x32')](_0x5f5802)[_0x90d4('0x33')]();};}function respondWithResult(_0x5b80d8,_0x271a92){_0x271a92=_0x271a92||0xc8;return function(_0x4daabe){if(_0x4daabe){return _0x5b80d8[_0x90d4('0x32')](_0x271a92)[_0x90d4('0x34')](_0x4daabe);}};}function respondWithFilteredResult(_0x30e9f0,_0x5667f4){return function(_0x452db8){if(_0x452db8){var _0x354f55=_0x452db8[_0x90d4('0x35')],_0x460186=_0x5667f4['offset'],_0x3f2c99=_0x5667f4[_0x90d4('0x36')]+_0x5667f4[_0x90d4('0x37')],_0x1b75f2;if(_0x3f2c99>=_0x354f55){_0x3f2c99=_0x354f55;_0x1b75f2=0xc8;}else{_0x1b75f2=0xce;}_0x30e9f0[_0x90d4('0x32')](_0x1b75f2);return _0x30e9f0[_0x90d4('0x38')](_0x90d4('0x39'),_0x460186+'-'+_0x3f2c99+'/'+_0x354f55)['json'](_0x452db8);}return null;};}function patchUpdates(_0x52beb3){return function(_0x2bef6d){try{jsonpatch['apply'](_0x2bef6d,_0x52beb3,!![]);}catch(_0x2e1830){return BPromise['reject'](_0x2e1830);}return _0x2bef6d[_0x90d4('0x3a')]();};}function saveUpdates(_0x4f9949,_0x286465){return function(_0x23b02f){if(_0x23b02f){return _0x23b02f['update'](_0x4f9949)[_0x90d4('0x26')](function(_0x5dbe80){return _0x5dbe80;});}return null;};}function removeEntity(_0x130abe,_0x8071d1){return function(_0x10fbaf){if(_0x10fbaf){return _0x10fbaf[_0x90d4('0x3b')]()[_0x90d4('0x26')](function(){_0x130abe[_0x90d4('0x32')](0xcc)[_0x90d4('0x33')]();});}};}function handleEntityNotFound(_0x3b004b,_0x54e204){return function(_0x5c8451){if(!_0x5c8451){_0x3b004b['sendStatus'](0x194);}return _0x5c8451;};}function handleError(_0x144398,_0x67bccc){_0x67bccc=_0x67bccc||0x1f4;return function(_0x31aee8){logger[_0x90d4('0x2d')](_0x31aee8[_0x90d4('0x3c')]);if(_0x31aee8[_0x90d4('0x3d')]){delete _0x31aee8[_0x90d4('0x3d')];}_0x144398[_0x90d4('0x32')](_0x67bccc)['send'](_0x31aee8);};}exports['index']=function(_0xc1b6ed,_0x1bb4e7){var _0x195526={},_0x249d27={},_0xac53b3={'count':0x0,'rows':[]};var _0x2863de=_['map'](db['SmsMessage']['rawAttributes'],function(_0x3b6c2d){return{'name':_0x3b6c2d[_0x90d4('0x3e')],'type':_0x3b6c2d[_0x90d4('0x3f')][_0x90d4('0x40')]};});_0x249d27[_0x90d4('0x41')]=_['map'](_0x2863de,_0x90d4('0x3d'));_0x249d27[_0x90d4('0x42')]=_[_0x90d4('0x43')](_0xc1b6ed[_0x90d4('0x42')]);_0x249d27[_0x90d4('0x44')]=_[_0x90d4('0x45')](_0x249d27[_0x90d4('0x41')],_0x249d27['query']);_0x195526[_0x90d4('0x46')]=_[_0x90d4('0x45')](_0x249d27[_0x90d4('0x41')],qs[_0x90d4('0x47')](_0xc1b6ed[_0x90d4('0x42')]['fields']));_0x195526[_0x90d4('0x46')]=_0x195526[_0x90d4('0x46')]['length']?_0x195526[_0x90d4('0x46')]:_0x249d27['model'];if(!_0xc1b6ed[_0x90d4('0x42')][_0x90d4('0x48')](_0x90d4('0x49'))){_0x195526[_0x90d4('0x37')]=qs[_0x90d4('0x37')](_0xc1b6ed['query'][_0x90d4('0x37')]);_0x195526[_0x90d4('0x36')]=qs[_0x90d4('0x36')](_0xc1b6ed[_0x90d4('0x42')]['offset']);}_0x195526[_0x90d4('0x4a')]=qs[_0x90d4('0x4b')](_0xc1b6ed[_0x90d4('0x42')][_0x90d4('0x4b')]);_0x195526[_0x90d4('0x4c')]=qs[_0x90d4('0x44')](_[_0x90d4('0x4d')](_0xc1b6ed[_0x90d4('0x42')],_0x249d27[_0x90d4('0x44')]));if(_0xc1b6ed[_0x90d4('0x42')][_0x90d4('0x4e')]){_0x195526[_0x90d4('0x4c')]=_['merge'](_0x195526['where'],{'$or':_['map'](_0x2863de,function(_0x141fc0){if(_0x141fc0[_0x90d4('0x3f')]!==_0x90d4('0x4f')){var _0x19fdbd={};_0x19fdbd[_0x141fc0['name']]={'$like':'%'+_0xc1b6ed[_0x90d4('0x42')][_0x90d4('0x4e')]+'%'};return _0x19fdbd;}})});}_0x195526=_['merge']({},_0x195526,_0xc1b6ed[_0x90d4('0x50')]);var _0x5af083={'where':_0x195526[_0x90d4('0x4c')]};return db[_0x90d4('0x51')][_0x90d4('0x35')](_0x5af083)[_0x90d4('0x26')](function(_0x18619e){_0xac53b3[_0x90d4('0x35')]=_0x18619e;if(_0xc1b6ed[_0x90d4('0x42')][_0x90d4('0x52')]){_0x195526[_0x90d4('0x53')]=[{'all':!![]}];}return db[_0x90d4('0x51')][_0x90d4('0x54')](_0x195526);})[_0x90d4('0x26')](function(_0x4d51c3){_0xac53b3[_0x90d4('0x55')]=_0x4d51c3;return _0xac53b3;})[_0x90d4('0x26')](respondWithFilteredResult(_0x1bb4e7,_0x195526))[_0x90d4('0x30')](handleError(_0x1bb4e7,null));};exports['show']=function(_0x45ede8,_0x458e18){var _0x2378f1={'raw':!![],'where':{'id':_0x45ede8[_0x90d4('0x56')]['id']}},_0x5dbc5e={};_0x5dbc5e[_0x90d4('0x41')]=_['keys'](db['SmsMessage'][_0x90d4('0x57')]);_0x5dbc5e[_0x90d4('0x42')]=_[_0x90d4('0x43')](_0x45ede8[_0x90d4('0x42')]);_0x5dbc5e['filters']=_[_0x90d4('0x45')](_0x5dbc5e['model'],_0x5dbc5e[_0x90d4('0x42')]);_0x2378f1['attributes']=_['intersection'](_0x5dbc5e[_0x90d4('0x41')],qs[_0x90d4('0x47')](_0x45ede8[_0x90d4('0x42')]['fields']));_0x2378f1[_0x90d4('0x46')]=_0x2378f1[_0x90d4('0x46')][_0x90d4('0x58')]?_0x2378f1['attributes']:_0x5dbc5e[_0x90d4('0x41')];if(_0x45ede8['query'][_0x90d4('0x52')]){_0x2378f1['include']=[{'all':!![]}];}_0x2378f1=_[_0x90d4('0x59')]({},_0x2378f1,_0x45ede8[_0x90d4('0x50')]);return db[_0x90d4('0x51')][_0x90d4('0x5a')](_0x2378f1)[_0x90d4('0x26')](handleEntityNotFound(_0x458e18,null))['then'](respondWithResult(_0x458e18,null))[_0x90d4('0x30')](handleError(_0x458e18,null));};exports[_0x90d4('0x5b')]=function(_0x51fbd1,_0x46ca31){return db['SmsMessage']['create'](_0x51fbd1[_0x90d4('0x5c')],{})['then'](respondWithResult(_0x46ca31,0xc9))['catch'](handleError(_0x46ca31,null));};exports[_0x90d4('0x5d')]=function(_0x2cd02f,_0x2c20d3){if(_0x2cd02f[_0x90d4('0x5c')]['id']){delete _0x2cd02f[_0x90d4('0x5c')]['id'];}return db['SmsMessage'][_0x90d4('0x5a')]({'where':{'id':_0x2cd02f['params']['id']}})['then'](handleEntityNotFound(_0x2c20d3,null))[_0x90d4('0x26')](saveUpdates(_0x2cd02f[_0x90d4('0x5c')],null))[_0x90d4('0x26')](respondWithResult(_0x2c20d3,null))[_0x90d4('0x30')](handleError(_0x2c20d3,null));};exports[_0x90d4('0x3b')]=function(_0x5b67f9,_0x560bff){return db[_0x90d4('0x51')]['find']({'where':{'id':_0x5b67f9['params']['id']}})[_0x90d4('0x26')](handleEntityNotFound(_0x560bff,null))[_0x90d4('0x26')](removeEntity(_0x560bff,null))[_0x90d4('0x30')](handleError(_0x560bff,null));};exports[_0x90d4('0x5e')]=function(_0x3e7c28,_0x46f1b5){return db[_0x90d4('0x51')][_0x90d4('0x5e')]()['then'](respondWithResult(_0x46f1b5,null))[_0x90d4('0x30')](handleError(_0x46f1b5,null));};var interaction_log=require(_0x90d4('0x15'))('sms-interactions');exports[_0x90d4('0x5f')]=function(_0x1c71ba,_0x591112,_0x21ae29){var _0x496d73={'channel':_0x90d4('0x60')};if(_0x1c71ba[_0x90d4('0x5c')]['id']){delete _0x1c71ba[_0x90d4('0x5c')]['id'];}_0x1c71ba[_0x90d4('0x5c')]['read']=!![];_0x1c71ba[_0x90d4('0x5c')][_0x90d4('0x61')]=moment()[_0x90d4('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c71ba[_0x90d4('0x5c')][_0x90d4('0x63')]=_0x1c71ba[_0x90d4('0x5c')][_0x90d4('0x63')]||_0x1c71ba[_0x90d4('0x64')]['id'];return db[_0x90d4('0x51')][_0x90d4('0x5a')]({'where':{'id':_0x1c71ba['params']['id'],'UserId':null},'include':[{'model':db[_0x90d4('0x65')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x591112,null))['then'](saveUpdates(_0x1c71ba[_0x90d4('0x5c')],null))[_0x90d4('0x26')](function(_0x40e146){if(_0x40e146){_0x496d73['message']=_0x40e146[_0x90d4('0x66')]({'plain':!![]});return db[_0x90d4('0x67')][_0x90d4('0x5a')]({'where':{'id':_0x40e146['SmsInteractionId']}});}return null;})[_0x90d4('0x26')](handleEntityNotFound(_0x591112,null))[_0x90d4('0x26')](function(_0x12dcc6){if(_0x12dcc6){return _0x12dcc6[_0x90d4('0x5d')]({'UserId':_0x1c71ba['body']['UserId'],'read1stAt':_[_0x90d4('0x68')](_0x12dcc6[_0x90d4('0x69')])?moment()[_0x90d4('0x62')](_0x90d4('0x6a')):undefined});}return null;})[_0x90d4('0x26')](function(_0x519587){if(_0x519587){_0x496d73[_0x90d4('0x6b')]=_0x519587[_0x90d4('0x66')]({'plain':!![]});interaction_log[_0x90d4('0x27')](_0x90d4('0x6c'),_0x1c71ba[_0x90d4('0x64')]['id'],_0x1c71ba['user'][_0x90d4('0x3d')],_0x1c71ba[_0x90d4('0x64')][_0x90d4('0x6d')],_0x496d73[_0x90d4('0x6b')]['id'],_0x1c71ba['body']?JSON[_0x90d4('0x2c')](_0x1c71ba[_0x90d4('0x5c')]):_0x90d4('0x6e'));return respondWithRpcPromise(_0x90d4('0x6f'),'acceptMessage',_0x496d73);}return null;})[_0x90d4('0x26')](function(_0x362794){if(_0x362794){if(_0x1c71ba[_0x90d4('0x5c')][_0x90d4('0x70')]){_0x496d73['message'][_0x90d4('0x71')]=util[_0x90d4('0x62')](_0x90d4('0x72'),_0x1c71ba['user']['name']);_0x496d73[_0x90d4('0x2e')][_0x90d4('0x73')]=_0x496d73[_0x90d4('0x73')];_0x496d73[_0x90d4('0x2e')][_0x90d4('0x74')]='accept';return respondWithRpcPromise(_0x90d4('0x75'),'EventManager',{'event':_0x90d4('0x76'),'message':_0x496d73[_0x90d4('0x2e')]},client9002)[_0x90d4('0x26')](function(){return _0x496d73;});}return _0x496d73;}return null;})[_0x90d4('0x26')](respondWithResult(_0x591112,null))['catch'](handleError(_0x591112,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x90d4('0x77')]=function(_0x52e305,_0x43557c,_0x39540a){var _0x465b37={'agent':{},'channel':_0x90d4('0x60')};if(_0x52e305[_0x90d4('0x5c')]['id']){delete _0x52e305['body']['id'];}_0x52e305[_0x90d4('0x5c')][_0x90d4('0x63')]=_0x52e305[_0x90d4('0x5c')][_0x90d4('0x63')]||_0x52e305['user']['id'];_0x465b37[_0x90d4('0x78')]['id']=_0x52e305[_0x90d4('0x5c')]['UserId'];return db[_0x90d4('0x51')]['find']({'where':{'id':_0x52e305[_0x90d4('0x56')]['id'],'UserId':null}})[_0x90d4('0x26')](handleEntityNotFound(_0x43557c,null))[_0x90d4('0x26')](function(_0xd46128){if(_0xd46128){_0x465b37[_0x90d4('0x2e')]=_0xd46128[_0x90d4('0x66')]({'plain':!![]});return db[_0x90d4('0x67')][_0x90d4('0x5a')]({'where':{'id':_0xd46128['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x43557c,null))[_0x90d4('0x26')](function(_0x27ab8d){if(_0x27ab8d){_0x465b37['interaction']=_0x27ab8d[_0x90d4('0x66')]({'plain':!![]});interaction_log[_0x90d4('0x27')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x52e305[_0x90d4('0x64')]['id'],_0x52e305[_0x90d4('0x64')][_0x90d4('0x3d')],_0x52e305[_0x90d4('0x64')]['role'],_0x465b37[_0x90d4('0x6b')]['id'],_0x52e305[_0x90d4('0x5c')]?JSON[_0x90d4('0x2c')](_0x52e305['body']):'null');return respondWithRpcPromise(_0x90d4('0x79'),_0x90d4('0x7a'),_0x465b37);}return null;})[_0x90d4('0x26')](function(_0x52e509){if(_0x52e509){_0x52e509[_0x90d4('0x2e')][_0x90d4('0x71')]=util[_0x90d4('0x62')]('SIP/%s',_0x52e305[_0x90d4('0x64')][_0x90d4('0x3d')]);_0x52e509['message']['channel']=_0x465b37[_0x90d4('0x73')];_0x52e509[_0x90d4('0x2e')][_0x90d4('0x74')]=_0x90d4('0x77');respondWithRpcPromise(_0x90d4('0x75'),_0x90d4('0x75'),{'event':'rejectmessage','message':_0x52e509[_0x90d4('0x2e')]},client9002);return _0x465b37;}return null;})[_0x90d4('0x26')](respondWithResult(_0x43557c,null))[_0x90d4('0x30')](handleError(_0x43557c,null));};exports['status']=function(_0xe7a8ba,_0x31dcaa,_0x5fc329){if(_0xe7a8ba[_0x90d4('0x5c')]['id']){delete _0xe7a8ba[_0x90d4('0x5c')]['id'];}var _0x76965;return db[_0x90d4('0x51')][_0x90d4('0x5a')]({'where':{'id':_0xe7a8ba['params']['id']}})[_0x90d4('0x26')](handleEntityNotFound(_0x31dcaa,null))['then'](function(_0x34c42c){if(_0x34c42c){_0x76965=_0x34c42c;return db[_0x90d4('0x7b')][_0x90d4('0x5a')]({'where':{'id':_0x34c42c['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x31dcaa,null))['then'](function(_0x48931b){if(_0x48931b){logger[_0x90d4('0x29')](_0x90d4('0x2a'),_0x90d4('0x32'),_0x90d4('0x7c'),_0x48931b[_0x90d4('0x3f')],util['inspect'](_0xe7a8ba['body'],{'showHidden':![],'depth':null}));switch(_0x48931b[_0x90d4('0x3f')]){case'twilio':if(_0xe7a8ba['body']['MessageSid']&&_0xe7a8ba[_0x90d4('0x5c')][_0x90d4('0x7d')]===_0x76965[_0x90d4('0x7e')]){return _0x76965[_0x90d4('0x5d')]({'read':!![]});}else{logger[_0x90d4('0x2d')](_0x90d4('0x7f'),_0x90d4('0x32'),_0x90d4('0x80'),util[_0x90d4('0x81')](_0xe7a8ba[_0x90d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x90d4('0x82'):if(_0xe7a8ba[_0x90d4('0x5c')][_0x90d4('0x83')]&&_0xe7a8ba[_0x90d4('0x5c')]['MessageUUID']===_0x76965['messageId']&&_['indexOf'](['sent',_0x90d4('0x84')],_0xe7a8ba[_0x90d4('0x5c')][_0x90d4('0x85')])>=0x0){return _0x76965[_0x90d4('0x5d')]({'read':!![]});}else{logger[_0x90d4('0x2d')](_0x90d4('0x7f'),_0x90d4('0x32'),_0x90d4('0x86'),util[_0x90d4('0x81')](_0xe7a8ba[_0x90d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x90d4('0x87'):var _0x2415e0=_0xe7a8ba[_0x90d4('0x5c')]['results'][0x0];if(_0x2415e0[_0x90d4('0x32')][_0x90d4('0x88')]===_0x90d4('0x89')){return _0x76965[_0x90d4('0x5d')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x90d4('0x32'),_0x90d4('0x87'),util[_0x90d4('0x81')](_0xe7a8ba[_0x90d4('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x76965;}})[_0x90d4('0x26')](respondWithResult(_0x31dcaa,null))['catch'](handleError(_0x31dcaa,null));}; \ No newline at end of file +var _0x5cd5=['hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','find','create','body','describe','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','interface','format','channel','EventManager','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','rejectMessage','SIP/%s','event','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','update','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','sent','delivered','Status','infobip','results','groupName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','destroy','end','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x4763f7,_0x7c6950){var _0x5d419e=function(_0x593f4b){while(--_0x593f4b){_0x4763f7['push'](_0x4763f7['shift']());}};_0x5d419e(++_0x7c6950);}(_0x5cd5,0x149));var _0x55cd=function(_0x4e7ec8,_0xe36ab0){_0x4e7ec8=_0x4e7ec8-0x0;var _0x20aeed=_0x5cd5[_0x4e7ec8];return _0x20aeed;};'use strict';var pdf=require(_0x55cd('0x0'));var emlformat=require(_0x55cd('0x1'));var rimraf=require(_0x55cd('0x2'));var zipdir=require(_0x55cd('0x3'));var jsonpatch=require(_0x55cd('0x4'));var rp=require('request-promise');var moment=require(_0x55cd('0x5'));var BPromise=require(_0x55cd('0x6'));var Mustache=require(_0x55cd('0x7'));var util=require(_0x55cd('0x8'));var path=require(_0x55cd('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x55cd('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x55cd('0xb'));var crypto=require(_0x55cd('0xc'));var jsforce=require(_0x55cd('0xd'));var deskjs=require(_0x55cd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x55cd('0xf'));var Papa=require('papaparse');var Redis=require(_0x55cd('0x10'));var authService=require(_0x55cd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x55cd('0x12'));var hardwareService=require(_0x55cd('0x13'));var logger=require(_0x55cd('0x14'))('api');var utils=require(_0x55cd('0x15'));var config=require(_0x55cd('0x16'));var db=require('../../mysqldb')['db'];config[_0x55cd('0x17')]=_['defaults'](config['redis'],{'host':_0x55cd('0x18'),'port':0x18eb});var socket=require(_0x55cd('0x19'))(new Redis(config[_0x55cd('0x17')]));require(_0x55cd('0x1a'))[_0x55cd('0x1b')](socket);var jayson=require(_0x55cd('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x55cd('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1413db,_0x4df6e9,_0x11e5c4){if(_0x11e5c4){var _0x26a5b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26a5b6[_0x55cd('0x1e')](_0x4df6e9)){return _0x1413db;}else{throw new db['Sequelize'][(_0x55cd('0x1f'))](_0x55cd('0x20'));}}else{return _0x1413db;}}function respondWithRpcPromise(_0x13856f,_0x29a635,_0x4e9a8c,_0x46692a){return new BPromise(function(_0x2c84e6,_0x55f784){var _0x4ab739=_0x46692a||client;return _0x4ab739[_0x55cd('0x21')](_0x13856f,_0x4e9a8c)[_0x55cd('0x22')](function(_0xeab27b){logger[_0x55cd('0x23')](_0x55cd('0x24'),_0x29a635,'request\x20sent');logger[_0x55cd('0x25')](_0x55cd('0x26'),_0x29a635,_0x55cd('0x27'),JSON[_0x55cd('0x28')](_0xeab27b));if(_0xeab27b['error']){if(_0xeab27b[_0x55cd('0x29')]['code']===0x1f4){logger[_0x55cd('0x29')](_0x55cd('0x24'),_0x29a635,_0xeab27b[_0x55cd('0x29')]['message']);return _0x55f784(_0xeab27b[_0x55cd('0x29')][_0x55cd('0x2a')]);}logger[_0x55cd('0x29')]('SmsMessage,\x20%s,\x20%s',_0x29a635,_0xeab27b['error'][_0x55cd('0x2a')]);return _0x2c84e6(_0xeab27b[_0x55cd('0x29')][_0x55cd('0x2a')]);}else{logger['info'](_0x55cd('0x24'),_0x29a635,'request\x20sent');_0x2c84e6(_0xeab27b['result'][_0x55cd('0x2a')]);}})[_0x55cd('0x2b')](function(_0x2a138f){logger[_0x55cd('0x29')](_0x55cd('0x24'),_0x29a635,_0x2a138f);_0x55f784(_0x2a138f);});});}function respondWithStatusCode(_0x44beaf,_0x1346f8){_0x1346f8=_0x1346f8||0xcc;return function(_0xbf5704){if(_0xbf5704){return _0x44beaf[_0x55cd('0x2c')](_0x1346f8);}return _0x44beaf[_0x55cd('0x2d')](_0x1346f8)['end']();};}function respondWithResult(_0x55110b,_0x42e8a0){_0x42e8a0=_0x42e8a0||0xc8;return function(_0x33a5a0){if(_0x33a5a0){return _0x55110b[_0x55cd('0x2d')](_0x42e8a0)[_0x55cd('0x2e')](_0x33a5a0);}};}function respondWithFilteredResult(_0x144ae7,_0x4417f1){return function(_0x11f475){if(_0x11f475){var _0x4bc961=_0x11f475['count'],_0x94707a=_0x4417f1[_0x55cd('0x2f')],_0x11524a=_0x4417f1[_0x55cd('0x2f')]+_0x4417f1[_0x55cd('0x30')],_0x1fb574;if(_0x11524a>=_0x4bc961){_0x11524a=_0x4bc961;_0x1fb574=0xc8;}else{_0x1fb574=0xce;}_0x144ae7[_0x55cd('0x2d')](_0x1fb574);return _0x144ae7['set'](_0x55cd('0x31'),_0x94707a+'-'+_0x11524a+'/'+_0x4bc961)[_0x55cd('0x2e')](_0x11f475);}return null;};}function patchUpdates(_0xd0ec0d){return function(_0x44a678){try{jsonpatch[_0x55cd('0x32')](_0x44a678,_0xd0ec0d,!![]);}catch(_0xdce13f){return BPromise[_0x55cd('0x33')](_0xdce13f);}return _0x44a678[_0x55cd('0x34')]();};}function saveUpdates(_0x5d5ec5,_0x3e6213){return function(_0x9914fa){if(_0x9914fa){return _0x9914fa['update'](_0x5d5ec5)[_0x55cd('0x22')](function(_0x1440e9){return _0x1440e9;});}return null;};}function removeEntity(_0x80c471,_0x2f6e40){return function(_0x407769){if(_0x407769){return _0x407769[_0x55cd('0x35')]()[_0x55cd('0x22')](function(){_0x80c471[_0x55cd('0x2d')](0xcc)[_0x55cd('0x36')]();});}};}function handleEntityNotFound(_0xed082f,_0xc7dbfd){return function(_0x359537){if(!_0x359537){_0xed082f[_0x55cd('0x2c')](0x194);}return _0x359537;};}function handleError(_0x264791,_0x537c98){_0x537c98=_0x537c98||0x1f4;return function(_0x582320){logger[_0x55cd('0x29')](_0x582320[_0x55cd('0x37')]);if(_0x582320[_0x55cd('0x38')]){delete _0x582320[_0x55cd('0x38')];}_0x264791[_0x55cd('0x2d')](_0x537c98)[_0x55cd('0x39')](_0x582320);};}exports[_0x55cd('0x3a')]=function(_0x1fa49c,_0x5b1ba6){var _0x5a9c8e={},_0x598572={},_0x2fb393={'count':0x0,'rows':[]};var _0x5cc7d8=_[_0x55cd('0x3b')](db[_0x55cd('0x3c')][_0x55cd('0x3d')],function(_0x27b454){return{'name':_0x27b454[_0x55cd('0x3e')],'type':_0x27b454[_0x55cd('0x3f')][_0x55cd('0x40')]};});_0x598572[_0x55cd('0x41')]=_[_0x55cd('0x3b')](_0x5cc7d8,_0x55cd('0x38'));_0x598572[_0x55cd('0x42')]=_[_0x55cd('0x43')](_0x1fa49c[_0x55cd('0x42')]);_0x598572[_0x55cd('0x44')]=_[_0x55cd('0x45')](_0x598572[_0x55cd('0x41')],_0x598572[_0x55cd('0x42')]);_0x5a9c8e[_0x55cd('0x46')]=_[_0x55cd('0x45')](_0x598572[_0x55cd('0x41')],qs[_0x55cd('0x47')](_0x1fa49c[_0x55cd('0x42')]['fields']));_0x5a9c8e[_0x55cd('0x46')]=_0x5a9c8e[_0x55cd('0x46')][_0x55cd('0x48')]?_0x5a9c8e[_0x55cd('0x46')]:_0x598572['model'];if(!_0x1fa49c[_0x55cd('0x42')][_0x55cd('0x49')](_0x55cd('0x4a'))){_0x5a9c8e['limit']=qs['limit'](_0x1fa49c[_0x55cd('0x42')][_0x55cd('0x30')]);_0x5a9c8e[_0x55cd('0x2f')]=qs[_0x55cd('0x2f')](_0x1fa49c[_0x55cd('0x42')][_0x55cd('0x2f')]);}_0x5a9c8e[_0x55cd('0x4b')]=qs[_0x55cd('0x4c')](_0x1fa49c[_0x55cd('0x42')][_0x55cd('0x4c')]);_0x5a9c8e[_0x55cd('0x4d')]=qs['filters'](_[_0x55cd('0x4e')](_0x1fa49c[_0x55cd('0x42')],_0x598572[_0x55cd('0x44')]));if(_0x1fa49c['query'][_0x55cd('0x4f')]){_0x5a9c8e[_0x55cd('0x4d')]=_['merge'](_0x5a9c8e[_0x55cd('0x4d')],{'$or':_[_0x55cd('0x3b')](_0x5cc7d8,function(_0x33cf93){if(_0x33cf93[_0x55cd('0x3f')]!==_0x55cd('0x50')){var _0xd60b02={};_0xd60b02[_0x33cf93[_0x55cd('0x38')]]={'$like':'%'+_0x1fa49c[_0x55cd('0x42')]['filter']+'%'};return _0xd60b02;}})});}_0x5a9c8e=_[_0x55cd('0x51')]({},_0x5a9c8e,_0x1fa49c[_0x55cd('0x52')]);var _0x43107c={'where':_0x5a9c8e[_0x55cd('0x4d')]};return db['SmsMessage'][_0x55cd('0x53')](_0x43107c)[_0x55cd('0x22')](function(_0x1bbf29){_0x2fb393[_0x55cd('0x53')]=_0x1bbf29;if(_0x1fa49c[_0x55cd('0x42')][_0x55cd('0x54')]){_0x5a9c8e[_0x55cd('0x55')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x5a9c8e);})[_0x55cd('0x22')](function(_0x480f5b){_0x2fb393[_0x55cd('0x56')]=_0x480f5b;return _0x2fb393;})[_0x55cd('0x22')](respondWithFilteredResult(_0x5b1ba6,_0x5a9c8e))[_0x55cd('0x2b')](handleError(_0x5b1ba6,null));};exports[_0x55cd('0x57')]=function(_0x15d384,_0x5870ce){var _0x3832a5={'raw':!![],'where':{'id':_0x15d384[_0x55cd('0x58')]['id']}},_0x9f4fc3={};_0x9f4fc3[_0x55cd('0x41')]=_['keys'](db['SmsMessage']['rawAttributes']);_0x9f4fc3[_0x55cd('0x42')]=_[_0x55cd('0x43')](_0x15d384['query']);_0x9f4fc3[_0x55cd('0x44')]=_['intersection'](_0x9f4fc3[_0x55cd('0x41')],_0x9f4fc3[_0x55cd('0x42')]);_0x3832a5[_0x55cd('0x46')]=_[_0x55cd('0x45')](_0x9f4fc3[_0x55cd('0x41')],qs[_0x55cd('0x47')](_0x15d384[_0x55cd('0x42')]['fields']));_0x3832a5['attributes']=_0x3832a5['attributes'][_0x55cd('0x48')]?_0x3832a5[_0x55cd('0x46')]:_0x9f4fc3[_0x55cd('0x41')];if(_0x15d384[_0x55cd('0x42')][_0x55cd('0x54')]){_0x3832a5['include']=[{'all':!![]}];}_0x3832a5=_[_0x55cd('0x51')]({},_0x3832a5,_0x15d384['options']);return db[_0x55cd('0x3c')][_0x55cd('0x59')](_0x3832a5)[_0x55cd('0x22')](handleEntityNotFound(_0x5870ce,null))[_0x55cd('0x22')](respondWithResult(_0x5870ce,null))[_0x55cd('0x2b')](handleError(_0x5870ce,null));};exports['create']=function(_0x1f085e,_0x1c3d77){return db['SmsMessage'][_0x55cd('0x5a')](_0x1f085e['body'],{})[_0x55cd('0x22')](respondWithResult(_0x1c3d77,0xc9))[_0x55cd('0x2b')](handleError(_0x1c3d77,null));};exports['update']=function(_0x2996aa,_0x4dc307){if(_0x2996aa[_0x55cd('0x5b')]['id']){delete _0x2996aa[_0x55cd('0x5b')]['id'];}return db[_0x55cd('0x3c')][_0x55cd('0x59')]({'where':{'id':_0x2996aa['params']['id']}})[_0x55cd('0x22')](handleEntityNotFound(_0x4dc307,null))['then'](saveUpdates(_0x2996aa[_0x55cd('0x5b')],null))[_0x55cd('0x22')](respondWithResult(_0x4dc307,null))[_0x55cd('0x2b')](handleError(_0x4dc307,null));};exports[_0x55cd('0x35')]=function(_0x5c423f,_0x56a303){return db[_0x55cd('0x3c')][_0x55cd('0x59')]({'where':{'id':_0x5c423f[_0x55cd('0x58')]['id']}})[_0x55cd('0x22')](handleEntityNotFound(_0x56a303,null))['then'](removeEntity(_0x56a303,null))[_0x55cd('0x2b')](handleError(_0x56a303,null));};exports[_0x55cd('0x5c')]=function(_0x34a3c6,_0xcb3a96){return db[_0x55cd('0x3c')][_0x55cd('0x5c')]()[_0x55cd('0x22')](respondWithResult(_0xcb3a96,null))[_0x55cd('0x2b')](handleError(_0xcb3a96,null));};var interaction_log=require(_0x55cd('0x14'))('sms-interactions');exports[_0x55cd('0x5d')]=function(_0x1c2bb2,_0x56482f,_0x451d0b){var _0x536ad0={'channel':_0x55cd('0x5e')};if(_0x1c2bb2['body']['id']){delete _0x1c2bb2[_0x55cd('0x5b')]['id'];}_0x1c2bb2[_0x55cd('0x5b')]['read']=!![];_0x1c2bb2[_0x55cd('0x5b')][_0x55cd('0x5f')]=moment()['format'](_0x55cd('0x60'));_0x1c2bb2[_0x55cd('0x5b')][_0x55cd('0x61')]=_0x1c2bb2['body'][_0x55cd('0x61')]||_0x1c2bb2[_0x55cd('0x62')]['id'];return db['SmsMessage']['find']({'where':{'id':_0x1c2bb2['params']['id'],'UserId':null},'include':[{'model':db[_0x55cd('0x63')],'as':_0x55cd('0x64')}]})[_0x55cd('0x22')](handleEntityNotFound(_0x56482f,null))[_0x55cd('0x22')](saveUpdates(_0x1c2bb2['body'],null))['then'](function(_0x4120dd){if(_0x4120dd){_0x536ad0['message']=_0x4120dd[_0x55cd('0x65')]({'plain':!![]});return db[_0x55cd('0x66')][_0x55cd('0x59')]({'where':{'id':_0x4120dd[_0x55cd('0x67')]}});}return null;})[_0x55cd('0x22')](handleEntityNotFound(_0x56482f,null))[_0x55cd('0x22')](function(_0xc7ec74){if(_0xc7ec74){return _0xc7ec74['update']({'UserId':_0x1c2bb2[_0x55cd('0x5b')][_0x55cd('0x61')],'read1stAt':_['isNil'](_0xc7ec74['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x55cd('0x22')](function(_0x4c5ee6){if(_0x4c5ee6){_0x536ad0['interaction']=_0x4c5ee6[_0x55cd('0x65')]({'plain':!![]});interaction_log['info'](_0x55cd('0x68'),_0x1c2bb2[_0x55cd('0x62')]['id'],_0x1c2bb2[_0x55cd('0x62')][_0x55cd('0x38')],_0x1c2bb2[_0x55cd('0x62')]['role'],_0x536ad0['interaction']['id'],_0x1c2bb2[_0x55cd('0x5b')]?JSON[_0x55cd('0x28')](_0x1c2bb2['body']):'null');return respondWithRpcPromise(_0x55cd('0x69'),_0x55cd('0x6a'),_0x536ad0);}return null;})[_0x55cd('0x22')](function(_0xfa71ce){if(_0xfa71ce){if(_0x1c2bb2[_0x55cd('0x5b')]['manual']){_0x536ad0['message'][_0x55cd('0x6b')]=util[_0x55cd('0x6c')]('SIP/%s',_0x1c2bb2[_0x55cd('0x62')][_0x55cd('0x38')]);_0x536ad0[_0x55cd('0x2a')][_0x55cd('0x6d')]=_0x536ad0[_0x55cd('0x6d')];_0x536ad0['message']['event']=_0x55cd('0x5d');return respondWithRpcPromise(_0x55cd('0x6e'),_0x55cd('0x6e'),{'event':'acceptmessage','message':_0x536ad0[_0x55cd('0x2a')]},client9002)[_0x55cd('0x22')](function(){return _0x536ad0;});}return _0x536ad0;}return null;})[_0x55cd('0x22')](respondWithResult(_0x56482f,null))['catch'](handleError(_0x56482f,null));};var interaction_log=require('../../config/logger')(_0x55cd('0x6f'));exports['reject']=function(_0x226fc8,_0x4a0169,_0x511a82){var _0x37a9ad={'agent':{},'channel':_0x55cd('0x5e')};if(_0x226fc8[_0x55cd('0x5b')]['id']){delete _0x226fc8['body']['id'];}_0x226fc8['body'][_0x55cd('0x61')]=_0x226fc8[_0x55cd('0x5b')][_0x55cd('0x61')]||_0x226fc8[_0x55cd('0x62')]['id'];_0x37a9ad['agent']['id']=_0x226fc8[_0x55cd('0x5b')]['UserId'];return db[_0x55cd('0x3c')][_0x55cd('0x59')]({'where':{'id':_0x226fc8[_0x55cd('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a0169,null))[_0x55cd('0x22')](function(_0xc1b513){if(_0xc1b513){_0x37a9ad['message']=_0xc1b513['get']({'plain':!![]});return db[_0x55cd('0x66')]['find']({'where':{'id':_0xc1b513[_0x55cd('0x67')]}});}return null;})[_0x55cd('0x22')](handleEntityNotFound(_0x4a0169,null))['then'](function(_0x34babd){if(_0x34babd){_0x37a9ad['interaction']=_0x34babd['get']({'plain':!![]});interaction_log[_0x55cd('0x23')](_0x55cd('0x70'),_0x226fc8[_0x55cd('0x62')]['id'],_0x226fc8['user'][_0x55cd('0x38')],_0x226fc8[_0x55cd('0x62')]['role'],_0x37a9ad[_0x55cd('0x71')]['id'],_0x226fc8['body']?JSON['stringify'](_0x226fc8[_0x55cd('0x5b')]):_0x55cd('0x72'));return respondWithRpcPromise('RejectMessage',_0x55cd('0x73'),_0x37a9ad);}return null;})[_0x55cd('0x22')](function(_0x210936){if(_0x210936){_0x210936[_0x55cd('0x2a')][_0x55cd('0x6b')]=util[_0x55cd('0x6c')](_0x55cd('0x74'),_0x226fc8[_0x55cd('0x62')][_0x55cd('0x38')]);_0x210936[_0x55cd('0x2a')]['channel']=_0x37a9ad['channel'];_0x210936['message'][_0x55cd('0x75')]=_0x55cd('0x33');respondWithRpcPromise(_0x55cd('0x6e'),_0x55cd('0x6e'),{'event':'rejectmessage','message':_0x210936[_0x55cd('0x2a')]},client9002);return _0x37a9ad;}return null;})[_0x55cd('0x22')](respondWithResult(_0x4a0169,null))[_0x55cd('0x2b')](handleError(_0x4a0169,null));};exports[_0x55cd('0x2d')]=function(_0x27d193,_0x499817,_0x5cf5be){if(_0x27d193[_0x55cd('0x5b')]['id']){delete _0x27d193[_0x55cd('0x5b')]['id'];}var _0x544913;return db['SmsMessage']['find']({'where':{'id':_0x27d193[_0x55cd('0x58')]['id']}})['then'](handleEntityNotFound(_0x499817,null))['then'](function(_0x2b0cd8){if(_0x2b0cd8){_0x544913=_0x2b0cd8;return db['SmsAccount']['find']({'where':{'id':_0x2b0cd8[_0x55cd('0x76')]}});}})[_0x55cd('0x22')](handleEntityNotFound(_0x499817,null))[_0x55cd('0x22')](function(_0x641e6b){if(_0x641e6b){logger[_0x55cd('0x25')](_0x55cd('0x26'),_0x55cd('0x2d'),_0x55cd('0x77'),_0x641e6b[_0x55cd('0x3f')],util[_0x55cd('0x78')](_0x27d193[_0x55cd('0x5b')],{'showHidden':![],'depth':null}));switch(_0x641e6b[_0x55cd('0x3f')]){case'twilio':if(_0x27d193[_0x55cd('0x5b')][_0x55cd('0x79')]&&_0x27d193[_0x55cd('0x5b')][_0x55cd('0x79')]===_0x544913[_0x55cd('0x7a')]){return _0x544913[_0x55cd('0x7b')]({'read':!![]});}else{logger[_0x55cd('0x29')](_0x55cd('0x7c'),'status',_0x55cd('0x7d'),util[_0x55cd('0x78')](_0x27d193[_0x55cd('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x55cd('0x7e'):if(_0x27d193[_0x55cd('0x5b')][_0x55cd('0x7f')]&&_0x27d193[_0x55cd('0x5b')][_0x55cd('0x7f')]===_0x544913['messageId']&&_['indexOf']([_0x55cd('0x80'),_0x55cd('0x81')],_0x27d193[_0x55cd('0x5b')][_0x55cd('0x82')])>=0x0){return _0x544913[_0x55cd('0x7b')]({'read':!![]});}else{logger[_0x55cd('0x29')](_0x55cd('0x7c'),'status','plivio',util[_0x55cd('0x78')](_0x27d193[_0x55cd('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x55cd('0x83'):var _0x3384c8=_0x27d193[_0x55cd('0x5b')][_0x55cd('0x84')][0x0];if(_0x3384c8['status'][_0x55cd('0x85')]==='DELIVERED'){return _0x544913['update']({'read':!![]});}else{logger[_0x55cd('0x29')](_0x55cd('0x7c'),_0x55cd('0x2d'),_0x55cd('0x83'),util[_0x55cd('0x78')](_0x27d193[_0x55cd('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x544913;}})[_0x55cd('0x22')](respondWithResult(_0x499817,null))['catch'](handleError(_0x499817,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index a47e51b..1df62b3 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 _0x5c19=['SmsMessage','update','emit','exports'];(function(_0x15705c,_0x44a657){var _0x3758ef=function(_0x482c39){while(--_0x482c39){_0x15705c['push'](_0x15705c['shift']());}};_0x3758ef(++_0x44a657);}(_0x5c19,0x1d8));var _0x95c1=function(_0x4b14bb,_0xe7b4d3){_0x4b14bb=_0x4b14bb-0x0;var _0x285200=_0x5c19[_0x4b14bb];return _0x285200;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x95c1('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x95c1('0x1'),'afterDestroy':'remove'};function emitEvent(_0xe9f0f5){return function(_0x2320d1,_0x5ab727,_0x2b8b32){SmsMessageEvents[_0x95c1('0x2')](_0xe9f0f5+':'+_0x2320d1['id'],_0x2320d1);SmsMessageEvents[_0x95c1('0x2')](_0xe9f0f5,_0x2320d1);_0x2b8b32(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x95c1('0x3')]=SmsMessageEvents; \ No newline at end of file +var _0xe5cd=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0xe5cd,0x14b));var _0xde5c=function(_0x3ca60d,_0x12b56a){_0x3ca60d=_0x3ca60d-0x0;var _0x5ea19f=_0xe5cd[_0x3ca60d];return _0x5ea19f;};'use strict';var EventEmitter=require(_0xde5c('0x0'));var SmsMessage=require(_0xde5c('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xde5c('0x2')](0x0);var events={'afterCreate':_0xde5c('0x3'),'afterUpdate':_0xde5c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x350e83){return function(_0x3c5642,_0x345283,_0x5d90c0){SmsMessageEvents['emit'](_0x350e83+':'+_0x3c5642['id'],_0x3c5642);SmsMessageEvents[_0xde5c('0x5')](_0x350e83,_0x3c5642);_0x5d90c0(null);};}for(var e in events){if(events[_0xde5c('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xde5c('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 ed185ad..d21a71c 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 _0x7d0e=['digest','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','path','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','FULLTEXT','models','get','direction','toLowerCase','out','isNil','SmsInteraction','findOne','then','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','body','/status?token=','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','&password=','GET','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','POST','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','clickSend','authId','/api/sms/messages/','token','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','keys','sort','createHash'];(function(_0x59770d,_0x44866e){var _0x176afb=function(_0x8578f){while(--_0x8578f){_0x59770d['push'](_0x59770d['shift']());}};_0x176afb(++_0x44866e);}(_0x7d0e,0x1f2));var _0xe7d0=function(_0x297972,_0x512ca9){_0x297972=_0x297972-0x0;var _0x40bac2=_0x7d0e[_0x297972];return _0x40bac2;};'use strict';var _=require(_0xe7d0('0x0'));var util=require('util');var logger=require(_0xe7d0('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe7d0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7d0('0x3'));var rimraf=require('rimraf');var config=require(_0xe7d0('0x4'));var attributes=require('./smsMessage.attributes');module[_0xe7d0('0x5')]=function(_0x16cfaa,_0x306883){return _0x16cfaa[_0xe7d0('0x6')](_0xe7d0('0x7'),attributes,{'tableName':_0xe7d0('0x8'),'paranoid':![],'indexes':[{'name':_0xe7d0('0x9'),'fields':['messageId']},{'name':'fti_sms_messages','fields':['body'],'type':_0xe7d0('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x98f3a5,_0xd7d597,_0x368e4f){var _0x63d18a=_0x16cfaa[_0xe7d0('0xb')];var _0xa79540=_0x98f3a5[_0xe7d0('0xc')]({'plain':!![]});if(_0xa79540[_0xe7d0('0xd')][_0xe7d0('0xe')]()==='in'||_0xa79540[_0xe7d0('0xd')][_0xe7d0('0xe')]()===_0xe7d0('0xf')&&!_0xa79540['secret']&&!_[_0xe7d0('0x10')](_0xa79540['UserId'])){_0x63d18a[_0xe7d0('0x11')][_0xe7d0('0x12')]({'where':{'id':_0xa79540['SmsInteractionId']}})[_0xe7d0('0x13')](function(_0x2ec786){if(_0x2ec786){_0x2ec786['update']({'lastMsgAt':_0xa79540[_0xe7d0('0x14')],'lastMsgDirection':_0xa79540[_0xe7d0('0xd')][_0xe7d0('0xe')]()});}})[_0xe7d0('0x15')](function(_0x511eea){console[_0xe7d0('0x16')](_0x511eea);});}if(_0xa79540[_0xe7d0('0xd')]==='out'&&!_0xa79540[_0xe7d0('0x17')]){var _0x5b5749;_0x63d18a[_0xe7d0('0x18')][_0xe7d0('0x19')]({'where':{'id':_0xa79540[_0xe7d0('0x1a')]},'raw':!![]})[_0xe7d0('0x13')](function(_0x493e0e){_0x5b5749=_0x493e0e;if(_0x5b5749&&_0x5b5749[_0xe7d0('0x1b')]){switch(_0x5b5749[_0xe7d0('0x1b')]){case _0xe7d0('0x1c'):var _0x11000e=require(_0xe7d0('0x1c'));if(_0x5b5749[_0xe7d0('0x1d')]&&_0x5b5749[_0xe7d0('0x1e')]&&_0x5b5749[_0xe7d0('0x1f')]){var _0x62b102=new _0x11000e(_0x5b5749[_0xe7d0('0x1d')],_0x5b5749['authToken']);_0x62b102['messages'][_0xe7d0('0x20')]({'body':_0xa79540[_0xe7d0('0x21')],'to':_0xa79540[_0xe7d0('0x1f')],'from':_0x5b5749[_0xe7d0('0x1f')],'statusCallback':_0x5b5749['remote']+'/api/sms/messages/'+_0xa79540['id']+_0xe7d0('0x22')+_0x5b5749['token']})[_0xe7d0('0x13')](function(_0x1bd6db){if(_0x1bd6db[_0xe7d0('0x23')]){return _0x98f3a5[_0xe7d0('0x24')]({'messageId':_0x1bd6db[_0xe7d0('0x23')]});}})[_0xe7d0('0x15')](function(_0x266c9c){logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x1c'),util[_0xe7d0('0x27')](_0x266c9c,{'showHidden':![],'depth':null}));});}else{logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x1c'),_0xe7d0('0x28'));}break;case _0xe7d0('0x29'):var _0x4eee90='https://api.skebby.it/API/v1.0/REST/';if(_0x5b5749[_0xe7d0('0x2a')]&&_0x5b5749[_0xe7d0('0x2b')]){var _0x27a8f8={'recipient':[_0xa79540[_0xe7d0('0x1f')]],'message':_0xa79540[_0xe7d0('0x21')],'message_type':_0x5b5749[_0xe7d0('0x2c')]};if(_0x5b5749[_0xe7d0('0x2c')]&&_0x5b5749[_0xe7d0('0x2c')]!=='SI'){_0x27a8f8['sender']=_0x5b5749['phone'];}var _0x4324b3={'url':_0x4eee90+_0xe7d0('0x2d')+_0x5b5749['username']+_0xe7d0('0x2e')+_0x5b5749[_0xe7d0('0x2b')],'method':_0xe7d0('0x2f')};rp(_0x4324b3)[_0xe7d0('0x13')](function(_0x209db3){var _0x2f0d30=_0x209db3['split'](';');var _0x113ec1={'user_key':_0x2f0d30[0x0],'session_key':_0x2f0d30[0x1]};_0x4324b3={'url':_0x4eee90+_0xe7d0('0x30'),'method':'POST','headers':{'user_key':_0x113ec1[_0xe7d0('0x31')],'Session_key':_0x113ec1[_0xe7d0('0x32')]},'json':!![],'body':_0x27a8f8};return rp(_0x4324b3);})['then'](function(_0x5227ba){if(_0x5227ba[_0xe7d0('0x33')]>=0x1){var _0xdcfc7f={'messageId':_0x5227ba[_0xe7d0('0x34')]};if(_0x5b5749[_0xe7d0('0x2c')]!=='GP'||!_0x5b5749[_0xe7d0('0x35')]){_0xdcfc7f['read']=!![];}return _0x98f3a5[_0xe7d0('0x24')](_0xdcfc7f);}else{return logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x29'),util[_0xe7d0('0x27')](_0x5227ba,{'showHidden':![],'depth':null}));}})[_0xe7d0('0x15')](function(_0x550558){return logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x29'),util[_0xe7d0('0x27')](_0x550558,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe7d0('0x25'),_0xe7d0('0x26'),'skebby',_0xe7d0('0x36'));}break;case _0xe7d0('0x37'):if(_0x5b5749[_0xe7d0('0x1e')]){var _0x5cae3a={'recipient':_0xa79540[_0xe7d0('0x1f')],'message':_0xa79540[_0xe7d0('0x21')],'sender':_0x5b5749[_0xe7d0('0x38')]||_0x5b5749[_0xe7d0('0x1f')],'authorization':_0x5b5749[_0xe7d0('0x1e')]};var _0xd7d597={'method':'POST','uri':_0xe7d0('0x39'),'body':_0x5cae3a,'json':!![]};rp(_0xd7d597)[_0xe7d0('0x13')](function(_0x1e2f5d){var _0x476265={'messageId':_0x1e2f5d[_0xe7d0('0x3a')]};if(!_0x5b5749['deliveryReport']){_0x476265[_0xe7d0('0x3b')]=!![];}return _0x98f3a5[_0xe7d0('0x24')](_0x476265);})[_0xe7d0('0x15')](function(_0x4b4db3){logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x37'),util[_0xe7d0('0x27')](_0x4b4db3,{'showHidden':![],'depth':null}));});}else{logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x37'),_0xe7d0('0x3c'));}break;case _0xe7d0('0x3d'):if(_0x5b5749[_0xe7d0('0x2a')]&&_0x5b5749[_0xe7d0('0x2b')]){var _0x5cae3a={'messages':[{'source':_0xe7d0('0x3e'),'to':_0xa79540[_0xe7d0('0x1f')],'body':_0xa79540['body'],'from':_0x5b5749[_0xe7d0('0x38')]||_0x5b5749['phone']}]};var _0xf0418=util[_0xe7d0('0x3f')](_0xe7d0('0x40'),_0x5b5749[_0xe7d0('0x2a')],_0x5b5749['password']);var _0xd7d597={'method':_0xe7d0('0x41'),'uri':_0xe7d0('0x42'),'body':_0x5cae3a,'headers':{'Authorization':util[_0xe7d0('0x3f')]('Basic\x20%s',new Buffer(_0xf0418)[_0xe7d0('0x43')](_0xe7d0('0x44')))},'json':!![]};rp(_0xd7d597)[_0xe7d0('0x13')](function(_0x24cf6f){if(_0x24cf6f[_0xe7d0('0x45')]>=0xc8&&_0x24cf6f['http_code']<=0xce){if(_0x24cf6f[_0xe7d0('0x46')]&&_0x24cf6f[_0xe7d0('0x46')][_0xe7d0('0x47')]>0x0){var _0x4e4e4b=_[_0xe7d0('0x48')](_0x24cf6f[_0xe7d0('0x46')]['messages']);var _0x2c62d8={'messageId':_0x4e4e4b['message_id']};if(!_0x5b5749['deliveryReport']){_0x2c62d8['read']=!![];}return _0x98f3a5['update'](_0x2c62d8);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7d0('0x26'),_0xe7d0('0x49'),util['inspect'](_0x24cf6f,{'showHidden':![],'depth':null}));}}else{logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x49'),util[_0xe7d0('0x27')](_0x24cf6f,{'showHidden':![],'depth':null}));}})[_0xe7d0('0x15')](function(_0x57135c){logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x49'),util[_0xe7d0('0x27')](_0x57135c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x49'),_0xe7d0('0x36'));}break;case'plivo':if(_0x5b5749[_0xe7d0('0x4a')]&&_0x5b5749[_0xe7d0('0x1e')]){var _0x5cae3a={'dst':_0xa79540[_0xe7d0('0x1f')],'text':_0xa79540[_0xe7d0('0x21')],'src':_0x5b5749[_0xe7d0('0x38')]||_0x5b5749[_0xe7d0('0x1f')],'url':_0x5b5749['remote']+_0xe7d0('0x4b')+_0xa79540['id']+_0xe7d0('0x22')+_0x5b5749[_0xe7d0('0x4c')]};var _0xf0418=util[_0xe7d0('0x3f')](_0xe7d0('0x40'),_0x5b5749['authId'],_0x5b5749['authToken']);var _0xd7d597={'method':'POST','uri':util[_0xe7d0('0x3f')](_0xe7d0('0x4d'),_0x5b5749[_0xe7d0('0x4a')]),'body':_0x5cae3a,'headers':{'Authorization':util['format'](_0xe7d0('0x4e'),new Buffer(_0xf0418)['toString']('base64'))},'json':!![]};rp(_0xd7d597)[_0xe7d0('0x13')](function(_0x2605fa){var _0x43ad9b={'messageId':_0x2605fa['message_uuid'][0x0]};return _0x98f3a5[_0xe7d0('0x24')](_0x43ad9b);})['catch'](function(_0x562342){logger[_0xe7d0('0x16')](_0xe7d0('0x25'),'afterCreate',_0xe7d0('0x4f'),util[_0xe7d0('0x27')](_0x562342,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe7d0('0x25'),_0xe7d0('0x26'),'plivo',_0xe7d0('0x50'));}break;case'infobip':if(_0x5b5749['username']&&_0x5b5749[_0xe7d0('0x2b')]){if(_0x5b5749[_0xe7d0('0x51')]){var _0xae0df6={'method':'POST','uri':_0x5b5749[_0xe7d0('0x51')]+_0xe7d0('0x52'),'body':{'username':_0x5b5749[_0xe7d0('0x2a')],'password':_0x5b5749[_0xe7d0('0x2b')]},'json':!![]};return rp(_0xae0df6)[_0xe7d0('0x13')](function(_0x26b9fb){var _0x4bc99d={'method':_0xe7d0('0x41'),'uri':_0x5b5749['baseUrl']+_0xe7d0('0x53'),'body':{'messages':[{'from':_0x5b5749[_0xe7d0('0x1f')],'destinations':[{'to':_0xa79540['phone']}],'text':_0xa79540[_0xe7d0('0x21')],'notifyUrl':_0x5b5749['remote']+_0xe7d0('0x4b')+_0xa79540['id']+_0xe7d0('0x22')+_0x5b5749[_0xe7d0('0x4c')],'notifyContentType':_0xe7d0('0x54'),'callbackData':_0x5b5749[_0xe7d0('0x1f')]+';'+_0xa79540[_0xe7d0('0x21')]}]},'headers':{'Authorization':_0xe7d0('0x55')+_0x26b9fb[_0xe7d0('0x4c')]},'json':!![]};return rp(_0x4bc99d)[_0xe7d0('0x13')](function(_0x1d8dcf){if(_0x1d8dcf[_0xe7d0('0x56')]){var _0x584c87={'messageId':_0x1d8dcf[_0xe7d0('0x56')][0x0][_0xe7d0('0x9')]};if(!_0x5b5749['deliveryReport']){_0x584c87[_0xe7d0('0x3b')]=!![];}return _0x98f3a5[_0xe7d0('0x24')](_0x584c87);}else{return logger['error'](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x57'),util[_0xe7d0('0x27')](_0x1d8dcf,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x57d501){return logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x57'),util[_0xe7d0('0x27')](_0x57d501,{'showHidden':![],'depth':null}));});}else{logger[_0xe7d0('0x16')](_0xe7d0('0x25'),'afterCreate',_0xe7d0('0x57'),_0xe7d0('0x58'));}}else{logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x57'),_0xe7d0('0x36'));}break;case _0xe7d0('0x59'):var _0x507cef=require(_0xe7d0('0x5a'));if(_0x5b5749[_0xe7d0('0x5b')]){var _0x5ade46={};_0x5ade46[_0xe7d0('0x5c')]=_0x5b5749[_0xe7d0('0x2a')];_0x5ade46[_0xe7d0('0x1f')]=_0xa79540[_0xe7d0('0x1f')];_0x5ade46[_0xe7d0('0x5d')]=_0x5b5749[_0xe7d0('0x1f')];_0x5ade46['text']=_0xa79540[_0xe7d0('0x21')];_0x5ade46['timestamp']=+new Date();var _0x23be41='';var _0x4de495='';var _0x351ba2=Object[_0xe7d0('0x5e')](_0x5ade46);_0x351ba2[_0xe7d0('0x5f')]();for(var _0x461d31=0x0;_0x461d31<_0x351ba2['length'];_0x461d31++){if(_0x23be41!=''){_0x23be41+='&';}_0x23be41+=_0x351ba2[_0x461d31]+'='+encodeURIComponent(_0x5ade46[_0x351ba2[_0x461d31]]);_0x4de495+=_0x5ade46[_0x351ba2[_0x461d31]];}_0x4de495+=_0x5b5749['apiKey'];_0x4de495=_0x507cef[_0xe7d0('0x60')]('md5')[_0xe7d0('0x24')](_0x4de495)[_0xe7d0('0x61')]('hex');if(_0x23be41!==''){_0x23be41+='&';}_0x23be41+=_0xe7d0('0x62')+_0x4de495;var _0x4324b3={'method':_0xe7d0('0x2f'),'uri':_0x5b5749[_0xe7d0('0x51')]+_0xe7d0('0x63')+_0x23be41,'json':!![]};return rp(_0x4324b3)[_0xe7d0('0x13')](function(_0x362e42){var _0x1cf9e6=Object[_0xe7d0('0x5e')](_0x362e42);if(_0x362e42[_0x1cf9e6[0x0]]['error']&&parseInt(_0x362e42[_0x1cf9e6[0x0]][_0xe7d0('0x16')])===0x0){var _0x5e588f={'messageId':_0x362e42[_0x1cf9e6[0x0]][_0xe7d0('0x64')]};if(!_0x5b5749[_0xe7d0('0x35')]){_0x5e588f['read']=!![];}return _0x98f3a5[_0xe7d0('0x24')](_0x5e588f);}else{return logger[_0xe7d0('0x16')](_0xe7d0('0x25'),'afterCreate',_0xe7d0('0x59'),util[_0xe7d0('0x27')](_0x362e42[_0xe7d0('0x16')],{'showHidden':![],'depth':null}));}})[_0xe7d0('0x15')](function(_0x31cc87){return logger['error'](_0xe7d0('0x25'),'afterCreate',_0xe7d0('0x59'),util[_0xe7d0('0x27')](_0x31cc87,{'showHidden':![],'depth':null}));});}else{logger[_0xe7d0('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7d0('0x26'),_0xe7d0('0x59'),_0xe7d0('0x65'));}break;case _0xe7d0('0x66'):if(_0x5b5749[_0xe7d0('0x5b')]){var _0x511ea4={'method':_0xe7d0('0x41'),'uri':_0xe7d0('0x67'),'headers':{'Authorization':_0x5b5749['apiKey']},'body':{'content':_0xa79540['body'],'to':[_0xa79540[_0xe7d0('0x1f')]],'from':_0x5b5749[_0xe7d0('0x1f')],'binary':![],'clientMessageId':_0xe7d0('0x68'),'charset':_0xe7d0('0x69')},'json':!![]};rp(_0x511ea4)[_0xe7d0('0x13')](function(_0x3abe24){if(!_0x3abe24[_0xe7d0('0x16')]){var _0x34f2c9={'messageId':_0x3abe24[_0xe7d0('0x56')][0x0][_0xe7d0('0x6a')]};if(!_0x5b5749[_0xe7d0('0x35')]){_0x34f2c9[_0xe7d0('0x3b')]=!![];}return _0x98f3a5[_0xe7d0('0x24')](_0x34f2c9);}else{return logger[_0xe7d0('0x16')](_0xe7d0('0x25'),'afterCreate',_0xe7d0('0x66'),util[_0xe7d0('0x27')](_0x3abe24[_0xe7d0('0x16')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x837f6d){return logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),'clickatell',util['inspect'](_0x837f6d,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7d0('0x26'),_0xe7d0('0x66'),_0xe7d0('0x65'));}break;case _0xe7d0('0x6b'):if(_0x5b5749[_0xe7d0('0x5b')]){var _0x4405fb={};var _0x4324b3={'method':_0xe7d0('0x41'),'uri':_0xe7d0('0x6c'),'headers':{'Authorization':_0xe7d0('0x6d')+_0x5b5749[_0xe7d0('0x5b')],'Content-Type':'application/json'},'body':{'from':_0x5b5749[_0xe7d0('0x1f')],'to':_0xa79540[_0xe7d0('0x1f')],'text':_0xa79540['body']},'json':!![]};return rp(_0x4324b3)[_0xe7d0('0x13')](function(_0x1ffb2d){if(_0x1ffb2d[_0xe7d0('0x6e')]==0xca){_0x4405fb[_0xe7d0('0x6f')]=_0x1ffb2d;var _0xa1caee={'method':'POST','uri':_0xe7d0('0x70'),'headers':{'Authorization':_0xe7d0('0x6d')+_0x5b5749[_0xe7d0('0x5b')],'Content-Type':_0xe7d0('0x54')},'body':{'refid':_0x4405fb['message'][_0xe7d0('0x71')]},'json':!![]};return rp(_0xa1caee)['then'](function(_0x5a09ec){_0x4405fb[_0xe7d0('0x72')]=_0x5a09ec;var _0x5e6676={'messageId':_0x4405fb[_0xe7d0('0x6f')][_0xe7d0('0x71')],'read':!![]};return _0x98f3a5[_0xe7d0('0x24')](_0x5e6676);});}else{return logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),'intelepeer',util['inspect'](_0x1ffb2d,{'showHidden':![],'depth':null}));}})[_0xe7d0('0x15')](function(_0xce79ad){return logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x6b'),util[_0xe7d0('0x27')](_0xce79ad,{'showHidden':![],'depth':null}));});}else{return logger[_0xe7d0('0x16')](_0xe7d0('0x25'),_0xe7d0('0x26'),_0xe7d0('0x6b'),_0xe7d0('0x73'));}break;}}})[_0xe7d0('0x74')](function(){_0x368e4f();});}else{_0x368e4f();}}},'charset':_0xe7d0('0x75'),'collate':_0xe7d0('0x76')});}; \ No newline at end of file +var _0x6d1b=['user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','senderString','POST','https://smsapi.connectel.se/api/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','toString','base64','http_code','queued_count','data','message_id','clickSend','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','plivo','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteraction','SmsInteractionId','then','update','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','/api/sms/messages/','/status?token=','token','sid','inspect','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms'];(function(_0x142e7b,_0x56c7c1){var _0xf91352=function(_0x161ab7){while(--_0x161ab7){_0x142e7b['push'](_0x142e7b['shift']());}};_0xf91352(++_0x56c7c1);}(_0x6d1b,0x132));var _0xb6d1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6d1b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb6d1('0x0'));var util=require(_0xb6d1('0x1'));var logger=require(_0xb6d1('0x2'))(_0xb6d1('0x3'));var moment=require('moment');var BPromise=require(_0xb6d1('0x4'));var rp=require(_0xb6d1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb6d1('0x6'));var config=require('../../config/environment');var attributes=require(_0xb6d1('0x7'));module[_0xb6d1('0x8')]=function(_0x536e38,_0x3fb285){return _0x536e38['define'](_0xb6d1('0x9'),attributes,{'tableName':_0xb6d1('0xa'),'paranoid':![],'indexes':[{'name':_0xb6d1('0xb'),'fields':[_0xb6d1('0xb')]},{'name':_0xb6d1('0xc'),'fields':[_0xb6d1('0xd')],'type':_0xb6d1('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e83f5,_0x2cd5ac,_0x466102){var _0x3053e7=_0x536e38[_0xb6d1('0xf')];var _0x1759ca=_0x5e83f5[_0xb6d1('0x10')]({'plain':!![]});if(_0x1759ca['direction']['toLowerCase']()==='in'||_0x1759ca[_0xb6d1('0x11')][_0xb6d1('0x12')]()===_0xb6d1('0x13')&&!_0x1759ca[_0xb6d1('0x14')]&&!_[_0xb6d1('0x15')](_0x1759ca['UserId'])){_0x3053e7[_0xb6d1('0x16')]['findOne']({'where':{'id':_0x1759ca[_0xb6d1('0x17')]}})[_0xb6d1('0x18')](function(_0x5b638d){if(_0x5b638d){_0x5b638d[_0xb6d1('0x19')]({'lastMsgAt':_0x1759ca['createdAt'],'lastMsgDirection':_0x1759ca[_0xb6d1('0x11')][_0xb6d1('0x12')]()});}})[_0xb6d1('0x1a')](function(_0x5c231a){console['error'](_0x5c231a);});}if(_0x1759ca['direction']===_0xb6d1('0x13')&&!_0x1759ca[_0xb6d1('0x14')]){var _0x1064df;_0x3053e7[_0xb6d1('0x1b')][_0xb6d1('0x1c')]({'where':{'id':_0x1759ca[_0xb6d1('0x1d')]},'raw':!![]})[_0xb6d1('0x18')](function(_0x3d7410){_0x1064df=_0x3d7410;if(_0x1064df&&_0x1064df[_0xb6d1('0x1e')]){switch(_0x1064df['type']){case _0xb6d1('0x1f'):var _0x4a6953=require(_0xb6d1('0x1f'));if(_0x1064df[_0xb6d1('0x20')]&&_0x1064df[_0xb6d1('0x21')]&&_0x1064df[_0xb6d1('0x22')]){var _0x5dcd9a=new _0x4a6953(_0x1064df['accountSid'],_0x1064df[_0xb6d1('0x21')]);_0x5dcd9a[_0xb6d1('0x23')][_0xb6d1('0x24')]({'body':_0x1759ca[_0xb6d1('0xd')],'to':_0x1759ca[_0xb6d1('0x22')],'from':_0x1064df[_0xb6d1('0x22')],'statusCallback':_0x1064df['remote']+_0xb6d1('0x25')+_0x1759ca['id']+_0xb6d1('0x26')+_0x1064df[_0xb6d1('0x27')]})[_0xb6d1('0x18')](function(_0x1a6c01){if(_0x1a6c01[_0xb6d1('0x28')]){return _0x5e83f5['update']({'messageId':_0x1a6c01[_0xb6d1('0x28')]});}})[_0xb6d1('0x1a')](function(_0x2f9ebd){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb6d1('0x1f'),util[_0xb6d1('0x29')](_0x2f9ebd,{'showHidden':![],'depth':null}));});}else{logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x3ba489=_0xb6d1('0x2d');if(_0x1064df[_0xb6d1('0x2e')]&&_0x1064df[_0xb6d1('0x2f')]){var _0x3bb840={'recipient':[_0x1759ca['phone']],'message':_0x1759ca[_0xb6d1('0xd')],'message_type':_0x1064df[_0xb6d1('0x30')]};if(_0x1064df[_0xb6d1('0x30')]&&_0x1064df[_0xb6d1('0x30')]!=='SI'){_0x3bb840['sender']=_0x1064df['phone'];}var _0xbef674={'url':_0x3ba489+_0xb6d1('0x31')+_0x1064df[_0xb6d1('0x2e')]+_0xb6d1('0x32')+_0x1064df['password'],'method':_0xb6d1('0x33')};rp(_0xbef674)[_0xb6d1('0x18')](function(_0x3ddc8b){var _0x14bdf7=_0x3ddc8b[_0xb6d1('0x34')](';');var _0x10d760={'user_key':_0x14bdf7[0x0],'session_key':_0x14bdf7[0x1]};_0xbef674={'url':_0x3ba489+_0xb6d1('0x35'),'method':'POST','headers':{'user_key':_0x10d760[_0xb6d1('0x36')],'Session_key':_0x10d760[_0xb6d1('0x37')]},'json':!![],'body':_0x3bb840};return rp(_0xbef674);})['then'](function(_0x2fa4e0){if(_0x2fa4e0[_0xb6d1('0x38')]>=0x1){var _0xcb01ca={'messageId':_0x2fa4e0[_0xb6d1('0x39')]};if(_0x1064df[_0xb6d1('0x30')]!=='GP'||!_0x1064df[_0xb6d1('0x3a')]){_0xcb01ca[_0xb6d1('0x3b')]=!![];}return _0x5e83f5[_0xb6d1('0x19')](_0xcb01ca);}else{return logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x3c'),util[_0xb6d1('0x29')](_0x2fa4e0,{'showHidden':![],'depth':null}));}})[_0xb6d1('0x1a')](function(_0x51357e){return logger['error'](_0xb6d1('0x2b'),'afterCreate',_0xb6d1('0x3c'),util[_0xb6d1('0x29')](_0x51357e,{'showHidden':![],'depth':null}));});}else{logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),'skebby',_0xb6d1('0x3d'));}break;case'connectel':if(_0x1064df[_0xb6d1('0x21')]){var _0x3a95d8={'recipient':_0x1759ca['phone'],'message':_0x1759ca['body'],'sender':_0x1064df[_0xb6d1('0x3e')]||_0x1064df[_0xb6d1('0x22')],'authorization':_0x1064df[_0xb6d1('0x21')]};var _0x2cd5ac={'method':_0xb6d1('0x3f'),'uri':_0xb6d1('0x40'),'body':_0x3a95d8,'json':!![]};rp(_0x2cd5ac)['then'](function(_0x5ec85b){var _0x57ec11={'messageId':_0x5ec85b[_0xb6d1('0x41')]};if(!_0x1064df[_0xb6d1('0x3a')]){_0x57ec11[_0xb6d1('0x3b')]=!![];}return _0x5e83f5['update'](_0x57ec11);})[_0xb6d1('0x1a')](function(_0x5242d1){logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x42'),util[_0xb6d1('0x29')](_0x5242d1,{'showHidden':![],'depth':null}));});}else{logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),'connectel',_0xb6d1('0x43'));}break;case _0xb6d1('0x44'):if(_0x1064df[_0xb6d1('0x2e')]&&_0x1064df[_0xb6d1('0x2f')]){var _0x3a95d8={'messages':[{'source':_0xb6d1('0x45'),'to':_0x1759ca['phone'],'body':_0x1759ca[_0xb6d1('0xd')],'from':_0x1064df[_0xb6d1('0x3e')]||_0x1064df[_0xb6d1('0x22')]}]};var _0x428d28=util[_0xb6d1('0x46')](_0xb6d1('0x47'),_0x1064df[_0xb6d1('0x2e')],_0x1064df[_0xb6d1('0x2f')]);var _0x2cd5ac={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x3a95d8,'headers':{'Authorization':util[_0xb6d1('0x46')]('Basic\x20%s',new Buffer(_0x428d28)[_0xb6d1('0x48')](_0xb6d1('0x49')))},'json':!![]};rp(_0x2cd5ac)[_0xb6d1('0x18')](function(_0x43b699){if(_0x43b699['http_code']>=0xc8&&_0x43b699[_0xb6d1('0x4a')]<=0xce){if(_0x43b699['data']&&_0x43b699['data'][_0xb6d1('0x4b')]>0x0){var _0xbcdb76=_['head'](_0x43b699[_0xb6d1('0x4c')][_0xb6d1('0x23')]);var _0x5b91f1={'messageId':_0xbcdb76[_0xb6d1('0x4d')]};if(!_0x1064df[_0xb6d1('0x3a')]){_0x5b91f1[_0xb6d1('0x3b')]=!![];}return _0x5e83f5[_0xb6d1('0x19')](_0x5b91f1);}else{logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),'clickSend',util[_0xb6d1('0x29')](_0x43b699,{'showHidden':![],'depth':null}));}}else{logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x4e'),util['inspect'](_0x43b699,{'showHidden':![],'depth':null}));}})['catch'](function(_0x194a88){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb6d1('0x2c'),_0xb6d1('0x4e'),util['inspect'](_0x194a88,{'showHidden':![],'depth':null}));});}else{logger[_0xb6d1('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',_0xb6d1('0x3d'));}break;case'plivo':if(_0x1064df[_0xb6d1('0x4f')]&&_0x1064df[_0xb6d1('0x21')]){var _0x3a95d8={'dst':_0x1759ca[_0xb6d1('0x22')],'text':_0x1759ca[_0xb6d1('0xd')],'src':_0x1064df[_0xb6d1('0x3e')]||_0x1064df[_0xb6d1('0x22')],'url':_0x1064df[_0xb6d1('0x50')]+_0xb6d1('0x25')+_0x1759ca['id']+_0xb6d1('0x26')+_0x1064df[_0xb6d1('0x27')]};var _0x428d28=util[_0xb6d1('0x46')](_0xb6d1('0x47'),_0x1064df['authId'],_0x1064df[_0xb6d1('0x21')]);var _0x2cd5ac={'method':_0xb6d1('0x3f'),'uri':util['format'](_0xb6d1('0x51'),_0x1064df[_0xb6d1('0x4f')]),'body':_0x3a95d8,'headers':{'Authorization':util[_0xb6d1('0x46')](_0xb6d1('0x52'),new Buffer(_0x428d28)[_0xb6d1('0x48')](_0xb6d1('0x49')))},'json':!![]};rp(_0x2cd5ac)[_0xb6d1('0x18')](function(_0x13d214){var _0x3c9272={'messageId':_0x13d214[_0xb6d1('0x53')][0x0]};return _0x5e83f5[_0xb6d1('0x19')](_0x3c9272);})[_0xb6d1('0x1a')](function(_0x55540a){logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x54'),util[_0xb6d1('0x29')](_0x55540a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x54'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xb6d1('0x55'):if(_0x1064df[_0xb6d1('0x2e')]&&_0x1064df['password']){if(_0x1064df[_0xb6d1('0x56')]){var _0x3be87a={'method':_0xb6d1('0x3f'),'uri':_0x1064df['baseUrl']+_0xb6d1('0x57'),'body':{'username':_0x1064df[_0xb6d1('0x2e')],'password':_0x1064df[_0xb6d1('0x2f')]},'json':!![]};return rp(_0x3be87a)['then'](function(_0x103f39){var _0x340471={'method':_0xb6d1('0x3f'),'uri':_0x1064df[_0xb6d1('0x56')]+_0xb6d1('0x58'),'body':{'messages':[{'from':_0x1064df['phone'],'destinations':[{'to':_0x1759ca[_0xb6d1('0x22')]}],'text':_0x1759ca[_0xb6d1('0xd')],'notifyUrl':_0x1064df[_0xb6d1('0x50')]+_0xb6d1('0x25')+_0x1759ca['id']+'/status?token='+_0x1064df[_0xb6d1('0x27')],'notifyContentType':_0xb6d1('0x59'),'callbackData':_0x1064df[_0xb6d1('0x22')]+';'+_0x1759ca[_0xb6d1('0xd')]}]},'headers':{'Authorization':_0xb6d1('0x5a')+_0x103f39[_0xb6d1('0x27')]},'json':!![]};return rp(_0x340471)['then'](function(_0x4d727f){if(_0x4d727f[_0xb6d1('0x23')]){var _0x439530={'messageId':_0x4d727f[_0xb6d1('0x23')][0x0]['messageId']};if(!_0x1064df[_0xb6d1('0x3a')]){_0x439530['read']=!![];}return _0x5e83f5['update'](_0x439530);}else{return logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x55'),util[_0xb6d1('0x29')](_0x4d727f,{'showHidden':![],'depth':null}));}});})[_0xb6d1('0x1a')](function(_0xf4bbb9){return logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),'infobip',util[_0xb6d1('0x29')](_0xf4bbb9,{'showHidden':![],'depth':null}));});}else{logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),'afterCreate','infobip',_0xb6d1('0x5b'));}}else{logger[_0xb6d1('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb6d1('0x2c'),_0xb6d1('0x55'),_0xb6d1('0x3d'));}break;case _0xb6d1('0x5c'):var _0x1f344b=require('crypto');if(_0x1064df[_0xb6d1('0x5d')]){var _0x34385b={};_0x34385b[_0xb6d1('0x5e')]=_0x1064df[_0xb6d1('0x2e')];_0x34385b[_0xb6d1('0x22')]=_0x1759ca[_0xb6d1('0x22')];_0x34385b['sender']=_0x1064df[_0xb6d1('0x22')];_0x34385b['text']=_0x1759ca[_0xb6d1('0xd')];_0x34385b['timestamp']=+new Date();var _0x17375c='';var _0x3b2eb8='';var _0x1b3d7a=Object[_0xb6d1('0x5f')](_0x34385b);_0x1b3d7a[_0xb6d1('0x60')]();for(var _0xbba907=0x0;_0xbba907<_0x1b3d7a[_0xb6d1('0x61')];_0xbba907++){if(_0x17375c!=''){_0x17375c+='&';}_0x17375c+=_0x1b3d7a[_0xbba907]+'='+encodeURIComponent(_0x34385b[_0x1b3d7a[_0xbba907]]);_0x3b2eb8+=_0x34385b[_0x1b3d7a[_0xbba907]];}_0x3b2eb8+=_0x1064df[_0xb6d1('0x5d')];_0x3b2eb8=_0x1f344b[_0xb6d1('0x62')](_0xb6d1('0x63'))[_0xb6d1('0x19')](_0x3b2eb8)[_0xb6d1('0x64')](_0xb6d1('0x65'));if(_0x17375c!==''){_0x17375c+='&';}_0x17375c+=_0xb6d1('0x66')+_0x3b2eb8;var _0xbef674={'method':_0xb6d1('0x33'),'uri':_0x1064df[_0xb6d1('0x56')]+_0xb6d1('0x67')+_0x17375c,'json':!![]};return rp(_0xbef674)[_0xb6d1('0x18')](function(_0x43cf07){var _0x5f5219=Object['keys'](_0x43cf07);if(_0x43cf07[_0x5f5219[0x0]][_0xb6d1('0x2a')]&&parseInt(_0x43cf07[_0x5f5219[0x0]][_0xb6d1('0x2a')])===0x0){var _0x367699={'messageId':_0x43cf07[_0x5f5219[0x0]][_0xb6d1('0x68')]};if(!_0x1064df[_0xb6d1('0x3a')]){_0x367699[_0xb6d1('0x3b')]=!![];}return _0x5e83f5[_0xb6d1('0x19')](_0x367699);}else{return logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),'afterCreate','csc',util[_0xb6d1('0x29')](_0x43cf07[_0xb6d1('0x2a')],{'showHidden':![],'depth':null}));}})[_0xb6d1('0x1a')](function(_0x3bf887){return logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),'afterCreate','csc',util['inspect'](_0x3bf887,{'showHidden':![],'depth':null}));});}else{logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),'csc','Missing\x20parameters:\x20apiKey');}break;case _0xb6d1('0x69'):if(_0x1064df['apiKey']){var _0x13ca28={'method':_0xb6d1('0x3f'),'uri':_0xb6d1('0x6a'),'headers':{'Authorization':_0x1064df[_0xb6d1('0x5d')]},'body':{'content':_0x1759ca[_0xb6d1('0xd')],'to':[_0x1759ca[_0xb6d1('0x22')]],'from':_0x1064df[_0xb6d1('0x22')],'binary':![],'clientMessageId':_0xb6d1('0x6b'),'charset':'UTF-8'},'json':!![]};rp(_0x13ca28)['then'](function(_0x52b303){if(!_0x52b303[_0xb6d1('0x2a')]){var _0x3b0f3a={'messageId':_0x52b303['messages'][0x0][_0xb6d1('0x6c')]};if(!_0x1064df[_0xb6d1('0x3a')]){_0x3b0f3a[_0xb6d1('0x3b')]=!![];}return _0x5e83f5[_0xb6d1('0x19')](_0x3b0f3a);}else{return logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),'clickatell',util[_0xb6d1('0x29')](_0x52b303[_0xb6d1('0x2a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x23acc2){return logger['error'](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x69'),util['inspect'](_0x23acc2,{'showHidden':![],'depth':null}));});}else{logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x69'),_0xb6d1('0x6d'));}break;case _0xb6d1('0x6e'):if(_0x1064df[_0xb6d1('0x5d')]){var _0x28b1cc={};var _0xbef674={'method':_0xb6d1('0x3f'),'uri':_0xb6d1('0x6f'),'headers':{'Authorization':_0xb6d1('0x70')+_0x1064df[_0xb6d1('0x5d')],'Content-Type':_0xb6d1('0x59')},'body':{'from':_0x1064df[_0xb6d1('0x22')],'to':_0x1759ca[_0xb6d1('0x22')],'text':_0x1759ca[_0xb6d1('0xd')]},'json':!![]};return rp(_0xbef674)['then'](function(_0x9ed41b){if(_0x9ed41b['code']==0xca){_0x28b1cc[_0xb6d1('0x71')]=_0x9ed41b;var _0x9c5db7={'method':_0xb6d1('0x3f'),'uri':_0xb6d1('0x72'),'headers':{'Authorization':_0xb6d1('0x70')+_0x1064df[_0xb6d1('0x5d')],'Content-Type':_0xb6d1('0x59')},'body':{'refid':_0x28b1cc[_0xb6d1('0x71')][_0xb6d1('0x73')]},'json':!![]};return rp(_0x9c5db7)['then'](function(_0x5f45a9){_0x28b1cc[_0xb6d1('0x74')]=_0x5f45a9;var _0x2fc9f5={'messageId':_0x28b1cc['message'][_0xb6d1('0x73')],'read':!![]};return _0x5e83f5['update'](_0x2fc9f5);});}else{return logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x6e'),util['inspect'](_0x9ed41b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3bfd39){return logger[_0xb6d1('0x2a')](_0xb6d1('0x2b'),_0xb6d1('0x2c'),_0xb6d1('0x6e'),util[_0xb6d1('0x29')](_0x3bfd39,{'showHidden':![],'depth':null}));});}else{return logger[_0xb6d1('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb6d1('0x6e'),_0xb6d1('0x75'));}break;}}})[_0xb6d1('0x76')](function(){_0x466102();});}else{_0x466102();}}},'charset':'utf8mb4','collate':_0xb6d1('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 55e7c16..50b20e8 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 _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body'];(function(_0xe06e68,_0x503c3c){var _0x199e22=function(_0x3423c7){while(--_0x3423c7){_0xe06e68['push'](_0xe06e68['shift']());}};_0x199e22(++_0x503c3c);}(_0xb10b,0x12a));var _0xbb10=function(_0x3eff21,_0x5bf36c){_0x3eff21=_0x3eff21-0x0;var _0x1945bb=_0xb10b[_0x3eff21];return _0x1945bb;};'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')]('SmsMessage,\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')]('SmsMessage,\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')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});}; \ No newline at end of file +var _0x2032=['register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','error','message','info','result','CreateSmsMessage','create','options','then','stringify','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x2032,0xd9));var _0x2203=function(_0x478c2f,_0x53a317){_0x478c2f=_0x478c2f-0x0;var _0x4102fc=_0x2032[_0x478c2f];return _0x4102fc;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});config[_0x2203('0xb')]=_[_0x2203('0xc')](config[_0x2203('0xb')],{'host':_0x2203('0xd'),'port':0x18eb});var socket=require(_0x2203('0xe'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x2203('0xf')](socket);function respondWithRpcPromise(_0x549908,_0x27081c,_0x2972f3){return new BPromise(function(_0x6339c4,_0x5b19df){return client[_0x2203('0x10')](_0x549908,_0x2972f3)['then'](function(_0x3f690a){logger['info'](_0x2203('0x11'),_0x27081c,_0x2203('0x12'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27081c,'request\x20sent',JSON['stringify'](_0x3f690a));if(_0x3f690a['error']){if(_0x3f690a[_0x2203('0x13')]['code']===0x1f4){logger['error'](_0x2203('0x11'),_0x27081c,_0x3f690a[_0x2203('0x13')][_0x2203('0x14')]);return _0x5b19df(_0x3f690a[_0x2203('0x13')][_0x2203('0x14')]);}logger[_0x2203('0x13')](_0x2203('0x11'),_0x27081c,_0x3f690a[_0x2203('0x13')][_0x2203('0x14')]);return _0x6339c4(_0x3f690a[_0x2203('0x13')]['message']);}else{logger[_0x2203('0x15')](_0x2203('0x11'),_0x27081c,'request\x20sent');_0x6339c4(_0x3f690a[_0x2203('0x16')][_0x2203('0x14')]);}})['catch'](function(_0x30c6f7){logger['error'](_0x2203('0x11'),_0x27081c,_0x30c6f7);_0x5b19df(_0x30c6f7);});});}exports[_0x2203('0x17')]=function(_0x3c8c34){var _0x3b4034=this;return new Promise(function(_0x15cb1a,_0x449039){return db['SmsMessage'][_0x2203('0x18')](_0x3c8c34['body'],{'raw':_0x3c8c34['options']?_0x3c8c34[_0x2203('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2203('0x1a')](function(_0x5bfe61){logger['info'](_0x2203('0x17'),_0x3c8c34);logger['debug']('CreateSmsMessage',_0x3c8c34,JSON[_0x2203('0x1b')](_0x5bfe61));_0x15cb1a(_0x5bfe61);})[_0x2203('0x1c')](function(_0x21f930){logger[_0x2203('0x13')](_0x2203('0x17'),_0x21f930[_0x2203('0x14')],_0x3c8c34);_0x449039(_0x3b4034[_0x2203('0x13')](0x1f4,_0x21f930[_0x2203('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index e6bafc4..e38e1e3 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 _0x295c=['update','emit','removeListener','register','./smsMessage.events','save','remove'];(function(_0x479ff4,_0x424734){var _0x546951=function(_0x9f141b){while(--_0x9f141b){_0x479ff4['push'](_0x479ff4['shift']());}};_0x546951(++_0x424734);}(_0x295c,0x14d));var _0xc295=function(_0x48d125,_0x6577fb){_0x48d125=_0x48d125-0x0;var _0x21a61a=_0x295c[_0x48d125];return _0x21a61a;};'use strict';var SmsMessageEvents=require(_0xc295('0x0'));var events=[_0xc295('0x1'),_0xc295('0x2'),_0xc295('0x3')];function createListener(_0x3ae694,_0x540fdb){return function(_0x5b3e14){_0x540fdb[_0xc295('0x4')](_0x3ae694,_0x5b3e14);};}function removeListener(_0x5f1626,_0x45cdb6){return function(){SmsMessageEvents[_0xc295('0x5')](_0x5f1626,_0x45cdb6);};}exports[_0xc295('0x6')]=function(_0x32a718){for(var _0x2722fc=0x0,_0x2c3ed0=events['length'];_0x2722fc<_0x2c3ed0;_0x2722fc++){var _0x32cb92=events[_0x2722fc];var _0x30efe9=createListener('smsMessage:'+_0x32cb92,_0x32a718);SmsMessageEvents['on'](_0x32cb92,_0x30efe9);}}; \ No newline at end of file +var _0x9e14=['./smsMessage.events','save','remove','update','emit','register','smsMessage:'];(function(_0x4debc9,_0x5b30a2){var _0x24b133=function(_0x4cf989){while(--_0x4cf989){_0x4debc9['push'](_0x4debc9['shift']());}};_0x24b133(++_0x5b30a2);}(_0x9e14,0xe7));var _0x49e1=function(_0xbbc7a4,_0x4db0c9){_0xbbc7a4=_0xbbc7a4-0x0;var _0x1de7bb=_0x9e14[_0xbbc7a4];return _0x1de7bb;};'use strict';var SmsMessageEvents=require(_0x49e1('0x0'));var events=[_0x49e1('0x1'),_0x49e1('0x2'),_0x49e1('0x3')];function createListener(_0x1cf762,_0x1d00e1){return function(_0x2a8cf7){_0x1d00e1[_0x49e1('0x4')](_0x1cf762,_0x2a8cf7);};}function removeListener(_0x74c39d,_0x166007){return function(){SmsMessageEvents['removeListener'](_0x74c39d,_0x166007);};}exports[_0x49e1('0x5')]=function(_0x5dcb6a){for(var _0x4900be=0x0,_0x30a2e5=events['length'];_0x4900be<_0x30a2e5;_0x4900be++){var _0x5bc460=events[_0x4900be];var _0xc10343=createListener(_0x49e1('0x6')+_0x5bc460,_0x5dcb6a);SmsMessageEvents['on'](_0x5bc460,_0xc10343);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 3e516ad..017727b 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 _0xae30=['show','getMembers','getTeams','/:id/users','post','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x32b762,_0x49f452){var _0x57b02e=function(_0x4a3878){while(--_0x4a3878){_0x32b762['push'](_0x32b762['shift']());}};_0x57b02e(++_0x49f452);}(_0xae30,0x10a));var _0x0ae3=function(_0x81dae,_0x4437c9){_0x81dae=_0x81dae-0x0;var _0x2cab87=_0xae30[_0x81dae];return _0x2cab87;};'use strict';var multer=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var path=require(_0x0ae3('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae3('0x3'));var router=express[_0x0ae3('0x4')]();var auth=require(_0x0ae3('0x5'));var interaction=require(_0x0ae3('0x6'));var config=require('../../config/environment');var controller=require(_0x0ae3('0x7'));router[_0x0ae3('0x8')]('/',auth[_0x0ae3('0x9')](),controller[_0x0ae3('0xa')]);router[_0x0ae3('0x8')](_0x0ae3('0xb'),auth[_0x0ae3('0x9')](),controller[_0x0ae3('0xc')]);router[_0x0ae3('0x8')](_0x0ae3('0xd'),auth[_0x0ae3('0x9')](),controller[_0x0ae3('0xe')]);router[_0x0ae3('0x8')]('/:id/members',auth[_0x0ae3('0x9')](),controller[_0x0ae3('0xf')]);router['get']('/:id/teams',auth[_0x0ae3('0x9')](),controller[_0x0ae3('0x10')]);router[_0x0ae3('0x8')](_0x0ae3('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0ae3('0x12')]('/',auth[_0x0ae3('0x9')](),controller['create']);router['post'](_0x0ae3('0x13'),auth['isAuthenticated'](),controller[_0x0ae3('0x14')]);router[_0x0ae3('0x12')](_0x0ae3('0x11'),auth[_0x0ae3('0x9')](),controller[_0x0ae3('0x15')]);router[_0x0ae3('0x16')](_0x0ae3('0xd'),auth['isAuthenticated'](),controller[_0x0ae3('0x17')]);router['delete'](_0x0ae3('0xd'),auth[_0x0ae3('0x9')](),controller[_0x0ae3('0x18')]);router[_0x0ae3('0x19')](_0x0ae3('0x13'),auth[_0x0ae3('0x9')](),controller[_0x0ae3('0x1a')]);router[_0x0ae3('0x19')](_0x0ae3('0x11'),auth['isAuthenticated'](),controller[_0x0ae3('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xa786=['exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents'];(function(_0x386700,_0x17cbf7){var _0x16a3ab=function(_0x1f96e6){while(--_0x1f96e6){_0x386700['push'](_0x386700['shift']());}};_0x16a3ab(++_0x17cbf7);}(_0xa786,0x71));var _0x6a78=function(_0x54d9c1,_0x5319ba){_0x54d9c1=_0x54d9c1-0x0;var _0x5559de=_0xa786[_0x54d9c1];return _0x5559de;};'use strict';var multer=require(_0x6a78('0x0'));var util=require(_0x6a78('0x1'));var path=require(_0x6a78('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a78('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6a78('0x4'));var config=require(_0x6a78('0x5'));var controller=require(_0x6a78('0x6'));router[_0x6a78('0x7')]('/',auth[_0x6a78('0x8')](),controller[_0x6a78('0x9')]);router[_0x6a78('0x7')]('/describe',auth[_0x6a78('0x8')](),controller[_0x6a78('0xa')]);router[_0x6a78('0x7')](_0x6a78('0xb'),auth[_0x6a78('0x8')](),controller[_0x6a78('0xc')]);router[_0x6a78('0x7')](_0x6a78('0xd'),auth[_0x6a78('0x8')](),controller['getMembers']);router[_0x6a78('0x7')](_0x6a78('0xe'),auth[_0x6a78('0x8')](),controller['getTeams']);router[_0x6a78('0x7')](_0x6a78('0xf'),auth[_0x6a78('0x8')](),controller[_0x6a78('0x10')]);router[_0x6a78('0x11')]('/',auth['isAuthenticated'](),controller[_0x6a78('0x12')]);router[_0x6a78('0x11')](_0x6a78('0xe'),auth['isAuthenticated'](),controller[_0x6a78('0x13')]);router[_0x6a78('0x11')]('/:id/users',auth[_0x6a78('0x8')](),controller[_0x6a78('0x14')]);router[_0x6a78('0x15')](_0x6a78('0xb'),auth[_0x6a78('0x8')](),controller[_0x6a78('0x16')]);router['delete'](_0x6a78('0xb'),auth[_0x6a78('0x8')](),controller[_0x6a78('0x17')]);router[_0x6a78('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6a78('0x19')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x6a78('0x1a')]);module[_0x6a78('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index ba72aee..da48439 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 _0xe2f7=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0xd235a,_0x36f794){var _0x2a00aa=function(_0x4a75f4){while(--_0x4a75f4){_0xd235a['push'](_0xd235a['shift']());}};_0x2a00aa(++_0x36f794);}(_0xe2f7,0x19f));var _0x7e2f=function(_0x510f18,_0x42e24d){_0x510f18=_0x510f18-0x0;var _0xc33c72=_0xe2f7[_0x510f18];return _0xc33c72;};'use strict';var Sequelize=require('sequelize');module[_0x7e2f('0x0')]={'name':{'type':Sequelize[_0x7e2f('0x1')],'unique':_0x7e2f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7e2f('0x1')]},'timeout':{'type':Sequelize[_0x7e2f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7e2f('0x4'),_0x7e2f('0x5'),_0x7e2f('0x6'))}}; \ No newline at end of file +var _0x5e94=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x2710ca,_0x1ebe93){var _0x53df6e=function(_0x6690fc){while(--_0x6690fc){_0x2710ca['push'](_0x2710ca['shift']());}};_0x53df6e(++_0x1ebe93);}(_0x5e94,0xb2));var _0x45e9=function(_0x587602,_0x38bffb){_0x587602=_0x587602-0x0;var _0x5f54f7=_0x5e94[_0x587602];return _0x5f54f7;};'use strict';var Sequelize=require(_0x45e9('0x0'));module[_0x45e9('0x1')]={'name':{'type':Sequelize[_0x45e9('0x2')],'unique':_0x45e9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x45e9('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x45e9('0x4')](_0x45e9('0x5'),'beepall',_0x45e9('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b092a25..72d608e 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','count','offset','reject','save','update','then','destroy','get','SmsQueues','error','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','filters','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','params','describe','getMembers','findOne','keys','UserSmsQueue','hasOwnProperty','SmsQueueId','User','agent','smsPause','updatedAt','rows','format','SIP','createdAt','getTeams','Team','addTeams','Agents','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','select','team_has_sms_queues','join','user_has_teams','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x314e4d,_0x3bd63c){var _0x43b1fc=function(_0x13f48c){while(--_0x13f48c){_0x314e4d['push'](_0x314e4d['shift']());}};_0x43b1fc(++_0x3bd63c);}(_0x1967,0x173));var _0x7196=function(_0x56a5aa,_0x1245aa){_0x56a5aa=_0x56a5aa-0x0;var _0x59463e=_0x1967[_0x56a5aa];return _0x59463e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];config[_0x7196('0x1a')]=_[_0x7196('0x1b')](config[_0x7196('0x1a')],{'host':_0x7196('0x1c'),'port':0x18eb});var socket=require(_0x7196('0x1d'))(new Redis(config['redis']));require(_0x7196('0x1e'))[_0x7196('0x1f')](socket);function respondWithStatusCode(_0x3545aa,_0xf098c1){_0xf098c1=_0xf098c1||0xcc;return function(_0x511aa1){if(_0x511aa1){return _0x3545aa[_0x7196('0x20')](_0xf098c1);}return _0x3545aa['status'](_0xf098c1)[_0x7196('0x21')]();};}function respondWithResult(_0x2590a6,_0xf7e97){_0xf7e97=_0xf7e97||0xc8;return function(_0x3ed1ad){if(_0x3ed1ad){return _0x2590a6[_0x7196('0x22')](_0xf7e97)[_0x7196('0x23')](_0x3ed1ad);}};}function respondWithFilteredResult(_0x22bd62,_0x1ed296){return function(_0x3e4e69){if(_0x3e4e69){var _0x32fe2b=_0x3e4e69[_0x7196('0x24')],_0x385f2d=_0x1ed296[_0x7196('0x25')],_0x5b716a=_0x1ed296[_0x7196('0x25')]+_0x1ed296['limit'],_0x4c4f91;if(_0x5b716a>=_0x32fe2b){_0x5b716a=_0x32fe2b;_0x4c4f91=0xc8;}else{_0x4c4f91=0xce;}_0x22bd62[_0x7196('0x22')](_0x4c4f91);return _0x22bd62['set']('Content-Range',_0x385f2d+'-'+_0x5b716a+'/'+_0x32fe2b)[_0x7196('0x23')](_0x3e4e69);}return null;};}function patchUpdates(_0x627223){return function(_0x8dee9d){try{jsonpatch['apply'](_0x8dee9d,_0x627223,!![]);}catch(_0x57c390){return BPromise[_0x7196('0x26')](_0x57c390);}return _0x8dee9d[_0x7196('0x27')]();};}function saveUpdates(_0x598a26,_0x18649b){return function(_0x27ff84){if(_0x27ff84){return _0x27ff84[_0x7196('0x28')](_0x598a26)[_0x7196('0x29')](function(_0x38b3d6){return _0x38b3d6;});}return null;};}function removeEntity(_0x549f34,_0x3f8178){return function(_0x520d01){if(_0x520d01){return _0x520d01[_0x7196('0x2a')]()[_0x7196('0x29')](function(){var _0x2e15c7=_0x520d01[_0x7196('0x2b')]({'plain':!![]});var _0x70aa65=_0x7196('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x70aa65,'resourceId':_0x2e15c7['id']}})[_0x7196('0x29')](function(){return _0x520d01;});})[_0x7196('0x29')](function(){_0x549f34[_0x7196('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aa538,_0x41cfd2){return function(_0x162cfc){if(!_0x162cfc){_0x5aa538[_0x7196('0x20')](0x194);}return _0x162cfc;};}function handleError(_0x4c6006,_0x35eef9){_0x35eef9=_0x35eef9||0x1f4;return function(_0x4ecea1){logger[_0x7196('0x2d')](_0x4ecea1['stack']);if(_0x4ecea1[_0x7196('0x2e')]){delete _0x4ecea1[_0x7196('0x2e')];}_0x4c6006[_0x7196('0x22')](_0x35eef9)['send'](_0x4ecea1);};}exports[_0x7196('0x2f')]=function(_0x45d567,_0x2f9583){var _0xf999e9={},_0x50c386={},_0x39710d={'count':0x0,'rows':[]};var _0x429160=_[_0x7196('0x30')](db[_0x7196('0x31')][_0x7196('0x32')],function(_0x2786f3){return{'name':_0x2786f3[_0x7196('0x33')],'type':_0x2786f3[_0x7196('0x34')][_0x7196('0x35')]};});_0x50c386[_0x7196('0x36')]=_[_0x7196('0x30')](_0x429160,'name');_0x50c386[_0x7196('0x37')]=_['keys'](_0x45d567[_0x7196('0x37')]);_0x50c386['filters']=_[_0x7196('0x38')](_0x50c386[_0x7196('0x36')],_0x50c386['query']);_0xf999e9[_0x7196('0x39')]=_[_0x7196('0x38')](_0x50c386[_0x7196('0x36')],qs[_0x7196('0x3a')](_0x45d567[_0x7196('0x37')]['fields']));_0xf999e9[_0x7196('0x39')]=_0xf999e9[_0x7196('0x39')][_0x7196('0x3b')]?_0xf999e9[_0x7196('0x39')]:_0x50c386[_0x7196('0x36')];if(!_0x45d567[_0x7196('0x37')]['hasOwnProperty'](_0x7196('0x3c'))){_0xf999e9[_0x7196('0x3d')]=qs[_0x7196('0x3d')](_0x45d567['query'][_0x7196('0x3d')]);_0xf999e9[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x45d567[_0x7196('0x37')][_0x7196('0x25')]);}_0xf999e9[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_0x45d567[_0x7196('0x37')][_0x7196('0x3f')]);_0xf999e9[_0x7196('0x40')]=qs['filters'](_[_0x7196('0x41')](_0x45d567[_0x7196('0x37')],_0x50c386['filters']));if(_0x45d567[_0x7196('0x37')]['filter']){_0xf999e9['where']=_[_0x7196('0x42')](_0xf999e9[_0x7196('0x40')],{'$or':_['map'](_0x429160,function(_0x587f6f){if(_0x587f6f[_0x7196('0x34')]!==_0x7196('0x43')){var _0xed32cd={};_0xed32cd[_0x587f6f['name']]={'$like':'%'+_0x45d567[_0x7196('0x37')][_0x7196('0x44')]+'%'};return _0xed32cd;}})});}_0xf999e9=_[_0x7196('0x42')]({},_0xf999e9,_0x45d567[_0x7196('0x45')]);var _0x16da09={'where':_0xf999e9[_0x7196('0x40')]};return db[_0x7196('0x31')][_0x7196('0x24')](_0x16da09)['then'](function(_0x89c8ea){_0x39710d[_0x7196('0x24')]=_0x89c8ea;if(_0x45d567['query'][_0x7196('0x46')]){_0xf999e9[_0x7196('0x47')]=[{'all':!![]}];}return db['SmsQueue'][_0x7196('0x48')](_0xf999e9);})[_0x7196('0x29')](function(_0x3b78c8){_0x39710d['rows']=_0x3b78c8;return _0x39710d;})[_0x7196('0x29')](respondWithFilteredResult(_0x2f9583,_0xf999e9))[_0x7196('0x49')](handleError(_0x2f9583,null));};exports['show']=function(_0xcd287c,_0x1a7052){var _0x4f0c6c={'raw':!![],'where':{'id':_0xcd287c['params']['id']}},_0x335e6f={};_0x335e6f['model']=_['keys'](db['SmsQueue']['rawAttributes']);_0x335e6f[_0x7196('0x37')]=_['keys'](_0xcd287c[_0x7196('0x37')]);_0x335e6f[_0x7196('0x4a')]=_[_0x7196('0x38')](_0x335e6f[_0x7196('0x36')],_0x335e6f['query']);_0x4f0c6c[_0x7196('0x39')]=_['intersection'](_0x335e6f[_0x7196('0x36')],qs[_0x7196('0x3a')](_0xcd287c[_0x7196('0x37')]['fields']));_0x4f0c6c[_0x7196('0x39')]=_0x4f0c6c[_0x7196('0x39')][_0x7196('0x3b')]?_0x4f0c6c['attributes']:_0x335e6f['model'];if(_0xcd287c[_0x7196('0x37')]['includeAll']){_0x4f0c6c[_0x7196('0x47')]=[{'all':!![]}];}_0x4f0c6c=_['merge']({},_0x4f0c6c,_0xcd287c['options']);return db[_0x7196('0x31')]['find'](_0x4f0c6c)['then'](handleEntityNotFound(_0x1a7052,null))['then'](respondWithResult(_0x1a7052,null))[_0x7196('0x49')](handleError(_0x1a7052,null));};exports['create']=function(_0x48e3b5,_0x28591e){return db[_0x7196('0x31')][_0x7196('0x4b')](_0x48e3b5[_0x7196('0x4c')],{})['then'](function(_0x50cc66){var _0x564688=_0x48e3b5[_0x7196('0x4d')][_0x7196('0x2b')]({'plain':!![]});if(!_0x564688)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x564688[_0x7196('0x4e')]===_0x7196('0x4d')){var _0x3fe092=_0x50cc66['get']({'plain':!![]});var _0x317ab6='SmsQueues';return db[_0x7196('0x4f')][_0x7196('0x50')]({'where':{'name':_0x317ab6,'userProfileId':_0x564688[_0x7196('0x51')]},'raw':!![]})[_0x7196('0x29')](function(_0x41a9aa){if(_0x41a9aa&&_0x41a9aa[_0x7196('0x52')]===0x0){return db[_0x7196('0x53')][_0x7196('0x4b')]({'name':_0x3fe092['name'],'resourceId':_0x3fe092['id'],'type':_0x41a9aa['name'],'sectionId':_0x41a9aa['id']},{})[_0x7196('0x29')](function(){return _0x50cc66;});}else{return _0x50cc66;}})[_0x7196('0x49')](function(_0x40f820){logger[_0x7196('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40f820);throw _0x40f820;});}return _0x50cc66;})[_0x7196('0x29')](respondWithResult(_0x28591e,0xc9))[_0x7196('0x49')](handleError(_0x28591e,null));};exports[_0x7196('0x28')]=function(_0x11dc10,_0x9fcfd4){if(_0x11dc10[_0x7196('0x4c')]['id']){delete _0x11dc10[_0x7196('0x4c')]['id'];}return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x11dc10[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x9fcfd4,null))['then'](saveUpdates(_0x11dc10[_0x7196('0x4c')],null))[_0x7196('0x29')](respondWithResult(_0x9fcfd4,null))[_0x7196('0x49')](handleError(_0x9fcfd4,null));};exports['destroy']=function(_0x1f098c,_0x5ca1ca){return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x1f098c[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x5ca1ca,null))[_0x7196('0x29')](removeEntity(_0x5ca1ca,null))['catch'](handleError(_0x5ca1ca,null));};exports[_0x7196('0x55')]=function(_0x5b77fc,_0x4be36d){return db['SmsQueue'][_0x7196('0x55')]()[_0x7196('0x29')](respondWithResult(_0x4be36d,null))[_0x7196('0x49')](handleError(_0x4be36d,null));};exports[_0x7196('0x56')]=function(_0x105a3f,_0x41fa94,_0x2d8b3d){var _0x560ddb={'raw':!![],'where':{}},_0x293467={},_0x14dc43;return db[_0x7196('0x31')][_0x7196('0x57')]({'where':{'id':_0x105a3f[_0x7196('0x54')]['id']}})['then'](handleEntityNotFound(_0x41fa94,null))['then'](function(_0xa7ecfb){if(_0xa7ecfb){_0x14dc43=_0xa7ecfb[_0x7196('0x2b')]({'plain':!![]});_0x293467[_0x7196('0x36')]=_[_0x7196('0x58')](db[_0x7196('0x59')][_0x7196('0x32')]);_0x293467[_0x7196('0x37')]=_[_0x7196('0x58')](_0x105a3f[_0x7196('0x37')]);_0x293467[_0x7196('0x4a')]=_[_0x7196('0x38')](_0x293467['model'],_0x293467[_0x7196('0x37')]);_0x560ddb[_0x7196('0x39')]=_[_0x7196('0x38')](_0x293467[_0x7196('0x36')],qs['fields'](_0x105a3f[_0x7196('0x37')][_0x7196('0x3a')]));_0x560ddb[_0x7196('0x39')]=_0x560ddb[_0x7196('0x39')][_0x7196('0x3b')]?_0x560ddb[_0x7196('0x39')]:_0x293467[_0x7196('0x36')];if(!_0x105a3f['query'][_0x7196('0x5a')](_0x7196('0x3c'))){_0x560ddb[_0x7196('0x3d')]=qs[_0x7196('0x3d')](_0x105a3f['query'][_0x7196('0x3d')]);_0x560ddb[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x105a3f[_0x7196('0x37')][_0x7196('0x25')]);}_0x560ddb[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_0x105a3f['query']['sort']);_0x560ddb['where']=qs[_0x7196('0x4a')](_['pick'](_0x105a3f[_0x7196('0x37')],_0x293467[_0x7196('0x4a')]));_0x560ddb[_0x7196('0x40')][_0x7196('0x5b')]=_0xa7ecfb['id'];if(_0x105a3f[_0x7196('0x37')][_0x7196('0x44')]){_0x560ddb[_0x7196('0x40')]=_[_0x7196('0x42')](_0x560ddb[_0x7196('0x40')],{'$or':_['map'](_0x560ddb['attributes'],function(_0x4542c1){var _0x3f939a={};_0x3f939a[_0x4542c1]={'$like':'%'+_0x105a3f[_0x7196('0x37')][_0x7196('0x44')]+'%'};return _0x3f939a;})});}_0x560ddb=_[_0x7196('0x42')]({},_0x560ddb,_0x105a3f[_0x7196('0x45')]);return db[_0x7196('0x59')][_0x7196('0x48')](_0x560ddb);}})['then'](function(_0x4cb99d){if(_0x4cb99d){return db[_0x7196('0x5c')]['findAndCountAll']({'where':{'id':_[_0x7196('0x30')](_0x4cb99d,'UserId'),'role':_0x7196('0x5d')},'attributes':['id',_0x7196('0x2e'),_0x7196('0x5e'),_0x7196('0x5f'),'createdAt']});}})['then'](function(_0x33d301){if(_0x33d301){return{'count':_0x33d301['count'],'rows':_[_0x7196('0x30')](_0x33d301[_0x7196('0x60')],function(_0x4526e8){return{'membername':_0x4526e8[_0x7196('0x2e')],'UserId':_0x4526e8['id'],'queue_name':_0x14dc43[_0x7196('0x2e')],'SmsQueueId':_0x14dc43['id'],'interface':util[_0x7196('0x61')]('%s/%s',_0x7196('0x62'),_0x4526e8[_0x7196('0x2e')]),'penalty':0x0,'paused':_0x4526e8[_0x7196('0x5e')],'createdAt':_0x4526e8[_0x7196('0x63')],'updatedAt':_0x4526e8[_0x7196('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7196('0x29')](respondWithFilteredResult(_0x41fa94,_0x560ddb))[_0x7196('0x49')](handleError(_0x41fa94,null));};exports[_0x7196('0x64')]=function(_0x13cbe2,_0xa20de8,_0x3d3768){var _0x2181f5={};var _0x53a6fa={};var _0x431415;var _0x13f802;return db['SmsQueue']['findOne']({'where':{'id':_0x13cbe2[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0xa20de8,null))[_0x7196('0x29')](function(_0x5b2c33){if(_0x5b2c33){_0x431415=_0x5b2c33;_0x53a6fa[_0x7196('0x36')]=_['keys'](db[_0x7196('0x65')][_0x7196('0x32')]);_0x53a6fa['query']=_[_0x7196('0x58')](_0x13cbe2['query']);_0x53a6fa['filters']=_[_0x7196('0x38')](_0x53a6fa[_0x7196('0x36')],_0x53a6fa[_0x7196('0x37')]);_0x2181f5['attributes']=_[_0x7196('0x38')](_0x53a6fa['model'],qs[_0x7196('0x3a')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x3a')]));_0x2181f5[_0x7196('0x39')]=_0x2181f5[_0x7196('0x39')]['length']?_0x2181f5[_0x7196('0x39')]:_0x53a6fa[_0x7196('0x36')];_0x2181f5[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x3f')]);_0x2181f5[_0x7196('0x40')]=qs[_0x7196('0x4a')](_['pick'](_0x13cbe2[_0x7196('0x37')],_0x53a6fa[_0x7196('0x4a')]));if(_0x13cbe2[_0x7196('0x37')][_0x7196('0x44')]){_0x2181f5['where']=_[_0x7196('0x42')](_0x2181f5[_0x7196('0x40')],{'$or':_['map'](_0x2181f5[_0x7196('0x39')],function(_0x53d470){var _0xd6d8cf={};_0xd6d8cf[_0x53d470]={'$like':'%'+_0x13cbe2['query'][_0x7196('0x44')]+'%'};return _0xd6d8cf;})});}_0x2181f5=_[_0x7196('0x42')]({},_0x2181f5,_0x13cbe2['options']);return _0x431415[_0x7196('0x64')](_0x2181f5);}})[_0x7196('0x29')](function(_0x2c2c53){if(_0x2c2c53){_0x13f802=_0x2c2c53['length'];if(!_0x13cbe2['query'][_0x7196('0x5a')]('nolimit')){_0x2181f5['limit']=qs[_0x7196('0x3d')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x3d')]);_0x2181f5['offset']=qs[_0x7196('0x25')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x25')]);}return _0x431415[_0x7196('0x64')](_0x2181f5);}})[_0x7196('0x29')](function(_0x26048c){if(_0x26048c){return _0x26048c?{'count':_0x13f802,'rows':_0x26048c}:null;}})[_0x7196('0x29')](respondWithResult(_0xa20de8,null))[_0x7196('0x49')](handleError(_0xa20de8,null));};exports[_0x7196('0x66')]=function(_0x446f28,_0x173fe5,_0x5eb2b5){var _0x5acff1=_0x446f28[_0x7196('0x4c')]['ids'];return db['Team'][_0x7196('0x48')]({'where':{'id':_0x5acff1},'attributes':['id'],'include':[{'model':db[_0x7196('0x5c')],'as':_0x7196('0x67'),'attributes':['id',_0x7196('0x2e'),'online','voicePause',_0x7196('0x68')],'raw':!![]}]})[_0x7196('0x29')](function(_0x1eea71){if(_0x1eea71){var _0x247b15=_['flatMap'](_0x1eea71,function(_0x4d8b8e){var _0x4afbee=_0x4d8b8e['get']({'plain':!![]});return _0x4afbee[_0x7196('0x67')];});return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x446f28['params']['id']}})[_0x7196('0x29')](function(_0x40d4c3){return db[_0x7196('0x69')][_0x7196('0x6a')](function(_0x10712f){return _0x40d4c3[_0x7196('0x66')](_0x5acff1,{'transaction':_0x10712f})[_0x7196('0x29')](function(){return BPromise[_0x7196('0x6b')](_0x247b15,function(_0x5de550){return db[_0x7196('0x59')][_0x7196('0x6c')]({'where':{'UserId':_0x5de550['id'],'SmsQueueId':_0x446f28[_0x7196('0x54')]['id']},'transaction':_0x10712f});});})[_0x7196('0x29')](function(){_0x247b15[_0x7196('0x6d')](function(_0x4faf7b){socket[_0x7196('0x6e')](_0x7196('0x6f'),{'UserId':_0x4faf7b['id'],'SmsQueueId':_0x40d4c3['id']});});});});});}})[_0x7196('0x29')](respondWithStatusCode(_0x173fe5,null))['catch'](handleError(_0x173fe5,null));};exports[_0x7196('0x70')]=function(_0x4b98de,_0x53ae84,_0x1dcf93){return db[_0x7196('0x65')]['findAll']({'where':{'id':_0x4b98de[_0x7196('0x37')][_0x7196('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7196('0x67'),'attributes':['id'],'raw':!![]}]})[_0x7196('0x29')](handleEntityNotFound(_0x53ae84,null))[_0x7196('0x29')](function(_0x28d665){var _0x441ca1=_[_0x7196('0x30')](_0x28d665,'id');var _0x5d5d1f=[];var _0x3639be=[];var _0x460e51=squel[_0x7196('0x72')]();_0x460e51['field']('tq.TeamId')['from'](_0x7196('0x73'),'tq')[_0x7196('0x74')](_0x7196('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7196('0x40')]('SmsQueueId\x20=\x20?',_0x4b98de[_0x7196('0x54')]['id']);for(var _0x4e22df=0x0;_0x4e22df<_0x28d665[_0x7196('0x3b')];_0x4e22df+=0x1){let _0x18bafa=_0x28d665[_0x4e22df];for(var _0x33d5bf=0x0;_0x33d5bf<_0x18bafa[_0x7196('0x67')][_0x7196('0x3b')];_0x33d5bf+=0x1){let _0x10b628=_0x18bafa[_0x7196('0x67')][_0x33d5bf];var _0x48608b=_0x460e51[_0x7196('0x76')]();_0x48608b['where']('ut.UserId\x20=\x20?',_0x10b628['id']);_0x3639be['push'](db['sequelize']['query'](_0x48608b[_0x7196('0x77')](),{'type':db[_0x7196('0x69')][_0x7196('0x78')]['SELECT']})[_0x7196('0x29')](function(_0x49bf7e){if(_0x49bf7e['length']===0x1){return _0x10b628['id'];}else{var _0x4f7717=_[_0x7196('0x79')](_['map'](_0x49bf7e,_0x7196('0x7a')),function(_0x2fe382){return _[_0x7196('0x7b')](_0x441ca1,_0x2fe382);});if(_0x4f7717){return _0x10b628['id'];}}}));}}return BPromise[_0x7196('0x7c')](_0x3639be)[_0x7196('0x29')](function(_0x36893a){_0x5d5d1f=_(_0x5d5d1f)[_0x7196('0x7d')](_0x36893a)[_0x7196('0x7e')]()['value']();return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x4b98de[_0x7196('0x54')]['id']}})['then'](function(_0x3a241a){return db[_0x7196('0x69')][_0x7196('0x6a')](function(_0x4fa1b5){return _0x3a241a[_0x7196('0x70')](_0x4b98de[_0x7196('0x37')][_0x7196('0x71')],{'transaction':_0x4fa1b5})['then'](function(){if(!_[_0x7196('0x7f')](_0x5d5d1f)){return _0x3a241a[_0x7196('0x80')](_0x5d5d1f,{'transaction':_0x4fa1b5});}})['then'](function(){_0x5d5d1f[_0x7196('0x6d')](function(_0x5db5f1){socket[_0x7196('0x6e')](_0x7196('0x81'),{'UserId':_0x5db5f1,'SmsQueueId':_0x3a241a['id']});});});});});});})['then'](respondWithStatusCode(_0x53ae84,null))[_0x7196('0x49')](handleError(_0x53ae84,null));};exports['addAgents']=function(_0x5d24ff,_0x2cae94,_0x4738c2){return db['SmsQueue'][_0x7196('0x50')]({'where':{'id':_0x5d24ff[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x2cae94,null))[_0x7196('0x29')](function(_0x5b91e5){if(_0x5b91e5){return _0x5b91e5[_0x7196('0x82')](_0x5d24ff[_0x7196('0x4c')][_0x7196('0x71')],_['omit'](_0x5d24ff['body'],[_0x7196('0x71'),'id'])||{})[_0x7196('0x83')](function(_0x87184a){for(var _0x2af201=0x0;_0x2af201<_0x5d24ff['body'][_0x7196('0x71')]['length'];_0x2af201+=0x1){socket[_0x7196('0x6e')]('userSmsQueue:save',{'UserId':_0x5d24ff[_0x7196('0x4c')][_0x7196('0x71')][_0x2af201],'SmsQueueId':_0x5d24ff[_0x7196('0x54')]['id']});}return _0x87184a;});}})[_0x7196('0x29')](respondWithResult(_0x2cae94,null))[_0x7196('0x49')](handleError(_0x2cae94,null));};exports[_0x7196('0x80')]=function(_0x342fb1,_0x4c9c35,_0x1ae8bc){return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x342fb1[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x4c9c35,null))[_0x7196('0x29')](function(_0x186731){if(_0x186731){return _0x186731[_0x7196('0x80')](_0x342fb1['query'][_0x7196('0x71')])[_0x7196('0x29')](function(){if(_['isArray'](_0x342fb1[_0x7196('0x37')][_0x7196('0x71')])){for(var _0x4fa57e=0x0;_0x4fa57e<_0x342fb1[_0x7196('0x37')][_0x7196('0x71')][_0x7196('0x3b')];_0x4fa57e+=0x1){socket[_0x7196('0x6e')]('userSmsQueue:remove',{'UserId':Number(_0x342fb1['query'][_0x7196('0x71')][_0x4fa57e]),'SmsQueueId':Number(_0x342fb1['params']['id'])});}}else{socket[_0x7196('0x6e')](_0x7196('0x81'),{'UserId':Number(_0x342fb1[_0x7196('0x37')][_0x7196('0x71')]),'SmsQueueId':Number(_0x342fb1[_0x7196('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c9c35,null))[_0x7196('0x49')](handleError(_0x4c9c35,null));};exports[_0x7196('0x84')]=function(_0x163857,_0x1948b8,_0x1bd2dc){var _0x2b954c={};var _0x446a99={};var _0x149144;var _0x11fb5b;return db['SmsQueue']['findOne']({'where':{'id':_0x163857['params']['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x1948b8,null))[_0x7196('0x29')](function(_0x92179b){if(_0x92179b){_0x149144=_0x92179b;_0x446a99[_0x7196('0x36')]=_[_0x7196('0x58')](db[_0x7196('0x5c')][_0x7196('0x32')]);_0x446a99[_0x7196('0x37')]=_['keys'](_0x163857['query']);_0x446a99['filters']=_['intersection'](_0x446a99[_0x7196('0x36')],_0x446a99[_0x7196('0x37')]);_0x2b954c[_0x7196('0x39')]=_[_0x7196('0x38')](_0x446a99[_0x7196('0x36')],qs[_0x7196('0x3a')](_0x163857['query'][_0x7196('0x3a')]));_0x2b954c['attributes']=_0x2b954c['attributes'][_0x7196('0x3b')]?_0x2b954c['attributes']:_0x446a99['model'];_0x2b954c[_0x7196('0x3e')]=qs['sort'](_0x163857[_0x7196('0x37')][_0x7196('0x3f')]);_0x2b954c[_0x7196('0x40')]=qs[_0x7196('0x4a')](_[_0x7196('0x41')](_0x163857[_0x7196('0x37')],_0x446a99['filters']));if(_0x163857[_0x7196('0x37')][_0x7196('0x44')]){_0x2b954c[_0x7196('0x40')]=_['merge'](_0x2b954c[_0x7196('0x40')],{'$or':_[_0x7196('0x30')](_0x2b954c[_0x7196('0x39')],function(_0x48262c){var _0x571fa5={};_0x571fa5[_0x48262c]={'$like':'%'+_0x163857[_0x7196('0x37')][_0x7196('0x44')]+'%'};return _0x571fa5;})});}_0x2b954c=_[_0x7196('0x42')]({},_0x2b954c,_0x163857[_0x7196('0x45')]);return _0x149144[_0x7196('0x84')](_0x2b954c);}})[_0x7196('0x29')](function(_0x1a8a5a){if(_0x1a8a5a){_0x11fb5b=_0x1a8a5a[_0x7196('0x3b')];if(!_0x163857[_0x7196('0x37')][_0x7196('0x5a')]('nolimit')){_0x2b954c[_0x7196('0x3d')]=qs[_0x7196('0x3d')](_0x163857['query'][_0x7196('0x3d')]);_0x2b954c[_0x7196('0x25')]=qs['offset'](_0x163857[_0x7196('0x37')][_0x7196('0x25')]);}return _0x149144[_0x7196('0x84')](_0x2b954c);}})[_0x7196('0x29')](function(_0x1e7a64){if(_0x1e7a64){return _0x1e7a64?{'count':_0x11fb5b,'rows':_0x1e7a64}:null;}})[_0x7196('0x29')](respondWithResult(_0x1948b8,null))['catch'](handleError(_0x1948b8,null));}; \ No newline at end of file +var _0x5f66=['ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','isArray','userSmsQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','register','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','SmsQueue','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','map','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x8'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x65f6('0x13'))['db'];config['redis']=_[_0x65f6('0x14')](config['redis'],{'host':_0x65f6('0x15'),'port':0x18eb});var socket=require(_0x65f6('0x16'))(new Redis(config[_0x65f6('0x17')]));require(_0x65f6('0x18'))[_0x65f6('0x19')](socket);function respondWithStatusCode(_0x1d29fd,_0x44144b){_0x44144b=_0x44144b||0xcc;return function(_0xb1d40a){if(_0xb1d40a){return _0x1d29fd[_0x65f6('0x1a')](_0x44144b);}return _0x1d29fd[_0x65f6('0x1b')](_0x44144b)['end']();};}function respondWithResult(_0x19b9ff,_0x49a913){_0x49a913=_0x49a913||0xc8;return function(_0x5dd324){if(_0x5dd324){return _0x19b9ff[_0x65f6('0x1b')](_0x49a913)[_0x65f6('0x1c')](_0x5dd324);}};}function respondWithFilteredResult(_0x37330d,_0x1c955c){return function(_0x1b1cbb){if(_0x1b1cbb){var _0x1f974c=_0x1b1cbb['count'],_0xc8660c=_0x1c955c[_0x65f6('0x1d')],_0x18380e=_0x1c955c['offset']+_0x1c955c['limit'],_0x495dd6;if(_0x18380e>=_0x1f974c){_0x18380e=_0x1f974c;_0x495dd6=0xc8;}else{_0x495dd6=0xce;}_0x37330d['status'](_0x495dd6);return _0x37330d[_0x65f6('0x1e')](_0x65f6('0x1f'),_0xc8660c+'-'+_0x18380e+'/'+_0x1f974c)['json'](_0x1b1cbb);}return null;};}function patchUpdates(_0x39e19f){return function(_0x270893){try{jsonpatch[_0x65f6('0x20')](_0x270893,_0x39e19f,!![]);}catch(_0x3876ed){return BPromise[_0x65f6('0x21')](_0x3876ed);}return _0x270893[_0x65f6('0x22')]();};}function saveUpdates(_0x581374,_0x197a49){return function(_0x4bb39e){if(_0x4bb39e){return _0x4bb39e['update'](_0x581374)[_0x65f6('0x23')](function(_0xd173f4){return _0xd173f4;});}return null;};}function removeEntity(_0x524e42,_0x1eeaaa){return function(_0x471a33){if(_0x471a33){return _0x471a33[_0x65f6('0x24')]()[_0x65f6('0x23')](function(){var _0x4f5a69=_0x471a33[_0x65f6('0x25')]({'plain':!![]});var _0x59ea32=_0x65f6('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x59ea32,'resourceId':_0x4f5a69['id']}})['then'](function(){return _0x471a33;});})[_0x65f6('0x23')](function(){_0x524e42[_0x65f6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x296cd9,_0x28f710){return function(_0x52277c){if(!_0x52277c){_0x296cd9[_0x65f6('0x1a')](0x194);}return _0x52277c;};}function handleError(_0x2bff2b,_0x28d0df){_0x28d0df=_0x28d0df||0x1f4;return function(_0x559330){logger['error'](_0x559330['stack']);if(_0x559330[_0x65f6('0x27')]){delete _0x559330[_0x65f6('0x27')];}_0x2bff2b[_0x65f6('0x1b')](_0x28d0df)[_0x65f6('0x28')](_0x559330);};}exports[_0x65f6('0x29')]=function(_0x14a387,_0x144e55){var _0x4ace4c={},_0x4ea23d={},_0x154cbd={'count':0x0,'rows':[]};var _0x27e284=_['map'](db['SmsQueue'][_0x65f6('0x2a')],function(_0x1ce43c){return{'name':_0x1ce43c[_0x65f6('0x2b')],'type':_0x1ce43c[_0x65f6('0x2c')][_0x65f6('0x2d')]};});_0x4ea23d[_0x65f6('0x2e')]=_['map'](_0x27e284,_0x65f6('0x27'));_0x4ea23d[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0x14a387['query']);_0x4ea23d[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x4ea23d[_0x65f6('0x2e')],_0x4ea23d[_0x65f6('0x2f')]);_0x4ace4c[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x4ea23d['model'],qs[_0x65f6('0x34')](_0x14a387[_0x65f6('0x2f')]['fields']));_0x4ace4c[_0x65f6('0x33')]=_0x4ace4c['attributes'][_0x65f6('0x35')]?_0x4ace4c['attributes']:_0x4ea23d[_0x65f6('0x2e')];if(!_0x14a387[_0x65f6('0x2f')]['hasOwnProperty'](_0x65f6('0x36'))){_0x4ace4c[_0x65f6('0x37')]=qs[_0x65f6('0x37')](_0x14a387['query']['limit']);_0x4ace4c[_0x65f6('0x1d')]=qs['offset'](_0x14a387[_0x65f6('0x2f')]['offset']);}_0x4ace4c[_0x65f6('0x38')]=qs[_0x65f6('0x39')](_0x14a387['query'][_0x65f6('0x39')]);_0x4ace4c['where']=qs['filters'](_[_0x65f6('0x3a')](_0x14a387[_0x65f6('0x2f')],_0x4ea23d[_0x65f6('0x31')]));if(_0x14a387[_0x65f6('0x2f')][_0x65f6('0x3b')]){_0x4ace4c[_0x65f6('0x3c')]=_[_0x65f6('0x3d')](_0x4ace4c[_0x65f6('0x3c')],{'$or':_['map'](_0x27e284,function(_0x3aa254){if(_0x3aa254['type']!==_0x65f6('0x3e')){var _0xa4394a={};_0xa4394a[_0x3aa254[_0x65f6('0x27')]]={'$like':'%'+_0x14a387[_0x65f6('0x2f')]['filter']+'%'};return _0xa4394a;}})});}_0x4ace4c=_[_0x65f6('0x3d')]({},_0x4ace4c,_0x14a387[_0x65f6('0x3f')]);var _0x413819={'where':_0x4ace4c[_0x65f6('0x3c')]};return db[_0x65f6('0x40')][_0x65f6('0x41')](_0x413819)[_0x65f6('0x23')](function(_0x2acca5){_0x154cbd[_0x65f6('0x41')]=_0x2acca5;if(_0x14a387['query'][_0x65f6('0x42')]){_0x4ace4c[_0x65f6('0x43')]=[{'all':!![]}];}return db[_0x65f6('0x40')][_0x65f6('0x44')](_0x4ace4c);})[_0x65f6('0x23')](function(_0x1ac040){_0x154cbd[_0x65f6('0x45')]=_0x1ac040;return _0x154cbd;})[_0x65f6('0x23')](respondWithFilteredResult(_0x144e55,_0x4ace4c))[_0x65f6('0x46')](handleError(_0x144e55,null));};exports[_0x65f6('0x47')]=function(_0xcf19da,_0x2c008a){var _0x6c4d94={'raw':!![],'where':{'id':_0xcf19da[_0x65f6('0x48')]['id']}},_0x27157d={};_0x27157d[_0x65f6('0x2e')]=_['keys'](db[_0x65f6('0x40')][_0x65f6('0x2a')]);_0x27157d[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0xcf19da['query']);_0x27157d[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x27157d[_0x65f6('0x2e')],_0x27157d['query']);_0x6c4d94[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x27157d[_0x65f6('0x2e')],qs[_0x65f6('0x34')](_0xcf19da['query'][_0x65f6('0x34')]));_0x6c4d94['attributes']=_0x6c4d94[_0x65f6('0x33')][_0x65f6('0x35')]?_0x6c4d94['attributes']:_0x27157d[_0x65f6('0x2e')];if(_0xcf19da['query'][_0x65f6('0x42')]){_0x6c4d94[_0x65f6('0x43')]=[{'all':!![]}];}_0x6c4d94=_[_0x65f6('0x3d')]({},_0x6c4d94,_0xcf19da[_0x65f6('0x3f')]);return db[_0x65f6('0x40')][_0x65f6('0x49')](_0x6c4d94)['then'](handleEntityNotFound(_0x2c008a,null))['then'](respondWithResult(_0x2c008a,null))[_0x65f6('0x46')](handleError(_0x2c008a,null));};exports[_0x65f6('0x4a')]=function(_0x3b647a,_0x1e9e29){return db[_0x65f6('0x40')][_0x65f6('0x4a')](_0x3b647a[_0x65f6('0x4b')],{})[_0x65f6('0x23')](function(_0x414f49){var _0x517a47=_0x3b647a[_0x65f6('0x4c')][_0x65f6('0x25')]({'plain':!![]});if(!_0x517a47)throw new Error(_0x65f6('0x4d'));if(_0x517a47['role']===_0x65f6('0x4c')){var _0x42d453=_0x414f49['get']({'plain':!![]});var _0x22d745=_0x65f6('0x26');return db['UserProfileSection'][_0x65f6('0x49')]({'where':{'name':_0x22d745,'userProfileId':_0x517a47['userProfileId']},'raw':!![]})[_0x65f6('0x23')](function(_0x3b241f){if(_0x3b241f&&_0x3b241f[_0x65f6('0x4e')]===0x0){return db['UserProfileResource'][_0x65f6('0x4a')]({'name':_0x42d453[_0x65f6('0x27')],'resourceId':_0x42d453['id'],'type':_0x3b241f['name'],'sectionId':_0x3b241f['id']},{})[_0x65f6('0x23')](function(){return _0x414f49;});}else{return _0x414f49;}})[_0x65f6('0x46')](function(_0x48a2ed){logger[_0x65f6('0x4f')](_0x65f6('0x50'),_0x48a2ed);throw _0x48a2ed;});}return _0x414f49;})[_0x65f6('0x23')](respondWithResult(_0x1e9e29,0xc9))[_0x65f6('0x46')](handleError(_0x1e9e29,null));};exports[_0x65f6('0x51')]=function(_0x2350ca,_0x1d620a){if(_0x2350ca[_0x65f6('0x4b')]['id']){delete _0x2350ca['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x2350ca[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x1d620a,null))[_0x65f6('0x23')](saveUpdates(_0x2350ca[_0x65f6('0x4b')],null))['then'](respondWithResult(_0x1d620a,null))[_0x65f6('0x46')](handleError(_0x1d620a,null));};exports[_0x65f6('0x24')]=function(_0x9ff849,_0x50f63a){return db[_0x65f6('0x40')][_0x65f6('0x49')]({'where':{'id':_0x9ff849[_0x65f6('0x48')]['id']}})['then'](handleEntityNotFound(_0x50f63a,null))['then'](removeEntity(_0x50f63a,null))[_0x65f6('0x46')](handleError(_0x50f63a,null));};exports[_0x65f6('0x52')]=function(_0x4125cb,_0x39364f){return db[_0x65f6('0x40')][_0x65f6('0x52')]()[_0x65f6('0x23')](respondWithResult(_0x39364f,null))[_0x65f6('0x46')](handleError(_0x39364f,null));};exports[_0x65f6('0x53')]=function(_0xddbd90,_0xa7eee9,_0x141fcc){var _0x30adee={'raw':!![],'where':{}},_0x3e3143={},_0x5ba9c6;return db[_0x65f6('0x40')][_0x65f6('0x54')]({'where':{'id':_0xddbd90[_0x65f6('0x48')]['id']}})['then'](handleEntityNotFound(_0xa7eee9,null))[_0x65f6('0x23')](function(_0x16dec0){if(_0x16dec0){_0x5ba9c6=_0x16dec0[_0x65f6('0x25')]({'plain':!![]});_0x3e3143[_0x65f6('0x2e')]=_['keys'](db[_0x65f6('0x55')][_0x65f6('0x2a')]);_0x3e3143[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0xddbd90['query']);_0x3e3143[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x3e3143['model'],_0x3e3143[_0x65f6('0x2f')]);_0x30adee[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x3e3143['model'],qs[_0x65f6('0x34')](_0xddbd90[_0x65f6('0x2f')][_0x65f6('0x34')]));_0x30adee[_0x65f6('0x33')]=_0x30adee[_0x65f6('0x33')][_0x65f6('0x35')]?_0x30adee['attributes']:_0x3e3143['model'];if(!_0xddbd90['query'][_0x65f6('0x56')](_0x65f6('0x36'))){_0x30adee[_0x65f6('0x37')]=qs[_0x65f6('0x37')](_0xddbd90[_0x65f6('0x2f')][_0x65f6('0x37')]);_0x30adee['offset']=qs[_0x65f6('0x1d')](_0xddbd90[_0x65f6('0x2f')]['offset']);}_0x30adee[_0x65f6('0x38')]=qs[_0x65f6('0x39')](_0xddbd90[_0x65f6('0x2f')]['sort']);_0x30adee[_0x65f6('0x3c')]=qs[_0x65f6('0x31')](_['pick'](_0xddbd90[_0x65f6('0x2f')],_0x3e3143[_0x65f6('0x31')]));_0x30adee[_0x65f6('0x3c')][_0x65f6('0x57')]=_0x16dec0['id'];if(_0xddbd90[_0x65f6('0x2f')][_0x65f6('0x3b')]){_0x30adee[_0x65f6('0x3c')]=_['merge'](_0x30adee['where'],{'$or':_[_0x65f6('0x58')](_0x30adee[_0x65f6('0x33')],function(_0x4a9524){var _0x417ba5={};_0x417ba5[_0x4a9524]={'$like':'%'+_0xddbd90['query'][_0x65f6('0x3b')]+'%'};return _0x417ba5;})});}_0x30adee=_['merge']({},_0x30adee,_0xddbd90[_0x65f6('0x3f')]);return db[_0x65f6('0x55')][_0x65f6('0x44')](_0x30adee);}})[_0x65f6('0x23')](function(_0x145aaa){if(_0x145aaa){return db[_0x65f6('0x59')][_0x65f6('0x5a')]({'where':{'id':_[_0x65f6('0x58')](_0x145aaa,_0x65f6('0x5b')),'role':'agent'},'attributes':['id','name',_0x65f6('0x5c'),_0x65f6('0x5d'),_0x65f6('0x5e')]});}})['then'](function(_0x49cd14){if(_0x49cd14){return{'count':_0x49cd14[_0x65f6('0x41')],'rows':_[_0x65f6('0x58')](_0x49cd14[_0x65f6('0x45')],function(_0xc703f9){return{'membername':_0xc703f9[_0x65f6('0x27')],'UserId':_0xc703f9['id'],'queue_name':_0x5ba9c6[_0x65f6('0x27')],'SmsQueueId':_0x5ba9c6['id'],'interface':util['format']('%s/%s',_0x65f6('0x5f'),_0xc703f9[_0x65f6('0x27')]),'penalty':0x0,'paused':_0xc703f9['smsPause'],'createdAt':_0xc703f9[_0x65f6('0x5e')],'updatedAt':_0xc703f9['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x65f6('0x23')](respondWithFilteredResult(_0xa7eee9,_0x30adee))[_0x65f6('0x46')](handleError(_0xa7eee9,null));};exports[_0x65f6('0x60')]=function(_0x16726d,_0x558888,_0x34ab7b){var _0x351d43={};var _0x11411c={};var _0x59131c;var _0x4c0511;return db[_0x65f6('0x40')]['findOne']({'where':{'id':_0x16726d[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x558888,null))[_0x65f6('0x23')](function(_0x354b90){if(_0x354b90){_0x59131c=_0x354b90;_0x11411c['model']=_['keys'](db['Team'][_0x65f6('0x2a')]);_0x11411c[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0x16726d['query']);_0x11411c[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x11411c[_0x65f6('0x2e')],_0x11411c['query']);_0x351d43[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x11411c['model'],qs[_0x65f6('0x34')](_0x16726d[_0x65f6('0x2f')]['fields']));_0x351d43[_0x65f6('0x33')]=_0x351d43['attributes'][_0x65f6('0x35')]?_0x351d43['attributes']:_0x11411c[_0x65f6('0x2e')];_0x351d43[_0x65f6('0x38')]=qs['sort'](_0x16726d[_0x65f6('0x2f')][_0x65f6('0x39')]);_0x351d43[_0x65f6('0x3c')]=qs[_0x65f6('0x31')](_[_0x65f6('0x3a')](_0x16726d[_0x65f6('0x2f')],_0x11411c[_0x65f6('0x31')]));if(_0x16726d[_0x65f6('0x2f')][_0x65f6('0x3b')]){_0x351d43[_0x65f6('0x3c')]=_[_0x65f6('0x3d')](_0x351d43['where'],{'$or':_[_0x65f6('0x58')](_0x351d43[_0x65f6('0x33')],function(_0x15c8b7){var _0x219e42={};_0x219e42[_0x15c8b7]={'$like':'%'+_0x16726d['query'][_0x65f6('0x3b')]+'%'};return _0x219e42;})});}_0x351d43=_[_0x65f6('0x3d')]({},_0x351d43,_0x16726d['options']);return _0x59131c[_0x65f6('0x60')](_0x351d43);}})['then'](function(_0x10d98f){if(_0x10d98f){_0x4c0511=_0x10d98f['length'];if(!_0x16726d[_0x65f6('0x2f')][_0x65f6('0x56')]('nolimit')){_0x351d43['limit']=qs[_0x65f6('0x37')](_0x16726d[_0x65f6('0x2f')]['limit']);_0x351d43[_0x65f6('0x1d')]=qs[_0x65f6('0x1d')](_0x16726d[_0x65f6('0x2f')]['offset']);}return _0x59131c[_0x65f6('0x60')](_0x351d43);}})[_0x65f6('0x23')](function(_0x5889dc){if(_0x5889dc){return _0x5889dc?{'count':_0x4c0511,'rows':_0x5889dc}:null;}})[_0x65f6('0x23')](respondWithResult(_0x558888,null))['catch'](handleError(_0x558888,null));};exports[_0x65f6('0x61')]=function(_0x57eb49,_0x51105d,_0x20687f){var _0x1cf4ed=_0x57eb49[_0x65f6('0x4b')][_0x65f6('0x62')];return db[_0x65f6('0x63')][_0x65f6('0x44')]({'where':{'id':_0x1cf4ed},'attributes':['id'],'include':[{'model':db[_0x65f6('0x59')],'as':_0x65f6('0x64'),'attributes':['id','name','online',_0x65f6('0x65'),'interface'],'raw':!![]}]})[_0x65f6('0x23')](function(_0x36699b){if(_0x36699b){var _0x21b5f2=_[_0x65f6('0x66')](_0x36699b,function(_0x43127b){var _0x56bd9d=_0x43127b[_0x65f6('0x25')]({'plain':!![]});return _0x56bd9d[_0x65f6('0x64')];});return db[_0x65f6('0x40')]['find']({'where':{'id':_0x57eb49[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](function(_0x4254c2){return db[_0x65f6('0x67')][_0x65f6('0x68')](function(_0x16bf93){return _0x4254c2['addTeams'](_0x1cf4ed,{'transaction':_0x16bf93})['then'](function(){return BPromise[_0x65f6('0x69')](_0x21b5f2,function(_0x10d744){return db[_0x65f6('0x55')][_0x65f6('0x6a')]({'where':{'UserId':_0x10d744['id'],'SmsQueueId':_0x57eb49['params']['id']},'transaction':_0x16bf93});});})['then'](function(){_0x21b5f2[_0x65f6('0x6b')](function(_0x452f1e){socket[_0x65f6('0x6c')](_0x65f6('0x6d'),{'UserId':_0x452f1e['id'],'SmsQueueId':_0x4254c2['id']});});});});});}})[_0x65f6('0x23')](respondWithStatusCode(_0x51105d,null))[_0x65f6('0x46')](handleError(_0x51105d,null));};exports['removeTeams']=function(_0x4d607a,_0x5851b6,_0x2c59f6){return db[_0x65f6('0x63')][_0x65f6('0x44')]({'where':{'id':_0x4d607a[_0x65f6('0x2f')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x65f6('0x64'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x23')](handleEntityNotFound(_0x5851b6,null))['then'](function(_0x346fa9){var _0x52004e=_[_0x65f6('0x58')](_0x346fa9,'id');var _0x4f3ef8=[];var _0x3a30ed=[];var _0x208fee=squel['select']();_0x208fee[_0x65f6('0x6e')](_0x65f6('0x6f'))[_0x65f6('0x70')](_0x65f6('0x71'),'tq')[_0x65f6('0x72')](_0x65f6('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x65f6('0x3c')]('SmsQueueId\x20=\x20?',_0x4d607a[_0x65f6('0x48')]['id']);for(var _0x56336a=0x0;_0x56336a<_0x346fa9[_0x65f6('0x35')];_0x56336a+=0x1){let _0x3528be=_0x346fa9[_0x56336a];for(var _0xdf396c=0x0;_0xdf396c<_0x3528be[_0x65f6('0x64')]['length'];_0xdf396c+=0x1){let _0x2b6f98=_0x3528be[_0x65f6('0x64')][_0xdf396c];var _0x376a23=_0x208fee['clone']();_0x376a23['where'](_0x65f6('0x74'),_0x2b6f98['id']);_0x3a30ed[_0x65f6('0x75')](db['sequelize'][_0x65f6('0x2f')](_0x376a23[_0x65f6('0x76')](),{'type':db[_0x65f6('0x67')]['QueryTypes'][_0x65f6('0x77')]})[_0x65f6('0x23')](function(_0x5df361){if(_0x5df361[_0x65f6('0x35')]===0x1){return _0x2b6f98['id'];}else{var _0x7136bc=_[_0x65f6('0x78')](_['map'](_0x5df361,_0x65f6('0x79')),function(_0x2287fc){return _[_0x65f6('0x7a')](_0x52004e,_0x2287fc);});if(_0x7136bc){return _0x2b6f98['id'];}}}));}}return BPromise['all'](_0x3a30ed)[_0x65f6('0x23')](function(_0x4febfa){_0x4f3ef8=_(_0x4f3ef8)[_0x65f6('0x7b')](_0x4febfa)[_0x65f6('0x7c')]()[_0x65f6('0x7d')]();return db[_0x65f6('0x40')][_0x65f6('0x49')]({'where':{'id':_0x4d607a[_0x65f6('0x48')]['id']}})['then'](function(_0x284473){return db[_0x65f6('0x67')][_0x65f6('0x68')](function(_0x32a101){return _0x284473[_0x65f6('0x7e')](_0x4d607a['query']['ids'],{'transaction':_0x32a101})['then'](function(){if(!_[_0x65f6('0x7f')](_0x4f3ef8)){return _0x284473[_0x65f6('0x80')](_0x4f3ef8,{'transaction':_0x32a101});}})[_0x65f6('0x23')](function(){_0x4f3ef8['forEach'](function(_0x151cee){socket['emit']('userSmsQueue:remove',{'UserId':_0x151cee,'SmsQueueId':_0x284473['id']});});});});});});})[_0x65f6('0x23')](respondWithStatusCode(_0x5851b6,null))[_0x65f6('0x46')](handleError(_0x5851b6,null));};exports['addAgents']=function(_0xdd36c4,_0x3c5053,_0x43ed6c){return db[_0x65f6('0x40')][_0x65f6('0x49')]({'where':{'id':_0xdd36c4[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x3c5053,null))[_0x65f6('0x23')](function(_0x477f29){if(_0x477f29){return _0x477f29[_0x65f6('0x81')](_0xdd36c4[_0x65f6('0x4b')][_0x65f6('0x62')],_['omit'](_0xdd36c4[_0x65f6('0x4b')],['ids','id'])||{})['spread'](function(_0x24d524){for(var _0x10a877=0x0;_0x10a877<_0xdd36c4[_0x65f6('0x4b')][_0x65f6('0x62')]['length'];_0x10a877+=0x1){socket[_0x65f6('0x6c')]('userSmsQueue:save',{'UserId':_0xdd36c4['body'][_0x65f6('0x62')][_0x10a877],'SmsQueueId':_0xdd36c4[_0x65f6('0x48')]['id']});}return _0x24d524;});}})[_0x65f6('0x23')](respondWithResult(_0x3c5053,null))[_0x65f6('0x46')](handleError(_0x3c5053,null));};exports[_0x65f6('0x80')]=function(_0xcdfebe,_0x5a33cf,_0x5c8131){return db['SmsQueue'][_0x65f6('0x49')]({'where':{'id':_0xcdfebe[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x5a33cf,null))['then'](function(_0x29396f){if(_0x29396f){return _0x29396f['removeAgents'](_0xcdfebe['query'][_0x65f6('0x62')])[_0x65f6('0x23')](function(){if(_[_0x65f6('0x82')](_0xcdfebe[_0x65f6('0x2f')][_0x65f6('0x62')])){for(var _0x5adf21=0x0;_0x5adf21<_0xcdfebe[_0x65f6('0x2f')][_0x65f6('0x62')][_0x65f6('0x35')];_0x5adf21+=0x1){socket[_0x65f6('0x6c')]('userSmsQueue:remove',{'UserId':Number(_0xcdfebe[_0x65f6('0x2f')][_0x65f6('0x62')][_0x5adf21]),'SmsQueueId':Number(_0xcdfebe[_0x65f6('0x48')]['id'])});}}else{socket[_0x65f6('0x6c')](_0x65f6('0x83'),{'UserId':Number(_0xcdfebe[_0x65f6('0x2f')][_0x65f6('0x62')]),'SmsQueueId':Number(_0xcdfebe[_0x65f6('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x5a33cf,null))[_0x65f6('0x46')](handleError(_0x5a33cf,null));};exports[_0x65f6('0x84')]=function(_0x3efa55,_0x8adb47,_0x146c11){var _0x4171a1={};var _0x57667e={};var _0x3fd6ee;var _0x19c425;return db['SmsQueue'][_0x65f6('0x54')]({'where':{'id':_0x3efa55['params']['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x8adb47,null))[_0x65f6('0x23')](function(_0xd87bec){if(_0xd87bec){_0x3fd6ee=_0xd87bec;_0x57667e[_0x65f6('0x2e')]=_[_0x65f6('0x30')](db['User'][_0x65f6('0x2a')]);_0x57667e[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0x3efa55[_0x65f6('0x2f')]);_0x57667e[_0x65f6('0x31')]=_['intersection'](_0x57667e['model'],_0x57667e[_0x65f6('0x2f')]);_0x4171a1[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x57667e[_0x65f6('0x2e')],qs['fields'](_0x3efa55['query']['fields']));_0x4171a1[_0x65f6('0x33')]=_0x4171a1[_0x65f6('0x33')][_0x65f6('0x35')]?_0x4171a1['attributes']:_0x57667e[_0x65f6('0x2e')];_0x4171a1[_0x65f6('0x38')]=qs[_0x65f6('0x39')](_0x3efa55[_0x65f6('0x2f')][_0x65f6('0x39')]);_0x4171a1['where']=qs[_0x65f6('0x31')](_[_0x65f6('0x3a')](_0x3efa55['query'],_0x57667e['filters']));if(_0x3efa55[_0x65f6('0x2f')][_0x65f6('0x3b')]){_0x4171a1[_0x65f6('0x3c')]=_[_0x65f6('0x3d')](_0x4171a1[_0x65f6('0x3c')],{'$or':_['map'](_0x4171a1[_0x65f6('0x33')],function(_0x4b080a){var _0x280c96={};_0x280c96[_0x4b080a]={'$like':'%'+_0x3efa55['query'][_0x65f6('0x3b')]+'%'};return _0x280c96;})});}_0x4171a1=_['merge']({},_0x4171a1,_0x3efa55[_0x65f6('0x3f')]);return _0x3fd6ee['getAgents'](_0x4171a1);}})[_0x65f6('0x23')](function(_0x3b9aed){if(_0x3b9aed){_0x19c425=_0x3b9aed['length'];if(!_0x3efa55['query'][_0x65f6('0x56')](_0x65f6('0x36'))){_0x4171a1[_0x65f6('0x37')]=qs[_0x65f6('0x37')](_0x3efa55[_0x65f6('0x2f')][_0x65f6('0x37')]);_0x4171a1[_0x65f6('0x1d')]=qs[_0x65f6('0x1d')](_0x3efa55[_0x65f6('0x2f')][_0x65f6('0x1d')]);}return _0x3fd6ee[_0x65f6('0x84')](_0x4171a1);}})[_0x65f6('0x23')](function(_0x264d8b){if(_0x264d8b){return _0x264d8b?{'count':_0x19c425,'rows':_0x264d8b}:null;}})[_0x65f6('0x23')](respondWithResult(_0x8adb47,null))[_0x65f6('0x46')](handleError(_0x8adb47,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 11ca141..efd4266 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 _0x5843=['hasOwnProperty','hook','exports','events','../../mysqldb','save','remove','emit'];(function(_0x4bcf38,_0x3c12be){var _0x4a89be=function(_0x3215a6){while(--_0x3215a6){_0x4bcf38['push'](_0x4bcf38['shift']());}};_0x4a89be(++_0x3c12be);}(_0x5843,0x17b));var _0x3584=function(_0x5a9ee5,_0x301435){_0x5a9ee5=_0x5a9ee5-0x0;var _0x50c322=_0x5843[_0x5a9ee5];return _0x50c322;};'use strict';var EventEmitter=require(_0x3584('0x0'));var SmsQueue=require(_0x3584('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3584('0x2'),'afterUpdate':'update','afterDestroy':_0x3584('0x3')};function emitEvent(_0x4e6c5c){return function(_0x390571,_0x11d4e2,_0x379e5d){SmsQueueEvents['emit'](_0x4e6c5c+':'+_0x390571['id'],_0x390571);SmsQueueEvents[_0x3584('0x4')](_0x4e6c5c,_0x390571);_0x379e5d(null);};}for(var e in events){if(events[_0x3584('0x5')](e)){var event=events[e];SmsQueue[_0x3584('0x6')](e,emitEvent(event));}}module[_0x3584('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xb315=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x126860,_0x35b557){var _0x19555b=function(_0x5a0d1a){while(--_0x5a0d1a){_0x126860['push'](_0x126860['shift']());}};_0x19555b(++_0x35b557);}(_0xb315,0x6f));var _0x5b31=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xb315[_0xbe200f];return _0x192597;};'use strict';var EventEmitter=require(_0x5b31('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5b31('0x1')](0x0);var events={'afterCreate':_0x5b31('0x2'),'afterUpdate':_0x5b31('0x3'),'afterDestroy':_0x5b31('0x4')};function emitEvent(_0x4f1704){return function(_0xa46410,_0x1cac89,_0xd0c62b){SmsQueueEvents[_0x5b31('0x5')](_0x4f1704+':'+_0xa46410['id'],_0xa46410);SmsQueueEvents['emit'](_0x4f1704,_0xa46410);_0xd0c62b(null);};}for(var e in events){if(events[_0x5b31('0x6')](e)){var event=events[e];SmsQueue[_0x5b31('0x7')](e,emitEvent(event));}}module[_0x5b31('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 135a579..49f5058 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 _0x30dc=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','lodash','util','../../config/logger'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x30dc,0x173));var _0xc30d=function(_0x5dc0de,_0x25bba4){_0x5dc0de=_0x5dc0de-0x0;var _0x54ba0e=_0x30dc[_0x5dc0de];return _0x54ba0e;};'use strict';var _=require(_0xc30d('0x0'));var util=require(_0xc30d('0x1'));var logger=require(_0xc30d('0x2'))(_0xc30d('0x3'));var moment=require(_0xc30d('0x4'));var BPromise=require(_0xc30d('0x5'));var rp=require(_0xc30d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc30d('0x7'));var config=require(_0xc30d('0x8'));var attributes=require(_0xc30d('0x9'));module[_0xc30d('0xa')]=function(_0x375f07,_0xdd4ed2){return _0x375f07['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a9e=['moment','bluebird','request-promise','path','rimraf','exports','define','sms_queues','lodash','../../config/logger','api'];(function(_0x247ba9,_0x14b8c3){var _0x29ac34=function(_0x50e320){while(--_0x50e320){_0x247ba9['push'](_0x247ba9['shift']());}};_0x29ac34(++_0x14b8c3);}(_0x0a9e,0x97));var _0xe0a9=function(_0xbdffe4,_0x4b50e3){_0xbdffe4=_0xbdffe4-0x0;var _0x4f524e=_0x0a9e[_0xbdffe4];return _0x4f524e;};'use strict';var _=require(_0xe0a9('0x0'));var util=require('util');var logger=require(_0xe0a9('0x1'))(_0xe0a9('0x2'));var moment=require(_0xe0a9('0x3'));var BPromise=require(_0xe0a9('0x4'));var rp=require(_0xe0a9('0x5'));var fs=require('fs');var path=require(_0xe0a9('0x6'));var rimraf=require(_0xe0a9('0x7'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0xe0a9('0x8')]=function(_0x326543,_0x4dbc9b){return _0x326543[_0xe0a9('0x9')]('SmsQueue',attributes,{'tableName':_0xe0a9('0xa'),'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 c7e18c2..3e17c74 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 _0xf63e=['message','result','GetSmsQueue','SmsQueue','findAll','raw','where','options','attributes','limit','include','map','model','catch','find','ShowSmsQueue','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf63e,0x1d8));var _0xef63=function(_0x7b3e5f,_0x4acd0c){_0x7b3e5f=_0x7b3e5f-0x0;var _0x537028=_0xf63e[_0x7b3e5f];return _0x537028;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xef63('0x0'));var BPromise=require(_0xef63('0x1'));var rs=require(_0xef63('0x2'));var fs=require('fs');var Redis=require(_0xef63('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xef63('0x4'));var logger=require(_0xef63('0x5'))(_0xef63('0x6'));var config=require(_0xef63('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xef63('0x8')][_0xef63('0x9')]({'port':0x232a});config[_0xef63('0xa')]=_[_0xef63('0xb')](config[_0xef63('0xa')],{'host':_0xef63('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xef63('0xa')]));require('./smsQueue.socket')[_0xef63('0xd')](socket);function respondWithRpcPromise(_0xee0216,_0x562461,_0x43e5cd){return new BPromise(function(_0x34882f,_0xa22bb0){return client[_0xef63('0xe')](_0xee0216,_0x43e5cd)['then'](function(_0x49c2e2){logger[_0xef63('0xf')](_0xef63('0x10'),_0x562461,_0xef63('0x11'));logger[_0xef63('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x562461,_0xef63('0x11'),JSON[_0xef63('0x13')](_0x49c2e2));if(_0x49c2e2[_0xef63('0x14')]){if(_0x49c2e2['error'][_0xef63('0x15')]===0x1f4){logger[_0xef63('0x14')](_0xef63('0x10'),_0x562461,_0x49c2e2[_0xef63('0x14')]['message']);return _0xa22bb0(_0x49c2e2[_0xef63('0x14')][_0xef63('0x16')]);}logger['error'](_0xef63('0x10'),_0x562461,_0x49c2e2[_0xef63('0x14')][_0xef63('0x16')]);return _0x34882f(_0x49c2e2[_0xef63('0x14')][_0xef63('0x16')]);}else{logger[_0xef63('0xf')]('SmsQueue,\x20%s,\x20%s',_0x562461,'request\x20sent');_0x34882f(_0x49c2e2[_0xef63('0x17')][_0xef63('0x16')]);}})['catch'](function(_0x2c8d22){logger[_0xef63('0x14')](_0xef63('0x10'),_0x562461,_0x2c8d22);_0xa22bb0(_0x2c8d22);});});}exports[_0xef63('0x18')]=function(_0x50703e){var _0x2e9cbd=this;return new Promise(function(_0x399217,_0x49f11e){return db[_0xef63('0x19')][_0xef63('0x1a')]({'raw':_0x50703e['options']?_0x50703e['options'][_0xef63('0x1b')]===undefined?!![]:![]:!![],'where':_0x50703e['options']?_0x50703e['options'][_0xef63('0x1c')]||null:null,'attributes':_0x50703e[_0xef63('0x1d')]?_0x50703e[_0xef63('0x1d')][_0xef63('0x1e')]||null:null,'limit':_0x50703e[_0xef63('0x1d')]?_0x50703e[_0xef63('0x1d')][_0xef63('0x1f')]||null:null,'include':_0x50703e[_0xef63('0x1d')]?_0x50703e[_0xef63('0x1d')][_0xef63('0x20')]?_[_0xef63('0x21')](_0x50703e[_0xef63('0x1d')][_0xef63('0x20')],function(_0xadfbdb){return{'model':db[_0xadfbdb[_0xef63('0x22')]],'as':_0xadfbdb['as'],'attributes':_0xadfbdb[_0xef63('0x1e')],'include':_0xadfbdb[_0xef63('0x20')]?_['map'](_0xadfbdb[_0xef63('0x20')],function(_0x2f91c5){return{'model':db[_0x2f91c5[_0xef63('0x22')]],'as':_0x2f91c5['as'],'attributes':_0x2f91c5[_0xef63('0x1e')],'include':_0x2f91c5['include']?_[_0xef63('0x21')](_0x2f91c5[_0xef63('0x20')],function(_0x523849){return{'model':db[_0x523849[_0xef63('0x22')]],'as':_0x523849['as'],'attributes':_0x523849[_0xef63('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x651e10){logger[_0xef63('0xf')](_0xef63('0x18'),_0x50703e);logger['debug'](_0xef63('0x18'),_0x50703e,JSON[_0xef63('0x13')](_0x651e10));_0x399217(_0x651e10);})[_0xef63('0x23')](function(_0xf6d055){logger[_0xef63('0x14')](_0xef63('0x18'),_0xf6d055[_0xef63('0x16')],_0x50703e);_0x49f11e(_0x2e9cbd['error'](0x1f4,_0xf6d055[_0xef63('0x16')]));});});};exports['ShowSmsQueue']=function(_0x3a0e28){var _0x3b0bce=this;return new Promise(function(_0x10a2ed,_0x261098){return db['SmsQueue'][_0xef63('0x24')]({'raw':_0x3a0e28[_0xef63('0x1d')]?_0x3a0e28[_0xef63('0x1d')][_0xef63('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a0e28['options']?_0x3a0e28[_0xef63('0x1d')][_0xef63('0x1c')]||null:null,'attributes':_0x3a0e28[_0xef63('0x1d')]?_0x3a0e28[_0xef63('0x1d')]['attributes']||null:null,'include':_0x3a0e28['options']?_0x3a0e28[_0xef63('0x1d')]['include']?_[_0xef63('0x21')](_0x3a0e28[_0xef63('0x1d')][_0xef63('0x20')],function(_0x1adea0){return{'model':db[_0x1adea0[_0xef63('0x22')]],'as':_0x1adea0['as'],'attributes':_0x1adea0[_0xef63('0x1e')],'include':_0x1adea0['include']?_['map'](_0x1adea0[_0xef63('0x20')],function(_0x5c728c){return{'model':db[_0x5c728c['model']],'as':_0x5c728c['as'],'attributes':_0x5c728c['attributes'],'include':_0x5c728c[_0xef63('0x20')]?_[_0xef63('0x21')](_0x5c728c[_0xef63('0x20')],function(_0xcdaa7e){return{'model':db[_0xcdaa7e[_0xef63('0x22')]],'as':_0xcdaa7e['as'],'attributes':_0xcdaa7e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43eb30){logger[_0xef63('0xf')](_0xef63('0x25'),_0x3a0e28);logger[_0xef63('0x12')](_0xef63('0x25'),_0x3a0e28,JSON['stringify'](_0x43eb30));_0x10a2ed(_0x43eb30);})['catch'](function(_0x31edf4){logger[_0xef63('0x14')](_0xef63('0x25'),_0x31edf4[_0xef63('0x16')],_0x3a0e28);_0x261098(_0x3b0bce[_0xef63('0x14')](0x1f4,_0x31edf4[_0xef63('0x16')]));});});}; \ No newline at end of file +var _0xa1f6=['localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','SmsQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults'];(function(_0xa51855,_0x27ad4b){var _0x58050f=function(_0x465a6b){while(--_0x465a6b){_0xa51855['push'](_0xa51855['shift']());}};_0x58050f(++_0x27ad4b);}(_0xa1f6,0x13b));var _0x6a1f=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xa1f6[_0x528575];return _0x3063b7;};'use strict';var _=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var moment=require('moment');var BPromise=require(_0x6a1f('0x2'));var rs=require(_0x6a1f('0x3'));var fs=require('fs');var Redis=require(_0x6a1f('0x4'));var db=require(_0x6a1f('0x5'))['db'];var utils=require(_0x6a1f('0x6'));var logger=require(_0x6a1f('0x7'))(_0x6a1f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6a1f('0x9')][_0x6a1f('0xa')]({'port':0x232a});config[_0x6a1f('0xb')]=_[_0x6a1f('0xc')](config['redis'],{'host':_0x6a1f('0xd'),'port':0x18eb});var socket=require(_0x6a1f('0xe'))(new Redis(config[_0x6a1f('0xb')]));require(_0x6a1f('0xf'))[_0x6a1f('0x10')](socket);function respondWithRpcPromise(_0x2cf5cc,_0x335343,_0x3538c1){return new BPromise(function(_0x43632f,_0x5a14c9){return client[_0x6a1f('0x11')](_0x2cf5cc,_0x3538c1)[_0x6a1f('0x12')](function(_0x5849f2){logger[_0x6a1f('0x13')](_0x6a1f('0x14'),_0x335343,_0x6a1f('0x15'));logger[_0x6a1f('0x16')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x335343,'request\x20sent',JSON[_0x6a1f('0x17')](_0x5849f2));if(_0x5849f2['error']){if(_0x5849f2[_0x6a1f('0x18')][_0x6a1f('0x19')]===0x1f4){logger['error'](_0x6a1f('0x14'),_0x335343,_0x5849f2[_0x6a1f('0x18')]['message']);return _0x5a14c9(_0x5849f2[_0x6a1f('0x18')][_0x6a1f('0x1a')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x335343,_0x5849f2[_0x6a1f('0x18')][_0x6a1f('0x1a')]);return _0x43632f(_0x5849f2['error'][_0x6a1f('0x1a')]);}else{logger[_0x6a1f('0x13')](_0x6a1f('0x14'),_0x335343,_0x6a1f('0x15'));_0x43632f(_0x5849f2['result'][_0x6a1f('0x1a')]);}})[_0x6a1f('0x1b')](function(_0x34ddad){logger[_0x6a1f('0x18')](_0x6a1f('0x14'),_0x335343,_0x34ddad);_0x5a14c9(_0x34ddad);});});}exports['GetSmsQueue']=function(_0x2113b3){var _0x545f67=this;return new Promise(function(_0x1e3f09,_0x1d79b9){return db['SmsQueue'][_0x6a1f('0x1c')]({'raw':_0x2113b3[_0x6a1f('0x1d')]?_0x2113b3[_0x6a1f('0x1d')][_0x6a1f('0x1e')]===undefined?!![]:![]:!![],'where':_0x2113b3[_0x6a1f('0x1d')]?_0x2113b3[_0x6a1f('0x1d')][_0x6a1f('0x1f')]||null:null,'attributes':_0x2113b3[_0x6a1f('0x1d')]?_0x2113b3[_0x6a1f('0x1d')][_0x6a1f('0x20')]||null:null,'limit':_0x2113b3['options']?_0x2113b3[_0x6a1f('0x1d')][_0x6a1f('0x21')]||null:null,'include':_0x2113b3[_0x6a1f('0x1d')]?_0x2113b3[_0x6a1f('0x1d')][_0x6a1f('0x22')]?_[_0x6a1f('0x23')](_0x2113b3['options'][_0x6a1f('0x22')],function(_0x335069){return{'model':db[_0x335069['model']],'as':_0x335069['as'],'attributes':_0x335069['attributes'],'include':_0x335069[_0x6a1f('0x22')]?_[_0x6a1f('0x23')](_0x335069[_0x6a1f('0x22')],function(_0x315ee9){return{'model':db[_0x315ee9[_0x6a1f('0x24')]],'as':_0x315ee9['as'],'attributes':_0x315ee9['attributes'],'include':_0x315ee9[_0x6a1f('0x22')]?_[_0x6a1f('0x23')](_0x315ee9['include'],function(_0x1be994){return{'model':db[_0x1be994[_0x6a1f('0x24')]],'as':_0x1be994['as'],'attributes':_0x1be994[_0x6a1f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x517d50){logger[_0x6a1f('0x13')](_0x6a1f('0x25'),_0x2113b3);logger['debug'](_0x6a1f('0x25'),_0x2113b3,JSON['stringify'](_0x517d50));_0x1e3f09(_0x517d50);})[_0x6a1f('0x1b')](function(_0x46f70d){logger[_0x6a1f('0x18')]('GetSmsQueue',_0x46f70d[_0x6a1f('0x1a')],_0x2113b3);_0x1d79b9(_0x545f67[_0x6a1f('0x18')](0x1f4,_0x46f70d[_0x6a1f('0x1a')]));});});};exports[_0x6a1f('0x26')]=function(_0x220e7e){var _0x573251=this;return new Promise(function(_0x206040,_0x46df3f){return db[_0x6a1f('0x27')][_0x6a1f('0x28')]({'raw':_0x220e7e[_0x6a1f('0x1d')]?_0x220e7e['options'][_0x6a1f('0x1e')]===undefined?!![]:![]:!![],'where':_0x220e7e[_0x6a1f('0x1d')]?_0x220e7e[_0x6a1f('0x1d')][_0x6a1f('0x1f')]||null:null,'attributes':_0x220e7e[_0x6a1f('0x1d')]?_0x220e7e['options'][_0x6a1f('0x20')]||null:null,'include':_0x220e7e[_0x6a1f('0x1d')]?_0x220e7e[_0x6a1f('0x1d')][_0x6a1f('0x22')]?_[_0x6a1f('0x23')](_0x220e7e[_0x6a1f('0x1d')][_0x6a1f('0x22')],function(_0x397336){return{'model':db[_0x397336[_0x6a1f('0x24')]],'as':_0x397336['as'],'attributes':_0x397336[_0x6a1f('0x20')],'include':_0x397336['include']?_[_0x6a1f('0x23')](_0x397336[_0x6a1f('0x22')],function(_0x1c0466){return{'model':db[_0x1c0466[_0x6a1f('0x24')]],'as':_0x1c0466['as'],'attributes':_0x1c0466[_0x6a1f('0x20')],'include':_0x1c0466[_0x6a1f('0x22')]?_[_0x6a1f('0x23')](_0x1c0466['include'],function(_0x3a61b9){return{'model':db[_0x3a61b9[_0x6a1f('0x24')]],'as':_0x3a61b9['as'],'attributes':_0x3a61b9[_0x6a1f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cbd3b){logger[_0x6a1f('0x13')]('ShowSmsQueue',_0x220e7e);logger[_0x6a1f('0x16')](_0x6a1f('0x26'),_0x220e7e,JSON['stringify'](_0x3cbd3b));_0x206040(_0x3cbd3b);})['catch'](function(_0x8d003a){logger[_0x6a1f('0x18')](_0x6a1f('0x26'),_0x8d003a['message'],_0x220e7e);_0x46df3f(_0x573251[_0x6a1f('0x18')](0x1f4,_0x8d003a[_0x6a1f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 531ab24..58cd111 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 _0x4e64=['./smsQueue.events','save','remove','emit','removeListener','length','smsQueue:'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x4e64,0xc4));var _0x44e6=function(_0x1b89be,_0x55ceec){_0x1b89be=_0x1b89be-0x0;var _0x55f150=_0x4e64[_0x1b89be];return _0x55f150;};'use strict';var SmsQueueEvents=require(_0x44e6('0x0'));var events=[_0x44e6('0x1'),_0x44e6('0x2'),'update'];function createListener(_0x4a2812,_0xabeca3){return function(_0xa3aff1){_0xabeca3[_0x44e6('0x3')](_0x4a2812,_0xa3aff1);};}function removeListener(_0x588133,_0x404ab9){return function(){SmsQueueEvents[_0x44e6('0x4')](_0x588133,_0x404ab9);};}exports['register']=function(_0x3d333e){for(var _0x307a46=0x0,_0x1b8aaa=events[_0x44e6('0x5')];_0x307a46<_0x1b8aaa;_0x307a46++){var _0xf1af51=events[_0x307a46];var _0x1e25ae=createListener(_0x44e6('0x6')+_0xf1af51,_0x3d333e);SmsQueueEvents['on'](_0xf1af51,_0x1e25ae);}}; \ No newline at end of file +var _0x7366=['./smsQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x562a79,_0x41fd4a){var _0x225281=function(_0x2e8913){while(--_0x2e8913){_0x562a79['push'](_0x562a79['shift']());}};_0x225281(++_0x41fd4a);}(_0x7366,0xc8));var _0x6736=function(_0x4976eb,_0x4b09d1){_0x4976eb=_0x4976eb-0x0;var _0x5dd7b2=_0x7366[_0x4976eb];return _0x5dd7b2;};'use strict';var SmsQueueEvents=require(_0x6736('0x0'));var events=[_0x6736('0x1'),_0x6736('0x2'),_0x6736('0x3')];function createListener(_0x701766,_0x29cd9e){return function(_0x44d636){_0x29cd9e[_0x6736('0x4')](_0x701766,_0x44d636);};}function removeListener(_0x4f31aa,_0x1115a7){return function(){SmsQueueEvents[_0x6736('0x5')](_0x4f31aa,_0x1115a7);};}exports[_0x6736('0x6')]=function(_0x132c0b){for(var _0x1b866b=0x0,_0x49c70d=events[_0x6736('0x7')];_0x1b866b<_0x49c70d;_0x1b866b++){var _0x16ee0d=events[_0x1b866b];var _0x4491f3=createListener('smsQueue:'+_0x16ee0d,_0x132c0b);SmsQueueEvents['on'](_0x16ee0d,_0x4491f3);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 796d36c..907ef66 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 _0xf933=['post','create','/:id','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show'];(function(_0x799277,_0x574d5f){var _0x56d41f=function(_0x5e009e){while(--_0x5e009e){_0x799277['push'](_0x799277['shift']());}};_0x56d41f(++_0x574d5f);}(_0xf933,0x159));var _0x3f93=function(_0x58cbde,_0x4b0f62){_0x58cbde=_0x58cbde-0x0;var _0x5799f3=_0xf933[_0x58cbde];return _0x5799f3;};'use strict';var multer=require(_0x3f93('0x0'));var util=require(_0x3f93('0x1'));var path=require(_0x3f93('0x2'));var timeout=require(_0x3f93('0x3'));var express=require(_0x3f93('0x4'));var router=express[_0x3f93('0x5')]();var auth=require(_0x3f93('0x6'));var interaction=require(_0x3f93('0x7'));var config=require(_0x3f93('0x8'));var controller=require('./smsQueueReport.controller');router[_0x3f93('0x9')]('/',auth[_0x3f93('0xa')](),controller[_0x3f93('0xb')]);router[_0x3f93('0x9')](_0x3f93('0xc'),auth[_0x3f93('0xa')](),controller[_0x3f93('0xd')]);router[_0x3f93('0x9')]('/:id',auth[_0x3f93('0xa')](),controller[_0x3f93('0xe')]);router[_0x3f93('0xf')]('/',auth[_0x3f93('0xa')](),controller[_0x3f93('0x10')]);router['put'](_0x3f93('0x11'),auth[_0x3f93('0xa')](),controller[_0x3f93('0x12')]);router[_0x3f93('0x13')](_0x3f93('0x11'),auth[_0x3f93('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf4f8=['delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x45ac2d,_0x7b683e){var _0x3f82fa=function(_0x47a4a4){while(--_0x47a4a4){_0x45ac2d['push'](_0x45ac2d['shift']());}};_0x3f82fa(++_0x7b683e);}(_0xf4f8,0x129));var _0x8f4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf4f8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8f4f('0x0'));var util=require(_0x8f4f('0x1'));var path=require(_0x8f4f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8f4f('0x3')]();var auth=require(_0x8f4f('0x4'));var interaction=require(_0x8f4f('0x5'));var config=require(_0x8f4f('0x6'));var controller=require(_0x8f4f('0x7'));router[_0x8f4f('0x8')]('/',auth[_0x8f4f('0x9')](),controller[_0x8f4f('0xa')]);router[_0x8f4f('0x8')](_0x8f4f('0xb'),auth['isAuthenticated'](),controller[_0x8f4f('0xc')]);router[_0x8f4f('0x8')](_0x8f4f('0xd'),auth[_0x8f4f('0x9')](),controller[_0x8f4f('0xe')]);router[_0x8f4f('0xf')]('/',auth['isAuthenticated'](),controller[_0x8f4f('0x10')]);router['put']('/:id',auth[_0x8f4f('0x9')](),controller[_0x8f4f('0x11')]);router[_0x8f4f('0x12')](_0x8f4f('0xd'),auth[_0x8f4f('0x9')](),controller[_0x8f4f('0x13')]);module[_0x8f4f('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 7705036..1f85a97 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 _0x8583=['sequelize','exports','STRING','DATE','moment'];(function(_0x2462c7,_0x51b09d){var _0x1afbf7=function(_0xea68dc){while(--_0xea68dc){_0x2462c7['push'](_0x2462c7['shift']());}};_0x1afbf7(++_0x51b09d);}(_0x8583,0x121));var _0x3858=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8583[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x3858('0x0'));var Sequelize=require(_0x3858('0x1'));module[_0x3858('0x2')]={'uniqueid':{'type':Sequelize[_0x3858('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3858('0x3')]},'joinAt':{'type':Sequelize[_0x3858('0x4')]},'leaveAt':{'type':Sequelize[_0x3858('0x4')]},'acceptAt':{'type':Sequelize[_0x3858('0x4')]},'exitAt':{'type':Sequelize[_0x3858('0x4')]},'reason':{'type':Sequelize[_0x3858('0x3')]}}; \ No newline at end of file +var _0x9dd4=['DATE','moment','exports','STRING'];(function(_0xa1dc2c,_0x6d230d){var _0x4caf06=function(_0x107e1c){while(--_0x107e1c){_0xa1dc2c['push'](_0xa1dc2c['shift']());}};_0x4caf06(++_0x6d230d);}(_0x9dd4,0x121));var _0x49dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dd4[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x49dd('0x0'));var Sequelize=require('sequelize');module[_0x49dd('0x1')]={'uniqueid':{'type':Sequelize[_0x49dd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x49dd('0x2')]},'joinAt':{'type':Sequelize[_0x49dd('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x49dd('0x3')]},'reason':{'type':Sequelize[_0x49dd('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 817a462..f5d71f8 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 _0x8b8c=['key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','VIRTUAL','options','then','count','includeAll','include','findAll','rows','catch','show','merge','create','body','find','params','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','SmsQueueReport','fieldName','type'];(function(_0x40bdbc,_0x3fabcd){var _0xc603a8=function(_0x17c0e6){while(--_0x17c0e6){_0x40bdbc['push'](_0x40bdbc['shift']());}};_0xc603a8(++_0x3fabcd);}(_0x8b8c,0x151));var _0xc8b8=function(_0x6ed8d6,_0x4f3611){_0x6ed8d6=_0x6ed8d6-0x0;var _0x174cec=_0x8b8c[_0x6ed8d6];return _0x174cec;};'use strict';var pdf=require(_0xc8b8('0x0'));var emlformat=require(_0xc8b8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc8b8('0x2'));var jsonpatch=require(_0xc8b8('0x3'));var rp=require(_0xc8b8('0x4'));var moment=require(_0xc8b8('0x5'));var BPromise=require(_0xc8b8('0x6'));var Mustache=require(_0xc8b8('0x7'));var util=require(_0xc8b8('0x8'));var path=require(_0xc8b8('0x9'));var sox=require(_0xc8b8('0xa'));var csv=require('to-csv');var ejs=require(_0xc8b8('0xb'));var fs=require('fs');var _=require(_0xc8b8('0xc'));var squel=require(_0xc8b8('0xd'));var crypto=require(_0xc8b8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc8b8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc8b8('0x10'));var Redis=require(_0xc8b8('0x11'));var authService=require(_0xc8b8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8b8('0x13'))(_0xc8b8('0x14'));var utils=require(_0xc8b8('0x15'));var config=require(_0xc8b8('0x16'));var db=require(_0xc8b8('0x17'))['db'];function respondWithStatusCode(_0xa7f78b,_0x29f9ba){_0x29f9ba=_0x29f9ba||0xcc;return function(_0x1c4d63){if(_0x1c4d63){return _0xa7f78b[_0xc8b8('0x18')](_0x29f9ba);}return _0xa7f78b[_0xc8b8('0x19')](_0x29f9ba)[_0xc8b8('0x1a')]();};}function respondWithResult(_0x3fdab8,_0x88159c){_0x88159c=_0x88159c||0xc8;return function(_0x59ea32){if(_0x59ea32){return _0x3fdab8[_0xc8b8('0x19')](_0x88159c)[_0xc8b8('0x1b')](_0x59ea32);}};}function respondWithFilteredResult(_0x482628,_0x1f4079){return function(_0x2428b9){if(_0x2428b9){var _0x513a75=_0x2428b9['count'],_0x19ca44=_0x1f4079[_0xc8b8('0x1c')],_0x14f580=_0x1f4079[_0xc8b8('0x1c')]+_0x1f4079['limit'],_0x4d61c7;if(_0x14f580>=_0x513a75){_0x14f580=_0x513a75;_0x4d61c7=0xc8;}else{_0x4d61c7=0xce;}_0x482628[_0xc8b8('0x19')](_0x4d61c7);return _0x482628[_0xc8b8('0x1d')](_0xc8b8('0x1e'),_0x19ca44+'-'+_0x14f580+'/'+_0x513a75)[_0xc8b8('0x1b')](_0x2428b9);}return null;};}function patchUpdates(_0x5dcf54){return function(_0x230982){try{jsonpatch[_0xc8b8('0x1f')](_0x230982,_0x5dcf54,!![]);}catch(_0x1c9fab){return BPromise[_0xc8b8('0x20')](_0x1c9fab);}return _0x230982[_0xc8b8('0x21')]();};}function saveUpdates(_0x13a8cb,_0xd51139){return function(_0x48f5c5){if(_0x48f5c5){return _0x48f5c5[_0xc8b8('0x22')](_0x13a8cb)['then'](function(_0x43fbfa){return _0x43fbfa;});}return null;};}function removeEntity(_0x1dc47f,_0x2b23de){return function(_0x550026){if(_0x550026){return _0x550026['destroy']()['then'](function(){_0x1dc47f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfb9212,_0x35c381){return function(_0x5cc7af){if(!_0x5cc7af){_0xfb9212[_0xc8b8('0x18')](0x194);}return _0x5cc7af;};}function handleError(_0x53f7fd,_0x302ccb){_0x302ccb=_0x302ccb||0x1f4;return function(_0x54a70c){logger['error'](_0x54a70c[_0xc8b8('0x23')]);if(_0x54a70c[_0xc8b8('0x24')]){delete _0x54a70c[_0xc8b8('0x24')];}_0x53f7fd[_0xc8b8('0x19')](_0x302ccb)[_0xc8b8('0x25')](_0x54a70c);};}exports[_0xc8b8('0x26')]=function(_0x34dfc5,_0x53173f){var _0x5c71e3={},_0x1c124e={},_0x3c439d={'count':0x0,'rows':[]};var _0x56ce5e=_[_0xc8b8('0x27')](db[_0xc8b8('0x28')]['rawAttributes'],function(_0x3d9d23){return{'name':_0x3d9d23[_0xc8b8('0x29')],'type':_0x3d9d23[_0xc8b8('0x2a')][_0xc8b8('0x2b')]};});_0x1c124e[_0xc8b8('0x2c')]=_[_0xc8b8('0x27')](_0x56ce5e,'name');_0x1c124e['query']=_[_0xc8b8('0x2d')](_0x34dfc5['query']);_0x1c124e['filters']=_[_0xc8b8('0x2e')](_0x1c124e[_0xc8b8('0x2c')],_0x1c124e[_0xc8b8('0x2f')]);_0x5c71e3['attributes']=_['intersection'](_0x1c124e['model'],qs[_0xc8b8('0x30')](_0x34dfc5[_0xc8b8('0x2f')]['fields']));_0x5c71e3[_0xc8b8('0x31')]=_0x5c71e3['attributes'][_0xc8b8('0x32')]?_0x5c71e3['attributes']:_0x1c124e[_0xc8b8('0x2c')];if(!_0x34dfc5[_0xc8b8('0x2f')][_0xc8b8('0x33')](_0xc8b8('0x34'))){_0x5c71e3[_0xc8b8('0x35')]=qs[_0xc8b8('0x35')](_0x34dfc5[_0xc8b8('0x2f')][_0xc8b8('0x35')]);_0x5c71e3[_0xc8b8('0x1c')]=qs[_0xc8b8('0x1c')](_0x34dfc5[_0xc8b8('0x2f')][_0xc8b8('0x1c')]);}_0x5c71e3['order']=qs[_0xc8b8('0x36')](_0x34dfc5[_0xc8b8('0x2f')]['sort']);_0x5c71e3['where']=qs[_0xc8b8('0x37')](_[_0xc8b8('0x38')](_0x34dfc5[_0xc8b8('0x2f')],_0x1c124e[_0xc8b8('0x37')]));if(_0x34dfc5[_0xc8b8('0x2f')][_0xc8b8('0x39')]){_0x5c71e3[_0xc8b8('0x3a')]=_['merge'](_0x5c71e3[_0xc8b8('0x3a')],{'$or':_[_0xc8b8('0x27')](_0x56ce5e,function(_0x198f36){if(_0x198f36[_0xc8b8('0x2a')]!==_0xc8b8('0x3b')){var _0x4a9f9b={};_0x4a9f9b[_0x198f36[_0xc8b8('0x24')]]={'$like':'%'+_0x34dfc5[_0xc8b8('0x2f')]['filter']+'%'};return _0x4a9f9b;}})});}_0x5c71e3=_['merge']({},_0x5c71e3,_0x34dfc5[_0xc8b8('0x3c')]);var _0x16c2ee={'where':_0x5c71e3['where']};return db[_0xc8b8('0x28')]['count'](_0x16c2ee)[_0xc8b8('0x3d')](function(_0x46f519){_0x3c439d[_0xc8b8('0x3e')]=_0x46f519;if(_0x34dfc5[_0xc8b8('0x2f')][_0xc8b8('0x3f')]){_0x5c71e3[_0xc8b8('0x40')]=[{'all':!![]}];}return db[_0xc8b8('0x28')][_0xc8b8('0x41')](_0x5c71e3);})[_0xc8b8('0x3d')](function(_0x59ea61){_0x3c439d[_0xc8b8('0x42')]=_0x59ea61;return _0x3c439d;})[_0xc8b8('0x3d')](respondWithFilteredResult(_0x53173f,_0x5c71e3))[_0xc8b8('0x43')](handleError(_0x53173f,null));};exports[_0xc8b8('0x44')]=function(_0x42f178,_0x763080){var _0x11ebf1={'raw':!![],'where':{'id':_0x42f178['params']['id']}},_0xba871d={};_0xba871d['model']=_[_0xc8b8('0x2d')](db['SmsQueueReport']['rawAttributes']);_0xba871d[_0xc8b8('0x2f')]=_[_0xc8b8('0x2d')](_0x42f178['query']);_0xba871d['filters']=_[_0xc8b8('0x2e')](_0xba871d['model'],_0xba871d[_0xc8b8('0x2f')]);_0x11ebf1['attributes']=_[_0xc8b8('0x2e')](_0xba871d[_0xc8b8('0x2c')],qs[_0xc8b8('0x30')](_0x42f178['query']['fields']));_0x11ebf1[_0xc8b8('0x31')]=_0x11ebf1[_0xc8b8('0x31')]['length']?_0x11ebf1[_0xc8b8('0x31')]:_0xba871d[_0xc8b8('0x2c')];if(_0x42f178['query'][_0xc8b8('0x3f')]){_0x11ebf1[_0xc8b8('0x40')]=[{'all':!![]}];}_0x11ebf1=_[_0xc8b8('0x45')]({},_0x11ebf1,_0x42f178[_0xc8b8('0x3c')]);return db[_0xc8b8('0x28')]['find'](_0x11ebf1)[_0xc8b8('0x3d')](handleEntityNotFound(_0x763080,null))[_0xc8b8('0x3d')](respondWithResult(_0x763080,null))['catch'](handleError(_0x763080,null));};exports['create']=function(_0x1a5b26,_0x3c4f7f){return db[_0xc8b8('0x28')][_0xc8b8('0x46')](_0x1a5b26[_0xc8b8('0x47')],{})['then'](respondWithResult(_0x3c4f7f,0xc9))[_0xc8b8('0x43')](handleError(_0x3c4f7f,null));};exports[_0xc8b8('0x22')]=function(_0x380191,_0x3e749e){if(_0x380191['body']['id']){delete _0x380191[_0xc8b8('0x47')]['id'];}return db[_0xc8b8('0x28')][_0xc8b8('0x48')]({'where':{'id':_0x380191[_0xc8b8('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e749e,null))['then'](saveUpdates(_0x380191[_0xc8b8('0x47')],null))[_0xc8b8('0x3d')](respondWithResult(_0x3e749e,null))[_0xc8b8('0x43')](handleError(_0x3e749e,null));};exports[_0xc8b8('0x4a')]=function(_0x11e805,_0x1458e7){return db[_0xc8b8('0x28')]['find']({'where':{'id':_0x11e805[_0xc8b8('0x49')]['id']}})[_0xc8b8('0x3d')](handleEntityNotFound(_0x1458e7,null))[_0xc8b8('0x3d')](removeEntity(_0x1458e7,null))[_0xc8b8('0x43')](handleError(_0x1458e7,null));};exports[_0xc8b8('0x4b')]=function(_0x155170,_0x561da0){return db['SmsQueueReport'][_0xc8b8('0x4b')]()[_0xc8b8('0x3d')](respondWithResult(_0x561da0,null))[_0xc8b8('0x43')](handleError(_0x561da0,null));}; \ No newline at end of file +var _0x2a05=['find','create','body','params','destroy','describe','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','apply','reject','update','then','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x2a05,0x1f0));var _0x52a0=function(_0x390ac1,_0x427d1e){_0x390ac1=_0x390ac1-0x0;var _0x4bd968=_0x2a05[_0x390ac1];return _0x4bd968;};'use strict';var pdf=require(_0x52a0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x52a0('0x1'));var zipdir=require(_0x52a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x52a0('0x3'));var BPromise=require(_0x52a0('0x4'));var Mustache=require(_0x52a0('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x52a0('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x52a0('0x7'));var crypto=require(_0x52a0('0x8'));var jsforce=require(_0x52a0('0x9'));var deskjs=require(_0x52a0('0xa'));var toCsv=require('to-csv');var querystring=require(_0x52a0('0xb'));var Papa=require(_0x52a0('0xc'));var Redis=require(_0x52a0('0xd'));var authService=require(_0x52a0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x52a0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x52a0('0x10'))('api');var utils=require(_0x52a0('0x11'));var config=require(_0x52a0('0x12'));var db=require(_0x52a0('0x13'))['db'];function respondWithStatusCode(_0x48bfba,_0x56cfd7){_0x56cfd7=_0x56cfd7||0xcc;return function(_0x36824b){if(_0x36824b){return _0x48bfba[_0x52a0('0x14')](_0x56cfd7);}return _0x48bfba[_0x52a0('0x15')](_0x56cfd7)[_0x52a0('0x16')]();};}function respondWithResult(_0x3b4da4,_0x54d256){_0x54d256=_0x54d256||0xc8;return function(_0x3a59ff){if(_0x3a59ff){return _0x3b4da4['status'](_0x54d256)[_0x52a0('0x17')](_0x3a59ff);}};}function respondWithFilteredResult(_0x5e06c5,_0x1c5409){return function(_0x38d397){if(_0x38d397){var _0x3b5857=_0x38d397['count'],_0x237df9=_0x1c5409[_0x52a0('0x18')],_0x54867d=_0x1c5409[_0x52a0('0x18')]+_0x1c5409['limit'],_0x4e221b;if(_0x54867d>=_0x3b5857){_0x54867d=_0x3b5857;_0x4e221b=0xc8;}else{_0x4e221b=0xce;}_0x5e06c5[_0x52a0('0x15')](_0x4e221b);return _0x5e06c5['set']('Content-Range',_0x237df9+'-'+_0x54867d+'/'+_0x3b5857)[_0x52a0('0x17')](_0x38d397);}return null;};}function patchUpdates(_0x46699e){return function(_0x4b90ae){try{jsonpatch[_0x52a0('0x19')](_0x4b90ae,_0x46699e,!![]);}catch(_0x5eb3f0){return BPromise[_0x52a0('0x1a')](_0x5eb3f0);}return _0x4b90ae['save']();};}function saveUpdates(_0x1f54ac,_0x4e7abd){return function(_0xf7a536){if(_0xf7a536){return _0xf7a536[_0x52a0('0x1b')](_0x1f54ac)['then'](function(_0x5ee491){return _0x5ee491;});}return null;};}function removeEntity(_0x8a5e5f,_0x1b5282){return function(_0x5ba15c){if(_0x5ba15c){return _0x5ba15c['destroy']()[_0x52a0('0x1c')](function(){_0x8a5e5f[_0x52a0('0x15')](0xcc)[_0x52a0('0x16')]();});}};}function handleEntityNotFound(_0x3244e9,_0x62669a){return function(_0x23997c){if(!_0x23997c){_0x3244e9[_0x52a0('0x14')](0x194);}return _0x23997c;};}function handleError(_0x34430f,_0x1ea851){_0x1ea851=_0x1ea851||0x1f4;return function(_0x2a90e3){logger[_0x52a0('0x1d')](_0x2a90e3['stack']);if(_0x2a90e3[_0x52a0('0x1e')]){delete _0x2a90e3['name'];}_0x34430f[_0x52a0('0x15')](_0x1ea851)[_0x52a0('0x1f')](_0x2a90e3);};}exports[_0x52a0('0x20')]=function(_0x582354,_0x4ab300){var _0x262975={},_0x3d884a={},_0x50869c={'count':0x0,'rows':[]};var _0x45a48d=_[_0x52a0('0x21')](db[_0x52a0('0x22')][_0x52a0('0x23')],function(_0x285b70){return{'name':_0x285b70[_0x52a0('0x24')],'type':_0x285b70[_0x52a0('0x25')]['key']};});_0x3d884a[_0x52a0('0x26')]=_[_0x52a0('0x21')](_0x45a48d,_0x52a0('0x1e'));_0x3d884a['query']=_[_0x52a0('0x27')](_0x582354[_0x52a0('0x28')]);_0x3d884a[_0x52a0('0x29')]=_[_0x52a0('0x2a')](_0x3d884a['model'],_0x3d884a['query']);_0x262975[_0x52a0('0x2b')]=_['intersection'](_0x3d884a[_0x52a0('0x26')],qs[_0x52a0('0x2c')](_0x582354[_0x52a0('0x28')]['fields']));_0x262975[_0x52a0('0x2b')]=_0x262975['attributes'][_0x52a0('0x2d')]?_0x262975[_0x52a0('0x2b')]:_0x3d884a[_0x52a0('0x26')];if(!_0x582354[_0x52a0('0x28')][_0x52a0('0x2e')](_0x52a0('0x2f'))){_0x262975[_0x52a0('0x30')]=qs[_0x52a0('0x30')](_0x582354[_0x52a0('0x28')][_0x52a0('0x30')]);_0x262975[_0x52a0('0x18')]=qs[_0x52a0('0x18')](_0x582354[_0x52a0('0x28')]['offset']);}_0x262975[_0x52a0('0x31')]=qs[_0x52a0('0x32')](_0x582354[_0x52a0('0x28')][_0x52a0('0x32')]);_0x262975[_0x52a0('0x33')]=qs[_0x52a0('0x29')](_[_0x52a0('0x34')](_0x582354[_0x52a0('0x28')],_0x3d884a['filters']));if(_0x582354['query'][_0x52a0('0x35')]){_0x262975[_0x52a0('0x33')]=_[_0x52a0('0x36')](_0x262975['where'],{'$or':_[_0x52a0('0x21')](_0x45a48d,function(_0x4266c1){if(_0x4266c1[_0x52a0('0x25')]!==_0x52a0('0x37')){var _0x361cb7={};_0x361cb7[_0x4266c1[_0x52a0('0x1e')]]={'$like':'%'+_0x582354[_0x52a0('0x28')]['filter']+'%'};return _0x361cb7;}})});}_0x262975=_['merge']({},_0x262975,_0x582354[_0x52a0('0x38')]);var _0x2f68c0={'where':_0x262975['where']};return db[_0x52a0('0x22')]['count'](_0x2f68c0)[_0x52a0('0x1c')](function(_0x2c106a){_0x50869c[_0x52a0('0x39')]=_0x2c106a;if(_0x582354['query'][_0x52a0('0x3a')]){_0x262975[_0x52a0('0x3b')]=[{'all':!![]}];}return db[_0x52a0('0x22')][_0x52a0('0x3c')](_0x262975);})[_0x52a0('0x1c')](function(_0x2701fd){_0x50869c[_0x52a0('0x3d')]=_0x2701fd;return _0x50869c;})[_0x52a0('0x1c')](respondWithFilteredResult(_0x4ab300,_0x262975))[_0x52a0('0x3e')](handleError(_0x4ab300,null));};exports[_0x52a0('0x3f')]=function(_0x3d8dfd,_0x28b9c1){var _0x5109d4={'raw':!![],'where':{'id':_0x3d8dfd['params']['id']}},_0x1af571={};_0x1af571[_0x52a0('0x26')]=_['keys'](db[_0x52a0('0x22')][_0x52a0('0x23')]);_0x1af571[_0x52a0('0x28')]=_[_0x52a0('0x27')](_0x3d8dfd[_0x52a0('0x28')]);_0x1af571[_0x52a0('0x29')]=_[_0x52a0('0x2a')](_0x1af571[_0x52a0('0x26')],_0x1af571[_0x52a0('0x28')]);_0x5109d4['attributes']=_[_0x52a0('0x2a')](_0x1af571[_0x52a0('0x26')],qs[_0x52a0('0x2c')](_0x3d8dfd[_0x52a0('0x28')]['fields']));_0x5109d4[_0x52a0('0x2b')]=_0x5109d4[_0x52a0('0x2b')][_0x52a0('0x2d')]?_0x5109d4[_0x52a0('0x2b')]:_0x1af571[_0x52a0('0x26')];if(_0x3d8dfd[_0x52a0('0x28')][_0x52a0('0x3a')]){_0x5109d4['include']=[{'all':!![]}];}_0x5109d4=_['merge']({},_0x5109d4,_0x3d8dfd[_0x52a0('0x38')]);return db[_0x52a0('0x22')][_0x52a0('0x40')](_0x5109d4)[_0x52a0('0x1c')](handleEntityNotFound(_0x28b9c1,null))[_0x52a0('0x1c')](respondWithResult(_0x28b9c1,null))[_0x52a0('0x3e')](handleError(_0x28b9c1,null));};exports[_0x52a0('0x41')]=function(_0x1ccf00,_0x12c6ea){return db[_0x52a0('0x22')][_0x52a0('0x41')](_0x1ccf00[_0x52a0('0x42')],{})[_0x52a0('0x1c')](respondWithResult(_0x12c6ea,0xc9))[_0x52a0('0x3e')](handleError(_0x12c6ea,null));};exports[_0x52a0('0x1b')]=function(_0x4147d6,_0x4f0079){if(_0x4147d6[_0x52a0('0x42')]['id']){delete _0x4147d6['body']['id'];}return db[_0x52a0('0x22')][_0x52a0('0x40')]({'where':{'id':_0x4147d6[_0x52a0('0x43')]['id']}})[_0x52a0('0x1c')](handleEntityNotFound(_0x4f0079,null))[_0x52a0('0x1c')](saveUpdates(_0x4147d6[_0x52a0('0x42')],null))[_0x52a0('0x1c')](respondWithResult(_0x4f0079,null))[_0x52a0('0x3e')](handleError(_0x4f0079,null));};exports[_0x52a0('0x44')]=function(_0x6496ef,_0x43f352){return db['SmsQueueReport'][_0x52a0('0x40')]({'where':{'id':_0x6496ef['params']['id']}})['then'](handleEntityNotFound(_0x43f352,null))[_0x52a0('0x1c')](removeEntity(_0x43f352,null))['catch'](handleError(_0x43f352,null));};exports[_0x52a0('0x45')]=function(_0x3867fa,_0x16271e){return db[_0x52a0('0x22')][_0x52a0('0x45')]()[_0x52a0('0x1c')](respondWithResult(_0x16271e,null))[_0x52a0('0x3e')](handleError(_0x16271e,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index b8df6c8..6ff4da4 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 _0x2f38=['SmsQueueReport','report_sms_queue','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','define'];(function(_0x186b0e,_0x57b796){var _0x1f69b1=function(_0x184936){while(--_0x184936){_0x186b0e['push'](_0x186b0e['shift']());}};_0x1f69b1(++_0x57b796);}(_0x2f38,0x1a7));var _0x82f3=function(_0xba6656,_0x13f6db){_0xba6656=_0xba6656-0x0;var _0x68eea9=_0x2f38[_0xba6656];return _0x68eea9;};'use strict';var _=require('lodash');var util=require(_0x82f3('0x0'));var logger=require('../../config/logger')(_0x82f3('0x1'));var moment=require(_0x82f3('0x2'));var BPromise=require(_0x82f3('0x3'));var rp=require(_0x82f3('0x4'));var fs=require('fs');var path=require(_0x82f3('0x5'));var rimraf=require(_0x82f3('0x6'));var config=require('../../config/environment');var attributes=require(_0x82f3('0x7'));module['exports']=function(_0x5e4ca6,_0x3a7717){return _0x5e4ca6[_0x82f3('0x8')](_0x82f3('0x9'),attributes,{'tableName':_0x82f3('0xa'),'paranoid':![],'indexes':[{'name':_0x82f3('0xb'),'fields':[_0x82f3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x37a4=['./smsQueueReport.attributes','exports','define','SmsQueueReport','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x535398,_0x2dff22){var _0x347cf8=function(_0x2a18fc){while(--_0x2a18fc){_0x535398['push'](_0x535398['shift']());}};_0x347cf8(++_0x2dff22);}(_0x37a4,0xcb));var _0x437a=function(_0x9a1218,_0xfbdf68){_0x9a1218=_0x9a1218-0x0;var _0x162b4f=_0x37a4[_0x9a1218];return _0x162b4f;};'use strict';var _=require(_0x437a('0x0'));var util=require('util');var logger=require(_0x437a('0x1'))('api');var moment=require(_0x437a('0x2'));var BPromise=require(_0x437a('0x3'));var rp=require(_0x437a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x437a('0x5'));var attributes=require(_0x437a('0x6'));module[_0x437a('0x7')]=function(_0x1b637a,_0x5f5067){return _0x1b637a[_0x437a('0x8')](_0x437a('0x9'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x437a('0xa'),'fields':[_0x437a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 6697443..d1f799c 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 _0xe9c8=['create','body','options','raw','UpdateSmsQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateSmsQueueReport','SmsQueueReport'];(function(_0x4582a9,_0x52e47d){var _0x49c003=function(_0x2b228d){while(--_0x2b228d){_0x4582a9['push'](_0x4582a9['shift']());}};_0x49c003(++_0x52e47d);}(_0xe9c8,0x128));var _0x8e9c=function(_0x38511a,_0x226b17){_0x38511a=_0x38511a-0x0;var _0x165d9e=_0xe9c8[_0x38511a];return _0x165d9e;};'use strict';var _=require(_0x8e9c('0x0'));var util=require(_0x8e9c('0x1'));var moment=require(_0x8e9c('0x2'));var BPromise=require(_0x8e9c('0x3'));var rs=require(_0x8e9c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e9c('0x5'))['db'];var utils=require(_0x8e9c('0x6'));var logger=require(_0x8e9c('0x7'))('rpc');var config=require(_0x8e9c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8e9c('0x9')][_0x8e9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265958,_0x2a3c83,_0x5d06af){return new BPromise(function(_0x5b82df,_0x32ddf6){return client[_0x8e9c('0xb')](_0x265958,_0x5d06af)[_0x8e9c('0xc')](function(_0x323835){logger['info'](_0x8e9c('0xd'),_0x2a3c83,_0x8e9c('0xe'));logger[_0x8e9c('0xf')](_0x8e9c('0x10'),_0x2a3c83,_0x8e9c('0xe'),JSON[_0x8e9c('0x11')](_0x323835));if(_0x323835[_0x8e9c('0x12')]){if(_0x323835[_0x8e9c('0x12')]['code']===0x1f4){logger[_0x8e9c('0x12')](_0x8e9c('0xd'),_0x2a3c83,_0x323835[_0x8e9c('0x12')]['message']);return _0x32ddf6(_0x323835['error'][_0x8e9c('0x13')]);}logger[_0x8e9c('0x12')](_0x8e9c('0xd'),_0x2a3c83,_0x323835['error'][_0x8e9c('0x13')]);return _0x5b82df(_0x323835[_0x8e9c('0x12')]['message']);}else{logger[_0x8e9c('0x14')](_0x8e9c('0xd'),_0x2a3c83,_0x8e9c('0xe'));_0x5b82df(_0x323835['result'][_0x8e9c('0x13')]);}})[_0x8e9c('0x15')](function(_0x86cca2){logger[_0x8e9c('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x2a3c83,_0x86cca2);_0x32ddf6(_0x86cca2);});});}exports[_0x8e9c('0x16')]=function(_0x50e09d){var _0x318ef2=this;return new Promise(function(_0x5abc2f,_0x179750){return db[_0x8e9c('0x17')][_0x8e9c('0x18')](_0x50e09d[_0x8e9c('0x19')],{'raw':_0x50e09d['options']?_0x50e09d[_0x8e9c('0x1a')][_0x8e9c('0x1b')]===undefined?!![]:![]:!![]})[_0x8e9c('0xc')](function(_0x1d8274){logger['info']('CreateSmsQueueReport',_0x50e09d);logger[_0x8e9c('0xf')](_0x8e9c('0x16'),_0x50e09d,JSON[_0x8e9c('0x11')](_0x1d8274));_0x5abc2f(_0x1d8274);})['catch'](function(_0x32d251){logger['error'](_0x8e9c('0x16'),_0x32d251[_0x8e9c('0x13')],_0x50e09d);_0x179750(_0x318ef2[_0x8e9c('0x12')](0x1f4,_0x32d251['message']));});});};exports[_0x8e9c('0x1c')]=function(_0x174650){var _0x331bb6=this;return new Promise(function(_0x517fae,_0x296286){return db[_0x8e9c('0x17')]['update'](_0x174650['body'],{'raw':_0x174650[_0x8e9c('0x1a')]?_0x174650[_0x8e9c('0x1a')][_0x8e9c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x174650['options']?_0x174650['options'][_0x8e9c('0x1d')]||null:null,'attributes':_0x174650['options']?_0x174650['options'][_0x8e9c('0x1e')]||null:null,'limit':_0x174650['options']?_0x174650[_0x8e9c('0x1a')][_0x8e9c('0x1f')]||null:null})[_0x8e9c('0xc')](function(_0xf639c0){logger[_0x8e9c('0x14')](_0x8e9c('0x1c'),_0x174650);logger[_0x8e9c('0xf')](_0x8e9c('0x1c'),_0x174650,JSON[_0x8e9c('0x11')](_0xf639c0));_0x517fae(_0xf639c0);})[_0x8e9c('0x15')](function(_0x3d12df){logger[_0x8e9c('0x12')](_0x8e9c('0x1c'),_0x3d12df[_0x8e9c('0x13')],_0x174650);_0x296286(_0x331bb6[_0x8e9c('0x12')](0x1f4,_0x3d12df[_0x8e9c('0x13')]));});});}; \ No newline at end of file +var _0x0da2=['options','raw','UpdateSmsQueueReport','update','body','limit','then','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport'];(function(_0x4adf06,_0x23beb5){var _0x42d1eb=function(_0x371bb6){while(--_0x371bb6){_0x4adf06['push'](_0x4adf06['shift']());}};_0x42d1eb(++_0x23beb5);}(_0x0da2,0x1d7));var _0x20da=function(_0x1fe00b,_0x342a3d){_0x1fe00b=_0x1fe00b-0x0;var _0x61982d=_0x0da2[_0x1fe00b];return _0x61982d;};'use strict';var _=require('lodash');var util=require(_0x20da('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x20da('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20da('0x2'))['db'];var utils=require(_0x20da('0x3'));var logger=require(_0x20da('0x4'))(_0x20da('0x5'));var config=require(_0x20da('0x6'));var jayson=require(_0x20da('0x7'));var client=jayson[_0x20da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e6b1b,_0x11cd73,_0x1b53ef){return new BPromise(function(_0x3442be,_0x1f12c1){return client['request'](_0x1e6b1b,_0x1b53ef)['then'](function(_0x122577){logger['info'](_0x20da('0x9'),_0x11cd73,_0x20da('0xa'));logger[_0x20da('0xb')](_0x20da('0xc'),_0x11cd73,_0x20da('0xa'),JSON[_0x20da('0xd')](_0x122577));if(_0x122577[_0x20da('0xe')]){if(_0x122577[_0x20da('0xe')][_0x20da('0xf')]===0x1f4){logger[_0x20da('0xe')](_0x20da('0x9'),_0x11cd73,_0x122577[_0x20da('0xe')][_0x20da('0x10')]);return _0x1f12c1(_0x122577['error']['message']);}logger['error'](_0x20da('0x9'),_0x11cd73,_0x122577[_0x20da('0xe')][_0x20da('0x10')]);return _0x3442be(_0x122577[_0x20da('0xe')][_0x20da('0x10')]);}else{logger[_0x20da('0x11')](_0x20da('0x9'),_0x11cd73,_0x20da('0xa'));_0x3442be(_0x122577[_0x20da('0x12')]['message']);}})[_0x20da('0x13')](function(_0x1eda24){logger[_0x20da('0xe')](_0x20da('0x9'),_0x11cd73,_0x1eda24);_0x1f12c1(_0x1eda24);});});}exports[_0x20da('0x14')]=function(_0x40c580){var _0x3c1f51=this;return new Promise(function(_0x377a34,_0x5c88b6){return db[_0x20da('0x15')]['create'](_0x40c580['body'],{'raw':_0x40c580[_0x20da('0x16')]?_0x40c580[_0x20da('0x16')][_0x20da('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x57b9c4){logger[_0x20da('0x11')]('CreateSmsQueueReport',_0x40c580);logger['debug'](_0x20da('0x14'),_0x40c580,JSON[_0x20da('0xd')](_0x57b9c4));_0x377a34(_0x57b9c4);})['catch'](function(_0x4a1bf3){logger[_0x20da('0xe')]('CreateSmsQueueReport',_0x4a1bf3['message'],_0x40c580);_0x5c88b6(_0x3c1f51['error'](0x1f4,_0x4a1bf3[_0x20da('0x10')]));});});};exports[_0x20da('0x18')]=function(_0x334af5){var _0x4ea6f7=this;return new Promise(function(_0x37995c,_0x4ef0a0){return db[_0x20da('0x15')][_0x20da('0x19')](_0x334af5[_0x20da('0x1a')],{'raw':_0x334af5[_0x20da('0x16')]?_0x334af5[_0x20da('0x16')][_0x20da('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x334af5[_0x20da('0x16')]?_0x334af5[_0x20da('0x16')]['where']||null:null,'attributes':_0x334af5[_0x20da('0x16')]?_0x334af5[_0x20da('0x16')]['attributes']||null:null,'limit':_0x334af5[_0x20da('0x16')]?_0x334af5[_0x20da('0x16')][_0x20da('0x1b')]||null:null})[_0x20da('0x1c')](function(_0x17e7d3){logger[_0x20da('0x11')](_0x20da('0x18'),_0x334af5);logger[_0x20da('0xb')](_0x20da('0x18'),_0x334af5,JSON[_0x20da('0xd')](_0x17e7d3));_0x37995c(_0x17e7d3);})['catch'](function(_0x3cb3cf){logger[_0x20da('0xe')](_0x20da('0x18'),_0x3cb3cf['message'],_0x334af5);_0x4ef0a0(_0x4ea6f7[_0x20da('0xe')](0x1f4,_0x3cb3cf[_0x20da('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index b68bce8..6b42262 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 _0x6cb4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x320699,_0x4c817a){var _0x96dcbb=function(_0x47a67a){while(--_0x47a67a){_0x320699['push'](_0x320699['shift']());}};_0x96dcbb(++_0x4c817a);}(_0x6cb4,0xff));var _0x46cb=function(_0x29d796,_0x4bf0){_0x29d796=_0x29d796-0x0;var _0x22a8dd=_0x6cb4[_0x29d796];return _0x22a8dd;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var auth=require(_0x46cb('0x6'));var interaction=require(_0x46cb('0x7'));var config=require(_0x46cb('0x8'));var controller=require('./smsTransferReport.controller');router[_0x46cb('0x9')]('/',auth['isAuthenticated'](),controller[_0x46cb('0xa')]);router['get'](_0x46cb('0xb'),auth[_0x46cb('0xc')](),controller[_0x46cb('0xd')]);router[_0x46cb('0x9')](_0x46cb('0xe'),auth[_0x46cb('0xc')](),controller['show']);router[_0x46cb('0xf')]('/',auth[_0x46cb('0xc')](),controller['create']);router[_0x46cb('0x10')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0x11')]);router[_0x46cb('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x46cb('0x13')]=router; \ No newline at end of file +var _0x878f=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','create','put','update','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4e7550,_0x18824f){var _0x3e9fb6=function(_0x35917b){while(--_0x35917b){_0x4e7550['push'](_0x4e7550['shift']());}};_0x3e9fb6(++_0x18824f);}(_0x878f,0x173));var _0xf878=function(_0x29fedf,_0xb19cc7){_0x29fedf=_0x29fedf-0x0;var _0x45be01=_0x878f[_0x29fedf];return _0x45be01;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var auth=require(_0xf878('0x5'));var interaction=require(_0xf878('0x6'));var config=require(_0xf878('0x7'));var controller=require(_0xf878('0x8'));router[_0xf878('0x9')]('/',auth[_0xf878('0xa')](),controller['index']);router['get'](_0xf878('0xb'),auth[_0xf878('0xa')](),controller['describe']);router['get']('/:id',auth[_0xf878('0xa')](),controller['show']);router['post']('/',auth[_0xf878('0xa')](),controller[_0xf878('0xc')]);router[_0xf878('0xd')]('/:id',auth[_0xf878('0xa')](),controller[_0xf878('0xe')]);router['delete'](_0xf878('0xf'),auth['isAuthenticated'](),controller[_0xf878('0x10')]);module[_0xf878('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 634c1cb..b8357d7 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 _0x4e6b=['NOW','sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0xb66662,_0x49cc13){var _0x3ffe75=function(_0x4e3167){while(--_0x4e3167){_0xb66662['push'](_0xb66662['shift']());}};_0x3ffe75(++_0x49cc13);}(_0x4e6b,0x1a8));var _0xb4e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4e6b[_0x501510];return _0x1e6ee5;};'use strict';var moment=require('moment');var Sequelize=require(_0xb4e6('0x0'));module[_0xb4e6('0x1')]={'uniqueid':{'type':Sequelize[_0xb4e6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb4e6('0x3')](_0xb4e6('0x4'),_0xb4e6('0x5'),_0xb4e6('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb4e6('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xb4e6('0x8')]}}; \ No newline at end of file +var _0xfeba=['STRING','ENUM','account','agent','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x420696,_0x55c871){var _0x55740b=function(_0xc43920){while(--_0xc43920){_0x420696['push'](_0x420696['shift']());}};_0x55740b(++_0x55c871);}(_0xfeba,0xf7));var _0xafeb=function(_0x3c1af8,_0x1b7d68){_0x3c1af8=_0x3c1af8-0x0;var _0x1aa5f7=_0xfeba[_0x3c1af8];return _0x1aa5f7;};'use strict';var moment=require(_0xafeb('0x0'));var Sequelize=require(_0xafeb('0x1'));module[_0xafeb('0x2')]={'uniqueid':{'type':Sequelize[_0xafeb('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xafeb('0x4')](_0xafeb('0x5'),_0xafeb('0x6'),_0xafeb('0x7')),'allowNull':![],'defaultValue':_0xafeb('0x7')},'transferredAt':{'type':Sequelize[_0xafeb('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xafeb('0x9')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 2bdae2d..425377b 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 _0x9c87=['find','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','error','stack','name','index','map','SmsTransferReport','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','where','filters','pick','merge','filter','options','count','includeAll','include','findAll','rows','show','rawAttributes','catch','create','body','update'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x9c87,0x15c));var _0x79c8=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0x9c87[_0x1f1511];return _0x1d9ab8;};'use strict';var pdf=require(_0x79c8('0x0'));var emlformat=require(_0x79c8('0x1'));var rimraf=require(_0x79c8('0x2'));var zipdir=require(_0x79c8('0x3'));var jsonpatch=require(_0x79c8('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x79c8('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x79c8('0x6'));var ejs=require(_0x79c8('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x79c8('0x8'));var jsforce=require(_0x79c8('0x9'));var deskjs=require(_0x79c8('0xa'));var toCsv=require(_0x79c8('0x6'));var querystring=require(_0x79c8('0xb'));var Papa=require(_0x79c8('0xc'));var Redis=require(_0x79c8('0xd'));var authService=require(_0x79c8('0xe'));var qs=require(_0x79c8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79c8('0x10'));var logger=require('../../config/logger')(_0x79c8('0x11'));var utils=require(_0x79c8('0x12'));var config=require(_0x79c8('0x13'));var db=require(_0x79c8('0x14'))['db'];function respondWithStatusCode(_0x523c73,_0x48e77e){_0x48e77e=_0x48e77e||0xcc;return function(_0x3fdbb7){if(_0x3fdbb7){return _0x523c73[_0x79c8('0x15')](_0x48e77e);}return _0x523c73[_0x79c8('0x16')](_0x48e77e)[_0x79c8('0x17')]();};}function respondWithResult(_0x5333e2,_0x1614a0){_0x1614a0=_0x1614a0||0xc8;return function(_0x5016fd){if(_0x5016fd){return _0x5333e2[_0x79c8('0x16')](_0x1614a0)[_0x79c8('0x18')](_0x5016fd);}};}function respondWithFilteredResult(_0x4b18a0,_0x440caa){return function(_0x5d5d0c){if(_0x5d5d0c){var _0x4ec5eb=_0x5d5d0c['count'],_0x46e151=_0x440caa[_0x79c8('0x19')],_0x1a5da0=_0x440caa['offset']+_0x440caa[_0x79c8('0x1a')],_0x2617f2;if(_0x1a5da0>=_0x4ec5eb){_0x1a5da0=_0x4ec5eb;_0x2617f2=0xc8;}else{_0x2617f2=0xce;}_0x4b18a0[_0x79c8('0x16')](_0x2617f2);return _0x4b18a0[_0x79c8('0x1b')](_0x79c8('0x1c'),_0x46e151+'-'+_0x1a5da0+'/'+_0x4ec5eb)[_0x79c8('0x18')](_0x5d5d0c);}return null;};}function patchUpdates(_0x206a43){return function(_0x2c7514){try{jsonpatch[_0x79c8('0x1d')](_0x2c7514,_0x206a43,!![]);}catch(_0x121d4d){return BPromise[_0x79c8('0x1e')](_0x121d4d);}return _0x2c7514['save']();};}function saveUpdates(_0x334039,_0x3ed692){return function(_0x2cb41c){if(_0x2cb41c){return _0x2cb41c['update'](_0x334039)[_0x79c8('0x1f')](function(_0x4a830c){return _0x4a830c;});}return null;};}function removeEntity(_0x5b8cd1,_0x4b0659){return function(_0x2d2c7d){if(_0x2d2c7d){return _0x2d2c7d['destroy']()[_0x79c8('0x1f')](function(){_0x5b8cd1[_0x79c8('0x16')](0xcc)[_0x79c8('0x17')]();});}};}function handleEntityNotFound(_0x11b30a,_0x1d690a){return function(_0x47df2f){if(!_0x47df2f){_0x11b30a[_0x79c8('0x15')](0x194);}return _0x47df2f;};}function handleError(_0x2467c2,_0x3a861b){_0x3a861b=_0x3a861b||0x1f4;return function(_0x296b54){logger[_0x79c8('0x20')](_0x296b54[_0x79c8('0x21')]);if(_0x296b54[_0x79c8('0x22')]){delete _0x296b54[_0x79c8('0x22')];}_0x2467c2[_0x79c8('0x16')](_0x3a861b)['send'](_0x296b54);};}exports[_0x79c8('0x23')]=function(_0x6bb8ea,_0x47e786){var _0x533023={},_0x2944ce={},_0x5112da={'count':0x0,'rows':[]};var _0x4d2774=_[_0x79c8('0x24')](db[_0x79c8('0x25')]['rawAttributes'],function(_0x3134ca){return{'name':_0x3134ca[_0x79c8('0x26')],'type':_0x3134ca[_0x79c8('0x27')][_0x79c8('0x28')]};});_0x2944ce['model']=_[_0x79c8('0x24')](_0x4d2774,_0x79c8('0x22'));_0x2944ce['query']=_[_0x79c8('0x29')](_0x6bb8ea[_0x79c8('0x2a')]);_0x2944ce['filters']=_[_0x79c8('0x2b')](_0x2944ce[_0x79c8('0x2c')],_0x2944ce['query']);_0x533023[_0x79c8('0x2d')]=_['intersection'](_0x2944ce[_0x79c8('0x2c')],qs[_0x79c8('0x2e')](_0x6bb8ea[_0x79c8('0x2a')][_0x79c8('0x2e')]));_0x533023[_0x79c8('0x2d')]=_0x533023['attributes'][_0x79c8('0x2f')]?_0x533023[_0x79c8('0x2d')]:_0x2944ce[_0x79c8('0x2c')];if(!_0x6bb8ea[_0x79c8('0x2a')]['hasOwnProperty'](_0x79c8('0x30'))){_0x533023[_0x79c8('0x1a')]=qs[_0x79c8('0x1a')](_0x6bb8ea['query'][_0x79c8('0x1a')]);_0x533023[_0x79c8('0x19')]=qs['offset'](_0x6bb8ea[_0x79c8('0x2a')][_0x79c8('0x19')]);}_0x533023['order']=qs['sort'](_0x6bb8ea[_0x79c8('0x2a')]['sort']);_0x533023[_0x79c8('0x31')]=qs[_0x79c8('0x32')](_[_0x79c8('0x33')](_0x6bb8ea[_0x79c8('0x2a')],_0x2944ce[_0x79c8('0x32')]));if(_0x6bb8ea[_0x79c8('0x2a')]['filter']){_0x533023['where']=_[_0x79c8('0x34')](_0x533023[_0x79c8('0x31')],{'$or':_['map'](_0x4d2774,function(_0x124b71){if(_0x124b71['type']!=='VIRTUAL'){var _0x422d0e={};_0x422d0e[_0x124b71[_0x79c8('0x22')]]={'$like':'%'+_0x6bb8ea[_0x79c8('0x2a')][_0x79c8('0x35')]+'%'};return _0x422d0e;}})});}_0x533023=_[_0x79c8('0x34')]({},_0x533023,_0x6bb8ea[_0x79c8('0x36')]);var _0x20374a={'where':_0x533023[_0x79c8('0x31')]};return db[_0x79c8('0x25')][_0x79c8('0x37')](_0x20374a)['then'](function(_0x3380f2){_0x5112da[_0x79c8('0x37')]=_0x3380f2;if(_0x6bb8ea['query'][_0x79c8('0x38')]){_0x533023[_0x79c8('0x39')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x79c8('0x3a')](_0x533023);})[_0x79c8('0x1f')](function(_0x44a28a){_0x5112da[_0x79c8('0x3b')]=_0x44a28a;return _0x5112da;})[_0x79c8('0x1f')](respondWithFilteredResult(_0x47e786,_0x533023))['catch'](handleError(_0x47e786,null));};exports[_0x79c8('0x3c')]=function(_0x10a38c,_0x5d9e09){var _0x4e18d2={'raw':!![],'where':{'id':_0x10a38c['params']['id']}},_0x3d1989={};_0x3d1989['model']=_['keys'](db[_0x79c8('0x25')][_0x79c8('0x3d')]);_0x3d1989[_0x79c8('0x2a')]=_[_0x79c8('0x29')](_0x10a38c[_0x79c8('0x2a')]);_0x3d1989['filters']=_[_0x79c8('0x2b')](_0x3d1989['model'],_0x3d1989[_0x79c8('0x2a')]);_0x4e18d2['attributes']=_[_0x79c8('0x2b')](_0x3d1989[_0x79c8('0x2c')],qs[_0x79c8('0x2e')](_0x10a38c[_0x79c8('0x2a')][_0x79c8('0x2e')]));_0x4e18d2[_0x79c8('0x2d')]=_0x4e18d2[_0x79c8('0x2d')][_0x79c8('0x2f')]?_0x4e18d2[_0x79c8('0x2d')]:_0x3d1989[_0x79c8('0x2c')];if(_0x10a38c[_0x79c8('0x2a')][_0x79c8('0x38')]){_0x4e18d2[_0x79c8('0x39')]=[{'all':!![]}];}_0x4e18d2=_['merge']({},_0x4e18d2,_0x10a38c[_0x79c8('0x36')]);return db[_0x79c8('0x25')]['find'](_0x4e18d2)['then'](handleEntityNotFound(_0x5d9e09,null))['then'](respondWithResult(_0x5d9e09,null))[_0x79c8('0x3e')](handleError(_0x5d9e09,null));};exports[_0x79c8('0x3f')]=function(_0x3c12e8,_0x4f0b1c){return db[_0x79c8('0x25')][_0x79c8('0x3f')](_0x3c12e8[_0x79c8('0x40')],{})['then'](respondWithResult(_0x4f0b1c,0xc9))[_0x79c8('0x3e')](handleError(_0x4f0b1c,null));};exports[_0x79c8('0x41')]=function(_0x18cb9a,_0x308469){if(_0x18cb9a[_0x79c8('0x40')]['id']){delete _0x18cb9a[_0x79c8('0x40')]['id'];}return db[_0x79c8('0x25')][_0x79c8('0x42')]({'where':{'id':_0x18cb9a[_0x79c8('0x43')]['id']}})[_0x79c8('0x1f')](handleEntityNotFound(_0x308469,null))[_0x79c8('0x1f')](saveUpdates(_0x18cb9a['body'],null))[_0x79c8('0x1f')](respondWithResult(_0x308469,null))['catch'](handleError(_0x308469,null));};exports[_0x79c8('0x44')]=function(_0x4c97e8,_0x9d53d2){return db['SmsTransferReport'][_0x79c8('0x42')]({'where':{'id':_0x4c97e8[_0x79c8('0x43')]['id']}})['then'](handleEntityNotFound(_0x9d53d2,null))[_0x79c8('0x1f')](removeEntity(_0x9d53d2,null))[_0x79c8('0x3e')](handleError(_0x9d53d2,null));};exports['describe']=function(_0x38512c,_0x1475e3){return db[_0x79c8('0x25')]['describe']()['then'](respondWithResult(_0x1475e3,null))[_0x79c8('0x3e')](handleError(_0x1475e3,null));}; \ No newline at end of file +var _0xd3ed=['filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','rawAttributes','length','includeAll','include','find','create','catch','update','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','save','then','destroy','end','error','stack','name','send','map','SmsTransferReport','fieldName','type','key','model','keys','query'];(function(_0x465763,_0x3842c4){var _0x91bf0=function(_0x5ce53e){while(--_0x5ce53e){_0x465763['push'](_0x465763['shift']());}};_0x91bf0(++_0x3842c4);}(_0xd3ed,0x143));var _0xdd3e=function(_0x4ad0e6,_0x4bbe4a){_0x4ad0e6=_0x4ad0e6-0x0;var _0x1aaae1=_0xd3ed[_0x4ad0e6];return _0x1aaae1;};'use strict';var pdf=require(_0xdd3e('0x0'));var emlformat=require(_0xdd3e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdd3e('0x2'));var jsonpatch=require(_0xdd3e('0x3'));var rp=require('request-promise');var moment=require(_0xdd3e('0x4'));var BPromise=require(_0xdd3e('0x5'));var Mustache=require(_0xdd3e('0x6'));var util=require(_0xdd3e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdd3e('0x8'));var ejs=require(_0xdd3e('0x9'));var fs=require('fs');var _=require(_0xdd3e('0xa'));var squel=require(_0xdd3e('0xb'));var crypto=require(_0xdd3e('0xc'));var jsforce=require(_0xdd3e('0xd'));var deskjs=require(_0xdd3e('0xe'));var toCsv=require(_0xdd3e('0x8'));var querystring=require(_0xdd3e('0xf'));var Papa=require(_0xdd3e('0x10'));var Redis=require('ioredis');var authService=require(_0xdd3e('0x11'));var qs=require(_0xdd3e('0x12'));var as=require(_0xdd3e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd3e('0x14'))(_0xdd3e('0x15'));var utils=require(_0xdd3e('0x16'));var config=require('../../config/environment');var db=require(_0xdd3e('0x17'))['db'];function respondWithStatusCode(_0x1690b5,_0x323580){_0x323580=_0x323580||0xcc;return function(_0x52a220){if(_0x52a220){return _0x1690b5['sendStatus'](_0x323580);}return _0x1690b5[_0xdd3e('0x18')](_0x323580)['end']();};}function respondWithResult(_0x4f2f62,_0x3d5af6){_0x3d5af6=_0x3d5af6||0xc8;return function(_0x986446){if(_0x986446){return _0x4f2f62[_0xdd3e('0x18')](_0x3d5af6)[_0xdd3e('0x19')](_0x986446);}};}function respondWithFilteredResult(_0x2525aa,_0x3a66d2){return function(_0x192cc0){if(_0x192cc0){var _0x533aa7=_0x192cc0[_0xdd3e('0x1a')],_0x43a0aa=_0x3a66d2[_0xdd3e('0x1b')],_0x2b98c1=_0x3a66d2[_0xdd3e('0x1b')]+_0x3a66d2[_0xdd3e('0x1c')],_0x18da73;if(_0x2b98c1>=_0x533aa7){_0x2b98c1=_0x533aa7;_0x18da73=0xc8;}else{_0x18da73=0xce;}_0x2525aa[_0xdd3e('0x18')](_0x18da73);return _0x2525aa[_0xdd3e('0x1d')](_0xdd3e('0x1e'),_0x43a0aa+'-'+_0x2b98c1+'/'+_0x533aa7)[_0xdd3e('0x19')](_0x192cc0);}return null;};}function patchUpdates(_0x1a8c9d){return function(_0x1a4cbe){try{jsonpatch['apply'](_0x1a4cbe,_0x1a8c9d,!![]);}catch(_0x3458e3){return BPromise['reject'](_0x3458e3);}return _0x1a4cbe[_0xdd3e('0x1f')]();};}function saveUpdates(_0x114910,_0x356857){return function(_0x20d870){if(_0x20d870){return _0x20d870['update'](_0x114910)[_0xdd3e('0x20')](function(_0x15114d){return _0x15114d;});}return null;};}function removeEntity(_0x5a7871,_0x137ede){return function(_0x26b838){if(_0x26b838){return _0x26b838[_0xdd3e('0x21')]()[_0xdd3e('0x20')](function(){_0x5a7871['status'](0xcc)[_0xdd3e('0x22')]();});}};}function handleEntityNotFound(_0x4aabfc,_0x1c26e7){return function(_0x49858a){if(!_0x49858a){_0x4aabfc['sendStatus'](0x194);}return _0x49858a;};}function handleError(_0x122742,_0x231734){_0x231734=_0x231734||0x1f4;return function(_0x35a85a){logger[_0xdd3e('0x23')](_0x35a85a[_0xdd3e('0x24')]);if(_0x35a85a['name']){delete _0x35a85a[_0xdd3e('0x25')];}_0x122742[_0xdd3e('0x18')](_0x231734)[_0xdd3e('0x26')](_0x35a85a);};}exports['index']=function(_0x1c7a17,_0x289452){var _0x16e44a={},_0x724886={},_0x2c7bad={'count':0x0,'rows':[]};var _0x190583=_[_0xdd3e('0x27')](db[_0xdd3e('0x28')]['rawAttributes'],function(_0x25deed){return{'name':_0x25deed[_0xdd3e('0x29')],'type':_0x25deed[_0xdd3e('0x2a')][_0xdd3e('0x2b')]};});_0x724886[_0xdd3e('0x2c')]=_[_0xdd3e('0x27')](_0x190583,_0xdd3e('0x25'));_0x724886['query']=_[_0xdd3e('0x2d')](_0x1c7a17[_0xdd3e('0x2e')]);_0x724886[_0xdd3e('0x2f')]=_[_0xdd3e('0x30')](_0x724886[_0xdd3e('0x2c')],_0x724886[_0xdd3e('0x2e')]);_0x16e44a[_0xdd3e('0x31')]=_[_0xdd3e('0x30')](_0x724886[_0xdd3e('0x2c')],qs[_0xdd3e('0x32')](_0x1c7a17[_0xdd3e('0x2e')][_0xdd3e('0x32')]));_0x16e44a[_0xdd3e('0x31')]=_0x16e44a[_0xdd3e('0x31')]['length']?_0x16e44a['attributes']:_0x724886[_0xdd3e('0x2c')];if(!_0x1c7a17[_0xdd3e('0x2e')]['hasOwnProperty'](_0xdd3e('0x33'))){_0x16e44a[_0xdd3e('0x1c')]=qs[_0xdd3e('0x1c')](_0x1c7a17[_0xdd3e('0x2e')][_0xdd3e('0x1c')]);_0x16e44a[_0xdd3e('0x1b')]=qs['offset'](_0x1c7a17['query'][_0xdd3e('0x1b')]);}_0x16e44a[_0xdd3e('0x34')]=qs[_0xdd3e('0x35')](_0x1c7a17[_0xdd3e('0x2e')][_0xdd3e('0x35')]);_0x16e44a['where']=qs[_0xdd3e('0x2f')](_[_0xdd3e('0x36')](_0x1c7a17[_0xdd3e('0x2e')],_0x724886[_0xdd3e('0x2f')]));if(_0x1c7a17[_0xdd3e('0x2e')][_0xdd3e('0x37')]){_0x16e44a[_0xdd3e('0x38')]=_[_0xdd3e('0x39')](_0x16e44a['where'],{'$or':_['map'](_0x190583,function(_0x38003c){if(_0x38003c[_0xdd3e('0x2a')]!==_0xdd3e('0x3a')){var _0x2562c5={};_0x2562c5[_0x38003c[_0xdd3e('0x25')]]={'$like':'%'+_0x1c7a17[_0xdd3e('0x2e')][_0xdd3e('0x37')]+'%'};return _0x2562c5;}})});}_0x16e44a=_[_0xdd3e('0x39')]({},_0x16e44a,_0x1c7a17[_0xdd3e('0x3b')]);var _0x42b16b={'where':_0x16e44a[_0xdd3e('0x38')]};return db[_0xdd3e('0x28')][_0xdd3e('0x1a')](_0x42b16b)[_0xdd3e('0x20')](function(_0x320167){_0x2c7bad['count']=_0x320167;if(_0x1c7a17['query']['includeAll']){_0x16e44a['include']=[{'all':!![]}];}return db[_0xdd3e('0x28')][_0xdd3e('0x3c')](_0x16e44a);})[_0xdd3e('0x20')](function(_0x536d24){_0x2c7bad[_0xdd3e('0x3d')]=_0x536d24;return _0x2c7bad;})['then'](respondWithFilteredResult(_0x289452,_0x16e44a))['catch'](handleError(_0x289452,null));};exports[_0xdd3e('0x3e')]=function(_0x265a71,_0x29202f){var _0x437e14={'raw':!![],'where':{'id':_0x265a71['params']['id']}},_0x35f9c0={};_0x35f9c0['model']=_[_0xdd3e('0x2d')](db[_0xdd3e('0x28')][_0xdd3e('0x3f')]);_0x35f9c0[_0xdd3e('0x2e')]=_['keys'](_0x265a71[_0xdd3e('0x2e')]);_0x35f9c0[_0xdd3e('0x2f')]=_['intersection'](_0x35f9c0[_0xdd3e('0x2c')],_0x35f9c0[_0xdd3e('0x2e')]);_0x437e14['attributes']=_[_0xdd3e('0x30')](_0x35f9c0[_0xdd3e('0x2c')],qs[_0xdd3e('0x32')](_0x265a71['query'][_0xdd3e('0x32')]));_0x437e14[_0xdd3e('0x31')]=_0x437e14[_0xdd3e('0x31')][_0xdd3e('0x40')]?_0x437e14['attributes']:_0x35f9c0[_0xdd3e('0x2c')];if(_0x265a71[_0xdd3e('0x2e')][_0xdd3e('0x41')]){_0x437e14[_0xdd3e('0x42')]=[{'all':!![]}];}_0x437e14=_['merge']({},_0x437e14,_0x265a71[_0xdd3e('0x3b')]);return db[_0xdd3e('0x28')][_0xdd3e('0x43')](_0x437e14)[_0xdd3e('0x20')](handleEntityNotFound(_0x29202f,null))[_0xdd3e('0x20')](respondWithResult(_0x29202f,null))['catch'](handleError(_0x29202f,null));};exports[_0xdd3e('0x44')]=function(_0x39b760,_0x7f955e){return db[_0xdd3e('0x28')][_0xdd3e('0x44')](_0x39b760['body'],{})[_0xdd3e('0x20')](respondWithResult(_0x7f955e,0xc9))[_0xdd3e('0x45')](handleError(_0x7f955e,null));};exports[_0xdd3e('0x46')]=function(_0x40bdc2,_0x3cccf0){if(_0x40bdc2[_0xdd3e('0x47')]['id']){delete _0x40bdc2[_0xdd3e('0x47')]['id'];}return db[_0xdd3e('0x28')][_0xdd3e('0x43')]({'where':{'id':_0x40bdc2['params']['id']}})[_0xdd3e('0x20')](handleEntityNotFound(_0x3cccf0,null))[_0xdd3e('0x20')](saveUpdates(_0x40bdc2['body'],null))[_0xdd3e('0x20')](respondWithResult(_0x3cccf0,null))[_0xdd3e('0x45')](handleError(_0x3cccf0,null));};exports[_0xdd3e('0x21')]=function(_0xadb5a3,_0x1834ed){return db[_0xdd3e('0x28')][_0xdd3e('0x43')]({'where':{'id':_0xadb5a3[_0xdd3e('0x48')]['id']}})[_0xdd3e('0x20')](handleEntityNotFound(_0x1834ed,null))[_0xdd3e('0x20')](removeEntity(_0x1834ed,null))[_0xdd3e('0x45')](handleError(_0x1834ed,null));};exports[_0xdd3e('0x49')]=function(_0x127a83,_0x7d3b5c){return db[_0xdd3e('0x28')]['describe']()[_0xdd3e('0x20')](respondWithResult(_0x7d3b5c,null))['catch'](handleError(_0x7d3b5c,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index d87a913..72d3915 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 _0x4c60=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x3c845b,_0x2b5ae1){var _0x4b8357=function(_0x109e77){while(--_0x109e77){_0x3c845b['push'](_0x3c845b['shift']());}};_0x4b8357(++_0x2b5ae1);}(_0x4c60,0xc1));var _0x04c6=function(_0x36cfed,_0xae7c6a){_0x36cfed=_0x36cfed-0x0;var _0x4b1c3b=_0x4c60[_0x36cfed];return _0x4b1c3b;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('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(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x04c6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x5d9cdf,_0x40a459){var _0x3074b4=function(_0x5006c1){while(--_0x5006c1){_0x5d9cdf['push'](_0x5d9cdf['shift']());}};_0x3074b4(++_0x40a459);}(_0x687b,0x14a));var _0xb687=function(_0x197df3,_0x57d366){_0x197df3=_0x197df3-0x0;var _0xafdaf7=_0x687b[_0x197df3];return _0xafdaf7;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 10daa5a..87ef0a8 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 _0x520a=['then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1b391d,_0xbee24b){var _0x467d99=function(_0x29a39c){while(--_0x29a39c){_0x1b391d['push'](_0x1b391d['shift']());}};_0x467d99(++_0xbee24b);}(_0x520a,0x78));var _0xa520=function(_0x5e1008,_0x4aa9b1){_0x5e1008=_0x5e1008-0x0;var _0x2f15e8=_0x520a[_0x5e1008];return _0x2f15e8;};'use strict';var _=require(_0xa520('0x0'));var util=require('util');var moment=require(_0xa520('0x1'));var BPromise=require(_0xa520('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa520('0x3'))['db'];var utils=require(_0xa520('0x4'));var logger=require(_0xa520('0x5'))(_0xa520('0x6'));var config=require(_0xa520('0x7'));var jayson=require(_0xa520('0x8'));var client=jayson[_0xa520('0x9')][_0xa520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc619c5,_0x5b27df,_0x1ba316){return new BPromise(function(_0x314282,_0x40e60d){return client[_0xa520('0xb')](_0xc619c5,_0x1ba316)[_0xa520('0xc')](function(_0x569294){logger[_0xa520('0xd')](_0xa520('0xe'),_0x5b27df,'request\x20sent');logger[_0xa520('0xf')](_0xa520('0x10'),_0x5b27df,_0xa520('0x11'),JSON['stringify'](_0x569294));if(_0x569294['error']){if(_0x569294[_0xa520('0x12')][_0xa520('0x13')]===0x1f4){logger[_0xa520('0x12')](_0xa520('0xe'),_0x5b27df,_0x569294[_0xa520('0x12')]['message']);return _0x40e60d(_0x569294['error'][_0xa520('0x14')]);}logger['error'](_0xa520('0xe'),_0x5b27df,_0x569294['error']['message']);return _0x314282(_0x569294[_0xa520('0x12')][_0xa520('0x14')]);}else{logger[_0xa520('0xd')](_0xa520('0xe'),_0x5b27df,_0xa520('0x11'));_0x314282(_0x569294['result'][_0xa520('0x14')]);}})[_0xa520('0x15')](function(_0x4618a6){logger[_0xa520('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5b27df,_0x4618a6);_0x40e60d(_0x4618a6);});});} \ No newline at end of file +var _0xfb40=['request\x20sent','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request'];(function(_0x261a5f,_0x4405cc){var _0x508fd7=function(_0x1b1e9b){while(--_0x1b1e9b){_0x261a5f['push'](_0x261a5f['shift']());}};_0x508fd7(++_0x4405cc);}(_0xfb40,0x68));var _0x0fb4=function(_0x5870ae,_0xb9fa8b){_0x5870ae=_0x5870ae-0x0;var _0x1b2eac=_0xfb40[_0x5870ae];return _0x1b2eac;};'use strict';var _=require(_0x0fb4('0x0'));var util=require(_0x0fb4('0x1'));var moment=require('moment');var BPromise=require(_0x0fb4('0x2'));var rs=require(_0x0fb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0fb4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0fb4('0x5'));var jayson=require(_0x0fb4('0x6'));var client=jayson[_0x0fb4('0x7')][_0x0fb4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39d73a,_0x54ac96,_0x25800a){return new BPromise(function(_0x262434,_0x85bacb){return client[_0x0fb4('0x9')](_0x39d73a,_0x25800a)['then'](function(_0x48d39c){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x54ac96,'request\x20sent');logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x54ac96,_0x0fb4('0xa'),JSON[_0x0fb4('0xb')](_0x48d39c));if(_0x48d39c[_0x0fb4('0xc')]){if(_0x48d39c[_0x0fb4('0xc')][_0x0fb4('0xd')]===0x1f4){logger[_0x0fb4('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x54ac96,_0x48d39c[_0x0fb4('0xc')][_0x0fb4('0xe')]);return _0x85bacb(_0x48d39c[_0x0fb4('0xc')][_0x0fb4('0xe')]);}logger[_0x0fb4('0xc')](_0x0fb4('0xf'),_0x54ac96,_0x48d39c['error']['message']);return _0x262434(_0x48d39c[_0x0fb4('0xc')]['message']);}else{logger[_0x0fb4('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x54ac96,_0x0fb4('0xa'));_0x262434(_0x48d39c[_0x0fb4('0x11')][_0x0fb4('0xe')]);}})[_0x0fb4('0x12')](function(_0x5e821a){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x54ac96,_0x5e821a);_0x85bacb(_0x5e821a);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index ce3e2f9..57b4006 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 _0x890c=['put','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','download','diskStorage','join','root','server/files/sounds/original/','replace','%s-%s%s','basename','originalname','extname','now','single','file'];(function(_0x5d8488,_0x42dc2f){var _0x3c34bc=function(_0x101776){while(--_0x101776){_0x5d8488['push'](_0x5d8488['shift']());}};_0x3c34bc(++_0x42dc2f);}(_0x890c,0x77));var _0xc890=function(_0x539991,_0x4fc3aa){_0x539991=_0x539991-0x0;var _0x365d0d=_0x890c[_0x539991];return _0x365d0d;};'use strict';var multer=require(_0xc890('0x0'));var util=require(_0xc890('0x1'));var path=require(_0xc890('0x2'));var timeout=require('connect-timeout');var express=require(_0xc890('0x3'));var router=express[_0xc890('0x4')]();var auth=require(_0xc890('0x5'));var interaction=require(_0xc890('0x6'));var config=require(_0xc890('0x7'));var controller=require(_0xc890('0x8'));router['get']('/',auth[_0xc890('0x9')](),controller[_0xc890('0xa')]);router[_0xc890('0xb')](_0xc890('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xc890('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0xc890('0xd')]);var upload=multer({'storage':multer[_0xc890('0xe')]({'destination':function(_0x25e41f,_0x1aa672,_0x45a50f){_0x45a50f(null,path[_0xc890('0xf')](config[_0xc890('0x10')],_0xc890('0x11')));},'filename':function(_0x12f5cf,_0x3ca588,_0xfc4817){_0x3ca588['originalname']=_0x3ca588['originalname'][_0xc890('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xfc4817(null,util['format'](_0xc890('0x13'),path[_0xc890('0x14')](_0x3ca588[_0xc890('0x15')],path[_0xc890('0x16')](_0x3ca588['originalname'])),Date[_0xc890('0x17')](),path['extname'](_0x3ca588['originalname'])));}})});router['post']('/',upload[_0xc890('0x18')](_0xc890('0x19')),controller['create']);router[_0xc890('0x1a')](_0xc890('0xc'),auth[_0xc890('0x9')](),controller['update']);router[_0xc890('0x1b')]('/:id',auth[_0xc890('0x9')](),controller['delete']);module[_0xc890('0x1c')]=router; \ No newline at end of file +var _0xf649=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get','index','show','/:id/download','isAuthenticated','diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','now','post','single','file','create','/:id','update','delete','exports'];(function(_0x51267a,_0x49abec){var _0x2409fd=function(_0x91fe9f){while(--_0x91fe9f){_0x51267a['push'](_0x51267a['shift']());}};_0x2409fd(++_0x49abec);}(_0xf649,0xf0));var _0x9f64=function(_0x29a63a,_0x139ddc){_0x29a63a=_0x29a63a-0x0;var _0x294151=_0xf649[_0x29a63a];return _0x294151;};'use strict';var multer=require('multer');var util=require(_0x9f64('0x0'));var path=require(_0x9f64('0x1'));var timeout=require(_0x9f64('0x2'));var express=require(_0x9f64('0x3'));var router=express[_0x9f64('0x4')]();var auth=require(_0x9f64('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9f64('0x6'));var controller=require(_0x9f64('0x7'));router[_0x9f64('0x8')]('/',auth['isAuthenticated'](),controller[_0x9f64('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9f64('0xa')]);router['get'](_0x9f64('0xb'),auth[_0x9f64('0xc')](),controller['download']);var upload=multer({'storage':multer[_0x9f64('0xd')]({'destination':function(_0x2ed83e,_0x55c799,_0x15b5f8){_0x15b5f8(null,path[_0x9f64('0xe')](config[_0x9f64('0xf')],'server/files/sounds/original/'));},'filename':function(_0x4511c0,_0x54caee,_0x97f8e8){_0x54caee[_0x9f64('0x10')]=_0x54caee['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x97f8e8(null,util[_0x9f64('0x11')](_0x9f64('0x12'),path[_0x9f64('0x13')](_0x54caee[_0x9f64('0x10')],path[_0x9f64('0x14')](_0x54caee[_0x9f64('0x10')])),Date[_0x9f64('0x15')](),path[_0x9f64('0x14')](_0x54caee[_0x9f64('0x10')])));}})});router[_0x9f64('0x16')]('/',upload[_0x9f64('0x17')](_0x9f64('0x18')),controller[_0x9f64('0x19')]);router['put'](_0x9f64('0x1a'),auth[_0x9f64('0xc')](),controller[_0x9f64('0x1b')]);router[_0x9f64('0x1c')](_0x9f64('0x1a'),auth[_0x9f64('0xc')](),controller['delete']);module[_0x9f64('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 4ff3b6b..0f41010 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 _0x13d7=['sequelize','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x52c398,_0x331956){var _0x31d327=function(_0x578729){while(--_0x578729){_0x52c398['push'](_0x52c398['shift']());}};_0x31d327(++_0x331956);}(_0x13d7,0x102));var _0x713d=function(_0x200b4d,_0x4b997f){_0x200b4d=_0x200b4d-0x0;var _0x29b4d5=_0x13d7[_0x200b4d];return _0x29b4d5;};'use strict';var Sequelize=require(_0x713d('0x0'));module['exports']={'name':{'type':Sequelize[_0x713d('0x1')],'unique':_0x713d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x713d('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x713d('0x1')]},'original_format':{'type':Sequelize[_0x713d('0x1')]},'original_duration':{'type':Sequelize[_0x713d('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x713d('0x4')]},'original_sampleRate':{'type':Sequelize[_0x713d('0x5')]},'converted_format':{'type':Sequelize[_0x713d('0x1')]},'converted_duration':{'type':Sequelize[_0x713d('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x713d('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x713d('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x713d('0x5')]}}; \ No newline at end of file +var _0x6f09=['FLOAT','exports','STRING','INTEGER','BIGINT'];(function(_0x8c6164,_0x1dc7db){var _0x1ca172=function(_0x1c8d48){while(--_0x1c8d48){_0x8c6164['push'](_0x8c6164['shift']());}};_0x1ca172(++_0x1dc7db);}(_0x6f09,0x65));var _0x96f0=function(_0xc11e96,_0x2f0502){_0xc11e96=_0xc11e96-0x0;var _0x25e1ae=_0x6f09[_0xc11e96];return _0x25e1ae;};'use strict';var Sequelize=require('sequelize');module[_0x96f0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x96f0('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x96f0('0x1')]},'original_format':{'type':Sequelize[_0x96f0('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x96f0('0x2')]},'original_bitRate':{'type':Sequelize[_0x96f0('0x3')]},'original_sampleRate':{'type':Sequelize[_0x96f0('0x2')]},'converted_format':{'type':Sequelize[_0x96f0('0x1')]},'converted_duration':{'type':Sequelize[_0x96f0('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x96f0('0x3')]},'converted_channelCount':{'type':Sequelize[_0x96f0('0x2')]},'converted_bitRate':{'type':Sequelize[_0x96f0('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x96f0('0x2')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 3956a68..e858ce1 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 _0xfd6a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','Sound','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','download','find','params','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','file','extname','filename','originalname','substring','wav','root','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','0777','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','body','description','delete','original_format','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x5ee135,_0x3ef7fe){var _0x5d65ec=function(_0xb1c253){while(--_0xb1c253){_0x5ee135['push'](_0x5ee135['shift']());}};_0x5d65ec(++_0x3ef7fe);}(_0xfd6a,0xee));var _0xafd6=function(_0x4123d1,_0x30ccb5){_0x4123d1=_0x4123d1-0x0;var _0x2c0c60=_0xfd6a[_0x4123d1];return _0x2c0c60;};'use strict';var pdf=require(_0xafd6('0x0'));var emlformat=require(_0xafd6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xafd6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xafd6('0x3'));var moment=require(_0xafd6('0x4'));var BPromise=require(_0xafd6('0x5'));var Mustache=require(_0xafd6('0x6'));var util=require(_0xafd6('0x7'));var path=require(_0xafd6('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xafd6('0x9'));var fs=require('fs');var _=require(_0xafd6('0xa'));var squel=require(_0xafd6('0xb'));var crypto=require(_0xafd6('0xc'));var jsforce=require(_0xafd6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xafd6('0xe'));var querystring=require(_0xafd6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xafd6('0x10'));var hardwareService=require(_0xafd6('0x11'));var logger=require(_0xafd6('0x12'))(_0xafd6('0x13'));var utils=require(_0xafd6('0x14'));var config=require(_0xafd6('0x15'));var db=require(_0xafd6('0x16'))['db'];function respondWithStatusCode(_0x52b889,_0x38b18e){_0x38b18e=_0x38b18e||0xcc;return function(_0x313b7c){if(_0x313b7c){return _0x52b889[_0xafd6('0x17')](_0x38b18e);}return _0x52b889['status'](_0x38b18e)['end']();};}function respondWithResult(_0x1b93a8,_0x2c484b){_0x2c484b=_0x2c484b||0xc8;return function(_0x12b9de){if(_0x12b9de){return _0x1b93a8[_0xafd6('0x18')](_0x2c484b)[_0xafd6('0x19')](_0x12b9de);}};}function respondWithFilteredResult(_0x42c4ea,_0x59a8fa){return function(_0x1f8b02){if(_0x1f8b02){var _0x43aea9=_0x1f8b02[_0xafd6('0x1a')],_0x3880a2=_0x59a8fa['offset'],_0x40d582=_0x59a8fa[_0xafd6('0x1b')]+_0x59a8fa[_0xafd6('0x1c')],_0x3f4840;if(_0x40d582>=_0x43aea9){_0x40d582=_0x43aea9;_0x3f4840=0xc8;}else{_0x3f4840=0xce;}_0x42c4ea['status'](_0x3f4840);return _0x42c4ea['set'](_0xafd6('0x1d'),_0x3880a2+'-'+_0x40d582+'/'+_0x43aea9)[_0xafd6('0x19')](_0x1f8b02);}return null;};}function patchUpdates(_0x57d14b){return function(_0x230297){try{jsonpatch[_0xafd6('0x1e')](_0x230297,_0x57d14b,!![]);}catch(_0x82e3ae){return BPromise[_0xafd6('0x1f')](_0x82e3ae);}return _0x230297[_0xafd6('0x20')]();};}function saveUpdates(_0x2ede08,_0x4758e4){return function(_0x5ba8f9){if(_0x5ba8f9){return _0x5ba8f9[_0xafd6('0x21')](_0x2ede08)[_0xafd6('0x22')](function(_0x426771){return _0x426771;});}return null;};}function removeEntity(_0x5c3dcd,_0x41de81){return function(_0x39c241){if(_0x39c241){return _0x39c241[_0xafd6('0x23')]()[_0xafd6('0x22')](function(){var _0x288555=_0x39c241[_0xafd6('0x24')]({'plain':!![]});var _0x45da57='Sounds';return db[_0xafd6('0x25')][_0xafd6('0x23')]({'where':{'type':_0x45da57,'resourceId':_0x288555['id']}})['then'](function(){return _0x39c241;});})[_0xafd6('0x22')](function(){_0x5c3dcd[_0xafd6('0x18')](0xcc)[_0xafd6('0x26')]();});}};}function handleEntityNotFound(_0x57f635,_0x1b8d26){return function(_0xd40bab){if(!_0xd40bab){_0x57f635[_0xafd6('0x17')](0x194);}return _0xd40bab;};}function handleError(_0x35c648,_0x24d18c){_0x24d18c=_0x24d18c||0x1f4;return function(_0x352530){logger[_0xafd6('0x27')](_0x352530[_0xafd6('0x28')]);if(_0x352530[_0xafd6('0x29')]){delete _0x352530[_0xafd6('0x29')];}_0x35c648[_0xafd6('0x18')](_0x24d18c)[_0xafd6('0x2a')](_0x352530);};}exports[_0xafd6('0x2b')]=function(_0x36dd8b,_0xf2cdd0){var _0xb7d1be={},_0x427444={},_0x3ab9f8={'count':0x0,'rows':[]};var _0x10d4aa=_['map'](db[_0xafd6('0x2c')]['rawAttributes'],function(_0x30030a){return{'name':_0x30030a[_0xafd6('0x2d')],'type':_0x30030a['type'][_0xafd6('0x2e')]};});_0x427444[_0xafd6('0x2f')]=_['map'](_0x10d4aa,_0xafd6('0x29'));_0x427444[_0xafd6('0x30')]=_[_0xafd6('0x31')](_0x36dd8b[_0xafd6('0x30')]);_0x427444[_0xafd6('0x32')]=_['intersection'](_0x427444[_0xafd6('0x2f')],_0x427444[_0xafd6('0x30')]);_0xb7d1be['attributes']=_[_0xafd6('0x33')](_0x427444[_0xafd6('0x2f')],qs[_0xafd6('0x34')](_0x36dd8b[_0xafd6('0x30')][_0xafd6('0x34')]));_0xb7d1be['attributes']=_0xb7d1be[_0xafd6('0x35')][_0xafd6('0x36')]?_0xb7d1be[_0xafd6('0x35')]:_0x427444[_0xafd6('0x2f')];if(!_0x36dd8b['query'][_0xafd6('0x37')](_0xafd6('0x38'))){_0xb7d1be[_0xafd6('0x1c')]=qs[_0xafd6('0x1c')](_0x36dd8b[_0xafd6('0x30')][_0xafd6('0x1c')]);_0xb7d1be[_0xafd6('0x1b')]=qs[_0xafd6('0x1b')](_0x36dd8b[_0xafd6('0x30')][_0xafd6('0x1b')]);}_0xb7d1be[_0xafd6('0x39')]=qs[_0xafd6('0x3a')](_0x36dd8b[_0xafd6('0x30')][_0xafd6('0x3a')]);_0xb7d1be[_0xafd6('0x3b')]=qs[_0xafd6('0x32')](_[_0xafd6('0x3c')](_0x36dd8b['query'],_0x427444[_0xafd6('0x32')]));if(_0x36dd8b[_0xafd6('0x30')][_0xafd6('0x3d')]){_0xb7d1be['where']=_[_0xafd6('0x3e')](_0xb7d1be[_0xafd6('0x3b')],{'$or':_[_0xafd6('0x3f')](_0x10d4aa,function(_0x3525eb){if(_0x3525eb['type']!==_0xafd6('0x40')){var _0x4f2dd5={};_0x4f2dd5[_0x3525eb[_0xafd6('0x29')]]={'$like':'%'+_0x36dd8b['query'][_0xafd6('0x3d')]+'%'};return _0x4f2dd5;}})});}_0xb7d1be=_[_0xafd6('0x3e')]({},_0xb7d1be,_0x36dd8b[_0xafd6('0x41')]);var _0x3907ee={'where':_0xb7d1be[_0xafd6('0x3b')]};return db[_0xafd6('0x2c')][_0xafd6('0x1a')](_0x3907ee)[_0xafd6('0x22')](function(_0x4641e8){_0x3ab9f8['count']=_0x4641e8;if(_0x36dd8b[_0xafd6('0x30')][_0xafd6('0x42')]){_0xb7d1be['include']=[{'all':!![]}];}return db[_0xafd6('0x2c')][_0xafd6('0x43')](_0xb7d1be);})[_0xafd6('0x22')](function(_0x53f716){_0x3ab9f8[_0xafd6('0x44')]=_0x53f716;return _0x3ab9f8;})[_0xafd6('0x22')](respondWithFilteredResult(_0xf2cdd0,_0xb7d1be))[_0xafd6('0x45')](handleError(_0xf2cdd0,null));};exports[_0xafd6('0x46')]=function(_0x3f42cc,_0x2e9a57){var _0x3595b5={'raw':!![],'where':{'id':_0x3f42cc['params']['id']}},_0x246219={};_0x246219[_0xafd6('0x2f')]=_[_0xafd6('0x31')](db[_0xafd6('0x2c')][_0xafd6('0x47')]);_0x246219[_0xafd6('0x30')]=_[_0xafd6('0x31')](_0x3f42cc[_0xafd6('0x30')]);_0x246219['filters']=_[_0xafd6('0x33')](_0x246219[_0xafd6('0x2f')],_0x246219[_0xafd6('0x30')]);_0x3595b5[_0xafd6('0x35')]=_['intersection'](_0x246219[_0xafd6('0x2f')],qs[_0xafd6('0x34')](_0x3f42cc[_0xafd6('0x30')][_0xafd6('0x34')]));_0x3595b5[_0xafd6('0x35')]=_0x3595b5[_0xafd6('0x35')][_0xafd6('0x36')]?_0x3595b5[_0xafd6('0x35')]:_0x246219[_0xafd6('0x2f')];if(_0x3f42cc['query'][_0xafd6('0x42')]){_0x3595b5[_0xafd6('0x48')]=[{'all':!![]}];}_0x3595b5=_[_0xafd6('0x3e')]({},_0x3595b5,_0x3f42cc[_0xafd6('0x41')]);return db[_0xafd6('0x2c')]['find'](_0x3595b5)[_0xafd6('0x22')](handleEntityNotFound(_0x2e9a57,null))[_0xafd6('0x22')](respondWithResult(_0x2e9a57,null))[_0xafd6('0x45')](handleError(_0x2e9a57,null));};exports[_0xafd6('0x49')]=function(_0x1c713e,_0xef191f,_0x4c7403){return db[_0xafd6('0x2c')][_0xafd6('0x4a')]({'where':{'id':_0x1c713e[_0xafd6('0x4b')]['id']},'attributes':[_0xafd6('0x29'),_0xafd6('0x4c'),_0xafd6('0x4d')],'raw':!![]})[_0xafd6('0x22')](handleEntityNotFound(_0xef191f,null))['then'](function(_0x354fa9){if(_0x354fa9){if(!fs[_0xafd6('0x4e')](path[_0xafd6('0x4f')](config['root'],_0xafd6('0x50'),_0x354fa9[_0xafd6('0x4c')]+'.'+_0x354fa9['converted_format']))){throw new db[(_0xafd6('0x51'))]['ValidationError'](_0xafd6('0x52'));}return _0xef191f['download'](path[_0xafd6('0x4f')](config['root'],_0xafd6('0x50'),util[_0xafd6('0x53')](_0xafd6('0x54'),_0x354fa9[_0xafd6('0x4c')],_0x354fa9[_0xafd6('0x4d')])),util['format'](_0xafd6('0x54'),_0x354fa9[_0xafd6('0x29')],_0x354fa9['converted_format']));}return null;})[_0xafd6('0x45')](handleError(_0xef191f,null));};exports[_0xafd6('0x55')]=function(_0x5d647e,_0x52b562,_0x434ff6){var _0x5bc2bb={'name':path[_0xafd6('0x56')](_0x5d647e[_0xafd6('0x57')]['originalname'],path[_0xafd6('0x58')](_0x5d647e[_0xafd6('0x57')]['originalname'])),'save_name':path[_0xafd6('0x56')](_0x5d647e['file']['filename'],path['extname'](_0x5d647e[_0xafd6('0x57')][_0xafd6('0x59')])),'original_format':path[_0xafd6('0x58')](_0x5d647e['file'][_0xafd6('0x5a')])[_0xafd6('0x5b')](0x1),'converted_format':_0xafd6('0x5c')};var _0x1e2efe=path['join'](config[_0xafd6('0x5d')],_0xafd6('0x5e'),_0x5d647e[_0xafd6('0x57')]['filename']);var _0x4d7a7b=path['join'](config[_0xafd6('0x5d')],_0xafd6('0x50'),util[_0xafd6('0x53')](_0xafd6('0x54'),path[_0xafd6('0x56')](_0x5d647e[_0xafd6('0x57')][_0xafd6('0x59')],path[_0xafd6('0x58')](_0x5d647e[_0xafd6('0x57')]['filename'])),_0x5bc2bb[_0xafd6('0x4d')]));logger[_0xafd6('0x5f')](_0xafd6('0x60'),_0x1e2efe);logger['info'](_0xafd6('0x61'),_0x4d7a7b);try{fs[_0xafd6('0x62')](_0x1e2efe,parseInt('0777',0x8));var _0x4e515e=sox['transcode'](_0x1e2efe,_0x4d7a7b,{'sampleRate':0x1f40,'format':_0xafd6('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4e515e['on']('error',function(_0x4c7633){fs[_0xafd6('0x63')](_0x1e2efe);_0x52b562[_0xafd6('0x18')](0x1f4)[_0xafd6('0x2a')](_0x4c7633);});_0x4e515e['on'](_0xafd6('0x64'),function(_0x272eab){_0x5bc2bb[_0xafd6('0x65')]=isNaN(_0x272eab[_0xafd6('0x66')])?null:_0x272eab['duration']*0x3e8;_0x5bc2bb[_0xafd6('0x67')]=isNaN(_0x272eab['sampleCount'])?null:_0x272eab[_0xafd6('0x68')];_0x5bc2bb[_0xafd6('0x69')]=isNaN(_0x272eab[_0xafd6('0x6a')])?null:_0x272eab[_0xafd6('0x6a')];_0x5bc2bb[_0xafd6('0x6b')]=isNaN(_0x272eab[_0xafd6('0x6c')])?null:_0x272eab[_0xafd6('0x6c')];_0x5bc2bb[_0xafd6('0x6d')]=isNaN(_0x272eab[_0xafd6('0x6e')])?null:_0x272eab[_0xafd6('0x6e')];});_0x4e515e['on'](_0xafd6('0x6f'),function(_0x123aba){_0x5bc2bb[_0xafd6('0x70')]=isNaN(_0x123aba[_0xafd6('0x66')])?null:_0x123aba['duration']*0x3e8;_0x5bc2bb[_0xafd6('0x71')]=isNaN(_0x123aba[_0xafd6('0x68')])?null:_0x123aba['sampleCount'];_0x5bc2bb[_0xafd6('0x72')]=isNaN(_0x123aba[_0xafd6('0x6a')])?null:_0x123aba['channelCount'];_0x5bc2bb['converted_bitRate']=isNaN(_0x123aba[_0xafd6('0x6c')])?null:_0x123aba[_0xafd6('0x6c')];_0x5bc2bb[_0xafd6('0x73')]=isNaN(_0x123aba[_0xafd6('0x6e')])?null:_0x123aba['sampleRate'];});_0x4e515e['on'](_0xafd6('0x26'),function(){fs[_0xafd6('0x62')](_0x4d7a7b,parseInt(_0xafd6('0x74'),0x8));return db['Sound'][_0xafd6('0x55')](_0x5bc2bb)[_0xafd6('0x22')](function(_0x983a1a){var _0x4882a6={'role':_0x5d647e['body'][_0xafd6('0x75')],'userProfileId':_0x5d647e['body'][_0xafd6('0x76')]};if(!_0x4882a6)throw new Error(_0xafd6('0x77'));if(_0x4882a6[_0xafd6('0x75')]===_0xafd6('0x78')){var _0x3bfdb8=_0x983a1a[_0xafd6('0x24')]({'plain':!![]});return db[_0xafd6('0x79')]['find']({'where':{'name':_0xafd6('0x7a'),'userProfileId':_0x4882a6[_0xafd6('0x76')]},'raw':!![]})['then'](function(_0x327d8f){if(_0x327d8f&&_0x327d8f['autoAssociation']===0x0){return db['UserProfileResource'][_0xafd6('0x55')]({'name':_0x3bfdb8[_0xafd6('0x29')],'resourceId':_0x3bfdb8['id'],'type':_0x327d8f[_0xafd6('0x29')],'sectionId':_0x327d8f['id']},{})[_0xafd6('0x22')](function(){return _0x983a1a;});}else{return _0x983a1a;}})[_0xafd6('0x45')](function(_0x2fdc04){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fdc04);throw _0x2fdc04;});}return _0x983a1a;})[_0xafd6('0x22')](respondWithResult(_0x52b562,null))[_0xafd6('0x45')](handleError(_0x52b562,null));});_0x4e515e['start']();}catch(_0x4d8f9b){_0x52b562[_0xafd6('0x18')](0x1f4)[_0xafd6('0x2a')](_0x4d8f9b);}};exports['update']=function(_0x4ed706,_0x131354,_0x5a80e9){return db[_0xafd6('0x2c')][_0xafd6('0x4a')]({'where':{'id':_0x4ed706['params']['id']}})[_0xafd6('0x22')](handleEntityNotFound(_0x131354,null))[_0xafd6('0x22')](saveUpdates(_[_0xafd6('0x3c')](_0x4ed706[_0xafd6('0x7b')],['name',_0xafd6('0x7c')]),null))[_0xafd6('0x22')](respondWithResult(_0x131354,null))[_0xafd6('0x45')](handleError(_0x131354,null));};exports[_0xafd6('0x7d')]=function(_0x10e9e9,_0x2f4aee,_0x2aae10){return db[_0xafd6('0x2c')][_0xafd6('0x4a')]({'where':{'id':_0x10e9e9['params']['id']}})[_0xafd6('0x22')](function(_0x536a8c){if(_0x536a8c){return _0x536a8c[_0xafd6('0x23')]();}})[_0xafd6('0x22')](function(_0x5b410d){var _0x1ac0bf=path[_0xafd6('0x4f')](config[_0xafd6('0x5d')],_0xafd6('0x5e'),util[_0xafd6('0x53')](_0xafd6('0x54'),_0x5b410d[_0xafd6('0x4c')],_0x5b410d[_0xafd6('0x7e')]));var _0x1fcf75=path[_0xafd6('0x4f')](config[_0xafd6('0x5d')],_0xafd6('0x50'),util[_0xafd6('0x53')](_0xafd6('0x54'),_0x5b410d['save_name'],_0x5b410d[_0xafd6('0x4d')]));fs[_0xafd6('0x63')](_0x1ac0bf);fs[_0xafd6('0x63')](_0x1fcf75);return _0x5b410d;})[_0xafd6('0x22')](function(_0x28428d){if(_0x28428d){return _0x2f4aee[_0xafd6('0x18')](0xcc)[_0xafd6('0x26')]();}})[_0xafd6('0x22')](handleEntityNotFound(_0x2f4aee,null))[_0xafd6('0x45')](handleError(_0x2f4aee,null));}; \ No newline at end of file +var _0x8d60=['sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Sounds','UserProfileResource','error','name','send','index','map','Sound','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','length','find','download','converted_format','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','save_name','%s.%s','create','basename','extname','file','originalname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','description','delete','original_format','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x405a4b,_0x412fd3){var _0x44588d=function(_0x6284b8){while(--_0x6284b8){_0x405a4b['push'](_0x405a4b['shift']());}};_0x44588d(++_0x412fd3);}(_0x8d60,0x6d));var _0x08d6=function(_0x52c00d,_0x2c75d0){_0x52c00d=_0x52c00d-0x0;var _0x58c559=_0x8d60[_0x52c00d];return _0x58c559;};'use strict';var pdf=require(_0x08d6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x08d6('0x1'));var zipdir=require(_0x08d6('0x2'));var jsonpatch=require(_0x08d6('0x3'));var rp=require(_0x08d6('0x4'));var moment=require('moment');var BPromise=require(_0x08d6('0x5'));var Mustache=require(_0x08d6('0x6'));var util=require(_0x08d6('0x7'));var path=require(_0x08d6('0x8'));var sox=require(_0x08d6('0x9'));var csv=require(_0x08d6('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x08d6('0xb'));var squel=require(_0x08d6('0xc'));var crypto=require(_0x08d6('0xd'));var jsforce=require(_0x08d6('0xe'));var deskjs=require(_0x08d6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x08d6('0x10'));var Redis=require('ioredis');var authService=require(_0x08d6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x08d6('0x12'))(_0x08d6('0x13'));var utils=require(_0x08d6('0x14'));var config=require(_0x08d6('0x15'));var db=require(_0x08d6('0x16'))['db'];function respondWithStatusCode(_0x4e7c26,_0xf4c25f){_0xf4c25f=_0xf4c25f||0xcc;return function(_0x4d5e1b){if(_0x4d5e1b){return _0x4e7c26[_0x08d6('0x17')](_0xf4c25f);}return _0x4e7c26[_0x08d6('0x18')](_0xf4c25f)[_0x08d6('0x19')]();};}function respondWithResult(_0x46ff96,_0x4b0681){_0x4b0681=_0x4b0681||0xc8;return function(_0x261323){if(_0x261323){return _0x46ff96[_0x08d6('0x18')](_0x4b0681)[_0x08d6('0x1a')](_0x261323);}};}function respondWithFilteredResult(_0x472d51,_0x5e7de3){return function(_0x3391c0){if(_0x3391c0){var _0x1ff654=_0x3391c0[_0x08d6('0x1b')],_0x417a78=_0x5e7de3[_0x08d6('0x1c')],_0x38ed8a=_0x5e7de3[_0x08d6('0x1c')]+_0x5e7de3[_0x08d6('0x1d')],_0xd73cb0;if(_0x38ed8a>=_0x1ff654){_0x38ed8a=_0x1ff654;_0xd73cb0=0xc8;}else{_0xd73cb0=0xce;}_0x472d51[_0x08d6('0x18')](_0xd73cb0);return _0x472d51[_0x08d6('0x1e')](_0x08d6('0x1f'),_0x417a78+'-'+_0x38ed8a+'/'+_0x1ff654)[_0x08d6('0x1a')](_0x3391c0);}return null;};}function patchUpdates(_0x354b45){return function(_0x40634b){try{jsonpatch[_0x08d6('0x20')](_0x40634b,_0x354b45,!![]);}catch(_0x4b9b80){return BPromise['reject'](_0x4b9b80);}return _0x40634b[_0x08d6('0x21')]();};}function saveUpdates(_0x268c1b,_0x14521d){return function(_0x417506){if(_0x417506){return _0x417506[_0x08d6('0x22')](_0x268c1b)[_0x08d6('0x23')](function(_0x487fa6){return _0x487fa6;});}return null;};}function removeEntity(_0x4ea5f7,_0x36ffe0){return function(_0xb9ccfa){if(_0xb9ccfa){return _0xb9ccfa[_0x08d6('0x24')]()[_0x08d6('0x23')](function(){var _0x2a9d62=_0xb9ccfa[_0x08d6('0x25')]({'plain':!![]});var _0x58b065=_0x08d6('0x26');return db[_0x08d6('0x27')][_0x08d6('0x24')]({'where':{'type':_0x58b065,'resourceId':_0x2a9d62['id']}})[_0x08d6('0x23')](function(){return _0xb9ccfa;});})[_0x08d6('0x23')](function(){_0x4ea5f7[_0x08d6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e5da,_0x3f9f35){return function(_0x1a10ce){if(!_0x1a10ce){_0x46e5da[_0x08d6('0x17')](0x194);}return _0x1a10ce;};}function handleError(_0x1d5ac4,_0x36b676){_0x36b676=_0x36b676||0x1f4;return function(_0x3ba26a){logger[_0x08d6('0x28')](_0x3ba26a['stack']);if(_0x3ba26a[_0x08d6('0x29')]){delete _0x3ba26a[_0x08d6('0x29')];}_0x1d5ac4[_0x08d6('0x18')](_0x36b676)[_0x08d6('0x2a')](_0x3ba26a);};}exports[_0x08d6('0x2b')]=function(_0x25e824,_0xde1523){var _0x552bd1={},_0x2e045b={},_0x413bf8={'count':0x0,'rows':[]};var _0x1f579d=_[_0x08d6('0x2c')](db[_0x08d6('0x2d')]['rawAttributes'],function(_0x4b0d6e){return{'name':_0x4b0d6e[_0x08d6('0x2e')],'type':_0x4b0d6e[_0x08d6('0x2f')]['key']};});_0x2e045b[_0x08d6('0x30')]=_['map'](_0x1f579d,_0x08d6('0x29'));_0x2e045b[_0x08d6('0x31')]=_[_0x08d6('0x32')](_0x25e824['query']);_0x2e045b['filters']=_[_0x08d6('0x33')](_0x2e045b[_0x08d6('0x30')],_0x2e045b[_0x08d6('0x31')]);_0x552bd1[_0x08d6('0x34')]=_['intersection'](_0x2e045b[_0x08d6('0x30')],qs['fields'](_0x25e824[_0x08d6('0x31')][_0x08d6('0x35')]));_0x552bd1[_0x08d6('0x34')]=_0x552bd1[_0x08d6('0x34')]['length']?_0x552bd1[_0x08d6('0x34')]:_0x2e045b['model'];if(!_0x25e824['query'][_0x08d6('0x36')]('nolimit')){_0x552bd1['limit']=qs['limit'](_0x25e824[_0x08d6('0x31')]['limit']);_0x552bd1[_0x08d6('0x1c')]=qs[_0x08d6('0x1c')](_0x25e824['query'][_0x08d6('0x1c')]);}_0x552bd1['order']=qs[_0x08d6('0x37')](_0x25e824[_0x08d6('0x31')][_0x08d6('0x37')]);_0x552bd1[_0x08d6('0x38')]=qs['filters'](_[_0x08d6('0x39')](_0x25e824[_0x08d6('0x31')],_0x2e045b[_0x08d6('0x3a')]));if(_0x25e824[_0x08d6('0x31')][_0x08d6('0x3b')]){_0x552bd1[_0x08d6('0x38')]=_[_0x08d6('0x3c')](_0x552bd1['where'],{'$or':_['map'](_0x1f579d,function(_0x30abc8){if(_0x30abc8[_0x08d6('0x2f')]!==_0x08d6('0x3d')){var _0x529e05={};_0x529e05[_0x30abc8[_0x08d6('0x29')]]={'$like':'%'+_0x25e824['query'][_0x08d6('0x3b')]+'%'};return _0x529e05;}})});}_0x552bd1=_[_0x08d6('0x3c')]({},_0x552bd1,_0x25e824[_0x08d6('0x3e')]);var _0x2be40d={'where':_0x552bd1[_0x08d6('0x38')]};return db[_0x08d6('0x2d')][_0x08d6('0x1b')](_0x2be40d)[_0x08d6('0x23')](function(_0xa60841){_0x413bf8[_0x08d6('0x1b')]=_0xa60841;if(_0x25e824[_0x08d6('0x31')][_0x08d6('0x3f')]){_0x552bd1[_0x08d6('0x40')]=[{'all':!![]}];}return db[_0x08d6('0x2d')]['findAll'](_0x552bd1);})[_0x08d6('0x23')](function(_0x5ca3de){_0x413bf8[_0x08d6('0x41')]=_0x5ca3de;return _0x413bf8;})[_0x08d6('0x23')](respondWithFilteredResult(_0xde1523,_0x552bd1))[_0x08d6('0x42')](handleError(_0xde1523,null));};exports['show']=function(_0x176877,_0x29877d){var _0x4e5701={'raw':!![],'where':{'id':_0x176877[_0x08d6('0x43')]['id']}},_0x4c4981={};_0x4c4981[_0x08d6('0x30')]=_[_0x08d6('0x32')](db[_0x08d6('0x2d')][_0x08d6('0x44')]);_0x4c4981[_0x08d6('0x31')]=_[_0x08d6('0x32')](_0x176877[_0x08d6('0x31')]);_0x4c4981[_0x08d6('0x3a')]=_[_0x08d6('0x33')](_0x4c4981[_0x08d6('0x30')],_0x4c4981[_0x08d6('0x31')]);_0x4e5701[_0x08d6('0x34')]=_[_0x08d6('0x33')](_0x4c4981[_0x08d6('0x30')],qs['fields'](_0x176877[_0x08d6('0x31')]['fields']));_0x4e5701[_0x08d6('0x34')]=_0x4e5701[_0x08d6('0x34')][_0x08d6('0x45')]?_0x4e5701[_0x08d6('0x34')]:_0x4c4981[_0x08d6('0x30')];if(_0x176877[_0x08d6('0x31')][_0x08d6('0x3f')]){_0x4e5701['include']=[{'all':!![]}];}_0x4e5701=_[_0x08d6('0x3c')]({},_0x4e5701,_0x176877[_0x08d6('0x3e')]);return db[_0x08d6('0x2d')][_0x08d6('0x46')](_0x4e5701)[_0x08d6('0x23')](handleEntityNotFound(_0x29877d,null))[_0x08d6('0x23')](respondWithResult(_0x29877d,null))['catch'](handleError(_0x29877d,null));};exports[_0x08d6('0x47')]=function(_0x21e693,_0x1abf76,_0x531e51){return db[_0x08d6('0x2d')][_0x08d6('0x46')]({'where':{'id':_0x21e693[_0x08d6('0x43')]['id']},'attributes':['name','save_name',_0x08d6('0x48')],'raw':!![]})[_0x08d6('0x23')](handleEntityNotFound(_0x1abf76,null))[_0x08d6('0x23')](function(_0x203a35){if(_0x203a35){if(!fs['existsSync'](path[_0x08d6('0x49')](config[_0x08d6('0x4a')],_0x08d6('0x4b'),_0x203a35['save_name']+'.'+_0x203a35[_0x08d6('0x48')]))){throw new db[(_0x08d6('0x4c'))][(_0x08d6('0x4d'))](_0x08d6('0x4e'));}return _0x1abf76[_0x08d6('0x47')](path[_0x08d6('0x49')](config[_0x08d6('0x4a')],'server/files/sounds/converted',util[_0x08d6('0x4f')]('%s.%s',_0x203a35[_0x08d6('0x50')],_0x203a35[_0x08d6('0x48')])),util[_0x08d6('0x4f')](_0x08d6('0x51'),_0x203a35[_0x08d6('0x29')],_0x203a35[_0x08d6('0x48')]));}return null;})[_0x08d6('0x42')](handleError(_0x1abf76,null));};exports[_0x08d6('0x52')]=function(_0xb21181,_0x5f3af2,_0x21c6fa){var _0x2b72f9={'name':path[_0x08d6('0x53')](_0xb21181['file']['originalname'],path[_0x08d6('0x54')](_0xb21181[_0x08d6('0x55')][_0x08d6('0x56')])),'save_name':path['basename'](_0xb21181[_0x08d6('0x55')][_0x08d6('0x57')],path['extname'](_0xb21181[_0x08d6('0x55')][_0x08d6('0x57')])),'original_format':path[_0x08d6('0x54')](_0xb21181['file'][_0x08d6('0x56')])[_0x08d6('0x58')](0x1),'converted_format':'wav'};var _0x185208=path[_0x08d6('0x49')](config[_0x08d6('0x4a')],_0x08d6('0x59'),_0xb21181[_0x08d6('0x55')][_0x08d6('0x57')]);var _0x2bf883=path[_0x08d6('0x49')](config[_0x08d6('0x4a')],'server/files/sounds/converted',util[_0x08d6('0x4f')](_0x08d6('0x51'),path[_0x08d6('0x53')](_0xb21181[_0x08d6('0x55')][_0x08d6('0x57')],path[_0x08d6('0x54')](_0xb21181['file']['filename'])),_0x2b72f9[_0x08d6('0x48')]));logger[_0x08d6('0x5a')](_0x08d6('0x5b'),_0x185208);logger[_0x08d6('0x5a')]('Sound\x20upload\x20destination:\x20%s',_0x2bf883);try{fs[_0x08d6('0x5c')](_0x185208,parseInt('0777',0x8));var _0x22b296=sox['transcode'](_0x185208,_0x2bf883,{'sampleRate':0x1f40,'format':_0x08d6('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x22b296['on'](_0x08d6('0x28'),function(_0x45bd14){fs[_0x08d6('0x5e')](_0x185208);_0x5f3af2[_0x08d6('0x18')](0x1f4)[_0x08d6('0x2a')](_0x45bd14);});_0x22b296['on'](_0x08d6('0x5f'),function(_0x1bbd82){_0x2b72f9[_0x08d6('0x60')]=isNaN(_0x1bbd82[_0x08d6('0x61')])?null:_0x1bbd82[_0x08d6('0x61')]*0x3e8;_0x2b72f9[_0x08d6('0x62')]=isNaN(_0x1bbd82[_0x08d6('0x63')])?null:_0x1bbd82['sampleCount'];_0x2b72f9[_0x08d6('0x64')]=isNaN(_0x1bbd82[_0x08d6('0x65')])?null:_0x1bbd82['channelCount'];_0x2b72f9[_0x08d6('0x66')]=isNaN(_0x1bbd82['bitRate'])?null:_0x1bbd82[_0x08d6('0x67')];_0x2b72f9[_0x08d6('0x68')]=isNaN(_0x1bbd82[_0x08d6('0x69')])?null:_0x1bbd82[_0x08d6('0x69')];});_0x22b296['on'](_0x08d6('0x6a'),function(_0x35ab10){_0x2b72f9['converted_duration']=isNaN(_0x35ab10[_0x08d6('0x61')])?null:_0x35ab10[_0x08d6('0x61')]*0x3e8;_0x2b72f9[_0x08d6('0x6b')]=isNaN(_0x35ab10[_0x08d6('0x63')])?null:_0x35ab10[_0x08d6('0x63')];_0x2b72f9['converted_channelCount']=isNaN(_0x35ab10[_0x08d6('0x65')])?null:_0x35ab10[_0x08d6('0x65')];_0x2b72f9[_0x08d6('0x6c')]=isNaN(_0x35ab10['bitRate'])?null:_0x35ab10['bitRate'];_0x2b72f9[_0x08d6('0x6d')]=isNaN(_0x35ab10['sampleRate'])?null:_0x35ab10['sampleRate'];});_0x22b296['on'](_0x08d6('0x19'),function(){fs[_0x08d6('0x5c')](_0x2bf883,parseInt('0777',0x8));return db[_0x08d6('0x2d')]['create'](_0x2b72f9)['then'](function(_0x3a7a05){var _0x3013ad={'role':_0xb21181[_0x08d6('0x6e')][_0x08d6('0x6f')],'userProfileId':_0xb21181['body'][_0x08d6('0x70')]};if(!_0x3013ad)throw new Error(_0x08d6('0x71'));if(_0x3013ad[_0x08d6('0x6f')]==='user'){var _0x245c61=_0x3a7a05['get']({'plain':!![]});return db[_0x08d6('0x72')]['find']({'where':{'name':'Sounds','userProfileId':_0x3013ad[_0x08d6('0x70')]},'raw':!![]})[_0x08d6('0x23')](function(_0x492608){if(_0x492608&&_0x492608['autoAssociation']===0x0){return db[_0x08d6('0x27')][_0x08d6('0x52')]({'name':_0x245c61[_0x08d6('0x29')],'resourceId':_0x245c61['id'],'type':_0x492608[_0x08d6('0x29')],'sectionId':_0x492608['id']},{})['then'](function(){return _0x3a7a05;});}else{return _0x3a7a05;}})['catch'](function(_0x4c4337){logger[_0x08d6('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c4337);throw _0x4c4337;});}return _0x3a7a05;})[_0x08d6('0x23')](respondWithResult(_0x5f3af2,null))[_0x08d6('0x42')](handleError(_0x5f3af2,null));});_0x22b296['start']();}catch(_0x303aaf){_0x5f3af2['status'](0x1f4)[_0x08d6('0x2a')](_0x303aaf);}};exports[_0x08d6('0x22')]=function(_0x4d1fae,_0x38b1ce,_0x312b29){return db[_0x08d6('0x2d')][_0x08d6('0x46')]({'where':{'id':_0x4d1fae[_0x08d6('0x43')]['id']}})[_0x08d6('0x23')](handleEntityNotFound(_0x38b1ce,null))[_0x08d6('0x23')](saveUpdates(_[_0x08d6('0x39')](_0x4d1fae[_0x08d6('0x6e')],[_0x08d6('0x29'),_0x08d6('0x73')]),null))[_0x08d6('0x23')](respondWithResult(_0x38b1ce,null))[_0x08d6('0x42')](handleError(_0x38b1ce,null));};exports[_0x08d6('0x74')]=function(_0x226a58,_0x459c32,_0x167067){return db[_0x08d6('0x2d')]['find']({'where':{'id':_0x226a58[_0x08d6('0x43')]['id']}})['then'](function(_0x1d6feb){if(_0x1d6feb){return _0x1d6feb[_0x08d6('0x24')]();}})[_0x08d6('0x23')](function(_0x43640e){var _0x202a18=path['join'](config[_0x08d6('0x4a')],_0x08d6('0x59'),util[_0x08d6('0x4f')](_0x08d6('0x51'),_0x43640e[_0x08d6('0x50')],_0x43640e[_0x08d6('0x75')]));var _0x59b286=path['join'](config[_0x08d6('0x4a')],_0x08d6('0x4b'),util['format'](_0x08d6('0x51'),_0x43640e[_0x08d6('0x50')],_0x43640e[_0x08d6('0x48')]));fs['unlinkSync'](_0x202a18);fs[_0x08d6('0x5e')](_0x59b286);return _0x43640e;})[_0x08d6('0x23')](function(_0x4665ca){if(_0x4665ca){return _0x459c32[_0x08d6('0x18')](0xcc)[_0x08d6('0x19')]();}})[_0x08d6('0x23')](handleEntityNotFound(_0x459c32,null))[_0x08d6('0x42')](handleError(_0x459c32,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 78cfdf2..0f50922 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 _0x9047=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','lodash','util'];(function(_0x530408,_0x33eec6){var _0x5df96f=function(_0x462221){while(--_0x462221){_0x530408['push'](_0x530408['shift']());}};_0x5df96f(++_0x33eec6);}(_0x9047,0x166));var _0x7904=function(_0x4a1443,_0x39ed40){_0x4a1443=_0x4a1443-0x0;var _0x47c56b=_0x9047[_0x4a1443];return _0x47c56b;};'use strict';var _=require(_0x7904('0x0'));var util=require(_0x7904('0x1'));var logger=require(_0x7904('0x2'))('api');var moment=require(_0x7904('0x3'));var BPromise=require(_0x7904('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7904('0x5'));var rimraf=require(_0x7904('0x6'));var config=require(_0x7904('0x7'));var attributes=require(_0x7904('0x8'));module[_0x7904('0x9')]=function(_0x1a53bb,_0x388ae3){return _0x1a53bb[_0x7904('0xa')](_0x7904('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0da=['define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x3ec217,_0xf590cf){var _0x512066=function(_0x3602d6){while(--_0x3602d6){_0x3ec217['push'](_0x3ec217['shift']());}};_0x512066(++_0xf590cf);}(_0xc0da,0x6d));var _0xac0d=function(_0x13d53e,_0x46c19a){_0x13d53e=_0x13d53e-0x0;var _0x432238=_0xc0da[_0x13d53e];return _0x432238;};'use strict';var _=require(_0xac0d('0x0'));var util=require(_0xac0d('0x1'));var logger=require(_0xac0d('0x2'))(_0xac0d('0x3'));var moment=require(_0xac0d('0x4'));var BPromise=require('bluebird');var rp=require(_0xac0d('0x5'));var fs=require('fs');var path=require(_0xac0d('0x6'));var rimraf=require(_0xac0d('0x7'));var config=require(_0xac0d('0x8'));var attributes=require(_0xac0d('0x9'));module[_0xac0d('0xa')]=function(_0x483141,_0x4222f9){return _0x483141[_0xac0d('0xb')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 37ea2f8..a870f52 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 _0x41ce=['attributes','include','model','map','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','ShowSound','Sound','options'];(function(_0x4cab57,_0x3cf502){var _0x457d6d=function(_0x1785a2){while(--_0x1785a2){_0x4cab57['push'](_0x4cab57['shift']());}};_0x457d6d(++_0x3cf502);}(_0x41ce,0x159));var _0xe41c=function(_0x49527d,_0x1da7f2){_0x49527d=_0x49527d-0x0;var _0x19e2e7=_0x41ce[_0x49527d];return _0x19e2e7;};'use strict';var _=require(_0xe41c('0x0'));var util=require(_0xe41c('0x1'));var moment=require(_0xe41c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe41c('0x3'));var db=require(_0xe41c('0x4'))['db'];var utils=require(_0xe41c('0x5'));var logger=require(_0xe41c('0x6'))(_0xe41c('0x7'));var config=require(_0xe41c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe41c('0x9')][_0xe41c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4edda6,_0x1e8455,_0x49150c){return new BPromise(function(_0x442d02,_0x58d0b2){return client[_0xe41c('0xb')](_0x4edda6,_0x49150c)[_0xe41c('0xc')](function(_0x580c9c){logger[_0xe41c('0xd')](_0xe41c('0xe'),_0x1e8455,_0xe41c('0xf'));logger[_0xe41c('0x10')](_0xe41c('0x11'),_0x1e8455,'request\x20sent',JSON[_0xe41c('0x12')](_0x580c9c));if(_0x580c9c['error']){if(_0x580c9c['error'][_0xe41c('0x13')]===0x1f4){logger[_0xe41c('0x14')](_0xe41c('0xe'),_0x1e8455,_0x580c9c['error'][_0xe41c('0x15')]);return _0x58d0b2(_0x580c9c['error'][_0xe41c('0x15')]);}logger[_0xe41c('0x14')]('Sound,\x20%s,\x20%s',_0x1e8455,_0x580c9c[_0xe41c('0x14')]['message']);return _0x442d02(_0x580c9c[_0xe41c('0x14')][_0xe41c('0x15')]);}else{logger['info'](_0xe41c('0xe'),_0x1e8455,_0xe41c('0xf'));_0x442d02(_0x580c9c[_0xe41c('0x16')]['message']);}})[_0xe41c('0x17')](function(_0x288699){logger[_0xe41c('0x14')](_0xe41c('0xe'),_0x1e8455,_0x288699);_0x58d0b2(_0x288699);});});}exports[_0xe41c('0x18')]=function(_0x2c139b){var _0x41aa83=this;return new Promise(function(_0x2688b6,_0xea487a){return db[_0xe41c('0x19')]['find']({'raw':_0x2c139b[_0xe41c('0x1a')]?_0x2c139b[_0xe41c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2c139b['options']?_0x2c139b['options']['where']||null:null,'attributes':_0x2c139b['options']?_0x2c139b['options'][_0xe41c('0x1b')]||null:null,'include':_0x2c139b[_0xe41c('0x1a')]?_0x2c139b[_0xe41c('0x1a')]['include']?_['map'](_0x2c139b[_0xe41c('0x1a')][_0xe41c('0x1c')],function(_0x937b54){return{'model':db[_0x937b54[_0xe41c('0x1d')]],'as':_0x937b54['as'],'attributes':_0x937b54['attributes'],'include':_0x937b54[_0xe41c('0x1c')]?_[_0xe41c('0x1e')](_0x937b54['include'],function(_0x336ce9){return{'model':db[_0x336ce9[_0xe41c('0x1d')]],'as':_0x336ce9['as'],'attributes':_0x336ce9['attributes'],'include':_0x336ce9[_0xe41c('0x1c')]?_['map'](_0x336ce9[_0xe41c('0x1c')],function(_0x581416){return{'model':db[_0x581416[_0xe41c('0x1d')]],'as':_0x581416['as'],'attributes':_0x581416[_0xe41c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe41c('0xc')](function(_0x20fb98){logger[_0xe41c('0xd')](_0xe41c('0x18'),_0x2c139b);logger[_0xe41c('0x10')]('ShowSound',_0x2c139b,JSON[_0xe41c('0x12')](_0x20fb98));_0x2688b6(_0x20fb98);})['catch'](function(_0x31b266){logger[_0xe41c('0x14')](_0xe41c('0x18'),_0x31b266['message'],_0x2c139b);_0xea487a(_0x41aa83[_0xe41c('0x14')](0x1f4,_0x31b266['message']));});});}; \ No newline at end of file +var _0xdddb=['lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSound','Sound','options','raw','where','attributes','map','include','model','debug'];(function(_0x414b44,_0x3b95a0){var _0x32fa6b=function(_0x109d96){while(--_0x109d96){_0x414b44['push'](_0x414b44['shift']());}};_0x32fa6b(++_0x3b95a0);}(_0xdddb,0x16c));var _0xbddd=function(_0x343560,_0x65d36a){_0x343560=_0x343560-0x0;var _0x4d3a42=_0xdddb[_0x343560];return _0x4d3a42;};'use strict';var _=require(_0xbddd('0x0'));var util=require('util');var moment=require(_0xbddd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbddd('0x2'));var db=require(_0xbddd('0x3'))['db'];var utils=require(_0xbddd('0x4'));var logger=require(_0xbddd('0x5'))(_0xbddd('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbddd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24a34b,_0x2571b9,_0x29856e){return new BPromise(function(_0x2f3dd0,_0x3e33b8){return client[_0xbddd('0x8')](_0x24a34b,_0x29856e)[_0xbddd('0x9')](function(_0x196f89){logger[_0xbddd('0xa')](_0xbddd('0xb'),_0x2571b9,'request\x20sent');logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x2571b9,_0xbddd('0xc'),JSON[_0xbddd('0xd')](_0x196f89));if(_0x196f89[_0xbddd('0xe')]){if(_0x196f89['error']['code']===0x1f4){logger[_0xbddd('0xe')](_0xbddd('0xb'),_0x2571b9,_0x196f89[_0xbddd('0xe')][_0xbddd('0xf')]);return _0x3e33b8(_0x196f89[_0xbddd('0xe')][_0xbddd('0xf')]);}logger[_0xbddd('0xe')]('Sound,\x20%s,\x20%s',_0x2571b9,_0x196f89[_0xbddd('0xe')][_0xbddd('0xf')]);return _0x2f3dd0(_0x196f89[_0xbddd('0xe')][_0xbddd('0xf')]);}else{logger[_0xbddd('0xa')](_0xbddd('0xb'),_0x2571b9,'request\x20sent');_0x2f3dd0(_0x196f89[_0xbddd('0x10')]['message']);}})[_0xbddd('0x11')](function(_0x45ff79){logger[_0xbddd('0xe')]('Sound,\x20%s,\x20%s',_0x2571b9,_0x45ff79);_0x3e33b8(_0x45ff79);});});}exports[_0xbddd('0x12')]=function(_0x575030){var _0x17ff91=this;return new Promise(function(_0xcf11e4,_0x139d93){return db[_0xbddd('0x13')]['find']({'raw':_0x575030[_0xbddd('0x14')]?_0x575030[_0xbddd('0x14')][_0xbddd('0x15')]===undefined?!![]:![]:!![],'where':_0x575030[_0xbddd('0x14')]?_0x575030[_0xbddd('0x14')][_0xbddd('0x16')]||null:null,'attributes':_0x575030[_0xbddd('0x14')]?_0x575030[_0xbddd('0x14')][_0xbddd('0x17')]||null:null,'include':_0x575030['options']?_0x575030[_0xbddd('0x14')]['include']?_[_0xbddd('0x18')](_0x575030[_0xbddd('0x14')][_0xbddd('0x19')],function(_0x40c399){return{'model':db[_0x40c399[_0xbddd('0x1a')]],'as':_0x40c399['as'],'attributes':_0x40c399[_0xbddd('0x17')],'include':_0x40c399[_0xbddd('0x19')]?_[_0xbddd('0x18')](_0x40c399[_0xbddd('0x19')],function(_0x5a3bc4){return{'model':db[_0x5a3bc4[_0xbddd('0x1a')]],'as':_0x5a3bc4['as'],'attributes':_0x5a3bc4[_0xbddd('0x17')],'include':_0x5a3bc4['include']?_[_0xbddd('0x18')](_0x5a3bc4[_0xbddd('0x19')],function(_0x2cdab9){return{'model':db[_0x2cdab9[_0xbddd('0x1a')]],'as':_0x2cdab9['as'],'attributes':_0x2cdab9[_0xbddd('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbddd('0x9')](function(_0x1b8f38){logger[_0xbddd('0xa')]('ShowSound',_0x575030);logger[_0xbddd('0x1b')](_0xbddd('0x12'),_0x575030,JSON[_0xbddd('0xd')](_0x1b8f38));_0xcf11e4(_0x1b8f38);})[_0xbddd('0x11')](function(_0x4d54d8){logger['error'](_0xbddd('0x12'),_0x4d54d8[_0xbddd('0xf')],_0x575030);_0x139d93(_0x17ff91[_0xbddd('0xe')](0x1f4,_0x4d54d8['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index b88667d..3e2341c 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 _0xece8=['post','create','put','update','delete','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','/:id','show'];(function(_0x552cf8,_0x493a58){var _0x5b0eca=function(_0xbc6b6d){while(--_0xbc6b6d){_0x552cf8['push'](_0x552cf8['shift']());}};_0x5b0eca(++_0x493a58);}(_0xece8,0x1af));var _0x8ece=function(_0x27330c,_0x2567a1){_0x27330c=_0x27330c-0x0;var _0x1fd23f=_0xece8[_0x27330c];return _0x1fd23f;};'use strict';var multer=require('multer');var util=require(_0x8ece('0x0'));var path=require('path');var timeout=require(_0x8ece('0x1'));var express=require('express');var router=express[_0x8ece('0x2')]();var auth=require(_0x8ece('0x3'));var interaction=require(_0x8ece('0x4'));var config=require(_0x8ece('0x5'));var controller=require(_0x8ece('0x6'));router[_0x8ece('0x7')]('/',auth[_0x8ece('0x8')](),controller['index']);router[_0x8ece('0x7')](_0x8ece('0x9'),auth[_0x8ece('0x8')](),controller[_0x8ece('0xa')]);router[_0x8ece('0xb')]('/',auth[_0x8ece('0x8')](),controller[_0x8ece('0xc')]);router[_0x8ece('0xd')](_0x8ece('0x9'),auth['isAuthenticated'](),controller[_0x8ece('0xe')]);router[_0x8ece('0xf')](_0x8ece('0x9'),auth[_0x8ece('0x8')](),controller[_0x8ece('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5025=['show','put','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5025,0x19d));var _0x5502=function(_0x2ff8ae,_0x459670){_0x2ff8ae=_0x2ff8ae-0x0;var _0x52d112=_0x5025[_0x2ff8ae];return _0x52d112;};'use strict';var multer=require('multer');var util=require(_0x5502('0x0'));var path=require(_0x5502('0x1'));var timeout=require(_0x5502('0x2'));var express=require(_0x5502('0x3'));var router=express['Router']();var auth=require(_0x5502('0x4'));var interaction=require(_0x5502('0x5'));var config=require(_0x5502('0x6'));var controller=require(_0x5502('0x7'));router[_0x5502('0x8')]('/',auth[_0x5502('0x9')](),controller[_0x5502('0xa')]);router['get'](_0x5502('0xb'),auth[_0x5502('0x9')](),controller[_0x5502('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5502('0xd')]('/:id',auth[_0x5502('0x9')](),controller[_0x5502('0xe')]);router['delete'](_0x5502('0xb'),auth['isAuthenticated'](),controller[_0x5502('0xf')]);module[_0x5502('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 34513ac..9b6829d 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 _0xd2dc=['TEXT','medium','ENUM','out','STRING'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0xd2dc,0x9a));var _0xcd2d=function(_0x3b7733,_0x6d3c5a){_0x3b7733=_0x3b7733-0x0;var _0x3c377d=_0xd2dc[_0x3b7733];return _0x3c377d;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xcd2d('0x0')]},'body':{'type':Sequelize[_0xcd2d('0x1')](_0xcd2d('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xcd2d('0x3')]('in',_0xcd2d('0x4')),'defaultValue':_0xcd2d('0x4'),'allowNull':![]}}; \ No newline at end of file +var _0x93a4=['out','sequelize','exports','TEXT','medium','ENUM'];(function(_0x4772e0,_0x1072a2){var _0x8797f0=function(_0x24d04f){while(--_0x24d04f){_0x4772e0['push'](_0x4772e0['shift']());}};_0x8797f0(++_0x1072a2);}(_0x93a4,0x157));var _0x493a=function(_0x414324,_0x4719b0){_0x414324=_0x414324-0x0;var _0x3490b5=_0x93a4[_0x414324];return _0x3490b5;};'use strict';var Sequelize=require(_0x493a('0x0'));module[_0x493a('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x493a('0x2')](_0x493a('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x493a('0x4')]('in',_0x493a('0x5')),'defaultValue':_0x493a('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index deb63bc..f87a7b9 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 _0x99dc=['filter','merge','where','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x2e8775,_0x310049){var _0x4cbf35=function(_0x103483){while(--_0x103483){_0x2e8775['push'](_0x2e8775['shift']());}};_0x4cbf35(++_0x310049);}(_0x99dc,0xa2));var _0xc99d=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x99dc[_0x5ec454];return _0x5ebf50;};'use strict';var pdf=require(_0xc99d('0x0'));var emlformat=require(_0xc99d('0x1'));var rimraf=require(_0xc99d('0x2'));var zipdir=require(_0xc99d('0x3'));var jsonpatch=require(_0xc99d('0x4'));var rp=require(_0xc99d('0x5'));var moment=require(_0xc99d('0x6'));var BPromise=require(_0xc99d('0x7'));var Mustache=require('mustache');var util=require(_0xc99d('0x8'));var path=require(_0xc99d('0x9'));var sox=require(_0xc99d('0xa'));var csv=require(_0xc99d('0xb'));var ejs=require(_0xc99d('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc99d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc99d('0xb'));var querystring=require(_0xc99d('0xe'));var Papa=require(_0xc99d('0xf'));var Redis=require(_0xc99d('0x10'));var authService=require(_0xc99d('0x11'));var qs=require(_0xc99d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc99d('0x13'))(_0xc99d('0x14'));var utils=require(_0xc99d('0x15'));var config=require(_0xc99d('0x16'));var db=require(_0xc99d('0x17'))['db'];function respondWithStatusCode(_0x23eedb,_0x231b9f){_0x231b9f=_0x231b9f||0xcc;return function(_0x43a912){if(_0x43a912){return _0x23eedb[_0xc99d('0x18')](_0x231b9f);}return _0x23eedb[_0xc99d('0x19')](_0x231b9f)[_0xc99d('0x1a')]();};}function respondWithResult(_0x5c45af,_0x1f29e0){_0x1f29e0=_0x1f29e0||0xc8;return function(_0x2a8dfe){if(_0x2a8dfe){return _0x5c45af[_0xc99d('0x19')](_0x1f29e0)['json'](_0x2a8dfe);}};}function respondWithFilteredResult(_0x403b81,_0x317f02){return function(_0x57143b){if(_0x57143b){var _0x32bd1e=_0x57143b[_0xc99d('0x1b')],_0x324105=_0x317f02[_0xc99d('0x1c')],_0x4f90d1=_0x317f02[_0xc99d('0x1c')]+_0x317f02[_0xc99d('0x1d')],_0x24bda0;if(_0x4f90d1>=_0x32bd1e){_0x4f90d1=_0x32bd1e;_0x24bda0=0xc8;}else{_0x24bda0=0xce;}_0x403b81[_0xc99d('0x19')](_0x24bda0);return _0x403b81[_0xc99d('0x1e')](_0xc99d('0x1f'),_0x324105+'-'+_0x4f90d1+'/'+_0x32bd1e)[_0xc99d('0x20')](_0x57143b);}return null;};}function patchUpdates(_0x56d3e8){return function(_0x57a797){try{jsonpatch['apply'](_0x57a797,_0x56d3e8,!![]);}catch(_0x100a35){return BPromise[_0xc99d('0x21')](_0x100a35);}return _0x57a797['save']();};}function saveUpdates(_0x492041,_0x5f2453){return function(_0x2ddc2a){if(_0x2ddc2a){return _0x2ddc2a[_0xc99d('0x22')](_0x492041)[_0xc99d('0x23')](function(_0x3fde93){return _0x3fde93;});}return null;};}function removeEntity(_0x4aa8f8,_0x271594){return function(_0x85609a){if(_0x85609a){return _0x85609a[_0xc99d('0x24')]()[_0xc99d('0x23')](function(){_0x4aa8f8[_0xc99d('0x19')](0xcc)[_0xc99d('0x1a')]();});}};}function handleEntityNotFound(_0x26bb20,_0x5a35b2){return function(_0x3a984a){if(!_0x3a984a){_0x26bb20['sendStatus'](0x194);}return _0x3a984a;};}function handleError(_0x1db4fe,_0xba971c){_0xba971c=_0xba971c||0x1f4;return function(_0x5cdb20){logger[_0xc99d('0x25')](_0x5cdb20[_0xc99d('0x26')]);if(_0x5cdb20[_0xc99d('0x27')]){delete _0x5cdb20[_0xc99d('0x27')];}_0x1db4fe[_0xc99d('0x19')](_0xba971c)[_0xc99d('0x28')](_0x5cdb20);};}exports[_0xc99d('0x29')]=function(_0x522dea,_0x6d7ac2){var _0x1888de={},_0xe0758={},_0x56e5b8={'count':0x0,'rows':[]};var _0x45f7f9=_[_0xc99d('0x2a')](db[_0xc99d('0x2b')][_0xc99d('0x2c')],function(_0x20b2a0){return{'name':_0x20b2a0[_0xc99d('0x2d')],'type':_0x20b2a0['type']['key']};});_0xe0758[_0xc99d('0x2e')]=_[_0xc99d('0x2a')](_0x45f7f9,'name');_0xe0758['query']=_[_0xc99d('0x2f')](_0x522dea[_0xc99d('0x30')]);_0xe0758[_0xc99d('0x31')]=_[_0xc99d('0x32')](_0xe0758[_0xc99d('0x2e')],_0xe0758[_0xc99d('0x30')]);_0x1888de['attributes']=_[_0xc99d('0x32')](_0xe0758[_0xc99d('0x2e')],qs[_0xc99d('0x33')](_0x522dea[_0xc99d('0x30')]['fields']));_0x1888de['attributes']=_0x1888de[_0xc99d('0x34')][_0xc99d('0x35')]?_0x1888de[_0xc99d('0x34')]:_0xe0758['model'];if(!_0x522dea[_0xc99d('0x30')][_0xc99d('0x36')](_0xc99d('0x37'))){_0x1888de[_0xc99d('0x1d')]=qs['limit'](_0x522dea[_0xc99d('0x30')]['limit']);_0x1888de[_0xc99d('0x1c')]=qs['offset'](_0x522dea['query'][_0xc99d('0x1c')]);}_0x1888de['order']=qs[_0xc99d('0x38')](_0x522dea[_0xc99d('0x30')][_0xc99d('0x38')]);_0x1888de['where']=qs[_0xc99d('0x31')](_['pick'](_0x522dea[_0xc99d('0x30')],_0xe0758[_0xc99d('0x31')]));if(_0x522dea[_0xc99d('0x30')][_0xc99d('0x39')]){_0x1888de['where']=_[_0xc99d('0x3a')](_0x1888de[_0xc99d('0x3b')],{'$or':_['map'](_0x45f7f9,function(_0x23cd3f){if(_0x23cd3f[_0xc99d('0x3c')]!==_0xc99d('0x3d')){var _0x11e087={};_0x11e087[_0x23cd3f[_0xc99d('0x27')]]={'$like':'%'+_0x522dea[_0xc99d('0x30')]['filter']+'%'};return _0x11e087;}})});}_0x1888de=_[_0xc99d('0x3a')]({},_0x1888de,_0x522dea['options']);var _0x3b9143={'where':_0x1888de[_0xc99d('0x3b')]};return db[_0xc99d('0x2b')][_0xc99d('0x1b')](_0x3b9143)[_0xc99d('0x23')](function(_0x136931){_0x56e5b8['count']=_0x136931;if(_0x522dea[_0xc99d('0x30')][_0xc99d('0x3e')]){_0x1888de[_0xc99d('0x3f')]=[{'all':!![]}];}return db[_0xc99d('0x2b')][_0xc99d('0x40')](_0x1888de);})['then'](function(_0x447113){_0x56e5b8[_0xc99d('0x41')]=_0x447113;return _0x56e5b8;})['then'](respondWithFilteredResult(_0x6d7ac2,_0x1888de))[_0xc99d('0x42')](handleError(_0x6d7ac2,null));};exports[_0xc99d('0x43')]=function(_0x3b49f0,_0x2b9693){var _0x109d7c={'raw':!![],'where':{'id':_0x3b49f0[_0xc99d('0x44')]['id']}},_0x5b74c={};_0x5b74c[_0xc99d('0x2e')]=_['keys'](db[_0xc99d('0x2b')][_0xc99d('0x2c')]);_0x5b74c[_0xc99d('0x30')]=_['keys'](_0x3b49f0[_0xc99d('0x30')]);_0x5b74c['filters']=_['intersection'](_0x5b74c['model'],_0x5b74c[_0xc99d('0x30')]);_0x109d7c[_0xc99d('0x34')]=_[_0xc99d('0x32')](_0x5b74c['model'],qs[_0xc99d('0x33')](_0x3b49f0[_0xc99d('0x30')][_0xc99d('0x33')]));_0x109d7c[_0xc99d('0x34')]=_0x109d7c['attributes'][_0xc99d('0x35')]?_0x109d7c[_0xc99d('0x34')]:_0x5b74c['model'];if(_0x3b49f0[_0xc99d('0x30')]['includeAll']){_0x109d7c['include']=[{'all':!![]}];}_0x109d7c=_[_0xc99d('0x3a')]({},_0x109d7c,_0x3b49f0[_0xc99d('0x45')]);return db['SquareMessage'][_0xc99d('0x46')](_0x109d7c)['then'](handleEntityNotFound(_0x2b9693,null))[_0xc99d('0x23')](respondWithResult(_0x2b9693,null))['catch'](handleError(_0x2b9693,null));};exports[_0xc99d('0x47')]=function(_0x9967e2,_0x3d4152){return db[_0xc99d('0x2b')]['create'](_0x9967e2[_0xc99d('0x48')],{})['then'](respondWithResult(_0x3d4152,0xc9))['catch'](handleError(_0x3d4152,null));};exports[_0xc99d('0x22')]=function(_0x42ae6c,_0x2ea0ed){if(_0x42ae6c[_0xc99d('0x48')]['id']){delete _0x42ae6c[_0xc99d('0x48')]['id'];}return db[_0xc99d('0x2b')]['find']({'where':{'id':_0x42ae6c[_0xc99d('0x44')]['id']}})[_0xc99d('0x23')](handleEntityNotFound(_0x2ea0ed,null))['then'](saveUpdates(_0x42ae6c[_0xc99d('0x48')],null))[_0xc99d('0x23')](respondWithResult(_0x2ea0ed,null))[_0xc99d('0x42')](handleError(_0x2ea0ed,null));};exports[_0xc99d('0x24')]=function(_0x200dc1,_0xc5d320){return db[_0xc99d('0x2b')]['find']({'where':{'id':_0x200dc1[_0xc99d('0x44')]['id']}})[_0xc99d('0x23')](handleEntityNotFound(_0xc5d320,null))['then'](removeEntity(_0xc5d320,null))['catch'](handleError(_0xc5d320,null));}; \ No newline at end of file +var _0x91bb=['key','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x91bb,0xfa));var _0xb91b=function(_0x434d68,_0xcbdfed){_0x434d68=_0x434d68-0x0;var _0x56f3ce=_0x91bb[_0x434d68];return _0x56f3ce;};'use strict';var pdf=require(_0xb91b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb91b('0x1'));var zipdir=require(_0xb91b('0x2'));var jsonpatch=require(_0xb91b('0x3'));var rp=require(_0xb91b('0x4'));var moment=require(_0xb91b('0x5'));var BPromise=require(_0xb91b('0x6'));var Mustache=require('mustache');var util=require(_0xb91b('0x7'));var path=require('path');var sox=require(_0xb91b('0x8'));var csv=require(_0xb91b('0x9'));var ejs=require(_0xb91b('0xa'));var fs=require('fs');var _=require(_0xb91b('0xb'));var squel=require(_0xb91b('0xc'));var crypto=require(_0xb91b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb91b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb91b('0xf'));var Papa=require('papaparse');var Redis=require(_0xb91b('0x10'));var authService=require(_0xb91b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb91b('0x12'));var logger=require(_0xb91b('0x13'))(_0xb91b('0x14'));var utils=require('../../config/utils');var config=require(_0xb91b('0x15'));var db=require(_0xb91b('0x16'))['db'];function respondWithStatusCode(_0x6df2b9,_0x1df68c){_0x1df68c=_0x1df68c||0xcc;return function(_0x30696b){if(_0x30696b){return _0x6df2b9[_0xb91b('0x17')](_0x1df68c);}return _0x6df2b9[_0xb91b('0x18')](_0x1df68c)[_0xb91b('0x19')]();};}function respondWithResult(_0x8562c9,_0x745817){_0x745817=_0x745817||0xc8;return function(_0x34ed82){if(_0x34ed82){return _0x8562c9[_0xb91b('0x18')](_0x745817)['json'](_0x34ed82);}};}function respondWithFilteredResult(_0x5beb55,_0x5ea573){return function(_0x48ef9e){if(_0x48ef9e){var _0x2df550=_0x48ef9e[_0xb91b('0x1a')],_0x53b32a=_0x5ea573[_0xb91b('0x1b')],_0x3c8130=_0x5ea573[_0xb91b('0x1b')]+_0x5ea573[_0xb91b('0x1c')],_0x1b909f;if(_0x3c8130>=_0x2df550){_0x3c8130=_0x2df550;_0x1b909f=0xc8;}else{_0x1b909f=0xce;}_0x5beb55[_0xb91b('0x18')](_0x1b909f);return _0x5beb55[_0xb91b('0x1d')](_0xb91b('0x1e'),_0x53b32a+'-'+_0x3c8130+'/'+_0x2df550)[_0xb91b('0x1f')](_0x48ef9e);}return null;};}function patchUpdates(_0x2d48ed){return function(_0x452181){try{jsonpatch[_0xb91b('0x20')](_0x452181,_0x2d48ed,!![]);}catch(_0x184364){return BPromise[_0xb91b('0x21')](_0x184364);}return _0x452181[_0xb91b('0x22')]();};}function saveUpdates(_0x3a59de,_0x52cc17){return function(_0x308096){if(_0x308096){return _0x308096[_0xb91b('0x23')](_0x3a59de)['then'](function(_0x3e6516){return _0x3e6516;});}return null;};}function removeEntity(_0x34a64c,_0x37d7ec){return function(_0x269102){if(_0x269102){return _0x269102[_0xb91b('0x24')]()[_0xb91b('0x25')](function(){_0x34a64c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c26f8,_0x30b7b7){return function(_0x453dcc){if(!_0x453dcc){_0x3c26f8[_0xb91b('0x17')](0x194);}return _0x453dcc;};}function handleError(_0x29fb0a,_0x131c82){_0x131c82=_0x131c82||0x1f4;return function(_0x39f484){logger[_0xb91b('0x26')](_0x39f484[_0xb91b('0x27')]);if(_0x39f484[_0xb91b('0x28')]){delete _0x39f484['name'];}_0x29fb0a[_0xb91b('0x18')](_0x131c82)[_0xb91b('0x29')](_0x39f484);};}exports['index']=function(_0x2b2f6d,_0xf426f9){var _0x522703={},_0x534973={},_0x579451={'count':0x0,'rows':[]};var _0x1056ee=_[_0xb91b('0x2a')](db[_0xb91b('0x2b')][_0xb91b('0x2c')],function(_0x43771e){return{'name':_0x43771e[_0xb91b('0x2d')],'type':_0x43771e['type'][_0xb91b('0x2e')]};});_0x534973['model']=_['map'](_0x1056ee,'name');_0x534973['query']=_[_0xb91b('0x2f')](_0x2b2f6d['query']);_0x534973[_0xb91b('0x30')]=_[_0xb91b('0x31')](_0x534973[_0xb91b('0x32')],_0x534973['query']);_0x522703[_0xb91b('0x33')]=_[_0xb91b('0x31')](_0x534973[_0xb91b('0x32')],qs['fields'](_0x2b2f6d[_0xb91b('0x34')][_0xb91b('0x35')]));_0x522703[_0xb91b('0x33')]=_0x522703[_0xb91b('0x33')][_0xb91b('0x36')]?_0x522703[_0xb91b('0x33')]:_0x534973[_0xb91b('0x32')];if(!_0x2b2f6d[_0xb91b('0x34')][_0xb91b('0x37')](_0xb91b('0x38'))){_0x522703[_0xb91b('0x1c')]=qs[_0xb91b('0x1c')](_0x2b2f6d[_0xb91b('0x34')][_0xb91b('0x1c')]);_0x522703[_0xb91b('0x1b')]=qs['offset'](_0x2b2f6d['query'][_0xb91b('0x1b')]);}_0x522703[_0xb91b('0x39')]=qs[_0xb91b('0x3a')](_0x2b2f6d[_0xb91b('0x34')][_0xb91b('0x3a')]);_0x522703[_0xb91b('0x3b')]=qs[_0xb91b('0x30')](_['pick'](_0x2b2f6d[_0xb91b('0x34')],_0x534973[_0xb91b('0x30')]));if(_0x2b2f6d['query'][_0xb91b('0x3c')]){_0x522703[_0xb91b('0x3b')]=_[_0xb91b('0x3d')](_0x522703[_0xb91b('0x3b')],{'$or':_['map'](_0x1056ee,function(_0x4e1745){if(_0x4e1745['type']!==_0xb91b('0x3e')){var _0x440a62={};_0x440a62[_0x4e1745['name']]={'$like':'%'+_0x2b2f6d[_0xb91b('0x34')][_0xb91b('0x3c')]+'%'};return _0x440a62;}})});}_0x522703=_['merge']({},_0x522703,_0x2b2f6d[_0xb91b('0x3f')]);var _0x16abc2={'where':_0x522703['where']};return db['SquareMessage'][_0xb91b('0x1a')](_0x16abc2)[_0xb91b('0x25')](function(_0x32a725){_0x579451[_0xb91b('0x1a')]=_0x32a725;if(_0x2b2f6d[_0xb91b('0x34')][_0xb91b('0x40')]){_0x522703[_0xb91b('0x41')]=[{'all':!![]}];}return db[_0xb91b('0x2b')][_0xb91b('0x42')](_0x522703);})[_0xb91b('0x25')](function(_0x391dee){_0x579451[_0xb91b('0x43')]=_0x391dee;return _0x579451;})[_0xb91b('0x25')](respondWithFilteredResult(_0xf426f9,_0x522703))[_0xb91b('0x44')](handleError(_0xf426f9,null));};exports[_0xb91b('0x45')]=function(_0x5006ba,_0x4915cd){var _0x376353={'raw':!![],'where':{'id':_0x5006ba['params']['id']}},_0x44d1bf={};_0x44d1bf[_0xb91b('0x32')]=_[_0xb91b('0x2f')](db[_0xb91b('0x2b')]['rawAttributes']);_0x44d1bf[_0xb91b('0x34')]=_['keys'](_0x5006ba[_0xb91b('0x34')]);_0x44d1bf['filters']=_[_0xb91b('0x31')](_0x44d1bf['model'],_0x44d1bf[_0xb91b('0x34')]);_0x376353[_0xb91b('0x33')]=_[_0xb91b('0x31')](_0x44d1bf[_0xb91b('0x32')],qs[_0xb91b('0x35')](_0x5006ba[_0xb91b('0x34')][_0xb91b('0x35')]));_0x376353[_0xb91b('0x33')]=_0x376353[_0xb91b('0x33')][_0xb91b('0x36')]?_0x376353['attributes']:_0x44d1bf[_0xb91b('0x32')];if(_0x5006ba[_0xb91b('0x34')][_0xb91b('0x40')]){_0x376353[_0xb91b('0x41')]=[{'all':!![]}];}_0x376353=_['merge']({},_0x376353,_0x5006ba['options']);return db[_0xb91b('0x2b')][_0xb91b('0x46')](_0x376353)[_0xb91b('0x25')](handleEntityNotFound(_0x4915cd,null))['then'](respondWithResult(_0x4915cd,null))[_0xb91b('0x44')](handleError(_0x4915cd,null));};exports[_0xb91b('0x47')]=function(_0x407a2a,_0x4d7883){return db['SquareMessage']['create'](_0x407a2a[_0xb91b('0x48')],{})[_0xb91b('0x25')](respondWithResult(_0x4d7883,0xc9))[_0xb91b('0x44')](handleError(_0x4d7883,null));};exports[_0xb91b('0x23')]=function(_0x17f406,_0x5a33c2){if(_0x17f406[_0xb91b('0x48')]['id']){delete _0x17f406[_0xb91b('0x48')]['id'];}return db[_0xb91b('0x2b')][_0xb91b('0x46')]({'where':{'id':_0x17f406[_0xb91b('0x49')]['id']}})[_0xb91b('0x25')](handleEntityNotFound(_0x5a33c2,null))[_0xb91b('0x25')](saveUpdates(_0x17f406['body'],null))[_0xb91b('0x25')](respondWithResult(_0x5a33c2,null))[_0xb91b('0x44')](handleError(_0x5a33c2,null));};exports[_0xb91b('0x24')]=function(_0x4c70bd,_0x542598){return db[_0xb91b('0x2b')][_0xb91b('0x46')]({'where':{'id':_0x4c70bd[_0xb91b('0x49')]['id']}})[_0xb91b('0x25')](handleEntityNotFound(_0x542598,null))[_0xb91b('0x25')](removeEntity(_0x542598,null))[_0xb91b('0x44')](handleError(_0x542598,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 19cc7dc..1f857e6 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 _0x1373=['request-promise','path','./squareMessage.attributes','exports','SquareMessage','square_messages','../../config/logger','api','moment','bluebird'];(function(_0x3116a0,_0x201793){var _0x41c174=function(_0x4b8496){while(--_0x4b8496){_0x3116a0['push'](_0x3116a0['shift']());}};_0x41c174(++_0x201793);}(_0x1373,0x178));var _0x3137=function(_0x212a1e,_0x8c4f97){_0x212a1e=_0x212a1e-0x0;var _0x446c25=_0x1373[_0x212a1e];return _0x446c25;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3137('0x0'))(_0x3137('0x1'));var moment=require(_0x3137('0x2'));var BPromise=require(_0x3137('0x3'));var rp=require(_0x3137('0x4'));var fs=require('fs');var path=require(_0x3137('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3137('0x6'));module[_0x3137('0x7')]=function(_0x48dc39,_0x3425e4){return _0x48dc39['define'](_0x3137('0x8'),attributes,{'tableName':_0x3137('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52c1=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','SquareMessage','square_messages','lodash','util'];(function(_0x48b66e,_0x461edb){var _0x151723=function(_0x1f1421){while(--_0x1f1421){_0x48b66e['push'](_0x48b66e['shift']());}};_0x151723(++_0x461edb);}(_0x52c1,0x169));var _0x152c=function(_0x142f5c,_0x17303e){_0x142f5c=_0x142f5c-0x0;var _0x2576ee=_0x52c1[_0x142f5c];return _0x2576ee;};'use strict';var _=require(_0x152c('0x0'));var util=require(_0x152c('0x1'));var logger=require('../../config/logger')(_0x152c('0x2'));var moment=require(_0x152c('0x3'));var BPromise=require(_0x152c('0x4'));var rp=require(_0x152c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x152c('0x6'));var config=require(_0x152c('0x7'));var attributes=require('./squareMessage.attributes');module[_0x152c('0x8')]=function(_0x3ff6aa,_0x193144){return _0x3ff6aa['define'](_0x152c('0x9'),attributes,{'tableName':_0x152c('0xa'),'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 854dd60..a7f9fc3 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 _0x27a0=['moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateSquareMessage','SquareMessage','options','raw','catch','util'];(function(_0x17c0f6,_0x218b61){var _0xce0ff4=function(_0x386fa9){while(--_0x386fa9){_0x17c0f6['push'](_0x17c0f6['shift']());}};_0xce0ff4(++_0x218b61);}(_0x27a0,0xbf));var _0x027a=function(_0x42fd32,_0x12d3ae){_0x42fd32=_0x42fd32-0x0;var _0x328b6f=_0x27a0[_0x42fd32];return _0x328b6f;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require(_0x027a('0x2'));var rs=require(_0x027a('0x3'));var fs=require('fs');var Redis=require(_0x027a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x027a('0x5'));var jayson=require(_0x027a('0x6'));var client=jayson[_0x027a('0x7')][_0x027a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe233ed,_0x3c7d67,_0x550fbb){return new BPromise(function(_0x3d1429,_0x271dfe){return client[_0x027a('0x9')](_0xe233ed,_0x550fbb)['then'](function(_0x44c56a){logger[_0x027a('0xa')](_0x027a('0xb'),_0x3c7d67,'request\x20sent');logger[_0x027a('0xc')](_0x027a('0xd'),_0x3c7d67,_0x027a('0xe'),JSON[_0x027a('0xf')](_0x44c56a));if(_0x44c56a[_0x027a('0x10')]){if(_0x44c56a[_0x027a('0x10')][_0x027a('0x11')]===0x1f4){logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x271dfe(_0x44c56a['error'][_0x027a('0x12')]);}logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x3d1429(_0x44c56a['error']['message']);}else{logger[_0x027a('0xa')]('SquareMessage,\x20%s,\x20%s',_0x3c7d67,_0x027a('0xe'));_0x3d1429(_0x44c56a['result'][_0x027a('0x12')]);}})['catch'](function(_0x4dc3ab){logger['error'](_0x027a('0xb'),_0x3c7d67,_0x4dc3ab);_0x271dfe(_0x4dc3ab);});});}exports[_0x027a('0x13')]=function(_0x826d19){var _0x1fb40b=this;return new Promise(function(_0x52125e,_0x282e70){return db[_0x027a('0x14')]['create'](_0x826d19['body'],{'raw':_0x826d19[_0x027a('0x15')]?_0x826d19['options'][_0x027a('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x59511c){logger['info']('CreateSquareMessage',_0x826d19);logger[_0x027a('0xc')](_0x027a('0x13'),_0x826d19,JSON[_0x027a('0xf')](_0x59511c));_0x52125e(_0x59511c);})[_0x027a('0x17')](function(_0x51b870){logger[_0x027a('0x10')](_0x027a('0x13'),_0x51b870[_0x027a('0x12')],_0x826d19);_0x282e70(_0x1fb40b[_0x027a('0x10')](0x1f4,_0x51b870[_0x027a('0x12')]));});});}; \ No newline at end of file +var _0x5fab=['debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent'];(function(_0x2e626b,_0x17295a){var _0xcce84d=function(_0x19560b){while(--_0x19560b){_0x2e626b['push'](_0x2e626b['shift']());}};_0xcce84d(++_0x17295a);}(_0x5fab,0x177));var _0xb5fa=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x5fab[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('SquareMessage,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('SquareMessage,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}exports[_0xb5fa('0x18')]=function(_0x32e9e5){var _0x46eef0=this;return new Promise(function(_0x324ba5,_0x13e82b){return db[_0xb5fa('0x19')][_0xb5fa('0x1a')](_0x32e9e5[_0xb5fa('0x1b')],{'raw':_0x32e9e5[_0xb5fa('0x1c')]?_0x32e9e5[_0xb5fa('0x1c')][_0xb5fa('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x432bfa){logger['info'](_0xb5fa('0x18'),_0x32e9e5);logger['debug'](_0xb5fa('0x18'),_0x32e9e5,JSON[_0xb5fa('0x11')](_0x432bfa));_0x324ba5(_0x432bfa);})['catch'](function(_0x40dfdf){logger[_0xb5fa('0x12')](_0xb5fa('0x18'),_0x40dfdf['message'],_0x32e9e5);_0x13e82b(_0x46eef0[_0xb5fa('0x12')](0x1f4,_0x40dfdf[_0xb5fa('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a6810cf..603fd2b 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 _0x5109=['update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','show','/:id/test','post','create','put','/:id'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x5109,0x17f));var _0x9510=function(_0x42c9d4,_0x217683){_0x42c9d4=_0x42c9d4-0x0;var _0x15ef9e=_0x5109[_0x42c9d4];return _0x15ef9e;};'use strict';var multer=require('multer');var util=require(_0x9510('0x0'));var path=require(_0x9510('0x1'));var timeout=require(_0x9510('0x2'));var express=require(_0x9510('0x3'));var router=express[_0x9510('0x4')]();var auth=require(_0x9510('0x5'));var interaction=require(_0x9510('0x6'));var config=require(_0x9510('0x7'));var controller=require(_0x9510('0x8'));router[_0x9510('0x9')]('/',auth[_0x9510('0xa')](),controller['index']);router[_0x9510('0x9')]('/:id',auth[_0x9510('0xa')](),controller[_0x9510('0xb')]);router[_0x9510('0x9')](_0x9510('0xc'),auth[_0x9510('0xa')](),timeout('15s'),controller['test']);router[_0x9510('0xd')]('/',auth[_0x9510('0xa')](),controller[_0x9510('0xe')]);router[_0x9510('0xf')](_0x9510('0x10'),auth[_0x9510('0xa')](),controller[_0x9510('0x11')]);router[_0x9510('0x12')](_0x9510('0x10'),auth[_0x9510('0xa')](),controller[_0x9510('0x13')]);module['exports']=router; \ No newline at end of file +var _0x55bc=['/:id/test','15s','test','put','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x55bc,0x65));var _0xc55b=function(_0x24687c,_0x106359){_0x24687c=_0x24687c-0x0;var _0xf32832=_0x55bc[_0x24687c];return _0xf32832;};'use strict';var multer=require(_0xc55b('0x0'));var util=require(_0xc55b('0x1'));var path=require(_0xc55b('0x2'));var timeout=require(_0xc55b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc55b('0x4'));var interaction=require(_0xc55b('0x5'));var config=require(_0xc55b('0x6'));var controller=require(_0xc55b('0x7'));router[_0xc55b('0x8')]('/',auth[_0xc55b('0x9')](),controller[_0xc55b('0xa')]);router[_0xc55b('0x8')](_0xc55b('0xb'),auth[_0xc55b('0x9')](),controller[_0xc55b('0xc')]);router['get'](_0xc55b('0xd'),auth['isAuthenticated'](),timeout(_0xc55b('0xe')),controller[_0xc55b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc55b('0x10')](_0xc55b('0xb'),auth[_0xc55b('0x9')](),controller['update']);router['delete'](_0xc55b('0xb'),auth[_0xc55b('0x9')](),controller[_0xc55b('0x11')]);module[_0xc55b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 938e666..32a2a9d 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 _0xca97=['sequelize','exports','STRING'];(function(_0x1a8bf8,_0x36df6c){var _0x5bc209=function(_0xa96ae5){while(--_0xa96ae5){_0x1a8bf8['push'](_0x1a8bf8['shift']());}};_0x5bc209(++_0x36df6c);}(_0xca97,0x135));var _0x7ca9=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xca97[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x7ca9('0x0'));module[_0x7ca9('0x1')]={'name':{'type':Sequelize[_0x7ca9('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7ca9('0x2')]}}; \ No newline at end of file +var _0x8152=['sequelize','exports','STRING'];(function(_0x3c8de5,_0x2f1fb5){var _0x4fd9ce=function(_0x20368b){while(--_0x20368b){_0x3c8de5['push'](_0x3c8de5['shift']());}};_0x4fd9ce(++_0x2f1fb5);}(_0x8152,0x15f));var _0x2815=function(_0x374707,_0x3cb2db){_0x374707=_0x374707-0x0;var _0x36385f=_0x8152[_0x374707];return _0x36385f;};'use strict';var Sequelize=require(_0x2815('0x0'));module[_0x2815('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x2815('0x2')]},'description':{'type':Sequelize[_0x2815('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 09033ba..ef1cfd6 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 _0x4cc4=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','then','error','stack','name','index','map','SquareOdbc','type','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','catch','show','params','rawAttributes','intersection','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ODBC','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','dsn','closeSync','html-pdf','eml-format'];(function(_0x5668ca,_0x133142){var _0x588c9d=function(_0x54f32f){while(--_0x54f32f){_0x5668ca['push'](_0x5668ca['shift']());}};_0x588c9d(++_0x133142);}(_0x4cc4,0x152));var _0x44cc=function(_0x3fb393,_0x35d75e){_0x3fb393=_0x3fb393-0x0;var _0xd3d861=_0x4cc4[_0x3fb393];return _0xd3d861;};'use strict';var pdf=require(_0x44cc('0x0'));var emlformat=require(_0x44cc('0x1'));var rimraf=require(_0x44cc('0x2'));var zipdir=require(_0x44cc('0x3'));var jsonpatch=require(_0x44cc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44cc('0x5'));var Mustache=require(_0x44cc('0x6'));var util=require(_0x44cc('0x7'));var path=require(_0x44cc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x44cc('0x9'));var squel=require(_0x44cc('0xa'));var crypto=require(_0x44cc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x44cc('0xc'));var toCsv=require(_0x44cc('0xd'));var querystring=require(_0x44cc('0xe'));var Papa=require(_0x44cc('0xf'));var Redis=require(_0x44cc('0x10'));var authService=require(_0x44cc('0x11'));var qs=require(_0x44cc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x44cc('0x13'))(_0x44cc('0x14'));var utils=require(_0x44cc('0x15'));var config=require(_0x44cc('0x16'));var db=require(_0x44cc('0x17'))['db'];function respondWithStatusCode(_0x23c059,_0x1367e8){_0x1367e8=_0x1367e8||0xcc;return function(_0x25eee0){if(_0x25eee0){return _0x23c059[_0x44cc('0x18')](_0x1367e8);}return _0x23c059[_0x44cc('0x19')](_0x1367e8)[_0x44cc('0x1a')]();};}function respondWithResult(_0x305190,_0x576cc5){_0x576cc5=_0x576cc5||0xc8;return function(_0x50fe21){if(_0x50fe21){return _0x305190[_0x44cc('0x19')](_0x576cc5)['json'](_0x50fe21);}};}function respondWithFilteredResult(_0x3cd2d6,_0x12ffe2){return function(_0x5615fd){if(_0x5615fd){var _0x34030a=_0x5615fd['count'],_0xf53b62=_0x12ffe2[_0x44cc('0x1b')],_0x345806=_0x12ffe2['offset']+_0x12ffe2[_0x44cc('0x1c')],_0x442408;if(_0x345806>=_0x34030a){_0x345806=_0x34030a;_0x442408=0xc8;}else{_0x442408=0xce;}_0x3cd2d6[_0x44cc('0x19')](_0x442408);return _0x3cd2d6[_0x44cc('0x1d')](_0x44cc('0x1e'),_0xf53b62+'-'+_0x345806+'/'+_0x34030a)[_0x44cc('0x1f')](_0x5615fd);}return null;};}function patchUpdates(_0xa8d315){return function(_0x1bc949){try{jsonpatch[_0x44cc('0x20')](_0x1bc949,_0xa8d315,!![]);}catch(_0x25d9ec){return BPromise[_0x44cc('0x21')](_0x25d9ec);}return _0x1bc949[_0x44cc('0x22')]();};}function saveUpdates(_0x49466b,_0x4dd70f){return function(_0x5d436d){if(_0x5d436d){return _0x5d436d[_0x44cc('0x23')](_0x49466b)['then'](function(_0x3d8d77){return _0x3d8d77;});}return null;};}function removeEntity(_0x1ff128,_0x15ee0c){return function(_0x2a7514){if(_0x2a7514){return _0x2a7514[_0x44cc('0x24')]()['then'](function(){var _0x44aa43=_0x2a7514[_0x44cc('0x25')]({'plain':!![]});var _0x147853='ODBC';return db[_0x44cc('0x26')][_0x44cc('0x24')]({'where':{'type':_0x147853,'resourceId':_0x44aa43['id']}})[_0x44cc('0x27')](function(){return _0x2a7514;});})['then'](function(){_0x1ff128[_0x44cc('0x19')](0xcc)[_0x44cc('0x1a')]();});}};}function handleEntityNotFound(_0x545db8,_0x1c22b7){return function(_0x45ea8e){if(!_0x45ea8e){_0x545db8[_0x44cc('0x18')](0x194);}return _0x45ea8e;};}function handleError(_0x3aebf0,_0x208187){_0x208187=_0x208187||0x1f4;return function(_0x5116bf){logger[_0x44cc('0x28')](_0x5116bf[_0x44cc('0x29')]);if(_0x5116bf['name']){delete _0x5116bf[_0x44cc('0x2a')];}_0x3aebf0[_0x44cc('0x19')](_0x208187)['send'](_0x5116bf);};}exports[_0x44cc('0x2b')]=function(_0x1a3368,_0x48f141){var _0x11daab={},_0x4201f0={},_0x7cf353={'count':0x0,'rows':[]};var _0x646f3f=_[_0x44cc('0x2c')](db[_0x44cc('0x2d')]['rawAttributes'],function(_0x4dce56){return{'name':_0x4dce56['fieldName'],'type':_0x4dce56[_0x44cc('0x2e')][_0x44cc('0x2f')]};});_0x4201f0[_0x44cc('0x30')]=_[_0x44cc('0x2c')](_0x646f3f,_0x44cc('0x2a'));_0x4201f0[_0x44cc('0x31')]=_[_0x44cc('0x32')](_0x1a3368[_0x44cc('0x31')]);_0x4201f0[_0x44cc('0x33')]=_['intersection'](_0x4201f0[_0x44cc('0x30')],_0x4201f0[_0x44cc('0x31')]);_0x11daab[_0x44cc('0x34')]=_['intersection'](_0x4201f0[_0x44cc('0x30')],qs[_0x44cc('0x35')](_0x1a3368['query']['fields']));_0x11daab[_0x44cc('0x34')]=_0x11daab[_0x44cc('0x34')]['length']?_0x11daab[_0x44cc('0x34')]:_0x4201f0[_0x44cc('0x30')];if(!_0x1a3368[_0x44cc('0x31')]['hasOwnProperty'](_0x44cc('0x36'))){_0x11daab[_0x44cc('0x1c')]=qs[_0x44cc('0x1c')](_0x1a3368[_0x44cc('0x31')][_0x44cc('0x1c')]);_0x11daab['offset']=qs[_0x44cc('0x1b')](_0x1a3368['query'][_0x44cc('0x1b')]);}_0x11daab[_0x44cc('0x37')]=qs[_0x44cc('0x38')](_0x1a3368[_0x44cc('0x31')]['sort']);_0x11daab[_0x44cc('0x39')]=qs['filters'](_['pick'](_0x1a3368[_0x44cc('0x31')],_0x4201f0[_0x44cc('0x33')]));if(_0x1a3368[_0x44cc('0x31')][_0x44cc('0x3a')]){_0x11daab[_0x44cc('0x39')]=_[_0x44cc('0x3b')](_0x11daab[_0x44cc('0x39')],{'$or':_['map'](_0x646f3f,function(_0x3fb0ca){if(_0x3fb0ca[_0x44cc('0x2e')]!==_0x44cc('0x3c')){var _0x544d28={};_0x544d28[_0x3fb0ca['name']]={'$like':'%'+_0x1a3368[_0x44cc('0x31')][_0x44cc('0x3a')]+'%'};return _0x544d28;}})});}_0x11daab=_['merge']({},_0x11daab,_0x1a3368[_0x44cc('0x3d')]);var _0x2f4474={'where':_0x11daab[_0x44cc('0x39')]};return db[_0x44cc('0x2d')][_0x44cc('0x3e')](_0x2f4474)[_0x44cc('0x27')](function(_0x58fb36){_0x7cf353[_0x44cc('0x3e')]=_0x58fb36;if(_0x1a3368['query'][_0x44cc('0x3f')]){_0x11daab['include']=[{'all':!![]}];}return db[_0x44cc('0x2d')][_0x44cc('0x40')](_0x11daab);})['then'](function(_0x3c48f5){_0x7cf353['rows']=_0x3c48f5;return _0x7cf353;})[_0x44cc('0x27')](respondWithFilteredResult(_0x48f141,_0x11daab))[_0x44cc('0x41')](handleError(_0x48f141,null));};exports[_0x44cc('0x42')]=function(_0x33032b,_0x3c524c){var _0x2c41bb={'raw':!![],'where':{'id':_0x33032b[_0x44cc('0x43')]['id']}},_0x264bc0={};_0x264bc0['model']=_[_0x44cc('0x32')](db[_0x44cc('0x2d')][_0x44cc('0x44')]);_0x264bc0[_0x44cc('0x31')]=_[_0x44cc('0x32')](_0x33032b[_0x44cc('0x31')]);_0x264bc0[_0x44cc('0x33')]=_[_0x44cc('0x45')](_0x264bc0['model'],_0x264bc0[_0x44cc('0x31')]);_0x2c41bb[_0x44cc('0x34')]=_[_0x44cc('0x45')](_0x264bc0['model'],qs[_0x44cc('0x35')](_0x33032b[_0x44cc('0x31')][_0x44cc('0x35')]));_0x2c41bb[_0x44cc('0x34')]=_0x2c41bb[_0x44cc('0x34')][_0x44cc('0x46')]?_0x2c41bb[_0x44cc('0x34')]:_0x264bc0[_0x44cc('0x30')];if(_0x33032b[_0x44cc('0x31')]['includeAll']){_0x2c41bb[_0x44cc('0x47')]=[{'all':!![]}];}_0x2c41bb=_[_0x44cc('0x3b')]({},_0x2c41bb,_0x33032b[_0x44cc('0x3d')]);return db[_0x44cc('0x2d')][_0x44cc('0x48')](_0x2c41bb)[_0x44cc('0x27')](handleEntityNotFound(_0x3c524c,null))['then'](respondWithResult(_0x3c524c,null))[_0x44cc('0x41')](handleError(_0x3c524c,null));};exports['create']=function(_0x8cbb21,_0x3417dc){return db['SquareOdbc'][_0x44cc('0x49')](_0x8cbb21[_0x44cc('0x4a')],{})[_0x44cc('0x27')](function(_0x345af8){var _0x30f222=_0x8cbb21['user'][_0x44cc('0x25')]({'plain':!![]});if(!_0x30f222)throw new Error(_0x44cc('0x4b'));if(_0x30f222['role']===_0x44cc('0x4c')){var _0x43acec=_0x345af8[_0x44cc('0x25')]({'plain':!![]});var _0x41ee1d=_0x44cc('0x4d');return db['UserProfileSection'][_0x44cc('0x48')]({'where':{'name':_0x41ee1d,'userProfileId':_0x30f222[_0x44cc('0x4e')]},'raw':!![]})['then'](function(_0x3de5d1){if(_0x3de5d1&&_0x3de5d1[_0x44cc('0x4f')]===0x0){return db[_0x44cc('0x26')][_0x44cc('0x49')]({'name':_0x43acec[_0x44cc('0x2a')],'resourceId':_0x43acec['id'],'type':_0x3de5d1[_0x44cc('0x2a')],'sectionId':_0x3de5d1['id']},{})[_0x44cc('0x27')](function(){return _0x345af8;});}else{return _0x345af8;}})['catch'](function(_0x1c5262){logger['error'](_0x44cc('0x50'),_0x1c5262);throw _0x1c5262;});}return _0x345af8;})['then'](respondWithResult(_0x3417dc,0xc9))[_0x44cc('0x41')](handleError(_0x3417dc,null));};exports['update']=function(_0x5f180e,_0x2e3fdf){if(_0x5f180e[_0x44cc('0x4a')]['id']){delete _0x5f180e[_0x44cc('0x4a')]['id'];}return db[_0x44cc('0x2d')][_0x44cc('0x48')]({'where':{'id':_0x5f180e[_0x44cc('0x43')]['id']}})[_0x44cc('0x27')](handleEntityNotFound(_0x2e3fdf,null))[_0x44cc('0x27')](saveUpdates(_0x5f180e[_0x44cc('0x4a')],null))[_0x44cc('0x27')](respondWithResult(_0x2e3fdf,null))[_0x44cc('0x41')](handleError(_0x2e3fdf,null));};exports['destroy']=function(_0x31e643,_0x546707){return db['SquareOdbc'][_0x44cc('0x48')]({'where':{'id':_0x31e643[_0x44cc('0x43')]['id']}})[_0x44cc('0x27')](handleEntityNotFound(_0x546707,null))['then'](removeEntity(_0x546707,null))[_0x44cc('0x41')](handleError(_0x546707,null));};exports[_0x44cc('0x51')]=function(_0x12ed68,_0x191551,_0x366164){var _0x3fd89b;return db[_0x44cc('0x2d')]['find']({'where':{'id':_0x12ed68[_0x44cc('0x43')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x191551,null))[_0x44cc('0x27')](function(_0x36c75d){if(_0x36c75d){var _0x5b3000=require(_0x44cc('0x52'))();_0x5b3000['openSync'](_0x36c75d[_0x44cc('0x53')]);_0x5b3000[_0x44cc('0x54')]();return _0x36c75d;}})[_0x44cc('0x27')](respondWithResult(_0x191551,null))[_0x44cc('0x41')](handleError(_0x191551,null));}; \ No newline at end of file +var _0x9c49=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','ODBC','UserProfileResource','error','stack','send','index','map','SquareOdbc','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9c49,0x1b1));var _0x99c4=function(_0x4275dd,_0x25d8c6){_0x4275dd=_0x4275dd-0x0;var _0x401207=_0x9c49[_0x4275dd];return _0x401207;};'use strict';var pdf=require(_0x99c4('0x0'));var emlformat=require(_0x99c4('0x1'));var rimraf=require(_0x99c4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x99c4('0x3'));var moment=require(_0x99c4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x99c4('0x5'));var path=require(_0x99c4('0x6'));var sox=require(_0x99c4('0x7'));var csv=require('to-csv');var ejs=require(_0x99c4('0x8'));var fs=require('fs');var _=require(_0x99c4('0x9'));var squel=require(_0x99c4('0xa'));var crypto=require('crypto');var jsforce=require(_0x99c4('0xb'));var deskjs=require(_0x99c4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x99c4('0xd'));var Papa=require(_0x99c4('0xe'));var Redis=require(_0x99c4('0xf'));var authService=require(_0x99c4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x99c4('0x11'));var hardwareService=require(_0x99c4('0x12'));var logger=require('../../config/logger')(_0x99c4('0x13'));var utils=require(_0x99c4('0x14'));var config=require(_0x99c4('0x15'));var db=require(_0x99c4('0x16'))['db'];function respondWithStatusCode(_0x1a4309,_0x364dd5){_0x364dd5=_0x364dd5||0xcc;return function(_0x3b0778){if(_0x3b0778){return _0x1a4309['sendStatus'](_0x364dd5);}return _0x1a4309['status'](_0x364dd5)[_0x99c4('0x17')]();};}function respondWithResult(_0x5233a7,_0x298c47){_0x298c47=_0x298c47||0xc8;return function(_0x371ac2){if(_0x371ac2){return _0x5233a7['status'](_0x298c47)[_0x99c4('0x18')](_0x371ac2);}};}function respondWithFilteredResult(_0x560fce,_0x2e85af){return function(_0xa2d7bd){if(_0xa2d7bd){var _0x4269c0=_0xa2d7bd[_0x99c4('0x19')],_0x327565=_0x2e85af[_0x99c4('0x1a')],_0x231a76=_0x2e85af['offset']+_0x2e85af[_0x99c4('0x1b')],_0x513de4;if(_0x231a76>=_0x4269c0){_0x231a76=_0x4269c0;_0x513de4=0xc8;}else{_0x513de4=0xce;}_0x560fce[_0x99c4('0x1c')](_0x513de4);return _0x560fce[_0x99c4('0x1d')](_0x99c4('0x1e'),_0x327565+'-'+_0x231a76+'/'+_0x4269c0)[_0x99c4('0x18')](_0xa2d7bd);}return null;};}function patchUpdates(_0x39efad){return function(_0x404aca){try{jsonpatch['apply'](_0x404aca,_0x39efad,!![]);}catch(_0x1020af){return BPromise[_0x99c4('0x1f')](_0x1020af);}return _0x404aca[_0x99c4('0x20')]();};}function saveUpdates(_0x58e025,_0x3f2001){return function(_0x4c22d7){if(_0x4c22d7){return _0x4c22d7[_0x99c4('0x21')](_0x58e025)[_0x99c4('0x22')](function(_0x1d196b){return _0x1d196b;});}return null;};}function removeEntity(_0x3bf0ae,_0x50237c){return function(_0xbaa780){if(_0xbaa780){return _0xbaa780[_0x99c4('0x23')]()[_0x99c4('0x22')](function(){var _0x581530=_0xbaa780['get']({'plain':!![]});var _0x47eefa=_0x99c4('0x24');return db[_0x99c4('0x25')][_0x99c4('0x23')]({'where':{'type':_0x47eefa,'resourceId':_0x581530['id']}})[_0x99c4('0x22')](function(){return _0xbaa780;});})[_0x99c4('0x22')](function(){_0x3bf0ae[_0x99c4('0x1c')](0xcc)[_0x99c4('0x17')]();});}};}function handleEntityNotFound(_0x2ef9c4,_0x209212){return function(_0x147610){if(!_0x147610){_0x2ef9c4['sendStatus'](0x194);}return _0x147610;};}function handleError(_0x50b30a,_0x3ef3c4){_0x3ef3c4=_0x3ef3c4||0x1f4;return function(_0xcb69c5){logger[_0x99c4('0x26')](_0xcb69c5[_0x99c4('0x27')]);if(_0xcb69c5['name']){delete _0xcb69c5['name'];}_0x50b30a[_0x99c4('0x1c')](_0x3ef3c4)[_0x99c4('0x28')](_0xcb69c5);};}exports[_0x99c4('0x29')]=function(_0x4bccf5,_0x2c0246){var _0x5f2833={},_0x54b2e2={},_0x139c28={'count':0x0,'rows':[]};var _0x872bbe=_[_0x99c4('0x2a')](db[_0x99c4('0x2b')][_0x99c4('0x2c')],function(_0x244556){return{'name':_0x244556['fieldName'],'type':_0x244556[_0x99c4('0x2d')][_0x99c4('0x2e')]};});_0x54b2e2[_0x99c4('0x2f')]=_[_0x99c4('0x2a')](_0x872bbe,_0x99c4('0x30'));_0x54b2e2[_0x99c4('0x31')]=_[_0x99c4('0x32')](_0x4bccf5[_0x99c4('0x31')]);_0x54b2e2[_0x99c4('0x33')]=_['intersection'](_0x54b2e2[_0x99c4('0x2f')],_0x54b2e2[_0x99c4('0x31')]);_0x5f2833[_0x99c4('0x34')]=_[_0x99c4('0x35')](_0x54b2e2['model'],qs[_0x99c4('0x36')](_0x4bccf5[_0x99c4('0x31')]['fields']));_0x5f2833[_0x99c4('0x34')]=_0x5f2833[_0x99c4('0x34')][_0x99c4('0x37')]?_0x5f2833['attributes']:_0x54b2e2[_0x99c4('0x2f')];if(!_0x4bccf5[_0x99c4('0x31')][_0x99c4('0x38')](_0x99c4('0x39'))){_0x5f2833[_0x99c4('0x1b')]=qs[_0x99c4('0x1b')](_0x4bccf5[_0x99c4('0x31')]['limit']);_0x5f2833[_0x99c4('0x1a')]=qs[_0x99c4('0x1a')](_0x4bccf5[_0x99c4('0x31')][_0x99c4('0x1a')]);}_0x5f2833[_0x99c4('0x3a')]=qs[_0x99c4('0x3b')](_0x4bccf5['query']['sort']);_0x5f2833[_0x99c4('0x3c')]=qs[_0x99c4('0x33')](_['pick'](_0x4bccf5[_0x99c4('0x31')],_0x54b2e2[_0x99c4('0x33')]));if(_0x4bccf5[_0x99c4('0x31')][_0x99c4('0x3d')]){_0x5f2833[_0x99c4('0x3c')]=_['merge'](_0x5f2833[_0x99c4('0x3c')],{'$or':_[_0x99c4('0x2a')](_0x872bbe,function(_0x4e19c1){if(_0x4e19c1[_0x99c4('0x2d')]!==_0x99c4('0x3e')){var _0x52c5b6={};_0x52c5b6[_0x4e19c1[_0x99c4('0x30')]]={'$like':'%'+_0x4bccf5[_0x99c4('0x31')][_0x99c4('0x3d')]+'%'};return _0x52c5b6;}})});}_0x5f2833=_[_0x99c4('0x3f')]({},_0x5f2833,_0x4bccf5[_0x99c4('0x40')]);var _0x462501={'where':_0x5f2833[_0x99c4('0x3c')]};return db['SquareOdbc'][_0x99c4('0x19')](_0x462501)[_0x99c4('0x22')](function(_0x4fd028){_0x139c28['count']=_0x4fd028;if(_0x4bccf5['query'][_0x99c4('0x41')]){_0x5f2833[_0x99c4('0x42')]=[{'all':!![]}];}return db[_0x99c4('0x2b')]['findAll'](_0x5f2833);})['then'](function(_0x5da3d6){_0x139c28[_0x99c4('0x43')]=_0x5da3d6;return _0x139c28;})['then'](respondWithFilteredResult(_0x2c0246,_0x5f2833))[_0x99c4('0x44')](handleError(_0x2c0246,null));};exports['show']=function(_0x24888b,_0x173792){var _0x1d2c41={'raw':!![],'where':{'id':_0x24888b[_0x99c4('0x45')]['id']}},_0x2abe7a={};_0x2abe7a[_0x99c4('0x2f')]=_['keys'](db['SquareOdbc'][_0x99c4('0x2c')]);_0x2abe7a[_0x99c4('0x31')]=_[_0x99c4('0x32')](_0x24888b[_0x99c4('0x31')]);_0x2abe7a[_0x99c4('0x33')]=_[_0x99c4('0x35')](_0x2abe7a[_0x99c4('0x2f')],_0x2abe7a[_0x99c4('0x31')]);_0x1d2c41[_0x99c4('0x34')]=_[_0x99c4('0x35')](_0x2abe7a['model'],qs[_0x99c4('0x36')](_0x24888b[_0x99c4('0x31')]['fields']));_0x1d2c41['attributes']=_0x1d2c41[_0x99c4('0x34')][_0x99c4('0x37')]?_0x1d2c41[_0x99c4('0x34')]:_0x2abe7a[_0x99c4('0x2f')];if(_0x24888b['query'][_0x99c4('0x41')]){_0x1d2c41[_0x99c4('0x42')]=[{'all':!![]}];}_0x1d2c41=_[_0x99c4('0x3f')]({},_0x1d2c41,_0x24888b['options']);return db[_0x99c4('0x2b')][_0x99c4('0x46')](_0x1d2c41)[_0x99c4('0x22')](handleEntityNotFound(_0x173792,null))[_0x99c4('0x22')](respondWithResult(_0x173792,null))['catch'](handleError(_0x173792,null));};exports['create']=function(_0x202800,_0xfc2c50){return db[_0x99c4('0x2b')][_0x99c4('0x47')](_0x202800['body'],{})[_0x99c4('0x22')](function(_0x522731){var _0x3f727c=_0x202800[_0x99c4('0x48')]['get']({'plain':!![]});if(!_0x3f727c)throw new Error(_0x99c4('0x49'));if(_0x3f727c[_0x99c4('0x4a')]===_0x99c4('0x48')){var _0x895ee0=_0x522731['get']({'plain':!![]});var _0x3fcffe=_0x99c4('0x24');return db[_0x99c4('0x4b')][_0x99c4('0x46')]({'where':{'name':_0x3fcffe,'userProfileId':_0x3f727c['userProfileId']},'raw':!![]})[_0x99c4('0x22')](function(_0x24ee01){if(_0x24ee01&&_0x24ee01[_0x99c4('0x4c')]===0x0){return db[_0x99c4('0x25')][_0x99c4('0x47')]({'name':_0x895ee0[_0x99c4('0x30')],'resourceId':_0x895ee0['id'],'type':_0x24ee01['name'],'sectionId':_0x24ee01['id']},{})['then'](function(){return _0x522731;});}else{return _0x522731;}})[_0x99c4('0x44')](function(_0x1c9bf6){logger['error'](_0x99c4('0x4d'),_0x1c9bf6);throw _0x1c9bf6;});}return _0x522731;})[_0x99c4('0x22')](respondWithResult(_0xfc2c50,0xc9))['catch'](handleError(_0xfc2c50,null));};exports[_0x99c4('0x21')]=function(_0x3ea44a,_0x4ab73e){if(_0x3ea44a[_0x99c4('0x4e')]['id']){delete _0x3ea44a[_0x99c4('0x4e')]['id'];}return db[_0x99c4('0x2b')][_0x99c4('0x46')]({'where':{'id':_0x3ea44a[_0x99c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ab73e,null))[_0x99c4('0x22')](saveUpdates(_0x3ea44a['body'],null))[_0x99c4('0x22')](respondWithResult(_0x4ab73e,null))[_0x99c4('0x44')](handleError(_0x4ab73e,null));};exports[_0x99c4('0x23')]=function(_0x7d4cc6,_0x22ef1c){return db['SquareOdbc'][_0x99c4('0x46')]({'where':{'id':_0x7d4cc6['params']['id']}})[_0x99c4('0x22')](handleEntityNotFound(_0x22ef1c,null))[_0x99c4('0x22')](removeEntity(_0x22ef1c,null))[_0x99c4('0x44')](handleError(_0x22ef1c,null));};exports[_0x99c4('0x4f')]=function(_0x2d517d,_0x27eb79,_0x7300ab){var _0x28db9a;return db[_0x99c4('0x2b')][_0x99c4('0x46')]({'where':{'id':_0x2d517d['params']['id']},'attributes':['id',_0x99c4('0x50')]})[_0x99c4('0x22')](handleEntityNotFound(_0x27eb79,null))['then'](function(_0x206114){if(_0x206114){var _0x5ca598=require(_0x99c4('0x51'))();_0x5ca598[_0x99c4('0x52')](_0x206114[_0x99c4('0x50')]);_0x5ca598[_0x99c4('0x53')]();return _0x206114;}})[_0x99c4('0x22')](respondWithResult(_0x27eb79,null))['catch'](handleError(_0x27eb79,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index e1d44af..81e215d 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 _0x784f=['exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x1fd456,_0x3b5d5f){var _0x599648=function(_0x1f8a70){while(--_0x1f8a70){_0x1fd456['push'](_0x1fd456['shift']());}};_0x599648(++_0x3b5d5f);}(_0x784f,0x1c0));var _0xf784=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x784f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf784('0x0'));var util=require(_0xf784('0x1'));var logger=require(_0xf784('0x2'))(_0xf784('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf784('0x4'));var fs=require('fs');var path=require(_0xf784('0x5'));var rimraf=require(_0xf784('0x6'));var config=require(_0xf784('0x7'));var attributes=require('./squareOdbc.attributes');module[_0xf784('0x8')]=function(_0x19a2a2,_0x2c4535){return _0x19a2a2[_0xf784('0x9')](_0xf784('0xa'),attributes,{'tableName':_0xf784('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3d4=['api','bluebird','request-promise','rimraf','./squareOdbc.attributes','exports','define','square_odbc','util','../../config/logger'];(function(_0xcd5b3b,_0x3af894){var _0x1f112f=function(_0x4cce63){while(--_0x4cce63){_0xcd5b3b['push'](_0xcd5b3b['shift']());}};_0x1f112f(++_0x3af894);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x55fe01,_0x12ed37){_0x55fe01=_0x55fe01-0x0;var _0x5b42f0=_0xe3d4[_0x55fe01];return _0x5b42f0;};'use strict';var _=require('lodash');var util=require(_0x4e3d('0x0'));var logger=require(_0x4e3d('0x1'))(_0x4e3d('0x2'));var moment=require('moment');var BPromise=require(_0x4e3d('0x3'));var rp=require(_0x4e3d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e3d('0x5'));var config=require('../../config/environment');var attributes=require(_0x4e3d('0x6'));module[_0x4e3d('0x7')]=function(_0x4fd5ff,_0x3eaf60){return _0x4fd5ff[_0x4e3d('0x8')]('SquareOdbc',attributes,{'tableName':_0x4e3d('0x9'),'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 c38944f..d52587a 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x5dc45d,_0x55f90f){var _0x4ce697=function(_0x4e6e21){while(--_0x4e6e21){_0x5dc45d['push'](_0x5dc45d['shift']());}};_0x4ce697(++_0x55f90f);}(_0xe14b,0x93));var _0xbe14=function(_0x39a03b,_0x5598f1){_0x39a03b=_0x39a03b-0x0;var _0x227c49=_0xe14b[_0x39a03b];return _0x227c49;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x2b9509,_0x1ff672){var _0x1f680d=function(_0x2e2a66){while(--_0x2e2a66){_0x2b9509['push'](_0x2b9509['shift']());}};_0x1f680d(++_0x1ff672);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f846f26..e189309 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 _0x236c=['show','getUsers','create','post','/:id/users','put','/:id','update','delete','removeUsers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0x11273e,_0x3821a6){var _0x1e8616=function(_0x439d86){while(--_0x439d86){_0x11273e['push'](_0x11273e['shift']());}};_0x1e8616(++_0x3821a6);}(_0x236c,0x155));var _0xc236=function(_0x3240c5,_0x2a5753){_0x3240c5=_0x3240c5-0x0;var _0xb81b86=_0x236c[_0x3240c5];return _0xb81b86;};'use strict';var multer=require(_0xc236('0x0'));var util=require('util');var path=require(_0xc236('0x1'));var timeout=require(_0xc236('0x2'));var express=require(_0xc236('0x3'));var router=express[_0xc236('0x4')]();var auth=require(_0xc236('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc236('0x6'));var controller=require(_0xc236('0x7'));router[_0xc236('0x8')]('/',auth[_0xc236('0x9')](),controller[_0xc236('0xa')]);router[_0xc236('0x8')]('/:id',auth[_0xc236('0x9')](),controller[_0xc236('0xb')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xc236('0xc')]);router['post']('/',auth[_0xc236('0x9')](),controller[_0xc236('0xd')]);router[_0xc236('0xe')](_0xc236('0xf'),auth[_0xc236('0x9')](),controller['addUsers']);router[_0xc236('0x10')](_0xc236('0x11'),auth['isAuthenticated'](),controller[_0xc236('0x12')]);router[_0xc236('0x13')]('/:id',auth[_0xc236('0x9')](),controller['destroy']);router['delete'](_0xc236('0xf'),auth[_0xc236('0x9')](),controller[_0xc236('0x14')]);module[_0xc236('0x15')]=router; \ No newline at end of file +var _0x1eba=['isAuthenticated','index','/:id','show','/:id/users','getUsers','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x1972f4,_0x3ff9f9){var _0x2689d8=function(_0x125299){while(--_0x125299){_0x1972f4['push'](_0x1972f4['shift']());}};_0x2689d8(++_0x3ff9f9);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0x1eba[_0x56b138];return _0x3df878;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa1eb('0x5'));var config=require(_0xa1eb('0x6'));var controller=require(_0xa1eb('0x7'));router[_0xa1eb('0x8')]('/',auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xa')]);router[_0xa1eb('0x8')](_0xa1eb('0xb'),auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xc')]);router[_0xa1eb('0x8')](_0xa1eb('0xd'),auth['isAuthenticated'](),controller[_0xa1eb('0xe')]);router['post']('/',auth[_0xa1eb('0x9')](),controller['create']);router[_0xa1eb('0xf')]('/:id/users',auth[_0xa1eb('0x9')](),controller['addUsers']);router[_0xa1eb('0x10')](_0xa1eb('0xb'),auth[_0xa1eb('0x9')](),controller['update']);router[_0xa1eb('0x11')](_0xa1eb('0xb'),auth['isAuthenticated'](),controller[_0xa1eb('0x12')]);router['delete']('/:id/users',auth[_0xa1eb('0x9')](),controller['removeUsers']);module[_0xa1eb('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 73f8456..f3e8a5d 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 _0x37ef=['exports','STRING','TEXT','preproduction','getDataValue','toString','utf8','BLOB','long','production','sequelize'];(function(_0x5e9883,_0x4b556c){var _0x4d25af=function(_0x1725d4){while(--_0x1725d4){_0x5e9883['push'](_0x5e9883['shift']());}};_0x4d25af(++_0x4b556c);}(_0x37ef,0xfc));var _0xf37e=function(_0x371bcc,_0x383b29){_0x371bcc=_0x371bcc-0x0;var _0x353553=_0x37ef[_0x371bcc];return _0x353553;};'use strict';var Sequelize=require(_0xf37e('0x0'));module[_0xf37e('0x1')]={'name':{'type':Sequelize[_0xf37e('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf37e('0x2')]},'notes':{'type':Sequelize[_0xf37e('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue'](_0xf37e('0x4'))){return this[_0xf37e('0x5')]('preproduction')[_0xf37e('0x6')](_0xf37e('0x7'));}}},'production':{'type':Sequelize[_0xf37e('0x8')](_0xf37e('0x9')),'get':function(){if(this[_0xf37e('0x5')](_0xf37e('0xa'))){return this['getDataValue']('production')[_0xf37e('0x6')](_0xf37e('0x7'));}}}}; \ No newline at end of file +var _0x1abc=['getDataValue','preproduction','toString','production','utf8','sequelize','name','STRING','BLOB','long'];(function(_0x5e009a,_0x12da94){var _0x4f00a1=function(_0x28c370){while(--_0x28c370){_0x5e009a['push'](_0x5e009a['shift']());}};_0x4f00a1(++_0x12da94);}(_0x1abc,0x1bd));var _0xc1ab=function(_0x54214a,_0x16b6dd){_0x54214a=_0x54214a-0x0;var _0x1fea42=_0x1abc[_0x54214a];return _0x1fea42;};'use strict';var Sequelize=require(_0xc1ab('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc1ab('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xc1ab('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xc1ab('0x3')](_0xc1ab('0x4')),'get':function(){if(this[_0xc1ab('0x5')](_0xc1ab('0x6'))){return this[_0xc1ab('0x5')](_0xc1ab('0x6'))[_0xc1ab('0x7')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xc1ab('0x4')),'get':function(){if(this['getDataValue'](_0xc1ab('0x8'))){return this['getDataValue']('production')[_0xc1ab('0x7')](_0xc1ab('0x9'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c9fb9c5..0c6e312 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 _0xca66=['fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','SquareProject','rows','catch','show','params','includeAll','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','sort','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./squareProject.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','SquareProjects','UserProfileResource','then','sendStatus','name','send','index','map','rawAttributes'];(function(_0x3eba00,_0x4a6745){var _0x2f6411=function(_0x17b820){while(--_0x17b820){_0x3eba00['push'](_0x3eba00['shift']());}};_0x2f6411(++_0x4a6745);}(_0xca66,0x8b));var _0x6ca6=function(_0x455547,_0x3f7a23){_0x455547=_0x455547-0x0;var _0x2767ea=_0xca66[_0x455547];return _0x2767ea;};'use strict';var pdf=require(_0x6ca6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ca6('0x1'));var jsonpatch=require(_0x6ca6('0x2'));var rp=require(_0x6ca6('0x3'));var moment=require('moment');var BPromise=require(_0x6ca6('0x4'));var Mustache=require('mustache');var util=require(_0x6ca6('0x5'));var path=require('path');var sox=require(_0x6ca6('0x6'));var csv=require(_0x6ca6('0x7'));var ejs=require(_0x6ca6('0x8'));var fs=require('fs');var _=require(_0x6ca6('0x9'));var squel=require(_0x6ca6('0xa'));var crypto=require(_0x6ca6('0xb'));var jsforce=require(_0x6ca6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6ca6('0x7'));var querystring=require(_0x6ca6('0xd'));var Papa=require(_0x6ca6('0xe'));var Redis=require(_0x6ca6('0xf'));var authService=require(_0x6ca6('0x10'));var qs=require(_0x6ca6('0x11'));var as=require(_0x6ca6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ca6('0x13'))(_0x6ca6('0x14'));var utils=require(_0x6ca6('0x15'));var config=require(_0x6ca6('0x16'));var db=require(_0x6ca6('0x17'))['db'];config[_0x6ca6('0x18')]=_['defaults'](config[_0x6ca6('0x18')],{'host':_0x6ca6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ca6('0x18')]));require(_0x6ca6('0x1a'))[_0x6ca6('0x1b')](socket);function respondWithStatusCode(_0x3570f1,_0xc774c){_0xc774c=_0xc774c||0xcc;return function(_0x1d1d86){if(_0x1d1d86){return _0x3570f1['sendStatus'](_0xc774c);}return _0x3570f1['status'](_0xc774c)['end']();};}function respondWithResult(_0x36ff3e,_0x19e94f){_0x19e94f=_0x19e94f||0xc8;return function(_0x260b56){if(_0x260b56){return _0x36ff3e[_0x6ca6('0x1c')](_0x19e94f)[_0x6ca6('0x1d')](_0x260b56);}};}function respondWithFilteredResult(_0x3d7f3f,_0x25dc6c){return function(_0x4f056d){if(_0x4f056d){var _0x2391ce=_0x4f056d[_0x6ca6('0x1e')],_0x10be57=_0x25dc6c[_0x6ca6('0x1f')],_0xc97f0=_0x25dc6c[_0x6ca6('0x1f')]+_0x25dc6c[_0x6ca6('0x20')],_0x1f21ff;if(_0xc97f0>=_0x2391ce){_0xc97f0=_0x2391ce;_0x1f21ff=0xc8;}else{_0x1f21ff=0xce;}_0x3d7f3f[_0x6ca6('0x1c')](_0x1f21ff);return _0x3d7f3f[_0x6ca6('0x21')](_0x6ca6('0x22'),_0x10be57+'-'+_0xc97f0+'/'+_0x2391ce)['json'](_0x4f056d);}return null;};}function patchUpdates(_0x28a982){return function(_0x254afe){try{jsonpatch[_0x6ca6('0x23')](_0x254afe,_0x28a982,!![]);}catch(_0x195c92){return BPromise[_0x6ca6('0x24')](_0x195c92);}return _0x254afe[_0x6ca6('0x25')]();};}function saveUpdates(_0x593f15,_0xfb962d){return function(_0x108319){if(_0x108319){return _0x108319['update'](_0x593f15)['then'](function(_0xfbf496){return _0xfbf496;});}return null;};}function removeEntity(_0x216701,_0xfe0760){return function(_0x224a1f){if(_0x224a1f){return _0x224a1f[_0x6ca6('0x26')]()['then'](function(){var _0x222373=_0x224a1f[_0x6ca6('0x27')]({'plain':!![]});var _0x1c43ee=_0x6ca6('0x28');return db[_0x6ca6('0x29')][_0x6ca6('0x26')]({'where':{'type':_0x1c43ee,'resourceId':_0x222373['id']}})[_0x6ca6('0x2a')](function(){return _0x224a1f;});})[_0x6ca6('0x2a')](function(){_0x216701['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x144ec5,_0x9467bd){return function(_0xf1d821){if(!_0xf1d821){_0x144ec5[_0x6ca6('0x2b')](0x194);}return _0xf1d821;};}function handleError(_0x552f3e,_0x5ea6f7){_0x5ea6f7=_0x5ea6f7||0x1f4;return function(_0x306583){logger['error'](_0x306583['stack']);if(_0x306583[_0x6ca6('0x2c')]){delete _0x306583[_0x6ca6('0x2c')];}_0x552f3e['status'](_0x5ea6f7)[_0x6ca6('0x2d')](_0x306583);};}exports[_0x6ca6('0x2e')]=function(_0xac50e8,_0x566543){var _0x484411={},_0x28af50={},_0x23112a={'count':0x0,'rows':[]};var _0x35fbb5=_[_0x6ca6('0x2f')](db['SquareProject'][_0x6ca6('0x30')],function(_0x15b962){return{'name':_0x15b962[_0x6ca6('0x31')],'type':_0x15b962[_0x6ca6('0x32')]['key']};});_0x28af50['model']=_['map'](_0x35fbb5,'name');_0x28af50['query']=_[_0x6ca6('0x33')](_0xac50e8[_0x6ca6('0x34')]);_0x28af50[_0x6ca6('0x35')]=_['intersection'](_0x28af50[_0x6ca6('0x36')],_0x28af50[_0x6ca6('0x34')]);_0x484411[_0x6ca6('0x37')]=_[_0x6ca6('0x38')](_0x28af50['model'],qs[_0x6ca6('0x39')](_0xac50e8[_0x6ca6('0x34')][_0x6ca6('0x39')]));_0x484411[_0x6ca6('0x37')]=_0x484411['attributes'][_0x6ca6('0x3a')]?_0x484411['attributes']:_0x28af50[_0x6ca6('0x36')];if(!_0xac50e8['query']['hasOwnProperty'](_0x6ca6('0x3b'))){_0x484411[_0x6ca6('0x20')]=qs[_0x6ca6('0x20')](_0xac50e8[_0x6ca6('0x34')]['limit']);_0x484411['offset']=qs[_0x6ca6('0x1f')](_0xac50e8[_0x6ca6('0x34')]['offset']);}_0x484411[_0x6ca6('0x3c')]=qs['sort'](_0xac50e8[_0x6ca6('0x34')]['sort']);_0x484411[_0x6ca6('0x3d')]=qs[_0x6ca6('0x35')](_[_0x6ca6('0x3e')](_0xac50e8[_0x6ca6('0x34')],_0x28af50[_0x6ca6('0x35')]));if(_0xac50e8[_0x6ca6('0x34')][_0x6ca6('0x3f')]){_0x484411[_0x6ca6('0x3d')]=_['merge'](_0x484411[_0x6ca6('0x3d')],{'$or':_['map'](_0x35fbb5,function(_0x57186c){if(_0x57186c[_0x6ca6('0x32')]!==_0x6ca6('0x40')){var _0x52cc41={};_0x52cc41[_0x57186c[_0x6ca6('0x2c')]]={'$like':'%'+_0xac50e8['query'][_0x6ca6('0x3f')]+'%'};return _0x52cc41;}})});}_0x484411=_[_0x6ca6('0x41')]({},_0x484411,_0xac50e8[_0x6ca6('0x42')]);var _0x3705cc={'where':_0x484411['where']};return db['SquareProject'][_0x6ca6('0x1e')](_0x3705cc)[_0x6ca6('0x2a')](function(_0x197ffa){_0x23112a[_0x6ca6('0x1e')]=_0x197ffa;if(_0xac50e8[_0x6ca6('0x34')]['includeAll']){_0x484411[_0x6ca6('0x43')]=[{'all':!![]}];}return db[_0x6ca6('0x44')]['findAll'](_0x484411);})[_0x6ca6('0x2a')](function(_0x3b60db){_0x23112a[_0x6ca6('0x45')]=_0x3b60db;return _0x23112a;})[_0x6ca6('0x2a')](respondWithFilteredResult(_0x566543,_0x484411))[_0x6ca6('0x46')](handleError(_0x566543,null));};exports[_0x6ca6('0x47')]=function(_0x258c76,_0xe9bce9){var _0x1a8b7e={'raw':![],'where':{'id':_0x258c76[_0x6ca6('0x48')]['id']}},_0x5e424f={};_0x5e424f[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x44')][_0x6ca6('0x30')]);_0x5e424f[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0x258c76[_0x6ca6('0x34')]);_0x5e424f['filters']=_['intersection'](_0x5e424f[_0x6ca6('0x36')],_0x5e424f[_0x6ca6('0x34')]);_0x1a8b7e[_0x6ca6('0x37')]=_[_0x6ca6('0x38')](_0x5e424f[_0x6ca6('0x36')],qs[_0x6ca6('0x39')](_0x258c76[_0x6ca6('0x34')]['fields']));_0x1a8b7e['attributes']=_0x1a8b7e[_0x6ca6('0x37')][_0x6ca6('0x3a')]?_0x1a8b7e['attributes']:_0x5e424f[_0x6ca6('0x36')];if(_0x258c76[_0x6ca6('0x34')][_0x6ca6('0x49')]){_0x1a8b7e[_0x6ca6('0x43')]=[{'all':!![]}];}_0x1a8b7e=_[_0x6ca6('0x41')]({},_0x1a8b7e,_0x258c76[_0x6ca6('0x42')]);return db[_0x6ca6('0x44')]['find'](_0x1a8b7e)[_0x6ca6('0x2a')](handleEntityNotFound(_0xe9bce9,null))[_0x6ca6('0x2a')](respondWithResult(_0xe9bce9,null))[_0x6ca6('0x46')](handleError(_0xe9bce9,null));};exports['create']=function(_0x408df3,_0x4dd78d){return db[_0x6ca6('0x44')]['create'](_0x408df3['body'],{})['then'](function(_0x199489){var _0x1603a7=_0x408df3[_0x6ca6('0x4a')]['get']({'plain':!![]});if(!_0x1603a7)throw new Error(_0x6ca6('0x4b'));if(_0x1603a7['role']===_0x6ca6('0x4a')){var _0x1010a6=_0x199489[_0x6ca6('0x27')]({'plain':!![]});var _0x18602d=_0x6ca6('0x28');return db[_0x6ca6('0x4c')][_0x6ca6('0x4d')]({'where':{'name':_0x18602d,'userProfileId':_0x1603a7[_0x6ca6('0x4e')]},'raw':!![]})[_0x6ca6('0x2a')](function(_0x2e4cc5){if(_0x2e4cc5&&_0x2e4cc5[_0x6ca6('0x4f')]===0x0){return db['UserProfileResource'][_0x6ca6('0x50')]({'name':_0x1010a6[_0x6ca6('0x2c')],'resourceId':_0x1010a6['id'],'type':_0x2e4cc5[_0x6ca6('0x2c')],'sectionId':_0x2e4cc5['id']},{})[_0x6ca6('0x2a')](function(){return _0x199489;});}else{return _0x199489;}})[_0x6ca6('0x46')](function(_0x594209){logger[_0x6ca6('0x51')](_0x6ca6('0x52'),_0x594209);throw _0x594209;});}return _0x199489;})[_0x6ca6('0x2a')](respondWithResult(_0x4dd78d,0xc9))['catch'](handleError(_0x4dd78d,null));};exports['update']=function(_0x4fe7a9,_0x4bcb4e){if(_0x4fe7a9[_0x6ca6('0x53')]['id']){delete _0x4fe7a9[_0x6ca6('0x53')]['id'];}return db[_0x6ca6('0x44')]['find']({'where':{'id':_0x4fe7a9['params']['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x4bcb4e,null))[_0x6ca6('0x2a')](saveUpdates(_0x4fe7a9[_0x6ca6('0x53')],null))['then'](respondWithResult(_0x4bcb4e,null))[_0x6ca6('0x46')](handleError(_0x4bcb4e,null));};exports['destroy']=function(_0x281759,_0x40077c){return db[_0x6ca6('0x44')][_0x6ca6('0x4d')]({'where':{'id':_0x281759['params']['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x40077c,null))['then'](removeEntity(_0x40077c,null))['catch'](handleError(_0x40077c,null));};exports[_0x6ca6('0x54')]=function(_0x11538e,_0x1b9da5,_0x35854a){return db['SquareProject'][_0x6ca6('0x4d')]({'where':{'id':_0x11538e[_0x6ca6('0x48')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x1b9da5,null))[_0x6ca6('0x2a')](function(_0x43881a){if(_0x43881a){return _0x43881a[_0x6ca6('0x54')](_0x11538e[_0x6ca6('0x53')][_0x6ca6('0x55')],_[_0x6ca6('0x56')](_0x11538e[_0x6ca6('0x53')],[_0x6ca6('0x55'),'id'])||{});}})[_0x6ca6('0x2a')](respondWithResult(_0x1b9da5,null))[_0x6ca6('0x46')](handleError(_0x1b9da5,null));};exports[_0x6ca6('0x57')]=function(_0x2eeed6,_0x290c04,_0x493e5d){return db[_0x6ca6('0x44')][_0x6ca6('0x4d')]({'where':{'id':_0x2eeed6[_0x6ca6('0x48')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x290c04,null))[_0x6ca6('0x2a')](function(_0x139144){if(_0x139144){return _0x139144[_0x6ca6('0x57')](_0x2eeed6[_0x6ca6('0x34')][_0x6ca6('0x55')])[_0x6ca6('0x2a')](function(){if(_[_0x6ca6('0x58')](_0x2eeed6[_0x6ca6('0x34')][_0x6ca6('0x55')])){for(var _0x16a4f9=0x0;_0x16a4f9<_0x2eeed6[_0x6ca6('0x34')][_0x6ca6('0x55')]['length'];_0x16a4f9+=0x1){socket[_0x6ca6('0x59')](_0x6ca6('0x5a'),{'UserId':Number(_0x2eeed6[_0x6ca6('0x34')][_0x6ca6('0x55')][_0x16a4f9]),'SquareProjectId':Number(_0x2eeed6[_0x6ca6('0x48')]['id'])});}}else{socket[_0x6ca6('0x59')]('userSquareProject:remove',{'UserId':Number(_0x2eeed6['query']['ids']),'SquareProjectId':Number(_0x2eeed6[_0x6ca6('0x48')]['id'])});}});}})[_0x6ca6('0x2a')](respondWithStatusCode(_0x290c04,null))['catch'](handleError(_0x290c04,null));};exports[_0x6ca6('0x5b')]=function(_0xc6021a,_0x97f23,_0x555b22){var _0x4250a1={};var _0x18e9c1={};var _0x22c621;var _0x1c3064;return db[_0x6ca6('0x44')]['findOne']({'where':{'id':_0xc6021a['params']['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x97f23,null))[_0x6ca6('0x2a')](function(_0x47d420){if(_0x47d420){_0x22c621=_0x47d420;_0x18e9c1[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x5c')][_0x6ca6('0x30')]);_0x18e9c1[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0xc6021a[_0x6ca6('0x34')]);_0x18e9c1[_0x6ca6('0x35')]=_[_0x6ca6('0x38')](_0x18e9c1['model'],_0x18e9c1['query']);_0x4250a1[_0x6ca6('0x37')]=_[_0x6ca6('0x38')](_0x18e9c1[_0x6ca6('0x36')],qs[_0x6ca6('0x39')](_0xc6021a[_0x6ca6('0x34')][_0x6ca6('0x39')]));_0x4250a1['attributes']=_0x4250a1[_0x6ca6('0x37')]['length']?_0x4250a1[_0x6ca6('0x37')]:_0x18e9c1[_0x6ca6('0x36')];_0x4250a1[_0x6ca6('0x3c')]=qs[_0x6ca6('0x5d')](_0xc6021a[_0x6ca6('0x34')]['sort']);_0x4250a1['where']=qs[_0x6ca6('0x35')](_[_0x6ca6('0x3e')](_0xc6021a[_0x6ca6('0x34')],_0x18e9c1['filters']));if(_0xc6021a[_0x6ca6('0x34')][_0x6ca6('0x3f')]){_0x4250a1[_0x6ca6('0x3d')]=_[_0x6ca6('0x41')](_0x4250a1['where'],{'$or':_[_0x6ca6('0x2f')](_0x4250a1[_0x6ca6('0x37')],function(_0x3637c9){var _0x48d7cb={};_0x48d7cb[_0x3637c9]={'$like':'%'+_0xc6021a[_0x6ca6('0x34')]['filter']+'%'};return _0x48d7cb;})});}_0x4250a1=_[_0x6ca6('0x41')]({},_0x4250a1,_0xc6021a[_0x6ca6('0x42')]);return _0x22c621[_0x6ca6('0x5b')](_0x4250a1);}})[_0x6ca6('0x2a')](function(_0x2b3fb5){if(_0x2b3fb5){_0x1c3064=_0x2b3fb5[_0x6ca6('0x3a')];if(!_0xc6021a[_0x6ca6('0x34')]['hasOwnProperty']('nolimit')){_0x4250a1[_0x6ca6('0x20')]=qs[_0x6ca6('0x20')](_0xc6021a[_0x6ca6('0x34')]['limit']);_0x4250a1[_0x6ca6('0x1f')]=qs[_0x6ca6('0x1f')](_0xc6021a[_0x6ca6('0x34')][_0x6ca6('0x1f')]);}return _0x22c621[_0x6ca6('0x5b')](_0x4250a1);}})[_0x6ca6('0x2a')](function(_0x5ceb48){if(_0x5ceb48){return _0x5ceb48?{'count':_0x1c3064,'rows':_0x5ceb48}:null;}})['then'](respondWithResult(_0x97f23,null))[_0x6ca6('0x46')](handleError(_0x97f23,null));}; \ No newline at end of file +var _0xc788=['SquareProjects','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','userSquareProject:remove','emit','getUsers','sort','nolimit','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SquareProject','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','params','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x4fe12b,_0x553c84){var _0x3d3b14=function(_0x4f0148){while(--_0x4f0148){_0x4fe12b['push'](_0x4fe12b['shift']());}};_0x3d3b14(++_0x553c84);}(_0xc788,0xc4));var _0x8c78=function(_0x189d3c,_0x5efebf){_0x189d3c=_0x189d3c-0x0;var _0x485959=_0xc788[_0x189d3c];return _0x485959;};'use strict';var pdf=require(_0x8c78('0x0'));var emlformat=require(_0x8c78('0x1'));var rimraf=require(_0x8c78('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c78('0x3'));var moment=require(_0x8c78('0x4'));var BPromise=require(_0x8c78('0x5'));var Mustache=require(_0x8c78('0x6'));var util=require(_0x8c78('0x7'));var path=require('path');var sox=require(_0x8c78('0x8'));var csv=require(_0x8c78('0x9'));var ejs=require(_0x8c78('0xa'));var fs=require('fs');var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x9'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var db=require('../../mysqldb')['db'];config[_0x8c78('0x17')]=_['defaults'](config['redis'],{'host':_0x8c78('0x18'),'port':0x18eb});var socket=require(_0x8c78('0x19'))(new Redis(config[_0x8c78('0x17')]));require(_0x8c78('0x1a'))[_0x8c78('0x1b')](socket);function respondWithStatusCode(_0x3d1306,_0xe5f8ae){_0xe5f8ae=_0xe5f8ae||0xcc;return function(_0x930233){if(_0x930233){return _0x3d1306[_0x8c78('0x1c')](_0xe5f8ae);}return _0x3d1306[_0x8c78('0x1d')](_0xe5f8ae)['end']();};}function respondWithResult(_0x1fa78e,_0x293cfe){_0x293cfe=_0x293cfe||0xc8;return function(_0x57ad11){if(_0x57ad11){return _0x1fa78e[_0x8c78('0x1d')](_0x293cfe)[_0x8c78('0x1e')](_0x57ad11);}};}function respondWithFilteredResult(_0xe7c355,_0x23824e){return function(_0x2a982c){if(_0x2a982c){var _0x461eff=_0x2a982c['count'],_0x54eafa=_0x23824e['offset'],_0x4f7bf9=_0x23824e[_0x8c78('0x1f')]+_0x23824e['limit'],_0x339d04;if(_0x4f7bf9>=_0x461eff){_0x4f7bf9=_0x461eff;_0x339d04=0xc8;}else{_0x339d04=0xce;}_0xe7c355[_0x8c78('0x1d')](_0x339d04);return _0xe7c355[_0x8c78('0x20')]('Content-Range',_0x54eafa+'-'+_0x4f7bf9+'/'+_0x461eff)[_0x8c78('0x1e')](_0x2a982c);}return null;};}function patchUpdates(_0x5b111b){return function(_0x2dba52){try{jsonpatch[_0x8c78('0x21')](_0x2dba52,_0x5b111b,!![]);}catch(_0x5a254d){return BPromise[_0x8c78('0x22')](_0x5a254d);}return _0x2dba52[_0x8c78('0x23')]();};}function saveUpdates(_0x499603,_0x2bc595){return function(_0x28ed3a){if(_0x28ed3a){return _0x28ed3a[_0x8c78('0x24')](_0x499603)[_0x8c78('0x25')](function(_0x215940){return _0x215940;});}return null;};}function removeEntity(_0x20f483,_0xbfdf6f){return function(_0x1958f1){if(_0x1958f1){return _0x1958f1[_0x8c78('0x26')]()['then'](function(){var _0x93c78d=_0x1958f1[_0x8c78('0x27')]({'plain':!![]});var _0x1d1cef='SquareProjects';return db[_0x8c78('0x28')]['destroy']({'where':{'type':_0x1d1cef,'resourceId':_0x93c78d['id']}})[_0x8c78('0x25')](function(){return _0x1958f1;});})[_0x8c78('0x25')](function(){_0x20f483[_0x8c78('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583a74,_0x2568d5){return function(_0x4be49d){if(!_0x4be49d){_0x583a74[_0x8c78('0x1c')](0x194);}return _0x4be49d;};}function handleError(_0x4376da,_0x394c1d){_0x394c1d=_0x394c1d||0x1f4;return function(_0x36e8e5){logger[_0x8c78('0x29')](_0x36e8e5[_0x8c78('0x2a')]);if(_0x36e8e5['name']){delete _0x36e8e5[_0x8c78('0x2b')];}_0x4376da['status'](_0x394c1d)[_0x8c78('0x2c')](_0x36e8e5);};}exports[_0x8c78('0x2d')]=function(_0xb69c52,_0x4e764f){var _0x1f1a0c={},_0x3816d2={},_0x4f0005={'count':0x0,'rows':[]};var _0x42d4bb=_[_0x8c78('0x2e')](db[_0x8c78('0x2f')]['rawAttributes'],function(_0x36ece0){return{'name':_0x36ece0[_0x8c78('0x30')],'type':_0x36ece0[_0x8c78('0x31')]['key']};});_0x3816d2[_0x8c78('0x32')]=_[_0x8c78('0x2e')](_0x42d4bb,'name');_0x3816d2[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0xb69c52[_0x8c78('0x33')]);_0x3816d2[_0x8c78('0x35')]=_[_0x8c78('0x36')](_0x3816d2[_0x8c78('0x32')],_0x3816d2[_0x8c78('0x33')]);_0x1f1a0c[_0x8c78('0x37')]=_[_0x8c78('0x36')](_0x3816d2[_0x8c78('0x32')],qs['fields'](_0xb69c52[_0x8c78('0x33')][_0x8c78('0x38')]));_0x1f1a0c[_0x8c78('0x37')]=_0x1f1a0c[_0x8c78('0x37')][_0x8c78('0x39')]?_0x1f1a0c['attributes']:_0x3816d2[_0x8c78('0x32')];if(!_0xb69c52[_0x8c78('0x33')][_0x8c78('0x3a')]('nolimit')){_0x1f1a0c[_0x8c78('0x3b')]=qs[_0x8c78('0x3b')](_0xb69c52['query'][_0x8c78('0x3b')]);_0x1f1a0c['offset']=qs[_0x8c78('0x1f')](_0xb69c52[_0x8c78('0x33')][_0x8c78('0x1f')]);}_0x1f1a0c[_0x8c78('0x3c')]=qs['sort'](_0xb69c52[_0x8c78('0x33')]['sort']);_0x1f1a0c[_0x8c78('0x3d')]=qs[_0x8c78('0x35')](_[_0x8c78('0x3e')](_0xb69c52['query'],_0x3816d2['filters']));if(_0xb69c52[_0x8c78('0x33')][_0x8c78('0x3f')]){_0x1f1a0c[_0x8c78('0x3d')]=_[_0x8c78('0x40')](_0x1f1a0c[_0x8c78('0x3d')],{'$or':_[_0x8c78('0x2e')](_0x42d4bb,function(_0x326b34){if(_0x326b34[_0x8c78('0x31')]!==_0x8c78('0x41')){var _0x23f155={};_0x23f155[_0x326b34[_0x8c78('0x2b')]]={'$like':'%'+_0xb69c52[_0x8c78('0x33')][_0x8c78('0x3f')]+'%'};return _0x23f155;}})});}_0x1f1a0c=_['merge']({},_0x1f1a0c,_0xb69c52[_0x8c78('0x42')]);var _0x2aad8b={'where':_0x1f1a0c['where']};return db['SquareProject'][_0x8c78('0x43')](_0x2aad8b)[_0x8c78('0x25')](function(_0x5c9af3){_0x4f0005[_0x8c78('0x43')]=_0x5c9af3;if(_0xb69c52[_0x8c78('0x33')]['includeAll']){_0x1f1a0c[_0x8c78('0x44')]=[{'all':!![]}];}return db[_0x8c78('0x2f')]['findAll'](_0x1f1a0c);})[_0x8c78('0x25')](function(_0x24a8ea){_0x4f0005[_0x8c78('0x45')]=_0x24a8ea;return _0x4f0005;})[_0x8c78('0x25')](respondWithFilteredResult(_0x4e764f,_0x1f1a0c))[_0x8c78('0x46')](handleError(_0x4e764f,null));};exports['show']=function(_0x545d90,_0x2841c2){var _0x2f6a6b={'raw':![],'where':{'id':_0x545d90[_0x8c78('0x47')]['id']}},_0xac60f9={};_0xac60f9[_0x8c78('0x32')]=_[_0x8c78('0x34')](db[_0x8c78('0x2f')][_0x8c78('0x48')]);_0xac60f9[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x545d90[_0x8c78('0x33')]);_0xac60f9['filters']=_[_0x8c78('0x36')](_0xac60f9[_0x8c78('0x32')],_0xac60f9[_0x8c78('0x33')]);_0x2f6a6b[_0x8c78('0x37')]=_[_0x8c78('0x36')](_0xac60f9['model'],qs[_0x8c78('0x38')](_0x545d90[_0x8c78('0x33')][_0x8c78('0x38')]));_0x2f6a6b[_0x8c78('0x37')]=_0x2f6a6b[_0x8c78('0x37')]['length']?_0x2f6a6b[_0x8c78('0x37')]:_0xac60f9['model'];if(_0x545d90['query'][_0x8c78('0x49')]){_0x2f6a6b[_0x8c78('0x44')]=[{'all':!![]}];}_0x2f6a6b=_[_0x8c78('0x40')]({},_0x2f6a6b,_0x545d90['options']);return db[_0x8c78('0x2f')][_0x8c78('0x4a')](_0x2f6a6b)[_0x8c78('0x25')](handleEntityNotFound(_0x2841c2,null))[_0x8c78('0x25')](respondWithResult(_0x2841c2,null))[_0x8c78('0x46')](handleError(_0x2841c2,null));};exports[_0x8c78('0x4b')]=function(_0x26103c,_0x1f5cdb){return db[_0x8c78('0x2f')]['create'](_0x26103c[_0x8c78('0x4c')],{})[_0x8c78('0x25')](function(_0xba0de6){var _0x2cbee8=_0x26103c['user'][_0x8c78('0x27')]({'plain':!![]});if(!_0x2cbee8)throw new Error(_0x8c78('0x4d'));if(_0x2cbee8[_0x8c78('0x4e')]===_0x8c78('0x4f')){var _0x53e75c=_0xba0de6[_0x8c78('0x27')]({'plain':!![]});var _0x38f7af=_0x8c78('0x50');return db['UserProfileSection'][_0x8c78('0x4a')]({'where':{'name':_0x38f7af,'userProfileId':_0x2cbee8['userProfileId']},'raw':!![]})[_0x8c78('0x25')](function(_0xe6325b){if(_0xe6325b&&_0xe6325b[_0x8c78('0x51')]===0x0){return db[_0x8c78('0x28')][_0x8c78('0x4b')]({'name':_0x53e75c[_0x8c78('0x2b')],'resourceId':_0x53e75c['id'],'type':_0xe6325b[_0x8c78('0x2b')],'sectionId':_0xe6325b['id']},{})[_0x8c78('0x25')](function(){return _0xba0de6;});}else{return _0xba0de6;}})[_0x8c78('0x46')](function(_0x454e97){logger[_0x8c78('0x29')](_0x8c78('0x52'),_0x454e97);throw _0x454e97;});}return _0xba0de6;})[_0x8c78('0x25')](respondWithResult(_0x1f5cdb,0xc9))[_0x8c78('0x46')](handleError(_0x1f5cdb,null));};exports['update']=function(_0x22fe6c,_0x3721f4){if(_0x22fe6c[_0x8c78('0x4c')]['id']){delete _0x22fe6c[_0x8c78('0x4c')]['id'];}return db['SquareProject'][_0x8c78('0x4a')]({'where':{'id':_0x22fe6c[_0x8c78('0x47')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x3721f4,null))[_0x8c78('0x25')](saveUpdates(_0x22fe6c[_0x8c78('0x4c')],null))[_0x8c78('0x25')](respondWithResult(_0x3721f4,null))['catch'](handleError(_0x3721f4,null));};exports[_0x8c78('0x26')]=function(_0x42a34e,_0x486b61){return db[_0x8c78('0x2f')]['find']({'where':{'id':_0x42a34e[_0x8c78('0x47')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x486b61,null))[_0x8c78('0x25')](removeEntity(_0x486b61,null))[_0x8c78('0x46')](handleError(_0x486b61,null));};exports[_0x8c78('0x53')]=function(_0x35cf85,_0x416a05,_0x49fa4c){return db[_0x8c78('0x2f')][_0x8c78('0x4a')]({'where':{'id':_0x35cf85['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x416a05,null))[_0x8c78('0x25')](function(_0x577361){if(_0x577361){return _0x577361[_0x8c78('0x53')](_0x35cf85[_0x8c78('0x4c')][_0x8c78('0x54')],_[_0x8c78('0x55')](_0x35cf85[_0x8c78('0x4c')],[_0x8c78('0x54'),'id'])||{});}})[_0x8c78('0x25')](respondWithResult(_0x416a05,null))[_0x8c78('0x46')](handleError(_0x416a05,null));};exports[_0x8c78('0x56')]=function(_0x1b3600,_0x25b8bc,_0x1c57ea){return db[_0x8c78('0x2f')][_0x8c78('0x4a')]({'where':{'id':_0x1b3600['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x25b8bc,null))['then'](function(_0x4424a4){if(_0x4424a4){return _0x4424a4['removeUsers'](_0x1b3600['query']['ids'])[_0x8c78('0x25')](function(){if(_['isArray'](_0x1b3600['query']['ids'])){for(var _0x4373b4=0x0;_0x4373b4<_0x1b3600[_0x8c78('0x33')][_0x8c78('0x54')][_0x8c78('0x39')];_0x4373b4+=0x1){socket['emit'](_0x8c78('0x57'),{'UserId':Number(_0x1b3600[_0x8c78('0x33')][_0x8c78('0x54')][_0x4373b4]),'SquareProjectId':Number(_0x1b3600[_0x8c78('0x47')]['id'])});}}else{socket[_0x8c78('0x58')](_0x8c78('0x57'),{'UserId':Number(_0x1b3600[_0x8c78('0x33')][_0x8c78('0x54')]),'SquareProjectId':Number(_0x1b3600[_0x8c78('0x47')]['id'])});}});}})[_0x8c78('0x25')](respondWithStatusCode(_0x25b8bc,null))[_0x8c78('0x46')](handleError(_0x25b8bc,null));};exports[_0x8c78('0x59')]=function(_0x3e1ee0,_0x37da1f,_0x4bdb7e){var _0x46f57b={};var _0x4ed66c={};var _0x1b1de6;var _0x28d1a7;return db[_0x8c78('0x2f')]['findOne']({'where':{'id':_0x3e1ee0[_0x8c78('0x47')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x37da1f,null))[_0x8c78('0x25')](function(_0x4fa0b0){if(_0x4fa0b0){_0x1b1de6=_0x4fa0b0;_0x4ed66c[_0x8c78('0x32')]=_[_0x8c78('0x34')](db['User'][_0x8c78('0x48')]);_0x4ed66c[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x3e1ee0['query']);_0x4ed66c[_0x8c78('0x35')]=_[_0x8c78('0x36')](_0x4ed66c[_0x8c78('0x32')],_0x4ed66c[_0x8c78('0x33')]);_0x46f57b[_0x8c78('0x37')]=_[_0x8c78('0x36')](_0x4ed66c[_0x8c78('0x32')],qs[_0x8c78('0x38')](_0x3e1ee0[_0x8c78('0x33')]['fields']));_0x46f57b[_0x8c78('0x37')]=_0x46f57b[_0x8c78('0x37')][_0x8c78('0x39')]?_0x46f57b[_0x8c78('0x37')]:_0x4ed66c[_0x8c78('0x32')];_0x46f57b[_0x8c78('0x3c')]=qs[_0x8c78('0x5a')](_0x3e1ee0[_0x8c78('0x33')][_0x8c78('0x5a')]);_0x46f57b['where']=qs[_0x8c78('0x35')](_[_0x8c78('0x3e')](_0x3e1ee0['query'],_0x4ed66c['filters']));if(_0x3e1ee0[_0x8c78('0x33')]['filter']){_0x46f57b[_0x8c78('0x3d')]=_[_0x8c78('0x40')](_0x46f57b[_0x8c78('0x3d')],{'$or':_[_0x8c78('0x2e')](_0x46f57b[_0x8c78('0x37')],function(_0x154d34){var _0x512283={};_0x512283[_0x154d34]={'$like':'%'+_0x3e1ee0['query'][_0x8c78('0x3f')]+'%'};return _0x512283;})});}_0x46f57b=_[_0x8c78('0x40')]({},_0x46f57b,_0x3e1ee0[_0x8c78('0x42')]);return _0x1b1de6[_0x8c78('0x59')](_0x46f57b);}})[_0x8c78('0x25')](function(_0x4c09fd){if(_0x4c09fd){_0x28d1a7=_0x4c09fd[_0x8c78('0x39')];if(!_0x3e1ee0[_0x8c78('0x33')][_0x8c78('0x3a')](_0x8c78('0x5b'))){_0x46f57b[_0x8c78('0x3b')]=qs[_0x8c78('0x3b')](_0x3e1ee0['query'][_0x8c78('0x3b')]);_0x46f57b[_0x8c78('0x1f')]=qs['offset'](_0x3e1ee0[_0x8c78('0x33')][_0x8c78('0x1f')]);}return _0x1b1de6[_0x8c78('0x59')](_0x46f57b);}})[_0x8c78('0x25')](function(_0x3f2496){if(_0x3f2496){return _0x3f2496?{'count':_0x28d1a7,'rows':_0x3f2496}:null;}})[_0x8c78('0x25')](respondWithResult(_0x37da1f,null))[_0x8c78('0x46')](handleError(_0x37da1f,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index cc109bb..95ac0be 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 _0x5e87=['events','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x34e12f,_0x57d22b){var _0x3f611a=function(_0x3aba68){while(--_0x3aba68){_0x34e12f['push'](_0x34e12f['shift']());}};_0x3f611a(++_0x57d22b);}(_0x5e87,0x8c));var _0x75e8=function(_0x19a8b6,_0x125cee){_0x19a8b6=_0x19a8b6-0x0;var _0xaaca66=_0x5e87[_0x19a8b6];return _0xaaca66;};'use strict';var EventEmitter=require(_0x75e8('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x75e8('0x1'),'afterUpdate':_0x75e8('0x2'),'afterDestroy':_0x75e8('0x3')};function emitEvent(_0x121373){return function(_0x43dfdc,_0x32ce94,_0x39a7a3){SquareProjectEvents['emit'](_0x121373+':'+_0x43dfdc['id'],_0x43dfdc);SquareProjectEvents[_0x75e8('0x4')](_0x121373,_0x43dfdc);_0x39a7a3(null);};}for(var e in events){if(events[_0x75e8('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x75e8('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x8853=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x5d0a3e,_0x5bdb16){var _0x5575af=function(_0x327020){while(--_0x327020){_0x5d0a3e['push'](_0x5d0a3e['shift']());}};_0x5575af(++_0x5bdb16);}(_0x8853,0x1a8));var _0x3885=function(_0x3d4a91,_0x18d54b){_0x3d4a91=_0x3d4a91-0x0;var _0x1728d2=_0x8853[_0x3d4a91];return _0x1728d2;};'use strict';var EventEmitter=require(_0x3885('0x0'));var SquareProject=require(_0x3885('0x1'))['db'][_0x3885('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x3885('0x3')](0x0);var events={'afterCreate':_0x3885('0x4'),'afterUpdate':_0x3885('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2ed969){return function(_0x26b2d1,_0x54ff71,_0x53b253){SquareProjectEvents[_0x3885('0x6')](_0x2ed969+':'+_0x26b2d1['id'],_0x26b2d1);SquareProjectEvents['emit'](_0x2ed969,_0x26b2d1);_0x53b253(null);};}for(var e in events){if(events[_0x3885('0x7')](e)){var event=events[e];SquareProject[_0x3885('0x8')](e,emitEvent(event));}}module[_0x3885('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index dc50f57..48ba76a 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 _0xc881=['moment','bluebird','path','rimraf','./squareProject.attributes','define','square_projects','util','../../config/logger','api'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xc881,0x75));var _0x1c88=function(_0x5677b1,_0x4cfe89){_0x5677b1=_0x5677b1-0x0;var _0x3324e5=_0xc881[_0x5677b1];return _0x3324e5;};'use strict';var _=require('lodash');var util=require(_0x1c88('0x0'));var logger=require(_0x1c88('0x1'))(_0x1c88('0x2'));var moment=require(_0x1c88('0x3'));var BPromise=require(_0x1c88('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c88('0x5'));var rimraf=require(_0x1c88('0x6'));var config=require('../../config/environment');var attributes=require(_0x1c88('0x7'));module['exports']=function(_0xa957cc,_0xd5ff11){return _0xa957cc[_0x1c88('0x8')]('SquareProject',attributes,{'tableName':_0x1c88('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x868d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x37ed69,_0x17348e){var _0x7840aa=function(_0x1fdf88){while(--_0x1fdf88){_0x37ed69['push'](_0x37ed69['shift']());}};_0x7840aa(++_0x17348e);}(_0x868d,0x17a));var _0xd868=function(_0x380974,_0x2f9563){_0x380974=_0x380974-0x0;var _0x12700b=_0x868d[_0x380974];return _0x12700b;};'use strict';var _=require(_0xd868('0x0'));var util=require('util');var logger=require(_0xd868('0x1'))(_0xd868('0x2'));var moment=require(_0xd868('0x3'));var BPromise=require(_0xd868('0x4'));var rp=require(_0xd868('0x5'));var fs=require('fs');var path=require(_0xd868('0x6'));var rimraf=require(_0xd868('0x7'));var config=require(_0xd868('0x8'));var attributes=require(_0xd868('0x9'));module[_0xd868('0xa')]=function(_0x1cb71d,_0x50b95f){return _0x1cb71d[_0xd868('0xb')](_0xd868('0xc'),attributes,{'tableName':_0xd868('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 9fbd311..577d585 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 _0xe3da=['options','raw','where','include','model','map','attributes','lodash','util','bluebird','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find'];(function(_0x3dd632,_0x2f098b){var _0x536ba7=function(_0x747767){while(--_0x747767){_0x3dd632['push'](_0x3dd632['shift']());}};_0x536ba7(++_0x2f098b);}(_0xe3da,0x1d5));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require('moment');var BPromise=require(_0xae3d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xae3d('0x3'));var client=jayson[_0xae3d('0x4')][_0xae3d('0x5')]({'port':0x232a});config['redis']=_[_0xae3d('0x6')](config['redis'],{'host':_0xae3d('0x7'),'port':0x18eb});var socket=require(_0xae3d('0x8'))(new Redis(config[_0xae3d('0x9')]));require('./squareProject.socket')[_0xae3d('0xa')](socket);function respondWithRpcPromise(_0x45c67a,_0x31aef6,_0x4d5939){return new BPromise(function(_0x6b38b3,_0x4fa2b6){return client[_0xae3d('0xb')](_0x45c67a,_0x4d5939)[_0xae3d('0xc')](function(_0x45f768){logger[_0xae3d('0xd')](_0xae3d('0xe'),_0x31aef6,_0xae3d('0xf'));logger['debug'](_0xae3d('0x10'),_0x31aef6,_0xae3d('0xf'),JSON[_0xae3d('0x11')](_0x45f768));if(_0x45f768[_0xae3d('0x12')]){if(_0x45f768['error'][_0xae3d('0x13')]===0x1f4){logger[_0xae3d('0x12')]('SquareProject,\x20%s,\x20%s',_0x31aef6,_0x45f768[_0xae3d('0x12')][_0xae3d('0x14')]);return _0x4fa2b6(_0x45f768['error'][_0xae3d('0x14')]);}logger['error'](_0xae3d('0xe'),_0x31aef6,_0x45f768['error'][_0xae3d('0x14')]);return _0x6b38b3(_0x45f768[_0xae3d('0x12')][_0xae3d('0x14')]);}else{logger[_0xae3d('0xd')](_0xae3d('0xe'),_0x31aef6,'request\x20sent');_0x6b38b3(_0x45f768[_0xae3d('0x15')][_0xae3d('0x14')]);}})[_0xae3d('0x16')](function(_0x1fe3a4){logger[_0xae3d('0x12')](_0xae3d('0xe'),_0x31aef6,_0x1fe3a4);_0x4fa2b6(_0x1fe3a4);});});}exports[_0xae3d('0x17')]=function(_0x49a4bd){var _0x2c182a=this;return new Promise(function(_0x87b5a5,_0x2245c0){return db[_0xae3d('0x18')][_0xae3d('0x19')]({'raw':_0x49a4bd[_0xae3d('0x1a')]?_0x49a4bd['options'][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x49a4bd[_0xae3d('0x1a')]?_0x49a4bd[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'attributes':_0x49a4bd[_0xae3d('0x1a')]?_0x49a4bd['options']['attributes']||null:null,'include':_0x49a4bd['options']?_0x49a4bd[_0xae3d('0x1a')][_0xae3d('0x1d')]?_['map'](_0x49a4bd[_0xae3d('0x1a')][_0xae3d('0x1d')],function(_0x2674de){return{'model':db[_0x2674de[_0xae3d('0x1e')]],'as':_0x2674de['as'],'attributes':_0x2674de['attributes'],'include':_0x2674de['include']?_[_0xae3d('0x1f')](_0x2674de[_0xae3d('0x1d')],function(_0x390b0c){return{'model':db[_0x390b0c[_0xae3d('0x1e')]],'as':_0x390b0c['as'],'attributes':_0x390b0c[_0xae3d('0x20')],'include':_0x390b0c[_0xae3d('0x1d')]?_[_0xae3d('0x1f')](_0x390b0c[_0xae3d('0x1d')],function(_0xb3c5d1){return{'model':db[_0xb3c5d1[_0xae3d('0x1e')]],'as':_0xb3c5d1['as'],'attributes':_0xb3c5d1[_0xae3d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1be91e){logger[_0xae3d('0xd')](_0xae3d('0x17'),_0x49a4bd);logger['debug'](_0xae3d('0x17'),_0x49a4bd,JSON[_0xae3d('0x11')](_0x1be91e));_0x87b5a5(_0x1be91e);})[_0xae3d('0x16')](function(_0x5648af){logger['error'](_0xae3d('0x17'),_0x5648af['message'],_0x49a4bd);_0x2245c0(_0x2c182a[_0xae3d('0x12')](0x1f4,_0x5648af[_0xae3d('0x14')]));});});}; \ No newline at end of file +var _0x5dc0=['raw','include','map','model','attributes','stringify','ShowSquareProject','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','SquareProject','find','options'];(function(_0x573348,_0x5b06c3){var _0x448cd0=function(_0x97fe3d){while(--_0x97fe3d){_0x573348['push'](_0x573348['shift']());}};_0x448cd0(++_0x5b06c3);}(_0x5dc0,0xfc));var _0x05dc=function(_0x3ada41,_0x93ec38){_0x3ada41=_0x3ada41-0x0;var _0x52e0ed=_0x5dc0[_0x3ada41];return _0x52e0ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x05dc('0x0'));var rs=require(_0x05dc('0x1'));var fs=require('fs');var Redis=require(_0x05dc('0x2'));var db=require(_0x05dc('0x3'))['db'];var utils=require(_0x05dc('0x4'));var logger=require('../../config/logger')(_0x05dc('0x5'));var config=require(_0x05dc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x05dc('0x7')][_0x05dc('0x8')]({'port':0x232a});config[_0x05dc('0x9')]=_['defaults'](config[_0x05dc('0x9')],{'host':_0x05dc('0xa'),'port':0x18eb});var socket=require(_0x05dc('0xb'))(new Redis(config['redis']));require(_0x05dc('0xc'))[_0x05dc('0xd')](socket);function respondWithRpcPromise(_0xc2505d,_0x2a4633,_0x59284a){return new BPromise(function(_0xf3b922,_0x1d994a){return client[_0x05dc('0xe')](_0xc2505d,_0x59284a)[_0x05dc('0xf')](function(_0x4fcdf6){logger['info'](_0x05dc('0x10'),_0x2a4633,_0x05dc('0x11'));logger[_0x05dc('0x12')](_0x05dc('0x13'),_0x2a4633,_0x05dc('0x11'),JSON['stringify'](_0x4fcdf6));if(_0x4fcdf6[_0x05dc('0x14')]){if(_0x4fcdf6[_0x05dc('0x14')]['code']===0x1f4){logger[_0x05dc('0x14')]('SquareProject,\x20%s,\x20%s',_0x2a4633,_0x4fcdf6[_0x05dc('0x14')][_0x05dc('0x15')]);return _0x1d994a(_0x4fcdf6[_0x05dc('0x14')][_0x05dc('0x15')]);}logger[_0x05dc('0x14')](_0x05dc('0x10'),_0x2a4633,_0x4fcdf6[_0x05dc('0x14')][_0x05dc('0x15')]);return _0xf3b922(_0x4fcdf6[_0x05dc('0x14')]['message']);}else{logger[_0x05dc('0x16')]('SquareProject,\x20%s,\x20%s',_0x2a4633,_0x05dc('0x11'));_0xf3b922(_0x4fcdf6[_0x05dc('0x17')]['message']);}})[_0x05dc('0x18')](function(_0x459ccd){logger[_0x05dc('0x14')](_0x05dc('0x10'),_0x2a4633,_0x459ccd);_0x1d994a(_0x459ccd);});});}exports['ShowSquareProject']=function(_0x1678e6){var _0x4cda44=this;return new Promise(function(_0x3312c3,_0x1d8247){return db[_0x05dc('0x19')][_0x05dc('0x1a')]({'raw':_0x1678e6[_0x05dc('0x1b')]?_0x1678e6[_0x05dc('0x1b')][_0x05dc('0x1c')]===undefined?!![]:![]:!![],'where':_0x1678e6['options']?_0x1678e6['options']['where']||null:null,'attributes':_0x1678e6['options']?_0x1678e6[_0x05dc('0x1b')]['attributes']||null:null,'include':_0x1678e6[_0x05dc('0x1b')]?_0x1678e6[_0x05dc('0x1b')][_0x05dc('0x1d')]?_[_0x05dc('0x1e')](_0x1678e6[_0x05dc('0x1b')]['include'],function(_0x41aa0a){return{'model':db[_0x41aa0a[_0x05dc('0x1f')]],'as':_0x41aa0a['as'],'attributes':_0x41aa0a['attributes'],'include':_0x41aa0a[_0x05dc('0x1d')]?_['map'](_0x41aa0a['include'],function(_0x589727){return{'model':db[_0x589727[_0x05dc('0x1f')]],'as':_0x589727['as'],'attributes':_0x589727['attributes'],'include':_0x589727['include']?_[_0x05dc('0x1e')](_0x589727['include'],function(_0x8d86ee){return{'model':db[_0x8d86ee[_0x05dc('0x1f')]],'as':_0x8d86ee['as'],'attributes':_0x8d86ee[_0x05dc('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23931c){logger[_0x05dc('0x16')]('ShowSquareProject',_0x1678e6);logger[_0x05dc('0x12')]('ShowSquareProject',_0x1678e6,JSON[_0x05dc('0x21')](_0x23931c));_0x3312c3(_0x23931c);})['catch'](function(_0x1f6069){logger[_0x05dc('0x14')](_0x05dc('0x22'),_0x1f6069['message'],_0x1678e6);_0x1d8247(_0x4cda44['error'](0x1f4,_0x1f6069['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index accf5fe..fbcc764 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 _0x326f=['update','emit','removeListener','register','length','./squareProject.events'];(function(_0x48c773,_0x53c0c1){var _0x3c6175=function(_0x3d6fff){while(--_0x3d6fff){_0x48c773['push'](_0x48c773['shift']());}};_0x3c6175(++_0x53c0c1);}(_0x326f,0xd1));var _0xf326=function(_0x2152e3,_0x385386){_0x2152e3=_0x2152e3-0x0;var _0x37e367=_0x326f[_0x2152e3];return _0x37e367;};'use strict';var SquareProjectEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){SquareProjectEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('squareProject:'+_0x165f95,_0x3ace29);SquareProjectEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x814b=['removeListener','register','length','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x814b,0x1a2));var _0xb814=function(_0x595b9b,_0xa58ff){_0x595b9b=_0x595b9b-0x0;var _0x3be4c6=_0x814b[_0x595b9b];return _0x3be4c6;};'use strict';var SquareProjectEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){SquareProjectEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);SquareProjectEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 897a2af..9503f95 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 _0x827a=['index','/:id/download','post','/:id','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated'];(function(_0x132edb,_0x54e052){var _0x294aab=function(_0x3630cf){while(--_0x3630cf){_0x132edb['push'](_0x132edb['shift']());}};_0x294aab(++_0x54e052);}(_0x827a,0xd2));var _0xa827=function(_0x545f74,_0x58a6bf){_0x545f74=_0x545f74-0x0;var _0x4f7cd7=_0x827a[_0x545f74];return _0x4f7cd7;};'use strict';var multer=require(_0xa827('0x0'));var util=require(_0xa827('0x1'));var path=require(_0xa827('0x2'));var timeout=require(_0xa827('0x3'));var express=require(_0xa827('0x4'));var router=express['Router']();var auth=require(_0xa827('0x5'));var interaction=require(_0xa827('0x6'));var config=require(_0xa827('0x7'));var controller=require(_0xa827('0x8'));router[_0xa827('0x9')]('/',auth[_0xa827('0xa')](),controller[_0xa827('0xb')]);router[_0xa827('0x9')]('/:id',auth[_0xa827('0xa')](),controller['show']);router['get'](_0xa827('0xc'),auth[_0xa827('0xa')](),controller['download']);router[_0xa827('0xd')]('/',auth[_0xa827('0xa')](),controller['create']);router['put'](_0xa827('0xe'),auth['isAuthenticated'](),controller[_0xa827('0xf')]);router['delete']('/:id/delete',auth[_0xa827('0xa')](),controller[_0xa827('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0d9c=['./squareRecording.controller','index','get','/:id','isAuthenticated','show','/:id/download','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment'];(function(_0x3233c3,_0x15e5fa){var _0x36029b=function(_0xe3dd12){while(--_0xe3dd12){_0x3233c3['push'](_0x3233c3['shift']());}};_0x36029b(++_0x15e5fa);}(_0x0d9c,0x1e8));var _0xc0d9=function(_0xc0754,_0x37f107){_0xc0754=_0xc0754-0x0;var _0x195498=_0x0d9c[_0xc0754];return _0x195498;};'use strict';var multer=require(_0xc0d9('0x0'));var util=require(_0xc0d9('0x1'));var path=require('path');var timeout=require(_0xc0d9('0x2'));var express=require(_0xc0d9('0x3'));var router=express[_0xc0d9('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc0d9('0x5'));var controller=require(_0xc0d9('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc0d9('0x7')]);router[_0xc0d9('0x8')](_0xc0d9('0x9'),auth[_0xc0d9('0xa')](),controller[_0xc0d9('0xb')]);router['get'](_0xc0d9('0xc'),auth[_0xc0d9('0xa')](),controller['download']);router[_0xc0d9('0xd')]('/',auth[_0xc0d9('0xa')](),controller[_0xc0d9('0xe')]);router[_0xc0d9('0xf')](_0xc0d9('0x9'),auth['isAuthenticated'](),controller[_0xc0d9('0x10')]);router['delete']('/:id/delete',auth[_0xc0d9('0xa')](),controller[_0xc0d9('0x11')]);module[_0xc0d9('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 3011fc2..aa9c419 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 _0x36a5=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0x1aa0b4,_0xc215e){var _0x3a5a1e=function(_0x12edc1){while(--_0x12edc1){_0x1aa0b4['push'](_0x1aa0b4['shift']());}};_0x3a5a1e(++_0xc215e);}(_0x36a5,0xb4));var _0x536a=function(_0xf08d72,_0x131486){_0xf08d72=_0xf08d72-0x0;var _0x73a51=_0x36a5[_0xf08d72];return _0x73a51;};'use strict';var Sequelize=require(_0x536a('0x0'));module[_0x536a('0x1')]={'uniqueid':{'type':Sequelize[_0x536a('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x536a('0x2')]},'context':{'type':Sequelize[_0x536a('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x536a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x536a('0x2')]},'projectName':{'type':Sequelize[_0x536a('0x2')]},'saveName':{'type':Sequelize[_0x536a('0x2')]},'filename':{'type':Sequelize[_0x536a('0x2')]},'savePath':{'type':Sequelize[_0x536a('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x2da988='';var _0x320a10=this[_0x536a('0x3')](_0x536a('0x4'));if(_0x320a10){_0x2da988=_0x320a10['substring'](_0x320a10[_0x536a('0x5')]('.'));}return _0x2da988;}}}; \ No newline at end of file +var _0xbfc6=['getDataValue','savePath','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x205bf4,_0x47e37e){var _0x2e3c00=function(_0x4d7cfc){while(--_0x4d7cfc){_0x205bf4['push'](_0x205bf4['shift']());}};_0x2e3c00(++_0x47e37e);}(_0xbfc6,0xea));var _0x6bfc=function(_0x39def2,_0x5906f7){_0x39def2=_0x39def2-0x0;var _0xcc30fc=_0xbfc6[_0x39def2];return _0xcc30fc;};'use strict';var Sequelize=require(_0x6bfc('0x0'));module[_0x6bfc('0x1')]={'uniqueid':{'type':Sequelize[_0x6bfc('0x2')]},'callerid':{'type':Sequelize[_0x6bfc('0x2')]},'calleridname':{'type':Sequelize[_0x6bfc('0x2')]},'context':{'type':Sequelize[_0x6bfc('0x2')]},'extension':{'type':Sequelize[_0x6bfc('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x6bfc('0x2')]},'projectName':{'type':Sequelize[_0x6bfc('0x2')]},'saveName':{'type':Sequelize[_0x6bfc('0x2')]},'filename':{'type':Sequelize[_0x6bfc('0x2')]},'savePath':{'type':Sequelize[_0x6bfc('0x2')]},'format':{'type':Sequelize[_0x6bfc('0x3')],'get':function(){var _0x2e4e93='';var _0x274107=this[_0x6bfc('0x4')](_0x6bfc('0x5'));if(_0x274107){_0x2e4e93=_0x274107[_0x6bfc('0x6')](_0x274107['lastIndexOf']('.'));}return _0x2e4e93;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 25b9f7f..07e45cf 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 _0x39a2=['decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','existsSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','set','reject','update','then','destroy','status','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','show','keys','intersection','find','catch','create','body','download','../../components/encryptor','params','savePath','filename','format','%s.cypher'];(function(_0xfcd42c,_0x101856){var _0x374e59=function(_0x3dfb59){while(--_0x3dfb59){_0xfcd42c['push'](_0xfcd42c['shift']());}};_0x374e59(++_0x101856);}(_0x39a2,0x196));var _0x239a=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x39a2[_0x397cfb];return _0x15fed9;};'use strict';var pdf=require(_0x239a('0x0'));var emlformat=require(_0x239a('0x1'));var rimraf=require(_0x239a('0x2'));var zipdir=require(_0x239a('0x3'));var jsonpatch=require(_0x239a('0x4'));var rp=require('request-promise');var moment=require(_0x239a('0x5'));var BPromise=require(_0x239a('0x6'));var Mustache=require(_0x239a('0x7'));var util=require('util');var path=require(_0x239a('0x8'));var sox=require('sox');var csv=require(_0x239a('0x9'));var ejs=require(_0x239a('0xa'));var fs=require('fs');var _=require(_0x239a('0xb'));var squel=require(_0x239a('0xc'));var crypto=require(_0x239a('0xd'));var jsforce=require(_0x239a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x239a('0x9'));var querystring=require(_0x239a('0xf'));var Papa=require(_0x239a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x239a('0x11'));var as=require(_0x239a('0x12'));var hardwareService=require(_0x239a('0x13'));var logger=require(_0x239a('0x14'))(_0x239a('0x15'));var utils=require(_0x239a('0x16'));var config=require(_0x239a('0x17'));var db=require(_0x239a('0x18'))['db'];function respondWithStatusCode(_0x32552f,_0xe09bc7){_0xe09bc7=_0xe09bc7||0xcc;return function(_0x515339){if(_0x515339){return _0x32552f[_0x239a('0x19')](_0xe09bc7);}return _0x32552f['status'](_0xe09bc7)[_0x239a('0x1a')]();};}function respondWithResult(_0x4f8d25,_0x4cd1a7){_0x4cd1a7=_0x4cd1a7||0xc8;return function(_0x3e0cf8){if(_0x3e0cf8){return _0x4f8d25['status'](_0x4cd1a7)[_0x239a('0x1b')](_0x3e0cf8);}};}function respondWithFilteredResult(_0x446503,_0x32aca2){return function(_0x19b497){if(_0x19b497){var _0x43eead=_0x19b497[_0x239a('0x1c')],_0x181b23=_0x32aca2[_0x239a('0x1d')],_0x20a92b=_0x32aca2[_0x239a('0x1d')]+_0x32aca2['limit'],_0x310e63;if(_0x20a92b>=_0x43eead){_0x20a92b=_0x43eead;_0x310e63=0xc8;}else{_0x310e63=0xce;}_0x446503['status'](_0x310e63);return _0x446503[_0x239a('0x1e')]('Content-Range',_0x181b23+'-'+_0x20a92b+'/'+_0x43eead)[_0x239a('0x1b')](_0x19b497);}return null;};}function patchUpdates(_0x3679cb){return function(_0x3d6dd1){try{jsonpatch['apply'](_0x3d6dd1,_0x3679cb,!![]);}catch(_0x4c857e){return BPromise[_0x239a('0x1f')](_0x4c857e);}return _0x3d6dd1['save']();};}function saveUpdates(_0x2fa5f4,_0xa6e21f){return function(_0xe63e95){if(_0xe63e95){return _0xe63e95[_0x239a('0x20')](_0x2fa5f4)[_0x239a('0x21')](function(_0x303949){return _0x303949;});}return null;};}function removeEntity(_0x22103a,_0x7935e9){return function(_0x3603b6){if(_0x3603b6){return _0x3603b6[_0x239a('0x22')]()['then'](function(){_0x22103a[_0x239a('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19edec,_0x51c751){return function(_0x51f09b){if(!_0x51f09b){_0x19edec[_0x239a('0x19')](0x194);}return _0x51f09b;};}function handleError(_0x5a31f5,_0x366ff0){_0x366ff0=_0x366ff0||0x1f4;return function(_0x340a8c){logger[_0x239a('0x24')](_0x340a8c[_0x239a('0x25')]);if(_0x340a8c[_0x239a('0x26')]){delete _0x340a8c[_0x239a('0x26')];}_0x5a31f5[_0x239a('0x23')](_0x366ff0)[_0x239a('0x27')](_0x340a8c);};}exports[_0x239a('0x28')]=function(_0x2c1b58,_0x19641a){var _0x3c02bc={},_0x40170a={},_0x56b6de={'count':0x0,'rows':[]};var _0x3905be=_[_0x239a('0x29')](db[_0x239a('0x2a')][_0x239a('0x2b')],function(_0x3117cb){return{'name':_0x3117cb[_0x239a('0x2c')],'type':_0x3117cb[_0x239a('0x2d')]['key']};});_0x40170a[_0x239a('0x2e')]=_['map'](_0x3905be,_0x239a('0x26'));_0x40170a[_0x239a('0x2f')]=_['keys'](_0x2c1b58[_0x239a('0x2f')]);_0x40170a['filters']=_['intersection'](_0x40170a['model'],_0x40170a['query']);_0x3c02bc[_0x239a('0x30')]=_['intersection'](_0x40170a[_0x239a('0x2e')],qs[_0x239a('0x31')](_0x2c1b58[_0x239a('0x2f')][_0x239a('0x31')]));_0x3c02bc[_0x239a('0x30')]=_0x3c02bc[_0x239a('0x30')][_0x239a('0x32')]?_0x3c02bc[_0x239a('0x30')]:_0x40170a[_0x239a('0x2e')];if(!_0x2c1b58['query'][_0x239a('0x33')](_0x239a('0x34'))){_0x3c02bc[_0x239a('0x35')]=qs[_0x239a('0x35')](_0x2c1b58['query']['limit']);_0x3c02bc[_0x239a('0x1d')]=qs['offset'](_0x2c1b58[_0x239a('0x2f')]['offset']);}_0x3c02bc[_0x239a('0x36')]=qs[_0x239a('0x37')](_0x2c1b58['query'][_0x239a('0x37')]);_0x3c02bc[_0x239a('0x38')]=qs[_0x239a('0x39')](_[_0x239a('0x3a')](_0x2c1b58[_0x239a('0x2f')],_0x40170a[_0x239a('0x39')]));if(_0x2c1b58[_0x239a('0x2f')][_0x239a('0x3b')]){_0x3c02bc[_0x239a('0x38')]=_[_0x239a('0x3c')](_0x3c02bc[_0x239a('0x38')],{'$or':_['map'](_0x3905be,function(_0x27bb8b){if(_0x27bb8b['type']!==_0x239a('0x3d')){var _0x5f52c5={};_0x5f52c5[_0x27bb8b[_0x239a('0x26')]]={'$like':'%'+_0x2c1b58[_0x239a('0x2f')]['filter']+'%'};return _0x5f52c5;}})});}_0x3c02bc=_[_0x239a('0x3c')]({},_0x3c02bc,_0x2c1b58[_0x239a('0x3e')]);var _0x15c934={'where':_0x3c02bc['where']};return db[_0x239a('0x2a')][_0x239a('0x1c')](_0x15c934)[_0x239a('0x21')](function(_0x3f743e){_0x56b6de[_0x239a('0x1c')]=_0x3f743e;if(_0x2c1b58[_0x239a('0x2f')][_0x239a('0x3f')]){_0x3c02bc[_0x239a('0x40')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x3c02bc);})[_0x239a('0x21')](function(_0x2f6acc){_0x56b6de['rows']=_0x2f6acc;return _0x56b6de;})[_0x239a('0x21')](respondWithFilteredResult(_0x19641a,_0x3c02bc))['catch'](handleError(_0x19641a,null));};exports[_0x239a('0x41')]=function(_0x2bab51,_0x1eff1e){var _0x35dd7a={'raw':!![],'where':{'id':_0x2bab51['params']['id']}},_0xc799a8={};_0xc799a8[_0x239a('0x2e')]=_['keys'](db['SquareRecording'][_0x239a('0x2b')]);_0xc799a8[_0x239a('0x2f')]=_[_0x239a('0x42')](_0x2bab51[_0x239a('0x2f')]);_0xc799a8[_0x239a('0x39')]=_[_0x239a('0x43')](_0xc799a8['model'],_0xc799a8[_0x239a('0x2f')]);_0x35dd7a[_0x239a('0x30')]=_[_0x239a('0x43')](_0xc799a8[_0x239a('0x2e')],qs[_0x239a('0x31')](_0x2bab51[_0x239a('0x2f')][_0x239a('0x31')]));_0x35dd7a[_0x239a('0x30')]=_0x35dd7a[_0x239a('0x30')][_0x239a('0x32')]?_0x35dd7a['attributes']:_0xc799a8[_0x239a('0x2e')];if(_0x2bab51[_0x239a('0x2f')][_0x239a('0x3f')]){_0x35dd7a[_0x239a('0x40')]=[{'all':!![]}];}_0x35dd7a=_[_0x239a('0x3c')]({},_0x35dd7a,_0x2bab51[_0x239a('0x3e')]);return db['SquareRecording'][_0x239a('0x44')](_0x35dd7a)[_0x239a('0x21')](handleEntityNotFound(_0x1eff1e,null))['then'](respondWithResult(_0x1eff1e,null))[_0x239a('0x45')](handleError(_0x1eff1e,null));};exports[_0x239a('0x46')]=function(_0x4fd9ea,_0x19236f){return db[_0x239a('0x2a')][_0x239a('0x46')](_0x4fd9ea[_0x239a('0x47')],{})[_0x239a('0x21')](respondWithResult(_0x19236f,0xc9))[_0x239a('0x45')](handleError(_0x19236f,null));};exports[_0x239a('0x20')]=function(_0x5116d9,_0x2c6613){if(_0x5116d9[_0x239a('0x47')]['id']){delete _0x5116d9[_0x239a('0x47')]['id'];}return db[_0x239a('0x2a')][_0x239a('0x44')]({'where':{'id':_0x5116d9['params']['id']}})[_0x239a('0x21')](handleEntityNotFound(_0x2c6613,null))[_0x239a('0x21')](saveUpdates(_0x5116d9[_0x239a('0x47')],null))[_0x239a('0x21')](respondWithResult(_0x2c6613,null))[_0x239a('0x45')](handleError(_0x2c6613,null));};exports[_0x239a('0x48')]=function(_0x3b4d0,_0x25d282,_0x315a02){var _0x1bc5cd=require(_0x239a('0x49'));var _0x4aadfb=![];var _0x58fcf1={};if(_0x3b4d0[_0x239a('0x2f')]['type']&&_0x3b4d0['query'][_0x239a('0x2d')]==='uniqueid'){_0x58fcf1['uniqueid']=_0x3b4d0[_0x239a('0x4a')]['id'];}else{_0x58fcf1['id']=_0x3b4d0[_0x239a('0x4a')]['id'];}return db[_0x239a('0x2a')][_0x239a('0x44')]({'where':_0x58fcf1,'attributes':['id',_0x239a('0x4b'),_0x239a('0x4c')],'raw':!![]})[_0x239a('0x21')](handleEntityNotFound(_0x25d282,null))[_0x239a('0x21')](function(_0x9e5ab8){if(_0x9e5ab8){var _0x136025=_0x9e5ab8[_0x239a('0x4b')];var _0x5c4fac=util[_0x239a('0x4d')](_0x239a('0x4e'),_0x136025);if(fs['existsSync'](_0x5c4fac)){_0x4aadfb=!![];return _0x1bc5cd[_0x239a('0x4f')](_0x5c4fac,_0x136025,config[_0x239a('0x50')][_0x239a('0x51')])['then'](function(){return _0x9e5ab8;});}return _0x9e5ab8;}})[_0x239a('0x21')](function(_0x1374ff){if(_0x1374ff){var _0x5ea8d6=_0x1374ff['savePath'];if(!fs['existsSync'](_0x5ea8d6)){throw new db[(_0x239a('0x52'))][(_0x239a('0x53'))]('SquareRecording\x20not\x20found');}if(_0x1374ff['filename']){return _0x25d282[_0x239a('0x48')](_0x5ea8d6,_0x1374ff['filename']+path[_0x239a('0x54')](_0x5ea8d6),function(){if(_0x4aadfb){fs[_0x239a('0x55')](_0x5ea8d6);}});}else{return _0x25d282[_0x239a('0x48')](_0x5ea8d6,function(_0x819b3){if(_0x4aadfb){fs[_0x239a('0x55')](_0x5ea8d6);}});}}})[_0x239a('0x45')](function(_0x25de81){if(_0x25de81[_0x239a('0x56')]===_0x239a('0x57')){_0x25d282['status'](0x194)[_0x239a('0x27')](_0x239a('0x58'));}else{return handleError(_0x25d282,null);}});};exports[_0x239a('0x22')]=function(_0x3684fb,_0x14d689){return db[_0x239a('0x2a')]['find']({'where':{'id':_0x3684fb[_0x239a('0x4a')]['id']}})[_0x239a('0x21')](function(_0x5d8a5c){if(!_0x5d8a5c)throw new ReferenceError(_0x239a('0x59'));return _0x5d8a5c;})[_0x239a('0x21')](function(_0x45407f){var _0x27352d=_0x45407f[_0x239a('0x4b')];logger[_0x239a('0x5a')]('cancellazione\x20fisica\x20documento\x20%s',_0x27352d);if(!_[_0x239a('0x5b')](_0x45407f['savePath'])&&fs['existsSync'](_0x27352d)){logger['info'](_0x239a('0x5c')+_0x27352d+_0x239a('0x5d'));fs[_0x239a('0x5e')](_0x27352d);}_0x27352d=_0x27352d+_0x239a('0x5f');if(!_[_0x239a('0x5b')](_0x45407f['savePath'])&&fs[_0x239a('0x60')](_0x27352d)){logger[_0x239a('0x5a')](_0x239a('0x5c')+_0x27352d+_0x239a('0x5d'));fs[_0x239a('0x5e')](_0x27352d);}return _0x45407f;})[_0x239a('0x21')](function(_0x396961){if(!_0x396961)throw new InternalError();return _0x396961[_0x239a('0x22')]();})[_0x239a('0x21')](function(){_0x14d689[_0x239a('0x23')](0xcc)['end']();})['catch'](handleError(_0x14d689,null));}; \ No newline at end of file +var _0x259c=['map','SquareRecording','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','download','../../components/encryptor','uniqueid','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','end','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','squel','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x259c,0x89));var _0xc259=function(_0xddf136,_0x1974ad){_0xddf136=_0xddf136-0x0;var _0x16e835=_0x259c[_0xddf136];return _0x16e835;};'use strict';var pdf=require(_0xc259('0x0'));var emlformat=require(_0xc259('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc259('0x2'));var jsonpatch=require(_0xc259('0x3'));var rp=require(_0xc259('0x4'));var moment=require(_0xc259('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc259('0x6'));var util=require('util');var path=require(_0xc259('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc259('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc259('0x9'));var toCsv=require(_0xc259('0xa'));var querystring=require(_0xc259('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc259('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc259('0xd'));var logger=require(_0xc259('0xe'))('api');var utils=require(_0xc259('0xf'));var config=require(_0xc259('0x10'));var db=require(_0xc259('0x11'))['db'];function respondWithStatusCode(_0x3418ea,_0x3134de){_0x3134de=_0x3134de||0xcc;return function(_0x18a6ba){if(_0x18a6ba){return _0x3418ea[_0xc259('0x12')](_0x3134de);}return _0x3418ea[_0xc259('0x13')](_0x3134de)['end']();};}function respondWithResult(_0x3c341e,_0x1ab7de){_0x1ab7de=_0x1ab7de||0xc8;return function(_0x532f3e){if(_0x532f3e){return _0x3c341e[_0xc259('0x13')](_0x1ab7de)['json'](_0x532f3e);}};}function respondWithFilteredResult(_0x38af04,_0x16a99b){return function(_0x391fc1){if(_0x391fc1){var _0xcb5372=_0x391fc1[_0xc259('0x14')],_0x4d6d5c=_0x16a99b['offset'],_0x127484=_0x16a99b[_0xc259('0x15')]+_0x16a99b[_0xc259('0x16')],_0x46c0e9;if(_0x127484>=_0xcb5372){_0x127484=_0xcb5372;_0x46c0e9=0xc8;}else{_0x46c0e9=0xce;}_0x38af04[_0xc259('0x13')](_0x46c0e9);return _0x38af04[_0xc259('0x17')](_0xc259('0x18'),_0x4d6d5c+'-'+_0x127484+'/'+_0xcb5372)['json'](_0x391fc1);}return null;};}function patchUpdates(_0x5ee8d0){return function(_0x424cbe){try{jsonpatch[_0xc259('0x19')](_0x424cbe,_0x5ee8d0,!![]);}catch(_0x293664){return BPromise['reject'](_0x293664);}return _0x424cbe['save']();};}function saveUpdates(_0x376fbd,_0x5525bc){return function(_0x453552){if(_0x453552){return _0x453552[_0xc259('0x1a')](_0x376fbd)['then'](function(_0x15f088){return _0x15f088;});}return null;};}function removeEntity(_0x31e55b,_0x3f6956){return function(_0x4e1d4f){if(_0x4e1d4f){return _0x4e1d4f[_0xc259('0x1b')]()[_0xc259('0x1c')](function(){_0x31e55b[_0xc259('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b7da0,_0x9dc29e){return function(_0x1de612){if(!_0x1de612){_0x5b7da0['sendStatus'](0x194);}return _0x1de612;};}function handleError(_0x89815f,_0x4ca085){_0x4ca085=_0x4ca085||0x1f4;return function(_0x3100d1){logger[_0xc259('0x1d')](_0x3100d1[_0xc259('0x1e')]);if(_0x3100d1[_0xc259('0x1f')]){delete _0x3100d1[_0xc259('0x1f')];}_0x89815f[_0xc259('0x13')](_0x4ca085)[_0xc259('0x20')](_0x3100d1);};}exports['index']=function(_0x310ea8,_0x5560cd){var _0x31a59f={},_0x3b7673={},_0x56534e={'count':0x0,'rows':[]};var _0x34a7a0=_[_0xc259('0x21')](db[_0xc259('0x22')]['rawAttributes'],function(_0x149e3e){return{'name':_0x149e3e[_0xc259('0x23')],'type':_0x149e3e[_0xc259('0x24')][_0xc259('0x25')]};});_0x3b7673[_0xc259('0x26')]=_['map'](_0x34a7a0,'name');_0x3b7673[_0xc259('0x27')]=_['keys'](_0x310ea8[_0xc259('0x27')]);_0x3b7673[_0xc259('0x28')]=_[_0xc259('0x29')](_0x3b7673[_0xc259('0x26')],_0x3b7673[_0xc259('0x27')]);_0x31a59f[_0xc259('0x2a')]=_[_0xc259('0x29')](_0x3b7673[_0xc259('0x26')],qs[_0xc259('0x2b')](_0x310ea8[_0xc259('0x27')][_0xc259('0x2b')]));_0x31a59f['attributes']=_0x31a59f[_0xc259('0x2a')]['length']?_0x31a59f[_0xc259('0x2a')]:_0x3b7673[_0xc259('0x26')];if(!_0x310ea8[_0xc259('0x27')][_0xc259('0x2c')]('nolimit')){_0x31a59f[_0xc259('0x16')]=qs['limit'](_0x310ea8[_0xc259('0x27')][_0xc259('0x16')]);_0x31a59f[_0xc259('0x15')]=qs[_0xc259('0x15')](_0x310ea8[_0xc259('0x27')][_0xc259('0x15')]);}_0x31a59f['order']=qs[_0xc259('0x2d')](_0x310ea8[_0xc259('0x27')]['sort']);_0x31a59f[_0xc259('0x2e')]=qs[_0xc259('0x28')](_['pick'](_0x310ea8[_0xc259('0x27')],_0x3b7673['filters']));if(_0x310ea8['query'][_0xc259('0x2f')]){_0x31a59f[_0xc259('0x2e')]=_[_0xc259('0x30')](_0x31a59f['where'],{'$or':_[_0xc259('0x21')](_0x34a7a0,function(_0x287f1f){if(_0x287f1f[_0xc259('0x24')]!=='VIRTUAL'){var _0x53b5ae={};_0x53b5ae[_0x287f1f[_0xc259('0x1f')]]={'$like':'%'+_0x310ea8[_0xc259('0x27')][_0xc259('0x2f')]+'%'};return _0x53b5ae;}})});}_0x31a59f=_['merge']({},_0x31a59f,_0x310ea8[_0xc259('0x31')]);var _0x4d687d={'where':_0x31a59f['where']};return db[_0xc259('0x22')][_0xc259('0x14')](_0x4d687d)[_0xc259('0x1c')](function(_0x42a1e0){_0x56534e[_0xc259('0x14')]=_0x42a1e0;if(_0x310ea8[_0xc259('0x27')][_0xc259('0x32')]){_0x31a59f[_0xc259('0x33')]=[{'all':!![]}];}return db[_0xc259('0x22')][_0xc259('0x34')](_0x31a59f);})[_0xc259('0x1c')](function(_0x15fd65){_0x56534e[_0xc259('0x35')]=_0x15fd65;return _0x56534e;})[_0xc259('0x1c')](respondWithFilteredResult(_0x5560cd,_0x31a59f))[_0xc259('0x36')](handleError(_0x5560cd,null));};exports[_0xc259('0x37')]=function(_0x1d1393,_0x4ff3df){var _0x13c24c={'raw':!![],'where':{'id':_0x1d1393[_0xc259('0x38')]['id']}},_0x1d8996={};_0x1d8996['model']=_[_0xc259('0x39')](db['SquareRecording'][_0xc259('0x3a')]);_0x1d8996[_0xc259('0x27')]=_[_0xc259('0x39')](_0x1d1393['query']);_0x1d8996[_0xc259('0x28')]=_[_0xc259('0x29')](_0x1d8996[_0xc259('0x26')],_0x1d8996[_0xc259('0x27')]);_0x13c24c[_0xc259('0x2a')]=_[_0xc259('0x29')](_0x1d8996[_0xc259('0x26')],qs['fields'](_0x1d1393[_0xc259('0x27')][_0xc259('0x2b')]));_0x13c24c['attributes']=_0x13c24c[_0xc259('0x2a')]['length']?_0x13c24c[_0xc259('0x2a')]:_0x1d8996[_0xc259('0x26')];if(_0x1d1393['query']['includeAll']){_0x13c24c[_0xc259('0x33')]=[{'all':!![]}];}_0x13c24c=_[_0xc259('0x30')]({},_0x13c24c,_0x1d1393[_0xc259('0x31')]);return db[_0xc259('0x22')][_0xc259('0x3b')](_0x13c24c)[_0xc259('0x1c')](handleEntityNotFound(_0x4ff3df,null))[_0xc259('0x1c')](respondWithResult(_0x4ff3df,null))[_0xc259('0x36')](handleError(_0x4ff3df,null));};exports['create']=function(_0x146ac2,_0x3358b7){return db['SquareRecording'][_0xc259('0x3c')](_0x146ac2[_0xc259('0x3d')],{})[_0xc259('0x1c')](respondWithResult(_0x3358b7,0xc9))[_0xc259('0x36')](handleError(_0x3358b7,null));};exports[_0xc259('0x1a')]=function(_0x2080af,_0x400cb9){if(_0x2080af[_0xc259('0x3d')]['id']){delete _0x2080af[_0xc259('0x3d')]['id'];}return db[_0xc259('0x22')][_0xc259('0x3b')]({'where':{'id':_0x2080af['params']['id']}})[_0xc259('0x1c')](handleEntityNotFound(_0x400cb9,null))['then'](saveUpdates(_0x2080af[_0xc259('0x3d')],null))[_0xc259('0x1c')](respondWithResult(_0x400cb9,null))[_0xc259('0x36')](handleError(_0x400cb9,null));};exports[_0xc259('0x3e')]=function(_0x3299d2,_0x5bb8d3,_0x28ff25){var _0x52b4c3=require(_0xc259('0x3f'));var _0x4ae32c=![];var _0x35a6c6={};if(_0x3299d2['query'][_0xc259('0x24')]&&_0x3299d2['query'][_0xc259('0x24')]===_0xc259('0x40')){_0x35a6c6[_0xc259('0x40')]=_0x3299d2[_0xc259('0x38')]['id'];}else{_0x35a6c6['id']=_0x3299d2['params']['id'];}return db['SquareRecording'][_0xc259('0x3b')]({'where':_0x35a6c6,'attributes':['id',_0xc259('0x41'),'filename'],'raw':!![]})[_0xc259('0x1c')](handleEntityNotFound(_0x5bb8d3,null))[_0xc259('0x1c')](function(_0xee126d){if(_0xee126d){var _0x3211eb=_0xee126d[_0xc259('0x41')];var _0x241f2d=util['format'](_0xc259('0x42'),_0x3211eb);if(fs[_0xc259('0x43')](_0x241f2d)){_0x4ae32c=!![];return _0x52b4c3[_0xc259('0x44')](_0x241f2d,_0x3211eb,config[_0xc259('0x45')][_0xc259('0x46')])[_0xc259('0x1c')](function(){return _0xee126d;});}return _0xee126d;}})[_0xc259('0x1c')](function(_0x5f5388){if(_0x5f5388){var _0x318b37=_0x5f5388[_0xc259('0x41')];if(!fs[_0xc259('0x43')](_0x318b37)){throw new db[(_0xc259('0x47'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x5f5388[_0xc259('0x48')]){return _0x5bb8d3[_0xc259('0x3e')](_0x318b37,_0x5f5388[_0xc259('0x48')]+path[_0xc259('0x49')](_0x318b37),function(){if(_0x4ae32c){fs['unlink'](_0x318b37);}});}else{return _0x5bb8d3[_0xc259('0x3e')](_0x318b37,function(_0x31c392){if(_0x4ae32c){fs[_0xc259('0x4a')](_0x318b37);}});}}})[_0xc259('0x36')](function(_0x3158db){if(_0x3158db[_0xc259('0x4b')]==='SquareRecording\x20not\x20found'){_0x5bb8d3['status'](0x194)[_0xc259('0x20')]('Not\x20found');}else{return handleError(_0x5bb8d3,null);}});};exports[_0xc259('0x1b')]=function(_0x4f3485,_0x5456de){return db['SquareRecording'][_0xc259('0x3b')]({'where':{'id':_0x4f3485[_0xc259('0x38')]['id']}})[_0xc259('0x1c')](function(_0x2c40f0){if(!_0x2c40f0)throw new ReferenceError(_0xc259('0x4c'));return _0x2c40f0;})[_0xc259('0x1c')](function(_0x1aea9f){var _0x2c1223=_0x1aea9f[_0xc259('0x41')];logger['info'](_0xc259('0x4d'),_0x2c1223);if(!_[_0xc259('0x4e')](_0x1aea9f['savePath'])&&fs[_0xc259('0x43')](_0x2c1223)){logger[_0xc259('0x4f')](_0xc259('0x50')+_0x2c1223+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc259('0x51')](_0x2c1223);}_0x2c1223=_0x2c1223+_0xc259('0x52');if(!_[_0xc259('0x4e')](_0x1aea9f['savePath'])&&fs[_0xc259('0x43')](_0x2c1223)){logger['info'](_0xc259('0x50')+_0x2c1223+_0xc259('0x53'));fs[_0xc259('0x51')](_0x2c1223);}return _0x1aea9f;})[_0xc259('0x1c')](function(_0x2f7c55){if(!_0x2f7c55)throw new InternalError();return _0x2f7c55['destroy']();})[_0xc259('0x1c')](function(){_0x5456de[_0xc259('0x13')](0xcc)[_0xc259('0x54')]();})[_0xc259('0x36')](handleError(_0x5456de,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 9160090..36695e1 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 _0x69d4=['util','api','moment','bluebird','path','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash'];(function(_0xffeb23,_0x2085be){var _0x135dc1=function(_0x47209a){while(--_0x47209a){_0xffeb23['push'](_0xffeb23['shift']());}};_0x135dc1(++_0x2085be);}(_0x69d4,0x83));var _0x469d=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0x69d4[_0x3efe87];return _0x56a4cc;};'use strict';var _=require(_0x469d('0x0'));var util=require(_0x469d('0x1'));var logger=require('../../config/logger')(_0x469d('0x2'));var moment=require(_0x469d('0x3'));var BPromise=require(_0x469d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x469d('0x5'));var rimraf=require('rimraf');var config=require(_0x469d('0x6'));var attributes=require(_0x469d('0x7'));module[_0x469d('0x8')]=function(_0x336101,_0x3d0ec8){return _0x336101[_0x469d('0x9')]('SquareRecording',attributes,{'tableName':_0x469d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06ef=['path','rimraf','../../config/environment','exports','../../config/logger'];(function(_0x118f05,_0x182ae9){var _0x56cb10=function(_0x5c902c){while(--_0x5c902c){_0x118f05['push'](_0x118f05['shift']());}};_0x56cb10(++_0x182ae9);}(_0x06ef,0x185));var _0xf06e=function(_0x27d616,_0x251ce7){_0x27d616=_0x27d616-0x0;var _0xcd15e7=_0x06ef[_0x27d616];return _0xcd15e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf06e('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf06e('0x1'));var rimraf=require(_0xf06e('0x2'));var config=require(_0xf06e('0x3'));var attributes=require('./squareRecording.attributes');module[_0xf06e('0x4')]=function(_0x71a36,_0x4be428){return _0x71a36['define']('SquareRecording',attributes,{'tableName':'square_recordings','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 3f50ee1..8b8c154 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 _0xf21d=['SquareRecording','create','options','raw','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','stringify','error','SquareRecording,\x20%s,\x20%s','message','catch','CreateSquareRecording'];(function(_0x1a2fa5,_0x1770c8){var _0x4eb2f2=function(_0x57da36){while(--_0x57da36){_0x1a2fa5['push'](_0x1a2fa5['shift']());}};_0x4eb2f2(++_0x1770c8);}(_0xf21d,0x101));var _0xdf21=function(_0x113892,_0x3db946){_0x113892=_0x113892-0x0;var _0x1d9bd7=_0xf21d[_0x113892];return _0x1d9bd7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xdf21('0x0'));var rs=require(_0xdf21('0x1'));var fs=require('fs');var Redis=require(_0xdf21('0x2'));var db=require(_0xdf21('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf21('0x4'))(_0xdf21('0x5'));var config=require(_0xdf21('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdf21('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x500c8c,_0x486241,_0x3e1966){return new BPromise(function(_0x55c51b,_0x3b96db){return client[_0xdf21('0x8')](_0x500c8c,_0x3e1966)[_0xdf21('0x9')](function(_0x2f4c9e){logger[_0xdf21('0xa')]('SquareRecording,\x20%s,\x20%s',_0x486241,_0xdf21('0xb'));logger[_0xdf21('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x486241,_0xdf21('0xb'),JSON[_0xdf21('0xd')](_0x2f4c9e));if(_0x2f4c9e[_0xdf21('0xe')]){if(_0x2f4c9e[_0xdf21('0xe')]['code']===0x1f4){logger[_0xdf21('0xe')](_0xdf21('0xf'),_0x486241,_0x2f4c9e[_0xdf21('0xe')][_0xdf21('0x10')]);return _0x3b96db(_0x2f4c9e[_0xdf21('0xe')][_0xdf21('0x10')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x486241,_0x2f4c9e[_0xdf21('0xe')][_0xdf21('0x10')]);return _0x55c51b(_0x2f4c9e[_0xdf21('0xe')][_0xdf21('0x10')]);}else{logger['info'](_0xdf21('0xf'),_0x486241,_0xdf21('0xb'));_0x55c51b(_0x2f4c9e['result'][_0xdf21('0x10')]);}})[_0xdf21('0x11')](function(_0x52002c){logger[_0xdf21('0xe')]('SquareRecording,\x20%s,\x20%s',_0x486241,_0x52002c);_0x3b96db(_0x52002c);});});}exports[_0xdf21('0x12')]=function(_0x492369){var _0x20a726=this;return new Promise(function(_0x5724a,_0x135b3e){return db[_0xdf21('0x13')][_0xdf21('0x14')](_0x492369['body'],{'raw':_0x492369[_0xdf21('0x15')]?_0x492369[_0xdf21('0x15')][_0xdf21('0x16')]===undefined?!![]:![]:!![]})[_0xdf21('0x9')](function(_0x2d746c){logger[_0xdf21('0xa')](_0xdf21('0x12'),_0x492369);logger[_0xdf21('0xc')](_0xdf21('0x12'),_0x492369,JSON['stringify'](_0x2d746c));_0x5724a(_0x2d746c);})['catch'](function(_0x1ae53b){logger[_0xdf21('0xe')]('CreateSquareRecording',_0x1ae53b[_0xdf21('0x10')],_0x492369);_0x135b3e(_0x20a726[_0xdf21('0xe')](0x1f4,_0x1ae53b['message']));});});}; \ No newline at end of file +var _0xa4d0=['raw','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','options'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xa4d0,0xfb));var _0x0a4d=function(_0x5d52fe,_0x1b80d9){_0x5d52fe=_0x5d52fe-0x0;var _0x45a6da=_0xa4d0[_0x5d52fe];return _0x45a6da;};'use strict';var _=require(_0x0a4d('0x0'));var util=require(_0x0a4d('0x1'));var moment=require(_0x0a4d('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a4d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0a4d('0x4'));var logger=require(_0x0a4d('0x5'))(_0x0a4d('0x6'));var config=require(_0x0a4d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0a4d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x111d97,_0x1ddfb2,_0x44809c){return new BPromise(function(_0x363cea,_0x9f9c17){return client[_0x0a4d('0x9')](_0x111d97,_0x44809c)[_0x0a4d('0xa')](function(_0x2f2362){logger[_0x0a4d('0xb')](_0x0a4d('0xc'),_0x1ddfb2,_0x0a4d('0xd'));logger[_0x0a4d('0xe')](_0x0a4d('0xf'),_0x1ddfb2,_0x0a4d('0xd'),JSON[_0x0a4d('0x10')](_0x2f2362));if(_0x2f2362['error']){if(_0x2f2362[_0x0a4d('0x11')][_0x0a4d('0x12')]===0x1f4){logger[_0x0a4d('0x11')](_0x0a4d('0xc'),_0x1ddfb2,_0x2f2362['error'][_0x0a4d('0x13')]);return _0x9f9c17(_0x2f2362['error'][_0x0a4d('0x13')]);}logger['error'](_0x0a4d('0xc'),_0x1ddfb2,_0x2f2362[_0x0a4d('0x11')][_0x0a4d('0x13')]);return _0x363cea(_0x2f2362[_0x0a4d('0x11')][_0x0a4d('0x13')]);}else{logger[_0x0a4d('0xb')](_0x0a4d('0xc'),_0x1ddfb2,_0x0a4d('0xd'));_0x363cea(_0x2f2362[_0x0a4d('0x14')]['message']);}})[_0x0a4d('0x15')](function(_0x2f8a80){logger['error']('SquareRecording,\x20%s,\x20%s',_0x1ddfb2,_0x2f8a80);_0x9f9c17(_0x2f8a80);});});}exports[_0x0a4d('0x16')]=function(_0x3ee5e6){var _0x29d661=this;return new Promise(function(_0x5e9e7d,_0x2326e7){return db['SquareRecording']['create'](_0x3ee5e6['body'],{'raw':_0x3ee5e6[_0x0a4d('0x17')]?_0x3ee5e6['options'][_0x0a4d('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1bd508){logger['info'](_0x0a4d('0x16'),_0x3ee5e6);logger['debug']('CreateSquareRecording',_0x3ee5e6,JSON['stringify'](_0x1bd508));_0x5e9e7d(_0x1bd508);})[_0x0a4d('0x15')](function(_0x29561b){logger[_0x0a4d('0x11')](_0x0a4d('0x16'),_0x29561b[_0x0a4d('0x13')],_0x3ee5e6);_0x2326e7(_0x29d661[_0x0a4d('0x11')](0x1f4,_0x29561b[_0x0a4d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 31dcb81..520b138 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 _0x6eed=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x564161,_0x1a1884){var _0x30786b=function(_0x209ad7){while(--_0x209ad7){_0x564161['push'](_0x564161['shift']());}};_0x30786b(++_0x1a1884);}(_0x6eed,0x198));var _0xd6ee=function(_0x7097e8,_0x53e913){_0x7097e8=_0x7097e8-0x0;var _0x212772=_0x6eed[_0x7097e8];return _0x212772;};'use strict';var multer=require(_0xd6ee('0x0'));var util=require(_0xd6ee('0x1'));var path=require(_0xd6ee('0x2'));var timeout=require(_0xd6ee('0x3'));var express=require(_0xd6ee('0x4'));var router=express[_0xd6ee('0x5')]();var auth=require(_0xd6ee('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd6ee('0x7'));var controller=require('./squareReport.controller');router[_0xd6ee('0x8')]('/',auth[_0xd6ee('0x9')](),controller[_0xd6ee('0xa')]);router['get'](_0xd6ee('0xb'),auth[_0xd6ee('0x9')](),controller['describe']);router[_0xd6ee('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd6ee('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd6ee('0xd'),auth[_0xd6ee('0x9')](),controller[_0xd6ee('0xe')]);router[_0xd6ee('0xf')](_0xd6ee('0xd'),auth['isAuthenticated'](),controller[_0xd6ee('0x10')]);module[_0xd6ee('0x11')]=router; \ No newline at end of file +var _0xf512=['get','/:id','show','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','isAuthenticated','index','describe'];(function(_0x41614a,_0x167ef0){var _0x543bf9=function(_0x7cb10b){while(--_0x7cb10b){_0x41614a['push'](_0x41614a['shift']());}};_0x543bf9(++_0x167ef0);}(_0xf512,0x124));var _0x2f51=function(_0x2e4733,_0x1a717f){_0x2e4733=_0x2e4733-0x0;var _0x4a5958=_0xf512[_0x2e4733];return _0x4a5958;};'use strict';var multer=require(_0x2f51('0x0'));var util=require(_0x2f51('0x1'));var path=require('path');var timeout=require(_0x2f51('0x2'));var express=require(_0x2f51('0x3'));var router=express[_0x2f51('0x4')]();var auth=require(_0x2f51('0x5'));var interaction=require(_0x2f51('0x6'));var config=require(_0x2f51('0x7'));var controller=require(_0x2f51('0x8'));router['get']('/',auth[_0x2f51('0x9')](),controller[_0x2f51('0xa')]);router['get']('/describe',auth[_0x2f51('0x9')](),controller[_0x2f51('0xb')]);router[_0x2f51('0xc')](_0x2f51('0xd'),auth[_0x2f51('0x9')](),controller[_0x2f51('0xe')]);router['post']('/',auth[_0x2f51('0x9')](),controller[_0x2f51('0xf')]);router['put'](_0x2f51('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2f51('0x10')](_0x2f51('0xd'),auth[_0x2f51('0x9')](),controller[_0x2f51('0x11')]);module[_0x2f51('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index bd6762e..205e02a 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 _0x5b0e=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2e5263,_0x12f055){var _0x4fd55d=function(_0x2d2a3c){while(--_0x2d2a3c){_0x2e5263['push'](_0x2e5263['shift']());}};_0x4fd55d(++_0x12f055);}(_0x5b0e,0x112));var _0xe5b0=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x5b0e[_0x133277];return _0x5b4a22;};'use strict';var Sequelize=require(_0xe5b0('0x0'));module[_0xe5b0('0x1')]={'network':{'type':Sequelize[_0xe5b0('0x2')]},'network_script':{'type':Sequelize[_0xe5b0('0x2')]},'request':{'type':Sequelize[_0xe5b0('0x2')]},'channel':{'type':Sequelize[_0xe5b0('0x2')]},'language':{'type':Sequelize[_0xe5b0('0x2')]},'type':{'type':Sequelize[_0xe5b0('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xe5b0('0x2')]},'callerid':{'type':Sequelize[_0xe5b0('0x2')]},'calleridname':{'type':Sequelize[_0xe5b0('0x2')]},'callingpres':{'type':Sequelize[_0xe5b0('0x2')]},'callingani2':{'type':Sequelize[_0xe5b0('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xe5b0('0x2')]},'dnid':{'type':Sequelize[_0xe5b0('0x2')]},'rdnis':{'type':Sequelize[_0xe5b0('0x2')]},'context':{'type':Sequelize[_0xe5b0('0x2')]},'extension':{'type':Sequelize[_0xe5b0('0x2')]},'priority':{'type':Sequelize[_0xe5b0('0x2')]},'enhanced':{'type':Sequelize[_0xe5b0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xe5b0('0x2')]},'joinAt':{'type':Sequelize[_0xe5b0('0x3')]},'leaveAt':{'type':Sequelize[_0xe5b0('0x3')]},'bot':{'type':Sequelize[_0xe5b0('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x2913=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2913,0xb0));var _0x3291=function(_0x5d8631,_0xde17e7){_0x5d8631=_0x5d8631-0x0;var _0x2d789=_0x2913[_0x5d8631];return _0x2d789;};'use strict';var Sequelize=require(_0x3291('0x0'));module[_0x3291('0x1')]={'network':{'type':Sequelize[_0x3291('0x2')]},'network_script':{'type':Sequelize[_0x3291('0x2')]},'request':{'type':Sequelize[_0x3291('0x2')]},'channel':{'type':Sequelize[_0x3291('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3291('0x2')]},'version':{'type':Sequelize[_0x3291('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3291('0x2')]},'callingpres':{'type':Sequelize[_0x3291('0x2')]},'callingani2':{'type':Sequelize[_0x3291('0x2')]},'callington':{'type':Sequelize[_0x3291('0x2')]},'callingtns':{'type':Sequelize[_0x3291('0x2')]},'dnid':{'type':Sequelize[_0x3291('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3291('0x2')]},'extension':{'type':Sequelize[_0x3291('0x2')]},'priority':{'type':Sequelize[_0x3291('0x2')]},'enhanced':{'type':Sequelize[_0x3291('0x2')]},'accountcode':{'type':Sequelize[_0x3291('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x3291('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x3291('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 8efe047..3742be1 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 _0xe14b=['findAll','rows','catch','find','create','body','params','destroy','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','update','then','error','stack','name','index','SquareReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x3ea232,_0x311883){var _0x39af05=function(_0x5b5c6d){while(--_0x5b5c6d){_0x3ea232['push'](_0x3ea232['shift']());}};_0x39af05(++_0x311883);}(_0xe14b,0x93));var _0xbe14=function(_0x314baf,_0x5c648d){_0x314baf=_0x314baf-0x0;var _0x1d7d5e=_0xe14b[_0x314baf];return _0x1d7d5e;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];function respondWithStatusCode(_0x3d38c2,_0x27792f){_0x27792f=_0x27792f||0xcc;return function(_0x3b898d){if(_0x3b898d){return _0x3d38c2[_0xbe14('0x15')](_0x27792f);}return _0x3d38c2[_0xbe14('0x16')](_0x27792f)[_0xbe14('0x17')]();};}function respondWithResult(_0xa2cf72,_0x1e4826){_0x1e4826=_0x1e4826||0xc8;return function(_0x33fd54){if(_0x33fd54){return _0xa2cf72[_0xbe14('0x16')](_0x1e4826)['json'](_0x33fd54);}};}function respondWithFilteredResult(_0x55b3a7,_0x3f58f5){return function(_0x3dc4a9){if(_0x3dc4a9){var _0xf4ac9=_0x3dc4a9[_0xbe14('0x18')],_0x37ce4e=_0x3f58f5[_0xbe14('0x19')],_0x4e8f34=_0x3f58f5[_0xbe14('0x19')]+_0x3f58f5[_0xbe14('0x1a')],_0x21c789;if(_0x4e8f34>=_0xf4ac9){_0x4e8f34=_0xf4ac9;_0x21c789=0xc8;}else{_0x21c789=0xce;}_0x55b3a7[_0xbe14('0x16')](_0x21c789);return _0x55b3a7[_0xbe14('0x1b')]('Content-Range',_0x37ce4e+'-'+_0x4e8f34+'/'+_0xf4ac9)[_0xbe14('0x1c')](_0x3dc4a9);}return null;};}function patchUpdates(_0x456ca8){return function(_0x329588){try{jsonpatch[_0xbe14('0x1d')](_0x329588,_0x456ca8,!![]);}catch(_0x3249da){return BPromise[_0xbe14('0x1e')](_0x3249da);}return _0x329588['save']();};}function saveUpdates(_0x24f820,_0x4a1bbd){return function(_0x417c8d){if(_0x417c8d){return _0x417c8d[_0xbe14('0x1f')](_0x24f820)[_0xbe14('0x20')](function(_0x51dc0b){return _0x51dc0b;});}return null;};}function removeEntity(_0xe60f42,_0x56d845){return function(_0x3c1c85){if(_0x3c1c85){return _0x3c1c85['destroy']()[_0xbe14('0x20')](function(){_0xe60f42['status'](0xcc)[_0xbe14('0x17')]();});}};}function handleEntityNotFound(_0x3d3608,_0x505dbd){return function(_0x2da350){if(!_0x2da350){_0x3d3608['sendStatus'](0x194);}return _0x2da350;};}function handleError(_0x4587a8,_0x4851f8){_0x4851f8=_0x4851f8||0x1f4;return function(_0x36a21e){logger[_0xbe14('0x21')](_0x36a21e[_0xbe14('0x22')]);if(_0x36a21e[_0xbe14('0x23')]){delete _0x36a21e[_0xbe14('0x23')];}_0x4587a8[_0xbe14('0x16')](_0x4851f8)['send'](_0x36a21e);};}exports[_0xbe14('0x24')]=function(_0x1ba46a,_0x391556){var _0x169369={},_0x5dd475={},_0x16f884={'count':0x0,'rows':[]};var _0x29fc64=_['map'](db[_0xbe14('0x25')][_0xbe14('0x26')],function(_0x1c7cc7){return{'name':_0x1c7cc7[_0xbe14('0x27')],'type':_0x1c7cc7[_0xbe14('0x28')][_0xbe14('0x29')]};});_0x5dd475[_0xbe14('0x2a')]=_[_0xbe14('0x2b')](_0x29fc64,_0xbe14('0x23'));_0x5dd475[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](_0x1ba46a[_0xbe14('0x2c')]);_0x5dd475[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],_0x5dd475[_0xbe14('0x2c')]);_0x169369[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],qs[_0xbe14('0x31')](_0x1ba46a['query'][_0xbe14('0x31')]));_0x169369['attributes']=_0x169369['attributes'][_0xbe14('0x32')]?_0x169369['attributes']:_0x5dd475[_0xbe14('0x2a')];if(!_0x1ba46a[_0xbe14('0x2c')]['hasOwnProperty']('nolimit')){_0x169369['limit']=qs[_0xbe14('0x1a')](_0x1ba46a[_0xbe14('0x2c')]['limit']);_0x169369[_0xbe14('0x19')]=qs[_0xbe14('0x19')](_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x19')]);}_0x169369[_0xbe14('0x33')]=qs['sort'](_0x1ba46a['query'][_0xbe14('0x34')]);_0x169369['where']=qs['filters'](_['pick'](_0x1ba46a[_0xbe14('0x2c')],_0x5dd475[_0xbe14('0x2e')]));if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x35')]){_0x169369[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x169369[_0xbe14('0x36')],{'$or':_[_0xbe14('0x2b')](_0x29fc64,function(_0x2d9c12){if(_0x2d9c12[_0xbe14('0x28')]!==_0xbe14('0x38')){var _0x32c59d={};_0x32c59d[_0x2d9c12['name']]={'$like':'%'+_0x1ba46a['query'][_0xbe14('0x35')]+'%'};return _0x32c59d;}})});}_0x169369=_[_0xbe14('0x37')]({},_0x169369,_0x1ba46a[_0xbe14('0x39')]);var _0x520e09={'where':_0x169369[_0xbe14('0x36')]};return db[_0xbe14('0x25')][_0xbe14('0x18')](_0x520e09)[_0xbe14('0x20')](function(_0x3bd454){_0x16f884[_0xbe14('0x18')]=_0x3bd454;if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x3a')]){_0x169369[_0xbe14('0x3b')]=[{'all':!![]}];}return db['SquareReport'][_0xbe14('0x3c')](_0x169369);})[_0xbe14('0x20')](function(_0x3463c4){_0x16f884[_0xbe14('0x3d')]=_0x3463c4;return _0x16f884;})[_0xbe14('0x20')](respondWithFilteredResult(_0x391556,_0x169369))[_0xbe14('0x3e')](handleError(_0x391556,null));};exports['show']=function(_0xb0f143,_0x1974a4){var _0x1220c9={'raw':!![],'where':{'id':_0xb0f143['params']['id']}},_0x36263c={};_0x36263c['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x25')][_0xbe14('0x26')]);_0x36263c['query']=_['keys'](_0xb0f143[_0xbe14('0x2c')]);_0x36263c['filters']=_['intersection'](_0x36263c[_0xbe14('0x2a')],_0x36263c[_0xbe14('0x2c')]);_0x1220c9[_0xbe14('0x30')]=_['intersection'](_0x36263c['model'],qs['fields'](_0xb0f143[_0xbe14('0x2c')][_0xbe14('0x31')]));_0x1220c9[_0xbe14('0x30')]=_0x1220c9['attributes'][_0xbe14('0x32')]?_0x1220c9[_0xbe14('0x30')]:_0x36263c[_0xbe14('0x2a')];if(_0xb0f143[_0xbe14('0x2c')]['includeAll']){_0x1220c9['include']=[{'all':!![]}];}_0x1220c9=_[_0xbe14('0x37')]({},_0x1220c9,_0xb0f143[_0xbe14('0x39')]);return db[_0xbe14('0x25')][_0xbe14('0x3f')](_0x1220c9)[_0xbe14('0x20')](handleEntityNotFound(_0x1974a4,null))['then'](respondWithResult(_0x1974a4,null))['catch'](handleError(_0x1974a4,null));};exports[_0xbe14('0x40')]=function(_0x2a3623,_0x238c60){return db[_0xbe14('0x25')]['create'](_0x2a3623[_0xbe14('0x41')],{})[_0xbe14('0x20')](respondWithResult(_0x238c60,0xc9))['catch'](handleError(_0x238c60,null));};exports[_0xbe14('0x1f')]=function(_0x2a35e5,_0x2d6ee8){if(_0x2a35e5[_0xbe14('0x41')]['id']){delete _0x2a35e5['body']['id'];}return db['SquareReport'][_0xbe14('0x3f')]({'where':{'id':_0x2a35e5[_0xbe14('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d6ee8,null))['then'](saveUpdates(_0x2a35e5[_0xbe14('0x41')],null))[_0xbe14('0x20')](respondWithResult(_0x2d6ee8,null))[_0xbe14('0x3e')](handleError(_0x2d6ee8,null));};exports[_0xbe14('0x43')]=function(_0xdbc6e1,_0xd04fd5){return db[_0xbe14('0x25')]['find']({'where':{'id':_0xdbc6e1[_0xbe14('0x42')]['id']}})[_0xbe14('0x20')](handleEntityNotFound(_0xd04fd5,null))[_0xbe14('0x20')](removeEntity(_0xd04fd5,null))[_0xbe14('0x3e')](handleError(_0xd04fd5,null));};exports[_0xbe14('0x44')]=function(_0x494c32,_0x3a221b){return db[_0xbe14('0x25')][_0xbe14('0x44')]()[_0xbe14('0x20')](respondWithResult(_0x3a221b,null))[_0xbe14('0x3e')](handleError(_0x3a221b,null));}; \ No newline at end of file +var _0x326f=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','type','filter','options','SquareReport','include','rows','catch','show','params','includeAll','create','body','update','find','describe','html-pdf','zip-dir','fast-json-patch','request-promise'];(function(_0x5a101a,_0x2383f8){var _0x7dc821=function(_0x462c66){while(--_0x462c66){_0x5a101a['push'](_0x5a101a['shift']());}};_0x7dc821(++_0x2383f8);}(_0x326f,0xd1));var _0xf326=function(_0x3395ae,_0x507b09){_0x3395ae=_0x3395ae-0x0;var _0x35764e=_0x326f[_0x3395ae];return _0x35764e;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];function respondWithStatusCode(_0x518ab5,_0x3162f9){_0x3162f9=_0x3162f9||0xcc;return function(_0x9ed463){if(_0x9ed463){return _0x518ab5['sendStatus'](_0x3162f9);}return _0x518ab5[_0xf326('0x17')](_0x3162f9)[_0xf326('0x18')]();};}function respondWithResult(_0x3504eb,_0x17a098){_0x17a098=_0x17a098||0xc8;return function(_0x5c8483){if(_0x5c8483){return _0x3504eb[_0xf326('0x17')](_0x17a098)['json'](_0x5c8483);}};}function respondWithFilteredResult(_0x54bd1a,_0xdf21d9){return function(_0x11f6d2){if(_0x11f6d2){var _0x1f2e5a=_0x11f6d2[_0xf326('0x19')],_0xa63d1a=_0xdf21d9[_0xf326('0x1a')],_0x292f4b=_0xdf21d9['offset']+_0xdf21d9[_0xf326('0x1b')],_0x287a2a;if(_0x292f4b>=_0x1f2e5a){_0x292f4b=_0x1f2e5a;_0x287a2a=0xc8;}else{_0x287a2a=0xce;}_0x54bd1a[_0xf326('0x17')](_0x287a2a);return _0x54bd1a[_0xf326('0x1c')](_0xf326('0x1d'),_0xa63d1a+'-'+_0x292f4b+'/'+_0x1f2e5a)[_0xf326('0x1e')](_0x11f6d2);}return null;};}function patchUpdates(_0x311af0){return function(_0x4d3d41){try{jsonpatch['apply'](_0x4d3d41,_0x311af0,!![]);}catch(_0x56ad41){return BPromise[_0xf326('0x1f')](_0x56ad41);}return _0x4d3d41[_0xf326('0x20')]();};}function saveUpdates(_0x484cbe,_0x4cabce){return function(_0x128c68){if(_0x128c68){return _0x128c68['update'](_0x484cbe)['then'](function(_0x448b92){return _0x448b92;});}return null;};}function removeEntity(_0x18ead3,_0x549b46){return function(_0x5aa184){if(_0x5aa184){return _0x5aa184[_0xf326('0x21')]()[_0xf326('0x22')](function(){_0x18ead3['status'](0xcc)[_0xf326('0x18')]();});}};}function handleEntityNotFound(_0x1b9039,_0x43c53e){return function(_0x295752){if(!_0x295752){_0x1b9039[_0xf326('0x23')](0x194);}return _0x295752;};}function handleError(_0x2049ec,_0x5ce532){_0x5ce532=_0x5ce532||0x1f4;return function(_0x55b9f4){logger['error'](_0x55b9f4[_0xf326('0x24')]);if(_0x55b9f4[_0xf326('0x25')]){delete _0x55b9f4[_0xf326('0x25')];}_0x2049ec[_0xf326('0x17')](_0x5ce532)[_0xf326('0x26')](_0x55b9f4);};}exports[_0xf326('0x27')]=function(_0x5217d4,_0x201d28){var _0xa3c0b={},_0x212d5d={},_0x581531={'count':0x0,'rows':[]};var _0x1617d2=_['map'](db['SquareReport'][_0xf326('0x28')],function(_0x1ae23a){return{'name':_0x1ae23a[_0xf326('0x29')],'type':_0x1ae23a['type'][_0xf326('0x2a')]};});_0x212d5d[_0xf326('0x2b')]=_['map'](_0x1617d2,_0xf326('0x25'));_0x212d5d[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5217d4[_0xf326('0x2c')]);_0x212d5d[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x212d5d[_0xf326('0x2b')],_0x212d5d[_0xf326('0x2c')]);_0xa3c0b[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x212d5d['model'],qs[_0xf326('0x31')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x31')]));_0xa3c0b['attributes']=_0xa3c0b[_0xf326('0x30')][_0xf326('0x32')]?_0xa3c0b[_0xf326('0x30')]:_0x212d5d['model'];if(!_0x5217d4['query'][_0xf326('0x33')](_0xf326('0x34'))){_0xa3c0b[_0xf326('0x1b')]=qs[_0xf326('0x1b')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x1b')]);_0xa3c0b[_0xf326('0x1a')]=qs[_0xf326('0x1a')](_0x5217d4['query'][_0xf326('0x1a')]);}_0xa3c0b[_0xf326('0x35')]=qs['sort'](_0x5217d4[_0xf326('0x2c')]['sort']);_0xa3c0b[_0xf326('0x36')]=qs['filters'](_['pick'](_0x5217d4[_0xf326('0x2c')],_0x212d5d['filters']));if(_0x5217d4[_0xf326('0x2c')]['filter']){_0xa3c0b[_0xf326('0x36')]=_[_0xf326('0x37')](_0xa3c0b[_0xf326('0x36')],{'$or':_['map'](_0x1617d2,function(_0x3dcc7e){if(_0x3dcc7e[_0xf326('0x38')]!=='VIRTUAL'){var _0x13932b={};_0x13932b[_0x3dcc7e[_0xf326('0x25')]]={'$like':'%'+_0x5217d4[_0xf326('0x2c')][_0xf326('0x39')]+'%'};return _0x13932b;}})});}_0xa3c0b=_['merge']({},_0xa3c0b,_0x5217d4[_0xf326('0x3a')]);var _0xb1ef35={'where':_0xa3c0b[_0xf326('0x36')]};return db[_0xf326('0x3b')][_0xf326('0x19')](_0xb1ef35)['then'](function(_0x3e830d){_0x581531[_0xf326('0x19')]=_0x3e830d;if(_0x5217d4['query']['includeAll']){_0xa3c0b[_0xf326('0x3c')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0xa3c0b);})[_0xf326('0x22')](function(_0x5d6ae2){_0x581531[_0xf326('0x3d')]=_0x5d6ae2;return _0x581531;})[_0xf326('0x22')](respondWithFilteredResult(_0x201d28,_0xa3c0b))[_0xf326('0x3e')](handleError(_0x201d28,null));};exports[_0xf326('0x3f')]=function(_0x49112d,_0x9dda89){var _0x45d344={'raw':!![],'where':{'id':_0x49112d[_0xf326('0x40')]['id']}},_0x347e7b={};_0x347e7b[_0xf326('0x2b')]=_[_0xf326('0x2d')](db[_0xf326('0x3b')][_0xf326('0x28')]);_0x347e7b[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x49112d[_0xf326('0x2c')]);_0x347e7b[_0xf326('0x2e')]=_['intersection'](_0x347e7b[_0xf326('0x2b')],_0x347e7b[_0xf326('0x2c')]);_0x45d344[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x347e7b[_0xf326('0x2b')],qs[_0xf326('0x31')](_0x49112d['query'][_0xf326('0x31')]));_0x45d344[_0xf326('0x30')]=_0x45d344['attributes'][_0xf326('0x32')]?_0x45d344[_0xf326('0x30')]:_0x347e7b[_0xf326('0x2b')];if(_0x49112d[_0xf326('0x2c')][_0xf326('0x41')]){_0x45d344['include']=[{'all':!![]}];}_0x45d344=_['merge']({},_0x45d344,_0x49112d[_0xf326('0x3a')]);return db[_0xf326('0x3b')]['find'](_0x45d344)['then'](handleEntityNotFound(_0x9dda89,null))[_0xf326('0x22')](respondWithResult(_0x9dda89,null))[_0xf326('0x3e')](handleError(_0x9dda89,null));};exports[_0xf326('0x42')]=function(_0x5b3705,_0x301e65){return db[_0xf326('0x3b')][_0xf326('0x42')](_0x5b3705[_0xf326('0x43')],{})[_0xf326('0x22')](respondWithResult(_0x301e65,0xc9))[_0xf326('0x3e')](handleError(_0x301e65,null));};exports[_0xf326('0x44')]=function(_0x3b90dc,_0x3df9a8){if(_0x3b90dc[_0xf326('0x43')]['id']){delete _0x3b90dc[_0xf326('0x43')]['id'];}return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x3b90dc[_0xf326('0x40')]['id']}})[_0xf326('0x22')](handleEntityNotFound(_0x3df9a8,null))['then'](saveUpdates(_0x3b90dc[_0xf326('0x43')],null))[_0xf326('0x22')](respondWithResult(_0x3df9a8,null))[_0xf326('0x3e')](handleError(_0x3df9a8,null));};exports[_0xf326('0x21')]=function(_0x5f1829,_0x10f437){return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x5f1829[_0xf326('0x40')]['id']}})['then'](handleEntityNotFound(_0x10f437,null))[_0xf326('0x22')](removeEntity(_0x10f437,null))[_0xf326('0x3e')](handleError(_0x10f437,null));};exports[_0xf326('0x46')]=function(_0x451ac7,_0x39ba25){return db['SquareReport']['describe']()[_0xf326('0x22')](respondWithResult(_0x39ba25,null))[_0xf326('0x3e')](handleError(_0x39ba25,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index f8daecc..bb04460 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 _0xf0dd=['path','rimraf','../../config/environment','./squareReport.attributes','define','report_square','uniqueid','project_name','leaveAt','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x37ae27,_0x31331e){var _0x58ceba=function(_0x59eb65){while(--_0x59eb65){_0x37ae27['push'](_0x37ae27['shift']());}};_0x58ceba(++_0x31331e);}(_0xf0dd,0xae));var _0xdf0d=function(_0x39aba0,_0x5a5cf6){_0x39aba0=_0x39aba0-0x0;var _0x56dc38=_0xf0dd[_0x39aba0];return _0x56dc38;};'use strict';var _=require('lodash');var util=require(_0xdf0d('0x0'));var logger=require(_0xdf0d('0x1'))(_0xdf0d('0x2'));var moment=require(_0xdf0d('0x3'));var BPromise=require(_0xdf0d('0x4'));var rp=require(_0xdf0d('0x5'));var fs=require('fs');var path=require(_0xdf0d('0x6'));var rimraf=require(_0xdf0d('0x7'));var config=require(_0xdf0d('0x8'));var attributes=require(_0xdf0d('0x9'));module['exports']=function(_0x56ac38,_0x51df5e){return _0x56ac38[_0xdf0d('0xa')]('SquareReport',attributes,{'tableName':_0xdf0d('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xdf0d('0xc'),_0xdf0d('0xd')]},{'name':_0xdf0d('0xe'),'fields':[_0xdf0d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b64=['leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','uid_pname','uniqueid','project_name'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x1b64,0x1e1));var _0x41b6=function(_0x565082,_0x47db9b){_0x565082=_0x565082-0x0;var _0x1378be=_0x1b64[_0x565082];return _0x1378be;};'use strict';var _=require(_0x41b6('0x0'));var util=require(_0x41b6('0x1'));var logger=require(_0x41b6('0x2'))(_0x41b6('0x3'));var moment=require(_0x41b6('0x4'));var BPromise=require(_0x41b6('0x5'));var rp=require(_0x41b6('0x6'));var fs=require('fs');var path=require(_0x41b6('0x7'));var rimraf=require(_0x41b6('0x8'));var config=require('../../config/environment');var attributes=require(_0x41b6('0x9'));module[_0x41b6('0xa')]=function(_0xc7b4d0,_0x1180de){return _0xc7b4d0[_0x41b6('0xb')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x41b6('0xc'),'fields':[_0x41b6('0xd'),_0x41b6('0xe')]},{'name':_0x41b6('0xf'),'fields':[_0x41b6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index de02c5d..dfae1c9 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 _0x2502=['catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','update','where','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x806eca,_0x1b3327){var _0x584dbe=function(_0x4fc6ee){while(--_0x4fc6ee){_0x806eca['push'](_0x806eca['shift']());}};_0x584dbe(++_0x1b3327);}(_0x2502,0x141));var _0x2250=function(_0x2e1423,_0x3d6461){_0x2e1423=_0x2e1423-0x0;var _0x16b9c1=_0x2502[_0x2e1423];return _0x16b9c1;};'use strict';var _=require(_0x2250('0x0'));var util=require(_0x2250('0x1'));var moment=require(_0x2250('0x2'));var BPromise=require('bluebird');var rs=require(_0x2250('0x3'));var fs=require('fs');var Redis=require(_0x2250('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2250('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2250('0x6')][_0x2250('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x219119,_0x59a7d7,_0x42c625){return new BPromise(function(_0x37353e,_0x2216b0){return client[_0x2250('0x8')](_0x219119,_0x42c625)[_0x2250('0x9')](function(_0x4f31e1){logger[_0x2250('0xa')](_0x2250('0xb'),_0x59a7d7,_0x2250('0xc'));logger[_0x2250('0xd')](_0x2250('0xe'),_0x59a7d7,_0x2250('0xc'),JSON[_0x2250('0xf')](_0x4f31e1));if(_0x4f31e1[_0x2250('0x10')]){if(_0x4f31e1[_0x2250('0x10')][_0x2250('0x11')]===0x1f4){logger['error'](_0x2250('0xb'),_0x59a7d7,_0x4f31e1[_0x2250('0x10')][_0x2250('0x12')]);return _0x2216b0(_0x4f31e1['error'][_0x2250('0x12')]);}logger[_0x2250('0x10')]('SquareReport,\x20%s,\x20%s',_0x59a7d7,_0x4f31e1[_0x2250('0x10')][_0x2250('0x12')]);return _0x37353e(_0x4f31e1['error'][_0x2250('0x12')]);}else{logger['info'](_0x2250('0xb'),_0x59a7d7,_0x2250('0xc'));_0x37353e(_0x4f31e1[_0x2250('0x13')]['message']);}})[_0x2250('0x14')](function(_0x3c1742){logger[_0x2250('0x10')](_0x2250('0xb'),_0x59a7d7,_0x3c1742);_0x2216b0(_0x3c1742);});});}exports[_0x2250('0x15')]=function(_0x48aa3c){var _0x2d733c=this;return new Promise(function(_0xa0c605,_0x5759c7){return db['SquareReport'][_0x2250('0x16')](_0x48aa3c[_0x2250('0x17')],{'raw':_0x48aa3c[_0x2250('0x18')]?_0x48aa3c['options'][_0x2250('0x19')]===undefined?!![]:![]:!![]})[_0x2250('0x9')](function(_0x361704){logger[_0x2250('0xa')]('CreateSquareReport',_0x48aa3c);logger[_0x2250('0xd')](_0x2250('0x15'),_0x48aa3c,JSON[_0x2250('0xf')](_0x361704));_0xa0c605(_0x361704);})[_0x2250('0x14')](function(_0x54373a){logger['error']('CreateSquareReport',_0x54373a[_0x2250('0x12')],_0x48aa3c);_0x5759c7(_0x2d733c['error'](0x1f4,_0x54373a[_0x2250('0x12')]));});});};exports[_0x2250('0x1a')]=function(_0x4238e9){var _0x31c08b=this;return new Promise(function(_0x56f9f1,_0x25f4a8){return db[_0x2250('0x1b')][_0x2250('0x1c')](_0x4238e9['body'],{'raw':_0x4238e9[_0x2250('0x18')]?_0x4238e9[_0x2250('0x18')][_0x2250('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4238e9['options']?_0x4238e9[_0x2250('0x18')][_0x2250('0x1d')]||null:null,'attributes':_0x4238e9[_0x2250('0x18')]?_0x4238e9[_0x2250('0x18')]['attributes']||null:null,'limit':_0x4238e9[_0x2250('0x18')]?_0x4238e9[_0x2250('0x18')][_0x2250('0x1e')]||null:null})[_0x2250('0x9')](function(_0x2c8efd){logger[_0x2250('0xa')](_0x2250('0x1a'),_0x4238e9);logger[_0x2250('0xd')](_0x2250('0x1a'),_0x4238e9,JSON[_0x2250('0xf')](_0x2c8efd));_0x56f9f1(_0x2c8efd);})['catch'](function(_0x388786){logger[_0x2250('0x10')](_0x2250('0x1a'),_0x388786[_0x2250('0x12')],_0x4238e9);_0x25f4a8(_0x31c08b['error'](0x1f4,_0x388786[_0x2250('0x12')]));});});}; \ No newline at end of file +var _0x4969=['../../config/logger','rpc','../../config/environment','client','http','request','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareReport','create','body','options','catch','UpdateSquareReport','SquareReport','update','raw','attributes','then','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1d669e,_0x4921c9){var _0x1d1ec7=function(_0x332a50){while(--_0x332a50){_0x1d669e['push'](_0x1d669e['shift']());}};_0x1d1ec7(++_0x4921c9);}(_0x4969,0x144));var _0x9496=function(_0x28e71a,_0x4405bd){_0x28e71a=_0x28e71a-0x0;var _0x268fed=_0x4969[_0x28e71a];return _0x268fed;};'use strict';var _=require(_0x9496('0x0'));var util=require(_0x9496('0x1'));var moment=require('moment');var BPromise=require(_0x9496('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9496('0x3'));var db=require(_0x9496('0x4'))['db'];var utils=require(_0x9496('0x5'));var logger=require(_0x9496('0x6'))(_0x9496('0x7'));var config=require(_0x9496('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9496('0x9')][_0x9496('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x567315,_0x2c08e4,_0x290ee6){return new BPromise(function(_0x173729,_0x3d15cc){return client[_0x9496('0xb')](_0x567315,_0x290ee6)['then'](function(_0x166bbc){logger['info'](_0x9496('0xc'),_0x2c08e4,_0x9496('0xd'));logger['debug'](_0x9496('0xe'),_0x2c08e4,_0x9496('0xd'),JSON[_0x9496('0xf')](_0x166bbc));if(_0x166bbc['error']){if(_0x166bbc[_0x9496('0x10')][_0x9496('0x11')]===0x1f4){logger[_0x9496('0x10')](_0x9496('0xc'),_0x2c08e4,_0x166bbc[_0x9496('0x10')][_0x9496('0x12')]);return _0x3d15cc(_0x166bbc['error'][_0x9496('0x12')]);}logger['error'](_0x9496('0xc'),_0x2c08e4,_0x166bbc['error'][_0x9496('0x12')]);return _0x173729(_0x166bbc[_0x9496('0x10')][_0x9496('0x12')]);}else{logger[_0x9496('0x13')](_0x9496('0xc'),_0x2c08e4,'request\x20sent');_0x173729(_0x166bbc[_0x9496('0x14')]['message']);}})['catch'](function(_0x410930){logger[_0x9496('0x10')](_0x9496('0xc'),_0x2c08e4,_0x410930);_0x3d15cc(_0x410930);});});}exports[_0x9496('0x15')]=function(_0x295cef){var _0x26bb6e=this;return new Promise(function(_0x3506e2,_0x81780f){return db['SquareReport'][_0x9496('0x16')](_0x295cef[_0x9496('0x17')],{'raw':_0x295cef['options']?_0x295cef[_0x9496('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4afee7){logger[_0x9496('0x13')]('CreateSquareReport',_0x295cef);logger['debug'](_0x9496('0x15'),_0x295cef,JSON[_0x9496('0xf')](_0x4afee7));_0x3506e2(_0x4afee7);})[_0x9496('0x19')](function(_0x5ede8b){logger[_0x9496('0x10')](_0x9496('0x15'),_0x5ede8b[_0x9496('0x12')],_0x295cef);_0x81780f(_0x26bb6e[_0x9496('0x10')](0x1f4,_0x5ede8b['message']));});});};exports[_0x9496('0x1a')]=function(_0x52fa06){var _0x3dfcb6=this;return new Promise(function(_0x280e18,_0x4f7666){return db[_0x9496('0x1b')][_0x9496('0x1c')](_0x52fa06['body'],{'raw':_0x52fa06[_0x9496('0x18')]?_0x52fa06[_0x9496('0x18')][_0x9496('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52fa06[_0x9496('0x18')]?_0x52fa06['options']['where']||null:null,'attributes':_0x52fa06['options']?_0x52fa06['options'][_0x9496('0x1e')]||null:null,'limit':_0x52fa06[_0x9496('0x18')]?_0x52fa06[_0x9496('0x18')]['limit']||null:null})[_0x9496('0x1f')](function(_0x37d33e){logger[_0x9496('0x13')](_0x9496('0x1a'),_0x52fa06);logger[_0x9496('0x20')](_0x9496('0x1a'),_0x52fa06,JSON[_0x9496('0xf')](_0x37d33e));_0x280e18(_0x37d33e);})[_0x9496('0x19')](function(_0xa36c17){logger[_0x9496('0x10')](_0x9496('0x1a'),_0xa36c17[_0x9496('0x12')],_0x52fa06);_0x4f7666(_0x3dfcb6[_0x9496('0x10')](0x1f4,_0xa36c17[_0x9496('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 23c6c59..24ce19b 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x429baf,_0x352418){var _0x397269=function(_0xaee337){while(--_0xaee337){_0x429baf['push'](_0x429baf['shift']());}};_0x397269(++_0x352418);}(_0x7a54,0x106));var _0x47a5=function(_0x29f210,_0x2ee049){_0x29f210=_0x29f210-0x0;var _0x5cb2d9=_0x7a54[_0x29f210];return _0x5cb2d9;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file +var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x2a8761,_0x21852a){var _0x314436=function(_0xda0cd){while(--_0xda0cd){_0x2a8761['push'](_0x2a8761['shift']());}};_0x314436(++_0x21852a);}(_0x7a54,0x106));var _0x47a5=function(_0x41d4a8,_0xcf9104){_0x41d4a8=_0x41d4a8-0x0;var _0x46b96c=_0x7a54[_0x41d4a8];return _0x46b96c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 7b603d0..7fc89a6 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 _0x6e9f=['exports','STRING'];(function(_0x28fb07,_0xb72e74){var _0x27bd7a=function(_0x912350){while(--_0x912350){_0x28fb07['push'](_0x28fb07['shift']());}};_0x27bd7a(++_0xb72e74);}(_0x6e9f,0x128));var _0xf6e9=function(_0x264573,_0x171c2a){_0x264573=_0x264573-0x0;var _0x18ac8a=_0x6e9f[_0x264573];return _0x18ac8a;};'use strict';var Sequelize=require('sequelize');module[_0xf6e9('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xf6e9('0x1')]},'application':{'type':Sequelize[_0xf6e9('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xf6e9('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaf51=['exports','STRING','TEXT','sequelize'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xaf51,0x1bb));var _0x1af5=function(_0x227bf7,_0x153133){_0x227bf7=_0x227bf7-0x0;var _0x270f1e=_0xaf51[_0x227bf7];return _0x270f1e;};'use strict';var Sequelize=require(_0x1af5('0x0'));module[_0x1af5('0x1')]={'uniqueid':{'type':Sequelize[_0x1af5('0x2')]},'node':{'type':Sequelize[_0x1af5('0x2')]},'application':{'type':Sequelize[_0x1af5('0x2')]},'data':{'type':Sequelize[_0x1af5('0x3')]},'project_name':{'type':Sequelize[_0x1af5('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index e4c984d..e97fac4 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 _0x21fe=['../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','SquareDetailsReport','rawAttributes','type','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','create','update','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x21fe,0x7f));var _0xe21f=function(_0x14714d,_0x968dc7){_0x14714d=_0x14714d-0x0;var _0x30685d=_0x21fe[_0x14714d];return _0x30685d;};'use strict';var pdf=require(_0xe21f('0x0'));var emlformat=require(_0xe21f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe21f('0x2'));var jsonpatch=require(_0xe21f('0x3'));var rp=require(_0xe21f('0x4'));var moment=require(_0xe21f('0x5'));var BPromise=require(_0xe21f('0x6'));var Mustache=require(_0xe21f('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe21f('0x8'));var csv=require(_0xe21f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe21f('0xa'));var squel=require(_0xe21f('0xb'));var crypto=require(_0xe21f('0xc'));var jsforce=require(_0xe21f('0xd'));var deskjs=require(_0xe21f('0xe'));var toCsv=require(_0xe21f('0x9'));var querystring=require(_0xe21f('0xf'));var Papa=require(_0xe21f('0x10'));var Redis=require(_0xe21f('0x11'));var authService=require(_0xe21f('0x12'));var qs=require(_0xe21f('0x13'));var as=require(_0xe21f('0x14'));var hardwareService=require(_0xe21f('0x15'));var logger=require(_0xe21f('0x16'))('api');var utils=require(_0xe21f('0x17'));var config=require(_0xe21f('0x18'));var db=require(_0xe21f('0x19'))['db'];function respondWithStatusCode(_0xa1ad0d,_0x3db715){_0x3db715=_0x3db715||0xcc;return function(_0x4a9722){if(_0x4a9722){return _0xa1ad0d['sendStatus'](_0x3db715);}return _0xa1ad0d[_0xe21f('0x1a')](_0x3db715)['end']();};}function respondWithResult(_0x18000d,_0x137c23){_0x137c23=_0x137c23||0xc8;return function(_0x27d63b){if(_0x27d63b){return _0x18000d[_0xe21f('0x1a')](_0x137c23)[_0xe21f('0x1b')](_0x27d63b);}};}function respondWithFilteredResult(_0x5d9923,_0x5554ff){return function(_0xc6855b){if(_0xc6855b){var _0x1b5a9f=_0xc6855b[_0xe21f('0x1c')],_0x4767f6=_0x5554ff[_0xe21f('0x1d')],_0xae4953=_0x5554ff[_0xe21f('0x1d')]+_0x5554ff[_0xe21f('0x1e')],_0x236103;if(_0xae4953>=_0x1b5a9f){_0xae4953=_0x1b5a9f;_0x236103=0xc8;}else{_0x236103=0xce;}_0x5d9923[_0xe21f('0x1a')](_0x236103);return _0x5d9923[_0xe21f('0x1f')]('Content-Range',_0x4767f6+'-'+_0xae4953+'/'+_0x1b5a9f)[_0xe21f('0x1b')](_0xc6855b);}return null;};}function patchUpdates(_0x5be6ee){return function(_0x3bad15){try{jsonpatch[_0xe21f('0x20')](_0x3bad15,_0x5be6ee,!![]);}catch(_0x3a9bda){return BPromise[_0xe21f('0x21')](_0x3a9bda);}return _0x3bad15[_0xe21f('0x22')]();};}function saveUpdates(_0x5db2e3,_0x111f3c){return function(_0x482ba7){if(_0x482ba7){return _0x482ba7['update'](_0x5db2e3)[_0xe21f('0x23')](function(_0x28e2c0){return _0x28e2c0;});}return null;};}function removeEntity(_0x53b78b,_0x591239){return function(_0x589a38){if(_0x589a38){return _0x589a38[_0xe21f('0x24')]()['then'](function(){_0x53b78b[_0xe21f('0x1a')](0xcc)[_0xe21f('0x25')]();});}};}function handleEntityNotFound(_0x315e72,_0x3368a0){return function(_0x445536){if(!_0x445536){_0x315e72[_0xe21f('0x26')](0x194);}return _0x445536;};}function handleError(_0x27c870,_0x161eac){_0x161eac=_0x161eac||0x1f4;return function(_0x414394){logger[_0xe21f('0x27')](_0x414394[_0xe21f('0x28')]);if(_0x414394[_0xe21f('0x29')]){delete _0x414394[_0xe21f('0x29')];}_0x27c870[_0xe21f('0x1a')](_0x161eac)[_0xe21f('0x2a')](_0x414394);};}exports['index']=function(_0x59603b,_0x146396){var _0x45a445={},_0x5f31f2={},_0x549610={'count':0x0,'rows':[]};var _0x439689=_['map'](db[_0xe21f('0x2b')][_0xe21f('0x2c')],function(_0x1057d4){return{'name':_0x1057d4['fieldName'],'type':_0x1057d4[_0xe21f('0x2d')]['key']};});_0x5f31f2[_0xe21f('0x2e')]=_['map'](_0x439689,_0xe21f('0x29'));_0x5f31f2['query']=_[_0xe21f('0x2f')](_0x59603b[_0xe21f('0x30')]);_0x5f31f2[_0xe21f('0x31')]=_['intersection'](_0x5f31f2[_0xe21f('0x2e')],_0x5f31f2[_0xe21f('0x30')]);_0x45a445['attributes']=_['intersection'](_0x5f31f2[_0xe21f('0x2e')],qs[_0xe21f('0x32')](_0x59603b['query'][_0xe21f('0x32')]));_0x45a445[_0xe21f('0x33')]=_0x45a445['attributes']['length']?_0x45a445['attributes']:_0x5f31f2[_0xe21f('0x2e')];if(!_0x59603b[_0xe21f('0x30')][_0xe21f('0x34')](_0xe21f('0x35'))){_0x45a445[_0xe21f('0x1e')]=qs[_0xe21f('0x1e')](_0x59603b[_0xe21f('0x30')]['limit']);_0x45a445['offset']=qs['offset'](_0x59603b[_0xe21f('0x30')][_0xe21f('0x1d')]);}_0x45a445['order']=qs['sort'](_0x59603b['query']['sort']);_0x45a445[_0xe21f('0x36')]=qs[_0xe21f('0x31')](_[_0xe21f('0x37')](_0x59603b[_0xe21f('0x30')],_0x5f31f2[_0xe21f('0x31')]));if(_0x59603b[_0xe21f('0x30')][_0xe21f('0x38')]){_0x45a445['where']=_[_0xe21f('0x39')](_0x45a445[_0xe21f('0x36')],{'$or':_[_0xe21f('0x3a')](_0x439689,function(_0x2ad31b){if(_0x2ad31b[_0xe21f('0x2d')]!==_0xe21f('0x3b')){var _0x268b75={};_0x268b75[_0x2ad31b[_0xe21f('0x29')]]={'$like':'%'+_0x59603b[_0xe21f('0x30')][_0xe21f('0x38')]+'%'};return _0x268b75;}})});}_0x45a445=_[_0xe21f('0x39')]({},_0x45a445,_0x59603b[_0xe21f('0x3c')]);var _0x43c9ca={'where':_0x45a445[_0xe21f('0x36')]};return db[_0xe21f('0x2b')]['count'](_0x43c9ca)[_0xe21f('0x23')](function(_0x451c39){_0x549610['count']=_0x451c39;if(_0x59603b[_0xe21f('0x30')][_0xe21f('0x3d')]){_0x45a445[_0xe21f('0x3e')]=[{'all':!![]}];}return db[_0xe21f('0x2b')][_0xe21f('0x3f')](_0x45a445);})[_0xe21f('0x23')](function(_0x339799){_0x549610[_0xe21f('0x40')]=_0x339799;return _0x549610;})[_0xe21f('0x23')](respondWithFilteredResult(_0x146396,_0x45a445))[_0xe21f('0x41')](handleError(_0x146396,null));};exports[_0xe21f('0x42')]=function(_0x541497,_0x77394e){var _0xb42e41={'raw':!![],'where':{'id':_0x541497[_0xe21f('0x43')]['id']}},_0x3b5513={};_0x3b5513['model']=_[_0xe21f('0x2f')](db['SquareDetailsReport'][_0xe21f('0x2c')]);_0x3b5513[_0xe21f('0x30')]=_[_0xe21f('0x2f')](_0x541497[_0xe21f('0x30')]);_0x3b5513[_0xe21f('0x31')]=_[_0xe21f('0x44')](_0x3b5513[_0xe21f('0x2e')],_0x3b5513['query']);_0xb42e41[_0xe21f('0x33')]=_[_0xe21f('0x44')](_0x3b5513[_0xe21f('0x2e')],qs['fields'](_0x541497[_0xe21f('0x30')]['fields']));_0xb42e41[_0xe21f('0x33')]=_0xb42e41[_0xe21f('0x33')][_0xe21f('0x45')]?_0xb42e41[_0xe21f('0x33')]:_0x3b5513[_0xe21f('0x2e')];if(_0x541497['query']['includeAll']){_0xb42e41[_0xe21f('0x3e')]=[{'all':!![]}];}_0xb42e41=_[_0xe21f('0x39')]({},_0xb42e41,_0x541497[_0xe21f('0x3c')]);return db[_0xe21f('0x2b')]['find'](_0xb42e41)[_0xe21f('0x23')](handleEntityNotFound(_0x77394e,null))['then'](respondWithResult(_0x77394e,null))[_0xe21f('0x41')](handleError(_0x77394e,null));};exports[_0xe21f('0x46')]=function(_0x5b40b9,_0x556c9d){return db['SquareDetailsReport'][_0xe21f('0x46')](_0x5b40b9['body'],{})[_0xe21f('0x23')](respondWithResult(_0x556c9d,0xc9))[_0xe21f('0x41')](handleError(_0x556c9d,null));};exports[_0xe21f('0x47')]=function(_0x1747c0,_0x4d8330){if(_0x1747c0[_0xe21f('0x48')]['id']){delete _0x1747c0[_0xe21f('0x48')]['id'];}return db['SquareDetailsReport'][_0xe21f('0x49')]({'where':{'id':_0x1747c0[_0xe21f('0x43')]['id']}})[_0xe21f('0x23')](handleEntityNotFound(_0x4d8330,null))[_0xe21f('0x23')](saveUpdates(_0x1747c0[_0xe21f('0x48')],null))[_0xe21f('0x23')](respondWithResult(_0x4d8330,null))[_0xe21f('0x41')](handleError(_0x4d8330,null));};exports[_0xe21f('0x24')]=function(_0x5511fb,_0x553b02){return db[_0xe21f('0x2b')][_0xe21f('0x49')]({'where':{'id':_0x5511fb[_0xe21f('0x43')]['id']}})[_0xe21f('0x23')](handleEntityNotFound(_0x553b02,null))[_0xe21f('0x23')](removeEntity(_0x553b02,null))[_0xe21f('0x41')](handleError(_0x553b02,null));};exports[_0xe21f('0x4a')]=function(_0x30768a,_0x5a95f5){return db[_0xe21f('0x2b')]['describe']()[_0xe21f('0x23')](respondWithResult(_0x5a95f5,null))['catch'](handleError(_0x5a95f5,null));}; \ No newline at end of file +var _0x916e=['count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','SquareDetailsReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','params','include','options','find','create','body','catch','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json'];(function(_0x2b4f2d,_0x170d09){var _0xc077e=function(_0x17d5e8){while(--_0x17d5e8){_0x2b4f2d['push'](_0x2b4f2d['shift']());}};_0xc077e(++_0x170d09);}(_0x916e,0x195));var _0xe916=function(_0x37d806,_0x110232){_0x37d806=_0x37d806-0x0;var _0x151504=_0x916e[_0x37d806];return _0x151504;};'use strict';var pdf=require(_0xe916('0x0'));var emlformat=require(_0xe916('0x1'));var rimraf=require(_0xe916('0x2'));var zipdir=require(_0xe916('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe916('0x4'));var moment=require(_0xe916('0x5'));var BPromise=require(_0xe916('0x6'));var Mustache=require(_0xe916('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe916('0x8'));var csv=require(_0xe916('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe916('0xa'));var squel=require(_0xe916('0xb'));var crypto=require(_0xe916('0xc'));var jsforce=require(_0xe916('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe916('0x9'));var querystring=require(_0xe916('0xe'));var Papa=require(_0xe916('0xf'));var Redis=require(_0xe916('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe916('0x11'));var as=require(_0xe916('0x12'));var hardwareService=require(_0xe916('0x13'));var logger=require('../../config/logger')(_0xe916('0x14'));var utils=require(_0xe916('0x15'));var config=require(_0xe916('0x16'));var db=require(_0xe916('0x17'))['db'];function respondWithStatusCode(_0x5d689c,_0x59893d){_0x59893d=_0x59893d||0xcc;return function(_0x5d5cfb){if(_0x5d5cfb){return _0x5d689c['sendStatus'](_0x59893d);}return _0x5d689c[_0xe916('0x18')](_0x59893d)[_0xe916('0x19')]();};}function respondWithResult(_0x224bc0,_0x24c1d7){_0x24c1d7=_0x24c1d7||0xc8;return function(_0x46c767){if(_0x46c767){return _0x224bc0[_0xe916('0x18')](_0x24c1d7)[_0xe916('0x1a')](_0x46c767);}};}function respondWithFilteredResult(_0x2ca9e4,_0x1aae71){return function(_0x390ca6){if(_0x390ca6){var _0x4941e2=_0x390ca6[_0xe916('0x1b')],_0x1ca05b=_0x1aae71[_0xe916('0x1c')],_0x21935e=_0x1aae71['offset']+_0x1aae71[_0xe916('0x1d')],_0x5b72dd;if(_0x21935e>=_0x4941e2){_0x21935e=_0x4941e2;_0x5b72dd=0xc8;}else{_0x5b72dd=0xce;}_0x2ca9e4[_0xe916('0x18')](_0x5b72dd);return _0x2ca9e4[_0xe916('0x1e')]('Content-Range',_0x1ca05b+'-'+_0x21935e+'/'+_0x4941e2)[_0xe916('0x1a')](_0x390ca6);}return null;};}function patchUpdates(_0x487ab0){return function(_0x2363d5){try{jsonpatch[_0xe916('0x1f')](_0x2363d5,_0x487ab0,!![]);}catch(_0x3c4c37){return BPromise[_0xe916('0x20')](_0x3c4c37);}return _0x2363d5[_0xe916('0x21')]();};}function saveUpdates(_0x19fc84,_0x1eba03){return function(_0x398865){if(_0x398865){return _0x398865[_0xe916('0x22')](_0x19fc84)[_0xe916('0x23')](function(_0x33a01d){return _0x33a01d;});}return null;};}function removeEntity(_0x19e555,_0x5df8d6){return function(_0x1e38a6){if(_0x1e38a6){return _0x1e38a6[_0xe916('0x24')]()[_0xe916('0x23')](function(){_0x19e555[_0xe916('0x18')](0xcc)[_0xe916('0x19')]();});}};}function handleEntityNotFound(_0x23dc18,_0xab7232){return function(_0x3d84a8){if(!_0x3d84a8){_0x23dc18[_0xe916('0x25')](0x194);}return _0x3d84a8;};}function handleError(_0x2f7eb9,_0x5814b8){_0x5814b8=_0x5814b8||0x1f4;return function(_0x2052fb){logger[_0xe916('0x26')](_0x2052fb['stack']);if(_0x2052fb[_0xe916('0x27')]){delete _0x2052fb[_0xe916('0x27')];}_0x2f7eb9['status'](_0x5814b8)[_0xe916('0x28')](_0x2052fb);};}exports['index']=function(_0x1e4f9a,_0x3f6b0a){var _0x4532f4={},_0x4ec0bf={},_0x1d7f5b={'count':0x0,'rows':[]};var _0x3ab678=_[_0xe916('0x29')](db[_0xe916('0x2a')][_0xe916('0x2b')],function(_0x592dab){return{'name':_0x592dab[_0xe916('0x2c')],'type':_0x592dab['type'][_0xe916('0x2d')]};});_0x4ec0bf[_0xe916('0x2e')]=_[_0xe916('0x29')](_0x3ab678,_0xe916('0x27'));_0x4ec0bf['query']=_[_0xe916('0x2f')](_0x1e4f9a[_0xe916('0x30')]);_0x4ec0bf[_0xe916('0x31')]=_[_0xe916('0x32')](_0x4ec0bf['model'],_0x4ec0bf[_0xe916('0x30')]);_0x4532f4[_0xe916('0x33')]=_[_0xe916('0x32')](_0x4ec0bf[_0xe916('0x2e')],qs['fields'](_0x1e4f9a[_0xe916('0x30')][_0xe916('0x34')]));_0x4532f4[_0xe916('0x33')]=_0x4532f4['attributes'][_0xe916('0x35')]?_0x4532f4[_0xe916('0x33')]:_0x4ec0bf[_0xe916('0x2e')];if(!_0x1e4f9a['query'][_0xe916('0x36')]('nolimit')){_0x4532f4['limit']=qs[_0xe916('0x1d')](_0x1e4f9a[_0xe916('0x30')][_0xe916('0x1d')]);_0x4532f4[_0xe916('0x1c')]=qs['offset'](_0x1e4f9a['query']['offset']);}_0x4532f4[_0xe916('0x37')]=qs[_0xe916('0x38')](_0x1e4f9a[_0xe916('0x30')][_0xe916('0x38')]);_0x4532f4[_0xe916('0x39')]=qs['filters'](_[_0xe916('0x3a')](_0x1e4f9a[_0xe916('0x30')],_0x4ec0bf[_0xe916('0x31')]));if(_0x1e4f9a[_0xe916('0x30')][_0xe916('0x3b')]){_0x4532f4[_0xe916('0x39')]=_[_0xe916('0x3c')](_0x4532f4[_0xe916('0x39')],{'$or':_['map'](_0x3ab678,function(_0x29d4d7){if(_0x29d4d7['type']!==_0xe916('0x3d')){var _0x5b6199={};_0x5b6199[_0x29d4d7[_0xe916('0x27')]]={'$like':'%'+_0x1e4f9a[_0xe916('0x30')][_0xe916('0x3b')]+'%'};return _0x5b6199;}})});}_0x4532f4=_['merge']({},_0x4532f4,_0x1e4f9a['options']);var _0x27fa43={'where':_0x4532f4[_0xe916('0x39')]};return db[_0xe916('0x2a')][_0xe916('0x1b')](_0x27fa43)['then'](function(_0x11ba48){_0x1d7f5b[_0xe916('0x1b')]=_0x11ba48;if(_0x1e4f9a[_0xe916('0x30')][_0xe916('0x3e')]){_0x4532f4['include']=[{'all':!![]}];}return db[_0xe916('0x2a')]['findAll'](_0x4532f4);})['then'](function(_0x1337d4){_0x1d7f5b[_0xe916('0x3f')]=_0x1337d4;return _0x1d7f5b;})[_0xe916('0x23')](respondWithFilteredResult(_0x3f6b0a,_0x4532f4))['catch'](handleError(_0x3f6b0a,null));};exports['show']=function(_0x4cec9b,_0x3b7731){var _0x1bfdef={'raw':!![],'where':{'id':_0x4cec9b[_0xe916('0x40')]['id']}},_0x6d91b2={};_0x6d91b2['model']=_[_0xe916('0x2f')](db[_0xe916('0x2a')][_0xe916('0x2b')]);_0x6d91b2[_0xe916('0x30')]=_[_0xe916('0x2f')](_0x4cec9b[_0xe916('0x30')]);_0x6d91b2[_0xe916('0x31')]=_[_0xe916('0x32')](_0x6d91b2[_0xe916('0x2e')],_0x6d91b2[_0xe916('0x30')]);_0x1bfdef[_0xe916('0x33')]=_['intersection'](_0x6d91b2['model'],qs[_0xe916('0x34')](_0x4cec9b[_0xe916('0x30')][_0xe916('0x34')]));_0x1bfdef['attributes']=_0x1bfdef[_0xe916('0x33')][_0xe916('0x35')]?_0x1bfdef[_0xe916('0x33')]:_0x6d91b2['model'];if(_0x4cec9b[_0xe916('0x30')]['includeAll']){_0x1bfdef[_0xe916('0x41')]=[{'all':!![]}];}_0x1bfdef=_['merge']({},_0x1bfdef,_0x4cec9b[_0xe916('0x42')]);return db[_0xe916('0x2a')][_0xe916('0x43')](_0x1bfdef)[_0xe916('0x23')](handleEntityNotFound(_0x3b7731,null))[_0xe916('0x23')](respondWithResult(_0x3b7731,null))['catch'](handleError(_0x3b7731,null));};exports[_0xe916('0x44')]=function(_0x56f45e,_0x3c08f2){return db['SquareDetailsReport'][_0xe916('0x44')](_0x56f45e[_0xe916('0x45')],{})['then'](respondWithResult(_0x3c08f2,0xc9))[_0xe916('0x46')](handleError(_0x3c08f2,null));};exports[_0xe916('0x22')]=function(_0x15a939,_0x2af156){if(_0x15a939[_0xe916('0x45')]['id']){delete _0x15a939[_0xe916('0x45')]['id'];}return db['SquareDetailsReport'][_0xe916('0x43')]({'where':{'id':_0x15a939[_0xe916('0x40')]['id']}})['then'](handleEntityNotFound(_0x2af156,null))[_0xe916('0x23')](saveUpdates(_0x15a939[_0xe916('0x45')],null))[_0xe916('0x23')](respondWithResult(_0x2af156,null))[_0xe916('0x46')](handleError(_0x2af156,null));};exports['destroy']=function(_0x12e213,_0x3bd43a){return db[_0xe916('0x2a')][_0xe916('0x43')]({'where':{'id':_0x12e213[_0xe916('0x40')]['id']}})['then'](handleEntityNotFound(_0x3bd43a,null))[_0xe916('0x23')](removeEntity(_0x3bd43a,null))[_0xe916('0x46')](handleError(_0x3bd43a,null));};exports[_0xe916('0x47')]=function(_0x32fff0,_0x2ac0c9){return db[_0xe916('0x2a')][_0xe916('0x47')]()['then'](respondWithResult(_0x2ac0c9,null))[_0xe916('0x46')](handleError(_0x2ac0c9,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index eb8d48e..d5f9418 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 _0x8544=['exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x842273,_0x377b4f){var _0x1b1bb6=function(_0x12ba23){while(--_0x12ba23){_0x842273['push'](_0x842273['shift']());}};_0x1b1bb6(++_0x377b4f);}(_0x8544,0x11c));var _0x4854=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x8544[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0x4854('0x0'));var util=require(_0x4854('0x1'));var logger=require(_0x4854('0x2'))(_0x4854('0x3'));var moment=require('moment');var BPromise=require(_0x4854('0x4'));var rp=require(_0x4854('0x5'));var fs=require('fs');var path=require(_0x4854('0x6'));var rimraf=require(_0x4854('0x7'));var config=require(_0x4854('0x8'));var attributes=require(_0x4854('0x9'));module[_0x4854('0xa')]=function(_0x26035b,_0x94d6a3){return _0x26035b[_0x4854('0xb')](_0x4854('0xc'),attributes,{'tableName':_0x4854('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1173=['exports','define','SquareDetailsReport','report_square_details','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes'];(function(_0x5be1d6,_0x52ab2a){var _0x5d9bd4=function(_0x4f05ba){while(--_0x4f05ba){_0x5be1d6['push'](_0x5be1d6['shift']());}};_0x5d9bd4(++_0x52ab2a);}(_0x1173,0x138));var _0x3117=function(_0x19a7d3,_0x487155){_0x19a7d3=_0x19a7d3-0x0;var _0x569a8e=_0x1173[_0x19a7d3];return _0x569a8e;};'use strict';var _=require('lodash');var util=require(_0x3117('0x0'));var logger=require(_0x3117('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3117('0x2'));var rp=require(_0x3117('0x3'));var fs=require('fs');var path=require(_0x3117('0x4'));var rimraf=require('rimraf');var config=require(_0x3117('0x5'));var attributes=require(_0x3117('0x6'));module[_0x3117('0x7')]=function(_0x32e084,_0x3a38b){return _0x32e084[_0x3117('0x8')](_0x3117('0x9'),attributes,{'tableName':_0x3117('0xa'),'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 27c7f47..14e650c 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 _0x536c=['SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x308408,_0x37d440){var _0x9dc073=function(_0x29f0c9){while(--_0x29f0c9){_0x308408['push'](_0x308408['shift']());}};_0x9dc073(++_0x37d440);}(_0x536c,0x67));var _0xc536=function(_0x3ed0e4,_0x473e73){_0x3ed0e4=_0x3ed0e4-0x0;var _0x13d9ee=_0x536c[_0x3ed0e4];return _0x13d9ee;};'use strict';var _=require(_0xc536('0x0'));var util=require(_0xc536('0x1'));var moment=require(_0xc536('0x2'));var BPromise=require(_0xc536('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc536('0x4'));var db=require(_0xc536('0x5'))['db'];var utils=require(_0xc536('0x6'));var logger=require(_0xc536('0x7'))(_0xc536('0x8'));var config=require(_0xc536('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc536('0xa')][_0xc536('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf435cd,_0x5c4221,_0x5aee58){return new BPromise(function(_0x2e3ffa,_0x500f71){return client[_0xc536('0xc')](_0xf435cd,_0x5aee58)['then'](function(_0x1bcf9e){logger[_0xc536('0xd')](_0xc536('0xe'),_0x5c4221,_0xc536('0xf'));logger[_0xc536('0x10')](_0xc536('0x11'),_0x5c4221,_0xc536('0xf'),JSON[_0xc536('0x12')](_0x1bcf9e));if(_0x1bcf9e['error']){if(_0x1bcf9e['error'][_0xc536('0x13')]===0x1f4){logger[_0xc536('0x14')](_0xc536('0xe'),_0x5c4221,_0x1bcf9e[_0xc536('0x14')]['message']);return _0x500f71(_0x1bcf9e[_0xc536('0x14')][_0xc536('0x15')]);}logger[_0xc536('0x14')](_0xc536('0xe'),_0x5c4221,_0x1bcf9e['error'][_0xc536('0x15')]);return _0x2e3ffa(_0x1bcf9e[_0xc536('0x14')][_0xc536('0x15')]);}else{logger[_0xc536('0xd')](_0xc536('0xe'),_0x5c4221,'request\x20sent');_0x2e3ffa(_0x1bcf9e[_0xc536('0x16')][_0xc536('0x15')]);}})[_0xc536('0x17')](function(_0x402b80){logger[_0xc536('0x14')](_0xc536('0xe'),_0x5c4221,_0x402b80);_0x500f71(_0x402b80);});});}exports[_0xc536('0x18')]=function(_0x262807){var _0x4626fc=this;return new Promise(function(_0x48b14d,_0x117eeb){return db[_0xc536('0x19')]['create'](_0x262807[_0xc536('0x1a')],{'raw':_0x262807[_0xc536('0x1b')]?_0x262807[_0xc536('0x1b')][_0xc536('0x1c')]===undefined?!![]:![]:!![]})[_0xc536('0x1d')](function(_0x5398ac){logger[_0xc536('0xd')](_0xc536('0x18'),_0x262807);logger[_0xc536('0x10')](_0xc536('0x18'),_0x262807,JSON['stringify'](_0x5398ac));_0x48b14d(_0x5398ac);})['catch'](function(_0x1f5027){logger['error'](_0xc536('0x18'),_0x1f5027[_0xc536('0x15')],_0x262807);_0x117eeb(_0x4626fc[_0xc536('0x14')](0x1f4,_0x1f5027[_0xc536('0x15')]));});});}; \ No newline at end of file +var _0xeda5=['raw','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareDetailsReport','create','body','options'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xeda5,0x12c));var _0x5eda=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeda5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5eda('0x0'));var util=require('util');var moment=require(_0x5eda('0x1'));var BPromise=require(_0x5eda('0x2'));var rs=require(_0x5eda('0x3'));var fs=require('fs');var Redis=require(_0x5eda('0x4'));var db=require(_0x5eda('0x5'))['db'];var utils=require(_0x5eda('0x6'));var logger=require(_0x5eda('0x7'))('rpc');var config=require(_0x5eda('0x8'));var jayson=require(_0x5eda('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c327e,_0x37c8c1,_0x5ea690){return new BPromise(function(_0x25711c,_0x40431a){return client['request'](_0x1c327e,_0x5ea690)['then'](function(_0x28894a){logger[_0x5eda('0xa')](_0x5eda('0xb'),_0x37c8c1,'request\x20sent');logger[_0x5eda('0xc')](_0x5eda('0xd'),_0x37c8c1,_0x5eda('0xe'),JSON[_0x5eda('0xf')](_0x28894a));if(_0x28894a[_0x5eda('0x10')]){if(_0x28894a[_0x5eda('0x10')][_0x5eda('0x11')]===0x1f4){logger[_0x5eda('0x10')](_0x5eda('0xb'),_0x37c8c1,_0x28894a['error'][_0x5eda('0x12')]);return _0x40431a(_0x28894a['error'][_0x5eda('0x12')]);}logger[_0x5eda('0x10')](_0x5eda('0xb'),_0x37c8c1,_0x28894a['error']['message']);return _0x25711c(_0x28894a['error'][_0x5eda('0x12')]);}else{logger[_0x5eda('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x37c8c1,_0x5eda('0xe'));_0x25711c(_0x28894a[_0x5eda('0x13')][_0x5eda('0x12')]);}})['catch'](function(_0x1975a7){logger[_0x5eda('0x10')](_0x5eda('0xb'),_0x37c8c1,_0x1975a7);_0x40431a(_0x1975a7);});});}exports[_0x5eda('0x14')]=function(_0x104e83){var _0x578010=this;return new Promise(function(_0x1e9107,_0x301f49){return db['SquareDetailsReport'][_0x5eda('0x15')](_0x104e83[_0x5eda('0x16')],{'raw':_0x104e83[_0x5eda('0x17')]?_0x104e83[_0x5eda('0x17')][_0x5eda('0x18')]===undefined?!![]:![]:!![]})[_0x5eda('0x19')](function(_0x2e3f96){logger[_0x5eda('0xa')](_0x5eda('0x14'),_0x104e83);logger[_0x5eda('0xc')]('CreateSquareDetailsReport',_0x104e83,JSON['stringify'](_0x2e3f96));_0x1e9107(_0x2e3f96);})[_0x5eda('0x1a')](function(_0x302523){logger['error']('CreateSquareDetailsReport',_0x302523[_0x5eda('0x12')],_0x104e83);_0x301f49(_0x578010['error'](0x1f4,_0x302523[_0x5eda('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 245eed1..215c1a0 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 _0x4273=['exports','express','Router','../../components/auth/service','get','isAuthenticated','index'];(function(_0x1b658,_0x344b6a){var _0x1d17e5=function(_0x1fae07){while(--_0x1fae07){_0x1b658['push'](_0x1b658['shift']());}};_0x1d17e5(++_0x344b6a);}(_0x4273,0xc5));var _0x3427=function(_0x42b8fe,_0x39ca29){_0x42b8fe=_0x42b8fe-0x0;var _0x14d733=_0x4273[_0x42b8fe];return _0x14d733;};'use strict';var express=require(_0x3427('0x0'));var router=express[_0x3427('0x1')]();var auth=require(_0x3427('0x2'));var controller=require('./system.controller');router[_0x3427('0x3')]('/',auth[_0x3427('0x4')](),controller[_0x3427('0x5')]);router['get']('/process/:pid/kill',auth['isAuthenticated'](),controller['killProcess']);module[_0x3427('0x6')]=router; \ No newline at end of file +var _0xb49b=['get','index','isAuthenticated','killProcess','exports','Router','./system.controller'];(function(_0x15573c,_0x441212){var _0x31111c=function(_0x1683d0){while(--_0x1683d0){_0x15573c['push'](_0x15573c['shift']());}};_0x31111c(++_0x441212);}(_0xb49b,0x194));var _0xbb49=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb49b[_0x6131cd];return _0x47e916;};'use strict';var express=require('express');var router=express[_0xbb49('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xbb49('0x1'));router[_0xbb49('0x2')]('/',auth['isAuthenticated'](),controller[_0xbb49('0x3')]);router[_0xbb49('0x2')]('/process/:pid/kill',auth[_0xbb49('0x4')](),controller[_0xbb49('0x5')]);module[_0xbb49('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 50fa9f2..09378cb 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 _0x4abd=['params','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','then','status','catch','json','killProcess','components/import/cm'];(function(_0x49a2a3,_0x5671ec){var _0x5222e7=function(_0x10f864){while(--_0x10f864){_0x49a2a3['push'](_0x49a2a3['shift']());}};_0x5222e7(++_0x5671ec);}(_0x4abd,0x9a));var _0xd4ab=function(_0x337eeb,_0x4f17e9){_0x337eeb=_0x337eeb-0x0;var _0x2dfdd8=_0x4abd[_0x337eeb];return _0x2dfdd8;};'use strict';var info=require('systeminformation');var exec=require(_0xd4ab('0x0'))[_0xd4ab('0x1')];var logger=require(_0xd4ab('0x2'))('api');var util=require(_0xd4ab('0x3'));var BPromise=require('bluebird');var _=require(_0xd4ab('0x4'));function handleError(_0x85fee4,_0x5a4e81,_0x22b20b){_0x5a4e81=_0x5a4e81||0x1f4;return function(_0x163f2f){logger['error'](_0xd4ab('0x5'),_0x22b20b,_0x5a4e81,util[_0xd4ab('0x6')](_0x163f2f,{'showHidden':![],'depth':null}));delete _0x163f2f[_0xd4ab('0x7')];_0x85fee4['status'](_0x5a4e81)['send'](_0x163f2f);};}exports['index']=function(_0x5ee2ee,_0x1a6cc9){return info['getAllData']()[_0xd4ab('0x8')](function(_0x54a44e){return _0x1a6cc9[_0xd4ab('0x9')](0xc8)['json'](_0x54a44e);})[_0xd4ab('0xa')](function(_0x3c871b){return _0x1a6cc9[_0xd4ab('0x9')](0x1f4)[_0xd4ab('0xb')](_0x3c871b);});};exports[_0xd4ab('0xc')]=function(_0x5abecd,_0x92223a){var _0x5c91e8=[_0xd4ab('0xd')];return new BPromise(function(_0x30ff14,_0x5d5abf){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x5abecd[_0xd4ab('0xe')][_0xd4ab('0xf')]),function(_0x38a6cf,_0x5945b1,_0x4d251f){if(_0x38a6cf){return _0x5d5abf(_0x38a6cf);}return _0x30ff14(_0x5945b1);});})[_0xd4ab('0x8')](function(_0x1b784d){var _0x38f2e7=![];var _0xc275ab=_0x1b784d[_0xd4ab('0x10')](/\n/);for(var _0x37eda5=0x0,_0x12795f=_0x5c91e8[_0xd4ab('0x11')];_0x37eda5<_0x12795f,_0x38f2e7===![];_0x37eda5+=0x1){if(_0x1b784d[_0xd4ab('0x12')](_0x5c91e8[_0x37eda5])>=0x0){_0x38f2e7=!![];}}if(!_0x38f2e7){throw new Error(util[_0xd4ab('0x13')](_0xd4ab('0x14'),_0x5abecd[_0xd4ab('0xe')]['pid']));}process[_0xd4ab('0x15')](_0x5abecd['params'][_0xd4ab('0xf')],_0xd4ab('0x16'));return _0x92223a[_0xd4ab('0x9')](0xc8)[_0xd4ab('0xb')]({'message':util[_0xd4ab('0x13')](_0xd4ab('0x17'),_0x5abecd['params']['pid'])});})[_0xd4ab('0xa')](handleError(_0x92223a,null,_0xd4ab('0xc')));}; \ No newline at end of file +var _0xe49a=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','getAllData','then','status','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','../../config/logger','api','util','bluebird'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xe49a,0x6f));var _0xae49=function(_0x29d932,_0x97f2a7){_0x29d932=_0x29d932-0x0;var _0x5cd611=_0xe49a[_0x29d932];return _0x5cd611;};'use strict';var info=require('systeminformation');var exec=require('child_process')['exec'];var logger=require(_0xae49('0x0'))(_0xae49('0x1'));var util=require(_0xae49('0x2'));var BPromise=require(_0xae49('0x3'));var _=require('lodash');function handleError(_0x1753e6,_0x48372c,_0x582869){_0x48372c=_0x48372c||0x1f4;return function(_0x170946){logger[_0xae49('0x4')](_0xae49('0x5'),_0x582869,_0x48372c,util[_0xae49('0x6')](_0x170946,{'showHidden':![],'depth':null}));delete _0x170946[_0xae49('0x7')];_0x1753e6['status'](_0x48372c)['send'](_0x170946);};}exports['index']=function(_0x8f1013,_0x419a31){return info[_0xae49('0x8')]()[_0xae49('0x9')](function(_0x5184fb){return _0x419a31[_0xae49('0xa')](0xc8)[_0xae49('0xb')](_0x5184fb);})[_0xae49('0xc')](function(_0x8886d4){return _0x419a31[_0xae49('0xa')](0x1f4)[_0xae49('0xb')](_0x8886d4);});};exports[_0xae49('0xd')]=function(_0x199891,_0x1e7484){var _0x2dda5c=['components/import/cm'];return new BPromise(function(_0x4a09b1,_0x15092d){return exec(util[_0xae49('0xe')](_0xae49('0xf'),_0x199891[_0xae49('0x10')][_0xae49('0x11')]),function(_0x585f44,_0x1c556e,_0x238398){if(_0x585f44){return _0x15092d(_0x585f44);}return _0x4a09b1(_0x1c556e);});})['then'](function(_0x407bb2){var _0x38bb04=![];var _0x365dca=_0x407bb2['split'](/\n/);for(var _0x23625f=0x0,_0x7a5e33=_0x2dda5c[_0xae49('0x12')];_0x23625f<_0x7a5e33,_0x38bb04===![];_0x23625f+=0x1){if(_0x407bb2[_0xae49('0x13')](_0x2dda5c[_0x23625f])>=0x0){_0x38bb04=!![];}}if(!_0x38bb04){throw new Error(util[_0xae49('0xe')](_0xae49('0x14'),_0x199891[_0xae49('0x10')][_0xae49('0x11')]));}process['kill'](_0x199891[_0xae49('0x10')][_0xae49('0x11')],_0xae49('0x15'));return _0x1e7484['status'](0xc8)['json']({'message':util[_0xae49('0xe')](_0xae49('0x16'),_0x199891['params'][_0xae49('0x11')])});})[_0xae49('0xc')](handleError(_0x1e7484,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 7b7553a..b295b2d 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 _0xee5b=['/:id','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x364553,_0x332074){var _0x41a185=function(_0x3a53fe){while(--_0x3a53fe){_0x364553['push'](_0x364553['shift']());}};_0x41a185(++_0x332074);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5a72d5,_0x3a6b8e){_0x5a72d5=_0x5a72d5-0x0;var _0x4f06d8=_0xee5b[_0x5a72d5];return _0x4f06d8;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var auth=require(_0xbee5('0x4'));var interaction=require(_0xbee5('0x5'));var config=require(_0xbee5('0x6'));var controller=require('./tag.controller');router['get']('/',auth[_0xbee5('0x7')](),controller[_0xbee5('0x8')]);router[_0xbee5('0x9')](_0xbee5('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbee5('0xb')](_0xbee5('0xa'),auth[_0xbee5('0x7')](),controller[_0xbee5('0xc')]);router['delete'](_0xbee5('0xa'),auth[_0xbee5('0x7')](),controller[_0xbee5('0xd')]);module[_0xbee5('0xe')]=router; \ No newline at end of file +var _0xf4eb=['../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','Router'];(function(_0x2647c7,_0x4f3d93){var _0xda326a=function(_0x29e283){while(--_0x29e283){_0x2647c7['push'](_0x2647c7['shift']());}};_0xda326a(++_0x4f3d93);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3200cd,_0x28fa29){_0x3200cd=_0x3200cd-0x0;var _0x20172b=_0xf4eb[_0x3200cd];return _0x20172b;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf4e('0x2'));var controller=require(_0xbf4e('0x3'));router[_0xbf4e('0x4')]('/',auth[_0xbf4e('0x5')](),controller[_0xbf4e('0x6')]);router[_0xbf4e('0x4')](_0xbf4e('0x7'),auth['isAuthenticated'](),controller[_0xbf4e('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')](_0xbf4e('0x7'),auth[_0xbf4e('0x5')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')](_0xbf4e('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbf4e('0xd')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 0f0f12d..cb2be0d 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 _0x4fc2=['STRING','name','#0091EA','sequelize','exports'];(function(_0x3634d8,_0xbfa70b){var _0x2c1369=function(_0x27b79a){while(--_0x27b79a){_0x3634d8['push'](_0x3634d8['shift']());}};_0x2c1369(++_0xbfa70b);}(_0x4fc2,0x111));var _0x24fc=function(_0x3c8793,_0x5e8b3d){_0x3c8793=_0x3c8793-0x0;var _0x1811a7=_0x4fc2[_0x3c8793];return _0x1811a7;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'name':{'type':Sequelize[_0x24fc('0x2')],'unique':_0x24fc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x24fc('0x4')},'description':{'type':Sequelize[_0x24fc('0x2')]}}; \ No newline at end of file +var _0x4483=['exports','STRING','#0091EA','sequelize'];(function(_0xca9674,_0x3d301d){var _0xffcfe8=function(_0x340444){while(--_0x340444){_0xca9674['push'](_0xca9674['shift']());}};_0xffcfe8(++_0x3d301d);}(_0x4483,0x1a3));var _0x3448=function(_0x2fff57,_0x5072a9){_0x2fff57=_0x2fff57-0x0;var _0x41804c=_0x4483[_0x2fff57];return _0x41804c;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'name':{'type':Sequelize[_0x3448('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3448('0x2')],'defaultValue':_0x3448('0x3')},'description':{'type':Sequelize[_0x3448('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 70c306a..a46af11 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 _0xe057=['length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Tags','UserProfileResource','error','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0xe057,0x6c));var _0x7e05=function(_0x159c46,_0x2ddfa0){_0x159c46=_0x159c46-0x0;var _0x4da3ca=_0xe057[_0x159c46];return _0x4da3ca;};'use strict';var pdf=require(_0x7e05('0x0'));var emlformat=require(_0x7e05('0x1'));var rimraf=require(_0x7e05('0x2'));var zipdir=require(_0x7e05('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e05('0x4'));var moment=require(_0x7e05('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7e05('0x6'));var util=require('util');var path=require(_0x7e05('0x7'));var sox=require(_0x7e05('0x8'));var csv=require('to-csv');var ejs=require(_0x7e05('0x9'));var fs=require('fs');var _=require(_0x7e05('0xa'));var squel=require(_0x7e05('0xb'));var crypto=require(_0x7e05('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7e05('0xd'));var toCsv=require(_0x7e05('0xe'));var querystring=require(_0x7e05('0xf'));var Papa=require(_0x7e05('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e05('0x11'));var as=require(_0x7e05('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7e05('0x13'));var utils=require(_0x7e05('0x14'));var config=require('../../config/environment');var db=require(_0x7e05('0x15'))['db'];function respondWithStatusCode(_0x308fd2,_0x21a8f4){_0x21a8f4=_0x21a8f4||0xcc;return function(_0x3dc61e){if(_0x3dc61e){return _0x308fd2[_0x7e05('0x16')](_0x21a8f4);}return _0x308fd2[_0x7e05('0x17')](_0x21a8f4)[_0x7e05('0x18')]();};}function respondWithResult(_0x51dfa5,_0x545087){_0x545087=_0x545087||0xc8;return function(_0x3253db){if(_0x3253db){return _0x51dfa5[_0x7e05('0x17')](_0x545087)[_0x7e05('0x19')](_0x3253db);}};}function respondWithFilteredResult(_0x1cd704,_0x206ca2){return function(_0x4b922f){if(_0x4b922f){var _0xd4684=_0x4b922f['count'],_0x3c3e67=_0x206ca2[_0x7e05('0x1a')],_0x4e5c09=_0x206ca2[_0x7e05('0x1a')]+_0x206ca2[_0x7e05('0x1b')],_0x58941f;if(_0x4e5c09>=_0xd4684){_0x4e5c09=_0xd4684;_0x58941f=0xc8;}else{_0x58941f=0xce;}_0x1cd704[_0x7e05('0x17')](_0x58941f);return _0x1cd704[_0x7e05('0x1c')](_0x7e05('0x1d'),_0x3c3e67+'-'+_0x4e5c09+'/'+_0xd4684)[_0x7e05('0x19')](_0x4b922f);}return null;};}function patchUpdates(_0x28f1df){return function(_0x5c4948){try{jsonpatch[_0x7e05('0x1e')](_0x5c4948,_0x28f1df,!![]);}catch(_0x28bd9a){return BPromise[_0x7e05('0x1f')](_0x28bd9a);}return _0x5c4948[_0x7e05('0x20')]();};}function saveUpdates(_0x2e99ae,_0x505b14){return function(_0x5913fa){if(_0x5913fa){return _0x5913fa[_0x7e05('0x21')](_0x2e99ae)['then'](function(_0x16afca){return _0x16afca;});}return null;};}function removeEntity(_0x40cf57,_0x2daab6){return function(_0x43d5ac){if(_0x43d5ac){return _0x43d5ac[_0x7e05('0x22')]()[_0x7e05('0x23')](function(){var _0xa10808=_0x43d5ac['get']({'plain':!![]});var _0x3cfe8b=_0x7e05('0x24');return db[_0x7e05('0x25')][_0x7e05('0x22')]({'where':{'type':_0x3cfe8b,'resourceId':_0xa10808['id']}})[_0x7e05('0x23')](function(){return _0x43d5ac;});})[_0x7e05('0x23')](function(){_0x40cf57[_0x7e05('0x17')](0xcc)[_0x7e05('0x18')]();});}};}function handleEntityNotFound(_0x232239,_0x119658){return function(_0x5112c1){if(!_0x5112c1){_0x232239[_0x7e05('0x16')](0x194);}return _0x5112c1;};}function handleError(_0x1ec552,_0x2b8762){_0x2b8762=_0x2b8762||0x1f4;return function(_0x368aba){logger[_0x7e05('0x26')](_0x368aba['stack']);if(_0x368aba[_0x7e05('0x27')]){delete _0x368aba[_0x7e05('0x27')];}_0x1ec552[_0x7e05('0x17')](_0x2b8762)[_0x7e05('0x28')](_0x368aba);};}exports[_0x7e05('0x29')]=function(_0x87e48f,_0x5b3490){var _0x2ccf3d={},_0x2afbd5={},_0x4119b6={'count':0x0,'rows':[]};var _0x163246=_[_0x7e05('0x2a')](db[_0x7e05('0x2b')][_0x7e05('0x2c')],function(_0x249b81){return{'name':_0x249b81[_0x7e05('0x2d')],'type':_0x249b81[_0x7e05('0x2e')][_0x7e05('0x2f')]};});_0x2afbd5[_0x7e05('0x30')]=_[_0x7e05('0x2a')](_0x163246,_0x7e05('0x27'));_0x2afbd5[_0x7e05('0x31')]=_[_0x7e05('0x32')](_0x87e48f[_0x7e05('0x31')]);_0x2afbd5['filters']=_['intersection'](_0x2afbd5[_0x7e05('0x30')],_0x2afbd5[_0x7e05('0x31')]);_0x2ccf3d[_0x7e05('0x33')]=_[_0x7e05('0x34')](_0x2afbd5[_0x7e05('0x30')],qs[_0x7e05('0x35')](_0x87e48f[_0x7e05('0x31')][_0x7e05('0x35')]));_0x2ccf3d[_0x7e05('0x33')]=_0x2ccf3d['attributes'][_0x7e05('0x36')]?_0x2ccf3d[_0x7e05('0x33')]:_0x2afbd5[_0x7e05('0x30')];if(!_0x87e48f[_0x7e05('0x31')][_0x7e05('0x37')]('nolimit')){_0x2ccf3d[_0x7e05('0x1b')]=qs[_0x7e05('0x1b')](_0x87e48f['query'][_0x7e05('0x1b')]);_0x2ccf3d['offset']=qs[_0x7e05('0x1a')](_0x87e48f[_0x7e05('0x31')][_0x7e05('0x1a')]);}_0x2ccf3d['order']=qs[_0x7e05('0x38')](_0x87e48f[_0x7e05('0x31')][_0x7e05('0x38')]);_0x2ccf3d[_0x7e05('0x39')]=qs['filters'](_['pick'](_0x87e48f[_0x7e05('0x31')],_0x2afbd5[_0x7e05('0x3a')]));if(_0x87e48f[_0x7e05('0x31')][_0x7e05('0x3b')]){_0x2ccf3d[_0x7e05('0x39')]=_[_0x7e05('0x3c')](_0x2ccf3d[_0x7e05('0x39')],{'$or':_[_0x7e05('0x2a')](_0x163246,function(_0x2f5376){if(_0x2f5376[_0x7e05('0x2e')]!==_0x7e05('0x3d')){var _0x53fe90={};_0x53fe90[_0x2f5376[_0x7e05('0x27')]]={'$like':'%'+_0x87e48f['query'][_0x7e05('0x3b')]+'%'};return _0x53fe90;}})});}_0x2ccf3d=_[_0x7e05('0x3c')]({},_0x2ccf3d,_0x87e48f['options']);var _0x13d99f={'where':_0x2ccf3d[_0x7e05('0x39')]};return db[_0x7e05('0x2b')][_0x7e05('0x3e')](_0x13d99f)[_0x7e05('0x23')](function(_0x5aac10){_0x4119b6['count']=_0x5aac10;if(_0x87e48f['query'][_0x7e05('0x3f')]){_0x2ccf3d[_0x7e05('0x40')]=[{'all':!![]}];}return db[_0x7e05('0x2b')][_0x7e05('0x41')](_0x2ccf3d);})['then'](function(_0x1f14f7){_0x4119b6[_0x7e05('0x42')]=_0x1f14f7;return _0x4119b6;})[_0x7e05('0x23')](respondWithFilteredResult(_0x5b3490,_0x2ccf3d))[_0x7e05('0x43')](handleError(_0x5b3490,null));};exports[_0x7e05('0x44')]=function(_0x25d785,_0x5d089c){var _0x308d0b={'raw':!![],'where':{'id':_0x25d785[_0x7e05('0x45')]['id']}},_0x306580={};_0x306580[_0x7e05('0x30')]=_[_0x7e05('0x32')](db[_0x7e05('0x2b')][_0x7e05('0x2c')]);_0x306580[_0x7e05('0x31')]=_[_0x7e05('0x32')](_0x25d785[_0x7e05('0x31')]);_0x306580[_0x7e05('0x3a')]=_[_0x7e05('0x34')](_0x306580['model'],_0x306580[_0x7e05('0x31')]);_0x308d0b[_0x7e05('0x33')]=_['intersection'](_0x306580[_0x7e05('0x30')],qs[_0x7e05('0x35')](_0x25d785[_0x7e05('0x31')]['fields']));_0x308d0b[_0x7e05('0x33')]=_0x308d0b[_0x7e05('0x33')]['length']?_0x308d0b['attributes']:_0x306580[_0x7e05('0x30')];if(_0x25d785[_0x7e05('0x31')][_0x7e05('0x3f')]){_0x308d0b['include']=[{'all':!![]}];}_0x308d0b=_[_0x7e05('0x3c')]({},_0x308d0b,_0x25d785[_0x7e05('0x46')]);return db[_0x7e05('0x2b')][_0x7e05('0x47')](_0x308d0b)[_0x7e05('0x23')](handleEntityNotFound(_0x5d089c,null))[_0x7e05('0x23')](respondWithResult(_0x5d089c,null))['catch'](handleError(_0x5d089c,null));};exports[_0x7e05('0x48')]=function(_0x14ad19,_0x174b1c){return db[_0x7e05('0x2b')][_0x7e05('0x48')](_0x14ad19[_0x7e05('0x49')],{})[_0x7e05('0x23')](function(_0x534284){var _0x5ede07=_0x14ad19[_0x7e05('0x4a')][_0x7e05('0x4b')]({'plain':!![]});if(!_0x5ede07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ede07[_0x7e05('0x4c')]===_0x7e05('0x4a')){var _0x3409d3=_0x534284[_0x7e05('0x4b')]({'plain':!![]});var _0xdcf732=_0x7e05('0x24');return db[_0x7e05('0x4d')][_0x7e05('0x47')]({'where':{'name':_0xdcf732,'userProfileId':_0x5ede07[_0x7e05('0x4e')]},'raw':!![]})['then'](function(_0x540dff){if(_0x540dff&&_0x540dff[_0x7e05('0x4f')]===0x0){return db[_0x7e05('0x25')][_0x7e05('0x48')]({'name':_0x3409d3[_0x7e05('0x27')],'resourceId':_0x3409d3['id'],'type':_0x540dff[_0x7e05('0x27')],'sectionId':_0x540dff['id']},{})[_0x7e05('0x23')](function(){return _0x534284;});}else{return _0x534284;}})[_0x7e05('0x43')](function(_0x129639){logger[_0x7e05('0x26')](_0x7e05('0x50'),_0x129639);throw _0x129639;});}return _0x534284;})[_0x7e05('0x23')](respondWithResult(_0x174b1c,0xc9))[_0x7e05('0x43')](handleError(_0x174b1c,null));};exports['update']=function(_0xf86120,_0x5056ee){if(_0xf86120['body']['id']){delete _0xf86120[_0x7e05('0x49')]['id'];}return db[_0x7e05('0x2b')][_0x7e05('0x47')]({'where':{'id':_0xf86120[_0x7e05('0x45')]['id']}})[_0x7e05('0x23')](handleEntityNotFound(_0x5056ee,null))[_0x7e05('0x23')](saveUpdates(_0xf86120['body'],null))[_0x7e05('0x23')](respondWithResult(_0x5056ee,null))[_0x7e05('0x43')](handleError(_0x5056ee,null));};exports['destroy']=function(_0x55cd2f,_0x3652b3){return db[_0x7e05('0x2b')][_0x7e05('0x47')]({'where':{'id':_0x55cd2f[_0x7e05('0x45')]['id']}})[_0x7e05('0x23')](handleEntityNotFound(_0x3652b3,null))[_0x7e05('0x23')](removeEntity(_0x3652b3,null))[_0x7e05('0x43')](handleError(_0x3652b3,null));}; \ No newline at end of file +var _0x73a7=['Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Tag','includeAll','findAll','rows','show','length','include','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','set'];(function(_0x27c190,_0x550696){var _0x45661e=function(_0x433abd){while(--_0x433abd){_0x27c190['push'](_0x27c190['shift']());}};_0x45661e(++_0x550696);}(_0x73a7,0x127));var _0x773a=function(_0x2f7461,_0x53c433){_0x2f7461=_0x2f7461-0x0;var _0x371b32=_0x73a7[_0x2f7461];return _0x371b32;};'use strict';var pdf=require(_0x773a('0x0'));var emlformat=require(_0x773a('0x1'));var rimraf=require(_0x773a('0x2'));var zipdir=require(_0x773a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x773a('0x4'));var moment=require(_0x773a('0x5'));var BPromise=require(_0x773a('0x6'));var Mustache=require(_0x773a('0x7'));var util=require('util');var path=require('path');var sox=require(_0x773a('0x8'));var csv=require('to-csv');var ejs=require(_0x773a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x773a('0xa'));var jsforce=require(_0x773a('0xb'));var deskjs=require(_0x773a('0xc'));var toCsv=require(_0x773a('0xd'));var querystring=require(_0x773a('0xe'));var Papa=require(_0x773a('0xf'));var Redis=require('ioredis');var authService=require(_0x773a('0x10'));var qs=require(_0x773a('0x11'));var as=require(_0x773a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x773a('0x13'));var utils=require(_0x773a('0x14'));var config=require('../../config/environment');var db=require(_0x773a('0x15'))['db'];function respondWithStatusCode(_0x3d6bea,_0x4ed310){_0x4ed310=_0x4ed310||0xcc;return function(_0x4b8bfb){if(_0x4b8bfb){return _0x3d6bea['sendStatus'](_0x4ed310);}return _0x3d6bea['status'](_0x4ed310)[_0x773a('0x16')]();};}function respondWithResult(_0x170a97,_0x3406f5){_0x3406f5=_0x3406f5||0xc8;return function(_0x24ed7e){if(_0x24ed7e){return _0x170a97[_0x773a('0x17')](_0x3406f5)[_0x773a('0x18')](_0x24ed7e);}};}function respondWithFilteredResult(_0x59f0c5,_0x429b41){return function(_0x51755b){if(_0x51755b){var _0x1a8c92=_0x51755b[_0x773a('0x19')],_0x377a49=_0x429b41[_0x773a('0x1a')],_0x5f2d08=_0x429b41[_0x773a('0x1a')]+_0x429b41[_0x773a('0x1b')],_0x5ea9e2;if(_0x5f2d08>=_0x1a8c92){_0x5f2d08=_0x1a8c92;_0x5ea9e2=0xc8;}else{_0x5ea9e2=0xce;}_0x59f0c5['status'](_0x5ea9e2);return _0x59f0c5[_0x773a('0x1c')](_0x773a('0x1d'),_0x377a49+'-'+_0x5f2d08+'/'+_0x1a8c92)[_0x773a('0x18')](_0x51755b);}return null;};}function patchUpdates(_0x269d5d){return function(_0x5857a9){try{jsonpatch[_0x773a('0x1e')](_0x5857a9,_0x269d5d,!![]);}catch(_0x23677a){return BPromise[_0x773a('0x1f')](_0x23677a);}return _0x5857a9['save']();};}function saveUpdates(_0x42aa90,_0x25be07){return function(_0x223ab5){if(_0x223ab5){return _0x223ab5[_0x773a('0x20')](_0x42aa90)[_0x773a('0x21')](function(_0x3acebc){return _0x3acebc;});}return null;};}function removeEntity(_0x1c31fb,_0x33f4fe){return function(_0x302b7a){if(_0x302b7a){return _0x302b7a[_0x773a('0x22')]()[_0x773a('0x21')](function(){var _0x58dfa2=_0x302b7a[_0x773a('0x23')]({'plain':!![]});var _0x5c18b5='Tags';return db[_0x773a('0x24')][_0x773a('0x22')]({'where':{'type':_0x5c18b5,'resourceId':_0x58dfa2['id']}})['then'](function(){return _0x302b7a;});})[_0x773a('0x21')](function(){_0x1c31fb['status'](0xcc)[_0x773a('0x16')]();});}};}function handleEntityNotFound(_0x470e03,_0x5bf6ed){return function(_0x22b1f3){if(!_0x22b1f3){_0x470e03[_0x773a('0x25')](0x194);}return _0x22b1f3;};}function handleError(_0x5e14a6,_0x1036f6){_0x1036f6=_0x1036f6||0x1f4;return function(_0x4a7f00){logger[_0x773a('0x26')](_0x4a7f00[_0x773a('0x27')]);if(_0x4a7f00[_0x773a('0x28')]){delete _0x4a7f00[_0x773a('0x28')];}_0x5e14a6[_0x773a('0x17')](_0x1036f6)[_0x773a('0x29')](_0x4a7f00);};}exports[_0x773a('0x2a')]=function(_0x2d63af,_0x883a33){var _0x26b0aa={},_0x2b9166={},_0x54a7b6={'count':0x0,'rows':[]};var _0x52d160=_[_0x773a('0x2b')](db['Tag'][_0x773a('0x2c')],function(_0x4b2628){return{'name':_0x4b2628[_0x773a('0x2d')],'type':_0x4b2628[_0x773a('0x2e')][_0x773a('0x2f')]};});_0x2b9166['model']=_[_0x773a('0x2b')](_0x52d160,_0x773a('0x28'));_0x2b9166['query']=_[_0x773a('0x30')](_0x2d63af[_0x773a('0x31')]);_0x2b9166[_0x773a('0x32')]=_[_0x773a('0x33')](_0x2b9166[_0x773a('0x34')],_0x2b9166[_0x773a('0x31')]);_0x26b0aa[_0x773a('0x35')]=_[_0x773a('0x33')](_0x2b9166[_0x773a('0x34')],qs[_0x773a('0x36')](_0x2d63af[_0x773a('0x31')][_0x773a('0x36')]));_0x26b0aa[_0x773a('0x35')]=_0x26b0aa['attributes']['length']?_0x26b0aa['attributes']:_0x2b9166['model'];if(!_0x2d63af[_0x773a('0x31')][_0x773a('0x37')](_0x773a('0x38'))){_0x26b0aa[_0x773a('0x1b')]=qs['limit'](_0x2d63af['query']['limit']);_0x26b0aa[_0x773a('0x1a')]=qs[_0x773a('0x1a')](_0x2d63af[_0x773a('0x31')]['offset']);}_0x26b0aa[_0x773a('0x39')]=qs[_0x773a('0x3a')](_0x2d63af[_0x773a('0x31')][_0x773a('0x3a')]);_0x26b0aa[_0x773a('0x3b')]=qs[_0x773a('0x32')](_[_0x773a('0x3c')](_0x2d63af[_0x773a('0x31')],_0x2b9166[_0x773a('0x32')]));if(_0x2d63af[_0x773a('0x31')][_0x773a('0x3d')]){_0x26b0aa[_0x773a('0x3b')]=_[_0x773a('0x3e')](_0x26b0aa[_0x773a('0x3b')],{'$or':_[_0x773a('0x2b')](_0x52d160,function(_0x5a926f){if(_0x5a926f[_0x773a('0x2e')]!=='VIRTUAL'){var _0x46c20e={};_0x46c20e[_0x5a926f[_0x773a('0x28')]]={'$like':'%'+_0x2d63af[_0x773a('0x31')][_0x773a('0x3d')]+'%'};return _0x46c20e;}})});}_0x26b0aa=_[_0x773a('0x3e')]({},_0x26b0aa,_0x2d63af[_0x773a('0x3f')]);var _0x4102b2={'where':_0x26b0aa['where']};return db[_0x773a('0x40')][_0x773a('0x19')](_0x4102b2)[_0x773a('0x21')](function(_0x5dff5f){_0x54a7b6[_0x773a('0x19')]=_0x5dff5f;if(_0x2d63af[_0x773a('0x31')][_0x773a('0x41')]){_0x26b0aa['include']=[{'all':!![]}];}return db[_0x773a('0x40')][_0x773a('0x42')](_0x26b0aa);})[_0x773a('0x21')](function(_0xcf2b21){_0x54a7b6[_0x773a('0x43')]=_0xcf2b21;return _0x54a7b6;})[_0x773a('0x21')](respondWithFilteredResult(_0x883a33,_0x26b0aa))['catch'](handleError(_0x883a33,null));};exports[_0x773a('0x44')]=function(_0x2515fe,_0x12acc1){var _0x4ed2bf={'raw':!![],'where':{'id':_0x2515fe['params']['id']}},_0x14f0e1={};_0x14f0e1[_0x773a('0x34')]=_[_0x773a('0x30')](db[_0x773a('0x40')][_0x773a('0x2c')]);_0x14f0e1[_0x773a('0x31')]=_['keys'](_0x2515fe[_0x773a('0x31')]);_0x14f0e1[_0x773a('0x32')]=_['intersection'](_0x14f0e1['model'],_0x14f0e1[_0x773a('0x31')]);_0x4ed2bf[_0x773a('0x35')]=_[_0x773a('0x33')](_0x14f0e1[_0x773a('0x34')],qs[_0x773a('0x36')](_0x2515fe[_0x773a('0x31')]['fields']));_0x4ed2bf[_0x773a('0x35')]=_0x4ed2bf['attributes'][_0x773a('0x45')]?_0x4ed2bf[_0x773a('0x35')]:_0x14f0e1[_0x773a('0x34')];if(_0x2515fe[_0x773a('0x31')][_0x773a('0x41')]){_0x4ed2bf[_0x773a('0x46')]=[{'all':!![]}];}_0x4ed2bf=_[_0x773a('0x3e')]({},_0x4ed2bf,_0x2515fe[_0x773a('0x3f')]);return db[_0x773a('0x40')]['find'](_0x4ed2bf)[_0x773a('0x21')](handleEntityNotFound(_0x12acc1,null))[_0x773a('0x21')](respondWithResult(_0x12acc1,null))[_0x773a('0x47')](handleError(_0x12acc1,null));};exports['create']=function(_0x4ac3c4,_0x399dec){return db['Tag']['create'](_0x4ac3c4[_0x773a('0x48')],{})[_0x773a('0x21')](function(_0x48a0e3){var _0x3baf8d=_0x4ac3c4[_0x773a('0x49')]['get']({'plain':!![]});if(!_0x3baf8d)throw new Error(_0x773a('0x4a'));if(_0x3baf8d[_0x773a('0x4b')]==='user'){var _0xcb926=_0x48a0e3['get']({'plain':!![]});var _0x88e79c=_0x773a('0x4c');return db['UserProfileSection'][_0x773a('0x4d')]({'where':{'name':_0x88e79c,'userProfileId':_0x3baf8d[_0x773a('0x4e')]},'raw':!![]})[_0x773a('0x21')](function(_0x3fb00f){if(_0x3fb00f&&_0x3fb00f['autoAssociation']===0x0){return db[_0x773a('0x24')]['create']({'name':_0xcb926[_0x773a('0x28')],'resourceId':_0xcb926['id'],'type':_0x3fb00f[_0x773a('0x28')],'sectionId':_0x3fb00f['id']},{})[_0x773a('0x21')](function(){return _0x48a0e3;});}else{return _0x48a0e3;}})[_0x773a('0x47')](function(_0xa35f43){logger['error'](_0x773a('0x4f'),_0xa35f43);throw _0xa35f43;});}return _0x48a0e3;})[_0x773a('0x21')](respondWithResult(_0x399dec,0xc9))['catch'](handleError(_0x399dec,null));};exports[_0x773a('0x20')]=function(_0x4b17f9,_0x879fe7){if(_0x4b17f9[_0x773a('0x48')]['id']){delete _0x4b17f9[_0x773a('0x48')]['id'];}return db[_0x773a('0x40')]['find']({'where':{'id':_0x4b17f9[_0x773a('0x50')]['id']}})[_0x773a('0x21')](handleEntityNotFound(_0x879fe7,null))['then'](saveUpdates(_0x4b17f9[_0x773a('0x48')],null))['then'](respondWithResult(_0x879fe7,null))[_0x773a('0x47')](handleError(_0x879fe7,null));};exports[_0x773a('0x22')]=function(_0x28e92c,_0x55e131){return db[_0x773a('0x40')][_0x773a('0x4d')]({'where':{'id':_0x28e92c[_0x773a('0x50')]['id']}})[_0x773a('0x21')](handleEntityNotFound(_0x55e131,null))[_0x773a('0x21')](removeEntity(_0x55e131,null))[_0x773a('0x47')](handleError(_0x55e131,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6e8b543..1deb2d3 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 _0xfbe8=['api','moment','bluebird','path','rimraf','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x428d83,_0x177637){var _0x181681=function(_0x33a10d){while(--_0x33a10d){_0x428d83['push'](_0x428d83['shift']());}};_0x181681(++_0x177637);}(_0xfbe8,0x152));var _0x8fbe=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xfbe8[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x8fbe('0x0'));var util=require(_0x8fbe('0x1'));var logger=require(_0x8fbe('0x2'))(_0x8fbe('0x3'));var moment=require(_0x8fbe('0x4'));var BPromise=require(_0x8fbe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fbe('0x6'));var rimraf=require(_0x8fbe('0x7'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module['exports']=function(_0x2035fa,_0x47a254){return _0x2035fa[_0x8fbe('0x8')](_0x8fbe('0x9'),attributes,{'tableName':_0x8fbe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18f3=['define','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x34d03a,_0x5828f9){var _0x53e53c=function(_0x316cf7){while(--_0x316cf7){_0x34d03a['push'](_0x34d03a['shift']());}};_0x53e53c(++_0x5828f9);}(_0x18f3,0x19f));var _0x318f=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x18f3[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0x318f('0x0'));var logger=require(_0x318f('0x1'))(_0x318f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x318f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x318f('0x4'));var config=require(_0x318f('0x5'));var attributes=require(_0x318f('0x6'));module[_0x318f('0x7')]=function(_0x52e7bc,_0x5f7340){return _0x52e7bc[_0x318f('0x8')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 73403f8..2318563 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 _0xf290=['message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf290,0xde));var _0x0f29=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xf290[_0x31b5b2];return _0x364f13;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('Tag,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});} \ No newline at end of file +var _0x76dc=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x2995fc,_0x21ce58){var _0x559612=function(_0x446229){while(--_0x446229){_0x2995fc['push'](_0x2995fc['shift']());}};_0x559612(++_0x21ce58);}(_0x76dc,0x1f2));var _0xc76d=function(_0x3e842b,_0x302885){_0x3e842b=_0x3e842b-0x0;var _0x143ec2=_0x76dc[_0x3e842b];return _0x143ec2;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var moment=require(_0xc76d('0x2'));var BPromise=require(_0xc76d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76d('0x4'));var db=require(_0xc76d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc76d('0x7'));var client=jayson[_0xc76d('0x8')][_0xc76d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4832bd,_0x4ce0bd,_0x119f38){return new BPromise(function(_0x114572,_0x18574f){return client['request'](_0x4832bd,_0x119f38)['then'](function(_0x1dc996){logger[_0xc76d('0xa')]('Tag,\x20%s,\x20%s',_0x4ce0bd,_0xc76d('0xb'));logger['debug'](_0xc76d('0xc'),_0x4ce0bd,_0xc76d('0xb'),JSON[_0xc76d('0xd')](_0x1dc996));if(_0x1dc996[_0xc76d('0xe')]){if(_0x1dc996[_0xc76d('0xe')][_0xc76d('0xf')]===0x1f4){logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);return _0x18574f(_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);}logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996['error'][_0xc76d('0x11')]);return _0x114572(_0x1dc996[_0xc76d('0xe')]['message']);}else{logger[_0xc76d('0xa')](_0xc76d('0x10'),_0x4ce0bd,_0xc76d('0xb'));_0x114572(_0x1dc996[_0xc76d('0x12')]['message']);}})[_0xc76d('0x13')](function(_0x5d881c){logger['error'](_0xc76d('0x10'),_0x4ce0bd,_0x5d881c);_0x18574f(_0x5d881c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index eaeaae3..97c4984 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 _0x27de=['isAuthenticated','index','/:id','show','/:id/users','getAgents','post','create','/:id/queues','addQueues','addAgents','delete','destroy','removeQueues','removeAgents','multer','util','path','connect-timeout','express','Router','../../config/environment','./team.controller','get'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x27de,0xe7));var _0xe27d=function(_0x20ad0f,_0x26ba89){_0x20ad0f=_0x20ad0f-0x0;var _0xa85a56=_0x27de[_0x20ad0f];return _0xa85a56;};'use strict';var multer=require(_0xe27d('0x0'));var util=require(_0xe27d('0x1'));var path=require(_0xe27d('0x2'));var timeout=require(_0xe27d('0x3'));var express=require(_0xe27d('0x4'));var router=express[_0xe27d('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe27d('0x6'));var controller=require(_0xe27d('0x7'));router[_0xe27d('0x8')]('/',auth[_0xe27d('0x9')](),controller[_0xe27d('0xa')]);router[_0xe27d('0x8')](_0xe27d('0xb'),auth[_0xe27d('0x9')](),controller[_0xe27d('0xc')]);router['get']('/:id/queues',auth[_0xe27d('0x9')](),controller['getQueues']);router[_0xe27d('0x8')](_0xe27d('0xd'),auth[_0xe27d('0x9')](),controller[_0xe27d('0xe')]);router[_0xe27d('0xf')]('/',auth[_0xe27d('0x9')](),controller[_0xe27d('0x10')]);router[_0xe27d('0xf')](_0xe27d('0x11'),auth[_0xe27d('0x9')](),controller[_0xe27d('0x12')]);router[_0xe27d('0xf')](_0xe27d('0xd'),auth[_0xe27d('0x9')](),controller[_0xe27d('0x13')]);router['put'](_0xe27d('0xb'),auth[_0xe27d('0x9')](),controller['update']);router[_0xe27d('0x14')](_0xe27d('0xb'),auth[_0xe27d('0x9')](),controller[_0xe27d('0x15')]);router[_0xe27d('0x14')](_0xe27d('0x11'),auth[_0xe27d('0x9')](),controller[_0xe27d('0x16')]);router[_0xe27d('0x14')](_0xe27d('0xd'),auth[_0xe27d('0x9')](),controller[_0xe27d('0x17')]);module['exports']=router; \ No newline at end of file +var _0x55bc=['./team.controller','get','index','/:id','isAuthenticated','show','getQueues','post','create','addQueues','/:id/users','addAgents','put','update','delete','destroy','removeAgents','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x55bc,0x1f1));var _0xc55b=function(_0x12fdf8,_0x33d31c){_0x12fdf8=_0x12fdf8-0x0;var _0x538092=_0x55bc[_0x12fdf8];return _0x538092;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc55b('0x0'));var timeout=require(_0xc55b('0x1'));var express=require(_0xc55b('0x2'));var router=express[_0xc55b('0x3')]();var auth=require(_0xc55b('0x4'));var interaction=require(_0xc55b('0x5'));var config=require(_0xc55b('0x6'));var controller=require(_0xc55b('0x7'));router[_0xc55b('0x8')]('/',auth['isAuthenticated'](),controller[_0xc55b('0x9')]);router[_0xc55b('0x8')](_0xc55b('0xa'),auth[_0xc55b('0xb')](),controller[_0xc55b('0xc')]);router[_0xc55b('0x8')]('/:id/queues',auth[_0xc55b('0xb')](),controller[_0xc55b('0xd')]);router[_0xc55b('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xc55b('0xe')]('/',auth[_0xc55b('0xb')](),controller[_0xc55b('0xf')]);router[_0xc55b('0xe')]('/:id/queues',auth[_0xc55b('0xb')](),controller[_0xc55b('0x10')]);router[_0xc55b('0xe')](_0xc55b('0x11'),auth[_0xc55b('0xb')](),controller[_0xc55b('0x12')]);router[_0xc55b('0x13')](_0xc55b('0xa'),auth[_0xc55b('0xb')](),controller[_0xc55b('0x14')]);router[_0xc55b('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc55b('0x16')]);router[_0xc55b('0x15')]('/:id/queues',auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0xc55b('0x11'),auth[_0xc55b('0xb')](),controller[_0xc55b('0x17')]);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 396d496..a543f60 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 _0x0f00=['name','sequelize','exports','STRING'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x0f00,0xb1));var _0x00f0=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x0f00[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x00f0('0x0'));module[_0x00f0('0x1')]={'name':{'type':Sequelize[_0x00f0('0x2')],'allowNull':![],'unique':_0x00f0('0x3')},'description':{'type':Sequelize[_0x00f0('0x2')]}}; \ No newline at end of file +var _0xf767=['STRING','sequelize','exports'];(function(_0x41cf1c,_0x25244c){var _0x25d457=function(_0x46a004){while(--_0x46a004){_0x41cf1c['push'](_0x41cf1c['shift']());}};_0x25d457(++_0x25244c);}(_0xf767,0xe2));var _0x7f76=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xf767[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x7f76('0x0'));module[_0x7f76('0x1')]={'name':{'type':Sequelize[_0x7f76('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7f76('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index dc3f63e..456ece3 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 _0x8ff9=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','findOne','Sequelize','add','ids','addAgents','Voice','Chat','Mail','Sms','Fax','each','User','online','UserVoiceQueueRt','upsert','interface','format','SIP/%s','spread','emit','voice','chat','fax','openchannel','removeAgents','isArray','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','defaults','redis','localhost','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','Teams','end','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','user','role','UserProfileSection','userProfileId'];(function(_0x327867,_0x69bd8a){var _0x4d5e35=function(_0x4d5d0b){while(--_0x4d5d0b){_0x327867['push'](_0x327867['shift']());}};_0x4d5e35(++_0x69bd8a);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x35f82f,_0xe6d632){_0x35f82f=_0x35f82f-0x0;var _0x4741ff=_0x8ff9[_0x35f82f];return _0x4741ff;};'use strict';var pdf=require(_0x98ff('0x0'));var emlformat=require(_0x98ff('0x1'));var rimraf=require(_0x98ff('0x2'));var zipdir=require(_0x98ff('0x3'));var jsonpatch=require(_0x98ff('0x4'));var rp=require(_0x98ff('0x5'));var moment=require(_0x98ff('0x6'));var BPromise=require(_0x98ff('0x7'));var Mustache=require(_0x98ff('0x8'));var util=require(_0x98ff('0x9'));var path=require(_0x98ff('0xa'));var sox=require('sox');var csv=require(_0x98ff('0xb'));var ejs=require(_0x98ff('0xc'));var fs=require('fs');var _=require(_0x98ff('0xd'));var squel=require(_0x98ff('0xe'));var crypto=require(_0x98ff('0xf'));var jsforce=require(_0x98ff('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x98ff('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x98ff('0x11'));var authService=require(_0x98ff('0x12'));var qs=require(_0x98ff('0x13'));var as=require(_0x98ff('0x14'));var hardwareService=require(_0x98ff('0x15'));var logger=require('../../config/logger')(_0x98ff('0x16'));var utils=require('../../config/utils');var config=require(_0x98ff('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x98ff('0x18')](config[_0x98ff('0x19')],{'host':_0x98ff('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x98ff('0x19')]));require('./team.socket')[_0x98ff('0x1b')](socket);function respondWithStatusCode(_0x373e14,_0x2c4e4d){_0x2c4e4d=_0x2c4e4d||0xcc;return function(_0x3a7e21){if(_0x3a7e21){return _0x373e14[_0x98ff('0x1c')](_0x2c4e4d);}return _0x373e14[_0x98ff('0x1d')](_0x2c4e4d)['end']();};}function respondWithResult(_0x3573a4,_0x196f27){_0x196f27=_0x196f27||0xc8;return function(_0xb48c72){if(_0xb48c72){return _0x3573a4[_0x98ff('0x1d')](_0x196f27)[_0x98ff('0x1e')](_0xb48c72);}};}function respondWithFilteredResult(_0x5644b6,_0x1f3044){return function(_0x33023e){if(_0x33023e){var _0x268121=_0x33023e[_0x98ff('0x1f')],_0x3c04d4=_0x1f3044[_0x98ff('0x20')],_0x91e31c=_0x1f3044['offset']+_0x1f3044[_0x98ff('0x21')],_0x1611b5;if(_0x91e31c>=_0x268121){_0x91e31c=_0x268121;_0x1611b5=0xc8;}else{_0x1611b5=0xce;}_0x5644b6[_0x98ff('0x1d')](_0x1611b5);return _0x5644b6[_0x98ff('0x22')](_0x98ff('0x23'),_0x3c04d4+'-'+_0x91e31c+'/'+_0x268121)[_0x98ff('0x1e')](_0x33023e);}return null;};}function patchUpdates(_0x26e589){return function(_0x205633){try{jsonpatch[_0x98ff('0x24')](_0x205633,_0x26e589,!![]);}catch(_0x165b0f){return BPromise[_0x98ff('0x25')](_0x165b0f);}return _0x205633[_0x98ff('0x26')]();};}function saveUpdates(_0x2b21be,_0x2fdbc2){return function(_0x4ea518){if(_0x4ea518){return _0x4ea518['update'](_0x2b21be)['then'](function(_0x27a070){return _0x27a070;});}return null;};}function removeEntity(_0x3ee01b,_0x547fab){return function(_0xd0293e){if(_0xd0293e){return _0xd0293e['destroy']()[_0x98ff('0x27')](function(){var _0x10b8d0=_0xd0293e[_0x98ff('0x28')]({'plain':!![]});var _0x2b3ee9=_0x98ff('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x2b3ee9,'resourceId':_0x10b8d0['id']}})[_0x98ff('0x27')](function(){return _0xd0293e;});})[_0x98ff('0x27')](function(){_0x3ee01b[_0x98ff('0x1d')](0xcc)[_0x98ff('0x2a')]();});}};}function handleEntityNotFound(_0x8b7939,_0x231e00){return function(_0x1c7fdb){if(!_0x1c7fdb){_0x8b7939[_0x98ff('0x1c')](0x194);}return _0x1c7fdb;};}function handleError(_0xda7649,_0x25a658){_0x25a658=_0x25a658||0x1f4;return function(_0x4b6e9c){logger[_0x98ff('0x2b')](_0x4b6e9c[_0x98ff('0x2c')]);if(_0x4b6e9c[_0x98ff('0x2d')]){delete _0x4b6e9c[_0x98ff('0x2d')];}_0xda7649[_0x98ff('0x1d')](_0x25a658)[_0x98ff('0x2e')](_0x4b6e9c);};}exports[_0x98ff('0x2f')]=function(_0x41c093,_0x42213a){var _0x205d85={},_0x3fa70c={},_0x1472cb={'count':0x0,'rows':[]};var _0x257722=_[_0x98ff('0x30')](db[_0x98ff('0x31')][_0x98ff('0x32')],function(_0x249807){return{'name':_0x249807[_0x98ff('0x33')],'type':_0x249807[_0x98ff('0x34')][_0x98ff('0x35')]};});_0x3fa70c[_0x98ff('0x36')]=_['map'](_0x257722,_0x98ff('0x2d'));_0x3fa70c[_0x98ff('0x37')]=_[_0x98ff('0x38')](_0x41c093[_0x98ff('0x37')]);_0x3fa70c[_0x98ff('0x39')]=_['intersection'](_0x3fa70c[_0x98ff('0x36')],_0x3fa70c['query']);_0x205d85[_0x98ff('0x3a')]=_[_0x98ff('0x3b')](_0x3fa70c[_0x98ff('0x36')],qs[_0x98ff('0x3c')](_0x41c093[_0x98ff('0x37')][_0x98ff('0x3c')]));_0x205d85[_0x98ff('0x3a')]=_0x205d85[_0x98ff('0x3a')][_0x98ff('0x3d')]?_0x205d85[_0x98ff('0x3a')]:_0x3fa70c['model'];if(!_0x41c093[_0x98ff('0x37')][_0x98ff('0x3e')](_0x98ff('0x3f'))){_0x205d85[_0x98ff('0x21')]=qs[_0x98ff('0x21')](_0x41c093[_0x98ff('0x37')][_0x98ff('0x21')]);_0x205d85[_0x98ff('0x20')]=qs['offset'](_0x41c093[_0x98ff('0x37')]['offset']);}_0x205d85[_0x98ff('0x40')]=qs[_0x98ff('0x41')](_0x41c093[_0x98ff('0x37')][_0x98ff('0x41')]);_0x205d85[_0x98ff('0x42')]=qs['filters'](_['pick'](_0x41c093[_0x98ff('0x37')],_0x3fa70c[_0x98ff('0x39')]));if(_0x41c093[_0x98ff('0x37')][_0x98ff('0x43')]){_0x205d85[_0x98ff('0x42')]=_[_0x98ff('0x44')](_0x205d85[_0x98ff('0x42')],{'$or':_['map'](_0x257722,function(_0x263e85){if(_0x263e85[_0x98ff('0x34')]!==_0x98ff('0x45')){var _0x1c8f40={};_0x1c8f40[_0x263e85[_0x98ff('0x2d')]]={'$like':'%'+_0x41c093[_0x98ff('0x37')][_0x98ff('0x43')]+'%'};return _0x1c8f40;}})});}_0x205d85=_['merge']({},_0x205d85,_0x41c093[_0x98ff('0x46')]);var _0x5c6ef0={'where':_0x205d85[_0x98ff('0x42')]};return db[_0x98ff('0x31')][_0x98ff('0x1f')](_0x5c6ef0)['then'](function(_0x541ab8){_0x1472cb[_0x98ff('0x1f')]=_0x541ab8;if(_0x41c093['query'][_0x98ff('0x47')]){_0x205d85[_0x98ff('0x48')]=[{'all':!![]}];}return db[_0x98ff('0x31')][_0x98ff('0x49')](_0x205d85);})[_0x98ff('0x27')](function(_0x2ce337){_0x1472cb['rows']=_0x2ce337;return _0x1472cb;})['then'](respondWithFilteredResult(_0x42213a,_0x205d85))[_0x98ff('0x4a')](handleError(_0x42213a,null));};exports['show']=function(_0x1507d1,_0x61d31d){var _0xd3c5b0={'raw':![],'where':{'id':_0x1507d1[_0x98ff('0x4b')]['id']}},_0x1be690={};_0x1be690[_0x98ff('0x36')]=_['keys'](db[_0x98ff('0x31')][_0x98ff('0x32')]);_0x1be690[_0x98ff('0x37')]=_['keys'](_0x1507d1[_0x98ff('0x37')]);_0x1be690[_0x98ff('0x39')]=_[_0x98ff('0x3b')](_0x1be690[_0x98ff('0x36')],_0x1be690[_0x98ff('0x37')]);_0xd3c5b0[_0x98ff('0x3a')]=_[_0x98ff('0x3b')](_0x1be690[_0x98ff('0x36')],qs[_0x98ff('0x3c')](_0x1507d1[_0x98ff('0x37')][_0x98ff('0x3c')]));_0xd3c5b0[_0x98ff('0x3a')]=_0xd3c5b0[_0x98ff('0x3a')][_0x98ff('0x3d')]?_0xd3c5b0[_0x98ff('0x3a')]:_0x1be690[_0x98ff('0x36')];if(_0x1507d1['query']['includeAll']){_0xd3c5b0[_0x98ff('0x48')]=[{'all':!![]}];}_0xd3c5b0=_['merge']({},_0xd3c5b0,_0x1507d1[_0x98ff('0x46')]);return db[_0x98ff('0x31')][_0x98ff('0x4c')](_0xd3c5b0)[_0x98ff('0x27')](handleEntityNotFound(_0x61d31d,null))[_0x98ff('0x27')](respondWithResult(_0x61d31d,null))[_0x98ff('0x4a')](handleError(_0x61d31d,null));};exports[_0x98ff('0x4d')]=function(_0x3eb900,_0x45ed50){return db['Team'][_0x98ff('0x4d')](_0x3eb900['body'],{})[_0x98ff('0x27')](function(_0x168e68){var _0x5e3283=_0x3eb900[_0x98ff('0x4e')][_0x98ff('0x28')]({'plain':!![]});if(!_0x5e3283)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e3283[_0x98ff('0x4f')]===_0x98ff('0x4e')){var _0x4dd9f5=_0x168e68[_0x98ff('0x28')]({'plain':!![]});var _0x23a922=_0x98ff('0x29');return db[_0x98ff('0x50')][_0x98ff('0x4c')]({'where':{'name':_0x23a922,'userProfileId':_0x5e3283[_0x98ff('0x51')]},'raw':!![]})['then'](function(_0x42f8b7){if(_0x42f8b7&&_0x42f8b7[_0x98ff('0x52')]===0x0){return db[_0x98ff('0x53')][_0x98ff('0x4d')]({'name':_0x4dd9f5[_0x98ff('0x2d')],'resourceId':_0x4dd9f5['id'],'type':_0x42f8b7[_0x98ff('0x2d')],'sectionId':_0x42f8b7['id']},{})[_0x98ff('0x27')](function(){return _0x168e68;});}else{return _0x168e68;}})[_0x98ff('0x4a')](function(_0x5c41e){logger[_0x98ff('0x2b')](_0x98ff('0x54'),_0x5c41e);throw _0x5c41e;});}return _0x168e68;})['then'](respondWithResult(_0x45ed50,0xc9))['catch'](handleError(_0x45ed50,null));};exports[_0x98ff('0x55')]=function(_0x356755,_0x3fe60f){if(_0x356755[_0x98ff('0x56')]['id']){delete _0x356755[_0x98ff('0x56')]['id'];}return db[_0x98ff('0x31')][_0x98ff('0x4c')]({'where':{'id':_0x356755[_0x98ff('0x4b')]['id']}})[_0x98ff('0x27')](handleEntityNotFound(_0x3fe60f,null))['then'](saveUpdates(_0x356755[_0x98ff('0x56')],null))[_0x98ff('0x27')](respondWithResult(_0x3fe60f,null))[_0x98ff('0x4a')](handleError(_0x3fe60f,null));};exports[_0x98ff('0x57')]=function(_0x394b03,_0x126ef9){return db[_0x98ff('0x31')][_0x98ff('0x4c')]({'where':{'id':_0x394b03[_0x98ff('0x4b')]['id']}})[_0x98ff('0x27')](handleEntityNotFound(_0x126ef9,null))['then'](removeEntity(_0x126ef9,null))['catch'](handleError(_0x126ef9,null));};exports[_0x98ff('0x58')]=function(_0x40b9b5,_0x56b10a,_0x302e7c){return db['Team']['findOne']({'where':{'id':_0x40b9b5[_0x98ff('0x4b')]['id']}})[_0x98ff('0x27')](handleEntityNotFound(_0x56b10a,null))['then'](function(_0x4f97c9){if(!_0x40b9b5[_0x98ff('0x37')][_0x98ff('0x59')]||!utils[_0x98ff('0x5a')](_0x40b9b5[_0x98ff('0x37')][_0x98ff('0x59')])){throw new db['Sequelize'][(_0x98ff('0x5b'))](_0x98ff('0x5c'));}var _0xefcdb9={};var _0xa794c4={};_0xa794c4[_0x98ff('0x36')]=_[_0x98ff('0x38')](db[_['capitalize'](_0x40b9b5['query'][_0x98ff('0x59')][_0x98ff('0x5d')]())+_0x98ff('0x5e')]['rawAttributes']);_0xa794c4[_0x98ff('0x37')]=_[_0x98ff('0x38')](_0x40b9b5[_0x98ff('0x37')]);_0xa794c4[_0x98ff('0x39')]=_[_0x98ff('0x3b')](_0xa794c4[_0x98ff('0x36')],_0xa794c4[_0x98ff('0x37')]);_0xefcdb9[_0x98ff('0x3a')]=_['intersection'](_0xa794c4[_0x98ff('0x36')],qs[_0x98ff('0x3c')](_0x40b9b5['query'][_0x98ff('0x3c')]));_0xefcdb9[_0x98ff('0x3a')]=_0xefcdb9[_0x98ff('0x3a')][_0x98ff('0x3d')]?_0xefcdb9['attributes']:_0xa794c4[_0x98ff('0x36')];_0xefcdb9['limit']=qs['limit'](_0x40b9b5[_0x98ff('0x37')][_0x98ff('0x21')]);_0xefcdb9[_0x98ff('0x20')]=qs[_0x98ff('0x20')](_0x40b9b5[_0x98ff('0x37')][_0x98ff('0x20')]);_0xefcdb9[_0x98ff('0x40')]=qs[_0x98ff('0x41')](_0x40b9b5['query'][_0x98ff('0x41')]);_0xefcdb9[_0x98ff('0x42')]=qs['filters'](_['pick'](_0x40b9b5['query'],_0xa794c4[_0x98ff('0x39')]));_0xefcdb9=_['merge']({},_0xefcdb9,_0x40b9b5[_0x98ff('0x46')]);return _0x4f97c9[_0x98ff('0x28')+_[_0x98ff('0x5f')](_0x40b9b5[_0x98ff('0x37')][_0x98ff('0x59')][_0x98ff('0x5d')]())+_0x98ff('0x60')](_0xefcdb9);})[_0x98ff('0x27')](respondWithResult(_0x56b10a,null))[_0x98ff('0x4a')](handleError(_0x56b10a,null));};exports[_0x98ff('0x61')]=function(_0x6a26de,_0x19fb65,_0x46dfad){return db['Team'][_0x98ff('0x62')]({'where':{'id':_0x6a26de['params']['id']}})[_0x98ff('0x27')](function(_0x548a65){if(_0x548a65){if(!_0x6a26de[_0x98ff('0x56')]['channel']||!utils[_0x98ff('0x5a')](_0x6a26de[_0x98ff('0x56')][_0x98ff('0x59')])){throw new db[(_0x98ff('0x63'))]['ValidationError'](_0x98ff('0x5c'));}return _0x548a65[_0x98ff('0x64')+_[_0x98ff('0x5f')](_0x6a26de[_0x98ff('0x56')]['channel']['toLowerCase']())+'Queues'](_0x6a26de[_0x98ff('0x56')][_0x98ff('0x65')]);}return null;})[_0x98ff('0x27')](handleEntityNotFound(_0x19fb65,null))[_0x98ff('0x27')](respondWithStatusCode(_0x19fb65,null))[_0x98ff('0x4a')](handleError(_0x19fb65,null));};exports['removeQueues']=function(_0x43aa10,_0x426979,_0xa82b27){return db[_0x98ff('0x31')][_0x98ff('0x62')]({'where':{'id':_0x43aa10['params']['id']}})[_0x98ff('0x27')](function(_0x5c887c){if(_0x5c887c){if(!_0x43aa10['query'][_0x98ff('0x59')]||!utils[_0x98ff('0x5a')](_0x43aa10[_0x98ff('0x37')][_0x98ff('0x59')])){throw new db[(_0x98ff('0x63'))]['ValidationError'](_0x98ff('0x5c'));}return _0x5c887c['remove'+_['capitalize'](_0x43aa10[_0x98ff('0x37')][_0x98ff('0x59')][_0x98ff('0x5d')]())+'Queues'](_0x43aa10[_0x98ff('0x37')][_0x98ff('0x65')]);}return null;})[_0x98ff('0x27')](handleEntityNotFound(_0x426979,null))[_0x98ff('0x27')](respondWithStatusCode(_0x426979,null))[_0x98ff('0x4a')](handleError(_0x426979,null));};exports[_0x98ff('0x66')]=function(_0xf9baa6,_0x5e931e,_0x20bb4c){return db['Team']['find']({'where':{'id':_0xf9baa6[_0x98ff('0x4b')]['id']}})[_0x98ff('0x27')](handleEntityNotFound(_0x5e931e,null))[_0x98ff('0x27')](function(_0x1af88c){if(_0x1af88c){var _0x1ccae4=[_0x98ff('0x67'),_0x98ff('0x68'),_0x98ff('0x69'),_0x98ff('0x6a'),_0x98ff('0x6b'),'Openchannel'];return BPromise[_0x98ff('0x6c')](_0x1ccae4,function(_0xf01703){return _0x1af88c[_0x98ff('0x28')+_0xf01703+'Queues']({'attributes':['id',_0x98ff('0x2d')]})[_0x98ff('0x27')](function(_0x446677){return BPromise['each'](_0x446677,function(_0x406b41){return _0x406b41[_0x98ff('0x66')](_0xf9baa6[_0x98ff('0x56')][_0x98ff('0x65')])[_0x98ff('0x27')](function(){if(_0xf01703===_0x98ff('0x67')){return db[_0x98ff('0x6d')][_0x98ff('0x49')]({'where':{'id':_0xf9baa6['body'][_0x98ff('0x65')]},'attributes':['id',_0x98ff('0x2d'),_0x98ff('0x6e'),'voicePause','interface'],'raw':!![]})['then'](function(_0x48dcb5){return BPromise['each'](_[_0x98ff('0x43')](_0x48dcb5,{'online':0x1}),function(_0x34bf7d){return db[_0x98ff('0x6f')][_0x98ff('0x70')]({'membername':_0x34bf7d[_0x98ff('0x2d')],'UserId':_0x34bf7d['id'],'queue_name':_0x406b41[_0x98ff('0x2d')],'VoiceQueueId':_0x406b41['id'],'interface':_['isNil'](_0x34bf7d[_0x98ff('0x71')])?util[_0x98ff('0x72')](_0x98ff('0x73'),_0x34bf7d['name']):_0x34bf7d['interface'],'paused':_0x34bf7d['voicePause']||![],'penalty':0x0});});});}});});})[_0x98ff('0x27')](function(){return _0x1af88c;});})['then'](function(){return _0x1af88c;});}})[_0x98ff('0x27')](function(_0x28df1e){if(_0x28df1e){return _0x28df1e[_0x98ff('0x66')](_0xf9baa6[_0x98ff('0x56')]['ids'],_['omit'](_0xf9baa6['body'],['ids','id'])||{})[_0x98ff('0x74')](function(_0x7f8e80){for(var _0x426129=0x0;_0x426129<_0xf9baa6[_0x98ff('0x56')][_0x98ff('0x65')][_0x98ff('0x3d')];_0x426129+=0x1){socket[_0x98ff('0x75')]('userTeam:save',{'UserId':_0xf9baa6[_0x98ff('0x56')]['ids'][_0x426129],'TeamId':_0xf9baa6[_0x98ff('0x4b')]['id']});}return _0x7f8e80;});}})['then'](respondWithResult(_0x5e931e,null))[_0x98ff('0x4a')](handleError(_0x5e931e,null));};exports['removeAgents']=function(_0x7ed537,_0x3c317b,_0x4c3c62){return db['Team'][_0x98ff('0x4c')]({'where':{'id':_0x7ed537['params']['id']}})[_0x98ff('0x27')](handleEntityNotFound(_0x3c317b,null))[_0x98ff('0x27')](function(_0x19dd5d){if(_0x19dd5d){return BPromise[_0x98ff('0x6c')]([_0x98ff('0x76'),_0x98ff('0x77'),'mail','sms',_0x98ff('0x78'),_0x98ff('0x79')],function(_0x4326fd){return _0x19dd5d[_0x98ff('0x28')+_[_0x98ff('0x5f')](_0x4326fd)+_0x98ff('0x60')]({'attributes':['id','name']})['then'](function(_0x40cd24){return BPromise[_0x98ff('0x6c')](_0x40cd24,function(_0x8b1ee1){return _0x8b1ee1[_0x98ff('0x7a')](_0x7ed537[_0x98ff('0x37')][_0x98ff('0x65')])[_0x98ff('0x27')](function(){if(_0x4326fd===_0x98ff('0x76')){return db['UserVoiceQueueRt'][_0x98ff('0x57')]({'where':{'VoiceQueueId':_0x8b1ee1['id'],'UserId':_0x7ed537['query'][_0x98ff('0x65')]}});}});});})[_0x98ff('0x27')](function(){return _0x19dd5d;});})['then'](function(){return _0x19dd5d;});}})[_0x98ff('0x27')](function(_0x451fd0){if(_0x451fd0){return _0x451fd0[_0x98ff('0x7a')](_0x7ed537[_0x98ff('0x37')][_0x98ff('0x65')])[_0x98ff('0x27')](function(){if(_[_0x98ff('0x7b')](_0x7ed537[_0x98ff('0x37')][_0x98ff('0x65')])){for(var _0x106f0b=0x0;_0x106f0b<_0x7ed537[_0x98ff('0x37')]['ids']['length'];_0x106f0b+=0x1){socket[_0x98ff('0x75')](_0x98ff('0x7c'),{'UserId':Number(_0x7ed537['query']['ids'][_0x106f0b]),'TeamId':Number(_0x7ed537['params']['id'])});}}else{socket['emit'](_0x98ff('0x7c'),{'UserId':Number(_0x7ed537[_0x98ff('0x37')][_0x98ff('0x65')]),'TeamId':Number(_0x7ed537[_0x98ff('0x4b')]['id'])});}});}})[_0x98ff('0x27')](respondWithStatusCode(_0x3c317b,null))[_0x98ff('0x4a')](handleError(_0x3c317b,null));};exports[_0x98ff('0x7d')]=function(_0x436859,_0x3159d6,_0x2edbb5){var _0x519614={};var _0x46d217={};var _0x3a51b2;var _0x3c134c;return db[_0x98ff('0x31')]['findOne']({'where':{'id':_0x436859[_0x98ff('0x4b')]['id']}})[_0x98ff('0x27')](handleEntityNotFound(_0x3159d6,null))['then'](function(_0x44d4dc){if(_0x44d4dc){_0x3a51b2=_0x44d4dc;_0x46d217[_0x98ff('0x36')]=_['keys'](db[_0x98ff('0x6d')][_0x98ff('0x32')]);_0x46d217[_0x98ff('0x37')]=_[_0x98ff('0x38')](_0x436859[_0x98ff('0x37')]);_0x46d217[_0x98ff('0x39')]=_['intersection'](_0x46d217[_0x98ff('0x36')],_0x46d217['query']);_0x519614['attributes']=_[_0x98ff('0x3b')](_0x46d217[_0x98ff('0x36')],qs[_0x98ff('0x3c')](_0x436859['query']['fields']));_0x519614[_0x98ff('0x3a')]=_0x519614[_0x98ff('0x3a')][_0x98ff('0x3d')]?_0x519614[_0x98ff('0x3a')]:_0x46d217[_0x98ff('0x36')];_0x519614[_0x98ff('0x40')]=qs[_0x98ff('0x41')](_0x436859[_0x98ff('0x37')][_0x98ff('0x41')]);_0x519614['where']=qs['filters'](_['pick'](_0x436859[_0x98ff('0x37')],_0x46d217[_0x98ff('0x39')]));if(_0x436859[_0x98ff('0x37')][_0x98ff('0x43')]){_0x519614[_0x98ff('0x42')]=_[_0x98ff('0x44')](_0x519614[_0x98ff('0x42')],{'$or':_['map'](_0x519614[_0x98ff('0x3a')],function(_0x2f7370){var _0x4fb094={};_0x4fb094[_0x2f7370]={'$like':'%'+_0x436859['query'][_0x98ff('0x43')]+'%'};return _0x4fb094;})});}_0x519614=_['merge']({},_0x519614,_0x436859['options']);return _0x3a51b2[_0x98ff('0x7d')](_0x519614);}})[_0x98ff('0x27')](function(_0x2e32be){if(_0x2e32be){_0x3c134c=_0x2e32be['length'];if(!_0x436859[_0x98ff('0x37')][_0x98ff('0x3e')](_0x98ff('0x3f'))){_0x519614[_0x98ff('0x21')]=qs['limit'](_0x436859['query'][_0x98ff('0x21')]);_0x519614['offset']=qs[_0x98ff('0x20')](_0x436859[_0x98ff('0x37')]['offset']);}return _0x3a51b2[_0x98ff('0x7d')](_0x519614);}})[_0x98ff('0x27')](function(_0x2cce35){if(_0x2cce35){return _0x2cce35?{'count':_0x3c134c,'rows':_0x2cce35}:null;}})['then'](respondWithResult(_0x3159d6,null))[_0x98ff('0x4a')](handleError(_0x3159d6,null));}; \ No newline at end of file +var _0xba5a=['api','../../mysqldb','defaults','socket.io-emitter','redis','./team.socket','register','end','status','offset','json','save','update','then','destroy','get','Teams','UserProfileResource','sendStatus','name','send','index','map','Team','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','filter','merge','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','getQueues','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','sort','pick','Queues','addQueues','findOne','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','each','online','interface','upsert','isNil','format','SIP/%s','voicePause','addAgents','omit','spread','emit','userTeam:save','voice','chat','sms','fax','removeAgents','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xba5a,0x1d0));var _0xaba5=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0xba5a[_0x427352];return _0x23e0e6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaba5('0x0'));var rimraf=require(_0xaba5('0x1'));var zipdir=require(_0xaba5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaba5('0x3'));var BPromise=require(_0xaba5('0x4'));var Mustache=require(_0xaba5('0x5'));var util=require(_0xaba5('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaba5('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xaba5('0x8'));var crypto=require(_0xaba5('0x9'));var jsforce=require(_0xaba5('0xa'));var deskjs=require(_0xaba5('0xb'));var toCsv=require(_0xaba5('0xc'));var querystring=require('querystring');var Papa=require(_0xaba5('0xd'));var Redis=require(_0xaba5('0xe'));var authService=require(_0xaba5('0xf'));var qs=require(_0xaba5('0x10'));var as=require(_0xaba5('0x11'));var hardwareService=require(_0xaba5('0x12'));var logger=require(_0xaba5('0x13'))(_0xaba5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xaba5('0x15'))['db'];config['redis']=_[_0xaba5('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaba5('0x17'))(new Redis(config[_0xaba5('0x18')]));require(_0xaba5('0x19'))[_0xaba5('0x1a')](socket);function respondWithStatusCode(_0x4be6a6,_0x306ebd){_0x306ebd=_0x306ebd||0xcc;return function(_0x2c21b8){if(_0x2c21b8){return _0x4be6a6['sendStatus'](_0x306ebd);}return _0x4be6a6['status'](_0x306ebd)[_0xaba5('0x1b')]();};}function respondWithResult(_0x33a63e,_0x176dff){_0x176dff=_0x176dff||0xc8;return function(_0x3c991d){if(_0x3c991d){return _0x33a63e[_0xaba5('0x1c')](_0x176dff)['json'](_0x3c991d);}};}function respondWithFilteredResult(_0xf38b7f,_0x49e9b2){return function(_0x40706d){if(_0x40706d){var _0x55289e=_0x40706d['count'],_0x3ebe81=_0x49e9b2[_0xaba5('0x1d')],_0x442cac=_0x49e9b2[_0xaba5('0x1d')]+_0x49e9b2['limit'],_0x514d68;if(_0x442cac>=_0x55289e){_0x442cac=_0x55289e;_0x514d68=0xc8;}else{_0x514d68=0xce;}_0xf38b7f[_0xaba5('0x1c')](_0x514d68);return _0xf38b7f['set']('Content-Range',_0x3ebe81+'-'+_0x442cac+'/'+_0x55289e)[_0xaba5('0x1e')](_0x40706d);}return null;};}function patchUpdates(_0xe03ffb){return function(_0x12ab35){try{jsonpatch['apply'](_0x12ab35,_0xe03ffb,!![]);}catch(_0x36838e){return BPromise['reject'](_0x36838e);}return _0x12ab35[_0xaba5('0x1f')]();};}function saveUpdates(_0x3f0282,_0x34f0ef){return function(_0x430a8e){if(_0x430a8e){return _0x430a8e[_0xaba5('0x20')](_0x3f0282)[_0xaba5('0x21')](function(_0x59a185){return _0x59a185;});}return null;};}function removeEntity(_0x2b337e,_0x4d4120){return function(_0x13c302){if(_0x13c302){return _0x13c302[_0xaba5('0x22')]()[_0xaba5('0x21')](function(){var _0x3e63d4=_0x13c302[_0xaba5('0x23')]({'plain':!![]});var _0x812f8b=_0xaba5('0x24');return db[_0xaba5('0x25')][_0xaba5('0x22')]({'where':{'type':_0x812f8b,'resourceId':_0x3e63d4['id']}})[_0xaba5('0x21')](function(){return _0x13c302;});})[_0xaba5('0x21')](function(){_0x2b337e[_0xaba5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5509b2,_0x54f7fb){return function(_0x52699f){if(!_0x52699f){_0x5509b2[_0xaba5('0x26')](0x194);}return _0x52699f;};}function handleError(_0x5257ac,_0x97a7d){_0x97a7d=_0x97a7d||0x1f4;return function(_0x444c5f){logger['error'](_0x444c5f['stack']);if(_0x444c5f[_0xaba5('0x27')]){delete _0x444c5f[_0xaba5('0x27')];}_0x5257ac[_0xaba5('0x1c')](_0x97a7d)[_0xaba5('0x28')](_0x444c5f);};}exports[_0xaba5('0x29')]=function(_0xcb1960,_0x45d54f){var _0x5798d3={},_0x9c7210={},_0x28e95c={'count':0x0,'rows':[]};var _0x44462e=_[_0xaba5('0x2a')](db[_0xaba5('0x2b')]['rawAttributes'],function(_0xb15e5a){return{'name':_0xb15e5a[_0xaba5('0x2c')],'type':_0xb15e5a[_0xaba5('0x2d')][_0xaba5('0x2e')]};});_0x9c7210[_0xaba5('0x2f')]=_[_0xaba5('0x2a')](_0x44462e,_0xaba5('0x27'));_0x9c7210[_0xaba5('0x30')]=_['keys'](_0xcb1960[_0xaba5('0x30')]);_0x9c7210['filters']=_[_0xaba5('0x31')](_0x9c7210[_0xaba5('0x2f')],_0x9c7210[_0xaba5('0x30')]);_0x5798d3[_0xaba5('0x32')]=_['intersection'](_0x9c7210[_0xaba5('0x2f')],qs[_0xaba5('0x33')](_0xcb1960['query'][_0xaba5('0x33')]));_0x5798d3['attributes']=_0x5798d3[_0xaba5('0x32')][_0xaba5('0x34')]?_0x5798d3['attributes']:_0x9c7210[_0xaba5('0x2f')];if(!_0xcb1960['query'][_0xaba5('0x35')](_0xaba5('0x36'))){_0x5798d3[_0xaba5('0x37')]=qs[_0xaba5('0x37')](_0xcb1960[_0xaba5('0x30')][_0xaba5('0x37')]);_0x5798d3['offset']=qs[_0xaba5('0x1d')](_0xcb1960[_0xaba5('0x30')][_0xaba5('0x1d')]);}_0x5798d3[_0xaba5('0x38')]=qs['sort'](_0xcb1960[_0xaba5('0x30')]['sort']);_0x5798d3[_0xaba5('0x39')]=qs[_0xaba5('0x3a')](_['pick'](_0xcb1960[_0xaba5('0x30')],_0x9c7210['filters']));if(_0xcb1960[_0xaba5('0x30')][_0xaba5('0x3b')]){_0x5798d3['where']=_[_0xaba5('0x3c')](_0x5798d3[_0xaba5('0x39')],{'$or':_['map'](_0x44462e,function(_0x1f8461){if(_0x1f8461[_0xaba5('0x2d')]!=='VIRTUAL'){var _0x267147={};_0x267147[_0x1f8461[_0xaba5('0x27')]]={'$like':'%'+_0xcb1960[_0xaba5('0x30')][_0xaba5('0x3b')]+'%'};return _0x267147;}})});}_0x5798d3=_[_0xaba5('0x3c')]({},_0x5798d3,_0xcb1960[_0xaba5('0x3d')]);var _0x486270={'where':_0x5798d3['where']};return db[_0xaba5('0x2b')][_0xaba5('0x3e')](_0x486270)[_0xaba5('0x21')](function(_0x367d3e){_0x28e95c[_0xaba5('0x3e')]=_0x367d3e;if(_0xcb1960[_0xaba5('0x30')][_0xaba5('0x3f')]){_0x5798d3['include']=[{'all':!![]}];}return db[_0xaba5('0x2b')][_0xaba5('0x40')](_0x5798d3);})[_0xaba5('0x21')](function(_0x38bb9c){_0x28e95c[_0xaba5('0x41')]=_0x38bb9c;return _0x28e95c;})[_0xaba5('0x21')](respondWithFilteredResult(_0x45d54f,_0x5798d3))[_0xaba5('0x42')](handleError(_0x45d54f,null));};exports[_0xaba5('0x43')]=function(_0x438824,_0x1ebf28){var _0x11c8c8={'raw':![],'where':{'id':_0x438824[_0xaba5('0x44')]['id']}},_0x1effde={};_0x1effde[_0xaba5('0x2f')]=_['keys'](db[_0xaba5('0x2b')][_0xaba5('0x45')]);_0x1effde['query']=_[_0xaba5('0x46')](_0x438824[_0xaba5('0x30')]);_0x1effde[_0xaba5('0x3a')]=_[_0xaba5('0x31')](_0x1effde[_0xaba5('0x2f')],_0x1effde[_0xaba5('0x30')]);_0x11c8c8[_0xaba5('0x32')]=_[_0xaba5('0x31')](_0x1effde[_0xaba5('0x2f')],qs[_0xaba5('0x33')](_0x438824[_0xaba5('0x30')][_0xaba5('0x33')]));_0x11c8c8[_0xaba5('0x32')]=_0x11c8c8['attributes'][_0xaba5('0x34')]?_0x11c8c8[_0xaba5('0x32')]:_0x1effde[_0xaba5('0x2f')];if(_0x438824[_0xaba5('0x30')]['includeAll']){_0x11c8c8[_0xaba5('0x47')]=[{'all':!![]}];}_0x11c8c8=_[_0xaba5('0x3c')]({},_0x11c8c8,_0x438824[_0xaba5('0x3d')]);return db[_0xaba5('0x2b')]['find'](_0x11c8c8)[_0xaba5('0x21')](handleEntityNotFound(_0x1ebf28,null))[_0xaba5('0x21')](respondWithResult(_0x1ebf28,null))[_0xaba5('0x42')](handleError(_0x1ebf28,null));};exports[_0xaba5('0x48')]=function(_0x3c9f09,_0x220dc0){return db[_0xaba5('0x2b')][_0xaba5('0x48')](_0x3c9f09[_0xaba5('0x49')],{})[_0xaba5('0x21')](function(_0x5c181e){var _0x3e4482=_0x3c9f09[_0xaba5('0x4a')][_0xaba5('0x23')]({'plain':!![]});if(!_0x3e4482)throw new Error(_0xaba5('0x4b'));if(_0x3e4482[_0xaba5('0x4c')]===_0xaba5('0x4a')){var _0x4956f9=_0x5c181e['get']({'plain':!![]});var _0x51d582=_0xaba5('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x51d582,'userProfileId':_0x3e4482['userProfileId']},'raw':!![]})[_0xaba5('0x21')](function(_0x5e11a3){if(_0x5e11a3&&_0x5e11a3[_0xaba5('0x4d')]===0x0){return db['UserProfileResource'][_0xaba5('0x48')]({'name':_0x4956f9[_0xaba5('0x27')],'resourceId':_0x4956f9['id'],'type':_0x5e11a3[_0xaba5('0x27')],'sectionId':_0x5e11a3['id']},{})[_0xaba5('0x21')](function(){return _0x5c181e;});}else{return _0x5c181e;}})[_0xaba5('0x42')](function(_0x1ab1c9){logger['error'](_0xaba5('0x4e'),_0x1ab1c9);throw _0x1ab1c9;});}return _0x5c181e;})[_0xaba5('0x21')](respondWithResult(_0x220dc0,0xc9))['catch'](handleError(_0x220dc0,null));};exports['update']=function(_0x4c0e35,_0x3c9f91){if(_0x4c0e35[_0xaba5('0x49')]['id']){delete _0x4c0e35[_0xaba5('0x49')]['id'];}return db[_0xaba5('0x2b')]['find']({'where':{'id':_0x4c0e35['params']['id']}})[_0xaba5('0x21')](handleEntityNotFound(_0x3c9f91,null))[_0xaba5('0x21')](saveUpdates(_0x4c0e35[_0xaba5('0x49')],null))['then'](respondWithResult(_0x3c9f91,null))['catch'](handleError(_0x3c9f91,null));};exports[_0xaba5('0x22')]=function(_0x14a6bc,_0x501d49){return db[_0xaba5('0x2b')][_0xaba5('0x4f')]({'where':{'id':_0x14a6bc[_0xaba5('0x44')]['id']}})[_0xaba5('0x21')](handleEntityNotFound(_0x501d49,null))[_0xaba5('0x21')](removeEntity(_0x501d49,null))['catch'](handleError(_0x501d49,null));};exports[_0xaba5('0x50')]=function(_0x3b3bc2,_0x2a3b27,_0x10505c){return db[_0xaba5('0x2b')]['findOne']({'where':{'id':_0x3b3bc2['params']['id']}})[_0xaba5('0x21')](handleEntityNotFound(_0x2a3b27,null))[_0xaba5('0x21')](function(_0x325853){if(!_0x3b3bc2[_0xaba5('0x30')][_0xaba5('0x51')]||!utils[_0xaba5('0x52')](_0x3b3bc2[_0xaba5('0x30')]['channel'])){throw new db[(_0xaba5('0x53'))][(_0xaba5('0x54'))](_0xaba5('0x55'));}var _0x2b0e3a={};var _0x36659b={};_0x36659b[_0xaba5('0x2f')]=_[_0xaba5('0x46')](db[_[_0xaba5('0x56')](_0x3b3bc2['query'][_0xaba5('0x51')][_0xaba5('0x57')]())+'Queue'][_0xaba5('0x45')]);_0x36659b[_0xaba5('0x30')]=_[_0xaba5('0x46')](_0x3b3bc2[_0xaba5('0x30')]);_0x36659b[_0xaba5('0x3a')]=_[_0xaba5('0x31')](_0x36659b[_0xaba5('0x2f')],_0x36659b[_0xaba5('0x30')]);_0x2b0e3a[_0xaba5('0x32')]=_[_0xaba5('0x31')](_0x36659b['model'],qs['fields'](_0x3b3bc2[_0xaba5('0x30')]['fields']));_0x2b0e3a[_0xaba5('0x32')]=_0x2b0e3a[_0xaba5('0x32')]['length']?_0x2b0e3a['attributes']:_0x36659b[_0xaba5('0x2f')];_0x2b0e3a['limit']=qs[_0xaba5('0x37')](_0x3b3bc2[_0xaba5('0x30')]['limit']);_0x2b0e3a['offset']=qs['offset'](_0x3b3bc2[_0xaba5('0x30')]['offset']);_0x2b0e3a[_0xaba5('0x38')]=qs[_0xaba5('0x58')](_0x3b3bc2[_0xaba5('0x30')][_0xaba5('0x58')]);_0x2b0e3a[_0xaba5('0x39')]=qs['filters'](_[_0xaba5('0x59')](_0x3b3bc2[_0xaba5('0x30')],_0x36659b[_0xaba5('0x3a')]));_0x2b0e3a=_[_0xaba5('0x3c')]({},_0x2b0e3a,_0x3b3bc2['options']);return _0x325853[_0xaba5('0x23')+_[_0xaba5('0x56')](_0x3b3bc2[_0xaba5('0x30')][_0xaba5('0x51')][_0xaba5('0x57')]())+_0xaba5('0x5a')](_0x2b0e3a);})[_0xaba5('0x21')](respondWithResult(_0x2a3b27,null))[_0xaba5('0x42')](handleError(_0x2a3b27,null));};exports[_0xaba5('0x5b')]=function(_0x208af1,_0x140153,_0x150eb0){return db['Team'][_0xaba5('0x5c')]({'where':{'id':_0x208af1[_0xaba5('0x44')]['id']}})['then'](function(_0x549a5b){if(_0x549a5b){if(!_0x208af1['body'][_0xaba5('0x51')]||!utils['isValidChannel'](_0x208af1[_0xaba5('0x49')]['channel'])){throw new db[(_0xaba5('0x53'))][(_0xaba5('0x54'))](_0xaba5('0x55'));}return _0x549a5b['add'+_['capitalize'](_0x208af1[_0xaba5('0x49')][_0xaba5('0x51')][_0xaba5('0x57')]())+'Queues'](_0x208af1[_0xaba5('0x49')][_0xaba5('0x5d')]);}return null;})[_0xaba5('0x21')](handleEntityNotFound(_0x140153,null))['then'](respondWithStatusCode(_0x140153,null))[_0xaba5('0x42')](handleError(_0x140153,null));};exports[_0xaba5('0x5e')]=function(_0x1bce71,_0x39413f,_0xe456){return db[_0xaba5('0x2b')][_0xaba5('0x5c')]({'where':{'id':_0x1bce71[_0xaba5('0x44')]['id']}})[_0xaba5('0x21')](function(_0x1cad0d){if(_0x1cad0d){if(!_0x1bce71[_0xaba5('0x30')][_0xaba5('0x51')]||!utils[_0xaba5('0x52')](_0x1bce71['query'][_0xaba5('0x51')])){throw new db[(_0xaba5('0x53'))][(_0xaba5('0x54'))](_0xaba5('0x55'));}return _0x1cad0d[_0xaba5('0x5f')+_[_0xaba5('0x56')](_0x1bce71[_0xaba5('0x30')][_0xaba5('0x51')][_0xaba5('0x57')]())+_0xaba5('0x5a')](_0x1bce71[_0xaba5('0x30')][_0xaba5('0x5d')]);}return null;})[_0xaba5('0x21')](handleEntityNotFound(_0x39413f,null))[_0xaba5('0x21')](respondWithStatusCode(_0x39413f,null))[_0xaba5('0x42')](handleError(_0x39413f,null));};exports['addAgents']=function(_0x589ffc,_0x5ada53,_0x31d047){return db[_0xaba5('0x2b')][_0xaba5('0x4f')]({'where':{'id':_0x589ffc['params']['id']}})[_0xaba5('0x21')](handleEntityNotFound(_0x5ada53,null))[_0xaba5('0x21')](function(_0x58f9c1){if(_0x58f9c1){var _0x178f30=[_0xaba5('0x60'),_0xaba5('0x61'),_0xaba5('0x62'),_0xaba5('0x63'),_0xaba5('0x64'),'Openchannel'];return BPromise[_0xaba5('0x65')](_0x178f30,function(_0x31e105){return _0x58f9c1[_0xaba5('0x23')+_0x31e105+_0xaba5('0x5a')]({'attributes':['id','name']})['then'](function(_0x1c6eb1){return BPromise[_0xaba5('0x65')](_0x1c6eb1,function(_0x41afcd){return _0x41afcd['addAgents'](_0x589ffc[_0xaba5('0x49')][_0xaba5('0x5d')])[_0xaba5('0x21')](function(){if(_0x31e105===_0xaba5('0x60')){return db['User'][_0xaba5('0x40')]({'where':{'id':_0x589ffc[_0xaba5('0x49')][_0xaba5('0x5d')]},'attributes':['id',_0xaba5('0x27'),_0xaba5('0x66'),'voicePause',_0xaba5('0x67')],'raw':!![]})['then'](function(_0x482c93){return BPromise[_0xaba5('0x65')](_[_0xaba5('0x3b')](_0x482c93,{'online':0x1}),function(_0x26c1a6){return db['UserVoiceQueueRt'][_0xaba5('0x68')]({'membername':_0x26c1a6[_0xaba5('0x27')],'UserId':_0x26c1a6['id'],'queue_name':_0x41afcd[_0xaba5('0x27')],'VoiceQueueId':_0x41afcd['id'],'interface':_[_0xaba5('0x69')](_0x26c1a6[_0xaba5('0x67')])?util[_0xaba5('0x6a')](_0xaba5('0x6b'),_0x26c1a6[_0xaba5('0x27')]):_0x26c1a6[_0xaba5('0x67')],'paused':_0x26c1a6[_0xaba5('0x6c')]||![],'penalty':0x0});});});}});});})[_0xaba5('0x21')](function(){return _0x58f9c1;});})['then'](function(){return _0x58f9c1;});}})['then'](function(_0x231f2b){if(_0x231f2b){return _0x231f2b[_0xaba5('0x6d')](_0x589ffc[_0xaba5('0x49')][_0xaba5('0x5d')],_[_0xaba5('0x6e')](_0x589ffc[_0xaba5('0x49')],[_0xaba5('0x5d'),'id'])||{})[_0xaba5('0x6f')](function(_0x5726e2){for(var _0x20e514=0x0;_0x20e514<_0x589ffc[_0xaba5('0x49')]['ids'][_0xaba5('0x34')];_0x20e514+=0x1){socket[_0xaba5('0x70')](_0xaba5('0x71'),{'UserId':_0x589ffc[_0xaba5('0x49')][_0xaba5('0x5d')][_0x20e514],'TeamId':_0x589ffc[_0xaba5('0x44')]['id']});}return _0x5726e2;});}})[_0xaba5('0x21')](respondWithResult(_0x5ada53,null))[_0xaba5('0x42')](handleError(_0x5ada53,null));};exports['removeAgents']=function(_0x551b2c,_0x28ee09,_0x207d6b){return db['Team']['find']({'where':{'id':_0x551b2c[_0xaba5('0x44')]['id']}})[_0xaba5('0x21')](handleEntityNotFound(_0x28ee09,null))['then'](function(_0x5e277a){if(_0x5e277a){return BPromise[_0xaba5('0x65')]([_0xaba5('0x72'),_0xaba5('0x73'),'mail',_0xaba5('0x74'),_0xaba5('0x75'),'openchannel'],function(_0x34e66e){return _0x5e277a[_0xaba5('0x23')+_[_0xaba5('0x56')](_0x34e66e)+_0xaba5('0x5a')]({'attributes':['id',_0xaba5('0x27')]})['then'](function(_0x356323){return BPromise[_0xaba5('0x65')](_0x356323,function(_0x267a21){return _0x267a21[_0xaba5('0x76')](_0x551b2c[_0xaba5('0x30')][_0xaba5('0x5d')])[_0xaba5('0x21')](function(){if(_0x34e66e===_0xaba5('0x72')){return db[_0xaba5('0x77')][_0xaba5('0x22')]({'where':{'VoiceQueueId':_0x267a21['id'],'UserId':_0x551b2c[_0xaba5('0x30')][_0xaba5('0x5d')]}});}});});})['then'](function(){return _0x5e277a;});})[_0xaba5('0x21')](function(){return _0x5e277a;});}})[_0xaba5('0x21')](function(_0x1c9049){if(_0x1c9049){return _0x1c9049['removeAgents'](_0x551b2c[_0xaba5('0x30')][_0xaba5('0x5d')])[_0xaba5('0x21')](function(){if(_['isArray'](_0x551b2c[_0xaba5('0x30')][_0xaba5('0x5d')])){for(var _0x24e7da=0x0;_0x24e7da<_0x551b2c['query'][_0xaba5('0x5d')][_0xaba5('0x34')];_0x24e7da+=0x1){socket[_0xaba5('0x70')]('userTeam:remove',{'UserId':Number(_0x551b2c[_0xaba5('0x30')][_0xaba5('0x5d')][_0x24e7da]),'TeamId':Number(_0x551b2c[_0xaba5('0x44')]['id'])});}}else{socket['emit']('userTeam:remove',{'UserId':Number(_0x551b2c[_0xaba5('0x30')]['ids']),'TeamId':Number(_0x551b2c[_0xaba5('0x44')]['id'])});}});}})[_0xaba5('0x21')](respondWithStatusCode(_0x28ee09,null))[_0xaba5('0x42')](handleError(_0x28ee09,null));};exports['getAgents']=function(_0x3160b1,_0x2d8641,_0x82d91e){var _0x26abe9={};var _0x577684={};var _0x328880;var _0x4ad5e7;return db[_0xaba5('0x2b')][_0xaba5('0x5c')]({'where':{'id':_0x3160b1[_0xaba5('0x44')]['id']}})['then'](handleEntityNotFound(_0x2d8641,null))[_0xaba5('0x21')](function(_0x3f40a6){if(_0x3f40a6){_0x328880=_0x3f40a6;_0x577684[_0xaba5('0x2f')]=_['keys'](db['User']['rawAttributes']);_0x577684[_0xaba5('0x30')]=_[_0xaba5('0x46')](_0x3160b1[_0xaba5('0x30')]);_0x577684[_0xaba5('0x3a')]=_['intersection'](_0x577684[_0xaba5('0x2f')],_0x577684[_0xaba5('0x30')]);_0x26abe9[_0xaba5('0x32')]=_[_0xaba5('0x31')](_0x577684[_0xaba5('0x2f')],qs[_0xaba5('0x33')](_0x3160b1['query']['fields']));_0x26abe9['attributes']=_0x26abe9[_0xaba5('0x32')][_0xaba5('0x34')]?_0x26abe9[_0xaba5('0x32')]:_0x577684[_0xaba5('0x2f')];_0x26abe9[_0xaba5('0x38')]=qs[_0xaba5('0x58')](_0x3160b1[_0xaba5('0x30')]['sort']);_0x26abe9[_0xaba5('0x39')]=qs[_0xaba5('0x3a')](_['pick'](_0x3160b1['query'],_0x577684[_0xaba5('0x3a')]));if(_0x3160b1[_0xaba5('0x30')][_0xaba5('0x3b')]){_0x26abe9[_0xaba5('0x39')]=_[_0xaba5('0x3c')](_0x26abe9['where'],{'$or':_[_0xaba5('0x2a')](_0x26abe9[_0xaba5('0x32')],function(_0xe066a0){var _0x3ea7aa={};_0x3ea7aa[_0xe066a0]={'$like':'%'+_0x3160b1[_0xaba5('0x30')][_0xaba5('0x3b')]+'%'};return _0x3ea7aa;})});}_0x26abe9=_['merge']({},_0x26abe9,_0x3160b1[_0xaba5('0x3d')]);return _0x328880[_0xaba5('0x78')](_0x26abe9);}})[_0xaba5('0x21')](function(_0x178c98){if(_0x178c98){_0x4ad5e7=_0x178c98['length'];if(!_0x3160b1[_0xaba5('0x30')][_0xaba5('0x35')](_0xaba5('0x36'))){_0x26abe9[_0xaba5('0x37')]=qs[_0xaba5('0x37')](_0x3160b1[_0xaba5('0x30')][_0xaba5('0x37')]);_0x26abe9['offset']=qs[_0xaba5('0x1d')](_0x3160b1['query']['offset']);}return _0x328880[_0xaba5('0x78')](_0x26abe9);}})['then'](function(_0x48c068){if(_0x48c068){return _0x48c068?{'count':_0x4ad5e7,'rows':_0x48c068}:null;}})[_0xaba5('0x21')](respondWithResult(_0x2d8641,null))['catch'](handleError(_0x2d8641,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index b67f195..0c2718c 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 _0x87b1=['events','Team','save','remove','emit','hasOwnProperty','hook'];(function(_0x12f2be,_0x6de5f9){var _0x15bee7=function(_0x454ff2){while(--_0x454ff2){_0x12f2be['push'](_0x12f2be['shift']());}};_0x15bee7(++_0x6de5f9);}(_0x87b1,0x103));var _0x187b=function(_0x2e4785,_0x2c8761){_0x2e4785=_0x2e4785-0x0;var _0x321412=_0x87b1[_0x2e4785];return _0x321412;};'use strict';var EventEmitter=require(_0x187b('0x0'));var Team=require('../../mysqldb')['db'][_0x187b('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x187b('0x2'),'afterUpdate':'update','afterDestroy':_0x187b('0x3')};function emitEvent(_0x494c9c){return function(_0x39223d,_0x4cc08e,_0x5232f4){TeamEvents[_0x187b('0x4')](_0x494c9c+':'+_0x39223d['id'],_0x39223d);TeamEvents[_0x187b('0x4')](_0x494c9c,_0x39223d);_0x5232f4(null);};}for(var e in events){if(events[_0x187b('0x5')](e)){var event=events[e];Team[_0x187b('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xff9e=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xff9e,0x1e4));var _0xeff9=function(_0x4a7c23,_0x4b2ce4){_0x4a7c23=_0x4a7c23-0x0;var _0x1634b4=_0xff9e[_0x4a7c23];return _0x1634b4;};'use strict';var EventEmitter=require('events');var Team=require(_0xeff9('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeff9('0x1'),'afterUpdate':_0xeff9('0x2'),'afterDestroy':_0xeff9('0x3')};function emitEvent(_0x22f05a){return function(_0x36094b,_0x1570c8,_0x5403dc){TeamEvents['emit'](_0x22f05a+':'+_0x36094b['id'],_0x36094b);TeamEvents[_0xeff9('0x4')](_0x22f05a,_0x36094b);_0x5403dc(null);};}for(var e in events){if(events[_0xeff9('0x5')](e)){var event=events[e];Team[_0xeff9('0x6')](e,emitEvent(event));}}module[_0xeff9('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 2003516..fed5c1d 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 _0x9cb3=['lodash','util','moment','request-promise','path','rimraf','./team.attributes','exports','define','Team','teams'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x9cb3,0xfd));var _0x39cb=function(_0x48b4a1,_0x3c2bf4){_0x48b4a1=_0x48b4a1-0x0;var _0x2df379=_0x9cb3[_0x48b4a1];return _0x2df379;};'use strict';var _=require(_0x39cb('0x0'));var util=require(_0x39cb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x39cb('0x2'));var BPromise=require('bluebird');var rp=require(_0x39cb('0x3'));var fs=require('fs');var path=require(_0x39cb('0x4'));var rimraf=require(_0x39cb('0x5'));var config=require('../../config/environment');var attributes=require(_0x39cb('0x6'));module[_0x39cb('0x7')]=function(_0xb9121c,_0x596273){return _0xb9121c[_0x39cb('0x8')](_0x39cb('0x9'),attributes,{'tableName':_0x39cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3111=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','./team.attributes','define','Team','teams'];(function(_0x568d30,_0x50fceb){var _0xabb817=function(_0x1167f3){while(--_0x1167f3){_0x568d30['push'](_0x568d30['shift']());}};_0xabb817(++_0x50fceb);}(_0x3111,0x1a2));var _0x1311=function(_0x3c9030,_0x1d19f6){_0x3c9030=_0x3c9030-0x0;var _0x114468=_0x3111[_0x3c9030];return _0x114468;};'use strict';var _=require(_0x1311('0x0'));var util=require(_0x1311('0x1'));var logger=require(_0x1311('0x2'))(_0x1311('0x3'));var moment=require(_0x1311('0x4'));var BPromise=require(_0x1311('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1311('0x6'));var config=require('../../config/environment');var attributes=require(_0x1311('0x7'));module['exports']=function(_0x3a677a,_0x11fcfd){return _0x3a677a[_0x1311('0x8')](_0x1311('0x9'),attributes,{'tableName':_0x1311('0xa'),'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 39f43b2..9723418 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 _0xb6ed=['then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request'];(function(_0x41a0ee,_0x1e1348){var _0x3cd0f7=function(_0x7828a){while(--_0x7828a){_0x41a0ee['push'](_0x41a0ee['shift']());}};_0x3cd0f7(++_0x1e1348);}(_0xb6ed,0x1c5));var _0xdb6e=function(_0x4df7f9,_0x21a744){_0x4df7f9=_0x4df7f9-0x0;var _0x18609f=_0xb6ed[_0x4df7f9];return _0x18609f;};'use strict';var _=require('lodash');var util=require(_0xdb6e('0x0'));var moment=require('moment');var BPromise=require(_0xdb6e('0x1'));var rs=require(_0xdb6e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb6e('0x3'));var logger=require(_0xdb6e('0x4'))('rpc');var config=require(_0xdb6e('0x5'));var jayson=require(_0xdb6e('0x6'));var client=jayson[_0xdb6e('0x7')][_0xdb6e('0x8')]({'port':0x232a});config[_0xdb6e('0x9')]=_[_0xdb6e('0xa')](config[_0xdb6e('0x9')],{'host':_0xdb6e('0xb'),'port':0x18eb});var socket=require(_0xdb6e('0xc'))(new Redis(config['redis']));require(_0xdb6e('0xd'))['register'](socket);function respondWithRpcPromise(_0x4759bf,_0x3624cd,_0x38b441){return new BPromise(function(_0xcca584,_0x337c24){return client[_0xdb6e('0xe')](_0x4759bf,_0x38b441)[_0xdb6e('0xf')](function(_0x2cacf6){logger[_0xdb6e('0x10')](_0xdb6e('0x11'),_0x3624cd,_0xdb6e('0x12'));logger[_0xdb6e('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0x3624cd,_0xdb6e('0x12'),JSON[_0xdb6e('0x14')](_0x2cacf6));if(_0x2cacf6[_0xdb6e('0x15')]){if(_0x2cacf6[_0xdb6e('0x15')][_0xdb6e('0x16')]===0x1f4){logger[_0xdb6e('0x15')]('Team,\x20%s,\x20%s',_0x3624cd,_0x2cacf6[_0xdb6e('0x15')]['message']);return _0x337c24(_0x2cacf6['error'][_0xdb6e('0x17')]);}logger['error']('Team,\x20%s,\x20%s',_0x3624cd,_0x2cacf6[_0xdb6e('0x15')][_0xdb6e('0x17')]);return _0xcca584(_0x2cacf6[_0xdb6e('0x15')]['message']);}else{logger[_0xdb6e('0x10')](_0xdb6e('0x11'),_0x3624cd,'request\x20sent');_0xcca584(_0x2cacf6[_0xdb6e('0x18')][_0xdb6e('0x17')]);}})[_0xdb6e('0x19')](function(_0x1791a3){logger[_0xdb6e('0x15')](_0xdb6e('0x11'),_0x3624cd,_0x1791a3);_0x337c24(_0x1791a3);});});} \ No newline at end of file +var _0x1681=['localhost','./team.socket','register','request','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x34eb56,_0x16843e){var _0x3bdc06=function(_0x1e10e5){while(--_0x1e10e5){_0x34eb56['push'](_0x34eb56['shift']());}};_0x3bdc06(++_0x16843e);}(_0x1681,0x121));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1168('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1168('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1168('0x2'));var db=require(_0x1168('0x3'))['db'];var utils=require(_0x1168('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x1168('0x5'));var jayson=require(_0x1168('0x6'));var client=jayson[_0x1168('0x7')]['http']({'port':0x232a});config[_0x1168('0x8')]=_[_0x1168('0x9')](config[_0x1168('0x8')],{'host':_0x1168('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1168('0x8')]));require(_0x1168('0xb'))[_0x1168('0xc')](socket);function respondWithRpcPromise(_0x1c3ad6,_0x25bc63,_0x45b85c){return new BPromise(function(_0x3ac387,_0x1168d1){return client[_0x1168('0xd')](_0x1c3ad6,_0x45b85c)['then'](function(_0x1bef07){logger['info'](_0x1168('0xe'),_0x25bc63,_0x1168('0xf'));logger['debug'](_0x1168('0x10'),_0x25bc63,_0x1168('0xf'),JSON[_0x1168('0x11')](_0x1bef07));if(_0x1bef07[_0x1168('0x12')]){if(_0x1bef07[_0x1168('0x12')][_0x1168('0x13')]===0x1f4){logger[_0x1168('0x12')](_0x1168('0xe'),_0x25bc63,_0x1bef07[_0x1168('0x12')][_0x1168('0x14')]);return _0x1168d1(_0x1bef07[_0x1168('0x12')][_0x1168('0x14')]);}logger[_0x1168('0x12')]('Team,\x20%s,\x20%s',_0x25bc63,_0x1bef07[_0x1168('0x12')][_0x1168('0x14')]);return _0x3ac387(_0x1bef07[_0x1168('0x12')]['message']);}else{logger[_0x1168('0x15')](_0x1168('0xe'),_0x25bc63,_0x1168('0xf'));_0x3ac387(_0x1bef07['result'][_0x1168('0x14')]);}})[_0x1168('0x16')](function(_0xa0d4de){logger[_0x1168('0x12')](_0x1168('0xe'),_0x25bc63,_0xa0d4de);_0x1168d1(_0xa0d4de);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f0a072e..033e037 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 _0x1a44=['./team.events','remove','update','emit','removeListener','register','team:'];(function(_0x475dea,_0x49d113){var _0x557404=function(_0x1c09af){while(--_0x1c09af){_0x475dea['push'](_0x475dea['shift']());}};_0x557404(++_0x49d113);}(_0x1a44,0xc4));var _0x41a4=function(_0x5b39be,_0x13c4d1){_0x5b39be=_0x5b39be-0x0;var _0x557e9b=_0x1a44[_0x5b39be];return _0x557e9b;};'use strict';var TeamEvents=require(_0x41a4('0x0'));var events=['save',_0x41a4('0x1'),_0x41a4('0x2')];function createListener(_0x306334,_0xb7b167){return function(_0x308968){_0xb7b167[_0x41a4('0x3')](_0x306334,_0x308968);};}function removeListener(_0x397cb2,_0x529244){return function(){TeamEvents[_0x41a4('0x4')](_0x397cb2,_0x529244);};}exports[_0x41a4('0x5')]=function(_0xb62f3c){for(var _0x412bd8=0x0,_0x599ccc=events['length'];_0x412bd8<_0x599ccc;_0x412bd8++){var _0x2e523b=events[_0x412bd8];var _0x141ae3=createListener(_0x41a4('0x6')+_0x2e523b,_0xb62f3c);TeamEvents['on'](_0x2e523b,_0x141ae3);}}; \ No newline at end of file +var _0x4dcb=['save','remove','update','emit','length','team:'];(function(_0x43a251,_0x2ca1b8){var _0x15f782=function(_0x8b1d41){while(--_0x8b1d41){_0x43a251['push'](_0x43a251['shift']());}};_0x15f782(++_0x2ca1b8);}(_0x4dcb,0x186));var _0xb4dc=function(_0x34d284,_0x38b678){_0x34d284=_0x34d284-0x0;var _0x1f2f4b=_0x4dcb[_0x34d284];return _0x1f2f4b;};'use strict';var TeamEvents=require('./team.events');var events=[_0xb4dc('0x0'),_0xb4dc('0x1'),_0xb4dc('0x2')];function createListener(_0x3b0d48,_0x183583){return function(_0x1fad90){_0x183583[_0xb4dc('0x3')](_0x3b0d48,_0x1fad90);};}function removeListener(_0x2f9f7c,_0x161991){return function(){TeamEvents['removeListener'](_0x2f9f7c,_0x161991);};}exports['register']=function(_0x244be0){for(var _0x5be4d1=0x0,_0x445f93=events[_0xb4dc('0x4')];_0x5be4d1<_0x445f93;_0x5be4d1++){var _0x2d4522=events[_0x5be4d1];var _0x34c857=createListener(_0xb4dc('0x5')+_0x2d4522,_0x244be0);TeamEvents['on'](_0x2d4522,_0x34c857);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 02f7073..9b9dc5c 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 _0xdd31=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','create','put','update','delete','multer'];(function(_0x5b79aa,_0x565fcd){var _0x51ede2=function(_0x44f274){while(--_0x44f274){_0x5b79aa['push'](_0x5b79aa['shift']());}};_0x51ede2(++_0x565fcd);}(_0xdd31,0x1ec));var _0x1dd3=function(_0x18dc32,_0x26d38e){_0x18dc32=_0x18dc32-0x0;var _0x2adfaf=_0xdd31[_0x18dc32];return _0x2adfaf;};'use strict';var multer=require(_0x1dd3('0x0'));var util=require(_0x1dd3('0x1'));var path=require('path');var timeout=require(_0x1dd3('0x2'));var express=require(_0x1dd3('0x3'));var router=express[_0x1dd3('0x4')]();var auth=require(_0x1dd3('0x5'));var interaction=require(_0x1dd3('0x6'));var config=require(_0x1dd3('0x7'));var controller=require(_0x1dd3('0x8'));router[_0x1dd3('0x9')]('/',auth[_0x1dd3('0xa')](),controller[_0x1dd3('0xb')]);router[_0x1dd3('0x9')](_0x1dd3('0xc'),auth[_0x1dd3('0xa')](),controller['show']);router['post']('/',auth[_0x1dd3('0xa')](),controller[_0x1dd3('0xd')]);router[_0x1dd3('0xe')](_0x1dd3('0xc'),auth['isAuthenticated'](),controller[_0x1dd3('0xf')]);router[_0x1dd3('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa384=['create','put','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','/:id','show','post'];(function(_0x2168dc,_0x591c65){var _0x59c5e0=function(_0x5939f1){while(--_0x5939f1){_0x2168dc['push'](_0x2168dc['shift']());}};_0x59c5e0(++_0x591c65);}(_0xa384,0xee));var _0x4a38=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xa384[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0x4a38('0x0'));var util=require('util');var path=require(_0x4a38('0x1'));var timeout=require(_0x4a38('0x2'));var express=require(_0x4a38('0x3'));var router=express[_0x4a38('0x4')]();var auth=require(_0x4a38('0x5'));var interaction=require(_0x4a38('0x6'));var config=require(_0x4a38('0x7'));var controller=require(_0x4a38('0x8'));router['get']('/',auth[_0x4a38('0x9')](),controller[_0x4a38('0xa')]);router['get'](_0x4a38('0xb'),auth[_0x4a38('0x9')](),controller[_0x4a38('0xc')]);router[_0x4a38('0xd')]('/',auth[_0x4a38('0x9')](),controller[_0x4a38('0xe')]);router[_0x4a38('0xf')](_0x4a38('0xb'),auth[_0x4a38('0x9')](),controller[_0x4a38('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4a38('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 5bbddb0..6c80526 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 _0x7142=['STRING','TEXT','sequelize'];(function(_0x224940,_0x53db42){var _0x5a8bf8=function(_0x33e8d7){while(--_0x33e8d7){_0x224940['push'](_0x224940['shift']());}};_0x5a8bf8(++_0x53db42);}(_0x7142,0x1eb));var _0x2714=function(_0x393573,_0x4230ca){_0x393573=_0x393573-0x0;var _0x3afc7c=_0x7142[_0x393573];return _0x3afc7c;};'use strict';var Sequelize=require(_0x2714('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2714('0x1')]},'html':{'type':Sequelize[_0x2714('0x2')]}}; \ No newline at end of file +var _0xb7d4=['TEXT','exports','STRING'];(function(_0x1dda39,_0x221826){var _0x269408=function(_0x545613){while(--_0x545613){_0x1dda39['push'](_0x1dda39['shift']());}};_0x269408(++_0x221826);}(_0xb7d4,0xb8));var _0x4b7d=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb7d4[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require('sequelize');module[_0x4b7d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4b7d('0x1')]},'html':{'type':Sequelize[_0x4b7d('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index e0254c5..3879452 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 _0xce85=['fieldName','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','role','UserProfileSection','update','html-pdf','eml-format','rimraf','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','Content-Range','apply','save','then','destroy','get','Templates','UserProfileResource','end','sendStatus','error','name','send','index','Template'];(function(_0xec1289,_0x4fa82b){var _0x3e223c=function(_0x9752ec){while(--_0x9752ec){_0xec1289['push'](_0xec1289['shift']());}};_0x3e223c(++_0x4fa82b);}(_0xce85,0x14a));var _0x5ce8=function(_0x348d8d,_0x25a6dd){_0x348d8d=_0x348d8d-0x0;var _0x2a7d1f=_0xce85[_0x348d8d];return _0x2a7d1f;};'use strict';var pdf=require(_0x5ce8('0x0'));var emlformat=require(_0x5ce8('0x1'));var rimraf=require(_0x5ce8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ce8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5ce8('0x4'));var csv=require(_0x5ce8('0x5'));var ejs=require(_0x5ce8('0x6'));var fs=require('fs');var _=require(_0x5ce8('0x7'));var squel=require(_0x5ce8('0x8'));var crypto=require(_0x5ce8('0x9'));var jsforce=require(_0x5ce8('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5ce8('0xb'));var Redis=require(_0x5ce8('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x5ce8('0xd'));var as=require(_0x5ce8('0xe'));var hardwareService=require(_0x5ce8('0xf'));var logger=require(_0x5ce8('0x10'))(_0x5ce8('0x11'));var utils=require(_0x5ce8('0x12'));var config=require(_0x5ce8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f129a,_0x5ed104){_0x5ed104=_0x5ed104||0xcc;return function(_0x5a3e3e){if(_0x5a3e3e){return _0x5f129a['sendStatus'](_0x5ed104);}return _0x5f129a[_0x5ce8('0x14')](_0x5ed104)['end']();};}function respondWithResult(_0x2e5119,_0x4f073c){_0x4f073c=_0x4f073c||0xc8;return function(_0x35d453){if(_0x35d453){return _0x2e5119[_0x5ce8('0x14')](_0x4f073c)[_0x5ce8('0x15')](_0x35d453);}};}function respondWithFilteredResult(_0xbc4b60,_0x382f00){return function(_0x2f77b7){if(_0x2f77b7){var _0xa01c68=_0x2f77b7[_0x5ce8('0x16')],_0x39f229=_0x382f00[_0x5ce8('0x17')],_0x330af1=_0x382f00[_0x5ce8('0x17')]+_0x382f00[_0x5ce8('0x18')],_0x1b3ee8;if(_0x330af1>=_0xa01c68){_0x330af1=_0xa01c68;_0x1b3ee8=0xc8;}else{_0x1b3ee8=0xce;}_0xbc4b60[_0x5ce8('0x14')](_0x1b3ee8);return _0xbc4b60['set'](_0x5ce8('0x19'),_0x39f229+'-'+_0x330af1+'/'+_0xa01c68)[_0x5ce8('0x15')](_0x2f77b7);}return null;};}function patchUpdates(_0x220e9c){return function(_0x293d70){try{jsonpatch[_0x5ce8('0x1a')](_0x293d70,_0x220e9c,!![]);}catch(_0x28a137){return BPromise['reject'](_0x28a137);}return _0x293d70[_0x5ce8('0x1b')]();};}function saveUpdates(_0x5c2683,_0x32f983){return function(_0x5f51bb){if(_0x5f51bb){return _0x5f51bb['update'](_0x5c2683)[_0x5ce8('0x1c')](function(_0x1ba281){return _0x1ba281;});}return null;};}function removeEntity(_0x23c060,_0x4110ba){return function(_0x80fd43){if(_0x80fd43){return _0x80fd43[_0x5ce8('0x1d')]()[_0x5ce8('0x1c')](function(){var _0x1fe841=_0x80fd43[_0x5ce8('0x1e')]({'plain':!![]});var _0x3fad1e=_0x5ce8('0x1f');return db[_0x5ce8('0x20')][_0x5ce8('0x1d')]({'where':{'type':_0x3fad1e,'resourceId':_0x1fe841['id']}})['then'](function(){return _0x80fd43;});})[_0x5ce8('0x1c')](function(){_0x23c060[_0x5ce8('0x14')](0xcc)[_0x5ce8('0x21')]();});}};}function handleEntityNotFound(_0x5f333e,_0x4eff62){return function(_0x384520){if(!_0x384520){_0x5f333e[_0x5ce8('0x22')](0x194);}return _0x384520;};}function handleError(_0x236fb6,_0x251fb1){_0x251fb1=_0x251fb1||0x1f4;return function(_0x133742){logger[_0x5ce8('0x23')](_0x133742['stack']);if(_0x133742[_0x5ce8('0x24')]){delete _0x133742[_0x5ce8('0x24')];}_0x236fb6[_0x5ce8('0x14')](_0x251fb1)[_0x5ce8('0x25')](_0x133742);};}exports[_0x5ce8('0x26')]=function(_0x345be9,_0x4e33b1){var _0x453c14={},_0x4cf24f={},_0x168fa4={'count':0x0,'rows':[]};var _0x2de302=_['map'](db[_0x5ce8('0x27')]['rawAttributes'],function(_0x48f8ed){return{'name':_0x48f8ed[_0x5ce8('0x28')],'type':_0x48f8ed['type']['key']};});_0x4cf24f['model']=_[_0x5ce8('0x29')](_0x2de302,_0x5ce8('0x24'));_0x4cf24f['query']=_[_0x5ce8('0x2a')](_0x345be9[_0x5ce8('0x2b')]);_0x4cf24f[_0x5ce8('0x2c')]=_[_0x5ce8('0x2d')](_0x4cf24f[_0x5ce8('0x2e')],_0x4cf24f[_0x5ce8('0x2b')]);_0x453c14['attributes']=_[_0x5ce8('0x2d')](_0x4cf24f[_0x5ce8('0x2e')],qs[_0x5ce8('0x2f')](_0x345be9[_0x5ce8('0x2b')]['fields']));_0x453c14[_0x5ce8('0x30')]=_0x453c14['attributes'][_0x5ce8('0x31')]?_0x453c14[_0x5ce8('0x30')]:_0x4cf24f['model'];if(!_0x345be9[_0x5ce8('0x2b')][_0x5ce8('0x32')](_0x5ce8('0x33'))){_0x453c14[_0x5ce8('0x18')]=qs[_0x5ce8('0x18')](_0x345be9[_0x5ce8('0x2b')][_0x5ce8('0x18')]);_0x453c14[_0x5ce8('0x17')]=qs[_0x5ce8('0x17')](_0x345be9[_0x5ce8('0x2b')][_0x5ce8('0x17')]);}_0x453c14[_0x5ce8('0x34')]=qs[_0x5ce8('0x35')](_0x345be9['query'][_0x5ce8('0x35')]);_0x453c14[_0x5ce8('0x36')]=qs['filters'](_[_0x5ce8('0x37')](_0x345be9[_0x5ce8('0x2b')],_0x4cf24f[_0x5ce8('0x2c')]));if(_0x345be9['query']['filter']){_0x453c14['where']=_['merge'](_0x453c14[_0x5ce8('0x36')],{'$or':_['map'](_0x2de302,function(_0x229b22){if(_0x229b22[_0x5ce8('0x38')]!=='VIRTUAL'){var _0x11add4={};_0x11add4[_0x229b22[_0x5ce8('0x24')]]={'$like':'%'+_0x345be9[_0x5ce8('0x2b')][_0x5ce8('0x39')]+'%'};return _0x11add4;}})});}_0x453c14=_[_0x5ce8('0x3a')]({},_0x453c14,_0x345be9[_0x5ce8('0x3b')]);var _0x4ba553={'where':_0x453c14[_0x5ce8('0x36')]};return db[_0x5ce8('0x27')][_0x5ce8('0x16')](_0x4ba553)[_0x5ce8('0x1c')](function(_0x23eb19){_0x168fa4[_0x5ce8('0x16')]=_0x23eb19;if(_0x345be9[_0x5ce8('0x2b')][_0x5ce8('0x3c')]){_0x453c14[_0x5ce8('0x3d')]=[{'all':!![]}];}return db[_0x5ce8('0x27')][_0x5ce8('0x3e')](_0x453c14);})['then'](function(_0x2a945f){_0x168fa4[_0x5ce8('0x3f')]=_0x2a945f;return _0x168fa4;})[_0x5ce8('0x1c')](respondWithFilteredResult(_0x4e33b1,_0x453c14))[_0x5ce8('0x40')](handleError(_0x4e33b1,null));};exports['show']=function(_0x15847e,_0xfd7b2b){var _0xdc6650={'raw':!![],'where':{'id':_0x15847e[_0x5ce8('0x41')]['id']}},_0x29d834={};_0x29d834[_0x5ce8('0x2e')]=_['keys'](db[_0x5ce8('0x27')][_0x5ce8('0x42')]);_0x29d834[_0x5ce8('0x2b')]=_[_0x5ce8('0x2a')](_0x15847e[_0x5ce8('0x2b')]);_0x29d834['filters']=_[_0x5ce8('0x2d')](_0x29d834[_0x5ce8('0x2e')],_0x29d834[_0x5ce8('0x2b')]);_0xdc6650[_0x5ce8('0x30')]=_[_0x5ce8('0x2d')](_0x29d834[_0x5ce8('0x2e')],qs[_0x5ce8('0x2f')](_0x15847e['query'][_0x5ce8('0x2f')]));_0xdc6650[_0x5ce8('0x30')]=_0xdc6650[_0x5ce8('0x30')][_0x5ce8('0x31')]?_0xdc6650['attributes']:_0x29d834['model'];if(_0x15847e['query'][_0x5ce8('0x3c')]){_0xdc6650[_0x5ce8('0x3d')]=[{'all':!![]}];}_0xdc6650=_[_0x5ce8('0x3a')]({},_0xdc6650,_0x15847e[_0x5ce8('0x3b')]);return db['Template'][_0x5ce8('0x43')](_0xdc6650)['then'](handleEntityNotFound(_0xfd7b2b,null))[_0x5ce8('0x1c')](respondWithResult(_0xfd7b2b,null))[_0x5ce8('0x40')](handleError(_0xfd7b2b,null));};exports[_0x5ce8('0x44')]=function(_0x41961b,_0x3e5f24){return db[_0x5ce8('0x27')][_0x5ce8('0x44')](_0x41961b[_0x5ce8('0x45')],{})['then'](function(_0x1b0492){var _0x2feba8=_0x41961b[_0x5ce8('0x46')][_0x5ce8('0x1e')]({'plain':!![]});if(!_0x2feba8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2feba8[_0x5ce8('0x47')]===_0x5ce8('0x46')){var _0x56cb74=_0x1b0492['get']({'plain':!![]});var _0x3cf5b6='Templates';return db[_0x5ce8('0x48')][_0x5ce8('0x43')]({'where':{'name':_0x3cf5b6,'userProfileId':_0x2feba8['userProfileId']},'raw':!![]})[_0x5ce8('0x1c')](function(_0x5db673){if(_0x5db673&&_0x5db673['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x56cb74[_0x5ce8('0x24')],'resourceId':_0x56cb74['id'],'type':_0x5db673[_0x5ce8('0x24')],'sectionId':_0x5db673['id']},{})[_0x5ce8('0x1c')](function(){return _0x1b0492;});}else{return _0x1b0492;}})[_0x5ce8('0x40')](function(_0x4cc93f){logger[_0x5ce8('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cc93f);throw _0x4cc93f;});}return _0x1b0492;})[_0x5ce8('0x1c')](respondWithResult(_0x3e5f24,0xc9))['catch'](handleError(_0x3e5f24,null));};exports[_0x5ce8('0x49')]=function(_0x5108bf,_0x33f0ec){if(_0x5108bf[_0x5ce8('0x45')]['id']){delete _0x5108bf[_0x5ce8('0x45')]['id'];}return db['Template'][_0x5ce8('0x43')]({'where':{'id':_0x5108bf[_0x5ce8('0x41')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x33f0ec,null))['then'](saveUpdates(_0x5108bf['body'],null))[_0x5ce8('0x1c')](respondWithResult(_0x33f0ec,null))[_0x5ce8('0x40')](handleError(_0x33f0ec,null));};exports[_0x5ce8('0x1d')]=function(_0x5428ca,_0x52c747){return db[_0x5ce8('0x27')][_0x5ce8('0x43')]({'where':{'id':_0x5428ca[_0x5ce8('0x41')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x52c747,null))[_0x5ce8('0x1c')](removeEntity(_0x52c747,null))[_0x5ce8('0x40')](handleError(_0x52c747,null));}; \ No newline at end of file +var _0x6c1d=['sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','get','Templates','UserProfileResource','error','stack','name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','options','Template','includeAll','include','show','params','rawAttributes','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','destroy','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6c1d,0x83));var _0xd6c1=function(_0x11eceb,_0x49b9ba){_0x11eceb=_0x11eceb-0x0;var _0x545df8=_0x6c1d[_0x11eceb];return _0x545df8;};'use strict';var pdf=require(_0xd6c1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd6c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6c1('0x2'));var rp=require(_0xd6c1('0x3'));var moment=require(_0xd6c1('0x4'));var BPromise=require(_0xd6c1('0x5'));var Mustache=require(_0xd6c1('0x6'));var util=require(_0xd6c1('0x7'));var path=require(_0xd6c1('0x8'));var sox=require('sox');var csv=require(_0xd6c1('0x9'));var ejs=require(_0xd6c1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd6c1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd6c1('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd6c1('0xd'));var Papa=require(_0xd6c1('0xe'));var Redis=require(_0xd6c1('0xf'));var authService=require(_0xd6c1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd6c1('0x11'))(_0xd6c1('0x12'));var utils=require(_0xd6c1('0x13'));var config=require(_0xd6c1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bf160,_0x483fbc){_0x483fbc=_0x483fbc||0xcc;return function(_0x2feff1){if(_0x2feff1){return _0x3bf160[_0xd6c1('0x15')](_0x483fbc);}return _0x3bf160['status'](_0x483fbc)[_0xd6c1('0x16')]();};}function respondWithResult(_0x2a2eb9,_0xb39424){_0xb39424=_0xb39424||0xc8;return function(_0x289a75){if(_0x289a75){return _0x2a2eb9[_0xd6c1('0x17')](_0xb39424)[_0xd6c1('0x18')](_0x289a75);}};}function respondWithFilteredResult(_0x3d00da,_0x5bd027){return function(_0x3e319d){if(_0x3e319d){var _0x56e61e=_0x3e319d[_0xd6c1('0x19')],_0x19a2aa=_0x5bd027[_0xd6c1('0x1a')],_0x44965b=_0x5bd027[_0xd6c1('0x1a')]+_0x5bd027[_0xd6c1('0x1b')],_0x551a78;if(_0x44965b>=_0x56e61e){_0x44965b=_0x56e61e;_0x551a78=0xc8;}else{_0x551a78=0xce;}_0x3d00da[_0xd6c1('0x17')](_0x551a78);return _0x3d00da[_0xd6c1('0x1c')]('Content-Range',_0x19a2aa+'-'+_0x44965b+'/'+_0x56e61e)[_0xd6c1('0x18')](_0x3e319d);}return null;};}function patchUpdates(_0x3f9687){return function(_0x17d8b6){try{jsonpatch[_0xd6c1('0x1d')](_0x17d8b6,_0x3f9687,!![]);}catch(_0x185cfc){return BPromise[_0xd6c1('0x1e')](_0x185cfc);}return _0x17d8b6[_0xd6c1('0x1f')]();};}function saveUpdates(_0x58dbce,_0x3b835a){return function(_0x5e0d70){if(_0x5e0d70){return _0x5e0d70['update'](_0x58dbce)[_0xd6c1('0x20')](function(_0x2bcaf5){return _0x2bcaf5;});}return null;};}function removeEntity(_0x199948,_0x25cc14){return function(_0x5f5759){if(_0x5f5759){return _0x5f5759['destroy']()[_0xd6c1('0x20')](function(){var _0x400abb=_0x5f5759[_0xd6c1('0x21')]({'plain':!![]});var _0x510742=_0xd6c1('0x22');return db[_0xd6c1('0x23')]['destroy']({'where':{'type':_0x510742,'resourceId':_0x400abb['id']}})[_0xd6c1('0x20')](function(){return _0x5f5759;});})[_0xd6c1('0x20')](function(){_0x199948[_0xd6c1('0x17')](0xcc)[_0xd6c1('0x16')]();});}};}function handleEntityNotFound(_0x4e5bb8,_0x1b2913){return function(_0x56c537){if(!_0x56c537){_0x4e5bb8[_0xd6c1('0x15')](0x194);}return _0x56c537;};}function handleError(_0x3bcc99,_0x2ceb99){_0x2ceb99=_0x2ceb99||0x1f4;return function(_0x512142){logger[_0xd6c1('0x24')](_0x512142[_0xd6c1('0x25')]);if(_0x512142[_0xd6c1('0x26')]){delete _0x512142[_0xd6c1('0x26')];}_0x3bcc99['status'](_0x2ceb99)[_0xd6c1('0x27')](_0x512142);};}exports['index']=function(_0x8c1979,_0x4d197b){var _0x242ef1={},_0x333db2={},_0x3f31e4={'count':0x0,'rows':[]};var _0x2a305f=_['map'](db['Template']['rawAttributes'],function(_0x4697f1){return{'name':_0x4697f1[_0xd6c1('0x28')],'type':_0x4697f1[_0xd6c1('0x29')][_0xd6c1('0x2a')]};});_0x333db2[_0xd6c1('0x2b')]=_[_0xd6c1('0x2c')](_0x2a305f,_0xd6c1('0x26'));_0x333db2[_0xd6c1('0x2d')]=_[_0xd6c1('0x2e')](_0x8c1979['query']);_0x333db2[_0xd6c1('0x2f')]=_[_0xd6c1('0x30')](_0x333db2[_0xd6c1('0x2b')],_0x333db2[_0xd6c1('0x2d')]);_0x242ef1[_0xd6c1('0x31')]=_[_0xd6c1('0x30')](_0x333db2[_0xd6c1('0x2b')],qs[_0xd6c1('0x32')](_0x8c1979[_0xd6c1('0x2d')][_0xd6c1('0x32')]));_0x242ef1['attributes']=_0x242ef1[_0xd6c1('0x31')][_0xd6c1('0x33')]?_0x242ef1[_0xd6c1('0x31')]:_0x333db2['model'];if(!_0x8c1979[_0xd6c1('0x2d')][_0xd6c1('0x34')]('nolimit')){_0x242ef1[_0xd6c1('0x1b')]=qs['limit'](_0x8c1979['query'][_0xd6c1('0x1b')]);_0x242ef1[_0xd6c1('0x1a')]=qs[_0xd6c1('0x1a')](_0x8c1979[_0xd6c1('0x2d')][_0xd6c1('0x1a')]);}_0x242ef1[_0xd6c1('0x35')]=qs[_0xd6c1('0x36')](_0x8c1979[_0xd6c1('0x2d')][_0xd6c1('0x36')]);_0x242ef1[_0xd6c1('0x37')]=qs[_0xd6c1('0x2f')](_[_0xd6c1('0x38')](_0x8c1979[_0xd6c1('0x2d')],_0x333db2[_0xd6c1('0x2f')]));if(_0x8c1979[_0xd6c1('0x2d')]['filter']){_0x242ef1['where']=_['merge'](_0x242ef1[_0xd6c1('0x37')],{'$or':_['map'](_0x2a305f,function(_0x1d6049){if(_0x1d6049[_0xd6c1('0x29')]!=='VIRTUAL'){var _0x3e205d={};_0x3e205d[_0x1d6049[_0xd6c1('0x26')]]={'$like':'%'+_0x8c1979[_0xd6c1('0x2d')]['filter']+'%'};return _0x3e205d;}})});}_0x242ef1=_['merge']({},_0x242ef1,_0x8c1979[_0xd6c1('0x39')]);var _0x362b4a={'where':_0x242ef1[_0xd6c1('0x37')]};return db[_0xd6c1('0x3a')]['count'](_0x362b4a)[_0xd6c1('0x20')](function(_0x137a25){_0x3f31e4[_0xd6c1('0x19')]=_0x137a25;if(_0x8c1979[_0xd6c1('0x2d')][_0xd6c1('0x3b')]){_0x242ef1[_0xd6c1('0x3c')]=[{'all':!![]}];}return db['Template']['findAll'](_0x242ef1);})[_0xd6c1('0x20')](function(_0xf750f7){_0x3f31e4['rows']=_0xf750f7;return _0x3f31e4;})[_0xd6c1('0x20')](respondWithFilteredResult(_0x4d197b,_0x242ef1))['catch'](handleError(_0x4d197b,null));};exports[_0xd6c1('0x3d')]=function(_0x245b80,_0x4c94b5){var _0x2521f4={'raw':!![],'where':{'id':_0x245b80[_0xd6c1('0x3e')]['id']}},_0x229c5d={};_0x229c5d[_0xd6c1('0x2b')]=_[_0xd6c1('0x2e')](db['Template'][_0xd6c1('0x3f')]);_0x229c5d[_0xd6c1('0x2d')]=_[_0xd6c1('0x2e')](_0x245b80[_0xd6c1('0x2d')]);_0x229c5d[_0xd6c1('0x2f')]=_['intersection'](_0x229c5d[_0xd6c1('0x2b')],_0x229c5d[_0xd6c1('0x2d')]);_0x2521f4[_0xd6c1('0x31')]=_[_0xd6c1('0x30')](_0x229c5d['model'],qs[_0xd6c1('0x32')](_0x245b80[_0xd6c1('0x2d')][_0xd6c1('0x32')]));_0x2521f4[_0xd6c1('0x31')]=_0x2521f4[_0xd6c1('0x31')][_0xd6c1('0x33')]?_0x2521f4[_0xd6c1('0x31')]:_0x229c5d[_0xd6c1('0x2b')];if(_0x245b80['query'][_0xd6c1('0x3b')]){_0x2521f4[_0xd6c1('0x3c')]=[{'all':!![]}];}_0x2521f4=_[_0xd6c1('0x40')]({},_0x2521f4,_0x245b80[_0xd6c1('0x39')]);return db['Template'][_0xd6c1('0x41')](_0x2521f4)[_0xd6c1('0x20')](handleEntityNotFound(_0x4c94b5,null))['then'](respondWithResult(_0x4c94b5,null))[_0xd6c1('0x42')](handleError(_0x4c94b5,null));};exports[_0xd6c1('0x43')]=function(_0x28a0cc,_0x5b77f8){return db[_0xd6c1('0x3a')][_0xd6c1('0x43')](_0x28a0cc[_0xd6c1('0x44')],{})[_0xd6c1('0x20')](function(_0x4d6bbb){var _0x43137b=_0x28a0cc[_0xd6c1('0x45')][_0xd6c1('0x21')]({'plain':!![]});if(!_0x43137b)throw new Error(_0xd6c1('0x46'));if(_0x43137b[_0xd6c1('0x47')]===_0xd6c1('0x45')){var _0x3354a2=_0x4d6bbb[_0xd6c1('0x21')]({'plain':!![]});var _0x1105e7=_0xd6c1('0x22');return db[_0xd6c1('0x48')][_0xd6c1('0x41')]({'where':{'name':_0x1105e7,'userProfileId':_0x43137b[_0xd6c1('0x49')]},'raw':!![]})[_0xd6c1('0x20')](function(_0x54e0dd){if(_0x54e0dd&&_0x54e0dd[_0xd6c1('0x4a')]===0x0){return db[_0xd6c1('0x23')][_0xd6c1('0x43')]({'name':_0x3354a2['name'],'resourceId':_0x3354a2['id'],'type':_0x54e0dd[_0xd6c1('0x26')],'sectionId':_0x54e0dd['id']},{})[_0xd6c1('0x20')](function(){return _0x4d6bbb;});}else{return _0x4d6bbb;}})[_0xd6c1('0x42')](function(_0x3c69a8){logger[_0xd6c1('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c69a8);throw _0x3c69a8;});}return _0x4d6bbb;})[_0xd6c1('0x20')](respondWithResult(_0x5b77f8,0xc9))[_0xd6c1('0x42')](handleError(_0x5b77f8,null));};exports['update']=function(_0x3cc8ee,_0x3d2b0c){if(_0x3cc8ee[_0xd6c1('0x44')]['id']){delete _0x3cc8ee[_0xd6c1('0x44')]['id'];}return db[_0xd6c1('0x3a')][_0xd6c1('0x41')]({'where':{'id':_0x3cc8ee[_0xd6c1('0x3e')]['id']}})[_0xd6c1('0x20')](handleEntityNotFound(_0x3d2b0c,null))['then'](saveUpdates(_0x3cc8ee[_0xd6c1('0x44')],null))[_0xd6c1('0x20')](respondWithResult(_0x3d2b0c,null))[_0xd6c1('0x42')](handleError(_0x3d2b0c,null));};exports[_0xd6c1('0x4b')]=function(_0x1f27f0,_0x52b917){return db[_0xd6c1('0x3a')][_0xd6c1('0x41')]({'where':{'id':_0x1f27f0['params']['id']}})['then'](handleEntityNotFound(_0x52b917,null))['then'](removeEntity(_0x52b917,null))['catch'](handleError(_0x52b917,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 87ecd3f..5d21de0 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 _0xedc8=['moment','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','tools_templates','util','../../config/logger','api'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xedc8,0x1e1));var _0x8edc=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xedc8[_0x172747];return _0x509692;};'use strict';var _=require('lodash');var util=require(_0x8edc('0x0'));var logger=require(_0x8edc('0x1'))(_0x8edc('0x2'));var moment=require(_0x8edc('0x3'));var BPromise=require(_0x8edc('0x4'));var rp=require(_0x8edc('0x5'));var fs=require('fs');var path=require(_0x8edc('0x6'));var rimraf=require('rimraf');var config=require(_0x8edc('0x7'));var attributes=require(_0x8edc('0x8'));module[_0x8edc('0x9')]=function(_0x22aab1,_0x31737c){return _0x22aab1['define']('Template',attributes,{'tableName':_0x8edc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa89a=['Template','tools_templates','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa89a,0x1d0));var _0xaa89=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xa89a[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0xaa89('0x0'));var util=require(_0xaa89('0x1'));var logger=require(_0xaa89('0x2'))(_0xaa89('0x3'));var moment=require(_0xaa89('0x4'));var BPromise=require('bluebird');var rp=require(_0xaa89('0x5'));var fs=require('fs');var path=require(_0xaa89('0x6'));var rimraf=require(_0xaa89('0x7'));var config=require(_0xaa89('0x8'));var attributes=require(_0xaa89('0x9'));module[_0xaa89('0xa')]=function(_0x3621d4,_0xa294fa){return _0x3621d4[_0xaa89('0xb')](_0xaa89('0xc'),attributes,{'tableName':_0xaa89('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 04ed406..0d9272b 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 _0xd15d=['debug','stringify','util','moment','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','message','catch','GetTemplate','Template','findAll','options','attributes','limit','map','model','include'];(function(_0x5e7192,_0x2330fc){var _0x13bd72=function(_0x5233b7){while(--_0x5233b7){_0x5e7192['push'](_0x5e7192['shift']());}};_0x13bd72(++_0x2330fc);}(_0xd15d,0xf5));var _0xdd15=function(_0x665846,_0x5503d8){_0x665846=_0x665846-0x0;var _0x16c349=_0xd15d[_0x665846];return _0x16c349;};'use strict';var _=require('lodash');var util=require(_0xdd15('0x0'));var moment=require(_0xdd15('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdd15('0x2'));var logger=require(_0xdd15('0x3'))(_0xdd15('0x4'));var config=require('../../config/environment');var jayson=require(_0xdd15('0x5'));var client=jayson[_0xdd15('0x6')][_0xdd15('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3f4da8,_0x3484ef,_0x476fde){return new BPromise(function(_0x537e44,_0x353b4f){return client[_0xdd15('0x8')](_0x3f4da8,_0x476fde)[_0xdd15('0x9')](function(_0x572441){logger['info'](_0xdd15('0xa'),_0x3484ef,_0xdd15('0xb'));logger['debug'](_0xdd15('0xc'),_0x3484ef,_0xdd15('0xb'),JSON['stringify'](_0x572441));if(_0x572441[_0xdd15('0xd')]){if(_0x572441['error']['code']===0x1f4){logger[_0xdd15('0xd')](_0xdd15('0xa'),_0x3484ef,_0x572441[_0xdd15('0xd')][_0xdd15('0xe')]);return _0x353b4f(_0x572441[_0xdd15('0xd')]['message']);}logger[_0xdd15('0xd')](_0xdd15('0xa'),_0x3484ef,_0x572441[_0xdd15('0xd')][_0xdd15('0xe')]);return _0x537e44(_0x572441[_0xdd15('0xd')][_0xdd15('0xe')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x3484ef,_0xdd15('0xb'));_0x537e44(_0x572441['result'][_0xdd15('0xe')]);}})[_0xdd15('0xf')](function(_0x126a4d){logger[_0xdd15('0xd')](_0xdd15('0xa'),_0x3484ef,_0x126a4d);_0x353b4f(_0x126a4d);});});}exports[_0xdd15('0x10')]=function(_0x2d6c04){var _0x4c0436=this;return new Promise(function(_0x5f5be1,_0x1e9078){return db[_0xdd15('0x11')][_0xdd15('0x12')]({'raw':_0x2d6c04[_0xdd15('0x13')]?_0x2d6c04[_0xdd15('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x2d6c04[_0xdd15('0x13')]?_0x2d6c04[_0xdd15('0x13')]['where']||null:null,'attributes':_0x2d6c04[_0xdd15('0x13')]?_0x2d6c04[_0xdd15('0x13')][_0xdd15('0x14')]||null:null,'limit':_0x2d6c04[_0xdd15('0x13')]?_0x2d6c04[_0xdd15('0x13')][_0xdd15('0x15')]||null:null,'include':_0x2d6c04[_0xdd15('0x13')]?_0x2d6c04[_0xdd15('0x13')]['include']?_[_0xdd15('0x16')](_0x2d6c04[_0xdd15('0x13')]['include'],function(_0x43a804){return{'model':db[_0x43a804[_0xdd15('0x17')]],'as':_0x43a804['as'],'attributes':_0x43a804[_0xdd15('0x14')],'include':_0x43a804[_0xdd15('0x18')]?_[_0xdd15('0x16')](_0x43a804[_0xdd15('0x18')],function(_0xbf6e7d){return{'model':db[_0xbf6e7d[_0xdd15('0x17')]],'as':_0xbf6e7d['as'],'attributes':_0xbf6e7d[_0xdd15('0x14')],'include':_0xbf6e7d['include']?_[_0xdd15('0x16')](_0xbf6e7d[_0xdd15('0x18')],function(_0x131efa){return{'model':db[_0x131efa[_0xdd15('0x17')]],'as':_0x131efa['as'],'attributes':_0x131efa[_0xdd15('0x14')]};}):[]};}):[]};}):[]:[]})[_0xdd15('0x9')](function(_0x48240b){logger['info'](_0xdd15('0x10'),_0x2d6c04);logger[_0xdd15('0x19')](_0xdd15('0x10'),_0x2d6c04,JSON[_0xdd15('0x1a')](_0x48240b));_0x5f5be1(_0x48240b);})[_0xdd15('0xf')](function(_0x2af632){logger[_0xdd15('0xd')](_0xdd15('0x10'),_0x2af632[_0xdd15('0xe')],_0x2d6c04);_0x1e9078(_0x4c0436[_0xdd15('0xd')](0x1f4,_0x2af632['message']));});});}; \ No newline at end of file +var _0x65ca=['Template,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','GetTemplate','Template','options','where','attributes','limit','include','map','model','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x65ca,0x8e));var _0xa65c=function(_0x6dce05,_0x539eb6){_0x6dce05=_0x6dce05-0x0;var _0x7f486=_0x65ca[_0x6dce05];return _0x7f486;};'use strict';var _=require(_0xa65c('0x0'));var util=require(_0xa65c('0x1'));var moment=require(_0xa65c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa65c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa65c('0x4'));var logger=require(_0xa65c('0x5'))(_0xa65c('0x6'));var config=require(_0xa65c('0x7'));var jayson=require(_0xa65c('0x8'));var client=jayson[_0xa65c('0x9')][_0xa65c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53f51f,_0x3e2fbb,_0x535ff6){return new BPromise(function(_0x1ae1d0,_0x1f4595){return client[_0xa65c('0xb')](_0x53f51f,_0x535ff6)[_0xa65c('0xc')](function(_0x3fead8){logger['info'](_0xa65c('0xd'),_0x3e2fbb,_0xa65c('0xe'));logger[_0xa65c('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x3e2fbb,_0xa65c('0xe'),JSON['stringify'](_0x3fead8));if(_0x3fead8[_0xa65c('0x10')]){if(_0x3fead8[_0xa65c('0x10')][_0xa65c('0x11')]===0x1f4){logger[_0xa65c('0x10')]('Template,\x20%s,\x20%s',_0x3e2fbb,_0x3fead8[_0xa65c('0x10')][_0xa65c('0x12')]);return _0x1f4595(_0x3fead8[_0xa65c('0x10')][_0xa65c('0x12')]);}logger['error'](_0xa65c('0xd'),_0x3e2fbb,_0x3fead8[_0xa65c('0x10')][_0xa65c('0x12')]);return _0x1ae1d0(_0x3fead8[_0xa65c('0x10')][_0xa65c('0x12')]);}else{logger[_0xa65c('0x13')](_0xa65c('0xd'),_0x3e2fbb,_0xa65c('0xe'));_0x1ae1d0(_0x3fead8['result'][_0xa65c('0x12')]);}})[_0xa65c('0x14')](function(_0x3e1f44){logger[_0xa65c('0x10')](_0xa65c('0xd'),_0x3e2fbb,_0x3e1f44);_0x1f4595(_0x3e1f44);});});}exports[_0xa65c('0x15')]=function(_0x4b2549){var _0xbb71d=this;return new Promise(function(_0x4207e3,_0x33369e){return db[_0xa65c('0x16')]['findAll']({'raw':_0x4b2549['options']?_0x4b2549['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b2549[_0xa65c('0x17')]?_0x4b2549[_0xa65c('0x17')][_0xa65c('0x18')]||null:null,'attributes':_0x4b2549[_0xa65c('0x17')]?_0x4b2549[_0xa65c('0x17')][_0xa65c('0x19')]||null:null,'limit':_0x4b2549[_0xa65c('0x17')]?_0x4b2549[_0xa65c('0x17')][_0xa65c('0x1a')]||null:null,'include':_0x4b2549[_0xa65c('0x17')]?_0x4b2549[_0xa65c('0x17')][_0xa65c('0x1b')]?_['map'](_0x4b2549[_0xa65c('0x17')][_0xa65c('0x1b')],function(_0x3fed5d){return{'model':db[_0x3fed5d['model']],'as':_0x3fed5d['as'],'attributes':_0x3fed5d[_0xa65c('0x19')],'include':_0x3fed5d[_0xa65c('0x1b')]?_[_0xa65c('0x1c')](_0x3fed5d[_0xa65c('0x1b')],function(_0x56e445){return{'model':db[_0x56e445[_0xa65c('0x1d')]],'as':_0x56e445['as'],'attributes':_0x56e445['attributes'],'include':_0x56e445['include']?_[_0xa65c('0x1c')](_0x56e445[_0xa65c('0x1b')],function(_0x3792a8){return{'model':db[_0x3792a8['model']],'as':_0x3792a8['as'],'attributes':_0x3792a8[_0xa65c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa65c('0xc')](function(_0x35a3fa){logger[_0xa65c('0x13')](_0xa65c('0x15'),_0x4b2549);logger[_0xa65c('0xf')](_0xa65c('0x15'),_0x4b2549,JSON[_0xa65c('0x1e')](_0x35a3fa));_0x4207e3(_0x35a3fa);})[_0xa65c('0x14')](function(_0x507f25){logger['error'](_0xa65c('0x15'),_0x507f25[_0xa65c('0x12')],_0x4b2549);_0x33369e(_0xbb71d[_0xa65c('0x10')](0x1f4,_0x507f25['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 1c58351..b5a6dae 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 _0xebd4=['put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','/:id','show','/:id/all_conditions','/:id/any_conditions','create','post','addAllCondition','addAnyCondition','/:id/actions','addAction'];(function(_0x59ffb3,_0x4a76b8){var _0x1c4c37=function(_0x52b890){while(--_0x52b890){_0x59ffb3['push'](_0x59ffb3['shift']());}};_0x1c4c37(++_0x4a76b8);}(_0xebd4,0x1e8));var _0x4ebd=function(_0x3f9b0a,_0x1c03a2){_0x3f9b0a=_0x3f9b0a-0x0;var _0x252830=_0xebd4[_0x3f9b0a];return _0x252830;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ebd('0x0'));var timeout=require(_0x4ebd('0x1'));var express=require(_0x4ebd('0x2'));var router=express['Router']();var auth=require(_0x4ebd('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0x4ebd('0x4')]('/',auth[_0x4ebd('0x5')](),controller['index']);router['get'](_0x4ebd('0x6'),auth[_0x4ebd('0x5')](),controller[_0x4ebd('0x7')]);router[_0x4ebd('0x4')](_0x4ebd('0x8'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x4ebd('0x4')](_0x4ebd('0x9'),auth[_0x4ebd('0x5')](),controller['getAnyConditions']);router[_0x4ebd('0x4')]('/:id/actions',auth[_0x4ebd('0x5')](),controller['getActions']);router['post']('/',auth[_0x4ebd('0x5')](),controller[_0x4ebd('0xa')]);router[_0x4ebd('0xb')](_0x4ebd('0x8'),auth[_0x4ebd('0x5')](),controller[_0x4ebd('0xc')]);router[_0x4ebd('0xb')](_0x4ebd('0x9'),auth[_0x4ebd('0x5')](),controller[_0x4ebd('0xd')]);router['post'](_0x4ebd('0xe'),auth[_0x4ebd('0x5')](),controller[_0x4ebd('0xf')]);router[_0x4ebd('0x10')](_0x4ebd('0x6'),auth[_0x4ebd('0x5')](),controller[_0x4ebd('0x11')]);router[_0x4ebd('0x12')](_0x4ebd('0x6'),auth[_0x4ebd('0x5')](),controller[_0x4ebd('0x13')]);module[_0x4ebd('0x14')]=router; \ No newline at end of file +var _0xb6d6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','getAllConditions','getAnyConditions','getActions','create','post','/:id/all_conditions','/:id/any_conditions','addAnyCondition','/:id/actions','addAction','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb6d6,0x100));var _0x6b6d=function(_0x3e59cb,_0x2eb01d){_0x3e59cb=_0x3e59cb-0x0;var _0x3f435e=_0xb6d6[_0x3e59cb];return _0x3f435e;};'use strict';var multer=require(_0x6b6d('0x0'));var util=require(_0x6b6d('0x1'));var path=require('path');var timeout=require(_0x6b6d('0x2'));var express=require(_0x6b6d('0x3'));var router=express[_0x6b6d('0x4')]();var auth=require(_0x6b6d('0x5'));var interaction=require(_0x6b6d('0x6'));var config=require(_0x6b6d('0x7'));var controller=require(_0x6b6d('0x8'));router[_0x6b6d('0x9')]('/',auth[_0x6b6d('0xa')](),controller[_0x6b6d('0xb')]);router[_0x6b6d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b6d('0xc')]);router[_0x6b6d('0x9')]('/:id/all_conditions',auth[_0x6b6d('0xa')](),controller[_0x6b6d('0xd')]);router[_0x6b6d('0x9')]('/:id/any_conditions',auth[_0x6b6d('0xa')](),controller[_0x6b6d('0xe')]);router[_0x6b6d('0x9')]('/:id/actions',auth[_0x6b6d('0xa')](),controller[_0x6b6d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6b6d('0x10')]);router[_0x6b6d('0x11')](_0x6b6d('0x12'),auth[_0x6b6d('0xa')](),controller['addAllCondition']);router[_0x6b6d('0x11')](_0x6b6d('0x13'),auth[_0x6b6d('0xa')](),controller[_0x6b6d('0x14')]);router[_0x6b6d('0x11')](_0x6b6d('0x15'),auth[_0x6b6d('0xa')](),controller[_0x6b6d('0x16')]);router[_0x6b6d('0x17')](_0x6b6d('0x18'),auth[_0x6b6d('0xa')](),controller[_0x6b6d('0x19')]);router[_0x6b6d('0x1a')](_0x6b6d('0x18'),auth[_0x6b6d('0xa')](),controller[_0x6b6d('0x1b')]);module[_0x6b6d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 1911b9d..4decdde 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 _0x8307=['STRING','BOOLEAN','sequelize'];(function(_0x479f4e,_0x5037eb){var _0x3a6c08=function(_0x30d9a7){while(--_0x30d9a7){_0x479f4e['push'](_0x479f4e['shift']());}};_0x3a6c08(++_0x5037eb);}(_0x8307,0xaa));var _0x7830=function(_0x37d798,_0x483c95){_0x37d798=_0x37d798-0x0;var _0x402b46=_0x8307[_0x37d798];return _0x402b46;};'use strict';var Sequelize=require(_0x7830('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7830('0x1')]},'description':{'type':Sequelize[_0x7830('0x1')]},'status':{'type':Sequelize[_0x7830('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x84b0=['exports','STRING','sequelize'];(function(_0x1602dd,_0x396882){var _0x94cfbf=function(_0x2d8491){while(--_0x2d8491){_0x1602dd['push'](_0x1602dd['shift']());}};_0x94cfbf(++_0x396882);}(_0x84b0,0xe0));var _0x084b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x84b0[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0x084b('0x0'));module[_0x084b('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x084b('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 76723f6..e4ac0fb 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 _0xa842=['then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','sort','filters','where','merge','type','filter','includeAll','include','rows','catch','show','keys','options','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','pick','nolimit','getAllConditions','getAnyConditions','order','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','request-promise','moment','mustache','sox','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','apply','update'];(function(_0x16e454,_0x5ce338){var _0x48b543=function(_0x4ab597){while(--_0x4ab597){_0x16e454['push'](_0x16e454['shift']());}};_0x48b543(++_0x5ce338);}(_0xa842,0x8e));var _0x2a84=function(_0x59c040,_0x2af4f0){_0x59c040=_0x59c040-0x0;var _0x39a166=_0xa842[_0x59c040];return _0x39a166;};'use strict';var pdf=require(_0x2a84('0x0'));var emlformat=require(_0x2a84('0x1'));var rimraf=require(_0x2a84('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2a84('0x3'));var moment=require(_0x2a84('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2a84('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2a84('0x6'));var csv=require('to-csv');var ejs=require(_0x2a84('0x7'));var fs=require('fs');var _=require(_0x2a84('0x8'));var squel=require(_0x2a84('0x9'));var crypto=require('crypto');var jsforce=require(_0x2a84('0xa'));var deskjs=require(_0x2a84('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2a84('0xc'));var Papa=require('papaparse');var Redis=require(_0x2a84('0xd'));var authService=require(_0x2a84('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2a84('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a84('0x10'))(_0x2a84('0x11'));var utils=require(_0x2a84('0x12'));var config=require(_0x2a84('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c03ed,_0x511806){_0x511806=_0x511806||0xcc;return function(_0x39d74e){if(_0x39d74e){return _0x2c03ed[_0x2a84('0x14')](_0x511806);}return _0x2c03ed[_0x2a84('0x15')](_0x511806)['end']();};}function respondWithResult(_0xc8bee7,_0x509213){_0x509213=_0x509213||0xc8;return function(_0x5be1b2){if(_0x5be1b2){return _0xc8bee7[_0x2a84('0x15')](_0x509213)[_0x2a84('0x16')](_0x5be1b2);}};}function respondWithFilteredResult(_0x75722f,_0x413e81){return function(_0x378ec7){if(_0x378ec7){var _0x6daeb1=_0x378ec7[_0x2a84('0x17')],_0x2ae760=_0x413e81[_0x2a84('0x18')],_0x518886=_0x413e81['offset']+_0x413e81[_0x2a84('0x19')],_0x187aaa;if(_0x518886>=_0x6daeb1){_0x518886=_0x6daeb1;_0x187aaa=0xc8;}else{_0x187aaa=0xce;}_0x75722f[_0x2a84('0x15')](_0x187aaa);return _0x75722f['set']('Content-Range',_0x2ae760+'-'+_0x518886+'/'+_0x6daeb1)[_0x2a84('0x16')](_0x378ec7);}return null;};}function patchUpdates(_0x5314b7){return function(_0x3a155e){try{jsonpatch[_0x2a84('0x1a')](_0x3a155e,_0x5314b7,!![]);}catch(_0x17546d){return BPromise['reject'](_0x17546d);}return _0x3a155e['save']();};}function saveUpdates(_0x445154,_0x5cd5fe){return function(_0x5d3353){if(_0x5d3353){return _0x5d3353[_0x2a84('0x1b')](_0x445154)[_0x2a84('0x1c')](function(_0xa0c69e){return _0xa0c69e;});}return null;};}function removeEntity(_0x2201ab,_0x2c8773){return function(_0x47dff0){if(_0x47dff0){return _0x47dff0[_0x2a84('0x1d')]()['then'](function(){var _0x3fc22b=_0x47dff0[_0x2a84('0x1e')]({'plain':!![]});var _0x3ce884='Triggers';return db[_0x2a84('0x1f')]['destroy']({'where':{'type':_0x3ce884,'resourceId':_0x3fc22b['id']}})[_0x2a84('0x1c')](function(){return _0x47dff0;});})[_0x2a84('0x1c')](function(){_0x2201ab[_0x2a84('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32cf13,_0x22caaf){return function(_0x2f34b7){if(!_0x2f34b7){_0x32cf13[_0x2a84('0x14')](0x194);}return _0x2f34b7;};}function handleError(_0x88cd14,_0x35fcd7){_0x35fcd7=_0x35fcd7||0x1f4;return function(_0x495599){logger[_0x2a84('0x20')](_0x495599[_0x2a84('0x21')]);if(_0x495599[_0x2a84('0x22')]){delete _0x495599[_0x2a84('0x22')];}_0x88cd14[_0x2a84('0x15')](_0x35fcd7)[_0x2a84('0x23')](_0x495599);};}exports[_0x2a84('0x24')]=function(_0x3c64c9,_0x4ad37d){var _0x19ff8c={},_0x392a5a={},_0x58955b={'count':0x0,'rows':[]};var _0x3668eb=_[_0x2a84('0x25')](db[_0x2a84('0x26')][_0x2a84('0x27')],function(_0x343be3){return{'name':_0x343be3[_0x2a84('0x28')],'type':_0x343be3['type'][_0x2a84('0x29')]};});_0x392a5a[_0x2a84('0x2a')]=_[_0x2a84('0x25')](_0x3668eb,_0x2a84('0x22'));_0x392a5a[_0x2a84('0x2b')]=_['keys'](_0x3c64c9[_0x2a84('0x2b')]);_0x392a5a['filters']=_[_0x2a84('0x2c')](_0x392a5a[_0x2a84('0x2a')],_0x392a5a[_0x2a84('0x2b')]);_0x19ff8c[_0x2a84('0x2d')]=_[_0x2a84('0x2c')](_0x392a5a[_0x2a84('0x2a')],qs[_0x2a84('0x2e')](_0x3c64c9[_0x2a84('0x2b')]['fields']));_0x19ff8c[_0x2a84('0x2d')]=_0x19ff8c[_0x2a84('0x2d')][_0x2a84('0x2f')]?_0x19ff8c['attributes']:_0x392a5a[_0x2a84('0x2a')];if(!_0x3c64c9[_0x2a84('0x2b')]['hasOwnProperty']('nolimit')){_0x19ff8c[_0x2a84('0x19')]=qs['limit'](_0x3c64c9['query']['limit']);_0x19ff8c[_0x2a84('0x18')]=qs[_0x2a84('0x18')](_0x3c64c9['query']['offset']);}_0x19ff8c['order']=qs[_0x2a84('0x30')](_0x3c64c9[_0x2a84('0x2b')][_0x2a84('0x30')]);_0x19ff8c['where']=qs[_0x2a84('0x31')](_['pick'](_0x3c64c9[_0x2a84('0x2b')],_0x392a5a[_0x2a84('0x31')]));if(_0x3c64c9[_0x2a84('0x2b')]['filter']){_0x19ff8c[_0x2a84('0x32')]=_[_0x2a84('0x33')](_0x19ff8c[_0x2a84('0x32')],{'$or':_[_0x2a84('0x25')](_0x3668eb,function(_0x4e1e3b){if(_0x4e1e3b[_0x2a84('0x34')]!=='VIRTUAL'){var _0x1fbd3e={};_0x1fbd3e[_0x4e1e3b['name']]={'$like':'%'+_0x3c64c9[_0x2a84('0x2b')][_0x2a84('0x35')]+'%'};return _0x1fbd3e;}})});}_0x19ff8c=_['merge']({},_0x19ff8c,_0x3c64c9['options']);var _0x22d2a7={'where':_0x19ff8c[_0x2a84('0x32')]};return db[_0x2a84('0x26')]['count'](_0x22d2a7)[_0x2a84('0x1c')](function(_0x1e31a6){_0x58955b[_0x2a84('0x17')]=_0x1e31a6;if(_0x3c64c9[_0x2a84('0x2b')][_0x2a84('0x36')]){_0x19ff8c[_0x2a84('0x37')]=[{'all':!![]}];}return db[_0x2a84('0x26')]['findAll'](_0x19ff8c);})['then'](function(_0x26cb6f){_0x58955b[_0x2a84('0x38')]=_0x26cb6f;return _0x58955b;})[_0x2a84('0x1c')](respondWithFilteredResult(_0x4ad37d,_0x19ff8c))[_0x2a84('0x39')](handleError(_0x4ad37d,null));};exports[_0x2a84('0x3a')]=function(_0x22dcff,_0x568d9b){var _0x55ec59={'raw':![],'where':{'id':_0x22dcff['params']['id']}},_0x4a3e44={};_0x4a3e44['model']=_[_0x2a84('0x3b')](db[_0x2a84('0x26')][_0x2a84('0x27')]);_0x4a3e44[_0x2a84('0x2b')]=_[_0x2a84('0x3b')](_0x22dcff[_0x2a84('0x2b')]);_0x4a3e44[_0x2a84('0x31')]=_[_0x2a84('0x2c')](_0x4a3e44['model'],_0x4a3e44[_0x2a84('0x2b')]);_0x55ec59[_0x2a84('0x2d')]=_[_0x2a84('0x2c')](_0x4a3e44[_0x2a84('0x2a')],qs[_0x2a84('0x2e')](_0x22dcff[_0x2a84('0x2b')][_0x2a84('0x2e')]));_0x55ec59['attributes']=_0x55ec59[_0x2a84('0x2d')]['length']?_0x55ec59[_0x2a84('0x2d')]:_0x4a3e44[_0x2a84('0x2a')];if(_0x22dcff[_0x2a84('0x2b')]['includeAll']){_0x55ec59[_0x2a84('0x37')]=[{'all':!![]}];}_0x55ec59=_['merge']({},_0x55ec59,_0x22dcff[_0x2a84('0x3c')]);return db[_0x2a84('0x26')][_0x2a84('0x3d')](_0x55ec59)[_0x2a84('0x1c')](handleEntityNotFound(_0x568d9b,null))[_0x2a84('0x1c')](respondWithResult(_0x568d9b,null))[_0x2a84('0x39')](handleError(_0x568d9b,null));};exports['create']=function(_0x2ad8f9,_0x4a4c05){return db[_0x2a84('0x26')][_0x2a84('0x3e')](_0x2ad8f9['body'],{})[_0x2a84('0x1c')](function(_0x447230){var _0x5b0da9=_0x2ad8f9[_0x2a84('0x3f')][_0x2a84('0x1e')]({'plain':!![]});if(!_0x5b0da9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b0da9[_0x2a84('0x40')]===_0x2a84('0x3f')){var _0x245e8b=_0x447230[_0x2a84('0x1e')]({'plain':!![]});var _0x2c1322='Triggers';return db[_0x2a84('0x41')][_0x2a84('0x3d')]({'where':{'name':_0x2c1322,'userProfileId':_0x5b0da9[_0x2a84('0x42')]},'raw':!![]})[_0x2a84('0x1c')](function(_0x2bc65f){if(_0x2bc65f&&_0x2bc65f['autoAssociation']===0x0){return db[_0x2a84('0x1f')][_0x2a84('0x3e')]({'name':_0x245e8b[_0x2a84('0x22')],'resourceId':_0x245e8b['id'],'type':_0x2bc65f['name'],'sectionId':_0x2bc65f['id']},{})[_0x2a84('0x1c')](function(){return _0x447230;});}else{return _0x447230;}})[_0x2a84('0x39')](function(_0x1a5f24){logger[_0x2a84('0x20')](_0x2a84('0x43'),_0x1a5f24);throw _0x1a5f24;});}return _0x447230;})['then'](respondWithResult(_0x4a4c05,0xc9))[_0x2a84('0x39')](handleError(_0x4a4c05,null));};exports[_0x2a84('0x1b')]=function(_0x35f8ca,_0x11726f){if(_0x35f8ca[_0x2a84('0x44')]['id']){delete _0x35f8ca[_0x2a84('0x44')]['id'];}return db[_0x2a84('0x26')][_0x2a84('0x3d')]({'where':{'id':_0x35f8ca[_0x2a84('0x45')]['id']}})[_0x2a84('0x1c')](handleEntityNotFound(_0x11726f,null))['then'](saveUpdates(_0x35f8ca[_0x2a84('0x44')],null))['then'](respondWithResult(_0x11726f,null))[_0x2a84('0x39')](handleError(_0x11726f,null));};exports['destroy']=function(_0x2faa09,_0x461a95){return db['Trigger'][_0x2a84('0x3d')]({'where':{'id':_0x2faa09[_0x2a84('0x45')]['id']}})[_0x2a84('0x1c')](handleEntityNotFound(_0x461a95,null))[_0x2a84('0x1c')](removeEntity(_0x461a95,null))[_0x2a84('0x39')](handleError(_0x461a95,null));};exports[_0x2a84('0x46')]=function(_0x53b247,_0x55899f,_0x19a890){if(_0x53b247[_0x2a84('0x44')]['id']){delete _0x53b247['body']['id'];}return db[_0x2a84('0x26')][_0x2a84('0x3d')]({'where':{'id':_0x53b247[_0x2a84('0x45')]['id']}})[_0x2a84('0x1c')](handleEntityNotFound(_0x55899f,null))[_0x2a84('0x1c')](function(_0x4c5eb4){if(_0x4c5eb4){_0x53b247[_0x2a84('0x44')][_0x2a84('0x47')]=_0x4c5eb4['id'];return db[_0x2a84('0x48')][_0x2a84('0x3e')](_0x53b247[_0x2a84('0x44')]);}})[_0x2a84('0x1c')](respondWithResult(_0x55899f,null))[_0x2a84('0x39')](handleError(_0x55899f,null));};exports[_0x2a84('0x49')]=function(_0x489601,_0x59fcdd,_0x513696){if(_0x489601[_0x2a84('0x44')]['id']){delete _0x489601[_0x2a84('0x44')]['id'];}return db[_0x2a84('0x26')][_0x2a84('0x3d')]({'where':{'id':_0x489601[_0x2a84('0x45')]['id']}})[_0x2a84('0x1c')](handleEntityNotFound(_0x59fcdd,null))[_0x2a84('0x1c')](function(_0x5cd79b){if(_0x5cd79b){_0x489601[_0x2a84('0x44')][_0x2a84('0x4a')]=_0x5cd79b['id'];return db[_0x2a84('0x48')][_0x2a84('0x3e')](_0x489601[_0x2a84('0x44')]);}})['then'](respondWithResult(_0x59fcdd,null))[_0x2a84('0x39')](handleError(_0x59fcdd,null));};exports['getAllConditions']=function(_0x2ec665,_0x24649c,_0x9532d7){var _0x3c15b6={};var _0x9335cb={};var _0x4f1f4f;var _0xcdbb88;return db[_0x2a84('0x26')][_0x2a84('0x4b')]({'where':{'id':_0x2ec665[_0x2a84('0x45')]['id']}})[_0x2a84('0x1c')](handleEntityNotFound(_0x24649c,null))[_0x2a84('0x1c')](function(_0x49e6e8){if(_0x49e6e8){_0x4f1f4f=_0x49e6e8;_0x9335cb[_0x2a84('0x2a')]=_[_0x2a84('0x3b')](db[_0x2a84('0x48')][_0x2a84('0x27')]);_0x9335cb[_0x2a84('0x2b')]=_[_0x2a84('0x3b')](_0x2ec665[_0x2a84('0x2b')]);_0x9335cb['filters']=_[_0x2a84('0x2c')](_0x9335cb[_0x2a84('0x2a')],_0x9335cb[_0x2a84('0x2b')]);_0x3c15b6[_0x2a84('0x2d')]=_[_0x2a84('0x2c')](_0x9335cb[_0x2a84('0x2a')],qs[_0x2a84('0x2e')](_0x2ec665[_0x2a84('0x2b')]['fields']));_0x3c15b6['attributes']=_0x3c15b6[_0x2a84('0x2d')][_0x2a84('0x2f')]?_0x3c15b6['attributes']:_0x9335cb['model'];_0x3c15b6['order']=qs['sort'](_0x2ec665[_0x2a84('0x2b')]['sort']);_0x3c15b6[_0x2a84('0x32')]=qs['filters'](_[_0x2a84('0x4c')](_0x2ec665[_0x2a84('0x2b')],_0x9335cb[_0x2a84('0x31')]));if(_0x2ec665[_0x2a84('0x2b')]['filter']){_0x3c15b6[_0x2a84('0x32')]=_['merge'](_0x3c15b6[_0x2a84('0x32')],{'$or':_['map'](_0x3c15b6[_0x2a84('0x2d')],function(_0x261fe8){var _0x89b97b={};_0x89b97b[_0x261fe8]={'$like':'%'+_0x2ec665[_0x2a84('0x2b')]['filter']+'%'};return _0x89b97b;})});}_0x3c15b6=_[_0x2a84('0x33')]({},_0x3c15b6,_0x2ec665[_0x2a84('0x3c')]);return _0x4f1f4f['getAllConditions'](_0x3c15b6);}})['then'](function(_0x178313){if(_0x178313){_0xcdbb88=_0x178313[_0x2a84('0x2f')];if(!_0x2ec665[_0x2a84('0x2b')]['hasOwnProperty'](_0x2a84('0x4d'))){_0x3c15b6[_0x2a84('0x19')]=qs['limit'](_0x2ec665['query']['limit']);_0x3c15b6[_0x2a84('0x18')]=qs[_0x2a84('0x18')](_0x2ec665[_0x2a84('0x2b')][_0x2a84('0x18')]);}return _0x4f1f4f[_0x2a84('0x4e')](_0x3c15b6);}})[_0x2a84('0x1c')](function(_0x42111b){if(_0x42111b){return _0x42111b?{'count':_0xcdbb88,'rows':_0x42111b}:null;}})[_0x2a84('0x1c')](respondWithResult(_0x24649c,null))['catch'](handleError(_0x24649c,null));};exports[_0x2a84('0x4f')]=function(_0x189336,_0x28f634,_0x2fad31){var _0x12a218={};var _0x54b3a1={};var _0x1995ae;var _0x563c62;return db['Trigger'][_0x2a84('0x4b')]({'where':{'id':_0x189336['params']['id']}})[_0x2a84('0x1c')](handleEntityNotFound(_0x28f634,null))['then'](function(_0xa95b7e){if(_0xa95b7e){_0x1995ae=_0xa95b7e;_0x54b3a1[_0x2a84('0x2a')]=_[_0x2a84('0x3b')](db[_0x2a84('0x48')]['rawAttributes']);_0x54b3a1[_0x2a84('0x2b')]=_[_0x2a84('0x3b')](_0x189336[_0x2a84('0x2b')]);_0x54b3a1['filters']=_[_0x2a84('0x2c')](_0x54b3a1['model'],_0x54b3a1['query']);_0x12a218[_0x2a84('0x2d')]=_['intersection'](_0x54b3a1['model'],qs[_0x2a84('0x2e')](_0x189336[_0x2a84('0x2b')][_0x2a84('0x2e')]));_0x12a218[_0x2a84('0x2d')]=_0x12a218['attributes']['length']?_0x12a218[_0x2a84('0x2d')]:_0x54b3a1[_0x2a84('0x2a')];_0x12a218[_0x2a84('0x50')]=qs[_0x2a84('0x30')](_0x189336[_0x2a84('0x2b')]['sort']);_0x12a218[_0x2a84('0x32')]=qs['filters'](_[_0x2a84('0x4c')](_0x189336[_0x2a84('0x2b')],_0x54b3a1[_0x2a84('0x31')]));if(_0x189336[_0x2a84('0x2b')][_0x2a84('0x35')]){_0x12a218['where']=_[_0x2a84('0x33')](_0x12a218[_0x2a84('0x32')],{'$or':_[_0x2a84('0x25')](_0x12a218[_0x2a84('0x2d')],function(_0x863c68){var _0x215e82={};_0x215e82[_0x863c68]={'$like':'%'+_0x189336[_0x2a84('0x2b')][_0x2a84('0x35')]+'%'};return _0x215e82;})});}_0x12a218=_['merge']({},_0x12a218,_0x189336[_0x2a84('0x3c')]);return _0x1995ae['getAnyConditions'](_0x12a218);}})[_0x2a84('0x1c')](function(_0x4393a9){if(_0x4393a9){_0x563c62=_0x4393a9['length'];if(!_0x189336[_0x2a84('0x2b')]['hasOwnProperty'](_0x2a84('0x4d'))){_0x12a218[_0x2a84('0x19')]=qs['limit'](_0x189336[_0x2a84('0x2b')]['limit']);_0x12a218[_0x2a84('0x18')]=qs[_0x2a84('0x18')](_0x189336['query']['offset']);}return _0x1995ae['getAnyConditions'](_0x12a218);}})['then'](function(_0x9b86f9){if(_0x9b86f9){return _0x9b86f9?{'count':_0x563c62,'rows':_0x9b86f9}:null;}})['then'](respondWithResult(_0x28f634,null))[_0x2a84('0x39')](handleError(_0x28f634,null));};exports[_0x2a84('0x51')]=function(_0x5ca154,_0x3f75c5,_0x52b0e3){if(_0x5ca154[_0x2a84('0x44')]['id']){delete _0x5ca154['body']['id'];}return db[_0x2a84('0x26')][_0x2a84('0x3d')]({'where':{'id':_0x5ca154[_0x2a84('0x45')]['id']}})[_0x2a84('0x1c')](handleEntityNotFound(_0x3f75c5,null))[_0x2a84('0x1c')](function(_0x50a7d5){if(_0x50a7d5){_0x5ca154[_0x2a84('0x44')][_0x2a84('0x52')]=_0x50a7d5['id'];return db[_0x2a84('0x53')][_0x2a84('0x3e')](_0x5ca154[_0x2a84('0x44')]);}})[_0x2a84('0x1c')](respondWithResult(_0x3f75c5,null))[_0x2a84('0x39')](handleError(_0x3f75c5,null));};exports[_0x2a84('0x54')]=function(_0x46f9bf,_0x3cc44b,_0x161003){var _0x4cb3cc={};var _0x4234a4={};var _0x1725e0;var _0x59b594;return db[_0x2a84('0x26')][_0x2a84('0x4b')]({'where':{'id':_0x46f9bf['params']['id']}})[_0x2a84('0x1c')](handleEntityNotFound(_0x3cc44b,null))[_0x2a84('0x1c')](function(_0x55a674){if(_0x55a674){_0x1725e0=_0x55a674;_0x4234a4[_0x2a84('0x2a')]=_['keys'](db[_0x2a84('0x53')][_0x2a84('0x27')]);_0x4234a4[_0x2a84('0x2b')]=_[_0x2a84('0x3b')](_0x46f9bf[_0x2a84('0x2b')]);_0x4234a4[_0x2a84('0x31')]=_[_0x2a84('0x2c')](_0x4234a4[_0x2a84('0x2a')],_0x4234a4[_0x2a84('0x2b')]);_0x4cb3cc[_0x2a84('0x2d')]=_['intersection'](_0x4234a4['model'],qs[_0x2a84('0x2e')](_0x46f9bf[_0x2a84('0x2b')][_0x2a84('0x2e')]));_0x4cb3cc[_0x2a84('0x2d')]=_0x4cb3cc[_0x2a84('0x2d')]['length']?_0x4cb3cc[_0x2a84('0x2d')]:_0x4234a4['model'];_0x4cb3cc[_0x2a84('0x50')]=qs[_0x2a84('0x30')](_0x46f9bf[_0x2a84('0x2b')][_0x2a84('0x30')]);_0x4cb3cc[_0x2a84('0x32')]=qs[_0x2a84('0x31')](_[_0x2a84('0x4c')](_0x46f9bf[_0x2a84('0x2b')],_0x4234a4['filters']));if(_0x46f9bf[_0x2a84('0x2b')][_0x2a84('0x35')]){_0x4cb3cc[_0x2a84('0x32')]=_[_0x2a84('0x33')](_0x4cb3cc['where'],{'$or':_['map'](_0x4cb3cc[_0x2a84('0x2d')],function(_0xec2682){var _0x10e567={};_0x10e567[_0xec2682]={'$like':'%'+_0x46f9bf[_0x2a84('0x2b')][_0x2a84('0x35')]+'%'};return _0x10e567;})});}_0x4cb3cc=_[_0x2a84('0x33')]({},_0x4cb3cc,_0x46f9bf[_0x2a84('0x3c')]);return _0x1725e0['getActions'](_0x4cb3cc);}})[_0x2a84('0x1c')](function(_0x24657a){if(_0x24657a){_0x59b594=_0x24657a['length'];if(!_0x46f9bf[_0x2a84('0x2b')]['hasOwnProperty']('nolimit')){_0x4cb3cc[_0x2a84('0x19')]=qs[_0x2a84('0x19')](_0x46f9bf[_0x2a84('0x2b')][_0x2a84('0x19')]);_0x4cb3cc[_0x2a84('0x18')]=qs[_0x2a84('0x18')](_0x46f9bf[_0x2a84('0x2b')][_0x2a84('0x18')]);}return _0x1725e0[_0x2a84('0x54')](_0x4cb3cc);}})['then'](function(_0x46bb39){if(_0x46bb39){return _0x46bb39?{'count':_0x59b594,'rows':_0x46bb39}:null;}})[_0x2a84('0x1c')](respondWithResult(_0x3cc44b,null))[_0x2a84('0x39')](handleError(_0x3cc44b,null));}; \ No newline at end of file +var _0x45c6=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','order','addAction','TriggerId','Action','getActions','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Triggers','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0xe8c12d,_0x4f8209){var _0x5defef=function(_0x1b62c0){while(--_0x1b62c0){_0xe8c12d['push'](_0xe8c12d['shift']());}};_0x5defef(++_0x4f8209);}(_0x45c6,0x74));var _0x645c=function(_0x3efd01,_0x4beea2){_0x3efd01=_0x3efd01-0x0;var _0x3ef038=_0x45c6[_0x3efd01];return _0x3ef038;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x645c('0x0'));var rimraf=require(_0x645c('0x1'));var zipdir=require(_0x645c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x645c('0x3'));var moment=require(_0x645c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x645c('0x5'));var util=require(_0x645c('0x6'));var path=require(_0x645c('0x7'));var sox=require(_0x645c('0x8'));var csv=require('to-csv');var ejs=require(_0x645c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x645c('0xa'));var jsforce=require(_0x645c('0xb'));var deskjs=require(_0x645c('0xc'));var toCsv=require(_0x645c('0xd'));var querystring=require(_0x645c('0xe'));var Papa=require(_0x645c('0xf'));var Redis=require(_0x645c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x645c('0x11'));var as=require(_0x645c('0x12'));var hardwareService=require(_0x645c('0x13'));var logger=require('../../config/logger')(_0x645c('0x14'));var utils=require(_0x645c('0x15'));var config=require(_0x645c('0x16'));var db=require(_0x645c('0x17'))['db'];function respondWithStatusCode(_0x42c0a9,_0x5a7597){_0x5a7597=_0x5a7597||0xcc;return function(_0x182114){if(_0x182114){return _0x42c0a9[_0x645c('0x18')](_0x5a7597);}return _0x42c0a9[_0x645c('0x19')](_0x5a7597)[_0x645c('0x1a')]();};}function respondWithResult(_0x3aada4,_0x5ca5ca){_0x5ca5ca=_0x5ca5ca||0xc8;return function(_0x4eb3fe){if(_0x4eb3fe){return _0x3aada4['status'](_0x5ca5ca)[_0x645c('0x1b')](_0x4eb3fe);}};}function respondWithFilteredResult(_0x1c2dbd,_0x2a46ad){return function(_0xa5aedb){if(_0xa5aedb){var _0x37eef0=_0xa5aedb[_0x645c('0x1c')],_0x29060d=_0x2a46ad[_0x645c('0x1d')],_0x1dff66=_0x2a46ad[_0x645c('0x1d')]+_0x2a46ad[_0x645c('0x1e')],_0x275e1e;if(_0x1dff66>=_0x37eef0){_0x1dff66=_0x37eef0;_0x275e1e=0xc8;}else{_0x275e1e=0xce;}_0x1c2dbd[_0x645c('0x19')](_0x275e1e);return _0x1c2dbd[_0x645c('0x1f')](_0x645c('0x20'),_0x29060d+'-'+_0x1dff66+'/'+_0x37eef0)[_0x645c('0x1b')](_0xa5aedb);}return null;};}function patchUpdates(_0x505428){return function(_0x597c7a){try{jsonpatch[_0x645c('0x21')](_0x597c7a,_0x505428,!![]);}catch(_0x2143c8){return BPromise[_0x645c('0x22')](_0x2143c8);}return _0x597c7a[_0x645c('0x23')]();};}function saveUpdates(_0x3f093d,_0x293e92){return function(_0x3baa9b){if(_0x3baa9b){return _0x3baa9b[_0x645c('0x24')](_0x3f093d)['then'](function(_0xe09169){return _0xe09169;});}return null;};}function removeEntity(_0x526e8e,_0x2148a7){return function(_0x1fb241){if(_0x1fb241){return _0x1fb241[_0x645c('0x25')]()[_0x645c('0x26')](function(){var _0xf79ec9=_0x1fb241[_0x645c('0x27')]({'plain':!![]});var _0x4419aa=_0x645c('0x28');return db['UserProfileResource'][_0x645c('0x25')]({'where':{'type':_0x4419aa,'resourceId':_0xf79ec9['id']}})[_0x645c('0x26')](function(){return _0x1fb241;});})[_0x645c('0x26')](function(){_0x526e8e['status'](0xcc)[_0x645c('0x1a')]();});}};}function handleEntityNotFound(_0x48c7ea,_0x50d2ff){return function(_0x51672d){if(!_0x51672d){_0x48c7ea[_0x645c('0x18')](0x194);}return _0x51672d;};}function handleError(_0x1980b5,_0x3c4485){_0x3c4485=_0x3c4485||0x1f4;return function(_0x52633c){logger[_0x645c('0x29')](_0x52633c[_0x645c('0x2a')]);if(_0x52633c[_0x645c('0x2b')]){delete _0x52633c['name'];}_0x1980b5['status'](_0x3c4485)[_0x645c('0x2c')](_0x52633c);};}exports[_0x645c('0x2d')]=function(_0x468da7,_0x266152){var _0x47c630={},_0x539130={},_0x277ddf={'count':0x0,'rows':[]};var _0x1c609c=_[_0x645c('0x2e')](db[_0x645c('0x2f')][_0x645c('0x30')],function(_0x27e387){return{'name':_0x27e387[_0x645c('0x31')],'type':_0x27e387[_0x645c('0x32')][_0x645c('0x33')]};});_0x539130[_0x645c('0x34')]=_[_0x645c('0x2e')](_0x1c609c,_0x645c('0x2b'));_0x539130['query']=_[_0x645c('0x35')](_0x468da7[_0x645c('0x36')]);_0x539130[_0x645c('0x37')]=_[_0x645c('0x38')](_0x539130[_0x645c('0x34')],_0x539130['query']);_0x47c630[_0x645c('0x39')]=_[_0x645c('0x38')](_0x539130[_0x645c('0x34')],qs[_0x645c('0x3a')](_0x468da7['query'][_0x645c('0x3a')]));_0x47c630[_0x645c('0x39')]=_0x47c630[_0x645c('0x39')]['length']?_0x47c630['attributes']:_0x539130[_0x645c('0x34')];if(!_0x468da7['query'][_0x645c('0x3b')]('nolimit')){_0x47c630[_0x645c('0x1e')]=qs[_0x645c('0x1e')](_0x468da7[_0x645c('0x36')][_0x645c('0x1e')]);_0x47c630['offset']=qs[_0x645c('0x1d')](_0x468da7['query']['offset']);}_0x47c630['order']=qs[_0x645c('0x3c')](_0x468da7[_0x645c('0x36')][_0x645c('0x3c')]);_0x47c630['where']=qs[_0x645c('0x37')](_[_0x645c('0x3d')](_0x468da7['query'],_0x539130[_0x645c('0x37')]));if(_0x468da7['query'][_0x645c('0x3e')]){_0x47c630[_0x645c('0x3f')]=_[_0x645c('0x40')](_0x47c630[_0x645c('0x3f')],{'$or':_[_0x645c('0x2e')](_0x1c609c,function(_0x524172){if(_0x524172[_0x645c('0x32')]!==_0x645c('0x41')){var _0x4ba5f4={};_0x4ba5f4[_0x524172[_0x645c('0x2b')]]={'$like':'%'+_0x468da7[_0x645c('0x36')]['filter']+'%'};return _0x4ba5f4;}})});}_0x47c630=_[_0x645c('0x40')]({},_0x47c630,_0x468da7[_0x645c('0x42')]);var _0x45a708={'where':_0x47c630[_0x645c('0x3f')]};return db[_0x645c('0x2f')][_0x645c('0x1c')](_0x45a708)[_0x645c('0x26')](function(_0x4add83){_0x277ddf[_0x645c('0x1c')]=_0x4add83;if(_0x468da7[_0x645c('0x36')][_0x645c('0x43')]){_0x47c630[_0x645c('0x44')]=[{'all':!![]}];}return db[_0x645c('0x2f')][_0x645c('0x45')](_0x47c630);})[_0x645c('0x26')](function(_0x2143de){_0x277ddf[_0x645c('0x46')]=_0x2143de;return _0x277ddf;})[_0x645c('0x26')](respondWithFilteredResult(_0x266152,_0x47c630))[_0x645c('0x47')](handleError(_0x266152,null));};exports[_0x645c('0x48')]=function(_0x14768a,_0x430741){var _0x3c1f04={'raw':![],'where':{'id':_0x14768a[_0x645c('0x49')]['id']}},_0x355969={};_0x355969[_0x645c('0x34')]=_[_0x645c('0x35')](db[_0x645c('0x2f')][_0x645c('0x30')]);_0x355969['query']=_[_0x645c('0x35')](_0x14768a[_0x645c('0x36')]);_0x355969['filters']=_[_0x645c('0x38')](_0x355969[_0x645c('0x34')],_0x355969['query']);_0x3c1f04[_0x645c('0x39')]=_[_0x645c('0x38')](_0x355969[_0x645c('0x34')],qs[_0x645c('0x3a')](_0x14768a['query'][_0x645c('0x3a')]));_0x3c1f04[_0x645c('0x39')]=_0x3c1f04[_0x645c('0x39')][_0x645c('0x4a')]?_0x3c1f04[_0x645c('0x39')]:_0x355969['model'];if(_0x14768a[_0x645c('0x36')][_0x645c('0x43')]){_0x3c1f04['include']=[{'all':!![]}];}_0x3c1f04=_[_0x645c('0x40')]({},_0x3c1f04,_0x14768a['options']);return db[_0x645c('0x2f')][_0x645c('0x4b')](_0x3c1f04)[_0x645c('0x26')](handleEntityNotFound(_0x430741,null))['then'](respondWithResult(_0x430741,null))[_0x645c('0x47')](handleError(_0x430741,null));};exports[_0x645c('0x4c')]=function(_0x4a745d,_0x2f5f0b){return db[_0x645c('0x2f')][_0x645c('0x4c')](_0x4a745d[_0x645c('0x4d')],{})[_0x645c('0x26')](function(_0x250af9){var _0xaba3b5=_0x4a745d[_0x645c('0x4e')][_0x645c('0x27')]({'plain':!![]});if(!_0xaba3b5)throw new Error(_0x645c('0x4f'));if(_0xaba3b5[_0x645c('0x50')]===_0x645c('0x4e')){var _0xb95ee5=_0x250af9[_0x645c('0x27')]({'plain':!![]});var _0x39cac7='Triggers';return db[_0x645c('0x51')]['find']({'where':{'name':_0x39cac7,'userProfileId':_0xaba3b5[_0x645c('0x52')]},'raw':!![]})[_0x645c('0x26')](function(_0x21ed77){if(_0x21ed77&&_0x21ed77[_0x645c('0x53')]===0x0){return db[_0x645c('0x54')][_0x645c('0x4c')]({'name':_0xb95ee5[_0x645c('0x2b')],'resourceId':_0xb95ee5['id'],'type':_0x21ed77[_0x645c('0x2b')],'sectionId':_0x21ed77['id']},{})['then'](function(){return _0x250af9;});}else{return _0x250af9;}})[_0x645c('0x47')](function(_0xf200b2){logger[_0x645c('0x29')](_0x645c('0x55'),_0xf200b2);throw _0xf200b2;});}return _0x250af9;})[_0x645c('0x26')](respondWithResult(_0x2f5f0b,0xc9))['catch'](handleError(_0x2f5f0b,null));};exports[_0x645c('0x24')]=function(_0x345910,_0x6881d7){if(_0x345910[_0x645c('0x4d')]['id']){delete _0x345910['body']['id'];}return db[_0x645c('0x2f')]['find']({'where':{'id':_0x345910['params']['id']}})['then'](handleEntityNotFound(_0x6881d7,null))[_0x645c('0x26')](saveUpdates(_0x345910[_0x645c('0x4d')],null))[_0x645c('0x26')](respondWithResult(_0x6881d7,null))['catch'](handleError(_0x6881d7,null));};exports[_0x645c('0x25')]=function(_0x4b8063,_0x3097ce){return db['Trigger'][_0x645c('0x4b')]({'where':{'id':_0x4b8063['params']['id']}})[_0x645c('0x26')](handleEntityNotFound(_0x3097ce,null))[_0x645c('0x26')](removeEntity(_0x3097ce,null))[_0x645c('0x47')](handleError(_0x3097ce,null));};exports[_0x645c('0x56')]=function(_0x29fc5d,_0x27eda3,_0x57ef31){if(_0x29fc5d[_0x645c('0x4d')]['id']){delete _0x29fc5d['body']['id'];}return db[_0x645c('0x2f')][_0x645c('0x4b')]({'where':{'id':_0x29fc5d[_0x645c('0x49')]['id']}})['then'](handleEntityNotFound(_0x27eda3,null))[_0x645c('0x26')](function(_0x51c564){if(_0x51c564){_0x29fc5d[_0x645c('0x4d')][_0x645c('0x57')]=_0x51c564['id'];return db[_0x645c('0x58')]['create'](_0x29fc5d[_0x645c('0x4d')]);}})[_0x645c('0x26')](respondWithResult(_0x27eda3,null))['catch'](handleError(_0x27eda3,null));};exports[_0x645c('0x59')]=function(_0x599400,_0x5e5515,_0x505516){if(_0x599400[_0x645c('0x4d')]['id']){delete _0x599400[_0x645c('0x4d')]['id'];}return db['Trigger'][_0x645c('0x4b')]({'where':{'id':_0x599400[_0x645c('0x49')]['id']}})[_0x645c('0x26')](handleEntityNotFound(_0x5e5515,null))['then'](function(_0x55c4a2){if(_0x55c4a2){_0x599400['body'][_0x645c('0x5a')]=_0x55c4a2['id'];return db[_0x645c('0x58')][_0x645c('0x4c')](_0x599400[_0x645c('0x4d')]);}})['then'](respondWithResult(_0x5e5515,null))[_0x645c('0x47')](handleError(_0x5e5515,null));};exports[_0x645c('0x5b')]=function(_0x39716b,_0x35c4cd,_0x4cf52f){var _0x1e86c7={};var _0x733dd3={};var _0x23b43f;var _0x300ed6;return db[_0x645c('0x2f')][_0x645c('0x5c')]({'where':{'id':_0x39716b[_0x645c('0x49')]['id']}})['then'](handleEntityNotFound(_0x35c4cd,null))[_0x645c('0x26')](function(_0x4e12b6){if(_0x4e12b6){_0x23b43f=_0x4e12b6;_0x733dd3[_0x645c('0x34')]=_[_0x645c('0x35')](db[_0x645c('0x58')][_0x645c('0x30')]);_0x733dd3[_0x645c('0x36')]=_['keys'](_0x39716b[_0x645c('0x36')]);_0x733dd3['filters']=_[_0x645c('0x38')](_0x733dd3[_0x645c('0x34')],_0x733dd3[_0x645c('0x36')]);_0x1e86c7[_0x645c('0x39')]=_[_0x645c('0x38')](_0x733dd3[_0x645c('0x34')],qs[_0x645c('0x3a')](_0x39716b['query'][_0x645c('0x3a')]));_0x1e86c7['attributes']=_0x1e86c7[_0x645c('0x39')]['length']?_0x1e86c7[_0x645c('0x39')]:_0x733dd3['model'];_0x1e86c7['order']=qs[_0x645c('0x3c')](_0x39716b[_0x645c('0x36')][_0x645c('0x3c')]);_0x1e86c7[_0x645c('0x3f')]=qs[_0x645c('0x37')](_['pick'](_0x39716b[_0x645c('0x36')],_0x733dd3['filters']));if(_0x39716b[_0x645c('0x36')]['filter']){_0x1e86c7[_0x645c('0x3f')]=_[_0x645c('0x40')](_0x1e86c7[_0x645c('0x3f')],{'$or':_['map'](_0x1e86c7['attributes'],function(_0x3bea75){var _0x2452f2={};_0x2452f2[_0x3bea75]={'$like':'%'+_0x39716b[_0x645c('0x36')][_0x645c('0x3e')]+'%'};return _0x2452f2;})});}_0x1e86c7=_[_0x645c('0x40')]({},_0x1e86c7,_0x39716b[_0x645c('0x42')]);return _0x23b43f[_0x645c('0x5b')](_0x1e86c7);}})[_0x645c('0x26')](function(_0x15bd6e){if(_0x15bd6e){_0x300ed6=_0x15bd6e['length'];if(!_0x39716b['query']['hasOwnProperty']('nolimit')){_0x1e86c7[_0x645c('0x1e')]=qs[_0x645c('0x1e')](_0x39716b[_0x645c('0x36')][_0x645c('0x1e')]);_0x1e86c7[_0x645c('0x1d')]=qs[_0x645c('0x1d')](_0x39716b['query'][_0x645c('0x1d')]);}return _0x23b43f[_0x645c('0x5b')](_0x1e86c7);}})['then'](function(_0x3a66fb){if(_0x3a66fb){return _0x3a66fb?{'count':_0x300ed6,'rows':_0x3a66fb}:null;}})[_0x645c('0x26')](respondWithResult(_0x35c4cd,null))[_0x645c('0x47')](handleError(_0x35c4cd,null));};exports[_0x645c('0x5d')]=function(_0x59dda4,_0x9c4bd5,_0x26ddd9){var _0x2c30a1={};var _0x35ca46={};var _0x5803e7;var _0x2a6ce6;return db[_0x645c('0x2f')]['findOne']({'where':{'id':_0x59dda4[_0x645c('0x49')]['id']}})[_0x645c('0x26')](handleEntityNotFound(_0x9c4bd5,null))[_0x645c('0x26')](function(_0x2383c2){if(_0x2383c2){_0x5803e7=_0x2383c2;_0x35ca46[_0x645c('0x34')]=_['keys'](db[_0x645c('0x58')]['rawAttributes']);_0x35ca46[_0x645c('0x36')]=_['keys'](_0x59dda4[_0x645c('0x36')]);_0x35ca46[_0x645c('0x37')]=_[_0x645c('0x38')](_0x35ca46[_0x645c('0x34')],_0x35ca46['query']);_0x2c30a1[_0x645c('0x39')]=_['intersection'](_0x35ca46['model'],qs[_0x645c('0x3a')](_0x59dda4[_0x645c('0x36')][_0x645c('0x3a')]));_0x2c30a1[_0x645c('0x39')]=_0x2c30a1[_0x645c('0x39')]['length']?_0x2c30a1['attributes']:_0x35ca46[_0x645c('0x34')];_0x2c30a1[_0x645c('0x5e')]=qs[_0x645c('0x3c')](_0x59dda4[_0x645c('0x36')][_0x645c('0x3c')]);_0x2c30a1[_0x645c('0x3f')]=qs[_0x645c('0x37')](_[_0x645c('0x3d')](_0x59dda4[_0x645c('0x36')],_0x35ca46['filters']));if(_0x59dda4['query']['filter']){_0x2c30a1['where']=_[_0x645c('0x40')](_0x2c30a1[_0x645c('0x3f')],{'$or':_[_0x645c('0x2e')](_0x2c30a1[_0x645c('0x39')],function(_0x415e8b){var _0x52eec7={};_0x52eec7[_0x415e8b]={'$like':'%'+_0x59dda4[_0x645c('0x36')][_0x645c('0x3e')]+'%'};return _0x52eec7;})});}_0x2c30a1=_[_0x645c('0x40')]({},_0x2c30a1,_0x59dda4[_0x645c('0x42')]);return _0x5803e7[_0x645c('0x5d')](_0x2c30a1);}})[_0x645c('0x26')](function(_0x4dc47a){if(_0x4dc47a){_0x2a6ce6=_0x4dc47a[_0x645c('0x4a')];if(!_0x59dda4['query'][_0x645c('0x3b')]('nolimit')){_0x2c30a1[_0x645c('0x1e')]=qs['limit'](_0x59dda4[_0x645c('0x36')][_0x645c('0x1e')]);_0x2c30a1[_0x645c('0x1d')]=qs[_0x645c('0x1d')](_0x59dda4[_0x645c('0x36')]['offset']);}return _0x5803e7['getAnyConditions'](_0x2c30a1);}})[_0x645c('0x26')](function(_0x10a183){if(_0x10a183){return _0x10a183?{'count':_0x2a6ce6,'rows':_0x10a183}:null;}})[_0x645c('0x26')](respondWithResult(_0x9c4bd5,null))['catch'](handleError(_0x9c4bd5,null));};exports[_0x645c('0x5f')]=function(_0x57a92a,_0x38522a,_0x309468){if(_0x57a92a[_0x645c('0x4d')]['id']){delete _0x57a92a[_0x645c('0x4d')]['id'];}return db['Trigger']['find']({'where':{'id':_0x57a92a[_0x645c('0x49')]['id']}})[_0x645c('0x26')](handleEntityNotFound(_0x38522a,null))[_0x645c('0x26')](function(_0x27fa43){if(_0x27fa43){_0x57a92a['body'][_0x645c('0x60')]=_0x27fa43['id'];return db[_0x645c('0x61')][_0x645c('0x4c')](_0x57a92a['body']);}})[_0x645c('0x26')](respondWithResult(_0x38522a,null))[_0x645c('0x47')](handleError(_0x38522a,null));};exports[_0x645c('0x62')]=function(_0x3dcdfc,_0x5cece1,_0x20da31){var _0x58a485={};var _0x40fcf8={};var _0x58f6b0;var _0x2d7a23;return db[_0x645c('0x2f')][_0x645c('0x5c')]({'where':{'id':_0x3dcdfc[_0x645c('0x49')]['id']}})[_0x645c('0x26')](handleEntityNotFound(_0x5cece1,null))[_0x645c('0x26')](function(_0x330ed3){if(_0x330ed3){_0x58f6b0=_0x330ed3;_0x40fcf8[_0x645c('0x34')]=_[_0x645c('0x35')](db[_0x645c('0x61')][_0x645c('0x30')]);_0x40fcf8['query']=_['keys'](_0x3dcdfc['query']);_0x40fcf8[_0x645c('0x37')]=_['intersection'](_0x40fcf8['model'],_0x40fcf8[_0x645c('0x36')]);_0x58a485[_0x645c('0x39')]=_[_0x645c('0x38')](_0x40fcf8[_0x645c('0x34')],qs[_0x645c('0x3a')](_0x3dcdfc[_0x645c('0x36')][_0x645c('0x3a')]));_0x58a485['attributes']=_0x58a485[_0x645c('0x39')]['length']?_0x58a485[_0x645c('0x39')]:_0x40fcf8[_0x645c('0x34')];_0x58a485['order']=qs['sort'](_0x3dcdfc[_0x645c('0x36')][_0x645c('0x3c')]);_0x58a485[_0x645c('0x3f')]=qs['filters'](_[_0x645c('0x3d')](_0x3dcdfc[_0x645c('0x36')],_0x40fcf8[_0x645c('0x37')]));if(_0x3dcdfc[_0x645c('0x36')][_0x645c('0x3e')]){_0x58a485['where']=_[_0x645c('0x40')](_0x58a485['where'],{'$or':_[_0x645c('0x2e')](_0x58a485[_0x645c('0x39')],function(_0xe7ca1f){var _0x552451={};_0x552451[_0xe7ca1f]={'$like':'%'+_0x3dcdfc[_0x645c('0x36')][_0x645c('0x3e')]+'%'};return _0x552451;})});}_0x58a485=_[_0x645c('0x40')]({},_0x58a485,_0x3dcdfc[_0x645c('0x42')]);return _0x58f6b0['getActions'](_0x58a485);}})[_0x645c('0x26')](function(_0x9e1d0c){if(_0x9e1d0c){_0x2d7a23=_0x9e1d0c[_0x645c('0x4a')];if(!_0x3dcdfc[_0x645c('0x36')][_0x645c('0x3b')](_0x645c('0x63'))){_0x58a485[_0x645c('0x1e')]=qs[_0x645c('0x1e')](_0x3dcdfc[_0x645c('0x36')]['limit']);_0x58a485[_0x645c('0x1d')]=qs[_0x645c('0x1d')](_0x3dcdfc[_0x645c('0x36')][_0x645c('0x1d')]);}return _0x58f6b0[_0x645c('0x62')](_0x58a485);}})[_0x645c('0x26')](function(_0x47cb05){if(_0x47cb05){return _0x47cb05?{'count':_0x2d7a23,'rows':_0x47cb05}:null;}})['then'](respondWithResult(_0x5cece1,null))[_0x645c('0x47')](handleError(_0x5cece1,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index be15896..5a75eaf 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 _0x8a85=['path','rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2c065a,_0x44e071){var _0x16dcf0=function(_0x4ef63d){while(--_0x4ef63d){_0x2c065a['push'](_0x2c065a['shift']());}};_0x16dcf0(++_0x44e071);}(_0x8a85,0x18f));var _0x58a8=function(_0x373025,_0x128993){_0x373025=_0x373025-0x0;var _0x3c8778=_0x8a85[_0x373025];return _0x3c8778;};'use strict';var _=require(_0x58a8('0x0'));var util=require(_0x58a8('0x1'));var logger=require(_0x58a8('0x2'))(_0x58a8('0x3'));var moment=require(_0x58a8('0x4'));var BPromise=require(_0x58a8('0x5'));var rp=require(_0x58a8('0x6'));var fs=require('fs');var path=require(_0x58a8('0x7'));var rimraf=require(_0x58a8('0x8'));var config=require(_0x58a8('0x9'));var attributes=require('./trigger.attributes');module[_0x58a8('0xa')]=function(_0x5ece1d,_0x2b3591){return _0x5ece1d[_0x58a8('0xb')](_0x58a8('0xc'),attributes,{'tableName':_0x58a8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab81=['tools_triggers','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','Trigger'];(function(_0x3f2f65,_0x294aa3){var _0x566a8f=function(_0x58e7ee){while(--_0x58e7ee){_0x3f2f65['push'](_0x3f2f65['shift']());}};_0x566a8f(++_0x294aa3);}(_0xab81,0x187));var _0x1ab8=function(_0x216f50,_0x36d762){_0x216f50=_0x216f50-0x0;var _0x35b908=_0xab81[_0x216f50];return _0x35b908;};'use strict';var _=require(_0x1ab8('0x0'));var util=require('util');var logger=require(_0x1ab8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1ab8('0x2'));var rp=require(_0x1ab8('0x3'));var fs=require('fs');var path=require(_0x1ab8('0x4'));var rimraf=require(_0x1ab8('0x5'));var config=require(_0x1ab8('0x6'));var attributes=require('./trigger.attributes');module[_0x1ab8('0x7')]=function(_0x322ba6,_0x5d4dfa){return _0x322ba6['define'](_0x1ab8('0x8'),attributes,{'tableName':_0x1ab8('0x9'),'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 f84f2a1..1dfc6ec 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 _0x9354=['catch','GetTrigger','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowTrigger','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0xf02e0e,_0x4b650e){var _0x13a4e2=function(_0x376d2f){while(--_0x376d2f){_0xf02e0e['push'](_0xf02e0e['shift']());}};_0x13a4e2(++_0x4b650e);}(_0x9354,0x96));var _0x4935=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0x9354[_0x5c811c];return _0x5df3af;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var Redis=require(_0x4935('0x3'));var db=require(_0x4935('0x4'))['db'];var utils=require(_0x4935('0x5'));var logger=require('../../config/logger')(_0x4935('0x6'));var config=require(_0x4935('0x7'));var jayson=require(_0x4935('0x8'));var client=jayson[_0x4935('0x9')][_0x4935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e47bd,_0x118d36,_0x2d735e){return new BPromise(function(_0x10793e,_0x4c9902){return client[_0x4935('0xb')](_0x2e47bd,_0x2d735e)['then'](function(_0x2aac9a){logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));logger[_0x4935('0xf')](_0x4935('0x10'),_0x118d36,'request\x20sent',JSON['stringify'](_0x2aac9a));if(_0x2aac9a[_0x4935('0x11')]){if(_0x2aac9a['error']['code']===0x1f4){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x4c9902(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x10793e(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}else{logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));_0x10793e(_0x2aac9a[_0x4935('0x13')]['message']);}})[_0x4935('0x14')](function(_0x46526a){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x46526a);_0x4c9902(_0x46526a);});});}exports[_0x4935('0x15')]=function(_0x429ef3){var _0x4ebc63=this;return new Promise(function(_0xd70eff,_0x145277){return db['Trigger'][_0x4935('0x16')]({'raw':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x18')]||null:null,'attributes':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x19')]||null:null,'limit':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x1a')]||null:null,'include':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')],function(_0x53530f){return{'model':db[_0x53530f['model']],'as':_0x53530f['as'],'attributes':_0x53530f[_0x4935('0x19')],'include':_0x53530f[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x53530f[_0x4935('0x1b')],function(_0x344e51){return{'model':db[_0x344e51[_0x4935('0x1d')]],'as':_0x344e51['as'],'attributes':_0x344e51[_0x4935('0x19')],'include':_0x344e51[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x344e51[_0x4935('0x1b')],function(_0x1d08b5){return{'model':db[_0x1d08b5[_0x4935('0x1d')]],'as':_0x1d08b5['as'],'attributes':_0x1d08b5[_0x4935('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x359522){logger['info']('GetTrigger',_0x429ef3);logger['debug'](_0x4935('0x15'),_0x429ef3,JSON[_0x4935('0x1f')](_0x359522));_0xd70eff(_0x359522);})['catch'](function(_0x3f0707){logger[_0x4935('0x11')](_0x4935('0x15'),_0x3f0707[_0x4935('0x12')],_0x429ef3);_0x145277(_0x4ebc63[_0x4935('0x11')](0x1f4,_0x3f0707[_0x4935('0x12')]));});});};exports[_0x4935('0x20')]=function(_0x2fe6da){var _0x5b3c8e=this;return new Promise(function(_0xb7fe2a,_0x2dcb0b){return db['Trigger']['find']({'raw':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da['options'][_0x4935('0x21')]===undefined?!![]:![]:!![],'where':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da[_0x4935('0x17')]['where']||null:null,'attributes':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x19')]||null:null,'include':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')],function(_0x4a69bc){return{'model':db[_0x4a69bc['model']],'as':_0x4a69bc['as'],'attributes':_0x4a69bc[_0x4935('0x19')],'include':_0x4a69bc[_0x4935('0x1b')]?_['map'](_0x4a69bc['include'],function(_0xb3d934){return{'model':db[_0xb3d934['model']],'as':_0xb3d934['as'],'attributes':_0xb3d934[_0x4935('0x19')],'include':_0xb3d934[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0xb3d934[_0x4935('0x1b')],function(_0x1d77b8){return{'model':db[_0x1d77b8[_0x4935('0x1d')]],'as':_0x1d77b8['as'],'attributes':_0x1d77b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x51b7ac){logger[_0x4935('0xc')]('ShowTrigger',_0x2fe6da);logger[_0x4935('0xf')]('ShowTrigger',_0x2fe6da,JSON[_0x4935('0x1f')](_0x51b7ac));_0xb7fe2a(_0x51b7ac);})[_0x4935('0x14')](function(_0x352679){logger[_0x4935('0x11')](_0x4935('0x20'),_0x352679[_0x4935('0x12')],_0x2fe6da);_0x2dcb0b(_0x5b3c8e[_0x4935('0x11')](0x1f4,_0x352679['message']));});});}; \ No newline at end of file +var _0x28f2=['limit','include','map','model','GetTrigger','catch','ShowTrigger','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trigger','options','where','attributes'];(function(_0x5823a8,_0x5d7025){var _0x539c0b=function(_0x387796){while(--_0x387796){_0x5823a8['push'](_0x5823a8['shift']());}};_0x539c0b(++_0x5d7025);}(_0x28f2,0x193));var _0x228f=function(_0x1f7fb5,_0x43af75){_0x1f7fb5=_0x1f7fb5-0x0;var _0x821689=_0x28f2[_0x1f7fb5];return _0x821689;};'use strict';var _=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var moment=require(_0x228f('0x2'));var BPromise=require(_0x228f('0x3'));var rs=require(_0x228f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x228f('0x5'))['db'];var utils=require(_0x228f('0x6'));var logger=require(_0x228f('0x7'))(_0x228f('0x8'));var config=require(_0x228f('0x9'));var jayson=require(_0x228f('0xa'));var client=jayson[_0x228f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10da58,_0x4a4a44,_0x3ca074){return new BPromise(function(_0x455eb6,_0xf4b011){return client['request'](_0x10da58,_0x3ca074)[_0x228f('0xc')](function(_0x4d0038){logger[_0x228f('0xd')](_0x228f('0xe'),_0x4a4a44,'request\x20sent');logger[_0x228f('0xf')](_0x228f('0x10'),_0x4a4a44,_0x228f('0x11'),JSON[_0x228f('0x12')](_0x4d0038));if(_0x4d0038[_0x228f('0x13')]){if(_0x4d0038['error'][_0x228f('0x14')]===0x1f4){logger[_0x228f('0x13')](_0x228f('0xe'),_0x4a4a44,_0x4d0038[_0x228f('0x13')][_0x228f('0x15')]);return _0xf4b011(_0x4d0038[_0x228f('0x13')][_0x228f('0x15')]);}logger[_0x228f('0x13')]('Trigger,\x20%s,\x20%s',_0x4a4a44,_0x4d0038[_0x228f('0x13')][_0x228f('0x15')]);return _0x455eb6(_0x4d0038[_0x228f('0x13')][_0x228f('0x15')]);}else{logger[_0x228f('0xd')](_0x228f('0xe'),_0x4a4a44,_0x228f('0x11'));_0x455eb6(_0x4d0038['result'][_0x228f('0x15')]);}})['catch'](function(_0x20e687){logger[_0x228f('0x13')](_0x228f('0xe'),_0x4a4a44,_0x20e687);_0xf4b011(_0x20e687);});});}exports['GetTrigger']=function(_0x2d4819){var _0x4e1968=this;return new Promise(function(_0x33e32e,_0x5b33a6){return db[_0x228f('0x16')]['findAll']({'raw':_0x2d4819['options']?_0x2d4819[_0x228f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2d4819[_0x228f('0x17')]?_0x2d4819[_0x228f('0x17')][_0x228f('0x18')]||null:null,'attributes':_0x2d4819[_0x228f('0x17')]?_0x2d4819[_0x228f('0x17')][_0x228f('0x19')]||null:null,'limit':_0x2d4819[_0x228f('0x17')]?_0x2d4819[_0x228f('0x17')][_0x228f('0x1a')]||null:null,'include':_0x2d4819['options']?_0x2d4819[_0x228f('0x17')][_0x228f('0x1b')]?_[_0x228f('0x1c')](_0x2d4819[_0x228f('0x17')][_0x228f('0x1b')],function(_0x194d1a){return{'model':db[_0x194d1a[_0x228f('0x1d')]],'as':_0x194d1a['as'],'attributes':_0x194d1a[_0x228f('0x19')],'include':_0x194d1a[_0x228f('0x1b')]?_['map'](_0x194d1a[_0x228f('0x1b')],function(_0x306928){return{'model':db[_0x306928[_0x228f('0x1d')]],'as':_0x306928['as'],'attributes':_0x306928[_0x228f('0x19')],'include':_0x306928[_0x228f('0x1b')]?_['map'](_0x306928[_0x228f('0x1b')],function(_0x49efe9){return{'model':db[_0x49efe9[_0x228f('0x1d')]],'as':_0x49efe9['as'],'attributes':_0x49efe9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b9802){logger[_0x228f('0xd')](_0x228f('0x1e'),_0x2d4819);logger[_0x228f('0xf')](_0x228f('0x1e'),_0x2d4819,JSON[_0x228f('0x12')](_0x2b9802));_0x33e32e(_0x2b9802);})[_0x228f('0x1f')](function(_0x2511e5){logger[_0x228f('0x13')](_0x228f('0x1e'),_0x2511e5[_0x228f('0x15')],_0x2d4819);_0x5b33a6(_0x4e1968[_0x228f('0x13')](0x1f4,_0x2511e5[_0x228f('0x15')]));});});};exports[_0x228f('0x20')]=function(_0x2a3677){var _0x4e9ca8=this;return new Promise(function(_0x4148ff,_0x40bf17){return db[_0x228f('0x16')]['find']({'raw':_0x2a3677[_0x228f('0x17')]?_0x2a3677[_0x228f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2a3677[_0x228f('0x17')]?_0x2a3677[_0x228f('0x17')][_0x228f('0x18')]||null:null,'attributes':_0x2a3677[_0x228f('0x17')]?_0x2a3677['options'][_0x228f('0x19')]||null:null,'include':_0x2a3677['options']?_0x2a3677[_0x228f('0x17')][_0x228f('0x1b')]?_[_0x228f('0x1c')](_0x2a3677[_0x228f('0x17')]['include'],function(_0x36f06b){return{'model':db[_0x36f06b[_0x228f('0x1d')]],'as':_0x36f06b['as'],'attributes':_0x36f06b['attributes'],'include':_0x36f06b['include']?_['map'](_0x36f06b[_0x228f('0x1b')],function(_0x327af5){return{'model':db[_0x327af5[_0x228f('0x1d')]],'as':_0x327af5['as'],'attributes':_0x327af5[_0x228f('0x19')],'include':_0x327af5[_0x228f('0x1b')]?_[_0x228f('0x1c')](_0x327af5[_0x228f('0x1b')],function(_0x1f1ef7){return{'model':db[_0x1f1ef7[_0x228f('0x1d')]],'as':_0x1f1ef7['as'],'attributes':_0x1f1ef7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45e1c6){logger[_0x228f('0xd')](_0x228f('0x20'),_0x2a3677);logger[_0x228f('0xf')](_0x228f('0x20'),_0x2a3677,JSON[_0x228f('0x12')](_0x45e1c6));_0x4148ff(_0x45e1c6);})[_0x228f('0x1f')](function(_0x40968b){logger[_0x228f('0x13')](_0x228f('0x20'),_0x40968b['message'],_0x2a3677);_0x40bf17(_0x4e9ca8['error'](0x1f4,_0x40968b[_0x228f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 76cde67..ba6d51a 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 _0xeec6=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','isAuthenticated','show','post','/:id/clone','clone','update','exports'];(function(_0x174592,_0x2448e3){var _0x22f2ab=function(_0xde7f0f){while(--_0xde7f0f){_0x174592['push'](_0x174592['shift']());}};_0x22f2ab(++_0x2448e3);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3d2012,_0x3d02b9){_0x3d2012=_0x3d2012-0x0;var _0x53d542=_0xeec6[_0x3d2012];return _0x53d542;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var auth=require(_0x6eec('0x5'));var interaction=require(_0x6eec('0x6'));var config=require(_0x6eec('0x7'));var controller=require(_0x6eec('0x8'));router[_0x6eec('0x9')]('/',auth['isAuthenticated'](),controller[_0x6eec('0xa')]);router[_0x6eec('0x9')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xc')]);router[_0x6eec('0xd')](_0x6eec('0xe'),auth['isAuthenticated'](),controller[_0x6eec('0xf')]);router[_0x6eec('0xd')]('/',auth[_0x6eec('0xb')](),controller['create']);router['put']('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0x10')]);router['delete']('/:id',auth[_0x6eec('0xb')](),controller['destroy']);module[_0x6eec('0x11')]=router; \ No newline at end of file +var _0xd0bb=['express','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','index','get','/:id','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path'];(function(_0x10841c,_0x389f1f){var _0x59e4a5=function(_0x55d789){while(--_0x55d789){_0x10841c['push'](_0x10841c['shift']());}};_0x59e4a5(++_0x389f1f);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x27acbf,_0xe7afec){_0x27acbf=_0x27acbf-0x0;var _0xf93fc8=_0xd0bb[_0x27acbf];return _0xf93fc8;};'use strict';var multer=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var path=require(_0xbd0b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd0b('0x3'));var router=express['Router']();var auth=require(_0xbd0b('0x4'));var interaction=require(_0xbd0b('0x5'));var config=require('../../config/environment');var controller=require(_0xbd0b('0x6'));router['get']('/',auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x8')]);router[_0xbd0b('0x9')](_0xbd0b('0xa'),auth[_0xbd0b('0x7')](),controller['show']);router[_0xbd0b('0xb')](_0xbd0b('0xc'),auth[_0xbd0b('0x7')](),controller[_0xbd0b('0xd')]);router[_0xbd0b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbd0b('0xe')](_0xbd0b('0xa'),auth['isAuthenticated'](),controller[_0xbd0b('0xf')]);router[_0xbd0b('0x10')]('/:id',auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x11')]);module[_0xbd0b('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index c77afbb..5d038e5 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 _0x1394=['ulaw;alaw;gsm','allow','port,invite','insecure','yes','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','rfc2833','info','auto','nonat','update','outgoing','force_rport,comedia','nat','all'];(function(_0x18be7e,_0x32fd6c){var _0x44139b=function(_0x219c43){while(--_0x219c43){_0x18be7e['push'](_0x18be7e['shift']());}};_0x44139b(++_0x32fd6c);}(_0x1394,0x16c));var _0x4139=function(_0x40429e,_0x3e4fae){_0x40429e=_0x40429e-0x0;var _0x29a910=_0x1394[_0x40429e];return _0x29a910;};'use strict';var Sequelize=require('sequelize');module[_0x4139('0x0')]={'name':{'type':Sequelize[_0x4139('0x1')],'allowNull':![],'unique':_0x4139('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x4'),_0x4139('0x5'),_0x4139('0x6')),'allowNull':![],'defaultValue':_0x4139('0x4')},'context':{'type':Sequelize[_0x4139('0x1')],'allowNull':![],'defaultValue':_0x4139('0x7')},'callingpres':{'type':Sequelize[_0x4139('0x3')]('ALLOWED_NOT_SCREENED',_0x4139('0x8'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x4139('0x9'),_0x4139('0xa'),_0x4139('0xb'),_0x4139('0xc'))},'deny':{'type':Sequelize[_0x4139('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x4139('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x4139('0x1')]},'transport':{'type':Sequelize[_0x4139('0x1')],'defaultValue':_0x4139('0xd'),'set':function(_0x198475){this[_0x4139('0xe')](_0x4139('0xf'),_0x198475?_0x198475[_0x4139('0x10')](','):null);},'get':function(){return this[_0x4139('0x11')]('transport')?this[_0x4139('0x11')](_0x4139('0xf'))[_0x4139('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x4139('0x13'),_0x4139('0x14'),'shortinfo','inband',_0x4139('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x4139('0x16'),_0x4139('0x17'),_0x4139('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4139('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4139('0x1')]},'directmediadeny':{'type':Sequelize[_0x4139('0x1')]},'nat':{'type':Sequelize[_0x4139('0x1')],'defaultValue':_0x4139('0x19'),'set':function(_0xd9779){this['setDataValue']('nat',_0xd9779?_0xd9779['join'](','):null);},'get':function(){return this['getDataValue'](_0x4139('0x1a'))?this['getDataValue'](_0x4139('0x1a'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x4139('0x1')]},'namedcallgroup':{'type':Sequelize[_0x4139('0x1')]},'pickupgroup':{'type':Sequelize[_0x4139('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x4139('0x1')]},'language':{'type':Sequelize[_0x4139('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4139('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4139('0x1')],'defaultValue':_0x4139('0x1b')},'allow':{'type':Sequelize[_0x4139('0x1')],'allowNull':![],'defaultValue':_0x4139('0x1c'),'set':function(_0x1fbd6d){this['setDataValue'](_0x4139('0x1d'),_0x1fbd6d?_0x1fbd6d[_0x4139('0x10')](';'):_0x4139('0x1c'));},'get':function(){return this[_0x4139('0x11')](_0x4139('0x1d'))?this['getDataValue']('allow')[_0x4139('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x4139('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x4139('0x1')],'defaultValue':_0x4139('0x1e'),'set':function(_0x5b5f08){this[_0x4139('0xe')](_0x4139('0x1f'),_0x5b5f08?_0x5b5f08[_0x4139('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x4139('0x1f'))?this['getDataValue']('insecure')[_0x4139('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no',_0x4139('0x21'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x4139('0x20'),'no')},'accountcode':{'type':Sequelize[_0x4139('0x22')](0xb)},'setvar':{'type':Sequelize[_0x4139('0x1')]},'callerid':{'type':Sequelize[_0x4139('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x4139('0x1')]},'callcounter':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no'),'defaultValue':_0x4139('0x20')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x4139('0x20'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x4139('0x20'),'no')},'subscribecontext':{'type':Sequelize[_0x4139('0x1')]},'template':{'type':Sequelize[_0x4139('0x1')]},'videosupport':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no',_0x4139('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4139('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x4139('0x20'),'no')},'mailbox':{'type':Sequelize[_0x4139('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x4139('0x24'),_0x4139('0x25'),_0x4139('0x26'))},'session_expires':{'type':Sequelize[_0x4139('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x4139('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x27'),_0x4139('0x28')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x4139('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x4139('0x1')]},'port':{'type':Sequelize[_0x4139('0x22')](0x5)},'qualify':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no'),'defaultValue':_0x4139('0x20')},'keepalive':{'type':Sequelize[_0x4139('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x4139('0x1')]},'defaultuser':{'type':Sequelize[_0x4139('0x1')]},'rtptimeout':{'type':Sequelize[_0x4139('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4139('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no',_0x4139('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4139('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x4139('0x22')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x4139('0x1')]},'contactdeny':{'type':Sequelize[_0x4139('0x1')]},'contactacl':{'type':Sequelize[_0x4139('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x4139('0x1')]},'use_q850_reason':{'type':Sequelize[_0x4139('0x1')]},'maxforwards':{'type':Sequelize[_0x4139('0x22')](0xb)},'encryption':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no')},'force_avp':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no')},'icesupport':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no')},'dtlsenable':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x4139('0x2a'),_0x4139('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x4139('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x4139('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x4139('0x1')]},'dtlscipher':{'type':Sequelize[_0x4139('0x1')]},'dtlscafile':{'type':Sequelize[_0x4139('0x1')]},'dtlscapath':{'type':Sequelize[_0x4139('0x1')]},'dtlssetup':{'type':Sequelize[_0x4139('0x3')]('active',_0x4139('0x2c'),_0x4139('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4139('0x1')]},'usereqphone':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4139('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x4139('0x20'),'no')},'vmexten':{'type':Sequelize[_0x4139('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x4139('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4139('0x1')],'defaultValue':_0x4139('0x2e')},'canreinvite':{'type':Sequelize[_0x4139('0x3')](_0x4139('0x20'),'no','nonat','update',_0x4139('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4139('0x1')]},'otherFields':{'type':Sequelize[_0x4139('0x1')]},'active':{'type':Sequelize[_0x4139('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4139('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x2f53=['port,invite','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','pai','fingerprint','certificate','passive','actpass','dynamic','update,nonat','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','join','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]'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2f53,0xe1));var _0x32f5=function(_0x37d43d,_0x47d40e){_0x37d43d=_0x37d43d-0x0;var _0x459577=_0x2f53[_0x37d43d];return _0x459577;};'use strict';var Sequelize=require('sequelize');module[_0x32f5('0x0')]={'name':{'type':Sequelize[_0x32f5('0x1')],'allowNull':![],'unique':_0x32f5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x32f5('0x3')]('friend',_0x32f5('0x4'),_0x32f5('0x5')),'allowNull':![],'defaultValue':_0x32f5('0x6')},'context':{'type':Sequelize[_0x32f5('0x1')],'allowNull':![],'defaultValue':_0x32f5('0x7')},'callingpres':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x8'),'ALLOWED_PASSED_SCREEN',_0x32f5('0x9'),_0x32f5('0xa'),_0x32f5('0xb'),_0x32f5('0xc'),_0x32f5('0xd'),'PROHIB')},'deny':{'type':Sequelize[_0x32f5('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x32f5('0x1')]},'md5secret':{'type':Sequelize[_0x32f5('0x1')]},'remotesecret':{'type':Sequelize[_0x32f5('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x32f5('0xe'),'set':function(_0x1b7eed){this[_0x32f5('0xf')](_0x32f5('0x10'),_0x1b7eed?_0x1b7eed['join'](','):null);},'get':function(){return this[_0x32f5('0x11')]('transport')?this[_0x32f5('0x11')]('transport')[_0x32f5('0x12')](','):null;},'comment':_0x32f5('0x13')},'dtmfmode':{'type':Sequelize[_0x32f5('0x3')]('rfc2833',_0x32f5('0x14'),_0x32f5('0x15'),_0x32f5('0x16'),_0x32f5('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no',_0x32f5('0x19'),_0x32f5('0x1a'),_0x32f5('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x32f5('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x32f5('0x1')]},'directmediadeny':{'type':Sequelize[_0x32f5('0x1')]},'nat':{'type':Sequelize[_0x32f5('0x1')],'defaultValue':'force_rport,comedia','set':function(_0xd1e36a){this[_0x32f5('0xf')](_0x32f5('0x1c'),_0xd1e36a?_0xd1e36a[_0x32f5('0x1d')](','):null);},'get':function(){return this[_0x32f5('0x11')](_0x32f5('0x1c'))?this[_0x32f5('0x11')]('nat')['split'](','):null;},'comment':_0x32f5('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x32f5('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x32f5('0x1')]},'language':{'type':Sequelize[_0x32f5('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x32f5('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x32f5('0x1')],'defaultValue':_0x32f5('0x1f')},'allow':{'type':Sequelize[_0x32f5('0x1')],'allowNull':![],'defaultValue':_0x32f5('0x20'),'set':function(_0x6d33d2){this[_0x32f5('0xf')](_0x32f5('0x21'),_0x6d33d2?_0x6d33d2[_0x32f5('0x1d')](';'):_0x32f5('0x20'));},'get':function(){return this['getDataValue'](_0x32f5('0x21'))?this['getDataValue'](_0x32f5('0x21'))[_0x32f5('0x12')](';'):null;},'comment':_0x32f5('0x22')},'autoframing':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no')},'insecure':{'type':Sequelize[_0x32f5('0x1')],'defaultValue':_0x32f5('0x23'),'set':function(_0x1b1e33){this[_0x32f5('0xf')]('insecure',_0x1b1e33?_0x1b1e33[_0x32f5('0x1d')](','):null);},'get':function(){return this[_0x32f5('0x11')]('insecure')?this[_0x32f5('0x11')]('insecure')[_0x32f5('0x12')](','):null;},'comment':_0x32f5('0x24')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x32f5('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x32f5('0x25'))},'promiscredir':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no')},'accountcode':{'type':Sequelize[_0x32f5('0x26')](0xb)},'setvar':{'type':Sequelize[_0x32f5('0x1')]},'callerid':{'type':Sequelize[_0x32f5('0x1')],'defaultValue':_0x32f5('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x32f5('0x3')]('yes','no'),'defaultValue':_0x32f5('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x32f5('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x32f5('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x32f5('0x1')]},'template':{'type':Sequelize[_0x32f5('0x1')]},'videosupport':{'type':Sequelize[_0x32f5('0x3')]('yes','no',_0x32f5('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x32f5('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x32f5('0x1')]},'session_timers':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x29'),_0x32f5('0x2a'),_0x32f5('0x2b'))},'session_expires':{'type':Sequelize[_0x32f5('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x32f5('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x2c'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x32f5('0x1')]},'regexten':{'type':Sequelize[_0x32f5('0x1')]},'fromdomain':{'type':Sequelize[_0x32f5('0x1')]},'fromuser':{'type':Sequelize[_0x32f5('0x1')]},'port':{'type':Sequelize[_0x32f5('0x26')](0x5)},'qualify':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no'),'defaultValue':_0x32f5('0x18')},'keepalive':{'type':Sequelize[_0x32f5('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x32f5('0x1')]},'defaultuser':{'type':Sequelize[_0x32f5('0x1')]},'rtptimeout':{'type':Sequelize[_0x32f5('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x32f5('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no',_0x32f5('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x32f5('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x32f5('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x32f5('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x32f5('0x1')]},'use_q850_reason':{'type':Sequelize[_0x32f5('0x1')]},'maxforwards':{'type':Sequelize[_0x32f5('0x26')](0xb)},'encryption':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no')},'force_avp':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x32f5('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no',_0x32f5('0x2e'),_0x32f5('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x32f5('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x32f5('0x1')]},'dtlscipher':{'type':Sequelize[_0x32f5('0x1')]},'dtlscafile':{'type':Sequelize[_0x32f5('0x1')]},'dtlscapath':{'type':Sequelize[_0x32f5('0x1')]},'dtlssetup':{'type':Sequelize[_0x32f5('0x3')]('active',_0x32f5('0x30'),_0x32f5('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x32f5('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x32f5('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x32f5('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x32f5('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x32f5('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x32f5('0x32')},'canreinvite':{'type':Sequelize[_0x32f5('0x3')](_0x32f5('0x18'),'no','nonat','update',_0x32f5('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x32f5('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'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 de9cb0c..7f4aa59 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 _0x434a=['query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','clone','omit','updatedAt','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model'];(function(_0x10291b,_0x518773){var _0x1d5fbe=function(_0x24df58){while(--_0x24df58){_0x10291b['push'](_0x10291b['shift']());}};_0x1d5fbe(++_0x518773);}(_0x434a,0x9f));var _0xa434=function(_0xebca85,_0x55cd72){_0xebca85=_0xebca85-0x0;var _0x9d5527=_0x434a[_0xebca85];return _0x9d5527;};'use strict';var pdf=require(_0xa434('0x0'));var emlformat=require(_0xa434('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa434('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa434('0x3'));var moment=require('moment');var BPromise=require(_0xa434('0x4'));var Mustache=require(_0xa434('0x5'));var util=require(_0xa434('0x6'));var path=require('path');var sox=require(_0xa434('0x7'));var csv=require(_0xa434('0x8'));var ejs=require(_0xa434('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa434('0xa'));var crypto=require(_0xa434('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa434('0xc'));var Papa=require(_0xa434('0xd'));var Redis=require(_0xa434('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa434('0xf'));var as=require(_0xa434('0x10'));var hardwareService=require(_0xa434('0x11'));var logger=require(_0xa434('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa434('0x13'));var db=require(_0xa434('0x14'))['db'];var jayson=require(_0xa434('0x15'));var client=jayson[_0xa434('0x16')][_0xa434('0x17')]({'port':0x232a});function checkPasswordPattern(_0x764f5b,_0x36d220,_0x426fe6){if(_0x426fe6){var _0x493055=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x493055[_0xa434('0x18')](_0x36d220)){return _0x764f5b;}else{throw new db[(_0xa434('0x19'))]['ValidationError'](_0xa434('0x1a'));}}else{return _0x764f5b;}}function respondWithRpcPromise(_0x2123e9,_0x258752,_0x15f0e5,_0x216044){return new BPromise(function(_0x2b9de3,_0x53ea88){var _0x3a84de=_0x216044||client;return _0x3a84de['request'](_0x2123e9,_0x15f0e5)[_0xa434('0x1b')](function(_0x3064f2){logger[_0xa434('0x1c')]('Trunk,\x20%s,\x20%s',_0x258752,_0xa434('0x1d'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x258752,_0xa434('0x1d'),JSON[_0xa434('0x1e')](_0x3064f2));if(_0x3064f2['error']){if(_0x3064f2[_0xa434('0x1f')][_0xa434('0x20')]===0x1f4){logger[_0xa434('0x1f')](_0xa434('0x21'),_0x258752,_0x3064f2[_0xa434('0x1f')]['message']);return _0x53ea88(_0x3064f2['error'][_0xa434('0x22')]);}logger[_0xa434('0x1f')](_0xa434('0x21'),_0x258752,_0x3064f2[_0xa434('0x1f')][_0xa434('0x22')]);return _0x2b9de3(_0x3064f2['error']['message']);}else{logger[_0xa434('0x1c')](_0xa434('0x21'),_0x258752,'request\x20sent');_0x2b9de3(_0x3064f2[_0xa434('0x23')]['message']);}})[_0xa434('0x24')](function(_0xd8f06d){logger['error']('Trunk,\x20%s,\x20%s',_0x258752,_0xd8f06d);_0x53ea88(_0xd8f06d);});});}function respondWithStatusCode(_0x322f42,_0x40bd6d){_0x40bd6d=_0x40bd6d||0xcc;return function(_0x56b2dc){if(_0x56b2dc){return _0x322f42[_0xa434('0x25')](_0x40bd6d);}return _0x322f42[_0xa434('0x26')](_0x40bd6d)[_0xa434('0x27')]();};}function respondWithResult(_0x4a18e7,_0x1dd431){_0x1dd431=_0x1dd431||0xc8;return function(_0x3a907d){if(_0x3a907d){return _0x4a18e7[_0xa434('0x26')](_0x1dd431)[_0xa434('0x28')](_0x3a907d);}};}function respondWithFilteredResult(_0x3dc993,_0x1ce85a){return function(_0x2c9a3e){if(_0x2c9a3e){var _0x1a7259=_0x2c9a3e[_0xa434('0x29')],_0x4506d1=_0x1ce85a[_0xa434('0x2a')],_0x3c9d33=_0x1ce85a[_0xa434('0x2a')]+_0x1ce85a[_0xa434('0x2b')],_0x1bb245;if(_0x3c9d33>=_0x1a7259){_0x3c9d33=_0x1a7259;_0x1bb245=0xc8;}else{_0x1bb245=0xce;}_0x3dc993[_0xa434('0x26')](_0x1bb245);return _0x3dc993['set'](_0xa434('0x2c'),_0x4506d1+'-'+_0x3c9d33+'/'+_0x1a7259)[_0xa434('0x28')](_0x2c9a3e);}return null;};}function patchUpdates(_0x8e891b){return function(_0x15fa49){try{jsonpatch[_0xa434('0x2d')](_0x15fa49,_0x8e891b,!![]);}catch(_0x30bc1c){return BPromise[_0xa434('0x2e')](_0x30bc1c);}return _0x15fa49[_0xa434('0x2f')]();};}function saveUpdates(_0x1db7db,_0x169abe){return function(_0x41be40){if(_0x41be40){return _0x41be40[_0xa434('0x30')](_0x1db7db)[_0xa434('0x1b')](function(_0xec6546){return _0xec6546;});}return null;};}function removeEntity(_0x26ece7,_0x38b151){return function(_0x20ff36){if(_0x20ff36){return _0x20ff36['destroy']()[_0xa434('0x1b')](function(){var _0x11ea13=_0x20ff36[_0xa434('0x31')]({'plain':!![]});var _0x1a96cc=_0xa434('0x32');return db[_0xa434('0x33')][_0xa434('0x34')]({'where':{'type':_0x1a96cc,'resourceId':_0x11ea13['id']}})[_0xa434('0x1b')](function(){return _0x20ff36;});})[_0xa434('0x1b')](function(){_0x26ece7[_0xa434('0x26')](0xcc)[_0xa434('0x27')]();});}};}function handleEntityNotFound(_0x326b1e,_0x5017c4){return function(_0x87af5d){if(!_0x87af5d){_0x326b1e[_0xa434('0x25')](0x194);}return _0x87af5d;};}function handleError(_0x447a31,_0x2a5ad9){_0x2a5ad9=_0x2a5ad9||0x1f4;return function(_0x2167f4){logger[_0xa434('0x1f')](_0x2167f4[_0xa434('0x35')]);if(_0x2167f4[_0xa434('0x36')]){delete _0x2167f4[_0xa434('0x36')];}_0x447a31['status'](_0x2a5ad9)[_0xa434('0x37')](_0x2167f4);};}exports[_0xa434('0x38')]=function(_0x1492a4,_0x32aa73){var _0x521215={},_0xcfab96={},_0xf14892={'count':0x0,'rows':[]};var _0x4349ec=_['map'](db[_0xa434('0x39')][_0xa434('0x3a')],function(_0x19c5e7){return{'name':_0x19c5e7[_0xa434('0x3b')],'type':_0x19c5e7[_0xa434('0x3c')][_0xa434('0x3d')]};});_0xcfab96[_0xa434('0x3e')]=_['map'](_0x4349ec,_0xa434('0x36'));_0xcfab96[_0xa434('0x3f')]=_[_0xa434('0x40')](_0x1492a4[_0xa434('0x3f')]);_0xcfab96['filters']=_[_0xa434('0x41')](_0xcfab96[_0xa434('0x3e')],_0xcfab96[_0xa434('0x3f')]);_0x521215['attributes']=_[_0xa434('0x41')](_0xcfab96[_0xa434('0x3e')],qs[_0xa434('0x42')](_0x1492a4[_0xa434('0x3f')][_0xa434('0x42')]));_0x521215[_0xa434('0x43')]=_0x521215[_0xa434('0x43')][_0xa434('0x44')]?_0x521215['attributes']:_0xcfab96[_0xa434('0x3e')];if(!_0x1492a4[_0xa434('0x3f')][_0xa434('0x45')](_0xa434('0x46'))){_0x521215[_0xa434('0x2b')]=qs[_0xa434('0x2b')](_0x1492a4[_0xa434('0x3f')][_0xa434('0x2b')]);_0x521215[_0xa434('0x2a')]=qs[_0xa434('0x2a')](_0x1492a4[_0xa434('0x3f')][_0xa434('0x2a')]);}_0x521215[_0xa434('0x47')]=qs[_0xa434('0x48')](_0x1492a4['query'][_0xa434('0x48')]);_0x521215[_0xa434('0x49')]=qs[_0xa434('0x4a')](_[_0xa434('0x4b')](_0x1492a4['query'],_0xcfab96[_0xa434('0x4a')]));if(_0x1492a4[_0xa434('0x3f')]['filter']){_0x521215[_0xa434('0x49')]=_[_0xa434('0x4c')](_0x521215[_0xa434('0x49')],{'$or':_[_0xa434('0x4d')](_0x4349ec,function(_0x389025){if(_0x389025[_0xa434('0x3c')]!==_0xa434('0x4e')){var _0x2d5ba9={};_0x2d5ba9[_0x389025[_0xa434('0x36')]]={'$like':'%'+_0x1492a4[_0xa434('0x3f')][_0xa434('0x4f')]+'%'};return _0x2d5ba9;}})});}_0x521215=_[_0xa434('0x4c')]({},_0x521215,_0x1492a4[_0xa434('0x50')]);var _0x5f12e5={'where':_0x521215['where']};return db[_0xa434('0x39')][_0xa434('0x29')](_0x5f12e5)[_0xa434('0x1b')](function(_0x3b64c4){_0xf14892[_0xa434('0x29')]=_0x3b64c4;if(_0x1492a4[_0xa434('0x3f')][_0xa434('0x51')]){_0x521215[_0xa434('0x52')]=[{'all':!![]}];}return db['Trunk'][_0xa434('0x53')](_0x521215);})[_0xa434('0x1b')](function(_0x18ddbf){_0xf14892['rows']=_0x18ddbf;return _0xf14892;})[_0xa434('0x1b')](respondWithFilteredResult(_0x32aa73,_0x521215))[_0xa434('0x24')](handleError(_0x32aa73,null));};exports[_0xa434('0x54')]=function(_0x618704,_0x79fb57){var _0x256372={'raw':![],'where':{'id':_0x618704[_0xa434('0x55')]['id']}},_0xf1490c={};_0xf1490c[_0xa434('0x3e')]=_[_0xa434('0x40')](db[_0xa434('0x39')][_0xa434('0x3a')]);_0xf1490c['query']=_[_0xa434('0x40')](_0x618704[_0xa434('0x3f')]);_0xf1490c[_0xa434('0x4a')]=_['intersection'](_0xf1490c[_0xa434('0x3e')],_0xf1490c['query']);_0x256372[_0xa434('0x43')]=_[_0xa434('0x41')](_0xf1490c['model'],qs[_0xa434('0x42')](_0x618704[_0xa434('0x3f')]['fields']));_0x256372[_0xa434('0x43')]=_0x256372[_0xa434('0x43')][_0xa434('0x44')]?_0x256372[_0xa434('0x43')]:_0xf1490c[_0xa434('0x3e')];if(_0x618704[_0xa434('0x3f')]['includeAll']){_0x256372[_0xa434('0x52')]=[{'all':!![]}];}_0x256372=_['merge']({},_0x256372,_0x618704[_0xa434('0x50')]);return db[_0xa434('0x39')][_0xa434('0x56')](_0x256372)['then'](handleEntityNotFound(_0x79fb57,null))['then'](respondWithResult(_0x79fb57,null))[_0xa434('0x24')](handleError(_0x79fb57,null));};exports[_0xa434('0x57')]=function(_0x5e25e2,_0x422030){var _0x27810c={'where':{'id':_0x5e25e2[_0xa434('0x55')]['id']}},_0xc2dd6b={};_0xc2dd6b['model']=_[_0xa434('0x40')](db[_0xa434('0x39')][_0xa434('0x3a')]);_0x27810c[_0xa434('0x43')]=_['intersection'](_0xc2dd6b[_0xa434('0x3e')],qs[_0xa434('0x42')](_0x5e25e2[_0xa434('0x3f')][_0xa434('0x42')]));_0x27810c[_0xa434('0x43')]=_0x27810c[_0xa434('0x43')][_0xa434('0x44')]?_0x27810c[_0xa434('0x43')]:_0xc2dd6b['model'];if(_0x5e25e2[_0xa434('0x3f')]['includeAll']){_0x27810c[_0xa434('0x52')]=[{'all':!![]}];}_0x27810c=_['merge']({},_0x27810c,_0x5e25e2[_0xa434('0x50')]);return db[_0xa434('0x39')][_0xa434('0x56')](_0x27810c)[_0xa434('0x1b')](handleEntityNotFound(_0x422030,null))[_0xa434('0x1b')](function(_0x21d6b6){if(_0x21d6b6){var _0xbbfce=_0x21d6b6[_0xa434('0x31')]({'plain':!![]});_0xbbfce=qs[_0xa434('0x58')](_0xbbfce,['id','createdAt',_0xa434('0x59')]);_0x5e25e2[_0xa434('0x5a')]=_[_0xa434('0x58')](_0x5e25e2[_0xa434('0x5a')],['id','createdAt',_0xa434('0x59')]);return db['Trunk']['create'](_[_0xa434('0x4c')](_0xbbfce,_0x5e25e2[_0xa434('0x5a')]),{'include':_0x5e25e2['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x563883){var _0x51aeb4=_0x5e25e2[_0xa434('0x5b')][_0xa434('0x31')]({'plain':!![]});if(!_0x51aeb4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51aeb4[_0xa434('0x5c')]==='user'){var _0x3a5df6=_0x563883[_0xa434('0x31')]({'plain':!![]});var _0x5b617b=_0xa434('0x32');return db[_0xa434('0x5d')][_0xa434('0x56')]({'where':{'name':_0x5b617b,'userProfileId':_0x51aeb4['userProfileId']},'raw':!![]})[_0xa434('0x1b')](function(_0x5dd4bb){if(_0x5dd4bb&&_0x5dd4bb[_0xa434('0x5e')]===0x0){return db[_0xa434('0x33')]['create']({'name':_0x3a5df6[_0xa434('0x36')],'resourceId':_0x3a5df6['id'],'type':_0x5dd4bb['name'],'sectionId':_0x5dd4bb['id']},{})[_0xa434('0x1b')](function(){return _0x563883;});}else{return _0x563883;}})['catch'](function(_0x200a88){logger[_0xa434('0x1f')](_0xa434('0x5f'),_0x200a88);throw _0x200a88;});}return _0x563883;});}})[_0xa434('0x1b')](respondWithResult(_0x422030,0xc9))[_0xa434('0x24')](handleError(_0x422030,null));};exports[_0xa434('0x60')]=function(_0x501b9c,_0x421ade,_0x266e4b){var _0x2d8b4c;return db[_0xa434('0x39')][_0xa434('0x60')](_0x501b9c['body'],{'raw':!![]})['then'](function(_0x12cfa1){_0x2d8b4c=_0x12cfa1;return db[_0xa434('0x39')][_0xa434('0x53')]({'raw':!![]});})[_0xa434('0x1b')](function(_0x4d4b0d){var _0x2d8719=fs[_0xa434('0x61')](path[_0xa434('0x62')](config[_0xa434('0x63')],_0xa434('0x64')),_0xa434('0x65'));var _0x2e7268=fs[_0xa434('0x61')](path[_0xa434('0x62')](config['root'],_0xa434('0x66')),_0xa434('0x65'));var _0x454eee=ejs[_0xa434('0x67')](_0x2d8719,{'trunks':_0x4d4b0d||[]});fs[_0xa434('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x454eee);if(_0x2d8b4c['registry']){var _0x1788ce=ejs[_0xa434('0x67')](_0x2e7268,{'trunks':_0x4d4b0d||[]});fs[_0xa434('0x68')](_0xa434('0x69'),_0x1788ce);}})[_0xa434('0x1b')](function(){return respondWithRpcPromise(_0xa434('0x6a'),_0xa434('0x60'),{'module':'chan_sip.so'});})['then'](function(){var _0x388074=_0x501b9c[_0xa434('0x5b')][_0xa434('0x31')]({'plain':!![]});if(!_0x388074)throw new Error(_0xa434('0x6b'));if(_0x388074[_0xa434('0x5c')]===_0xa434('0x5b')){var _0xf346b8=_0x2d8b4c[_0xa434('0x31')]({'plain':!![]});return db['UserProfileSection'][_0xa434('0x56')]({'where':{'name':_0xa434('0x32'),'userProfileId':_0x388074[_0xa434('0x6c')]},'raw':!![]})[_0xa434('0x1b')](function(_0x448b83){if(_0x448b83&&_0x448b83[_0xa434('0x5e')]===0x0){return db[_0xa434('0x33')]['create']({'name':_0xf346b8['name'],'resourceId':_0xf346b8['id'],'type':_0x448b83[_0xa434('0x36')],'sectionId':_0x448b83['id']},{})['then'](function(){return _0x2d8b4c;});}else{return _0x2d8b4c;}})[_0xa434('0x24')](function(_0x2b26bd){logger[_0xa434('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b26bd);throw _0x2b26bd;});}return _0x2d8b4c;})[_0xa434('0x1b')](respondWithResult(_0x421ade,0xc9))[_0xa434('0x24')](handleError(_0x421ade,null));};exports[_0xa434('0x30')]=function(_0x1144db,_0x4438d9,_0x3b376b){var _0x5bf4f2;return db['Trunk'][_0xa434('0x56')]({'where':{'id':_0x1144db['params']['id']}})['then'](handleEntityNotFound(_0x4438d9,null))[_0xa434('0x1b')](saveUpdates(_0x1144db[_0xa434('0x5a')],null))[_0xa434('0x1b')](function(_0x5dea23){if(_0x5dea23){_0x5bf4f2=_0x5dea23;return db[_0xa434('0x39')]['findAll']({'raw':!![]});}})[_0xa434('0x1b')](function(_0x6be82f){if(_0x6be82f){var _0x3f9579=fs[_0xa434('0x61')](path[_0xa434('0x62')](config[_0xa434('0x63')],'server/files/templates/trunk.ejs'),_0xa434('0x65'));var _0x2496b6=fs['readFileSync'](path['join'](config['root'],_0xa434('0x66')),_0xa434('0x65'));var _0x132a49=ejs[_0xa434('0x67')](_0x3f9579,{'trunks':_0x6be82f||[]});fs[_0xa434('0x68')](_0xa434('0x6d'),_0x132a49);var _0x44c24f=ejs[_0xa434('0x67')](_0x2496b6,{'trunks':_0x6be82f||[]});fs['writeFileSync'](_0xa434('0x69'),_0x44c24f);return respondWithRpcPromise(_0xa434('0x6a'),_0xa434('0x30'),{'module':_0xa434('0x6e')});}return null;})[_0xa434('0x1b')](function(_0x33e463){if(_0x33e463){return _0x5bf4f2;}})[_0xa434('0x1b')](respondWithResult(_0x4438d9,null))['catch'](handleError(_0x4438d9,null));};exports['destroy']=function(_0x25958a,_0x479330,_0x21c14e){var _0x5f2f53;return db[_0xa434('0x39')]['find']({'where':{'id':_0x25958a[_0xa434('0x55')]['id']}})[_0xa434('0x1b')](handleEntityNotFound(_0x479330,null))[_0xa434('0x1b')](removeEntity(_0x479330,null))[_0xa434('0x1b')](function(){return db['Trunk'][_0xa434('0x53')]({'raw':!![]});})[_0xa434('0x1b')](function(_0x32d8ff){var _0x4be6ed=fs[_0xa434('0x61')](path[_0xa434('0x62')](config['root'],_0xa434('0x64')),_0xa434('0x65'));var _0x56452d=fs[_0xa434('0x61')](path[_0xa434('0x62')](config[_0xa434('0x63')],'server/files/templates/registry.ejs'),_0xa434('0x65'));var _0x1c107a=ejs[_0xa434('0x67')](_0x4be6ed,{'trunks':_0x32d8ff});var _0x1ef0eb=ejs[_0xa434('0x67')](_0x56452d,{'trunks':_0x32d8ff});fs[_0xa434('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1c107a);fs[_0xa434('0x68')](_0xa434('0x69'),_0x1ef0eb);return respondWithRpcPromise('Reload',_0xa434('0x34'),{'module':'chan_sip.so'});})[_0xa434('0x24')](handleError(_0x479330,null));}; \ No newline at end of file +var _0xbfae=['../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','limit','save','update','get','Trunks','UserProfileResource','destroy','sendStatus','name','send','map','Trunk','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','show','params','options','find','clone','include','body','omit','createdAt','updatedAt','create','user','userProfileId','autoAssociation','root','server/files/templates/trunk.ejs','utf8','readFileSync','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5ccae9,_0x32d0bf){var _0x5aaaa1=function(_0x536b04){while(--_0x536b04){_0x5ccae9['push'](_0x5ccae9['shift']());}};_0x5aaaa1(++_0x32d0bf);}(_0xbfae,0xc1));var _0xebfa=function(_0x403a8a,_0x59e1b8){_0x403a8a=_0x403a8a-0x0;var _0xc3e821=_0xbfae[_0x403a8a];return _0xc3e821;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xebfa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebfa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebfa('0x2'));var moment=require(_0xebfa('0x3'));var BPromise=require(_0xebfa('0x4'));var Mustache=require('mustache');var util=require(_0xebfa('0x5'));var path=require(_0xebfa('0x6'));var sox=require('sox');var csv=require(_0xebfa('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xebfa('0x8'));var squel=require(_0xebfa('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xebfa('0x7'));var querystring=require(_0xebfa('0xa'));var Papa=require(_0xebfa('0xb'));var Redis=require(_0xebfa('0xc'));var authService=require(_0xebfa('0xd'));var qs=require(_0xebfa('0xe'));var as=require(_0xebfa('0xf'));var hardwareService=require(_0xebfa('0x10'));var logger=require(_0xebfa('0x11'))(_0xebfa('0x12'));var utils=require(_0xebfa('0x13'));var config=require(_0xebfa('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xebfa('0x15'));var client=jayson[_0xebfa('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x3fef7c,_0x2ddd67,_0x29c18a){if(_0x29c18a){var _0x37713a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37713a['test'](_0x2ddd67)){return _0x3fef7c;}else{throw new db[(_0xebfa('0x17'))][(_0xebfa('0x18'))](_0xebfa('0x19'));}}else{return _0x3fef7c;}}function respondWithRpcPromise(_0x4ae8f3,_0x596465,_0x16cae2,_0x48371a){return new BPromise(function(_0x5290c7,_0x3a9a81){var _0x3012bc=_0x48371a||client;return _0x3012bc[_0xebfa('0x1a')](_0x4ae8f3,_0x16cae2)[_0xebfa('0x1b')](function(_0x8bf923){logger[_0xebfa('0x1c')](_0xebfa('0x1d'),_0x596465,_0xebfa('0x1e'));logger[_0xebfa('0x1f')]('Trunk,\x20%s,\x20%s,\x20%s',_0x596465,_0xebfa('0x1e'),JSON[_0xebfa('0x20')](_0x8bf923));if(_0x8bf923[_0xebfa('0x21')]){if(_0x8bf923[_0xebfa('0x21')][_0xebfa('0x22')]===0x1f4){logger[_0xebfa('0x21')](_0xebfa('0x1d'),_0x596465,_0x8bf923['error'][_0xebfa('0x23')]);return _0x3a9a81(_0x8bf923[_0xebfa('0x21')][_0xebfa('0x23')]);}logger[_0xebfa('0x21')](_0xebfa('0x1d'),_0x596465,_0x8bf923[_0xebfa('0x21')][_0xebfa('0x23')]);return _0x5290c7(_0x8bf923[_0xebfa('0x21')][_0xebfa('0x23')]);}else{logger[_0xebfa('0x1c')](_0xebfa('0x1d'),_0x596465,'request\x20sent');_0x5290c7(_0x8bf923[_0xebfa('0x24')][_0xebfa('0x23')]);}})[_0xebfa('0x25')](function(_0x16df38){logger[_0xebfa('0x21')](_0xebfa('0x1d'),_0x596465,_0x16df38);_0x3a9a81(_0x16df38);});});}function respondWithStatusCode(_0x2d8470,_0x12a2c7){_0x12a2c7=_0x12a2c7||0xcc;return function(_0x4f0782){if(_0x4f0782){return _0x2d8470['sendStatus'](_0x12a2c7);}return _0x2d8470[_0xebfa('0x26')](_0x12a2c7)[_0xebfa('0x27')]();};}function respondWithResult(_0x120f7b,_0x57619d){_0x57619d=_0x57619d||0xc8;return function(_0x593a81){if(_0x593a81){return _0x120f7b[_0xebfa('0x26')](_0x57619d)[_0xebfa('0x28')](_0x593a81);}};}function respondWithFilteredResult(_0x1aa165,_0x482f98){return function(_0x4e1058){if(_0x4e1058){var _0xb5fd40=_0x4e1058['count'],_0x38642e=_0x482f98[_0xebfa('0x29')],_0x3a25e4=_0x482f98[_0xebfa('0x29')]+_0x482f98[_0xebfa('0x2a')],_0x14b623;if(_0x3a25e4>=_0xb5fd40){_0x3a25e4=_0xb5fd40;_0x14b623=0xc8;}else{_0x14b623=0xce;}_0x1aa165[_0xebfa('0x26')](_0x14b623);return _0x1aa165['set']('Content-Range',_0x38642e+'-'+_0x3a25e4+'/'+_0xb5fd40)['json'](_0x4e1058);}return null;};}function patchUpdates(_0x510068){return function(_0x2d2993){try{jsonpatch['apply'](_0x2d2993,_0x510068,!![]);}catch(_0x366716){return BPromise['reject'](_0x366716);}return _0x2d2993[_0xebfa('0x2b')]();};}function saveUpdates(_0x145677,_0x2a450e){return function(_0x14b1dc){if(_0x14b1dc){return _0x14b1dc[_0xebfa('0x2c')](_0x145677)[_0xebfa('0x1b')](function(_0xfe1b38){return _0xfe1b38;});}return null;};}function removeEntity(_0x2ac41d,_0x2d130a){return function(_0xfe9fa){if(_0xfe9fa){return _0xfe9fa['destroy']()[_0xebfa('0x1b')](function(){var _0x24265b=_0xfe9fa[_0xebfa('0x2d')]({'plain':!![]});var _0x2eafa2=_0xebfa('0x2e');return db[_0xebfa('0x2f')][_0xebfa('0x30')]({'where':{'type':_0x2eafa2,'resourceId':_0x24265b['id']}})[_0xebfa('0x1b')](function(){return _0xfe9fa;});})[_0xebfa('0x1b')](function(){_0x2ac41d['status'](0xcc)[_0xebfa('0x27')]();});}};}function handleEntityNotFound(_0x4ecca7,_0x283e98){return function(_0xdff676){if(!_0xdff676){_0x4ecca7[_0xebfa('0x31')](0x194);}return _0xdff676;};}function handleError(_0x22a3be,_0x2483c2){_0x2483c2=_0x2483c2||0x1f4;return function(_0x59105c){logger[_0xebfa('0x21')](_0x59105c['stack']);if(_0x59105c[_0xebfa('0x32')]){delete _0x59105c['name'];}_0x22a3be['status'](_0x2483c2)[_0xebfa('0x33')](_0x59105c);};}exports['index']=function(_0x4a64a2,_0x4186f5){var _0x221d70={},_0x1aae12={},_0x4cd866={'count':0x0,'rows':[]};var _0x57d407=_[_0xebfa('0x34')](db[_0xebfa('0x35')][_0xebfa('0x36')],function(_0x428a1f){return{'name':_0x428a1f['fieldName'],'type':_0x428a1f[_0xebfa('0x37')]['key']};});_0x1aae12[_0xebfa('0x38')]=_[_0xebfa('0x34')](_0x57d407,_0xebfa('0x32'));_0x1aae12[_0xebfa('0x39')]=_[_0xebfa('0x3a')](_0x4a64a2[_0xebfa('0x39')]);_0x1aae12[_0xebfa('0x3b')]=_[_0xebfa('0x3c')](_0x1aae12[_0xebfa('0x38')],_0x1aae12[_0xebfa('0x39')]);_0x221d70[_0xebfa('0x3d')]=_[_0xebfa('0x3c')](_0x1aae12['model'],qs[_0xebfa('0x3e')](_0x4a64a2[_0xebfa('0x39')][_0xebfa('0x3e')]));_0x221d70[_0xebfa('0x3d')]=_0x221d70['attributes'][_0xebfa('0x3f')]?_0x221d70['attributes']:_0x1aae12[_0xebfa('0x38')];if(!_0x4a64a2[_0xebfa('0x39')][_0xebfa('0x40')](_0xebfa('0x41'))){_0x221d70[_0xebfa('0x2a')]=qs['limit'](_0x4a64a2[_0xebfa('0x39')][_0xebfa('0x2a')]);_0x221d70[_0xebfa('0x29')]=qs[_0xebfa('0x29')](_0x4a64a2[_0xebfa('0x39')][_0xebfa('0x29')]);}_0x221d70[_0xebfa('0x42')]=qs[_0xebfa('0x43')](_0x4a64a2[_0xebfa('0x39')][_0xebfa('0x43')]);_0x221d70[_0xebfa('0x44')]=qs[_0xebfa('0x3b')](_[_0xebfa('0x45')](_0x4a64a2['query'],_0x1aae12['filters']));if(_0x4a64a2[_0xebfa('0x39')][_0xebfa('0x46')]){_0x221d70[_0xebfa('0x44')]=_[_0xebfa('0x47')](_0x221d70[_0xebfa('0x44')],{'$or':_['map'](_0x57d407,function(_0x105dae){if(_0x105dae['type']!==_0xebfa('0x48')){var _0x1164e9={};_0x1164e9[_0x105dae[_0xebfa('0x32')]]={'$like':'%'+_0x4a64a2[_0xebfa('0x39')][_0xebfa('0x46')]+'%'};return _0x1164e9;}})});}_0x221d70=_[_0xebfa('0x47')]({},_0x221d70,_0x4a64a2['options']);var _0x32a74c={'where':_0x221d70[_0xebfa('0x44')]};return db['Trunk'][_0xebfa('0x49')](_0x32a74c)['then'](function(_0x1c1c3a){_0x4cd866[_0xebfa('0x49')]=_0x1c1c3a;if(_0x4a64a2[_0xebfa('0x39')][_0xebfa('0x4a')]){_0x221d70['include']=[{'all':!![]}];}return db[_0xebfa('0x35')][_0xebfa('0x4b')](_0x221d70);})[_0xebfa('0x1b')](function(_0x1e31fe){_0x4cd866[_0xebfa('0x4c')]=_0x1e31fe;return _0x4cd866;})[_0xebfa('0x1b')](respondWithFilteredResult(_0x4186f5,_0x221d70))[_0xebfa('0x25')](handleError(_0x4186f5,null));};exports[_0xebfa('0x4d')]=function(_0x312ada,_0x394083){var _0x492624={'raw':![],'where':{'id':_0x312ada[_0xebfa('0x4e')]['id']}},_0xb5109b={};_0xb5109b[_0xebfa('0x38')]=_['keys'](db['Trunk']['rawAttributes']);_0xb5109b[_0xebfa('0x39')]=_[_0xebfa('0x3a')](_0x312ada[_0xebfa('0x39')]);_0xb5109b[_0xebfa('0x3b')]=_[_0xebfa('0x3c')](_0xb5109b['model'],_0xb5109b[_0xebfa('0x39')]);_0x492624[_0xebfa('0x3d')]=_[_0xebfa('0x3c')](_0xb5109b[_0xebfa('0x38')],qs['fields'](_0x312ada[_0xebfa('0x39')]['fields']));_0x492624['attributes']=_0x492624['attributes'][_0xebfa('0x3f')]?_0x492624['attributes']:_0xb5109b[_0xebfa('0x38')];if(_0x312ada['query']['includeAll']){_0x492624['include']=[{'all':!![]}];}_0x492624=_[_0xebfa('0x47')]({},_0x492624,_0x312ada[_0xebfa('0x4f')]);return db[_0xebfa('0x35')][_0xebfa('0x50')](_0x492624)[_0xebfa('0x1b')](handleEntityNotFound(_0x394083,null))[_0xebfa('0x1b')](respondWithResult(_0x394083,null))[_0xebfa('0x25')](handleError(_0x394083,null));};exports[_0xebfa('0x51')]=function(_0x451022,_0x48e3a5){var _0x379502={'where':{'id':_0x451022[_0xebfa('0x4e')]['id']}},_0x3cab2d={};_0x3cab2d[_0xebfa('0x38')]=_[_0xebfa('0x3a')](db[_0xebfa('0x35')][_0xebfa('0x36')]);_0x379502[_0xebfa('0x3d')]=_['intersection'](_0x3cab2d[_0xebfa('0x38')],qs['fields'](_0x451022[_0xebfa('0x39')][_0xebfa('0x3e')]));_0x379502[_0xebfa('0x3d')]=_0x379502[_0xebfa('0x3d')][_0xebfa('0x3f')]?_0x379502[_0xebfa('0x3d')]:_0x3cab2d['model'];if(_0x451022['query'][_0xebfa('0x4a')]){_0x379502[_0xebfa('0x52')]=[{'all':!![]}];}_0x379502=_[_0xebfa('0x47')]({},_0x379502,_0x451022[_0xebfa('0x4f')]);return db[_0xebfa('0x35')][_0xebfa('0x50')](_0x379502)[_0xebfa('0x1b')](handleEntityNotFound(_0x48e3a5,null))[_0xebfa('0x1b')](function(_0x5c52de){if(_0x5c52de){var _0x256e21=_0x5c52de[_0xebfa('0x2d')]({'plain':!![]});_0x256e21=qs['omit'](_0x256e21,['id','createdAt','updatedAt']);_0x451022[_0xebfa('0x53')]=_[_0xebfa('0x54')](_0x451022[_0xebfa('0x53')],['id',_0xebfa('0x55'),_0xebfa('0x56')]);return db[_0xebfa('0x35')][_0xebfa('0x57')](_[_0xebfa('0x47')](_0x256e21,_0x451022['body']),{'include':_0x451022[_0xebfa('0x39')][_0xebfa('0x4a')]?[{'all':!![]}]:undefined})[_0xebfa('0x1b')](function(_0x14bfc0){var _0x1d85ab=_0x451022[_0xebfa('0x58')][_0xebfa('0x2d')]({'plain':!![]});if(!_0x1d85ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d85ab['role']===_0xebfa('0x58')){var _0x1454ac=_0x14bfc0['get']({'plain':!![]});var _0x54289b='Trunks';return db['UserProfileSection']['find']({'where':{'name':_0x54289b,'userProfileId':_0x1d85ab[_0xebfa('0x59')]},'raw':!![]})['then'](function(_0x25cbd1){if(_0x25cbd1&&_0x25cbd1[_0xebfa('0x5a')]===0x0){return db['UserProfileResource'][_0xebfa('0x57')]({'name':_0x1454ac[_0xebfa('0x32')],'resourceId':_0x1454ac['id'],'type':_0x25cbd1['name'],'sectionId':_0x25cbd1['id']},{})['then'](function(){return _0x14bfc0;});}else{return _0x14bfc0;}})[_0xebfa('0x25')](function(_0x46cde4){logger[_0xebfa('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46cde4);throw _0x46cde4;});}return _0x14bfc0;});}})['then'](respondWithResult(_0x48e3a5,0xc9))['catch'](handleError(_0x48e3a5,null));};exports[_0xebfa('0x57')]=function(_0xa65477,_0x27620d,_0xf8fef2){var _0x4f4b97;return db[_0xebfa('0x35')]['create'](_0xa65477[_0xebfa('0x53')],{'raw':!![]})[_0xebfa('0x1b')](function(_0x6d82f8){_0x4f4b97=_0x6d82f8;return db[_0xebfa('0x35')][_0xebfa('0x4b')]({'raw':!![]});})[_0xebfa('0x1b')](function(_0x20507d){var _0x9ade94=fs['readFileSync'](path['join'](config[_0xebfa('0x5b')],_0xebfa('0x5c')),_0xebfa('0x5d'));var _0x5209d4=fs[_0xebfa('0x5e')](path[_0xebfa('0x5f')](config[_0xebfa('0x5b')],_0xebfa('0x60')),_0xebfa('0x5d'));var _0x3b8658=ejs[_0xebfa('0x61')](_0x9ade94,{'trunks':_0x20507d||[]});fs[_0xebfa('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3b8658);if(_0x4f4b97['registry']){var _0x475647=ejs[_0xebfa('0x61')](_0x5209d4,{'trunks':_0x20507d||[]});fs[_0xebfa('0x62')](_0xebfa('0x63'),_0x475647);}})[_0xebfa('0x1b')](function(){return respondWithRpcPromise('Reload',_0xebfa('0x57'),{'module':'chan_sip.so'});})['then'](function(){var _0x39c003=_0xa65477[_0xebfa('0x58')]['get']({'plain':!![]});if(!_0x39c003)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39c003[_0xebfa('0x64')]==='user'){var _0x4a5e04=_0x4f4b97[_0xebfa('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0xebfa('0x50')]({'where':{'name':'Trunks','userProfileId':_0x39c003[_0xebfa('0x59')]},'raw':!![]})[_0xebfa('0x1b')](function(_0x2b099b){if(_0x2b099b&&_0x2b099b[_0xebfa('0x5a')]===0x0){return db[_0xebfa('0x2f')][_0xebfa('0x57')]({'name':_0x4a5e04[_0xebfa('0x32')],'resourceId':_0x4a5e04['id'],'type':_0x2b099b[_0xebfa('0x32')],'sectionId':_0x2b099b['id']},{})[_0xebfa('0x1b')](function(){return _0x4f4b97;});}else{return _0x4f4b97;}})[_0xebfa('0x25')](function(_0x289848){logger['error'](_0xebfa('0x65'),_0x289848);throw _0x289848;});}return _0x4f4b97;})[_0xebfa('0x1b')](respondWithResult(_0x27620d,0xc9))['catch'](handleError(_0x27620d,null));};exports[_0xebfa('0x2c')]=function(_0x515a6b,_0x437d99,_0x108f27){var _0x4573bb;return db[_0xebfa('0x35')]['find']({'where':{'id':_0x515a6b[_0xebfa('0x4e')]['id']}})[_0xebfa('0x1b')](handleEntityNotFound(_0x437d99,null))[_0xebfa('0x1b')](saveUpdates(_0x515a6b['body'],null))[_0xebfa('0x1b')](function(_0x35d919){if(_0x35d919){_0x4573bb=_0x35d919;return db[_0xebfa('0x35')][_0xebfa('0x4b')]({'raw':!![]});}})[_0xebfa('0x1b')](function(_0x1bb7e2){if(_0x1bb7e2){var _0x20752e=fs['readFileSync'](path[_0xebfa('0x5f')](config[_0xebfa('0x5b')],_0xebfa('0x5c')),'utf8');var _0x30a144=fs['readFileSync'](path[_0xebfa('0x5f')](config[_0xebfa('0x5b')],_0xebfa('0x60')),_0xebfa('0x5d'));var _0x4f70e3=ejs['render'](_0x20752e,{'trunks':_0x1bb7e2||[]});fs[_0xebfa('0x62')](_0xebfa('0x66'),_0x4f70e3);var _0x59b11d=ejs[_0xebfa('0x61')](_0x30a144,{'trunks':_0x1bb7e2||[]});fs[_0xebfa('0x62')](_0xebfa('0x63'),_0x59b11d);return respondWithRpcPromise(_0xebfa('0x67'),_0xebfa('0x2c'),{'module':'chan_sip.so'});}return null;})[_0xebfa('0x1b')](function(_0x3d3696){if(_0x3d3696){return _0x4573bb;}})[_0xebfa('0x1b')](respondWithResult(_0x437d99,null))[_0xebfa('0x25')](handleError(_0x437d99,null));};exports[_0xebfa('0x30')]=function(_0xd576df,_0x2f874d,_0x2b19b7){var _0x48ef2f;return db[_0xebfa('0x35')][_0xebfa('0x50')]({'where':{'id':_0xd576df[_0xebfa('0x4e')]['id']}})[_0xebfa('0x1b')](handleEntityNotFound(_0x2f874d,null))[_0xebfa('0x1b')](removeEntity(_0x2f874d,null))['then'](function(){return db[_0xebfa('0x35')][_0xebfa('0x4b')]({'raw':!![]});})['then'](function(_0x1d503e){var _0xc7517f=fs[_0xebfa('0x5e')](path['join'](config[_0xebfa('0x5b')],_0xebfa('0x5c')),_0xebfa('0x5d'));var _0x37d4d9=fs[_0xebfa('0x5e')](path[_0xebfa('0x5f')](config[_0xebfa('0x5b')],_0xebfa('0x60')),_0xebfa('0x5d'));var _0x147241=ejs['render'](_0xc7517f,{'trunks':_0x1d503e});var _0x2d56b4=ejs[_0xebfa('0x61')](_0x37d4d9,{'trunks':_0x1d503e});fs[_0xebfa('0x62')](_0xebfa('0x66'),_0x147241);fs[_0xebfa('0x62')]('/etc/asterisk/sip_xcally_registers.conf',_0x2d56b4);return respondWithRpcPromise(_0xebfa('0x67'),'destroy',{'module':_0xebfa('0x68')});})[_0xebfa('0x25')](handleError(_0x2f874d,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index e467918..b338254 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 _0x5927=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash'];(function(_0x5b3cd4,_0x3acc1a){var _0x1daac5=function(_0x373f62){while(--_0x373f62){_0x5b3cd4['push'](_0x5b3cd4['shift']());}};_0x1daac5(++_0x3acc1a);}(_0x5927,0x17f));var _0x7592=function(_0x2a9548,_0x2742f6){_0x2a9548=_0x2a9548-0x0;var _0xf55c55=_0x5927[_0x2a9548];return _0xf55c55;};'use strict';var _=require(_0x7592('0x0'));var util=require('util');var logger=require(_0x7592('0x1'))(_0x7592('0x2'));var moment=require(_0x7592('0x3'));var BPromise=require(_0x7592('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7592('0x5'));var rimraf=require(_0x7592('0x6'));var config=require(_0x7592('0x7'));var attributes=require(_0x7592('0x8'));module[_0x7592('0x9')]=function(_0x433a91,_0x3bbaa7){return _0x433a91[_0x7592('0xa')](_0x7592('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7173=['path','rimraf','../../config/environment','exports','define','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x32e69b,_0x4d0e31){var _0x27ef53=function(_0x580c9f){while(--_0x580c9f){_0x32e69b['push'](_0x32e69b['shift']());}};_0x27ef53(++_0x4d0e31);}(_0x7173,0x96));var _0x3717=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x7173[_0x16771d];return _0x386f11;};'use strict';var _=require(_0x3717('0x0'));var util=require(_0x3717('0x1'));var logger=require(_0x3717('0x2'))(_0x3717('0x3'));var moment=require(_0x3717('0x4'));var BPromise=require(_0x3717('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3717('0x6'));var rimraf=require(_0x3717('0x7'));var config=require(_0x3717('0x8'));var attributes=require('./trunk.attributes');module[_0x3717('0x9')]=function(_0x40e73e,_0x14db78){return _0x40e73e[_0x3717('0xa')]('Trunk',attributes,{'tableName':_0x3717('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index a2444a2..218bf40 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8603=['result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrunk','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x5c41b0,_0x5bbc92){var _0x365e5c=function(_0x48e666){while(--_0x48e666){_0x5c41b0['push'](_0x5c41b0['shift']());}};_0x365e5c(++_0x5bbc92);}(_0x8603,0x190));var _0x3860=function(_0x10ed05,_0x6a2997){_0x10ed05=_0x10ed05-0x0;var _0x489ad4=_0x8603[_0x10ed05];return _0x489ad4;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});}exports[_0x3860('0x12')]=function(_0x45b799){var _0x4b6b15=this;return new Promise(function(_0x4863bd,_0x373b06){return db[_0x3860('0x13')][_0x3860('0x14')]({'raw':_0x45b799['options']?_0x45b799[_0x3860('0x15')][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x17')]||null:null,'attributes':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x18')]||null:null,'limit':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x19')]||null:null,'include':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x45b799['options'][_0x3860('0x1a')],function(_0x133093){return{'model':db[_0x133093[_0x3860('0x1c')]],'as':_0x133093['as'],'attributes':_0x133093[_0x3860('0x18')],'include':_0x133093[_0x3860('0x1a')]?_['map'](_0x133093[_0x3860('0x1a')],function(_0x568515){return{'model':db[_0x568515['model']],'as':_0x568515['as'],'attributes':_0x568515[_0x3860('0x18')],'include':_0x568515[_0x3860('0x1a')]?_['map'](_0x568515['include'],function(_0x5f42d5){return{'model':db[_0x5f42d5[_0x3860('0x1c')]],'as':_0x5f42d5['as'],'attributes':_0x5f42d5[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x371f3a){logger[_0x3860('0xf')](_0x3860('0x12'),_0x45b799);logger['debug']('GetTrunk',_0x45b799,JSON[_0x3860('0x1d')](_0x371f3a));_0x4863bd(_0x371f3a);})[_0x3860('0x11')](function(_0x5a9af2){logger[_0x3860('0xd')](_0x3860('0x12'),_0x5a9af2[_0x3860('0xe')],_0x45b799);_0x373b06(_0x4b6b15[_0x3860('0xd')](0x1f4,_0x5a9af2[_0x3860('0xe')]));});});};exports['ShowTrunk']=function(_0x36ae2b){var _0xf624ba=this;return new Promise(function(_0x367b14,_0x4bd90c){return db[_0x3860('0x13')]['find']({'raw':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['where']||null:null,'attributes':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['attributes']||null:null,'include':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x36ae2b[_0x3860('0x15')][_0x3860('0x1a')],function(_0x30dc2a){return{'model':db[_0x30dc2a[_0x3860('0x1c')]],'as':_0x30dc2a['as'],'attributes':_0x30dc2a[_0x3860('0x18')],'include':_0x30dc2a['include']?_[_0x3860('0x1b')](_0x30dc2a[_0x3860('0x1a')],function(_0x4d62e9){return{'model':db[_0x4d62e9[_0x3860('0x1c')]],'as':_0x4d62e9['as'],'attributes':_0x4d62e9[_0x3860('0x18')],'include':_0x4d62e9[_0x3860('0x1a')]?_['map'](_0x4d62e9['include'],function(_0x285b1b){return{'model':db[_0x285b1b[_0x3860('0x1c')]],'as':_0x285b1b['as'],'attributes':_0x285b1b[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x59271f){logger['info'](_0x3860('0x1e'),_0x36ae2b);logger[_0x3860('0x1f')](_0x3860('0x1e'),_0x36ae2b,JSON[_0x3860('0x1d')](_0x59271f));_0x367b14(_0x59271f);})[_0x3860('0x11')](function(_0x4df2a9){logger[_0x3860('0xd')](_0x3860('0x1e'),_0x4df2a9['message'],_0x36ae2b);_0x4bd90c(_0xf624ba['error'](0x1f4,_0x4df2a9[_0x3860('0xe')]));});});}; \ No newline at end of file +var _0xda2d=['../../config/environment','jayson/promise','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetTrunk','Trunk','findAll','options','raw','attributes','include','map','model','catch','find','where','ShowTrunk','util','moment','bluebird','randomstring','ioredis','rpc'];(function(_0x219935,_0x5b7d02){var _0x130409=function(_0x56409e){while(--_0x56409e){_0x219935['push'](_0x219935['shift']());}};_0x130409(++_0x5b7d02);}(_0xda2d,0x102));var _0xdda2=function(_0x80d1d9,_0x433208){_0x80d1d9=_0x80d1d9-0x0;var _0x6546cc=_0xda2d[_0x80d1d9];return _0x6546cc;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Trunk,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}exports[_0xdda2('0x14')]=function(_0x1a3b35){var _0x335fb5=this;return new Promise(function(_0x2b6ee8,_0x8d44b7){return db[_0xdda2('0x15')][_0xdda2('0x16')]({'raw':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')][_0xdda2('0x18')]===undefined?!![]:![]:!![],'where':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['where']||null:null,'attributes':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x19')]||null:null,'limit':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['limit']||null:null,'include':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x1a3b35['options'][_0xdda2('0x1a')],function(_0xfda248){return{'model':db[_0xfda248[_0xdda2('0x1c')]],'as':_0xfda248['as'],'attributes':_0xfda248[_0xdda2('0x19')],'include':_0xfda248[_0xdda2('0x1a')]?_['map'](_0xfda248[_0xdda2('0x1a')],function(_0x4be5ea){return{'model':db[_0x4be5ea[_0xdda2('0x1c')]],'as':_0x4be5ea['as'],'attributes':_0x4be5ea[_0xdda2('0x19')],'include':_0x4be5ea['include']?_['map'](_0x4be5ea[_0xdda2('0x1a')],function(_0x4567e7){return{'model':db[_0x4567e7[_0xdda2('0x1c')]],'as':_0x4567e7['as'],'attributes':_0x4567e7['attributes']};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x5d26ae){logger[_0xdda2('0x12')](_0xdda2('0x14'),_0x1a3b35);logger[_0xdda2('0xd')](_0xdda2('0x14'),_0x1a3b35,JSON['stringify'](_0x5d26ae));_0x2b6ee8(_0x5d26ae);})[_0xdda2('0x1d')](function(_0x255bbc){logger['error'](_0xdda2('0x14'),_0x255bbc[_0xdda2('0x11')],_0x1a3b35);_0x8d44b7(_0x335fb5[_0xdda2('0x10')](0x1f4,_0x255bbc[_0xdda2('0x11')]));});});};exports['ShowTrunk']=function(_0x129eba){var _0x5e107f=this;return new Promise(function(_0x4b19b7,_0x1ca9f3){return db['Trunk'][_0xdda2('0x1e')]({'raw':_0x129eba['options']?_0x129eba['options']['raw']===undefined?!![]:![]:!![],'where':_0x129eba[_0xdda2('0x17')]?_0x129eba['options'][_0xdda2('0x1f')]||null:null,'attributes':_0x129eba['options']?_0x129eba['options']['attributes']||null:null,'include':_0x129eba[_0xdda2('0x17')]?_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')],function(_0x2bcfba){return{'model':db[_0x2bcfba[_0xdda2('0x1c')]],'as':_0x2bcfba['as'],'attributes':_0x2bcfba[_0xdda2('0x19')],'include':_0x2bcfba[_0xdda2('0x1a')]?_['map'](_0x2bcfba[_0xdda2('0x1a')],function(_0x4212da){return{'model':db[_0x4212da[_0xdda2('0x1c')]],'as':_0x4212da['as'],'attributes':_0x4212da[_0xdda2('0x19')],'include':_0x4212da[_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x4212da[_0xdda2('0x1a')],function(_0x5835cd){return{'model':db[_0x5835cd['model']],'as':_0x5835cd['as'],'attributes':_0x5835cd[_0xdda2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x40eb19){logger['info']('ShowTrunk',_0x129eba);logger[_0xdda2('0xd')](_0xdda2('0x20'),_0x129eba,JSON[_0xdda2('0xf')](_0x40eb19));_0x4b19b7(_0x40eb19);})[_0xdda2('0x1d')](function(_0x246001){logger['error'](_0xdda2('0x20'),_0x246001[_0xdda2('0x11')],_0x129eba);_0x1ca9f3(_0x5e107f['error'](0x1f4,_0x246001['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index f2cd478..b7bdb3a 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 _0xdb28=['/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','/:id','update','put','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','describe','get','/whoami','whoami','show','getAvatar','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/teams','getTeams','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getScheduledCalls','getApiKey','post','bulkCreate','/:id/contacts','addContacts','create','addQueues','diskStorage','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','login'];(function(_0x2ab06e,_0x299cb8){var _0x4f107b=function(_0x5d7d69){while(--_0x5d7d69){_0x2ab06e['push'](_0x2ab06e['shift']());}};_0x4f107b(++_0x299cb8);}(_0xdb28,0x106));var _0x8db2=function(_0x20c09c,_0xbc25aa){_0x20c09c=_0x20c09c-0x0;var _0x30e872=_0xdb28[_0x20c09c];return _0x30e872;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/describe',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xc')]('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xf')]);router[_0x8db2('0xc')]('/:id/avatar',controller[_0x8db2('0x10')]);router[_0x8db2('0xc')]('/:id/contacts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x11')]);router[_0x8db2('0xc')](_0x8db2('0x12'),auth[_0x8db2('0x9')](),controller['getQueues']);router['get'](_0x8db2('0x13'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x14')]);router[_0x8db2('0xc')](_0x8db2('0x15'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x16')]);router[_0x8db2('0xc')](_0x8db2('0x17'),auth[_0x8db2('0x9')](),controller['getRecordings']);router[_0x8db2('0xc')](_0x8db2('0x18'),auth['isAuthenticated'](),controller[_0x8db2('0x19')]);router[_0x8db2('0xc')](_0x8db2('0x1a'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1b')]);router[_0x8db2('0xc')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x8db2('0x1c')]);router[_0x8db2('0xc')](_0x8db2('0x1d'),auth[_0x8db2('0x9')](),controller['getMailInteractions']);router[_0x8db2('0xc')](_0x8db2('0x1e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1f')]);router[_0x8db2('0xc')]('/:id/fax/interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x20')]);router[_0x8db2('0xc')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x22')]);router[_0x8db2('0xc')]('/:id/lists',auth[_0x8db2('0x9')](),controller['getLists']);router['get']('/:id/agents',auth['isAuthenticated'](),controller[_0x8db2('0x23')]);router[_0x8db2('0xc')](_0x8db2('0x24'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x25')]);router[_0x8db2('0xc')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x26')]);router[_0x8db2('0xc')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x28')]);router[_0x8db2('0xc')](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2a')]);router[_0x8db2('0xc')](_0x8db2('0x2b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2c')]);router['get'](_0x8db2('0x2d'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x8db2('0xc')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller['getSquareProjects']);router[_0x8db2('0xc')]('/:id/scheduled_calls',auth[_0x8db2('0x9')](),controller[_0x8db2('0x2f')]);router[_0x8db2('0xc')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x8db2('0x30')]);router[_0x8db2('0x31')]('/create_many',auth['isAuthenticated'](),controller[_0x8db2('0x32')]);router[_0x8db2('0x31')](_0x8db2('0x33'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x34')]);router[_0x8db2('0x31')]('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0x35')]);router[_0x8db2('0x31')](_0x8db2('0x12'),auth['isAuthenticated'](),controller[_0x8db2('0x36')]);var upload=multer({'storage':multer[_0x8db2('0x37')]({'destination':function(_0x5d2a5b,_0x41594c,_0x3ca80b){_0x3ca80b(null,path['join'](config['root'],_0x8db2('0x38')));},'filename':function(_0x4a45dd,_0x3dfbaa,_0x264696){_0x264696(null,util[_0x8db2('0x39')](_0x8db2('0x3a'),Date['now'](),_0x3dfbaa[_0x8db2('0x3b')]));}})});router['post'](_0x8db2('0x3c'),upload[_0x8db2('0x3d')](_0x8db2('0x3e')),controller[_0x8db2('0x3f')]);router['post']('/:id/login',auth[_0x8db2('0x9')](),controller[_0x8db2('0x40')]);router['post'](_0x8db2('0x41'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x42')]);router['post'](_0x8db2('0x43'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x44')]);router[_0x8db2('0x31')](_0x8db2('0x45'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x46')]);router[_0x8db2('0x31')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x47')]);router[_0x8db2('0x31')](_0x8db2('0x48'),auth['isAuthenticated'](),controller[_0x8db2('0x49')]);router[_0x8db2('0x31')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x8db2('0x4a')]);router['post'](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4c')]);router[_0x8db2('0x31')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4e')]);router['post'](_0x8db2('0x4f'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x50')]);router[_0x8db2('0x31')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x51')]);router[_0x8db2('0x31')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x52')]);router['post'](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x53')]);router['post']('/:id/sms_accounts',auth[_0x8db2('0x9')](),controller['addSmsAccounts']);router[_0x8db2('0x31')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x54')]);router[_0x8db2('0x31')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x55')]);router[_0x8db2('0x31')](_0x8db2('0x56'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x57')]);router['put'](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x59')]);router[_0x8db2('0x5a')]('/:id/password',auth['isAuthenticated'](),controller[_0x8db2('0x5b')]);router[_0x8db2('0x5c')](_0x8db2('0x12'),auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5d')]);router[_0x8db2('0x5c')](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5e')]);router['delete']('/:id/chat_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x5f')]);router[_0x8db2('0x5c')](_0x8db2('0x60'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x61')]);router[_0x8db2('0x5c')](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x62')]);router[_0x8db2('0x5c')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x63')]);router[_0x8db2('0x5c')]('/:id/openchannel_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x64')]);router['delete'](_0x8db2('0x65'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x66')]);router['delete'](_0x8db2('0x27'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x67')]);router[_0x8db2('0x5c')](_0x8db2('0x29'),auth['isAuthenticated'](),controller[_0x8db2('0x68')]);router[_0x8db2('0x5c')](_0x8db2('0x2b'),auth['isAuthenticated'](),controller[_0x8db2('0x69')]);router[_0x8db2('0x5c')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x6a')]);router[_0x8db2('0x5c')](_0x8db2('0x2e'),auth['isAuthenticated'](),controller[_0x8db2('0x6b')]);router[_0x8db2('0x5c')]('/:id/api_key',auth[_0x8db2('0x9')](),controller[_0x8db2('0x6c')]);module['exports']=router; \ No newline at end of file +var _0x7a54=['getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','/create_many','post','addContacts','create','addQueues','join','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','addAvatar','login','logout','/:id/pause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','describe','/whoami','/:id','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings'];(function(_0x1e76c5,_0x3ec9e7){var _0x5dd2de=function(_0x823de){while(--_0x823de){_0x1e76c5['push'](_0x1e76c5['shift']());}};_0x5dd2de(++_0x3ec9e7);}(_0x7a54,0x106));var _0x47a5=function(_0x5bcaaa,_0x3c1bf4){_0x5bcaaa=_0x5bcaaa-0x0;var _0x1a1fbf=_0x7a54[_0x5bcaaa];return _0x1a1fbf;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['whoami']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x47a5('0x8')](_0x47a5('0xd'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);router[_0x47a5('0x8')](_0x47a5('0xf'),auth[_0x47a5('0x9')](),controller['getQueues']);router[_0x47a5('0x8')](_0x47a5('0x10'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x8')](_0x47a5('0x12'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x13')]);router['get'](_0x47a5('0x14'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x15')]);router[_0x47a5('0x8')](_0x47a5('0x16'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x47a5('0x8')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x47a5('0x17')]);router[_0x47a5('0x8')](_0x47a5('0x18'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x19')]);router[_0x47a5('0x8')](_0x47a5('0x1a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x1b')]);router['get'](_0x47a5('0x1c'),auth[_0x47a5('0x9')](),controller['getSmsInteractions']);router[_0x47a5('0x8')](_0x47a5('0x1d'),auth[_0x47a5('0x9')](),controller['getFaxInteractions']);router[_0x47a5('0x8')](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x1f')]);router['get'](_0x47a5('0x20'),auth[_0x47a5('0x9')](),controller['getLists']);router[_0x47a5('0x8')](_0x47a5('0x21'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x22')]);router[_0x47a5('0x8')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x47a5('0x23')]);router['get'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router[_0x47a5('0x8')](_0x47a5('0x26'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x27')]);router[_0x47a5('0x8')](_0x47a5('0x28'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x29')]);router[_0x47a5('0x8')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x2b')]);router['get'](_0x47a5('0x2c'),auth['isAuthenticated'](),controller[_0x47a5('0x2d')]);router[_0x47a5('0x8')](_0x47a5('0x2e'),auth['isAuthenticated'](),controller[_0x47a5('0x2f')]);router[_0x47a5('0x8')](_0x47a5('0x30'),auth[_0x47a5('0x9')](),controller['getScheduledCalls']);router['get'](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller['getApiKey']);router['post'](_0x47a5('0x32'),auth[_0x47a5('0x9')](),controller['bulkCreate']);router[_0x47a5('0x33')]('/:id/contacts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x34')]);router['post']('/',auth['isAuthenticated'](),controller[_0x47a5('0x35')]);router['post'](_0x47a5('0xf'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x18f7e9,_0x50c086,_0x53c754){_0x53c754(null,path[_0x47a5('0x37')](config['root'],_0x47a5('0x38')));},'filename':function(_0x5ef577,_0x21ad34,_0x3534cb){_0x3534cb(null,util[_0x47a5('0x39')](_0x47a5('0x3a'),Date[_0x47a5('0x3b')](),_0x21ad34[_0x47a5('0x3c')]));}})});router[_0x47a5('0x33')](_0x47a5('0x3d'),upload[_0x47a5('0x3e')]('file'),controller[_0x47a5('0x3f')]);router[_0x47a5('0x33')]('/:id/login',auth[_0x47a5('0x9')](),controller[_0x47a5('0x40')]);router[_0x47a5('0x33')]('/:id/logout',auth[_0x47a5('0x9')](),controller[_0x47a5('0x41')]);router['post'](_0x47a5('0x42'),auth[_0x47a5('0x9')](),controller['pause']);router['post']('/:id/unpause',auth[_0x47a5('0x9')](),controller['unpause']);router[_0x47a5('0x33')](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x43')]);router[_0x47a5('0x33')](_0x47a5('0x44'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x45')]);router[_0x47a5('0x33')](_0x47a5('0x46'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x47')]);router[_0x47a5('0x33')]('/:id/fax_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x48')]);router[_0x47a5('0x33')](_0x47a5('0x49'),auth['isAuthenticated'](),controller[_0x47a5('0x4a')]);router['post']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x47a5('0x33')]('/:id/fax_accounts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x4b')]);router[_0x47a5('0x33')]('/:id/mail_accounts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x4c')]);router['post']('/:id/openchannel_accounts',auth[_0x47a5('0x9')](),controller['addOpenchannelAccounts']);router[_0x47a5('0x33')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4d')]);router[_0x47a5('0x33')](_0x47a5('0x2c'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4e')]);router[_0x47a5('0x33')](_0x47a5('0x2e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4f')]);router[_0x47a5('0x33')](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x50')]);router['put'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router['put'](_0x47a5('0x51'),auth['isAuthenticated'](),controller[_0x47a5('0x52')]);router[_0x47a5('0x53')]('/:id/queues',auth['isAuthenticated'](),controller[_0x47a5('0x54')]);router['delete'](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x55')]);router[_0x47a5('0x53')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x56')]);router['delete']('/:id/chat_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x57')]);router[_0x47a5('0x53')](_0x47a5('0x46'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x58')]);router[_0x47a5('0x53')]('/:id/fax_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x59')]);router[_0x47a5('0x53')]('/:id/sms_interactions',auth[_0x47a5('0x9')](),controller['removeSmsInteractions']);router[_0x47a5('0x53')](_0x47a5('0x5a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5b')]);router['delete'](_0x47a5('0x24'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5c')]);router[_0x47a5('0x53')](_0x47a5('0x26'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5d')]);router['delete'](_0x47a5('0x28'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5e')]);router[_0x47a5('0x53')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller['removeSmsAccounts']);router[_0x47a5('0x53')](_0x47a5('0x2c'),auth[_0x47a5('0x9')](),controller['removeChatWebsites']);router[_0x47a5('0x53')](_0x47a5('0x2e'),auth[_0x47a5('0x9')](),controller['removeSquareProjects']);router['delete'](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index a138c2f..97b0e24 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x54e054,_0x456e5b){var _0x40d14a=function(_0x581106){while(--_0x581106){_0x54e054['push'](_0x54e054['shift']());}};_0x40d14a(++_0x456e5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x2b1e9a,_0x44d00e){var _0x814578=function(_0x4acdb2){while(--_0x4acdb2){_0x2b1e9a['push'](_0x2b1e9a['shift']());}};_0x814578(++_0x44d00e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 274a687..9e3e588 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 _0x8374=['$overlap','$contains','$any','CmHopper','firstName','lastName','phone','Contact','rows','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','socket.io-emitter','./user.socket','register','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','User,\x20%s,\x20%s','catch','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','get','user','Agents','Telephones','filter','ignore','map','value','includes','role','find','name','destroy','stack','send','User','fieldName','type','key','differenceBy','password','salt','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','sequelize','lower','col','options','includeAll','include','findAll','show','rawAttributes','bulkCreate','body','params','describe','addContacts','ids','omit','agent\x20role','telephone','../../config/license/util','users','isNil','License\x20limit\x20reached','format','create','internal','Setting','findById','securePassword','min_internal','max','QueryTypes','SELECT','from','voicemail','mailbox','fullname','email','agent','permissions','101','102','103','106','107','108','109','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','online','loginInPause','voicePause','interface','add','toLowerCase','Queues','spread','capitalize','emit','Queue:save','VoiceQueue','voice','push','SIP/%s','penalty','each','removeQueues','isValidChannel','Unknown\x20channel','QueueId','Queue:remove','addAvatar','userpic','getAvatar','join','server/files/images/logos/default_profile.png','existsSync','root','server/files/images/','getContacts','CmContact','CmList','List','Tag','tag','getQueues','admin','Queue','Unknown\x20role','getVoiceQueuesRt','UserVoiceQueueRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','login','LOCAL/%s@from-sip/n','user:%s','user:forcelogout','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','all','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','LOGININPAUSE','concat','isMiddleware','logout','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','chat','manual','set','Pause','getTeams','Team','addTeams','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','Sms','getFaxQueues','getOpenchannelQueues','flatten','getDataValue','removeTeams','getChatQueues','Fax','transaction','removeAgent','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','$or','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$like'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8374,0x174));var _0x4837=function(_0x372b6b,_0x3a77ec){_0x372b6b=_0x372b6b-0x0;var _0x782c32=_0x8374[_0x372b6b];return _0x782c32;};'use strict';var pdf=require(_0x4837('0x0'));var emlformat=require(_0x4837('0x1'));var rimraf=require(_0x4837('0x2'));var zipdir=require(_0x4837('0x3'));var jsonpatch=require(_0x4837('0x4'));var rp=require(_0x4837('0x5'));var moment=require(_0x4837('0x6'));var BPromise=require(_0x4837('0x7'));var Mustache=require(_0x4837('0x8'));var util=require(_0x4837('0x9'));var path=require(_0x4837('0xa'));var sox=require(_0x4837('0xb'));var csv=require(_0x4837('0xc'));var ejs=require(_0x4837('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4837('0xe'));var crypto=require('crypto');var jsforce=require(_0x4837('0xf'));var deskjs=require(_0x4837('0x10'));var toCsv=require(_0x4837('0xc'));var querystring=require(_0x4837('0x11'));var Papa=require(_0x4837('0x12'));var Redis=require(_0x4837('0x13'));var authService=require(_0x4837('0x14'));var qs=require(_0x4837('0x15'));var as=require(_0x4837('0x16'));var hardwareService=require(_0x4837('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x4837('0x18'));var config=require('../../config/environment');var db=require(_0x4837('0x19'))['db'];config[_0x4837('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4837('0x1b'))(new Redis(config[_0x4837('0x1a')]));require(_0x4837('0x1c'))[_0x4837('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4837('0x1e')][_0x4837('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x39e5f6,_0x52a82c,_0x1685ee){if(_0x1685ee){var _0xae4f01=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xae4f01['test'](_0x52a82c)){return _0x39e5f6;}else{throw new db[(_0x4837('0x20'))][(_0x4837('0x21'))](_0x4837('0x22'));}}else{return _0x39e5f6;}}function respondWithRpcPromise(_0x5fdddc,_0x27460b,_0x2505ce,_0x48b61b){return new BPromise(function(_0xf21681,_0x1cb24a){var _0x427171=_0x48b61b||client;return _0x427171[_0x4837('0x23')](_0x5fdddc,_0x2505ce)[_0x4837('0x24')](function(_0x2c1ddf){logger[_0x4837('0x25')]('User,\x20%s,\x20%s',_0x27460b,'request\x20sent');logger[_0x4837('0x26')](_0x4837('0x27'),_0x27460b,_0x4837('0x28'),JSON[_0x4837('0x29')](_0x2c1ddf));if(_0x2c1ddf['error']){if(_0x2c1ddf[_0x4837('0x2a')]['code']===0x1f4){logger[_0x4837('0x2a')]('User,\x20%s,\x20%s',_0x27460b,_0x2c1ddf['error'][_0x4837('0x2b')]);return _0x1cb24a(_0x2c1ddf['error']['message']);}logger['error'](_0x4837('0x2c'),_0x27460b,_0x2c1ddf[_0x4837('0x2a')]['message']);return _0xf21681(_0x2c1ddf[_0x4837('0x2a')][_0x4837('0x2b')]);}else{logger['info'](_0x4837('0x2c'),_0x27460b,_0x4837('0x28'));_0xf21681(_0x2c1ddf['result'][_0x4837('0x2b')]);}})[_0x4837('0x2d')](function(_0x1a8871){logger[_0x4837('0x2a')](_0x4837('0x2c'),_0x27460b,_0x1a8871);_0x1cb24a(_0x1a8871);});});}function respondWithStatusCode(_0x5c07db,_0x2a7dfd){_0x2a7dfd=_0x2a7dfd||0xcc;return function(_0x153bc7){if(_0x153bc7){return _0x5c07db[_0x4837('0x2e')](_0x2a7dfd);}return _0x5c07db[_0x4837('0x2f')](_0x2a7dfd)[_0x4837('0x30')]();};}function respondWithResult(_0x17266c,_0x215858){_0x215858=_0x215858||0xc8;return function(_0x107a5f){if(_0x107a5f){return _0x17266c['status'](_0x215858)[_0x4837('0x31')](_0x107a5f);}};}function respondWithFilteredResult(_0x35c602,_0x141bbc){return function(_0x2da6bf){if(_0x2da6bf){var _0x594039=_0x2da6bf[_0x4837('0x32')],_0x18c7a7=_0x141bbc['offset'],_0xf3e0d7=_0x141bbc[_0x4837('0x33')]+_0x141bbc['limit'],_0x139e3c;if(_0xf3e0d7>=_0x594039){_0xf3e0d7=_0x594039;_0x139e3c=0xc8;}else{_0x139e3c=0xce;}_0x35c602[_0x4837('0x2f')](_0x139e3c);return _0x35c602['set'](_0x4837('0x34'),_0x18c7a7+'-'+_0xf3e0d7+'/'+_0x594039)[_0x4837('0x31')](_0x2da6bf);}return null;};}function patchUpdates(_0x2af464){return function(_0x540248){try{jsonpatch['apply'](_0x540248,_0x2af464,!![]);}catch(_0x43bdb3){return BPromise[_0x4837('0x35')](_0x43bdb3);}return _0x540248[_0x4837('0x36')]();};}function saveUpdates(_0x2daa7e,_0x6bb833){return function(_0x5ba853){if(_0x5ba853){return _0x5ba853[_0x4837('0x37')](_0x2daa7e)[_0x4837('0x24')](function(_0x5695a1){return _0x5695a1;});}return null;};}function removeEntity(_0x611a87,_0x5388ec){return function(_0x35c4e5){if(_0x35c4e5){return _0x35c4e5['destroy']()['then'](function(){var _0x449e7b=_0x35c4e5[_0x4837('0x38')]({'plain':!![]});var _0x104f77=[{'name':'Users','value':_0x4837('0x39'),'ignore':!![]},{'name':_0x4837('0x3a'),'value':'agent','ignore':![]},{'name':_0x4837('0x3b'),'value':'telephone','ignore':![]}];var _0x1d422d=_(_0x104f77)[_0x4837('0x3c')](_0x4837('0x3d'))[_0x4837('0x3e')]('value')[_0x4837('0x3f')]();if(_[_0x4837('0x40')](_0x1d422d,_0x449e7b[_0x4837('0x41')])){return;}var _0x285b48=_[_0x4837('0x42')](_0x104f77,[_0x4837('0x3f'),_0x449e7b['role']])[_0x4837('0x43')];return db['UserProfileResource'][_0x4837('0x44')]({'where':{'type':_0x285b48,'resourceId':_0x449e7b['id']}})[_0x4837('0x24')](function(){return _0x35c4e5;});})['then'](function(){_0x611a87['status'](0xcc)[_0x4837('0x30')]();});}};}function handleEntityNotFound(_0x4a03dd,_0x475562){return function(_0x24c14a){if(!_0x24c14a){_0x4a03dd[_0x4837('0x2e')](0x194);}return _0x24c14a;};}function handleError(_0x2d70c3,_0x179141){_0x179141=_0x179141||0x1f4;return function(_0xb44dd){logger[_0x4837('0x2a')](_0xb44dd[_0x4837('0x45')]);if(_0xb44dd[_0x4837('0x43')]){delete _0xb44dd[_0x4837('0x43')];}_0x2d70c3[_0x4837('0x2f')](_0x179141)[_0x4837('0x46')](_0xb44dd);};}exports['index']=function(_0x5059ce,_0x346fe8){var _0x10d3d0={},_0x4d2b7e={},_0x5eeb09={'count':0x0,'rows':[]};var _0x5a287c=_['map'](db[_0x4837('0x47')]['rawAttributes'],function(_0x5409e4){return{'name':_0x5409e4[_0x4837('0x48')],'type':_0x5409e4[_0x4837('0x49')][_0x4837('0x4a')]};});_0x4d2b7e['model']=_[_0x4837('0x4b')](_[_0x4837('0x3e')](_0x5a287c,'name'),[_0x4837('0x4c'),_0x4837('0x4d')]);_0x4d2b7e[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x5059ce[_0x4837('0x4e')]);_0x4d2b7e[_0x4837('0x50')]=_[_0x4837('0x51')](_0x4d2b7e[_0x4837('0x52')],_0x4d2b7e[_0x4837('0x4e')]);_0x10d3d0[_0x4837('0x53')]=_[_0x4837('0x51')](_0x4d2b7e[_0x4837('0x52')],qs[_0x4837('0x54')](_0x5059ce[_0x4837('0x4e')][_0x4837('0x54')]));_0x10d3d0['attributes']=_0x10d3d0[_0x4837('0x53')][_0x4837('0x55')]?_0x10d3d0[_0x4837('0x53')]:_0x4d2b7e[_0x4837('0x52')];if(!_0x5059ce['query'][_0x4837('0x56')](_0x4837('0x57'))){_0x10d3d0['limit']=qs['limit'](_0x5059ce[_0x4837('0x4e')][_0x4837('0x58')]);_0x10d3d0[_0x4837('0x33')]=qs['offset'](_0x5059ce[_0x4837('0x4e')][_0x4837('0x33')]);}_0x10d3d0[_0x4837('0x59')]=qs[_0x4837('0x5a')](_0x5059ce[_0x4837('0x4e')][_0x4837('0x5a')]);_0x10d3d0[_0x4837('0x5b')]=qs[_0x4837('0x50')](_[_0x4837('0x5c')](_0x5059ce['query'],_0x4d2b7e['filters']));if(_0x5059ce[_0x4837('0x4e')]['filter']){_0x10d3d0[_0x4837('0x5b')]=_[_0x4837('0x5d')](_0x10d3d0[_0x4837('0x5b')],{'$or':_[_0x4837('0x3e')](_0x5a287c,function(_0x32384d){if(_0x32384d[_0x4837('0x49')]!=='VIRTUAL'){return db[_0x4837('0x5e')][_0x4837('0x5b')](db[_0x4837('0x5e')]['fn'](_0x4837('0x5f'),db['sequelize'][_0x4837('0x60')](_0x32384d[_0x4837('0x43')])),{'$like':db[_0x4837('0x5e')]['fn'](_0x4837('0x5f'),'%'+_0x5059ce[_0x4837('0x4e')][_0x4837('0x3c')]+'%')});}})});}_0x10d3d0=_['merge']({},_0x10d3d0,_0x5059ce[_0x4837('0x61')]);var _0xded8da={'where':_0x10d3d0['where']};return db[_0x4837('0x47')][_0x4837('0x32')](_0xded8da)[_0x4837('0x24')](function(_0x2ac8be){_0x5eeb09['count']=_0x2ac8be;if(_0x5059ce[_0x4837('0x4e')][_0x4837('0x62')]){_0x10d3d0[_0x4837('0x63')]=[{'all':!![]}];}return db[_0x4837('0x47')][_0x4837('0x64')](_0x10d3d0);})[_0x4837('0x24')](function(_0x3e1e4e){_0x5eeb09['rows']=_0x3e1e4e;return _0x5eeb09;})[_0x4837('0x24')](respondWithFilteredResult(_0x346fe8,_0x10d3d0))[_0x4837('0x2d')](handleError(_0x346fe8,null));};exports[_0x4837('0x65')]=function(_0x2bc50d,_0x406b89){var _0x289c4f={'raw':![],'where':{'id':_0x2bc50d['params']['id']}},_0x2ce30e={};_0x2ce30e[_0x4837('0x52')]=_[_0x4837('0x4b')](_[_0x4837('0x4f')](db[_0x4837('0x47')][_0x4837('0x66')]),[_0x4837('0x4c'),_0x4837('0x4d')]);_0x2ce30e[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x2bc50d[_0x4837('0x4e')]);_0x2ce30e[_0x4837('0x50')]=_[_0x4837('0x51')](_0x2ce30e[_0x4837('0x52')],_0x2ce30e[_0x4837('0x4e')]);_0x289c4f[_0x4837('0x53')]=_[_0x4837('0x51')](_0x2ce30e['model'],qs[_0x4837('0x54')](_0x2bc50d[_0x4837('0x4e')][_0x4837('0x54')]));_0x289c4f['attributes']=_0x289c4f[_0x4837('0x53')][_0x4837('0x55')]?_0x289c4f['attributes']:_0x2ce30e[_0x4837('0x52')];if(_0x2bc50d[_0x4837('0x4e')]['includeAll']){_0x289c4f[_0x4837('0x63')]=[{'all':!![]}];}_0x289c4f=_[_0x4837('0x5d')]({},_0x289c4f,_0x2bc50d['options']);return db[_0x4837('0x47')][_0x4837('0x42')](_0x289c4f)[_0x4837('0x24')](handleEntityNotFound(_0x406b89,null))[_0x4837('0x24')](respondWithResult(_0x406b89,null))[_0x4837('0x2d')](handleError(_0x406b89,null));};exports['bulkCreate']=function(_0x2ea7b8,_0x8d1722){return db[_0x4837('0x47')][_0x4837('0x67')](_0x2ea7b8[_0x4837('0x68')],{'raw':![],'individualHooks':!![]})[_0x4837('0x24')](respondWithResult(_0x8d1722,0xc9))[_0x4837('0x2d')](handleError(_0x8d1722,null));};exports[_0x4837('0x37')]=function(_0x136a04,_0x3514ee){if(_0x136a04[_0x4837('0x68')]['id']){delete _0x136a04[_0x4837('0x68')]['id'];}delete _0x136a04[_0x4837('0x68')][_0x4837('0x41')];return db['User'][_0x4837('0x42')]({'where':{'id':_0x136a04[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x3514ee,null))[_0x4837('0x24')](saveUpdates(_0x136a04[_0x4837('0x68')],null))['then'](respondWithResult(_0x3514ee,null))[_0x4837('0x2d')](handleError(_0x3514ee,null));};exports[_0x4837('0x6a')]=function(_0x14baac,_0xd74716){return db['User'][_0x4837('0x6a')]()['then'](respondWithResult(_0xd74716,null))[_0x4837('0x2d')](handleError(_0xd74716,null));};exports[_0x4837('0x6b')]=function(_0x390922,_0x2cade7,_0x14728){return db[_0x4837('0x47')][_0x4837('0x42')]({'where':{'id':_0x390922[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x2cade7,null))[_0x4837('0x24')](function(_0x44c294){if(_0x44c294){return _0x44c294[_0x4837('0x6b')](_0x390922[_0x4837('0x68')][_0x4837('0x6c')],_[_0x4837('0x6d')](_0x390922[_0x4837('0x68')],[_0x4837('0x6c'),'id'])||{});}})[_0x4837('0x24')](respondWithResult(_0x2cade7,null))[_0x4837('0x2d')](handleError(_0x2cade7,null));};var getLicense=function(_0x48c98b){return new BPromise(function(_0x194152,_0xc1b9fd){var _0x2e45ea=0x0;_0x48c98b[_0x4837('0x68')][_0x4837('0x41')]==='agent'&&_0x194152(_0x4837('0x6e'));return db[_0x4837('0x47')]['count']({'where':{'$or':[{'role':_0x48c98b['body']['role']===_0x4837('0x6f')?_0x4837('0x6f'):['admin',_0x4837('0x39')]}]}})[_0x4837('0x24')](function(_0x56e957){_0x2e45ea=_0x56e957;return require(_0x4837('0x70'))['getLicense']();})[_0x4837('0x24')](function(_0x3a4bc4){var _0x5aa178=_0x48c98b['body'][_0x4837('0x41')]===_0x4837('0x6f')?'telephones':_0x4837('0x71');if(!_[_0x4837('0x72')](_0x3a4bc4[_0x5aa178])&&_0x2e45ea>=_0x3a4bc4[_0x5aa178]){return _0xc1b9fd({'message':_0x4837('0x73')});}return _0x194152(util[_0x4837('0x74')]('count\x20%s:\x20%s',_0x5aa178,_0x2e45ea));})[_0x4837('0x2d')](function(_0x21e5dc){return _0xc1b9fd(_0x21e5dc);});});};exports[_0x4837('0x75')]=function(_0x2f4ff1,_0x119716){return getLicense(_0x2f4ff1)[_0x4837('0x24')](function(_0x203e1e){if(!_0x2f4ff1[_0x4837('0x68')][_0x4837('0x76')]){var _0x19cd84;return db[_0x4837('0x77')][_0x4837('0x78')](0x1)['then'](function(_0x27400d){return checkPasswordPattern(_0x27400d,_0x2f4ff1[_0x4837('0x68')][_0x4837('0x4c')],_0x27400d[_0x4837('0x79')]);})[_0x4837('0x24')](function(_0x4001d4){_0x19cd84=_0x4001d4[_0x4837('0x7a')];return db[_0x4837('0x47')][_0x4837('0x7b')](_0x4837('0x76'));})['then'](function(_0xf80220){if(_[_0x4837('0x72')](_0xf80220)){if(_0x19cd84){_0x2f4ff1[_0x4837('0x68')]['internal']=_0x19cd84;}else{_0x2f4ff1[_0x4837('0x68')][_0x4837('0x76')]=0x1;}}else{if(_[_0x4837('0x72')](_0x19cd84)||_0x19cd84==_0xf80220){_0x2f4ff1[_0x4837('0x68')][_0x4837('0x76')]=_0xf80220+0x1;}else if(_0x19cd84>_0xf80220){_0x2f4ff1['body'][_0x4837('0x76')]=_0x19cd84;}else{return db[_0x4837('0x5e')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x4837('0x5e')][_0x4837('0x7c')][_0x4837('0x7d')]})['then'](function(_0x42ae23){if(_0x42ae23&&_0x42ae23[_0x4837('0x55')]){for(var _0x4314fe=0x0,_0x5b7504=_0x42ae23['length'];_0x4314fe<_0x5b7504&&_['isNil'](_0x2f4ff1[_0x4837('0x68')][_0x4837('0x76')]);_0x4314fe++){if(_0x19cd84<=_0x42ae23[_0x4314fe][_0x4837('0x7e')]){_0x2f4ff1['body'][_0x4837('0x76')]=_0x42ae23[_0x4314fe][_0x4837('0x7e')];}else if(_0x19cd84>_0x42ae23[_0x4314fe][_0x4837('0x7e')]&&_0x19cd84<=_0x42ae23[_0x4314fe]['to']){_0x2f4ff1[_0x4837('0x68')]['internal']=_0x19cd84;}}}if(_[_0x4837('0x72')](_0x2f4ff1[_0x4837('0x68')][_0x4837('0x76')])){_0x2f4ff1[_0x4837('0x68')][_0x4837('0x76')]=_0xf80220+0x1;}});}}});}})[_0x4837('0x24')](function(){if(_0x2f4ff1[_0x4837('0x68')][_0x4837('0x7f')]){_0x2f4ff1['body'][_0x4837('0x80')]=_0x2f4ff1[_0x4837('0x68')][_0x4837('0x76')];_0x2f4ff1[_0x4837('0x68')]['VoiceMail']={'mailbox':_0x2f4ff1[_0x4837('0x68')]['internal'],'password':_0x2f4ff1[_0x4837('0x68')][_0x4837('0x4c')],'fullname':_0x2f4ff1[_0x4837('0x68')][_0x4837('0x81')],'email':_0x2f4ff1['body'][_0x4837('0x82')]};}if(_0x2f4ff1[_0x4837('0x68')]&&_0x2f4ff1[_0x4837('0x68')][_0x4837('0x41')]===_0x4837('0x83')){_0x2f4ff1[_0x4837('0x68')][_0x4837('0x84')]=[_0x4837('0x85'),_0x4837('0x86'),_0x4837('0x87'),'110','104','105',_0x4837('0x88'),_0x4837('0x89'),_0x4837('0x8a'),_0x4837('0x8b'),'100','111'];}return db[_0x4837('0x47')][_0x4837('0x75')](_0x2f4ff1[_0x4837('0x68')],{'include':[{'model':db[_0x4837('0x8c')],'as':'VoiceMail'}]});})[_0x4837('0x24')](function(_0x216dfa){if(_0x2f4ff1[_0x4837('0x68')]['role']===_0x4837('0x39'))return _0x216dfa;var _0x1e1bde=_0x2f4ff1[_0x4837('0x39')][_0x4837('0x38')]({'plain':!![]});if(!_0x1e1bde)throw new Error(_0x4837('0x8d'));if(_0x1e1bde[_0x4837('0x41')]===_0x4837('0x39')){var _0x24d740=_0x216dfa[_0x4837('0x38')]({'plain':!![]});var _0x4b4cb8=[{'name':_0x4837('0x3a'),'value':_0x4837('0x83')},{'name':_0x4837('0x3b'),'value':'telephone'}];var _0x5cd7a6=_[_0x4837('0x42')](_0x4b4cb8,[_0x4837('0x3f'),_0x24d740[_0x4837('0x41')]])[_0x4837('0x43')];return db[_0x4837('0x8e')][_0x4837('0x42')]({'where':{'name':_0x5cd7a6,'userProfileId':_0x1e1bde[_0x4837('0x8f')]},'raw':!![]})[_0x4837('0x24')](function(_0x45e1d1){if(_0x45e1d1&&_0x45e1d1[_0x4837('0x90')]===0x0){return db[_0x4837('0x91')][_0x4837('0x75')]({'name':_0x24d740[_0x4837('0x43')],'resourceId':_0x24d740['id'],'type':_0x45e1d1['name'],'sectionId':_0x45e1d1['id']},{})[_0x4837('0x24')](function(){return _0x216dfa;});}else{return _0x216dfa;}})[_0x4837('0x2d')](function(_0xc27390){logger[_0x4837('0x2a')](_0x4837('0x92'),_0xc27390);throw _0xc27390;});}return _0x216dfa;})[_0x4837('0x24')](respondWithResult(_0x119716,0xc9))[_0x4837('0x2d')](handleError(_0x119716,null));};exports[_0x4837('0x93')]=function(_0x3fcc27,_0x347ae0,_0x2dbeda){var _0x1c70e3=![];if(_0x3fcc27[_0x4837('0x68')]['id']){delete _0x3fcc27['body']['id'];}return db[_0x4837('0x77')][_0x4837('0x94')]({'attributes':['id',_0x4837('0x79')]})[_0x4837('0x24')](function(_0x51ebe6){_0x1c70e3=_0x51ebe6['securePassword'];return db[_0x4837('0x47')][_0x4837('0x42')]({'where':{'id':_0x3fcc27[_0x4837('0x69')]['id']}});})[_0x4837('0x24')](function(_0xc4416f){if(_0xc4416f){if(_0xc4416f['id']==_0x3fcc27['user']['id']){if(!_0x3fcc27['body'][_0x4837('0x95')]||!_0x3fcc27['body'][_0x4837('0x96')]){throw new db[(_0x4837('0x20'))][(_0x4837('0x21'))](_0x4837('0x97'));}if(!_0xc4416f[_0x4837('0x98')](_0x3fcc27[_0x4837('0x68')][_0x4837('0x95')])){throw new db[(_0x4837('0x20'))][(_0x4837('0x21'))]('Wrong\x20credentials');}if(_0x3fcc27[_0x4837('0x68')][_0x4837('0x95')]==_0x3fcc27['body'][_0x4837('0x96')]){throw new db[(_0x4837('0x20'))][(_0x4837('0x21'))](_0x4837('0x99'));}return _0xc4416f;}else if(_0x3fcc27[_0x4837('0x39')][_0x4837('0x41')]=='admin'){if(!_0x3fcc27['body'][_0x4837('0x96')]){throw new db[(_0x4837('0x20'))][(_0x4837('0x21'))](_0x4837('0x9a'));}return _0xc4416f;}else if(_0x3fcc27['user'][_0x4837('0x41')]==_0x4837('0x39')){if(!_0x3fcc27[_0x4837('0x68')][_0x4837('0x96')]){throw new db[(_0x4837('0x20'))][(_0x4837('0x21'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0xc4416f[_0x4837('0x41')]!=_0x4837('0x83')){throw new db[(_0x4837('0x20'))][(_0x4837('0x21'))]('Unauthorized');}return _0xc4416f;}else{throw new db['Sequelize']['ValidationError'](_0x4837('0x9b'));}}return null;})[_0x4837('0x24')](handleEntityNotFound(_0x347ae0,null))[_0x4837('0x24')](function(_0x24b41a){return checkPasswordPattern(_0x24b41a,_0x3fcc27[_0x4837('0x68')][_0x4837('0x96')],_0x1c70e3);})['then'](saveUpdates({'password':_0x3fcc27[_0x4837('0x68')][_0x4837('0x96')],'passwordResetAt':_0x3fcc27[_0x4837('0x39')]['id']==_0x3fcc27[_0x4837('0x69')]['id']?moment():null},null))[_0x4837('0x24')](respondWithResult(_0x347ae0,null))[_0x4837('0x2d')](handleError(_0x347ae0,null));};exports['addQueues']=function(_0x4a5137,_0x35e1a2,_0x1dd789){var _0x164d75=_0x4a5137['body'][_0x4837('0x9c')];return db[_0x4837('0x47')][_0x4837('0x42')]({'where':{'id':_0x4a5137[_0x4837('0x69')]['id']},'attributes':['id',_0x4837('0x43'),_0x4837('0x41'),_0x4837('0x9d'),_0x4837('0x9e'),_0x4837('0x9f'),_0x4837('0xa0')]})[_0x4837('0x24')](handleEntityNotFound(_0x35e1a2,null))[_0x4837('0x24')](function(_0x218785){if(_0x218785){if(!utils['isValidChannel'](_0x164d75)){throw new db[(_0x4837('0x20'))][(_0x4837('0x21'))]('Unknown\x20channel');}return _0x218785[_0x4837('0xa1')+_['capitalize'](_0x164d75[_0x4837('0xa2')]())+_0x4837('0xa3')](_0x4a5137[_0x4837('0x68')][_0x4837('0x6c')],{'penalty':_0x4a5137[_0x4837('0x68')]['penalty']||0x0})[_0x4837('0xa4')](function(_0x363d38){for(var _0x4b5f0b=0x0;_0x4b5f0b<_0x4a5137[_0x4837('0x68')]['ids'][_0x4837('0x55')];_0x4b5f0b+=0x1){var _0x273429={'UserId':_0x4a5137[_0x4837('0x69')]['id']};_0x273429[_[_0x4837('0xa5')](_0x164d75[_0x4837('0xa2')]())+'QueueId']=_0x4a5137[_0x4837('0x68')][_0x4837('0x6c')][_0x4b5f0b];socket[_0x4837('0xa6')](_0x4837('0x39')+_[_0x4837('0xa5')](_0x164d75[_0x4837('0xa2')]())+_0x4837('0xa7'),_0x273429);}return _0x363d38;})[_0x4837('0x24')](function(){if(_0x164d75==='voice'){return db[_0x4837('0xa8')][_0x4837('0x64')]({'where':{'id':_0x4a5137[_0x4837('0x68')][_0x4837('0x6c')]||[]},'raw':!![],'attributes':['id',_0x4837('0x43')]});}})[_0x4837('0x24')](function(_0x2ac495){var _0x33a29d=_0x218785[_0x4837('0x38')]({'plain':!![]});var _0x2331cf=[];if(_0x164d75===_0x4837('0xa9')&&_0x33a29d[_0x4837('0x41')]===_0x4837('0x83')&&_0x33a29d['online']){for(var _0x1f49f4=0x0;_0x1f49f4<_0x2ac495[_0x4837('0x55')];_0x1f49f4+=0x1){_0x2331cf[_0x4837('0xaa')]({'membername':_0x33a29d[_0x4837('0x43')],'UserId':_0x33a29d['id'],'queue_name':_0x2ac495[_0x1f49f4][_0x4837('0x43')],'VoiceQueueId':_0x2ac495[_0x1f49f4]['id'],'interface':_[_0x4837('0x72')](_0x33a29d[_0x4837('0xa0')])?util[_0x4837('0x74')](_0x4837('0xab'),_0x33a29d[_0x4837('0x43')]):_0x33a29d['interface'],'paused':_0x33a29d[_0x4837('0x9f')]||![],'penalty':_0x4a5137[_0x4837('0x68')][_0x4837('0xac')]||0x0});}return BPromise[_0x4837('0xad')](_0x2331cf,function(_0x637b61){return db['UserVoiceQueueRt']['upsert'](_0x637b61);});}return _0x218785;});}})[_0x4837('0x24')](respondWithStatusCode(_0x35e1a2,null))['catch'](handleError(_0x35e1a2,null));};exports[_0x4837('0xae')]=function(_0x5ad67d,_0x236a37,_0x5528c7){var _0x178c16;return db[_0x4837('0x47')][_0x4837('0x42')]({'where':{'id':_0x5ad67d[_0x4837('0x69')]['id']},'attributes':['id',_0x4837('0x43'),_0x4837('0x41')]})[_0x4837('0x24')](handleEntityNotFound(_0x236a37,null))[_0x4837('0x24')](function(_0x216316){if(_0x216316){_0x178c16=_0x216316;if(!_0x5ad67d['query'][_0x4837('0x9c')]||!utils[_0x4837('0xaf')](_0x5ad67d[_0x4837('0x4e')][_0x4837('0x9c')])){throw new db[(_0x4837('0x20'))]['ValidationError'](_0x4837('0xb0'));}return _0x216316['remove'+_[_0x4837('0xa5')](_0x5ad67d[_0x4837('0x4e')][_0x4837('0x9c')][_0x4837('0xa2')]())+_0x4837('0xa3')](_0x5ad67d['query']['ids']);}})[_0x4837('0x24')](function(_0x465877){for(var _0x2ec4fb=0x0;_0x2ec4fb<_0x5ad67d[_0x4837('0x4e')][_0x4837('0x6c')][_0x4837('0x55')];_0x2ec4fb+=0x1){var _0x43c35b={'UserId':_0x5ad67d[_0x4837('0x69')]['id']};_0x43c35b[_[_0x4837('0xa5')](_0x5ad67d[_0x4837('0x4e')][_0x4837('0x9c')][_0x4837('0xa2')]())+_0x4837('0xb1')]=_0x5ad67d[_0x4837('0x4e')][_0x4837('0x6c')][_0x2ec4fb];socket[_0x4837('0xa6')](_0x4837('0x39')+_['capitalize'](_0x5ad67d[_0x4837('0x4e')][_0x4837('0x9c')][_0x4837('0xa2')]())+_0x4837('0xb2'),_0x43c35b);}return _0x465877;})[_0x4837('0x24')](function(){if(_0x5ad67d['query'][_0x4837('0x9c')]===_0x4837('0xa9')){return db['UserVoiceQueueRt'][_0x4837('0x44')]({'where':{'UserId':_0x5ad67d[_0x4837('0x69')]['id'],'VoiceQueueId':_0x5ad67d[_0x4837('0x4e')][_0x4837('0x6c')]},'individualHooks':!![]})[_0x4837('0x24')](function(){return _0x178c16;});}return _0x178c16;})[_0x4837('0x24')](respondWithStatusCode(_0x236a37,null))['catch'](handleError(_0x236a37,null));};exports[_0x4837('0xb3')]=function(_0x1440d1,_0x45ea6b,_0x467adf){_0x1440d1[_0x4837('0x68')][_0x4837('0xb4')]=_0x1440d1['file']['filename'];return db[_0x4837('0x47')][_0x4837('0x42')]({'where':{'id':_0x1440d1[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x45ea6b,null))[_0x4837('0x24')](saveUpdates(_0x1440d1[_0x4837('0x68')],null))['then'](respondWithResult(_0x45ea6b,null))['catch'](handleError(_0x45ea6b,null));};exports[_0x4837('0xb5')]=function(_0x458f87,_0x5eee78,_0x5b7e80){var _0x36cf1c=path[_0x4837('0xb6')](config['root'],_0x4837('0xb7'));return db[_0x4837('0x47')][_0x4837('0x42')]({'where':{'id':_0x458f87[_0x4837('0x69')]['id']},'attributes':['id',_0x4837('0xb4')],'raw':!![]})[_0x4837('0x24')](handleEntityNotFound(_0x5eee78,null))[_0x4837('0x24')](function(_0x20a6de){if(_0x20a6de){if(_[_0x4837('0x72')](_0x20a6de[_0x4837('0xb4')])){return _0x5eee78['download'](_0x36cf1c);}else{if(!fs[_0x4837('0xb8')](path[_0x4837('0xb6')](config[_0x4837('0xb9')],_0x4837('0xba'),_0x20a6de[_0x4837('0xb4')]))){return _0x5eee78['download'](_0x36cf1c);}return _0x5eee78['download'](path['join'](config[_0x4837('0xb9')],'server/files/images/',_0x20a6de[_0x4837('0xb4')]));}}})[_0x4837('0x2d')](handleError(_0x5eee78,null));};exports[_0x4837('0xbb')]=function(_0x1b7482,_0x3d97cd,_0x420e0e){var _0x3b4240={};var _0x3da1fb={};var _0x4ddd68;var _0x519fc0;return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0x1b7482['params']['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x3d97cd,null))[_0x4837('0x24')](function(_0x275fd1){if(_0x275fd1){_0x4ddd68=_0x275fd1;_0x3da1fb['model']=_[_0x4837('0x4f')](db[_0x4837('0xbc')]['rawAttributes']);_0x3da1fb['query']=_['keys'](_0x1b7482[_0x4837('0x4e')]);_0x3da1fb['filters']=_['intersection'](_0x3da1fb[_0x4837('0x52')],_0x3da1fb[_0x4837('0x4e')]);_0x3b4240[_0x4837('0x53')]=_['intersection'](_0x3da1fb['model'],qs['fields'](_0x1b7482['query'][_0x4837('0x54')]));_0x3b4240['attributes']=_0x3b4240[_0x4837('0x53')][_0x4837('0x55')]?_0x3b4240[_0x4837('0x53')]:_0x3da1fb[_0x4837('0x52')];_0x3b4240[_0x4837('0x59')]=qs[_0x4837('0x5a')](_0x1b7482[_0x4837('0x4e')][_0x4837('0x5a')]);_0x3b4240[_0x4837('0x5b')]=qs['filters'](_['pick'](_0x1b7482[_0x4837('0x4e')],_0x3da1fb['filters']));if(_0x1b7482[_0x4837('0x4e')]['filter']){_0x3b4240['where']=_['merge'](_0x3b4240[_0x4837('0x5b')],{'$or':_['map'](_0x3b4240[_0x4837('0x53')],function(_0x37225e){var _0x3c8fa3={};_0x3c8fa3[_0x37225e]={'$like':'%'+_0x1b7482[_0x4837('0x4e')][_0x4837('0x3c')]+'%'};return _0x3c8fa3;})});}_0x3b4240=_[_0x4837('0x5d')]({},_0x3b4240,_0x1b7482[_0x4837('0x61')]);return _0x4ddd68[_0x4837('0xbb')](_0x3b4240);}})[_0x4837('0x24')](function(_0x36efda){if(_0x36efda){_0x519fc0=_0x36efda[_0x4837('0x55')];if(_0x1b7482[_0x4837('0x4e')][_0x4837('0x56')](_0x4837('0x62'))){_0x3b4240['include']=[{'model':db[_0x4837('0xbd')],'as':_0x4837('0xbe'),'required':![]},{'model':db[_0x4837('0xbf')],'as':'Tags','attributes':['id',_0x4837('0x43'),'color'],'where':_0x1b7482[_0x4837('0x4e')][_0x4837('0xc0')]?{'id':_0x1b7482[_0x4837('0x4e')][_0x4837('0xc0')]}:undefined,'required':_0x1b7482[_0x4837('0x4e')][_0x4837('0xc0')]?!![]:![]}];}if(!_0x1b7482['query'][_0x4837('0x56')](_0x4837('0x57'))){_0x3b4240[_0x4837('0x58')]=qs[_0x4837('0x58')](_0x1b7482[_0x4837('0x4e')]['limit']);_0x3b4240[_0x4837('0x33')]=qs[_0x4837('0x33')](_0x1b7482[_0x4837('0x4e')]['offset']);}return _0x4ddd68['getContacts'](_0x3b4240);}})[_0x4837('0x24')](function(_0x1b09c2){if(_0x1b09c2){return _0x1b09c2?{'count':_0x519fc0,'rows':_0x1b09c2}:null;}})['then'](respondWithResult(_0x3d97cd,null))[_0x4837('0x2d')](handleError(_0x3d97cd,null));};exports[_0x4837('0xc1')]=function(_0x28c226,_0x4825f9,_0x3bfd43){var _0x370830;var _0x309104;var _0x35c56f={};var _0x539e62;return db[_0x4837('0x47')]['findOne']({'where':{'id':_0x28c226[_0x4837('0x69')]['id']},'attributes':['id','name',_0x4837('0x41')]})[_0x4837('0x24')](handleEntityNotFound(_0x4825f9,null))[_0x4837('0x24')](function(_0x4ca1bd){if(!utils[_0x4837('0xaf')](_0x28c226[_0x4837('0x4e')][_0x4837('0x9c')])){throw new db[(_0x4837('0x20'))][(_0x4837('0x21'))](_0x4837('0xb0'));}_0x370830=_0x4ca1bd;var _0xf3cc69={};_0xf3cc69['model']=_['keys'](db[_[_0x4837('0xa5')](_0x28c226[_0x4837('0x4e')][_0x4837('0x9c')])+'Queue'][_0x4837('0x66')]);_0xf3cc69[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x28c226['query']);_0xf3cc69['filters']=_[_0x4837('0x51')](_0xf3cc69['model'],_0xf3cc69[_0x4837('0x4e')]);_0x35c56f[_0x4837('0x53')]=_['intersection'](_0xf3cc69[_0x4837('0x52')],qs[_0x4837('0x54')](_0x28c226[_0x4837('0x4e')]['fields']));_0x35c56f['attributes']=_0x35c56f[_0x4837('0x53')]['length']?_0x35c56f[_0x4837('0x53')]:_0xf3cc69[_0x4837('0x52')];_0x35c56f[_0x4837('0x59')]=qs[_0x4837('0x5a')](_0x28c226[_0x4837('0x4e')][_0x4837('0x5a')]);_0x35c56f[_0x4837('0x5b')]=qs[_0x4837('0x50')](_[_0x4837('0x5c')](_0x28c226[_0x4837('0x4e')],_0xf3cc69['filters']));if(_0x28c226[_0x4837('0x4e')][_0x4837('0x3c')]){_0x35c56f[_0x4837('0x5b')]=_['merge'](_0x35c56f[_0x4837('0x5b')],{'$or':_[_0x4837('0x3e')](_0x35c56f[_0x4837('0x53')],function(_0x13f31f){var _0xbaaf13={};_0xbaaf13[_0x13f31f]={'$like':'%'+_0x28c226[_0x4837('0x4e')][_0x4837('0x3c')]+'%'};return _0xbaaf13;})});}_0x35c56f=_[_0x4837('0x5d')]({},_0x35c56f,_0x28c226[_0x4837('0x61')]);switch(_0x370830[_0x4837('0x41')]){case _0x4837('0xc2'):return db[_[_0x4837('0xa5')](_0x28c226['query'][_0x4837('0x9c')])+_0x4837('0xc3')]['findAll'](_0x35c56f);case _0x4837('0x39'):case _0x4837('0x83'):return _0x370830['get'+_[_0x4837('0xa5')](_0x28c226[_0x4837('0x4e')][_0x4837('0x9c')])+_0x4837('0xa3')](_0x35c56f);default:throw new db[(_0x4837('0x20'))]['ValidationError'](_0x4837('0xc4'));}})[_0x4837('0x24')](function(_0x3499ce){_0x539e62=_0x3499ce['length'];if(!_0x28c226[_0x4837('0x4e')][_0x4837('0x56')](_0x4837('0x57'))){_0x35c56f[_0x4837('0x58')]=qs[_0x4837('0x58')](_0x28c226['query'][_0x4837('0x58')]);_0x35c56f['offset']=qs[_0x4837('0x33')](_0x28c226['query'][_0x4837('0x33')]);}switch(_0x370830[_0x4837('0x41')]){case _0x4837('0xc2'):return db[_[_0x4837('0xa5')](_0x28c226[_0x4837('0x4e')][_0x4837('0x9c')])+_0x4837('0xc3')][_0x4837('0x64')](_0x35c56f);case _0x4837('0x39'):case'agent':return _0x370830[_0x4837('0x38')+_['capitalize'](_0x28c226[_0x4837('0x4e')][_0x4837('0x9c')])+'Queues'](_0x35c56f);}})[_0x4837('0x24')](function(_0x36dcb0){return{'count':_0x539e62,'rows':_0x36dcb0};})['then'](respondWithResult(_0x4825f9,null))['catch'](handleError(_0x4825f9,null));};exports[_0x4837('0xc5')]=function(_0x303f59,_0x166ce4,_0x48ce26){var _0x51b29a={};var _0x159dbe={};var _0x449259;var _0x4ad290;return db['User'][_0x4837('0x94')]({'where':{'id':_0x303f59['params']['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x166ce4,null))[_0x4837('0x24')](function(_0x203d9b){if(_0x203d9b){_0x449259=_0x203d9b;_0x159dbe[_0x4837('0x52')]=_['keys'](db[_0x4837('0xc6')][_0x4837('0x66')]);_0x159dbe[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x303f59[_0x4837('0x4e')]);_0x159dbe[_0x4837('0x50')]=_['intersection'](_0x159dbe['model'],_0x159dbe['query']);_0x51b29a[_0x4837('0x53')]=_['intersection'](_0x159dbe['model'],qs[_0x4837('0x54')](_0x303f59[_0x4837('0x4e')][_0x4837('0x54')]));_0x51b29a[_0x4837('0x53')]=_0x51b29a[_0x4837('0x53')][_0x4837('0x55')]?_0x51b29a['attributes']:_0x159dbe[_0x4837('0x52')];_0x51b29a[_0x4837('0x59')]=qs['sort'](_0x303f59[_0x4837('0x4e')]['sort']);_0x51b29a[_0x4837('0x5b')]=qs['filters'](_[_0x4837('0x5c')](_0x303f59[_0x4837('0x4e')],_0x159dbe[_0x4837('0x50')]));if(_0x303f59[_0x4837('0x4e')][_0x4837('0x3c')]){_0x51b29a[_0x4837('0x5b')]=_[_0x4837('0x5d')](_0x51b29a[_0x4837('0x5b')],{'$or':_['map'](_0x51b29a[_0x4837('0x53')],function(_0x4df5e7){var _0x488f3d={};_0x488f3d[_0x4df5e7]={'$like':'%'+_0x303f59['query']['filter']+'%'};return _0x488f3d;})});}_0x51b29a=_[_0x4837('0x5d')]({},_0x51b29a,_0x303f59[_0x4837('0x61')]);return _0x449259['getVoiceQueuesRt'](_0x51b29a);}})['then'](function(_0x3f5a0a){if(_0x3f5a0a){_0x4ad290=_0x3f5a0a['length'];if(!_0x303f59[_0x4837('0x4e')][_0x4837('0x56')](_0x4837('0x57'))){_0x51b29a[_0x4837('0x58')]=qs[_0x4837('0x58')](_0x303f59['query'][_0x4837('0x58')]);_0x51b29a['offset']=qs[_0x4837('0x33')](_0x303f59['query']['offset']);}return _0x449259[_0x4837('0xc5')](_0x51b29a);}})[_0x4837('0x24')](function(_0x164445){if(_0x164445){return _0x164445?{'count':_0x4ad290,'rows':_0x164445}:null;}})[_0x4837('0x24')](respondWithResult(_0x166ce4,null))[_0x4837('0x2d')](handleError(_0x166ce4,null));};exports[_0x4837('0xc7')]=function(_0x4586b2,_0x2dac76,_0x27b104){var _0x20bc06={};var _0x304b8a={};var _0x3c3629;var _0x51e791;return db['User'][_0x4837('0x94')]({'where':{'id':_0x4586b2['params']['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x2dac76,null))[_0x4837('0x24')](function(_0x22c513){if(_0x22c513){_0x3c3629=_0x22c513;_0x304b8a[_0x4837('0x52')]=_[_0x4837('0x4f')](db[_0x4837('0xc8')]['rawAttributes']);_0x304b8a['query']=_[_0x4837('0x4f')](_0x4586b2[_0x4837('0x4e')]);_0x304b8a[_0x4837('0x50')]=_[_0x4837('0x51')](_0x304b8a['model'],_0x304b8a[_0x4837('0x4e')]);_0x20bc06['attributes']=_[_0x4837('0x51')](_0x304b8a[_0x4837('0x52')],qs[_0x4837('0x54')](_0x4586b2[_0x4837('0x4e')][_0x4837('0x54')]));_0x20bc06[_0x4837('0x53')]=_0x20bc06['attributes'][_0x4837('0x55')]?_0x20bc06['attributes']:_0x304b8a[_0x4837('0x52')];_0x20bc06[_0x4837('0x59')]=qs['sort'](_0x4586b2['query'][_0x4837('0x5a')]);_0x20bc06[_0x4837('0x5b')]=qs[_0x4837('0x50')](_[_0x4837('0x5c')](_0x4586b2[_0x4837('0x4e')],_0x304b8a[_0x4837('0x50')]));if(_0x4586b2[_0x4837('0x4e')][_0x4837('0x3c')]){_0x20bc06[_0x4837('0x5b')]=_['merge'](_0x20bc06['where'],{'$or':_[_0x4837('0x3e')](_0x20bc06[_0x4837('0x53')],function(_0x3543e6){var _0x550b1e={};_0x550b1e[_0x3543e6]={'$like':'%'+_0x4586b2['query']['filter']+'%'};return _0x550b1e;})});}_0x20bc06=_[_0x4837('0x5d')]({},_0x20bc06,_0x4586b2[_0x4837('0x61')]);return _0x3c3629['getGroups'](_0x20bc06);}})['then'](function(_0xa76fc7){if(_0xa76fc7){_0x51e791=_0xa76fc7[_0x4837('0x55')];if(!_0x4586b2['query'][_0x4837('0x56')](_0x4837('0x57'))){_0x20bc06[_0x4837('0x58')]=qs[_0x4837('0x58')](_0x4586b2[_0x4837('0x4e')][_0x4837('0x58')]);_0x20bc06[_0x4837('0x33')]=qs[_0x4837('0x33')](_0x4586b2[_0x4837('0x4e')][_0x4837('0x33')]);}return _0x3c3629['getGroups'](_0x20bc06);}})[_0x4837('0x24')](function(_0x367fa9){if(_0x367fa9){return _0x367fa9?{'count':_0x51e791,'rows':_0x367fa9}:null;}})[_0x4837('0x24')](respondWithResult(_0x2dac76,null))['catch'](handleError(_0x2dac76,null));};exports[_0x4837('0xc9')]=function(_0x202e95,_0x5cf0b3,_0x2d3e4f){var _0x1ec902={'raw':!![],'where':{}};var _0x3a0b57={};var _0x350ff2={'count':0x0,'rows':[]};return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0x202e95[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x5cf0b3,null))[_0x4837('0x24')](function(_0xe5e6e4){if(_0xe5e6e4){_0x3a0b57[_0x4837('0x52')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x3a0b57[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x202e95[_0x4837('0x4e')]);_0x3a0b57[_0x4837('0x50')]=_[_0x4837('0x51')](_0x3a0b57[_0x4837('0x52')],_0x3a0b57[_0x4837('0x4e')]);_0x1ec902[_0x4837('0x53')]=_[_0x4837('0x51')](_0x3a0b57['model'],qs[_0x4837('0x54')](_0x202e95[_0x4837('0x4e')][_0x4837('0x54')]));_0x1ec902[_0x4837('0x53')]=_0x1ec902[_0x4837('0x53')][_0x4837('0x55')]?_0x1ec902[_0x4837('0x53')]:_0x3a0b57[_0x4837('0x52')];if(!_0x202e95[_0x4837('0x4e')]['hasOwnProperty']('nolimit')){_0x1ec902[_0x4837('0x58')]=qs[_0x4837('0x58')](_0x202e95[_0x4837('0x4e')][_0x4837('0x58')]);_0x1ec902[_0x4837('0x33')]=qs[_0x4837('0x33')](_0x202e95[_0x4837('0x4e')][_0x4837('0x33')]);}_0x1ec902[_0x4837('0x59')]=qs['sort'](_0x202e95[_0x4837('0x4e')][_0x4837('0x5a')]);_0x1ec902[_0x4837('0x5b')]=qs[_0x4837('0x50')](_['pick'](_0x202e95[_0x4837('0x4e')],_0x3a0b57[_0x4837('0x50')]));_0x1ec902['where'][_0x4837('0xca')]=_0xe5e6e4['id'];if(_0x202e95[_0x4837('0x4e')][_0x4837('0x3c')]){_0x1ec902[_0x4837('0x5b')]=_[_0x4837('0x5d')](_0x1ec902['where'],{'$or':_[_0x4837('0x3e')](_0x1ec902['attributes'],function(_0x2bf11d){var _0x35a562={};_0x35a562[_0x2bf11d]={'$like':'%'+_0x202e95[_0x4837('0x4e')][_0x4837('0x3c')]+'%'};return _0x35a562;})});}_0x1ec902=_[_0x4837('0x5d')]({},_0x1ec902,_0x202e95['options']);return db[_0x4837('0xcb')][_0x4837('0x32')]({'where':_0x1ec902[_0x4837('0x5b')]})[_0x4837('0x24')](function(_0x31bd6b){_0x350ff2[_0x4837('0x32')]=_0x31bd6b;if(_0x202e95[_0x4837('0x4e')][_0x4837('0x62')]){_0x1ec902[_0x4837('0x63')]=[{'all':!![]}];}return db[_0x4837('0xcb')]['findAll'](_0x1ec902);})[_0x4837('0x24')](function(_0x20e33a){_0x350ff2['rows']=_0x20e33a;return _0x350ff2;});}})[_0x4837('0x24')](respondWithFilteredResult(_0x5cf0b3,_0x1ec902))['catch'](handleError(_0x5cf0b3,null));};exports['getScreenRecordings']=function(_0x120e47,_0xb7064b,_0x5545f0){var _0x185dec={'raw':!![],'where':{}};var _0x46ed3c={};var _0x5e0251={'count':0x0,'rows':[]};return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0x120e47[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0xb7064b,null))[_0x4837('0x24')](function(_0x3d120a){if(_0x3d120a){_0x46ed3c[_0x4837('0x52')]=_[_0x4837('0x4f')](db['ScreenRecording']['rawAttributes']);_0x46ed3c[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x120e47['query']);_0x46ed3c[_0x4837('0x50')]=_['intersection'](_0x46ed3c[_0x4837('0x52')],_0x46ed3c[_0x4837('0x4e')]);_0x185dec['attributes']=_[_0x4837('0x51')](_0x46ed3c['model'],qs['fields'](_0x120e47['query'][_0x4837('0x54')]));_0x185dec['attributes']=_0x185dec[_0x4837('0x53')][_0x4837('0x55')]?_0x185dec['attributes']:_0x46ed3c['model'];if(!_0x120e47[_0x4837('0x4e')][_0x4837('0x56')](_0x4837('0x57'))){_0x185dec[_0x4837('0x58')]=qs[_0x4837('0x58')](_0x120e47[_0x4837('0x4e')][_0x4837('0x58')]);_0x185dec[_0x4837('0x33')]=qs[_0x4837('0x33')](_0x120e47[_0x4837('0x4e')][_0x4837('0x33')]);}_0x185dec[_0x4837('0x59')]=qs[_0x4837('0x5a')](_0x120e47[_0x4837('0x4e')][_0x4837('0x5a')]);_0x185dec[_0x4837('0x5b')]=qs[_0x4837('0x50')](_[_0x4837('0x5c')](_0x120e47[_0x4837('0x4e')],_0x46ed3c['filters']));_0x185dec['where'][_0x4837('0xca')]=_0x3d120a['id'];if(_0x120e47[_0x4837('0x4e')]['filter']){_0x185dec[_0x4837('0x5b')]=_['merge'](_0x185dec['where'],{'$or':_['map'](_0x185dec[_0x4837('0x53')],function(_0x434c1f){var _0x2b7c52={};_0x2b7c52[_0x434c1f]={'$like':'%'+_0x120e47[_0x4837('0x4e')][_0x4837('0x3c')]+'%'};return _0x2b7c52;})});}_0x185dec=_[_0x4837('0x5d')]({},_0x185dec,_0x120e47[_0x4837('0x61')]);return db['ScreenRecording']['count']({'where':_0x185dec[_0x4837('0x5b')]})['then'](function(_0x868ea9){_0x5e0251[_0x4837('0x32')]=_0x868ea9;if(_0x120e47[_0x4837('0x4e')][_0x4837('0x62')]){_0x185dec['include']=[{'all':!![]}];}return db[_0x4837('0xcc')][_0x4837('0x64')](_0x185dec);})[_0x4837('0x24')](function(_0x49a4c2){_0x5e0251['rows']=_0x49a4c2;return _0x5e0251;});}})['then'](respondWithFilteredResult(_0xb7064b,_0x185dec))[_0x4837('0x2d')](handleError(_0xb7064b,null));};exports['getChatInteractions']=function(_0x1b7cc4,_0x221c1b,_0x3c22c7){var _0x27d974={};var _0x114c79={};var _0x4956a2;var _0x17e399;return db[_0x4837('0x47')]['findOne']({'where':{'id':_0x1b7cc4[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x221c1b,null))[_0x4837('0x24')](function(_0x2fdd8b){if(_0x2fdd8b){_0x4956a2=_0x2fdd8b;_0x114c79[_0x4837('0x52')]=_[_0x4837('0x4f')](db[_0x4837('0xcd')][_0x4837('0x66')]);_0x114c79[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x1b7cc4[_0x4837('0x4e')]);_0x114c79['filters']=_[_0x4837('0x51')](_0x114c79['model'],_0x114c79['query']);_0x27d974[_0x4837('0x53')]=_[_0x4837('0x51')](_0x114c79[_0x4837('0x52')],qs[_0x4837('0x54')](_0x1b7cc4['query'][_0x4837('0x54')]));_0x27d974['attributes']=_0x27d974[_0x4837('0x53')][_0x4837('0x55')]?_0x27d974[_0x4837('0x53')]:_0x114c79[_0x4837('0x52')];_0x27d974['order']=qs[_0x4837('0x5a')](_0x1b7cc4['query']['sort']);_0x27d974[_0x4837('0x5b')]=qs['filters'](_[_0x4837('0x5c')](_0x1b7cc4[_0x4837('0x4e')],_0x114c79[_0x4837('0x50')]));if(_0x1b7cc4[_0x4837('0x4e')][_0x4837('0x3c')]){_0x27d974['where']=_[_0x4837('0x5d')](_0x27d974[_0x4837('0x5b')],{'$or':_[_0x4837('0x3e')](_0x27d974[_0x4837('0x53')],function(_0x23366f){var _0x1faa35={};_0x1faa35[_0x23366f]={'$like':'%'+_0x1b7cc4['query']['filter']+'%'};return _0x1faa35;})});}_0x27d974=_[_0x4837('0x5d')]({},_0x27d974,_0x1b7cc4[_0x4837('0x61')]);return _0x4956a2[_0x4837('0xce')](_0x27d974);}})[_0x4837('0x24')](function(_0x145c5c){if(_0x145c5c){_0x17e399=_0x145c5c['length'];if(!_0x1b7cc4[_0x4837('0x4e')][_0x4837('0x56')](_0x4837('0x57'))){_0x27d974['limit']=qs[_0x4837('0x58')](_0x1b7cc4[_0x4837('0x4e')][_0x4837('0x58')]);_0x27d974[_0x4837('0x33')]=qs[_0x4837('0x33')](_0x1b7cc4[_0x4837('0x4e')][_0x4837('0x33')]);}return _0x4956a2[_0x4837('0xce')](_0x27d974);}})[_0x4837('0x24')](function(_0x191c77){if(_0x191c77){return _0x191c77?{'count':_0x17e399,'rows':_0x191c77}:null;}})[_0x4837('0x24')](respondWithResult(_0x221c1b,null))[_0x4837('0x2d')](handleError(_0x221c1b,null));};exports[_0x4837('0xcf')]=function(_0x2315f3,_0x4ca344,_0x230622){var _0x56fdeb={};var _0xd4398d={};var _0x2d9b70;var _0x34409f;return db[_0x4837('0x47')]['findOne']({'where':{'id':_0x2315f3[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x4ca344,null))['then'](function(_0x190aeb){if(_0x190aeb){_0x2d9b70=_0x190aeb;_0xd4398d['model']=_[_0x4837('0x4f')](db[_0x4837('0xd0')][_0x4837('0x66')]);_0xd4398d[_0x4837('0x4e')]=_['keys'](_0x2315f3['query']);_0xd4398d[_0x4837('0x50')]=_[_0x4837('0x51')](_0xd4398d[_0x4837('0x52')],_0xd4398d[_0x4837('0x4e')]);_0x56fdeb['attributes']=_['intersection'](_0xd4398d[_0x4837('0x52')],qs[_0x4837('0x54')](_0x2315f3[_0x4837('0x4e')]['fields']));_0x56fdeb[_0x4837('0x53')]=_0x56fdeb['attributes'][_0x4837('0x55')]?_0x56fdeb[_0x4837('0x53')]:_0xd4398d[_0x4837('0x52')];_0x56fdeb['order']=qs['sort'](_0x2315f3[_0x4837('0x4e')][_0x4837('0x5a')]);_0x56fdeb[_0x4837('0x5b')]=qs[_0x4837('0x50')](_[_0x4837('0x5c')](_0x2315f3['query'],_0xd4398d[_0x4837('0x50')]));if(_0x2315f3[_0x4837('0x4e')]['filter']){_0x56fdeb[_0x4837('0x5b')]=_[_0x4837('0x5d')](_0x56fdeb[_0x4837('0x5b')],{'$or':_[_0x4837('0x3e')](_0x56fdeb[_0x4837('0x53')],function(_0x292b72){var _0x55c331={};_0x55c331[_0x292b72]={'$like':'%'+_0x2315f3[_0x4837('0x4e')]['filter']+'%'};return _0x55c331;})});}_0x56fdeb=_['merge']({},_0x56fdeb,_0x2315f3[_0x4837('0x61')]);return _0x2d9b70[_0x4837('0xcf')](_0x56fdeb);}})[_0x4837('0x24')](function(_0x4b3a87){if(_0x4b3a87){_0x34409f=_0x4b3a87['length'];if(!_0x2315f3[_0x4837('0x4e')][_0x4837('0x56')](_0x4837('0x57'))){_0x56fdeb[_0x4837('0x58')]=qs[_0x4837('0x58')](_0x2315f3[_0x4837('0x4e')][_0x4837('0x58')]);_0x56fdeb[_0x4837('0x33')]=qs[_0x4837('0x33')](_0x2315f3['query']['offset']);}return _0x2d9b70[_0x4837('0xcf')](_0x56fdeb);}})[_0x4837('0x24')](function(_0x2eab52){if(_0x2eab52){return _0x2eab52?{'count':_0x34409f,'rows':_0x2eab52}:null;}})['then'](respondWithResult(_0x4ca344,null))['catch'](handleError(_0x4ca344,null));};exports[_0x4837('0xd1')]=function(_0x15f644,_0x51d2c0,_0x3e49e1){var _0x38ca9e={'raw':!![],'where':{}};var _0x2edaae={};var _0x5bf6fc={'count':0x0,'rows':[]};return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0x15f644[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x51d2c0,null))['then'](function(_0x4708be){if(_0x4708be){_0x2edaae['model']=_[_0x4837('0x4f')](db[_0x4837('0xd2')][_0x4837('0x66')]);_0x2edaae[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x15f644[_0x4837('0x4e')]);_0x2edaae[_0x4837('0x50')]=_[_0x4837('0x51')](_0x2edaae[_0x4837('0x52')],_0x2edaae[_0x4837('0x4e')]);_0x38ca9e[_0x4837('0x53')]=_[_0x4837('0x51')](_0x2edaae['model'],qs[_0x4837('0x54')](_0x15f644[_0x4837('0x4e')][_0x4837('0x54')]));_0x38ca9e['attributes']=_0x38ca9e[_0x4837('0x53')][_0x4837('0x55')]?_0x38ca9e[_0x4837('0x53')]:_0x2edaae[_0x4837('0x52')];if(!_0x15f644[_0x4837('0x4e')]['hasOwnProperty'](_0x4837('0x57'))){_0x38ca9e['limit']=qs[_0x4837('0x58')](_0x15f644[_0x4837('0x4e')][_0x4837('0x58')]);_0x38ca9e[_0x4837('0x33')]=qs[_0x4837('0x33')](_0x15f644[_0x4837('0x4e')]['offset']);}_0x38ca9e[_0x4837('0x59')]=qs[_0x4837('0x5a')](_0x15f644[_0x4837('0x4e')][_0x4837('0x5a')]);_0x38ca9e['where']=qs[_0x4837('0x50')](_[_0x4837('0x5c')](_0x15f644[_0x4837('0x4e')],_0x2edaae['filters']));_0x38ca9e[_0x4837('0x5b')]['UserId']=_0x4708be['id'];if(_0x15f644[_0x4837('0x4e')][_0x4837('0x3c')]){_0x38ca9e[_0x4837('0x5b')]=_[_0x4837('0x5d')](_0x38ca9e[_0x4837('0x5b')],{'$or':_[_0x4837('0x3e')](_0x38ca9e[_0x4837('0x53')],function(_0x52eac7){var _0x1efa73={};_0x1efa73[_0x52eac7]={'$like':'%'+_0x15f644['query'][_0x4837('0x3c')]+'%'};return _0x1efa73;})});}_0x38ca9e=_[_0x4837('0x5d')]({},_0x38ca9e,_0x15f644[_0x4837('0x61')]);return db['MailInteraction']['count']({'where':_0x38ca9e['where']})[_0x4837('0x24')](function(_0xb05860){_0x5bf6fc[_0x4837('0x32')]=_0xb05860;if(_0x15f644[_0x4837('0x4e')]['includeAll']){_0x38ca9e[_0x4837('0x63')]=[{'all':!![]}];}return db[_0x4837('0xd2')][_0x4837('0x64')](_0x38ca9e);})[_0x4837('0x24')](function(_0x5197b4){_0x5bf6fc['rows']=_0x5197b4;return _0x5bf6fc;});}})[_0x4837('0x24')](respondWithFilteredResult(_0x51d2c0,_0x38ca9e))['catch'](handleError(_0x51d2c0,null));};exports[_0x4837('0xd3')]=function(_0x5e6842,_0x473171,_0x314c33){var _0x40e9d9={};var _0x196ac3={};var _0x4ab8d2;var _0x1ab824;return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0x5e6842['params']['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x473171,null))['then'](function(_0x1a05c9){if(_0x1a05c9){_0x4ab8d2=_0x1a05c9;_0x196ac3['model']=_[_0x4837('0x4f')](db[_0x4837('0xd4')][_0x4837('0x66')]);_0x196ac3[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x5e6842[_0x4837('0x4e')]);_0x196ac3[_0x4837('0x50')]=_[_0x4837('0x51')](_0x196ac3[_0x4837('0x52')],_0x196ac3['query']);_0x40e9d9['attributes']=_[_0x4837('0x51')](_0x196ac3['model'],qs['fields'](_0x5e6842['query'][_0x4837('0x54')]));_0x40e9d9['attributes']=_0x40e9d9[_0x4837('0x53')][_0x4837('0x55')]?_0x40e9d9[_0x4837('0x53')]:_0x196ac3['model'];_0x40e9d9[_0x4837('0x59')]=qs[_0x4837('0x5a')](_0x5e6842[_0x4837('0x4e')]['sort']);_0x40e9d9['where']=qs['filters'](_[_0x4837('0x5c')](_0x5e6842['query'],_0x196ac3[_0x4837('0x50')]));if(_0x5e6842['query'][_0x4837('0x3c')]){_0x40e9d9[_0x4837('0x5b')]=_[_0x4837('0x5d')](_0x40e9d9[_0x4837('0x5b')],{'$or':_[_0x4837('0x3e')](_0x40e9d9[_0x4837('0x53')],function(_0x802672){var _0x194c07={};_0x194c07[_0x802672]={'$like':'%'+_0x5e6842[_0x4837('0x4e')][_0x4837('0x3c')]+'%'};return _0x194c07;})});}_0x40e9d9=_[_0x4837('0x5d')]({},_0x40e9d9,_0x5e6842[_0x4837('0x61')]);return _0x4ab8d2[_0x4837('0xd3')](_0x40e9d9);}})[_0x4837('0x24')](function(_0x142345){if(_0x142345){_0x1ab824=_0x142345[_0x4837('0x55')];if(!_0x5e6842['query'][_0x4837('0x56')](_0x4837('0x57'))){_0x40e9d9[_0x4837('0x58')]=qs[_0x4837('0x58')](_0x5e6842[_0x4837('0x4e')][_0x4837('0x58')]);_0x40e9d9[_0x4837('0x33')]=qs[_0x4837('0x33')](_0x5e6842[_0x4837('0x4e')][_0x4837('0x33')]);}return _0x4ab8d2['getSmsInteractions'](_0x40e9d9);}})[_0x4837('0x24')](function(_0x67e4cc){if(_0x67e4cc){return _0x67e4cc?{'count':_0x1ab824,'rows':_0x67e4cc}:null;}})[_0x4837('0x24')](respondWithResult(_0x473171,null))[_0x4837('0x2d')](handleError(_0x473171,null));};exports[_0x4837('0xd5')]=function(_0x8741c8,_0x56b1c1,_0x24e7ec){var _0x320b8c={};var _0x4c2313={};var _0x492fbd;var _0x7b6ed6;return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0x8741c8[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x56b1c1,null))['then'](function(_0x388100){if(_0x388100){_0x492fbd=_0x388100;_0x4c2313[_0x4837('0x52')]=_[_0x4837('0x4f')](db['FaxInteraction']['rawAttributes']);_0x4c2313['query']=_[_0x4837('0x4f')](_0x8741c8[_0x4837('0x4e')]);_0x4c2313[_0x4837('0x50')]=_[_0x4837('0x51')](_0x4c2313[_0x4837('0x52')],_0x4c2313[_0x4837('0x4e')]);_0x320b8c[_0x4837('0x53')]=_[_0x4837('0x51')](_0x4c2313[_0x4837('0x52')],qs['fields'](_0x8741c8[_0x4837('0x4e')][_0x4837('0x54')]));_0x320b8c[_0x4837('0x53')]=_0x320b8c[_0x4837('0x53')][_0x4837('0x55')]?_0x320b8c['attributes']:_0x4c2313[_0x4837('0x52')];_0x320b8c[_0x4837('0x59')]=qs['sort'](_0x8741c8[_0x4837('0x4e')][_0x4837('0x5a')]);_0x320b8c[_0x4837('0x5b')]=qs['filters'](_['pick'](_0x8741c8[_0x4837('0x4e')],_0x4c2313[_0x4837('0x50')]));if(_0x8741c8[_0x4837('0x4e')][_0x4837('0x3c')]){_0x320b8c[_0x4837('0x5b')]=_[_0x4837('0x5d')](_0x320b8c[_0x4837('0x5b')],{'$or':_[_0x4837('0x3e')](_0x320b8c[_0x4837('0x53')],function(_0x1558aa){var _0x1384d4={};_0x1384d4[_0x1558aa]={'$like':'%'+_0x8741c8[_0x4837('0x4e')]['filter']+'%'};return _0x1384d4;})});}_0x320b8c=_[_0x4837('0x5d')]({},_0x320b8c,_0x8741c8['options']);return _0x492fbd[_0x4837('0xd5')](_0x320b8c);}})[_0x4837('0x24')](function(_0x73f417){if(_0x73f417){_0x7b6ed6=_0x73f417[_0x4837('0x55')];if(!_0x8741c8[_0x4837('0x4e')]['hasOwnProperty']('nolimit')){_0x320b8c[_0x4837('0x58')]=qs['limit'](_0x8741c8[_0x4837('0x4e')][_0x4837('0x58')]);_0x320b8c[_0x4837('0x33')]=qs['offset'](_0x8741c8[_0x4837('0x4e')][_0x4837('0x33')]);}return _0x492fbd['getFaxInteractions'](_0x320b8c);}})[_0x4837('0x24')](function(_0x156477){if(_0x156477){return _0x156477?{'count':_0x7b6ed6,'rows':_0x156477}:null;}})[_0x4837('0x24')](respondWithResult(_0x56b1c1,null))[_0x4837('0x2d')](handleError(_0x56b1c1,null));};exports[_0x4837('0xd6')]=function(_0x1e397b,_0x3efee2,_0x517c7f){var _0x379072;var _0x295e79;var _0x3e2fa6;var _0x963da4=!_['isNil'](_0x1e397b[_0x4837('0x69')]['id'])?_0x1e397b[_0x4837('0x69')]['id']:!_[_0x4837('0x72')](_0x1e397b[_0x4837('0x39')]['id'])?_0x1e397b[_0x4837('0x39')]['id']:null;return db[_0x4837('0x47')][_0x4837('0x42')]({'where':{'id':_0x963da4,'role':{'$or':['admin',_0x4837('0x39'),'agent']}},'attributes':['id','name','phone','mobile',_0x4837('0x41'),_0x4837('0x76'),_0x4837('0x9e')]})['then'](function(_0x14d2d5){if(_0x14d2d5){if(_0x14d2d5[_0x4837('0x41')]===_0x4837('0x83')){_0x379072=_0x14d2d5;if(_0x1e397b[_0x4837('0x68')]['interface']){_0x3e2fa6=util[_0x4837('0x74')](_0x4837('0xd7'),_0x379072[_0x1e397b['body'][_0x4837('0xa0')]]);}else if(_0x1e397b['body']['intrf']){_0x3e2fa6=util[_0x4837('0x74')](_0x4837('0xab'),_0x1e397b[_0x4837('0x68')]['intrf']);}else{_0x3e2fa6=util[_0x4837('0x74')](_0x4837('0xab'),_0x379072[_0x4837('0x43')]);}socket['to'](util[_0x4837('0x74')](_0x4837('0xd8'),_0x379072[_0x4837('0x43')]))[_0x4837('0xa6')](_0x4837('0xd9'),{'ip':_0x1e397b['headers'][_0x4837('0xda')]||_0x1e397b[_0x4837('0xdb')]['remoteAddress']||_0x1e397b['socket']['remoteAddress']||_0x1e397b['connection'][_0x4837('0xdc')][_0x4837('0xdd')]});return db['UserVoiceQueueRt'][_0x4837('0x44')]({'where':{'membername':_0x379072[_0x4837('0x43')]},'individualHooks':!![]});}}else{throw new db[(_0x4837('0x20'))]['ValidationError'](_0x4837('0xde'));}})[_0x4837('0x24')](function(){if(_0x379072){return _0x379072[_0x4837('0xdf')]({'raw':!![]});}})[_0x4837('0x24')](function(_0x1802b7){if(_0x379072){var _0x479801=[];if(_0x1802b7){_0x295e79=_0x1802b7;if(_0x295e79['length']){for(var _0x4f691f=0x0;_0x4f691f<_0x295e79['length'];_0x4f691f++){_0x479801[_0x4837('0xaa')]({'membername':_0x379072[_0x4837('0x43')],'UserId':_0x379072['id'],'queue_name':_0x295e79[_0x4f691f]['name'],'VoiceQueueId':_0x295e79[_0x4f691f]['id'],'interface':_0x3e2fa6,'paused':_0x379072[_0x4837('0x9e')]||![],'penalty':_0x295e79[_0x4f691f][_0x4837('0xe0')]||0x0});}return BPromise['each'](_0x479801,function(_0x50bf6c){return db[_0x4837('0xc6')][_0x4837('0xe1')](_0x50bf6c);});}}}})[_0x4837('0x24')](function(){if(_0x379072){return db[_0x4837('0xe2')]['findAll']({'where':{'membername':_0x379072[_0x4837('0x43')],'exitAt':null}});}})['then'](function(_0x39d22c){if(_0x379072){var _0x41fb37=[];_0x39d22c[_0x4837('0xe3')](function(_0x21a804){_0x41fb37[_0x4837('0xaa')](_0x21a804[_0x4837('0x37')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x4837('0xe4')](_0x41fb37);}})[_0x4837('0x24')](function(){if(_0x379072){var _0x396b8a=[];var _0xa47ad=[];var _0x5886c9=utils[_0x4837('0xe5')]();var _0x353bf2={'membername':_0x379072[_0x4837('0x43')],'interface':_0x3e2fa6,'enterAt':moment()[_0x4837('0x74')](_0x4837('0xe6')),'role':_0x379072['role'],'internal':_0x379072[_0x4837('0x76')]};_0x5886c9['forEach'](function(_0x6b4ca0){_0x396b8a['push'](_[_0x4837('0x5d')]({'channel':_0x6b4ca0,'type':_0x4837('0xe7'),'data1':_0x1e397b[_0x4837('0x68')][_0x4837('0xe8')],'data2':_0x3e2fa6},_0x353bf2));if(_0x379072[_0x4837('0x9e')]){_0xa47ad['push'](_[_0x4837('0x5d')]({'channel':_0x6b4ca0,'type':'PAUSE','data1':_0x4837('0xe9')},_0x353bf2));}});return db[_0x4837('0xe2')][_0x4837('0x67')](_0x396b8a[_0x4837('0xea')](_0xa47ad),{'individualHooks':!![]});}})[_0x4837('0x24')](function(){if(_0x379072){return _0x379072['update']({'online':!![],'lastLoginAt':moment()[_0x4837('0x74')](_0x4837('0xe6')),'voicePause':_0x379072[_0x4837('0x9e')]||![],'mailPause':_0x379072[_0x4837('0x9e')]||![],'chatPause':_0x379072[_0x4837('0x9e')]||![],'faxPause':_0x379072[_0x4837('0x9e')]||![],'smsPause':_0x379072[_0x4837('0x9e')]||![],'openchannelPause':_0x379072[_0x4837('0x9e')]||![],'pauseType':_0x379072['loginInPause']?_0x4837('0xe9'):null,'interface':_0x3e2fa6,'lastPauseAt':moment()[_0x4837('0x74')](_0x4837('0xe6'))});}})['then'](function(_0x182169){if(_0x1e397b[_0x4837('0xeb')]){return _0x517c7f();}else{return BPromise['resolve'](_0x182169)[_0x4837('0x24')](respondWithResult(_0x3efee2,null));}})[_0x4837('0x2d')](handleError(_0x3efee2,null));};exports[_0x4837('0xec')]=function(_0x5f1910,_0x2f1696,_0x3cc01e){var _0x3b79a9;return db['User'][_0x4837('0x42')]({'where':{'id':_0x5f1910[_0x4837('0x69')]['id'],'role':_0x4837('0x83')},'attributes':['id',_0x4837('0x43'),_0x4837('0x41')]})[_0x4837('0x24')](handleEntityNotFound(_0x2f1696,null))[_0x4837('0x24')](function(_0x38fa9e){if(_0x38fa9e){_0x3b79a9=_0x38fa9e;return db[_0x4837('0xc6')][_0x4837('0x44')]({'where':{'membername':_0x3b79a9[_0x4837('0x43')]},'individualHooks':!![]});}})[_0x4837('0x24')](function(){return db[_0x4837('0xe2')]['findAll']({'where':{'membername':_0x3b79a9[_0x4837('0x43')],'exitAt':null}});})['then'](function(_0xbb16b5){var _0x26afb3=[];_0xbb16b5[_0x4837('0xe3')](function(_0x277a05){_0x26afb3['push'](_0x277a05[_0x4837('0x37')]({'exitAt':moment()[_0x4837('0x74')](_0x4837('0xe6'))}));});return BPromise[_0x4837('0xe4')](_0x26afb3);})[_0x4837('0x24')](function(){return _0x3b79a9[_0x4837('0x37')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x4837('0x24')](respondWithResult(_0x2f1696,null))['catch'](handleError(_0x2f1696,null));};exports[_0x4837('0xed')]=function(_0x5a6988,_0x49dce2,_0x44d4a5){var _0x458daa;return db[_0x4837('0xc6')][_0x4837('0x37')]({'paused':0x1},{'where':{'UserId':_0x5a6988[_0x4837('0x69')]['id']},'individualHooks':!![]})['then'](function(){return db['User']['find']({'where':{'id':_0x5a6988[_0x4837('0x69')]['id'],'role':_0x4837('0x83')},'attributes':['id',_0x4837('0x43'),_0x4837('0x41'),_0x4837('0x76'),_0x4837('0xa0')]});})[_0x4837('0x24')](handleEntityNotFound(_0x49dce2,null))[_0x4837('0x24')](function(_0x57897){if(_0x57897){_0x458daa=_0x57897;return respondWithRpcPromise(_0x4837('0xee'),_0x4837('0xed'),{'id':_0x458daa['id'],'name':_0x458daa[_0x4837('0x43')],'pause':!![]});}})[_0x4837('0x24')](function(){if(_0x458daa){return db[_0x4837('0xe2')]['findAll']({'where':{'membername':_0x458daa[_0x4837('0x43')],'type':_0x4837('0xef'),'exitAt':null}});}})['then'](function(_0x143254){if(_0x143254['length']){var _0x3a3f28=moment()[_0x4837('0x74')](_0x4837('0xe6'));for(var _0x48ed46=0x0,_0x2a0976=_0x143254[_0x4837('0x55')];_0x48ed46<_0x2a0976;_0x48ed46++){_0x143254[_0x48ed46][_0x4837('0xf0')]({'exitAt':_0x3a3f28});}}})[_0x4837('0x24')](function(){var _0x4120d0=[];var _0x2909f3=utils['getChannels']();_0x2909f3['forEach'](function(_0xd9de91){_0x4120d0[_0x4837('0xaa')]({'channel':_0xd9de91,'membername':_0x458daa[_0x4837('0x43')],'interface':_['isNil'](_0x458daa[_0x4837('0xa0')])?util['format'](_0x4837('0xab'),_0x458daa['name']):_0x458daa[_0x4837('0xa0')],'type':_0x4837('0xef'),'enterAt':moment()['format'](_0x4837('0xe6')),'data1':_0x5a6988['body']['type']||'DEFAULT\x20PAUSE','role':_0x458daa[_0x4837('0x41')],'internal':_0x458daa[_0x4837('0x76')]});});return db[_0x4837('0xe2')][_0x4837('0x67')](_0x4120d0,{'individualHooks':!![]});})[_0x4837('0x24')](function(){return _0x458daa[_0x4837('0x37')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x5a6988[_0x4837('0x68')][_0x4837('0x49')]||_0x4837('0xf1'),'lastPauseAt':moment()[_0x4837('0x74')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x4837('0x24')](respondWithResult(_0x49dce2,null))[_0x4837('0x2d')](handleError(_0x49dce2,null));};exports[_0x4837('0xf2')]=function(_0x549eea,_0xe8ae40,_0x503577){var _0x53ca9d;return db[_0x4837('0x47')][_0x4837('0x42')]({'where':{'id':_0x549eea[_0x4837('0x69')]['id']},'attributes':['id',_0x4837('0x43'),_0x4837('0x41'),_0x4837('0x9f'),_0x4837('0xf3'),_0x4837('0xf4'),_0x4837('0xf5'),_0x4837('0xf6'),_0x4837('0xf7'),'pauseType','lastPauseAt']})['then'](handleEntityNotFound(_0xe8ae40,null))['then'](function(_0xa47d6a){if(_0xa47d6a){_0x53ca9d=_0xa47d6a;if(_0x549eea['body'][_0x4837('0x9c')]&&!utils['isValidChannel'](_0x549eea[_0x4837('0x68')][_0x4837('0x9c')])){throw new db[(_0x4837('0x20'))]['ValidationError']('Unknown\x20channel');}switch(_0x549eea[_0x4837('0x68')]['channel']){case'voice':return respondWithRpcPromise(_0x4837('0xee'),_0x4837('0xf2'),{'id':_0x53ca9d['id'],'name':_0x53ca9d['name'],'pause':![]})[_0x4837('0x24')](function(){return db[_0x4837('0xc6')]['update']({'paused':0x0},{'where':{'UserId':_0x53ca9d['id']},'individualHooks':!![]});})[_0x4837('0x24')](function(){return db['MemberReport'][_0x4837('0x42')]({'where':{'channel':_0x549eea[_0x4837('0x68')][_0x4837('0x9c')],'membername':_0x53ca9d['name'],'type':_0x4837('0xef'),'exitAt':null}});})['then'](function(_0x5f2323){if(_0x5f2323){return _0x5f2323['update']({'exitAt':moment()[_0x4837('0x74')](_0x4837('0xe6')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x4837('0x24')](function(){return _0x53ca9d[_0x4837('0x37')]({'voicePause':![]});});case'mail':case _0x4837('0xf8'):case'fax':case'sms':case'openchannel':return db[_0x4837('0xe2')][_0x4837('0x42')]({'where':{'channel':_0x549eea[_0x4837('0x68')][_0x4837('0x9c')],'membername':_0x53ca9d[_0x4837('0x43')],'type':_0x4837('0xef'),'exitAt':null}})[_0x4837('0x24')](function(_0x16a822){if(_0x16a822){return _0x16a822['update']({'exitAt':moment()[_0x4837('0x74')](_0x4837('0xe6')),'data2':_0x4837('0xf9')},{'individualHooks':!![]});}return null;})[_0x4837('0x24')](function(){var _0x11b208={};_[_0x4837('0xfa')](_0x11b208,util[_0x4837('0x74')]('%s%s',_0x549eea[_0x4837('0x68')][_0x4837('0x9c')],_0x4837('0xfb')),![]);return _0x53ca9d[_0x4837('0x37')](_0x11b208);});default:return respondWithRpcPromise(_0x4837('0xee'),_0x4837('0xf2'),{'id':_0x53ca9d['id'],'name':_0x53ca9d[_0x4837('0x43')],'pause':![]})['then'](function(){return db[_0x4837('0xc6')]['update']({'paused':0x0},{'where':{'UserId':_0x53ca9d['id']}});})[_0x4837('0x24')](function(){return db[_0x4837('0xe2')][_0x4837('0x64')]({'where':{'membername':_0x53ca9d['name'],'type':_0x4837('0xef'),'exitAt':null}});})['then'](function(_0x4312eb){var _0x2e4b47=[];_0x4312eb[_0x4837('0xe3')](function(_0xf3dc05){_0x2e4b47[_0x4837('0xaa')](_0xf3dc05[_0x4837('0x37')]({'exitAt':moment()[_0x4837('0x74')](_0x4837('0xe6')),'data2':_0x4837('0xf9')}));});return BPromise[_0x4837('0xe4')](_0x2e4b47);})[_0x4837('0x24')](function(){return _0x53ca9d[_0x4837('0x37')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x4837('0x24')](respondWithResult(_0xe8ae40,null))['catch'](handleError(_0xe8ae40,null));};exports[_0x4837('0xfc')]=function(_0xe6dc4c,_0x21232e,_0x591bbd){var _0x30cab7={};var _0x1c1498={};var _0x964f9f;var _0x292599;return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0xe6dc4c[_0x4837('0x69')]['id']}})[_0x4837('0x24')](handleEntityNotFound(_0x21232e,null))[_0x4837('0x24')](function(_0x202435){if(_0x202435){_0x964f9f=_0x202435;_0x1c1498[_0x4837('0x52')]=_['keys'](db[_0x4837('0xfd')][_0x4837('0x66')]);_0x1c1498['query']=_[_0x4837('0x4f')](_0xe6dc4c[_0x4837('0x4e')]);_0x1c1498[_0x4837('0x50')]=_['intersection'](_0x1c1498[_0x4837('0x52')],_0x1c1498['query']);_0x30cab7['attributes']=_['intersection'](_0x1c1498[_0x4837('0x52')],qs['fields'](_0xe6dc4c[_0x4837('0x4e')][_0x4837('0x54')]));_0x30cab7[_0x4837('0x53')]=_0x30cab7[_0x4837('0x53')][_0x4837('0x55')]?_0x30cab7[_0x4837('0x53')]:_0x1c1498[_0x4837('0x52')];_0x30cab7[_0x4837('0x59')]=qs[_0x4837('0x5a')](_0xe6dc4c[_0x4837('0x4e')][_0x4837('0x5a')]);_0x30cab7['where']=qs[_0x4837('0x50')](_[_0x4837('0x5c')](_0xe6dc4c[_0x4837('0x4e')],_0x1c1498[_0x4837('0x50')]));if(_0xe6dc4c[_0x4837('0x4e')][_0x4837('0x3c')]){_0x30cab7[_0x4837('0x5b')]=_[_0x4837('0x5d')](_0x30cab7[_0x4837('0x5b')],{'$or':_[_0x4837('0x3e')](_0x30cab7[_0x4837('0x53')],function(_0x4aad6f){var _0x526928={};_0x526928[_0x4aad6f]={'$like':'%'+_0xe6dc4c[_0x4837('0x4e')][_0x4837('0x3c')]+'%'};return _0x526928;})});}_0x30cab7=_['merge']({},_0x30cab7,_0xe6dc4c[_0x4837('0x61')]);return _0x964f9f[_0x4837('0xfc')](_0x30cab7);}})[_0x4837('0x24')](function(_0x3b486c){if(_0x3b486c){_0x292599=_0x3b486c[_0x4837('0x55')];if(!_0xe6dc4c[_0x4837('0x4e')]['hasOwnProperty']('nolimit')){_0x30cab7['limit']=qs['limit'](_0xe6dc4c['query'][_0x4837('0x58')]);_0x30cab7['offset']=qs[_0x4837('0x33')](_0xe6dc4c[_0x4837('0x4e')][_0x4837('0x33')]);}return _0x964f9f['getTeams'](_0x30cab7);}})[_0x4837('0x24')](function(_0x52d85c){if(_0x52d85c){return _0x52d85c?{'count':_0x292599,'rows':_0x52d85c}:null;}})[_0x4837('0x24')](respondWithResult(_0x21232e,null))[_0x4837('0x2d')](handleError(_0x21232e,null));};exports[_0x4837('0xfe')]=function(_0x4927e7,_0x166a33){return db[_0x4837('0x47')]['find']({'where':{'id':_0x4927e7[_0x4837('0x69')]['id']}})['then'](handleEntityNotFound(_0x166a33,null))[_0x4837('0x24')](function(_0x41216a){if(_0x41216a){var _0xf24124=_0x41216a['get']({'plain':!![]});return _0x41216a[_0x4837('0xfe')](_0x4927e7[_0x4837('0x68')][_0x4837('0x6c')],_[_0x4837('0x6d')](_0x4927e7[_0x4837('0x68')],[_0x4837('0x6c'),'id'])||{})['then'](function(){for(var _0x3655b2=0x0;_0x3655b2<_0x4927e7['body'][_0x4837('0x6c')][_0x4837('0x55')];_0x3655b2++){var _0x5448c8=[];db[_0x4837('0xfd')]['findOne']({'where':{'id':_0x4927e7[_0x4837('0x68')]['ids'][_0x3655b2]}})['then'](function(_0x452cf8){_0x5448c8['push'](_0x452cf8['getVoiceQueues']()[_0x4837('0x24')](function(_0x115c10){for(var _0x1e9f88=0x0;_0x1e9f88<_0x115c10[_0x4837('0x55')];_0x1e9f88++){_0x115c10[_0x1e9f88][_0x4837('0xff')](_0x4837('0x9c'),_0x4837('0x100'));}return _0x115c10;}));_0x5448c8[_0x4837('0xaa')](_0x452cf8['getChatQueues']()['then'](function(_0x2da44b){for(var _0x33c7f0=0x0;_0x33c7f0<_0x2da44b[_0x4837('0x55')];_0x33c7f0++){_0x2da44b[_0x33c7f0][_0x4837('0xff')](_0x4837('0x9c'),_0x4837('0x101'));}return _0x2da44b;}));_0x5448c8[_0x4837('0xaa')](_0x452cf8[_0x4837('0x102')]()['then'](function(_0x1b7200){for(var _0x5788aa=0x0;_0x5788aa<_0x1b7200[_0x4837('0x55')];_0x5788aa++){_0x1b7200[_0x5788aa][_0x4837('0xff')]('channel',_0x4837('0x103'));}return _0x1b7200;}));_0x5448c8['push'](_0x452cf8[_0x4837('0x104')]()['then'](function(_0x5dc1f1){for(var _0x2a48fd=0x0;_0x2a48fd<_0x5dc1f1['length'];_0x2a48fd++){_0x5dc1f1[_0x2a48fd][_0x4837('0xff')](_0x4837('0x9c'),_0x4837('0x105'));}return _0x5dc1f1;}));_0x5448c8[_0x4837('0xaa')](_0x452cf8[_0x4837('0x106')]()[_0x4837('0x24')](function(_0x174d12){for(var _0x44c6f7=0x0;_0x44c6f7<_0x174d12[_0x4837('0x55')];_0x44c6f7++){_0x174d12[_0x44c6f7][_0x4837('0xff')]('channel','Fax');}return _0x174d12;}));_0x5448c8[_0x4837('0xaa')](_0x452cf8[_0x4837('0x107')]()[_0x4837('0x24')](function(_0xa9692e){for(var _0x4a2c24=0x0;_0x4a2c24<_0xa9692e[_0x4837('0x55')];_0x4a2c24++){_0xa9692e[_0x4a2c24][_0x4837('0xff')](_0x4837('0x9c'),'Openchannel');}return _0xa9692e;}));return BPromise[_0x4837('0xe4')](_0x5448c8);})['then'](function(_0x4d9eb4){var _0x12ac45=_[_0x4837('0x108')](_0x4d9eb4);_0x5448c8=[];return db[_0x4837('0x5e')]['transaction'](function(_0x75ed79){for(var _0x5b458e=0x0;_0x5b458e<_0x12ac45[_0x4837('0x55')];_0x5b458e++){_0x5448c8['push'](_0x12ac45[_0x5b458e]['addAgent'](_0xf24124['id']),{'transaction':_0x75ed79});}return BPromise[_0x4837('0xe4')](_0x5448c8)[_0x4837('0x24')](function(){if(_0xf24124[_0x4837('0x9d')]){return BPromise[_0x4837('0xad')](_['filter'](_0x12ac45,function(_0x5adfa7){return _0x5adfa7[_0x4837('0x109')](_0x4837('0x9c'))===_0x4837('0x100');}),function(_0x5c2b7b){return db[_0x4837('0xc6')][_0x4837('0xe1')]({'membername':_0xf24124[_0x4837('0x43')],'UserId':_0xf24124['id'],'queue_name':_0x5c2b7b['name'],'VoiceQueueId':_0x5c2b7b['id'],'interface':_[_0x4837('0x72')](_0xf24124[_0x4837('0xa0')])?util[_0x4837('0x74')](_0x4837('0xab'),_0xf24124[_0x4837('0x43')]):_0xf24124[_0x4837('0xa0')],'paused':_0xf24124['voicePause']||![],'penalty':_0xf24124[_0x4837('0xac')]},{'transaction':_0x75ed79});});}else{return;}})[_0x4837('0x24')](function(){for(var _0x5d1ae8=0x0;_0x5d1ae8<_0x12ac45[_0x4837('0x55')];_0x5d1ae8++){var _0x2ccf2d=_0x12ac45[_0x5d1ae8][_0x4837('0x109')](_0x4837('0x9c'));var _0x3e3045=_0x2ccf2d+_0x4837('0xb1');socket[_0x4837('0xa6')](_0x4837('0x39')+_0x2ccf2d+_0x4837('0xa7'),{'UserId':_0xf24124['id'],['queueField']:_0x12ac45[_0x5d1ae8]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x166a33,null))[_0x4837('0x2d')](handleError(_0x166a33,null));};exports[_0x4837('0x10a')]=function(_0x41c3fd,_0x149fec){return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0x41c3fd['params']['id']}})['then'](handleEntityNotFound(_0x149fec,null))[_0x4837('0x24')](function(_0xf5c95a){if(_0xf5c95a){var _0x40889c=_0xf5c95a[_0x4837('0x38')]({'plain':!![]});var _0x3e7f90=_0x41c3fd[_0x4837('0x4e')][_0x4837('0x6c')];return _0xf5c95a[_0x4837('0x10a')](_0x3e7f90)[_0x4837('0x24')](function(){for(var _0x27d6a4=0x0;_0x27d6a4<_0x3e7f90['length'];_0x27d6a4++){var _0x2c7955=[];db[_0x4837('0xfd')]['findOne']({'where':{'id':_0x3e7f90[_0x27d6a4]}})[_0x4837('0x24')](function(_0x186c80){_0x2c7955['push'](_0x186c80[_0x4837('0xdf')]()[_0x4837('0x24')](function(_0x2182ec){for(var _0x42dfba=0x0;_0x42dfba<_0x2182ec[_0x4837('0x55')];_0x42dfba++){_0x2182ec[_0x42dfba]['setDataValue']('channel',_0x4837('0x100'));}return _0x2182ec;}));_0x2c7955[_0x4837('0xaa')](_0x186c80[_0x4837('0x10b')]()[_0x4837('0x24')](function(_0x4bb29e){for(var _0x786768=0x0;_0x786768<_0x4bb29e[_0x4837('0x55')];_0x786768++){_0x4bb29e[_0x786768][_0x4837('0xff')](_0x4837('0x9c'),_0x4837('0x101'));}return _0x4bb29e;}));_0x2c7955[_0x4837('0xaa')](_0x186c80[_0x4837('0x102')]()[_0x4837('0x24')](function(_0x1c654e){for(var _0x2ec308=0x0;_0x2ec308<_0x1c654e[_0x4837('0x55')];_0x2ec308++){_0x1c654e[_0x2ec308]['setDataValue']('channel','Mail');}return _0x1c654e;}));_0x2c7955[_0x4837('0xaa')](_0x186c80[_0x4837('0x104')]()[_0x4837('0x24')](function(_0x3984f2){for(var _0x49244d=0x0;_0x49244d<_0x3984f2[_0x4837('0x55')];_0x49244d++){_0x3984f2[_0x49244d][_0x4837('0xff')](_0x4837('0x9c'),_0x4837('0x105'));}return _0x3984f2;}));_0x2c7955[_0x4837('0xaa')](_0x186c80[_0x4837('0x106')]()[_0x4837('0x24')](function(_0x2b0604){for(var _0x3173a1=0x0;_0x3173a1<_0x2b0604['length'];_0x3173a1++){_0x2b0604[_0x3173a1][_0x4837('0xff')](_0x4837('0x9c'),_0x4837('0x10c'));}return _0x2b0604;}));_0x2c7955[_0x4837('0xaa')](_0x186c80[_0x4837('0x107')]()[_0x4837('0x24')](function(_0x1c3577){for(var _0x26abb7=0x0;_0x26abb7<_0x1c3577[_0x4837('0x55')];_0x26abb7++){_0x1c3577[_0x26abb7][_0x4837('0xff')]('channel','Openchannel');}return _0x1c3577;}));return BPromise[_0x4837('0xe4')](_0x2c7955);})[_0x4837('0x24')](function(_0x13c71d){var _0x51e441=_[_0x4837('0x108')](_0x13c71d);_0x2c7955=[];return db[_0x4837('0x5e')][_0x4837('0x10d')](function(_0x585bf0){for(var _0x3cf9d2=0x0;_0x3cf9d2<_0x51e441['length'];_0x3cf9d2++){_0x2c7955[_0x4837('0xaa')](_0x51e441[_0x3cf9d2][_0x4837('0x10e')](_0x40889c['id']),{'transaction':_0x585bf0});}return BPromise[_0x4837('0xe4')](_0x2c7955)['then'](function(){if(_0x40889c[_0x4837('0x9d')]){return BPromise[_0x4837('0xad')](_[_0x4837('0x3c')](_0x51e441,function(_0x41e2df){return _0x41e2df['getDataValue']('channel')===_0x4837('0x100');}),function(_0x43c9c4){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x43c9c4['id'],'UserId':_0x40889c['id']},'transaction':_0x585bf0});});}else{return;}})['then'](function(){for(var _0x4c6e9f=0x0;_0x4c6e9f<_0x51e441[_0x4837('0x55')];_0x4c6e9f++){var _0x43a6a8=_0x51e441[_0x4c6e9f]['getDataValue']('channel');var _0x528187=_0x43a6a8+_0x4837('0xb1');socket[_0x4837('0xa6')]('user'+_0x43a6a8+_0x4837('0xb2'),{'UserId':_0x40889c['id'],['queueField']:_0x51e441[_0x4c6e9f]['id']});}});});});}});}})[_0x4837('0x24')](respondWithStatusCode(_0x149fec,null))['catch'](handleError(_0x149fec,null));};exports[_0x4837('0x10f')]=function(_0x20bcf1,_0x3786ea,_0x4830e5){var _0x4a7bf6={};var _0x31a2fc={};var _0x86d124;var _0x45a227;return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0x20bcf1[_0x4837('0x69')]['id']}})['then'](handleEntityNotFound(_0x3786ea,null))[_0x4837('0x24')](function(_0x54abae){if(_0x54abae){_0x86d124=_0x54abae;_0x31a2fc[_0x4837('0x52')]=_[_0x4837('0x4f')](db[_0x4837('0xbd')]['rawAttributes']);_0x31a2fc[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x20bcf1[_0x4837('0x4e')]);_0x31a2fc[_0x4837('0x50')]=_[_0x4837('0x51')](_0x31a2fc[_0x4837('0x52')],_0x31a2fc[_0x4837('0x4e')]);_0x4a7bf6[_0x4837('0x53')]=_[_0x4837('0x51')](_0x31a2fc[_0x4837('0x52')],qs[_0x4837('0x54')](_0x20bcf1[_0x4837('0x4e')][_0x4837('0x54')]));_0x4a7bf6[_0x4837('0x53')]=_0x4a7bf6[_0x4837('0x53')][_0x4837('0x55')]?_0x4a7bf6[_0x4837('0x53')]:_0x31a2fc[_0x4837('0x52')];_0x4a7bf6['order']=qs[_0x4837('0x5a')](_0x20bcf1['query']['sort']);_0x4a7bf6[_0x4837('0x5b')]=qs[_0x4837('0x50')](_[_0x4837('0x5c')](_0x20bcf1[_0x4837('0x4e')],_0x31a2fc[_0x4837('0x50')]));if(_0x20bcf1[_0x4837('0x4e')][_0x4837('0x3c')]){_0x4a7bf6[_0x4837('0x5b')]=_[_0x4837('0x5d')](_0x4a7bf6['where'],{'$or':_['map'](_0x4a7bf6[_0x4837('0x53')],function(_0x10528e){var _0xec43d={};_0xec43d[_0x10528e]={'$like':'%'+_0x20bcf1[_0x4837('0x4e')][_0x4837('0x3c')]+'%'};return _0xec43d;})});}_0x4a7bf6=_[_0x4837('0x5d')]({},_0x4a7bf6,_0x20bcf1[_0x4837('0x61')]);return _0x86d124['getLists'](_0x4a7bf6);}})[_0x4837('0x24')](function(_0x19747c){if(_0x19747c){_0x45a227=_0x19747c[_0x4837('0x55')];if(!_0x20bcf1[_0x4837('0x4e')][_0x4837('0x56')]('nolimit')){_0x4a7bf6[_0x4837('0x58')]=qs[_0x4837('0x58')](_0x20bcf1[_0x4837('0x4e')]['limit']);_0x4a7bf6[_0x4837('0x33')]=qs[_0x4837('0x33')](_0x20bcf1[_0x4837('0x4e')][_0x4837('0x33')]);}return _0x86d124[_0x4837('0x10f')](_0x4a7bf6);}})[_0x4837('0x24')](function(_0x360eae){if(_0x360eae){return _0x360eae?{'count':_0x45a227,'rows':_0x360eae}:null;}})[_0x4837('0x24')](respondWithResult(_0x3786ea,null))['catch'](handleError(_0x3786ea,null));};exports[_0x4837('0x110')]=function(_0x530bc5,_0x4f631,_0x127514){var _0x58a0a8={};var _0x431705={};var _0x5693be;var _0x440c42;return db[_0x4837('0x47')][_0x4837('0x94')]({'where':{'id':_0x530bc5[_0x4837('0x69')]['id']}})['then'](handleEntityNotFound(_0x4f631,null))[_0x4837('0x24')](function(_0x9adf70){if(_0x9adf70){_0x5693be=_0x9adf70;_0x431705['model']=_[_0x4837('0x4f')](db[_0x4837('0x47')][_0x4837('0x66')]);_0x431705[_0x4837('0x4e')]=_[_0x4837('0x4f')](_0x530bc5[_0x4837('0x4e')]);_0x431705['filters']=_['intersection'](_0x431705[_0x4837('0x52')],_0x431705['query']);_0x58a0a8[_0x4837('0x53')]=_['intersection'](_0x431705[_0x4837('0x52')],qs[_0x4837('0x54')](_0x530bc5[_0x4837('0x4e')]['fields']));_0x58a0a8[_0x4837('0x53')]=_0x58a0a8[_0x4837('0x53')][_0x4837('0x55')]?_0x58a0a8[_0x4837('0x53')]:_0x431705[_0x4837('0x52')];_0x58a0a8[_0x4837('0x59')]=qs[_0x4837('0x5a')](_0x530bc5[_0x4837('0x4e')][_0x4837('0x5a')]);_0x58a0a8['where']=qs['filters'](_[_0x4837('0x5c')](_0x530bc5['query'],_0x431705[_0x4837('0x50')]));if(_0x530bc5[_0x4837('0x4e')]['filter']){_0x58a0a8['where']=_[_0x4837('0x5d')](_0x58a0a8[_0x4837('0x5b')],{'$or':_[_0x4837('0x3e')](_0x58a0a8['attributes'],function(_0x505af0){var _0x3afbb7={};_0x3afbb7[_0x505af0]={'$like':'%'+_0x530bc5[_0x4837('0x4e')][_0x4837('0x3c')]+'%'};return _0x3afbb7;})});}_0x58a0a8[_0x4837('0x52')]=db[_0x4837('0x47')];_0x58a0a8['as']=_0x4837('0x3a');_0x58a0a8=_[_0x4837('0x5d')]({},_0x58a0a8,_0x530bc5[_0x4837('0x61')]);return _0x5693be['getVoiceQueues']({'include':[_0x58a0a8]});}})[_0x4837('0x24')](function(_0x2103ec){if(_0x2103ec){var _0x50b8ce={},_0xf9880b=[],_0x1e1e96=0x0;for(var _0x493d28=0x0;_0x493d28<_0x2103ec['length'];_0x493d28+=0x1){for(var _0x34efdd=0x0,_0x5585cf;_0x34efdd<_0x2103ec[_0x493d28][_0x4837('0x3a')][_0x4837('0x55')];_0x34efdd+=0x1){_0x5585cf=_0x2103ec[_0x493d28][_0x4837('0x3a')][_0x34efdd][_0x4837('0x38')]({'plain':!![]});_0x50b8ce[_0x5585cf['id']]=_0x5585cf;}}_0x50b8ce=_['values'](_0x50b8ce);for(var _0x6904a2=qs[_0x4837('0x33')](_0x530bc5['query'][_0x4837('0x33')]);_0x6904a2<_0x50b8ce[_0x4837('0x55')]&&_0xf9880b['length']=_0x17cb4d){_0x139adc=_0x17cb4d;_0x52300b=0xc8;}else{_0x52300b=0xce;}_0x30a5d7[_0xf323('0x30')](_0x52300b);return _0x30a5d7['set'](_0xf323('0x36'),_0x1723b7+'-'+_0x139adc+'/'+_0x17cb4d)[_0xf323('0x32')](_0x36bd3f);}return null;};}function patchUpdates(_0x2c9b8f){return function(_0x25c528){try{jsonpatch[_0xf323('0x37')](_0x25c528,_0x2c9b8f,!![]);}catch(_0x485cbf){return BPromise[_0xf323('0x38')](_0x485cbf);}return _0x25c528[_0xf323('0x39')]();};}function saveUpdates(_0x336315,_0x35121f){return function(_0x4fc6bd){if(_0x4fc6bd){return _0x4fc6bd[_0xf323('0x3a')](_0x336315)['then'](function(_0x372c47){return _0x372c47;});}return null;};}function removeEntity(_0x14f9fd,_0x4ff3c1){return function(_0x3dcac7){if(_0x3dcac7){return _0x3dcac7['destroy']()[_0xf323('0x3b')](function(){var _0x4a49d2=_0x3dcac7[_0xf323('0x3c')]({'plain':!![]});var _0x4f28fb=[{'name':_0xf323('0x3d'),'value':_0xf323('0x3e'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':'Telephones','value':_0xf323('0x3f'),'ignore':![]}];var _0x277a6c=_(_0x4f28fb)[_0xf323('0x40')](_0xf323('0x41'))[_0xf323('0x42')]('value')['value']();if(_['includes'](_0x277a6c,_0x4a49d2[_0xf323('0x43')])){return;}var _0x59fee2=_[_0xf323('0x44')](_0x4f28fb,['value',_0x4a49d2[_0xf323('0x43')]])[_0xf323('0x45')];return db[_0xf323('0x46')][_0xf323('0x47')]({'where':{'type':_0x59fee2,'resourceId':_0x4a49d2['id']}})[_0xf323('0x3b')](function(){return _0x3dcac7;});})['then'](function(){_0x14f9fd[_0xf323('0x30')](0xcc)[_0xf323('0x31')]();});}};}function handleEntityNotFound(_0x408b66,_0x27ddcc){return function(_0x455f75){if(!_0x455f75){_0x408b66[_0xf323('0x2f')](0x194);}return _0x455f75;};}function handleError(_0x288428,_0x2dcb00){_0x2dcb00=_0x2dcb00||0x1f4;return function(_0x3cbe88){logger[_0xf323('0x2a')](_0x3cbe88[_0xf323('0x48')]);if(_0x3cbe88[_0xf323('0x45')]){delete _0x3cbe88[_0xf323('0x45')];}_0x288428[_0xf323('0x30')](_0x2dcb00)[_0xf323('0x49')](_0x3cbe88);};}exports[_0xf323('0x4a')]=function(_0x5bb658,_0x502114){var _0x1818c4={},_0x16ac6d={},_0x2864f7={'count':0x0,'rows':[]};var _0xb21a85=_[_0xf323('0x42')](db[_0xf323('0x4b')][_0xf323('0x4c')],function(_0x125047){return{'name':_0x125047[_0xf323('0x4d')],'type':_0x125047[_0xf323('0x4e')][_0xf323('0x4f')]};});_0x16ac6d[_0xf323('0x50')]=_[_0xf323('0x51')](_['map'](_0xb21a85,_0xf323('0x45')),['password','salt']);_0x16ac6d[_0xf323('0x52')]=_['keys'](_0x5bb658['query']);_0x16ac6d[_0xf323('0x53')]=_[_0xf323('0x54')](_0x16ac6d[_0xf323('0x50')],_0x16ac6d[_0xf323('0x52')]);_0x1818c4[_0xf323('0x55')]=_[_0xf323('0x54')](_0x16ac6d[_0xf323('0x50')],qs[_0xf323('0x56')](_0x5bb658[_0xf323('0x52')][_0xf323('0x56')]));_0x1818c4[_0xf323('0x55')]=_0x1818c4['attributes'][_0xf323('0x57')]?_0x1818c4['attributes']:_0x16ac6d[_0xf323('0x50')];if(!_0x5bb658[_0xf323('0x52')][_0xf323('0x58')](_0xf323('0x59'))){_0x1818c4['limit']=qs['limit'](_0x5bb658[_0xf323('0x52')]['limit']);_0x1818c4[_0xf323('0x34')]=qs['offset'](_0x5bb658[_0xf323('0x52')][_0xf323('0x34')]);}_0x1818c4['order']=qs[_0xf323('0x5a')](_0x5bb658[_0xf323('0x52')][_0xf323('0x5a')]);_0x1818c4[_0xf323('0x5b')]=qs[_0xf323('0x53')](_[_0xf323('0x5c')](_0x5bb658[_0xf323('0x52')],_0x16ac6d[_0xf323('0x53')]));if(_0x5bb658[_0xf323('0x52')][_0xf323('0x40')]){_0x1818c4[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x1818c4[_0xf323('0x5b')],{'$or':_['map'](_0xb21a85,function(_0x108ec1){if(_0x108ec1[_0xf323('0x4e')]!==_0xf323('0x5e')){return db[_0xf323('0x5f')][_0xf323('0x5b')](db[_0xf323('0x5f')]['fn']('lower',db[_0xf323('0x5f')][_0xf323('0x60')](_0x108ec1['name'])),{'$like':db[_0xf323('0x5f')]['fn'](_0xf323('0x61'),'%'+_0x5bb658['query']['filter']+'%')});}})});}_0x1818c4=_[_0xf323('0x5d')]({},_0x1818c4,_0x5bb658[_0xf323('0x62')]);var _0x227d1b={'where':_0x1818c4[_0xf323('0x5b')]};return db[_0xf323('0x4b')][_0xf323('0x33')](_0x227d1b)[_0xf323('0x3b')](function(_0x4a5e99){_0x2864f7['count']=_0x4a5e99;if(_0x5bb658[_0xf323('0x52')][_0xf323('0x63')]){_0x1818c4[_0xf323('0x64')]=[{'all':!![]}];}return db[_0xf323('0x4b')][_0xf323('0x65')](_0x1818c4);})[_0xf323('0x3b')](function(_0x35f0c1){_0x2864f7['rows']=_0x35f0c1;return _0x2864f7;})[_0xf323('0x3b')](respondWithFilteredResult(_0x502114,_0x1818c4))[_0xf323('0x66')](handleError(_0x502114,null));};exports[_0xf323('0x67')]=function(_0x23bd20,_0x12c1db){var _0xefd109={'raw':![],'where':{'id':_0x23bd20[_0xf323('0x68')]['id']}},_0x4621f2={};_0x4621f2[_0xf323('0x50')]=_['differenceBy'](_[_0xf323('0x69')](db[_0xf323('0x4b')][_0xf323('0x4c')]),['password',_0xf323('0x6a')]);_0x4621f2[_0xf323('0x52')]=_['keys'](_0x23bd20[_0xf323('0x52')]);_0x4621f2[_0xf323('0x53')]=_['intersection'](_0x4621f2[_0xf323('0x50')],_0x4621f2[_0xf323('0x52')]);_0xefd109['attributes']=_[_0xf323('0x54')](_0x4621f2[_0xf323('0x50')],qs[_0xf323('0x56')](_0x23bd20[_0xf323('0x52')][_0xf323('0x56')]));_0xefd109[_0xf323('0x55')]=_0xefd109[_0xf323('0x55')][_0xf323('0x57')]?_0xefd109[_0xf323('0x55')]:_0x4621f2['model'];if(_0x23bd20[_0xf323('0x52')][_0xf323('0x63')]){_0xefd109['include']=[{'all':!![]}];}_0xefd109=_[_0xf323('0x5d')]({},_0xefd109,_0x23bd20[_0xf323('0x62')]);return db['User'][_0xf323('0x44')](_0xefd109)[_0xf323('0x3b')](handleEntityNotFound(_0x12c1db,null))[_0xf323('0x3b')](respondWithResult(_0x12c1db,null))[_0xf323('0x66')](handleError(_0x12c1db,null));};exports['bulkCreate']=function(_0x2a0e10,_0x288f99){return db[_0xf323('0x4b')][_0xf323('0x6b')](_0x2a0e10['body'],{'raw':![],'individualHooks':!![]})[_0xf323('0x3b')](respondWithResult(_0x288f99,0xc9))[_0xf323('0x66')](handleError(_0x288f99,null));};exports[_0xf323('0x3a')]=function(_0x3aa631,_0x107397){if(_0x3aa631[_0xf323('0x6c')]['id']){delete _0x3aa631[_0xf323('0x6c')]['id'];}delete _0x3aa631[_0xf323('0x6c')][_0xf323('0x43')];return db[_0xf323('0x4b')][_0xf323('0x44')]({'where':{'id':_0x3aa631[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x107397,null))[_0xf323('0x3b')](saveUpdates(_0x3aa631[_0xf323('0x6c')],null))['then'](respondWithResult(_0x107397,null))['catch'](handleError(_0x107397,null));};exports[_0xf323('0x6d')]=function(_0x3f49d1,_0x27d031){return db[_0xf323('0x4b')][_0xf323('0x6d')]()[_0xf323('0x3b')](respondWithResult(_0x27d031,null))['catch'](handleError(_0x27d031,null));};exports[_0xf323('0x6e')]=function(_0x642320,_0x3c103e,_0x3add7c){return db['User']['find']({'where':{'id':_0x642320[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x3c103e,null))[_0xf323('0x3b')](function(_0x3feccc){if(_0x3feccc){return _0x3feccc[_0xf323('0x6e')](_0x642320[_0xf323('0x6c')][_0xf323('0x6f')],_['omit'](_0x642320['body'],[_0xf323('0x6f'),'id'])||{});}})[_0xf323('0x3b')](respondWithResult(_0x3c103e,null))[_0xf323('0x66')](handleError(_0x3c103e,null));};var getLicense=function(_0x2c95d9){return new BPromise(function(_0x93f1be,_0x40d146){var _0x4d0511=0x0;_0x2c95d9[_0xf323('0x6c')][_0xf323('0x43')]==='agent'&&_0x93f1be('agent\x20role');return db[_0xf323('0x4b')][_0xf323('0x33')]({'where':{'$or':[{'role':_0x2c95d9['body'][_0xf323('0x43')]===_0xf323('0x3f')?_0xf323('0x3f'):['admin',_0xf323('0x3e')]}]}})['then'](function(_0x51780e){_0x4d0511=_0x51780e;return require(_0xf323('0x70'))[_0xf323('0x71')]();})[_0xf323('0x3b')](function(_0x38d407){var _0x258e1a=_0x2c95d9['body'][_0xf323('0x43')]===_0xf323('0x3f')?_0xf323('0x72'):_0xf323('0x73');if(!_['isNil'](_0x38d407[_0x258e1a])&&_0x4d0511>=_0x38d407[_0x258e1a]){return _0x40d146({'message':_0xf323('0x74')});}return _0x93f1be(util[_0xf323('0x75')](_0xf323('0x76'),_0x258e1a,_0x4d0511));})[_0xf323('0x66')](function(_0x4b8408){return _0x40d146(_0x4b8408);});});};exports[_0xf323('0x77')]=function(_0x12ec58,_0x197977){return getLicense(_0x12ec58)[_0xf323('0x3b')](function(_0x4c8b47){if(!_0x12ec58[_0xf323('0x6c')][_0xf323('0x78')]){var _0x14b12e;return db['Setting']['findById'](0x1)[_0xf323('0x3b')](function(_0x49bd06){return checkPasswordPattern(_0x49bd06,_0x12ec58[_0xf323('0x6c')][_0xf323('0x79')],_0x49bd06[_0xf323('0x7a')]);})[_0xf323('0x3b')](function(_0x53c4e3){_0x14b12e=_0x53c4e3[_0xf323('0x7b')];return db[_0xf323('0x4b')][_0xf323('0x7c')](_0xf323('0x78'));})[_0xf323('0x3b')](function(_0x4c7cba){if(_[_0xf323('0x7d')](_0x4c7cba)){if(_0x14b12e){_0x12ec58[_0xf323('0x6c')][_0xf323('0x78')]=_0x14b12e;}else{_0x12ec58[_0xf323('0x6c')]['internal']=0x1;}}else{if(_['isNil'](_0x14b12e)||_0x14b12e==_0x4c7cba){_0x12ec58[_0xf323('0x6c')][_0xf323('0x78')]=_0x4c7cba+0x1;}else if(_0x14b12e>_0x4c7cba){_0x12ec58['body'][_0xf323('0x78')]=_0x14b12e;}else{return db['sequelize'][_0xf323('0x52')](_0xf323('0x7e'),{'type':db[_0xf323('0x5f')]['QueryTypes'][_0xf323('0x7f')]})[_0xf323('0x3b')](function(_0x4c336c){if(_0x4c336c&&_0x4c336c[_0xf323('0x57')]){for(var _0x79b794=0x0,_0xc7761=_0x4c336c[_0xf323('0x57')];_0x79b794<_0xc7761&&_[_0xf323('0x7d')](_0x12ec58['body'][_0xf323('0x78')]);_0x79b794++){if(_0x14b12e<=_0x4c336c[_0x79b794][_0xf323('0x80')]){_0x12ec58[_0xf323('0x6c')][_0xf323('0x78')]=_0x4c336c[_0x79b794][_0xf323('0x80')];}else if(_0x14b12e>_0x4c336c[_0x79b794]['from']&&_0x14b12e<=_0x4c336c[_0x79b794]['to']){_0x12ec58[_0xf323('0x6c')]['internal']=_0x14b12e;}}}if(_['isNil'](_0x12ec58['body'][_0xf323('0x78')])){_0x12ec58[_0xf323('0x6c')][_0xf323('0x78')]=_0x4c7cba+0x1;}});}}});}})['then'](function(){if(_0x12ec58[_0xf323('0x6c')][_0xf323('0x81')]){_0x12ec58['body'][_0xf323('0x82')]=_0x12ec58[_0xf323('0x6c')][_0xf323('0x78')];_0x12ec58[_0xf323('0x6c')][_0xf323('0x83')]={'mailbox':_0x12ec58[_0xf323('0x6c')][_0xf323('0x78')],'password':_0x12ec58[_0xf323('0x6c')]['password'],'fullname':_0x12ec58[_0xf323('0x6c')][_0xf323('0x84')],'email':_0x12ec58[_0xf323('0x6c')]['email']};}if(_0x12ec58['body']&&_0x12ec58[_0xf323('0x6c')][_0xf323('0x43')]===_0xf323('0x85')){_0x12ec58[_0xf323('0x6c')][_0xf323('0x86')]=['101','102',_0xf323('0x87'),_0xf323('0x88'),'104',_0xf323('0x89'),_0xf323('0x8a'),'107',_0xf323('0x8b'),_0xf323('0x8c'),_0xf323('0x8d'),_0xf323('0x8e')];}return db['User'][_0xf323('0x77')](_0x12ec58[_0xf323('0x6c')],{'include':[{'model':db[_0xf323('0x83')],'as':_0xf323('0x83')}]});})[_0xf323('0x3b')](function(_0x10e7e6){if(_0x12ec58[_0xf323('0x6c')][_0xf323('0x43')]===_0xf323('0x3e'))return _0x10e7e6;var _0x4c1229=_0x12ec58[_0xf323('0x3e')][_0xf323('0x3c')]({'plain':!![]});if(!_0x4c1229)throw new Error(_0xf323('0x8f'));if(_0x4c1229['role']===_0xf323('0x3e')){var _0x10e36f=_0x10e7e6['get']({'plain':!![]});var _0x487518=[{'name':_0xf323('0x90'),'value':_0xf323('0x85')},{'name':_0xf323('0x91'),'value':'telephone'}];var _0x587a21=_[_0xf323('0x44')](_0x487518,['value',_0x10e36f[_0xf323('0x43')]])[_0xf323('0x45')];return db[_0xf323('0x92')][_0xf323('0x44')]({'where':{'name':_0x587a21,'userProfileId':_0x4c1229['userProfileId']},'raw':!![]})[_0xf323('0x3b')](function(_0x50a7e0){if(_0x50a7e0&&_0x50a7e0[_0xf323('0x93')]===0x0){return db[_0xf323('0x46')]['create']({'name':_0x10e36f[_0xf323('0x45')],'resourceId':_0x10e36f['id'],'type':_0x50a7e0[_0xf323('0x45')],'sectionId':_0x50a7e0['id']},{})['then'](function(){return _0x10e7e6;});}else{return _0x10e7e6;}})[_0xf323('0x66')](function(_0x48bb26){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48bb26);throw _0x48bb26;});}return _0x10e7e6;})[_0xf323('0x3b')](respondWithResult(_0x197977,0xc9))[_0xf323('0x66')](handleError(_0x197977,null));};exports[_0xf323('0x94')]=function(_0x2ee479,_0x3c29e7,_0x5f086d){var _0xf15ef6=![];if(_0x2ee479[_0xf323('0x6c')]['id']){delete _0x2ee479[_0xf323('0x6c')]['id'];}return db[_0xf323('0x95')][_0xf323('0x96')]({'attributes':['id',_0xf323('0x7a')]})[_0xf323('0x3b')](function(_0xaaebcc){_0xf15ef6=_0xaaebcc['securePassword'];return db[_0xf323('0x4b')][_0xf323('0x44')]({'where':{'id':_0x2ee479[_0xf323('0x68')]['id']}});})['then'](function(_0x53615b){if(_0x53615b){if(_0x53615b['id']==_0x2ee479['user']['id']){if(!_0x2ee479[_0xf323('0x6c')][_0xf323('0x97')]||!_0x2ee479[_0xf323('0x6c')][_0xf323('0x98')]){throw new db[(_0xf323('0x23'))][(_0xf323('0x99'))](_0xf323('0x9a'));}if(!_0x53615b[_0xf323('0x9b')](_0x2ee479['body'][_0xf323('0x97')])){throw new db[(_0xf323('0x23'))][(_0xf323('0x99'))](_0xf323('0x9c'));}if(_0x2ee479[_0xf323('0x6c')][_0xf323('0x97')]==_0x2ee479[_0xf323('0x6c')][_0xf323('0x98')]){throw new db[(_0xf323('0x23'))]['ValidationError'](_0xf323('0x9d'));}return _0x53615b;}else if(_0x2ee479[_0xf323('0x3e')][_0xf323('0x43')]==_0xf323('0x9e')){if(!_0x2ee479[_0xf323('0x6c')][_0xf323('0x98')]){throw new db[(_0xf323('0x23'))]['ValidationError'](_0xf323('0x9f'));}return _0x53615b;}else if(_0x2ee479[_0xf323('0x3e')][_0xf323('0x43')]==_0xf323('0x3e')){if(!_0x2ee479[_0xf323('0x6c')][_0xf323('0x98')]){throw new db[(_0xf323('0x23'))][(_0xf323('0x99'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x53615b['role']!=_0xf323('0x85')){throw new db[(_0xf323('0x23'))][(_0xf323('0x99'))](_0xf323('0xa0'));}return _0x53615b;}else{throw new db['Sequelize']['ValidationError'](_0xf323('0xa0'));}}return null;})[_0xf323('0x3b')](handleEntityNotFound(_0x3c29e7,null))[_0xf323('0x3b')](function(_0x23ee34){return checkPasswordPattern(_0x23ee34,_0x2ee479[_0xf323('0x6c')][_0xf323('0x98')],_0xf15ef6);})[_0xf323('0x3b')](saveUpdates({'password':_0x2ee479['body']['newPassword'],'passwordResetAt':_0x2ee479['user']['id']==_0x2ee479['params']['id']?moment():null},null))[_0xf323('0x3b')](respondWithResult(_0x3c29e7,null))['catch'](handleError(_0x3c29e7,null));};exports[_0xf323('0xa1')]=function(_0xd45bcb,_0x31ad59,_0x2eceb3){var _0x14bae7=_0xd45bcb['body'][_0xf323('0xa2')];return db[_0xf323('0x4b')]['find']({'where':{'id':_0xd45bcb['params']['id']},'attributes':['id',_0xf323('0x45'),_0xf323('0x43'),_0xf323('0xa3'),_0xf323('0xa4'),_0xf323('0xa5'),_0xf323('0xa6')]})[_0xf323('0x3b')](handleEntityNotFound(_0x31ad59,null))[_0xf323('0x3b')](function(_0x5f3c83){if(_0x5f3c83){if(!utils['isValidChannel'](_0x14bae7)){throw new db[(_0xf323('0x23'))][(_0xf323('0x99'))](_0xf323('0xa7'));}return _0x5f3c83['add'+_[_0xf323('0xa8')](_0x14bae7['toLowerCase']())+'Queues'](_0xd45bcb[_0xf323('0x6c')][_0xf323('0x6f')],{'penalty':_0xd45bcb[_0xf323('0x6c')][_0xf323('0xa9')]||0x0})['spread'](function(_0xd179d7){for(var _0x61c5ab=0x0;_0x61c5ab<_0xd45bcb[_0xf323('0x6c')][_0xf323('0x6f')][_0xf323('0x57')];_0x61c5ab+=0x1){var _0x432b1e={'UserId':_0xd45bcb['params']['id']};_0x432b1e[_[_0xf323('0xa8')](_0x14bae7[_0xf323('0xaa')]())+_0xf323('0xab')]=_0xd45bcb[_0xf323('0x6c')][_0xf323('0x6f')][_0x61c5ab];socket[_0xf323('0xac')](_0xf323('0x3e')+_[_0xf323('0xa8')](_0x14bae7[_0xf323('0xaa')]())+'Queue:save',_0x432b1e);}return _0xd179d7;})[_0xf323('0x3b')](function(){if(_0x14bae7===_0xf323('0xad')){return db[_0xf323('0xae')][_0xf323('0x65')]({'where':{'id':_0xd45bcb[_0xf323('0x6c')]['ids']||[]},'raw':!![],'attributes':['id',_0xf323('0x45')]});}})[_0xf323('0x3b')](function(_0x1028d4){var _0x3de572=_0x5f3c83[_0xf323('0x3c')]({'plain':!![]});var _0x2409c9=[];if(_0x14bae7===_0xf323('0xad')&&_0x3de572[_0xf323('0x43')]==='agent'&&_0x3de572[_0xf323('0xa3')]){for(var _0x23ec08=0x0;_0x23ec08<_0x1028d4[_0xf323('0x57')];_0x23ec08+=0x1){_0x2409c9[_0xf323('0xaf')]({'membername':_0x3de572[_0xf323('0x45')],'UserId':_0x3de572['id'],'queue_name':_0x1028d4[_0x23ec08][_0xf323('0x45')],'VoiceQueueId':_0x1028d4[_0x23ec08]['id'],'interface':_[_0xf323('0x7d')](_0x3de572[_0xf323('0xa6')])?util[_0xf323('0x75')](_0xf323('0xb0'),_0x3de572['name']):_0x3de572[_0xf323('0xa6')],'paused':_0x3de572[_0xf323('0xa5')]||![],'penalty':_0xd45bcb['body'][_0xf323('0xa9')]||0x0});}return BPromise[_0xf323('0xb1')](_0x2409c9,function(_0x295c6a){return db[_0xf323('0xb2')][_0xf323('0xb3')](_0x295c6a);});}return _0x5f3c83;});}})[_0xf323('0x3b')](respondWithStatusCode(_0x31ad59,null))['catch'](handleError(_0x31ad59,null));};exports['removeQueues']=function(_0x5ca3f1,_0x3868a7,_0x34d742){var _0x5f72f4;return db[_0xf323('0x4b')]['find']({'where':{'id':_0x5ca3f1[_0xf323('0x68')]['id']},'attributes':['id',_0xf323('0x45'),'role']})[_0xf323('0x3b')](handleEntityNotFound(_0x3868a7,null))[_0xf323('0x3b')](function(_0x5e1cf7){if(_0x5e1cf7){_0x5f72f4=_0x5e1cf7;if(!_0x5ca3f1[_0xf323('0x52')][_0xf323('0xa2')]||!utils[_0xf323('0xb4')](_0x5ca3f1[_0xf323('0x52')]['channel'])){throw new db[(_0xf323('0x23'))][(_0xf323('0x99'))](_0xf323('0xa7'));}return _0x5e1cf7[_0xf323('0xb5')+_[_0xf323('0xa8')](_0x5ca3f1['query'][_0xf323('0xa2')][_0xf323('0xaa')]())+_0xf323('0xb6')](_0x5ca3f1[_0xf323('0x52')][_0xf323('0x6f')]);}})[_0xf323('0x3b')](function(_0x43208b){for(var _0x47bb90=0x0;_0x47bb90<_0x5ca3f1[_0xf323('0x52')][_0xf323('0x6f')][_0xf323('0x57')];_0x47bb90+=0x1){var _0x674601={'UserId':_0x5ca3f1[_0xf323('0x68')]['id']};_0x674601[_[_0xf323('0xa8')](_0x5ca3f1['query'][_0xf323('0xa2')]['toLowerCase']())+_0xf323('0xab')]=_0x5ca3f1[_0xf323('0x52')]['ids'][_0x47bb90];socket[_0xf323('0xac')](_0xf323('0x3e')+_['capitalize'](_0x5ca3f1['query'][_0xf323('0xa2')][_0xf323('0xaa')]())+_0xf323('0xb7'),_0x674601);}return _0x43208b;})[_0xf323('0x3b')](function(){if(_0x5ca3f1[_0xf323('0x52')][_0xf323('0xa2')]===_0xf323('0xad')){return db[_0xf323('0xb2')][_0xf323('0x47')]({'where':{'UserId':_0x5ca3f1[_0xf323('0x68')]['id'],'VoiceQueueId':_0x5ca3f1['query'][_0xf323('0x6f')]},'individualHooks':!![]})[_0xf323('0x3b')](function(){return _0x5f72f4;});}return _0x5f72f4;})['then'](respondWithStatusCode(_0x3868a7,null))[_0xf323('0x66')](handleError(_0x3868a7,null));};exports['addAvatar']=function(_0x3a1aeb,_0x2469ed,_0x2870c2){_0x3a1aeb[_0xf323('0x6c')][_0xf323('0xb8')]=_0x3a1aeb[_0xf323('0xb9')][_0xf323('0xba')];return db[_0xf323('0x4b')][_0xf323('0x44')]({'where':{'id':_0x3a1aeb['params']['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x2469ed,null))[_0xf323('0x3b')](saveUpdates(_0x3a1aeb[_0xf323('0x6c')],null))[_0xf323('0x3b')](respondWithResult(_0x2469ed,null))[_0xf323('0x66')](handleError(_0x2469ed,null));};exports[_0xf323('0xbb')]=function(_0x20d684,_0x1cb1c8,_0x27026c){var _0x11acdb=path[_0xf323('0xbc')](config['root'],'server/files/images/logos/default_profile.png');return db[_0xf323('0x4b')][_0xf323('0x44')]({'where':{'id':_0x20d684[_0xf323('0x68')]['id']},'attributes':['id',_0xf323('0xb8')],'raw':!![]})['then'](handleEntityNotFound(_0x1cb1c8,null))['then'](function(_0x5f5124){if(_0x5f5124){if(_['isNil'](_0x5f5124[_0xf323('0xb8')])){return _0x1cb1c8[_0xf323('0xbd')](_0x11acdb);}else{if(!fs[_0xf323('0xbe')](path[_0xf323('0xbc')](config[_0xf323('0xbf')],_0xf323('0xc0'),_0x5f5124['userpic']))){return _0x1cb1c8[_0xf323('0xbd')](_0x11acdb);}return _0x1cb1c8[_0xf323('0xbd')](path['join'](config['root'],_0xf323('0xc0'),_0x5f5124[_0xf323('0xb8')]));}}})[_0xf323('0x66')](handleError(_0x1cb1c8,null));};exports[_0xf323('0xc1')]=function(_0x42d28f,_0xde6b01,_0x520b25){var _0x3ac91f={};var _0x47ba51={};var _0x4f6e70;var _0x1123cc;return db[_0xf323('0x4b')][_0xf323('0x96')]({'where':{'id':_0x42d28f[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0xde6b01,null))['then'](function(_0x701154){if(_0x701154){_0x4f6e70=_0x701154;_0x47ba51[_0xf323('0x50')]=_['keys'](db[_0xf323('0xc2')]['rawAttributes']);_0x47ba51['query']=_[_0xf323('0x69')](_0x42d28f['query']);_0x47ba51[_0xf323('0x53')]=_[_0xf323('0x54')](_0x47ba51[_0xf323('0x50')],_0x47ba51['query']);_0x3ac91f[_0xf323('0x55')]=_[_0xf323('0x54')](_0x47ba51['model'],qs[_0xf323('0x56')](_0x42d28f['query'][_0xf323('0x56')]));_0x3ac91f[_0xf323('0x55')]=_0x3ac91f[_0xf323('0x55')][_0xf323('0x57')]?_0x3ac91f[_0xf323('0x55')]:_0x47ba51[_0xf323('0x50')];_0x3ac91f[_0xf323('0xc3')]=qs[_0xf323('0x5a')](_0x42d28f[_0xf323('0x52')]['sort']);_0x3ac91f[_0xf323('0x5b')]=qs[_0xf323('0x53')](_[_0xf323('0x5c')](_0x42d28f[_0xf323('0x52')],_0x47ba51['filters']));if(_0x42d28f[_0xf323('0x52')][_0xf323('0x40')]){_0x3ac91f[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x3ac91f['where'],{'$or':_[_0xf323('0x42')](_0x3ac91f[_0xf323('0x55')],function(_0x2309d1){var _0x3f5d94={};_0x3f5d94[_0x2309d1]={'$like':'%'+_0x42d28f[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x3f5d94;})});}_0x3ac91f=_[_0xf323('0x5d')]({},_0x3ac91f,_0x42d28f[_0xf323('0x62')]);return _0x4f6e70[_0xf323('0xc1')](_0x3ac91f);}})[_0xf323('0x3b')](function(_0x4627fb){if(_0x4627fb){_0x1123cc=_0x4627fb[_0xf323('0x57')];if(_0x42d28f['query'][_0xf323('0x58')](_0xf323('0x63'))){_0x3ac91f[_0xf323('0x64')]=[{'model':db[_0xf323('0xc4')],'as':'List','required':![]},{'model':db[_0xf323('0xc5')],'as':_0xf323('0xc6'),'attributes':['id',_0xf323('0x45'),'color'],'where':_0x42d28f[_0xf323('0x52')][_0xf323('0xc7')]?{'id':_0x42d28f[_0xf323('0x52')]['tag']}:undefined,'required':_0x42d28f[_0xf323('0x52')]['tag']?!![]:![]}];}if(!_0x42d28f[_0xf323('0x52')][_0xf323('0x58')](_0xf323('0x59'))){_0x3ac91f[_0xf323('0x35')]=qs[_0xf323('0x35')](_0x42d28f[_0xf323('0x52')]['limit']);_0x3ac91f[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x42d28f[_0xf323('0x52')][_0xf323('0x34')]);}return _0x4f6e70[_0xf323('0xc1')](_0x3ac91f);}})[_0xf323('0x3b')](function(_0x124d92){if(_0x124d92){return _0x124d92?{'count':_0x1123cc,'rows':_0x124d92}:null;}})['then'](respondWithResult(_0xde6b01,null))[_0xf323('0x66')](handleError(_0xde6b01,null));};exports['getQueues']=function(_0x460b5f,_0xd386c3,_0x8d297f){var _0x333f1a;var _0x1c96cc;var _0x3d9976={};var _0x1a867c;return db['User']['findOne']({'where':{'id':_0x460b5f['params']['id']},'attributes':['id',_0xf323('0x45'),_0xf323('0x43')]})[_0xf323('0x3b')](handleEntityNotFound(_0xd386c3,null))['then'](function(_0x5a35cd){if(!utils[_0xf323('0xb4')](_0x460b5f['query'][_0xf323('0xa2')])){throw new db[(_0xf323('0x23'))][(_0xf323('0x99'))](_0xf323('0xa7'));}_0x333f1a=_0x5a35cd;var _0x3c1441={};_0x3c1441[_0xf323('0x50')]=_[_0xf323('0x69')](db[_[_0xf323('0xa8')](_0x460b5f[_0xf323('0x52')][_0xf323('0xa2')])+_0xf323('0xc8')][_0xf323('0x4c')]);_0x3c1441[_0xf323('0x52')]=_[_0xf323('0x69')](_0x460b5f[_0xf323('0x52')]);_0x3c1441[_0xf323('0x53')]=_['intersection'](_0x3c1441[_0xf323('0x50')],_0x3c1441[_0xf323('0x52')]);_0x3d9976['attributes']=_['intersection'](_0x3c1441[_0xf323('0x50')],qs['fields'](_0x460b5f[_0xf323('0x52')][_0xf323('0x56')]));_0x3d9976['attributes']=_0x3d9976[_0xf323('0x55')][_0xf323('0x57')]?_0x3d9976[_0xf323('0x55')]:_0x3c1441['model'];_0x3d9976[_0xf323('0xc3')]=qs['sort'](_0x460b5f[_0xf323('0x52')][_0xf323('0x5a')]);_0x3d9976[_0xf323('0x5b')]=qs[_0xf323('0x53')](_[_0xf323('0x5c')](_0x460b5f[_0xf323('0x52')],_0x3c1441[_0xf323('0x53')]));if(_0x460b5f['query'][_0xf323('0x40')]){_0x3d9976[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x3d9976[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x3d9976[_0xf323('0x55')],function(_0x49ac7f){var _0x2f0aab={};_0x2f0aab[_0x49ac7f]={'$like':'%'+_0x460b5f[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x2f0aab;})});}_0x3d9976=_[_0xf323('0x5d')]({},_0x3d9976,_0x460b5f['options']);switch(_0x333f1a[_0xf323('0x43')]){case _0xf323('0x9e'):return db[_['capitalize'](_0x460b5f['query']['channel'])+_0xf323('0xc8')][_0xf323('0x65')](_0x3d9976);case _0xf323('0x3e'):case _0xf323('0x85'):return _0x333f1a['get'+_[_0xf323('0xa8')](_0x460b5f[_0xf323('0x52')][_0xf323('0xa2')])+'Queues'](_0x3d9976);default:throw new db[(_0xf323('0x23'))]['ValidationError'](_0xf323('0xc9'));}})[_0xf323('0x3b')](function(_0x4faebc){_0x1a867c=_0x4faebc[_0xf323('0x57')];if(!_0x460b5f[_0xf323('0x52')][_0xf323('0x58')](_0xf323('0x59'))){_0x3d9976[_0xf323('0x35')]=qs[_0xf323('0x35')](_0x460b5f[_0xf323('0x52')][_0xf323('0x35')]);_0x3d9976[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x460b5f[_0xf323('0x52')][_0xf323('0x34')]);}switch(_0x333f1a[_0xf323('0x43')]){case _0xf323('0x9e'):return db[_[_0xf323('0xa8')](_0x460b5f['query']['channel'])+_0xf323('0xc8')][_0xf323('0x65')](_0x3d9976);case'user':case _0xf323('0x85'):return _0x333f1a['get'+_[_0xf323('0xa8')](_0x460b5f['query'][_0xf323('0xa2')])+_0xf323('0xb6')](_0x3d9976);}})['then'](function(_0x476717){return{'count':_0x1a867c,'rows':_0x476717};})[_0xf323('0x3b')](respondWithResult(_0xd386c3,null))['catch'](handleError(_0xd386c3,null));};exports['getVoiceQueuesRt']=function(_0x289df4,_0x195afe,_0x14433f){var _0x1c2f09={};var _0x22c0d3={};var _0x19f212;var _0x458aac;return db['User'][_0xf323('0x96')]({'where':{'id':_0x289df4[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x195afe,null))[_0xf323('0x3b')](function(_0x2f32a9){if(_0x2f32a9){_0x19f212=_0x2f32a9;_0x22c0d3[_0xf323('0x50')]=_['keys'](db[_0xf323('0xb2')][_0xf323('0x4c')]);_0x22c0d3[_0xf323('0x52')]=_[_0xf323('0x69')](_0x289df4[_0xf323('0x52')]);_0x22c0d3[_0xf323('0x53')]=_[_0xf323('0x54')](_0x22c0d3[_0xf323('0x50')],_0x22c0d3[_0xf323('0x52')]);_0x1c2f09[_0xf323('0x55')]=_[_0xf323('0x54')](_0x22c0d3[_0xf323('0x50')],qs[_0xf323('0x56')](_0x289df4['query'][_0xf323('0x56')]));_0x1c2f09[_0xf323('0x55')]=_0x1c2f09['attributes'][_0xf323('0x57')]?_0x1c2f09[_0xf323('0x55')]:_0x22c0d3[_0xf323('0x50')];_0x1c2f09['order']=qs[_0xf323('0x5a')](_0x289df4[_0xf323('0x52')][_0xf323('0x5a')]);_0x1c2f09[_0xf323('0x5b')]=qs[_0xf323('0x53')](_['pick'](_0x289df4[_0xf323('0x52')],_0x22c0d3['filters']));if(_0x289df4[_0xf323('0x52')][_0xf323('0x40')]){_0x1c2f09[_0xf323('0x5b')]=_['merge'](_0x1c2f09[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x1c2f09[_0xf323('0x55')],function(_0x52ffbe){var _0x181fd6={};_0x181fd6[_0x52ffbe]={'$like':'%'+_0x289df4['query']['filter']+'%'};return _0x181fd6;})});}_0x1c2f09=_[_0xf323('0x5d')]({},_0x1c2f09,_0x289df4[_0xf323('0x62')]);return _0x19f212['getVoiceQueuesRt'](_0x1c2f09);}})[_0xf323('0x3b')](function(_0x2ca568){if(_0x2ca568){_0x458aac=_0x2ca568[_0xf323('0x57')];if(!_0x289df4['query'][_0xf323('0x58')](_0xf323('0x59'))){_0x1c2f09['limit']=qs[_0xf323('0x35')](_0x289df4['query']['limit']);_0x1c2f09[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x289df4[_0xf323('0x52')]['offset']);}return _0x19f212[_0xf323('0xca')](_0x1c2f09);}})['then'](function(_0x12dddf){if(_0x12dddf){return _0x12dddf?{'count':_0x458aac,'rows':_0x12dddf}:null;}})[_0xf323('0x3b')](respondWithResult(_0x195afe,null))[_0xf323('0x66')](handleError(_0x195afe,null));};exports['getGroups']=function(_0x45ade3,_0x501710,_0x55aeae){var _0x5a1c68={};var _0x16c217={};var _0x435c42;var _0x29bb89;return db['User']['findOne']({'where':{'id':_0x45ade3[_0xf323('0x68')]['id']}})['then'](handleEntityNotFound(_0x501710,null))['then'](function(_0x2b20a5){if(_0x2b20a5){_0x435c42=_0x2b20a5;_0x16c217['model']=_[_0xf323('0x69')](db[_0xf323('0xcb')][_0xf323('0x4c')]);_0x16c217[_0xf323('0x52')]=_[_0xf323('0x69')](_0x45ade3[_0xf323('0x52')]);_0x16c217[_0xf323('0x53')]=_[_0xf323('0x54')](_0x16c217[_0xf323('0x50')],_0x16c217['query']);_0x5a1c68[_0xf323('0x55')]=_[_0xf323('0x54')](_0x16c217['model'],qs[_0xf323('0x56')](_0x45ade3[_0xf323('0x52')]['fields']));_0x5a1c68[_0xf323('0x55')]=_0x5a1c68[_0xf323('0x55')][_0xf323('0x57')]?_0x5a1c68[_0xf323('0x55')]:_0x16c217[_0xf323('0x50')];_0x5a1c68[_0xf323('0xc3')]=qs[_0xf323('0x5a')](_0x45ade3[_0xf323('0x52')][_0xf323('0x5a')]);_0x5a1c68[_0xf323('0x5b')]=qs[_0xf323('0x53')](_[_0xf323('0x5c')](_0x45ade3[_0xf323('0x52')],_0x16c217[_0xf323('0x53')]));if(_0x45ade3[_0xf323('0x52')][_0xf323('0x40')]){_0x5a1c68[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x5a1c68[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x5a1c68['attributes'],function(_0x5eb090){var _0x562fb4={};_0x562fb4[_0x5eb090]={'$like':'%'+_0x45ade3[_0xf323('0x52')]['filter']+'%'};return _0x562fb4;})});}_0x5a1c68=_[_0xf323('0x5d')]({},_0x5a1c68,_0x45ade3[_0xf323('0x62')]);return _0x435c42[_0xf323('0xcc')](_0x5a1c68);}})[_0xf323('0x3b')](function(_0xa15bcb){if(_0xa15bcb){_0x29bb89=_0xa15bcb[_0xf323('0x57')];if(!_0x45ade3[_0xf323('0x52')]['hasOwnProperty'](_0xf323('0x59'))){_0x5a1c68['limit']=qs[_0xf323('0x35')](_0x45ade3[_0xf323('0x52')]['limit']);_0x5a1c68[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x45ade3[_0xf323('0x52')][_0xf323('0x34')]);}return _0x435c42[_0xf323('0xcc')](_0x5a1c68);}})[_0xf323('0x3b')](function(_0x32e961){if(_0x32e961){return _0x32e961?{'count':_0x29bb89,'rows':_0x32e961}:null;}})[_0xf323('0x3b')](respondWithResult(_0x501710,null))[_0xf323('0x66')](handleError(_0x501710,null));};exports[_0xf323('0xcd')]=function(_0x1ea2bc,_0x2bc841,_0xede2f5){var _0x1d1737={'raw':!![],'where':{}};var _0x4e9a8a={};var _0x39e8a3={'count':0x0,'rows':[]};return db[_0xf323('0x4b')][_0xf323('0x96')]({'where':{'id':_0x1ea2bc[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x2bc841,null))['then'](function(_0x3508b9){if(_0x3508b9){_0x4e9a8a[_0xf323('0x50')]=_[_0xf323('0x69')](db[_0xf323('0xce')][_0xf323('0x4c')]);_0x4e9a8a[_0xf323('0x52')]=_['keys'](_0x1ea2bc[_0xf323('0x52')]);_0x4e9a8a[_0xf323('0x53')]=_[_0xf323('0x54')](_0x4e9a8a[_0xf323('0x50')],_0x4e9a8a[_0xf323('0x52')]);_0x1d1737[_0xf323('0x55')]=_[_0xf323('0x54')](_0x4e9a8a['model'],qs[_0xf323('0x56')](_0x1ea2bc[_0xf323('0x52')][_0xf323('0x56')]));_0x1d1737['attributes']=_0x1d1737[_0xf323('0x55')]['length']?_0x1d1737[_0xf323('0x55')]:_0x4e9a8a[_0xf323('0x50')];if(!_0x1ea2bc['query'][_0xf323('0x58')](_0xf323('0x59'))){_0x1d1737['limit']=qs[_0xf323('0x35')](_0x1ea2bc[_0xf323('0x52')][_0xf323('0x35')]);_0x1d1737[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x1ea2bc['query'][_0xf323('0x34')]);}_0x1d1737[_0xf323('0xc3')]=qs[_0xf323('0x5a')](_0x1ea2bc['query'][_0xf323('0x5a')]);_0x1d1737[_0xf323('0x5b')]=qs[_0xf323('0x53')](_[_0xf323('0x5c')](_0x1ea2bc['query'],_0x4e9a8a['filters']));_0x1d1737['where']['UserId']=_0x3508b9['id'];if(_0x1ea2bc[_0xf323('0x52')][_0xf323('0x40')]){_0x1d1737[_0xf323('0x5b')]=_['merge'](_0x1d1737[_0xf323('0x5b')],{'$or':_['map'](_0x1d1737['attributes'],function(_0x4125c2){var _0xb3e2c4={};_0xb3e2c4[_0x4125c2]={'$like':'%'+_0x1ea2bc[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0xb3e2c4;})});}_0x1d1737=_[_0xf323('0x5d')]({},_0x1d1737,_0x1ea2bc['options']);return db['VoiceRecording']['count']({'where':_0x1d1737['where']})[_0xf323('0x3b')](function(_0x137e10){_0x39e8a3[_0xf323('0x33')]=_0x137e10;if(_0x1ea2bc['query']['includeAll']){_0x1d1737[_0xf323('0x64')]=[{'all':!![]}];}return db[_0xf323('0xce')][_0xf323('0x65')](_0x1d1737);})['then'](function(_0x34a7b7){_0x39e8a3[_0xf323('0xcf')]=_0x34a7b7;return _0x39e8a3;});}})[_0xf323('0x3b')](respondWithFilteredResult(_0x2bc841,_0x1d1737))[_0xf323('0x66')](handleError(_0x2bc841,null));};exports[_0xf323('0xd0')]=function(_0x4437c4,_0x220b5f,_0x164e84){var _0x5b6cfe={'raw':!![],'where':{}};var _0x271af7={};var _0x55ae6c={'count':0x0,'rows':[]};return db['User'][_0xf323('0x96')]({'where':{'id':_0x4437c4[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x220b5f,null))[_0xf323('0x3b')](function(_0x534bc2){if(_0x534bc2){_0x271af7['model']=_[_0xf323('0x69')](db['ScreenRecording']['rawAttributes']);_0x271af7['query']=_[_0xf323('0x69')](_0x4437c4['query']);_0x271af7[_0xf323('0x53')]=_[_0xf323('0x54')](_0x271af7[_0xf323('0x50')],_0x271af7[_0xf323('0x52')]);_0x5b6cfe['attributes']=_[_0xf323('0x54')](_0x271af7[_0xf323('0x50')],qs[_0xf323('0x56')](_0x4437c4[_0xf323('0x52')]['fields']));_0x5b6cfe[_0xf323('0x55')]=_0x5b6cfe[_0xf323('0x55')][_0xf323('0x57')]?_0x5b6cfe[_0xf323('0x55')]:_0x271af7[_0xf323('0x50')];if(!_0x4437c4[_0xf323('0x52')][_0xf323('0x58')]('nolimit')){_0x5b6cfe['limit']=qs[_0xf323('0x35')](_0x4437c4[_0xf323('0x52')]['limit']);_0x5b6cfe[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x4437c4[_0xf323('0x52')]['offset']);}_0x5b6cfe[_0xf323('0xc3')]=qs['sort'](_0x4437c4[_0xf323('0x52')][_0xf323('0x5a')]);_0x5b6cfe['where']=qs[_0xf323('0x53')](_[_0xf323('0x5c')](_0x4437c4[_0xf323('0x52')],_0x271af7[_0xf323('0x53')]));_0x5b6cfe['where']['UserId']=_0x534bc2['id'];if(_0x4437c4[_0xf323('0x52')]['filter']){_0x5b6cfe[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x5b6cfe[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x5b6cfe[_0xf323('0x55')],function(_0x3cd1de){var _0x5fb5d4={};_0x5fb5d4[_0x3cd1de]={'$like':'%'+_0x4437c4[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x5fb5d4;})});}_0x5b6cfe=_[_0xf323('0x5d')]({},_0x5b6cfe,_0x4437c4['options']);return db[_0xf323('0xd1')][_0xf323('0x33')]({'where':_0x5b6cfe[_0xf323('0x5b')]})['then'](function(_0xf61ae9){_0x55ae6c['count']=_0xf61ae9;if(_0x4437c4[_0xf323('0x52')][_0xf323('0x63')]){_0x5b6cfe[_0xf323('0x64')]=[{'all':!![]}];}return db[_0xf323('0xd1')]['findAll'](_0x5b6cfe);})[_0xf323('0x3b')](function(_0x57dc77){_0x55ae6c[_0xf323('0xcf')]=_0x57dc77;return _0x55ae6c;});}})[_0xf323('0x3b')](respondWithFilteredResult(_0x220b5f,_0x5b6cfe))[_0xf323('0x66')](handleError(_0x220b5f,null));};exports[_0xf323('0xd2')]=function(_0x51db03,_0x134972,_0x433413){var _0x58e150={};var _0x2bc699={};var _0x30bacb;var _0x2a6cc5;return db[_0xf323('0x4b')][_0xf323('0x96')]({'where':{'id':_0x51db03[_0xf323('0x68')]['id']}})['then'](handleEntityNotFound(_0x134972,null))[_0xf323('0x3b')](function(_0x36ade1){if(_0x36ade1){_0x30bacb=_0x36ade1;_0x2bc699['model']=_['keys'](db[_0xf323('0xd3')][_0xf323('0x4c')]);_0x2bc699['query']=_['keys'](_0x51db03[_0xf323('0x52')]);_0x2bc699[_0xf323('0x53')]=_['intersection'](_0x2bc699[_0xf323('0x50')],_0x2bc699[_0xf323('0x52')]);_0x58e150['attributes']=_[_0xf323('0x54')](_0x2bc699[_0xf323('0x50')],qs[_0xf323('0x56')](_0x51db03[_0xf323('0x52')][_0xf323('0x56')]));_0x58e150[_0xf323('0x55')]=_0x58e150[_0xf323('0x55')]['length']?_0x58e150['attributes']:_0x2bc699['model'];_0x58e150[_0xf323('0xc3')]=qs[_0xf323('0x5a')](_0x51db03[_0xf323('0x52')][_0xf323('0x5a')]);_0x58e150[_0xf323('0x5b')]=qs[_0xf323('0x53')](_['pick'](_0x51db03[_0xf323('0x52')],_0x2bc699[_0xf323('0x53')]));if(_0x51db03[_0xf323('0x52')]['filter']){_0x58e150[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x58e150[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x58e150[_0xf323('0x55')],function(_0x19cf7a){var _0x4bbc2c={};_0x4bbc2c[_0x19cf7a]={'$like':'%'+_0x51db03[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x4bbc2c;})});}_0x58e150=_['merge']({},_0x58e150,_0x51db03[_0xf323('0x62')]);return _0x30bacb[_0xf323('0xd2')](_0x58e150);}})[_0xf323('0x3b')](function(_0x4d12a7){if(_0x4d12a7){_0x2a6cc5=_0x4d12a7['length'];if(!_0x51db03['query'][_0xf323('0x58')](_0xf323('0x59'))){_0x58e150[_0xf323('0x35')]=qs['limit'](_0x51db03[_0xf323('0x52')][_0xf323('0x35')]);_0x58e150[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x51db03[_0xf323('0x52')][_0xf323('0x34')]);}return _0x30bacb[_0xf323('0xd2')](_0x58e150);}})['then'](function(_0x1bd9c2){if(_0x1bd9c2){return _0x1bd9c2?{'count':_0x2a6cc5,'rows':_0x1bd9c2}:null;}})[_0xf323('0x3b')](respondWithResult(_0x134972,null))['catch'](handleError(_0x134972,null));};exports[_0xf323('0xd4')]=function(_0x1c75d0,_0x5cad63,_0x4750ad){var _0x930ecd={};var _0x22dceb={};var _0x1ab525;var _0x22d804;return db[_0xf323('0x4b')]['findOne']({'where':{'id':_0x1c75d0[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x5cad63,null))[_0xf323('0x3b')](function(_0x331982){if(_0x331982){_0x1ab525=_0x331982;_0x22dceb[_0xf323('0x50')]=_[_0xf323('0x69')](db[_0xf323('0xd5')]['rawAttributes']);_0x22dceb['query']=_[_0xf323('0x69')](_0x1c75d0[_0xf323('0x52')]);_0x22dceb['filters']=_[_0xf323('0x54')](_0x22dceb['model'],_0x22dceb['query']);_0x930ecd[_0xf323('0x55')]=_['intersection'](_0x22dceb[_0xf323('0x50')],qs[_0xf323('0x56')](_0x1c75d0[_0xf323('0x52')]['fields']));_0x930ecd[_0xf323('0x55')]=_0x930ecd[_0xf323('0x55')][_0xf323('0x57')]?_0x930ecd[_0xf323('0x55')]:_0x22dceb[_0xf323('0x50')];_0x930ecd['order']=qs[_0xf323('0x5a')](_0x1c75d0[_0xf323('0x52')][_0xf323('0x5a')]);_0x930ecd[_0xf323('0x5b')]=qs[_0xf323('0x53')](_['pick'](_0x1c75d0[_0xf323('0x52')],_0x22dceb[_0xf323('0x53')]));if(_0x1c75d0['query'][_0xf323('0x40')]){_0x930ecd[_0xf323('0x5b')]=_['merge'](_0x930ecd[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x930ecd['attributes'],function(_0x3113b5){var _0x8f2eb0={};_0x8f2eb0[_0x3113b5]={'$like':'%'+_0x1c75d0[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x8f2eb0;})});}_0x930ecd=_['merge']({},_0x930ecd,_0x1c75d0[_0xf323('0x62')]);return _0x1ab525['getOpenchannelInteractions'](_0x930ecd);}})['then'](function(_0x5066e4){if(_0x5066e4){_0x22d804=_0x5066e4[_0xf323('0x57')];if(!_0x1c75d0[_0xf323('0x52')][_0xf323('0x58')]('nolimit')){_0x930ecd['limit']=qs[_0xf323('0x35')](_0x1c75d0[_0xf323('0x52')]['limit']);_0x930ecd['offset']=qs['offset'](_0x1c75d0[_0xf323('0x52')]['offset']);}return _0x1ab525[_0xf323('0xd4')](_0x930ecd);}})[_0xf323('0x3b')](function(_0x18ae25){if(_0x18ae25){return _0x18ae25?{'count':_0x22d804,'rows':_0x18ae25}:null;}})['then'](respondWithResult(_0x5cad63,null))[_0xf323('0x66')](handleError(_0x5cad63,null));};exports[_0xf323('0xd6')]=function(_0x3d8413,_0x4b9947,_0x41b807){var _0x12ddc1={'raw':!![],'where':{}};var _0x5a4ae1={};var _0x4a79d4={'count':0x0,'rows':[]};return db[_0xf323('0x4b')][_0xf323('0x96')]({'where':{'id':_0x3d8413['params']['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x4b9947,null))[_0xf323('0x3b')](function(_0xff1517){if(_0xff1517){_0x5a4ae1[_0xf323('0x50')]=_[_0xf323('0x69')](db[_0xf323('0xd7')][_0xf323('0x4c')]);_0x5a4ae1[_0xf323('0x52')]=_['keys'](_0x3d8413[_0xf323('0x52')]);_0x5a4ae1[_0xf323('0x53')]=_[_0xf323('0x54')](_0x5a4ae1[_0xf323('0x50')],_0x5a4ae1[_0xf323('0x52')]);_0x12ddc1['attributes']=_[_0xf323('0x54')](_0x5a4ae1[_0xf323('0x50')],qs[_0xf323('0x56')](_0x3d8413[_0xf323('0x52')][_0xf323('0x56')]));_0x12ddc1['attributes']=_0x12ddc1[_0xf323('0x55')][_0xf323('0x57')]?_0x12ddc1[_0xf323('0x55')]:_0x5a4ae1[_0xf323('0x50')];if(!_0x3d8413[_0xf323('0x52')][_0xf323('0x58')](_0xf323('0x59'))){_0x12ddc1[_0xf323('0x35')]=qs['limit'](_0x3d8413[_0xf323('0x52')][_0xf323('0x35')]);_0x12ddc1[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x3d8413[_0xf323('0x52')]['offset']);}_0x12ddc1[_0xf323('0xc3')]=qs['sort'](_0x3d8413[_0xf323('0x52')][_0xf323('0x5a')]);_0x12ddc1[_0xf323('0x5b')]=qs['filters'](_['pick'](_0x3d8413[_0xf323('0x52')],_0x5a4ae1[_0xf323('0x53')]));_0x12ddc1[_0xf323('0x5b')]['UserId']=_0xff1517['id'];if(_0x3d8413['query'][_0xf323('0x40')]){_0x12ddc1[_0xf323('0x5b')]=_['merge'](_0x12ddc1[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x12ddc1[_0xf323('0x55')],function(_0x35454f){var _0x11490e={};_0x11490e[_0x35454f]={'$like':'%'+_0x3d8413[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x11490e;})});}_0x12ddc1=_[_0xf323('0x5d')]({},_0x12ddc1,_0x3d8413[_0xf323('0x62')]);return db[_0xf323('0xd7')]['count']({'where':_0x12ddc1['where']})[_0xf323('0x3b')](function(_0x2fe0f9){_0x4a79d4[_0xf323('0x33')]=_0x2fe0f9;if(_0x3d8413['query'][_0xf323('0x63')]){_0x12ddc1[_0xf323('0x64')]=[{'all':!![]}];}return db['MailInteraction'][_0xf323('0x65')](_0x12ddc1);})[_0xf323('0x3b')](function(_0x3f8acd){_0x4a79d4[_0xf323('0xcf')]=_0x3f8acd;return _0x4a79d4;});}})['then'](respondWithFilteredResult(_0x4b9947,_0x12ddc1))['catch'](handleError(_0x4b9947,null));};exports['getSmsInteractions']=function(_0x4322b9,_0x2c0cca,_0xc23fd0){var _0x393aee={};var _0x181fcd={};var _0x52fcc0;var _0x28c270;return db[_0xf323('0x4b')]['findOne']({'where':{'id':_0x4322b9[_0xf323('0x68')]['id']}})['then'](handleEntityNotFound(_0x2c0cca,null))[_0xf323('0x3b')](function(_0x3bbebd){if(_0x3bbebd){_0x52fcc0=_0x3bbebd;_0x181fcd[_0xf323('0x50')]=_[_0xf323('0x69')](db[_0xf323('0xd8')][_0xf323('0x4c')]);_0x181fcd[_0xf323('0x52')]=_[_0xf323('0x69')](_0x4322b9[_0xf323('0x52')]);_0x181fcd[_0xf323('0x53')]=_[_0xf323('0x54')](_0x181fcd[_0xf323('0x50')],_0x181fcd[_0xf323('0x52')]);_0x393aee[_0xf323('0x55')]=_['intersection'](_0x181fcd[_0xf323('0x50')],qs[_0xf323('0x56')](_0x4322b9[_0xf323('0x52')][_0xf323('0x56')]));_0x393aee[_0xf323('0x55')]=_0x393aee[_0xf323('0x55')][_0xf323('0x57')]?_0x393aee[_0xf323('0x55')]:_0x181fcd[_0xf323('0x50')];_0x393aee[_0xf323('0xc3')]=qs[_0xf323('0x5a')](_0x4322b9[_0xf323('0x52')][_0xf323('0x5a')]);_0x393aee[_0xf323('0x5b')]=qs[_0xf323('0x53')](_[_0xf323('0x5c')](_0x4322b9[_0xf323('0x52')],_0x181fcd[_0xf323('0x53')]));if(_0x4322b9[_0xf323('0x52')][_0xf323('0x40')]){_0x393aee[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x393aee[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x393aee[_0xf323('0x55')],function(_0x370a31){var _0x272bb4={};_0x272bb4[_0x370a31]={'$like':'%'+_0x4322b9[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x272bb4;})});}_0x393aee=_[_0xf323('0x5d')]({},_0x393aee,_0x4322b9[_0xf323('0x62')]);return _0x52fcc0[_0xf323('0xd9')](_0x393aee);}})[_0xf323('0x3b')](function(_0x47e9da){if(_0x47e9da){_0x28c270=_0x47e9da[_0xf323('0x57')];if(!_0x4322b9[_0xf323('0x52')][_0xf323('0x58')](_0xf323('0x59'))){_0x393aee['limit']=qs[_0xf323('0x35')](_0x4322b9[_0xf323('0x52')]['limit']);_0x393aee[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x4322b9['query'][_0xf323('0x34')]);}return _0x52fcc0['getSmsInteractions'](_0x393aee);}})[_0xf323('0x3b')](function(_0x121250){if(_0x121250){return _0x121250?{'count':_0x28c270,'rows':_0x121250}:null;}})[_0xf323('0x3b')](respondWithResult(_0x2c0cca,null))[_0xf323('0x66')](handleError(_0x2c0cca,null));};exports[_0xf323('0xda')]=function(_0x2fa51b,_0x5df7ed,_0x5e82bd){var _0x5354e3={};var _0x3c2342={};var _0x598d86;var _0x1ab82c;return db['User'][_0xf323('0x96')]({'where':{'id':_0x2fa51b[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x5df7ed,null))[_0xf323('0x3b')](function(_0x29b2b7){if(_0x29b2b7){_0x598d86=_0x29b2b7;_0x3c2342[_0xf323('0x50')]=_[_0xf323('0x69')](db[_0xf323('0xdb')][_0xf323('0x4c')]);_0x3c2342[_0xf323('0x52')]=_[_0xf323('0x69')](_0x2fa51b[_0xf323('0x52')]);_0x3c2342['filters']=_['intersection'](_0x3c2342[_0xf323('0x50')],_0x3c2342[_0xf323('0x52')]);_0x5354e3[_0xf323('0x55')]=_[_0xf323('0x54')](_0x3c2342['model'],qs[_0xf323('0x56')](_0x2fa51b[_0xf323('0x52')][_0xf323('0x56')]));_0x5354e3[_0xf323('0x55')]=_0x5354e3[_0xf323('0x55')][_0xf323('0x57')]?_0x5354e3[_0xf323('0x55')]:_0x3c2342[_0xf323('0x50')];_0x5354e3['order']=qs[_0xf323('0x5a')](_0x2fa51b[_0xf323('0x52')][_0xf323('0x5a')]);_0x5354e3[_0xf323('0x5b')]=qs[_0xf323('0x53')](_[_0xf323('0x5c')](_0x2fa51b['query'],_0x3c2342[_0xf323('0x53')]));if(_0x2fa51b[_0xf323('0x52')][_0xf323('0x40')]){_0x5354e3[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x5354e3[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x5354e3[_0xf323('0x55')],function(_0x506890){var _0x1bb4d3={};_0x1bb4d3[_0x506890]={'$like':'%'+_0x2fa51b[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x1bb4d3;})});}_0x5354e3=_[_0xf323('0x5d')]({},_0x5354e3,_0x2fa51b['options']);return _0x598d86['getFaxInteractions'](_0x5354e3);}})[_0xf323('0x3b')](function(_0xcaf6b5){if(_0xcaf6b5){_0x1ab82c=_0xcaf6b5[_0xf323('0x57')];if(!_0x2fa51b['query'][_0xf323('0x58')](_0xf323('0x59'))){_0x5354e3[_0xf323('0x35')]=qs[_0xf323('0x35')](_0x2fa51b[_0xf323('0x52')][_0xf323('0x35')]);_0x5354e3[_0xf323('0x34')]=qs['offset'](_0x2fa51b[_0xf323('0x52')][_0xf323('0x34')]);}return _0x598d86[_0xf323('0xda')](_0x5354e3);}})[_0xf323('0x3b')](function(_0x232a8e){if(_0x232a8e){return _0x232a8e?{'count':_0x1ab82c,'rows':_0x232a8e}:null;}})['then'](respondWithResult(_0x5df7ed,null))['catch'](handleError(_0x5df7ed,null));};exports[_0xf323('0xdc')]=function(_0x56b050,_0x2862c1,_0x432a26){var _0x5e8e8a;var _0x58a69f;var _0x34aa9c;var _0x4cfa44=!_[_0xf323('0x7d')](_0x56b050['params']['id'])?_0x56b050[_0xf323('0x68')]['id']:!_[_0xf323('0x7d')](_0x56b050['user']['id'])?_0x56b050['user']['id']:null;return db[_0xf323('0x4b')]['find']({'where':{'id':_0x4cfa44,'role':{'$or':[_0xf323('0x9e'),'user',_0xf323('0x85')]}},'attributes':['id',_0xf323('0x45'),'phone',_0xf323('0xdd'),'role',_0xf323('0x78'),'loginInPause']})['then'](function(_0x4a59ce){if(_0x4a59ce){if(_0x4a59ce[_0xf323('0x43')]===_0xf323('0x85')){_0x5e8e8a=_0x4a59ce;if(_0x56b050[_0xf323('0x6c')][_0xf323('0xa6')]){_0x34aa9c=util[_0xf323('0x75')]('LOCAL/%s@from-sip/n',_0x5e8e8a[_0x56b050[_0xf323('0x6c')]['interface']]);}else if(_0x56b050[_0xf323('0x6c')][_0xf323('0xde')]){_0x34aa9c=util[_0xf323('0x75')]('SIP/%s',_0x56b050[_0xf323('0x6c')][_0xf323('0xde')]);}else{_0x34aa9c=util['format'](_0xf323('0xb0'),_0x5e8e8a[_0xf323('0x45')]);}socket['to'](util['format'](_0xf323('0xdf'),_0x5e8e8a['name']))[_0xf323('0xac')]('user:forcelogout',{'ip':_0x56b050[_0xf323('0xe0')][_0xf323('0xe1')]||_0x56b050[_0xf323('0xe2')][_0xf323('0xe3')]||_0x56b050[_0xf323('0xe4')][_0xf323('0xe3')]||_0x56b050[_0xf323('0xe2')][_0xf323('0xe4')][_0xf323('0xe3')]});return db[_0xf323('0xb2')][_0xf323('0x47')]({'where':{'membername':_0x5e8e8a['name']},'individualHooks':!![]});}}else{throw new db[(_0xf323('0x23'))][(_0xf323('0x99'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x5e8e8a){return _0x5e8e8a[_0xf323('0xe5')]({'raw':!![]});}})[_0xf323('0x3b')](function(_0x5c7a7b){if(_0x5e8e8a){var _0x657cbe=[];if(_0x5c7a7b){_0x58a69f=_0x5c7a7b;if(_0x58a69f[_0xf323('0x57')]){for(var _0x29da89=0x0;_0x29da89<_0x58a69f['length'];_0x29da89++){_0x657cbe['push']({'membername':_0x5e8e8a[_0xf323('0x45')],'UserId':_0x5e8e8a['id'],'queue_name':_0x58a69f[_0x29da89][_0xf323('0x45')],'VoiceQueueId':_0x58a69f[_0x29da89]['id'],'interface':_0x34aa9c,'paused':_0x5e8e8a['loginInPause']||![],'penalty':_0x58a69f[_0x29da89][_0xf323('0xe6')]||0x0});}return BPromise['each'](_0x657cbe,function(_0x3760f5){return db['UserVoiceQueueRt']['upsert'](_0x3760f5);});}}}})[_0xf323('0x3b')](function(){if(_0x5e8e8a){return db[_0xf323('0xe7')][_0xf323('0x65')]({'where':{'membername':_0x5e8e8a[_0xf323('0x45')],'exitAt':null}});}})[_0xf323('0x3b')](function(_0x1dde55){if(_0x5e8e8a){var _0x175199=[];_0x1dde55['forEach'](function(_0x15f30e){_0x175199[_0xf323('0xaf')](_0x15f30e[_0xf323('0x3a')]({'exitAt':moment()['format'](_0xf323('0xe8'))}));});return BPromise[_0xf323('0xe9')](_0x175199);}})['then'](function(){if(_0x5e8e8a){var _0x1d642e=[];var _0x2c24ba=[];var _0x18428f=utils[_0xf323('0xea')]();var _0x1f7178={'membername':_0x5e8e8a['name'],'interface':_0x34aa9c,'enterAt':moment()[_0xf323('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5e8e8a['role'],'internal':_0x5e8e8a['internal']};_0x18428f['forEach'](function(_0x3a4a2e){_0x1d642e[_0xf323('0xaf')](_[_0xf323('0x5d')]({'channel':_0x3a4a2e,'type':_0xf323('0xeb'),'data1':_0x56b050[_0xf323('0x6c')][_0xf323('0xec')],'data2':_0x34aa9c},_0x1f7178));if(_0x5e8e8a['loginInPause']){_0x2c24ba[_0xf323('0xaf')](_[_0xf323('0x5d')]({'channel':_0x3a4a2e,'type':_0xf323('0xed'),'data1':_0xf323('0xee')},_0x1f7178));}});return db[_0xf323('0xe7')][_0xf323('0x6b')](_0x1d642e['concat'](_0x2c24ba),{'individualHooks':!![]});}})[_0xf323('0x3b')](function(){if(_0x5e8e8a){return _0x5e8e8a[_0xf323('0x3a')]({'online':!![],'lastLoginAt':moment()[_0xf323('0x75')](_0xf323('0xe8')),'voicePause':_0x5e8e8a[_0xf323('0xa4')]||![],'mailPause':_0x5e8e8a[_0xf323('0xa4')]||![],'chatPause':_0x5e8e8a['loginInPause']||![],'faxPause':_0x5e8e8a[_0xf323('0xa4')]||![],'smsPause':_0x5e8e8a[_0xf323('0xa4')]||![],'openchannelPause':_0x5e8e8a[_0xf323('0xa4')]||![],'pauseType':_0x5e8e8a[_0xf323('0xa4')]?_0xf323('0xee'):null,'interface':_0x34aa9c,'lastPauseAt':moment()[_0xf323('0x75')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xf323('0x3b')](function(_0x97b021){if(_0x56b050[_0xf323('0xef')]){return _0x432a26();}else{return BPromise[_0xf323('0xf0')](_0x97b021)[_0xf323('0x3b')](respondWithResult(_0x2862c1,null));}})['catch'](handleError(_0x2862c1,null));};exports['logout']=function(_0x47dcef,_0x560d04,_0x14ffc3){var _0x324d24;return db[_0xf323('0x4b')][_0xf323('0x44')]({'where':{'id':_0x47dcef[_0xf323('0x68')]['id'],'role':'agent'},'attributes':['id',_0xf323('0x45'),'role']})[_0xf323('0x3b')](handleEntityNotFound(_0x560d04,null))[_0xf323('0x3b')](function(_0x38f2f9){if(_0x38f2f9){_0x324d24=_0x38f2f9;return db[_0xf323('0xb2')][_0xf323('0x47')]({'where':{'membername':_0x324d24[_0xf323('0x45')]},'individualHooks':!![]});}})[_0xf323('0x3b')](function(){return db[_0xf323('0xe7')]['findAll']({'where':{'membername':_0x324d24[_0xf323('0x45')],'exitAt':null}});})[_0xf323('0x3b')](function(_0x4c94ff){var _0x26c569=[];_0x4c94ff[_0xf323('0xf1')](function(_0x1918b7){_0x26c569[_0xf323('0xaf')](_0x1918b7[_0xf323('0x3a')]({'exitAt':moment()[_0xf323('0x75')](_0xf323('0xe8'))}));});return BPromise['all'](_0x26c569);})['then'](function(){return _0x324d24[_0xf323('0x3a')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x560d04,null))[_0xf323('0x66')](handleError(_0x560d04,null));};exports[_0xf323('0xf2')]=function(_0x1c04ad,_0x534964,_0x2927b1){var _0x51ef6a;return db[_0xf323('0xb2')][_0xf323('0x3a')]({'paused':0x1},{'where':{'UserId':_0x1c04ad['params']['id']},'individualHooks':!![]})[_0xf323('0x3b')](function(){return db['User'][_0xf323('0x44')]({'where':{'id':_0x1c04ad[_0xf323('0x68')]['id'],'role':_0xf323('0x85')},'attributes':['id',_0xf323('0x45'),_0xf323('0x43'),_0xf323('0x78'),'interface']});})[_0xf323('0x3b')](handleEntityNotFound(_0x534964,null))[_0xf323('0x3b')](function(_0x48fd66){if(_0x48fd66){_0x51ef6a=_0x48fd66;return respondWithRpcPromise(_0xf323('0xf3'),'pause',{'id':_0x51ef6a['id'],'name':_0x51ef6a[_0xf323('0x45')],'pause':!![]});}})[_0xf323('0x3b')](function(){if(_0x51ef6a){return db[_0xf323('0xe7')][_0xf323('0x65')]({'where':{'membername':_0x51ef6a[_0xf323('0x45')],'type':_0xf323('0xed'),'exitAt':null}});}})[_0xf323('0x3b')](function(_0x59fcfe){if(_0x59fcfe[_0xf323('0x57')]){var _0x125f8c=moment()[_0xf323('0x75')](_0xf323('0xe8'));for(var _0x24b517=0x0,_0x35e41c=_0x59fcfe['length'];_0x24b517<_0x35e41c;_0x24b517++){_0x59fcfe[_0x24b517][_0xf323('0xf4')]({'exitAt':_0x125f8c});}}})[_0xf323('0x3b')](function(){var _0x69d9=[];var _0x42df10=utils[_0xf323('0xea')]();_0x42df10[_0xf323('0xf1')](function(_0x4458e9){_0x69d9[_0xf323('0xaf')]({'channel':_0x4458e9,'membername':_0x51ef6a[_0xf323('0x45')],'interface':_['isNil'](_0x51ef6a[_0xf323('0xa6')])?util[_0xf323('0x75')](_0xf323('0xb0'),_0x51ef6a['name']):_0x51ef6a['interface'],'type':_0xf323('0xed'),'enterAt':moment()['format'](_0xf323('0xe8')),'data1':_0x1c04ad[_0xf323('0x6c')][_0xf323('0x4e')]||_0xf323('0xf5'),'role':_0x51ef6a[_0xf323('0x43')],'internal':_0x51ef6a[_0xf323('0x78')]});});return db['MemberReport'][_0xf323('0x6b')](_0x69d9,{'individualHooks':!![]});})['then'](function(){return _0x51ef6a['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1c04ad['body'][_0xf323('0x4e')]||_0xf323('0xf5'),'lastPauseAt':moment()[_0xf323('0x75')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xf323('0x3b')](respondWithResult(_0x534964,null))[_0xf323('0x66')](handleError(_0x534964,null));};exports[_0xf323('0xf6')]=function(_0x40478d,_0x138f89,_0x573f5e){var _0x9ccb83;return db[_0xf323('0x4b')][_0xf323('0x44')]({'where':{'id':_0x40478d[_0xf323('0x68')]['id']},'attributes':['id',_0xf323('0x45'),'role',_0xf323('0xa5'),_0xf323('0xf7'),'chatPause',_0xf323('0xf8'),_0xf323('0xf9'),'smsPause','pauseType',_0xf323('0xfa')]})[_0xf323('0x3b')](handleEntityNotFound(_0x138f89,null))[_0xf323('0x3b')](function(_0x1a8803){if(_0x1a8803){_0x9ccb83=_0x1a8803;if(_0x40478d['body'][_0xf323('0xa2')]&&!utils['isValidChannel'](_0x40478d[_0xf323('0x6c')][_0xf323('0xa2')])){throw new db['Sequelize'][(_0xf323('0x99'))](_0xf323('0xa7'));}switch(_0x40478d[_0xf323('0x6c')][_0xf323('0xa2')]){case _0xf323('0xad'):return respondWithRpcPromise(_0xf323('0xf3'),_0xf323('0xf6'),{'id':_0x9ccb83['id'],'name':_0x9ccb83['name'],'pause':![]})[_0xf323('0x3b')](function(){return db[_0xf323('0xb2')][_0xf323('0x3a')]({'paused':0x0},{'where':{'UserId':_0x9ccb83['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0xf323('0x44')]({'where':{'channel':_0x40478d[_0xf323('0x6c')][_0xf323('0xa2')],'membername':_0x9ccb83[_0xf323('0x45')],'type':_0xf323('0xed'),'exitAt':null}});})[_0xf323('0x3b')](function(_0x4bf328){if(_0x4bf328){return _0x4bf328[_0xf323('0x3a')]({'exitAt':moment()[_0xf323('0x75')](_0xf323('0xe8')),'data2':_0xf323('0xfb')},{'individualHooks':!![]});}return null;})[_0xf323('0x3b')](function(){return _0x9ccb83[_0xf323('0x3a')]({'voicePause':![]});});case _0xf323('0xfc'):case _0xf323('0xfd'):case _0xf323('0xfe'):case _0xf323('0xff'):case _0xf323('0x100'):return db[_0xf323('0xe7')][_0xf323('0x44')]({'where':{'channel':_0x40478d[_0xf323('0x6c')][_0xf323('0xa2')],'membername':_0x9ccb83['name'],'type':'PAUSE','exitAt':null}})['then'](function(_0x2493d7){if(_0x2493d7){return _0x2493d7['update']({'exitAt':moment()[_0xf323('0x75')](_0xf323('0xe8')),'data2':_0xf323('0xfb')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x138962={};_[_0xf323('0x101')](_0x138962,util[_0xf323('0x75')](_0xf323('0x102'),_0x40478d[_0xf323('0x6c')][_0xf323('0xa2')],_0xf323('0x103')),![]);return _0x9ccb83[_0xf323('0x3a')](_0x138962);});default:return respondWithRpcPromise(_0xf323('0xf3'),_0xf323('0xf6'),{'id':_0x9ccb83['id'],'name':_0x9ccb83['name'],'pause':![]})[_0xf323('0x3b')](function(){return db[_0xf323('0xb2')][_0xf323('0x3a')]({'paused':0x0},{'where':{'UserId':_0x9ccb83['id']}});})[_0xf323('0x3b')](function(){return db[_0xf323('0xe7')]['findAll']({'where':{'membername':_0x9ccb83[_0xf323('0x45')],'type':_0xf323('0xed'),'exitAt':null}});})['then'](function(_0x4d5a38){var _0x1c626c=[];_0x4d5a38[_0xf323('0xf1')](function(_0x28a315){_0x1c626c[_0xf323('0xaf')](_0x28a315[_0xf323('0x3a')]({'exitAt':moment()[_0xf323('0x75')](_0xf323('0xe8')),'data2':_0xf323('0xfb')}));});return BPromise[_0xf323('0xe9')](_0x1c626c);})[_0xf323('0x3b')](function(){return _0x9ccb83['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xf323('0x3b')](respondWithResult(_0x138f89,null))[_0xf323('0x66')](handleError(_0x138f89,null));};exports[_0xf323('0x104')]=function(_0x440190,_0x3bdbe6,_0x438b39){var _0x59c365={};var _0x211a82={};var _0x1e5280;var _0x2af395;return db[_0xf323('0x4b')][_0xf323('0x96')]({'where':{'id':_0x440190[_0xf323('0x68')]['id']}})['then'](handleEntityNotFound(_0x3bdbe6,null))['then'](function(_0x13cf31){if(_0x13cf31){_0x1e5280=_0x13cf31;_0x211a82[_0xf323('0x50')]=_[_0xf323('0x69')](db[_0xf323('0x105')][_0xf323('0x4c')]);_0x211a82[_0xf323('0x52')]=_[_0xf323('0x69')](_0x440190[_0xf323('0x52')]);_0x211a82['filters']=_[_0xf323('0x54')](_0x211a82[_0xf323('0x50')],_0x211a82[_0xf323('0x52')]);_0x59c365['attributes']=_[_0xf323('0x54')](_0x211a82[_0xf323('0x50')],qs[_0xf323('0x56')](_0x440190[_0xf323('0x52')][_0xf323('0x56')]));_0x59c365[_0xf323('0x55')]=_0x59c365[_0xf323('0x55')][_0xf323('0x57')]?_0x59c365[_0xf323('0x55')]:_0x211a82[_0xf323('0x50')];_0x59c365[_0xf323('0xc3')]=qs[_0xf323('0x5a')](_0x440190[_0xf323('0x52')]['sort']);_0x59c365[_0xf323('0x5b')]=qs[_0xf323('0x53')](_[_0xf323('0x5c')](_0x440190['query'],_0x211a82['filters']));if(_0x440190['query']['filter']){_0x59c365[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x59c365[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x59c365[_0xf323('0x55')],function(_0x10a515){var _0x2bc12f={};_0x2bc12f[_0x10a515]={'$like':'%'+_0x440190[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x2bc12f;})});}_0x59c365=_[_0xf323('0x5d')]({},_0x59c365,_0x440190[_0xf323('0x62')]);return _0x1e5280['getTeams'](_0x59c365);}})[_0xf323('0x3b')](function(_0x446515){if(_0x446515){_0x2af395=_0x446515['length'];if(!_0x440190[_0xf323('0x52')]['hasOwnProperty']('nolimit')){_0x59c365[_0xf323('0x35')]=qs[_0xf323('0x35')](_0x440190[_0xf323('0x52')]['limit']);_0x59c365[_0xf323('0x34')]=qs[_0xf323('0x34')](_0x440190[_0xf323('0x52')][_0xf323('0x34')]);}return _0x1e5280[_0xf323('0x104')](_0x59c365);}})[_0xf323('0x3b')](function(_0x41cf40){if(_0x41cf40){return _0x41cf40?{'count':_0x2af395,'rows':_0x41cf40}:null;}})[_0xf323('0x3b')](respondWithResult(_0x3bdbe6,null))[_0xf323('0x66')](handleError(_0x3bdbe6,null));};exports[_0xf323('0x106')]=function(_0x371050,_0x77f29c){return db[_0xf323('0x4b')][_0xf323('0x44')]({'where':{'id':_0x371050[_0xf323('0x68')]['id']}})['then'](handleEntityNotFound(_0x77f29c,null))[_0xf323('0x3b')](function(_0x336f1e){if(_0x336f1e){var _0x4e72eb=_0x336f1e[_0xf323('0x3c')]({'plain':!![]});return _0x336f1e[_0xf323('0x106')](_0x371050[_0xf323('0x6c')][_0xf323('0x6f')],_['omit'](_0x371050[_0xf323('0x6c')],[_0xf323('0x6f'),'id'])||{})['then'](function(){for(var _0x39b0f0=0x0;_0x39b0f0<_0x371050[_0xf323('0x6c')][_0xf323('0x6f')][_0xf323('0x57')];_0x39b0f0++){var _0x75dab9=[];db[_0xf323('0x105')][_0xf323('0x96')]({'where':{'id':_0x371050['body'][_0xf323('0x6f')][_0x39b0f0]}})['then'](function(_0x2354c2){_0x75dab9[_0xf323('0xaf')](_0x2354c2[_0xf323('0xe5')]()['then'](function(_0x21b95d){for(var _0x48c30e=0x0;_0x48c30e<_0x21b95d[_0xf323('0x57')];_0x48c30e++){_0x21b95d[_0x48c30e][_0xf323('0x107')](_0xf323('0xa2'),_0xf323('0x108'));}return _0x21b95d;}));_0x75dab9[_0xf323('0xaf')](_0x2354c2[_0xf323('0x109')]()[_0xf323('0x3b')](function(_0x300b11){for(var _0x5388fe=0x0;_0x5388fe<_0x300b11[_0xf323('0x57')];_0x5388fe++){_0x300b11[_0x5388fe][_0xf323('0x107')]('channel',_0xf323('0x10a'));}return _0x300b11;}));_0x75dab9[_0xf323('0xaf')](_0x2354c2[_0xf323('0x10b')]()['then'](function(_0x4b7146){for(var _0x4dbb5e=0x0;_0x4dbb5e<_0x4b7146['length'];_0x4dbb5e++){_0x4b7146[_0x4dbb5e][_0xf323('0x107')](_0xf323('0xa2'),_0xf323('0x10c'));}return _0x4b7146;}));_0x75dab9[_0xf323('0xaf')](_0x2354c2[_0xf323('0x10d')]()[_0xf323('0x3b')](function(_0x101a53){for(var _0x3f045e=0x0;_0x3f045e<_0x101a53[_0xf323('0x57')];_0x3f045e++){_0x101a53[_0x3f045e]['setDataValue'](_0xf323('0xa2'),'Sms');}return _0x101a53;}));_0x75dab9[_0xf323('0xaf')](_0x2354c2['getFaxQueues']()[_0xf323('0x3b')](function(_0x1bd738){for(var _0x5c954f=0x0;_0x5c954f<_0x1bd738['length'];_0x5c954f++){_0x1bd738[_0x5c954f][_0xf323('0x107')](_0xf323('0xa2'),_0xf323('0x10e'));}return _0x1bd738;}));_0x75dab9[_0xf323('0xaf')](_0x2354c2[_0xf323('0x10f')]()[_0xf323('0x3b')](function(_0x1413a4){for(var _0x516b62=0x0;_0x516b62<_0x1413a4[_0xf323('0x57')];_0x516b62++){_0x1413a4[_0x516b62][_0xf323('0x107')](_0xf323('0xa2'),_0xf323('0x110'));}return _0x1413a4;}));return BPromise[_0xf323('0xe9')](_0x75dab9);})[_0xf323('0x3b')](function(_0x51ead1){var _0x36a58c=_['flatten'](_0x51ead1);_0x75dab9=[];return db[_0xf323('0x5f')]['transaction'](function(_0xa7deb9){for(var _0x5c4571=0x0;_0x5c4571<_0x36a58c[_0xf323('0x57')];_0x5c4571++){_0x75dab9[_0xf323('0xaf')](_0x36a58c[_0x5c4571][_0xf323('0x111')](_0x4e72eb['id']),{'transaction':_0xa7deb9});}return BPromise[_0xf323('0xe9')](_0x75dab9)[_0xf323('0x3b')](function(){if(_0x4e72eb[_0xf323('0xa3')]){return BPromise[_0xf323('0xb1')](_['filter'](_0x36a58c,function(_0x4ba1e4){return _0x4ba1e4[_0xf323('0x112')](_0xf323('0xa2'))===_0xf323('0x108');}),function(_0x45b525){return db[_0xf323('0xb2')][_0xf323('0xb3')]({'membername':_0x4e72eb['name'],'UserId':_0x4e72eb['id'],'queue_name':_0x45b525[_0xf323('0x45')],'VoiceQueueId':_0x45b525['id'],'interface':_[_0xf323('0x7d')](_0x4e72eb[_0xf323('0xa6')])?util[_0xf323('0x75')](_0xf323('0xb0'),_0x4e72eb[_0xf323('0x45')]):_0x4e72eb[_0xf323('0xa6')],'paused':_0x4e72eb[_0xf323('0xa5')]||![],'penalty':_0x4e72eb['penalty']},{'transaction':_0xa7deb9});});}else{return;}})['then'](function(){for(var _0x18219f=0x0;_0x18219f<_0x36a58c['length'];_0x18219f++){var _0x48ab65=_0x36a58c[_0x18219f][_0xf323('0x112')](_0xf323('0xa2'));var _0x4d4070=_0x48ab65+'QueueId';socket['emit'](_0xf323('0x3e')+_0x48ab65+_0xf323('0x113'),{'UserId':_0x4e72eb['id'],['queueField']:_0x36a58c[_0x18219f]['id']});}});});});}});}})[_0xf323('0x3b')](respondWithStatusCode(_0x77f29c,null))[_0xf323('0x66')](handleError(_0x77f29c,null));};exports[_0xf323('0x114')]=function(_0x2a034e,_0x5123ba){return db[_0xf323('0x4b')]['findOne']({'where':{'id':_0x2a034e[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x5123ba,null))['then'](function(_0x43b589){if(_0x43b589){var _0xc0a8e8=_0x43b589[_0xf323('0x3c')]({'plain':!![]});var _0x188417=_0x2a034e['query'][_0xf323('0x6f')];return _0x43b589[_0xf323('0x114')](_0x188417)[_0xf323('0x3b')](function(){for(var _0x3a0363=0x0;_0x3a0363<_0x188417[_0xf323('0x57')];_0x3a0363++){var _0x546c3d=[];db[_0xf323('0x105')]['findOne']({'where':{'id':_0x188417[_0x3a0363]}})[_0xf323('0x3b')](function(_0x4ab4b0){_0x546c3d[_0xf323('0xaf')](_0x4ab4b0[_0xf323('0xe5')]()[_0xf323('0x3b')](function(_0x19e55b){for(var _0x19fbdc=0x0;_0x19fbdc<_0x19e55b[_0xf323('0x57')];_0x19fbdc++){_0x19e55b[_0x19fbdc][_0xf323('0x107')]('channel',_0xf323('0x108'));}return _0x19e55b;}));_0x546c3d['push'](_0x4ab4b0['getChatQueues']()[_0xf323('0x3b')](function(_0x4c7b02){for(var _0x17d08f=0x0;_0x17d08f<_0x4c7b02[_0xf323('0x57')];_0x17d08f++){_0x4c7b02[_0x17d08f][_0xf323('0x107')](_0xf323('0xa2'),_0xf323('0x10a'));}return _0x4c7b02;}));_0x546c3d[_0xf323('0xaf')](_0x4ab4b0[_0xf323('0x10b')]()[_0xf323('0x3b')](function(_0x285d6b){for(var _0x5855d0=0x0;_0x5855d0<_0x285d6b[_0xf323('0x57')];_0x5855d0++){_0x285d6b[_0x5855d0][_0xf323('0x107')](_0xf323('0xa2'),_0xf323('0x10c'));}return _0x285d6b;}));_0x546c3d[_0xf323('0xaf')](_0x4ab4b0['getSmsQueues']()[_0xf323('0x3b')](function(_0x5c1271){for(var _0x48cad3=0x0;_0x48cad3<_0x5c1271[_0xf323('0x57')];_0x48cad3++){_0x5c1271[_0x48cad3][_0xf323('0x107')](_0xf323('0xa2'),_0xf323('0x115'));}return _0x5c1271;}));_0x546c3d[_0xf323('0xaf')](_0x4ab4b0[_0xf323('0x116')]()[_0xf323('0x3b')](function(_0x50198b){for(var _0x393d6e=0x0;_0x393d6e<_0x50198b[_0xf323('0x57')];_0x393d6e++){_0x50198b[_0x393d6e][_0xf323('0x107')](_0xf323('0xa2'),_0xf323('0x10e'));}return _0x50198b;}));_0x546c3d[_0xf323('0xaf')](_0x4ab4b0[_0xf323('0x10f')]()[_0xf323('0x3b')](function(_0x43afa2){for(var _0x5178e3=0x0;_0x5178e3<_0x43afa2['length'];_0x5178e3++){_0x43afa2[_0x5178e3][_0xf323('0x107')]('channel','Openchannel');}return _0x43afa2;}));return BPromise['all'](_0x546c3d);})[_0xf323('0x3b')](function(_0x3371e5){var _0xe4b5ef=_[_0xf323('0x117')](_0x3371e5);_0x546c3d=[];return db['sequelize'][_0xf323('0x118')](function(_0x3c29a1){for(var _0x26cf38=0x0;_0x26cf38<_0xe4b5ef[_0xf323('0x57')];_0x26cf38++){_0x546c3d[_0xf323('0xaf')](_0xe4b5ef[_0x26cf38][_0xf323('0x119')](_0xc0a8e8['id']),{'transaction':_0x3c29a1});}return BPromise[_0xf323('0xe9')](_0x546c3d)[_0xf323('0x3b')](function(){if(_0xc0a8e8[_0xf323('0xa3')]){return BPromise[_0xf323('0xb1')](_[_0xf323('0x40')](_0xe4b5ef,function(_0x3f4428){return _0x3f4428[_0xf323('0x112')](_0xf323('0xa2'))===_0xf323('0x108');}),function(_0x1a8f71){return db[_0xf323('0xb2')][_0xf323('0x47')]({'where':{'VoiceQueueId':_0x1a8f71['id'],'UserId':_0xc0a8e8['id']},'transaction':_0x3c29a1});});}else{return;}})[_0xf323('0x3b')](function(){for(var _0x11b512=0x0;_0x11b512<_0xe4b5ef['length'];_0x11b512++){var _0x2c0ebd=_0xe4b5ef[_0x11b512][_0xf323('0x112')]('channel');var _0x3f732e=_0x2c0ebd+'QueueId';socket[_0xf323('0xac')](_0xf323('0x3e')+_0x2c0ebd+_0xf323('0xb7'),{'UserId':_0xc0a8e8['id'],['queueField']:_0xe4b5ef[_0x11b512]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x5123ba,null))[_0xf323('0x66')](handleError(_0x5123ba,null));};exports[_0xf323('0x11a')]=function(_0x5c31af,_0x56cb2a,_0x147c87){var _0x31441b={};var _0x4e47d9={};var _0x1df1e2;var _0x4eec1d;return db[_0xf323('0x4b')][_0xf323('0x96')]({'where':{'id':_0x5c31af[_0xf323('0x68')]['id']}})['then'](handleEntityNotFound(_0x56cb2a,null))[_0xf323('0x3b')](function(_0x5370f5){if(_0x5370f5){_0x1df1e2=_0x5370f5;_0x4e47d9['model']=_['keys'](db['CmList']['rawAttributes']);_0x4e47d9[_0xf323('0x52')]=_[_0xf323('0x69')](_0x5c31af['query']);_0x4e47d9[_0xf323('0x53')]=_[_0xf323('0x54')](_0x4e47d9[_0xf323('0x50')],_0x4e47d9[_0xf323('0x52')]);_0x31441b[_0xf323('0x55')]=_['intersection'](_0x4e47d9[_0xf323('0x50')],qs[_0xf323('0x56')](_0x5c31af[_0xf323('0x52')][_0xf323('0x56')]));_0x31441b[_0xf323('0x55')]=_0x31441b[_0xf323('0x55')][_0xf323('0x57')]?_0x31441b['attributes']:_0x4e47d9[_0xf323('0x50')];_0x31441b[_0xf323('0xc3')]=qs['sort'](_0x5c31af[_0xf323('0x52')][_0xf323('0x5a')]);_0x31441b['where']=qs['filters'](_[_0xf323('0x5c')](_0x5c31af['query'],_0x4e47d9[_0xf323('0x53')]));if(_0x5c31af[_0xf323('0x52')]['filter']){_0x31441b[_0xf323('0x5b')]=_[_0xf323('0x5d')](_0x31441b[_0xf323('0x5b')],{'$or':_['map'](_0x31441b['attributes'],function(_0x42f3c8){var _0x313449={};_0x313449[_0x42f3c8]={'$like':'%'+_0x5c31af[_0xf323('0x52')][_0xf323('0x40')]+'%'};return _0x313449;})});}_0x31441b=_[_0xf323('0x5d')]({},_0x31441b,_0x5c31af['options']);return _0x1df1e2[_0xf323('0x11a')](_0x31441b);}})[_0xf323('0x3b')](function(_0x232712){if(_0x232712){_0x4eec1d=_0x232712[_0xf323('0x57')];if(!_0x5c31af[_0xf323('0x52')]['hasOwnProperty'](_0xf323('0x59'))){_0x31441b['limit']=qs['limit'](_0x5c31af['query'][_0xf323('0x35')]);_0x31441b['offset']=qs[_0xf323('0x34')](_0x5c31af[_0xf323('0x52')][_0xf323('0x34')]);}return _0x1df1e2[_0xf323('0x11a')](_0x31441b);}})[_0xf323('0x3b')](function(_0x26d9c0){if(_0x26d9c0){return _0x26d9c0?{'count':_0x4eec1d,'rows':_0x26d9c0}:null;}})[_0xf323('0x3b')](respondWithResult(_0x56cb2a,null))['catch'](handleError(_0x56cb2a,null));};exports[_0xf323('0x11b')]=function(_0x2af0a8,_0x51e92e,_0x1b4eea){var _0x135d3f={};var _0x1ead43={};var _0x33d6a1;var _0x352940;return db['User'][_0xf323('0x96')]({'where':{'id':_0x2af0a8[_0xf323('0x68')]['id']}})[_0xf323('0x3b')](handleEntityNotFound(_0x51e92e,null))[_0xf323('0x3b')](function(_0x760bde){if(_0x760bde){_0x33d6a1=_0x760bde;_0x1ead43[_0xf323('0x50')]=_[_0xf323('0x69')](db[_0xf323('0x4b')]['rawAttributes']);_0x1ead43[_0xf323('0x52')]=_[_0xf323('0x69')](_0x2af0a8[_0xf323('0x52')]);_0x1ead43['filters']=_[_0xf323('0x54')](_0x1ead43[_0xf323('0x50')],_0x1ead43[_0xf323('0x52')]);_0x135d3f[_0xf323('0x55')]=_['intersection'](_0x1ead43[_0xf323('0x50')],qs['fields'](_0x2af0a8['query'][_0xf323('0x56')]));_0x135d3f[_0xf323('0x55')]=_0x135d3f[_0xf323('0x55')][_0xf323('0x57')]?_0x135d3f['attributes']:_0x1ead43[_0xf323('0x50')];_0x135d3f['order']=qs[_0xf323('0x5a')](_0x2af0a8['query'][_0xf323('0x5a')]);_0x135d3f[_0xf323('0x5b')]=qs['filters'](_[_0xf323('0x5c')](_0x2af0a8[_0xf323('0x52')],_0x1ead43[_0xf323('0x53')]));if(_0x2af0a8[_0xf323('0x52')][_0xf323('0x40')]){_0x135d3f['where']=_['merge'](_0x135d3f[_0xf323('0x5b')],{'$or':_[_0xf323('0x42')](_0x135d3f[_0xf323('0x55')],function(_0x516196){var _0x5dd126={};_0x5dd126[_0x516196]={'$like':'%'+_0x2af0a8['query'][_0xf323('0x40')]+'%'};return _0x5dd126;})});}_0x135d3f[_0xf323('0x50')]=db[_0xf323('0x4b')];_0x135d3f['as']=_0xf323('0x90');_0x135d3f=_['merge']({},_0x135d3f,_0x2af0a8['options']);return _0x33d6a1[_0xf323('0xe5')]({'include':[_0x135d3f]});}})[_0xf323('0x3b')](function(_0x5ad15f){if(_0x5ad15f){var _0x33b72c={},_0x338bc9=[],_0x22acf9=0x0;for(var _0x1aace1=0x0;_0x1aace1<_0x5ad15f[_0xf323('0x57')];_0x1aace1+=0x1){for(var _0x2b610d=0x0,_0x2179fd;_0x2b610d<_0x5ad15f[_0x1aace1][_0xf323('0x90')][_0xf323('0x57')];_0x2b610d+=0x1){_0x2179fd=_0x5ad15f[_0x1aace1][_0xf323('0x90')][_0x2b610d][_0xf323('0x3c')]({'plain':!![]});_0x33b72c[_0x2179fd['id']]=_0x2179fd;}}_0x33b72c=_['values'](_0x33b72c);for(var _0x3a6a8f=qs[_0xf323('0x34')](_0x2af0a8[_0xf323('0x52')][_0xf323('0x34')]);_0x3a6a8f<_0x33b72c['length']&&_0x338bc9['length']=_0x30726c['agents']){throw new Error(_0xb2d2('0x53'));}})[_0xb2d2('0xf')](function(){if(_0x209d8e){return db[_0xb2d2('0x2a')]['destroy']({'where':{'membername':_0x209d8e[_0xb2d2('0x34')]},'individualHooks':!![]});}})[_0xb2d2('0xf')](function(){if(_0x209d8e){return _0x209d8e[_0xb2d2('0x54')]({'raw':!![]});}})[_0xb2d2('0xf')](function(_0x451050){if(_0x209d8e){if(_0x451050){var _0x5cc323=[];_0x47adfa=_0x451050;if(_0x47adfa['length']){for(var _0x28c5a2=0x0;_0x28c5a2<_0x47adfa[_0xb2d2('0x2e')];_0x28c5a2++){_0x5cc323[_0xb2d2('0x33')](db[_0xb2d2('0x2a')]['upsert']({'membername':_0x209d8e[_0xb2d2('0x34')],'UserId':_0x209d8e['id'],'queue_name':_0x47adfa[_0x28c5a2][_0xb2d2('0x34')],'VoiceQueueId':_0x47adfa[_0x28c5a2]['id'],'interface':_0xae978,'paused':_0x209d8e['loginInPause']||![],'penalty':_0x47adfa[_0x28c5a2]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xb2d2('0x48')](_0x5cc323);}}}})[_0xb2d2('0xf')](function(){if(_0x209d8e){return db[_0xb2d2('0x2c')][_0xb2d2('0x1c')]({'where':{'membername':_0x209d8e[_0xb2d2('0x34')],'exitAt':null}});}})[_0xb2d2('0xf')](function(_0x213704){if(_0x209d8e){if(_0x213704&&_0x213704[_0xb2d2('0x2e')]){var _0x77e4c7=[];_0x213704[_0xb2d2('0x32')](function(_0x42b711){_0x77e4c7['push'](_0x42b711['update']({'exitAt':moment()['format'](_0xb2d2('0x30'))}));});return BPromise['all'](_0x77e4c7);}}})['then'](function(_0x4252d6){if(_0x209d8e){var _0x1aed95=[];var _0x1b1028=[];var _0x2e42f8=utils[_0xb2d2('0x31')]();var _0x18bf58={'membername':_0x209d8e[_0xb2d2('0x34')],'interface':_0xae978,'enterAt':moment()['format'](_0xb2d2('0x30')),'role':_0x209d8e['role'],'internal':_0x209d8e[_0xb2d2('0x4d')]};_0x2e42f8['forEach'](function(_0x4aedfd){_0x1aed95[_0xb2d2('0x33')](_['merge']({'channel':_0x4aedfd,'type':'LOGIN','data1':_0xb2d2('0x55'),'data2':_0xae978},_0x18bf58));if(_0x209d8e['loginInPause']){_0x1b1028[_0xb2d2('0x33')](_['merge']({'channel':_0x4aedfd,'type':'PAUSE','data1':_0xb2d2('0x56')},_0x18bf58));}});return db[_0xb2d2('0x2c')][_0xb2d2('0x3b')](_0x1aed95[_0xb2d2('0x57')](_0x1b1028),{'individualHooks':!![]});}})[_0xb2d2('0xf')](function(){if(_0x209d8e){return _0x209d8e[_0xb2d2('0x2b')]({'online':!![],'lastLoginAt':moment()[_0xb2d2('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x209d8e['loginInPause']||![],'mailPause':_0x209d8e[_0xb2d2('0x58')]||![],'chatPause':_0x209d8e['loginInPause']||![],'faxPause':_0x209d8e[_0xb2d2('0x58')]||![],'smsPause':_0x209d8e[_0xb2d2('0x58')]||![],'openchannelPause':_0x209d8e[_0xb2d2('0x58')]||![],'pauseType':_0x209d8e[_0xb2d2('0x58')]?_0xb2d2('0x56'):null,'lastPauseAt':moment()[_0xb2d2('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0xae978});}})[_0xb2d2('0xf')](function(_0x360421){_0x431f82(_0x360421);})[_0xb2d2('0x19')](function(_0x8f95e2){_0x204ef2(_0x1c4c04[_0xb2d2('0x15')](0x1f4,_0x8f95e2['message']));});});}; \ No newline at end of file +var _0x8152=['name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','isNil','SIP/%s','PAUSE','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','voice','find','mail','chat','fax','sms','system','Pause','push','all','LogoutUser','destroy','mobile','phone','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','GetUser','User','findAll','options','raw','where','include','map','model','attributes','debug','catch','ShowUser'];(function(_0x4e2ecb,_0x37e832){var _0x3944b6=function(_0x9db1){while(--_0x9db1){_0x4e2ecb['push'](_0x4e2ecb['shift']());}};_0x3944b6(++_0x37e832);}(_0x8152,0x90));var _0x2815=function(_0x33f8b6,_0x3ec786){_0x33f8b6=_0x33f8b6-0x0;var _0x191af5=_0x8152[_0x33f8b6];return _0x191af5;};'use strict';var _=require('lodash');var util=require(_0x2815('0x0'));var moment=require(_0x2815('0x1'));var BPromise=require(_0x2815('0x2'));var rs=require(_0x2815('0x3'));var fs=require('fs');var Redis=require(_0x2815('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2815('0x5'));var logger=require(_0x2815('0x6'))(_0x2815('0x7'));var config=require(_0x2815('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2815('0x9')]({'port':0x232a});config[_0x2815('0xa')]=_[_0x2815('0xb')](config[_0x2815('0xa')],{'host':_0x2815('0xc'),'port':0x18eb});var socket=require(_0x2815('0xd'))(new Redis(config['redis']));require(_0x2815('0xe'))[_0x2815('0xf')](socket);function respondWithRpcPromise(_0x258ba6,_0x565cc1,_0x4c652b){return new BPromise(function(_0x1a0f39,_0x5bad94){return client[_0x2815('0x10')](_0x258ba6,_0x4c652b)[_0x2815('0x11')](function(_0x1fcc01){logger['info'](_0x2815('0x12'),_0x565cc1,_0x2815('0x13'));logger['debug'](_0x2815('0x14'),_0x565cc1,_0x2815('0x13'),JSON[_0x2815('0x15')](_0x1fcc01));if(_0x1fcc01['error']){if(_0x1fcc01['error'][_0x2815('0x16')]===0x1f4){logger[_0x2815('0x17')]('User,\x20%s,\x20%s',_0x565cc1,_0x1fcc01[_0x2815('0x17')][_0x2815('0x18')]);return _0x5bad94(_0x1fcc01[_0x2815('0x17')][_0x2815('0x18')]);}logger[_0x2815('0x17')]('User,\x20%s,\x20%s',_0x565cc1,_0x1fcc01['error'][_0x2815('0x18')]);return _0x1a0f39(_0x1fcc01['error'][_0x2815('0x18')]);}else{logger[_0x2815('0x19')](_0x2815('0x12'),_0x565cc1,_0x2815('0x13'));_0x1a0f39(_0x1fcc01[_0x2815('0x1a')]['message']);}})['catch'](function(_0x3910fe){logger[_0x2815('0x17')](_0x2815('0x12'),_0x565cc1,_0x3910fe);_0x5bad94(_0x3910fe);});});}exports[_0x2815('0x1b')]=function(_0x586e65){var _0x2ea273=this;return new Promise(function(_0x3af81e,_0x39d632){return db[_0x2815('0x1c')][_0x2815('0x1d')]({'raw':_0x586e65[_0x2815('0x1e')]?_0x586e65[_0x2815('0x1e')][_0x2815('0x1f')]===undefined?!![]:![]:!![],'where':_0x586e65[_0x2815('0x1e')]?_0x586e65['options'][_0x2815('0x20')]||null:null,'attributes':_0x586e65['options']?_0x586e65['options']['attributes']||null:null,'limit':_0x586e65['options']?_0x586e65[_0x2815('0x1e')]['limit']||null:null,'include':_0x586e65[_0x2815('0x1e')]?_0x586e65['options'][_0x2815('0x21')]?_[_0x2815('0x22')](_0x586e65[_0x2815('0x1e')][_0x2815('0x21')],function(_0x27f361){return{'model':db[_0x27f361[_0x2815('0x23')]],'as':_0x27f361['as'],'attributes':_0x27f361[_0x2815('0x24')],'include':_0x27f361[_0x2815('0x21')]?_['map'](_0x27f361[_0x2815('0x21')],function(_0x4c4085){return{'model':db[_0x4c4085[_0x2815('0x23')]],'as':_0x4c4085['as'],'attributes':_0x4c4085[_0x2815('0x24')],'include':_0x4c4085[_0x2815('0x21')]?_[_0x2815('0x22')](_0x4c4085[_0x2815('0x21')],function(_0x1e1a21){return{'model':db[_0x1e1a21['model']],'as':_0x1e1a21['as'],'attributes':_0x1e1a21['attributes']};}):[]};}):[]};}):[]:[]})[_0x2815('0x11')](function(_0x4c7631){logger[_0x2815('0x19')](_0x2815('0x1b'),_0x586e65);logger[_0x2815('0x25')]('GetUser',_0x586e65,JSON['stringify'](_0x4c7631));_0x3af81e(_0x4c7631);})[_0x2815('0x26')](function(_0x4e0f9a){logger[_0x2815('0x17')](_0x2815('0x1b'),_0x4e0f9a[_0x2815('0x18')],_0x586e65);_0x39d632(_0x2ea273[_0x2815('0x17')](0x1f4,_0x4e0f9a[_0x2815('0x18')]));});});};exports['ShowUser']=function(_0x2a2a7b){var _0x4e5554=this;return new Promise(function(_0x37b0ba,_0x5d0555){return db[_0x2815('0x1c')]['find']({'raw':_0x2a2a7b[_0x2815('0x1e')]?_0x2a2a7b['options'][_0x2815('0x1f')]===undefined?!![]:![]:!![],'where':_0x2a2a7b[_0x2815('0x1e')]?_0x2a2a7b[_0x2815('0x1e')][_0x2815('0x20')]||null:null,'attributes':_0x2a2a7b[_0x2815('0x1e')]?_0x2a2a7b['options']['attributes']||null:null,'include':_0x2a2a7b[_0x2815('0x1e')]?_0x2a2a7b[_0x2815('0x1e')][_0x2815('0x21')]?_[_0x2815('0x22')](_0x2a2a7b[_0x2815('0x1e')][_0x2815('0x21')],function(_0x3253a7){return{'model':db[_0x3253a7[_0x2815('0x23')]],'as':_0x3253a7['as'],'attributes':_0x3253a7['attributes'],'include':_0x3253a7[_0x2815('0x21')]?_[_0x2815('0x22')](_0x3253a7['include'],function(_0x5443da){return{'model':db[_0x5443da[_0x2815('0x23')]],'as':_0x5443da['as'],'attributes':_0x5443da['attributes'],'include':_0x5443da[_0x2815('0x21')]?_['map'](_0x5443da['include'],function(_0x14849b){return{'model':db[_0x14849b['model']],'as':_0x14849b['as'],'attributes':_0x14849b[_0x2815('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a2683){logger[_0x2815('0x19')](_0x2815('0x27'),_0x2a2a7b);logger[_0x2815('0x25')]('ShowUser',_0x2a2a7b,JSON[_0x2815('0x15')](_0x5a2683));_0x37b0ba(_0x5a2683);})['catch'](function(_0x4fd1d4){logger[_0x2815('0x17')]('ShowUser',_0x4fd1d4[_0x2815('0x18')],_0x2a2a7b);_0x5d0555(_0x4e5554[_0x2815('0x17')](0x1f4,_0x4fd1d4[_0x2815('0x18')]));});});};exports['PauseUser']=function(_0x2dfd54){var _0x28598a=this;return new Promise(function(_0x36b88b,_0x572935){var _0x2c7917;return db[_0x2815('0x1c')]['find']({'where':_0x2dfd54[_0x2815('0x1e')][_0x2815('0x20')]||{},'attributes':['id',_0x2815('0x28'),_0x2815('0x29'),_0x2815('0x2a'),_0x2815('0x2b')]})[_0x2815('0x11')](function(_0x342058){if(_0x342058){_0x2c7917=_0x342058;return db[_0x2815('0x2c')][_0x2815('0x2d')]({'paused':0x1},{'where':{'UserId':_0x2c7917['id']},'individualHooks':!![]});}})[_0x2815('0x11')](function(){if(_0x2c7917){return db[_0x2815('0x2e')][_0x2815('0x1d')]({'where':{'membername':_0x2c7917[_0x2815('0x28')],'type':'PAUSE','exitAt':null}});}})[_0x2815('0x11')](function(_0xe7efb){if(_0x2c7917){if(_0xe7efb&&_0xe7efb[_0x2815('0x2f')]){var _0x5a7351=moment()[_0x2815('0x30')](_0x2815('0x31'));for(var _0x527286=0x0,_0x5ba1a1=_0xe7efb[_0x2815('0x2f')];_0x527286<_0x5ba1a1;_0x527286++){_0xe7efb[_0x527286][_0x2815('0x32')]({'exitAt':_0x5a7351});}}}})[_0x2815('0x11')](function(){if(_0x2c7917){var _0x29994e=[];var _0x4c3b15=utils['getChannels']();_0x4c3b15[_0x2815('0x33')](function(_0x29dd6c){_0x29994e['push']({'channel':_0x29dd6c,'membername':_0x2c7917['name'],'interface':_[_0x2815('0x34')](_0x2c7917[_0x2815('0x2b')])?util[_0x2815('0x30')](_0x2815('0x35'),_0x2c7917[_0x2815('0x28')]):_0x2c7917[_0x2815('0x2b')],'type':_0x2815('0x36'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2dfd54[_0x2815('0x37')]['type']||_0x2815('0x38'),'role':_0x2c7917[_0x2815('0x29')],'internal':_0x2c7917[_0x2815('0x2a')],'uniqueid':_0x2dfd54[_0x2815('0x37')][_0x2815('0x39')]||null});});return db[_0x2815('0x2e')][_0x2815('0x3a')](_0x29994e,{'individualHooks':!![]});}})['then'](function(){if(_0x2c7917){return _0x2c7917[_0x2815('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2dfd54[_0x2815('0x37')][_0x2815('0x3b')]||_0x2815('0x38'),'lastPauseAt':moment()[_0x2815('0x30')](_0x2815('0x31'))});}})['then'](function(_0xd93cf){_0x36b88b(_0xd93cf);})[_0x2815('0x26')](function(_0x541674){_0x572935(_0x28598a[_0x2815('0x17')](0x1f4,_0x541674[_0x2815('0x18')]));});});};exports[_0x2815('0x3c')]=function(_0x3e40ff){var _0x4b348c=this;return new Promise(function(_0x3d5153,_0x2e4ffa){var _0x554d83;return db[_0x2815('0x1c')][_0x2815('0x3d')]({'where':_0x3e40ff[_0x2815('0x1e')][_0x2815('0x20')]||{},'attributes':['id','name']})[_0x2815('0x11')](function(_0xe53efe){if(_0xe53efe){_0x554d83=_0xe53efe;if(_0x3e40ff[_0x2815('0x37')][_0x2815('0x3e')]&&!utils['isValidChannel'](_0x3e40ff[_0x2815('0x37')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x3e40ff['body'][_0x2815('0x3e')]){case _0x2815('0x3f'):return db[_0x2815('0x2c')]['update']({'paused':0x0},{'where':{'UserId':_0x554d83['id']}})[_0x2815('0x11')](function(){return db['MemberReport'][_0x2815('0x40')]({'where':{'channel':_0x3e40ff['body']['channel'],'membername':_0x554d83[_0x2815('0x28')],'type':'PAUSE','exitAt':null}});})[_0x2815('0x11')](function(_0x4f46cc){if(_0x4f46cc){return _0x4f46cc[_0x2815('0x2d')]({'exitAt':moment()[_0x2815('0x30')](_0x2815('0x31')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x2815('0x11')](function(){return _0x554d83['update']({'voicePause':![]});});case _0x2815('0x41'):case _0x2815('0x42'):case _0x2815('0x43'):case _0x2815('0x44'):case'openchannel':return db[_0x2815('0x2e')][_0x2815('0x40')]({'where':{'channel':_0x3e40ff[_0x2815('0x37')]['channel'],'membername':_0x554d83[_0x2815('0x28')],'type':'PAUSE','exitAt':null}})[_0x2815('0x11')](function(_0x587aed){return _0x587aed[_0x2815('0x2d')]({'exitAt':moment()[_0x2815('0x30')](_0x2815('0x31')),'data2':_0x2815('0x45')},{'individualHooks':!![]});})[_0x2815('0x11')](function(){var _0x188ffa={};_['set'](_0x188ffa,util[_0x2815('0x30')]('%s%s',_0x3e40ff[_0x2815('0x37')][_0x2815('0x3e')],_0x2815('0x46')),![]);return _0x554d83[_0x2815('0x2d')](_0x188ffa);});default:return db[_0x2815('0x2c')]['update']({'paused':0x0},{'where':{'UserId':_0x554d83['id']}})['then'](function(){return db['MemberReport'][_0x2815('0x1d')]({'where':{'membername':_0x554d83[_0x2815('0x28')],'type':'PAUSE','exitAt':null}});})[_0x2815('0x11')](function(_0x25e0c8){var _0x1f4ad2=[];_0x25e0c8[_0x2815('0x33')](function(_0x58e8b5){_0x1f4ad2[_0x2815('0x47')](_0x58e8b5[_0x2815('0x2d')]({'exitAt':moment()[_0x2815('0x30')](_0x2815('0x31')),'data2':_0x2815('0x45')}));});return BPromise[_0x2815('0x48')](_0x1f4ad2);})[_0x2815('0x11')](function(){return _0x554d83['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x2815('0x11')](function(_0x2376a8){_0x3d5153(_0x2376a8);})[_0x2815('0x26')](function(_0x5377b9){_0x2e4ffa(_0x4b348c['error'](0x1f4,_0x5377b9[_0x2815('0x18')]));});});};exports[_0x2815('0x49')]=function(_0x32c18d){var _0x330603=this;return new Promise(function(_0x296abb,_0x1da2fc){var _0x14e015;return db[_0x2815('0x1c')][_0x2815('0x3d')]({'where':_0x32c18d[_0x2815('0x1e')][_0x2815('0x20')]||{},'attributes':['id',_0x2815('0x28')]})[_0x2815('0x11')](function(_0x21e0ff){if(_0x21e0ff){_0x14e015=_0x21e0ff;return db[_0x2815('0x2c')][_0x2815('0x4a')]({'where':{'membername':_0x14e015[_0x2815('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x14e015){return db[_0x2815('0x2e')][_0x2815('0x1d')]({'where':{'membername':_0x14e015[_0x2815('0x28')],'exitAt':null}});}})['then'](function(_0x1c765f){if(_0x14e015){if(_0x1c765f&&_0x1c765f[_0x2815('0x2f')]){var _0x3f9219=[];_0x1c765f[_0x2815('0x33')](function(_0xca60ec){_0x3f9219['push'](_0xca60ec[_0x2815('0x2d')]({'exitAt':moment()[_0x2815('0x30')](_0x2815('0x31'))}));});return BPromise[_0x2815('0x48')](_0x3f9219);}}})[_0x2815('0x11')](function(){if(_0x14e015){return _0x14e015[_0x2815('0x2d')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x1b0e49){_0x296abb(_0x1b0e49);})[_0x2815('0x26')](function(_0x1baf23){_0x1da2fc(_0x330603[_0x2815('0x17')](0x1f4,_0x1baf23['message']));});});};exports['LoginUser']=function(_0x5bc00e){var _0x1f894b=this;return new Promise(function(_0x3c5c78,_0x18ee78){var _0x4044d3;var _0x1421ff;var _0x5c2721;var _0x332105;return db[_0x2815('0x1c')][_0x2815('0x3d')]({'where':_0x5bc00e['options'][_0x2815('0x20')]||{},'attributes':['id','name','role',_0x2815('0x4b'),_0x2815('0x4c'),_0x2815('0x2a'),'loginInPause',_0x2815('0x2b')]})[_0x2815('0x11')](function(_0x1a3e55){if(_0x1a3e55){_0x4044d3=_0x1a3e55;_0x332105=_0x5bc00e['body'][_0x2815('0x2b')]?_0x5bc00e[_0x2815('0x37')][_0x2815('0x2b')]:util[_0x2815('0x30')](_0x2815('0x35'),_0x4044d3[_0x2815('0x28')]);return db[_0x2815('0x1c')]['count']({'where':{'role':_0x2815('0x4d'),'online':!![],'id':{'$ne':_0x4044d3['id']}}});}})[_0x2815('0x11')](function(_0x4b68e0){if(_0x4b68e0){_0x5c2721=_0x4b68e0;return require(_0x2815('0x4e'))[_0x2815('0x4f')]();}})[_0x2815('0x11')](function(_0x1f301b){if(_0x1f301b&&_0x1f301b[_0x2815('0x50')]&&_0x5c2721>=_0x1f301b[_0x2815('0x50')]){throw new Error(_0x2815('0x51'));}})[_0x2815('0x11')](function(){if(_0x4044d3){return db[_0x2815('0x2c')][_0x2815('0x4a')]({'where':{'membername':_0x4044d3['name']},'individualHooks':!![]});}})[_0x2815('0x11')](function(){if(_0x4044d3){return _0x4044d3[_0x2815('0x52')]({'raw':!![]});}})[_0x2815('0x11')](function(_0x2d8b2c){if(_0x4044d3){if(_0x2d8b2c){var _0x1bbe99=[];_0x1421ff=_0x2d8b2c;if(_0x1421ff[_0x2815('0x2f')]){for(var _0x12c72f=0x0;_0x12c72f<_0x1421ff[_0x2815('0x2f')];_0x12c72f++){_0x1bbe99[_0x2815('0x47')](db['UserVoiceQueueRt'][_0x2815('0x53')]({'membername':_0x4044d3[_0x2815('0x28')],'UserId':_0x4044d3['id'],'queue_name':_0x1421ff[_0x12c72f][_0x2815('0x28')],'VoiceQueueId':_0x1421ff[_0x12c72f]['id'],'interface':_0x332105,'paused':_0x4044d3[_0x2815('0x54')]||![],'penalty':_0x1421ff[_0x12c72f][_0x2815('0x55')]||0x0}));}return BPromise['all'](_0x1bbe99);}}}})['then'](function(){if(_0x4044d3){return db[_0x2815('0x2e')][_0x2815('0x1d')]({'where':{'membername':_0x4044d3['name'],'exitAt':null}});}})[_0x2815('0x11')](function(_0x4f9b1a){if(_0x4044d3){if(_0x4f9b1a&&_0x4f9b1a[_0x2815('0x2f')]){var _0x426ca0=[];_0x4f9b1a['forEach'](function(_0x46cf46){_0x426ca0['push'](_0x46cf46[_0x2815('0x2d')]({'exitAt':moment()[_0x2815('0x30')](_0x2815('0x31'))}));});return BPromise[_0x2815('0x48')](_0x426ca0);}}})[_0x2815('0x11')](function(_0x1421ce){if(_0x4044d3){var _0x430e66=[];var _0x410020=[];var _0x35d652=utils[_0x2815('0x56')]();var _0x6f5770={'membername':_0x4044d3[_0x2815('0x28')],'interface':_0x332105,'enterAt':moment()[_0x2815('0x30')](_0x2815('0x31')),'role':_0x4044d3['role'],'internal':_0x4044d3['internal']};_0x35d652['forEach'](function(_0x8a9e12){_0x430e66[_0x2815('0x47')](_[_0x2815('0x57')]({'channel':_0x8a9e12,'type':_0x2815('0x58'),'data1':_0x2815('0x59'),'data2':_0x332105},_0x6f5770));if(_0x4044d3['loginInPause']){_0x410020[_0x2815('0x47')](_[_0x2815('0x57')]({'channel':_0x8a9e12,'type':_0x2815('0x36'),'data1':_0x2815('0x5a')},_0x6f5770));}});return db[_0x2815('0x2e')][_0x2815('0x3a')](_0x430e66[_0x2815('0x5b')](_0x410020),{'individualHooks':!![]});}})[_0x2815('0x11')](function(){if(_0x4044d3){return _0x4044d3[_0x2815('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x2815('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4044d3[_0x2815('0x54')]||![],'mailPause':_0x4044d3['loginInPause']||![],'chatPause':_0x4044d3['loginInPause']||![],'faxPause':_0x4044d3[_0x2815('0x54')]||![],'smsPause':_0x4044d3['loginInPause']||![],'openchannelPause':_0x4044d3[_0x2815('0x54')]||![],'pauseType':_0x4044d3[_0x2815('0x54')]?_0x2815('0x5a'):null,'lastPauseAt':moment()['format'](_0x2815('0x31')),'interface':_0x332105});}})[_0x2815('0x11')](function(_0x21b462){_0x3c5c78(_0x21b462);})[_0x2815('0x26')](function(_0x4b82c9){_0x18ee78(_0x1f894b['error'](0x1f4,_0x4b82c9['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 9141dd3..5b447da 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 _0x79ac=['user:','save','update','removeListener','register'];(function(_0xe47c5f,_0x6d4ea3){var _0x5cb7ac=function(_0x5dc3ed){while(--_0x5dc3ed){_0xe47c5f['push'](_0xe47c5f['shift']());}};_0x5cb7ac(++_0x6d4ea3);}(_0x79ac,0x11e));var _0xc79a=function(_0x44acb0,_0x34d415){_0x44acb0=_0x44acb0-0x0;var _0x1c6383=_0x79ac[_0x44acb0];return _0x1c6383;};'use strict';var UserEvents=require('./user.events');var events=[_0xc79a('0x0'),'remove',_0xc79a('0x1')];function createListener(_0x51bc8b,_0x114c70){return function(_0x377a5a){_0x114c70['emit'](_0x51bc8b,_0x377a5a);};}function removeListener(_0x542d4a,_0x23f576){return function(){UserEvents[_0xc79a('0x2')](_0x542d4a,_0x23f576);};}exports[_0xc79a('0x3')]=function(_0x4e7c68){for(var _0x542e02=0x0,_0x30b384=events['length'];_0x542e02<_0x30b384;_0x542e02++){var _0x174a28=events[_0x542e02];var _0x473d23=createListener(_0xc79a('0x4')+_0x174a28,_0x4e7c68);UserEvents['on'](_0x174a28,_0x473d23);}}; \ No newline at end of file +var _0x16c2=['length','./user.events','save','remove','update','emit','removeListener','register'];(function(_0x5ccb00,_0x5f5760){var _0x4d068b=function(_0x455b30){while(--_0x455b30){_0x5ccb00['push'](_0x5ccb00['shift']());}};_0x4d068b(++_0x5f5760);}(_0x16c2,0xb9));var _0x216c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16c2[_0x14add3];return _0x4a174f;};'use strict';var UserEvents=require(_0x216c('0x0'));var events=[_0x216c('0x1'),_0x216c('0x2'),_0x216c('0x3')];function createListener(_0x56e52e,_0x517bf8){return function(_0x2448fa){_0x517bf8[_0x216c('0x4')](_0x56e52e,_0x2448fa);};}function removeListener(_0xe2f94b,_0x25a59b){return function(){UserEvents[_0x216c('0x5')](_0xe2f94b,_0x25a59b);};}exports[_0x216c('0x6')]=function(_0x13ef2f){for(var _0x573ebf=0x0,_0x4418d2=events[_0x216c('0x7')];_0x573ebf<_0x4418d2;_0x573ebf++){var _0x31b502=events[_0x573ebf];var _0x1d1a3a=createListener('user:'+_0x31b502,_0x13ef2f);UserEvents['on'](_0x31b502,_0x1d1a3a);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 0d501f4..b059045 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 _0xe9af=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','util','path'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xe9af,0x96));var _0xfe9a=function(_0x376a56,_0x502a2d){_0x376a56=_0x376a56-0x0;var _0x552fca=_0xe9af[_0x376a56];return _0x552fca;};'use strict';var multer=require('multer');var util=require(_0xfe9a('0x0'));var path=require(_0xfe9a('0x1'));var timeout=require(_0xfe9a('0x2'));var express=require(_0xfe9a('0x3'));var router=express[_0xfe9a('0x4')]();var auth=require(_0xfe9a('0x5'));var interaction=require(_0xfe9a('0x6'));var config=require(_0xfe9a('0x7'));module['exports']=router; \ No newline at end of file +var _0x0087=['exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x1430ba,_0x438b68){var _0x58e5d4=function(_0x16f359){while(--_0x16f359){_0x1430ba['push'](_0x1430ba['shift']());}};_0x58e5d4(++_0x438b68);}(_0x0087,0x1ac));var _0x7008=function(_0x2e25cc,_0x447630){_0x2e25cc=_0x2e25cc-0x0;var _0x6e701=_0x0087[_0x2e25cc];return _0x6e701;};'use strict';var multer=require(_0x7008('0x0'));var util=require('util');var path=require(_0x7008('0x1'));var timeout=require(_0x7008('0x2'));var express=require('express');var router=express[_0x7008('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7008('0x4'));var config=require(_0x7008('0x5'));module[_0x7008('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 9676c34..12f37a1 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 _0xd8b0=['exports','sequelize'];(function(_0x537881,_0x3555b0){var _0x19ef90=function(_0x38cbfa){while(--_0x38cbfa){_0x537881['push'](_0x537881['shift']());}};_0x19ef90(++_0x3555b0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x1d4449,_0x495153){var _0x4dcde3=function(_0x36d549){while(--_0x36d549){_0x1d4449['push'](_0x1d4449['shift']());}};_0x4dcde3(++_0x495153);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 6caed4c..5db6543 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 _0xae3f=['request-promise','path','rimraf','../../config/environment','exports','UserChatQueue','user_has_chat_queues','util','api','moment'];(function(_0x2f344f,_0x6be7d1){var _0x55cebd=function(_0x51b168){while(--_0x51b168){_0x2f344f['push'](_0x2f344f['shift']());}};_0x55cebd(++_0x6be7d1);}(_0xae3f,0x115));var _0xfae3=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xae3f[_0x47aa64];return _0x549c7a;};'use strict';var _=require('lodash');var util=require(_0xfae3('0x0'));var logger=require('../../config/logger')(_0xfae3('0x1'));var moment=require(_0xfae3('0x2'));var BPromise=require('bluebird');var rp=require(_0xfae3('0x3'));var fs=require('fs');var path=require(_0xfae3('0x4'));var rimraf=require(_0xfae3('0x5'));var config=require(_0xfae3('0x6'));var attributes=require('./userChatQueue.attributes');module[_0xfae3('0x7')]=function(_0x172278,_0x3dd005){return _0x172278['define'](_0xfae3('0x8'),attributes,{'tableName':_0xfae3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbbc=['./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x43379c,_0x271d36){var _0x495648=function(_0x3f4652){while(--_0x3f4652){_0x43379c['push'](_0x43379c['shift']());}};_0x495648(++_0x271d36);}(_0xfbbc,0x86));var _0xcfbb=function(_0x50a3ed,_0x33477c){_0x50a3ed=_0x50a3ed-0x0;var _0x406a91=_0xfbbc[_0x50a3ed];return _0x406a91;};'use strict';var _=require(_0xcfbb('0x0'));var util=require(_0xcfbb('0x1'));var logger=require(_0xcfbb('0x2'))(_0xcfbb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcfbb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfbb('0x5'));var config=require('../../config/environment');var attributes=require(_0xcfbb('0x6'));module[_0xcfbb('0x7')]=function(_0x496729,_0x2755b3){return _0x496729['define'](_0xcfbb('0x8'),attributes,{'tableName':_0xcfbb('0x9'),'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 12d8bf5..ba4dbc1 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 _0xd459=['stringify','error','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3510f0,_0x5fd4d8){var _0x344104=function(_0x4b1cb9){while(--_0x4b1cb9){_0x3510f0['push'](_0x3510f0['shift']());}};_0x344104(++_0x5fd4d8);}(_0xd459,0xa6));var _0x9d45=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xd459[_0x373dee];return _0x46798f;};'use strict';var _=require('lodash');var util=require(_0x9d45('0x0'));var moment=require(_0x9d45('0x1'));var BPromise=require(_0x9d45('0x2'));var rs=require(_0x9d45('0x3'));var fs=require('fs');var Redis=require(_0x9d45('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9d45('0x5'))('rpc');var config=require(_0x9d45('0x6'));var jayson=require(_0x9d45('0x7'));var client=jayson[_0x9d45('0x8')][_0x9d45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fae63,_0x44be0b,_0x780ca7){return new BPromise(function(_0x312e5e,_0x287065){return client['request'](_0x1fae63,_0x780ca7)[_0x9d45('0xa')](function(_0x283ca6){logger[_0x9d45('0xb')](_0x9d45('0xc'),_0x44be0b,'request\x20sent');logger['debug'](_0x9d45('0xd'),_0x44be0b,'request\x20sent',JSON[_0x9d45('0xe')](_0x283ca6));if(_0x283ca6[_0x9d45('0xf')]){if(_0x283ca6['error']['code']===0x1f4){logger[_0x9d45('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x44be0b,_0x283ca6[_0x9d45('0xf')]['message']);return _0x287065(_0x283ca6[_0x9d45('0xf')][_0x9d45('0x10')]);}logger[_0x9d45('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x44be0b,_0x283ca6[_0x9d45('0xf')][_0x9d45('0x10')]);return _0x312e5e(_0x283ca6[_0x9d45('0xf')][_0x9d45('0x10')]);}else{logger[_0x9d45('0xb')](_0x9d45('0xc'),_0x44be0b,_0x9d45('0x11'));_0x312e5e(_0x283ca6[_0x9d45('0x12')][_0x9d45('0x10')]);}})[_0x9d45('0x13')](function(_0x37de08){logger['error'](_0x9d45('0xc'),_0x44be0b,_0x37de08);_0x287065(_0x37de08);});});} \ No newline at end of file +var _0xf918=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s'];(function(_0x3a83c8,_0x489ffd){var _0x5c89db=function(_0x35a94a){while(--_0x35a94a){_0x3a83c8['push'](_0x3a83c8['shift']());}};_0x5c89db(++_0x489ffd);}(_0xf918,0x13b));var _0x8f91=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0xf918[_0x1a8bbc];return _0x212fc2;};'use strict';var _=require('lodash');var util=require(_0x8f91('0x0'));var moment=require(_0x8f91('0x1'));var BPromise=require(_0x8f91('0x2'));var rs=require(_0x8f91('0x3'));var fs=require('fs');var Redis=require(_0x8f91('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f91('0x5'));var logger=require(_0x8f91('0x6'))('rpc');var config=require(_0x8f91('0x7'));var jayson=require(_0x8f91('0x8'));var client=jayson[_0x8f91('0x9')][_0x8f91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x152a18,_0x4f44aa,_0x2c5521){return new BPromise(function(_0x4e4b18,_0x33672e){return client[_0x8f91('0xb')](_0x152a18,_0x2c5521)[_0x8f91('0xc')](function(_0x1dae9c){logger[_0x8f91('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x4f44aa,_0x8f91('0xe'));logger[_0x8f91('0xf')](_0x8f91('0x10'),_0x4f44aa,_0x8f91('0xe'),JSON[_0x8f91('0x11')](_0x1dae9c));if(_0x1dae9c[_0x8f91('0x12')]){if(_0x1dae9c['error'][_0x8f91('0x13')]===0x1f4){logger['error'](_0x8f91('0x14'),_0x4f44aa,_0x1dae9c[_0x8f91('0x12')][_0x8f91('0x15')]);return _0x33672e(_0x1dae9c[_0x8f91('0x12')][_0x8f91('0x15')]);}logger['error'](_0x8f91('0x14'),_0x4f44aa,_0x1dae9c['error']['message']);return _0x4e4b18(_0x1dae9c[_0x8f91('0x12')][_0x8f91('0x15')]);}else{logger[_0x8f91('0xd')](_0x8f91('0x14'),_0x4f44aa,_0x8f91('0xe'));_0x4e4b18(_0x1dae9c[_0x8f91('0x16')]['message']);}})[_0x8f91('0x17')](function(_0x270699){logger[_0x8f91('0x12')](_0x8f91('0x14'),_0x4f44aa,_0x270699);_0x33672e(_0x270699);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 0b8acf4..face551 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 _0x089a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','path','connect-timeout'];(function(_0x178d36,_0x488189){var _0x1b4d06=function(_0xf0cce){while(--_0xf0cce){_0x178d36['push'](_0x178d36['shift']());}};_0x1b4d06(++_0x488189);}(_0x089a,0xb5));var _0xa089=function(_0x3ee539,_0x354239){_0x3ee539=_0x3ee539-0x0;var _0x2d72ed=_0x089a[_0x3ee539];return _0x2d72ed;};'use strict';var multer=require(_0xa089('0x0'));var util=require('util');var path=require(_0xa089('0x1'));var timeout=require(_0xa089('0x2'));var express=require(_0xa089('0x3'));var router=express[_0xa089('0x4')]();var auth=require(_0xa089('0x5'));var interaction=require(_0xa089('0x6'));var config=require(_0xa089('0x7'));module['exports']=router; \ No newline at end of file +var _0x1979=['exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x53ec90,_0x51852b){var _0x52fdf2=function(_0x53f01e){while(--_0x53f01e){_0x53ec90['push'](_0x53ec90['shift']());}};_0x52fdf2(++_0x51852b);}(_0x1979,0x8b));var _0x9197=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x1979[_0x10df18];return _0x1f9a1d;};'use strict';var multer=require(_0x9197('0x0'));var util=require('util');var path=require(_0x9197('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x9197('0x2'));var interaction=require(_0x9197('0x3'));var config=require(_0x9197('0x4'));module[_0x9197('0x5')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 2680d59..72621f9 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 _0x7916=['sequelize','INTEGER'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0x7916,0x128));var _0x6791=function(_0xb216e9,_0x59e322){_0xb216e9=_0xb216e9-0x0;var _0x4573e7=_0x7916[_0xb216e9];return _0x4573e7;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6791('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6791('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd4a2=['INTEGER','sequelize'];(function(_0x16c794,_0x55524d){var _0x7c4211=function(_0x543140){while(--_0x543140){_0x16c794['push'](_0x16c794['shift']());}};_0x7c4211(++_0x55524d);}(_0xd4a2,0x173));var _0x2d4a=function(_0x2c4436,_0x1dc861){_0x2c4436=_0x2c4436-0x0;var _0x10ab62=_0xd4a2[_0x2c4436];return _0x10ab62;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2d4a('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 94053ee..8c72d01 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 _0xffaf=['exports','define','UserFaxQueue','../../config/logger','api','request-promise','path','rimraf'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xffaf,0x1c3));var _0xfffa=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0xffaf[_0x4d45c1];return _0x244478;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfffa('0x0'))(_0xfffa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfffa('0x2'));var fs=require('fs');var path=require(_0xfffa('0x3'));var rimraf=require(_0xfffa('0x4'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0xfffa('0x5')]=function(_0x4d1698,_0x5b8340){return _0x4d1698[_0xfffa('0x6')](_0xfffa('0x7'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb1=['./userFaxQueue.attributes','exports','define','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xe2a8bf,_0x36f6e4){var _0x34b028=function(_0x577e1d){while(--_0x577e1d){_0xe2a8bf['push'](_0xe2a8bf['shift']());}};_0x34b028(++_0x36f6e4);}(_0x5eb1,0x7c));var _0x15eb=function(_0x33f31b,_0x550ae9){_0x33f31b=_0x33f31b-0x0;var _0x33514e=_0x5eb1[_0x33f31b];return _0x33514e;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var logger=require(_0x15eb('0x1'))(_0x15eb('0x2'));var moment=require(_0x15eb('0x3'));var BPromise=require(_0x15eb('0x4'));var rp=require(_0x15eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15eb('0x6'));var config=require(_0x15eb('0x7'));var attributes=require(_0x15eb('0x8'));module[_0x15eb('0x9')]=function(_0x47e341,_0x1be042){return _0x47e341[_0x15eb('0xa')]('UserFaxQueue',attributes,{'tableName':_0x15eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 1e75361..9224c5f 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 _0x383b=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x383b,0x89));var _0xb383=function(_0x36b87d,_0x55371d){_0x36b87d=_0x36b87d-0x0;var _0x2e22d4=_0x383b[_0x36b87d];return _0x2e22d4;};'use strict';var _=require(_0xb383('0x0'));var util=require('util');var moment=require(_0xb383('0x1'));var BPromise=require(_0xb383('0x2'));var rs=require(_0xb383('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb383('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb383('0x5'))(_0xb383('0x6'));var config=require(_0xb383('0x7'));var jayson=require(_0xb383('0x8'));var client=jayson[_0xb383('0x9')][_0xb383('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ee0de,_0x6b4bdd,_0x441967){return new BPromise(function(_0x14c47c,_0x510487){return client['request'](_0x5ee0de,_0x441967)[_0xb383('0xb')](function(_0x236a19){logger[_0xb383('0xc')](_0xb383('0xd'),_0x6b4bdd,'request\x20sent');logger[_0xb383('0xe')](_0xb383('0xf'),_0x6b4bdd,_0xb383('0x10'),JSON[_0xb383('0x11')](_0x236a19));if(_0x236a19[_0xb383('0x12')]){if(_0x236a19['error'][_0xb383('0x13')]===0x1f4){logger[_0xb383('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x6b4bdd,_0x236a19[_0xb383('0x12')][_0xb383('0x14')]);return _0x510487(_0x236a19[_0xb383('0x12')][_0xb383('0x14')]);}logger[_0xb383('0x12')](_0xb383('0xd'),_0x6b4bdd,_0x236a19[_0xb383('0x12')][_0xb383('0x14')]);return _0x14c47c(_0x236a19[_0xb383('0x12')][_0xb383('0x14')]);}else{logger[_0xb383('0xc')](_0xb383('0xd'),_0x6b4bdd,'request\x20sent');_0x14c47c(_0x236a19[_0xb383('0x15')][_0xb383('0x14')]);}})[_0xb383('0x16')](function(_0x4b902b){logger[_0xb383('0x12')](_0xb383('0xd'),_0x6b4bdd,_0x4b902b);_0x510487(_0x4b902b);});});} \ No newline at end of file +var _0xaf37=['jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x342e63,_0x1884ac){var _0x78ca1b=function(_0x59eede){while(--_0x59eede){_0x342e63['push'](_0x342e63['shift']());}};_0x78ca1b(++_0x1884ac);}(_0xaf37,0xa1));var _0x7af3=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xaf37[_0x4914e2];return _0x2dcd07;};'use strict';var _=require('lodash');var util=require(_0x7af3('0x0'));var moment=require(_0x7af3('0x1'));var BPromise=require(_0x7af3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7af3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7af3('0x4'));var logger=require('../../config/logger')(_0x7af3('0x5'));var config=require(_0x7af3('0x6'));var jayson=require(_0x7af3('0x7'));var client=jayson['client'][_0x7af3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x464a3d,_0x105d8c,_0xa79f6){return new BPromise(function(_0x666ed2,_0x105453){return client[_0x7af3('0x9')](_0x464a3d,_0xa79f6)[_0x7af3('0xa')](function(_0x12f388){logger[_0x7af3('0xb')](_0x7af3('0xc'),_0x105d8c,_0x7af3('0xd'));logger[_0x7af3('0xe')](_0x7af3('0xf'),_0x105d8c,_0x7af3('0xd'),JSON[_0x7af3('0x10')](_0x12f388));if(_0x12f388[_0x7af3('0x11')]){if(_0x12f388['error'][_0x7af3('0x12')]===0x1f4){logger[_0x7af3('0x11')](_0x7af3('0xc'),_0x105d8c,_0x12f388[_0x7af3('0x11')]['message']);return _0x105453(_0x12f388[_0x7af3('0x11')][_0x7af3('0x13')]);}logger[_0x7af3('0x11')](_0x7af3('0xc'),_0x105d8c,_0x12f388['error'][_0x7af3('0x13')]);return _0x666ed2(_0x12f388[_0x7af3('0x11')]['message']);}else{logger[_0x7af3('0xb')](_0x7af3('0xc'),_0x105d8c,_0x7af3('0xd'));_0x666ed2(_0x12f388[_0x7af3('0x14')][_0x7af3('0x13')]);}})['catch'](function(_0x2ba09e){logger[_0x7af3('0x11')](_0x7af3('0xc'),_0x105d8c,_0x2ba09e);_0x105453(_0x2ba09e);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2d255f4..227a338 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 _0xbd1d=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x235ba6,_0x315773){var _0x2aa7c4=function(_0x4d7040){while(--_0x4d7040){_0x235ba6['push'](_0x235ba6['shift']());}};_0x2aa7c4(++_0x315773);}(_0xbd1d,0x1d8));var _0xdbd1=function(_0x5ab7c8,_0x19b852){_0x5ab7c8=_0x5ab7c8-0x0;var _0x2884ea=_0xbd1d[_0x5ab7c8];return _0x2884ea;};'use strict';var multer=require(_0xdbd1('0x0'));var util=require(_0xdbd1('0x1'));var path=require('path');var timeout=require(_0xdbd1('0x2'));var express=require(_0xdbd1('0x3'));var router=express[_0xdbd1('0x4')]();var auth=require(_0xdbd1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdbd1('0x6'));module[_0xdbd1('0x7')]=router; \ No newline at end of file +var _0xbed9=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5e6332,_0x4ad1cc){var _0x38f82c=function(_0x16fed8){while(--_0x16fed8){_0x5e6332['push'](_0x5e6332['shift']());}};_0x38f82c(++_0x4ad1cc);}(_0xbed9,0x106));var _0x9bed=function(_0x411b00,_0x56f7dc){_0x411b00=_0x411b00-0x0;var _0x5c9867=_0xbed9[_0x411b00];return _0x5c9867;};'use strict';var multer=require(_0x9bed('0x0'));var util=require(_0x9bed('0x1'));var path=require(_0x9bed('0x2'));var timeout=require(_0x9bed('0x3'));var express=require(_0x9bed('0x4'));var router=express[_0x9bed('0x5')]();var auth=require(_0x9bed('0x6'));var interaction=require(_0x9bed('0x7'));var config=require('../../config/environment');module[_0x9bed('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 2702f74..045aa57 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 _0xb10b=['sequelize','INTEGER'];(function(_0x32de9c,_0x5cbf90){var _0x5c59f9=function(_0x3130ec){while(--_0x3130ec){_0x32de9c['push'](_0x32de9c['shift']());}};_0x5c59f9(++_0x5cbf90);}(_0xb10b,0x12a));var _0xbb10=function(_0x32e919,_0x4fd27c){_0x32e919=_0x32e919-0x0;var _0x2fc4cb=_0xb10b[_0x32e919];return _0x2fc4cb;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x145d14,_0x2f6f5d){var _0x1c14cd=function(_0x306204){while(--_0x306204){_0x145d14['push'](_0x145d14['shift']());}};_0x1c14cd(++_0x2f6f5d);}(_0xe706,0xa3));var _0x6e70=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0xe706[_0x14a0a0];return _0x56b651;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 8be6af7..085cd77 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 _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x28cb35,_0x28592b){var _0x528465=function(_0x509310){while(--_0x509310){_0x28cb35['push'](_0x28cb35['shift']());}};_0x528465(++_0x28592b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1d75de,_0x12c5d9){var _0x1f3427=function(_0xa9f538){while(--_0xa9f538){_0x1d75de['push'](_0x1d75de['shift']());}};_0x1f3427(++_0x12c5d9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 1cca183..3df66a4 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 _0x29e0=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x142a4b,_0x1d6f86){var _0x2ced82=function(_0x28e619){while(--_0x28e619){_0x142a4b['push'](_0x142a4b['shift']());}};_0x2ced82(++_0x1d6f86);}(_0x29e0,0x1c8));var _0x029e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x029e('0x0'));var util=require(_0x029e('0x1'));var moment=require(_0x029e('0x2'));var BPromise=require(_0x029e('0x3'));var rs=require(_0x029e('0x4'));var fs=require('fs');var Redis=require(_0x029e('0x5'));var db=require(_0x029e('0x6'))['db'];var utils=require(_0x029e('0x7'));var logger=require(_0x029e('0x8'))(_0x029e('0x9'));var config=require(_0x029e('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x029e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3571ef,_0x2a096d,_0x54cfb2){return new BPromise(function(_0x21484b,_0x4fa4d4){return client[_0x029e('0xc')](_0x3571ef,_0x54cfb2)[_0x029e('0xd')](function(_0x42a960){logger[_0x029e('0xe')](_0x029e('0xf'),_0x2a096d,_0x029e('0x10'));logger['debug'](_0x029e('0x11'),_0x2a096d,_0x029e('0x10'),JSON[_0x029e('0x12')](_0x42a960));if(_0x42a960[_0x029e('0x13')]){if(_0x42a960['error'][_0x029e('0x14')]===0x1f4){logger[_0x029e('0x13')](_0x029e('0xf'),_0x2a096d,_0x42a960[_0x029e('0x13')][_0x029e('0x15')]);return _0x4fa4d4(_0x42a960[_0x029e('0x13')][_0x029e('0x15')]);}logger[_0x029e('0x13')](_0x029e('0xf'),_0x2a096d,_0x42a960['error'][_0x029e('0x15')]);return _0x21484b(_0x42a960['error'][_0x029e('0x15')]);}else{logger[_0x029e('0xe')](_0x029e('0xf'),_0x2a096d,_0x029e('0x10'));_0x21484b(_0x42a960[_0x029e('0x16')][_0x029e('0x15')]);}})[_0x029e('0x17')](function(_0x50e658){logger['error'](_0x029e('0xf'),_0x2a096d,_0x50e658);_0x4fa4d4(_0x50e658);});});} \ No newline at end of file +var _0xed5f=['message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0xed5f,0x1e6));var _0xfed5=function(_0x40ee48,_0xee93b8){_0x40ee48=_0x40ee48-0x0;var _0x18c595=_0xed5f[_0x40ee48];return _0x18c595;};'use strict';var _=require('lodash');var util=require(_0xfed5('0x0'));var moment=require(_0xfed5('0x1'));var BPromise=require(_0xfed5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfed5('0x3'));var db=require(_0xfed5('0x4'))['db'];var utils=require(_0xfed5('0x5'));var logger=require(_0xfed5('0x6'))('rpc');var config=require(_0xfed5('0x7'));var jayson=require(_0xfed5('0x8'));var client=jayson[_0xfed5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2128e,_0x103d3b,_0x55f533){return new BPromise(function(_0x299fb6,_0x4422e5){return client[_0xfed5('0xa')](_0x2128e,_0x55f533)[_0xfed5('0xb')](function(_0x38b02a){logger[_0xfed5('0xc')](_0xfed5('0xd'),_0x103d3b,_0xfed5('0xe'));logger[_0xfed5('0xf')](_0xfed5('0x10'),_0x103d3b,_0xfed5('0xe'),JSON[_0xfed5('0x11')](_0x38b02a));if(_0x38b02a['error']){if(_0x38b02a[_0xfed5('0x12')][_0xfed5('0x13')]===0x1f4){logger[_0xfed5('0x12')](_0xfed5('0xd'),_0x103d3b,_0x38b02a['error'][_0xfed5('0x14')]);return _0x4422e5(_0x38b02a[_0xfed5('0x12')]['message']);}logger[_0xfed5('0x12')](_0xfed5('0xd'),_0x103d3b,_0x38b02a[_0xfed5('0x12')][_0xfed5('0x14')]);return _0x299fb6(_0x38b02a[_0xfed5('0x12')]['message']);}else{logger[_0xfed5('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x103d3b,_0xfed5('0xe'));_0x299fb6(_0x38b02a['result'][_0xfed5('0x14')]);}})[_0xfed5('0x15')](function(_0x2a269f){logger[_0xfed5('0x12')](_0xfed5('0xd'),_0x103d3b,_0x2a269f);_0x4422e5(_0x2a269f);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index b2c8281..2b40969 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 _0x4075=['path','express','Router','../../components/interaction/service','../../config/environment','exports','util'];(function(_0x5543a6,_0x37d647){var _0x5e6ba9=function(_0x26468a){while(--_0x26468a){_0x5543a6['push'](_0x5543a6['shift']());}};_0x5e6ba9(++_0x37d647);}(_0x4075,0x1a3));var _0x5407=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x4075[_0x5db99b];return _0x4b2d0e;};'use strict';var multer=require('multer');var util=require(_0x5407('0x0'));var path=require(_0x5407('0x1'));var timeout=require('connect-timeout');var express=require(_0x5407('0x2'));var router=express[_0x5407('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5407('0x4'));var config=require(_0x5407('0x5'));module[_0x5407('0x6')]=router; \ No newline at end of file +var _0x517e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x2ef7b2,_0x12bf5f){var _0x53e903=function(_0x71940a){while(--_0x71940a){_0x2ef7b2['push'](_0x2ef7b2['shift']());}};_0x53e903(++_0x12bf5f);}(_0x517e,0x150));var _0xe517=function(_0x24ec6f,_0x1de736){_0x24ec6f=_0x24ec6f-0x0;var _0x2b3d05=_0x517e[_0x24ec6f];return _0x2b3d05;};'use strict';var multer=require(_0xe517('0x0'));var util=require(_0xe517('0x1'));var path=require(_0xe517('0x2'));var timeout=require(_0xe517('0x3'));var express=require(_0xe517('0x4'));var router=express[_0xe517('0x5')]();var auth=require(_0xe517('0x6'));var interaction=require(_0xe517('0x7'));var config=require(_0xe517('0x8'));module[_0xe517('0x9')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index a94f6c2..c19cabd 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x2e2d97,_0x1ee54e){var _0x2d78a4=function(_0x329d68){while(--_0x329d68){_0x2e2d97['push'](_0x2e2d97['shift']());}};_0x2d78a4(++_0x1ee54e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x4ccc,_0x1132af){var _0x52af63=function(_0x112184){while(--_0x112184){_0x4ccc['push'](_0x4ccc['shift']());}};_0x52af63(++_0x1132af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index e493765..d900ace 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 _0x30d2=['path','rimraf','../../config/environment','exports','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x180c9b,_0x13d173){var _0x3ff116=function(_0x241982){while(--_0x241982){_0x180c9b['push'](_0x180c9b['shift']());}};_0x3ff116(++_0x13d173);}(_0x30d2,0x187));var _0x230d=function(_0x1f4b18,_0x4e777c){_0x1f4b18=_0x1f4b18-0x0;var _0xde3957=_0x30d2[_0x1f4b18];return _0xde3957;};'use strict';var _=require('lodash');var util=require(_0x230d('0x0'));var logger=require(_0x230d('0x1'))(_0x230d('0x2'));var moment=require(_0x230d('0x3'));var BPromise=require('bluebird');var rp=require(_0x230d('0x4'));var fs=require('fs');var path=require(_0x230d('0x5'));var rimraf=require(_0x230d('0x6'));var config=require(_0x230d('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x230d('0x8')]=function(_0x55183c,_0x2f0858){return _0x55183c['define'](_0x230d('0x9'),attributes,{'tableName':_0x230d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa07d=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x45acdb,_0x220bf2){var _0x3bbadd=function(_0x2a7903){while(--_0x2a7903){_0x45acdb['push'](_0x45acdb['shift']());}};_0x3bbadd(++_0x220bf2);}(_0xa07d,0xbd));var _0xda07=function(_0x4cefbc,_0x3ffa6c){_0x4cefbc=_0x4cefbc-0x0;var _0x423c86=_0xa07d[_0x4cefbc];return _0x423c86;};'use strict';var _=require(_0xda07('0x0'));var util=require(_0xda07('0x1'));var logger=require(_0xda07('0x2'))(_0xda07('0x3'));var moment=require('moment');var BPromise=require(_0xda07('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xda07('0x5'));var config=require(_0xda07('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xda07('0x7')]=function(_0x176e3c,_0x35b597){return _0x176e3c[_0xda07('0x8')](_0xda07('0x9'),attributes,{'tableName':_0xda07('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index cda65bf..1e22725 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 _0xfe24=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x107616,_0x4c4c91){var _0x48079e=function(_0x52cd51){while(--_0x52cd51){_0x107616['push'](_0x107616['shift']());}};_0x48079e(++_0x4c4c91);}(_0xfe24,0xc2));var _0x4fe2=function(_0x3752b8,_0x54cf09){_0x3752b8=_0x3752b8-0x0;var _0xcf292=_0xfe24[_0x3752b8];return _0xcf292;};'use strict';var _=require(_0x4fe2('0x0'));var util=require('util');var moment=require(_0x4fe2('0x1'));var BPromise=require(_0x4fe2('0x2'));var rs=require(_0x4fe2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4fe2('0x4'));var logger=require(_0x4fe2('0x5'))(_0x4fe2('0x6'));var config=require(_0x4fe2('0x7'));var jayson=require(_0x4fe2('0x8'));var client=jayson[_0x4fe2('0x9')][_0x4fe2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x502a53,_0x2b1d69,_0x5e32ee){return new BPromise(function(_0x3f8d1d,_0x3154c4){return client[_0x4fe2('0xb')](_0x502a53,_0x5e32ee)[_0x4fe2('0xc')](function(_0x44b21d){logger[_0x4fe2('0xd')](_0x4fe2('0xe'),_0x2b1d69,_0x4fe2('0xf'));logger[_0x4fe2('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2b1d69,'request\x20sent',JSON[_0x4fe2('0x11')](_0x44b21d));if(_0x44b21d['error']){if(_0x44b21d[_0x4fe2('0x12')][_0x4fe2('0x13')]===0x1f4){logger[_0x4fe2('0x12')](_0x4fe2('0xe'),_0x2b1d69,_0x44b21d[_0x4fe2('0x12')][_0x4fe2('0x14')]);return _0x3154c4(_0x44b21d[_0x4fe2('0x12')]['message']);}logger[_0x4fe2('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2b1d69,_0x44b21d[_0x4fe2('0x12')]['message']);return _0x3f8d1d(_0x44b21d[_0x4fe2('0x12')]['message']);}else{logger[_0x4fe2('0xd')](_0x4fe2('0xe'),_0x2b1d69,_0x4fe2('0xf'));_0x3f8d1d(_0x44b21d[_0x4fe2('0x15')]['message']);}})[_0x4fe2('0x16')](function(_0x1209a3){logger[_0x4fe2('0x12')](_0x4fe2('0xe'),_0x2b1d69,_0x1209a3);_0x3154c4(_0x1209a3);});});} \ No newline at end of file +var _0xa3bd=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0x667081,_0x1d02b8){var _0x1c1e88=function(_0x4231c2){while(--_0x4231c2){_0x667081['push'](_0x667081['shift']());}};_0x1c1e88(++_0x1d02b8);}(_0xa3bd,0x1d4));var _0xda3b=function(_0x31ff3f,_0x2153cb){_0x31ff3f=_0x31ff3f-0x0;var _0x2b2f98=_0xa3bd[_0x31ff3f];return _0x2b2f98;};'use strict';var _=require(_0xda3b('0x0'));var util=require('util');var moment=require(_0xda3b('0x1'));var BPromise=require(_0xda3b('0x2'));var rs=require(_0xda3b('0x3'));var fs=require('fs');var Redis=require(_0xda3b('0x4'));var db=require(_0xda3b('0x5'))['db'];var utils=require(_0xda3b('0x6'));var logger=require(_0xda3b('0x7'))(_0xda3b('0x8'));var config=require(_0xda3b('0x9'));var jayson=require(_0xda3b('0xa'));var client=jayson['client'][_0xda3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e537b,_0x58bc21,_0x411480){return new BPromise(function(_0x48e4d5,_0x640e6){return client['request'](_0x3e537b,_0x411480)[_0xda3b('0xc')](function(_0x43ae4e){logger[_0xda3b('0xd')](_0xda3b('0xe'),_0x58bc21,_0xda3b('0xf'));logger[_0xda3b('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x58bc21,_0xda3b('0xf'),JSON[_0xda3b('0x11')](_0x43ae4e));if(_0x43ae4e[_0xda3b('0x12')]){if(_0x43ae4e['error'][_0xda3b('0x13')]===0x1f4){logger['error'](_0xda3b('0xe'),_0x58bc21,_0x43ae4e['error']['message']);return _0x640e6(_0x43ae4e[_0xda3b('0x12')][_0xda3b('0x14')]);}logger[_0xda3b('0x12')](_0xda3b('0xe'),_0x58bc21,_0x43ae4e['error'][_0xda3b('0x14')]);return _0x48e4d5(_0x43ae4e[_0xda3b('0x12')][_0xda3b('0x14')]);}else{logger[_0xda3b('0xd')](_0xda3b('0xe'),_0x58bc21,_0xda3b('0xf'));_0x48e4d5(_0x43ae4e[_0xda3b('0x15')]['message']);}})[_0xda3b('0x16')](function(_0x10a395){logger[_0xda3b('0x12')](_0xda3b('0xe'),_0x58bc21,_0x10a395);_0x640e6(_0x10a395);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 1ff1227..9e5db6b 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 _0x826b=['get','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','update','delete','destroy','removeResources','exports','multer','util','path','connect-timeout','express','./userProfile.controller','isAuthenticated'];(function(_0x3a5f8c,_0x10f56e){var _0x2e78c9=function(_0x339e80){while(--_0x339e80){_0x3a5f8c['push'](_0x3a5f8c['shift']());}};_0x2e78c9(++_0x10f56e);}(_0x826b,0x131));var _0xb826=function(_0x3e558a,_0x52fd19){_0x3e558a=_0x3e558a-0x0;var _0x2d590f=_0x826b[_0x3e558a];return _0x2d590f;};'use strict';var multer=require(_0xb826('0x0'));var util=require(_0xb826('0x1'));var path=require(_0xb826('0x2'));var timeout=require(_0xb826('0x3'));var express=require(_0xb826('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb826('0x5'));router['get']('/',auth[_0xb826('0x6')](),controller['index']);router[_0xb826('0x7')](_0xb826('0x8'),auth['isAuthenticated'](),controller[_0xb826('0x9')]);router[_0xb826('0x7')](_0xb826('0xa'),auth[_0xb826('0x6')](),controller[_0xb826('0xb')]);router[_0xb826('0x7')](_0xb826('0xc'),auth[_0xb826('0x6')](),controller[_0xb826('0xd')]);router['get'](_0xb826('0xe'),auth['isAuthenticated'](),controller[_0xb826('0xf')]);router[_0xb826('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb826('0x10')](_0xb826('0x11'),auth[_0xb826('0x6')](),controller[_0xb826('0x12')]);router[_0xb826('0x10')](_0xb826('0xc'),auth[_0xb826('0x6')](),controller[_0xb826('0x13')]);router['post'](_0xb826('0xe'),auth[_0xb826('0x6')](),controller[_0xb826('0x14')]);router['put'](_0xb826('0xa'),auth[_0xb826('0x6')](),controller[_0xb826('0x15')]);router[_0xb826('0x16')](_0xb826('0xa'),auth['isAuthenticated'](),controller[_0xb826('0x17')]);router[_0xb826('0x16')](_0xb826('0xc'),auth['isAuthenticated'](),controller['removeSections']);router[_0xb826('0x16')](_0xb826('0xe'),auth['isAuthenticated'](),controller[_0xb826('0x18')]);module[_0xb826('0x19')]=router; \ No newline at end of file +var _0x0196=['show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','/:id','delete','destroy','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x5c7cfa,_0xa4f76c){var _0x248936=function(_0x4328bf){while(--_0x4328bf){_0x5c7cfa['push'](_0x5c7cfa['shift']());}};_0x248936(++_0xa4f76c);}(_0x0196,0x6c));var _0x6019=function(_0xe1cce7,_0x183181){_0xe1cce7=_0xe1cce7-0x0;var _0x1b9195=_0x0196[_0xe1cce7];return _0x1b9195;};'use strict';var multer=require(_0x6019('0x0'));var util=require(_0x6019('0x1'));var path=require('path');var timeout=require(_0x6019('0x2'));var express=require(_0x6019('0x3'));var router=express[_0x6019('0x4')]();var auth=require(_0x6019('0x5'));var interaction=require(_0x6019('0x6'));var config=require(_0x6019('0x7'));var controller=require('./userProfile.controller');router[_0x6019('0x8')]('/',auth[_0x6019('0x9')](),controller[_0x6019('0xa')]);router[_0x6019('0x8')]('/describe',auth[_0x6019('0x9')](),controller[_0x6019('0xb')]);router[_0x6019('0x8')]('/:id',auth[_0x6019('0x9')](),controller[_0x6019('0xc')]);router[_0x6019('0x8')](_0x6019('0xd'),auth[_0x6019('0x9')](),controller[_0x6019('0xe')]);router['get'](_0x6019('0xf'),auth[_0x6019('0x9')](),controller[_0x6019('0x10')]);router[_0x6019('0x11')]('/',auth[_0x6019('0x9')](),controller[_0x6019('0x12')]);router[_0x6019('0x11')](_0x6019('0x13'),auth['isAuthenticated'](),controller[_0x6019('0x14')]);router[_0x6019('0x11')](_0x6019('0xd'),auth[_0x6019('0x9')](),controller[_0x6019('0x15')]);router['post'](_0x6019('0xf'),auth['isAuthenticated'](),controller[_0x6019('0x16')]);router[_0x6019('0x17')](_0x6019('0x18'),auth[_0x6019('0x9')](),controller['update']);router[_0x6019('0x19')]('/:id',auth[_0x6019('0x9')](),controller[_0x6019('0x1a')]);router[_0x6019('0x19')](_0x6019('0xd'),auth[_0x6019('0x9')](),controller[_0x6019('0x1b')]);router['delete'](_0x6019('0xf'),auth[_0x6019('0x9')](),controller[_0x6019('0x1c')]);module[_0x6019('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index da6c33c..e50106c 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 _0x5f2a=['sequelize','exports','STRING','name','crudPermissions','join','getDataValue'];(function(_0x537c6f,_0x5d7d20){var _0x57c10b=function(_0x309aed){while(--_0x309aed){_0x537c6f['push'](_0x537c6f['shift']());}};_0x57c10b(++_0x5d7d20);}(_0x5f2a,0x19d));var _0xa5f2=function(_0x479927,_0x1c163a){_0x479927=_0x479927-0x0;var _0x4d66b7=_0x5f2a[_0x479927];return _0x4d66b7;};'use strict';var Sequelize=require(_0xa5f2('0x0'));module[_0xa5f2('0x1')]={'name':{'type':Sequelize[_0xa5f2('0x2')],'allowNull':![],'unique':_0xa5f2('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3f4155){this['setDataValue'](_0xa5f2('0x4'),_0x3f4155?_0x3f4155[_0xa5f2('0x5')](''):[]);},'get':function(){return this[_0xa5f2('0x6')]('crudPermissions')?this[_0xa5f2('0x6')](_0xa5f2('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa5f2('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x72c9=['setDataValue','crudPermissions','join','split','sequelize','exports','name','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x72c9,0xcc));var _0x972c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72c9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x972c('0x0'));module[_0x972c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x972c('0x2')},'crudPermissions':{'type':Sequelize[_0x972c('0x3')],'set':function(_0x5a9080){this[_0x972c('0x4')](_0x972c('0x5'),_0x5a9080?_0x5a9080[_0x972c('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x972c('0x5'))?this['getDataValue']('crudPermissions')[_0x972c('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index eb09e40..726267d 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 _0xf963=['mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./userProfile.socket','register','status','end','count','offset','limit','set','json','apply','reject','save','update','destroy','then','stack','name','index','map','UserProfile','rawAttributes','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','merge','type','includeAll','include','findAll','rows','catch','show','params','find','create','body','clone','options','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','Resources','describe','addSections','userProfileId','each','push','ids','getSections','filter','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','section','undefined','ValidationError','Unknown\x20section','childModel','Sequelize','Invalid\x20section\x20\x27','parentSections','all','ignore','sort','field','AnalyticExtractedReport','associatedResources','foreignKey','reportType','default','DefaultReports','custom','reportId','CustomReports','CmContact','Tag','Tags','color','tag','toLowerCase','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareProjects','projects','JscriptyProject','Lists','ListId','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','freshdeskaccounts','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Interval','Pause','scheduler','Schedule','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x15f4ee,_0x36e526){var _0x425606=function(_0x525af0){while(--_0x525af0){_0x15f4ee['push'](_0x15f4ee['shift']());}};_0x425606(++_0x36e526);}(_0xf963,0x1c8));var _0x3f96=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf963[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x3f96('0x0'));var emlformat=require(_0x3f96('0x1'));var rimraf=require(_0x3f96('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f96('0x3'));var rp=require(_0x3f96('0x4'));var moment=require('moment');var BPromise=require(_0x3f96('0x5'));var Mustache=require(_0x3f96('0x6'));var util=require(_0x3f96('0x7'));var path=require('path');var sox=require(_0x3f96('0x8'));var csv=require(_0x3f96('0x9'));var ejs=require(_0x3f96('0xa'));var fs=require('fs');var _=require(_0x3f96('0xb'));var squel=require('squel');var crypto=require(_0x3f96('0xc'));var jsforce=require(_0x3f96('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3f96('0x9'));var querystring=require(_0x3f96('0xe'));var Papa=require(_0x3f96('0xf'));var Redis=require('ioredis');var authService=require(_0x3f96('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3f96('0x11'));var hardwareService=require(_0x3f96('0x12'));var logger=require(_0x3f96('0x13'))(_0x3f96('0x14'));var utils=require(_0x3f96('0x15'));var config=require(_0x3f96('0x16'));var db=require('../../mysqldb')['db'];config[_0x3f96('0x17')]=_[_0x3f96('0x18')](config[_0x3f96('0x17')],{'host':_0x3f96('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f96('0x17')]));require(_0x3f96('0x1a'))[_0x3f96('0x1b')](socket);function respondWithStatusCode(_0x1ed290,_0x4d897b){_0x4d897b=_0x4d897b||0xcc;return function(_0x554a42){if(_0x554a42){return _0x1ed290['sendStatus'](_0x4d897b);}return _0x1ed290[_0x3f96('0x1c')](_0x4d897b)[_0x3f96('0x1d')]();};}function respondWithResult(_0x16bd11,_0x36cf70){_0x36cf70=_0x36cf70||0xc8;return function(_0x146462){if(_0x146462){return _0x16bd11[_0x3f96('0x1c')](_0x36cf70)['json'](_0x146462);}};}function respondWithFilteredResult(_0x53daa6,_0x18bf7d){return function(_0x444101){if(_0x444101){var _0x30461e=_0x444101[_0x3f96('0x1e')],_0x70b204=_0x18bf7d[_0x3f96('0x1f')],_0x26b0e5=_0x18bf7d['offset']+_0x18bf7d[_0x3f96('0x20')],_0x153dda;if(_0x26b0e5>=_0x30461e){_0x26b0e5=_0x30461e;_0x153dda=0xc8;}else{_0x153dda=0xce;}_0x53daa6[_0x3f96('0x1c')](_0x153dda);return _0x53daa6[_0x3f96('0x21')]('Content-Range',_0x70b204+'-'+_0x26b0e5+'/'+_0x30461e)[_0x3f96('0x22')](_0x444101);}return null;};}function patchUpdates(_0x13749c){return function(_0x383ab3){try{jsonpatch[_0x3f96('0x23')](_0x383ab3,_0x13749c,!![]);}catch(_0x455d2e){return BPromise[_0x3f96('0x24')](_0x455d2e);}return _0x383ab3[_0x3f96('0x25')]();};}function saveUpdates(_0x553298,_0x1d91e9){return function(_0x5a4620){if(_0x5a4620){return _0x5a4620[_0x3f96('0x26')](_0x553298)['then'](function(_0x16ac29){return _0x16ac29;});}return null;};}function removeEntity(_0x230319,_0x4fa235){return function(_0x594f8f){if(_0x594f8f){return _0x594f8f[_0x3f96('0x27')]()[_0x3f96('0x28')](function(){_0x230319[_0x3f96('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2474b2,_0x493e46){return function(_0x5cc0d6){if(!_0x5cc0d6){_0x2474b2['sendStatus'](0x194);}return _0x5cc0d6;};}function handleError(_0x10d652,_0x5b0db9){_0x5b0db9=_0x5b0db9||0x1f4;return function(_0x57481f){logger['error'](_0x57481f[_0x3f96('0x29')]);if(_0x57481f['name']){delete _0x57481f[_0x3f96('0x2a')];}_0x10d652[_0x3f96('0x1c')](_0x5b0db9)['send'](_0x57481f);};}exports[_0x3f96('0x2b')]=function(_0x49f0de,_0x1ba510){var _0x257bc7={},_0x39ac5e={},_0x4de4f3={'count':0x0,'rows':[]};var _0x3c4bfe=_[_0x3f96('0x2c')](db[_0x3f96('0x2d')][_0x3f96('0x2e')],function(_0x5f00f1){return{'name':_0x5f00f1['fieldName'],'type':_0x5f00f1['type'][_0x3f96('0x2f')]};});_0x39ac5e['model']=_[_0x3f96('0x2c')](_0x3c4bfe,'name');_0x39ac5e[_0x3f96('0x30')]=_['keys'](_0x49f0de[_0x3f96('0x30')]);_0x39ac5e['filters']=_[_0x3f96('0x31')](_0x39ac5e[_0x3f96('0x32')],_0x39ac5e[_0x3f96('0x30')]);_0x257bc7[_0x3f96('0x33')]=_[_0x3f96('0x31')](_0x39ac5e[_0x3f96('0x32')],qs['fields'](_0x49f0de['query'][_0x3f96('0x34')]));_0x257bc7[_0x3f96('0x33')]=_0x257bc7['attributes'][_0x3f96('0x35')]?_0x257bc7[_0x3f96('0x33')]:_0x39ac5e[_0x3f96('0x32')];if(!_0x49f0de[_0x3f96('0x30')][_0x3f96('0x36')](_0x3f96('0x37'))){_0x257bc7['limit']=qs['limit'](_0x49f0de[_0x3f96('0x30')][_0x3f96('0x20')]);_0x257bc7[_0x3f96('0x1f')]=qs[_0x3f96('0x1f')](_0x49f0de['query'][_0x3f96('0x1f')]);}_0x257bc7[_0x3f96('0x38')]=qs['sort'](_0x49f0de[_0x3f96('0x30')]['sort']);_0x257bc7[_0x3f96('0x39')]=qs['filters'](_[_0x3f96('0x3a')](_0x49f0de[_0x3f96('0x30')],_0x39ac5e[_0x3f96('0x3b')]));if(_0x49f0de[_0x3f96('0x30')]['filter']){_0x257bc7[_0x3f96('0x39')]=_[_0x3f96('0x3c')](_0x257bc7['where'],{'$or':_[_0x3f96('0x2c')](_0x3c4bfe,function(_0x555fe8){if(_0x555fe8[_0x3f96('0x3d')]!=='VIRTUAL'){var _0x3e881b={};_0x3e881b[_0x555fe8[_0x3f96('0x2a')]]={'$like':'%'+_0x49f0de[_0x3f96('0x30')]['filter']+'%'};return _0x3e881b;}})});}_0x257bc7=_[_0x3f96('0x3c')]({},_0x257bc7,_0x49f0de['options']);var _0x2e7e11={'where':_0x257bc7['where']};return db[_0x3f96('0x2d')][_0x3f96('0x1e')](_0x2e7e11)[_0x3f96('0x28')](function(_0x37efc4){_0x4de4f3[_0x3f96('0x1e')]=_0x37efc4;if(_0x49f0de[_0x3f96('0x30')][_0x3f96('0x3e')]){_0x257bc7[_0x3f96('0x3f')]=[{'all':!![]}];}return db[_0x3f96('0x2d')][_0x3f96('0x40')](_0x257bc7);})[_0x3f96('0x28')](function(_0x1b64e9){_0x4de4f3[_0x3f96('0x41')]=_0x1b64e9;return _0x4de4f3;})[_0x3f96('0x28')](respondWithFilteredResult(_0x1ba510,_0x257bc7))[_0x3f96('0x42')](handleError(_0x1ba510,null));};exports[_0x3f96('0x43')]=function(_0x27e136,_0x1b52e4){var _0x3e69bb={'raw':![],'where':{'id':_0x27e136[_0x3f96('0x44')]['id']}},_0x48558f={};_0x48558f[_0x3f96('0x32')]=_['keys'](db['UserProfile'][_0x3f96('0x2e')]);_0x48558f[_0x3f96('0x30')]=_['keys'](_0x27e136['query']);_0x48558f['filters']=_[_0x3f96('0x31')](_0x48558f['model'],_0x48558f[_0x3f96('0x30')]);_0x3e69bb[_0x3f96('0x33')]=_[_0x3f96('0x31')](_0x48558f[_0x3f96('0x32')],qs[_0x3f96('0x34')](_0x27e136[_0x3f96('0x30')][_0x3f96('0x34')]));_0x3e69bb[_0x3f96('0x33')]=_0x3e69bb[_0x3f96('0x33')]['length']?_0x3e69bb[_0x3f96('0x33')]:_0x48558f[_0x3f96('0x32')];if(_0x27e136[_0x3f96('0x30')][_0x3f96('0x3e')]){_0x3e69bb[_0x3f96('0x3f')]=[{'all':!![]}];}_0x3e69bb=_[_0x3f96('0x3c')]({},_0x3e69bb,_0x27e136['options']);return db[_0x3f96('0x2d')][_0x3f96('0x45')](_0x3e69bb)['then'](handleEntityNotFound(_0x1b52e4,null))['then'](respondWithResult(_0x1b52e4,null))[_0x3f96('0x42')](handleError(_0x1b52e4,null));};exports[_0x3f96('0x46')]=function(_0x275272,_0xe8528d){return db[_0x3f96('0x2d')][_0x3f96('0x46')](_0x275272[_0x3f96('0x47')],{})[_0x3f96('0x28')](respondWithResult(_0xe8528d,0xc9))[_0x3f96('0x42')](handleError(_0xe8528d,null));};exports[_0x3f96('0x48')]=function(_0x2475e3,_0x5adb8c){var _0x17d366={'where':{'id':_0x2475e3[_0x3f96('0x44')]['id']}},_0x78f4bb={};_0x78f4bb[_0x3f96('0x32')]=_['keys'](db[_0x3f96('0x2d')][_0x3f96('0x2e')]);_0x17d366['attributes']=_[_0x3f96('0x31')](_0x78f4bb[_0x3f96('0x32')],qs['fields'](_0x2475e3[_0x3f96('0x30')]['fields']));_0x17d366[_0x3f96('0x33')]=_0x17d366[_0x3f96('0x33')][_0x3f96('0x35')]?_0x17d366[_0x3f96('0x33')]:_0x78f4bb[_0x3f96('0x32')];if(_0x2475e3['query'][_0x3f96('0x3e')]){_0x17d366[_0x3f96('0x3f')]=[{'all':!![]}];}_0x17d366=_[_0x3f96('0x3c')]({},_0x17d366,_0x2475e3[_0x3f96('0x49')]);return db[_0x3f96('0x2d')][_0x3f96('0x45')](_0x17d366)[_0x3f96('0x28')](handleEntityNotFound(_0x5adb8c,null))[_0x3f96('0x28')](function(_0x11905a){if(_0x11905a){var _0x3f125a=_0x11905a[_0x3f96('0x4a')]({'plain':!![]});_0x3f125a=qs[_0x3f96('0x4b')](_0x3f125a,['id',_0x3f96('0x4c'),_0x3f96('0x4d'),_0x3f96('0x4e')]);_0x2475e3['body']=_[_0x3f96('0x4b')](_0x2475e3['body'],['id',_0x3f96('0x4c'),'updatedAt']);return db[_0x3f96('0x4f')][_0x3f96('0x50')](function(_0x10c99d){return db[_0x3f96('0x2d')][_0x3f96('0x46')](_['merge'](_0x3f125a,_0x2475e3[_0x3f96('0x47')]),{'include':_0x2475e3[_0x3f96('0x30')][_0x3f96('0x3e')]?[{'all':!![]}]:undefined,'transaction':_0x10c99d})[_0x3f96('0x28')](function(_0xef1abf){var _0x440eb5=_0xef1abf[_0x3f96('0x4a')]({'plain':!![]});return db[_0x3f96('0x51')][_0x3f96('0x40')]({'where':{'userProfileId':_0x2475e3[_0x3f96('0x44')]['id']},'raw':!![]})['then'](function(_0x520dda){if(_0x520dda){return BPromise['each'](_0x520dda,function(_0x1a8bff){return new BPromise(function(_0x5b9be9,_0xf1fa43){if(_0x1a8bff[_0x3f96('0x52')]===null||_0x1a8bff[_0x3f96('0x52')]===0x1)_0x5b9be9(null);return db[_0x3f96('0x53')][_0x3f96('0x40')]({'where':{'sectionId':_0x1a8bff['id']},'raw':!![]})[_0x3f96('0x28')](function(_0x1e3acd){var _0x29ab62=_[_0x3f96('0x2c')](_0x1e3acd,function(_0x2582d3){return qs[_0x3f96('0x4b')](_0x2582d3,['id',_0x3f96('0x4c'),_0x3f96('0x4d'),_0x3f96('0x54')]);});_0x5b9be9(_0x29ab62);})[_0x3f96('0x42')](function(_0x591a43){_0xf1fa43(_0x591a43);});})[_0x3f96('0x28')](function(_0x41fbec){var _0x191e5b=qs[_0x3f96('0x4b')](_0x1a8bff,['id',_0x3f96('0x4c'),_0x3f96('0x4d')]);_0x191e5b['userProfileId']=_0x440eb5['id'];if(_0x41fbec)_0x191e5b[_0x3f96('0x55')]=_0x41fbec;return _0x191e5b;})[_0x3f96('0x28')](function(_0x1b532){return db['UserProfileSection'][_0x3f96('0x46')](_0x1b532,{'include':[{'model':db[_0x3f96('0x53')],'as':'Resources'}],'raw':!![],'transaction':_0x10c99d});});})[_0x3f96('0x28')](function(){return _0x440eb5;});}});});});}})[_0x3f96('0x28')](respondWithResult(_0x5adb8c,0xc9))[_0x3f96('0x42')](handleError(_0x5adb8c,null));};exports[_0x3f96('0x26')]=function(_0x10663a,_0x2d214d){if(_0x10663a[_0x3f96('0x47')]['id']){delete _0x10663a[_0x3f96('0x47')]['id'];}return db[_0x3f96('0x2d')][_0x3f96('0x45')]({'where':{'id':_0x10663a[_0x3f96('0x44')]['id']}})['then'](handleEntityNotFound(_0x2d214d,null))[_0x3f96('0x28')](saveUpdates(_0x10663a[_0x3f96('0x47')],null))['then'](respondWithResult(_0x2d214d,null))[_0x3f96('0x42')](handleError(_0x2d214d,null));};exports[_0x3f96('0x27')]=function(_0x461b31,_0x138e36){return db[_0x3f96('0x2d')][_0x3f96('0x45')]({'where':{'id':_0x461b31[_0x3f96('0x44')]['id']}})['then'](handleEntityNotFound(_0x138e36,null))['then'](removeEntity(_0x138e36,null))['catch'](handleError(_0x138e36,null));};exports[_0x3f96('0x56')]=function(_0x1633b5,_0x29b155){return db[_0x3f96('0x2d')][_0x3f96('0x56')]()['then'](respondWithResult(_0x29b155,null))[_0x3f96('0x42')](handleError(_0x29b155,null));};exports[_0x3f96('0x57')]=function(_0xe67806,_0x39a27d){var _0x3838f1=_0xe67806[_0x3f96('0x47')];return db[_0x3f96('0x2d')][_0x3f96('0x45')]({'where':{'id':_0xe67806[_0x3f96('0x44')]['id']}})[_0x3f96('0x28')](handleEntityNotFound(_0x39a27d,null))[_0x3f96('0x28')](function(_0x50a89b){if(_0x50a89b){return db[_0x3f96('0x4f')]['transaction'](function(_0x517ccf){return db[_0x3f96('0x51')][_0x3f96('0x27')]({'where':{'userProfileId':_0xe67806[_0x3f96('0x44')]['id'],'sectionId':_[_0x3f96('0x2c')](_0x3838f1,function(_0x34c354){return _0x34c354[_0x3f96('0x54')];})},'transaction':_0x517ccf})['then'](function(){var _0x31ba4b=_['map'](_0x3838f1,function(_0x52328d){_0x52328d[_0x3f96('0x58')]=_0xe67806['params']['id'];return _0x52328d;});var _0xeaec98=[];return BPromise[_0x3f96('0x59')](_0x31ba4b,function(_0x6912b7){return db['UserProfileSection'][_0x3f96('0x46')](_0x6912b7,{'include':[{'model':db[_0x3f96('0x53')],'as':_0x3f96('0x55')}],'raw':!![],'transaction':_0x517ccf})[_0x3f96('0x28')](function(_0x1e56c2){_0xeaec98[_0x3f96('0x5a')](_0x1e56c2[_0x3f96('0x4a')]({'plain':!![]}));});})[_0x3f96('0x28')](function(){return _0xeaec98;});});});}})[_0x3f96('0x28')](function(_0x3337f4){return _0x3337f4;})[_0x3f96('0x28')](respondWithResult(_0x39a27d,null))[_0x3f96('0x42')](handleError(_0x39a27d,null));};exports['removeSections']=function(_0x148375,_0x1e9829){var _0x1cda18;return db[_0x3f96('0x2d')][_0x3f96('0x45')]({'where':{'id':_0x148375['params']['id']},'attributes':['id','name']})[_0x3f96('0x28')](handleEntityNotFound(_0x1e9829,null))['then'](function(_0x572021){if(_0x572021){_0x1cda18=_0x572021;return db[_0x3f96('0x51')][_0x3f96('0x27')]({'where':{'userProfileId':_0x148375[_0x3f96('0x44')]['id'],'sectionId':_0x148375['query'][_0x3f96('0x5b')]}});}})[_0x3f96('0x28')](function(){return _0x1cda18;})[_0x3f96('0x28')](respondWithStatusCode(_0x1e9829,null))[_0x3f96('0x42')](handleError(_0x1e9829,null));};exports[_0x3f96('0x5c')]=function(_0x1dd9c9,_0x3802af){var _0x2737fd=[];var _0x54339f=[];return db[_0x3f96('0x51')]['findAll']({'where':{'userProfileId':_0x1dd9c9['params']['id']},'raw':!![]})[_0x3f96('0x28')](function(_0x4ec542){_0x2737fd=_[_0x3f96('0x5d')](_0x4ec542,function(_0x480109){return _0x480109[_0x3f96('0x5e')]===0x1||_[_0x3f96('0x5f')]([0x3eb,0x709],_0x480109[_0x3f96('0x54')]);});if(!_[_0x3f96('0x60')](_0x2737fd)){return _[_0x3f96('0x2c')](_0x2737fd,function(_0x35f05a){return _0x35f05a[_0x3f96('0x54')];});}else{return;}})[_0x3f96('0x28')](function(_0xc4058){if(_0xc4058)_0x54339f=_0xc4058;if(_[_0x3f96('0x5f')](_0x54339f,0x64)){var _0x24d686=_[_0x3f96('0x45')](_0x2737fd,{'sectionId':0x64});return hasDefaultDashboard(_0x24d686)['then'](function(_0x1b7da5){return _[_0x3f96('0x2c')](_0x2737fd,function(_0x124ae2){if(_0x124ae2[_0x3f96('0x54')]===0x64){_0x124ae2['subsections']=_0x1b7da5;}return _0x124ae2;});});}else{return;}})[_0x3f96('0x28')](function(_0x105dbc){if(_0x105dbc)_0x2737fd=_0x105dbc;if(_[_0x3f96('0x5f')](_0x54339f,0x3eb)){var _0x16d890=_['find'](_0x2737fd,{'sectionId':0x3eb});return getCustomDashboards(_0x16d890)[_0x3f96('0x28')](function(_0x5140fe){return _[_0x3f96('0x2c')](_0x2737fd,function(_0x2a02d8){if(_0x16d890[_0x3f96('0x5e')]){if(_0x2a02d8[_0x3f96('0x54')]===0x3eb){_0x2a02d8[_0x3f96('0x61')]=_0x5140fe;}}else{if(_0x2a02d8[_0x3f96('0x54')]===0x64){_0x2a02d8[_0x3f96('0x61')]=_0x5140fe;}}return _0x2a02d8;});});}else{return;}})[_0x3f96('0x28')](function(_0x457abd){if(_0x457abd)_0x2737fd=_0x457abd;if(_[_0x3f96('0x5f')](_0x54339f,0x709)){var _0x343b5a=_[_0x3f96('0x45')](_0x2737fd,{'sectionId':0x709});return getPlugins(_0x343b5a)[_0x3f96('0x28')](function(_0xad113c){if(_0x343b5a['enabled']){return _[_0x3f96('0x2c')](_0x2737fd,function(_0x24c2d1){if(_0x24c2d1[_0x3f96('0x54')]===0x709){_0x24c2d1[_0x3f96('0x61')]=_0xad113c;}return _0x24c2d1;});}else{var _0x2a7b75={'sectionId':0x76c,'enabled':0x1,'subsections':_0xad113c};var _0x2d8192=_['map'](_0x2737fd);_0x2d8192[_0x3f96('0x5a')](_0x2a7b75);return _0x2d8192;}});}else{return;}})[_0x3f96('0x28')](function(_0x29f314){if(_0x29f314)_0x2737fd=_0x29f314;return _[_0x3f96('0x5d')](_0x2737fd,[_0x3f96('0x5e'),0x1]);})[_0x3f96('0x28')](respondWithResult(_0x3802af,null))['catch'](handleError(_0x3802af,null));};function hasDefaultDashboard(_0x3f8e0d){var _0x35ff2c=[0x65];return new BPromise(function(_0x420ca3,_0x40dc3e){try{if(_0x3f8e0d[_0x3f96('0x52')]){_0x420ca3(_0x35ff2c);}else{return db[_0x3f96('0x53')][_0x3f96('0x62')]({'where':{'sectionId':_0x3f8e0d['id']},'raw':!![]})[_0x3f96('0x28')](function(_0x4a2dca){_0x4a2dca?_0x420ca3(_0x35ff2c):_0x420ca3();});}}catch(_0x41a08c){_0x40dc3e(_0x41a08c);}});}function getCustomDashboards(_0x181ccc){var _0x5479ef=[];return new BPromise(function(_0x1fbcc6,_0x2a1fb5){try{if(_0x181ccc[_0x3f96('0x52')]){return db[_0x3f96('0x63')][_0x3f96('0x40')]({'raw':!![]})[_0x3f96('0x28')](function(_0x2f7ecb){_0x2f7ecb[_0x3f96('0x64')](function(_0x124c9a){_0x5479ef[_0x3f96('0x5a')](_0x124c9a['id']+0x1869f);});_0x1fbcc6(_0x5479ef);});}else{return db['UserProfileResource'][_0x3f96('0x40')]({'where':{'sectionId':_0x181ccc['id']},'raw':!![]})[_0x3f96('0x28')](function(_0x296790){_0x296790['forEach'](function(_0x4178d5){_0x5479ef[_0x3f96('0x5a')](_0x4178d5['resourceId']+0x1869f);});_0x1fbcc6(_0x5479ef);});}}catch(_0x2ef071){_0x2a1fb5(_0x2ef071);}});}function getPlugins(_0x40cbe9){var _0x2750e7=[];return new BPromise(function(_0x4bcd81,_0x11772b){try{if(_0x40cbe9[_0x3f96('0x52')]){return db[_0x3f96('0x65')][_0x3f96('0x40')]({'raw':!![]})[_0x3f96('0x28')](function(_0x5d6a85){_0x5d6a85['forEach'](function(_0x42addc){_0x2750e7['push'](_0x42addc['id']+0x15b38);});_0x4bcd81(_0x2750e7);});}else{return db[_0x3f96('0x53')][_0x3f96('0x40')]({'where':{'sectionId':_0x40cbe9['id']},'raw':!![]})[_0x3f96('0x28')](function(_0xa7a358){_0xa7a358[_0x3f96('0x64')](function(_0xb80b13){_0x2750e7[_0x3f96('0x5a')](_0xb80b13[_0x3f96('0x66')]+0x15b38);});_0x4bcd81(_0x2750e7);});}}catch(_0x76c478){_0x11772b(_0x76c478);}});}exports[_0x3f96('0x67')]=function(_0x55a78b,_0x5f1f13){return db[_0x3f96('0x2d')][_0x3f96('0x45')]({'where':{'id':_0x55a78b[_0x3f96('0x44')]['id']}})[_0x3f96('0x28')](handleEntityNotFound(_0x5f1f13,null))[_0x3f96('0x28')](function(_0x503af9){if(_0x503af9){return db[_0x3f96('0x4f')][_0x3f96('0x50')](function(_0x2fd483){return db[_0x3f96('0x51')][_0x3f96('0x40')]({'where':{'userProfileId':_0x55a78b[_0x3f96('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0x3f96('0x28')](function(_0x2d99f1){if(_0x2d99f1){return db['UserProfileSection'][_0x3f96('0x27')]({'where':{'userProfileId':_0x55a78b[_0x3f96('0x44')]['id'],'id':_[_0x3f96('0x2c')](_0x2d99f1,function(_0x2bee22){return _0x2bee22['id'];})},'transaction':_0x2fd483});}})[_0x3f96('0x28')](function(_0x38cca0){var _0x2a3bc7=_[_0x3f96('0x2c')](_0x55a78b['body'],function(_0x5c8a12){_0x5c8a12['userProfileId']=_0x55a78b[_0x3f96('0x44')]['id'];return _0x5c8a12;});return db[_0x3f96('0x51')]['bulkCreate'](_0x2a3bc7,{'raw':!![],'transaction':_0x2fd483});})[_0x3f96('0x28')](function(_0x201642){var _0x5b0fc4=_[_0x3f96('0x5d')](_['map'](_0x201642,function(_0x792c7a){return _0x792c7a[_0x3f96('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x5b0fc4){return db[_0x3f96('0x51')]['findAll']({'where':{'userProfileId':_0x55a78b[_0x3f96('0x44')]['id'],'sectionId':_['map'](_0x5b0fc4,function(_0x5dca4e){return _0x5dca4e[_0x3f96('0x54')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x282bfb){var _0x412b97=_[_0x3f96('0x2c')](_0x55a78b[_0x3f96('0x47')],function(_0x255a37){_0x255a37[_0x3f96('0x58')]=_0x55a78b[_0x3f96('0x44')]['id'];return _0x255a37;});return db[_0x3f96('0x53')][_0x3f96('0x68')](_0x412b97,{'raw':!![],'transaction':_0x2fd483});});}})[_0x3f96('0x42')](handleError(_0x5f1f13,null));});}})[_0x3f96('0x28')](function(_0x24ba61){var _0x4ac884=_['map'](_0x24ba61,function(_0x255c75){return _0x255c75[_0x3f96('0x4a')]({'plain':!![]});});})[_0x3f96('0x28')](respondWithResult(_0x5f1f13,null))[_0x3f96('0x42')](handleError(_0x5f1f13,null));};exports[_0x3f96('0x69')]=function(_0x51b3ee,_0x24eb6d,_0x59c738){return db['UserProfile']['find']({'where':{'id':_0x51b3ee['params']['id']}})['then'](handleEntityNotFound(_0x24eb6d,null))[_0x3f96('0x28')](function(_0x360b62){if(_0x360b62){return _0x360b62['removeResources'](_0x51b3ee[_0x3f96('0x30')][_0x3f96('0x5b')]);}})['then'](respondWithStatusCode(_0x24eb6d,null))[_0x3f96('0x42')](handleError(_0x24eb6d,null));};exports['getResources']=function(_0x25b9f3,_0x4338ad){var _0x21093f={'raw':![],'where':{}};var _0x50eb90={};var _0xb423da={'count':0x0,'rows':[]};var _0x2a386d=_0x25b9f3[_0x3f96('0x30')][_0x3f96('0x6a')];if(typeof _0x2a386d===_0x3f96('0x6b')){throw new db['Sequelize'][(_0x3f96('0x6c'))](_0x3f96('0x6d'));}var _0x409d78=_0x25b9f3['query']['mergeResources']||![];var _0x30d849=getQueryModels(_0x2a386d,_0x409d78);if(typeof _0x30d849[_0x3f96('0x6e')]===_0x3f96('0x6b')){throw new db[(_0x3f96('0x6f'))][(_0x3f96('0x6c'))](_0x3f96('0x70')+_0x2a386d+'\x27');}var _0x450e6c=[];if(!_[_0x3f96('0x60')](_0x30d849['parentSections'])){_0x450e6c=_0x30d849[_0x3f96('0x71')];}else{_0x450e6c=[{'name':_0x2a386d}];}return db['UserProfile']['findOne']({'where':{'id':_0x25b9f3[_0x3f96('0x44')]['id']}})[_0x3f96('0x28')](handleEntityNotFound(_0x4338ad,null))[_0x3f96('0x28')](function(_0x3d122f){if(_0x3d122f){var _0x1e973e=[];for(var _0x56d60c=0x0;_0x56d60c<_0x450e6c[_0x3f96('0x35')];_0x56d60c++){_0x1e973e[_0x3f96('0x5a')](db[_0x3f96('0x51')]['findOne']({'where':{'userProfileId':_0x3d122f['id'],'name':_0x450e6c[_0x56d60c][_0x3f96('0x2a')]},'raw':!![]}));}return BPromise[_0x3f96('0x72')](_0x1e973e);}})['then'](function(_0x49c0c3){var _0x10fd0f=_['filter'](_0x49c0c3,function(_0x15584f){return _0x15584f?_0x15584f:undefined;});var _0xed381=_[_0x3f96('0x5d')](_0x450e6c,[_0x3f96('0x73'),!![]]);var _0x1143a8=_['isEmpty'](_0x10fd0f)&&_['isEmpty'](_0xed381)?null:_['union'](_0xed381,_0x10fd0f);if(_0x1143a8){var _0x94b803=[];for(var _0x3f543d=0x0;_0x3f543d<_0x1143a8[_0x3f96('0x35')];_0x3f543d++){var _0xda1ac7=_['find'](_0x450e6c,function(_0x493f42){return _0x1143a8[_0x3f543d]?_0x493f42['name']===_0x1143a8[_0x3f543d][_0x3f96('0x2a')]:null;});if(_0xda1ac7){if(_0x1143a8[_0x3f543d][_0x3f96('0x73')]){_0x94b803[_0x3f96('0x5a')](getAllResources(_0x30d849[_0x3f96('0x6e')],_0x1143a8[_0x3f543d]));}else{if(!_0x1143a8[_0x3f543d]['autoAssociation']){_0x94b803[_0x3f96('0x5a')](getAllowedResources(_0xda1ac7,_0x1143a8[_0x3f543d],_0x30d849[_0x3f96('0x6e')]));}else{if(_0xda1ac7[_0x3f96('0x32')]){_0x94b803['push'](getAllFilteredResources(_0xda1ac7,_0x1143a8[_0x3f543d]));}}}}}return BPromise[_0x3f96('0x72')](_0x94b803);}else{return null;}})[_0x3f96('0x28')](function(_0x5322be){var _0xe346e=_0x5322be;var _0x3f1a09=null;if(_0xe346e){_0x3f1a09=_0xe346e['length']===0x1?_0xe346e[0x0]:null;}if(_0x3f1a09||_0xe346e){var _0x2ea21c=db[_0x30d849[_0x3f96('0x6e')]][_0x3f96('0x2e')];_0x50eb90[_0x3f96('0x32')]=_['keys'](_0x2ea21c);_0x50eb90[_0x3f96('0x30')]=_['keys'](_0x25b9f3[_0x3f96('0x30')]);_0x50eb90[_0x3f96('0x3b')]=_[_0x3f96('0x31')](_0x50eb90[_0x3f96('0x32')],_0x50eb90['query']);_0x21093f[_0x3f96('0x33')]=_[_0x3f96('0x31')](_0x50eb90[_0x3f96('0x32')],qs[_0x3f96('0x34')](_0x25b9f3[_0x3f96('0x30')][_0x3f96('0x34')]));_0x21093f['attributes']=_0x21093f['attributes']['length']?_0x21093f[_0x3f96('0x33')]:_0x50eb90[_0x3f96('0x32')];if(!_0x25b9f3[_0x3f96('0x30')]['hasOwnProperty']('nolimit')){_0x21093f[_0x3f96('0x20')]=qs[_0x3f96('0x20')](_0x25b9f3['query'][_0x3f96('0x20')]);_0x21093f[_0x3f96('0x1f')]=qs['offset'](_0x25b9f3[_0x3f96('0x30')][_0x3f96('0x1f')]);}_0x21093f['order']=qs[_0x3f96('0x74')](_0x25b9f3['query'][_0x3f96('0x74')]);_0x21093f['where']=qs[_0x3f96('0x3b')](_[_0x3f96('0x3a')](_0x25b9f3[_0x3f96('0x30')],_0x50eb90[_0x3f96('0x3b')]));if(_0x25b9f3['query']['filter']){_0x21093f['where']=_[_0x3f96('0x3c')](_0x21093f[_0x3f96('0x39')],{'$or':_[_0x3f96('0x2c')](_0x2ea21c,function(_0x31b730){if(_0x31b730[_0x3f96('0x3d')][_0x3f96('0x2f')]!=='VIRTUAL'){var _0x2a368f={};_0x2a368f[_0x31b730['field']]={'$like':'%'+_0x25b9f3['query'][_0x3f96('0x5d')]+'%'};return _0x2a368f;}})});}var _0x2012d6=[];if(_0x3f1a09){var _0x578908=_[_0x3f96('0x45')](_0x450e6c,['name',_0x3f1a09[_0x3f96('0x2a')]]);if(_0x578908[_0x3f96('0x75')]){var _0x1f851b={};if(_0x30d849[_0x3f96('0x6e')]===_0x3f96('0x76')){_0x1f851b[_0x578908['foreignKey']]=_[_0x3f96('0x2c')](_0x3f1a09[_0x3f96('0x77')],'id');}else{_0x1f851b[_0x578908[_0x3f96('0x78')]]=_0x3f1a09[_0x3f96('0x77')];}_0x2012d6[_0x3f96('0x5a')](_0x1f851b);}else{_0x21093f[_0x3f96('0x39')]['id']=_0x3f1a09['associatedResources'];}}else{for(var _0x269f4c=0x0;_0x269f4c<_0xe346e[_0x3f96('0x35')];_0x269f4c++){var _0x578908=_[_0x3f96('0x45')](_0x450e6c,[_0x3f96('0x2a'),_0xe346e[_0x269f4c]['name']]);if(_0x578908[_0x3f96('0x75')]){var _0x1f851b={};_0x1f851b[_0x578908[_0x3f96('0x78')]]=_0xe346e[_0x269f4c]['associatedResources'];_0x2012d6[_0x3f96('0x5a')](_0x1f851b);}else{if(!_0x21093f['where']['id'])_0x21093f['where']['id']=[];_0xe346e[_0x269f4c]['associatedResources'][_0x3f96('0x64')](function(_0x123828){_0x21093f[_0x3f96('0x39')]['id'][_0x3f96('0x5a')](_0x123828);});}}}if(!_['isEmpty'](_0x2012d6)){_0x21093f['where']=_['merge'](_0x21093f[_0x3f96('0x39')],{'$and':{'$or':_0x2012d6}});}_0x21093f=_[_0x3f96('0x3c')]({},_0x21093f,_0x25b9f3[_0x3f96('0x49')]);if(_0x3f1a09&&!_0x3f1a09[_0x3f96('0x52')]&&_0x30d849['childModel']==='AnalyticExtractedReport'){if(_0x25b9f3[_0x3f96('0x30')][_0x3f96('0x3e')]){_0x21093f[_0x3f96('0x3f')]=[{'all':!![]}];}return db[_0x30d849[_0x3f96('0x6e')]][_0x3f96('0x40')](_0x21093f)[_0x3f96('0x28')](function(_0x35c8f5){var _0x42bcd7=[];_0x35c8f5[_0x3f96('0x64')](function(_0x833168){var _0x23ecc9;switch(_0x833168[_0x3f96('0x79')]){case _0x3f96('0x7a'):_0x23ecc9=_[_0x3f96('0x45')](_0x3f1a09[_0x3f96('0x77')],function(_0x532d88){return _0x532d88['id']===_0x833168['reportId']&&_0x532d88['type']===_0x3f96('0x7b');});break;case _0x3f96('0x7c'):_0x23ecc9=_[_0x3f96('0x45')](_0x3f1a09['associatedResources'],function(_0x3a24ae){return _0x3a24ae['id']===_0x833168[_0x3f96('0x7d')]&&_0x3a24ae['type']===_0x3f96('0x7e');});break;}if(_0x23ecc9)_0x42bcd7[_0x3f96('0x5a')](_0x833168);});_0xb423da[_0x3f96('0x1e')]=_0x42bcd7[_0x3f96('0x35')];_0xb423da['rows']=_0x42bcd7;return _0xb423da;});}else{return db[_0x30d849['childModel']][_0x3f96('0x1e')]({'where':_0x21093f[_0x3f96('0x39')]})[_0x3f96('0x28')](function(_0x2cbafa){_0xb423da[_0x3f96('0x1e')]=_0x2cbafa;if(_0x25b9f3['query'][_0x3f96('0x3e')]){if(_0x30d849[_0x3f96('0x6e')]===_0x3f96('0x7f')){_0x21093f[_0x3f96('0x3f')]=[{'model':db[_0x3f96('0x80')],'as':_0x3f96('0x81'),'attributes':['id',_0x3f96('0x2a'),_0x3f96('0x82')],'required':_0x25b9f3['query'][_0x3f96('0x83')]?!![]:![]},{'model':db[_0x3f96('0x80')],'as':'ThroughTags','attributes':['id',_0x3f96('0x2a'),'color'],'through':_0x25b9f3[_0x3f96('0x30')][_0x3f96('0x83')]?{'attributes':[],'where':{'TagId':_0x25b9f3['query']['tag']||undefined}}:{},'required':_0x25b9f3[_0x3f96('0x30')][_0x3f96('0x83')]?!![]:![]}];}else{_0x21093f[_0x3f96('0x3f')]=[{'all':!![]}];}}return db[_0x30d849['childModel']]['findAll'](_0x21093f);})['then'](function(_0x4816f2){_0xb423da[_0x3f96('0x41')]=_0x4816f2;return _0xb423da;});}}else{return _0xb423da;}})[_0x3f96('0x28')](respondWithFilteredResult(_0x4338ad,_0x21093f))['catch'](handleError(_0x4338ad,null));};function getAllResources(_0x51dd0a,_0x50b60f){return new BPromise(function(_0x138d17,_0x4e108e){if(_0x50b60f){var _0xf6c675=_0x50b60f[_0x3f96('0x5d')]?{[_0x50b60f[_0x3f96('0x5d')][_0x3f96('0x75')]]:_0x50b60f['filter']['value']}:undefined;return db[_0x51dd0a][_0x3f96('0x40')]({'where':_0xf6c675,'raw':!![]})[_0x3f96('0x28')](function(_0x496b6f){_0x50b60f['associatedResources']=_[_0x3f96('0x2c')](_0x496b6f,'id');_0x138d17(_0x50b60f);})[_0x3f96('0x42')](function(_0x222602){_0x4e108e(_0x222602);});}else{_0x138d17(null);}});}function getAllFilteredResources(_0x294113,_0x4e6fe9){return new BPromise(function(_0x2dd6c3,_0x39b64a){var _0x14b180=_0x294113[_0x3f96('0x5d')]?{[_0x294113['filter'][_0x3f96('0x75')]]:_0x294113[_0x3f96('0x5d')]['value']}:undefined;return db[_0x294113[_0x3f96('0x32')]]['findAll']({'where':_0x14b180,'raw':!![]})[_0x3f96('0x28')](function(_0x1e292){_0x4e6fe9[_0x3f96('0x77')]=_[_0x3f96('0x2c')](_0x1e292,function(_0x3e41ba){return _0x3e41ba['name'];});_0x2dd6c3(_0x4e6fe9);})['catch'](function(_0x2674b4){_0x39b64a(_0x2674b4);});});}function getAllowedResources(_0x17763b,_0x487d61,_0xaa3cbc){return new BPromise(function(_0x801bca,_0x18cf12){if(_0x487d61){return db[_0x3f96('0x53')][_0x3f96('0x40')]({'where':{'sectionId':_0x487d61['id']},'raw':!![]})[_0x3f96('0x28')](function(_0x2eadd8){if(_0x17763b[_0x3f96('0x75')]&&_0x17763b[_0x3f96('0x75')]!=='id'){_0x487d61['associatedResources']=_['map'](_0x2eadd8,function(_0x5e0ee6){return _0x5e0ee6[_0x17763b[_0x3f96('0x75')]];});}else{if(_0xaa3cbc===_0x3f96('0x76')){_0x487d61['associatedResources']=_[_0x3f96('0x2c')](_0x2eadd8,function(_0x168611){return{'id':_0x168611[_0x3f96('0x66')],'type':_0x168611['type']};});}else{_0x487d61[_0x3f96('0x77')]=_['map'](_0x2eadd8,function(_0x4d2250){return _0x4d2250['resourceId'];});}}_0x801bca(_0x487d61);})[_0x3f96('0x42')](function(_0x5b853e){_0x18cf12(_0x5b853e);});}else{_0x801bca(null);}});}function getQueryModels(_0x5c529c,_0x2f55ec){var _0x365f76=_0x5c529c[_0x3f96('0x84')]();var _0x51e248={'childModel':undefined,'parentSections':[]};switch(_0x365f76){case _0x3f96('0x85'):_0x51e248['childModel']=_0x3f96('0x86');break;case'odbc':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x87');break;case _0x3f96('0x88'):_0x51e248[_0x3f96('0x6e')]='SquareRecording';_0x51e248[_0x3f96('0x71')]=[{'name':_0x3f96('0x89'),'field':_0x3f96('0x2a'),'foreignKey':'projectName'}];break;case _0x3f96('0x8a'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x8b');break;case'contacts':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x7f');_0x51e248[_0x3f96('0x71')]=[{'name':_0x3f96('0x8c'),'field':'id','foreignKey':_0x3f96('0x8d')}];break;case'lists':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x8e');break;case _0x3f96('0x8f'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x90');break;case'globalcustomfields':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x91');break;case _0x3f96('0x92'):_0x51e248['childModel']=_0x3f96('0x93');break;case _0x3f96('0x94'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x95');break;case'faxqueues':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x96');break;case'faxaccounts':_0x51e248['childModel']=_0x3f96('0x97');break;case _0x3f96('0x98'):case'internalroutes':case _0x3f96('0x99'):_0x51e248['childModel']=_0x3f96('0x9a');break;case _0x3f96('0x9b'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x9c');break;case _0x3f96('0x9d'):_0x51e248[_0x3f96('0x6e')]='VoiceMail';break;case _0x3f96('0x9e'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x9f');_0x51e248[_0x3f96('0x71')]=[{'name':'Agents','field':_0x3f96('0x2a'),'foreignKey':_0x3f96('0xa0'),'model':_0x3f96('0xa1'),'filter':{'field':_0x3f96('0xa2'),'value':[_0x3f96('0xa3')]}},{'name':_0x3f96('0xa4'),'field':_0x3f96('0x2a'),'foreignKey':_0x3f96('0xa0'),'model':'User','filter':{'field':'role','value':[_0x3f96('0xa5')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x3f96('0xa6'),'model':_0x3f96('0xa7'),'filter':{'field':_0x3f96('0x3d'),'value':[_0x3f96('0xa8')]}},{'name':'QueueCampaigns','field':_0x3f96('0x2a'),'foreignKey':_0x3f96('0xa6'),'model':_0x3f96('0xa7'),'filter':{'field':_0x3f96('0x3d'),'value':[_0x3f96('0xa9')]}}];break;case _0x3f96('0xaa'):_0x51e248['childModel']=_0x3f96('0xab');break;case _0x3f96('0xac'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xad');break;case'voiceprefixes':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xae');break;case _0x3f96('0xaf'):_0x51e248['childModel']=_0x3f96('0xb0');break;case _0x3f96('0xb1'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xb2');break;case _0x3f96('0xb3'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xb4');break;case _0x3f96('0xb5'):_0x51e248['childModel']=_0x3f96('0xb6');break;case _0x3f96('0xb7'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xb8');break;case _0x3f96('0xb9'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xba');break;case'smsqueues':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xbb');break;case _0x3f96('0xbc'):_0x51e248[_0x3f96('0x6e')]='SmsAccount';break;case _0x3f96('0xbd'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xbe');break;case _0x3f96('0xbf'):case _0x3f96('0xc0'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xa7');if(_0x2f55ec){_0x51e248[_0x3f96('0x71')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x3f96('0xc1'):case'agents':case _0x3f96('0xc2'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xa1');if(_0x2f55ec){_0x51e248[_0x3f96('0x71')]=[{'name':_0x3f96('0xc3'),'filter':{'field':_0x3f96('0xa2'),'value':[_0x3f96('0xc4'),_0x3f96('0xc5')]},'ignore':!![]},{'name':_0x3f96('0xc6')},{'name':_0x3f96('0xa4')}];}break;case _0x3f96('0xc7'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xc8');break;case'salesforceaccounts':_0x51e248[_0x3f96('0x6e')]='SalesforceAccount';break;case _0x3f96('0xc9'):_0x51e248[_0x3f96('0x6e')]='FreshdeskAccount';break;case _0x3f96('0xca'):_0x51e248['childModel']='SugarcrmAccount';break;case _0x3f96('0xcb'):_0x51e248['childModel']=_0x3f96('0xcc');break;case _0x3f96('0xcd'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xce');break;case _0x3f96('0xcf'):_0x51e248[_0x3f96('0x6e')]='User';break;case _0x3f96('0xd0'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xd1');break;case _0x3f96('0xd2'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xd3');break;case'customdashboards':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x63');break;case'intervals':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xd4');break;case'pauses':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xd5');break;case _0x3f96('0xd6'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xd7');break;case'sounds':_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xd8');break;case _0x3f96('0xd9'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x80');break;case _0x3f96('0xda'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xdb');break;case _0x3f96('0xdc'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xdd');break;case _0x3f96('0xde'):_0x51e248['childModel']=_0x3f96('0xdf');break;case _0x3f96('0xe0'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xe1');break;case _0x3f96('0xe2'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0x65');break;case _0x3f96('0xe3'):_0x51e248[_0x3f96('0x6e')]='AnalyticExtractedReport';_0x51e248['parentSections']=[{'name':_0x3f96('0xe4'),'field':'id','foreignKey':_0x3f96('0x7d')}];break;case _0x3f96('0xe5'):_0x51e248[_0x3f96('0x6e')]=_0x3f96('0xe6');break;default:return _0x51e248;}return _0x51e248;} \ No newline at end of file +var _0x1ea9=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','options','UserProfile','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','clone','includeAll','find','createdAt','updatedAt','crudPermissions','omit','UserProfileSection','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','sequelize','transaction','push','get','removeSections','getSections','filter','includes','isEmpty','enabled','subsections','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','undefined','Sequelize','ValidationError','Unknown\x20section','childModel','Invalid\x20section\x20\x27','parentSections','ignore','all','nolimit','field','foreignKey','associatedResources','reportType','default','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','ThroughTags','tag','value','AnalyticExtractedReport','toLowerCase','squareprojects','odbc','projectName','projects','JscriptyProject','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','User','agent','membername','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','smsqueues','SmsQueue','smsaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Trigger','trunks','Variable','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x1ea9,0xe5));var _0x91ea=function(_0x4ca06b,_0x513e86){_0x4ca06b=_0x4ca06b-0x0;var _0x2de0fe=_0x1ea9[_0x4ca06b];return _0x2de0fe;};'use strict';var pdf=require(_0x91ea('0x0'));var emlformat=require(_0x91ea('0x1'));var rimraf=require(_0x91ea('0x2'));var zipdir=require(_0x91ea('0x3'));var jsonpatch=require(_0x91ea('0x4'));var rp=require(_0x91ea('0x5'));var moment=require(_0x91ea('0x6'));var BPromise=require(_0x91ea('0x7'));var Mustache=require(_0x91ea('0x8'));var util=require(_0x91ea('0x9'));var path=require(_0x91ea('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x91ea('0xb'));var fs=require('fs');var _=require(_0x91ea('0xc'));var squel=require(_0x91ea('0xd'));var crypto=require('crypto');var jsforce=require(_0x91ea('0xe'));var deskjs=require(_0x91ea('0xf'));var toCsv=require(_0x91ea('0x10'));var querystring=require(_0x91ea('0x11'));var Papa=require(_0x91ea('0x12'));var Redis=require(_0x91ea('0x13'));var authService=require(_0x91ea('0x14'));var qs=require(_0x91ea('0x15'));var as=require(_0x91ea('0x16'));var hardwareService=require(_0x91ea('0x17'));var logger=require(_0x91ea('0x18'))(_0x91ea('0x19'));var utils=require(_0x91ea('0x1a'));var config=require('../../config/environment');var db=require(_0x91ea('0x1b'))['db'];config[_0x91ea('0x1c')]=_['defaults'](config[_0x91ea('0x1c')],{'host':_0x91ea('0x1d'),'port':0x18eb});var socket=require(_0x91ea('0x1e'))(new Redis(config[_0x91ea('0x1c')]));require(_0x91ea('0x1f'))['register'](socket);function respondWithStatusCode(_0x27d2b7,_0x1aa8ba){_0x1aa8ba=_0x1aa8ba||0xcc;return function(_0x25fcbd){if(_0x25fcbd){return _0x27d2b7['sendStatus'](_0x1aa8ba);}return _0x27d2b7[_0x91ea('0x20')](_0x1aa8ba)['end']();};}function respondWithResult(_0x4977d6,_0x574420){_0x574420=_0x574420||0xc8;return function(_0x384468){if(_0x384468){return _0x4977d6[_0x91ea('0x20')](_0x574420)[_0x91ea('0x21')](_0x384468);}};}function respondWithFilteredResult(_0x21fc4,_0xaa1e8b){return function(_0x2957b3){if(_0x2957b3){var _0x10aa30=_0x2957b3[_0x91ea('0x22')],_0x30d9a7=_0xaa1e8b[_0x91ea('0x23')],_0x5563c4=_0xaa1e8b['offset']+_0xaa1e8b[_0x91ea('0x24')],_0xaeacd1;if(_0x5563c4>=_0x10aa30){_0x5563c4=_0x10aa30;_0xaeacd1=0xc8;}else{_0xaeacd1=0xce;}_0x21fc4[_0x91ea('0x20')](_0xaeacd1);return _0x21fc4[_0x91ea('0x25')](_0x91ea('0x26'),_0x30d9a7+'-'+_0x5563c4+'/'+_0x10aa30)[_0x91ea('0x21')](_0x2957b3);}return null;};}function patchUpdates(_0x62e8d4){return function(_0x1b1b32){try{jsonpatch[_0x91ea('0x27')](_0x1b1b32,_0x62e8d4,!![]);}catch(_0x5de779){return BPromise[_0x91ea('0x28')](_0x5de779);}return _0x1b1b32[_0x91ea('0x29')]();};}function saveUpdates(_0x576ac1,_0x1d2a23){return function(_0x4a225b){if(_0x4a225b){return _0x4a225b[_0x91ea('0x2a')](_0x576ac1)[_0x91ea('0x2b')](function(_0x4d32dc){return _0x4d32dc;});}return null;};}function removeEntity(_0x45a227,_0x57ed28){return function(_0x2eda8d){if(_0x2eda8d){return _0x2eda8d[_0x91ea('0x2c')]()[_0x91ea('0x2b')](function(){_0x45a227[_0x91ea('0x20')](0xcc)[_0x91ea('0x2d')]();});}};}function handleEntityNotFound(_0x55a4ca,_0x4d393b){return function(_0x13888f){if(!_0x13888f){_0x55a4ca['sendStatus'](0x194);}return _0x13888f;};}function handleError(_0x47a113,_0x2020b4){_0x2020b4=_0x2020b4||0x1f4;return function(_0x5aee94){logger['error'](_0x5aee94[_0x91ea('0x2e')]);if(_0x5aee94[_0x91ea('0x2f')]){delete _0x5aee94[_0x91ea('0x2f')];}_0x47a113['status'](_0x2020b4)[_0x91ea('0x30')](_0x5aee94);};}exports[_0x91ea('0x31')]=function(_0x2fcb93,_0x470093){var _0x416b75={},_0xbd1541={},_0x594152={'count':0x0,'rows':[]};var _0x310a87=_[_0x91ea('0x32')](db['UserProfile']['rawAttributes'],function(_0x7e2cb){return{'name':_0x7e2cb[_0x91ea('0x33')],'type':_0x7e2cb['type'][_0x91ea('0x34')]};});_0xbd1541[_0x91ea('0x35')]=_[_0x91ea('0x32')](_0x310a87,_0x91ea('0x2f'));_0xbd1541['query']=_['keys'](_0x2fcb93[_0x91ea('0x36')]);_0xbd1541[_0x91ea('0x37')]=_[_0x91ea('0x38')](_0xbd1541[_0x91ea('0x35')],_0xbd1541['query']);_0x416b75[_0x91ea('0x39')]=_[_0x91ea('0x38')](_0xbd1541['model'],qs[_0x91ea('0x3a')](_0x2fcb93[_0x91ea('0x36')]['fields']));_0x416b75[_0x91ea('0x39')]=_0x416b75[_0x91ea('0x39')][_0x91ea('0x3b')]?_0x416b75[_0x91ea('0x39')]:_0xbd1541['model'];if(!_0x2fcb93[_0x91ea('0x36')]['hasOwnProperty']('nolimit')){_0x416b75[_0x91ea('0x24')]=qs[_0x91ea('0x24')](_0x2fcb93[_0x91ea('0x36')]['limit']);_0x416b75[_0x91ea('0x23')]=qs[_0x91ea('0x23')](_0x2fcb93['query'][_0x91ea('0x23')]);}_0x416b75[_0x91ea('0x3c')]=qs[_0x91ea('0x3d')](_0x2fcb93['query'][_0x91ea('0x3d')]);_0x416b75[_0x91ea('0x3e')]=qs[_0x91ea('0x37')](_[_0x91ea('0x3f')](_0x2fcb93[_0x91ea('0x36')],_0xbd1541['filters']));if(_0x2fcb93['query']['filter']){_0x416b75[_0x91ea('0x3e')]=_[_0x91ea('0x40')](_0x416b75[_0x91ea('0x3e')],{'$or':_[_0x91ea('0x32')](_0x310a87,function(_0x301362){if(_0x301362[_0x91ea('0x41')]!==_0x91ea('0x42')){var _0xc34390={};_0xc34390[_0x301362[_0x91ea('0x2f')]]={'$like':'%'+_0x2fcb93[_0x91ea('0x36')]['filter']+'%'};return _0xc34390;}})});}_0x416b75=_[_0x91ea('0x40')]({},_0x416b75,_0x2fcb93[_0x91ea('0x43')]);var _0x13b4f7={'where':_0x416b75[_0x91ea('0x3e')]};return db[_0x91ea('0x44')][_0x91ea('0x22')](_0x13b4f7)[_0x91ea('0x2b')](function(_0x3ba44c){_0x594152['count']=_0x3ba44c;if(_0x2fcb93[_0x91ea('0x36')]['includeAll']){_0x416b75['include']=[{'all':!![]}];}return db[_0x91ea('0x44')][_0x91ea('0x45')](_0x416b75);})[_0x91ea('0x2b')](function(_0x5e4d8c){_0x594152[_0x91ea('0x46')]=_0x5e4d8c;return _0x594152;})['then'](respondWithFilteredResult(_0x470093,_0x416b75))[_0x91ea('0x47')](handleError(_0x470093,null));};exports[_0x91ea('0x48')]=function(_0x10d507,_0xd3499f){var _0x524475={'raw':![],'where':{'id':_0x10d507[_0x91ea('0x49')]['id']}},_0x99e674={};_0x99e674[_0x91ea('0x35')]=_[_0x91ea('0x4a')](db[_0x91ea('0x44')][_0x91ea('0x4b')]);_0x99e674[_0x91ea('0x36')]=_[_0x91ea('0x4a')](_0x10d507['query']);_0x99e674[_0x91ea('0x37')]=_[_0x91ea('0x38')](_0x99e674['model'],_0x99e674['query']);_0x524475['attributes']=_[_0x91ea('0x38')](_0x99e674[_0x91ea('0x35')],qs[_0x91ea('0x3a')](_0x10d507['query'][_0x91ea('0x3a')]));_0x524475[_0x91ea('0x39')]=_0x524475[_0x91ea('0x39')]['length']?_0x524475[_0x91ea('0x39')]:_0x99e674[_0x91ea('0x35')];if(_0x10d507[_0x91ea('0x36')]['includeAll']){_0x524475[_0x91ea('0x4c')]=[{'all':!![]}];}_0x524475=_[_0x91ea('0x40')]({},_0x524475,_0x10d507[_0x91ea('0x43')]);return db[_0x91ea('0x44')]['find'](_0x524475)[_0x91ea('0x2b')](handleEntityNotFound(_0xd3499f,null))['then'](respondWithResult(_0xd3499f,null))[_0x91ea('0x47')](handleError(_0xd3499f,null));};exports[_0x91ea('0x4d')]=function(_0x31f3dc,_0xfbbd27){return db[_0x91ea('0x44')]['create'](_0x31f3dc[_0x91ea('0x4e')],{})[_0x91ea('0x2b')](respondWithResult(_0xfbbd27,0xc9))[_0x91ea('0x47')](handleError(_0xfbbd27,null));};exports[_0x91ea('0x4f')]=function(_0x4a5d32,_0x2a7501){var _0x36d5b4={'where':{'id':_0x4a5d32[_0x91ea('0x49')]['id']}},_0x10891b={};_0x10891b[_0x91ea('0x35')]=_[_0x91ea('0x4a')](db[_0x91ea('0x44')][_0x91ea('0x4b')]);_0x36d5b4[_0x91ea('0x39')]=_[_0x91ea('0x38')](_0x10891b[_0x91ea('0x35')],qs[_0x91ea('0x3a')](_0x4a5d32['query']['fields']));_0x36d5b4['attributes']=_0x36d5b4['attributes']['length']?_0x36d5b4[_0x91ea('0x39')]:_0x10891b[_0x91ea('0x35')];if(_0x4a5d32[_0x91ea('0x36')][_0x91ea('0x50')]){_0x36d5b4[_0x91ea('0x4c')]=[{'all':!![]}];}_0x36d5b4=_[_0x91ea('0x40')]({},_0x36d5b4,_0x4a5d32[_0x91ea('0x43')]);return db['UserProfile'][_0x91ea('0x51')](_0x36d5b4)[_0x91ea('0x2b')](handleEntityNotFound(_0x2a7501,null))[_0x91ea('0x2b')](function(_0x27dc66){if(_0x27dc66){var _0x233d55=_0x27dc66['get']({'plain':!![]});_0x233d55=qs['omit'](_0x233d55,['id',_0x91ea('0x52'),_0x91ea('0x53'),_0x91ea('0x54')]);_0x4a5d32['body']=_[_0x91ea('0x55')](_0x4a5d32[_0x91ea('0x4e')],['id',_0x91ea('0x52'),_0x91ea('0x53')]);return db['sequelize']['transaction'](function(_0x20d48c){return db[_0x91ea('0x44')][_0x91ea('0x4d')](_[_0x91ea('0x40')](_0x233d55,_0x4a5d32['body']),{'include':_0x4a5d32[_0x91ea('0x36')][_0x91ea('0x50')]?[{'all':!![]}]:undefined,'transaction':_0x20d48c})[_0x91ea('0x2b')](function(_0x1d876f){var _0x21a9ed=_0x1d876f['get']({'plain':!![]});return db[_0x91ea('0x56')][_0x91ea('0x45')]({'where':{'userProfileId':_0x4a5d32[_0x91ea('0x49')]['id']},'raw':!![]})[_0x91ea('0x2b')](function(_0x2da0c1){if(_0x2da0c1){return BPromise[_0x91ea('0x57')](_0x2da0c1,function(_0x2164bf){return new BPromise(function(_0x397f05,_0x3c3e55){if(_0x2164bf[_0x91ea('0x58')]===null||_0x2164bf['autoAssociation']===0x1)_0x397f05(null);return db['UserProfileResource'][_0x91ea('0x45')]({'where':{'sectionId':_0x2164bf['id']},'raw':!![]})[_0x91ea('0x2b')](function(_0x31de07){var _0x3cb261=_['map'](_0x31de07,function(_0x1296a3){return qs['omit'](_0x1296a3,['id',_0x91ea('0x52'),'updatedAt',_0x91ea('0x59')]);});_0x397f05(_0x3cb261);})[_0x91ea('0x47')](function(_0x43d936){_0x3c3e55(_0x43d936);});})['then'](function(_0x11f6c6){var _0x5eaca5=qs[_0x91ea('0x55')](_0x2164bf,['id','createdAt',_0x91ea('0x53')]);_0x5eaca5[_0x91ea('0x5a')]=_0x21a9ed['id'];if(_0x11f6c6)_0x5eaca5[_0x91ea('0x5b')]=_0x11f6c6;return _0x5eaca5;})['then'](function(_0x1a79bb){return db['UserProfileSection'][_0x91ea('0x4d')](_0x1a79bb,{'include':[{'model':db[_0x91ea('0x5c')],'as':_0x91ea('0x5b')}],'raw':!![],'transaction':_0x20d48c});});})[_0x91ea('0x2b')](function(){return _0x21a9ed;});}});});});}})['then'](respondWithResult(_0x2a7501,0xc9))[_0x91ea('0x47')](handleError(_0x2a7501,null));};exports[_0x91ea('0x2a')]=function(_0x36e8e7,_0x254a23){if(_0x36e8e7[_0x91ea('0x4e')]['id']){delete _0x36e8e7['body']['id'];}return db[_0x91ea('0x44')]['find']({'where':{'id':_0x36e8e7[_0x91ea('0x49')]['id']}})[_0x91ea('0x2b')](handleEntityNotFound(_0x254a23,null))[_0x91ea('0x2b')](saveUpdates(_0x36e8e7['body'],null))[_0x91ea('0x2b')](respondWithResult(_0x254a23,null))['catch'](handleError(_0x254a23,null));};exports[_0x91ea('0x2c')]=function(_0x2b0d8c,_0x1aeed8){return db[_0x91ea('0x44')][_0x91ea('0x51')]({'where':{'id':_0x2b0d8c['params']['id']}})['then'](handleEntityNotFound(_0x1aeed8,null))[_0x91ea('0x2b')](removeEntity(_0x1aeed8,null))['catch'](handleError(_0x1aeed8,null));};exports['describe']=function(_0x1c018f,_0x3bc286){return db[_0x91ea('0x44')][_0x91ea('0x5d')]()[_0x91ea('0x2b')](respondWithResult(_0x3bc286,null))[_0x91ea('0x47')](handleError(_0x3bc286,null));};exports['addSections']=function(_0x2bded0,_0x399161){var _0x2daa72=_0x2bded0['body'];return db[_0x91ea('0x44')][_0x91ea('0x51')]({'where':{'id':_0x2bded0[_0x91ea('0x49')]['id']}})['then'](handleEntityNotFound(_0x399161,null))['then'](function(_0x55d366){if(_0x55d366){return db[_0x91ea('0x5e')][_0x91ea('0x5f')](function(_0x444ad5){return db[_0x91ea('0x56')]['destroy']({'where':{'userProfileId':_0x2bded0['params']['id'],'sectionId':_[_0x91ea('0x32')](_0x2daa72,function(_0x1f67ce){return _0x1f67ce[_0x91ea('0x59')];})},'transaction':_0x444ad5})[_0x91ea('0x2b')](function(){var _0x50d4ff=_[_0x91ea('0x32')](_0x2daa72,function(_0x518918){_0x518918['userProfileId']=_0x2bded0[_0x91ea('0x49')]['id'];return _0x518918;});var _0x50e9ab=[];return BPromise[_0x91ea('0x57')](_0x50d4ff,function(_0x59447b){return db[_0x91ea('0x56')][_0x91ea('0x4d')](_0x59447b,{'include':[{'model':db[_0x91ea('0x5c')],'as':'Resources'}],'raw':!![],'transaction':_0x444ad5})['then'](function(_0x1a1eab){_0x50e9ab[_0x91ea('0x60')](_0x1a1eab[_0x91ea('0x61')]({'plain':!![]}));});})['then'](function(){return _0x50e9ab;});});});}})['then'](function(_0x18a7f8){return _0x18a7f8;})[_0x91ea('0x2b')](respondWithResult(_0x399161,null))[_0x91ea('0x47')](handleError(_0x399161,null));};exports[_0x91ea('0x62')]=function(_0x4c7792,_0x36b081){var _0x1071a4;return db[_0x91ea('0x44')][_0x91ea('0x51')]({'where':{'id':_0x4c7792[_0x91ea('0x49')]['id']},'attributes':['id',_0x91ea('0x2f')]})['then'](handleEntityNotFound(_0x36b081,null))[_0x91ea('0x2b')](function(_0x49d56a){if(_0x49d56a){_0x1071a4=_0x49d56a;return db[_0x91ea('0x56')]['destroy']({'where':{'userProfileId':_0x4c7792[_0x91ea('0x49')]['id'],'sectionId':_0x4c7792[_0x91ea('0x36')]['ids']}});}})[_0x91ea('0x2b')](function(){return _0x1071a4;})[_0x91ea('0x2b')](respondWithStatusCode(_0x36b081,null))[_0x91ea('0x47')](handleError(_0x36b081,null));};exports[_0x91ea('0x63')]=function(_0x5a5a61,_0x538f96){var _0x598665=[];var _0x3d98c3=[];return db[_0x91ea('0x56')][_0x91ea('0x45')]({'where':{'userProfileId':_0x5a5a61[_0x91ea('0x49')]['id']},'raw':!![]})[_0x91ea('0x2b')](function(_0x5010c2){_0x598665=_[_0x91ea('0x64')](_0x5010c2,function(_0x1cb4f5){return _0x1cb4f5['enabled']===0x1||_[_0x91ea('0x65')]([0x3eb,0x709],_0x1cb4f5[_0x91ea('0x59')]);});if(!_[_0x91ea('0x66')](_0x598665)){return _[_0x91ea('0x32')](_0x598665,function(_0x507495){return _0x507495[_0x91ea('0x59')];});}else{return;}})[_0x91ea('0x2b')](function(_0x2af720){if(_0x2af720)_0x3d98c3=_0x2af720;if(_['includes'](_0x3d98c3,0x64)){var _0x74ce25=_[_0x91ea('0x51')](_0x598665,{'sectionId':0x64});return hasDefaultDashboard(_0x74ce25)[_0x91ea('0x2b')](function(_0x47b0f5){return _[_0x91ea('0x32')](_0x598665,function(_0xf28ea7){if(_0xf28ea7['sectionId']===0x64){_0xf28ea7['subsections']=_0x47b0f5;}return _0xf28ea7;});});}else{return;}})[_0x91ea('0x2b')](function(_0x25197b){if(_0x25197b)_0x598665=_0x25197b;if(_[_0x91ea('0x65')](_0x3d98c3,0x3eb)){var _0x4a222c=_[_0x91ea('0x51')](_0x598665,{'sectionId':0x3eb});return getCustomDashboards(_0x4a222c)[_0x91ea('0x2b')](function(_0xa132fd){return _['map'](_0x598665,function(_0x3650bb){if(_0x4a222c[_0x91ea('0x67')]){if(_0x3650bb[_0x91ea('0x59')]===0x3eb){_0x3650bb['subsections']=_0xa132fd;}}else{if(_0x3650bb[_0x91ea('0x59')]===0x64){_0x3650bb['subsections']=_0xa132fd;}}return _0x3650bb;});});}else{return;}})[_0x91ea('0x2b')](function(_0x40b51a){if(_0x40b51a)_0x598665=_0x40b51a;if(_[_0x91ea('0x65')](_0x3d98c3,0x709)){var _0x24b261=_[_0x91ea('0x51')](_0x598665,{'sectionId':0x709});return getPlugins(_0x24b261)[_0x91ea('0x2b')](function(_0x1e810f){if(_0x24b261['enabled']){return _[_0x91ea('0x32')](_0x598665,function(_0x4554e8){if(_0x4554e8[_0x91ea('0x59')]===0x709){_0x4554e8[_0x91ea('0x68')]=_0x1e810f;}return _0x4554e8;});}else{var _0x43df8f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1e810f};var _0x843793=_['map'](_0x598665);_0x843793[_0x91ea('0x60')](_0x43df8f);return _0x843793;}});}else{return;}})[_0x91ea('0x2b')](function(_0x46bceb){if(_0x46bceb)_0x598665=_0x46bceb;return _['filter'](_0x598665,['enabled',0x1]);})[_0x91ea('0x2b')](respondWithResult(_0x538f96,null))[_0x91ea('0x47')](handleError(_0x538f96,null));};function hasDefaultDashboard(_0x50099a){var _0x4640b3=[0x65];return new BPromise(function(_0x2f2322,_0x4dadf0){try{if(_0x50099a['autoAssociation']){_0x2f2322(_0x4640b3);}else{return db[_0x91ea('0x5c')][_0x91ea('0x69')]({'where':{'sectionId':_0x50099a['id']},'raw':!![]})[_0x91ea('0x2b')](function(_0x3a6f6f){_0x3a6f6f?_0x2f2322(_0x4640b3):_0x2f2322();});}}catch(_0x472371){_0x4dadf0(_0x472371);}});}function getCustomDashboards(_0x13f957){var _0x36b5b7=[];return new BPromise(function(_0x56e38b,_0x4134f9){try{if(_0x13f957[_0x91ea('0x58')]){return db['Dashboard'][_0x91ea('0x45')]({'raw':!![]})[_0x91ea('0x2b')](function(_0x4e7533){_0x4e7533[_0x91ea('0x6a')](function(_0x6de3d2){_0x36b5b7[_0x91ea('0x60')](_0x6de3d2['id']+0x1869f);});_0x56e38b(_0x36b5b7);});}else{return db[_0x91ea('0x5c')]['findAll']({'where':{'sectionId':_0x13f957['id']},'raw':!![]})['then'](function(_0x39ef3b){_0x39ef3b[_0x91ea('0x6a')](function(_0x26d251){_0x36b5b7[_0x91ea('0x60')](_0x26d251[_0x91ea('0x6b')]+0x1869f);});_0x56e38b(_0x36b5b7);});}}catch(_0x2b6bf3){_0x4134f9(_0x2b6bf3);}});}function getPlugins(_0x40e0c3){var _0x255c03=[];return new BPromise(function(_0x346ecc,_0x1833c3){try{if(_0x40e0c3['autoAssociation']){return db[_0x91ea('0x6c')][_0x91ea('0x45')]({'raw':!![]})['then'](function(_0x2853f5){_0x2853f5[_0x91ea('0x6a')](function(_0x16b3fc){_0x255c03[_0x91ea('0x60')](_0x16b3fc['id']+0x15b38);});_0x346ecc(_0x255c03);});}else{return db[_0x91ea('0x5c')]['findAll']({'where':{'sectionId':_0x40e0c3['id']},'raw':!![]})[_0x91ea('0x2b')](function(_0x51fe20){_0x51fe20[_0x91ea('0x6a')](function(_0x561bfb){_0x255c03[_0x91ea('0x60')](_0x561bfb[_0x91ea('0x6b')]+0x15b38);});_0x346ecc(_0x255c03);});}}catch(_0x113e61){_0x1833c3(_0x113e61);}});}exports[_0x91ea('0x6d')]=function(_0x15d388,_0x3f4c7e){return db[_0x91ea('0x44')][_0x91ea('0x51')]({'where':{'id':_0x15d388[_0x91ea('0x49')]['id']}})[_0x91ea('0x2b')](handleEntityNotFound(_0x3f4c7e,null))[_0x91ea('0x2b')](function(_0x85d40a){if(_0x85d40a){return db[_0x91ea('0x5e')][_0x91ea('0x5f')](function(_0x343993){return db['UserProfileSection'][_0x91ea('0x45')]({'where':{'userProfileId':_0x15d388[_0x91ea('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x91ea('0x2b')](function(_0x5f4241){if(_0x5f4241){return db[_0x91ea('0x56')][_0x91ea('0x2c')]({'where':{'userProfileId':_0x15d388[_0x91ea('0x49')]['id'],'id':_[_0x91ea('0x32')](_0x5f4241,function(_0x4fa316){return _0x4fa316['id'];})},'transaction':_0x343993});}})[_0x91ea('0x2b')](function(_0xd8d0b4){var _0x132945=_[_0x91ea('0x32')](_0x15d388['body'],function(_0x10847e){_0x10847e[_0x91ea('0x5a')]=_0x15d388['params']['id'];return _0x10847e;});return db[_0x91ea('0x56')][_0x91ea('0x6e')](_0x132945,{'raw':!![],'transaction':_0x343993});})[_0x91ea('0x2b')](function(_0x146110){var _0x324eaf=_[_0x91ea('0x64')](_['map'](_0x146110,function(_0xdae59e){return _0xdae59e[_0x91ea('0x61')]({'plain':!![]});}),{'includeAll':![]});if(_0x324eaf){return db[_0x91ea('0x56')]['findAll']({'where':{'userProfileId':_0x15d388[_0x91ea('0x49')]['id'],'sectionId':_[_0x91ea('0x32')](_0x324eaf,function(_0x3c6823){return _0x3c6823[_0x91ea('0x59')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x91ea('0x2b')](function(_0x16454c){var _0x44d552=_[_0x91ea('0x32')](_0x15d388[_0x91ea('0x4e')],function(_0x3c0670){_0x3c0670[_0x91ea('0x5a')]=_0x15d388[_0x91ea('0x49')]['id'];return _0x3c0670;});return db['UserProfileResource']['bulkCreate'](_0x44d552,{'raw':!![],'transaction':_0x343993});});}})[_0x91ea('0x47')](handleError(_0x3f4c7e,null));});}})[_0x91ea('0x2b')](function(_0x32aa90){var _0x49615e=_[_0x91ea('0x32')](_0x32aa90,function(_0x1b913c){return _0x1b913c[_0x91ea('0x61')]({'plain':!![]});});})[_0x91ea('0x2b')](respondWithResult(_0x3f4c7e,null))[_0x91ea('0x47')](handleError(_0x3f4c7e,null));};exports[_0x91ea('0x6f')]=function(_0x143d7c,_0x9c216a,_0xfc2257){return db[_0x91ea('0x44')][_0x91ea('0x51')]({'where':{'id':_0x143d7c[_0x91ea('0x49')]['id']}})[_0x91ea('0x2b')](handleEntityNotFound(_0x9c216a,null))[_0x91ea('0x2b')](function(_0x31b1e2){if(_0x31b1e2){return _0x31b1e2[_0x91ea('0x6f')](_0x143d7c[_0x91ea('0x36')][_0x91ea('0x70')]);}})[_0x91ea('0x2b')](respondWithStatusCode(_0x9c216a,null))[_0x91ea('0x47')](handleError(_0x9c216a,null));};exports[_0x91ea('0x71')]=function(_0x12911e,_0x4a0028){var _0x2fe182={'raw':![],'where':{}};var _0x294ed0={};var _0x54071d={'count':0x0,'rows':[]};var _0x28b563=_0x12911e[_0x91ea('0x36')]['section'];if(typeof _0x28b563===_0x91ea('0x72')){throw new db[(_0x91ea('0x73'))][(_0x91ea('0x74'))](_0x91ea('0x75'));}var _0x4d41c5=_0x12911e[_0x91ea('0x36')]['mergeResources']||![];var _0x34a31e=getQueryModels(_0x28b563,_0x4d41c5);if(typeof _0x34a31e[_0x91ea('0x76')]===_0x91ea('0x72')){throw new db[(_0x91ea('0x73'))][(_0x91ea('0x74'))](_0x91ea('0x77')+_0x28b563+'\x27');}var _0x593b96=[];if(!_[_0x91ea('0x66')](_0x34a31e['parentSections'])){_0x593b96=_0x34a31e[_0x91ea('0x78')];}else{_0x593b96=[{'name':_0x28b563}];}return db[_0x91ea('0x44')][_0x91ea('0x69')]({'where':{'id':_0x12911e[_0x91ea('0x49')]['id']}})[_0x91ea('0x2b')](handleEntityNotFound(_0x4a0028,null))[_0x91ea('0x2b')](function(_0x2f8f8f){if(_0x2f8f8f){var _0x23d058=[];for(var _0x1edb47=0x0;_0x1edb47<_0x593b96[_0x91ea('0x3b')];_0x1edb47++){_0x23d058[_0x91ea('0x60')](db['UserProfileSection'][_0x91ea('0x69')]({'where':{'userProfileId':_0x2f8f8f['id'],'name':_0x593b96[_0x1edb47][_0x91ea('0x2f')]},'raw':!![]}));}return BPromise['all'](_0x23d058);}})['then'](function(_0x4b096c){var _0x24eb89=_['filter'](_0x4b096c,function(_0x3f336d){return _0x3f336d?_0x3f336d:undefined;});var _0x549f3a=_[_0x91ea('0x64')](_0x593b96,[_0x91ea('0x79'),!![]]);var _0x5b48dc=_[_0x91ea('0x66')](_0x24eb89)&&_[_0x91ea('0x66')](_0x549f3a)?null:_['union'](_0x549f3a,_0x24eb89);if(_0x5b48dc){var _0x17bafe=[];for(var _0x3d026f=0x0;_0x3d026f<_0x5b48dc[_0x91ea('0x3b')];_0x3d026f++){var _0x3d16c7=_[_0x91ea('0x51')](_0x593b96,function(_0x2aa826){return _0x5b48dc[_0x3d026f]?_0x2aa826[_0x91ea('0x2f')]===_0x5b48dc[_0x3d026f][_0x91ea('0x2f')]:null;});if(_0x3d16c7){if(_0x5b48dc[_0x3d026f][_0x91ea('0x79')]){_0x17bafe[_0x91ea('0x60')](getAllResources(_0x34a31e[_0x91ea('0x76')],_0x5b48dc[_0x3d026f]));}else{if(!_0x5b48dc[_0x3d026f][_0x91ea('0x58')]){_0x17bafe['push'](getAllowedResources(_0x3d16c7,_0x5b48dc[_0x3d026f],_0x34a31e[_0x91ea('0x76')]));}else{if(_0x3d16c7[_0x91ea('0x35')]){_0x17bafe[_0x91ea('0x60')](getAllFilteredResources(_0x3d16c7,_0x5b48dc[_0x3d026f]));}}}}}return BPromise[_0x91ea('0x7a')](_0x17bafe);}else{return null;}})['then'](function(_0x5e23bd){var _0x4d0eb8=_0x5e23bd;var _0x51dfaa=null;if(_0x4d0eb8){_0x51dfaa=_0x4d0eb8['length']===0x1?_0x4d0eb8[0x0]:null;}if(_0x51dfaa||_0x4d0eb8){var _0x3706df=db[_0x34a31e[_0x91ea('0x76')]][_0x91ea('0x4b')];_0x294ed0['model']=_[_0x91ea('0x4a')](_0x3706df);_0x294ed0[_0x91ea('0x36')]=_['keys'](_0x12911e[_0x91ea('0x36')]);_0x294ed0['filters']=_['intersection'](_0x294ed0['model'],_0x294ed0[_0x91ea('0x36')]);_0x2fe182[_0x91ea('0x39')]=_[_0x91ea('0x38')](_0x294ed0['model'],qs[_0x91ea('0x3a')](_0x12911e['query'][_0x91ea('0x3a')]));_0x2fe182[_0x91ea('0x39')]=_0x2fe182['attributes'][_0x91ea('0x3b')]?_0x2fe182['attributes']:_0x294ed0[_0x91ea('0x35')];if(!_0x12911e[_0x91ea('0x36')]['hasOwnProperty'](_0x91ea('0x7b'))){_0x2fe182[_0x91ea('0x24')]=qs[_0x91ea('0x24')](_0x12911e['query'][_0x91ea('0x24')]);_0x2fe182[_0x91ea('0x23')]=qs[_0x91ea('0x23')](_0x12911e[_0x91ea('0x36')]['offset']);}_0x2fe182[_0x91ea('0x3c')]=qs[_0x91ea('0x3d')](_0x12911e[_0x91ea('0x36')]['sort']);_0x2fe182['where']=qs['filters'](_['pick'](_0x12911e[_0x91ea('0x36')],_0x294ed0[_0x91ea('0x37')]));if(_0x12911e['query'][_0x91ea('0x64')]){_0x2fe182['where']=_[_0x91ea('0x40')](_0x2fe182['where'],{'$or':_[_0x91ea('0x32')](_0x3706df,function(_0x35ce6c){if(_0x35ce6c[_0x91ea('0x41')]['key']!==_0x91ea('0x42')){var _0x5de81b={};_0x5de81b[_0x35ce6c[_0x91ea('0x7c')]]={'$like':'%'+_0x12911e[_0x91ea('0x36')][_0x91ea('0x64')]+'%'};return _0x5de81b;}})});}var _0x119631=[];if(_0x51dfaa){var _0xaa058=_['find'](_0x593b96,[_0x91ea('0x2f'),_0x51dfaa[_0x91ea('0x2f')]]);if(_0xaa058[_0x91ea('0x7c')]){var _0x40e74d={};if(_0x34a31e[_0x91ea('0x76')]==='AnalyticExtractedReport'){_0x40e74d[_0xaa058[_0x91ea('0x7d')]]=_['map'](_0x51dfaa[_0x91ea('0x7e')],'id');}else{_0x40e74d[_0xaa058['foreignKey']]=_0x51dfaa[_0x91ea('0x7e')];}_0x119631['push'](_0x40e74d);}else{_0x2fe182[_0x91ea('0x3e')]['id']=_0x51dfaa[_0x91ea('0x7e')];}}else{for(var _0x4504b6=0x0;_0x4504b6<_0x4d0eb8[_0x91ea('0x3b')];_0x4504b6++){var _0xaa058=_[_0x91ea('0x51')](_0x593b96,[_0x91ea('0x2f'),_0x4d0eb8[_0x4504b6][_0x91ea('0x2f')]]);if(_0xaa058[_0x91ea('0x7c')]){var _0x40e74d={};_0x40e74d[_0xaa058[_0x91ea('0x7d')]]=_0x4d0eb8[_0x4504b6][_0x91ea('0x7e')];_0x119631[_0x91ea('0x60')](_0x40e74d);}else{if(!_0x2fe182['where']['id'])_0x2fe182[_0x91ea('0x3e')]['id']=[];_0x4d0eb8[_0x4504b6]['associatedResources'][_0x91ea('0x6a')](function(_0x25a092){_0x2fe182['where']['id'][_0x91ea('0x60')](_0x25a092);});}}}if(!_[_0x91ea('0x66')](_0x119631)){_0x2fe182[_0x91ea('0x3e')]=_[_0x91ea('0x40')](_0x2fe182[_0x91ea('0x3e')],{'$and':{'$or':_0x119631}});}_0x2fe182=_[_0x91ea('0x40')]({},_0x2fe182,_0x12911e[_0x91ea('0x43')]);if(_0x51dfaa&&!_0x51dfaa[_0x91ea('0x58')]&&_0x34a31e[_0x91ea('0x76')]==='AnalyticExtractedReport'){if(_0x12911e[_0x91ea('0x36')]['includeAll']){_0x2fe182[_0x91ea('0x4c')]=[{'all':!![]}];}return db[_0x34a31e[_0x91ea('0x76')]][_0x91ea('0x45')](_0x2fe182)[_0x91ea('0x2b')](function(_0x16e9b7){var _0x24349d=[];_0x16e9b7[_0x91ea('0x6a')](function(_0x316d77){var _0x31f039;switch(_0x316d77[_0x91ea('0x7f')]){case _0x91ea('0x80'):_0x31f039=_[_0x91ea('0x51')](_0x51dfaa[_0x91ea('0x7e')],function(_0x40cf21){return _0x40cf21['id']===_0x316d77[_0x91ea('0x81')]&&_0x40cf21[_0x91ea('0x41')]===_0x91ea('0x82');});break;case _0x91ea('0x83'):_0x31f039=_['find'](_0x51dfaa['associatedResources'],function(_0x1327ed){return _0x1327ed['id']===_0x316d77['reportId']&&_0x1327ed['type']===_0x91ea('0x84');});break;}if(_0x31f039)_0x24349d['push'](_0x316d77);});_0x54071d[_0x91ea('0x22')]=_0x24349d[_0x91ea('0x3b')];_0x54071d[_0x91ea('0x46')]=_0x24349d;return _0x54071d;});}else{return db[_0x34a31e['childModel']][_0x91ea('0x22')]({'where':_0x2fe182[_0x91ea('0x3e')]})[_0x91ea('0x2b')](function(_0x1228f8){_0x54071d['count']=_0x1228f8;if(_0x12911e['query'][_0x91ea('0x50')]){if(_0x34a31e[_0x91ea('0x76')]===_0x91ea('0x85')){_0x2fe182[_0x91ea('0x4c')]=[{'model':db[_0x91ea('0x86')],'as':_0x91ea('0x87'),'attributes':['id',_0x91ea('0x2f'),_0x91ea('0x88')],'required':_0x12911e[_0x91ea('0x36')]['tag']?!![]:![]},{'model':db[_0x91ea('0x86')],'as':_0x91ea('0x89'),'attributes':['id',_0x91ea('0x2f'),_0x91ea('0x88')],'through':_0x12911e[_0x91ea('0x36')]['tag']?{'attributes':[],'where':{'TagId':_0x12911e[_0x91ea('0x36')][_0x91ea('0x8a')]||undefined}}:{},'required':_0x12911e[_0x91ea('0x36')][_0x91ea('0x8a')]?!![]:![]}];}else{_0x2fe182[_0x91ea('0x4c')]=[{'all':!![]}];}}return db[_0x34a31e[_0x91ea('0x76')]]['findAll'](_0x2fe182);})[_0x91ea('0x2b')](function(_0x3d4fd4){_0x54071d[_0x91ea('0x46')]=_0x3d4fd4;return _0x54071d;});}}else{return _0x54071d;}})[_0x91ea('0x2b')](respondWithFilteredResult(_0x4a0028,_0x2fe182))[_0x91ea('0x47')](handleError(_0x4a0028,null));};function getAllResources(_0x56397f,_0xf7d429){return new BPromise(function(_0x26fb55,_0x1730cd){if(_0xf7d429){var _0x4fd012=_0xf7d429['filter']?{[_0xf7d429[_0x91ea('0x64')][_0x91ea('0x7c')]]:_0xf7d429[_0x91ea('0x64')][_0x91ea('0x8b')]}:undefined;return db[_0x56397f]['findAll']({'where':_0x4fd012,'raw':!![]})[_0x91ea('0x2b')](function(_0x5f237c){_0xf7d429[_0x91ea('0x7e')]=_['map'](_0x5f237c,'id');_0x26fb55(_0xf7d429);})[_0x91ea('0x47')](function(_0x51099c){_0x1730cd(_0x51099c);});}else{_0x26fb55(null);}});}function getAllFilteredResources(_0x404e63,_0x4020ea){return new BPromise(function(_0x15a03b,_0x46918a){var _0x3ba210=_0x404e63[_0x91ea('0x64')]?{[_0x404e63[_0x91ea('0x64')][_0x91ea('0x7c')]]:_0x404e63['filter']['value']}:undefined;return db[_0x404e63[_0x91ea('0x35')]][_0x91ea('0x45')]({'where':_0x3ba210,'raw':!![]})['then'](function(_0x1e45ea){_0x4020ea['associatedResources']=_['map'](_0x1e45ea,function(_0x49b52a){return _0x49b52a[_0x91ea('0x2f')];});_0x15a03b(_0x4020ea);})['catch'](function(_0xbeb7dd){_0x46918a(_0xbeb7dd);});});}function getAllowedResources(_0x1e5dff,_0x19c96d,_0x373b37){return new BPromise(function(_0x220472,_0x29a363){if(_0x19c96d){return db[_0x91ea('0x5c')]['findAll']({'where':{'sectionId':_0x19c96d['id']},'raw':!![]})[_0x91ea('0x2b')](function(_0x52709b){if(_0x1e5dff[_0x91ea('0x7c')]&&_0x1e5dff[_0x91ea('0x7c')]!=='id'){_0x19c96d[_0x91ea('0x7e')]=_[_0x91ea('0x32')](_0x52709b,function(_0x4bd663){return _0x4bd663[_0x1e5dff['field']];});}else{if(_0x373b37===_0x91ea('0x8c')){_0x19c96d[_0x91ea('0x7e')]=_['map'](_0x52709b,function(_0x55fba0){return{'id':_0x55fba0[_0x91ea('0x6b')],'type':_0x55fba0[_0x91ea('0x41')]};});}else{_0x19c96d[_0x91ea('0x7e')]=_[_0x91ea('0x32')](_0x52709b,function(_0x310743){return _0x310743[_0x91ea('0x6b')];});}}_0x220472(_0x19c96d);})['catch'](function(_0x24c7bb){_0x29a363(_0x24c7bb);});}else{_0x220472(null);}});}function getQueryModels(_0x582bb8,_0x1d0075){var _0x17bdec=_0x582bb8[_0x91ea('0x8d')]();var _0x1e9148={'childModel':undefined,'parentSections':[]};switch(_0x17bdec){case _0x91ea('0x8e'):_0x1e9148[_0x91ea('0x76')]='SquareProject';break;case _0x91ea('0x8f'):_0x1e9148[_0x91ea('0x76')]='SquareOdbc';break;case'squarerecordings':_0x1e9148[_0x91ea('0x76')]='SquareRecording';_0x1e9148[_0x91ea('0x78')]=[{'name':'SquareProjects','field':_0x91ea('0x2f'),'foreignKey':_0x91ea('0x90')}];break;case _0x91ea('0x91'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0x92');break;case _0x91ea('0x93'):_0x1e9148['childModel']=_0x91ea('0x85');_0x1e9148[_0x91ea('0x78')]=[{'name':_0x91ea('0x94'),'field':'id','foreignKey':'ListId'}];break;case _0x91ea('0x95'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0x96');break;case _0x91ea('0x97'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0x98');break;case _0x91ea('0x99'):_0x1e9148['childModel']=_0x91ea('0x9a');break;case _0x91ea('0x9b'):_0x1e9148['childModel']='ChatQueue';break;case _0x91ea('0x9c'):_0x1e9148[_0x91ea('0x76')]='ChatWebsite';break;case _0x91ea('0x9d'):_0x1e9148[_0x91ea('0x76')]='FaxQueue';break;case _0x91ea('0x9e'):_0x1e9148['childModel']=_0x91ea('0x9f');break;case _0x91ea('0xa0'):case _0x91ea('0xa1'):case'outboundroutes':_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xa2');break;case _0x91ea('0xa3'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xa4');break;case'voicemails':_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xa5');break;case _0x91ea('0xa6'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xa7');_0x1e9148[_0x91ea('0x78')]=[{'name':_0x91ea('0xa8'),'field':_0x91ea('0x2f'),'foreignKey':'membername','model':_0x91ea('0xa9'),'filter':{'field':'role','value':[_0x91ea('0xaa')]}},{'name':'Telephones','field':_0x91ea('0x2f'),'foreignKey':_0x91ea('0xab'),'model':_0x91ea('0xa9'),'filter':{'field':_0x91ea('0xac'),'value':[_0x91ea('0xad')]}},{'name':_0x91ea('0xae'),'field':'name','foreignKey':_0x91ea('0xaf'),'model':_0x91ea('0xb0'),'filter':{'field':_0x91ea('0x41'),'value':[_0x91ea('0xb1')]}},{'name':_0x91ea('0xb2'),'field':_0x91ea('0x2f'),'foreignKey':_0x91ea('0xaf'),'model':'VoiceQueue','filter':{'field':_0x91ea('0x41'),'value':['outbound']}}];break;case _0x91ea('0xb3'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xb4');break;case _0x91ea('0xb5'):_0x1e9148['childModel']=_0x91ea('0xb6');break;case _0x91ea('0xb7'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xb8');break;case _0x91ea('0xb9'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xba');break;case _0x91ea('0xbb'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xbc');break;case _0x91ea('0xbd'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xbe');break;case _0x91ea('0xbf'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xc0');break;case _0x91ea('0xc1'):_0x1e9148[_0x91ea('0x76')]='OpenchannelQueue';break;case'openchannelaccounts':_0x1e9148[_0x91ea('0x76')]='OpenchannelAccount';break;case _0x91ea('0xc2'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xc3');break;case _0x91ea('0xc4'):_0x1e9148[_0x91ea('0x76')]='SmsAccount';break;case _0x91ea('0xc5'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xc6');break;case _0x91ea('0xc7'):case _0x91ea('0xc8'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xb0');if(_0x1d0075){_0x1e9148[_0x91ea('0x78')]=[{'name':_0x91ea('0xae')},{'name':'QueueCampaigns'}];}break;case _0x91ea('0xc9'):case _0x91ea('0xca'):case _0x91ea('0xcb'):_0x1e9148['childModel']=_0x91ea('0xa9');if(_0x1d0075){_0x1e9148['parentSections']=[{'name':_0x91ea('0xcc'),'filter':{'field':'role','value':[_0x91ea('0xcd'),'user']},'ignore':!![]},{'name':_0x91ea('0xa8')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xce');break;case'salesforceaccounts':_0x1e9148['childModel']=_0x91ea('0xcf');break;case _0x91ea('0xd0'):_0x1e9148[_0x91ea('0x76')]='FreshdeskAccount';break;case _0x91ea('0xd1'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xd2');break;case _0x91ea('0xd3'):_0x1e9148['childModel']=_0x91ea('0xd4');break;case'zohoaccounts':_0x1e9148['childModel']=_0x91ea('0xd5');break;case _0x91ea('0xd6'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xa9');break;case _0x91ea('0xd7'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xd8');break;case'dispositions':_0x1e9148[_0x91ea('0x76')]='Disposition';break;case'customdashboards':_0x1e9148[_0x91ea('0x76')]='Dashboard';break;case _0x91ea('0xd9'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xda');break;case _0x91ea('0xdb'):_0x1e9148['childModel']=_0x91ea('0xdc');break;case _0x91ea('0xdd'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xde');break;case _0x91ea('0xdf'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xe0');break;case _0x91ea('0xe1'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0x86');break;case'templates':_0x1e9148[_0x91ea('0x76')]='Template';break;case'triggers':_0x1e9148['childModel']=_0x91ea('0xe2');break;case _0x91ea('0xe3'):_0x1e9148[_0x91ea('0x76')]='Trunk';break;case'variables':_0x1e9148['childModel']=_0x91ea('0xe4');break;case'plugins':_0x1e9148['childModel']=_0x91ea('0x6c');break;case'extractedreports':_0x1e9148[_0x91ea('0x76')]=_0x91ea('0x8c');_0x1e9148[_0x91ea('0x78')]=[{'name':_0x91ea('0xe5'),'field':'id','foreignKey':_0x91ea('0x81')}];break;case _0x91ea('0xe6'):_0x1e9148[_0x91ea('0x76')]=_0x91ea('0xe7');break;default:return _0x1e9148;}return _0x1e9148;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index e28ef32..b835b3d 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 _0x528f=['update','remove','emit','hasOwnProperty','exports','events','UserProfile','setMaxListeners','save'];(function(_0x3a03cd,_0x1e6838){var _0x38e4ba=function(_0x224982){while(--_0x224982){_0x3a03cd['push'](_0x3a03cd['shift']());}};_0x38e4ba(++_0x1e6838);}(_0x528f,0x191));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf528('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xf528('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xf528('0x2')](0x0);var events={'afterCreate':_0xf528('0x3'),'afterUpdate':_0xf528('0x4'),'afterDestroy':_0xf528('0x5')};function emitEvent(_0x382dca){return function(_0x35cc42,_0x5d79f2,_0x1a7a41){UserProfileEvents[_0xf528('0x6')](_0x382dca+':'+_0x35cc42['id'],_0x35cc42);UserProfileEvents['emit'](_0x382dca,_0x35cc42);_0x1a7a41(null);};}for(var e in events){if(events[_0xf528('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xf528('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xa29f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile'];(function(_0x3b9f5d,_0x502a26){var _0x487d4d=function(_0x45e0dc){while(--_0x45e0dc){_0x3b9f5d['push'](_0x3b9f5d['shift']());}};_0x487d4d(++_0x502a26);}(_0xa29f,0xc5));var _0xfa29=function(_0x3a6b78,_0x2d62be){_0x3a6b78=_0x3a6b78-0x0;var _0x4943d4=_0xa29f[_0x3a6b78];return _0x4943d4;};'use strict';var EventEmitter=require(_0xfa29('0x0'));var UserProfile=require(_0xfa29('0x1'))['db'][_0xfa29('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xfa29('0x3')](0x0);var events={'afterCreate':_0xfa29('0x4'),'afterUpdate':_0xfa29('0x5'),'afterDestroy':_0xfa29('0x6')};function emitEvent(_0x3fc5b4){return function(_0x5701a5,_0x142bd4,_0x5e5afd){UserProfileEvents[_0xfa29('0x7')](_0x3fc5b4+':'+_0x5701a5['id'],_0x5701a5);UserProfileEvents[_0xfa29('0x7')](_0x3fc5b4,_0x5701a5);_0x5e5afd(null);};}for(var e in events){if(events[_0xfa29('0x8')](e)){var event=events[e];UserProfile[_0xfa29('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 4294efc..501869e 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 _0xcf6f=['path','rimraf','../../config/environment','exports','define','UserProfile','user_profiles','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x495c2b,_0x5044b0){var _0x370520=function(_0x57c87f){while(--_0x57c87f){_0x495c2b['push'](_0x495c2b['shift']());}};_0x370520(++_0x5044b0);}(_0xcf6f,0x19a));var _0xfcf6=function(_0xb4b4cd,_0x3a5a7c){_0xb4b4cd=_0xb4b4cd-0x0;var _0x4c58e4=_0xcf6f[_0xb4b4cd];return _0x4c58e4;};'use strict';var _=require('lodash');var util=require(_0xfcf6('0x0'));var logger=require(_0xfcf6('0x1'))(_0xfcf6('0x2'));var moment=require(_0xfcf6('0x3'));var BPromise=require(_0xfcf6('0x4'));var rp=require(_0xfcf6('0x5'));var fs=require('fs');var path=require(_0xfcf6('0x6'));var rimraf=require(_0xfcf6('0x7'));var config=require(_0xfcf6('0x8'));var attributes=require('./userProfile.attributes');module[_0xfcf6('0x9')]=function(_0x4133fb,_0x932991){return _0x4133fb[_0xfcf6('0xa')](_0xfcf6('0xb'),attributes,{'tableName':_0xfcf6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5211=['moment','bluebird','request-promise','path','../../config/environment','./userProfile.attributes','define','UserProfile','../../config/logger','api'];(function(_0x5794f8,_0x19e6e5){var _0x3be2ac=function(_0x571297){while(--_0x571297){_0x5794f8['push'](_0x5794f8['shift']());}};_0x3be2ac(++_0x19e6e5);}(_0x5211,0x18e));var _0x1521=function(_0x2fac7a,_0x3e9699){_0x2fac7a=_0x2fac7a-0x0;var _0x34c501=_0x5211[_0x2fac7a];return _0x34c501;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1521('0x0'))(_0x1521('0x1'));var moment=require(_0x1521('0x2'));var BPromise=require(_0x1521('0x3'));var rp=require(_0x1521('0x4'));var fs=require('fs');var path=require(_0x1521('0x5'));var rimraf=require('rimraf');var config=require(_0x1521('0x6'));var attributes=require(_0x1521('0x7'));module['exports']=function(_0x184a2d,_0x8cd579){return _0x184a2d[_0x1521('0x8')](_0x1521('0x9'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 3ae62c9..dd8bd01 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 _0xf494=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s','message','info','lodash','util','moment','randomstring','ioredis'];(function(_0x556477,_0x1b7214){var _0x552276=function(_0xf0e2ef){while(--_0xf0e2ef){_0x556477['push'](_0x556477['shift']());}};_0x552276(++_0x1b7214);}(_0xf494,0x1c6));var _0x4f49=function(_0x384d91,_0x1d344d){_0x384d91=_0x384d91-0x0;var _0x432c71=_0xf494[_0x384d91];return _0x432c71;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});config[_0x4f49('0xd')]=_['defaults'](config['redis'],{'host':_0x4f49('0xe'),'port':0x18eb});var socket=require(_0x4f49('0xf'))(new Redis(config[_0x4f49('0xd')]));require(_0x4f49('0x10'))[_0x4f49('0x11')](socket);function respondWithRpcPromise(_0x174d0d,_0x151d8c,_0x410884){return new BPromise(function(_0x53ee74,_0x3e464f){return client[_0x4f49('0x12')](_0x174d0d,_0x410884)['then'](function(_0x15e7a1){logger['info']('UserProfile,\x20%s,\x20%s',_0x151d8c,_0x4f49('0x13'));logger[_0x4f49('0x14')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x151d8c,_0x4f49('0x13'),JSON[_0x4f49('0x15')](_0x15e7a1));if(_0x15e7a1[_0x4f49('0x16')]){if(_0x15e7a1[_0x4f49('0x16')][_0x4f49('0x17')]===0x1f4){logger[_0x4f49('0x16')](_0x4f49('0x18'),_0x151d8c,_0x15e7a1['error'][_0x4f49('0x19')]);return _0x3e464f(_0x15e7a1[_0x4f49('0x16')][_0x4f49('0x19')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x151d8c,_0x15e7a1[_0x4f49('0x16')][_0x4f49('0x19')]);return _0x53ee74(_0x15e7a1[_0x4f49('0x16')]['message']);}else{logger[_0x4f49('0x1a')](_0x4f49('0x18'),_0x151d8c,_0x4f49('0x13'));_0x53ee74(_0x15e7a1['result']['message']);}})['catch'](function(_0x47f1e8){logger[_0x4f49('0x16')](_0x4f49('0x18'),_0x151d8c,_0x47f1e8);_0x3e464f(_0x47f1e8);});});} \ No newline at end of file +var _0x7da7=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x14e436,_0x44aa6c){var _0x36ea13=function(_0x35808e){while(--_0x35808e){_0x14e436['push'](_0x14e436['shift']());}};_0x36ea13(++_0x44aa6c);}(_0x7da7,0x10d));var _0x77da=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0x7da7[_0x28d225];return _0x1f79e1;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});config[_0x77da('0x9')]=_['defaults'](config[_0x77da('0x9')],{'host':_0x77da('0xa'),'port':0x18eb});var socket=require(_0x77da('0xb'))(new Redis(config[_0x77da('0x9')]));require(_0x77da('0xc'))['register'](socket);function respondWithRpcPromise(_0x40c86e,_0xb55827,_0x172d7f){return new BPromise(function(_0x5ea12f,_0x35d06e){return client[_0x77da('0xd')](_0x40c86e,_0x172d7f)[_0x77da('0xe')](function(_0x2a675a){logger['info'](_0x77da('0xf'),_0xb55827,_0x77da('0x10'));logger[_0x77da('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0xb55827,'request\x20sent',JSON[_0x77da('0x12')](_0x2a675a));if(_0x2a675a[_0x77da('0x13')]){if(_0x2a675a['error'][_0x77da('0x14')]===0x1f4){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')]['message']);return _0x35d06e(_0x2a675a[_0x77da('0x13')]['message']);}logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')][_0x77da('0x15')]);return _0x5ea12f(_0x2a675a['error']['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0xb55827,_0x77da('0x10'));_0x5ea12f(_0x2a675a[_0x77da('0x16')][_0x77da('0x15')]);}})[_0x77da('0x17')](function(_0x19a00c){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x19a00c);_0x35d06e(_0x19a00c);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 8658dcb..f2d6a4f 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 _0x9f45=['emit','removeListener','length','remove','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9f45,0x189));var _0x59f4=function(_0x2f4e40,_0x2c7e6c){_0x2f4e40=_0x2f4e40-0x0;var _0x36719d=_0x9f45[_0x2f4e40];return _0x36719d;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0x59f4('0x0'),_0x59f4('0x1')];function createListener(_0x35a517,_0x46a732){return function(_0xb78ca){_0x46a732[_0x59f4('0x2')](_0x35a517,_0xb78ca);};}function removeListener(_0x4fe5ad,_0x3286e6){return function(){UserProfileEvents[_0x59f4('0x3')](_0x4fe5ad,_0x3286e6);};}exports['register']=function(_0x311aea){for(var _0x31de7f=0x0,_0x4f8d4d=events[_0x59f4('0x4')];_0x31de7f<_0x4f8d4d;_0x31de7f++){var _0x380e1e=events[_0x31de7f];var _0x46573d=createListener('userProfile:'+_0x380e1e,_0x311aea);UserProfileEvents['on'](_0x380e1e,_0x46573d);}}; \ No newline at end of file +var _0x1095=['remove','update','emit','removeListener','userProfile:'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x1095,0x113));var _0x5109=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x1095[_0x311c35];return _0x5cc50c;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0x5109('0x0'),_0x5109('0x1')];function createListener(_0x2e5e4a,_0x5eb505){return function(_0x4e02e4){_0x5eb505[_0x5109('0x2')](_0x2e5e4a,_0x4e02e4);};}function removeListener(_0x10c5c9,_0x501eec){return function(){UserProfileEvents[_0x5109('0x3')](_0x10c5c9,_0x501eec);};}exports['register']=function(_0x26ded2){for(var _0x5e8596=0x0,_0x117b83=events['length'];_0x5e8596<_0x117b83;_0x5e8596++){var _0x363895=events[_0x5e8596];var _0x4f2aef=createListener(_0x5109('0x4')+_0x363895,_0x26ded2);UserProfileEvents['on'](_0x363895,_0x4f2aef);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 60caf89..118975c 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 _0xf6a5=['/:id','show','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x5ee4e9,_0x2e99de){var _0x53a83e=function(_0x592e4f){while(--_0x592e4f){_0x5ee4e9['push'](_0x5ee4e9['shift']());}};_0x53a83e(++_0x2e99de);}(_0xf6a5,0x16d));var _0x5f6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6a5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5f6a('0x0'));var util=require(_0x5f6a('0x1'));var path=require(_0x5f6a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5f6a('0x3')]();var auth=require(_0x5f6a('0x4'));var interaction=require(_0x5f6a('0x5'));var config=require(_0x5f6a('0x6'));var controller=require(_0x5f6a('0x7'));router[_0x5f6a('0x8')]('/',auth['isAuthenticated'](),controller[_0x5f6a('0x9')]);router['get'](_0x5f6a('0xa'),auth[_0x5f6a('0xb')](),controller[_0x5f6a('0xc')]);router[_0x5f6a('0x8')](_0x5f6a('0xd'),auth[_0x5f6a('0xb')](),controller[_0x5f6a('0xe')]);router['post']('/',auth[_0x5f6a('0xb')](),controller[_0x5f6a('0xf')]);router[_0x5f6a('0x10')](_0x5f6a('0xd'),auth['isAuthenticated'](),controller[_0x5f6a('0x11')]);router[_0x5f6a('0x12')](_0x5f6a('0xd'),auth['isAuthenticated'](),controller[_0x5f6a('0x13')]);module[_0x5f6a('0x14')]=router; \ No newline at end of file +var _0xc859=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x4ce230,_0xab121d){var _0x46058b=function(_0x3d95eb){while(--_0x3d95eb){_0x4ce230['push'](_0x4ce230['shift']());}};_0x46058b(++_0xab121d);}(_0xc859,0x17b));var _0x9c85=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xc859[_0x12d033];return _0x3b4e80;};'use strict';var multer=require('multer');var util=require(_0x9c85('0x0'));var path=require(_0x9c85('0x1'));var timeout=require(_0x9c85('0x2'));var express=require(_0x9c85('0x3'));var router=express[_0x9c85('0x4')]();var auth=require(_0x9c85('0x5'));var interaction=require(_0x9c85('0x6'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x9c85('0x7')]('/',auth[_0x9c85('0x8')](),controller[_0x9c85('0x9')]);router[_0x9c85('0x7')](_0x9c85('0xa'),auth[_0x9c85('0x8')](),controller[_0x9c85('0xb')]);router[_0x9c85('0x7')](_0x9c85('0xc'),auth['isAuthenticated'](),controller[_0x9c85('0xd')]);router[_0x9c85('0xe')]('/',auth[_0x9c85('0x8')](),controller[_0x9c85('0xf')]);router[_0x9c85('0x10')](_0x9c85('0xc'),auth['isAuthenticated'](),controller[_0x9c85('0x11')]);router[_0x9c85('0x12')](_0x9c85('0xc'),auth['isAuthenticated'](),controller[_0x9c85('0x13')]);module[_0x9c85('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 44e635f..c5f3848 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 _0x55e0=['sequelize','STRING','INTEGER'];(function(_0x571c5d,_0x1b7785){var _0x51f10f=function(_0x1e1b38){while(--_0x1e1b38){_0x571c5d['push'](_0x571c5d['shift']());}};_0x51f10f(++_0x1b7785);}(_0x55e0,0x1d1));var _0x055e=function(_0x25c5a4,_0x1922b9){_0x25c5a4=_0x25c5a4-0x0;var _0x3f191b=_0x55e0[_0x25c5a4];return _0x3f191b;};'use strict';var Sequelize=require(_0x055e('0x0'));module['exports']={'name':{'type':Sequelize[_0x055e('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x055e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x055e('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x6231=['STRING','INTEGER','exports'];(function(_0x2f8fcc,_0x562d8b){var _0x410aed=function(_0x2970e3){while(--_0x2970e3){_0x2f8fcc['push'](_0x2f8fcc['shift']());}};_0x410aed(++_0x562d8b);}(_0x6231,0x6b));var _0x1623=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6231[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x1623('0x0')]={'name':{'type':Sequelize[_0x1623('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x1623('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1623('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 6ce6319..234589f 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 _0xc0bc=['VIRTUAL','options','include','rows','catch','params','keys','includeAll','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','end','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0xc0bc,0x129));var _0xcc0b=function(_0x3ae1a7,_0x32260e){_0x3ae1a7=_0x3ae1a7-0x0;var _0x256cb1=_0xc0bc[_0x3ae1a7];return _0x256cb1;};'use strict';var pdf=require(_0xcc0b('0x0'));var emlformat=require(_0xcc0b('0x1'));var rimraf=require(_0xcc0b('0x2'));var zipdir=require(_0xcc0b('0x3'));var jsonpatch=require(_0xcc0b('0x4'));var rp=require(_0xcc0b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcc0b('0x6'));var path=require(_0xcc0b('0x7'));var sox=require(_0xcc0b('0x8'));var csv=require(_0xcc0b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcc0b('0xa'));var squel=require(_0xcc0b('0xb'));var crypto=require(_0xcc0b('0xc'));var jsforce=require(_0xcc0b('0xd'));var deskjs=require(_0xcc0b('0xe'));var toCsv=require(_0xcc0b('0x9'));var querystring=require('querystring');var Papa=require(_0xcc0b('0xf'));var Redis=require(_0xcc0b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcc0b('0x11'));var hardwareService=require(_0xcc0b('0x12'));var logger=require(_0xcc0b('0x13'))('api');var utils=require(_0xcc0b('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18f925,_0x318c0d){_0x318c0d=_0x318c0d||0xcc;return function(_0x51ba25){if(_0x51ba25){return _0x18f925[_0xcc0b('0x15')](_0x318c0d);}return _0x18f925[_0xcc0b('0x16')](_0x318c0d)['end']();};}function respondWithResult(_0x4d1278,_0x3602bf){_0x3602bf=_0x3602bf||0xc8;return function(_0x440194){if(_0x440194){return _0x4d1278[_0xcc0b('0x16')](_0x3602bf)[_0xcc0b('0x17')](_0x440194);}};}function respondWithFilteredResult(_0x993652,_0x3bcb46){return function(_0x5d5494){if(_0x5d5494){var _0x5c0e77=_0x5d5494[_0xcc0b('0x18')],_0x5a1914=_0x3bcb46[_0xcc0b('0x19')],_0x1b3f90=_0x3bcb46[_0xcc0b('0x19')]+_0x3bcb46[_0xcc0b('0x1a')],_0x8ca606;if(_0x1b3f90>=_0x5c0e77){_0x1b3f90=_0x5c0e77;_0x8ca606=0xc8;}else{_0x8ca606=0xce;}_0x993652['status'](_0x8ca606);return _0x993652[_0xcc0b('0x1b')](_0xcc0b('0x1c'),_0x5a1914+'-'+_0x1b3f90+'/'+_0x5c0e77)[_0xcc0b('0x17')](_0x5d5494);}return null;};}function patchUpdates(_0x1100e8){return function(_0x2b2d84){try{jsonpatch['apply'](_0x2b2d84,_0x1100e8,!![]);}catch(_0x109ca7){return BPromise[_0xcc0b('0x1d')](_0x109ca7);}return _0x2b2d84[_0xcc0b('0x1e')]();};}function saveUpdates(_0x283170,_0x56f1d4){return function(_0x107b0b){if(_0x107b0b){return _0x107b0b['update'](_0x283170)[_0xcc0b('0x1f')](function(_0xc75c3a){return _0xc75c3a;});}return null;};}function removeEntity(_0x46c864,_0x74272f){return function(_0x33ebc0){if(_0x33ebc0){return _0x33ebc0[_0xcc0b('0x20')]()[_0xcc0b('0x1f')](function(){_0x46c864[_0xcc0b('0x16')](0xcc)[_0xcc0b('0x21')]();});}};}function handleEntityNotFound(_0x565a49,_0x10a03b){return function(_0x515380){if(!_0x515380){_0x565a49['sendStatus'](0x194);}return _0x515380;};}function handleError(_0x2f81e7,_0x3592d4){_0x3592d4=_0x3592d4||0x1f4;return function(_0x51c365){logger['error'](_0x51c365['stack']);if(_0x51c365[_0xcc0b('0x22')]){delete _0x51c365['name'];}_0x2f81e7[_0xcc0b('0x16')](_0x3592d4)[_0xcc0b('0x23')](_0x51c365);};}exports[_0xcc0b('0x24')]=function(_0x470f11,_0x11335e){var _0x3ee0bf={},_0x8e4fd4={},_0x5dc0b2={'count':0x0,'rows':[]};var _0x4dbedb=_[_0xcc0b('0x25')](db[_0xcc0b('0x26')][_0xcc0b('0x27')],function(_0x3016b0){return{'name':_0x3016b0[_0xcc0b('0x28')],'type':_0x3016b0[_0xcc0b('0x29')][_0xcc0b('0x2a')]};});_0x8e4fd4[_0xcc0b('0x2b')]=_['map'](_0x4dbedb,'name');_0x8e4fd4[_0xcc0b('0x2c')]=_['keys'](_0x470f11[_0xcc0b('0x2c')]);_0x8e4fd4[_0xcc0b('0x2d')]=_[_0xcc0b('0x2e')](_0x8e4fd4['model'],_0x8e4fd4[_0xcc0b('0x2c')]);_0x3ee0bf['attributes']=_['intersection'](_0x8e4fd4['model'],qs['fields'](_0x470f11[_0xcc0b('0x2c')][_0xcc0b('0x2f')]));_0x3ee0bf['attributes']=_0x3ee0bf[_0xcc0b('0x30')][_0xcc0b('0x31')]?_0x3ee0bf['attributes']:_0x8e4fd4[_0xcc0b('0x2b')];if(!_0x470f11['query'][_0xcc0b('0x32')](_0xcc0b('0x33'))){_0x3ee0bf['limit']=qs[_0xcc0b('0x1a')](_0x470f11[_0xcc0b('0x2c')][_0xcc0b('0x1a')]);_0x3ee0bf[_0xcc0b('0x19')]=qs['offset'](_0x470f11[_0xcc0b('0x2c')][_0xcc0b('0x19')]);}_0x3ee0bf[_0xcc0b('0x34')]=qs[_0xcc0b('0x35')](_0x470f11[_0xcc0b('0x2c')][_0xcc0b('0x35')]);_0x3ee0bf[_0xcc0b('0x36')]=qs['filters'](_[_0xcc0b('0x37')](_0x470f11['query'],_0x8e4fd4[_0xcc0b('0x2d')]));if(_0x470f11[_0xcc0b('0x2c')][_0xcc0b('0x38')]){_0x3ee0bf[_0xcc0b('0x36')]=_[_0xcc0b('0x39')](_0x3ee0bf[_0xcc0b('0x36')],{'$or':_[_0xcc0b('0x25')](_0x4dbedb,function(_0x377a7a){if(_0x377a7a[_0xcc0b('0x29')]!==_0xcc0b('0x3a')){var _0x22ff59={};_0x22ff59[_0x377a7a[_0xcc0b('0x22')]]={'$like':'%'+_0x470f11[_0xcc0b('0x2c')][_0xcc0b('0x38')]+'%'};return _0x22ff59;}})});}_0x3ee0bf=_['merge']({},_0x3ee0bf,_0x470f11[_0xcc0b('0x3b')]);var _0x5a927c={'where':_0x3ee0bf[_0xcc0b('0x36')]};return db[_0xcc0b('0x26')][_0xcc0b('0x18')](_0x5a927c)[_0xcc0b('0x1f')](function(_0x56af01){_0x5dc0b2[_0xcc0b('0x18')]=_0x56af01;if(_0x470f11[_0xcc0b('0x2c')]['includeAll']){_0x3ee0bf[_0xcc0b('0x3c')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x3ee0bf);})[_0xcc0b('0x1f')](function(_0x9fc650){_0x5dc0b2[_0xcc0b('0x3d')]=_0x9fc650;return _0x5dc0b2;})[_0xcc0b('0x1f')](respondWithFilteredResult(_0x11335e,_0x3ee0bf))[_0xcc0b('0x3e')](handleError(_0x11335e,null));};exports['show']=function(_0x10c1db,_0x19c822){var _0x23a573={'raw':![],'where':{'id':_0x10c1db[_0xcc0b('0x3f')]['id']}},_0x5aee7c={};_0x5aee7c[_0xcc0b('0x2b')]=_['keys'](db['UserProfileResource'][_0xcc0b('0x27')]);_0x5aee7c[_0xcc0b('0x2c')]=_[_0xcc0b('0x40')](_0x10c1db['query']);_0x5aee7c[_0xcc0b('0x2d')]=_['intersection'](_0x5aee7c[_0xcc0b('0x2b')],_0x5aee7c[_0xcc0b('0x2c')]);_0x23a573[_0xcc0b('0x30')]=_['intersection'](_0x5aee7c['model'],qs[_0xcc0b('0x2f')](_0x10c1db[_0xcc0b('0x2c')][_0xcc0b('0x2f')]));_0x23a573['attributes']=_0x23a573[_0xcc0b('0x30')][_0xcc0b('0x31')]?_0x23a573[_0xcc0b('0x30')]:_0x5aee7c[_0xcc0b('0x2b')];if(_0x10c1db['query'][_0xcc0b('0x41')]){_0x23a573[_0xcc0b('0x3c')]=[{'all':!![]}];}_0x23a573=_[_0xcc0b('0x39')]({},_0x23a573,_0x10c1db[_0xcc0b('0x3b')]);return db[_0xcc0b('0x26')][_0xcc0b('0x42')](_0x23a573)[_0xcc0b('0x1f')](handleEntityNotFound(_0x19c822,null))[_0xcc0b('0x1f')](respondWithResult(_0x19c822,null))['catch'](handleError(_0x19c822,null));};exports[_0xcc0b('0x43')]=function(_0x3d8bb9,_0x163249){return db['UserProfileResource'][_0xcc0b('0x43')](_0x3d8bb9[_0xcc0b('0x44')],{})[_0xcc0b('0x1f')](respondWithResult(_0x163249,0xc9))[_0xcc0b('0x3e')](handleError(_0x163249,null));};exports[_0xcc0b('0x45')]=function(_0x281e1d,_0x5ad476){if(_0x281e1d[_0xcc0b('0x44')]['id']){delete _0x281e1d[_0xcc0b('0x44')]['id'];}return db[_0xcc0b('0x26')][_0xcc0b('0x42')]({'where':{'id':_0x281e1d['params']['id']}})[_0xcc0b('0x1f')](handleEntityNotFound(_0x5ad476,null))[_0xcc0b('0x1f')](saveUpdates(_0x281e1d[_0xcc0b('0x44')],null))[_0xcc0b('0x1f')](respondWithResult(_0x5ad476,null))[_0xcc0b('0x3e')](handleError(_0x5ad476,null));};exports[_0xcc0b('0x20')]=function(_0x1b86f9,_0x4762cb){return db[_0xcc0b('0x26')][_0xcc0b('0x42')]({'where':{'id':_0x1b86f9[_0xcc0b('0x3f')]['id']}})[_0xcc0b('0x1f')](handleEntityNotFound(_0x4762cb,null))[_0xcc0b('0x1f')](removeEntity(_0x4762cb,null))['catch'](handleError(_0x4762cb,null));};exports['describe']=function(_0x31a0a6,_0x28ac62){return db[_0xcc0b('0x26')][_0xcc0b('0x46')]()[_0xcc0b('0x1f')](respondWithResult(_0x28ac62,null))[_0xcc0b('0x3e')](handleError(_0x28ac62,null));}; \ No newline at end of file +var _0xc176=['length','hasOwnProperty','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','json','update','then','sendStatus','error','name','send','index','UserProfileResource','fieldName','type','model','map','query','keys','intersection','attributes','fields'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc176,0x166));var _0x6c17=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xc176[_0x2d126e];return _0xcb04d3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6c17('0x0'));var rimraf=require(_0x6c17('0x1'));var zipdir=require(_0x6c17('0x2'));var jsonpatch=require(_0x6c17('0x3'));var rp=require(_0x6c17('0x4'));var moment=require('moment');var BPromise=require(_0x6c17('0x5'));var Mustache=require('mustache');var util=require(_0x6c17('0x6'));var path=require(_0x6c17('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6c17('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6c17('0x9'));var toCsv=require(_0x6c17('0xa'));var querystring=require(_0x6c17('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6c17('0xc'));var qs=require(_0x6c17('0xd'));var as=require(_0x6c17('0xe'));var hardwareService=require(_0x6c17('0xf'));var logger=require('../../config/logger')(_0x6c17('0x10'));var utils=require(_0x6c17('0x11'));var config=require(_0x6c17('0x12'));var db=require(_0x6c17('0x13'))['db'];function respondWithStatusCode(_0x25af7f,_0x3ca7ad){_0x3ca7ad=_0x3ca7ad||0xcc;return function(_0x2cec52){if(_0x2cec52){return _0x25af7f['sendStatus'](_0x3ca7ad);}return _0x25af7f[_0x6c17('0x14')](_0x3ca7ad)[_0x6c17('0x15')]();};}function respondWithResult(_0x292fbf,_0x2b9847){_0x2b9847=_0x2b9847||0xc8;return function(_0x37c3ec){if(_0x37c3ec){return _0x292fbf[_0x6c17('0x14')](_0x2b9847)['json'](_0x37c3ec);}};}function respondWithFilteredResult(_0xdb842f,_0x48279e){return function(_0x6e7dc9){if(_0x6e7dc9){var _0x104887=_0x6e7dc9[_0x6c17('0x16')],_0x28be77=_0x48279e[_0x6c17('0x17')],_0x85748d=_0x48279e[_0x6c17('0x17')]+_0x48279e[_0x6c17('0x18')],_0x2684a5;if(_0x85748d>=_0x104887){_0x85748d=_0x104887;_0x2684a5=0xc8;}else{_0x2684a5=0xce;}_0xdb842f['status'](_0x2684a5);return _0xdb842f['set'](_0x6c17('0x19'),_0x28be77+'-'+_0x85748d+'/'+_0x104887)[_0x6c17('0x1a')](_0x6e7dc9);}return null;};}function patchUpdates(_0x451c25){return function(_0x30e40f){try{jsonpatch['apply'](_0x30e40f,_0x451c25,!![]);}catch(_0x5a5732){return BPromise['reject'](_0x5a5732);}return _0x30e40f['save']();};}function saveUpdates(_0x661628,_0x28af9a){return function(_0x45f6e0){if(_0x45f6e0){return _0x45f6e0[_0x6c17('0x1b')](_0x661628)['then'](function(_0x1b1106){return _0x1b1106;});}return null;};}function removeEntity(_0x30d92d,_0x46f44e){return function(_0x546a25){if(_0x546a25){return _0x546a25['destroy']()[_0x6c17('0x1c')](function(){_0x30d92d['status'](0xcc)[_0x6c17('0x15')]();});}};}function handleEntityNotFound(_0x29cd1d,_0x4b5839){return function(_0x1ff01d){if(!_0x1ff01d){_0x29cd1d[_0x6c17('0x1d')](0x194);}return _0x1ff01d;};}function handleError(_0x29e571,_0x31aa61){_0x31aa61=_0x31aa61||0x1f4;return function(_0x39867f){logger[_0x6c17('0x1e')](_0x39867f['stack']);if(_0x39867f[_0x6c17('0x1f')]){delete _0x39867f['name'];}_0x29e571[_0x6c17('0x14')](_0x31aa61)[_0x6c17('0x20')](_0x39867f);};}exports[_0x6c17('0x21')]=function(_0xde5db0,_0x7cce9b){var _0x300c6f={},_0x3c3d94={},_0x3c35af={'count':0x0,'rows':[]};var _0x424528=_['map'](db[_0x6c17('0x22')]['rawAttributes'],function(_0x4fa138){return{'name':_0x4fa138[_0x6c17('0x23')],'type':_0x4fa138[_0x6c17('0x24')]['key']};});_0x3c3d94[_0x6c17('0x25')]=_[_0x6c17('0x26')](_0x424528,_0x6c17('0x1f'));_0x3c3d94[_0x6c17('0x27')]=_[_0x6c17('0x28')](_0xde5db0[_0x6c17('0x27')]);_0x3c3d94['filters']=_[_0x6c17('0x29')](_0x3c3d94[_0x6c17('0x25')],_0x3c3d94[_0x6c17('0x27')]);_0x300c6f[_0x6c17('0x2a')]=_[_0x6c17('0x29')](_0x3c3d94['model'],qs[_0x6c17('0x2b')](_0xde5db0[_0x6c17('0x27')][_0x6c17('0x2b')]));_0x300c6f['attributes']=_0x300c6f[_0x6c17('0x2a')][_0x6c17('0x2c')]?_0x300c6f[_0x6c17('0x2a')]:_0x3c3d94['model'];if(!_0xde5db0[_0x6c17('0x27')][_0x6c17('0x2d')]('nolimit')){_0x300c6f['limit']=qs[_0x6c17('0x18')](_0xde5db0[_0x6c17('0x27')][_0x6c17('0x18')]);_0x300c6f[_0x6c17('0x17')]=qs[_0x6c17('0x17')](_0xde5db0['query']['offset']);}_0x300c6f['order']=qs[_0x6c17('0x2e')](_0xde5db0[_0x6c17('0x27')][_0x6c17('0x2e')]);_0x300c6f['where']=qs[_0x6c17('0x2f')](_[_0x6c17('0x30')](_0xde5db0['query'],_0x3c3d94[_0x6c17('0x2f')]));if(_0xde5db0[_0x6c17('0x27')]['filter']){_0x300c6f['where']=_[_0x6c17('0x31')](_0x300c6f[_0x6c17('0x32')],{'$or':_[_0x6c17('0x26')](_0x424528,function(_0x4fcd4c){if(_0x4fcd4c['type']!==_0x6c17('0x33')){var _0x4575d4={};_0x4575d4[_0x4fcd4c[_0x6c17('0x1f')]]={'$like':'%'+_0xde5db0[_0x6c17('0x27')][_0x6c17('0x34')]+'%'};return _0x4575d4;}})});}_0x300c6f=_[_0x6c17('0x31')]({},_0x300c6f,_0xde5db0[_0x6c17('0x35')]);var _0x12ee91={'where':_0x300c6f[_0x6c17('0x32')]};return db[_0x6c17('0x22')]['count'](_0x12ee91)[_0x6c17('0x1c')](function(_0x27c7b6){_0x3c35af['count']=_0x27c7b6;if(_0xde5db0[_0x6c17('0x27')][_0x6c17('0x36')]){_0x300c6f[_0x6c17('0x37')]=[{'all':!![]}];}return db[_0x6c17('0x22')][_0x6c17('0x38')](_0x300c6f);})[_0x6c17('0x1c')](function(_0x306f2c){_0x3c35af[_0x6c17('0x39')]=_0x306f2c;return _0x3c35af;})[_0x6c17('0x1c')](respondWithFilteredResult(_0x7cce9b,_0x300c6f))[_0x6c17('0x3a')](handleError(_0x7cce9b,null));};exports[_0x6c17('0x3b')]=function(_0x1c024e,_0x2d8bc6){var _0x89da41={'raw':![],'where':{'id':_0x1c024e['params']['id']}},_0x7a265d={};_0x7a265d[_0x6c17('0x25')]=_[_0x6c17('0x28')](db[_0x6c17('0x22')][_0x6c17('0x3c')]);_0x7a265d['query']=_[_0x6c17('0x28')](_0x1c024e[_0x6c17('0x27')]);_0x7a265d[_0x6c17('0x2f')]=_[_0x6c17('0x29')](_0x7a265d[_0x6c17('0x25')],_0x7a265d[_0x6c17('0x27')]);_0x89da41[_0x6c17('0x2a')]=_[_0x6c17('0x29')](_0x7a265d[_0x6c17('0x25')],qs['fields'](_0x1c024e[_0x6c17('0x27')][_0x6c17('0x2b')]));_0x89da41[_0x6c17('0x2a')]=_0x89da41[_0x6c17('0x2a')][_0x6c17('0x2c')]?_0x89da41[_0x6c17('0x2a')]:_0x7a265d[_0x6c17('0x25')];if(_0x1c024e[_0x6c17('0x27')][_0x6c17('0x36')]){_0x89da41[_0x6c17('0x37')]=[{'all':!![]}];}_0x89da41=_['merge']({},_0x89da41,_0x1c024e[_0x6c17('0x35')]);return db['UserProfileResource'][_0x6c17('0x3d')](_0x89da41)[_0x6c17('0x1c')](handleEntityNotFound(_0x2d8bc6,null))['then'](respondWithResult(_0x2d8bc6,null))['catch'](handleError(_0x2d8bc6,null));};exports[_0x6c17('0x3e')]=function(_0x2b6308,_0xbf45ec){return db[_0x6c17('0x22')]['create'](_0x2b6308[_0x6c17('0x3f')],{})[_0x6c17('0x1c')](respondWithResult(_0xbf45ec,0xc9))[_0x6c17('0x3a')](handleError(_0xbf45ec,null));};exports[_0x6c17('0x1b')]=function(_0x43b44d,_0x69e23b){if(_0x43b44d[_0x6c17('0x3f')]['id']){delete _0x43b44d[_0x6c17('0x3f')]['id'];}return db[_0x6c17('0x22')]['find']({'where':{'id':_0x43b44d[_0x6c17('0x40')]['id']}})[_0x6c17('0x1c')](handleEntityNotFound(_0x69e23b,null))['then'](saveUpdates(_0x43b44d[_0x6c17('0x3f')],null))['then'](respondWithResult(_0x69e23b,null))[_0x6c17('0x3a')](handleError(_0x69e23b,null));};exports[_0x6c17('0x41')]=function(_0x4a8f23,_0x140914){return db['UserProfileResource'][_0x6c17('0x3d')]({'where':{'id':_0x4a8f23[_0x6c17('0x40')]['id']}})[_0x6c17('0x1c')](handleEntityNotFound(_0x140914,null))['then'](removeEntity(_0x140914,null))[_0x6c17('0x3a')](handleError(_0x140914,null));};exports[_0x6c17('0x42')]=function(_0x20ea42,_0x29cd22){return db['UserProfileResource'][_0x6c17('0x42')]()[_0x6c17('0x1c')](respondWithResult(_0x29cd22,null))['catch'](handleError(_0x29cd22,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 6f40581..d69854a 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 _0xbe93=['resourceId','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0x3e9258,_0x4e70a7){var _0x5493a8=function(_0x339ee6){while(--_0x339ee6){_0x3e9258['push'](_0x3e9258['shift']());}};_0x5493a8(++_0x4e70a7);}(_0xbe93,0x153));var _0x3be9=function(_0x5d4835,_0x4642bb){_0x5d4835=_0x5d4835-0x0;var _0x17a06e=_0xbe93[_0x5d4835];return _0x17a06e;};'use strict';var _=require('lodash');var util=require(_0x3be9('0x0'));var logger=require(_0x3be9('0x1'))(_0x3be9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3be9('0x3'));var fs=require('fs');var path=require(_0x3be9('0x4'));var rimraf=require(_0x3be9('0x5'));var config=require(_0x3be9('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x3be9('0x7')]=function(_0x439d13,_0x394bd8){return _0x439d13[_0x3be9('0x8')](_0x3be9('0x9'),attributes,{'tableName':_0x3be9('0xa'),'paranoid':![],'indexes':[{'name':_0x3be9('0xb'),'fields':[_0x3be9('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x65ee=['./userProfileResource.attributes','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2785b0,_0x41a400){var _0x2cba6a=function(_0x11982e){while(--_0x11982e){_0x2785b0['push'](_0x2785b0['shift']());}};_0x2cba6a(++_0x41a400);}(_0x65ee,0x84));var _0xe65e=function(_0x3dbc61,_0x238c20){_0x3dbc61=_0x3dbc61-0x0;var _0x5549ef=_0x65ee[_0x3dbc61];return _0x5549ef;};'use strict';var _=require('lodash');var util=require(_0xe65e('0x0'));var logger=require(_0xe65e('0x1'))(_0xe65e('0x2'));var moment=require(_0xe65e('0x3'));var BPromise=require(_0xe65e('0x4'));var rp=require(_0xe65e('0x5'));var fs=require('fs');var path=require(_0xe65e('0x6'));var rimraf=require(_0xe65e('0x7'));var config=require('../../config/environment');var attributes=require(_0xe65e('0x8'));module['exports']=function(_0x348699,_0x3621aa){return _0x348699['define'](_0xe65e('0x9'),attributes,{'tableName':_0xe65e('0xa'),'paranoid':![],'indexes':[{'name':_0xe65e('0xb'),'fields':[_0xe65e('0xc'),_0xe65e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 24dbf94..cdb7339 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 _0xf169=['info','result','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1b4d6d,_0x3d1622){var _0x507da1=function(_0x21078d){while(--_0x21078d){_0x1b4d6d['push'](_0x1b4d6d['shift']());}};_0x507da1(++_0x3d1622);}(_0xf169,0x189));var _0x9f16=function(_0x339c52,_0x233f20){_0x339c52=_0x339c52-0x0;var _0x463406=_0xf169[_0x339c52];return _0x463406;};'use strict';var _=require(_0x9f16('0x0'));var util=require(_0x9f16('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f16('0x2'));var fs=require('fs');var Redis=require(_0x9f16('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f16('0x4'));var logger=require('../../config/logger')(_0x9f16('0x5'));var config=require(_0x9f16('0x6'));var jayson=require(_0x9f16('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34c292,_0x197fbe,_0x165c36){return new BPromise(function(_0xf47e3a,_0x597768){return client['request'](_0x34c292,_0x165c36)[_0x9f16('0x8')](function(_0x1abbd9){logger['info'](_0x9f16('0x9'),_0x197fbe,_0x9f16('0xa'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x197fbe,_0x9f16('0xa'),JSON[_0x9f16('0xb')](_0x1abbd9));if(_0x1abbd9['error']){if(_0x1abbd9[_0x9f16('0xc')][_0x9f16('0xd')]===0x1f4){logger[_0x9f16('0xc')](_0x9f16('0x9'),_0x197fbe,_0x1abbd9[_0x9f16('0xc')][_0x9f16('0xe')]);return _0x597768(_0x1abbd9[_0x9f16('0xc')][_0x9f16('0xe')]);}logger[_0x9f16('0xc')](_0x9f16('0x9'),_0x197fbe,_0x1abbd9[_0x9f16('0xc')][_0x9f16('0xe')]);return _0xf47e3a(_0x1abbd9[_0x9f16('0xc')][_0x9f16('0xe')]);}else{logger[_0x9f16('0xf')](_0x9f16('0x9'),_0x197fbe,_0x9f16('0xa'));_0xf47e3a(_0x1abbd9[_0x9f16('0x10')]['message']);}})['catch'](function(_0x207f9d){logger[_0x9f16('0xc')](_0x9f16('0x9'),_0x197fbe,_0x207f9d);_0x597768(_0x207f9d);});});} \ No newline at end of file +var _0x9f51=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','catch','util','bluebird','ioredis'];(function(_0x506f68,_0x194049){var _0x92843e=function(_0x23fd8a){while(--_0x23fd8a){_0x506f68['push'](_0x506f68['shift']());}};_0x92843e(++_0x194049);}(_0x9f51,0x1b6));var _0x19f5=function(_0x35289d,_0x230ce7){_0x35289d=_0x35289d-0x0;var _0x2dec71=_0x9f51[_0x35289d];return _0x2dec71;};'use strict';var _=require('lodash');var util=require(_0x19f5('0x0'));var moment=require('moment');var BPromise=require(_0x19f5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x19f5('0x2'));var db=require(_0x19f5('0x3'))['db'];var utils=require(_0x19f5('0x4'));var logger=require(_0x19f5('0x5'))('rpc');var config=require(_0x19f5('0x6'));var jayson=require(_0x19f5('0x7'));var client=jayson[_0x19f5('0x8')][_0x19f5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14b4a0,_0x122103,_0x42c348){return new BPromise(function(_0x4449e3,_0x3c264c){return client[_0x19f5('0xa')](_0x14b4a0,_0x42c348)['then'](function(_0x27a76a){logger[_0x19f5('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x122103,_0x19f5('0xc'));logger[_0x19f5('0xd')](_0x19f5('0xe'),_0x122103,_0x19f5('0xc'),JSON[_0x19f5('0xf')](_0x27a76a));if(_0x27a76a['error']){if(_0x27a76a[_0x19f5('0x10')][_0x19f5('0x11')]===0x1f4){logger['error'](_0x19f5('0x12'),_0x122103,_0x27a76a[_0x19f5('0x10')][_0x19f5('0x13')]);return _0x3c264c(_0x27a76a['error']['message']);}logger['error'](_0x19f5('0x12'),_0x122103,_0x27a76a[_0x19f5('0x10')][_0x19f5('0x13')]);return _0x4449e3(_0x27a76a['error']['message']);}else{logger[_0x19f5('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x122103,_0x19f5('0xc'));_0x4449e3(_0x27a76a['result'][_0x19f5('0x13')]);}})[_0x19f5('0x14')](function(_0xd3d938){logger[_0x19f5('0x10')](_0x19f5('0x12'),_0x122103,_0xd3d938);_0x3c264c(_0xd3d938);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index af7b9a4..7216887 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 _0x29a7=['isAuthenticated','get','/describe','describe','show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x127e78,_0x4d97e8){var _0x36ef7e=function(_0x535130){while(--_0x535130){_0x127e78['push'](_0x127e78['shift']());}};_0x36ef7e(++_0x4d97e8);}(_0x29a7,0x1af));var _0x729a=function(_0x2bb66c,_0x36c6c6){_0x2bb66c=_0x2bb66c-0x0;var _0x1e0f98=_0x29a7[_0x2bb66c];return _0x1e0f98;};'use strict';var multer=require(_0x729a('0x0'));var util=require(_0x729a('0x1'));var path=require(_0x729a('0x2'));var timeout=require(_0x729a('0x3'));var express=require(_0x729a('0x4'));var router=express[_0x729a('0x5')]();var auth=require(_0x729a('0x6'));var interaction=require(_0x729a('0x7'));var config=require(_0x729a('0x8'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x729a('0x9')](),controller['index']);router[_0x729a('0xa')](_0x729a('0xb'),auth[_0x729a('0x9')](),controller[_0x729a('0xc')]);router[_0x729a('0xa')]('/:id',auth[_0x729a('0x9')](),controller[_0x729a('0xd')]);router[_0x729a('0xe')]('/',auth[_0x729a('0x9')](),controller[_0x729a('0xf')]);router[_0x729a('0x10')](_0x729a('0x11'),auth[_0x729a('0x9')](),controller[_0x729a('0x12')]);router['delete'](_0x729a('0x11'),auth[_0x729a('0x9')](),controller[_0x729a('0x13')]);module['exports']=router; \ No newline at end of file +var _0x45c2=['isAuthenticated','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x45c2,0x13a));var _0x245c=function(_0x4383e9,_0xa4b307){_0x4383e9=_0x4383e9-0x0;var _0x355405=_0x45c2[_0x4383e9];return _0x355405;};'use strict';var multer=require(_0x245c('0x0'));var util=require(_0x245c('0x1'));var path=require(_0x245c('0x2'));var timeout=require(_0x245c('0x3'));var express=require(_0x245c('0x4'));var router=express['Router']();var auth=require(_0x245c('0x5'));var interaction=require(_0x245c('0x6'));var config=require(_0x245c('0x7'));var controller=require(_0x245c('0x8'));router[_0x245c('0x9')]('/',auth[_0x245c('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x245c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x245c('0xc')]('/',auth[_0x245c('0xa')](),controller[_0x245c('0xd')]);router['put'](_0x245c('0xb'),auth[_0x245c('0xa')](),controller[_0x245c('0xe')]);router[_0x245c('0xf')](_0x245c('0xb'),auth[_0x245c('0xa')](),controller[_0x245c('0x10')]);module[_0x245c('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 6b62ed3..ed8fa69 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 _0x534d=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x534d,0x79));var _0xd534=function(_0x2e47dc,_0x29283c){_0x2e47dc=_0x2e47dc-0x0;var _0x5dc813=_0x534d[_0x2e47dc];return _0x5dc813;};'use strict';var Sequelize=require(_0xd534('0x0'));module[_0xd534('0x1')]={'name':{'type':Sequelize[_0xd534('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xd534('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd534('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd534('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd534('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd534('0x2')],'set':function(_0x1479ec){this[_0xd534('0x5')](_0xd534('0x6'),_0x1479ec?_0x1479ec[_0xd534('0x7')](''):[]);},'get':function(){return this[_0xd534('0x8')](_0xd534('0x6'))?this[_0xd534('0x8')](_0xd534('0x6'))[_0xd534('0x9')](''):[];}}}; \ No newline at end of file +var _0x5044=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split'];(function(_0x4c1f6a,_0x54869f){var _0x55fc29=function(_0x41ccdb){while(--_0x41ccdb){_0x4c1f6a['push'](_0x4c1f6a['shift']());}};_0x55fc29(++_0x54869f);}(_0x5044,0xc8));var _0x4504=function(_0x5eab7d,_0xd0de6){_0x5eab7d=_0x5eab7d-0x0;var _0x993755=_0x5044[_0x5eab7d];return _0x993755;};'use strict';var Sequelize=require('sequelize');module[_0x4504('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4504('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4504('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4504('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4504('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4504('0x1')],'set':function(_0x3e3c2d){this[_0x4504('0x4')](_0x4504('0x5'),_0x3e3c2d?_0x3e3c2d['join'](''):[]);},'get':function(){return this[_0x4504('0x6')](_0x4504('0x5'))?this[_0x4504('0x6')](_0x4504('0x5'))[_0x4504('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 4eba0b7..7aa9867 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 _0x6780=['create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','end','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','UserProfileSection','count','includeAll','findAll','rows','catch','fields','include','find'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0x6780,0x9a));var _0x0678=function(_0x31de13,_0x27e5bf){_0x31de13=_0x31de13-0x0;var _0x5eea84=_0x6780[_0x31de13];return _0x5eea84;};'use strict';var pdf=require(_0x0678('0x0'));var emlformat=require(_0x0678('0x1'));var rimraf=require(_0x0678('0x2'));var zipdir=require(_0x0678('0x3'));var jsonpatch=require(_0x0678('0x4'));var rp=require(_0x0678('0x5'));var moment=require(_0x0678('0x6'));var BPromise=require(_0x0678('0x7'));var Mustache=require(_0x0678('0x8'));var util=require(_0x0678('0x9'));var path=require(_0x0678('0xa'));var sox=require(_0x0678('0xb'));var csv=require(_0x0678('0xc'));var ejs=require(_0x0678('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0678('0xe'));var crypto=require(_0x0678('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0678('0x10'));var toCsv=require(_0x0678('0xc'));var querystring=require(_0x0678('0x11'));var Papa=require(_0x0678('0x12'));var Redis=require('ioredis');var authService=require(_0x0678('0x13'));var qs=require(_0x0678('0x14'));var as=require(_0x0678('0x15'));var hardwareService=require(_0x0678('0x16'));var logger=require(_0x0678('0x17'))(_0x0678('0x18'));var utils=require(_0x0678('0x19'));var config=require(_0x0678('0x1a'));var db=require(_0x0678('0x1b'))['db'];function respondWithStatusCode(_0x414765,_0x12477f){_0x12477f=_0x12477f||0xcc;return function(_0x207d5d){if(_0x207d5d){return _0x414765[_0x0678('0x1c')](_0x12477f);}return _0x414765[_0x0678('0x1d')](_0x12477f)['end']();};}function respondWithResult(_0x59cf18,_0x2313e7){_0x2313e7=_0x2313e7||0xc8;return function(_0x2e7785){if(_0x2e7785){return _0x59cf18[_0x0678('0x1d')](_0x2313e7)[_0x0678('0x1e')](_0x2e7785);}};}function respondWithFilteredResult(_0x338f8e,_0x3a471a){return function(_0x3a7c3f){if(_0x3a7c3f){var _0x3eef3b=_0x3a7c3f['count'],_0xc3b64d=_0x3a471a[_0x0678('0x1f')],_0x4dc8ef=_0x3a471a[_0x0678('0x1f')]+_0x3a471a[_0x0678('0x20')],_0x2f2169;if(_0x4dc8ef>=_0x3eef3b){_0x4dc8ef=_0x3eef3b;_0x2f2169=0xc8;}else{_0x2f2169=0xce;}_0x338f8e[_0x0678('0x1d')](_0x2f2169);return _0x338f8e[_0x0678('0x21')](_0x0678('0x22'),_0xc3b64d+'-'+_0x4dc8ef+'/'+_0x3eef3b)['json'](_0x3a7c3f);}return null;};}function patchUpdates(_0x3c4d11){return function(_0x3d155c){try{jsonpatch['apply'](_0x3d155c,_0x3c4d11,!![]);}catch(_0x6e81ef){return BPromise[_0x0678('0x23')](_0x6e81ef);}return _0x3d155c[_0x0678('0x24')]();};}function saveUpdates(_0x1db11c,_0x75b939){return function(_0x440822){if(_0x440822){return _0x440822[_0x0678('0x25')](_0x1db11c)[_0x0678('0x26')](function(_0x351bed){return _0x351bed;});}return null;};}function removeEntity(_0x2432fb,_0x4f3843){return function(_0x29bd84){if(_0x29bd84){return _0x29bd84['destroy']()[_0x0678('0x26')](function(){_0x2432fb['status'](0xcc)[_0x0678('0x27')]();});}};}function handleEntityNotFound(_0x174080,_0x4ec997){return function(_0x4f59de){if(!_0x4f59de){_0x174080[_0x0678('0x1c')](0x194);}return _0x4f59de;};}function handleError(_0x347f81,_0x44a4a9){_0x44a4a9=_0x44a4a9||0x1f4;return function(_0xa7853b){logger['error'](_0xa7853b[_0x0678('0x28')]);if(_0xa7853b['name']){delete _0xa7853b[_0x0678('0x29')];}_0x347f81[_0x0678('0x1d')](_0x44a4a9)['send'](_0xa7853b);};}exports[_0x0678('0x2a')]=function(_0x50a5f5,_0x11c897){var _0x236556={},_0x48dcb9={},_0x1d2bb0={'count':0x0,'rows':[]};var _0x6855d6=_[_0x0678('0x2b')](db['UserProfileSection'][_0x0678('0x2c')],function(_0xaa69d4){return{'name':_0xaa69d4['fieldName'],'type':_0xaa69d4[_0x0678('0x2d')][_0x0678('0x2e')]};});_0x48dcb9[_0x0678('0x2f')]=_['map'](_0x6855d6,'name');_0x48dcb9[_0x0678('0x30')]=_[_0x0678('0x31')](_0x50a5f5[_0x0678('0x30')]);_0x48dcb9[_0x0678('0x32')]=_[_0x0678('0x33')](_0x48dcb9[_0x0678('0x2f')],_0x48dcb9[_0x0678('0x30')]);_0x236556['attributes']=_[_0x0678('0x33')](_0x48dcb9[_0x0678('0x2f')],qs['fields'](_0x50a5f5[_0x0678('0x30')]['fields']));_0x236556[_0x0678('0x34')]=_0x236556['attributes'][_0x0678('0x35')]?_0x236556['attributes']:_0x48dcb9[_0x0678('0x2f')];if(!_0x50a5f5['query']['hasOwnProperty'](_0x0678('0x36'))){_0x236556[_0x0678('0x20')]=qs['limit'](_0x50a5f5[_0x0678('0x30')][_0x0678('0x20')]);_0x236556[_0x0678('0x1f')]=qs['offset'](_0x50a5f5['query'][_0x0678('0x1f')]);}_0x236556[_0x0678('0x37')]=qs[_0x0678('0x38')](_0x50a5f5[_0x0678('0x30')][_0x0678('0x38')]);_0x236556[_0x0678('0x39')]=qs[_0x0678('0x32')](_['pick'](_0x50a5f5[_0x0678('0x30')],_0x48dcb9[_0x0678('0x32')]));if(_0x50a5f5['query'][_0x0678('0x3a')]){_0x236556[_0x0678('0x39')]=_[_0x0678('0x3b')](_0x236556[_0x0678('0x39')],{'$or':_[_0x0678('0x2b')](_0x6855d6,function(_0x1bc40f){if(_0x1bc40f[_0x0678('0x2d')]!==_0x0678('0x3c')){var _0x58546b={};_0x58546b[_0x1bc40f['name']]={'$like':'%'+_0x50a5f5['query']['filter']+'%'};return _0x58546b;}})});}_0x236556=_[_0x0678('0x3b')]({},_0x236556,_0x50a5f5[_0x0678('0x3d')]);var _0x250b22={'where':_0x236556[_0x0678('0x39')]};return db[_0x0678('0x3e')]['count'](_0x250b22)[_0x0678('0x26')](function(_0x25d31e){_0x1d2bb0[_0x0678('0x3f')]=_0x25d31e;if(_0x50a5f5[_0x0678('0x30')][_0x0678('0x40')]){_0x236556['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x0678('0x41')](_0x236556);})[_0x0678('0x26')](function(_0x1bf0a7){_0x1d2bb0[_0x0678('0x42')]=_0x1bf0a7;return _0x1d2bb0;})[_0x0678('0x26')](respondWithFilteredResult(_0x11c897,_0x236556))[_0x0678('0x43')](handleError(_0x11c897,null));};exports['show']=function(_0x1aa508,_0xcc7b97){var _0x5eabb0={'raw':![],'where':{'id':_0x1aa508['params']['id']}},_0x4c22fe={};_0x4c22fe[_0x0678('0x2f')]=_['keys'](db[_0x0678('0x3e')]['rawAttributes']);_0x4c22fe[_0x0678('0x30')]=_[_0x0678('0x31')](_0x1aa508[_0x0678('0x30')]);_0x4c22fe[_0x0678('0x32')]=_[_0x0678('0x33')](_0x4c22fe['model'],_0x4c22fe[_0x0678('0x30')]);_0x5eabb0[_0x0678('0x34')]=_[_0x0678('0x33')](_0x4c22fe['model'],qs[_0x0678('0x44')](_0x1aa508[_0x0678('0x30')][_0x0678('0x44')]));_0x5eabb0[_0x0678('0x34')]=_0x5eabb0[_0x0678('0x34')][_0x0678('0x35')]?_0x5eabb0[_0x0678('0x34')]:_0x4c22fe[_0x0678('0x2f')];if(_0x1aa508[_0x0678('0x30')][_0x0678('0x40')]){_0x5eabb0[_0x0678('0x45')]=[{'all':!![]}];}_0x5eabb0=_['merge']({},_0x5eabb0,_0x1aa508[_0x0678('0x3d')]);return db[_0x0678('0x3e')][_0x0678('0x46')](_0x5eabb0)[_0x0678('0x26')](handleEntityNotFound(_0xcc7b97,null))[_0x0678('0x26')](respondWithResult(_0xcc7b97,null))['catch'](handleError(_0xcc7b97,null));};exports[_0x0678('0x47')]=function(_0x4fed09,_0xbf7ad2){return db[_0x0678('0x3e')][_0x0678('0x47')](_0x4fed09['body'],{})[_0x0678('0x26')](respondWithResult(_0xbf7ad2,0xc9))['catch'](handleError(_0xbf7ad2,null));};exports[_0x0678('0x25')]=function(_0x543bf8,_0x1d0cdf){if(_0x543bf8[_0x0678('0x48')]['id']){delete _0x543bf8[_0x0678('0x48')]['id'];}return db[_0x0678('0x3e')]['find']({'where':{'id':_0x543bf8[_0x0678('0x49')]['id']}})[_0x0678('0x26')](handleEntityNotFound(_0x1d0cdf,null))[_0x0678('0x26')](saveUpdates(_0x543bf8['body'],null))[_0x0678('0x26')](respondWithResult(_0x1d0cdf,null))['catch'](handleError(_0x1d0cdf,null));};exports['destroy']=function(_0x14081e,_0x4995c2){return db[_0x0678('0x3e')][_0x0678('0x46')]({'where':{'id':_0x14081e[_0x0678('0x49')]['id']}})[_0x0678('0x26')](handleEntityNotFound(_0x4995c2,null))['then'](removeEntity(_0x4995c2,null))[_0x0678('0x43')](handleError(_0x4995c2,null));};exports['describe']=function(_0x5c893d,_0x12926d){return db[_0x0678('0x3e')][_0x0678('0x4a')]()[_0x0678('0x26')](respondWithResult(_0x12926d,null))[_0x0678('0x43')](handleError(_0x12926d,null));}; \ No newline at end of file +var _0xc402=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','UserProfileSection','findAll','rows','show','params','keys','length','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x400f2a,_0x52a559){var _0x3dd8d1=function(_0x12d129){while(--_0x12d129){_0x400f2a['push'](_0x400f2a['shift']());}};_0x3dd8d1(++_0x52a559);}(_0xc402,0xd8));var _0x2c40=function(_0x119c04,_0x3b138a){_0x119c04=_0x119c04-0x0;var _0x19fc31=_0xc402[_0x119c04];return _0x19fc31;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2c40('0x0'));var rimraf=require(_0x2c40('0x1'));var zipdir=require(_0x2c40('0x2'));var jsonpatch=require(_0x2c40('0x3'));var rp=require(_0x2c40('0x4'));var moment=require(_0x2c40('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c40('0x6'));var util=require(_0x2c40('0x7'));var path=require(_0x2c40('0x8'));var sox=require(_0x2c40('0x9'));var csv=require(_0x2c40('0xa'));var ejs=require(_0x2c40('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2c40('0xc'));var crypto=require(_0x2c40('0xd'));var jsforce=require(_0x2c40('0xe'));var deskjs=require(_0x2c40('0xf'));var toCsv=require(_0x2c40('0xa'));var querystring=require(_0x2c40('0x10'));var Papa=require(_0x2c40('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2c40('0x12'));var hardwareService=require(_0x2c40('0x13'));var logger=require(_0x2c40('0x14'))(_0x2c40('0x15'));var utils=require(_0x2c40('0x16'));var config=require(_0x2c40('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371547,_0x471f43){_0x471f43=_0x471f43||0xcc;return function(_0x2126c7){if(_0x2126c7){return _0x371547[_0x2c40('0x18')](_0x471f43);}return _0x371547['status'](_0x471f43)[_0x2c40('0x19')]();};}function respondWithResult(_0x291b25,_0x4b54ef){_0x4b54ef=_0x4b54ef||0xc8;return function(_0x297018){if(_0x297018){return _0x291b25[_0x2c40('0x1a')](_0x4b54ef)[_0x2c40('0x1b')](_0x297018);}};}function respondWithFilteredResult(_0xd8f81c,_0xd0d2c5){return function(_0x24d906){if(_0x24d906){var _0x54256a=_0x24d906[_0x2c40('0x1c')],_0x256bc0=_0xd0d2c5[_0x2c40('0x1d')],_0xeb7ee1=_0xd0d2c5['offset']+_0xd0d2c5[_0x2c40('0x1e')],_0x5c5651;if(_0xeb7ee1>=_0x54256a){_0xeb7ee1=_0x54256a;_0x5c5651=0xc8;}else{_0x5c5651=0xce;}_0xd8f81c[_0x2c40('0x1a')](_0x5c5651);return _0xd8f81c[_0x2c40('0x1f')](_0x2c40('0x20'),_0x256bc0+'-'+_0xeb7ee1+'/'+_0x54256a)['json'](_0x24d906);}return null;};}function patchUpdates(_0x16a095){return function(_0x112cb4){try{jsonpatch[_0x2c40('0x21')](_0x112cb4,_0x16a095,!![]);}catch(_0x49a31e){return BPromise['reject'](_0x49a31e);}return _0x112cb4[_0x2c40('0x22')]();};}function saveUpdates(_0x59053c,_0x200c6e){return function(_0x1e6d4b){if(_0x1e6d4b){return _0x1e6d4b[_0x2c40('0x23')](_0x59053c)[_0x2c40('0x24')](function(_0x5344e5){return _0x5344e5;});}return null;};}function removeEntity(_0x11ae3e,_0x3f18f5){return function(_0x248fbc){if(_0x248fbc){return _0x248fbc[_0x2c40('0x25')]()[_0x2c40('0x24')](function(){_0x11ae3e[_0x2c40('0x1a')](0xcc)[_0x2c40('0x19')]();});}};}function handleEntityNotFound(_0x146e6d,_0x37d74a){return function(_0x7195fe){if(!_0x7195fe){_0x146e6d[_0x2c40('0x18')](0x194);}return _0x7195fe;};}function handleError(_0x4f9975,_0x2230ad){_0x2230ad=_0x2230ad||0x1f4;return function(_0x30e741){logger['error'](_0x30e741[_0x2c40('0x26')]);if(_0x30e741[_0x2c40('0x27')]){delete _0x30e741[_0x2c40('0x27')];}_0x4f9975[_0x2c40('0x1a')](_0x2230ad)[_0x2c40('0x28')](_0x30e741);};}exports[_0x2c40('0x29')]=function(_0x98db34,_0x3e0623){var _0x342d67={},_0x33fca6={},_0x2b498f={'count':0x0,'rows':[]};var _0x51961d=_[_0x2c40('0x2a')](db['UserProfileSection'][_0x2c40('0x2b')],function(_0x488fb8){return{'name':_0x488fb8[_0x2c40('0x2c')],'type':_0x488fb8['type'][_0x2c40('0x2d')]};});_0x33fca6[_0x2c40('0x2e')]=_[_0x2c40('0x2a')](_0x51961d,_0x2c40('0x27'));_0x33fca6[_0x2c40('0x2f')]=_['keys'](_0x98db34['query']);_0x33fca6[_0x2c40('0x30')]=_[_0x2c40('0x31')](_0x33fca6['model'],_0x33fca6[_0x2c40('0x2f')]);_0x342d67[_0x2c40('0x32')]=_['intersection'](_0x33fca6[_0x2c40('0x2e')],qs[_0x2c40('0x33')](_0x98db34[_0x2c40('0x2f')]['fields']));_0x342d67[_0x2c40('0x32')]=_0x342d67[_0x2c40('0x32')]['length']?_0x342d67[_0x2c40('0x32')]:_0x33fca6[_0x2c40('0x2e')];if(!_0x98db34[_0x2c40('0x2f')][_0x2c40('0x34')](_0x2c40('0x35'))){_0x342d67[_0x2c40('0x1e')]=qs[_0x2c40('0x1e')](_0x98db34[_0x2c40('0x2f')][_0x2c40('0x1e')]);_0x342d67[_0x2c40('0x1d')]=qs[_0x2c40('0x1d')](_0x98db34[_0x2c40('0x2f')][_0x2c40('0x1d')]);}_0x342d67[_0x2c40('0x36')]=qs[_0x2c40('0x37')](_0x98db34[_0x2c40('0x2f')]['sort']);_0x342d67[_0x2c40('0x38')]=qs[_0x2c40('0x30')](_['pick'](_0x98db34[_0x2c40('0x2f')],_0x33fca6[_0x2c40('0x30')]));if(_0x98db34['query'][_0x2c40('0x39')]){_0x342d67[_0x2c40('0x38')]=_[_0x2c40('0x3a')](_0x342d67[_0x2c40('0x38')],{'$or':_['map'](_0x51961d,function(_0xafa089){if(_0xafa089[_0x2c40('0x3b')]!==_0x2c40('0x3c')){var _0x2f573a={};_0x2f573a[_0xafa089['name']]={'$like':'%'+_0x98db34[_0x2c40('0x2f')]['filter']+'%'};return _0x2f573a;}})});}_0x342d67=_[_0x2c40('0x3a')]({},_0x342d67,_0x98db34[_0x2c40('0x3d')]);var _0x33340e={'where':_0x342d67['where']};return db['UserProfileSection']['count'](_0x33340e)[_0x2c40('0x24')](function(_0x1fa38a){_0x2b498f[_0x2c40('0x1c')]=_0x1fa38a;if(_0x98db34[_0x2c40('0x2f')][_0x2c40('0x3e')]){_0x342d67[_0x2c40('0x3f')]=[{'all':!![]}];}return db[_0x2c40('0x40')][_0x2c40('0x41')](_0x342d67);})[_0x2c40('0x24')](function(_0x48645a){_0x2b498f[_0x2c40('0x42')]=_0x48645a;return _0x2b498f;})[_0x2c40('0x24')](respondWithFilteredResult(_0x3e0623,_0x342d67))['catch'](handleError(_0x3e0623,null));};exports[_0x2c40('0x43')]=function(_0x37b860,_0x2d6750){var _0x5366c2={'raw':![],'where':{'id':_0x37b860[_0x2c40('0x44')]['id']}},_0x2aac6b={};_0x2aac6b[_0x2c40('0x2e')]=_[_0x2c40('0x45')](db[_0x2c40('0x40')][_0x2c40('0x2b')]);_0x2aac6b[_0x2c40('0x2f')]=_[_0x2c40('0x45')](_0x37b860['query']);_0x2aac6b[_0x2c40('0x30')]=_['intersection'](_0x2aac6b[_0x2c40('0x2e')],_0x2aac6b[_0x2c40('0x2f')]);_0x5366c2[_0x2c40('0x32')]=_[_0x2c40('0x31')](_0x2aac6b['model'],qs[_0x2c40('0x33')](_0x37b860[_0x2c40('0x2f')][_0x2c40('0x33')]));_0x5366c2[_0x2c40('0x32')]=_0x5366c2['attributes'][_0x2c40('0x46')]?_0x5366c2[_0x2c40('0x32')]:_0x2aac6b[_0x2c40('0x2e')];if(_0x37b860['query']['includeAll']){_0x5366c2['include']=[{'all':!![]}];}_0x5366c2=_[_0x2c40('0x3a')]({},_0x5366c2,_0x37b860[_0x2c40('0x3d')]);return db[_0x2c40('0x40')]['find'](_0x5366c2)['then'](handleEntityNotFound(_0x2d6750,null))['then'](respondWithResult(_0x2d6750,null))[_0x2c40('0x47')](handleError(_0x2d6750,null));};exports[_0x2c40('0x48')]=function(_0x3b21b2,_0x1dfa67){return db[_0x2c40('0x40')][_0x2c40('0x48')](_0x3b21b2[_0x2c40('0x49')],{})['then'](respondWithResult(_0x1dfa67,0xc9))['catch'](handleError(_0x1dfa67,null));};exports[_0x2c40('0x23')]=function(_0x585afb,_0x1aa8f7){if(_0x585afb['body']['id']){delete _0x585afb[_0x2c40('0x49')]['id'];}return db['UserProfileSection'][_0x2c40('0x4a')]({'where':{'id':_0x585afb[_0x2c40('0x44')]['id']}})['then'](handleEntityNotFound(_0x1aa8f7,null))[_0x2c40('0x24')](saveUpdates(_0x585afb[_0x2c40('0x49')],null))[_0x2c40('0x24')](respondWithResult(_0x1aa8f7,null))[_0x2c40('0x47')](handleError(_0x1aa8f7,null));};exports[_0x2c40('0x25')]=function(_0x5186a2,_0x43cb97){return db['UserProfileSection'][_0x2c40('0x4a')]({'where':{'id':_0x5186a2[_0x2c40('0x44')]['id']}})[_0x2c40('0x24')](handleEntityNotFound(_0x43cb97,null))[_0x2c40('0x24')](removeEntity(_0x43cb97,null))['catch'](handleError(_0x43cb97,null));};exports[_0x2c40('0x4b')]=function(_0x39dd7c,_0x4e1b3a){return db[_0x2c40('0x40')][_0x2c40('0x4b')]()[_0x2c40('0x24')](respondWithResult(_0x4e1b3a,null))[_0x2c40('0x47')](handleError(_0x4e1b3a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index dc32f96..8171c41 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 _0xc6b8=['sectionId','userProfileId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x591c67,_0x1f2d0b){var _0x243313=function(_0xd7680e){while(--_0xd7680e){_0x591c67['push'](_0x591c67['shift']());}};_0x243313(++_0x1f2d0b);}(_0xc6b8,0x162));var _0x8c6b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc6b8[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8c6b('0x0'));var util=require('util');var logger=require(_0x8c6b('0x1'))(_0x8c6b('0x2'));var moment=require('moment');var BPromise=require(_0x8c6b('0x3'));var rp=require(_0x8c6b('0x4'));var fs=require('fs');var path=require(_0x8c6b('0x5'));var rimraf=require(_0x8c6b('0x6'));var config=require(_0x8c6b('0x7'));var attributes=require(_0x8c6b('0x8'));module[_0x8c6b('0x9')]=function(_0x35decc,_0x22c144){return _0x35decc[_0x8c6b('0xa')](_0x8c6b('0xb'),attributes,{'tableName':_0x8c6b('0xc'),'paranoid':![],'indexes':[{'name':_0x8c6b('0xd'),'fields':[_0x8c6b('0xe'),_0x8c6b('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9f5=['util','../../config/logger','moment','path','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','lodash'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xd9f5,0x83));var _0x5d9f=function(_0x4f32de,_0x5bd4a){_0x4f32de=_0x4f32de-0x0;var _0x149821=_0xd9f5[_0x4f32de];return _0x149821;};'use strict';var _=require(_0x5d9f('0x0'));var util=require(_0x5d9f('0x1'));var logger=require(_0x5d9f('0x2'))('api');var moment=require(_0x5d9f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d9f('0x4'));var rimraf=require('rimraf');var config=require(_0x5d9f('0x5'));var attributes=require('./userProfileSection.attributes');module[_0x5d9f('0x6')]=function(_0x2bd76d,_0x313c38){return _0x2bd76d[_0x5d9f('0x7')](_0x5d9f('0x8'),attributes,{'tableName':_0x5d9f('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x5d9f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index d925ea5..f46e6ab 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 _0xd38a=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x421bc2,_0x574b53){var _0x3a6266=function(_0x5a5e8b){while(--_0x5a5e8b){_0x421bc2['push'](_0x421bc2['shift']());}};_0x3a6266(++_0x574b53);}(_0xd38a,0x1aa));var _0xad38=function(_0x4de54e,_0x5f0d2e){_0x4de54e=_0x4de54e-0x0;var _0x114f2c=_0xd38a[_0x4de54e];return _0x114f2c;};'use strict';var _=require('lodash');var util=require(_0xad38('0x0'));var moment=require(_0xad38('0x1'));var BPromise=require(_0xad38('0x2'));var rs=require(_0xad38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad38('0x4'))['db'];var utils=require(_0xad38('0x5'));var logger=require('../../config/logger')(_0xad38('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad38('0x7')][_0xad38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4126c3,_0x2a9fd2,_0x5b9761){return new BPromise(function(_0xf46d4a,_0x1755a5){return client[_0xad38('0x9')](_0x4126c3,_0x5b9761)[_0xad38('0xa')](function(_0x4d1b5f){logger[_0xad38('0xb')](_0xad38('0xc'),_0x2a9fd2,_0xad38('0xd'));logger['debug'](_0xad38('0xe'),_0x2a9fd2,'request\x20sent',JSON[_0xad38('0xf')](_0x4d1b5f));if(_0x4d1b5f[_0xad38('0x10')]){if(_0x4d1b5f['error'][_0xad38('0x11')]===0x1f4){logger[_0xad38('0x10')](_0xad38('0xc'),_0x2a9fd2,_0x4d1b5f[_0xad38('0x10')][_0xad38('0x12')]);return _0x1755a5(_0x4d1b5f[_0xad38('0x10')][_0xad38('0x12')]);}logger[_0xad38('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x2a9fd2,_0x4d1b5f['error'][_0xad38('0x12')]);return _0xf46d4a(_0x4d1b5f[_0xad38('0x10')][_0xad38('0x12')]);}else{logger[_0xad38('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x2a9fd2,'request\x20sent');_0xf46d4a(_0x4d1b5f[_0xad38('0x13')][_0xad38('0x12')]);}})[_0xad38('0x14')](function(_0x313950){logger[_0xad38('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x2a9fd2,_0x313950);_0x1755a5(_0x313950);});});} \ No newline at end of file +var _0xb891=['request\x20sent','error','code','result','message','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x52b6cd,_0x3db842){var _0x4998df=function(_0x58276a){while(--_0x58276a){_0x52b6cd['push'](_0x52b6cd['shift']());}};_0x4998df(++_0x3db842);}(_0xb891,0x18d));var _0x1b89=function(_0x2be30b,_0x362c2c){_0x2be30b=_0x2be30b-0x0;var _0x5c92c3=_0xb891[_0x2be30b];return _0x5c92c3;};'use strict';var _=require(_0x1b89('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b89('0x1'));var fs=require('fs');var Redis=require(_0x1b89('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b89('0x3'));var logger=require(_0x1b89('0x4'))(_0x1b89('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3832eb,_0x45d28b,_0x44d985){return new BPromise(function(_0x37f7eb,_0x6aa766){return client['request'](_0x3832eb,_0x44d985)[_0x1b89('0x6')](function(_0x31e640){logger[_0x1b89('0x7')](_0x1b89('0x8'),_0x45d28b,'request\x20sent');logger[_0x1b89('0x9')](_0x1b89('0xa'),_0x45d28b,_0x1b89('0xb'),JSON['stringify'](_0x31e640));if(_0x31e640['error']){if(_0x31e640[_0x1b89('0xc')][_0x1b89('0xd')]===0x1f4){logger['error'](_0x1b89('0x8'),_0x45d28b,_0x31e640['error']['message']);return _0x6aa766(_0x31e640[_0x1b89('0xc')]['message']);}logger[_0x1b89('0xc')](_0x1b89('0x8'),_0x45d28b,_0x31e640['error']['message']);return _0x37f7eb(_0x31e640[_0x1b89('0xc')]['message']);}else{logger['info'](_0x1b89('0x8'),_0x45d28b,_0x1b89('0xb'));_0x37f7eb(_0x31e640[_0x1b89('0xe')][_0x1b89('0xf')]);}})[_0x1b89('0x10')](function(_0x35df96){logger[_0x1b89('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x45d28b,_0x35df96);_0x6aa766(_0x35df96);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index dc4cce3..fc04180 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 _0x718b=['multer','express','Router','../../config/environment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x718b,0xb4));var _0xb718=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x718b[_0x14a862];return _0x245eb5;};'use strict';var multer=require(_0xb718('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb718('0x1'));var router=express[_0xb718('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb718('0x3'));module[_0xb718('0x4')]=router; \ No newline at end of file +var _0x484b=['../../components/interaction/service','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0xe9ba8b,_0x1e44a6){var _0x518952=function(_0x2b87f2){while(--_0x2b87f2){_0xe9ba8b['push'](_0xe9ba8b['shift']());}};_0x518952(++_0x1e44a6);}(_0x484b,0x104));var _0xb484=function(_0x1462c5,_0xba4d60){_0x1462c5=_0x1462c5-0x0;var _0x304c81=_0x484b[_0x1462c5];return _0x304c81;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb484('0x0'));var timeout=require(_0xb484('0x1'));var express=require(_0xb484('0x2'));var router=express['Router']();var auth=require(_0xb484('0x3'));var interaction=require(_0xb484('0x4'));var config=require('../../config/environment');module[_0xb484('0x5')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 51c7921..f97aca2 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 _0xd8b0=['exports','sequelize'];(function(_0x45dafe,_0x9ff797){var _0x5e7f7e=function(_0x1b6d36){while(--_0x1b6d36){_0x45dafe['push'](_0x45dafe['shift']());}};_0x5e7f7e(++_0x9ff797);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x12db6a,_0x327366){var _0x7dd50=function(_0x278367){while(--_0x278367){_0x12db6a['push'](_0x12db6a['shift']());}};_0x7dd50(++_0x327366);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index bdf0801..de20982 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 _0x051d=['UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define'];(function(_0x33a47b,_0x25022a){var _0x3164d0=function(_0x1f070f){while(--_0x1f070f){_0x33a47b['push'](_0x33a47b['shift']());}};_0x3164d0(++_0x25022a);}(_0x051d,0x10a));var _0xd051=function(_0x112929,_0x7da466){_0x112929=_0x112929-0x0;var _0x333c16=_0x051d[_0x112929];return _0x333c16;};'use strict';var _=require(_0xd051('0x0'));var util=require(_0xd051('0x1'));var logger=require(_0xd051('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd051('0x3'));var rp=require(_0xd051('0x4'));var fs=require('fs');var path=require(_0xd051('0x5'));var rimraf=require(_0xd051('0x6'));var config=require('../../config/environment');var attributes=require(_0xd051('0x7'));module[_0xd051('0x8')]=function(_0x47d9b4,_0x262ab6){return _0x47d9b4[_0xd051('0x9')](_0xd051('0xa'),attributes,{'tableName':_0xd051('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb462=['request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','moment','bluebird'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xb462,0x158));var _0x2b46=function(_0x305ac5,_0x5f025e){_0x305ac5=_0x305ac5-0x0;var _0x587c56=_0xb462[_0x305ac5];return _0x587c56;};'use strict';var _=require('lodash');var util=require(_0x2b46('0x0'));var logger=require(_0x2b46('0x1'))('api');var moment=require(_0x2b46('0x2'));var BPromise=require(_0x2b46('0x3'));var rp=require(_0x2b46('0x4'));var fs=require('fs');var path=require(_0x2b46('0x5'));var rimraf=require('rimraf');var config=require(_0x2b46('0x6'));var attributes=require(_0x2b46('0x7'));module[_0x2b46('0x8')]=function(_0x4e19ce,_0x4a7705){return _0x4e19ce[_0x2b46('0x9')](_0x2b46('0xa'),attributes,{'tableName':_0x2b46('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 f789cda..b6c6e81 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 _0xecbd=['UserSmsQueue,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','request\x20sent','debug','error','message'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0xecbd,0x16b));var _0xdecb=function(_0x261418,_0xa7fa05){_0x261418=_0x261418-0x0;var _0xdd4d9d=_0xecbd[_0x261418];return _0xdd4d9d;};'use strict';var _=require(_0xdecb('0x0'));var util=require(_0xdecb('0x1'));var moment=require(_0xdecb('0x2'));var BPromise=require(_0xdecb('0x3'));var rs=require(_0xdecb('0x4'));var fs=require('fs');var Redis=require(_0xdecb('0x5'));var db=require(_0xdecb('0x6'))['db'];var utils=require(_0xdecb('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdecb('0x8'));var client=jayson[_0xdecb('0x9')][_0xdecb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x101c0a,_0x594275,_0x171a9c){return new BPromise(function(_0x5d0cdf,_0x5141ac){return client[_0xdecb('0xb')](_0x101c0a,_0x171a9c)[_0xdecb('0xc')](function(_0x15cce4){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x594275,_0xdecb('0xd'));logger[_0xdecb('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x594275,_0xdecb('0xd'),JSON['stringify'](_0x15cce4));if(_0x15cce4[_0xdecb('0xf')]){if(_0x15cce4['error']['code']===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x594275,_0x15cce4[_0xdecb('0xf')][_0xdecb('0x10')]);return _0x5141ac(_0x15cce4[_0xdecb('0xf')]['message']);}logger[_0xdecb('0xf')](_0xdecb('0x11'),_0x594275,_0x15cce4[_0xdecb('0xf')][_0xdecb('0x10')]);return _0x5d0cdf(_0x15cce4[_0xdecb('0xf')][_0xdecb('0x10')]);}else{logger[_0xdecb('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x594275,'request\x20sent');_0x5d0cdf(_0x15cce4[_0xdecb('0x13')][_0xdecb('0x10')]);}})['catch'](function(_0x34d223){logger[_0xdecb('0xf')](_0xdecb('0x11'),_0x594275,_0x34d223);_0x5141ac(_0x34d223);});});} \ No newline at end of file +var _0x2bb7=['jayson/promise','client','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment'];(function(_0x53c552,_0x129587){var _0x599000=function(_0x519b95){while(--_0x519b95){_0x53c552['push'](_0x53c552['shift']());}};_0x599000(++_0x129587);}(_0x2bb7,0x15e));var _0x72bb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2bb7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x72bb('0x0'));var util=require(_0x72bb('0x1'));var moment=require(_0x72bb('0x2'));var BPromise=require(_0x72bb('0x3'));var rs=require(_0x72bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x72bb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x72bb('0x6'));var jayson=require(_0x72bb('0x7'));var client=jayson[_0x72bb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfa3557,_0x549ff5,_0x3d4aea){return new BPromise(function(_0x37b903,_0x28cd9d){return client[_0x72bb('0x9')](_0xfa3557,_0x3d4aea)['then'](function(_0x15161c){logger[_0x72bb('0xa')](_0x72bb('0xb'),_0x549ff5,_0x72bb('0xc'));logger[_0x72bb('0xd')](_0x72bb('0xe'),_0x549ff5,'request\x20sent',JSON[_0x72bb('0xf')](_0x15161c));if(_0x15161c[_0x72bb('0x10')]){if(_0x15161c[_0x72bb('0x10')][_0x72bb('0x11')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x549ff5,_0x15161c[_0x72bb('0x10')][_0x72bb('0x12')]);return _0x28cd9d(_0x15161c[_0x72bb('0x10')]['message']);}logger['error'](_0x72bb('0xb'),_0x549ff5,_0x15161c[_0x72bb('0x10')][_0x72bb('0x12')]);return _0x37b903(_0x15161c[_0x72bb('0x10')][_0x72bb('0x12')]);}else{logger[_0x72bb('0xa')](_0x72bb('0xb'),_0x549ff5,'request\x20sent');_0x37b903(_0x15161c[_0x72bb('0x13')][_0x72bb('0x12')]);}})[_0x72bb('0x14')](function(_0x5a4a00){logger[_0x72bb('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x549ff5,_0x5a4a00);_0x28cd9d(_0x5a4a00);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index a03c3de..21152d5 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 _0xa1ba=['path','express','../../components/auth/service','exports','multer','util'];(function(_0x2de56a,_0x2a0373){var _0x39cfab=function(_0x1b3441){while(--_0x1b3441){_0x2de56a['push'](_0x2de56a['shift']());}};_0x39cfab(++_0x2a0373);}(_0xa1ba,0x64));var _0xaa1b=function(_0x21c3e8,_0x3bad1a){_0x21c3e8=_0x21c3e8-0x0;var _0x11919b=_0xa1ba[_0x21c3e8];return _0x11919b;};'use strict';var multer=require(_0xaa1b('0x0'));var util=require(_0xaa1b('0x1'));var path=require(_0xaa1b('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa1b('0x3'));var router=express['Router']();var auth=require(_0xaa1b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xaa1b('0x5')]=router; \ No newline at end of file +var _0x438b=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x438b,0x1d9));var _0xb438=function(_0x58ae54,_0x400931){_0x58ae54=_0x58ae54-0x0;var _0x3ec352=_0x438b[_0x58ae54];return _0x3ec352;};'use strict';var multer=require(_0xb438('0x0'));var util=require(_0xb438('0x1'));var path=require(_0xb438('0x2'));var timeout=require(_0xb438('0x3'));var express=require(_0xb438('0x4'));var router=express['Router']();var auth=require(_0xb438('0x5'));var interaction=require(_0xb438('0x6'));var config=require(_0xb438('0x7'));module[_0xb438('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index be9ffd4..baf4aa0 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 _0xb10b=['sequelize','INTEGER'];(function(_0xd0d34f,_0x1d74ca){var _0x28c23f=function(_0x1e3ef0){while(--_0x1e3ef0){_0xd0d34f['push'](_0xd0d34f['shift']());}};_0x28c23f(++_0x1d74ca);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0xb10b[_0x1d87fc];return _0x492b56;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb10b=['sequelize','INTEGER'];(function(_0x18fed9,_0x16c084){var _0x46e3d5=function(_0x2fadf5){while(--_0x2fadf5){_0x18fed9['push'](_0x18fed9['shift']());}};_0x46e3d5(++_0x16c084);}(_0xb10b,0x12a));var _0xbb10=function(_0x91e24e,_0x2eddb3){_0x91e24e=_0x91e24e-0x0;var _0x642ebd=_0xb10b[_0x91e24e];return _0x642ebd;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index e9a8e16..126073e 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 _0xe5b3=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x5bd4f6,_0xf4e45c){var _0x33a165=function(_0x37eef6){while(--_0x37eef6){_0x5bd4f6['push'](_0x5bd4f6['shift']());}};_0x33a165(++_0xf4e45c);}(_0xe5b3,0x133));var _0x3e5b=function(_0x55ce83,_0x25758e){_0x55ce83=_0x55ce83-0x0;var _0x43a7cc=_0xe5b3[_0x55ce83];return _0x43a7cc;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('UserVoiceQueue',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue'];(function(_0x4f1ef3,_0x78908){var _0x1cbd8b=function(_0x3ee954){while(--_0x3ee954){_0x4f1ef3['push'](_0x4f1ef3['shift']());}};_0x1cbd8b(++_0x78908);}(_0x99e9,0xb4));var _0x999e=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0x99e9[_0x281e5e];return _0x5a22d2;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),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 70bc83a..2eba2f2 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 _0xec41=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec41,0x7c));var _0x1ec4=function(_0xe96487,_0x36c816){_0xe96487=_0xe96487-0x0;var _0x500779=_0xec41[_0xe96487];return _0x500779;};'use strict';var _=require(_0x1ec4('0x0'));var util=require(_0x1ec4('0x1'));var moment=require(_0x1ec4('0x2'));var BPromise=require(_0x1ec4('0x3'));var rs=require(_0x1ec4('0x4'));var fs=require('fs');var Redis=require(_0x1ec4('0x5'));var db=require(_0x1ec4('0x6'))['db'];var utils=require(_0x1ec4('0x7'));var logger=require('../../config/logger')(_0x1ec4('0x8'));var config=require(_0x1ec4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1ec4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x159a6a,_0x1e3870,_0x4cbfef){return new BPromise(function(_0x1ddb23,_0xb44bb5){return client[_0x1ec4('0xb')](_0x159a6a,_0x4cbfef)[_0x1ec4('0xc')](function(_0x20a35b){logger[_0x1ec4('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x1e3870,_0x1ec4('0xe'));logger[_0x1ec4('0xf')](_0x1ec4('0x10'),_0x1e3870,_0x1ec4('0xe'),JSON['stringify'](_0x20a35b));if(_0x20a35b[_0x1ec4('0x11')]){if(_0x20a35b[_0x1ec4('0x11')][_0x1ec4('0x12')]===0x1f4){logger[_0x1ec4('0x11')](_0x1ec4('0x13'),_0x1e3870,_0x20a35b[_0x1ec4('0x11')][_0x1ec4('0x14')]);return _0xb44bb5(_0x20a35b[_0x1ec4('0x11')]['message']);}logger[_0x1ec4('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x1e3870,_0x20a35b[_0x1ec4('0x11')][_0x1ec4('0x14')]);return _0x1ddb23(_0x20a35b['error'][_0x1ec4('0x14')]);}else{logger[_0x1ec4('0xd')](_0x1ec4('0x13'),_0x1e3870,_0x1ec4('0xe'));_0x1ddb23(_0x20a35b[_0x1ec4('0x15')][_0x1ec4('0x14')]);}})[_0x1ec4('0x16')](function(_0x361dd0){logger[_0x1ec4('0x11')](_0x1ec4('0x13'),_0x1e3870,_0x361dd0);_0xb44bb5(_0x361dd0);});});} \ No newline at end of file +var _0x8413=['info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x27acaa,_0x4918bd){var _0x4d0b67=function(_0x7d728e){while(--_0x7d728e){_0x27acaa['push'](_0x27acaa['shift']());}};_0x4d0b67(++_0x4918bd);}(_0x8413,0x10b));var _0x3841=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x8413[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x3841('0x0'));var util=require(_0x3841('0x1'));var moment=require(_0x3841('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3841('0x3'))['db'];var utils=require(_0x3841('0x4'));var logger=require(_0x3841('0x5'))(_0x3841('0x6'));var config=require(_0x3841('0x7'));var jayson=require(_0x3841('0x8'));var client=jayson[_0x3841('0x9')][_0x3841('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4064d0,_0x30405d,_0x3cb850){return new BPromise(function(_0x51fb94,_0x479318){return client[_0x3841('0xb')](_0x4064d0,_0x3cb850)[_0x3841('0xc')](function(_0x453b65){logger[_0x3841('0xd')](_0x3841('0xe'),_0x30405d,'request\x20sent');logger[_0x3841('0xf')](_0x3841('0x10'),_0x30405d,'request\x20sent',JSON['stringify'](_0x453b65));if(_0x453b65['error']){if(_0x453b65[_0x3841('0x11')]['code']===0x1f4){logger[_0x3841('0x11')](_0x3841('0xe'),_0x30405d,_0x453b65[_0x3841('0x11')][_0x3841('0x12')]);return _0x479318(_0x453b65[_0x3841('0x11')][_0x3841('0x12')]);}logger[_0x3841('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x30405d,_0x453b65[_0x3841('0x11')]['message']);return _0x51fb94(_0x453b65[_0x3841('0x11')][_0x3841('0x12')]);}else{logger[_0x3841('0xd')](_0x3841('0xe'),_0x30405d,'request\x20sent');_0x51fb94(_0x453b65[_0x3841('0x13')][_0x3841('0x12')]);}})['catch'](function(_0x5e7006){logger[_0x3841('0x11')](_0x3841('0xe'),_0x30405d,_0x5e7006);_0x479318(_0x5e7006);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 006c9f5..57e8694 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 _0x8381=['multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x96bc09,_0x177730){var _0x817943=function(_0x12d5bc){while(--_0x12d5bc){_0x96bc09['push'](_0x96bc09['shift']());}};_0x817943(++_0x177730);}(_0x8381,0xd8));var _0x1838=function(_0x3e2f7e,_0x2830b1){_0x3e2f7e=_0x3e2f7e-0x0;var _0x3e315b=_0x8381[_0x3e2f7e];return _0x3e315b;};'use strict';var multer=require(_0x1838('0x0'));var util=require(_0x1838('0x1'));var path=require('path');var timeout=require(_0x1838('0x2'));var express=require('express');var router=express[_0x1838('0x3')]();var auth=require(_0x1838('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1838('0x5'));module['exports']=router; \ No newline at end of file +var _0xe520=['../../components/auth/service','exports','multer','path','connect-timeout','express'];(function(_0x1b64fd,_0x4425c5){var _0xc32105=function(_0x3d54a6){while(--_0x3d54a6){_0x1b64fd['push'](_0x1b64fd['shift']());}};_0xc32105(++_0x4425c5);}(_0xe520,0x1b2));var _0x0e52=function(_0x46b72d,_0x129db3){_0x46b72d=_0x46b72d-0x0;var _0x47169b=_0xe520[_0x46b72d];return _0x47169b;};'use strict';var multer=require(_0x0e52('0x0'));var util=require('util');var path=require(_0x0e52('0x1'));var timeout=require(_0x0e52('0x2'));var express=require(_0x0e52('0x3'));var router=express['Router']();var auth=require(_0x0e52('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x0e52('0x5')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index e049c4a..65f287e 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 _0xe12d=['sequelize','exports','Required\x20by\x20Asterisk','INTEGER','STRING','queue_interface'];(function(_0x4b3482,_0x393473){var _0x3db199=function(_0x363374){while(--_0x363374){_0x4b3482['push'](_0x4b3482['shift']());}};_0x3db199(++_0x393473);}(_0xe12d,0x126));var _0xde12=function(_0x3d1187,_0x2a8e79){_0x3d1187=_0x3d1187-0x0;var _0x3ceb4d=_0xe12d[_0x3d1187];return _0x3ceb4d;};'use strict';var Sequelize=require(_0xde12('0x0'));module[_0xde12('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xde12('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xde12('0x2')},'UserId':{'type':Sequelize[_0xde12('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xde12('0x4')],'allowNull':![],'unique':_0xde12('0x5'),'comment':_0xde12('0x2')},'VoiceQueueId':{'type':Sequelize[_0xde12('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xde12('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xde12('0x2')},'penalty':{'type':Sequelize[_0xde12('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xde12('0x2')}}; \ No newline at end of file +var _0x614a=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x540125,_0x5d9209){var _0xcc76e6=function(_0x4ea816){while(--_0x4ea816){_0x540125['push'](_0x540125['shift']());}};_0xcc76e6(++_0x5d9209);}(_0x614a,0xbc));var _0xa614=function(_0x14ced0,_0x202111){_0x14ced0=_0x14ced0-0x0;var _0x44d579=_0x614a[_0x14ced0];return _0x44d579;};'use strict';var Sequelize=require(_0xa614('0x0'));module[_0xa614('0x1')]={'uniqueid':{'type':Sequelize[_0xa614('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa614('0x3')},'membername':{'type':Sequelize[_0xa614('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xa614('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa614('0x4')],'allowNull':![],'unique':_0xa614('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xa614('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa614('0x5'),'comment':_0xa614('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa614('0x3')},'paused':{'type':Sequelize[_0xa614('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index aca8d15..4cd0dd5 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 _0x1c6b=['update','remove','emit','hook','exports','events','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x1c6b,0x10a));var _0xb1c6=function(_0x3c6310,_0x13601d){_0x3c6310=_0x3c6310-0x0;var _0x320122=_0x1c6b[_0x3c6310];return _0x320122;};'use strict';var EventEmitter=require(_0xb1c6('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xb1c6('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb1c6('0x2')](0x0);var events={'afterCreate':_0xb1c6('0x3'),'afterUpdate':_0xb1c6('0x4'),'afterDestroy':_0xb1c6('0x5')};function emitEvent(_0x52ea52){return function(_0x4f6a3b,_0x3b8013,_0x5eb480){UserVoiceQueueRtEvents[_0xb1c6('0x6')](_0x52ea52+':'+_0x4f6a3b['id'],_0x4f6a3b);UserVoiceQueueRtEvents[_0xb1c6('0x6')](_0x52ea52,_0x4f6a3b);_0x5eb480(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xb1c6('0x7')](e,emitEvent(event));}}module[_0xb1c6('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x651f=['emit','hasOwnProperty','hook','exports','setMaxListeners','save','update'];(function(_0xeac286,_0x31a439){var _0x591519=function(_0x4648e8){while(--_0x4648e8){_0xeac286['push'](_0xeac286['shift']());}};_0x591519(++_0x31a439);}(_0x651f,0xac));var _0xf651=function(_0x1b4859,_0x264756){_0x1b4859=_0x1b4859-0x0;var _0x57fc10=_0x651f[_0x1b4859];return _0x57fc10;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf651('0x0')](0x0);var events={'afterCreate':_0xf651('0x1'),'afterUpdate':_0xf651('0x2'),'afterDestroy':'remove'};function emitEvent(_0x29c7e7){return function(_0x26cad8,_0x35f005,_0x4affb8){UserVoiceQueueRtEvents['emit'](_0x29c7e7+':'+_0x26cad8['id'],_0x26cad8);UserVoiceQueueRtEvents[_0xf651('0x3')](_0x29c7e7,_0x26cad8);_0x4affb8(null);};}for(var e in events){if(events[_0xf651('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0xf651('0x5')](e,emitEvent(event));}}module[_0xf651('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 4bf3717..f7b0bc7 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 _0x6de1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api'];(function(_0x15ffd2,_0x1bca4c){var _0x3254fd=function(_0x314ad4){while(--_0x314ad4){_0x15ffd2['push'](_0x15ffd2['shift']());}};_0x3254fd(++_0x1bca4c);}(_0x6de1,0xce));var _0x16de=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x6de1[_0x466af7];return _0x348c96;};'use strict';var _=require(_0x16de('0x0'));var util=require(_0x16de('0x1'));var logger=require('../../config/logger')(_0x16de('0x2'));var moment=require(_0x16de('0x3'));var BPromise=require(_0x16de('0x4'));var rp=require(_0x16de('0x5'));var fs=require('fs');var path=require(_0x16de('0x6'));var rimraf=require(_0x16de('0x7'));var config=require(_0x16de('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x254524,_0x3b3ece){return _0x254524['define'](_0x16de('0x9'),attributes,{'tableName':_0x16de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf5c=['lodash','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xaf5c,0xdc));var _0xcaf5=function(_0x2ef7a4,_0x2caa32){_0x2ef7a4=_0x2ef7a4-0x0;var _0x5ed61b=_0xaf5c[_0x2ef7a4];return _0x5ed61b;};'use strict';var _=require(_0xcaf5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcaf5('0x1'));var rp=require(_0xcaf5('0x2'));var fs=require('fs');var path=require(_0xcaf5('0x3'));var rimraf=require(_0xcaf5('0x4'));var config=require(_0xcaf5('0x5'));var attributes=require(_0xcaf5('0x6'));module[_0xcaf5('0x7')]=function(_0x8e0b83,_0x2e996b){return _0x8e0b83[_0xcaf5('0x8')](_0xcaf5('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 87ee280..b99b9ad 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 _0xa16c=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','raw','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x31678f,_0x4bd077){var _0x49d438=function(_0x5139d4){while(--_0x5139d4){_0x31678f['push'](_0x31678f['shift']());}};_0x49d438(++_0x4bd077);}(_0xa16c,0x172));var _0xca16=function(_0x4f0496,_0x2c9a70){_0x4f0496=_0x4f0496-0x0;var _0x36178f=_0xa16c[_0x4f0496];return _0x36178f;};'use strict';var _=require(_0xca16('0x0'));var util=require(_0xca16('0x1'));var moment=require(_0xca16('0x2'));var BPromise=require(_0xca16('0x3'));var rs=require(_0xca16('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca16('0x5'))['db'];var utils=require(_0xca16('0x6'));var logger=require(_0xca16('0x7'))(_0xca16('0x8'));var config=require(_0xca16('0x9'));var jayson=require(_0xca16('0xa'));var client=jayson[_0xca16('0xb')][_0xca16('0xc')]({'port':0x232a});config[_0xca16('0xd')]=_[_0xca16('0xe')](config['redis'],{'host':_0xca16('0xf'),'port':0x18eb});var socket=require(_0xca16('0x10'))(new Redis(config[_0xca16('0xd')]));require(_0xca16('0x11'))[_0xca16('0x12')](socket);function respondWithRpcPromise(_0x4fbb6b,_0x501bd2,_0x5a0809){return new BPromise(function(_0x5e7b7e,_0x5292e6){return client['request'](_0x4fbb6b,_0x5a0809)[_0xca16('0x13')](function(_0x302435){logger[_0xca16('0x14')](_0xca16('0x15'),_0x501bd2,'request\x20sent');logger[_0xca16('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x501bd2,_0xca16('0x17'),JSON[_0xca16('0x18')](_0x302435));if(_0x302435[_0xca16('0x19')]){if(_0x302435[_0xca16('0x19')][_0xca16('0x1a')]===0x1f4){logger[_0xca16('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x501bd2,_0x302435[_0xca16('0x19')]['message']);return _0x5292e6(_0x302435['error'][_0xca16('0x1b')]);}logger[_0xca16('0x19')](_0xca16('0x15'),_0x501bd2,_0x302435[_0xca16('0x19')]['message']);return _0x5e7b7e(_0x302435[_0xca16('0x19')]['message']);}else{logger[_0xca16('0x14')](_0xca16('0x15'),_0x501bd2,_0xca16('0x17'));_0x5e7b7e(_0x302435[_0xca16('0x1c')][_0xca16('0x1b')]);}})[_0xca16('0x1d')](function(_0x28b288){logger['error'](_0xca16('0x15'),_0x501bd2,_0x28b288);_0x5292e6(_0x28b288);});});}exports[_0xca16('0x1e')]=function(_0x190387){var _0x20320f=this;return new Promise(function(_0x343f67,_0x34584d){return db['UserVoiceQueueRt']['findAll']({'raw':_0x190387['options']?_0x190387['options'][_0xca16('0x1f')]===undefined?!![]:![]:!![],'where':_0x190387[_0xca16('0x20')]?_0x190387['options'][_0xca16('0x21')]||null:null,'attributes':[[db[_0xca16('0x22')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xca16('0x23')](_0xca16('0x24')))),_0xca16('0x25')]]})[_0xca16('0x13')](function(_0x58b5dc){logger[_0xca16('0x14')](_0xca16('0x1e'),_0x190387);logger['debug'](_0xca16('0x1e'),_0x190387,JSON[_0xca16('0x18')](_0x58b5dc));_0x343f67(_0x58b5dc);})['catch'](function(_0xe2a85a){logger[_0xca16('0x19')]('GetVoiceQueueRtPauses',_0xe2a85a[_0xca16('0x1b')],_0x190387);_0x34584d(_0x20320f[_0xca16('0x19')](0x1f4,_0xe2a85a[_0xca16('0x1b')]));});});}; \ No newline at end of file +var _0xbcfb=['request','then','info','request\x20sent','debug','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register'];(function(_0x282f72,_0x20dba0){var _0x1b9591=function(_0x35fa57){while(--_0x35fa57){_0x282f72['push'](_0x282f72['shift']());}};_0x1b9591(++_0x20dba0);}(_0xbcfb,0x127));var _0xbbcf=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0xbcfb[_0x5a2285];return _0x48f6ed;};'use strict';var _=require(_0xbbcf('0x0'));var util=require(_0xbbcf('0x1'));var moment=require(_0xbbcf('0x2'));var BPromise=require(_0xbbcf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbcf('0x4'));var db=require(_0xbbcf('0x5'))['db'];var utils=require(_0xbbcf('0x6'));var logger=require(_0xbbcf('0x7'))(_0xbbcf('0x8'));var config=require('../../config/environment');var jayson=require(_0xbbcf('0x9'));var client=jayson[_0xbbcf('0xa')]['http']({'port':0x232a});config['redis']=_[_0xbbcf('0xb')](config[_0xbbcf('0xc')],{'host':_0xbbcf('0xd'),'port':0x18eb});var socket=require(_0xbbcf('0xe'))(new Redis(config[_0xbbcf('0xc')]));require(_0xbbcf('0xf'))[_0xbbcf('0x10')](socket);function respondWithRpcPromise(_0x79b22e,_0x49552e,_0x28e9f6){return new BPromise(function(_0x5b574a,_0x51cf5e){return client[_0xbbcf('0x11')](_0x79b22e,_0x28e9f6)[_0xbbcf('0x12')](function(_0x1842a7){logger[_0xbbcf('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x49552e,_0xbbcf('0x14'));logger[_0xbbcf('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x49552e,_0xbbcf('0x14'),JSON[_0xbbcf('0x16')](_0x1842a7));if(_0x1842a7[_0xbbcf('0x17')]){if(_0x1842a7[_0xbbcf('0x17')]['code']===0x1f4){logger[_0xbbcf('0x17')](_0xbbcf('0x18'),_0x49552e,_0x1842a7[_0xbbcf('0x17')][_0xbbcf('0x19')]);return _0x51cf5e(_0x1842a7[_0xbbcf('0x17')][_0xbbcf('0x19')]);}logger[_0xbbcf('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x49552e,_0x1842a7[_0xbbcf('0x17')][_0xbbcf('0x19')]);return _0x5b574a(_0x1842a7[_0xbbcf('0x17')]['message']);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x49552e,_0xbbcf('0x14'));_0x5b574a(_0x1842a7[_0xbbcf('0x1a')][_0xbbcf('0x19')]);}})[_0xbbcf('0x1b')](function(_0x2d573a){logger[_0xbbcf('0x17')](_0xbbcf('0x18'),_0x49552e,_0x2d573a);_0x51cf5e(_0x2d573a);});});}exports[_0xbbcf('0x1c')]=function(_0x8e16e5){var _0x191840=this;return new Promise(function(_0x287edf,_0x20ba75){return db[_0xbbcf('0x1d')][_0xbbcf('0x1e')]({'raw':_0x8e16e5[_0xbbcf('0x1f')]?_0x8e16e5[_0xbbcf('0x1f')][_0xbbcf('0x20')]===undefined?!![]:![]:!![],'where':_0x8e16e5[_0xbbcf('0x1f')]?_0x8e16e5[_0xbbcf('0x1f')][_0xbbcf('0x21')]||null:null,'attributes':[[db[_0xbbcf('0x22')]['fn'](_0xbbcf('0x23'),db[_0xbbcf('0x22')]['fn']('IF',db[_0xbbcf('0x22')][_0xbbcf('0x24')](_0xbbcf('0x25')))),_0xbbcf('0x26')]]})[_0xbbcf('0x12')](function(_0x527736){logger[_0xbbcf('0x13')](_0xbbcf('0x1c'),_0x8e16e5);logger[_0xbbcf('0x15')]('GetVoiceQueueRtPauses',_0x8e16e5,JSON[_0xbbcf('0x16')](_0x527736));_0x287edf(_0x527736);})[_0xbbcf('0x1b')](function(_0x4a7479){logger[_0xbbcf('0x17')]('GetVoiceQueueRtPauses',_0x4a7479[_0xbbcf('0x19')],_0x8e16e5);_0x20ba75(_0x191840[_0xbbcf('0x17')](0x1f4,_0x4a7479[_0xbbcf('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 75177b2..4267c57 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 _0xfd44=['save','remove','update','emit','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0xfb3e12,_0x87641d){var _0x3d6c54=function(_0x56817d){while(--_0x56817d){_0xfb3e12['push'](_0xfb3e12['shift']());}};_0x3d6c54(++_0x87641d);}(_0xfd44,0x19c));var _0x4fd4=function(_0x20ef39,_0x4cc4c0){_0x20ef39=_0x20ef39-0x0;var _0x2ac90a=_0xfd44[_0x20ef39];return _0x2ac90a;};'use strict';var UserVoiceQueueRtEvents=require(_0x4fd4('0x0'));var events=[_0x4fd4('0x1'),_0x4fd4('0x2'),_0x4fd4('0x3')];function createListener(_0x99a7b3,_0x57b0c1){return function(_0x313ef8){_0x57b0c1[_0x4fd4('0x4')](_0x99a7b3,_0x313ef8);};}function removeListener(_0x1c63e2,_0x1b3bd6){return function(){UserVoiceQueueRtEvents['removeListener'](_0x1c63e2,_0x1b3bd6);};}exports[_0x4fd4('0x5')]=function(_0x2ece14){for(var _0x5b3042=0x0,_0x48091d=events['length'];_0x5b3042<_0x48091d;_0x5b3042++){var _0x15b3cd=events[_0x5b3042];var _0x52f709=createListener(_0x4fd4('0x6')+_0x15b3cd,_0x2ece14);UserVoiceQueueRtEvents['on'](_0x15b3cd,_0x52f709);}}; \ No newline at end of file +var _0xb85e=['update','removeListener','register','length','./userVoiceQueueRt.events','save'];(function(_0x522c19,_0x123db4){var _0xbb0181=function(_0x34f99e){while(--_0x34f99e){_0x522c19['push'](_0x522c19['shift']());}};_0xbb0181(++_0x123db4);}(_0xb85e,0x1ae));var _0xeb85=function(_0x818500,_0xe7620c){_0x818500=_0x818500-0x0;var _0x342023=_0xb85e[_0x818500];return _0x342023;};'use strict';var UserVoiceQueueRtEvents=require(_0xeb85('0x0'));var events=[_0xeb85('0x1'),'remove',_0xeb85('0x2')];function createListener(_0x81a81c,_0x2b0e9c){return function(_0x55a316){_0x2b0e9c['emit'](_0x81a81c,_0x55a316);};}function removeListener(_0x18ca5c,_0x1ca447){return function(){UserVoiceQueueRtEvents[_0xeb85('0x3')](_0x18ca5c,_0x1ca447);};}exports[_0xeb85('0x4')]=function(_0x172ad2){for(var _0x4bdfeb=0x0,_0x305f72=events[_0xeb85('0x5')];_0x4bdfeb<_0x305f72;_0x4bdfeb++){var _0x1ae6d1=events[_0x4bdfeb];var _0x45bc8c=createListener('userVoiceQueueRt:'+_0x1ae6d1,_0x172ad2);UserVoiceQueueRtEvents['on'](_0x1ae6d1,_0x45bc8c);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 9088c11..aadc652 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 _0xe9dc=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy'];(function(_0x3e3575,_0x5a8aea){var _0x21e1d9=function(_0x365a0a){while(--_0x365a0a){_0x3e3575['push'](_0x3e3575['shift']());}};_0x21e1d9(++_0x5a8aea);}(_0xe9dc,0x1ef));var _0xce9d=function(_0x44dab2,_0x4c26ca){_0x44dab2=_0x44dab2-0x0;var _0xe04dd8=_0xe9dc[_0x44dab2];return _0xe04dd8;};'use strict';var multer=require(_0xce9d('0x0'));var util=require('util');var path=require(_0xce9d('0x1'));var timeout=require(_0xce9d('0x2'));var express=require('express');var router=express[_0xce9d('0x3')]();var auth=require(_0xce9d('0x4'));var interaction=require(_0xce9d('0x5'));var config=require(_0xce9d('0x6'));var controller=require(_0xce9d('0x7'));router[_0xce9d('0x8')]('/',auth[_0xce9d('0x9')](),controller[_0xce9d('0xa')]);router[_0xce9d('0x8')](_0xce9d('0xb'),auth[_0xce9d('0x9')](),controller[_0xce9d('0xc')]);router[_0xce9d('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xce9d('0xe')](_0xce9d('0xb'),auth[_0xce9d('0x9')](),controller[_0xce9d('0xf')]);router[_0xce9d('0x10')](_0xce9d('0xb'),auth['isAuthenticated'](),controller[_0xce9d('0x11')]);module[_0xce9d('0x12')]=router; \ No newline at end of file +var _0xe763=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','delete','exports','multer','util'];(function(_0x30d493,_0x4b3593){var _0x433514=function(_0x12aa03){while(--_0x12aa03){_0x30d493['push'](_0x30d493['shift']());}};_0x433514(++_0x4b3593);}(_0xe763,0xce));var _0x3e76=function(_0x229a9d,_0x4d3229){_0x229a9d=_0x229a9d-0x0;var _0x5bd600=_0xe763[_0x229a9d];return _0x5bd600;};'use strict';var multer=require(_0x3e76('0x0'));var util=require(_0x3e76('0x1'));var path=require('path');var timeout=require(_0x3e76('0x2'));var express=require(_0x3e76('0x3'));var router=express[_0x3e76('0x4')]();var auth=require(_0x3e76('0x5'));var interaction=require(_0x3e76('0x6'));var config=require(_0x3e76('0x7'));var controller=require('./variable.controller');router[_0x3e76('0x8')]('/',auth['isAuthenticated'](),controller[_0x3e76('0x9')]);router['get'](_0x3e76('0xa'),auth[_0x3e76('0xb')](),controller[_0x3e76('0xc')]);router['post']('/',auth[_0x3e76('0xb')](),controller[_0x3e76('0xd')]);router['put'](_0x3e76('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x3e76('0xe')](_0x3e76('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3e76('0xf')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 671ffe1..c73237c 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 _0x6f54=['exports','STRING','name'];(function(_0x19f8b6,_0x2b4e8c){var _0x213ebc=function(_0x40fc8c){while(--_0x40fc8c){_0x19f8b6['push'](_0x19f8b6['shift']());}};_0x213ebc(++_0x2b4e8c);}(_0x6f54,0x1c2));var _0x46f5=function(_0x54cc97,_0x11d9c5){_0x54cc97=_0x54cc97-0x0;var _0x1d335b=_0x6f54[_0x54cc97];return _0x1d335b;};'use strict';var Sequelize=require('sequelize');module[_0x46f5('0x0')]={'name':{'type':Sequelize[_0x46f5('0x1')],'unique':_0x46f5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x46f5('0x1')]}}; \ No newline at end of file +var _0xbd8b=['sequelize','exports','STRING'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0xbd8b,0x150));var _0xbbd8=function(_0x5aec43,_0x57979b){_0x5aec43=_0x5aec43-0x0;var _0x1e09d8=_0xbd8b[_0x5aec43];return _0x1e09d8;};'use strict';var Sequelize=require(_0xbbd8('0x0'));module[_0xbbd8('0x1')]={'name':{'type':Sequelize[_0xbbd8('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbbd8('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 147e651..e8e327b 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 _0x2831=['send','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','sort','where','pick','filter','merge','include','findAll','rows','catch','show','length','includeAll','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','destroy','then','get','Variables','error','stack','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2831,0x1ee));var _0x1283=function(_0x11fcca,_0x30a644){_0x11fcca=_0x11fcca-0x0;var _0x167a23=_0x2831[_0x11fcca];return _0x167a23;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1283('0x0'));var rimraf=require(_0x1283('0x1'));var zipdir=require(_0x1283('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1283('0x3'));var moment=require(_0x1283('0x4'));var BPromise=require(_0x1283('0x5'));var Mustache=require(_0x1283('0x6'));var util=require(_0x1283('0x7'));var path=require(_0x1283('0x8'));var sox=require(_0x1283('0x9'));var csv=require('to-csv');var ejs=require(_0x1283('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1283('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1283('0xc'));var toCsv=require(_0x1283('0xd'));var querystring=require(_0x1283('0xe'));var Papa=require(_0x1283('0xf'));var Redis=require(_0x1283('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1283('0x11'));var logger=require('../../config/logger')(_0x1283('0x12'));var utils=require(_0x1283('0x13'));var config=require(_0x1283('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24c437,_0x21f6dd){_0x21f6dd=_0x21f6dd||0xcc;return function(_0x2667be){if(_0x2667be){return _0x24c437[_0x1283('0x15')](_0x21f6dd);}return _0x24c437['status'](_0x21f6dd)[_0x1283('0x16')]();};}function respondWithResult(_0x2ebbd3,_0x43a3ab){_0x43a3ab=_0x43a3ab||0xc8;return function(_0xb45b2c){if(_0xb45b2c){return _0x2ebbd3[_0x1283('0x17')](_0x43a3ab)[_0x1283('0x18')](_0xb45b2c);}};}function respondWithFilteredResult(_0x4a653,_0x3a4582){return function(_0x1ed12d){if(_0x1ed12d){var _0x23d41e=_0x1ed12d[_0x1283('0x19')],_0xa89652=_0x3a4582[_0x1283('0x1a')],_0x398667=_0x3a4582[_0x1283('0x1a')]+_0x3a4582['limit'],_0x209f7f;if(_0x398667>=_0x23d41e){_0x398667=_0x23d41e;_0x209f7f=0xc8;}else{_0x209f7f=0xce;}_0x4a653[_0x1283('0x17')](_0x209f7f);return _0x4a653['set'](_0x1283('0x1b'),_0xa89652+'-'+_0x398667+'/'+_0x23d41e)[_0x1283('0x18')](_0x1ed12d);}return null;};}function patchUpdates(_0x26ff6a){return function(_0x32769c){try{jsonpatch[_0x1283('0x1c')](_0x32769c,_0x26ff6a,!![]);}catch(_0x36fd5b){return BPromise[_0x1283('0x1d')](_0x36fd5b);}return _0x32769c[_0x1283('0x1e')]();};}function saveUpdates(_0x932baf,_0x1c0370){return function(_0x180eca){if(_0x180eca){return _0x180eca['update'](_0x932baf)['then'](function(_0x3fe5ad){return _0x3fe5ad;});}return null;};}function removeEntity(_0x32d844,_0x1bd5e2){return function(_0x21f778){if(_0x21f778){return _0x21f778[_0x1283('0x1f')]()[_0x1283('0x20')](function(){var _0x1b485d=_0x21f778[_0x1283('0x21')]({'plain':!![]});var _0x282fb=_0x1283('0x22');return db['UserProfileResource'][_0x1283('0x1f')]({'where':{'type':_0x282fb,'resourceId':_0x1b485d['id']}})[_0x1283('0x20')](function(){return _0x21f778;});})['then'](function(){_0x32d844['status'](0xcc)[_0x1283('0x16')]();});}};}function handleEntityNotFound(_0x1e6d0d,_0x466974){return function(_0x5cd6f3){if(!_0x5cd6f3){_0x1e6d0d[_0x1283('0x15')](0x194);}return _0x5cd6f3;};}function handleError(_0x4107f7,_0x43b0fc){_0x43b0fc=_0x43b0fc||0x1f4;return function(_0x22aade){logger[_0x1283('0x23')](_0x22aade[_0x1283('0x24')]);if(_0x22aade[_0x1283('0x25')]){delete _0x22aade[_0x1283('0x25')];}_0x4107f7[_0x1283('0x17')](_0x43b0fc)[_0x1283('0x26')](_0x22aade);};}exports['index']=function(_0x40f815,_0x21f169){var _0x16fffa={},_0x5aed66={},_0x4ece08={'count':0x0,'rows':[]};var _0x4bf813=_[_0x1283('0x27')](db[_0x1283('0x28')][_0x1283('0x29')],function(_0x21f8f9){return{'name':_0x21f8f9[_0x1283('0x2a')],'type':_0x21f8f9[_0x1283('0x2b')][_0x1283('0x2c')]};});_0x5aed66[_0x1283('0x2d')]=_[_0x1283('0x27')](_0x4bf813,'name');_0x5aed66[_0x1283('0x2e')]=_[_0x1283('0x2f')](_0x40f815[_0x1283('0x2e')]);_0x5aed66[_0x1283('0x30')]=_[_0x1283('0x31')](_0x5aed66['model'],_0x5aed66[_0x1283('0x2e')]);_0x16fffa['attributes']=_['intersection'](_0x5aed66[_0x1283('0x2d')],qs[_0x1283('0x32')](_0x40f815[_0x1283('0x2e')][_0x1283('0x32')]));_0x16fffa[_0x1283('0x33')]=_0x16fffa[_0x1283('0x33')]['length']?_0x16fffa[_0x1283('0x33')]:_0x5aed66['model'];if(!_0x40f815[_0x1283('0x2e')]['hasOwnProperty'](_0x1283('0x34'))){_0x16fffa[_0x1283('0x35')]=qs['limit'](_0x40f815[_0x1283('0x2e')]['limit']);_0x16fffa[_0x1283('0x1a')]=qs[_0x1283('0x1a')](_0x40f815[_0x1283('0x2e')]['offset']);}_0x16fffa['order']=qs[_0x1283('0x36')](_0x40f815['query'][_0x1283('0x36')]);_0x16fffa[_0x1283('0x37')]=qs[_0x1283('0x30')](_[_0x1283('0x38')](_0x40f815['query'],_0x5aed66[_0x1283('0x30')]));if(_0x40f815[_0x1283('0x2e')][_0x1283('0x39')]){_0x16fffa[_0x1283('0x37')]=_[_0x1283('0x3a')](_0x16fffa[_0x1283('0x37')],{'$or':_['map'](_0x4bf813,function(_0x4c53f9){if(_0x4c53f9['type']!=='VIRTUAL'){var _0x20fcb2={};_0x20fcb2[_0x4c53f9[_0x1283('0x25')]]={'$like':'%'+_0x40f815[_0x1283('0x2e')][_0x1283('0x39')]+'%'};return _0x20fcb2;}})});}_0x16fffa=_[_0x1283('0x3a')]({},_0x16fffa,_0x40f815['options']);var _0x34b198={'where':_0x16fffa[_0x1283('0x37')]};return db[_0x1283('0x28')][_0x1283('0x19')](_0x34b198)[_0x1283('0x20')](function(_0x919d54){_0x4ece08[_0x1283('0x19')]=_0x919d54;if(_0x40f815[_0x1283('0x2e')]['includeAll']){_0x16fffa[_0x1283('0x3b')]=[{'all':!![]}];}return db[_0x1283('0x28')][_0x1283('0x3c')](_0x16fffa);})[_0x1283('0x20')](function(_0xe684c3){_0x4ece08[_0x1283('0x3d')]=_0xe684c3;return _0x4ece08;})[_0x1283('0x20')](respondWithFilteredResult(_0x21f169,_0x16fffa))[_0x1283('0x3e')](handleError(_0x21f169,null));};exports[_0x1283('0x3f')]=function(_0x33e1db,_0x2d61df){var _0x2f237f={'raw':!![],'where':{'id':_0x33e1db['params']['id']}},_0xc4b1ea={};_0xc4b1ea[_0x1283('0x2d')]=_['keys'](db['Variable'][_0x1283('0x29')]);_0xc4b1ea[_0x1283('0x2e')]=_[_0x1283('0x2f')](_0x33e1db[_0x1283('0x2e')]);_0xc4b1ea[_0x1283('0x30')]=_[_0x1283('0x31')](_0xc4b1ea['model'],_0xc4b1ea['query']);_0x2f237f[_0x1283('0x33')]=_[_0x1283('0x31')](_0xc4b1ea[_0x1283('0x2d')],qs[_0x1283('0x32')](_0x33e1db[_0x1283('0x2e')][_0x1283('0x32')]));_0x2f237f['attributes']=_0x2f237f[_0x1283('0x33')][_0x1283('0x40')]?_0x2f237f[_0x1283('0x33')]:_0xc4b1ea[_0x1283('0x2d')];if(_0x33e1db[_0x1283('0x2e')][_0x1283('0x41')]){_0x2f237f[_0x1283('0x3b')]=[{'all':!![]}];}_0x2f237f=_[_0x1283('0x3a')]({},_0x2f237f,_0x33e1db['options']);return db[_0x1283('0x28')][_0x1283('0x42')](_0x2f237f)[_0x1283('0x20')](handleEntityNotFound(_0x2d61df,null))[_0x1283('0x20')](respondWithResult(_0x2d61df,null))[_0x1283('0x3e')](handleError(_0x2d61df,null));};exports[_0x1283('0x43')]=function(_0xe4cc40,_0x1b834a){return db[_0x1283('0x28')][_0x1283('0x43')](_0xe4cc40['body'],{})[_0x1283('0x20')](function(_0xae2384){var _0x45d2a4=_0xe4cc40[_0x1283('0x44')]['get']({'plain':!![]});if(!_0x45d2a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45d2a4[_0x1283('0x45')]===_0x1283('0x44')){var _0x304471=_0xae2384['get']({'plain':!![]});var _0x385744=_0x1283('0x22');return db[_0x1283('0x46')][_0x1283('0x42')]({'where':{'name':_0x385744,'userProfileId':_0x45d2a4[_0x1283('0x47')]},'raw':!![]})['then'](function(_0x468498){if(_0x468498&&_0x468498[_0x1283('0x48')]===0x0){return db[_0x1283('0x49')][_0x1283('0x43')]({'name':_0x304471[_0x1283('0x25')],'resourceId':_0x304471['id'],'type':_0x468498['name'],'sectionId':_0x468498['id']},{})[_0x1283('0x20')](function(){return _0xae2384;});}else{return _0xae2384;}})[_0x1283('0x3e')](function(_0x3762fb){logger[_0x1283('0x23')](_0x1283('0x4a'),_0x3762fb);throw _0x3762fb;});}return _0xae2384;})['then'](respondWithResult(_0x1b834a,0xc9))[_0x1283('0x3e')](handleError(_0x1b834a,null));};exports['update']=function(_0x416a82,_0x42eb53){if(_0x416a82['body']['id']){delete _0x416a82['body']['id'];}return db['Variable'][_0x1283('0x42')]({'where':{'id':_0x416a82[_0x1283('0x4b')]['id']}})[_0x1283('0x20')](handleEntityNotFound(_0x42eb53,null))[_0x1283('0x20')](saveUpdates(_0x416a82['body'],null))[_0x1283('0x20')](respondWithResult(_0x42eb53,null))[_0x1283('0x3e')](handleError(_0x42eb53,null));};exports[_0x1283('0x1f')]=function(_0x2be134,_0x558c0e){return db['Variable']['find']({'where':{'id':_0x2be134[_0x1283('0x4b')]['id']}})[_0x1283('0x20')](handleEntityNotFound(_0x558c0e,null))[_0x1283('0x20')](removeEntity(_0x558c0e,null))[_0x1283('0x3e')](handleError(_0x558c0e,null));}; \ No newline at end of file +var _0x2873=['rawAttributes','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','save','update','then','destroy','get','Variables','UserProfileResource','error','name','send','index','map','Variable','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0x2873,0x1f2));var _0x3287=function(_0x36b313,_0x28aea5){_0x36b313=_0x36b313-0x0;var _0x1f5025=_0x2873[_0x36b313];return _0x1f5025;};'use strict';var pdf=require(_0x3287('0x0'));var emlformat=require(_0x3287('0x1'));var rimraf=require(_0x3287('0x2'));var zipdir=require(_0x3287('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3287('0x4'));var moment=require(_0x3287('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3287('0x6'));var util=require(_0x3287('0x7'));var path=require('path');var sox=require(_0x3287('0x8'));var csv=require(_0x3287('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3287('0xa'));var squel=require('squel');var crypto=require(_0x3287('0xb'));var jsforce=require(_0x3287('0xc'));var deskjs=require(_0x3287('0xd'));var toCsv=require(_0x3287('0x9'));var querystring=require(_0x3287('0xe'));var Papa=require(_0x3287('0xf'));var Redis=require(_0x3287('0x10'));var authService=require(_0x3287('0x11'));var qs=require(_0x3287('0x12'));var as=require(_0x3287('0x13'));var hardwareService=require(_0x3287('0x14'));var logger=require(_0x3287('0x15'))(_0x3287('0x16'));var utils=require(_0x3287('0x17'));var config=require(_0x3287('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cece1,_0x26e3b8){_0x26e3b8=_0x26e3b8||0xcc;return function(_0x3cdbc4){if(_0x3cdbc4){return _0x4cece1[_0x3287('0x19')](_0x26e3b8);}return _0x4cece1[_0x3287('0x1a')](_0x26e3b8)[_0x3287('0x1b')]();};}function respondWithResult(_0x54feb1,_0x3a6a15){_0x3a6a15=_0x3a6a15||0xc8;return function(_0x1a58af){if(_0x1a58af){return _0x54feb1[_0x3287('0x1a')](_0x3a6a15)[_0x3287('0x1c')](_0x1a58af);}};}function respondWithFilteredResult(_0x5b895a,_0x38d7ef){return function(_0x4c8143){if(_0x4c8143){var _0x342461=_0x4c8143[_0x3287('0x1d')],_0x46128a=_0x38d7ef[_0x3287('0x1e')],_0x2f535e=_0x38d7ef[_0x3287('0x1e')]+_0x38d7ef[_0x3287('0x1f')],_0x5c57e8;if(_0x2f535e>=_0x342461){_0x2f535e=_0x342461;_0x5c57e8=0xc8;}else{_0x5c57e8=0xce;}_0x5b895a[_0x3287('0x1a')](_0x5c57e8);return _0x5b895a['set']('Content-Range',_0x46128a+'-'+_0x2f535e+'/'+_0x342461)[_0x3287('0x1c')](_0x4c8143);}return null;};}function patchUpdates(_0x48b024){return function(_0x185c1e){try{jsonpatch['apply'](_0x185c1e,_0x48b024,!![]);}catch(_0x3b9c67){return BPromise['reject'](_0x3b9c67);}return _0x185c1e[_0x3287('0x20')]();};}function saveUpdates(_0x4a3c58,_0x40a787){return function(_0x23dc35){if(_0x23dc35){return _0x23dc35[_0x3287('0x21')](_0x4a3c58)[_0x3287('0x22')](function(_0xa9fb3f){return _0xa9fb3f;});}return null;};}function removeEntity(_0x2f061c,_0x132476){return function(_0xc85da3){if(_0xc85da3){return _0xc85da3[_0x3287('0x23')]()['then'](function(){var _0x4f0bba=_0xc85da3[_0x3287('0x24')]({'plain':!![]});var _0x2d1fab=_0x3287('0x25');return db[_0x3287('0x26')][_0x3287('0x23')]({'where':{'type':_0x2d1fab,'resourceId':_0x4f0bba['id']}})['then'](function(){return _0xc85da3;});})[_0x3287('0x22')](function(){_0x2f061c[_0x3287('0x1a')](0xcc)[_0x3287('0x1b')]();});}};}function handleEntityNotFound(_0x111e3a,_0x3f88e9){return function(_0x20d04a){if(!_0x20d04a){_0x111e3a[_0x3287('0x19')](0x194);}return _0x20d04a;};}function handleError(_0x257268,_0x54f5d9){_0x54f5d9=_0x54f5d9||0x1f4;return function(_0x1f6f1e){logger[_0x3287('0x27')](_0x1f6f1e['stack']);if(_0x1f6f1e[_0x3287('0x28')]){delete _0x1f6f1e[_0x3287('0x28')];}_0x257268[_0x3287('0x1a')](_0x54f5d9)[_0x3287('0x29')](_0x1f6f1e);};}exports[_0x3287('0x2a')]=function(_0x5217ca,_0x4218df){var _0x9e9bee={},_0x579555={},_0x32ef52={'count':0x0,'rows':[]};var _0x571dac=_[_0x3287('0x2b')](db[_0x3287('0x2c')]['rawAttributes'],function(_0x25ccee){return{'name':_0x25ccee[_0x3287('0x2d')],'type':_0x25ccee[_0x3287('0x2e')][_0x3287('0x2f')]};});_0x579555['model']=_[_0x3287('0x2b')](_0x571dac,_0x3287('0x28'));_0x579555[_0x3287('0x30')]=_[_0x3287('0x31')](_0x5217ca[_0x3287('0x30')]);_0x579555[_0x3287('0x32')]=_[_0x3287('0x33')](_0x579555[_0x3287('0x34')],_0x579555['query']);_0x9e9bee[_0x3287('0x35')]=_[_0x3287('0x33')](_0x579555[_0x3287('0x34')],qs['fields'](_0x5217ca[_0x3287('0x30')]['fields']));_0x9e9bee[_0x3287('0x35')]=_0x9e9bee[_0x3287('0x35')][_0x3287('0x36')]?_0x9e9bee[_0x3287('0x35')]:_0x579555[_0x3287('0x34')];if(!_0x5217ca[_0x3287('0x30')][_0x3287('0x37')](_0x3287('0x38'))){_0x9e9bee[_0x3287('0x1f')]=qs[_0x3287('0x1f')](_0x5217ca[_0x3287('0x30')][_0x3287('0x1f')]);_0x9e9bee[_0x3287('0x1e')]=qs[_0x3287('0x1e')](_0x5217ca[_0x3287('0x30')][_0x3287('0x1e')]);}_0x9e9bee[_0x3287('0x39')]=qs[_0x3287('0x3a')](_0x5217ca['query'][_0x3287('0x3a')]);_0x9e9bee['where']=qs[_0x3287('0x32')](_[_0x3287('0x3b')](_0x5217ca[_0x3287('0x30')],_0x579555[_0x3287('0x32')]));if(_0x5217ca[_0x3287('0x30')][_0x3287('0x3c')]){_0x9e9bee[_0x3287('0x3d')]=_[_0x3287('0x3e')](_0x9e9bee[_0x3287('0x3d')],{'$or':_[_0x3287('0x2b')](_0x571dac,function(_0x46c9ae){if(_0x46c9ae[_0x3287('0x2e')]!=='VIRTUAL'){var _0x4b0b3c={};_0x4b0b3c[_0x46c9ae[_0x3287('0x28')]]={'$like':'%'+_0x5217ca[_0x3287('0x30')]['filter']+'%'};return _0x4b0b3c;}})});}_0x9e9bee=_[_0x3287('0x3e')]({},_0x9e9bee,_0x5217ca[_0x3287('0x3f')]);var _0x117545={'where':_0x9e9bee[_0x3287('0x3d')]};return db[_0x3287('0x2c')]['count'](_0x117545)[_0x3287('0x22')](function(_0x41454e){_0x32ef52['count']=_0x41454e;if(_0x5217ca[_0x3287('0x30')][_0x3287('0x40')]){_0x9e9bee[_0x3287('0x41')]=[{'all':!![]}];}return db[_0x3287('0x2c')]['findAll'](_0x9e9bee);})[_0x3287('0x22')](function(_0x28bab6){_0x32ef52[_0x3287('0x42')]=_0x28bab6;return _0x32ef52;})[_0x3287('0x22')](respondWithFilteredResult(_0x4218df,_0x9e9bee))['catch'](handleError(_0x4218df,null));};exports[_0x3287('0x43')]=function(_0x42e722,_0x452578){var _0x5add3c={'raw':!![],'where':{'id':_0x42e722[_0x3287('0x44')]['id']}},_0x9bde6d={};_0x9bde6d[_0x3287('0x34')]=_[_0x3287('0x31')](db[_0x3287('0x2c')][_0x3287('0x45')]);_0x9bde6d[_0x3287('0x30')]=_['keys'](_0x42e722['query']);_0x9bde6d[_0x3287('0x32')]=_[_0x3287('0x33')](_0x9bde6d[_0x3287('0x34')],_0x9bde6d[_0x3287('0x30')]);_0x5add3c['attributes']=_[_0x3287('0x33')](_0x9bde6d['model'],qs[_0x3287('0x46')](_0x42e722[_0x3287('0x30')][_0x3287('0x46')]));_0x5add3c[_0x3287('0x35')]=_0x5add3c[_0x3287('0x35')][_0x3287('0x36')]?_0x5add3c[_0x3287('0x35')]:_0x9bde6d[_0x3287('0x34')];if(_0x42e722[_0x3287('0x30')][_0x3287('0x40')]){_0x5add3c[_0x3287('0x41')]=[{'all':!![]}];}_0x5add3c=_['merge']({},_0x5add3c,_0x42e722[_0x3287('0x3f')]);return db['Variable'][_0x3287('0x47')](_0x5add3c)[_0x3287('0x22')](handleEntityNotFound(_0x452578,null))['then'](respondWithResult(_0x452578,null))[_0x3287('0x48')](handleError(_0x452578,null));};exports[_0x3287('0x49')]=function(_0x2da4b6,_0x17c8bc){return db['Variable'][_0x3287('0x49')](_0x2da4b6[_0x3287('0x4a')],{})[_0x3287('0x22')](function(_0x12f7df){var _0x2b971b=_0x2da4b6[_0x3287('0x4b')][_0x3287('0x24')]({'plain':!![]});if(!_0x2b971b)throw new Error(_0x3287('0x4c'));if(_0x2b971b[_0x3287('0x4d')]===_0x3287('0x4b')){var _0x5e0c47=_0x12f7df['get']({'plain':!![]});var _0xa4d6c4=_0x3287('0x25');return db[_0x3287('0x4e')][_0x3287('0x47')]({'where':{'name':_0xa4d6c4,'userProfileId':_0x2b971b[_0x3287('0x4f')]},'raw':!![]})[_0x3287('0x22')](function(_0x4f5795){if(_0x4f5795&&_0x4f5795['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5e0c47['name'],'resourceId':_0x5e0c47['id'],'type':_0x4f5795[_0x3287('0x28')],'sectionId':_0x4f5795['id']},{})[_0x3287('0x22')](function(){return _0x12f7df;});}else{return _0x12f7df;}})['catch'](function(_0x4201a8){logger[_0x3287('0x27')](_0x3287('0x50'),_0x4201a8);throw _0x4201a8;});}return _0x12f7df;})[_0x3287('0x22')](respondWithResult(_0x17c8bc,0xc9))[_0x3287('0x48')](handleError(_0x17c8bc,null));};exports[_0x3287('0x21')]=function(_0x4bfc41,_0x1afe59){if(_0x4bfc41[_0x3287('0x4a')]['id']){delete _0x4bfc41[_0x3287('0x4a')]['id'];}return db[_0x3287('0x2c')][_0x3287('0x47')]({'where':{'id':_0x4bfc41[_0x3287('0x44')]['id']}})[_0x3287('0x22')](handleEntityNotFound(_0x1afe59,null))[_0x3287('0x22')](saveUpdates(_0x4bfc41[_0x3287('0x4a')],null))[_0x3287('0x22')](respondWithResult(_0x1afe59,null))['catch'](handleError(_0x1afe59,null));};exports[_0x3287('0x23')]=function(_0x553ecf,_0x31da10){return db[_0x3287('0x2c')]['find']({'where':{'id':_0x553ecf[_0x3287('0x44')]['id']}})['then'](handleEntityNotFound(_0x31da10,null))[_0x3287('0x22')](removeEntity(_0x31da10,null))[_0x3287('0x48')](handleError(_0x31da10,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index b604b94..bbea83f 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 _0x450a=['./variable.attributes','define','Variable','tools_variables','lodash','util','moment','bluebird','path','rimraf'];(function(_0x29f476,_0x2db883){var _0x18ded1=function(_0x221cc6){while(--_0x221cc6){_0x29f476['push'](_0x29f476['shift']());}};_0x18ded1(++_0x2db883);}(_0x450a,0x11c));var _0xa450=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x450a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xa450('0x0'));var util=require(_0xa450('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa450('0x2'));var BPromise=require(_0xa450('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa450('0x4'));var rimraf=require(_0xa450('0x5'));var config=require('../../config/environment');var attributes=require(_0xa450('0x6'));module['exports']=function(_0x4e42c6,_0x15efef){return _0x4e42c6[_0xa450('0x7')](_0xa450('0x8'),attributes,{'tableName':_0xa450('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed65=['exports','define','Variable','tools_variables','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0xed65,0xd6));var _0x5ed6=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0xed65[_0x1a21ff];return _0x25afc1;};'use strict';var _=require('lodash');var util=require(_0x5ed6('0x0'));var logger=require(_0x5ed6('0x1'))(_0x5ed6('0x2'));var moment=require(_0x5ed6('0x3'));var BPromise=require(_0x5ed6('0x4'));var rp=require(_0x5ed6('0x5'));var fs=require('fs');var path=require(_0x5ed6('0x6'));var rimraf=require(_0x5ed6('0x7'));var config=require(_0x5ed6('0x8'));var attributes=require(_0x5ed6('0x9'));module[_0x5ed6('0xa')]=function(_0x115110,_0x2e8ed2){return _0x115110[_0x5ed6('0xb')](_0x5ed6('0xc'),attributes,{'tableName':_0x5ed6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 98f0c99..1d37659 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 _0x03b3=['result','catch','ShowVariable','find','options','raw','where','attributes','include','map','model','info','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x03b3,0x138));var _0x303b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03b3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x303b('0x0'));var rs=require(_0x303b('0x1'));var fs=require('fs');var Redis=require(_0x303b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x303b('0x3'));var logger=require(_0x303b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x303b('0x5'));var client=jayson[_0x303b('0x6')][_0x303b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1bdac1,_0x45be9c,_0x7e450a){return new BPromise(function(_0x5b9a40,_0x259973){return client[_0x303b('0x8')](_0x1bdac1,_0x7e450a)[_0x303b('0x9')](function(_0x415130){logger['info'](_0x303b('0xa'),_0x45be9c,_0x303b('0xb'));logger[_0x303b('0xc')](_0x303b('0xd'),_0x45be9c,_0x303b('0xb'),JSON[_0x303b('0xe')](_0x415130));if(_0x415130['error']){if(_0x415130[_0x303b('0xf')][_0x303b('0x10')]===0x1f4){logger[_0x303b('0xf')]('Variable,\x20%s,\x20%s',_0x45be9c,_0x415130[_0x303b('0xf')][_0x303b('0x11')]);return _0x259973(_0x415130[_0x303b('0xf')][_0x303b('0x11')]);}logger[_0x303b('0xf')](_0x303b('0xa'),_0x45be9c,_0x415130[_0x303b('0xf')][_0x303b('0x11')]);return _0x5b9a40(_0x415130[_0x303b('0xf')]['message']);}else{logger['info'](_0x303b('0xa'),_0x45be9c,_0x303b('0xb'));_0x5b9a40(_0x415130[_0x303b('0x12')][_0x303b('0x11')]);}})[_0x303b('0x13')](function(_0xaa5ed9){logger[_0x303b('0xf')]('Variable,\x20%s,\x20%s',_0x45be9c,_0xaa5ed9);_0x259973(_0xaa5ed9);});});}exports[_0x303b('0x14')]=function(_0x58c1b3){var _0x34c6c2=this;return new Promise(function(_0x47db46,_0x50af7){return db['Variable'][_0x303b('0x15')]({'raw':_0x58c1b3['options']?_0x58c1b3[_0x303b('0x16')][_0x303b('0x17')]===undefined?!![]:![]:!![],'where':_0x58c1b3[_0x303b('0x16')]?_0x58c1b3['options'][_0x303b('0x18')]||null:null,'attributes':_0x58c1b3[_0x303b('0x16')]?_0x58c1b3[_0x303b('0x16')][_0x303b('0x19')]||null:null,'include':_0x58c1b3[_0x303b('0x16')]?_0x58c1b3[_0x303b('0x16')][_0x303b('0x1a')]?_[_0x303b('0x1b')](_0x58c1b3['options'][_0x303b('0x1a')],function(_0x5ed943){return{'model':db[_0x5ed943[_0x303b('0x1c')]],'as':_0x5ed943['as'],'attributes':_0x5ed943['attributes'],'include':_0x5ed943[_0x303b('0x1a')]?_[_0x303b('0x1b')](_0x5ed943[_0x303b('0x1a')],function(_0x36142d){return{'model':db[_0x36142d[_0x303b('0x1c')]],'as':_0x36142d['as'],'attributes':_0x36142d['attributes'],'include':_0x36142d[_0x303b('0x1a')]?_[_0x303b('0x1b')](_0x36142d[_0x303b('0x1a')],function(_0x46ceae){return{'model':db[_0x46ceae[_0x303b('0x1c')]],'as':_0x46ceae['as'],'attributes':_0x46ceae[_0x303b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55bff2){logger[_0x303b('0x1d')]('ShowVariable',_0x58c1b3);logger[_0x303b('0xc')](_0x303b('0x14'),_0x58c1b3,JSON[_0x303b('0xe')](_0x55bff2));_0x47db46(_0x55bff2);})[_0x303b('0x13')](function(_0x44bf38){logger[_0x303b('0xf')]('ShowVariable',_0x44bf38[_0x303b('0x11')],_0x58c1b3);_0x50af7(_0x34c6c2[_0x303b('0xf')](0x1f4,_0x44bf38[_0x303b('0x11')]));});});}; \ No newline at end of file +var _0x2344=['Variable,\x20%s,\x20%s,\x20%s','stringify','code','error','Variable,\x20%s,\x20%s','message','info','result','catch','ShowVariable','find','options','raw','include','model','map','attributes','debug','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x554f93,_0x443fe8){var _0x1eaa99=function(_0x55cc8f){while(--_0x55cc8f){_0x554f93['push'](_0x554f93['shift']());}};_0x1eaa99(++_0x443fe8);}(_0x2344,0xb2));var _0x4234=function(_0x5d71da,_0x107a9a){_0x5d71da=_0x5d71da-0x0;var _0x37740=_0x2344[_0x5d71da];return _0x37740;};'use strict';var _=require('lodash');var util=require(_0x4234('0x0'));var moment=require(_0x4234('0x1'));var BPromise=require('bluebird');var rs=require(_0x4234('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4234('0x3'))['db'];var utils=require(_0x4234('0x4'));var logger=require(_0x4234('0x5'))(_0x4234('0x6'));var config=require(_0x4234('0x7'));var jayson=require(_0x4234('0x8'));var client=jayson[_0x4234('0x9')][_0x4234('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4922d5,_0x15d8e0,_0x19c153){return new BPromise(function(_0x441898,_0x55e305){return client[_0x4234('0xb')](_0x4922d5,_0x19c153)[_0x4234('0xc')](function(_0x2b91e7){logger['info']('Variable,\x20%s,\x20%s',_0x15d8e0,_0x4234('0xd'));logger['debug'](_0x4234('0xe'),_0x15d8e0,'request\x20sent',JSON[_0x4234('0xf')](_0x2b91e7));if(_0x2b91e7['error']){if(_0x2b91e7['error'][_0x4234('0x10')]===0x1f4){logger[_0x4234('0x11')](_0x4234('0x12'),_0x15d8e0,_0x2b91e7['error'][_0x4234('0x13')]);return _0x55e305(_0x2b91e7[_0x4234('0x11')][_0x4234('0x13')]);}logger[_0x4234('0x11')](_0x4234('0x12'),_0x15d8e0,_0x2b91e7[_0x4234('0x11')][_0x4234('0x13')]);return _0x441898(_0x2b91e7[_0x4234('0x11')]['message']);}else{logger[_0x4234('0x14')](_0x4234('0x12'),_0x15d8e0,_0x4234('0xd'));_0x441898(_0x2b91e7[_0x4234('0x15')][_0x4234('0x13')]);}})[_0x4234('0x16')](function(_0x2b49d2){logger[_0x4234('0x11')](_0x4234('0x12'),_0x15d8e0,_0x2b49d2);_0x55e305(_0x2b49d2);});});}exports[_0x4234('0x17')]=function(_0x91938f){var _0x292f06=this;return new Promise(function(_0x111adb,_0x5cd87d){return db['Variable'][_0x4234('0x18')]({'raw':_0x91938f[_0x4234('0x19')]?_0x91938f[_0x4234('0x19')][_0x4234('0x1a')]===undefined?!![]:![]:!![],'where':_0x91938f[_0x4234('0x19')]?_0x91938f[_0x4234('0x19')]['where']||null:null,'attributes':_0x91938f[_0x4234('0x19')]?_0x91938f['options']['attributes']||null:null,'include':_0x91938f[_0x4234('0x19')]?_0x91938f[_0x4234('0x19')][_0x4234('0x1b')]?_['map'](_0x91938f[_0x4234('0x19')]['include'],function(_0x3c5eb1){return{'model':db[_0x3c5eb1[_0x4234('0x1c')]],'as':_0x3c5eb1['as'],'attributes':_0x3c5eb1['attributes'],'include':_0x3c5eb1['include']?_[_0x4234('0x1d')](_0x3c5eb1[_0x4234('0x1b')],function(_0x4abae2){return{'model':db[_0x4abae2[_0x4234('0x1c')]],'as':_0x4abae2['as'],'attributes':_0x4abae2[_0x4234('0x1e')],'include':_0x4abae2[_0x4234('0x1b')]?_[_0x4234('0x1d')](_0x4abae2[_0x4234('0x1b')],function(_0x24244e){return{'model':db[_0x24244e[_0x4234('0x1c')]],'as':_0x24244e['as'],'attributes':_0x24244e[_0x4234('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4234('0xc')](function(_0x320c35){logger[_0x4234('0x14')](_0x4234('0x17'),_0x91938f);logger[_0x4234('0x1f')](_0x4234('0x17'),_0x91938f,JSON['stringify'](_0x320c35));_0x111adb(_0x320c35);})[_0x4234('0x16')](function(_0x428327){logger[_0x4234('0x11')](_0x4234('0x17'),_0x428327['message'],_0x91938f);_0x5cd87d(_0x292f06[_0x4234('0x11')](0x1f4,_0x428327[_0x4234('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index c1dbf84..e56e8c2 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 _0x5fdd=['./version.controller','index','get','/fetch','fetch','/reset','canUpdate','reset','/pull','isAuthenticated','pull','restart','/migrations','migrations','exports','../../components/auth/service'];(function(_0x575383,_0x4c25f4){var _0x127998=function(_0x2e7eaa){while(--_0x2e7eaa){_0x575383['push'](_0x575383['shift']());}};_0x127998(++_0x4c25f4);}(_0x5fdd,0x16f));var _0xd5fd=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0x5fdd[_0xd0cd0b];return _0x59cced;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xd5fd('0x0'));var controller=require(_0xd5fd('0x1'));router['get']('/',controller[_0xd5fd('0x2')]);router[_0xd5fd('0x3')](_0xd5fd('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xd5fd('0x5')]);router[_0xd5fd('0x3')](_0xd5fd('0x6'),auth['isAuthenticated'](),auth[_0xd5fd('0x7')](),controller[_0xd5fd('0x8')]);router[_0xd5fd('0x3')](_0xd5fd('0x9'),auth[_0xd5fd('0xa')](),auth['canUpdate'](),controller[_0xd5fd('0xb')]);router['get']('/restart',auth['isAuthenticated'](),controller[_0xd5fd('0xc')]);router[_0xd5fd('0x3')](_0xd5fd('0xd'),controller[_0xd5fd('0xe')]);module[_0xd5fd('0xf')]=router; \ No newline at end of file +var _0x8470=['restart','/migrations','migrations','exports','../../components/auth/service','index','/fetch','canUpdate','fetch','get','isAuthenticated','reset','/pull','pull'];(function(_0x3776b4,_0x19a1e3){var _0x1636d9=function(_0x320ae3){while(--_0x320ae3){_0x3776b4['push'](_0x3776b4['shift']());}};_0x1636d9(++_0x19a1e3);}(_0x8470,0x1d2));var _0x0847=function(_0x3edb09,_0x3fe7e9){_0x3edb09=_0x3edb09-0x0;var _0x315b55=_0x8470[_0x3edb09];return _0x315b55;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x0847('0x0'));var controller=require('./version.controller');router['get']('/',controller[_0x0847('0x1')]);router['get'](_0x0847('0x2'),auth['isAuthenticated'](),auth[_0x0847('0x3')](),controller[_0x0847('0x4')]);router[_0x0847('0x5')]('/reset',auth[_0x0847('0x6')](),auth['canUpdate'](),controller[_0x0847('0x7')]);router[_0x0847('0x5')](_0x0847('0x8'),auth[_0x0847('0x6')](),auth[_0x0847('0x3')](),controller[_0x0847('0x9')]);router[_0x0847('0x5')]('/restart',auth['isAuthenticated'](),controller[_0x0847('0xa')]);router['get'](_0x0847('0xb'),controller[_0x0847('0xc')]);module[_0x0847('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 59494c9..fa904bd 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 _0x79a3=['--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','info','restart','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','root','server','length','replace','.js','push','sort','sequelize','getQueryInterface','constructor','map','then','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','compare-versions','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','exports','version','query','latest','2.0.0','json','fetch','master','error','status','git\x20fetch','git\x20fetch\x20origin\x20master','reset'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0x79a3,0x80));var _0x379a=function(_0x12e6dc,_0x56c555){_0x12e6dc=_0x12e6dc-0x0;var _0x1743c0=_0x79a3[_0x12e6dc];return _0x1743c0;};'use strict';var Umzug=require(_0x379a('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x379a('0x1'));var pkginfo=require(_0x379a('0x2'))(module,'version');var compareVersions=require(_0x379a('0x3'));var exec=require('child_process')['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x379a('0x4'));var pm2=require(_0x379a('0x5'));var logger=require(_0x379a('0x6'))(_0x379a('0x7'));var git=require(_0x379a('0x8'))(config['root']);exports['index']=function(_0x484a91,_0x23e684){var _0x11d27d={'current':module[_0x379a('0x9')][_0x379a('0xa')],'phonebar':0x2};if(_0x484a91[_0x379a('0xb')]&&_0x484a91[_0x379a('0xb')][_0x379a('0xc')]){return git['fetch']()['tags'](function(_0x1f163a,_0x539147){_0x11d27d['latest']=(_0x1f163a?module[_0x379a('0x9')][_0x379a('0xa')]:_0x539147[_0x379a('0xc')])||_0x379a('0xd');return _0x23e684['status'](0xc8)['json'](_0x11d27d);});}else{return _0x23e684['status'](0xc8)[_0x379a('0xe')](_0x11d27d);}};exports[_0x379a('0xf')]=function(_0x21d65a,_0x17adab){return git['fetch'](['origin',_0x379a('0x10')],function(_0x1c04ea){if(_0x1c04ea){logger[_0x379a('0x11')](_0x1c04ea);return _0x17adab[_0x379a('0x12')](0x1f4)['json'](_0x1c04ea);}logger['info'](_0x379a('0x13'));return _0x17adab['status'](0xc8)[_0x379a('0xe')]({'output':_0x379a('0x14')});});};exports[_0x379a('0x15')]=function(_0x5828dc,_0x48f0a9){return git[_0x379a('0x15')]([_0x379a('0x16'),'FETCH_HEAD'],function(_0x200cfd){if(_0x200cfd){logger[_0x379a('0x11')](_0x200cfd);return _0x48f0a9['status'](0x1f4)['json'](_0x200cfd);}logger['info'](_0x379a('0x17'));return _0x48f0a9['status'](0xc8)[_0x379a('0xe')]({'output':_0x379a('0x18')});});};exports[_0x379a('0x19')]=function(_0x120997,_0x44433a){exec(_0x379a('0x1a'),function(_0x1d3f0f,_0x1b1b98,_0x4c0dda){logger[_0x379a('0x1b')](_0x1b1b98);logger[_0x379a('0x1b')](_0x4c0dda);if(_0x1d3f0f){logger[_0x379a('0x11')](_0x1d3f0f);return _0x44433a[_0x379a('0x12')](0x1f4)[_0x379a('0xe')](_0x1d3f0f);}return _0x44433a[_0x379a('0x12')](0xc8)[_0x379a('0xe')]({'output':_0x1b1b98});});};exports['restart']=function(_0x285c34,_0x2379a3){return pm2[_0x379a('0x1c')]('motion2')['then'](function(_0x3fc6c8){logger['info'](_0x379a('0x1d'),_0x3fc6c8);return _0x2379a3[_0x379a('0x12')](0xc8)['json']({'output':_0x379a('0x1e')});})[_0x379a('0x1f')](function(_0x19f945){logger['error'](_0x19f945);return _0x2379a3[_0x379a('0x12')](0x1f4)['json'](_0x19f945);});};exports[_0x379a('0x20')]=function(_0x33d5f7,_0xa803f7){var _0x3f92b1=fs['readdirSync'](path[_0x379a('0x21')](config[_0x379a('0x22')],_0x379a('0x23'),_0x379a('0x20')));var _0x30c9ab=[];for(var _0x5c68f2=0x0;_0x5c68f2<_0x3f92b1[_0x379a('0x24')];_0x5c68f2++){var _0x37f538=_0x3f92b1[_0x5c68f2][_0x379a('0x25')](_0x379a('0x26'),'');if(compareVersions(module[_0x379a('0x9')]['version'],_0x37f538)===-0x1){_0x30c9ab[_0x379a('0x27')](_0x37f538);}}if(_0x30c9ab[_0x379a('0x24')]){var _0x85c61e=_0x30c9ab[_0x379a('0x28')](compareVersions);var _0x1ee19b=new Umzug({'storage':_0x379a('0x29'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x379a('0xa')},'migrations':{'params':[db['sequelize'][_0x379a('0x2a')](),db[_0x379a('0x29')][_0x379a('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config[_0x379a('0x22')],_0x379a('0x23'),_0x379a('0x20')),'pattern':/\.js$/}});_0x1ee19b['up']({'migrations':_[_0x379a('0x2c')](_0x85c61e,function(_0x5e4e30){return _0x5e4e30+_0x379a('0x26');})})[_0x379a('0x2d')](function(){return _0xa803f7[_0x379a('0x12')](0xc8)[_0x379a('0xe')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x379a('0x9')][_0x379a('0xa')]+_0x379a('0x2e')+_[_0x379a('0x2f')](_0x85c61e),'migrations':_[_0x379a('0x21')](_0x85c61e)});})[_0x379a('0x1f')](function(_0x1d0249){if(_0x1d0249 instanceof db[_0x379a('0x29')][_0x379a('0x30')]){return _0xa803f7[_0x379a('0x12')](0xc8)['json']({'output':_0x379a('0x31')});}else{return _0xa803f7[_0x379a('0x12')](0x1f4)[_0x379a('0xe')](_0x1d0249);}});}else{return _0xa803f7['status'](0xc8)[_0x379a('0xe')]({'output':_0x379a('0x31')});}}; \ No newline at end of file +var _0xde46=['join','migrations','length','replace','sort','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','sequelize','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','root','exports','version','query','latest','fetch','tags','2.0.0','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync'];(function(_0x284350,_0x5eaed7){var _0x56567a=function(_0x597fe4){while(--_0x597fe4){_0x284350['push'](_0x284350['shift']());}};_0x56567a(++_0x5eaed7);}(_0xde46,0x14e));var _0x6de4=function(_0x29779e,_0x52f4a3){_0x29779e=_0x29779e-0x0;var _0x52b6c8=_0xde46[_0x29779e];return _0x52b6c8;};'use strict';var Umzug=require(_0x6de4('0x0'));var path=require(_0x6de4('0x1'));var fs=require('fs');var _=require(_0x6de4('0x2'));var pkginfo=require(_0x6de4('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x6de4('0x4'))['exec'];var db=require(_0x6de4('0x5'))['db'];var config=require(_0x6de4('0x6'));var pm2=require(_0x6de4('0x7'));var logger=require(_0x6de4('0x8'))('update');var git=require('simple-git')(config[_0x6de4('0x9')]);exports['index']=function(_0xb20ddf,_0x12d3bb){var _0x503d50={'current':module[_0x6de4('0xa')][_0x6de4('0xb')],'phonebar':0x2};if(_0xb20ddf[_0x6de4('0xc')]&&_0xb20ddf[_0x6de4('0xc')][_0x6de4('0xd')]){return git[_0x6de4('0xe')]()[_0x6de4('0xf')](function(_0x3b2c5b,_0x3fa47e){_0x503d50[_0x6de4('0xd')]=(_0x3b2c5b?module[_0x6de4('0xa')]['version']:_0x3fa47e[_0x6de4('0xd')])||_0x6de4('0x10');return _0x12d3bb[_0x6de4('0x11')](0xc8)[_0x6de4('0x12')](_0x503d50);});}else{return _0x12d3bb[_0x6de4('0x11')](0xc8)[_0x6de4('0x12')](_0x503d50);}};exports[_0x6de4('0xe')]=function(_0x189520,_0x547798){return git[_0x6de4('0xe')](['origin',_0x6de4('0x13')],function(_0x40de53){if(_0x40de53){logger[_0x6de4('0x14')](_0x40de53);return _0x547798['status'](0x1f4)[_0x6de4('0x12')](_0x40de53);}logger[_0x6de4('0x15')](_0x6de4('0x16'));return _0x547798[_0x6de4('0x11')](0xc8)['json']({'output':_0x6de4('0x17')});});};exports['reset']=function(_0x59f06b,_0x162f59){return git[_0x6de4('0x18')]([_0x6de4('0x19'),_0x6de4('0x1a')],function(_0xe8af1a){if(_0xe8af1a){logger[_0x6de4('0x14')](_0xe8af1a);return _0x162f59[_0x6de4('0x11')](0x1f4)[_0x6de4('0x12')](_0xe8af1a);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x162f59[_0x6de4('0x11')](0xc8)['json']({'output':_0x6de4('0x1b')});});};exports[_0x6de4('0x1c')]=function(_0x51bed3,_0x2aa767){exec(_0x6de4('0x1d'),function(_0x58d5d7,_0x2ea2cd,_0x20c4d0){logger[_0x6de4('0x15')](_0x2ea2cd);logger[_0x6de4('0x15')](_0x20c4d0);if(_0x58d5d7){logger['error'](_0x58d5d7);return _0x2aa767[_0x6de4('0x11')](0x1f4)['json'](_0x58d5d7);}return _0x2aa767[_0x6de4('0x11')](0xc8)[_0x6de4('0x12')]({'output':_0x2ea2cd});});};exports[_0x6de4('0x1e')]=function(_0x42c06b,_0xc11227){return pm2[_0x6de4('0x1e')](_0x6de4('0x1f'))[_0x6de4('0x20')](function(_0x1bf488){logger[_0x6de4('0x15')](_0x6de4('0x21'),_0x1bf488);return _0xc11227['status'](0xc8)[_0x6de4('0x12')]({'output':_0x6de4('0x22')});})[_0x6de4('0x23')](function(_0x5dd6f4){logger[_0x6de4('0x14')](_0x5dd6f4);return _0xc11227[_0x6de4('0x11')](0x1f4)['json'](_0x5dd6f4);});};exports['migrations']=function(_0x348b28,_0x579476){var _0x534dc0=fs[_0x6de4('0x24')](path[_0x6de4('0x25')](config[_0x6de4('0x9')],'server',_0x6de4('0x26')));var _0xcc9afc=[];for(var _0x248d8e=0x0;_0x248d8e<_0x534dc0[_0x6de4('0x27')];_0x248d8e++){var _0x579a10=_0x534dc0[_0x248d8e][_0x6de4('0x28')]('.js','');if(compareVersions(module[_0x6de4('0xa')][_0x6de4('0xb')],_0x579a10)===-0x1){_0xcc9afc['push'](_0x579a10);}}if(_0xcc9afc[_0x6de4('0x27')]){var _0x6f93f5=_0xcc9afc[_0x6de4('0x29')](compareVersions);var _0x2787a0=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x6de4('0x2a')],'modelName':_0x6de4('0x2a'),'columnName':_0x6de4('0xb')},'migrations':{'params':[db['sequelize'][_0x6de4('0x2b')](),db['sequelize']['constructor'],function(){throw new Error(_0x6de4('0x2c'));}],'path':path[_0x6de4('0x25')](config['root'],_0x6de4('0x2d'),_0x6de4('0x26')),'pattern':/\.js$/}});_0x2787a0['up']({'migrations':_[_0x6de4('0x2e')](_0x6f93f5,function(_0x43bf8d){return _0x43bf8d+_0x6de4('0x2f');})})[_0x6de4('0x20')](function(){return _0x579476[_0x6de4('0x11')](0xc8)[_0x6de4('0x12')]({'output':_0x6de4('0x30')+module[_0x6de4('0xa')][_0x6de4('0xb')]+_0x6de4('0x31')+_['last'](_0x6f93f5),'migrations':_[_0x6de4('0x25')](_0x6f93f5)});})[_0x6de4('0x23')](function(_0x312213){if(_0x312213 instanceof db[_0x6de4('0x32')][_0x6de4('0x33')]){return _0x579476['status'](0xc8)[_0x6de4('0x12')]({'output':_0x6de4('0x34')});}else{return _0x579476[_0x6de4('0x11')](0x1f4)[_0x6de4('0x12')](_0x312213);}});}else{return _0x579476[_0x6de4('0x11')](0xc8)[_0x6de4('0x12')]({'output':_0x6de4('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 4125003..102ea57 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 _0xae6c=['isAuthenticated','describe','/:id','post','create','put','update','destroy','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index'];(function(_0xaa2b0d,_0x3a95b5){var _0x304ce5=function(_0x32b9be){while(--_0x32b9be){_0xaa2b0d['push'](_0xaa2b0d['shift']());}};_0x304ce5(++_0x3a95b5);}(_0xae6c,0x128));var _0xcae6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xae6c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xcae6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcae6('0x1'));var express=require(_0xcae6('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xcae6('0x3'));var config=require(_0xcae6('0x4'));var controller=require(_0xcae6('0x5'));router[_0xcae6('0x6')]('/',auth['isAuthenticated'](),controller[_0xcae6('0x7')]);router[_0xcae6('0x6')]('/describe',auth[_0xcae6('0x8')](),controller[_0xcae6('0x9')]);router[_0xcae6('0x6')](_0xcae6('0xa'),auth[_0xcae6('0x8')](),controller['show']);router[_0xcae6('0xb')]('/',auth[_0xcae6('0x8')](),controller[_0xcae6('0xc')]);router[_0xcae6('0xd')](_0xcae6('0xa'),auth[_0xcae6('0x8')](),controller[_0xcae6('0xe')]);router['delete'](_0xcae6('0xa'),auth[_0xcae6('0x8')](),controller[_0xcae6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0bfb=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','Router','../../components/auth/service'];(function(_0x354b1c,_0x1e31a6){var _0x23b9b4=function(_0x48b313){while(--_0x48b313){_0x354b1c['push'](_0x354b1c['shift']());}};_0x23b9b4(++_0x1e31a6);}(_0x0bfb,0x178));var _0xb0bf=function(_0x3eaeea,_0x2a93a3){_0x3eaeea=_0x3eaeea-0x0;var _0x21d7bd=_0x0bfb[_0x3eaeea];return _0x21d7bd;};'use strict';var multer=require('multer');var util=require(_0xb0bf('0x0'));var path=require('path');var timeout=require(_0xb0bf('0x1'));var express=require('express');var router=express[_0xb0bf('0x2')]();var auth=require(_0xb0bf('0x3'));var interaction=require(_0xb0bf('0x4'));var config=require(_0xb0bf('0x5'));var controller=require(_0xb0bf('0x6'));router[_0xb0bf('0x7')]('/',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x9')]);router['get'](_0xb0bf('0xa'),auth[_0xb0bf('0x8')](),controller['describe']);router[_0xb0bf('0x7')](_0xb0bf('0xb'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0xc')]);router[_0xb0bf('0xd')]('/',auth['isAuthenticated'](),controller[_0xb0bf('0xe')]);router[_0xb0bf('0xf')](_0xb0bf('0xb'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x10')]);router[_0xb0bf('0x11')](_0xb0bf('0xb'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index a57f7a9..8624739 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 _0x038b=['BOOLEAN','exports','STRING','DATE','INTEGER'];(function(_0x48a9ef,_0x241e0c){var _0x4d244b=function(_0x19b28a){while(--_0x19b28a){_0x48a9ef['push'](_0x48a9ef['shift']());}};_0x4d244b(++_0x241e0c);}(_0x038b,0x114));var _0xb038=function(_0x67d315,_0x1155ad){_0x67d315=_0x67d315-0x0;var _0x16fbad=_0x038b[_0x67d315];return _0x16fbad;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'type':{'type':Sequelize[_0xb038('0x1')]},'uniqueid':{'type':Sequelize[_0xb038('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb038('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb038('0x1')]},'membername':{'type':Sequelize[_0xb038('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xb038('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xb038('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xb038('0x3')]},'agentcomplete':{'type':Sequelize[_0xb038('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb038('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xb038('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb038('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb038('0x1')]},'channelstate':{'type':Sequelize[_0xb038('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb038('0x1')]},'connectedlinename':{'type':Sequelize[_0xb038('0x1')]},'language':{'type':Sequelize[_0xb038('0x1')]},'accountcode':{'type':Sequelize[_0xb038('0x1')]},'context':{'type':Sequelize[_0xb038('0x1')]},'exten':{'type':Sequelize[_0xb038('0x1')]},'priority':{'type':Sequelize[_0xb038('0x1')]},'destchannel':{'type':Sequelize[_0xb038('0x1')]},'destchannelstate':{'type':Sequelize[_0xb038('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb038('0x1')]},'destcalleridnum':{'type':Sequelize[_0xb038('0x1')]},'destcalleridname':{'type':Sequelize[_0xb038('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xb038('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xb038('0x1')]},'destlanguage':{'type':Sequelize[_0xb038('0x1')]},'destaccountcode':{'type':Sequelize[_0xb038('0x1')]},'destcontext':{'type':Sequelize[_0xb038('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb038('0x1')]},'destuniqueid':{'type':Sequelize[_0xb038('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb038('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xb038('0x1')]},'transfer':{'type':Sequelize[_0xb038('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb038('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xb038('0x1')]},'transferuniqueid':{'type':Sequelize[_0xb038('0x1')]},'agententerreason':{'type':Sequelize[_0xb038('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4819=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4819,0xcd));var _0x9481=function(_0x5265d5,_0x51a837){_0x5265d5=_0x5265d5-0x0;var _0x44899d=_0x4819[_0x5265d5];return _0x44899d;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'type':{'type':Sequelize[_0x9481('0x1')]},'uniqueid':{'type':Sequelize[_0x9481('0x1')]},'calleridnum':{'type':Sequelize[_0x9481('0x1')]},'calleridname':{'type':Sequelize[_0x9481('0x1')]},'queue':{'type':Sequelize[_0x9481('0x1')]},'interface':{'type':Sequelize[_0x9481('0x1')]},'membername':{'type':Sequelize[_0x9481('0x1')]},'agentcalledAt':{'type':Sequelize[_0x9481('0x2')]},'agentconnectAt':{'type':Sequelize[_0x9481('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x9481('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9481('0x4')]},'agentacw':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x9481('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9481('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9481('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9481('0x1')]},'connectedlinename':{'type':Sequelize[_0x9481('0x1')]},'language':{'type':Sequelize[_0x9481('0x1')]},'accountcode':{'type':Sequelize[_0x9481('0x1')]},'context':{'type':Sequelize[_0x9481('0x1')]},'exten':{'type':Sequelize[_0x9481('0x1')]},'priority':{'type':Sequelize[_0x9481('0x1')]},'destchannel':{'type':Sequelize[_0x9481('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9481('0x1')]},'destcalleridname':{'type':Sequelize[_0x9481('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9481('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x9481('0x1')]},'destlanguage':{'type':Sequelize[_0x9481('0x1')]},'destaccountcode':{'type':Sequelize[_0x9481('0x1')]},'destcontext':{'type':Sequelize[_0x9481('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9481('0x1')]},'destuniqueid':{'type':Sequelize[_0x9481('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x9481('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9481('0x1')],'comment':_0x9481('0x5')},'transferexten':{'type':Sequelize[_0x9481('0x1')]},'transferuniqueid':{'type':Sequelize[_0x9481('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 4eb8485..28ca7e0 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 _0x66e1=['api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','map','VoiceAgentReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','length','create','update','body','find','describe','eml-format','rimraf','fast-json-patch','mustache','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x4c23f7,_0x146a72){var _0x49417a=function(_0x166707){while(--_0x166707){_0x4c23f7['push'](_0x4c23f7['shift']());}};_0x49417a(++_0x146a72);}(_0x66e1,0xbf));var _0x166e=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x66e1[_0x258b93];return _0x35484b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x166e('0x0'));var rimraf=require(_0x166e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x166e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x166e('0x3'));var util=require('util');var path=require(_0x166e('0x4'));var sox=require(_0x166e('0x5'));var csv=require(_0x166e('0x6'));var ejs=require(_0x166e('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x166e('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x166e('0x9'));var toCsv=require(_0x166e('0x6'));var querystring=require(_0x166e('0xa'));var Papa=require(_0x166e('0xb'));var Redis=require(_0x166e('0xc'));var authService=require(_0x166e('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x166e('0xe'));var logger=require(_0x166e('0xf'))(_0x166e('0x10'));var utils=require(_0x166e('0x11'));var config=require(_0x166e('0x12'));var db=require(_0x166e('0x13'))['db'];function respondWithStatusCode(_0x38c079,_0x5843ca){_0x5843ca=_0x5843ca||0xcc;return function(_0xc539d0){if(_0xc539d0){return _0x38c079['sendStatus'](_0x5843ca);}return _0x38c079[_0x166e('0x14')](_0x5843ca)[_0x166e('0x15')]();};}function respondWithResult(_0x38a369,_0x211990){_0x211990=_0x211990||0xc8;return function(_0x5ac7e0){if(_0x5ac7e0){return _0x38a369[_0x166e('0x14')](_0x211990)[_0x166e('0x16')](_0x5ac7e0);}};}function respondWithFilteredResult(_0x222178,_0x127d38){return function(_0x3c25e6){if(_0x3c25e6){var _0x196335=_0x3c25e6[_0x166e('0x17')],_0xaa6e03=_0x127d38[_0x166e('0x18')],_0x366fdc=_0x127d38[_0x166e('0x18')]+_0x127d38[_0x166e('0x19')],_0x52fdaa;if(_0x366fdc>=_0x196335){_0x366fdc=_0x196335;_0x52fdaa=0xc8;}else{_0x52fdaa=0xce;}_0x222178[_0x166e('0x14')](_0x52fdaa);return _0x222178['set'](_0x166e('0x1a'),_0xaa6e03+'-'+_0x366fdc+'/'+_0x196335)[_0x166e('0x16')](_0x3c25e6);}return null;};}function patchUpdates(_0x3b3e4d){return function(_0x36e58e){try{jsonpatch[_0x166e('0x1b')](_0x36e58e,_0x3b3e4d,!![]);}catch(_0x204cf0){return BPromise[_0x166e('0x1c')](_0x204cf0);}return _0x36e58e[_0x166e('0x1d')]();};}function saveUpdates(_0x135d04,_0x37e249){return function(_0x54fc52){if(_0x54fc52){return _0x54fc52['update'](_0x135d04)['then'](function(_0x596e78){return _0x596e78;});}return null;};}function removeEntity(_0x127c62,_0x511565){return function(_0x8268f7){if(_0x8268f7){return _0x8268f7[_0x166e('0x1e')]()[_0x166e('0x1f')](function(){_0x127c62['status'](0xcc)[_0x166e('0x15')]();});}};}function handleEntityNotFound(_0x4f840b,_0x48b210){return function(_0x2fef72){if(!_0x2fef72){_0x4f840b[_0x166e('0x20')](0x194);}return _0x2fef72;};}function handleError(_0x56aee0,_0x120d87){_0x120d87=_0x120d87||0x1f4;return function(_0x2c5ea3){logger[_0x166e('0x21')](_0x2c5ea3[_0x166e('0x22')]);if(_0x2c5ea3[_0x166e('0x23')]){delete _0x2c5ea3[_0x166e('0x23')];}_0x56aee0[_0x166e('0x14')](_0x120d87)[_0x166e('0x24')](_0x2c5ea3);};}exports['index']=function(_0x589df3,_0x413f19){var _0x5002ab={},_0x287aa={},_0x5906dd={'count':0x0,'rows':[]};var _0x440e3e=_[_0x166e('0x25')](db[_0x166e('0x26')][_0x166e('0x27')],function(_0x582d0c){return{'name':_0x582d0c[_0x166e('0x28')],'type':_0x582d0c['type']['key']};});_0x287aa[_0x166e('0x29')]=_[_0x166e('0x25')](_0x440e3e,'name');_0x287aa[_0x166e('0x2a')]=_['keys'](_0x589df3[_0x166e('0x2a')]);_0x287aa[_0x166e('0x2b')]=_[_0x166e('0x2c')](_0x287aa[_0x166e('0x29')],_0x287aa['query']);_0x5002ab[_0x166e('0x2d')]=_[_0x166e('0x2c')](_0x287aa[_0x166e('0x29')],qs['fields'](_0x589df3['query'][_0x166e('0x2e')]));_0x5002ab[_0x166e('0x2d')]=_0x5002ab[_0x166e('0x2d')]['length']?_0x5002ab[_0x166e('0x2d')]:_0x287aa[_0x166e('0x29')];if(!_0x589df3[_0x166e('0x2a')][_0x166e('0x2f')](_0x166e('0x30'))){_0x5002ab[_0x166e('0x19')]=qs[_0x166e('0x19')](_0x589df3[_0x166e('0x2a')]['limit']);_0x5002ab[_0x166e('0x18')]=qs[_0x166e('0x18')](_0x589df3[_0x166e('0x2a')][_0x166e('0x18')]);}_0x5002ab[_0x166e('0x31')]=qs[_0x166e('0x32')](_0x589df3[_0x166e('0x2a')][_0x166e('0x32')]);_0x5002ab['where']=qs['filters'](_[_0x166e('0x33')](_0x589df3[_0x166e('0x2a')],_0x287aa[_0x166e('0x2b')]));if(_0x589df3[_0x166e('0x2a')][_0x166e('0x34')]){_0x5002ab[_0x166e('0x35')]=_[_0x166e('0x36')](_0x5002ab[_0x166e('0x35')],{'$or':_[_0x166e('0x25')](_0x440e3e,function(_0x4e7f21){if(_0x4e7f21['type']!==_0x166e('0x37')){var _0x2e6fab={};_0x2e6fab[_0x4e7f21[_0x166e('0x23')]]={'$like':'%'+_0x589df3[_0x166e('0x2a')][_0x166e('0x34')]+'%'};return _0x2e6fab;}})});}_0x5002ab=_[_0x166e('0x36')]({},_0x5002ab,_0x589df3[_0x166e('0x38')]);var _0x217b12={'where':_0x5002ab[_0x166e('0x35')]};return db[_0x166e('0x26')][_0x166e('0x17')](_0x217b12)[_0x166e('0x1f')](function(_0x214c3a){_0x5906dd[_0x166e('0x17')]=_0x214c3a;if(_0x589df3[_0x166e('0x2a')][_0x166e('0x39')]){_0x5002ab[_0x166e('0x3a')]=[{'all':!![]}];}return db[_0x166e('0x26')][_0x166e('0x3b')](_0x5002ab);})['then'](function(_0x53c486){_0x5906dd['rows']=_0x53c486;return _0x5906dd;})[_0x166e('0x1f')](respondWithFilteredResult(_0x413f19,_0x5002ab))[_0x166e('0x3c')](handleError(_0x413f19,null));};exports['show']=function(_0x3829b9,_0x476501){var _0x26f48f={'raw':![],'where':{'id':_0x3829b9[_0x166e('0x3d')]['id']}},_0x6973e4={};_0x6973e4[_0x166e('0x29')]=_[_0x166e('0x3e')](db['VoiceAgentReport'][_0x166e('0x27')]);_0x6973e4[_0x166e('0x2a')]=_['keys'](_0x3829b9[_0x166e('0x2a')]);_0x6973e4[_0x166e('0x2b')]=_[_0x166e('0x2c')](_0x6973e4[_0x166e('0x29')],_0x6973e4[_0x166e('0x2a')]);_0x26f48f['attributes']=_[_0x166e('0x2c')](_0x6973e4[_0x166e('0x29')],qs[_0x166e('0x2e')](_0x3829b9[_0x166e('0x2a')][_0x166e('0x2e')]));_0x26f48f['attributes']=_0x26f48f[_0x166e('0x2d')][_0x166e('0x3f')]?_0x26f48f[_0x166e('0x2d')]:_0x6973e4[_0x166e('0x29')];if(_0x3829b9[_0x166e('0x2a')]['includeAll']){_0x26f48f['include']=[{'all':!![]}];}_0x26f48f=_[_0x166e('0x36')]({},_0x26f48f,_0x3829b9[_0x166e('0x38')]);return db[_0x166e('0x26')]['find'](_0x26f48f)['then'](handleEntityNotFound(_0x476501,null))[_0x166e('0x1f')](respondWithResult(_0x476501,null))['catch'](handleError(_0x476501,null));};exports[_0x166e('0x40')]=function(_0x211e53,_0x29876f){return db[_0x166e('0x26')][_0x166e('0x40')](_0x211e53['body'],{})[_0x166e('0x1f')](respondWithResult(_0x29876f,0xc9))[_0x166e('0x3c')](handleError(_0x29876f,null));};exports[_0x166e('0x41')]=function(_0x1eec8c,_0x55170b){if(_0x1eec8c[_0x166e('0x42')]['id']){delete _0x1eec8c['body']['id'];}return db['VoiceAgentReport'][_0x166e('0x43')]({'where':{'id':_0x1eec8c[_0x166e('0x3d')]['id']}})[_0x166e('0x1f')](handleEntityNotFound(_0x55170b,null))[_0x166e('0x1f')](saveUpdates(_0x1eec8c['body'],null))[_0x166e('0x1f')](respondWithResult(_0x55170b,null))['catch'](handleError(_0x55170b,null));};exports['destroy']=function(_0x102130,_0xd11186){return db[_0x166e('0x26')][_0x166e('0x43')]({'where':{'id':_0x102130[_0x166e('0x3d')]['id']}})[_0x166e('0x1f')](handleEntityNotFound(_0xd11186,null))['then'](removeEntity(_0xd11186,null))[_0x166e('0x3c')](handleError(_0xd11186,null));};exports[_0x166e('0x44')]=function(_0x1c280c,_0x1b14b3){return db[_0x166e('0x26')]['describe']()[_0x166e('0x1f')](respondWithResult(_0x1b14b3,null))[_0x166e('0x3c')](handleError(_0x1b14b3,null));}; \ No newline at end of file +var _0xad45=['json','count','limit','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','VoiceAgentReport','rawAttributes','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','offset','order','sort','where','filter','merge','type','include','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x3d284f,_0x294866){var _0x2b2a77=function(_0x89f052){while(--_0x89f052){_0x3d284f['push'](_0x3d284f['shift']());}};_0x2b2a77(++_0x294866);}(_0xad45,0x6e));var _0x5ad4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xad45[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ad4('0x0'));var jsonpatch=require(_0x5ad4('0x1'));var rp=require(_0x5ad4('0x2'));var moment=require(_0x5ad4('0x3'));var BPromise=require(_0x5ad4('0x4'));var Mustache=require(_0x5ad4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5ad4('0x6'));var csv=require(_0x5ad4('0x7'));var ejs=require(_0x5ad4('0x8'));var fs=require('fs');var _=require(_0x5ad4('0x9'));var squel=require('squel');var crypto=require(_0x5ad4('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5ad4('0x7'));var querystring=require(_0x5ad4('0xb'));var Papa=require(_0x5ad4('0xc'));var Redis=require(_0x5ad4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5ad4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ad4('0xf'));var logger=require(_0x5ad4('0x10'))(_0x5ad4('0x11'));var utils=require(_0x5ad4('0x12'));var config=require(_0x5ad4('0x13'));var db=require(_0x5ad4('0x14'))['db'];function respondWithStatusCode(_0x80c36,_0xab02a4){_0xab02a4=_0xab02a4||0xcc;return function(_0x4ef8c6){if(_0x4ef8c6){return _0x80c36[_0x5ad4('0x15')](_0xab02a4);}return _0x80c36[_0x5ad4('0x16')](_0xab02a4)[_0x5ad4('0x17')]();};}function respondWithResult(_0x25ef9f,_0x29f826){_0x29f826=_0x29f826||0xc8;return function(_0x223e05){if(_0x223e05){return _0x25ef9f[_0x5ad4('0x16')](_0x29f826)[_0x5ad4('0x18')](_0x223e05);}};}function respondWithFilteredResult(_0x264f6c,_0x50a146){return function(_0x21cbd7){if(_0x21cbd7){var _0x2ea5a3=_0x21cbd7[_0x5ad4('0x19')],_0x10e83c=_0x50a146['offset'],_0x27964f=_0x50a146['offset']+_0x50a146[_0x5ad4('0x1a')],_0x16d918;if(_0x27964f>=_0x2ea5a3){_0x27964f=_0x2ea5a3;_0x16d918=0xc8;}else{_0x16d918=0xce;}_0x264f6c[_0x5ad4('0x16')](_0x16d918);return _0x264f6c['set'](_0x5ad4('0x1b'),_0x10e83c+'-'+_0x27964f+'/'+_0x2ea5a3)['json'](_0x21cbd7);}return null;};}function patchUpdates(_0x335b9c){return function(_0x221c46){try{jsonpatch[_0x5ad4('0x1c')](_0x221c46,_0x335b9c,!![]);}catch(_0x2322ff){return BPromise['reject'](_0x2322ff);}return _0x221c46['save']();};}function saveUpdates(_0x4b4aa5,_0x32b914){return function(_0x2224f6){if(_0x2224f6){return _0x2224f6[_0x5ad4('0x1d')](_0x4b4aa5)['then'](function(_0x305cba){return _0x305cba;});}return null;};}function removeEntity(_0x419283,_0x2fbea7){return function(_0x496133){if(_0x496133){return _0x496133[_0x5ad4('0x1e')]()[_0x5ad4('0x1f')](function(){_0x419283[_0x5ad4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x63c2ed,_0x17b877){return function(_0x12d61e){if(!_0x12d61e){_0x63c2ed[_0x5ad4('0x15')](0x194);}return _0x12d61e;};}function handleError(_0x2df796,_0x5614e1){_0x5614e1=_0x5614e1||0x1f4;return function(_0x16cefe){logger[_0x5ad4('0x20')](_0x16cefe[_0x5ad4('0x21')]);if(_0x16cefe['name']){delete _0x16cefe[_0x5ad4('0x22')];}_0x2df796['status'](_0x5614e1)[_0x5ad4('0x23')](_0x16cefe);};}exports[_0x5ad4('0x24')]=function(_0x224e98,_0x13b0c7){var _0x4b2466={},_0x3abd60={},_0x1322f1={'count':0x0,'rows':[]};var _0x572990=_[_0x5ad4('0x25')](db[_0x5ad4('0x26')][_0x5ad4('0x27')],function(_0xa9f5ad){return{'name':_0xa9f5ad['fieldName'],'type':_0xa9f5ad['type'][_0x5ad4('0x28')]};});_0x3abd60[_0x5ad4('0x29')]=_[_0x5ad4('0x25')](_0x572990,'name');_0x3abd60[_0x5ad4('0x2a')]=_['keys'](_0x224e98['query']);_0x3abd60[_0x5ad4('0x2b')]=_['intersection'](_0x3abd60['model'],_0x3abd60[_0x5ad4('0x2a')]);_0x4b2466[_0x5ad4('0x2c')]=_[_0x5ad4('0x2d')](_0x3abd60[_0x5ad4('0x29')],qs[_0x5ad4('0x2e')](_0x224e98[_0x5ad4('0x2a')]['fields']));_0x4b2466[_0x5ad4('0x2c')]=_0x4b2466[_0x5ad4('0x2c')]['length']?_0x4b2466['attributes']:_0x3abd60[_0x5ad4('0x29')];if(!_0x224e98[_0x5ad4('0x2a')][_0x5ad4('0x2f')]('nolimit')){_0x4b2466[_0x5ad4('0x1a')]=qs[_0x5ad4('0x1a')](_0x224e98[_0x5ad4('0x2a')][_0x5ad4('0x1a')]);_0x4b2466['offset']=qs[_0x5ad4('0x30')](_0x224e98['query'][_0x5ad4('0x30')]);}_0x4b2466[_0x5ad4('0x31')]=qs[_0x5ad4('0x32')](_0x224e98[_0x5ad4('0x2a')][_0x5ad4('0x32')]);_0x4b2466[_0x5ad4('0x33')]=qs[_0x5ad4('0x2b')](_['pick'](_0x224e98['query'],_0x3abd60[_0x5ad4('0x2b')]));if(_0x224e98[_0x5ad4('0x2a')][_0x5ad4('0x34')]){_0x4b2466[_0x5ad4('0x33')]=_[_0x5ad4('0x35')](_0x4b2466[_0x5ad4('0x33')],{'$or':_[_0x5ad4('0x25')](_0x572990,function(_0x13e1d4){if(_0x13e1d4[_0x5ad4('0x36')]!=='VIRTUAL'){var _0x36078d={};_0x36078d[_0x13e1d4[_0x5ad4('0x22')]]={'$like':'%'+_0x224e98['query'][_0x5ad4('0x34')]+'%'};return _0x36078d;}})});}_0x4b2466=_['merge']({},_0x4b2466,_0x224e98['options']);var _0x1b27ee={'where':_0x4b2466[_0x5ad4('0x33')]};return db[_0x5ad4('0x26')][_0x5ad4('0x19')](_0x1b27ee)['then'](function(_0x2301e8){_0x1322f1[_0x5ad4('0x19')]=_0x2301e8;if(_0x224e98[_0x5ad4('0x2a')]['includeAll']){_0x4b2466[_0x5ad4('0x37')]=[{'all':!![]}];}return db[_0x5ad4('0x26')]['findAll'](_0x4b2466);})[_0x5ad4('0x1f')](function(_0x1d2048){_0x1322f1[_0x5ad4('0x38')]=_0x1d2048;return _0x1322f1;})[_0x5ad4('0x1f')](respondWithFilteredResult(_0x13b0c7,_0x4b2466))[_0x5ad4('0x39')](handleError(_0x13b0c7,null));};exports[_0x5ad4('0x3a')]=function(_0x448f23,_0x402106){var _0x1670c5={'raw':![],'where':{'id':_0x448f23['params']['id']}},_0x5bd874={};_0x5bd874[_0x5ad4('0x29')]=_[_0x5ad4('0x3b')](db['VoiceAgentReport']['rawAttributes']);_0x5bd874['query']=_['keys'](_0x448f23[_0x5ad4('0x2a')]);_0x5bd874['filters']=_[_0x5ad4('0x2d')](_0x5bd874['model'],_0x5bd874['query']);_0x1670c5[_0x5ad4('0x2c')]=_[_0x5ad4('0x2d')](_0x5bd874[_0x5ad4('0x29')],qs[_0x5ad4('0x2e')](_0x448f23[_0x5ad4('0x2a')][_0x5ad4('0x2e')]));_0x1670c5[_0x5ad4('0x2c')]=_0x1670c5[_0x5ad4('0x2c')]['length']?_0x1670c5[_0x5ad4('0x2c')]:_0x5bd874['model'];if(_0x448f23[_0x5ad4('0x2a')][_0x5ad4('0x3c')]){_0x1670c5['include']=[{'all':!![]}];}_0x1670c5=_['merge']({},_0x1670c5,_0x448f23[_0x5ad4('0x3d')]);return db[_0x5ad4('0x26')][_0x5ad4('0x3e')](_0x1670c5)[_0x5ad4('0x1f')](handleEntityNotFound(_0x402106,null))['then'](respondWithResult(_0x402106,null))[_0x5ad4('0x39')](handleError(_0x402106,null));};exports[_0x5ad4('0x3f')]=function(_0x53967e,_0x5c75b9){return db['VoiceAgentReport'][_0x5ad4('0x3f')](_0x53967e[_0x5ad4('0x40')],{})[_0x5ad4('0x1f')](respondWithResult(_0x5c75b9,0xc9))[_0x5ad4('0x39')](handleError(_0x5c75b9,null));};exports[_0x5ad4('0x1d')]=function(_0x460b0a,_0x28e3eb){if(_0x460b0a[_0x5ad4('0x40')]['id']){delete _0x460b0a[_0x5ad4('0x40')]['id'];}return db[_0x5ad4('0x26')][_0x5ad4('0x3e')]({'where':{'id':_0x460b0a[_0x5ad4('0x41')]['id']}})[_0x5ad4('0x1f')](handleEntityNotFound(_0x28e3eb,null))[_0x5ad4('0x1f')](saveUpdates(_0x460b0a[_0x5ad4('0x40')],null))[_0x5ad4('0x1f')](respondWithResult(_0x28e3eb,null))[_0x5ad4('0x39')](handleError(_0x28e3eb,null));};exports[_0x5ad4('0x1e')]=function(_0x204475,_0x11edb3){return db[_0x5ad4('0x26')][_0x5ad4('0x3e')]({'where':{'id':_0x204475['params']['id']}})[_0x5ad4('0x1f')](handleEntityNotFound(_0x11edb3,null))[_0x5ad4('0x1f')](removeEntity(_0x11edb3,null))[_0x5ad4('0x39')](handleError(_0x11edb3,null));};exports[_0x5ad4('0x42')]=function(_0x1cbda6,_0x15eecc){return db[_0x5ad4('0x26')][_0x5ad4('0x42')]()[_0x5ad4('0x1f')](respondWithResult(_0x15eecc,null))['catch'](handleError(_0x15eecc,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 0afbe4b..e208d97 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 _0xeaaa=['uniqueid','lodash','util','../../config/logger','api','request-promise','../../config/environment','define','VoiceAgentReport'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xeaaa,0x13c));var _0xaeaa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeaaa[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xaeaa('0x0'));var util=require(_0xaeaa('0x1'));var logger=require(_0xaeaa('0x2'))(_0xaeaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaeaa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaeaa('0x5'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x18318d,_0x1d1d6c){return _0x18318d[_0xaeaa('0x6')](_0xaeaa('0x7'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xaeaa('0x8'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3da2=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','VoiceAgentReport'];(function(_0x1e3f14,_0x18c586){var _0x60e5b5=function(_0x302d1b){while(--_0x302d1b){_0x1e3f14['push'](_0x1e3f14['shift']());}};_0x60e5b5(++_0x18c586);}(_0x3da2,0x1b5));var _0x23da=function(_0x5bdea9,_0x33f532){_0x5bdea9=_0x5bdea9-0x0;var _0x16eead=_0x3da2[_0x5bdea9];return _0x16eead;};'use strict';var _=require(_0x23da('0x0'));var util=require(_0x23da('0x1'));var logger=require(_0x23da('0x2'))(_0x23da('0x3'));var moment=require(_0x23da('0x4'));var BPromise=require(_0x23da('0x5'));var rp=require(_0x23da('0x6'));var fs=require('fs');var path=require(_0x23da('0x7'));var rimraf=require(_0x23da('0x8'));var config=require(_0x23da('0x9'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x1f968f,_0x2477a1){return _0x1f968f['define'](_0x23da('0xa'),attributes,{'tableName':_0x23da('0xb'),'paranoid':![],'indexes':[{'fields':[_0x23da('0xc'),_0x23da('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0d72cd2..cf2df9a 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 _0x727b=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result','create','body','options','raw','CreateVoiceAgentReport','debug','catch','UpdateVoiceAgentReport','where','limit','lodash','util'];(function(_0x4e8487,_0x3ee4b9){var _0x4c4e70=function(_0x179037){while(--_0x179037){_0x4e8487['push'](_0x4e8487['shift']());}};_0x4c4e70(++_0x3ee4b9);}(_0x727b,0x11e));var _0xb727=function(_0x273615,_0x41f134){_0x273615=_0x273615-0x0;var _0x1b2c2e=_0x727b[_0x273615];return _0x1b2c2e;};'use strict';var _=require(_0xb727('0x0'));var util=require(_0xb727('0x1'));var moment=require(_0xb727('0x2'));var BPromise=require(_0xb727('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb727('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb727('0x5'));var logger=require(_0xb727('0x6'))(_0xb727('0x7'));var config=require(_0xb727('0x8'));var jayson=require(_0xb727('0x9'));var client=jayson[_0xb727('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4437d5,_0xf1db26,_0x3acfba){return new BPromise(function(_0x227963,_0x427cfb){return client[_0xb727('0xb')](_0x4437d5,_0x3acfba)[_0xb727('0xc')](function(_0x3b632f){logger[_0xb727('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0xf1db26,_0xb727('0xe'));logger['debug'](_0xb727('0xf'),_0xf1db26,'request\x20sent',JSON[_0xb727('0x10')](_0x3b632f));if(_0x3b632f[_0xb727('0x11')]){if(_0x3b632f['error'][_0xb727('0x12')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xf1db26,_0x3b632f[_0xb727('0x11')][_0xb727('0x13')]);return _0x427cfb(_0x3b632f[_0xb727('0x11')][_0xb727('0x13')]);}logger[_0xb727('0x11')](_0xb727('0x14'),_0xf1db26,_0x3b632f[_0xb727('0x11')][_0xb727('0x13')]);return _0x227963(_0x3b632f[_0xb727('0x11')][_0xb727('0x13')]);}else{logger[_0xb727('0xd')](_0xb727('0x14'),_0xf1db26,'request\x20sent');_0x227963(_0x3b632f[_0xb727('0x15')]['message']);}})['catch'](function(_0x3a13b3){logger[_0xb727('0x11')](_0xb727('0x14'),_0xf1db26,_0x3a13b3);_0x427cfb(_0x3a13b3);});});}exports['CreateVoiceAgentReport']=function(_0x52dd8d){var _0x5e4ebc=this;return new Promise(function(_0x3073b7,_0x54ef9b){return db['VoiceAgentReport'][_0xb727('0x16')](_0x52dd8d[_0xb727('0x17')],{'raw':_0x52dd8d['options']?_0x52dd8d[_0xb727('0x18')][_0xb727('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4a432d){logger[_0xb727('0xd')](_0xb727('0x1a'),_0x52dd8d);logger[_0xb727('0x1b')](_0xb727('0x1a'),_0x52dd8d,JSON[_0xb727('0x10')](_0x4a432d));_0x3073b7(_0x4a432d);})[_0xb727('0x1c')](function(_0x25b341){logger[_0xb727('0x11')]('CreateVoiceAgentReport',_0x25b341[_0xb727('0x13')],_0x52dd8d);_0x54ef9b(_0x5e4ebc['error'](0x1f4,_0x25b341[_0xb727('0x13')]));});});};exports[_0xb727('0x1d')]=function(_0x4afdcd){var _0xa6a22c=this;return new Promise(function(_0x137c36,_0x48422f){return db['VoiceAgentReport']['update'](_0x4afdcd[_0xb727('0x17')],{'raw':_0x4afdcd[_0xb727('0x18')]?_0x4afdcd[_0xb727('0x18')][_0xb727('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4afdcd[_0xb727('0x18')]?_0x4afdcd[_0xb727('0x18')][_0xb727('0x1e')]||null:null,'attributes':_0x4afdcd[_0xb727('0x18')]?_0x4afdcd[_0xb727('0x18')]['attributes']||null:null,'limit':_0x4afdcd[_0xb727('0x18')]?_0x4afdcd[_0xb727('0x18')][_0xb727('0x1f')]||null:null})['then'](function(_0x3eae20){logger[_0xb727('0xd')]('UpdateVoiceAgentReport',_0x4afdcd);logger[_0xb727('0x1b')](_0xb727('0x1d'),_0x4afdcd,JSON[_0xb727('0x10')](_0x3eae20));_0x137c36(_0x3eae20);})[_0xb727('0x1c')](function(_0x9d806b){logger[_0xb727('0x11')](_0xb727('0x1d'),_0x9d806b[_0xb727('0x13')],_0x4afdcd);_0x48422f(_0xa6a22c[_0xb727('0x11')](0x1f4,_0x9d806b[_0xb727('0x13')]));});});}; \ No newline at end of file +var _0x814e=['catch','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result'];(function(_0x28c9f2,_0x19cab5){var _0x2333d1=function(_0x15c122){while(--_0x15c122){_0x28c9f2['push'](_0x28c9f2['shift']());}};_0x2333d1(++_0x19cab5);}(_0x814e,0x1e4));var _0xe814=function(_0x45190e,_0x39376c){_0x45190e=_0x45190e-0x0;var _0x38871b=_0x814e[_0x45190e];return _0x38871b;};'use strict';var _=require('lodash');var util=require(_0xe814('0x0'));var moment=require(_0xe814('0x1'));var BPromise=require('bluebird');var rs=require(_0xe814('0x2'));var fs=require('fs');var Redis=require(_0xe814('0x3'));var db=require(_0xe814('0x4'))['db'];var utils=require(_0xe814('0x5'));var logger=require('../../config/logger')(_0xe814('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe814('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42b7b6,_0x42ec0a,_0x565e82){return new BPromise(function(_0x13f53a,_0x31e19f){return client[_0xe814('0x8')](_0x42b7b6,_0x565e82)[_0xe814('0x9')](function(_0x4231e2){logger[_0xe814('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x42ec0a,_0xe814('0xb'));logger[_0xe814('0xc')](_0xe814('0xd'),_0x42ec0a,_0xe814('0xb'),JSON[_0xe814('0xe')](_0x4231e2));if(_0x4231e2['error']){if(_0x4231e2[_0xe814('0xf')][_0xe814('0x10')]===0x1f4){logger[_0xe814('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x42ec0a,_0x4231e2['error'][_0xe814('0x11')]);return _0x31e19f(_0x4231e2[_0xe814('0xf')]['message']);}logger[_0xe814('0xf')](_0xe814('0x12'),_0x42ec0a,_0x4231e2['error'][_0xe814('0x11')]);return _0x13f53a(_0x4231e2[_0xe814('0xf')][_0xe814('0x11')]);}else{logger['info'](_0xe814('0x12'),_0x42ec0a,_0xe814('0xb'));_0x13f53a(_0x4231e2[_0xe814('0x13')]['message']);}})[_0xe814('0x14')](function(_0x39f1b7){logger[_0xe814('0xf')](_0xe814('0x12'),_0x42ec0a,_0x39f1b7);_0x31e19f(_0x39f1b7);});});}exports['CreateVoiceAgentReport']=function(_0x4010dc){var _0x59cabf=this;return new Promise(function(_0x259681,_0x4246c7){return db['VoiceAgentReport']['create'](_0x4010dc[_0xe814('0x15')],{'raw':_0x4010dc[_0xe814('0x16')]?_0x4010dc['options'][_0xe814('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x31b811){logger[_0xe814('0xa')](_0xe814('0x18'),_0x4010dc);logger[_0xe814('0xc')](_0xe814('0x18'),_0x4010dc,JSON[_0xe814('0xe')](_0x31b811));_0x259681(_0x31b811);})['catch'](function(_0x2f4162){logger[_0xe814('0xf')](_0xe814('0x18'),_0x2f4162['message'],_0x4010dc);_0x4246c7(_0x59cabf['error'](0x1f4,_0x2f4162[_0xe814('0x11')]));});});};exports[_0xe814('0x19')]=function(_0x51595c){var _0x12cd73=this;return new Promise(function(_0x3f15e6,_0x306a5c){return db['VoiceAgentReport'][_0xe814('0x1a')](_0x51595c[_0xe814('0x15')],{'raw':_0x51595c[_0xe814('0x16')]?_0x51595c[_0xe814('0x16')][_0xe814('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51595c['options']?_0x51595c[_0xe814('0x16')][_0xe814('0x1b')]||null:null,'attributes':_0x51595c[_0xe814('0x16')]?_0x51595c['options']['attributes']||null:null,'limit':_0x51595c[_0xe814('0x16')]?_0x51595c[_0xe814('0x16')]['limit']||null:null})[_0xe814('0x9')](function(_0x368b62){logger[_0xe814('0xa')](_0xe814('0x19'),_0x51595c);logger[_0xe814('0xc')]('UpdateVoiceAgentReport',_0x51595c,JSON[_0xe814('0xe')](_0x368b62));_0x3f15e6(_0x368b62);})[_0xe814('0x14')](function(_0x23c613){logger[_0xe814('0xf')](_0xe814('0x19'),_0x23c613[_0xe814('0x11')],_0x51595c);_0x306a5c(_0x12cd73[_0xe814('0xf')](0x1f4,_0x23c613[_0xe814('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 59d580e..92be7af 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 _0xa108=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x2df3ef,_0x438621){var _0x1a42c3=function(_0x4f042a){while(--_0x4f042a){_0x2df3ef['push'](_0x2df3ef['shift']());}};_0x1a42c3(++_0x438621);}(_0xa108,0xed));var _0x8a10=function(_0x3a731a,_0xc89d11){_0x3a731a=_0x3a731a-0x0;var _0x5ee15e=_0xa108[_0x3a731a];return _0x5ee15e;};'use strict';var multer=require(_0x8a10('0x0'));var util=require(_0x8a10('0x1'));var path=require(_0x8a10('0x2'));var timeout=require(_0x8a10('0x3'));var express=require(_0x8a10('0x4'));var router=express[_0x8a10('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8a10('0x6'));var config=require(_0x8a10('0x7'));var controller=require(_0x8a10('0x8'));router[_0x8a10('0x9')]('/',auth[_0x8a10('0xa')](),controller['index']);router[_0x8a10('0x9')](_0x8a10('0xb'),auth[_0x8a10('0xa')](),controller[_0x8a10('0xc')]);router[_0x8a10('0x9')](_0x8a10('0xd'),auth[_0x8a10('0xa')](),controller[_0x8a10('0xe')]);router[_0x8a10('0xf')]('/',auth[_0x8a10('0xa')](),controller[_0x8a10('0x10')]);router[_0x8a10('0x11')]('/:id',auth[_0x8a10('0xa')](),controller[_0x8a10('0x12')]);router['delete'](_0x8a10('0xd'),auth[_0x8a10('0xa')](),controller[_0x8a10('0x13')]);module[_0x8a10('0x14')]=router; \ No newline at end of file +var _0xeb69=['delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x29ba0f,_0x502ec8){var _0x3ae0a0=function(_0x10fdda){while(--_0x10fdda){_0x29ba0f['push'](_0x29ba0f['shift']());}};_0x3ae0a0(++_0x502ec8);}(_0xeb69,0x87));var _0x9eb6=function(_0x3e10b1,_0x258dd3){_0x3e10b1=_0x3e10b1-0x0;var _0x2c94c4=_0xeb69[_0x3e10b1];return _0x2c94c4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9eb6('0x0'));var timeout=require(_0x9eb6('0x1'));var express=require('express');var router=express[_0x9eb6('0x2')]();var auth=require(_0x9eb6('0x3'));var interaction=require(_0x9eb6('0x4'));var config=require(_0x9eb6('0x5'));var controller=require(_0x9eb6('0x6'));router[_0x9eb6('0x7')]('/',auth['isAuthenticated'](),controller[_0x9eb6('0x8')]);router[_0x9eb6('0x7')](_0x9eb6('0x9'),auth[_0x9eb6('0xa')](),controller['describe']);router['get'](_0x9eb6('0xb'),auth['isAuthenticated'](),controller[_0x9eb6('0xc')]);router[_0x9eb6('0xd')]('/',auth[_0x9eb6('0xa')](),controller[_0x9eb6('0xe')]);router[_0x9eb6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9eb6('0x10')]);router[_0x9eb6('0x11')]('/:id',auth[_0x9eb6('0xa')](),controller[_0x9eb6('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index b552cde..80cb4e5 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x168914,_0x407783){var _0x53922e=function(_0x332d30){while(--_0x332d30){_0x168914['push'](_0x168914['shift']());}};_0x53922e(++_0x407783);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x38c425,_0xbac891){var _0x4650b0=function(_0x211b0f){while(--_0x211b0f){_0x38c425['push'](_0x38c425['shift']());}};_0x4650b0(++_0xbac891);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 1335810..05d14a5 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 _0x2789=['desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','error','name','send','index','map','VoiceCallReport','fieldName','key','model','query','intersection','attributes','fields','length','limit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','then','includeAll','include','fullname','User','findAll','rows','show','params','keys','catch','create','body','find','describe','uniqueid','user','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x490117,_0x5e3b9d){var _0x55713c=function(_0x238936){while(--_0x238936){_0x490117['push'](_0x490117['shift']());}};_0x55713c(++_0x5e3b9d);}(_0x2789,0x8a));var _0x9278=function(_0xd8aba6,_0x63cdbc){_0xd8aba6=_0xd8aba6-0x0;var _0xfee48e=_0x2789[_0xd8aba6];return _0xfee48e;};'use strict';var pdf=require(_0x9278('0x0'));var emlformat=require(_0x9278('0x1'));var rimraf=require(_0x9278('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9278('0x3'));var moment=require('moment');var BPromise=require(_0x9278('0x4'));var Mustache=require(_0x9278('0x5'));var util=require(_0x9278('0x6'));var path=require(_0x9278('0x7'));var sox=require(_0x9278('0x8'));var csv=require(_0x9278('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9278('0xa'));var squel=require(_0x9278('0xb'));var crypto=require(_0x9278('0xc'));var jsforce=require(_0x9278('0xd'));var deskjs=require(_0x9278('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9278('0xf'));var authService=require(_0x9278('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9278('0x11'));var logger=require(_0x9278('0x12'))(_0x9278('0x13'));var utils=require(_0x9278('0x14'));var config=require(_0x9278('0x15'));var db=require(_0x9278('0x16'))['db'];function respondWithStatusCode(_0x54edb6,_0x4d74c5){_0x4d74c5=_0x4d74c5||0xcc;return function(_0x23a794){if(_0x23a794){return _0x54edb6[_0x9278('0x17')](_0x4d74c5);}return _0x54edb6[_0x9278('0x18')](_0x4d74c5)[_0x9278('0x19')]();};}function respondWithResult(_0x38852f,_0x3b39c1){_0x3b39c1=_0x3b39c1||0xc8;return function(_0x56fab7){if(_0x56fab7){return _0x38852f[_0x9278('0x18')](_0x3b39c1)[_0x9278('0x1a')](_0x56fab7);}};}function respondWithFilteredResult(_0x4a6b52,_0x33854a){return function(_0x120a32){if(_0x120a32){var _0x655aed=_0x120a32[_0x9278('0x1b')],_0x29d26d=_0x33854a[_0x9278('0x1c')],_0x4fb5c0=_0x33854a[_0x9278('0x1c')]+_0x33854a['limit'],_0x5a0e0b;if(_0x4fb5c0>=_0x655aed){_0x4fb5c0=_0x655aed;_0x5a0e0b=0xc8;}else{_0x5a0e0b=0xce;}_0x4a6b52[_0x9278('0x18')](_0x5a0e0b);return _0x4a6b52[_0x9278('0x1d')](_0x9278('0x1e'),_0x29d26d+'-'+_0x4fb5c0+'/'+_0x655aed)[_0x9278('0x1a')](_0x120a32);}return null;};}function patchUpdates(_0x4e777){return function(_0x1e1842){try{jsonpatch['apply'](_0x1e1842,_0x4e777,!![]);}catch(_0xd25b83){return BPromise[_0x9278('0x1f')](_0xd25b83);}return _0x1e1842[_0x9278('0x20')]();};}function saveUpdates(_0x37d6cd,_0x1f401e){return function(_0x2cf55b){if(_0x2cf55b){return _0x2cf55b[_0x9278('0x21')](_0x37d6cd)['then'](function(_0x87dd46){return _0x87dd46;});}return null;};}function removeEntity(_0x510039,_0x3a6cfd){return function(_0xd7c4d9){if(_0xd7c4d9){return _0xd7c4d9[_0x9278('0x22')]()['then'](function(){_0x510039[_0x9278('0x18')](0xcc)[_0x9278('0x19')]();});}};}function handleEntityNotFound(_0x4efa8e,_0x176502){return function(_0x21bcdc){if(!_0x21bcdc){_0x4efa8e['sendStatus'](0x194);}return _0x21bcdc;};}function handleError(_0x349021,_0x357175){_0x357175=_0x357175||0x1f4;return function(_0x43533e){logger[_0x9278('0x23')](_0x43533e['stack']);if(_0x43533e[_0x9278('0x24')]){delete _0x43533e['name'];}_0x349021[_0x9278('0x18')](_0x357175)[_0x9278('0x25')](_0x43533e);};}exports[_0x9278('0x26')]=function(_0x3e7fca,_0x16578a){var _0x514456={},_0x5bc448={},_0x9709c9={'count':0x0,'rows':[]};var _0x49b4cd=_[_0x9278('0x27')](db[_0x9278('0x28')]['rawAttributes'],function(_0x4fe594){return{'name':_0x4fe594[_0x9278('0x29')],'type':_0x4fe594['type'][_0x9278('0x2a')]};});_0x5bc448[_0x9278('0x2b')]=_['map'](_0x49b4cd,'name');_0x5bc448[_0x9278('0x2c')]=_['keys'](_0x3e7fca[_0x9278('0x2c')]);_0x5bc448['filters']=_[_0x9278('0x2d')](_0x5bc448[_0x9278('0x2b')],_0x5bc448[_0x9278('0x2c')]);_0x514456[_0x9278('0x2e')]=_[_0x9278('0x2d')](_0x5bc448['model'],qs[_0x9278('0x2f')](_0x3e7fca[_0x9278('0x2c')]['fields']));_0x514456[_0x9278('0x2e')]=_0x514456[_0x9278('0x2e')][_0x9278('0x30')]?_0x514456[_0x9278('0x2e')]:_0x5bc448['model'];if(!_0x3e7fca[_0x9278('0x2c')]['hasOwnProperty']('nolimit')){_0x514456[_0x9278('0x31')]=qs[_0x9278('0x31')](_0x3e7fca[_0x9278('0x2c')][_0x9278('0x31')]);_0x514456[_0x9278('0x1c')]=qs['offset'](_0x3e7fca[_0x9278('0x2c')][_0x9278('0x1c')]);}_0x514456[_0x9278('0x32')]=qs[_0x9278('0x33')](_0x3e7fca[_0x9278('0x2c')][_0x9278('0x33')]);_0x514456[_0x9278('0x34')]=qs[_0x9278('0x35')](_['pick'](_0x3e7fca[_0x9278('0x2c')],_0x5bc448['filters']));if(_0x3e7fca[_0x9278('0x2c')][_0x9278('0x36')]){_0x514456['where']=_['merge'](_0x514456[_0x9278('0x34')],{'$or':_['map'](_0x49b4cd,function(_0x147aa3){if(_0x147aa3[_0x9278('0x37')]!==_0x9278('0x38')){var _0x43ef59={};_0x43ef59[_0x147aa3['name']]={'$like':'%'+_0x3e7fca[_0x9278('0x2c')][_0x9278('0x36')]+'%'};return _0x43ef59;}})});}_0x514456=_[_0x9278('0x39')]({},_0x514456,_0x3e7fca[_0x9278('0x3a')]);var _0x2e92fd={'where':_0x514456[_0x9278('0x34')]};return db[_0x9278('0x28')][_0x9278('0x1b')](_0x2e92fd)[_0x9278('0x3b')](function(_0x24a2a1){_0x9709c9[_0x9278('0x1b')]=_0x24a2a1;if(_0x3e7fca[_0x9278('0x2c')][_0x9278('0x3c')]){_0x514456[_0x9278('0x3d')]=[{'attributes':['id','name',_0x9278('0x3e'),'alias'],'model':db[_0x9278('0x3f')],'as':_0x9278('0x3f')}];}return db['VoiceCallReport'][_0x9278('0x40')](_0x514456);})[_0x9278('0x3b')](function(_0xb50142){_0x9709c9[_0x9278('0x41')]=_0xb50142;return _0x9709c9;})[_0x9278('0x3b')](respondWithFilteredResult(_0x16578a,_0x514456))['catch'](handleError(_0x16578a,null));};exports[_0x9278('0x42')]=function(_0x223ec6,_0x2a9b5b){var _0x57ae24={'raw':!![],'where':{'id':_0x223ec6[_0x9278('0x43')]['id']}},_0x52bf83={};_0x52bf83[_0x9278('0x2b')]=_[_0x9278('0x44')](db[_0x9278('0x28')]['rawAttributes']);_0x52bf83[_0x9278('0x2c')]=_[_0x9278('0x44')](_0x223ec6[_0x9278('0x2c')]);_0x52bf83[_0x9278('0x35')]=_[_0x9278('0x2d')](_0x52bf83[_0x9278('0x2b')],_0x52bf83[_0x9278('0x2c')]);_0x57ae24[_0x9278('0x2e')]=_[_0x9278('0x2d')](_0x52bf83[_0x9278('0x2b')],qs[_0x9278('0x2f')](_0x223ec6[_0x9278('0x2c')][_0x9278('0x2f')]));_0x57ae24[_0x9278('0x2e')]=_0x57ae24[_0x9278('0x2e')][_0x9278('0x30')]?_0x57ae24['attributes']:_0x52bf83[_0x9278('0x2b')];if(_0x223ec6[_0x9278('0x2c')]['includeAll']){_0x57ae24[_0x9278('0x3d')]=[{'all':!![]}];}_0x57ae24=_[_0x9278('0x39')]({},_0x57ae24,_0x223ec6[_0x9278('0x3a')]);return db[_0x9278('0x28')]['find'](_0x57ae24)[_0x9278('0x3b')](handleEntityNotFound(_0x2a9b5b,null))[_0x9278('0x3b')](respondWithResult(_0x2a9b5b,null))[_0x9278('0x45')](handleError(_0x2a9b5b,null));};exports[_0x9278('0x46')]=function(_0x153ae7,_0x5d3a23){return db['VoiceCallReport']['create'](_0x153ae7[_0x9278('0x47')],{})[_0x9278('0x3b')](respondWithResult(_0x5d3a23,0xc9))[_0x9278('0x45')](handleError(_0x5d3a23,null));};exports[_0x9278('0x22')]=function(_0xb07b8,_0x4f166b){return db[_0x9278('0x28')][_0x9278('0x48')]({'where':{'id':_0xb07b8[_0x9278('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f166b,null))['then'](removeEntity(_0x4f166b,null))[_0x9278('0x45')](handleError(_0x4f166b,null));};exports[_0x9278('0x49')]=function(_0x327e57,_0x48ff44){return db[_0x9278('0x28')][_0x9278('0x49')]()['then'](respondWithResult(_0x48ff44,null))[_0x9278('0x45')](handleError(_0x48ff44,null));};exports[_0x9278('0x21')]=function(_0xe3ffe,_0x328fb6){if(_0xe3ffe[_0x9278('0x47')][_0x9278('0x4a')]){delete _0xe3ffe['body'][_0x9278('0x4a')];}return db[_0x9278('0x28')][_0x9278('0x48')]({'where':{'uniqueid':_0xe3ffe['params']['id'],'UserId':{'$or':[null,_0xe3ffe[_0x9278('0x4b')]['id']]}}})[_0x9278('0x3b')](handleEntityNotFound(_0x328fb6,null))[_0x9278('0x3b')](saveUpdates(_0xe3ffe[_0x9278('0x47')],null))[_0x9278('0x3b')](respondWithResult(_0x328fb6,null))[_0x9278('0x45')](handleError(_0x328fb6,null));}; \ No newline at end of file +var _0x261d=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceCallReport','fieldName','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','fullname','User','findAll','catch','show','params','model','options','create','find','describe','body','uniqueid','eml-format','zip-dir','fast-json-patch'];(function(_0x48b098,_0x557169){var _0x2ed72d=function(_0x706f4c){while(--_0x706f4c){_0x48b098['push'](_0x48b098['shift']());}};_0x2ed72d(++_0x557169);}(_0x261d,0x183));var _0xd261=function(_0x1ecf62,_0xd5a61b){_0x1ecf62=_0x1ecf62-0x0;var _0x471e63=_0x261d[_0x1ecf62];return _0x471e63;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd261('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd261('0x1'));var jsonpatch=require(_0xd261('0x2'));var rp=require(_0xd261('0x3'));var moment=require(_0xd261('0x4'));var BPromise=require(_0xd261('0x5'));var Mustache=require(_0xd261('0x6'));var util=require(_0xd261('0x7'));var path=require(_0xd261('0x8'));var sox=require(_0xd261('0x9'));var csv=require(_0xd261('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd261('0xb'));var squel=require(_0xd261('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd261('0xd'));var toCsv=require(_0xd261('0xa'));var querystring=require(_0xd261('0xe'));var Papa=require(_0xd261('0xf'));var Redis=require(_0xd261('0x10'));var authService=require(_0xd261('0x11'));var qs=require(_0xd261('0x12'));var as=require(_0xd261('0x13'));var hardwareService=require(_0xd261('0x14'));var logger=require(_0xd261('0x15'))(_0xd261('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd261('0x17'))['db'];function respondWithStatusCode(_0x4b616c,_0xa41273){_0xa41273=_0xa41273||0xcc;return function(_0x2e7470){if(_0x2e7470){return _0x4b616c[_0xd261('0x18')](_0xa41273);}return _0x4b616c[_0xd261('0x19')](_0xa41273)[_0xd261('0x1a')]();};}function respondWithResult(_0x42ff4c,_0x4afd4d){_0x4afd4d=_0x4afd4d||0xc8;return function(_0xa1fb72){if(_0xa1fb72){return _0x42ff4c['status'](_0x4afd4d)[_0xd261('0x1b')](_0xa1fb72);}};}function respondWithFilteredResult(_0x27ccf7,_0x5136c6){return function(_0x2b0d1d){if(_0x2b0d1d){var _0x4a6ff7=_0x2b0d1d[_0xd261('0x1c')],_0x164076=_0x5136c6[_0xd261('0x1d')],_0x307bb2=_0x5136c6[_0xd261('0x1d')]+_0x5136c6[_0xd261('0x1e')],_0x35d6aa;if(_0x307bb2>=_0x4a6ff7){_0x307bb2=_0x4a6ff7;_0x35d6aa=0xc8;}else{_0x35d6aa=0xce;}_0x27ccf7[_0xd261('0x19')](_0x35d6aa);return _0x27ccf7[_0xd261('0x1f')](_0xd261('0x20'),_0x164076+'-'+_0x307bb2+'/'+_0x4a6ff7)[_0xd261('0x1b')](_0x2b0d1d);}return null;};}function patchUpdates(_0x21d669){return function(_0x571f42){try{jsonpatch[_0xd261('0x21')](_0x571f42,_0x21d669,!![]);}catch(_0x5a327a){return BPromise[_0xd261('0x22')](_0x5a327a);}return _0x571f42[_0xd261('0x23')]();};}function saveUpdates(_0x133e0c,_0x45222e){return function(_0x597b55){if(_0x597b55){return _0x597b55[_0xd261('0x24')](_0x133e0c)['then'](function(_0x2218e8){return _0x2218e8;});}return null;};}function removeEntity(_0x480e81,_0x3ab1a9){return function(_0x2150d5){if(_0x2150d5){return _0x2150d5[_0xd261('0x25')]()[_0xd261('0x26')](function(){_0x480e81[_0xd261('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37bb95,_0x1a0b06){return function(_0x58d763){if(!_0x58d763){_0x37bb95[_0xd261('0x18')](0x194);}return _0x58d763;};}function handleError(_0x10eebc,_0x2aefa2){_0x2aefa2=_0x2aefa2||0x1f4;return function(_0x264bef){logger[_0xd261('0x27')](_0x264bef[_0xd261('0x28')]);if(_0x264bef['name']){delete _0x264bef[_0xd261('0x29')];}_0x10eebc[_0xd261('0x19')](_0x2aefa2)[_0xd261('0x2a')](_0x264bef);};}exports[_0xd261('0x2b')]=function(_0x311e49,_0x14ff7c){var _0x2259b2={},_0x491668={},_0x179ab2={'count':0x0,'rows':[]};var _0x7c436d=_[_0xd261('0x2c')](db[_0xd261('0x2d')]['rawAttributes'],function(_0x24781c){return{'name':_0x24781c[_0xd261('0x2e')],'type':_0x24781c['type']['key']};});_0x491668['model']=_[_0xd261('0x2c')](_0x7c436d,_0xd261('0x29'));_0x491668[_0xd261('0x2f')]=_[_0xd261('0x30')](_0x311e49[_0xd261('0x2f')]);_0x491668['filters']=_[_0xd261('0x31')](_0x491668['model'],_0x491668[_0xd261('0x2f')]);_0x2259b2[_0xd261('0x32')]=_[_0xd261('0x31')](_0x491668['model'],qs[_0xd261('0x33')](_0x311e49['query']['fields']));_0x2259b2[_0xd261('0x32')]=_0x2259b2[_0xd261('0x32')][_0xd261('0x34')]?_0x2259b2[_0xd261('0x32')]:_0x491668['model'];if(!_0x311e49['query'][_0xd261('0x35')](_0xd261('0x36'))){_0x2259b2['limit']=qs[_0xd261('0x1e')](_0x311e49['query'][_0xd261('0x1e')]);_0x2259b2[_0xd261('0x1d')]=qs['offset'](_0x311e49[_0xd261('0x2f')][_0xd261('0x1d')]);}_0x2259b2[_0xd261('0x37')]=qs[_0xd261('0x38')](_0x311e49[_0xd261('0x2f')]['sort']);_0x2259b2[_0xd261('0x39')]=qs[_0xd261('0x3a')](_['pick'](_0x311e49[_0xd261('0x2f')],_0x491668[_0xd261('0x3a')]));if(_0x311e49[_0xd261('0x2f')][_0xd261('0x3b')]){_0x2259b2[_0xd261('0x39')]=_[_0xd261('0x3c')](_0x2259b2[_0xd261('0x39')],{'$or':_['map'](_0x7c436d,function(_0x382365){if(_0x382365[_0xd261('0x3d')]!==_0xd261('0x3e')){var _0x2c9e3d={};_0x2c9e3d[_0x382365[_0xd261('0x29')]]={'$like':'%'+_0x311e49[_0xd261('0x2f')][_0xd261('0x3b')]+'%'};return _0x2c9e3d;}})});}_0x2259b2=_[_0xd261('0x3c')]({},_0x2259b2,_0x311e49['options']);var _0x45dfcf={'where':_0x2259b2[_0xd261('0x39')]};return db[_0xd261('0x2d')][_0xd261('0x1c')](_0x45dfcf)[_0xd261('0x26')](function(_0x479bf3){_0x179ab2[_0xd261('0x1c')]=_0x479bf3;if(_0x311e49[_0xd261('0x2f')][_0xd261('0x3f')]){_0x2259b2[_0xd261('0x40')]=[{'attributes':['id',_0xd261('0x29'),_0xd261('0x41'),'alias'],'model':db[_0xd261('0x42')],'as':_0xd261('0x42')}];}return db[_0xd261('0x2d')][_0xd261('0x43')](_0x2259b2);})[_0xd261('0x26')](function(_0xcedbaa){_0x179ab2['rows']=_0xcedbaa;return _0x179ab2;})[_0xd261('0x26')](respondWithFilteredResult(_0x14ff7c,_0x2259b2))[_0xd261('0x44')](handleError(_0x14ff7c,null));};exports[_0xd261('0x45')]=function(_0x5d9c51,_0x51dda5){var _0x3910b4={'raw':!![],'where':{'id':_0x5d9c51[_0xd261('0x46')]['id']}},_0x2dacb6={};_0x2dacb6[_0xd261('0x47')]=_['keys'](db[_0xd261('0x2d')]['rawAttributes']);_0x2dacb6[_0xd261('0x2f')]=_[_0xd261('0x30')](_0x5d9c51['query']);_0x2dacb6[_0xd261('0x3a')]=_['intersection'](_0x2dacb6[_0xd261('0x47')],_0x2dacb6[_0xd261('0x2f')]);_0x3910b4[_0xd261('0x32')]=_['intersection'](_0x2dacb6[_0xd261('0x47')],qs[_0xd261('0x33')](_0x5d9c51['query'][_0xd261('0x33')]));_0x3910b4[_0xd261('0x32')]=_0x3910b4['attributes'][_0xd261('0x34')]?_0x3910b4[_0xd261('0x32')]:_0x2dacb6[_0xd261('0x47')];if(_0x5d9c51['query']['includeAll']){_0x3910b4[_0xd261('0x40')]=[{'all':!![]}];}_0x3910b4=_[_0xd261('0x3c')]({},_0x3910b4,_0x5d9c51[_0xd261('0x48')]);return db[_0xd261('0x2d')]['find'](_0x3910b4)['then'](handleEntityNotFound(_0x51dda5,null))[_0xd261('0x26')](respondWithResult(_0x51dda5,null))[_0xd261('0x44')](handleError(_0x51dda5,null));};exports[_0xd261('0x49')]=function(_0x258d92,_0x31aa54){return db['VoiceCallReport'][_0xd261('0x49')](_0x258d92['body'],{})[_0xd261('0x26')](respondWithResult(_0x31aa54,0xc9))[_0xd261('0x44')](handleError(_0x31aa54,null));};exports[_0xd261('0x25')]=function(_0x292bde,_0x1d1f5f){return db[_0xd261('0x2d')][_0xd261('0x4a')]({'where':{'id':_0x292bde[_0xd261('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d1f5f,null))[_0xd261('0x26')](removeEntity(_0x1d1f5f,null))[_0xd261('0x44')](handleError(_0x1d1f5f,null));};exports[_0xd261('0x4b')]=function(_0x13a1f5,_0x3a6cc9){return db['VoiceCallReport'][_0xd261('0x4b')]()[_0xd261('0x26')](respondWithResult(_0x3a6cc9,null))['catch'](handleError(_0x3a6cc9,null));};exports[_0xd261('0x24')]=function(_0xbde284,_0x17a605){if(_0xbde284[_0xd261('0x4c')][_0xd261('0x4d')]){delete _0xbde284[_0xd261('0x4c')][_0xd261('0x4d')];}return db[_0xd261('0x2d')][_0xd261('0x4a')]({'where':{'uniqueid':_0xbde284['params']['id'],'UserId':{'$or':[null,_0xbde284['user']['id']]}}})[_0xd261('0x26')](handleEntityNotFound(_0x17a605,null))['then'](saveUpdates(_0xbde284[_0xd261('0x4c')],null))['then'](respondWithResult(_0x17a605,null))[_0xd261('0x44')](handleError(_0x17a605,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 14db1a0..d2edd92 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 _0x9713=['./voiceCallReport.attributes','exports','define','VoiceCallReport','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x49ba23,_0x5cef36){var _0x23f3f5=function(_0x54c224){while(--_0x54c224){_0x49ba23['push'](_0x49ba23['shift']());}};_0x23f3f5(++_0x5cef36);}(_0x9713,0x1cc));var _0x3971=function(_0x590455,_0x362143){_0x590455=_0x590455-0x0;var _0x4ac5dd=_0x9713[_0x590455];return _0x4ac5dd;};'use strict';var _=require(_0x3971('0x0'));var util=require(_0x3971('0x1'));var logger=require('../../config/logger')(_0x3971('0x2'));var moment=require(_0x3971('0x3'));var BPromise=require(_0x3971('0x4'));var rp=require(_0x3971('0x5'));var fs=require('fs');var path=require(_0x3971('0x6'));var rimraf=require('rimraf');var config=require(_0x3971('0x7'));var attributes=require(_0x3971('0x8'));module[_0x3971('0x9')]=function(_0x26cfe5,_0x32addb){return _0x26cfe5[_0x3971('0xa')](_0x3971('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x44ee=['path','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','lodash','util','../../config/logger','moment','bluebird'];(function(_0x424357,_0x9ebe3e){var _0x29c68e=function(_0x663b5d){while(--_0x663b5d){_0x424357['push'](_0x424357['shift']());}};_0x29c68e(++_0x9ebe3e);}(_0x44ee,0x1e7));var _0xe44e=function(_0x3b9e1c,_0x274509){_0x3b9e1c=_0x3b9e1c-0x0;var _0x250180=_0x44ee[_0x3b9e1c];return _0x250180;};'use strict';var _=require(_0xe44e('0x0'));var util=require(_0xe44e('0x1'));var logger=require(_0xe44e('0x2'))('api');var moment=require(_0xe44e('0x3'));var BPromise=require(_0xe44e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe44e('0x5'));var rimraf=require(_0xe44e('0x6'));var config=require('../../config/environment');var attributes=require(_0xe44e('0x7'));module[_0xe44e('0x8')]=function(_0x17a048,_0x2668e0){return _0x17a048[_0xe44e('0x9')](_0xe44e('0xa'),attributes,{'tableName':_0xe44e('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 22c19f8..c2f42e0 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 _0x2622=['raw','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','result','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','limit','include','model','attributes','map','CreateVoiceCallReport','create','body'];(function(_0x28efd9,_0x4bfd8a){var _0x5f536e=function(_0x136858){while(--_0x136858){_0x28efd9['push'](_0x28efd9['shift']());}};_0x5f536e(++_0x4bfd8a);}(_0x2622,0xff));var _0x2262=function(_0x5dc199,_0x585c2c){_0x5dc199=_0x5dc199-0x0;var _0x2c9f7d=_0x2622[_0x5dc199];return _0x2c9f7d;};'use strict';var _=require(_0x2262('0x0'));var util=require(_0x2262('0x1'));var moment=require(_0x2262('0x2'));var BPromise=require(_0x2262('0x3'));var rs=require(_0x2262('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2262('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2262('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2262('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52f907,_0x2b07d8,_0x478fa3){return new BPromise(function(_0x10e77d,_0x11cf58){return client[_0x2262('0x8')](_0x52f907,_0x478fa3)[_0x2262('0x9')](function(_0x2494dd){logger[_0x2262('0xa')](_0x2262('0xb'),_0x2b07d8,_0x2262('0xc'));logger[_0x2262('0xd')](_0x2262('0xe'),_0x2b07d8,'request\x20sent',JSON[_0x2262('0xf')](_0x2494dd));if(_0x2494dd[_0x2262('0x10')]){if(_0x2494dd[_0x2262('0x10')]['code']===0x1f4){logger[_0x2262('0x10')](_0x2262('0xb'),_0x2b07d8,_0x2494dd[_0x2262('0x10')]['message']);return _0x11cf58(_0x2494dd[_0x2262('0x10')]['message']);}logger['error'](_0x2262('0xb'),_0x2b07d8,_0x2494dd[_0x2262('0x10')]['message']);return _0x10e77d(_0x2494dd[_0x2262('0x10')]['message']);}else{logger[_0x2262('0xa')](_0x2262('0xb'),_0x2b07d8,'request\x20sent');_0x10e77d(_0x2494dd[_0x2262('0x11')][_0x2262('0x12')]);}})[_0x2262('0x13')](function(_0x5952d2){logger[_0x2262('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x2b07d8,_0x5952d2);_0x11cf58(_0x5952d2);});});}exports[_0x2262('0x14')]=function(_0x334bcf){var _0x206b9a=this;return new Promise(function(_0x54492f,_0x53fb39){return db[_0x2262('0x15')][_0x2262('0x16')]({'raw':_0x334bcf[_0x2262('0x17')]?_0x334bcf['options']['raw']===undefined?!![]:![]:!![],'where':_0x334bcf['options']?_0x334bcf[_0x2262('0x17')][_0x2262('0x18')]||null:null,'attributes':_0x334bcf['options']?_0x334bcf['options']['attributes']||null:null,'limit':_0x334bcf[_0x2262('0x17')]?_0x334bcf[_0x2262('0x17')][_0x2262('0x19')]||null:null,'include':_0x334bcf[_0x2262('0x17')]?_0x334bcf['options'][_0x2262('0x1a')]?_['map'](_0x334bcf['options'][_0x2262('0x1a')],function(_0x681c5d){return{'model':db[_0x681c5d[_0x2262('0x1b')]],'as':_0x681c5d['as'],'attributes':_0x681c5d[_0x2262('0x1c')],'include':_0x681c5d['include']?_[_0x2262('0x1d')](_0x681c5d[_0x2262('0x1a')],function(_0x5e932a){return{'model':db[_0x5e932a[_0x2262('0x1b')]],'as':_0x5e932a['as'],'attributes':_0x5e932a[_0x2262('0x1c')],'include':_0x5e932a[_0x2262('0x1a')]?_[_0x2262('0x1d')](_0x5e932a[_0x2262('0x1a')],function(_0x524aae){return{'model':db[_0x524aae[_0x2262('0x1b')]],'as':_0x524aae['as'],'attributes':_0x524aae[_0x2262('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2262('0x9')](function(_0x17fa89){logger[_0x2262('0xa')]('GetVoiceCallReport',_0x334bcf);logger[_0x2262('0xd')](_0x2262('0x14'),_0x334bcf,JSON[_0x2262('0xf')](_0x17fa89));_0x54492f(_0x17fa89);})[_0x2262('0x13')](function(_0x351a7b){logger['error'](_0x2262('0x14'),_0x351a7b['message'],_0x334bcf);_0x53fb39(_0x206b9a['error'](0x1f4,_0x351a7b[_0x2262('0x12')]));});});};exports[_0x2262('0x1e')]=function(_0x5954f6){var _0x1f9882=this;return new Promise(function(_0x32cea7,_0x2bbdd4){return db[_0x2262('0x15')][_0x2262('0x1f')](_0x5954f6[_0x2262('0x20')],{'raw':_0x5954f6['options']?_0x5954f6['options'][_0x2262('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x4f42cb){logger['info'](_0x2262('0x1e'),_0x5954f6);logger[_0x2262('0xd')](_0x2262('0x1e'),_0x5954f6,JSON[_0x2262('0xf')](_0x4f42cb));_0x32cea7(_0x4f42cb);})[_0x2262('0x13')](function(_0x9b920e){logger[_0x2262('0x10')](_0x2262('0x1e'),_0x9b920e[_0x2262('0x12')],_0x5954f6);_0x2bbdd4(_0x1f9882[_0x2262('0x10')](0x1f4,_0x9b920e[_0x2262('0x12')]));});});};exports[_0x2262('0x22')]=function(_0x44edc1){var _0x3c4a3a=this;return new Promise(function(_0x58206f,_0x1b225f){return db['VoiceCallReport'][_0x2262('0x23')](_0x44edc1[_0x2262('0x20')],{'raw':_0x44edc1[_0x2262('0x17')]?_0x44edc1[_0x2262('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44edc1[_0x2262('0x17')]?_0x44edc1[_0x2262('0x17')][_0x2262('0x18')]||null:null,'attributes':_0x44edc1[_0x2262('0x17')]?_0x44edc1[_0x2262('0x17')][_0x2262('0x1c')]||null:null,'limit':_0x44edc1[_0x2262('0x17')]?_0x44edc1[_0x2262('0x17')][_0x2262('0x19')]||null:null})[_0x2262('0x9')](function(_0x193737){logger['info'](_0x2262('0x22'),_0x44edc1);logger[_0x2262('0xd')](_0x2262('0x22'),_0x44edc1,JSON[_0x2262('0xf')](_0x193737));_0x58206f(_0x193737);})[_0x2262('0x13')](function(_0x4832e8){logger['error'](_0x2262('0x22'),_0x4832e8[_0x2262('0x12')],_0x44edc1);_0x1b225f(_0x3c4a3a[_0x2262('0x10')](0x1f4,_0x4832e8[_0x2262('0x12')]));});});}; \ No newline at end of file +var _0xccc8=['CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','code','VoiceCallReport,\x20%s,\x20%s','error','message','info','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','include','map','model','catch','create','body','raw'];(function(_0x313bd5,_0x441c3f){var _0xa9ea5c=function(_0x2ac0e7){while(--_0x2ac0e7){_0x313bd5['push'](_0x313bd5['shift']());}};_0xa9ea5c(++_0x441c3f);}(_0xccc8,0x177));var _0x8ccc=function(_0x5de1bc,_0x434be1){_0x5de1bc=_0x5de1bc-0x0;var _0x19f4b8=_0xccc8[_0x5de1bc];return _0x19f4b8;};'use strict';var _=require(_0x8ccc('0x0'));var util=require(_0x8ccc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ccc('0x2'));var fs=require('fs');var Redis=require(_0x8ccc('0x3'));var db=require(_0x8ccc('0x4'))['db'];var utils=require(_0x8ccc('0x5'));var logger=require('../../config/logger')(_0x8ccc('0x6'));var config=require(_0x8ccc('0x7'));var jayson=require(_0x8ccc('0x8'));var client=jayson[_0x8ccc('0x9')][_0x8ccc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48022c,_0x21a391,_0xb17e67){return new BPromise(function(_0x3c5cf4,_0x30d2a2){return client['request'](_0x48022c,_0xb17e67)[_0x8ccc('0xb')](function(_0x1dbfc7){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x21a391,_0x8ccc('0xc'));logger[_0x8ccc('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x21a391,_0x8ccc('0xc'),JSON['stringify'](_0x1dbfc7));if(_0x1dbfc7['error']){if(_0x1dbfc7['error'][_0x8ccc('0xe')]===0x1f4){logger['error'](_0x8ccc('0xf'),_0x21a391,_0x1dbfc7[_0x8ccc('0x10')][_0x8ccc('0x11')]);return _0x30d2a2(_0x1dbfc7[_0x8ccc('0x10')][_0x8ccc('0x11')]);}logger[_0x8ccc('0x10')](_0x8ccc('0xf'),_0x21a391,_0x1dbfc7[_0x8ccc('0x10')][_0x8ccc('0x11')]);return _0x3c5cf4(_0x1dbfc7[_0x8ccc('0x10')][_0x8ccc('0x11')]);}else{logger[_0x8ccc('0x12')](_0x8ccc('0xf'),_0x21a391,_0x8ccc('0xc'));_0x3c5cf4(_0x1dbfc7['result'][_0x8ccc('0x11')]);}})['catch'](function(_0x5a38c9){logger['error'](_0x8ccc('0xf'),_0x21a391,_0x5a38c9);_0x30d2a2(_0x5a38c9);});});}exports[_0x8ccc('0x13')]=function(_0x44f4b0){var _0x2d76cf=this;return new Promise(function(_0x407963,_0xdc3c21){return db[_0x8ccc('0x14')][_0x8ccc('0x15')]({'raw':_0x44f4b0[_0x8ccc('0x16')]?_0x44f4b0[_0x8ccc('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x44f4b0[_0x8ccc('0x16')]?_0x44f4b0['options'][_0x8ccc('0x17')]||null:null,'attributes':_0x44f4b0[_0x8ccc('0x16')]?_0x44f4b0[_0x8ccc('0x16')][_0x8ccc('0x18')]||null:null,'limit':_0x44f4b0[_0x8ccc('0x16')]?_0x44f4b0[_0x8ccc('0x16')]['limit']||null:null,'include':_0x44f4b0[_0x8ccc('0x16')]?_0x44f4b0['options'][_0x8ccc('0x19')]?_[_0x8ccc('0x1a')](_0x44f4b0[_0x8ccc('0x16')][_0x8ccc('0x19')],function(_0x46e9fe){return{'model':db[_0x46e9fe[_0x8ccc('0x1b')]],'as':_0x46e9fe['as'],'attributes':_0x46e9fe[_0x8ccc('0x18')],'include':_0x46e9fe[_0x8ccc('0x19')]?_['map'](_0x46e9fe[_0x8ccc('0x19')],function(_0x2b6c77){return{'model':db[_0x2b6c77[_0x8ccc('0x1b')]],'as':_0x2b6c77['as'],'attributes':_0x2b6c77['attributes'],'include':_0x2b6c77[_0x8ccc('0x19')]?_['map'](_0x2b6c77['include'],function(_0x40db3c){return{'model':db[_0x40db3c[_0x8ccc('0x1b')]],'as':_0x40db3c['as'],'attributes':_0x40db3c[_0x8ccc('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8ccc('0xb')](function(_0x157481){logger[_0x8ccc('0x12')]('GetVoiceCallReport',_0x44f4b0);logger[_0x8ccc('0xd')](_0x8ccc('0x13'),_0x44f4b0,JSON['stringify'](_0x157481));_0x407963(_0x157481);})[_0x8ccc('0x1c')](function(_0x238c0d){logger[_0x8ccc('0x10')](_0x8ccc('0x13'),_0x238c0d[_0x8ccc('0x11')],_0x44f4b0);_0xdc3c21(_0x2d76cf[_0x8ccc('0x10')](0x1f4,_0x238c0d[_0x8ccc('0x11')]));});});};exports['CreateVoiceCallReport']=function(_0x5f3adf){var _0x4fe9eb=this;return new Promise(function(_0x3618df,_0x55e538){return db[_0x8ccc('0x14')][_0x8ccc('0x1d')](_0x5f3adf[_0x8ccc('0x1e')],{'raw':_0x5f3adf[_0x8ccc('0x16')]?_0x5f3adf[_0x8ccc('0x16')][_0x8ccc('0x1f')]===undefined?!![]:![]:!![]})[_0x8ccc('0xb')](function(_0x57c77a){logger['info']('CreateVoiceCallReport',_0x5f3adf);logger[_0x8ccc('0xd')](_0x8ccc('0x20'),_0x5f3adf,JSON[_0x8ccc('0x21')](_0x57c77a));_0x3618df(_0x57c77a);})[_0x8ccc('0x1c')](function(_0x1145ca){logger['error'](_0x8ccc('0x20'),_0x1145ca[_0x8ccc('0x11')],_0x5f3adf);_0x55e538(_0x4fe9eb[_0x8ccc('0x10')](0x1f4,_0x1145ca[_0x8ccc('0x11')]));});});};exports[_0x8ccc('0x22')]=function(_0x113a59){var _0x407f6c=this;return new Promise(function(_0x3cd707,_0x31838d){return db[_0x8ccc('0x14')][_0x8ccc('0x23')](_0x113a59[_0x8ccc('0x1e')],{'raw':_0x113a59[_0x8ccc('0x16')]?_0x113a59[_0x8ccc('0x16')][_0x8ccc('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x113a59[_0x8ccc('0x16')]?_0x113a59['options'][_0x8ccc('0x17')]||null:null,'attributes':_0x113a59[_0x8ccc('0x16')]?_0x113a59[_0x8ccc('0x16')][_0x8ccc('0x18')]||null:null,'limit':_0x113a59[_0x8ccc('0x16')]?_0x113a59[_0x8ccc('0x16')][_0x8ccc('0x24')]||null:null})[_0x8ccc('0xb')](function(_0x475e23){logger[_0x8ccc('0x12')](_0x8ccc('0x22'),_0x113a59);logger[_0x8ccc('0xd')](_0x8ccc('0x22'),_0x113a59,JSON[_0x8ccc('0x21')](_0x475e23));_0x3cd707(_0x475e23);})['catch'](function(_0x543a49){logger[_0x8ccc('0x10')](_0x8ccc('0x22'),_0x543a49['message'],_0x113a59);_0x31838d(_0x407f6c[_0x8ccc('0x10')](0x1f4,_0x543a49[_0x8ccc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 99926ad..937172a 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 _0x3989=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x45ebbe,_0x2ccb9f){var _0x156a14=function(_0x50fe32){while(--_0x50fe32){_0x45ebbe['push'](_0x45ebbe['shift']());}};_0x156a14(++_0x2ccb9f);}(_0x3989,0x12f));var _0x9398=function(_0x55db5e,_0x2e7ee2){_0x55db5e=_0x55db5e-0x0;var _0x56c137=_0x3989[_0x55db5e];return _0x56c137;};'use strict';var multer=require(_0x9398('0x0'));var util=require('util');var path=require(_0x9398('0x1'));var timeout=require(_0x9398('0x2'));var express=require(_0x9398('0x3'));var router=express[_0x9398('0x4')]();var auth=require(_0x9398('0x5'));var interaction=require(_0x9398('0x6'));var config=require(_0x9398('0x7'));var controller=require(_0x9398('0x8'));router[_0x9398('0x9')]('/',auth[_0x9398('0xa')](),controller[_0x9398('0xb')]);router[_0x9398('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9398('0xc')]);router[_0x9398('0xd')]('/',auth[_0x9398('0xa')](),controller[_0x9398('0xe')]);router[_0x9398('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9398('0x10')]);router[_0x9398('0x11')]('/:id',auth[_0x9398('0xa')](),controller[_0x9398('0x12')]);module[_0x9398('0x13')]=router; \ No newline at end of file +var _0xfd40=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show'];(function(_0x227e24,_0x573dd6){var _0x2ccc99=function(_0x177963){while(--_0x177963){_0x227e24['push'](_0x227e24['shift']());}};_0x2ccc99(++_0x573dd6);}(_0xfd40,0x182));var _0x0fd4=function(_0x170f4b,_0x15a579){_0x170f4b=_0x170f4b-0x0;var _0x4892d2=_0xfd40[_0x170f4b];return _0x4892d2;};'use strict';var multer=require('multer');var util=require(_0x0fd4('0x0'));var path=require(_0x0fd4('0x1'));var timeout=require(_0x0fd4('0x2'));var express=require(_0x0fd4('0x3'));var router=express[_0x0fd4('0x4')]();var auth=require(_0x0fd4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0fd4('0x6'));var controller=require(_0x0fd4('0x7'));router[_0x0fd4('0x8')]('/',auth[_0x0fd4('0x9')](),controller[_0x0fd4('0xa')]);router[_0x0fd4('0x8')](_0x0fd4('0xb'),auth['isAuthenticated'](),controller[_0x0fd4('0xc')]);router['post']('/',auth[_0x0fd4('0x9')](),controller[_0x0fd4('0xd')]);router[_0x0fd4('0xe')](_0x0fd4('0xb'),auth[_0x0fd4('0x9')](),controller[_0x0fd4('0xf')]);router[_0x0fd4('0x10')](_0x0fd4('0xb'),auth[_0x0fd4('0x9')](),controller[_0x0fd4('0x11')]);module[_0x0fd4('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 dabe670..3041f25 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 _0x5ff2=['name','join','getDataValue','options','split','BOOLEAN','exports','STRING'];(function(_0x1e3b99,_0x54ea39){var _0x416130=function(_0x2a48fc){while(--_0x2a48fc){_0x1e3b99['push'](_0x1e3b99['shift']());}};_0x416130(++_0x54ea39);}(_0x5ff2,0xde));var _0x25ff=function(_0x34db21,_0x4256bb){_0x34db21=_0x34db21-0x0;var _0x5e7d82=_0x5ff2[_0x34db21];return _0x5e7d82;};'use strict';var Sequelize=require('sequelize');module[_0x25ff('0x0')]={'name':{'type':Sequelize[_0x25ff('0x1')]},'prefix':{'type':Sequelize[_0x25ff('0x1')],'unique':_0x25ff('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x26d6e5){this['setDataValue']('options',_0x26d6e5?_0x26d6e5[_0x25ff('0x3')](''):[]);},'get':function(){return this[_0x25ff('0x4')](_0x25ff('0x5'))?this[_0x25ff('0x4')](_0x25ff('0x5'))[_0x25ff('0x6')](''):[];}},'auth':{'type':Sequelize[_0x25ff('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x25ff('0x1')]},'record':{'type':Sequelize[_0x25ff('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x25ff('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaa1d=['name','setDataValue','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xaa1d,0xe7));var _0xdaa1=function(_0xda9702,_0x521922){_0xda9702=_0xda9702-0x0;var _0x105be5=_0xaa1d[_0xda9702];return _0x105be5;};'use strict';var Sequelize=require(_0xdaa1('0x0'));module[_0xdaa1('0x1')]={'name':{'type':Sequelize[_0xdaa1('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xdaa1('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xdaa1('0x2')],'set':function(_0x172001){this[_0xdaa1('0x4')]('options',_0x172001?_0x172001[_0xdaa1('0x5')](''):[]);},'get':function(){return this[_0xdaa1('0x6')]('options')?this[_0xdaa1('0x6')]('options')[_0xdaa1('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xdaa1('0x2')]},'record':{'type':Sequelize[_0xdaa1('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xdaa1('0x2')]},'description':{'type':Sequelize[_0xdaa1('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 1a040f6..fd888bf 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 _0xe03c=['key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','count','includeAll','include','findAll','show','params','keys','length','catch','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','then','destroy','ChanSpies','error','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type'];(function(_0x3181c3,_0x44f848){var _0x2eadca=function(_0xdc81fc){while(--_0xdc81fc){_0x3181c3['push'](_0x3181c3['shift']());}};_0x2eadca(++_0x44f848);}(_0xe03c,0x123));var _0xce03=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0xe03c[_0x5f49c0];return _0x5ab653;};'use strict';var pdf=require(_0xce03('0x0'));var emlformat=require(_0xce03('0x1'));var rimraf=require(_0xce03('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce03('0x3'));var rp=require('request-promise');var moment=require(_0xce03('0x4'));var BPromise=require(_0xce03('0x5'));var Mustache=require(_0xce03('0x6'));var util=require(_0xce03('0x7'));var path=require(_0xce03('0x8'));var sox=require(_0xce03('0x9'));var csv=require(_0xce03('0xa'));var ejs=require(_0xce03('0xb'));var fs=require('fs');var _=require(_0xce03('0xc'));var squel=require(_0xce03('0xd'));var crypto=require('crypto');var jsforce=require(_0xce03('0xe'));var deskjs=require(_0xce03('0xf'));var toCsv=require(_0xce03('0xa'));var querystring=require(_0xce03('0x10'));var Papa=require(_0xce03('0x11'));var Redis=require('ioredis');var authService=require(_0xce03('0x12'));var qs=require(_0xce03('0x13'));var as=require(_0xce03('0x14'));var hardwareService=require(_0xce03('0x15'));var logger=require(_0xce03('0x16'))(_0xce03('0x17'));var utils=require(_0xce03('0x18'));var config=require(_0xce03('0x19'));var db=require(_0xce03('0x1a'))['db'];function respondWithStatusCode(_0x4a213e,_0x2ee05d){_0x2ee05d=_0x2ee05d||0xcc;return function(_0xb5f2a3){if(_0xb5f2a3){return _0x4a213e[_0xce03('0x1b')](_0x2ee05d);}return _0x4a213e[_0xce03('0x1c')](_0x2ee05d)[_0xce03('0x1d')]();};}function respondWithResult(_0x9ce54f,_0x465955){_0x465955=_0x465955||0xc8;return function(_0x222fe5){if(_0x222fe5){return _0x9ce54f[_0xce03('0x1c')](_0x465955)[_0xce03('0x1e')](_0x222fe5);}};}function respondWithFilteredResult(_0x74745b,_0x4d03e1){return function(_0x5c8536){if(_0x5c8536){var _0x493c81=_0x5c8536['count'],_0x53773a=_0x4d03e1[_0xce03('0x1f')],_0x51bee5=_0x4d03e1['offset']+_0x4d03e1[_0xce03('0x20')],_0x1c6129;if(_0x51bee5>=_0x493c81){_0x51bee5=_0x493c81;_0x1c6129=0xc8;}else{_0x1c6129=0xce;}_0x74745b[_0xce03('0x1c')](_0x1c6129);return _0x74745b[_0xce03('0x21')]('Content-Range',_0x53773a+'-'+_0x51bee5+'/'+_0x493c81)[_0xce03('0x1e')](_0x5c8536);}return null;};}function patchUpdates(_0x171690){return function(_0x20b1c9){try{jsonpatch[_0xce03('0x22')](_0x20b1c9,_0x171690,!![]);}catch(_0x553c76){return BPromise[_0xce03('0x23')](_0x553c76);}return _0x20b1c9[_0xce03('0x24')]();};}function saveUpdates(_0x305621,_0x520674){return function(_0xe13d62){if(_0xe13d62){return _0xe13d62['update'](_0x305621)[_0xce03('0x25')](function(_0x4e45d4){return _0x4e45d4;});}return null;};}function removeEntity(_0x43fc18,_0x42dc75){return function(_0x1f03a3){if(_0x1f03a3){return _0x1f03a3[_0xce03('0x26')]()[_0xce03('0x25')](function(){var _0x43e4bc=_0x1f03a3['get']({'plain':!![]});var _0x4f38ca=_0xce03('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4f38ca,'resourceId':_0x43e4bc['id']}})['then'](function(){return _0x1f03a3;});})['then'](function(){_0x43fc18['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a520,_0x18a938){return function(_0x1c8c2e){if(!_0x1c8c2e){_0x31a520['sendStatus'](0x194);}return _0x1c8c2e;};}function handleError(_0x45fe67,_0x34dd70){_0x34dd70=_0x34dd70||0x1f4;return function(_0x27d873){logger[_0xce03('0x28')](_0x27d873['stack']);if(_0x27d873[_0xce03('0x29')]){delete _0x27d873[_0xce03('0x29')];}_0x45fe67[_0xce03('0x1c')](_0x34dd70)[_0xce03('0x2a')](_0x27d873);};}exports[_0xce03('0x2b')]=function(_0x9e1750,_0x27d260){var _0x1305e5={},_0x188923={},_0x4f41b5={'count':0x0,'rows':[]};var _0xbea703=_[_0xce03('0x2c')](db[_0xce03('0x2d')][_0xce03('0x2e')],function(_0x5165e6){return{'name':_0x5165e6[_0xce03('0x2f')],'type':_0x5165e6[_0xce03('0x30')][_0xce03('0x31')]};});_0x188923[_0xce03('0x32')]=_[_0xce03('0x2c')](_0xbea703,_0xce03('0x29'));_0x188923['query']=_['keys'](_0x9e1750[_0xce03('0x33')]);_0x188923['filters']=_[_0xce03('0x34')](_0x188923[_0xce03('0x32')],_0x188923['query']);_0x1305e5[_0xce03('0x35')]=_[_0xce03('0x34')](_0x188923[_0xce03('0x32')],qs[_0xce03('0x36')](_0x9e1750[_0xce03('0x33')][_0xce03('0x36')]));_0x1305e5[_0xce03('0x35')]=_0x1305e5[_0xce03('0x35')]['length']?_0x1305e5['attributes']:_0x188923[_0xce03('0x32')];if(!_0x9e1750[_0xce03('0x33')][_0xce03('0x37')](_0xce03('0x38'))){_0x1305e5['limit']=qs[_0xce03('0x20')](_0x9e1750['query'][_0xce03('0x20')]);_0x1305e5[_0xce03('0x1f')]=qs[_0xce03('0x1f')](_0x9e1750[_0xce03('0x33')][_0xce03('0x1f')]);}_0x1305e5[_0xce03('0x39')]=qs[_0xce03('0x3a')](_0x9e1750['query'][_0xce03('0x3a')]);_0x1305e5['where']=qs[_0xce03('0x3b')](_[_0xce03('0x3c')](_0x9e1750[_0xce03('0x33')],_0x188923[_0xce03('0x3b')]));if(_0x9e1750[_0xce03('0x33')][_0xce03('0x3d')]){_0x1305e5[_0xce03('0x3e')]=_[_0xce03('0x3f')](_0x1305e5[_0xce03('0x3e')],{'$or':_['map'](_0xbea703,function(_0xfeb5d5){if(_0xfeb5d5[_0xce03('0x30')]!=='VIRTUAL'){var _0x6778ff={};_0x6778ff[_0xfeb5d5[_0xce03('0x29')]]={'$like':'%'+_0x9e1750[_0xce03('0x33')]['filter']+'%'};return _0x6778ff;}})});}_0x1305e5=_[_0xce03('0x3f')]({},_0x1305e5,_0x9e1750[_0xce03('0x40')]);var _0x17d03c={'where':_0x1305e5[_0xce03('0x3e')]};return db[_0xce03('0x2d')][_0xce03('0x41')](_0x17d03c)['then'](function(_0x53bc07){_0x4f41b5['count']=_0x53bc07;if(_0x9e1750[_0xce03('0x33')][_0xce03('0x42')]){_0x1305e5[_0xce03('0x43')]=[{'all':!![]}];}return db[_0xce03('0x2d')][_0xce03('0x44')](_0x1305e5);})[_0xce03('0x25')](function(_0x3f8b55){_0x4f41b5['rows']=_0x3f8b55;return _0x4f41b5;})['then'](respondWithFilteredResult(_0x27d260,_0x1305e5))['catch'](handleError(_0x27d260,null));};exports[_0xce03('0x45')]=function(_0x27ca65,_0x5e3168){var _0x5c42bf={'raw':![],'where':{'id':_0x27ca65[_0xce03('0x46')]['id']}},_0x588772={};_0x588772[_0xce03('0x32')]=_[_0xce03('0x47')](db[_0xce03('0x2d')][_0xce03('0x2e')]);_0x588772[_0xce03('0x33')]=_['keys'](_0x27ca65['query']);_0x588772[_0xce03('0x3b')]=_[_0xce03('0x34')](_0x588772[_0xce03('0x32')],_0x588772[_0xce03('0x33')]);_0x5c42bf['attributes']=_[_0xce03('0x34')](_0x588772[_0xce03('0x32')],qs[_0xce03('0x36')](_0x27ca65['query']['fields']));_0x5c42bf['attributes']=_0x5c42bf[_0xce03('0x35')][_0xce03('0x48')]?_0x5c42bf[_0xce03('0x35')]:_0x588772['model'];if(_0x27ca65[_0xce03('0x33')]['includeAll']){_0x5c42bf[_0xce03('0x43')]=[{'all':!![]}];}_0x5c42bf=_[_0xce03('0x3f')]({},_0x5c42bf,_0x27ca65[_0xce03('0x40')]);return db[_0xce03('0x2d')]['find'](_0x5c42bf)[_0xce03('0x25')](handleEntityNotFound(_0x5e3168,null))[_0xce03('0x25')](respondWithResult(_0x5e3168,null))[_0xce03('0x49')](handleError(_0x5e3168,null));};exports[_0xce03('0x4a')]=function(_0x393e2b,_0x5e7dbe){return db['VoiceChanSpy'][_0xce03('0x4a')](_0x393e2b[_0xce03('0x4b')],{})[_0xce03('0x25')](function(_0x5222df){var _0x3e3b86=_0x393e2b[_0xce03('0x4c')]['get']({'plain':!![]});if(!_0x3e3b86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e3b86['role']===_0xce03('0x4c')){var _0x47104d=_0x5222df[_0xce03('0x4d')]({'plain':!![]});var _0x1a9d64=_0xce03('0x27');return db[_0xce03('0x4e')]['find']({'where':{'name':_0x1a9d64,'userProfileId':_0x3e3b86[_0xce03('0x4f')]},'raw':!![]})[_0xce03('0x25')](function(_0x4c6cc1){if(_0x4c6cc1&&_0x4c6cc1[_0xce03('0x50')]===0x0){return db[_0xce03('0x51')][_0xce03('0x4a')]({'name':_0x47104d['name'],'resourceId':_0x47104d['id'],'type':_0x4c6cc1[_0xce03('0x29')],'sectionId':_0x4c6cc1['id']},{})[_0xce03('0x25')](function(){return _0x5222df;});}else{return _0x5222df;}})[_0xce03('0x49')](function(_0x309911){logger[_0xce03('0x28')](_0xce03('0x52'),_0x309911);throw _0x309911;});}return _0x5222df;})[_0xce03('0x25')](respondWithResult(_0x5e7dbe,0xc9))['catch'](handleError(_0x5e7dbe,null));};exports[_0xce03('0x53')]=function(_0x51fdca,_0x310e6f){if(_0x51fdca[_0xce03('0x4b')]['id']){delete _0x51fdca['body']['id'];}return db[_0xce03('0x2d')]['find']({'where':{'id':_0x51fdca[_0xce03('0x46')]['id']}})[_0xce03('0x25')](handleEntityNotFound(_0x310e6f,null))[_0xce03('0x25')](saveUpdates(_0x51fdca[_0xce03('0x4b')],null))[_0xce03('0x25')](respondWithResult(_0x310e6f,null))[_0xce03('0x49')](handleError(_0x310e6f,null));};exports[_0xce03('0x26')]=function(_0x24a15,_0x4a14ae){return db['VoiceChanSpy'][_0xce03('0x54')]({'where':{'id':_0x24a15['params']['id']}})[_0xce03('0x25')](handleEntityNotFound(_0x4a14ae,null))[_0xce03('0x25')](removeEntity(_0x4a14ae,null))['catch'](handleError(_0x4a14ae,null));}; \ No newline at end of file +var _0x5e0b=['name','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','VoiceChanSpy','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','ChanSpies','stack'];(function(_0xadb014,_0x41f056){var _0x1f2db0=function(_0x49afca){while(--_0x49afca){_0xadb014['push'](_0xadb014['shift']());}};_0x1f2db0(++_0x41f056);}(_0x5e0b,0x174));var _0xb5e0=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0x5e0b[_0x9fb081];return _0x43f8b0;};'use strict';var pdf=require(_0xb5e0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb5e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb5e0('0x2'));var moment=require(_0xb5e0('0x3'));var BPromise=require(_0xb5e0('0x4'));var Mustache=require(_0xb5e0('0x5'));var util=require(_0xb5e0('0x6'));var path=require(_0xb5e0('0x7'));var sox=require(_0xb5e0('0x8'));var csv=require(_0xb5e0('0x9'));var ejs=require(_0xb5e0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb5e0('0xb'));var crypto=require('crypto');var jsforce=require(_0xb5e0('0xc'));var deskjs=require(_0xb5e0('0xd'));var toCsv=require(_0xb5e0('0x9'));var querystring=require('querystring');var Papa=require(_0xb5e0('0xe'));var Redis=require('ioredis');var authService=require(_0xb5e0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb5e0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5e0('0x11'))(_0xb5e0('0x12'));var utils=require(_0xb5e0('0x13'));var config=require(_0xb5e0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b7b0d,_0x482e84){_0x482e84=_0x482e84||0xcc;return function(_0x22ad08){if(_0x22ad08){return _0x5b7b0d[_0xb5e0('0x15')](_0x482e84);}return _0x5b7b0d[_0xb5e0('0x16')](_0x482e84)[_0xb5e0('0x17')]();};}function respondWithResult(_0x5f7361,_0x15ac95){_0x15ac95=_0x15ac95||0xc8;return function(_0x576163){if(_0x576163){return _0x5f7361[_0xb5e0('0x16')](_0x15ac95)[_0xb5e0('0x18')](_0x576163);}};}function respondWithFilteredResult(_0x5e7122,_0x49c247){return function(_0x1b9b11){if(_0x1b9b11){var _0x93bbb5=_0x1b9b11[_0xb5e0('0x19')],_0x13b8cf=_0x49c247[_0xb5e0('0x1a')],_0x514c96=_0x49c247[_0xb5e0('0x1a')]+_0x49c247[_0xb5e0('0x1b')],_0x16f952;if(_0x514c96>=_0x93bbb5){_0x514c96=_0x93bbb5;_0x16f952=0xc8;}else{_0x16f952=0xce;}_0x5e7122[_0xb5e0('0x16')](_0x16f952);return _0x5e7122[_0xb5e0('0x1c')](_0xb5e0('0x1d'),_0x13b8cf+'-'+_0x514c96+'/'+_0x93bbb5)['json'](_0x1b9b11);}return null;};}function patchUpdates(_0x55f451){return function(_0xa570ac){try{jsonpatch[_0xb5e0('0x1e')](_0xa570ac,_0x55f451,!![]);}catch(_0x320dbe){return BPromise[_0xb5e0('0x1f')](_0x320dbe);}return _0xa570ac[_0xb5e0('0x20')]();};}function saveUpdates(_0x1a33fd,_0x5a6e41){return function(_0x3e345f){if(_0x3e345f){return _0x3e345f[_0xb5e0('0x21')](_0x1a33fd)['then'](function(_0x27facd){return _0x27facd;});}return null;};}function removeEntity(_0x3d86c5,_0xadb895){return function(_0x441863){if(_0x441863){return _0x441863[_0xb5e0('0x22')]()[_0xb5e0('0x23')](function(){var _0x113ebc=_0x441863['get']({'plain':!![]});var _0x1f55ae=_0xb5e0('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1f55ae,'resourceId':_0x113ebc['id']}})[_0xb5e0('0x23')](function(){return _0x441863;});})[_0xb5e0('0x23')](function(){_0x3d86c5[_0xb5e0('0x16')](0xcc)[_0xb5e0('0x17')]();});}};}function handleEntityNotFound(_0x3fa595,_0xe67d9d){return function(_0x35a9e8){if(!_0x35a9e8){_0x3fa595[_0xb5e0('0x15')](0x194);}return _0x35a9e8;};}function handleError(_0x9e990,_0x18bfa9){_0x18bfa9=_0x18bfa9||0x1f4;return function(_0x2f5f53){logger['error'](_0x2f5f53[_0xb5e0('0x25')]);if(_0x2f5f53[_0xb5e0('0x26')]){delete _0x2f5f53[_0xb5e0('0x26')];}_0x9e990['status'](_0x18bfa9)['send'](_0x2f5f53);};}exports[_0xb5e0('0x27')]=function(_0x32a7db,_0x546611){var _0x38908b={},_0x52928e={},_0x2a96c0={'count':0x0,'rows':[]};var _0x482657=_['map'](db['VoiceChanSpy'][_0xb5e0('0x28')],function(_0x26d3a1){return{'name':_0x26d3a1[_0xb5e0('0x29')],'type':_0x26d3a1[_0xb5e0('0x2a')][_0xb5e0('0x2b')]};});_0x52928e[_0xb5e0('0x2c')]=_['map'](_0x482657,_0xb5e0('0x26'));_0x52928e[_0xb5e0('0x2d')]=_['keys'](_0x32a7db[_0xb5e0('0x2d')]);_0x52928e[_0xb5e0('0x2e')]=_[_0xb5e0('0x2f')](_0x52928e[_0xb5e0('0x2c')],_0x52928e[_0xb5e0('0x2d')]);_0x38908b[_0xb5e0('0x30')]=_[_0xb5e0('0x2f')](_0x52928e[_0xb5e0('0x2c')],qs[_0xb5e0('0x31')](_0x32a7db[_0xb5e0('0x2d')][_0xb5e0('0x31')]));_0x38908b[_0xb5e0('0x30')]=_0x38908b[_0xb5e0('0x30')][_0xb5e0('0x32')]?_0x38908b[_0xb5e0('0x30')]:_0x52928e[_0xb5e0('0x2c')];if(!_0x32a7db[_0xb5e0('0x2d')][_0xb5e0('0x33')](_0xb5e0('0x34'))){_0x38908b[_0xb5e0('0x1b')]=qs[_0xb5e0('0x1b')](_0x32a7db[_0xb5e0('0x2d')][_0xb5e0('0x1b')]);_0x38908b[_0xb5e0('0x1a')]=qs[_0xb5e0('0x1a')](_0x32a7db[_0xb5e0('0x2d')][_0xb5e0('0x1a')]);}_0x38908b[_0xb5e0('0x35')]=qs[_0xb5e0('0x36')](_0x32a7db[_0xb5e0('0x2d')][_0xb5e0('0x36')]);_0x38908b[_0xb5e0('0x37')]=qs['filters'](_[_0xb5e0('0x38')](_0x32a7db[_0xb5e0('0x2d')],_0x52928e[_0xb5e0('0x2e')]));if(_0x32a7db['query'][_0xb5e0('0x39')]){_0x38908b[_0xb5e0('0x37')]=_[_0xb5e0('0x3a')](_0x38908b[_0xb5e0('0x37')],{'$or':_[_0xb5e0('0x3b')](_0x482657,function(_0x20b9c6){if(_0x20b9c6[_0xb5e0('0x2a')]!=='VIRTUAL'){var _0x2ea6f9={};_0x2ea6f9[_0x20b9c6[_0xb5e0('0x26')]]={'$like':'%'+_0x32a7db[_0xb5e0('0x2d')]['filter']+'%'};return _0x2ea6f9;}})});}_0x38908b=_[_0xb5e0('0x3a')]({},_0x38908b,_0x32a7db[_0xb5e0('0x3c')]);var _0x40a8db={'where':_0x38908b['where']};return db[_0xb5e0('0x3d')][_0xb5e0('0x19')](_0x40a8db)[_0xb5e0('0x23')](function(_0x27312d){_0x2a96c0[_0xb5e0('0x19')]=_0x27312d;if(_0x32a7db[_0xb5e0('0x2d')][_0xb5e0('0x3e')]){_0x38908b[_0xb5e0('0x3f')]=[{'all':!![]}];}return db[_0xb5e0('0x3d')][_0xb5e0('0x40')](_0x38908b);})[_0xb5e0('0x23')](function(_0x41f732){_0x2a96c0[_0xb5e0('0x41')]=_0x41f732;return _0x2a96c0;})[_0xb5e0('0x23')](respondWithFilteredResult(_0x546611,_0x38908b))['catch'](handleError(_0x546611,null));};exports[_0xb5e0('0x42')]=function(_0xa5acd3,_0x43558f){var _0x48d7da={'raw':![],'where':{'id':_0xa5acd3[_0xb5e0('0x43')]['id']}},_0x49b8e5={};_0x49b8e5[_0xb5e0('0x2c')]=_[_0xb5e0('0x44')](db[_0xb5e0('0x3d')][_0xb5e0('0x28')]);_0x49b8e5['query']=_[_0xb5e0('0x44')](_0xa5acd3[_0xb5e0('0x2d')]);_0x49b8e5[_0xb5e0('0x2e')]=_['intersection'](_0x49b8e5[_0xb5e0('0x2c')],_0x49b8e5[_0xb5e0('0x2d')]);_0x48d7da[_0xb5e0('0x30')]=_[_0xb5e0('0x2f')](_0x49b8e5[_0xb5e0('0x2c')],qs[_0xb5e0('0x31')](_0xa5acd3[_0xb5e0('0x2d')]['fields']));_0x48d7da['attributes']=_0x48d7da['attributes'][_0xb5e0('0x32')]?_0x48d7da[_0xb5e0('0x30')]:_0x49b8e5['model'];if(_0xa5acd3[_0xb5e0('0x2d')]['includeAll']){_0x48d7da[_0xb5e0('0x3f')]=[{'all':!![]}];}_0x48d7da=_[_0xb5e0('0x3a')]({},_0x48d7da,_0xa5acd3[_0xb5e0('0x3c')]);return db[_0xb5e0('0x3d')][_0xb5e0('0x45')](_0x48d7da)['then'](handleEntityNotFound(_0x43558f,null))[_0xb5e0('0x23')](respondWithResult(_0x43558f,null))['catch'](handleError(_0x43558f,null));};exports[_0xb5e0('0x46')]=function(_0x4f8ac3,_0x698ba5){return db['VoiceChanSpy'][_0xb5e0('0x46')](_0x4f8ac3[_0xb5e0('0x47')],{})[_0xb5e0('0x23')](function(_0x71ded9){var _0x531c3c=_0x4f8ac3[_0xb5e0('0x48')][_0xb5e0('0x49')]({'plain':!![]});if(!_0x531c3c)throw new Error(_0xb5e0('0x4a'));if(_0x531c3c[_0xb5e0('0x4b')]===_0xb5e0('0x48')){var _0x4e2cdb=_0x71ded9['get']({'plain':!![]});var _0x2fbe1c=_0xb5e0('0x24');return db['UserProfileSection'][_0xb5e0('0x45')]({'where':{'name':_0x2fbe1c,'userProfileId':_0x531c3c[_0xb5e0('0x4c')]},'raw':!![]})['then'](function(_0x1d72b5){if(_0x1d72b5&&_0x1d72b5[_0xb5e0('0x4d')]===0x0){return db[_0xb5e0('0x4e')][_0xb5e0('0x46')]({'name':_0x4e2cdb[_0xb5e0('0x26')],'resourceId':_0x4e2cdb['id'],'type':_0x1d72b5[_0xb5e0('0x26')],'sectionId':_0x1d72b5['id']},{})[_0xb5e0('0x23')](function(){return _0x71ded9;});}else{return _0x71ded9;}})[_0xb5e0('0x4f')](function(_0x4c2934){logger[_0xb5e0('0x50')](_0xb5e0('0x51'),_0x4c2934);throw _0x4c2934;});}return _0x71ded9;})['then'](respondWithResult(_0x698ba5,0xc9))[_0xb5e0('0x4f')](handleError(_0x698ba5,null));};exports[_0xb5e0('0x21')]=function(_0x2f2551,_0x30b7cf){if(_0x2f2551[_0xb5e0('0x47')]['id']){delete _0x2f2551[_0xb5e0('0x47')]['id'];}return db[_0xb5e0('0x3d')]['find']({'where':{'id':_0x2f2551[_0xb5e0('0x43')]['id']}})[_0xb5e0('0x23')](handleEntityNotFound(_0x30b7cf,null))[_0xb5e0('0x23')](saveUpdates(_0x2f2551[_0xb5e0('0x47')],null))[_0xb5e0('0x23')](respondWithResult(_0x30b7cf,null))[_0xb5e0('0x4f')](handleError(_0x30b7cf,null));};exports[_0xb5e0('0x22')]=function(_0x210b40,_0xd4f323){return db[_0xb5e0('0x3d')][_0xb5e0('0x45')]({'where':{'id':_0x210b40[_0xb5e0('0x43')]['id']}})[_0xb5e0('0x23')](handleEntityNotFound(_0xd4f323,null))[_0xb5e0('0x23')](removeEntity(_0xd4f323,null))[_0xb5e0('0x4f')](handleError(_0xd4f323,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 3436d84..7c2a679 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 _0x9cec=['system','push','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,ab','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','merge','StopMixMonitor','length','internal','concat','User','then','catch','exports','models','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix'];(function(_0x5279d5,_0x1c38e7){var _0x10cef0=function(_0x46c8e3){while(--_0x46c8e3){_0x5279d5['push'](_0x5279d5['shift']());}};_0x10cef0(++_0x1c38e7);}(_0x9cec,0x174));var _0xc9ce=function(_0x473f45,_0x185e43){_0x473f45=_0x473f45-0x0;var _0x3dc894=_0x9cec[_0x473f45];return _0x3dc894;};'use strict';var _=require(_0xc9ce('0x0'));var util=require(_0xc9ce('0x1'));var BPromise=require(_0xc9ce('0x2'));var attributes=require(_0xc9ce('0x3'));var getUserApplications=function(_0x14e830,_0x4b9772,_0x5956e1){var _0x300bc4=0x1;var _0x2cde67=[];var _0x4e2277={'context':_0x4b9772['context']||_0xc9ce('0x4'),'exten':util[_0xc9ce('0x5')](_0xc9ce('0x6'),_0x14e830[_0xc9ce('0x7')],_0x5956e1),'type':_0xc9ce('0x8'),'isApp':![],'ChanSpyId':_0x14e830['id'],'UserId':_0x4b9772['id']};_0x2cde67[_0xc9ce('0x9')](_['merge']({'app':_0xc9ce('0xa'),'appdata':util[_0xc9ce('0x5')](_0xc9ce('0xb'),_0xc9ce('0xc')),'priority':_0x300bc4++},_0x4e2277));if(_0x14e830[_0xc9ce('0xd')]){_0x2cde67[_0xc9ce('0x9')](_['merge']({'app':'MixMonitor','appdata':util['format'](_0xc9ce('0xe'),_0x14e830['recordingFormat']),'priority':_0x300bc4++},_0x4e2277));}if(_0x14e830[_0xc9ce('0xf')]){_0x2cde67['push'](_['merge']({'app':_0xc9ce('0x10'),'appdata':_0x14e830[_0xc9ce('0x11')],'priority':_0x300bc4++},_0x4e2277));}_0x2cde67[_0xc9ce('0x9')](_['merge']({'app':_0xc9ce('0x12'),'appdata':util[_0xc9ce('0x5')](_0xc9ce('0x13'),_0x4b9772[_0xc9ce('0x14')],_0x14e830[_0xc9ce('0x15')]?_0x14e830['options'][_0xc9ce('0x16')](''):''),'priority':_0x300bc4++},_0x4e2277));if(_0x14e830[_0xc9ce('0xd')]){_0x2cde67[_0xc9ce('0x9')](_[_0xc9ce('0x17')]({'app':_0xc9ce('0x18'),'priority':_0x300bc4++},_0x4e2277));}return _0x2cde67;};var getChanSpyApplications=function(_0x5ac3aa,_0x3cd469){var _0x24f37d=[];for(var _0x13484d=0x0,_0x64a0ce=0x1;_0x13484d<_0x3cd469[_0xc9ce('0x19')];_0x13484d++,_0x64a0ce=0x1){_0x24f37d=_0x24f37d['concat'](getUserApplications(_0x5ac3aa,_0x3cd469[_0x13484d],_0x3cd469[_0x13484d][_0xc9ce('0x1a')]));if(_0x3cd469[_0x13484d][_0xc9ce('0x1a')]!=_0x3cd469[_0x13484d]['name']){_0x24f37d=_0x24f37d[_0xc9ce('0x1b')](getUserApplications(_0x5ac3aa,_0x3cd469[_0x13484d],_0x3cd469[_0x13484d][_0xc9ce('0x14')]));}}return _0x24f37d;};var getChanSpyPromise=function(_0x405411,_0x2cf294){return new BPromise(function(_0x3b4684,_0x44af10){return _0x405411[_0xc9ce('0x1c')]['findAll']({'attributes':['id',_0xc9ce('0x14'),_0xc9ce('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xc9ce('0x1d')](function(_0x3ec4e0){if(_0x3ec4e0){return _0x3b4684(getChanSpyApplications(_0x2cf294,_0x3ec4e0));}return _0x3b4684([]);})[_0xc9ce('0x1e')](function(_0x3cd258){_0x44af10(_0x3cd258);});});};module[_0xc9ce('0x1f')]=function(_0x487180,_0x19a3e3){var _0x489085=_0x487180[_0xc9ce('0x20')];return _0x487180[_0xc9ce('0x21')]('VoiceChanSpy',attributes,{'tableName':_0xc9ce('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x45f993,_0xa27709,_0x213669){return getChanSpyPromise(_0x489085,_0x45f993)[_0xc9ce('0x1d')](function(_0x11ab21){if(_0x11ab21&&_0x11ab21[_0xc9ce('0x19')]){return _0x489085[_0xc9ce('0x23')][_0xc9ce('0x24')](_0x11ab21);}})[_0xc9ce('0x1d')](function(){_0x213669();})[_0xc9ce('0x1e')](function(_0x17040e){_0x213669(_0x17040e);});},'afterUpdate':function(_0x21db01,_0x53e583,_0x2527d9){return _0x489085['VoiceExtension'][_0xc9ce('0x25')]({'where':{'ChanSpyId':_0x21db01['id']}})[_0xc9ce('0x1d')](function(){return getChanSpyPromise(_0x489085,_0x21db01);})['then'](function(_0x47366c){if(_0x47366c&&_0x47366c[_0xc9ce('0x19')]){return _0x489085[_0xc9ce('0x23')][_0xc9ce('0x24')](_0x47366c);}})['then'](function(){_0x2527d9();})[_0xc9ce('0x1e')](function(_0x53bd4a){_0x2527d9(_0x53bd4a);});},'afterDestroy':function(_0x5bb5dc,_0x1ff325,_0x490e8d){return _0x489085[_0xc9ce('0x23')][_0xc9ce('0x25')]({'where':{'ChanSpyId':_0x5bb5dc['id']}})[_0xc9ce('0x1d')](function(){_0x490e8d();})[_0xc9ce('0x1e')](function(_0x6b9497){_0x490e8d(_0x6b9497);});}}});}; \ No newline at end of file +var _0x835d=['Authenticate','ChanSpy','name','options','join','record','StopMixMonitor','concat','internal','User','findAll','then','catch','exports','VoiceChanSpy','length','VoiceExtension','destroy','bulkCreate','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth'];(function(_0x2da9b2,_0x5207a7){var _0x3f222e=function(_0xd9b776){while(--_0xd9b776){_0x2da9b2['push'](_0x2da9b2['shift']());}};_0x3f222e(++_0x5207a7);}(_0x835d,0x10f));var _0xd835=function(_0x58eb21,_0x7125de){_0x58eb21=_0x58eb21-0x0;var _0x5c5604=_0x835d[_0x58eb21];return _0x5c5604;};'use strict';var _=require('lodash');var util=require(_0xd835('0x0'));var BPromise=require('bluebird');var attributes=require(_0xd835('0x1'));var getUserApplications=function(_0x13f54d,_0x372955,_0x9f94da){var _0xabb777=0x1;var _0x44df5d=[];var _0x5cc9ac={'context':_0x372955[_0xd835('0x2')]||_0xd835('0x3'),'exten':util[_0xd835('0x4')](_0xd835('0x5'),_0x13f54d[_0xd835('0x6')],_0x9f94da),'type':_0xd835('0x7'),'isApp':![],'ChanSpyId':_0x13f54d['id'],'UserId':_0x372955['id']};_0x44df5d[_0xd835('0x8')](_[_0xd835('0x9')]({'app':_0xd835('0xa'),'appdata':util[_0xd835('0x4')](_0xd835('0xb'),_0xd835('0xc')),'priority':_0xabb777++},_0x5cc9ac));if(_0x13f54d['record']){_0x44df5d[_0xd835('0x8')](_['merge']({'app':_0xd835('0xd'),'appdata':util[_0xd835('0x4')](_0xd835('0xe'),_0x13f54d[_0xd835('0xf')]),'priority':_0xabb777++},_0x5cc9ac));}if(_0x13f54d[_0xd835('0x10')]){_0x44df5d[_0xd835('0x8')](_['merge']({'app':_0xd835('0x11'),'appdata':_0x13f54d['password'],'priority':_0xabb777++},_0x5cc9ac));}_0x44df5d[_0xd835('0x8')](_[_0xd835('0x9')]({'app':_0xd835('0x12'),'appdata':util['format']('SIP/%s,%s',_0x372955[_0xd835('0x13')],_0x13f54d[_0xd835('0x14')]?_0x13f54d[_0xd835('0x14')][_0xd835('0x15')](''):''),'priority':_0xabb777++},_0x5cc9ac));if(_0x13f54d[_0xd835('0x16')]){_0x44df5d[_0xd835('0x8')](_[_0xd835('0x9')]({'app':_0xd835('0x17'),'priority':_0xabb777++},_0x5cc9ac));}return _0x44df5d;};var getChanSpyApplications=function(_0x5aef42,_0x4be07a){var _0x58a33c=[];for(var _0x58c3e5=0x0,_0x1eb0a0=0x1;_0x58c3e5<_0x4be07a['length'];_0x58c3e5++,_0x1eb0a0=0x1){_0x58a33c=_0x58a33c[_0xd835('0x18')](getUserApplications(_0x5aef42,_0x4be07a[_0x58c3e5],_0x4be07a[_0x58c3e5][_0xd835('0x19')]));if(_0x4be07a[_0x58c3e5][_0xd835('0x19')]!=_0x4be07a[_0x58c3e5][_0xd835('0x13')]){_0x58a33c=_0x58a33c['concat'](getUserApplications(_0x5aef42,_0x4be07a[_0x58c3e5],_0x4be07a[_0x58c3e5]['name']));}}return _0x58a33c;};var getChanSpyPromise=function(_0x1c0e3c,_0x1dd98b){return new BPromise(function(_0x585a73,_0x5662ca){return _0x1c0e3c[_0xd835('0x1a')][_0xd835('0x1b')]({'attributes':['id','name',_0xd835('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xd835('0x1c')](function(_0x204a0d){if(_0x204a0d){return _0x585a73(getChanSpyApplications(_0x1dd98b,_0x204a0d));}return _0x585a73([]);})[_0xd835('0x1d')](function(_0x155658){_0x5662ca(_0x155658);});});};module[_0xd835('0x1e')]=function(_0x5731f9,_0xae3b9f){var _0x2de38d=_0x5731f9['models'];return _0x5731f9['define'](_0xd835('0x1f'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x39ea79,_0x34d66d,_0x53b5b5){return getChanSpyPromise(_0x2de38d,_0x39ea79)[_0xd835('0x1c')](function(_0x57d330){if(_0x57d330&&_0x57d330[_0xd835('0x20')]){return _0x2de38d[_0xd835('0x21')]['bulkCreate'](_0x57d330);}})['then'](function(){_0x53b5b5();})[_0xd835('0x1d')](function(_0x448e51){_0x53b5b5(_0x448e51);});},'afterUpdate':function(_0x83c60d,_0x28f572,_0x3cdfee){return _0x2de38d[_0xd835('0x21')][_0xd835('0x22')]({'where':{'ChanSpyId':_0x83c60d['id']}})[_0xd835('0x1c')](function(){return getChanSpyPromise(_0x2de38d,_0x83c60d);})[_0xd835('0x1c')](function(_0x49573d){if(_0x49573d&&_0x49573d[_0xd835('0x20')]){return _0x2de38d[_0xd835('0x21')][_0xd835('0x23')](_0x49573d);}})[_0xd835('0x1c')](function(){_0x3cdfee();})[_0xd835('0x1d')](function(_0x278c3f){_0x3cdfee(_0x278c3f);});},'afterDestroy':function(_0x568d02,_0x373f98,_0x46eb3c){return _0x2de38d[_0xd835('0x21')][_0xd835('0x22')]({'where':{'ChanSpyId':_0x568d02['id']}})[_0xd835('0x1c')](function(){_0x46eb3c();})['catch'](function(_0x587f2a){_0x46eb3c(_0x587f2a);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 26f6c37..211c878 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 _0x9976=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent'];(function(_0x1ba4d1,_0x54fd0e){var _0x29a4a5=function(_0x15c9b8){while(--_0x15c9b8){_0x1ba4d1['push'](_0x1ba4d1['shift']());}};_0x29a4a5(++_0x54fd0e);}(_0x9976,0x1d4));var _0x6997=function(_0x2d04b3,_0x3b65e2){_0x2d04b3=_0x2d04b3-0x0;var _0x5a10aa=_0x9976[_0x2d04b3];return _0x5a10aa;};'use strict';var _=require(_0x6997('0x0'));var util=require(_0x6997('0x1'));var moment=require(_0x6997('0x2'));var BPromise=require(_0x6997('0x3'));var rs=require(_0x6997('0x4'));var fs=require('fs');var Redis=require(_0x6997('0x5'));var db=require(_0x6997('0x6'))['db'];var utils=require(_0x6997('0x7'));var logger=require(_0x6997('0x8'))(_0x6997('0x9'));var config=require('../../config/environment');var jayson=require(_0x6997('0xa'));var client=jayson['client'][_0x6997('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5311b3,_0x507adb,_0x2ee664){return new BPromise(function(_0x148c69,_0x1efb94){return client[_0x6997('0xc')](_0x5311b3,_0x2ee664)[_0x6997('0xd')](function(_0x144f6f){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x507adb,_0x6997('0xe'));logger[_0x6997('0xf')](_0x6997('0x10'),_0x507adb,'request\x20sent',JSON['stringify'](_0x144f6f));if(_0x144f6f['error']){if(_0x144f6f[_0x6997('0x11')][_0x6997('0x12')]===0x1f4){logger[_0x6997('0x11')](_0x6997('0x13'),_0x507adb,_0x144f6f[_0x6997('0x11')][_0x6997('0x14')]);return _0x1efb94(_0x144f6f[_0x6997('0x11')]['message']);}logger[_0x6997('0x11')](_0x6997('0x13'),_0x507adb,_0x144f6f['error'][_0x6997('0x14')]);return _0x148c69(_0x144f6f[_0x6997('0x11')][_0x6997('0x14')]);}else{logger[_0x6997('0x15')](_0x6997('0x13'),_0x507adb,'request\x20sent');_0x148c69(_0x144f6f['result'][_0x6997('0x14')]);}})[_0x6997('0x16')](function(_0x252860){logger[_0x6997('0x11')](_0x6997('0x13'),_0x507adb,_0x252860);_0x1efb94(_0x252860);});});} \ No newline at end of file +var _0x1cd2=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x475416,_0x3e2685){var _0x5da334=function(_0x26270a){while(--_0x26270a){_0x475416['push'](_0x475416['shift']());}};_0x5da334(++_0x3e2685);}(_0x1cd2,0x11f));var _0x21cd=function(_0xfac678,_0x1fb4c9){_0xfac678=_0xfac678-0x0;var _0xb5700f=_0x1cd2[_0xfac678];return _0xb5700f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x21cd('0x0'));var BPromise=require(_0x21cd('0x1'));var rs=require(_0x21cd('0x2'));var fs=require('fs');var Redis=require(_0x21cd('0x3'));var db=require(_0x21cd('0x4'))['db'];var utils=require(_0x21cd('0x5'));var logger=require(_0x21cd('0x6'))(_0x21cd('0x7'));var config=require('../../config/environment');var jayson=require(_0x21cd('0x8'));var client=jayson[_0x21cd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xadc0a8,_0x1a250b,_0x4e89a0){return new BPromise(function(_0x1021dc,_0x3ebfb7){return client[_0x21cd('0xa')](_0xadc0a8,_0x4e89a0)[_0x21cd('0xb')](function(_0x1703ed){logger[_0x21cd('0xc')](_0x21cd('0xd'),_0x1a250b,_0x21cd('0xe'));logger[_0x21cd('0xf')](_0x21cd('0x10'),_0x1a250b,'request\x20sent',JSON[_0x21cd('0x11')](_0x1703ed));if(_0x1703ed[_0x21cd('0x12')]){if(_0x1703ed[_0x21cd('0x12')]['code']===0x1f4){logger[_0x21cd('0x12')](_0x21cd('0xd'),_0x1a250b,_0x1703ed['error'][_0x21cd('0x13')]);return _0x3ebfb7(_0x1703ed[_0x21cd('0x12')]['message']);}logger['error'](_0x21cd('0xd'),_0x1a250b,_0x1703ed[_0x21cd('0x12')][_0x21cd('0x13')]);return _0x1021dc(_0x1703ed['error'][_0x21cd('0x13')]);}else{logger[_0x21cd('0xc')](_0x21cd('0xd'),_0x1a250b,_0x21cd('0xe'));_0x1021dc(_0x1703ed[_0x21cd('0x14')][_0x21cd('0x13')]);}})[_0x21cd('0x15')](function(_0xe651a6){logger[_0x21cd('0x12')](_0x21cd('0xd'),_0x1a250b,_0xe651a6);_0x3ebfb7(_0xe651a6);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 8480f47..45d0ff3 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 _0x84c3=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x84c3,0x17e));var _0x384c=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x84c3[_0x1ae5ab];return _0x1ce001;};'use strict';var multer=require('multer');var util=require(_0x384c('0x0'));var path=require(_0x384c('0x1'));var timeout=require(_0x384c('0x2'));var express=require(_0x384c('0x3'));var router=express['Router']();var auth=require(_0x384c('0x4'));var interaction=require(_0x384c('0x5'));var config=require(_0x384c('0x6'));var controller=require(_0x384c('0x7'));router[_0x384c('0x8')]('/',auth['isAuthenticated'](),controller[_0x384c('0x9')]);router[_0x384c('0x8')]('/:id',auth[_0x384c('0xa')](),controller[_0x384c('0xb')]);router[_0x384c('0xc')]('/',auth[_0x384c('0xa')](),controller[_0x384c('0xd')]);router[_0x384c('0xe')]('/:id',auth[_0x384c('0xa')](),controller[_0x384c('0xf')]);router[_0x384c('0x10')](_0x384c('0x11'),auth[_0x384c('0xa')](),controller[_0x384c('0x12')]);module[_0x384c('0x13')]=router; \ No newline at end of file +var _0xf1cb=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get'];(function(_0xad1f95,_0x25c26f){var _0x18540f=function(_0xa8e727){while(--_0xa8e727){_0xad1f95['push'](_0xad1f95['shift']());}};_0x18540f(++_0x25c26f);}(_0xf1cb,0xd6));var _0xbf1c=function(_0x160648,_0x1ca02d){_0x160648=_0x160648-0x0;var _0x5266c6=_0xf1cb[_0x160648];return _0x5266c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf1c('0x0'));var timeout=require('connect-timeout');var express=require(_0xbf1c('0x1'));var router=express[_0xbf1c('0x2')]();var auth=require(_0xbf1c('0x3'));var interaction=require(_0xbf1c('0x4'));var config=require('../../config/environment');var controller=require(_0xbf1c('0x5'));router[_0xbf1c('0x6')]('/',auth[_0xbf1c('0x7')](),controller[_0xbf1c('0x8')]);router[_0xbf1c('0x6')](_0xbf1c('0x9'),auth['isAuthenticated'](),controller[_0xbf1c('0xa')]);router[_0xbf1c('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf1c('0xc')](_0xbf1c('0x9'),auth[_0xbf1c('0x7')](),controller[_0xbf1c('0xd')]);router[_0xbf1c('0xe')](_0xbf1c('0x9'),auth['isAuthenticated'](),controller[_0xbf1c('0xf')]);module[_0xbf1c('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index dfafb1d..fbe497a 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 _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x4344e5,_0x1f17c6){var _0x5332ea=function(_0x486d6e){while(--_0x486d6e){_0x4344e5['push'](_0x4344e5['shift']());}};_0x5332ea(++_0x1f17c6);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e74=['name','sequelize','STRING'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0x3e74,0x175));var _0x43e7=function(_0x572c8d,_0x34b491){_0x572c8d=_0x572c8d-0x0;var _0x5c8517=_0x3e74[_0x572c8d];return _0x5c8517;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 445e276..c2554f1 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 _0x882e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Contexts','UserProfileResource','stack','name','map','VoiceContext','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','Reload','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x168358,_0x3f253e){var _0x52c54c=function(_0x433d4a){while(--_0x433d4a){_0x168358['push'](_0x168358['shift']());}};_0x52c54c(++_0x3f253e);}(_0x882e,0xbd));var _0xe882=function(_0x51d72b,_0x510850){_0x51d72b=_0x51d72b-0x0;var _0x4a9407=_0x882e[_0x51d72b];return _0x4a9407;};'use strict';var pdf=require(_0xe882('0x0'));var emlformat=require(_0xe882('0x1'));var rimraf=require(_0xe882('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe882('0x3'));var rp=require(_0xe882('0x4'));var moment=require('moment');var BPromise=require(_0xe882('0x5'));var Mustache=require(_0xe882('0x6'));var util=require(_0xe882('0x7'));var path=require(_0xe882('0x8'));var sox=require(_0xe882('0x9'));var csv=require(_0xe882('0xa'));var ejs=require(_0xe882('0xb'));var fs=require('fs');var _=require(_0xe882('0xc'));var squel=require(_0xe882('0xd'));var crypto=require(_0xe882('0xe'));var jsforce=require(_0xe882('0xf'));var deskjs=require(_0xe882('0x10'));var toCsv=require(_0xe882('0xa'));var querystring=require(_0xe882('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe882('0x12'));var qs=require(_0xe882('0x13'));var as=require(_0xe882('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe882('0x15'))(_0xe882('0x16'));var utils=require('../../config/utils');var config=require(_0xe882('0x17'));var db=require(_0xe882('0x18'))['db'];var jayson=require(_0xe882('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x58870d,_0x54e566,_0x5224b0){if(_0x5224b0){var _0x3ed4bc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ed4bc[_0xe882('0x1a')](_0x54e566)){return _0x58870d;}else{throw new db[(_0xe882('0x1b'))]['ValidationError'](_0xe882('0x1c'));}}else{return _0x58870d;}}function respondWithRpcPromise(_0x21dd91,_0x270a44,_0x31ae40,_0x4a943e){return new BPromise(function(_0x1cc1aa,_0x76018a){var _0x2c082f=_0x4a943e||client;return _0x2c082f[_0xe882('0x1d')](_0x21dd91,_0x31ae40)['then'](function(_0x405477){logger[_0xe882('0x1e')](_0xe882('0x1f'),_0x270a44,_0xe882('0x20'));logger[_0xe882('0x21')](_0xe882('0x22'),_0x270a44,'request\x20sent',JSON['stringify'](_0x405477));if(_0x405477[_0xe882('0x23')]){if(_0x405477[_0xe882('0x23')]['code']===0x1f4){logger['error'](_0xe882('0x1f'),_0x270a44,_0x405477[_0xe882('0x23')][_0xe882('0x24')]);return _0x76018a(_0x405477['error'][_0xe882('0x24')]);}logger[_0xe882('0x23')](_0xe882('0x1f'),_0x270a44,_0x405477[_0xe882('0x23')]['message']);return _0x1cc1aa(_0x405477[_0xe882('0x23')][_0xe882('0x24')]);}else{logger[_0xe882('0x1e')](_0xe882('0x1f'),_0x270a44,_0xe882('0x20'));_0x1cc1aa(_0x405477[_0xe882('0x25')]['message']);}})[_0xe882('0x26')](function(_0x33dde7){logger[_0xe882('0x23')](_0xe882('0x1f'),_0x270a44,_0x33dde7);_0x76018a(_0x33dde7);});});}function respondWithStatusCode(_0x50d172,_0x5c9cdb){_0x5c9cdb=_0x5c9cdb||0xcc;return function(_0x593188){if(_0x593188){return _0x50d172[_0xe882('0x27')](_0x5c9cdb);}return _0x50d172['status'](_0x5c9cdb)[_0xe882('0x28')]();};}function respondWithResult(_0xf81f56,_0x367e14){_0x367e14=_0x367e14||0xc8;return function(_0x1c3485){if(_0x1c3485){return _0xf81f56[_0xe882('0x29')](_0x367e14)[_0xe882('0x2a')](_0x1c3485);}};}function respondWithFilteredResult(_0x442d78,_0x246073){return function(_0x4770c8){if(_0x4770c8){var _0x32bd1f=_0x4770c8[_0xe882('0x2b')],_0x4546eb=_0x246073['offset'],_0x19dc12=_0x246073[_0xe882('0x2c')]+_0x246073[_0xe882('0x2d')],_0x208d96;if(_0x19dc12>=_0x32bd1f){_0x19dc12=_0x32bd1f;_0x208d96=0xc8;}else{_0x208d96=0xce;}_0x442d78[_0xe882('0x29')](_0x208d96);return _0x442d78[_0xe882('0x2e')](_0xe882('0x2f'),_0x4546eb+'-'+_0x19dc12+'/'+_0x32bd1f)[_0xe882('0x2a')](_0x4770c8);}return null;};}function patchUpdates(_0x2254cf){return function(_0x125e2e){try{jsonpatch[_0xe882('0x30')](_0x125e2e,_0x2254cf,!![]);}catch(_0x3f5be7){return BPromise['reject'](_0x3f5be7);}return _0x125e2e[_0xe882('0x31')]();};}function saveUpdates(_0x5a1ab0,_0x1cdf1b){return function(_0x2b9ec2){if(_0x2b9ec2){return _0x2b9ec2[_0xe882('0x32')](_0x5a1ab0)[_0xe882('0x33')](function(_0x460864){return _0x460864;});}return null;};}function removeEntity(_0x2d5aca,_0x168469){return function(_0x2e6c0d){if(_0x2e6c0d){return _0x2e6c0d[_0xe882('0x34')]()['then'](function(){var _0x3dc0ee=_0x2e6c0d[_0xe882('0x35')]({'plain':!![]});var _0x22b263=_0xe882('0x36');return db[_0xe882('0x37')][_0xe882('0x34')]({'where':{'type':_0x22b263,'resourceId':_0x3dc0ee['id']}})['then'](function(){return _0x2e6c0d;});})[_0xe882('0x33')](function(){_0x2d5aca['status'](0xcc)[_0xe882('0x28')]();});}};}function handleEntityNotFound(_0x4676a0,_0x4fa60d){return function(_0xcdde93){if(!_0xcdde93){_0x4676a0[_0xe882('0x27')](0x194);}return _0xcdde93;};}function handleError(_0x20d4cc,_0xb45ff4){_0xb45ff4=_0xb45ff4||0x1f4;return function(_0x12289d){logger[_0xe882('0x23')](_0x12289d[_0xe882('0x38')]);if(_0x12289d[_0xe882('0x39')]){delete _0x12289d[_0xe882('0x39')];}_0x20d4cc[_0xe882('0x29')](_0xb45ff4)['send'](_0x12289d);};}exports['index']=function(_0x1e3c16,_0x3be372){var _0x23dc31={},_0x37a984={},_0x2874a1={'count':0x0,'rows':[]};var _0x5ef402=_[_0xe882('0x3a')](db[_0xe882('0x3b')][_0xe882('0x3c')],function(_0x239143){return{'name':_0x239143[_0xe882('0x3d')],'type':_0x239143[_0xe882('0x3e')][_0xe882('0x3f')]};});_0x37a984['model']=_[_0xe882('0x3a')](_0x5ef402,_0xe882('0x39'));_0x37a984[_0xe882('0x40')]=_[_0xe882('0x41')](_0x1e3c16['query']);_0x37a984[_0xe882('0x42')]=_[_0xe882('0x43')](_0x37a984[_0xe882('0x44')],_0x37a984[_0xe882('0x40')]);_0x23dc31[_0xe882('0x45')]=_[_0xe882('0x43')](_0x37a984[_0xe882('0x44')],qs[_0xe882('0x46')](_0x1e3c16['query']['fields']));_0x23dc31[_0xe882('0x45')]=_0x23dc31[_0xe882('0x45')][_0xe882('0x47')]?_0x23dc31[_0xe882('0x45')]:_0x37a984[_0xe882('0x44')];if(!_0x1e3c16[_0xe882('0x40')]['hasOwnProperty'](_0xe882('0x48'))){_0x23dc31[_0xe882('0x2d')]=qs[_0xe882('0x2d')](_0x1e3c16[_0xe882('0x40')][_0xe882('0x2d')]);_0x23dc31[_0xe882('0x2c')]=qs[_0xe882('0x2c')](_0x1e3c16['query'][_0xe882('0x2c')]);}_0x23dc31['order']=qs[_0xe882('0x49')](_0x1e3c16[_0xe882('0x40')][_0xe882('0x49')]);_0x23dc31[_0xe882('0x4a')]=qs[_0xe882('0x42')](_[_0xe882('0x4b')](_0x1e3c16[_0xe882('0x40')],_0x37a984[_0xe882('0x42')]));if(_0x1e3c16[_0xe882('0x40')][_0xe882('0x4c')]){_0x23dc31['where']=_['merge'](_0x23dc31['where'],{'$or':_['map'](_0x5ef402,function(_0xcb373e){if(_0xcb373e[_0xe882('0x3e')]!=='VIRTUAL'){var _0x23d3e7={};_0x23d3e7[_0xcb373e[_0xe882('0x39')]]={'$like':'%'+_0x1e3c16[_0xe882('0x40')]['filter']+'%'};return _0x23d3e7;}})});}_0x23dc31=_[_0xe882('0x4d')]({},_0x23dc31,_0x1e3c16[_0xe882('0x4e')]);var _0x4f1033={'where':_0x23dc31[_0xe882('0x4a')]};return db[_0xe882('0x3b')][_0xe882('0x2b')](_0x4f1033)[_0xe882('0x33')](function(_0x146e8e){_0x2874a1[_0xe882('0x2b')]=_0x146e8e;if(_0x1e3c16[_0xe882('0x40')][_0xe882('0x4f')]){_0x23dc31[_0xe882('0x50')]=[{'all':!![]}];}return db[_0xe882('0x3b')][_0xe882('0x51')](_0x23dc31);})[_0xe882('0x33')](function(_0x43edab){_0x2874a1[_0xe882('0x52')]=_0x43edab;return _0x2874a1;})[_0xe882('0x33')](respondWithFilteredResult(_0x3be372,_0x23dc31))[_0xe882('0x26')](handleError(_0x3be372,null));};exports[_0xe882('0x53')]=function(_0x4f32a,_0x35aa8f){var _0x1334f8={'raw':![],'where':{'id':_0x4f32a[_0xe882('0x54')]['id']}},_0x4db420={};_0x4db420[_0xe882('0x44')]=_[_0xe882('0x41')](db[_0xe882('0x3b')]['rawAttributes']);_0x4db420[_0xe882('0x40')]=_['keys'](_0x4f32a['query']);_0x4db420[_0xe882('0x42')]=_[_0xe882('0x43')](_0x4db420[_0xe882('0x44')],_0x4db420[_0xe882('0x40')]);_0x1334f8[_0xe882('0x45')]=_[_0xe882('0x43')](_0x4db420['model'],qs[_0xe882('0x46')](_0x4f32a[_0xe882('0x40')][_0xe882('0x46')]));_0x1334f8[_0xe882('0x45')]=_0x1334f8[_0xe882('0x45')]['length']?_0x1334f8['attributes']:_0x4db420['model'];if(_0x4f32a[_0xe882('0x40')][_0xe882('0x4f')]){_0x1334f8['include']=[{'all':!![]}];}_0x1334f8=_[_0xe882('0x4d')]({},_0x1334f8,_0x4f32a[_0xe882('0x4e')]);return db[_0xe882('0x3b')][_0xe882('0x55')](_0x1334f8)[_0xe882('0x33')](handleEntityNotFound(_0x35aa8f,null))[_0xe882('0x33')](respondWithResult(_0x35aa8f,null))[_0xe882('0x26')](handleError(_0x35aa8f,null));};exports[_0xe882('0x56')]=function(_0x431649,_0x1b4100,_0xe06ebb){var _0x4bab42;return db['VoiceContext'][_0xe882('0x56')](_0x431649[_0xe882('0x57')],{'raw':!![]})[_0xe882('0x33')](function(_0x5d5c62){_0x4bab42=_0x5d5c62;return db['VoiceContext'][_0xe882('0x51')]({'raw':!![]});})[_0xe882('0x33')](function(_0x22cfdf){var _0x45270a=fs['readFileSync'](path['join'](config[_0xe882('0x58')],_0xe882('0x59')),_0xe882('0x5a'));var _0x95ac47=ejs[_0xe882('0x5b')](_0x45270a,{'contexts':_0x22cfdf||[]});fs[_0xe882('0x5c')](_0xe882('0x5d'),_0x95ac47);})[_0xe882('0x33')](function(){return respondWithRpcPromise('Reload',_0xe882('0x56'),{'module':_0xe882('0x5e')});})[_0xe882('0x33')](function(){var _0x281386=_0x431649[_0xe882('0x5f')][_0xe882('0x35')]({'plain':!![]});if(!_0x281386)throw new Error(_0xe882('0x60'));if(_0x281386[_0xe882('0x61')]===_0xe882('0x5f')){var _0x4eda0f=_0x4bab42[_0xe882('0x35')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe882('0x36'),'userProfileId':_0x281386[_0xe882('0x62')]},'raw':!![]})[_0xe882('0x33')](function(_0x55cd69){if(_0x55cd69&&_0x55cd69[_0xe882('0x63')]===0x0){return db[_0xe882('0x37')][_0xe882('0x56')]({'name':_0x4eda0f[_0xe882('0x39')],'resourceId':_0x4eda0f['id'],'type':_0x55cd69['name'],'sectionId':_0x55cd69['id']},{})[_0xe882('0x33')](function(){return _0x4bab42;});}else{return _0x4bab42;}})[_0xe882('0x26')](function(_0x402b70){logger[_0xe882('0x23')](_0xe882('0x64'),_0x402b70);throw _0x402b70;});}return _0x4bab42;})['then'](respondWithResult(_0x1b4100,0xc9))['catch'](handleError(_0x1b4100,null));};exports['update']=function(_0x2a41d1,_0xfd6b9d,_0x48ab7c){var _0x175f4d;return db[_0xe882('0x3b')][_0xe882('0x55')]({'where':{'id':_0x2a41d1['params']['id']}})['then'](handleEntityNotFound(_0xfd6b9d,null))[_0xe882('0x33')](saveUpdates(_0x2a41d1[_0xe882('0x57')],null))[_0xe882('0x33')](function(_0x4f81da){if(_0x4f81da){_0x175f4d=_0x4f81da;return db[_0xe882('0x3b')]['findAll']({'raw':!![]});}})[_0xe882('0x33')](function(_0x2313cd){var _0x3c9d9f=fs[_0xe882('0x65')](path[_0xe882('0x66')](config[_0xe882('0x58')],_0xe882('0x59')),_0xe882('0x5a'));var _0x4327d4=ejs[_0xe882('0x5b')](_0x3c9d9f,{'contexts':_0x2313cd||[]});fs[_0xe882('0x5c')](_0xe882('0x5d'),_0x4327d4);})[_0xe882('0x33')](function(){return respondWithRpcPromise(_0xe882('0x67'),_0xe882('0x32'),{'module':_0xe882('0x5e')});})[_0xe882('0x33')](function(){return _0x175f4d;})[_0xe882('0x33')](respondWithResult(_0xfd6b9d,null))['catch'](handleError(_0xfd6b9d,null));};exports[_0xe882('0x34')]=function(_0x6b3cc0,_0x35d549,_0x4a6d99){var _0x2a6f0b;return db[_0xe882('0x3b')][_0xe882('0x55')]({'where':{'id':_0x6b3cc0[_0xe882('0x54')]['id']}})[_0xe882('0x33')](handleEntityNotFound(_0x35d549,null))[_0xe882('0x33')](removeEntity(_0x35d549,null))[_0xe882('0x33')](function(){return db[_0xe882('0x3b')][_0xe882('0x51')]({'raw':!![]});})[_0xe882('0x33')](function(_0xaeeed6){var _0x1f42b9=fs[_0xe882('0x65')](path['join'](config[_0xe882('0x58')],_0xe882('0x59')),_0xe882('0x5a'));var _0x3768b9=ejs[_0xe882('0x5b')](_0x1f42b9,{'contexts':_0xaeeed6});fs['writeFileSync'](_0xe882('0x5d'),_0x3768b9);return respondWithRpcPromise(_0xe882('0x67'),_0xe882('0x34'),{'module':_0xe882('0x5e')});})['catch'](handleError(_0x35d549,null));}; \ No newline at end of file +var _0xf0a6=['where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','rawAttributes','includeAll','include','create','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','UserProfileResource','body','readFileSync','root','writeFileSync','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','Contexts','stack','name','send','index','VoiceContext','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf0a6,0x157));var _0x6f0a=function(_0x3e9af0,_0xb82e07){_0x3e9af0=_0x3e9af0-0x0;var _0x243da8=_0xf0a6[_0x3e9af0];return _0x243da8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6f0a('0x0'));var rimraf=require(_0x6f0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f0a('0x2'));var rp=require(_0x6f0a('0x3'));var moment=require(_0x6f0a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6f0a('0x5'));var path=require(_0x6f0a('0x6'));var sox=require(_0x6f0a('0x7'));var csv=require(_0x6f0a('0x8'));var ejs=require(_0x6f0a('0x9'));var fs=require('fs');var _=require(_0x6f0a('0xa'));var squel=require(_0x6f0a('0xb'));var crypto=require(_0x6f0a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6f0a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6f0a('0xe'));var Papa=require(_0x6f0a('0xf'));var Redis=require(_0x6f0a('0x10'));var authService=require(_0x6f0a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6f0a('0x12'));var hardwareService=require(_0x6f0a('0x13'));var logger=require('../../config/logger')(_0x6f0a('0x14'));var utils=require(_0x6f0a('0x15'));var config=require(_0x6f0a('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6f0a('0x17'));var client=jayson[_0x6f0a('0x18')][_0x6f0a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1d3bbb,_0x5350b4,_0x2d710c){if(_0x2d710c){var _0x438736=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x438736[_0x6f0a('0x1a')](_0x5350b4)){return _0x1d3bbb;}else{throw new db['Sequelize'][(_0x6f0a('0x1b'))](_0x6f0a('0x1c'));}}else{return _0x1d3bbb;}}function respondWithRpcPromise(_0x268ce6,_0x582bb4,_0x332e66,_0x116f7b){return new BPromise(function(_0x479230,_0x326142){var _0x194fdd=_0x116f7b||client;return _0x194fdd[_0x6f0a('0x1d')](_0x268ce6,_0x332e66)[_0x6f0a('0x1e')](function(_0x573024){logger[_0x6f0a('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x582bb4,_0x6f0a('0x20'));logger[_0x6f0a('0x21')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x582bb4,_0x6f0a('0x20'),JSON[_0x6f0a('0x22')](_0x573024));if(_0x573024[_0x6f0a('0x23')]){if(_0x573024['error'][_0x6f0a('0x24')]===0x1f4){logger[_0x6f0a('0x23')](_0x6f0a('0x25'),_0x582bb4,_0x573024['error'][_0x6f0a('0x26')]);return _0x326142(_0x573024[_0x6f0a('0x23')][_0x6f0a('0x26')]);}logger['error'](_0x6f0a('0x25'),_0x582bb4,_0x573024['error']['message']);return _0x479230(_0x573024[_0x6f0a('0x23')]['message']);}else{logger['info'](_0x6f0a('0x25'),_0x582bb4,'request\x20sent');_0x479230(_0x573024[_0x6f0a('0x27')][_0x6f0a('0x26')]);}})['catch'](function(_0x4eee4d){logger[_0x6f0a('0x23')]('VoiceContext,\x20%s,\x20%s',_0x582bb4,_0x4eee4d);_0x326142(_0x4eee4d);});});}function respondWithStatusCode(_0x569dc5,_0x34d9e4){_0x34d9e4=_0x34d9e4||0xcc;return function(_0x13a5ba){if(_0x13a5ba){return _0x569dc5[_0x6f0a('0x28')](_0x34d9e4);}return _0x569dc5['status'](_0x34d9e4)[_0x6f0a('0x29')]();};}function respondWithResult(_0x4fd99,_0x3ae934){_0x3ae934=_0x3ae934||0xc8;return function(_0x444ed7){if(_0x444ed7){return _0x4fd99[_0x6f0a('0x2a')](_0x3ae934)[_0x6f0a('0x2b')](_0x444ed7);}};}function respondWithFilteredResult(_0x2db120,_0x59c2c8){return function(_0x575607){if(_0x575607){var _0x132e60=_0x575607[_0x6f0a('0x2c')],_0xfeb41a=_0x59c2c8[_0x6f0a('0x2d')],_0xc771c8=_0x59c2c8[_0x6f0a('0x2d')]+_0x59c2c8[_0x6f0a('0x2e')],_0x4ad5fc;if(_0xc771c8>=_0x132e60){_0xc771c8=_0x132e60;_0x4ad5fc=0xc8;}else{_0x4ad5fc=0xce;}_0x2db120[_0x6f0a('0x2a')](_0x4ad5fc);return _0x2db120[_0x6f0a('0x2f')](_0x6f0a('0x30'),_0xfeb41a+'-'+_0xc771c8+'/'+_0x132e60)[_0x6f0a('0x2b')](_0x575607);}return null;};}function patchUpdates(_0x1f3612){return function(_0x4e3f18){try{jsonpatch[_0x6f0a('0x31')](_0x4e3f18,_0x1f3612,!![]);}catch(_0x1e39be){return BPromise['reject'](_0x1e39be);}return _0x4e3f18[_0x6f0a('0x32')]();};}function saveUpdates(_0x2fab8c,_0x5b1a98){return function(_0x3f841c){if(_0x3f841c){return _0x3f841c[_0x6f0a('0x33')](_0x2fab8c)[_0x6f0a('0x1e')](function(_0x2b8f19){return _0x2b8f19;});}return null;};}function removeEntity(_0x3af185,_0x5580cd){return function(_0x3b4ac2){if(_0x3b4ac2){return _0x3b4ac2[_0x6f0a('0x34')]()['then'](function(){var _0x1ca0ea=_0x3b4ac2['get']({'plain':!![]});var _0x403721=_0x6f0a('0x35');return db['UserProfileResource'][_0x6f0a('0x34')]({'where':{'type':_0x403721,'resourceId':_0x1ca0ea['id']}})['then'](function(){return _0x3b4ac2;});})['then'](function(){_0x3af185[_0x6f0a('0x2a')](0xcc)[_0x6f0a('0x29')]();});}};}function handleEntityNotFound(_0x4f51fd,_0x27ac62){return function(_0x31648c){if(!_0x31648c){_0x4f51fd[_0x6f0a('0x28')](0x194);}return _0x31648c;};}function handleError(_0x3299db,_0x46bc00){_0x46bc00=_0x46bc00||0x1f4;return function(_0x51dfe3){logger[_0x6f0a('0x23')](_0x51dfe3[_0x6f0a('0x36')]);if(_0x51dfe3[_0x6f0a('0x37')]){delete _0x51dfe3['name'];}_0x3299db[_0x6f0a('0x2a')](_0x46bc00)[_0x6f0a('0x38')](_0x51dfe3);};}exports[_0x6f0a('0x39')]=function(_0x3524f6,_0x8ec16c){var _0x4b5263={},_0x145261={},_0x15efd3={'count':0x0,'rows':[]};var _0x2a054a=_['map'](db[_0x6f0a('0x3a')]['rawAttributes'],function(_0x2d46c0){return{'name':_0x2d46c0['fieldName'],'type':_0x2d46c0[_0x6f0a('0x3b')][_0x6f0a('0x3c')]};});_0x145261[_0x6f0a('0x3d')]=_[_0x6f0a('0x3e')](_0x2a054a,_0x6f0a('0x37'));_0x145261[_0x6f0a('0x3f')]=_[_0x6f0a('0x40')](_0x3524f6['query']);_0x145261[_0x6f0a('0x41')]=_[_0x6f0a('0x42')](_0x145261['model'],_0x145261[_0x6f0a('0x3f')]);_0x4b5263[_0x6f0a('0x43')]=_[_0x6f0a('0x42')](_0x145261[_0x6f0a('0x3d')],qs[_0x6f0a('0x44')](_0x3524f6[_0x6f0a('0x3f')][_0x6f0a('0x44')]));_0x4b5263['attributes']=_0x4b5263[_0x6f0a('0x43')][_0x6f0a('0x45')]?_0x4b5263[_0x6f0a('0x43')]:_0x145261[_0x6f0a('0x3d')];if(!_0x3524f6[_0x6f0a('0x3f')][_0x6f0a('0x46')]('nolimit')){_0x4b5263[_0x6f0a('0x2e')]=qs[_0x6f0a('0x2e')](_0x3524f6[_0x6f0a('0x3f')]['limit']);_0x4b5263[_0x6f0a('0x2d')]=qs[_0x6f0a('0x2d')](_0x3524f6[_0x6f0a('0x3f')]['offset']);}_0x4b5263[_0x6f0a('0x47')]=qs['sort'](_0x3524f6['query'][_0x6f0a('0x48')]);_0x4b5263[_0x6f0a('0x49')]=qs[_0x6f0a('0x41')](_[_0x6f0a('0x4a')](_0x3524f6[_0x6f0a('0x3f')],_0x145261[_0x6f0a('0x41')]));if(_0x3524f6[_0x6f0a('0x3f')][_0x6f0a('0x4b')]){_0x4b5263[_0x6f0a('0x49')]=_[_0x6f0a('0x4c')](_0x4b5263['where'],{'$or':_['map'](_0x2a054a,function(_0xd71167){if(_0xd71167[_0x6f0a('0x3b')]!==_0x6f0a('0x4d')){var _0x104a04={};_0x104a04[_0xd71167['name']]={'$like':'%'+_0x3524f6['query']['filter']+'%'};return _0x104a04;}})});}_0x4b5263=_['merge']({},_0x4b5263,_0x3524f6[_0x6f0a('0x4e')]);var _0x51e399={'where':_0x4b5263[_0x6f0a('0x49')]};return db[_0x6f0a('0x3a')][_0x6f0a('0x2c')](_0x51e399)[_0x6f0a('0x1e')](function(_0x2babe9){_0x15efd3[_0x6f0a('0x2c')]=_0x2babe9;if(_0x3524f6['query']['includeAll']){_0x4b5263['include']=[{'all':!![]}];}return db[_0x6f0a('0x3a')][_0x6f0a('0x4f')](_0x4b5263);})['then'](function(_0x10c769){_0x15efd3[_0x6f0a('0x50')]=_0x10c769;return _0x15efd3;})[_0x6f0a('0x1e')](respondWithFilteredResult(_0x8ec16c,_0x4b5263))[_0x6f0a('0x51')](handleError(_0x8ec16c,null));};exports['show']=function(_0x41f770,_0x13e5c6){var _0x1c62f7={'raw':![],'where':{'id':_0x41f770[_0x6f0a('0x52')]['id']}},_0x442872={};_0x442872[_0x6f0a('0x3d')]=_[_0x6f0a('0x40')](db[_0x6f0a('0x3a')][_0x6f0a('0x53')]);_0x442872[_0x6f0a('0x3f')]=_[_0x6f0a('0x40')](_0x41f770[_0x6f0a('0x3f')]);_0x442872[_0x6f0a('0x41')]=_['intersection'](_0x442872[_0x6f0a('0x3d')],_0x442872[_0x6f0a('0x3f')]);_0x1c62f7['attributes']=_[_0x6f0a('0x42')](_0x442872[_0x6f0a('0x3d')],qs[_0x6f0a('0x44')](_0x41f770[_0x6f0a('0x3f')][_0x6f0a('0x44')]));_0x1c62f7['attributes']=_0x1c62f7[_0x6f0a('0x43')][_0x6f0a('0x45')]?_0x1c62f7['attributes']:_0x442872[_0x6f0a('0x3d')];if(_0x41f770[_0x6f0a('0x3f')][_0x6f0a('0x54')]){_0x1c62f7[_0x6f0a('0x55')]=[{'all':!![]}];}_0x1c62f7=_['merge']({},_0x1c62f7,_0x41f770[_0x6f0a('0x4e')]);return db[_0x6f0a('0x3a')]['find'](_0x1c62f7)[_0x6f0a('0x1e')](handleEntityNotFound(_0x13e5c6,null))[_0x6f0a('0x1e')](respondWithResult(_0x13e5c6,null))[_0x6f0a('0x51')](handleError(_0x13e5c6,null));};exports[_0x6f0a('0x56')]=function(_0x513be4,_0x43c9c7,_0x4fc303){var _0x84a75e;return db[_0x6f0a('0x3a')][_0x6f0a('0x56')](_0x513be4['body'],{'raw':!![]})['then'](function(_0x51418e){_0x84a75e=_0x51418e;return db[_0x6f0a('0x3a')][_0x6f0a('0x4f')]({'raw':!![]});})[_0x6f0a('0x1e')](function(_0x3bfa96){var _0x44cd31=fs['readFileSync'](path[_0x6f0a('0x57')](config['root'],_0x6f0a('0x58')),_0x6f0a('0x59'));var _0x15ee11=ejs[_0x6f0a('0x5a')](_0x44cd31,{'contexts':_0x3bfa96||[]});fs['writeFileSync'](_0x6f0a('0x5b'),_0x15ee11);})[_0x6f0a('0x1e')](function(){return respondWithRpcPromise(_0x6f0a('0x5c'),_0x6f0a('0x56'),{'module':_0x6f0a('0x5d')});})[_0x6f0a('0x1e')](function(){var _0x1b5959=_0x513be4[_0x6f0a('0x5e')][_0x6f0a('0x5f')]({'plain':!![]});if(!_0x1b5959)throw new Error(_0x6f0a('0x60'));if(_0x1b5959[_0x6f0a('0x61')]==='user'){var _0x320874=_0x84a75e['get']({'plain':!![]});return db['UserProfileSection'][_0x6f0a('0x62')]({'where':{'name':'Contexts','userProfileId':_0x1b5959['userProfileId']},'raw':!![]})[_0x6f0a('0x1e')](function(_0x223a4b){if(_0x223a4b&&_0x223a4b['autoAssociation']===0x0){return db[_0x6f0a('0x63')]['create']({'name':_0x320874[_0x6f0a('0x37')],'resourceId':_0x320874['id'],'type':_0x223a4b['name'],'sectionId':_0x223a4b['id']},{})['then'](function(){return _0x84a75e;});}else{return _0x84a75e;}})[_0x6f0a('0x51')](function(_0x2f0379){logger[_0x6f0a('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f0379);throw _0x2f0379;});}return _0x84a75e;})[_0x6f0a('0x1e')](respondWithResult(_0x43c9c7,0xc9))[_0x6f0a('0x51')](handleError(_0x43c9c7,null));};exports[_0x6f0a('0x33')]=function(_0x186877,_0x1f0e70,_0x3bc3d1){var _0x3b963e;return db[_0x6f0a('0x3a')][_0x6f0a('0x62')]({'where':{'id':_0x186877[_0x6f0a('0x52')]['id']}})[_0x6f0a('0x1e')](handleEntityNotFound(_0x1f0e70,null))[_0x6f0a('0x1e')](saveUpdates(_0x186877[_0x6f0a('0x64')],null))[_0x6f0a('0x1e')](function(_0x2eca34){if(_0x2eca34){_0x3b963e=_0x2eca34;return db['VoiceContext'][_0x6f0a('0x4f')]({'raw':!![]});}})[_0x6f0a('0x1e')](function(_0x28c2a7){var _0x5dba17=fs[_0x6f0a('0x65')](path[_0x6f0a('0x57')](config[_0x6f0a('0x66')],_0x6f0a('0x58')),_0x6f0a('0x59'));var _0x24b392=ejs[_0x6f0a('0x5a')](_0x5dba17,{'contexts':_0x28c2a7||[]});fs[_0x6f0a('0x67')](_0x6f0a('0x5b'),_0x24b392);})[_0x6f0a('0x1e')](function(){return respondWithRpcPromise('Reload',_0x6f0a('0x33'),{'module':_0x6f0a('0x5d')});})[_0x6f0a('0x1e')](function(){return _0x3b963e;})[_0x6f0a('0x1e')](respondWithResult(_0x1f0e70,null))[_0x6f0a('0x51')](handleError(_0x1f0e70,null));};exports[_0x6f0a('0x34')]=function(_0x293b96,_0x3df287,_0x188ad6){var _0x579894;return db[_0x6f0a('0x3a')][_0x6f0a('0x62')]({'where':{'id':_0x293b96[_0x6f0a('0x52')]['id']}})[_0x6f0a('0x1e')](handleEntityNotFound(_0x3df287,null))[_0x6f0a('0x1e')](removeEntity(_0x3df287,null))[_0x6f0a('0x1e')](function(){return db[_0x6f0a('0x3a')][_0x6f0a('0x4f')]({'raw':!![]});})[_0x6f0a('0x1e')](function(_0xaca6c0){var _0x16a6fc=fs['readFileSync'](path[_0x6f0a('0x57')](config[_0x6f0a('0x66')],_0x6f0a('0x58')),_0x6f0a('0x59'));var _0x3d61f0=ejs['render'](_0x16a6fc,{'contexts':_0xaca6c0});fs[_0x6f0a('0x67')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3d61f0);return respondWithRpcPromise(_0x6f0a('0x5c'),_0x6f0a('0x34'),{'module':_0x6f0a('0x5d')});})[_0x6f0a('0x51')](handleError(_0x3df287,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index cd7a0a8..048a6e6 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 _0x9f13=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9f13,0x1ec));var _0x39f1=function(_0x5f2a76,_0x108286){_0x5f2a76=_0x5f2a76-0x0;var _0x4f625d=_0x9f13[_0x5f2a76];return _0x4f625d;};'use strict';var _=require(_0x39f1('0x0'));var util=require(_0x39f1('0x1'));var logger=require(_0x39f1('0x2'))(_0x39f1('0x3'));var moment=require(_0x39f1('0x4'));var BPromise=require('bluebird');var rp=require(_0x39f1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39f1('0x6'));var config=require(_0x39f1('0x7'));var attributes=require(_0x39f1('0x8'));module[_0x39f1('0x9')]=function(_0x183ad4,_0x3d33e7){return _0x183ad4['define'](_0x39f1('0xa'),attributes,{'tableName':_0x39f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab5a=['define','VoiceContext','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x29faa0,_0x592a85){var _0x56fc8b=function(_0xd878a3){while(--_0xd878a3){_0x29faa0['push'](_0x29faa0['shift']());}};_0x56fc8b(++_0x592a85);}(_0xab5a,0x11a));var _0xaab5=function(_0x4c1df2,_0x53e044){_0x4c1df2=_0x4c1df2-0x0;var _0xcee2f6=_0xab5a[_0x4c1df2];return _0xcee2f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xaab5('0x0'));var moment=require(_0xaab5('0x1'));var BPromise=require(_0xaab5('0x2'));var rp=require(_0xaab5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaab5('0x4'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0xaab5('0x5')]=function(_0x464284,_0x4812fe){return _0x464284[_0xaab5('0x6')](_0xaab5('0x7'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 91ba6f5..1acbc45 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 _0xf230=['../../config/environment','jayson/promise','client','http','request','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceContext,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf230,0x1f2));var _0x0f23=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf230[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x0f23('0x0'));var util=require(_0x0f23('0x1'));var moment=require('moment');var BPromise=require(_0x0f23('0x2'));var rs=require(_0x0f23('0x3'));var fs=require('fs');var Redis=require(_0x0f23('0x4'));var db=require(_0x0f23('0x5'))['db'];var utils=require(_0x0f23('0x6'));var logger=require(_0x0f23('0x7'))('rpc');var config=require(_0x0f23('0x8'));var jayson=require(_0x0f23('0x9'));var client=jayson[_0x0f23('0xa')][_0x0f23('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4774a6,_0x21db93,_0x29b284){return new BPromise(function(_0x16dc59,_0x4639ec){return client[_0x0f23('0xc')](_0x4774a6,_0x29b284)['then'](function(_0x502d57){logger[_0x0f23('0xd')]('VoiceContext,\x20%s,\x20%s',_0x21db93,'request\x20sent');logger[_0x0f23('0xe')](_0x0f23('0xf'),_0x21db93,_0x0f23('0x10'),JSON['stringify'](_0x502d57));if(_0x502d57[_0x0f23('0x11')]){if(_0x502d57[_0x0f23('0x11')][_0x0f23('0x12')]===0x1f4){logger['error'](_0x0f23('0x13'),_0x21db93,_0x502d57[_0x0f23('0x11')][_0x0f23('0x14')]);return _0x4639ec(_0x502d57['error'][_0x0f23('0x14')]);}logger[_0x0f23('0x11')](_0x0f23('0x13'),_0x21db93,_0x502d57[_0x0f23('0x11')]['message']);return _0x16dc59(_0x502d57[_0x0f23('0x11')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x21db93,_0x0f23('0x10'));_0x16dc59(_0x502d57['result'][_0x0f23('0x14')]);}})[_0x0f23('0x15')](function(_0x2a44d0){logger[_0x0f23('0x11')](_0x0f23('0x13'),_0x21db93,_0x2a44d0);_0x4639ec(_0x2a44d0);});});} \ No newline at end of file +var _0x4a83=['rpc','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x33385c,_0x13ac69){var _0x14e17e=function(_0x41dd24){while(--_0x41dd24){_0x33385c['push'](_0x33385c['shift']());}};_0x14e17e(++_0x13ac69);}(_0x4a83,0x125));var _0x34a8=function(_0x592a87,_0x152cb3){_0x592a87=_0x592a87-0x0;var _0x44ddc1=_0x4a83[_0x592a87];return _0x44ddc1;};'use strict';var _=require('lodash');var util=require(_0x34a8('0x0'));var moment=require(_0x34a8('0x1'));var BPromise=require(_0x34a8('0x2'));var rs=require(_0x34a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34a8('0x4'));var logger=require(_0x34a8('0x5'))(_0x34a8('0x6'));var config=require('../../config/environment');var jayson=require(_0x34a8('0x7'));var client=jayson[_0x34a8('0x8')][_0x34a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2405a6,_0x54950c,_0x47b304){return new BPromise(function(_0x4e4c99,_0x1cd500){return client[_0x34a8('0xa')](_0x2405a6,_0x47b304)[_0x34a8('0xb')](function(_0x124c2b){logger[_0x34a8('0xc')](_0x34a8('0xd'),_0x54950c,_0x34a8('0xe'));logger[_0x34a8('0xf')](_0x34a8('0x10'),_0x54950c,_0x34a8('0xe'),JSON[_0x34a8('0x11')](_0x124c2b));if(_0x124c2b[_0x34a8('0x12')]){if(_0x124c2b['error'][_0x34a8('0x13')]===0x1f4){logger[_0x34a8('0x12')]('VoiceContext,\x20%s,\x20%s',_0x54950c,_0x124c2b[_0x34a8('0x12')][_0x34a8('0x14')]);return _0x1cd500(_0x124c2b[_0x34a8('0x12')]['message']);}logger[_0x34a8('0x12')](_0x34a8('0xd'),_0x54950c,_0x124c2b['error'][_0x34a8('0x14')]);return _0x4e4c99(_0x124c2b[_0x34a8('0x12')][_0x34a8('0x14')]);}else{logger[_0x34a8('0xc')]('VoiceContext,\x20%s,\x20%s',_0x54950c,_0x34a8('0xe'));_0x4e4c99(_0x124c2b[_0x34a8('0x15')][_0x34a8('0x14')]);}})[_0x34a8('0x16')](function(_0x4b0113){logger[_0x34a8('0x12')](_0x34a8('0xd'),_0x54950c,_0x4b0113);_0x1cd500(_0x4b0113);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 1fc2dad..59924db 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 _0x2d8e=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','delete','destroy','multer'];(function(_0x52085f,_0x19bdce){var _0x5cd78c=function(_0x2ce4cb){while(--_0x2ce4cb){_0x52085f['push'](_0x52085f['shift']());}};_0x5cd78c(++_0x19bdce);}(_0x2d8e,0xb3));var _0xe2d8=function(_0x12eedd,_0x85f5){_0x12eedd=_0x12eedd-0x0;var _0x3c19aa=_0x2d8e[_0x12eedd];return _0x3c19aa;};'use strict';var multer=require(_0xe2d8('0x0'));var util=require(_0xe2d8('0x1'));var path=require(_0xe2d8('0x2'));var timeout=require(_0xe2d8('0x3'));var express=require(_0xe2d8('0x4'));var router=express['Router']();var auth=require(_0xe2d8('0x5'));var interaction=require(_0xe2d8('0x6'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0xe2d8('0x7')]('/',auth[_0xe2d8('0x8')](),controller[_0xe2d8('0x9')]);router[_0xe2d8('0x7')](_0xe2d8('0xa'),auth['isAuthenticated'](),controller[_0xe2d8('0xb')]);router['get']('/:id',auth[_0xe2d8('0x8')](),controller['show']);router[_0xe2d8('0xc')]('/',auth['isAuthenticated'](),controller[_0xe2d8('0xd')]);router[_0xe2d8('0xe')](_0xe2d8('0xf'),auth[_0xe2d8('0x8')](),controller['update']);router[_0xe2d8('0x10')](_0xe2d8('0xf'),auth[_0xe2d8('0x8')](),controller[_0xe2d8('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5ae0=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','create','put','update','destroy'];(function(_0x5c6ecc,_0x40e2d2){var _0x39a034=function(_0x57edc7){while(--_0x57edc7){_0x5c6ecc['push'](_0x5c6ecc['shift']());}};_0x39a034(++_0x40e2d2);}(_0x5ae0,0x1bb));var _0x05ae=function(_0x8bef97,_0x2a1f21){_0x8bef97=_0x8bef97-0x0;var _0x1d33c6=_0x5ae0[_0x8bef97];return _0x1d33c6;};'use strict';var multer=require(_0x05ae('0x0'));var util=require(_0x05ae('0x1'));var path=require('path');var timeout=require(_0x05ae('0x2'));var express=require(_0x05ae('0x3'));var router=express['Router']();var auth=require(_0x05ae('0x4'));var interaction=require(_0x05ae('0x5'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0x05ae('0x6')](),controller['index']);router[_0x05ae('0x7')](_0x05ae('0x8'),auth[_0x05ae('0x6')](),controller[_0x05ae('0x9')]);router['get'](_0x05ae('0xa'),auth[_0x05ae('0x6')](),controller[_0x05ae('0xb')]);router['post']('/',auth[_0x05ae('0x6')](),controller[_0x05ae('0xc')]);router[_0x05ae('0xd')]('/:id',auth[_0x05ae('0x6')](),controller[_0x05ae('0xe')]);router['delete'](_0x05ae('0xa'),auth[_0x05ae('0x6')](),controller[_0x05ae('0xf')]);module[_0x05ae('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 67175da..59b43e1 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 _0x96c4=['called,connect,complete','exports','STRING','INTEGER','DATE'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x96c4,0x1c3));var _0x496c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x96c4[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x496c('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x496c('0x1')]},'channelstate':{'type':Sequelize[_0x496c('0x2')]},'channelstatedesc':{'type':Sequelize[_0x496c('0x1')]},'calleridnum':{'type':Sequelize[_0x496c('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x496c('0x1')]},'connectedlinename':{'type':Sequelize[_0x496c('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x496c('0x1')]},'context':{'type':Sequelize[_0x496c('0x1')]},'exten':{'type':Sequelize[_0x496c('0x1')]},'priority':{'type':Sequelize[_0x496c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x496c('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x496c('0x1')]},'destcalleridname':{'type':Sequelize[_0x496c('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x496c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x496c('0x1')]},'destlanguage':{'type':Sequelize[_0x496c('0x1')]},'destaccountcode':{'type':Sequelize[_0x496c('0x1')]},'destcontext':{'type':Sequelize[_0x496c('0x1')]},'destexten':{'type':Sequelize[_0x496c('0x1')]},'destpriority':{'type':Sequelize[_0x496c('0x2')]},'destuniqueid':{'type':Sequelize[_0x496c('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x496c('0x1')]},'dialstatus':{'type':Sequelize[_0x496c('0x1')]},'starttime':{'type':Sequelize[_0x496c('0x3')]},'answertime':{'type':Sequelize[_0x496c('0x3')]},'endtime':{'type':Sequelize[_0x496c('0x3')]},'lastevent':{'type':Sequelize[_0x496c('0x1')],'comment':_0x496c('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x496c('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x496c('0x2')]}}; \ No newline at end of file +var _0x4192=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x2d03a9,_0x280544){var _0xb8cf50=function(_0xcba44d){while(--_0xcba44d){_0x2d03a9['push'](_0x2d03a9['shift']());}};_0xb8cf50(++_0x280544);}(_0x4192,0x195));var _0x2419=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0x4192[_0x11deef];return _0xe9ba85;};'use strict';var Sequelize=require(_0x2419('0x0'));module[_0x2419('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2419('0x2')]},'channelstate':{'type':Sequelize[_0x2419('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2419('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2419('0x2')]},'language':{'type':Sequelize[_0x2419('0x2')]},'accountcode':{'type':Sequelize[_0x2419('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2419('0x2')]},'priority':{'type':Sequelize[_0x2419('0x3')]},'uniqueid':{'type':Sequelize[_0x2419('0x2')]},'linkedid':{'type':Sequelize[_0x2419('0x2')]},'destchannel':{'type':Sequelize[_0x2419('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x2419('0x2')]},'destcalleridnum':{'type':Sequelize[_0x2419('0x2')]},'destcalleridname':{'type':Sequelize[_0x2419('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2419('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x2419('0x2')]},'destlanguage':{'type':Sequelize[_0x2419('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2419('0x3')]},'destuniqueid':{'type':Sequelize[_0x2419('0x2')]},'destlinkedid':{'type':Sequelize[_0x2419('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x2419('0x2')]},'starttime':{'type':Sequelize[_0x2419('0x4')]},'answertime':{'type':Sequelize[_0x2419('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':_0x2419('0x5')},'routeId':{'type':Sequelize[_0x2419('0x3')]},'duration':{'type':Sequelize[_0x2419('0x3')]},'holdtime':{'type':Sequelize[_0x2419('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index dc8880c..1d69d6d 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 _0x33b4=['limit','set','reject','save','update','then','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x33b4,0xc7));var _0x433b=function(_0x17f918,_0x1099a9){_0x17f918=_0x17f918-0x0;var _0x556249=_0x33b4[_0x17f918];return _0x556249;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x433b('0x0'));var rimraf=require(_0x433b('0x1'));var zipdir=require(_0x433b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x433b('0x3'));var moment=require(_0x433b('0x4'));var BPromise=require(_0x433b('0x5'));var Mustache=require(_0x433b('0x6'));var util=require(_0x433b('0x7'));var path=require(_0x433b('0x8'));var sox=require(_0x433b('0x9'));var csv=require(_0x433b('0xa'));var ejs=require(_0x433b('0xb'));var fs=require('fs');var _=require(_0x433b('0xc'));var squel=require(_0x433b('0xd'));var crypto=require(_0x433b('0xe'));var jsforce=require(_0x433b('0xf'));var deskjs=require(_0x433b('0x10'));var toCsv=require(_0x433b('0xa'));var querystring=require(_0x433b('0x11'));var Papa=require(_0x433b('0x12'));var Redis=require(_0x433b('0x13'));var authService=require(_0x433b('0x14'));var qs=require(_0x433b('0x15'));var as=require(_0x433b('0x16'));var hardwareService=require(_0x433b('0x17'));var logger=require(_0x433b('0x18'))(_0x433b('0x19'));var utils=require(_0x433b('0x1a'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fc0fa,_0x4a7076){_0x4a7076=_0x4a7076||0xcc;return function(_0x57346f){if(_0x57346f){return _0x2fc0fa[_0x433b('0x1b')](_0x4a7076);}return _0x2fc0fa['status'](_0x4a7076)[_0x433b('0x1c')]();};}function respondWithResult(_0x1c24ef,_0x2ccfda){_0x2ccfda=_0x2ccfda||0xc8;return function(_0x100362){if(_0x100362){return _0x1c24ef[_0x433b('0x1d')](_0x2ccfda)[_0x433b('0x1e')](_0x100362);}};}function respondWithFilteredResult(_0x213281,_0x5123c1){return function(_0x1d0b20){if(_0x1d0b20){var _0x6ee04e=_0x1d0b20[_0x433b('0x1f')],_0x88e542=_0x5123c1['offset'],_0x4bdb67=_0x5123c1['offset']+_0x5123c1[_0x433b('0x20')],_0x139f39;if(_0x4bdb67>=_0x6ee04e){_0x4bdb67=_0x6ee04e;_0x139f39=0xc8;}else{_0x139f39=0xce;}_0x213281[_0x433b('0x1d')](_0x139f39);return _0x213281[_0x433b('0x21')]('Content-Range',_0x88e542+'-'+_0x4bdb67+'/'+_0x6ee04e)[_0x433b('0x1e')](_0x1d0b20);}return null;};}function patchUpdates(_0x3f2188){return function(_0x5bd05d){try{jsonpatch['apply'](_0x5bd05d,_0x3f2188,!![]);}catch(_0x3201f2){return BPromise[_0x433b('0x22')](_0x3201f2);}return _0x5bd05d[_0x433b('0x23')]();};}function saveUpdates(_0x4cb1e9,_0x25445f){return function(_0xc9b6a6){if(_0xc9b6a6){return _0xc9b6a6[_0x433b('0x24')](_0x4cb1e9)[_0x433b('0x25')](function(_0x21ba03){return _0x21ba03;});}return null;};}function removeEntity(_0x2ddeb9,_0xe95b88){return function(_0x5b897d){if(_0x5b897d){return _0x5b897d['destroy']()['then'](function(){_0x2ddeb9[_0x433b('0x1d')](0xcc)[_0x433b('0x1c')]();});}};}function handleEntityNotFound(_0x5393d4,_0x5f0a4e){return function(_0x3e0803){if(!_0x3e0803){_0x5393d4[_0x433b('0x1b')](0x194);}return _0x3e0803;};}function handleError(_0x133ca5,_0x50a0a9){_0x50a0a9=_0x50a0a9||0x1f4;return function(_0x2f1a21){logger[_0x433b('0x26')](_0x2f1a21['stack']);if(_0x2f1a21[_0x433b('0x27')]){delete _0x2f1a21[_0x433b('0x27')];}_0x133ca5['status'](_0x50a0a9)[_0x433b('0x28')](_0x2f1a21);};}exports[_0x433b('0x29')]=function(_0x5b9b15,_0x7774c3){var _0x2ded49={},_0x54a467={},_0x2b0a99={'count':0x0,'rows':[]};var _0x320364=_[_0x433b('0x2a')](db[_0x433b('0x2b')][_0x433b('0x2c')],function(_0x4ed5dd){return{'name':_0x4ed5dd[_0x433b('0x2d')],'type':_0x4ed5dd[_0x433b('0x2e')][_0x433b('0x2f')]};});_0x54a467[_0x433b('0x30')]=_[_0x433b('0x2a')](_0x320364,_0x433b('0x27'));_0x54a467['query']=_[_0x433b('0x31')](_0x5b9b15[_0x433b('0x32')]);_0x54a467['filters']=_[_0x433b('0x33')](_0x54a467[_0x433b('0x30')],_0x54a467['query']);_0x2ded49[_0x433b('0x34')]=_[_0x433b('0x33')](_0x54a467[_0x433b('0x30')],qs[_0x433b('0x35')](_0x5b9b15['query'][_0x433b('0x35')]));_0x2ded49[_0x433b('0x34')]=_0x2ded49[_0x433b('0x34')][_0x433b('0x36')]?_0x2ded49[_0x433b('0x34')]:_0x54a467[_0x433b('0x30')];if(!_0x5b9b15[_0x433b('0x32')][_0x433b('0x37')](_0x433b('0x38'))){_0x2ded49[_0x433b('0x20')]=qs[_0x433b('0x20')](_0x5b9b15['query']['limit']);_0x2ded49[_0x433b('0x39')]=qs['offset'](_0x5b9b15[_0x433b('0x32')][_0x433b('0x39')]);}_0x2ded49[_0x433b('0x3a')]=qs[_0x433b('0x3b')](_0x5b9b15[_0x433b('0x32')][_0x433b('0x3b')]);_0x2ded49['where']=qs['filters'](_[_0x433b('0x3c')](_0x5b9b15[_0x433b('0x32')],_0x54a467[_0x433b('0x3d')]));if(_0x5b9b15['query'][_0x433b('0x3e')]){_0x2ded49[_0x433b('0x3f')]=_[_0x433b('0x40')](_0x2ded49['where'],{'$or':_['map'](_0x320364,function(_0xc1387){if(_0xc1387[_0x433b('0x2e')]!=='VIRTUAL'){var _0x5c3908={};_0x5c3908[_0xc1387[_0x433b('0x27')]]={'$like':'%'+_0x5b9b15[_0x433b('0x32')][_0x433b('0x3e')]+'%'};return _0x5c3908;}})});}_0x2ded49=_['merge']({},_0x2ded49,_0x5b9b15[_0x433b('0x41')]);var _0x105880={'where':_0x2ded49[_0x433b('0x3f')]};return db['VoiceDialReport'][_0x433b('0x1f')](_0x105880)[_0x433b('0x25')](function(_0x190268){_0x2b0a99[_0x433b('0x1f')]=_0x190268;if(_0x5b9b15[_0x433b('0x32')][_0x433b('0x42')]){_0x2ded49[_0x433b('0x43')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x433b('0x44')](_0x2ded49);})['then'](function(_0x2d9bea){_0x2b0a99[_0x433b('0x45')]=_0x2d9bea;return _0x2b0a99;})[_0x433b('0x25')](respondWithFilteredResult(_0x7774c3,_0x2ded49))[_0x433b('0x46')](handleError(_0x7774c3,null));};exports[_0x433b('0x47')]=function(_0x3978ab,_0x2eecaa){var _0x3c38eb={'raw':!![],'where':{'id':_0x3978ab[_0x433b('0x48')]['id']}},_0x11ef15={};_0x11ef15[_0x433b('0x30')]=_[_0x433b('0x31')](db['VoiceDialReport'][_0x433b('0x2c')]);_0x11ef15['query']=_[_0x433b('0x31')](_0x3978ab['query']);_0x11ef15[_0x433b('0x3d')]=_['intersection'](_0x11ef15['model'],_0x11ef15[_0x433b('0x32')]);_0x3c38eb[_0x433b('0x34')]=_[_0x433b('0x33')](_0x11ef15[_0x433b('0x30')],qs['fields'](_0x3978ab[_0x433b('0x32')][_0x433b('0x35')]));_0x3c38eb['attributes']=_0x3c38eb[_0x433b('0x34')][_0x433b('0x36')]?_0x3c38eb[_0x433b('0x34')]:_0x11ef15['model'];if(_0x3978ab[_0x433b('0x32')]['includeAll']){_0x3c38eb[_0x433b('0x43')]=[{'all':!![]}];}_0x3c38eb=_[_0x433b('0x40')]({},_0x3c38eb,_0x3978ab[_0x433b('0x41')]);return db[_0x433b('0x2b')][_0x433b('0x49')](_0x3c38eb)[_0x433b('0x25')](handleEntityNotFound(_0x2eecaa,null))[_0x433b('0x25')](respondWithResult(_0x2eecaa,null))[_0x433b('0x46')](handleError(_0x2eecaa,null));};exports['create']=function(_0x533b7a,_0x1cefa6){return db[_0x433b('0x2b')][_0x433b('0x4a')](_0x533b7a[_0x433b('0x4b')],{})[_0x433b('0x25')](respondWithResult(_0x1cefa6,0xc9))[_0x433b('0x46')](handleError(_0x1cefa6,null));};exports[_0x433b('0x24')]=function(_0x179888,_0x456af7){if(_0x179888['body']['id']){delete _0x179888[_0x433b('0x4b')]['id'];}return db[_0x433b('0x2b')]['find']({'where':{'id':_0x179888[_0x433b('0x48')]['id']}})['then'](handleEntityNotFound(_0x456af7,null))[_0x433b('0x25')](saveUpdates(_0x179888[_0x433b('0x4b')],null))[_0x433b('0x25')](respondWithResult(_0x456af7,null))[_0x433b('0x46')](handleError(_0x456af7,null));};exports['destroy']=function(_0x540370,_0x56d437){return db[_0x433b('0x2b')][_0x433b('0x49')]({'where':{'id':_0x540370['params']['id']}})[_0x433b('0x25')](handleEntityNotFound(_0x56d437,null))[_0x433b('0x25')](removeEntity(_0x56d437,null))[_0x433b('0x46')](handleError(_0x56d437,null));};exports[_0x433b('0x4c')]=function(_0x73f54e,_0x33a562){return db['VoiceDialReport'][_0x433b('0x4c')]()[_0x433b('0x25')](respondWithResult(_0x33a562,null))['catch'](handleError(_0x33a562,null));}; \ No newline at end of file +var _0x4b04=['set','Content-Range','apply','reject','save','update','then','stack','name','send','map','VoiceDialReport','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','rawAttributes','includeAll','options','find','create','body','params','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit'];(function(_0x3e0bb7,_0x3065da){var _0x168e05=function(_0x14a402){while(--_0x14a402){_0x3e0bb7['push'](_0x3e0bb7['shift']());}};_0x168e05(++_0x3065da);}(_0x4b04,0x15a));var _0x44b0=function(_0x300bd1,_0x284ac3){_0x300bd1=_0x300bd1-0x0;var _0x304455=_0x4b04[_0x300bd1];return _0x304455;};'use strict';var pdf=require(_0x44b0('0x0'));var emlformat=require(_0x44b0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x44b0('0x2'));var jsonpatch=require(_0x44b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b0('0x4'));var Mustache=require('mustache');var util=require(_0x44b0('0x5'));var path=require(_0x44b0('0x6'));var sox=require(_0x44b0('0x7'));var csv=require(_0x44b0('0x8'));var ejs=require(_0x44b0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44b0('0xa'));var crypto=require(_0x44b0('0xb'));var jsforce=require(_0x44b0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x44b0('0x8'));var querystring=require(_0x44b0('0xd'));var Papa=require(_0x44b0('0xe'));var Redis=require(_0x44b0('0xf'));var authService=require(_0x44b0('0x10'));var qs=require(_0x44b0('0x11'));var as=require(_0x44b0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44b0('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x44b0('0x14'));var db=require(_0x44b0('0x15'))['db'];function respondWithStatusCode(_0x4a35c6,_0x5d67d3){_0x5d67d3=_0x5d67d3||0xcc;return function(_0x16196d){if(_0x16196d){return _0x4a35c6[_0x44b0('0x16')](_0x5d67d3);}return _0x4a35c6['status'](_0x5d67d3)[_0x44b0('0x17')]();};}function respondWithResult(_0x7dcd7c,_0x265cd6){_0x265cd6=_0x265cd6||0xc8;return function(_0x460814){if(_0x460814){return _0x7dcd7c[_0x44b0('0x18')](_0x265cd6)[_0x44b0('0x19')](_0x460814);}};}function respondWithFilteredResult(_0x1ec937,_0x37cd9f){return function(_0xa7545a){if(_0xa7545a){var _0x507dcf=_0xa7545a[_0x44b0('0x1a')],_0x2a49a1=_0x37cd9f[_0x44b0('0x1b')],_0x429e34=_0x37cd9f['offset']+_0x37cd9f[_0x44b0('0x1c')],_0x215ce5;if(_0x429e34>=_0x507dcf){_0x429e34=_0x507dcf;_0x215ce5=0xc8;}else{_0x215ce5=0xce;}_0x1ec937[_0x44b0('0x18')](_0x215ce5);return _0x1ec937[_0x44b0('0x1d')](_0x44b0('0x1e'),_0x2a49a1+'-'+_0x429e34+'/'+_0x507dcf)['json'](_0xa7545a);}return null;};}function patchUpdates(_0xa03f0c){return function(_0x2bc353){try{jsonpatch[_0x44b0('0x1f')](_0x2bc353,_0xa03f0c,!![]);}catch(_0x423226){return BPromise[_0x44b0('0x20')](_0x423226);}return _0x2bc353[_0x44b0('0x21')]();};}function saveUpdates(_0x44fb5b,_0x259d79){return function(_0x4966b5){if(_0x4966b5){return _0x4966b5[_0x44b0('0x22')](_0x44fb5b)[_0x44b0('0x23')](function(_0x385c87){return _0x385c87;});}return null;};}function removeEntity(_0x35b570,_0x55c7d8){return function(_0x140a68){if(_0x140a68){return _0x140a68['destroy']()['then'](function(){_0x35b570[_0x44b0('0x18')](0xcc)[_0x44b0('0x17')]();});}};}function handleEntityNotFound(_0x541770,_0x2bd5a0){return function(_0x19fc4a){if(!_0x19fc4a){_0x541770['sendStatus'](0x194);}return _0x19fc4a;};}function handleError(_0x145580,_0x53d7c3){_0x53d7c3=_0x53d7c3||0x1f4;return function(_0x1693c8){logger['error'](_0x1693c8[_0x44b0('0x24')]);if(_0x1693c8['name']){delete _0x1693c8[_0x44b0('0x25')];}_0x145580[_0x44b0('0x18')](_0x53d7c3)[_0x44b0('0x26')](_0x1693c8);};}exports['index']=function(_0x4ddf5e,_0x172ab6){var _0x39297c={},_0x9acc5={},_0x3328e5={'count':0x0,'rows':[]};var _0x1a86d5=_[_0x44b0('0x27')](db[_0x44b0('0x28')]['rawAttributes'],function(_0x5a42e3){return{'name':_0x5a42e3[_0x44b0('0x29')],'type':_0x5a42e3[_0x44b0('0x2a')][_0x44b0('0x2b')]};});_0x9acc5[_0x44b0('0x2c')]=_[_0x44b0('0x27')](_0x1a86d5,_0x44b0('0x25'));_0x9acc5[_0x44b0('0x2d')]=_[_0x44b0('0x2e')](_0x4ddf5e[_0x44b0('0x2d')]);_0x9acc5['filters']=_['intersection'](_0x9acc5[_0x44b0('0x2c')],_0x9acc5[_0x44b0('0x2d')]);_0x39297c[_0x44b0('0x2f')]=_[_0x44b0('0x30')](_0x9acc5['model'],qs[_0x44b0('0x31')](_0x4ddf5e[_0x44b0('0x2d')][_0x44b0('0x31')]));_0x39297c[_0x44b0('0x2f')]=_0x39297c[_0x44b0('0x2f')][_0x44b0('0x32')]?_0x39297c['attributes']:_0x9acc5[_0x44b0('0x2c')];if(!_0x4ddf5e[_0x44b0('0x2d')][_0x44b0('0x33')](_0x44b0('0x34'))){_0x39297c[_0x44b0('0x1c')]=qs[_0x44b0('0x1c')](_0x4ddf5e[_0x44b0('0x2d')][_0x44b0('0x1c')]);_0x39297c[_0x44b0('0x1b')]=qs[_0x44b0('0x1b')](_0x4ddf5e['query'][_0x44b0('0x1b')]);}_0x39297c[_0x44b0('0x35')]=qs[_0x44b0('0x36')](_0x4ddf5e['query']['sort']);_0x39297c[_0x44b0('0x37')]=qs[_0x44b0('0x38')](_[_0x44b0('0x39')](_0x4ddf5e[_0x44b0('0x2d')],_0x9acc5['filters']));if(_0x4ddf5e[_0x44b0('0x2d')][_0x44b0('0x3a')]){_0x39297c[_0x44b0('0x37')]=_[_0x44b0('0x3b')](_0x39297c[_0x44b0('0x37')],{'$or':_[_0x44b0('0x27')](_0x1a86d5,function(_0x124673){if(_0x124673[_0x44b0('0x2a')]!==_0x44b0('0x3c')){var _0x2ad421={};_0x2ad421[_0x124673['name']]={'$like':'%'+_0x4ddf5e[_0x44b0('0x2d')][_0x44b0('0x3a')]+'%'};return _0x2ad421;}})});}_0x39297c=_[_0x44b0('0x3b')]({},_0x39297c,_0x4ddf5e['options']);var _0x3e6cc5={'where':_0x39297c[_0x44b0('0x37')]};return db[_0x44b0('0x28')][_0x44b0('0x1a')](_0x3e6cc5)[_0x44b0('0x23')](function(_0x105f29){_0x3328e5[_0x44b0('0x1a')]=_0x105f29;if(_0x4ddf5e[_0x44b0('0x2d')]['includeAll']){_0x39297c[_0x44b0('0x3d')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x44b0('0x3e')](_0x39297c);})[_0x44b0('0x23')](function(_0x43f336){_0x3328e5[_0x44b0('0x3f')]=_0x43f336;return _0x3328e5;})[_0x44b0('0x23')](respondWithFilteredResult(_0x172ab6,_0x39297c))[_0x44b0('0x40')](handleError(_0x172ab6,null));};exports[_0x44b0('0x41')]=function(_0x38787f,_0x218ff8){var _0x41361a={'raw':!![],'where':{'id':_0x38787f['params']['id']}},_0x407597={};_0x407597[_0x44b0('0x2c')]=_[_0x44b0('0x2e')](db['VoiceDialReport'][_0x44b0('0x42')]);_0x407597[_0x44b0('0x2d')]=_[_0x44b0('0x2e')](_0x38787f['query']);_0x407597[_0x44b0('0x38')]=_[_0x44b0('0x30')](_0x407597['model'],_0x407597[_0x44b0('0x2d')]);_0x41361a[_0x44b0('0x2f')]=_[_0x44b0('0x30')](_0x407597[_0x44b0('0x2c')],qs[_0x44b0('0x31')](_0x38787f[_0x44b0('0x2d')][_0x44b0('0x31')]));_0x41361a[_0x44b0('0x2f')]=_0x41361a[_0x44b0('0x2f')]['length']?_0x41361a[_0x44b0('0x2f')]:_0x407597[_0x44b0('0x2c')];if(_0x38787f['query'][_0x44b0('0x43')]){_0x41361a[_0x44b0('0x3d')]=[{'all':!![]}];}_0x41361a=_[_0x44b0('0x3b')]({},_0x41361a,_0x38787f[_0x44b0('0x44')]);return db[_0x44b0('0x28')][_0x44b0('0x45')](_0x41361a)['then'](handleEntityNotFound(_0x218ff8,null))[_0x44b0('0x23')](respondWithResult(_0x218ff8,null))[_0x44b0('0x40')](handleError(_0x218ff8,null));};exports['create']=function(_0x346bb0,_0x24a63d){return db[_0x44b0('0x28')][_0x44b0('0x46')](_0x346bb0[_0x44b0('0x47')],{})[_0x44b0('0x23')](respondWithResult(_0x24a63d,0xc9))[_0x44b0('0x40')](handleError(_0x24a63d,null));};exports[_0x44b0('0x22')]=function(_0x14350f,_0x1bd6db){if(_0x14350f[_0x44b0('0x47')]['id']){delete _0x14350f['body']['id'];}return db[_0x44b0('0x28')][_0x44b0('0x45')]({'where':{'id':_0x14350f[_0x44b0('0x48')]['id']}})[_0x44b0('0x23')](handleEntityNotFound(_0x1bd6db,null))[_0x44b0('0x23')](saveUpdates(_0x14350f[_0x44b0('0x47')],null))[_0x44b0('0x23')](respondWithResult(_0x1bd6db,null))[_0x44b0('0x40')](handleError(_0x1bd6db,null));};exports[_0x44b0('0x49')]=function(_0x31b912,_0xd76ab2){return db['VoiceDialReport'][_0x44b0('0x45')]({'where':{'id':_0x31b912['params']['id']}})['then'](handleEntityNotFound(_0xd76ab2,null))[_0x44b0('0x23')](removeEntity(_0xd76ab2,null))[_0x44b0('0x40')](handleError(_0xd76ab2,null));};exports[_0x44b0('0x4a')]=function(_0x1da103,_0x49dec9){return db[_0x44b0('0x28')][_0x44b0('0x4a')]()['then'](respondWithResult(_0x49dec9,null))['catch'](handleError(_0x49dec9,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 5638d8c..b5e752c 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 _0x9032=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','path','rimraf','../../config/environment'];(function(_0x33c641,_0x2af4d8){var _0x3a0bda=function(_0x1728d4){while(--_0x1728d4){_0x33c641['push'](_0x33c641['shift']());}};_0x3a0bda(++_0x2af4d8);}(_0x9032,0x11a));var _0x2903=function(_0x4747a7,_0x1ed5d7){_0x4747a7=_0x4747a7-0x0;var _0x446f45=_0x9032[_0x4747a7];return _0x446f45;};'use strict';var _=require(_0x2903('0x0'));var util=require(_0x2903('0x1'));var logger=require(_0x2903('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2903('0x3'));var rimraf=require(_0x2903('0x4'));var config=require(_0x2903('0x5'));var attributes=require(_0x2903('0x6'));module[_0x2903('0x7')]=function(_0x1b7383,_0x376176){return _0x1b7383[_0x2903('0x8')](_0x2903('0x9'),attributes,{'tableName':_0x2903('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2903('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc38f=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','path','rimraf'];(function(_0x5b2132,_0x49215e){var _0x486098=function(_0xd8f8a1){while(--_0xd8f8a1){_0x5b2132['push'](_0x5b2132['shift']());}};_0x486098(++_0x49215e);}(_0xc38f,0xa0));var _0xfc38=function(_0x117a6a,_0x114490){_0x117a6a=_0x117a6a-0x0;var _0x45c51f=_0xc38f[_0x117a6a];return _0x45c51f;};'use strict';var _=require(_0xfc38('0x0'));var util=require(_0xfc38('0x1'));var logger=require(_0xfc38('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc38('0x3'));var rimraf=require(_0xfc38('0x4'));var config=require('../../config/environment');var attributes=require(_0xfc38('0x5'));module[_0xfc38('0x6')]=function(_0x49d429,_0x43991f){return _0x49d429[_0xfc38('0x7')](_0xfc38('0x8'),attributes,{'tableName':_0xfc38('0x9'),'paranoid':![],'indexes':[{'fields':[_0xfc38('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index ac5fe60..47b07bb 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 _0x894f=['request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','create','options','raw','catch','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x48aed3,_0x318f8a){var _0x364263=function(_0x3be269){while(--_0x3be269){_0x48aed3['push'](_0x48aed3['shift']());}};_0x364263(++_0x318f8a);}(_0x894f,0x14d));var _0xf894=function(_0xe0c0d2,_0x500878){_0xe0c0d2=_0xe0c0d2-0x0;var _0x1fbf02=_0x894f[_0xe0c0d2];return _0x1fbf02;};'use strict';var _=require(_0xf894('0x0'));var util=require(_0xf894('0x1'));var moment=require(_0xf894('0x2'));var BPromise=require(_0xf894('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf894('0x4'))['db'];var utils=require(_0xf894('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf894('0x6'));var jayson=require(_0xf894('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23a9fc,_0x371f86,_0x56d9d6){return new BPromise(function(_0x190cb1,_0x3d8f21){return client[_0xf894('0x8')](_0x23a9fc,_0x56d9d6)[_0xf894('0x9')](function(_0x10bb84){logger[_0xf894('0xa')](_0xf894('0xb'),_0x371f86,_0xf894('0xc'));logger[_0xf894('0xd')](_0xf894('0xe'),_0x371f86,_0xf894('0xc'),JSON[_0xf894('0xf')](_0x10bb84));if(_0x10bb84[_0xf894('0x10')]){if(_0x10bb84[_0xf894('0x10')][_0xf894('0x11')]===0x1f4){logger[_0xf894('0x10')](_0xf894('0xb'),_0x371f86,_0x10bb84[_0xf894('0x10')][_0xf894('0x12')]);return _0x3d8f21(_0x10bb84[_0xf894('0x10')][_0xf894('0x12')]);}logger[_0xf894('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x371f86,_0x10bb84[_0xf894('0x10')]['message']);return _0x190cb1(_0x10bb84['error'][_0xf894('0x12')]);}else{logger[_0xf894('0xa')](_0xf894('0xb'),_0x371f86,_0xf894('0xc'));_0x190cb1(_0x10bb84[_0xf894('0x13')]['message']);}})['catch'](function(_0x1865be){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x371f86,_0x1865be);_0x3d8f21(_0x1865be);});});}exports[_0xf894('0x14')]=function(_0x340345){var _0x3f29f1=this;return new Promise(function(_0x4bd77c,_0x45d995){return db[_0xf894('0x15')][_0xf894('0x16')](_0x340345['body'],{'raw':_0x340345['options']?_0x340345[_0xf894('0x17')][_0xf894('0x18')]===undefined?!![]:![]:!![]})[_0xf894('0x9')](function(_0x3abfd1){logger[_0xf894('0xa')](_0xf894('0x14'),_0x340345);logger[_0xf894('0xd')](_0xf894('0x14'),_0x340345,JSON[_0xf894('0xf')](_0x3abfd1));_0x4bd77c(_0x3abfd1);})[_0xf894('0x19')](function(_0x1ccbd1){logger[_0xf894('0x10')]('CreateVoiceDialReport',_0x1ccbd1[_0xf894('0x12')],_0x340345);_0x45d995(_0x3f29f1['error'](0x1f4,_0x1ccbd1['message']));});});};exports[_0xf894('0x1a')]=function(_0x441ec3){var _0x37e537=this;return new Promise(function(_0x18f177,_0xcd8b88){return db[_0xf894('0x15')][_0xf894('0x1b')](_0x441ec3['body'],{'raw':_0x441ec3[_0xf894('0x17')]?_0x441ec3[_0xf894('0x17')][_0xf894('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x441ec3[_0xf894('0x17')]?_0x441ec3[_0xf894('0x17')][_0xf894('0x1c')]||null:null,'attributes':_0x441ec3[_0xf894('0x17')]?_0x441ec3[_0xf894('0x17')][_0xf894('0x1d')]||null:null,'limit':_0x441ec3[_0xf894('0x17')]?_0x441ec3[_0xf894('0x17')][_0xf894('0x1e')]||null:null})[_0xf894('0x9')](function(_0x4e7312){logger[_0xf894('0xa')]('UpdateVoiceDialReport',_0x441ec3);logger[_0xf894('0xd')](_0xf894('0x1a'),_0x441ec3,JSON[_0xf894('0xf')](_0x4e7312));_0x18f177(_0x4e7312);})[_0xf894('0x19')](function(_0x52c47b){logger[_0xf894('0x10')](_0xf894('0x1a'),_0x52c47b[_0xf894('0x12')],_0x441ec3);_0xcd8b88(_0x37e537[_0xf894('0x10')](0x1f4,_0x52c47b[_0xf894('0x12')]));});});}; \ No newline at end of file +var _0x195e=['info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceDialReport','create','body','options','raw','then','UpdateVoiceDialReport','VoiceDialReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x195e,0xfb));var _0xe195=function(_0x4e7cc9,_0x334a85){_0x4e7cc9=_0x4e7cc9-0x0;var _0x45e081=_0x195e[_0x4e7cc9];return _0x45e081;};'use strict';var _=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var moment=require(_0xe195('0x2'));var BPromise=require(_0xe195('0x3'));var rs=require(_0xe195('0x4'));var fs=require('fs');var Redis=require(_0xe195('0x5'));var db=require(_0xe195('0x6'))['db'];var utils=require(_0xe195('0x7'));var logger=require(_0xe195('0x8'))(_0xe195('0x9'));var config=require(_0xe195('0xa'));var jayson=require(_0xe195('0xb'));var client=jayson[_0xe195('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a1acc,_0x663106,_0x2ead59){return new BPromise(function(_0x28c1a9,_0x3164c3){return client['request'](_0x2a1acc,_0x2ead59)['then'](function(_0x5f333b){logger[_0xe195('0xd')](_0xe195('0xe'),_0x663106,_0xe195('0xf'));logger[_0xe195('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x663106,_0xe195('0xf'),JSON[_0xe195('0x11')](_0x5f333b));if(_0x5f333b[_0xe195('0x12')]){if(_0x5f333b['error'][_0xe195('0x13')]===0x1f4){logger[_0xe195('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x663106,_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);return _0x3164c3(_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);}logger['error'](_0xe195('0xe'),_0x663106,_0x5f333b[_0xe195('0x12')]['message']);return _0x28c1a9(_0x5f333b['error'][_0xe195('0x14')]);}else{logger['info'](_0xe195('0xe'),_0x663106,'request\x20sent');_0x28c1a9(_0x5f333b['result'][_0xe195('0x14')]);}})[_0xe195('0x15')](function(_0x277362){logger[_0xe195('0x12')](_0xe195('0xe'),_0x663106,_0x277362);_0x3164c3(_0x277362);});});}exports[_0xe195('0x16')]=function(_0x4784b1){var _0x41265d=this;return new Promise(function(_0x9c8ba5,_0x25818c){return db['VoiceDialReport'][_0xe195('0x17')](_0x4784b1[_0xe195('0x18')],{'raw':_0x4784b1[_0xe195('0x19')]?_0x4784b1[_0xe195('0x19')][_0xe195('0x1a')]===undefined?!![]:![]:!![]})[_0xe195('0x1b')](function(_0x496722){logger[_0xe195('0xd')](_0xe195('0x16'),_0x4784b1);logger[_0xe195('0x10')](_0xe195('0x16'),_0x4784b1,JSON['stringify'](_0x496722));_0x9c8ba5(_0x496722);})['catch'](function(_0x4e5f13){logger[_0xe195('0x12')](_0xe195('0x16'),_0x4e5f13[_0xe195('0x14')],_0x4784b1);_0x25818c(_0x41265d[_0xe195('0x12')](0x1f4,_0x4e5f13[_0xe195('0x14')]));});});};exports[_0xe195('0x1c')]=function(_0x40c6a2){var _0x9b8d62=this;return new Promise(function(_0x296d4c,_0x3d7857){return db[_0xe195('0x1d')][_0xe195('0x1e')](_0x40c6a2[_0xe195('0x18')],{'raw':_0x40c6a2['options']?_0x40c6a2[_0xe195('0x19')][_0xe195('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40c6a2[_0xe195('0x19')]?_0x40c6a2[_0xe195('0x19')][_0xe195('0x1f')]||null:null,'attributes':_0x40c6a2[_0xe195('0x19')]?_0x40c6a2[_0xe195('0x19')][_0xe195('0x20')]||null:null,'limit':_0x40c6a2[_0xe195('0x19')]?_0x40c6a2[_0xe195('0x19')]['limit']||null:null})[_0xe195('0x1b')](function(_0x3e228f){logger[_0xe195('0xd')](_0xe195('0x1c'),_0x40c6a2);logger[_0xe195('0x10')]('UpdateVoiceDialReport',_0x40c6a2,JSON['stringify'](_0x3e228f));_0x296d4c(_0x3e228f);})[_0xe195('0x15')](function(_0x2022e8){logger[_0xe195('0x12')](_0xe195('0x1c'),_0x2022e8[_0xe195('0x14')],_0x40c6a2);_0x3d7857(_0x9b8d62[_0xe195('0x12')](0x1f4,_0x2022e8['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 7a1e741..fef2f33 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 _0x3c02=['update','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x3c02,0x146));var _0x23c0=function(_0x35e24d,_0xc4ea34){_0x35e24d=_0x35e24d-0x0;var _0x1dd069=_0x3c02[_0x35e24d];return _0x1dd069;};'use strict';var multer=require(_0x23c0('0x0'));var util=require(_0x23c0('0x1'));var path=require(_0x23c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x23c0('0x3'));var router=express[_0x23c0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x23c0('0x5'));var config=require('../../config/environment');var controller=require(_0x23c0('0x6'));router[_0x23c0('0x7')]('/',auth[_0x23c0('0x8')](),controller[_0x23c0('0x9')]);router[_0x23c0('0x7')](_0x23c0('0xa'),auth[_0x23c0('0x8')](),controller[_0x23c0('0xb')]);router[_0x23c0('0xc')]('/',auth[_0x23c0('0x8')](),controller[_0x23c0('0xd')]);router[_0x23c0('0xc')](_0x23c0('0xe'),auth['isAuthenticated'](),controller[_0x23c0('0xf')]);router['put'](_0x23c0('0xa'),auth['isAuthenticated'](),controller[_0x23c0('0x10')]);router['delete'](_0x23c0('0xa'),auth[_0x23c0('0x8')](),controller[_0x23c0('0x11')]);module[_0x23c0('0x12')]=router; \ No newline at end of file +var _0x6429=['/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6429,0xa8));var _0x9642=function(_0x4307d0,_0x31ae0){_0x4307d0=_0x4307d0-0x0;var _0x4bb86f=_0x6429[_0x4307d0];return _0x4bb86f;};'use strict';var multer=require(_0x9642('0x0'));var util=require(_0x9642('0x1'));var path=require(_0x9642('0x2'));var timeout=require(_0x9642('0x3'));var express=require(_0x9642('0x4'));var router=express[_0x9642('0x5')]();var auth=require(_0x9642('0x6'));var interaction=require(_0x9642('0x7'));var config=require(_0x9642('0x8'));var controller=require(_0x9642('0x9'));router['get']('/',auth[_0x9642('0xa')](),controller[_0x9642('0xb')]);router[_0x9642('0xc')](_0x9642('0xd'),auth[_0x9642('0xa')](),controller['show']);router[_0x9642('0xe')]('/',auth[_0x9642('0xa')](),controller[_0x9642('0xf')]);router['post'](_0x9642('0x10'),auth[_0x9642('0xa')](),controller[_0x9642('0x11')]);router[_0x9642('0x12')](_0x9642('0xd'),auth['isAuthenticated'](),controller[_0x9642('0x13')]);router[_0x9642('0x14')](_0x9642('0xd'),auth[_0x9642('0xa')](),controller[_0x9642('0x15')]);module[_0x9642('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 02d39d4..9c2d356 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x28255b,_0x4e04d9){var _0x328241=function(_0x6e2a5b){while(--_0x6e2a5b){_0x28255b['push'](_0x28255b['shift']());}};_0x328241(++_0x4e04d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x270c5c,_0x2ce83e){var _0x2b30e4=function(_0x29979f){while(--_0x29979f){_0x270c5c['push'](_0x270c5c['shift']());}};_0x2b30e4(++_0x2ce83e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 979d2fe..cef3f4e 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 _0xf21a=['then','destroy','inbound','outbound','InternalRoutes','filter','ignore','map','value','includes','type','find','name','UserProfileResource','stack','send','index','VoiceExtension','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','body','exten','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','InboundRoutes','autoAssociation','error','update','params','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save'];(function(_0x10a9b9,_0x4bb7b5){var _0x50aeed=function(_0x23be1a){while(--_0x23be1a){_0x10a9b9['push'](_0x10a9b9['shift']());}};_0x50aeed(++_0x4bb7b5);}(_0xf21a,0x116));var _0xaf21=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf21a[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0xaf21('0x0'));var emlformat=require(_0xaf21('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaf21('0x2'));var moment=require(_0xaf21('0x3'));var BPromise=require(_0xaf21('0x4'));var Mustache=require(_0xaf21('0x5'));var util=require(_0xaf21('0x6'));var path=require('path');var sox=require(_0xaf21('0x7'));var csv=require(_0xaf21('0x8'));var ejs=require(_0xaf21('0x9'));var fs=require('fs');var _=require(_0xaf21('0xa'));var squel=require(_0xaf21('0xb'));var crypto=require(_0xaf21('0xc'));var jsforce=require(_0xaf21('0xd'));var deskjs=require(_0xaf21('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaf21('0xf'));var Papa=require(_0xaf21('0x10'));var Redis=require(_0xaf21('0x11'));var authService=require(_0xaf21('0x12'));var qs=require(_0xaf21('0x13'));var as=require(_0xaf21('0x14'));var hardwareService=require(_0xaf21('0x15'));var logger=require(_0xaf21('0x16'))(_0xaf21('0x17'));var utils=require(_0xaf21('0x18'));var config=require(_0xaf21('0x19'));var db=require(_0xaf21('0x1a'))['db'];config['redis']=_['defaults'](config[_0xaf21('0x1b')],{'host':_0xaf21('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf21('0x1b')]));require('./voiceExtension.socket')[_0xaf21('0x1d')](socket);function respondWithStatusCode(_0x50e255,_0x1fcb93){_0x1fcb93=_0x1fcb93||0xcc;return function(_0x4f9006){if(_0x4f9006){return _0x50e255[_0xaf21('0x1e')](_0x1fcb93);}return _0x50e255[_0xaf21('0x1f')](_0x1fcb93)[_0xaf21('0x20')]();};}function respondWithResult(_0x18fbfc,_0x177dc5){_0x177dc5=_0x177dc5||0xc8;return function(_0x9a4d0d){if(_0x9a4d0d){return _0x18fbfc[_0xaf21('0x1f')](_0x177dc5)['json'](_0x9a4d0d);}};}function respondWithFilteredResult(_0x498bb2,_0x55c9d6){return function(_0x2697c7){if(_0x2697c7){var _0x2a52c9=_0x2697c7[_0xaf21('0x21')],_0x19da25=_0x55c9d6[_0xaf21('0x22')],_0x5de825=_0x55c9d6[_0xaf21('0x22')]+_0x55c9d6['limit'],_0x2be069;if(_0x5de825>=_0x2a52c9){_0x5de825=_0x2a52c9;_0x2be069=0xc8;}else{_0x2be069=0xce;}_0x498bb2[_0xaf21('0x1f')](_0x2be069);return _0x498bb2['set'](_0xaf21('0x23'),_0x19da25+'-'+_0x5de825+'/'+_0x2a52c9)[_0xaf21('0x24')](_0x2697c7);}return null;};}function patchUpdates(_0x309d4d){return function(_0x55ab1d){try{jsonpatch[_0xaf21('0x25')](_0x55ab1d,_0x309d4d,!![]);}catch(_0x4831aa){return BPromise[_0xaf21('0x26')](_0x4831aa);}return _0x55ab1d[_0xaf21('0x27')]();};}function saveUpdates(_0x48bf8a,_0x4afdd0){return function(_0x309510){if(_0x309510){return _0x309510['update'](_0x48bf8a)[_0xaf21('0x28')](function(_0x36589f){return _0x36589f;});}return null;};}function removeEntity(_0x1fd9b5,_0xe730ff){return function(_0xf685ec){if(_0xf685ec){return _0xf685ec[_0xaf21('0x29')]()['then'](function(){var _0x3d36bc=_0xf685ec['get']({'plain':!![]});var _0x4d1c04=[{'name':'InboundRoutes','value':_0xaf21('0x2a'),'ignore':![]},{'name':'OutboundRoutes','value':_0xaf21('0x2b'),'ignore':![]},{'name':_0xaf21('0x2c'),'value':'internal','ignore':![]}];var _0x40b464=_(_0x4d1c04)[_0xaf21('0x2d')](_0xaf21('0x2e'))[_0xaf21('0x2f')](_0xaf21('0x30'))[_0xaf21('0x30')]();if(_[_0xaf21('0x31')](_0x40b464,_0x3d36bc[_0xaf21('0x32')])){return;}var _0x543ece=_[_0xaf21('0x33')](_0x4d1c04,[_0xaf21('0x30'),_0x3d36bc['type']])[_0xaf21('0x34')];return db[_0xaf21('0x35')][_0xaf21('0x29')]({'where':{'type':_0x543ece,'resourceId':_0x3d36bc['id']}})['then'](function(){return _0xf685ec;});})[_0xaf21('0x28')](function(){_0x1fd9b5['status'](0xcc)[_0xaf21('0x20')]();});}};}function handleEntityNotFound(_0xb6a9,_0x315b67){return function(_0x4916db){if(!_0x4916db){_0xb6a9['sendStatus'](0x194);}return _0x4916db;};}function handleError(_0x104bfe,_0x422b41){_0x422b41=_0x422b41||0x1f4;return function(_0x1c8c57){logger['error'](_0x1c8c57[_0xaf21('0x36')]);if(_0x1c8c57[_0xaf21('0x34')]){delete _0x1c8c57[_0xaf21('0x34')];}_0x104bfe[_0xaf21('0x1f')](_0x422b41)[_0xaf21('0x37')](_0x1c8c57);};}exports[_0xaf21('0x38')]=function(_0x1f1440,_0x50288b){var _0x1935e6={},_0x402864={},_0x565b4b={'count':0x0,'rows':[]};var _0x6edea1=_[_0xaf21('0x2f')](db[_0xaf21('0x39')]['rawAttributes'],function(_0x592ecf){return{'name':_0x592ecf[_0xaf21('0x3a')],'type':_0x592ecf[_0xaf21('0x32')][_0xaf21('0x3b')]};});_0x402864[_0xaf21('0x3c')]=_[_0xaf21('0x2f')](_0x6edea1,_0xaf21('0x34'));_0x402864[_0xaf21('0x3d')]=_[_0xaf21('0x3e')](_0x1f1440['query']);_0x402864[_0xaf21('0x3f')]=_[_0xaf21('0x40')](_0x402864['model'],_0x402864[_0xaf21('0x3d')]);_0x1935e6['attributes']=_[_0xaf21('0x40')](_0x402864[_0xaf21('0x3c')],qs['fields'](_0x1f1440[_0xaf21('0x3d')]['fields']));_0x1935e6[_0xaf21('0x41')]=_0x1935e6[_0xaf21('0x41')][_0xaf21('0x42')]?_0x1935e6[_0xaf21('0x41')]:_0x402864['model'];if(!_0x1f1440[_0xaf21('0x3d')]['hasOwnProperty'](_0xaf21('0x43'))){_0x1935e6[_0xaf21('0x44')]=qs[_0xaf21('0x44')](_0x1f1440[_0xaf21('0x3d')][_0xaf21('0x44')]);_0x1935e6[_0xaf21('0x22')]=qs[_0xaf21('0x22')](_0x1f1440[_0xaf21('0x3d')][_0xaf21('0x22')]);}_0x1935e6[_0xaf21('0x45')]=qs[_0xaf21('0x46')](_0x1f1440['query'][_0xaf21('0x46')]);_0x1935e6[_0xaf21('0x47')]=qs[_0xaf21('0x3f')](_[_0xaf21('0x48')](_0x1f1440['query'],_0x402864[_0xaf21('0x3f')]));if(_0x1f1440['query'][_0xaf21('0x2d')]){_0x1935e6[_0xaf21('0x47')]=_[_0xaf21('0x49')](_0x1935e6[_0xaf21('0x47')],{'$or':_[_0xaf21('0x2f')](_0x6edea1,function(_0x50ea90){if(_0x50ea90['type']!==_0xaf21('0x4a')){var _0x1e79ef={};_0x1e79ef[_0x50ea90[_0xaf21('0x34')]]={'$like':'%'+_0x1f1440['query']['filter']+'%'};return _0x1e79ef;}})});}_0x1935e6=_[_0xaf21('0x49')]({},_0x1935e6,_0x1f1440[_0xaf21('0x4b')]);var _0x2f8fb5={'where':_0x1935e6[_0xaf21('0x47')]};return db[_0xaf21('0x39')]['count'](_0x2f8fb5)['then'](function(_0x662348){_0x565b4b['count']=_0x662348;if(_0x1f1440[_0xaf21('0x3d')][_0xaf21('0x4c')]){_0x1935e6[_0xaf21('0x4d')]=[{'all':!![]}];}return db[_0xaf21('0x39')][_0xaf21('0x4e')](_0x1935e6);})['then'](function(_0x53ed07){_0x565b4b[_0xaf21('0x4f')]=_0x53ed07;return _0x565b4b;})[_0xaf21('0x28')](respondWithFilteredResult(_0x50288b,_0x1935e6))[_0xaf21('0x50')](handleError(_0x50288b,null));};exports[_0xaf21('0x51')]=function(_0x407280,_0x306940){var _0x5c0f7e={'raw':![],'where':{'id':_0x407280['params']['id']}},_0x2a20c2={};_0x2a20c2['model']=_[_0xaf21('0x3e')](db['VoiceExtension'][_0xaf21('0x52')]);_0x2a20c2['query']=_[_0xaf21('0x3e')](_0x407280['query']);_0x2a20c2['filters']=_[_0xaf21('0x40')](_0x2a20c2[_0xaf21('0x3c')],_0x2a20c2[_0xaf21('0x3d')]);_0x5c0f7e[_0xaf21('0x41')]=_[_0xaf21('0x40')](_0x2a20c2[_0xaf21('0x3c')],qs['fields'](_0x407280[_0xaf21('0x3d')][_0xaf21('0x53')]));_0x5c0f7e[_0xaf21('0x41')]=_0x5c0f7e[_0xaf21('0x41')]['length']?_0x5c0f7e[_0xaf21('0x41')]:_0x2a20c2[_0xaf21('0x3c')];if(_0x407280['query'][_0xaf21('0x4c')]){_0x5c0f7e[_0xaf21('0x4d')]=[{'all':!![]}];}_0x5c0f7e=_[_0xaf21('0x49')]({},_0x5c0f7e,_0x407280[_0xaf21('0x4b')]);return db[_0xaf21('0x39')]['find'](_0x5c0f7e)[_0xaf21('0x28')](handleEntityNotFound(_0x306940,null))['then'](respondWithResult(_0x306940,null))[_0xaf21('0x50')](handleError(_0x306940,null));};exports[_0xaf21('0x29')]=function(_0x1d1f15,_0x54c4ea){return db['VoiceExtension'][_0xaf21('0x33')]({'where':{'id':_0x1d1f15['params']['id']}})[_0xaf21('0x28')](handleEntityNotFound(_0x54c4ea,null))['then'](removeEntity(_0x54c4ea,null))[_0xaf21('0x50')](handleError(_0x54c4ea,null));};exports['create']=function(_0xf8b5,_0x1bd07f){if(_0xf8b5[_0xaf21('0x54')][_0xaf21('0x32')]===_0xaf21('0x2b')&&!_['startsWith'](_0xf8b5[_0xaf21('0x54')][_0xaf21('0x55')],'_')){_0xf8b5['body'][_0xaf21('0x55')]='_'['concat'](_0xf8b5[_0xaf21('0x54')][_0xaf21('0x55')]);}return db[_0xaf21('0x39')][_0xaf21('0x56')](_0xf8b5['body'],{'raw':![]})['then'](function(_0x420019){var _0xd3e73=_0xf8b5['user']['get']({'plain':!![]});if(!_0xd3e73)throw new Error(_0xaf21('0x57'));if(_0xd3e73[_0xaf21('0x58')]==='user'){var _0x42dfe0=_0x420019[_0xaf21('0x59')]({'plain':!![]});var _0x2d3bdc=[{'name':_0xaf21('0x5a'),'value':_0xaf21('0x2a')},{'name':'OutboundRoutes','value':_0xaf21('0x2b')},{'name':_0xaf21('0x2c'),'value':'internal'}];var _0x12b3e3=_['find'](_0x2d3bdc,[_0xaf21('0x30'),_0x42dfe0[_0xaf21('0x32')]])[_0xaf21('0x34')];return db['UserProfileSection'][_0xaf21('0x33')]({'where':{'name':_0x12b3e3,'userProfileId':_0xd3e73['userProfileId']},'raw':!![]})[_0xaf21('0x28')](function(_0x405403){if(_0x405403&&_0x405403[_0xaf21('0x5b')]===0x0){return db['UserProfileResource'][_0xaf21('0x56')]({'name':_0x42dfe0['name'],'resourceId':_0x42dfe0['id'],'type':_0x405403[_0xaf21('0x34')],'sectionId':_0x405403['id']},{})['then'](function(){return _0x420019;});}else{return _0x420019;}})[_0xaf21('0x50')](function(_0x4f925b){logger[_0xaf21('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f925b);throw _0x4f925b;});}return _0x420019;})[_0xaf21('0x28')](respondWithResult(_0x1bd07f,0xc9))[_0xaf21('0x50')](handleError(_0x1bd07f,null));};exports[_0xaf21('0x5d')]=function(_0x346a8a,_0x395407){if(_0x346a8a['body']['id']){delete _0x346a8a[_0xaf21('0x54')]['id'];}return db['VoiceExtension'][_0xaf21('0x33')]({'where':{'id':_0x346a8a[_0xaf21('0x5e')]['id']}})[_0xaf21('0x28')](handleEntityNotFound(_0x395407,null))[_0xaf21('0x28')](function(_0x8c005e){if(_0x8c005e){return db[_0xaf21('0x39')][_0xaf21('0x5d')](_['pick'](_0x346a8a[_0xaf21('0x54')],[_0xaf21('0x55'),_0xaf21('0x5f'),_0xaf21('0x60'),_0xaf21('0x61'),_0xaf21('0x62'),_0xaf21('0x63')]),{'where':{'context':_0x8c005e[_0xaf21('0x5f')],'exten':_0x8c005e[_0xaf21('0x55')]},'individualHooks':!![]})['then'](function(_0x4eac54){return _0x4eac54;});}return null;})[_0xaf21('0x28')](respondWithStatusCode(_0x395407,null))[_0xaf21('0x50')](handleError(_0x395407,null));};exports[_0xaf21('0x64')]=function(_0x3aea42,_0x55ad23,_0x26414f){return db[_0xaf21('0x39')]['findOne']({'where':{'id':_0x3aea42['params']['id']}})[_0xaf21('0x28')](handleEntityNotFound(_0x55ad23,null))[_0xaf21('0x28')](function(_0x3dcd4c){if(_0x3dcd4c){return db[_0xaf21('0x65')][_0xaf21('0x66')](function(_0x596f41){return db[_0xaf21('0x39')][_0xaf21('0x29')]({'where':{'VoiceExtensionId':_0x3aea42[_0xaf21('0x5e')]['id']},'transaction':_0x596f41})[_0xaf21('0x28')](function(_0x4bddef){var _0xbc588e=_[_0xaf21('0x2f')](_0x3aea42[_0xaf21('0x54')],function(_0x4f821f){_0x4f821f[_0xaf21('0x67')]=_0x3aea42['params']['id'];return _0x4f821f;});return db[_0xaf21('0x39')][_0xaf21('0x68')](_0xbc588e,{'transaction':_0x596f41});});})[_0xaf21('0x28')](function(){return db[_0xaf21('0x39')][_0xaf21('0x69')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3aea42[_0xaf21('0x5e')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xaf21('0x28')](respondWithResult(_0x55ad23,null))[_0xaf21('0x50')](handleError(_0x55ad23,null));}; \ No newline at end of file +var _0x477c=['VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','rimraf','fast-json-patch','request-promise','bluebird','mustache','to-csv','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','find','type','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','catch','params','length','options','create','startsWith','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','context','recordingFormat','mandatoryDisposition','addApplications','findOne'];(function(_0x211de7,_0x2e6f69){var _0x2b29e0=function(_0xf2306){while(--_0xf2306){_0x211de7['push'](_0x211de7['shift']());}};_0x2b29e0(++_0x2e6f69);}(_0x477c,0x121));var _0xc477=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x477c[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc477('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc477('0x1'));var rp=require(_0xc477('0x2'));var moment=require('moment');var BPromise=require(_0xc477('0x3'));var Mustache=require(_0xc477('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc477('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc477('0x6'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc477('0x7'));var toCsv=require(_0xc477('0x5'));var querystring=require(_0xc477('0x8'));var Papa=require('papaparse');var Redis=require(_0xc477('0x9'));var authService=require('../../components/auth/service');var qs=require(_0xc477('0xa'));var as=require(_0xc477('0xb'));var hardwareService=require(_0xc477('0xc'));var logger=require('../../config/logger')(_0xc477('0xd'));var utils=require(_0xc477('0xe'));var config=require('../../config/environment');var db=require(_0xc477('0xf'))['db'];config[_0xc477('0x10')]=_['defaults'](config[_0xc477('0x10')],{'host':_0xc477('0x11'),'port':0x18eb});var socket=require(_0xc477('0x12'))(new Redis(config[_0xc477('0x10')]));require(_0xc477('0x13'))['register'](socket);function respondWithStatusCode(_0x319875,_0x5236ef){_0x5236ef=_0x5236ef||0xcc;return function(_0x2067b5){if(_0x2067b5){return _0x319875[_0xc477('0x14')](_0x5236ef);}return _0x319875[_0xc477('0x15')](_0x5236ef)[_0xc477('0x16')]();};}function respondWithResult(_0x65f97,_0x4de76e){_0x4de76e=_0x4de76e||0xc8;return function(_0x36b218){if(_0x36b218){return _0x65f97[_0xc477('0x15')](_0x4de76e)[_0xc477('0x17')](_0x36b218);}};}function respondWithFilteredResult(_0x3ac561,_0x4d8a71){return function(_0x4f1ee4){if(_0x4f1ee4){var _0x3e2ecc=_0x4f1ee4[_0xc477('0x18')],_0x17608f=_0x4d8a71[_0xc477('0x19')],_0xbe48dd=_0x4d8a71[_0xc477('0x19')]+_0x4d8a71[_0xc477('0x1a')],_0x2121ff;if(_0xbe48dd>=_0x3e2ecc){_0xbe48dd=_0x3e2ecc;_0x2121ff=0xc8;}else{_0x2121ff=0xce;}_0x3ac561[_0xc477('0x15')](_0x2121ff);return _0x3ac561['set'](_0xc477('0x1b'),_0x17608f+'-'+_0xbe48dd+'/'+_0x3e2ecc)[_0xc477('0x17')](_0x4f1ee4);}return null;};}function patchUpdates(_0x118acc){return function(_0x4f235a){try{jsonpatch[_0xc477('0x1c')](_0x4f235a,_0x118acc,!![]);}catch(_0x34c697){return BPromise[_0xc477('0x1d')](_0x34c697);}return _0x4f235a['save']();};}function saveUpdates(_0x5a6a35,_0x3e84c4){return function(_0x17d922){if(_0x17d922){return _0x17d922[_0xc477('0x1e')](_0x5a6a35)[_0xc477('0x1f')](function(_0x36b0bf){return _0x36b0bf;});}return null;};}function removeEntity(_0x4566a9,_0xc063f0){return function(_0x20f61e){if(_0x20f61e){return _0x20f61e[_0xc477('0x20')]()[_0xc477('0x1f')](function(){var _0x57f807=_0x20f61e[_0xc477('0x21')]({'plain':!![]});var _0x2535fb=[{'name':_0xc477('0x22'),'value':_0xc477('0x23'),'ignore':![]},{'name':_0xc477('0x24'),'value':_0xc477('0x25'),'ignore':![]},{'name':_0xc477('0x26'),'value':_0xc477('0x27'),'ignore':![]}];var _0x487638=_(_0x2535fb)['filter'](_0xc477('0x28'))[_0xc477('0x29')](_0xc477('0x2a'))['value']();if(_['includes'](_0x487638,_0x57f807['type'])){return;}var _0x4cbda8=_[_0xc477('0x2b')](_0x2535fb,['value',_0x57f807[_0xc477('0x2c')]])[_0xc477('0x2d')];return db[_0xc477('0x2e')]['destroy']({'where':{'type':_0x4cbda8,'resourceId':_0x57f807['id']}})[_0xc477('0x1f')](function(){return _0x20f61e;});})[_0xc477('0x1f')](function(){_0x4566a9[_0xc477('0x15')](0xcc)[_0xc477('0x16')]();});}};}function handleEntityNotFound(_0x54bbce,_0x3e559c){return function(_0x44683d){if(!_0x44683d){_0x54bbce[_0xc477('0x14')](0x194);}return _0x44683d;};}function handleError(_0x32ace9,_0x4be7b4){_0x4be7b4=_0x4be7b4||0x1f4;return function(_0x1b674c){logger[_0xc477('0x2f')](_0x1b674c[_0xc477('0x30')]);if(_0x1b674c[_0xc477('0x2d')]){delete _0x1b674c['name'];}_0x32ace9[_0xc477('0x15')](_0x4be7b4)[_0xc477('0x31')](_0x1b674c);};}exports[_0xc477('0x32')]=function(_0x58e56a,_0x2d21cd){var _0x2c5cb3={},_0x59ac69={},_0x2f03b6={'count':0x0,'rows':[]};var _0x37b8e1=_[_0xc477('0x29')](db[_0xc477('0x33')][_0xc477('0x34')],function(_0x20ea42){return{'name':_0x20ea42[_0xc477('0x35')],'type':_0x20ea42['type'][_0xc477('0x36')]};});_0x59ac69[_0xc477('0x37')]=_[_0xc477('0x29')](_0x37b8e1,_0xc477('0x2d'));_0x59ac69['query']=_[_0xc477('0x38')](_0x58e56a['query']);_0x59ac69[_0xc477('0x39')]=_[_0xc477('0x3a')](_0x59ac69[_0xc477('0x37')],_0x59ac69[_0xc477('0x3b')]);_0x2c5cb3[_0xc477('0x3c')]=_[_0xc477('0x3a')](_0x59ac69[_0xc477('0x37')],qs[_0xc477('0x3d')](_0x58e56a[_0xc477('0x3b')][_0xc477('0x3d')]));_0x2c5cb3[_0xc477('0x3c')]=_0x2c5cb3[_0xc477('0x3c')]['length']?_0x2c5cb3['attributes']:_0x59ac69[_0xc477('0x37')];if(!_0x58e56a['query'][_0xc477('0x3e')](_0xc477('0x3f'))){_0x2c5cb3[_0xc477('0x1a')]=qs['limit'](_0x58e56a[_0xc477('0x3b')]['limit']);_0x2c5cb3['offset']=qs[_0xc477('0x19')](_0x58e56a['query']['offset']);}_0x2c5cb3[_0xc477('0x40')]=qs[_0xc477('0x41')](_0x58e56a[_0xc477('0x3b')][_0xc477('0x41')]);_0x2c5cb3[_0xc477('0x42')]=qs[_0xc477('0x39')](_['pick'](_0x58e56a[_0xc477('0x3b')],_0x59ac69[_0xc477('0x39')]));if(_0x58e56a[_0xc477('0x3b')][_0xc477('0x43')]){_0x2c5cb3['where']=_[_0xc477('0x44')](_0x2c5cb3[_0xc477('0x42')],{'$or':_['map'](_0x37b8e1,function(_0x5421e){if(_0x5421e['type']!==_0xc477('0x45')){var _0x1192fe={};_0x1192fe[_0x5421e[_0xc477('0x2d')]]={'$like':'%'+_0x58e56a[_0xc477('0x3b')]['filter']+'%'};return _0x1192fe;}})});}_0x2c5cb3=_[_0xc477('0x44')]({},_0x2c5cb3,_0x58e56a['options']);var _0x35efe6={'where':_0x2c5cb3[_0xc477('0x42')]};return db['VoiceExtension'][_0xc477('0x18')](_0x35efe6)[_0xc477('0x1f')](function(_0x2bc281){_0x2f03b6['count']=_0x2bc281;if(_0x58e56a[_0xc477('0x3b')]['includeAll']){_0x2c5cb3[_0xc477('0x46')]=[{'all':!![]}];}return db[_0xc477('0x33')][_0xc477('0x47')](_0x2c5cb3);})['then'](function(_0x5014ee){_0x2f03b6['rows']=_0x5014ee;return _0x2f03b6;})[_0xc477('0x1f')](respondWithFilteredResult(_0x2d21cd,_0x2c5cb3))[_0xc477('0x48')](handleError(_0x2d21cd,null));};exports['show']=function(_0x5bf928,_0x4ba44c){var _0x44d17d={'raw':![],'where':{'id':_0x5bf928[_0xc477('0x49')]['id']}},_0x1de05b={};_0x1de05b[_0xc477('0x37')]=_[_0xc477('0x38')](db[_0xc477('0x33')][_0xc477('0x34')]);_0x1de05b[_0xc477('0x3b')]=_[_0xc477('0x38')](_0x5bf928[_0xc477('0x3b')]);_0x1de05b[_0xc477('0x39')]=_[_0xc477('0x3a')](_0x1de05b[_0xc477('0x37')],_0x1de05b[_0xc477('0x3b')]);_0x44d17d[_0xc477('0x3c')]=_[_0xc477('0x3a')](_0x1de05b[_0xc477('0x37')],qs[_0xc477('0x3d')](_0x5bf928[_0xc477('0x3b')][_0xc477('0x3d')]));_0x44d17d[_0xc477('0x3c')]=_0x44d17d[_0xc477('0x3c')][_0xc477('0x4a')]?_0x44d17d[_0xc477('0x3c')]:_0x1de05b[_0xc477('0x37')];if(_0x5bf928[_0xc477('0x3b')]['includeAll']){_0x44d17d['include']=[{'all':!![]}];}_0x44d17d=_[_0xc477('0x44')]({},_0x44d17d,_0x5bf928[_0xc477('0x4b')]);return db[_0xc477('0x33')][_0xc477('0x2b')](_0x44d17d)[_0xc477('0x1f')](handleEntityNotFound(_0x4ba44c,null))[_0xc477('0x1f')](respondWithResult(_0x4ba44c,null))['catch'](handleError(_0x4ba44c,null));};exports[_0xc477('0x20')]=function(_0x254511,_0x33b9bd){return db['VoiceExtension']['find']({'where':{'id':_0x254511[_0xc477('0x49')]['id']}})[_0xc477('0x1f')](handleEntityNotFound(_0x33b9bd,null))[_0xc477('0x1f')](removeEntity(_0x33b9bd,null))[_0xc477('0x48')](handleError(_0x33b9bd,null));};exports[_0xc477('0x4c')]=function(_0xfe8bd4,_0x7642e9){if(_0xfe8bd4['body'][_0xc477('0x2c')]===_0xc477('0x25')&&!_[_0xc477('0x4d')](_0xfe8bd4[_0xc477('0x4e')][_0xc477('0x4f')],'_')){_0xfe8bd4[_0xc477('0x4e')][_0xc477('0x4f')]='_'[_0xc477('0x50')](_0xfe8bd4[_0xc477('0x4e')][_0xc477('0x4f')]);}return db[_0xc477('0x33')][_0xc477('0x4c')](_0xfe8bd4[_0xc477('0x4e')],{'raw':![]})[_0xc477('0x1f')](function(_0x227c9c){var _0x4f56d3=_0xfe8bd4['user'][_0xc477('0x21')]({'plain':!![]});if(!_0x4f56d3)throw new Error(_0xc477('0x51'));if(_0x4f56d3[_0xc477('0x52')]===_0xc477('0x53')){var _0x41f904=_0x227c9c['get']({'plain':!![]});var _0x4df2b7=[{'name':'InboundRoutes','value':_0xc477('0x23')},{'name':_0xc477('0x24'),'value':_0xc477('0x25')},{'name':_0xc477('0x26'),'value':_0xc477('0x27')}];var _0x7f9011=_[_0xc477('0x2b')](_0x4df2b7,[_0xc477('0x2a'),_0x41f904['type']])['name'];return db[_0xc477('0x54')][_0xc477('0x2b')]({'where':{'name':_0x7f9011,'userProfileId':_0x4f56d3['userProfileId']},'raw':!![]})[_0xc477('0x1f')](function(_0xb33c95){if(_0xb33c95&&_0xb33c95[_0xc477('0x55')]===0x0){return db['UserProfileResource'][_0xc477('0x4c')]({'name':_0x41f904['name'],'resourceId':_0x41f904['id'],'type':_0xb33c95['name'],'sectionId':_0xb33c95['id']},{})[_0xc477('0x1f')](function(){return _0x227c9c;});}else{return _0x227c9c;}})[_0xc477('0x48')](function(_0x170913){logger[_0xc477('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x170913);throw _0x170913;});}return _0x227c9c;})['then'](respondWithResult(_0x7642e9,0xc9))[_0xc477('0x48')](handleError(_0x7642e9,null));};exports[_0xc477('0x1e')]=function(_0x38a651,_0x5b1c53){if(_0x38a651[_0xc477('0x4e')]['id']){delete _0x38a651['body']['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x38a651['params']['id']}})['then'](handleEntityNotFound(_0x5b1c53,null))[_0xc477('0x1f')](function(_0x16adff){if(_0x16adff){return db[_0xc477('0x33')][_0xc477('0x1e')](_['pick'](_0x38a651[_0xc477('0x4e')],['exten',_0xc477('0x56'),'description',_0xc477('0x57'),'cutdigits',_0xc477('0x58')]),{'where':{'context':_0x16adff['context'],'exten':_0x16adff[_0xc477('0x4f')]},'individualHooks':!![]})[_0xc477('0x1f')](function(_0x180603){return _0x180603;});}return null;})['then'](respondWithStatusCode(_0x5b1c53,null))['catch'](handleError(_0x5b1c53,null));};exports[_0xc477('0x59')]=function(_0x1ca30f,_0x2b57a7,_0x29ea68){return db[_0xc477('0x33')][_0xc477('0x5a')]({'where':{'id':_0x1ca30f['params']['id']}})['then'](handleEntityNotFound(_0x2b57a7,null))['then'](function(_0x1e4178){if(_0x1e4178){return db['sequelize']['transaction'](function(_0x20879a){return db[_0xc477('0x33')][_0xc477('0x20')]({'where':{'VoiceExtensionId':_0x1ca30f[_0xc477('0x49')]['id']},'transaction':_0x20879a})[_0xc477('0x1f')](function(_0x4a7a3d){var _0x1438f8=_[_0xc477('0x29')](_0x1ca30f[_0xc477('0x4e')],function(_0x2890db){_0x2890db[_0xc477('0x5b')]=_0x1ca30f[_0xc477('0x49')]['id'];return _0x2890db;});return db[_0xc477('0x33')][_0xc477('0x5c')](_0x1438f8,{'transaction':_0x20879a});});})[_0xc477('0x1f')](function(){return db['VoiceExtension'][_0xc477('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1ca30f[_0xc477('0x49')]['id']},'order':_0xc477('0x5e')});});}})['then'](respondWithResult(_0x2b57a7,null))[_0xc477('0x48')](handleError(_0x2b57a7,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 4cff66c..ad26f2d 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 _0x1046=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','VoiceExtension'];(function(_0x4d2ec0,_0x19b2fd){var _0x5781d1=function(_0x2223c5){while(--_0x2223c5){_0x4d2ec0['push'](_0x4d2ec0['shift']());}};_0x5781d1(++_0x19b2fd);}(_0x1046,0x134));var _0x6104=function(_0x4146b5,_0x4d1369){_0x4146b5=_0x4146b5-0x0;var _0x2dc4c6=_0x1046[_0x4146b5];return _0x2dc4c6;};'use strict';var EventEmitter=require(_0x6104('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x6104('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6104('0x2')](0x0);var events={'afterCreate':_0x6104('0x3'),'afterUpdate':_0x6104('0x4'),'afterDestroy':_0x6104('0x5')};function emitEvent(_0x4cecb8){return function(_0x10cfb0,_0x27ee1f,_0xaee2e1){VoiceExtensionEvents[_0x6104('0x6')](_0x4cecb8+':'+_0x10cfb0['id'],_0x10cfb0);VoiceExtensionEvents['emit'](_0x4cecb8,_0x10cfb0);_0xaee2e1(null);};}for(var e in events){if(events[_0x6104('0x7')](e)){var event=events[e];VoiceExtension[_0x6104('0x8')](e,emitEvent(event));}}module[_0x6104('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xfdbf=['exports','events','../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xe6bd52,_0x4d0727){var _0x57f8c1=function(_0x248a72){while(--_0x248a72){_0xe6bd52['push'](_0xe6bd52['shift']());}};_0x57f8c1(++_0x4d0727);}(_0xfdbf,0xb5));var _0xffdb=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0xfdbf[_0x1aba25];return _0x47d997;};'use strict';var EventEmitter=require(_0xffdb('0x0'));var VoiceExtension=require(_0xffdb('0x1'))['db'][_0xffdb('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xffdb('0x3'),'afterUpdate':_0xffdb('0x4'),'afterDestroy':_0xffdb('0x5')};function emitEvent(_0x117996){return function(_0x4e10cf,_0x185789,_0x5dd209){VoiceExtensionEvents[_0xffdb('0x6')](_0x117996+':'+_0x4e10cf['id'],_0x4e10cf);VoiceExtensionEvents[_0xffdb('0x6')](_0x117996,_0x4e10cf);_0x5dd209(null);};}for(var e in events){if(events[_0xffdb('0x7')](e)){var event=events[e];VoiceExtension[_0xffdb('0x8')](e,emitEvent(event));}}module[_0xffdb('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 080c513..a99f0a6 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 _0x160f=['VoiceExtension','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x544966,_0x318846){var _0x64c101=function(_0x2b82b0){while(--_0x2b82b0){_0x544966['push'](_0x544966['shift']());}};_0x64c101(++_0x318846);}(_0x160f,0x83));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf160('0x0'));var logger=require(_0xf160('0x1'))(_0xf160('0x2'));var moment=require(_0xf160('0x3'));var BPromise=require('bluebird');var rp=require(_0xf160('0x4'));var fs=require('fs');var path=require(_0xf160('0x5'));var rimraf=require(_0xf160('0x6'));var config=require(_0xf160('0x7'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x47a3f5,_0x118354){return _0x47a3f5[_0xf160('0x8')](_0xf160('0x9'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb680=['rimraf','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3d6f85,_0x333119){var _0x83afdd=function(_0x4bc53d){while(--_0x4bc53d){_0x3d6f85['push'](_0x3d6f85['shift']());}};_0x83afdd(++_0x333119);}(_0xb680,0x157));var _0x0b68=function(_0x5b1d80,_0x4230ba){_0x5b1d80=_0x5b1d80-0x0;var _0x4f344c=_0xb680[_0x5b1d80];return _0x4f344c;};'use strict';var _=require(_0x0b68('0x0'));var util=require(_0x0b68('0x1'));var logger=require(_0x0b68('0x2'))(_0x0b68('0x3'));var moment=require(_0x0b68('0x4'));var BPromise=require(_0x0b68('0x5'));var rp=require(_0x0b68('0x6'));var fs=require('fs');var path=require(_0x0b68('0x7'));var rimraf=require(_0x0b68('0x8'));var config=require('../../config/environment');var attributes=require(_0x0b68('0x9'));module[_0x0b68('0xa')]=function(_0xce98ce,_0x1d551e){return _0xce98ce['define'](_0x0b68('0xb'),attributes,{'tableName':_0x0b68('0xc'),'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 fa5dc0b..c223892 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 _0xffe6=['catch','findAll','options','raw','limit','include','attributes','map','model','lodash','moment','ioredis','../../config/utils','rpc','../../config/environment','http','redis','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','VoiceExtension,\x20%s,\x20%s','result'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xffe6,0x10e));var _0x6ffe=function(_0x4950d2,_0x4cdbb9){_0x4950d2=_0x4950d2-0x0;var _0x56e2ce=_0xffe6[_0x4950d2];return _0x56e2ce;};'use strict';var _=require(_0x6ffe('0x0'));var util=require('util');var moment=require(_0x6ffe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffe('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ffe('0x3'));var logger=require('../../config/logger')(_0x6ffe('0x4'));var config=require(_0x6ffe('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6ffe('0x6')]({'port':0x232a});config[_0x6ffe('0x7')]=_['defaults'](config[_0x6ffe('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ffe('0x7')]));require(_0x6ffe('0x8'))[_0x6ffe('0x9')](socket);function respondWithRpcPromise(_0x43ee67,_0xe390bd,_0x89b041){return new BPromise(function(_0x4d09c2,_0x1f0ec5){return client[_0x6ffe('0xa')](_0x43ee67,_0x89b041)[_0x6ffe('0xb')](function(_0x3d25bb){logger[_0x6ffe('0xc')]('VoiceExtension,\x20%s,\x20%s',_0xe390bd,_0x6ffe('0xd'));logger[_0x6ffe('0xe')](_0x6ffe('0xf'),_0xe390bd,_0x6ffe('0xd'),JSON['stringify'](_0x3d25bb));if(_0x3d25bb[_0x6ffe('0x10')]){if(_0x3d25bb[_0x6ffe('0x10')]['code']===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0xe390bd,_0x3d25bb[_0x6ffe('0x10')][_0x6ffe('0x11')]);return _0x1f0ec5(_0x3d25bb[_0x6ffe('0x10')][_0x6ffe('0x11')]);}logger[_0x6ffe('0x10')](_0x6ffe('0x12'),_0xe390bd,_0x3d25bb[_0x6ffe('0x10')][_0x6ffe('0x11')]);return _0x4d09c2(_0x3d25bb[_0x6ffe('0x10')]['message']);}else{logger['info'](_0x6ffe('0x12'),_0xe390bd,'request\x20sent');_0x4d09c2(_0x3d25bb[_0x6ffe('0x13')][_0x6ffe('0x11')]);}})[_0x6ffe('0x14')](function(_0x59938c){logger[_0x6ffe('0x10')]('VoiceExtension,\x20%s,\x20%s',_0xe390bd,_0x59938c);_0x1f0ec5(_0x59938c);});});}exports['GetVoiceExtension']=function(_0x3662cd){var _0x1605cc=this;return new Promise(function(_0x1384c7,_0x5b7642){return db['VoiceExtension'][_0x6ffe('0x15')]({'raw':_0x3662cd[_0x6ffe('0x16')]?_0x3662cd[_0x6ffe('0x16')][_0x6ffe('0x17')]===undefined?!![]:![]:!![],'where':_0x3662cd[_0x6ffe('0x16')]?_0x3662cd[_0x6ffe('0x16')]['where']||null:null,'attributes':_0x3662cd[_0x6ffe('0x16')]?_0x3662cd['options']['attributes']||null:null,'limit':_0x3662cd[_0x6ffe('0x16')]?_0x3662cd['options'][_0x6ffe('0x18')]||null:null,'include':_0x3662cd[_0x6ffe('0x16')]?_0x3662cd[_0x6ffe('0x16')]['include']?_['map'](_0x3662cd['options'][_0x6ffe('0x19')],function(_0x1354eb){return{'model':db[_0x1354eb['model']],'as':_0x1354eb['as'],'attributes':_0x1354eb[_0x6ffe('0x1a')],'include':_0x1354eb['include']?_[_0x6ffe('0x1b')](_0x1354eb[_0x6ffe('0x19')],function(_0x3d2507){return{'model':db[_0x3d2507[_0x6ffe('0x1c')]],'as':_0x3d2507['as'],'attributes':_0x3d2507['attributes'],'include':_0x3d2507['include']?_['map'](_0x3d2507[_0x6ffe('0x19')],function(_0x3c567a){return{'model':db[_0x3c567a[_0x6ffe('0x1c')]],'as':_0x3c567a['as'],'attributes':_0x3c567a[_0x6ffe('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34df65){logger[_0x6ffe('0xc')]('GetVoiceExtension',_0x3662cd);logger[_0x6ffe('0xe')]('GetVoiceExtension',_0x3662cd,JSON['stringify'](_0x34df65));_0x1384c7(_0x34df65);})[_0x6ffe('0x14')](function(_0x947795){logger[_0x6ffe('0x10')]('GetVoiceExtension',_0x947795[_0x6ffe('0x11')],_0x3662cd);_0x5b7642(_0x1605cc[_0x6ffe('0x10')](0x1f4,_0x947795[_0x6ffe('0x11')]));});});}; \ No newline at end of file +var _0xede6=['rpc','../../config/environment','client','http','redis','defaults','localhost','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','limit','include','map','attributes','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1d3a2b,_0x4f242d){var _0x132431=function(_0x44a46f){while(--_0x44a46f){_0x1d3a2b['push'](_0x1d3a2b['shift']());}};_0x132431(++_0x4f242d);}(_0xede6,0xdb));var _0x6ede=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xede6[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x6ede('0x0'));var util=require(_0x6ede('0x1'));var moment=require(_0x6ede('0x2'));var BPromise=require(_0x6ede('0x3'));var rs=require(_0x6ede('0x4'));var fs=require('fs');var Redis=require(_0x6ede('0x5'));var db=require(_0x6ede('0x6'))['db'];var utils=require(_0x6ede('0x7'));var logger=require(_0x6ede('0x8'))(_0x6ede('0x9'));var config=require(_0x6ede('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6ede('0xb')][_0x6ede('0xc')]({'port':0x232a});config[_0x6ede('0xd')]=_[_0x6ede('0xe')](config[_0x6ede('0xd')],{'host':_0x6ede('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ede('0xd')]));require(_0x6ede('0x10'))['register'](socket);function respondWithRpcPromise(_0x29874a,_0x195cb8,_0x57d020){return new BPromise(function(_0x31a8d6,_0xdcbe89){return client[_0x6ede('0x11')](_0x29874a,_0x57d020)[_0x6ede('0x12')](function(_0x58092a){logger[_0x6ede('0x13')](_0x6ede('0x14'),_0x195cb8,_0x6ede('0x15'));logger[_0x6ede('0x16')](_0x6ede('0x17'),_0x195cb8,_0x6ede('0x15'),JSON[_0x6ede('0x18')](_0x58092a));if(_0x58092a[_0x6ede('0x19')]){if(_0x58092a[_0x6ede('0x19')]['code']===0x1f4){logger['error'](_0x6ede('0x14'),_0x195cb8,_0x58092a[_0x6ede('0x19')]['message']);return _0xdcbe89(_0x58092a[_0x6ede('0x19')]['message']);}logger[_0x6ede('0x19')](_0x6ede('0x14'),_0x195cb8,_0x58092a[_0x6ede('0x19')]['message']);return _0x31a8d6(_0x58092a[_0x6ede('0x19')][_0x6ede('0x1a')]);}else{logger[_0x6ede('0x13')](_0x6ede('0x14'),_0x195cb8,_0x6ede('0x15'));_0x31a8d6(_0x58092a['result'][_0x6ede('0x1a')]);}})[_0x6ede('0x1b')](function(_0x1b4a7a){logger[_0x6ede('0x19')](_0x6ede('0x14'),_0x195cb8,_0x1b4a7a);_0xdcbe89(_0x1b4a7a);});});}exports[_0x6ede('0x1c')]=function(_0x383971){var _0x177275=this;return new Promise(function(_0x1320ed,_0x19930c){return db[_0x6ede('0x1d')][_0x6ede('0x1e')]({'raw':_0x383971[_0x6ede('0x1f')]?_0x383971[_0x6ede('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x383971[_0x6ede('0x1f')]?_0x383971[_0x6ede('0x1f')][_0x6ede('0x20')]||null:null,'attributes':_0x383971[_0x6ede('0x1f')]?_0x383971[_0x6ede('0x1f')]['attributes']||null:null,'limit':_0x383971[_0x6ede('0x1f')]?_0x383971[_0x6ede('0x1f')][_0x6ede('0x21')]||null:null,'include':_0x383971['options']?_0x383971[_0x6ede('0x1f')][_0x6ede('0x22')]?_[_0x6ede('0x23')](_0x383971[_0x6ede('0x1f')][_0x6ede('0x22')],function(_0x2ef1f6){return{'model':db[_0x2ef1f6['model']],'as':_0x2ef1f6['as'],'attributes':_0x2ef1f6[_0x6ede('0x24')],'include':_0x2ef1f6['include']?_[_0x6ede('0x23')](_0x2ef1f6['include'],function(_0x51903f){return{'model':db[_0x51903f[_0x6ede('0x25')]],'as':_0x51903f['as'],'attributes':_0x51903f['attributes'],'include':_0x51903f[_0x6ede('0x22')]?_[_0x6ede('0x23')](_0x51903f[_0x6ede('0x22')],function(_0x5825c8){return{'model':db[_0x5825c8['model']],'as':_0x5825c8['as'],'attributes':_0x5825c8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ede('0x12')](function(_0x4e5978){logger[_0x6ede('0x13')]('GetVoiceExtension',_0x383971);logger[_0x6ede('0x16')](_0x6ede('0x1c'),_0x383971,JSON[_0x6ede('0x18')](_0x4e5978));_0x1320ed(_0x4e5978);})[_0x6ede('0x1b')](function(_0x3bdc42){logger['error'](_0x6ede('0x1c'),_0x3bdc42[_0x6ede('0x1a')],_0x383971);_0x19930c(_0x177275[_0x6ede('0x19')](0x1f4,_0x3bdc42[_0x6ede('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 4ecf796..aaf896c 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 _0xd929=['removeListener','length','voiceExtension:','save','remove','update'];(function(_0x29f236,_0x25c7cb){var _0x133405=function(_0x3d6180){while(--_0x3d6180){_0x29f236['push'](_0x29f236['shift']());}};_0x133405(++_0x25c7cb);}(_0xd929,0x11d));var _0x9d92=function(_0x16c967,_0x48fa6f){_0x16c967=_0x16c967-0x0;var _0x3f9024=_0xd929[_0x16c967];return _0x3f9024;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x9d92('0x0'),_0x9d92('0x1'),_0x9d92('0x2')];function createListener(_0x4c8abc,_0x588651){return function(_0x26abc6){_0x588651['emit'](_0x4c8abc,_0x26abc6);};}function removeListener(_0x5244c1,_0x400d29){return function(){VoiceExtensionEvents[_0x9d92('0x3')](_0x5244c1,_0x400d29);};}exports['register']=function(_0x4e7698){for(var _0x2e7b31=0x0,_0x41d899=events[_0x9d92('0x4')];_0x2e7b31<_0x41d899;_0x2e7b31++){var _0x18249=events[_0x2e7b31];var _0x33f1d3=createListener(_0x9d92('0x5')+_0x18249,_0x4e7698);VoiceExtensionEvents['on'](_0x18249,_0x33f1d3);}}; \ No newline at end of file +var _0x4662=['./voiceExtension.events','save','update','removeListener','length','voiceExtension:'];(function(_0x12f31d,_0x786565){var _0x4e5c4d=function(_0x5880df){while(--_0x5880df){_0x12f31d['push'](_0x12f31d['shift']());}};_0x4e5c4d(++_0x786565);}(_0x4662,0x192));var _0x2466=function(_0x12fee9,_0x4c300c){_0x12fee9=_0x12fee9-0x0;var _0x5ed7b3=_0x4662[_0x12fee9];return _0x5ed7b3;};'use strict';var VoiceExtensionEvents=require(_0x2466('0x0'));var events=[_0x2466('0x1'),'remove',_0x2466('0x2')];function createListener(_0x52e580,_0x56f2fc){return function(_0x42185b){_0x56f2fc['emit'](_0x52e580,_0x42185b);};}function removeListener(_0x31663b,_0x234d0e){return function(){VoiceExtensionEvents[_0x2466('0x3')](_0x31663b,_0x234d0e);};}exports['register']=function(_0x467bb1){for(var _0x51b0a5=0x0,_0x26df99=events[_0x2466('0x4')];_0x51b0a5<_0x26df99;_0x51b0a5++){var _0x2aadae=events[_0x51b0a5];var _0x325ee2=createListener(_0x2466('0x5')+_0x2aadae,_0x467bb1);VoiceExtensionEvents['on'](_0x2aadae,_0x325ee2);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index d219e37..6393f0c 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 _0x7593=['/:id','show','get','/:id/messages','isAuthenticated','getMessages','put','update','delete','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','index'];(function(_0x38072f,_0x54ebf8){var _0x577424=function(_0x57a732){while(--_0x57a732){_0x38072f['push'](_0x38072f['shift']());}};_0x577424(++_0x54ebf8);}(_0x7593,0x14d));var _0x3759=function(_0x40197b,_0x4e763f){_0x40197b=_0x40197b-0x0;var _0x3b9c2f=_0x7593[_0x40197b];return _0x3b9c2f;};'use strict';var multer=require(_0x3759('0x0'));var util=require(_0x3759('0x1'));var path=require(_0x3759('0x2'));var timeout=require(_0x3759('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3759('0x4'));var config=require(_0x3759('0x5'));var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3759('0x6')]);router['get'](_0x3759('0x7'),auth['isAuthenticated'](),controller[_0x3759('0x8')]);router[_0x3759('0x9')](_0x3759('0xa'),auth[_0x3759('0xb')](),controller[_0x3759('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3759('0xd')](_0x3759('0x7'),auth[_0x3759('0xb')](),controller[_0x3759('0xe')]);router[_0x3759('0xf')](_0x3759('0x7'),auth[_0x3759('0xb')](),controller['destroy']);module[_0x3759('0x10')]=router; \ No newline at end of file +var _0xb05d=['./voiceMail.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','create','put','update','/:id','destroy','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x30b612,_0x201d65){var _0x17e0fd=function(_0x603a54){while(--_0x603a54){_0x30b612['push'](_0x30b612['shift']());}};_0x17e0fd(++_0x201d65);}(_0xb05d,0x187));var _0xdb05=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0xb05d[_0x549278];return _0x1ea9a1;};'use strict';var multer=require(_0xdb05('0x0'));var util=require('util');var path=require(_0xdb05('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb05('0x2'));var router=express[_0xdb05('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xdb05('0x4'));var config=require('../../config/environment');var controller=require(_0xdb05('0x5'));router[_0xdb05('0x6')]('/',auth[_0xdb05('0x7')](),controller[_0xdb05('0x8')]);router[_0xdb05('0x6')]('/:id',auth[_0xdb05('0x7')](),controller[_0xdb05('0x9')]);router[_0xdb05('0x6')](_0xdb05('0xa'),auth[_0xdb05('0x7')](),controller[_0xdb05('0xb')]);router['post']('/',auth[_0xdb05('0x7')](),controller[_0xdb05('0xc')]);router[_0xdb05('0xd')]('/:id',auth[_0xdb05('0x7')](),controller[_0xdb05('0xe')]);router['delete'](_0xdb05('0xf'),auth['isAuthenticated'](),controller[_0xdb05('0x10')]);module[_0xdb05('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 5e346f9..9e57198 100644 --- a/server/api/voiceMail/voiceMail.attributes.js +++ b/server/api/voiceMail/voiceMail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13f6=['getDataValue','fullname','\x20-\x20','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x4dfd8a,_0x476a02){var _0x5aeac9=function(_0x3aa276){while(--_0x3aa276){_0x4dfd8a['push'](_0x4dfd8a['shift']());}};_0x5aeac9(++_0x476a02);}(_0x13f6,0x124));var _0x613f=function(_0x8fdcec,_0x7d4bd1){_0x8fdcec=_0x8fdcec-0x0;var _0x3796f2=_0x13f6[_0x8fdcec];return _0x3796f2;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x613f('0x2'),'unique':_0x613f('0x3')},'mailbox':{'type':Sequelize[_0x613f('0x4')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x613f('0x4')]},'fullname':{'type':Sequelize[_0x613f('0x4')]},'email':{'type':Sequelize[_0x613f('0x4')],'validate':{'isEmail':!![]},'set':function(_0x5c9aa9){this[_0x613f('0x5')](_0x613f('0x6'),typeof _0x5c9aa9==='string'&&_0x5c9aa9['trim']()?_0x5c9aa9['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x613f('0x4')],'defaultValue':_0x613f('0x7')},'attach':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':_0x613f('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x613f('0x4')]},'review':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x613f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x613f('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':_0x613f('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x613f('0x9'),'allowNull':![]},'stamp':{'type':_0x613f('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x613f('0x4')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x613f('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x613f('0xd')],'get':function(){return this[_0x613f('0xe')](_0x613f('0xf'))+_0x613f('0x10')+this[_0x613f('0xe')]('mailbox');}}}; \ No newline at end of file +var _0xf7b4=['from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','sequelize','STRING'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xf7b4,0x152));var _0x4f7b=function(_0x173e58,_0x248ab0){_0x173e58=_0x173e58-0x0;var _0xbc3f05=_0xf7b4[_0x173e58];return _0xbc3f05;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4f7b('0x1')],'defaultValue':_0x4f7b('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x4f7b('0x3')},'password':{'type':Sequelize[_0x4f7b('0x1')]},'fullname':{'type':Sequelize[_0x4f7b('0x1')]},'email':{'type':Sequelize[_0x4f7b('0x1')],'validate':{'isEmail':!![]},'set':function(_0xc39829){this[_0x4f7b('0x4')](_0x4f7b('0x5'),typeof _0xc39829===_0x4f7b('0x6')&&_0xc39829[_0x4f7b('0x7')]()?_0xc39829[_0x4f7b('0x7')]():null);}},'pager':{'type':Sequelize[_0x4f7b('0x1')]},'tz':{'type':Sequelize[_0x4f7b('0x1')],'defaultValue':_0x4f7b('0x8')},'attach':{'type':Sequelize['ENUM'](_0x4f7b('0x9'),'no'),'defaultValue':_0x4f7b('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x4f7b('0x9'),'no'),'defaultValue':_0x4f7b('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4f7b('0x1')]},'callback':{'type':Sequelize[_0x4f7b('0x1')]},'review':{'type':Sequelize[_0x4f7b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4f7b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x4f7b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4f7b('0xa')](_0x4f7b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4f7b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4f7b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4f7b('0xa')](_0x4f7b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4f7b('0xa')](_0x4f7b('0x9'),'no'),'defaultValue':_0x4f7b('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4f7b('0xa')](_0x4f7b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4f7b('0xa')](_0x4f7b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4f7b('0xa')](_0x4f7b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x4f7b('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x4f7b('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4f7b('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4f7b('0xe')](_0x4f7b('0xf'))+_0x4f7b('0x10')+this[_0x4f7b('0xe')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 011181f..7f77512 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 _0xf72b=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','json','apply','reject','save','update','then','get','Voicemails','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','body','VoiceMailMessage','nolimit','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf72b,0x1d9));var _0xbf72=function(_0x5abdb6,_0x67a810){_0x5abdb6=_0x5abdb6-0x0;var _0x583b55=_0xf72b[_0x5abdb6];return _0x583b55;};'use strict';var pdf=require(_0xbf72('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbf72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf72('0x2'));var rp=require(_0xbf72('0x3'));var moment=require('moment');var BPromise=require(_0xbf72('0x4'));var Mustache=require(_0xbf72('0x5'));var util=require(_0xbf72('0x6'));var path=require(_0xbf72('0x7'));var sox=require(_0xbf72('0x8'));var csv=require(_0xbf72('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbf72('0xa'));var squel=require(_0xbf72('0xb'));var crypto=require(_0xbf72('0xc'));var jsforce=require(_0xbf72('0xd'));var deskjs=require(_0xbf72('0xe'));var toCsv=require(_0xbf72('0x9'));var querystring=require('querystring');var Papa=require(_0xbf72('0xf'));var Redis=require('ioredis');var authService=require(_0xbf72('0x10'));var qs=require(_0xbf72('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf72('0x12'));var logger=require(_0xbf72('0x13'))(_0xbf72('0x14'));var utils=require(_0xbf72('0x15'));var config=require(_0xbf72('0x16'));var db=require(_0xbf72('0x17'))['db'];function respondWithStatusCode(_0x14f6e6,_0x5eb4cc){_0x5eb4cc=_0x5eb4cc||0xcc;return function(_0x5967f5){if(_0x5967f5){return _0x14f6e6[_0xbf72('0x18')](_0x5eb4cc);}return _0x14f6e6[_0xbf72('0x19')](_0x5eb4cc)[_0xbf72('0x1a')]();};}function respondWithResult(_0x5d8c85,_0x25255e){_0x25255e=_0x25255e||0xc8;return function(_0x4f4fa5){if(_0x4f4fa5){return _0x5d8c85['status'](_0x25255e)['json'](_0x4f4fa5);}};}function respondWithFilteredResult(_0x32a0a5,_0xb96906){return function(_0x3af48d){if(_0x3af48d){var _0x723eb1=_0x3af48d[_0xbf72('0x1b')],_0x39d0cd=_0xb96906[_0xbf72('0x1c')],_0x160d61=_0xb96906[_0xbf72('0x1c')]+_0xb96906[_0xbf72('0x1d')],_0x566075;if(_0x160d61>=_0x723eb1){_0x160d61=_0x723eb1;_0x566075=0xc8;}else{_0x566075=0xce;}_0x32a0a5[_0xbf72('0x19')](_0x566075);return _0x32a0a5['set']('Content-Range',_0x39d0cd+'-'+_0x160d61+'/'+_0x723eb1)[_0xbf72('0x1e')](_0x3af48d);}return null;};}function patchUpdates(_0x9dbb0c){return function(_0x14ac5c){try{jsonpatch[_0xbf72('0x1f')](_0x14ac5c,_0x9dbb0c,!![]);}catch(_0x27e58e){return BPromise[_0xbf72('0x20')](_0x27e58e);}return _0x14ac5c[_0xbf72('0x21')]();};}function saveUpdates(_0x4d7922,_0x2aecae){return function(_0x42a193){if(_0x42a193){return _0x42a193[_0xbf72('0x22')](_0x4d7922)[_0xbf72('0x23')](function(_0x3486f3){return _0x3486f3;});}return null;};}function removeEntity(_0x5f2537,_0x3cd181){return function(_0x1de926){if(_0x1de926){return _0x1de926['destroy']()[_0xbf72('0x23')](function(){var _0x44c72f=_0x1de926[_0xbf72('0x24')]({'plain':!![]});var _0x4c7f3d=_0xbf72('0x25');return db[_0xbf72('0x26')][_0xbf72('0x27')]({'where':{'type':_0x4c7f3d,'resourceId':_0x44c72f['id']}})[_0xbf72('0x23')](function(){return _0x1de926;});})['then'](function(){_0x5f2537[_0xbf72('0x19')](0xcc)[_0xbf72('0x1a')]();});}};}function handleEntityNotFound(_0x1c8b8b,_0x54fdfe){return function(_0x3b3171){if(!_0x3b3171){_0x1c8b8b[_0xbf72('0x18')](0x194);}return _0x3b3171;};}function handleError(_0x3df816,_0x1a2f55){_0x1a2f55=_0x1a2f55||0x1f4;return function(_0x15d60d){logger[_0xbf72('0x28')](_0x15d60d[_0xbf72('0x29')]);if(_0x15d60d[_0xbf72('0x2a')]){delete _0x15d60d[_0xbf72('0x2a')];}_0x3df816[_0xbf72('0x19')](_0x1a2f55)[_0xbf72('0x2b')](_0x15d60d);};}exports[_0xbf72('0x2c')]=function(_0x4a6ccf,_0xb648f2){var _0x37a233={},_0x51f481={},_0x708fcb={'count':0x0,'rows':[]};var _0x475a54=_[_0xbf72('0x2d')](db[_0xbf72('0x2e')][_0xbf72('0x2f')],function(_0x82c0f0){return{'name':_0x82c0f0[_0xbf72('0x30')],'type':_0x82c0f0[_0xbf72('0x31')][_0xbf72('0x32')]};});_0x51f481[_0xbf72('0x33')]=_[_0xbf72('0x2d')](_0x475a54,_0xbf72('0x2a'));_0x51f481[_0xbf72('0x34')]=_[_0xbf72('0x35')](_0x4a6ccf['query']);_0x51f481[_0xbf72('0x36')]=_[_0xbf72('0x37')](_0x51f481[_0xbf72('0x33')],_0x51f481['query']);_0x37a233['attributes']=_['intersection'](_0x51f481[_0xbf72('0x33')],qs[_0xbf72('0x38')](_0x4a6ccf[_0xbf72('0x34')]['fields']));_0x37a233[_0xbf72('0x39')]=_0x37a233[_0xbf72('0x39')]['length']?_0x37a233[_0xbf72('0x39')]:_0x51f481['model'];if(!_0x4a6ccf[_0xbf72('0x34')][_0xbf72('0x3a')]('nolimit')){_0x37a233['limit']=qs[_0xbf72('0x1d')](_0x4a6ccf[_0xbf72('0x34')][_0xbf72('0x1d')]);_0x37a233[_0xbf72('0x1c')]=qs[_0xbf72('0x1c')](_0x4a6ccf[_0xbf72('0x34')][_0xbf72('0x1c')]);}_0x37a233[_0xbf72('0x3b')]=qs[_0xbf72('0x3c')](_0x4a6ccf['query'][_0xbf72('0x3c')]);_0x37a233[_0xbf72('0x3d')]=qs[_0xbf72('0x36')](_[_0xbf72('0x3e')](_0x4a6ccf['query'],_0x51f481[_0xbf72('0x36')]));if(_0x4a6ccf[_0xbf72('0x34')]['filter']){_0x37a233[_0xbf72('0x3d')]=_['merge'](_0x37a233['where'],{'$or':_['map'](_0x475a54,function(_0x49c4d7){if(_0x49c4d7[_0xbf72('0x31')]!=='VIRTUAL'){var _0x5e6749={};_0x5e6749[_0x49c4d7[_0xbf72('0x2a')]]={'$like':'%'+_0x4a6ccf['query'][_0xbf72('0x3f')]+'%'};return _0x5e6749;}})});}_0x37a233=_[_0xbf72('0x40')]({},_0x37a233,_0x4a6ccf['options']);var _0x2276d0={'where':_0x37a233['where']};return db['VoiceMail'][_0xbf72('0x1b')](_0x2276d0)[_0xbf72('0x23')](function(_0x40a4f1){_0x708fcb[_0xbf72('0x1b')]=_0x40a4f1;if(_0x4a6ccf[_0xbf72('0x34')][_0xbf72('0x41')]){_0x37a233[_0xbf72('0x42')]=[{'all':!![]}];}return db[_0xbf72('0x2e')]['findAll'](_0x37a233);})[_0xbf72('0x23')](function(_0x3831b9){_0x708fcb['rows']=_0x3831b9;return _0x708fcb;})[_0xbf72('0x23')](respondWithFilteredResult(_0xb648f2,_0x37a233))['catch'](handleError(_0xb648f2,null));};exports['show']=function(_0x396ff7,_0x15e4c7){var _0x3992fd={'raw':!![],'where':{'id':_0x396ff7[_0xbf72('0x43')]['id']}},_0x34d014={};_0x34d014['model']=_['keys'](db['VoiceMail'][_0xbf72('0x2f')]);_0x34d014[_0xbf72('0x34')]=_[_0xbf72('0x35')](_0x396ff7[_0xbf72('0x34')]);_0x34d014['filters']=_['intersection'](_0x34d014[_0xbf72('0x33')],_0x34d014['query']);_0x3992fd[_0xbf72('0x39')]=_[_0xbf72('0x37')](_0x34d014[_0xbf72('0x33')],qs[_0xbf72('0x38')](_0x396ff7['query'][_0xbf72('0x38')]));_0x3992fd[_0xbf72('0x39')]=_0x3992fd[_0xbf72('0x39')][_0xbf72('0x44')]?_0x3992fd['attributes']:_0x34d014[_0xbf72('0x33')];if(_0x396ff7[_0xbf72('0x34')]['includeAll']){_0x3992fd[_0xbf72('0x42')]=[{'all':!![]}];}_0x3992fd=_[_0xbf72('0x40')]({},_0x3992fd,_0x396ff7[_0xbf72('0x45')]);return db[_0xbf72('0x2e')][_0xbf72('0x46')](_0x3992fd)[_0xbf72('0x23')](handleEntityNotFound(_0x15e4c7,null))[_0xbf72('0x23')](respondWithResult(_0x15e4c7,null))['catch'](handleError(_0x15e4c7,null));};exports['create']=function(_0x5b4bbb,_0x3bd313){return db['VoiceMail'][_0xbf72('0x47')](_0x5b4bbb['body'],{})['then'](function(_0x4b3b02){var _0x9f94ea=_0x5b4bbb[_0xbf72('0x48')][_0xbf72('0x24')]({'plain':!![]});if(!_0x9f94ea)throw new Error(_0xbf72('0x49'));if(_0x9f94ea[_0xbf72('0x4a')]===_0xbf72('0x48')){var _0x530663=_0x4b3b02[_0xbf72('0x24')]({'plain':!![]});var _0x5e2dab=_0xbf72('0x25');return db['UserProfileSection'][_0xbf72('0x46')]({'where':{'name':_0x5e2dab,'userProfileId':_0x9f94ea[_0xbf72('0x4b')]},'raw':!![]})[_0xbf72('0x23')](function(_0x1fd1f8){if(_0x1fd1f8&&_0x1fd1f8[_0xbf72('0x4c')]===0x0){return db[_0xbf72('0x26')][_0xbf72('0x47')]({'name':_0x530663[_0xbf72('0x2a')],'resourceId':_0x530663['id'],'type':_0x1fd1f8[_0xbf72('0x2a')],'sectionId':_0x1fd1f8['id']},{})['then'](function(){return _0x4b3b02;});}else{return _0x4b3b02;}})[_0xbf72('0x4d')](function(_0x2f9816){logger[_0xbf72('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f9816);throw _0x2f9816;});}return _0x4b3b02;})[_0xbf72('0x23')](respondWithResult(_0x3bd313,0xc9))[_0xbf72('0x4d')](handleError(_0x3bd313,null));};exports[_0xbf72('0x22')]=function(_0x462075,_0x824918){if(_0x462075['body']['id']){delete _0x462075[_0xbf72('0x4e')]['id'];}return db[_0xbf72('0x2e')]['find']({'where':{'id':_0x462075[_0xbf72('0x43')]['id']}})['then'](handleEntityNotFound(_0x824918,null))['then'](saveUpdates(_0x462075[_0xbf72('0x4e')],null))[_0xbf72('0x23')](respondWithResult(_0x824918,null))[_0xbf72('0x4d')](handleError(_0x824918,null));};exports[_0xbf72('0x27')]=function(_0x2da903,_0x527061){return db['VoiceMail']['find']({'where':{'id':_0x2da903[_0xbf72('0x43')]['id']}})[_0xbf72('0x23')](handleEntityNotFound(_0x527061,null))[_0xbf72('0x23')](removeEntity(_0x527061,null))[_0xbf72('0x4d')](handleError(_0x527061,null));};exports['getMessages']=function(_0x5e2f01,_0x1fcf3b,_0x18ecf7){return db[_0xbf72('0x2e')]['findOne']({'where':{'id':_0x5e2f01[_0xbf72('0x43')]['id']}})['then'](handleEntityNotFound(_0x1fcf3b,null))[_0xbf72('0x23')](function(_0x3da80c){var _0x5718ab;var _0x2b3c34={},_0x441908={};_0x441908['model']=_[_0xbf72('0x35')](db[_0xbf72('0x4f')][_0xbf72('0x2f')]);_0x441908['query']=_['keys'](_0x5e2f01['query']);_0x441908[_0xbf72('0x36')]=_[_0xbf72('0x37')](_0x441908[_0xbf72('0x33')],_0x441908[_0xbf72('0x34')]);_0x2b3c34[_0xbf72('0x39')]=_[_0xbf72('0x37')](_0x441908[_0xbf72('0x33')],qs[_0xbf72('0x38')](_0x5e2f01[_0xbf72('0x34')]['fields']));_0x2b3c34[_0xbf72('0x39')]=_0x2b3c34[_0xbf72('0x39')]['length']?_0x2b3c34[_0xbf72('0x39')]:_0x441908[_0xbf72('0x33')];if(!_0x5e2f01[_0xbf72('0x34')][_0xbf72('0x3a')](_0xbf72('0x50'))){_0x2b3c34[_0xbf72('0x1d')]=qs[_0xbf72('0x1d')](_0x5e2f01[_0xbf72('0x34')][_0xbf72('0x1d')]);_0x2b3c34['offset']=qs['offset'](_0x5e2f01[_0xbf72('0x34')][_0xbf72('0x1c')]);}_0x2b3c34[_0xbf72('0x3b')]=qs[_0xbf72('0x3c')](_0x5e2f01[_0xbf72('0x34')][_0xbf72('0x3c')]);_0x2b3c34[_0xbf72('0x3d')]=qs[_0xbf72('0x36')](_['pick'](_0x5e2f01[_0xbf72('0x34')],_0x441908[_0xbf72('0x36')]));if(_0x5e2f01[_0xbf72('0x34')][_0xbf72('0x3f')]){_0x2b3c34[_0xbf72('0x3d')]=_[_0xbf72('0x40')](_0x2b3c34[_0xbf72('0x3d')],{'$or':_['map'](_0x2b3c34[_0xbf72('0x39')],function(_0xc3f0cc){var _0x23550f={};_0x23550f[_0xc3f0cc]={'$like':'%'+_0x5e2f01[_0xbf72('0x34')][_0xbf72('0x3f')]+'%'};return _0x23550f;})});}_0x2b3c34[_0xbf72('0x3d')]=_[_0xbf72('0x40')](_0x2b3c34[_0xbf72('0x3d')],{'mailboxuser':_0x3da80c['mailbox']});_0x2b3c34=_[_0xbf72('0x40')]({},_0x2b3c34,_0x5e2f01[_0xbf72('0x45')]);return db[_0xbf72('0x4f')]['findAndCountAll'](_0x2b3c34)[_0xbf72('0x23')](respondWithFilteredResult(_0x1fcf3b,_0x2b3c34));})[_0xbf72('0x4d')](handleError(_0x1fcf3b,null));}; \ No newline at end of file +var _0x7113=['include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','nolimit','pick','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','options','count'];(function(_0x1c9be7,_0x58c6d5){var _0x389139=function(_0x186f54){while(--_0x186f54){_0x1c9be7['push'](_0x1c9be7['shift']());}};_0x389139(++_0x58c6d5);}(_0x7113,0xc4));var _0x3711=function(_0x35a158,_0x435bfa){_0x35a158=_0x35a158-0x0;var _0x28d991=_0x7113[_0x35a158];return _0x28d991;};'use strict';var pdf=require(_0x3711('0x0'));var emlformat=require(_0x3711('0x1'));var rimraf=require(_0x3711('0x2'));var zipdir=require(_0x3711('0x3'));var jsonpatch=require(_0x3711('0x4'));var rp=require('request-promise');var moment=require(_0x3711('0x5'));var BPromise=require(_0x3711('0x6'));var Mustache=require(_0x3711('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3711('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3711('0x9'));var squel=require('squel');var crypto=require(_0x3711('0xa'));var jsforce=require(_0x3711('0xb'));var deskjs=require(_0x3711('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3711('0xd'));var Papa=require(_0x3711('0xe'));var Redis=require(_0x3711('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3711('0x10'));var as=require(_0x3711('0x11'));var hardwareService=require(_0x3711('0x12'));var logger=require(_0x3711('0x13'))(_0x3711('0x14'));var utils=require('../../config/utils');var config=require(_0x3711('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ac63,_0x9d49da){_0x9d49da=_0x9d49da||0xcc;return function(_0x522052){if(_0x522052){return _0x1ac63[_0x3711('0x16')](_0x9d49da);}return _0x1ac63[_0x3711('0x17')](_0x9d49da)[_0x3711('0x18')]();};}function respondWithResult(_0x4b1947,_0x3cf651){_0x3cf651=_0x3cf651||0xc8;return function(_0x2055a7){if(_0x2055a7){return _0x4b1947[_0x3711('0x17')](_0x3cf651)[_0x3711('0x19')](_0x2055a7);}};}function respondWithFilteredResult(_0x15f9ea,_0x2b88b4){return function(_0x5d7cfc){if(_0x5d7cfc){var _0x530ffd=_0x5d7cfc['count'],_0x9d9d0a=_0x2b88b4['offset'],_0xdd180f=_0x2b88b4[_0x3711('0x1a')]+_0x2b88b4[_0x3711('0x1b')],_0xc4fb96;if(_0xdd180f>=_0x530ffd){_0xdd180f=_0x530ffd;_0xc4fb96=0xc8;}else{_0xc4fb96=0xce;}_0x15f9ea[_0x3711('0x17')](_0xc4fb96);return _0x15f9ea[_0x3711('0x1c')](_0x3711('0x1d'),_0x9d9d0a+'-'+_0xdd180f+'/'+_0x530ffd)[_0x3711('0x19')](_0x5d7cfc);}return null;};}function patchUpdates(_0x92b0af){return function(_0x5e4d11){try{jsonpatch[_0x3711('0x1e')](_0x5e4d11,_0x92b0af,!![]);}catch(_0x16503c){return BPromise[_0x3711('0x1f')](_0x16503c);}return _0x5e4d11['save']();};}function saveUpdates(_0x154b94,_0x30cc28){return function(_0x40bc2a){if(_0x40bc2a){return _0x40bc2a[_0x3711('0x20')](_0x154b94)[_0x3711('0x21')](function(_0x49d0d7){return _0x49d0d7;});}return null;};}function removeEntity(_0x3ce975,_0x287247){return function(_0x6fd86a){if(_0x6fd86a){return _0x6fd86a[_0x3711('0x22')]()['then'](function(){var _0x1f15a1=_0x6fd86a[_0x3711('0x23')]({'plain':!![]});var _0x2c4676=_0x3711('0x24');return db[_0x3711('0x25')][_0x3711('0x22')]({'where':{'type':_0x2c4676,'resourceId':_0x1f15a1['id']}})[_0x3711('0x21')](function(){return _0x6fd86a;});})[_0x3711('0x21')](function(){_0x3ce975[_0x3711('0x17')](0xcc)[_0x3711('0x18')]();});}};}function handleEntityNotFound(_0x76880b,_0x4abba3){return function(_0x1de06b){if(!_0x1de06b){_0x76880b['sendStatus'](0x194);}return _0x1de06b;};}function handleError(_0x34af2c,_0x3fb0d7){_0x3fb0d7=_0x3fb0d7||0x1f4;return function(_0x92d2df){logger[_0x3711('0x26')](_0x92d2df[_0x3711('0x27')]);if(_0x92d2df[_0x3711('0x28')]){delete _0x92d2df[_0x3711('0x28')];}_0x34af2c[_0x3711('0x17')](_0x3fb0d7)[_0x3711('0x29')](_0x92d2df);};}exports[_0x3711('0x2a')]=function(_0x4ed3e7,_0x5e7059){var _0xcd3c6a={},_0x41f956={},_0x19ee88={'count':0x0,'rows':[]};var _0x5b6c17=_[_0x3711('0x2b')](db[_0x3711('0x2c')][_0x3711('0x2d')],function(_0x4114d1){return{'name':_0x4114d1[_0x3711('0x2e')],'type':_0x4114d1[_0x3711('0x2f')][_0x3711('0x30')]};});_0x41f956[_0x3711('0x31')]=_[_0x3711('0x2b')](_0x5b6c17,'name');_0x41f956[_0x3711('0x32')]=_[_0x3711('0x33')](_0x4ed3e7[_0x3711('0x32')]);_0x41f956[_0x3711('0x34')]=_[_0x3711('0x35')](_0x41f956[_0x3711('0x31')],_0x41f956[_0x3711('0x32')]);_0xcd3c6a[_0x3711('0x36')]=_['intersection'](_0x41f956[_0x3711('0x31')],qs[_0x3711('0x37')](_0x4ed3e7[_0x3711('0x32')][_0x3711('0x37')]));_0xcd3c6a[_0x3711('0x36')]=_0xcd3c6a[_0x3711('0x36')][_0x3711('0x38')]?_0xcd3c6a[_0x3711('0x36')]:_0x41f956['model'];if(!_0x4ed3e7[_0x3711('0x32')][_0x3711('0x39')]('nolimit')){_0xcd3c6a['limit']=qs[_0x3711('0x1b')](_0x4ed3e7['query'][_0x3711('0x1b')]);_0xcd3c6a['offset']=qs[_0x3711('0x1a')](_0x4ed3e7[_0x3711('0x32')][_0x3711('0x1a')]);}_0xcd3c6a[_0x3711('0x3a')]=qs[_0x3711('0x3b')](_0x4ed3e7[_0x3711('0x32')][_0x3711('0x3b')]);_0xcd3c6a['where']=qs[_0x3711('0x34')](_['pick'](_0x4ed3e7[_0x3711('0x32')],_0x41f956[_0x3711('0x34')]));if(_0x4ed3e7[_0x3711('0x32')][_0x3711('0x3c')]){_0xcd3c6a[_0x3711('0x3d')]=_[_0x3711('0x3e')](_0xcd3c6a[_0x3711('0x3d')],{'$or':_['map'](_0x5b6c17,function(_0x45cbf1){if(_0x45cbf1['type']!=='VIRTUAL'){var _0x18b330={};_0x18b330[_0x45cbf1['name']]={'$like':'%'+_0x4ed3e7[_0x3711('0x32')]['filter']+'%'};return _0x18b330;}})});}_0xcd3c6a=_[_0x3711('0x3e')]({},_0xcd3c6a,_0x4ed3e7[_0x3711('0x3f')]);var _0x3bea42={'where':_0xcd3c6a[_0x3711('0x3d')]};return db[_0x3711('0x2c')]['count'](_0x3bea42)[_0x3711('0x21')](function(_0x22b81e){_0x19ee88[_0x3711('0x40')]=_0x22b81e;if(_0x4ed3e7[_0x3711('0x32')]['includeAll']){_0xcd3c6a[_0x3711('0x41')]=[{'all':!![]}];}return db[_0x3711('0x2c')][_0x3711('0x42')](_0xcd3c6a);})[_0x3711('0x21')](function(_0xd97fb5){_0x19ee88['rows']=_0xd97fb5;return _0x19ee88;})[_0x3711('0x21')](respondWithFilteredResult(_0x5e7059,_0xcd3c6a))[_0x3711('0x43')](handleError(_0x5e7059,null));};exports[_0x3711('0x44')]=function(_0x2e3976,_0xcf5820){var _0x14a9b5={'raw':!![],'where':{'id':_0x2e3976[_0x3711('0x45')]['id']}},_0x4ac703={};_0x4ac703[_0x3711('0x31')]=_[_0x3711('0x33')](db[_0x3711('0x2c')][_0x3711('0x2d')]);_0x4ac703[_0x3711('0x32')]=_[_0x3711('0x33')](_0x2e3976[_0x3711('0x32')]);_0x4ac703[_0x3711('0x34')]=_['intersection'](_0x4ac703[_0x3711('0x31')],_0x4ac703['query']);_0x14a9b5[_0x3711('0x36')]=_['intersection'](_0x4ac703['model'],qs['fields'](_0x2e3976[_0x3711('0x32')][_0x3711('0x37')]));_0x14a9b5[_0x3711('0x36')]=_0x14a9b5[_0x3711('0x36')][_0x3711('0x38')]?_0x14a9b5[_0x3711('0x36')]:_0x4ac703[_0x3711('0x31')];if(_0x2e3976['query'][_0x3711('0x46')]){_0x14a9b5[_0x3711('0x41')]=[{'all':!![]}];}_0x14a9b5=_[_0x3711('0x3e')]({},_0x14a9b5,_0x2e3976[_0x3711('0x3f')]);return db['VoiceMail'][_0x3711('0x47')](_0x14a9b5)['then'](handleEntityNotFound(_0xcf5820,null))[_0x3711('0x21')](respondWithResult(_0xcf5820,null))['catch'](handleError(_0xcf5820,null));};exports[_0x3711('0x48')]=function(_0x3171fe,_0x2fb8fe){return db['VoiceMail'][_0x3711('0x48')](_0x3171fe[_0x3711('0x49')],{})[_0x3711('0x21')](function(_0x81727f){var _0x1f041a=_0x3171fe[_0x3711('0x4a')][_0x3711('0x23')]({'plain':!![]});if(!_0x1f041a)throw new Error(_0x3711('0x4b'));if(_0x1f041a[_0x3711('0x4c')]===_0x3711('0x4a')){var _0x2989bc=_0x81727f['get']({'plain':!![]});var _0x4edc9c=_0x3711('0x24');return db[_0x3711('0x4d')][_0x3711('0x47')]({'where':{'name':_0x4edc9c,'userProfileId':_0x1f041a['userProfileId']},'raw':!![]})[_0x3711('0x21')](function(_0xcf4484){if(_0xcf4484&&_0xcf4484[_0x3711('0x4e')]===0x0){return db[_0x3711('0x25')][_0x3711('0x48')]({'name':_0x2989bc['name'],'resourceId':_0x2989bc['id'],'type':_0xcf4484[_0x3711('0x28')],'sectionId':_0xcf4484['id']},{})[_0x3711('0x21')](function(){return _0x81727f;});}else{return _0x81727f;}})[_0x3711('0x43')](function(_0xfd23ad){logger[_0x3711('0x26')](_0x3711('0x4f'),_0xfd23ad);throw _0xfd23ad;});}return _0x81727f;})[_0x3711('0x21')](respondWithResult(_0x2fb8fe,0xc9))['catch'](handleError(_0x2fb8fe,null));};exports[_0x3711('0x20')]=function(_0x2bd5d4,_0x23691e){if(_0x2bd5d4[_0x3711('0x49')]['id']){delete _0x2bd5d4[_0x3711('0x49')]['id'];}return db['VoiceMail'][_0x3711('0x47')]({'where':{'id':_0x2bd5d4['params']['id']}})['then'](handleEntityNotFound(_0x23691e,null))[_0x3711('0x21')](saveUpdates(_0x2bd5d4[_0x3711('0x49')],null))[_0x3711('0x21')](respondWithResult(_0x23691e,null))['catch'](handleError(_0x23691e,null));};exports[_0x3711('0x22')]=function(_0x3ccbf5,_0x24bda9){return db[_0x3711('0x2c')]['find']({'where':{'id':_0x3ccbf5[_0x3711('0x45')]['id']}})[_0x3711('0x21')](handleEntityNotFound(_0x24bda9,null))[_0x3711('0x21')](removeEntity(_0x24bda9,null))[_0x3711('0x43')](handleError(_0x24bda9,null));};exports[_0x3711('0x50')]=function(_0x435d12,_0x4e66e5,_0x4e92b2){return db[_0x3711('0x2c')][_0x3711('0x51')]({'where':{'id':_0x435d12[_0x3711('0x45')]['id']}})[_0x3711('0x21')](handleEntityNotFound(_0x4e66e5,null))[_0x3711('0x21')](function(_0x22a1b0){var _0x5dde0e;var _0x1b44a6={},_0x5d4e00={};_0x5d4e00[_0x3711('0x31')]=_['keys'](db[_0x3711('0x52')][_0x3711('0x2d')]);_0x5d4e00[_0x3711('0x32')]=_[_0x3711('0x33')](_0x435d12['query']);_0x5d4e00[_0x3711('0x34')]=_[_0x3711('0x35')](_0x5d4e00[_0x3711('0x31')],_0x5d4e00['query']);_0x1b44a6[_0x3711('0x36')]=_[_0x3711('0x35')](_0x5d4e00['model'],qs[_0x3711('0x37')](_0x435d12['query']['fields']));_0x1b44a6[_0x3711('0x36')]=_0x1b44a6[_0x3711('0x36')]['length']?_0x1b44a6[_0x3711('0x36')]:_0x5d4e00[_0x3711('0x31')];if(!_0x435d12[_0x3711('0x32')][_0x3711('0x39')](_0x3711('0x53'))){_0x1b44a6[_0x3711('0x1b')]=qs[_0x3711('0x1b')](_0x435d12[_0x3711('0x32')]['limit']);_0x1b44a6['offset']=qs[_0x3711('0x1a')](_0x435d12[_0x3711('0x32')]['offset']);}_0x1b44a6['order']=qs['sort'](_0x435d12[_0x3711('0x32')][_0x3711('0x3b')]);_0x1b44a6['where']=qs['filters'](_[_0x3711('0x54')](_0x435d12[_0x3711('0x32')],_0x5d4e00[_0x3711('0x34')]));if(_0x435d12['query']['filter']){_0x1b44a6[_0x3711('0x3d')]=_[_0x3711('0x3e')](_0x1b44a6[_0x3711('0x3d')],{'$or':_[_0x3711('0x2b')](_0x1b44a6[_0x3711('0x36')],function(_0x403233){var _0xc3c01e={};_0xc3c01e[_0x403233]={'$like':'%'+_0x435d12[_0x3711('0x32')]['filter']+'%'};return _0xc3c01e;})});}_0x1b44a6['where']=_[_0x3711('0x3e')](_0x1b44a6[_0x3711('0x3d')],{'mailboxuser':_0x22a1b0[_0x3711('0x55')]});_0x1b44a6=_[_0x3711('0x3e')]({},_0x1b44a6,_0x435d12[_0x3711('0x3f')]);return db[_0x3711('0x52')][_0x3711('0x56')](_0x1b44a6)[_0x3711('0x21')](respondWithFilteredResult(_0x4e66e5,_0x1b44a6));})[_0x3711('0x43')](handleError(_0x4e66e5,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 2c622be..f4631a2 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 _0x552c=['exports','define','VoiceMail','voice_voicemail','mailbox_context','context','util','../../config/logger','api','moment','./voiceMail.attributes'];(function(_0x122036,_0x40973a){var _0x35e8b=function(_0x357e61){while(--_0x357e61){_0x122036['push'](_0x122036['shift']());}};_0x35e8b(++_0x40973a);}(_0x552c,0xa0));var _0xc552=function(_0x362a9c,_0x434fd5){_0x362a9c=_0x362a9c-0x0;var _0x159079=_0x552c[_0x362a9c];return _0x159079;};'use strict';var _=require('lodash');var util=require(_0xc552('0x0'));var logger=require(_0xc552('0x1'))(_0xc552('0x2'));var moment=require(_0xc552('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc552('0x4'));module[_0xc552('0x5')]=function(_0x37da20,_0xc71556){return _0x37da20[_0xc552('0x6')](_0xc552('0x7'),attributes,{'tableName':_0xc552('0x8'),'paranoid':![],'indexes':[{'name':_0xc552('0x9'),'fields':['mailbox',_0xc552('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x184d=['exports','VoiceMail','voice_voicemail','mailbox','util','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x184d,0x1d0));var _0xd184=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x184d[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0xd184('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd184('0x1'));var fs=require('fs');var path=require(_0xd184('0x2'));var rimraf=require(_0xd184('0x3'));var config=require(_0xd184('0x4'));var attributes=require(_0xd184('0x5'));module[_0xd184('0x6')]=function(_0x4b6af0,_0x497342){return _0x4b6af0['define'](_0xd184('0x7'),attributes,{'tableName':_0xd184('0x8'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xd184('0x9'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 4f06a87..7d7eccb 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 _0x0bda=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x457d63,_0x335206){var _0x5e1007=function(_0x2b692c){while(--_0x2b692c){_0x457d63['push'](_0x457d63['shift']());}};_0x5e1007(++_0x335206);}(_0x0bda,0x72));var _0xa0bd=function(_0x4acc74,_0xe5fa54){_0x4acc74=_0x4acc74-0x0;var _0xe055e6=_0x0bda[_0x4acc74];return _0xe055e6;};'use strict';var _=require(_0xa0bd('0x0'));var util=require(_0xa0bd('0x1'));var moment=require(_0xa0bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0bd('0x3'));var fs=require('fs');var Redis=require(_0xa0bd('0x4'));var db=require(_0xa0bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0bd('0x6'))('rpc');var config=require(_0xa0bd('0x7'));var jayson=require(_0xa0bd('0x8'));var client=jayson[_0xa0bd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37db89,_0x41d140,_0xf30af){return new BPromise(function(_0x486707,_0x525fa4){return client[_0xa0bd('0xa')](_0x37db89,_0xf30af)[_0xa0bd('0xb')](function(_0x5e79d9){logger['info']('VoiceMail,\x20%s,\x20%s',_0x41d140,_0xa0bd('0xc'));logger[_0xa0bd('0xd')](_0xa0bd('0xe'),_0x41d140,'request\x20sent',JSON[_0xa0bd('0xf')](_0x5e79d9));if(_0x5e79d9[_0xa0bd('0x10')]){if(_0x5e79d9[_0xa0bd('0x10')][_0xa0bd('0x11')]===0x1f4){logger[_0xa0bd('0x10')](_0xa0bd('0x12'),_0x41d140,_0x5e79d9['error'][_0xa0bd('0x13')]);return _0x525fa4(_0x5e79d9[_0xa0bd('0x10')][_0xa0bd('0x13')]);}logger[_0xa0bd('0x10')](_0xa0bd('0x12'),_0x41d140,_0x5e79d9[_0xa0bd('0x10')][_0xa0bd('0x13')]);return _0x486707(_0x5e79d9[_0xa0bd('0x10')][_0xa0bd('0x13')]);}else{logger[_0xa0bd('0x14')](_0xa0bd('0x12'),_0x41d140,_0xa0bd('0xc'));_0x486707(_0x5e79d9[_0xa0bd('0x15')]['message']);}})[_0xa0bd('0x16')](function(_0x576e79){logger[_0xa0bd('0x10')](_0xa0bd('0x12'),_0x41d140,_0x576e79);_0x525fa4(_0x576e79);});});} \ No newline at end of file +var _0x7897=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','error','message'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x7897,0x119));var _0x7789=function(_0x4d1162,_0x456c5c){_0x4d1162=_0x4d1162-0x0;var _0x184f3c=_0x7897[_0x4d1162];return _0x184f3c;};'use strict';var _=require('lodash');var util=require(_0x7789('0x0'));var moment=require(_0x7789('0x1'));var BPromise=require('bluebird');var rs=require(_0x7789('0x2'));var fs=require('fs');var Redis=require(_0x7789('0x3'));var db=require(_0x7789('0x4'))['db'];var utils=require(_0x7789('0x5'));var logger=require(_0x7789('0x6'))(_0x7789('0x7'));var config=require(_0x7789('0x8'));var jayson=require(_0x7789('0x9'));var client=jayson[_0x7789('0xa')][_0x7789('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24e3a5,_0x1d859c,_0x21d7dd){return new BPromise(function(_0x4735d6,_0x346b00){return client[_0x7789('0xc')](_0x24e3a5,_0x21d7dd)[_0x7789('0xd')](function(_0x28b543){logger[_0x7789('0xe')](_0x7789('0xf'),_0x1d859c,'request\x20sent');logger[_0x7789('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x1d859c,'request\x20sent',JSON['stringify'](_0x28b543));if(_0x28b543['error']){if(_0x28b543[_0x7789('0x11')]['code']===0x1f4){logger[_0x7789('0x11')](_0x7789('0xf'),_0x1d859c,_0x28b543[_0x7789('0x11')][_0x7789('0x12')]);return _0x346b00(_0x28b543[_0x7789('0x11')]['message']);}logger[_0x7789('0x11')](_0x7789('0xf'),_0x1d859c,_0x28b543[_0x7789('0x11')][_0x7789('0x12')]);return _0x4735d6(_0x28b543[_0x7789('0x11')]['message']);}else{logger[_0x7789('0xe')]('VoiceMail,\x20%s,\x20%s',_0x1d859c,'request\x20sent');_0x4735d6(_0x28b543['result']['message']);}})[_0x7789('0x13')](function(_0x3f5ffd){logger['error'](_0x7789('0xf'),_0x1d859c,_0x3f5ffd);_0x346b00(_0x3f5ffd);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 1a6308d..42f0c39 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 _0x5fc3=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x5fc3,0xa8));var _0x35fc=function(_0x586fa2,_0x1a45bc){_0x586fa2=_0x586fa2-0x0;var _0x515be9=_0x5fc3[_0x586fa2];return _0x515be9;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')]('/',auth[_0x35fc('0x9')](),controller['index']);router['get'](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0x8')](_0x35fc('0xc'),auth[_0x35fc('0x9')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth[_0x35fc('0x9')](),controller['create']);router[_0x35fc('0xf')](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);router[_0x35fc('0x11')]('/:id',auth[_0x35fc('0x9')](),controller[_0x35fc('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4975=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x4def54,_0x36de1d){var _0x137bee=function(_0x1dd6f4){while(--_0x1dd6f4){_0x4def54['push'](_0x4def54['shift']());}};_0x137bee(++_0x36de1d);}(_0x4975,0x86));var _0x5497=function(_0x21df73,_0x402dbf){_0x21df73=_0x21df73-0x0;var _0x1e8196=_0x4975[_0x21df73];return _0x1e8196;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var auth=require(_0x5497('0x5'));var interaction=require(_0x5497('0x6'));var config=require(_0x5497('0x7'));var controller=require(_0x5497('0x8'));router[_0x5497('0x9')]('/',auth[_0x5497('0xa')](),controller['index']);router[_0x5497('0x9')]('/:id',auth[_0x5497('0xa')](),controller[_0x5497('0xb')]);router[_0x5497('0x9')]('/:id/download',auth[_0x5497('0xa')](),controller['download']);router[_0x5497('0xc')]('/',auth[_0x5497('0xa')](),controller[_0x5497('0xd')]);router[_0x5497('0xe')](_0x5497('0xf'),auth[_0x5497('0xa')](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5497('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 0fb1132..8c4f341 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 _0xeb00=['VIRTUAL','INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xeb00,0x84));var _0x0eb0=function(_0x99b2a1,_0x2fe6c2){_0x99b2a1=_0x99b2a1-0x0;var _0x110148=_0xeb00[_0x99b2a1];return _0x110148;};'use strict';var Sequelize=require(_0x0eb0('0x0'));module['exports']={'name':{'type':Sequelize[_0x0eb0('0x1')],'get':function(_0xb0a8e){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x0eb0('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0eb0('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x0eb0('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x0eb0('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x0eb0('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0eb0('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x0eb0('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x0eb0('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x0eb0('0x4')](_0x0eb0('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x0eb0('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x0eb0('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xfe97=['getDataValue','INTEGER','STRING','BLOB','long','sequelize','exports'];(function(_0x4306f7,_0x57cd08){var _0x54188a=function(_0xad612a){while(--_0xad612a){_0x4306f7['push'](_0x4306f7['shift']());}};_0x54188a(++_0x57cd08);}(_0xfe97,0x178));var _0x7fe9=function(_0x18dfed,_0x506ff4){_0x18dfed=_0x18dfed-0x0;var _0x34ce48=_0xfe97[_0x18dfed];return _0x34ce48;};'use strict';var Sequelize=require(_0x7fe9('0x0'));module[_0x7fe9('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2d4a03){return this[_0x7fe9('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x7fe9('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x7fe9('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7fe9('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x7fe9('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x7fe9('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7fe9('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x7fe9('0x5')](_0x7fe9('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x7fe9('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index d095abf..0ba67bd 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 _0xe0ae=['zip-dir','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','name','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','rimraf'];(function(_0x5dfd65,_0x1ad889){var _0x47f853=function(_0x3fafbf){while(--_0x3fafbf){_0x5dfd65['push'](_0x5dfd65['shift']());}};_0x47f853(++_0x1ad889);}(_0xe0ae,0xa1));var _0xee0a=function(_0xf34895,_0x21fb70){_0xf34895=_0xf34895-0x0;var _0x143f44=_0xe0ae[_0xf34895];return _0x143f44;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xee0a('0x0'));var zipdir=require(_0xee0a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee0a('0x2'));var moment=require('moment');var BPromise=require(_0xee0a('0x3'));var Mustache=require(_0xee0a('0x4'));var util=require('util');var path=require(_0xee0a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee0a('0x6'));var fs=require('fs');var _=require(_0xee0a('0x7'));var squel=require(_0xee0a('0x8'));var crypto=require(_0xee0a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xee0a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee0a('0xb'));var Redis=require(_0xee0a('0xc'));var authService=require(_0xee0a('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xee0a('0xe'));var hardwareService=require(_0xee0a('0xf'));var logger=require('../../config/logger')(_0xee0a('0x10'));var utils=require('../../config/utils');var config=require(_0xee0a('0x11'));var db=require(_0xee0a('0x12'))['db'];function respondWithStatusCode(_0x4e60ee,_0x1fcf59){_0x1fcf59=_0x1fcf59||0xcc;return function(_0x5c56d9){if(_0x5c56d9){return _0x4e60ee[_0xee0a('0x13')](_0x1fcf59);}return _0x4e60ee[_0xee0a('0x14')](_0x1fcf59)['end']();};}function respondWithResult(_0x4e1cd0,_0x325a8e){_0x325a8e=_0x325a8e||0xc8;return function(_0x41b70a){if(_0x41b70a){return _0x4e1cd0[_0xee0a('0x14')](_0x325a8e)[_0xee0a('0x15')](_0x41b70a);}};}function respondWithFilteredResult(_0x41d4e4,_0x57afe6){return function(_0xb891a9){if(_0xb891a9){var _0xd39431=_0xb891a9[_0xee0a('0x16')],_0x50063f=_0x57afe6[_0xee0a('0x17')],_0x2c804a=_0x57afe6['offset']+_0x57afe6[_0xee0a('0x18')],_0x35d1e4;if(_0x2c804a>=_0xd39431){_0x2c804a=_0xd39431;_0x35d1e4=0xc8;}else{_0x35d1e4=0xce;}_0x41d4e4[_0xee0a('0x14')](_0x35d1e4);return _0x41d4e4[_0xee0a('0x19')]('Content-Range',_0x50063f+'-'+_0x2c804a+'/'+_0xd39431)[_0xee0a('0x15')](_0xb891a9);}return null;};}function patchUpdates(_0x1ffdb5){return function(_0xe1f346){try{jsonpatch[_0xee0a('0x1a')](_0xe1f346,_0x1ffdb5,!![]);}catch(_0x5d29e0){return BPromise[_0xee0a('0x1b')](_0x5d29e0);}return _0xe1f346[_0xee0a('0x1c')]();};}function saveUpdates(_0x452d97,_0x201d32){return function(_0x5c981e){if(_0x5c981e){return _0x5c981e[_0xee0a('0x1d')](_0x452d97)[_0xee0a('0x1e')](function(_0x31e98a){return _0x31e98a;});}return null;};}function removeEntity(_0x21197f,_0x39fa96){return function(_0x1eb176){if(_0x1eb176){return _0x1eb176[_0xee0a('0x1f')]()['then'](function(){_0x21197f[_0xee0a('0x14')](0xcc)[_0xee0a('0x20')]();});}};}function handleEntityNotFound(_0x27989c,_0x38d029){return function(_0x567810){if(!_0x567810){_0x27989c[_0xee0a('0x13')](0x194);}return _0x567810;};}function handleError(_0x197616,_0x1fe1a3){_0x1fe1a3=_0x1fe1a3||0x1f4;return function(_0x2c414d){logger['error'](_0x2c414d['stack']);if(_0x2c414d['name']){delete _0x2c414d[_0xee0a('0x21')];}_0x197616['status'](_0x1fe1a3)['send'](_0x2c414d);};}exports[_0xee0a('0x22')]=function(_0x2c8965,_0xe5365f){var _0x50d415={},_0x3c3d48={},_0xe14449={'count':0x0,'rows':[]};var _0x15b1c0=_[_0xee0a('0x23')](db[_0xee0a('0x24')][_0xee0a('0x25')],function(_0x145332){return{'name':_0x145332[_0xee0a('0x26')],'type':_0x145332[_0xee0a('0x27')][_0xee0a('0x28')]};});_0x3c3d48['model']=_[_0xee0a('0x29')](_[_0xee0a('0x23')](_0x15b1c0,_0xee0a('0x21')),[_0xee0a('0x21')]);_0x3c3d48[_0xee0a('0x2a')]=_[_0xee0a('0x2b')](_0x2c8965['query']);_0x3c3d48[_0xee0a('0x2c')]=_[_0xee0a('0x2d')](_0x3c3d48[_0xee0a('0x2e')],_0x3c3d48[_0xee0a('0x2a')]);_0x50d415['attributes']=_[_0xee0a('0x2d')](_0x3c3d48['model'],qs[_0xee0a('0x2f')](_0x2c8965[_0xee0a('0x2a')][_0xee0a('0x2f')]));_0x50d415[_0xee0a('0x30')]=_0x50d415[_0xee0a('0x30')][_0xee0a('0x31')]?_0x50d415[_0xee0a('0x30')]:_0x3c3d48[_0xee0a('0x2e')];if(!_0x2c8965['query'][_0xee0a('0x32')](_0xee0a('0x33'))){_0x50d415['limit']=qs[_0xee0a('0x18')](_0x2c8965[_0xee0a('0x2a')][_0xee0a('0x18')]);_0x50d415['offset']=qs[_0xee0a('0x17')](_0x2c8965[_0xee0a('0x2a')][_0xee0a('0x17')]);}_0x50d415['order']=qs[_0xee0a('0x34')](_0x2c8965[_0xee0a('0x2a')][_0xee0a('0x34')]);_0x50d415['where']=qs['filters'](_[_0xee0a('0x35')](_0x2c8965[_0xee0a('0x2a')],_0x3c3d48[_0xee0a('0x2c')]));if(_0x2c8965[_0xee0a('0x2a')][_0xee0a('0x36')]){_0x50d415[_0xee0a('0x37')]=_[_0xee0a('0x38')](_0x50d415[_0xee0a('0x37')],{'$or':_[_0xee0a('0x23')](_0x15b1c0,function(_0x5325ab){if(_0x5325ab[_0xee0a('0x27')]!==_0xee0a('0x39')){var _0x53bc62={};_0x53bc62[_0x5325ab[_0xee0a('0x21')]]={'$like':'%'+_0x2c8965[_0xee0a('0x2a')]['filter']+'%'};return _0x53bc62;}})});}_0x50d415=_[_0xee0a('0x38')]({},_0x50d415,_0x2c8965[_0xee0a('0x3a')]);var _0x3a825e={'where':_0x50d415[_0xee0a('0x37')]};return db[_0xee0a('0x24')][_0xee0a('0x16')](_0x3a825e)[_0xee0a('0x1e')](function(_0x1b88df){_0xe14449[_0xee0a('0x16')]=_0x1b88df;if(_0x2c8965['query'][_0xee0a('0x3b')]){_0x50d415[_0xee0a('0x3c')]=[{'all':!![]}];}return db[_0xee0a('0x24')][_0xee0a('0x3d')](_0x50d415);})['then'](function(_0x4857ea){_0xe14449[_0xee0a('0x3e')]=_0x4857ea;return _0xe14449;})[_0xee0a('0x1e')](respondWithFilteredResult(_0xe5365f,_0x50d415))[_0xee0a('0x3f')](handleError(_0xe5365f,null));};exports[_0xee0a('0x40')]=function(_0x1b69b9,_0x28bee3){var _0x242e6e={'raw':!![],'where':{'id':_0x1b69b9['params']['id']}},_0x4c398c={};_0x4c398c[_0xee0a('0x2e')]=_[_0xee0a('0x2b')](db['VoiceMailMessage'][_0xee0a('0x25')]);_0x4c398c[_0xee0a('0x2a')]=_['keys'](_0x1b69b9[_0xee0a('0x2a')]);_0x4c398c[_0xee0a('0x2c')]=_[_0xee0a('0x2d')](_0x4c398c[_0xee0a('0x2e')],_0x4c398c[_0xee0a('0x2a')]);_0x242e6e[_0xee0a('0x30')]=_[_0xee0a('0x2d')](_0x4c398c['model'],qs['fields'](_0x1b69b9[_0xee0a('0x2a')]['fields']));_0x242e6e['attributes']=_0x242e6e['attributes'][_0xee0a('0x31')]?_0x242e6e[_0xee0a('0x30')]:_0x4c398c['model'];if(_0x1b69b9['query']['includeAll']){_0x242e6e['include']=[{'all':!![]}];}_0x242e6e=_[_0xee0a('0x38')]({},_0x242e6e,_0x1b69b9[_0xee0a('0x3a')]);return db[_0xee0a('0x24')][_0xee0a('0x41')](_0x242e6e)[_0xee0a('0x1e')](handleEntityNotFound(_0x28bee3,null))[_0xee0a('0x1e')](respondWithResult(_0x28bee3,null))['catch'](handleError(_0x28bee3,null));};exports[_0xee0a('0x42')]=function(_0x5ee36f,_0x23df96){return db[_0xee0a('0x24')][_0xee0a('0x42')](_0x5ee36f[_0xee0a('0x43')],{})['then'](respondWithResult(_0x23df96,0xc9))[_0xee0a('0x3f')](handleError(_0x23df96,null));};exports[_0xee0a('0x1d')]=function(_0x290940,_0x12e47f){if(_0x290940[_0xee0a('0x43')]['id']){delete _0x290940[_0xee0a('0x43')]['id'];}return db[_0xee0a('0x24')]['find']({'where':{'id':_0x290940['params']['id']}})[_0xee0a('0x1e')](handleEntityNotFound(_0x12e47f,null))[_0xee0a('0x1e')](saveUpdates(_0x290940[_0xee0a('0x43')],null))[_0xee0a('0x1e')](respondWithResult(_0x12e47f,null))[_0xee0a('0x3f')](handleError(_0x12e47f,null));};exports[_0xee0a('0x1f')]=function(_0x4711b9,_0x1d64ff){return db[_0xee0a('0x24')][_0xee0a('0x41')]({'where':{'id':_0x4711b9[_0xee0a('0x44')]['id']}})[_0xee0a('0x1e')](handleEntityNotFound(_0x1d64ff,null))['then'](removeEntity(_0x1d64ff,null))[_0xee0a('0x3f')](handleError(_0x1d64ff,null));};exports[_0xee0a('0x45')]=function(_0x5a2bc,_0xfec3d0,_0x29e137){return db['VoiceMailMessage'][_0xee0a('0x41')]({'where':{'id':_0x5a2bc[_0xee0a('0x44')]['id']},'attributes':['id',_0xee0a('0x46'),_0xee0a('0x47')]})[_0xee0a('0x1e')](handleEntityNotFound(_0xfec3d0,null))['then'](function(_0x1cd43f){if(_0x1cd43f){if(!_0x1cd43f[_0xee0a('0x46')]){throw new db[(_0xee0a('0x48'))][(_0xee0a('0x49'))](_0xee0a('0x4a'));}var _0x4b21a7={'Content-Type':_0xee0a('0x4b'),'Content-Disposition':_0xee0a('0x4c')};if(_0x1cd43f[_0xee0a('0x47')]){_0x4b21a7[_0xee0a('0x4d')]=_0xee0a('0x4e')+_0x1cd43f[_0xee0a('0x47')]+_0xee0a('0x4f');}_0xfec3d0[_0xee0a('0x19')](_0x4b21a7);return _0xfec3d0[_0xee0a('0x50')](new Buffer(_0x1cd43f[_0xee0a('0x46')]));}})[_0xee0a('0x3f')](handleError(_0xfec3d0,null));}; \ No newline at end of file +var _0xf006=['to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','update','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','request-promise','bluebird','path','sox'];(function(_0x456b33,_0x169b8d){var _0x4bbf17=function(_0x33d3f8){while(--_0x33d3f8){_0x456b33['push'](_0x456b33['shift']());}};_0x4bbf17(++_0x169b8d);}(_0xf006,0x146));var _0x6f00=function(_0x1bed7a,_0x47dbb6){_0x1bed7a=_0x1bed7a-0x0;var _0x43dd2a=_0xf006[_0x1bed7a];return _0x43dd2a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6f00('0x0'));var zipdir=require(_0x6f00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f00('0x2'));var moment=require('moment');var BPromise=require(_0x6f00('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f00('0x4'));var sox=require(_0x6f00('0x5'));var csv=require(_0x6f00('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f00('0x7'));var squel=require('squel');var crypto=require(_0x6f00('0x8'));var jsforce=require(_0x6f00('0x9'));var deskjs=require(_0x6f00('0xa'));var toCsv=require(_0x6f00('0x6'));var querystring=require(_0x6f00('0xb'));var Papa=require(_0x6f00('0xc'));var Redis=require(_0x6f00('0xd'));var authService=require(_0x6f00('0xe'));var qs=require(_0x6f00('0xf'));var as=require(_0x6f00('0x10'));var hardwareService=require(_0x6f00('0x11'));var logger=require(_0x6f00('0x12'))(_0x6f00('0x13'));var utils=require('../../config/utils');var config=require(_0x6f00('0x14'));var db=require(_0x6f00('0x15'))['db'];function respondWithStatusCode(_0x158817,_0x36a2ec){_0x36a2ec=_0x36a2ec||0xcc;return function(_0x289fe9){if(_0x289fe9){return _0x158817['sendStatus'](_0x36a2ec);}return _0x158817[_0x6f00('0x16')](_0x36a2ec)['end']();};}function respondWithResult(_0x30b10e,_0x5047f5){_0x5047f5=_0x5047f5||0xc8;return function(_0x324e67){if(_0x324e67){return _0x30b10e[_0x6f00('0x16')](_0x5047f5)[_0x6f00('0x17')](_0x324e67);}};}function respondWithFilteredResult(_0x33f3a2,_0xa6e7a1){return function(_0x411203){if(_0x411203){var _0x46bc2c=_0x411203[_0x6f00('0x18')],_0x4d8aee=_0xa6e7a1['offset'],_0x342c7f=_0xa6e7a1['offset']+_0xa6e7a1[_0x6f00('0x19')],_0x4bfac3;if(_0x342c7f>=_0x46bc2c){_0x342c7f=_0x46bc2c;_0x4bfac3=0xc8;}else{_0x4bfac3=0xce;}_0x33f3a2[_0x6f00('0x16')](_0x4bfac3);return _0x33f3a2[_0x6f00('0x1a')](_0x6f00('0x1b'),_0x4d8aee+'-'+_0x342c7f+'/'+_0x46bc2c)[_0x6f00('0x17')](_0x411203);}return null;};}function patchUpdates(_0x27e466){return function(_0x23fe10){try{jsonpatch[_0x6f00('0x1c')](_0x23fe10,_0x27e466,!![]);}catch(_0x9844bf){return BPromise[_0x6f00('0x1d')](_0x9844bf);}return _0x23fe10[_0x6f00('0x1e')]();};}function saveUpdates(_0x23f27a,_0x4e11de){return function(_0x4f3031){if(_0x4f3031){return _0x4f3031['update'](_0x23f27a)[_0x6f00('0x1f')](function(_0x1fd3d4){return _0x1fd3d4;});}return null;};}function removeEntity(_0x43bfb8,_0x57340f){return function(_0xe301e5){if(_0xe301e5){return _0xe301e5[_0x6f00('0x20')]()[_0x6f00('0x1f')](function(){_0x43bfb8[_0x6f00('0x16')](0xcc)[_0x6f00('0x21')]();});}};}function handleEntityNotFound(_0x1cbf1c,_0x90d74c){return function(_0x1ea061){if(!_0x1ea061){_0x1cbf1c['sendStatus'](0x194);}return _0x1ea061;};}function handleError(_0x3c05ef,_0x45945e){_0x45945e=_0x45945e||0x1f4;return function(_0x1fd40b){logger['error'](_0x1fd40b[_0x6f00('0x22')]);if(_0x1fd40b['name']){delete _0x1fd40b[_0x6f00('0x23')];}_0x3c05ef['status'](_0x45945e)[_0x6f00('0x24')](_0x1fd40b);};}exports[_0x6f00('0x25')]=function(_0x7c6bcb,_0x1f84a6){var _0x375d76={},_0x49eb87={},_0x23a346={'count':0x0,'rows':[]};var _0x25cc71=_[_0x6f00('0x26')](db[_0x6f00('0x27')][_0x6f00('0x28')],function(_0x235a86){return{'name':_0x235a86[_0x6f00('0x29')],'type':_0x235a86[_0x6f00('0x2a')][_0x6f00('0x2b')]};});_0x49eb87[_0x6f00('0x2c')]=_[_0x6f00('0x2d')](_[_0x6f00('0x26')](_0x25cc71,_0x6f00('0x23')),[_0x6f00('0x23')]);_0x49eb87['query']=_['keys'](_0x7c6bcb['query']);_0x49eb87['filters']=_['intersection'](_0x49eb87['model'],_0x49eb87[_0x6f00('0x2e')]);_0x375d76['attributes']=_[_0x6f00('0x2f')](_0x49eb87[_0x6f00('0x2c')],qs[_0x6f00('0x30')](_0x7c6bcb[_0x6f00('0x2e')][_0x6f00('0x30')]));_0x375d76[_0x6f00('0x31')]=_0x375d76['attributes'][_0x6f00('0x32')]?_0x375d76[_0x6f00('0x31')]:_0x49eb87[_0x6f00('0x2c')];if(!_0x7c6bcb[_0x6f00('0x2e')][_0x6f00('0x33')]('nolimit')){_0x375d76['limit']=qs['limit'](_0x7c6bcb[_0x6f00('0x2e')][_0x6f00('0x19')]);_0x375d76[_0x6f00('0x34')]=qs[_0x6f00('0x34')](_0x7c6bcb[_0x6f00('0x2e')]['offset']);}_0x375d76[_0x6f00('0x35')]=qs[_0x6f00('0x36')](_0x7c6bcb[_0x6f00('0x2e')][_0x6f00('0x36')]);_0x375d76[_0x6f00('0x37')]=qs[_0x6f00('0x38')](_[_0x6f00('0x39')](_0x7c6bcb['query'],_0x49eb87[_0x6f00('0x38')]));if(_0x7c6bcb[_0x6f00('0x2e')][_0x6f00('0x3a')]){_0x375d76['where']=_[_0x6f00('0x3b')](_0x375d76[_0x6f00('0x37')],{'$or':_[_0x6f00('0x26')](_0x25cc71,function(_0x4bb9c5){if(_0x4bb9c5[_0x6f00('0x2a')]!=='VIRTUAL'){var _0x6480c8={};_0x6480c8[_0x4bb9c5['name']]={'$like':'%'+_0x7c6bcb[_0x6f00('0x2e')][_0x6f00('0x3a')]+'%'};return _0x6480c8;}})});}_0x375d76=_[_0x6f00('0x3b')]({},_0x375d76,_0x7c6bcb[_0x6f00('0x3c')]);var _0x57c13a={'where':_0x375d76[_0x6f00('0x37')]};return db['VoiceMailMessage'][_0x6f00('0x18')](_0x57c13a)['then'](function(_0x7785e1){_0x23a346[_0x6f00('0x18')]=_0x7785e1;if(_0x7c6bcb[_0x6f00('0x2e')][_0x6f00('0x3d')]){_0x375d76['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0x6f00('0x3e')](_0x375d76);})['then'](function(_0x209d39){_0x23a346[_0x6f00('0x3f')]=_0x209d39;return _0x23a346;})['then'](respondWithFilteredResult(_0x1f84a6,_0x375d76))[_0x6f00('0x40')](handleError(_0x1f84a6,null));};exports['show']=function(_0x4cac2c,_0x38da7f){var _0x3c19bb={'raw':!![],'where':{'id':_0x4cac2c[_0x6f00('0x41')]['id']}},_0x1a9f4c={};_0x1a9f4c['model']=_[_0x6f00('0x42')](db[_0x6f00('0x27')][_0x6f00('0x28')]);_0x1a9f4c[_0x6f00('0x2e')]=_[_0x6f00('0x42')](_0x4cac2c[_0x6f00('0x2e')]);_0x1a9f4c['filters']=_[_0x6f00('0x2f')](_0x1a9f4c[_0x6f00('0x2c')],_0x1a9f4c[_0x6f00('0x2e')]);_0x3c19bb[_0x6f00('0x31')]=_[_0x6f00('0x2f')](_0x1a9f4c[_0x6f00('0x2c')],qs['fields'](_0x4cac2c[_0x6f00('0x2e')][_0x6f00('0x30')]));_0x3c19bb[_0x6f00('0x31')]=_0x3c19bb['attributes'][_0x6f00('0x32')]?_0x3c19bb['attributes']:_0x1a9f4c[_0x6f00('0x2c')];if(_0x4cac2c[_0x6f00('0x2e')]['includeAll']){_0x3c19bb[_0x6f00('0x43')]=[{'all':!![]}];}_0x3c19bb=_['merge']({},_0x3c19bb,_0x4cac2c[_0x6f00('0x3c')]);return db[_0x6f00('0x27')][_0x6f00('0x44')](_0x3c19bb)[_0x6f00('0x1f')](handleEntityNotFound(_0x38da7f,null))['then'](respondWithResult(_0x38da7f,null))[_0x6f00('0x40')](handleError(_0x38da7f,null));};exports['create']=function(_0x5330ea,_0x565423){return db[_0x6f00('0x27')][_0x6f00('0x45')](_0x5330ea[_0x6f00('0x46')],{})[_0x6f00('0x1f')](respondWithResult(_0x565423,0xc9))[_0x6f00('0x40')](handleError(_0x565423,null));};exports[_0x6f00('0x47')]=function(_0x189109,_0x23af58){if(_0x189109['body']['id']){delete _0x189109[_0x6f00('0x46')]['id'];}return db['VoiceMailMessage'][_0x6f00('0x44')]({'where':{'id':_0x189109[_0x6f00('0x41')]['id']}})[_0x6f00('0x1f')](handleEntityNotFound(_0x23af58,null))['then'](saveUpdates(_0x189109['body'],null))[_0x6f00('0x1f')](respondWithResult(_0x23af58,null))[_0x6f00('0x40')](handleError(_0x23af58,null));};exports['destroy']=function(_0x3b15c6,_0x4b2386){return db[_0x6f00('0x27')]['find']({'where':{'id':_0x3b15c6[_0x6f00('0x41')]['id']}})[_0x6f00('0x1f')](handleEntityNotFound(_0x4b2386,null))['then'](removeEntity(_0x4b2386,null))['catch'](handleError(_0x4b2386,null));};exports[_0x6f00('0x48')]=function(_0x2520ff,_0x4c6925,_0x1f2f76){return db['VoiceMailMessage'][_0x6f00('0x44')]({'where':{'id':_0x2520ff[_0x6f00('0x41')]['id']},'attributes':['id',_0x6f00('0x49'),_0x6f00('0x4a')]})[_0x6f00('0x1f')](handleEntityNotFound(_0x4c6925,null))[_0x6f00('0x1f')](function(_0x25b284){if(_0x25b284){if(!_0x25b284[_0x6f00('0x49')]){throw new db[(_0x6f00('0x4b'))][(_0x6f00('0x4c'))](_0x6f00('0x4d'));}var _0x75f030={'Content-Type':_0x6f00('0x4e'),'Content-Disposition':_0x6f00('0x4f')};if(_0x25b284[_0x6f00('0x4a')]){_0x75f030[_0x6f00('0x50')]=_0x6f00('0x51')+_0x25b284[_0x6f00('0x4a')]+_0x6f00('0x52');}_0x4c6925[_0x6f00('0x1a')](_0x75f030);return _0x4c6925['send'](new Buffer(_0x25b284['recording']));}})[_0x6f00('0x40')](handleError(_0x4c6925,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 415f591..3cb8a10 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 _0x3781=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','api','request-promise','path','rimraf'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0x3781,0x96));var _0x1378=function(_0x25b9a1,_0x3e141b){_0x25b9a1=_0x25b9a1-0x0;var _0x2dff67=_0x3781[_0x25b9a1];return _0x2dff67;};'use strict';var _=require(_0x1378('0x0'));var util=require(_0x1378('0x1'));var logger=require('../../config/logger')(_0x1378('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1378('0x3'));var fs=require('fs');var path=require(_0x1378('0x4'));var rimraf=require(_0x1378('0x5'));var config=require('../../config/environment');var attributes=require(_0x1378('0x6'));module[_0x1378('0x7')]=function(_0x4db45d,_0x38e1bd){return _0x4db45d[_0x1378('0x8')](_0x1378('0x9'),attributes,{'tableName':_0x1378('0xa'),'paranoid':![],'indexes':[{'name':_0x1378('0xb'),'fields':[_0x1378('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x307f=['moment','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','dir','lodash','../../config/logger','api'];(function(_0x2e9023,_0x39517c){var _0xf5caee=function(_0x5db545){while(--_0x5db545){_0x2e9023['push'](_0x2e9023['shift']());}};_0xf5caee(++_0x39517c);}(_0x307f,0x171));var _0xf307=function(_0x5c2ed0,_0x48017b){_0x5c2ed0=_0x5c2ed0-0x0;var _0x375482=_0x307f[_0x5c2ed0];return _0x375482;};'use strict';var _=require(_0xf307('0x0'));var util=require('util');var logger=require(_0xf307('0x1'))(_0xf307('0x2'));var moment=require(_0xf307('0x3'));var BPromise=require(_0xf307('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf307('0x5'));var rimraf=require(_0xf307('0x6'));var config=require(_0xf307('0x7'));var attributes=require(_0xf307('0x8'));module['exports']=function(_0x228ef1,_0x5d2532){return _0x228ef1[_0xf307('0x9')](_0xf307('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0xf307('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index a9ad8f7..d46f413 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x5e3af6,_0x3c97dd){var _0x215aa8=function(_0x3adef5){while(--_0x3adef5){_0x5e3af6['push'](_0x5e3af6['shift']());}};_0x215aa8(++_0x3c97dd);}(_0x14a0,0x8e));var _0x014a=function(_0x1b3f68,_0x87b81d){_0x1b3f68=_0x1b3f68-0x0;var _0x4341e9=_0x14a0[_0x1b3f68];return _0x4341e9;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x4959da,_0x33befc){var _0x453a70=function(_0x51d4b2){while(--_0x51d4b2){_0x4959da['push'](_0x4959da['shift']());}};_0x453a70(++_0x33befc);}(_0x1a85,0x178));var _0x51a8=function(_0x408758,_0x548c1f){_0x408758=_0x408758-0x0;var _0x2e25ae=_0x1a85[_0x408758];return _0x2e25ae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 01b5621..7df7b47 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 _0xf707=['/:id/sounds/:id2','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','create','post','addSound','put','destroy'];(function(_0xd6c010,_0x5355e6){var _0x15893b=function(_0x1b0a5a){while(--_0x1b0a5a){_0xd6c010['push'](_0xd6c010['shift']());}};_0x15893b(++_0x5355e6);}(_0xf707,0x128));var _0x7f70=function(_0xcc8881,_0x42c0a1){_0xcc8881=_0xcc8881-0x0;var _0x542a32=_0xf707[_0xcc8881];return _0x542a32;};'use strict';var multer=require(_0x7f70('0x0'));var util=require(_0x7f70('0x1'));var path=require('path');var timeout=require(_0x7f70('0x2'));var express=require(_0x7f70('0x3'));var router=express[_0x7f70('0x4')]();var auth=require(_0x7f70('0x5'));var interaction=require(_0x7f70('0x6'));var config=require(_0x7f70('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x7f70('0x8')]('/',auth[_0x7f70('0x9')](),controller[_0x7f70('0xa')]);router[_0x7f70('0x8')](_0x7f70('0xb'),auth[_0x7f70('0x9')](),controller['show']);router['get'](_0x7f70('0xc'),auth['isAuthenticated'](),controller[_0x7f70('0xd')]);router['post']('/',auth[_0x7f70('0x9')](),controller[_0x7f70('0xe')]);router[_0x7f70('0xf')]('/:id/sounds',auth[_0x7f70('0x9')](),controller[_0x7f70('0x10')]);router[_0x7f70('0x11')](_0x7f70('0xb'),auth[_0x7f70('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7f70('0x9')](),controller[_0x7f70('0x12')]);router['delete'](_0x7f70('0x13'),auth['isAuthenticated'](),controller['removeSound']);module[_0x7f70('0x14')]=router; \ No newline at end of file +var _0x184c=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','update','delete','/:id/sounds/:id2','removeSound','util','path'];(function(_0x38c699,_0x56fea7){var _0x3b1ded=function(_0x100851){while(--_0x100851){_0x38c699['push'](_0x38c699['shift']());}};_0x3b1ded(++_0x56fea7);}(_0x184c,0x148));var _0xc184=function(_0x284f0a,_0x3406ff){_0x284f0a=_0x284f0a-0x0;var _0xe3ea35=_0x184c[_0x284f0a];return _0xe3ea35;};'use strict';var multer=require('multer');var util=require(_0xc184('0x0'));var path=require(_0xc184('0x1'));var timeout=require(_0xc184('0x2'));var express=require(_0xc184('0x3'));var router=express[_0xc184('0x4')]();var auth=require(_0xc184('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc184('0x6'));var controller=require(_0xc184('0x7'));router[_0xc184('0x8')]('/',auth[_0xc184('0x9')](),controller['index']);router[_0xc184('0x8')](_0xc184('0xa'),auth[_0xc184('0x9')](),controller[_0xc184('0xb')]);router[_0xc184('0x8')](_0xc184('0xc'),auth[_0xc184('0x9')](),controller[_0xc184('0xd')]);router[_0xc184('0xe')]('/',auth[_0xc184('0x9')](),controller[_0xc184('0xf')]);router[_0xc184('0xe')](_0xc184('0xc'),auth['isAuthenticated'](),controller[_0xc184('0x10')]);router[_0xc184('0x11')](_0xc184('0xa'),auth[_0xc184('0x9')](),controller[_0xc184('0x12')]);router['delete'](_0xc184('0xa'),auth[_0xc184('0x9')](),controller['destroy']);router[_0xc184('0x13')](_0xc184('0x14'),auth['isAuthenticated'](),controller[_0xc184('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 3e6e358..d7b4e29 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 _0xa939=['exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','sequelize'];(function(_0x4a631e,_0x47af39){var _0x4834f5=function(_0x1d0fd0){while(--_0x1d0fd0){_0x4a631e['push'](_0x4a631e['shift']());}};_0x4834f5(++_0x47af39);}(_0xa939,0x83));var _0x9a93=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xa939[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x9a93('0x0'));module[_0x9a93('0x1')]={'name':{'type':Sequelize[_0x9a93('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x9a93('0x3')](_0x9a93('0x4'),_0x9a93('0x5'),_0x9a93('0x6'),_0x9a93('0x7'),'quietmp3',_0x9a93('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x9a93('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x9a93('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x9a93('0x2')],'allowNull':!![],'defaultValue':_0x9a93('0x9')},'format':{'type':Sequelize[_0x9a93('0x2')],'allowNull':!![]},'stamp':{'type':_0x9a93('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6867=['mp3','alpha','sequelize','STRING','name','ENUM','custom','files','mp3nb','quietmp3'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6867,0x98));var _0x7686=function(_0x494c7,_0x1e9b1d){_0x494c7=_0x494c7-0x0;var _0xf3e697=_0x6867[_0x494c7];return _0xf3e697;};'use strict';var Sequelize=require(_0x7686('0x0'));module['exports']={'name':{'type':Sequelize[_0x7686('0x1')],'allowNull':![],'unique':_0x7686('0x2')},'mode':{'type':Sequelize[_0x7686('0x3')](_0x7686('0x4'),_0x7686('0x5'),_0x7686('0x6'),'quietmp3nb',_0x7686('0x7'),_0x7686('0x8')),'allowNull':!![],'defaultValue':_0x7686('0x5')},'directory':{'type':Sequelize[_0x7686('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x7686('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x7686('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x7686('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 42df4ec..0a74802 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 _0x9160=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceMusicOnHold','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','include','findAll','rows','catch','params','rawAttributes','includeAll','options','find','body','create','sequelize','transaction','mode','directory','join','root','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','Sequelize','ValidationError','message','Sound','findOne','converted_format','server/files/sounds/converted','basename','extname','save_name','server/files/moh','format','%s.%s','symlinkSync','removeSound','id2','createdAt','unlinkSync','getSounds','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x21c3ac,_0x2a46bb){var _0x3c45ad=function(_0xa506ae){while(--_0xa506ae){_0x21c3ac['push'](_0x21c3ac['shift']());}};_0x3c45ad(++_0x2a46bb);}(_0x9160,0x1b5));var _0x0916=function(_0xaa62e8,_0xf61285){_0xaa62e8=_0xaa62e8-0x0;var _0x5da4a1=_0x9160[_0xaa62e8];return _0x5da4a1;};'use strict';var pdf=require(_0x0916('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0916('0x1'));var zipdir=require(_0x0916('0x2'));var jsonpatch=require(_0x0916('0x3'));var rp=require(_0x0916('0x4'));var moment=require(_0x0916('0x5'));var BPromise=require(_0x0916('0x6'));var Mustache=require(_0x0916('0x7'));var util=require('util');var path=require(_0x0916('0x8'));var sox=require(_0x0916('0x9'));var csv=require(_0x0916('0xa'));var ejs=require(_0x0916('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0916('0xc'));var crypto=require('crypto');var jsforce=require(_0x0916('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0916('0xa'));var querystring=require(_0x0916('0xe'));var Papa=require(_0x0916('0xf'));var Redis=require(_0x0916('0x10'));var authService=require(_0x0916('0x11'));var qs=require(_0x0916('0x12'));var as=require(_0x0916('0x13'));var hardwareService=require(_0x0916('0x14'));var logger=require(_0x0916('0x15'))(_0x0916('0x16'));var utils=require(_0x0916('0x17'));var config=require(_0x0916('0x18'));var db=require(_0x0916('0x19'))['db'];function respondWithStatusCode(_0xee01de,_0x13841e){_0x13841e=_0x13841e||0xcc;return function(_0x51c3e2){if(_0x51c3e2){return _0xee01de['sendStatus'](_0x13841e);}return _0xee01de[_0x0916('0x1a')](_0x13841e)[_0x0916('0x1b')]();};}function respondWithResult(_0x5c767b,_0x25cc90){_0x25cc90=_0x25cc90||0xc8;return function(_0x253ed8){if(_0x253ed8){return _0x5c767b[_0x0916('0x1a')](_0x25cc90)[_0x0916('0x1c')](_0x253ed8);}};}function respondWithFilteredResult(_0x29346e,_0x2f5da1){return function(_0x989547){if(_0x989547){var _0x95bfcc=_0x989547[_0x0916('0x1d')],_0x2d7464=_0x2f5da1[_0x0916('0x1e')],_0x5acb80=_0x2f5da1[_0x0916('0x1e')]+_0x2f5da1[_0x0916('0x1f')],_0x338028;if(_0x5acb80>=_0x95bfcc){_0x5acb80=_0x95bfcc;_0x338028=0xc8;}else{_0x338028=0xce;}_0x29346e[_0x0916('0x1a')](_0x338028);return _0x29346e[_0x0916('0x20')](_0x0916('0x21'),_0x2d7464+'-'+_0x5acb80+'/'+_0x95bfcc)[_0x0916('0x1c')](_0x989547);}return null;};}function patchUpdates(_0x31abec){return function(_0x3ddfdd){try{jsonpatch['apply'](_0x3ddfdd,_0x31abec,!![]);}catch(_0x43b332){return BPromise[_0x0916('0x22')](_0x43b332);}return _0x3ddfdd[_0x0916('0x23')]();};}function saveUpdates(_0x25450f,_0x58f3ca){return function(_0x532014){if(_0x532014){return _0x532014[_0x0916('0x24')](_0x25450f)[_0x0916('0x25')](function(_0x5b29a7){return _0x5b29a7;});}return null;};}function removeEntity(_0x2580af,_0x1da5a5){return function(_0x4952e7){if(_0x4952e7){return _0x4952e7[_0x0916('0x26')]()[_0x0916('0x25')](function(){var _0x44458d=_0x4952e7[_0x0916('0x27')]({'plain':!![]});var _0x1dfe26=_0x0916('0x28');return db[_0x0916('0x29')][_0x0916('0x26')]({'where':{'type':_0x1dfe26,'resourceId':_0x44458d['id']}})[_0x0916('0x25')](function(){return _0x4952e7;});})[_0x0916('0x25')](function(){_0x2580af[_0x0916('0x1a')](0xcc)[_0x0916('0x1b')]();});}};}function handleEntityNotFound(_0xe1eb9c,_0x48d8d0){return function(_0x42b35c){if(!_0x42b35c){_0xe1eb9c[_0x0916('0x2a')](0x194);}return _0x42b35c;};}function handleError(_0x488a17,_0x2ace00){_0x2ace00=_0x2ace00||0x1f4;return function(_0x3bdb9d){logger[_0x0916('0x2b')](_0x3bdb9d[_0x0916('0x2c')]);if(_0x3bdb9d[_0x0916('0x2d')]){delete _0x3bdb9d[_0x0916('0x2d')];}_0x488a17['status'](_0x2ace00)[_0x0916('0x2e')](_0x3bdb9d);};}exports[_0x0916('0x2f')]=function(_0x3ae8a0,_0x65796e){var _0x43cc99={},_0x2107be={},_0x1b3b84={'count':0x0,'rows':[]};var _0x1e9307=_[_0x0916('0x30')](db[_0x0916('0x31')]['rawAttributes'],function(_0x25d340){return{'name':_0x25d340['fieldName'],'type':_0x25d340['type']['key']};});_0x2107be[_0x0916('0x32')]=_[_0x0916('0x30')](_0x1e9307,_0x0916('0x2d'));_0x2107be[_0x0916('0x33')]=_[_0x0916('0x34')](_0x3ae8a0[_0x0916('0x33')]);_0x2107be[_0x0916('0x35')]=_[_0x0916('0x36')](_0x2107be['model'],_0x2107be[_0x0916('0x33')]);_0x43cc99['attributes']=_[_0x0916('0x36')](_0x2107be['model'],qs['fields'](_0x3ae8a0[_0x0916('0x33')][_0x0916('0x37')]));_0x43cc99[_0x0916('0x38')]=_0x43cc99[_0x0916('0x38')][_0x0916('0x39')]?_0x43cc99[_0x0916('0x38')]:_0x2107be['model'];if(!_0x3ae8a0['query'][_0x0916('0x3a')](_0x0916('0x3b'))){_0x43cc99[_0x0916('0x1f')]=qs[_0x0916('0x1f')](_0x3ae8a0[_0x0916('0x33')][_0x0916('0x1f')]);_0x43cc99[_0x0916('0x1e')]=qs[_0x0916('0x1e')](_0x3ae8a0[_0x0916('0x33')][_0x0916('0x1e')]);}_0x43cc99[_0x0916('0x3c')]=qs[_0x0916('0x3d')](_0x3ae8a0[_0x0916('0x33')]['sort']);_0x43cc99[_0x0916('0x3e')]=qs['filters'](_[_0x0916('0x3f')](_0x3ae8a0[_0x0916('0x33')],_0x2107be[_0x0916('0x35')]));if(_0x3ae8a0[_0x0916('0x33')][_0x0916('0x40')]){_0x43cc99[_0x0916('0x3e')]=_['merge'](_0x43cc99[_0x0916('0x3e')],{'$or':_['map'](_0x1e9307,function(_0x38a9cf){if(_0x38a9cf[_0x0916('0x41')]!==_0x0916('0x42')){var _0x501549={};_0x501549[_0x38a9cf[_0x0916('0x2d')]]={'$like':'%'+_0x3ae8a0[_0x0916('0x33')][_0x0916('0x40')]+'%'};return _0x501549;}})});}_0x43cc99=_[_0x0916('0x43')]({},_0x43cc99,_0x3ae8a0['options']);var _0x1c6d30={'where':_0x43cc99[_0x0916('0x3e')]};return db['VoiceMusicOnHold'][_0x0916('0x1d')](_0x1c6d30)[_0x0916('0x25')](function(_0x4e4113){_0x1b3b84[_0x0916('0x1d')]=_0x4e4113;if(_0x3ae8a0['query']['includeAll']){_0x43cc99[_0x0916('0x44')]=[{'all':!![]}];}return db[_0x0916('0x31')][_0x0916('0x45')](_0x43cc99);})['then'](function(_0x5b1f8b){_0x1b3b84[_0x0916('0x46')]=_0x5b1f8b;return _0x1b3b84;})[_0x0916('0x25')](respondWithFilteredResult(_0x65796e,_0x43cc99))[_0x0916('0x47')](handleError(_0x65796e,null));};exports['show']=function(_0x317a7f,_0x288214){var _0x3098c1={'raw':![],'where':{'id':_0x317a7f[_0x0916('0x48')]['id']}},_0x5cda05={};_0x5cda05[_0x0916('0x32')]=_[_0x0916('0x34')](db[_0x0916('0x31')][_0x0916('0x49')]);_0x5cda05[_0x0916('0x33')]=_[_0x0916('0x34')](_0x317a7f['query']);_0x5cda05[_0x0916('0x35')]=_[_0x0916('0x36')](_0x5cda05[_0x0916('0x32')],_0x5cda05[_0x0916('0x33')]);_0x3098c1['attributes']=_[_0x0916('0x36')](_0x5cda05[_0x0916('0x32')],qs[_0x0916('0x37')](_0x317a7f[_0x0916('0x33')][_0x0916('0x37')]));_0x3098c1[_0x0916('0x38')]=_0x3098c1['attributes']['length']?_0x3098c1[_0x0916('0x38')]:_0x5cda05[_0x0916('0x32')];if(_0x317a7f['query'][_0x0916('0x4a')]){_0x3098c1[_0x0916('0x44')]=[{'all':!![]}];}_0x3098c1=_[_0x0916('0x43')]({},_0x3098c1,_0x317a7f[_0x0916('0x4b')]);return db['VoiceMusicOnHold'][_0x0916('0x4c')](_0x3098c1)[_0x0916('0x25')](handleEntityNotFound(_0x288214,null))[_0x0916('0x25')](respondWithResult(_0x288214,null))['catch'](handleError(_0x288214,null));};exports['update']=function(_0x30abeb,_0x4d3922){if(_0x30abeb['body']['id']){delete _0x30abeb[_0x0916('0x4d')]['id'];}return db[_0x0916('0x31')]['find']({'where':{'id':_0x30abeb[_0x0916('0x48')]['id']}})[_0x0916('0x25')](handleEntityNotFound(_0x4d3922,null))[_0x0916('0x25')](saveUpdates(_0x30abeb[_0x0916('0x4d')],null))['then'](respondWithResult(_0x4d3922,null))[_0x0916('0x47')](handleError(_0x4d3922,null));};exports[_0x0916('0x4e')]=function(_0x520a53,_0x41fc73,_0x3c2ee2){return db[_0x0916('0x4f')][_0x0916('0x50')](function(_0x100458){if(_0x520a53[_0x0916('0x4d')][_0x0916('0x51')]==='files'){_0x520a53[_0x0916('0x4d')][_0x0916('0x52')]=path[_0x0916('0x53')](config[_0x0916('0x54')],'server/files/moh',_0x520a53[_0x0916('0x4d')][_0x0916('0x2d')]);}return db[_0x0916('0x31')][_0x0916('0x4e')](_0x520a53[_0x0916('0x4d')],{'transaction':_0x100458})[_0x0916('0x25')](function(_0x5771aa){if(_0x520a53[_0x0916('0x4d')]['mode']==='files'){fs[_0x0916('0x55')](_0x5771aa[_0x0916('0x52')],parseInt(_0x0916('0x56'),0x8));}var _0x38e753=_0x520a53[_0x0916('0x57')]['get']({'plain':!![]});if(!_0x38e753)throw new Error(_0x0916('0x58'));if(_0x38e753['role']===_0x0916('0x57')){var _0x2f3446=_0x5771aa[_0x0916('0x27')]({'plain':!![]});return db[_0x0916('0x59')][_0x0916('0x4c')]({'where':{'name':_0x0916('0x28'),'userProfileId':_0x38e753[_0x0916('0x5a')]},'raw':!![]})['then'](function(_0x2b6080){if(_0x2b6080&&_0x2b6080[_0x0916('0x5b')]===0x0){return db[_0x0916('0x29')][_0x0916('0x4e')]({'name':_0x2f3446[_0x0916('0x2d')],'resourceId':_0x2f3446['id'],'type':_0x2b6080[_0x0916('0x2d')],'sectionId':_0x2b6080['id']},{})['then'](function(){return _0x5771aa;});}else{return _0x5771aa;}})[_0x0916('0x47')](function(_0xd0454){logger[_0x0916('0x2b')](_0x0916('0x5c'),_0xd0454);});}return _0x5771aa;});})[_0x0916('0x25')](respondWithResult(_0x41fc73,0xc9))[_0x0916('0x47')](handleError(_0x41fc73,null));};exports[_0x0916('0x26')]=function(_0xf043b7,_0x46fb45,_0x269e8d){var _0x49116d;return db[_0x0916('0x31')][_0x0916('0x4c')]({'where':{'id':_0xf043b7[_0x0916('0x48')]['id']}})[_0x0916('0x25')](function(_0x542b03){if(_0x542b03){return db[_0x0916('0x4f')][_0x0916('0x50')](function(_0x5afa76){return _0x542b03['destroy']({'transaction':_0x5afa76,'raw':!![]})[_0x0916('0x25')](function(_0x241fd3){if(_0x241fd3[_0x0916('0x52')]){fs[_0x0916('0x5d')](_0x241fd3[_0x0916('0x52')])[_0x0916('0x5e')](function(_0x48c66c){fs['unlinkSync'](path['join'](_0x241fd3['directory'],_0x48c66c));});fs['rmdirSync'](_0x241fd3[_0x0916('0x52')]);}return _0x241fd3;});})[_0x0916('0x47')](function(_0x537704){throw new db[(_0x0916('0x5f'))][(_0x0916('0x60'))](_0x537704[_0x0916('0x61')]);});}})[_0x0916('0x25')](handleEntityNotFound(_0x46fb45,null))['then'](removeEntity(_0x46fb45,null))[_0x0916('0x47')](handleError(_0x46fb45,null));};exports['addSound']=function(_0x14d4e0,_0x5814a4,_0x59a918){return db[_0x0916('0x4f')]['transaction'](function(_0x27f78b){var _0xe14f28;return db[_0x0916('0x31')]['find']({'where':{'id':_0x14d4e0[_0x0916('0x48')]['id']}})[_0x0916('0x25')](function(_0xefedcd){if(_0xefedcd){_0xe14f28=_0xefedcd;return _0xefedcd['addSound'](_0x14d4e0[_0x0916('0x4d')]['id'],{'transaction':_0x27f78b});}})[_0x0916('0x25')](function(_0x5486aa){if(_0x5486aa){return db[_0x0916('0x62')][_0x0916('0x63')]({'where':{'id':_0x14d4e0['body']['id']},'attributes':['id',_0x0916('0x2d'),'save_name',_0x0916('0x64'),'createdAt'],'raw':!![]});}})[_0x0916('0x25')](function(_0x2f473e){if(_0x2f473e){var _0xa96429=path[_0x0916('0x53')](config[_0x0916('0x54')],_0x0916('0x65'),util['format']('%s.%s',path[_0x0916('0x66')](_0x2f473e['save_name'],path[_0x0916('0x67')](_0x2f473e[_0x0916('0x68')])),_0x2f473e[_0x0916('0x64')]));var _0x1c0dc6=path['join'](config[_0x0916('0x54')],_0x0916('0x69'),_0xe14f28[_0x0916('0x2d')],util[_0x0916('0x6a')](_0x0916('0x6b'),_0x2f473e[_0x0916('0x2d')],_0x2f473e[_0x0916('0x64')]));fs[_0x0916('0x6c')](_0xa96429,_0x1c0dc6);return _0x2f473e;}})[_0x0916('0x47')](function(_0x228cb4){throw new db[(_0x0916('0x5f'))]['ValidationError'](_0x228cb4[_0x0916('0x61')]);});})[_0x0916('0x25')](handleEntityNotFound(_0x5814a4,null))[_0x0916('0x25')](respondWithResult(_0x5814a4,0xc9))['catch'](handleError(_0x5814a4,null));};exports[_0x0916('0x6d')]=function(_0x4a7b8d,_0x20b2d9,_0x5a70e1){return db[_0x0916('0x4f')][_0x0916('0x50')](function(_0x7daf4a){var _0xd07eef;return db[_0x0916('0x31')]['findOne']({'where':{'id':_0x4a7b8d[_0x0916('0x48')]['id']}})[_0x0916('0x25')](handleEntityNotFound(_0x20b2d9,null))[_0x0916('0x25')](function(_0x4c6f68){if(_0x4c6f68){_0xd07eef=_0x4c6f68;return _0x4c6f68['removeSound'](_0x4a7b8d['params'][_0x0916('0x6e')]);}})[_0x0916('0x25')](function(_0x502611){if(_0x502611){return db[_0x0916('0x62')]['findOne']({'where':{'id':_0x4a7b8d[_0x0916('0x48')][_0x0916('0x6e')]},'attributes':['id','name',_0x0916('0x68'),_0x0916('0x64'),_0x0916('0x6f')],'raw':!![]});}})[_0x0916('0x25')](function(_0x193d6b){if(_0x193d6b){fs[_0x0916('0x70')](path[_0x0916('0x53')](_0xd07eef[_0x0916('0x52')],util[_0x0916('0x6a')](_0x0916('0x6b'),_0x193d6b[_0x0916('0x2d')],_0x193d6b[_0x0916('0x64')])));return _0x193d6b;}})[_0x0916('0x47')](function(_0x13ebb2){throw new db['Sequelize'][(_0x0916('0x60'))](_0x13ebb2[_0x0916('0x61')]);});})['then'](handleEntityNotFound(_0x20b2d9,null))['then'](respondWithStatusCode(_0x20b2d9,0xcc))[_0x0916('0x47')](handleError(_0x20b2d9,null));};exports[_0x0916('0x71')]=function(_0x244c3f,_0x5be813,_0x18307b){var _0x42c2a1={};var _0x51a50f={};var _0x2bc492;var _0x1b3dd6;return db[_0x0916('0x31')][_0x0916('0x63')]({'where':{'id':_0x244c3f['params']['id']}})[_0x0916('0x25')](handleEntityNotFound(_0x5be813,null))[_0x0916('0x25')](function(_0x17bf28){if(_0x17bf28){_0x2bc492=_0x17bf28;_0x51a50f[_0x0916('0x32')]=_[_0x0916('0x34')](db[_0x0916('0x62')]['rawAttributes']);_0x51a50f['query']=_[_0x0916('0x34')](_0x244c3f[_0x0916('0x33')]);_0x51a50f[_0x0916('0x35')]=_[_0x0916('0x36')](_0x51a50f[_0x0916('0x32')],_0x51a50f[_0x0916('0x33')]);_0x42c2a1[_0x0916('0x38')]=_[_0x0916('0x36')](_0x51a50f[_0x0916('0x32')],qs[_0x0916('0x37')](_0x244c3f[_0x0916('0x33')]['fields']));_0x42c2a1[_0x0916('0x38')]=_0x42c2a1[_0x0916('0x38')]['length']?_0x42c2a1[_0x0916('0x38')]:_0x51a50f[_0x0916('0x32')];_0x42c2a1[_0x0916('0x3c')]=qs[_0x0916('0x3d')](_0x244c3f['query'][_0x0916('0x3d')]);_0x42c2a1[_0x0916('0x3e')]=qs[_0x0916('0x35')](_['pick'](_0x244c3f[_0x0916('0x33')],_0x51a50f[_0x0916('0x35')]));if(_0x244c3f[_0x0916('0x33')][_0x0916('0x40')]){_0x42c2a1['where']=_[_0x0916('0x43')](_0x42c2a1[_0x0916('0x3e')],{'$or':_[_0x0916('0x30')](_0x42c2a1[_0x0916('0x38')],function(_0x1e8719){var _0x344941={};_0x344941[_0x1e8719]={'$like':'%'+_0x244c3f['query'][_0x0916('0x40')]+'%'};return _0x344941;})});}_0x42c2a1=_[_0x0916('0x43')]({},_0x42c2a1,_0x244c3f[_0x0916('0x4b')]);return _0x2bc492[_0x0916('0x71')](_0x42c2a1);}})[_0x0916('0x25')](function(_0x23267c){if(_0x23267c){_0x1b3dd6=_0x23267c[_0x0916('0x39')];if(!_0x244c3f['query'][_0x0916('0x3a')]('nolimit')){_0x42c2a1[_0x0916('0x1f')]=qs['limit'](_0x244c3f[_0x0916('0x33')][_0x0916('0x1f')]);_0x42c2a1[_0x0916('0x1e')]=qs[_0x0916('0x1e')](_0x244c3f[_0x0916('0x33')][_0x0916('0x1e')]);}return _0x2bc492[_0x0916('0x71')](_0x42c2a1);}})[_0x0916('0x25')](function(_0x183e08){if(_0x183e08){return _0x183e08?{'count':_0x1b3dd6,'rows':_0x183e08}:null;}})[_0x0916('0x25')](respondWithResult(_0x5be813,null))['catch'](handleError(_0x5be813,null));}; \ No newline at end of file +var _0xefb1=['Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','format','%s.%s','basename','save_name','extname','symlinkSync','removeSound','id2','sort','getSounds','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','where','filters','pick','filter','merge','type','options','includeAll','include','rows','params','length','body','catch','create','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','MusicOnHolds','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync'];(function(_0x29fefa,_0x3c9ba0){var _0x530b05=function(_0xc21842){while(--_0xc21842){_0x29fefa['push'](_0x29fefa['shift']());}};_0x530b05(++_0x3c9ba0);}(_0xefb1,0x150));var _0x1efb=function(_0x27135b,_0x5ce9a4){_0x27135b=_0x27135b-0x0;var _0x5c41f5=_0xefb1[_0x27135b];return _0x5c41f5;};'use strict';var pdf=require(_0x1efb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1efb('0x1'));var zipdir=require(_0x1efb('0x2'));var jsonpatch=require(_0x1efb('0x3'));var rp=require(_0x1efb('0x4'));var moment=require(_0x1efb('0x5'));var BPromise=require(_0x1efb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1efb('0x7'));var fs=require('fs');var _=require(_0x1efb('0x8'));var squel=require('squel');var crypto=require(_0x1efb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1efb('0xa'));var toCsv=require(_0x1efb('0xb'));var querystring=require('querystring');var Papa=require(_0x1efb('0xc'));var Redis=require(_0x1efb('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1efb('0xe'));var as=require(_0x1efb('0xf'));var hardwareService=require(_0x1efb('0x10'));var logger=require(_0x1efb('0x11'))(_0x1efb('0x12'));var utils=require(_0x1efb('0x13'));var config=require(_0x1efb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x126fbf,_0x50b3ac){_0x50b3ac=_0x50b3ac||0xcc;return function(_0x3e2a63){if(_0x3e2a63){return _0x126fbf[_0x1efb('0x15')](_0x50b3ac);}return _0x126fbf[_0x1efb('0x16')](_0x50b3ac)[_0x1efb('0x17')]();};}function respondWithResult(_0x45b055,_0x3205a3){_0x3205a3=_0x3205a3||0xc8;return function(_0x25c1cc){if(_0x25c1cc){return _0x45b055[_0x1efb('0x16')](_0x3205a3)[_0x1efb('0x18')](_0x25c1cc);}};}function respondWithFilteredResult(_0xccb24a,_0x2d2d5c){return function(_0x486531){if(_0x486531){var _0x30c844=_0x486531[_0x1efb('0x19')],_0x273233=_0x2d2d5c['offset'],_0x5397d1=_0x2d2d5c[_0x1efb('0x1a')]+_0x2d2d5c['limit'],_0x384cac;if(_0x5397d1>=_0x30c844){_0x5397d1=_0x30c844;_0x384cac=0xc8;}else{_0x384cac=0xce;}_0xccb24a[_0x1efb('0x16')](_0x384cac);return _0xccb24a[_0x1efb('0x1b')]('Content-Range',_0x273233+'-'+_0x5397d1+'/'+_0x30c844)['json'](_0x486531);}return null;};}function patchUpdates(_0x3136ad){return function(_0x40870e){try{jsonpatch['apply'](_0x40870e,_0x3136ad,!![]);}catch(_0x4495a4){return BPromise['reject'](_0x4495a4);}return _0x40870e[_0x1efb('0x1c')]();};}function saveUpdates(_0x49d5ef,_0x3db8bf){return function(_0x399032){if(_0x399032){return _0x399032[_0x1efb('0x1d')](_0x49d5ef)['then'](function(_0x42362f){return _0x42362f;});}return null;};}function removeEntity(_0x17cd3a,_0x23afce){return function(_0x121a19){if(_0x121a19){return _0x121a19['destroy']()[_0x1efb('0x1e')](function(){var _0xdb88ba=_0x121a19['get']({'plain':!![]});var _0x13aee8='MusicOnHolds';return db[_0x1efb('0x1f')][_0x1efb('0x20')]({'where':{'type':_0x13aee8,'resourceId':_0xdb88ba['id']}})[_0x1efb('0x1e')](function(){return _0x121a19;});})[_0x1efb('0x1e')](function(){_0x17cd3a[_0x1efb('0x16')](0xcc)[_0x1efb('0x17')]();});}};}function handleEntityNotFound(_0x371718,_0x51606e){return function(_0x1182ed){if(!_0x1182ed){_0x371718[_0x1efb('0x15')](0x194);}return _0x1182ed;};}function handleError(_0x10f0a1,_0x4e5505){_0x4e5505=_0x4e5505||0x1f4;return function(_0x206fb1){logger[_0x1efb('0x21')](_0x206fb1[_0x1efb('0x22')]);if(_0x206fb1[_0x1efb('0x23')]){delete _0x206fb1[_0x1efb('0x23')];}_0x10f0a1[_0x1efb('0x16')](_0x4e5505)[_0x1efb('0x24')](_0x206fb1);};}exports[_0x1efb('0x25')]=function(_0x26a788,_0x3441ae){var _0x1cdaf9={},_0x2b3216={},_0xebeae1={'count':0x0,'rows':[]};var _0xd476c9=_[_0x1efb('0x26')](db[_0x1efb('0x27')]['rawAttributes'],function(_0x564781){return{'name':_0x564781[_0x1efb('0x28')],'type':_0x564781['type'][_0x1efb('0x29')]};});_0x2b3216[_0x1efb('0x2a')]=_[_0x1efb('0x26')](_0xd476c9,'name');_0x2b3216[_0x1efb('0x2b')]=_[_0x1efb('0x2c')](_0x26a788[_0x1efb('0x2b')]);_0x2b3216['filters']=_[_0x1efb('0x2d')](_0x2b3216['model'],_0x2b3216[_0x1efb('0x2b')]);_0x1cdaf9[_0x1efb('0x2e')]=_[_0x1efb('0x2d')](_0x2b3216[_0x1efb('0x2a')],qs[_0x1efb('0x2f')](_0x26a788['query'][_0x1efb('0x2f')]));_0x1cdaf9[_0x1efb('0x2e')]=_0x1cdaf9['attributes']['length']?_0x1cdaf9[_0x1efb('0x2e')]:_0x2b3216[_0x1efb('0x2a')];if(!_0x26a788[_0x1efb('0x2b')]['hasOwnProperty'](_0x1efb('0x30'))){_0x1cdaf9[_0x1efb('0x31')]=qs[_0x1efb('0x31')](_0x26a788[_0x1efb('0x2b')][_0x1efb('0x31')]);_0x1cdaf9[_0x1efb('0x1a')]=qs['offset'](_0x26a788['query'][_0x1efb('0x1a')]);}_0x1cdaf9[_0x1efb('0x32')]=qs['sort'](_0x26a788[_0x1efb('0x2b')]['sort']);_0x1cdaf9[_0x1efb('0x33')]=qs[_0x1efb('0x34')](_[_0x1efb('0x35')](_0x26a788[_0x1efb('0x2b')],_0x2b3216[_0x1efb('0x34')]));if(_0x26a788[_0x1efb('0x2b')][_0x1efb('0x36')]){_0x1cdaf9[_0x1efb('0x33')]=_[_0x1efb('0x37')](_0x1cdaf9[_0x1efb('0x33')],{'$or':_['map'](_0xd476c9,function(_0x581608){if(_0x581608[_0x1efb('0x38')]!=='VIRTUAL'){var _0x2d076c={};_0x2d076c[_0x581608[_0x1efb('0x23')]]={'$like':'%'+_0x26a788['query'][_0x1efb('0x36')]+'%'};return _0x2d076c;}})});}_0x1cdaf9=_['merge']({},_0x1cdaf9,_0x26a788[_0x1efb('0x39')]);var _0x5b2ee0={'where':_0x1cdaf9[_0x1efb('0x33')]};return db['VoiceMusicOnHold'][_0x1efb('0x19')](_0x5b2ee0)[_0x1efb('0x1e')](function(_0x5a9596){_0xebeae1[_0x1efb('0x19')]=_0x5a9596;if(_0x26a788['query'][_0x1efb('0x3a')]){_0x1cdaf9[_0x1efb('0x3b')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x1cdaf9);})[_0x1efb('0x1e')](function(_0x4d8de1){_0xebeae1[_0x1efb('0x3c')]=_0x4d8de1;return _0xebeae1;})[_0x1efb('0x1e')](respondWithFilteredResult(_0x3441ae,_0x1cdaf9))['catch'](handleError(_0x3441ae,null));};exports['show']=function(_0xbcf4d0,_0x3ece3e){var _0x237991={'raw':![],'where':{'id':_0xbcf4d0[_0x1efb('0x3d')]['id']}},_0x59e5d1={};_0x59e5d1[_0x1efb('0x2a')]=_[_0x1efb('0x2c')](db[_0x1efb('0x27')]['rawAttributes']);_0x59e5d1['query']=_['keys'](_0xbcf4d0[_0x1efb('0x2b')]);_0x59e5d1[_0x1efb('0x34')]=_['intersection'](_0x59e5d1['model'],_0x59e5d1['query']);_0x237991[_0x1efb('0x2e')]=_['intersection'](_0x59e5d1[_0x1efb('0x2a')],qs[_0x1efb('0x2f')](_0xbcf4d0[_0x1efb('0x2b')]['fields']));_0x237991['attributes']=_0x237991[_0x1efb('0x2e')][_0x1efb('0x3e')]?_0x237991[_0x1efb('0x2e')]:_0x59e5d1[_0x1efb('0x2a')];if(_0xbcf4d0[_0x1efb('0x2b')][_0x1efb('0x3a')]){_0x237991['include']=[{'all':!![]}];}_0x237991=_['merge']({},_0x237991,_0xbcf4d0['options']);return db[_0x1efb('0x27')]['find'](_0x237991)['then'](handleEntityNotFound(_0x3ece3e,null))['then'](respondWithResult(_0x3ece3e,null))['catch'](handleError(_0x3ece3e,null));};exports[_0x1efb('0x1d')]=function(_0x34ca29,_0xbea977){if(_0x34ca29[_0x1efb('0x3f')]['id']){delete _0x34ca29[_0x1efb('0x3f')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x34ca29[_0x1efb('0x3d')]['id']}})['then'](handleEntityNotFound(_0xbea977,null))[_0x1efb('0x1e')](saveUpdates(_0x34ca29[_0x1efb('0x3f')],null))[_0x1efb('0x1e')](respondWithResult(_0xbea977,null))[_0x1efb('0x40')](handleError(_0xbea977,null));};exports[_0x1efb('0x41')]=function(_0x185bbe,_0x1ff30f,_0x2e1697){return db['sequelize'][_0x1efb('0x42')](function(_0x1e7758){if(_0x185bbe[_0x1efb('0x3f')][_0x1efb('0x43')]===_0x1efb('0x44')){_0x185bbe[_0x1efb('0x3f')][_0x1efb('0x45')]=path[_0x1efb('0x46')](config[_0x1efb('0x47')],_0x1efb('0x48'),_0x185bbe[_0x1efb('0x3f')]['name']);}return db[_0x1efb('0x27')][_0x1efb('0x41')](_0x185bbe[_0x1efb('0x3f')],{'transaction':_0x1e7758})[_0x1efb('0x1e')](function(_0x2a4453){if(_0x185bbe[_0x1efb('0x3f')][_0x1efb('0x43')]==='files'){fs[_0x1efb('0x49')](_0x2a4453['directory'],parseInt(_0x1efb('0x4a'),0x8));}var _0x1e2d13=_0x185bbe[_0x1efb('0x4b')][_0x1efb('0x4c')]({'plain':!![]});if(!_0x1e2d13)throw new Error(_0x1efb('0x4d'));if(_0x1e2d13[_0x1efb('0x4e')]===_0x1efb('0x4b')){var _0xa2ed9b=_0x2a4453[_0x1efb('0x4c')]({'plain':!![]});return db[_0x1efb('0x4f')][_0x1efb('0x50')]({'where':{'name':_0x1efb('0x51'),'userProfileId':_0x1e2d13[_0x1efb('0x52')]},'raw':!![]})['then'](function(_0x39b26f){if(_0x39b26f&&_0x39b26f['autoAssociation']===0x0){return db[_0x1efb('0x1f')][_0x1efb('0x41')]({'name':_0xa2ed9b[_0x1efb('0x23')],'resourceId':_0xa2ed9b['id'],'type':_0x39b26f[_0x1efb('0x23')],'sectionId':_0x39b26f['id']},{})[_0x1efb('0x1e')](function(){return _0x2a4453;});}else{return _0x2a4453;}})[_0x1efb('0x40')](function(_0x47b503){logger[_0x1efb('0x21')](_0x1efb('0x53'),_0x47b503);});}return _0x2a4453;});})[_0x1efb('0x1e')](respondWithResult(_0x1ff30f,0xc9))[_0x1efb('0x40')](handleError(_0x1ff30f,null));};exports['destroy']=function(_0x11d4a2,_0x210883,_0x5d69ed){var _0x547156;return db[_0x1efb('0x27')][_0x1efb('0x50')]({'where':{'id':_0x11d4a2['params']['id']}})['then'](function(_0x7c0fb){if(_0x7c0fb){return db[_0x1efb('0x54')][_0x1efb('0x42')](function(_0x521ea6){return _0x7c0fb['destroy']({'transaction':_0x521ea6,'raw':!![]})[_0x1efb('0x1e')](function(_0x1d60a5){if(_0x1d60a5['directory']){fs[_0x1efb('0x55')](_0x1d60a5[_0x1efb('0x45')])[_0x1efb('0x56')](function(_0xb5c62){fs[_0x1efb('0x57')](path[_0x1efb('0x46')](_0x1d60a5[_0x1efb('0x45')],_0xb5c62));});fs['rmdirSync'](_0x1d60a5[_0x1efb('0x45')]);}return _0x1d60a5;});})['catch'](function(_0x8f98de){throw new db[(_0x1efb('0x58'))][(_0x1efb('0x59'))](_0x8f98de[_0x1efb('0x5a')]);});}})['then'](handleEntityNotFound(_0x210883,null))[_0x1efb('0x1e')](removeEntity(_0x210883,null))[_0x1efb('0x40')](handleError(_0x210883,null));};exports[_0x1efb('0x5b')]=function(_0x3e32ec,_0x5b506d,_0x2d42f4){return db[_0x1efb('0x54')]['transaction'](function(_0xc459aa){var _0x310848;return db['VoiceMusicOnHold'][_0x1efb('0x50')]({'where':{'id':_0x3e32ec[_0x1efb('0x3d')]['id']}})['then'](function(_0xc36f0e){if(_0xc36f0e){_0x310848=_0xc36f0e;return _0xc36f0e[_0x1efb('0x5b')](_0x3e32ec['body']['id'],{'transaction':_0xc459aa});}})[_0x1efb('0x1e')](function(_0x2eab72){if(_0x2eab72){return db[_0x1efb('0x5c')][_0x1efb('0x5d')]({'where':{'id':_0x3e32ec[_0x1efb('0x3f')]['id']},'attributes':['id','name','save_name',_0x1efb('0x5e'),_0x1efb('0x5f')],'raw':!![]});}})[_0x1efb('0x1e')](function(_0x734524){if(_0x734524){var _0x32a414=path[_0x1efb('0x46')](config[_0x1efb('0x47')],'server/files/sounds/converted',util[_0x1efb('0x60')](_0x1efb('0x61'),path[_0x1efb('0x62')](_0x734524[_0x1efb('0x63')],path[_0x1efb('0x64')](_0x734524[_0x1efb('0x63')])),_0x734524[_0x1efb('0x5e')]));var _0x34e539=path[_0x1efb('0x46')](config[_0x1efb('0x47')],'server/files/moh',_0x310848['name'],util[_0x1efb('0x60')](_0x1efb('0x61'),_0x734524[_0x1efb('0x23')],_0x734524[_0x1efb('0x5e')]));fs[_0x1efb('0x65')](_0x32a414,_0x34e539);return _0x734524;}})[_0x1efb('0x40')](function(_0x1f7146){throw new db[(_0x1efb('0x58'))]['ValidationError'](_0x1f7146[_0x1efb('0x5a')]);});})['then'](handleEntityNotFound(_0x5b506d,null))[_0x1efb('0x1e')](respondWithResult(_0x5b506d,0xc9))['catch'](handleError(_0x5b506d,null));};exports[_0x1efb('0x66')]=function(_0x3b7aac,_0x32f260,_0xf5ae69){return db['sequelize'][_0x1efb('0x42')](function(_0x368218){var _0x503790;return db['VoiceMusicOnHold'][_0x1efb('0x5d')]({'where':{'id':_0x3b7aac['params']['id']}})['then'](handleEntityNotFound(_0x32f260,null))['then'](function(_0x32cfea){if(_0x32cfea){_0x503790=_0x32cfea;return _0x32cfea[_0x1efb('0x66')](_0x3b7aac['params'][_0x1efb('0x67')]);}})[_0x1efb('0x1e')](function(_0x4cc5f5){if(_0x4cc5f5){return db[_0x1efb('0x5c')][_0x1efb('0x5d')]({'where':{'id':_0x3b7aac[_0x1efb('0x3d')][_0x1efb('0x67')]},'attributes':['id',_0x1efb('0x23'),_0x1efb('0x63'),_0x1efb('0x5e'),_0x1efb('0x5f')],'raw':!![]});}})['then'](function(_0x541706){if(_0x541706){fs[_0x1efb('0x57')](path[_0x1efb('0x46')](_0x503790[_0x1efb('0x45')],util[_0x1efb('0x60')]('%s.%s',_0x541706[_0x1efb('0x23')],_0x541706[_0x1efb('0x5e')])));return _0x541706;}})['catch'](function(_0x1ae212){throw new db[(_0x1efb('0x58'))]['ValidationError'](_0x1ae212['message']);});})[_0x1efb('0x1e')](handleEntityNotFound(_0x32f260,null))['then'](respondWithStatusCode(_0x32f260,0xcc))[_0x1efb('0x40')](handleError(_0x32f260,null));};exports['getSounds']=function(_0x37cc64,_0x2e22a4,_0x2e0115){var _0x5d42dc={};var _0x36c992={};var _0x1345d9;var _0x1de5c9;return db[_0x1efb('0x27')]['findOne']({'where':{'id':_0x37cc64[_0x1efb('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2e22a4,null))['then'](function(_0x14875a){if(_0x14875a){_0x1345d9=_0x14875a;_0x36c992[_0x1efb('0x2a')]=_[_0x1efb('0x2c')](db[_0x1efb('0x5c')]['rawAttributes']);_0x36c992[_0x1efb('0x2b')]=_[_0x1efb('0x2c')](_0x37cc64[_0x1efb('0x2b')]);_0x36c992[_0x1efb('0x34')]=_[_0x1efb('0x2d')](_0x36c992['model'],_0x36c992['query']);_0x5d42dc[_0x1efb('0x2e')]=_[_0x1efb('0x2d')](_0x36c992[_0x1efb('0x2a')],qs[_0x1efb('0x2f')](_0x37cc64[_0x1efb('0x2b')]['fields']));_0x5d42dc[_0x1efb('0x2e')]=_0x5d42dc['attributes'][_0x1efb('0x3e')]?_0x5d42dc[_0x1efb('0x2e')]:_0x36c992[_0x1efb('0x2a')];_0x5d42dc[_0x1efb('0x32')]=qs[_0x1efb('0x68')](_0x37cc64['query'][_0x1efb('0x68')]);_0x5d42dc[_0x1efb('0x33')]=qs['filters'](_[_0x1efb('0x35')](_0x37cc64[_0x1efb('0x2b')],_0x36c992[_0x1efb('0x34')]));if(_0x37cc64['query']['filter']){_0x5d42dc['where']=_[_0x1efb('0x37')](_0x5d42dc[_0x1efb('0x33')],{'$or':_[_0x1efb('0x26')](_0x5d42dc[_0x1efb('0x2e')],function(_0x37318a){var _0x76cd26={};_0x76cd26[_0x37318a]={'$like':'%'+_0x37cc64[_0x1efb('0x2b')]['filter']+'%'};return _0x76cd26;})});}_0x5d42dc=_['merge']({},_0x5d42dc,_0x37cc64[_0x1efb('0x39')]);return _0x1345d9['getSounds'](_0x5d42dc);}})[_0x1efb('0x1e')](function(_0x2b833a){if(_0x2b833a){_0x1de5c9=_0x2b833a[_0x1efb('0x3e')];if(!_0x37cc64['query']['hasOwnProperty'](_0x1efb('0x30'))){_0x5d42dc['limit']=qs['limit'](_0x37cc64[_0x1efb('0x2b')][_0x1efb('0x31')]);_0x5d42dc[_0x1efb('0x1a')]=qs[_0x1efb('0x1a')](_0x37cc64[_0x1efb('0x2b')][_0x1efb('0x1a')]);}return _0x1345d9[_0x1efb('0x69')](_0x5d42dc);}})[_0x1efb('0x1e')](function(_0x52cbc1){if(_0x52cbc1){return _0x52cbc1?{'count':_0x1de5c9,'rows':_0x52cbc1}:null;}})[_0x1efb('0x1e')](respondWithResult(_0x2e22a4,null))[_0x1efb('0x40')](handleError(_0x2e22a4,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 8c82eea..77c7bd4 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 _0x2fba=['voice_musiconhold','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','VoiceMusicOnHold'];(function(_0x1df5b6,_0x593828){var _0x28affd=function(_0xdc2eba){while(--_0xdc2eba){_0x1df5b6['push'](_0x1df5b6['shift']());}};_0x28affd(++_0x593828);}(_0x2fba,0x139));var _0xa2fb=function(_0x9c2772,_0x5a457a){_0x9c2772=_0x9c2772-0x0;var _0x1680c9=_0x2fba[_0x9c2772];return _0x1680c9;};'use strict';var _=require(_0xa2fb('0x0'));var util=require(_0xa2fb('0x1'));var logger=require(_0xa2fb('0x2'))('api');var moment=require(_0xa2fb('0x3'));var BPromise=require(_0xa2fb('0x4'));var rp=require(_0xa2fb('0x5'));var fs=require('fs');var path=require(_0xa2fb('0x6'));var rimraf=require(_0xa2fb('0x7'));var config=require(_0xa2fb('0x8'));var attributes=require(_0xa2fb('0x9'));module['exports']=function(_0x5243c2,_0x46a825){return _0x5243c2['define'](_0xa2fb('0xa'),attributes,{'tableName':_0xa2fb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8fc=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','util'];(function(_0x5c13bd,_0x225d2a){var _0x173c78=function(_0x4b7d9d){while(--_0x4b7d9d){_0x5c13bd['push'](_0x5c13bd['shift']());}};_0x173c78(++_0x225d2a);}(_0xc8fc,0x78));var _0xcc8f=function(_0xbaea09,_0x1d2ea5){_0xbaea09=_0xbaea09-0x0;var _0x1c54f6=_0xc8fc[_0xbaea09];return _0x1c54f6;};'use strict';var _=require('lodash');var util=require(_0xcc8f('0x0'));var logger=require(_0xcc8f('0x1'))('api');var moment=require(_0xcc8f('0x2'));var BPromise=require(_0xcc8f('0x3'));var rp=require(_0xcc8f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc8f('0x5'));var config=require(_0xcc8f('0x6'));var attributes=require(_0xcc8f('0x7'));module[_0xcc8f('0x8')]=function(_0x60995f,_0x499640){return _0x60995f[_0xcc8f('0x9')](_0xcc8f('0xa'),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 b1674a1..3c2c37f 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 _0xa64a=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x5aae9f,_0x5c4f87){var _0x6051ca=function(_0x31c1df){while(--_0x31c1df){_0x5aae9f['push'](_0x5aae9f['shift']());}};_0x6051ca(++_0x5c4f87);}(_0xa64a,0x1df));var _0xaa64=function(_0xc67f7f,_0xc6dc1d){_0xc67f7f=_0xc67f7f-0x0;var _0x5aa9da=_0xa64a[_0xc67f7f];return _0x5aa9da;};'use strict';var _=require(_0xaa64('0x0'));var util=require(_0xaa64('0x1'));var moment=require(_0xaa64('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa64('0x3'));var fs=require('fs');var Redis=require(_0xaa64('0x4'));var db=require(_0xaa64('0x5'))['db'];var utils=require(_0xaa64('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xaa64('0x7'));var jayson=require(_0xaa64('0x8'));var client=jayson[_0xaa64('0x9')][_0xaa64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dae2,_0x1ee8bf,_0x42d394){return new BPromise(function(_0x480a6b,_0x10677b){return client[_0xaa64('0xb')](_0x27dae2,_0x42d394)[_0xaa64('0xc')](function(_0x504473){logger[_0xaa64('0xd')](_0xaa64('0xe'),_0x1ee8bf,_0xaa64('0xf'));logger[_0xaa64('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x1ee8bf,'request\x20sent',JSON[_0xaa64('0x11')](_0x504473));if(_0x504473[_0xaa64('0x12')]){if(_0x504473['error'][_0xaa64('0x13')]===0x1f4){logger[_0xaa64('0x12')](_0xaa64('0xe'),_0x1ee8bf,_0x504473['error'][_0xaa64('0x14')]);return _0x10677b(_0x504473[_0xaa64('0x12')]['message']);}logger[_0xaa64('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x1ee8bf,_0x504473[_0xaa64('0x12')][_0xaa64('0x14')]);return _0x480a6b(_0x504473[_0xaa64('0x12')]['message']);}else{logger['info'](_0xaa64('0xe'),_0x1ee8bf,_0xaa64('0xf'));_0x480a6b(_0x504473[_0xaa64('0x15')]['message']);}})['catch'](function(_0x501a6e){logger[_0xaa64('0x12')](_0xaa64('0xe'),_0x1ee8bf,_0x501a6e);_0x10677b(_0x501a6e);});});} \ No newline at end of file +var _0xd835=['request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x362056,_0x2e7ba2){var _0x1f807f=function(_0x5eee27){while(--_0x5eee27){_0x362056['push'](_0x362056['shift']());}};_0x1f807f(++_0x2e7ba2);}(_0xd835,0x139));var _0x5d83=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0xd835[_0x587dd0];return _0x56f153;};'use strict';var _=require(_0x5d83('0x0'));var util=require(_0x5d83('0x1'));var moment=require(_0x5d83('0x2'));var BPromise=require(_0x5d83('0x3'));var rs=require(_0x5d83('0x4'));var fs=require('fs');var Redis=require(_0x5d83('0x5'));var db=require(_0x5d83('0x6'))['db'];var utils=require(_0x5d83('0x7'));var logger=require(_0x5d83('0x8'))(_0x5d83('0x9'));var config=require('../../config/environment');var jayson=require(_0x5d83('0xa'));var client=jayson[_0x5d83('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35a096,_0x488fc3,_0x253a3c){return new BPromise(function(_0x857479,_0x483d5e){return client[_0x5d83('0xc')](_0x35a096,_0x253a3c)[_0x5d83('0xd')](function(_0x311a37){logger[_0x5d83('0xe')](_0x5d83('0xf'),_0x488fc3,_0x5d83('0x10'));logger[_0x5d83('0x11')](_0x5d83('0x12'),_0x488fc3,_0x5d83('0x10'),JSON[_0x5d83('0x13')](_0x311a37));if(_0x311a37[_0x5d83('0x14')]){if(_0x311a37[_0x5d83('0x14')][_0x5d83('0x15')]===0x1f4){logger[_0x5d83('0x14')](_0x5d83('0xf'),_0x488fc3,_0x311a37[_0x5d83('0x14')][_0x5d83('0x16')]);return _0x483d5e(_0x311a37['error'][_0x5d83('0x16')]);}logger[_0x5d83('0x14')](_0x5d83('0xf'),_0x488fc3,_0x311a37[_0x5d83('0x14')][_0x5d83('0x16')]);return _0x857479(_0x311a37[_0x5d83('0x14')][_0x5d83('0x16')]);}else{logger[_0x5d83('0xe')](_0x5d83('0xf'),_0x488fc3,_0x5d83('0x10'));_0x857479(_0x311a37[_0x5d83('0x17')][_0x5d83('0x16')]);}})[_0x5d83('0x18')](function(_0x380007){logger[_0x5d83('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x488fc3,_0x380007);_0x483d5e(_0x380007);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 9130623..76760f8 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 _0x3b9f=['../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','post','create','update','destroy','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4e2148,_0x382a2c){var _0x323345=function(_0x426339){while(--_0x426339){_0x4e2148['push'](_0x4e2148['shift']());}};_0x323345(++_0x382a2c);}(_0x3b9f,0x1f3));var _0xf3b9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3b9f[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf3b9('0x0'));var timeout=require(_0xf3b9('0x1'));var express=require(_0xf3b9('0x2'));var router=express[_0xf3b9('0x3')]();var auth=require(_0xf3b9('0x4'));var interaction=require(_0xf3b9('0x5'));var config=require(_0xf3b9('0x6'));var controller=require(_0xf3b9('0x7'));router[_0xf3b9('0x8')]('/',auth[_0xf3b9('0x9')](),controller[_0xf3b9('0xa')]);router[_0xf3b9('0x8')]('/describe',auth[_0xf3b9('0x9')](),controller[_0xf3b9('0xb')]);router[_0xf3b9('0x8')](_0xf3b9('0xc'),auth['isAuthenticated'](),controller[_0xf3b9('0xd')]);router[_0xf3b9('0x8')](_0xf3b9('0xe'),auth['isAuthenticated'](),controller['getAgents']);router[_0xf3b9('0xf')]('/',auth[_0xf3b9('0x9')](),controller[_0xf3b9('0x10')]);router['post'](_0xf3b9('0xe'),auth[_0xf3b9('0x9')](),controller['addAgents']);router['put'](_0xf3b9('0xc'),auth[_0xf3b9('0x9')](),controller[_0xf3b9('0x11')]);router['delete']('/:id',auth[_0xf3b9('0x9')](),controller[_0xf3b9('0x12')]);router['delete'](_0xf3b9('0xe'),auth[_0xf3b9('0x9')](),controller[_0xf3b9('0x13')]);module[_0xf3b9('0x14')]=router; \ No newline at end of file +var _0xc21b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeAgents','exports','path'];(function(_0x35009a,_0x4c647b){var _0x41ae8a=function(_0x594c04){while(--_0x594c04){_0x35009a['push'](_0x35009a['shift']());}};_0x41ae8a(++_0x4c647b);}(_0xc21b,0x113));var _0xbc21=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc21b[_0x413feb];return _0x40ee88;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc21('0x0'));var timeout=require(_0xbc21('0x1'));var express=require(_0xbc21('0x2'));var router=express[_0xbc21('0x3')]();var auth=require(_0xbc21('0x4'));var interaction=require(_0xbc21('0x5'));var config=require(_0xbc21('0x6'));var controller=require(_0xbc21('0x7'));router[_0xbc21('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbc21('0x8')]('/describe',auth[_0xbc21('0x9')](),controller[_0xbc21('0xa')]);router[_0xbc21('0x8')](_0xbc21('0xb'),auth[_0xbc21('0x9')](),controller[_0xbc21('0xc')]);router[_0xbc21('0x8')](_0xbc21('0xd'),auth[_0xbc21('0x9')](),controller[_0xbc21('0xe')]);router[_0xbc21('0xf')]('/',auth[_0xbc21('0x9')](),controller[_0xbc21('0x10')]);router[_0xbc21('0xf')](_0xbc21('0xd'),auth[_0xbc21('0x9')](),controller[_0xbc21('0x11')]);router[_0xbc21('0x12')](_0xbc21('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xbc21('0x13')](_0xbc21('0xb'),auth[_0xbc21('0x9')](),controller[_0xbc21('0x14')]);router[_0xbc21('0x13')](_0xbc21('0xd'),auth['isAuthenticated'](),controller[_0xbc21('0x15')]);module[_0xbc21('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 3a16b11..34d414f 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 _0xe0d3=['STRING','INTEGER','sequelize','exports','name','VIRTUAL','system-','getDataValue'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xe0d3,0x1a2));var _0x3e0d=function(_0x16d2c0,_0x10b91c){_0x16d2c0=_0x16d2c0-0x0;var _0x104177=_0xe0d3[_0x16d2c0];return _0x104177;};'use strict';var Sequelize=require(_0x3e0d('0x0'));module[_0x3e0d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3e0d('0x2')},'prefix':{'type':Sequelize[_0x3e0d('0x3')],'get':function(_0x329467){return _0x3e0d('0x4')+this[_0x3e0d('0x5')](_0x3e0d('0x2'))+'-';}},'description':{'type':Sequelize[_0x3e0d('0x6')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x3e0d('0x7')]}}; \ No newline at end of file +var _0x5216=['getDataValue','exports','STRING','name','system-'];(function(_0x47c19d,_0x2f6f74){var _0x4fc740=function(_0x475d61){while(--_0x475d61){_0x47c19d['push'](_0x47c19d['shift']());}};_0x4fc740(++_0x2f6f74);}(_0x5216,0x146));var _0x6521=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5216[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6521('0x0')]={'name':{'type':Sequelize[_0x6521('0x1')],'allowNull':![],'unique':_0x6521('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x4f8ec1){return _0x6521('0x3')+this[_0x6521('0x4')](_0x6521('0x2'))+'-';}},'description':{'type':Sequelize[_0x6521('0x1')]},'callerIdAll':{'type':Sequelize[_0x6521('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4064b4f..6b6bc71 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 _0x1c8a=['moment','bluebird','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','intersection','find','describe','create','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','error','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','bulkCreate','Extensions\x20creation\x20failed','CDR(prefix)=','callerIdAll','push','No\x20callerid\x20available','context','length','charAt','system-','sequelize','transaction','findById','addAgents','body','omit','ids','emit','userVoicePrefix:save','removeAgents','params','isArray','userVoicePrefix:remove','order','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3f452e,_0x313c85){var _0xacff82=function(_0x55bc12){while(--_0x55bc12){_0x3f452e['push'](_0x3f452e['shift']());}};_0xacff82(++_0x313c85);}(_0x1c8a,0x162));var _0xa1c8=function(_0xdf54be,_0x1e89e5){_0xdf54be=_0xdf54be-0x0;var _0x465020=_0x1c8a[_0xdf54be];return _0x465020;};'use strict';var pdf=require(_0xa1c8('0x0'));var emlformat=require(_0xa1c8('0x1'));var rimraf=require(_0xa1c8('0x2'));var zipdir=require(_0xa1c8('0x3'));var jsonpatch=require(_0xa1c8('0x4'));var rp=require(_0xa1c8('0x5'));var moment=require(_0xa1c8('0x6'));var BPromise=require(_0xa1c8('0x7'));var Mustache=require('mustache');var util=require(_0xa1c8('0x8'));var path=require(_0xa1c8('0x9'));var sox=require(_0xa1c8('0xa'));var csv=require('to-csv');var ejs=require(_0xa1c8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa1c8('0xc'));var crypto=require('crypto');var jsforce=require(_0xa1c8('0xd'));var deskjs=require(_0xa1c8('0xe'));var toCsv=require(_0xa1c8('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa1c8('0x10'));var authService=require(_0xa1c8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa1c8('0x12'));var hardwareService=require(_0xa1c8('0x13'));var logger=require(_0xa1c8('0x14'))(_0xa1c8('0x15'));var utils=require(_0xa1c8('0x16'));var config=require(_0xa1c8('0x17'));var db=require('../../mysqldb')['db'];config[_0xa1c8('0x18')]=_[_0xa1c8('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa1c8('0x1a'))(new Redis(config[_0xa1c8('0x18')]));require(_0xa1c8('0x1b'))[_0xa1c8('0x1c')](socket);function respondWithStatusCode(_0x4b8ed8,_0x589fb2){_0x589fb2=_0x589fb2||0xcc;return function(_0x3077e4){if(_0x3077e4){return _0x4b8ed8['sendStatus'](_0x589fb2);}return _0x4b8ed8[_0xa1c8('0x1d')](_0x589fb2)[_0xa1c8('0x1e')]();};}function respondWithResult(_0x8679cf,_0x1e7a15){_0x1e7a15=_0x1e7a15||0xc8;return function(_0x589b5f){if(_0x589b5f){return _0x8679cf[_0xa1c8('0x1d')](_0x1e7a15)[_0xa1c8('0x1f')](_0x589b5f);}};}function respondWithFilteredResult(_0x420d81,_0x5400d7){return function(_0x1a7691){if(_0x1a7691){var _0x55a1b2=_0x1a7691[_0xa1c8('0x20')],_0x2d08d6=_0x5400d7[_0xa1c8('0x21')],_0x470043=_0x5400d7[_0xa1c8('0x21')]+_0x5400d7[_0xa1c8('0x22')],_0x178da9;if(_0x470043>=_0x55a1b2){_0x470043=_0x55a1b2;_0x178da9=0xc8;}else{_0x178da9=0xce;}_0x420d81[_0xa1c8('0x1d')](_0x178da9);return _0x420d81[_0xa1c8('0x23')](_0xa1c8('0x24'),_0x2d08d6+'-'+_0x470043+'/'+_0x55a1b2)[_0xa1c8('0x1f')](_0x1a7691);}return null;};}function patchUpdates(_0x4c21e4){return function(_0x38e94d){try{jsonpatch[_0xa1c8('0x25')](_0x38e94d,_0x4c21e4,!![]);}catch(_0xa13841){return BPromise[_0xa1c8('0x26')](_0xa13841);}return _0x38e94d['save']();};}function saveUpdates(_0x46fe59,_0x470e6e){return function(_0x4d9fb7){if(_0x4d9fb7){return _0x4d9fb7[_0xa1c8('0x27')](_0x46fe59)[_0xa1c8('0x28')](function(_0x58492e){return _0x58492e;});}return null;};}function removeEntity(_0x4979f7,_0xf74a9a){return function(_0x6b4c31){if(_0x6b4c31){return _0x6b4c31[_0xa1c8('0x29')]()[_0xa1c8('0x28')](function(){var _0x54086d=_0x6b4c31[_0xa1c8('0x2a')]({'plain':!![]});var _0x4815fd='VoicePrefixes';return db[_0xa1c8('0x2b')][_0xa1c8('0x29')]({'where':{'type':_0x4815fd,'resourceId':_0x54086d['id']}})[_0xa1c8('0x28')](function(){return _0x6b4c31;});})[_0xa1c8('0x28')](function(){_0x4979f7['status'](0xcc)[_0xa1c8('0x1e')]();});}};}function handleEntityNotFound(_0x2aa0f8,_0x4001ff){return function(_0x5ef649){if(!_0x5ef649){_0x2aa0f8[_0xa1c8('0x2c')](0x194);}return _0x5ef649;};}function handleError(_0x3131af,_0x4e7a96){_0x4e7a96=_0x4e7a96||0x1f4;return function(_0x5c4dc6){logger['error'](_0x5c4dc6[_0xa1c8('0x2d')]);if(_0x5c4dc6['name']){delete _0x5c4dc6[_0xa1c8('0x2e')];}_0x3131af['status'](_0x4e7a96)[_0xa1c8('0x2f')](_0x5c4dc6);};}exports[_0xa1c8('0x30')]=function(_0x5b51a6,_0x16e963){var _0x3d9c49={},_0x39b4ca={},_0x2a4825={'count':0x0,'rows':[]};var _0x52f12b=_[_0xa1c8('0x31')](db[_0xa1c8('0x32')][_0xa1c8('0x33')],function(_0x1a70c3){return{'name':_0x1a70c3[_0xa1c8('0x34')],'type':_0x1a70c3[_0xa1c8('0x35')][_0xa1c8('0x36')]};});_0x39b4ca[_0xa1c8('0x37')]=_[_0xa1c8('0x31')](_0x52f12b,_0xa1c8('0x2e'));_0x39b4ca[_0xa1c8('0x38')]=_[_0xa1c8('0x39')](_0x5b51a6[_0xa1c8('0x38')]);_0x39b4ca[_0xa1c8('0x3a')]=_['intersection'](_0x39b4ca[_0xa1c8('0x37')],_0x39b4ca['query']);_0x3d9c49[_0xa1c8('0x3b')]=_['intersection'](_0x39b4ca[_0xa1c8('0x37')],qs['fields'](_0x5b51a6[_0xa1c8('0x38')][_0xa1c8('0x3c')]));_0x3d9c49['attributes']=_0x3d9c49['attributes']['length']?_0x3d9c49['attributes']:_0x39b4ca[_0xa1c8('0x37')];if(!_0x5b51a6['query'][_0xa1c8('0x3d')]('nolimit')){_0x3d9c49['limit']=qs[_0xa1c8('0x22')](_0x5b51a6['query'][_0xa1c8('0x22')]);_0x3d9c49['offset']=qs[_0xa1c8('0x21')](_0x5b51a6[_0xa1c8('0x38')][_0xa1c8('0x21')]);}_0x3d9c49['order']=qs['sort'](_0x5b51a6[_0xa1c8('0x38')][_0xa1c8('0x3e')]);_0x3d9c49[_0xa1c8('0x3f')]=qs['filters'](_[_0xa1c8('0x40')](_0x5b51a6[_0xa1c8('0x38')],_0x39b4ca[_0xa1c8('0x3a')]));if(_0x5b51a6[_0xa1c8('0x38')][_0xa1c8('0x41')]){_0x3d9c49['where']=_[_0xa1c8('0x42')](_0x3d9c49['where'],{'$or':_['map'](_0x52f12b,function(_0x109be7){if(_0x109be7[_0xa1c8('0x35')]!==_0xa1c8('0x43')){var _0x4c7e05={};_0x4c7e05[_0x109be7[_0xa1c8('0x2e')]]={'$like':'%'+_0x5b51a6[_0xa1c8('0x38')]['filter']+'%'};return _0x4c7e05;}})});}_0x3d9c49=_[_0xa1c8('0x42')]({},_0x3d9c49,_0x5b51a6[_0xa1c8('0x44')]);var _0x4f6db4={'where':_0x3d9c49['where']};return db[_0xa1c8('0x32')][_0xa1c8('0x20')](_0x4f6db4)[_0xa1c8('0x28')](function(_0xf383ed){_0x2a4825[_0xa1c8('0x20')]=_0xf383ed;if(_0x5b51a6['query'][_0xa1c8('0x45')]){_0x3d9c49[_0xa1c8('0x46')]=[{'all':!![]}];}return db[_0xa1c8('0x32')]['findAll'](_0x3d9c49);})[_0xa1c8('0x28')](function(_0x5cde65){_0x2a4825[_0xa1c8('0x47')]=_0x5cde65;return _0x2a4825;})[_0xa1c8('0x28')](respondWithFilteredResult(_0x16e963,_0x3d9c49))[_0xa1c8('0x48')](handleError(_0x16e963,null));};exports[_0xa1c8('0x49')]=function(_0x3bbf87,_0x398660){var _0x597a58={'raw':![],'where':{'id':_0x3bbf87['params']['id']}},_0xfcca8a={};_0xfcca8a[_0xa1c8('0x37')]=_[_0xa1c8('0x39')](db[_0xa1c8('0x32')][_0xa1c8('0x33')]);_0xfcca8a[_0xa1c8('0x38')]=_[_0xa1c8('0x39')](_0x3bbf87['query']);_0xfcca8a[_0xa1c8('0x3a')]=_[_0xa1c8('0x4a')](_0xfcca8a[_0xa1c8('0x37')],_0xfcca8a[_0xa1c8('0x38')]);_0x597a58[_0xa1c8('0x3b')]=_['intersection'](_0xfcca8a['model'],qs[_0xa1c8('0x3c')](_0x3bbf87[_0xa1c8('0x38')]['fields']));_0x597a58[_0xa1c8('0x3b')]=_0x597a58[_0xa1c8('0x3b')]['length']?_0x597a58[_0xa1c8('0x3b')]:_0xfcca8a['model'];if(_0x3bbf87[_0xa1c8('0x38')][_0xa1c8('0x45')]){_0x597a58[_0xa1c8('0x46')]=[{'all':!![]}];}_0x597a58=_[_0xa1c8('0x42')]({},_0x597a58,_0x3bbf87[_0xa1c8('0x44')]);return db[_0xa1c8('0x32')][_0xa1c8('0x4b')](_0x597a58)[_0xa1c8('0x28')](handleEntityNotFound(_0x398660,null))[_0xa1c8('0x28')](respondWithResult(_0x398660,null))[_0xa1c8('0x48')](handleError(_0x398660,null));};exports[_0xa1c8('0x29')]=function(_0x1d488c,_0x3ac978){return db[_0xa1c8('0x32')]['find']({'where':{'id':_0x1d488c['params']['id']}})[_0xa1c8('0x28')](handleEntityNotFound(_0x3ac978,null))[_0xa1c8('0x28')](removeEntity(_0x3ac978,null))[_0xa1c8('0x48')](handleError(_0x3ac978,null));};exports[_0xa1c8('0x4c')]=function(_0x2c4f49,_0x18d8aa){return db[_0xa1c8('0x32')][_0xa1c8('0x4c')]()[_0xa1c8('0x28')](respondWithResult(_0x18d8aa,null))[_0xa1c8('0x48')](handleError(_0x18d8aa,null));};exports[_0xa1c8('0x4d')]=function(_0x213323,_0x48a7a3){var _0x1b0099;return db['sequelize']['transaction'](function(_0xa5830e){return db['VoicePrefix'][_0xa1c8('0x4d')](_0x213323['body'],{'transaction':_0xa5830e})[_0xa1c8('0x28')](function(_0x443166){_0x1b0099=_0x443166[_0xa1c8('0x2a')]({'plain':!![]});return db[_0xa1c8('0x4e')][_0xa1c8('0x4b')]({'where':{'id':_0x1b0099[_0xa1c8('0x4f')]},'raw':!![]})[_0xa1c8('0x28')](function(_0x397522){return createVoicePrefixExtensions(_0x1b0099,_0x397522,_0xa5830e);});});})['then'](function(){var _0x110736=_0x213323[_0xa1c8('0x50')][_0xa1c8('0x2a')]({'plain':!![]});if(!_0x110736)throw new Error(_0xa1c8('0x51'));if(_0x110736['role']==='user'){var _0x402e50=_0x1b0099;return db[_0xa1c8('0x52')][_0xa1c8('0x4b')]({'where':{'name':_0xa1c8('0x53'),'userProfileId':_0x110736[_0xa1c8('0x54')]},'raw':!![]})[_0xa1c8('0x28')](function(_0x55fa80){if(_0x55fa80&&_0x55fa80[_0xa1c8('0x55')]===0x0){return db[_0xa1c8('0x2b')][_0xa1c8('0x4d')]({'name':_0x402e50[_0xa1c8('0x2e')],'resourceId':_0x402e50['id'],'type':_0x55fa80[_0xa1c8('0x2e')],'sectionId':_0x55fa80['id']},{})[_0xa1c8('0x28')](function(){return _0x1b0099;});}else{return _0x1b0099;}})['catch'](function(_0x42df71){logger[_0xa1c8('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42df71);throw _0x42df71;});}return _0x1b0099;})['then'](respondWithResult(_0x48a7a3,null))[_0xa1c8('0x48')](handleError(_0x48a7a3,null));};function Extension(_0x1e2c5b,_0x25f38a,_0x130d8b,_0x36bfd1){this['context']=_0xa1c8('0x57');this[_0xa1c8('0x58')]=_0x1e2c5b;this['app']=_0x130d8b;this['type']=_0xa1c8('0x59');this[_0xa1c8('0x5a')]=_0xa1c8('0x5b');this['priority']=_0x25f38a;this[_0xa1c8('0x5c')]=_0x36bfd1;}function createVoicePrefixExtensions(_0x1754b9,_0x3ea2ac,_0x76d2a2){return new BPromise(function(_0xbecfff,_0x5ed1ec){var _0x384f03=new Extension(formatPrefixName(_0x1754b9[_0xa1c8('0x5d')]),0x1,_0xa1c8('0x5e'),'Voice\x20Prefix');_0x384f03['VoicePrefixId']=_0x1754b9['id'];return db[_0xa1c8('0x4e')]['create'](_0x384f03,{'transaction':_0x76d2a2})['then'](function(_0x4ede8c){var _0x4fe9d4=_0x4ede8c[_0xa1c8('0x2a')]({'plain':!![]});var _0x9d29df=_[_0xa1c8('0x31')](addVoicePrefixExtensions(_0x1754b9,_0x3ea2ac),function(_0x3bd552){_0x3bd552[_0xa1c8('0x4f')]=_0x4fe9d4['id'];_0x3bd552['VoicePrefixId']=_0x1754b9['id'];return _0x3bd552;});return db['VoiceExtension'][_0xa1c8('0x5f')](_0x9d29df,{'transaction':_0x76d2a2})[_0xa1c8('0x28')](function(_0x1b789a){if(!_0x1b789a){return _0x5ed1ec(_0xa1c8('0x60'));}else{return _0xbecfff(_0x1b789a);}})[_0xa1c8('0x48')](function(_0x2900b7){return _0x5ed1ec(_0x2900b7);});});;});};function addVoicePrefixExtensions(_0xaecd4b,_0x2662df){var _0x16d9e2=[];var _0x349157=formatPrefixName(_0xaecd4b['prefix']);_0x16d9e2['push'](new Extension(_0x349157,0x2,'Set',_0xa1c8('0x61')+_0xaecd4b['name']));if(_0xaecd4b[_0xa1c8('0x62')]){_0x16d9e2[_0xa1c8('0x63')](new Extension(_0x349157,0x3,'Set','PREFIX-CALLERIDALL='+_0xaecd4b['callerIdAll']));}else{_0x16d9e2[_0xa1c8('0x63')](new Extension(_0x349157,0x3,'NoOp',_0xa1c8('0x64')));}_0x16d9e2['push'](new Extension(_0x349157,0x4,'goto',_0x2662df[_0xa1c8('0x65')]+','+'${EXTEN:'+(0x8+_0xaecd4b['name'][_0xa1c8('0x66')])+'}'+','+0x1));return _0x16d9e2;}function formatPrefixName(_0xf79ac1){var _0x55bfcf='_';for(var _0x4e39ef=0x0;_0x4e39ef<_0xf79ac1[_0xa1c8('0x66')];_0x4e39ef++){if(_0xf79ac1[_0xa1c8('0x67')](_0x4e39ef)=='-'){_0x55bfcf+=_0xf79ac1[_0xa1c8('0x67')](_0x4e39ef);}else{_0x55bfcf+='['+_0xf79ac1[_0xa1c8('0x67')](_0x4e39ef)+']';}}_0x55bfcf+='.';return _0x55bfcf;}exports[_0xa1c8('0x27')]=function(_0x2ff485,_0x1fd07f,_0xfdea8){var _0x43c6b5=_0x2ff485['body'];_0x43c6b5['prefix']=_0xa1c8('0x68')+_0x43c6b5['name']+'-';return db[_0xa1c8('0x69')][_0xa1c8('0x6a')](function(_0x16d53d){return db[_0xa1c8('0x32')][_0xa1c8('0x27')](_0x43c6b5,{'where':{'id':_0x43c6b5['id']},'transaction':_0x16d53d})['then'](function(){return db['VoiceExtension'][_0xa1c8('0x29')]({'where':{'VoicePrefixId':_0x43c6b5['id']},'transaction':_0x16d53d})[_0xa1c8('0x28')](function(){return db[_0xa1c8('0x4e')][_0xa1c8('0x4b')]({'where':{'id':_0x43c6b5[_0xa1c8('0x4f')]},'raw':!![]})[_0xa1c8('0x28')](function(_0x185805){return createVoicePrefixExtensions(_0x43c6b5,_0x185805,_0x16d53d);});});});})[_0xa1c8('0x28')](function(){return db[_0xa1c8('0x32')][_0xa1c8('0x6b')](_0x43c6b5['id']);})[_0xa1c8('0x28')](respondWithResult(_0x1fd07f,null))[_0xa1c8('0x48')](handleError(_0x1fd07f,null));};exports[_0xa1c8('0x6c')]=function(_0x32d402,_0x288744,_0x15be4e){return db['VoicePrefix'][_0xa1c8('0x4b')]({'where':{'id':_0x32d402['params']['id']}})[_0xa1c8('0x28')](handleEntityNotFound(_0x288744,null))[_0xa1c8('0x28')](function(_0x16df0c){if(_0x16df0c){return _0x16df0c['addAgents'](_0x32d402[_0xa1c8('0x6d')]['ids'],_[_0xa1c8('0x6e')](_0x32d402['body'],[_0xa1c8('0x6f'),'id'])||{})['spread'](function(_0xe3ec79){for(var _0xed86e7=0x0;_0xed86e7<_0x32d402[_0xa1c8('0x6d')][_0xa1c8('0x6f')]['length'];_0xed86e7+=0x1){socket[_0xa1c8('0x70')](_0xa1c8('0x71'),{'UserId':_0x32d402['body'][_0xa1c8('0x6f')][_0xed86e7],'VoicePrefixId':_0x32d402['params']['id']});}return _0xe3ec79;});}})[_0xa1c8('0x28')](respondWithResult(_0x288744,null))[_0xa1c8('0x48')](handleError(_0x288744,null));};exports[_0xa1c8('0x72')]=function(_0xaeb17f,_0x3a35ea,_0x45a493){return db[_0xa1c8('0x32')]['find']({'where':{'id':_0xaeb17f[_0xa1c8('0x73')]['id']}})[_0xa1c8('0x28')](handleEntityNotFound(_0x3a35ea,null))[_0xa1c8('0x28')](function(_0x1fb02e){if(_0x1fb02e){return _0x1fb02e['removeAgents'](_0xaeb17f['query']['ids'])['then'](function(){if(_[_0xa1c8('0x74')](_0xaeb17f[_0xa1c8('0x38')]['ids'])){for(var _0x2aa248=0x0;_0x2aa248<_0xaeb17f[_0xa1c8('0x38')][_0xa1c8('0x6f')]['length'];_0x2aa248+=0x1){socket[_0xa1c8('0x70')](_0xa1c8('0x75'),{'UserId':Number(_0xaeb17f[_0xa1c8('0x38')][_0xa1c8('0x6f')][_0x2aa248]),'VoicePrefixId':Number(_0xaeb17f[_0xa1c8('0x73')]['id'])});}}else{socket[_0xa1c8('0x70')](_0xa1c8('0x75'),{'UserId':Number(_0xaeb17f[_0xa1c8('0x38')][_0xa1c8('0x6f')]),'VoicePrefixId':Number(_0xaeb17f['params']['id'])});}});}})[_0xa1c8('0x28')](respondWithStatusCode(_0x3a35ea,null))[_0xa1c8('0x48')](handleError(_0x3a35ea,null));};exports['getAgents']=function(_0x5b69e1,_0x1800c1,_0x31b4dc){var _0x398eb7={};var _0x1c419a={};var _0x58a08f;var _0x10c59a;return db[_0xa1c8('0x32')]['findOne']({'where':{'id':_0x5b69e1[_0xa1c8('0x73')]['id']}})[_0xa1c8('0x28')](handleEntityNotFound(_0x1800c1,null))[_0xa1c8('0x28')](function(_0x300ab4){if(_0x300ab4){_0x58a08f=_0x300ab4;_0x1c419a[_0xa1c8('0x37')]=_[_0xa1c8('0x39')](db['User'][_0xa1c8('0x33')]);_0x1c419a['query']=_[_0xa1c8('0x39')](_0x5b69e1['query']);_0x1c419a['filters']=_[_0xa1c8('0x4a')](_0x1c419a[_0xa1c8('0x37')],_0x1c419a[_0xa1c8('0x38')]);_0x398eb7['attributes']=_['intersection'](_0x1c419a[_0xa1c8('0x37')],qs[_0xa1c8('0x3c')](_0x5b69e1['query']['fields']));_0x398eb7[_0xa1c8('0x3b')]=_0x398eb7['attributes']['length']?_0x398eb7[_0xa1c8('0x3b')]:_0x1c419a[_0xa1c8('0x37')];_0x398eb7[_0xa1c8('0x76')]=qs[_0xa1c8('0x3e')](_0x5b69e1[_0xa1c8('0x38')]['sort']);_0x398eb7[_0xa1c8('0x3f')]=qs[_0xa1c8('0x3a')](_['pick'](_0x5b69e1[_0xa1c8('0x38')],_0x1c419a[_0xa1c8('0x3a')]));if(_0x5b69e1[_0xa1c8('0x38')][_0xa1c8('0x41')]){_0x398eb7[_0xa1c8('0x3f')]=_[_0xa1c8('0x42')](_0x398eb7[_0xa1c8('0x3f')],{'$or':_[_0xa1c8('0x31')](_0x398eb7[_0xa1c8('0x3b')],function(_0x1a298e){var _0x24b01d={};_0x24b01d[_0x1a298e]={'$like':'%'+_0x5b69e1[_0xa1c8('0x38')][_0xa1c8('0x41')]+'%'};return _0x24b01d;})});}_0x398eb7=_[_0xa1c8('0x42')]({},_0x398eb7,_0x5b69e1[_0xa1c8('0x44')]);return _0x58a08f[_0xa1c8('0x77')](_0x398eb7);}})[_0xa1c8('0x28')](function(_0x54b5c0){if(_0x54b5c0){_0x10c59a=_0x54b5c0[_0xa1c8('0x66')];if(!_0x5b69e1[_0xa1c8('0x38')]['hasOwnProperty']('nolimit')){_0x398eb7[_0xa1c8('0x22')]=qs['limit'](_0x5b69e1[_0xa1c8('0x38')][_0xa1c8('0x22')]);_0x398eb7['offset']=qs[_0xa1c8('0x21')](_0x5b69e1[_0xa1c8('0x38')][_0xa1c8('0x21')]);}return _0x58a08f[_0xa1c8('0x77')](_0x398eb7);}})['then'](function(_0x5ca013){if(_0x5ca013){return _0x5ca013?{'count':_0x10c59a,'rows':_0x5ca013}:null;}})[_0xa1c8('0x28')](respondWithResult(_0x1800c1,null))[_0xa1c8('0x48')](handleError(_0x1800c1,null));}; \ No newline at end of file +var _0xccd7=['request-promise','moment','bluebird','mustache','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','status','end','json','count','offset','set','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','sendStatus','error','name','send','index','VoicePrefix','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','params','rawAttributes','include','find','catch','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','priority','NoOp','Voice\x20Prefix','bulkCreate','CDR(prefix)=','callerIdAll','push','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','prefix','system-','sequelize','findById','addAgents','omit','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xccd7,0x75));var _0x7ccd=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0xccd7[_0x450bf9];return _0x268350;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7ccd('0x0'));var rimraf=require(_0x7ccd('0x1'));var zipdir=require(_0x7ccd('0x2'));var jsonpatch=require(_0x7ccd('0x3'));var rp=require(_0x7ccd('0x4'));var moment=require(_0x7ccd('0x5'));var BPromise=require(_0x7ccd('0x6'));var Mustache=require(_0x7ccd('0x7'));var util=require('util');var path=require(_0x7ccd('0x8'));var sox=require('sox');var csv=require(_0x7ccd('0x9'));var ejs=require(_0x7ccd('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ccd('0xb'));var deskjs=require(_0x7ccd('0xc'));var toCsv=require(_0x7ccd('0x9'));var querystring=require(_0x7ccd('0xd'));var Papa=require(_0x7ccd('0xe'));var Redis=require(_0x7ccd('0xf'));var authService=require(_0x7ccd('0x10'));var qs=require(_0x7ccd('0x11'));var as=require(_0x7ccd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7ccd('0x13'))(_0x7ccd('0x14'));var utils=require(_0x7ccd('0x15'));var config=require(_0x7ccd('0x16'));var db=require(_0x7ccd('0x17'))['db'];config[_0x7ccd('0x18')]=_['defaults'](config[_0x7ccd('0x18')],{'host':_0x7ccd('0x19'),'port':0x18eb});var socket=require(_0x7ccd('0x1a'))(new Redis(config['redis']));require(_0x7ccd('0x1b'))[_0x7ccd('0x1c')](socket);function respondWithStatusCode(_0xa0c012,_0x420af8){_0x420af8=_0x420af8||0xcc;return function(_0x9012c2){if(_0x9012c2){return _0xa0c012['sendStatus'](_0x420af8);}return _0xa0c012[_0x7ccd('0x1d')](_0x420af8)[_0x7ccd('0x1e')]();};}function respondWithResult(_0x2731ce,_0x552757){_0x552757=_0x552757||0xc8;return function(_0x4ce678){if(_0x4ce678){return _0x2731ce[_0x7ccd('0x1d')](_0x552757)[_0x7ccd('0x1f')](_0x4ce678);}};}function respondWithFilteredResult(_0x156616,_0x225321){return function(_0x14141c){if(_0x14141c){var _0x1d307c=_0x14141c[_0x7ccd('0x20')],_0x4a0d97=_0x225321['offset'],_0x214241=_0x225321[_0x7ccd('0x21')]+_0x225321['limit'],_0xffc850;if(_0x214241>=_0x1d307c){_0x214241=_0x1d307c;_0xffc850=0xc8;}else{_0xffc850=0xce;}_0x156616['status'](_0xffc850);return _0x156616[_0x7ccd('0x22')]('Content-Range',_0x4a0d97+'-'+_0x214241+'/'+_0x1d307c)[_0x7ccd('0x1f')](_0x14141c);}return null;};}function patchUpdates(_0x38adaa){return function(_0x16ffde){try{jsonpatch['apply'](_0x16ffde,_0x38adaa,!![]);}catch(_0x3fb29d){return BPromise['reject'](_0x3fb29d);}return _0x16ffde[_0x7ccd('0x23')]();};}function saveUpdates(_0x4b0f43,_0x4f1d88){return function(_0x4057e4){if(_0x4057e4){return _0x4057e4[_0x7ccd('0x24')](_0x4b0f43)['then'](function(_0x45dfdf){return _0x45dfdf;});}return null;};}function removeEntity(_0x1ab52a,_0xa9edc2){return function(_0x389ed6){if(_0x389ed6){return _0x389ed6[_0x7ccd('0x25')]()[_0x7ccd('0x26')](function(){var _0x2a322f=_0x389ed6[_0x7ccd('0x27')]({'plain':!![]});var _0x24dbb0=_0x7ccd('0x28');return db[_0x7ccd('0x29')][_0x7ccd('0x25')]({'where':{'type':_0x24dbb0,'resourceId':_0x2a322f['id']}})[_0x7ccd('0x26')](function(){return _0x389ed6;});})['then'](function(){_0x1ab52a[_0x7ccd('0x1d')](0xcc)[_0x7ccd('0x1e')]();});}};}function handleEntityNotFound(_0x7467de,_0x4976ef){return function(_0x431242){if(!_0x431242){_0x7467de[_0x7ccd('0x2a')](0x194);}return _0x431242;};}function handleError(_0x593f24,_0x191b4b){_0x191b4b=_0x191b4b||0x1f4;return function(_0x3cd2e7){logger[_0x7ccd('0x2b')](_0x3cd2e7['stack']);if(_0x3cd2e7['name']){delete _0x3cd2e7[_0x7ccd('0x2c')];}_0x593f24[_0x7ccd('0x1d')](_0x191b4b)[_0x7ccd('0x2d')](_0x3cd2e7);};}exports[_0x7ccd('0x2e')]=function(_0x59468c,_0xa2ca28){var _0x28f3db={},_0x955e2f={},_0x10c089={'count':0x0,'rows':[]};var _0x56774f=_['map'](db[_0x7ccd('0x2f')]['rawAttributes'],function(_0x275494){return{'name':_0x275494[_0x7ccd('0x30')],'type':_0x275494[_0x7ccd('0x31')]['key']};});_0x955e2f[_0x7ccd('0x32')]=_[_0x7ccd('0x33')](_0x56774f,_0x7ccd('0x2c'));_0x955e2f[_0x7ccd('0x34')]=_[_0x7ccd('0x35')](_0x59468c[_0x7ccd('0x34')]);_0x955e2f[_0x7ccd('0x36')]=_[_0x7ccd('0x37')](_0x955e2f[_0x7ccd('0x32')],_0x955e2f[_0x7ccd('0x34')]);_0x28f3db[_0x7ccd('0x38')]=_[_0x7ccd('0x37')](_0x955e2f['model'],qs[_0x7ccd('0x39')](_0x59468c[_0x7ccd('0x34')][_0x7ccd('0x39')]));_0x28f3db[_0x7ccd('0x38')]=_0x28f3db[_0x7ccd('0x38')][_0x7ccd('0x3a')]?_0x28f3db['attributes']:_0x955e2f[_0x7ccd('0x32')];if(!_0x59468c[_0x7ccd('0x34')][_0x7ccd('0x3b')](_0x7ccd('0x3c'))){_0x28f3db[_0x7ccd('0x3d')]=qs[_0x7ccd('0x3d')](_0x59468c[_0x7ccd('0x34')][_0x7ccd('0x3d')]);_0x28f3db[_0x7ccd('0x21')]=qs[_0x7ccd('0x21')](_0x59468c[_0x7ccd('0x34')][_0x7ccd('0x21')]);}_0x28f3db[_0x7ccd('0x3e')]=qs[_0x7ccd('0x3f')](_0x59468c[_0x7ccd('0x34')][_0x7ccd('0x3f')]);_0x28f3db[_0x7ccd('0x40')]=qs[_0x7ccd('0x36')](_[_0x7ccd('0x41')](_0x59468c[_0x7ccd('0x34')],_0x955e2f[_0x7ccd('0x36')]));if(_0x59468c['query']['filter']){_0x28f3db[_0x7ccd('0x40')]=_['merge'](_0x28f3db[_0x7ccd('0x40')],{'$or':_[_0x7ccd('0x33')](_0x56774f,function(_0x1b99e2){if(_0x1b99e2[_0x7ccd('0x31')]!==_0x7ccd('0x42')){var _0x40ec12={};_0x40ec12[_0x1b99e2[_0x7ccd('0x2c')]]={'$like':'%'+_0x59468c[_0x7ccd('0x34')][_0x7ccd('0x43')]+'%'};return _0x40ec12;}})});}_0x28f3db=_[_0x7ccd('0x44')]({},_0x28f3db,_0x59468c[_0x7ccd('0x45')]);var _0x1efb40={'where':_0x28f3db['where']};return db['VoicePrefix'][_0x7ccd('0x20')](_0x1efb40)['then'](function(_0x2fa602){_0x10c089['count']=_0x2fa602;if(_0x59468c[_0x7ccd('0x34')][_0x7ccd('0x46')]){_0x28f3db['include']=[{'all':!![]}];}return db['VoicePrefix'][_0x7ccd('0x47')](_0x28f3db);})[_0x7ccd('0x26')](function(_0x13c9cf){_0x10c089['rows']=_0x13c9cf;return _0x10c089;})['then'](respondWithFilteredResult(_0xa2ca28,_0x28f3db))['catch'](handleError(_0xa2ca28,null));};exports['show']=function(_0x18e537,_0x1e1471){var _0x5d88ba={'raw':![],'where':{'id':_0x18e537[_0x7ccd('0x48')]['id']}},_0x11bcc5={};_0x11bcc5[_0x7ccd('0x32')]=_['keys'](db[_0x7ccd('0x2f')][_0x7ccd('0x49')]);_0x11bcc5[_0x7ccd('0x34')]=_[_0x7ccd('0x35')](_0x18e537[_0x7ccd('0x34')]);_0x11bcc5[_0x7ccd('0x36')]=_[_0x7ccd('0x37')](_0x11bcc5[_0x7ccd('0x32')],_0x11bcc5[_0x7ccd('0x34')]);_0x5d88ba[_0x7ccd('0x38')]=_[_0x7ccd('0x37')](_0x11bcc5['model'],qs[_0x7ccd('0x39')](_0x18e537[_0x7ccd('0x34')]['fields']));_0x5d88ba['attributes']=_0x5d88ba[_0x7ccd('0x38')]['length']?_0x5d88ba[_0x7ccd('0x38')]:_0x11bcc5['model'];if(_0x18e537[_0x7ccd('0x34')][_0x7ccd('0x46')]){_0x5d88ba[_0x7ccd('0x4a')]=[{'all':!![]}];}_0x5d88ba=_[_0x7ccd('0x44')]({},_0x5d88ba,_0x18e537[_0x7ccd('0x45')]);return db['VoicePrefix'][_0x7ccd('0x4b')](_0x5d88ba)[_0x7ccd('0x26')](handleEntityNotFound(_0x1e1471,null))[_0x7ccd('0x26')](respondWithResult(_0x1e1471,null))[_0x7ccd('0x4c')](handleError(_0x1e1471,null));};exports[_0x7ccd('0x25')]=function(_0x45cde8,_0x4950ab){return db[_0x7ccd('0x2f')][_0x7ccd('0x4b')]({'where':{'id':_0x45cde8[_0x7ccd('0x48')]['id']}})[_0x7ccd('0x26')](handleEntityNotFound(_0x4950ab,null))[_0x7ccd('0x26')](removeEntity(_0x4950ab,null))[_0x7ccd('0x4c')](handleError(_0x4950ab,null));};exports['describe']=function(_0x430109,_0x2d41dc){return db[_0x7ccd('0x2f')][_0x7ccd('0x4d')]()['then'](respondWithResult(_0x2d41dc,null))[_0x7ccd('0x4c')](handleError(_0x2d41dc,null));};exports[_0x7ccd('0x4e')]=function(_0xc65179,_0x50b1fe){var _0x485e13;return db['sequelize'][_0x7ccd('0x4f')](function(_0x2fde49){return db['VoicePrefix'][_0x7ccd('0x4e')](_0xc65179[_0x7ccd('0x50')],{'transaction':_0x2fde49})[_0x7ccd('0x26')](function(_0x447000){_0x485e13=_0x447000[_0x7ccd('0x27')]({'plain':!![]});return db[_0x7ccd('0x51')]['find']({'where':{'id':_0x485e13[_0x7ccd('0x52')]},'raw':!![]})['then'](function(_0x1ca072){return createVoicePrefixExtensions(_0x485e13,_0x1ca072,_0x2fde49);});});})[_0x7ccd('0x26')](function(){var _0x5d10f8=_0xc65179[_0x7ccd('0x53')]['get']({'plain':!![]});if(!_0x5d10f8)throw new Error(_0x7ccd('0x54'));if(_0x5d10f8['role']===_0x7ccd('0x53')){var _0x3cefa7=_0x485e13;return db[_0x7ccd('0x55')][_0x7ccd('0x4b')]({'where':{'name':_0x7ccd('0x28'),'userProfileId':_0x5d10f8[_0x7ccd('0x56')]},'raw':!![]})[_0x7ccd('0x26')](function(_0x26f0d6){if(_0x26f0d6&&_0x26f0d6[_0x7ccd('0x57')]===0x0){return db[_0x7ccd('0x29')][_0x7ccd('0x4e')]({'name':_0x3cefa7[_0x7ccd('0x2c')],'resourceId':_0x3cefa7['id'],'type':_0x26f0d6[_0x7ccd('0x2c')],'sectionId':_0x26f0d6['id']},{})[_0x7ccd('0x26')](function(){return _0x485e13;});}else{return _0x485e13;}})[_0x7ccd('0x4c')](function(_0x3147dd){logger[_0x7ccd('0x2b')](_0x7ccd('0x58'),_0x3147dd);throw _0x3147dd;});}return _0x485e13;})[_0x7ccd('0x26')](respondWithResult(_0x50b1fe,null))['catch'](handleError(_0x50b1fe,null));};function Extension(_0x17ada1,_0x1e2c8d,_0x4c92be,_0x178f37){this[_0x7ccd('0x59')]='from-sip';this[_0x7ccd('0x5a')]=_0x17ada1;this[_0x7ccd('0x5b')]=_0x4c92be;this[_0x7ccd('0x31')]=_0x7ccd('0x5c');this['description']='Voice\x20Prefix\x20Extension';this[_0x7ccd('0x5d')]=_0x1e2c8d;this['appdata']=_0x178f37;}function createVoicePrefixExtensions(_0x16fb60,_0x5aab08,_0x2fb965){return new BPromise(function(_0x20a468,_0x25492c){var _0x2dc5ec=new Extension(formatPrefixName(_0x16fb60['prefix']),0x1,_0x7ccd('0x5e'),_0x7ccd('0x5f'));_0x2dc5ec['VoicePrefixId']=_0x16fb60['id'];return db[_0x7ccd('0x51')][_0x7ccd('0x4e')](_0x2dc5ec,{'transaction':_0x2fb965})[_0x7ccd('0x26')](function(_0x146cbf){var _0x1020ad=_0x146cbf[_0x7ccd('0x27')]({'plain':!![]});var _0x1410ae=_[_0x7ccd('0x33')](addVoicePrefixExtensions(_0x16fb60,_0x5aab08),function(_0x5b75b6){_0x5b75b6[_0x7ccd('0x52')]=_0x1020ad['id'];_0x5b75b6['VoicePrefixId']=_0x16fb60['id'];return _0x5b75b6;});return db[_0x7ccd('0x51')][_0x7ccd('0x60')](_0x1410ae,{'transaction':_0x2fb965})['then'](function(_0x2c0a05){if(!_0x2c0a05){return _0x25492c('Extensions\x20creation\x20failed');}else{return _0x20a468(_0x2c0a05);}})[_0x7ccd('0x4c')](function(_0x267919){return _0x25492c(_0x267919);});});;});};function addVoicePrefixExtensions(_0xd97cdc,_0x1944dc){var _0x53fa7a=[];var _0x42e31f=formatPrefixName(_0xd97cdc['prefix']);_0x53fa7a['push'](new Extension(_0x42e31f,0x2,'Set',_0x7ccd('0x61')+_0xd97cdc[_0x7ccd('0x2c')]));if(_0xd97cdc[_0x7ccd('0x62')]){_0x53fa7a[_0x7ccd('0x63')](new Extension(_0x42e31f,0x3,_0x7ccd('0x64'),_0x7ccd('0x65')+_0xd97cdc[_0x7ccd('0x62')]));}else{_0x53fa7a['push'](new Extension(_0x42e31f,0x3,_0x7ccd('0x5e'),_0x7ccd('0x66')));}_0x53fa7a[_0x7ccd('0x63')](new Extension(_0x42e31f,0x4,_0x7ccd('0x67'),_0x1944dc['context']+','+'${EXTEN:'+(0x8+_0xd97cdc['name'][_0x7ccd('0x3a')])+'}'+','+0x1));return _0x53fa7a;}function formatPrefixName(_0x5ddfaa){var _0xbe74b7='_';for(var _0x164a64=0x0;_0x164a64<_0x5ddfaa[_0x7ccd('0x3a')];_0x164a64++){if(_0x5ddfaa[_0x7ccd('0x68')](_0x164a64)=='-'){_0xbe74b7+=_0x5ddfaa[_0x7ccd('0x68')](_0x164a64);}else{_0xbe74b7+='['+_0x5ddfaa[_0x7ccd('0x68')](_0x164a64)+']';}}_0xbe74b7+='.';return _0xbe74b7;}exports['update']=function(_0x3568ff,_0x201564,_0x156d44){var _0x5b1855=_0x3568ff['body'];_0x5b1855[_0x7ccd('0x69')]=_0x7ccd('0x6a')+_0x5b1855['name']+'-';return db[_0x7ccd('0x6b')][_0x7ccd('0x4f')](function(_0x2ad6b1){return db[_0x7ccd('0x2f')]['update'](_0x5b1855,{'where':{'id':_0x5b1855['id']},'transaction':_0x2ad6b1})[_0x7ccd('0x26')](function(){return db[_0x7ccd('0x51')]['destroy']({'where':{'VoicePrefixId':_0x5b1855['id']},'transaction':_0x2ad6b1})['then'](function(){return db['VoiceExtension'][_0x7ccd('0x4b')]({'where':{'id':_0x5b1855[_0x7ccd('0x52')]},'raw':!![]})[_0x7ccd('0x26')](function(_0x42424c){return createVoicePrefixExtensions(_0x5b1855,_0x42424c,_0x2ad6b1);});});});})[_0x7ccd('0x26')](function(){return db['VoicePrefix'][_0x7ccd('0x6c')](_0x5b1855['id']);})[_0x7ccd('0x26')](respondWithResult(_0x201564,null))[_0x7ccd('0x4c')](handleError(_0x201564,null));};exports[_0x7ccd('0x6d')]=function(_0x31671d,_0x2580bb,_0x423d7c){return db[_0x7ccd('0x2f')][_0x7ccd('0x4b')]({'where':{'id':_0x31671d[_0x7ccd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2580bb,null))[_0x7ccd('0x26')](function(_0x550820){if(_0x550820){return _0x550820[_0x7ccd('0x6d')](_0x31671d[_0x7ccd('0x50')]['ids'],_[_0x7ccd('0x6e')](_0x31671d[_0x7ccd('0x50')],[_0x7ccd('0x6f'),'id'])||{})[_0x7ccd('0x70')](function(_0x378403){for(var _0x5ece60=0x0;_0x5ece60<_0x31671d[_0x7ccd('0x50')]['ids'][_0x7ccd('0x3a')];_0x5ece60+=0x1){socket['emit'](_0x7ccd('0x71'),{'UserId':_0x31671d[_0x7ccd('0x50')]['ids'][_0x5ece60],'VoicePrefixId':_0x31671d[_0x7ccd('0x48')]['id']});}return _0x378403;});}})['then'](respondWithResult(_0x2580bb,null))[_0x7ccd('0x4c')](handleError(_0x2580bb,null));};exports['removeAgents']=function(_0xc370f4,_0xd2de75,_0x36e671){return db[_0x7ccd('0x2f')]['find']({'where':{'id':_0xc370f4[_0x7ccd('0x48')]['id']}})['then'](handleEntityNotFound(_0xd2de75,null))['then'](function(_0x4e13a0){if(_0x4e13a0){return _0x4e13a0[_0x7ccd('0x72')](_0xc370f4[_0x7ccd('0x34')]['ids'])['then'](function(){if(_[_0x7ccd('0x73')](_0xc370f4[_0x7ccd('0x34')][_0x7ccd('0x6f')])){for(var _0x142379=0x0;_0x142379<_0xc370f4['query'][_0x7ccd('0x6f')][_0x7ccd('0x3a')];_0x142379+=0x1){socket[_0x7ccd('0x74')]('userVoicePrefix:remove',{'UserId':Number(_0xc370f4[_0x7ccd('0x34')][_0x7ccd('0x6f')][_0x142379]),'VoicePrefixId':Number(_0xc370f4[_0x7ccd('0x48')]['id'])});}}else{socket['emit'](_0x7ccd('0x75'),{'UserId':Number(_0xc370f4[_0x7ccd('0x34')][_0x7ccd('0x6f')]),'VoicePrefixId':Number(_0xc370f4[_0x7ccd('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0xd2de75,null))[_0x7ccd('0x4c')](handleError(_0xd2de75,null));};exports[_0x7ccd('0x76')]=function(_0x429aae,_0x339e55,_0x17c213){var _0x2e429f={};var _0x22ed1b={};var _0x23f201;var _0x6851;return db['VoicePrefix'][_0x7ccd('0x77')]({'where':{'id':_0x429aae[_0x7ccd('0x48')]['id']}})['then'](handleEntityNotFound(_0x339e55,null))[_0x7ccd('0x26')](function(_0x3337e0){if(_0x3337e0){_0x23f201=_0x3337e0;_0x22ed1b[_0x7ccd('0x32')]=_['keys'](db[_0x7ccd('0x78')][_0x7ccd('0x49')]);_0x22ed1b[_0x7ccd('0x34')]=_['keys'](_0x429aae[_0x7ccd('0x34')]);_0x22ed1b[_0x7ccd('0x36')]=_[_0x7ccd('0x37')](_0x22ed1b[_0x7ccd('0x32')],_0x22ed1b['query']);_0x2e429f[_0x7ccd('0x38')]=_[_0x7ccd('0x37')](_0x22ed1b[_0x7ccd('0x32')],qs[_0x7ccd('0x39')](_0x429aae[_0x7ccd('0x34')][_0x7ccd('0x39')]));_0x2e429f['attributes']=_0x2e429f['attributes']['length']?_0x2e429f[_0x7ccd('0x38')]:_0x22ed1b[_0x7ccd('0x32')];_0x2e429f[_0x7ccd('0x3e')]=qs[_0x7ccd('0x3f')](_0x429aae[_0x7ccd('0x34')][_0x7ccd('0x3f')]);_0x2e429f['where']=qs['filters'](_['pick'](_0x429aae[_0x7ccd('0x34')],_0x22ed1b[_0x7ccd('0x36')]));if(_0x429aae['query'][_0x7ccd('0x43')]){_0x2e429f['where']=_['merge'](_0x2e429f[_0x7ccd('0x40')],{'$or':_[_0x7ccd('0x33')](_0x2e429f[_0x7ccd('0x38')],function(_0x3cd4c4){var _0x370e31={};_0x370e31[_0x3cd4c4]={'$like':'%'+_0x429aae[_0x7ccd('0x34')][_0x7ccd('0x43')]+'%'};return _0x370e31;})});}_0x2e429f=_['merge']({},_0x2e429f,_0x429aae[_0x7ccd('0x45')]);return _0x23f201['getAgents'](_0x2e429f);}})[_0x7ccd('0x26')](function(_0x11dd2d){if(_0x11dd2d){_0x6851=_0x11dd2d['length'];if(!_0x429aae[_0x7ccd('0x34')][_0x7ccd('0x3b')]('nolimit')){_0x2e429f['limit']=qs['limit'](_0x429aae[_0x7ccd('0x34')][_0x7ccd('0x3d')]);_0x2e429f[_0x7ccd('0x21')]=qs[_0x7ccd('0x21')](_0x429aae[_0x7ccd('0x34')][_0x7ccd('0x21')]);}return _0x23f201[_0x7ccd('0x76')](_0x2e429f);}})[_0x7ccd('0x26')](function(_0x16397f){if(_0x16397f){return _0x16397f?{'count':_0x6851,'rows':_0x16397f}:null;}})[_0x7ccd('0x26')](respondWithResult(_0x339e55,null))[_0x7ccd('0x4c')](handleError(_0x339e55,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 15cfc1f..dd37800 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoicePrefix=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoicePrefixEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoicePrefixEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoicePrefix[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x70e0=['emit','events','../../mysqldb','VoicePrefix','update','remove'];(function(_0x47b3ff,_0x44b244){var _0x37289d=function(_0x1a3a53){while(--_0x1a3a53){_0x47b3ff['push'](_0x47b3ff['shift']());}};_0x37289d(++_0x44b244);}(_0x70e0,0x17b));var _0x070e=function(_0x2f2d8a,_0x179528){_0x2f2d8a=_0x2f2d8a-0x0;var _0x41239e=_0x70e0[_0x2f2d8a];return _0x41239e;};'use strict';var EventEmitter=require(_0x070e('0x0'));var VoicePrefix=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){VoicePrefixEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);VoicePrefixEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 967cae7..ab7148a 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 _0x9515=['./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x372ff4,_0x351cdb){var _0x3f74ec=function(_0x3c18aa){while(--_0x3c18aa){_0x372ff4['push'](_0x372ff4['shift']());}};_0x3f74ec(++_0x351cdb);}(_0x9515,0x1c4));var _0x5951=function(_0xbcdce,_0xadb248){_0xbcdce=_0xbcdce-0x0;var _0x16f787=_0x9515[_0xbcdce];return _0x16f787;};'use strict';var _=require(_0x5951('0x0'));var util=require(_0x5951('0x1'));var logger=require(_0x5951('0x2'))(_0x5951('0x3'));var moment=require(_0x5951('0x4'));var BPromise=require(_0x5951('0x5'));var rp=require(_0x5951('0x6'));var fs=require('fs');var path=require(_0x5951('0x7'));var rimraf=require(_0x5951('0x8'));var config=require(_0x5951('0x9'));var attributes=require(_0x5951('0xa'));module[_0x5951('0xb')]=function(_0x3ed96a,_0xf108cb){return _0x3ed96a[_0x5951('0xc')](_0x5951('0xd'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdd3=['request-promise','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','api','moment'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0xfdd3,0x68));var _0x3fdd=function(_0x54e12a,_0x549082){_0x54e12a=_0x54e12a-0x0;var _0x393d5c=_0xfdd3[_0x54e12a];return _0x393d5c;};'use strict';var _=require(_0x3fdd('0x0'));var util=require(_0x3fdd('0x1'));var logger=require('../../config/logger')(_0x3fdd('0x2'));var moment=require(_0x3fdd('0x3'));var BPromise=require('bluebird');var rp=require(_0x3fdd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3fdd('0x5'));module[_0x3fdd('0x6')]=function(_0x53c8f8,_0x307e22){return _0x53c8f8[_0x3fdd('0x7')](_0x3fdd('0x8'),attributes,{'tableName':'voice_prefixes','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 b03b43c..d90cf75 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 _0xf9c9=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x2746a4,_0x5effc7){var _0x4bc33e=function(_0x592dae){while(--_0x592dae){_0x2746a4['push'](_0x2746a4['shift']());}};_0x4bc33e(++_0x5effc7);}(_0xf9c9,0x165));var _0x9f9c=function(_0xa20971,_0x1bf32c){_0xa20971=_0xa20971-0x0;var _0x4f4271=_0xf9c9[_0xa20971];return _0x4f4271;};'use strict';var _=require(_0x9f9c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9f9c('0x1'));var rs=require(_0x9f9c('0x2'));var fs=require('fs');var Redis=require(_0x9f9c('0x3'));var db=require(_0x9f9c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f9c('0x5'))('rpc');var config=require(_0x9f9c('0x6'));var jayson=require(_0x9f9c('0x7'));var client=jayson[_0x9f9c('0x8')]['http']({'port':0x232a});config[_0x9f9c('0x9')]=_[_0x9f9c('0xa')](config[_0x9f9c('0x9')],{'host':_0x9f9c('0xb'),'port':0x18eb});var socket=require(_0x9f9c('0xc'))(new Redis(config[_0x9f9c('0x9')]));require(_0x9f9c('0xd'))[_0x9f9c('0xe')](socket);function respondWithRpcPromise(_0x5a4b31,_0x980577,_0x23ff64){return new BPromise(function(_0x33a9d6,_0x418444){return client[_0x9f9c('0xf')](_0x5a4b31,_0x23ff64)['then'](function(_0x235db7){logger[_0x9f9c('0x10')](_0x9f9c('0x11'),_0x980577,_0x9f9c('0x12'));logger[_0x9f9c('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x980577,_0x9f9c('0x12'),JSON[_0x9f9c('0x14')](_0x235db7));if(_0x235db7['error']){if(_0x235db7['error'][_0x9f9c('0x15')]===0x1f4){logger[_0x9f9c('0x16')](_0x9f9c('0x11'),_0x980577,_0x235db7['error'][_0x9f9c('0x17')]);return _0x418444(_0x235db7['error'][_0x9f9c('0x17')]);}logger[_0x9f9c('0x16')](_0x9f9c('0x11'),_0x980577,_0x235db7['error'][_0x9f9c('0x17')]);return _0x33a9d6(_0x235db7['error']['message']);}else{logger[_0x9f9c('0x10')](_0x9f9c('0x11'),_0x980577,'request\x20sent');_0x33a9d6(_0x235db7[_0x9f9c('0x18')][_0x9f9c('0x17')]);}})[_0x9f9c('0x19')](function(_0x3383d3){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x980577,_0x3383d3);_0x418444(_0x3383d3);});});} \ No newline at end of file +var _0x5035=['VoicePrefix,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./voicePrefix.socket','request','then','info','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0x5035,0xcb));var _0x5503=function(_0x488b78,_0x371290){_0x488b78=_0x488b78-0x0;var _0x298b2f=_0x5035[_0x488b78];return _0x298b2f;};'use strict';var _=require(_0x5503('0x0'));var util=require(_0x5503('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5503('0x2'));var fs=require('fs');var Redis=require(_0x5503('0x3'));var db=require(_0x5503('0x4'))['db'];var utils=require(_0x5503('0x5'));var logger=require(_0x5503('0x6'))('rpc');var config=require(_0x5503('0x7'));var jayson=require(_0x5503('0x8'));var client=jayson[_0x5503('0x9')][_0x5503('0xa')]({'port':0x232a});config[_0x5503('0xb')]=_['defaults'](config[_0x5503('0xb')],{'host':_0x5503('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5503('0xb')]));require(_0x5503('0xd'))['register'](socket);function respondWithRpcPromise(_0x17d7c2,_0x18486c,_0x5f5c25){return new BPromise(function(_0x16843b,_0x16f128){return client[_0x5503('0xe')](_0x17d7c2,_0x5f5c25)[_0x5503('0xf')](function(_0x418d58){logger[_0x5503('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x18486c,'request\x20sent');logger[_0x5503('0x11')](_0x5503('0x12'),_0x18486c,_0x5503('0x13'),JSON['stringify'](_0x418d58));if(_0x418d58[_0x5503('0x14')]){if(_0x418d58['error'][_0x5503('0x15')]===0x1f4){logger[_0x5503('0x14')](_0x5503('0x16'),_0x18486c,_0x418d58['error']['message']);return _0x16f128(_0x418d58[_0x5503('0x14')][_0x5503('0x17')]);}logger['error'](_0x5503('0x16'),_0x18486c,_0x418d58['error'][_0x5503('0x17')]);return _0x16843b(_0x418d58[_0x5503('0x14')]['message']);}else{logger[_0x5503('0x10')](_0x5503('0x16'),_0x18486c,_0x5503('0x13'));_0x16843b(_0x418d58[_0x5503('0x18')][_0x5503('0x17')]);}})['catch'](function(_0x5b57a9){logger[_0x5503('0x14')](_0x5503('0x16'),_0x18486c,_0x5b57a9);_0x16f128(_0x5b57a9);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 70b0e38..fd69ec3 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 _0x6bcf=['update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','remove'];(function(_0x22499b,_0x3d5a5c){var _0x35cabe=function(_0x883037){while(--_0x883037){_0x22499b['push'](_0x22499b['shift']());}};_0x35cabe(++_0x3d5a5c);}(_0x6bcf,0xd6));var _0xf6bc=function(_0x4dd198,_0x5bd0ed){_0x4dd198=_0x4dd198-0x0;var _0x1a7872=_0x6bcf[_0x4dd198];return _0x1a7872;};'use strict';var VoicePrefixEvents=require(_0xf6bc('0x0'));var events=['save',_0xf6bc('0x1'),_0xf6bc('0x2')];function createListener(_0x15bbad,_0x11e3c6){return function(_0x4412bf){_0x11e3c6[_0xf6bc('0x3')](_0x15bbad,_0x4412bf);};}function removeListener(_0x25da49,_0x34db07){return function(){VoicePrefixEvents[_0xf6bc('0x4')](_0x25da49,_0x34db07);};}exports[_0xf6bc('0x5')]=function(_0x2c60c9){for(var _0x13b15c=0x0,_0x2f467f=events[_0xf6bc('0x6')];_0x13b15c<_0x2f467f;_0x13b15c++){var _0x873549=events[_0x13b15c];var _0xe98600=createListener(_0xf6bc('0x7')+_0x873549,_0x2c60c9);VoicePrefixEvents['on'](_0x873549,_0xe98600);}}; \ No newline at end of file +var _0x9a2b=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','update'];(function(_0x5440e5,_0x56fac9){var _0x6c5beb=function(_0x381227){while(--_0x381227){_0x5440e5['push'](_0x5440e5['shift']());}};_0x6c5beb(++_0x56fac9);}(_0x9a2b,0x186));var _0xb9a2=function(_0x50abc4,_0x558d64){_0x50abc4=_0x50abc4-0x0;var _0x5a745d=_0x9a2b[_0x50abc4];return _0x5a745d;};'use strict';var VoicePrefixEvents=require(_0xb9a2('0x0'));var events=['save','remove',_0xb9a2('0x1')];function createListener(_0x3e4f6a,_0x36d4f1){return function(_0x21589b){_0x36d4f1[_0xb9a2('0x2')](_0x3e4f6a,_0x21589b);};}function removeListener(_0xf7f980,_0x260c01){return function(){VoicePrefixEvents[_0xb9a2('0x3')](_0xf7f980,_0x260c01);};}exports[_0xb9a2('0x4')]=function(_0x5507da){for(var _0x266236=0x0,_0x480bf9=events[_0xb9a2('0x5')];_0x266236<_0x480bf9;_0x266236++){var _0x5a6c62=events[_0x266236];var _0x31d8a8=createListener(_0xb9a2('0x6')+_0x5a6c62,_0x5507da);VoicePrefixEvents['on'](_0x5a6c62,_0x31d8a8);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index cb690f3..84c2f47 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 _0x6853=['exports','multer','path','connect-timeout','Router','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getTeams','/:id/users','getAgents','/:id/members','getLists','/:id/blacklists','create','post','clone','/:id/teams','addTeams','addAgents','/:id/lists','addLists','addBlackLists','put','/:id','update','delete','destroy','removeTeams','removeLists','removeBlackLists'];(function(_0xd48cf0,_0x858296){var _0x20c54=function(_0x1526a7){while(--_0x1526a7){_0xd48cf0['push'](_0xd48cf0['shift']());}};_0x20c54(++_0x858296);}(_0x6853,0x99));var _0x3685=function(_0x1c21b4,_0x3e6e66){_0x1c21b4=_0x1c21b4-0x0;var _0x57ef82=_0x6853[_0x1c21b4];return _0x57ef82;};'use strict';var multer=require(_0x3685('0x0'));var util=require('util');var path=require(_0x3685('0x1'));var timeout=require(_0x3685('0x2'));var express=require('express');var router=express[_0x3685('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3685('0x4'));var controller=require(_0x3685('0x5'));router[_0x3685('0x6')]('/',auth['isAuthenticated'](),controller[_0x3685('0x7')]);router[_0x3685('0x6')]('/:id',auth[_0x3685('0x8')](),controller[_0x3685('0x9')]);router[_0x3685('0x6')]('/:id/hoppers',auth[_0x3685('0x8')](),controller['getHoppers']);router[_0x3685('0x6')](_0x3685('0xa'),auth[_0x3685('0x8')](),controller[_0x3685('0xb')]);router['get'](_0x3685('0xc'),auth[_0x3685('0x8')](),controller['getHopperFinals']);router[_0x3685('0x6')](_0x3685('0xd'),auth[_0x3685('0x8')](),controller['getHopperBlacks']);router[_0x3685('0x6')]('/:id/teams',auth[_0x3685('0x8')](),controller[_0x3685('0xe')]);router[_0x3685('0x6')](_0x3685('0xf'),auth[_0x3685('0x8')](),controller[_0x3685('0x10')]);router['get'](_0x3685('0x11'),auth[_0x3685('0x8')](),controller['getMembers']);router[_0x3685('0x6')]('/:id/lists',auth[_0x3685('0x8')](),controller[_0x3685('0x12')]);router[_0x3685('0x6')](_0x3685('0x13'),auth[_0x3685('0x8')](),controller['getBlackLists']);router['post']('/',auth[_0x3685('0x8')](),controller[_0x3685('0x14')]);router[_0x3685('0x15')]('/:id/clone',auth[_0x3685('0x8')](),controller[_0x3685('0x16')]);router[_0x3685('0x15')](_0x3685('0x17'),auth['isAuthenticated'](),controller[_0x3685('0x18')]);router[_0x3685('0x15')](_0x3685('0xf'),auth[_0x3685('0x8')](),controller[_0x3685('0x19')]);router[_0x3685('0x15')](_0x3685('0x1a'),auth[_0x3685('0x8')](),controller[_0x3685('0x1b')]);router['post']('/:id/blacklists',auth[_0x3685('0x8')](),controller[_0x3685('0x1c')]);router[_0x3685('0x1d')](_0x3685('0x1e'),auth[_0x3685('0x8')](),controller[_0x3685('0x1f')]);router[_0x3685('0x20')](_0x3685('0x1e'),auth[_0x3685('0x8')](),controller[_0x3685('0x21')]);router[_0x3685('0x20')](_0x3685('0x17'),auth['isAuthenticated'](),controller[_0x3685('0x22')]);router['delete']('/:id/users',auth[_0x3685('0x8')](),controller['removeAgents']);router[_0x3685('0x20')](_0x3685('0x1a'),auth[_0x3685('0x8')](),controller[_0x3685('0x23')]);router[_0x3685('0x20')](_0x3685('0x13'),auth['isAuthenticated'](),controller[_0x3685('0x24')]);module[_0x3685('0x25')]=router; \ No newline at end of file +var _0x0fae=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','index','get','/:id','isAuthenticated','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeTeams','removeLists','removeBlackLists','multer'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x0fae,0xa7));var _0xe0fa=function(_0x25fc4a,_0x543fdb){_0x25fc4a=_0x25fc4a-0x0;var _0x1f7307=_0x0fae[_0x25fc4a];return _0x1f7307;};'use strict';var multer=require(_0xe0fa('0x0'));var util=require(_0xe0fa('0x1'));var path=require(_0xe0fa('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0fa('0x3'));var router=express[_0xe0fa('0x4')]();var auth=require(_0xe0fa('0x5'));var interaction=require(_0xe0fa('0x6'));var config=require(_0xe0fa('0x7'));var controller=require(_0xe0fa('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe0fa('0x9')]);router[_0xe0fa('0xa')](_0xe0fa('0xb'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0xd')]);router[_0xe0fa('0xa')](_0xe0fa('0xe'),auth[_0xe0fa('0xc')](),controller['getHoppers']);router[_0xe0fa('0xa')](_0xe0fa('0xf'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x10')]);router['get'](_0xe0fa('0x11'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x12')]);router['get'](_0xe0fa('0x13'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xe0fa('0xa')](_0xe0fa('0x14'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x15')]);router['get'](_0xe0fa('0x16'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x17')]);router[_0xe0fa('0xa')](_0xe0fa('0x18'),auth['isAuthenticated'](),controller[_0xe0fa('0x19')]);router['get'](_0xe0fa('0x1a'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x1b')]);router[_0xe0fa('0xa')](_0xe0fa('0x1c'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x1d')]);router[_0xe0fa('0x1e')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe0fa('0x1e')](_0xe0fa('0x1f'),auth['isAuthenticated'](),controller[_0xe0fa('0x20')]);router[_0xe0fa('0x1e')](_0xe0fa('0x14'),auth[_0xe0fa('0xc')](),controller['addTeams']);router[_0xe0fa('0x1e')]('/:id/users',auth[_0xe0fa('0xc')](),controller['addAgents']);router[_0xe0fa('0x1e')](_0xe0fa('0x1a'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x21')]);router[_0xe0fa('0x1e')](_0xe0fa('0x1c'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x22')]);router[_0xe0fa('0x23')](_0xe0fa('0xb'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x24')]);router['delete'](_0xe0fa('0xb'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x25')]);router[_0xe0fa('0x26')]('/:id/teams',auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x27')]);router[_0xe0fa('0x26')](_0xe0fa('0x16'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xe0fa('0x26')](_0xe0fa('0x1a'),auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x28')]);router[_0xe0fa('0x26')]('/:id/blacklists',auth[_0xe0fa('0xc')](),controller[_0xe0fa('0x29')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 88e34d0..59a5577 100644 --- a/server/api/voiceQueue/voiceQueue.attributes.js +++ b/server/api/voiceQueue/voiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x3c7616,_0x1ad775){var _0x290716=function(_0x32257b){while(--_0x32257b){_0x3c7616['push'](_0x3c7616['shift']());}};_0x290716(++_0x1ad775);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 6244ab2..b7b9995 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 _0x4ca7=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','count','includeAll','rows','params','keys','include','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','role','getHoppers','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','User','Agents','online','interface','flatMap','penalty','transaction','addTeams','UserVoiceQueue','findOrCreate','each','UserVoiceQueueRt','upsert','format','SIP/%s','voicePause','forEach','userVoiceQueue:save','removeTeams','ids','tq.TeamId','from','user_has_teams','VoiceQueueId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','all','union','isEmpty','removeAgents','emit','addAgents','spread','isNil','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','CmListId','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','getBlackLists','addBlackLists','deletedAt\x20IS\x20NULL','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','get','VoiceQueues','inbound','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','destroy','error','stack','name','send','VoiceQueue','fieldName','key','model'];(function(_0xad2e0b,_0x5dfa55){var _0x59ed58=function(_0x276cd7){while(--_0x276cd7){_0xad2e0b['push'](_0xad2e0b['shift']());}};_0x59ed58(++_0x5dfa55);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x24b6cc,_0x4cfbf2){_0x24b6cc=_0x24b6cc-0x0;var _0x2496aa=_0x4ca7[_0x24b6cc];return _0x2496aa;};'use strict';var pdf=require(_0x74ca('0x0'));var emlformat=require(_0x74ca('0x1'));var rimraf=require(_0x74ca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74ca('0x3'));var rp=require(_0x74ca('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x74ca('0x5'));var util=require('util');var path=require(_0x74ca('0x6'));var sox=require(_0x74ca('0x7'));var csv=require('to-csv');var ejs=require(_0x74ca('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x74ca('0x9'));var crypto=require(_0x74ca('0xa'));var jsforce=require(_0x74ca('0xb'));var deskjs=require(_0x74ca('0xc'));var toCsv=require(_0x74ca('0xd'));var querystring=require(_0x74ca('0xe'));var Papa=require(_0x74ca('0xf'));var Redis=require('ioredis');var authService=require(_0x74ca('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x74ca('0x11'));var hardwareService=require(_0x74ca('0x12'));var logger=require('../../config/logger')(_0x74ca('0x13'));var utils=require(_0x74ca('0x14'));var config=require(_0x74ca('0x15'));var db=require(_0x74ca('0x16'))['db'];config[_0x74ca('0x17')]=_[_0x74ca('0x18')](config[_0x74ca('0x17')],{'host':_0x74ca('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74ca('0x17')]));require(_0x74ca('0x1a'))[_0x74ca('0x1b')](socket);function respondWithStatusCode(_0x223a9d,_0x248a33){_0x248a33=_0x248a33||0xcc;return function(_0x276ea6){if(_0x276ea6){return _0x223a9d[_0x74ca('0x1c')](_0x248a33);}return _0x223a9d[_0x74ca('0x1d')](_0x248a33)[_0x74ca('0x1e')]();};}function respondWithResult(_0x196b51,_0x440310){_0x440310=_0x440310||0xc8;return function(_0x4606fe){if(_0x4606fe){return _0x196b51[_0x74ca('0x1d')](_0x440310)[_0x74ca('0x1f')](_0x4606fe);}};}function respondWithFilteredResult(_0x5464be,_0x22010a){return function(_0xa4f361){if(_0xa4f361){var _0xdc8fc7=_0xa4f361['count'],_0x392d58=_0x22010a[_0x74ca('0x20')],_0x42ab02=_0x22010a[_0x74ca('0x20')]+_0x22010a[_0x74ca('0x21')],_0x5769e1;if(_0x42ab02>=_0xdc8fc7){_0x42ab02=_0xdc8fc7;_0x5769e1=0xc8;}else{_0x5769e1=0xce;}_0x5464be[_0x74ca('0x1d')](_0x5769e1);return _0x5464be[_0x74ca('0x22')](_0x74ca('0x23'),_0x392d58+'-'+_0x42ab02+'/'+_0xdc8fc7)['json'](_0xa4f361);}return null;};}function patchUpdates(_0x37ac3e){return function(_0x3a3a6c){try{jsonpatch['apply'](_0x3a3a6c,_0x37ac3e,!![]);}catch(_0x5a77f4){return BPromise['reject'](_0x5a77f4);}return _0x3a3a6c[_0x74ca('0x24')]();};}function saveUpdates(_0x2f7bb1,_0x2ba9f2){return function(_0x6c2ba2){if(_0x6c2ba2){return _0x6c2ba2[_0x74ca('0x25')](_0x2f7bb1)[_0x74ca('0x26')](function(_0x1a48cf){return _0x1a48cf;});}return null;};}function removeEntity(_0x1c527b,_0x1ceb6c){return function(_0x25ca30){if(_0x25ca30){return _0x25ca30['destroy']()['then'](function(){var _0x1aeded=_0x25ca30[_0x74ca('0x27')]({'plain':!![]});var _0x2eaef6=[{'name':_0x74ca('0x28'),'value':_0x74ca('0x29'),'ignore':![]},{'name':'QueueCampaigns','value':_0x74ca('0x2a'),'ignore':![]}];var _0x13ef53=_(_0x2eaef6)[_0x74ca('0x2b')](_0x74ca('0x2c'))[_0x74ca('0x2d')](_0x74ca('0x2e'))[_0x74ca('0x2e')]();if(_[_0x74ca('0x2f')](_0x13ef53,_0x1aeded[_0x74ca('0x30')])){return;}var _0x31d9b2=_[_0x74ca('0x31')](_0x2eaef6,[_0x74ca('0x2e'),_0x1aeded['type']])['name'];return db[_0x74ca('0x32')][_0x74ca('0x33')]({'where':{'type':_0x31d9b2,'resourceId':_0x1aeded['id']}})[_0x74ca('0x26')](function(){return _0x25ca30;});})[_0x74ca('0x26')](function(){_0x1c527b[_0x74ca('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdee066,_0x425cd5){return function(_0x52f02e){if(!_0x52f02e){_0xdee066[_0x74ca('0x1c')](0x194);}return _0x52f02e;};}function handleError(_0x3d0800,_0x55d3ac){_0x55d3ac=_0x55d3ac||0x1f4;return function(_0x3866dd){logger[_0x74ca('0x34')](_0x3866dd[_0x74ca('0x35')]);if(_0x3866dd[_0x74ca('0x36')]){delete _0x3866dd[_0x74ca('0x36')];}_0x3d0800[_0x74ca('0x1d')](_0x55d3ac)[_0x74ca('0x37')](_0x3866dd);};}exports['index']=function(_0x4d3f62,_0x14b8c){var _0x25433c={},_0x3c140d={},_0x1881a0={'count':0x0,'rows':[]};var _0x41e555=_[_0x74ca('0x2d')](db[_0x74ca('0x38')]['rawAttributes'],function(_0x385eff){return{'name':_0x385eff[_0x74ca('0x39')],'type':_0x385eff[_0x74ca('0x30')][_0x74ca('0x3a')]};});_0x3c140d[_0x74ca('0x3b')]=_[_0x74ca('0x2d')](_0x41e555,_0x74ca('0x36'));_0x3c140d[_0x74ca('0x3c')]=_['keys'](_0x4d3f62[_0x74ca('0x3c')]);_0x3c140d['filters']=_[_0x74ca('0x3d')](_0x3c140d['model'],_0x3c140d[_0x74ca('0x3c')]);_0x25433c[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x3c140d[_0x74ca('0x3b')],qs[_0x74ca('0x3f')](_0x4d3f62['query'][_0x74ca('0x3f')]));_0x25433c[_0x74ca('0x3e')]=_0x25433c['attributes'][_0x74ca('0x40')]?_0x25433c['attributes']:_0x3c140d[_0x74ca('0x3b')];if(!_0x4d3f62[_0x74ca('0x3c')][_0x74ca('0x41')](_0x74ca('0x42'))){_0x25433c[_0x74ca('0x21')]=qs[_0x74ca('0x21')](_0x4d3f62[_0x74ca('0x3c')]['limit']);_0x25433c[_0x74ca('0x20')]=qs[_0x74ca('0x20')](_0x4d3f62[_0x74ca('0x3c')][_0x74ca('0x20')]);}_0x25433c[_0x74ca('0x43')]=qs[_0x74ca('0x44')](_0x4d3f62[_0x74ca('0x3c')][_0x74ca('0x44')]);_0x25433c[_0x74ca('0x45')]=qs[_0x74ca('0x46')](_[_0x74ca('0x47')](_0x4d3f62['query'],_0x3c140d['filters']));if(_0x4d3f62[_0x74ca('0x3c')][_0x74ca('0x2b')]){_0x25433c['where']=_[_0x74ca('0x48')](_0x25433c['where'],{'$or':_[_0x74ca('0x2d')](_0x41e555,function(_0x2e9a37){if(_0x2e9a37[_0x74ca('0x30')]!==_0x74ca('0x49')){var _0x52e278={};_0x52e278[_0x2e9a37[_0x74ca('0x36')]]={'$like':'%'+_0x4d3f62[_0x74ca('0x3c')][_0x74ca('0x2b')]+'%'};return _0x52e278;}})});}_0x25433c=_[_0x74ca('0x48')]({},_0x25433c,_0x4d3f62['options']);var _0x513b25={'where':_0x25433c[_0x74ca('0x45')]};return db[_0x74ca('0x38')]['count'](_0x513b25)['then'](function(_0x356e96){_0x1881a0[_0x74ca('0x4a')]=_0x356e96;if(_0x4d3f62[_0x74ca('0x3c')][_0x74ca('0x4b')]){_0x25433c['include']=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x25433c);})[_0x74ca('0x26')](function(_0x2ee7b0){_0x1881a0[_0x74ca('0x4c')]=_0x2ee7b0;return _0x1881a0;})[_0x74ca('0x26')](respondWithFilteredResult(_0x14b8c,_0x25433c))['catch'](handleError(_0x14b8c,null));};exports['show']=function(_0xa75116,_0x5277b7){var _0xb7d00b={'raw':![],'where':{'id':_0xa75116[_0x74ca('0x4d')]['id']}},_0xb7f0a2={};_0xb7f0a2[_0x74ca('0x3b')]=_[_0x74ca('0x4e')](db[_0x74ca('0x38')]['rawAttributes']);_0xb7f0a2[_0x74ca('0x3c')]=_['keys'](_0xa75116[_0x74ca('0x3c')]);_0xb7f0a2[_0x74ca('0x46')]=_[_0x74ca('0x3d')](_0xb7f0a2[_0x74ca('0x3b')],_0xb7f0a2[_0x74ca('0x3c')]);_0xb7d00b[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0xb7f0a2['model'],qs[_0x74ca('0x3f')](_0xa75116[_0x74ca('0x3c')][_0x74ca('0x3f')]));_0xb7d00b[_0x74ca('0x3e')]=_0xb7d00b['attributes'][_0x74ca('0x40')]?_0xb7d00b[_0x74ca('0x3e')]:_0xb7f0a2[_0x74ca('0x3b')];if(_0xa75116['query']['includeAll']){_0xb7d00b[_0x74ca('0x4f')]=[{'all':!![]}];}_0xb7d00b=_[_0x74ca('0x48')]({},_0xb7d00b,_0xa75116[_0x74ca('0x50')]);return db['VoiceQueue'][_0x74ca('0x31')](_0xb7d00b)['then'](handleEntityNotFound(_0x5277b7,null))[_0x74ca('0x26')](respondWithResult(_0x5277b7,null))[_0x74ca('0x51')](handleError(_0x5277b7,null));};exports[_0x74ca('0x52')]=function(_0x74d6a0,_0x4de3f9){return db[_0x74ca('0x38')][_0x74ca('0x52')](_0x74d6a0[_0x74ca('0x53')],{})[_0x74ca('0x26')](function(_0x3d68f6){var _0x492e6b=_0x74d6a0[_0x74ca('0x54')][_0x74ca('0x27')]({'plain':!![]});if(!_0x492e6b)throw new Error(_0x74ca('0x55'));if(_0x492e6b['role']===_0x74ca('0x54')){var _0x4d4c7c=_0x3d68f6[_0x74ca('0x27')]({'plain':!![]});var _0xb2ca4c=[{'name':_0x74ca('0x28'),'value':_0x74ca('0x29')},{'name':_0x74ca('0x56'),'value':_0x74ca('0x2a')}];var _0x337358=_[_0x74ca('0x31')](_0xb2ca4c,[_0x74ca('0x2e'),_0x4d4c7c[_0x74ca('0x30')]])['name'];return db[_0x74ca('0x57')][_0x74ca('0x31')]({'where':{'name':_0x337358,'userProfileId':_0x492e6b[_0x74ca('0x58')]},'raw':!![]})[_0x74ca('0x26')](function(_0x320267){if(_0x320267&&_0x320267[_0x74ca('0x59')]===0x0){return db[_0x74ca('0x32')][_0x74ca('0x52')]({'name':_0x4d4c7c[_0x74ca('0x36')],'resourceId':_0x4d4c7c['id'],'type':_0x320267[_0x74ca('0x36')],'sectionId':_0x320267['id']},{})[_0x74ca('0x26')](function(){return _0x3d68f6;});}else{return _0x3d68f6;}})[_0x74ca('0x51')](function(_0x2bbebf){logger[_0x74ca('0x34')](_0x74ca('0x5a'),_0x2bbebf);throw _0x2bbebf;});}return _0x3d68f6;})[_0x74ca('0x26')](respondWithResult(_0x4de3f9,0xc9))['catch'](handleError(_0x4de3f9,null));};exports[_0x74ca('0x5b')]=function(_0xfb5877,_0x49e11f){var _0x55139e={'where':{'id':_0xfb5877[_0x74ca('0x4d')]['id']}},_0x361534={};_0x361534[_0x74ca('0x3b')]=_[_0x74ca('0x4e')](db['VoiceQueue'][_0x74ca('0x5c')]);_0x55139e[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x361534[_0x74ca('0x3b')],qs[_0x74ca('0x3f')](_0xfb5877[_0x74ca('0x3c')]['fields']));_0x55139e['attributes']=_0x55139e[_0x74ca('0x3e')][_0x74ca('0x40')]?_0x55139e[_0x74ca('0x3e')]:_0x361534[_0x74ca('0x3b')];if(_0xfb5877[_0x74ca('0x3c')][_0x74ca('0x4b')]){_0x55139e[_0x74ca('0x4f')]=[{'all':!![]}];}_0x55139e=_[_0x74ca('0x48')]({},_0x55139e,_0xfb5877[_0x74ca('0x50')]);return db[_0x74ca('0x38')]['find'](_0x55139e)['then'](handleEntityNotFound(_0x49e11f,null))[_0x74ca('0x26')](function(_0xa91a85){if(_0xa91a85){var _0x21b705=_0xa91a85['get']({'plain':!![]});_0x21b705=qs[_0x74ca('0x5d')](_0x21b705,['id',_0x74ca('0x5e'),_0x74ca('0x5f')]);_0xfb5877['body']=_[_0x74ca('0x5d')](_0xfb5877[_0x74ca('0x53')],['id','createdAt',_0x74ca('0x5f')]);return db[_0x74ca('0x38')]['create'](_[_0x74ca('0x48')](_0x21b705,_0xfb5877[_0x74ca('0x53')]),{'include':_0xfb5877['query'][_0x74ca('0x4b')]?[{'all':!![]}]:undefined})[_0x74ca('0x26')](function(_0x15ab6c){var _0x216d22=_0xfb5877[_0x74ca('0x54')][_0x74ca('0x27')]({'plain':!![]});if(!_0x216d22)throw new Error(_0x74ca('0x55'));if(_0x216d22[_0x74ca('0x60')]===_0x74ca('0x54')){var _0x154f3d=_0x15ab6c[_0x74ca('0x27')]({'plain':!![]});var _0x18b074=[{'name':_0x74ca('0x28'),'value':_0x74ca('0x29')},{'name':_0x74ca('0x56'),'value':_0x74ca('0x2a')}];var _0x234081=_[_0x74ca('0x31')](_0x18b074,['value',_0x154f3d[_0x74ca('0x30')]])[_0x74ca('0x36')];return db['UserProfileSection'][_0x74ca('0x31')]({'where':{'name':_0x234081,'userProfileId':_0x216d22[_0x74ca('0x58')]},'raw':!![]})[_0x74ca('0x26')](function(_0x49f025){if(_0x49f025&&_0x49f025['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x154f3d['name'],'resourceId':_0x154f3d['id'],'type':_0x49f025[_0x74ca('0x36')],'sectionId':_0x49f025['id']},{})[_0x74ca('0x26')](function(){return _0x15ab6c;});}else{return _0x15ab6c;}})[_0x74ca('0x51')](function(_0x3b3d20){logger[_0x74ca('0x34')](_0x74ca('0x5a'),_0x3b3d20);throw _0x3b3d20;});}return _0x15ab6c;});}})[_0x74ca('0x26')](respondWithResult(_0x49e11f,0xc9))[_0x74ca('0x51')](handleError(_0x49e11f,null));};exports['update']=function(_0x5559de,_0x18c8a8){if(_0x5559de[_0x74ca('0x53')]['id']){delete _0x5559de[_0x74ca('0x53')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x5559de['params']['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x18c8a8,null))[_0x74ca('0x26')](saveUpdates(_0x5559de[_0x74ca('0x53')],null))['then'](respondWithResult(_0x18c8a8,null))[_0x74ca('0x51')](handleError(_0x18c8a8,null));};exports[_0x74ca('0x33')]=function(_0x4d9e4d,_0x3c93c1){return db[_0x74ca('0x38')][_0x74ca('0x31')]({'where':{'id':_0x4d9e4d[_0x74ca('0x4d')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x3c93c1,null))['then'](removeEntity(_0x3c93c1,null))[_0x74ca('0x51')](handleError(_0x3c93c1,null));};exports[_0x74ca('0x61')]=function(_0x541eb9,_0x3ebcb,_0x31057a){var _0x429efd={'raw':![],'where':{}};var _0x44bd4f={};var _0x536be0={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x74ca('0x62')]({'where':{'id':_0x541eb9['params']['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x3ebcb,null))[_0x74ca('0x26')](function(_0x5da7aa){if(_0x5da7aa){_0x44bd4f[_0x74ca('0x3b')]=_[_0x74ca('0x4e')](db[_0x74ca('0x63')][_0x74ca('0x5c')]);_0x44bd4f[_0x74ca('0x3c')]=_['keys'](_0x541eb9[_0x74ca('0x3c')]);_0x44bd4f[_0x74ca('0x46')]=_[_0x74ca('0x3d')](_0x44bd4f[_0x74ca('0x3b')],_0x44bd4f[_0x74ca('0x3c')]);_0x429efd[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x44bd4f[_0x74ca('0x3b')],qs[_0x74ca('0x3f')](_0x541eb9[_0x74ca('0x3c')][_0x74ca('0x3f')]));_0x429efd[_0x74ca('0x3e')]=_0x429efd['attributes'][_0x74ca('0x40')]?_0x429efd[_0x74ca('0x3e')]:_0x44bd4f[_0x74ca('0x3b')];if(!_0x541eb9[_0x74ca('0x3c')][_0x74ca('0x41')](_0x74ca('0x42'))){_0x429efd[_0x74ca('0x21')]=qs[_0x74ca('0x21')](_0x541eb9[_0x74ca('0x3c')][_0x74ca('0x21')]);_0x429efd[_0x74ca('0x20')]=qs[_0x74ca('0x20')](_0x541eb9[_0x74ca('0x3c')][_0x74ca('0x20')]);}_0x429efd[_0x74ca('0x43')]=qs['sort'](_0x541eb9['query']['sort']);_0x429efd[_0x74ca('0x45')]=qs['filters'](_[_0x74ca('0x47')](_0x541eb9[_0x74ca('0x3c')],_0x44bd4f['filters']));_0x429efd[_0x74ca('0x45')][_0x74ca('0x64')]=_0x5da7aa['id'];if(_0x541eb9[_0x74ca('0x3c')][_0x74ca('0x2b')]){_0x429efd[_0x74ca('0x45')]=_[_0x74ca('0x48')](_0x429efd[_0x74ca('0x45')],{'$or':_[_0x74ca('0x2d')](_0x429efd[_0x74ca('0x3e')],function(_0x20b5d9){var _0x34f02b={};_0x34f02b[_0x20b5d9]={'$like':'%'+_0x541eb9[_0x74ca('0x3c')][_0x74ca('0x2b')]+'%'};return _0x34f02b;})});}_0x429efd=_[_0x74ca('0x48')]({},_0x429efd,_0x541eb9[_0x74ca('0x50')]);return db[_0x74ca('0x63')]['count']({'where':_0x429efd[_0x74ca('0x45')]})[_0x74ca('0x26')](function(_0x5189ca){_0x536be0[_0x74ca('0x4a')]=_0x5189ca;if(_0x541eb9[_0x74ca('0x3c')][_0x74ca('0x4b')]){_0x429efd['include']=[{'all':!![]}];}return db[_0x74ca('0x63')][_0x74ca('0x65')](_0x429efd);})[_0x74ca('0x26')](function(_0x3bea9e){_0x536be0['rows']=_0x3bea9e;return _0x536be0;});}})[_0x74ca('0x26')](respondWithFilteredResult(_0x3ebcb,_0x429efd))[_0x74ca('0x51')](handleError(_0x3ebcb,null));};exports[_0x74ca('0x66')]=function(_0x499177,_0x41339d,_0x217e22){var _0x50ccdd={'raw':!![],'where':{}};var _0x1fb827={};var _0xc16735={'count':0x0,'rows':[]};return db[_0x74ca('0x38')][_0x74ca('0x62')]({'where':{'id':_0x499177[_0x74ca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x41339d,null))['then'](function(_0x3466b6){if(_0x3466b6){_0x1fb827[_0x74ca('0x3b')]=_[_0x74ca('0x4e')](db['CmHopperHistory'][_0x74ca('0x5c')]);_0x1fb827[_0x74ca('0x3c')]=_[_0x74ca('0x4e')](_0x499177[_0x74ca('0x3c')]);_0x1fb827[_0x74ca('0x46')]=_[_0x74ca('0x3d')](_0x1fb827[_0x74ca('0x3b')],_0x1fb827[_0x74ca('0x3c')]);_0x50ccdd[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x1fb827[_0x74ca('0x3b')],qs['fields'](_0x499177[_0x74ca('0x3c')]['fields']));_0x50ccdd['attributes']=_0x50ccdd[_0x74ca('0x3e')][_0x74ca('0x40')]?_0x50ccdd[_0x74ca('0x3e')]:_0x1fb827[_0x74ca('0x3b')];if(!_0x499177[_0x74ca('0x3c')][_0x74ca('0x41')]('nolimit')){_0x50ccdd[_0x74ca('0x21')]=qs[_0x74ca('0x21')](_0x499177['query'][_0x74ca('0x21')]);_0x50ccdd[_0x74ca('0x20')]=qs['offset'](_0x499177[_0x74ca('0x3c')][_0x74ca('0x20')]);}_0x50ccdd[_0x74ca('0x43')]=qs[_0x74ca('0x44')](_0x499177[_0x74ca('0x3c')][_0x74ca('0x44')]);_0x50ccdd[_0x74ca('0x45')]=qs[_0x74ca('0x46')](_[_0x74ca('0x47')](_0x499177[_0x74ca('0x3c')],_0x1fb827['filters']));_0x50ccdd[_0x74ca('0x45')][_0x74ca('0x64')]=_0x3466b6['id'];if(_0x499177[_0x74ca('0x3c')][_0x74ca('0x2b')]){_0x50ccdd[_0x74ca('0x45')]=_['merge'](_0x50ccdd['where'],{'$or':_[_0x74ca('0x2d')](_0x50ccdd[_0x74ca('0x3e')],function(_0x4de8e3){var _0x4bff1c={};_0x4bff1c[_0x4de8e3]={'$like':'%'+_0x499177[_0x74ca('0x3c')][_0x74ca('0x2b')]+'%'};return _0x4bff1c;})});}_0x50ccdd=_[_0x74ca('0x48')]({},_0x50ccdd,_0x499177['options']);return db['CmHopperHistory'][_0x74ca('0x4a')]({'where':_0x50ccdd[_0x74ca('0x45')]})['then'](function(_0x5ef623){_0xc16735[_0x74ca('0x4a')]=_0x5ef623;if(_0x499177['query'][_0x74ca('0x4b')]){_0x50ccdd[_0x74ca('0x4f')]=[{'all':!![]}];}return db[_0x74ca('0x67')][_0x74ca('0x65')](_0x50ccdd);})[_0x74ca('0x26')](function(_0x3b1fe9){_0xc16735[_0x74ca('0x4c')]=_0x3b1fe9;return _0xc16735;});}})[_0x74ca('0x26')](respondWithFilteredResult(_0x41339d,_0x50ccdd))[_0x74ca('0x51')](handleError(_0x41339d,null));};exports[_0x74ca('0x68')]=function(_0x2b07ab,_0x4ac5ca,_0x3f9356){var _0x972472={'raw':!![],'where':{}};var _0x114804={};var _0x2d00b8={'count':0x0,'rows':[]};return db[_0x74ca('0x38')][_0x74ca('0x62')]({'where':{'id':_0x2b07ab[_0x74ca('0x4d')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x4ac5ca,null))[_0x74ca('0x26')](function(_0x5da155){if(_0x5da155){_0x114804[_0x74ca('0x3b')]=_[_0x74ca('0x4e')](db[_0x74ca('0x69')][_0x74ca('0x5c')]);_0x114804['query']=_[_0x74ca('0x4e')](_0x2b07ab[_0x74ca('0x3c')]);_0x114804[_0x74ca('0x46')]=_[_0x74ca('0x3d')](_0x114804['model'],_0x114804[_0x74ca('0x3c')]);_0x972472[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x114804[_0x74ca('0x3b')],qs[_0x74ca('0x3f')](_0x2b07ab[_0x74ca('0x3c')][_0x74ca('0x3f')]));_0x972472[_0x74ca('0x3e')]=_0x972472[_0x74ca('0x3e')][_0x74ca('0x40')]?_0x972472['attributes']:_0x114804[_0x74ca('0x3b')];if(!_0x2b07ab[_0x74ca('0x3c')]['hasOwnProperty'](_0x74ca('0x42'))){_0x972472[_0x74ca('0x21')]=qs[_0x74ca('0x21')](_0x2b07ab[_0x74ca('0x3c')][_0x74ca('0x21')]);_0x972472[_0x74ca('0x20')]=qs['offset'](_0x2b07ab[_0x74ca('0x3c')]['offset']);}_0x972472[_0x74ca('0x43')]=qs[_0x74ca('0x44')](_0x2b07ab[_0x74ca('0x3c')][_0x74ca('0x44')]);_0x972472[_0x74ca('0x45')]=qs['filters'](_[_0x74ca('0x47')](_0x2b07ab[_0x74ca('0x3c')],_0x114804[_0x74ca('0x46')]));_0x972472[_0x74ca('0x45')]['VoiceQueueId']=_0x5da155['id'];if(_0x2b07ab['query'][_0x74ca('0x2b')]){_0x972472[_0x74ca('0x45')]=_[_0x74ca('0x48')](_0x972472[_0x74ca('0x45')],{'$or':_[_0x74ca('0x2d')](_0x972472[_0x74ca('0x3e')],function(_0x2f7111){var _0x1992f4={};_0x1992f4[_0x2f7111]={'$like':'%'+_0x2b07ab['query'][_0x74ca('0x2b')]+'%'};return _0x1992f4;})});}_0x972472=_[_0x74ca('0x48')]({},_0x972472,_0x2b07ab[_0x74ca('0x50')]);return db[_0x74ca('0x69')][_0x74ca('0x4a')]({'where':_0x972472[_0x74ca('0x45')]})[_0x74ca('0x26')](function(_0x3a084a){_0x2d00b8[_0x74ca('0x4a')]=_0x3a084a;if(_0x2b07ab[_0x74ca('0x3c')][_0x74ca('0x4b')]){_0x972472[_0x74ca('0x4f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x74ca('0x65')](_0x972472);})[_0x74ca('0x26')](function(_0x56e102){_0x2d00b8[_0x74ca('0x4c')]=_0x56e102;return _0x2d00b8;});}})[_0x74ca('0x26')](respondWithFilteredResult(_0x4ac5ca,_0x972472))['catch'](handleError(_0x4ac5ca,null));};exports[_0x74ca('0x6a')]=function(_0x2a9ed6,_0x2fb480,_0x44987c){var _0x4f5494={'raw':!![],'where':{}};var _0x50d1e2={};var _0x2e32e9={'count':0x0,'rows':[]};return db[_0x74ca('0x38')][_0x74ca('0x62')]({'where':{'id':_0x2a9ed6[_0x74ca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2fb480,null))[_0x74ca('0x26')](function(_0x19f5b5){if(_0x19f5b5){_0x50d1e2[_0x74ca('0x3b')]=_[_0x74ca('0x4e')](db[_0x74ca('0x6b')][_0x74ca('0x5c')]);_0x50d1e2['query']=_['keys'](_0x2a9ed6['query']);_0x50d1e2[_0x74ca('0x46')]=_[_0x74ca('0x3d')](_0x50d1e2[_0x74ca('0x3b')],_0x50d1e2[_0x74ca('0x3c')]);_0x4f5494[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x50d1e2[_0x74ca('0x3b')],qs[_0x74ca('0x3f')](_0x2a9ed6[_0x74ca('0x3c')]['fields']));_0x4f5494[_0x74ca('0x3e')]=_0x4f5494[_0x74ca('0x3e')][_0x74ca('0x40')]?_0x4f5494['attributes']:_0x50d1e2[_0x74ca('0x3b')];if(!_0x2a9ed6[_0x74ca('0x3c')][_0x74ca('0x41')](_0x74ca('0x42'))){_0x4f5494['limit']=qs[_0x74ca('0x21')](_0x2a9ed6[_0x74ca('0x3c')][_0x74ca('0x21')]);_0x4f5494['offset']=qs[_0x74ca('0x20')](_0x2a9ed6[_0x74ca('0x3c')][_0x74ca('0x20')]);}_0x4f5494[_0x74ca('0x43')]=qs[_0x74ca('0x44')](_0x2a9ed6['query'][_0x74ca('0x44')]);_0x4f5494['where']=qs[_0x74ca('0x46')](_['pick'](_0x2a9ed6['query'],_0x50d1e2['filters']));_0x4f5494[_0x74ca('0x45')]['VoiceQueueId']=_0x19f5b5['id'];if(_0x2a9ed6[_0x74ca('0x3c')][_0x74ca('0x2b')]){_0x4f5494[_0x74ca('0x45')]=_[_0x74ca('0x48')](_0x4f5494['where'],{'$or':_[_0x74ca('0x2d')](_0x4f5494['attributes'],function(_0x574457){var _0x223583={};_0x223583[_0x574457]={'$like':'%'+_0x2a9ed6[_0x74ca('0x3c')][_0x74ca('0x2b')]+'%'};return _0x223583;})});}_0x4f5494=_[_0x74ca('0x48')]({},_0x4f5494,_0x2a9ed6[_0x74ca('0x50')]);return db[_0x74ca('0x6b')][_0x74ca('0x4a')]({'where':_0x4f5494[_0x74ca('0x45')]})[_0x74ca('0x26')](function(_0x3ad490){_0x2e32e9[_0x74ca('0x4a')]=_0x3ad490;if(_0x2a9ed6[_0x74ca('0x3c')][_0x74ca('0x4b')]){_0x4f5494['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x74ca('0x65')](_0x4f5494);})[_0x74ca('0x26')](function(_0x209c53){_0x2e32e9['rows']=_0x209c53;return _0x2e32e9;});}})[_0x74ca('0x26')](respondWithFilteredResult(_0x2fb480,_0x4f5494))['catch'](handleError(_0x2fb480,null));};exports[_0x74ca('0x6c')]=function(_0x325043,_0x45d272,_0x17eb0c){var _0x5b3379={};var _0x30662d={};var _0x361983;var _0x42f50d;return db[_0x74ca('0x38')][_0x74ca('0x62')]({'where':{'id':_0x325043[_0x74ca('0x4d')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x45d272,null))[_0x74ca('0x26')](function(_0x786c44){if(_0x786c44){_0x361983=_0x786c44;_0x30662d[_0x74ca('0x3b')]=_[_0x74ca('0x4e')](db['Team'][_0x74ca('0x5c')]);_0x30662d[_0x74ca('0x3c')]=_[_0x74ca('0x4e')](_0x325043[_0x74ca('0x3c')]);_0x30662d['filters']=_[_0x74ca('0x3d')](_0x30662d['model'],_0x30662d['query']);_0x5b3379[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x30662d['model'],qs[_0x74ca('0x3f')](_0x325043[_0x74ca('0x3c')][_0x74ca('0x3f')]));_0x5b3379[_0x74ca('0x3e')]=_0x5b3379['attributes'][_0x74ca('0x40')]?_0x5b3379['attributes']:_0x30662d[_0x74ca('0x3b')];_0x5b3379[_0x74ca('0x43')]=qs[_0x74ca('0x44')](_0x325043['query'][_0x74ca('0x44')]);_0x5b3379[_0x74ca('0x45')]=qs['filters'](_['pick'](_0x325043[_0x74ca('0x3c')],_0x30662d['filters']));if(_0x325043['query'][_0x74ca('0x2b')]){_0x5b3379[_0x74ca('0x45')]=_['merge'](_0x5b3379[_0x74ca('0x45')],{'$or':_['map'](_0x5b3379['attributes'],function(_0x28c74a){var _0x30d888={};_0x30d888[_0x28c74a]={'$like':'%'+_0x325043[_0x74ca('0x3c')][_0x74ca('0x2b')]+'%'};return _0x30d888;})});}_0x5b3379=_['merge']({},_0x5b3379,_0x325043[_0x74ca('0x50')]);return _0x361983[_0x74ca('0x6c')](_0x5b3379);}})[_0x74ca('0x26')](function(_0xdf65d8){if(_0xdf65d8){_0x42f50d=_0xdf65d8[_0x74ca('0x40')];if(!_0x325043[_0x74ca('0x3c')][_0x74ca('0x41')](_0x74ca('0x42'))){_0x5b3379[_0x74ca('0x21')]=qs[_0x74ca('0x21')](_0x325043['query']['limit']);_0x5b3379[_0x74ca('0x20')]=qs[_0x74ca('0x20')](_0x325043[_0x74ca('0x3c')][_0x74ca('0x20')]);}return _0x361983['getTeams'](_0x5b3379);}})[_0x74ca('0x26')](function(_0x11c045){if(_0x11c045){return _0x11c045?{'count':_0x42f50d,'rows':_0x11c045}:null;}})[_0x74ca('0x26')](respondWithResult(_0x45d272,null))[_0x74ca('0x51')](handleError(_0x45d272,null));};exports['addTeams']=function(_0x562f14,_0x2455b7,_0x1a325a){var _0x1e17f3=_0x562f14['body'][_0x74ca('0x6d')];var _0x2e3340=_[_0x74ca('0x2d')](_0x1e17f3,'id');return db[_0x74ca('0x6e')][_0x74ca('0x65')]({'where':{'id':_0x2e3340},'attributes':['id'],'include':[{'model':db[_0x74ca('0x6f')],'as':_0x74ca('0x70'),'attributes':['id',_0x74ca('0x36'),_0x74ca('0x71'),'voicePause',_0x74ca('0x72')],'raw':!![]}]})['then'](function(_0x5657a9){if(_0x5657a9){var _0x4229f2=_[_0x74ca('0x73')](_0x5657a9,function(_0x207a72){var _0x2c7eaa=_0x207a72[_0x74ca('0x27')]({'plain':!![]});_0x2c7eaa[_0x74ca('0x70')]['forEach'](function(_0x4da994){_0x4da994[_0x74ca('0x74')]=_[_0x74ca('0x31')](_0x1e17f3,{'id':_0x2c7eaa['id']})[_0x74ca('0x74')];});return _0x2c7eaa[_0x74ca('0x70')];});return db['VoiceQueue'][_0x74ca('0x31')]({'where':{'id':_0x562f14['params']['id']}})[_0x74ca('0x26')](function(_0x38cd36){return db['sequelize'][_0x74ca('0x75')](function(_0x55b750){return _0x38cd36[_0x74ca('0x76')](_0x2e3340,{'transaction':_0x55b750})[_0x74ca('0x26')](function(){return BPromise['each'](_0x4229f2,function(_0x462402){return db[_0x74ca('0x77')][_0x74ca('0x78')]({'where':{'UserId':_0x462402['id'],'VoiceQueueId':_0x562f14[_0x74ca('0x4d')]['id']},'defaults':{'penalty':_0x462402[_0x74ca('0x74')]},'transaction':_0x55b750});});})[_0x74ca('0x26')](function(){return BPromise[_0x74ca('0x79')](_[_0x74ca('0x2b')](_0x4229f2,{'online':!![]}),function(_0x3d8807){return db[_0x74ca('0x7a')][_0x74ca('0x7b')]({'membername':_0x3d8807[_0x74ca('0x36')],'UserId':_0x3d8807['id'],'queue_name':_0x38cd36[_0x74ca('0x36')],'VoiceQueueId':_0x38cd36['id'],'interface':_['isNil'](_0x3d8807['interface'])?util[_0x74ca('0x7c')](_0x74ca('0x7d'),_0x3d8807[_0x74ca('0x36')]):_0x3d8807[_0x74ca('0x72')],'paused':_0x3d8807[_0x74ca('0x7e')]||![],'penalty':_0x3d8807['penalty']},{'transaction':_0x55b750});});})[_0x74ca('0x26')](function(){_0x4229f2[_0x74ca('0x7f')](function(_0x5b4070){socket['emit'](_0x74ca('0x80'),{'UserId':_0x5b4070['id'],'VoiceQueueId':_0x38cd36['id']});});});});});}})[_0x74ca('0x26')](respondWithStatusCode(_0x2455b7,null))[_0x74ca('0x51')](handleError(_0x2455b7,null));};exports[_0x74ca('0x81')]=function(_0x127709,_0x9bf172,_0x26c0b4){return db[_0x74ca('0x6e')][_0x74ca('0x65')]({'where':{'id':_0x127709[_0x74ca('0x3c')][_0x74ca('0x82')]},'attributes':['id'],'include':[{'model':db[_0x74ca('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x9bf172,null))[_0x74ca('0x26')](function(_0x4e18c0){var _0x2a70bf=_[_0x74ca('0x2d')](_0x4e18c0,'id');var _0x150c37=[];var _0x361e84=[];var _0x24f506=squel['select']();_0x24f506['field'](_0x74ca('0x83'))[_0x74ca('0x84')]('team_has_voice_queues','tq')['join'](_0x74ca('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x74ca('0x45')](_0x74ca('0x86'),_0x127709[_0x74ca('0x4d')]['id']);for(var _0x310e3b=0x0;_0x310e3b<_0x4e18c0[_0x74ca('0x40')];_0x310e3b+=0x1){let _0x534a54=_0x4e18c0[_0x310e3b];for(var _0x4c7ee6=0x0;_0x4c7ee6<_0x534a54['Agents']['length'];_0x4c7ee6+=0x1){let _0x129e6e=_0x534a54[_0x74ca('0x70')][_0x4c7ee6];var _0x25c17b=_0x24f506[_0x74ca('0x5b')]();_0x25c17b[_0x74ca('0x45')]('ut.UserId\x20=\x20?',_0x129e6e['id']);_0x361e84[_0x74ca('0x87')](db['sequelize'][_0x74ca('0x3c')](_0x25c17b[_0x74ca('0x88')](),{'type':db[_0x74ca('0x89')]['QueryTypes'][_0x74ca('0x8a')]})[_0x74ca('0x26')](function(_0x1ed49c){if(_0x1ed49c[_0x74ca('0x40')]===0x1){return _0x129e6e['id'];}else{var _0x47d91d=_[_0x74ca('0x8b')](_['map'](_0x1ed49c,_0x74ca('0x8c')),function(_0x2fe20a){return _['includes'](_0x2a70bf,_0x2fe20a);});if(_0x47d91d){return _0x129e6e['id'];}}}));}}return BPromise[_0x74ca('0x8d')](_0x361e84)[_0x74ca('0x26')](function(_0x2437ef){_0x150c37=_(_0x150c37)[_0x74ca('0x8e')](_0x2437ef)['compact']()[_0x74ca('0x2e')]();return db['VoiceQueue'][_0x74ca('0x31')]({'where':{'id':_0x127709['params']['id']}})['then'](function(_0x4da6ba){return db['sequelize'][_0x74ca('0x75')](function(_0x5120e0){return _0x4da6ba['removeTeams'](_0x127709[_0x74ca('0x3c')][_0x74ca('0x82')],{'transaction':_0x5120e0})[_0x74ca('0x26')](function(){if(!_[_0x74ca('0x8f')](_0x150c37)){return _0x4da6ba[_0x74ca('0x90')](_0x150c37,{'transaction':_0x5120e0})['then'](function(){return db[_0x74ca('0x7a')]['destroy']({'where':{'VoiceQueueId':_0x127709[_0x74ca('0x4d')]['id'],'UserId':_0x150c37},'transaction':_0x5120e0});});}})[_0x74ca('0x26')](function(){_0x150c37['forEach'](function(_0x551e4a){socket[_0x74ca('0x91')]('userVoiceQueue:remove',{'UserId':_0x551e4a,'VoiceQueueId':_0x4da6ba['id']});});});});});});})[_0x74ca('0x26')](respondWithStatusCode(_0x9bf172,null))[_0x74ca('0x51')](handleError(_0x9bf172,null));};exports['addAgents']=function(_0x457ec1,_0x47f34f,_0x3f88a6){var _0x316134,_0xc6da46;return db[_0x74ca('0x38')][_0x74ca('0x31')]({'where':{'id':_0x457ec1[_0x74ca('0x4d')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x47f34f,null))[_0x74ca('0x26')](function(_0x5810f2){if(_0x5810f2){_0xc6da46=_0x5810f2;return _0x5810f2[_0x74ca('0x92')](_0x457ec1[_0x74ca('0x53')][_0x74ca('0x82')],_[_0x74ca('0x5d')](_0x457ec1[_0x74ca('0x53')],[_0x74ca('0x82'),'id'])||{})[_0x74ca('0x93')](function(_0x5f001c){for(var _0x17015b=0x0;_0x17015b<_0x457ec1[_0x74ca('0x53')]['ids'][_0x74ca('0x40')];_0x17015b+=0x1){socket[_0x74ca('0x91')](_0x74ca('0x80'),{'UserId':_0x457ec1['body'][_0x74ca('0x82')][_0x17015b],'VoiceQueueId':_0x457ec1['params']['id']});}return _0x5f001c;});}})[_0x74ca('0x26')](function(_0x5c03c8){_0x316134=_0x5c03c8||[];if(_0xc6da46){return db[_0x74ca('0x6f')][_0x74ca('0x65')]({'where':{'id':_0x457ec1[_0x74ca('0x53')][_0x74ca('0x82')]},'attributes':['id',_0x74ca('0x36'),_0x74ca('0x71'),_0x74ca('0x7e'),_0x74ca('0x72')],'raw':!![]});}})['then'](function(_0x5714d0){if(!_[_0x74ca('0x8f')](_0x5714d0)){var _0x37f5f4=[];for(var _0x998993=0x0;_0x998993<_0x5714d0['length'];_0x998993++){if(_0x5714d0[_0x998993][_0x74ca('0x71')]){_0x37f5f4[_0x74ca('0x87')](db['UserVoiceQueueRt']['upsert']({'membername':_0x5714d0[_0x998993][_0x74ca('0x36')],'UserId':_0x5714d0[_0x998993]['id'],'queue_name':_0xc6da46[_0x74ca('0x36')],'VoiceQueueId':_0xc6da46['id'],'interface':_[_0x74ca('0x94')](_0x5714d0[_0x998993][_0x74ca('0x72')])?util[_0x74ca('0x7c')]('SIP/%s',_0x5714d0[_0x998993]['name']):_0x5714d0[_0x998993][_0x74ca('0x72')],'paused':_0x5714d0[_0x998993][_0x74ca('0x7e')]||![],'penalty':_0x457ec1[_0x74ca('0x53')][_0x74ca('0x74')]||0x0}));}}return BPromise[_0x74ca('0x8d')](_0x37f5f4);}})[_0x74ca('0x26')](function(){return _0x316134;})[_0x74ca('0x26')](respondWithResult(_0x47f34f,null))[_0x74ca('0x51')](handleError(_0x47f34f,null));};exports['removeAgents']=function(_0x180c35,_0x5d75c3,_0x1295db){return db[_0x74ca('0x38')][_0x74ca('0x31')]({'where':{'id':_0x180c35[_0x74ca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d75c3,null))['then'](function(_0x3a91b9){if(_0x3a91b9){return _0x3a91b9[_0x74ca('0x90')](_0x180c35[_0x74ca('0x3c')][_0x74ca('0x82')])['then'](function(){if(_[_0x74ca('0x95')](_0x180c35[_0x74ca('0x3c')][_0x74ca('0x82')])){for(var _0x5ba351=0x0;_0x5ba351<_0x180c35[_0x74ca('0x3c')][_0x74ca('0x82')]['length'];_0x5ba351+=0x1){socket[_0x74ca('0x91')]('userVoiceQueue:remove',{'UserId':Number(_0x180c35[_0x74ca('0x3c')][_0x74ca('0x82')][_0x5ba351]),'VoiceQueueId':Number(_0x180c35[_0x74ca('0x4d')]['id'])});}}else{socket[_0x74ca('0x91')](_0x74ca('0x96'),{'UserId':Number(_0x180c35[_0x74ca('0x3c')][_0x74ca('0x82')]),'VoiceQueueId':Number(_0x180c35[_0x74ca('0x4d')]['id'])});}});}})[_0x74ca('0x26')](function(_0x229f06){return db[_0x74ca('0x7a')][_0x74ca('0x33')]({'where':{'VoiceQueueId':_0x180c35[_0x74ca('0x4d')]['id'],'UserId':_0x180c35['query'][_0x74ca('0x82')]}})[_0x74ca('0x26')](function(){return _0x229f06;});})['then'](respondWithStatusCode(_0x5d75c3,null))['catch'](handleError(_0x5d75c3,null));};exports[_0x74ca('0x97')]=function(_0xa144a6,_0x59b165,_0x4fdc80){var _0x5ca1c1={};var _0x388e80={};var _0x1b83e7;var _0x2ab828;return db[_0x74ca('0x38')][_0x74ca('0x62')]({'where':{'id':_0xa144a6[_0x74ca('0x4d')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x59b165,null))[_0x74ca('0x26')](function(_0x51e2c2){if(_0x51e2c2){_0x1b83e7=_0x51e2c2;_0x388e80[_0x74ca('0x3b')]=_['keys'](db[_0x74ca('0x6f')][_0x74ca('0x5c')]);_0x388e80[_0x74ca('0x3c')]=_['keys'](_0xa144a6[_0x74ca('0x3c')]);_0x388e80[_0x74ca('0x46')]=_['intersection'](_0x388e80[_0x74ca('0x3b')],_0x388e80['query']);_0x5ca1c1[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x388e80[_0x74ca('0x3b')],qs['fields'](_0xa144a6['query'][_0x74ca('0x3f')]));_0x5ca1c1[_0x74ca('0x3e')]=_0x5ca1c1[_0x74ca('0x3e')][_0x74ca('0x40')]?_0x5ca1c1[_0x74ca('0x3e')]:_0x388e80['model'];_0x5ca1c1[_0x74ca('0x43')]=qs[_0x74ca('0x44')](_0xa144a6[_0x74ca('0x3c')][_0x74ca('0x44')]);_0x5ca1c1['where']=qs[_0x74ca('0x46')](_[_0x74ca('0x47')](_0xa144a6[_0x74ca('0x3c')],_0x388e80[_0x74ca('0x46')]));if(_0xa144a6[_0x74ca('0x3c')][_0x74ca('0x2b')]){_0x5ca1c1[_0x74ca('0x45')]=_[_0x74ca('0x48')](_0x5ca1c1[_0x74ca('0x45')],{'$or':_[_0x74ca('0x2d')](_0x5ca1c1[_0x74ca('0x3e')],function(_0x5463ad){var _0x16c213={};_0x16c213[_0x5463ad]={'$like':'%'+_0xa144a6[_0x74ca('0x3c')][_0x74ca('0x2b')]+'%'};return _0x16c213;})});}_0x5ca1c1=_['merge']({},_0x5ca1c1,_0xa144a6[_0x74ca('0x50')]);return _0x1b83e7[_0x74ca('0x97')](_0x5ca1c1);}})[_0x74ca('0x26')](function(_0x579fcd){if(_0x579fcd){_0x2ab828=_0x579fcd['length'];if(!_0xa144a6[_0x74ca('0x3c')][_0x74ca('0x41')](_0x74ca('0x42'))){_0x5ca1c1[_0x74ca('0x21')]=qs[_0x74ca('0x21')](_0xa144a6[_0x74ca('0x3c')]['limit']);_0x5ca1c1[_0x74ca('0x20')]=qs['offset'](_0xa144a6[_0x74ca('0x3c')]['offset']);}return _0x1b83e7[_0x74ca('0x97')](_0x5ca1c1);}})[_0x74ca('0x26')](function(_0x1ebc02){if(_0x1ebc02){return _0x1ebc02?{'count':_0x2ab828,'rows':_0x1ebc02}:null;}})[_0x74ca('0x26')](respondWithResult(_0x59b165,null))['catch'](handleError(_0x59b165,null));};exports[_0x74ca('0x98')]=function(_0x59d502,_0x1022c4,_0x52c4f2){var _0x4381e0={};var _0x3082e4={};var _0x4f95a7;var _0x416209;return db[_0x74ca('0x38')][_0x74ca('0x62')]({'where':{'id':_0x59d502['params']['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x1022c4,null))[_0x74ca('0x26')](function(_0x56fd07){if(_0x56fd07){_0x4f95a7=_0x56fd07;_0x3082e4[_0x74ca('0x3b')]=_['keys'](db[_0x74ca('0x7a')][_0x74ca('0x5c')]);_0x3082e4[_0x74ca('0x3c')]=_[_0x74ca('0x4e')](_0x59d502[_0x74ca('0x3c')]);_0x3082e4[_0x74ca('0x46')]=_[_0x74ca('0x3d')](_0x3082e4[_0x74ca('0x3b')],_0x3082e4[_0x74ca('0x3c')]);_0x4381e0[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x3082e4[_0x74ca('0x3b')],qs[_0x74ca('0x3f')](_0x59d502['query'][_0x74ca('0x3f')]));_0x4381e0['attributes']=_0x4381e0[_0x74ca('0x3e')][_0x74ca('0x40')]?_0x4381e0['attributes']:_0x3082e4[_0x74ca('0x3b')];_0x4381e0[_0x74ca('0x43')]=qs['sort'](_0x59d502[_0x74ca('0x3c')][_0x74ca('0x44')]);_0x4381e0[_0x74ca('0x45')]=qs[_0x74ca('0x46')](_[_0x74ca('0x47')](_0x59d502[_0x74ca('0x3c')],_0x3082e4[_0x74ca('0x46')]));if(_0x59d502[_0x74ca('0x3c')][_0x74ca('0x2b')]){_0x4381e0[_0x74ca('0x45')]=_['merge'](_0x4381e0[_0x74ca('0x45')],{'$or':_[_0x74ca('0x2d')](_0x4381e0[_0x74ca('0x3e')],function(_0x1e7da7){var _0x3bcb65={};_0x3bcb65[_0x1e7da7]={'$like':'%'+_0x59d502[_0x74ca('0x3c')][_0x74ca('0x2b')]+'%'};return _0x3bcb65;})});}_0x4381e0=_[_0x74ca('0x48')]({},_0x4381e0,_0x59d502[_0x74ca('0x50')]);return _0x4f95a7[_0x74ca('0x98')](_0x4381e0);}})['then'](function(_0x5ea783){if(_0x5ea783){_0x416209=_0x5ea783[_0x74ca('0x40')];if(!_0x59d502[_0x74ca('0x3c')]['hasOwnProperty'](_0x74ca('0x42'))){_0x4381e0[_0x74ca('0x21')]=qs[_0x74ca('0x21')](_0x59d502[_0x74ca('0x3c')][_0x74ca('0x21')]);_0x4381e0[_0x74ca('0x20')]=qs['offset'](_0x59d502['query'][_0x74ca('0x20')]);}return _0x4f95a7['getMembers'](_0x4381e0);}})[_0x74ca('0x26')](function(_0xfac059){return _0xfac059?{'count':_0x416209,'rows':_0xfac059}:null;})['then'](respondWithResult(_0x1022c4,null))['catch'](handleError(_0x1022c4,null));};exports[_0x74ca('0x99')]=function(_0x281c55,_0xaad329,_0x45208e){var _0x23831c={};var _0x1115bc={};var _0x1c6dff;var _0x50c9fb;return db[_0x74ca('0x38')]['findOne']({'where':{'id':_0x281c55[_0x74ca('0x4d')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0xaad329,null))['then'](function(_0x4b575f){if(_0x4b575f){_0x1c6dff=_0x4b575f;_0x1115bc[_0x74ca('0x3b')]=_[_0x74ca('0x4e')](db['CmList'][_0x74ca('0x5c')]);_0x1115bc[_0x74ca('0x3c')]=_[_0x74ca('0x4e')](_0x281c55[_0x74ca('0x3c')]);_0x1115bc['filters']=_['intersection'](_0x1115bc[_0x74ca('0x3b')],_0x1115bc[_0x74ca('0x3c')]);_0x23831c[_0x74ca('0x3e')]=_['intersection'](_0x1115bc['model'],qs[_0x74ca('0x3f')](_0x281c55['query']['fields']));_0x23831c['attributes']=_0x23831c['attributes'][_0x74ca('0x40')]?_0x23831c[_0x74ca('0x3e')]:_0x1115bc[_0x74ca('0x3b')];_0x23831c['order']=qs[_0x74ca('0x44')](_0x281c55['query'][_0x74ca('0x44')]);_0x23831c['where']=qs['filters'](_[_0x74ca('0x47')](_0x281c55['query'],_0x1115bc['filters']));if(_0x281c55[_0x74ca('0x3c')][_0x74ca('0x2b')]){_0x23831c[_0x74ca('0x45')]=_['merge'](_0x23831c[_0x74ca('0x45')],{'$or':_[_0x74ca('0x2d')](_0x23831c[_0x74ca('0x3e')],function(_0xc50aab){var _0xf78252={};_0xf78252[_0xc50aab]={'$like':'%'+_0x281c55[_0x74ca('0x3c')][_0x74ca('0x2b')]+'%'};return _0xf78252;})});}_0x23831c=_['merge']({},_0x23831c,_0x281c55[_0x74ca('0x50')]);return _0x1c6dff[_0x74ca('0x99')](_0x23831c);}})[_0x74ca('0x26')](function(_0x34e866){if(_0x34e866){_0x50c9fb=_0x34e866[_0x74ca('0x40')];if(!_0x281c55['query'][_0x74ca('0x41')](_0x74ca('0x42'))){_0x23831c['limit']=qs['limit'](_0x281c55[_0x74ca('0x3c')][_0x74ca('0x21')]);_0x23831c[_0x74ca('0x20')]=qs['offset'](_0x281c55[_0x74ca('0x3c')][_0x74ca('0x20')]);}return _0x1c6dff['getLists'](_0x23831c);}})[_0x74ca('0x26')](function(_0x232333){if(_0x232333){return _0x232333?{'count':_0x50c9fb,'rows':_0x232333}:null;}})[_0x74ca('0x26')](respondWithResult(_0xaad329,null))['catch'](handleError(_0xaad329,null));};exports[_0x74ca('0x9a')]=function(_0x561b17,_0x519a73,_0x4e5191){var _0x2c8674,_0x388df5;return db['VoiceQueue'][_0x74ca('0x31')]({'where':{'id':_0x561b17[_0x74ca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x519a73,null))[_0x74ca('0x26')](function(_0x53db27){if(_0x53db27){_0x388df5=_0x53db27;return _0x53db27['addLists'](_0x561b17[_0x74ca('0x53')][_0x74ca('0x82')],_['omit'](_0x561b17[_0x74ca('0x53')],['ids','id'])||{});}return null;})[_0x74ca('0x93')](function(_0x2ff192){var _0x1aa334;_0x2c8674=_0x2ff192||[];var _0x32231a=[];if(_0x2ff192){for(var _0x2e005b=0x0;_0x2e005b<_0x2ff192['length'];_0x2e005b+=0x1){var _0x59b63f=_0x2ff192[_0x2e005b][_0x74ca('0x27')]({'plain':!![]});_0x388df5[_0x74ca('0x9b')]=_0x561b17[_0x74ca('0x53')][_0x74ca('0x9b')]?_0x561b17['body']['dialCheckDuplicateType']:_0x388df5['dialCheckDuplicateType'];switch(_0x388df5[_0x74ca('0x9b')]){case _0x74ca('0x9c'):_0x1aa334=squel[_0x74ca('0x9d')]()[_0x74ca('0x9e')](_0x74ca('0x9f'))[_0x74ca('0xa0')](['phone',_0x74ca('0xa1'),_0x74ca('0xa2'),_0x74ca('0xa3'),_0x74ca('0x64'),_0x74ca('0x5e'),_0x74ca('0x5f')],squel[_0x74ca('0xa4')]()[_0x74ca('0xa5')](_0x74ca('0xa6'),_0x74ca('0xa6'))[_0x74ca('0xa5')]('NOW()',_0x74ca('0xa1'))['field']('id',_0x74ca('0xa2'))[_0x74ca('0xa5')](_0x59b63f[_0x74ca('0xa7')][_0x74ca('0x88')](),_0x74ca('0xa3'))['field'](_0x561b17['params']['id'][_0x74ca('0x88')](),_0x74ca('0x64'))[_0x74ca('0xa5')](_0x74ca('0xa8'),_0x74ca('0x5e'))['field'](_0x74ca('0xa8'),_0x74ca('0x5f'))[_0x74ca('0x84')](_0x74ca('0xa9'))[_0x74ca('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x74ca('0xaa'),_0x59b63f[_0x74ca('0xa7')][_0x74ca('0x88')]())[_0x74ca('0x45')](_0x74ca('0xab'))[_0x74ca('0x45')](_0x74ca('0xac'),squel['select']()[_0x74ca('0xa5')](_0x74ca('0xad'))[_0x74ca('0x84')]('cm_hopper_final')[_0x74ca('0x45')](_0x74ca('0x86'),_0x561b17[_0x74ca('0x4d')]['id'][_0x74ca('0x88')]()))[_0x74ca('0x45')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x74ca('0xa5')](_0x74ca('0xae'))[_0x74ca('0x84')]('cm_hopper')[_0x74ca('0x45')](_0x74ca('0x86'),_0x561b17[_0x74ca('0x4d')]['id'][_0x74ca('0x88')]())))[_0x74ca('0x88')]();break;case _0x74ca('0xaf'):_0x1aa334=squel[_0x74ca('0x9d')]()[_0x74ca('0x9e')](_0x74ca('0x9f'))['fromQuery'](['phone','scheduledAt',_0x74ca('0xa2'),_0x74ca('0xa3'),_0x74ca('0x64'),_0x74ca('0x5e'),'updatedAt'],squel['select']()[_0x74ca('0xa5')](_0x74ca('0xa6'),_0x74ca('0xa6'))[_0x74ca('0xa5')](_0x74ca('0xa8'),_0x74ca('0xa1'))[_0x74ca('0xa5')]('id',_0x74ca('0xa2'))[_0x74ca('0xa5')](_0x59b63f[_0x74ca('0xa7')]['toString'](),_0x74ca('0xa3'))[_0x74ca('0xa5')](_0x561b17[_0x74ca('0x4d')]['id'][_0x74ca('0x88')](),_0x74ca('0x64'))[_0x74ca('0xa5')](_0x74ca('0xa8'),_0x74ca('0x5e'))[_0x74ca('0xa5')](_0x74ca('0xa8'),'updatedAt')[_0x74ca('0x84')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x74ca('0xaa'),_0x59b63f['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x74ca('0x45')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x74ca('0xa5')](_0x74ca('0xae'))[_0x74ca('0x84')](_0x74ca('0x9f'))[_0x74ca('0x45')](_0x74ca('0x86'),_0x561b17[_0x74ca('0x4d')]['id'][_0x74ca('0x88')]())))[_0x74ca('0x88')]();break;default:_0x1aa334=squel[_0x74ca('0x9d')]()[_0x74ca('0x9e')](_0x74ca('0x9f'))[_0x74ca('0xa0')](['phone',_0x74ca('0xa1'),_0x74ca('0xa2'),_0x74ca('0xa3'),_0x74ca('0x64'),'createdAt',_0x74ca('0x5f')],squel['select']()['field']('phone',_0x74ca('0xa6'))[_0x74ca('0xa5')](_0x74ca('0xa8'),_0x74ca('0xa1'))[_0x74ca('0xa5')]('id',_0x74ca('0xa2'))[_0x74ca('0xa5')](_0x59b63f['CmListId'][_0x74ca('0x88')](),'ListId')[_0x74ca('0xa5')](_0x561b17[_0x74ca('0x4d')]['id'][_0x74ca('0x88')](),_0x74ca('0x64'))[_0x74ca('0xa5')](_0x74ca('0xa8'),'createdAt')[_0x74ca('0xa5')]('NOW()',_0x74ca('0x5f'))[_0x74ca('0x84')](_0x74ca('0xa9'))[_0x74ca('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x74ca('0xaa'),_0x59b63f['CmListId']['toString']())[_0x74ca('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0x74ca('0x88')]();}_0x32231a['push'](db['sequelize'][_0x74ca('0x3c')](_0x1aa334));}return BPromise[_0x74ca('0x8d')](_0x32231a);}})[_0x74ca('0x26')](function(){return _0x2c8674;})[_0x74ca('0x26')](respondWithResult(_0x519a73,null))[_0x74ca('0x51')](handleError(_0x519a73,null));};exports[_0x74ca('0xb0')]=function(_0xf391bb,_0x334443,_0x3b9a2e){return db['VoiceQueue']['find']({'where':{'id':_0xf391bb[_0x74ca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x334443,null))[_0x74ca('0x26')](function(_0x11682d){if(_0x11682d){return _0x11682d[_0x74ca('0xb0')](_0xf391bb[_0x74ca('0x3c')]['ids']);}})[_0x74ca('0x26')](function(_0x4890c2){if(_0x4890c2){return db[_0x74ca('0x63')][_0x74ca('0x33')]({'where':{'ListId':_0xf391bb[_0x74ca('0x3c')][_0x74ca('0x82')],'VoiceQueueId':_0xf391bb[_0x74ca('0x4d')]['id']}})[_0x74ca('0x26')](function(){return _0x4890c2;});}})[_0x74ca('0x26')](respondWithStatusCode(_0x334443,null))[_0x74ca('0x51')](handleError(_0x334443,null));};exports[_0x74ca('0xb1')]=function(_0x2fc465,_0x5ccd1e,_0x11e5fa){var _0x227d68={};var _0x15d126={};var _0x458b8e;var _0x4606c0;return db[_0x74ca('0x38')][_0x74ca('0x62')]({'where':{'id':_0x2fc465[_0x74ca('0x4d')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x5ccd1e,null))['then'](function(_0x154631){if(_0x154631){_0x458b8e=_0x154631;_0x15d126[_0x74ca('0x3b')]=_[_0x74ca('0x4e')](db['CmList'][_0x74ca('0x5c')]);_0x15d126[_0x74ca('0x3c')]=_[_0x74ca('0x4e')](_0x2fc465[_0x74ca('0x3c')]);_0x15d126[_0x74ca('0x46')]=_[_0x74ca('0x3d')](_0x15d126[_0x74ca('0x3b')],_0x15d126[_0x74ca('0x3c')]);_0x227d68[_0x74ca('0x3e')]=_[_0x74ca('0x3d')](_0x15d126['model'],qs[_0x74ca('0x3f')](_0x2fc465[_0x74ca('0x3c')][_0x74ca('0x3f')]));_0x227d68[_0x74ca('0x3e')]=_0x227d68[_0x74ca('0x3e')][_0x74ca('0x40')]?_0x227d68['attributes']:_0x15d126[_0x74ca('0x3b')];_0x227d68[_0x74ca('0x43')]=qs[_0x74ca('0x44')](_0x2fc465[_0x74ca('0x3c')]['sort']);_0x227d68[_0x74ca('0x45')]=qs[_0x74ca('0x46')](_[_0x74ca('0x47')](_0x2fc465['query'],_0x15d126[_0x74ca('0x46')]));if(_0x2fc465[_0x74ca('0x3c')][_0x74ca('0x2b')]){_0x227d68[_0x74ca('0x45')]=_['merge'](_0x227d68['where'],{'$or':_[_0x74ca('0x2d')](_0x227d68['attributes'],function(_0x1a33d5){var _0x5a51bf={};_0x5a51bf[_0x1a33d5]={'$like':'%'+_0x2fc465[_0x74ca('0x3c')][_0x74ca('0x2b')]+'%'};return _0x5a51bf;})});}_0x227d68=_[_0x74ca('0x48')]({},_0x227d68,_0x2fc465[_0x74ca('0x50')]);return _0x458b8e[_0x74ca('0xb1')](_0x227d68);}})[_0x74ca('0x26')](function(_0x57fbad){if(_0x57fbad){_0x4606c0=_0x57fbad[_0x74ca('0x40')];if(!_0x2fc465[_0x74ca('0x3c')]['hasOwnProperty'](_0x74ca('0x42'))){_0x227d68[_0x74ca('0x21')]=qs[_0x74ca('0x21')](_0x2fc465[_0x74ca('0x3c')]['limit']);_0x227d68[_0x74ca('0x20')]=qs[_0x74ca('0x20')](_0x2fc465[_0x74ca('0x3c')][_0x74ca('0x20')]);}return _0x458b8e['getBlackLists'](_0x227d68);}})[_0x74ca('0x26')](function(_0x118672){if(_0x118672){return _0x118672?{'count':_0x4606c0,'rows':_0x118672}:null;}})[_0x74ca('0x26')](respondWithResult(_0x5ccd1e,null))[_0x74ca('0x51')](handleError(_0x5ccd1e,null));};exports[_0x74ca('0xb2')]=function(_0x1861a9,_0x237720,_0x40848a){var _0x23c1ee,_0x540fcc;return db[_0x74ca('0x38')][_0x74ca('0x31')]({'where':{'id':_0x1861a9[_0x74ca('0x4d')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x237720,null))[_0x74ca('0x26')](function(_0x4e8ceb){if(_0x4e8ceb){_0x540fcc=_0x4e8ceb;return _0x4e8ceb['addBlackLists'](_0x1861a9[_0x74ca('0x53')]['ids'],_[_0x74ca('0x5d')](_0x1861a9['body'],[_0x74ca('0x82'),'id'])||{});}return null;})[_0x74ca('0x93')](function(_0x367c94){var _0xc81bcc;_0x23c1ee=_0x367c94||[];var _0x49218c=[];if(_0x367c94){for(var _0x43a6f0=0x0;_0x43a6f0<_0x367c94['length'];_0x43a6f0+=0x1){var _0x57f5f9=_0x367c94[_0x43a6f0][_0x74ca('0x27')]({'plain':!![]});_0xc81bcc=squel[_0x74ca('0x9d')]()[_0x74ca('0x9e')]('cm_hopper_black')[_0x74ca('0xa0')]([_0x74ca('0xa6'),'ContactId',_0x74ca('0xa3'),_0x74ca('0x64'),'createdAt',_0x74ca('0x5f')],squel[_0x74ca('0xa4')]()[_0x74ca('0xa5')](_0x74ca('0xa6'),'phone')[_0x74ca('0xa5')]('id',_0x74ca('0xa2'))['field'](_0x57f5f9[_0x74ca('0xa7')][_0x74ca('0x88')](),_0x74ca('0xa3'))['field'](_0x1861a9[_0x74ca('0x4d')]['id'][_0x74ca('0x88')](),_0x74ca('0x64'))['field'](_0x74ca('0xa8'),_0x74ca('0x5e'))[_0x74ca('0xa5')](_0x74ca('0xa8'),_0x74ca('0x5f'))[_0x74ca('0x84')](_0x74ca('0xa9'))[_0x74ca('0x45')](_0x74ca('0xb3'))[_0x74ca('0x45')](_0x74ca('0xaa'),_0x57f5f9['CmListId'][_0x74ca('0x88')]())[_0x74ca('0x45')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x49218c[_0x74ca('0x87')](db[_0x74ca('0x89')][_0x74ca('0x3c')](_0xc81bcc));}return BPromise['all'](_0x49218c);}})[_0x74ca('0x26')](function(){return _0x23c1ee;})[_0x74ca('0x26')](respondWithResult(_0x237720,null))[_0x74ca('0x51')](handleError(_0x237720,null));};exports[_0x74ca('0xb4')]=function(_0x536bff,_0x1fc42b,_0x2eb813){return db['VoiceQueue']['find']({'where':{'id':_0x536bff['params']['id']}})['then'](handleEntityNotFound(_0x1fc42b,null))[_0x74ca('0x26')](function(_0x949dd7){if(_0x949dd7){return _0x949dd7[_0x74ca('0xb4')](_0x536bff[_0x74ca('0x3c')][_0x74ca('0x82')]);}})[_0x74ca('0x26')](function(_0x434ae7){if(_0x434ae7){return db[_0x74ca('0x6b')]['destroy']({'where':{'ListId':_0x536bff[_0x74ca('0x3c')]['ids'],'VoiceQueueId':_0x536bff['params']['id']}})['then'](function(){return _0x434ae7;});}})[_0x74ca('0x26')](respondWithStatusCode(_0x1fc42b,null))[_0x74ca('0x51')](handleError(_0x1fc42b,null));}; \ No newline at end of file +var _0x1a5c=['hasOwnProperty','order','sort','pick','filters','where','merge','VoiceQueue','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','outbound','UserProfileSection','userProfileId','autoAssociation','omit','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','nolimit','CmHopperFinal','CmHopperBlack','getTeams','teams','Team','User','Agents','voicePause','interface','forEach','penalty','sequelize','transaction','addTeams','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','online','push','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','createdAt','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','CmListId','insert','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','filter','ignore','map','value','name','UserProfileResource','end','error','stack','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes'];(function(_0x4d24ea,_0x3f5526){var _0x268e16=function(_0x54bb82){while(--_0x54bb82){_0x4d24ea['push'](_0x4d24ea['shift']());}};_0x268e16(++_0x3f5526);}(_0x1a5c,0x12c));var _0xc1a5=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x1a5c[_0x4d8ed9];return _0x1e2140;};'use strict';var pdf=require(_0xc1a5('0x0'));var emlformat=require(_0xc1a5('0x1'));var rimraf=require(_0xc1a5('0x2'));var zipdir=require(_0xc1a5('0x3'));var jsonpatch=require(_0xc1a5('0x4'));var rp=require(_0xc1a5('0x5'));var moment=require(_0xc1a5('0x6'));var BPromise=require(_0xc1a5('0x7'));var Mustache=require(_0xc1a5('0x8'));var util=require(_0xc1a5('0x9'));var path=require('path');var sox=require(_0xc1a5('0xa'));var csv=require(_0xc1a5('0xb'));var ejs=require(_0xc1a5('0xc'));var fs=require('fs');var _=require(_0xc1a5('0xd'));var squel=require(_0xc1a5('0xe'));var crypto=require(_0xc1a5('0xf'));var jsforce=require(_0xc1a5('0x10'));var deskjs=require(_0xc1a5('0x11'));var toCsv=require('to-csv');var querystring=require(_0xc1a5('0x12'));var Papa=require(_0xc1a5('0x13'));var Redis=require('ioredis');var authService=require(_0xc1a5('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1a5('0x15'));var logger=require(_0xc1a5('0x16'))('api');var utils=require(_0xc1a5('0x17'));var config=require(_0xc1a5('0x18'));var db=require(_0xc1a5('0x19'))['db'];config[_0xc1a5('0x1a')]=_[_0xc1a5('0x1b')](config['redis'],{'host':_0xc1a5('0x1c'),'port':0x18eb});var socket=require(_0xc1a5('0x1d'))(new Redis(config[_0xc1a5('0x1a')]));require(_0xc1a5('0x1e'))[_0xc1a5('0x1f')](socket);function respondWithStatusCode(_0x1dabb5,_0x24e513){_0x24e513=_0x24e513||0xcc;return function(_0x45c431){if(_0x45c431){return _0x1dabb5[_0xc1a5('0x20')](_0x24e513);}return _0x1dabb5['status'](_0x24e513)['end']();};}function respondWithResult(_0x1b2cfb,_0xfdb88e){_0xfdb88e=_0xfdb88e||0xc8;return function(_0x677442){if(_0x677442){return _0x1b2cfb['status'](_0xfdb88e)[_0xc1a5('0x21')](_0x677442);}};}function respondWithFilteredResult(_0x25db42,_0x21faf9){return function(_0x5bf0bc){if(_0x5bf0bc){var _0x82766f=_0x5bf0bc[_0xc1a5('0x22')],_0x4927df=_0x21faf9[_0xc1a5('0x23')],_0x294e92=_0x21faf9[_0xc1a5('0x23')]+_0x21faf9[_0xc1a5('0x24')],_0x318f71;if(_0x294e92>=_0x82766f){_0x294e92=_0x82766f;_0x318f71=0xc8;}else{_0x318f71=0xce;}_0x25db42[_0xc1a5('0x25')](_0x318f71);return _0x25db42[_0xc1a5('0x26')](_0xc1a5('0x27'),_0x4927df+'-'+_0x294e92+'/'+_0x82766f)[_0xc1a5('0x21')](_0x5bf0bc);}return null;};}function patchUpdates(_0x45a3f5){return function(_0x267ee0){try{jsonpatch[_0xc1a5('0x28')](_0x267ee0,_0x45a3f5,!![]);}catch(_0x3548c5){return BPromise['reject'](_0x3548c5);}return _0x267ee0[_0xc1a5('0x29')]();};}function saveUpdates(_0x12002d,_0x4b424c){return function(_0x5a3228){if(_0x5a3228){return _0x5a3228[_0xc1a5('0x2a')](_0x12002d)[_0xc1a5('0x2b')](function(_0x2a8ee8){return _0x2a8ee8;});}return null;};}function removeEntity(_0x232666,_0x2e2351){return function(_0x22e02e){if(_0x22e02e){return _0x22e02e[_0xc1a5('0x2c')]()['then'](function(){var _0x5ab00b=_0x22e02e[_0xc1a5('0x2d')]({'plain':!![]});var _0x259c22=[{'name':_0xc1a5('0x2e'),'value':'inbound','ignore':![]},{'name':_0xc1a5('0x2f'),'value':'outbound','ignore':![]}];var _0x5aba6b=_(_0x259c22)[_0xc1a5('0x30')](_0xc1a5('0x31'))[_0xc1a5('0x32')](_0xc1a5('0x33'))['value']();if(_['includes'](_0x5aba6b,_0x5ab00b['type'])){return;}var _0x1fa511=_['find'](_0x259c22,[_0xc1a5('0x33'),_0x5ab00b['type']])[_0xc1a5('0x34')];return db[_0xc1a5('0x35')][_0xc1a5('0x2c')]({'where':{'type':_0x1fa511,'resourceId':_0x5ab00b['id']}})[_0xc1a5('0x2b')](function(){return _0x22e02e;});})['then'](function(){_0x232666['status'](0xcc)[_0xc1a5('0x36')]();});}};}function handleEntityNotFound(_0x5e50a7,_0x167fcb){return function(_0xdca8bd){if(!_0xdca8bd){_0x5e50a7[_0xc1a5('0x20')](0x194);}return _0xdca8bd;};}function handleError(_0x2b3792,_0x4be68b){_0x4be68b=_0x4be68b||0x1f4;return function(_0x4dbf2f){logger[_0xc1a5('0x37')](_0x4dbf2f[_0xc1a5('0x38')]);if(_0x4dbf2f[_0xc1a5('0x34')]){delete _0x4dbf2f[_0xc1a5('0x34')];}_0x2b3792[_0xc1a5('0x25')](_0x4be68b)[_0xc1a5('0x39')](_0x4dbf2f);};}exports[_0xc1a5('0x3a')]=function(_0x211036,_0x20c87a){var _0x3d7feb={},_0x3d5b17={},_0x42cfb2={'count':0x0,'rows':[]};var _0xee9256=_[_0xc1a5('0x32')](db['VoiceQueue'][_0xc1a5('0x3b')],function(_0x187803){return{'name':_0x187803[_0xc1a5('0x3c')],'type':_0x187803[_0xc1a5('0x3d')][_0xc1a5('0x3e')]};});_0x3d5b17[_0xc1a5('0x3f')]=_['map'](_0xee9256,_0xc1a5('0x34'));_0x3d5b17[_0xc1a5('0x40')]=_[_0xc1a5('0x41')](_0x211036[_0xc1a5('0x40')]);_0x3d5b17['filters']=_[_0xc1a5('0x42')](_0x3d5b17[_0xc1a5('0x3f')],_0x3d5b17[_0xc1a5('0x40')]);_0x3d7feb['attributes']=_['intersection'](_0x3d5b17[_0xc1a5('0x3f')],qs[_0xc1a5('0x43')](_0x211036['query'][_0xc1a5('0x43')]));_0x3d7feb['attributes']=_0x3d7feb['attributes'][_0xc1a5('0x44')]?_0x3d7feb[_0xc1a5('0x45')]:_0x3d5b17[_0xc1a5('0x3f')];if(!_0x211036[_0xc1a5('0x40')][_0xc1a5('0x46')]('nolimit')){_0x3d7feb[_0xc1a5('0x24')]=qs[_0xc1a5('0x24')](_0x211036[_0xc1a5('0x40')][_0xc1a5('0x24')]);_0x3d7feb['offset']=qs[_0xc1a5('0x23')](_0x211036[_0xc1a5('0x40')][_0xc1a5('0x23')]);}_0x3d7feb[_0xc1a5('0x47')]=qs[_0xc1a5('0x48')](_0x211036[_0xc1a5('0x40')][_0xc1a5('0x48')]);_0x3d7feb['where']=qs['filters'](_[_0xc1a5('0x49')](_0x211036[_0xc1a5('0x40')],_0x3d5b17[_0xc1a5('0x4a')]));if(_0x211036[_0xc1a5('0x40')][_0xc1a5('0x30')]){_0x3d7feb[_0xc1a5('0x4b')]=_[_0xc1a5('0x4c')](_0x3d7feb[_0xc1a5('0x4b')],{'$or':_['map'](_0xee9256,function(_0x5bb9e5){if(_0x5bb9e5['type']!=='VIRTUAL'){var _0x2aaf8f={};_0x2aaf8f[_0x5bb9e5[_0xc1a5('0x34')]]={'$like':'%'+_0x211036[_0xc1a5('0x40')]['filter']+'%'};return _0x2aaf8f;}})});}_0x3d7feb=_[_0xc1a5('0x4c')]({},_0x3d7feb,_0x211036['options']);var _0x4abc59={'where':_0x3d7feb['where']};return db[_0xc1a5('0x4d')][_0xc1a5('0x22')](_0x4abc59)[_0xc1a5('0x2b')](function(_0x198903){_0x42cfb2[_0xc1a5('0x22')]=_0x198903;if(_0x211036[_0xc1a5('0x40')]['includeAll']){_0x3d7feb[_0xc1a5('0x4e')]=[{'all':!![]}];}return db[_0xc1a5('0x4d')][_0xc1a5('0x4f')](_0x3d7feb);})[_0xc1a5('0x2b')](function(_0x1446d2){_0x42cfb2[_0xc1a5('0x50')]=_0x1446d2;return _0x42cfb2;})['then'](respondWithFilteredResult(_0x20c87a,_0x3d7feb))[_0xc1a5('0x51')](handleError(_0x20c87a,null));};exports[_0xc1a5('0x52')]=function(_0x46d4cc,_0x2fc0f2){var _0x4da9ea={'raw':![],'where':{'id':_0x46d4cc[_0xc1a5('0x53')]['id']}},_0x5df3f6={};_0x5df3f6['model']=_['keys'](db[_0xc1a5('0x4d')][_0xc1a5('0x3b')]);_0x5df3f6['query']=_[_0xc1a5('0x41')](_0x46d4cc[_0xc1a5('0x40')]);_0x5df3f6['filters']=_[_0xc1a5('0x42')](_0x5df3f6['model'],_0x5df3f6[_0xc1a5('0x40')]);_0x4da9ea[_0xc1a5('0x45')]=_['intersection'](_0x5df3f6[_0xc1a5('0x3f')],qs[_0xc1a5('0x43')](_0x46d4cc[_0xc1a5('0x40')][_0xc1a5('0x43')]));_0x4da9ea[_0xc1a5('0x45')]=_0x4da9ea[_0xc1a5('0x45')][_0xc1a5('0x44')]?_0x4da9ea['attributes']:_0x5df3f6[_0xc1a5('0x3f')];if(_0x46d4cc[_0xc1a5('0x40')][_0xc1a5('0x54')]){_0x4da9ea[_0xc1a5('0x4e')]=[{'all':!![]}];}_0x4da9ea=_[_0xc1a5('0x4c')]({},_0x4da9ea,_0x46d4cc[_0xc1a5('0x55')]);return db['VoiceQueue'][_0xc1a5('0x56')](_0x4da9ea)[_0xc1a5('0x2b')](handleEntityNotFound(_0x2fc0f2,null))['then'](respondWithResult(_0x2fc0f2,null))[_0xc1a5('0x51')](handleError(_0x2fc0f2,null));};exports[_0xc1a5('0x57')]=function(_0x5d5690,_0x3581ba){return db[_0xc1a5('0x4d')]['create'](_0x5d5690[_0xc1a5('0x58')],{})[_0xc1a5('0x2b')](function(_0x3ac8b6){var _0x3b1b9b=_0x5d5690[_0xc1a5('0x59')][_0xc1a5('0x2d')]({'plain':!![]});if(!_0x3b1b9b)throw new Error(_0xc1a5('0x5a'));if(_0x3b1b9b['role']===_0xc1a5('0x59')){var _0x29d221=_0x3ac8b6[_0xc1a5('0x2d')]({'plain':!![]});var _0x5d836f=[{'name':_0xc1a5('0x2e'),'value':_0xc1a5('0x5b')},{'name':'QueueCampaigns','value':_0xc1a5('0x5c')}];var _0x3612e6=_['find'](_0x5d836f,[_0xc1a5('0x33'),_0x29d221['type']])[_0xc1a5('0x34')];return db[_0xc1a5('0x5d')][_0xc1a5('0x56')]({'where':{'name':_0x3612e6,'userProfileId':_0x3b1b9b[_0xc1a5('0x5e')]},'raw':!![]})[_0xc1a5('0x2b')](function(_0x280194){if(_0x280194&&_0x280194[_0xc1a5('0x5f')]===0x0){return db['UserProfileResource']['create']({'name':_0x29d221['name'],'resourceId':_0x29d221['id'],'type':_0x280194[_0xc1a5('0x34')],'sectionId':_0x280194['id']},{})[_0xc1a5('0x2b')](function(){return _0x3ac8b6;});}else{return _0x3ac8b6;}})[_0xc1a5('0x51')](function(_0x59905f){logger[_0xc1a5('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59905f);throw _0x59905f;});}return _0x3ac8b6;})['then'](respondWithResult(_0x3581ba,0xc9))['catch'](handleError(_0x3581ba,null));};exports['clone']=function(_0x2a2a24,_0x243976){var _0x20f6fc={'where':{'id':_0x2a2a24[_0xc1a5('0x53')]['id']}},_0xb2ac70={};_0xb2ac70[_0xc1a5('0x3f')]=_[_0xc1a5('0x41')](db['VoiceQueue'][_0xc1a5('0x3b')]);_0x20f6fc[_0xc1a5('0x45')]=_[_0xc1a5('0x42')](_0xb2ac70[_0xc1a5('0x3f')],qs[_0xc1a5('0x43')](_0x2a2a24[_0xc1a5('0x40')][_0xc1a5('0x43')]));_0x20f6fc[_0xc1a5('0x45')]=_0x20f6fc[_0xc1a5('0x45')][_0xc1a5('0x44')]?_0x20f6fc[_0xc1a5('0x45')]:_0xb2ac70[_0xc1a5('0x3f')];if(_0x2a2a24['query'][_0xc1a5('0x54')]){_0x20f6fc['include']=[{'all':!![]}];}_0x20f6fc=_[_0xc1a5('0x4c')]({},_0x20f6fc,_0x2a2a24['options']);return db['VoiceQueue']['find'](_0x20f6fc)[_0xc1a5('0x2b')](handleEntityNotFound(_0x243976,null))['then'](function(_0x249b7b){if(_0x249b7b){var _0x16a58e=_0x249b7b[_0xc1a5('0x2d')]({'plain':!![]});_0x16a58e=qs[_0xc1a5('0x60')](_0x16a58e,['id','createdAt',_0xc1a5('0x61')]);_0x2a2a24[_0xc1a5('0x58')]=_[_0xc1a5('0x60')](_0x2a2a24[_0xc1a5('0x58')],['id','createdAt',_0xc1a5('0x61')]);return db['VoiceQueue'][_0xc1a5('0x57')](_[_0xc1a5('0x4c')](_0x16a58e,_0x2a2a24[_0xc1a5('0x58')]),{'include':_0x2a2a24[_0xc1a5('0x40')][_0xc1a5('0x54')]?[{'all':!![]}]:undefined})[_0xc1a5('0x2b')](function(_0x419cef){var _0x49784b=_0x2a2a24[_0xc1a5('0x59')][_0xc1a5('0x2d')]({'plain':!![]});if(!_0x49784b)throw new Error(_0xc1a5('0x5a'));if(_0x49784b[_0xc1a5('0x62')]===_0xc1a5('0x59')){var _0x6afb0b=_0x419cef[_0xc1a5('0x2d')]({'plain':!![]});var _0x542625=[{'name':_0xc1a5('0x2e'),'value':_0xc1a5('0x5b')},{'name':_0xc1a5('0x2f'),'value':_0xc1a5('0x5c')}];var _0x600e34=_[_0xc1a5('0x56')](_0x542625,[_0xc1a5('0x33'),_0x6afb0b[_0xc1a5('0x3d')]])[_0xc1a5('0x34')];return db[_0xc1a5('0x5d')][_0xc1a5('0x56')]({'where':{'name':_0x600e34,'userProfileId':_0x49784b[_0xc1a5('0x5e')]},'raw':!![]})[_0xc1a5('0x2b')](function(_0x1714cb){if(_0x1714cb&&_0x1714cb[_0xc1a5('0x5f')]===0x0){return db[_0xc1a5('0x35')][_0xc1a5('0x57')]({'name':_0x6afb0b[_0xc1a5('0x34')],'resourceId':_0x6afb0b['id'],'type':_0x1714cb[_0xc1a5('0x34')],'sectionId':_0x1714cb['id']},{})[_0xc1a5('0x2b')](function(){return _0x419cef;});}else{return _0x419cef;}})[_0xc1a5('0x51')](function(_0x35f06a){logger['error'](_0xc1a5('0x63'),_0x35f06a);throw _0x35f06a;});}return _0x419cef;});}})[_0xc1a5('0x2b')](respondWithResult(_0x243976,0xc9))[_0xc1a5('0x51')](handleError(_0x243976,null));};exports[_0xc1a5('0x2a')]=function(_0x54d8e7,_0xb08583){if(_0x54d8e7[_0xc1a5('0x58')]['id']){delete _0x54d8e7[_0xc1a5('0x58')]['id'];}return db[_0xc1a5('0x4d')][_0xc1a5('0x56')]({'where':{'id':_0x54d8e7[_0xc1a5('0x53')]['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0xb08583,null))[_0xc1a5('0x2b')](saveUpdates(_0x54d8e7['body'],null))[_0xc1a5('0x2b')](respondWithResult(_0xb08583,null))['catch'](handleError(_0xb08583,null));};exports[_0xc1a5('0x2c')]=function(_0x23afc4,_0x2662c3){return db[_0xc1a5('0x4d')]['find']({'where':{'id':_0x23afc4['params']['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x2662c3,null))[_0xc1a5('0x2b')](removeEntity(_0x2662c3,null))[_0xc1a5('0x51')](handleError(_0x2662c3,null));};exports[_0xc1a5('0x64')]=function(_0x55216b,_0x447e69,_0x155d1f){var _0x5f4f19={'raw':![],'where':{}};var _0x479884={};var _0x34d81d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc1a5('0x65')]({'where':{'id':_0x55216b[_0xc1a5('0x53')]['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x447e69,null))[_0xc1a5('0x2b')](function(_0x2e755e){if(_0x2e755e){_0x479884[_0xc1a5('0x3f')]=_[_0xc1a5('0x41')](db[_0xc1a5('0x66')][_0xc1a5('0x3b')]);_0x479884['query']=_[_0xc1a5('0x41')](_0x55216b['query']);_0x479884[_0xc1a5('0x4a')]=_[_0xc1a5('0x42')](_0x479884[_0xc1a5('0x3f')],_0x479884['query']);_0x5f4f19[_0xc1a5('0x45')]=_['intersection'](_0x479884[_0xc1a5('0x3f')],qs[_0xc1a5('0x43')](_0x55216b[_0xc1a5('0x40')][_0xc1a5('0x43')]));_0x5f4f19[_0xc1a5('0x45')]=_0x5f4f19['attributes'][_0xc1a5('0x44')]?_0x5f4f19[_0xc1a5('0x45')]:_0x479884[_0xc1a5('0x3f')];if(!_0x55216b[_0xc1a5('0x40')][_0xc1a5('0x46')]('nolimit')){_0x5f4f19[_0xc1a5('0x24')]=qs['limit'](_0x55216b[_0xc1a5('0x40')][_0xc1a5('0x24')]);_0x5f4f19['offset']=qs[_0xc1a5('0x23')](_0x55216b['query']['offset']);}_0x5f4f19[_0xc1a5('0x47')]=qs['sort'](_0x55216b[_0xc1a5('0x40')][_0xc1a5('0x48')]);_0x5f4f19[_0xc1a5('0x4b')]=qs['filters'](_[_0xc1a5('0x49')](_0x55216b['query'],_0x479884[_0xc1a5('0x4a')]));_0x5f4f19[_0xc1a5('0x4b')][_0xc1a5('0x67')]=_0x2e755e['id'];if(_0x55216b[_0xc1a5('0x40')][_0xc1a5('0x30')]){_0x5f4f19[_0xc1a5('0x4b')]=_[_0xc1a5('0x4c')](_0x5f4f19[_0xc1a5('0x4b')],{'$or':_[_0xc1a5('0x32')](_0x5f4f19[_0xc1a5('0x45')],function(_0x9b7f09){var _0x2b3397={};_0x2b3397[_0x9b7f09]={'$like':'%'+_0x55216b['query'][_0xc1a5('0x30')]+'%'};return _0x2b3397;})});}_0x5f4f19=_[_0xc1a5('0x4c')]({},_0x5f4f19,_0x55216b['options']);return db[_0xc1a5('0x66')][_0xc1a5('0x22')]({'where':_0x5f4f19[_0xc1a5('0x4b')]})[_0xc1a5('0x2b')](function(_0x2b9701){_0x34d81d['count']=_0x2b9701;if(_0x55216b[_0xc1a5('0x40')][_0xc1a5('0x54')]){_0x5f4f19[_0xc1a5('0x4e')]=[{'all':!![]}];}return db[_0xc1a5('0x66')][_0xc1a5('0x4f')](_0x5f4f19);})[_0xc1a5('0x2b')](function(_0x37d344){_0x34d81d[_0xc1a5('0x50')]=_0x37d344;return _0x34d81d;});}})[_0xc1a5('0x2b')](respondWithFilteredResult(_0x447e69,_0x5f4f19))[_0xc1a5('0x51')](handleError(_0x447e69,null));};exports[_0xc1a5('0x68')]=function(_0x324a31,_0x56557a,_0x198ff4){var _0x2da848={'raw':!![],'where':{}};var _0x4ddf8c={};var _0x479421={'count':0x0,'rows':[]};return db[_0xc1a5('0x4d')][_0xc1a5('0x65')]({'where':{'id':_0x324a31[_0xc1a5('0x53')]['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x56557a,null))[_0xc1a5('0x2b')](function(_0x556de9){if(_0x556de9){_0x4ddf8c[_0xc1a5('0x3f')]=_[_0xc1a5('0x41')](db[_0xc1a5('0x69')][_0xc1a5('0x3b')]);_0x4ddf8c['query']=_['keys'](_0x324a31[_0xc1a5('0x40')]);_0x4ddf8c[_0xc1a5('0x4a')]=_['intersection'](_0x4ddf8c[_0xc1a5('0x3f')],_0x4ddf8c[_0xc1a5('0x40')]);_0x2da848[_0xc1a5('0x45')]=_['intersection'](_0x4ddf8c['model'],qs[_0xc1a5('0x43')](_0x324a31[_0xc1a5('0x40')][_0xc1a5('0x43')]));_0x2da848[_0xc1a5('0x45')]=_0x2da848[_0xc1a5('0x45')]['length']?_0x2da848['attributes']:_0x4ddf8c[_0xc1a5('0x3f')];if(!_0x324a31[_0xc1a5('0x40')][_0xc1a5('0x46')](_0xc1a5('0x6a'))){_0x2da848[_0xc1a5('0x24')]=qs[_0xc1a5('0x24')](_0x324a31[_0xc1a5('0x40')][_0xc1a5('0x24')]);_0x2da848['offset']=qs[_0xc1a5('0x23')](_0x324a31[_0xc1a5('0x40')]['offset']);}_0x2da848[_0xc1a5('0x47')]=qs['sort'](_0x324a31['query']['sort']);_0x2da848['where']=qs[_0xc1a5('0x4a')](_[_0xc1a5('0x49')](_0x324a31[_0xc1a5('0x40')],_0x4ddf8c[_0xc1a5('0x4a')]));_0x2da848[_0xc1a5('0x4b')][_0xc1a5('0x67')]=_0x556de9['id'];if(_0x324a31[_0xc1a5('0x40')][_0xc1a5('0x30')]){_0x2da848[_0xc1a5('0x4b')]=_[_0xc1a5('0x4c')](_0x2da848[_0xc1a5('0x4b')],{'$or':_['map'](_0x2da848['attributes'],function(_0x16a67e){var _0x56d1e1={};_0x56d1e1[_0x16a67e]={'$like':'%'+_0x324a31[_0xc1a5('0x40')][_0xc1a5('0x30')]+'%'};return _0x56d1e1;})});}_0x2da848=_[_0xc1a5('0x4c')]({},_0x2da848,_0x324a31['options']);return db[_0xc1a5('0x69')][_0xc1a5('0x22')]({'where':_0x2da848[_0xc1a5('0x4b')]})[_0xc1a5('0x2b')](function(_0x359e22){_0x479421[_0xc1a5('0x22')]=_0x359e22;if(_0x324a31[_0xc1a5('0x40')]['includeAll']){_0x2da848[_0xc1a5('0x4e')]=[{'all':!![]}];}return db[_0xc1a5('0x69')][_0xc1a5('0x4f')](_0x2da848);})[_0xc1a5('0x2b')](function(_0x35fd06){_0x479421[_0xc1a5('0x50')]=_0x35fd06;return _0x479421;});}})[_0xc1a5('0x2b')](respondWithFilteredResult(_0x56557a,_0x2da848))[_0xc1a5('0x51')](handleError(_0x56557a,null));};exports['getHopperFinals']=function(_0x4ffb55,_0x269a97,_0x141b17){var _0x42bcf4={'raw':!![],'where':{}};var _0x419410={};var _0x3b7421={'count':0x0,'rows':[]};return db[_0xc1a5('0x4d')][_0xc1a5('0x65')]({'where':{'id':_0x4ffb55['params']['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x269a97,null))[_0xc1a5('0x2b')](function(_0x2cb6d9){if(_0x2cb6d9){_0x419410[_0xc1a5('0x3f')]=_['keys'](db[_0xc1a5('0x6b')][_0xc1a5('0x3b')]);_0x419410[_0xc1a5('0x40')]=_['keys'](_0x4ffb55['query']);_0x419410[_0xc1a5('0x4a')]=_[_0xc1a5('0x42')](_0x419410[_0xc1a5('0x3f')],_0x419410['query']);_0x42bcf4[_0xc1a5('0x45')]=_[_0xc1a5('0x42')](_0x419410[_0xc1a5('0x3f')],qs['fields'](_0x4ffb55[_0xc1a5('0x40')][_0xc1a5('0x43')]));_0x42bcf4['attributes']=_0x42bcf4[_0xc1a5('0x45')]['length']?_0x42bcf4[_0xc1a5('0x45')]:_0x419410[_0xc1a5('0x3f')];if(!_0x4ffb55[_0xc1a5('0x40')][_0xc1a5('0x46')](_0xc1a5('0x6a'))){_0x42bcf4[_0xc1a5('0x24')]=qs[_0xc1a5('0x24')](_0x4ffb55[_0xc1a5('0x40')][_0xc1a5('0x24')]);_0x42bcf4['offset']=qs['offset'](_0x4ffb55[_0xc1a5('0x40')]['offset']);}_0x42bcf4[_0xc1a5('0x47')]=qs[_0xc1a5('0x48')](_0x4ffb55[_0xc1a5('0x40')][_0xc1a5('0x48')]);_0x42bcf4[_0xc1a5('0x4b')]=qs[_0xc1a5('0x4a')](_['pick'](_0x4ffb55['query'],_0x419410[_0xc1a5('0x4a')]));_0x42bcf4[_0xc1a5('0x4b')][_0xc1a5('0x67')]=_0x2cb6d9['id'];if(_0x4ffb55[_0xc1a5('0x40')][_0xc1a5('0x30')]){_0x42bcf4[_0xc1a5('0x4b')]=_['merge'](_0x42bcf4[_0xc1a5('0x4b')],{'$or':_[_0xc1a5('0x32')](_0x42bcf4[_0xc1a5('0x45')],function(_0x1cb3b1){var _0x2c3d62={};_0x2c3d62[_0x1cb3b1]={'$like':'%'+_0x4ffb55['query'][_0xc1a5('0x30')]+'%'};return _0x2c3d62;})});}_0x42bcf4=_['merge']({},_0x42bcf4,_0x4ffb55[_0xc1a5('0x55')]);return db['CmHopperFinal'][_0xc1a5('0x22')]({'where':_0x42bcf4[_0xc1a5('0x4b')]})[_0xc1a5('0x2b')](function(_0x165551){_0x3b7421[_0xc1a5('0x22')]=_0x165551;if(_0x4ffb55['query']['includeAll']){_0x42bcf4[_0xc1a5('0x4e')]=[{'all':!![]}];}return db[_0xc1a5('0x6b')]['findAll'](_0x42bcf4);})[_0xc1a5('0x2b')](function(_0x1a6468){_0x3b7421[_0xc1a5('0x50')]=_0x1a6468;return _0x3b7421;});}})['then'](respondWithFilteredResult(_0x269a97,_0x42bcf4))[_0xc1a5('0x51')](handleError(_0x269a97,null));};exports['getHopperBlacks']=function(_0x20cdfa,_0x2ef715,_0xbb3bfe){var _0x1243e9={'raw':!![],'where':{}};var _0x3203d5={};var _0x10f620={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc1a5('0x65')]({'where':{'id':_0x20cdfa['params']['id']}})['then'](handleEntityNotFound(_0x2ef715,null))[_0xc1a5('0x2b')](function(_0x6a740f){if(_0x6a740f){_0x3203d5['model']=_[_0xc1a5('0x41')](db[_0xc1a5('0x6c')]['rawAttributes']);_0x3203d5[_0xc1a5('0x40')]=_[_0xc1a5('0x41')](_0x20cdfa[_0xc1a5('0x40')]);_0x3203d5[_0xc1a5('0x4a')]=_[_0xc1a5('0x42')](_0x3203d5[_0xc1a5('0x3f')],_0x3203d5['query']);_0x1243e9['attributes']=_['intersection'](_0x3203d5[_0xc1a5('0x3f')],qs[_0xc1a5('0x43')](_0x20cdfa[_0xc1a5('0x40')][_0xc1a5('0x43')]));_0x1243e9[_0xc1a5('0x45')]=_0x1243e9[_0xc1a5('0x45')]['length']?_0x1243e9[_0xc1a5('0x45')]:_0x3203d5[_0xc1a5('0x3f')];if(!_0x20cdfa[_0xc1a5('0x40')]['hasOwnProperty'](_0xc1a5('0x6a'))){_0x1243e9[_0xc1a5('0x24')]=qs[_0xc1a5('0x24')](_0x20cdfa[_0xc1a5('0x40')][_0xc1a5('0x24')]);_0x1243e9[_0xc1a5('0x23')]=qs[_0xc1a5('0x23')](_0x20cdfa[_0xc1a5('0x40')][_0xc1a5('0x23')]);}_0x1243e9[_0xc1a5('0x47')]=qs[_0xc1a5('0x48')](_0x20cdfa[_0xc1a5('0x40')][_0xc1a5('0x48')]);_0x1243e9[_0xc1a5('0x4b')]=qs[_0xc1a5('0x4a')](_[_0xc1a5('0x49')](_0x20cdfa[_0xc1a5('0x40')],_0x3203d5[_0xc1a5('0x4a')]));_0x1243e9[_0xc1a5('0x4b')][_0xc1a5('0x67')]=_0x6a740f['id'];if(_0x20cdfa['query']['filter']){_0x1243e9[_0xc1a5('0x4b')]=_[_0xc1a5('0x4c')](_0x1243e9[_0xc1a5('0x4b')],{'$or':_[_0xc1a5('0x32')](_0x1243e9[_0xc1a5('0x45')],function(_0xe6717e){var _0x3a66c4={};_0x3a66c4[_0xe6717e]={'$like':'%'+_0x20cdfa[_0xc1a5('0x40')]['filter']+'%'};return _0x3a66c4;})});}_0x1243e9=_[_0xc1a5('0x4c')]({},_0x1243e9,_0x20cdfa[_0xc1a5('0x55')]);return db['CmHopperBlack'][_0xc1a5('0x22')]({'where':_0x1243e9['where']})[_0xc1a5('0x2b')](function(_0xabef10){_0x10f620['count']=_0xabef10;if(_0x20cdfa[_0xc1a5('0x40')]['includeAll']){_0x1243e9[_0xc1a5('0x4e')]=[{'all':!![]}];}return db[_0xc1a5('0x6c')][_0xc1a5('0x4f')](_0x1243e9);})[_0xc1a5('0x2b')](function(_0x3483ec){_0x10f620[_0xc1a5('0x50')]=_0x3483ec;return _0x10f620;});}})['then'](respondWithFilteredResult(_0x2ef715,_0x1243e9))[_0xc1a5('0x51')](handleError(_0x2ef715,null));};exports[_0xc1a5('0x6d')]=function(_0x1bf1d9,_0x2df6f5,_0x582b10){var _0x4367e1={};var _0x174006={};var _0x4660f9;var _0x10f1b2;return db['VoiceQueue'][_0xc1a5('0x65')]({'where':{'id':_0x1bf1d9['params']['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x2df6f5,null))[_0xc1a5('0x2b')](function(_0x4968a8){if(_0x4968a8){_0x4660f9=_0x4968a8;_0x174006[_0xc1a5('0x3f')]=_[_0xc1a5('0x41')](db['Team'][_0xc1a5('0x3b')]);_0x174006[_0xc1a5('0x40')]=_[_0xc1a5('0x41')](_0x1bf1d9[_0xc1a5('0x40')]);_0x174006[_0xc1a5('0x4a')]=_[_0xc1a5('0x42')](_0x174006['model'],_0x174006['query']);_0x4367e1['attributes']=_[_0xc1a5('0x42')](_0x174006[_0xc1a5('0x3f')],qs[_0xc1a5('0x43')](_0x1bf1d9['query']['fields']));_0x4367e1[_0xc1a5('0x45')]=_0x4367e1['attributes'][_0xc1a5('0x44')]?_0x4367e1[_0xc1a5('0x45')]:_0x174006['model'];_0x4367e1[_0xc1a5('0x47')]=qs[_0xc1a5('0x48')](_0x1bf1d9['query'][_0xc1a5('0x48')]);_0x4367e1[_0xc1a5('0x4b')]=qs['filters'](_[_0xc1a5('0x49')](_0x1bf1d9[_0xc1a5('0x40')],_0x174006['filters']));if(_0x1bf1d9[_0xc1a5('0x40')]['filter']){_0x4367e1[_0xc1a5('0x4b')]=_[_0xc1a5('0x4c')](_0x4367e1[_0xc1a5('0x4b')],{'$or':_[_0xc1a5('0x32')](_0x4367e1[_0xc1a5('0x45')],function(_0x23e350){var _0x3d963c={};_0x3d963c[_0x23e350]={'$like':'%'+_0x1bf1d9['query'][_0xc1a5('0x30')]+'%'};return _0x3d963c;})});}_0x4367e1=_['merge']({},_0x4367e1,_0x1bf1d9[_0xc1a5('0x55')]);return _0x4660f9[_0xc1a5('0x6d')](_0x4367e1);}})[_0xc1a5('0x2b')](function(_0x46ab89){if(_0x46ab89){_0x10f1b2=_0x46ab89[_0xc1a5('0x44')];if(!_0x1bf1d9['query'][_0xc1a5('0x46')](_0xc1a5('0x6a'))){_0x4367e1[_0xc1a5('0x24')]=qs['limit'](_0x1bf1d9[_0xc1a5('0x40')][_0xc1a5('0x24')]);_0x4367e1[_0xc1a5('0x23')]=qs[_0xc1a5('0x23')](_0x1bf1d9[_0xc1a5('0x40')][_0xc1a5('0x23')]);}return _0x4660f9['getTeams'](_0x4367e1);}})[_0xc1a5('0x2b')](function(_0x45d29c){if(_0x45d29c){return _0x45d29c?{'count':_0x10f1b2,'rows':_0x45d29c}:null;}})[_0xc1a5('0x2b')](respondWithResult(_0x2df6f5,null))[_0xc1a5('0x51')](handleError(_0x2df6f5,null));};exports['addTeams']=function(_0x2353df,_0x4019ac,_0x9b6d73){var _0x213f03=_0x2353df[_0xc1a5('0x58')][_0xc1a5('0x6e')];var _0x338996=_[_0xc1a5('0x32')](_0x213f03,'id');return db[_0xc1a5('0x6f')]['findAll']({'where':{'id':_0x338996},'attributes':['id'],'include':[{'model':db[_0xc1a5('0x70')],'as':_0xc1a5('0x71'),'attributes':['id',_0xc1a5('0x34'),'online',_0xc1a5('0x72'),_0xc1a5('0x73')],'raw':!![]}]})[_0xc1a5('0x2b')](function(_0x5aae9e){if(_0x5aae9e){var _0x2f213d=_['flatMap'](_0x5aae9e,function(_0x19d247){var _0x39c2ce=_0x19d247[_0xc1a5('0x2d')]({'plain':!![]});_0x39c2ce[_0xc1a5('0x71')][_0xc1a5('0x74')](function(_0x4b6ab2){_0x4b6ab2[_0xc1a5('0x75')]=_[_0xc1a5('0x56')](_0x213f03,{'id':_0x39c2ce['id']})['penalty'];});return _0x39c2ce[_0xc1a5('0x71')];});return db[_0xc1a5('0x4d')][_0xc1a5('0x56')]({'where':{'id':_0x2353df[_0xc1a5('0x53')]['id']}})[_0xc1a5('0x2b')](function(_0x15d06c){return db[_0xc1a5('0x76')][_0xc1a5('0x77')](function(_0x384224){return _0x15d06c[_0xc1a5('0x78')](_0x338996,{'transaction':_0x384224})['then'](function(){return BPromise['each'](_0x2f213d,function(_0x11c927){return db['UserVoiceQueue'][_0xc1a5('0x79')]({'where':{'UserId':_0x11c927['id'],'VoiceQueueId':_0x2353df[_0xc1a5('0x53')]['id']},'defaults':{'penalty':_0x11c927['penalty']},'transaction':_0x384224});});})[_0xc1a5('0x2b')](function(){return BPromise['each'](_[_0xc1a5('0x30')](_0x2f213d,{'online':!![]}),function(_0x248434){return db[_0xc1a5('0x7a')]['upsert']({'membername':_0x248434[_0xc1a5('0x34')],'UserId':_0x248434['id'],'queue_name':_0x15d06c[_0xc1a5('0x34')],'VoiceQueueId':_0x15d06c['id'],'interface':_[_0xc1a5('0x7b')](_0x248434[_0xc1a5('0x73')])?util[_0xc1a5('0x7c')](_0xc1a5('0x7d'),_0x248434[_0xc1a5('0x34')]):_0x248434['interface'],'paused':_0x248434[_0xc1a5('0x72')]||![],'penalty':_0x248434[_0xc1a5('0x75')]},{'transaction':_0x384224});});})[_0xc1a5('0x2b')](function(){_0x2f213d[_0xc1a5('0x74')](function(_0x341eb9){socket[_0xc1a5('0x7e')]('userVoiceQueue:save',{'UserId':_0x341eb9['id'],'VoiceQueueId':_0x15d06c['id']});});});});});}})['then'](respondWithStatusCode(_0x4019ac,null))[_0xc1a5('0x51')](handleError(_0x4019ac,null));};exports[_0xc1a5('0x7f')]=function(_0x3ea22b,_0x17983a,_0x5a9216){return db[_0xc1a5('0x6f')][_0xc1a5('0x4f')]({'where':{'id':_0x3ea22b[_0xc1a5('0x40')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc1a5('0x70')],'as':_0xc1a5('0x71'),'attributes':['id'],'raw':!![]}]})[_0xc1a5('0x2b')](handleEntityNotFound(_0x17983a,null))['then'](function(_0x293a7d){var _0x1c4ded=_[_0xc1a5('0x32')](_0x293a7d,'id');var _0x320d6a=[];var _0x3f52ad=[];var _0x47b682=squel[_0xc1a5('0x80')]();_0x47b682[_0xc1a5('0x81')](_0xc1a5('0x82'))[_0xc1a5('0x83')]('team_has_voice_queues','tq')['join'](_0xc1a5('0x84'),'ut',_0xc1a5('0x85'))[_0xc1a5('0x4b')](_0xc1a5('0x86'),_0x3ea22b[_0xc1a5('0x53')]['id']);for(var _0x36bf00=0x0;_0x36bf00<_0x293a7d['length'];_0x36bf00+=0x1){let _0x352a82=_0x293a7d[_0x36bf00];for(var _0xbbf653=0x0;_0xbbf653<_0x352a82[_0xc1a5('0x71')][_0xc1a5('0x44')];_0xbbf653+=0x1){let _0x3d8278=_0x352a82['Agents'][_0xbbf653];var _0x171208=_0x47b682['clone']();_0x171208['where'](_0xc1a5('0x87'),_0x3d8278['id']);_0x3f52ad['push'](db[_0xc1a5('0x76')][_0xc1a5('0x40')](_0x171208[_0xc1a5('0x88')](),{'type':db[_0xc1a5('0x76')][_0xc1a5('0x89')][_0xc1a5('0x8a')]})[_0xc1a5('0x2b')](function(_0x1952e5){if(_0x1952e5[_0xc1a5('0x44')]===0x1){return _0x3d8278['id'];}else{var _0x1f88da=_['every'](_[_0xc1a5('0x32')](_0x1952e5,_0xc1a5('0x8b')),function(_0x420023){return _[_0xc1a5('0x8c')](_0x1c4ded,_0x420023);});if(_0x1f88da){return _0x3d8278['id'];}}}));}}return BPromise[_0xc1a5('0x8d')](_0x3f52ad)[_0xc1a5('0x2b')](function(_0x434bf7){_0x320d6a=_(_0x320d6a)[_0xc1a5('0x8e')](_0x434bf7)[_0xc1a5('0x8f')]()[_0xc1a5('0x33')]();return db[_0xc1a5('0x4d')]['find']({'where':{'id':_0x3ea22b['params']['id']}})[_0xc1a5('0x2b')](function(_0x20fd24){return db[_0xc1a5('0x76')]['transaction'](function(_0x5b5e29){return _0x20fd24[_0xc1a5('0x7f')](_0x3ea22b['query'][_0xc1a5('0x90')],{'transaction':_0x5b5e29})[_0xc1a5('0x2b')](function(){if(!_[_0xc1a5('0x91')](_0x320d6a)){return _0x20fd24[_0xc1a5('0x92')](_0x320d6a,{'transaction':_0x5b5e29})[_0xc1a5('0x2b')](function(){return db['UserVoiceQueueRt'][_0xc1a5('0x2c')]({'where':{'VoiceQueueId':_0x3ea22b[_0xc1a5('0x53')]['id'],'UserId':_0x320d6a},'transaction':_0x5b5e29});});}})[_0xc1a5('0x2b')](function(){_0x320d6a['forEach'](function(_0x1b854f){socket['emit'](_0xc1a5('0x93'),{'UserId':_0x1b854f,'VoiceQueueId':_0x20fd24['id']});});});});});});})[_0xc1a5('0x2b')](respondWithStatusCode(_0x17983a,null))[_0xc1a5('0x51')](handleError(_0x17983a,null));};exports[_0xc1a5('0x94')]=function(_0x163b1f,_0x19aa18,_0x22564b){var _0x2765fe,_0x31d4ec;return db[_0xc1a5('0x4d')][_0xc1a5('0x56')]({'where':{'id':_0x163b1f['params']['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x19aa18,null))[_0xc1a5('0x2b')](function(_0x52c2d4){if(_0x52c2d4){_0x31d4ec=_0x52c2d4;return _0x52c2d4[_0xc1a5('0x94')](_0x163b1f[_0xc1a5('0x58')][_0xc1a5('0x90')],_[_0xc1a5('0x60')](_0x163b1f[_0xc1a5('0x58')],[_0xc1a5('0x90'),'id'])||{})[_0xc1a5('0x95')](function(_0x1d7264){for(var _0x45b1cd=0x0;_0x45b1cd<_0x163b1f[_0xc1a5('0x58')][_0xc1a5('0x90')][_0xc1a5('0x44')];_0x45b1cd+=0x1){socket[_0xc1a5('0x7e')](_0xc1a5('0x96'),{'UserId':_0x163b1f[_0xc1a5('0x58')]['ids'][_0x45b1cd],'VoiceQueueId':_0x163b1f['params']['id']});}return _0x1d7264;});}})[_0xc1a5('0x2b')](function(_0x278675){_0x2765fe=_0x278675||[];if(_0x31d4ec){return db[_0xc1a5('0x70')]['findAll']({'where':{'id':_0x163b1f[_0xc1a5('0x58')]['ids']},'attributes':['id',_0xc1a5('0x34'),_0xc1a5('0x97'),_0xc1a5('0x72'),'interface'],'raw':!![]});}})['then'](function(_0x3cad88){if(!_[_0xc1a5('0x91')](_0x3cad88)){var _0x38bf7f=[];for(var _0x52c7be=0x0;_0x52c7be<_0x3cad88['length'];_0x52c7be++){if(_0x3cad88[_0x52c7be]['online']){_0x38bf7f[_0xc1a5('0x98')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3cad88[_0x52c7be][_0xc1a5('0x34')],'UserId':_0x3cad88[_0x52c7be]['id'],'queue_name':_0x31d4ec[_0xc1a5('0x34')],'VoiceQueueId':_0x31d4ec['id'],'interface':_[_0xc1a5('0x7b')](_0x3cad88[_0x52c7be][_0xc1a5('0x73')])?util[_0xc1a5('0x7c')](_0xc1a5('0x7d'),_0x3cad88[_0x52c7be][_0xc1a5('0x34')]):_0x3cad88[_0x52c7be][_0xc1a5('0x73')],'paused':_0x3cad88[_0x52c7be][_0xc1a5('0x72')]||![],'penalty':_0x163b1f[_0xc1a5('0x58')]['penalty']||0x0}));}}return BPromise['all'](_0x38bf7f);}})[_0xc1a5('0x2b')](function(){return _0x2765fe;})[_0xc1a5('0x2b')](respondWithResult(_0x19aa18,null))[_0xc1a5('0x51')](handleError(_0x19aa18,null));};exports[_0xc1a5('0x92')]=function(_0x599c3d,_0x533425,_0x3c56a6){return db['VoiceQueue'][_0xc1a5('0x56')]({'where':{'id':_0x599c3d['params']['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x533425,null))[_0xc1a5('0x2b')](function(_0x28bd0b){if(_0x28bd0b){return _0x28bd0b[_0xc1a5('0x92')](_0x599c3d[_0xc1a5('0x40')][_0xc1a5('0x90')])[_0xc1a5('0x2b')](function(){if(_[_0xc1a5('0x99')](_0x599c3d[_0xc1a5('0x40')]['ids'])){for(var _0x5db48e=0x0;_0x5db48e<_0x599c3d[_0xc1a5('0x40')][_0xc1a5('0x90')][_0xc1a5('0x44')];_0x5db48e+=0x1){socket[_0xc1a5('0x7e')](_0xc1a5('0x93'),{'UserId':Number(_0x599c3d[_0xc1a5('0x40')][_0xc1a5('0x90')][_0x5db48e]),'VoiceQueueId':Number(_0x599c3d[_0xc1a5('0x53')]['id'])});}}else{socket[_0xc1a5('0x7e')](_0xc1a5('0x93'),{'UserId':Number(_0x599c3d[_0xc1a5('0x40')][_0xc1a5('0x90')]),'VoiceQueueId':Number(_0x599c3d[_0xc1a5('0x53')]['id'])});}});}})['then'](function(_0x2491b1){return db[_0xc1a5('0x7a')][_0xc1a5('0x2c')]({'where':{'VoiceQueueId':_0x599c3d[_0xc1a5('0x53')]['id'],'UserId':_0x599c3d[_0xc1a5('0x40')]['ids']}})[_0xc1a5('0x2b')](function(){return _0x2491b1;});})['then'](respondWithStatusCode(_0x533425,null))['catch'](handleError(_0x533425,null));};exports['getAgents']=function(_0x54bc61,_0x12ec35,_0x48cacf){var _0x388ef2={};var _0x145201={};var _0xcaac6c;var _0x3439ea;return db[_0xc1a5('0x4d')][_0xc1a5('0x65')]({'where':{'id':_0x54bc61['params']['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x12ec35,null))[_0xc1a5('0x2b')](function(_0x5cc9a){if(_0x5cc9a){_0xcaac6c=_0x5cc9a;_0x145201['model']=_[_0xc1a5('0x41')](db['User'][_0xc1a5('0x3b')]);_0x145201[_0xc1a5('0x40')]=_[_0xc1a5('0x41')](_0x54bc61[_0xc1a5('0x40')]);_0x145201[_0xc1a5('0x4a')]=_['intersection'](_0x145201['model'],_0x145201['query']);_0x388ef2[_0xc1a5('0x45')]=_[_0xc1a5('0x42')](_0x145201[_0xc1a5('0x3f')],qs[_0xc1a5('0x43')](_0x54bc61[_0xc1a5('0x40')]['fields']));_0x388ef2[_0xc1a5('0x45')]=_0x388ef2[_0xc1a5('0x45')][_0xc1a5('0x44')]?_0x388ef2[_0xc1a5('0x45')]:_0x145201[_0xc1a5('0x3f')];_0x388ef2['order']=qs[_0xc1a5('0x48')](_0x54bc61[_0xc1a5('0x40')][_0xc1a5('0x48')]);_0x388ef2[_0xc1a5('0x4b')]=qs[_0xc1a5('0x4a')](_[_0xc1a5('0x49')](_0x54bc61['query'],_0x145201[_0xc1a5('0x4a')]));if(_0x54bc61[_0xc1a5('0x40')]['filter']){_0x388ef2[_0xc1a5('0x4b')]=_['merge'](_0x388ef2[_0xc1a5('0x4b')],{'$or':_['map'](_0x388ef2[_0xc1a5('0x45')],function(_0x4aa4d0){var _0x561fbd={};_0x561fbd[_0x4aa4d0]={'$like':'%'+_0x54bc61[_0xc1a5('0x40')][_0xc1a5('0x30')]+'%'};return _0x561fbd;})});}_0x388ef2=_[_0xc1a5('0x4c')]({},_0x388ef2,_0x54bc61[_0xc1a5('0x55')]);return _0xcaac6c[_0xc1a5('0x9a')](_0x388ef2);}})[_0xc1a5('0x2b')](function(_0x289d4d){if(_0x289d4d){_0x3439ea=_0x289d4d[_0xc1a5('0x44')];if(!_0x54bc61['query'][_0xc1a5('0x46')](_0xc1a5('0x6a'))){_0x388ef2[_0xc1a5('0x24')]=qs[_0xc1a5('0x24')](_0x54bc61[_0xc1a5('0x40')][_0xc1a5('0x24')]);_0x388ef2[_0xc1a5('0x23')]=qs[_0xc1a5('0x23')](_0x54bc61['query'][_0xc1a5('0x23')]);}return _0xcaac6c['getAgents'](_0x388ef2);}})[_0xc1a5('0x2b')](function(_0x1c50f5){if(_0x1c50f5){return _0x1c50f5?{'count':_0x3439ea,'rows':_0x1c50f5}:null;}})[_0xc1a5('0x2b')](respondWithResult(_0x12ec35,null))[_0xc1a5('0x51')](handleError(_0x12ec35,null));};exports[_0xc1a5('0x9b')]=function(_0x56ecba,_0xe9efa6,_0x138a76){var _0x21ba1f={};var _0x6292bb={};var _0x56668c;var _0x44defe;return db[_0xc1a5('0x4d')]['findOne']({'where':{'id':_0x56ecba[_0xc1a5('0x53')]['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0xe9efa6,null))[_0xc1a5('0x2b')](function(_0xb73094){if(_0xb73094){_0x56668c=_0xb73094;_0x6292bb[_0xc1a5('0x3f')]=_[_0xc1a5('0x41')](db[_0xc1a5('0x7a')]['rawAttributes']);_0x6292bb['query']=_[_0xc1a5('0x41')](_0x56ecba['query']);_0x6292bb[_0xc1a5('0x4a')]=_['intersection'](_0x6292bb['model'],_0x6292bb[_0xc1a5('0x40')]);_0x21ba1f[_0xc1a5('0x45')]=_['intersection'](_0x6292bb[_0xc1a5('0x3f')],qs[_0xc1a5('0x43')](_0x56ecba[_0xc1a5('0x40')]['fields']));_0x21ba1f[_0xc1a5('0x45')]=_0x21ba1f['attributes'][_0xc1a5('0x44')]?_0x21ba1f[_0xc1a5('0x45')]:_0x6292bb[_0xc1a5('0x3f')];_0x21ba1f['order']=qs[_0xc1a5('0x48')](_0x56ecba[_0xc1a5('0x40')][_0xc1a5('0x48')]);_0x21ba1f[_0xc1a5('0x4b')]=qs[_0xc1a5('0x4a')](_[_0xc1a5('0x49')](_0x56ecba[_0xc1a5('0x40')],_0x6292bb[_0xc1a5('0x4a')]));if(_0x56ecba['query'][_0xc1a5('0x30')]){_0x21ba1f[_0xc1a5('0x4b')]=_[_0xc1a5('0x4c')](_0x21ba1f[_0xc1a5('0x4b')],{'$or':_[_0xc1a5('0x32')](_0x21ba1f[_0xc1a5('0x45')],function(_0xd03d04){var _0x26516c={};_0x26516c[_0xd03d04]={'$like':'%'+_0x56ecba[_0xc1a5('0x40')][_0xc1a5('0x30')]+'%'};return _0x26516c;})});}_0x21ba1f=_[_0xc1a5('0x4c')]({},_0x21ba1f,_0x56ecba[_0xc1a5('0x55')]);return _0x56668c[_0xc1a5('0x9b')](_0x21ba1f);}})['then'](function(_0x364c91){if(_0x364c91){_0x44defe=_0x364c91[_0xc1a5('0x44')];if(!_0x56ecba[_0xc1a5('0x40')][_0xc1a5('0x46')](_0xc1a5('0x6a'))){_0x21ba1f[_0xc1a5('0x24')]=qs[_0xc1a5('0x24')](_0x56ecba['query'][_0xc1a5('0x24')]);_0x21ba1f['offset']=qs[_0xc1a5('0x23')](_0x56ecba[_0xc1a5('0x40')][_0xc1a5('0x23')]);}return _0x56668c['getMembers'](_0x21ba1f);}})[_0xc1a5('0x2b')](function(_0x2d1e93){return _0x2d1e93?{'count':_0x44defe,'rows':_0x2d1e93}:null;})[_0xc1a5('0x2b')](respondWithResult(_0xe9efa6,null))[_0xc1a5('0x51')](handleError(_0xe9efa6,null));};exports['getLists']=function(_0x144fc1,_0x206a40,_0x308370){var _0x54e7d1={};var _0x1efbe1={};var _0xfdb69b;var _0x2d70da;return db[_0xc1a5('0x4d')][_0xc1a5('0x65')]({'where':{'id':_0x144fc1[_0xc1a5('0x53')]['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x206a40,null))[_0xc1a5('0x2b')](function(_0x30fd7e){if(_0x30fd7e){_0xfdb69b=_0x30fd7e;_0x1efbe1[_0xc1a5('0x3f')]=_[_0xc1a5('0x41')](db[_0xc1a5('0x9c')]['rawAttributes']);_0x1efbe1[_0xc1a5('0x40')]=_[_0xc1a5('0x41')](_0x144fc1[_0xc1a5('0x40')]);_0x1efbe1['filters']=_[_0xc1a5('0x42')](_0x1efbe1[_0xc1a5('0x3f')],_0x1efbe1[_0xc1a5('0x40')]);_0x54e7d1['attributes']=_[_0xc1a5('0x42')](_0x1efbe1['model'],qs['fields'](_0x144fc1[_0xc1a5('0x40')][_0xc1a5('0x43')]));_0x54e7d1[_0xc1a5('0x45')]=_0x54e7d1[_0xc1a5('0x45')]['length']?_0x54e7d1['attributes']:_0x1efbe1['model'];_0x54e7d1[_0xc1a5('0x47')]=qs[_0xc1a5('0x48')](_0x144fc1[_0xc1a5('0x40')][_0xc1a5('0x48')]);_0x54e7d1['where']=qs[_0xc1a5('0x4a')](_[_0xc1a5('0x49')](_0x144fc1[_0xc1a5('0x40')],_0x1efbe1['filters']));if(_0x144fc1[_0xc1a5('0x40')][_0xc1a5('0x30')]){_0x54e7d1['where']=_[_0xc1a5('0x4c')](_0x54e7d1[_0xc1a5('0x4b')],{'$or':_['map'](_0x54e7d1['attributes'],function(_0x142085){var _0x1fa21a={};_0x1fa21a[_0x142085]={'$like':'%'+_0x144fc1[_0xc1a5('0x40')][_0xc1a5('0x30')]+'%'};return _0x1fa21a;})});}_0x54e7d1=_[_0xc1a5('0x4c')]({},_0x54e7d1,_0x144fc1[_0xc1a5('0x55')]);return _0xfdb69b[_0xc1a5('0x9d')](_0x54e7d1);}})[_0xc1a5('0x2b')](function(_0x4f480d){if(_0x4f480d){_0x2d70da=_0x4f480d['length'];if(!_0x144fc1[_0xc1a5('0x40')][_0xc1a5('0x46')](_0xc1a5('0x6a'))){_0x54e7d1[_0xc1a5('0x24')]=qs[_0xc1a5('0x24')](_0x144fc1[_0xc1a5('0x40')]['limit']);_0x54e7d1['offset']=qs[_0xc1a5('0x23')](_0x144fc1[_0xc1a5('0x40')]['offset']);}return _0xfdb69b[_0xc1a5('0x9d')](_0x54e7d1);}})[_0xc1a5('0x2b')](function(_0x58f118){if(_0x58f118){return _0x58f118?{'count':_0x2d70da,'rows':_0x58f118}:null;}})[_0xc1a5('0x2b')](respondWithResult(_0x206a40,null))['catch'](handleError(_0x206a40,null));};exports[_0xc1a5('0x9e')]=function(_0x28509b,_0x422111,_0x32f25f){var _0x140bc9,_0x50f84c;return db[_0xc1a5('0x4d')][_0xc1a5('0x56')]({'where':{'id':_0x28509b[_0xc1a5('0x53')]['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x422111,null))[_0xc1a5('0x2b')](function(_0x41de86){if(_0x41de86){_0x50f84c=_0x41de86;return _0x41de86[_0xc1a5('0x9e')](_0x28509b[_0xc1a5('0x58')][_0xc1a5('0x90')],_[_0xc1a5('0x60')](_0x28509b[_0xc1a5('0x58')],[_0xc1a5('0x90'),'id'])||{});}return null;})[_0xc1a5('0x95')](function(_0x1ac8aa){var _0x3cad44;_0x140bc9=_0x1ac8aa||[];var _0x4655dc=[];if(_0x1ac8aa){for(var _0x151f81=0x0;_0x151f81<_0x1ac8aa['length'];_0x151f81+=0x1){var _0x2bcae2=_0x1ac8aa[_0x151f81][_0xc1a5('0x2d')]({'plain':!![]});_0x50f84c[_0xc1a5('0x9f')]=_0x28509b[_0xc1a5('0x58')][_0xc1a5('0x9f')]?_0x28509b[_0xc1a5('0x58')][_0xc1a5('0x9f')]:_0x50f84c[_0xc1a5('0x9f')];switch(_0x50f84c[_0xc1a5('0x9f')]){case _0xc1a5('0xa0'):_0x3cad44=squel['insert']()[_0xc1a5('0xa1')](_0xc1a5('0xa2'))[_0xc1a5('0xa3')](['phone',_0xc1a5('0xa4'),_0xc1a5('0xa5'),_0xc1a5('0xa6'),_0xc1a5('0x67'),'createdAt','updatedAt'],squel['select']()['field'](_0xc1a5('0xa7'),'phone')[_0xc1a5('0x81')](_0xc1a5('0xa8'),_0xc1a5('0xa4'))['field']('id',_0xc1a5('0xa5'))[_0xc1a5('0x81')](_0x2bcae2['CmListId']['toString'](),_0xc1a5('0xa6'))['field'](_0x28509b[_0xc1a5('0x53')]['id'][_0xc1a5('0x88')](),_0xc1a5('0x67'))['field'](_0xc1a5('0xa8'),_0xc1a5('0xa9'))[_0xc1a5('0x81')](_0xc1a5('0xa8'),'updatedAt')[_0xc1a5('0x83')](_0xc1a5('0xaa'))[_0xc1a5('0x4b')](_0xc1a5('0xab'))[_0xc1a5('0x4b')](_0xc1a5('0xac'),_0x2bcae2['CmListId'][_0xc1a5('0x88')]())[_0xc1a5('0x4b')](_0xc1a5('0xad'))['where'](_0xc1a5('0xae'),squel[_0xc1a5('0x80')]()[_0xc1a5('0x81')](_0xc1a5('0xaf'))[_0xc1a5('0x83')]('cm_hopper_final')[_0xc1a5('0x4b')](_0xc1a5('0x86'),_0x28509b[_0xc1a5('0x53')]['id'][_0xc1a5('0x88')]()))['where'](_0xc1a5('0xae'),squel['select']()[_0xc1a5('0x81')](_0xc1a5('0xb0'))[_0xc1a5('0x83')](_0xc1a5('0xa2'))[_0xc1a5('0x4b')]('VoiceQueueId\x20=\x20?',_0x28509b[_0xc1a5('0x53')]['id'][_0xc1a5('0x88')]())))[_0xc1a5('0x88')]();break;case _0xc1a5('0xb1'):_0x3cad44=squel['insert']()[_0xc1a5('0xa1')](_0xc1a5('0xa2'))[_0xc1a5('0xa3')]([_0xc1a5('0xa7'),'scheduledAt','ContactId',_0xc1a5('0xa6'),_0xc1a5('0x67'),_0xc1a5('0xa9'),'updatedAt'],squel['select']()['field'](_0xc1a5('0xa7'),_0xc1a5('0xa7'))[_0xc1a5('0x81')]('NOW()','scheduledAt')[_0xc1a5('0x81')]('id',_0xc1a5('0xa5'))['field'](_0x2bcae2[_0xc1a5('0xb2')]['toString'](),_0xc1a5('0xa6'))[_0xc1a5('0x81')](_0x28509b['params']['id'][_0xc1a5('0x88')](),_0xc1a5('0x67'))['field'](_0xc1a5('0xa8'),'createdAt')[_0xc1a5('0x81')](_0xc1a5('0xa8'),_0xc1a5('0x61'))[_0xc1a5('0x83')](_0xc1a5('0xaa'))[_0xc1a5('0x4b')](_0xc1a5('0xab'))[_0xc1a5('0x4b')](_0xc1a5('0xac'),_0x2bcae2['CmListId']['toString']())[_0xc1a5('0x4b')](_0xc1a5('0xad'))['where'](_0xc1a5('0xae'),squel[_0xc1a5('0x80')]()['field'](_0xc1a5('0xb0'))[_0xc1a5('0x83')](_0xc1a5('0xa2'))[_0xc1a5('0x4b')](_0xc1a5('0x86'),_0x28509b[_0xc1a5('0x53')]['id'][_0xc1a5('0x88')]())))['toString']();break;default:_0x3cad44=squel[_0xc1a5('0xb3')]()[_0xc1a5('0xa1')](_0xc1a5('0xa2'))[_0xc1a5('0xa3')]([_0xc1a5('0xa7'),'scheduledAt','ContactId',_0xc1a5('0xa6'),_0xc1a5('0x67'),_0xc1a5('0xa9'),_0xc1a5('0x61')],squel[_0xc1a5('0x80')]()[_0xc1a5('0x81')](_0xc1a5('0xa7'),_0xc1a5('0xa7'))[_0xc1a5('0x81')](_0xc1a5('0xa8'),_0xc1a5('0xa4'))[_0xc1a5('0x81')]('id',_0xc1a5('0xa5'))['field'](_0x2bcae2[_0xc1a5('0xb2')][_0xc1a5('0x88')](),_0xc1a5('0xa6'))[_0xc1a5('0x81')](_0x28509b[_0xc1a5('0x53')]['id'][_0xc1a5('0x88')](),_0xc1a5('0x67'))[_0xc1a5('0x81')](_0xc1a5('0xa8'),'createdAt')[_0xc1a5('0x81')](_0xc1a5('0xa8'),'updatedAt')[_0xc1a5('0x83')](_0xc1a5('0xaa'))[_0xc1a5('0x4b')]('deletedAt\x20IS\x20NULL')[_0xc1a5('0x4b')]('ListId\x20=\x20?',_0x2bcae2[_0xc1a5('0xb2')][_0xc1a5('0x88')]())['where'](_0xc1a5('0xad')))[_0xc1a5('0x88')]();}_0x4655dc[_0xc1a5('0x98')](db[_0xc1a5('0x76')][_0xc1a5('0x40')](_0x3cad44));}return BPromise['all'](_0x4655dc);}})[_0xc1a5('0x2b')](function(){return _0x140bc9;})['then'](respondWithResult(_0x422111,null))['catch'](handleError(_0x422111,null));};exports[_0xc1a5('0xb4')]=function(_0x3aeca7,_0x479518,_0x5d0dec){return db[_0xc1a5('0x4d')][_0xc1a5('0x56')]({'where':{'id':_0x3aeca7[_0xc1a5('0x53')]['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x479518,null))[_0xc1a5('0x2b')](function(_0x34b719){if(_0x34b719){return _0x34b719[_0xc1a5('0xb4')](_0x3aeca7[_0xc1a5('0x40')][_0xc1a5('0x90')]);}})[_0xc1a5('0x2b')](function(_0x2d96ba){if(_0x2d96ba){return db[_0xc1a5('0x66')][_0xc1a5('0x2c')]({'where':{'ListId':_0x3aeca7['query'][_0xc1a5('0x90')],'VoiceQueueId':_0x3aeca7['params']['id']}})[_0xc1a5('0x2b')](function(){return _0x2d96ba;});}})[_0xc1a5('0x2b')](respondWithStatusCode(_0x479518,null))[_0xc1a5('0x51')](handleError(_0x479518,null));};exports['getBlackLists']=function(_0x57b65a,_0x35c3c8,_0x313a28){var _0x44555a={};var _0x29a4cf={};var _0x2adbb5;var _0x587fc5;return db[_0xc1a5('0x4d')][_0xc1a5('0x65')]({'where':{'id':_0x57b65a['params']['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x35c3c8,null))[_0xc1a5('0x2b')](function(_0x4f8f29){if(_0x4f8f29){_0x2adbb5=_0x4f8f29;_0x29a4cf['model']=_[_0xc1a5('0x41')](db['CmList'][_0xc1a5('0x3b')]);_0x29a4cf[_0xc1a5('0x40')]=_['keys'](_0x57b65a[_0xc1a5('0x40')]);_0x29a4cf[_0xc1a5('0x4a')]=_[_0xc1a5('0x42')](_0x29a4cf['model'],_0x29a4cf[_0xc1a5('0x40')]);_0x44555a[_0xc1a5('0x45')]=_[_0xc1a5('0x42')](_0x29a4cf[_0xc1a5('0x3f')],qs[_0xc1a5('0x43')](_0x57b65a[_0xc1a5('0x40')][_0xc1a5('0x43')]));_0x44555a['attributes']=_0x44555a[_0xc1a5('0x45')]['length']?_0x44555a['attributes']:_0x29a4cf[_0xc1a5('0x3f')];_0x44555a[_0xc1a5('0x47')]=qs[_0xc1a5('0x48')](_0x57b65a[_0xc1a5('0x40')][_0xc1a5('0x48')]);_0x44555a['where']=qs[_0xc1a5('0x4a')](_[_0xc1a5('0x49')](_0x57b65a[_0xc1a5('0x40')],_0x29a4cf[_0xc1a5('0x4a')]));if(_0x57b65a[_0xc1a5('0x40')][_0xc1a5('0x30')]){_0x44555a[_0xc1a5('0x4b')]=_[_0xc1a5('0x4c')](_0x44555a['where'],{'$or':_['map'](_0x44555a[_0xc1a5('0x45')],function(_0xaf9c2d){var _0x149316={};_0x149316[_0xaf9c2d]={'$like':'%'+_0x57b65a['query'][_0xc1a5('0x30')]+'%'};return _0x149316;})});}_0x44555a=_[_0xc1a5('0x4c')]({},_0x44555a,_0x57b65a[_0xc1a5('0x55')]);return _0x2adbb5[_0xc1a5('0xb5')](_0x44555a);}})[_0xc1a5('0x2b')](function(_0x2ca767){if(_0x2ca767){_0x587fc5=_0x2ca767['length'];if(!_0x57b65a[_0xc1a5('0x40')][_0xc1a5('0x46')](_0xc1a5('0x6a'))){_0x44555a[_0xc1a5('0x24')]=qs[_0xc1a5('0x24')](_0x57b65a[_0xc1a5('0x40')][_0xc1a5('0x24')]);_0x44555a['offset']=qs[_0xc1a5('0x23')](_0x57b65a[_0xc1a5('0x40')][_0xc1a5('0x23')]);}return _0x2adbb5[_0xc1a5('0xb5')](_0x44555a);}})[_0xc1a5('0x2b')](function(_0x5cbaea){if(_0x5cbaea){return _0x5cbaea?{'count':_0x587fc5,'rows':_0x5cbaea}:null;}})[_0xc1a5('0x2b')](respondWithResult(_0x35c3c8,null))[_0xc1a5('0x51')](handleError(_0x35c3c8,null));};exports[_0xc1a5('0xb6')]=function(_0x52c1cc,_0x164c89,_0x4f60a8){var _0x46c7ad,_0x56b057;return db[_0xc1a5('0x4d')][_0xc1a5('0x56')]({'where':{'id':_0x52c1cc[_0xc1a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x164c89,null))[_0xc1a5('0x2b')](function(_0xced576){if(_0xced576){_0x56b057=_0xced576;return _0xced576[_0xc1a5('0xb6')](_0x52c1cc[_0xc1a5('0x58')][_0xc1a5('0x90')],_['omit'](_0x52c1cc[_0xc1a5('0x58')],[_0xc1a5('0x90'),'id'])||{});}return null;})[_0xc1a5('0x95')](function(_0x4496aa){var _0x40fbd8;_0x46c7ad=_0x4496aa||[];var _0x3644ad=[];if(_0x4496aa){for(var _0x1185ee=0x0;_0x1185ee<_0x4496aa['length'];_0x1185ee+=0x1){var _0x36d3ce=_0x4496aa[_0x1185ee]['get']({'plain':!![]});_0x40fbd8=squel[_0xc1a5('0xb3')]()['into'](_0xc1a5('0xb7'))[_0xc1a5('0xa3')]([_0xc1a5('0xa7'),_0xc1a5('0xa5'),'ListId',_0xc1a5('0x67'),_0xc1a5('0xa9'),_0xc1a5('0x61')],squel[_0xc1a5('0x80')]()['field'](_0xc1a5('0xa7'),_0xc1a5('0xa7'))[_0xc1a5('0x81')]('id','ContactId')[_0xc1a5('0x81')](_0x36d3ce[_0xc1a5('0xb2')]['toString'](),'ListId')[_0xc1a5('0x81')](_0x52c1cc[_0xc1a5('0x53')]['id'][_0xc1a5('0x88')](),_0xc1a5('0x67'))[_0xc1a5('0x81')]('NOW()',_0xc1a5('0xa9'))[_0xc1a5('0x81')](_0xc1a5('0xa8'),_0xc1a5('0x61'))[_0xc1a5('0x83')](_0xc1a5('0xaa'))['where'](_0xc1a5('0xab'))[_0xc1a5('0x4b')](_0xc1a5('0xac'),_0x36d3ce['CmListId']['toString']())[_0xc1a5('0x4b')]('phone\x20IS\x20NOT\x20NULL'))[_0xc1a5('0x88')]();_0x3644ad[_0xc1a5('0x98')](db['sequelize']['query'](_0x40fbd8));}return BPromise['all'](_0x3644ad);}})[_0xc1a5('0x2b')](function(){return _0x46c7ad;})['then'](respondWithResult(_0x164c89,null))['catch'](handleError(_0x164c89,null));};exports[_0xc1a5('0xb8')]=function(_0xcf2c76,_0x45109f,_0x329382){return db[_0xc1a5('0x4d')]['find']({'where':{'id':_0xcf2c76['params']['id']}})[_0xc1a5('0x2b')](handleEntityNotFound(_0x45109f,null))[_0xc1a5('0x2b')](function(_0xa7336){if(_0xa7336){return _0xa7336['removeBlackLists'](_0xcf2c76[_0xc1a5('0x40')][_0xc1a5('0x90')]);}})[_0xc1a5('0x2b')](function(_0x4c23bb){if(_0x4c23bb){return db['CmHopperBlack'][_0xc1a5('0x2c')]({'where':{'ListId':_0xcf2c76[_0xc1a5('0x40')]['ids'],'VoiceQueueId':_0xcf2c76[_0xc1a5('0x53')]['id']}})[_0xc1a5('0x2b')](function(){return _0x4c23bb;});}})[_0xc1a5('0x2b')](respondWithStatusCode(_0x45109f,null))[_0xc1a5('0x51')](handleError(_0x45109f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 67b7ba9..8ef13ac 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 _0x7c48=['hook','exports','events','../../mysqldb','VoiceQueue','remove','emit','hasOwnProperty'];(function(_0x36909f,_0x4f45a5){var _0x512c12=function(_0x45f2a5){while(--_0x45f2a5){_0x36909f['push'](_0x36909f['shift']());}};_0x512c12(++_0x4f45a5);}(_0x7c48,0x122));var _0x87c4=function(_0x40b138,_0x4ad3c4){_0x40b138=_0x40b138-0x0;var _0x3ca1e7=_0x7c48[_0x40b138];return _0x3ca1e7;};'use strict';var EventEmitter=require(_0x87c4('0x0'));var VoiceQueue=require(_0x87c4('0x1'))['db'][_0x87c4('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x87c4('0x3')};function emitEvent(_0x3e5c5c){return function(_0x3e96d2,_0x2f36fa,_0x85b5d1){VoiceQueueEvents[_0x87c4('0x4')](_0x3e5c5c+':'+_0x3e96d2['id'],_0x3e96d2);VoiceQueueEvents[_0x87c4('0x4')](_0x3e5c5c,_0x3e96d2);_0x85b5d1(null);};}for(var e in events){if(events[_0x87c4('0x5')](e)){var event=events[e];VoiceQueue[_0x87c4('0x6')](e,emitEvent(event));}}module[_0x87c4('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x6728=['emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x8dc273,_0x21ac1b){var _0x32d30d=function(_0x58bda3){while(--_0x58bda3){_0x8dc273['push'](_0x8dc273['shift']());}};_0x32d30d(++_0x21ac1b);}(_0x6728,0x198));var _0x8672=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0x6728[_0x2a3c4d];return _0x55c390;};'use strict';var EventEmitter=require(_0x8672('0x0'));var VoiceQueue=require(_0x8672('0x1'))['db'][_0x8672('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x8672('0x3')](0x0);var events={'afterCreate':_0x8672('0x4'),'afterUpdate':_0x8672('0x5'),'afterDestroy':'remove'};function emitEvent(_0x53096b){return function(_0x504552,_0x4ce5f3,_0x578db4){VoiceQueueEvents['emit'](_0x53096b+':'+_0x504552['id'],_0x504552);VoiceQueueEvents[_0x8672('0x6')](_0x53096b,_0x504552);_0x578db4(null);};}for(var e in events){if(events[_0x8672('0x7')](e)){var event=events[e];VoiceQueue[_0x8672('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index cf9a9aa..9dae9e8 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 _0x46c8=['../../config/environment','./voiceQueue.attributes','voice_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x46c8,0x9d));var _0x846c=function(_0x2a5400,_0x1bdbaa){_0x2a5400=_0x2a5400-0x0;var _0x1f8f5c=_0x46c8[_0x2a5400];return _0x1f8f5c;};'use strict';var _=require(_0x846c('0x0'));var util=require(_0x846c('0x1'));var logger=require('../../config/logger')(_0x846c('0x2'));var moment=require(_0x846c('0x3'));var BPromise=require(_0x846c('0x4'));var rp=require(_0x846c('0x5'));var fs=require('fs');var path=require(_0x846c('0x6'));var rimraf=require(_0x846c('0x7'));var config=require(_0x846c('0x8'));var attributes=require(_0x846c('0x9'));module['exports']=function(_0xf584de,_0x3353a1){return _0xf584de['define']('VoiceQueue',attributes,{'tableName':_0x846c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe54=['voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','define'];(function(_0x5b7522,_0x17b149){var _0x8df3ac=function(_0x31c02c){while(--_0x31c02c){_0x5b7522['push'](_0x5b7522['shift']());}};_0x8df3ac(++_0x17b149);}(_0xfe54,0xa9));var _0x4fe5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfe54[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x4fe5('0x0'));var util=require(_0x4fe5('0x1'));var logger=require(_0x4fe5('0x2'))(_0x4fe5('0x3'));var moment=require(_0x4fe5('0x4'));var BPromise=require(_0x4fe5('0x5'));var rp=require(_0x4fe5('0x6'));var fs=require('fs');var path=require(_0x4fe5('0x7'));var rimraf=require(_0x4fe5('0x8'));var config=require(_0x4fe5('0x9'));var attributes=require(_0x4fe5('0xa'));module[_0x4fe5('0xb')]=function(_0x1414a5,_0x586deb){return _0x1414a5[_0x4fe5('0xc')]('VoiceQueue',attributes,{'tableName':_0x4fe5('0xd'),'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 7884342..38eca4c 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 _0x0542=['stringify','error','code','message','info','result','GetVoiceQueue','VoiceQueue','findAll','options','where','limit','include','map','attributes','model','then','ShowVoiceQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x335d90,_0x2d5769){var _0x32f18b=function(_0x3e305b){while(--_0x3e305b){_0x335d90['push'](_0x335d90['shift']());}};_0x32f18b(++_0x2d5769);}(_0x0542,0x109));var _0x2054=function(_0x5c3a99,_0x3a6edc){_0x5c3a99=_0x5c3a99-0x0;var _0x54e700=_0x0542[_0x5c3a99];return _0x54e700;};'use strict';var _=require(_0x2054('0x0'));var util=require(_0x2054('0x1'));var moment=require(_0x2054('0x2'));var BPromise=require(_0x2054('0x3'));var rs=require(_0x2054('0x4'));var fs=require('fs');var Redis=require(_0x2054('0x5'));var db=require(_0x2054('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2054('0x7'))(_0x2054('0x8'));var config=require(_0x2054('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2054('0xa')][_0x2054('0xb')]({'port':0x232a});config[_0x2054('0xc')]=_[_0x2054('0xd')](config[_0x2054('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2054('0xe'))(new Redis(config[_0x2054('0xc')]));require(_0x2054('0xf'))[_0x2054('0x10')](socket);function respondWithRpcPromise(_0x24d5b1,_0x1b9a77,_0x433d41){return new BPromise(function(_0x5e87a7,_0x3877c4){return client[_0x2054('0x11')](_0x24d5b1,_0x433d41)['then'](function(_0x5da3c5){logger['info'](_0x2054('0x12'),_0x1b9a77,'request\x20sent');logger[_0x2054('0x13')](_0x2054('0x14'),_0x1b9a77,_0x2054('0x15'),JSON[_0x2054('0x16')](_0x5da3c5));if(_0x5da3c5[_0x2054('0x17')]){if(_0x5da3c5[_0x2054('0x17')][_0x2054('0x18')]===0x1f4){logger['error'](_0x2054('0x12'),_0x1b9a77,_0x5da3c5[_0x2054('0x17')][_0x2054('0x19')]);return _0x3877c4(_0x5da3c5[_0x2054('0x17')]['message']);}logger[_0x2054('0x17')](_0x2054('0x12'),_0x1b9a77,_0x5da3c5[_0x2054('0x17')]['message']);return _0x5e87a7(_0x5da3c5[_0x2054('0x17')][_0x2054('0x19')]);}else{logger[_0x2054('0x1a')](_0x2054('0x12'),_0x1b9a77,_0x2054('0x15'));_0x5e87a7(_0x5da3c5[_0x2054('0x1b')][_0x2054('0x19')]);}})['catch'](function(_0x5df9a8){logger[_0x2054('0x17')](_0x2054('0x12'),_0x1b9a77,_0x5df9a8);_0x3877c4(_0x5df9a8);});});}exports[_0x2054('0x1c')]=function(_0x4e04ee){var _0x77dc79=this;return new Promise(function(_0x4c7545,_0x5247de){return db[_0x2054('0x1d')][_0x2054('0x1e')]({'raw':_0x4e04ee[_0x2054('0x1f')]?_0x4e04ee[_0x2054('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4e04ee[_0x2054('0x1f')]?_0x4e04ee[_0x2054('0x1f')][_0x2054('0x20')]||null:null,'attributes':_0x4e04ee[_0x2054('0x1f')]?_0x4e04ee[_0x2054('0x1f')]['attributes']||null:null,'limit':_0x4e04ee[_0x2054('0x1f')]?_0x4e04ee[_0x2054('0x1f')][_0x2054('0x21')]||null:null,'include':_0x4e04ee['options']?_0x4e04ee['options'][_0x2054('0x22')]?_[_0x2054('0x23')](_0x4e04ee[_0x2054('0x1f')]['include'],function(_0x65ed0c){return{'model':db[_0x65ed0c['model']],'as':_0x65ed0c['as'],'attributes':_0x65ed0c['attributes'],'include':_0x65ed0c[_0x2054('0x22')]?_[_0x2054('0x23')](_0x65ed0c[_0x2054('0x22')],function(_0xae86e4){return{'model':db[_0xae86e4['model']],'as':_0xae86e4['as'],'attributes':_0xae86e4[_0x2054('0x24')],'include':_0xae86e4[_0x2054('0x22')]?_['map'](_0xae86e4['include'],function(_0x3379c7){return{'model':db[_0x3379c7[_0x2054('0x25')]],'as':_0x3379c7['as'],'attributes':_0x3379c7[_0x2054('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2054('0x26')](function(_0x20bb9a){logger[_0x2054('0x1a')]('GetVoiceQueue',_0x4e04ee);logger['debug'](_0x2054('0x1c'),_0x4e04ee,JSON[_0x2054('0x16')](_0x20bb9a));_0x4c7545(_0x20bb9a);})['catch'](function(_0x3f7f6b){logger[_0x2054('0x17')](_0x2054('0x1c'),_0x3f7f6b[_0x2054('0x19')],_0x4e04ee);_0x5247de(_0x77dc79[_0x2054('0x17')](0x1f4,_0x3f7f6b['message']));});});};exports[_0x2054('0x27')]=function(_0xff21e5){var _0x2fd3ae=this;return new Promise(function(_0x573c94,_0x2a2b9e){return db[_0x2054('0x1d')]['find']({'raw':_0xff21e5[_0x2054('0x1f')]?_0xff21e5[_0x2054('0x1f')][_0x2054('0x28')]===undefined?!![]:![]:!![],'where':_0xff21e5[_0x2054('0x1f')]?_0xff21e5[_0x2054('0x1f')][_0x2054('0x20')]||null:null,'attributes':_0xff21e5[_0x2054('0x1f')]?_0xff21e5[_0x2054('0x1f')]['attributes']||null:null,'include':_0xff21e5[_0x2054('0x1f')]?_0xff21e5[_0x2054('0x1f')]['include']?_[_0x2054('0x23')](_0xff21e5[_0x2054('0x1f')][_0x2054('0x22')],function(_0x438bfe){return{'model':db[_0x438bfe['model']],'as':_0x438bfe['as'],'attributes':_0x438bfe[_0x2054('0x24')],'include':_0x438bfe[_0x2054('0x22')]?_[_0x2054('0x23')](_0x438bfe[_0x2054('0x22')],function(_0x46dd65){return{'model':db[_0x46dd65[_0x2054('0x25')]],'as':_0x46dd65['as'],'attributes':_0x46dd65[_0x2054('0x24')],'include':_0x46dd65[_0x2054('0x22')]?_['map'](_0x46dd65[_0x2054('0x22')],function(_0x69c268){return{'model':db[_0x69c268['model']],'as':_0x69c268['as'],'attributes':_0x69c268[_0x2054('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2054('0x26')](function(_0x4c2a6d){logger[_0x2054('0x1a')](_0x2054('0x27'),_0xff21e5);logger[_0x2054('0x13')](_0x2054('0x27'),_0xff21e5,JSON['stringify'](_0x4c2a6d));_0x573c94(_0x4c2a6d);})['catch'](function(_0x383ee0){logger[_0x2054('0x17')]('ShowVoiceQueue',_0x383ee0[_0x2054('0x19')],_0xff21e5);_0x2a2b9e(_0x2fd3ae[_0x2054('0x17')](0x1f4,_0x383ee0[_0x2054('0x19')]));});});}; \ No newline at end of file +var _0xc337=['model','stringify','catch','ShowVoiceQueue','VoiceQueue','find','lodash','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x49b076,_0x4fb74e){var _0xa3609=function(_0x474e71){while(--_0x474e71){_0x49b076['push'](_0x49b076['shift']());}};_0xa3609(++_0x4fb74e);}(_0xc337,0x1b6));var _0x7c33=function(_0x3246e0,_0x399283){_0x3246e0=_0x3246e0-0x0;var _0x325ac1=_0xc337[_0x3246e0];return _0x325ac1;};'use strict';var _=require(_0x7c33('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c33('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c33('0x2'));var logger=require(_0x7c33('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c33('0x4'));var client=jayson[_0x7c33('0x5')][_0x7c33('0x6')]({'port':0x232a});config[_0x7c33('0x7')]=_[_0x7c33('0x8')](config[_0x7c33('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7c33('0x9'))[_0x7c33('0xa')](socket);function respondWithRpcPromise(_0x11e7b2,_0x4a7cb8,_0x1de302){return new BPromise(function(_0x282ee0,_0x2a81e1){return client[_0x7c33('0xb')](_0x11e7b2,_0x1de302)[_0x7c33('0xc')](function(_0x5b54ab){logger[_0x7c33('0xd')](_0x7c33('0xe'),_0x4a7cb8,'request\x20sent');logger[_0x7c33('0xf')](_0x7c33('0x10'),_0x4a7cb8,_0x7c33('0x11'),JSON['stringify'](_0x5b54ab));if(_0x5b54ab[_0x7c33('0x12')]){if(_0x5b54ab[_0x7c33('0x12')]['code']===0x1f4){logger[_0x7c33('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x4a7cb8,_0x5b54ab[_0x7c33('0x12')]['message']);return _0x2a81e1(_0x5b54ab[_0x7c33('0x12')][_0x7c33('0x13')]);}logger[_0x7c33('0x12')](_0x7c33('0xe'),_0x4a7cb8,_0x5b54ab[_0x7c33('0x12')][_0x7c33('0x13')]);return _0x282ee0(_0x5b54ab['error'][_0x7c33('0x13')]);}else{logger[_0x7c33('0xd')](_0x7c33('0xe'),_0x4a7cb8,_0x7c33('0x11'));_0x282ee0(_0x5b54ab[_0x7c33('0x14')][_0x7c33('0x13')]);}})['catch'](function(_0xa5c709){logger[_0x7c33('0x12')](_0x7c33('0xe'),_0x4a7cb8,_0xa5c709);_0x2a81e1(_0xa5c709);});});}exports[_0x7c33('0x15')]=function(_0x4da8c3){var _0x201c55=this;return new Promise(function(_0x5d622e,_0x3f082f){return db['VoiceQueue'][_0x7c33('0x16')]({'raw':_0x4da8c3[_0x7c33('0x17')]?_0x4da8c3[_0x7c33('0x17')][_0x7c33('0x18')]===undefined?!![]:![]:!![],'where':_0x4da8c3[_0x7c33('0x17')]?_0x4da8c3[_0x7c33('0x17')][_0x7c33('0x19')]||null:null,'attributes':_0x4da8c3[_0x7c33('0x17')]?_0x4da8c3['options'][_0x7c33('0x1a')]||null:null,'limit':_0x4da8c3[_0x7c33('0x17')]?_0x4da8c3['options'][_0x7c33('0x1b')]||null:null,'include':_0x4da8c3['options']?_0x4da8c3['options'][_0x7c33('0x1c')]?_[_0x7c33('0x1d')](_0x4da8c3[_0x7c33('0x17')]['include'],function(_0x3aabe9){return{'model':db[_0x3aabe9['model']],'as':_0x3aabe9['as'],'attributes':_0x3aabe9['attributes'],'include':_0x3aabe9[_0x7c33('0x1c')]?_['map'](_0x3aabe9[_0x7c33('0x1c')],function(_0x45fff3){return{'model':db[_0x45fff3[_0x7c33('0x1e')]],'as':_0x45fff3['as'],'attributes':_0x45fff3[_0x7c33('0x1a')],'include':_0x45fff3['include']?_['map'](_0x45fff3[_0x7c33('0x1c')],function(_0x2bcf58){return{'model':db[_0x2bcf58[_0x7c33('0x1e')]],'as':_0x2bcf58['as'],'attributes':_0x2bcf58['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c33('0xc')](function(_0x1f277e){logger[_0x7c33('0xd')](_0x7c33('0x15'),_0x4da8c3);logger[_0x7c33('0xf')](_0x7c33('0x15'),_0x4da8c3,JSON[_0x7c33('0x1f')](_0x1f277e));_0x5d622e(_0x1f277e);})[_0x7c33('0x20')](function(_0x45ef86){logger[_0x7c33('0x12')]('GetVoiceQueue',_0x45ef86[_0x7c33('0x13')],_0x4da8c3);_0x3f082f(_0x201c55['error'](0x1f4,_0x45ef86[_0x7c33('0x13')]));});});};exports[_0x7c33('0x21')]=function(_0x2191bf){var _0x56d4fe=this;return new Promise(function(_0x548be5,_0x3efc8d){return db[_0x7c33('0x22')][_0x7c33('0x23')]({'raw':_0x2191bf[_0x7c33('0x17')]?_0x2191bf[_0x7c33('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2191bf[_0x7c33('0x17')]?_0x2191bf[_0x7c33('0x17')][_0x7c33('0x19')]||null:null,'attributes':_0x2191bf[_0x7c33('0x17')]?_0x2191bf[_0x7c33('0x17')][_0x7c33('0x1a')]||null:null,'include':_0x2191bf[_0x7c33('0x17')]?_0x2191bf[_0x7c33('0x17')][_0x7c33('0x1c')]?_['map'](_0x2191bf[_0x7c33('0x17')][_0x7c33('0x1c')],function(_0x39e260){return{'model':db[_0x39e260[_0x7c33('0x1e')]],'as':_0x39e260['as'],'attributes':_0x39e260['attributes'],'include':_0x39e260['include']?_[_0x7c33('0x1d')](_0x39e260[_0x7c33('0x1c')],function(_0x214cbb){return{'model':db[_0x214cbb[_0x7c33('0x1e')]],'as':_0x214cbb['as'],'attributes':_0x214cbb[_0x7c33('0x1a')],'include':_0x214cbb[_0x7c33('0x1c')]?_[_0x7c33('0x1d')](_0x214cbb[_0x7c33('0x1c')],function(_0x318af5){return{'model':db[_0x318af5[_0x7c33('0x1e')]],'as':_0x318af5['as'],'attributes':_0x318af5[_0x7c33('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7c33('0xc')](function(_0x226cdf){logger['info'](_0x7c33('0x21'),_0x2191bf);logger[_0x7c33('0xf')]('ShowVoiceQueue',_0x2191bf,JSON[_0x7c33('0x1f')](_0x226cdf));_0x548be5(_0x226cdf);})['catch'](function(_0x49e15c){logger['error'](_0x7c33('0x21'),_0x49e15c['message'],_0x2191bf);_0x3efc8d(_0x56d4fe['error'](0x1f4,_0x49e15c[_0x7c33('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index a013fdd..cbd1748 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 _0x7d4b=['voiceQueue:','./voiceQueue.events','save','update','register','length'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7d4b,0x12d));var _0xb7d4=function(_0x2c81c4,_0x4f3ff6){_0x2c81c4=_0x2c81c4-0x0;var _0x177eb7=_0x7d4b[_0x2c81c4];return _0x177eb7;};'use strict';var VoiceQueueEvents=require(_0xb7d4('0x0'));var events=[_0xb7d4('0x1'),'remove',_0xb7d4('0x2')];function createListener(_0x1d2cd2,_0x5bda9b){return function(_0x5346c2){_0x5bda9b['emit'](_0x1d2cd2,_0x5346c2);};}function removeListener(_0x3e4fb6,_0x1c012c){return function(){VoiceQueueEvents['removeListener'](_0x3e4fb6,_0x1c012c);};}exports[_0xb7d4('0x3')]=function(_0x54c387){for(var _0x54d5b3=0x0,_0x368487=events[_0xb7d4('0x4')];_0x54d5b3<_0x368487;_0x54d5b3++){var _0x935a6c=events[_0x54d5b3];var _0x3d9ad4=createListener(_0xb7d4('0x5')+_0x935a6c,_0x54c387);VoiceQueueEvents['on'](_0x935a6c,_0x3d9ad4);}}; \ No newline at end of file +var _0xabc5=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x189282,_0x50281e){var _0x9cd42a=function(_0x335537){while(--_0x335537){_0x189282['push'](_0x189282['shift']());}};_0x9cd42a(++_0x50281e);}(_0xabc5,0x1db));var _0x5abc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xabc5[_0x2dafbe];return _0x58a45a;};'use strict';var VoiceQueueEvents=require(_0x5abc('0x0'));var events=[_0x5abc('0x1'),_0x5abc('0x2'),_0x5abc('0x3')];function createListener(_0x354024,_0x444978){return function(_0x5b03cc){_0x444978[_0x5abc('0x4')](_0x354024,_0x5b03cc);};}function removeListener(_0x4a38d6,_0x228198){return function(){VoiceQueueEvents['removeListener'](_0x4a38d6,_0x228198);};}exports[_0x5abc('0x5')]=function(_0x1d1a14){for(var _0x3247f8=0x0,_0x3183fc=events[_0x5abc('0x6')];_0x3247f8<_0x3183fc;_0x3247f8++){var _0x12dbe8=events[_0x3247f8];var _0x51f5a2=createListener(_0x5abc('0x7')+_0x12dbe8,_0x1d1a14);VoiceQueueEvents['on'](_0x12dbe8,_0x51f5a2);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index ae5b1a7..44d228a 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 _0x9536=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','getVoiceQueuesReport','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x187454,_0x69cd05){var _0x4a203a=function(_0x157324){while(--_0x157324){_0x187454['push'](_0x187454['shift']());}};_0x4a203a(++_0x69cd05);}(_0x9536,0x179));var _0x6953=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x9536[_0x425716];return _0x2d39af;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6953('0x5'));var config=require(_0x6953('0x6'));var controller=require(_0x6953('0x7'));router[_0x6953('0x8')]('/',auth[_0x6953('0x9')](),controller['index']);router[_0x6953('0x8')](_0x6953('0xa'),auth[_0x6953('0x9')](),controller[_0x6953('0xb')]);router[_0x6953('0x8')]('/index',auth[_0x6953('0x9')](),controller[_0x6953('0xc')]);router[_0x6953('0x8')]('/:id',auth[_0x6953('0x9')](),controller[_0x6953('0xd')]);router[_0x6953('0xe')]('/',auth[_0x6953('0x9')](),controller[_0x6953('0xf')]);router[_0x6953('0x10')](_0x6953('0x11'),auth[_0x6953('0x9')](),controller[_0x6953('0x12')]);router['delete'](_0x6953('0x11'),auth['isAuthenticated'](),controller[_0x6953('0x13')]);module[_0x6953('0x14')]=router; \ No newline at end of file +var _0x126e=['isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get'];(function(_0x5f56cd,_0x43bda5){var _0x1bb528=function(_0x373bb6){while(--_0x373bb6){_0x5f56cd['push'](_0x5f56cd['shift']());}};_0x1bb528(++_0x43bda5);}(_0x126e,0x108));var _0xe126=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x126e[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require('multer');var util=require(_0xe126('0x0'));var path=require(_0xe126('0x1'));var timeout=require(_0xe126('0x2'));var express=require(_0xe126('0x3'));var router=express[_0xe126('0x4')]();var auth=require(_0xe126('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe126('0x6'));var controller=require(_0xe126('0x7'));router[_0xe126('0x8')]('/',auth[_0xe126('0x9')](),controller[_0xe126('0xa')]);router[_0xe126('0x8')](_0xe126('0xb'),auth['isAuthenticated'](),controller[_0xe126('0xc')]);router[_0xe126('0x8')](_0xe126('0xd'),auth[_0xe126('0x9')](),controller[_0xe126('0xe')]);router['get'](_0xe126('0xf'),auth[_0xe126('0x9')](),controller['show']);router[_0xe126('0x10')]('/',auth[_0xe126('0x9')](),controller['create']);router[_0xe126('0x11')]('/:id',auth[_0xe126('0x9')](),controller['update']);router[_0xe126('0x12')](_0xe126('0xf'),auth[_0xe126('0x9')](),controller[_0xe126('0x13')]);module[_0xe126('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ec3012c..2c76990 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 _0xf2b7=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x4b53c5,_0x11cfee){var _0x5c7638=function(_0x5690bf){while(--_0x5690bf){_0x4b53c5['push'](_0x4b53c5['shift']());}};_0x5c7638(++_0x11cfee);}(_0xf2b7,0x82));var _0x7f2b=function(_0x2d14b0,_0x362cb4){_0x2d14b0=_0x2d14b0-0x0;var _0x4395ac=_0xf2b7[_0x2d14b0];return _0x4395ac;};'use strict';var Sequelize=require(_0x7f2b('0x0'));var moment=require(_0x7f2b('0x1'));module['exports']={'type':{'type':Sequelize[_0x7f2b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7f2b('0x2')]},'calleridname':{'type':Sequelize[_0x7f2b('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x7f2b('0x3')],'set':function(_0x2854d4){var _0x3f90fc=moment(_0x2854d4);var _0x2eedc0=moment(this[_0x7f2b('0x4')](_0x7f2b('0x5')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x8f9391=_0x3f90fc['diff'](_0x2eedc0,_0x7f2b('0x6'));this[_0x7f2b('0x7')](_0x7f2b('0x8'),_0x2854d4);this[_0x7f2b('0x7')](_0x7f2b('0x9'),_0x8f9391||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x7f2b('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x7f2b('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7f2b('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x7f2b('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7f2b('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x7f2b('0x2')],'comment':_0x7f2b('0xc')},'originalposition':{'type':Sequelize[_0x7f2b('0xa')]},'channel':{'type':Sequelize[_0x7f2b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7f2b('0x2')]},'connectedlinename':{'type':Sequelize[_0x7f2b('0x2')]},'accountcode':{'type':Sequelize[_0x7f2b('0x2')]},'context':{'type':Sequelize[_0x7f2b('0x2')]},'exten':{'type':Sequelize[_0x7f2b('0x2')]},'priority':{'type':Sequelize[_0x7f2b('0x2')]},'holdtime':{'type':Sequelize[_0x7f2b('0xa')]},'mohtime':{'type':Sequelize[_0x7f2b('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7f2b('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7f2b('0x2')]},'transfer':{'type':Sequelize[_0x7f2b('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7f2b('0x2')],'comment':_0x7f2b('0xd')},'transferexten':{'type':Sequelize[_0x7f2b('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x7f2b('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x7f2b('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfa7e=['setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds'];(function(_0x28cb57,_0x50fe28){var _0xa39e88=function(_0x55e2ea){while(--_0x55e2ea){_0x28cb57['push'](_0x28cb57['shift']());}};_0xa39e88(++_0x50fe28);}(_0xfa7e,0xfc));var _0xefa7=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xfa7e[_0x1992f1];return _0x413dfe;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xefa7('0x0'));module['exports']={'type':{'type':Sequelize[_0xefa7('0x1')]},'uniqueid':{'type':Sequelize[_0xefa7('0x1')]},'calleridnum':{'type':Sequelize[_0xefa7('0x1')]},'calleridname':{'type':Sequelize[_0xefa7('0x1')]},'queue':{'type':Sequelize[_0xefa7('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xefa7('0x2')],'set':function(_0x111bf5){var _0x6b6cd5=moment(_0x111bf5);var _0x3b9b84=moment(this[_0xefa7('0x3')](_0xefa7('0x4')))[_0xefa7('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x519e65=_0x6b6cd5[_0xefa7('0x6')](_0x3b9b84,_0xefa7('0x7'));this[_0xefa7('0x8')]('queuecallerleaveAt',_0x111bf5);this[_0xefa7('0x8')](_0xefa7('0x9'),_0x519e65||null);}},'position':{'type':Sequelize[_0xefa7('0xa')]},'count':{'type':Sequelize[_0xefa7('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xefa7('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xefa7('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xefa7('0x2')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xefa7('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xefa7('0x1')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xefa7('0xa')]},'channel':{'type':Sequelize[_0xefa7('0x1')]},'connectedlinenum':{'type':Sequelize[_0xefa7('0x1')]},'connectedlinename':{'type':Sequelize[_0xefa7('0x1')]},'accountcode':{'type':Sequelize[_0xefa7('0x1')]},'context':{'type':Sequelize[_0xefa7('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xefa7('0x1')]},'holdtime':{'type':Sequelize[_0xefa7('0xa')]},'mohtime':{'type':Sequelize[_0xefa7('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xefa7('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xefa7('0x1')]},'transfer':{'type':Sequelize[_0xefa7('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xefa7('0x1')],'comment':_0xefa7('0xc')},'transferexten':{'type':Sequelize[_0xefa7('0x1')]},'transferuniqueid':{'type':Sequelize[_0xefa7('0x1')]},'disposition':{'type':Sequelize[_0xefa7('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xefa7('0xa')],'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 6401985..765f58c 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 _0x5fab=['sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','status','count','offset','limit','set','json','reject','then','end','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','merge','options','find','create','body','update','destroy','describe','getVoiceQueuesReport','filter','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5917af,_0x5b14b){var _0x263b6d=function(_0x516968){while(--_0x516968){_0x5917af['push'](_0x5917af['shift']());}};_0x263b6d(++_0x5b14b);}(_0x5fab,0x177));var _0xb5fa=function(_0x3b1502,_0xa23e9d){_0x3b1502=_0x3b1502-0x0;var _0x1c8537=_0x5fab[_0x3b1502];return _0x1c8537;};'use strict';var pdf=require(_0xb5fa('0x0'));var emlformat=require(_0xb5fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5fa('0x2'));var jsonpatch=require(_0xb5fa('0x3'));var rp=require(_0xb5fa('0x4'));var moment=require(_0xb5fa('0x5'));var BPromise=require(_0xb5fa('0x6'));var Mustache=require(_0xb5fa('0x7'));var util=require(_0xb5fa('0x8'));var path=require(_0xb5fa('0x9'));var sox=require(_0xb5fa('0xa'));var csv=require(_0xb5fa('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xb'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var db=require(_0xb5fa('0x18'))['db'];config[_0xb5fa('0x19')]=_['defaults'](config[_0xb5fa('0x19')],{'host':_0xb5fa('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5fa('0x19')]));require('./voiceQueueReport.socket')[_0xb5fa('0x1b')](socket);function respondWithStatusCode(_0x3fc372,_0x40c914){_0x40c914=_0x40c914||0xcc;return function(_0xca8d82){if(_0xca8d82){return _0x3fc372[_0xb5fa('0x1c')](_0x40c914);}return _0x3fc372['status'](_0x40c914)['end']();};}function respondWithResult(_0x38e964,_0x587043){_0x587043=_0x587043||0xc8;return function(_0x31f252){if(_0x31f252){return _0x38e964[_0xb5fa('0x1d')](_0x587043)['json'](_0x31f252);}};}function respondWithFilteredResult(_0x4fabcc,_0x451a55){return function(_0x1f7f05){if(_0x1f7f05){var _0x32e9e5=_0x1f7f05[_0xb5fa('0x1e')],_0x46eef0=_0x451a55[_0xb5fa('0x1f')],_0x324ba5=_0x451a55[_0xb5fa('0x1f')]+_0x451a55[_0xb5fa('0x20')],_0x13e82b;if(_0x324ba5>=_0x32e9e5){_0x324ba5=_0x32e9e5;_0x13e82b=0xc8;}else{_0x13e82b=0xce;}_0x4fabcc[_0xb5fa('0x1d')](_0x13e82b);return _0x4fabcc[_0xb5fa('0x21')]('Content-Range',_0x46eef0+'-'+_0x324ba5+'/'+_0x32e9e5)[_0xb5fa('0x22')](_0x1f7f05);}return null;};}function patchUpdates(_0x519e20){return function(_0x37ae06){try{jsonpatch['apply'](_0x37ae06,_0x519e20,!![]);}catch(_0xd0fe2b){return BPromise[_0xb5fa('0x23')](_0xd0fe2b);}return _0x37ae06['save']();};}function saveUpdates(_0x40dfdf,_0x3a2ab9){return function(_0x283a56){if(_0x283a56){return _0x283a56['update'](_0x40dfdf)[_0xb5fa('0x24')](function(_0xec108f){return _0xec108f;});}return null;};}function removeEntity(_0x444237,_0x542348){return function(_0x224ec8){if(_0x224ec8){return _0x224ec8['destroy']()[_0xb5fa('0x24')](function(){_0x444237[_0xb5fa('0x1d')](0xcc)[_0xb5fa('0x25')]();});}};}function handleEntityNotFound(_0x543edf,_0x2dbd22){return function(_0x3f61cd){if(!_0x3f61cd){_0x543edf[_0xb5fa('0x1c')](0x194);}return _0x3f61cd;};}function handleError(_0x20d649,_0x568870){_0x568870=_0x568870||0x1f4;return function(_0x4ec294){logger['error'](_0x4ec294['stack']);if(_0x4ec294[_0xb5fa('0x26')]){delete _0x4ec294[_0xb5fa('0x26')];}_0x20d649[_0xb5fa('0x1d')](_0x568870)[_0xb5fa('0x27')](_0x4ec294);};}exports[_0xb5fa('0x28')]=function(_0x3506a4,_0x358549){var _0x353314={},_0x409af9={},_0x2a5690={'count':0x0,'rows':[]};var _0x142bfa=_[_0xb5fa('0x29')](db[_0xb5fa('0x2a')][_0xb5fa('0x2b')],function(_0xed02e){return{'name':_0xed02e[_0xb5fa('0x2c')],'type':_0xed02e[_0xb5fa('0x2d')][_0xb5fa('0x2e')]};});_0x409af9[_0xb5fa('0x2f')]=_[_0xb5fa('0x29')](_0x142bfa,_0xb5fa('0x26'));_0x409af9[_0xb5fa('0x30')]=_[_0xb5fa('0x31')](_0x3506a4[_0xb5fa('0x30')]);_0x409af9['filters']=_[_0xb5fa('0x32')](_0x409af9['model'],_0x409af9['query']);_0x353314['attributes']=_[_0xb5fa('0x32')](_0x409af9['model'],qs[_0xb5fa('0x33')](_0x3506a4['query']['fields']));_0x353314[_0xb5fa('0x34')]=_0x353314[_0xb5fa('0x34')]['length']?_0x353314['attributes']:_0x409af9[_0xb5fa('0x2f')];if(!_0x3506a4[_0xb5fa('0x30')][_0xb5fa('0x35')]('nolimit')){_0x353314[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0x3506a4['query'][_0xb5fa('0x20')]);_0x353314[_0xb5fa('0x1f')]=qs[_0xb5fa('0x1f')](_0x3506a4['query'][_0xb5fa('0x1f')]);}_0x353314[_0xb5fa('0x36')]=qs[_0xb5fa('0x37')](_0x3506a4['query'][_0xb5fa('0x37')]);_0x353314[_0xb5fa('0x38')]=qs[_0xb5fa('0x39')](_[_0xb5fa('0x3a')](_0x3506a4['query'],_0x409af9['filters']));if(_0x3506a4['query']['filter']){_0x353314['where']=_['merge'](_0x353314[_0xb5fa('0x38')],{'$or':_['map'](_0x142bfa,function(_0x43de71){if(_0x43de71[_0xb5fa('0x2d')]!==_0xb5fa('0x3b')){var _0x30b288={};_0x30b288[_0x43de71[_0xb5fa('0x26')]]={'$like':'%'+_0x3506a4[_0xb5fa('0x30')]['filter']+'%'};return _0x30b288;}})});}_0x353314=_['merge']({},_0x353314,_0x3506a4['options']);var _0x534b38={'where':_0x353314['where']};return db[_0xb5fa('0x2a')]['count'](_0x534b38)['then'](function(_0x3cdf63){_0x2a5690[_0xb5fa('0x1e')]=_0x3cdf63;if(_0x3506a4[_0xb5fa('0x30')][_0xb5fa('0x3c')]){_0x353314[_0xb5fa('0x3d')]=[{'all':!![]}];}return db[_0xb5fa('0x2a')][_0xb5fa('0x3e')](_0x353314);})[_0xb5fa('0x24')](function(_0x19e370){_0x2a5690[_0xb5fa('0x3f')]=_0x19e370;return _0x2a5690;})['then'](respondWithFilteredResult(_0x358549,_0x353314))[_0xb5fa('0x40')](handleError(_0x358549,null));};exports['show']=function(_0x233f90,_0x39aac3){var _0x2c7c5f={'raw':![],'where':{'id':_0x233f90[_0xb5fa('0x41')]['id']}},_0x2ef359={};_0x2ef359[_0xb5fa('0x2f')]=_[_0xb5fa('0x31')](db[_0xb5fa('0x2a')]['rawAttributes']);_0x2ef359[_0xb5fa('0x30')]=_[_0xb5fa('0x31')](_0x233f90['query']);_0x2ef359[_0xb5fa('0x39')]=_['intersection'](_0x2ef359[_0xb5fa('0x2f')],_0x2ef359[_0xb5fa('0x30')]);_0x2c7c5f['attributes']=_['intersection'](_0x2ef359[_0xb5fa('0x2f')],qs[_0xb5fa('0x33')](_0x233f90[_0xb5fa('0x30')][_0xb5fa('0x33')]));_0x2c7c5f[_0xb5fa('0x34')]=_0x2c7c5f[_0xb5fa('0x34')][_0xb5fa('0x42')]?_0x2c7c5f[_0xb5fa('0x34')]:_0x2ef359['model'];if(_0x233f90[_0xb5fa('0x30')][_0xb5fa('0x3c')]){_0x2c7c5f['include']=[{'all':!![]}];}_0x2c7c5f=_[_0xb5fa('0x43')]({},_0x2c7c5f,_0x233f90[_0xb5fa('0x44')]);return db[_0xb5fa('0x2a')][_0xb5fa('0x45')](_0x2c7c5f)[_0xb5fa('0x24')](handleEntityNotFound(_0x39aac3,null))[_0xb5fa('0x24')](respondWithResult(_0x39aac3,null))[_0xb5fa('0x40')](handleError(_0x39aac3,null));};exports[_0xb5fa('0x46')]=function(_0x20f5f5,_0x464e36){return db[_0xb5fa('0x2a')][_0xb5fa('0x46')](_0x20f5f5[_0xb5fa('0x47')],{})[_0xb5fa('0x24')](respondWithResult(_0x464e36,0xc9))[_0xb5fa('0x40')](handleError(_0x464e36,null));};exports[_0xb5fa('0x48')]=function(_0x52f5d8,_0x56dceb){if(_0x52f5d8[_0xb5fa('0x47')]['id']){delete _0x52f5d8['body']['id'];}return db[_0xb5fa('0x2a')][_0xb5fa('0x45')]({'where':{'id':_0x52f5d8['params']['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x56dceb,null))[_0xb5fa('0x24')](saveUpdates(_0x52f5d8[_0xb5fa('0x47')],null))[_0xb5fa('0x24')](respondWithResult(_0x56dceb,null))[_0xb5fa('0x40')](handleError(_0x56dceb,null));};exports[_0xb5fa('0x49')]=function(_0x51d5f7,_0x27a651){return db['VoiceQueueReport'][_0xb5fa('0x45')]({'where':{'id':_0x51d5f7[_0xb5fa('0x41')]['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x27a651,null))['then'](removeEntity(_0x27a651,null))[_0xb5fa('0x40')](handleError(_0x27a651,null));};exports[_0xb5fa('0x4a')]=function(_0x4dea87,_0x4f6ffa){return db[_0xb5fa('0x2a')][_0xb5fa('0x4a')]()[_0xb5fa('0x24')](respondWithResult(_0x4f6ffa,null))[_0xb5fa('0x40')](handleError(_0x4f6ffa,null));};exports[_0xb5fa('0x4b')]=function(_0x7775b4,_0x31c91f){var _0x3b092a={},_0x1c1f1b={},_0x1578e6={'count':0x0,'rows':[]};_0x1c1f1b[_0xb5fa('0x2f')]=_[_0xb5fa('0x31')](db[_0xb5fa('0x2a')][_0xb5fa('0x2b')]);_0x1c1f1b[_0xb5fa('0x30')]=_[_0xb5fa('0x31')](_0x7775b4[_0xb5fa('0x30')]);_0x1c1f1b[_0xb5fa('0x39')]=_['intersection'](_0x1c1f1b[_0xb5fa('0x2f')],_0x1c1f1b[_0xb5fa('0x30')]);_0x3b092a[_0xb5fa('0x34')]=_[_0xb5fa('0x32')](_0x1c1f1b[_0xb5fa('0x2f')],qs[_0xb5fa('0x33')](_0x7775b4[_0xb5fa('0x30')][_0xb5fa('0x33')]));_0x3b092a[_0xb5fa('0x34')]=_0x3b092a[_0xb5fa('0x34')]['length']?_0x3b092a['attributes']:_0x1c1f1b[_0xb5fa('0x2f')];if(!_0x7775b4[_0xb5fa('0x30')][_0xb5fa('0x35')]('nolimit')){_0x3b092a[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0x7775b4[_0xb5fa('0x30')][_0xb5fa('0x20')]);_0x3b092a[_0xb5fa('0x1f')]=qs[_0xb5fa('0x1f')](_0x7775b4[_0xb5fa('0x30')]['offset']);}_0x3b092a[_0xb5fa('0x36')]=qs[_0xb5fa('0x37')](_0x7775b4['query'][_0xb5fa('0x37')]);_0x3b092a[_0xb5fa('0x38')]=qs['filters'](_[_0xb5fa('0x3a')](_0x7775b4[_0xb5fa('0x30')],_0x1c1f1b[_0xb5fa('0x39')]));if(_0x7775b4[_0xb5fa('0x30')][_0xb5fa('0x4c')]){_0x3b092a[_0xb5fa('0x38')]=_[_0xb5fa('0x43')](_0x3b092a[_0xb5fa('0x38')],{'$or':_[_0xb5fa('0x29')](_0x3b092a[_0xb5fa('0x34')],function(_0xfb88cc){var _0x3caf48={};_0x3caf48[_0xfb88cc]={'$like':'%'+_0x7775b4[_0xb5fa('0x30')][_0xb5fa('0x4c')]+'%'};return _0x3caf48;})});}_0x3b092a=_[_0xb5fa('0x43')]({},_0x3b092a,_0x7775b4[_0xb5fa('0x44')]);var _0x41cce9={'where':_0x3b092a[_0xb5fa('0x38')]};return db[_0xb5fa('0x2a')][_0xb5fa('0x1e')](_0x41cce9)[_0xb5fa('0x24')](function(_0x36fc0f){_0x1578e6['count']=_0x36fc0f;if(_0x7775b4[_0xb5fa('0x30')][_0xb5fa('0x3c')]){_0x3b092a[_0xb5fa('0x3d')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xb5fa('0x3e')](_0x3b092a);})[_0xb5fa('0x24')](function(_0x58d394){_0x1578e6[_0xb5fa('0x3f')]=_0x58d394;return _0x1578e6;})[_0xb5fa('0x24')](respondWithFilteredResult(_0x31c91f,_0x3b092a,_0xb5fa('0x4b')))['catch'](handleError(_0x31c91f,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x53ec=['query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','count','include','catch','params','includeAll','options','find','create','body','destroy','getVoiceQueuesReport','findAll','rows','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','redis','defaults','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','name','index','map','VoiceQueueReport','rawAttributes','type','key','model','keys'];(function(_0x308fb2,_0x5f4ad3){var _0x43fdf3=function(_0x412c07){while(--_0x412c07){_0x308fb2['push'](_0x308fb2['shift']());}};_0x43fdf3(++_0x5f4ad3);}(_0x53ec,0x192));var _0xc53e=function(_0x3f3f40,_0x4e745f){_0x3f3f40=_0x3f3f40-0x0;var _0x32c366=_0x53ec[_0x3f3f40];return _0x32c366;};'use strict';var pdf=require(_0xc53e('0x0'));var emlformat=require(_0xc53e('0x1'));var rimraf=require(_0xc53e('0x2'));var zipdir=require(_0xc53e('0x3'));var jsonpatch=require(_0xc53e('0x4'));var rp=require(_0xc53e('0x5'));var moment=require('moment');var BPromise=require(_0xc53e('0x6'));var Mustache=require('mustache');var util=require(_0xc53e('0x7'));var path=require(_0xc53e('0x8'));var sox=require('sox');var csv=require(_0xc53e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0x9'));var querystring=require(_0xc53e('0xe'));var Papa=require(_0xc53e('0xf'));var Redis=require(_0xc53e('0x10'));var authService=require(_0xc53e('0x11'));var qs=require(_0xc53e('0x12'));var as=require(_0xc53e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc53e('0x15'))['db'];config[_0xc53e('0x16')]=_[_0xc53e('0x17')](config[_0xc53e('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc53e('0x16')]));require(_0xc53e('0x18'))[_0xc53e('0x19')](socket);function respondWithStatusCode(_0x3d2e17,_0x358ef3){_0x358ef3=_0x358ef3||0xcc;return function(_0x382e87){if(_0x382e87){return _0x3d2e17[_0xc53e('0x1a')](_0x358ef3);}return _0x3d2e17[_0xc53e('0x1b')](_0x358ef3)[_0xc53e('0x1c')]();};}function respondWithResult(_0x2ad6eb,_0x5b0a88){_0x5b0a88=_0x5b0a88||0xc8;return function(_0x8a522e){if(_0x8a522e){return _0x2ad6eb[_0xc53e('0x1b')](_0x5b0a88)[_0xc53e('0x1d')](_0x8a522e);}};}function respondWithFilteredResult(_0x261c6c,_0x15333b){return function(_0x270c78){if(_0x270c78){var _0x164016=_0x270c78['count'],_0x2d4ebb=_0x15333b[_0xc53e('0x1e')],_0x3b550e=_0x15333b[_0xc53e('0x1e')]+_0x15333b[_0xc53e('0x1f')],_0x5d1098;if(_0x3b550e>=_0x164016){_0x3b550e=_0x164016;_0x5d1098=0xc8;}else{_0x5d1098=0xce;}_0x261c6c[_0xc53e('0x1b')](_0x5d1098);return _0x261c6c[_0xc53e('0x20')](_0xc53e('0x21'),_0x2d4ebb+'-'+_0x3b550e+'/'+_0x164016)[_0xc53e('0x1d')](_0x270c78);}return null;};}function patchUpdates(_0x25702b){return function(_0x364c80){try{jsonpatch[_0xc53e('0x22')](_0x364c80,_0x25702b,!![]);}catch(_0x17d825){return BPromise[_0xc53e('0x23')](_0x17d825);}return _0x364c80[_0xc53e('0x24')]();};}function saveUpdates(_0x4fb695,_0x47cfdd){return function(_0x531ede){if(_0x531ede){return _0x531ede[_0xc53e('0x25')](_0x4fb695)[_0xc53e('0x26')](function(_0x7591c1){return _0x7591c1;});}return null;};}function removeEntity(_0x4015c8,_0x180811){return function(_0x5009e1){if(_0x5009e1){return _0x5009e1['destroy']()[_0xc53e('0x26')](function(){_0x4015c8['status'](0xcc)[_0xc53e('0x1c')]();});}};}function handleEntityNotFound(_0x3a5ce8,_0x443179){return function(_0x1166e6){if(!_0x1166e6){_0x3a5ce8[_0xc53e('0x1a')](0x194);}return _0x1166e6;};}function handleError(_0x4df8cf,_0x398e7a){_0x398e7a=_0x398e7a||0x1f4;return function(_0x4b9f6a){logger['error'](_0x4b9f6a['stack']);if(_0x4b9f6a[_0xc53e('0x27')]){delete _0x4b9f6a['name'];}_0x4df8cf[_0xc53e('0x1b')](_0x398e7a)['send'](_0x4b9f6a);};}exports[_0xc53e('0x28')]=function(_0x5112d2,_0x5ce216){var _0x8f0ee6={},_0x6a62b0={},_0x42dec1={'count':0x0,'rows':[]};var _0x2fa20b=_[_0xc53e('0x29')](db[_0xc53e('0x2a')][_0xc53e('0x2b')],function(_0x2a2ca9){return{'name':_0x2a2ca9['fieldName'],'type':_0x2a2ca9[_0xc53e('0x2c')][_0xc53e('0x2d')]};});_0x6a62b0[_0xc53e('0x2e')]=_['map'](_0x2fa20b,_0xc53e('0x27'));_0x6a62b0['query']=_[_0xc53e('0x2f')](_0x5112d2[_0xc53e('0x30')]);_0x6a62b0['filters']=_['intersection'](_0x6a62b0[_0xc53e('0x2e')],_0x6a62b0[_0xc53e('0x30')]);_0x8f0ee6[_0xc53e('0x31')]=_[_0xc53e('0x32')](_0x6a62b0[_0xc53e('0x2e')],qs[_0xc53e('0x33')](_0x5112d2[_0xc53e('0x30')][_0xc53e('0x33')]));_0x8f0ee6['attributes']=_0x8f0ee6[_0xc53e('0x31')][_0xc53e('0x34')]?_0x8f0ee6[_0xc53e('0x31')]:_0x6a62b0[_0xc53e('0x2e')];if(!_0x5112d2[_0xc53e('0x30')][_0xc53e('0x35')](_0xc53e('0x36'))){_0x8f0ee6[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x5112d2['query'][_0xc53e('0x1f')]);_0x8f0ee6['offset']=qs[_0xc53e('0x1e')](_0x5112d2[_0xc53e('0x30')]['offset']);}_0x8f0ee6[_0xc53e('0x37')]=qs[_0xc53e('0x38')](_0x5112d2[_0xc53e('0x30')]['sort']);_0x8f0ee6[_0xc53e('0x39')]=qs[_0xc53e('0x3a')](_[_0xc53e('0x3b')](_0x5112d2[_0xc53e('0x30')],_0x6a62b0[_0xc53e('0x3a')]));if(_0x5112d2[_0xc53e('0x30')][_0xc53e('0x3c')]){_0x8f0ee6['where']=_[_0xc53e('0x3d')](_0x8f0ee6[_0xc53e('0x39')],{'$or':_[_0xc53e('0x29')](_0x2fa20b,function(_0x5d35b0){if(_0x5d35b0[_0xc53e('0x2c')]!=='VIRTUAL'){var _0xaa00cd={};_0xaa00cd[_0x5d35b0[_0xc53e('0x27')]]={'$like':'%'+_0x5112d2[_0xc53e('0x30')][_0xc53e('0x3c')]+'%'};return _0xaa00cd;}})});}_0x8f0ee6=_[_0xc53e('0x3d')]({},_0x8f0ee6,_0x5112d2['options']);var _0x3dda55={'where':_0x8f0ee6[_0xc53e('0x39')]};return db['VoiceQueueReport']['count'](_0x3dda55)['then'](function(_0x52cf0a){_0x42dec1[_0xc53e('0x3e')]=_0x52cf0a;if(_0x5112d2[_0xc53e('0x30')]['includeAll']){_0x8f0ee6[_0xc53e('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x8f0ee6);})['then'](function(_0x255794){_0x42dec1['rows']=_0x255794;return _0x42dec1;})['then'](respondWithFilteredResult(_0x5ce216,_0x8f0ee6))[_0xc53e('0x40')](handleError(_0x5ce216,null));};exports['show']=function(_0x422088,_0x360af9){var _0x49f204={'raw':![],'where':{'id':_0x422088[_0xc53e('0x41')]['id']}},_0x19869a={};_0x19869a['model']=_[_0xc53e('0x2f')](db['VoiceQueueReport']['rawAttributes']);_0x19869a['query']=_['keys'](_0x422088[_0xc53e('0x30')]);_0x19869a[_0xc53e('0x3a')]=_[_0xc53e('0x32')](_0x19869a['model'],_0x19869a[_0xc53e('0x30')]);_0x49f204[_0xc53e('0x31')]=_['intersection'](_0x19869a['model'],qs[_0xc53e('0x33')](_0x422088[_0xc53e('0x30')][_0xc53e('0x33')]));_0x49f204['attributes']=_0x49f204[_0xc53e('0x31')][_0xc53e('0x34')]?_0x49f204[_0xc53e('0x31')]:_0x19869a[_0xc53e('0x2e')];if(_0x422088[_0xc53e('0x30')][_0xc53e('0x42')]){_0x49f204[_0xc53e('0x3f')]=[{'all':!![]}];}_0x49f204=_['merge']({},_0x49f204,_0x422088[_0xc53e('0x43')]);return db[_0xc53e('0x2a')][_0xc53e('0x44')](_0x49f204)['then'](handleEntityNotFound(_0x360af9,null))[_0xc53e('0x26')](respondWithResult(_0x360af9,null))[_0xc53e('0x40')](handleError(_0x360af9,null));};exports[_0xc53e('0x45')]=function(_0x15e744,_0xa7d256){return db[_0xc53e('0x2a')]['create'](_0x15e744[_0xc53e('0x46')],{})[_0xc53e('0x26')](respondWithResult(_0xa7d256,0xc9))[_0xc53e('0x40')](handleError(_0xa7d256,null));};exports['update']=function(_0x33d45c,_0x1d2491){if(_0x33d45c[_0xc53e('0x46')]['id']){delete _0x33d45c[_0xc53e('0x46')]['id'];}return db[_0xc53e('0x2a')][_0xc53e('0x44')]({'where':{'id':_0x33d45c[_0xc53e('0x41')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x1d2491,null))[_0xc53e('0x26')](saveUpdates(_0x33d45c[_0xc53e('0x46')],null))['then'](respondWithResult(_0x1d2491,null))[_0xc53e('0x40')](handleError(_0x1d2491,null));};exports[_0xc53e('0x47')]=function(_0x38520c,_0x3d74ac){return db[_0xc53e('0x2a')]['find']({'where':{'id':_0x38520c['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x3d74ac,null))['then'](removeEntity(_0x3d74ac,null))[_0xc53e('0x40')](handleError(_0x3d74ac,null));};exports['describe']=function(_0x3a49a4,_0x12d901){return db[_0xc53e('0x2a')]['describe']()[_0xc53e('0x26')](respondWithResult(_0x12d901,null))[_0xc53e('0x40')](handleError(_0x12d901,null));};exports[_0xc53e('0x48')]=function(_0x4843ce,_0x2f7df2){var _0x501f0a={},_0x2be75c={},_0x3f1ca5={'count':0x0,'rows':[]};_0x2be75c['model']=_[_0xc53e('0x2f')](db[_0xc53e('0x2a')]['rawAttributes']);_0x2be75c[_0xc53e('0x30')]=_[_0xc53e('0x2f')](_0x4843ce[_0xc53e('0x30')]);_0x2be75c[_0xc53e('0x3a')]=_[_0xc53e('0x32')](_0x2be75c[_0xc53e('0x2e')],_0x2be75c[_0xc53e('0x30')]);_0x501f0a[_0xc53e('0x31')]=_[_0xc53e('0x32')](_0x2be75c[_0xc53e('0x2e')],qs[_0xc53e('0x33')](_0x4843ce['query'][_0xc53e('0x33')]));_0x501f0a['attributes']=_0x501f0a[_0xc53e('0x31')]['length']?_0x501f0a[_0xc53e('0x31')]:_0x2be75c[_0xc53e('0x2e')];if(!_0x4843ce['query'][_0xc53e('0x35')](_0xc53e('0x36'))){_0x501f0a[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x4843ce['query'][_0xc53e('0x1f')]);_0x501f0a[_0xc53e('0x1e')]=qs['offset'](_0x4843ce['query'][_0xc53e('0x1e')]);}_0x501f0a['order']=qs['sort'](_0x4843ce['query'][_0xc53e('0x38')]);_0x501f0a['where']=qs[_0xc53e('0x3a')](_['pick'](_0x4843ce[_0xc53e('0x30')],_0x2be75c[_0xc53e('0x3a')]));if(_0x4843ce[_0xc53e('0x30')][_0xc53e('0x3c')]){_0x501f0a[_0xc53e('0x39')]=_['merge'](_0x501f0a['where'],{'$or':_[_0xc53e('0x29')](_0x501f0a[_0xc53e('0x31')],function(_0x31e22b){var _0x1ae133={};_0x1ae133[_0x31e22b]={'$like':'%'+_0x4843ce[_0xc53e('0x30')][_0xc53e('0x3c')]+'%'};return _0x1ae133;})});}_0x501f0a=_[_0xc53e('0x3d')]({},_0x501f0a,_0x4843ce[_0xc53e('0x43')]);var _0x13bf71={'where':_0x501f0a[_0xc53e('0x39')]};return db[_0xc53e('0x2a')][_0xc53e('0x3e')](_0x13bf71)[_0xc53e('0x26')](function(_0x520738){_0x3f1ca5[_0xc53e('0x3e')]=_0x520738;if(_0x4843ce['query'][_0xc53e('0x42')]){_0x501f0a[_0xc53e('0x3f')]=[{'all':!![]}];}return db[_0xc53e('0x2a')][_0xc53e('0x49')](_0x501f0a);})[_0xc53e('0x26')](function(_0x1b43d3){_0x3f1ca5[_0xc53e('0x4a')]=_0x1b43d3;return _0x3f1ca5;})[_0xc53e('0x26')](respondWithFilteredResult(_0x2f7df2,_0x501f0a,'getVoiceQueuesReport'))['catch'](handleError(_0x2f7df2,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 1aa6735..cf199ce 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 _0x35af=['update','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x138b85,_0x24dc94){var _0x1c9556=function(_0x443525){while(--_0x443525){_0x138b85['push'](_0x138b85['shift']());}};_0x1c9556(++_0x24dc94);}(_0x35af,0x199));var _0xf35a=function(_0x5d7108,_0x371867){_0x5d7108=_0x5d7108-0x0;var _0x28b4c1=_0x35af[_0x5d7108];return _0x28b4c1;};'use strict';var EventEmitter=require(_0xf35a('0x0'));var VoiceQueueReport=require(_0xf35a('0x1'))['db'][_0xf35a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf35a('0x3')](0x0);var events={'afterCreate':_0xf35a('0x4'),'afterUpdate':_0xf35a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x25430a){return function(_0x14b483,_0x1924e5,_0xeae203){VoiceQueueReportEvents[_0xf35a('0x6')](_0x25430a+':'+_0x14b483['id'],_0x14b483);VoiceQueueReportEvents[_0xf35a('0x6')](_0x25430a,_0x14b483);_0xeae203(null);};}for(var e in events){if(events[_0xf35a('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xf35a('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xc868=['emit','hook','exports','events','../../mysqldb','VoiceQueueReport','save','update'];(function(_0x26b4b0,_0x3b300e){var _0xb9e7fe=function(_0x4dcc2e){while(--_0x4dcc2e){_0x26b4b0['push'](_0x26b4b0['shift']());}};_0xb9e7fe(++_0x3b300e);}(_0xc868,0x1e3));var _0x8c86=function(_0x1442b7,_0x2d4e29){_0x1442b7=_0x1442b7-0x0;var _0x3e1e96=_0xc868[_0x1442b7];return _0x3e1e96;};'use strict';var EventEmitter=require(_0x8c86('0x0'));var VoiceQueueReport=require(_0x8c86('0x1'))['db'][_0x8c86('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c86('0x3'),'afterUpdate':_0x8c86('0x4'),'afterDestroy':'remove'};function emitEvent(_0x55e3dc){return function(_0x28dffd,_0x4d70c7,_0x3e9cfe){VoiceQueueReportEvents[_0x8c86('0x5')](_0x55e3dc+':'+_0x28dffd['id'],_0x28dffd);VoiceQueueReportEvents[_0x8c86('0x5')](_0x55e3dc,_0x28dffd);_0x3e9cfe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x8c86('0x6')](e,emitEvent(event));}}module[_0x8c86('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index a17c95e..1839e8d 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 _0x2032=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0x2032,0xd9));var _0x2203=function(_0x4a3c72,_0x1d86e9){_0x4a3c72=_0x4a3c72-0x0;var _0x1aa6e7=_0x2032[_0x4a3c72];return _0x1aa6e7;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2203('0xc')]},{'fields':[_0x2203('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2032=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4914ad,_0x551a18){var _0x3cd61f=function(_0x2a773e){while(--_0x2a773e){_0x4914ad['push'](_0x4914ad['shift']());}};_0x3cd61f(++_0x551a18);}(_0x2032,0xd9));var _0x2203=function(_0x370853,_0x4b56ef){_0x370853=_0x370853-0x0;var _0x2ab607=_0x2032[_0x370853];return _0x2ab607;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2203('0xc')]},{'fields':[_0x2203('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index e6d31f8..904602f 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 _0xe127=['VoiceQueueReport,\x20%s,\x20%s','message','info','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceQueueReport','CreateVoiceQueueReport','VoiceQueueReport','body','UpdateVoiceQueueReport','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','request\x20sent','debug','stringify','error','code'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0xe127,0x1c0));var _0x7e12=function(_0x143cc6,_0x3c1f1c){_0x143cc6=_0x143cc6-0x0;var _0x4a5e96=_0xe127[_0x143cc6];return _0x4a5e96;};'use strict';var _=require(_0x7e12('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7e12('0x1'));var rs=require(_0x7e12('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e12('0x3'))['db'];var utils=require(_0x7e12('0x4'));var logger=require(_0x7e12('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e12('0x6')][_0x7e12('0x7')]({'port':0x232a});config[_0x7e12('0x8')]=_[_0x7e12('0x9')](config[_0x7e12('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e12('0xa'))(new Redis(config[_0x7e12('0x8')]));require(_0x7e12('0xb'))[_0x7e12('0xc')](socket);function respondWithRpcPromise(_0x459226,_0x3cb3db,_0x1bc3be){return new BPromise(function(_0x55465d,_0x3603ea){return client[_0x7e12('0xd')](_0x459226,_0x1bc3be)[_0x7e12('0xe')](function(_0x293245){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x3cb3db,_0x7e12('0xf'));logger[_0x7e12('0x10')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3cb3db,'request\x20sent',JSON[_0x7e12('0x11')](_0x293245));if(_0x293245[_0x7e12('0x12')]){if(_0x293245[_0x7e12('0x12')][_0x7e12('0x13')]===0x1f4){logger[_0x7e12('0x12')](_0x7e12('0x14'),_0x3cb3db,_0x293245['error'][_0x7e12('0x15')]);return _0x3603ea(_0x293245['error'][_0x7e12('0x15')]);}logger[_0x7e12('0x12')](_0x7e12('0x14'),_0x3cb3db,_0x293245[_0x7e12('0x12')][_0x7e12('0x15')]);return _0x55465d(_0x293245[_0x7e12('0x12')][_0x7e12('0x15')]);}else{logger[_0x7e12('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x3cb3db,_0x7e12('0xf'));_0x55465d(_0x293245[_0x7e12('0x17')][_0x7e12('0x15')]);}})[_0x7e12('0x18')](function(_0x19ff7d){logger[_0x7e12('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x3cb3db,_0x19ff7d);_0x3603ea(_0x19ff7d);});});}exports['GetVoiceQueueReport']=function(_0x338473){var _0x5aa573=this;return new Promise(function(_0x5655ac,_0x54f0cb){return db['VoiceQueueReport'][_0x7e12('0x19')]({'raw':_0x338473[_0x7e12('0x1a')]?_0x338473[_0x7e12('0x1a')][_0x7e12('0x1b')]===undefined?!![]:![]:!![],'where':_0x338473[_0x7e12('0x1a')]?_0x338473[_0x7e12('0x1a')][_0x7e12('0x1c')]||null:null,'attributes':_0x338473[_0x7e12('0x1a')]?_0x338473['options'][_0x7e12('0x1d')]||null:null,'limit':_0x338473[_0x7e12('0x1a')]?_0x338473[_0x7e12('0x1a')][_0x7e12('0x1e')]||null:null,'include':_0x338473[_0x7e12('0x1a')]?_0x338473[_0x7e12('0x1a')]['include']?_[_0x7e12('0x1f')](_0x338473[_0x7e12('0x1a')][_0x7e12('0x20')],function(_0x300d9a){return{'model':db[_0x300d9a['model']],'as':_0x300d9a['as'],'attributes':_0x300d9a[_0x7e12('0x1d')],'include':_0x300d9a['include']?_[_0x7e12('0x1f')](_0x300d9a['include'],function(_0x353d6a){return{'model':db[_0x353d6a[_0x7e12('0x21')]],'as':_0x353d6a['as'],'attributes':_0x353d6a['attributes'],'include':_0x353d6a[_0x7e12('0x20')]?_['map'](_0x353d6a[_0x7e12('0x20')],function(_0x40656d){return{'model':db[_0x40656d[_0x7e12('0x21')]],'as':_0x40656d['as'],'attributes':_0x40656d[_0x7e12('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f9b8f){logger[_0x7e12('0x16')](_0x7e12('0x22'),_0x338473);logger[_0x7e12('0x10')](_0x7e12('0x22'),_0x338473,JSON[_0x7e12('0x11')](_0x4f9b8f));_0x5655ac(_0x4f9b8f);})[_0x7e12('0x18')](function(_0x50e9cb){logger['error'](_0x7e12('0x22'),_0x50e9cb[_0x7e12('0x15')],_0x338473);_0x54f0cb(_0x5aa573[_0x7e12('0x12')](0x1f4,_0x50e9cb[_0x7e12('0x15')]));});});};exports[_0x7e12('0x23')]=function(_0x1434d2){var _0x341c2d=this;return new Promise(function(_0xb62425,_0x5cbc4d){return db[_0x7e12('0x24')]['create'](_0x1434d2[_0x7e12('0x25')],{'raw':_0x1434d2[_0x7e12('0x1a')]?_0x1434d2[_0x7e12('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x7e12('0xe')](function(_0x52de64){logger[_0x7e12('0x16')]('CreateVoiceQueueReport',_0x1434d2);logger[_0x7e12('0x10')](_0x7e12('0x23'),_0x1434d2,JSON[_0x7e12('0x11')](_0x52de64));_0xb62425(_0x52de64);})[_0x7e12('0x18')](function(_0x261bbc){logger['error'](_0x7e12('0x23'),_0x261bbc[_0x7e12('0x15')],_0x1434d2);_0x5cbc4d(_0x341c2d[_0x7e12('0x12')](0x1f4,_0x261bbc[_0x7e12('0x15')]));});});};exports[_0x7e12('0x26')]=function(_0xea2f3d){var _0x1a7aef=this;return new Promise(function(_0x6f93df,_0x247a41){return db[_0x7e12('0x24')]['update'](_0xea2f3d[_0x7e12('0x25')],{'raw':_0xea2f3d[_0x7e12('0x1a')]?_0xea2f3d[_0x7e12('0x1a')][_0x7e12('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xea2f3d['options']?_0xea2f3d['options'][_0x7e12('0x1c')]||null:null,'attributes':_0xea2f3d['options']?_0xea2f3d[_0x7e12('0x1a')][_0x7e12('0x1d')]||null:null,'limit':_0xea2f3d[_0x7e12('0x1a')]?_0xea2f3d['options']['limit']||null:null})['then'](function(_0x29b215){logger[_0x7e12('0x16')](_0x7e12('0x26'),_0xea2f3d);logger['debug'](_0x7e12('0x26'),_0xea2f3d,JSON[_0x7e12('0x11')](_0x29b215));_0x6f93df(_0x29b215);})['catch'](function(_0x549568){logger[_0x7e12('0x12')](_0x7e12('0x26'),_0x549568['message'],_0xea2f3d);_0x247a41(_0x1a7aef[_0x7e12('0x12')](0x1f4,_0x549568[_0x7e12('0x15')]));});});}; \ No newline at end of file +var _0xaf53=['map','CreateVoiceQueueReport','create','body','debug','UpdateVoiceQueueReport','update','where','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','model'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xaf53,0x8c));var _0x3af5=function(_0x5a6f46,_0x4395f6){_0x5a6f46=_0x5a6f46-0x0;var _0x5e92fc=_0xaf53[_0x5a6f46];return _0x5e92fc;};'use strict';var _=require(_0x3af5('0x0'));var util=require(_0x3af5('0x1'));var moment=require(_0x3af5('0x2'));var BPromise=require('bluebird');var rs=require(_0x3af5('0x3'));var fs=require('fs');var Redis=require(_0x3af5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3af5('0x5'))(_0x3af5('0x6'));var config=require(_0x3af5('0x7'));var jayson=require(_0x3af5('0x8'));var client=jayson[_0x3af5('0x9')]['http']({'port':0x232a});config[_0x3af5('0xa')]=_[_0x3af5('0xb')](config[_0x3af5('0xa')],{'host':_0x3af5('0xc'),'port':0x18eb});var socket=require(_0x3af5('0xd'))(new Redis(config['redis']));require(_0x3af5('0xe'))[_0x3af5('0xf')](socket);function respondWithRpcPromise(_0x5dfee3,_0x41cfdb,_0x3a838a){return new BPromise(function(_0x293c4b,_0x573955){return client[_0x3af5('0x10')](_0x5dfee3,_0x3a838a)[_0x3af5('0x11')](function(_0x52b6bd){logger[_0x3af5('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x41cfdb,'request\x20sent');logger['debug'](_0x3af5('0x13'),_0x41cfdb,_0x3af5('0x14'),JSON[_0x3af5('0x15')](_0x52b6bd));if(_0x52b6bd['error']){if(_0x52b6bd[_0x3af5('0x16')][_0x3af5('0x17')]===0x1f4){logger[_0x3af5('0x16')](_0x3af5('0x18'),_0x41cfdb,_0x52b6bd[_0x3af5('0x16')]['message']);return _0x573955(_0x52b6bd['error']['message']);}logger[_0x3af5('0x16')](_0x3af5('0x18'),_0x41cfdb,_0x52b6bd[_0x3af5('0x16')][_0x3af5('0x19')]);return _0x293c4b(_0x52b6bd[_0x3af5('0x16')][_0x3af5('0x19')]);}else{logger[_0x3af5('0x12')](_0x3af5('0x18'),_0x41cfdb,_0x3af5('0x14'));_0x293c4b(_0x52b6bd['result'][_0x3af5('0x19')]);}})[_0x3af5('0x1a')](function(_0x412158){logger['error'](_0x3af5('0x18'),_0x41cfdb,_0x412158);_0x573955(_0x412158);});});}exports[_0x3af5('0x1b')]=function(_0x5af26b){var _0x1c6c59=this;return new Promise(function(_0x4af0b3,_0x355fb8){return db[_0x3af5('0x1c')][_0x3af5('0x1d')]({'raw':_0x5af26b[_0x3af5('0x1e')]?_0x5af26b[_0x3af5('0x1e')][_0x3af5('0x1f')]===undefined?!![]:![]:!![],'where':_0x5af26b[_0x3af5('0x1e')]?_0x5af26b['options']['where']||null:null,'attributes':_0x5af26b[_0x3af5('0x1e')]?_0x5af26b[_0x3af5('0x1e')][_0x3af5('0x20')]||null:null,'limit':_0x5af26b[_0x3af5('0x1e')]?_0x5af26b[_0x3af5('0x1e')][_0x3af5('0x21')]||null:null,'include':_0x5af26b['options']?_0x5af26b[_0x3af5('0x1e')]['include']?_['map'](_0x5af26b[_0x3af5('0x1e')][_0x3af5('0x22')],function(_0x329ccb){return{'model':db[_0x329ccb[_0x3af5('0x23')]],'as':_0x329ccb['as'],'attributes':_0x329ccb['attributes'],'include':_0x329ccb['include']?_[_0x3af5('0x24')](_0x329ccb[_0x3af5('0x22')],function(_0x25ad9f){return{'model':db[_0x25ad9f[_0x3af5('0x23')]],'as':_0x25ad9f['as'],'attributes':_0x25ad9f[_0x3af5('0x20')],'include':_0x25ad9f['include']?_[_0x3af5('0x24')](_0x25ad9f[_0x3af5('0x22')],function(_0x564088){return{'model':db[_0x564088[_0x3af5('0x23')]],'as':_0x564088['as'],'attributes':_0x564088['attributes']};}):[]};}):[]};}):[]:[]})[_0x3af5('0x11')](function(_0x1d7a79){logger[_0x3af5('0x12')]('GetVoiceQueueReport',_0x5af26b);logger['debug'](_0x3af5('0x1b'),_0x5af26b,JSON['stringify'](_0x1d7a79));_0x4af0b3(_0x1d7a79);})['catch'](function(_0x1d363e){logger[_0x3af5('0x16')](_0x3af5('0x1b'),_0x1d363e[_0x3af5('0x19')],_0x5af26b);_0x355fb8(_0x1c6c59[_0x3af5('0x16')](0x1f4,_0x1d363e[_0x3af5('0x19')]));});});};exports[_0x3af5('0x25')]=function(_0x310c88){var _0x67b76f=this;return new Promise(function(_0x571ee4,_0xfea7f){return db[_0x3af5('0x1c')][_0x3af5('0x26')](_0x310c88[_0x3af5('0x27')],{'raw':_0x310c88[_0x3af5('0x1e')]?_0x310c88['options'][_0x3af5('0x1f')]===undefined?!![]:![]:!![]})[_0x3af5('0x11')](function(_0x12e6fe){logger['info']('CreateVoiceQueueReport',_0x310c88);logger[_0x3af5('0x28')](_0x3af5('0x25'),_0x310c88,JSON[_0x3af5('0x15')](_0x12e6fe));_0x571ee4(_0x12e6fe);})[_0x3af5('0x1a')](function(_0x436ef4){logger[_0x3af5('0x16')](_0x3af5('0x25'),_0x436ef4[_0x3af5('0x19')],_0x310c88);_0xfea7f(_0x67b76f[_0x3af5('0x16')](0x1f4,_0x436ef4[_0x3af5('0x19')]));});});};exports[_0x3af5('0x29')]=function(_0x41a895){var _0x26e90e=this;return new Promise(function(_0x3e32df,_0x502a44){return db['VoiceQueueReport'][_0x3af5('0x2a')](_0x41a895['body'],{'raw':_0x41a895[_0x3af5('0x1e')]?_0x41a895['options'][_0x3af5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41a895[_0x3af5('0x1e')]?_0x41a895[_0x3af5('0x1e')][_0x3af5('0x2b')]||null:null,'attributes':_0x41a895[_0x3af5('0x1e')]?_0x41a895['options'][_0x3af5('0x20')]||null:null,'limit':_0x41a895[_0x3af5('0x1e')]?_0x41a895[_0x3af5('0x1e')]['limit']||null:null})['then'](function(_0x5b9c75){logger['info'](_0x3af5('0x29'),_0x41a895);logger[_0x3af5('0x28')](_0x3af5('0x29'),_0x41a895,JSON[_0x3af5('0x15')](_0x5b9c75));_0x3e32df(_0x5b9c75);})[_0x3af5('0x1a')](function(_0x419927){logger[_0x3af5('0x16')](_0x3af5('0x29'),_0x419927[_0x3af5('0x19')],_0x41a895);_0x502a44(_0x26e90e[_0x3af5('0x16')](0x1f4,_0x419927['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 208ea57..a95f1c6 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 _0x833c=['update','emit','removeListener','length','voiceQueueReport:','./voiceQueueReport.events','remove'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0x833c,0xe5));var _0xc833=function(_0x34d9cc,_0x4a2b9a){_0x34d9cc=_0x34d9cc-0x0;var _0x38af8a=_0x833c[_0x34d9cc];return _0x38af8a;};'use strict';var VoiceQueueReportEvents=require(_0xc833('0x0'));var events=['save',_0xc833('0x1'),_0xc833('0x2')];function createListener(_0x594d26,_0x5a417e){return function(_0x5213bf){_0x5a417e[_0xc833('0x3')](_0x594d26,_0x5213bf);};}function removeListener(_0x37f2c3,_0x28803c){return function(){VoiceQueueReportEvents[_0xc833('0x4')](_0x37f2c3,_0x28803c);};}exports['register']=function(_0x18ed7a){for(var _0x5afd4d=0x0,_0x54e634=events[_0xc833('0x5')];_0x5afd4d<_0x54e634;_0x5afd4d++){var _0x18ef32=events[_0x5afd4d];var _0x20dcea=createListener(_0xc833('0x6')+_0x18ef32,_0x18ed7a);VoiceQueueReportEvents['on'](_0x18ef32,_0x20dcea);}}; \ No newline at end of file +var _0x62c6=['removeListener','length','voiceQueueReport:','save','remove','update','emit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x62c6,0x1c3));var _0x662c=function(_0x3ef21e,_0x16194b){_0x3ef21e=_0x3ef21e-0x0;var _0x509d72=_0x62c6[_0x3ef21e];return _0x509d72;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x662c('0x0'),_0x662c('0x1'),_0x662c('0x2')];function createListener(_0x200ad9,_0x4683a5){return function(_0x5954ac){_0x4683a5[_0x662c('0x3')](_0x200ad9,_0x5954ac);};}function removeListener(_0x452692,_0x31af79){return function(){VoiceQueueReportEvents[_0x662c('0x4')](_0x452692,_0x31af79);};}exports['register']=function(_0x1bef6d){for(var _0x594540=0x0,_0x5727fa=events[_0x662c('0x5')];_0x594540<_0x5727fa;_0x594540++){var _0x298ef0=events[_0x594540];var _0x4fb768=createListener(_0x662c('0x6')+_0x298ef0,_0x1bef6d);VoiceQueueReportEvents['on'](_0x298ef0,_0x4fb768);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 9ae2269..28e7d6a 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 _0xe300=['../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0xe300,0xa4));var _0x0e30=function(_0x37d656,_0x388b40){_0x37d656=_0x37d656-0x0;var _0x2cd958=_0xe300[_0x37d656];return _0x2cd958;};'use strict';var multer=require(_0x0e30('0x0'));var util=require(_0x0e30('0x1'));var path=require('path');var timeout=require(_0x0e30('0x2'));var express=require(_0x0e30('0x3'));var router=express[_0x0e30('0x4')]();var auth=require(_0x0e30('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0e30('0x6'));var controller=require(_0x0e30('0x7'));router[_0x0e30('0x8')]('/',auth[_0x0e30('0x9')](),controller[_0x0e30('0xa')]);router[_0x0e30('0x8')]('/:id',auth[_0x0e30('0x9')](),controller[_0x0e30('0xb')]);router[_0x0e30('0xc')]('/',auth[_0x0e30('0x9')](),controller[_0x0e30('0xd')]);router['put']('/:id',auth[_0x0e30('0x9')](),controller['update']);router['delete'](_0x0e30('0xe'),auth[_0x0e30('0x9')](),controller[_0x0e30('0xf')]);module[_0x0e30('0x10')]=router; \ No newline at end of file +var _0x2b56=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x1d77d1,_0x4adb0c){var _0x2c7461=function(_0x45410a){while(--_0x45410a){_0x1d77d1['push'](_0x1d77d1['shift']());}};_0x2c7461(++_0x4adb0c);}(_0x2b56,0x18b));var _0x62b5=function(_0x3f5795,_0x26f2b4){_0x3f5795=_0x3f5795-0x0;var _0x5960bc=_0x2b56[_0x3f5795];return _0x5960bc;};'use strict';var multer=require('multer');var util=require(_0x62b5('0x0'));var path=require(_0x62b5('0x1'));var timeout=require(_0x62b5('0x2'));var express=require('express');var router=express[_0x62b5('0x3')]();var auth=require(_0x62b5('0x4'));var interaction=require(_0x62b5('0x5'));var config=require(_0x62b5('0x6'));var controller=require(_0x62b5('0x7'));router[_0x62b5('0x8')]('/',auth[_0x62b5('0x9')](),controller[_0x62b5('0xa')]);router[_0x62b5('0x8')](_0x62b5('0xb'),auth['isAuthenticated'](),controller[_0x62b5('0xc')]);router['post']('/',auth[_0x62b5('0x9')](),controller[_0x62b5('0xd')]);router[_0x62b5('0xe')]('/:id',auth[_0x62b5('0x9')](),controller[_0x62b5('0xf')]);router[_0x62b5('0x10')](_0x62b5('0xb'),auth['isAuthenticated'](),controller[_0x62b5('0x11')]);module[_0x62b5('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 2b27cbe..25d5821 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 _0x6f6f=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0xc7951e,_0x2a7c2b){var _0x4f9cea=function(_0x1678c4){while(--_0x1678c4){_0xc7951e['push'](_0xc7951e['shift']());}};_0x4f9cea(++_0x2a7c2b);}(_0x6f6f,0x1b3));var _0xf6f6=function(_0x1a029c,_0x73b780){_0x1a029c=_0x1a029c-0x0;var _0x37303f=_0x6f6f[_0x1a029c];return _0x37303f;};'use strict';var Sequelize=require(_0xf6f6('0x0'));var moment=require(_0xf6f6('0x1'));module[_0xf6f6('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf6f6('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf6f6('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xf6f6('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf6f6('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf6f6('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xf6f6('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xf6f6('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0xf6f6('0x5'))}}; \ No newline at end of file +var _0x3e84=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING'];(function(_0x60337,_0x163a14){var _0x48e690=function(_0x570685){while(--_0x570685){_0x60337['push'](_0x60337['shift']());}};_0x48e690(++_0x163a14);}(_0x3e84,0xd5));var _0x43e8=function(_0x1fe7c3,_0x2f7c6e){_0x1fe7c3=_0x1fe7c3-0x0;var _0x490542=_0x3e84[_0x1fe7c3];return _0x490542;};'use strict';var Sequelize=require(_0x43e8('0x0'));var moment=require(_0x43e8('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x43e8('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x43e8('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x43e8('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x43e8('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x43e8('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x43e8('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x43e8('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x43e8('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x43e8('0x3')],'allowNull':![],'defaultValue':moment()[_0x43e8('0x4')](_0x43e8('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index f13a746..a0ae46c 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 _0xa28c=['bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','stack','name','send','map','VoiceQueuesLog','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','rows','catch','show','params','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x30e439,_0x3e3246){var _0x47eb7b=function(_0x2b3396){while(--_0x2b3396){_0x30e439['push'](_0x30e439['shift']());}};_0x47eb7b(++_0x3e3246);}(_0xa28c,0x1cf));var _0xca28=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xa28c[_0x4fde08];return _0x12e725;};'use strict';var pdf=require(_0xca28('0x0'));var emlformat=require(_0xca28('0x1'));var rimraf=require(_0xca28('0x2'));var zipdir=require(_0xca28('0x3'));var jsonpatch=require(_0xca28('0x4'));var rp=require('request-promise');var moment=require(_0xca28('0x5'));var BPromise=require(_0xca28('0x6'));var Mustache=require(_0xca28('0x7'));var util=require('util');var path=require(_0xca28('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca28('0x9'));var fs=require('fs');var _=require(_0xca28('0xa'));var squel=require(_0xca28('0xb'));var crypto=require('crypto');var jsforce=require(_0xca28('0xc'));var deskjs=require(_0xca28('0xd'));var toCsv=require(_0xca28('0xe'));var querystring=require(_0xca28('0xf'));var Papa=require('papaparse');var Redis=require(_0xca28('0x10'));var authService=require(_0xca28('0x11'));var qs=require(_0xca28('0x12'));var as=require(_0xca28('0x13'));var hardwareService=require(_0xca28('0x14'));var logger=require(_0xca28('0x15'))(_0xca28('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xccdedc,_0x9d3a01){_0x9d3a01=_0x9d3a01||0xcc;return function(_0xee455f){if(_0xee455f){return _0xccdedc['sendStatus'](_0x9d3a01);}return _0xccdedc[_0xca28('0x17')](_0x9d3a01)[_0xca28('0x18')]();};}function respondWithResult(_0x19e701,_0x564dfa){_0x564dfa=_0x564dfa||0xc8;return function(_0x5f4b89){if(_0x5f4b89){return _0x19e701[_0xca28('0x17')](_0x564dfa)[_0xca28('0x19')](_0x5f4b89);}};}function respondWithFilteredResult(_0x471ece,_0x84094c){return function(_0x127153){if(_0x127153){var _0x245a2f=_0x127153[_0xca28('0x1a')],_0x42e088=_0x84094c[_0xca28('0x1b')],_0x5b5690=_0x84094c[_0xca28('0x1b')]+_0x84094c[_0xca28('0x1c')],_0x5074da;if(_0x5b5690>=_0x245a2f){_0x5b5690=_0x245a2f;_0x5074da=0xc8;}else{_0x5074da=0xce;}_0x471ece[_0xca28('0x17')](_0x5074da);return _0x471ece['set'](_0xca28('0x1d'),_0x42e088+'-'+_0x5b5690+'/'+_0x245a2f)[_0xca28('0x19')](_0x127153);}return null;};}function patchUpdates(_0x501c30){return function(_0x58281c){try{jsonpatch['apply'](_0x58281c,_0x501c30,!![]);}catch(_0x5a2dea){return BPromise[_0xca28('0x1e')](_0x5a2dea);}return _0x58281c['save']();};}function saveUpdates(_0x40622a,_0x4b06bc){return function(_0x2949b3){if(_0x2949b3){return _0x2949b3[_0xca28('0x1f')](_0x40622a)[_0xca28('0x20')](function(_0x1a4d7d){return _0x1a4d7d;});}return null;};}function removeEntity(_0x565c5f,_0x14c283){return function(_0x32816e){if(_0x32816e){return _0x32816e[_0xca28('0x21')]()[_0xca28('0x20')](function(){_0x565c5f[_0xca28('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c34e6,_0xda63f8){return function(_0x17f7f5){if(!_0x17f7f5){_0x4c34e6['sendStatus'](0x194);}return _0x17f7f5;};}function handleError(_0x3aa2d4,_0x37c32c){_0x37c32c=_0x37c32c||0x1f4;return function(_0x5e4f8f){logger['error'](_0x5e4f8f[_0xca28('0x22')]);if(_0x5e4f8f[_0xca28('0x23')]){delete _0x5e4f8f[_0xca28('0x23')];}_0x3aa2d4[_0xca28('0x17')](_0x37c32c)[_0xca28('0x24')](_0x5e4f8f);};}exports['index']=function(_0x4cea5e,_0x8b12ed){var _0x334573={},_0x440b71={},_0x29323e={'count':0x0,'rows':[]};var _0x13f869=_[_0xca28('0x25')](db[_0xca28('0x26')][_0xca28('0x27')],function(_0x111dc3){return{'name':_0x111dc3['fieldName'],'type':_0x111dc3[_0xca28('0x28')][_0xca28('0x29')]};});_0x440b71['model']=_[_0xca28('0x25')](_0x13f869,_0xca28('0x23'));_0x440b71['query']=_[_0xca28('0x2a')](_0x4cea5e[_0xca28('0x2b')]);_0x440b71['filters']=_[_0xca28('0x2c')](_0x440b71[_0xca28('0x2d')],_0x440b71[_0xca28('0x2b')]);_0x334573[_0xca28('0x2e')]=_[_0xca28('0x2c')](_0x440b71[_0xca28('0x2d')],qs[_0xca28('0x2f')](_0x4cea5e['query'][_0xca28('0x2f')]));_0x334573['attributes']=_0x334573['attributes'][_0xca28('0x30')]?_0x334573[_0xca28('0x2e')]:_0x440b71['model'];if(!_0x4cea5e[_0xca28('0x2b')][_0xca28('0x31')](_0xca28('0x32'))){_0x334573['limit']=qs[_0xca28('0x1c')](_0x4cea5e[_0xca28('0x2b')][_0xca28('0x1c')]);_0x334573['offset']=qs[_0xca28('0x1b')](_0x4cea5e['query']['offset']);}_0x334573['order']=qs[_0xca28('0x33')](_0x4cea5e[_0xca28('0x2b')][_0xca28('0x33')]);_0x334573[_0xca28('0x34')]=qs['filters'](_[_0xca28('0x35')](_0x4cea5e['query'],_0x440b71[_0xca28('0x36')]));if(_0x4cea5e[_0xca28('0x2b')]['filter']){_0x334573[_0xca28('0x34')]=_['merge'](_0x334573['where'],{'$or':_[_0xca28('0x25')](_0x13f869,function(_0x5b0698){if(_0x5b0698['type']!=='VIRTUAL'){var _0xe14881={};_0xe14881[_0x5b0698['name']]={'$like':'%'+_0x4cea5e[_0xca28('0x2b')][_0xca28('0x37')]+'%'};return _0xe14881;}})});}_0x334573=_[_0xca28('0x38')]({},_0x334573,_0x4cea5e['options']);var _0x3f68fe={'where':_0x334573['where']};return db[_0xca28('0x26')][_0xca28('0x1a')](_0x3f68fe)['then'](function(_0x59a445){_0x29323e[_0xca28('0x1a')]=_0x59a445;if(_0x4cea5e[_0xca28('0x2b')][_0xca28('0x39')]){_0x334573[_0xca28('0x3a')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x334573);})[_0xca28('0x20')](function(_0x312a2a){_0x29323e[_0xca28('0x3b')]=_0x312a2a;return _0x29323e;})[_0xca28('0x20')](respondWithFilteredResult(_0x8b12ed,_0x334573))[_0xca28('0x3c')](handleError(_0x8b12ed,null));};exports[_0xca28('0x3d')]=function(_0x598f50,_0x24a97a){var _0x2e293c={'raw':!![],'where':{'id':_0x598f50[_0xca28('0x3e')]['id']}},_0x478467={};_0x478467[_0xca28('0x2d')]=_[_0xca28('0x2a')](db[_0xca28('0x26')]['rawAttributes']);_0x478467[_0xca28('0x2b')]=_[_0xca28('0x2a')](_0x598f50[_0xca28('0x2b')]);_0x478467[_0xca28('0x36')]=_['intersection'](_0x478467[_0xca28('0x2d')],_0x478467[_0xca28('0x2b')]);_0x2e293c[_0xca28('0x2e')]=_[_0xca28('0x2c')](_0x478467[_0xca28('0x2d')],qs['fields'](_0x598f50[_0xca28('0x2b')][_0xca28('0x2f')]));_0x2e293c['attributes']=_0x2e293c[_0xca28('0x2e')][_0xca28('0x30')]?_0x2e293c[_0xca28('0x2e')]:_0x478467[_0xca28('0x2d')];if(_0x598f50[_0xca28('0x2b')][_0xca28('0x39')]){_0x2e293c[_0xca28('0x3a')]=[{'all':!![]}];}_0x2e293c=_[_0xca28('0x38')]({},_0x2e293c,_0x598f50[_0xca28('0x3f')]);return db[_0xca28('0x26')]['find'](_0x2e293c)['then'](handleEntityNotFound(_0x24a97a,null))[_0xca28('0x20')](respondWithResult(_0x24a97a,null))[_0xca28('0x3c')](handleError(_0x24a97a,null));};exports['create']=function(_0x1b462a,_0x4711a8){return db[_0xca28('0x26')][_0xca28('0x40')](_0x1b462a[_0xca28('0x41')],{})[_0xca28('0x20')](respondWithResult(_0x4711a8,0xc9))[_0xca28('0x3c')](handleError(_0x4711a8,null));};exports[_0xca28('0x1f')]=function(_0x57b517,_0x41c886){if(_0x57b517[_0xca28('0x41')]['id']){delete _0x57b517[_0xca28('0x41')]['id'];}return db[_0xca28('0x26')][_0xca28('0x42')]({'where':{'id':_0x57b517['params']['id']}})[_0xca28('0x20')](handleEntityNotFound(_0x41c886,null))[_0xca28('0x20')](saveUpdates(_0x57b517[_0xca28('0x41')],null))[_0xca28('0x20')](respondWithResult(_0x41c886,null))[_0xca28('0x3c')](handleError(_0x41c886,null));};exports[_0xca28('0x21')]=function(_0x234d1f,_0x40526e){return db['VoiceQueuesLog'][_0xca28('0x42')]({'where':{'id':_0x234d1f[_0xca28('0x3e')]['id']}})[_0xca28('0x20')](handleEntityNotFound(_0x40526e,null))[_0xca28('0x20')](removeEntity(_0x40526e,null))[_0xca28('0x3c')](handleError(_0x40526e,null));}; \ No newline at end of file +var _0xc5b0=['includeAll','include','rows','catch','show','params','options','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x22cc6a,_0x5ca60e){var _0x495131=function(_0x204b24){while(--_0x204b24){_0x22cc6a['push'](_0x22cc6a['shift']());}};_0x495131(++_0x5ca60e);}(_0xc5b0,0x1c0));var _0x0c5b=function(_0x2bfa06,_0x351e03){_0x2bfa06=_0x2bfa06-0x0;var _0x58811b=_0xc5b0[_0x2bfa06];return _0x58811b;};'use strict';var pdf=require(_0x0c5b('0x0'));var emlformat=require(_0x0c5b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0c5b('0x2'));var jsonpatch=require(_0x0c5b('0x3'));var rp=require(_0x0c5b('0x4'));var moment=require(_0x0c5b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0c5b('0x6'));var util=require(_0x0c5b('0x7'));var path=require('path');var sox=require(_0x0c5b('0x8'));var csv=require(_0x0c5b('0x9'));var ejs=require(_0x0c5b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0c5b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c5b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0c5b('0xd'));var Papa=require(_0x0c5b('0xe'));var Redis=require(_0x0c5b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0c5b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c5b('0x11'));var logger=require(_0x0c5b('0x12'))(_0x0c5b('0x13'));var utils=require(_0x0c5b('0x14'));var config=require(_0x0c5b('0x15'));var db=require(_0x0c5b('0x16'))['db'];function respondWithStatusCode(_0x5a85ba,_0x37b100){_0x37b100=_0x37b100||0xcc;return function(_0xc8100c){if(_0xc8100c){return _0x5a85ba[_0x0c5b('0x17')](_0x37b100);}return _0x5a85ba[_0x0c5b('0x18')](_0x37b100)[_0x0c5b('0x19')]();};}function respondWithResult(_0x3f64c4,_0x352ea1){_0x352ea1=_0x352ea1||0xc8;return function(_0x503c6e){if(_0x503c6e){return _0x3f64c4[_0x0c5b('0x18')](_0x352ea1)['json'](_0x503c6e);}};}function respondWithFilteredResult(_0x2f7a86,_0x5d6ee7){return function(_0x50c5d1){if(_0x50c5d1){var _0x4b8332=_0x50c5d1[_0x0c5b('0x1a')],_0x4f484c=_0x5d6ee7['offset'],_0x5a789a=_0x5d6ee7[_0x0c5b('0x1b')]+_0x5d6ee7[_0x0c5b('0x1c')],_0x3a9a7b;if(_0x5a789a>=_0x4b8332){_0x5a789a=_0x4b8332;_0x3a9a7b=0xc8;}else{_0x3a9a7b=0xce;}_0x2f7a86[_0x0c5b('0x18')](_0x3a9a7b);return _0x2f7a86[_0x0c5b('0x1d')](_0x0c5b('0x1e'),_0x4f484c+'-'+_0x5a789a+'/'+_0x4b8332)[_0x0c5b('0x1f')](_0x50c5d1);}return null;};}function patchUpdates(_0x3ae878){return function(_0x4853f6){try{jsonpatch[_0x0c5b('0x20')](_0x4853f6,_0x3ae878,!![]);}catch(_0x2d53b1){return BPromise[_0x0c5b('0x21')](_0x2d53b1);}return _0x4853f6['save']();};}function saveUpdates(_0x3d6108,_0x1b191d){return function(_0x41846c){if(_0x41846c){return _0x41846c[_0x0c5b('0x22')](_0x3d6108)['then'](function(_0x78278){return _0x78278;});}return null;};}function removeEntity(_0xac75b1,_0x2e0083){return function(_0x571120){if(_0x571120){return _0x571120[_0x0c5b('0x23')]()[_0x0c5b('0x24')](function(){_0xac75b1[_0x0c5b('0x18')](0xcc)[_0x0c5b('0x19')]();});}};}function handleEntityNotFound(_0x50817b,_0x518f3a){return function(_0x345bf4){if(!_0x345bf4){_0x50817b[_0x0c5b('0x17')](0x194);}return _0x345bf4;};}function handleError(_0x3380e8,_0x1dec7e){_0x1dec7e=_0x1dec7e||0x1f4;return function(_0x3631bf){logger[_0x0c5b('0x25')](_0x3631bf[_0x0c5b('0x26')]);if(_0x3631bf[_0x0c5b('0x27')]){delete _0x3631bf['name'];}_0x3380e8['status'](_0x1dec7e)[_0x0c5b('0x28')](_0x3631bf);};}exports[_0x0c5b('0x29')]=function(_0x22d21b,_0x874577){var _0x108378={},_0x2f9b7e={},_0x7130bd={'count':0x0,'rows':[]};var _0x7002ae=_[_0x0c5b('0x2a')](db[_0x0c5b('0x2b')]['rawAttributes'],function(_0x273a79){return{'name':_0x273a79[_0x0c5b('0x2c')],'type':_0x273a79[_0x0c5b('0x2d')]['key']};});_0x2f9b7e[_0x0c5b('0x2e')]=_['map'](_0x7002ae,_0x0c5b('0x27'));_0x2f9b7e[_0x0c5b('0x2f')]=_[_0x0c5b('0x30')](_0x22d21b['query']);_0x2f9b7e[_0x0c5b('0x31')]=_[_0x0c5b('0x32')](_0x2f9b7e[_0x0c5b('0x2e')],_0x2f9b7e[_0x0c5b('0x2f')]);_0x108378[_0x0c5b('0x33')]=_[_0x0c5b('0x32')](_0x2f9b7e[_0x0c5b('0x2e')],qs['fields'](_0x22d21b[_0x0c5b('0x2f')][_0x0c5b('0x34')]));_0x108378[_0x0c5b('0x33')]=_0x108378[_0x0c5b('0x33')][_0x0c5b('0x35')]?_0x108378[_0x0c5b('0x33')]:_0x2f9b7e[_0x0c5b('0x2e')];if(!_0x22d21b[_0x0c5b('0x2f')][_0x0c5b('0x36')](_0x0c5b('0x37'))){_0x108378[_0x0c5b('0x1c')]=qs[_0x0c5b('0x1c')](_0x22d21b[_0x0c5b('0x2f')][_0x0c5b('0x1c')]);_0x108378[_0x0c5b('0x1b')]=qs['offset'](_0x22d21b[_0x0c5b('0x2f')][_0x0c5b('0x1b')]);}_0x108378[_0x0c5b('0x38')]=qs[_0x0c5b('0x39')](_0x22d21b['query'][_0x0c5b('0x39')]);_0x108378['where']=qs['filters'](_[_0x0c5b('0x3a')](_0x22d21b[_0x0c5b('0x2f')],_0x2f9b7e[_0x0c5b('0x31')]));if(_0x22d21b[_0x0c5b('0x2f')][_0x0c5b('0x3b')]){_0x108378[_0x0c5b('0x3c')]=_[_0x0c5b('0x3d')](_0x108378['where'],{'$or':_['map'](_0x7002ae,function(_0x27207f){if(_0x27207f[_0x0c5b('0x2d')]!==_0x0c5b('0x3e')){var _0x84213f={};_0x84213f[_0x27207f[_0x0c5b('0x27')]]={'$like':'%'+_0x22d21b[_0x0c5b('0x2f')]['filter']+'%'};return _0x84213f;}})});}_0x108378=_[_0x0c5b('0x3d')]({},_0x108378,_0x22d21b['options']);var _0x284f42={'where':_0x108378[_0x0c5b('0x3c')]};return db[_0x0c5b('0x2b')][_0x0c5b('0x1a')](_0x284f42)[_0x0c5b('0x24')](function(_0x43837b){_0x7130bd[_0x0c5b('0x1a')]=_0x43837b;if(_0x22d21b[_0x0c5b('0x2f')][_0x0c5b('0x3f')]){_0x108378[_0x0c5b('0x40')]=[{'all':!![]}];}return db[_0x0c5b('0x2b')]['findAll'](_0x108378);})['then'](function(_0x226bc2){_0x7130bd[_0x0c5b('0x41')]=_0x226bc2;return _0x7130bd;})['then'](respondWithFilteredResult(_0x874577,_0x108378))[_0x0c5b('0x42')](handleError(_0x874577,null));};exports[_0x0c5b('0x43')]=function(_0x32badc,_0x438676){var _0x334a05={'raw':!![],'where':{'id':_0x32badc[_0x0c5b('0x44')]['id']}},_0x427c87={};_0x427c87[_0x0c5b('0x2e')]=_[_0x0c5b('0x30')](db[_0x0c5b('0x2b')]['rawAttributes']);_0x427c87['query']=_[_0x0c5b('0x30')](_0x32badc[_0x0c5b('0x2f')]);_0x427c87[_0x0c5b('0x31')]=_['intersection'](_0x427c87[_0x0c5b('0x2e')],_0x427c87[_0x0c5b('0x2f')]);_0x334a05[_0x0c5b('0x33')]=_['intersection'](_0x427c87['model'],qs[_0x0c5b('0x34')](_0x32badc[_0x0c5b('0x2f')]['fields']));_0x334a05[_0x0c5b('0x33')]=_0x334a05[_0x0c5b('0x33')][_0x0c5b('0x35')]?_0x334a05[_0x0c5b('0x33')]:_0x427c87['model'];if(_0x32badc[_0x0c5b('0x2f')][_0x0c5b('0x3f')]){_0x334a05[_0x0c5b('0x40')]=[{'all':!![]}];}_0x334a05=_[_0x0c5b('0x3d')]({},_0x334a05,_0x32badc[_0x0c5b('0x45')]);return db[_0x0c5b('0x2b')][_0x0c5b('0x46')](_0x334a05)['then'](handleEntityNotFound(_0x438676,null))[_0x0c5b('0x24')](respondWithResult(_0x438676,null))['catch'](handleError(_0x438676,null));};exports[_0x0c5b('0x47')]=function(_0x48e13c,_0x23d210){return db[_0x0c5b('0x2b')][_0x0c5b('0x47')](_0x48e13c[_0x0c5b('0x48')],{})[_0x0c5b('0x24')](respondWithResult(_0x23d210,0xc9))[_0x0c5b('0x42')](handleError(_0x23d210,null));};exports[_0x0c5b('0x22')]=function(_0x3b446c,_0x5723e9){if(_0x3b446c[_0x0c5b('0x48')]['id']){delete _0x3b446c[_0x0c5b('0x48')]['id'];}return db['VoiceQueuesLog'][_0x0c5b('0x46')]({'where':{'id':_0x3b446c[_0x0c5b('0x44')]['id']}})[_0x0c5b('0x24')](handleEntityNotFound(_0x5723e9,null))[_0x0c5b('0x24')](saveUpdates(_0x3b446c[_0x0c5b('0x48')],null))[_0x0c5b('0x24')](respondWithResult(_0x5723e9,null))[_0x0c5b('0x42')](handleError(_0x5723e9,null));};exports[_0x0c5b('0x23')]=function(_0x37fe48,_0x335bfd){return db[_0x0c5b('0x2b')][_0x0c5b('0x46')]({'where':{'id':_0x37fe48['params']['id']}})['then'](handleEntityNotFound(_0x335bfd,null))['then'](removeEntity(_0x335bfd,null))[_0x0c5b('0x42')](handleError(_0x335bfd,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 949d9f2..2249277 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 _0x3161=['event_dtm','event','dtm','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog'];(function(_0x400461,_0x267206){var _0x1d5a3c=function(_0x267766){while(--_0x267766){_0x400461['push'](_0x400461['shift']());}};_0x1d5a3c(++_0x267206);}(_0x3161,0x145));var _0x1316=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3161[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1316('0x0'));var util=require(_0x1316('0x1'));var logger=require(_0x1316('0x2'))(_0x1316('0x3'));var moment=require('moment');var BPromise=require(_0x1316('0x4'));var rp=require(_0x1316('0x5'));var fs=require('fs');var path=require(_0x1316('0x6'));var rimraf=require('rimraf');var config=require(_0x1316('0x7'));var attributes=require(_0x1316('0x8'));module[_0x1316('0x9')]=function(_0x5bb4d4,_0x261cd6){return _0x5bb4d4['define'](_0x1316('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x1316('0xb'),'fields':[_0x1316('0xc'),_0x1316('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xeb1f=['path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x22819a,_0x294d24){var _0x8ef79b=function(_0x1f2602){while(--_0x1f2602){_0x22819a['push'](_0x22819a['shift']());}};_0x8ef79b(++_0x294d24);}(_0xeb1f,0x12f));var _0xfeb1=function(_0x2f15ef,_0x45e669){_0x2f15ef=_0x2f15ef-0x0;var _0x461234=_0xeb1f[_0x2f15ef];return _0x461234;};'use strict';var _=require(_0xfeb1('0x0'));var util=require(_0xfeb1('0x1'));var logger=require(_0xfeb1('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfeb1('0x3'));var rp=require(_0xfeb1('0x4'));var fs=require('fs');var path=require(_0xfeb1('0x5'));var rimraf=require(_0xfeb1('0x6'));var config=require('../../config/environment');var attributes=require(_0xfeb1('0x7'));module[_0xfeb1('0x8')]=function(_0x3eb7cb,_0x4a9ca9){return _0x3eb7cb[_0xfeb1('0x9')](_0xfeb1('0xa'),attributes,{'tableName':_0xfeb1('0xb'),'paranoid':![],'indexes':[{'name':_0xfeb1('0xc'),'fields':['event',_0xfeb1('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 492404b..c9e80a7 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 _0x7334=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment'];(function(_0x31d7b9,_0x55c62f){var _0x1c5417=function(_0x39b082){while(--_0x39b082){_0x31d7b9['push'](_0x31d7b9['shift']());}};_0x1c5417(++_0x55c62f);}(_0x7334,0x184));var _0x4733=function(_0x1ea4ef,_0x2e7e39){_0x1ea4ef=_0x1ea4ef-0x0;var _0xc8c2c1=_0x7334[_0x1ea4ef];return _0xc8c2c1;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});} \ No newline at end of file +var _0xb62e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1a89ca,_0x27394b){var _0x29cbb2=function(_0x31e1f4){while(--_0x31e1f4){_0x1a89ca['push'](_0x1a89ca['shift']());}};_0x29cbb2(++_0x27394b);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31f5ea,_0x5e0dc4,_0x2065a0){return new BPromise(function(_0xab7049,_0x1e10ae){return client[_0xeb62('0xc')](_0x31f5ea,_0x2065a0)['then'](function(_0x5cdef3){logger[_0xeb62('0xd')](_0xeb62('0xe'),_0x5e0dc4,_0xeb62('0xf'));logger[_0xeb62('0x10')](_0xeb62('0x11'),_0x5e0dc4,_0xeb62('0xf'),JSON[_0xeb62('0x12')](_0x5cdef3));if(_0x5cdef3[_0xeb62('0x13')]){if(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x14')]===0x1f4){logger['error'](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);return _0x1e10ae(_0x5cdef3[_0xeb62('0x13')]['message']);}logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')]['message']);return _0xab7049(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);}else{logger[_0xeb62('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5e0dc4,_0xeb62('0xf'));_0xab7049(_0x5cdef3[_0xeb62('0x16')][_0xeb62('0x15')]);}})[_0xeb62('0x17')](function(_0x3fb280){logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x3fb280);_0x1e10ae(_0x3fb280);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 1e4c889..7ddbf55 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 _0x763d=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','isAuthenticated','describe','show','/:id/downloads','downloads','post','create','put','/:id','update','delete','exports'];(function(_0x4190bf,_0x12bbc2){var _0x2523fa=function(_0x1bba54){while(--_0x1bba54){_0x4190bf['push'](_0x4190bf['shift']());}};_0x2523fa(++_0x12bbc2);}(_0x763d,0x6e));var _0xd763=function(_0x2b7d7d,_0x5a355d){_0x2b7d7d=_0x2b7d7d-0x0;var _0x2c1a87=_0x763d[_0x2b7d7d];return _0x2c1a87;};'use strict';var multer=require(_0xd763('0x0'));var util=require('util');var path=require(_0xd763('0x1'));var timeout=require(_0xd763('0x2'));var express=require(_0xd763('0x3'));var router=express[_0xd763('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd763('0x5'));var config=require(_0xd763('0x6'));var controller=require(_0xd763('0x7'));router[_0xd763('0x8')]('/',auth['isAuthenticated'](),controller[_0xd763('0x9')]);router['get']('/describe',auth[_0xd763('0xa')](),controller[_0xd763('0xb')]);router[_0xd763('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd763('0xc')]);router[_0xd763('0x8')]('/:id/download',auth[_0xd763('0xa')](),controller['download']);router['get'](_0xd763('0xd'),controller[_0xd763('0xe')]);router[_0xd763('0xf')]('/',auth[_0xd763('0xa')](),controller[_0xd763('0x10')]);router[_0xd763('0x11')](_0xd763('0x12'),auth['isAuthenticated'](),controller[_0xd763('0x13')]);router[_0xd763('0x14')](_0xd763('0x12'),auth[_0xd763('0xa')](),controller['destroy']);module[_0xd763('0x15')]=router; \ No newline at end of file +var _0xce92=['get','isAuthenticated','index','/describe','describe','show','/:id/download','download','downloads','post','create','put','/:id','delete','destroy','util','express','../../components/auth/service','../../config/environment'];(function(_0x319b3d,_0x466f2f){var _0x54025b=function(_0x5b294f){while(--_0x5b294f){_0x319b3d['push'](_0x319b3d['shift']());}};_0x54025b(++_0x466f2f);}(_0xce92,0x18b));var _0x2ce9=function(_0x127b15,_0x11a2a9){_0x127b15=_0x127b15-0x0;var _0x3fe772=_0xce92[_0x127b15];return _0x3fe772;};'use strict';var multer=require('multer');var util=require(_0x2ce9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2ce9('0x1'));var router=express['Router']();var auth=require(_0x2ce9('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x2ce9('0x3'));var controller=require('./voiceRecording.controller');router[_0x2ce9('0x4')]('/',auth[_0x2ce9('0x5')](),controller[_0x2ce9('0x6')]);router[_0x2ce9('0x4')](_0x2ce9('0x7'),auth[_0x2ce9('0x5')](),controller[_0x2ce9('0x8')]);router['get']('/:id',auth[_0x2ce9('0x5')](),controller[_0x2ce9('0x9')]);router[_0x2ce9('0x4')](_0x2ce9('0xa'),auth[_0x2ce9('0x5')](),controller[_0x2ce9('0xb')]);router[_0x2ce9('0x4')]('/:id/downloads',controller[_0x2ce9('0xc')]);router[_0x2ce9('0xd')]('/',auth[_0x2ce9('0x5')](),controller[_0x2ce9('0xe')]);router[_0x2ce9('0xf')](_0x2ce9('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x2ce9('0x11')]('/:id',auth[_0x2ce9('0x5')](),controller[_0x2ce9('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 148594e..dde2561 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 _0x04ce=['createdAt','MM-DD-YYYY\x20HH:mm','toString','updatedAt','format','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','membername','INTEGER','DATE'];(function(_0xd4dfb7,_0xc6f5c3){var _0x1240de=function(_0x2daf58){while(--_0x2daf58){_0xd4dfb7['push'](_0xd4dfb7['shift']());}};_0x1240de(++_0xc6f5c3);}(_0x04ce,0x16d));var _0xe04c=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x04ce[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xe04c('0x0'));var moment=require(_0xe04c('0x1'));var path=require(_0xe04c('0x2'));module[_0xe04c('0x3')]={'format':{'type':Sequelize[_0xe04c('0x4')],'get':function(){return this[_0xe04c('0x5')](_0xe04c('0x6'))?path[_0xe04c('0x7')](this[_0xe04c('0x5')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0xe04c('0x8')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x7edc18){if(_0x7edc18){this[_0xe04c('0x9')]('channel',_0x7edc18);this[_0xe04c('0x9')](_0xe04c('0xa'),_0x7edc18['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe04c('0x8')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xe04c('0x8')]},'connectedlinename':{'type':Sequelize[_0xe04c('0x8')]},'accountcode':{'type':Sequelize[_0xe04c('0x8')]},'context':{'type':Sequelize[_0xe04c('0x8')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xe04c('0x8')]},'type':{'type':Sequelize[_0xe04c('0x8')]},'rating':{'type':Sequelize[_0xe04c('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xe04c('0x8')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0xe04c('0xc')],'get':function(){return moment(this[_0xe04c('0x5')](_0xe04c('0xd')))['format'](_0xe04c('0xe'))[_0xe04c('0xf')]();}},'updatedAt':{'type':Sequelize[_0xe04c('0xc')],'get':function(){return moment(this['getDataValue'](_0xe04c('0x10')))[_0xe04c('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xe04c('0xf')]();}}}; \ No newline at end of file +var _0x1b9a=['format','MM-DD-YYYY\x20HH:mm','updatedAt','toString','sequelize','moment','path','getDataValue','value','STRING','setDataValue','channel','split','INTEGER','DATE','createdAt'];(function(_0x5bbe6d,_0x53fd00){var _0x5ba70f=function(_0xa6c685){while(--_0xa6c685){_0x5bbe6d['push'](_0x5bbe6d['shift']());}};_0x5ba70f(++_0x53fd00);}(_0x1b9a,0xc4));var _0xa1b9=function(_0x5cb69c,_0x538fe9){_0x5cb69c=_0x5cb69c-0x0;var _0x1d756c=_0x1b9a[_0x5cb69c];return _0x1d756c;};'use strict';var Sequelize=require(_0xa1b9('0x0'));var moment=require(_0xa1b9('0x1'));var path=require(_0xa1b9('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa1b9('0x3')](_0xa1b9('0x4'))?path['extname'](this[_0xa1b9('0x3')](_0xa1b9('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0xa1b9('0x5')]},'channel':{'type':Sequelize[_0xa1b9('0x5')],'set':function(_0x7ae62f){if(_0x7ae62f){this[_0xa1b9('0x6')](_0xa1b9('0x7'),_0x7ae62f);this[_0xa1b9('0x6')]('membername',_0x7ae62f[_0xa1b9('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xa1b9('0x5')]},'calleridnum':{'type':Sequelize[_0xa1b9('0x5')]},'calleridname':{'type':Sequelize[_0xa1b9('0x5')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xa1b9('0x5')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa1b9('0x5')]},'exten':{'type':Sequelize[_0xa1b9('0x5')]},'value':{'type':Sequelize[_0xa1b9('0x5')]},'type':{'type':Sequelize[_0xa1b9('0x5')]},'rating':{'type':Sequelize[_0xa1b9('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xa1b9('0x5')]},'userDisposition':{'type':Sequelize[_0xa1b9('0x5')]},'createdAt':{'type':Sequelize[_0xa1b9('0xa')],'get':function(){return moment(this[_0xa1b9('0x3')](_0xa1b9('0xb')))[_0xa1b9('0xc')](_0xa1b9('0xd'))['toString']();}},'updatedAt':{'type':Sequelize[_0xa1b9('0xa')],'get':function(){return moment(this['getDataValue'](_0xa1b9('0xe')))['format'](_0xa1b9('0xd'))[_0xa1b9('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 920d7b8..2ae49ff 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 _0x9b91=['rows','catch','show','params','create','body','find','describe','download','../../components/encryptor','uniqueid','existsSync','decryptFile','secrets','recording','value','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','token','$and','push','%s.cypher','Sequelize','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','query','intersection','attributes','fields','length','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x793bd2,_0x474bfb){var _0x33f39f=function(_0x175607){while(--_0x175607){_0x793bd2['push'](_0x793bd2['shift']());}};_0x33f39f(++_0x474bfb);}(_0x9b91,0x1bd));var _0x19b9=function(_0x311374,_0x132c28){_0x311374=_0x311374-0x0;var _0x1bf041=_0x9b91[_0x311374];return _0x1bf041;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x19b9('0x0'));var zipdir=require(_0x19b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19b9('0x2'));var moment=require('moment');var BPromise=require(_0x19b9('0x3'));var Mustache=require('mustache');var util=require(_0x19b9('0x4'));var path=require(_0x19b9('0x5'));var sox=require(_0x19b9('0x6'));var csv=require('to-csv');var ejs=require(_0x19b9('0x7'));var fs=require('fs');var _=require(_0x19b9('0x8'));var squel=require('squel');var crypto=require(_0x19b9('0x9'));var jsforce=require(_0x19b9('0xa'));var deskjs=require(_0x19b9('0xb'));var toCsv=require(_0x19b9('0xc'));var querystring=require(_0x19b9('0xd'));var Papa=require(_0x19b9('0xe'));var Redis=require('ioredis');var authService=require(_0x19b9('0xf'));var qs=require(_0x19b9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19b9('0x11'));var logger=require(_0x19b9('0x12'))(_0x19b9('0x13'));var utils=require(_0x19b9('0x14'));var config=require(_0x19b9('0x15'));var db=require(_0x19b9('0x16'))['db'];function respondWithStatusCode(_0x5e1afe,_0x2dea83){_0x2dea83=_0x2dea83||0xcc;return function(_0x2ff939){if(_0x2ff939){return _0x5e1afe['sendStatus'](_0x2dea83);}return _0x5e1afe[_0x19b9('0x17')](_0x2dea83)[_0x19b9('0x18')]();};}function respondWithResult(_0xffca73,_0x184250){_0x184250=_0x184250||0xc8;return function(_0x15fe36){if(_0x15fe36){return _0xffca73[_0x19b9('0x17')](_0x184250)['json'](_0x15fe36);}};}function respondWithFilteredResult(_0xabf505,_0xfc8223){return function(_0x5f5b09){if(_0x5f5b09){var _0x21c4cb=_0x5f5b09[_0x19b9('0x19')],_0x3d098a=_0xfc8223['offset'],_0x15c749=_0xfc8223[_0x19b9('0x1a')]+_0xfc8223[_0x19b9('0x1b')],_0x35395f;if(_0x15c749>=_0x21c4cb){_0x15c749=_0x21c4cb;_0x35395f=0xc8;}else{_0x35395f=0xce;}_0xabf505['status'](_0x35395f);return _0xabf505['set']('Content-Range',_0x3d098a+'-'+_0x15c749+'/'+_0x21c4cb)[_0x19b9('0x1c')](_0x5f5b09);}return null;};}function patchUpdates(_0x262fda){return function(_0xcdcd83){try{jsonpatch[_0x19b9('0x1d')](_0xcdcd83,_0x262fda,!![]);}catch(_0x2a21c8){return BPromise[_0x19b9('0x1e')](_0x2a21c8);}return _0xcdcd83[_0x19b9('0x1f')]();};}function saveUpdates(_0x2530be,_0x5af7ee){return function(_0x584b9c){if(_0x584b9c){return _0x584b9c[_0x19b9('0x20')](_0x2530be)[_0x19b9('0x21')](function(_0x15a443){return _0x15a443;});}return null;};}function removeEntity(_0x513cd7,_0x5ab9d9){return function(_0x1a1600){if(_0x1a1600){return _0x1a1600[_0x19b9('0x22')]()[_0x19b9('0x21')](function(){_0x513cd7[_0x19b9('0x17')](0xcc)[_0x19b9('0x18')]();});}};}function handleEntityNotFound(_0x49c66d,_0x1c77a3){return function(_0x324d3a){if(!_0x324d3a){_0x49c66d[_0x19b9('0x23')](0x194);}return _0x324d3a;};}function handleError(_0x97e48a,_0x3480b9){_0x3480b9=_0x3480b9||0x1f4;return function(_0x120f09){logger['error'](_0x120f09[_0x19b9('0x24')]);if(_0x120f09[_0x19b9('0x25')]){delete _0x120f09[_0x19b9('0x25')];}_0x97e48a[_0x19b9('0x17')](_0x3480b9)[_0x19b9('0x26')](_0x120f09);};}exports[_0x19b9('0x27')]=function(_0x66e828,_0x307957){var _0x4d5a83={},_0x3d911e={},_0x5486b7={'count':0x0,'rows':[]};var _0x54da7b=_[_0x19b9('0x28')](db[_0x19b9('0x29')][_0x19b9('0x2a')],function(_0x4b79a8){return{'name':_0x4b79a8[_0x19b9('0x2b')],'type':_0x4b79a8[_0x19b9('0x2c')][_0x19b9('0x2d')]};});_0x3d911e[_0x19b9('0x2e')]=_[_0x19b9('0x2f')](_['map'](_0x54da7b,_0x19b9('0x25')),[_0x19b9('0x30')]);_0x3d911e['query']=_[_0x19b9('0x31')](_0x66e828[_0x19b9('0x32')]);_0x3d911e['filters']=_[_0x19b9('0x33')](_0x3d911e['model'],_0x3d911e['query']);_0x4d5a83[_0x19b9('0x34')]=_[_0x19b9('0x33')](_0x3d911e[_0x19b9('0x2e')],qs[_0x19b9('0x35')](_0x66e828[_0x19b9('0x32')][_0x19b9('0x35')]));_0x4d5a83['attributes']=_0x4d5a83['attributes'][_0x19b9('0x36')]?_0x4d5a83[_0x19b9('0x34')]:_0x3d911e[_0x19b9('0x2e')];if(!_0x66e828[_0x19b9('0x32')]['hasOwnProperty']('nolimit')){_0x4d5a83[_0x19b9('0x1b')]=qs[_0x19b9('0x1b')](_0x66e828[_0x19b9('0x32')][_0x19b9('0x1b')]);_0x4d5a83[_0x19b9('0x1a')]=qs[_0x19b9('0x1a')](_0x66e828[_0x19b9('0x32')][_0x19b9('0x1a')]);}_0x4d5a83['order']=qs['sort'](_0x66e828[_0x19b9('0x32')][_0x19b9('0x37')]);_0x4d5a83['where']=qs['filters'](_[_0x19b9('0x38')](_0x66e828[_0x19b9('0x32')],_0x3d911e[_0x19b9('0x39')]));if(_0x66e828[_0x19b9('0x32')][_0x19b9('0x3a')]){_0x4d5a83[_0x19b9('0x3b')]=_[_0x19b9('0x3c')](_0x4d5a83[_0x19b9('0x3b')],{'$or':_[_0x19b9('0x28')](_0x54da7b,function(_0x20eeae){if(_0x20eeae[_0x19b9('0x2c')]!==_0x19b9('0x3d')){var _0x1108dd={};_0x1108dd[_0x20eeae[_0x19b9('0x25')]]={'$like':'%'+_0x66e828[_0x19b9('0x32')][_0x19b9('0x3a')]+'%'};return _0x1108dd;}})});}_0x4d5a83=_[_0x19b9('0x3c')]({},_0x4d5a83,_0x66e828[_0x19b9('0x3e')]);var _0x1a670c={'where':_0x4d5a83['where']};return db[_0x19b9('0x29')][_0x19b9('0x19')](_0x1a670c)[_0x19b9('0x21')](function(_0x59c18f){_0x5486b7[_0x19b9('0x19')]=_0x59c18f;if(_0x66e828[_0x19b9('0x32')][_0x19b9('0x3f')]){_0x4d5a83[_0x19b9('0x40')]=[{'all':!![]}];}return db[_0x19b9('0x29')]['findAll'](_0x4d5a83);})[_0x19b9('0x21')](function(_0x36602f){_0x5486b7[_0x19b9('0x41')]=_0x36602f;return _0x5486b7;})[_0x19b9('0x21')](respondWithFilteredResult(_0x307957,_0x4d5a83))[_0x19b9('0x42')](handleError(_0x307957,null));};exports[_0x19b9('0x43')]=function(_0x4b7e10,_0x22e4ef){var _0x56277a={'raw':![],'where':{'id':_0x4b7e10[_0x19b9('0x44')]['id']}},_0x165efa={};_0x165efa[_0x19b9('0x2e')]=_[_0x19b9('0x31')](db[_0x19b9('0x29')][_0x19b9('0x2a')]);_0x165efa[_0x19b9('0x32')]=_[_0x19b9('0x31')](_0x4b7e10[_0x19b9('0x32')]);_0x165efa[_0x19b9('0x39')]=_[_0x19b9('0x33')](_0x165efa['model'],_0x165efa[_0x19b9('0x32')]);_0x56277a['attributes']=_[_0x19b9('0x33')](_0x165efa[_0x19b9('0x2e')],qs[_0x19b9('0x35')](_0x4b7e10[_0x19b9('0x32')][_0x19b9('0x35')]));_0x56277a[_0x19b9('0x34')]=_0x56277a[_0x19b9('0x34')][_0x19b9('0x36')]?_0x56277a[_0x19b9('0x34')]:_0x165efa[_0x19b9('0x2e')];if(_0x4b7e10[_0x19b9('0x32')][_0x19b9('0x3f')]){_0x56277a['include']=[{'all':!![]}];}_0x56277a=_['merge']({},_0x56277a,_0x4b7e10[_0x19b9('0x3e')]);return db[_0x19b9('0x29')]['find'](_0x56277a)[_0x19b9('0x21')](handleEntityNotFound(_0x22e4ef,null))[_0x19b9('0x21')](respondWithResult(_0x22e4ef,null))[_0x19b9('0x42')](handleError(_0x22e4ef,null));};exports[_0x19b9('0x45')]=function(_0x298591,_0x296b17){return db[_0x19b9('0x29')]['create'](_0x298591[_0x19b9('0x46')],{})[_0x19b9('0x21')](respondWithResult(_0x296b17,0xc9))['catch'](handleError(_0x296b17,null));};exports[_0x19b9('0x20')]=function(_0x15fa92,_0x5d5397){if(_0x15fa92['body']['id']){delete _0x15fa92[_0x19b9('0x46')]['id'];}return db[_0x19b9('0x29')][_0x19b9('0x47')]({'where':{'id':_0x15fa92['params']['id']}})[_0x19b9('0x21')](handleEntityNotFound(_0x5d5397,null))[_0x19b9('0x21')](saveUpdates(_0x15fa92[_0x19b9('0x46')],null))[_0x19b9('0x21')](respondWithResult(_0x5d5397,null))[_0x19b9('0x42')](handleError(_0x5d5397,null));};exports['describe']=function(_0x265274,_0x2dfdb4){return db[_0x19b9('0x29')][_0x19b9('0x48')]()[_0x19b9('0x21')](respondWithResult(_0x2dfdb4,null))[_0x19b9('0x42')](handleError(_0x2dfdb4,null));};exports[_0x19b9('0x49')]=function(_0x15a004,_0x2538b9,_0x1751f0){var _0x2ecd37=require(_0x19b9('0x4a'));var _0x188b4c=![];var _0x414fbe={};if(_0x15a004['query'][_0x19b9('0x2c')]&&_0x15a004[_0x19b9('0x32')][_0x19b9('0x2c')]===_0x19b9('0x4b')){_0x414fbe[_0x19b9('0x4b')]=_0x15a004[_0x19b9('0x44')]['id'];}else{_0x414fbe['id']=_0x15a004[_0x19b9('0x44')]['id'];}return db[_0x19b9('0x29')][_0x19b9('0x47')]({'where':_0x414fbe,'attributes':['id','value'],'raw':!![]})[_0x19b9('0x21')](handleEntityNotFound(_0x2538b9,null))[_0x19b9('0x21')](function(_0x2c6a02){if(_0x2c6a02){var _0x2f0b98=_0x2c6a02['value'];var _0x139d56=util[_0x19b9('0x30')]('%s.cypher',_0x2f0b98);if(fs[_0x19b9('0x4c')](_0x139d56)){_0x188b4c=!![];return _0x2ecd37[_0x19b9('0x4d')](_0x139d56,_0x2f0b98,config[_0x19b9('0x4e')][_0x19b9('0x4f')])['then'](function(){return _0x2c6a02;});}return _0x2c6a02;}})['then'](function(_0x18cc0d){if(_0x18cc0d){var _0x162624=_0x18cc0d[_0x19b9('0x50')];if(!fs['existsSync'](_0x162624)){throw new db['Sequelize'][(_0x19b9('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x18cc0d[_0x19b9('0x52')]){return _0x2538b9[_0x19b9('0x49')](_0x162624,_0x18cc0d['filename']+path[_0x19b9('0x53')](_0x162624),function(){if(_0x188b4c){fs[_0x19b9('0x54')](_0x162624);}});}else{return _0x2538b9[_0x19b9('0x49')](_0x162624,function(_0x256666){if(_0x188b4c){fs[_0x19b9('0x54')](_0x162624);}});}}})[_0x19b9('0x42')](function(_0x32ea7f){if(_0x32ea7f[_0x19b9('0x55')]===_0x19b9('0x56')){_0x2538b9[_0x19b9('0x17')](0x194)[_0x19b9('0x26')](_0x19b9('0x57'));}else{return handleError(_0x2538b9,null);}});};exports[_0x19b9('0x58')]=function(_0x303ba0,_0x7b282f,_0x7b0696){var _0x3d4f78=require(_0x19b9('0x4a'));var _0x380e15=![];var _0x422ee2={'$and':[db[_0x19b9('0x59')][_0x19b9('0x3b')](db[_0x19b9('0x59')]['fn']('MD5',db['sequelize']['col'](_0x19b9('0x4b'))),_0x303ba0[_0x19b9('0x32')][_0x19b9('0x5a')])]};if(_0x303ba0['query']['type']&&_0x303ba0[_0x19b9('0x32')][_0x19b9('0x2c')]==='uniqueid'){_0x422ee2[_0x19b9('0x5b')][_0x19b9('0x5c')]({'uniqueid':_0x303ba0['params']['id']});}else{_0x422ee2['$and']['push']({'id':_0x303ba0[_0x19b9('0x44')]['id']});}return db[_0x19b9('0x29')][_0x19b9('0x47')]({'where':_0x422ee2,'attributes':['id','value'],'raw':!![]})[_0x19b9('0x21')](handleEntityNotFound(_0x7b282f,null))[_0x19b9('0x21')](function(_0x1440a6){if(_0x1440a6){var _0xa3e27a=util['format'](_0x19b9('0x5d'),_0x1440a6[_0x19b9('0x50')]);if(fs[_0x19b9('0x4c')](_0xa3e27a)){_0x380e15=!![];return _0x3d4f78[_0x19b9('0x4d')](_0xa3e27a,_0x1440a6['value'],config[_0x19b9('0x4e')]['recording'])[_0x19b9('0x21')](function(){return _0x1440a6;});}return _0x1440a6;}})[_0x19b9('0x21')](function(_0x25cd71){if(_0x25cd71){if(!fs[_0x19b9('0x4c')](_0x25cd71[_0x19b9('0x50')])){throw new db[(_0x19b9('0x5e'))][(_0x19b9('0x51'))](_0x19b9('0x56'));}if(_0x25cd71['filename']){return _0x7b282f[_0x19b9('0x49')](_0x25cd71['value'],_0x25cd71[_0x19b9('0x52')]+path[_0x19b9('0x53')](_0x25cd71[_0x19b9('0x50')]),function(){if(_0x380e15){fs['unlink'](_0x25cd71['value']);}});}else{return _0x7b282f[_0x19b9('0x49')](_0x25cd71[_0x19b9('0x50')],function(_0x1c97e7){if(_0x380e15){fs[_0x19b9('0x54')](_0x25cd71[_0x19b9('0x50')]);}});}}})['catch'](handleError(_0x7b282f,null));};exports['destroy']=function(_0x34da28,_0x52b2fc){return db[_0x19b9('0x29')][_0x19b9('0x47')]({'where':{'id':_0x34da28[_0x19b9('0x44')]['id']}})[_0x19b9('0x21')](function(_0x15dad5){if(!_0x15dad5)throw new ReferenceError(_0x19b9('0x5f'));return _0x15dad5;})[_0x19b9('0x21')](function(_0x120234){var _0x14f4f9=_0x120234[_0x19b9('0x50')];logger[_0x19b9('0x60')](_0x19b9('0x61'),_0x14f4f9);if(!_[_0x19b9('0x62')](_0x120234[_0x19b9('0x50')])&&fs[_0x19b9('0x4c')](_0x14f4f9)){logger[_0x19b9('0x60')](_0x19b9('0x63')+_0x14f4f9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x14f4f9);}_0x14f4f9=_0x14f4f9+'.cypher';if(!_['isNil'](_0x120234[_0x19b9('0x50')])&&fs[_0x19b9('0x4c')](_0x14f4f9)){logger['info']('File:\x20\x22'+_0x14f4f9+_0x19b9('0x64'));fs[_0x19b9('0x65')](_0x14f4f9);}return _0x120234;})[_0x19b9('0x21')](function(_0xc9ca96){if(!_0xc9ca96)throw new InternalError();return _0xc9ca96['destroy']();})[_0x19b9('0x21')](function(){_0x52b2fc['status'](0xcc)[_0x19b9('0x18')]();})[_0x19b9('0x42')](handleError(_0x52b2fc,null));}; \ No newline at end of file +var _0x1dff=['find','create','body','describe','download','uniqueid','%s.cypher','existsSync','decryptFile','secrets','recording','value','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','../../components/encryptor','sequelize','MD5','token','$and','push','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','count','offset','limit','set','json','reject','save','update','then','destroy','name','send','index','map','VoiceRecording','rawAttributes','model','differenceBy','format','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1dff,0x14d));var _0xf1df=function(_0x5eb6e6,_0x17f551){_0x5eb6e6=_0x5eb6e6-0x0;var _0x35c38b=_0x1dff[_0x5eb6e6];return _0x35c38b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf1df('0x0'));var rimraf=require(_0xf1df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1df('0x2'));var rp=require(_0xf1df('0x3'));var moment=require(_0xf1df('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf1df('0x5'));var util=require(_0xf1df('0x6'));var path=require(_0xf1df('0x7'));var sox=require(_0xf1df('0x8'));var csv=require('to-csv');var ejs=require(_0xf1df('0x9'));var fs=require('fs');var _=require(_0xf1df('0xa'));var squel=require('squel');var crypto=require(_0xf1df('0xb'));var jsforce=require(_0xf1df('0xc'));var deskjs=require(_0xf1df('0xd'));var toCsv=require(_0xf1df('0xe'));var querystring=require(_0xf1df('0xf'));var Papa=require(_0xf1df('0x10'));var Redis=require(_0xf1df('0x11'));var authService=require(_0xf1df('0x12'));var qs=require(_0xf1df('0x13'));var as=require(_0xf1df('0x14'));var hardwareService=require(_0xf1df('0x15'));var logger=require(_0xf1df('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf1df('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47607b,_0x58b475){_0x58b475=_0x58b475||0xcc;return function(_0x119931){if(_0x119931){return _0x47607b[_0xf1df('0x18')](_0x58b475);}return _0x47607b[_0xf1df('0x19')](_0x58b475)[_0xf1df('0x1a')]();};}function respondWithResult(_0xf513d4,_0x2ee623){_0x2ee623=_0x2ee623||0xc8;return function(_0x2f3c88){if(_0x2f3c88){return _0xf513d4[_0xf1df('0x19')](_0x2ee623)['json'](_0x2f3c88);}};}function respondWithFilteredResult(_0x3ebe02,_0x56c16c){return function(_0x2ac0fb){if(_0x2ac0fb){var _0x41d4ac=_0x2ac0fb[_0xf1df('0x1b')],_0x52540e=_0x56c16c[_0xf1df('0x1c')],_0x125653=_0x56c16c[_0xf1df('0x1c')]+_0x56c16c[_0xf1df('0x1d')],_0x2afb3b;if(_0x125653>=_0x41d4ac){_0x125653=_0x41d4ac;_0x2afb3b=0xc8;}else{_0x2afb3b=0xce;}_0x3ebe02[_0xf1df('0x19')](_0x2afb3b);return _0x3ebe02[_0xf1df('0x1e')]('Content-Range',_0x52540e+'-'+_0x125653+'/'+_0x41d4ac)[_0xf1df('0x1f')](_0x2ac0fb);}return null;};}function patchUpdates(_0x2a01cb){return function(_0x1c2097){try{jsonpatch['apply'](_0x1c2097,_0x2a01cb,!![]);}catch(_0x92245d){return BPromise[_0xf1df('0x20')](_0x92245d);}return _0x1c2097[_0xf1df('0x21')]();};}function saveUpdates(_0x1f93e5,_0x1b8c3e){return function(_0x23320f){if(_0x23320f){return _0x23320f[_0xf1df('0x22')](_0x1f93e5)[_0xf1df('0x23')](function(_0x158f11){return _0x158f11;});}return null;};}function removeEntity(_0x5d793d,_0x202348){return function(_0x5a43f1){if(_0x5a43f1){return _0x5a43f1[_0xf1df('0x24')]()[_0xf1df('0x23')](function(){_0x5d793d[_0xf1df('0x19')](0xcc)[_0xf1df('0x1a')]();});}};}function handleEntityNotFound(_0x461fcf,_0x326f70){return function(_0xf1c45b){if(!_0xf1c45b){_0x461fcf['sendStatus'](0x194);}return _0xf1c45b;};}function handleError(_0x12ebcf,_0xf03276){_0xf03276=_0xf03276||0x1f4;return function(_0x4cb735){logger['error'](_0x4cb735['stack']);if(_0x4cb735[_0xf1df('0x25')]){delete _0x4cb735[_0xf1df('0x25')];}_0x12ebcf[_0xf1df('0x19')](_0xf03276)[_0xf1df('0x26')](_0x4cb735);};}exports[_0xf1df('0x27')]=function(_0x42c37b,_0x2e6fc6){var _0x1511d6={},_0x3704a5={},_0x5429ff={'count':0x0,'rows':[]};var _0x3e9096=_[_0xf1df('0x28')](db[_0xf1df('0x29')][_0xf1df('0x2a')],function(_0x3a3263){return{'name':_0x3a3263['fieldName'],'type':_0x3a3263['type']['key']};});_0x3704a5[_0xf1df('0x2b')]=_[_0xf1df('0x2c')](_[_0xf1df('0x28')](_0x3e9096,_0xf1df('0x25')),[_0xf1df('0x2d')]);_0x3704a5['query']=_[_0xf1df('0x2e')](_0x42c37b[_0xf1df('0x2f')]);_0x3704a5[_0xf1df('0x30')]=_[_0xf1df('0x31')](_0x3704a5[_0xf1df('0x2b')],_0x3704a5[_0xf1df('0x2f')]);_0x1511d6['attributes']=_['intersection'](_0x3704a5[_0xf1df('0x2b')],qs['fields'](_0x42c37b[_0xf1df('0x2f')]['fields']));_0x1511d6[_0xf1df('0x32')]=_0x1511d6[_0xf1df('0x32')][_0xf1df('0x33')]?_0x1511d6[_0xf1df('0x32')]:_0x3704a5[_0xf1df('0x2b')];if(!_0x42c37b[_0xf1df('0x2f')][_0xf1df('0x34')](_0xf1df('0x35'))){_0x1511d6[_0xf1df('0x1d')]=qs[_0xf1df('0x1d')](_0x42c37b['query'][_0xf1df('0x1d')]);_0x1511d6[_0xf1df('0x1c')]=qs[_0xf1df('0x1c')](_0x42c37b['query'][_0xf1df('0x1c')]);}_0x1511d6[_0xf1df('0x36')]=qs['sort'](_0x42c37b[_0xf1df('0x2f')]['sort']);_0x1511d6[_0xf1df('0x37')]=qs[_0xf1df('0x30')](_['pick'](_0x42c37b[_0xf1df('0x2f')],_0x3704a5[_0xf1df('0x30')]));if(_0x42c37b[_0xf1df('0x2f')][_0xf1df('0x38')]){_0x1511d6[_0xf1df('0x37')]=_[_0xf1df('0x39')](_0x1511d6['where'],{'$or':_[_0xf1df('0x28')](_0x3e9096,function(_0x2a6ec0){if(_0x2a6ec0[_0xf1df('0x3a')]!=='VIRTUAL'){var _0x21dde3={};_0x21dde3[_0x2a6ec0[_0xf1df('0x25')]]={'$like':'%'+_0x42c37b['query'][_0xf1df('0x38')]+'%'};return _0x21dde3;}})});}_0x1511d6=_[_0xf1df('0x39')]({},_0x1511d6,_0x42c37b[_0xf1df('0x3b')]);var _0x1c64f6={'where':_0x1511d6[_0xf1df('0x37')]};return db[_0xf1df('0x29')][_0xf1df('0x1b')](_0x1c64f6)[_0xf1df('0x23')](function(_0x3b9be1){_0x5429ff[_0xf1df('0x1b')]=_0x3b9be1;if(_0x42c37b[_0xf1df('0x2f')][_0xf1df('0x3c')]){_0x1511d6['include']=[{'all':!![]}];}return db[_0xf1df('0x29')][_0xf1df('0x3d')](_0x1511d6);})['then'](function(_0x59eb8f){_0x5429ff[_0xf1df('0x3e')]=_0x59eb8f;return _0x5429ff;})[_0xf1df('0x23')](respondWithFilteredResult(_0x2e6fc6,_0x1511d6))[_0xf1df('0x3f')](handleError(_0x2e6fc6,null));};exports[_0xf1df('0x40')]=function(_0x2c1f9e,_0x5255c7){var _0x5c4cb5={'raw':![],'where':{'id':_0x2c1f9e[_0xf1df('0x41')]['id']}},_0x3679de={};_0x3679de[_0xf1df('0x2b')]=_[_0xf1df('0x2e')](db[_0xf1df('0x29')][_0xf1df('0x2a')]);_0x3679de['query']=_[_0xf1df('0x2e')](_0x2c1f9e[_0xf1df('0x2f')]);_0x3679de[_0xf1df('0x30')]=_[_0xf1df('0x31')](_0x3679de[_0xf1df('0x2b')],_0x3679de[_0xf1df('0x2f')]);_0x5c4cb5['attributes']=_['intersection'](_0x3679de[_0xf1df('0x2b')],qs[_0xf1df('0x42')](_0x2c1f9e[_0xf1df('0x2f')][_0xf1df('0x42')]));_0x5c4cb5[_0xf1df('0x32')]=_0x5c4cb5[_0xf1df('0x32')][_0xf1df('0x33')]?_0x5c4cb5[_0xf1df('0x32')]:_0x3679de[_0xf1df('0x2b')];if(_0x2c1f9e[_0xf1df('0x2f')][_0xf1df('0x3c')]){_0x5c4cb5['include']=[{'all':!![]}];}_0x5c4cb5=_[_0xf1df('0x39')]({},_0x5c4cb5,_0x2c1f9e['options']);return db[_0xf1df('0x29')][_0xf1df('0x43')](_0x5c4cb5)[_0xf1df('0x23')](handleEntityNotFound(_0x5255c7,null))['then'](respondWithResult(_0x5255c7,null))[_0xf1df('0x3f')](handleError(_0x5255c7,null));};exports[_0xf1df('0x44')]=function(_0x524053,_0x2d0d0b){return db[_0xf1df('0x29')][_0xf1df('0x44')](_0x524053[_0xf1df('0x45')],{})[_0xf1df('0x23')](respondWithResult(_0x2d0d0b,0xc9))['catch'](handleError(_0x2d0d0b,null));};exports['update']=function(_0x15a8c4,_0x109ce7){if(_0x15a8c4[_0xf1df('0x45')]['id']){delete _0x15a8c4[_0xf1df('0x45')]['id'];}return db['VoiceRecording'][_0xf1df('0x43')]({'where':{'id':_0x15a8c4[_0xf1df('0x41')]['id']}})['then'](handleEntityNotFound(_0x109ce7,null))['then'](saveUpdates(_0x15a8c4[_0xf1df('0x45')],null))[_0xf1df('0x23')](respondWithResult(_0x109ce7,null))[_0xf1df('0x3f')](handleError(_0x109ce7,null));};exports[_0xf1df('0x46')]=function(_0x1c9278,_0x527c45){return db[_0xf1df('0x29')][_0xf1df('0x46')]()[_0xf1df('0x23')](respondWithResult(_0x527c45,null))['catch'](handleError(_0x527c45,null));};exports[_0xf1df('0x47')]=function(_0x47b951,_0x5cc4e0,_0x16afbe){var _0x2f36db=require('../../components/encryptor');var _0x4eb774=![];var _0x540532={};if(_0x47b951[_0xf1df('0x2f')][_0xf1df('0x3a')]&&_0x47b951[_0xf1df('0x2f')][_0xf1df('0x3a')]===_0xf1df('0x48')){_0x540532[_0xf1df('0x48')]=_0x47b951['params']['id'];}else{_0x540532['id']=_0x47b951['params']['id'];}return db['VoiceRecording']['find']({'where':_0x540532,'attributes':['id','value'],'raw':!![]})[_0xf1df('0x23')](handleEntityNotFound(_0x5cc4e0,null))['then'](function(_0x389270){if(_0x389270){var _0x8f22c8=_0x389270['value'];var _0x6d4124=util['format'](_0xf1df('0x49'),_0x8f22c8);if(fs[_0xf1df('0x4a')](_0x6d4124)){_0x4eb774=!![];return _0x2f36db[_0xf1df('0x4b')](_0x6d4124,_0x8f22c8,config[_0xf1df('0x4c')][_0xf1df('0x4d')])['then'](function(){return _0x389270;});}return _0x389270;}})[_0xf1df('0x23')](function(_0x1a6e89){if(_0x1a6e89){var _0x2f6f14=_0x1a6e89[_0xf1df('0x4e')];if(!fs[_0xf1df('0x4a')](_0x2f6f14)){throw new db['Sequelize'][(_0xf1df('0x4f'))](_0xf1df('0x50'));}if(_0x1a6e89['filename']){return _0x5cc4e0['download'](_0x2f6f14,_0x1a6e89[_0xf1df('0x51')]+path[_0xf1df('0x52')](_0x2f6f14),function(){if(_0x4eb774){fs[_0xf1df('0x53')](_0x2f6f14);}});}else{return _0x5cc4e0[_0xf1df('0x47')](_0x2f6f14,function(_0x307d8a){if(_0x4eb774){fs[_0xf1df('0x53')](_0x2f6f14);}});}}})[_0xf1df('0x3f')](function(_0x19e46f){if(_0x19e46f[_0xf1df('0x54')]===_0xf1df('0x50')){_0x5cc4e0[_0xf1df('0x19')](0x194)[_0xf1df('0x26')](_0xf1df('0x55'));}else{return handleError(_0x5cc4e0,null);}});};exports['downloads']=function(_0x34fa2b,_0x3ac396,_0x49c8ad){var _0x4d1f40=require(_0xf1df('0x56'));var _0x4a57c=![];var _0x46ed02={'$and':[db[_0xf1df('0x57')][_0xf1df('0x37')](db['sequelize']['fn'](_0xf1df('0x58'),db[_0xf1df('0x57')]['col']('uniqueid')),_0x34fa2b[_0xf1df('0x2f')][_0xf1df('0x59')])]};if(_0x34fa2b[_0xf1df('0x2f')][_0xf1df('0x3a')]&&_0x34fa2b[_0xf1df('0x2f')][_0xf1df('0x3a')]==='uniqueid'){_0x46ed02[_0xf1df('0x5a')][_0xf1df('0x5b')]({'uniqueid':_0x34fa2b[_0xf1df('0x41')]['id']});}else{_0x46ed02['$and']['push']({'id':_0x34fa2b[_0xf1df('0x41')]['id']});}return db[_0xf1df('0x29')][_0xf1df('0x43')]({'where':_0x46ed02,'attributes':['id',_0xf1df('0x4e')],'raw':!![]})[_0xf1df('0x23')](handleEntityNotFound(_0x3ac396,null))[_0xf1df('0x23')](function(_0x1eb7df){if(_0x1eb7df){var _0xcb750a=util[_0xf1df('0x2d')](_0xf1df('0x49'),_0x1eb7df[_0xf1df('0x4e')]);if(fs['existsSync'](_0xcb750a)){_0x4a57c=!![];return _0x4d1f40[_0xf1df('0x4b')](_0xcb750a,_0x1eb7df[_0xf1df('0x4e')],config[_0xf1df('0x4c')][_0xf1df('0x4d')])[_0xf1df('0x23')](function(){return _0x1eb7df;});}return _0x1eb7df;}})[_0xf1df('0x23')](function(_0x717ea9){if(_0x717ea9){if(!fs[_0xf1df('0x4a')](_0x717ea9[_0xf1df('0x4e')])){throw new db['Sequelize']['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x717ea9['filename']){return _0x3ac396[_0xf1df('0x47')](_0x717ea9[_0xf1df('0x4e')],_0x717ea9[_0xf1df('0x51')]+path['extname'](_0x717ea9[_0xf1df('0x4e')]),function(){if(_0x4a57c){fs['unlink'](_0x717ea9['value']);}});}else{return _0x3ac396[_0xf1df('0x47')](_0x717ea9[_0xf1df('0x4e')],function(_0x4b9a39){if(_0x4a57c){fs[_0xf1df('0x53')](_0x717ea9[_0xf1df('0x4e')]);}});}}})[_0xf1df('0x3f')](handleError(_0x3ac396,null));};exports[_0xf1df('0x24')]=function(_0x3c90b5,_0x14f0ad){return db[_0xf1df('0x29')]['find']({'where':{'id':_0x3c90b5[_0xf1df('0x41')]['id']}})['then'](function(_0x30bf95){if(!_0x30bf95)throw new ReferenceError(_0xf1df('0x5c'));return _0x30bf95;})[_0xf1df('0x23')](function(_0x2d7737){var _0x4925a1=_0x2d7737[_0xf1df('0x4e')];logger['info'](_0xf1df('0x5d'),_0x4925a1);if(!_[_0xf1df('0x5e')](_0x2d7737[_0xf1df('0x4e')])&&fs['existsSync'](_0x4925a1)){logger[_0xf1df('0x5f')](_0xf1df('0x60')+_0x4925a1+_0xf1df('0x61'));fs[_0xf1df('0x62')](_0x4925a1);}_0x4925a1=_0x4925a1+_0xf1df('0x63');if(!_[_0xf1df('0x5e')](_0x2d7737['value'])&&fs['existsSync'](_0x4925a1)){logger['info'](_0xf1df('0x60')+_0x4925a1+_0xf1df('0x61'));fs['unlinkSync'](_0x4925a1);}return _0x2d7737;})['then'](function(_0x3921b6){if(!_0x3921b6)throw new InternalError();return _0x3921b6[_0xf1df('0x24')]();})[_0xf1df('0x23')](function(){_0x14f0ad[_0xf1df('0x19')](0xcc)['end']();})[_0xf1df('0x3f')](handleError(_0x14f0ad,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 48eb988..e79c5ae 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 _0xc40f=['moment','bluebird','path','exports','define','VoiceRecording','uniqueid','util','../../config/logger','api'];(function(_0x587e59,_0x494190){var _0x59242d=function(_0x24f18f){while(--_0x24f18f){_0x587e59['push'](_0x587e59['shift']());}};_0x59242d(++_0x494190);}(_0xc40f,0x1e7));var _0xfc40=function(_0x1b15b4,_0x4b5d7c){_0x1b15b4=_0x1b15b4-0x0;var _0x10d385=_0xc40f[_0x1b15b4];return _0x10d385;};'use strict';var _=require('lodash');var util=require(_0xfc40('0x0'));var logger=require(_0xfc40('0x1'))(_0xfc40('0x2'));var moment=require(_0xfc40('0x3'));var BPromise=require(_0xfc40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc40('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0xfc40('0x6')]=function(_0x2799b2,_0xdbfc9c){return _0x2799b2[_0xfc40('0x7')](_0xfc40('0x8'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xfc40('0x9'),'fields':[_0xfc40('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0701=['uniqueid','lodash','util','../../config/logger','api','moment','rimraf','exports','VoiceRecording'];(function(_0x3ae82a,_0x58fc29){var _0x37259e=function(_0x1b4145){while(--_0x1b4145){_0x3ae82a['push'](_0x3ae82a['shift']());}};_0x37259e(++_0x58fc29);}(_0x0701,0xf4));var _0x1070=function(_0x3b52a9,_0x442d55){_0x3b52a9=_0x3b52a9-0x0;var _0x31ddb8=_0x0701[_0x3b52a9];return _0x31ddb8;};'use strict';var _=require(_0x1070('0x0'));var util=require(_0x1070('0x1'));var logger=require(_0x1070('0x2'))(_0x1070('0x3'));var moment=require(_0x1070('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1070('0x5'));var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0x1070('0x6')]=function(_0x491998,_0x2ba15a){return _0x491998['define'](_0x1070('0x7'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x1070('0x8'),'fields':[_0x1070('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 806707a..1c63238 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x5ebf85,_0x598413){var _0x5b175a=function(_0x3b213a){while(--_0x3b213a){_0x5ebf85['push'](_0x5ebf85['shift']());}};_0x5b175a(++_0x598413);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x3ef2b3,_0x1ca524){var _0xe7016d=function(_0x2c7f00){while(--_0x2c7f00){_0x3ef2b3['push'](_0x3ef2b3['shift']());}};_0xe7016d(++_0x1ca524);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 0ce0d55..b328ca2 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 _0x5d17=['../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','create','exports','multer','util','express','Router'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0x5d17,0x114));var _0x75d1=function(_0x44ae0b,_0x3e9865){_0x44ae0b=_0x44ae0b-0x0;var _0x69232a=_0x5d17[_0x44ae0b];return _0x69232a;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var auth=require(_0x75d1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x75d1('0x5'));var controller=require(_0x75d1('0x6'));router[_0x75d1('0x7')]('/',auth[_0x75d1('0x8')](),controller['index']);router[_0x75d1('0x7')](_0x75d1('0x9'),auth[_0x75d1('0x8')](),controller[_0x75d1('0xa')]);router[_0x75d1('0xb')]('/',auth[_0x75d1('0x8')](),controller[_0x75d1('0xc')]);router['put']('/:id',auth[_0x75d1('0x8')](),controller['update']);router['delete'](_0x75d1('0x9'),auth[_0x75d1('0x8')](),controller['destroy']);module[_0x75d1('0xd')]=router; \ No newline at end of file +var _0x5d58=['../../components/auth/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/:id','show','post','create','update','destroy','exports','Router'];(function(_0x1afe8a,_0x8b5079){var _0x2a99ed=function(_0x395af8){while(--_0x395af8){_0x1afe8a['push'](_0x1afe8a['shift']());}};_0x2a99ed(++_0x8b5079);}(_0x5d58,0x187));var _0x85d5=function(_0x972f62,_0x14002c){_0x972f62=_0x972f62-0x0;var _0x202d2e=_0x5d58[_0x972f62];return _0x202d2e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var auth=require(_0x85d5('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x85d5('0x2'));var controller=require(_0x85d5('0x3'));router['get']('/',auth[_0x85d5('0x4')](),controller[_0x85d5('0x5')]);router[_0x85d5('0x6')](_0x85d5('0x7'),auth['isAuthenticated'](),controller[_0x85d5('0x8')]);router[_0x85d5('0x9')]('/',auth['isAuthenticated'](),controller[_0x85d5('0xa')]);router['put'](_0x85d5('0x7'),auth[_0x85d5('0x4')](),controller[_0x85d5('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x85d5('0xc')]);module[_0x85d5('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index a7abc14..3b5bd0b 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 _0x49d6=['moment','exports','ENUM','blind','STRING','sequelize'];(function(_0x451735,_0x391a76){var _0x41d1e2=function(_0x3566d7){while(--_0x3566d7){_0x451735['push'](_0x451735['shift']());}};_0x41d1e2(++_0x391a76);}(_0x49d6,0x131));var _0x649d=function(_0x3fdacd,_0x2c824b){_0x3fdacd=_0x3fdacd-0x0;var _0x34fc3d=_0x49d6[_0x3fdacd];return _0x34fc3d;};'use strict';var Sequelize=require(_0x649d('0x0'));var moment=require(_0x649d('0x1'));module[_0x649d('0x2')]={'type':{'type':Sequelize[_0x649d('0x3')](_0x649d('0x4'),'attended')},'result':{'type':Sequelize[_0x649d('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x649d('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x649d('0x5')]},'transferercontext':{'type':Sequelize[_0x649d('0x5')]},'transfererexten':{'type':Sequelize[_0x649d('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x649d('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x649d('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x649d('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x649d('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x649d('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x649d('0x5')]},'transfereecontext':{'type':Sequelize[_0x649d('0x5')]},'transfereeexten':{'type':Sequelize[_0x649d('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x649d('0x5')]},'isexternal':{'type':Sequelize[_0x649d('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x649d('0x5')]},'extension':{'type':Sequelize[_0x649d('0x5')]}}; \ No newline at end of file +var _0x6ab8=['Yes','exports','ENUM','blind','attended','STRING'];(function(_0xfd930e,_0x27c6b8){var _0x296c1b=function(_0x4408e6){while(--_0x4408e6){_0xfd930e['push'](_0xfd930e['shift']());}};_0x296c1b(++_0x27c6b8);}(_0x6ab8,0xd3));var _0x86ab=function(_0x52485d,_0x40b3ff){_0x52485d=_0x52485d-0x0;var _0x3dab23=_0x6ab8[_0x52485d];return _0x3dab23;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x86ab('0x0')]={'type':{'type':Sequelize[_0x86ab('0x1')](_0x86ab('0x2'),_0x86ab('0x3'))},'result':{'type':Sequelize[_0x86ab('0x4')]},'transfererchannel':{'type':Sequelize[_0x86ab('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x86ab('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x86ab('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x86ab('0x4')]},'transfererexten':{'type':Sequelize[_0x86ab('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x86ab('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x86ab('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x86ab('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x86ab('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x86ab('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x86ab('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x86ab('0x5'),'No')},'context':{'type':Sequelize[_0x86ab('0x4')]},'extension':{'type':Sequelize[_0x86ab('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 5b7ae34..d8ca111 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.controller.js +++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa571=['set','apply','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit'];(function(_0xade4ca,_0x19bd62){var _0x36a83f=function(_0x66c3bb){while(--_0x66c3bb){_0xade4ca['push'](_0xade4ca['shift']());}};_0x36a83f(++_0x19bd62);}(_0xa571,0x107));var _0x1a57=function(_0xe2b8fc,_0x3ec76a){_0xe2b8fc=_0xe2b8fc-0x0;var _0x1bfefb=_0xa571[_0xe2b8fc];return _0x1bfefb;};'use strict';var pdf=require(_0x1a57('0x0'));var emlformat=require(_0x1a57('0x1'));var rimraf=require(_0x1a57('0x2'));var zipdir=require(_0x1a57('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a57('0x4'));var moment=require(_0x1a57('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a57('0x6'));var path=require('path');var sox=require(_0x1a57('0x7'));var csv=require(_0x1a57('0x8'));var ejs=require(_0x1a57('0x9'));var fs=require('fs');var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x8'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2256af,_0x1911b2){_0x1911b2=_0x1911b2||0xcc;return function(_0x202d9a){if(_0x202d9a){return _0x2256af['sendStatus'](_0x1911b2);}return _0x2256af[_0x1a57('0x17')](_0x1911b2)[_0x1a57('0x18')]();};}function respondWithResult(_0x4c5ed4,_0x503278){_0x503278=_0x503278||0xc8;return function(_0x587422){if(_0x587422){return _0x4c5ed4[_0x1a57('0x17')](_0x503278)[_0x1a57('0x19')](_0x587422);}};}function respondWithFilteredResult(_0x27e824,_0x153d01){return function(_0x5802d6){if(_0x5802d6){var _0x20f7ad=_0x5802d6[_0x1a57('0x1a')],_0x53c61f=_0x153d01[_0x1a57('0x1b')],_0x49ee05=_0x153d01['offset']+_0x153d01[_0x1a57('0x1c')],_0x1b58d7;if(_0x49ee05>=_0x20f7ad){_0x49ee05=_0x20f7ad;_0x1b58d7=0xc8;}else{_0x1b58d7=0xce;}_0x27e824[_0x1a57('0x17')](_0x1b58d7);return _0x27e824[_0x1a57('0x1d')]('Content-Range',_0x53c61f+'-'+_0x49ee05+'/'+_0x20f7ad)[_0x1a57('0x19')](_0x5802d6);}return null;};}function patchUpdates(_0x4262c8){return function(_0x451b34){try{jsonpatch[_0x1a57('0x1e')](_0x451b34,_0x4262c8,!![]);}catch(_0xe936dd){return BPromise['reject'](_0xe936dd);}return _0x451b34['save']();};}function saveUpdates(_0x439844,_0x21e811){return function(_0x211c63){if(_0x211c63){return _0x211c63['update'](_0x439844)['then'](function(_0x51e271){return _0x51e271;});}return null;};}function removeEntity(_0x154cf3,_0x113ad4){return function(_0x3f52b9){if(_0x3f52b9){return _0x3f52b9[_0x1a57('0x1f')]()[_0x1a57('0x20')](function(){_0x154cf3[_0x1a57('0x17')](0xcc)[_0x1a57('0x18')]();});}};}function handleEntityNotFound(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(!_0x35d5dc){_0x2f8b00[_0x1a57('0x21')](0x194);}return _0x35d5dc;};}function handleError(_0x36b17e,_0x26cdd3){_0x26cdd3=_0x26cdd3||0x1f4;return function(_0x1b4cb5){logger[_0x1a57('0x22')](_0x1b4cb5[_0x1a57('0x23')]);if(_0x1b4cb5[_0x1a57('0x24')]){delete _0x1b4cb5[_0x1a57('0x24')];}_0x36b17e[_0x1a57('0x17')](_0x26cdd3)[_0x1a57('0x25')](_0x1b4cb5);};}exports[_0x1a57('0x26')]=function(_0x1dd939,_0x5a53c8){var _0x530401={},_0x139d8c={},_0x22549f={'count':0x0,'rows':[]};var _0x545041=_[_0x1a57('0x27')](db['VoiceTransferReport'][_0x1a57('0x28')],function(_0x4a2901){return{'name':_0x4a2901['fieldName'],'type':_0x4a2901[_0x1a57('0x29')][_0x1a57('0x2a')]};});_0x139d8c[_0x1a57('0x2b')]=_[_0x1a57('0x27')](_0x545041,'name');_0x139d8c[_0x1a57('0x2c')]=_[_0x1a57('0x2d')](_0x1dd939[_0x1a57('0x2c')]);_0x139d8c[_0x1a57('0x2e')]=_['intersection'](_0x139d8c[_0x1a57('0x2b')],_0x139d8c[_0x1a57('0x2c')]);_0x530401[_0x1a57('0x2f')]=_[_0x1a57('0x30')](_0x139d8c[_0x1a57('0x2b')],qs[_0x1a57('0x31')](_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x31')]));_0x530401[_0x1a57('0x2f')]=_0x530401['attributes'][_0x1a57('0x32')]?_0x530401[_0x1a57('0x2f')]:_0x139d8c['model'];if(!_0x1dd939['query'][_0x1a57('0x33')](_0x1a57('0x34'))){_0x530401[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x1c')]);_0x530401[_0x1a57('0x1b')]=qs[_0x1a57('0x1b')](_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x1b')]);}_0x530401[_0x1a57('0x35')]=qs[_0x1a57('0x36')](_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x36')]);_0x530401[_0x1a57('0x37')]=qs[_0x1a57('0x2e')](_[_0x1a57('0x38')](_0x1dd939[_0x1a57('0x2c')],_0x139d8c['filters']));if(_0x1dd939[_0x1a57('0x2c')][_0x1a57('0x39')]){_0x530401[_0x1a57('0x37')]=_[_0x1a57('0x3a')](_0x530401[_0x1a57('0x37')],{'$or':_[_0x1a57('0x27')](_0x545041,function(_0x939976){if(_0x939976[_0x1a57('0x29')]!==_0x1a57('0x3b')){var _0x490119={};_0x490119[_0x939976['name']]={'$like':'%'+_0x1dd939['query']['filter']+'%'};return _0x490119;}})});}_0x530401=_[_0x1a57('0x3a')]({},_0x530401,_0x1dd939[_0x1a57('0x3c')]);var _0xf58eb9={'where':_0x530401['where']};return db[_0x1a57('0x3d')][_0x1a57('0x1a')](_0xf58eb9)[_0x1a57('0x20')](function(_0x347d91){_0x22549f['count']=_0x347d91;if(_0x1dd939[_0x1a57('0x2c')]['includeAll']){_0x530401[_0x1a57('0x3e')]=[{'all':!![]}];}return db[_0x1a57('0x3d')][_0x1a57('0x3f')](_0x530401);})['then'](function(_0x1848cc){_0x22549f[_0x1a57('0x40')]=_0x1848cc;return _0x22549f;})[_0x1a57('0x20')](respondWithFilteredResult(_0x5a53c8,_0x530401))[_0x1a57('0x41')](handleError(_0x5a53c8,null));};exports[_0x1a57('0x42')]=function(_0x528ed3,_0x2eeb71){var _0x47e998={'raw':!![],'where':{'id':_0x528ed3[_0x1a57('0x43')]['id']}},_0x4ba6b3={};_0x4ba6b3['model']=_[_0x1a57('0x2d')](db[_0x1a57('0x3d')][_0x1a57('0x28')]);_0x4ba6b3['query']=_[_0x1a57('0x2d')](_0x528ed3[_0x1a57('0x2c')]);_0x4ba6b3[_0x1a57('0x2e')]=_[_0x1a57('0x30')](_0x4ba6b3['model'],_0x4ba6b3[_0x1a57('0x2c')]);_0x47e998[_0x1a57('0x2f')]=_['intersection'](_0x4ba6b3[_0x1a57('0x2b')],qs['fields'](_0x528ed3['query'][_0x1a57('0x31')]));_0x47e998[_0x1a57('0x2f')]=_0x47e998[_0x1a57('0x2f')][_0x1a57('0x32')]?_0x47e998['attributes']:_0x4ba6b3[_0x1a57('0x2b')];if(_0x528ed3[_0x1a57('0x2c')][_0x1a57('0x44')]){_0x47e998[_0x1a57('0x3e')]=[{'all':!![]}];}_0x47e998=_[_0x1a57('0x3a')]({},_0x47e998,_0x528ed3['options']);return db[_0x1a57('0x3d')][_0x1a57('0x45')](_0x47e998)[_0x1a57('0x20')](handleEntityNotFound(_0x2eeb71,null))[_0x1a57('0x20')](respondWithResult(_0x2eeb71,null))['catch'](handleError(_0x2eeb71,null));};exports[_0x1a57('0x46')]=function(_0x5f1d5f,_0x4bbfc3){return db[_0x1a57('0x3d')][_0x1a57('0x46')](_0x5f1d5f[_0x1a57('0x47')],{})[_0x1a57('0x20')](respondWithResult(_0x4bbfc3,0xc9))[_0x1a57('0x41')](handleError(_0x4bbfc3,null));};exports[_0x1a57('0x48')]=function(_0x401285,_0x29fe1f){if(_0x401285[_0x1a57('0x47')]['id']){delete _0x401285[_0x1a57('0x47')]['id'];}return db[_0x1a57('0x3d')][_0x1a57('0x45')]({'where':{'id':_0x401285['params']['id']}})[_0x1a57('0x20')](handleEntityNotFound(_0x29fe1f,null))[_0x1a57('0x20')](saveUpdates(_0x401285[_0x1a57('0x47')],null))[_0x1a57('0x20')](respondWithResult(_0x29fe1f,null))[_0x1a57('0x41')](handleError(_0x29fe1f,null));};exports[_0x1a57('0x1f')]=function(_0x323af1,_0x3cbb9e){return db[_0x1a57('0x3d')][_0x1a57('0x45')]({'where':{'id':_0x323af1[_0x1a57('0x43')]['id']}})['then'](handleEntityNotFound(_0x3cbb9e,null))[_0x1a57('0x20')](removeEntity(_0x3cbb9e,null))[_0x1a57('0x41')](handleError(_0x3cbb9e,null));}; \ No newline at end of file +var _0xb688=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','error','stack','send','index','VoiceTransferReport','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1c5476,_0x1b8be9){var _0x31dd35=function(_0x3f179){while(--_0x3f179){_0x1c5476['push'](_0x1c5476['shift']());}};_0x31dd35(++_0x1b8be9);}(_0xb688,0xcf));var _0x8b68=function(_0x23f355,_0x1b19f4){_0x23f355=_0x23f355-0x0;var _0x3b9562=_0xb688[_0x23f355];return _0x3b9562;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b68('0x0'));var rimraf=require(_0x8b68('0x1'));var zipdir=require(_0x8b68('0x2'));var jsonpatch=require(_0x8b68('0x3'));var rp=require(_0x8b68('0x4'));var moment=require(_0x8b68('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b68('0x6'));var util=require(_0x8b68('0x7'));var path=require(_0x8b68('0x8'));var sox=require(_0x8b68('0x9'));var csv=require('to-csv');var ejs=require(_0x8b68('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0xf'));var querystring=require(_0x8b68('0x10'));var Papa=require(_0x8b68('0x11'));var Redis=require(_0x8b68('0x12'));var authService=require(_0x8b68('0x13'));var qs=require(_0x8b68('0x14'));var as=require(_0x8b68('0x15'));var hardwareService=require(_0x8b68('0x16'));var logger=require(_0x8b68('0x17'))('api');var utils=require(_0x8b68('0x18'));var config=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x2d8472,_0x1965cf){_0x1965cf=_0x1965cf||0xcc;return function(_0x2f3af4){if(_0x2f3af4){return _0x2d8472[_0x8b68('0x1b')](_0x1965cf);}return _0x2d8472[_0x8b68('0x1c')](_0x1965cf)[_0x8b68('0x1d')]();};}function respondWithResult(_0x5b4364,_0xb2df35){_0xb2df35=_0xb2df35||0xc8;return function(_0x509033){if(_0x509033){return _0x5b4364['status'](_0xb2df35)[_0x8b68('0x1e')](_0x509033);}};}function respondWithFilteredResult(_0x1554d6,_0x27d717){return function(_0x5d3468){if(_0x5d3468){var _0x5c8d0e=_0x5d3468[_0x8b68('0x1f')],_0x23bd52=_0x27d717[_0x8b68('0x20')],_0x5c1e44=_0x27d717[_0x8b68('0x20')]+_0x27d717['limit'],_0x136f1b;if(_0x5c1e44>=_0x5c8d0e){_0x5c1e44=_0x5c8d0e;_0x136f1b=0xc8;}else{_0x136f1b=0xce;}_0x1554d6[_0x8b68('0x1c')](_0x136f1b);return _0x1554d6[_0x8b68('0x21')]('Content-Range',_0x23bd52+'-'+_0x5c1e44+'/'+_0x5c8d0e)[_0x8b68('0x1e')](_0x5d3468);}return null;};}function patchUpdates(_0x3c7e5a){return function(_0x3cf3bd){try{jsonpatch[_0x8b68('0x22')](_0x3cf3bd,_0x3c7e5a,!![]);}catch(_0x38b7a7){return BPromise['reject'](_0x38b7a7);}return _0x3cf3bd[_0x8b68('0x23')]();};}function saveUpdates(_0x4b4b0f,_0x59e9b1){return function(_0x1a9788){if(_0x1a9788){return _0x1a9788[_0x8b68('0x24')](_0x4b4b0f)[_0x8b68('0x25')](function(_0x5603d4){return _0x5603d4;});}return null;};}function removeEntity(_0x571adf,_0x23edc1){return function(_0x59cb26){if(_0x59cb26){return _0x59cb26[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){_0x571adf[_0x8b68('0x1c')](0xcc)[_0x8b68('0x1d')]();});}};}function handleEntityNotFound(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(!_0x59bb8a){_0x32ddc5[_0x8b68('0x1b')](0x194);}return _0x59bb8a;};}function handleError(_0x46e827,_0x4ca77d){_0x4ca77d=_0x4ca77d||0x1f4;return function(_0x1c5808){logger[_0x8b68('0x27')](_0x1c5808[_0x8b68('0x28')]);if(_0x1c5808['name']){delete _0x1c5808['name'];}_0x46e827['status'](_0x4ca77d)[_0x8b68('0x29')](_0x1c5808);};}exports[_0x8b68('0x2a')]=function(_0x2ba2a3,_0x583476){var _0x3311c7={},_0x53aaa2={},_0x4cf89d={'count':0x0,'rows':[]};var _0x3865ea=_['map'](db[_0x8b68('0x2b')][_0x8b68('0x2c')],function(_0x48e2c8){return{'name':_0x48e2c8['fieldName'],'type':_0x48e2c8[_0x8b68('0x2d')][_0x8b68('0x2e')]};});_0x53aaa2[_0x8b68('0x2f')]=_[_0x8b68('0x30')](_0x3865ea,_0x8b68('0x31'));_0x53aaa2[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x2ba2a3['query']);_0x53aaa2[_0x8b68('0x34')]=_['intersection'](_0x53aaa2[_0x8b68('0x2f')],_0x53aaa2[_0x8b68('0x32')]);_0x3311c7['attributes']=_[_0x8b68('0x35')](_0x53aaa2[_0x8b68('0x2f')],qs[_0x8b68('0x36')](_0x2ba2a3['query']['fields']));_0x3311c7[_0x8b68('0x37')]=_0x3311c7[_0x8b68('0x37')][_0x8b68('0x38')]?_0x3311c7[_0x8b68('0x37')]:_0x53aaa2[_0x8b68('0x2f')];if(!_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x39')](_0x8b68('0x3a'))){_0x3311c7[_0x8b68('0x3b')]=qs[_0x8b68('0x3b')](_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3b')]);_0x3311c7[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x3311c7[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3d')]);_0x3311c7[_0x8b68('0x3e')]=qs[_0x8b68('0x34')](_['pick'](_0x2ba2a3['query'],_0x53aaa2[_0x8b68('0x34')]));if(_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3f')]){_0x3311c7[_0x8b68('0x3e')]=_[_0x8b68('0x40')](_0x3311c7[_0x8b68('0x3e')],{'$or':_[_0x8b68('0x30')](_0x3865ea,function(_0x43feb3){if(_0x43feb3['type']!==_0x8b68('0x41')){var _0x2c94d0={};_0x2c94d0[_0x43feb3[_0x8b68('0x31')]]={'$like':'%'+_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3f')]+'%'};return _0x2c94d0;}})});}_0x3311c7=_[_0x8b68('0x40')]({},_0x3311c7,_0x2ba2a3[_0x8b68('0x42')]);var _0x2dd264={'where':_0x3311c7['where']};return db[_0x8b68('0x2b')][_0x8b68('0x1f')](_0x2dd264)[_0x8b68('0x25')](function(_0x374a7c){_0x4cf89d[_0x8b68('0x1f')]=_0x374a7c;if(_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x43')]){_0x3311c7['include']=[{'all':!![]}];}return db[_0x8b68('0x2b')][_0x8b68('0x44')](_0x3311c7);})['then'](function(_0x14ec40){_0x4cf89d[_0x8b68('0x45')]=_0x14ec40;return _0x4cf89d;})['then'](respondWithFilteredResult(_0x583476,_0x3311c7))['catch'](handleError(_0x583476,null));};exports['show']=function(_0x4a093e,_0x423194){var _0x23d24a={'raw':!![],'where':{'id':_0x4a093e[_0x8b68('0x46')]['id']}},_0x515815={};_0x515815['model']=_[_0x8b68('0x33')](db[_0x8b68('0x2b')]['rawAttributes']);_0x515815[_0x8b68('0x32')]=_['keys'](_0x4a093e['query']);_0x515815['filters']=_[_0x8b68('0x35')](_0x515815[_0x8b68('0x2f')],_0x515815[_0x8b68('0x32')]);_0x23d24a[_0x8b68('0x37')]=_['intersection'](_0x515815[_0x8b68('0x2f')],qs['fields'](_0x4a093e[_0x8b68('0x32')][_0x8b68('0x36')]));_0x23d24a['attributes']=_0x23d24a[_0x8b68('0x37')][_0x8b68('0x38')]?_0x23d24a[_0x8b68('0x37')]:_0x515815[_0x8b68('0x2f')];if(_0x4a093e['query'][_0x8b68('0x43')]){_0x23d24a[_0x8b68('0x47')]=[{'all':!![]}];}_0x23d24a=_[_0x8b68('0x40')]({},_0x23d24a,_0x4a093e[_0x8b68('0x42')]);return db[_0x8b68('0x2b')][_0x8b68('0x48')](_0x23d24a)[_0x8b68('0x25')](handleEntityNotFound(_0x423194,null))[_0x8b68('0x25')](respondWithResult(_0x423194,null))[_0x8b68('0x49')](handleError(_0x423194,null));};exports[_0x8b68('0x4a')]=function(_0x1ec2c4,_0x2a2a99){return db[_0x8b68('0x2b')][_0x8b68('0x4a')](_0x1ec2c4[_0x8b68('0x4b')],{})[_0x8b68('0x25')](respondWithResult(_0x2a2a99,0xc9))['catch'](handleError(_0x2a2a99,null));};exports[_0x8b68('0x24')]=function(_0x20681a,_0x5dd099){if(_0x20681a[_0x8b68('0x4b')]['id']){delete _0x20681a['body']['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x20681a[_0x8b68('0x46')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x5dd099,null))[_0x8b68('0x25')](saveUpdates(_0x20681a[_0x8b68('0x4b')],null))['then'](respondWithResult(_0x5dd099,null))['catch'](handleError(_0x5dd099,null));};exports[_0x8b68('0x26')]=function(_0x163fd5,_0x1e900f){return db['VoiceTransferReport'][_0x8b68('0x48')]({'where':{'id':_0x163fd5[_0x8b68('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e900f,null))[_0x8b68('0x25')](removeEntity(_0x1e900f,null))[_0x8b68('0x49')](handleError(_0x1e900f,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c29bd87..8e5a7ab 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 _0x1724=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x1ee5be,_0x5f46e3){var _0x177140=function(_0x162779){while(--_0x162779){_0x1ee5be['push'](_0x1ee5be['shift']());}};_0x177140(++_0x5f46e3);}(_0x1724,0xca));var _0x4172=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x1724[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x4172('0x0'));var util=require('util');var logger=require(_0x4172('0x1'))(_0x4172('0x2'));var moment=require(_0x4172('0x3'));var BPromise=require('bluebird');var rp=require(_0x4172('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4172('0x5'));var config=require(_0x4172('0x6'));var attributes=require(_0x4172('0x7'));module[_0x4172('0x8')]=function(_0x4bc1c7,_0x59e272){return _0x4bc1c7[_0x4172('0x9')](_0x4172('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x112f=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer'];(function(_0x5828cb,_0x232ab4){var _0x170506=function(_0x133c39){while(--_0x133c39){_0x5828cb['push'](_0x5828cb['shift']());}};_0x170506(++_0x232ab4);}(_0x112f,0x11e));var _0xf112=function(_0x27fe63,_0x4b1f52){_0x27fe63=_0x27fe63-0x0;var _0x561534=_0x112f[_0x27fe63];return _0x561534;};'use strict';var _=require(_0xf112('0x0'));var util=require('util');var logger=require(_0xf112('0x1'))('api');var moment=require(_0xf112('0x2'));var BPromise=require(_0xf112('0x3'));var rp=require(_0xf112('0x4'));var fs=require('fs');var path=require(_0xf112('0x5'));var rimraf=require('rimraf');var config=require(_0xf112('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0xf112('0x7')]=function(_0x2ca020,_0x1b060d){return _0x2ca020[_0xf112('0x8')](_0xf112('0x9'),attributes,{'tableName':_0xf112('0xa'),'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 20261c2..60fd6da 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 _0x09ae=['options','raw','CreateVoiceTransferReport','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x09ae,0x6f));var _0xe09a=function(_0x561e86,_0x20d5f9){_0x561e86=_0x561e86-0x0;var _0x4499d3=_0x09ae[_0x561e86];return _0x4499d3;};'use strict';var _=require('lodash');var util=require(_0xe09a('0x0'));var moment=require(_0xe09a('0x1'));var BPromise=require(_0xe09a('0x2'));var rs=require(_0xe09a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe09a('0x4'))['db'];var utils=require(_0xe09a('0x5'));var logger=require('../../config/logger')(_0xe09a('0x6'));var config=require('../../config/environment');var jayson=require(_0xe09a('0x7'));var client=jayson[_0xe09a('0x8')][_0xe09a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15a5a2,_0x140e21,_0x1dfd5d){return new BPromise(function(_0x5cdc7a,_0x46448a){return client['request'](_0x15a5a2,_0x1dfd5d)[_0xe09a('0xa')](function(_0x1cc334){logger[_0xe09a('0xb')](_0xe09a('0xc'),_0x140e21,_0xe09a('0xd'));logger[_0xe09a('0xe')](_0xe09a('0xf'),_0x140e21,'request\x20sent',JSON[_0xe09a('0x10')](_0x1cc334));if(_0x1cc334[_0xe09a('0x11')]){if(_0x1cc334[_0xe09a('0x11')][_0xe09a('0x12')]===0x1f4){logger[_0xe09a('0x11')](_0xe09a('0xc'),_0x140e21,_0x1cc334[_0xe09a('0x11')]['message']);return _0x46448a(_0x1cc334[_0xe09a('0x11')][_0xe09a('0x13')]);}logger['error'](_0xe09a('0xc'),_0x140e21,_0x1cc334[_0xe09a('0x11')][_0xe09a('0x13')]);return _0x5cdc7a(_0x1cc334[_0xe09a('0x11')][_0xe09a('0x13')]);}else{logger['info'](_0xe09a('0xc'),_0x140e21,_0xe09a('0xd'));_0x5cdc7a(_0x1cc334[_0xe09a('0x14')][_0xe09a('0x13')]);}})[_0xe09a('0x15')](function(_0x4441f4){logger[_0xe09a('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x140e21,_0x4441f4);_0x46448a(_0x4441f4);});});}exports['CreateVoiceTransferReport']=function(_0x49be6d){var _0x403e34=this;return new Promise(function(_0x4a878d,_0x364114){return db['VoiceTransferReport'][_0xe09a('0x16')](_0x49be6d[_0xe09a('0x17')],{'raw':_0x49be6d[_0xe09a('0x18')]?_0x49be6d['options'][_0xe09a('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2b795b){logger[_0xe09a('0xb')]('CreateVoiceTransferReport',_0x49be6d);logger['debug'](_0xe09a('0x1a'),_0x49be6d,JSON[_0xe09a('0x10')](_0x2b795b));_0x4a878d(_0x2b795b);})[_0xe09a('0x15')](function(_0x3a5523){logger[_0xe09a('0x11')](_0xe09a('0x1a'),_0x3a5523['message'],_0x49be6d);_0x364114(_0x403e34[_0xe09a('0x11')](0x1f4,_0x3a5523[_0xe09a('0x13')]));});});}; \ No newline at end of file +var _0xe4ba=['request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x206100,_0x2f9bc4){var _0x4c66a1=function(_0x10cba3){while(--_0x10cba3){_0x206100['push'](_0x206100['shift']());}};_0x4c66a1(++_0x2f9bc4);}(_0xe4ba,0x126));var _0xae4b=function(_0x19e4b8,_0xdedf7b){_0x19e4b8=_0x19e4b8-0x0;var _0x587c38=_0xe4ba[_0x19e4b8];return _0x587c38;};'use strict';var _=require(_0xae4b('0x0'));var util=require(_0xae4b('0x1'));var moment=require(_0xae4b('0x2'));var BPromise=require('bluebird');var rs=require(_0xae4b('0x3'));var fs=require('fs');var Redis=require(_0xae4b('0x4'));var db=require(_0xae4b('0x5'))['db'];var utils=require(_0xae4b('0x6'));var logger=require(_0xae4b('0x7'))(_0xae4b('0x8'));var config=require(_0xae4b('0x9'));var jayson=require(_0xae4b('0xa'));var client=jayson[_0xae4b('0xb')][_0xae4b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x439f31,_0x2589db,_0x5d0748){return new BPromise(function(_0x3de5e6,_0xf14d4b){return client[_0xae4b('0xd')](_0x439f31,_0x5d0748)['then'](function(_0x3a3088){logger[_0xae4b('0xe')](_0xae4b('0xf'),_0x2589db,_0xae4b('0x10'));logger[_0xae4b('0x11')](_0xae4b('0x12'),_0x2589db,_0xae4b('0x10'),JSON[_0xae4b('0x13')](_0x3a3088));if(_0x3a3088[_0xae4b('0x14')]){if(_0x3a3088[_0xae4b('0x14')][_0xae4b('0x15')]===0x1f4){logger[_0xae4b('0x14')](_0xae4b('0xf'),_0x2589db,_0x3a3088[_0xae4b('0x14')][_0xae4b('0x16')]);return _0xf14d4b(_0x3a3088[_0xae4b('0x14')][_0xae4b('0x16')]);}logger[_0xae4b('0x14')](_0xae4b('0xf'),_0x2589db,_0x3a3088[_0xae4b('0x14')][_0xae4b('0x16')]);return _0x3de5e6(_0x3a3088[_0xae4b('0x14')][_0xae4b('0x16')]);}else{logger[_0xae4b('0xe')](_0xae4b('0xf'),_0x2589db,_0xae4b('0x10'));_0x3de5e6(_0x3a3088[_0xae4b('0x17')][_0xae4b('0x16')]);}})[_0xae4b('0x18')](function(_0x1f2f16){logger['error'](_0xae4b('0xf'),_0x2589db,_0x1f2f16);_0xf14d4b(_0x1f2f16);});});}exports[_0xae4b('0x19')]=function(_0xd6179c){var _0xaf798a=this;return new Promise(function(_0x2527d3,_0x39827e){return db[_0xae4b('0x1a')]['create'](_0xd6179c[_0xae4b('0x1b')],{'raw':_0xd6179c[_0xae4b('0x1c')]?_0xd6179c[_0xae4b('0x1c')][_0xae4b('0x1d')]===undefined?!![]:![]:!![]})[_0xae4b('0x1e')](function(_0x2db3ac){logger[_0xae4b('0xe')](_0xae4b('0x19'),_0xd6179c);logger[_0xae4b('0x11')](_0xae4b('0x19'),_0xd6179c,JSON[_0xae4b('0x13')](_0x2db3ac));_0x2527d3(_0x2db3ac);})[_0xae4b('0x18')](function(_0x57507a){logger[_0xae4b('0x14')](_0xae4b('0x19'),_0x57507a[_0xae4b('0x16')],_0xd6179c);_0x39827e(_0xaf798a[_0xae4b('0x14')](0x1f4,_0x57507a[_0xae4b('0x16')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 6af875d..4b24887 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x678f=['None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start','Online\x20apps:','map','name','join','filter','status'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0x678f,0x9f));var _0xf678=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x678f[_0x5d72da];return _0x43ebe7;};'use strict';var _=require('lodash');var mysqldb=require(_0xf678('0x0'));var rpc=require(_0xf678('0x1'));var config=require(_0xf678('0x2'));var logger=require(_0xf678('0x3'))(_0xf678('0x4'));var pm2=require(_0xf678('0x5'));var pm2Config=require(_0xf678('0x6'));var schedule=require(_0xf678('0x7'));var chat=require(_0xf678('0x8'));function main(){return mysqldb['db'][_0xf678('0x9')][_0xf678('0xa')]()[_0xf678('0xb')](function(){return rpc[_0xf678('0xc')]();})[_0xf678('0xb')](function(_0x12d3d8){logger[_0xf678('0xd')](_0x12d3d8);return chat[_0xf678('0xe')]();})[_0xf678('0xb')](function(){return schedule['start']();})[_0xf678('0xb')](function(_0x4ce6f0){logger[_0xf678('0xd')](_0x4ce6f0);return pm2[_0xf678('0xe')](pm2Config);})[_0xf678('0xb')](function(_0xe1b9b6){logger[_0xf678('0xd')](_0xf678('0xf'),_[_0xf678('0x10')](_['filter'](_0xe1b9b6,{'status':'online'}),_0xf678('0x11'))[_0xf678('0x12')]());logger['info']('Offline\x20apps:',_[_0xf678('0x10')](_[_0xf678('0x13')](_0xe1b9b6,function(_0x15e226){return _0x15e226[_0xf678('0x14')]!=='online';}),_0xf678('0x11'))[_0xf678('0x12')]()||_0xf678('0x15'));config[_0xf678('0x16')]&&require(_0xf678('0x17'))[_0xf678('0x18')]();require(_0xf678('0x19'))[_0xf678('0x18')]();})[_0xf678('0x1a')](function(_0x33a617){logger[_0xf678('0x1b')](_0xf678('0x1c'),_0x33a617);process[_0xf678('0x1d')](0x1);});}main(); \ No newline at end of file +var _0x25b5=['./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sync','then','listen','info','start','filter','name','join','status','online','None','./config/seedDB','default'];(function(_0x181066,_0x455ebc){var _0xd7ff55=function(_0x2354d4){while(--_0x2354d4){_0x181066['push'](_0x181066['shift']());}};_0xd7ff55(++_0x455ebc);}(_0x25b5,0x116));var _0x525b=function(_0x283977,_0x2991ab){_0x283977=_0x283977-0x0;var _0x519d17=_0x25b5[_0x283977];return _0x519d17;};'use strict';var _=require(_0x525b('0x0'));var mysqldb=require(_0x525b('0x1'));var rpc=require(_0x525b('0x2'));var config=require(_0x525b('0x3'));var logger=require('./config/logger')(_0x525b('0x4'));var pm2=require(_0x525b('0x5'));var pm2Config=require(_0x525b('0x6'));var schedule=require(_0x525b('0x7'));var chat=require(_0x525b('0x8'));function main(){return mysqldb['db']['sequelize'][_0x525b('0x9')]()[_0x525b('0xa')](function(){return rpc[_0x525b('0xb')]();})['then'](function(_0x18d999){logger[_0x525b('0xc')](_0x18d999);return chat[_0x525b('0xd')]();})[_0x525b('0xa')](function(){return schedule[_0x525b('0xd')]();})['then'](function(_0x5a963e){logger[_0x525b('0xc')](_0x5a963e);return pm2[_0x525b('0xd')](pm2Config);})[_0x525b('0xa')](function(_0x444e25){logger[_0x525b('0xc')]('Online\x20apps:',_['map'](_[_0x525b('0xe')](_0x444e25,{'status':'online'}),_0x525b('0xf'))[_0x525b('0x10')]());logger[_0x525b('0xc')]('Offline\x20apps:',_['map'](_[_0x525b('0xe')](_0x444e25,function(_0x320ade){return _0x320ade[_0x525b('0x11')]!==_0x525b('0x12');}),'name')['join']()||_0x525b('0x13'));config['seedDB']&&require(_0x525b('0x14'))[_0x525b('0x15')]();require(_0x525b('0x16'))[_0x525b('0x15')]();})['catch'](function(_0x442a6a){logger[_0x525b('0x17')](_0x525b('0x18'),_0x442a6a);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index fb1f2b4..14fbaa6 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 _0xb10b=['basic-auth','crypto','bluebird','secrets','session','fullname','name','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','catch','headers','authorization','startsWith','Basic','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','User','find','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/license/hardware','lodash','jsonwebtoken','composable-middleware'];(function(_0x27dba7,_0x2ebc9a){var _0x2f2bd9=function(_0x149471){while(--_0x149471){_0x27dba7['push'](_0x27dba7['shift']());}};_0x2f2bd9(++_0x2ebc9a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c70d0,_0xfeac42){_0x5c70d0=_0x5c70d0-0x0;var _0x484491=_0xb10b[_0x5c70d0];return _0x484491;};'use strict';var db=require(_0xbb10('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xbb10('0x1'));var _=require(_0xbb10('0x2'));var jwt=require(_0xbb10('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xbb10('0x4'));var basicAuth=require(_0xbb10('0x5'));var crypto=require(_0xbb10('0x6'));var BPromise=require(_0xbb10('0x7'));var validateJwt=expressJwt({'secret':config[_0xbb10('0x8')][_0xbb10('0x9')]});var userAttributes=['id','role',_0xbb10('0xa'),_0xbb10('0xb'),'internal',_0xbb10('0xc'),_0xbb10('0xd'),_0xbb10('0xe'),_0xbb10('0xf'),_0xbb10('0x10'),_0xbb10('0x11'),_0xbb10('0x12'),_0xbb10('0x13'),'smsPause','openchannelPause',_0xbb10('0x14'),_0xbb10('0x15'),_0xbb10('0x16'),'lastPauseAt',_0xbb10('0x17'),'allowmessenger',_0xbb10('0x18'),_0xbb10('0x19'),_0xbb10('0x1a'),_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x1d'),'phoneBarEnableSettings',_0xbb10('0x1e'),_0xbb10('0x1f'),_0xbb10('0x20'),_0xbb10('0x21'),_0xbb10('0x22'),_0xbb10('0x23'),_0xbb10('0x24')];exports[_0xbb10('0x25')]=function(){return this[_0xbb10('0x26')](!![])[_0xbb10('0x27')](function(_0x4a2bfc,_0x2eca0f,_0x1145f1){if(_0x4a2bfc[_0xbb10('0x28')]){_0x1145f1();}else{return db[_0xbb10('0x29')][_0xbb10('0x2a')]({'where':{'id':_0x4a2bfc[_0xbb10('0x2b')]['id']},'attributes':['id',_0xbb10('0x2c'),_0xbb10('0x2d')],'raw':!![]})[_0xbb10('0x2e')](function(_0xe1c665){if(_0xe1c665&&_0xe1c665['closed']){return _0x2eca0f[_0xbb10('0x2f')](_0xe1c665[_0xbb10('0x2d')]===_0xbb10('0x30')?0x195:0x193)[_0xbb10('0x31')]({'message':_0xe1c665[_0xbb10('0x2d')]===_0xbb10('0x30')?'Unmanaged.':_0xbb10('0x32')});}else{_0x1145f1();}})[_0xbb10('0x33')](function(_0x50aea1){_0x1145f1(_0x50aea1);});}});};exports['isAuthenticated']=function isAuthenticated(_0x8e2b97){return compose()[_0xbb10('0x27')](function(_0x2e911d,_0x317da4,_0x445761){if(_0x2e911d[_0xbb10('0x34')][_0xbb10('0x35')]){if(_[_0xbb10('0x36')](_0x2e911d[_0xbb10('0x34')][_0xbb10('0x35')],_0xbb10('0x37'))){var _0x26ad93=basicAuth(_0x2e911d);db['User']['find']({'where':{'name':_0x26ad93['name']}})[_0xbb10('0x2e')](function(_0x3c5ae7){if(!_0x3c5ae7||!_0x3c5ae7[_0xbb10('0x38')](_0x26ad93['pass'])){return _0x317da4[_0xbb10('0x2f')](0x191)[_0xbb10('0x31')]({'message':_0xbb10('0x39')});}_0x2e911d[_0xbb10('0x28')]={'id':_0x3c5ae7['id']};_0x445761();})[_0xbb10('0x33')](function(_0x20d946){_0x445761(_0x20d946);});}else if(_[_0xbb10('0x36')](_0x2e911d['headers'][_0xbb10('0x35')],_0xbb10('0x3a'))){validateJwt(_0x2e911d,_0x317da4,_0x445761);}else{if(_0x8e2b97){_0x445761();}else{return _0x317da4[_0xbb10('0x2f')](0x193)[_0xbb10('0x31')]({'message':_0xbb10('0x3b')});}}}else if(_0x2e911d[_0xbb10('0x3c')]['apikey']){try{var _0x221624={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xbb10('0x3d')]()};verifyJwt(_0x2e911d['query'][_0xbb10('0x3e')],_0x221624)[_0xbb10('0x2e')](function(_0x1b59f9){return db['User']['find']({'where':{'id':_0x1b59f9[_0xbb10('0x3f')]}})[_0xbb10('0x2e')](function(_0x4f590d){if(!_0x4f590d||!_[_0xbb10('0x40')](_0x4f590d[_0xbb10('0x41')],_0x1b59f9[_0xbb10('0x42')])){return _0x317da4[_0xbb10('0x2f')](0x191)[_0xbb10('0x31')]({'message':_0xbb10('0x43')});}_0x2e911d[_0xbb10('0x28')]={'id':_0x4f590d['id']};_0x445761();});})['catch'](function(){return _0x317da4[_0xbb10('0x2f')](0x191)[_0xbb10('0x31')]({'message':_0xbb10('0x44')});});}catch(_0x8c1ce6){_0x445761(_0x8c1ce6);}}else if(_0x8e2b97){_0x445761();}else{return _0x317da4[_0xbb10('0x2f')](0x193)[_0xbb10('0x31')]({'message':_0xbb10('0x3b')});}})[_0xbb10('0x27')](function(_0x3c8d7d,_0x56943c,_0x2b5352){if(_0x3c8d7d[_0xbb10('0x28')]){db[_0xbb10('0x45')][_0xbb10('0x46')]({'where':{'id':_0x3c8d7d['user']['id']},'attributes':userAttributes})[_0xbb10('0x2e')](function(_0x5de37b){if(!_0x5de37b){return _0x56943c['status'](0x194)[_0xbb10('0x31')]({'message':_0xbb10('0x47')});}_0x3c8d7d[_0xbb10('0x28')]=_0x5de37b;_0x2b5352();})[_0xbb10('0x33')](function(_0x15d895){_0x2b5352(_0x15d895);});}else if(_0x8e2b97){_0x2b5352();}else{return _0x56943c[_0xbb10('0x2f')](0x194)['json']({'message':_0xbb10('0x48')});}});};exports[_0xbb10('0x49')]=function canUpdate(){return compose()['use'](function(_0x5e3fbd,_0x5cd55f,_0x31bee3){return require(_0xbb10('0x4a'))[_0xbb10('0x4b')]()['then'](function(_0x3c0cd7){if(_0x3c0cd7[_0xbb10('0x4c')]){_0x31bee3();}else{return _0x5cd55f[_0xbb10('0x2f')](0x193)['json']({'message':_0xbb10('0x4d')});}})[_0xbb10('0x33')](function(_0x1dcd38){_0x31bee3(_0x1dcd38);});});};exports[_0xbb10('0x4e')]=function(_0x4f1cdd,_0xd238e9,_0x110eb5){_0x4f1cdd['isMiddleware']=!![];return _0x110eb5();};exports[_0xbb10('0x4f')]=function signToken(_0x2e3214){return signJwt(_0x2e3214);};exports[_0xbb10('0x50')]=function(_0x3a9934,_0x2dd35a){if(!_0x3a9934[_0xbb10('0x28')]){return _0x2dd35a['status'](0x194)[_0xbb10('0x31')]({'message':_0xbb10('0x51')});}var _0x3e7b4c={'payload':{'id':_0x3a9934[_0xbb10('0x28')]['id'],'role':_0x3a9934['user'][_0xbb10('0x52')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3e7b4c)[_0xbb10('0x2e')](function(_0x23dc18){_0x2dd35a[_0xbb10('0x53')]('motion.token',_0x23dc18);_0x2dd35a[_0xbb10('0x54')](_0xbb10('0x55'));})['catch'](function(_0x5d9a4f){return _0x2dd35a[_0xbb10('0x2f')](0x1f4)['send'](_0x5d9a4f);});};exports[_0xbb10('0x56')]=function(_0x180933){if(_['isNil'](_0x180933[_0xbb10('0x41')])||_[_0xbb10('0x57')](_0x180933[_0xbb10('0x58')])){return null;}else{return createJwt(_0x180933);}};exports['generateApiKey']=function(_0x2dd02b){_0x2dd02b[_0xbb10('0x41')]=generateNonce();_0x2dd02b[_0xbb10('0x58')]=generateIssuedAt();return createJwt(_0x2dd02b);};exports[_0xbb10('0x59')]=function(_0x36e1fa,_0x19f94d){var _0x190781=_0x36e1fa[_0xbb10('0x3c')][_0xbb10('0x3e')];if(_0x190781){var _0x43b948={'nonce':_0x19f94d[_0xbb10('0x41')],'iat':_0x19f94d[_0xbb10('0x58')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xbb10('0x3d')]()};return verifyJwt(_0x190781,_0x43b948)[_0xbb10('0x2e')](function(){return generateApiKey(_0x19f94d);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0x14e1cb){var _0x2f5027=BPromise[_0xbb10('0x5a')](jwt[_0xbb10('0x5b')],{'context':jwt});var _0x41ea91=_0x14e1cb[_0xbb10('0x5c')]||config[_0xbb10('0x8')]['session'];return new BPromise(function(_0x4a9793,_0xcb3354){_0x2f5027(_0x14e1cb[_0xbb10('0x5d')],_0x41ea91,_0x14e1cb[_0xbb10('0x5e')])['then'](function(_0x5f0c12){_0x4a9793(_0x5f0c12);})[_0xbb10('0x33')](function(_0x34cf4e){_0xcb3354(_0x34cf4e);});});}function verifyJwt(_0x1bd054,_0xf820fe,_0x10159b){var _0x22b315=BPromise[_0xbb10('0x5a')](jwt[_0xbb10('0x5f')],{'context':jwt});var _0x2626d8=_0x10159b||config[_0xbb10('0x8')]['session'];return new BPromise(function(_0x5eafac,_0x412e13){_0x22b315(_0x1bd054,_0x2626d8,_0xf820fe)[_0xbb10('0x2e')](function(_0x36ab7d){_0x5eafac(_0x36ab7d);})[_0xbb10('0x33')](function(_0x36aa7d){_0x412e13(_0x36aa7d);});});}function generateNonce(){return crypto[_0xbb10('0x60')](0x10)[_0xbb10('0x61')](_0xbb10('0x62'));}function generateIssuedAt(){return Math[_0xbb10('0x63')](Date[_0xbb10('0x64')]()/0x3e8)[_0xbb10('0x61')]();}function createJwt(_0x20e18a){var _0x61e689={'payload':{'iat':_0x20e18a[_0xbb10('0x58')],'nonce':_0x20e18a[_0xbb10('0x41')]},'options':{'algorithm':'HS512','subject':_0x20e18a['id'][_0xbb10('0x61')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xbb10('0x3d')]()}};return signJwt(_0x61e689)[_0xbb10('0x2e')](function(_0x1ffe20){return{'iat':_0x20e18a[_0xbb10('0x58')],'nonce':_0x20e18a[_0xbb10('0x41')],'token':_0x1ffe20};});} \ No newline at end of file +var _0xdd4f=['fullname','name','internal','userpic','md5secret','voicePause','chatPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','use','headers','startsWith','authorization','User','find','authenticate','pass','Wrong\x20credentials.','catch','Bearer','query','apikey','getUuid','nonce','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','secrets','payload','options','randomBytes','toString','hex','floor','HS512','../../mysqldb','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','session','role'];(function(_0x3a5ac9,_0xd6b08b){var _0x428e4a=function(_0x5f172d){while(--_0x5f172d){_0x3a5ac9['push'](_0x3a5ac9['shift']());}};_0x428e4a(++_0xd6b08b);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x4fcb08,_0x365ca5){_0x4fcb08=_0x4fcb08-0x0;var _0x3e3bcf=_0xdd4f[_0x4fcb08];return _0x3e3bcf;};'use strict';var db=require(_0xfdd4('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require(_0xfdd4('0x1'));var expressJwt=require(_0xfdd4('0x2'));var compose=require('composable-middleware');var basicAuth=require(_0xfdd4('0x3'));var crypto=require(_0xfdd4('0x4'));var BPromise=require(_0xfdd4('0x5'));var validateJwt=expressJwt({'secret':config['secrets'][_0xfdd4('0x6')]});var userAttributes=['id',_0xfdd4('0x7'),_0xfdd4('0x8'),_0xfdd4('0x9'),_0xfdd4('0xa'),'email',_0xfdd4('0xb'),'permissions',_0xfdd4('0xc'),_0xfdd4('0xd'),_0xfdd4('0xe'),'mailPause',_0xfdd4('0xf'),'smsPause',_0xfdd4('0x10'),_0xfdd4('0x11'),_0xfdd4('0x12'),_0xfdd4('0x13'),_0xfdd4('0x14'),_0xfdd4('0x15'),_0xfdd4('0x16'),_0xfdd4('0x17'),_0xfdd4('0x18'),_0xfdd4('0x19'),_0xfdd4('0x1a'),'phoneBarEnableRecording',_0xfdd4('0x1b'),_0xfdd4('0x1c'),_0xfdd4('0x1d'),'phoneBarPrefixRequired',_0xfdd4('0x1e'),'phoneBarRemoteControlPort',_0xfdd4('0x1f'),_0xfdd4('0x20'),_0xfdd4('0x21')];exports[_0xfdd4('0x22')]=function(){return this[_0xfdd4('0x23')](!![])['use'](function(_0x47ed1d,_0x559c77,_0x3a966d){if(_0x47ed1d[_0xfdd4('0x24')]){_0x3a966d();}else{return db[_0xfdd4('0x25')][_0xfdd4('0x26')]({'where':{'id':_0x47ed1d[_0xfdd4('0x27')]['id']},'attributes':['id',_0xfdd4('0x28'),_0xfdd4('0x29')],'raw':!![]})[_0xfdd4('0x2a')](function(_0x32e00d){if(_0x32e00d&&_0x32e00d['closed']){return _0x559c77[_0xfdd4('0x2b')](_0x32e00d[_0xfdd4('0x29')]===_0xfdd4('0x2c')?0x195:0x193)[_0xfdd4('0x2d')]({'message':_0x32e00d[_0xfdd4('0x29')]===_0xfdd4('0x2c')?_0xfdd4('0x2e'):_0xfdd4('0x2f')});}else{_0x3a966d();}})['catch'](function(_0x2147e6){_0x3a966d(_0x2147e6);});}});};exports[_0xfdd4('0x23')]=function isAuthenticated(_0x2a24e8){return compose()[_0xfdd4('0x30')](function(_0xb7856d,_0x144acd,_0x451767){if(_0xb7856d[_0xfdd4('0x31')]['authorization']){if(_[_0xfdd4('0x32')](_0xb7856d[_0xfdd4('0x31')][_0xfdd4('0x33')],'Basic')){var _0x58fe0d=basicAuth(_0xb7856d);db[_0xfdd4('0x34')][_0xfdd4('0x35')]({'where':{'name':_0x58fe0d[_0xfdd4('0x9')]}})[_0xfdd4('0x2a')](function(_0x4a8790){if(!_0x4a8790||!_0x4a8790[_0xfdd4('0x36')](_0x58fe0d[_0xfdd4('0x37')])){return _0x144acd[_0xfdd4('0x2b')](0x191)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x38')});}_0xb7856d[_0xfdd4('0x24')]={'id':_0x4a8790['id']};_0x451767();})[_0xfdd4('0x39')](function(_0x37b7a2){_0x451767(_0x37b7a2);});}else if(_['startsWith'](_0xb7856d[_0xfdd4('0x31')][_0xfdd4('0x33')],_0xfdd4('0x3a'))){validateJwt(_0xb7856d,_0x144acd,_0x451767);}else{if(_0x2a24e8){_0x451767();}else{return _0x144acd[_0xfdd4('0x2b')](0x193)[_0xfdd4('0x2d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xb7856d[_0xfdd4('0x3b')][_0xfdd4('0x3c')]){try{var _0xbf38b4={'audience':hardwareConf[_0xfdd4('0x3d')](),'issuer':hardwareConf[_0xfdd4('0x3d')]()};verifyJwt(_0xb7856d['query'][_0xfdd4('0x3c')],_0xbf38b4)[_0xfdd4('0x2a')](function(_0x2ab99e){return db['User'][_0xfdd4('0x35')]({'where':{'id':_0x2ab99e['sub']}})[_0xfdd4('0x2a')](function(_0x2b22f9){if(!_0x2b22f9||!_['isEqual'](_0x2b22f9['apiKeyNonce'],_0x2ab99e[_0xfdd4('0x3e')])){return _0x144acd[_0xfdd4('0x2b')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0xb7856d[_0xfdd4('0x24')]={'id':_0x2b22f9['id']};_0x451767();});})[_0xfdd4('0x39')](function(){return _0x144acd[_0xfdd4('0x2b')](0x191)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x3f')});});}catch(_0x265cab){_0x451767(_0x265cab);}}else if(_0x2a24e8){_0x451767();}else{return _0x144acd[_0xfdd4('0x2b')](0x193)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x40')});}})[_0xfdd4('0x30')](function(_0x6ffe30,_0x12b8b1,_0xa5c90e){if(_0x6ffe30[_0xfdd4('0x24')]){db[_0xfdd4('0x34')][_0xfdd4('0x35')]({'where':{'id':_0x6ffe30[_0xfdd4('0x24')]['id']},'attributes':userAttributes})[_0xfdd4('0x2a')](function(_0x2abe77){if(!_0x2abe77){return _0x12b8b1[_0xfdd4('0x2b')](0x194)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x41')});}_0x6ffe30[_0xfdd4('0x24')]=_0x2abe77;_0xa5c90e();})[_0xfdd4('0x39')](function(_0x301824){_0xa5c90e(_0x301824);});}else if(_0x2a24e8){_0xa5c90e();}else{return _0x12b8b1[_0xfdd4('0x2b')](0x194)['json']({'message':_0xfdd4('0x42')});}});};exports[_0xfdd4('0x43')]=function canUpdate(){return compose()[_0xfdd4('0x30')](function(_0x439389,_0x2850f5,_0x5842f1){return require('../../config/license/util')[_0xfdd4('0x44')]()['then'](function(_0xeca9d){if(_0xeca9d[_0xfdd4('0x45')]){_0x5842f1();}else{return _0x2850f5[_0xfdd4('0x2b')](0x193)[_0xfdd4('0x2d')]({'message':'Forbidden'});}})[_0xfdd4('0x39')](function(_0x3feb36){_0x5842f1(_0x3feb36);});});};exports[_0xfdd4('0x46')]=function(_0x2ee857,_0x35b719,_0x7e171){_0x2ee857[_0xfdd4('0x46')]=!![];return _0x7e171();};exports[_0xfdd4('0x47')]=function signToken(_0xe65944){return signJwt(_0xe65944);};exports[_0xfdd4('0x48')]=function(_0x5bcbc8,_0xa7d254){if(!_0x5bcbc8[_0xfdd4('0x24')]){return _0xa7d254[_0xfdd4('0x2b')](0x194)[_0xfdd4('0x2d')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3e2bda={'payload':{'id':_0x5bcbc8[_0xfdd4('0x24')]['id'],'role':_0x5bcbc8[_0xfdd4('0x24')][_0xfdd4('0x7')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3e2bda)[_0xfdd4('0x2a')](function(_0x496747){_0xa7d254[_0xfdd4('0x49')](_0xfdd4('0x4a'),_0x496747);_0xa7d254[_0xfdd4('0x4b')](_0xfdd4('0x4c'));})[_0xfdd4('0x39')](function(_0x1fc778){return _0xa7d254[_0xfdd4('0x2b')](0x1f4)['send'](_0x1fc778);});};exports[_0xfdd4('0x4d')]=function(_0x586713){if(_[_0xfdd4('0x4e')](_0x586713[_0xfdd4('0x4f')])||_[_0xfdd4('0x4e')](_0x586713[_0xfdd4('0x50')])){return null;}else{return createJwt(_0x586713);}};exports['generateApiKey']=function(_0x419578){_0x419578[_0xfdd4('0x4f')]=generateNonce();_0x419578['apiKeyIat']=generateIssuedAt();return createJwt(_0x419578);};exports[_0xfdd4('0x51')]=function(_0xbfaa53,_0x48d422){var _0x218ca5=_0xbfaa53['query']['apikey'];if(_0x218ca5){var _0x4c3dbf={'nonce':_0x48d422[_0xfdd4('0x4f')],'iat':_0x48d422[_0xfdd4('0x50')],'audience':hardwareConf[_0xfdd4('0x3d')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x218ca5,_0x4c3dbf)[_0xfdd4('0x2a')](function(){return generateApiKey(_0x48d422);});}else{throw{'message':_0xfdd4('0x52')};}};function signJwt(_0x4d11d1){var _0x25e3c9=BPromise[_0xfdd4('0x53')](jwt[_0xfdd4('0x54')],{'context':jwt});var _0x2bb94a=_0x4d11d1[_0xfdd4('0x55')]||config[_0xfdd4('0x56')][_0xfdd4('0x6')];return new BPromise(function(_0x2bec0c,_0x393c11){_0x25e3c9(_0x4d11d1[_0xfdd4('0x57')],_0x2bb94a,_0x4d11d1[_0xfdd4('0x58')])[_0xfdd4('0x2a')](function(_0x300965){_0x2bec0c(_0x300965);})[_0xfdd4('0x39')](function(_0x55065e){_0x393c11(_0x55065e);});});}function verifyJwt(_0x4dd1a2,_0x43e631,_0x222902){var _0x1296e6=BPromise[_0xfdd4('0x53')](jwt['verify'],{'context':jwt});var _0x3c6828=_0x222902||config[_0xfdd4('0x56')]['session'];return new BPromise(function(_0x58cdab,_0x53c66d){_0x1296e6(_0x4dd1a2,_0x3c6828,_0x43e631)['then'](function(_0x557cb3){_0x58cdab(_0x557cb3);})[_0xfdd4('0x39')](function(_0x88e9ef){_0x53c66d(_0x88e9ef);});});}function generateNonce(){return crypto[_0xfdd4('0x59')](0x10)[_0xfdd4('0x5a')](_0xfdd4('0x5b'));}function generateIssuedAt(){return Math[_0xfdd4('0x5c')](Date['now']()/0x3e8)[_0xfdd4('0x5a')]();}function createJwt(_0x1f521a){var _0x1dd417={'payload':{'iat':_0x1f521a[_0xfdd4('0x50')],'nonce':_0x1f521a['apiKeyNonce']},'options':{'algorithm':_0xfdd4('0x5d'),'subject':_0x1f521a['id'][_0xfdd4('0x5a')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xfdd4('0x3d')]()}};return signJwt(_0x1dd417)[_0xfdd4('0x2a')](function(_0x555e50){return{'iat':_0x1f521a['apiKeyIat'],'nonce':_0x1f521a[_0xfdd4('0x4f')],'token':_0x555e50};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 153f2c6..704fd72 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','binary','write','end','final','close','decryptFile','createDecipher','update','unlink'];(function(_0x3bbc98,_0x138310){var _0x3f9749=function(_0x42969d){while(--_0x42969d){_0x3bbc98['push'](_0x3bbc98['shift']());}};_0x3f9749(++_0x138310);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x3071('0x0')};function combineOptions(_0x2afa91){var _0x27405a={};for(var _0x305d85 in defaultOptions){if(defaultOptions[_0x3071('0x1')](_0x305d85)){_0x27405a[_0x305d85]=defaultOptions[_0x305d85];}}if(_0x2afa91){for(var _0x52b5fb in _0x2afa91){if(_0x2afa91[_0x3071('0x1')](_0x52b5fb)){_0x27405a[_0x52b5fb]=_0x2afa91[_0x52b5fb];}}}return _0x27405a;}exports[_0x3071('0x2')]=function(_0x33a70c,_0x3137c8,_0xabd7b6,_0x41cf76){return new BPromise(function(_0x1d3dd6,_0x2f1e87){_0x41cf76=combineOptions(_0x41cf76);var _0xbd737f=new Buffer(_0xabd7b6);var _0x22274c=fs[_0x3071('0x3')](_0x33a70c);var _0x2fce7a=fs[_0x3071('0x4')](_0x3137c8);var _0x4a36ec=crypto[_0x3071('0x5')](_0x41cf76[_0x3071('0x6')],_0xbd737f);_0x22274c['on'](_0x3071('0x7'),function(_0xff9a29){var _0x1ce844=new Buffer(_0x4a36ec['update'](_0xff9a29),_0x3071('0x8'));_0x2fce7a[_0x3071('0x9')](_0x1ce844);});_0x22274c['on'](_0x3071('0xa'),function(){try{var _0x3ed4a0=new Buffer(_0x4a36ec[_0x3071('0xb')]('binary'),'binary');_0x2fce7a[_0x3071('0x9')](_0x3ed4a0);_0x2fce7a['end']();_0x2fce7a['on'](_0x3071('0xc'),function(){return _0x1d3dd6(_0x3137c8);});}catch(_0x44fbae){fs['unlink'](_0x3137c8);return _0x2f1e87(_0x44fbae);}});});};exports[_0x3071('0xd')]=function(_0x4e1219,_0x2fc15d,_0x45c93b,_0x1271d0){return new BPromise(function(_0x1f14e1,_0x1caa5d){_0x1271d0=combineOptions(_0x1271d0);var _0x2a6a4b=new Buffer(_0x45c93b);var _0x157a47=fs[_0x3071('0x3')](_0x4e1219);var _0x21aad3=fs[_0x3071('0x4')](_0x2fc15d);var _0x5f3c22=crypto[_0x3071('0xe')](_0x1271d0[_0x3071('0x6')],_0x2a6a4b);_0x157a47['on'](_0x3071('0x7'),function(_0x108a83){var _0x3acf0e=new Buffer(_0x5f3c22[_0x3071('0xf')](_0x108a83),_0x3071('0x8'));_0x21aad3[_0x3071('0x9')](_0x3acf0e);});_0x157a47['on']('end',function(){try{var _0x359e66=new Buffer(_0x5f3c22[_0x3071('0xb')](_0x3071('0x8')),'binary');_0x21aad3[_0x3071('0x9')](_0x359e66);_0x21aad3['end']();_0x21aad3['on'](_0x3071('0xc'),function(){return _0x1f14e1(_0x2fc15d);});}catch(_0x43128c){fs[_0x3071('0x10')](_0x2fc15d);return _0x1caa5d(_0x43128c);}});});}; \ No newline at end of file +var _0xb7e7=['crypto','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','end','final','createDecipher','data','close','unlink'];(function(_0x86bd3e,_0x25c128){var _0x1cd684=function(_0x101bbd){while(--_0x101bbd){_0x86bd3e['push'](_0x86bd3e['shift']());}};_0x1cd684(++_0x25c128);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb7e7[_0x3947c9];return _0x2e7871;};'use strict';var crypto=require(_0x7b7e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x7b7e('0x1')};function combineOptions(_0x518dc6){var _0x1b7cc7={};for(var _0x54a37f in defaultOptions){if(defaultOptions[_0x7b7e('0x2')](_0x54a37f)){_0x1b7cc7[_0x54a37f]=defaultOptions[_0x54a37f];}}if(_0x518dc6){for(var _0x556d68 in _0x518dc6){if(_0x518dc6[_0x7b7e('0x2')](_0x556d68)){_0x1b7cc7[_0x556d68]=_0x518dc6[_0x556d68];}}}return _0x1b7cc7;}exports[_0x7b7e('0x3')]=function(_0x1d9384,_0x52047f,_0x53ed64,_0x333fa4){return new BPromise(function(_0x372bde,_0x7f87e0){_0x333fa4=combineOptions(_0x333fa4);var _0x55ce81=new Buffer(_0x53ed64);var _0x42b871=fs[_0x7b7e('0x4')](_0x1d9384);var _0x2917f9=fs[_0x7b7e('0x5')](_0x52047f);var _0x148964=crypto[_0x7b7e('0x6')](_0x333fa4[_0x7b7e('0x7')],_0x55ce81);_0x42b871['on']('data',function(_0x299519){var _0x1eef0a=new Buffer(_0x148964[_0x7b7e('0x8')](_0x299519),_0x7b7e('0x9'));_0x2917f9[_0x7b7e('0xa')](_0x1eef0a);});_0x42b871['on'](_0x7b7e('0xb'),function(){try{var _0x36d2a3=new Buffer(_0x148964[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x2917f9[_0x7b7e('0xa')](_0x36d2a3);_0x2917f9[_0x7b7e('0xb')]();_0x2917f9['on']('close',function(){return _0x372bde(_0x52047f);});}catch(_0x422d3a){fs['unlink'](_0x52047f);return _0x7f87e0(_0x422d3a);}});});};exports['decryptFile']=function(_0x2889ed,_0xd304f5,_0xf067da,_0x457ec5){return new BPromise(function(_0x3d2fb2,_0x5703fd){_0x457ec5=combineOptions(_0x457ec5);var _0x51baf6=new Buffer(_0xf067da);var _0xc7f087=fs[_0x7b7e('0x4')](_0x2889ed);var _0x27f999=fs[_0x7b7e('0x5')](_0xd304f5);var _0x2cc400=crypto[_0x7b7e('0xd')](_0x457ec5[_0x7b7e('0x7')],_0x51baf6);_0xc7f087['on'](_0x7b7e('0xe'),function(_0x2acb8c){var _0x429a0e=new Buffer(_0x2cc400[_0x7b7e('0x8')](_0x2acb8c),_0x7b7e('0x9'));_0x27f999[_0x7b7e('0xa')](_0x429a0e);});_0xc7f087['on'](_0x7b7e('0xb'),function(){try{var _0x9776c3=new Buffer(_0x2cc400[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x27f999[_0x7b7e('0xa')](_0x9776c3);_0x27f999[_0x7b7e('0xb')]();_0x27f999['on'](_0x7b7e('0xf'),function(){return _0x3d2fb2(_0xd304f5);});}catch(_0x4c0647){fs[_0x7b7e('0x10')](_0xd304f5);return _0x5703fd(_0x4c0647);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index c85ae6e..6aa264a 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 _0xd0bb=['push','QueryTypes','basename','.csv','join','mkdirSync','each','length','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty'];(function(_0x16c7d4,_0x1fd6a5){var _0x54c042=function(_0x2ef67c){while(--_0x2ef67c){_0x16c7d4['push'](_0x16c7d4['shift']());}};_0x54c042(++_0x1fd6a5);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x2d4eba,_0x348848){_0x2d4eba=_0x2d4eba-0x0;var _0x21141d=_0xd0bb[_0x2d4eba];return _0x21141d;};'use strict';var util=require(_0xbd0b('0x0'));var path=require(_0xbd0b('0x1'));var _=require(_0xbd0b('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xbd0b('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xbd0b('0x4'));var db=require(_0xbd0b('0x5'))['db'];var dbH=require('../../mysqldb')[_0xbd0b('0x6')];var logger=require('../../config/logger')(_0xbd0b('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xbd0b('0x8')][0x2]);var QUERY=process[_0xbd0b('0x8')][0x3];var PATH=process[_0xbd0b('0x8')][0x4];function analyticExtractedReport(_0x809599,_0x5eb975){var _0x2a4075={'status':_0x809599};var _0x4533ff={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5eb975){_0x2a4075[_0xbd0b('0x9')]=_0x5eb975;}return db[_0xbd0b('0xa')][_0xbd0b('0xb')](_0x2a4075,_0x4533ff);}function main(){var _0x53d5e8=0x1388;var _0x51cf98;logger[_0xbd0b('0xc')](util[_0xbd0b('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbd0b('0xe')));return db[_0xbd0b('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbd0b('0x10'),_0xbd0b('0x11')]})[_0xbd0b('0x12')](function(_0x315ed9){if(_0x315ed9){_0x51cf98=_0x315ed9;_0x53d5e8=_0x51cf98[_0xbd0b('0x11')]||0x1388;}})[_0xbd0b('0x12')](function(){return dbH[_0xbd0b('0x13')][_0xbd0b('0x14')](util[_0xbd0b('0xd')](_0xbd0b('0x15'),QUERY),{'type':dbH[_0xbd0b('0x13')]['QueryTypes'][_0xbd0b('0x16')]});})['then'](function(_0x4a8014){if(!_0x4a8014[0x0][_0xbd0b('0x17')]){return analyticExtractedReport(_0xbd0b('0x18'));}var _0x3183cf=[];var _0x40b075=0x0;var _0x39b0fe=!![];if(_0x4a8014&&_0x4a8014['length']){var _0x55e0a1=_0x4a8014[0x0][_0xbd0b('0x17')]%(_0x40b075+_0x53d5e8);if(_0x51cf98[_0xbd0b('0x10')]){for(;_0x39b0fe;_0x40b075+=_0x53d5e8,_0x55e0a1=_0x4a8014[0x0][_0xbd0b('0x17')]%(_0x40b075+_0x53d5e8)){if(_0x55e0a1==0x0||_0x55e0a1==_0x4a8014[0x0][_0xbd0b('0x17')]){_0x39b0fe=![];}_0x3183cf[_0xbd0b('0x19')](dbH[_0xbd0b('0x13')]['query'](util[_0xbd0b('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x53d5e8,_0x40b075),{'type':dbH[_0xbd0b('0x13')][_0xbd0b('0x1a')][_0xbd0b('0x16')]}));}}else{_0x3183cf[_0xbd0b('0x19')](dbH['sequelize'][_0xbd0b('0x14')](QUERY,{'type':dbH[_0xbd0b('0x13')][_0xbd0b('0x1a')]['SELECT']}));}}var _0x1c5b52=path['dirname'](PATH);var _0xc66b8=path[_0xbd0b('0x1b')](PATH,_0xbd0b('0x1c'));var _0x17a92a=_0x51cf98[_0xbd0b('0x10')]&&_0x3183cf['length']>0x1;var _0x75909f=[];if(!fs['existsSync'](path[_0xbd0b('0x1d')](_0x1c5b52,_0xc66b8))&&_0x17a92a){fs[_0xbd0b('0x1e')](path[_0xbd0b('0x1d')](_0x1c5b52,_0xc66b8));}return BPromise[_0xbd0b('0x1f')](_0x3183cf,function(_0xfd9f82){_0x75909f[_0xbd0b('0x19')](_0xfd9f82);})['then'](function(){for(var _0x382f76=0x0;_0x382f76<_0x75909f[_0xbd0b('0x20')];_0x382f76+=0x1){var _0x33b752;var _0x1b5a00=_0x75909f[_0x382f76];if(_0x17a92a){_0x33b752=path[_0xbd0b('0x1d')](_0x1c5b52,_0xc66b8,util[_0xbd0b('0xd')]('%s%d.%s',_0xc66b8,_0x382f76,_0xbd0b('0x21')));}else{_0x33b752=path[_0xbd0b('0x1d')](_0x1c5b52,util[_0xbd0b('0xd')]('%s.%s',_0xc66b8,'csv'));}fs[_0xbd0b('0x22')](_0x33b752,csv(_0x1b5a00));}})[_0xbd0b('0x12')](function(){if(_0x17a92a){zipdir(path[_0xbd0b('0x1d')](_0x1c5b52,_0xc66b8),{'saveTo':path[_0xbd0b('0x1d')](_0x1c5b52,util[_0xbd0b('0xd')](_0xbd0b('0x23'),_0xc66b8,_0xbd0b('0x24')))},function(_0x4bc752,_0x45f7d6){});rimraf(path[_0xbd0b('0x1d')](_0x1c5b52,_0xc66b8),function(){});}})['then'](function(){logger['info'](util[_0xbd0b('0xd')](_0xbd0b('0x25'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbd0b('0x26'),_0x17a92a?util[_0xbd0b('0xd')](_0xbd0b('0x23'),_0xc66b8,_0x17a92a?_0xbd0b('0x24'):_0xbd0b('0x21')):null);});})[_0xbd0b('0x27')](function(_0x5f224e){logger[_0xbd0b('0xc')](util[_0xbd0b('0xd')](_0xbd0b('0x28'),EXTRACTED_REPORT_ID,_0xbd0b('0xe')),util[_0xbd0b('0x29')](_0x5f224e,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbd0b('0x2a'));});}main(); \ No newline at end of file +var _0xf4eb=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','basename','existsSync','join','mkdirSync','then','%s%d.%s','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Setting','split','splitSizeCsv','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4eb,0xec));var _0xbf4e=function(_0x491a46,_0x352ce3){_0x491a46=_0x491a46-0x0;var _0x2c4dc4=_0xf4eb[_0x491a46];return _0x2c4dc4;};'use strict';var util=require(_0xbf4e('0x0'));var path=require('path');var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xbf4e('0x1'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xbf4e('0x2'))[_0xbf4e('0x3')];var logger=require(_0xbf4e('0x4'))(_0xbf4e('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0xbf4e('0x6')][0x2]);var QUERY=process[_0xbf4e('0x6')][0x3];var PATH=process[_0xbf4e('0x6')][0x4];function analyticExtractedReport(_0x540736,_0x449d55){var _0x5013c2={'status':_0x540736};var _0x5e23d4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x449d55){_0x5013c2[_0xbf4e('0x7')]=_0x449d55;}return db[_0xbf4e('0x8')][_0xbf4e('0x9')](_0x5013c2,_0x5e23d4);}function main(){var _0xc86f04=0x1388;var _0x5da823;logger[_0xbf4e('0xa')](util[_0xbf4e('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xbf4e('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbf4e('0xd'),_0xbf4e('0xe')]})['then'](function(_0x17fd01){if(_0x17fd01){_0x5da823=_0x17fd01;_0xc86f04=_0x5da823['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0xbf4e('0xf')][_0xbf4e('0x10')](util[_0xbf4e('0xb')](_0xbf4e('0x11'),QUERY),{'type':dbH[_0xbf4e('0xf')][_0xbf4e('0x12')]['SELECT']});})['then'](function(_0x180432){if(!_0x180432[0x0][_0xbf4e('0x13')]){return analyticExtractedReport(_0xbf4e('0x14'));}var _0x542909=[];var _0x14110b=0x0;var _0x2c292c=!![];if(_0x180432&&_0x180432[_0xbf4e('0x15')]){var _0x320e7d=_0x180432[0x0]['num']%(_0x14110b+_0xc86f04);if(_0x5da823[_0xbf4e('0xd')]){for(;_0x2c292c;_0x14110b+=_0xc86f04,_0x320e7d=_0x180432[0x0]['num']%(_0x14110b+_0xc86f04)){if(_0x320e7d==0x0||_0x320e7d==_0x180432[0x0]['num']){_0x2c292c=![];}_0x542909['push'](dbH['sequelize'][_0xbf4e('0x10')](util[_0xbf4e('0xb')](_0xbf4e('0x16'),QUERY,_0xc86f04,_0x14110b),{'type':dbH['sequelize']['QueryTypes'][_0xbf4e('0x17')]}));}}else{_0x542909[_0xbf4e('0x18')](dbH[_0xbf4e('0xf')][_0xbf4e('0x10')](QUERY,{'type':dbH[_0xbf4e('0xf')][_0xbf4e('0x12')][_0xbf4e('0x17')]}));}}var _0x3d642a=path[_0xbf4e('0x19')](PATH);var _0x376832=path[_0xbf4e('0x1a')](PATH,'.csv');var _0x1ff2ec=_0x5da823[_0xbf4e('0xd')]&&_0x542909['length']>0x1;var _0x31e3f5=[];if(!fs[_0xbf4e('0x1b')](path[_0xbf4e('0x1c')](_0x3d642a,_0x376832))&&_0x1ff2ec){fs[_0xbf4e('0x1d')](path[_0xbf4e('0x1c')](_0x3d642a,_0x376832));}return BPromise['each'](_0x542909,function(_0x90635e){_0x31e3f5[_0xbf4e('0x18')](_0x90635e);})[_0xbf4e('0x1e')](function(){for(var _0x5766d4=0x0;_0x5766d4<_0x31e3f5[_0xbf4e('0x15')];_0x5766d4+=0x1){var _0x5e08b1;var _0x5bcf71=_0x31e3f5[_0x5766d4];if(_0x1ff2ec){_0x5e08b1=path[_0xbf4e('0x1c')](_0x3d642a,_0x376832,util['format'](_0xbf4e('0x1f'),_0x376832,_0x5766d4,_0xbf4e('0x20')));}else{_0x5e08b1=path[_0xbf4e('0x1c')](_0x3d642a,util[_0xbf4e('0xb')]('%s.%s',_0x376832,_0xbf4e('0x20')));}fs[_0xbf4e('0x21')](_0x5e08b1,csv(_0x5bcf71));}})[_0xbf4e('0x1e')](function(){if(_0x1ff2ec){zipdir(path['join'](_0x3d642a,_0x376832),{'saveTo':path[_0xbf4e('0x1c')](_0x3d642a,util['format'](_0xbf4e('0x22'),_0x376832,_0xbf4e('0x23')))},function(_0xb8b58e,_0x498dbd){});rimraf(path[_0xbf4e('0x1c')](_0x3d642a,_0x376832),function(){});}})[_0xbf4e('0x1e')](function(){logger[_0xbf4e('0xa')](util[_0xbf4e('0xb')](_0xbf4e('0x24'),EXTRACTED_REPORT_ID,_0xbf4e('0x25')));return analyticExtractedReport('Completed',_0x1ff2ec?util[_0xbf4e('0xb')](_0xbf4e('0x22'),_0x376832,_0x1ff2ec?'zip':_0xbf4e('0x20')):null);});})[_0xbf4e('0x26')](function(_0x5473ed){logger[_0xbf4e('0xa')](util['format'](_0xbf4e('0x27'),EXTRACTED_REPORT_ID,'CSV'),util[_0xbf4e('0x28')](_0x5473ed,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbf4e('0x29'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0fea6fd..5c7f094 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x1d1171,_0x3beda1){var _0x3c5ec8=function(_0x13236f){while(--_0x13236f){_0x1d1171['push'](_0x1d1171['shift']());}};_0x3c5ec8(++_0x3beda1);}(_0xb10b,0x12a));var _0xbb10=function(_0x1bd247,_0x14f195){_0x1bd247=_0x1bd247-0x0;var _0x54d8d5=_0xb10b[_0x1bd247];return _0x54d8d5;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file +var _0x5f2f=['hasOwnProperty','push','num','Empty','dirname','basename','Setting','find','split','splitSizePdf','then','length','query','format','QueryTypes','SELECT','sequelize','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','createWriteStream','finish','err','end','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x3b1823,_0xb6bd67){var _0x3f2603=function(_0x3dc999){while(--_0x3dc999){_0x3b1823['push'](_0x3b1823['shift']());}};_0x3f2603(++_0xb6bd67);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3eeb67,_0x474174){_0x3eeb67=_0x3eeb67-0x0;var _0x3a88d9=_0x5f2f[_0x3eeb67];return _0x3a88d9;};'use strict';var _=require(_0xf5f2('0x0'));var fs=require('fs');var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var PdfPrinter=require(_0xf5f2('0x5'));var zipdir=require(_0xf5f2('0x6'));var rimraf=require(_0xf5f2('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5f2('0x8')];var logger=require(_0xf5f2('0x9'))(_0xf5f2('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf5f2('0xb')][0x2]);var QUERY=process[_0xf5f2('0xb')][0x3];var PATH=process[_0xf5f2('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5f2('0xc');var _extractedReport;function analyticExtractedReport(_0x46cd9c,_0x2ec345){var _0x56a69f={'status':_0x46cd9c};var _0x375da4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ec345){_0x56a69f[_0xf5f2('0xd')]=_0x2ec345;}return db[_0xf5f2('0xe')]['update'](_0x56a69f,_0x375da4);}function getHeader(_0x977a59){var _0x4ebbbe=[];for(var _0x53fb33 in _0x977a59){if(_0x977a59[_0xf5f2('0xf')](_0x53fb33)){_0x4ebbbe[_0xf5f2('0x10')]({'text':_0x53fb33,'style':'tableHeader'});}}return _0x4ebbbe;}function extractReport(_0x336f6b){var _0x14b51f=0x1388;var _0x331482;if(!_0x336f6b[0x0][_0xf5f2('0x11')]){return analyticExtractedReport(_0xf5f2('0x12'));}var _0x3e5956=[];var _0x5c01b8=0x0;var _0x5850f4=!![];var _0xea612c=path[_0xf5f2('0x13')](PATH);var _0x1c1a5c=path[_0xf5f2('0x14')](PATH,'.pdf');var _0xafe430=![];var _0x286197=[];return db[_0xf5f2('0x15')][_0xf5f2('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5f2('0x17'),_0xf5f2('0x18')]})[_0xf5f2('0x19')](function(_0x395a5a){if(_0x395a5a){_0x331482=_0x395a5a;_0x14b51f=_0x331482[_0xf5f2('0x18')]||0x3e8;}})[_0xf5f2('0x19')](function(){if(_0x336f6b&&_0x336f6b[_0xf5f2('0x1a')]){var _0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f);if(_0x331482[_0xf5f2('0x17')]){for(;_0x5850f4;_0x5c01b8+=_0x14b51f,_0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f)){if(_0x28e097==0x0||_0x28e097==_0x336f6b[0x0][_0xf5f2('0x11')]){_0x5850f4=![];}_0x3e5956[_0xf5f2('0x10')](dbH['sequelize'][_0xf5f2('0x1b')](util[_0xf5f2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14b51f,_0x5c01b8),{'type':dbH['sequelize'][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}else{_0x3e5956['push'](dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](QUERY,{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}_0xafe430=_0x331482['split']&&_0x3e5956[_0xf5f2('0x1a')]>0x1;if(!fs[_0xf5f2('0x20')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c))&&_0xafe430){fs[_0xf5f2('0x22')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c));}return BPromise['each'](_0x3e5956,function(_0x529f07){_0x286197[_0xf5f2('0x10')](_0x529f07);});})[_0xf5f2('0x19')](function(){return BPromise[_0xf5f2('0x23')](_0x3e5956,function(_0x1a5bb3,_0xf6c58d){var _0x788a8d;var _0x13a3be=util[_0xf5f2('0x1c')](_0xf5f2('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xf5f2('0x25')])[_0xf5f2('0x1c')](FORMAT),moment(_extractedReport[_0xf5f2('0x26')])[_0xf5f2('0x1c')](FORMAT));var _0x198c73={'pageSize':'A4','pageOrientation':_0xf5f2('0x27'),'content':[{'text':_0x13a3be,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x22c826={'headerRows':0x1,'body':[]};_0x22c826[_0xf5f2('0x28')][_0xf5f2('0x10')](getHeader(_0x1a5bb3[0x0]));var _0x5027ab;for(var _0x5a2c7e=0x0;_0x5a2c7e<_0x1a5bb3[_0xf5f2('0x1a')];_0x5a2c7e+=0x1){_0x5027ab=[];for(var _0x50b8a2 in _0x1a5bb3[_0x5a2c7e]){if(_0x1a5bb3[_0x5a2c7e][_0xf5f2('0xf')](_0x50b8a2)){_0x5027ab[_0xf5f2('0x10')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]?_[_0xf5f2('0x29')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]):'');}}_0x22c826['body']['push'](_0x5027ab);}_0x198c73[_0xf5f2('0x2a')]['push']({'table':_0x22c826});return new BPromise(function(_0xb744b9,_0x58a4df){var _0x45b643=new PdfPrinter({'Roboto':{'normal':__dirname+_0xf5f2('0x2b'),'bold':__dirname+_0xf5f2('0x2c'),'italics':__dirname+_0xf5f2('0x2d'),'bolditalics':__dirname+_0xf5f2('0x2e')}});var _0x277eee=_0x45b643[_0xf5f2('0x2f')](_0x198c73);if(_0xafe430){_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c,util['format'](_0xf5f2('0x30'),_0x1c1a5c,_0xf6c58d,_0xf5f2('0x31')));}else{_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xf5f2('0x31')));}var _0x297c0c=_0x277eee['pipe'](fs[_0xf5f2('0x33')](_0x788a8d));_0x297c0c['on'](_0xf5f2('0x34'),function(){_0xb744b9();});_0x297c0c['on']('error',function(_0x3fc168){console['log'](_0xf5f2('0x35'),_0x3fc168);_0x58a4df(_0x3fc168);});_0x277eee[_0xf5f2('0x36')]();});});})[_0xf5f2('0x19')](function(){if(_0xafe430){return new BPromise(function(_0x2e3cca,_0x59a6dd){zipdir(path['join'](_0xea612c,_0x1c1a5c),{'saveTo':path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,'zip'))},function(_0x41447f){if(_0x41447f){_0x59a6dd(_0x41447f);}else{_0x2e3cca();}});});}})['then'](function(){if(_0xafe430){rimraf(path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c),function(){});}})['then'](function(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf5f2('0x38')));return analyticExtractedReport(_0xf5f2('0x39'),_0xafe430?util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xafe430?'zip':'pdf'):null);});}function main(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')](_0xf5f2('0x3a'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')));return db[_0xf5f2('0xe')][_0xf5f2('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5f2('0x19')](function(_0x4c0ac7){_extractedReport=_0x4c0ac7;return dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](util['format'](_0xf5f2('0x3d'),QUERY),{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]});})[_0xf5f2('0x19')](extractReport)[_0xf5f2('0x3e')](function(_0x462ea3){logger[_0xf5f2('0x37')](util['format'](_0xf5f2('0x3f'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')),util[_0xf5f2('0x40')](_0x462ea3,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 6faead0..7b5f280 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 _0x9632=['zip-dir','rimraf','dbH','../../config/logger','analytics','argv','update','info','format','XLSX','Setting','find','split','then','splitSizeXlsx','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','join','mkdirSync','each','length','%s.%s','xlsx','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','lodash','json2xls','bluebird'];(function(_0x43745b,_0x448eb5){var _0x14051f=function(_0x38bf92){while(--_0x38bf92){_0x43745b['push'](_0x43745b['shift']());}};_0x14051f(++_0x448eb5);}(_0x9632,0x109));var _0x2963=function(_0x11b461,_0x4f7af9){_0x11b461=_0x11b461-0x0;var _0x30c380=_0x9632[_0x11b461];return _0x30c380;};'use strict';var util=require(_0x2963('0x0'));var path=require(_0x2963('0x1'));var _=require(_0x2963('0x2'));var fs=require('fs');var json2xls=require(_0x2963('0x3'));var BPromise=require(_0x2963('0x4'));var zipdir=require(_0x2963('0x5'));var rimraf=require(_0x2963('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x2963('0x7')];var logger=require(_0x2963('0x8'))(_0x2963('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x2963('0xa')][0x2]);var QUERY=process[_0x2963('0xa')][0x3];var PATH=process[_0x2963('0xa')][0x4];function analyticExtractedReport(_0xbda6fd,_0x43ac6a){var _0x1008e9={'status':_0xbda6fd};var _0x20fb54={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x43ac6a){_0x1008e9['savename']=_0x43ac6a;}return db['AnalyticExtractedReport'][_0x2963('0xb')](_0x1008e9,_0x20fb54);}function main(){var _0x4d2be3=0x1388;var _0x58ff91;logger[_0x2963('0xc')](util[_0x2963('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2963('0xe')));return db[_0x2963('0xf')][_0x2963('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2963('0x11'),'splitSizeXlsx']})[_0x2963('0x12')](function(_0x544329){if(_0x544329){_0x58ff91=_0x544329;_0x4d2be3=_0x58ff91[_0x2963('0x13')]||0x1388;}})[_0x2963('0x12')](function(){return dbH['sequelize'][_0x2963('0x14')](util['format'](_0x2963('0x15'),QUERY),{'type':dbH[_0x2963('0x16')][_0x2963('0x17')][_0x2963('0x18')]});})[_0x2963('0x12')](function(_0x264c13){if(!_0x264c13[0x0][_0x2963('0x19')]){return analyticExtractedReport(_0x2963('0x1a'));}var _0x5cb845=[];var _0x331b2e=0x0;var _0x11d35d=!![];if(_0x58ff91[_0x2963('0x11')]){if(_0x264c13&&_0x264c13['length']){var _0x442278=_0x264c13[0x0]['num']%(_0x331b2e+_0x4d2be3);for(;_0x11d35d;_0x331b2e+=_0x4d2be3,_0x442278=_0x264c13[0x0]['num']%(_0x331b2e+_0x4d2be3)){if(_0x442278==0x0||_0x442278==_0x264c13[0x0][_0x2963('0x19')]){_0x11d35d=![];}_0x5cb845[_0x2963('0x1b')](dbH[_0x2963('0x16')][_0x2963('0x14')](util[_0x2963('0xd')](_0x2963('0x1c'),QUERY,_0x4d2be3,_0x331b2e),{'type':dbH[_0x2963('0x16')][_0x2963('0x17')][_0x2963('0x18')]}));}}}else{_0x5cb845['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x2963('0x16')]['QueryTypes'][_0x2963('0x18')]}));}var _0x19aa41=path['dirname'](PATH);var _0x1b3b5d=path[_0x2963('0x1d')](PATH,_0x2963('0x1e'));var _0x47509e=_0x58ff91[_0x2963('0x11')]&&_0x5cb845['length']>0x1;var _0x306746=[];if(!fs['existsSync'](path[_0x2963('0x1f')](_0x19aa41,_0x1b3b5d))&&_0x47509e){fs[_0x2963('0x20')](path['join'](_0x19aa41,_0x1b3b5d));}return BPromise[_0x2963('0x21')](_0x5cb845,function(_0xaecf9a){_0x306746[_0x2963('0x1b')](_0xaecf9a);})[_0x2963('0x12')](function(){for(var _0x2c07d3=0x0;_0x2c07d3<_0x306746[_0x2963('0x22')];_0x2c07d3+=0x1){var _0x18dfbb;var _0x567697=_0x306746[_0x2c07d3];if(_0x47509e){_0x18dfbb=path[_0x2963('0x1f')](_0x19aa41,_0x1b3b5d,util[_0x2963('0xd')]('%s%d.%s',_0x1b3b5d,_0x2c07d3,'xlsx'));}else{_0x18dfbb=path[_0x2963('0x1f')](_0x19aa41,util[_0x2963('0xd')](_0x2963('0x23'),_0x1b3b5d,_0x2963('0x24')));}fs[_0x2963('0x25')](_0x18dfbb,json2xls(_0x567697),_0x2963('0x26'));}})['then'](function(){if(_0x47509e){zipdir(path[_0x2963('0x1f')](_0x19aa41,_0x1b3b5d),{'saveTo':path['join'](_0x19aa41,util[_0x2963('0xd')]('%s.%s',_0x1b3b5d,_0x2963('0x27')))},function(_0x2d8ece,_0x3cd2be){});rimraf(path[_0x2963('0x1f')](_0x19aa41,_0x1b3b5d),function(){});}})[_0x2963('0x12')](function(){logger['info'](util[_0x2963('0xd')](_0x2963('0x28'),EXTRACTED_REPORT_ID,_0x2963('0xe')));return analyticExtractedReport(_0x2963('0x29'),_0x47509e?util[_0x2963('0xd')](_0x2963('0x23'),_0x1b3b5d,_0x47509e?_0x2963('0x27'):_0x2963('0x24')):null);});})[_0x2963('0x2a')](function(_0x2d233b){logger[_0x2963('0xc')](util['format'](_0x2963('0x2b'),EXTRACTED_REPORT_ID,_0x2963('0xe')),util['inspect'](_0x2d233b,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x2963('0x2c'));});}main(); \ No newline at end of file +var _0x506e=['%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT','split','num','push','QueryTypes','dirname','.xlsx','mkdirSync','join','each','length'];(function(_0xfacca4,_0x1ac60f){var _0x5e2787=function(_0x566e41){while(--_0x566e41){_0xfacca4['push'](_0xfacca4['shift']());}};_0x5e2787(++_0x1ac60f);}(_0x506e,0x68));var _0xe506=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x506e[_0x27af45];return _0x18df21;};'use strict';var util=require(_0xe506('0x0'));var path=require(_0xe506('0x1'));var _=require(_0xe506('0x2'));var fs=require('fs');var json2xls=require(_0xe506('0x3'));var BPromise=require(_0xe506('0x4'));var zipdir=require(_0xe506('0x5'));var rimraf=require(_0xe506('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xe506('0x7'))[_0xe506('0x8')];var logger=require(_0xe506('0x9'))(_0xe506('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xe506('0xb')][0x2]);var QUERY=process[_0xe506('0xb')][0x3];var PATH=process[_0xe506('0xb')][0x4];function analyticExtractedReport(_0x58f623,_0x27806a){var _0x16c77d={'status':_0x58f623};var _0xd1032c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x27806a){_0x16c77d[_0xe506('0xc')]=_0x27806a;}return db[_0xe506('0xd')]['update'](_0x16c77d,_0xd1032c);}function main(){var _0x5009f5=0x1388;var _0x57e51c;logger[_0xe506('0xe')](util[_0xe506('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe506('0x10')));return db[_0xe506('0x11')][_0xe506('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xe506('0x13')]})[_0xe506('0x14')](function(_0x526aa4){if(_0x526aa4){_0x57e51c=_0x526aa4;_0x5009f5=_0x57e51c[_0xe506('0x13')]||0x1388;}})['then'](function(){return dbH[_0xe506('0x15')][_0xe506('0x16')](util[_0xe506('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xe506('0x15')]['QueryTypes'][_0xe506('0x17')]});})[_0xe506('0x14')](function(_0x1a51cb){if(!_0x1a51cb[0x0]['num']){return analyticExtractedReport('Empty');}var _0x41032c=[];var _0x1ba90f=0x0;var _0x49da5c=!![];if(_0x57e51c[_0xe506('0x18')]){if(_0x1a51cb&&_0x1a51cb['length']){var _0x377c50=_0x1a51cb[0x0][_0xe506('0x19')]%(_0x1ba90f+_0x5009f5);for(;_0x49da5c;_0x1ba90f+=_0x5009f5,_0x377c50=_0x1a51cb[0x0]['num']%(_0x1ba90f+_0x5009f5)){if(_0x377c50==0x0||_0x377c50==_0x1a51cb[0x0]['num']){_0x49da5c=![];}_0x41032c[_0xe506('0x1a')](dbH[_0xe506('0x15')]['query'](util[_0xe506('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5009f5,_0x1ba90f),{'type':dbH[_0xe506('0x15')][_0xe506('0x1b')][_0xe506('0x17')]}));}}}else{_0x41032c['push'](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0xe506('0x1b')][_0xe506('0x17')]}));}var _0x2e370d=path[_0xe506('0x1c')](PATH);var _0x423236=path['basename'](PATH,_0xe506('0x1d'));var _0x5b6389=_0x57e51c['split']&&_0x41032c['length']>0x1;var _0x508f09=[];if(!fs['existsSync'](path['join'](_0x2e370d,_0x423236))&&_0x5b6389){fs[_0xe506('0x1e')](path[_0xe506('0x1f')](_0x2e370d,_0x423236));}return BPromise[_0xe506('0x20')](_0x41032c,function(_0x5e8aaf){_0x508f09[_0xe506('0x1a')](_0x5e8aaf);})['then'](function(){for(var _0x11d9be=0x0;_0x11d9be<_0x508f09[_0xe506('0x21')];_0x11d9be+=0x1){var _0x132140;var _0x46cc0c=_0x508f09[_0x11d9be];if(_0x5b6389){_0x132140=path[_0xe506('0x1f')](_0x2e370d,_0x423236,util['format'](_0xe506('0x22'),_0x423236,_0x11d9be,_0xe506('0x23')));}else{_0x132140=path['join'](_0x2e370d,util[_0xe506('0xf')]('%s.%s',_0x423236,'xlsx'));}fs[_0xe506('0x24')](_0x132140,json2xls(_0x46cc0c),_0xe506('0x25'));}})[_0xe506('0x14')](function(){if(_0x5b6389){zipdir(path['join'](_0x2e370d,_0x423236),{'saveTo':path[_0xe506('0x1f')](_0x2e370d,util[_0xe506('0xf')](_0xe506('0x26'),_0x423236,_0xe506('0x27')))},function(_0x555d14,_0x1b0220){});rimraf(path['join'](_0x2e370d,_0x423236),function(){});}})[_0xe506('0x14')](function(){logger[_0xe506('0xe')](util[_0xe506('0xf')](_0xe506('0x28'),EXTRACTED_REPORT_ID,_0xe506('0x10')));return analyticExtractedReport(_0xe506('0x29'),_0x5b6389?util[_0xe506('0xf')](_0xe506('0x26'),_0x423236,_0x5b6389?_0xe506('0x27'):_0xe506('0x23')):null);});})[_0xe506('0x2a')](function(_0xfa5537){logger['info'](util[_0xe506('0xf')](_0xe506('0x2b'),EXTRACTED_REPORT_ID,_0xe506('0x10')),util[_0xe506('0x2c')](_0xfa5537,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xe506('0x2d'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index ff12a26..c4edf66 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 _0xa226=['XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','updatedAt','interval','map','tag','CDR(tag)=','length','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','transaction','bulkCreate','sortBy','catch','rewrite','util','models','Interval','then','intervals','findAll','IntervalId','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','push','type','format','priority','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN:','Set','CDR(routeid)=','context','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa226,0x64));var _0x6a22=function(_0x18e4f2,_0x4982c7){_0x18e4f2=_0x18e4f2-0x0;var _0x1d842d=_0xa226[_0x18e4f2];return _0x1d842d;};'use strict';var _=require('lodash');var util=require(_0x6a22('0x0'));function rewrite(_0x4f1c91,_0x1077ff){var _0x1582c5=this;return _0x4f1c91[_0x6a22('0x1')][_0x6a22('0x2')]['findAll']({'raw':!![]})[_0x6a22('0x3')](function(_0x9e0956){_0x1582c5[_0x6a22('0x4')]=_0x9e0956;return _0x4f1c91[_0x6a22('0x1')]['VoiceExtension'][_0x6a22('0x5')]({'where':{'IntervalId':_0x1077ff[_0x6a22('0x6')]},'raw':!![]});})['then'](function(_0x59ae55){return _0x4f1c91[_0x6a22('0x1')][_0x6a22('0x7')][_0x6a22('0x5')]({'where':{'exten':{'$in':_[_0x6a22('0x8')](_['map'](_0x59ae55,_0x6a22('0x9')))}},'order':[{'raw':_0x6a22('0xa')}],'raw':!![]});})[_0x6a22('0x3')](function(_0x5e90e6){var _0x4b2f7f=_[_0x6a22('0xb')](_0x5e90e6,{'priority':'1'});var _0x24a558=_[_0x6a22('0xb')](_0x5e90e6,{'isApp':0x1});var _0x143444=_[_0x6a22('0xc')](_0x24a558,_0x6a22('0x9'));var _0x1b29c1=[_0x6a22('0xd'),_0x6a22('0xe')];var _0x59b2ed=[];var _0x3e9871=[];for(var _0x435ffa in _0x143444){if(_0x143444[_0x6a22('0xf')](_0x435ffa)){_0x1582c5['priority']=0x2;_0x1582c5[_0x6a22('0x10')]=[];_0x1582c5[_0x6a22('0x11')]=_[_0x6a22('0x12')](_0x4b2f7f,{'exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')]});_0x1582c5[_0x6a22('0x10')][_0x6a22('0x13')]({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':'Set','appdata':util[_0x6a22('0x15')]('CDR(type)=%s',_0x143444[_0x435ffa][0x0][_0x6a22('0x14')]),'context':_0x143444[_0x435ffa][0x0]['context'],'exten':_0x143444[_0x435ffa][0x0]['exten'],'priority':_0x1582c5[_0x6a22('0x16')]++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});if(_0x143444[_0x435ffa][0x0][_0x6a22('0x14')]==='outbound'){if(_0x1582c5[_0x6a22('0x11')]){_0x1582c5[_0x6a22('0x10')]['push']({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':'Set','appdata':_0x6a22('0x18')+(_0x1582c5['extension'][_0x6a22('0x19')]?_0x6a22('0x1a')+_0x1582c5[_0x6a22('0x11')][_0x6a22('0x19')]+'}':'${EXTEN}'),'context':_0x143444[_0x435ffa][0x0]['context'],'exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')],'priority':_0x1582c5['priority']++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});}_0x1582c5[_0x6a22('0x10')][_0x6a22('0x13')]({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':_0x6a22('0x1b'),'appdata':_0x6a22('0x1c')+_0x143444[_0x435ffa][0x0][_0x6a22('0x17')],'context':_0x143444[_0x435ffa][0x0][_0x6a22('0x1d')],'exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')],'priority':_0x1582c5[_0x6a22('0x16')]++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});var _0x57ccaa=_0x1582c5[_0x6a22('0x16')]++;_0x1582c5[_0x6a22('0x10')][_0x6a22('0x13')]({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':_0x6a22('0x1e'),'appdata':_0x6a22('0x1f')+(_0x57ccaa+0x2)+_0x6a22('0x20')+(_0x57ccaa+0x1)+')','context':_0x143444[_0x435ffa][0x0]['context'],'exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')],'priority':_0x57ccaa,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});if(_0x1582c5[_0x6a22('0x11')]){_0x1582c5[_0x6a22('0x10')]['push']({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':'Set','appdata':_0x1582c5[_0x6a22('0x11')][_0x6a22('0x19')]?_0x6a22('0x21')+_0x1582c5['extension'][_0x6a22('0x19')]+'}':_0x6a22('0x22'),'context':_0x143444[_0x435ffa][0x0][_0x6a22('0x1d')],'exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')],'priority':_0x1582c5[_0x6a22('0x16')]++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});}_0x1582c5[_0x6a22('0x10')][_0x6a22('0x13')]({'type':_0x143444[_0x435ffa][0x0]['type'],'app':_0x6a22('0x1b'),'appdata':_0x6a22('0x23')+_0x143444[_0x435ffa][0x0]['VoiceExtensionId'],'context':_0x143444[_0x435ffa][0x0]['context'],'exten':_0x143444[_0x435ffa][0x0]['exten'],'priority':_0x1582c5[_0x6a22('0x16')]++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});if(_0x1582c5[_0x6a22('0x11')]&&_0x1582c5[_0x6a22('0x11')][_0x6a22('0xf')](_0x6a22('0x24'))&&_0x1582c5['extension'][_0x6a22('0x24')]!==_0x6a22('0x25')){_0x1582c5[_0x6a22('0x10')]['push']({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':_0x6a22('0x1b'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x143444[_0x435ffa][0x0][_0x6a22('0x1d')],'exten':_0x143444[_0x435ffa][0x0]['exten'],'priority':_0x1582c5[_0x6a22('0x16')]++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});_0x1582c5[_0x6a22('0x10')][_0x6a22('0x13')]({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':_0x6a22('0x1b'),'appdata':_0x6a22('0x26')+_0x1582c5[_0x6a22('0x11')][_0x6a22('0x24')]||_0x6a22('0x27'),'context':_0x143444[_0x435ffa][0x0][_0x6a22('0x1d')],'exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')],'priority':_0x1582c5['priority']++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});}}_0x1582c5[_0x6a22('0x10')][_0x6a22('0x13')]({'type':_0x143444[_0x435ffa][0x0]['type'],'app':_0x6a22('0x1b'),'appdata':_0x6a22('0x28'),'context':_0x143444[_0x435ffa][0x0][_0x6a22('0x1d')],'exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')],'priority':_0x1582c5[_0x6a22('0x16')]++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});_0x1582c5[_0x6a22('0x10')][_0x6a22('0x13')]({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':'Set','appdata':_0x6a22('0x29'),'context':_0x143444[_0x435ffa][0x0][_0x6a22('0x1d')],'exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')],'priority':_0x1582c5['priority']++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});_0x1582c5[_0x6a22('0x10')]['push']({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':_0x6a22('0x1b'),'appdata':_0x6a22('0x2a'),'context':_0x143444[_0x435ffa][0x0]['context'],'exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')],'priority':_0x1582c5[_0x6a22('0x16')]++,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});for(var _0xae59f9=0x0,_0xbd89dd=0x0;_0xae59f9<_0x143444[_0x435ffa]['length'];_0xae59f9+=0x1,_0xbd89dd=0x0){var _0x1752d2=_0x143444[_0x435ffa][_0xae59f9];if(_0x1752d2[_0x6a22('0x14')]){_0x1752d2[_0x6a22('0x14')]=_0x1752d2[_0x6a22('0x14')][_0x6a22('0x2b')]();}var _0xbabcb5=[];var _0x54ccb9=[];delete _0x1752d2['id'];delete _0x1752d2['createdAt'];delete _0x1752d2[_0x6a22('0x2c')];var _0x1b381d=_0x1752d2['interval']!=='*,*,*,*'?[_0x1752d2[_0x6a22('0x2d')]]:_0x1752d2[_0x6a22('0x6')]?_[_0x6a22('0x2e')](_[_0x6a22('0xb')](_0x1582c5['intervals'],{'IntervalId':_0x1752d2[_0x6a22('0x6')]}),_0x6a22('0x2d')):[];if(_0x1752d2[_0x6a22('0xf')]('tag')){if(_0x1752d2[_0x6a22('0x2f')]&&_0x1752d2[_0x6a22('0x2f')]!=='--'){_0xbabcb5['push']({'type':_0x1752d2['type'],'app':_0x6a22('0x1b'),'appdata':_0x6a22('0x30')+_0x1752d2[_0x6a22('0x2f')],'context':_0x1752d2['context'],'exten':_0x1752d2[_0x6a22('0x9')],'priority':_0x1b381d[_0x6a22('0x31')]+_0x1582c5[_0x6a22('0x16')]+_0xbd89dd++,'VoiceExtensionId':_0x1752d2[_0x6a22('0x17')]});}}if(_0x1752d2['type']===_0x6a22('0x32')&&_0x1752d2['hasOwnProperty'](_0x6a22('0x33'))){if(_0x1752d2[_0x6a22('0x33')]){_0xbabcb5[_0x6a22('0x13')]({'type':_0x1752d2['type'],'app':'ExecIf','appdata':_0x6a22('0x34')+_0x1752d2[_0x6a22('0x33')]+')','context':_0x1752d2[_0x6a22('0x1d')],'exten':_0x1752d2[_0x6a22('0x9')],'priority':_0x1b381d['length']+_0x1582c5[_0x6a22('0x16')]+_0xbd89dd++,'VoiceExtensionId':_0x1752d2[_0x6a22('0x17')]});}else{_0xbabcb5[_0x6a22('0x13')]({'type':_0x1752d2[_0x6a22('0x14')],'app':_0x6a22('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x1752d2[_0x6a22('0x1d')],'exten':_0x1752d2['exten'],'priority':_0x1b381d[_0x6a22('0x31')]+_0x1582c5[_0x6a22('0x16')]+_0xbd89dd++,'VoiceExtensionId':_0x1752d2[_0x6a22('0x17')]});}}if(_0x1752d2['hasOwnProperty'](_0x6a22('0x35'))){if(_0x1b29c1[_0x6a22('0x36')](_0x1752d2[_0x6a22('0x37')]['toLowerCase']())>=0x0&&_0x1752d2[_0x6a22('0x38')]!=='custom'){if(_0x1752d2[_0x6a22('0x35')]){_0xbabcb5[_0x6a22('0x13')]({'type':_0x1752d2[_0x6a22('0x14')],'app':_0x6a22('0x1e'),'appdata':_0x6a22('0x39'),'context':_0x1752d2[_0x6a22('0x1d')],'exten':_0x1752d2[_0x6a22('0x9')],'priority':_0x1b381d['length']+_0x1582c5[_0x6a22('0x16')]+_0xbd89dd++,'VoiceExtensionId':_0x1752d2['VoiceExtensionId']});_0xbabcb5[_0x6a22('0x13')]({'type':_0x1752d2[_0x6a22('0x14')],'app':'Set','appdata':_0x6a22('0x3a'),'context':_0x1752d2['context'],'exten':_0x1752d2[_0x6a22('0x9')],'priority':_0x1b381d[_0x6a22('0x31')]+_0x1582c5[_0x6a22('0x16')]+_0xbd89dd++,'VoiceExtensionId':_0x1752d2[_0x6a22('0x17')]});}else{_0xbabcb5[_0x6a22('0x13')]({'type':_0x1752d2[_0x6a22('0x14')],'app':_0x6a22('0x1e'),'appdata':_0x6a22('0x3b'),'context':_0x1752d2['context'],'exten':_0x1752d2[_0x6a22('0x9')],'priority':_0x1b381d['length']+_0x1582c5['priority']+_0xbd89dd++,'VoiceExtensionId':_0x1752d2['VoiceExtensionId']});_0xbabcb5[_0x6a22('0x13')]({'type':_0x1752d2['type'],'app':'Set','appdata':_0x6a22('0x3c'),'context':_0x1752d2[_0x6a22('0x1d')],'exten':_0x1752d2[_0x6a22('0x9')],'priority':_0x1b381d['length']+_0x1582c5[_0x6a22('0x16')]+_0xbd89dd++,'VoiceExtensionId':_0x1752d2[_0x6a22('0x17')]});}}}for(var _0x46fa73=0x0;_0x46fa73<_0x1b381d[_0x6a22('0x31')];_0x46fa73+=0x1){var _0xc2479b=_0x1582c5['priority']+_0x1b381d['length'];var _0x227851=_0x46fa73===_0x1b381d[_0x6a22('0x31')]-0x1?_0x1582c5[_0x6a22('0x16')]+_0xbabcb5[_0x6a22('0x31')]+_0x54ccb9['length']+0x2:_0x1582c5[_0x6a22('0x16')]+_0x46fa73+0x1;_0xbabcb5['splice'](_0x46fa73,0x0,{'type':_0x1752d2[_0x6a22('0x14')],'app':_0x6a22('0x3d'),'appdata':_0x1b381d[_0x46fa73]+'?'+_0x1752d2[_0x6a22('0x1d')]+_0x6a22('0x3e')+_0xc2479b+':'+_0x1752d2['context']+_0x6a22('0x3e')+_0x227851,'exten':_0x1752d2[_0x6a22('0x9')],'context':_0x1752d2['context'],'priority':_0x1582c5[_0x6a22('0x16')]+_0x46fa73,'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});}_0x1752d2['priority']=_0xbabcb5[_0x6a22('0x31')]?_[_0x6a22('0x3f')](_0xbabcb5)[_0x6a22('0x16')]+0x1:_0x1582c5[_0x6a22('0x16')];_0x1582c5['priority']=(_0x54ccb9[_0x6a22('0x31')]?_[_0x6a22('0x3f')](_0x54ccb9)[_0x6a22('0x16')]:_0x1752d2[_0x6a22('0x16')])+0x1;_0x1582c5[_0x6a22('0x10')]=_['concat'](_0x1582c5['extensions'],_0xbabcb5,[_0x1752d2],_0x54ccb9);}_0x1582c5[_0x6a22('0x10')][_0x6a22('0x13')]({'type':_0x143444[_0x435ffa][0x0][_0x6a22('0x14')],'app':'Hangup','exten':_0x143444[_0x435ffa][0x0][_0x6a22('0x9')],'context':_0x143444[_0x435ffa][0x0][_0x6a22('0x1d')],'priority':_0x1582c5[_0x6a22('0x16')],'VoiceExtensionId':_0x143444[_0x435ffa][0x0][_0x6a22('0x17')]});_0x59b2ed['push'](_0x143444[_0x435ffa][0x0]['VoiceExtensionId']);_0x3e9871=_[_0x6a22('0x40')](_0x3e9871,_0x1582c5[_0x6a22('0x10')]);}}return _0x4f1c91[_0x6a22('0x41')](function(_0x336f49){return _0x4f1c91[_0x6a22('0x1')][_0x6a22('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x59b2ed}},'transaction':_0x336f49})[_0x6a22('0x3')](function(_0x5fba47){return _0x4f1c91[_0x6a22('0x1')][_0x6a22('0x7')][_0x6a22('0x42')](_[_0x6a22('0x43')](_0x3e9871,_0x6a22('0x16')),{'transaction':_0x336f49});});});})[_0x6a22('0x44')](function(_0x254e6e){console['error'](_0x254e6e);});}exports[_0x6a22('0x45')]=rewrite; \ No newline at end of file +var _0xa75b=['indexOf','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','rewrite','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','hasOwnProperty','priority','extensions','extension','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','outbound','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0xa75b,0x170));var _0xba75=function(_0xd5f4c9,_0x25dcfa){_0xd5f4c9=_0xd5f4c9-0x0;var _0x55fd95=_0xa75b[_0xd5f4c9];return _0x55fd95;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');function rewrite(_0x546e14,_0x10c0dd){var _0x39dc19=this;return _0x546e14[_0xba75('0x1')][_0xba75('0x2')][_0xba75('0x3')]({'raw':!![]})[_0xba75('0x4')](function(_0x152269){_0x39dc19[_0xba75('0x5')]=_0x152269;return _0x546e14[_0xba75('0x1')][_0xba75('0x6')][_0xba75('0x3')]({'where':{'IntervalId':_0x10c0dd[_0xba75('0x7')]},'raw':!![]});})[_0xba75('0x4')](function(_0x5c79e3){return _0x546e14['models'][_0xba75('0x6')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0xba75('0x8')](_0x5c79e3,'exten'))}},'order':[{'raw':_0xba75('0x9')}],'raw':!![]});})[_0xba75('0x4')](function(_0x1371f4){var _0x141931=_[_0xba75('0xa')](_0x1371f4,{'priority':'1'});var _0xc50bda=_[_0xba75('0xa')](_0x1371f4,{'isApp':0x1});var _0x2538eb=_[_0xba75('0xb')](_0xc50bda,_0xba75('0xc'));var _0x8116d8=[_0xba75('0xd'),'playback'];var _0x55553a=[];var _0x38a6db=[];for(var _0x5262ec in _0x2538eb){if(_0x2538eb[_0xba75('0xe')](_0x5262ec)){_0x39dc19[_0xba75('0xf')]=0x2;_0x39dc19[_0xba75('0x10')]=[];_0x39dc19[_0xba75('0x11')]=_['find'](_0x141931,{'exten':_0x2538eb[_0x5262ec][0x0][_0xba75('0xc')]});_0x39dc19[_0xba75('0x10')][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':util['format'](_0xba75('0x15'),_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')]),'context':_0x2538eb[_0x5262ec][0x0][_0xba75('0x16')],'exten':_0x2538eb[_0x5262ec][0x0]['exten'],'priority':_0x39dc19[_0xba75('0xf')]++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]});if(_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')]===_0xba75('0x18')){if(_0x39dc19[_0xba75('0x11')]){_0x39dc19[_0xba75('0x10')]['push']({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':'CDR(destination)='+(_0x39dc19['extension'][_0xba75('0x19')]?_0xba75('0x1a')+_0x39dc19['extension']['cutdigits']+'}':_0xba75('0x1b')),'context':_0x2538eb[_0x5262ec][0x0]['context'],'exten':_0x2538eb[_0x5262ec][0x0][_0xba75('0xc')],'priority':_0x39dc19[_0xba75('0xf')]++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]});}_0x39dc19['extensions'][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':_0xba75('0x1c')+_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')],'context':_0x2538eb[_0x5262ec][0x0][_0xba75('0x16')],'exten':_0x2538eb[_0x5262ec][0x0]['exten'],'priority':_0x39dc19[_0xba75('0xf')]++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]});var _0xe579fb=_0x39dc19[_0xba75('0xf')]++;_0x39dc19[_0xba75('0x10')][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':_0xba75('0x1d'),'appdata':_0xba75('0x1e')+(_0xe579fb+0x2)+_0xba75('0x1f')+(_0xe579fb+0x1)+')','context':_0x2538eb[_0x5262ec][0x0]['context'],'exten':_0x2538eb[_0x5262ec][0x0]['exten'],'priority':_0xe579fb,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0]['VoiceExtensionId']});if(_0x39dc19[_0xba75('0x11')]){_0x39dc19['extensions'][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0]['type'],'app':_0xba75('0x14'),'appdata':_0x39dc19[_0xba75('0x11')][_0xba75('0x19')]?'CDR(prefix)=${EXTEN:0:'+_0x39dc19[_0xba75('0x11')][_0xba75('0x19')]+'}':_0xba75('0x20'),'context':_0x2538eb[_0x5262ec][0x0][_0xba75('0x16')],'exten':_0x2538eb[_0x5262ec][0x0]['exten'],'priority':_0x39dc19['priority']++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]});}_0x39dc19['extensions'][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':_0xba75('0x21')+_0x2538eb[_0x5262ec][0x0]['VoiceExtensionId'],'context':_0x2538eb[_0x5262ec][0x0][_0xba75('0x16')],'exten':_0x2538eb[_0x5262ec][0x0][_0xba75('0xc')],'priority':_0x39dc19['priority']++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]});if(_0x39dc19[_0xba75('0x11')]&&_0x39dc19[_0xba75('0x11')][_0xba75('0xe')]('recordingFormat')&&_0x39dc19[_0xba75('0x11')][_0xba75('0x22')]!=='none'){_0x39dc19[_0xba75('0x10')][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':'Set','appdata':_0xba75('0x23'),'context':_0x2538eb[_0x5262ec][0x0][_0xba75('0x16')],'exten':_0x2538eb[_0x5262ec][0x0][_0xba75('0xc')],'priority':_0x39dc19[_0xba75('0xf')]++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]});_0x39dc19[_0xba75('0x10')][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0]['type'],'app':'Set','appdata':_0xba75('0x24')+_0x39dc19[_0xba75('0x11')][_0xba75('0x22')]||'wav','context':_0x2538eb[_0x5262ec][0x0][_0xba75('0x16')],'exten':_0x2538eb[_0x5262ec][0x0][_0xba75('0xc')],'priority':_0x39dc19['priority']++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0]['VoiceExtensionId']});}}_0x39dc19[_0xba75('0x10')][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':_0xba75('0x25'),'context':_0x2538eb[_0x5262ec][0x0]['context'],'exten':_0x2538eb[_0x5262ec][0x0]['exten'],'priority':_0x39dc19[_0xba75('0xf')]++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]});_0x39dc19[_0xba75('0x10')][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':_0xba75('0x26'),'context':_0x2538eb[_0x5262ec][0x0]['context'],'exten':_0x2538eb[_0x5262ec][0x0][_0xba75('0xc')],'priority':_0x39dc19[_0xba75('0xf')]++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0]['VoiceExtensionId']});_0x39dc19[_0xba75('0x10')][_0xba75('0x12')]({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':_0xba75('0x27'),'context':_0x2538eb[_0x5262ec][0x0][_0xba75('0x16')],'exten':_0x2538eb[_0x5262ec][0x0][_0xba75('0xc')],'priority':_0x39dc19['priority']++,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]});for(var _0x59d005=0x0,_0x44b0a5=0x0;_0x59d005<_0x2538eb[_0x5262ec]['length'];_0x59d005+=0x1,_0x44b0a5=0x0){var _0x3604c5=_0x2538eb[_0x5262ec][_0x59d005];if(_0x3604c5[_0xba75('0x13')]){_0x3604c5[_0xba75('0x13')]=_0x3604c5[_0xba75('0x13')][_0xba75('0x28')]();}var _0x30338c=[];var _0xff94c8=[];delete _0x3604c5['id'];delete _0x3604c5[_0xba75('0x29')];delete _0x3604c5[_0xba75('0x2a')];var _0x5c7c7f=_0x3604c5[_0xba75('0x2b')]!==_0xba75('0x2c')?[_0x3604c5['interval']]:_0x3604c5[_0xba75('0x7')]?_[_0xba75('0x8')](_[_0xba75('0xa')](_0x39dc19['intervals'],{'IntervalId':_0x3604c5['IntervalId']}),'interval'):[];if(_0x3604c5['hasOwnProperty'](_0xba75('0x2d'))){if(_0x3604c5['tag']&&_0x3604c5[_0xba75('0x2d')]!=='--'){_0x30338c[_0xba75('0x12')]({'type':_0x3604c5[_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':_0xba75('0x2e')+_0x3604c5['tag'],'context':_0x3604c5['context'],'exten':_0x3604c5[_0xba75('0xc')],'priority':_0x5c7c7f['length']+_0x39dc19[_0xba75('0xf')]+_0x44b0a5++,'VoiceExtensionId':_0x3604c5['VoiceExtensionId']});}}if(_0x3604c5[_0xba75('0x13')]===_0xba75('0x18')&&_0x3604c5[_0xba75('0xe')](_0xba75('0x2f'))){if(_0x3604c5['callerID']){_0x30338c[_0xba75('0x12')]({'type':_0x3604c5[_0xba75('0x13')],'app':_0xba75('0x1d'),'appdata':_0xba75('0x30')+_0x3604c5[_0xba75('0x2f')]+')','context':_0x3604c5[_0xba75('0x16')],'exten':_0x3604c5[_0xba75('0xc')],'priority':_0x5c7c7f[_0xba75('0x31')]+_0x39dc19['priority']+_0x44b0a5++,'VoiceExtensionId':_0x3604c5[_0xba75('0x17')]});}else{_0x30338c[_0xba75('0x12')]({'type':_0x3604c5[_0xba75('0x13')],'app':_0xba75('0x1d'),'appdata':_0xba75('0x32'),'context':_0x3604c5['context'],'exten':_0x3604c5[_0xba75('0xc')],'priority':_0x5c7c7f[_0xba75('0x31')]+_0x39dc19[_0xba75('0xf')]+_0x44b0a5++,'VoiceExtensionId':_0x3604c5[_0xba75('0x17')]});}}if(_0x3604c5[_0xba75('0xe')](_0xba75('0x33'))){if(_0x8116d8[_0xba75('0x34')](_0x3604c5['app'][_0xba75('0x28')]())>=0x0&&_0x3604c5[_0xba75('0x35')]!==_0xba75('0x36')){if(_0x3604c5['answer']){_0x30338c[_0xba75('0x12')]({'type':_0x3604c5[_0xba75('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x3604c5[_0xba75('0x16')],'exten':_0x3604c5['exten'],'priority':_0x5c7c7f['length']+_0x39dc19[_0xba75('0xf')]+_0x44b0a5++,'VoiceExtensionId':_0x3604c5['VoiceExtensionId']});_0x30338c[_0xba75('0x12')]({'type':_0x3604c5[_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':_0xba75('0x37'),'context':_0x3604c5[_0xba75('0x16')],'exten':_0x3604c5['exten'],'priority':_0x5c7c7f[_0xba75('0x31')]+_0x39dc19[_0xba75('0xf')]+_0x44b0a5++,'VoiceExtensionId':_0x3604c5['VoiceExtensionId']});}else{_0x30338c[_0xba75('0x12')]({'type':_0x3604c5[_0xba75('0x13')],'app':_0xba75('0x1d'),'appdata':_0xba75('0x38'),'context':_0x3604c5[_0xba75('0x16')],'exten':_0x3604c5['exten'],'priority':_0x5c7c7f[_0xba75('0x31')]+_0x39dc19[_0xba75('0xf')]+_0x44b0a5++,'VoiceExtensionId':_0x3604c5['VoiceExtensionId']});_0x30338c[_0xba75('0x12')]({'type':_0x3604c5[_0xba75('0x13')],'app':_0xba75('0x14'),'appdata':_0xba75('0x39'),'context':_0x3604c5[_0xba75('0x16')],'exten':_0x3604c5[_0xba75('0xc')],'priority':_0x5c7c7f['length']+_0x39dc19[_0xba75('0xf')]+_0x44b0a5++,'VoiceExtensionId':_0x3604c5[_0xba75('0x17')]});}}}for(var _0x361efb=0x0;_0x361efb<_0x5c7c7f[_0xba75('0x31')];_0x361efb+=0x1){var _0x38129c=_0x39dc19[_0xba75('0xf')]+_0x5c7c7f['length'];var _0x5668b4=_0x361efb===_0x5c7c7f['length']-0x1?_0x39dc19['priority']+_0x30338c[_0xba75('0x31')]+_0xff94c8[_0xba75('0x31')]+0x2:_0x39dc19[_0xba75('0xf')]+_0x361efb+0x1;_0x30338c[_0xba75('0x3a')](_0x361efb,0x0,{'type':_0x3604c5[_0xba75('0x13')],'app':_0xba75('0x3b'),'appdata':_0x5c7c7f[_0x361efb]+'?'+_0x3604c5[_0xba75('0x16')]+',${EXTEN},'+_0x38129c+':'+_0x3604c5[_0xba75('0x16')]+_0xba75('0x3c')+_0x5668b4,'exten':_0x3604c5[_0xba75('0xc')],'context':_0x3604c5[_0xba75('0x16')],'priority':_0x39dc19['priority']+_0x361efb,'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]});}_0x3604c5[_0xba75('0xf')]=_0x30338c['length']?_[_0xba75('0x3d')](_0x30338c)['priority']+0x1:_0x39dc19[_0xba75('0xf')];_0x39dc19[_0xba75('0xf')]=(_0xff94c8['length']?_[_0xba75('0x3d')](_0xff94c8)[_0xba75('0xf')]:_0x3604c5['priority'])+0x1;_0x39dc19['extensions']=_[_0xba75('0x3e')](_0x39dc19['extensions'],_0x30338c,[_0x3604c5],_0xff94c8);}_0x39dc19[_0xba75('0x10')]['push']({'type':_0x2538eb[_0x5262ec][0x0][_0xba75('0x13')],'app':_0xba75('0x3f'),'exten':_0x2538eb[_0x5262ec][0x0][_0xba75('0xc')],'context':_0x2538eb[_0x5262ec][0x0][_0xba75('0x16')],'priority':_0x39dc19[_0xba75('0xf')],'VoiceExtensionId':_0x2538eb[_0x5262ec][0x0]['VoiceExtensionId']});_0x55553a[_0xba75('0x12')](_0x2538eb[_0x5262ec][0x0][_0xba75('0x17')]);_0x38a6db=_['concat'](_0x38a6db,_0x39dc19[_0xba75('0x10')]);}}return _0x546e14[_0xba75('0x40')](function(_0x16f8ff){return _0x546e14[_0xba75('0x1')][_0xba75('0x6')][_0xba75('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x55553a}},'transaction':_0x16f8ff})[_0xba75('0x4')](function(_0xb6d3a2){return _0x546e14[_0xba75('0x1')][_0xba75('0x6')][_0xba75('0x42')](_[_0xba75('0x43')](_0x38a6db,'priority'),{'transaction':_0x16f8ff});});});})['catch'](function(_0x46c05c){console[_0xba75('0x44')](_0x46c05c);});}exports[_0xba75('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 044adcf..3e5829a 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 _0xe706=['toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','insert','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()'];(function(_0x3cfd25,_0x2983a5){var _0x5d3609=function(_0x25df16){while(--_0x25df16){_0x3cfd25['push'](_0x3cfd25['shift']());}};_0x5d3609(++_0x2983a5);}(_0xe706,0xa3));var _0x6e70=function(_0xb49cb8,_0x39474b){_0xb49cb8=_0xb49cb8-0x0;var _0x879ead=_0xe706[_0xb49cb8];return _0x879ead;};'use strict';var BPromise=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var socket=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));require(_0x6e70('0xd'))[_0x6e70('0xe')](socket);try{if(!process[_0x6e70('0xf')][0x2]||process[_0x6e70('0xf')][0x2]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x2]===_0x6e70('0x11')){throw new Error(_0x6e70('0x12'));}var FILEPATH=process[_0x6e70('0xf')][0x2];if(!process[_0x6e70('0xf')][0x3]||process[_0x6e70('0xf')][0x3]===_0x6e70('0x10')||process['argv'][0x3]==='null'||!process[_0x6e70('0xf')][0x4]||process[_0x6e70('0xf')][0x4]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x4]===_0x6e70('0x11')){throw new Error(_0x6e70('0x13'));}var FIELDS=_[_0x6e70('0x14')](process[_0x6e70('0xf')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x6e70('0xf')][0x5]||process['argv'][0x5]==='undefined'||process[_0x6e70('0xf')][0x5]===_0x6e70('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x6e70('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6e70('0xf')][0x6]!==_0x6e70('0x10')&&process['argv'][0x6]!=='null'?process[_0x6e70('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6e70('0xf')][0x7]!==_0x6e70('0x10')&&process['argv'][0x7]!=='null'?process[_0x6e70('0xf')][0x7]:null;if(!process[_0x6e70('0xf')][0x8]||process[_0x6e70('0xf')][0x8]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x8]===_0x6e70('0x11')){throw new Error(_0x6e70('0x15'));}var SOCKET_TIMESTAMP=process[_0x6e70('0xf')][0x8];}catch(_0x29326f){logger[_0x6e70('0x16')](_0x29326f);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(_0x4a0cfe,_0x228350,_0x344b65,_0x27b294){var _0x502b2d={'message':_0x228350};_0x502b2d[_0x4a0cfe]=!![];if(_0x344b65){_0x502b2d[_0x6e70('0x17')]=_0x344b65;}if(_0x27b294){_0x502b2d[_0x6e70('0x18')]=_0x27b294;}return _0x502b2d;}function isEmail(_0x3337a6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3337a6);}function checkRow(_0x10fc91,_0x538b9c,_0x50aec2){return new BPromise(function(_0x4e97c7,_0x41e352){if(_[_0x6e70('0x19')](_0x10fc91)){return _0x41e352(handleCheckRowError('error',_0x6e70('0x1a'),null,_0x50aec2));}if(_0x10fc91[_0x6e70('0x1b')]&&_0x10fc91['errors'][_0x6e70('0x1c')]){var _0x67fb43=_[_0x6e70('0x1d')](_0x10fc91['errors'],'message')[_0x6e70('0x1e')](';');return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x67fb43,null,_0x50aec2));}var _0x83c836={};for(var _0x114344 in FIELDS){if(FIELDS[_0x6e70('0x1f')](_0x114344)&&FIELDS[_0x114344]){_0x83c836[_0x114344]=_0x10fc91['data'][0x0][FIELDS[_0x114344]]||_0x10fc91[_0x6e70('0x20')][0x0]['\ufeff'+FIELDS[_0x114344]];}}if(!_0x83c836[_0x6e70('0x21')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x22'),null,_0x50aec2));}if(!_0x83c836[_0x6e70('0x23')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x24'),null,_0x50aec2));}if(_0x83c836[_0x6e70('0x25')]){var _0x3a0821=moment(_0x83c836[_0x6e70('0x25')],'YYYY-MM-DD');if(!_0x3a0821[_0x6e70('0x26')]()){return _0x41e352(handleCheckRowError('error',_0x6e70('0x27'),null,_0x50aec2));}}if(_0x83c836['email']){if(!isEmail(_0x83c836[_0x6e70('0x28')])){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x29'),null,_0x50aec2));}}_0x83c836['ListId']=LISTID;_0x83c836[_0x6e70('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){var _0x5780a1={};for(var _0x13d673=0x0,_0x154925=DUPLICATES['length'];_0x13d673<_0x154925;_0x13d673+=0x1){_0x5780a1[DUPLICATES[_0x13d673]]=_0x83c836[DUPLICATES[_0x13d673]];}var _0x10d8f6=_[_0x6e70('0x2b')](_0x538b9c,_0x5780a1);if(_0x10d8f6){return _0x41e352(handleCheckRowError(_0x6e70('0x2c'),_0x6e70('0x2d'),_0x10d8f6,_0x50aec2));}}return db[_0x6e70('0x2e')][_0x6e70('0x2f')](_0x83c836,{'raw':!![],'hooks':![],'fields':_[_0x6e70('0x30')](_0x83c836)})[_0x6e70('0x31')](function(_0xf146fd){if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){_0x538b9c['push'](_[_0x6e70('0x32')](_0x83c836,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xf146fd['id'];return _0x4e97c7();})['catch'](function(_0x23cd1a){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x33')+(_0x23cd1a[_0x6e70('0x34')]||JSON[_0x6e70('0x35')](_0x23cd1a)),null,_0x50aec2));});});}function checkHopper(){function _0x989b80(){return function(_0x2440be){logger[_0x6e70('0x16')](_0x6e70('0x36'),_0x6e70('0x37'),util[_0x6e70('0x38')](_0x2440be,{'showHidden':![],'depth':null}));};}var _0x23d5e2=function(_0x5594d3,_0x501b53){var _0x5446a2=squel['insert']()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),'ListId',_0x501b53,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x5594d3['id'][_0x6e70('0x43')](),_0x501b53)['field']('NOW()','createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6e70('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x501b53+'\x20=\x20?',_0x5594d3['id'][_0x6e70('0x43')]())))[_0x6e70('0x43')]();return _0x5446a2;};var _0x2dafb5=function(_0x3478e2,_0x5bbc3a){var _0x291de6=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),'ContactId',_0x6e70('0x44'),_0x5bbc3a,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))['field'](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))['field'](LISTID['toString'](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x3478e2['id'][_0x6e70('0x43')](),_0x5bbc3a)['field']('NOW()',_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b'))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()['field'](_0x6e70('0x4d'))[_0x6e70('0x45')](_0x6e70('0x4e'))[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']()))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']())))[_0x6e70('0x43')]();return _0x291de6;};function _0xebe5f7(_0x54efdf,_0x3cfaa9){var _0xb3f06c=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))['fromQuery']([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),_0x6e70('0x44'),_0x3cfaa9,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3c'))[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x54efdf['id'][_0x6e70('0x43')](),_0x3cfaa9)['field'](_0x6e70('0x42'),_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')]('cm_contacts')[_0x6e70('0x48')](_0x6e70('0x47'))['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0xb3f06c;}function _0x41a861(_0x10d299,_0x739946){var _0x30cd88=squel['insert']()['into'](_0x6e70('0x50'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3d'),'ListId',_0x739946,'createdAt',_0x6e70('0x3f')],squel[_0x6e70('0x40')]()['field']('phone',_0x6e70('0x23'))['field']('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x10d299['id'][_0x6e70('0x43')](),_0x739946)[_0x6e70('0x41')](_0x6e70('0x42'),'createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0x30cd88;}return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x55'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x82a9a){var _0x515c0c=[];if(_0x82a9a){var _0xce964b;for(var _0x531097=0x0,_0x5b4046;_0x531097<_0x82a9a[_0x6e70('0x1c')];_0x531097+=0x1){_0x5b4046=_0x82a9a[_0x531097][_0x6e70('0x56')]({'plain':!![]});switch(_0x5b4046[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')]['query'](_0x2dafb5(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;default:_0x515c0c['push'](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x5b4046,_0x6e70('0x5b')))['then'](function(){})['catch'](_0x989b80()));}}}return _0x515c0c;})[_0x6e70('0x5f')]()[_0x6e70('0x31')](function(){return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x241a21){var _0x56d4d9=[];if(_0x241a21){var _0x58666a;for(var _0x1c7c5f=0x0,_0xf7a034;_0x1c7c5f<_0x241a21[_0x6e70('0x1c')];_0x1c7c5f+=0x1){_0xf7a034=_0x241a21[_0x1c7c5f][_0x6e70('0x56')]({'plain':!![]});_0x56d4d9[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x41a861(_0xf7a034,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}return _0x56d4d9;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':'Lists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x4b2d40){var _0x5b5471=[];if(_0x4b2d40){for(var _0x402f6f=0x0,_0x48e04b;_0x402f6f<_0x4b2d40['length'];_0x402f6f+=0x1){_0x48e04b=_0x4b2d40[_0x402f6f][_0x6e70('0x56')]({'plain':!![]});switch(_0x48e04b[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x5b5471['push'](db['sequelize']['query'](_0x2dafb5(_0x48e04b,_0x6e70('0x61')))['then'](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x48e04b,_0x6e70('0x61')))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));break;default:_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x48e04b,'CampaignId'))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}}return _0x5b5471;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')][_0x6e70('0x52')]({'attributes':['id'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x62'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x48f6fd){var _0x463eed=[];if(_0x48f6fd){for(var _0x39e6db=0x0,_0x53acc8;_0x39e6db<_0x48f6fd[_0x6e70('0x1c')];_0x39e6db+=0x1){_0x53acc8=_0x48f6fd[_0x39e6db][_0x6e70('0x56')]({'plain':!![]});_0x463eed['push'](db['sequelize'][_0x6e70('0x5e')](_0x41a861(_0x53acc8,'CampaignId'))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));}}return _0x463eed;})[_0x6e70('0x5f')]();})[_0x6e70('0x5c')](function(_0x106f32){logger[_0x6e70('0x16')](_0x6e70('0x63'),_0x6e70('0x64'),_0x106f32[_0x6e70('0x34')]);});}var processPromises=function(_0x5afbf5){return BPromise['all'](promises)[_0x6e70('0x31')](function(_0x4bf451){})[_0x6e70('0x5c')](function(_0xa2a4d5){logger[_0x6e70('0x16')](_0x6e70('0x65'),JSON['stringify'](_0xa2a4d5));})[_0x6e70('0x66')](function(){socket['emit'](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5afbf5){return _0x5afbf5[_0x6e70('0x68')]();}});};var endCsv=function(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x6e70('0x31')](function(){socket[_0x6e70('0x6a')](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d6acf){logger['error'](_0x6e70('0x6b'),JSON['stringify'](_0x1d6acf));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x6e70('0x6c')](_0x6e70('0x6d'));endCsv();});function main(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6e70('0x6e')](',');return db['CmContact'][_0x6e70('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6e70('0x31')](function(_0x48c30c){var _0x3c2d33=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6e70('0x6f')](_0x3c2d33,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d0585,_0x4a87e2){total+=0x1;var _0x25f60c=total;promises[_0x6e70('0x59')](checkRow(_0x5d0585,_0x48c30c,_0x25f60c)[_0x6e70('0x31')](function(){success+=0x1;})[_0x6e70('0x5c')](function(_0x3e6661){if(_0x3e6661[_0x6e70('0x16')]){errors+=0x1;delete _0x3e6661[_0x6e70('0x16')];}else if(_0x3e6661['duplicate']){duplicates+=0x1;delete _0x3e6661[_0x6e70('0x2c')];}rows['push'](_0x3e6661);}));if(total%0xc8===0x0){_0x4a87e2[_0x6e70('0x70')]();return processPromises(_0x4a87e2);}},'complete':function(){return processPromises()[_0x6e70('0x31')](function(){logger[_0x6e70('0x6c')](_0x6e70('0x71'));endCsv();});},'error':function(_0x4764d5,_0x41b7de){logger[_0x6e70('0x6c')]('CSV\x20parse\x20error',JSON[_0x6e70('0x35')](_0x4764d5));endCsv();}});})['catch'](function(_0x27bdf2){logger[_0x6e70('0x16')](_0x6e70('0x72'),JSON[_0x6e70('0x35')](_0x27bdf2));});}main(); \ No newline at end of file +var _0xa9e0=['CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','query','catch','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','emit','unlinkSync','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate'];(function(_0x595bcd,_0x2bad18){var _0x4c7181=function(_0x1aeeae){while(--_0x1aeeae){_0x595bcd['push'](_0x595bcd['shift']());}};_0x4c7181(++_0x2bad18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0a9e('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var socket=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x0a9e('0xb')][0x2]||process['argv'][0x2]==='undefined'||process[_0x0a9e('0xb')][0x2]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xd'));}var FILEPATH=process[_0x0a9e('0xb')][0x2];if(!process[_0x0a9e('0xb')][0x3]||process[_0x0a9e('0xb')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process['argv'][0x4]||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xf'));}var FIELDS=_[_0x0a9e('0x10')](process['argv'][0x3][_0x0a9e('0x11')](','),process[_0x0a9e('0xb')][0x4][_0x0a9e('0x11')](','));if(!process[_0x0a9e('0xb')][0x5]||process[_0x0a9e('0xb')][0x5]===_0x0a9e('0xe')||process['argv'][0x5]===_0x0a9e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x0a9e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0a9e('0xb')][0x6]!==_0x0a9e('0xe')&&process['argv'][0x6]!==_0x0a9e('0xc')?process['argv'][0x6]:null;var DUPLICATES=process[_0x0a9e('0xb')][0x7]&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xe')&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xc')?process[_0x0a9e('0xb')][0x7]:null;if(!process[_0x0a9e('0xb')][0x8]||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2c3407){logger[_0x0a9e('0x13')](_0x2c3407);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x53682f,_0x20f109,_0x5a09ef,_0x588269){var _0x3a02e1={'message':_0x20f109};_0x3a02e1[_0x53682f]=!![];if(_0x5a09ef){_0x3a02e1[_0x0a9e('0x14')]=_0x5a09ef;}if(_0x588269){_0x3a02e1[_0x0a9e('0x15')]=_0x588269;}return _0x3a02e1;}function isEmail(_0x30bae6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x30bae6);}function checkRow(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return new BPromise(function(_0x4d00e6,_0x370d86){if(_[_0x0a9e('0x16')](_0xfb6e48)){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3b45bc));}if(_0xfb6e48['errors']&&_0xfb6e48[_0x0a9e('0x17')][_0x0a9e('0x18')]){var _0x40c424=_[_0x0a9e('0x19')](_0xfb6e48['errors'],_0x0a9e('0x1a'))['join'](';');return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x40c424,null,_0x3b45bc));}var _0x5bfb33={};for(var _0x1dc186 in FIELDS){if(FIELDS[_0x0a9e('0x1b')](_0x1dc186)&&FIELDS[_0x1dc186]){_0x5bfb33[_0x1dc186]=_0xfb6e48[_0x0a9e('0x1c')][0x0][FIELDS[_0x1dc186]]||_0xfb6e48[_0x0a9e('0x1c')][0x0]['\ufeff'+FIELDS[_0x1dc186]];}}if(!_0x5bfb33[_0x0a9e('0x1d')]){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x1e'),null,_0x3b45bc));}if(!_0x5bfb33[_0x0a9e('0x1f')]){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x20'),null,_0x3b45bc));}if(_0x5bfb33[_0x0a9e('0x21')]){var _0x2b1f27=moment(_0x5bfb33[_0x0a9e('0x21')],'YYYY-MM-DD');if(!_0x2b1f27[_0x0a9e('0x22')]()){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x23'),null,_0x3b45bc));}}if(_0x5bfb33[_0x0a9e('0x24')]){if(!isEmail(_0x5bfb33[_0x0a9e('0x24')])){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x25'),null,_0x3b45bc));}}_0x5bfb33[_0x0a9e('0x26')]=LISTID;_0x5bfb33[_0x0a9e('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2fb0e4){var _0x426950={};for(var _0x5d1e0e=0x0,_0x2407f9=DUPLICATES[_0x0a9e('0x18')];_0x5d1e0e<_0x2407f9;_0x5d1e0e+=0x1){_0x426950[DUPLICATES[_0x5d1e0e]]=_0x5bfb33[DUPLICATES[_0x5d1e0e]];}var _0x1122db=_[_0x0a9e('0x28')](_0x2fb0e4,_0x426950);if(_0x1122db){return _0x370d86(handleCheckRowError(_0x0a9e('0x29'),'Duplicate\x20Contact',_0x1122db,_0x3b45bc));}}return db[_0x0a9e('0x2a')][_0x0a9e('0x2b')](_0x5bfb33,{'raw':!![],'hooks':![],'fields':_[_0x0a9e('0x2c')](_0x5bfb33)})[_0x0a9e('0x2d')](function(_0x2b45ea){if(DUPLICATES&&DUPLICATES[_0x0a9e('0x18')]&&_0x2fb0e4){_0x2fb0e4[_0x0a9e('0x2e')](_[_0x0a9e('0x2f')](_0x5bfb33,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2b45ea['id'];return _0x4d00e6();})['catch'](function(_0x44295a){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x30')+(_0x44295a[_0x0a9e('0x1a')]||JSON[_0x0a9e('0x31')](_0x44295a)),null,_0x3b45bc));});});}function checkHopper(){function _0x3f3d41(){return function(_0x567193){logger[_0x0a9e('0x13')](_0x0a9e('0x32'),_0x0a9e('0x33'),util[_0x0a9e('0x34')](_0x567193,{'showHidden':![],'depth':null}));};}var _0x4853b1=function(_0x54135e,_0x1e8694){var _0x5640eb=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')](['phone',_0x0a9e('0x39'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x1e8694,'createdAt',_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')]('phone','phone')[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),'ListId')['field'](_0x54135e['id'][_0x0a9e('0x3f')](),_0x1e8694)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')](_0x0a9e('0x46'))[_0x0a9e('0x43')](_0x0a9e('0x47'),squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')['where'](_0x1e8694+_0x0a9e('0x48'),_0x54135e['id'][_0x0a9e('0x3f')]())))[_0x0a9e('0x3f')]();return _0x5640eb;};var _0x315881=function(_0x1a69dd,_0xc9a702){var _0x10b040=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),'scheduledAt',_0x0a9e('0x3a'),_0x0a9e('0x26'),_0xc9a702,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x1a69dd['id'][_0x0a9e('0x3f')](),_0xc9a702)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x3b'))[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')]('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x4a'))[_0x0a9e('0x41')](_0x0a9e('0x4b'))[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id'][_0x0a9e('0x3f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id']['toString']())))['toString']();return _0x10b040;};function _0x2ef381(_0x59c6ff,_0x443e72){var _0x4c3845=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))['fromQuery']([_0x0a9e('0x1f'),_0x0a9e('0x39'),'ContactId','ListId',_0x443e72,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')]('phone',_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')['field']('id','ContactId')[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x59c6ff['id'][_0x0a9e('0x3f')](),_0x443e72)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID['toString']())[_0x0a9e('0x43')](_0x0a9e('0x4c'),squel['str'](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x0a9e('0x3f')]();return _0x4c3845;}function _0x5ba1f9(_0x4b3c1a,_0x5674ee){var _0x273cb5=squel['insert']()[_0x0a9e('0x36')](_0x0a9e('0x4d'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x5674ee,'createdAt',_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field']('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),_0x0a9e('0x26'))['field'](_0x4b3c1a['id'][_0x0a9e('0x3f')](),_0x5674ee)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x3b'))[_0x0a9e('0x41')]('cm_contacts')[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')]('ListId\x20=\x20?',LISTID[_0x0a9e('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')](_0x0a9e('0x46')))[_0x0a9e('0x3f')]();return _0x273cb5;}return db[_0x0a9e('0x4e')][_0x0a9e('0x4f')]({'where':{'type':_0x0a9e('0x50')},'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x53'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x19012b){var _0x2bbb86=[];if(_0x19012b){var _0x2b8192;for(var _0x320898=0x0,_0x412a72;_0x320898<_0x19012b[_0x0a9e('0x18')];_0x320898+=0x1){_0x412a72=_0x19012b[_0x320898][_0x0a9e('0x54')]({'plain':!![]});switch(_0x412a72['dialCheckDuplicateType']){case _0x0a9e('0x55'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x315881(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x4853b1(_0x412a72,_0x0a9e('0x57')))['then'](function(){})['catch'](_0x3f3d41()));break;default:_0x2bbb86['push'](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x2ef381(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}}return _0x2bbb86;})[_0x0a9e('0x5b')]()[_0x0a9e('0x2d')](function(){return db[_0x0a9e('0x4e')]['findAll']({'where':{'type':_0x0a9e('0x50')},'attributes':['id'],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x2bdc44){var _0x583b2e=[];if(_0x2bdc44){var _0x4437ff;for(var _0x44351d=0x0,_0x4c46c1;_0x44351d<_0x2bdc44[_0x0a9e('0x18')];_0x44351d+=0x1){_0x4c46c1=_0x2bdc44[_0x44351d][_0x0a9e('0x54')]({'plain':!![]});_0x583b2e[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x5ba1f9(_0x4c46c1,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x583b2e;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x3511c9){var _0x30a4c7=[];if(_0x3511c9){for(var _0xf410e5=0x0,_0x332367;_0xf410e5<_0x3511c9[_0x0a9e('0x18')];_0xf410e5+=0x1){_0x332367=_0x3511c9[_0xf410e5][_0x0a9e('0x54')]({'plain':!![]});switch(_0x332367[_0x0a9e('0x51')]){case _0x0a9e('0x55'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x315881(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x4853b1(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));break;default:_0x30a4c7[_0x0a9e('0x2e')](db['sequelize']['query'](_0x2ef381(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));}}}return _0x30a4c7;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x2d2286){var _0x42b959=[];if(_0x2d2286){for(var _0x3755fe=0x0,_0x1f42a0;_0x3755fe<_0x2d2286[_0x0a9e('0x18')];_0x3755fe+=0x1){_0x1f42a0=_0x2d2286[_0x3755fe]['get']({'plain':!![]});_0x42b959[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x5ba1f9(_0x1f42a0,_0x0a9e('0x5e')))['then'](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x42b959;})[_0x0a9e('0x5b')]();})['catch'](function(_0x1d6834){logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x60'),_0x1d6834[_0x0a9e('0x1a')]);});}var processPromises=function(_0x385d52){return BPromise['all'](promises)['then'](function(_0x353384){})[_0x0a9e('0x5a')](function(_0x94dcf5){logger['error'](_0x0a9e('0x61'),JSON[_0x0a9e('0x31')](_0x94dcf5));})['finally'](function(){socket['emit'](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x385d52){return _0x385d52['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0a9e('0x2d')](function(){socket[_0x0a9e('0x63')](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0a9e('0x64')](FILEPATH);}catch(_0x3c6dd6){logger[_0x0a9e('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x0a9e('0x31')](_0x3c6dd6));}finally{process['exit'](0x0);}});};process['on'](_0x0a9e('0x65'),function(){logger[_0x0a9e('0x66')](_0x0a9e('0x67'));endCsv();});function main(){return BPromise[_0x0a9e('0x68')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0a9e('0x11')](',');return db[_0x0a9e('0x2a')][_0x0a9e('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0xb6e411){var _0x21e592=fs[_0x0a9e('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0a9e('0x6a')](_0x21e592,{'header':!![],'skipEmptyLines':!![],'step':function(_0x255e49,_0x1910bf){total+=0x1;var _0x32b9bd=total;promises[_0x0a9e('0x2e')](checkRow(_0x255e49,_0xb6e411,_0x32b9bd)['then'](function(){success+=0x1;})[_0x0a9e('0x5a')](function(_0x3325c5){if(_0x3325c5['error']){errors+=0x1;delete _0x3325c5[_0x0a9e('0x13')];}else if(_0x3325c5[_0x0a9e('0x29')]){duplicates+=0x1;delete _0x3325c5[_0x0a9e('0x29')];}rows['push'](_0x3325c5);}));if(total%0xc8===0x0){_0x1910bf[_0x0a9e('0x6b')]();return processPromises(_0x1910bf);}},'complete':function(){return processPromises()['then'](function(){logger[_0x0a9e('0x66')](_0x0a9e('0x6c'));endCsv();});},'error':function(_0x558a87,_0x1f29bd){logger[_0x0a9e('0x66')](_0x0a9e('0x6d'),JSON[_0x0a9e('0x31')](_0x558a87));endCsv();}});})[_0x0a9e('0x5a')](function(_0x501050){logger[_0x0a9e('0x13')](_0x0a9e('0x6e'),JSON[_0x0a9e('0x31')](_0x501050));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d584b20..90740c5 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 _0xda7b=['localhost','format','select','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','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','createdAt','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','concat','keys','deletedAt\x20IS\x20NULL','id\x20IN\x20?','field','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','code','sequelize','spread','push','catch','error','main','stringify','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xda7b,0x102));var _0xbda7=function(_0x438ffe,_0xbf1a81){_0x438ffe=_0x438ffe-0x0;var _0x5e637b=_0xda7b[_0x438ffe];return _0x5e637b;};'use strict';var fs=require('fs');var path=require(_0xbda7('0x0'));var _=require(_0xbda7('0x1'));var Papa=require(_0xbda7('0x2'));var util=require('util');var BPromise=require(_0xbda7('0x3'));var moment=require(_0xbda7('0x4'));var squel=require('squel');var Redis=require(_0xbda7('0x5'));var db=require(_0xbda7('0x6'))['db'];var config=require(_0xbda7('0x7'));var logger=require(_0xbda7('0x8'))(_0xbda7('0x9'));config['redis']=_[_0xbda7('0xa')](config[_0xbda7('0xb')],{'host':_0xbda7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbda7('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xbda7('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x537eb4){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x537eb4);}function selectNotIn(_0x347d94,_0x37ad15,_0x77373e,_0x2ae8a8,_0x324453){return squel[_0xbda7('0xe')]()['field'](_0xbda7('0xf'))[_0xbda7('0x10')](_0x2ae8a8)[_0xbda7('0x11')](_0x37ad15,null,_0x37ad15+_0xbda7('0x12')+_0x2ae8a8+'.'+_0x77373e)['where'](_0x2ae8a8+'.'+_0x77373e+'\x20=\x20'+_0x347d94+'.'+_0x77373e)[_0xbda7('0x13')](_0x37ad15+_0xbda7('0x14')+_0x324453['join']()+')');}function insertCmHopper(_0xed0d5f,_0x778d3e,_0x1a07ad,_0x2736aa,_0x259609){var _0xde7795=[_0xbda7('0x15'),_0xbda7('0x16'),_0xbda7('0x17'),_0xbda7('0x18'),_0x778d3e+'.'+_0x2736aa,_0xbda7('0x19'),_0xbda7('0x1a'),_0xbda7('0x1b'),_0xbda7('0x1c'),'\x22'+_0x259609+'\x22'];return squel[_0xbda7('0x1d')]()[_0xbda7('0x1e')]('cm_hopper')[_0xbda7('0x1f')](['phone',_0xbda7('0x20'),_0xbda7('0x21'),_0xbda7('0x22'),_0x2736aa,'createdAt',_0xbda7('0x23'),_0xbda7('0x24'),'UserId',_0xbda7('0x25')],squel['select']()[_0xbda7('0x26')](_0xde7795)['from'](_0x778d3e)[_0xbda7('0x11')](_0xbda7('0x27'),null,_0xbda7('0x28')+_0x778d3e+_0xbda7('0x29'))[_0xbda7('0x11')](_0x1a07ad,null,_0x1a07ad+_0xbda7('0x12')+_0x778d3e+'.'+_0x2736aa)['where'](_0x778d3e+_0xbda7('0x2a'),_0xed0d5f)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x778d3e,_0x1a07ad,_0x2736aa,_0xbda7('0x2b'),[_0xbda7('0x2c'),_0xbda7('0x2d')]))[_0xbda7('0x13')](_0xbda7('0x2e'),selectNotIn(_0x778d3e,_0x1a07ad,_0x2736aa,_0xbda7('0x2b'),[_0xbda7('0x2c')])))[_0xbda7('0x2f')]();}function insertCmHopperBlack(_0x4d0758,_0x17f745,_0x417e29,_0x1add31){var _0x49ed7f=[_0xbda7('0x15'),_0xbda7('0x17'),_0xbda7('0x18'),_0x17f745+'.'+_0x1add31,_0xbda7('0x19'),_0xbda7('0x1a')];return squel[_0xbda7('0x1d')]()['into']('cm_hopper_black')['fromQuery'](['phone','ContactId',_0xbda7('0x22'),_0x1add31,_0xbda7('0x30'),'updatedAt'],squel[_0xbda7('0xe')]()[_0xbda7('0x26')](_0x49ed7f)[_0xbda7('0x10')](_0x17f745)[_0xbda7('0x11')](_0xbda7('0x27'),null,_0xbda7('0x28')+_0x17f745+_0xbda7('0x29'))['join'](_0x417e29,null,_0x417e29+_0xbda7('0x12')+_0x17f745+'.'+_0x1add31)[_0xbda7('0x13')](_0x17f745+'.CmListId\x20=\x20?',_0x4d0758)[_0xbda7('0x13')](_0xbda7('0x31'),NOW)[_0xbda7('0x13')](_0xbda7('0x2e'),squel[_0xbda7('0xe')]()['field']('phone')[_0xbda7('0x10')]('cm_hopper_black')[_0xbda7('0x13')]('ListId\x20=\x20?',_0x4d0758)['where'](_0x1add31+_0xbda7('0x32'),_0x17f745+'.'+_0x1add31)))[_0xbda7('0x2f')]();}function insertCmContact(_0x1a7ff6,_0x3ad628,_0x46de89,_0x33fc3a){var _0x1cce83=_[_0xbda7('0x33')](_[_0xbda7('0x34')](_0x33fc3a),[_0xbda7('0x22'),'CompanyId',_0xbda7('0x30'),_0xbda7('0x23')]);return squel['insert']()[_0xbda7('0x1e')](_0xbda7('0x27'))[_0xbda7('0x1f')](_0x1cce83,squel[_0xbda7('0xe')]()[_0xbda7('0x26')](_0x1cce83)['from'](_0x3ad628)['where']('('+_0x46de89[_0xbda7('0x11')](',')+')\x20NOT\x20IN\x20?',squel['select']()['fields'](_0x46de89)[_0xbda7('0x10')](_0xbda7('0x27'))[_0xbda7('0x13')]('ListId\x20=\x20?',_0x1a7ff6)[_0xbda7('0x13')](_0xbda7('0x35')))[_0xbda7('0x13')](_0xbda7('0x36'),squel[_0xbda7('0xe')]()[_0xbda7('0x37')](_0xbda7('0x38'),_0xbda7('0x39'))[_0xbda7('0x10')](_0x3ad628)[_0xbda7('0x3a')](_0x46de89[_0xbda7('0x11')](','))))['toString']();}function handleStop(){logger[_0xbda7('0x3b')](_0xbda7('0x3c'));stopped=!![];}function handleUncaughtException(_0x1fee3f){logger['error'](_0x1fee3f[_0xbda7('0x3d')]);process[_0xbda7('0x3e')](0x1);}function handleError(_0x32e072,_0x56ead6){stats[_0xbda7('0x3f')]['push']({'name':_0x56ead6[_0xbda7('0x40')],'message':_0x56ead6[_0xbda7('0x3d')],'row':_0x32e072});}function handleQuery(_0xfd7615){logger[_0xbda7('0x3b')](_0xfd7615);return db[_0xbda7('0x41')]['query'](_0xfd7615)[_0xbda7('0x42')](function(_0x569cc0){results[_0xbda7('0x43')](_0x569cc0);})[_0xbda7('0x44')](function(_0x57cb1a){logger[_0xbda7('0x45')](_0x57cb1a[_0xbda7('0x3d')]);});}function main(_0x23f54a,_0x559f08,_0x58e331,_0x57c7cc){logger[_0xbda7('0x3b')](_0xbda7('0x46'),_0x23f54a,JSON[_0xbda7('0x47')](_0x559f08));process['send']('start');var _0x1c514d=_0x559f08[_0xbda7('0x48')];var _0x17f989=_0x559f08[_0xbda7('0x49')];var _0x183dba=path['join'](config[_0xbda7('0x4a')],_0xbda7('0x4b'),_0x17f989+'.csv');var _0x299d01=_['keys'](_0x1c514d)['join']();logger[_0xbda7('0x3b')](_0xbda7('0x4c'),_0x299d01);fs[_0xbda7('0x4d')](_0x183dba,_0x299d01+'\x0a');Papa[_0xbda7('0x4e')](fs[_0xbda7('0x4f')](_0x23f54a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x12a5d7,_0x36ae94){try{for(var _0x443f98=0x0,_0x1826da=[];_0x443f98<_0x12a5d7[_0xbda7('0x50')][_0xbda7('0x51')];_0x443f98++){stats[_0xbda7('0x52')]+=0x1;if(_0x12a5d7[_0xbda7('0x3f')][_0x443f98]){handleError(_0x12a5d7[_0xbda7('0x50')][_0x443f98],_0x12a5d7[_0xbda7('0x3f')][_0x443f98]);}else{var _0x29bbbd=[];for(var _0x23a1ed in _0x1c514d){if(_0x1c514d[_0xbda7('0x53')](_0x23a1ed)){if(_0x12a5d7[_0xbda7('0x50')][_0x443f98][_0x1c514d[_0x23a1ed]]){var _0x268561=_[_0xbda7('0x54')](_0x12a5d7[_0xbda7('0x50')][_0x443f98][_0x1c514d[_0x23a1ed]][_0xbda7('0x55')](/"/g,'\x27'));switch(_0x23a1ed){case _0xbda7('0x20'):var _0x3f383b=moment(_0x268561,_0xbda7('0x56'),!![]);if(_0x3f383b[_0xbda7('0x57')]()){_0x1826da[_0xbda7('0x43')]('\x22'+_0x268561+'\x22');}else{_0x29bbbd[_0xbda7('0x43')](_0xbda7('0x58'));}break;case'priority':var _0x17a186=parseInt(_0x268561);_0x268561=_['isNaN'](_0x17a186)||_0x17a186<0x0||_0x17a186>0x4?_0x57c7cc?0x3:0x2:_0x17a186;_0x1826da[_0xbda7('0x43')]('\x22'+_0x268561+'\x22');break;case _0xbda7('0x59'):var _0x405f4c=parseInt(_0x268561);if(_[_0xbda7('0x5a')](_0x405f4c)&&_[_0xbda7('0x5b')](_0x58e331,_0x405f4c)){_0x1826da[_0xbda7('0x43')]('\x22'+_0x405f4c+'\x22');}else{_0x29bbbd[_0xbda7('0x43')](_0xbda7('0x5c'));}break;case _0xbda7('0x5d'):if(isEmail(_0x268561)){_0x1826da[_0xbda7('0x43')]('\x22'+_0x268561+'\x22');}else{_0x29bbbd[_0xbda7('0x43')](_0xbda7('0x5e'));}break;case'dateOfBirth':var _0x59a5bd=moment(_0x268561,_0xbda7('0x5f'),!![]);if(_0x59a5bd[_0xbda7('0x57')]()){_0x1826da[_0xbda7('0x43')]('\x22'+_0x268561+'\x22');}else{_0x29bbbd[_0xbda7('0x43')](_0xbda7('0x60'));}break;default:_0x1826da[_0xbda7('0x43')]('\x22'+_0x268561+'\x22');}}else{switch(_0x23a1ed){case _0xbda7('0x61'):case _0xbda7('0xf'):_0x29bbbd[_0xbda7('0x43')](_0x23a1ed+'\x20not\x20specified');break;default:_0x1826da['push']('\x22\x22');}}}}if(_0x29bbbd[_0xbda7('0x51')]){handleError(_0x12a5d7[_0xbda7('0x50')][_0x443f98],{'code':'SystemRow','message':_0x29bbbd[_0xbda7('0x11')]()});}else{fs[_0xbda7('0x62')](_0x183dba,_0x1826da[_0xbda7('0x11')]()+'\x0a');}_0x1826da=[];}if(!(stats['rows']%0xc8)){socket[_0xbda7('0x63')](_0xbda7('0x64')+_0x17f989,stats);stats[_0xbda7('0x3f')]=[];}}if(stopped){logger[_0xbda7('0x3b')](_0xbda7('0x65'));_0x36ae94[_0xbda7('0x66')]();}}catch(_0x39fe74){handleError(_0x12a5d7[_0xbda7('0x50')][_0x443f98],{'code':_0xbda7('0x67'),'message':_0x39fe74[_0xbda7('0x3d')]});logger[_0xbda7('0x45')](_0xbda7('0x68'),_0x39fe74[_0xbda7('0x3d')]);}},'complete':function(){try{var _0x2fdacf=[];var _0x33dedd='cm_contacts';if(_0x559f08[_0xbda7('0x69')]&&_0x559f08[_0xbda7('0x69')][_0xbda7('0x51')]){_0x33dedd=_0xbda7('0x6a')+_0x17f989;_0x2fdacf['push'](_0xbda7('0x6b')+_0x33dedd+'\x20LIKE\x20cm_contacts;');}var _0x458d03=util[_0xbda7('0xd')](_0xbda7('0x6c'),_0x183dba,_0x33dedd,_0x299d01,_0x559f08['ListId'],_0x559f08[_0xbda7('0x6d')]||null,NOW,NOW);if(_[_0xbda7('0x6e')](_0x1c514d[_0xbda7('0x20')])){_0x458d03+=_0xbda7('0x6f');}_0x2fdacf['push'](_0x458d03);if(_0x559f08['duplicates']&&_0x559f08['duplicates'][_0xbda7('0x51')]){_0x2fdacf[_0xbda7('0x43')](insertCmContact(_0x559f08[_0xbda7('0x22')],_0x33dedd,_0x559f08[_0xbda7('0x69')],_0x1c514d));_0x2fdacf[_0xbda7('0x43')](_0xbda7('0x70')+_0x33dedd+';');}_0x2fdacf[_0xbda7('0x43')](insertCmHopper(_0x559f08[_0xbda7('0x22')],_0xbda7('0x71'),'voice_queues',_0xbda7('0x72'),_0x57c7cc));_0x2fdacf['push'](insertCmHopperBlack(_0x559f08[_0xbda7('0x22')],_0xbda7('0x73'),_0xbda7('0x74'),'VoiceQueueId'));_0x2fdacf[_0xbda7('0x43')](insertCmHopper(_0x559f08['ListId'],_0xbda7('0x75'),'campaigns',_0xbda7('0x76'),_0x57c7cc));_0x2fdacf[_0xbda7('0x43')](insertCmHopperBlack(_0x559f08[_0xbda7('0x22')],_0xbda7('0x77'),'campaigns',_0xbda7('0x76')));BPromise[_0xbda7('0x78')](_0x2fdacf,handleQuery)[_0xbda7('0x79')](function(_0x1ff14b){stats['finish']=!![];stats['affectedRows']=_0x559f08[_0xbda7('0x69')]&&_0x559f08['duplicates'][_0xbda7('0x51')]?results[0x2][_0xbda7('0x7a')]:results[0x0]['affectedRows'];socket[_0xbda7('0x63')](_0xbda7('0x64')+_0x17f989,stats);fs[_0xbda7('0x7b')](_0x23f54a);fs['unlink'](_0x183dba);process['exit'](0x0);})[_0xbda7('0x44')](function(_0x301ab8){logger[_0xbda7('0x45')](_0x301ab8[_0xbda7('0x3d')]);process[_0xbda7('0x3e')](0x1);});}catch(_0x39898f){logger['error'](_0xbda7('0x7c'),_0x39898f[_0xbda7('0x3d')]);process['exit'](0x1);}},'error':function(_0x2be9f2,_0x4488bd,_0x3bb33e,_0x2d2e92){throw new Error(_0x2d2e92);}});}function validate(){if(process[_0xbda7('0x7d')]&&process[_0xbda7('0x7d')][_0xbda7('0x51')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x543a75=path[_0xbda7('0x11')](config[_0xbda7('0x4a')],_0xbda7('0x4b'),process[_0xbda7('0x7d')][0x2]);if(!fs[_0xbda7('0x7e')](_0x543a75)){throw new Error(_0xbda7('0x7f'));}var _0x1e41d8={};try{_0x1e41d8=JSON[_0xbda7('0x4e')](process[_0xbda7('0x7d')][0x3]);if(!_0x1e41d8['binding']){throw new Error(_0xbda7('0x80'));}if(!_0x1e41d8[_0xbda7('0x48')][_0xbda7('0xf')]){throw new Error(_0xbda7('0x81'));}if(!_0x1e41d8['binding'][_0xbda7('0x61')]){throw new Error(_0xbda7('0x82'));}var _0xb5b8ff=0x0;if(_0x1e41d8['binding'][_0xbda7('0x59')]){_0xb5b8ff=0x1;}if(!_0x1e41d8[_0xbda7('0x22')]){throw new Error(_0xbda7('0x83'));}}catch(_0x20a3f5){throw new Error(_0xbda7('0x84'));}var _0x558f9c=[];try{_0x558f9c=_[_0xbda7('0x85')](JSON[_0xbda7('0x4e')](process[_0xbda7('0x7d')][0x4]),'id');}catch(_0xe832db){logger[_0xbda7('0x3b')]('No\x20agent\x20available');}main(_0x543a75,_0x1e41d8,_0x558f9c,_0xb5b8ff);}validate();process['on']('SIGINT',handleStop);process['on'](_0xbda7('0x86'),handleUncaughtException); \ No newline at end of file +var _0x898b=['toString','cm_contacts.updatedAt','cm_hopper_black','createdAt','ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','errors','push','spread','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','header','parse','data','length','rows','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','complete','arguments\x20\x20\x20','argv','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','test','field','phone','from','join','.id\x20=\x20','where','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22'];(function(_0x1293f1,_0x1a39dc){var _0x2f800b=function(_0x115544){while(--_0x115544){_0x1293f1['push'](_0x1293f1['shift']());}};_0x2f800b(++_0x1a39dc);}(_0x898b,0x160));var _0xb898=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x898b[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0xb898('0x0'));var _=require(_0xb898('0x1'));var Papa=require('papaparse');var util=require(_0xb898('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xb898('0x3'));var Redis=require(_0xb898('0x4'));var db=require(_0xb898('0x5'))['db'];var config=require(_0xb898('0x6'));var logger=require(_0xb898('0x7'))(_0xb898('0x8'));config[_0xb898('0x9')]=_[_0xb898('0xa')](config[_0xb898('0x9')],{'host':_0xb898('0xb'),'port':0x18eb});var socket=require(_0xb898('0xc'))(new Redis(config[_0xb898('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xb898('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x2d0409){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))*$/[_0xb898('0xe')](_0x2d0409);}function selectNotIn(_0x2fb84b,_0x19efa0,_0x1775d3,_0xd06d13,_0xf06b7f){return squel['select']()[_0xb898('0xf')](_0xb898('0x10'))[_0xb898('0x11')](_0xd06d13)[_0xb898('0x12')](_0x19efa0,null,_0x19efa0+_0xb898('0x13')+_0xd06d13+'.'+_0x1775d3)['where'](_0xd06d13+'.'+_0x1775d3+'\x20=\x20'+_0x2fb84b+'.'+_0x1775d3)[_0xb898('0x14')](_0x19efa0+'.dialCheckDuplicateType\x20IN\x20('+_0xf06b7f[_0xb898('0x12')]()+')');}function insertCmHopper(_0x20e508,_0x588e34,_0x1d4839,_0x4313e9,_0x46f2de){var _0x32bbd0=[_0xb898('0x15'),'cm_contacts.scheduledat',_0xb898('0x16'),_0xb898('0x17'),_0x588e34+'.'+_0x4313e9,_0xb898('0x18'),'cm_contacts.updatedAt',_0xb898('0x19'),_0xb898('0x1a'),'\x22'+_0x46f2de+'\x22'];return squel[_0xb898('0x1b')]()[_0xb898('0x1c')](_0xb898('0x1d'))[_0xb898('0x1e')](['phone',_0xb898('0x1f'),_0xb898('0x20'),_0xb898('0x21'),_0x4313e9,'createdAt',_0xb898('0x22'),'priority',_0xb898('0x23'),_0xb898('0x24')],squel[_0xb898('0x25')]()[_0xb898('0x26')](_0x32bbd0)[_0xb898('0x11')](_0x588e34)[_0xb898('0x12')](_0xb898('0x27'),null,_0xb898('0x28')+_0x588e34+_0xb898('0x29'))['join'](_0x1d4839,null,_0x1d4839+_0xb898('0x13')+_0x588e34+'.'+_0x4313e9)['where'](_0x588e34+_0xb898('0x2a'),_0x20e508)[_0xb898('0x14')](_0xb898('0x2b'),NOW)['where'](_0xb898('0x2c'),selectNotIn(_0x588e34,_0x1d4839,_0x4313e9,_0xb898('0x1d'),[_0xb898('0x2d'),_0xb898('0x2e')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x588e34,_0x1d4839,_0x4313e9,_0xb898('0x1d'),[_0xb898('0x2d')])))[_0xb898('0x2f')]();}function insertCmHopperBlack(_0x100a93,_0x57326e,_0x91c971,_0xa6cc12){var _0x6e2450=[_0xb898('0x15'),_0xb898('0x16'),_0xb898('0x17'),_0x57326e+'.'+_0xa6cc12,_0xb898('0x18'),_0xb898('0x30')];return squel[_0xb898('0x1b')]()[_0xb898('0x1c')](_0xb898('0x31'))[_0xb898('0x1e')]([_0xb898('0x10'),_0xb898('0x20'),_0xb898('0x21'),_0xa6cc12,_0xb898('0x32'),'updatedAt'],squel[_0xb898('0x25')]()[_0xb898('0x26')](_0x6e2450)[_0xb898('0x11')](_0x57326e)['join'](_0xb898('0x27'),null,_0xb898('0x28')+_0x57326e+'.CmListId')[_0xb898('0x12')](_0x91c971,null,_0x91c971+_0xb898('0x13')+_0x57326e+'.'+_0xa6cc12)['where'](_0x57326e+_0xb898('0x2a'),_0x100a93)['where'](_0xb898('0x2b'),NOW)[_0xb898('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xb898('0x25')]()[_0xb898('0xf')](_0xb898('0x10'))['from'](_0xb898('0x31'))[_0xb898('0x14')](_0xb898('0x33'),_0x100a93)['where'](_0xa6cc12+'\x20=\x20?',_0x57326e+'.'+_0xa6cc12)))['toString']();}function insertCmContact(_0x50c08b,_0xc90719,_0x26842e,_0xd73e13){var _0xcb4a0d=_['concat'](_[_0xb898('0x34')](_0xd73e13),[_0xb898('0x21'),_0xb898('0x35'),_0xb898('0x32'),'updatedAt']);return squel['insert']()[_0xb898('0x1c')]('cm_contacts')[_0xb898('0x1e')](_0xcb4a0d,squel[_0xb898('0x25')]()[_0xb898('0x26')](_0xcb4a0d)['from'](_0xc90719)[_0xb898('0x14')]('('+_0x26842e[_0xb898('0x12')](',')+_0xb898('0x36'),squel[_0xb898('0x25')]()[_0xb898('0x26')](_0x26842e)['from'](_0xb898('0x27'))[_0xb898('0x14')](_0xb898('0x33'),_0x50c08b)['where']('deletedAt\x20IS\x20NULL'))[_0xb898('0x14')]('id\x20IN\x20?',squel['select']()[_0xb898('0xf')](_0xb898('0x37'),'min_id')[_0xb898('0x11')](_0xc90719)[_0xb898('0x38')](_0x26842e[_0xb898('0x12')](','))))['toString']();}function handleStop(){logger[_0xb898('0x39')](_0xb898('0x3a'));stopped=!![];}function handleUncaughtException(_0x5f5033){logger[_0xb898('0x3b')](_0x5f5033[_0xb898('0x3c')]);process[_0xb898('0x3d')](0x1);}function handleError(_0x3b6fc3,_0x378779){stats[_0xb898('0x3e')][_0xb898('0x3f')]({'name':_0x378779['code'],'message':_0x378779[_0xb898('0x3c')],'row':_0x3b6fc3});}function handleQuery(_0x1539ca){logger[_0xb898('0x39')](_0x1539ca);return db['sequelize']['query'](_0x1539ca)[_0xb898('0x40')](function(_0x3dcb00){results[_0xb898('0x3f')](_0x3dcb00);})[_0xb898('0x41')](function(_0x34c9fd){logger[_0xb898('0x3b')](_0x34c9fd[_0xb898('0x3c')]);});}function main(_0x3867ca,_0x1fd50c,_0x546631,_0x360497){logger[_0xb898('0x39')](_0xb898('0x42'),_0x3867ca,JSON[_0xb898('0x43')](_0x1fd50c));process[_0xb898('0x44')]('start');var _0x213682=_0x1fd50c[_0xb898('0x45')];var _0xdb60de=_0x1fd50c[_0xb898('0x46')];var _0x360b75=path['join'](config[_0xb898('0x47')],_0xb898('0x48'),_0xdb60de+_0xb898('0x49'));var _0x3aeeaa=_[_0xb898('0x34')](_0x213682)[_0xb898('0x12')]();logger['info'](_0xb898('0x4a'),_0x3aeeaa);fs['writeFileSync'](_0x360b75,_0x3aeeaa+'\x0a');Papa[_0xb898('0x4b')](fs['createReadStream'](_0x3867ca),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2ac2de,_0x27c22d){try{for(var _0x4c5617=0x0,_0xc6e6a5=[];_0x4c5617<_0x2ac2de[_0xb898('0x4c')][_0xb898('0x4d')];_0x4c5617++){stats[_0xb898('0x4e')]+=0x1;if(_0x2ac2de[_0xb898('0x3e')][_0x4c5617]){handleError(_0x2ac2de['data'][_0x4c5617],_0x2ac2de['errors'][_0x4c5617]);}else{var _0x214231=[];for(var _0x5c2c87 in _0x213682){if(_0x213682[_0xb898('0x4f')](_0x5c2c87)){if(_0x2ac2de[_0xb898('0x4c')][_0x4c5617][_0x213682[_0x5c2c87]]){var _0x519d4a=_[_0xb898('0x50')](_0x2ac2de[_0xb898('0x4c')][_0x4c5617][_0x213682[_0x5c2c87]][_0xb898('0x51')](/"/g,'\x27'));switch(_0x5c2c87){case _0xb898('0x1f'):var _0x33f8a1=moment(_0x519d4a,_0xb898('0x52'),!![]);if(_0x33f8a1[_0xb898('0x53')]()){_0xc6e6a5[_0xb898('0x3f')]('\x22'+_0x519d4a+'\x22');}else{_0x214231[_0xb898('0x3f')](_0xb898('0x54'));}break;case _0xb898('0x55'):var _0x5c1c9b=parseInt(_0x519d4a);_0x519d4a=_[_0xb898('0x56')](_0x5c1c9b)||_0x5c1c9b<0x0||_0x5c1c9b>0x4?_0x360497?0x3:0x2:_0x5c1c9b;_0xc6e6a5['push']('\x22'+_0x519d4a+'\x22');break;case _0xb898('0x23'):var _0x2373aa=parseInt(_0x519d4a);if(_[_0xb898('0x57')](_0x2373aa)&&_[_0xb898('0x58')](_0x546631,_0x2373aa)){_0xc6e6a5[_0xb898('0x3f')]('\x22'+_0x2373aa+'\x22');}else{_0x214231[_0xb898('0x3f')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x519d4a)){_0xc6e6a5[_0xb898('0x3f')]('\x22'+_0x519d4a+'\x22');}else{_0x214231[_0xb898('0x3f')](_0xb898('0x59'));}break;case _0xb898('0x5a'):var _0x5e0bb6=moment(_0x519d4a,_0xb898('0x5b'),!![]);if(_0x5e0bb6[_0xb898('0x53')]()){_0xc6e6a5[_0xb898('0x3f')]('\x22'+_0x519d4a+'\x22');}else{_0x214231[_0xb898('0x3f')](_0xb898('0x5c'));}break;default:_0xc6e6a5[_0xb898('0x3f')]('\x22'+_0x519d4a+'\x22');}}else{switch(_0x5c2c87){case _0xb898('0x5d'):case'phone':_0x214231[_0xb898('0x3f')](_0x5c2c87+_0xb898('0x5e'));break;default:_0xc6e6a5[_0xb898('0x3f')]('\x22\x22');}}}}if(_0x214231['length']){handleError(_0x2ac2de['data'][_0x4c5617],{'code':_0xb898('0x5f'),'message':_0x214231[_0xb898('0x12')]()});}else{fs[_0xb898('0x60')](_0x360b75,_0xc6e6a5[_0xb898('0x12')]()+'\x0a');}_0xc6e6a5=[];}if(!(stats['rows']%0xc8)){socket[_0xb898('0x61')](_0xb898('0x62')+_0xdb60de,stats);stats[_0xb898('0x3e')]=[];}}if(stopped){logger[_0xb898('0x39')](_0xb898('0x63'));_0x27c22d[_0xb898('0x64')]();}}catch(_0x20c311){handleError(_0x2ac2de[_0xb898('0x4c')][_0x4c5617],{'code':_0xb898('0x65'),'message':_0x20c311[_0xb898('0x3c')]});logger[_0xb898('0x3b')](_0xb898('0x66'),_0x20c311[_0xb898('0x3c')]);}},'complete':function(){try{var _0x1f0ae1=[];var _0x4a0efd=_0xb898('0x27');if(_0x1fd50c[_0xb898('0x67')]&&_0x1fd50c['duplicates'][_0xb898('0x4d')]){_0x4a0efd='cm_contacts_'+_0xdb60de;_0x1f0ae1[_0xb898('0x3f')](_0xb898('0x68')+_0x4a0efd+_0xb898('0x69'));}var _0x2d0730=util[_0xb898('0xd')](_0xb898('0x6a'),_0x360b75,_0x4a0efd,_0x3aeeaa,_0x1fd50c[_0xb898('0x21')],_0x1fd50c[_0xb898('0x35')]||null,NOW,NOW);if(_[_0xb898('0x6b')](_0x213682[_0xb898('0x1f')])){_0x2d0730+=',\x20scheduledAt\x20=\x20NOW()';}_0x1f0ae1[_0xb898('0x3f')](_0x2d0730);if(_0x1fd50c[_0xb898('0x67')]&&_0x1fd50c['duplicates'][_0xb898('0x4d')]){_0x1f0ae1['push'](insertCmContact(_0x1fd50c['ListId'],_0x4a0efd,_0x1fd50c[_0xb898('0x67')],_0x213682));_0x1f0ae1[_0xb898('0x3f')]('DROP\x20TABLE\x20'+_0x4a0efd+';');}_0x1f0ae1[_0xb898('0x3f')](insertCmHopper(_0x1fd50c[_0xb898('0x21')],'voice_queues_has_cm_lists','voice_queues',_0xb898('0x6c'),_0x360497));_0x1f0ae1[_0xb898('0x3f')](insertCmHopperBlack(_0x1fd50c[_0xb898('0x21')],_0xb898('0x6d'),_0xb898('0x6e'),_0xb898('0x6c')));_0x1f0ae1[_0xb898('0x3f')](insertCmHopper(_0x1fd50c[_0xb898('0x21')],_0xb898('0x6f'),_0xb898('0x70'),_0xb898('0x71'),_0x360497));_0x1f0ae1[_0xb898('0x3f')](insertCmHopperBlack(_0x1fd50c[_0xb898('0x21')],_0xb898('0x72'),_0xb898('0x70'),_0xb898('0x71')));BPromise[_0xb898('0x73')](_0x1f0ae1,handleQuery)[_0xb898('0x74')](function(_0x2209fe){stats[_0xb898('0x75')]=!![];stats[_0xb898('0x76')]=_0x1fd50c[_0xb898('0x67')]&&_0x1fd50c[_0xb898('0x67')][_0xb898('0x4d')]?results[0x2][_0xb898('0x76')]:results[0x0][_0xb898('0x76')];socket[_0xb898('0x61')](_0xb898('0x62')+_0xdb60de,stats);fs[_0xb898('0x77')](_0x3867ca);fs['unlink'](_0x360b75);process[_0xb898('0x3d')](0x0);})[_0xb898('0x41')](function(_0x281da7){logger[_0xb898('0x3b')](_0x281da7[_0xb898('0x3c')]);process[_0xb898('0x3d')](0x1);});}catch(_0x240ae8){logger['error'](_0xb898('0x78'),_0x240ae8[_0xb898('0x3c')]);process[_0xb898('0x3d')](0x1);}},'error':function(_0x4536e1,_0x3bc92e,_0x16ccad,_0xe8f001){throw new Error(_0xe8f001);}});}function validate(){if(process['argv']&&process['argv'][_0xb898('0x4d')]<0x4){throw new Error(_0xb898('0x79'));}var _0x3dd4ca=path[_0xb898('0x12')](config['root'],_0xb898('0x48'),process[_0xb898('0x7a')][0x2]);if(!fs[_0xb898('0x7b')](_0x3dd4ca)){throw new Error(_0xb898('0x7c'));}var _0x8cad0={};try{_0x8cad0=JSON[_0xb898('0x4b')](process[_0xb898('0x7a')][0x3]);if(!_0x8cad0[_0xb898('0x45')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x8cad0[_0xb898('0x45')][_0xb898('0x10')]){throw new Error(_0xb898('0x7d'));}if(!_0x8cad0[_0xb898('0x45')][_0xb898('0x5d')]){throw new Error(_0xb898('0x7e'));}var _0x200b48=0x0;if(_0x8cad0['binding']['UserId']){_0x200b48=0x1;}if(!_0x8cad0[_0xb898('0x21')]){throw new Error(_0xb898('0x7f'));}}catch(_0x5dabaa){throw new Error(_0xb898('0x80'));}var _0x55b99b=[];try{_0x55b99b=_[_0xb898('0x81')](JSON[_0xb898('0x4b')](process[_0xb898('0x7a')][0x4]),'id');}catch(_0x430ef8){logger['info'](_0xb898('0x82'));}main(_0x3dd4ca,_0x8cad0,_0x55b99b,_0x200b48);}validate();process['on'](_0xb898('0x83'),handleStop);process['on'](_0xb898('0x84'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index b464a0a..232aa92 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 _0xe1e3=['***\x20Time\x20Info\x20***','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','destcalleridnum','Member\x20Name','membername','answertime','Complete\x20Time','endtime','Billable\x20Time','billableseconds','getSubjects','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','voice','calleridname','keyValue','destexten','UniqueId','uniqueid','Date','agentcalledAt','destcalleridname'];(function(_0x197242,_0x4ccda1){var _0x626e1f=function(_0xf38eac){while(--_0xf38eac){_0x197242['push'](_0x197242['shift']());}};_0x626e1f(++_0x4ccda1);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x50a488,_0x8879da){_0x50a488=_0x50a488-0x0;var _0x5e7e43=_0xe1e3[_0x50a488];return _0x5e7e43;};'use strict';exports[_0x3e1e('0x0')]=function(_0x12da55,_0x55659f){var _0xdbdabb=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x12da55[_0x3e1e('0x1')]()){case'voice':switch(_0x55659f[_0x3e1e('0x1')]()){case _0x3e1e('0x2'):_0xdbdabb[_0x3e1e('0x3')]({'type':_0x3e1e('0x4'),'content':'','variableName':_0x3e1e('0x5')});_0xdbdabb[_0x3e1e('0x3')]({'type':'variable','content':'','variableName':_0x3e1e('0x6')});break;case _0x3e1e('0x7'):_0xdbdabb[_0x3e1e('0x3')]({'type':_0x3e1e('0x8'),'content':_0x3e1e('0x9'),'variableName':null});_0xdbdabb[_0x3e1e('0x3')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0xdbdabb;};exports['getDescriptions']=function(_0x31d205,_0x5b0df8){var _0x349460=[];switch(_0x31d205[_0x3e1e('0x1')]()){case _0x3e1e('0xa'):switch(_0x5b0df8['toLowerCase']()){case _0x3e1e('0x2'):_0x349460=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x3e1e('0x6')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x3e1e('0x4'),'variableName':_0x3e1e('0xb')},{'type':_0x3e1e('0xc'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0x3e1e('0xd')},{'type':_0x3e1e('0xc'),'content':'','key':'Queue','keyType':_0x3e1e('0x4'),'variableName':_0x3e1e('0x5')},{'type':'keyValue','content':'','key':_0x3e1e('0xe'),'keyType':'variable','variableName':_0x3e1e('0xf')},{'type':_0x3e1e('0xc'),'content':'','key':_0x3e1e('0x10'),'keyType':_0x3e1e('0x4'),'variableName':_0x3e1e('0x11')},{'type':_0x3e1e('0x8'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0x3e1e('0x4'),'variableName':_0x3e1e('0x12')},{'type':_0x3e1e('0xc'),'content':'','key':'Agent\x20Number','keyType':_0x3e1e('0x4'),'variableName':'destcalleridnum'},{'type':_0x3e1e('0x8'),'content':_0x3e1e('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0x3e1e('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0x3e1e('0x4'),'variableName':_0x3e1e('0x11')},{'type':_0x3e1e('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x3e1e('0x14')},{'type':_0x3e1e('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0x3e1e('0x4'),'variableName':_0x3e1e('0x15')},{'type':_0x3e1e('0xc'),'content':'','key':_0x3e1e('0x16'),'keyType':_0x3e1e('0x4'),'variableName':_0x3e1e('0x17')},{'type':_0x3e1e('0xc'),'content':'','key':_0x3e1e('0x18'),'keyType':'variable','variableName':'talktime'}];break;case _0x3e1e('0x7'):_0x349460=[{'type':_0x3e1e('0x8'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0x3e1e('0x4'),'keyContent':'','variableName':_0x3e1e('0x19')},{'type':'keyValue','content':'','key':_0x3e1e('0x1a'),'keyType':'variable','keyContent':'','variableName':_0x3e1e('0x1b')},{'type':_0x3e1e('0xc'),'content':'','key':'UniqueId','keyType':_0x3e1e('0x4'),'keyContent':'','variableName':_0x3e1e('0xf')},{'type':_0x3e1e('0xc'),'content':'','key':'Date','keyType':_0x3e1e('0x4'),'keyContent':'','variableName':'starttime'},{'type':'string','content':'***\x20Time\x20Info\x20***'},{'type':_0x3e1e('0xc'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0x3e1e('0x1c')},{'type':_0x3e1e('0xc'),'content':'','key':_0x3e1e('0x1d'),'keyType':_0x3e1e('0x4'),'keyContent':'','variableName':_0x3e1e('0x1e')},{'type':'keyValue','content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0x3e1e('0xc'),'content':'','key':_0x3e1e('0x1f'),'keyType':_0x3e1e('0x4'),'keyContent':'','variableName':_0x3e1e('0x20')}];break;}}return _0x349460;}; \ No newline at end of file +var _0x4af8=['Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','uniqueid','starttime','Answer\x20Time','answertime','endtime','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','Caller\x20Number','variable','keyValue','Call\x20To','destexten','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x4af8,0x1ad));var _0x84af=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x4af8[_0x2d8fc2];return _0x3a9e53;};'use strict';exports['getSubjects']=function(_0x519c14,_0x5792b9){var _0x5a96c6=[{'type':_0x84af('0x0'),'content':_0x84af('0x1'),'variableName':null}];switch(_0x519c14[_0x84af('0x2')]()){case _0x84af('0x3'):switch(_0x5792b9['toLowerCase']()){case _0x84af('0x4'):_0x5a96c6[_0x84af('0x5')]({'type':'variable','content':'','variableName':_0x84af('0x6')});_0x5a96c6[_0x84af('0x5')]({'type':'variable','content':'','variableName':_0x84af('0x7')});break;case _0x84af('0x8'):_0x5a96c6['push']({'type':'string','content':_0x84af('0x9'),'variableName':null});_0x5a96c6[_0x84af('0x5')]({'type':'variable','content':'','variableName':_0x84af('0xa')});break;}}return _0x5a96c6;};exports['getDescriptions']=function(_0x1623f6,_0x21e634){var _0x34aa9e=[];switch(_0x1623f6[_0x84af('0x2')]()){case'voice':switch(_0x21e634[_0x84af('0x2')]()){case'inbound':_0x34aa9e=[{'type':_0x84af('0x0'),'content':_0x84af('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x84af('0xc'),'keyType':_0x84af('0xd'),'variableName':_0x84af('0x7')},{'type':_0x84af('0xe'),'content':'','key':'Caller\x20Name','keyType':_0x84af('0xd'),'variableName':'calleridname'},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0xf'),'keyType':'variable','variableName':_0x84af('0x10')},{'type':_0x84af('0xe'),'content':'','key':'Queue','keyType':_0x84af('0xd'),'variableName':'queue'},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x11'),'keyType':'variable','variableName':'uniqueid'},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x12'),'keyType':_0x84af('0xd'),'variableName':'agentcalledAt'},{'type':'string','content':_0x84af('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x14'),'keyType':_0x84af('0xd'),'variableName':_0x84af('0x15')},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x16'),'keyType':_0x84af('0xd'),'variableName':_0x84af('0xa')},{'type':'string','content':_0x84af('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x18'),'keyType':'variable','variableName':_0x84af('0x19')},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x1a'),'keyType':'variable','variableName':'agentconnectAt'},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x1b'),'keyType':_0x84af('0xd'),'variableName':_0x84af('0x1c')},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x1d'),'keyType':_0x84af('0xd'),'variableName':_0x84af('0x1e')},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x1f'),'keyType':_0x84af('0xd'),'variableName':'talktime'}];break;case _0x84af('0x8'):_0x34aa9e=[{'type':_0x84af('0x0'),'content':_0x84af('0xb'),'variableName':null},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x20'),'keyType':_0x84af('0xd'),'keyContent':'','variableName':_0x84af('0xa')},{'type':'keyValue','content':'','key':_0x84af('0x21'),'keyType':_0x84af('0xd'),'keyContent':'','variableName':'membername'},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x11'),'keyType':_0x84af('0xd'),'keyContent':'','variableName':_0x84af('0x22')},{'type':'keyValue','content':'','key':'Date','keyType':_0x84af('0xd'),'keyContent':'','variableName':_0x84af('0x23')},{'type':_0x84af('0x0'),'content':_0x84af('0x17')},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x24'),'keyType':'variable','keyContent':'','variableName':_0x84af('0x25')},{'type':_0x84af('0xe'),'content':'','key':'Complete\x20Time','keyType':_0x84af('0xd'),'keyContent':'','variableName':_0x84af('0x26')},{'type':'keyValue','content':'','key':'Duration','keyType':_0x84af('0xd'),'keyContent':'','variableName':'duration'},{'type':_0x84af('0xe'),'content':'','key':_0x84af('0x27'),'keyType':'variable','keyContent':'','variableName':_0x84af('0x28')}];break;}}return _0x34aa9e;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index e6441da..8b763b1 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 _0x6d3f=['openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','upperFirst','update','then','info','catch','error','user','query','clone','body','omit','html','fax','mobile','lodash','../../mysqldb','../../config/logger'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x6d3f,0x11f));var _0xf6d3=function(_0x4c36cb,_0x41a710){_0x4c36cb=_0x4c36cb-0x0;var _0x32fd7b=_0x6d3f[_0x4c36cb];return _0x32fd7b;};'use strict';var _=require(_0xf6d3('0x0'));var db=require(_0xf6d3('0x1'))['db'];var loggers={'openchannel':require(_0xf6d3('0x2'))(_0xf6d3('0x3')),'mail':require(_0xf6d3('0x2'))(_0xf6d3('0x4')),'fax':require(_0xf6d3('0x2'))(_0xf6d3('0x5')),'sms':require('../../config/logger')(_0xf6d3('0x6')),'chat':require(_0xf6d3('0x2'))(_0xf6d3('0x7'))};function getInteractionId(_0x2e00b7,_0x5d0427,_0x21678c){if(_0x2e00b7&&_0x2e00b7[_['upperFirst'](_0x21678c)+_0xf6d3('0x8')]){return _0x2e00b7[_['upperFirst'](_0x21678c)+_0xf6d3('0x8')];}else if(_0x2e00b7&&_0x2e00b7['id']){return _0x2e00b7['id'];}else if(_0x5d0427&&_0x5d0427['id']){return _0x5d0427['id'];}else{return _0xf6d3('0x9');}}function log(_0x527f8a,_0x12ecb1,_0x343f6d,_0x7d2004,_0x400d8a,_0xb1e5ef){loggers[_0x400d8a[_0xf6d3('0xa')]()][_0x527f8a](_0xf6d3('0xb'),_0xb1e5ef[_0xf6d3('0xc')](),_0x12ecb1?_0x12ecb1['id']:null,_0x12ecb1?_0x12ecb1['name']:null,_0x12ecb1?_0x12ecb1['role']:null,getInteractionId(_0x343f6d,_0x7d2004,_0x400d8a),_0x343f6d?JSON[_0xf6d3('0xd')](_0x343f6d):_0xf6d3('0xe'));}function updateUser(_0x382a17,_0x3cd923,_0xf9d5ce,_0x11c64d,_0x346cb4){db[_[_0xf6d3('0xf')](_0x11c64d)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x3cd923,_0xf9d5ce,_0x11c64d)}})['then'](function(_0x19a174){if(_0x19a174){return _0x19a174[_0xf6d3('0x10')]({'UserId':_0x382a17?_0x382a17['id']:null});}})[_0xf6d3('0x11')](function(_0x392de5){if(_0x392de5){log(_0xf6d3('0x12'),_0x382a17,_0x3cd923,_0xf9d5ce,_0x11c64d,_0x346cb4);}})[_0xf6d3('0x13')](function(){log(_0xf6d3('0x14'),_0x382a17,_0x3cd923,_0xf9d5ce,_0x11c64d,_0x346cb4);});}exports['tracked']=function(_0x185507,_0x22893d){return function(_0x57849d,_0x1010c6,_0x33b3bb){var _0x34f8b9=_0x57849d[_0xf6d3('0x15')];var _0x44525e={};var _0x27dcb7=_0x57849d[_0xf6d3('0x16')];if(_0x44525e){_0x44525e=_[_0xf6d3('0x17')](_0x57849d[_0xf6d3('0x18')]);_0x44525e=_[_0xf6d3('0x19')](_0x44525e,[_0xf6d3('0x18'),_0xf6d3('0x1a'),'phone',_0xf6d3('0x1b'),_0xf6d3('0x1c')]);}updateUser(_0x34f8b9,_0x44525e,_0x27dcb7,_0x185507,_0x22893d);_0x33b3bb(null);};}; \ No newline at end of file +var _0x924c=['name','role','null','Interaction','then','info','catch','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase'];(function(_0x2e2877,_0x452e2e){var _0x2678bb=function(_0xf71a0e){while(--_0xf71a0e){_0x2e2877['push'](_0x2e2877['shift']());}};_0x2678bb(++_0x452e2e);}(_0x924c,0x143));var _0xc924=function(_0x5510cd,_0x3c6ec9){_0x5510cd=_0x5510cd-0x0;var _0x3ab943=_0x924c[_0x5510cd];return _0x3ab943;};'use strict';var _=require(_0xc924('0x0'));var db=require(_0xc924('0x1'))['db'];var loggers={'openchannel':require(_0xc924('0x2'))(_0xc924('0x3')),'mail':require('../../config/logger')(_0xc924('0x4')),'fax':require(_0xc924('0x2'))(_0xc924('0x5')),'sms':require('../../config/logger')(_0xc924('0x6')),'chat':require(_0xc924('0x2'))(_0xc924('0x7'))};function getInteractionId(_0x473864,_0x4370cf,_0x5ec6df){if(_0x473864&&_0x473864[_[_0xc924('0x8')](_0x5ec6df)+_0xc924('0x9')]){return _0x473864[_['upperFirst'](_0x5ec6df)+_0xc924('0x9')];}else if(_0x473864&&_0x473864['id']){return _0x473864['id'];}else if(_0x4370cf&&_0x4370cf['id']){return _0x4370cf['id'];}else{return _0xc924('0xa');}}function log(_0x47abf0,_0x467141,_0x21f696,_0x48622d,_0x41843a,_0x5c79b9){loggers[_0x41843a['toLowerCase']()][_0x47abf0](_0xc924('0xb'),_0x5c79b9[_0xc924('0xc')](),_0x467141?_0x467141['id']:null,_0x467141?_0x467141[_0xc924('0xd')]:null,_0x467141?_0x467141[_0xc924('0xe')]:null,getInteractionId(_0x21f696,_0x48622d,_0x41843a),_0x21f696?JSON['stringify'](_0x21f696):_0xc924('0xf'));}function updateUser(_0x98484c,_0x5eb218,_0xa25ed0,_0x51ffa8,_0x437d88){db[_[_0xc924('0x8')](_0x51ffa8)+_0xc924('0x10')]['findOne']({'where':{'id':getInteractionId(_0x5eb218,_0xa25ed0,_0x51ffa8)}})[_0xc924('0x11')](function(_0x2c3cb2){if(_0x2c3cb2){return _0x2c3cb2['update']({'UserId':_0x98484c?_0x98484c['id']:null});}})[_0xc924('0x11')](function(_0x1b5623){if(_0x1b5623){log(_0xc924('0x12'),_0x98484c,_0x5eb218,_0xa25ed0,_0x51ffa8,_0x437d88);}})[_0xc924('0x13')](function(){log('error',_0x98484c,_0x5eb218,_0xa25ed0,_0x51ffa8,_0x437d88);});}exports['tracked']=function(_0x4a2501,_0x348cba){return function(_0x396a03,_0x59943a,_0x15f44b){var _0x4f48d8=_0x396a03['user'];var _0x2af69d={};var _0x1394f0=_0x396a03[_0xc924('0x14')];if(_0x2af69d){_0x2af69d=_[_0xc924('0x15')](_0x396a03[_0xc924('0x16')]);_0x2af69d=_[_0xc924('0x17')](_0x2af69d,[_0xc924('0x16'),_0xc924('0x18'),_0xc924('0x19'),_0xc924('0x1a'),_0xc924('0x1b')]);}updateUser(_0x4f48d8,_0x2af69d,_0x1394f0,_0x4a2501,_0x348cba);_0x15f44b(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 7ac4bf7..688b064 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 _0x9c19=['crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','hasOwnProperty','use','License','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit'];(function(_0x7fcb26,_0x589ef7){var _0x303976=function(_0x42692b){while(--_0x42692b){_0x7fcb26['push'](_0x7fcb26['shift']());}};_0x303976(++_0x589ef7);}(_0x9c19,0x70));var _0x99c1=function(_0x187dbd,_0x2ecf58){_0x187dbd=_0x187dbd-0x0;var _0x45d1e9=_0x9c19[_0x187dbd];return _0x45d1e9;};'use strict';var crypto=require(_0x99c1('0x0'));var util=require('util');var compose=require(_0x99c1('0x1'));var db=require(_0x99c1('0x2'))['db'];var config=require(_0x99c1('0x3'));function getValueFromLicense(_0xae2280,_0x43c461){if(_0xae2280&&_0x43c461){if(_0x43c461[_0x99c1('0x4')]&&_0x43c461[_0x99c1('0x5')]){var _0x3ee560=_0x43c461[_0x99c1('0x4')];var _0xc55e7b=_0x43c461['license'];var _0xbd4ddd=_0x3ee560[_0x99c1('0x6')]('-')[0x4];var _0x5243ad=_0x3ee560[_0x99c1('0x6')]('-')[0x0];var _0x3209ef=crypto[_0x99c1('0x7')](_0x99c1('0x8'),util[_0x99c1('0x9')]('%s:%s:%s',_0xbd4ddd,_0x3ee560,_0x5243ad));var _0xed5140=_0x3209ef[_0x99c1('0xa')](_0xc55e7b,_0x99c1('0xb'),_0x99c1('0xc'));_0xed5140+=_0x3209ef[_0x99c1('0xd')]('utf8');var _0x40bc3e=JSON[_0x99c1('0xe')](_0xed5140);return _0x40bc3e[_0x99c1('0xf')](_0xae2280)?_0x40bc3e[_0xae2280]:null;}}return null;}function isLimit(_0x327d7a,_0x49442e,_0x48a3f6,_0x3d9f4a){var _0x24d471=_0x49442e;return compose()[_0x99c1('0x10')](function(_0x58791a,_0x5af533,_0x21bf53){return db[_0x99c1('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5568a3){var _0xd4a77b=getValueFromLicense(_0x327d7a,_0x5568a3);return _0xd4a77b?_0xd4a77b:_0x24d471;})[_0x99c1('0x12')](function(_0x563f35){_0x24d471=_0x563f35;return _0x48a3f6['count'](_0x3d9f4a);})['then'](function(_0x591150){if(_0x591150>=_0x24d471){return _0x5af533[_0x99c1('0x13')](0x193)[_0x99c1('0x14')]({'message':util[_0x99c1('0x9')](_0x99c1('0x15'),_0x327d7a)});}_0x21bf53();})[_0x99c1('0x16')](function(_0x1b6183){_0x21bf53(_0x1b6183);});});}function isUserLimit(){return isLimit(_0x99c1('0x17'),0x1,db[_0x99c1('0x18')],{'where':{'$or':[{'role':_0x99c1('0x19')},{'role':_0x99c1('0x1a')}]}});}exports[_0x99c1('0x1b')]=isUserLimit; \ No newline at end of file +var _0x1cad=['License','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','license','data1','split','aes-256-ctr','%s:%s:%s','update','base64','use'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x1cad,0x67));var _0xd1ca=function(_0x5ec6d4,_0x507077){_0x5ec6d4=_0x5ec6d4-0x0;var _0x530d74=_0x1cad[_0x5ec6d4];return _0x530d74;};'use strict';var crypto=require(_0xd1ca('0x0'));var util=require(_0xd1ca('0x1'));var compose=require(_0xd1ca('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xd1ca('0x3'));function getValueFromLicense(_0x52a1bd,_0x64517){if(_0x52a1bd&&_0x64517){if(_0x64517['data1']&&_0x64517[_0xd1ca('0x4')]){var _0x4ad4ad=_0x64517[_0xd1ca('0x5')];var _0x4325ae=_0x64517[_0xd1ca('0x4')];var _0x39f2bb=_0x4ad4ad['split']('-')[0x4];var _0x228c49=_0x4ad4ad[_0xd1ca('0x6')]('-')[0x0];var _0x54d1ec=crypto['createDecipher'](_0xd1ca('0x7'),util['format'](_0xd1ca('0x8'),_0x39f2bb,_0x4ad4ad,_0x228c49));var _0x335e81=_0x54d1ec[_0xd1ca('0x9')](_0x4325ae,_0xd1ca('0xa'),'utf8');_0x335e81+=_0x54d1ec['final']('utf8');var _0x7677b0=JSON['parse'](_0x335e81);return _0x7677b0['hasOwnProperty'](_0x52a1bd)?_0x7677b0[_0x52a1bd]:null;}}return null;}function isLimit(_0x5cf226,_0x173949,_0x1648d2,_0x57917d){var _0x288647=_0x173949;return compose()[_0xd1ca('0xb')](function(_0x41a5d7,_0x7100bb,_0x978b88){return db[_0xd1ca('0xc')][_0xd1ca('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xd1ca('0xe')](function(_0x336884){var _0x2ab4c2=getValueFromLicense(_0x5cf226,_0x336884);return _0x2ab4c2?_0x2ab4c2:_0x288647;})[_0xd1ca('0xe')](function(_0x400fd4){_0x288647=_0x400fd4;return _0x1648d2[_0xd1ca('0xf')](_0x57917d);})['then'](function(_0x22a543){if(_0x22a543>=_0x288647){return _0x7100bb['status'](0x193)[_0xd1ca('0x10')]({'message':util['format'](_0xd1ca('0x11'),_0x5cf226)});}_0x978b88();})[_0xd1ca('0x12')](function(_0x339838){_0x978b88(_0x339838);});});}function isUserLimit(){return isLimit(_0xd1ca('0x13'),0x1,db[_0xd1ca('0x14')],{'where':{'$or':[{'role':'admin'},{'role':_0xd1ca('0x15')}]}});}exports[_0xd1ca('0x16')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 3b8a5ef..fe2e407 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f79=['castTo','text','CAST(','\x20AS\x20','$ne','$notIn','field','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','start','$endsWith','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','shift','match','forEach','map','conditions','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f79,0x1b0));var _0x96f7=function(_0x4f9c46,_0x5e28b1){_0x4f9c46=_0x4f9c46-0x0;var _0x126767=_0x6f79[_0x4f9c46];return _0x126767;};'use strict';var _=require(_0x96f7('0x0'));var moment=require('moment');exports[_0x96f7('0x1')]=function(_0x5e45e7){var _0x47a601={'conditions':[]};_0x47a601[_0x96f7('0x2')]=_[_0x96f7('0x3')](_0x5e45e7,_0x96f7('0x4'))?'or':_0x96f7('0x5');var _0x595c80=_0x5e45e7[_0x96f7('0x6')](_0x96f7('0x7'),'')[_0x96f7('0x6')]('[$or]','')[_0x96f7('0x8')]('||');for(var _0x1e0731=0x0;_0x1e0731<_0x595c80['length'];_0x1e0731++){var _0x553d0b=_0x595c80[_0x1e0731][_0x96f7('0x8')](':=');var _0x68b46e=_0x553d0b[0x0];var _0x16d1d9=_0x553d0b[_0x96f7('0x9')](0x1);_0x16d1d9['forEach'](function(_0x2e1512){var _0x49ff8b=_0x2e1512[_0x96f7('0x8')]('[')[_0x96f7('0xa')]();var _0x10b7be=_0x2e1512[_0x96f7('0xb')](/\[(.*?)\]/g);_0x10b7be[_0x96f7('0xc')](function(_0x5613b3){var _0x4f618d=_0x5613b3[_0x96f7('0x8')]('[')['filter'](function(_0x48564f){return _0x48564f['indexOf'](']')>-0x1;})[_0x96f7('0xd')](function(_0x2152b2){return _0x2152b2[_0x96f7('0x8')](']')[0x0];})[0x0];_0x47a601[_0x96f7('0xe')]['push']({'field':_0x68b46e,'operator':_0x49ff8b,'value':_0x4f618d});});});}return _0x47a601;};exports[_0x96f7('0xf')]=function(_0x4451cf,_0x3510c9,_0x24d8d7){var _0x44d7d9={};if(_0x3510c9===_0x96f7('0x10')){if(_0x24d8d7[_0x96f7('0x11')]==='$eq'){_0x24d8d7[_0x96f7('0x11')]=_0x96f7('0x12');_0x24d8d7[_0x96f7('0x13')]+=','+_0x24d8d7[_0x96f7('0x13')];}else if(_[_0x96f7('0x14')]([_0x96f7('0x15'),_0x96f7('0x16')],_0x24d8d7[_0x96f7('0x11')])){_0x24d8d7[_0x96f7('0x13')]=moment(_0x24d8d7[_0x96f7('0x13')])[_0x96f7('0x17')](0x1,_0x96f7('0x18'))[_0x96f7('0x19')](_0x96f7('0x1a'));}}if(_0x24d8d7[_0x96f7('0x1b')]){_0x3510c9=_0x24d8d7[_0x96f7('0x1b')];_0x44d7d9[_0x96f7('0x1c')]=_0x96f7('0x1d')+_0x4451cf+'.'+_0x24d8d7['field']+_0x96f7('0x1e')+_0x24d8d7[_0x96f7('0x1b')]+')\x20'+parseOperator(_0x24d8d7['operator']);}else{_0x44d7d9[_0x96f7('0x1c')]=_0x4451cf+'.'+_0x24d8d7['field']+'\x20'+parseOperator(_0x24d8d7['operator']);}if(_[_0x96f7('0x14')]([_0x96f7('0x1f'),_0x96f7('0x20')],_0x24d8d7['operator']))_0x44d7d9[_0x96f7('0x1c')]='('+_0x44d7d9[_0x96f7('0x1c')]+'\x20OR\x20'+_0x4451cf+'.'+_0x24d8d7[_0x96f7('0x21')]+'\x20IS\x20NULL)';_0x44d7d9[_0x96f7('0x13')]=parseValue(_0x3510c9,_0x24d8d7[_0x96f7('0x11')],_0x24d8d7['value']);return _0x44d7d9;};function parseOperator(_0x5afd73){var _0x586655;switch(_0x5afd73){case'$in':_0x586655='IN\x20?';break;case _0x96f7('0x20'):_0x586655=_0x96f7('0x22');break;case _0x96f7('0x23'):_0x586655=_0x96f7('0x24');break;case _0x96f7('0x1f'):_0x586655=_0x96f7('0x25');break;case'$substring':case _0x96f7('0x26'):case'$endsWith':_0x586655=_0x96f7('0x27');break;case _0x96f7('0x28'):_0x586655=_0x96f7('0x29');break;case _0x96f7('0x15'):_0x586655=_0x96f7('0x2a');break;case _0x96f7('0x16'):_0x586655=_0x96f7('0x2b');break;case _0x96f7('0x2c'):_0x586655='>=\x20?';break;case _0x96f7('0x12'):_0x586655=_0x96f7('0x2d');break;}return _0x586655;}function parseValue(_0x427c87,_0x4649ac,_0x177de1){var _0x48dd31={'start':undefined,'end':undefined};switch(_0x4649ac){case _0x96f7('0x2e'):case _0x96f7('0x20'):_0x48dd31[_0x96f7('0x2f')]=_0x177de1[_0x96f7('0x8')](',');break;case'$substring':_0x48dd31[_0x96f7('0x2f')]='%'+_0x177de1+'%';break;case _0x96f7('0x26'):_0x48dd31[_0x96f7('0x2f')]=_0x177de1+'%';break;case _0x96f7('0x30'):_0x48dd31[_0x96f7('0x2f')]='%'+_0x177de1;break;case _0x96f7('0x12'):var _0x57b110=_0x177de1[_0x96f7('0x8')](',');var _0x177de1=_0x57b110['shift']();var _0x4a70ca=_0x57b110['pop']();if(_0x427c87===_0x96f7('0x10')){_0x177de1=moment(_0x177de1)['utcOffset'](0x0,!![])['format']();_0x4a70ca=moment(_0x4a70ca)['utcOffset'](0x0,!![])[_0x96f7('0x17')](0x17,'hours')['add'](0x3b,_0x96f7('0x31'))[_0x96f7('0x17')](0x3b,_0x96f7('0x32'))[_0x96f7('0x19')]();}_0x48dd31={'start':_0x177de1,'end':_0x4a70ca};break;default:_0x48dd31['start']=_0x177de1;break;}return _0x48dd31;} \ No newline at end of file +var _0xa437=['>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','pop','format','utcOffset','seconds','lodash','moment','sqlOperator','[$or]','and','split','length','slice','forEach','shift','match','filter','conditions','push','buildExpression','DATE','$eq','$between','value','includes','$gt','$lte','operator','add','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','$gte'];(function(_0x40a73a,_0x4d3623){var _0x46e6cb=function(_0x5d08a3){while(--_0x5d08a3){_0x40a73a['push'](_0x40a73a['shift']());}};_0x46e6cb(++_0x4d3623);}(_0xa437,0x1a8));var _0x7a43=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa437[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x7a43('0x0'));var moment=require(_0x7a43('0x1'));exports['parseSearch']=function(_0x129adf){var _0x24b145={'conditions':[]};_0x24b145[_0x7a43('0x2')]=_['startsWith'](_0x129adf,_0x7a43('0x3'))?'or':_0x7a43('0x4');var _0x1029f4=_0x129adf['replace']('[$and]','')['replace'](_0x7a43('0x3'),'')[_0x7a43('0x5')]('||');for(var _0x34e8ac=0x0;_0x34e8ac<_0x1029f4[_0x7a43('0x6')];_0x34e8ac++){var _0xc82061=_0x1029f4[_0x34e8ac][_0x7a43('0x5')](':=');var _0x96ec2b=_0xc82061[0x0];var _0x5ce59b=_0xc82061[_0x7a43('0x7')](0x1);_0x5ce59b[_0x7a43('0x8')](function(_0x45c47f){var _0x1fef70=_0x45c47f[_0x7a43('0x5')]('[')[_0x7a43('0x9')]();var _0xa4ba1f=_0x45c47f[_0x7a43('0xa')](/\[(.*?)\]/g);_0xa4ba1f[_0x7a43('0x8')](function(_0xfc35d4){var _0x205c19=_0xfc35d4['split']('[')[_0x7a43('0xb')](function(_0x52bdb7){return _0x52bdb7['indexOf'](']')>-0x1;})['map'](function(_0xb0344f){return _0xb0344f['split'](']')[0x0];})[0x0];_0x24b145[_0x7a43('0xc')][_0x7a43('0xd')]({'field':_0x96ec2b,'operator':_0x1fef70,'value':_0x205c19});});});}return _0x24b145;};exports[_0x7a43('0xe')]=function(_0x5514b0,_0x6871f3,_0x5deec4){var _0x59a582={};if(_0x6871f3===_0x7a43('0xf')){if(_0x5deec4['operator']===_0x7a43('0x10')){_0x5deec4['operator']=_0x7a43('0x11');_0x5deec4[_0x7a43('0x12')]+=','+_0x5deec4[_0x7a43('0x12')];}else if(_[_0x7a43('0x13')]([_0x7a43('0x14'),_0x7a43('0x15')],_0x5deec4[_0x7a43('0x16')])){_0x5deec4['value']=moment(_0x5deec4[_0x7a43('0x12')])[_0x7a43('0x17')](0x1,'days')['format']('YYYY-MM-DD');}}if(_0x5deec4[_0x7a43('0x18')]){_0x6871f3=_0x5deec4[_0x7a43('0x18')];_0x59a582['text']=_0x7a43('0x19')+_0x5514b0+'.'+_0x5deec4[_0x7a43('0x1a')]+_0x7a43('0x1b')+_0x5deec4['castTo']+')\x20'+parseOperator(_0x5deec4[_0x7a43('0x16')]);}else{_0x59a582[_0x7a43('0x1c')]=_0x5514b0+'.'+_0x5deec4[_0x7a43('0x1a')]+'\x20'+parseOperator(_0x5deec4[_0x7a43('0x16')]);}if(_[_0x7a43('0x13')]([_0x7a43('0x1d'),_0x7a43('0x1e')],_0x5deec4[_0x7a43('0x16')]))_0x59a582[_0x7a43('0x1c')]='('+_0x59a582[_0x7a43('0x1c')]+_0x7a43('0x1f')+_0x5514b0+'.'+_0x5deec4[_0x7a43('0x1a')]+_0x7a43('0x20');_0x59a582[_0x7a43('0x12')]=parseValue(_0x6871f3,_0x5deec4[_0x7a43('0x16')],_0x5deec4['value']);return _0x59a582;};function parseOperator(_0x50dee0){var _0x43dcf6;switch(_0x50dee0){case'$in':_0x43dcf6=_0x7a43('0x21');break;case _0x7a43('0x1e'):_0x43dcf6=_0x7a43('0x22');break;case _0x7a43('0x10'):_0x43dcf6=_0x7a43('0x23');break;case'$ne':_0x43dcf6='<>\x20?';break;case _0x7a43('0x24'):case _0x7a43('0x25'):case _0x7a43('0x26'):_0x43dcf6=_0x7a43('0x27');break;case _0x7a43('0x28'):_0x43dcf6='<\x20?';break;case _0x7a43('0x14'):_0x43dcf6=_0x7a43('0x29');break;case _0x7a43('0x15'):_0x43dcf6=_0x7a43('0x2a');break;case _0x7a43('0x2b'):_0x43dcf6=_0x7a43('0x2c');break;case _0x7a43('0x11'):_0x43dcf6=_0x7a43('0x2d');break;}return _0x43dcf6;}function parseValue(_0x59df56,_0x4c1e84,_0x3d00fc){var _0x277ac4={'start':undefined,'end':undefined};switch(_0x4c1e84){case _0x7a43('0x2e'):case _0x7a43('0x1e'):_0x277ac4[_0x7a43('0x2f')]=_0x3d00fc[_0x7a43('0x5')](',');break;case _0x7a43('0x24'):_0x277ac4[_0x7a43('0x2f')]='%'+_0x3d00fc+'%';break;case'$startsWith':_0x277ac4[_0x7a43('0x2f')]=_0x3d00fc+'%';break;case _0x7a43('0x26'):_0x277ac4[_0x7a43('0x2f')]='%'+_0x3d00fc;break;case _0x7a43('0x11'):var _0x234c49=_0x3d00fc[_0x7a43('0x5')](',');var _0x3d00fc=_0x234c49[_0x7a43('0x9')]();var _0x5c77b6=_0x234c49[_0x7a43('0x30')]();if(_0x59df56===_0x7a43('0xf')){_0x3d00fc=moment(_0x3d00fc)['utcOffset'](0x0,!![])[_0x7a43('0x31')]();_0x5c77b6=moment(_0x5c77b6)[_0x7a43('0x32')](0x0,!![])[_0x7a43('0x17')](0x17,'hours')[_0x7a43('0x17')](0x3b,'minutes')[_0x7a43('0x17')](0x3b,_0x7a43('0x33'))[_0x7a43('0x31')]();}_0x277ac4={'start':_0x3d00fc,'end':_0x5c77b6};break;default:_0x277ac4['start']=_0x3d00fc;break;}return _0x277ac4;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 1aee9b1..1b10376 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 _0x4277=['priority','cast','unsigned','DESC','col','ASC','omit','isArray','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','toString','lodash','sequelize','fields','split','filters','isEmpty','forOwn','parse','sort','map','indexOf'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x4277,0xcd));var _0x7427=function(_0x3d00c6,_0x21501e){_0x3d00c6=_0x3d00c6-0x0;var _0x1d628f=_0x4277[_0x3d00c6];return _0x1d628f;};'use strict';var _=require(_0x7427('0x0'));var sequelize=require(_0x7427('0x1'));var LIMIT_VALUE=0xfa;exports[_0x7427('0x2')]=function(_0x34a078){var _0x299886=null;if(_0x34a078){_0x299886=_0x34a078[_0x7427('0x3')](',');}return _0x299886;};exports[_0x7427('0x4')]=function(_0x4755d6){var _0x14bc15={};if(!_[_0x7427('0x5')](_0x4755d6)){_0x14bc15={};_[_0x7427('0x6')](_0x4755d6,function(_0x22a739,_0x4259cf){try{_0x14bc15[_0x4259cf]=_['isArray'](_0x22a739)?_0x22a739:JSON[_0x7427('0x7')](_0x22a739);}catch(_0x3ac59f){_0x14bc15[_0x4259cf]=_0x22a739[_0x7427('0x3')](',');}});}return _0x14bc15;};exports['limit']=function(_0x213f4d){_0x213f4d=parseInt(_0x213f4d,0xa);if(!_0x213f4d||_0x213f4d<0x0){_0x213f4d=LIMIT_VALUE;}return _0x213f4d;};exports['offset']=function(_0x112126){_0x112126=parseInt(_0x112126,0xa);if(!_0x112126||_0x112126<0x0){_0x112126=0x0;}return _0x112126;};exports[_0x7427('0x8')]=function(_0x4bea70){var _0xa30e8,_0x5d76cd=null;if(_0x4bea70){_0xa30e8=_0x4bea70[_0x7427('0x3')](',');_0x5d76cd=_[_0x7427('0x9')](_0xa30e8,function(_0x94d8cf){if(_0x94d8cf[_0x7427('0xa')]('-')===0x0){return[_0x94d8cf===_0x7427('0xb')?sequelize[_0x7427('0xc')](sequelize['col'](_0x7427('0xb')),_0x7427('0xd')):_0x94d8cf['substr'](0x1),_0x7427('0xe')];}else{return[_0x94d8cf==='priority'?sequelize['cast'](sequelize[_0x7427('0xf')]('priority'),_0x7427('0xd')):_0x94d8cf,_0x7427('0x10')];}});}return _0x5d76cd;};exports[_0x7427('0x11')]=function(_0xc22a5b,_0x166f5c){if(_['isEmpty'](_0xc22a5b)){return _0xc22a5b;}if(_[_0x7427('0x12')](_0xc22a5b)){for(var _0x3a166a=0x0;_0x3a166a<_0xc22a5b[_0x7427('0x13')];_0x3a166a+=0x1){_0xc22a5b[_0x3a166a]=this[_0x7427('0x11')](_0xc22a5b[_0x3a166a],_0x166f5c);}return _0xc22a5b;}if(!_[_0x7427('0x14')](_0xc22a5b)){return _0xc22a5b;}if(_[_0x7427('0x15')](_0x166f5c)){_0x166f5c=[_0x166f5c];}if(!_['isArray'](_0x166f5c)){return _0xc22a5b;}for(var _0x5e1c6f=0x0;_0x5e1c6f<_0x166f5c[_0x7427('0x13')];_0x5e1c6f+=0x1){_[_0x7427('0x16')](_0xc22a5b,_0x166f5c[_0x5e1c6f]);}for(var _0x3aaf5e in _0xc22a5b){if(_0xc22a5b[_0x7427('0x17')](_0x3aaf5e)){_0xc22a5b[_0x3aaf5e]=this[_0x7427('0x11')](_0xc22a5b[_0x3aaf5e],_0x166f5c);}}return _0xc22a5b;};exports[_0x7427('0x18')]=function(_0x2a2ba6){return _0x2a2ba6[_0x7427('0x19')](RegExp('^[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x2174c6){return _0x2174c6[_0x7427('0x19')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x1745bd){var _0x23409d=[];_0x1745bd['split']('\x20')['forEach'](function(_0x17eaa3){_0x23409d['push']('+'+_0x17eaa3[_0x7427('0x1a')]()+'*');});return _0x23409d['join']('\x20');}; \ No newline at end of file +var _0xf3c7=['priority','cast','unsigned','substr','DESC','col','ASC','omit','length','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','forEach','push','toString','join','sequelize','fields','split','filters','isEmpty','forOwn','isArray','parse','limit','offset','sort','map','indexOf'];(function(_0x2dfd28,_0x153b3c){var _0x49c016=function(_0x1cfb4d){while(--_0x1cfb4d){_0x2dfd28['push'](_0x2dfd28['shift']());}};_0x49c016(++_0x153b3c);}(_0xf3c7,0x113));var _0x7f3c=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0xf3c7[_0xdd827a];return _0x2f46f1;};'use strict';var _=require('lodash');var sequelize=require(_0x7f3c('0x0'));var LIMIT_VALUE=0xfa;exports[_0x7f3c('0x1')]=function(_0x2e3345){var _0x52c342=null;if(_0x2e3345){_0x52c342=_0x2e3345[_0x7f3c('0x2')](',');}return _0x52c342;};exports[_0x7f3c('0x3')]=function(_0x517b46){var _0x2a7365={};if(!_[_0x7f3c('0x4')](_0x517b46)){_0x2a7365={};_[_0x7f3c('0x5')](_0x517b46,function(_0x94fc2d,_0x5ea670){try{_0x2a7365[_0x5ea670]=_[_0x7f3c('0x6')](_0x94fc2d)?_0x94fc2d:JSON[_0x7f3c('0x7')](_0x94fc2d);}catch(_0x384764){_0x2a7365[_0x5ea670]=_0x94fc2d[_0x7f3c('0x2')](',');}});}return _0x2a7365;};exports[_0x7f3c('0x8')]=function(_0x11b53f){_0x11b53f=parseInt(_0x11b53f,0xa);if(!_0x11b53f||_0x11b53f<0x0){_0x11b53f=LIMIT_VALUE;}return _0x11b53f;};exports[_0x7f3c('0x9')]=function(_0x339200){_0x339200=parseInt(_0x339200,0xa);if(!_0x339200||_0x339200<0x0){_0x339200=0x0;}return _0x339200;};exports[_0x7f3c('0xa')]=function(_0x30b637){var _0x29fbb6,_0x3f0976=null;if(_0x30b637){_0x29fbb6=_0x30b637[_0x7f3c('0x2')](',');_0x3f0976=_[_0x7f3c('0xb')](_0x29fbb6,function(_0x857096){if(_0x857096[_0x7f3c('0xc')]('-')===0x0){return[_0x857096===_0x7f3c('0xd')?sequelize[_0x7f3c('0xe')](sequelize['col']('priority'),_0x7f3c('0xf')):_0x857096[_0x7f3c('0x10')](0x1),_0x7f3c('0x11')];}else{return[_0x857096==='priority'?sequelize['cast'](sequelize[_0x7f3c('0x12')](_0x7f3c('0xd')),'unsigned'):_0x857096,_0x7f3c('0x13')];}});}return _0x3f0976;};exports[_0x7f3c('0x14')]=function(_0x185111,_0x1cb9c0){if(_[_0x7f3c('0x4')](_0x185111)){return _0x185111;}if(_[_0x7f3c('0x6')](_0x185111)){for(var _0x20aeb4=0x0;_0x20aeb4<_0x185111[_0x7f3c('0x15')];_0x20aeb4+=0x1){_0x185111[_0x20aeb4]=this['omit'](_0x185111[_0x20aeb4],_0x1cb9c0);}return _0x185111;}if(!_['isObject'](_0x185111)){return _0x185111;}if(_['isString'](_0x1cb9c0)){_0x1cb9c0=[_0x1cb9c0];}if(!_[_0x7f3c('0x6')](_0x1cb9c0)){return _0x185111;}for(var _0x308f77=0x0;_0x308f77<_0x1cb9c0[_0x7f3c('0x15')];_0x308f77+=0x1){_['unset'](_0x185111,_0x1cb9c0[_0x308f77]);}for(var _0x1a53f1 in _0x185111){if(_0x185111[_0x7f3c('0x16')](_0x1a53f1)){_0x185111[_0x1a53f1]=this[_0x7f3c('0x14')](_0x185111[_0x1a53f1],_0x1cb9c0);}}return _0x185111;};exports[_0x7f3c('0x17')]=function(_0x4e05d6){return _0x4e05d6[_0x7f3c('0x18')](RegExp(_0x7f3c('0x19')))?!![]:![];};exports[_0x7f3c('0x1a')]=function(_0x147a99){return _0x147a99[_0x7f3c('0x18')](/^\S+@\S+$/)?!![]:![];};exports[_0x7f3c('0x1b')]=function(_0x21f951){var _0x599058=[];_0x21f951[_0x7f3c('0x2')]('\x20')[_0x7f3c('0x1c')](function(_0x4481f9){_0x599058[_0x7f3c('0x1d')]('+'+_0x4481f9[_0x7f3c('0x1e')]()+'*');});return _0x599058[_0x7f3c('0x1f')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 97f639e..64922fd 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe890=['production','set','appPath','development','test','join','client','use','json\x20replacer','split','static','views','root','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env'];(function(_0x272a88,_0x57e586){var _0x5c71c4=function(_0x8151b3){while(--_0x8151b3){_0x272a88['push'](_0x272a88['shift']());}};_0x5c71c4(++_0x57e586);}(_0xe890,0x119));var _0x0e89=function(_0x379f97,_0x225133){_0x379f97=_0x379f97-0x0;var _0x175144=_0xe890[_0x379f97];return _0x175144;};'use strict';var express=require(_0x0e89('0x0'));var favicon=require(_0x0e89('0x1'));var bodyParser=require(_0x0e89('0x2'));var methodOverride=require(_0x0e89('0x3'));var cookieParser=require(_0x0e89('0x4'));var errorHandler=require(_0x0e89('0x5'));var path=require(_0x0e89('0x6'));var passport=require(_0x0e89('0x7'));var cors=require(_0x0e89('0x8'));var moment=require(_0x0e89('0x9'));var config=require(_0x0e89('0xa'));var db=require(_0x0e89('0xb'))['db'];exports[_0x0e89('0xc')]=function(_0xf9fbae){var _0x3e8eec=_0xf9fbae[_0x0e89('0xd')](_0x0e89('0xe'));if(_0x3e8eec===_0x0e89('0xf')){_0xf9fbae[_0x0e89('0x10')](_0x0e89('0x11'),path['join'](config['root'],'public'));}if(_0x3e8eec===_0x0e89('0x12')||_0x3e8eec===_0x0e89('0x13')){_0xf9fbae['set'](_0x0e89('0x11'),path[_0x0e89('0x14')](config['root'],_0x0e89('0x15')));_0xf9fbae[_0x0e89('0x16')](errorHandler());}_0xf9fbae[_0x0e89('0x10')](_0x0e89('0x17'),function(_0x22d69f,_0x3ea0b0){if(this[_0x22d69f]instanceof Date){_0x3ea0b0=this[_0x22d69f]['toISOString']()[_0x0e89('0x18')]('.')[0x0]+'Z';}return _0x3ea0b0;});_0xf9fbae[_0x0e89('0x16')](express[_0x0e89('0x19')](_0xf9fbae[_0x0e89('0xd')](_0x0e89('0x11'))));_0xf9fbae[_0x0e89('0x10')](_0x0e89('0x1a'),config[_0x0e89('0x1b')]+'/server/views');_0xf9fbae[_0x0e89('0x1c')](_0x0e89('0x1d'),require(_0x0e89('0x1e'))[_0x0e89('0x1f')]);_0xf9fbae['set'](_0x0e89('0x20'),'html');_0xf9fbae[_0x0e89('0x16')](bodyParser[_0x0e89('0x21')]({'limit':'50mb','extended':!![]}));_0xf9fbae[_0x0e89('0x16')](bodyParser[_0x0e89('0x22')]({'limit':_0x0e89('0x23')}));_0xf9fbae[_0x0e89('0x16')](cors());_0xf9fbae[_0x0e89('0x16')](methodOverride());_0xf9fbae[_0x0e89('0x16')](cookieParser());_0xf9fbae[_0x0e89('0x16')](passport[_0x0e89('0x24')]());}; \ No newline at end of file +var _0xffab=['method-override','cookie-parser','errorhandler','passport','cors','./environment','../mysqldb','default','get','env','production','set','appPath','root','development','test','join','client','use','json\x20replacer','toISOString','split','static','views','/server/views','engine','html','ejs','view\x20engine','50mb','json','initialize','express','serve-favicon','body-parser'];(function(_0x479557,_0x354669){var _0x531642=function(_0xc541f0){while(--_0xc541f0){_0x479557['push'](_0x479557['shift']());}};_0x531642(++_0x354669);}(_0xffab,0x1c4));var _0xbffa=function(_0x440030,_0xaeec43){_0x440030=_0x440030-0x0;var _0x40d6b4=_0xffab[_0x440030];return _0x40d6b4;};'use strict';var express=require(_0xbffa('0x0'));var favicon=require(_0xbffa('0x1'));var bodyParser=require(_0xbffa('0x2'));var methodOverride=require(_0xbffa('0x3'));var cookieParser=require(_0xbffa('0x4'));var errorHandler=require(_0xbffa('0x5'));var path=require('path');var passport=require(_0xbffa('0x6'));var cors=require(_0xbffa('0x7'));var moment=require('moment');var config=require(_0xbffa('0x8'));var db=require(_0xbffa('0x9'))['db'];exports[_0xbffa('0xa')]=function(_0x1becc3){var _0x2ae1c4=_0x1becc3[_0xbffa('0xb')](_0xbffa('0xc'));if(_0x2ae1c4===_0xbffa('0xd')){_0x1becc3[_0xbffa('0xe')](_0xbffa('0xf'),path['join'](config[_0xbffa('0x10')],'public'));}if(_0x2ae1c4===_0xbffa('0x11')||_0x2ae1c4===_0xbffa('0x12')){_0x1becc3[_0xbffa('0xe')](_0xbffa('0xf'),path[_0xbffa('0x13')](config['root'],_0xbffa('0x14')));_0x1becc3[_0xbffa('0x15')](errorHandler());}_0x1becc3[_0xbffa('0xe')](_0xbffa('0x16'),function(_0x24e732,_0x33d23b){if(this[_0x24e732]instanceof Date){_0x33d23b=this[_0x24e732][_0xbffa('0x17')]()[_0xbffa('0x18')]('.')[0x0]+'Z';}return _0x33d23b;});_0x1becc3[_0xbffa('0x15')](express[_0xbffa('0x19')](_0x1becc3[_0xbffa('0xb')]('appPath')));_0x1becc3[_0xbffa('0xe')](_0xbffa('0x1a'),config[_0xbffa('0x10')]+_0xbffa('0x1b'));_0x1becc3[_0xbffa('0x1c')](_0xbffa('0x1d'),require(_0xbffa('0x1e'))['renderFile']);_0x1becc3[_0xbffa('0xe')](_0xbffa('0x1f'),'html');_0x1becc3[_0xbffa('0x15')](bodyParser['urlencoded']({'limit':_0xbffa('0x20'),'extended':!![]}));_0x1becc3['use'](bodyParser[_0xbffa('0x21')]({'limit':_0xbffa('0x20')}));_0x1becc3[_0xbffa('0x15')](cors());_0x1becc3[_0xbffa('0x15')](methodOverride());_0x1becc3[_0xbffa('0x15')](cookieParser());_0x1becc3[_0xbffa('0x15')](passport[_0xbffa('0x22')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 98453ce..ddb3820 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 _0xda19=['ipAddress','hex','substring','crypto','bimedia-machine-uuid','execSync','orderBy','keys','length','filter','family','IPv4','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5','digest','platform','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress'];(function(_0x1eb8d0,_0x3b24fe){var _0x20862d=function(_0x2e9782){while(--_0x2e9782){_0x1eb8d0['push'](_0x1eb8d0['shift']());}};_0x20862d(++_0x3b24fe);}(_0xda19,0xd5));var _0x9da1=function(_0x5adf08,_0x4528e1){_0x5adf08=_0x5adf08-0x0;var _0x1f721e=_0xda19[_0x5adf08];return _0x1f721e;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x9da1('0x0'));var machine=require(_0x9da1('0x1'));var exec=require('child_process')[_0x9da1('0x2')];function getInterfaces(){var _0x503770=[];var _0x435076=os['networkInterfaces']();var _0x2a77c7=_[_0x9da1('0x3')](_[_0x9da1('0x4')](_0x435076));for(var _0x470043=0x0;_0x470043<_0x2a77c7[_0x9da1('0x5')];_0x470043++){var _0x2dcbc6=_0x435076[_0x2a77c7[_0x470043]][_0x9da1('0x6')](function(_0x2c3cdd){return _0x2c3cdd[_0x9da1('0x7')]===_0x9da1('0x8')&&_0x2c3cdd['internal']===![];});_0x503770=_0x503770['concat'](_0x2dcbc6);}return _0x503770;}function getFirstInterface(){var _0x4cb9f7=_[_0x9da1('0x9')](getInterfaces());return{'macAddress':_0x4cb9f7&&_0x4cb9f7['mac']?_0x4cb9f7[_0x9da1('0xa')]:_0x9da1('0xb'),'ipAddress':_0x4cb9f7&&_0x4cb9f7[_0x9da1('0xc')]?_0x4cb9f7[_0x9da1('0xc')]:_0x9da1('0xd')};}exports[_0x9da1('0xe')]=getFirstInterface;function getCPUhash(){var _0x9fd032=_['orderBy'](os['cpus']()[_0x9da1('0xf')](function(_0x596b6b){return _0x596b6b[_0x9da1('0x10')];}))[_0x9da1('0x11')](':');return crypto[_0x9da1('0x12')](_0x9da1('0x13'))['update'](_0x9fd032)[_0x9da1('0x14')]('hex');}exports['getUuid']=function(){switch(os[_0x9da1('0x15')]()){case'win32':return exec(_0x9da1('0x16'),{'encoding':_0x9da1('0x17')})[_0x9da1('0x18')]('\x0d\x0a','');default:var _0x1a1a6b=getFirstInterface();var _0x7f1a64=getCPUhash();var _0x514d8e=_0x7f1a64+'|'+os[_0x9da1('0x19')]()+'|'+_0x1a1a6b[_0x9da1('0x1a')]+'|'+_0x1a1a6b[_0x9da1('0x1b')];var _0x77347a=crypto[_0x9da1('0x12')](_0x9da1('0x13'))['update'](_0x514d8e)['digest'](_0x9da1('0x1c'));return _0x77347a[_0x9da1('0x1d')](0x0,0x8)+'-'+_0x77347a[_0x9da1('0x1d')](0x8,0xc)+'-'+_0x77347a[_0x9da1('0x1d')](0xc,0x10)+'-'+_0x77347a[_0x9da1('0x1d')](0x10,0x14)+'-'+_0x77347a[_0x9da1('0x1d')](0x14);}}; \ No newline at end of file +var _0x81d4=['127.0.0.1','getFirstInterface','cpus','map','join','update','digest','hex','platform','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','crypto','bimedia-machine-uuid','execSync','orderBy','keys','filter','family','IPv4','internal','head','mac','00:00:00:00:00:00','address'];(function(_0x40cf6e,_0x31439b){var _0x5bf109=function(_0x4f2e25){while(--_0x4f2e25){_0x40cf6e['push'](_0x40cf6e['shift']());}};_0x5bf109(++_0x31439b);}(_0x81d4,0x197));var _0x481d=function(_0xadaff,_0x4c676e){_0xadaff=_0xadaff-0x0;var _0x2b69d0=_0x81d4[_0xadaff];return _0x2b69d0;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x481d('0x0'));var machine=require(_0x481d('0x1'));var exec=require('child_process')[_0x481d('0x2')];function getInterfaces(){var _0x369cf6=[];var _0x266766=os['networkInterfaces']();var _0x5af777=_[_0x481d('0x3')](_[_0x481d('0x4')](_0x266766));for(var _0x2ecf40=0x0;_0x2ecf40<_0x5af777['length'];_0x2ecf40++){var _0x1ef8ca=_0x266766[_0x5af777[_0x2ecf40]][_0x481d('0x5')](function(_0x2f91fd){return _0x2f91fd[_0x481d('0x6')]===_0x481d('0x7')&&_0x2f91fd[_0x481d('0x8')]===![];});_0x369cf6=_0x369cf6['concat'](_0x1ef8ca);}return _0x369cf6;}function getFirstInterface(){var _0x3b7273=_[_0x481d('0x9')](getInterfaces());return{'macAddress':_0x3b7273&&_0x3b7273[_0x481d('0xa')]?_0x3b7273['mac']:_0x481d('0xb'),'ipAddress':_0x3b7273&&_0x3b7273[_0x481d('0xc')]?_0x3b7273['address']:_0x481d('0xd')};}exports[_0x481d('0xe')]=getFirstInterface;function getCPUhash(){var _0x22f802=_[_0x481d('0x3')](os[_0x481d('0xf')]()[_0x481d('0x10')](function(_0x9c7a08){return _0x9c7a08['model'];}))[_0x481d('0x11')](':');return crypto['createHash']('md5')[_0x481d('0x12')](_0x22f802)[_0x481d('0x13')](_0x481d('0x14'));}exports['getUuid']=function(){switch(os[_0x481d('0x15')]()){case'win32':return exec(_0x481d('0x16'),{'encoding':_0x481d('0x17')})[_0x481d('0x18')]('\x0d\x0a','');default:var _0x1bda12=getFirstInterface();var _0x879e29=getCPUhash();var _0x59c5d5=_0x879e29+'|'+os[_0x481d('0x19')]()+'|'+_0x1bda12[_0x481d('0x1a')]+'|'+_0x1bda12[_0x481d('0x1b')];var _0x4f399b=crypto[_0x481d('0x1c')]('md5')[_0x481d('0x12')](_0x59c5d5)['digest'](_0x481d('0x14'));return _0x4f399b['substring'](0x0,0x8)+'-'+_0x4f399b[_0x481d('0x1d')](0x8,0xc)+'-'+_0x4f399b['substring'](0xc,0x10)+'-'+_0x4f399b[_0x481d('0x1d')](0x10,0x14)+'-'+_0x4f399b['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 765c1d3..4e03459 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 _0x5464=['diff','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','default','util','crypto','moment','bluebird','version','../environment','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','aes-256-ctr','final','createDecipher','secrets','session','update','base64','utf8','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','then','|reason|','|uuid|','|name|','|email|','getFirstInterface','ipAddress','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm'];(function(_0x1eb585,_0x202476){var _0x497ee2=function(_0x36dffa){while(--_0x36dffa){_0x1eb585['push'](_0x1eb585['shift']());}};_0x497ee2(++_0x202476);}(_0x5464,0x15d));var _0x4546=function(_0x4029ce,_0xfc06c6){_0x4029ce=_0x4029ce-0x0;var _0xd7a72b=_0x5464[_0x4029ce];return _0xd7a72b;};'use strict';var util=require(_0x4546('0x0'));var crypto=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var rp=require('request-promise');var BPromise=require(_0x4546('0x3'));var pkginfo=require('pkginfo')(module,_0x4546('0x4'));var db=require('../../mysqldb')['db'];var config=require(_0x4546('0x5'));var hardware=require(_0x4546('0x6'));var logger=require(_0x4546('0x7'))(_0x4546('0x8'));var jira=require('../../api/jira/jira.controller');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x5c5e09){return new BPromise(function(_0x224c7c,_0x36c875){var _0x1a76c1=util[_0x4546('0x9')](_0x4546('0xa'),HOST,_0x5c5e09,module[_0x4546('0xb')][_0x4546('0x4')]);if(oldToken){_0x1a76c1=util[_0x4546('0x9')](_0x4546('0xc'),HOST,_0x5c5e09,module['exports'][_0x4546('0x4')],oldToken);}var _0x8a15e2={'uri':_0x1a76c1,'method':_0x4546('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x8a15e2)['then'](function(_0x1f82c9){_0x224c7c(_0x1f82c9);})[_0x4546('0xe')](function(_0x23818b){_0x36c875(_0x23818b);});});}function encryptDate(_0x394c0b){var _0x4d31a7=crypto['createCipher'](_0x4546('0xf'),config['secrets']['session']);var _0x4bb236=_0x4d31a7['update'](_0x394c0b,'utf8','base64');_0x4bb236+=_0x4d31a7[_0x4546('0x10')]('base64');return _0x4bb236;}function decryptDate(_0x363a17){var _0x54581c=crypto[_0x4546('0x11')]('aes-256-ctr',config[_0x4546('0x12')][_0x4546('0x13')]);var _0x24b32a=_0x54581c[_0x4546('0x14')](_0x363a17,_0x4546('0x15'),_0x4546('0x16'));_0x24b32a+=_0x54581c['final']('utf8');return _0x24b32a;}function sendJiraAlert(_0x5780a7,_0x330235,_0x39f552){var _0x29e3bb=_0x4546('0x17');return db[_0x4546('0x18')][_0x4546('0x19')]({'where':{'role':_0x4546('0x1a')},'attributes':[_0x4546('0x1b'),_0x4546('0x1c')],'raw':!![]})[_0x4546('0x1d')](function(_0x57d740){ADMIN=_0x57d740;_0x29e3bb+=_0x4546('0x1e')+_0x39f552+'|\x0a';_0x29e3bb+=_0x4546('0x1f')+_0x5780a7+'|\x0a';_0x29e3bb+='|machineUuid|'+_0x330235+'|\x0a';_0x29e3bb+=_0x4546('0x20')+ADMIN[_0x4546('0x1b')]+'|\x0a';_0x29e3bb+=_0x4546('0x21')+ADMIN[_0x4546('0x1c')]+'|\x0a';return _0x29e3bb;})[_0x4546('0x1d')](function(_0x15b013){var _0x53e402=hardware[_0x4546('0x22')]()[_0x4546('0x23')];return jira['openIssue']({'key':_0x4546('0x24'),'summary':_0x4546('0x25'),'description':_0x15b013,'issuetype':_0x4546('0x26'),'oldToken':_0x5780a7,'newToken':_0x330235,'email':ADMIN[_0x4546('0x1c')],'name':ADMIN[_0x4546('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x53e402});});}function manageLicense(_0x53ae5e,_0x49dc98){var _0x3796fe=_0x49dc98[_0x4546('0x27')]({'plain':!![]});httpRequest(_0x53ae5e)['then'](function(_0x4c1dad){if(oldToken){oldToken=undefined;}if(_0x4c1dad[_0x4546('0x28')]){if(!_0x3796fe[_0x4546('0x8')]&&_0x3796fe[_0x4546('0x8')]!=_0x4c1dad[_0x4546('0x8')]||_0x3796fe[_0x4546('0x8')]&&_0x3796fe[_0x4546('0x29')]){logger[_0x4546('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x3796fe[_0x4546('0x8')]&&!_0x3796fe['data2']&&_0x3796fe[_0x4546('0x8')]!=_0x4c1dad[_0x4546('0x8')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x3796fe[_0x4546('0x8')]&&!_0x3796fe['data2']&&_0x3796fe[_0x4546('0x8')]==_0x4c1dad[_0x4546('0x8')]){return _0x49dc98;}return _0x49dc98['update']({'data1':_0x53ae5e,'data2':null,'license':_0x4c1dad['license']});}else{if(_0x4c1dad[_0x4546('0x8')]||_0x3796fe[_0x4546('0x8')]){if(!_0x3796fe[_0x4546('0x29')]){if(_0x3796fe['data1']==_0x53ae5e){GRAY_PERIOD_REASON=_0x4546('0x2b');logger[_0x4546('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x4546('0x2c');oldToken=_0x3796fe['data1'];logger[_0x4546('0x2a')](_0x4546('0x2d'),_0x3796fe[_0x4546('0x2e')],_0x53ae5e);}sendJiraAlert(_0x3796fe[_0x4546('0x2e')],_0x4c1dad['uuid'],GRAY_PERIOD_REASON);logger[_0x4546('0x2a')](_0x4546('0x2f'),GRAY_PERIOD_REASON[_0x4546('0x30')](),moment()[_0x4546('0x9')](_0x4546('0x31')));return _0x49dc98[_0x4546('0x14')]({'data2':encryptDate(moment()['format'](_0x4546('0x31')))});}else{if(moment()[_0x4546('0x32')](decryptDate(_0x3796fe['data2']),'days')>DAYS){logger[_0x4546('0x2a')](_0x4546('0x33'),moment()['format'](_0x4546('0x31')));return _0x49dc98[_0x4546('0x14')]({'data1':_0x53ae5e,'data2':null,'license':null});}}}else{if(_0x3796fe['data1']!=_0x53ae5e){logger['info'](_0x4546('0x2d'),_0x3796fe[_0x4546('0x2e')],_0x53ae5e);return _0x49dc98[_0x4546('0x14')]({'data1':_0x53ae5e,'data2':null,'license':null});}}}return _0x49dc98;})[_0x4546('0x1d')](function(_0x39f770){_0x49dc98=_0x39f770;})[_0x4546('0xe')](function(_0x4ddc9e){logger[_0x4546('0x34')](_0x4ddc9e[_0x4546('0x35')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x4546('0x36')](),_0x49dc98);},TIME);});}function defaultLicense(){var _0x5c5301=hardware[_0x4546('0x36')]();if(_0x5c5301){return db[_0x4546('0x37')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x5c5301}})['spread'](function(_0x104d56,_0x453593){logger[_0x4546('0x2a')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x5c5301);manageLicense(_0x5c5301,_0x104d56);})[_0x4546('0xe')](function(_0x3f7ddb){logger[_0x4546('0x34')](_0x3f7ddb[_0x4546('0x35')]);});}}exports[_0x4546('0x38')]=defaultLicense; \ No newline at end of file +var _0x3419=['error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','crypto','moment','request-promise','bluebird','version','../../mysqldb','../environment','./hardware','../logger','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','then','catch','aes-256-ctr','update','base64','final','createDecipher','secrets','session','utf8','||FIELD||VALUE||\x0a','admin','fullname','email','|name|','ipAddress','Motion\x20License\x20Alert','Alert','get','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3419,0xb3));var _0x9341=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0x3419[_0x3ab353];return _0x1e2285;};'use strict';var util=require(_0x9341('0x0'));var crypto=require(_0x9341('0x1'));var moment=require(_0x9341('0x2'));var rp=require(_0x9341('0x3'));var BPromise=require(_0x9341('0x4'));var pkginfo=require('pkginfo')(module,_0x9341('0x5'));var db=require(_0x9341('0x6'))['db'];var config=require(_0x9341('0x7'));var hardware=require(_0x9341('0x8'));var logger=require(_0x9341('0x9'))('license');var jira=require(_0x9341('0xa'));var HOST=_0x9341('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x5e3e79){return new BPromise(function(_0x2efc5a,_0x1c30cf){var _0x188d3b=util[_0x9341('0xc')](_0x9341('0xd'),HOST,_0x5e3e79,module[_0x9341('0xe')]['version']);if(oldToken){_0x188d3b=util[_0x9341('0xc')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x5e3e79,module[_0x9341('0xe')][_0x9341('0x5')],oldToken);}var _0x265e7e={'uri':_0x188d3b,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x265e7e)[_0x9341('0xf')](function(_0x4db89c){_0x2efc5a(_0x4db89c);})[_0x9341('0x10')](function(_0x2df75a){_0x1c30cf(_0x2df75a);});});}function encryptDate(_0xa841b9){var _0x277ddb=crypto['createCipher'](_0x9341('0x11'),config['secrets']['session']);var _0x1801c9=_0x277ddb[_0x9341('0x12')](_0xa841b9,'utf8',_0x9341('0x13'));_0x1801c9+=_0x277ddb[_0x9341('0x14')]('base64');return _0x1801c9;}function decryptDate(_0xe4a706){var _0x451ba7=crypto[_0x9341('0x15')]('aes-256-ctr',config[_0x9341('0x16')][_0x9341('0x17')]);var _0x256b0f=_0x451ba7[_0x9341('0x12')](_0xe4a706,_0x9341('0x13'),_0x9341('0x18'));_0x256b0f+=_0x451ba7[_0x9341('0x14')](_0x9341('0x18'));return _0x256b0f;}function sendJiraAlert(_0x25288c,_0x57ed13,_0x597459){var _0x5ba251=_0x9341('0x19');return db['User']['findOne']({'where':{'role':_0x9341('0x1a')},'attributes':[_0x9341('0x1b'),_0x9341('0x1c')],'raw':!![]})['then'](function(_0x5a615f){ADMIN=_0x5a615f;_0x5ba251+='|reason|'+_0x597459+'|\x0a';_0x5ba251+='|uuid|'+_0x25288c+'|\x0a';_0x5ba251+='|machineUuid|'+_0x57ed13+'|\x0a';_0x5ba251+=_0x9341('0x1d')+ADMIN['fullname']+'|\x0a';_0x5ba251+='|email|'+ADMIN['email']+'|\x0a';return _0x5ba251;})[_0x9341('0xf')](function(_0x2501d6){var _0x56bb59=hardware['getFirstInterface']()[_0x9341('0x1e')];return jira['openIssue']({'key':'MOTLICENSE','summary':_0x9341('0x1f'),'description':_0x2501d6,'issuetype':_0x9341('0x20'),'oldToken':_0x25288c,'newToken':_0x57ed13,'email':ADMIN['email'],'name':ADMIN[_0x9341('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x56bb59});});}function manageLicense(_0x3761a1,_0x35b6d5){var _0x557d48=_0x35b6d5[_0x9341('0x21')]({'plain':!![]});httpRequest(_0x3761a1)[_0x9341('0xf')](function(_0x4698b3){if(oldToken){oldToken=undefined;}if(_0x4698b3['active']){if(!_0x557d48[_0x9341('0x22')]&&_0x557d48[_0x9341('0x22')]!=_0x4698b3['license']||_0x557d48[_0x9341('0x22')]&&_0x557d48[_0x9341('0x23')]){logger[_0x9341('0x24')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x557d48['license']&&!_0x557d48[_0x9341('0x23')]&&_0x557d48[_0x9341('0x22')]!=_0x4698b3[_0x9341('0x22')]){logger[_0x9341('0x24')](_0x9341('0x25'));}if(_0x557d48['license']&&!_0x557d48['data2']&&_0x557d48[_0x9341('0x22')]==_0x4698b3[_0x9341('0x22')]){return _0x35b6d5;}return _0x35b6d5[_0x9341('0x12')]({'data1':_0x3761a1,'data2':null,'license':_0x4698b3[_0x9341('0x22')]});}else{if(_0x4698b3[_0x9341('0x22')]||_0x557d48[_0x9341('0x22')]){if(!_0x557d48[_0x9341('0x23')]){if(_0x557d48[_0x9341('0x26')]==_0x3761a1){GRAY_PERIOD_REASON=_0x9341('0x27');logger[_0x9341('0x24')](_0x9341('0x28'));}else{GRAY_PERIOD_REASON=_0x9341('0x29');oldToken=_0x557d48[_0x9341('0x26')];logger[_0x9341('0x24')](_0x9341('0x2a'),_0x557d48[_0x9341('0x26')],_0x3761a1);}sendJiraAlert(_0x557d48['data1'],_0x4698b3[_0x9341('0x2b')],GRAY_PERIOD_REASON);logger[_0x9341('0x24')](_0x9341('0x2c'),GRAY_PERIOD_REASON[_0x9341('0x2d')](),moment()['format'](_0x9341('0x2e')));return _0x35b6d5[_0x9341('0x12')]({'data2':encryptDate(moment()[_0x9341('0xc')](_0x9341('0x2e')))});}else{if(moment()['diff'](decryptDate(_0x557d48[_0x9341('0x23')]),_0x9341('0x2f'))>DAYS){logger[_0x9341('0x24')](_0x9341('0x30'),moment()['format'](_0x9341('0x2e')));return _0x35b6d5[_0x9341('0x12')]({'data1':_0x3761a1,'data2':null,'license':null});}}}else{if(_0x557d48[_0x9341('0x26')]!=_0x3761a1){logger['info'](_0x9341('0x2a'),_0x557d48[_0x9341('0x26')],_0x3761a1);return _0x35b6d5[_0x9341('0x12')]({'data1':_0x3761a1,'data2':null,'license':null});}}}return _0x35b6d5;})[_0x9341('0xf')](function(_0x39853f){_0x35b6d5=_0x39853f;})[_0x9341('0x10')](function(_0x438709){logger[_0x9341('0x31')](_0x438709[_0x9341('0x32')]);})[_0x9341('0x33')](function(){setTimeout(function(){manageLicense(hardware[_0x9341('0x34')](),_0x35b6d5);},TIME);});}function defaultLicense(){var _0x4513e1=hardware[_0x9341('0x34')]();if(_0x4513e1){return db[_0x9341('0x35')][_0x9341('0x36')]({'where':{'id':0x1},'defaults':{'data1':_0x4513e1}})[_0x9341('0x37')](function(_0x64773b,_0x253e01){logger[_0x9341('0x24')](_0x9341('0x38'),_0x4513e1);manageLicense(_0x4513e1,_0x64773b);})['catch'](function(_0x54b0bd){logger[_0x9341('0x31')](_0x54b0bd[_0x9341('0x32')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 1babaa0..5f0b4d5 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 _0x954a=['../environment','license','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','uuid','machineUuid','getUuid','secrets','session','gray','deadline','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','License','find','defaults','then','checkLicense','crypto','util','moment','./hardware'];(function(_0x224b25,_0x433c9d){var _0x7fd14c=function(_0x5ceb89){while(--_0x5ceb89){_0x224b25['push'](_0x224b25['shift']());}};_0x7fd14c(++_0x433c9d);}(_0x954a,0x1d0));var _0xa954=function(_0x35610f,_0x30dc0f){_0x35610f=_0x35610f-0x0;var _0x11ef6f=_0x954a[_0x35610f];return _0x11ef6f;};'use strict';var crypto=require(_0xa954('0x0'));var util=require(_0xa954('0x1'));var _=require('lodash');var moment=require(_0xa954('0x2'));var hardware=require(_0xa954('0x3'));var config=require(_0xa954('0x4'));var db=require('../../mysqldb')['db'];function checkLicense(_0x23a2f9,_0x422471){if(_0x23a2f9){try{var _0xf3d0c6=_0x422471||_0x23a2f9[_0xa954('0x5')];if(_['isEmpty'](_0xf3d0c6)){throw new Error(_0xa954('0x6'));}var _0x2074a0=_0x23a2f9[_0xa954('0x7')];var _0xa193df=_0x23a2f9['data2'];var _0x4e481e=_0x2074a0['split']('-')[0x4];var _0x4442bb=_0x2074a0[_0xa954('0x8')]('-')[0x0];var _0x374d3b=crypto[_0xa954('0x9')](_0xa954('0xa'),util[_0xa954('0xb')](_0xa954('0xc'),_0x4e481e,_0x2074a0,_0x4442bb));var _0x3bc5b2=_0x374d3b[_0xa954('0xd')](_0xf3d0c6,_0xa954('0xe'),_0xa954('0xf'));_0x3bc5b2+=_0x374d3b[_0xa954('0x10')](_0xa954('0xf'));var _0x36c818=JSON[_0xa954('0x11')](_0x3bc5b2);_0x36c818['demo']=![];_0x36c818[_0xa954('0x12')]=_0x2074a0;_0x36c818[_0xa954('0x13')]=hardware[_0xa954('0x14')]();if(_0xa193df){var _0x386b90=crypto[_0xa954('0x9')](_0xa954('0xa'),config[_0xa954('0x15')][_0xa954('0x16')]);var _0x2e004d=_0x386b90['update'](_0xa193df,_0xa954('0xe'),'utf8');_0x2e004d+=_0x386b90['final'](_0xa954('0xf'));_0x36c818[_0xa954('0x17')]=_0x2e004d;_0x36c818[_0xa954('0x18')]=moment(_0x2e004d)[_0xa954('0x19')](0x7,_0xa954('0x1a'))[_0xa954('0xb')]();_0x36c818[_0xa954('0x1b')]=_0x36c818['uuid']!=_0x36c818['machineUuid']?_0xa954('0x1c'):_0xa954('0x1d');}return _0x36c818;}catch(_0x5c23e4){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa954('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xa954('0x1f'),'uuid':_0x23a2f9[_0xa954('0x7')],'machineUuid':hardware['getUuid'](),'message':_0x5c23e4[_0xa954('0x20')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa954('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xa954('0x21'),'uuid':_0x23a2f9[_0xa954('0x7')],'machineUuid':hardware[_0xa954('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x135e3e){return db[_0xa954('0x22')][_0xa954('0x23')](_[_0xa954('0x24')](_0x135e3e,{'raw':!![],'where':{'id':0x1}}))[_0xa954('0x25')](function(_0xf4b809){return checkLicense(_0xf4b809,null);});};exports[_0xa954('0x26')]=checkLicense; \ No newline at end of file +var _0xeadc=['gray','deadline','disabled','2027-01-01T00:00:00.000Z','message','Demo\x20license','License','then','checkLicense','crypto','util','lodash','moment','./hardware','../environment','../../mysqldb','license','data1','data2','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','uuid','machineUuid','getUuid','aes-256-ctr','secrets'];(function(_0x3487c8,_0x440d8f){var _0x423d3e=function(_0x17302b){while(--_0x17302b){_0x3487c8['push'](_0x3487c8['shift']());}};_0x423d3e(++_0x440d8f);}(_0xeadc,0x149));var _0xcead=function(_0x90f406,_0x39beb6){_0x90f406=_0x90f406-0x0;var _0x54f205=_0xeadc[_0x90f406];return _0x54f205;};'use strict';var crypto=require(_0xcead('0x0'));var util=require(_0xcead('0x1'));var _=require(_0xcead('0x2'));var moment=require(_0xcead('0x3'));var hardware=require(_0xcead('0x4'));var config=require(_0xcead('0x5'));var db=require(_0xcead('0x6'))['db'];function checkLicense(_0x387d3c,_0x1f373f){if(_0x387d3c){try{var _0x9e08a1=_0x1f373f||_0x387d3c[_0xcead('0x7')];if(_['isEmpty'](_0x9e08a1)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x29b15f=_0x387d3c[_0xcead('0x8')];var _0x3d9eea=_0x387d3c[_0xcead('0x9')];var _0x14a069=_0x29b15f[_0xcead('0xa')]('-')[0x4];var _0x5e25dc=_0x29b15f['split']('-')[0x0];var _0x3d324d=crypto[_0xcead('0xb')]('aes-256-ctr',util[_0xcead('0xc')](_0xcead('0xd'),_0x14a069,_0x29b15f,_0x5e25dc));var _0x54df78=_0x3d324d[_0xcead('0xe')](_0x9e08a1,_0xcead('0xf'),_0xcead('0x10'));_0x54df78+=_0x3d324d[_0xcead('0x11')]('utf8');var _0x49ccbc=JSON['parse'](_0x54df78);_0x49ccbc['demo']=![];_0x49ccbc[_0xcead('0x12')]=_0x29b15f;_0x49ccbc[_0xcead('0x13')]=hardware[_0xcead('0x14')]();if(_0x3d9eea){var _0xc38eec=crypto[_0xcead('0xb')](_0xcead('0x15'),config[_0xcead('0x16')]['session']);var _0x127627=_0xc38eec[_0xcead('0xe')](_0x3d9eea,_0xcead('0xf'),_0xcead('0x10'));_0x127627+=_0xc38eec['final']('utf8');_0x49ccbc[_0xcead('0x17')]=_0x127627;_0x49ccbc[_0xcead('0x18')]=moment(_0x127627)['add'](0x7,'days')[_0xcead('0xc')]();_0x49ccbc['grayReason']=_0x49ccbc['uuid']!=_0x49ccbc[_0xcead('0x13')]?'changed':_0xcead('0x19');}return _0x49ccbc;}catch(_0x1d0b41){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xcead('0x1a'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x387d3c[_0xcead('0x8')],'machineUuid':hardware[_0xcead('0x14')](),'message':_0x1d0b41[_0xcead('0x1b')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xcead('0x1a'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xcead('0x1c'),'uuid':_0x387d3c[_0xcead('0x8')],'machineUuid':hardware[_0xcead('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x3e3e13){return db[_0xcead('0x1d')]['find'](_['defaults'](_0x3e3e13,{'raw':!![],'where':{'id':0x1}}))[_0xcead('0x1e')](function(_0x177288){return checkLicense(_0x177288,null);});};exports[_0xcead('0x1f')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 80fd94c..7dc882e 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 _0x282b=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x237a3c,_0x236ba8){var _0x379ea0=function(_0x13a174){while(--_0x13a174){_0x237a3c['push'](_0x237a3c['shift']());}};_0x379ea0(++_0x236ba8);}(_0x282b,0xec));var _0xb282=function(_0x449d1d,_0x49e15a){_0x449d1d=_0x449d1d-0x0;var _0x49be98=_0x282b[_0x449d1d];return _0x49be98;};'use strict';module[_0xb282('0x0')]={'DOMAIN':_0xb282('0x1'),'SESSION_SECRET':_0xb282('0x2'),'GOOGLE_ID':_0xb282('0x3'),'GOOGLE_SECRET':_0xb282('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x0fda=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x0fda,0x64));var _0xa0fd=function(_0x30ec1b,_0x2de912){_0x30ec1b=_0x30ec1b-0x0;var _0x4022e3=_0x0fda[_0x30ec1b];return _0x4022e3;};'use strict';module[_0xa0fd('0x0')]={'DOMAIN':_0xa0fd('0x1'),'SESSION_SECRET':_0xa0fd('0x2'),'GOOGLE_ID':_0xa0fd('0x3'),'GOOGLE_SECRET':_0xa0fd('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index f365d00..bda48a3 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9988=['util','path','INFO','join','/var','log','xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','Logger','transports','error','File','%s-%s','info','Console','env','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9988,0xfb));var _0x8998=function(_0xf8053,_0x4b5401){_0xf8053=_0xf8053-0x0;var _0x2fe82f=_0x9988[_0xf8053];return _0x2fe82f;};'use strict';var moment=require(_0x8998('0x0'));var winston=require('winston');var util=require(_0x8998('0x1'));var path=require(_0x8998('0x2'));var debugLevel=_0x8998('0x3');function filename(_0x1fc6ab,_0x10cc6b){return path[_0x8998('0x4')](_0x8998('0x5'),_0x8998('0x6'),_0x8998('0x7'),util['format']('%s-%s.log',_0x1fc6ab,_0x10cc6b));}function formatter(_0x28356e,_0x171bfd){return util[_0x8998('0x8')](_0x8998('0x9'),moment()[_0x8998('0x8')](_0x8998('0xa')),_0x171bfd[_0x8998('0xb')][_0x8998('0xc')](),_0x28356e,_0x171bfd['message']);}module['exports']=function(_0x2b568c){return new winston[(_0x8998('0xd'))]({'transports':[new winston[(_0x8998('0xe'))]['File']({'name':util[_0x8998('0x8')]('%s-%s',_0x2b568c,_0x8998('0xf')),'filename':filename(_0x2b568c,_0x8998('0xf')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c096f){return formatter(_0x2b568c,_0x1c096f);}}),new winston['transports'][(_0x8998('0x10'))]({'name':util[_0x8998('0x8')](_0x8998('0x11'),_0x2b568c,_0x8998('0x12')),'filename':filename(_0x2b568c,_0x8998('0x12')),'level':_0x8998('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x592397){return formatter(_0x2b568c,_0x592397);}}),new winston['transports'][(_0x8998('0x13'))]({'level':process[_0x8998('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x1c76fa){return formatter(_0x2b568c,_0x1c76fa);}})]});}; \ No newline at end of file +var _0x7705=['INFO','join','log','%s-%s.log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','message','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util'];(function(_0x5c8beb,_0x190d77){var _0x259cac=function(_0x12cc19){while(--_0x12cc19){_0x5c8beb['push'](_0x5c8beb['shift']());}};_0x259cac(++_0x190d77);}(_0x7705,0x7b));var _0x5770=function(_0x9e3edc,_0x594d61){_0x9e3edc=_0x9e3edc-0x0;var _0x44a387=_0x7705[_0x9e3edc];return _0x44a387;};'use strict';var moment=require(_0x5770('0x0'));var winston=require(_0x5770('0x1'));var util=require(_0x5770('0x2'));var path=require('path');var debugLevel=_0x5770('0x3');function filename(_0x389f0f,_0x5307fa){return path[_0x5770('0x4')]('/var',_0x5770('0x5'),'xcally',util['format'](_0x5770('0x6'),_0x389f0f,_0x5307fa));}function formatter(_0x230080,_0x56f307){return util[_0x5770('0x7')](_0x5770('0x8'),moment()['format'](_0x5770('0x9')),_0x56f307[_0x5770('0xa')]['toUpperCase'](),_0x230080,_0x56f307[_0x5770('0xb')]);}module['exports']=function(_0x12f092){return new winston[(_0x5770('0xc'))]({'transports':[new winston[(_0x5770('0xd'))][(_0x5770('0xe'))]({'name':util[_0x5770('0x7')](_0x5770('0xf'),_0x12f092,_0x5770('0x10')),'filename':filename(_0x12f092,_0x5770('0x10')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x542689){return formatter(_0x12f092,_0x542689);}}),new winston[(_0x5770('0xd'))]['File']({'name':util[_0x5770('0x7')](_0x5770('0xf'),_0x12f092,_0x5770('0x11')),'filename':filename(_0x12f092,_0x5770('0x11')),'level':_0x5770('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xe4d379){return formatter(_0x12f092,_0xe4d379);}}),new winston[(_0x5770('0xd'))][(_0x5770('0x12'))]({'level':process[_0x5770('0x13')][_0x5770('0x14')]||debugLevel,'json':![],'formatter':function(_0x5337a5){return formatter(_0x12f092,_0x5337a5);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4511a45..05149c5 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 _0x8a25=['../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join'];(function(_0x3c34d3,_0x1b34b6){var _0xdd9e1e=function(_0x2d188f){while(--_0x2d188f){_0x3c34d3['push'](_0x3c34d3['shift']());}};_0xdd9e1e(++_0x1b34b6);}(_0x8a25,0x1aa));var _0x58a2=function(_0x2da34d,_0x16b71b){_0x2da34d=_0x2da34d-0x0;var _0x534ed3=_0x8a25[_0x2da34d];return _0x534ed3;};'use strict';var path=require(_0x58a2('0x0'));var os=require('os');var config={'apps':[{'name':_0x58a2('0x1'),'script':path[_0x58a2('0x2')](__dirname,_0x58a2('0x3'))},{'name':'ami','script':path[_0x58a2('0x2')](__dirname,_0x58a2('0x4'))},{'name':_0x58a2('0x5'),'script':path[_0x58a2('0x2')](__dirname,_0x58a2('0x6'))},{'name':_0x58a2('0x7'),'script':path[_0x58a2('0x2')](__dirname,_0x58a2('0x8'))},{'name':_0x58a2('0x9'),'script':path[_0x58a2('0x2')](__dirname,_0x58a2('0xa'))},{'name':_0x58a2('0xb'),'script':path[_0x58a2('0x2')](__dirname,_0x58a2('0xc'))}]};module['exports']=config; \ No newline at end of file +var _0x45c9=['../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','express','../../services/express/index.js','ami','join','../../services/ami/index.js','agi'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x45c9,0x96));var _0x945c=function(_0x3f0fae,_0x1d3791){_0x3f0fae=_0x3f0fae-0x0;var _0xb35bde=_0x45c9[_0x3f0fae];return _0xb35bde;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x945c('0x0'),'script':path['join'](__dirname,_0x945c('0x1'))},{'name':_0x945c('0x2'),'script':path[_0x945c('0x3')](__dirname,_0x945c('0x4'))},{'name':_0x945c('0x5'),'script':path['join'](__dirname,_0x945c('0x6'))},{'name':'email','script':path[_0x945c('0x3')](__dirname,_0x945c('0x7'))},{'name':_0x945c('0x8'),'script':path[_0x945c('0x3')](__dirname,_0x945c('0x9'))},{'name':_0x945c('0xa'),'script':path[_0x945c('0x3')](__dirname,'../../services/xdr/index.js')}]};module[_0x945c('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 2d4320e..46d6bae 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 _0xd347=['disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connected','start','then'];(function(_0x13392e,_0x30783){var _0x17e182=function(_0x240b11){while(--_0x240b11){_0x13392e['push'](_0x13392e['shift']());}};_0x17e182(++_0x30783);}(_0xd347,0x182));var _0x7d34=function(_0x56b4e9,_0x3594a2){_0x56b4e9=_0x56b4e9-0x0;var _0x26faec=_0xd347[_0x56b4e9];return _0x26faec;};'use strict';var pm2=require(_0x7d34('0x0'));var BPromise=require(_0x7d34('0x1'));var config=require(_0x7d34('0x2'));function connect(){return new BPromise(function(_0x487f7d,_0x418ddf){return pm2['connect'](function(_0x53fcff){if(_0x53fcff){return _0x418ddf(_0x53fcff);}return _0x487f7d(_0x7d34('0x3'));});});};exports[_0x7d34('0x4')]=function(_0x42d530){return connect()[_0x7d34('0x5')](function(){return new BPromise(function(_0xccf341,_0x11ca81){return pm2[_0x7d34('0x4')](_0x42d530,function(_0x37669b,_0x41f301){if(_0x37669b){return _0x11ca81(_0x37669b);}pm2[_0x7d34('0x6')]();return _0xccf341(_0x41f301);});});});};exports[_0x7d34('0x7')]=function(_0x4c93e3){return connect()[_0x7d34('0x5')](function(){return new BPromise(function(_0x300188,_0x3e4036){return pm2['stop'](_0x4c93e3,function(_0x266182,_0x117987){if(_0x266182){return _0x3e4036(_0x266182);}pm2[_0x7d34('0x6')]();return _0x300188(_0x117987);});});});};exports[_0x7d34('0x8')]=function(_0xe8a030){return connect()[_0x7d34('0x5')](function(){return new BPromise(function(_0x5e2f23,_0x4dacea){return pm2[_0x7d34('0x8')](_0xe8a030,function(_0x57cad8,_0x1f73f9){if(_0x57cad8){return _0x4dacea(_0x57cad8);}pm2[_0x7d34('0x6')]();return _0x5e2f23(_0x1f73f9);});});});};exports[_0x7d34('0x9')]=function(){return connect()[_0x7d34('0x5')](function(){return new BPromise(function(_0xb09d30,_0x2a55ad){return pm2['list'](function(_0xcce889,_0x5acdc4){if(_0xcce889){return _0x2a55ad(_0xcce889);}pm2[_0x7d34('0x6')]();return _0xb09d30(_0x5acdc4);});});});};exports[_0x7d34('0xa')]=function(_0x5bca19){return connect()[_0x7d34('0x5')](function(){return new BPromise(function(_0xa974ff,_0x5636b6){return pm2[_0x7d34('0xa')](_0x5bca19,function(_0x5c5905,_0x220d38){if(_0x5c5905){return _0x5636b6(_0x5c5905);}pm2[_0x7d34('0x6')]();return _0xa974ff(_0x220d38);});});});};exports[_0x7d34('0xb')]=function(_0x4bcf9b){return connect()[_0x7d34('0x5')](function(){return new BPromise(function(_0x108319,_0x2ee966){return pm2[_0x7d34('0xb')](_0x4bcf9b,function(_0x43b30b,_0x3abdfd){if(_0x43b30b){return _0x2ee966(_0x43b30b);}pm2['disconnect']();return _0x108319(_0x3abdfd);});});});};exports[_0x7d34('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x448ab8,_0x287b6d){return pm2[_0x7d34('0xc')](function(_0x55c2f8){if(_0x55c2f8){return _0x287b6d(_0x55c2f8);}return _0x448ab8(_0x7d34('0xd'));});});});}; \ No newline at end of file +var _0x565f=['bluebird','./config','connect','connected','start','disconnect','stop','then','restart','list','describe','dump','saved'];(function(_0x53e19d,_0x604957){var _0x5ba332=function(_0x34f66e){while(--_0x34f66e){_0x53e19d['push'](_0x53e19d['shift']());}};_0x5ba332(++_0x604957);}(_0x565f,0x68));var _0xf565=function(_0x583b3d,_0x18d2e5){_0x583b3d=_0x583b3d-0x0;var _0x443e13=_0x565f[_0x583b3d];return _0x443e13;};'use strict';var pm2=require('pm2');var BPromise=require(_0xf565('0x0'));var config=require(_0xf565('0x1'));function connect(){return new BPromise(function(_0x1d8f31,_0x5956e1){return pm2[_0xf565('0x2')](function(_0x24f0ad){if(_0x24f0ad){return _0x5956e1(_0x24f0ad);}return _0x1d8f31(_0xf565('0x3'));});});};exports[_0xf565('0x4')]=function(_0x35e885){return connect()['then'](function(){return new BPromise(function(_0x538606,_0x570631){return pm2[_0xf565('0x4')](_0x35e885,function(_0x4cc0ea,_0x2d3b27){if(_0x4cc0ea){return _0x570631(_0x4cc0ea);}pm2[_0xf565('0x5')]();return _0x538606(_0x2d3b27);});});});};exports[_0xf565('0x6')]=function(_0x55685c){return connect()[_0xf565('0x7')](function(){return new BPromise(function(_0x50f02c,_0x35377e){return pm2['stop'](_0x55685c,function(_0x2d7f4e,_0x1a362d){if(_0x2d7f4e){return _0x35377e(_0x2d7f4e);}pm2[_0xf565('0x5')]();return _0x50f02c(_0x1a362d);});});});};exports[_0xf565('0x8')]=function(_0x306274){return connect()[_0xf565('0x7')](function(){return new BPromise(function(_0x4c13ed,_0x4cb8e1){return pm2[_0xf565('0x8')](_0x306274,function(_0x9f915c,_0xd29dae){if(_0x9f915c){return _0x4cb8e1(_0x9f915c);}pm2[_0xf565('0x5')]();return _0x4c13ed(_0xd29dae);});});});};exports[_0xf565('0x9')]=function(){return connect()[_0xf565('0x7')](function(){return new BPromise(function(_0x5304cf,_0x3c0cff){return pm2[_0xf565('0x9')](function(_0x366ac2,_0x4f926d){if(_0x366ac2){return _0x3c0cff(_0x366ac2);}pm2[_0xf565('0x5')]();return _0x5304cf(_0x4f926d);});});});};exports[_0xf565('0xa')]=function(_0x4c209f){return connect()[_0xf565('0x7')](function(){return new BPromise(function(_0x2cd6a8,_0x468d80){return pm2[_0xf565('0xa')](_0x4c209f,function(_0x38e9d1,_0x509ff4){if(_0x38e9d1){return _0x468d80(_0x38e9d1);}pm2[_0xf565('0x5')]();return _0x2cd6a8(_0x509ff4);});});});};exports['delete']=function(_0x4a3768){return connect()[_0xf565('0x7')](function(){return new BPromise(function(_0xfc92b8,_0x4fb154){return pm2['delete'](_0x4a3768,function(_0x2d2197,_0x4f0fc3){if(_0x2d2197){return _0x4fb154(_0x2d2197);}pm2[_0xf565('0x5')]();return _0xfc92b8(_0x4f0fc3);});});});};exports[_0xf565('0xb')]=function(){return connect()[_0xf565('0x7')](function(){return new BPromise(function(_0x51215d,_0x55032c){return pm2[_0xf565('0xb')](function(_0x3a8a09){if(_0x3a8a09){return _0x55032c(_0x3a8a09);}return _0x51215d(_0xf565('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index abd9d59..3707741 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 _0x2730=['length','emit','catch','error','start','moment','ioredis','../../mysqldb','defaults','localhost','socket.io-emitter','Setting','find','then','chatTimeout','findAll','subtract','minutes','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map'];(function(_0x243bde,_0x4934dd){var _0x447334=function(_0x8ebabd){while(--_0x8ebabd){_0x243bde['push'](_0x243bde['shift']());}};_0x447334(++_0x4934dd);}(_0x2730,0x130));var _0x0273=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2730[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0x0273('0x0'));var Redis=require(_0x0273('0x1'));var db=require(_0x0273('0x2'))['db'];var config=require('../../config/environment');config['redis']=_[_0x0273('0x3')](config['redis'],{'host':_0x0273('0x4'),'port':0x18eb});var io=require(_0x0273('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x1c2702=0x0;var _0x53b6d1=[];return db[_0x0273('0x6')][_0x0273('0x7')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x0273('0x8')](function(_0x30bbfa){_0x1c2702=_0x30bbfa[_0x0273('0x9')];if(_0x1c2702){return db['ChatInteraction'][_0x0273('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0273('0xb')](_0x30bbfa['chatTimeout'],_0x0273('0xc'))}}});}else{return[];}})[_0x0273('0x8')](function(_0x251b1a){_0x53b6d1=_0x251b1a;if(_0x1c2702){return db['ChatInteraction'][_0x0273('0xd')]({'closeReason':'system','disposition':_0x0273('0xe'),'closed':!![],'closedAt':moment()[_0x0273('0xf')](_0x0273('0x10'))},{'where':{'id':_[_0x0273('0x11')](_0x53b6d1||[],'id')}});}})[_0x0273('0x8')](function(_0x308a05){for(var _0x10058e=0x0;_0x10058e<_0x53b6d1[_0x0273('0x12')];_0x10058e++){io[_0x0273('0x13')]('chatInteraction:update',{'id':_0x53b6d1[_0x10058e]['id'],'closed':!![]});}})[_0x0273('0x14')](function(_0x52d541){console[_0x0273('0x15')](_0x52d541);});}exports[_0x0273('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc797=['redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','ChatInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','catch','error','start','lodash','ioredis','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc797,0x19d));var _0x7c79=function(_0x18e711,_0x48c539){_0x18e711=_0x18e711-0x0;var _0x36f89b=_0xc797[_0x18e711];return _0x36f89b;};'use strict';var _=require(_0x7c79('0x0'));var moment=require('moment');var Redis=require(_0x7c79('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x7c79('0x2'));config[_0x7c79('0x3')]=_[_0x7c79('0x4')](config[_0x7c79('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x7c79('0x5'))(new Redis(config[_0x7c79('0x3')]));function closeInteractions(){var _0x371932=0x0;var _0xd3284e=[];return db[_0x7c79('0x6')][_0x7c79('0x7')]({'raw':!![],'attributes':['id',_0x7c79('0x8')],'where':{'id':0x1}})[_0x7c79('0x9')](function(_0x38ab41){_0x371932=_0x38ab41['chatTimeout'];if(_0x371932){return db['ChatInteraction'][_0x7c79('0xa')]({'raw':!![],'attributes':['id',_0x7c79('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7c79('0xc')](_0x38ab41['chatTimeout'],_0x7c79('0xd'))}}});}else{return[];}})['then'](function(_0x501567){_0xd3284e=_0x501567;if(_0x371932){return db[_0x7c79('0xe')][_0x7c79('0xf')]({'closeReason':_0x7c79('0x10'),'disposition':_0x7c79('0x11'),'closed':!![],'closedAt':moment()['format'](_0x7c79('0x12'))},{'where':{'id':_[_0x7c79('0x13')](_0xd3284e||[],'id')}});}})[_0x7c79('0x9')](function(_0x273e39){for(var _0x524253=0x0;_0x524253<_0xd3284e[_0x7c79('0x14')];_0x524253++){io[_0x7c79('0x15')](_0x7c79('0x16'),{'id':_0xd3284e[_0x524253]['id'],'closed':!![]});}})[_0x7c79('0x17')](function(_0x505b7b){console[_0x7c79('0x18')](_0x505b7b);});}exports[_0x7c79('0x19')]=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 0742adc..b9b6aa6 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 _0xf556=['startAt','start','exists','stop\x20cron','update','update\x20cron','run','util','lodash','moment','cron-job-manager','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','zip','existsSync','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','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','keys','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','index','resolve','run\x20job','cron','active','isBetween'];(function(_0x418c7c,_0x154293){var _0x5380b0=function(_0x12819c){while(--_0x12819c){_0x418c7c['push'](_0x418c7c['shift']());}};_0x5380b0(++_0x154293);}(_0xf556,0xc1));var _0x6f55=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0xf556[_0x58175c];return _0x55b88f;};'use strict';var fs=require('fs');var util=require(_0x6f55('0x0'));var path=require('path');var _=require(_0x6f55('0x1'));var moment=require(_0x6f55('0x2'));var CronJobManager=require(_0x6f55('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x6f55('0x4'));var logger=require('../logger')(_0x6f55('0x5'));var db=require(_0x6f55('0x6'))['db'];var analyticCustomReportController=require(_0x6f55('0x7'));var analyticDefaultReportController=require(_0x6f55('0x8'));var client=jayson[_0x6f55('0x9')][_0x6f55('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3e5ec3,_0x162c7a){return function(){logger['info'](_0x6f55('0xb'),_0x3e5ec3[_0x6f55('0xc')]);var _0x557eb8=!![];var _0x1d6e96={'tls':{'rejectUnauthorized':![]}};if(_0x3e5ec3[_0x6f55('0xd')]['Smtp'][_0x6f55('0xe')]){_0x1d6e96[_0x6f55('0xe')]=_0x3e5ec3['MailAccount'][_0x6f55('0xf')]['service'];}else{_0x1d6e96[_0x6f55('0x10')]=_0x3e5ec3['MailAccount'][_0x6f55('0xf')][_0x6f55('0x10')];_0x1d6e96[_0x6f55('0x11')]=_0x3e5ec3['MailAccount'][_0x6f55('0xf')][_0x6f55('0x11')];_0x1d6e96[_0x6f55('0x12')]=_0x3e5ec3[_0x6f55('0xd')][_0x6f55('0xf')][_0x6f55('0x12')];}if(_0x3e5ec3[_0x6f55('0xd')]['Smtp'][_0x6f55('0x13')]){_0x1d6e96[_0x6f55('0x14')]={'user':_0x3e5ec3[_0x6f55('0xd')]['Smtp']['user'],'pass':_0x3e5ec3[_0x6f55('0xd')][_0x6f55('0xf')][_0x6f55('0x15')]};}var _0x5c74e7={'account':_0x1d6e96,'message':{'from':util[_0x6f55('0x16')](_0x6f55('0x17'),_0x3e5ec3['MailAccount'][_0x6f55('0x18')],_0x3e5ec3[_0x6f55('0xd')][_0x6f55('0xc')]||_0x3e5ec3[_0x6f55('0xd')][_0x6f55('0xf')][_0x6f55('0x19')]),'to':_0x3e5ec3[_0x6f55('0xc')],'cc':_0x3e5ec3['cc'],'bcc':_0x3e5ec3[_0x6f55('0x1a')],'subject':util[_0x6f55('0x16')](_0x6f55('0x1b'),_0x162c7a[_0x6f55('0x18')],_0x3e5ec3[_0x6f55('0x1c')],_0x3e5ec3['subtractUnit'])}};var _0x14c629=path[_0x6f55('0x1d')](__dirname,_0x6f55('0x1e'));var _0x262ee2=_0x162c7a[_0x6f55('0x1f')];var _0x14571d=util[_0x6f55('0x16')](_0x6f55('0x20'),path['basename'](_0x162c7a[_0x6f55('0x1f')],path['extname'](_0x162c7a[_0x6f55('0x1f')])),_0x6f55('0x21'));var _0x3a1c09=path[_0x6f55('0x1d')](_0x14c629,_0x262ee2);var _0x38f130=path[_0x6f55('0x1d')](_0x14c629,_0x14571d);if(fs[_0x6f55('0x22')](_0x3a1c09)){_0x162c7a[_0x6f55('0x23')]=_0x6f55('0x24');_0x5c74e7[_0x6f55('0x25')][_0x6f55('0x26')]=[{'filename':_0x262ee2,'path':_0x3a1c09}];_0x5c74e7['message'][_0x6f55('0x27')]=util[_0x6f55('0x16')](_0x6f55('0x28'),JSON[_0x6f55('0x29')](_0x162c7a,null,0x2));}else if(fs['existsSync'](_0x38f130)){_0x162c7a['status']=_0x6f55('0x24');_0x5c74e7['message']['attachments']=[{'filename':_0x14571d,'path':_0x38f130}];}else{_0x5c74e7[_0x6f55('0x25')]['text']=_0x6f55('0x2a');if(!_0x3e5ec3[_0x6f55('0x2b')]){_0x557eb8=![];logger[_0x6f55('0x2c')](_0x6f55('0x2d'));}}if(_0x557eb8){return client[_0x6f55('0x2e')](_0x6f55('0x2f'),_0x5c74e7)['then'](function(_0x4057c4){if(_0x4057c4[_0x6f55('0x30')]){return logger[_0x6f55('0x30')](_0x6f55('0x31'),JSON['stringify'](_0x4057c4));}return logger[_0x6f55('0x2c')]('email\x20sent');})[_0x6f55('0x32')](function(_0x187712){return logger[_0x6f55('0x30')](_0x6f55('0x31'),JSON[_0x6f55('0x29')](_0x187712));});}};}function handleError(){return function(_0x223b63){return logger[_0x6f55('0x30')](JSON[_0x6f55('0x29')](_0x223b63));};}function handleResult(_0x195bdc){return function(_0x12e739){logger[_0x6f55('0x2c')](_0x6f55('0x33'),JSON[_0x6f55('0x29')](_0x12e739));if(_0x195bdc['MailAccount']&&_0x195bdc['MailAccount'][_0x6f55('0xf')]&&!_[_0x6f55('0x34')](_0x195bdc['email'])){setTimeout(handleSendEmail(_0x195bdc,_0x12e739),0x3c*0x3e8);}};}function handleJob(_0x1fd1c6){return function(){try{if(_[_0x6f55('0x34')](_0x1fd1c6[_0x6f55('0x1c')])){return logger[_0x6f55('0x2c')](_0x6f55('0x35'));}if(_[_0x6f55('0x34')](_0x1fd1c6[_0x6f55('0x36')])){return logger[_0x6f55('0x2c')](_0x6f55('0x37'));}var _0x2b132c={'startDate':moment()[_0x6f55('0x38')](_0x1fd1c6[_0x6f55('0x1c')],_0x1fd1c6['subtractUnit'])[_0x6f55('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x6f55('0x16')](_0x6f55('0x39')),'type':_0x6f55('0x3a'),'output':_0x1fd1c6[_0x6f55('0x3b')],'name':_0x1fd1c6[_0x6f55('0x18')]};if(!_['isNil'](_0x1fd1c6[_0x6f55('0x3c')])){logger[_0x6f55('0x2c')](_0x6f55('0x3d'),_0x1fd1c6['DefaultReportId']);return analyticDefaultReportController[_0x6f55('0x3e')]({'id':_0x1fd1c6[_0x6f55('0x3c')]},_0x2b132c)[_0x6f55('0x3f')](handleResult(_0x1fd1c6))[_0x6f55('0x32')](handleError());}if(!_[_0x6f55('0x34')](_0x1fd1c6[_0x6f55('0x40')])){logger[_0x6f55('0x2c')](_0x6f55('0x41'),_0x1fd1c6['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x1fd1c6['CustomReportId']},_0x2b132c)[_0x6f55('0x3f')](handleResult(_0x1fd1c6))[_0x6f55('0x32')](handleError());}}catch(_0x4b95c2){logger[_0x6f55('0x30')](JSON['stringify'](_0x4b95c2));}return logger[_0x6f55('0x2c')](_0x6f55('0x42'));};}function getJobs(_0x1b5e2e){var _0x532d9f={};if(_0x1b5e2e){_0x532d9f['id']=_0x1b5e2e;}return db[_0x6f55('0x43')][_0x6f55('0x44')]({'where':_0x532d9f,'include':[{'model':db[_0x6f55('0xd')],'attributes':['id',_0x6f55('0x18'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x6f55('0xf')}]}]})['then'](function(_0x394a5e){var _0x556e28=_[_0x6f55('0x45')](manager['jobs']);var _0x353b4a=_[_0x6f55('0x46')](_0x394a5e,function(_0x41c367){return _0x41c367['id'][_0x6f55('0x47')]();});var _0x34045a=_[_0x6f55('0x48')](_0x394a5e,function(_0x3a9444){return _0x3a9444['id'][_0x6f55('0x47')]();});var _0x3df640=_0x1b5e2e?_0x353b4a:_[_0x6f55('0x49')](_0x353b4a,_0x556e28);var _0x2ea741=_[_0x6f55('0x4a')](_0x353b4a,_0x556e28);var _0x6c2258=_[_0x6f55('0x49')](_0x556e28,_0x353b4a);var _0x4d54d6;var _0x16e7b6;for(_0x4d54d6=0x0;_0x4d54d6<_0x6c2258[_0x6f55('0x4b')]&&!_0x1b5e2e;_0x4d54d6+=0x1){_0x16e7b6=_0x6c2258[_0x4d54d6][_0x6f55('0x47')]();if(manager['exists'](_0x16e7b6)){manager[_0x6f55('0x4c')](_0x16e7b6);manager[_0x6f55('0x4d')](_0x16e7b6);logger[_0x6f55('0x2c')](_0x6f55('0x4e'),_0x16e7b6);}}logger[_0x6f55('0x2c')](_0x6f55('0x4f'),JSON[_0x6f55('0x29')](_0x3df640));for(_0x4d54d6=0x0;_0x4d54d6<_0x3df640[_0x6f55('0x4b')];_0x4d54d6+=0x1){_0x16e7b6=_0x3df640[_0x4d54d6]['toString']();logger['info'](_0x6f55('0x50'),_0x16e7b6);if(_0x1b5e2e){logger[_0x6f55('0x2c')]('my\x20id',_0x1b5e2e);logger[_0x6f55('0x2c')](JSON['stringify'](_0x34045a[_0x16e7b6]));BPromise[_0x6f55('0x51')]()[_0x6f55('0x3f')](handleJob(_0x34045a[_0x16e7b6]));logger[_0x6f55('0x2c')](_0x6f55('0x52'),_0x34045a[_0x16e7b6][_0x6f55('0x18')],_0x34045a[_0x16e7b6]['cron']);}else if(_0x34045a[_0x16e7b6][_0x6f55('0x53')]&&_0x34045a[_0x16e7b6][_0x6f55('0x54')]&&moment()[_0x6f55('0x55')](_0x34045a[_0x16e7b6][_0x6f55('0x56')],_0x34045a[_0x16e7b6]['endAt'])){manager['add'](_0x16e7b6,_0x34045a[_0x16e7b6][_0x6f55('0x53')],handleJob(_0x34045a[_0x16e7b6]));manager[_0x6f55('0x57')](_0x16e7b6);logger[_0x6f55('0x2c')]('add\x20cron',_0x34045a[_0x16e7b6][_0x6f55('0x18')],_0x34045a[_0x16e7b6][_0x6f55('0x53')]);}else if(manager[_0x6f55('0x58')](_0x16e7b6)){manager[_0x6f55('0x4c')](_0x16e7b6);manager[_0x6f55('0x4d')](_0x16e7b6);logger['info'](_0x6f55('0x59'),_0x34045a[_0x16e7b6][_0x6f55('0x18')],_0x34045a[_0x16e7b6][_0x6f55('0x53')]);}}for(_0x4d54d6=0x0,_0x16e7b6;_0x4d54d6<_0x2ea741['length']&&!_0x1b5e2e;_0x4d54d6+=0x1){_0x16e7b6=_0x2ea741[_0x4d54d6][_0x6f55('0x47')]();if(manager[_0x6f55('0x58')](_0x16e7b6)){if(_0x34045a[_0x16e7b6][_0x6f55('0x53')]&&_0x34045a[_0x16e7b6][_0x6f55('0x54')]&&moment()['isBetween'](_0x34045a[_0x16e7b6][_0x6f55('0x56')],_0x34045a[_0x16e7b6]['endAt'])){manager[_0x6f55('0x5a')](_0x16e7b6,_0x34045a[_0x16e7b6][_0x6f55('0x53')],handleJob(_0x34045a[_0x16e7b6]));logger['info'](_0x6f55('0x5b'),_0x34045a[_0x16e7b6][_0x6f55('0x18')],_0x34045a[_0x16e7b6][_0x6f55('0x53')]);}else{manager[_0x6f55('0x4c')](_0x16e7b6);manager[_0x6f55('0x4d')](_0x16e7b6);logger[_0x6f55('0x2c')]('stop\x20cron',_0x34045a[_0x16e7b6][_0x6f55('0x18')],_0x34045a[_0x16e7b6][_0x6f55('0x53')]);}}}})[_0x6f55('0x32')](function(_0x44baaa){logger['error'](JSON[_0x6f55('0x29')](_0x44baaa));});}exports[_0x6f55('0x5c')]=function(_0x20f1dd){return getJobs(_0x20f1dd);};exports[_0x6f55('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xf3d5=['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','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','request','SendMail','error','stringify','email\x20sent','catch','error\x20mail','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','index','cron','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','active','update','lodash','moment','cron-job-manager','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','status','Sent'];(function(_0x2c1ad0,_0x5c2efb){var _0x22da92=function(_0x104fb5){while(--_0x104fb5){_0x2c1ad0['push'](_0x2c1ad0['shift']());}};_0x22da92(++_0x5c2efb);}(_0xf3d5,0x88));var _0x5f3d=function(_0x550cfa,_0x18957f){_0x550cfa=_0x550cfa-0x0;var _0x5b71ce=_0xf3d5[_0x550cfa];return _0x5b71ce;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x5f3d('0x0'));var moment=require(_0x5f3d('0x1'));var CronJobManager=require(_0x5f3d('0x2'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require('../logger')('schedule');var db=require(_0x5f3d('0x3'))['db'];var analyticCustomReportController=require(_0x5f3d('0x4'));var analyticDefaultReportController=require(_0x5f3d('0x5'));var client=jayson[_0x5f3d('0x6')][_0x5f3d('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x24797b,_0x205483){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x24797b[_0x5f3d('0x8')]);var _0x2a068b=!![];var _0x3838ac={'tls':{'rejectUnauthorized':![]}};if(_0x24797b[_0x5f3d('0x9')][_0x5f3d('0xa')][_0x5f3d('0xb')]){_0x3838ac[_0x5f3d('0xb')]=_0x24797b[_0x5f3d('0x9')][_0x5f3d('0xa')][_0x5f3d('0xb')];}else{_0x3838ac[_0x5f3d('0xc')]=_0x24797b[_0x5f3d('0x9')][_0x5f3d('0xa')][_0x5f3d('0xc')];_0x3838ac[_0x5f3d('0xd')]=_0x24797b['MailAccount']['Smtp'][_0x5f3d('0xd')];_0x3838ac[_0x5f3d('0xe')]=_0x24797b[_0x5f3d('0x9')][_0x5f3d('0xa')][_0x5f3d('0xe')];}if(_0x24797b[_0x5f3d('0x9')][_0x5f3d('0xa')][_0x5f3d('0xf')]){_0x3838ac[_0x5f3d('0x10')]={'user':_0x24797b[_0x5f3d('0x9')]['Smtp'][_0x5f3d('0x11')],'pass':_0x24797b[_0x5f3d('0x9')][_0x5f3d('0xa')]['pass']};}var _0x193aa0={'account':_0x3838ac,'message':{'from':util[_0x5f3d('0x12')](_0x5f3d('0x13'),_0x24797b[_0x5f3d('0x9')][_0x5f3d('0x14')],_0x24797b[_0x5f3d('0x9')][_0x5f3d('0x8')]||_0x24797b['MailAccount'][_0x5f3d('0xa')]['user']),'to':_0x24797b[_0x5f3d('0x8')],'cc':_0x24797b['cc'],'bcc':_0x24797b[_0x5f3d('0x15')],'subject':util[_0x5f3d('0x12')](_0x5f3d('0x16'),_0x205483[_0x5f3d('0x14')],_0x24797b['subtractNumber'],_0x24797b[_0x5f3d('0x17')])}};var _0x5785f7=path[_0x5f3d('0x18')](__dirname,_0x5f3d('0x19'));var _0x21aa96=_0x205483[_0x5f3d('0x1a')];var _0x302069=util[_0x5f3d('0x12')](_0x5f3d('0x1b'),path[_0x5f3d('0x1c')](_0x205483['savename'],path[_0x5f3d('0x1d')](_0x205483['savename'])),'zip');var _0x177d74=path[_0x5f3d('0x18')](_0x5785f7,_0x21aa96);var _0x34b75d=path[_0x5f3d('0x18')](_0x5785f7,_0x302069);if(fs['existsSync'](_0x177d74)){_0x205483[_0x5f3d('0x1e')]=_0x5f3d('0x1f');_0x193aa0[_0x5f3d('0x20')][_0x5f3d('0x21')]=[{'filename':_0x21aa96,'path':_0x177d74}];_0x193aa0[_0x5f3d('0x20')][_0x5f3d('0x22')]=util['format'](_0x5f3d('0x23'),JSON['stringify'](_0x205483,null,0x2));}else if(fs[_0x5f3d('0x24')](_0x34b75d)){_0x205483[_0x5f3d('0x1e')]=_0x5f3d('0x1f');_0x193aa0['message'][_0x5f3d('0x21')]=[{'filename':_0x302069,'path':_0x34b75d}];}else{_0x193aa0[_0x5f3d('0x20')]['text']=_0x5f3d('0x25');if(!_0x24797b['sendIfEmpty']){_0x2a068b=![];logger[_0x5f3d('0x26')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x2a068b){return client[_0x5f3d('0x27')](_0x5f3d('0x28'),_0x193aa0)['then'](function(_0x38a5d5){if(_0x38a5d5[_0x5f3d('0x29')]){return logger['error']('error\x20mail',JSON[_0x5f3d('0x2a')](_0x38a5d5));}return logger['info'](_0x5f3d('0x2b'));})[_0x5f3d('0x2c')](function(_0x681419){return logger[_0x5f3d('0x29')](_0x5f3d('0x2d'),JSON[_0x5f3d('0x2a')](_0x681419));});}};}function handleError(){return function(_0x3da207){return logger[_0x5f3d('0x29')](JSON[_0x5f3d('0x2a')](_0x3da207));};}function handleResult(_0xbe7445){return function(_0x9e3f93){logger[_0x5f3d('0x26')]('data',JSON[_0x5f3d('0x2a')](_0x9e3f93));if(_0xbe7445['MailAccount']&&_0xbe7445[_0x5f3d('0x9')]['Smtp']&&!_[_0x5f3d('0x2e')](_0xbe7445[_0x5f3d('0x8')])){setTimeout(handleSendEmail(_0xbe7445,_0x9e3f93),0x3c*0x3e8);}};}function handleJob(_0x89ec6b){return function(){try{if(_['isNil'](_0x89ec6b[_0x5f3d('0x2f')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x5f3d('0x2e')](_0x89ec6b[_0x5f3d('0x17')])){return logger['info'](_0x5f3d('0x30'));}var _0x503c8a={'startDate':moment()[_0x5f3d('0x31')](_0x89ec6b[_0x5f3d('0x2f')],_0x89ec6b[_0x5f3d('0x17')])['format'](_0x5f3d('0x32')),'endDate':moment()['format'](_0x5f3d('0x32')),'type':_0x5f3d('0x33'),'output':_0x89ec6b['output'],'name':_0x89ec6b['name']};if(!_[_0x5f3d('0x2e')](_0x89ec6b[_0x5f3d('0x34')])){logger[_0x5f3d('0x26')]('exec\x20defaul\x20report\x20id:%s',_0x89ec6b[_0x5f3d('0x34')]);return analyticDefaultReportController[_0x5f3d('0x35')]({'id':_0x89ec6b[_0x5f3d('0x34')]},_0x503c8a)[_0x5f3d('0x36')](handleResult(_0x89ec6b))[_0x5f3d('0x2c')](handleError());}if(!_[_0x5f3d('0x2e')](_0x89ec6b[_0x5f3d('0x37')])){logger[_0x5f3d('0x26')](_0x5f3d('0x38'),_0x89ec6b[_0x5f3d('0x37')]);return analyticCustomReportController['runReport']({'id':_0x89ec6b[_0x5f3d('0x37')]},_0x503c8a)[_0x5f3d('0x36')](handleResult(_0x89ec6b))[_0x5f3d('0x2c')](handleError());}}catch(_0x334b6f){logger[_0x5f3d('0x29')](JSON[_0x5f3d('0x2a')](_0x334b6f));}return logger['info'](_0x5f3d('0x39'));};}function getJobs(_0x4739ab){var _0x4f6665={};if(_0x4739ab){_0x4f6665['id']=_0x4739ab;}return db['Schedule'][_0x5f3d('0x3a')]({'where':_0x4f6665,'include':[{'model':db[_0x5f3d('0x9')],'attributes':['id',_0x5f3d('0x14'),_0x5f3d('0x8')],'include':[{'model':db[_0x5f3d('0x3b')],'as':_0x5f3d('0xa')}]}]})[_0x5f3d('0x36')](function(_0x108887){var _0x5015e8=_[_0x5f3d('0x3c')](manager[_0x5f3d('0x3d')]);var _0x51eff6=_[_0x5f3d('0x3e')](_0x108887,function(_0x389327){return _0x389327['id'][_0x5f3d('0x3f')]();});var _0x49d202=_[_0x5f3d('0x40')](_0x108887,function(_0x5d96dc){return _0x5d96dc['id'][_0x5f3d('0x3f')]();});var _0x5d57c0=_0x4739ab?_0x51eff6:_[_0x5f3d('0x41')](_0x51eff6,_0x5015e8);var _0xc91fa3=_[_0x5f3d('0x42')](_0x51eff6,_0x5015e8);var _0x411a9b=_[_0x5f3d('0x41')](_0x5015e8,_0x51eff6);var _0x2b9720;var _0x3e2c1b;for(_0x2b9720=0x0;_0x2b9720<_0x411a9b[_0x5f3d('0x43')]&&!_0x4739ab;_0x2b9720+=0x1){_0x3e2c1b=_0x411a9b[_0x2b9720][_0x5f3d('0x3f')]();if(manager[_0x5f3d('0x44')](_0x3e2c1b)){manager[_0x5f3d('0x45')](_0x3e2c1b);manager['deleteJob'](_0x3e2c1b);logger[_0x5f3d('0x26')](_0x5f3d('0x46'),_0x3e2c1b);}}logger[_0x5f3d('0x26')](_0x5f3d('0x47'),JSON['stringify'](_0x5d57c0));for(_0x2b9720=0x0;_0x2b9720<_0x5d57c0['length'];_0x2b9720+=0x1){_0x3e2c1b=_0x5d57c0[_0x2b9720]['toString']();logger[_0x5f3d('0x26')](_0x5f3d('0x48'),_0x3e2c1b);if(_0x4739ab){logger[_0x5f3d('0x26')]('my\x20id',_0x4739ab);logger[_0x5f3d('0x26')](JSON[_0x5f3d('0x2a')](_0x49d202[_0x3e2c1b]));BPromise['resolve']()[_0x5f3d('0x36')](handleJob(_0x49d202[_0x3e2c1b]));logger['info']('run\x20job',_0x49d202[_0x3e2c1b][_0x5f3d('0x14')],_0x49d202[_0x3e2c1b][_0x5f3d('0x49')]);}else if(_0x49d202[_0x3e2c1b][_0x5f3d('0x49')]&&_0x49d202[_0x3e2c1b]['active']&&moment()[_0x5f3d('0x4a')](_0x49d202[_0x3e2c1b][_0x5f3d('0x4b')],_0x49d202[_0x3e2c1b][_0x5f3d('0x4c')])){manager[_0x5f3d('0x4d')](_0x3e2c1b,_0x49d202[_0x3e2c1b][_0x5f3d('0x49')],handleJob(_0x49d202[_0x3e2c1b]));manager[_0x5f3d('0x4e')](_0x3e2c1b);logger[_0x5f3d('0x26')](_0x5f3d('0x4f'),_0x49d202[_0x3e2c1b][_0x5f3d('0x14')],_0x49d202[_0x3e2c1b][_0x5f3d('0x49')]);}else if(manager[_0x5f3d('0x44')](_0x3e2c1b)){manager[_0x5f3d('0x45')](_0x3e2c1b);manager[_0x5f3d('0x50')](_0x3e2c1b);logger[_0x5f3d('0x26')](_0x5f3d('0x51'),_0x49d202[_0x3e2c1b][_0x5f3d('0x14')],_0x49d202[_0x3e2c1b]['cron']);}}for(_0x2b9720=0x0,_0x3e2c1b;_0x2b9720<_0xc91fa3[_0x5f3d('0x43')]&&!_0x4739ab;_0x2b9720+=0x1){_0x3e2c1b=_0xc91fa3[_0x2b9720][_0x5f3d('0x3f')]();if(manager[_0x5f3d('0x44')](_0x3e2c1b)){if(_0x49d202[_0x3e2c1b][_0x5f3d('0x49')]&&_0x49d202[_0x3e2c1b][_0x5f3d('0x52')]&&moment()[_0x5f3d('0x4a')](_0x49d202[_0x3e2c1b][_0x5f3d('0x4b')],_0x49d202[_0x3e2c1b][_0x5f3d('0x4c')])){manager[_0x5f3d('0x53')](_0x3e2c1b,_0x49d202[_0x3e2c1b][_0x5f3d('0x49')],handleJob(_0x49d202[_0x3e2c1b]));logger['info']('update\x20cron',_0x49d202[_0x3e2c1b][_0x5f3d('0x14')],_0x49d202[_0x3e2c1b][_0x5f3d('0x49')]);}else{manager[_0x5f3d('0x45')](_0x3e2c1b);manager[_0x5f3d('0x50')](_0x3e2c1b);logger[_0x5f3d('0x26')]('stop\x20cron',_0x49d202[_0x3e2c1b][_0x5f3d('0x14')],_0x49d202[_0x3e2c1b][_0x5f3d('0x49')]);}}}})[_0x5f3d('0x2c')](function(_0x5a30ea){logger[_0x5f3d('0x29')](JSON[_0x5f3d('0x2a')](_0x5a30ea));});}exports['run']=function(_0x3a0506){return getJobs(_0x3a0506);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 0617c2b..3f306b9 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bc7=['push','Biondo','innocenzo.biondo','now','Innocenzo','CmContact','destroy','then','bulkCreate','contacts1','CmHopper','log','finished\x20populating','hopper1','contacts2','hopper2','catch','util','../mysqldb'];(function(_0x34a4fd,_0x5c07f2){var _0xf89bcb=function(_0x575bbe){while(--_0x575bbe){_0x34a4fd['push'](_0x34a4fd['shift']());}};_0xf89bcb(++_0x5c07f2);}(_0x4bc7,0x141));var _0x74bc=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0x4bc7[_0x919445];return _0x511b3e;};'use strict';var util=require(_0x74bc('0x0'));var db=require(_0x74bc('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x74bc('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x74bc('0x3')+i,'phone':0xf879fb460+i,'email':_0x74bc('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x74bc('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x74bc('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x74bc('0x6')+i,'lastName':_0x74bc('0x3')+i,'phone':0xf879fb460+i,'email':_0x74bc('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x74bc('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x74bc('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x74bc('0x5')](),'updatedAt':Date[_0x74bc('0x5')]()});}db[_0x74bc('0x7')][_0x74bc('0x8')]({'where':{}})[_0x74bc('0x9')](function(){return db[_0x74bc('0x7')][_0x74bc('0xa')](contacts);})[_0x74bc('0x9')](function(){console['log']('finished\x20populating',_0x74bc('0xb'));return db[_0x74bc('0xc')]['destroy']({'where':{}});})['then'](function(){return db[_0x74bc('0xc')]['bulkCreate'](hopper);})[_0x74bc('0x9')](function(){console[_0x74bc('0xd')](_0x74bc('0xe'),_0x74bc('0xf'));return db[_0x74bc('0x7')]['bulkCreate'](contacts2);})[_0x74bc('0x9')](function(){console[_0x74bc('0xd')](_0x74bc('0xe'),_0x74bc('0x10'));return db[_0x74bc('0xc')][_0x74bc('0xa')](hopper2);})[_0x74bc('0x9')](function(){console[_0x74bc('0xd')](_0x74bc('0xe'),_0x74bc('0x11'));})[_0x74bc('0x12')](function(_0x43495b){console['log'](_0x43495b);}); \ No newline at end of file +var _0xa33e=['finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','destroy','then','CmContact','bulkCreate','log'];(function(_0x2089b3,_0x31fbde){var _0x181087=function(_0x31d19b){while(--_0x31d19b){_0x2089b3['push'](_0x2089b3['shift']());}};_0x181087(++_0x31fbde);}(_0xa33e,0x1d1));var _0xea33=function(_0x1067f2,_0x483731){_0x1067f2=_0x1067f2-0x0;var _0x5c7c6f=_0xa33e[_0x1067f2];return _0x5c7c6f;};'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[_0xea33('0x0')]({'id':i,'firstName':_0xea33('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xea33('0x2')+i+_0xea33('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xea33('0x0')]({'id':i,'active':![],'scheduledat':Date[_0xea33('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xea33('0x4')](),'updatedAt':Date[_0xea33('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xea33('0x1')+i,'lastName':_0xea33('0x5')+i,'phone':0xf879fb460+i,'email':_0xea33('0x2')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xea33('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xea33('0x4')](),'updatedAt':Date[_0xea33('0x4')]()});}db['CmContact'][_0xea33('0x6')]({'where':{}})[_0xea33('0x7')](function(){return db[_0xea33('0x8')][_0xea33('0x9')](contacts);})[_0xea33('0x7')](function(){console[_0xea33('0xa')](_0xea33('0xb'),_0xea33('0xc'));return db[_0xea33('0xd')][_0xea33('0x6')]({'where':{}});})[_0xea33('0x7')](function(){return db[_0xea33('0xd')][_0xea33('0x9')](hopper);})['then'](function(){console[_0xea33('0xa')]('finished\x20populating',_0xea33('0xe'));return db[_0xea33('0x8')][_0xea33('0x9')](contacts2);})['then'](function(){console[_0xea33('0xa')](_0xea33('0xb'),_0xea33('0xf'));return db[_0xea33('0xd')][_0xea33('0x9')](hopper2);})[_0xea33('0x7')](function(){console[_0xea33('0xa')](_0xea33('0xb'),_0xea33('0x10'));})['catch'](function(_0x47a0ed){console[_0xea33('0xa')](_0x47a0ed);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 1ca94d8..de3c154 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcecb=['push','%s%s','agent','format','%s%s@xcally.com','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','User','bulkCreate','then','catch','log','util','../mysqldb'];(function(_0xadeb4a,_0x684a72){var _0xea20b2=function(_0x43f9a2){while(--_0x43f9a2){_0xadeb4a['push'](_0xadeb4a['shift']());}};_0xea20b2(++_0x684a72);}(_0xcecb,0x10c));var _0xbcec=function(_0x4a166c,_0x1fc0d4){_0x4a166c=_0x4a166c-0x0;var _0x51dcdd=_0xcecb[_0x4a166c];return _0x51dcdd;};'use strict';var util=require(_0xbcec('0x0'));var db=require(_0xbcec('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbcec('0x2')]({'name':util['format'](_0xbcec('0x3'),_0xbcec('0x4'),i),'fullname':util[_0xbcec('0x5')](_0xbcec('0x3'),_0xbcec('0x4'),i),'email':util[_0xbcec('0x5')](_0xbcec('0x6'),_0xbcec('0x4'),i),'role':_0xbcec('0x4'),'password':'password','internal':0xfa0+i,'type':_0xbcec('0x7'),'transport':[_0xbcec('0x8'),'ws','wss'],'disallow':[_0xbcec('0x9')],'allow':['ulaw'],'defaultuser':util[_0xbcec('0x5')](_0xbcec('0x3'),'agent',i),'encryption':_0xbcec('0xa'),'avpf':_0xbcec('0xa'),'force_avp':_0xbcec('0xa'),'icesupport':_0xbcec('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xbcec('0xb'),'dtlsprivatekey':_0xbcec('0xc'),'dtlssetup':'actpass','callerid':util[_0xbcec('0x5')]('\x22%s\x22\x20<%s>',util[_0xbcec('0x5')](_0xbcec('0x3'),'agent',i),0xfa0+i)});}db[_0xbcec('0xd')][_0xbcec('0xe')](users)[_0xbcec('0xf')](function(){console['log']('add\x20user');})[_0xbcec('0x10')](function(_0x4a19f6){console[_0xbcec('0x11')](_0x4a19f6);}); \ No newline at end of file +var _0xd321=['/etc/pki/tls/private/motion.key','actpass','bulkCreate','log','add\x20user','catch','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','yes'];(function(_0x69e92,_0x4c109b){var _0x2c1dcb=function(_0x24ea2d){while(--_0x24ea2d){_0x69e92['push'](_0x69e92['shift']());}};_0x2c1dcb(++_0x4c109b);}(_0xd321,0x138));var _0x1d32=function(_0x16a67e,_0x355307){_0x16a67e=_0x16a67e-0x0;var _0x29d830=_0xd321[_0x16a67e];return _0x29d830;};'use strict';var util=require('util');var db=require(_0x1d32('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x1d32('0x1')](_0x1d32('0x2'),'agent',i),'fullname':util[_0x1d32('0x1')](_0x1d32('0x2'),_0x1d32('0x3'),i),'email':util['format'](_0x1d32('0x4'),_0x1d32('0x3'),i),'role':_0x1d32('0x3'),'password':_0x1d32('0x5'),'internal':0xfa0+i,'type':_0x1d32('0x6'),'transport':[_0x1d32('0x7'),'ws',_0x1d32('0x8')],'disallow':[_0x1d32('0x9')],'allow':['ulaw'],'defaultuser':util[_0x1d32('0x1')]('%s%s',_0x1d32('0x3'),i),'encryption':_0x1d32('0xa'),'avpf':_0x1d32('0xa'),'force_avp':_0x1d32('0xa'),'icesupport':_0x1d32('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x1d32('0xb'),'dtlssetup':_0x1d32('0xc'),'callerid':util['format']('\x22%s\x22\x20<%s>',util['format'](_0x1d32('0x2'),_0x1d32('0x3'),i),0xfa0+i)});}db['User'][_0x1d32('0xd')](users)['then'](function(){console[_0x1d32('0xe')](_0x1d32('0xf'));})[_0x1d32('0x10')](function(_0xca9cf9){console[_0x1d32('0xe')](_0xca9cf9);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 43dacfd..ae1d5ff 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6da5=['map','resourceId','where','length','format','user:%s','handshake','query','find','userProfileId','ChatInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','voice:outbound','FaxQueues','Telephones','Trunks','IvrCampaigns','getChatQueues','getFaxQueues','voice','chat','fax','sms','mail','openchannel','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeOpenchannelInteractions','catch','log','join','default','setMaxListeners','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','findAll','UserProfileResource'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x6da5,0x98));var _0x56da=function(_0x65e862,_0xec1f28){_0x65e862=_0x65e862-0x0;var _0x37eb7c=_0x6da5[_0x65e862];return _0x37eb7c;};'use strict';var _=require(_0x56da('0x0'));var util=require(_0x56da('0x1'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x56da('0x2')],'include':[{'as':_0x56da('0x3'),'model':db[_0x56da('0x4')],'attributes':['id',_0x56da('0x2'),_0x56da('0x5')],'raw':!![],'where':{'role':_0x56da('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x56da('0x2')],'where':{'role':_0x56da('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x56da('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0x56da('0x2')],'where':{'role':_0x56da('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x56da('0x2'),_0x56da('0x8')],'where':{'type':_0x56da('0x9')}};function getAssociatedResources(_0x136271,_0x60a358,_0x559b5a){return db[_0x56da('0xa')][_0x56da('0xb')]({'where':{'name':_0x136271,'userProfileId':_0x60a358},'raw':!![]})[_0x56da('0xc')](function(_0x544efd){if(_0x544efd){if(_0x544efd[_0x56da('0xd')]){switch(_0x136271){case _0x56da('0xe'):case _0x56da('0xf'):case'FaxQueues':case _0x56da('0x10'):case _0x56da('0x11'):case'OpenchannelQueues':return db[_0x559b5a][_0x56da('0x12')](queryQueues);case'Telephones':return db[_0x559b5a]['findAll'](queryTelephones);case'Trunks':return db[_0x559b5a]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x559b5a]['findAll'](queryCampaigns);}}else{return db[_0x56da('0x13')][_0x56da('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x544efd['id']},'raw':!![]})['then'](function(_0x328b76){if(_0x328b76){var _0x292bd8={'where':{'id':_[_0x56da('0x14')](_0x328b76,_0x56da('0x15'))},'raw':!![]};switch(_0x559b5a){case _0x56da('0x4'):_0x292bd8[_0x56da('0x16')][_0x56da('0x5')]=_0x56da('0x7');break;case'Campaign':_0x292bd8[_0x56da('0x16')][_0x56da('0x8')]=_0x56da('0x9');break;}return db[_0x559b5a]['findAll'](_0x292bd8);}else{return[];}});}}else{return[];}})['then'](function(_0x787fb9){return _0x787fb9;});}function joinOrLeaveQueues(_0x340a84,_0x5640d4,_0x5af955,_0x2fc703){_0x340a84[_0x5640d4](util['format']('%s:queue:%s',_0x5af955,_0x2fc703[_0x56da('0x2')]));if(_0x2fc703['Agents']){for(var _0x249e9a=0x0;_0x249e9a<_0x2fc703[_0x56da('0x3')][_0x56da('0x17')];_0x249e9a+=0x1){_0x340a84[_0x5640d4](util[_0x56da('0x18')](_0x56da('0x19'),_0x2fc703[_0x56da('0x3')][_0x249e9a][_0x56da('0x2')]));}}}function joinOrLeave(_0x48151f,_0x5cba94,_0x2b6d49){var _0xe9c853;if(_0x48151f[_0x56da('0x1a')][_0x56da('0x1b')]['id']){db['User'][_0x56da('0x1c')]({'attributes':['id',_0x56da('0x2'),_0x56da('0x5'),_0x56da('0x1d')],'where':{'id':_0x48151f[_0x56da('0x1a')][_0x56da('0x1b')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x56da('0x1e'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x56da('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x56da('0x20')],'as':_0x56da('0x21'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x56da('0x22'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x5bbf3a){if(_0x5bbf3a){_0xe9c853=_0x5bbf3a;_0x48151f[_0x5cba94](util['format'](_0x56da('0x19'),_0x5bbf3a[_0x56da('0x2')]));var _0x2c20c5=[];switch(_0x5bbf3a['role']){case _0x56da('0x23'):_0x48151f[_0x5cba94](_0x56da('0x24'));_0x48151f[_0x5cba94]('voice:outbound');if(queryQueues[_0x56da('0x25')](_0x56da('0x26'))){delete queryQueues['include'];}_0x2c20c5[_0x56da('0x27')](db[_0x56da('0x28')][_0x56da('0x12')](queryQueues));_0x2c20c5[_0x56da('0x27')](db[_0x56da('0x29')][_0x56da('0x12')](queryQueues));_0x2c20c5[_0x56da('0x27')](db[_0x56da('0x2a')]['findAll'](queryQueues));_0x2c20c5[_0x56da('0x27')](db[_0x56da('0x2b')][_0x56da('0x12')](queryQueues));_0x2c20c5[_0x56da('0x27')](db[_0x56da('0x2c')][_0x56da('0x12')](queryQueues));_0x2c20c5[_0x56da('0x27')](db[_0x56da('0x2d')]['findAll'](queryQueues));_0x2c20c5[_0x56da('0x27')](db['User'][_0x56da('0x12')](queryTelephones));_0x2c20c5[_0x56da('0x27')](db[_0x56da('0x2e')][_0x56da('0x12')](queryTrunks));_0x2c20c5['push'](db['Campaign']['findAll'](queryCampaigns));_0x2c20c5[_0x56da('0x27')](db[_0x56da('0x4')][_0x56da('0x12')](queryAgents));break;case _0x56da('0x2f'):_0x48151f[_0x5cba94](_0x56da('0x24'));_0x48151f[_0x5cba94](_0x56da('0x30'));_0x2c20c5['push'](getAssociatedResources('VoiceQueues',_0x5bbf3a[_0x56da('0x1d')],'VoiceQueue'));_0x2c20c5['push'](getAssociatedResources(_0x56da('0xf'),_0x5bbf3a[_0x56da('0x1d')],'ChatQueue'));_0x2c20c5[_0x56da('0x27')](getAssociatedResources(_0x56da('0x31'),_0x5bbf3a[_0x56da('0x1d')],'FaxQueue'));_0x2c20c5[_0x56da('0x27')](getAssociatedResources(_0x56da('0x10'),_0x5bbf3a[_0x56da('0x1d')],_0x56da('0x2b')));_0x2c20c5[_0x56da('0x27')](getAssociatedResources(_0x56da('0x11'),_0x5bbf3a['userProfileId'],_0x56da('0x2c')));_0x2c20c5[_0x56da('0x27')](getAssociatedResources('OpenchannelQueues',_0x5bbf3a[_0x56da('0x1d')],_0x56da('0x2d')));_0x2c20c5[_0x56da('0x27')](getAssociatedResources(_0x56da('0x32'),_0x5bbf3a[_0x56da('0x1d')],_0x56da('0x4')));_0x2c20c5['push'](getAssociatedResources(_0x56da('0x33'),_0x5bbf3a[_0x56da('0x1d')],_0x56da('0x2e')));_0x2c20c5['push'](getAssociatedResources(_0x56da('0x34'),_0x5bbf3a[_0x56da('0x1d')],'Campaign'));_0x2c20c5[_0x56da('0x27')](db['User']['findAll'](queryAgents));break;case _0x56da('0x6'):_0x48151f[_0x5cba94]('voice:inbound');_0x48151f[_0x5cba94](_0x56da('0x30'));_0x2c20c5[_0x56da('0x27')](_0x5bbf3a['getVoiceQueues']({'attributes':['id','name']}));_0x2c20c5['push'](_0x5bbf3a[_0x56da('0x35')]({'attributes':['id',_0x56da('0x2')]}));_0x2c20c5['push'](_0x5bbf3a[_0x56da('0x36')]({'attributes':['id','name']}));_0x2c20c5['push'](_0x5bbf3a['getSmsQueues']({'attributes':['id','name']}));_0x2c20c5[_0x56da('0x27')](_0x5bbf3a['getMailQueues']({'attributes':['id',_0x56da('0x2')]}));_0x2c20c5[_0x56da('0x27')](_0x5bbf3a['getOpenchannelQueues']({'attributes':['id',_0x56da('0x2')]}));break;}return BPromise['all'](_0x2c20c5);}})[_0x56da('0xc')](function(_0x1a0a67){if(_0x1a0a67&&_0x1a0a67[_0x56da('0x17')]){for(var _0x66c309=0x0;_0x66c309<_0x1a0a67[_0x56da('0x17')];_0x66c309+=0x1){for(var _0x4ffbf6=0x0;_0x4ffbf6<_0x1a0a67[_0x66c309]['length'];_0x4ffbf6+=0x1){switch(_0x66c309){case 0x0:joinOrLeaveQueues(_0x48151f,_0x5cba94,_0x56da('0x37'),_0x1a0a67[_0x66c309][_0x4ffbf6]);break;case 0x1:joinOrLeaveQueues(_0x48151f,_0x5cba94,_0x56da('0x38'),_0x1a0a67[_0x66c309][_0x4ffbf6]);break;case 0x2:joinOrLeaveQueues(_0x48151f,_0x5cba94,_0x56da('0x39'),_0x1a0a67[_0x66c309][_0x4ffbf6]);break;case 0x3:joinOrLeaveQueues(_0x48151f,_0x5cba94,_0x56da('0x3a'),_0x1a0a67[_0x66c309][_0x4ffbf6]);break;case 0x4:joinOrLeaveQueues(_0x48151f,_0x5cba94,_0x56da('0x3b'),_0x1a0a67[_0x66c309][_0x4ffbf6]);break;case 0x5:joinOrLeaveQueues(_0x48151f,_0x5cba94,_0x56da('0x3c'),_0x1a0a67[_0x66c309][_0x4ffbf6]);break;case 0x6:_0x48151f[_0x5cba94](util[_0x56da('0x18')](_0x56da('0x3d'),_0x1a0a67[_0x66c309][_0x4ffbf6][_0x56da('0x2')]));break;case 0x7:_0x48151f[_0x5cba94](util['format']('trunk:%s',_0x1a0a67[_0x66c309][_0x4ffbf6]['name']));break;case 0x8:_0x48151f[_0x5cba94](util[_0x56da('0x18')](_0x56da('0x3e'),_0x1a0a67[_0x66c309][_0x4ffbf6]['type'],_0x1a0a67[_0x66c309][_0x4ffbf6][_0x56da('0x2')]));break;case 0x9:_0x48151f[_0x5cba94](util[_0x56da('0x18')](_0x56da('0x19'),_0x1a0a67[_0x66c309][_0x4ffbf6][_0x56da('0x2')]));break;}}}}})[_0x56da('0xc')](function(){if(_0x5cba94===_0x56da('0x3f')){var _0x22be65=_[_0x56da('0x14')](_0xe9c853[_0x56da('0x1e')],'id');return _0xe9c853[_0x56da('0x40')](_0x22be65)[_0x56da('0xc')](function(){for(var _0x2a6348=0x0;_0x2a6348<_0x22be65[_0x56da('0x17')];_0x2a6348+=0x1){_0x2b6d49[_0x56da('0x41')](_0x56da('0x42'),{'ChatInteractionId':Number(_0x22be65[_0x2a6348]),'UserId':Number(_0xe9c853['id'])});}});}})[_0x56da('0xc')](function(){if(_0x5cba94===_0x56da('0x3f')){var _0x129ffa=_[_0x56da('0x14')](_0xe9c853[_0x56da('0x43')],'id');return _0xe9c853[_0x56da('0x44')](_0x129ffa)[_0x56da('0xc')](function(){for(var _0x35ecdc=0x0;_0x35ecdc<_0x129ffa[_0x56da('0x17')];_0x35ecdc+=0x1){_0x2b6d49[_0x56da('0x41')](_0x56da('0x45'),{'MailInteractionId':Number(_0x129ffa[_0x35ecdc]),'UserId':Number(_0xe9c853['id'])});}});}})[_0x56da('0xc')](function(){if(_0x5cba94===_0x56da('0x3f')){var _0x34e1ad=_['map'](_0xe9c853[_0x56da('0x1f')],'id');return _0xe9c853[_0x56da('0x46')](_0x34e1ad)[_0x56da('0xc')](function(){for(var _0x153bae=0x0;_0x153bae<_0x34e1ad[_0x56da('0x17')];_0x153bae+=0x1){_0x2b6d49[_0x56da('0x41')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x34e1ad[_0x153bae]),'UserId':Number(_0xe9c853['id'])});}});}})[_0x56da('0xc')](function(){if(_0x5cba94===_0x56da('0x3f')){var _0x4a1051=_['map'](_0xe9c853[_0x56da('0x21')],'id');return _0xe9c853['removeSmsInteractions'](_0x4a1051)[_0x56da('0xc')](function(){for(var _0xf1381f=0x0;_0xf1381f<_0x4a1051['length'];_0xf1381f+=0x1){_0x2b6d49[_0x56da('0x41')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x4a1051[_0xf1381f]),'UserId':Number(_0xe9c853['id'])});}});}})[_0x56da('0xc')](function(){if(_0x5cba94===_0x56da('0x3f')){var _0x16859b=_[_0x56da('0x14')](_0xe9c853[_0x56da('0x22')],'id');return _0xe9c853[_0x56da('0x47')](_0x16859b)[_0x56da('0xc')](function(){for(var _0x1d9e0d=0x0;_0x1d9e0d<_0x16859b[_0x56da('0x17')];_0x1d9e0d+=0x1){_0x2b6d49['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x16859b[_0x1d9e0d]),'UserId':Number(_0xe9c853['id'])});}});}})[_0x56da('0x48')](function(_0x569fff){_0x48151f[_0x56da('0x49')](_0x569fff);});}}function onDisconnect(_0x9b0a58,_0x2c87e1){joinOrLeave(_0x9b0a58,_0x56da('0x3f'),_0x2c87e1);}function onConnect(_0x4c2fee){joinOrLeave(_0x4c2fee,_0x56da('0x4a'));}exports[_0x56da('0x4b')]=function(_0x464b30){_0x464b30['on']('connection',function(_0x1d7a67){_0x1d7a67[_0x56da('0x4c')](0x0);_0x1d7a67['address']=_0x1d7a67[_0x56da('0x4d')][_0x56da('0x4e')][_0x56da('0x4f')]+':'+_0x1d7a67[_0x56da('0x4d')][_0x56da('0x4e')][_0x56da('0x50')];_0x1d7a67[_0x56da('0x51')]=new Date();_0x1d7a67[_0x56da('0x49')]=function(_0x2adf2e){console[_0x56da('0x49')](_0x56da('0x52')+_0x1d7a67[_0x56da('0x53')][_0x56da('0x2')]+'['+_0x1d7a67['address']+']',_0x2adf2e);};_0x1d7a67['on'](_0x56da('0x54'),function(){onDisconnect(_0x1d7a67,_0x464b30);_0x1d7a67[_0x56da('0x49')]('DISCONNECTED');});onConnect(_0x1d7a67);_0x1d7a67[_0x56da('0x49')](_0x56da('0x55'));});}; \ No newline at end of file +var _0xd960=['DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','name','role','agent','type','ivr','autoAssociation','VoiceQueues','SmsQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','where','telephone','Campaign','format','%s:queue:%s','Agents','length','handshake','query','User','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','user:%s','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','user','voice:outbound','ChatQueues','MailQueues','MailQueue','Telephones','Trunk','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','chat','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','user_has_openchannel_interactions:remove','join','default','setMaxListeners','request','connection','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','disconnect'];(function(_0x1ebca8,_0x213d86){var _0x5c2386=function(_0x171cc3){while(--_0x171cc3){_0x1ebca8['push'](_0x1ebca8['shift']());}};_0x5c2386(++_0x213d86);}(_0xd960,0x172));var _0x0d96=function(_0x1efe3f,_0x11caf3){_0x1efe3f=_0x1efe3f-0x0;var _0x236ec1=_0xd960[_0x1efe3f];return _0x236ec1;};'use strict';var _=require(_0x0d96('0x0'));var util=require('util');var BPromise=require(_0x0d96('0x1'));var db=require(_0x0d96('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x0d96('0x3')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x0d96('0x3'),_0x0d96('0x4')],'raw':!![],'where':{'role':_0x0d96('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x0d96('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x0d96('0x3')],'where':{'role':_0x0d96('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x0d96('0x6')],'where':{'type':_0x0d96('0x7')}};function getAssociatedResources(_0x377e00,_0x4d633e,_0x36169c){return db['UserProfileSection']['findOne']({'where':{'name':_0x377e00,'userProfileId':_0x4d633e},'raw':!![]})['then'](function(_0x5c0964){if(_0x5c0964){if(_0x5c0964[_0x0d96('0x8')]){switch(_0x377e00){case _0x0d96('0x9'):case'ChatQueues':case'FaxQueues':case _0x0d96('0xa'):case'MailQueues':case _0x0d96('0xb'):return db[_0x36169c][_0x0d96('0xc')](queryQueues);case'Telephones':return db[_0x36169c][_0x0d96('0xc')](queryTelephones);case _0x0d96('0xd'):return db[_0x36169c]['findAll'](queryTrunks);case _0x0d96('0xe'):return db[_0x36169c][_0x0d96('0xc')](queryCampaigns);}}else{return db[_0x0d96('0xf')][_0x0d96('0xc')]({'attributes':[_0x0d96('0x10')],'where':{'sectionId':_0x5c0964['id']},'raw':!![]})[_0x0d96('0x11')](function(_0x3a8b2f){if(_0x3a8b2f){var _0x3f4884={'where':{'id':_[_0x0d96('0x12')](_0x3a8b2f,_0x0d96('0x10'))},'raw':!![]};switch(_0x36169c){case'User':_0x3f4884[_0x0d96('0x13')]['role']=_0x0d96('0x14');break;case _0x0d96('0x15'):_0x3f4884[_0x0d96('0x13')][_0x0d96('0x6')]=_0x0d96('0x7');break;}return db[_0x36169c]['findAll'](_0x3f4884);}else{return[];}});}}else{return[];}})[_0x0d96('0x11')](function(_0x431498){return _0x431498;});}function joinOrLeaveQueues(_0x4eb02d,_0x100bdf,_0x5ef1a2,_0x5309ca){_0x4eb02d[_0x100bdf](util[_0x0d96('0x16')](_0x0d96('0x17'),_0x5ef1a2,_0x5309ca[_0x0d96('0x3')]));if(_0x5309ca[_0x0d96('0x18')]){for(var _0x56f622=0x0;_0x56f622<_0x5309ca['Agents'][_0x0d96('0x19')];_0x56f622+=0x1){_0x4eb02d[_0x100bdf](util[_0x0d96('0x16')]('user:%s',_0x5309ca[_0x0d96('0x18')][_0x56f622]['name']));}}}function joinOrLeave(_0x21ad80,_0x178e5d,_0x234287){var _0x741283;if(_0x21ad80[_0x0d96('0x1a')][_0x0d96('0x1b')]['id']){db[_0x0d96('0x1c')][_0x0d96('0x1d')]({'attributes':['id',_0x0d96('0x3'),'role',_0x0d96('0x1e')],'where':{'id':_0x21ad80[_0x0d96('0x1a')][_0x0d96('0x1b')]['id']},'include':[{'model':db[_0x0d96('0x1f')],'as':_0x0d96('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x0d96('0x21')],'as':_0x0d96('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x0d96('0x23')],'as':_0x0d96('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x0d96('0x25')],'as':_0x0d96('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x0d96('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0x0d96('0x11')](function(_0x5727a5){if(_0x5727a5){_0x741283=_0x5727a5;_0x21ad80[_0x178e5d](util[_0x0d96('0x16')](_0x0d96('0x28'),_0x5727a5[_0x0d96('0x3')]));var _0x4b8ad7=[];switch(_0x5727a5[_0x0d96('0x4')]){case _0x0d96('0x29'):_0x21ad80[_0x178e5d](_0x0d96('0x2a'));_0x21ad80[_0x178e5d]('voice:outbound');if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x0d96('0x2b')];}_0x4b8ad7[_0x0d96('0x2c')](db[_0x0d96('0x2d')]['findAll'](queryQueues));_0x4b8ad7[_0x0d96('0x2c')](db[_0x0d96('0x2e')][_0x0d96('0xc')](queryQueues));_0x4b8ad7[_0x0d96('0x2c')](db[_0x0d96('0x2f')][_0x0d96('0xc')](queryQueues));_0x4b8ad7[_0x0d96('0x2c')](db[_0x0d96('0x30')]['findAll'](queryQueues));_0x4b8ad7[_0x0d96('0x2c')](db['MailQueue'][_0x0d96('0xc')](queryQueues));_0x4b8ad7[_0x0d96('0x2c')](db[_0x0d96('0x31')][_0x0d96('0xc')](queryQueues));_0x4b8ad7[_0x0d96('0x2c')](db[_0x0d96('0x1c')][_0x0d96('0xc')](queryTelephones));_0x4b8ad7[_0x0d96('0x2c')](db['Trunk'][_0x0d96('0xc')](queryTrunks));_0x4b8ad7[_0x0d96('0x2c')](db[_0x0d96('0x15')]['findAll'](queryCampaigns));_0x4b8ad7[_0x0d96('0x2c')](db[_0x0d96('0x1c')]['findAll'](queryAgents));break;case _0x0d96('0x32'):_0x21ad80[_0x178e5d](_0x0d96('0x2a'));_0x21ad80[_0x178e5d](_0x0d96('0x33'));_0x4b8ad7[_0x0d96('0x2c')](getAssociatedResources(_0x0d96('0x9'),_0x5727a5[_0x0d96('0x1e')],_0x0d96('0x2d')));_0x4b8ad7['push'](getAssociatedResources(_0x0d96('0x34'),_0x5727a5[_0x0d96('0x1e')],_0x0d96('0x2e')));_0x4b8ad7[_0x0d96('0x2c')](getAssociatedResources('FaxQueues',_0x5727a5[_0x0d96('0x1e')],_0x0d96('0x2f')));_0x4b8ad7['push'](getAssociatedResources(_0x0d96('0xa'),_0x5727a5[_0x0d96('0x1e')],_0x0d96('0x30')));_0x4b8ad7[_0x0d96('0x2c')](getAssociatedResources(_0x0d96('0x35'),_0x5727a5[_0x0d96('0x1e')],_0x0d96('0x36')));_0x4b8ad7[_0x0d96('0x2c')](getAssociatedResources(_0x0d96('0xb'),_0x5727a5[_0x0d96('0x1e')],'OpenchannelQueue'));_0x4b8ad7[_0x0d96('0x2c')](getAssociatedResources(_0x0d96('0x37'),_0x5727a5[_0x0d96('0x1e')],_0x0d96('0x1c')));_0x4b8ad7[_0x0d96('0x2c')](getAssociatedResources(_0x0d96('0xd'),_0x5727a5['userProfileId'],_0x0d96('0x38')));_0x4b8ad7['push'](getAssociatedResources(_0x0d96('0xe'),_0x5727a5[_0x0d96('0x1e')],'Campaign'));_0x4b8ad7[_0x0d96('0x2c')](db[_0x0d96('0x1c')][_0x0d96('0xc')](queryAgents));break;case _0x0d96('0x5'):_0x21ad80[_0x178e5d](_0x0d96('0x2a'));_0x21ad80[_0x178e5d](_0x0d96('0x33'));_0x4b8ad7['push'](_0x5727a5['getVoiceQueues']({'attributes':['id',_0x0d96('0x3')]}));_0x4b8ad7[_0x0d96('0x2c')](_0x5727a5[_0x0d96('0x39')]({'attributes':['id','name']}));_0x4b8ad7[_0x0d96('0x2c')](_0x5727a5[_0x0d96('0x3a')]({'attributes':['id',_0x0d96('0x3')]}));_0x4b8ad7[_0x0d96('0x2c')](_0x5727a5[_0x0d96('0x3b')]({'attributes':['id',_0x0d96('0x3')]}));_0x4b8ad7['push'](_0x5727a5[_0x0d96('0x3c')]({'attributes':['id',_0x0d96('0x3')]}));_0x4b8ad7[_0x0d96('0x2c')](_0x5727a5['getOpenchannelQueues']({'attributes':['id',_0x0d96('0x3')]}));break;}return BPromise[_0x0d96('0x3d')](_0x4b8ad7);}})['then'](function(_0x1370cf){if(_0x1370cf&&_0x1370cf[_0x0d96('0x19')]){for(var _0x4ce340=0x0;_0x4ce340<_0x1370cf[_0x0d96('0x19')];_0x4ce340+=0x1){for(var _0x2f8267=0x0;_0x2f8267<_0x1370cf[_0x4ce340]['length'];_0x2f8267+=0x1){switch(_0x4ce340){case 0x0:joinOrLeaveQueues(_0x21ad80,_0x178e5d,'voice',_0x1370cf[_0x4ce340][_0x2f8267]);break;case 0x1:joinOrLeaveQueues(_0x21ad80,_0x178e5d,_0x0d96('0x3e'),_0x1370cf[_0x4ce340][_0x2f8267]);break;case 0x2:joinOrLeaveQueues(_0x21ad80,_0x178e5d,'fax',_0x1370cf[_0x4ce340][_0x2f8267]);break;case 0x3:joinOrLeaveQueues(_0x21ad80,_0x178e5d,_0x0d96('0x3f'),_0x1370cf[_0x4ce340][_0x2f8267]);break;case 0x4:joinOrLeaveQueues(_0x21ad80,_0x178e5d,_0x0d96('0x40'),_0x1370cf[_0x4ce340][_0x2f8267]);break;case 0x5:joinOrLeaveQueues(_0x21ad80,_0x178e5d,_0x0d96('0x41'),_0x1370cf[_0x4ce340][_0x2f8267]);break;case 0x6:_0x21ad80[_0x178e5d](util[_0x0d96('0x16')](_0x0d96('0x42'),_0x1370cf[_0x4ce340][_0x2f8267][_0x0d96('0x3')]));break;case 0x7:_0x21ad80[_0x178e5d](util['format'](_0x0d96('0x43'),_0x1370cf[_0x4ce340][_0x2f8267][_0x0d96('0x3')]));break;case 0x8:_0x21ad80[_0x178e5d](util[_0x0d96('0x16')](_0x0d96('0x44'),_0x1370cf[_0x4ce340][_0x2f8267][_0x0d96('0x6')],_0x1370cf[_0x4ce340][_0x2f8267][_0x0d96('0x3')]));break;case 0x9:_0x21ad80[_0x178e5d](util[_0x0d96('0x16')](_0x0d96('0x28'),_0x1370cf[_0x4ce340][_0x2f8267]['name']));break;}}}}})[_0x0d96('0x11')](function(){if(_0x178e5d==='leave'){var _0xa97359=_['map'](_0x741283[_0x0d96('0x20')],'id');return _0x741283[_0x0d96('0x45')](_0xa97359)[_0x0d96('0x11')](function(){for(var _0x2f984a=0x0;_0x2f984a<_0xa97359['length'];_0x2f984a+=0x1){_0x234287[_0x0d96('0x46')](_0x0d96('0x47'),{'ChatInteractionId':Number(_0xa97359[_0x2f984a]),'UserId':Number(_0x741283['id'])});}});}})['then'](function(){if(_0x178e5d===_0x0d96('0x48')){var _0x4a6481=_[_0x0d96('0x12')](_0x741283['MailInteractions'],'id');return _0x741283['removeMailInteractions'](_0x4a6481)['then'](function(){for(var _0x5af1f8=0x0;_0x5af1f8<_0x4a6481[_0x0d96('0x19')];_0x5af1f8+=0x1){_0x234287[_0x0d96('0x46')](_0x0d96('0x49'),{'MailInteractionId':Number(_0x4a6481[_0x5af1f8]),'UserId':Number(_0x741283['id'])});}});}})[_0x0d96('0x11')](function(){if(_0x178e5d===_0x0d96('0x48')){var _0xdf1fb1=_[_0x0d96('0x12')](_0x741283[_0x0d96('0x24')],'id');return _0x741283['removeFaxInteractions'](_0xdf1fb1)[_0x0d96('0x11')](function(){for(var _0x551d7b=0x0;_0x551d7b<_0xdf1fb1[_0x0d96('0x19')];_0x551d7b+=0x1){_0x234287[_0x0d96('0x46')](_0x0d96('0x4a'),{'FaxInteractionId':Number(_0xdf1fb1[_0x551d7b]),'UserId':Number(_0x741283['id'])});}});}})[_0x0d96('0x11')](function(){if(_0x178e5d==='leave'){var _0x305b51=_[_0x0d96('0x12')](_0x741283[_0x0d96('0x26')],'id');return _0x741283[_0x0d96('0x4b')](_0x305b51)[_0x0d96('0x11')](function(){for(var _0x161150=0x0;_0x161150<_0x305b51[_0x0d96('0x19')];_0x161150+=0x1){_0x234287['emit'](_0x0d96('0x4c'),{'SmsInteractionId':Number(_0x305b51[_0x161150]),'UserId':Number(_0x741283['id'])});}});}})[_0x0d96('0x11')](function(){if(_0x178e5d===_0x0d96('0x48')){var _0x221d37=_[_0x0d96('0x12')](_0x741283[_0x0d96('0x4d')],'id');return _0x741283['removeOpenchannelInteractions'](_0x221d37)[_0x0d96('0x11')](function(){for(var _0x34745c=0x0;_0x34745c<_0x221d37[_0x0d96('0x19')];_0x34745c+=0x1){_0x234287['emit'](_0x0d96('0x4e'),{'OpenchannelInteractionId':Number(_0x221d37[_0x34745c]),'UserId':Number(_0x741283['id'])});}});}})['catch'](function(_0x33f813){_0x21ad80['log'](_0x33f813);});}}function onDisconnect(_0x32e84b,_0x37395b){joinOrLeave(_0x32e84b,_0x0d96('0x48'),_0x37395b);}function onConnect(_0x159fc2){joinOrLeave(_0x159fc2,_0x0d96('0x4f'));}exports[_0x0d96('0x50')]=function(_0x453488){_0x453488['on']('connection',function(_0x7e5038){_0x7e5038[_0x0d96('0x51')](0x0);_0x7e5038['address']=_0x7e5038[_0x0d96('0x52')][_0x0d96('0x53')][_0x0d96('0x54')]+':'+_0x7e5038[_0x0d96('0x52')][_0x0d96('0x53')][_0x0d96('0x55')];_0x7e5038[_0x0d96('0x56')]=new Date();_0x7e5038['log']=function(_0x282aea){console[_0x0d96('0x57')](_0x0d96('0x58')+_0x7e5038['nsp'][_0x0d96('0x3')]+'['+_0x7e5038['address']+']',_0x282aea);};_0x7e5038['on'](_0x0d96('0x59'),function(){onDisconnect(_0x7e5038,_0x453488);_0x7e5038[_0x0d96('0x57')](_0x0d96('0x5a'));});onConnect(_0x7e5038);_0x7e5038['log'](_0x0d96('0x5b'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index ce18806..16b3a6e 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 _0x7346=['FaxInteraction','FaxMessage','MailInteraction','Mail','OpenchannelInteraction','Openchannel','request','then','info','EventManager','error','catch','Trigger,\x20%s','channel','event','direction','UserId','User','find','name','interface','format','incomingmessage','outgoingmessage','opened','closed','get','SIP/%s','default','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','jayson/promise','../logger','client','Chat','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Fax'];(function(_0xfba23c,_0x544960){var _0x8d18de=function(_0x3de1b2){while(--_0x3de1b2){_0xfba23c['push'](_0xfba23c['shift']());}};_0x8d18de(++_0x544960);}(_0x7346,0x1ee));var _0x6734=function(_0x5a39e5,_0x3ce014){_0x5a39e5=_0x5a39e5-0x0;var _0x4ca6ff=_0x7346[_0x5a39e5];return _0x4ca6ff;};'use strict';var util=require(_0x6734('0x0'));var db=require(_0x6734('0x1'))['db'];var jayson=require(_0x6734('0x2'));var logger=require(_0x6734('0x3'))('triggers');var client=jayson[_0x6734('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0x6734('0x5'),'model':'ChatInteraction','event':_0x6734('0x6'),'condition':_0x6734('0x7'),'callback':afterCreate},{'channel':_0x6734('0x5'),'model':'ChatInteraction','event':_0x6734('0x8'),'condition':_0x6734('0x9'),'callback':afterUpdate},{'channel':_0x6734('0x5'),'model':_0x6734('0xa'),'event':_0x6734('0x6'),'condition':_0x6734('0xb'),'callback':afterCreateMessage},{'channel':_0x6734('0xc'),'model':_0x6734('0xd'),'event':_0x6734('0x6'),'condition':_0x6734('0x7'),'callback':afterCreate},{'channel':_0x6734('0xc'),'model':_0x6734('0xd'),'event':'afterUpdate','condition':_0x6734('0x9'),'callback':afterUpdate},{'channel':_0x6734('0xc'),'model':_0x6734('0xe'),'event':_0x6734('0x6'),'condition':_0x6734('0xb'),'callback':afterCreateMessage},{'channel':_0x6734('0xf'),'model':_0x6734('0x10'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x6734('0xf'),'model':_0x6734('0x10'),'event':_0x6734('0x8'),'condition':_0x6734('0x9'),'callback':afterUpdate},{'channel':_0x6734('0xf'),'model':_0x6734('0x11'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x6734('0x12'),'event':'afterCreate','condition':_0x6734('0x7'),'callback':afterCreate},{'channel':'Mail','model':_0x6734('0x12'),'event':_0x6734('0x8'),'condition':_0x6734('0x9'),'callback':afterUpdate},{'channel':_0x6734('0x13'),'model':'MailMessage','event':_0x6734('0x6'),'condition':_0x6734('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x6734('0x14'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x6734('0x15'),'model':_0x6734('0x14'),'event':_0x6734('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x6734('0x15'),'model':'OpenchannelMessage','event':_0x6734('0x6'),'condition':_0x6734('0xb'),'callback':afterCreateMessage}];function request(_0x416e65){return client[_0x6734('0x16')]('EventManager',_0x416e65)[_0x6734('0x17')](function(_0x3cd1e7){logger[_0x6734('0x18')]('Trigger,\x20%s',_0x6734('0x19'),_0x3cd1e7);if(_0x3cd1e7[_0x6734('0x1a')]){if(_0x3cd1e7['error']['code']===0x1f4){logger['error']('Trigger,\x20%s',_0x6734('0x19'),_0x3cd1e7[_0x6734('0x1a')]);}}})[_0x6734('0x1b')](function(_0x4cd66f){logger['error'](_0x6734('0x1c'),_0x6734('0x19'),_0x4cd66f);});}function afterCreateMessage(_0xc4845,_0x4dc09c){return function(_0x224ee6,_0x1ec0fb){_0x224ee6=_0x224ee6['get']({'plain':!![]});_0x224ee6[_0x6734('0x1d')]=_0xc4845;_0x224ee6[_0x6734('0x1e')]=_0x224ee6[_0x6734('0x1f')];if(_0x224ee6[_0x6734('0x20')]){return db[_0x6734('0x21')][_0x6734('0x22')]({'where':{'id':_0x224ee6[_0x6734('0x20')]},'attributes':['id',_0x6734('0x23')],'raw':!![]})[_0x6734('0x17')](function(_0x494a9e){_0x224ee6[_0x6734('0x24')]=util[_0x6734('0x25')]('SIP/%s',_0x494a9e[_0x6734('0x23')]);_0x224ee6[_0x6734('0x1d')]=_0xc4845;return request({'event':_0x6734('0x26'),'message':_0x224ee6});})[_0x6734('0x1b')](function(_0xfee982){console['error'](_0xfee982);});}else{return request({'event':_0x6734('0x27'),'message':_0x224ee6});}};}function afterCreate(_0x21617e,_0x2d6d14){return function(_0xaa34fb,_0x5de348){_0xaa34fb=_0xaa34fb['get']({'plain':!![]});_0xaa34fb[_0x6734('0x1d')]=_0x21617e;_0xaa34fb['event']=_0x6734('0x28');return request({'event':_0x2d6d14,'message':_0xaa34fb});};}function afterUpdate(_0x28cc11,_0x28f784){return function(_0x4338dc,_0x35f069){if(_0x4338dc['changed'](_0x6734('0x29'))&&_0x4338dc[_0x6734('0x29')]){_0x4338dc=_0x4338dc[_0x6734('0x2a')]({'plain':!![]});_0x4338dc['channel']=_0x28cc11;_0x4338dc[_0x6734('0x1e')]=_0x6734('0x29');if(_0x4338dc['UserId']){return db[_0x6734('0x21')]['find']({'where':{'id':_0x4338dc[_0x6734('0x20')]},'attributes':['id',_0x6734('0x23')],'raw':!![]})[_0x6734('0x17')](function(_0x493789){_0x4338dc[_0x6734('0x24')]=util[_0x6734('0x25')](_0x6734('0x2b'),_0x493789[_0x6734('0x23')]);return request({'event':_0x28f784,'message':_0x4338dc});})[_0x6734('0x1b')](function(_0x2fa4a4){console[_0x6734('0x1a')](_0x2fa4a4);});}else{return request({'event':_0x28f784,'message':_0x4338dc});}}};}exports[_0x6734('0x2c')]=function(){for(var _0x428e61=0x0;_0x428e61=_0x1eae37['agents']){throw Error(_0x55a6('0x17'));}_0x5aadc2(_0x2deb76);})[_0x55a6('0x18')](function(_0x6a872b){_0x424a65(_0x6a872b);});});}; \ No newline at end of file +var _0x6895=['chat','sms','openchannel','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','voice'];(function(_0x122128,_0x10c398){var _0x14de9b=function(_0x1ccb21){while(--_0x1ccb21){_0x122128['push'](_0x122128['shift']());}};_0x14de9b(++_0x10c398);}(_0x6895,0x6a));var _0x5689=function(_0xa97800,_0x1cc164){_0xa97800=_0xa97800-0x0;var _0x372505=_0x6895[_0xa97800];return _0x372505;};'use strict';var _=require(_0x5689('0x0'));var BPromise=require(_0x5689('0x1'));var db=require(_0x5689('0x2'))['db'];var util=require('./license/util');var channels=[_0x5689('0x3'),'mail',_0x5689('0x4'),'fax',_0x5689('0x5'),_0x5689('0x6')];exports[_0x5689('0x7')]=function(){return channels;};exports[_0x5689('0x8')]=function(_0x375d17){_0x375d17=_0x375d17['toLowerCase']();return _[_0x5689('0x9')](channels,_0x375d17);};exports[_0x5689('0xa')]=function(_0x22adbe,_0x4a5bd6,_0x286736,_0x4ca5c6){var _0x499976={'loginAttempts':_0x4a5bd6,'blocked':_0x286736};if(!_[_0x5689('0xb')](_0x4ca5c6)){_0x499976[_0x5689('0xc')]=_0x4ca5c6;}return _0x22adbe[_0x5689('0xd')](_0x499976);};exports[_0x5689('0xe')]=function(_0x607ecb){return new BPromise(function(_0x2530fb,_0x1b93d6){var _0x156499=0x0;if(_0x607ecb[_0x5689('0xf')]!==_0x5689('0x10')){_0x2530fb(_0x607ecb);}db[_0x5689('0x11')][_0x5689('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x607ecb['id']}}})[_0x5689('0x13')](function(_0x57483e){_0x156499=_0x57483e;return util[_0x5689('0xe')]();})[_0x5689('0x13')](function(_0x1b3cc5){if(_0x1b3cc5&&_0x1b3cc5['agents']&&_0x156499>=_0x1b3cc5[_0x5689('0x14')]){throw Error(_0x5689('0x15'));}_0x2530fb(_0x607ecb);})['catch'](function(_0x36ee56){_0x1b93d6(_0x36ee56);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 6823bac..2f71cd0 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87d9=['exports','404','status','send'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x87d9,0x8c));var _0x987d=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0x87d9[_0x4a5494];return _0x57cbb5;};'use strict';module[_0x987d('0x0')][0x194]=function pageNotFound(_0x102502,_0x2fb2e2){var _0xdc834a=_0x987d('0x1');var _0x4d5603=0x194;var _0x3a4813={'status':_0x4d5603};_0x2fb2e2[_0x987d('0x2')](_0x3a4813['status']);_0x2fb2e2['render'](_0xdc834a,{},function(_0x2f0ae8,_0x137c85){if(_0x2f0ae8){return _0x2fb2e2[_0x987d('0x2')](_0x3a4813[_0x987d('0x2')])['json'](_0x3a4813);}_0x2fb2e2[_0x987d('0x3')](_0x137c85);});}; \ No newline at end of file +var _0x3723=['exports','render','status','json'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3723,0x1e4));var _0x3372=function(_0x4c6477,_0x3faf12){_0x4c6477=_0x4c6477-0x0;var _0x4aaf32=_0x3723[_0x4c6477];return _0x4aaf32;};'use strict';module[_0x3372('0x0')][0x194]=function pageNotFound(_0x509d29,_0x25d5f0){var _0x1040a9='404';var _0x59abbb=0x194;var _0xf00efd={'status':_0x59abbb};_0x25d5f0['status'](_0xf00efd['status']);_0x25d5f0[_0x3372('0x1')](_0x1040a9,{},function(_0x2d3552,_0x210ac9){if(_0x2d3552){return _0x25d5f0[_0x3372('0x2')](_0xf00efd['status'])[_0x3372('0x3')](_0xf00efd);}_0x25d5f0['send'](_0x210ac9);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 2bf9211..a754aec 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2111=['VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','../api/team/team.model','License','Campaign','Migration','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteraction','SmsInteraction','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','belongsTo','userProfileId','ChatGroup','Groups','chat_group_has_users','Contacts','belongsToMany','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','ChatQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','CmList','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_sms_accounts','SquareProjects','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailbox','mailboxuser','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailAccountId','Imap','Smtp','Disposition','Answers','Messages','Interactions','List','TemplateId','Agents','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','restrict','TagId','FaxAccount','Dispositions','FaxAccountId','FaxMessage','ListId','FaxInteractionId','fax_interaction_has_tags','Tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CompanyId','Hoppers','Company','cm_user_has_contacts','cm_contact_has_tags','Agent','CampaignId','OwnerId','CmHopperBlack','All','OneAll','AutomationAllId','Condition','Any','OneAny','AutomationAnyId','Intervals','Extensions','FaxApplications','SmsApplications','CustomReportId','VoiceMusicOnHold','Mohs','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','DefaultReportId','MetricId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Description','VariableId','Configurations','Fields','Field','int_desk_configuration_has_tags','ZohoAccount','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Account','FreshsalesField','ToId','SessionId','ProjectId','user_has_square_projects','MailQueues','team_has_openchannel_queues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromUserId','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','UserProfileSections','UserProfileSection','Resources','sectionId','exports','path','../config/environment','sequelize','lodash','jstz','determine','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','motion2','utf8','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxApplication','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model'];(function(_0x37bb5c,_0x268d87){var _0x4b63f0=function(_0x11a3b3){while(--_0x11a3b3){_0x37bb5c['push'](_0x37bb5c['shift']());}};_0x4b63f0(++_0x268d87);}(_0x2111,0x11e));var _0x1211=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x2111[_0x51c819];return _0x15c5d2;};'use strict';var path=require(_0x1211('0x0'));var config=require(_0x1211('0x1'));var Sequelize=require(_0x1211('0x2'));var _=require(_0x1211('0x3'));var jstz=require(_0x1211('0x4'));var timezone=jstz[_0x1211('0x5')]();config[_0x1211('0x2')]=_['defaultsDeep'](config[_0x1211('0x2')],{'database':'motion2','username':_0x1211('0x6'),'password':_0x1211('0x7'),'options':{'host':_0x1211('0x8'),'port':0xcea,'dialect':_0x1211('0x9'),'dialectOptions':{'charset':_0x1211('0xa')},'logging':![],'timezone':timezone[_0x1211('0xb')](),'define':{'charset':'utf8','collate':_0x1211('0xc')}}});config[_0x1211('0xd')]=_['defaultsDeep'](config[_0x1211('0xd')],{'database':_0x1211('0xe'),'username':_0x1211('0x6'),'password':_0x1211('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x1211('0x9'),'dialectOptions':{'charset':_0x1211('0xa')},'logging':![],'timezone':timezone[_0x1211('0xb')](),'define':{'charset':_0x1211('0xf'),'collate':_0x1211('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1211('0x2')]['database'],config[_0x1211('0x2')][_0x1211('0x10')],config['sequelize'][_0x1211('0x11')],config[_0x1211('0x2')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1211('0xd')]['database'],config['sequelizeHistory'][_0x1211('0x10')],config[_0x1211('0xd')][_0x1211('0x11')],config[_0x1211('0xd')][_0x1211('0x12')])};db[_0x1211('0x13')]=db[_0x1211('0x2')]['import'](_0x1211('0x14'));db[_0x1211('0x15')]=db['sequelize']['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x17'));db[_0x1211('0x18')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x19'));db['VoiceMusicOnHold']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x1a'));db[_0x1211('0x1b')]=db['sequelize'][_0x1211('0x16')]('../api/voiceQueue/voiceQueue.model');db[_0x1211('0x1c')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x1d'));db[_0x1211('0x1e')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x1f'));db[_0x1211('0x20')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x21'));db['VoiceMailMessage']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x22'));db[_0x1211('0x23')]=db[_0x1211('0x2')]['import'](_0x1211('0x24'));db['VoiceDialReport']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x25'));db[_0x1211('0x26')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x27'));db[_0x1211('0x28')]=db[_0x1211('0x2')]['import'](_0x1211('0x29'));db[_0x1211('0x2a')]=db[_0x1211('0x2')]['import'](_0x1211('0x2b'));db['Trunk']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x2c'));db[_0x1211('0x2d')]=db[_0x1211('0x2')]['import'](_0x1211('0x2e'));db['UserVoiceQueueRt']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x2f'));db[_0x1211('0x30')]=db[_0x1211('0x2')]['import'](_0x1211('0x31'));db[_0x1211('0x32')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x33'));db[_0x1211('0x34')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x35'));db[_0x1211('0x36')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x37'));db[_0x1211('0x38')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x39'));db[_0x1211('0x3a')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x3b'));db['MailServerOut']=db['sequelize'][_0x1211('0x16')](_0x1211('0x3c'));db[_0x1211('0x3d')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/mailAccount/mailAccount.model');db[_0x1211('0x3e')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x3f'));db[_0x1211('0x40')]=db[_0x1211('0x2')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0x1211('0x41')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x42'));db[_0x1211('0x43')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x44'));db[_0x1211('0x45')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x46'));db[_0x1211('0x47')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x48'));db[_0x1211('0x49')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x4a'));db[_0x1211('0x4b')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x4c'));db['FaxAccount']=db['sequelize']['import']('../api/faxAccount/faxAccount.model');db[_0x1211('0x4d')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0x1211('0x2')][_0x1211('0x16')]('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db['sequelize'][_0x1211('0x16')](_0x1211('0x4e'));db[_0x1211('0x4f')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x50'));db[_0x1211('0x51')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x52'));db[_0x1211('0x53')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x54'));db[_0x1211('0x55')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x56'));db['SmsInteraction']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x57'));db[_0x1211('0x58')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/smsMessage/smsMessage.model');db[_0x1211('0x59')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x5a'));db[_0x1211('0x5b')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/openchannelAccount/openchannelAccount.model');db[_0x1211('0x5c')]=db[_0x1211('0x2')]['import'](_0x1211('0x5d'));db['OpenchannelInteraction']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x5e'));db['OpenchannelMessage']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x5f'));db[_0x1211('0x60')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x61'));db[_0x1211('0x62')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x63'));db[_0x1211('0x64')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x65'));db[_0x1211('0x66')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x1211('0x2')]['import'](_0x1211('0x67'));db[_0x1211('0x68')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x69'));db[_0x1211('0x6a')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x6b'));db[_0x1211('0x6c')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x6d'));db['ChatGroup']=db[_0x1211('0x2')][_0x1211('0x16')]('../api/chatGroup/chatGroup.model');db[_0x1211('0x6e')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x6f'));db[_0x1211('0x70')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/cmCompany/cmCompany.model');db[_0x1211('0x71')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x72'));db[_0x1211('0x73')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x74'));db['CmHopperBlack']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x75'));db[_0x1211('0x76')]=db[_0x1211('0x2')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x1211('0x77')]=db[_0x1211('0x2')]['import'](_0x1211('0x78'));db[_0x1211('0x79')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x7a'));db[_0x1211('0x7b')]=db[_0x1211('0x2')]['import'](_0x1211('0x7c'));db[_0x1211('0x7d')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x7e'));db[_0x1211('0x7f')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x80'));db[_0x1211('0x81')]=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x82'));db['Condition']=db['sequelize'][_0x1211('0x16')](_0x1211('0x83'));db[_0x1211('0x84')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x85'));db[_0x1211('0x86')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x87'));db[_0x1211('0x88')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/cdr/cdr.model');db[_0x1211('0x89')]=db[_0x1211('0x2')]['import'](_0x1211('0x8a'));db[_0x1211('0x8b')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x8c'));db[_0x1211('0x8d')]=db[_0x1211('0x2')]['import'](_0x1211('0x8e'));db[_0x1211('0x8f')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x90'));db[_0x1211('0x91')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x92'));db['Trigger']=db['sequelize']['import'](_0x1211('0x93'));db[_0x1211('0x94')]=db['sequelize']['import'](_0x1211('0x95'));db[_0x1211('0x96')]=db[_0x1211('0x2')]['import']('../api/integration/integration.model');db[_0x1211('0x97')]=db['sequelize'][_0x1211('0x16')](_0x1211('0x98'));db[_0x1211('0x99')]=db[_0x1211('0x2')]['import'](_0x1211('0x9a'));db[_0x1211('0x9b')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x9c'));db['AnalyticExtractedReport']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0x9d'));db[_0x1211('0x9e')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0x1211('0x2')][_0x1211('0x16')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x1211('0x9f')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xa0'));db[_0x1211('0xa1')]=db['sequelize'][_0x1211('0x16')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x1211('0xa2')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xa3'));db[_0x1211('0xa4')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xa5'));db[_0x1211('0xa6')]=db[_0x1211('0x2')]['import'](_0x1211('0xa7'));db[_0x1211('0xa8')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xa9'));db[_0x1211('0xaa')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xab'));db[_0x1211('0xac')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xad'));db[_0x1211('0xae')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xaf'));db[_0x1211('0xb0')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xb1'));db['ZohoAccount']=db[_0x1211('0x2')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0x1211('0xb2')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xb3'));db[_0x1211('0xb4')]=db['sequelize'][_0x1211('0x16')](_0x1211('0xb5'));db[_0x1211('0xb6')]=db[_0x1211('0x2')]['import'](_0x1211('0xb7'));db['ZendeskConfiguration']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xb8'));db['ZendeskField']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xb9'));db[_0x1211('0xba')]=db['sequelize'][_0x1211('0x16')](_0x1211('0xbb'));db[_0x1211('0xbc')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x1211('0x2')][_0x1211('0x16')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x1211('0xbd')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xbe'));db[_0x1211('0xbf')]=db[_0x1211('0x2')]['import'](_0x1211('0xc0'));db[_0x1211('0xc1')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/intVtigerField/intVtigerField.model');db[_0x1211('0xc2')]=db['sequelize'][_0x1211('0x16')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xc3'));db[_0x1211('0xc4')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xc5'));db['Dynamics365Account']=db[_0x1211('0x2')]['import'](_0x1211('0xc6'));db[_0x1211('0xc7')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xc8'));db[_0x1211('0xc9')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x1211('0xca')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xcb'));db[_0x1211('0xcc')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xcd'));db['FreshsalesField']=db['sequelize'][_0x1211('0x16')](_0x1211('0xce'));db[_0x1211('0x96')]=db['sequelize'][_0x1211('0x16')](_0x1211('0xcf'));db[_0x1211('0xd0')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/network/network.model');db[_0x1211('0xd1')]=db['sequelize'][_0x1211('0x16')](_0x1211('0xd2'));db['ChatInternalMessage']=db['sequelize'][_0x1211('0x16')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x1211('0xd3')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xd4'));db[_0x1211('0xd5')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xd6'));db[_0x1211('0xd7')]=db[_0x1211('0x2')]['import'](_0x1211('0xd8'));db[_0x1211('0xd9')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xda'));db[_0x1211('0xdb')]=db[_0x1211('0x2')]['import']('../api/squareReport/squareReport.model');db[_0x1211('0xdc')]=db[_0x1211('0x2')]['import'](_0x1211('0xdd'));db[_0x1211('0xde')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xdf'));db[_0x1211('0xe0')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xe1'));db[_0x1211('0xe2')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xe3'));db[_0x1211('0xe4')]=db[_0x1211('0x2')]['import']('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x1211('0x2')]['import'](_0x1211('0xe5'));db['SquareMessage']=db[_0x1211('0x2')]['import'](_0x1211('0xe6'));db['Team']=db[_0x1211('0x2')]['import'](_0x1211('0xe7'));db[_0x1211('0xe8')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/license/license.model');db[_0x1211('0xe9')]=db['sequelize'][_0x1211('0x16')]('../api/campaign/campaign.model');db[_0x1211('0xea')]=db[_0x1211('0x2')]['import']('../api/migration/migration.model');db[_0x1211('0xeb')]=db[_0x1211('0x2')]['import'](_0x1211('0xec'));db[_0x1211('0xed')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/plugin/plugin.model');db[_0x1211('0xee')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xef'));db[_0x1211('0xf0')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xf1'));db['FaxTransferReport']=db['sequelize'][_0x1211('0x16')](_0x1211('0xf2'));db[_0x1211('0xf3')]=db['sequelize']['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x1211('0xf4')]=db[_0x1211('0x2')][_0x1211('0x16')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x1211('0x2')]['import'](_0x1211('0xf5'));db[_0x1211('0xf6')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xf7'));db[_0x1211('0xf8')]=db['sequelize'][_0x1211('0x16')](_0x1211('0xf9'));db['UserProfileSection']=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xfa'));db[_0x1211('0xfb')]=db[_0x1211('0x2')][_0x1211('0x16')](_0x1211('0xfc'));db['User'][_0x1211('0xfd')](db[_0x1211('0x20')],{'as':'VoiceMail','onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x13')][_0x1211('0x100')](db['VoiceRecording'],{'as':_0x1211('0x101'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x13')]['hasMany'](db[_0x1211('0x102')],{'as':_0x1211('0x103'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x13')][_0x1211('0x100')](db[_0x1211('0x18')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0x1211('0x13')][_0x1211('0x100')](db[_0x1211('0x76')],{'as':_0x1211('0x104'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x13')]['hasMany'](db[_0x1211('0x77')],{'as':_0x1211('0x105'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x13')][_0x1211('0x100')](db[_0x1211('0x79')],{'as':'ReportAgentPreview','foreignKey':_0x1211('0xff')});db[_0x1211('0x13')][_0x1211('0x100')](db[_0x1211('0x106')],{'as':_0x1211('0x107'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x13')][_0x1211('0x100')](db[_0x1211('0x108')],{'as':'ChatInteractions','foreignKey':_0x1211('0xff')});db[_0x1211('0x13')][_0x1211('0x100')](db[_0x1211('0x109')],{'as':_0x1211('0x10a'),'foreignKey':_0x1211('0xff')});db['User'][_0x1211('0x100')](db[_0x1211('0x10b')],{'as':_0x1211('0x10c'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x13')][_0x1211('0x100')](db['MailInteraction'],{'as':_0x1211('0x10d'),'foreignKey':_0x1211('0xff')});db['User'][_0x1211('0x10e')](db['UserProfile'],{'as':_0x1211('0xf8'),'foreignKey':_0x1211('0x10f')});db[_0x1211('0x13')]['belongsToMany'](db[_0x1211('0x110')],{'as':_0x1211('0x111'),'through':_0x1211('0x112')});db[_0x1211('0x13')]['belongsToMany'](db[_0x1211('0x71')],{'as':_0x1211('0x113'),'through':'cm_user_has_contacts'});db[_0x1211('0x13')][_0x1211('0x114')](db['CmList'],{'as':'Lists','through':_0x1211('0x115')});db[_0x1211('0x13')][_0x1211('0x114')](db[_0x1211('0x116')],{'through':_0x1211('0x117')});db[_0x1211('0x13')]['belongsToMany'](db[_0x1211('0x41')],{'as':_0x1211('0x10d'),'through':_0x1211('0x118')});db[_0x1211('0x13')][_0x1211('0x114')](db[_0x1211('0x108')],{'as':'ChatInteractions','through':_0x1211('0x119')});db[_0x1211('0x13')][_0x1211('0x114')](db[_0x1211('0x10b')],{'as':_0x1211('0x10c'),'through':'user_has_fax_interactions'});db['User'][_0x1211('0x114')](db[_0x1211('0x109')],{'as':'SmsInteractions','through':_0x1211('0x11a')});db[_0x1211('0x13')][_0x1211('0x114')](db['OpenchannelInteraction'],{'as':_0x1211('0x107'),'through':_0x1211('0x11b')});db[_0x1211('0x13')][_0x1211('0x114')](db['VoiceQueue'],{'as':_0x1211('0x11c'),'through':'UserVoiceQueue','required':![]});db[_0x1211('0x13')][_0x1211('0x114')](db[_0x1211('0x3e')],{'as':'MailQueues','through':_0x1211('0x34'),'required':![]});db[_0x1211('0x13')][_0x1211('0x114')](db[_0x1211('0x6c')],{'as':_0x1211('0x11d'),'through':_0x1211('0x32'),'required':![],'hooks':!![]});db[_0x1211('0x13')][_0x1211('0x114')](db[_0x1211('0x4f')],{'as':'FaxQueues','through':_0x1211('0x36'),'required':![]});db['User'][_0x1211('0x114')](db[_0x1211('0x59')],{'as':_0x1211('0x11e'),'through':_0x1211('0x38'),'required':![]});db[_0x1211('0x13')]['belongsToMany'](db[_0x1211('0x60')],{'as':_0x1211('0x11f'),'through':_0x1211('0x120'),'required':![]});db[_0x1211('0x13')]['belongsToMany'](db[_0x1211('0x121')],{'through':_0x1211('0x115')});db[_0x1211('0x13')][_0x1211('0x114')](db[_0x1211('0xf6')],{'as':_0x1211('0x122'),'through':_0x1211('0x123'),'required':![]});db['User'][_0x1211('0x114')](db[_0x1211('0x62')],{'as':_0x1211('0x124'),'through':_0x1211('0x125')});db[_0x1211('0x13')][_0x1211('0x114')](db['FaxAccount'],{'as':_0x1211('0x126'),'through':'user_has_fax_accounts'});db[_0x1211('0x13')]['belongsToMany'](db[_0x1211('0x3d')],{'as':_0x1211('0x127'),'through':_0x1211('0x128')});db[_0x1211('0x13')]['belongsToMany'](db[_0x1211('0x5b')],{'as':_0x1211('0x129'),'through':'user_has_openchannel_accounts'});db[_0x1211('0x13')][_0x1211('0x114')](db[_0x1211('0x53')],{'as':'SmsAccounts','through':_0x1211('0x12a')});db[_0x1211('0x13')][_0x1211('0x114')](db[_0x1211('0xe4')],{'as':_0x1211('0x12b'),'through':'user_has_square_projects'});db[_0x1211('0x15')][_0x1211('0x100')](db[_0x1211('0x18')],{'as':'SpiedAgents','onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x12c')});db[_0x1211('0x12d')][_0x1211('0x100')](db[_0x1211('0x18')],{'onDelete':_0x1211('0xfe')});db[_0x1211('0x18')][_0x1211('0x100')](db[_0x1211('0x18')],{'as':_0x1211('0x12e'),'onDelete':'cascade'});db['VoiceMusicOnHold']['belongsToMany'](db['Sound'],{'as':_0x1211('0x12f'),'through':_0x1211('0x130')});db[_0x1211('0x1b')][_0x1211('0x100')](db[_0x1211('0x102')],{'as':_0x1211('0x131'),'foreignKey':_0x1211('0x132')});db['VoiceQueue']['hasMany'](db[_0x1211('0x73')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x1211('0x100')](db[_0x1211('0x76')],{'as':_0x1211('0x104'),'foreignKey':_0x1211('0x132')});db[_0x1211('0x1b')][_0x1211('0x100')](db[_0x1211('0x77')],{'as':_0x1211('0x133'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db['ReportAgentPreview'],{'as':_0x1211('0x79'),'foreignKey':_0x1211('0x132')});db[_0x1211('0x1b')][_0x1211('0x100')](db['CmHopperBlack'],{'as':_0x1211('0x134'),'foreignKey':_0x1211('0x132')});db['VoiceQueue'][_0x1211('0x100')](db[_0x1211('0xd7')],{'as':_0x1211('0x135'),'foreignKey':_0x1211('0x132')});db[_0x1211('0x1b')]['belongsTo'](db[_0x1211('0x136')],{'as':_0x1211('0x136'),'foreignKey':_0x1211('0x137')});db[_0x1211('0x1b')]['belongsTo'](db[_0x1211('0x136')],{'as':_0x1211('0x138'),'foreignKey':_0x1211('0x139')});db[_0x1211('0x1b')][_0x1211('0x10e')](db[_0x1211('0x84')],{'as':_0x1211('0x84'),'foreignKey':_0x1211('0x13a')});db[_0x1211('0x1b')][_0x1211('0x10e')](db[_0x1211('0x86')],{'as':_0x1211('0x13b'),'foreignKey':_0x1211('0x13c')});db[_0x1211('0x1b')][_0x1211('0x114')](db[_0x1211('0x121')],{'as':_0x1211('0x13d'),'through':_0x1211('0x13e')});db[_0x1211('0x1b')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':'Agents','through':_0x1211('0x30')});db[_0x1211('0x1b')][_0x1211('0x114')](db[_0x1211('0x116')],{'as':_0x1211('0x13f'),'through':_0x1211('0x140')});db[_0x1211('0x1b')]['belongsToMany'](db[_0x1211('0x121')],{'as':_0x1211('0x141'),'through':_0x1211('0x142')});db[_0x1211('0x1c')][_0x1211('0x10e')](db[_0x1211('0x13')],{'as':_0x1211('0x13'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x1e')][_0x1211('0x10e')](db[_0x1211('0x13')],{'as':_0x1211('0x13'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x20')][_0x1211('0x100')](db[_0x1211('0x143')],{'as':'Messages','onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x1211('0x144')});db['VoiceMailMessage']['belongsTo'](db[_0x1211('0x20')],{'foreignKey':_0x1211('0x145'),'targetKey':'mailbox'});db[_0x1211('0x23')]['hasMany'](db[_0x1211('0x28')],{'as':_0x1211('0x146'),'foreignKey':'uniqueid','constraints':![]});db[_0x1211('0x23')][_0x1211('0x100')](db['VoiceAgentReport'],{'as':_0x1211('0x147'),'foreignKey':_0x1211('0x148'),'constraints':![]});db[_0x1211('0x23')][_0x1211('0x10e')](db['User'],{'as':_0x1211('0x13'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x23')]['belongsTo'](db[_0x1211('0x71')],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db['MailServerIn'][_0x1211('0x10e')](db[_0x1211('0x3d')],{'as':'MailAccount','foreignKey':_0x1211('0x14b')});db['MailServerOut'][_0x1211('0x10e')](db[_0x1211('0x3d')],{'as':_0x1211('0x3d'),'foreignKey':_0x1211('0x14b')});db[_0x1211('0x3d')][_0x1211('0xfd')](db[_0x1211('0x3a')],{'as':_0x1211('0x14c'),'onDelete':_0x1211('0xfe')});db[_0x1211('0x3d')]['hasOne'](db['MailServerOut'],{'as':_0x1211('0x14d'),'onDelete':_0x1211('0xfe')});db['MailAccount'][_0x1211('0x100')](db[_0x1211('0x14e')],{'as':'Dispositions','foreignKey':_0x1211('0x14b')});db[_0x1211('0x3d')][_0x1211('0x100')](db[_0x1211('0x81')],{'as':_0x1211('0x14f'),'foreignKey':_0x1211('0x14b')});db['MailAccount'][_0x1211('0x100')](db[_0x1211('0x43')],{'as':_0x1211('0x150'),'foreignKey':'MailAccountId'});db[_0x1211('0x3d')]['hasMany'](db['MailInteraction'],{'as':_0x1211('0x151')});db[_0x1211('0x3d')]['hasMany'](db[_0x1211('0x45')],{'as':_0x1211('0x12e')});db['MailAccount']['belongsTo'](db[_0x1211('0x121')],{'as':_0x1211('0x152'),'foreignKey':'ListId'});db[_0x1211('0x3d')][_0x1211('0x10e')](db[_0x1211('0x91')],{'as':_0x1211('0x91'),'foreignKey':_0x1211('0x153')});db[_0x1211('0x3d')][_0x1211('0x10e')](db[_0x1211('0x86')],{'as':_0x1211('0x13b'),'foreignKey':_0x1211('0x13c')});db['MailAccount']['belongsToMany'](db[_0x1211('0x13')],{'as':_0x1211('0x154'),'through':_0x1211('0x128')});db[_0x1211('0x3e')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x154'),'through':_0x1211('0x34')});db['MailQueue'][_0x1211('0x114')](db[_0x1211('0x116')],{'through':_0x1211('0x155'),'as':_0x1211('0x13f')});db[_0x1211('0x41')][_0x1211('0x100')](db[_0x1211('0x43')],{'as':_0x1211('0x150'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x156')});db[_0x1211('0x41')][_0x1211('0x10e')](db[_0x1211('0x3d')],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x14b')});db[_0x1211('0x41')]['belongsTo'](db['CmContact'],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db['MailInteraction'][_0x1211('0x10e')](db[_0x1211('0x13')],{'as':_0x1211('0x158'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x41')][_0x1211('0x114')](db[_0x1211('0x8f')],{'through':_0x1211('0x159'),'as':'Tags'});db[_0x1211('0x41')][_0x1211('0x114')](db[_0x1211('0x8f')],{'through':_0x1211('0x159'),'as':_0x1211('0x15a')});db[_0x1211('0x41')]['belongsToMany'](db[_0x1211('0x13')],{'as':_0x1211('0x15b'),'through':'user_has_mail_interactions','foreignKey':_0x1211('0x156')});db[_0x1211('0x43')][_0x1211('0x100')](db['Attachment'],{'as':_0x1211('0x15c'),'onDelete':_0x1211('0xfe')});db[_0x1211('0x43')]['belongsTo'](db[_0x1211('0x13')],{'as':'User'});db[_0x1211('0x43')][_0x1211('0x10e')](db[_0x1211('0x71')],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x149')});db[_0x1211('0x43')][_0x1211('0x10e')](db['MailInteraction'],{'as':_0x1211('0x15d'),'foreignKey':'MailInteractionId'});db[_0x1211('0x43')][_0x1211('0x10e')](db[_0x1211('0x3d')],{'as':_0x1211('0x157'),'foreignKey':'MailAccountId'});db[_0x1211('0x45')][_0x1211('0x10e')](db['User'],{'onDelete':_0x1211('0x15e')});db[_0x1211('0x45')][_0x1211('0x10e')](db[_0x1211('0x3e')],{'onDelete':'restrict'});db[_0x1211('0x45')]['belongsTo'](db[_0x1211('0x3d')],{'onDelete':_0x1211('0x15e')});db[_0x1211('0x45')][_0x1211('0x10e')](db[_0x1211('0x84')],{'onDelete':_0x1211('0x15e'),'foreignKey':_0x1211('0x13a')});db[_0x1211('0x45')]['belongsTo'](db[_0x1211('0x8f')],{'onDelete':_0x1211('0x15e'),'foreignKey':_0x1211('0x15f')});db[_0x1211('0x47')][_0x1211('0x10e')](db[_0x1211('0x3d')],{});db[_0x1211('0x47')][_0x1211('0x10e')](db[_0x1211('0x121')],{'as':_0x1211('0x152'),'foreignKey':'ListId'});db['MailQueueReport'][_0x1211('0x10e')](db[_0x1211('0x71')],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db['MailQueueReport'][_0x1211('0x10e')](db['MailInteraction'],{});db[_0x1211('0x47')][_0x1211('0x10e')](db[_0x1211('0x43')],{});db[_0x1211('0x47')][_0x1211('0x10e')](db['User'],{});db[_0x1211('0x47')][_0x1211('0x10e')](db[_0x1211('0x3e')],{});db['Dashboard'][_0x1211('0x100')](db[_0x1211('0x4b')],{'as':'Items','onDelete':_0x1211('0xfe')});db[_0x1211('0x160')][_0x1211('0x100')](db[_0x1211('0x14e')],{'as':_0x1211('0x161'),'foreignKey':_0x1211('0x162')});db[_0x1211('0x160')][_0x1211('0x100')](db[_0x1211('0x81')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0x1211('0x160')][_0x1211('0x100')](db['FaxInteraction'],{'as':_0x1211('0x151')});db[_0x1211('0x160')]['hasMany'](db[_0x1211('0x4d')],{'as':'Applications'});db[_0x1211('0x160')][_0x1211('0x100')](db[_0x1211('0x18')],{'as':'Exntensions','onDelete':_0x1211('0xfe')});db[_0x1211('0x160')]['hasMany'](db[_0x1211('0x163')],{'as':_0x1211('0x150')});db['FaxAccount']['belongsTo'](db[_0x1211('0x136')],{'as':_0x1211('0x136')});db[_0x1211('0x160')][_0x1211('0x10e')](db[_0x1211('0x121')],{'as':_0x1211('0x152'),'foreignKey':_0x1211('0x164')});db[_0x1211('0x160')][_0x1211('0x10e')](db[_0x1211('0x86')],{'as':_0x1211('0x13b'),'foreignKey':_0x1211('0x13c')});db[_0x1211('0x160')]['belongsToMany'](db[_0x1211('0x13')],{'as':_0x1211('0x154'),'through':'user_has_fax_accounts'});db[_0x1211('0x4d')]['belongsTo'](db['User'],{'onDelete':_0x1211('0x15e')});db[_0x1211('0x4d')][_0x1211('0x10e')](db['FaxQueue'],{'onDelete':_0x1211('0x15e')});db['FaxApplication'][_0x1211('0x10e')](db[_0x1211('0x160')],{'onDelete':_0x1211('0x15e')});db[_0x1211('0x4d')][_0x1211('0x10e')](db['Tag'],{'onDelete':_0x1211('0x15e'),'foreignKey':_0x1211('0x15f')});db[_0x1211('0x10b')]['hasMany'](db['FaxMessage'],{'as':_0x1211('0x150'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x165')});db[_0x1211('0x10b')][_0x1211('0x10e')](db['FaxAccount'],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x162')});db[_0x1211('0x10b')]['belongsTo'](db[_0x1211('0x71')],{'as':'Contact','foreignKey':_0x1211('0x14a')});db[_0x1211('0x10b')][_0x1211('0x10e')](db[_0x1211('0x13')],{'as':_0x1211('0x158'),'foreignKey':'UserId'});db['FaxInteraction']['belongsToMany'](db[_0x1211('0x8f')],{'through':_0x1211('0x166'),'as':_0x1211('0x167')});db[_0x1211('0x10b')][_0x1211('0x114')](db['Tag'],{'through':_0x1211('0x166'),'as':_0x1211('0x15a')});db[_0x1211('0x10b')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':'Users','through':_0x1211('0x168'),'foreignKey':_0x1211('0x165')});db[_0x1211('0x163')][_0x1211('0x10e')](db[_0x1211('0x13')],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x13')});db[_0x1211('0x163')]['belongsTo'](db['FaxInteraction'],{'as':_0x1211('0x15d'),'foreignKey':'FaxInteractionId'});db[_0x1211('0x163')][_0x1211('0x10e')](db['CmContact'],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x149')});db[_0x1211('0x163')][_0x1211('0x10e')](db['Attachment'],{'as':_0x1211('0xeb'),'foreignKey':_0x1211('0x169')});db[_0x1211('0x163')]['belongsTo'](db[_0x1211('0x160')],{'as':'Account','foreignKey':_0x1211('0x162')});db['FaxQueue']['belongsToMany'](db[_0x1211('0x13')],{'as':'Agents','through':_0x1211('0x36')});db[_0x1211('0x4f')][_0x1211('0x114')](db[_0x1211('0x116')],{'through':_0x1211('0x16a'),'as':'Teams'});db['FaxQueueReport']['belongsTo'](db[_0x1211('0x160')],{});db[_0x1211('0x51')][_0x1211('0x10e')](db[_0x1211('0x121')],{'as':_0x1211('0x152'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x1211('0x10e')](db['CmContact'],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0x51')][_0x1211('0x10e')](db[_0x1211('0x10b')],{});db[_0x1211('0x51')][_0x1211('0x10e')](db[_0x1211('0x163')],{});db[_0x1211('0x51')][_0x1211('0x10e')](db['User'],{});db['FaxQueueReport'][_0x1211('0x10e')](db['FaxQueue'],{});db[_0x1211('0x53')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x1211('0x16b')});db[_0x1211('0x53')][_0x1211('0x100')](db[_0x1211('0x81')],{'as':_0x1211('0x14f'),'foreignKey':_0x1211('0x16b')});db['SmsAccount']['hasMany'](db[_0x1211('0x58')],{'as':_0x1211('0x150'),'foreignKey':'SmsAccountId'});db[_0x1211('0x53')][_0x1211('0x100')](db[_0x1211('0x109')],{'as':_0x1211('0x151')});db[_0x1211('0x53')][_0x1211('0x100')](db[_0x1211('0x55')],{'as':_0x1211('0x12e')});db[_0x1211('0x53')]['belongsTo'](db[_0x1211('0x121')],{'as':_0x1211('0x152'),'foreignKey':'ListId'});db[_0x1211('0x53')][_0x1211('0x10e')](db[_0x1211('0x86')],{'as':_0x1211('0x13b'),'foreignKey':_0x1211('0x13c')});db[_0x1211('0x53')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x154'),'through':_0x1211('0x12a')});db[_0x1211('0x55')][_0x1211('0x10e')](db[_0x1211('0x13')],{'onDelete':'restrict'});db['SmsApplication'][_0x1211('0x10e')](db[_0x1211('0x59')],{'onDelete':_0x1211('0x15e')});db['SmsApplication'][_0x1211('0x10e')](db[_0x1211('0x53')],{'onDelete':'restrict'});db[_0x1211('0x55')]['belongsTo'](db[_0x1211('0x84')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x1211('0x55')]['belongsTo'](db[_0x1211('0x8f')],{'onDelete':_0x1211('0x15e'),'foreignKey':_0x1211('0x15f')});db[_0x1211('0x109')][_0x1211('0x100')](db[_0x1211('0x58')],{'as':_0x1211('0x150'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x16c')});db['SmsInteraction'][_0x1211('0x10e')](db[_0x1211('0x53')],{'as':'Account','foreignKey':_0x1211('0x16b')});db[_0x1211('0x109')]['belongsTo'](db['CmContact'],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0x109')][_0x1211('0x10e')](db['User'],{'as':_0x1211('0x158'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x109')][_0x1211('0x114')](db[_0x1211('0x8f')],{'through':'sms_interaction_has_tags','as':_0x1211('0x167')});db['SmsInteraction'][_0x1211('0x114')](db[_0x1211('0x8f')],{'through':_0x1211('0x16d'),'as':_0x1211('0x15a')});db[_0x1211('0x109')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x15b'),'through':_0x1211('0x11a'),'foreignKey':_0x1211('0x16c')});db[_0x1211('0x58')][_0x1211('0x10e')](db[_0x1211('0x13')],{'as':_0x1211('0x13')});db['SmsMessage'][_0x1211('0x10e')](db[_0x1211('0x71')],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x149')});db[_0x1211('0x58')][_0x1211('0x10e')](db[_0x1211('0x109')],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x15d'),'foreignKey':_0x1211('0x16c')});db[_0x1211('0x58')][_0x1211('0x10e')](db['SmsAccount'],{'as':_0x1211('0x157'),'foreignKey':'SmsAccountId'});db[_0x1211('0x59')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':'Agents','through':_0x1211('0x38'),'foreignKey':_0x1211('0x16e')});db['SmsQueue']['belongsToMany'](db[_0x1211('0x116')],{'through':_0x1211('0x16f'),'as':_0x1211('0x13f')});db[_0x1211('0x5b')][_0x1211('0x100')](db['Disposition'],{'as':_0x1211('0x161'),'foreignKey':_0x1211('0x170')});db['OpenchannelAccount'][_0x1211('0x100')](db[_0x1211('0x81')],{'as':_0x1211('0x14f'),'foreignKey':_0x1211('0x170')});db[_0x1211('0x5b')][_0x1211('0x100')](db['OpenchannelInteraction'],{'as':_0x1211('0x151'),'foreignKey':_0x1211('0x170')});db[_0x1211('0x5b')][_0x1211('0x100')](db[_0x1211('0x171')],{'as':'Messages','foreignKey':_0x1211('0x170')});db[_0x1211('0x5b')][_0x1211('0x100')](db[_0x1211('0x5c')],{'as':_0x1211('0x12e'),'foreignKey':_0x1211('0x170')});db['OpenchannelAccount'][_0x1211('0x10e')](db[_0x1211('0x121')],{'as':_0x1211('0x152'),'foreignKey':'ListId'});db[_0x1211('0x5b')][_0x1211('0x10e')](db[_0x1211('0x86')],{'as':_0x1211('0x13b'),'foreignKey':_0x1211('0x13c')});db['OpenchannelAccount'][_0x1211('0x114')](db['User'],{'as':_0x1211('0x154'),'through':_0x1211('0x172')});db['OpenchannelApplication'][_0x1211('0x10e')](db[_0x1211('0x13')],{'onDelete':_0x1211('0x15e')});db['OpenchannelApplication'][_0x1211('0x10e')](db[_0x1211('0x60')],{'onDelete':_0x1211('0x15e'),'foreignKey':_0x1211('0x173')});db['OpenchannelApplication'][_0x1211('0x10e')](db[_0x1211('0x5b')],{'onDelete':_0x1211('0x15e'),'foreignKey':_0x1211('0x170')});db['OpenchannelApplication'][_0x1211('0x10e')](db[_0x1211('0x84')],{'onDelete':_0x1211('0x15e'),'foreignKey':'IntervalId'});db['OpenchannelApplication']['belongsTo'](db[_0x1211('0x8f')],{'onDelete':'restrict','foreignKey':_0x1211('0x15f')});db[_0x1211('0x106')][_0x1211('0x100')](db[_0x1211('0x171')],{'as':_0x1211('0x150'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x174')});db['OpenchannelInteraction'][_0x1211('0x10e')](db[_0x1211('0x5b')],{'as':_0x1211('0x157'),'foreignKey':'OpenchannelAccountId'});db[_0x1211('0x106')][_0x1211('0x10e')](db[_0x1211('0x71')],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db['OpenchannelInteraction'][_0x1211('0x10e')](db[_0x1211('0x13')],{'as':_0x1211('0x158'),'foreignKey':_0x1211('0xff')});db['OpenchannelInteraction'][_0x1211('0x114')](db[_0x1211('0x8f')],{'through':_0x1211('0x175'),'as':_0x1211('0x167')});db[_0x1211('0x106')][_0x1211('0x114')](db[_0x1211('0x8f')],{'through':_0x1211('0x175'),'as':'ThroughTags'});db[_0x1211('0x106')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0x1211('0x174')});db[_0x1211('0x171')][_0x1211('0x10e')](db['User'],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x13')});db[_0x1211('0x171')]['belongsTo'](db['CmContact'],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x149')});db[_0x1211('0x171')][_0x1211('0x10e')](db['OpenchannelInteraction'],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x15d'),'foreignKey':_0x1211('0x174')});db[_0x1211('0x171')][_0x1211('0x10e')](db[_0x1211('0xeb')],{'as':_0x1211('0xeb'),'foreignKey':_0x1211('0x169')});db['OpenchannelMessage'][_0x1211('0x10e')](db['OpenchannelAccount'],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x170')});db['OpenchannelQueue'][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x154'),'through':_0x1211('0x120'),'foreignKey':_0x1211('0x173')});db[_0x1211('0x60')][_0x1211('0x114')](db[_0x1211('0x116')],{'through':'team_has_openchannel_queues','as':_0x1211('0x13f')});db[_0x1211('0x62')][_0x1211('0x100')](db['Disposition'],{'as':_0x1211('0x161'),'foreignKey':_0x1211('0x176')});db[_0x1211('0x62')][_0x1211('0x100')](db['CannedAnswer'],{'as':_0x1211('0x14f'),'foreignKey':_0x1211('0x176')});db['ChatWebsite'][_0x1211('0x100')](db['ChatProactiveAction'],{'as':_0x1211('0x177')});db[_0x1211('0x62')]['hasMany'](db[_0x1211('0x108')],{'as':_0x1211('0x151')});db[_0x1211('0x62')][_0x1211('0x100')](db['ChatApplication'],{'as':_0x1211('0x12e')});db[_0x1211('0x62')][_0x1211('0x100')](db[_0x1211('0x68')],{'as':'Messages'});db['ChatWebsite'][_0x1211('0x10e')](db[_0x1211('0x121')],{'as':_0x1211('0x152'),'foreignKey':'ListId'});db[_0x1211('0x62')]['belongsTo'](db[_0x1211('0x84')],{'as':_0x1211('0x84'),'foreignKey':_0x1211('0x13a')});db[_0x1211('0x62')][_0x1211('0x10e')](db[_0x1211('0x86')],{'as':_0x1211('0x13b'),'foreignKey':_0x1211('0x13c')});db[_0x1211('0x62')]['belongsToMany'](db[_0x1211('0x13')],{'as':_0x1211('0x154'),'through':_0x1211('0x125')});db[_0x1211('0x64')][_0x1211('0x10e')](db[_0x1211('0x5b')],{});db[_0x1211('0x64')]['belongsTo'](db[_0x1211('0x121')],{'as':_0x1211('0x152'),'foreignKey':_0x1211('0x164')});db[_0x1211('0x64')][_0x1211('0x10e')](db[_0x1211('0x71')],{'as':'Contact','foreignKey':_0x1211('0x14a')});db[_0x1211('0x64')][_0x1211('0x10e')](db[_0x1211('0x106')],{});db[_0x1211('0x64')][_0x1211('0x10e')](db[_0x1211('0x171')],{});db['OpenchannelQueueReport'][_0x1211('0x10e')](db[_0x1211('0x13')],{});db[_0x1211('0x64')][_0x1211('0x10e')](db[_0x1211('0x60')],{});db[_0x1211('0x66')][_0x1211('0x10e')](db[_0x1211('0x13')],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db[_0x1211('0x66')][_0x1211('0x10e')](db[_0x1211('0x6c')],{'as':_0x1211('0x178'),'foreignKey':_0x1211('0x179'),'onDelete':_0x1211('0x15e')});db[_0x1211('0x66')][_0x1211('0x10e')](db[_0x1211('0x62')],{'as':_0x1211('0x17a'),'foreignKey':_0x1211('0x176'),'onDelete':_0x1211('0x15e')});db[_0x1211('0x66')]['belongsTo'](db[_0x1211('0x8f')],{'onDelete':_0x1211('0x15e'),'foreignKey':_0x1211('0x15f')});db['ChatInteraction'][_0x1211('0x100')](db[_0x1211('0x68')],{'as':_0x1211('0x150'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x17b')});db['ChatInteraction'][_0x1211('0x10e')](db[_0x1211('0x62')],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x176')});db[_0x1211('0x108')][_0x1211('0x10e')](db[_0x1211('0x71')],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0x108')][_0x1211('0x10e')](db['User'],{'as':_0x1211('0x158'),'foreignKey':_0x1211('0xff')});db[_0x1211('0x108')]['belongsToMany'](db[_0x1211('0x8f')],{'through':_0x1211('0x17c'),'as':'Tags'});db['ChatInteraction'][_0x1211('0x114')](db[_0x1211('0x8f')],{'through':'chat_interaction_has_tags','as':_0x1211('0x15a')});db['ChatInteraction'][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x15b'),'through':'user_has_chat_interactions','foreignKey':_0x1211('0x17b')});db[_0x1211('0x68')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0x1211('0x13')});db[_0x1211('0x68')][_0x1211('0x10e')](db['CmContact'],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db['ChatMessage'][_0x1211('0x10e')](db[_0x1211('0x108')],{'onDelete':_0x1211('0xfe'),'as':'Interaction','foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x1211('0x10e')](db[_0x1211('0xeb')],{'as':_0x1211('0xeb'),'foreignKey':_0x1211('0x169')});db[_0x1211('0x68')]['belongsTo'](db[_0x1211('0x62')],{'as':_0x1211('0x157'),'foreignKey':'ChatWebsiteId'});db[_0x1211('0x6a')][_0x1211('0x10e')](db[_0x1211('0x71')],{'onDelete':_0x1211('0xfe'),'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0x6a')][_0x1211('0x10e')](db[_0x1211('0x62')],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x176')});db[_0x1211('0x6c')]['belongsToMany'](db[_0x1211('0x13')],{'as':'Agents','through':_0x1211('0x32'),'hooks':!![]});db[_0x1211('0x6c')]['belongsToMany'](db[_0x1211('0x116')],{'through':_0x1211('0x17d'),'as':_0x1211('0x13f')});db[_0x1211('0x110')][_0x1211('0x100')](db[_0x1211('0x17e')],{'as':_0x1211('0x150'),'foreignKey':_0x1211('0x17f'),'onDelete':_0x1211('0xfe')});db[_0x1211('0x110')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x131'),'through':_0x1211('0x112')});db['ChatProactiveAction'][_0x1211('0x10e')](db[_0x1211('0x62')],{'as':_0x1211('0x17a'),'foreignKey':'ChatWebsiteId'});db[_0x1211('0x70')][_0x1211('0x100')](db[_0x1211('0x71')],{'as':_0x1211('0x113'),'foreignKey':_0x1211('0x180')});db[_0x1211('0x71')][_0x1211('0x100')](db['CmHopper'],{'as':_0x1211('0x181'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0x71')][_0x1211('0x100')](db[_0x1211('0x76')],{'as':_0x1211('0x104'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0x71')][_0x1211('0x100')](db['CmHopperHistory'],{'as':_0x1211('0x133'),'foreignKey':'ContactId'});db['CmContact'][_0x1211('0x100')](db[_0x1211('0x79')],{'as':_0x1211('0x79'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0x71')]['hasMany'](db['JscriptySessionReport'],{'as':_0x1211('0x135'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0x71')]['hasMany'](db[_0x1211('0x106')],{'as':_0x1211('0x107'),'foreignKey':_0x1211('0x14a'),'onDelete':_0x1211('0x15e')});db[_0x1211('0x71')][_0x1211('0x100')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x1211('0x14a'),'onDelete':_0x1211('0x15e')});db[_0x1211('0x71')][_0x1211('0x100')](db[_0x1211('0x109')],{'as':_0x1211('0x10a'),'foreignKey':_0x1211('0x14a'),'onDelete':'restrict'});db[_0x1211('0x71')][_0x1211('0x100')](db[_0x1211('0x10b')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0x1211('0x15e')});db[_0x1211('0x71')][_0x1211('0x100')](db[_0x1211('0x41')],{'as':_0x1211('0x10d'),'foreignKey':_0x1211('0x14a'),'onDelete':_0x1211('0x15e')});db[_0x1211('0x71')]['belongsTo'](db['CmCompany'],{'as':_0x1211('0x182'),'foreignKey':_0x1211('0x180')});db[_0x1211('0x71')][_0x1211('0x10e')](db[_0x1211('0x121')],{'as':'List','foreignKey':_0x1211('0x164'),'onDelete':_0x1211('0xfe')});db[_0x1211('0x71')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x15b'),'through':_0x1211('0x183')});db['CmContact'][_0x1211('0x114')](db[_0x1211('0x8f')],{'as':_0x1211('0x167'),'through':_0x1211('0x184')});db[_0x1211('0x71')][_0x1211('0x114')](db[_0x1211('0x8f')],{'through':_0x1211('0x184'),'as':'ThroughTags'});db['CmHopper'][_0x1211('0x10e')](db[_0x1211('0x71')],{'as':'Contact','foreignKey':_0x1211('0x14a'),'onDelete':_0x1211('0xfe')});db[_0x1211('0x73')][_0x1211('0x10e')](db['CmList'],{'as':_0x1211('0x152'),'foreignKey':_0x1211('0x164'),'onDelete':_0x1211('0xfe')});db[_0x1211('0x73')][_0x1211('0x10e')](db[_0x1211('0x13')],{'as':_0x1211('0x185'),'foreignKey':'UserId'});db[_0x1211('0x73')][_0x1211('0x10e')](db[_0x1211('0x1b')],{'as':'Queue','foreignKey':_0x1211('0x132'),'onDelete':_0x1211('0xfe')});db[_0x1211('0x73')]['belongsTo'](db[_0x1211('0xe9')],{'as':_0x1211('0xe9'),'foreignKey':_0x1211('0x186'),'onDelete':_0x1211('0xfe')});db[_0x1211('0x73')][_0x1211('0x10e')](db[_0x1211('0x13')],{'as':_0x1211('0x158'),'foreignKey':_0x1211('0x187')});db['CmHopperBlack'][_0x1211('0x10e')](db[_0x1211('0x71')],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a'),'onDelete':_0x1211('0xfe')});db['CmHopperBlack'][_0x1211('0x10e')](db['CmList'],{'as':_0x1211('0x152'),'foreignKey':'ListId','onDelete':_0x1211('0xfe')});db['CmHopperBlack'][_0x1211('0x10e')](db[_0x1211('0x1b')],{'as':_0x1211('0x178'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x1211('0x188')][_0x1211('0x10e')](db['Campaign'],{'as':_0x1211('0xe9'),'foreignKey':_0x1211('0x186'),'onDelete':_0x1211('0xfe')});db[_0x1211('0x7f')]['hasMany'](db['Condition'],{'as':{'plural':_0x1211('0x189'),'singular':_0x1211('0x18a')},'foreignKey':_0x1211('0x18b'),'onDelete':_0x1211('0xfe'),'hooks':!![]});db[_0x1211('0x7f')][_0x1211('0x100')](db[_0x1211('0x18c')],{'as':{'plural':_0x1211('0x18d'),'singular':_0x1211('0x18e')},'foreignKey':_0x1211('0x18f'),'onDelete':_0x1211('0xfe'),'hooks':!![]});db[_0x1211('0x7f')]['hasMany'](db[_0x1211('0x7d')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x1211('0xfe'),'hooks':!![]});db[_0x1211('0x84')][_0x1211('0x100')](db[_0x1211('0x84')],{'as':_0x1211('0x190'),'foreignKey':_0x1211('0x13a'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x1211('0x84')]['hasMany'](db[_0x1211('0x18')],{'as':_0x1211('0x191'),'foreignKey':_0x1211('0x13a'),'onDelete':'restrict'});db[_0x1211('0x84')][_0x1211('0x100')](db[_0x1211('0x45')],{'as':'MailApplications','foreignKey':_0x1211('0x13a')});db[_0x1211('0x84')][_0x1211('0x100')](db[_0x1211('0x66')],{'as':'ChatApplications','foreignKey':_0x1211('0x13a')});db[_0x1211('0x84')][_0x1211('0x100')](db[_0x1211('0x4d')],{'as':_0x1211('0x192'),'foreignKey':_0x1211('0x13a')});db['Interval'][_0x1211('0x100')](db['SmsApplication'],{'as':_0x1211('0x193'),'foreignKey':_0x1211('0x13a')});db[_0x1211('0x8b')][_0x1211('0x10e')](db[_0x1211('0x3d')],{});db[_0x1211('0x8b')][_0x1211('0x10e')](db[_0x1211('0x9b')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0x1211('0x10e')](db[_0x1211('0x99')],{'foreignKey':_0x1211('0x194')});db[_0x1211('0x8d')][_0x1211('0x114')](db[_0x1211('0x195')],{'as':_0x1211('0x196'),'through':_0x1211('0x130'),'onDelete':_0x1211('0x15e')});db[_0x1211('0x8f')][_0x1211('0x114')](db[_0x1211('0x71')],{'through':_0x1211('0x184')});db[_0x1211('0x8f')][_0x1211('0x114')](db[_0x1211('0x108')],{'through':_0x1211('0x17c')});db[_0x1211('0x8f')]['belongsToMany'](db['MailInteraction'],{'through':_0x1211('0x159')});db['Tag'][_0x1211('0x114')](db[_0x1211('0x109')],{'through':'sms_interaction_has_tags'});db[_0x1211('0x8f')]['belongsToMany'](db[_0x1211('0x10b')],{'through':_0x1211('0x166')});db[_0x1211('0x8f')]['belongsToMany'](db[_0x1211('0x106')],{'through':_0x1211('0x175')});db[_0x1211('0x197')][_0x1211('0x100')](db[_0x1211('0x18c')],{'as':{'plural':_0x1211('0x198'),'singular':_0x1211('0x199')},'foreignKey':_0x1211('0x19a'),'onDelete':'cascade','hooks':!![]});db[_0x1211('0x197')][_0x1211('0x100')](db[_0x1211('0x18c')],{'as':{'plural':_0x1211('0x19b'),'singular':_0x1211('0x19c')},'foreignKey':_0x1211('0x19d'),'onDelete':_0x1211('0xfe'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x1211('0x7d')],{'as':_0x1211('0x19e'),'foreignKey':_0x1211('0x19f'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0x1211('0x100')](db[_0x1211('0x1a0')],{'as':'Fields','onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x194'),'hooks':!![]});db[_0x1211('0x9b')]['hasMany'](db[_0x1211('0x1a0')],{'as':'Fields','onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a1')});db[_0x1211('0x9e')][_0x1211('0x100')](db[_0x1211('0x1a0')],{'as':'Fields','onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a2')});db[_0x1211('0x1a0')][_0x1211('0x10e')](db[_0x1211('0x9e')],{'foreignKey':_0x1211('0x1a2')});db[_0x1211('0xa1')][_0x1211('0x100')](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x1211('0xa2')][_0x1211('0x100')](db[_0x1211('0xa4')],{'as':_0x1211('0x1a3'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a4')});db[_0x1211('0xa2')][_0x1211('0x100')](db[_0x1211('0xa4')],{'as':_0x1211('0x1a5'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a6')});db[_0x1211('0xa2')]['hasMany'](db[_0x1211('0xa4')],{'as':'Fields','onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0xa2')][_0x1211('0x10e')](db[_0x1211('0xa1')],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x1a8')});db[_0x1211('0xa4')][_0x1211('0x100')](db['SalesforceField'],{'as':_0x1211('0x1a9'),'foreignKey':_0x1211('0x1a4')});db['SalesforceField'][_0x1211('0x100')](db[_0x1211('0xa4')],{'as':_0x1211('0x1aa'),'foreignKey':'DescriptionId'});db[_0x1211('0xa4')]['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':_0x1211('0x1a7')});db[_0x1211('0xa4')][_0x1211('0x10e')](db['Variable'],{'as':_0x1211('0x94'),'foreignKey':_0x1211('0x1ab')});db[_0x1211('0xa6')][_0x1211('0x100')](db[_0x1211('0xa8')],{'as':_0x1211('0x1ac'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a8')});db[_0x1211('0xa8')][_0x1211('0x100')](db[_0x1211('0xaa')],{'as':_0x1211('0x1a3'),'onDelete':_0x1211('0xfe'),'foreignKey':'SubjectId'});db[_0x1211('0xa8')][_0x1211('0x100')](db[_0x1211('0xaa')],{'as':'Descriptions','onDelete':_0x1211('0xfe'),'foreignKey':'DescriptionId'});db[_0x1211('0xa8')][_0x1211('0x100')](db[_0x1211('0xaa')],{'as':_0x1211('0x1ad'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0xa8')][_0x1211('0x10e')](db[_0x1211('0xa6')],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x1a8')});db['SugarcrmField'][_0x1211('0x100')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0x1211('0x1a4')});db[_0x1211('0xaa')]['hasMany'](db[_0x1211('0xaa')],{'as':_0x1211('0x1aa'),'foreignKey':_0x1211('0x1a6')});db[_0x1211('0xaa')][_0x1211('0x100')](db[_0x1211('0xaa')],{'as':_0x1211('0x1ae'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0xaa')][_0x1211('0x10e')](db['Variable'],{'as':_0x1211('0x94'),'foreignKey':_0x1211('0x1ab')});db[_0x1211('0xac')][_0x1211('0x100')](db[_0x1211('0xae')],{'as':_0x1211('0x1ac'),'onDelete':_0x1211('0xfe'),'foreignKey':'AccountId'});db[_0x1211('0xae')]['hasMany'](db[_0x1211('0xb0')],{'as':_0x1211('0x1a3'),'onDelete':_0x1211('0xfe'),'foreignKey':'SubjectId'});db['DeskConfiguration'][_0x1211('0x100')](db['DeskField'],{'as':_0x1211('0x1a5'),'onDelete':_0x1211('0xfe'),'foreignKey':'DescriptionId'});db[_0x1211('0xae')][_0x1211('0x100')](db[_0x1211('0xb0')],{'as':'Fields','onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0xae')][_0x1211('0x10e')](db[_0x1211('0xac')],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x1a8')});db['DeskConfiguration']['belongsToMany'](db[_0x1211('0x8f')],{'through':_0x1211('0x1af')});db['DeskField'][_0x1211('0x100')](db[_0x1211('0xb0')],{'as':_0x1211('0x1a9'),'foreignKey':'SubjectId'});db[_0x1211('0xb0')][_0x1211('0x100')](db[_0x1211('0xb0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x1211('0xb0')][_0x1211('0x100')](db[_0x1211('0xb0')],{'as':_0x1211('0x1ae'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0xb0')]['belongsTo'](db[_0x1211('0x94')],{'as':_0x1211('0x94'),'foreignKey':_0x1211('0x1ab')});db[_0x1211('0x1b0')]['hasMany'](db[_0x1211('0xb2')],{'as':_0x1211('0x1ac'),'onDelete':_0x1211('0xfe'),'foreignKey':'AccountId'});db[_0x1211('0xb2')]['hasMany'](db[_0x1211('0xb4')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x1211('0x1a4')});db[_0x1211('0xb2')][_0x1211('0x100')](db[_0x1211('0xb4')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x1211('0xb2')][_0x1211('0x100')](db[_0x1211('0xb4')],{'as':_0x1211('0x1ad'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a7')});db['ZohoConfiguration'][_0x1211('0x10e')](db[_0x1211('0x1b0')],{'as':'Account','foreignKey':'AccountId'});db[_0x1211('0xb4')]['hasMany'](db['ZohoField'],{'as':'Subject','foreignKey':_0x1211('0x1a4')});db['ZohoField'][_0x1211('0x100')](db[_0x1211('0xb4')],{'as':_0x1211('0x1aa'),'foreignKey':_0x1211('0x1a6')});db[_0x1211('0xb4')][_0x1211('0x100')](db[_0x1211('0xb4')],{'as':_0x1211('0x1ae'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0xb4')][_0x1211('0x10e')](db['Variable'],{'as':_0x1211('0x94'),'foreignKey':_0x1211('0x1ab')});db[_0x1211('0xb6')]['hasMany'](db[_0x1211('0x1b1')],{'as':_0x1211('0x1ac'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a8')});db['ZendeskConfiguration'][_0x1211('0x100')](db[_0x1211('0x1b2')],{'as':'Subjects','foreignKey':_0x1211('0x1a4')});db[_0x1211('0x1b1')]['hasMany'](db[_0x1211('0x1b2')],{'as':'Descriptions','foreignKey':_0x1211('0x1a6')});db[_0x1211('0x1b1')][_0x1211('0x100')](db[_0x1211('0x1b2')],{'as':_0x1211('0x1ad'),'foreignKey':_0x1211('0x1a7')});db['ZendeskConfiguration'][_0x1211('0x10e')](db[_0x1211('0xb6')],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x1a8')});db[_0x1211('0x1b1')]['belongsToMany'](db['Tag'],{'through':_0x1211('0x1b3')});db[_0x1211('0x1b2')]['hasMany'](db['ZendeskField'],{'as':_0x1211('0x1a9'),'foreignKey':'SubjectId'});db[_0x1211('0x1b2')][_0x1211('0x100')](db[_0x1211('0x1b2')],{'as':_0x1211('0x1aa'),'foreignKey':_0x1211('0x1a6')});db[_0x1211('0x1b2')][_0x1211('0x100')](db[_0x1211('0x1b2')],{'as':_0x1211('0x1ae'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0x1b2')][_0x1211('0x10e')](db[_0x1211('0x94')],{'as':'Variable','foreignKey':_0x1211('0x1ab')});db[_0x1211('0xba')][_0x1211('0x100')](db[_0x1211('0xbc')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['FreshdeskConfiguration']['hasMany'](db[_0x1211('0x1b4')],{'as':_0x1211('0x1a3'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a4')});db[_0x1211('0xbc')][_0x1211('0x100')](db['FreshdeskField'],{'as':_0x1211('0x1a5'),'onDelete':'cascade','foreignKey':_0x1211('0x1a6')});db[_0x1211('0xbc')][_0x1211('0x100')](db[_0x1211('0x1b4')],{'as':_0x1211('0x1ad'),'onDelete':'cascade','foreignKey':_0x1211('0x1a7')});db[_0x1211('0xbc')][_0x1211('0x10e')](db[_0x1211('0xba')],{'as':'Account','foreignKey':_0x1211('0x1a8')});db[_0x1211('0xbc')]['belongsToMany'](db[_0x1211('0x8f')],{'through':_0x1211('0x1b5')});db[_0x1211('0x1b4')]['hasMany'](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x1211('0x1a4')});db['FreshdeskField'][_0x1211('0x100')](db[_0x1211('0x1b4')],{'as':_0x1211('0x1aa'),'foreignKey':_0x1211('0x1a6')});db[_0x1211('0x1b4')][_0x1211('0x100')](db[_0x1211('0x1b4')],{'as':_0x1211('0x1ae'),'foreignKey':'FieldId'});db[_0x1211('0x1b4')][_0x1211('0x10e')](db['Variable'],{'as':_0x1211('0x94'),'foreignKey':_0x1211('0x1ab')});db['VtigerAccount'][_0x1211('0x100')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a8')});db[_0x1211('0xbf')][_0x1211('0x100')](db['VtigerField'],{'as':_0x1211('0x1a3'),'foreignKey':_0x1211('0x1a4')});db[_0x1211('0xbf')][_0x1211('0x100')](db[_0x1211('0xc1')],{'as':_0x1211('0x1a5'),'foreignKey':_0x1211('0x1a6')});db['VtigerConfiguration'][_0x1211('0x100')](db['VtigerField'],{'as':_0x1211('0x1ad'),'foreignKey':_0x1211('0x1a7')});db['VtigerConfiguration']['belongsTo'](db[_0x1211('0xbd')],{'as':_0x1211('0x157'),'foreignKey':'AccountId'});db[_0x1211('0xc1')][_0x1211('0x100')](db[_0x1211('0xc1')],{'as':_0x1211('0x1a9'),'foreignKey':_0x1211('0x1a4')});db[_0x1211('0xc1')][_0x1211('0x100')](db[_0x1211('0xc1')],{'as':'Description','foreignKey':_0x1211('0x1a6')});db[_0x1211('0xc1')][_0x1211('0x100')](db['VtigerField'],{'as':_0x1211('0x1ae'),'foreignKey':'FieldId'});db[_0x1211('0xc1')][_0x1211('0x10e')](db[_0x1211('0x94')],{'as':_0x1211('0x94'),'foreignKey':_0x1211('0x1ab')});db[_0x1211('0xc2')][_0x1211('0x100')](db[_0x1211('0x1b6')],{'as':_0x1211('0x1ac'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a8')});db[_0x1211('0x1b6')][_0x1211('0x100')](db['ServicenowField'],{'as':'Subjects','foreignKey':_0x1211('0x1a4')});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':_0x1211('0x1a5'),'foreignKey':_0x1211('0x1a6')});db[_0x1211('0x1b6')][_0x1211('0x100')](db[_0x1211('0xc4')],{'as':_0x1211('0x1ad'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0x1b6')][_0x1211('0x10e')](db[_0x1211('0xc2')],{'as':_0x1211('0x157'),'foreignKey':_0x1211('0x1a8')});db[_0x1211('0xc4')][_0x1211('0x100')](db['ServicenowField'],{'as':_0x1211('0x1a9'),'foreignKey':_0x1211('0x1a4')});db[_0x1211('0xc4')][_0x1211('0x100')](db[_0x1211('0xc4')],{'as':_0x1211('0x1aa'),'foreignKey':_0x1211('0x1a6')});db[_0x1211('0xc4')][_0x1211('0x100')](db['ServicenowField'],{'as':_0x1211('0x1ae'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0xc4')][_0x1211('0x10e')](db[_0x1211('0x94')],{'as':_0x1211('0x94'),'foreignKey':_0x1211('0x1ab')});db[_0x1211('0x1b7')][_0x1211('0x100')](db[_0x1211('0xc7')],{'as':_0x1211('0x1ac'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a8')});db['Dynamics365Configuration'][_0x1211('0x100')](db[_0x1211('0xc9')],{'as':_0x1211('0x1a3'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a4')});db[_0x1211('0xc7')][_0x1211('0x100')](db[_0x1211('0xc9')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x1211('0xc7')][_0x1211('0x100')](db[_0x1211('0xc9')],{'as':_0x1211('0x1ad'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x1211('0xc7')]['belongsTo'](db[_0x1211('0x1b7')],{'as':_0x1211('0x157'),'foreignKey':'AccountId'});db[_0x1211('0xc9')][_0x1211('0x100')](db[_0x1211('0xc9')],{'as':_0x1211('0x1a9'),'foreignKey':_0x1211('0x1a4')});db[_0x1211('0xc9')]['hasMany'](db[_0x1211('0xc9')],{'as':'Description','foreignKey':_0x1211('0x1a6')});db['Dynamics365Field'][_0x1211('0x100')](db[_0x1211('0xc9')],{'as':_0x1211('0x1ae'),'foreignKey':'FieldId'});db[_0x1211('0xc9')][_0x1211('0x10e')](db[_0x1211('0x94')],{'as':_0x1211('0x94'),'foreignKey':'VariableId'});db[_0x1211('0xca')][_0x1211('0x100')](db[_0x1211('0xcc')],{'as':'Configurations','onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1a8')});db[_0x1211('0xcc')][_0x1211('0x100')](db[_0x1211('0x1b8')],{'as':_0x1211('0x1a3'),'foreignKey':_0x1211('0x1a4')});db[_0x1211('0xcc')]['hasMany'](db[_0x1211('0x1b8')],{'as':_0x1211('0x1a5'),'foreignKey':_0x1211('0x1a6')});db[_0x1211('0xcc')][_0x1211('0x100')](db[_0x1211('0x1b8')],{'as':_0x1211('0x1ad'),'foreignKey':'FieldId'});db[_0x1211('0xcc')][_0x1211('0x10e')](db[_0x1211('0xca')],{'as':_0x1211('0x157'),'foreignKey':'AccountId'});db['FreshsalesField'][_0x1211('0x100')](db[_0x1211('0x1b8')],{'as':_0x1211('0x1a9'),'foreignKey':_0x1211('0x1a4')});db[_0x1211('0x1b8')][_0x1211('0x100')](db[_0x1211('0x1b8')],{'as':_0x1211('0x1aa'),'foreignKey':_0x1211('0x1a6')});db[_0x1211('0x1b8')][_0x1211('0x100')](db[_0x1211('0x1b8')],{'as':_0x1211('0x1ae'),'foreignKey':_0x1211('0x1a7')});db[_0x1211('0x1b8')][_0x1211('0x10e')](db[_0x1211('0x94')],{'as':_0x1211('0x94'),'foreignKey':_0x1211('0x1ab')});db['ChatQueueReport'][_0x1211('0x10e')](db[_0x1211('0x62')],{});db[_0x1211('0xd1')][_0x1211('0x10e')](db['CmList'],{'as':_0x1211('0x152'),'foreignKey':_0x1211('0x164')});db[_0x1211('0xd1')][_0x1211('0x10e')](db[_0x1211('0x71')],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0xd1')][_0x1211('0x10e')](db[_0x1211('0x108')],{});db[_0x1211('0xd1')][_0x1211('0x10e')](db['ChatMessage'],{});db[_0x1211('0xd1')]['belongsTo'](db[_0x1211('0x13')],{});db['ChatQueueReport']['belongsTo'](db[_0x1211('0x6c')],{});db['ChatInternalMessage'][_0x1211('0x10e')](db['User'],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x1211('0x17e')]['belongsTo'](db[_0x1211('0x13')],{'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x1b9')});db['JscriptySessionReport'][_0x1211('0x100')](db[_0x1211('0xd5')],{'foreignKey':_0x1211('0x1ba'),'onDelete':'cascade'});db[_0x1211('0xd7')][_0x1211('0x100')](db[_0x1211('0xd3')],{'foreignKey':_0x1211('0x1ba'),'onDelete':'cascade'});db['SmsQueueReport'][_0x1211('0x10e')](db[_0x1211('0x53')],{});db[_0x1211('0xd9')]['belongsTo'](db[_0x1211('0x121')],{'as':_0x1211('0x152'),'foreignKey':_0x1211('0x164')});db[_0x1211('0xd9')][_0x1211('0x10e')](db['CmContact'],{'as':_0x1211('0x149'),'foreignKey':_0x1211('0x14a')});db[_0x1211('0xd9')]['belongsTo'](db[_0x1211('0x109')],{});db[_0x1211('0xd9')]['belongsTo'](db['SmsMessage'],{});db[_0x1211('0xd9')][_0x1211('0x10e')](db[_0x1211('0x13')],{});db['SmsQueueReport']['belongsTo'](db['SmsQueue'],{});db['JscriptyProject'][_0x1211('0x100')](db[_0x1211('0xd7')],{'foreignKey':_0x1211('0x1bb')});db['JscriptyProject'][_0x1211('0x100')](db['JscriptyQuestionReport'],{'foreignKey':_0x1211('0x1bb')});db['JscriptyProject'][_0x1211('0x100')](db['JscriptyAnswerReport'],{'foreignKey':_0x1211('0x1bb')});db[_0x1211('0xe4')][_0x1211('0x114')](db['User'],{'as':_0x1211('0x15b'),'through':_0x1211('0x1bc')});db[_0x1211('0x116')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x154'),'through':_0x1211('0x117')});db[_0x1211('0x116')][_0x1211('0x114')](db['VoiceQueue'],{'through':_0x1211('0x140'),'as':_0x1211('0x11c')});db[_0x1211('0x116')][_0x1211('0x114')](db[_0x1211('0x3e')],{'through':_0x1211('0x155'),'as':_0x1211('0x1bd')});db['Team'][_0x1211('0x114')](db[_0x1211('0x6c')],{'through':'team_has_chat_queues','as':_0x1211('0x11d')});db[_0x1211('0x116')][_0x1211('0x114')](db[_0x1211('0x4f')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0x1211('0x116')][_0x1211('0x114')](db[_0x1211('0x59')],{'through':_0x1211('0x16f'),'as':_0x1211('0x11e')});db[_0x1211('0x116')]['belongsToMany'](db[_0x1211('0x60')],{'through':_0x1211('0x1be'),'as':_0x1211('0x11f')});db['Campaign'][_0x1211('0x100')](db[_0x1211('0x73')],{'as':_0x1211('0x181'),'foreignKey':_0x1211('0x186')});db['Campaign'][_0x1211('0x100')](db[_0x1211('0x76')],{'as':_0x1211('0x104'),'foreignKey':_0x1211('0x186')});db['Campaign'][_0x1211('0x100')](db[_0x1211('0x77')],{'as':_0x1211('0x133'),'foreignKey':_0x1211('0x186')});db['Campaign'][_0x1211('0x100')](db[_0x1211('0x188')],{'as':_0x1211('0x134'),'foreignKey':_0x1211('0x186')});db[_0x1211('0xe9')][_0x1211('0x10e')](db['Trunk'],{'as':'Trunk','foreignKey':_0x1211('0x137')});db['Campaign'][_0x1211('0x10e')](db[_0x1211('0x136')],{'as':_0x1211('0x138'),'foreignKey':_0x1211('0x139')});db[_0x1211('0xe9')][_0x1211('0x10e')](db[_0x1211('0x84')],{'as':_0x1211('0x84'),'foreignKey':_0x1211('0x13a')});db[_0x1211('0xe9')][_0x1211('0x10e')](db['SquareProject'],{'as':_0x1211('0xe4'),'foreignKey':'SquareProjectId'});db['Campaign'][_0x1211('0x114')](db[_0x1211('0x121')],{'as':'Lists','through':_0x1211('0x1bf')});db['Campaign'][_0x1211('0x114')](db[_0x1211('0x121')],{'as':_0x1211('0x141'),'through':_0x1211('0x1c0')});db[_0x1211('0xee')][_0x1211('0x10e')](db['MailMessage'],{});db['MailTransferReport']['belongsTo'](db[_0x1211('0x41')],{});db[_0x1211('0xee')]['belongsTo'](db[_0x1211('0x3d')],{'foreignKey':_0x1211('0x1c1'),'as':_0x1211('0x1c2')});db[_0x1211('0xee')]['belongsTo'](db[_0x1211('0x13')],{'foreignKey':'FromUserId','as':_0x1211('0x1c3')});db[_0x1211('0xee')]['belongsTo'](db[_0x1211('0x13')],{'foreignKey':_0x1211('0x1c4'),'as':'ToAgent'});db['MailTransferReport']['belongsTo'](db[_0x1211('0x3e')],{'foreignKey':_0x1211('0x1c5'),'as':_0x1211('0x1c6')});db[_0x1211('0xee')]['belongsTo'](db[_0x1211('0x3d')],{'foreignKey':_0x1211('0x1c7'),'as':_0x1211('0x1c8')});db[_0x1211('0xf0')][_0x1211('0x10e')](db['ChatMessage'],{});db['ChatTransferReport'][_0x1211('0x10e')](db['ChatInteraction'],{});db[_0x1211('0xf0')][_0x1211('0x10e')](db[_0x1211('0x62')],{'foreignKey':'FromChatWebsiteId','as':_0x1211('0x1c2')});db[_0x1211('0xf0')][_0x1211('0x10e')](db[_0x1211('0x13')],{'foreignKey':_0x1211('0x1c9'),'as':_0x1211('0x1c3')});db[_0x1211('0xf0')]['belongsTo'](db[_0x1211('0x13')],{'foreignKey':_0x1211('0x1c4'),'as':_0x1211('0x1ca')});db['ChatTransferReport'][_0x1211('0x10e')](db[_0x1211('0x6c')],{'foreignKey':_0x1211('0x1cb'),'as':_0x1211('0x1c6')});db[_0x1211('0xf0')][_0x1211('0x10e')](db[_0x1211('0x62')],{'foreignKey':_0x1211('0x1cc'),'as':'ToAccount'});db[_0x1211('0x1cd')][_0x1211('0x10e')](db['FaxMessage'],{});db[_0x1211('0x1cd')][_0x1211('0x10e')](db[_0x1211('0x10b')],{});db[_0x1211('0x1cd')][_0x1211('0x10e')](db[_0x1211('0x160')],{'foreignKey':_0x1211('0x1ce'),'as':_0x1211('0x1c2')});db['FaxTransferReport'][_0x1211('0x10e')](db[_0x1211('0x13')],{'foreignKey':_0x1211('0x1c9'),'as':_0x1211('0x1c3')});db[_0x1211('0x1cd')][_0x1211('0x10e')](db[_0x1211('0x13')],{'foreignKey':_0x1211('0x1c4'),'as':_0x1211('0x1ca')});db[_0x1211('0x1cd')][_0x1211('0x10e')](db[_0x1211('0x4f')],{'foreignKey':_0x1211('0x1cf'),'as':_0x1211('0x1c6')});db['FaxTransferReport']['belongsTo'](db[_0x1211('0x160')],{'foreignKey':_0x1211('0x1d0'),'as':_0x1211('0x1c8')});db[_0x1211('0xf3')]['belongsTo'](db[_0x1211('0x171')],{});db[_0x1211('0xf3')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x1211('0x10e')](db[_0x1211('0x5b')],{'foreignKey':_0x1211('0x1d1'),'as':_0x1211('0x1c2')});db[_0x1211('0xf3')][_0x1211('0x10e')](db[_0x1211('0x13')],{'foreignKey':_0x1211('0x1c9'),'as':_0x1211('0x1c3')});db[_0x1211('0xf3')][_0x1211('0x10e')](db[_0x1211('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x1211('0xf3')][_0x1211('0x10e')](db[_0x1211('0x60')],{'foreignKey':_0x1211('0x1d2'),'as':_0x1211('0x1c6')});db[_0x1211('0xf3')][_0x1211('0x10e')](db[_0x1211('0x5b')],{'foreignKey':_0x1211('0x1d3'),'as':'ToAccount'});db[_0x1211('0xf4')]['belongsTo'](db[_0x1211('0x58')],{});db[_0x1211('0xf4')][_0x1211('0x10e')](db['SmsInteraction'],{});db[_0x1211('0xf4')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x1211('0x1d4'),'as':_0x1211('0x1c2')});db[_0x1211('0xf4')][_0x1211('0x10e')](db['User'],{'foreignKey':_0x1211('0x1c9'),'as':_0x1211('0x1c3')});db['SmsTransferReport']['belongsTo'](db[_0x1211('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x1211('0xf4')][_0x1211('0x10e')](db[_0x1211('0x59')],{'foreignKey':_0x1211('0x1d5'),'as':_0x1211('0x1c6')});db[_0x1211('0xf4')]['belongsTo'](db[_0x1211('0x53')],{'foreignKey':_0x1211('0x1d6'),'as':'ToAccount'});db[_0x1211('0x121')]['hasMany'](db[_0x1211('0x14e')],{'as':_0x1211('0x161'),'foreignKey':_0x1211('0x164')});db['CmList'][_0x1211('0x100')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0x1211('0x164')});db[_0x1211('0x121')][_0x1211('0x100')](db[_0x1211('0x71')],{'as':_0x1211('0x113'),'onDelete':_0x1211('0xfe'),'foreignKey':_0x1211('0x164')});db[_0x1211('0x121')]['hasMany'](db[_0x1211('0x76')],{'as':_0x1211('0x104'),'foreignKey':'ListId'});db[_0x1211('0x121')][_0x1211('0x100')](db[_0x1211('0x77')],{'as':'HopperHistory','foreignKey':_0x1211('0x164')});db[_0x1211('0x121')][_0x1211('0x100')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x1211('0x164')});db[_0x1211('0x121')]['belongsToMany'](db[_0x1211('0x1b')],{'as':_0x1211('0x1d7'),'through':_0x1211('0x13e')});db[_0x1211('0x121')][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x154'),'through':_0x1211('0x115')});db[_0x1211('0xf6')][_0x1211('0x100')](db[_0x1211('0x18')],{'as':'Extensions','onDelete':_0x1211('0x15e')});db['VoicePrefix'][_0x1211('0x114')](db[_0x1211('0x13')],{'as':_0x1211('0x154'),'through':_0x1211('0x123')});db['UserProfile'][_0x1211('0x100')](db['User'],{'as':'Users','foreignKey':_0x1211('0x10f')});db['UserProfile'][_0x1211('0x100')](db['UserProfileSection'],{'as':_0x1211('0x1d8'),'foreignKey':'userProfileId','onDelete':_0x1211('0xfe')});db[_0x1211('0x1d9')][_0x1211('0x100')](db['UserProfileResource'],{'as':_0x1211('0x1da'),'foreignKey':_0x1211('0x1db'),'onDelete':'cascade'});module[_0x1211('0x1dc')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x49cc=['FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','CmList','cm_user_has_lists','VoicePrefixes','user_has_chat_websites','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperBlack','JscriptySessionReport','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','AgentReports','Contact','ContactId','MailAccount','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','TemplateId','team_has_mail_queues','Teams','MailInteractionId','mail_interaction_has_tags','Tags','user_has_mail_interactions','Attachments','Interaction','Account','Tag','restrict','TagId','MailQueueReport','ListId','DashboardItem','Items','FaxAccountId','Exntensions','FaxInteractionId','Owner','fax_interaction_has_tags','ThroughTags','Users','user_has_fax_interactions','AttachmentId','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelInteraction','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','OpenchannelQueueReport','Agent','ChatQueue','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatMessage','ChatOfflineMessage','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','CustomReportId','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','SugarcrmField','Subjects','VariableId','DeskAccount','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','ServicenowField','FreshsalesField','FromId','ToId','SessionId','SmsQueueReport','ProjectId','team_has_fax_queues','team_has_openchannel_queues','HopperHistories','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToAgent','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','HopperHistory','Queues','VoicePrefix','UserProfileSection','UserProfileSections','Resources','sectionId','exports','path','jstz','determine','sequelize','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','database','username','options','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','hasOne','cascade','UserId','VoiceRecording','Recordings','hasMany','Extensions','HopperFinals','CmHopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','user_has_teams','MailInteractions','user_has_chat_interactions','FaxInteraction','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','UserChatQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49cc,0xc3));var _0xc49c=function(_0x417291,_0x1d64e6){_0x417291=_0x417291-0x0;var _0x5202b3=_0x49cc[_0x417291];return _0x5202b3;};'use strict';var path=require(_0xc49c('0x0'));var config=require('../config/environment');var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xc49c('0x1'));var timezone=jstz[_0xc49c('0x2')]();config[_0xc49c('0x3')]=_[_0xc49c('0x4')](config[_0xc49c('0x3')],{'database':'motion2','username':_0xc49c('0x5'),'password':_0xc49c('0x6'),'options':{'host':_0xc49c('0x7'),'port':0xcea,'dialect':_0xc49c('0x8'),'dialectOptions':{'charset':_0xc49c('0x9')},'logging':![],'timezone':timezone[_0xc49c('0xa')](),'define':{'charset':_0xc49c('0xb'),'collate':_0xc49c('0xc')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0xc49c('0xd')],{'database':_0xc49c('0xe'),'username':_0xc49c('0x5'),'password':'xC@LL1234','options':{'host':_0xc49c('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xc49c('0xa')](),'define':{'charset':_0xc49c('0xb'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc49c('0x3')][_0xc49c('0xf')],config[_0xc49c('0x3')][_0xc49c('0x10')],config['sequelize']['password'],config[_0xc49c('0x3')][_0xc49c('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc49c('0xd')][_0xc49c('0xf')],config[_0xc49c('0xd')]['username'],config[_0xc49c('0xd')][_0xc49c('0x12')],config['sequelizeHistory'][_0xc49c('0x11')])};db[_0xc49c('0x13')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x15'));db[_0xc49c('0x16')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x17'));db[_0xc49c('0x18')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x19'));db[_0xc49c('0x1a')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x1b'));db['VoiceMusicOnHold']=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x1c'));db[_0xc49c('0x1d')]=db[_0xc49c('0x3')]['import'](_0xc49c('0x1e'));db['VoiceRecording']=db['sequelize']['import'](_0xc49c('0x1f'));db[_0xc49c('0x20')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x21'));db[_0xc49c('0x22')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/voiceMail/voiceMail.model');db[_0xc49c('0x23')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xc49c('0x24')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x25'));db[_0xc49c('0x26')]=db[_0xc49c('0x3')]['import'](_0xc49c('0x27'));db[_0xc49c('0x28')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x29'));db['VoiceQueueReport']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x2a'));db[_0xc49c('0x2b')]=db['sequelize'][_0xc49c('0x14')]('../api/memberReport/memberReport.model');db[_0xc49c('0x2c')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/trunk/trunk.model');db[_0xc49c('0x2d')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x2e'));db[_0xc49c('0x2f')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x30'));db[_0xc49c('0x31')]=db[_0xc49c('0x3')]['import'](_0xc49c('0x32'));db['UserChatQueue']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x33'));db[_0xc49c('0x34')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x35'));db[_0xc49c('0x36')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x37'));db[_0xc49c('0x38')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x39'));db['UserOpenchannelQueue']=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x3a'));db[_0xc49c('0x3b')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x3c'));db[_0xc49c('0x3d')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x3e'));db['MailAccount']=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x3f'));db[_0xc49c('0x40')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x41'));db['MailSubstatus']=db['sequelize'][_0xc49c('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0xc49c('0x42')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x43'));db[_0xc49c('0x44')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x45'));db['MailApplication']=db['sequelize']['import'](_0xc49c('0x46'));db['MailQueueReport']=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/mailQueueReport/mailQueueReport.model');db[_0xc49c('0x47')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x48'));db['DashboardItem']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x49'));db[_0xc49c('0x4a')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/faxAccount/faxAccount.model');db[_0xc49c('0x4b')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x4c'));db['FaxInteraction']=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0xc49c('0x4d')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x4e'));db[_0xc49c('0x4f')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x50'));db[_0xc49c('0x51')]=db['sequelize']['import']('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db['sequelize']['import']('../api/smsAccount/smsAccount.model');db[_0xc49c('0x52')]=db[_0xc49c('0x3')]['import'](_0xc49c('0x53'));db[_0xc49c('0x54')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x55'));db[_0xc49c('0x56')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/smsMessage/smsMessage.model');db[_0xc49c('0x57')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/smsQueue/smsQueue.model');db[_0xc49c('0x58')]=db['sequelize']['import']('../api/openchannelAccount/openchannelAccount.model');db[_0xc49c('0x59')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x5a'));db['OpenchannelInteraction']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x5b'));db[_0xc49c('0x5c')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0xc49c('0x5d')]=db[_0xc49c('0x3')]['import'](_0xc49c('0x5e'));db[_0xc49c('0x5f')]=db[_0xc49c('0x3')]['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x60'));db[_0xc49c('0x61')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x62'));db[_0xc49c('0x63')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x64'));db['ChatMessage']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x65'));db['ChatOfflineMessage']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x66'));db['ChatQueue']=db[_0xc49c('0x3')]['import']('../api/chatQueue/chatQueue.model');db[_0xc49c('0x67')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x68'));db[_0xc49c('0x69')]=db['sequelize']['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0xc49c('0x6a')]=db[_0xc49c('0x3')]['import']('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x6b'));db[_0xc49c('0x6c')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x6d'));db['CmHopperBlack']=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xc49c('0x6e')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x6f'));db['CmHopperHistory']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x70'));db[_0xc49c('0x71')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x72'));db[_0xc49c('0x73')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x74'));db[_0xc49c('0x75')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x76'));db['Automation']=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/automation/automation.model');db[_0xc49c('0x77')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x78'));db[_0xc49c('0x79')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x7a'));db[_0xc49c('0x7b')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x7c'));db[_0xc49c('0x7d')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x7e'));db[_0xc49c('0x7f')]=db['sequelize']['import']('../api/pause/pause.model');db[_0xc49c('0x80')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x81'));db[_0xc49c('0x82')]=db[_0xc49c('0x3')]['import'](_0xc49c('0x83'));db[_0xc49c('0x84')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x85'));db[_0xc49c('0x86')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x87'));db['Tag']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x88'));db[_0xc49c('0x89')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x8a'));db[_0xc49c('0x8b')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x8c'));db[_0xc49c('0x8d')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0x8e'));db['Integration']=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/integration/integration.model');db[_0xc49c('0x8f')]=db[_0xc49c('0x3')]['import']('../api/integrationReport/integrationReport.model');db[_0xc49c('0x90')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x91'));db[_0xc49c('0x92')]=db['sequelize']['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xc49c('0x93')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x94'));db[_0xc49c('0x95')]=db[_0xc49c('0x3')]['import'](_0xc49c('0x96'));db[_0xc49c('0x97')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize'][_0xc49c('0x14')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0xc49c('0x3')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xc49c('0x98')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x99'));db['SalesforceField']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x9a'));db[_0xc49c('0x9b')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x9c'));db[_0xc49c('0x9d')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x9e'));db['SugarcrmField']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0x9f'));db['DeskAccount']=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xa0'));db['DeskField']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xa1'));db[_0xc49c('0xa2')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xa3'));db[_0xc49c('0xa4')]=db['sequelize'][_0xc49c('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xc49c('0xa5')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xa6'));db[_0xc49c('0xa7')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xa8'));db[_0xc49c('0xa9')]=db[_0xc49c('0x3')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db['sequelize']['import']('../api/intZendeskField/intZendeskField.model');db[_0xc49c('0xaa')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xc49c('0xab')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xac'));db[_0xc49c('0xad')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xae'));db[_0xc49c('0xaf')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xb0'));db[_0xc49c('0xb1')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xb2'));db[_0xc49c('0xb3')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xb4'));db[_0xc49c('0xb5')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xb6'));db['ServicenowConfiguration']=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xb7'));db['ServicenowField']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xb8'));db[_0xc49c('0xb9')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xba'));db[_0xc49c('0xbb')]=db[_0xc49c('0x3')]['import'](_0xc49c('0xbc'));db[_0xc49c('0xbd')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xbe'));db[_0xc49c('0xbf')]=db[_0xc49c('0x3')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xc49c('0xc0')]=db[_0xc49c('0x3')]['import'](_0xc49c('0xc1'));db['FreshsalesField']=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xc2'));db[_0xc49c('0xc3')]=db[_0xc49c('0x3')]['import']('../api/integration/integration.model');db['Network']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xc4'));db[_0xc49c('0xc5')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xc6'));db[_0xc49c('0xc7')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xc8'));db[_0xc49c('0xc9')]=db[_0xc49c('0x3')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xc49c('0xca')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xcb'));db['JscriptySessionReport']=db['sequelize']['import'](_0xc49c('0xcc'));db['SmsQueueReport']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xcd'));db[_0xc49c('0xce')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xcf'));db['SquareDetailsReport']=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xd0'));db[_0xc49c('0xd1')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xd2'));db['Setting']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xd3'));db[_0xc49c('0xd4')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xd5'));db['SquareProject']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xd6'));db[_0xc49c('0xd7')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xd8'));db[_0xc49c('0xd9')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xda'));db[_0xc49c('0xdb')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xdc'));db[_0xc49c('0xdd')]=db['sequelize']['import'](_0xc49c('0xde'));db['Campaign']=db[_0xc49c('0x3')]['import'](_0xc49c('0xdf'));db[_0xc49c('0xe0')]=db[_0xc49c('0x3')]['import'](_0xc49c('0xe1'));db[_0xc49c('0xe2')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xe3'));db[_0xc49c('0xe4')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xe5'));db[_0xc49c('0xe6')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xe7'));db[_0xc49c('0xe8')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xe9'));db[_0xc49c('0xea')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xeb'));db[_0xc49c('0xec')]=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xed'));db[_0xc49c('0xee')]=db['sequelize'][_0xc49c('0x14')](_0xc49c('0xef'));db['CmList']=db[_0xc49c('0x3')]['import']('../api/cmList/cmList.model');db['VoicePrefix']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xf0'));db[_0xc49c('0xf1')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xc49c('0x3')][_0xc49c('0x14')](_0xc49c('0xf2'));db[_0xc49c('0xf3')]=db[_0xc49c('0x3')][_0xc49c('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0xc49c('0x13')][_0xc49c('0xf4')](db[_0xc49c('0x22')],{'as':_0xc49c('0x22'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x13')]['hasMany'](db[_0xc49c('0xf7')],{'as':_0xc49c('0xf8'),'foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x13')][_0xc49c('0xf9')](db[_0xc49c('0x2f')],{'as':'VoiceQueuesRt','foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x13')][_0xc49c('0xf9')](db[_0xc49c('0x1a')],{'as':_0xc49c('0xfa'),'onDelete':_0xc49c('0xf5'),'hooks':!![]});db['User'][_0xc49c('0xf9')](db[_0xc49c('0x6e')],{'as':_0xc49c('0xfb'),'foreignKey':_0xc49c('0xf6')});db['User']['hasMany'](db[_0xc49c('0xfc')],{'as':'HopperHistory','foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x13')][_0xc49c('0xf9')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xc49c('0xf6')});db['User'][_0xc49c('0xf9')](db['OpenchannelInteraction'],{'as':_0xc49c('0xfd'),'foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x13')][_0xc49c('0xf9')](db[_0xc49c('0x63')],{'as':_0xc49c('0xfe'),'foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x13')][_0xc49c('0xf9')](db[_0xc49c('0x54')],{'as':_0xc49c('0xff'),'foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x13')][_0xc49c('0xf9')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0xc49c('0x13')][_0xc49c('0xf9')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xc49c('0xf6')});db['User']['belongsTo'](db[_0xc49c('0xf1')],{'as':_0xc49c('0xf1'),'foreignKey':_0xc49c('0x100')});db[_0xc49c('0x13')][_0xc49c('0x101')](db[_0xc49c('0x67')],{'as':_0xc49c('0x102'),'through':_0xc49c('0x103')});db[_0xc49c('0x13')][_0xc49c('0x101')](db[_0xc49c('0x104')],{'as':_0xc49c('0x105'),'through':_0xc49c('0x106')});db[_0xc49c('0x13')][_0xc49c('0x101')](db['CmList'],{'as':'Lists','through':'cm_user_has_lists'});db[_0xc49c('0x13')]['belongsToMany'](db[_0xc49c('0xdb')],{'through':_0xc49c('0x107')});db[_0xc49c('0x13')]['belongsToMany'](db[_0xc49c('0x42')],{'as':_0xc49c('0x108'),'through':'user_has_mail_interactions'});db[_0xc49c('0x13')][_0xc49c('0x101')](db[_0xc49c('0x63')],{'as':_0xc49c('0xfe'),'through':_0xc49c('0x109')});db[_0xc49c('0x13')][_0xc49c('0x101')](db[_0xc49c('0x10a')],{'as':_0xc49c('0x10b'),'through':'user_has_fax_interactions'});db[_0xc49c('0x13')][_0xc49c('0x101')](db[_0xc49c('0x54')],{'as':_0xc49c('0xff'),'through':_0xc49c('0x10c')});db[_0xc49c('0x13')][_0xc49c('0x101')](db['OpenchannelInteraction'],{'as':_0xc49c('0xfd'),'through':_0xc49c('0x10d')});db['User']['belongsToMany'](db[_0xc49c('0x1d')],{'as':_0xc49c('0x10e'),'through':'UserVoiceQueue','required':![]});db['User'][_0xc49c('0x101')](db['MailQueue'],{'as':_0xc49c('0x10f'),'through':_0xc49c('0x34'),'required':![]});db[_0xc49c('0x13')][_0xc49c('0x101')](db['ChatQueue'],{'as':'ChatQueues','through':_0xc49c('0x110'),'required':![],'hooks':!![]});db[_0xc49c('0x13')][_0xc49c('0x101')](db['FaxQueue'],{'as':_0xc49c('0x111'),'through':'UserFaxQueue','required':![]});db[_0xc49c('0x13')][_0xc49c('0x101')](db[_0xc49c('0x57')],{'as':_0xc49c('0x112'),'through':_0xc49c('0x38'),'required':![]});db[_0xc49c('0x13')][_0xc49c('0x101')](db[_0xc49c('0x5d')],{'as':_0xc49c('0x113'),'through':_0xc49c('0x114'),'required':![]});db[_0xc49c('0x13')]['belongsToMany'](db[_0xc49c('0x115')],{'through':_0xc49c('0x116')});db[_0xc49c('0x13')][_0xc49c('0x101')](db['VoicePrefix'],{'as':_0xc49c('0x117'),'through':'user_has_voice_prefixes','required':![]});db['User']['belongsToMany'](db[_0xc49c('0x5f')],{'as':'ChatWebsites','through':_0xc49c('0x118')});db[_0xc49c('0x13')]['belongsToMany'](db[_0xc49c('0x4a')],{'as':'FaxAccounts','through':_0xc49c('0x119')});db['User'][_0xc49c('0x101')](db['MailAccount'],{'as':'MailAccounts','through':_0xc49c('0x11a')});db[_0xc49c('0x13')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0xc49c('0x11b'),'through':_0xc49c('0x11c')});db[_0xc49c('0x13')][_0xc49c('0x101')](db[_0xc49c('0x11d')],{'as':_0xc49c('0x11e'),'through':_0xc49c('0x11f')});db[_0xc49c('0x13')][_0xc49c('0x101')](db[_0xc49c('0x120')],{'as':_0xc49c('0x121'),'through':_0xc49c('0x122')});db[_0xc49c('0x16')][_0xc49c('0xf9')](db[_0xc49c('0x1a')],{'as':_0xc49c('0x123'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x124')});db[_0xc49c('0x18')][_0xc49c('0xf9')](db['VoiceExtension'],{'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x1a')][_0xc49c('0xf9')](db[_0xc49c('0x1a')],{'as':_0xc49c('0x125'),'onDelete':'cascade'});db[_0xc49c('0x126')][_0xc49c('0x101')](db[_0xc49c('0x86')],{'as':_0xc49c('0x127'),'through':_0xc49c('0x128')});db[_0xc49c('0x1d')]['hasMany'](db[_0xc49c('0x2f')],{'as':_0xc49c('0x129'),'foreignKey':_0xc49c('0x12a')});db[_0xc49c('0x1d')]['hasMany'](db[_0xc49c('0x6c')],{'as':_0xc49c('0x12b'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xc49c('0xf9')](db[_0xc49c('0x6e')],{'as':_0xc49c('0xfb'),'foreignKey':_0xc49c('0x12a')});db[_0xc49c('0x1d')][_0xc49c('0xf9')](db[_0xc49c('0xfc')],{'as':'HopperHistories','foreignKey':_0xc49c('0x12a')});db[_0xc49c('0x1d')][_0xc49c('0xf9')](db[_0xc49c('0x71')],{'as':_0xc49c('0x71'),'foreignKey':_0xc49c('0x12a')});db[_0xc49c('0x1d')][_0xc49c('0xf9')](db[_0xc49c('0x12c')],{'as':'HopperBlacks','foreignKey':_0xc49c('0x12a')});db[_0xc49c('0x1d')][_0xc49c('0xf9')](db[_0xc49c('0x12d')],{'as':_0xc49c('0x12e'),'foreignKey':_0xc49c('0x12a')});db['VoiceQueue'][_0xc49c('0x12f')](db[_0xc49c('0x2c')],{'as':_0xc49c('0x2c'),'foreignKey':_0xc49c('0x130')});db[_0xc49c('0x1d')][_0xc49c('0x12f')](db['Trunk'],{'as':_0xc49c('0x131'),'foreignKey':_0xc49c('0x132')});db[_0xc49c('0x1d')][_0xc49c('0x12f')](db[_0xc49c('0x7d')],{'as':_0xc49c('0x7d'),'foreignKey':_0xc49c('0x133')});db[_0xc49c('0x1d')][_0xc49c('0x12f')](db['Pause'],{'as':_0xc49c('0x134'),'foreignKey':_0xc49c('0x135')});db[_0xc49c('0x1d')][_0xc49c('0x101')](db[_0xc49c('0x115')],{'as':_0xc49c('0x136'),'through':_0xc49c('0x137')});db[_0xc49c('0x1d')][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':_0xc49c('0x138'),'through':_0xc49c('0x31')});db[_0xc49c('0x1d')][_0xc49c('0x101')](db[_0xc49c('0xdb')],{'as':'Teams','through':'team_has_voice_queues'});db['VoiceQueue'][_0xc49c('0x101')](db[_0xc49c('0x115')],{'as':_0xc49c('0x139'),'through':_0xc49c('0x13a')});db[_0xc49c('0xf7')][_0xc49c('0x12f')](db['User'],{'as':_0xc49c('0x13'),'foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x20')]['belongsTo'](db[_0xc49c('0x13')],{'as':'User','foreignKey':_0xc49c('0xf6')});db['VoiceMail'][_0xc49c('0xf9')](db[_0xc49c('0x23')],{'as':_0xc49c('0x13b'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x13c'),'sourceKey':_0xc49c('0x13d')});db[_0xc49c('0x23')][_0xc49c('0x12f')](db[_0xc49c('0x22')],{'foreignKey':_0xc49c('0x13c'),'targetKey':_0xc49c('0x13d')});db['VoiceCallReport']['hasMany'](db[_0xc49c('0x13e')],{'as':'QueueCalls','foreignKey':_0xc49c('0x13f'),'constraints':![]});db[_0xc49c('0x24')][_0xc49c('0xf9')](db[_0xc49c('0x28')],{'as':_0xc49c('0x140'),'foreignKey':_0xc49c('0x13f'),'constraints':![]});db['VoiceCallReport'][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'as':'User','foreignKey':_0xc49c('0xf6')});db['VoiceCallReport'][_0xc49c('0x12f')](db['CmContact'],{'as':_0xc49c('0x141'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x3b')][_0xc49c('0x12f')](db[_0xc49c('0x143')],{'as':_0xc49c('0x143'),'foreignKey':_0xc49c('0x144')});db[_0xc49c('0x3d')][_0xc49c('0x12f')](db[_0xc49c('0x143')],{'as':_0xc49c('0x143'),'foreignKey':'MailAccountId'});db[_0xc49c('0x143')]['hasOne'](db[_0xc49c('0x3b')],{'as':_0xc49c('0x145'),'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x143')][_0xc49c('0xf4')](db[_0xc49c('0x3d')],{'as':_0xc49c('0x146'),'onDelete':'cascade'});db[_0xc49c('0x143')][_0xc49c('0xf9')](db[_0xc49c('0x79')],{'as':_0xc49c('0x147'),'foreignKey':_0xc49c('0x144')});db[_0xc49c('0x143')][_0xc49c('0xf9')](db[_0xc49c('0x77')],{'as':_0xc49c('0x148'),'foreignKey':_0xc49c('0x144')});db[_0xc49c('0x143')][_0xc49c('0xf9')](db[_0xc49c('0x44')],{'as':_0xc49c('0x13b'),'foreignKey':_0xc49c('0x144')});db[_0xc49c('0x143')][_0xc49c('0xf9')](db[_0xc49c('0x42')],{'as':_0xc49c('0x149')});db[_0xc49c('0x143')][_0xc49c('0xf9')](db[_0xc49c('0x14a')],{'as':_0xc49c('0x125')});db['MailAccount'][_0xc49c('0x12f')](db[_0xc49c('0x115')],{'as':_0xc49c('0x14b'),'foreignKey':'ListId'});db[_0xc49c('0x143')][_0xc49c('0x12f')](db['Template'],{'as':_0xc49c('0x89'),'foreignKey':_0xc49c('0x14c')});db[_0xc49c('0x143')][_0xc49c('0x12f')](db[_0xc49c('0x7f')],{'as':_0xc49c('0x134'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc49c('0x143')][_0xc49c('0x101')](db['User'],{'as':'Agents','through':'user_has_mail_accounts'});db[_0xc49c('0x40')][_0xc49c('0x101')](db['User'],{'as':_0xc49c('0x138'),'through':_0xc49c('0x34')});db['MailQueue'][_0xc49c('0x101')](db['Team'],{'through':_0xc49c('0x14d'),'as':_0xc49c('0x14e')});db[_0xc49c('0x42')][_0xc49c('0xf9')](db[_0xc49c('0x44')],{'as':_0xc49c('0x13b'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x14f')});db[_0xc49c('0x42')][_0xc49c('0x12f')](db[_0xc49c('0x143')],{'as':'Account','foreignKey':'MailAccountId'});db['MailInteraction'][_0xc49c('0x12f')](db[_0xc49c('0x104')],{'as':_0xc49c('0x141'),'foreignKey':'ContactId'});db[_0xc49c('0x42')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x42')][_0xc49c('0x101')](db['Tag'],{'through':_0xc49c('0x150'),'as':_0xc49c('0x151')});db[_0xc49c('0x42')][_0xc49c('0x101')](db['Tag'],{'through':_0xc49c('0x150'),'as':'ThroughTags'});db[_0xc49c('0x42')][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':'Users','through':_0xc49c('0x152'),'foreignKey':'MailInteractionId'});db[_0xc49c('0x44')][_0xc49c('0xf9')](db['Attachment'],{'as':_0xc49c('0x153'),'onDelete':'cascade'});db[_0xc49c('0x44')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'as':'User'});db[_0xc49c('0x44')]['belongsTo'](db['CmContact'],{'onDelete':_0xc49c('0xf5'),'as':_0xc49c('0x141')});db['MailMessage'][_0xc49c('0x12f')](db[_0xc49c('0x42')],{'as':_0xc49c('0x154'),'foreignKey':_0xc49c('0x14f')});db[_0xc49c('0x44')][_0xc49c('0x12f')](db[_0xc49c('0x143')],{'as':_0xc49c('0x155'),'foreignKey':'MailAccountId'});db[_0xc49c('0x14a')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db['MailQueue'],{'onDelete':'restrict'});db[_0xc49c('0x14a')][_0xc49c('0x12f')](db[_0xc49c('0x143')],{'onDelete':'restrict'});db['MailApplication'][_0xc49c('0x12f')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db['MailApplication'][_0xc49c('0x12f')](db[_0xc49c('0x156')],{'onDelete':_0xc49c('0x157'),'foreignKey':_0xc49c('0x158')});db[_0xc49c('0x159')][_0xc49c('0x12f')](db[_0xc49c('0x143')],{});db[_0xc49c('0x159')][_0xc49c('0x12f')](db['CmList'],{'as':_0xc49c('0x14b'),'foreignKey':_0xc49c('0x15a')});db[_0xc49c('0x159')]['belongsTo'](db[_0xc49c('0x104')],{'as':_0xc49c('0x141'),'foreignKey':_0xc49c('0x142')});db['MailQueueReport']['belongsTo'](db[_0xc49c('0x42')],{});db[_0xc49c('0x159')][_0xc49c('0x12f')](db['MailMessage'],{});db[_0xc49c('0x159')][_0xc49c('0x12f')](db['User'],{});db[_0xc49c('0x159')]['belongsTo'](db[_0xc49c('0x40')],{});db[_0xc49c('0x47')][_0xc49c('0xf9')](db[_0xc49c('0x15b')],{'as':_0xc49c('0x15c'),'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x4a')][_0xc49c('0xf9')](db[_0xc49c('0x79')],{'as':'Dispositions','foreignKey':_0xc49c('0x15d')});db[_0xc49c('0x4a')][_0xc49c('0xf9')](db[_0xc49c('0x77')],{'as':_0xc49c('0x148'),'foreignKey':_0xc49c('0x15d')});db[_0xc49c('0x4a')][_0xc49c('0xf9')](db[_0xc49c('0x10a')],{'as':'Interactions'});db[_0xc49c('0x4a')][_0xc49c('0xf9')](db['FaxApplication'],{'as':_0xc49c('0x125')});db[_0xc49c('0x4a')]['hasMany'](db['VoiceExtension'],{'as':_0xc49c('0x15e'),'onDelete':'cascade'});db[_0xc49c('0x4a')][_0xc49c('0xf9')](db[_0xc49c('0x4d')],{'as':'Messages'});db[_0xc49c('0x4a')]['belongsTo'](db['Trunk'],{'as':'Trunk'});db[_0xc49c('0x4a')][_0xc49c('0x12f')](db['CmList'],{'as':_0xc49c('0x14b'),'foreignKey':_0xc49c('0x15a')});db[_0xc49c('0x4a')][_0xc49c('0x12f')](db[_0xc49c('0x7f')],{'as':_0xc49c('0x134'),'foreignKey':_0xc49c('0x135')});db[_0xc49c('0x4a')][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':_0xc49c('0x138'),'through':_0xc49c('0x119')});db[_0xc49c('0x4b')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'onDelete':_0xc49c('0x157')});db[_0xc49c('0x4b')][_0xc49c('0x12f')](db[_0xc49c('0x4f')],{'onDelete':_0xc49c('0x157')});db[_0xc49c('0x4b')][_0xc49c('0x12f')](db[_0xc49c('0x4a')],{'onDelete':_0xc49c('0x157')});db[_0xc49c('0x4b')][_0xc49c('0x12f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xc49c('0x158')});db['FaxInteraction'][_0xc49c('0xf9')](db['FaxMessage'],{'as':_0xc49c('0x13b'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x15f')});db[_0xc49c('0x10a')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxInteraction']['belongsTo'](db[_0xc49c('0x104')],{'as':_0xc49c('0x141'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x10a')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'as':_0xc49c('0x160'),'foreignKey':'UserId'});db[_0xc49c('0x10a')][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x161'),'as':_0xc49c('0x151')});db[_0xc49c('0x10a')]['belongsToMany'](db[_0xc49c('0x156')],{'through':_0xc49c('0x161'),'as':_0xc49c('0x162')});db[_0xc49c('0x10a')][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':_0xc49c('0x163'),'through':_0xc49c('0x164'),'foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db[_0xc49c('0x13')],{'onDelete':'cascade','as':_0xc49c('0x13')});db['FaxMessage'][_0xc49c('0x12f')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xc49c('0x15f')});db[_0xc49c('0x4d')][_0xc49c('0x12f')](db[_0xc49c('0x104')],{'onDelete':_0xc49c('0xf5'),'as':_0xc49c('0x141')});db['FaxMessage'][_0xc49c('0x12f')](db[_0xc49c('0xe2')],{'as':_0xc49c('0xe2'),'foreignKey':_0xc49c('0x165')});db[_0xc49c('0x4d')][_0xc49c('0x12f')](db['FaxAccount'],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x15d')});db[_0xc49c('0x4f')][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':_0xc49c('0x138'),'through':_0xc49c('0x36')});db[_0xc49c('0x4f')]['belongsToMany'](db[_0xc49c('0xdb')],{'through':'team_has_fax_queues','as':_0xc49c('0x14e')});db['FaxQueueReport']['belongsTo'](db[_0xc49c('0x4a')],{});db[_0xc49c('0x51')][_0xc49c('0x12f')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xc49c('0x51')][_0xc49c('0x12f')](db[_0xc49c('0x104')],{'as':_0xc49c('0x141'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x51')][_0xc49c('0x12f')](db[_0xc49c('0x10a')],{});db[_0xc49c('0x51')][_0xc49c('0x12f')](db[_0xc49c('0x4d')],{});db[_0xc49c('0x51')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{});db[_0xc49c('0x51')][_0xc49c('0x12f')](db['FaxQueue'],{});db[_0xc49c('0x11d')][_0xc49c('0xf9')](db[_0xc49c('0x79')],{'as':_0xc49c('0x147'),'foreignKey':'SmsAccountId'});db[_0xc49c('0x11d')][_0xc49c('0xf9')](db[_0xc49c('0x77')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0xc49c('0x11d')]['hasMany'](db['SmsMessage'],{'as':_0xc49c('0x13b'),'foreignKey':_0xc49c('0x166')});db[_0xc49c('0x11d')][_0xc49c('0xf9')](db['SmsInteraction'],{'as':_0xc49c('0x149')});db[_0xc49c('0x11d')]['hasMany'](db['SmsApplication'],{'as':_0xc49c('0x125')});db[_0xc49c('0x11d')][_0xc49c('0x12f')](db[_0xc49c('0x115')],{'as':_0xc49c('0x14b'),'foreignKey':'ListId'});db['SmsAccount']['belongsTo'](db[_0xc49c('0x7f')],{'as':_0xc49c('0x134'),'foreignKey':_0xc49c('0x135')});db[_0xc49c('0x11d')]['belongsToMany'](db['User'],{'as':_0xc49c('0x138'),'through':_0xc49c('0x11f')});db['SmsApplication'][_0xc49c('0x12f')](db['User'],{'onDelete':_0xc49c('0x157')});db[_0xc49c('0x52')][_0xc49c('0x12f')](db['SmsQueue'],{'onDelete':'restrict'});db[_0xc49c('0x52')][_0xc49c('0x12f')](db[_0xc49c('0x11d')],{'onDelete':_0xc49c('0x157')});db['SmsApplication']['belongsTo'](db[_0xc49c('0x7d')],{'onDelete':_0xc49c('0x157'),'foreignKey':_0xc49c('0x133')});db[_0xc49c('0x52')][_0xc49c('0x12f')](db[_0xc49c('0x156')],{'onDelete':_0xc49c('0x157'),'foreignKey':_0xc49c('0x158')});db[_0xc49c('0x54')][_0xc49c('0xf9')](db[_0xc49c('0x56')],{'as':'Messages','onDelete':_0xc49c('0xf5'),'foreignKey':'SmsInteractionId'});db[_0xc49c('0x54')][_0xc49c('0x12f')](db['SmsAccount'],{'as':'Account','foreignKey':_0xc49c('0x166')});db[_0xc49c('0x54')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xc49c('0x142')});db[_0xc49c('0x54')]['belongsTo'](db[_0xc49c('0x13')],{'as':'Owner','foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x54')][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x167'),'as':'Tags'});db['SmsInteraction'][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x167'),'as':_0xc49c('0x162')});db[_0xc49c('0x54')][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':_0xc49c('0x163'),'through':_0xc49c('0x10c'),'foreignKey':_0xc49c('0x168')});db['SmsMessage']['belongsTo'](db[_0xc49c('0x13')],{'as':_0xc49c('0x13')});db[_0xc49c('0x56')][_0xc49c('0x12f')](db[_0xc49c('0x104')],{'onDelete':_0xc49c('0xf5'),'as':_0xc49c('0x141')});db[_0xc49c('0x56')][_0xc49c('0x12f')](db['SmsInteraction'],{'onDelete':_0xc49c('0xf5'),'as':'Interaction','foreignKey':_0xc49c('0x168')});db['SmsMessage'][_0xc49c('0x12f')](db[_0xc49c('0x11d')],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x166')});db['SmsQueue'][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':_0xc49c('0x138'),'through':_0xc49c('0x38'),'foreignKey':_0xc49c('0x169')});db[_0xc49c('0x57')]['belongsToMany'](db[_0xc49c('0xdb')],{'through':'team_has_sms_queues','as':_0xc49c('0x14e')});db[_0xc49c('0x58')][_0xc49c('0xf9')](db[_0xc49c('0x79')],{'as':_0xc49c('0x147'),'foreignKey':_0xc49c('0x16a')});db[_0xc49c('0x58')][_0xc49c('0xf9')](db[_0xc49c('0x77')],{'as':_0xc49c('0x148'),'foreignKey':_0xc49c('0x16a')});db[_0xc49c('0x58')]['hasMany'](db[_0xc49c('0x16b')],{'as':_0xc49c('0x149'),'foreignKey':_0xc49c('0x16a')});db[_0xc49c('0x58')][_0xc49c('0xf9')](db[_0xc49c('0x5c')],{'as':_0xc49c('0x13b'),'foreignKey':_0xc49c('0x16a')});db[_0xc49c('0x58')][_0xc49c('0xf9')](db[_0xc49c('0x59')],{'as':_0xc49c('0x125'),'foreignKey':_0xc49c('0x16a')});db['OpenchannelAccount'][_0xc49c('0x12f')](db[_0xc49c('0x115')],{'as':_0xc49c('0x14b'),'foreignKey':'ListId'});db[_0xc49c('0x58')][_0xc49c('0x12f')](db[_0xc49c('0x7f')],{'as':_0xc49c('0x134'),'foreignKey':_0xc49c('0x135')});db[_0xc49c('0x58')]['belongsToMany'](db['User'],{'as':_0xc49c('0x138'),'through':'user_has_openchannel_accounts'});db[_0xc49c('0x59')]['belongsTo'](db[_0xc49c('0x13')],{'onDelete':_0xc49c('0x157')});db[_0xc49c('0x59')][_0xc49c('0x12f')](db[_0xc49c('0x5d')],{'onDelete':_0xc49c('0x157'),'foreignKey':_0xc49c('0x16c')});db[_0xc49c('0x59')]['belongsTo'](db[_0xc49c('0x58')],{'onDelete':_0xc49c('0x157'),'foreignKey':'OpenchannelAccountId'});db[_0xc49c('0x59')][_0xc49c('0x12f')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xc49c('0x133')});db[_0xc49c('0x59')]['belongsTo'](db[_0xc49c('0x156')],{'onDelete':_0xc49c('0x157'),'foreignKey':_0xc49c('0x158')});db['OpenchannelInteraction'][_0xc49c('0xf9')](db[_0xc49c('0x5c')],{'as':'Messages','onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x16d')});db['OpenchannelInteraction'][_0xc49c('0x12f')](db[_0xc49c('0x58')],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x16a')});db['OpenchannelInteraction'][_0xc49c('0x12f')](db[_0xc49c('0x104')],{'as':_0xc49c('0x141'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x16b')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'as':'Owner','foreignKey':_0xc49c('0xf6')});db['OpenchannelInteraction'][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x16e'),'as':'Tags'});db[_0xc49c('0x16b')][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x16e'),'as':_0xc49c('0x162')});db[_0xc49c('0x16b')]['belongsToMany'](db[_0xc49c('0x13')],{'as':_0xc49c('0x163'),'through':'user_has_openchannel_interactions','foreignKey':_0xc49c('0x16d')});db[_0xc49c('0x5c')][_0xc49c('0x12f')](db['User'],{'onDelete':'cascade','as':_0xc49c('0x13')});db[_0xc49c('0x5c')][_0xc49c('0x12f')](db['CmContact'],{'onDelete':'cascade','as':_0xc49c('0x141')});db[_0xc49c('0x5c')][_0xc49c('0x12f')](db[_0xc49c('0x16b')],{'onDelete':_0xc49c('0xf5'),'as':_0xc49c('0x154'),'foreignKey':_0xc49c('0x16d')});db[_0xc49c('0x5c')]['belongsTo'](db[_0xc49c('0xe2')],{'as':'Attachment','foreignKey':_0xc49c('0x165')});db[_0xc49c('0x5c')]['belongsTo'](db[_0xc49c('0x58')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':'Agents','through':_0xc49c('0x114'),'foreignKey':_0xc49c('0x16c')});db[_0xc49c('0x5d')][_0xc49c('0x101')](db[_0xc49c('0xdb')],{'through':'team_has_openchannel_queues','as':_0xc49c('0x14e')});db[_0xc49c('0x5f')][_0xc49c('0xf9')](db[_0xc49c('0x79')],{'as':_0xc49c('0x147'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0xc49c('0xf9')](db[_0xc49c('0x77')],{'as':'Answers','foreignKey':_0xc49c('0x16f')});db['ChatWebsite']['hasMany'](db['ChatProactiveAction'],{'as':'ProactiveActions'});db[_0xc49c('0x5f')][_0xc49c('0xf9')](db[_0xc49c('0x63')],{'as':_0xc49c('0x149')});db[_0xc49c('0x5f')][_0xc49c('0xf9')](db[_0xc49c('0x61')],{'as':_0xc49c('0x125')});db[_0xc49c('0x5f')]['hasMany'](db['ChatMessage'],{'as':_0xc49c('0x13b')});db[_0xc49c('0x5f')]['belongsTo'](db[_0xc49c('0x115')],{'as':_0xc49c('0x14b'),'foreignKey':_0xc49c('0x15a')});db['ChatWebsite'][_0xc49c('0x12f')](db[_0xc49c('0x7d')],{'as':_0xc49c('0x7d'),'foreignKey':_0xc49c('0x133')});db[_0xc49c('0x5f')][_0xc49c('0x12f')](db['Pause'],{'as':_0xc49c('0x134'),'foreignKey':_0xc49c('0x135')});db['ChatWebsite'][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':_0xc49c('0x138'),'through':_0xc49c('0x118')});db[_0xc49c('0x170')][_0xc49c('0x12f')](db[_0xc49c('0x58')],{});db[_0xc49c('0x170')]['belongsTo'](db[_0xc49c('0x115')],{'as':_0xc49c('0x14b'),'foreignKey':_0xc49c('0x15a')});db['OpenchannelQueueReport'][_0xc49c('0x12f')](db[_0xc49c('0x104')],{'as':_0xc49c('0x141'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x170')][_0xc49c('0x12f')](db[_0xc49c('0x16b')],{});db[_0xc49c('0x170')][_0xc49c('0x12f')](db['OpenchannelMessage'],{});db[_0xc49c('0x170')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{});db[_0xc49c('0x170')]['belongsTo'](db[_0xc49c('0x5d')],{});db['ChatApplication'][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'as':_0xc49c('0x171'),'foreignKey':_0xc49c('0xf6'),'onDelete':_0xc49c('0x157')});db[_0xc49c('0x61')][_0xc49c('0x12f')](db[_0xc49c('0x172')],{'as':_0xc49c('0x173'),'foreignKey':_0xc49c('0x174'),'onDelete':_0xc49c('0x157')});db[_0xc49c('0x61')][_0xc49c('0x12f')](db['ChatWebsite'],{'as':_0xc49c('0x175'),'foreignKey':_0xc49c('0x16f'),'onDelete':_0xc49c('0x157')});db['ChatApplication'][_0xc49c('0x12f')](db['Tag'],{'onDelete':_0xc49c('0x157'),'foreignKey':'TagId'});db['ChatInteraction']['hasMany'](db['ChatMessage'],{'as':_0xc49c('0x13b'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x176')});db[_0xc49c('0x63')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':_0xc49c('0x16f')});db[_0xc49c('0x63')][_0xc49c('0x12f')](db[_0xc49c('0x104')],{'as':_0xc49c('0x141'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x63')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'as':_0xc49c('0x160'),'foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x63')][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x177'),'as':_0xc49c('0x151')});db[_0xc49c('0x63')][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x177'),'as':_0xc49c('0x162')});db[_0xc49c('0x63')]['belongsToMany'](db[_0xc49c('0x13')],{'as':_0xc49c('0x163'),'through':'user_has_chat_interactions','foreignKey':_0xc49c('0x176')});db[_0xc49c('0x178')][_0xc49c('0x12f')](db['User'],{'onDelete':_0xc49c('0xf5'),'as':_0xc49c('0x13')});db[_0xc49c('0x178')]['belongsTo'](db[_0xc49c('0x104')],{'onDelete':_0xc49c('0xf5'),'as':_0xc49c('0x141'),'foreignKey':'ContactId'});db[_0xc49c('0x178')]['belongsTo'](db[_0xc49c('0x63')],{'onDelete':_0xc49c('0xf5'),'as':_0xc49c('0x154'),'foreignKey':_0xc49c('0x176')});db[_0xc49c('0x178')][_0xc49c('0x12f')](db[_0xc49c('0xe2')],{'as':'Attachment','foreignKey':_0xc49c('0x165')});db['ChatMessage'][_0xc49c('0x12f')](db[_0xc49c('0x5f')],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x16f')});db[_0xc49c('0x179')][_0xc49c('0x12f')](db[_0xc49c('0x104')],{'onDelete':'cascade','as':_0xc49c('0x141'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x179')][_0xc49c('0x12f')](db[_0xc49c('0x5f')],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x16f')});db[_0xc49c('0x172')][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':'Agents','through':_0xc49c('0x110'),'hooks':!![]});db[_0xc49c('0x172')]['belongsToMany'](db[_0xc49c('0xdb')],{'through':_0xc49c('0x17a'),'as':'Teams'});db[_0xc49c('0x67')]['hasMany'](db['ChatInternalMessage'],{'as':_0xc49c('0x13b'),'foreignKey':_0xc49c('0x17b'),'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x67')]['belongsToMany'](db[_0xc49c('0x13')],{'as':_0xc49c('0x129'),'through':_0xc49c('0x103')});db[_0xc49c('0x69')][_0xc49c('0x12f')](db[_0xc49c('0x5f')],{'as':'Website','foreignKey':_0xc49c('0x16f')});db[_0xc49c('0x6a')]['hasMany'](db[_0xc49c('0x104')],{'as':_0xc49c('0x105'),'foreignKey':_0xc49c('0x17c')});db['CmContact']['hasMany'](db[_0xc49c('0x6c')],{'as':_0xc49c('0x12b'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x104')][_0xc49c('0xf9')](db[_0xc49c('0x6e')],{'as':_0xc49c('0xfb'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x104')][_0xc49c('0xf9')](db[_0xc49c('0xfc')],{'as':'HopperHistories','foreignKey':_0xc49c('0x142')});db[_0xc49c('0x104')][_0xc49c('0xf9')](db['ReportAgentPreview'],{'as':_0xc49c('0x71'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x104')]['hasMany'](db[_0xc49c('0x12d')],{'as':_0xc49c('0x12e'),'foreignKey':_0xc49c('0x142')});db[_0xc49c('0x104')]['hasMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xc49c('0x142'),'onDelete':_0xc49c('0x157')});db[_0xc49c('0x104')][_0xc49c('0xf9')](db[_0xc49c('0x63')],{'as':'ChatInteractions','foreignKey':_0xc49c('0x142'),'onDelete':_0xc49c('0x157')});db[_0xc49c('0x104')][_0xc49c('0xf9')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xc49c('0x142'),'onDelete':_0xc49c('0x157')});db[_0xc49c('0x104')][_0xc49c('0xf9')](db['FaxInteraction'],{'as':_0xc49c('0x10b'),'foreignKey':'ContactId','onDelete':_0xc49c('0x157')});db[_0xc49c('0x104')][_0xc49c('0xf9')](db[_0xc49c('0x42')],{'as':_0xc49c('0x108'),'foreignKey':_0xc49c('0x142'),'onDelete':_0xc49c('0x157')});db[_0xc49c('0x104')][_0xc49c('0x12f')](db[_0xc49c('0x6a')],{'as':_0xc49c('0x17d'),'foreignKey':_0xc49c('0x17c')});db['CmContact'][_0xc49c('0x12f')](db[_0xc49c('0x115')],{'as':_0xc49c('0x14b'),'foreignKey':_0xc49c('0x15a'),'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x104')][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':_0xc49c('0x163'),'through':_0xc49c('0x106')});db['CmContact'][_0xc49c('0x101')](db['Tag'],{'as':_0xc49c('0x151'),'through':_0xc49c('0x17e')});db[_0xc49c('0x104')][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x17e'),'as':_0xc49c('0x162')});db['CmHopper'][_0xc49c('0x12f')](db['CmContact'],{'as':'Contact','foreignKey':_0xc49c('0x142'),'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x6c')][_0xc49c('0x12f')](db['CmList'],{'as':_0xc49c('0x14b'),'foreignKey':_0xc49c('0x15a'),'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x6c')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'as':_0xc49c('0x171'),'foreignKey':_0xc49c('0xf6')});db[_0xc49c('0x6c')][_0xc49c('0x12f')](db[_0xc49c('0x1d')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xc49c('0x6c')][_0xc49c('0x12f')](db[_0xc49c('0x17f')],{'as':_0xc49c('0x17f'),'foreignKey':_0xc49c('0x180'),'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x6c')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'as':'Owner','foreignKey':_0xc49c('0x181')});db[_0xc49c('0x12c')]['belongsTo'](db['CmContact'],{'as':_0xc49c('0x141'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0xc49c('0x12c')][_0xc49c('0x12f')](db[_0xc49c('0x115')],{'as':_0xc49c('0x14b'),'foreignKey':_0xc49c('0x15a'),'onDelete':_0xc49c('0xf5')});db['CmHopperBlack'][_0xc49c('0x12f')](db[_0xc49c('0x1d')],{'as':_0xc49c('0x173'),'foreignKey':_0xc49c('0x12a'),'onDelete':_0xc49c('0xf5')});db['CmHopperBlack'][_0xc49c('0x12f')](db['Campaign'],{'as':_0xc49c('0x17f'),'foreignKey':_0xc49c('0x180'),'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x182')][_0xc49c('0xf9')](db[_0xc49c('0x7b')],{'as':{'plural':_0xc49c('0x183'),'singular':_0xc49c('0x184')},'foreignKey':_0xc49c('0x185'),'onDelete':_0xc49c('0xf5'),'hooks':!![]});db[_0xc49c('0x182')][_0xc49c('0xf9')](db[_0xc49c('0x7b')],{'as':{'plural':'Any','singular':_0xc49c('0x186')},'foreignKey':_0xc49c('0x187'),'onDelete':'cascade','hooks':!![]});db[_0xc49c('0x182')][_0xc49c('0xf9')](db[_0xc49c('0x75')],{'as':_0xc49c('0x188'),'foreignKey':'AutomationId','onDelete':_0xc49c('0xf5'),'hooks':!![]});db[_0xc49c('0x7d')]['hasMany'](db[_0xc49c('0x7d')],{'as':'Intervals','foreignKey':_0xc49c('0x133'),'onDelete':_0xc49c('0xf5'),'hooks':!![],'required':![]});db[_0xc49c('0x7d')][_0xc49c('0xf9')](db[_0xc49c('0x1a')],{'as':_0xc49c('0xfa'),'foreignKey':_0xc49c('0x133'),'onDelete':_0xc49c('0x157')});db[_0xc49c('0x7d')][_0xc49c('0xf9')](db[_0xc49c('0x14a')],{'as':_0xc49c('0x189'),'foreignKey':_0xc49c('0x133')});db['Interval']['hasMany'](db['ChatApplication'],{'as':_0xc49c('0x18a'),'foreignKey':_0xc49c('0x133')});db['Interval'][_0xc49c('0xf9')](db[_0xc49c('0x4b')],{'as':_0xc49c('0x18b'),'foreignKey':_0xc49c('0x133')});db[_0xc49c('0x7d')][_0xc49c('0xf9')](db[_0xc49c('0x52')],{'as':_0xc49c('0x18c'),'foreignKey':_0xc49c('0x133')});db[_0xc49c('0x84')][_0xc49c('0x12f')](db[_0xc49c('0x143')],{});db[_0xc49c('0x84')][_0xc49c('0x12f')](db[_0xc49c('0x92')],{'foreignKey':_0xc49c('0x18d')});db[_0xc49c('0x84')]['belongsTo'](db[_0xc49c('0x90')],{'foreignKey':'CustomReportId'});db[_0xc49c('0x86')][_0xc49c('0x101')](db[_0xc49c('0x126')],{'as':_0xc49c('0x18e'),'through':_0xc49c('0x128'),'onDelete':_0xc49c('0x157')});db[_0xc49c('0x156')]['belongsToMany'](db[_0xc49c('0x104')],{'through':_0xc49c('0x17e')});db[_0xc49c('0x156')][_0xc49c('0x101')](db[_0xc49c('0x63')],{'through':_0xc49c('0x177')});db[_0xc49c('0x156')][_0xc49c('0x101')](db[_0xc49c('0x42')],{'through':_0xc49c('0x150')});db[_0xc49c('0x156')]['belongsToMany'](db[_0xc49c('0x54')],{'through':_0xc49c('0x167')});db[_0xc49c('0x156')][_0xc49c('0x101')](db[_0xc49c('0x10a')],{'through':_0xc49c('0x161')});db[_0xc49c('0x156')][_0xc49c('0x101')](db[_0xc49c('0x16b')],{'through':_0xc49c('0x16e')});db[_0xc49c('0x8b')][_0xc49c('0xf9')](db[_0xc49c('0x7b')],{'as':{'plural':'AllConditions','singular':_0xc49c('0x18f')},'foreignKey':_0xc49c('0x190'),'onDelete':_0xc49c('0xf5'),'hooks':!![]});db[_0xc49c('0x8b')][_0xc49c('0xf9')](db[_0xc49c('0x7b')],{'as':{'plural':_0xc49c('0x191'),'singular':_0xc49c('0x192')},'foreignKey':_0xc49c('0x193'),'onDelete':'cascade','hooks':!![]});db[_0xc49c('0x8b')][_0xc49c('0xf9')](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xc49c('0xf5'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0xc49c('0x97')],{'as':_0xc49c('0x194'),'onDelete':'cascade','foreignKey':_0xc49c('0x195'),'hooks':!![]});db[_0xc49c('0x92')][_0xc49c('0xf9')](db[_0xc49c('0x97')],{'as':_0xc49c('0x194'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x18d')});db['AnalyticMetric'][_0xc49c('0xf9')](db[_0xc49c('0x97')],{'as':_0xc49c('0x194'),'onDelete':_0xc49c('0xf5'),'foreignKey':'MetricId'});db[_0xc49c('0x97')][_0xc49c('0x12f')](db[_0xc49c('0x95')],{'foreignKey':_0xc49c('0x196')});db[_0xc49c('0x197')][_0xc49c('0xf9')](db['SalesforceConfiguration'],{'as':_0xc49c('0x198'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0x98')][_0xc49c('0xf9')](db[_0xc49c('0x19a')],{'as':'Subjects','onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19b')});db[_0xc49c('0x98')][_0xc49c('0xf9')](db[_0xc49c('0x19a')],{'as':_0xc49c('0x19c'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0x98')][_0xc49c('0xf9')](db[_0xc49c('0x19a')],{'as':_0xc49c('0x194'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0x98')][_0xc49c('0x12f')](db[_0xc49c('0x197')],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0x19a')]['hasMany'](db[_0xc49c('0x19a')],{'as':_0xc49c('0x19f'),'foreignKey':_0xc49c('0x19b')});db[_0xc49c('0x19a')]['hasMany'](db['SalesforceField'],{'as':_0xc49c('0x1a0'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0x19a')][_0xc49c('0xf9')](db[_0xc49c('0x19a')],{'as':_0xc49c('0x1a1'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0x19a')][_0xc49c('0x12f')](db[_0xc49c('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0xc49c('0x9b')][_0xc49c('0xf9')](db[_0xc49c('0x9d')],{'as':_0xc49c('0x198'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0x9d')][_0xc49c('0xf9')](db[_0xc49c('0x1a2')],{'as':_0xc49c('0x1a3'),'onDelete':'cascade','foreignKey':_0xc49c('0x19b')});db[_0xc49c('0x9d')][_0xc49c('0xf9')](db[_0xc49c('0x1a2')],{'as':_0xc49c('0x19c'),'onDelete':_0xc49c('0xf5'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0xc49c('0xf9')](db[_0xc49c('0x1a2')],{'as':_0xc49c('0x194'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0x9d')][_0xc49c('0x12f')](db[_0xc49c('0x9b')],{'as':'Account','foreignKey':'AccountId'});db[_0xc49c('0x1a2')][_0xc49c('0xf9')](db[_0xc49c('0x1a2')],{'as':'Subject','foreignKey':_0xc49c('0x19b')});db[_0xc49c('0x1a2')][_0xc49c('0xf9')](db['SugarcrmField'],{'as':'Description','foreignKey':_0xc49c('0x19d')});db[_0xc49c('0x1a2')]['hasMany'](db[_0xc49c('0x1a2')],{'as':_0xc49c('0x1a1'),'foreignKey':_0xc49c('0x19e')});db['SugarcrmField'][_0xc49c('0x12f')](db['Variable'],{'as':_0xc49c('0x8d'),'foreignKey':_0xc49c('0x1a4')});db[_0xc49c('0x1a5')][_0xc49c('0xf9')](db[_0xc49c('0x1a6')],{'as':_0xc49c('0x198'),'onDelete':'cascade','foreignKey':_0xc49c('0x199')});db[_0xc49c('0x1a6')]['hasMany'](db['DeskField'],{'as':_0xc49c('0x1a3'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19b')});db[_0xc49c('0x1a6')]['hasMany'](db[_0xc49c('0x1a7')],{'as':_0xc49c('0x19c'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0x1a6')]['hasMany'](db[_0xc49c('0x1a7')],{'as':_0xc49c('0x194'),'onDelete':_0xc49c('0xf5'),'foreignKey':'FieldId'});db[_0xc49c('0x1a6')][_0xc49c('0x12f')](db[_0xc49c('0x1a5')],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x199')});db['DeskConfiguration'][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x1a8')});db['DeskField']['hasMany'](db['DeskField'],{'as':_0xc49c('0x19f'),'foreignKey':_0xc49c('0x19b')});db[_0xc49c('0x1a7')]['hasMany'](db[_0xc49c('0x1a7')],{'as':_0xc49c('0x1a0'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0x1a7')][_0xc49c('0xf9')](db[_0xc49c('0x1a7')],{'as':_0xc49c('0x1a1'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0x1a7')]['belongsTo'](db[_0xc49c('0x8d')],{'as':_0xc49c('0x8d'),'foreignKey':_0xc49c('0x1a4')});db[_0xc49c('0xa2')][_0xc49c('0xf9')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xc49c('0x199')});db[_0xc49c('0xa4')]['hasMany'](db['ZohoField'],{'as':'Subjects','onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19b')});db[_0xc49c('0xa4')][_0xc49c('0xf9')](db[_0xc49c('0xa5')],{'as':_0xc49c('0x19c'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0xa4')]['hasMany'](db[_0xc49c('0xa5')],{'as':_0xc49c('0x194'),'onDelete':_0xc49c('0xf5'),'foreignKey':'FieldId'});db[_0xc49c('0xa4')][_0xc49c('0x12f')](db[_0xc49c('0xa2')],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0xa5')]['hasMany'](db[_0xc49c('0xa5')],{'as':'Subject','foreignKey':_0xc49c('0x19b')});db[_0xc49c('0xa5')][_0xc49c('0xf9')](db[_0xc49c('0xa5')],{'as':'Description','foreignKey':_0xc49c('0x19d')});db[_0xc49c('0xa5')]['hasMany'](db['ZohoField'],{'as':_0xc49c('0x1a1'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0xa5')][_0xc49c('0x12f')](db[_0xc49c('0x8d')],{'as':_0xc49c('0x8d'),'foreignKey':_0xc49c('0x1a4')});db['ZendeskAccount'][_0xc49c('0xf9')](db['ZendeskConfiguration'],{'as':_0xc49c('0x198'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0xa9')]['hasMany'](db[_0xc49c('0x1a9')],{'as':_0xc49c('0x1a3'),'foreignKey':_0xc49c('0x19b')});db[_0xc49c('0xa9')][_0xc49c('0xf9')](db[_0xc49c('0x1a9')],{'as':'Descriptions','foreignKey':_0xc49c('0x19d')});db[_0xc49c('0xa9')]['hasMany'](db['ZendeskField'],{'as':_0xc49c('0x194'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0xa9')][_0xc49c('0x12f')](db['ZendeskAccount'],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0xa9')][_0xc49c('0x101')](db[_0xc49c('0x156')],{'through':_0xc49c('0x1aa')});db['ZendeskField'][_0xc49c('0xf9')](db[_0xc49c('0x1a9')],{'as':_0xc49c('0x19f'),'foreignKey':_0xc49c('0x19b')});db[_0xc49c('0x1a9')][_0xc49c('0xf9')](db[_0xc49c('0x1a9')],{'as':_0xc49c('0x1a0'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0x1a9')]['hasMany'](db[_0xc49c('0x1a9')],{'as':_0xc49c('0x1a1'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0x1a9')][_0xc49c('0x12f')](db[_0xc49c('0x8d')],{'as':_0xc49c('0x8d'),'foreignKey':_0xc49c('0x1a4')});db[_0xc49c('0xaa')]['hasMany'](db[_0xc49c('0xab')],{'as':'Configurations','onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0xab')][_0xc49c('0xf9')](db[_0xc49c('0xad')],{'as':_0xc49c('0x1a3'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19b')});db['FreshdeskConfiguration'][_0xc49c('0xf9')](db[_0xc49c('0xad')],{'as':_0xc49c('0x19c'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0xab')][_0xc49c('0xf9')](db[_0xc49c('0xad')],{'as':_0xc49c('0x194'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19e')});db['FreshdeskConfiguration'][_0xc49c('0x12f')](db[_0xc49c('0xaa')],{'as':'Account','foreignKey':_0xc49c('0x199')});db[_0xc49c('0xab')]['belongsToMany'](db[_0xc49c('0x156')],{'through':_0xc49c('0x1ab')});db[_0xc49c('0xad')][_0xc49c('0xf9')](db[_0xc49c('0xad')],{'as':_0xc49c('0x19f'),'foreignKey':'SubjectId'});db[_0xc49c('0xad')][_0xc49c('0xf9')](db[_0xc49c('0xad')],{'as':_0xc49c('0x1a0'),'foreignKey':'DescriptionId'});db[_0xc49c('0xad')][_0xc49c('0xf9')](db['FreshdeskField'],{'as':'Field','foreignKey':_0xc49c('0x19e')});db[_0xc49c('0xad')][_0xc49c('0x12f')](db[_0xc49c('0x8d')],{'as':_0xc49c('0x8d'),'foreignKey':_0xc49c('0x1a4')});db['VtigerAccount'][_0xc49c('0xf9')](db[_0xc49c('0xb1')],{'as':'Configurations','onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x199')});db['VtigerConfiguration'][_0xc49c('0xf9')](db['VtigerField'],{'as':'Subjects','foreignKey':_0xc49c('0x19b')});db[_0xc49c('0xb1')][_0xc49c('0xf9')](db[_0xc49c('0xb3')],{'as':_0xc49c('0x19c'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0xb1')][_0xc49c('0xf9')](db[_0xc49c('0xb3')],{'as':'Fields','foreignKey':_0xc49c('0x19e')});db[_0xc49c('0xb1')]['belongsTo'](db[_0xc49c('0xaf')],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0xb3')][_0xc49c('0xf9')](db[_0xc49c('0xb3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xc49c('0xb3')][_0xc49c('0xf9')](db[_0xc49c('0xb3')],{'as':_0xc49c('0x1a0'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0xb3')]['hasMany'](db[_0xc49c('0xb3')],{'as':_0xc49c('0x1a1'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0xb3')][_0xc49c('0x12f')](db[_0xc49c('0x8d')],{'as':'Variable','foreignKey':_0xc49c('0x1a4')});db[_0xc49c('0xb5')][_0xc49c('0xf9')](db[_0xc49c('0x1ac')],{'as':'Configurations','onDelete':_0xc49c('0xf5'),'foreignKey':'AccountId'});db[_0xc49c('0x1ac')][_0xc49c('0xf9')](db[_0xc49c('0x1ad')],{'as':'Subjects','foreignKey':_0xc49c('0x19b')});db[_0xc49c('0x1ac')][_0xc49c('0xf9')](db[_0xc49c('0x1ad')],{'as':'Descriptions','foreignKey':_0xc49c('0x19d')});db[_0xc49c('0x1ac')]['hasMany'](db[_0xc49c('0x1ad')],{'as':_0xc49c('0x194'),'foreignKey':'FieldId'});db[_0xc49c('0x1ac')][_0xc49c('0x12f')](db[_0xc49c('0xb5')],{'as':'Account','foreignKey':'AccountId'});db['ServicenowField'][_0xc49c('0xf9')](db[_0xc49c('0x1ad')],{'as':_0xc49c('0x19f'),'foreignKey':_0xc49c('0x19b')});db[_0xc49c('0x1ad')]['hasMany'](db[_0xc49c('0x1ad')],{'as':_0xc49c('0x1a0'),'foreignKey':_0xc49c('0x19d')});db['ServicenowField'][_0xc49c('0xf9')](db[_0xc49c('0x1ad')],{'as':_0xc49c('0x1a1'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0x1ad')][_0xc49c('0x12f')](db['Variable'],{'as':_0xc49c('0x8d'),'foreignKey':_0xc49c('0x1a4')});db[_0xc49c('0xb9')][_0xc49c('0xf9')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0xbb')][_0xc49c('0xf9')](db[_0xc49c('0xbd')],{'as':_0xc49c('0x1a3'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19b')});db['Dynamics365Configuration'][_0xc49c('0xf9')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x19d')});db['Dynamics365Configuration'][_0xc49c('0xf9')](db[_0xc49c('0xbd')],{'as':_0xc49c('0x194'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xc49c('0xbb')][_0xc49c('0x12f')](db['Dynamics365Account'],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0xbd')]['hasMany'](db[_0xc49c('0xbd')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xc49c('0xbd')][_0xc49c('0xf9')](db[_0xc49c('0xbd')],{'as':_0xc49c('0x1a0'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0xbd')][_0xc49c('0xf9')](db[_0xc49c('0xbd')],{'as':'Field','foreignKey':_0xc49c('0x19e')});db[_0xc49c('0xbd')][_0xc49c('0x12f')](db[_0xc49c('0x8d')],{'as':_0xc49c('0x8d'),'foreignKey':_0xc49c('0x1a4')});db['FreshsalesAccount'][_0xc49c('0xf9')](db[_0xc49c('0xc0')],{'as':_0xc49c('0x198'),'onDelete':'cascade','foreignKey':_0xc49c('0x199')});db[_0xc49c('0xc0')][_0xc49c('0xf9')](db['FreshsalesField'],{'as':_0xc49c('0x1a3'),'foreignKey':_0xc49c('0x19b')});db[_0xc49c('0xc0')][_0xc49c('0xf9')](db[_0xc49c('0x1ae')],{'as':_0xc49c('0x19c'),'foreignKey':'DescriptionId'});db[_0xc49c('0xc0')][_0xc49c('0xf9')](db[_0xc49c('0x1ae')],{'as':_0xc49c('0x194'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0xc49c('0x12f')](db[_0xc49c('0xbf')],{'as':_0xc49c('0x155'),'foreignKey':_0xc49c('0x199')});db[_0xc49c('0x1ae')][_0xc49c('0xf9')](db[_0xc49c('0x1ae')],{'as':_0xc49c('0x19f'),'foreignKey':_0xc49c('0x19b')});db['FreshsalesField'][_0xc49c('0xf9')](db[_0xc49c('0x1ae')],{'as':_0xc49c('0x1a0'),'foreignKey':_0xc49c('0x19d')});db[_0xc49c('0x1ae')][_0xc49c('0xf9')](db[_0xc49c('0x1ae')],{'as':_0xc49c('0x1a1'),'foreignKey':_0xc49c('0x19e')});db[_0xc49c('0x1ae')]['belongsTo'](db['Variable'],{'as':_0xc49c('0x8d'),'foreignKey':_0xc49c('0x1a4')});db[_0xc49c('0xc5')][_0xc49c('0x12f')](db[_0xc49c('0x5f')],{});db[_0xc49c('0xc5')]['belongsTo'](db['CmList'],{'as':_0xc49c('0x14b'),'foreignKey':_0xc49c('0x15a')});db[_0xc49c('0xc5')][_0xc49c('0x12f')](db[_0xc49c('0x104')],{'as':'Contact','foreignKey':_0xc49c('0x142')});db[_0xc49c('0xc5')]['belongsTo'](db[_0xc49c('0x63')],{});db[_0xc49c('0xc5')][_0xc49c('0x12f')](db[_0xc49c('0x178')],{});db[_0xc49c('0xc5')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{});db[_0xc49c('0xc5')][_0xc49c('0x12f')](db[_0xc49c('0x172')],{});db[_0xc49c('0xc7')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x1af')});db[_0xc49c('0xc7')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x1b0')});db[_0xc49c('0x12d')][_0xc49c('0xf9')](db[_0xc49c('0xca')],{'foreignKey':_0xc49c('0x1b1'),'onDelete':_0xc49c('0xf5')});db[_0xc49c('0x12d')][_0xc49c('0xf9')](db[_0xc49c('0xc9')],{'foreignKey':'SessionId','onDelete':'cascade'});db['SmsQueueReport'][_0xc49c('0x12f')](db[_0xc49c('0x11d')],{});db[_0xc49c('0x1b2')][_0xc49c('0x12f')](db['CmList'],{'as':_0xc49c('0x14b'),'foreignKey':_0xc49c('0x15a')});db['SmsQueueReport']['belongsTo'](db[_0xc49c('0x104')],{'as':'Contact','foreignKey':_0xc49c('0x142')});db[_0xc49c('0x1b2')]['belongsTo'](db[_0xc49c('0x54')],{});db[_0xc49c('0x1b2')][_0xc49c('0x12f')](db['SmsMessage'],{});db[_0xc49c('0x1b2')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{});db[_0xc49c('0x1b2')][_0xc49c('0x12f')](db[_0xc49c('0x57')],{});db['JscriptyProject']['hasMany'](db[_0xc49c('0x12d')],{'foreignKey':'ProjectId'});db[_0xc49c('0xd1')][_0xc49c('0xf9')](db[_0xc49c('0xca')],{'foreignKey':_0xc49c('0x1b3')});db['JscriptyProject']['hasMany'](db[_0xc49c('0xc9')],{'foreignKey':_0xc49c('0x1b3')});db[_0xc49c('0x120')][_0xc49c('0x101')](db['User'],{'as':'Users','through':_0xc49c('0x122')});db['Team'][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':'Agents','through':_0xc49c('0x107')});db[_0xc49c('0xdb')][_0xc49c('0x101')](db['VoiceQueue'],{'through':'team_has_voice_queues','as':_0xc49c('0x10e')});db[_0xc49c('0xdb')][_0xc49c('0x101')](db['MailQueue'],{'through':_0xc49c('0x14d'),'as':_0xc49c('0x10f')});db[_0xc49c('0xdb')][_0xc49c('0x101')](db[_0xc49c('0x172')],{'through':_0xc49c('0x17a'),'as':'ChatQueues'});db[_0xc49c('0xdb')][_0xc49c('0x101')](db['FaxQueue'],{'through':_0xc49c('0x1b4'),'as':'FaxQueues'});db[_0xc49c('0xdb')][_0xc49c('0x101')](db[_0xc49c('0x57')],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0xc49c('0xdb')]['belongsToMany'](db['OpenchannelQueue'],{'through':_0xc49c('0x1b5'),'as':'OpenchannelQueues'});db[_0xc49c('0x17f')][_0xc49c('0xf9')](db[_0xc49c('0x6c')],{'as':_0xc49c('0x12b'),'foreignKey':_0xc49c('0x180')});db[_0xc49c('0x17f')][_0xc49c('0xf9')](db[_0xc49c('0x6e')],{'as':_0xc49c('0xfb'),'foreignKey':_0xc49c('0x180')});db[_0xc49c('0x17f')]['hasMany'](db[_0xc49c('0xfc')],{'as':_0xc49c('0x1b6'),'foreignKey':_0xc49c('0x180')});db['Campaign']['hasMany'](db['CmHopperBlack'],{'as':_0xc49c('0x1b7'),'foreignKey':_0xc49c('0x180')});db[_0xc49c('0x17f')][_0xc49c('0x12f')](db['Trunk'],{'as':_0xc49c('0x2c'),'foreignKey':_0xc49c('0x130')});db[_0xc49c('0x17f')]['belongsTo'](db['Trunk'],{'as':_0xc49c('0x131'),'foreignKey':_0xc49c('0x132')});db[_0xc49c('0x17f')]['belongsTo'](db[_0xc49c('0x7d')],{'as':_0xc49c('0x7d'),'foreignKey':_0xc49c('0x133')});db['Campaign'][_0xc49c('0x12f')](db[_0xc49c('0x120')],{'as':_0xc49c('0x120'),'foreignKey':_0xc49c('0x1b8')});db[_0xc49c('0x17f')][_0xc49c('0x101')](db[_0xc49c('0x115')],{'as':'Lists','through':_0xc49c('0x1b9')});db[_0xc49c('0x17f')][_0xc49c('0x101')](db[_0xc49c('0x115')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0xc49c('0xe6')]['belongsTo'](db[_0xc49c('0x44')],{});db[_0xc49c('0xe6')][_0xc49c('0x12f')](db[_0xc49c('0x42')],{});db[_0xc49c('0xe6')]['belongsTo'](db[_0xc49c('0x143')],{'foreignKey':'FromMailAccountId','as':_0xc49c('0x1ba')});db[_0xc49c('0xe6')]['belongsTo'](db[_0xc49c('0x13')],{'foreignKey':_0xc49c('0x1bb'),'as':_0xc49c('0x1bc')});db[_0xc49c('0xe6')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'foreignKey':_0xc49c('0x1bd'),'as':'ToAgent'});db[_0xc49c('0xe6')]['belongsTo'](db[_0xc49c('0x40')],{'foreignKey':'ToMailQueueId','as':_0xc49c('0x1be')});db['MailTransferReport'][_0xc49c('0x12f')](db[_0xc49c('0x143')],{'foreignKey':'ToMailAccountId','as':_0xc49c('0x1bf')});db[_0xc49c('0xe8')][_0xc49c('0x12f')](db['ChatMessage'],{});db[_0xc49c('0xe8')][_0xc49c('0x12f')](db['ChatInteraction'],{});db[_0xc49c('0xe8')][_0xc49c('0x12f')](db['ChatWebsite'],{'foreignKey':_0xc49c('0x1c0'),'as':_0xc49c('0x1ba')});db['ChatTransferReport'][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'foreignKey':'FromUserId','as':_0xc49c('0x1bc')});db[_0xc49c('0xe8')][_0xc49c('0x12f')](db['User'],{'foreignKey':_0xc49c('0x1bd'),'as':'ToAgent'});db[_0xc49c('0xe8')][_0xc49c('0x12f')](db[_0xc49c('0x172')],{'foreignKey':_0xc49c('0x1c1'),'as':_0xc49c('0x1be')});db[_0xc49c('0xe8')][_0xc49c('0x12f')](db['ChatWebsite'],{'foreignKey':_0xc49c('0x1c2'),'as':_0xc49c('0x1bf')});db[_0xc49c('0xea')][_0xc49c('0x12f')](db['FaxMessage'],{});db[_0xc49c('0xea')][_0xc49c('0x12f')](db['FaxInteraction'],{});db[_0xc49c('0xea')][_0xc49c('0x12f')](db['FaxAccount'],{'foreignKey':_0xc49c('0x1c3'),'as':_0xc49c('0x1ba')});db[_0xc49c('0xea')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xc49c('0xea')][_0xc49c('0x12f')](db['User'],{'foreignKey':_0xc49c('0x1bd'),'as':'ToAgent'});db[_0xc49c('0xea')]['belongsTo'](db[_0xc49c('0x4f')],{'foreignKey':_0xc49c('0x1c4'),'as':_0xc49c('0x1be')});db[_0xc49c('0xea')][_0xc49c('0x12f')](db[_0xc49c('0x4a')],{'foreignKey':_0xc49c('0x1c5'),'as':_0xc49c('0x1bf')});db[_0xc49c('0xec')][_0xc49c('0x12f')](db[_0xc49c('0x5c')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xc49c('0x16b')],{});db[_0xc49c('0xec')][_0xc49c('0x12f')](db[_0xc49c('0x58')],{'foreignKey':_0xc49c('0x1c6'),'as':_0xc49c('0x1ba')});db['OpenchannelTransferReport'][_0xc49c('0x12f')](db['User'],{'foreignKey':_0xc49c('0x1bb'),'as':_0xc49c('0x1bc')});db['OpenchannelTransferReport'][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'foreignKey':_0xc49c('0x1bd'),'as':_0xc49c('0x1c7')});db[_0xc49c('0xec')][_0xc49c('0x12f')](db[_0xc49c('0x5d')],{'foreignKey':'ToOpenchannelQueueId','as':_0xc49c('0x1be')});db[_0xc49c('0xec')]['belongsTo'](db[_0xc49c('0x58')],{'foreignKey':_0xc49c('0x1c8'),'as':'ToAccount'});db['SmsTransferReport'][_0xc49c('0x12f')](db[_0xc49c('0x56')],{});db[_0xc49c('0xee')][_0xc49c('0x12f')](db[_0xc49c('0x54')],{});db['SmsTransferReport'][_0xc49c('0x12f')](db[_0xc49c('0x11d')],{'foreignKey':_0xc49c('0x1c9'),'as':_0xc49c('0x1ba')});db[_0xc49c('0xee')][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'foreignKey':_0xc49c('0x1bb'),'as':_0xc49c('0x1bc')});db['SmsTransferReport'][_0xc49c('0x12f')](db[_0xc49c('0x13')],{'foreignKey':_0xc49c('0x1bd'),'as':'ToAgent'});db[_0xc49c('0xee')][_0xc49c('0x12f')](db[_0xc49c('0x57')],{'foreignKey':_0xc49c('0x1ca'),'as':_0xc49c('0x1be')});db[_0xc49c('0xee')]['belongsTo'](db[_0xc49c('0x11d')],{'foreignKey':'ToSmsAccountId','as':_0xc49c('0x1bf')});db[_0xc49c('0x115')][_0xc49c('0xf9')](db[_0xc49c('0x79')],{'as':_0xc49c('0x147'),'foreignKey':'ListId'});db['CmList'][_0xc49c('0xf9')](db[_0xc49c('0x73')],{'as':_0xc49c('0x1cb'),'foreignKey':_0xc49c('0x15a')});db['CmList'][_0xc49c('0xf9')](db[_0xc49c('0x104')],{'as':_0xc49c('0x105'),'onDelete':_0xc49c('0xf5'),'foreignKey':_0xc49c('0x15a')});db['CmList'][_0xc49c('0xf9')](db[_0xc49c('0x6e')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0xc49c('0x115')][_0xc49c('0xf9')](db[_0xc49c('0xfc')],{'as':_0xc49c('0x1cc'),'foreignKey':_0xc49c('0x15a')});db[_0xc49c('0x115')][_0xc49c('0xf9')](db[_0xc49c('0x71')],{'as':_0xc49c('0x71'),'foreignKey':_0xc49c('0x15a')});db[_0xc49c('0x115')][_0xc49c('0x101')](db[_0xc49c('0x1d')],{'as':_0xc49c('0x1cd'),'through':_0xc49c('0x137')});db['CmList'][_0xc49c('0x101')](db['User'],{'as':_0xc49c('0x138'),'through':'cm_user_has_lists'});db[_0xc49c('0x1ce')][_0xc49c('0xf9')](db[_0xc49c('0x1a')],{'as':_0xc49c('0xfa'),'onDelete':_0xc49c('0x157')});db['VoicePrefix'][_0xc49c('0x101')](db[_0xc49c('0x13')],{'as':'Agents','through':'user_has_voice_prefixes'});db[_0xc49c('0xf1')][_0xc49c('0xf9')](db[_0xc49c('0x13')],{'as':'Users','foreignKey':_0xc49c('0x100')});db['UserProfile'][_0xc49c('0xf9')](db[_0xc49c('0x1cf')],{'as':_0xc49c('0x1d0'),'foreignKey':_0xc49c('0x100'),'onDelete':'cascade'});db[_0xc49c('0x1cf')][_0xc49c('0xf9')](db['UserProfileResource'],{'as':_0xc49c('0x1d1'),'foreignKey':_0xc49c('0x1d2'),'onDelete':_0xc49c('0xf5')});module[_0xc49c('0x1d3')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 5288a2b..bc48076 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7ba=['./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/system','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','1.0.16','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','/index.html','path','express','express-winston','./errors','./config/environment','api','./config/logger','auth','default','use','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','role','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','name','device','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/cdr','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports'];(function(_0x2aa206,_0x1ab574){var _0x4269f5=function(_0x596345){while(--_0x596345){_0x2aa206['push'](_0x2aa206['shift']());}};_0x4269f5(++_0x1ab574);}(_0xb7ba,0x14b));var _0xab7b=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0xb7ba[_0x14476b];return _0x24e2e8;};'use strict';var path=require(_0xab7b('0x0'));var express=require(_0xab7b('0x1'));var ewinston=require(_0xab7b('0x2'));var util=require('util');var errors=require(_0xab7b('0x3'));var config=require(_0xab7b('0x4'));var logger=require('./config/logger')(_0xab7b('0x5'));var authLogger=require(_0xab7b('0x6'))(_0xab7b('0x7'));exports[_0xab7b('0x8')]=function(_0x1b2a1d){_0x1b2a1d[_0xab7b('0x9')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5d63df,_0x3c65c3){return util[_0xab7b('0xa')](_0xab7b('0xb'),_0x5d63df[_0xab7b('0xc')],_0x5d63df[_0xab7b('0xd')][_0xab7b('0xe')]?_0x5d63df[_0xab7b('0xd')][_0xab7b('0xe')]:_0x5d63df[_0xab7b('0xf')][_0xab7b('0x10')]||_0x5d63df['ip'],_0x5d63df['url'],_0x3c65c3[_0xab7b('0x11')],_0x3c65c3[_0xab7b('0x12')],_0x5d63df[_0xab7b('0x13')]?_0x5d63df[_0xab7b('0x13')]['id']:null,_0x5d63df[_0xab7b('0x13')]?_0x5d63df[_0xab7b('0x13')]['name']:null,_0x5d63df[_0xab7b('0x13')]?_0x5d63df[_0xab7b('0x13')][_0xab7b('0x14')]:null);}}));_0x1b2a1d[_0xab7b('0x9')](ewinston[_0xab7b('0x15')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x31c8cb,_0x2c35a7){var _0x5e571a=_0xab7b('0x16');if(_0x31c8cb[_0xab7b('0x17')]&&_0x31c8cb[_0xab7b('0x17')]['device']&&_0x31c8cb[_0xab7b('0x17')][_0xab7b('0x18')]){_0x5e571a=_0xab7b('0x19');}return util[_0xab7b('0xa')](_0x5e571a,_0x31c8cb['method'],_0x31c8cb[_0xab7b('0xd')][_0xab7b('0xe')]?_0x31c8cb['headers'][_0xab7b('0xe')]:_0x31c8cb[_0xab7b('0xf')]['remoteAddress']||_0x31c8cb['ip'],_0x31c8cb[_0xab7b('0x1a')],_0x2c35a7[_0xab7b('0x11')],_0x2c35a7['responseTime'],_0x31c8cb[_0xab7b('0x13')]?_0x31c8cb[_0xab7b('0x13')]['id']:null,_0x31c8cb[_0xab7b('0x13')]?_0x31c8cb['user'][_0xab7b('0x1b')]:null,_0x31c8cb[_0xab7b('0x13')]?_0x31c8cb[_0xab7b('0x13')][_0xab7b('0x14')]:null,_0x31c8cb[_0xab7b('0x17')]&&_0x31c8cb[_0xab7b('0x17')][_0xab7b('0x1c')]?_0x31c8cb[_0xab7b('0x17')]['device']:_0xab7b('0x1d'),_0x31c8cb[_0xab7b('0x17')]&&_0x31c8cb[_0xab7b('0x17')]['agent_id']?_0x31c8cb[_0xab7b('0x17')]['agent_id']:'',_0x31c8cb['body']&&_0x31c8cb[_0xab7b('0x17')][_0xab7b('0x1e')]?_0x31c8cb['body'][_0xab7b('0x1e')]:'');},'ignoreRoute':function(_0x150a52){var _0x1f663a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1f663a[_0xab7b('0x1f')](_0x150a52[_0xab7b('0x1a')]);}}));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x20'),require('./api/user'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x21'),require(_0xab7b('0x22')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x23'),require(_0xab7b('0x24')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x25'),require('./api/voiceExtension'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x26'),require(_0xab7b('0x27')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x28'),require(_0xab7b('0x29')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x2a'),require(_0xab7b('0x2b')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x2c'),require(_0xab7b('0x2d')));_0x1b2a1d['use'](_0xab7b('0x2e'),require('./api/voiceMail'));_0x1b2a1d[_0xab7b('0x9')]('/api/voice/mails/messages',require(_0xab7b('0x2f')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x30'),require(_0xab7b('0x31')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x32'),require('./api/voiceDialReport'));_0x1b2a1d['use'](_0xab7b('0x33'),require('./api/voiceAgentReport'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x34'),require('./api/voiceQueueReport'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x35'),require(_0xab7b('0x36')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x37'),require('./api/trunk'));_0x1b2a1d['use']('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x38'),require(_0xab7b('0x39')));_0x1b2a1d[_0xab7b('0x9')]('/api/mail/accounts',require(_0xab7b('0x3a')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x3b'),require(_0xab7b('0x3c')));_0x1b2a1d[_0xab7b('0x9')]('/api/mail/substatuses',require(_0xab7b('0x3d')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x3e'),require(_0xab7b('0x3f')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x40'),require(_0xab7b('0x41')));_0x1b2a1d[_0xab7b('0x9')]('/api/mail/applications',require(_0xab7b('0x42')));_0x1b2a1d[_0xab7b('0x9')]('/api/mail/reports/queue',require(_0xab7b('0x43')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x44'),require(_0xab7b('0x45')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x46'),require(_0xab7b('0x47')));_0x1b2a1d[_0xab7b('0x9')]('/api/fax/accounts',require(_0xab7b('0x48')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x49'),require(_0xab7b('0x4a')));_0x1b2a1d[_0xab7b('0x9')]('/api/fax/interactions',require(_0xab7b('0x4b')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x4c'),require(_0xab7b('0x4d')));_0x1b2a1d['use'](_0xab7b('0x4e'),require(_0xab7b('0x4f')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x50'),require('./api/faxQueueReport'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x51'),require('./api/smsAccount'));_0x1b2a1d['use'](_0xab7b('0x52'),require(_0xab7b('0x53')));_0x1b2a1d['use'](_0xab7b('0x54'),require(_0xab7b('0x55')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x56'),require(_0xab7b('0x57')));_0x1b2a1d['use'](_0xab7b('0x58'),require(_0xab7b('0x59')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x5a'),require(_0xab7b('0x5b')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x5c'),require(_0xab7b('0x5d')));_0x1b2a1d['use'](_0xab7b('0x5e'),require(_0xab7b('0x5f')));_0x1b2a1d[_0xab7b('0x9')]('/api/openchannel/messages',require(_0xab7b('0x60')));_0x1b2a1d['use'](_0xab7b('0x61'),require('./api/openchannelQueue'));_0x1b2a1d['use'](_0xab7b('0x62'),require(_0xab7b('0x63')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x64'),require(_0xab7b('0x65')));_0x1b2a1d['use'](_0xab7b('0x66'),require('./api/chatApplication'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x67'),require(_0xab7b('0x68')));_0x1b2a1d[_0xab7b('0x9')]('/api/chat/messages',require('./api/chatMessage'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x69'),require(_0xab7b('0x6a')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x6b'),require('./api/chatQueue'));_0x1b2a1d[_0xab7b('0x9')]('/api/chat/groups',require(_0xab7b('0x6c')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x6d'),require('./api/chatProactiveAction'));_0x1b2a1d[_0xab7b('0x9')]('/api/cm/companies',require('./api/cmCompany'));_0x1b2a1d[_0xab7b('0x9')]('/api/cm/contacts',require('./api/cmContact'));_0x1b2a1d[_0xab7b('0x9')]('/api/cm/hopper',require(_0xab7b('0x6e')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x6f'),require(_0xab7b('0x70')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x71'),require('./api/cmHopperFinal'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x72'),require('./api/cmHopperHistory'));_0x1b2a1d[_0xab7b('0x9')]('/api/cm/custom_fields',require(_0xab7b('0x73')));_0x1b2a1d['use'](_0xab7b('0x74'),require(_0xab7b('0x75')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x76'),require(_0xab7b('0x77')));_0x1b2a1d['use'](_0xab7b('0x78'),require(_0xab7b('0x79')));_0x1b2a1d['use']('/api/dispositions',require(_0xab7b('0x7a')));_0x1b2a1d['use']('/api/conditions',require(_0xab7b('0x7b')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x7c'),require(_0xab7b('0x7d')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x7e'),require('./api/pause'));_0x1b2a1d['use']('/api/cdr',require(_0xab7b('0x7f')));_0x1b2a1d[_0xab7b('0x9')]('/api/voiceQueuesLog',require(_0xab7b('0x80')));_0x1b2a1d[_0xab7b('0x9')]('/api/schedules',require(_0xab7b('0x81')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x82'),require(_0xab7b('0x83')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x84'),require('./api/tag'));_0x1b2a1d['use'](_0xab7b('0x85'),require(_0xab7b('0x86')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x87'),require(_0xab7b('0x88')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x89'),require(_0xab7b('0x8a')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x8b'),require(_0xab7b('0x8c')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x8d'),require(_0xab7b('0x8e')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x8f'),require(_0xab7b('0x90')));_0x1b2a1d['use'](_0xab7b('0x91'),require('./api/analyticDefaultReport'));_0x1b2a1d['use'](_0xab7b('0x92'),require(_0xab7b('0x93')));_0x1b2a1d['use'](_0xab7b('0x94'),require(_0xab7b('0x95')));_0x1b2a1d[_0xab7b('0x9')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x1b2a1d['use'](_0xab7b('0x96'),require(_0xab7b('0x97')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x98'),require(_0xab7b('0x99')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x9a'),require(_0xab7b('0x9b')));_0x1b2a1d['use'](_0xab7b('0x9c'),require('./api/intSalesforceField'));_0x1b2a1d['use']('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x9d'),require(_0xab7b('0x9e')));_0x1b2a1d['use'](_0xab7b('0x9f'),require('./api/intSugarcrmField'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xa0'),require(_0xab7b('0xa1')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xa2'),require(_0xab7b('0xa3')));_0x1b2a1d['use'](_0xab7b('0xa4'),require(_0xab7b('0xa5')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xa6'),require(_0xab7b('0xa7')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xa8'),require(_0xab7b('0xa9')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xaa'),require(_0xab7b('0xab')));_0x1b2a1d[_0xab7b('0x9')]('/api/integrations/zendesk/accounts',require(_0xab7b('0xac')));_0x1b2a1d[_0xab7b('0x9')]('/api/integrations/zendesk/configurations',require(_0xab7b('0xad')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xae'),require(_0xab7b('0xaf')));_0x1b2a1d['use']('/api/integrations/freshdesk/accounts',require(_0xab7b('0xb0')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xb1'),require(_0xab7b('0xb2')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xb3'),require(_0xab7b('0xb4')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xb5'),require(_0xab7b('0xb6')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xb7'),require(_0xab7b('0xb8')));_0x1b2a1d['use']('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xb9'),require('./api/intServicenowAccount'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xba'),require(_0xab7b('0xbb')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xbc'),require(_0xab7b('0xbd')));_0x1b2a1d['use'](_0xab7b('0xbe'),require(_0xab7b('0xbf')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xc0'),require(_0xab7b('0xc1')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xc2'),require(_0xab7b('0xc3')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xc4'),require(_0xab7b('0xc5')));_0x1b2a1d[_0xab7b('0x9')]('/api/integrations/freshsales/configurations',require(_0xab7b('0xc6')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xc7'),require(_0xab7b('0xc8')));_0x1b2a1d['use']('/api/networks',require(_0xab7b('0xc9')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xca'),require(_0xab7b('0xcb')));_0x1b2a1d['use'](_0xab7b('0xcc'),require('./api/chatInternalMessage'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xcd'),require(_0xab7b('0xce')));_0x1b2a1d['use'](_0xab7b('0xcf'),require('./api/jscriptyQuestionReport'));_0x1b2a1d['use'](_0xab7b('0xd0'),require(_0xab7b('0xd1')));_0x1b2a1d[_0xab7b('0x9')]('/api/sms/reports/queue',require(_0xab7b('0xd2')));_0x1b2a1d[_0xab7b('0x9')]('/api/square/reports',require(_0xab7b('0xd3')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xd4'),require(_0xab7b('0xd5')));_0x1b2a1d['use']('/api/jscripty/projects',require(_0xab7b('0xd6')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xd7'),require(_0xab7b('0xd8')));_0x1b2a1d['use']('/api/square/odbc',require(_0xab7b('0xd9')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xda'),require(_0xab7b('0xdb')));_0x1b2a1d['use']('/api/square/recordings',require('./api/squareRecording'));_0x1b2a1d['use']('/api/square/messages',require(_0xab7b('0xdc')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xdd'),require(_0xab7b('0xde')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xdf'),require(_0xab7b('0xe0')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xe1'),require('./api/campaign'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xe2'),require(_0xab7b('0xe3')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xe4'),require(_0xab7b('0xe5')));_0x1b2a1d[_0xab7b('0x9')]('/api/plugins',require(_0xab7b('0xe6')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xe7'),require(_0xab7b('0xe8')));_0x1b2a1d['use']('/api/chat/reports/transfer',require(_0xab7b('0xe9')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xea'),require(_0xab7b('0xeb')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xec'),require(_0xab7b('0xed')));_0x1b2a1d['use'](_0xab7b('0xee'),require('./api/smsTransferReport'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xef'),require(_0xab7b('0xf0')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xf1'),require(_0xab7b('0xf2')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xf3'),require(_0xab7b('0xf4')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xf5'),require(_0xab7b('0xf6')));_0x1b2a1d['use'](_0xab7b('0xf7'),require(_0xab7b('0xf8')));_0x1b2a1d['use'](_0xab7b('0xf9'),require('./api/authLocal'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xfa'),require(_0xab7b('0xfb')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xfc'),require(_0xab7b('0xfd')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xfe'),require('./api/rpc'));_0x1b2a1d[_0xab7b('0x9')]('/api/version',require('./api/version'));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0xff'),require('./api/system'));_0x1b2a1d[_0xab7b('0x9')]('/api/pm2',require(_0xab7b('0x100')));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x101'),express[_0xab7b('0x102')](path[_0xab7b('0x103')](config[_0xab7b('0x104')],_0xab7b('0x101'))));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x105'),express[_0xab7b('0x102')](path[_0xab7b('0x103')](config[_0xab7b('0x104')],_0xab7b('0x105'))));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x106'),express[_0xab7b('0x102')](path[_0xab7b('0x103')](config[_0xab7b('0x104')],_0xab7b('0x106'))));_0x1b2a1d['use'](_0xab7b('0x107'),express['static'](path[_0xab7b('0x103')](config[_0xab7b('0x104')],'snippet',_0xab7b('0x108'))));_0x1b2a1d[_0xab7b('0x9')](_0xab7b('0x109'),express[_0xab7b('0x102')](path[_0xab7b('0x103')](config[_0xab7b('0x104')],_0xab7b('0x10a'))));_0x1b2a1d[_0xab7b('0x10b')](_0xab7b('0x10c'))[_0xab7b('0x10d')](errors[0x194]);_0x1b2a1d['route']('/*')['get'](function(_0xd5d63c,_0x3bcc2d){_0x3bcc2d[_0xab7b('0x10e')](path['resolve'](_0x1b2a1d[_0xab7b('0x10d')]('appPath')+_0xab7b('0x10f')));});}; \ No newline at end of file +var _0xdf3c=['/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/campaign','/api/migrations','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileResource','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','static','join','root','/www','/demo','/snippet','snippet','1.0.16','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','path','express-winston','util','./config/logger','auth','default','use','format','headers','connection','remoteAddress','url','statusCode','responseTime','user','name','role','logger','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','x-forwarded-for','device','agent_name','test','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsInteraction','/api/sms/messages','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatMessage','./api/chatOfflineMessage'];(function(_0x33687a,_0x53f51d){var _0xc4e9aa=function(_0x2fee8b){while(--_0x2fee8b){_0x33687a['push'](_0x33687a['shift']());}};_0xc4e9aa(++_0x53f51d);}(_0xdf3c,0x1ac));var _0xcdf3=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xdf3c[_0x25e7cb];return _0x375d92;};'use strict';var path=require(_0xcdf3('0x0'));var express=require('express');var ewinston=require(_0xcdf3('0x1'));var util=require(_0xcdf3('0x2'));var errors=require('./errors');var config=require('./config/environment');var logger=require('./config/logger')('api');var authLogger=require(_0xcdf3('0x3'))(_0xcdf3('0x4'));exports[_0xcdf3('0x5')]=function(_0x30179c){_0x30179c[_0xcdf3('0x6')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3673fc,_0x4acd04){return util[_0xcdf3('0x7')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x3673fc['method'],_0x3673fc['headers']['x-forwarded-for']?_0x3673fc[_0xcdf3('0x8')]['x-forwarded-for']:_0x3673fc[_0xcdf3('0x9')][_0xcdf3('0xa')]||_0x3673fc['ip'],_0x3673fc[_0xcdf3('0xb')],_0x4acd04[_0xcdf3('0xc')],_0x4acd04[_0xcdf3('0xd')],_0x3673fc[_0xcdf3('0xe')]?_0x3673fc[_0xcdf3('0xe')]['id']:null,_0x3673fc[_0xcdf3('0xe')]?_0x3673fc[_0xcdf3('0xe')][_0xcdf3('0xf')]:null,_0x3673fc[_0xcdf3('0xe')]?_0x3673fc[_0xcdf3('0xe')][_0xcdf3('0x10')]:null);}}));_0x30179c[_0xcdf3('0x6')](ewinston[_0xcdf3('0x11')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2745dd,_0x338b6b){var _0x4f8f87='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2745dd[_0xcdf3('0x12')]&&_0x2745dd['body']['device']&&_0x2745dd[_0xcdf3('0x12')][_0xcdf3('0x13')]){_0x4f8f87=_0xcdf3('0x14');}return util[_0xcdf3('0x7')](_0x4f8f87,_0x2745dd['method'],_0x2745dd['headers'][_0xcdf3('0x15')]?_0x2745dd[_0xcdf3('0x8')][_0xcdf3('0x15')]:_0x2745dd[_0xcdf3('0x9')][_0xcdf3('0xa')]||_0x2745dd['ip'],_0x2745dd['url'],_0x338b6b[_0xcdf3('0xc')],_0x338b6b[_0xcdf3('0xd')],_0x2745dd[_0xcdf3('0xe')]?_0x2745dd['user']['id']:null,_0x2745dd[_0xcdf3('0xe')]?_0x2745dd[_0xcdf3('0xe')][_0xcdf3('0xf')]:null,_0x2745dd[_0xcdf3('0xe')]?_0x2745dd[_0xcdf3('0xe')][_0xcdf3('0x10')]:null,_0x2745dd['body']&&_0x2745dd[_0xcdf3('0x12')][_0xcdf3('0x16')]?_0x2745dd[_0xcdf3('0x12')]['device']:'other',_0x2745dd['body']&&_0x2745dd['body'][_0xcdf3('0x13')]?_0x2745dd['body'][_0xcdf3('0x13')]:'',_0x2745dd[_0xcdf3('0x12')]&&_0x2745dd[_0xcdf3('0x12')][_0xcdf3('0x17')]?_0x2745dd['body'][_0xcdf3('0x17')]:'');},'ignoreRoute':function(_0x2ea23d){var _0x58a81e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x58a81e[_0xcdf3('0x18')](_0x2ea23d['url']);}}));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x19'),require('./api/user'));_0x30179c[_0xcdf3('0x6')]('/api/voice/chanspy',require(_0xcdf3('0x1a')));_0x30179c['use'](_0xcdf3('0x1b'),require(_0xcdf3('0x1c')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x1d'),require(_0xcdf3('0x1e')));_0x30179c[_0xcdf3('0x6')]('/api/voice/mohs',require(_0xcdf3('0x1f')));_0x30179c['use']('/api/voice/queues',require(_0xcdf3('0x20')));_0x30179c[_0xcdf3('0x6')]('/api/voice/recordings',require(_0xcdf3('0x21')));_0x30179c['use']('/api/screen/recordings',require(_0xcdf3('0x22')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x23'),require('./api/voiceMail'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x24'),require(_0xcdf3('0x25')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x26'),require(_0xcdf3('0x27')));_0x30179c['use'](_0xcdf3('0x28'),require(_0xcdf3('0x29')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x2a'),require(_0xcdf3('0x2b')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x2c'),require(_0xcdf3('0x2d')));_0x30179c[_0xcdf3('0x6')]('/api/members/reports',require(_0xcdf3('0x2e')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x2f'),require('./api/trunk'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x30'),require(_0xcdf3('0x31')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x32'),require(_0xcdf3('0x33')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x34'),require('./api/mailAccount'));_0x30179c['use'](_0xcdf3('0x35'),require(_0xcdf3('0x36')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x37'),require('./api/mailSubstatus'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x38'),require('./api/mailInteraction'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x39'),require(_0xcdf3('0x3a')));_0x30179c['use']('/api/mail/applications',require('./api/mailApplication'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x3b'),require(_0xcdf3('0x3c')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x3d'),require(_0xcdf3('0x3e')));_0x30179c[_0xcdf3('0x6')]('/api/dashboards/items',require(_0xcdf3('0x3f')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x40'),require(_0xcdf3('0x41')));_0x30179c['use']('/api/fax/applications',require('./api/faxApplication'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x42'),require(_0xcdf3('0x43')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x44'),require('./api/faxMessage'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x45'),require(_0xcdf3('0x46')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x47'),require(_0xcdf3('0x48')));_0x30179c[_0xcdf3('0x6')]('/api/sms/accounts',require(_0xcdf3('0x49')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x4a'),require('./api/smsApplication'));_0x30179c[_0xcdf3('0x6')]('/api/sms/interactions',require(_0xcdf3('0x4b')));_0x30179c['use'](_0xcdf3('0x4c'),require('./api/smsMessage'));_0x30179c['use']('/api/sms/queues',require(_0xcdf3('0x4d')));_0x30179c[_0xcdf3('0x6')]('/api/openchannel/accounts',require(_0xcdf3('0x4e')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x4f'),require('./api/openchannelApplication'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x50'),require(_0xcdf3('0x51')));_0x30179c[_0xcdf3('0x6')]('/api/openchannel/messages',require(_0xcdf3('0x52')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x53'),require(_0xcdf3('0x54')));_0x30179c[_0xcdf3('0x6')]('/api/chat/websites',require(_0xcdf3('0x55')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x56'),require(_0xcdf3('0x57')));_0x30179c[_0xcdf3('0x6')]('/api/chat/applications',require('./api/chatApplication'));_0x30179c[_0xcdf3('0x6')]('/api/chat/interactions',require('./api/chatInteraction'));_0x30179c[_0xcdf3('0x6')]('/api/chat/messages',require(_0xcdf3('0x58')));_0x30179c[_0xcdf3('0x6')]('/api/chat/offline_messages',require(_0xcdf3('0x59')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x5a'),require(_0xcdf3('0x5b')));_0x30179c['use'](_0xcdf3('0x5c'),require(_0xcdf3('0x5d')));_0x30179c['use'](_0xcdf3('0x5e'),require(_0xcdf3('0x5f')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x60'),require(_0xcdf3('0x61')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x62'),require(_0xcdf3('0x63')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x64'),require(_0xcdf3('0x65')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x66'),require(_0xcdf3('0x67')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x68'),require(_0xcdf3('0x69')));_0x30179c['use'](_0xcdf3('0x6a'),require(_0xcdf3('0x6b')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x6c'),require(_0xcdf3('0x6d')));_0x30179c['use'](_0xcdf3('0x6e'),require(_0xcdf3('0x6f')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x70'),require(_0xcdf3('0x71')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x72'),require(_0xcdf3('0x73')));_0x30179c['use'](_0xcdf3('0x74'),require(_0xcdf3('0x75')));_0x30179c[_0xcdf3('0x6')]('/api/conditions',require(_0xcdf3('0x76')));_0x30179c[_0xcdf3('0x6')]('/api/intervals',require(_0xcdf3('0x77')));_0x30179c['use'](_0xcdf3('0x78'),require(_0xcdf3('0x79')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x7a'),require(_0xcdf3('0x7b')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x7c'),require(_0xcdf3('0x7d')));_0x30179c['use']('/api/schedules',require('./api/schedule'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x7e'),require(_0xcdf3('0x7f')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x80'),require(_0xcdf3('0x81')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x82'),require(_0xcdf3('0x83')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x84'),require('./api/trigger'));_0x30179c[_0xcdf3('0x6')]('/api/variables',require(_0xcdf3('0x85')));_0x30179c['use'](_0xcdf3('0x86'),require(_0xcdf3('0x87')));_0x30179c['use'](_0xcdf3('0x88'),require(_0xcdf3('0x89')));_0x30179c[_0xcdf3('0x6')]('/api/analytics/custom_reports',require(_0xcdf3('0x8a')));_0x30179c['use'](_0xcdf3('0x8b'),require(_0xcdf3('0x8c')));_0x30179c[_0xcdf3('0x6')]('/api/analytics/extracted_reports',require(_0xcdf3('0x8d')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x8e'),require(_0xcdf3('0x8f')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x90'),require(_0xcdf3('0x91')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x92'),require(_0xcdf3('0x93')));_0x30179c[_0xcdf3('0x6')]('/api/integrations/salesforce/accounts',require(_0xcdf3('0x94')));_0x30179c[_0xcdf3('0x6')]('/api/integrations/salesforce/configurations',require(_0xcdf3('0x95')));_0x30179c['use'](_0xcdf3('0x96'),require(_0xcdf3('0x97')));_0x30179c[_0xcdf3('0x6')]('/api/integrations/sugarcrm/accounts',require(_0xcdf3('0x98')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x99'),require(_0xcdf3('0x9a')));_0x30179c[_0xcdf3('0x6')]('/api/integrations/sugarcrm/fields',require(_0xcdf3('0x9b')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x9c'),require('./api/intDeskAccount'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0x9d'),require(_0xcdf3('0x9e')));_0x30179c[_0xcdf3('0x6')]('/api/integrations/desk/fields',require(_0xcdf3('0x9f')));_0x30179c[_0xcdf3('0x6')]('/api/integrations/zoho/accounts',require(_0xcdf3('0xa0')));_0x30179c['use']('/api/integrations/zoho/configurations',require(_0xcdf3('0xa1')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xa2'),require('./api/intZohoField'));_0x30179c[_0xcdf3('0x6')]('/api/integrations/zendesk/accounts',require(_0xcdf3('0xa3')));_0x30179c['use'](_0xcdf3('0xa4'),require('./api/intZendeskConfiguration'));_0x30179c['use'](_0xcdf3('0xa5'),require(_0xcdf3('0xa6')));_0x30179c['use'](_0xcdf3('0xa7'),require(_0xcdf3('0xa8')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xa9'),require(_0xcdf3('0xaa')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xab'),require('./api/intFreshdeskField'));_0x30179c['use'](_0xcdf3('0xac'),require(_0xcdf3('0xad')));_0x30179c[_0xcdf3('0x6')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x30179c['use']('/api/integrations/vtiger/fields',require(_0xcdf3('0xae')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xaf'),require(_0xcdf3('0xb0')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xb1'),require(_0xcdf3('0xb2')));_0x30179c['use'](_0xcdf3('0xb3'),require(_0xcdf3('0xb4')));_0x30179c['use'](_0xcdf3('0xb5'),require('./api/intDynamics365Account'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xb6'),require(_0xcdf3('0xb7')));_0x30179c['use']('/api/integrations/dynamics365/fields',require(_0xcdf3('0xb8')));_0x30179c[_0xcdf3('0x6')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xb9'),require(_0xcdf3('0xba')));_0x30179c[_0xcdf3('0x6')]('/api/integrations/freshsales/fields',require(_0xcdf3('0xbb')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xbc'),require(_0xcdf3('0xbd')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xbe'),require('./api/chatQueueReport'));_0x30179c['use'](_0xcdf3('0xbf'),require('./api/chatInternalMessage'));_0x30179c[_0xcdf3('0x6')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xc0'),require('./api/jscriptyQuestionReport'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xc1'),require(_0xcdf3('0xc2')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xc3'),require(_0xcdf3('0xc4')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xc5'),require(_0xcdf3('0xc6')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xc7'),require('./api/squareReportDetail'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xc8'),require(_0xcdf3('0xc9')));_0x30179c[_0xcdf3('0x6')]('/api/settings',require(_0xcdf3('0xca')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xcb'),require(_0xcdf3('0xcc')));_0x30179c['use'](_0xcdf3('0xcd'),require('./api/squareProject'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xce'),require(_0xcdf3('0xcf')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xd0'),require(_0xcdf3('0xd1')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xd2'),require(_0xcdf3('0xd3')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xd4'),require('./api/license'));_0x30179c[_0xcdf3('0x6')]('/api/campaigns',require(_0xcdf3('0xd5')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xd6'),require(_0xcdf3('0xd7')));_0x30179c['use']('/api/attachments',require(_0xcdf3('0xd8')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xd9'),require(_0xcdf3('0xda')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xdb'),require(_0xcdf3('0xdc')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xdd'),require(_0xcdf3('0xde')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xdf'),require(_0xcdf3('0xe0')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xe1'),require('./api/openchannelTransferReport'));_0x30179c[_0xcdf3('0x6')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x30179c['use'](_0xcdf3('0xe2'),require(_0xcdf3('0xe3')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xe4'),require(_0xcdf3('0xe5')));_0x30179c['use'](_0xcdf3('0xe6'),require(_0xcdf3('0xe7')));_0x30179c[_0xcdf3('0x6')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x30179c['use']('/api/userProfile/resources',require(_0xcdf3('0xe8')));_0x30179c[_0xcdf3('0x6')]('/api/auth/local',require('./api/authLocal'));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xe9'),require(_0xcdf3('0xea')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xeb'),require(_0xcdf3('0xec')));_0x30179c[_0xcdf3('0x6')]('/api/rpc',require(_0xcdf3('0xed')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xee'),require(_0xcdf3('0xef')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xf0'),require(_0xcdf3('0xf1')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xf2'),require('./api/pm2'));_0x30179c['use']('/apidoc',express[_0xcdf3('0xf3')](path[_0xcdf3('0xf4')](config[_0xcdf3('0xf5')],'/apidoc')));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xf6'),express[_0xcdf3('0xf3')](path[_0xcdf3('0xf4')](config[_0xcdf3('0xf5')],_0xcdf3('0xf6'))));_0x30179c['use'](_0xcdf3('0xf7'),express[_0xcdf3('0xf3')](path['join'](config[_0xcdf3('0xf5')],'/demo')));_0x30179c['use'](_0xcdf3('0xf8'),express['static'](path[_0xcdf3('0xf4')](config[_0xcdf3('0xf5')],_0xcdf3('0xf9'),_0xcdf3('0xfa'))));_0x30179c[_0xcdf3('0x6')](_0xcdf3('0xfb'),express['static'](path[_0xcdf3('0xf4')](config['root'],_0xcdf3('0xfc'))));_0x30179c[_0xcdf3('0xfd')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xcdf3('0xfe')](errors[0x194]);_0x30179c[_0xcdf3('0xfd')]('/*')['get'](function(_0x391f62,_0x75da){_0x75da[_0xcdf3('0xff')](path[_0xcdf3('0x100')](_0x30179c[_0xcdf3('0xfe')](_0xcdf3('0x101'))+_0xcdf3('0x102')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index dfb7ec0..92d9efa 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11c3=['../api/memberReport/memberReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x11c3,0x108));var _0x311c=function(_0x1d81b2,_0x2f7f1){_0x1d81b2=_0x1d81b2-0x0;var _0x19c641=_0x11c3[_0x1d81b2];return _0x19c641;};'use strict';var jayson=require(_0x311c('0x0'));var BPromise=require(_0x311c('0x1'));var _=require(_0x311c('0x2'));var config=require(_0x311c('0x3'));exports[_0x311c('0x4')]=function(){return new BPromise(function(_0x10d126,_0x5c162e){var _0x21b92f={};_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0x5')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/voiceExtension/voiceExtension.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x7')));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0x8')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x9')));_0x21b92f=_['merge'](_0x21b92f,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0xa')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0xb')));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0xc')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/trunk/trunk.rpc'));_0x21b92f=_['merge'](_0x21b92f,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x21b92f=_['merge'](_0x21b92f,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0xd')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0xe')));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0xf')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/mailInteraction/mailInteraction.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x10')));_0x21b92f=_['merge'](_0x21b92f,require('../api/mailApplication/mailApplication.rpc'));_0x21b92f=_['merge'](_0x21b92f,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x11')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x12')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x13')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/faxMessage/faxMessage.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x14')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x15')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x16')));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0x17')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x18')));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0x19')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x1a')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x1b')));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0x1c')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x1d')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x1e')));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0x1f')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x20')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x21')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x22')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x23')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x24')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x25')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/interval/interval.rpc'));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0x26')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/sound/sound.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x27')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x28')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/variable/variable.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x29')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x2a')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x2b')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x2c')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x2d')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x2e')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x2f')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x30')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0x31')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x32')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x33')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x34')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x35')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x36')));_0x21b92f=_['merge'](_0x21b92f,require(_0x311c('0x37')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require('../api/squareMessage/squareMessage.rpc'));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x38')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x39')));_0x21b92f=_[_0x311c('0x6')](_0x21b92f,require(_0x311c('0x3a')));var _0x4fe09d=jayson[_0x311c('0x3b')](_0x21b92f)[_0x311c('0x3c')]();var _0x3bee8d=config[_0x311c('0x3d')][_0x311c('0x3e')]||config['port']+0x1;var _0x4a52ab=config[_0x311c('0x3d')]['ip']||_0x311c('0x3f');_0x4fe09d['on'](_0x311c('0x40'),function(_0xf057ba){return _0x5c162e(_0xf057ba);});_0x4fe09d[_0x311c('0x4')](_0x3bee8d,_0x4a52ab,function(){console['log'](_0x311c('0x41'),_0x4a52ab,_0x3bee8d);require(_0x311c('0x42'))[_0x311c('0x43')]();return _0x10d126(_0x311c('0x44')+_0x4a52ab+':'+_0x3bee8d);});});}; \ No newline at end of file +var _0x92fc=['../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','merge','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc'];(function(_0x37d334,_0x22d198){var _0x48630a=function(_0x2c754c){while(--_0x2c754c){_0x37d334['push'](_0x37d334['shift']());}};_0x48630a(++_0x22d198);}(_0x92fc,0x151));var _0xc92f=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0x92fc[_0x2e41e2];return _0x2844d6;};'use strict';var jayson=require(_0xc92f('0x0'));var BPromise=require(_0xc92f('0x1'));var _=require(_0xc92f('0x2'));var config=require(_0xc92f('0x3'));exports['listen']=function(){return new BPromise(function(_0x456347,_0x559af5){var _0x373153={};_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/user/user.rpc'));_0x373153=_['merge'](_0x373153,require('../api/voiceExtension/voiceExtension.rpc'));_0x373153=_['merge'](_0x373153,require('../api/voiceQueue/voiceQueue.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/voiceRecording/voiceRecording.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x5')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x6')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x7')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x8')));_0x373153=_['merge'](_0x373153,require('../api/memberReport/memberReport.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/trunk/trunk.rpc'));_0x373153=_['merge'](_0x373153,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x9')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/mailServerIn/mailServerIn.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0xa')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0xb')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0xc')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0xd')));_0x373153=_['merge'](_0x373153,require(_0xc92f('0xe')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0xf')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/faxAccount/faxAccount.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x10')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x11')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x12')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/faxQueue/faxQueue.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x13')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/smsAccount/smsAccount.rpc'));_0x373153=_['merge'](_0x373153,require(_0xc92f('0x14')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x15')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x16')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x17')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x18')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x373153=_['merge'](_0x373153,require(_0xc92f('0x19')));_0x373153=_['merge'](_0x373153,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/chatInteraction/chatInteraction.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x1a')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x1b')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x1c')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/cmHopper/cmHopper.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x1d')));_0x373153=_['merge'](_0x373153,require(_0xc92f('0x1e')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x1f')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x20')));_0x373153=_['merge'](_0x373153,require(_0xc92f('0x21')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x22')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x23')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/template/template.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x24')));_0x373153=_['merge'](_0x373153,require(_0xc92f('0x25')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x26')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x27')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x28')));_0x373153=_['merge'](_0x373153,require(_0xc92f('0x29')));_0x373153=_['merge'](_0x373153,require(_0xc92f('0x2a')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x2b')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x2c')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x2d')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x2e')));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x2f')));_0x373153=_['merge'](_0x373153,require('../api/squareReport/squareReport.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x30')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/squareOdbc/squareOdbc.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/squareProject/squareProject.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/squareRecording/squareRecording.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x31')));_0x373153=_['merge'](_0x373153,require(_0xc92f('0x32')));_0x373153=_[_0xc92f('0x4')](_0x373153,require('../api/attachment/attachment.rpc'));_0x373153=_[_0xc92f('0x4')](_0x373153,require(_0xc92f('0x33')));var _0x32e096=jayson[_0xc92f('0x34')](_0x373153)['http']();var _0x57916c=config[_0xc92f('0x35')][_0xc92f('0x36')]||config[_0xc92f('0x36')]+0x1;var _0x3a4726=config['rpc']['ip']||_0xc92f('0x37');_0x32e096['on']('error',function(_0x55d77e){return _0x559af5(_0x55d77e);});_0x32e096['listen'](_0x57916c,_0x3a4726,function(){console[_0xc92f('0x38')](_0xc92f('0x39'),_0x3a4726,_0x57916c);require(_0xc92f('0x3a'))[_0xc92f('0x3b')]();return _0x456347(_0xc92f('0x3c')+_0x3a4726+':'+_0x57916c);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e8ac9a5..cdf5dfe 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','startsWith','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','function','write','inherits','sendRequest','prototype','answer','beep','format','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','utf8','setEncoding','headers','emit','ready','line'];(function(_0x156f75,_0x3233ee){var _0x5523a3=function(_0x2b9329){while(--_0x2b9329){_0x156f75['push'](_0x156f75['shift']());}};_0x5523a3(++_0x3233ee);}(_0x34e8,0x12c));var _0x834e=function(_0x25efc8,_0x52071c){_0x25efc8=_0x25efc8-0x0;var _0x54d5fd=_0x34e8[_0x25efc8];return _0x54d5fd;};'use strict';var util=require(_0x834e('0x0'));var _=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x834e('0x4'));function AGIChannel(_0x21e2e0){var _0x472111=this,_0x31bf20=new AGIReply(),_0x289ef2=![],_0x19a3e0={};EventEmitter[_0x834e('0x5')](_0x472111);_0x21e2e0['setEncoding'](_0x834e('0x6'));_0x21e2e0['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x31bf20[_0x834e('0x7')](_0x834e('0x6'));_0x31bf20['on'](_0x834e('0x8'),function(_0x2e69e2){for(var _0x33ea05 in _0x2e69e2){_0x472111[_0x33ea05]=_0x2e69e2[_0x33ea05];}_0x472111[_0x834e('0x9')](_0x834e('0xa'));});_0x31bf20['on'](_0x834e('0xb'),function(_0x3bdda9){if(_0x3bdda9[_0x834e('0xc')]()==_0x834e('0xd')){_0x472111[_0x834e('0x9')](_0x834e('0xd'));return;}if(_0x3bdda9[_0x834e('0xe')](0x0,0xb)==_0x834e('0xf')){_0x289ef2=!![];}if(_0x289ef2){_0x19a3e0['rx']+=_0x3bdda9+'\x0a';if(_0x3bdda9[_0x834e('0x10')](_0x834e('0x11'))!=-0x1){_0x289ef2=![];}}else{_0x19a3e0['rx']=_0x3bdda9;}if(_0x289ef2){return;}if(typeof _0x19a3e0['cb']=='function'){var _0x5e5b6d=_0x19a3e0['rx'][_0x834e('0xe')](0x0,0x3),_0x6cd9b9=null,_0x58a27e=null;_0x5e5b6d=parseInt(_0x5e5b6d);if(isNaN(_0x5e5b6d)){_0x19a3e0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x834e('0x12')});return;}if(_0x5e5b6d!=0xc8){_0x19a3e0['cb'](null,{'code':_0x5e5b6d,'result':-0x1,'extra':'KO'});return;}_0x6cd9b9=_0x19a3e0['rx'][_0x834e('0xe')](0x4)[_0x834e('0x13')]('result=','');if(_0x6cd9b9[_0x834e('0x14')]('\x20')!=-0x1){_0x6cd9b9=_0x6cd9b9[_0x834e('0x15')](0x0,_0x6cd9b9['indexOf']('\x20'));}if(_[_0x834e('0x16')](_0x6cd9b9,'-1')){_0x6cd9b9=parseInt(_0x6cd9b9);}_0x58a27e=_0x19a3e0['rx']['split']('\x20');if(_0x58a27e[_0x834e('0x17')]==0x3){_0x58a27e=_0x58a27e[0x2][_0x834e('0xe')](0x1,_0x58a27e[0x2]['length']-0x1);}else if(_0x58a27e[_0x834e('0x17')]>0x3){var _0x22106e=/\((.+)\)/;var _0x370fb5=_0x19a3e0['rx']['match'](_0x22106e);if(_0x370fb5){_0x58a27e=_0x370fb5[0x1];}else{_0x58a27e=null;}}else{_0x58a27e=null;}_0x19a3e0['cb'](null,{'code':_0x5e5b6d,'result':_0x6cd9b9,'extra':_0x58a27e});}});_0x21e2e0['on'](_0x834e('0x18'),function(_0x211e9a){_0x472111[_0x834e('0x9')](_0x834e('0x18'),new AGIError(_0x834e('0x19'),_0x211e9a[_0x834e('0x1a')]));});_0x21e2e0['on'](_0x834e('0x1b'),function(){_0x472111['emit'](_0x834e('0x1b'),new AGIError(_0x834e('0x1c')));});_0x21e2e0['on'](_0x834e('0x1d'),function(){_0x472111[_0x834e('0x9')]('timeout',new AGIError(_0x834e('0x1e')));_0x21e2e0[_0x834e('0x1f')]();});_0x21e2e0['pipe'](_0x31bf20);this[_0x834e('0x20')]=function(_0x28d687,_0x8d406e){var _0x28d687=_0x28d687||'',_0x8d406e=typeof _0x8d406e==_0x834e('0x21')?_0x8d406e:new Function();_0x19a3e0={'tx':_0x28d687,'rx':'','cb':_0x8d406e};_0x21e2e0[_0x834e('0x22')](_0x28d687+'\x0a');},this['close']=function(){_0x21e2e0[_0x834e('0x1f')]();};}util[_0x834e('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x834e('0x24')]=function(_0x2e1983){return this[_0x834e('0x20')]['sync'](this,_0x2e1983);};AGIChannel[_0x834e('0x25')][_0x834e('0x26')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x834e('0x25')]['getData']=function(_0x2826ec,_0x3f1b0b,_0x3db026){_0x2826ec=_0x2826ec===undefined?_0x834e('0x27'):_0x2826ec;_0x3f1b0b=_0x3f1b0b===undefined?'5':_0x3f1b0b;_0x3db026=_0x3db026===undefined?'1':_0x3db026;return this[_0x834e('0x24')](util[_0x834e('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2826ec,_0x3f1b0b*0x3e8,_0x3db026));};AGIChannel['prototype']['noop']=function(_0x58c1d7){_0x58c1d7=_0x58c1d7||_0x834e('0x29');return this[_0x834e('0x24')](util[_0x834e('0x28')]('VERBOSE\x20\x22%s\x22',_0x58c1d7));};AGIChannel[_0x834e('0x25')][_0x834e('0x2a')]=function(_0x1f3671,_0x1e026a){if(_[_0x834e('0x2b')](_0x1e026a)){return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x2c'),_0x1f3671,_0x1e026a[_0x834e('0x2d')](',')));}return this['sendRequest'](util[_0x834e('0x28')]('EXEC\x20%s\x20%s',_0x1f3671,_0x1e026a));};AGIChannel[_0x834e('0x25')][_0x834e('0x2e')]=function(_0x9ab921){return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x2f'),_0x9ab921));};AGIChannel[_0x834e('0x25')][_0x834e('0x30')]=function(_0x358c31){return this[_0x834e('0x24')](util['format'](_0x834e('0x31'),_0x358c31));};AGIChannel[_0x834e('0x25')][_0x834e('0x32')]=function(_0xaf01f4){return this['sendRequest'](util[_0x834e('0x28')](_0x834e('0x33'),_0xaf01f4));};AGIChannel['prototype']['hangup']=function(){return this['sendRequest'](_0x834e('0x34'));};AGIChannel[_0x834e('0x25')][_0x834e('0x35')]=function(_0x34fefb,_0x339e28){var _0x1b76dd=_['isBoolean'](_0x339e28)||_[_0x834e('0x36')](_0x339e28)?_0x339e28['toString']():_0x339e28;return this[_0x834e('0x24')](util[_0x834e('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x34fefb,_0x1b76dd?_0x1b76dd[_0x834e('0x37')]()[_0x834e('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x388711,_0xd0d43a){return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x38'),_0x388711,_0xd0d43a));};AGIChannel['prototype'][_0x834e('0x39')]=function(_0x548d1d,_0x50c243){return this[_0x834e('0x24')](util['format'](_0x834e('0x3a'),_0x548d1d,_0x50c243));};AGIChannel[_0x834e('0x25')][_0x834e('0x3b')]=function(_0x3c59af,_0x2b7933){return this['sendRequest'](util[_0x834e('0x28')](_0x834e('0x3c'),_0x3c59af,_0x2b7933));};AGIChannel[_0x834e('0x25')]['continueAt']=function(_0x35380e,_0x16ac45,_0x57b89a){_0x16ac45=_0x16ac45||this[_0x834e('0x3d')];_0x57b89a=_0x57b89a||0x1;this['setContext'](_0x35380e);this[_0x834e('0x30')](_0x16ac45);this[_0x834e('0x32')](_0x57b89a);return this['noop'](util['format'](_0x834e('0x3e'),_0x35380e,_0x16ac45,_0x57b89a));};AGIChannel[_0x834e('0x25')][_0x834e('0x3f')]=function(_0xbc1571){return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x40'),_0xbc1571));};AGIChannel['prototype'][_0x834e('0x41')]=function(_0x5abb7a,_0x321efa,_0x540685,_0x1df5b0,_0x5a5807,_0x361f60){_0x321efa=_0x321efa||_0x834e('0x42');_0x540685=_0x540685||'';_0x1df5b0=_0x1df5b0===undefined?-0x1:_0x1df5b0==='-1'?-0x1:_0x1df5b0*0x3e8;_0x5a5807=_0x5a5807===undefined?'':'s='+_0x5a5807;_0x361f60=_0x361f60?'BEEP':'';return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x43'),_0x5abb7a,_0x321efa,_0x540685,_0x1df5b0,_0x361f60,_0x5a5807));};AGIChannel[_0x834e('0x25')][_0x834e('0x44')]=function(_0x1a7149,_0xfa28da){_0xfa28da=_0xfa28da||'';return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x45'),_0x1a7149,_0xfa28da));};AGIChannel['prototype'][_0x834e('0x46')]=function(_0x6fff27){return this['exec'](_0x834e('0x47'),_0x6fff27);};AGIChannel[_0x834e('0x25')][_0x834e('0x48')]=function(_0x2112d5){return this[_0x834e('0x2a')](_0x834e('0x49'),_0x2112d5);};AGIChannel['prototype']['error']=function(_0x954d4b,_0x1a5444){this[_0x834e('0x4a')](util[_0x834e('0x28')](_0x834e('0x4b'),_0x954d4b['id'],_0x954d4b[_0x834e('0x4c')],_0x1a5444));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x834e('0x4d')]=AGIChannel; \ No newline at end of file +var _0xedd9=['getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','emit','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','sendRequest','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xedd9,0xfc));var _0x9edd=function(_0x192895,_0xd92c82){_0x192895=_0x192895-0x0;var _0x6d6bb=_0xedd9[_0x192895];return _0x6d6bb;};'use strict';var util=require('util');var _=require(_0x9edd('0x0'));var EventEmitter=require(_0x9edd('0x1'))[_0x9edd('0x2')];var AGIReply=require(_0x9edd('0x3'));var AGIError=require(_0x9edd('0x4'));function AGIChannel(_0x127cbe){var _0x3e6d3a=this,_0x36b53f=new AGIReply(),_0x5943b3=![],_0x33679f={};EventEmitter[_0x9edd('0x5')](_0x3e6d3a);_0x127cbe[_0x9edd('0x6')](_0x9edd('0x7'));_0x127cbe['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x36b53f[_0x9edd('0x6')]('utf8');_0x36b53f['on'](_0x9edd('0x8'),function(_0x190185){for(var _0x1355be in _0x190185){_0x3e6d3a[_0x1355be]=_0x190185[_0x1355be];}_0x3e6d3a[_0x9edd('0x9')]('ready');});_0x36b53f['on'](_0x9edd('0xa'),function(_0x5d2f90){if(_0x5d2f90[_0x9edd('0xb')]()==_0x9edd('0xc')){_0x3e6d3a['emit'](_0x9edd('0xc'));return;}if(_0x5d2f90[_0x9edd('0xd')](0x0,0xb)=='520-Invalid'){_0x5943b3=!![];}if(_0x5943b3){_0x33679f['rx']+=_0x5d2f90+'\x0a';if(_0x5d2f90[_0x9edd('0xe')](_0x9edd('0xf'))!=-0x1){_0x5943b3=![];}}else{_0x33679f['rx']=_0x5d2f90;}if(_0x5943b3){return;}if(typeof _0x33679f['cb']==_0x9edd('0x10')){var _0xfd544a=_0x33679f['rx'][_0x9edd('0xd')](0x0,0x3),_0x287ddd=null,_0x3a7b84=null;_0xfd544a=parseInt(_0xfd544a);if(isNaN(_0xfd544a)){_0x33679f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x9edd('0x11')});return;}if(_0xfd544a!=0xc8){_0x33679f['cb'](null,{'code':_0xfd544a,'result':-0x1,'extra':'KO'});return;}_0x287ddd=_0x33679f['rx']['substring'](0x4)[_0x9edd('0x12')](_0x9edd('0x13'),'');if(_0x287ddd[_0x9edd('0x14')]('\x20')!=-0x1){_0x287ddd=_0x287ddd[_0x9edd('0x15')](0x0,_0x287ddd[_0x9edd('0x14')]('\x20'));}if(_[_0x9edd('0x16')](_0x287ddd,'-1')){_0x287ddd=parseInt(_0x287ddd);}_0x3a7b84=_0x33679f['rx'][_0x9edd('0x17')]('\x20');if(_0x3a7b84[_0x9edd('0x18')]==0x3){_0x3a7b84=_0x3a7b84[0x2]['substring'](0x1,_0x3a7b84[0x2][_0x9edd('0x18')]-0x1);}else if(_0x3a7b84[_0x9edd('0x18')]>0x3){var _0x449cee=/\((.+)\)/;var _0x5acf65=_0x33679f['rx'][_0x9edd('0x19')](_0x449cee);if(_0x5acf65){_0x3a7b84=_0x5acf65[0x1];}else{_0x3a7b84=null;}}else{_0x3a7b84=null;}_0x33679f['cb'](null,{'code':_0xfd544a,'result':_0x287ddd,'extra':_0x3a7b84});}});_0x127cbe['on'](_0x9edd('0x1a'),function(_0x40ba32){_0x3e6d3a['emit'](_0x9edd('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x40ba32[_0x9edd('0x1b')]));});_0x127cbe['on'](_0x9edd('0x1c'),function(){_0x3e6d3a['emit']('close',new AGIError(_0x9edd('0x1d')));});_0x127cbe['on']('timeout',function(){_0x3e6d3a[_0x9edd('0x9')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x127cbe[_0x9edd('0x1e')]();});_0x127cbe[_0x9edd('0x1f')](_0x36b53f);this['command']=function(_0x5823bc,_0x341d67){var _0x5823bc=_0x5823bc||'',_0x341d67=typeof _0x341d67=='function'?_0x341d67:new Function();_0x33679f={'tx':_0x5823bc,'rx':'','cb':_0x341d67};_0x127cbe[_0x9edd('0x20')](_0x5823bc+'\x0a');},this[_0x9edd('0x1c')]=function(){_0x127cbe[_0x9edd('0x1e')]();};}util[_0x9edd('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x9edd('0x22')]['sendRequest']=function(_0x46c383){return this[_0x9edd('0x23')][_0x9edd('0x24')](this,_0x46c383);};AGIChannel[_0x9edd('0x22')][_0x9edd('0x25')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x9edd('0x22')][_0x9edd('0x26')]=function(_0x8d67aa,_0x25e135,_0x3c2227){_0x8d67aa=_0x8d67aa===undefined?'beep':_0x8d67aa;_0x25e135=_0x25e135===undefined?'5':_0x25e135;_0x3c2227=_0x3c2227===undefined?'1':_0x3c2227;return this['sendRequest'](util[_0x9edd('0x27')](_0x9edd('0x28'),_0x8d67aa,_0x25e135*0x3e8,_0x3c2227));};AGIChannel[_0x9edd('0x22')]['noop']=function(_0x238b22){_0x238b22=_0x238b22||_0x9edd('0x29');return this[_0x9edd('0x2a')](util[_0x9edd('0x27')]('VERBOSE\x20\x22%s\x22',_0x238b22));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x2b')]=function(_0xbe87e1,_0x12c1bc){if(_[_0x9edd('0x2c')](_0x12c1bc)){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x2d'),_0xbe87e1,_0x12c1bc[_0x9edd('0x2e')](',')));}return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x2d'),_0xbe87e1,_0x12c1bc));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x2f')]=function(_0x1a6c23){return this['sendRequest'](util[_0x9edd('0x27')](_0x9edd('0x30'),_0x1a6c23));};AGIChannel[_0x9edd('0x22')]['setExtension']=function(_0x2d2f88){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x31'),_0x2d2f88));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x32')]=function(_0x473068){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x33'),_0x473068));};AGIChannel[_0x9edd('0x22')][_0x9edd('0xc')]=function(){return this[_0x9edd('0x2a')](_0x9edd('0x34'));};AGIChannel['prototype'][_0x9edd('0x35')]=function(_0x5ed62d,_0x968303){var _0x148630=_[_0x9edd('0x36')](_0x968303)||_[_0x9edd('0x37')](_0x968303)?_0x968303[_0x9edd('0x38')]():_0x968303;return this['sendRequest'](util[_0x9edd('0x27')](_0x9edd('0x39'),_0x5ed62d,_0x148630?_0x148630[_0x9edd('0x38')]()[_0x9edd('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x3a')]=function(_0x5c0627,_0x1cbbac){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')]('SAY\x20NUMBER\x20%s\x20%s',_0x5c0627,_0x1cbbac));};AGIChannel[_0x9edd('0x22')]['sayDigits']=function(_0x3ef1d5,_0x5658d6){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x3b'),_0x3ef1d5,_0x5658d6));};AGIChannel['prototype'][_0x9edd('0x3c')]=function(_0xcbd0ef,_0x2f8f61){return this['sendRequest'](util[_0x9edd('0x27')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xcbd0ef,_0x2f8f61));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x3d')]=function(_0x50be2c,_0x315f52,_0x40fdfb){_0x315f52=_0x315f52||this[_0x9edd('0x3e')];_0x40fdfb=_0x40fdfb||0x1;this[_0x9edd('0x2f')](_0x50be2c);this['setExtension'](_0x315f52);this[_0x9edd('0x32')](_0x40fdfb);return this['noop'](util[_0x9edd('0x27')](_0x9edd('0x3f'),_0x50be2c,_0x315f52,_0x40fdfb));};AGIChannel['prototype'][_0x9edd('0x40')]=function(_0x49a128){return this['sendRequest'](util[_0x9edd('0x27')](_0x9edd('0x41'),_0x49a128));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x42')]=function(_0x25e6ec,_0x4737ae,_0x3ff512,_0x75efbe,_0x18c149,_0x2b081a){_0x4737ae=_0x4737ae||_0x9edd('0x43');_0x3ff512=_0x3ff512||'';_0x75efbe=_0x75efbe===undefined?-0x1:_0x75efbe==='-1'?-0x1:_0x75efbe*0x3e8;_0x18c149=_0x18c149===undefined?'':'s='+_0x18c149;_0x2b081a=_0x2b081a?_0x9edd('0x44'):'';return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x45'),_0x25e6ec,_0x4737ae,_0x3ff512,_0x75efbe,_0x2b081a,_0x18c149));};AGIChannel['prototype'][_0x9edd('0x46')]=function(_0x2570e3,_0x2231c1){_0x2231c1=_0x2231c1||'';return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x47'),_0x2570e3,_0x2231c1));};AGIChannel[_0x9edd('0x22')]['agi']=function(_0x4a4656){return this['exec'](_0x9edd('0x48'),_0x4a4656);};AGIChannel['prototype'][_0x9edd('0x49')]=function(_0x19b56b){return this[_0x9edd('0x2b')](_0x9edd('0x4a'),_0x19b56b);};AGIChannel[_0x9edd('0x22')]['error']=function(_0x387fb8,_0x35e63c){this[_0x9edd('0x4b')](util['format'](_0x9edd('0x4c'),_0x387fb8['id'],_0x387fb8[_0x9edd('0x4d')],_0x35e63c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9edd('0x4e')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 15db3b8..50f4727 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 _0xb821=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xb821,0xa7));var _0x1b82=function(_0x3dbb43,_0x1a4e7b){_0x3dbb43=_0x3dbb43-0x0;var _0x3856ca=_0xb821[_0x3dbb43];return _0x3856ca;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x1b82('0x0'),'E_AGI_ARGUMENT_PORT':_0x1b82('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x1b82('0x2'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x1b82('0x3'),'E_AGI_SOCKET_TIMEOUT':_0x1b82('0x4'),'E_AGI_COMMAND_EMPTY':_0x1b82('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1b82('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3e27c4){var _0x3e27c4=_0x3e27c4||null,_0x202a5f=_0x202a5f||[],_0x3632dd=0x1,_0x18f45f='';if(!error[_0x3e27c4]){_0x3e27c4=_0x1b82('0x7');}_0x202a5f[_0x1b82('0x8')](error[_0x3e27c4]);while(arguments[_0x3632dd]){_0x202a5f[_0x1b82('0x8')](arguments[_0x3632dd]);_0x3632dd++;}_0x18f45f=util[_0x1b82('0x9')]['apply'](util,_0x202a5f);this[_0x1b82('0xa')]=_0x18f45f;this[_0x1b82('0xb')]=_0x3e27c4;}module[_0x1b82('0xc')]=AGIError; \ No newline at end of file +var _0xbdd7=['Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x1c2d80,_0xe9b773){var _0x5cc58c=function(_0x2076f6){while(--_0x2076f6){_0x1c2d80['push'](_0x1c2d80['shift']());}};_0x5cc58c(++_0xe9b773);}(_0xbdd7,0xed));var _0x7bdd=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbdd7[_0x6131cd];return _0x47e916;};'use strict';var util=require(_0x7bdd('0x0'));var error={'E_AGI_UNDEFINED':_0x7bdd('0x1'),'E_AGI_ARGUMENT_PORT':_0x7bdd('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x7bdd('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x7bdd('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x7bdd('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x7bdd('0x6'),'E_AGI_COMMAND_EMPTY':_0x7bdd('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7bdd('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x37587c){var _0x37587c=_0x37587c||null,_0x769fde=_0x769fde||[],_0x1062b2=0x1,_0x48f7b1='';if(!error[_0x37587c]){_0x37587c=_0x7bdd('0x9');}_0x769fde[_0x7bdd('0xa')](error[_0x37587c]);while(arguments[_0x1062b2]){_0x769fde[_0x7bdd('0xa')](arguments[_0x1062b2]);_0x1062b2++;}_0x48f7b1=util['format']['apply'](util,_0x769fde);this['message']=_0x48f7b1;this[_0x7bdd('0xb')]=_0x37587c;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index e9b1728..4b3bfa8 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 _0x878f=['target','default','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size','relations','no\x20vertex\x20found','length','info','no\x20edge/s\x20available','condition','split','agicommand','vswitch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x878f,0x173));var _0xf878=function(_0x2d91fc,_0x35f8bb){_0x2d91fc=_0x2d91fc-0x0;var _0x5eccde=_0x878f[_0x2d91fc];return _0x5eccde;};'use strict';var _=require('lodash');var logger=require(_0xf878('0x0'))(_0xf878('0x1'));var verticesWithRetry=[_0xf878('0x2'),_0xf878('0x3'),_0xf878('0x4')];var Graph=function(){this[_0xf878('0x5')]={};this[_0xf878('0x6')]={};this[_0xf878('0x7')]=0x0;};Graph[_0xf878('0x8')][_0xf878('0x9')]=function(_0x27ae4d){this['vertices'][_0x27ae4d['id']]=_0x27ae4d;this['edges'][_0x27ae4d['id']]=[];};Graph[_0xf878('0x8')][_0xf878('0xa')]=function(_0x59e564,_0x52851e,_0x530767){this[_0xf878('0x6')][_0x59e564]['push']({'target':_0x52851e,'condition':_0x530767});this['numberOfEdges']+=0x1;};Graph[_0xf878('0x8')][_0xf878('0xb')]=function(){return _[_0xf878('0xb')](this['vertices']);};Graph[_0xf878('0x8')][_0xf878('0xc')]=function(){return this['numberOfEdges'];};Graph[_0xf878('0x8')]['getVertex']=function(_0x31d3d2){return this[_0xf878('0x5')][_0x31d3d2];};Graph[_0xf878('0x8')]['traverseBFS']=function(_0x1ce004,_0x38eddf){if(!this[_0xf878('0x5')][_0x1ce004]){return logger['info'](_0xf878('0xd'));}var _0x3902f7=_0x38eddf(this[_0xf878('0x5')][_0x1ce004]);if(!_0x3902f7){return logger['info']('stop\x20traverse');}if(this[_0xf878('0x6')][_0x1ce004][_0xf878('0xe')]===0x0){return logger[_0xf878('0xf')](_0xf878('0x10'));}for(var _0x44aacc=0x0,_0x186a02=[],_0x415056=![];_0x44aacc\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','retry','maxRetry','hasOwnProperty','length','source','target','addEdge','value','then','catch','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','context','extension','priority','response','isUndefined','result','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','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','close','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','moment','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','defaults','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0xdc97,0x13b));var _0x7dc9=function(_0x19bc27,_0x1899e2){_0x19bc27=_0x19bc27-0x0;var _0x43942e=_0xdc97[_0x19bc27];return _0x43942e;};'use strict';var parser=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));var syncho=require(_0x7dc9('0x2'));var util=require('util');var moment=require(_0x7dc9('0x3'));var config=require('../../config/environment');var logger=require(_0x7dc9('0x4'))(_0x7dc9('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x7dc9('0x6'));var mailRpc=require(_0x7dc9('0x7'));var Graph=require(_0x7dc9('0x8'));var Vertices=require(_0x7dc9('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x7dc9('0xa')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x2ff923){process[_0x7dc9('0xb')](function(){syncho(function(){try{setChannelVariables(_0x2ff923);agiHandler(_0x2ff923);}catch(_0x3318ea){logger[_0x7dc9('0xc')](_0x3318ea[_0x7dc9('0xd')]);}});});}function listeningHandler(){console['log'](_0x7dc9('0xe'),config[_0x7dc9('0x5')][_0x7dc9('0xf')]);logger[_0x7dc9('0x10')](util[_0x7dc9('0x11')](_0x7dc9('0x12'),config[_0x7dc9('0x5')]['ip'],config['agi']['port']));}function errorHandler(_0x4be1c8){if(_0x4be1c8&&_0x4be1c8['name']&&_0x4be1c8[_0x7dc9('0x13')]){logger[_0x7dc9('0xc')](util['format'](_0x7dc9('0x14'),_0x4be1c8[_0x7dc9('0x15')],_0x4be1c8[_0x7dc9('0x13')]));}else{logger[_0x7dc9('0xc')](util[_0x7dc9('0x11')](_0x7dc9('0x16'),_0x4be1c8['stack']));}}function closeHandler(){logger[_0x7dc9('0x10')](util[_0x7dc9('0x11')](_0x7dc9('0x17'),this[_0x7dc9('0x18')],this[_0x7dc9('0x19')],this[_0x7dc9('0x1a')],this[_0x7dc9('0x1b')],this[_0x7dc9('0x1c')]));try{createSquareReport(this);}catch(_0x4778d5){logger['error'](_0x4778d5[_0x7dc9('0xd')]);}}function timeoutHandler(){logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x1d'),this['arg_1'],this[_0x7dc9('0x19')],this[_0x7dc9('0x1a')],this[_0x7dc9('0x1b')],this[_0x7dc9('0x1c')]));}function hangupHandler(){logger[_0x7dc9('0x10')](util[_0x7dc9('0x11')](_0x7dc9('0x1e'),this[_0x7dc9('0x18')],this[_0x7dc9('0x19')],this[_0x7dc9('0x1a')],this['dnid'],this['uniqueid']));this[_0x7dc9('0x1f')]=!![];}function getRoot(_0x5981e2){return parser['toJson'](_0x5981e2,{'object':!![]})[_0x7dc9('0x20')][_0x7dc9('0x21')];}function addVertex(_0x5e9525,_0xffc080,_0x43d31f){_0xffc080[_0x7dc9('0x22')]=_0x43d31f;if(_0xffc080['hasOwnProperty'](_0x7dc9('0x23'))){_0xffc080[_0x7dc9('0x24')]=parseInt(_0xffc080[_0x7dc9('0x23')],0xa);}_0x5e9525['addVertex'](_['omit'](_0xffc080,'mxCell'));}function initGraph(_0x25b383,_0x32d032){var _0x5843bf=new Graph();for(var _0x585eef in _0x25b383){if(_0x25b383[_0x7dc9('0x25')](_0x585eef)){if(_['isArray'](_0x25b383[_0x585eef])){for(var _0x2d22eb=0x0;_0x2d22eb<_0x25b383[_0x585eef][_0x7dc9('0x26')];_0x2d22eb+=0x1){addVertex(_0x5843bf,_0x25b383[_0x585eef][_0x2d22eb],_0x585eef);}}else{addVertex(_0x5843bf,_0x25b383[_0x585eef],_0x585eef);}}}for(var _0x3a74a0=0x0;_0x3a74a0<_0x32d032[_0x7dc9('0x26')];_0x3a74a0+=0x1){if(_0x32d032[_0x3a74a0][_0x7dc9('0x27')]&&_0x32d032[_0x3a74a0][_0x7dc9('0x28')]){_0x5843bf[_0x7dc9('0x29')](_0x32d032[_0x3a74a0][_0x7dc9('0x27')],_0x32d032[_0x3a74a0][_0x7dc9('0x28')],_0x32d032[_0x3a74a0][_0x7dc9('0x2a')]);}}return _0x5843bf;}function getSquareProject(_0x14083d,_0x2a456c){rpc['getSquareProject'](_0x14083d)['then'](function(_0x513dd6){_0x2a456c(null,_0x513dd6);})['catch'](function(_0x4a68f0){_0x2a456c(null,_0x4a68f0);});}function createSquareReport(_0x553a03,_0x58c4e8){rpc['createSquareReport'](_0x553a03)[_0x7dc9('0x2b')](function(_0x21c4c2){if(_0x58c4e8){_0x58c4e8(null,_0x21c4c2);}})[_0x7dc9('0x2c')](function(_0x225410){if(_0x58c4e8){_0x58c4e8(null,_0x225410);}});}function setChannelVariables(_0x3300ff){for(var _0x154e22 in _0x3300ff){if(_0x3300ff['hasOwnProperty'](_0x154e22)){if(_0x154e22['indexOf']('agi_')===0x0){_0x3300ff[_0x154e22[_0x7dc9('0x2d')](0x4)]=_0x3300ff[_0x154e22];delete _0x3300ff[_0x154e22];}}}}function getLogFromObject(_0x49ed97){return util[_0x7dc9('0x2e')](_0x49ed97,{'showHidden':![],'depth':null});}function agiHandler(_0x448e46){var _0x1298f9,_0x213066,_0x109c66,_0x165882,_0xbb11e1;logger[_0x7dc9('0x2f')]('variables',JSON[_0x7dc9('0x30')](_0x448e46,null,0x2));logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x31'),_0x448e46[_0x7dc9('0x18')],_0x448e46[_0x7dc9('0x19')],_0x448e46['callerid'],_0x448e46[_0x7dc9('0x1b')],_0x448e46['uniqueid']));_0x448e46['on'](_0x7dc9('0xc'),errorHandler);_0x448e46['on']('close',closeHandler);_0x448e46['on']('timeout',timeoutHandler);_0x448e46[_0x7dc9('0x1f')]=![];_0x448e46['on'](_0x7dc9('0x32'),hangupHandler);var _0x21e036=getSquareProject[_0x7dc9('0x33')](null,_0x448e46['arg_1']);if(_0x21e036){if(_0x21e036[_0x7dc9('0x34')]){_0x1298f9=getRoot(_0x21e036[_0x7dc9('0x34')]);if(_0x1298f9&&_0x1298f9[_0x7dc9('0x35')]){logger[_0x7dc9('0x2f')](_0x7dc9('0x21'),JSON[_0x7dc9('0x30')](_0x1298f9,null,0x2));_0x448e46[_0x7dc9('0x36')]=moment()[_0x7dc9('0x11')](_0x7dc9('0x37'));_0x213066=initGraph(_[_0x7dc9('0x38')](_0x1298f9,_0x7dc9('0x39')),_0x1298f9[_0x7dc9('0x39')]);_0x109c66=new Vertices(_0x448e46,rpc,mailRpc);logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x3a'),_0x448e46[_0x7dc9('0x18')],_0x448e46[_0x7dc9('0x19')],_0x448e46['callerid'],_0x448e46[_0x7dc9('0x1b')],_0x448e46[_0x7dc9('0x1c')]));_0x213066[_0x7dc9('0x3b')](_0x1298f9[_0x7dc9('0x35')]['id'],function(_0x295853){try{_0x295853=_0x109c66[_0x7dc9('0x3c')](_0x295853);logger['debug']('vertex',JSON[_0x7dc9('0x30')](_0x295853,null,0x2));if(_0x295853[_0x7dc9('0x22')]==='gotoc'){logger[_0x7dc9('0x10')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x448e46[_0x7dc9('0x3d')]=_0x295853[_0x7dc9('0x3d')]||_0x448e46[_0x7dc9('0x3d')];_0x448e46['extension']=_0x295853[_0x7dc9('0x3e')];_0x448e46[_0x7dc9('0x3f')]=_0x295853[_0x7dc9('0x3f')]?_0x295853[_0x7dc9('0x3f')]-0x1:0x1;return null;}else if(_0x295853&&_0x109c66[_0x295853[_0x7dc9('0x22')]]){_0xbb11e1=_0x109c66[_0x295853[_0x7dc9('0x22')]](_0x295853);logger[_0x7dc9('0x10')]('response',JSON[_0x7dc9('0x30')](_0xbb11e1,null,0x2));if(_0xbb11e1&&_0xbb11e1['code']===AGI_CODE_SUCCESS&&_0xbb11e1['result']!==AGI_RESULT_ERROR&&!_0x448e46[_0x7dc9('0x1f')]){logger[_0x7dc9('0x2f')](_0x7dc9('0x40'),getLogFromObject(_0xbb11e1));return _[_0x7dc9('0x41')](_0xbb11e1[_0x7dc9('0x42')])?null:_0xbb11e1[_0x7dc9('0x42')][_0x7dc9('0x43')]();}else{logger[_0x7dc9('0xc')](_0x7dc9('0x40'),getLogFromObject(_0xbb11e1));return null;}}else{logger['error'](_0x7dc9('0x44'));return null;}}catch(_0x1971c7){logger[_0x7dc9('0xc')](_0x1971c7[_0x7dc9('0xd')]);return null;}});if(_0x1298f9[_0x7dc9('0x45')]){logger[_0x7dc9('0x10')](util['format'](_0x7dc9('0x46'),_0x448e46[_0x7dc9('0x18')],_0x448e46['calleridname'],_0x448e46[_0x7dc9('0x1a')],_0x448e46[_0x7dc9('0x1b')],_0x448e46[_0x7dc9('0x1c')]));_0x213066['traverseBFS'](_0x1298f9[_0x7dc9('0x45')]['id'],function(_0x5b3895){try{_0x5b3895=_0x109c66['clear'](_0x5b3895);logger[_0x7dc9('0x2f')](_0x7dc9('0x47'),JSON[_0x7dc9('0x30')](_0x5b3895,null,0x2));if(_0x5b3895&&_0x109c66[_0x5b3895['agicommand']]){_0xbb11e1=_0x109c66[_0x5b3895['agicommand']](_0x5b3895);if(_0xbb11e1){logger[_0x7dc9('0x2f')]('response',getLogFromObject(_0xbb11e1));return _[_0x7dc9('0x41')](_0xbb11e1[_0x7dc9('0x42')])?null:_0xbb11e1['result'][_0x7dc9('0x43')]();}else{logger[_0x7dc9('0xc')](_0x7dc9('0x40'),getLogFromObject(_0xbb11e1));return null;}}else{logger[_0x7dc9('0xc')](_0x7dc9('0x44'));return null;}}catch(_0x113087){logger[_0x7dc9('0xc')](_0x113087[_0x7dc9('0xd')]);return null;}});}logger[_0x7dc9('0x10')](util[_0x7dc9('0x11')](_0x7dc9('0x48'),_0x448e46[_0x7dc9('0x18')],_0x448e46[_0x7dc9('0x19')],_0x448e46['callerid'],_0x448e46[_0x7dc9('0x1b')],_0x448e46['uniqueid']));logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x49'),_0x448e46[_0x7dc9('0x3d')],_0x448e46[_0x7dc9('0x3e')],parseInt(_0x448e46[_0x7dc9('0x3f')],0xa)+0x1));_0x448e46['continueAt'](_0x448e46[_0x7dc9('0x3d')],_0x448e46[_0x7dc9('0x3e')],parseInt(_0x448e46[_0x7dc9('0x3f')],0xa)+0x1);_0x448e46['close']();}}else{logger[_0x7dc9('0xc')](util[_0x7dc9('0x11')](_0x7dc9('0x4a'),_0x448e46[_0x7dc9('0x18')]));_0x448e46[_0x7dc9('0x4b')](_0x448e46[_0x7dc9('0x3d')],_0x448e46['extension'],parseInt(_0x448e46[_0x7dc9('0x3f')],0xa)+0x1);_0x448e46[_0x7dc9('0x4c')]();}}else{logger[_0x7dc9('0xc')](util[_0x7dc9('0x11')](_0x7dc9('0x4d'),_0x448e46[_0x7dc9('0x18')]));_0x448e46[_0x7dc9('0x4b')](_0x448e46[_0x7dc9('0x3d')],_0x448e46[_0x7dc9('0x3e')],parseInt(_0x448e46[_0x7dc9('0x3f')],0xa)+0x1);_0x448e46[_0x7dc9('0x4c')]();}}function main(){var _0x3819e5;return utilLicense['getLicense']()[_0x7dc9('0x2b')](function(_0x39be46){if(_0x39be46){if(_0x39be46[_0x7dc9('0x4e')]){if(_0x39be46[_0x7dc9('0x4f')]&&_0x39be46[_0x7dc9('0x4f')]>0x0){logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x50'),_0x39be46[_0x7dc9('0x4f')]));_0x3819e5=_0x39be46[_0x7dc9('0x4f')];}else{logger[_0x7dc9('0x10')](_0x7dc9('0x51'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x3819e5=-0x1;}}})['catch'](function(_0x25bdee){logger[_0x7dc9('0xc')](_0x7dc9('0x52'),_0x25bdee[_0x7dc9('0xd')]);})['finally'](function(){var _0x5a6cfe=require(_0x7dc9('0x53'))(config[_0x7dc9('0x5')][_0x7dc9('0xf')],config[_0x7dc9('0x5')]['ip'],_0x3819e5);_0x5a6cfe['on'](_0x7dc9('0xc'),errorHandler);_0x5a6cfe['on'](_0x7dc9('0x54'),listeningHandler);_0x5a6cfe['on'](_0x7dc9('0x55'),connectionHandler);_0x5a6cfe['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x57d4=['variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','production','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','context','extension','priority','response','code','result','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','clear','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]','listening','connection','xml2json','lodash','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','error','stack','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','arg_1','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','mxGraphModel','agicommand','retry','maxRetry','addVertex','hasOwnProperty','isArray','length','source','target','getSquareProject','then','catch','createSquareReport','indexOf','substring','debug'];(function(_0x595288,_0x4664cd){var _0x22b6f3=function(_0x4392c5){while(--_0x4392c5){_0x595288['push'](_0x595288['shift']());}};_0x22b6f3(++_0x4664cd);}(_0x57d4,0x78));var _0x457d=function(_0x32e30d,_0xb2ebfd){_0x32e30d=_0x32e30d-0x0;var _0x17d62c=_0x57d4[_0x32e30d];return _0x17d62c;};'use strict';var parser=require(_0x457d('0x0'));var _=require(_0x457d('0x1'));var syncho=require('syncho');var util=require(_0x457d('0x2'));var moment=require(_0x457d('0x3'));var config=require(_0x457d('0x4'));var logger=require(_0x457d('0x5'))(_0x457d('0x6'));var utilLicense=require(_0x457d('0x7'));var rpc=require(_0x457d('0x8'));var mailRpc=require(_0x457d('0x9'));var Graph=require(_0x457d('0xa'));var Vertices=require(_0x457d('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x457d('0x6')]=_['defaults'](config[_0x457d('0x6')],{'ip':_0x457d('0xc'),'port':0x11dd});function connectionHandler(_0x4e32c0){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4e32c0);agiHandler(_0x4e32c0);}catch(_0x24d8ff){logger[_0x457d('0xd')](_0x24d8ff[_0x457d('0xe')]);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0x457d('0xf')]);logger[_0x457d('0x10')](util[_0x457d('0x11')](_0x457d('0x12'),config[_0x457d('0x6')]['ip'],config[_0x457d('0x6')][_0x457d('0xf')]));}function errorHandler(_0x24cf65){if(_0x24cf65&&_0x24cf65[_0x457d('0x13')]&&_0x24cf65['message']){logger[_0x457d('0xd')](util[_0x457d('0x11')]('[%s]\x20%s',_0x24cf65['name'],_0x24cf65[_0x457d('0x14')]));}else{logger[_0x457d('0xd')](util[_0x457d('0x11')](_0x457d('0x15'),_0x24cf65[_0x457d('0xe')]));}}function closeHandler(){logger[_0x457d('0x10')](util[_0x457d('0x11')](_0x457d('0x16'),this['arg_1'],this[_0x457d('0x17')],this[_0x457d('0x18')],this[_0x457d('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x4919da){logger[_0x457d('0xd')](_0x4919da['stack']);}}function timeoutHandler(){logger[_0x457d('0x10')](util[_0x457d('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x457d('0x1a')],this['calleridname'],this['callerid'],this[_0x457d('0x19')],this[_0x457d('0x1b')]));}function hangupHandler(){logger[_0x457d('0x10')](util[_0x457d('0x11')](_0x457d('0x1c'),this[_0x457d('0x1a')],this[_0x457d('0x17')],this[_0x457d('0x18')],this[_0x457d('0x19')],this[_0x457d('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x4bf90d){return parser['toJson'](_0x4bf90d,{'object':!![]})[_0x457d('0x1d')]['root'];}function addVertex(_0x5177cf,_0x55bcb9,_0x206fdc){_0x55bcb9[_0x457d('0x1e')]=_0x206fdc;if(_0x55bcb9['hasOwnProperty'](_0x457d('0x1f'))){_0x55bcb9[_0x457d('0x20')]=parseInt(_0x55bcb9[_0x457d('0x1f')],0xa);}_0x5177cf[_0x457d('0x21')](_['omit'](_0x55bcb9,'mxCell'));}function initGraph(_0x556a8,_0x47feed){var _0x3d1ca7=new Graph();for(var _0x21a102 in _0x556a8){if(_0x556a8[_0x457d('0x22')](_0x21a102)){if(_[_0x457d('0x23')](_0x556a8[_0x21a102])){for(var _0x54de66=0x0;_0x54de66<_0x556a8[_0x21a102][_0x457d('0x24')];_0x54de66+=0x1){addVertex(_0x3d1ca7,_0x556a8[_0x21a102][_0x54de66],_0x21a102);}}else{addVertex(_0x3d1ca7,_0x556a8[_0x21a102],_0x21a102);}}}for(var _0x57a47f=0x0;_0x57a47f<_0x47feed['length'];_0x57a47f+=0x1){if(_0x47feed[_0x57a47f][_0x457d('0x25')]&&_0x47feed[_0x57a47f][_0x457d('0x26')]){_0x3d1ca7['addEdge'](_0x47feed[_0x57a47f][_0x457d('0x25')],_0x47feed[_0x57a47f][_0x457d('0x26')],_0x47feed[_0x57a47f]['value']);}}return _0x3d1ca7;}function getSquareProject(_0xec380b,_0x41f012){rpc[_0x457d('0x27')](_0xec380b)[_0x457d('0x28')](function(_0x381a9d){_0x41f012(null,_0x381a9d);})[_0x457d('0x29')](function(_0x397f54){_0x41f012(null,_0x397f54);});}function createSquareReport(_0x123b58,_0x272d40){rpc[_0x457d('0x2a')](_0x123b58)[_0x457d('0x28')](function(_0x5782ce){if(_0x272d40){_0x272d40(null,_0x5782ce);}})[_0x457d('0x29')](function(_0x2e0ae2){if(_0x272d40){_0x272d40(null,_0x2e0ae2);}});}function setChannelVariables(_0x1fbe1c){for(var _0x3f905a in _0x1fbe1c){if(_0x1fbe1c[_0x457d('0x22')](_0x3f905a)){if(_0x3f905a[_0x457d('0x2b')]('agi_')===0x0){_0x1fbe1c[_0x3f905a[_0x457d('0x2c')](0x4)]=_0x1fbe1c[_0x3f905a];delete _0x1fbe1c[_0x3f905a];}}}}function getLogFromObject(_0x7a995b){return util['inspect'](_0x7a995b,{'showHidden':![],'depth':null});}function agiHandler(_0x47b7e8){var _0x17d000,_0xa1d4f4,_0x5b4622,_0x306ece,_0x271478;logger[_0x457d('0x2d')](_0x457d('0x2e'),JSON[_0x457d('0x2f')](_0x47b7e8,null,0x2));logger[_0x457d('0x10')](util[_0x457d('0x11')](_0x457d('0x30'),_0x47b7e8[_0x457d('0x1a')],_0x47b7e8[_0x457d('0x17')],_0x47b7e8[_0x457d('0x18')],_0x47b7e8[_0x457d('0x19')],_0x47b7e8[_0x457d('0x1b')]));_0x47b7e8['on'](_0x457d('0xd'),errorHandler);_0x47b7e8['on'](_0x457d('0x31'),closeHandler);_0x47b7e8['on']('timeout',timeoutHandler);_0x47b7e8[_0x457d('0x32')]=![];_0x47b7e8['on']('hangup',hangupHandler);var _0x5a3db2=getSquareProject['sync'](null,_0x47b7e8[_0x457d('0x1a')]);if(_0x5a3db2){if(_0x5a3db2['production']){_0x17d000=getRoot(_0x5a3db2[_0x457d('0x33')]);if(_0x17d000&&_0x17d000['start']){logger['debug'](_0x457d('0x34'),JSON[_0x457d('0x2f')](_0x17d000,null,0x2));_0x47b7e8[_0x457d('0x35')]=moment()[_0x457d('0x11')](_0x457d('0x36'));_0xa1d4f4=initGraph(_[_0x457d('0x37')](_0x17d000,_0x457d('0x38')),_0x17d000[_0x457d('0x38')]);_0x5b4622=new Vertices(_0x47b7e8,rpc,mailRpc);logger[_0x457d('0x10')](util[_0x457d('0x11')](_0x457d('0x39'),_0x47b7e8[_0x457d('0x1a')],_0x47b7e8[_0x457d('0x17')],_0x47b7e8[_0x457d('0x18')],_0x47b7e8[_0x457d('0x19')],_0x47b7e8[_0x457d('0x1b')]));_0xa1d4f4[_0x457d('0x3a')](_0x17d000['start']['id'],function(_0x35d2e1){try{_0x35d2e1=_0x5b4622['clear'](_0x35d2e1);logger[_0x457d('0x2d')](_0x457d('0x3b'),JSON[_0x457d('0x2f')](_0x35d2e1,null,0x2));if(_0x35d2e1[_0x457d('0x1e')]===_0x457d('0x3c')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x47b7e8[_0x457d('0x3d')]=_0x35d2e1['context']||_0x47b7e8[_0x457d('0x3d')];_0x47b7e8[_0x457d('0x3e')]=_0x35d2e1[_0x457d('0x3e')];_0x47b7e8['priority']=_0x35d2e1[_0x457d('0x3f')]?_0x35d2e1[_0x457d('0x3f')]-0x1:0x1;return null;}else if(_0x35d2e1&&_0x5b4622[_0x35d2e1[_0x457d('0x1e')]]){_0x271478=_0x5b4622[_0x35d2e1[_0x457d('0x1e')]](_0x35d2e1);logger[_0x457d('0x10')](_0x457d('0x40'),JSON[_0x457d('0x2f')](_0x271478,null,0x2));if(_0x271478&&_0x271478[_0x457d('0x41')]===AGI_CODE_SUCCESS&&_0x271478[_0x457d('0x42')]!==AGI_RESULT_ERROR&&!_0x47b7e8['evtHangup']){logger['debug'](_0x457d('0x40'),getLogFromObject(_0x271478));return _[_0x457d('0x43')](_0x271478[_0x457d('0x42')])?null:_0x271478[_0x457d('0x42')][_0x457d('0x44')]();}else{logger[_0x457d('0xd')]('response',getLogFromObject(_0x271478));return null;}}else{logger[_0x457d('0xd')](_0x457d('0x45'));return null;}}catch(_0x13f840){logger['error'](_0x13f840[_0x457d('0xe')]);return null;}});if(_0x17d000[_0x457d('0x46')]){logger[_0x457d('0x10')](util['format'](_0x457d('0x47'),_0x47b7e8[_0x457d('0x1a')],_0x47b7e8[_0x457d('0x17')],_0x47b7e8[_0x457d('0x18')],_0x47b7e8['dnid'],_0x47b7e8[_0x457d('0x1b')]));_0xa1d4f4[_0x457d('0x3a')](_0x17d000[_0x457d('0x46')]['id'],function(_0x24980f){try{_0x24980f=_0x5b4622[_0x457d('0x48')](_0x24980f);logger[_0x457d('0x2d')](_0x457d('0x3b'),JSON[_0x457d('0x2f')](_0x24980f,null,0x2));if(_0x24980f&&_0x5b4622[_0x24980f[_0x457d('0x1e')]]){_0x271478=_0x5b4622[_0x24980f[_0x457d('0x1e')]](_0x24980f);if(_0x271478){logger['debug'](_0x457d('0x40'),getLogFromObject(_0x271478));return _[_0x457d('0x43')](_0x271478[_0x457d('0x42')])?null:_0x271478[_0x457d('0x42')]['toString']();}else{logger[_0x457d('0xd')](_0x457d('0x40'),getLogFromObject(_0x271478));return null;}}else{logger[_0x457d('0xd')](_0x457d('0x45'));return null;}}catch(_0x3f10a8){logger[_0x457d('0xd')](_0x3f10a8[_0x457d('0xe')]);return null;}});}logger[_0x457d('0x10')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x47b7e8[_0x457d('0x1a')],_0x47b7e8[_0x457d('0x17')],_0x47b7e8[_0x457d('0x18')],_0x47b7e8[_0x457d('0x19')],_0x47b7e8[_0x457d('0x1b')]));logger[_0x457d('0x10')](util[_0x457d('0x11')](_0x457d('0x49'),_0x47b7e8[_0x457d('0x3d')],_0x47b7e8[_0x457d('0x3e')],parseInt(_0x47b7e8[_0x457d('0x3f')],0xa)+0x1));_0x47b7e8[_0x457d('0x4a')](_0x47b7e8[_0x457d('0x3d')],_0x47b7e8[_0x457d('0x3e')],parseInt(_0x47b7e8['priority'],0xa)+0x1);_0x47b7e8[_0x457d('0x31')]();}}else{logger[_0x457d('0xd')](util[_0x457d('0x11')](_0x457d('0x4b'),_0x47b7e8['arg_1']));_0x47b7e8[_0x457d('0x4a')](_0x47b7e8[_0x457d('0x3d')],_0x47b7e8['extension'],parseInt(_0x47b7e8[_0x457d('0x3f')],0xa)+0x1);_0x47b7e8[_0x457d('0x31')]();}}else{logger[_0x457d('0xd')](util['format']('Project\x20%s\x20not\x20found',_0x47b7e8[_0x457d('0x1a')]));_0x47b7e8['continueAt'](_0x47b7e8[_0x457d('0x3d')],_0x47b7e8[_0x457d('0x3e')],parseInt(_0x47b7e8[_0x457d('0x3f')],0xa)+0x1);_0x47b7e8[_0x457d('0x31')]();}}function main(){var _0x2f79d8;return utilLicense[_0x457d('0x4c')]()[_0x457d('0x28')](function(_0x376676){if(_0x376676){if(_0x376676[_0x457d('0x4d')]){if(_0x376676[_0x457d('0x4e')]&&_0x376676[_0x457d('0x4e')]>0x0){logger[_0x457d('0x10')](util[_0x457d('0x11')](_0x457d('0x4f'),_0x376676['callysquare']));_0x2f79d8=_0x376676[_0x457d('0x4e')];}else{logger[_0x457d('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x457d('0x10')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x2f79d8=-0x1;}}})[_0x457d('0x29')](function(_0x1bec33){logger['error'](_0x457d('0x50'),_0x1bec33[_0x457d('0xe')]);})[_0x457d('0x46')](function(){var _0x56de45=require('./server')(config[_0x457d('0x6')]['port'],config[_0x457d('0x6')]['ip'],_0x2f79d8);_0x56de45['on']('error',errorHandler);_0x56de45['on'](_0x457d('0x51'),listeningHandler);_0x56de45['on'](_0x457d('0x52'),connectionHandler);_0x56de45['on']('close',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 95ddc50..0df3c5d 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(_0x1e4b4a,_0xb3a6ad){var _0x3fafe3=function(_0x5a9e96){while(--_0x5a9e96){_0x1e4b4a['push'](_0x1e4b4a['shift']());}};_0x3fafe3(++_0xb3a6ad);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x33305e,_0x3ef3fc){var _0x218201=function(_0x2216bd){while(--_0x2216bd){_0x33305e['push'](_0x33305e['shift']());}};_0x218201(++_0x3ef3fc);}(_0x34e8,0x12c));var _0x834e=function(_0xae3b5c,_0x4cef53){_0xae3b5c=_0xae3b5c-0x0;var _0x59bc3f=_0x34e8[_0xae3b5c];return _0x59bc3f;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 56ab27f..97a4565 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(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0xb10b,0x12a));var _0xbb10=function(_0x52de48,_0x5bc748){_0x52de48=_0x52de48-0x0;var _0x18f4c0=_0xb10b[_0x52de48];return _0x18f4c0;};'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(_0x2389bc,_0x167cd2){var _0x170548=function(_0x2da7f2){while(--_0x2da7f2){_0x2389bc['push'](_0x2389bc['shift']());}};_0x170548(++_0x167cd2);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f1172,_0x5f5b26){_0x2f1172=_0x2f1172-0x0;var _0x58e374=_0xb10b[_0x2f1172];return _0x58e374;};'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 f3a5a98..0a51c86 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 _0x5454=['agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','util','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','getPauseById','ShowPause','agentLogin','LoginUser'];(function(_0x3bb255,_0x5f3a2b){var _0x108560=function(_0x4588aa){while(--_0x4588aa){_0x3bb255['push'](_0x3bb255['shift']());}};_0x108560(++_0x5f3a2b);}(_0x5454,0x15b));var _0x4545=function(_0x428569,_0x5439a7){_0x428569=_0x428569-0x0;var _0x5296c0=_0x5454[_0x428569];return _0x5296c0;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require(_0x4545('0x0'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x2329});function request(_0x1635b9,_0x32f284){return new BPromise(function(_0x1740a8,_0x37ede9){return client['request'](_0x1635b9,_0x32f284)[_0x4545('0x1')](function(_0xececc1){if(_0xececc1[_0x4545('0x2')]){return _0x37ede9(_0xececc1[_0x4545('0x2')][_0x4545('0x3')]);}else{return _0x1740a8(_0xececc1[_0x4545('0x4')]);}})[_0x4545('0x5')](function(_0x1e5cac){return _0x37ede9(_0x1e5cac);});});}exports[_0x4545('0x6')]=function(_0x3e2526){return request(_0x4545('0x7'),{'options':{'raw':![],'where':{'name':_0x3e2526},'attributes':[_0x4545('0x8')]}});};exports[_0x4545('0x9')]=function(_0x491b7b){return request(_0x4545('0xa'),{'options':{'raw':![],'where':{'id':_0x491b7b},'include':[{'model':_0x4545('0xb'),'as':_0x4545('0xc')}],'attributes':['id',_0x4545('0xd'),_0x4545('0xe')]}});};exports[_0x4545('0xf')]=function(_0x4d414c){return request(_0x4545('0x7'),{'options':{'where':{'id':_0x4d414c},'attributes':[_0x4545('0xd')]}});};exports[_0x4545('0x10')]=function(_0x1820cd){return request(_0x4545('0x11'),{'options':{'where':{'id':_0x1820cd},'attributes':[_0x4545('0xd')]}});};exports[_0x4545('0x12')]=function(_0x347072){return request(_0x4545('0x13'),{'options':{'where':{'id':_0x347072},'attributes':[_0x4545('0xd')]}});};exports[_0x4545('0x14')]=function(_0x4b5700){return request(_0x4545('0x15'),{'options':{'where':{'id':_0x4b5700},'attributes':[_0x4545('0x16')]}});};exports[_0x4545('0x17')]=function(_0x3bb165){return request('ShowUser',{'options':{'where':{'id':_0x3bb165},'attributes':['name']}});};exports[_0x4545('0x18')]=function(_0x29effa){return request(_0x4545('0x19'),{'options':{'where':{'id':_0x29effa},'attributes':[_0x4545('0xd')]}});};exports[_0x4545('0x1a')]=function(_0x33393b){return request(_0x4545('0x1b'),{'options':{'where':{'id':_0x33393b},'attributes':[_0x4545('0x1c')]}});};exports['getIntervalById']=function(_0x52a21c){return request(_0x4545('0x1d'),{'options':{'raw':![],'where':{'id':_0x52a21c},'include':[{'model':'Interval','as':_0x4545('0x1e')}]}});};exports[_0x4545('0x1f')]=function(_0x67e408){return request(_0x4545('0x20'),{'options':{'where':{'id':_0x67e408},'attributes':['id',_0x4545('0xd')]}});};exports[_0x4545('0x21')]=function(_0x1a4f5a){return request(_0x4545('0x22'),{'body':_0x1a4f5a});};exports['createSquareDetailsReport']=function(_0x580b57){return request(_0x4545('0x23'),{'body':_0x580b57});};exports['createSquareReport']=function(_0x3380e4){return request('CreateSquareReport',{'body':_[_0x4545('0x24')](_0x3380e4,{'project_name':_0x3380e4['arg_1'],'prev_project_name':_0x3380e4['arg_2']||'','is_subproject':_0x3380e4[_0x4545('0x25')]?!![]:![],'leaveAt':moment()[_0x4545('0x26')](_0x4545('0x27'))})});};exports[_0x4545('0x28')]=function(_0x344633){return request(_0x4545('0x29'),{'body':_0x344633});};exports[_0x4545('0x2a')]=function(_0x889814){return request(_0x4545('0x2b'),{'body':_0x889814});};exports[_0x4545('0x2c')]=function(_0x3e5807){return request(_0x4545('0x2d'),{'options':{'raw':![],'where':{'phone':_0x3e5807[_0x4545('0x2e')],'ListId':_0x3e5807[_0x4545('0x2f')]}}})[_0x4545('0x1')](function(_0xfd9247){if(_0xfd9247){return _0xfd9247;}return request('CreateCmContact',{'body':_0x3e5807});});};exports[_0x4545('0x30')]=function(_0x2c256b){return request(_0x4545('0x31'),{'options':{'where':{'id':_0x2c256b},'attributes':[_0x4545('0xd')]}});};exports[_0x4545('0x32')]=function(_0x531250,_0x157fe5){return request(_0x4545('0x33'),{'body':{'interface':_0x157fe5},'options':{'where':_0x531250}});};exports[_0x4545('0x34')]=function(_0x247762,_0x1da2a9,_0x27b7d7){return request('PauseUser',{'body':{'type':_0x1da2a9,'uniqueid':_0x27b7d7},'options':{'where':_0x247762}});};exports[_0x4545('0x35')]=function(_0x80b55f){return request(_0x4545('0x36'),{'body':{},'options':{'where':_0x80b55f}});};exports[_0x4545('0x37')]=function(_0x2f532f){return request(_0x4545('0x38'),{'body':{},'options':{'where':_0x2f532f}});}; \ No newline at end of file +var _0x48fa=['createCmContact','ShowCmHopper','phone','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','then','error','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','getTrunkById','ShowTrunk','getSoundById','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage'];(function(_0x1473d3,_0x38bd39){var _0x185f8e=function(_0x138f32){while(--_0x138f32){_0x1473d3['push'](_0x1473d3['shift']());}};_0x185f8e(++_0x38bd39);}(_0x48fa,0x127));var _0xa48f=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x48fa[_0x1cb18a];return _0x22442e;};'use strict';var BPromise=require(_0xa48f('0x0'));var moment=require(_0xa48f('0x1'));var _=require(_0xa48f('0x2'));var util=require(_0xa48f('0x3'));var jayson=require(_0xa48f('0x4'));var client=jayson['client']['http']({'port':0x2329});function request(_0x590c63,_0x276a18){return new BPromise(function(_0x35c214,_0xe05a33){return client['request'](_0x590c63,_0x276a18)[_0xa48f('0x5')](function(_0x2e0799){if(_0x2e0799[_0xa48f('0x6')]){return _0xe05a33(_0x2e0799['error']['message']);}else{return _0x35c214(_0x2e0799[_0xa48f('0x7')]);}})[_0xa48f('0x8')](function(_0x5778b7){return _0xe05a33(_0x5778b7);});});}exports[_0xa48f('0x9')]=function(_0x2d28d1){return request(_0xa48f('0xa'),{'options':{'raw':![],'where':{'name':_0x2d28d1},'attributes':[_0xa48f('0xb')]}});};exports[_0xa48f('0xc')]=function(_0x4a28ec){return request(_0xa48f('0xd'),{'options':{'raw':![],'where':{'id':_0x4a28ec},'include':[{'model':_0xa48f('0xe'),'as':_0xa48f('0xf')}],'attributes':['id','name','email']}});};exports[_0xa48f('0x10')]=function(_0x1fa6ec){return request(_0xa48f('0xa'),{'options':{'where':{'id':_0x1fa6ec},'attributes':[_0xa48f('0x11')]}});};exports[_0xa48f('0x12')]=function(_0x1389a0){return request(_0xa48f('0x13'),{'options':{'where':{'id':_0x1389a0},'attributes':[_0xa48f('0x11')]}});};exports[_0xa48f('0x14')]=function(_0x58c52f){return request(_0xa48f('0x15'),{'options':{'where':{'id':_0x58c52f},'attributes':[_0xa48f('0x11')]}});};exports[_0xa48f('0x16')]=function(_0x49e7a8){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x49e7a8},'attributes':[_0xa48f('0x17')]}});};exports[_0xa48f('0x18')]=function(_0x322d47){return request('ShowUser',{'options':{'where':{'id':_0x322d47},'attributes':[_0xa48f('0x11')]}});};exports[_0xa48f('0x19')]=function(_0x25595d){return request(_0xa48f('0x1a'),{'options':{'where':{'id':_0x25595d},'attributes':['name']}});};exports[_0xa48f('0x1b')]=function(_0x173ed2){return request('ShowSound',{'options':{'where':{'id':_0x173ed2},'attributes':['save_name']}});};exports[_0xa48f('0x1c')]=function(_0x1a2ae5){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1a2ae5},'include':[{'model':_0xa48f('0x1d'),'as':_0xa48f('0x1e')}]}});};exports[_0xa48f('0x1f')]=function(_0x2e5626){return request(_0xa48f('0x20'),{'options':{'where':{'id':_0x2e5626},'attributes':['id',_0xa48f('0x11')]}});};exports[_0xa48f('0x21')]=function(_0x54df04){return request(_0xa48f('0x22'),{'body':_0x54df04});};exports[_0xa48f('0x23')]=function(_0x21743c){return request('CreateSquareDetailsReport',{'body':_0x21743c});};exports[_0xa48f('0x24')]=function(_0x1ee16e){return request(_0xa48f('0x25'),{'body':_[_0xa48f('0x26')](_0x1ee16e,{'project_name':_0x1ee16e[_0xa48f('0x27')],'prev_project_name':_0x1ee16e[_0xa48f('0x28')]||'','is_subproject':_0x1ee16e[_0xa48f('0x28')]?!![]:![],'leaveAt':moment()[_0xa48f('0x29')](_0xa48f('0x2a'))})});};exports[_0xa48f('0x2b')]=function(_0x914590){return request(_0xa48f('0x2c'),{'body':_0x914590});};exports[_0xa48f('0x2d')]=function(_0x2012d9){return request(_0xa48f('0x2e'),{'body':_0x2012d9});};exports[_0xa48f('0x2f')]=function(_0x5e3632){return request(_0xa48f('0x30'),{'options':{'raw':![],'where':{'phone':_0x5e3632[_0xa48f('0x31')],'ListId':_0x5e3632['ListId']}}})[_0xa48f('0x5')](function(_0x33310b){if(_0x33310b){return _0x33310b;}return request('CreateCmContact',{'body':_0x5e3632});});};exports[_0xa48f('0x32')]=function(_0x3377ff){return request('ShowPause',{'options':{'where':{'id':_0x3377ff},'attributes':[_0xa48f('0x11')]}});};exports[_0xa48f('0x33')]=function(_0x45f5c4,_0x561671){return request(_0xa48f('0x34'),{'body':{'interface':_0x561671},'options':{'where':_0x45f5c4}});};exports[_0xa48f('0x35')]=function(_0x506e31,_0x5be2bb,_0x578735){return request(_0xa48f('0x36'),{'body':{'type':_0x5be2bb,'uniqueid':_0x578735},'options':{'where':_0x506e31}});};exports['agentUnpause']=function(_0x1ee9ba){return request(_0xa48f('0x37'),{'body':{},'options':{'where':_0x1ee9ba}});};exports['agentLogout']=function(_0x506a7d){return request(_0xa48f('0x38'),{'body':{},'options':{'where':_0x506a7d}});}; \ 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 9727107..1e1326a 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 _0xda55=['./lex','./polly'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xda55,0x6d));var _0x5da5=function(_0x36ef57,_0x36156e){_0x36ef57=_0x36ef57-0x0;var _0x69397f=_0xda55[_0x36ef57];return _0x69397f;};var polly=require(_0x5da5('0x0'));var lex=require(_0x5da5('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xb43b=['./polly','./lex'];(function(_0x505f73,_0x1f95d8){var _0x227e7f=function(_0x112ae8){while(--_0x112ae8){_0x505f73['push'](_0x505f73['shift']());}};_0x227e7f(++_0x1f95d8);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4a6b3e,_0x6f7e5c){_0x4a6b3e=_0x4a6b3e-0x0;var _0x4cdf84=_0xb43b[_0x4a6b3e];return _0x4cdf84;};var polly=require(_0xbb43('0x0'));var lex=require(_0xbb43('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 06c3066..0e6db9d 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 _0xd691=['./lib/api','exports'];(function(_0x19ad7b,_0x2ae8fa){var _0x8a0f00=function(_0x56781d){while(--_0x56781d){_0x19ad7b['push'](_0x19ad7b['shift']());}};_0x8a0f00(++_0x2ae8fa);}(_0xd691,0xe6));var _0x1d69=function(_0x510347,_0xdf770a){_0x510347=_0x510347-0x0;var _0x5cb84f=_0xd691[_0x510347];return _0x5cb84f;};'use strict';var lex=require(_0x1d69('0x0'));module[_0x1d69('0x1')]=function(_0x4738f2,_0x5ea40d,_0x468419,_0x44899f,_0x32502d,_0x3dc1c9){return lex(_0x4738f2,_0x5ea40d,_0x468419,_0x44899f,_0x32502d,_0x3dc1c9);}; \ No newline at end of file +var _0xd52a=['exports'];(function(_0x2fe5b9,_0x127e48){var _0x6f874=function(_0x23f8e7){while(--_0x23f8e7){_0x2fe5b9['push'](_0x2fe5b9['shift']());}};_0x6f874(++_0x127e48);}(_0xd52a,0xca));var _0xad52=function(_0x5d29ef,_0x3f94b0){_0x5d29ef=_0x5d29ef-0x0;var _0x1f4c3a=_0xd52a[_0x5d29ef];return _0x1f4c3a;};'use strict';var lex=require('./lib/api');module[_0xad52('0x0')]=function(_0x5e6aa7,_0x14c488,_0x7b9789,_0x30b335,_0x572592,_0x3f4207){return lex(_0x5e6aa7,_0x14c488,_0x7b9789,_0x30b335,_0x572592,_0x3f4207);}; \ 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 68d638f..ab3d14b 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 _0xda56=['postText','slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST'];(function(_0x11c4fa,_0x3d68f0){var _0x12e9aa=function(_0x417aa1){while(--_0x417aa1){_0x11c4fa['push'](_0x11c4fa['shift']());}};_0x12e9aa(++_0x3d68f0);}(_0xda56,0x19d));var _0x6da5=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0xda56[_0x4df6f9];return _0x4b1a73;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x1f3c00,_0x1ae8cb){return new BPromise(function(_0x5ea0d9,_0x1fa6d4){_0x1f3c00[_0x6da5('0x0')](_0x1ae8cb,function(_0x5ce00c,_0x241e8d){if(_0x5ce00c){_0x1fa6d4(_0x5ce00c);}if(_0x241e8d[_0x6da5('0x1')]){for(const _0x5402d6 in _0x241e8d[_0x6da5('0x1')]){if(_0x241e8d[_0x6da5('0x1')][_0x6da5('0x2')](_0x5402d6)){var _0x5e47d0=_0x241e8d[_0x6da5('0x1')][_0x5402d6];_0x241e8d[_0x6da5('0x3')+_0x5402d6]=_0x5e47d0;}}}_0x5ea0d9(_0x241e8d);});});}module[_0x6da5('0x4')]=function(_0x16ccbd,_0x1d657c,_0x526307,_0x419475,_0x949093,_0x2cdddd){var _0x1bd002=new AWS[(_0x6da5('0x5'))]({'accessKeyId':_0x1d657c,'secretAccessKey':_0x526307,'region':_0x419475});var _0x49df10={'botAlias':_0x6da5('0x6'),'botName':_0x2cdddd,'inputText':_0x949093,'userId':_0x16ccbd};return lexResult(_0x1bd002,_0x49df10);}; \ No newline at end of file +var _0xb252=['LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_'];(function(_0x105aaa,_0x358e95){var _0xe4b1fa=function(_0x52b5aa){while(--_0x52b5aa){_0x105aaa['push'](_0x105aaa['shift']());}};_0xe4b1fa(++_0x358e95);}(_0xb252,0x14a));var _0x2b25=function(_0x3f7e42,_0x45bf3d){_0x3f7e42=_0x3f7e42-0x0;var _0x5e2121=_0xb252[_0x3f7e42];return _0x5e2121;};'use strict';var BPromise=require(_0x2b25('0x0'));var AWS=require(_0x2b25('0x1'));function lexResult(_0x577fe0,_0x119e19){return new BPromise(function(_0xb0fe1d,_0x179322){_0x577fe0[_0x2b25('0x2')](_0x119e19,function(_0x4b844a,_0x137e8d){if(_0x4b844a){_0x179322(_0x4b844a);}if(_0x137e8d[_0x2b25('0x3')]){for(const _0x3aadfa in _0x137e8d[_0x2b25('0x3')]){if(_0x137e8d[_0x2b25('0x3')][_0x2b25('0x4')](_0x3aadfa)){var _0x4b0519=_0x137e8d['slots'][_0x3aadfa];_0x137e8d[_0x2b25('0x5')+_0x3aadfa]=_0x4b0519;}}}_0xb0fe1d(_0x137e8d);});});}module['exports']=function(_0x4260ea,_0x210b19,_0x22eca9,_0x34eaa0,_0x32dbd1,_0x3e085e){var _0x3f9694=new AWS[(_0x2b25('0x6'))]({'accessKeyId':_0x210b19,'secretAccessKey':_0x22eca9,'region':_0x34eaa0});var _0x47d374={'botAlias':_0x2b25('0x7'),'botName':_0x3e085e,'inputText':_0x32dbd1,'userId':_0x4260ea};return lexResult(_0x3f9694,_0x47d374);}; \ 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 35059aa..dd66c1b 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 _0xebc6=['./lib/api','exports'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xebc6,0x156));var _0x6ebc=function(_0x5a7d7c,_0x9ae68a){_0x5a7d7c=_0x5a7d7c-0x0;var _0x239238=_0xebc6[_0x5a7d7c];return _0x239238;};'use strict';var polly=require(_0x6ebc('0x0'));module[_0x6ebc('0x1')]=function(_0x1303ee,_0x4bfe18,_0x3e1e10,_0x32ae1b,_0x5871cd,_0x48aabb,_0xb945fe){return polly(_0x1303ee,_0x4bfe18,_0x3e1e10,_0x32ae1b,_0x5871cd,_0x48aabb,_0xb945fe);}; \ No newline at end of file +var _0xe622=['exports','./lib/api'];(function(_0x25923f,_0x544939){var _0x348e90=function(_0x1e2986){while(--_0x1e2986){_0x25923f['push'](_0x25923f['shift']());}};_0x348e90(++_0x544939);}(_0xe622,0x13f));var _0x2e62=function(_0x1702cd,_0x28cc33){_0x1702cd=_0x1702cd-0x0;var _0x47eb87=_0xe622[_0x1702cd];return _0x47eb87;};'use strict';var polly=require(_0x2e62('0x0'));module[_0x2e62('0x1')]=function(_0x1c2ea8,_0xa7192e,_0x1ef3da,_0x2f9dad,_0x56ec79,_0xef400e,_0x247282){return polly(_0x1c2ea8,_0xa7192e,_0x1ef3da,_0x2f9dad,_0x56ec79,_0xef400e,_0x247282);}; \ 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 bef697b..abffe85 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 _0x3495=['aws-sdk','synthesizeSpeech','AudioStream','writeFile','Polly','text','mp3','path','bluebird','randomstring'];(function(_0x490a46,_0x4e58ab){var _0x43598f=function(_0x5b9292){while(--_0x5b9292){_0x490a46['push'](_0x490a46['shift']());}};_0x43598f(++_0x4e58ab);}(_0x3495,0x1b5));var _0x5349=function(_0x334036,_0x135139){_0x334036=_0x334036-0x0;var _0xc7974f=_0x3495[_0x334036];return _0xc7974f;};'use strict';var fs=require('fs');var path=require(_0x5349('0x0'));var BPromise=require(_0x5349('0x1'));var rs=require(_0x5349('0x2'));var AWS=require(_0x5349('0x3'));function pollyResult(_0x4738b7,_0x4e908c,_0x5042c8){return new BPromise(function(_0x18a879,_0x183ef0){_0x4738b7[_0x5349('0x4')](_0x4e908c,function(_0x3994e7,_0x362cb9){if(_0x3994e7){_0x183ef0(_0x3994e7);}else if(_0x362cb9){if(_0x362cb9[_0x5349('0x5')]instanceof Buffer){fs[_0x5349('0x6')](_0x5042c8,_0x362cb9[_0x5349('0x5')],function(_0x147ebc){if(_0x147ebc){_0x183ef0(_0x147ebc);}else{_0x18a879();}});}else{_0x183ef0(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x183ef0(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x590f00,_0x544f0e,_0x2c7158,_0x560794,_0x3cfed4,_0x5a11a6,_0x335269){var _0xdf7942=new AWS[(_0x5349('0x7'))]({'accessKeyId':_0x590f00,'secretAccessKey':_0x544f0e,'region':_0x2c7158});var _0x3a98b0={'Text':_0x3cfed4,'TextType':_0x5a11a6||_0x5349('0x8'),'OutputFormat':_0x5349('0x9'),'VoiceId':_0x560794};return pollyResult(_0xdf7942,_0x3a98b0,_0x335269);}; \ No newline at end of file +var _0x0fd7=['synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','bluebird','randomstring','aws-sdk'];(function(_0x3d7b48,_0x4e0edd){var _0x34a715=function(_0x1c5f42){while(--_0x1c5f42){_0x3d7b48['push'](_0x3d7b48['shift']());}};_0x34a715(++_0x4e0edd);}(_0x0fd7,0x172));var _0x70fd=function(_0x58290b,_0x552f4a){_0x58290b=_0x58290b-0x0;var _0x59db80=_0x0fd7[_0x58290b];return _0x59db80;};'use strict';var fs=require('fs');var path=require(_0x70fd('0x0'));var BPromise=require(_0x70fd('0x1'));var rs=require(_0x70fd('0x2'));var AWS=require(_0x70fd('0x3'));function pollyResult(_0x453d76,_0x135807,_0x1487c4){return new BPromise(function(_0xce3e59,_0xfbe51a){_0x453d76[_0x70fd('0x4')](_0x135807,function(_0xb410cf,_0x1a59ad){if(_0xb410cf){_0xfbe51a(_0xb410cf);}else if(_0x1a59ad){if(_0x1a59ad[_0x70fd('0x5')]instanceof Buffer){fs[_0x70fd('0x6')](_0x1487c4,_0x1a59ad[_0x70fd('0x5')],function(_0x4e4a8f){if(_0x4e4a8f){_0xfbe51a(_0x4e4a8f);}else{_0xce3e59();}});}else{_0xfbe51a(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0xfbe51a(new Error(_0x70fd('0x7')));}});});}module[_0x70fd('0x8')]=function(_0x482172,_0x51edc6,_0x3d1189,_0x30d243,_0x493d76,_0x1b9abb,_0x3c1610){var _0x5857a6=new AWS[(_0x70fd('0x9'))]({'accessKeyId':_0x482172,'secretAccessKey':_0x51edc6,'region':_0x3d1189});var _0x1d3e15={'Text':_0x493d76,'TextType':_0x1b9abb||_0x70fd('0xa'),'OutputFormat':'mp3','VoiceId':_0x30d243};return pollyResult(_0x5857a6,_0x1d3e15,_0x3c1610);}; \ 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 339bd75..6dcc42b 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cee=['exports','./lib/api'];(function(_0x3dee92,_0x55e1eb){var _0x44d36e=function(_0x34de1a){while(--_0x34de1a){_0x3dee92['push'](_0x3dee92['shift']());}};_0x44d36e(++_0x55e1eb);}(_0x5cee,0x1b3));var _0xe5ce=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x5cee[_0x11005e];return _0x29338f;};'use strict';var asr=require(_0xe5ce('0x0'));module[_0xe5ce('0x1')]=function(_0x45cde6,_0x1c064a,_0x2b7b34,_0x5d4204){return asr(_0x45cde6,_0x1c064a,_0x2b7b34);}; \ No newline at end of file +var _0x9392=['exports','./lib/api'];(function(_0x17da09,_0x1ecf8e){var _0x3b3329=function(_0x106216){while(--_0x106216){_0x17da09['push'](_0x17da09['shift']());}};_0x3b3329(++_0x1ecf8e);}(_0x9392,0xa7));var _0x2939=function(_0x5c5ddc,_0x2bd2a2){_0x5c5ddc=_0x5c5ddc-0x0;var _0xd3dbb3=_0x9392[_0x5c5ddc];return _0xd3dbb3;};'use strict';var asr=require(_0x2939('0x0'));module[_0x2939('0x1')]=function(_0x362ee1,_0x2b7944,_0x2bda8e,_0x241e51){return asr(_0x362ee1,_0x2b7944,_0x2bda8e);}; \ 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 af48628..4964931 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 _0x6da4=['length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','string','filepath\x20should\x20be\x20a\x20string'];(function(_0x221966,_0x4d0e72){var _0x4a414e=function(_0x567000){while(--_0x567000){_0x221966['push'](_0x221966['shift']());}};_0x4a414e(++_0x4d0e72);}(_0x6da4,0xaf));var _0x46da=function(_0x4b99c2,_0x56ad9a){_0x4b99c2=_0x4b99c2-0x0;var _0xc8c211=_0x6da4[_0x4b99c2];return _0xc8c211;};'use strict';var url=require(_0x46da('0x0'));var BPromise=require(_0x46da('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x46da('0x2')]=function(_0xb1aa95,_0x1c6c71,_0x53197c){return new BPromise(function(_0x5476b7,_0x3e1481){var _0x54dc4d;if(typeof _0xb1aa95!==_0x46da('0x3')||_0xb1aa95['length']===0x0){return _0x3e1481(_0x46da('0x4'));}if(typeof _0x1c6c71!==_0x46da('0x3')||_0x1c6c71[_0x46da('0x5')]===0x0){return _0x3e1481(_0x46da('0x6'));}if(typeof _0x53197c!==_0x46da('0x7')&&(typeof _0x53197c!==_0x46da('0x3')||_0x53197c[_0x46da('0x5')]===0x0)){return _0x3e1481(_0x46da('0x8'));}try{_0x54dc4d=fs[_0x46da('0x9')](_0xb1aa95)['toString'](_0x46da('0xa'));}catch(_0x34a5f4){return _0x3e1481(_0x34a5f4);}return _0x5476b7({'method':_0x46da('0xb'),'uri':host+_0x46da('0xc')+_0x1c6c71,'body':{'config':{'encoding':_0x46da('0xd'),'sampleRateHertz':_0x46da('0xe'),'languageCode':_0x53197c},'audio':{'content':_0x54dc4d}},'json':!![]});});}; \ No newline at end of file +var _0x53fd=['lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','bluebird','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','undefined'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x53fd,0xe0));var _0xd53f=function(_0x8f2d8e,_0x3e1e14){_0x8f2d8e=_0x8f2d8e-0x0;var _0x4dd64d=_0x53fd[_0x8f2d8e];return _0x4dd64d;};'use strict';var url=require('url');var BPromise=require(_0xd53f('0x0'));var fs=require('fs');var host=_0xd53f('0x1');module[_0xd53f('0x2')]=function(_0x2ce46e,_0xa459a0,_0x250ea3){return new BPromise(function(_0x31989c,_0x3562a0){var _0x5de4d8;if(typeof _0x2ce46e!==_0xd53f('0x3')||_0x2ce46e['length']===0x0){return _0x3562a0('filepath\x20should\x20be\x20a\x20string');}if(typeof _0xa459a0!==_0xd53f('0x3')||_0xa459a0[_0xd53f('0x4')]===0x0){return _0x3562a0(_0xd53f('0x5'));}if(typeof _0x250ea3!==_0xd53f('0x6')&&(typeof _0x250ea3!==_0xd53f('0x3')||_0x250ea3['length']===0x0)){return _0x3562a0(_0xd53f('0x7'));}try{_0x5de4d8=fs[_0xd53f('0x8')](_0x2ce46e)[_0xd53f('0x9')]('base64');}catch(_0xbda983){return _0x3562a0(_0xbda983);}return _0x31989c({'method':_0xd53f('0xa'),'uri':host+'/v1/speech:recognize?key='+_0xa459a0,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x250ea3},'audio':{'content':_0x5de4d8}},'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 59fe924..7f58c11 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 _0x333a=['./asr','exports'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x333a,0xe0));var _0xa333=function(_0x52e330,_0x5e845f){_0x52e330=_0x52e330-0x0;var _0x270b50=_0x333a[_0x52e330];return _0x270b50;};var asr=require(_0xa333('0x0'));module[_0xa333('0x1')]={'asr':asr}; \ No newline at end of file +var _0x76d0=['./asr','exports'];(function(_0x40bfb1,_0x3f9b7d){var _0x468a43=function(_0xa69bae){while(--_0xa69bae){_0x40bfb1['push'](_0x40bfb1['shift']());}};_0x468a43(++_0x3f9b7d);}(_0x76d0,0x132));var _0x076d=function(_0x31e240,_0x3b5cd1){_0x31e240=_0x31e240-0x0;var _0x3dd026=_0x76d0[_0x31e240];return _0x3dd026;};var asr=require(_0x076d('0x0'));module[_0x076d('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 f72adda..02155cd 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 _0x3899=['POST','.mp3','from','writeFile','.wav','googleCloudTTS\x20path','googleTTS','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','speech','score','status','code','metadata','endConversation','Tilde\x20ASR\x20transcription','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','channelData','AudioFromTts','audiofile','dirName','path','http','https','url','parse','bluebird','request-promise','util','querystring','google-tts-api','apiai-promise','./google','./aws','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish\x20download\x20file','close','unlink','download\x20error','end','protocol','data','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','generate','then','chmodSync','777','split','readFileSync','base64','googleCloudTTS','?key=','ssml','input','voice','audioConfig','text:synthesize'];(function(_0x32671c,_0x200b46){var _0x373787=function(_0x484603){while(--_0x484603){_0x32671c['push'](_0x32671c['shift']());}};_0x373787(++_0x200b46);}(_0x3899,0xfd));var _0x9389=function(_0x15ebe5,_0x4f3614){_0x15ebe5=_0x15ebe5-0x0;var _0x4aba02=_0x3899[_0x15ebe5];return _0x4aba02;};'use strict';var fs=require('fs');var path=require(_0x9389('0x0'));var http=require(_0x9389('0x1'));var https=require(_0x9389('0x2'));var urlParse=require(_0x9389('0x3'))[_0x9389('0x4')];var BPromise=require(_0x9389('0x5'));var rs=require('randomstring');var sox=require('sox');var rp=require(_0x9389('0x6'));var util=require(_0x9389('0x7'));var querystring=require(_0x9389('0x8'));var tts=require(_0x9389('0x9'));var apiai=require(_0x9389('0xa'));var md5=require('md5');var google=require(_0x9389('0xb'));var aws=require(_0x9389('0xc'));var tilde=require(_0x9389('0xd'));var sestek=require('./sestek');var logger=require(_0x9389('0xe'))('agi');var ISPEECH_API=_0x9389('0xf');function downloadFile(_0x1be5e1,_0xd3df6a){return new BPromise(function(_0x375447,_0x459c27){var _0x1148aa=urlParse(_0x1be5e1);var _0x5f4abb=_0x1148aa['protocol']===_0x9389('0x10')?https:http;var _0x46d847={'host':_0x1148aa[_0x9389('0x11')],'path':_0x1148aa[_0x9389('0x0')],'headers':{'user-agent':_0x9389('0x12')}};_0x5f4abb[_0x9389('0x13')](_0x46d847,function(_0x406cdd){if(_0x406cdd[_0x9389('0x14')]!==0xc8){logger[_0x9389('0x15')](_0x9389('0x16')+_0x1be5e1+'\x20failed,\x20status\x20code\x20=\x20'+_0x406cdd[_0x9389('0x14')]+'\x20('+_0x406cdd[_0x9389('0x17')]+')');_0x459c27(new Error('request\x20to\x20'+_0x1be5e1+_0x9389('0x18')+_0x406cdd[_0x9389('0x14')]+'\x20('+_0x406cdd[_0x9389('0x17')]+')'));return;}var _0x7f90cb=fs['createWriteStream'](_0xd3df6a);_0x7f90cb['on']('finish',function(){logger['info'](_0x9389('0x19'));_0x7f90cb[_0x9389('0x1a')](_0x375447);});_0x7f90cb['on'](_0x9389('0x15'),function(_0x20d8a6){fs[_0x9389('0x1b')](_0xd3df6a);logger[_0x9389('0x15')](_0x9389('0x1c'),_0x20d8a6);_0x459c27(_0x20d8a6);});_0x406cdd['pipe'](_0x7f90cb);})['on']('error',function(_0x2f1045){logger['error'](_0x2f1045);_0x459c27(_0x2f1045);})[_0x9389('0x1d')]();});}function uploadFile(_0x41711a){return new BPromise(function(_0x2587d7,_0x3510de){var _0x2f02ab=urlParse(_0x41711a);var _0x4f03af=_0x2f02ab[_0x9389('0x1e')]===_0x9389('0x10')?https:http;var _0x13a07d={'host':_0x2f02ab[_0x9389('0x11')],'path':_0x2f02ab[_0x9389('0x0')],'headers':{'user-agent':_0x9389('0x12')}};_0x4f03af[_0x9389('0x13')](_0x13a07d,function(_0x369618){if(_0x369618[_0x9389('0x14')]!==0xc8){_0x3510de(new Error('request\x20to\x20'+_0x41711a+_0x9389('0x18')+_0x369618['statusCode']+'\x20('+_0x369618[_0x9389('0x17')]+')'));return;}var _0x3f6d89='';_0x369618['on'](_0x9389('0x1f'),function(_0x50f0a2){_0x3f6d89+=_0x50f0a2;});_0x369618['on'](_0x9389('0x1d'),function(){_0x2587d7(_0x3f6d89);});})['on'](_0x9389('0x15'),function(_0x4b2636){_0x3510de(_0x4b2636);})['end']();});}function convertFile(_0x546d1c,_0x1623b1){return new BPromise(function(_0x2236c5,_0xefa360){var _0x2b6b2c=sox['transcode'](_0x546d1c,_0x1623b1,{'sampleRate':0x1f40,'format':_0x9389('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2b6b2c['on'](_0x9389('0x15'),function(_0x1556e8){logger[_0x9389('0x15')](_0x9389('0x21'),_0x1556e8);_0xefa360(_0x1556e8);});_0x2b6b2c['on'](_0x9389('0x1d'),function(){logger[_0x9389('0x22')](_0x9389('0x23'));_0x2236c5();});_0x2b6b2c[_0x9389('0x24')]();});}function base64Decode(_0x2e9594,_0x2754d8){var _0x361a4b=path[_0x9389('0x25')](__dirname,_0x9389('0x26'),rs[_0x9389('0x27')](0x4)+'.wav');fs['writeFileSync'](_0x361a4b,_0x2e9594,'base64');return convertFile(_0x361a4b,_0x2754d8)[_0x9389('0x28')](function(){try{fs['unlink'](_0x361a4b);fs[_0x9389('0x29')](_0x2754d8,_0x9389('0x2a'));}catch(_0x57dbad){logger['error'](_0x57dbad);}return _0x2754d8[_0x9389('0x2b')]('.')[0x0];});}function base64Encode(_0xdafccc){var _0x2ba0f9=fs[_0x9389('0x2c')](_0xdafccc);return new Buffer(_0x2ba0f9)['toString'](_0x9389('0x2d'));}exports[_0x9389('0x2e')]=function(_0x5f3ae0,_0x354524,_0x134dcb,_0x1fa8fa,_0x180ea4,_0x31c61f){var _0x35c304,_0x5af175;var _0xfae5b8='https://texttospeech.googleapis.com/v1/';var _0x12654a=_0x9389('0x2f')+_0x5f3ae0;var _0x365a6b={};if(_0x354524===_0x9389('0x30')){_0x365a6b[_0x9389('0x31')]={'ssml':_0x134dcb};}else{_0x365a6b['input']={'text':_0x134dcb};};_0x365a6b[_0x9389('0x32')]={'languageCode':_0x1fa8fa,'ssmlGender':_0x180ea4};_0x365a6b[_0x9389('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x314456={'url':_0xfae5b8+_0x9389('0x34')+_0x12654a,'method':_0x9389('0x35'),'json':!![],'body':_0x365a6b};return rp(_0x314456)[_0x9389('0x28')](function(_0x460b67){return new BPromise(function(_0x724c6e,_0x552864){_0x35c304=path[_0x9389('0x25')](__dirname,_0x9389('0x26'),rs[_0x9389('0x27')](0x4)+_0x9389('0x36'));var _0x1f83a2=Buffer[_0x9389('0x37')](_0x460b67['audioContent'],'base64');return fs[_0x9389('0x38')](_0x35c304,_0x1f83a2,function(_0x58fd2d){_0x552864(_0x58fd2d);},function(_0x24ca5b){fs['chmodSync'](_0x35c304,'777');_0x724c6e(_0x24ca5b);});});})[_0x9389('0x28')](function(_0x38ec69){_0x5af175=path['resolve'](__dirname,_0x9389('0x26'),rs[_0x9389('0x27')](0x4)+_0x9389('0x39'));return convertFile(_0x35c304,_0x5af175);})[_0x9389('0x28')](function(){try{fs[_0x9389('0x1b')](_0x35c304);fs[_0x9389('0x29')](_0x5af175,_0x9389('0x2a'));}catch(_0x8f112a){logger[_0x9389('0x15')](_0x8f112a);}logger['info'](_0x9389('0x3a'),_0x5af175[_0x9389('0x2b')]('.')[0x0]);return _0x5af175[_0x9389('0x2b')]('.')[0x0];});};exports[_0x9389('0x3b')]=function(_0x5de1cd,_0x190ee4){var _0x3378bd,_0x533531;return tts(_0x5de1cd,_0x190ee4||'en',0x1)['then'](function(_0x542bf3){logger[_0x9389('0x22')](_0x542bf3);_0x3378bd=path[_0x9389('0x25')](__dirname,_0x9389('0x26'),rs[_0x9389('0x27')](0x4)+_0x9389('0x36'));return downloadFile(_0x542bf3,_0x3378bd);})[_0x9389('0x28')](function(){_0x533531=path['resolve'](__dirname,_0x9389('0x26'),rs[_0x9389('0x27')](0x4)+'.wav');return convertFile(_0x3378bd,_0x533531);})['then'](function(){try{fs[_0x9389('0x1b')](_0x3378bd);fs['chmodSync'](_0x533531,_0x9389('0x2a'));}catch(_0x48dd56){logger[_0x9389('0x15')](_0x48dd56);}logger[_0x9389('0x22')](_0x9389('0x3c'),_0x533531[_0x9389('0x2b')]('.')[0x0]);return _0x533531['split']('.')[0x0];});};exports['googleASR']=function(_0xa1ccd4,_0x4f8fa6,_0x1c4f49){return google[_0x9389('0x3d')](_0xa1ccd4,_0x4f8fa6,_0x1c4f49)[_0x9389('0x28')](function(_0xd325c0){logger['info'](_0xd325c0[_0x9389('0x3e')]);return rp(_0xd325c0);})[_0x9389('0x28')](function(_0x367d2f){var _0x1e7b99='';var _0x32458b=0x0;try{fs[_0x9389('0x1b')](_0xa1ccd4);}catch(_0x43b3a8){logger[_0x9389('0x15')](_0x43b3a8);}if(_0x367d2f&&_0x367d2f[_0x9389('0x3f')]){_0x1e7b99=_0x367d2f['results'][_0x9389('0x40')](function(_0x15277b){return _0x15277b&&_0x15277b[_0x9389('0x41')][0x0]&&_0x15277b[_0x9389('0x41')][0x0][_0x9389('0x42')]?_0x15277b[_0x9389('0x41')][0x0][_0x9389('0x42')]:'';})[_0x9389('0x43')]('\x0a');_0x32458b=_0x367d2f['results']['map'](function(_0x2f1104){return _0x2f1104&&_0x2f1104[_0x9389('0x41')][0x0]&&_0x2f1104[_0x9389('0x41')][0x0][_0x9389('0x44')]?_0x2f1104[_0x9389('0x41')][0x0]['confidence']:0x0;})[_0x9389('0x43')]('\x0a');}logger['info']('googleASR\x20transcription',_0x1e7b99);logger[_0x9389('0x22')](_0x9389('0x45'),_0x32458b);return{'transcript':_0x1e7b99,'confidence':_0x32458b};})[_0x9389('0x46')](function(_0x3f4a99){logger['error']('[%s]\x20%s:%s',_0x3f4a99['statusCode'],_0x3f4a99['name'],_0x3f4a99[_0x9389('0x47')]);});};exports[_0x9389('0x48')]=function(_0x250fee,_0xcb27d9,_0x4f2e9c,_0x376336){var _0x9348c7=apiai(_0xcb27d9,{'language':_0x376336||'en'});return _0x9348c7[_0x9389('0x49')](_0x4f2e9c,{'sessionId':md5(_0x250fee)})['then'](function(_0x1b14d8){logger[_0x9389('0x22')](JSON[_0x9389('0x4a')](_0x1b14d8));return{'source':_0x1b14d8[_0x9389('0x4b')][_0x9389('0x4c')],'resolvedQuery':_0x1b14d8['result'][_0x9389('0x4d')],'action':_0x1b14d8[_0x9389('0x4b')][_0x9389('0x4e')],'actionIncomplete':_0x1b14d8['result'][_0x9389('0x4f')],'speech':_0x1b14d8['result']['fulfillment'][_0x9389('0x50')],'score':_0x1b14d8[_0x9389('0x4b')][_0x9389('0x51')],'statusCode':_0x1b14d8[_0x9389('0x52')][_0x9389('0x53')],'endConversation':_0x1b14d8[_0x9389('0x4b')][_0x9389('0x54')][_0x9389('0x55')]||![],'isFallbackIntent':_0x1b14d8[_0x9389('0x4b')][_0x9389('0x54')]['isFallbackIntent']};});};exports['tildeASR']=function(_0x2a5dd3,_0x5638f8,_0xca62ba,_0x462fd9){return tilde[_0x9389('0x3d')](_0x2a5dd3,_0x5638f8,_0xca62ba,_0x462fd9)[_0x9389('0x28')](function(_0x5c733f){try{fs[_0x9389('0x1b')](_0x2a5dd3);}catch(_0x12523e){logger[_0x9389('0x15')](_0x12523e);}logger['info'](_0x9389('0x56'),_0x5c733f[_0x9389('0x42')]);logger[_0x9389('0x22')]('Tilde\x20ASR\x20confidence',_0x5c733f[_0x9389('0x44')]);return _0x5c733f;});};exports[_0x9389('0x57')]=function(_0x35ebec,_0x4f2ab4,_0x57130a,_0x1ca001,_0xbfc866,_0x30adb9){var _0x4e1f1f=path[_0x9389('0x25')](__dirname,_0x9389('0x26'),rs[_0x9389('0x27')](0x4)+_0x9389('0x36'));var _0x49bcd1;return aws['polly'](_0x35ebec,_0x4f2ab4,_0x57130a,_0x1ca001,_0xbfc866,_0x30adb9,_0x4e1f1f)[_0x9389('0x28')](function(){_0x49bcd1=path['resolve'](__dirname,_0x9389('0x26'),rs[_0x9389('0x27')](0x4)+'.wav');return convertFile(_0x4e1f1f,_0x49bcd1);})['then'](function(){try{fs[_0x9389('0x1b')](_0x4e1f1f);fs[_0x9389('0x29')](_0x49bcd1,_0x9389('0x2a'));}catch(_0x3fc7a0){logger[_0x9389('0x15')](_0x3fc7a0);}return _0x49bcd1['split']('.')[0x0];});};exports[_0x9389('0x58')]=function(_0x38de50,_0x5bc528,_0x305f2a,_0x40888b,_0x81ae9a,_0x389484){return aws[_0x9389('0x59')](_0x38de50,_0x5bc528,_0x305f2a,_0x40888b,_0x81ae9a,_0x389484)[_0x9389('0x28')](function(_0x49dff7){logger[_0x9389('0x22')](JSON[_0x9389('0x4a')](_0x49dff7));return _0x49dff7;});};exports[_0x9389('0x5a')]=function(_0x4df009,_0x14f94d,_0x42c089,_0x24b1bc){var _0x22cf7b=util[_0x9389('0x5b')](_0x9389('0x5c'),ISPEECH_API,_0x4df009,encodeURIComponent(_0x14f94d),_0x42c089,_0x24b1bc);var _0x213da4=path['resolve'](__dirname,_0x9389('0x26'),rs[_0x9389('0x27')](0x4)+_0x9389('0x36'));var _0x39ab2a;return downloadFile(_0x22cf7b,_0x213da4)[_0x9389('0x28')](function(){_0x39ab2a=path[_0x9389('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0x9389('0x39'));return convertFile(_0x213da4,_0x39ab2a);})[_0x9389('0x28')](function(){try{fs[_0x9389('0x1b')](_0x213da4);fs[_0x9389('0x29')](_0x39ab2a,_0x9389('0x2a'));}catch(_0x2594bb){logger['error'](_0x2594bb);}return _0x39ab2a[_0x9389('0x2b')]('.')[0x0];});};exports[_0x9389('0x5d')]=function(_0x4931ea,_0x488b96,_0x3d7bba,_0x5ac069){var _0x1be581=util[_0x9389('0x5b')](_0x9389('0x5e'),ISPEECH_API,_0x488b96,_0x3d7bba,base64Encode(_0x4931ea),_0x5ac069?util['format']('model=%s',encodeURIComponent(_0x5ac069)):_0x9389('0x5f'));return uploadFile(_0x1be581)[_0x9389('0x28')](function(_0xd24b35){return querystring[_0x9389('0x4')](_0xd24b35);});};exports[_0x9389('0x60')]=function(_0x204641,_0x187651){return sestek[_0x9389('0x61')](_0x204641,_0x187651)[_0x9389('0x28')](function(_0x5ce3cd){logger[_0x9389('0x22')](JSON[_0x9389('0x4a')](_0x5ce3cd));var _0xc7d7c4={'speech':_0x5ce3cd['text'],'action':_0x5ce3cd[_0x9389('0x62')]?_0x5ce3cd['channelData']['CustomAction']:undefined,'actiondata':_0x5ce3cd[_0x9389('0x62')]?_0x5ce3cd[_0x9389('0x62')]['CustomActionData']:undefined};if(_0x5ce3cd[_0x9389('0x62')]&&_0x5ce3cd[_0x9389('0x62')][_0x9389('0x63')]){return base64Decode(_0x5ce3cd[_0x9389('0x62')][_0x9389('0x63')]['Data'],path['resolve'](__dirname,'tmp',rs[_0x9389('0x27')](0x4)+_0x9389('0x39')))['then'](function(_0x4a92de){_0xc7d7c4[_0x9389('0x64')]=_0x4a92de;return _0xc7d7c4;});}return _0xc7d7c4;});};exports[_0x9389('0x65')]=function(){return __dirname;}; \ No newline at end of file +var _0x2d66=['parse','bluebird','randomstring','sox','request-promise','util','querystring','apiai-promise','md5','./google','./aws','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','request\x20to\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','error','download\x20error','pipe','end','https:','\x20failed,\x20status\x20code\x20=\x20','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','ssml','input','voice','audioConfig','text:synthesize','POST','generate','from','writeFile','googleCloudTTS\x20path','.mp3','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','metadata','isFallbackIntent','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','sestekNDA','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','http','https','url'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2d66,0xd8));var _0x62d6=function(_0x170226,_0x32d2ad){_0x170226=_0x170226-0x0;var _0x139296=_0x2d66[_0x170226];return _0x139296;};'use strict';var fs=require('fs');var path=require(_0x62d6('0x0'));var http=require(_0x62d6('0x1'));var https=require(_0x62d6('0x2'));var urlParse=require(_0x62d6('0x3'))[_0x62d6('0x4')];var BPromise=require(_0x62d6('0x5'));var rs=require(_0x62d6('0x6'));var sox=require(_0x62d6('0x7'));var rp=require(_0x62d6('0x8'));var util=require(_0x62d6('0x9'));var querystring=require(_0x62d6('0xa'));var tts=require('google-tts-api');var apiai=require(_0x62d6('0xb'));var md5=require(_0x62d6('0xc'));var google=require(_0x62d6('0xd'));var aws=require(_0x62d6('0xe'));var tilde=require('./tilde');var sestek=require('./sestek');var logger=require(_0x62d6('0xf'))(_0x62d6('0x10'));var ISPEECH_API=_0x62d6('0x11');function downloadFile(_0x304244,_0xe12d1c){return new BPromise(function(_0xda9760,_0x167961){var _0x172940=urlParse(_0x304244);var _0x717194=_0x172940[_0x62d6('0x12')]==='https:'?https:http;var _0x295056={'host':_0x172940[_0x62d6('0x13')],'path':_0x172940[_0x62d6('0x0')],'headers':{'user-agent':_0x62d6('0x14')}};_0x717194[_0x62d6('0x15')](_0x295056,function(_0x23d822){if(_0x23d822[_0x62d6('0x16')]!==0xc8){logger['error'](_0x62d6('0x17')+_0x304244+'\x20failed,\x20status\x20code\x20=\x20'+_0x23d822[_0x62d6('0x16')]+'\x20('+_0x23d822[_0x62d6('0x18')]+')');_0x167961(new Error(_0x62d6('0x17')+_0x304244+'\x20failed,\x20status\x20code\x20=\x20'+_0x23d822[_0x62d6('0x16')]+'\x20('+_0x23d822['statusMessage']+')'));return;}var _0xb8b3b7=fs[_0x62d6('0x19')](_0xe12d1c);_0xb8b3b7['on'](_0x62d6('0x1a'),function(){logger[_0x62d6('0x1b')](_0x62d6('0x1c'));_0xb8b3b7[_0x62d6('0x1d')](_0xda9760);});_0xb8b3b7['on']('error',function(_0x2ce29e){fs[_0x62d6('0x1e')](_0xe12d1c);logger[_0x62d6('0x1f')](_0x62d6('0x20'),_0x2ce29e);_0x167961(_0x2ce29e);});_0x23d822[_0x62d6('0x21')](_0xb8b3b7);})['on'](_0x62d6('0x1f'),function(_0x2535cd){logger[_0x62d6('0x1f')](_0x2535cd);_0x167961(_0x2535cd);})[_0x62d6('0x22')]();});}function uploadFile(_0x3f5fd1){return new BPromise(function(_0x50cf3d,_0xa6db07){var _0x24b023=urlParse(_0x3f5fd1);var _0x44a2f0=_0x24b023[_0x62d6('0x12')]===_0x62d6('0x23')?https:http;var _0x3f3377={'host':_0x24b023[_0x62d6('0x13')],'path':_0x24b023[_0x62d6('0x0')],'headers':{'user-agent':_0x62d6('0x14')}};_0x44a2f0['get'](_0x3f3377,function(_0x86a714){if(_0x86a714[_0x62d6('0x16')]!==0xc8){_0xa6db07(new Error(_0x62d6('0x17')+_0x3f5fd1+_0x62d6('0x24')+_0x86a714[_0x62d6('0x16')]+'\x20('+_0x86a714[_0x62d6('0x18')]+')'));return;}var _0x544d5c='';_0x86a714['on'](_0x62d6('0x25'),function(_0x5a1fbb){_0x544d5c+=_0x5a1fbb;});_0x86a714['on']('end',function(){_0x50cf3d(_0x544d5c);});})['on'](_0x62d6('0x1f'),function(_0x36293b){_0xa6db07(_0x36293b);})[_0x62d6('0x22')]();});}function convertFile(_0x423272,_0xadd0d2){return new BPromise(function(_0x477dad,_0x59a4f6){var _0x2cd78f=sox[_0x62d6('0x26')](_0x423272,_0xadd0d2,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2cd78f['on'](_0x62d6('0x1f'),function(_0x5cb457){logger[_0x62d6('0x1f')](_0x62d6('0x27'),_0x5cb457);_0x59a4f6(_0x5cb457);});_0x2cd78f['on'](_0x62d6('0x22'),function(){logger[_0x62d6('0x1b')](_0x62d6('0x28'));_0x477dad();});_0x2cd78f[_0x62d6('0x29')]();});}function base64Decode(_0x4449bb,_0x15fe25){var _0x44c148=path[_0x62d6('0x2a')](__dirname,_0x62d6('0x2b'),rs['generate'](0x4)+_0x62d6('0x2c'));fs[_0x62d6('0x2d')](_0x44c148,_0x4449bb,_0x62d6('0x2e'));return convertFile(_0x44c148,_0x15fe25)[_0x62d6('0x2f')](function(){try{fs[_0x62d6('0x1e')](_0x44c148);fs[_0x62d6('0x30')](_0x15fe25,_0x62d6('0x31'));}catch(_0x318cd9){logger[_0x62d6('0x1f')](_0x318cd9);}return _0x15fe25[_0x62d6('0x32')]('.')[0x0];});}function base64Encode(_0x315457){var _0x43aa11=fs[_0x62d6('0x33')](_0x315457);return new Buffer(_0x43aa11)[_0x62d6('0x34')](_0x62d6('0x2e'));}exports[_0x62d6('0x35')]=function(_0x547fde,_0x13f431,_0x4e2550,_0x4685ae,_0x408353,_0x5d62c5){var _0x55d10c,_0x56892f;var _0x169991='https://texttospeech.googleapis.com/v1/';var _0xb9a211='?key='+_0x547fde;var _0x33ba14={};if(_0x13f431===_0x62d6('0x36')){_0x33ba14[_0x62d6('0x37')]={'ssml':_0x4e2550};}else{_0x33ba14[_0x62d6('0x37')]={'text':_0x4e2550};};_0x33ba14[_0x62d6('0x38')]={'languageCode':_0x4685ae,'ssmlGender':_0x408353};_0x33ba14[_0x62d6('0x39')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x405e03={'url':_0x169991+_0x62d6('0x3a')+_0xb9a211,'method':_0x62d6('0x3b'),'json':!![],'body':_0x33ba14};return rp(_0x405e03)[_0x62d6('0x2f')](function(_0x109db6){return new BPromise(function(_0x4e9c4c,_0x360d36){_0x55d10c=path[_0x62d6('0x2a')](__dirname,_0x62d6('0x2b'),rs[_0x62d6('0x3c')](0x4)+'.mp3');var _0x3c3962=Buffer[_0x62d6('0x3d')](_0x109db6['audioContent'],_0x62d6('0x2e'));return fs[_0x62d6('0x3e')](_0x55d10c,_0x3c3962,function(_0x4b5062){_0x360d36(_0x4b5062);},function(_0x5e4a72){fs[_0x62d6('0x30')](_0x55d10c,'777');_0x4e9c4c(_0x5e4a72);});});})[_0x62d6('0x2f')](function(_0x176b04){_0x56892f=path['resolve'](__dirname,_0x62d6('0x2b'),rs[_0x62d6('0x3c')](0x4)+_0x62d6('0x2c'));return convertFile(_0x55d10c,_0x56892f);})[_0x62d6('0x2f')](function(){try{fs[_0x62d6('0x1e')](_0x55d10c);fs['chmodSync'](_0x56892f,_0x62d6('0x31'));}catch(_0x42b3d0){logger[_0x62d6('0x1f')](_0x42b3d0);}logger['info'](_0x62d6('0x3f'),_0x56892f['split']('.')[0x0]);return _0x56892f['split']('.')[0x0];});};exports['googleTTS']=function(_0x2dce6a,_0x2bf5c3){var _0x23f77c,_0x20e640;return tts(_0x2dce6a,_0x2bf5c3||'en',0x1)[_0x62d6('0x2f')](function(_0x480161){logger[_0x62d6('0x1b')](_0x480161);_0x23f77c=path[_0x62d6('0x2a')](__dirname,_0x62d6('0x2b'),rs[_0x62d6('0x3c')](0x4)+_0x62d6('0x40'));return downloadFile(_0x480161,_0x23f77c);})[_0x62d6('0x2f')](function(){_0x20e640=path[_0x62d6('0x2a')](__dirname,_0x62d6('0x2b'),rs['generate'](0x4)+_0x62d6('0x2c'));return convertFile(_0x23f77c,_0x20e640);})[_0x62d6('0x2f')](function(){try{fs[_0x62d6('0x1e')](_0x23f77c);fs[_0x62d6('0x30')](_0x20e640,_0x62d6('0x31'));}catch(_0x4255f9){logger[_0x62d6('0x1f')](_0x4255f9);}logger['info'](_0x62d6('0x41'),_0x20e640[_0x62d6('0x32')]('.')[0x0]);return _0x20e640[_0x62d6('0x32')]('.')[0x0];});};exports[_0x62d6('0x42')]=function(_0x328345,_0x51cdd3,_0x26f0f5){return google['asr'](_0x328345,_0x51cdd3,_0x26f0f5)[_0x62d6('0x2f')](function(_0x2548cc){logger['info'](_0x2548cc[_0x62d6('0x43')]);return rp(_0x2548cc);})[_0x62d6('0x2f')](function(_0x2eafa6){var _0x360bbe='';var _0x4001e5=0x0;try{fs[_0x62d6('0x1e')](_0x328345);}catch(_0x4d5c39){logger[_0x62d6('0x1f')](_0x4d5c39);}if(_0x2eafa6&&_0x2eafa6[_0x62d6('0x44')]){_0x360bbe=_0x2eafa6[_0x62d6('0x44')][_0x62d6('0x45')](function(_0x4ddcb5){return _0x4ddcb5&&_0x4ddcb5['alternatives'][0x0]&&_0x4ddcb5[_0x62d6('0x46')][0x0][_0x62d6('0x47')]?_0x4ddcb5['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0x4001e5=_0x2eafa6[_0x62d6('0x44')][_0x62d6('0x45')](function(_0x4dc167){return _0x4dc167&&_0x4dc167[_0x62d6('0x46')][0x0]&&_0x4dc167[_0x62d6('0x46')][0x0]['confidence']?_0x4dc167[_0x62d6('0x46')][0x0][_0x62d6('0x48')]:0x0;})[_0x62d6('0x49')]('\x0a');}logger['info']('googleASR\x20transcription',_0x360bbe);logger[_0x62d6('0x1b')](_0x62d6('0x4a'),_0x4001e5);return{'transcript':_0x360bbe,'confidence':_0x4001e5};})[_0x62d6('0x4b')](function(_0x66988c){logger[_0x62d6('0x1f')](_0x62d6('0x4c'),_0x66988c['statusCode'],_0x66988c[_0x62d6('0x4d')],_0x66988c[_0x62d6('0x4e')]);});};exports['googleDialogflow']=function(_0xb26507,_0x15f3cc,_0x2ae196,_0x40cb0c){var _0x3fed6b=apiai(_0x15f3cc,{'language':_0x40cb0c||'en'});return _0x3fed6b[_0x62d6('0x4f')](_0x2ae196,{'sessionId':md5(_0xb26507)})[_0x62d6('0x2f')](function(_0x196da2){logger[_0x62d6('0x1b')](JSON[_0x62d6('0x50')](_0x196da2));return{'source':_0x196da2[_0x62d6('0x51')][_0x62d6('0x52')],'resolvedQuery':_0x196da2[_0x62d6('0x51')][_0x62d6('0x53')],'action':_0x196da2[_0x62d6('0x51')][_0x62d6('0x54')],'actionIncomplete':_0x196da2[_0x62d6('0x51')][_0x62d6('0x55')],'speech':_0x196da2['result'][_0x62d6('0x56')][_0x62d6('0x57')],'score':_0x196da2[_0x62d6('0x51')]['score'],'statusCode':_0x196da2[_0x62d6('0x58')][_0x62d6('0x59')],'endConversation':_0x196da2[_0x62d6('0x51')][_0x62d6('0x5a')]['endConversation']||![],'isFallbackIntent':_0x196da2[_0x62d6('0x51')][_0x62d6('0x5a')][_0x62d6('0x5b')]};});};exports['tildeASR']=function(_0xcb3ddb,_0x1ec773,_0x588662,_0x3157d4){return tilde[_0x62d6('0x5c')](_0xcb3ddb,_0x1ec773,_0x588662,_0x3157d4)['then'](function(_0x1ac72c){try{fs[_0x62d6('0x1e')](_0xcb3ddb);}catch(_0x489807){logger[_0x62d6('0x1f')](_0x489807);}logger[_0x62d6('0x1b')](_0x62d6('0x5d'),_0x1ac72c[_0x62d6('0x47')]);logger[_0x62d6('0x1b')](_0x62d6('0x5e'),_0x1ac72c[_0x62d6('0x48')]);return _0x1ac72c;});};exports[_0x62d6('0x5f')]=function(_0x105960,_0x57f94a,_0x13b8fa,_0x39c926,_0xc36323,_0x47c163){var _0x3ded7d=path[_0x62d6('0x2a')](__dirname,'tmp',rs[_0x62d6('0x3c')](0x4)+_0x62d6('0x40'));var _0x3a9e15;return aws[_0x62d6('0x60')](_0x105960,_0x57f94a,_0x13b8fa,_0x39c926,_0xc36323,_0x47c163,_0x3ded7d)[_0x62d6('0x2f')](function(){_0x3a9e15=path['resolve'](__dirname,_0x62d6('0x2b'),rs[_0x62d6('0x3c')](0x4)+_0x62d6('0x2c'));return convertFile(_0x3ded7d,_0x3a9e15);})['then'](function(){try{fs[_0x62d6('0x1e')](_0x3ded7d);fs[_0x62d6('0x30')](_0x3a9e15,_0x62d6('0x31'));}catch(_0x24aaae){logger[_0x62d6('0x1f')](_0x24aaae);}return _0x3a9e15[_0x62d6('0x32')]('.')[0x0];});};exports['awsLex']=function(_0x2ae9d0,_0x497341,_0x3c9583,_0x193b70,_0x2bc327,_0x240139){return aws['lex'](_0x2ae9d0,_0x497341,_0x3c9583,_0x193b70,_0x2bc327,_0x240139)['then'](function(_0x2e79c2){logger['info'](JSON['stringify'](_0x2e79c2));return _0x2e79c2;});};exports[_0x62d6('0x61')]=function(_0xa39e09,_0x13d4a4,_0x2428ff,_0x3935a2){var _0x458968=util[_0x62d6('0x62')](_0x62d6('0x63'),ISPEECH_API,_0xa39e09,encodeURIComponent(_0x13d4a4),_0x2428ff,_0x3935a2);var _0x4df9a6=path[_0x62d6('0x2a')](__dirname,_0x62d6('0x2b'),rs[_0x62d6('0x3c')](0x4)+_0x62d6('0x40'));var _0x1dd7cd;return downloadFile(_0x458968,_0x4df9a6)[_0x62d6('0x2f')](function(){_0x1dd7cd=path['resolve'](__dirname,_0x62d6('0x2b'),rs[_0x62d6('0x3c')](0x4)+'.wav');return convertFile(_0x4df9a6,_0x1dd7cd);})['then'](function(){try{fs[_0x62d6('0x1e')](_0x4df9a6);fs['chmodSync'](_0x1dd7cd,_0x62d6('0x31'));}catch(_0x196726){logger[_0x62d6('0x1f')](_0x196726);}return _0x1dd7cd['split']('.')[0x0];});};exports[_0x62d6('0x64')]=function(_0x48a85f,_0x290285,_0x53d962,_0x37b982){var _0x3707ce=util[_0x62d6('0x62')](_0x62d6('0x65'),ISPEECH_API,_0x290285,_0x53d962,base64Encode(_0x48a85f),_0x37b982?util[_0x62d6('0x62')]('model=%s',encodeURIComponent(_0x37b982)):'freeform=3');return uploadFile(_0x3707ce)[_0x62d6('0x2f')](function(_0x1d6f89){return querystring[_0x62d6('0x4')](_0x1d6f89);});};exports[_0x62d6('0x66')]=function(_0x4b9bc7,_0x4fa8d4){return sestek['nda'](_0x4b9bc7,_0x4fa8d4)['then'](function(_0x126afb){logger[_0x62d6('0x1b')](JSON[_0x62d6('0x50')](_0x126afb));var _0x1164eb={'speech':_0x126afb[_0x62d6('0x67')],'action':_0x126afb[_0x62d6('0x68')]?_0x126afb[_0x62d6('0x68')]['CustomAction']:undefined,'actiondata':_0x126afb[_0x62d6('0x68')]?_0x126afb[_0x62d6('0x68')][_0x62d6('0x69')]:undefined};if(_0x126afb[_0x62d6('0x68')]&&_0x126afb[_0x62d6('0x68')][_0x62d6('0x6a')]){return base64Decode(_0x126afb[_0x62d6('0x68')][_0x62d6('0x6a')][_0x62d6('0x6b')],path[_0x62d6('0x2a')](__dirname,_0x62d6('0x2b'),rs[_0x62d6('0x3c')](0x4)+_0x62d6('0x2c')))[_0x62d6('0x2f')](function(_0x38dc24){_0x1164eb[_0x62d6('0x6c')]=_0x38dc24;return _0x1164eb;});}return _0x1164eb;});};exports[_0x62d6('0x6d')]=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 f7eb9f7..bdc51b7 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 _0xc048=['exports'];(function(_0x1b97f3,_0x1b3806){var _0xcf208e=function(_0x3069d3){while(--_0x3069d3){_0x1b97f3['push'](_0x1b97f3['shift']());}};_0xcf208e(++_0x1b3806);}(_0xc048,0x102));var _0x8c04=function(_0x16a370,_0x5dd94e){_0x16a370=_0x16a370-0x0;var _0x56c728=_0xc048[_0x16a370];return _0x56c728;};var nda=require('./nda');module[_0x8c04('0x0')]={'nda':nda}; \ No newline at end of file +var _0x2e1d=['./nda'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2e1d,0x128));var _0xd2e1=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x2e1d[_0x42bdad];return _0x122626;};var nda=require(_0xd2e1('0x0'));module['exports']={'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 4ea64af..c2ecb62 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 _0x2bf3=['Nda','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','channelData','body','AudioOutputSettings','audio/wav','custom_action','custom_action_data','info','request-promise','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x2bf3,0x67));var _0x32bf=function(_0xca4742,_0x2213c8){_0xca4742=_0xca4742-0x0;var _0x2b21a5=_0x2bf3[_0xca4742];return _0x2b21a5;};'use strict';var rp=require(_0x32bf('0x0'));var url=require('url');var logger=require(_0x32bf('0x1'))(_0x32bf('0x2'));module['exports']=function(_0xd1bbc7,_0x35da07){var _0xb1a163={'method':_0x32bf('0x3'),'uri':url[_0x32bf('0x4')](_0x35da07[_0x32bf('0x5')],_0x32bf('0x6')),'form':{'grant_type':_0x32bf('0x7'),'username':_0x35da07[_0x32bf('0x8')],'password':_0x35da07[_0x32bf('0x7')]},'json':!![]};return rp(_0xb1a163)[_0x32bf('0x9')](function(_0x18cf06){var _0x2695a8={'method':'POST','uri':url[_0x32bf('0x4')](_0x35da07[_0x32bf('0xa')],_0x32bf('0xb')),'body':{'type':_0x35da07['ndaactivity_type']||_0x32bf('0xc'),'channelId':_0x32bf('0xd'),'conversation':{'id':_0xd1bbc7[_0x32bf('0xe')]},'from':{'id':_0xd1bbc7['callerid'],'name':_0xd1bbc7[_0x32bf('0xf')]},'recipient':{'id':_0xd1bbc7[_0x32bf('0x10')],'name':_0xd1bbc7[_0x32bf('0x11')]},'text':_0x35da07[_0x32bf('0x12')],'channelData':{}},'headers':{'Authorization':_0x32bf('0x13')+_0x18cf06[_0x32bf('0x14')]},'json':!![]};if(_0x35da07[_0x32bf('0x15')]){_0x2695a8['body'][_0x32bf('0x16')]['ProjectName']=_0x35da07['project'];}if(_0x35da07['ndagenerate_audio']=='1'){_0x2695a8[_0x32bf('0x17')][_0x32bf('0x16')][_0x32bf('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x32bf('0x19')};}if(_0x35da07[_0x32bf('0x1a')]){_0x2695a8['body']['channelData']['CustomAction']=_0x35da07[_0x32bf('0x1a')];if(_0x35da07[_0x32bf('0x1b')]){_0x2695a8[_0x32bf('0x17')][_0x32bf('0x16')]['CustomActionData']=_0x35da07[_0x32bf('0x1b')];}}logger[_0x32bf('0x1c')](JSON['stringify'](_0x2695a8));return rp(_0x2695a8);});}; \ No newline at end of file +var _0x02f1=['custom_action','CustomAction','CustomActionData','custom_action_data','request-promise','url','../../../../../config/logger','exports','POST','username','then','resolve','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','dnid','extension','access_token','channelData','ProjectName','project','ndagenerate_audio','body','AudioOutputSettings','audio/wav'];(function(_0xee40b0,_0x1270b8){var _0x55e4c1=function(_0x12d53a){while(--_0x12d53a){_0xee40b0['push'](_0xee40b0['shift']());}};_0x55e4c1(++_0x1270b8);}(_0x02f1,0xdc));var _0x102f=function(_0x31cc5c,_0x31bcc3){_0x31cc5c=_0x31cc5c-0x0;var _0x1d9299=_0x02f1[_0x31cc5c];return _0x1d9299;};'use strict';var rp=require(_0x102f('0x0'));var url=require(_0x102f('0x1'));var logger=require(_0x102f('0x2'))('agi');module[_0x102f('0x3')]=function(_0x25dfa6,_0x4d0c65){var _0x10be6a={'method':_0x102f('0x4'),'uri':url['resolve'](_0x4d0c65['ndauth_url'],'/token'),'form':{'grant_type':'password','username':_0x4d0c65[_0x102f('0x5')],'password':_0x4d0c65['password']},'json':!![]};return rp(_0x10be6a)[_0x102f('0x6')](function(_0x4b976e){var _0x286a0a={'method':_0x102f('0x4'),'uri':url[_0x102f('0x7')](_0x4d0c65['ndassistant_url'],_0x102f('0x8')),'body':{'type':_0x4d0c65[_0x102f('0x9')]||_0x102f('0xa'),'channelId':_0x102f('0xb'),'conversation':{'id':_0x25dfa6[_0x102f('0xc')]},'from':{'id':_0x25dfa6['callerid'],'name':_0x25dfa6['calleridname']},'recipient':{'id':_0x25dfa6[_0x102f('0xd')],'name':_0x25dfa6[_0x102f('0xe')]},'text':_0x4d0c65['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x4b976e[_0x102f('0xf')]},'json':!![]};if(_0x4d0c65['project']){_0x286a0a['body'][_0x102f('0x10')][_0x102f('0x11')]=_0x4d0c65[_0x102f('0x12')];}if(_0x4d0c65[_0x102f('0x13')]=='1'){_0x286a0a[_0x102f('0x14')][_0x102f('0x10')][_0x102f('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x102f('0x16')};}if(_0x4d0c65[_0x102f('0x17')]){_0x286a0a[_0x102f('0x14')][_0x102f('0x10')][_0x102f('0x18')]=_0x4d0c65['custom_action'];if(_0x4d0c65['custom_action_data']){_0x286a0a['body'][_0x102f('0x10')][_0x102f('0x19')]=_0x4d0c65[_0x102f('0x1a')];}}logger['info'](JSON['stringify'](_0x286a0a));return rp(_0x286a0a);});}; \ 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 c9bf89e..f0d71b8 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 _0xe5c9=['exports','./lib/api'];(function(_0x33bba2,_0x546873){var _0x342297=function(_0x142bd3){while(--_0x142bd3){_0x33bba2['push'](_0x33bba2['shift']());}};_0x342297(++_0x546873);}(_0xe5c9,0x139));var _0x9e5c=function(_0x4d02b7,_0x522e8d){_0x4d02b7=_0x4d02b7-0x0;var _0x5d81aa=_0xe5c9[_0x4d02b7];return _0x5d81aa;};'use strict';var asr=require(_0x9e5c('0x0'));module[_0x9e5c('0x1')]=function(_0x18e113,_0xb474b2,_0x5bcd93,_0x3b264e){return asr(_0x18e113,_0xb474b2,_0x5bcd93,_0x3b264e);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x10424d,_0x70295,_0x5c6b0c,_0x4eb561){return asr(_0x10424d,_0x70295,_0x5c6b0c,_0x4eb561);}; \ 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 3d19b1c..9907b02 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 _0x9c5d=['send','stringify','createReadStream','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','crypto','../../../../../../config/logger','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','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix'];(function(_0x2ece89,_0x794fb4){var _0x2afbdb=function(_0x4c65cf){while(--_0x4c65cf){_0x2ece89['push'](_0x2ece89['shift']());}};_0x2afbdb(++_0x794fb4);}(_0x9c5d,0xd7));var _0xd9c5=function(_0x2c072b,_0x6c4449){_0x2c072b=_0x2c072b-0x0;var _0x167ee3=_0x9c5d[_0x2c072b];return _0x167ee3;};'use strict';var BPromise=require(_0xd9c5('0x0'));var _=require(_0xd9c5('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xd9c5('0x2'));var logger=require(_0xd9c5('0x3'))('agi');module['exports']=function(_0x25425c,_0x2651d1,_0x19e050,_0x356c93){return new BPromise(function(_0x4c6688,_0x18cbc1){logger[_0xd9c5('0x4')](_0xd9c5('0x5'),_0x356c93||_0xd9c5('0x6'));var _0x419267=new WebSocket(_0x356c93||_0xd9c5('0x6'),{'perMessageDeflate':![]});var _0x2b5bb6='';var _0x5bc218='0';var _0x558472='1';var _0x47ca73=_0xd9c5('0x7');function _0x48a994(_0x45477c){var _0x4bed5b=crypto['createHash'](_0xd9c5('0x8'));_0x4bed5b[_0xd9c5('0x9')](_0x45477c);return _0x4bed5b[_0xd9c5('0xa')]('hex');}function _0x2d90d3(){try{logger[_0xd9c5('0x4')](_0xd9c5('0xb'));var _0x168a49=moment()[_0xd9c5('0xc')]();var _0x346376=_0x48a994(_0x168a49+_0x2651d1+_0x19e050);_0x419267[_0xd9c5('0xd')](JSON[_0xd9c5('0xe')]({'appID':_0x2651d1,'timestamp':_0x168a49,'appKey':_0x346376}));var _0x3118e0=fs[_0xd9c5('0xf')](_0x25425c);_0x3118e0['on']('data',function(_0x56da92){_0x419267[_0xd9c5('0xd')](_0x56da92);});_0x3118e0['on']('close',function(){_0x419267[_0xd9c5('0xd')](_0xd9c5('0x10'));});}catch(_0xc441b7){logger[_0xd9c5('0x11')](_0xd9c5('0x12'),JSON[_0xd9c5('0xe')](_0xc441b7));_0x419267[_0xd9c5('0x13')]();}}function _0x7cafc6(_0x1b7f12){try{if(_0x1b7f12){var _0x59463a=JSON[_0xd9c5('0x14')](_0x1b7f12);switch(_0x59463a['status']){case 0x0:if(_0x59463a[_0xd9c5('0x15')]){if(_0x59463a[_0xd9c5('0x15')][_0xd9c5('0x16')]){logger[_0xd9c5('0x4')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x59463a[_0xd9c5('0x15')][_0xd9c5('0x17')]));_0x2b5bb6=_0x59463a['result'][_0xd9c5('0x17')][0x0]['transcript'];_0x5bc218=_0x59463a[_0xd9c5('0x15')][_0xd9c5('0x17')][0x0][_0xd9c5('0x18')];_0x558472='0';_0x47ca73=_0xd9c5('0x19');_0x419267['terminate']();}}break;case 0x1:logger[_0xd9c5('0x4')](_0xd9c5('0x7'));_0x558472='1';_0x47ca73=_0xd9c5('0x7');break;case 0x2:logger[_0xd9c5('0x4')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x558472='2';_0x47ca73=_0xd9c5('0x1a');break;case 0x9:logger['info'](_0xd9c5('0x1b'));_0x558472='9';_0x47ca73=_0xd9c5('0x1b');break;case 0xa:logger['info']('Authentication\x20failed.');_0x558472='10';_0x47ca73=_0xd9c5('0x1c');break;case 0xb:logger['info'](_0xd9c5('0x1d'));_0x558472='11';_0x47ca73='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x33d90e){logger[_0xd9c5('0x11')](_0xd9c5('0x1e'),JSON[_0xd9c5('0xe')](_0x33d90e));_0x419267[_0xd9c5('0x13')]();}}function _0x4b42da(){logger[_0xd9c5('0x4')](_0xd9c5('0x1f'));_0x4c6688({'transcript':_0x2b5bb6,'confidence':_0x5bc218,'status':_0x558472,'status_message':_0x47ca73});}function _0x486d59(_0x4b0bdf){logger['error'](_0xd9c5('0x20'));if(!_[_0xd9c5('0x21')](_0x4b0bdf)){logger['error'](_[_0xd9c5('0x22')](_0x4b0bdf)?JSON[_0xd9c5('0xe')](_0x4b0bdf):_0x4b0bdf);}}_0x419267['on'](_0xd9c5('0x23'),_0x2d90d3);_0x419267['on'](_0xd9c5('0x24'),_0x7cafc6);_0x419267['on'](_0xd9c5('0x25'),_0x4b42da);_0x419267['on'](_0xd9c5('0x11'),_0x486d59);});}; \ No newline at end of file +var _0xd2f7=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','unix','send','data','EOS','Tilde\x20ASR\x20send\x20error','stringify','terminate','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x495543,_0x55ea69){var _0x208538=function(_0x2567f9){while(--_0x2567f9){_0x495543['push'](_0x495543['shift']());}};_0x208538(++_0x55ea69);}(_0xd2f7,0x1cb));var _0x7d2f=function(_0x906f8a,_0x452fbd){_0x906f8a=_0x906f8a-0x0;var _0x2d29ef=_0xd2f7[_0x906f8a];return _0x2d29ef;};'use strict';var BPromise=require(_0x7d2f('0x0'));var _=require(_0x7d2f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7d2f('0x2'));var crypto=require(_0x7d2f('0x3'));var logger=require(_0x7d2f('0x4'))(_0x7d2f('0x5'));module[_0x7d2f('0x6')]=function(_0x462100,_0x3dcc19,_0x5d4d44,_0x2baf9d){return new BPromise(function(_0x4e2213,_0x5e2d4f){logger[_0x7d2f('0x7')]('Tilde\x20URI',_0x2baf9d||_0x7d2f('0x8'));var _0x10401a=new WebSocket(_0x2baf9d||_0x7d2f('0x8'),{'perMessageDeflate':![]});var _0x17141c='';var _0xd33ae5='0';var _0x1fe9b2='1';var _0x57a1d8=_0x7d2f('0x9');function _0x210e45(_0x22e9c7){var _0x3613be=crypto[_0x7d2f('0xa')](_0x7d2f('0xb'));_0x3613be['update'](_0x22e9c7);return _0x3613be['digest']('hex');}function _0x11cb79(){try{logger[_0x7d2f('0x7')]('Open\x20Tilde\x20ASR\x20socket');var _0x209f51=moment()[_0x7d2f('0xc')]();var _0x5190cb=_0x210e45(_0x209f51+_0x3dcc19+_0x5d4d44);_0x10401a[_0x7d2f('0xd')](JSON['stringify']({'appID':_0x3dcc19,'timestamp':_0x209f51,'appKey':_0x5190cb}));var _0x62def2=fs['createReadStream'](_0x462100);_0x62def2['on'](_0x7d2f('0xe'),function(_0x53eee9){_0x10401a['send'](_0x53eee9);});_0x62def2['on']('close',function(){_0x10401a['send'](_0x7d2f('0xf'));});}catch(_0x1990fb){logger['error'](_0x7d2f('0x10'),JSON[_0x7d2f('0x11')](_0x1990fb));_0x10401a[_0x7d2f('0x12')]();}}function _0x581f9d(_0x34a053){try{if(_0x34a053){var _0x2a6030=JSON['parse'](_0x34a053);switch(_0x2a6030['status']){case 0x0:if(_0x2a6030[_0x7d2f('0x13')]){if(_0x2a6030['result'][_0x7d2f('0x14')]){logger[_0x7d2f('0x7')](_0x7d2f('0x15'),JSON[_0x7d2f('0x11')](_0x2a6030['result'][_0x7d2f('0x16')]));_0x17141c=_0x2a6030[_0x7d2f('0x13')][_0x7d2f('0x16')][0x0][_0x7d2f('0x17')];_0xd33ae5=_0x2a6030[_0x7d2f('0x13')][_0x7d2f('0x16')][0x0][_0x7d2f('0x18')];_0x1fe9b2='0';_0x57a1d8=_0x7d2f('0x19');_0x10401a['terminate']();}}break;case 0x1:logger[_0x7d2f('0x7')](_0x7d2f('0x9'));_0x1fe9b2='1';_0x57a1d8=_0x7d2f('0x9');break;case 0x2:logger[_0x7d2f('0x7')](_0x7d2f('0x1a'));_0x1fe9b2='2';_0x57a1d8=_0x7d2f('0x1a');break;case 0x9:logger['info'](_0x7d2f('0x1b'));_0x1fe9b2='9';_0x57a1d8=_0x7d2f('0x1b');break;case 0xa:logger['info'](_0x7d2f('0x1c'));_0x1fe9b2='10';_0x57a1d8='Authentication\x20failed.';break;case 0xb:logger['info'](_0x7d2f('0x1d'));_0x1fe9b2='11';_0x57a1d8='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x2861c6){logger[_0x7d2f('0x1e')](_0x7d2f('0x1f'),JSON['stringify'](_0x2861c6));_0x10401a['terminate']();}}function _0x28f6f5(){logger[_0x7d2f('0x7')](_0x7d2f('0x20'));_0x4e2213({'transcript':_0x17141c,'confidence':_0xd33ae5,'status':_0x1fe9b2,'status_message':_0x57a1d8});}function _0x2ec212(_0x1925bb){logger[_0x7d2f('0x1e')](_0x7d2f('0x21'));if(!_[_0x7d2f('0x22')](_0x1925bb)){logger['error'](_[_0x7d2f('0x23')](_0x1925bb)?JSON[_0x7d2f('0x11')](_0x1925bb):_0x1925bb);}}_0x10401a['on'](_0x7d2f('0x24'),_0x11cb79);_0x10401a['on'](_0x7d2f('0x25'),_0x581f9d);_0x10401a['on'](_0x7d2f('0x26'),_0x28f6f5);_0x10401a['on'](_0x7d2f('0x1e'),_0x2ec212);});}; \ 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 0b76e1f..f161d15 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 _0x9809=['./asr','exports'];(function(_0x4b0249,_0x54cb29){var _0x10271b=function(_0x21c629){while(--_0x21c629){_0x4b0249['push'](_0x4b0249['shift']());}};_0x10271b(++_0x54cb29);}(_0x9809,0x1b2));var _0x9980=function(_0x2391cb,_0x139703){_0x2391cb=_0x2391cb-0x0;var _0x2864bf=_0x9809[_0x2391cb];return _0x2864bf;};var asr=require(_0x9980('0x0'));module[_0x9980('0x1')]={'asr':asr}; \ No newline at end of file +var _0x352e=['./asr','exports'];(function(_0x3397ce,_0xcba97c){var _0x45aa59=function(_0x5f01c8){while(--_0x5f01c8){_0x3397ce['push'](_0x3397ce['shift']());}};_0x45aa59(++_0xcba97c);}(_0x352e,0x1a6));var _0xe352=function(_0x1c255e,_0x15777b){_0x1c255e=_0x1c255e-0x0;var _0x57c3fd=_0x352e[_0x1c255e];return _0x57c3fd;};var asr=require(_0xe352('0x0'));module[_0xe352('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4afb9a2..39f5c1f 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 _0x5044=['inherits','exports','net','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','nextTick'];(function(_0x38b1ab,_0x4349c7){var _0x43809b=function(_0x15866d){while(--_0x15866d){_0x38b1ab['push'](_0x38b1ab['shift']());}};_0x43809b(++_0x4349c7);}(_0x5044,0xc8));var _0x4504=function(_0xa12d71,_0x3894b8){_0xa12d71=_0xa12d71-0x0;var _0x475c73=_0x5044[_0xa12d71];return _0x475c73;};'use strict';var util=require('util');var net=require(_0x4504('0x0'));var EventEmitter=require('events')[_0x4504('0x1')];var AGIError=require(_0x4504('0x2'));var AGIChannel=require(_0x4504('0x3'));var AGIServer=function(_0x4da79c,_0x254de4,_0x3e3c2d){var _0x19f90c=this,_0x4da79c=_0x4da79c||0x11dd,_0x254de4=_0x254de4||_0x4504('0x4'),_0x10b50f=null,_0x40195b=0x0;EventEmitter[_0x4504('0x5')](_0x19f90c);function _0x3df37b(){if(!_0x4da79c){_0x19f90c[_0x4504('0x6')](_0x4504('0x7'),new AGIError(_0x4504('0x8')));return![];}_0x10b50f=net[_0x4504('0x9')]();_0x10b50f['listen'](_0x4da79c,_0x254de4);_0x10b50f['on'](_0x4504('0xa'),function(){_0x19f90c['emit'](_0x4504('0xa'));});_0x10b50f['on'](_0x4504('0xb'),function(_0x1472f7){_0x10b50f[_0x4504('0xc')](function(_0x2498c3,_0x400b53){if(_0x2498c3){_0x19f90c[_0x4504('0x6')](_0x4504('0x7'),new AGIError(_0x4504('0xd'),_0x2498c3));}else if(_0x3e3c2d&&_0x3e3c2d<0x0){_0x19f90c[_0x4504('0x6')](_0x4504('0x7'),new AGIError(_0x4504('0xe')));_0x1472f7[_0x4504('0xf')]();}else if(_0x3e3c2d&&_0x3e3c2d>0x0&&_0x3e3c2d<_0x400b53){_0x40195b+=0x1;_0x19f90c['emit'](_0x4504('0x7'),new AGIError(_0x4504('0x10'),_0x40195b));_0x1472f7['destroy']();}else{var _0x1c7404=new AGIChannel(_0x1472f7);_0x1c7404['on'](_0x4504('0x11'),function(){_0x19f90c[_0x4504('0x6')](_0x4504('0xb'),_0x1c7404);});}});});_0x10b50f['on']('error',function(_0x5f5165){_0x19f90c[_0x4504('0x6')]('error',new AGIError(_0x4504('0xd'),_0x5f5165['code']));});_0x10b50f['on'](_0x4504('0x12'),function(){_0x19f90c[_0x4504('0x6')](_0x4504('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x4504('0x13')](function(){_0x3df37b();});};util[_0x4504('0x14')](AGIServer,EventEmitter);module[_0x4504('0x15')]=function(_0x41a7fa,_0x280edf,_0x209f4f){return new AGIServer(_0x41a7fa,_0x280edf,_0x209f4f);}; \ No newline at end of file +var _0xa8a8=['code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready'];(function(_0x1319e9,_0x34645f){var _0x1f828d=function(_0x132fcb){while(--_0x132fcb){_0x1319e9['push'](_0x1319e9['shift']());}};_0x1f828d(++_0x34645f);}(_0xa8a8,0xec));var _0x8a8a=function(_0x1e6926,_0x2ec0a9){_0x1e6926=_0x1e6926-0x0;var _0x5f4973=_0xa8a8[_0x1e6926];return _0x5f4973;};'use strict';var util=require(_0x8a8a('0x0'));var net=require(_0x8a8a('0x1'));var EventEmitter=require(_0x8a8a('0x2'))[_0x8a8a('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x8a8a('0x4'));var AGIServer=function(_0x3296a6,_0xf11a08,_0x3ed1de){var _0x45515d=this,_0x3296a6=_0x3296a6||0x11dd,_0xf11a08=_0xf11a08||_0x8a8a('0x5'),_0x12db82=null,_0x2e8193=0x0;EventEmitter[_0x8a8a('0x6')](_0x45515d);function _0x8e7aa0(){if(!_0x3296a6){_0x45515d[_0x8a8a('0x7')](_0x8a8a('0x8'),new AGIError(_0x8a8a('0x9')));return![];}_0x12db82=net['createServer']();_0x12db82['listen'](_0x3296a6,_0xf11a08);_0x12db82['on'](_0x8a8a('0xa'),function(){_0x45515d['emit'](_0x8a8a('0xa'));});_0x12db82['on'](_0x8a8a('0xb'),function(_0x532621){_0x12db82[_0x8a8a('0xc')](function(_0x76b586,_0xb13fca){if(_0x76b586){_0x45515d['emit'](_0x8a8a('0x8'),new AGIError(_0x8a8a('0xd'),_0x76b586));}else if(_0x3ed1de&&_0x3ed1de<0x0){_0x45515d[_0x8a8a('0x7')](_0x8a8a('0x8'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x532621[_0x8a8a('0xe')]();}else if(_0x3ed1de&&_0x3ed1de>0x0&&_0x3ed1de<_0xb13fca){_0x2e8193+=0x1;_0x45515d['emit'](_0x8a8a('0x8'),new AGIError(_0x8a8a('0xf'),_0x2e8193));_0x532621[_0x8a8a('0xe')]();}else{var _0x2f6e33=new AGIChannel(_0x532621);_0x2f6e33['on'](_0x8a8a('0x10'),function(){_0x45515d[_0x8a8a('0x7')](_0x8a8a('0xb'),_0x2f6e33);});}});});_0x12db82['on']('error',function(_0x1ed3be){_0x45515d['emit'](_0x8a8a('0x8'),new AGIError(_0x8a8a('0xd'),_0x1ed3be[_0x8a8a('0x11')]));});_0x12db82['on'](_0x8a8a('0x12'),function(){_0x45515d[_0x8a8a('0x7')]('close',new AGIError(_0x8a8a('0x13')));});}process[_0x8a8a('0x14')](function(){_0x8e7aa0();});};util[_0x8a8a('0x15')](AGIServer,EventEmitter);module[_0x8a8a('0x16')]=function(_0x299827,_0x22e611,_0x4d7a45){return new AGIServer(_0x299827,_0x22e611,_0x4d7a45);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 6b9420c..d99af7a 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 _0xfeaf=['body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','en-US','tildeASR','appid','appsecret','includes','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','format','split','replaceAll','extra','getAndSetVariable','result','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','list_id','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','grammar','RECOG_CONFIDENCE()','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','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','createSquareMessage','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','DIAL','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','generate','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','extension','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','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','math\x20%s','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','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','sms_account_id','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\x20CALLY\x20SQUARE','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','127.0.0.1','Executed\x20command\x20%s\x20%s','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','unlink','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','moment','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunk','getTrunkById','getSoundById','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','getSoundPath','%s/sounds/converted/%s','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','priority','accountcode','file','createCmContact','isEmpty','isNil','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agent','agentPause','error','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','toUpperCase'];(function(_0xb60643,_0x5a28f0){var _0x2375d3=function(_0x5d98a9){while(--_0x5d98a9){_0xb60643['push'](_0xb60643['shift']());}};_0x2375d3(++_0x5a28f0);}(_0xfeaf,0x15b));var _0xffea=function(_0x1c8c57,_0x1cb87f){_0x1c8c57=_0x1c8c57-0x0;var _0x14365=_0xfeaf[_0x1c8c57];return _0x14365;};'use strict';var fs=require('fs');var path=require(_0xffea('0x0'));var util=require(_0xffea('0x1'));var _=require(_0xffea('0x2'));var sh=require(_0xffea('0x3'));var odbc=require(_0xffea('0x4'))();var rs=require('randomstring');var moment=require(_0xffea('0x5'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0xffea('0x6'))(_0xffea('0x7'));var config=require(_0xffea('0x8'));var scripts=require('./scripts');var FILES_PATH=_0xffea('0x9');var recursiveMapAttributes=[_0xffea('0xa'),_0xffea('0xb')];var verticesWithRetry=[_0xffea('0xc'),_0xffea('0xd'),_0xffea('0xe')];var AGIVertices=function(_0x1f11d7,_0x168efc,_0x261313){this[_0xffea('0xf')]=_0x1f11d7;this['rpc']=_0x168efc;this[_0xffea('0x10')]=_0x261313;};AGIVertices[_0xffea('0x11')][_0xffea('0x12')]=function(_0x1d72d4,_0x3ae79f){this[_0xffea('0x13')][_0xffea('0x14')](_0x1d72d4)[_0xffea('0x15')](function(_0x108004){_0x3ae79f(null,_0x108004?_0x108004[_0xffea('0x16')]:![]);})[_0xffea('0x17')](function(_0x3084e5){_0x3ae79f(_0x3084e5);});};AGIVertices[_0xffea('0x11')][_0xffea('0x18')]=function(_0x453e25,_0x1d0a9d){this[_0xffea('0x13')]['getVoiceQueueById'](_0x453e25)[_0xffea('0x15')](function(_0x4d15d3){_0x1d0a9d(null,_0x4d15d3?_0x4d15d3[_0xffea('0x16')]:![]);})['catch'](function(_0x2de96a){_0x1d0a9d(_0x2de96a);});};AGIVertices[_0xffea('0x11')][_0xffea('0x19')]=function(_0x13d768,_0x151246){this[_0xffea('0x13')][_0xffea('0x1a')](_0x13d768)[_0xffea('0x15')](function(_0x47894a){_0x151246(null,_0x47894a?_0x47894a['name']:![]);})['catch'](function(_0x482a38){_0x151246(_0x482a38);});};AGIVertices['prototype'][_0xffea('0x1b')]=function(_0x18d47b,_0x141c88){this[_0xffea('0x13')]['getSquareOdbcById'](_0x18d47b)['then'](function(_0x31f9e3){_0x141c88(null,_0x31f9e3?_0x31f9e3[_0xffea('0x1c')]:![]);})[_0xffea('0x17')](function(_0x4e7b79){_0x141c88(_0x4e7b79);});};AGIVertices[_0xffea('0x11')]['getUser']=function(_0x421745,_0x44b3ed){this[_0xffea('0x13')][_0xffea('0x1d')](_0x421745)[_0xffea('0x15')](function(_0x1133cb){_0x44b3ed(null,_0x1133cb?_0x1133cb[_0xffea('0x16')]:![]);})['catch'](function(_0x393b01){_0x44b3ed(_0x393b01);});};AGIVertices[_0xffea('0x11')][_0xffea('0x1e')]=function(_0x23ffe1,_0x35f435){this[_0xffea('0x13')][_0xffea('0x1f')](_0x23ffe1)[_0xffea('0x15')](function(_0x352f46){_0x35f435(null,_0x352f46?_0x352f46[_0xffea('0x16')]:![]);})['catch'](function(_0x4d4139){_0x35f435(_0x4d4139);});};AGIVertices['prototype']['getSound']=function(_0x3fcfef,_0x1aa84c){var _0x160ea6=this;this[_0xffea('0x13')][_0xffea('0x20')](_0x3fcfef)[_0xffea('0x15')](function(_0x1faeff){_0x1aa84c(null,_0x1faeff?_0x160ea6['getSoundPath'](_0x1faeff[_0xffea('0x21')]):![]);})[_0xffea('0x17')](function(_0x511441){_0x1aa84c(_0x511441);});};AGIVertices['prototype']['getMailAccount']=function(_0x5774a4,_0x1730b1){this[_0xffea('0x13')][_0xffea('0x22')](_0x5774a4)[_0xffea('0x15')](function(_0x173d9a){_0x1730b1(null,_0x173d9a?_0x173d9a:![]);})[_0xffea('0x17')](function(_0x99037){_0x1730b1(_0x99037);});};AGIVertices[_0xffea('0x11')]['sendMailMessage']=function(_0x178170,_0x99b3a3,_0x22e439){this['mailRpc'][_0xffea('0x23')](_0x178170,_0x99b3a3)[_0xffea('0x15')](function(){_0x22e439(null);})['catch'](function(_0x1384e4){_0x22e439(_0x1384e4);});};AGIVertices[_0xffea('0x11')][_0xffea('0x24')]=function(_0x7a05de,_0x3ca7eb){this['rpc'][_0xffea('0x25')](_0x7a05de)[_0xffea('0x15')](function(_0x335821){if(_0x335821){if(_0x335821[_0xffea('0x26')]){_0x3ca7eb(null,[_0x335821['interval']]);}else{_0x3ca7eb(null,_['map'](_0x335821['Intervals'],'interval'));}}else{_0x3ca7eb(null,![]);}})[_0xffea('0x17')](function(_0x20273d){_0x3ca7eb(_0x20273d);});};AGIVertices['prototype'][_0xffea('0x27')]=function(_0x31a669){return util['format'](_0xffea('0x28'),FILES_PATH,_0x31a669);};AGIVertices[_0xffea('0x11')]['getQueryOdbc']=function(_0x5cea01,_0x4d68aa,_0x1e8a68){odbc['open'](_0x5cea01,function(_0x19ddb1){if(_0x19ddb1){logger['error'](_0xffea('0x29'),_0x19ddb1);_0x1e8a68(_0x19ddb1);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xffea('0x2a')](_0x4d68aa,function(_0x1ae95f,_0x5d378d){if(_0x1ae95f){logger[_0xffea('0x2b')](_0xffea('0x2c'),_0x4d68aa);_0x1e8a68(_0x1ae95f);}else{logger[_0xffea('0x2b')](_0xffea('0x2d'),_0x4d68aa);odbc[_0xffea('0x2e')](function(_0x2b7e8d){if(_0x2b7e8d){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x2b7e8d);}_0x1e8a68(null,_0x5d378d);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x47a1e0,_0x16655a){this[_0xffea('0x13')][_0xffea('0x2f')](_0x47a1e0)[_0xffea('0x15')](function(_0xaf0ca3){_0x16655a(null,_0xaf0ca3?_0xaf0ca3:![]);})[_0xffea('0x17')](function(_0x3871e3){_0x16655a(_0x3871e3);});};AGIVertices[_0xffea('0x11')][_0xffea('0x30')]=function(_0x1b21df,_0x555f0f){this['rpc'][_0xffea('0x30')](_0x1b21df)['then'](function(_0x58db57){_0x555f0f(null,_0x58db57);})[_0xffea('0x17')](function(_0x18a836){_0x555f0f(_0x18a836);});};AGIVertices[_0xffea('0x11')][_0xffea('0x31')]=function(_0x327eee,_0xabda5e,_0x2ccc28){this['rpc'][_0xffea('0x31')]({'uniqueid':this['channel'][_0xffea('0x32')],'node':_0x327eee[_0xffea('0x33')],'application':_0x327eee['agicommand'],'data':_0xabda5e||null,'project_name':this[_0xffea('0xf')][_0xffea('0x34')],'callerid':this[_0xffea('0xf')][_0xffea('0x35')]})[_0xffea('0x15')](function(_0x1a9ee1){if(_0x2ccc28){_0x2ccc28(null,_0x1a9ee1);}})[_0xffea('0x17')](function(_0x43122a){if(_0x2ccc28){_0x2ccc28(_0x43122a);}});};AGIVertices[_0xffea('0x11')][_0xffea('0x36')]=function(_0x91bb17,_0x19145a,_0x37a50c,_0x422356){this[_0xffea('0x13')][_0xffea('0x36')]({'uniqueid':this['channel'][_0xffea('0x32')],'callerid':this[_0xffea('0xf')]['callerid'],'calleridname':this[_0xffea('0xf')]['calleridname'],'context':this['channel']['context'],'extension':this['channel']['extension'],'priority':this[_0xffea('0xf')][_0xffea('0x37')],'accountcode':this[_0xffea('0xf')][_0xffea('0x38')],'dnid':this[_0xffea('0xf')]['dnid'],'projectName':this[_0xffea('0xf')]['arg_1'],'saveName':_0x19145a,'filename':_0x91bb17[_0xffea('0x39')]||_0x19145a,'savePath':_0x37a50c})[_0xffea('0x15')](function(_0x5de010){_0x422356(null,_0x5de010);})['catch'](function(_0x3a8ae9){_0x422356(_0x3a8ae9);});};AGIVertices[_0xffea('0x11')]['createSquareMessage']=function(_0x30fce3,_0x43dce5,_0x203999){this[_0xffea('0x13')]['createSquareMessage']({'uniqueid':this['channel'][_0xffea('0x32')],'body':_0x30fce3,'direction':_0x43dce5})[_0xffea('0x15')](function(_0x2a288b){if(_0x203999){_0x203999(null,_0x2a288b);}})[_0xffea('0x17')](function(_0x153549){if(_0x203999){_0x203999(_0x153549);}});};AGIVertices[_0xffea('0x11')]['createCmContact']=function(_0x152fdb,_0x5de3b0){this['rpc'][_0xffea('0x3a')]({'firstName':_[_0xffea('0x3b')](_0x152fdb[_0xffea('0x16')])||_[_0xffea('0x3c')](_0x152fdb[_0xffea('0x16')])?'callback_'+Math[_0xffea('0x3d')]():_0x152fdb[_0xffea('0x16')],'lastName':_['isEmpty'](_0x152fdb[_0xffea('0x3e')])||_[_0xffea('0x3c')](_0x152fdb[_0xffea('0x3e')])?null:_0x152fdb[_0xffea('0x3e')],'phone':_0x152fdb[_0xffea('0x3f')],'ListId':_0x152fdb['list_id'],'scheduledat':_0x152fdb[_0xffea('0x40')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xffea('0x41'),'description':_0xffea('0x42')+_0x152fdb[_0xffea('0x40')][_0xffea('0x43')](),'priority':_0x152fdb['callback_priority']})['then'](function(_0x5a46e3){_0x5de3b0(null,_0x5a46e3);})['catch'](function(_0x566e01){_0x5de3b0(_0x566e01);});};AGIVertices['prototype'][_0xffea('0x44')]=function(_0x29c242,_0x49a53c){this[_0xffea('0x13')][_0xffea('0x45')](_0x29c242)[_0xffea('0x15')](function(_0x2f432e){_0x49a53c(null,_0x2f432e?_0x2f432e[_0xffea('0x16')]:![]);})[_0xffea('0x17')](function(_0x2ea59b){_0x49a53c(_0x2ea59b);});};AGIVertices[_0xffea('0x11')]['agentPause']=function(_0xf79eb4,_0x3d66d3,_0x3b0f4e){var _0x4c0c9b={'role':_0xffea('0x46')};_0x4c0c9b[_0xf79eb4]=this[_0xffea('0xf')][_0xffea('0x35')];this['rpc'][_0xffea('0x47')](_0x4c0c9b,_0x3d66d3,this[_0xffea('0xf')][_0xffea('0x32')])[_0xffea('0x15')](function(_0x460b37){_0x3b0f4e(null,_[_0xffea('0x3c')](_0x460b37)?![]:!![]);})[_0xffea('0x17')](function(_0x41b51c){logger[_0xffea('0x48')](_0x41b51c);_0x3b0f4e(null,![]);});};AGIVertices[_0xffea('0x11')]['agentUnpause']=function(_0x5c30ba,_0x3c3374){var _0xa1e7a2={'role':_0xffea('0x46')};_0xa1e7a2[_0x5c30ba]=this[_0xffea('0xf')]['callerid'];this[_0xffea('0x13')][_0xffea('0x49')](_0xa1e7a2)[_0xffea('0x15')](function(_0x444528){_0x3c3374(null,_[_0xffea('0x3c')](_0x444528)?![]:!![]);})[_0xffea('0x17')](function(_0x4d38a2){logger[_0xffea('0x48')](_0x4d38a2);_0x3c3374(null,![]);});};AGIVertices[_0xffea('0x11')]['agentLogout']=function(_0x2d6121,_0xa23064){var _0x22a4a5={'role':_0xffea('0x46')};_0x22a4a5[_0x2d6121]=this[_0xffea('0xf')][_0xffea('0x35')];this[_0xffea('0x13')][_0xffea('0x4a')](_0x22a4a5)[_0xffea('0x15')](function(_0x2d7310){_0xa23064(null,_[_0xffea('0x3c')](_0x2d7310)?![]:!![]);})['catch'](function(_0x3a3b87){logger[_0xffea('0x48')](_0x3a3b87);_0xa23064(null,![]);});};AGIVertices['prototype'][_0xffea('0x4b')]=function(_0x5f2d55,_0x109aec){var _0x2adb0f={'role':_0xffea('0x46')};_0x2adb0f[_0x5f2d55]=this[_0xffea('0xf')][_0xffea('0x35')];var _0x532fee=_0x5f2d55!=_0xffea('0x4c')?util['format'](_0xffea('0x4d'),_0xffea('0x4e'),this['channel'][_0xffea('0x35')]):undefined;this[_0xffea('0x13')]['agentLogin'](_0x2adb0f,_0x532fee)['then'](function(_0x15eea5){_0x109aec(null,_[_0xffea('0x3c')](_0x15eea5)?![]:!![]);})[_0xffea('0x17')](function(_0x5755f2){logger['error'](_0x5755f2);_0x109aec(null,![]);});};AGIVertices[_0xffea('0x11')]['shellCommand']=function(_0x1a2f31,_0x3f845b){sh[_0xffea('0x4f')](_['trim'](_0x1a2f31),function(_0x3a69fa,_0x56f091){var _0x2d4859=_0x56f091[_0xffea('0x50')](/(\r\n|\n|\r)/gm,'');_0x3f845b(null,_0x2d4859);});};AGIVertices['prototype'][_0xffea('0x51')]=function(_0x345170,_0x152c95){scripts['googleCloudTTS'](_0x345170[_0xffea('0x52')],_0x345170[_0xffea('0x53')]||'text',_0x345170[_0xffea('0x54')],_0x345170[_0xffea('0x55')]||'en-US',_0x345170[_0xffea('0x56')]||_0xffea('0x57'),_0x345170['audioEncoding']||_0xffea('0x58'))[_0xffea('0x15')](function(_0x436aa4){_0x152c95(null,_0x436aa4);})[_0xffea('0x17')](function(_0x26269e){_0x152c95(_0x26269e);});};AGIVertices[_0xffea('0x11')]['googleTTS']=function(_0x597c36,_0x55d820){scripts[_0xffea('0x59')](_0x597c36[_0xffea('0x54')],_0x597c36[_0xffea('0x5a')]||'en',0x1)['then'](function(_0x325e09){_0x55d820(null,_0x325e09);})[_0xffea('0x17')](function(_0x20cfb0){_0x55d820(_0x20cfb0);});};AGIVertices['prototype'][_0xffea('0x5b')]=function(_0x4ef279,_0x3093d7){var _0x349457={'uri':_0x4ef279[_0xffea('0x5c')],'method':_0x4ef279[_0xffea('0x5d')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4ef279[_0xffea('0x5e')])===_0xffea('0x5f')&&parseInt(_0x4ef279[_0xffea('0x5e')])>=0x1?parseInt(_0x4ef279[_0xffea('0x5e')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xffea('0x60'),'PUT'],_0x349457[_0xffea('0x5d')][_0xffea('0x61')]())){try{_0x349457[_0xffea('0x62')]=_0x4ef279[_0xffea('0xb')]?JSON[_0xffea('0x63')](_0x4ef279[_0xffea('0xb')]):{};}catch(_0xdda6af){logger[_0xffea('0x48')](_0xffea('0x64'),_0xdda6af);}}try{_0x349457['headers']=_0x4ef279[_0xffea('0xa')]?JSON['parse'](_0x4ef279[_0xffea('0xa')]):{};}catch(_0x21cf0d){logger['error'](_0xffea('0x65'),_0x21cf0d);}if(_0x4ef279[_0xffea('0x66')]){try{var _0x466a81=require(_0x4ef279['computedVariables'])[_0xffea('0x67')](this,_0x349457);_0x349457['uri']=Mustache[_0xffea('0x68')](_0x4ef279[_0xffea('0x5c')],_0x466a81,{},['$$','$$']);if(_0x349457[_0xffea('0x69')]){_0x349457[_0xffea('0x69')]=JSON[_0xffea('0x63')](Mustache[_0xffea('0x68')](JSON[_0xffea('0x6a')](_0x349457[_0xffea('0x69')]),_0x466a81,{},['$$','$$']));}if(_0x349457[_0xffea('0x62')]){_0x349457[_0xffea('0x62')]=JSON[_0xffea('0x63')](Mustache['render'](JSON[_0xffea('0x6a')](_0x349457['body']),_0x466a81,{},['$$','$$']));}}catch(_0x49f25b){logger[_0xffea('0x48')](_0xffea('0x6b'),_0x49f25b);}}rp(_0x349457)[_0xffea('0x15')](function(_0x24df54){var _0x44dfdb={'statusCode':_0x24df54[_0xffea('0x6c')]||0xc8,'statusMessage':_0x24df54[_0xffea('0x6d')]||'OK','headers':_0x24df54[_0xffea('0x69')]||{},'body':_0x24df54[_0xffea('0x62')]||{}};_0x3093d7(null,_0x44dfdb);})[_0xffea('0x17')](function(_0x2fc8d0){var _0x14310d={'statusCode':_0x2fc8d0[_0xffea('0x6c')]||0x1f4,'statusMessage':_0x2fc8d0[_0xffea('0x6e')]||_0xffea('0x6f'),'headers':_0x2fc8d0[_0xffea('0x70')]['headers']||{},'body':_0x2fc8d0[_0xffea('0x70')][_0xffea('0x62')]||{}};_0x3093d7(null,_0x14310d);});};AGIVertices[_0xffea('0x11')][_0xffea('0x71')]=function(_0x1da53a,_0x255e76){scripts[_0xffea('0x71')](this['channel'][_0xffea('0x32')],_0x1da53a[_0xffea('0x72')],_0x1da53a[_0xffea('0x54')],_0x1da53a[_0xffea('0x73')]||'en')[_0xffea('0x15')](function(_0x307287){_0x255e76(null,_0x307287);})[_0xffea('0x17')](function(_0x5c8474){_0x255e76(_0x5c8474);});};AGIVertices['prototype'][_0xffea('0x74')]=function(_0x122fd8,_0x3569c3){scripts['sestekNDA'](this[_0xffea('0xf')],_0x122fd8)[_0xffea('0x15')](function(_0x318844){_0x3569c3(null,_0x318844);})['catch'](function(_0x4b0620){_0x3569c3(_0x4b0620);});};AGIVertices[_0xffea('0x11')][_0xffea('0x75')]=function(_0x23d1e8,_0x2c7fa0){scripts['ispeechTTS'](_0x23d1e8['key'],_0x23d1e8[_0xffea('0x54')],_0x23d1e8[_0xffea('0x76')]||'en-US',_0x23d1e8[_0xffea('0x77')])[_0xffea('0x15')](function(_0x5c0961){_0x2c7fa0(null,_0x5c0961);})[_0xffea('0x17')](function(_0x485cdf){_0x2c7fa0(_0x485cdf);});};AGIVertices[_0xffea('0x11')][_0xffea('0x78')]=function(_0x32541f,_0x1d92ed,_0x511a0f){scripts[_0xffea('0x78')](_0x1d92ed,_0x32541f[_0xffea('0x72')],_0x32541f[_0xffea('0x79')]||'en-US',this[_0xffea('0x7a')](_0x32541f[_0xffea('0x7b')])?_0x32541f[_0xffea('0x7b')]:undefined)[_0xffea('0x15')](function(_0x194bff){_0x511a0f(null,_0x194bff);})[_0xffea('0x17')](function(_0x4b3ba6){_0x511a0f(_0x4b3ba6);});};AGIVertices['prototype']['awsPolly']=function(_0x3aed16,_0x286a38){scripts[_0xffea('0x7c')](_0x3aed16[_0xffea('0x7d')],_0x3aed16[_0xffea('0x7e')],_0x3aed16[_0xffea('0x7f')],_0x3aed16[_0xffea('0x80')]||_0xffea('0x81'),_0x3aed16[_0xffea('0x54')],_0x3aed16[_0xffea('0x82')]||_0xffea('0x54'))[_0xffea('0x15')](function(_0xcc877f){_0x286a38(null,_0xcc877f);})['catch'](function(_0x4da81d){_0x286a38(_0x4da81d);});};AGIVertices[_0xffea('0x11')][_0xffea('0x83')]=function(_0x3387bd,_0x50a3f5){scripts['awsLex'](this[_0xffea('0xf')][_0xffea('0x32')],_0x3387bd[_0xffea('0x7d')],_0x3387bd['aws_secret_access_key'],_0x3387bd[_0xffea('0x84')],_0x3387bd['text'],_0x3387bd['aws_bot_name'])[_0xffea('0x15')](function(_0xc97b1e){_0x50a3f5(null,_0xc97b1e);})[_0xffea('0x17')](function(_0x5e731b){_0x50a3f5(_0x5e731b);});};AGIVertices[_0xffea('0x11')][_0xffea('0x85')]=function(_0x50eb59,_0x4c50af,_0x413de2){scripts['googleASR'](_0x4c50af,_0x50eb59['key'],_0x50eb59['google_asr_language']||_0xffea('0x86'))['then'](function(_0x53341d){_0x413de2(null,_0x53341d);})[_0xffea('0x17')](function(_0x21e549){_0x413de2(_0x21e549);});};AGIVertices[_0xffea('0x11')]['tildeASR']=function(_0x5ab218,_0x40da41,_0xf0eba2){scripts[_0xffea('0x87')](_0x40da41,_0x5ab218[_0xffea('0x88')],_0x5ab218[_0xffea('0x89')],_0x5ab218['uri'])['then'](function(_0x464438){_0xf0eba2(null,_0x464438);})[_0xffea('0x17')](function(_0x18522a){_0xf0eba2(_0x18522a);});};AGIVertices[_0xffea('0x11')]['clear']=function(_0x1c6878){var _0x2a7c20=_[_0xffea('0x8a')](verticesWithRetry,_0x1c6878[_0xffea('0x8b')])?_0x1c6878:_[_0xffea('0x8c')](_0x1c6878);for(var _0x18eb07 in _0x2a7c20){if(_0x2a7c20[_0xffea('0x8d')](_0x18eb07)){if(_0x2a7c20[_0x18eb07]&&_[_0xffea('0x8e')](_0x2a7c20[_0x18eb07])){if(_['includes'](recursiveMapAttributes,_0x18eb07)){_0x2a7c20[_0x18eb07]=this[_0xffea('0x8f')](_0x2a7c20[_0x18eb07]);}else{_0x2a7c20[_0x18eb07]=this[_0xffea('0x90')](_0x2a7c20[_0x18eb07]);}}}}return _0x2a7c20;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x5b4140){for(var _0x288254 in _0x5b4140){if(_0x5b4140[_0xffea('0x8d')](_0x288254)){if(_[_0xffea('0x91')](_0x5b4140[_0x288254])){this[_0xffea('0x92')](_0x5b4140[_0x288254]);}else if(_[_0xffea('0x93')](_0x5b4140[_0x288254])){for(var _0x84cf6b=0x0;_0x84cf6b<_0x5b4140[_0x288254][_0xffea('0x94')];_0x84cf6b++){this[_0xffea('0x92')](_0x5b4140[_0x288254][_0x84cf6b]);}}else if(_['isString'](_0x5b4140[_0x288254])){_0x5b4140[_0x288254]=this['replaceAllVariables'](_0x5b4140[_0x288254]);}}}};AGIVertices['prototype'][_0xffea('0x95')]=function(_0x1e9913,_0x4a4bf9){for(var _0x16e78e in _0x1e9913){if(_0x1e9913[_0xffea('0x8d')](_0x16e78e)){if(_[_0xffea('0x91')](_0x1e9913[_0x16e78e])){if(!_['isEmpty'](_0x1e9913[_0x16e78e])){this[_0xffea('0x95')](_0x1e9913[_0x16e78e],util['format'](_0xffea('0x96'),_0x4a4bf9,_0x16e78e));}}else if(_[_0xffea('0x93')](_0x1e9913[_0x16e78e])){for(var _0x5d243d=0x0;_0x5d243d<_0x1e9913[_0x16e78e][_0xffea('0x94')];_0x5d243d++){this[_0xffea('0x95')](_0x1e9913[_0x16e78e][_0x5d243d],util['format'](_0xffea('0x96'),_0x4a4bf9,_0x16e78e+'['+_0x5d243d+']'));}}else{if(!_[_0xffea('0x3c')](_0x1e9913[_0x16e78e])){this[_0xffea('0xf')][_0xffea('0x97')](util[_0xffea('0x98')](_0xffea('0x96'),_0x4a4bf9,_0x16e78e),_0x1e9913[_0x16e78e]);}}}}};AGIVertices['prototype'][_0xffea('0x8f')]=function(_0x125c52){try{var _0x4c2c93=JSON[_0xffea('0x63')](_0x125c52);this[_0xffea('0x92')](_0x4c2c93);return JSON[_0xffea('0x6a')](_0x4c2c93);}catch(_0x5142d7){return this[_0xffea('0x90')](_0x125c52);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x1ced84){var _0x27d75c=_0x1ced84[_0xffea('0x99')]('{');for(var _0x304411=0x1;_0x304411<_0x27d75c[_0xffea('0x94')];_0x304411+=0x1){var _0x1532e2=_0x27d75c[_0x304411][_0xffea('0x99')]('}');if(_0x1532e2['length']>0x1){_0x1ced84=_0x1ced84[_0xffea('0x9a')]('{'+_0x1532e2[0x0]+'}',this[_0xffea('0xf')]['getVariable'](_0x1532e2[0x0])[_0xffea('0x9b')]||_0x1532e2[0x0]);}}if(_0x27d75c[_0xffea('0x94')]===0x1){return _0x1ced84['toString']();}return this[_0xffea('0x90')](_0x1ced84);};AGIVertices[_0xffea('0x11')][_0xffea('0x9c')]=function(_0x47a8cd,_0x1192b9){var _0x9339e9=this[_0xffea('0xf')][_0xffea('0x12')](_0x47a8cd);if(_0x9339e9[_0xffea('0x9d')]===-0x1){return _0x9339e9;}logger[_0xffea('0x2b')](util[_0xffea('0x98')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1192b9,_0x9339e9[_0xffea('0x9b')]));return this[_0xffea('0xf')][_0xffea('0x97')](_0x1192b9,_0x9339e9[_0xffea('0x9b')]);};AGIVertices[_0xffea('0x11')][_0xffea('0x7a')]=function(_0x3b8bc1){return _0x3b8bc1&&_0x3b8bc1!=='0'&&_0x3b8bc1!=='-1'&&_0x3b8bc1!=='';};AGIVertices[_0xffea('0x11')]['maxRetry']=function(_0x556611){this[_0xffea('0x31')][_0xffea('0x67')](this,_0x556611,'-');_0x556611['retry']=_0x556611[_0xffea('0x9e')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xffea('0x7')]=function(_0x2db1ef){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x9f'),_0x2db1ef[_0xffea('0x33')]));return this[_0xffea('0xf')][_0xffea('0x7')]([_0x2db1ef['command'],_0x2db1ef[_0xffea('0xa0')]]);};AGIVertices[_0xffea('0x11')][_0xffea('0xa1')]=function(_0x16be6c){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0xa2'),_0x16be6c[_0xffea('0x33')]));if(this['isConfigured'](_0x16be6c[_0xffea('0x5e')])){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0xa3'),_0x16be6c[_0xffea('0x5e')]));var _0x1cb509=this[_0xffea('0xf')]['wait'](_0x16be6c[_0xffea('0x5e')]);if(_0x1cb509[_0xffea('0x9d')]===-0x1){return _0x1cb509;}}return this[_0xffea('0xf')]['answer']();};AGIVertices[_0xffea('0x11')][_0xffea('0x41')]=function(_0x5b707e){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0xa4'),_0x5b707e[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x5b707e['list_id'])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x5b707e,'no\x20list\x20selected');}_0x5b707e[_0xffea('0x40')]=moment();if(this[_0xffea('0x7a')](_0x5b707e[_0xffea('0xa5')])){_0x5b707e['scheduledAt']=moment()['add'](_0x5b707e[_0xffea('0xa5')],'minutes');}if(!this[_0xffea('0x7a')](_0x5b707e[_0xffea('0xa6')])){_0x5b707e[_0xffea('0xa6')]=0x2;}this[_0xffea('0x3a')][_0xffea('0x67')](this,_0x5b707e);return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0xa8'),_0x5b707e[_0xffea('0x3f')],_0x5b707e[_0xffea('0xa9')],_0x5b707e[_0xffea('0x40')]));};AGIVertices['prototype']['custom_app']=function(_0x50d147){logger[_0xffea('0x2b')](util['format'](_0xffea('0xaa'),_0x50d147['label']));var _0x248f40=this['channel'][_0xffea('0x4f')](_0x50d147[_0xffea('0xab')],_0x50d147[_0xffea('0x70')]);if(_0x248f40[_0xffea('0x9d')]===-0x1){return _0x248f40;}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')]('Executed\x20command\x20%s\x20%s',_0x50d147[_0xffea('0xab')],_0x50d147[_0xffea('0x70')]));};AGIVertices['prototype'][_0xffea('0xac')]=function(_0xb55cd2){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0xad'),_0xb55cd2[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0xb55cd2[_0xffea('0x54')])){return this[_0xffea('0xf')][_0xffea('0xa7')]('no\x20text\x20configured');}var _0x175694='\x22'+_0xb55cd2[_0xffea('0x54')]+'\x22';if(this[_0xffea('0x7a')](_0xb55cd2[_0xffea('0x70')])){_0x175694+=','+_0xb55cd2[_0xffea('0x70')];}var _0x3e8b45=this['channel']['exec'](_0xffea('0xae'),_0x175694);if(_0x3e8b45[_0xffea('0x9d')]===-0x1){return _0x3e8b45;}return this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')](_0xffea('0xaf'),_0x175694));};AGIVertices[_0xffea('0x11')][_0xffea('0xb0')]=function(_0x207be8){logger['info'](util['format'](_0xffea('0xb1'),_0x207be8['label']));if(!this[_0xffea('0x7a')](_0x207be8[_0xffea('0x54')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0xb2'));}var _0x50b9fd='\x22'+_0x207be8['text']+'\x22';if(this[_0xffea('0x7a')](_0x207be8[_0xffea('0x70')])){_0x50b9fd+=','+_0x207be8[_0xffea('0x70')];}var _0x337cf4=this['channel']['exec'](_0xffea('0xae'),_0x50b9fd);if(_0x337cf4[_0xffea('0x9d')]===-0x1){return _0x337cf4;}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0xaf'),_0x50b9fd));};AGIVertices[_0xffea('0x11')]['lumenvoxasr']=function(_0x44ae4e){logger['info'](util[_0xffea('0x98')](_0xffea('0xb3'),_0x44ae4e[_0xffea('0x33')]));if(!this['isConfigured'](_0x44ae4e['grammar'])){return this['channel'][_0xffea('0xa7')](_0xffea('0xb4'));}var _0x580376=_0x44ae4e['grammar'];if(this[_0xffea('0x7a')](_0x44ae4e[_0xffea('0x70')])){_0x580376+=','+_0x44ae4e['options'];}var _0x7f0209=this[_0xffea('0xf')]['exec'](_0xffea('0xb5'),_0x580376);if(_0x7f0209[_0xffea('0x9d')]===-0x1){return _0x7f0209;}var _0x14c888=this[_0xffea('0x9c')]('RECOG_CONFIDENCE()',_0xffea('0xb6'));if(_0x14c888['result']===-0x1){return _0x14c888;}var _0x2ddbb7=this[_0xffea('0x9c')](_0xffea('0xb7'),_0xffea('0xb8'));if(_0x2ddbb7[_0xffea('0x9d')]===-0x1){return _0x2ddbb7;}var _0x1cbc86=this[_0xffea('0x9c')](_0xffea('0xb9'),_0xffea('0xba'));if(_0x1cbc86['result']===-0x1){return _0x1cbc86;}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')]('Executed\x20command\x20MRCPRecog\x20%s',_0x580376));};AGIVertices['prototype']['sestekasr']=function(_0x459a09){logger['info'](util[_0xffea('0x98')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x459a09['label']));if(!this[_0xffea('0x7a')](_0x459a09[_0xffea('0xbb')])){return this[_0xffea('0xf')][_0xffea('0xa7')]('no\x20grammar\x20configured');}var _0x661441=_0x459a09[_0xffea('0xbb')];if(this['isConfigured'](_0x459a09[_0xffea('0x70')])){_0x661441+=','+_0x459a09[_0xffea('0x70')];}var _0x2f4622=this[_0xffea('0xf')][_0xffea('0x4f')](_0xffea('0xb5'),_0x661441);if(_0x2f4622[_0xffea('0x9d')]===-0x1){return _0x2f4622;}var _0x325bb1=this[_0xffea('0x9c')](_0xffea('0xbc'),_0xffea('0xbd'));if(_0x325bb1[_0xffea('0x9d')]===-0x1){return _0x325bb1;}var _0xf66537=this[_0xffea('0x9c')](_0xffea('0xb7'),_0xffea('0xbe'));if(_0xf66537['result']===-0x1){return _0xf66537;}var _0x580294=this['getAndSetVariable'](_0xffea('0xb9'),_0xffea('0xbf'));if(_0x580294[_0xffea('0x9d')]===-0x1){return _0x580294;}return this['channel'][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0xc0'),_0x661441));};AGIVertices[_0xffea('0x11')][_0xffea('0xc1')]=function(_0x18114d){logger[_0xffea('0x2b')](util['format'](_0xffea('0xc2'),_0x18114d[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x18114d[_0xffea('0xc3')])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x18114d,_0xffea('0xc4'));}var _0x211939=this['getSquareOdbc'][_0xffea('0x67')](this,_0x18114d['odbc_id']);if(!_0x211939){return this[_0xffea('0xf')][_0xffea('0x48')](_0x18114d,_0xffea('0xc5'));}if(!this[_0xffea('0x7a')](_0x18114d[_0xffea('0x2a')])){return this['channel'][_0xffea('0x48')](_0x18114d,_0xffea('0xc6'));}var _0x35d58b=_0x18114d[_0xffea('0x2a')][_0xffea('0x50')](/(\r\n|\n|\r)/gm,'\x20');this[_0xffea('0xf')][_0xffea('0xa7')](util['format']('query:\x20%s',_0x35d58b));var _0x4a9db1=this[_0xffea('0xc7')][_0xffea('0x67')](this,_0x211939,_0x35d58b);this['createSquareDetailsReport'][_0xffea('0x67')](this,_0x18114d,_0x35d58b);if(!this[_0xffea('0x7a')](_0x18114d[_0xffea('0xc8')])){return this[_0xffea('0xf')]['noop'](_0xffea('0xc9'));}var _0x2de587=this['getVariable'][_0xffea('0x67')](this,_0x18114d[_0xffea('0xc8')]);if(!_0x2de587){return this[_0xffea('0xf')][_0xffea('0x48')](_0x18114d,_0xffea('0xca'));}var _0x4df645=this;_0x4a9db1['forEach'](function(_0x1606f0,_0x173d69){Object[_0xffea('0xcb')](_0x1606f0)[_0xffea('0xcc')](function(_0x36493e){_0x4df645[_0xffea('0xf')][_0xffea('0x97')](util['format'](_0xffea('0xcd'),_0x2de587,_0x173d69,_0x36493e),_0x1606f0[_0x36493e]);});});this[_0xffea('0xf')][_0xffea('0x97')](util[_0xffea('0x98')](_0xffea('0xce'),_0x2de587),_0x4a9db1[_0xffea('0x94')]);return this['channel'][_0xffea('0xa7')](util['format'](_0xffea('0xcf'),_0x2de587));};AGIVertices[_0xffea('0x11')][_0xffea('0xd0')]=function(_0x396f58){logger['debug'](util[_0xffea('0x98')](_0xffea('0xd1'),_0x396f58['label']));if(!this[_0xffea('0x7a')](_0x396f58['sip_id'])){return this['channel']['error'](_0x396f58,_0xffea('0xd2'));}var _0x31cd04=this[_0xffea('0xd3')][_0xffea('0x67')](this,_0x396f58['sip_id']);if(!_0x31cd04){return this['channel'][_0xffea('0x48')](_0x396f58,'no\x20user\x20found');}var _0xd936ce=this[_0xffea('0xf')]['exec']('DIAL',[util[_0xffea('0x98')](_0xffea('0xd4'),_0x31cd04),_0x396f58[_0xffea('0x5e')],_0x396f58[_0xffea('0xd5')],_0x396f58['url']]);if(_0xd936ce[_0xffea('0x9d')]===-0x1){return _0xd936ce;}return this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')](_0xffea('0xd6'),'DIAL'));};AGIVertices[_0xffea('0x11')][_0xffea('0xd7')]=function(_0x53485c){logger['info'](util['format'](_0xffea('0xd8'),_0x53485c[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x53485c[_0xffea('0x72')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0xd9'));}if(!this[_0xffea('0x7a')](_0x53485c[_0xffea('0x54')])){return this['channel'][_0xffea('0xa7')](_0xffea('0xb2'));}this[_0xffea('0xf')][_0xffea('0xda')]=!![];this[_0xffea('0x31')](_0x53485c);this['createSquareMessage'](_0x53485c[_0xffea('0x54')],'in');this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')]('Trying\x20Dialogflow:\x20%s',_0x53485c['text']));var _0x5c975d=this[_0xffea('0x71')]['sync'](this,_0x53485c);if(_0x5c975d){for(var _0x229cff in _0x5c975d){if(_0x5c975d[_0xffea('0x8d')](_0x229cff)){this[_0xffea('0xf')]['setVariable'](util[_0xffea('0x98')]('DIALOGFLOW_%s',_0x229cff[_0xffea('0x61')]()),_0x5c975d[_0x229cff]);}}this[_0xffea('0xdb')](_0x5c975d[_0xffea('0xdc')],_0xffea('0xdd'));return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0xde'),_0x5c975d['speech']));}return this[_0xffea('0xf')]['error'](_0x53485c,_0xffea('0xdf'));};AGIVertices[_0xffea('0x11')][_0xffea('0xe0')]=function(_0x31bf3b){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0xe1'),_0x31bf3b[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x31bf3b[_0xffea('0xe2')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0xe3'));}if(!this[_0xffea('0x7a')](_0x31bf3b[_0xffea('0xe4')])){return this[_0xffea('0xf')][_0xffea('0xa7')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x31bf3b[_0xffea('0xe5')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0xe6'));}if(!this[_0xffea('0x7a')](_0x31bf3b[_0xffea('0xe7')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0xb2'));}this[_0xffea('0xf')][_0xffea('0xda')]=!![];this['createSquareDetailsReport'](_0x31bf3b);this[_0xffea('0xdb')](_0x31bf3b[_0xffea('0x54')],'in');this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0xe8'),_0x31bf3b[_0xffea('0x54')]));var _0x2da3d7=this[_0xffea('0x74')][_0xffea('0x67')](this,_0x31bf3b);if(_0x2da3d7){for(var _0x5d6765 in _0x2da3d7){if(_0x2da3d7[_0xffea('0x8d')](_0x5d6765)){this[_0xffea('0xf')][_0xffea('0x97')](util[_0xffea('0x98')](_0xffea('0xe9'),_0x5d6765['toUpperCase']()),_0x2da3d7[_0x5d6765]);}}this[_0xffea('0xdb')](_0x2da3d7['speech'],_0xffea('0xdd'));if(_0x2da3d7[_0xffea('0xea')]){this[_0xffea('0xf')][_0xffea('0xa7')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x2da3d7['audiofile']));var _0x46d844=this['channel'][_0xffea('0xeb')](_0x2da3d7[_0xffea('0xea')]);try{fs['unlink'](_0x2da3d7[_0xffea('0xea')]+_0xffea('0xec'));}catch(_0x41679b){logger[_0xffea('0x48')](_0x41679b);}return _0x46d844;}else{return this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')](_0xffea('0xed'),_0x2da3d7['speech']));}}return this[_0xffea('0xf')][_0xffea('0x48')](_0x31bf3b,_0xffea('0xee'));};AGIVertices[_0xffea('0x11')][_0xffea('0xef')]=function(_0x3f0f67){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0xf0'),_0x3f0f67[_0xffea('0x33')]));return this['channel'][_0xffea('0xa7')]('end');};AGIVertices[_0xffea('0x11')][_0xffea('0xf1')]=function(_0x906ca1){logger[_0xffea('0x2b')](util['format'](_0xffea('0xf2'),_0x906ca1[_0xffea('0x33')]));var _0x3b99d6='';if(_0x906ca1[_0xffea('0xf3')]){if(!this[_0xffea('0x7a')](_0x906ca1['trunk_id'])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x906ca1,_0xffea('0xf4'));}else{var _0xb719f4=parseInt(_0x906ca1['trunk_id'],0xa);if(isNaN(_0xb719f4)){_0x3b99d6=_0x906ca1[_0xffea('0xf3')];}else{_0x3b99d6=this[_0xffea('0x1e')]['sync'](this,_0x906ca1[_0xffea('0xf3')]);if(!_0x3b99d6){return this[_0xffea('0xf')][_0xffea('0x48')](_0x906ca1,_0xffea('0xf5'));}}}}else if(_0x906ca1['trunk_name']){_0x3b99d6=_0x906ca1[_0xffea('0xf6')];}else{return this[_0xffea('0xf')][_0xffea('0x48')](_0x906ca1,_0xffea('0xf4'));}var _0x43ae84=this[_0xffea('0xf')][_0xffea('0x4f')](_0xffea('0xf7'),[util[_0xffea('0x98')](_0xffea('0xf8'),_0x3b99d6,_0x906ca1['phone']),_0x906ca1[_0xffea('0x5e')],_0x906ca1[_0xffea('0xd5')],_0x906ca1['url']]);if(_0x43ae84[_0xffea('0x9d')]===-0x1){return _0x43ae84;}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')]('Executed\x20command\x20%s',_0xffea('0xf7')));};AGIVertices[_0xffea('0x11')]['finally']=function(_0x2c5806){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0xf9'),_0x2c5806['label']));return this['channel'][_0xffea('0xa7')](_0xffea('0xfa'));};AGIVertices[_0xffea('0x11')][_0xffea('0xd')]=function(_0x20ffa4){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0xfb'),_0x20ffa4[_0xffea('0x33')]));if(_0x20ffa4[_0xffea('0xfc')]===0x0){return this[_0xffea('0x9e')](_0x20ffa4);}_0x20ffa4[_0xffea('0xfc')]-=0x1;if(!this[_0xffea('0x7a')](_0x20ffa4['file_id'])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x20ffa4,_0xffea('0xfd'));}var _0x2b6dd8=this[_0xffea('0xfe')][_0xffea('0x67')](this,_0x20ffa4[_0xffea('0xff')]);if(!_0x2b6dd8){return this['channel'][_0xffea('0x48')](_0x20ffa4,_0xffea('0x100'));}if(!this[_0xffea('0x7a')](_0x20ffa4[_0xffea('0xc8')])){return this[_0xffea('0xf')]['error'](_0xffea('0xc9'));}var _0x5d7bc4=this[_0xffea('0xf')][_0xffea('0x101')](_0x2b6dd8,_0x20ffa4[_0xffea('0x102')],_0x20ffa4['maxdigit']);var _0x188a41=_0x5d7bc4[_0xffea('0x9d')]?_0x5d7bc4[_0xffea('0x9d')][_0xffea('0x43')]():'';logger[_0xffea('0x2b')](_0xffea('0x103'),JSON[_0xffea('0x6a')](_0x5d7bc4));if(_0x5d7bc4['result']===-0x1){this['createSquareDetailsReport'][_0xffea('0x67')](this,_0x20ffa4,_0x188a41);return _0x5d7bc4;}else if(_0x5d7bc4[_0xffea('0x9b')]===_0xffea('0x5e')){_0x5d7bc4[_0xffea('0x9d')]=_0x188a41[_0xffea('0x94')]>=parseInt(_0x20ffa4['mindigit'])?'x':'i';}else{_0x5d7bc4['result']=_0x188a41[_0xffea('0x94')]>=parseInt(_0x20ffa4[_0xffea('0x104')])&&_0x188a41[_0xffea('0x94')]<=parseInt(_0x20ffa4[_0xffea('0x105')])?'x':'i';}var _0x1a760c=this[_0xffea('0x12')][_0xffea('0x67')](this,_0x20ffa4[_0xffea('0xc8')]);if(!_0x1a760c){return this[_0xffea('0xf')][_0xffea('0x48')](_0x20ffa4,_0xffea('0xca'));}this['channel']['setVariable'](_0x1a760c,_0x188a41);if(this[_0xffea('0x7a')](_0x20ffa4['hiddendigitsnum'])){var _0x3da750=parseInt(_0x20ffa4['hiddendigitsnum'],0xa);var _0x4e8cbc=rs['generate']({'charset':'*','length':_0x3da750});var _0x51cfd6=_0x188a41['length'];if(_0x51cfd6>0x0){if(_0x51cfd6>_0x3da750){this[_0xffea('0x31')][_0xffea('0x67')](this,_0x20ffa4,_0x20ffa4[_0xffea('0x106')]===_0xffea('0x107')?_0x4e8cbc+_0x188a41[_0xffea('0x108')](_0x3da750):_0x188a41[_0xffea('0x108')](0x0,_0x51cfd6-_0x3da750)+_0x4e8cbc);}else{this[_0xffea('0x31')][_0xffea('0x67')](this,_0x20ffa4,rs['generate']({'charset':'*','length':_0x51cfd6}));}}else{this[_0xffea('0x31')]['sync'](this,_0x20ffa4,'');}}else{this[_0xffea('0x31')]['sync'](this,_0x20ffa4,_0x188a41);}return _0x5d7bc4;};AGIVertices[_0xffea('0x11')][_0xffea('0xe')]=function(_0x441e51){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x441e51[_0xffea('0x33')]));return this[_0xffea('0xd')](_0x441e51);};AGIVertices[_0xffea('0x11')][_0xffea('0x109')]=function(_0x59bb82){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x10a'),_0x59bb82[_0xffea('0x33')]));this[_0xffea('0x31')][_0xffea('0x67')](this,_0x59bb82,_0x59bb82[_0xffea('0x10b')]);return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x10c'),_0x59bb82[_0xffea('0x10b')]));};AGIVertices[_0xffea('0x11')][_0xffea('0x10d')]=function(_0x202b94){logger['info'](util[_0xffea('0x98')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x202b94['label']));if(!this[_0xffea('0x7a')](_0x202b94[_0xffea('0x7d')])||!this[_0xffea('0x7a')](_0x202b94[_0xffea('0x7e')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0x10e'));}if(!this[_0xffea('0x7a')](_0x202b94[_0xffea('0x54')])){return this[_0xffea('0xf')][_0xffea('0xa7')]('no\x20text\x20configured');}this[_0xffea('0xf')][_0xffea('0xa7')](util['format'](_0xffea('0x10f'),_0x202b94['text']));var _0x217336=this[_0xffea('0x7c')][_0xffea('0x67')](this,_0x202b94);if(_0x217336){this[_0xffea('0xf')][_0xffea('0xa7')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x217336));var _0x2d00d8=this[_0xffea('0xf')]['streamFile'](_0x217336);try{fs['unlink'](_0x217336+_0xffea('0xec'));}catch(_0x4fd865){logger[_0xffea('0x48')](_0x4fd865);}return _0x2d00d8;}return this[_0xffea('0xf')][_0xffea('0x48')](_0x202b94,_0xffea('0x110'));};AGIVertices['prototype']['awslex']=function(_0x184d41){logger[_0xffea('0x2b')](util['format'](_0xffea('0x111'),_0x184d41[_0xffea('0x33')]));if(!this['isConfigured'](_0x184d41[_0xffea('0x7d')])||!this['isConfigured'](_0x184d41[_0xffea('0x7e')])){return this['channel']['noop'](_0xffea('0x10e'));}if(!this[_0xffea('0x7a')](_0x184d41['aws_bot_name'])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0x112'));}if(!this['isConfigured'](_0x184d41[_0xffea('0x54')])){return this['channel']['noop']('no\x20text\x20configured');}this['channel'][_0xffea('0xda')]=!![];this['createSquareDetailsReport'](_0x184d41);this[_0xffea('0xdb')](_0x184d41[_0xffea('0x54')],'in');this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x113'),_0x184d41['text']));var _0x3e3e3f=this[_0xffea('0x83')][_0xffea('0x67')](this,_0x184d41);if(_0x3e3e3f){for(var _0x580230 in _0x3e3e3f){if(_0x3e3e3f['hasOwnProperty'](_0x580230)&&_[_0xffea('0x8e')](_0x3e3e3f[_0x580230])){this[_0xffea('0xf')][_0xffea('0x97')](util[_0xffea('0x98')](_0xffea('0x114'),_0x580230[_0xffea('0x61')]()),_0x3e3e3f[_0x580230]);}}if(_[_0xffea('0x3c')](_0x3e3e3f[_0xffea('0x6e')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0x115'));}else{this[_0xffea('0xdb')](_0x3e3e3f[_0xffea('0x6e')],_0xffea('0xdd'));return this['channel']['noop'](util[_0xffea('0x98')](_0xffea('0x116'),_0x3e3e3f['message']));}}return this[_0xffea('0xf')]['error'](_0x184d41,_0xffea('0x117'));};AGIVertices['prototype'][_0xffea('0x118')]=function(_0x176705){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x176705[_0xffea('0x33')],_0x176705[_0xffea('0x5e')]));if(!this[_0xffea('0x7a')](_0x176705[_0xffea('0x72')])){return this['channel'][_0xffea('0xa7')]('no\x20key\x20configured');}var _0x20520e=_0xffea('0x119');var _0x2ce711=util['format'](_0xffea('0x11a'),FILES_PATH,rs[_0xffea('0x11b')](0x4));var _0x58a75f=util['format'](_0xffea('0x96'),_0x2ce711,_0x20520e);var _0x5e53a1=!![];if(_0x176705[_0xffea('0x11c')]===_0xffea('0x11d')){_0x5e53a1=![];}var _0x4d7f08=this[_0xffea('0xf')][_0xffea('0x11e')](_0x2ce711,_0x20520e,_0x176705[_0xffea('0x11f')],_0x176705[_0xffea('0x5e')],undefined,_0x5e53a1);if(_0x4d7f08[_0xffea('0x9d')]!==-0x1){this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x120'),_0x58a75f));var _0x4f4684=this[_0xffea('0x85')]['sync'](this,_0x176705,_0x58a75f);if(_0x4f4684){for(var _0x5b5143 in _0x4f4684){if(_0x4f4684[_0xffea('0x8d')](_0x5b5143)){this['channel'][_0xffea('0x97')](util[_0xffea('0x98')](_0xffea('0x121'),_0x5b5143[_0xffea('0x61')]()),_0x4f4684[_0x5b5143]);}}return this[_0xffea('0xf')][_0xffea('0xa7')](util['format'](_0xffea('0x122'),JSON[_0xffea('0x6a')](_0x4f4684)));}}return _0x4d7f08;};AGIVertices[_0xffea('0x11')][_0xffea('0x123')]=function(_0x22aebb){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x124'),_0x22aebb['label']));if(!this[_0xffea('0x7a')](_0x22aebb[_0xffea('0x88')])){return this[_0xffea('0xf')]['noop']('no\x20appid\x20configured');}if(!this[_0xffea('0x7a')](_0x22aebb[_0xffea('0x89')])){return this[_0xffea('0xf')]['noop'](_0xffea('0x125'));}var _0x2c9a81='wav';var _0x1bdeca=util[_0xffea('0x98')](_0xffea('0x11a'),FILES_PATH,rs['generate'](0x4));var _0x390ca1=util[_0xffea('0x98')](_0xffea('0x96'),_0x1bdeca,_0x2c9a81);var _0xe4010e=!![];if(_0x22aebb[_0xffea('0x11c')]===_0xffea('0x11d')){_0xe4010e=![];}var _0x11c705=this[_0xffea('0xf')][_0xffea('0x11e')](_0x1bdeca,_0x2c9a81,_0x22aebb[_0xffea('0x11f')],_0x22aebb[_0xffea('0x5e')],undefined,_0xe4010e);if(_0x11c705[_0xffea('0x9d')]!==-0x1){this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x126'),_0x390ca1));var _0x59a68d=this[_0xffea('0x87')][_0xffea('0x67')](this,_0x22aebb,_0x390ca1);if(_0x59a68d){for(var _0x4d6c9b in _0x59a68d){if(_0x59a68d['hasOwnProperty'](_0x4d6c9b)){this[_0xffea('0xf')][_0xffea('0x97')](util[_0xffea('0x98')](_0xffea('0x127'),_0x4d6c9b['toUpperCase']()),_0x59a68d[_0x4d6c9b]);}}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x128'),JSON['stringify'](_0x59a68d)));}}return _0x11c705;};AGIVertices['prototype'][_0xffea('0x129')]=function(_0x1cdccc){logger['info'](util[_0xffea('0x98')](_0xffea('0x12a'),_0x1cdccc[_0xffea('0x33')]));return this[_0xffea('0xf')][_0xffea('0x12b')](_0x1cdccc[_0xffea('0x12c')],_0x1cdccc[_0xffea('0x12d')],_0x1cdccc[_0xffea('0x37')]);};AGIVertices[_0xffea('0x11')][_0xffea('0x12e')]=function(_0x131f10){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x12f'),_0x131f10[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x131f10[_0xffea('0x130')])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x131f10,_0xffea('0x131'));}try{var _0xa97ce4=eval(_0x131f10[_0xffea('0x130')])?_0xffea('0x132'):_0xffea('0x133');this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x134'),_0x131f10[_0xffea('0x130')],_0xa97ce4));return{'code':0xc8,'result':_0xa97ce4};}catch(_0x3f2b0c){return{'code':0xc8,'result':_0xffea('0x133')};}};AGIVertices[_0xffea('0x11')][_0xffea('0x135')]=function(_0x298ec6){logger[_0xffea('0x2b')](util['format'](_0xffea('0x136'),_0x298ec6[_0xffea('0x33')]));if(!this['isConfigured'](_0x298ec6['interval_id'])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x298ec6,_0xffea('0x137'));}var _0x3436cc=this[_0xffea('0x24')][_0xffea('0x67')](this,_0x298ec6[_0xffea('0x138')]);if(!_0x3436cc){return this['channel']['error'](_0x298ec6,_0xffea('0x139'));}for(var _0x3bd553=0x0;_0x3bd553<_0x3436cc['length'];_0x3bd553+=0x1){var _0x3c0a96=this[_0xffea('0xf')][_0xffea('0x12')](util[_0xffea('0x98')](_0xffea('0x13a'),_0x3436cc[_0x3bd553]));if(_0x3c0a96['result']===-0x1){return _0x3c0a96;}logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x13b'),_0x3436cc[_0x3bd553],_0x3c0a96[_0xffea('0x9b')]));if(_0x3c0a96[_0xffea('0x9b')]===_0xffea('0x132')){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('IFTIME\x20%s\x20%s',_0x3436cc[_0x3bd553],_0xffea('0x132')));this[_0xffea('0xf')][_0xffea('0xa7')](util['format'](_0xffea('0x13b'),_0x3436cc[_0x3bd553],_0xffea('0x132')));return{'code':0xc8,'result':_0xffea('0x132')};}else{logger[_0xffea('0x2b')](util['format'](_0xffea('0x13b'),_0x3436cc[_0x3bd553],_0xffea('0x133')));this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')](_0xffea('0x13b'),_0x3436cc[_0x3bd553],_0xffea('0x133')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xffea('0x11')][_0xffea('0x13c')]=function(_0x44b60f){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x13d'),_0x44b60f[_0xffea('0x33')]));return this[_0xffea('0xf')]['hangup']();};AGIVertices[_0xffea('0x11')][_0xffea('0x13e')]=function(_0x320f50){logger[_0xffea('0x2b')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x320f50['label']));if(!this[_0xffea('0x7a')](_0x320f50[_0xffea('0x72')])){return this['channel'][_0xffea('0xa7')](_0xffea('0xd9'));}var _0x31753c=_0xffea('0x119');var _0xe97a14=util[_0xffea('0x98')]('%s/recordings/%s',FILES_PATH,rs[_0xffea('0x11b')](0x4));var _0x404cec=util['format'](_0xffea('0x96'),_0xe97a14,_0x31753c);var _0x39e61d=!![];if(_0x320f50['beep']===_0xffea('0x11d')){_0x39e61d=![];}var _0x15e422=this[_0xffea('0xf')][_0xffea('0x11e')](_0xe97a14,_0x31753c,_0x320f50['intKey'],_0x320f50['timeout'],undefined,_0x39e61d);if(_0x15e422[_0xffea('0x9d')]!==-0x1){this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x13f'),_0x404cec));var _0xb792d6=this[_0xffea('0x78')][_0xffea('0x67')](this,_0x320f50,_0x404cec);if(_0xb792d6){for(var _0x203b07 in _0xb792d6){if(_0xb792d6[_0xffea('0x8d')](_0x203b07)){this[_0xffea('0xf')][_0xffea('0x97')](util[_0xffea('0x98')](_0xffea('0x140'),_0x203b07[_0xffea('0x61')]()),_0xb792d6[_0x203b07]);}}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x141'),JSON['stringify'](_0xb792d6)));}}return _0x15e422;};AGIVertices[_0xffea('0x11')][_0xffea('0x142')]=function(_0xe98adb){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x143'),_0xe98adb['label']));if(!this[_0xffea('0x7a')](_0xe98adb['key'])){return this[_0xffea('0xf')][_0xffea('0xa7')]('no\x20key\x20configured');}if(!this[_0xffea('0x7a')](_0xe98adb[_0xffea('0x54')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0xb2'));}this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x144'),_0xe98adb[_0xffea('0x54')]));var _0x17d3e0=this[_0xffea('0x75')][_0xffea('0x67')](this,_0xe98adb);if(_0x17d3e0){this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')](_0xffea('0x13f'),_0x17d3e0));var _0x53ffba=this[_0xffea('0xf')]['streamFile'](_0x17d3e0,_0xe98adb[_0xffea('0x11f')]);try{fs['unlink'](_0x17d3e0+_0xffea('0xec'));}catch(_0x16335a){logger[_0xffea('0x48')](_0x16335a);}return _0x53ffba;}return this['channel'][_0xffea('0x48')](_0xe98adb,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xffea('0x11')][_0xffea('0x145')]=function(_0x172fef){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x146'),_0x172fef[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x172fef[_0xffea('0x147')])){return this['channel'][_0xffea('0x48')](_0x172fef,_0xffea('0x148'));}logger['info'](util[_0xffea('0x98')](_0xffea('0x149'),this[_0xffea('0xf')]['callerid'],_0x172fef[_0xffea('0x147')]));var _0x3ce2d2=this[_0xffea('0x4b')]['sync'](this,_0x172fef[_0xffea('0x147')]);if(_0x3ce2d2){logger['info'](util[_0xffea('0x98')](_0xffea('0x14a'),this[_0xffea('0xf')][_0xffea('0x35')],_0x172fef[_0xffea('0x147')]));this['channel'][_0xffea('0xa7')](util['format'](_0xffea('0x14a'),this[_0xffea('0xf')][_0xffea('0x35')],_0x172fef[_0xffea('0x147')]));return{'code':0xc8,'result':_0xffea('0x14b')};}else{logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x14c'),this[_0xffea('0xf')][_0xffea('0x35')],_0x172fef[_0xffea('0x147')]));this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')](_0xffea('0x14c'),this[_0xffea('0xf')][_0xffea('0x35')],_0x172fef[_0xffea('0x147')]));return{'code':0xc8,'result':_0xffea('0x14d')};}};AGIVertices['prototype'][_0xffea('0x14e')]=function(_0x888c83){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x14f'),_0x888c83[_0xffea('0x33')]));if(!this['isConfigured'](_0x888c83['findBy'])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x888c83,_0xffea('0x148'));}logger['info'](util[_0xffea('0x98')](_0xffea('0x149'),this['channel'][_0xffea('0x35')],_0x888c83[_0xffea('0x147')]));var _0x3eabf7=this['agentLogout'][_0xffea('0x67')](this,_0x888c83[_0xffea('0x147')]);if(_0x3eabf7){logger[_0xffea('0x2b')](util['format'](_0xffea('0x14a'),this['channel'][_0xffea('0x35')],_0x888c83[_0xffea('0x147')]));this[_0xffea('0xf')][_0xffea('0xa7')](util['format'](_0xffea('0x14a'),this['channel'][_0xffea('0x35')],_0x888c83[_0xffea('0x147')]));return{'code':0xc8,'result':_0xffea('0x14b')};}else{logger['info'](util[_0xffea('0x98')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xffea('0x35')],_0x888c83[_0xffea('0x147')]));this[_0xffea('0xf')][_0xffea('0xa7')](util['format'](_0xffea('0x14c'),this[_0xffea('0xf')][_0xffea('0x35')],_0x888c83[_0xffea('0x147')]));return{'code':0xc8,'result':_0xffea('0x14d')};}};AGIVertices[_0xffea('0x11')][_0xffea('0x150')]=function(_0xe2ceed){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0xe2ceed[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0xe2ceed[_0xffea('0x151')])){return this[_0xffea('0xf')][_0xffea('0x48')](_0xe2ceed,'no\x20operation\x20configured');}this['channel'][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x152'),_0xe2ceed[_0xffea('0x151')]));var _0xbbd981=eval(_0xe2ceed[_0xffea('0x151')]);if(!this[_0xffea('0x7a')](_0xe2ceed[_0xffea('0xc8')])){return this['channel'][_0xffea('0xa7')](_0xffea('0xc9'));}var _0x477311=this[_0xffea('0x12')][_0xffea('0x67')](this,_0xe2ceed[_0xffea('0xc8')]);if(!_0x477311){return this[_0xffea('0xf')]['error'](_0xe2ceed,_0xffea('0xca'));}if(_['isArray'](_0xbbd981)){var _0x3a36f0=this;_0xbbd981[_0xffea('0xcc')](function(_0x13b657,_0x424af6){_0x3a36f0[_0xffea('0xf')][_0xffea('0x97')](util['format']('%s[%s]',_0x477311,_0x424af6),_0x13b657);});return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x153'),_0x477311));}else{return this[_0xffea('0xf')]['setVariable'](_0x477311,_0xbbd981);}};AGIVertices[_0xffea('0x11')][_0xffea('0xc')]=function(_0x4263bd){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x4263bd[_0xffea('0x33')]));if(_0x4263bd[_0xffea('0xfc')]===0x0){return this[_0xffea('0x9e')](_0x4263bd);}_0x4263bd[_0xffea('0xfc')]-=0x1;if(!this['isConfigured'](_0x4263bd['file_id'])){return this[_0xffea('0xf')]['error'](_0x4263bd,_0xffea('0xfd'));}var _0x4760c7=this[_0xffea('0xfe')]['sync'](this,_0x4263bd[_0xffea('0xff')]);if(!_0x4760c7){return this[_0xffea('0xf')][_0xffea('0x48')](_0x4263bd,_0xffea('0x100'));}var _0x174575=this[_0xffea('0xf')][_0xffea('0x101')](_0x4760c7,_0x4263bd[_0xffea('0x102')],_0x4263bd[_0xffea('0x154')]);var _0x35d560=_0x174575[_0xffea('0x9d')];if(_0x174575[_0xffea('0x9d')]===-0x1){this[_0xffea('0x31')][_0xffea('0x67')](this,_0x4263bd,'-1');return _0x174575;}else if(_0x174575['extra']===_0xffea('0x5e')){_0x174575[_0xffea('0x9d')]=_0x174575[_0xffea('0x9d')][_0xffea('0x94')]>0x0?_0x174575[_0xffea('0x9d')]:'t';}else if(_[_0xffea('0x3b')](_0x174575[_0xffea('0x9d')])){_0x174575[_0xffea('0x9d')]='#';_0x35d560='#';}if(!this[_0xffea('0x7a')](_0x4263bd['variable_id'])){this[_0xffea('0xf')]['noop'](_0xffea('0xc9'));}else{var _0x2783c4=this[_0xffea('0x12')][_0xffea('0x67')](this,_0x4263bd[_0xffea('0xc8')]);if(!_0x2783c4){return this[_0xffea('0xf')]['error'](_0x4263bd,'no\x20variable\x20found');}this[_0xffea('0xf')][_0xffea('0x97')](_0x2783c4,_0x35d560);}this[_0xffea('0x31')][_0xffea('0x67')](this,_0x4263bd,_0x35d560);return _0x174575;};AGIVertices[_0xffea('0x11')][_0xffea('0xa7')]=function(_0x58d5ad){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x155'),_0x58d5ad[_0xffea('0x33')]));return this[_0xffea('0xf')]['noop'](_0x58d5ad[_0xffea('0x156')]||_0x58d5ad['label']);};AGIVertices['prototype'][_0xffea('0x157')]=function(_0x33a4a4){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x158'),_0x33a4a4['label']));if(!this[_0xffea('0x7a')](_0x33a4a4[_0xffea('0x147')])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x33a4a4,_0xffea('0x148'));}logger['info'](util['format'](_0xffea('0x149'),this[_0xffea('0xf')][_0xffea('0x35')],_0x33a4a4[_0xffea('0x147')]));var _0x4736b1=this[_0xffea('0x44')]['sync'](this,_0x33a4a4[_0xffea('0x159')]);var _0x3dadae=this[_0xffea('0x47')]['sync'](this,_0x33a4a4[_0xffea('0x147')],_0x4736b1);if(_0x3dadae){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x14a'),this[_0xffea('0xf')][_0xffea('0x35')],_0x33a4a4[_0xffea('0x147')]));this['channel'][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x14a'),this[_0xffea('0xf')][_0xffea('0x35')],_0x33a4a4['findBy']));return{'code':0xc8,'result':_0xffea('0x14b')};}else{logger[_0xffea('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xffea('0xf')]['callerid'],_0x33a4a4[_0xffea('0x147')]));this[_0xffea('0xf')][_0xffea('0xa7')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xffea('0xf')][_0xffea('0x35')],_0x33a4a4['findBy']));return{'code':0xc8,'result':_0xffea('0x14d')};}};AGIVertices[_0xffea('0x11')]['playback']=function(_0x48762f){logger[_0xffea('0x2b')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x48762f[_0xffea('0x33')]));if(!this['isConfigured'](_0x48762f['file_id'])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x48762f,_0xffea('0xfd'));}var _0x345063=this['getSound'][_0xffea('0x67')](this,_0x48762f[_0xffea('0xff')]);if(!_0x345063){return this[_0xffea('0xf')][_0xffea('0x48')](_0x48762f,_0xffea('0x100'));}var _0x23a563=this['channel']['exec'](_0xffea('0x15a'),[_0x345063,_0x48762f['opts']]);if(_0x23a563['result']===-0x1){return _0x23a563;}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')]('Executed\x20command\x20%s\x20%s',_0xffea('0x15a'),_0x345063));};AGIVertices[_0xffea('0x11')][_0xffea('0x15b')]=function(_0x52bdb2){logger['info'](util[_0xffea('0x98')](_0xffea('0x15c'),_0x52bdb2[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x52bdb2['queue_id'])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x52bdb2,_0xffea('0x15d'));}var _0x2351de='';var _0x2d8c20=parseInt(_0x52bdb2['queue_id'],0xa);if(isNaN(_0x2d8c20)){_0x2351de=_0x52bdb2[_0xffea('0x15e')];}else{_0x2351de=this[_0xffea('0x18')][_0xffea('0x67')](this,_0x52bdb2[_0xffea('0x15e')]);if(!_0x2351de){return this[_0xffea('0xf')][_0xffea('0x48')](_0x52bdb2,_0xffea('0x15f'));}}var _0x501eda='';if(this[_0xffea('0x7a')](_0x52bdb2[_0xffea('0xff')])){var _0x507ad1=this[_0xffea('0xfe')][_0xffea('0x67')](this,_0x52bdb2['file_id']);if(_0x507ad1){_0x501eda=_0x507ad1;}}this[_0xffea('0x31')]['sync'](this,_0x52bdb2,_0x2351de);if(_0x52bdb2['opts']['indexOf']('x')<0x0){_0x52bdb2[_0xffea('0xd5')]+='x';}if(_0x52bdb2[_0xffea('0xd5')][_0xffea('0x160')]('X')<0x0){_0x52bdb2[_0xffea('0xd5')]+='X';}this[_0xffea('0xf')][_0xffea('0x97')](_0xffea('0x161'),_0x2351de?_0x2351de[_0xffea('0x162')]():'');var _0x111740=this[_0xffea('0xf')][_0xffea('0x4f')](_0xffea('0x163'),[_0x2351de,_0x52bdb2[_0xffea('0xd5')],_0x52bdb2[_0xffea('0x5c')],_0x501eda,_0x52bdb2[_0xffea('0x5e')],_0x52bdb2[_0xffea('0x7')],_0x52bdb2[_0xffea('0x164')],_0x52bdb2['gosub'],'',_0x52bdb2[_0xffea('0x165')]]);if(_0x111740[_0xffea('0x9d')]===-0x1){return _0x111740;}return this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')]('Executed\x20command\x20%s\x20%s',_0xffea('0x163'),_0x2351de));};AGIVertices[_0xffea('0x11')]['record']=function(_0x1b87ee){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x166'),_0x1b87ee['label']));var _0xed57c1=_0x1b87ee[_0xffea('0x167')]||_0xffea('0x119');var _0x442937=util[_0xffea('0x98')](_0xffea('0x168'),this['channel'][_0xffea('0x32')],rs['generate'](0x5));var _0x4e15e4=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x442937,_0xed57c1);var _0x24f4bb=util[_0xffea('0x98')](_0xffea('0x11a'),FILES_PATH,_0x442937);this['createSquareRecording'][_0xffea('0x67')](this,_0x1b87ee,_0x442937,_0x4e15e4);this[_0xffea('0xf')][_0xffea('0x97')](_0xffea('0x169'),_0x442937);logger[_0xffea('0x2b')](_0xffea('0x16a'),_0x24f4bb,_0xed57c1,_0x1b87ee[_0xffea('0x16b')],_0x1b87ee[_0xffea('0x5e')]);return this[_0xffea('0xf')]['recordFile'](_0x24f4bb,_0xed57c1,_0x1b87ee[_0xffea('0x16b')],_0x1b87ee[_0xffea('0x5e')],undefined,!![]);};AGIVertices[_0xffea('0x11')]['restapi']=function(_0x350205){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x16c'),_0x350205['label']));if(!this[_0xffea('0x7a')](_0x350205[_0xffea('0x5c')])){return this['channel'][_0xffea('0xa7')](_0xffea('0x16d'));}var _0x4f25af=this[_0xffea('0x5b')][_0xffea('0x67')](this,_0x350205);logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x16e'),util[_0xffea('0x16f')](_0x4f25af,{'showHidden':![],'depth':null})));if(!this[_0xffea('0x7a')](_0x350205[_0xffea('0xc8')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0x170'));}var _0x6b9f91=this['getVariable'][_0xffea('0x67')](this,_0x350205[_0xffea('0xc8')]);if(!_0x6b9f91){return this[_0xffea('0xf')][_0xffea('0x48')](_0x350205,_0xffea('0xca'));}this[_0xffea('0xf')][_0xffea('0x97')](util[_0xffea('0x98')]('%s_STATUS_CODE',_0x6b9f91),_0x4f25af[_0xffea('0x6c')]?_0x4f25af['statusCode']:'200');this[_0xffea('0xf')][_0xffea('0x97')](util[_0xffea('0x98')](_0xffea('0x171'),_0x6b9f91),_0x4f25af[_0xffea('0x6d')]?_0x4f25af[_0xffea('0x6d')]:'OK');if(_0x4f25af[_0xffea('0x62')]){try{this[_0xffea('0x95')](_0x4f25af[_0xffea('0x62')],_0x6b9f91);}catch(_0x1ea95c){logger[_0xffea('0x48')](util[_0xffea('0x98')](_0xffea('0x172'),_0x6b9f91));}}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0xcf'),_0x6b9f91));};AGIVertices[_0xffea('0x11')]['saydigits']=function(_0x30fba6){logger['info'](util[_0xffea('0x98')](_0xffea('0x173'),_0x30fba6[_0xffea('0x33')]));return this[_0xffea('0xf')][_0xffea('0x174')](_0x30fba6[_0xffea('0x175')][_0xffea('0x50')](/\s+/g,''),_0x30fba6[_0xffea('0x16b')]);};AGIVertices[_0xffea('0x11')][_0xffea('0x176')]=function(_0x4b2856){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x177'),_0x4b2856[_0xffea('0x33')]));return this[_0xffea('0xf')][_0xffea('0x178')](_0x4b2856[_0xffea('0x5f')][_0xffea('0x50')](/\s+/g,''),_0x4b2856[_0xffea('0x16b')]);};AGIVertices[_0xffea('0x11')][_0xffea('0x179')]=function(_0x2c101b){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2c101b[_0xffea('0x33')]));return this[_0xffea('0xf')][_0xffea('0x17a')](_0x2c101b[_0xffea('0x54')],_0x2c101b[_0xffea('0x16b')]);};AGIVertices[_0xffea('0x11')]['sendMail']=function(_0x2666ae){logger[_0xffea('0x2b')](util['format'](_0xffea('0x17b'),_0x2666ae[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x2666ae[_0xffea('0x17c')])){return this['channel'][_0xffea('0xa7')](_0xffea('0x17d'));}var _0x5e27d2=this[_0xffea('0x17e')][_0xffea('0x67')](this,_0x2666ae['account_id']);if(!_0x5e27d2||!_0x5e27d2[_0xffea('0x17f')]){return this['channel'][_0xffea('0x48')](_0x2666ae,_0xffea('0x180'));}var _0x2871d6={'from':util[_0xffea('0x98')](_0xffea('0x181'),_0x5e27d2[_0xffea('0x16')],_0x5e27d2[_0xffea('0x182')]||_0x5e27d2[_0xffea('0x17f')][_0xffea('0x183')]),'to':_0x2666ae['to']||'','cc':_0x2666ae['cc']||'','bcc':_0x2666ae[_0xffea('0x184')]||'','subject':_0x2666ae[_0xffea('0x185')],'html':_0x2666ae[_0xffea('0x54')],'text':_0x2666ae['text']};var _0x3dd3b1={'tls':{'rejectUnauthorized':![]}};if(_0x5e27d2[_0xffea('0x17f')][_0xffea('0x186')]){_0x3dd3b1[_0xffea('0x186')]=_0x5e27d2[_0xffea('0x17f')]['service'];}else{_0x3dd3b1[_0xffea('0x187')]=_0x5e27d2[_0xffea('0x17f')][_0xffea('0x187')];_0x3dd3b1[_0xffea('0x188')]=_0x5e27d2[_0xffea('0x17f')]['port'];_0x3dd3b1[_0xffea('0x189')]=_0x5e27d2[_0xffea('0x17f')][_0xffea('0x189')];}if(_0x5e27d2[_0xffea('0x17f')]['authentication']){_0x3dd3b1[_0xffea('0x18a')]={'user':_0x5e27d2[_0xffea('0x17f')][_0xffea('0x183')],'pass':_0x5e27d2[_0xffea('0x17f')][_0xffea('0x18b')]};}if(this[_0xffea('0x7a')](_0x2666ae[_0xffea('0x18c')])){}logger['debug'](_0xffea('0x18d'),JSON[_0xffea('0x6a')](_0x2871d6));this[_0xffea('0x31')]['sync'](this,_0x2666ae,_0x2666ae['account_id']);this['channel'][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x18e'),_0x5e27d2[_0xffea('0x16')]));this[_0xffea('0x23')][_0xffea('0x67')](this,_0x3dd3b1,_0x2871d6);return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0x18f'));};AGIVertices[_0xffea('0x11')][_0xffea('0x190')]=function(_0x37b55f){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x191'),_0x37b55f[_0xffea('0x33')]));return this['channel'][_0xffea('0xa7')](_0xffea('0x192'));};AGIVertices[_0xffea('0x11')]['sendSMS']=function(_0x57c6de){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x57c6de[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x57c6de[_0xffea('0x193')])){return this[_0xffea('0xf')][_0xffea('0xa7')]('no\x20sms\x20account\x20configured');}var _0x4da061=this['getSmsAccount'][_0xffea('0x67')](this,_0x57c6de[_0xffea('0x193')]);if(!_0x4da061){return this[_0xffea('0xf')][_0xffea('0x48')](_0x57c6de,_0xffea('0x194'));}var _0x59f775={'body':_0x57c6de[_0xffea('0x195')],'phone':_0x57c6de['to']||'','SmsAccountId':_0x4da061['id']};logger['debug'](_0xffea('0x196'),JSON[_0xffea('0x6a')](_0x59f775));this['createSquareDetailsReport'][_0xffea('0x67')](this,_0x57c6de,_0x57c6de[_0xffea('0x193')]);this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x197'),_0x4da061[_0xffea('0x16')]));this[_0xffea('0x30')]['sync'](this,_0x59f775);return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0x198'));};AGIVertices['prototype']['set']=function(_0xa611d0){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x199'),_0xa611d0[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0xa611d0[_0xffea('0xc8')])){return this[_0xffea('0xf')][_0xffea('0x48')](_0xa611d0,_0xffea('0x19a'));}var _0x354584=this[_0xffea('0x12')][_0xffea('0x67')](this,_0xa611d0[_0xffea('0xc8')]);if(!_0x354584){return this['channel']['error'](_0xa611d0,_0xffea('0xca'));}return this[_0xffea('0xf')]['setVariable'](_0x354584,_0xa611d0[_0xffea('0x19b')]);};AGIVertices[_0xffea('0x11')]['start']=function(_0x44f137){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('Enter\x20in\x20START\x20(%s)\x20block',_0x44f137[_0xffea('0x33')]));this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0x19c'));if(_0x44f137[_0xffea('0xa1')]==='yes'){this['channel'][_0xffea('0xa7')](_0xffea('0x19d'));return this[_0xffea('0xf')][_0xffea('0xa1')]();}return this[_0xffea('0xf')][_0xffea('0xa7')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xffea('0x19e')]=function(_0x1fe287){logger[_0xffea('0x2b')](util['format'](_0xffea('0x19f'),_0x1fe287['label']));if(!this[_0xffea('0x7a')](_0x1fe287[_0xffea('0x1a0')])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x1fe287,_0xffea('0x1a1'));}var _0x1241e4=this[_0xffea('0x19')][_0xffea('0x67')](this,_0x1fe287[_0xffea('0x1a0')]);if(!this[_0xffea('0x7a')](_0x1241e4)){return this[_0xffea('0xf')][_0xffea('0x48')](_0x1fe287,util[_0xffea('0x98')](_0xffea('0x1a2'),_0x1fe287['project_id']));}if(_0x1241e4===this['channel'][_0xffea('0x34')]){return this['channel'][_0xffea('0x48')](_0x1fe287,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xffea('0x31')][_0xffea('0x67')](this,_0x1fe287,_0x1241e4);var _0x33ab60=this['channel']['exec']('AGI',util[_0xffea('0x98')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0xffea('0x187')]||_0xffea('0x1a3'),_0x1241e4,this[_0xffea('0xf')][_0xffea('0x34')]));if(_0x33ab60[_0xffea('0x9d')]===-0x1){return _0x33ab60;}return this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')](_0xffea('0x1a4'),_0xffea('0x1a5'),_0x1241e4));};AGIVertices[_0xffea('0x11')][_0xffea('0x1a6')]=function(_0x4383d7){logger[_0xffea('0x2b')](util['format'](_0xffea('0x1a7'),_0x4383d7[_0xffea('0x33')]));var _0x38c203=this[_0xffea('0x1a8')][_0xffea('0x67')](this,_0x4383d7[_0xffea('0x1a9')]);this['createSquareDetailsReport'][_0xffea('0x67')](this,_0x4383d7,_0x4383d7[_0xffea('0x1a9')]);if(this[_0xffea('0x7a')](_0x4383d7[_0xffea('0xc8')])){var _0x487fd8=this['getVariable']['sync'](this,_0x4383d7[_0xffea('0xc8')]);if(_0x487fd8){this[_0xffea('0xf')]['setVariable'](_0x487fd8,_0x38c203);return this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')](_0xffea('0x1aa'),_0x4383d7[_0xffea('0x1a9')],_0x487fd8));}}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x1ab'),_0x4383d7[_0xffea('0x1a9')]));};AGIVertices[_0xffea('0x11')][_0xffea('0x1ac')]=function(_0x349f4c){logger[_0xffea('0x2b')](util['format'](_0xffea('0x1ad'),_0x349f4c[_0xffea('0x33')]));if(!this['isConfigured'](_0x349f4c[_0xffea('0x52')])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0x1ae'));}if(!this[_0xffea('0x7a')](_0x349f4c['text'])){return this[_0xffea('0xf')][_0xffea('0xa7')](_0xffea('0xb2'));}this[_0xffea('0xf')]['noop'](util['format'](_0xffea('0x1af'),_0x349f4c[_0xffea('0x54')]));var _0x2f9539=this[_0xffea('0x51')][_0xffea('0x67')](this,_0x349f4c);if(_0x2f9539){this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2f9539));var _0x4d5a44=this[_0xffea('0xf')][_0xffea('0xeb')](_0x2f9539);try{fs[_0xffea('0x1b0')](_0x2f9539+_0xffea('0xec'));}catch(_0x4dd1df){logger[_0xffea('0x48')](_0x4dd1df);}return _0x4d5a44;}return this[_0xffea('0xf')][_0xffea('0x48')](_0x349f4c,_0xffea('0x1b1'));};AGIVertices[_0xffea('0x11')][_0xffea('0x1b2')]=function(_0x426c4e){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x426c4e[_0xffea('0x33')]));if(!this['isConfigured'](_0x426c4e[_0xffea('0x54')])){return this[_0xffea('0xf')]['noop'](_0xffea('0xb2'));}this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x1b3'),_0x426c4e[_0xffea('0x54')]));var _0x470425=this[_0xffea('0x59')][_0xffea('0x67')](this,_0x426c4e);if(_0x470425){this[_0xffea('0xf')]['noop'](util[_0xffea('0x98')](_0xffea('0x1b4'),_0x470425));var _0x19508e=this['channel'][_0xffea('0xeb')](_0x470425);try{fs[_0xffea('0x1b0')](_0x470425+'.wav');}catch(_0x44c9c0){logger[_0xffea('0x48')](_0x44c9c0);}return _0x19508e;}return this[_0xffea('0xf')][_0xffea('0x48')](_0x426c4e,_0xffea('0x1b5'));};AGIVertices[_0xffea('0x11')]['unpause']=function(_0x45c3b7){logger['info'](util[_0xffea('0x98')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x45c3b7[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x45c3b7[_0xffea('0x147')])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x45c3b7,'no\x20find\x20by\x20configured');}logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x149'),this[_0xffea('0xf')][_0xffea('0x35')],_0x45c3b7['findBy']));var _0x5dd6ab=this[_0xffea('0x49')][_0xffea('0x67')](this,_0x45c3b7[_0xffea('0x147')]);if(_0x5dd6ab){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xffea('0xf')]['callerid'],_0x45c3b7['findBy']));this['channel'][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x14a'),this[_0xffea('0xf')][_0xffea('0x35')],_0x45c3b7[_0xffea('0x147')]));return{'code':0xc8,'result':'success'};}else{logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x14c'),this['channel'][_0xffea('0x35')],_0x45c3b7[_0xffea('0x147')]));this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xffea('0xf')][_0xffea('0x35')],_0x45c3b7['findBy']));return{'code':0xc8,'result':_0xffea('0x14d')};}};AGIVertices['prototype'][_0xffea('0x1b6')]=function(_0x25acea){logger[_0xffea('0x2b')](util[_0xffea('0x98')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x25acea[_0xffea('0x33')]));var _0x382f06=this[_0xffea('0xf')][_0xffea('0x4f')](_0xffea('0x1b7'),[_0x25acea[_0xffea('0x1b8')],_0x25acea[_0xffea('0x70')]]);if(_0x382f06[_0xffea('0x9d')]===-0x1){return _0x382f06;}return this[_0xffea('0xf')][_0xffea('0xa7')](util[_0xffea('0x98')](_0xffea('0x1a4'),_0xffea('0x1b7'),_0x25acea[_0xffea('0x1b8')]));};AGIVertices[_0xffea('0x11')][_0xffea('0x1b9')]=function(_0x4c983a){logger[_0xffea('0x2b')](util[_0xffea('0x98')](_0xffea('0x1ba'),_0x4c983a[_0xffea('0x33')]));if(!this[_0xffea('0x7a')](_0x4c983a[_0xffea('0xc8')])){return this[_0xffea('0xf')][_0xffea('0x48')](_0x4c983a,'no\x20variable\x20selected');}var _0x14be47=this['getVariable']['sync'](this,_0x4c983a[_0xffea('0xc8')]);if(!_0x14be47){return this[_0xffea('0xf')][_0xffea('0x48')](_0x4c983a,_0xffea('0xca'));}var _0x46e419=this[_0xffea('0xf')][_0xffea('0x12')](_0x14be47);return{'code':0xc8,'result':_0x46e419[_0xffea('0x9b')]?_0x46e419[_0xffea('0x9b')]:'-'};};String[_0xffea('0x11')][_0xffea('0x9a')]=function(_0x247d04,_0x5da599){return this['split'](_0x247d04)[_0xffea('0x1bb')](_0x5da599);};module[_0xffea('0x1bc')]=AGIVertices; \ No newline at end of file +var _0x4523=['saveRestApiResult','%s.%s','length','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','exec','noop','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','no\x20grammar\x20configured','grammar','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','sip_id','no\x20user\x20found','opts','url','Executed\x20command\x20%s','DIAL','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','out','Dialogflow\x20Result\x20%s','speech','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','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','test','mindigit','maxdigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','streamFile','ispeech\x20TTS\x20is\x20unreachable','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','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','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','then','name','catch','getSquareProject','getSquareProjectById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervalById','IntervalId','map','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','createSquareRecording','uniqueid','callerid','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','restAPI','method','timeout','number','includes','POST','PUT','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject'];(function(_0x1f5169,_0x50224c){var _0x28989f=function(_0x1fa67b){while(--_0x1fa67b){_0x1f5169['push'](_0x1f5169['shift']());}};_0x28989f(++_0x50224c);}(_0x4523,0x121));var _0x3452=function(_0x90bb6a,_0x2ab087){_0x90bb6a=_0x90bb6a-0x0;var _0xf18e2a=_0x4523[_0x90bb6a];return _0xf18e2a;};'use strict';var fs=require('fs');var path=require(_0x3452('0x0'));var util=require(_0x3452('0x1'));var _=require(_0x3452('0x2'));var sh=require(_0x3452('0x3'));var odbc=require(_0x3452('0x4'))();var rs=require(_0x3452('0x5'));var moment=require(_0x3452('0x6'));var Mustache=require(_0x3452('0x7'));var rp=require(_0x3452('0x8'));var logger=require(_0x3452('0x9'))('agi');var config=require(_0x3452('0xa'));var scripts=require(_0x3452('0xb'));var FILES_PATH=_0x3452('0xc');var recursiveMapAttributes=[_0x3452('0xd'),_0x3452('0xe')];var verticesWithRetry=[_0x3452('0xf'),_0x3452('0x10'),_0x3452('0x11')];var AGIVertices=function(_0x3443a8,_0x2114c7,_0x43668c){this[_0x3452('0x12')]=_0x3443a8;this['rpc']=_0x2114c7;this['mailRpc']=_0x43668c;};AGIVertices[_0x3452('0x13')][_0x3452('0x14')]=function(_0x1e50f2,_0x47b608){this[_0x3452('0x15')][_0x3452('0x16')](_0x1e50f2)[_0x3452('0x17')](function(_0x4ce590){_0x47b608(null,_0x4ce590?_0x4ce590[_0x3452('0x18')]:![]);})[_0x3452('0x19')](function(_0x4a2318){_0x47b608(_0x4a2318);});};AGIVertices[_0x3452('0x13')]['getVoiceQueue']=function(_0x504628,_0x2de83e){this[_0x3452('0x15')]['getVoiceQueueById'](_0x504628)[_0x3452('0x17')](function(_0x34d309){_0x2de83e(null,_0x34d309?_0x34d309['name']:![]);})['catch'](function(_0x1374ea){_0x2de83e(_0x1374ea);});};AGIVertices[_0x3452('0x13')][_0x3452('0x1a')]=function(_0x435f79,_0x48c8eb){this[_0x3452('0x15')][_0x3452('0x1b')](_0x435f79)[_0x3452('0x17')](function(_0xa98b59){_0x48c8eb(null,_0xa98b59?_0xa98b59[_0x3452('0x18')]:![]);})['catch'](function(_0x1f232d){_0x48c8eb(_0x1f232d);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x16f963,_0x2642d9){this[_0x3452('0x15')]['getSquareOdbcById'](_0x16f963)[_0x3452('0x17')](function(_0x530347){_0x2642d9(null,_0x530347?_0x530347[_0x3452('0x1c')]:![]);})['catch'](function(_0x29be44){_0x2642d9(_0x29be44);});};AGIVertices['prototype']['getUser']=function(_0x3b6fdd,_0x1ddd00){this[_0x3452('0x15')][_0x3452('0x1d')](_0x3b6fdd)['then'](function(_0x38d757){_0x1ddd00(null,_0x38d757?_0x38d757[_0x3452('0x18')]:![]);})[_0x3452('0x19')](function(_0x1de6c1){_0x1ddd00(_0x1de6c1);});};AGIVertices['prototype'][_0x3452('0x1e')]=function(_0x29c275,_0x5c9739){this[_0x3452('0x15')][_0x3452('0x1f')](_0x29c275)['then'](function(_0x13daf6){_0x5c9739(null,_0x13daf6?_0x13daf6[_0x3452('0x18')]:![]);})[_0x3452('0x19')](function(_0x17107c){_0x5c9739(_0x17107c);});};AGIVertices[_0x3452('0x13')][_0x3452('0x20')]=function(_0x4dc4a4,_0x54db62){var _0x3ded46=this;this[_0x3452('0x15')]['getSoundById'](_0x4dc4a4)[_0x3452('0x17')](function(_0x2277a1){_0x54db62(null,_0x2277a1?_0x3ded46[_0x3452('0x21')](_0x2277a1[_0x3452('0x22')]):![]);})[_0x3452('0x19')](function(_0x567054){_0x54db62(_0x567054);});};AGIVertices[_0x3452('0x13')][_0x3452('0x23')]=function(_0xdf73d4,_0x37012f){this['rpc']['getMailAccountById'](_0xdf73d4)['then'](function(_0x7d6c74){_0x37012f(null,_0x7d6c74?_0x7d6c74:![]);})[_0x3452('0x19')](function(_0x5ab4bd){_0x37012f(_0x5ab4bd);});};AGIVertices[_0x3452('0x13')][_0x3452('0x24')]=function(_0x22d6e1,_0x271150,_0x1bb78e){this['mailRpc'][_0x3452('0x24')](_0x22d6e1,_0x271150)[_0x3452('0x17')](function(){_0x1bb78e(null);})[_0x3452('0x19')](function(_0x2fdf2d){_0x1bb78e(_0x2fdf2d);});};AGIVertices[_0x3452('0x13')]['getIntervals']=function(_0x32e2bd,_0xe0023a){this['rpc'][_0x3452('0x25')](_0x32e2bd)[_0x3452('0x17')](function(_0x56660b){if(_0x56660b){if(_0x56660b[_0x3452('0x26')]){_0xe0023a(null,[_0x56660b['interval']]);}else{_0xe0023a(null,_[_0x3452('0x27')](_0x56660b['Intervals'],'interval'));}}else{_0xe0023a(null,![]);}})['catch'](function(_0x1ba74c){_0xe0023a(_0x1ba74c);});};AGIVertices[_0x3452('0x13')][_0x3452('0x21')]=function(_0x22e88d){return util[_0x3452('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x22e88d);};AGIVertices[_0x3452('0x13')][_0x3452('0x29')]=function(_0x46e708,_0x15d466,_0x19420f){odbc[_0x3452('0x2a')](_0x46e708,function(_0x30755e){if(_0x30755e){logger[_0x3452('0x2b')](_0x3452('0x2c'),_0x30755e);_0x19420f(_0x30755e);}else{logger[_0x3452('0x2d')](_0x3452('0x2e'));odbc['query'](_0x15d466,function(_0x2ac156,_0x292865){if(_0x2ac156){logger[_0x3452('0x2d')]('Error\x20executing\x20query\x20%s',_0x15d466);_0x19420f(_0x2ac156);}else{logger[_0x3452('0x2d')]('Query\x20executed\x20correctly\x20%s',_0x15d466);odbc[_0x3452('0x2f')](function(_0x5ef1c7){if(_0x5ef1c7){logger[_0x3452('0x2b')](_0x3452('0x30'),_0x5ef1c7);}_0x19420f(null,_0x292865);});}});}});};AGIVertices['prototype'][_0x3452('0x31')]=function(_0x692f5b,_0x530df0){this[_0x3452('0x15')][_0x3452('0x32')](_0x692f5b)[_0x3452('0x17')](function(_0x50aaba){_0x530df0(null,_0x50aaba?_0x50aaba:![]);})[_0x3452('0x19')](function(_0x52a037){_0x530df0(_0x52a037);});};AGIVertices[_0x3452('0x13')][_0x3452('0x33')]=function(_0x5acd90,_0x2613c0){this[_0x3452('0x15')][_0x3452('0x33')](_0x5acd90)[_0x3452('0x17')](function(_0x4818ab){_0x2613c0(null,_0x4818ab);})[_0x3452('0x19')](function(_0x499a69){_0x2613c0(_0x499a69);});};AGIVertices[_0x3452('0x13')][_0x3452('0x34')]=function(_0x4c586a,_0x171cd6,_0xe4cda0){this['rpc'][_0x3452('0x34')]({'uniqueid':this[_0x3452('0x12')]['uniqueid'],'node':_0x4c586a[_0x3452('0x35')],'application':_0x4c586a[_0x3452('0x36')],'data':_0x171cd6||null,'project_name':this['channel'][_0x3452('0x37')],'callerid':this[_0x3452('0x12')]['callerid']})[_0x3452('0x17')](function(_0x139afa){if(_0xe4cda0){_0xe4cda0(null,_0x139afa);}})[_0x3452('0x19')](function(_0x345f64){if(_0xe4cda0){_0xe4cda0(_0x345f64);}});};AGIVertices[_0x3452('0x13')][_0x3452('0x38')]=function(_0x3c2990,_0x52f3a6,_0x2c33e2,_0x8989d7){this['rpc'][_0x3452('0x38')]({'uniqueid':this['channel'][_0x3452('0x39')],'callerid':this[_0x3452('0x12')][_0x3452('0x3a')],'calleridname':this[_0x3452('0x12')]['calleridname'],'context':this[_0x3452('0x12')][_0x3452('0x3b')],'extension':this['channel']['extension'],'priority':this['channel'][_0x3452('0x3c')],'accountcode':this[_0x3452('0x12')][_0x3452('0x3d')],'dnid':this[_0x3452('0x12')][_0x3452('0x3e')],'projectName':this[_0x3452('0x12')][_0x3452('0x37')],'saveName':_0x52f3a6,'filename':_0x3c2990[_0x3452('0x3f')]||_0x52f3a6,'savePath':_0x2c33e2})[_0x3452('0x17')](function(_0x588d92){_0x8989d7(null,_0x588d92);})[_0x3452('0x19')](function(_0x50e6b8){_0x8989d7(_0x50e6b8);});};AGIVertices[_0x3452('0x13')][_0x3452('0x40')]=function(_0x5824b2,_0x5c9457,_0x47ca2f){this[_0x3452('0x15')][_0x3452('0x40')]({'uniqueid':this[_0x3452('0x12')][_0x3452('0x39')],'body':_0x5824b2,'direction':_0x5c9457})[_0x3452('0x17')](function(_0x3f995a){if(_0x47ca2f){_0x47ca2f(null,_0x3f995a);}})['catch'](function(_0x328429){if(_0x47ca2f){_0x47ca2f(_0x328429);}});};AGIVertices[_0x3452('0x13')][_0x3452('0x41')]=function(_0x390185,_0x7434de){this['rpc'][_0x3452('0x41')]({'firstName':_[_0x3452('0x42')](_0x390185['name'])||_[_0x3452('0x43')](_0x390185['name'])?'callback_'+Math[_0x3452('0x44')]():_0x390185[_0x3452('0x18')],'lastName':_['isEmpty'](_0x390185[_0x3452('0x45')])||_[_0x3452('0x43')](_0x390185[_0x3452('0x45')])?null:_0x390185[_0x3452('0x45')],'phone':_0x390185[_0x3452('0x46')],'ListId':_0x390185[_0x3452('0x47')],'scheduledat':_0x390185[_0x3452('0x48')],'callbackUniqueid':this['channel'][_0x3452('0x39')],'tags':_0x3452('0x49'),'description':_0x3452('0x4a')+_0x390185[_0x3452('0x48')][_0x3452('0x4b')](),'priority':_0x390185[_0x3452('0x4c')]})['then'](function(_0x214a36){_0x7434de(null,_0x214a36);})[_0x3452('0x19')](function(_0x614363){_0x7434de(_0x614363);});};AGIVertices[_0x3452('0x13')][_0x3452('0x4d')]=function(_0x22d0c1,_0x12ef2b){this[_0x3452('0x15')][_0x3452('0x4e')](_0x22d0c1)['then'](function(_0x28675e){_0x12ef2b(null,_0x28675e?_0x28675e[_0x3452('0x18')]:![]);})[_0x3452('0x19')](function(_0x353ba9){_0x12ef2b(_0x353ba9);});};AGIVertices[_0x3452('0x13')][_0x3452('0x4f')]=function(_0x59d44e,_0x26b73e,_0x4f4aeb){var _0x25f39e={'role':_0x3452('0x50')};_0x25f39e[_0x59d44e]=this[_0x3452('0x12')]['callerid'];this[_0x3452('0x15')][_0x3452('0x4f')](_0x25f39e,_0x26b73e,this[_0x3452('0x12')][_0x3452('0x39')])[_0x3452('0x17')](function(_0x13870b){_0x4f4aeb(null,_[_0x3452('0x43')](_0x13870b)?![]:!![]);})[_0x3452('0x19')](function(_0x1bc4a9){logger[_0x3452('0x2b')](_0x1bc4a9);_0x4f4aeb(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x48b6a2,_0x3a8570){var _0x1a54d5={'role':'agent'};_0x1a54d5[_0x48b6a2]=this['channel'][_0x3452('0x3a')];this[_0x3452('0x15')][_0x3452('0x51')](_0x1a54d5)[_0x3452('0x17')](function(_0x161cb4){_0x3a8570(null,_[_0x3452('0x43')](_0x161cb4)?![]:!![]);})[_0x3452('0x19')](function(_0x155613){logger[_0x3452('0x2b')](_0x155613);_0x3a8570(null,![]);});};AGIVertices[_0x3452('0x13')][_0x3452('0x52')]=function(_0xd9eb56,_0x526802){var _0x214f99={'role':_0x3452('0x50')};_0x214f99[_0xd9eb56]=this['channel'][_0x3452('0x3a')];this[_0x3452('0x15')][_0x3452('0x52')](_0x214f99)['then'](function(_0x3d3f69){_0x526802(null,_[_0x3452('0x43')](_0x3d3f69)?![]:!![]);})[_0x3452('0x19')](function(_0x14698a){logger[_0x3452('0x2b')](_0x14698a);_0x526802(null,![]);});};AGIVertices[_0x3452('0x13')]['agentLogin']=function(_0x40d69b,_0x36339d){var _0x6a9a2f={'role':_0x3452('0x50')};_0x6a9a2f[_0x40d69b]=this['channel'][_0x3452('0x3a')];var _0x1022c4=_0x40d69b!='internal'?util[_0x3452('0x28')](_0x3452('0x53'),_0x3452('0x54'),this['channel'][_0x3452('0x3a')]):undefined;this[_0x3452('0x15')][_0x3452('0x55')](_0x6a9a2f,_0x1022c4)[_0x3452('0x17')](function(_0x33e6ff){_0x36339d(null,_[_0x3452('0x43')](_0x33e6ff)?![]:!![]);})[_0x3452('0x19')](function(_0x20998a){logger[_0x3452('0x2b')](_0x20998a);_0x36339d(null,![]);});};AGIVertices[_0x3452('0x13')][_0x3452('0x56')]=function(_0x12b46e,_0x3f77c8){sh['exec'](_['trim'](_0x12b46e),function(_0x306bbb,_0x4f3839){var _0x4da794=_0x4f3839[_0x3452('0x57')](/(\r\n|\n|\r)/gm,'');_0x3f77c8(null,_0x4da794);});};AGIVertices[_0x3452('0x13')][_0x3452('0x58')]=function(_0x1934a1,_0x16edd3){scripts['googleCloudTTS'](_0x1934a1['apiKey'],_0x1934a1[_0x3452('0x59')]||_0x3452('0x5a'),_0x1934a1[_0x3452('0x5a')],_0x1934a1['languageCode']||_0x3452('0x5b'),_0x1934a1[_0x3452('0x5c')]||'MALE',_0x1934a1[_0x3452('0x5d')]||_0x3452('0x5e'))[_0x3452('0x17')](function(_0xa9da85){_0x16edd3(null,_0xa9da85);})['catch'](function(_0x59cea6){_0x16edd3(_0x59cea6);});};AGIVertices[_0x3452('0x13')][_0x3452('0x5f')]=function(_0x387f00,_0x54a9f1){scripts[_0x3452('0x5f')](_0x387f00[_0x3452('0x5a')],_0x387f00['google_tts_language']||'en',0x1)[_0x3452('0x17')](function(_0x3f93aa){_0x54a9f1(null,_0x3f93aa);})[_0x3452('0x19')](function(_0x15a057){_0x54a9f1(_0x15a057);});};AGIVertices['prototype'][_0x3452('0x60')]=function(_0x4d0d3a,_0x44ff02){var _0x24f9e7={'uri':_0x4d0d3a['url'],'method':_0x4d0d3a[_0x3452('0x61')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4d0d3a[_0x3452('0x62')])===_0x3452('0x63')&&parseInt(_0x4d0d3a['timeout'])>=0x1?parseInt(_0x4d0d3a[_0x3452('0x62')])*0x3e8:0x5*0x3e8};if(_[_0x3452('0x64')]([_0x3452('0x65'),_0x3452('0x66')],_0x24f9e7[_0x3452('0x61')]['toUpperCase']())){try{_0x24f9e7['body']=_0x4d0d3a[_0x3452('0xe')]?JSON[_0x3452('0x67')](_0x4d0d3a[_0x3452('0xe')]):{};}catch(_0x298c24){logger['error'](_0x3452('0x68'),_0x298c24);}}try{_0x24f9e7[_0x3452('0x69')]=_0x4d0d3a[_0x3452('0xd')]?JSON[_0x3452('0x67')](_0x4d0d3a[_0x3452('0xd')]):{};}catch(_0x35f3e7){logger[_0x3452('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x35f3e7);}if(_0x4d0d3a[_0x3452('0x6a')]){try{var _0x8b95d9=require(_0x4d0d3a[_0x3452('0x6a')])[_0x3452('0x6b')](this,_0x24f9e7);_0x24f9e7[_0x3452('0x6c')]=Mustache[_0x3452('0x6d')](_0x4d0d3a['url'],_0x8b95d9,{},['$$','$$']);if(_0x24f9e7[_0x3452('0x69')]){_0x24f9e7['headers']=JSON[_0x3452('0x67')](Mustache['render'](JSON[_0x3452('0x6e')](_0x24f9e7[_0x3452('0x69')]),_0x8b95d9,{},['$$','$$']));}if(_0x24f9e7[_0x3452('0x6f')]){_0x24f9e7['body']=JSON[_0x3452('0x67')](Mustache[_0x3452('0x6d')](JSON[_0x3452('0x6e')](_0x24f9e7[_0x3452('0x6f')]),_0x8b95d9,{},['$$','$$']));}}catch(_0x34d191){logger[_0x3452('0x2b')](_0x3452('0x70'),_0x34d191);}}rp(_0x24f9e7)['then'](function(_0x27999a){var _0x30c181={'statusCode':_0x27999a[_0x3452('0x71')]||0xc8,'statusMessage':_0x27999a[_0x3452('0x72')]||'OK','headers':_0x27999a[_0x3452('0x69')]||{},'body':_0x27999a[_0x3452('0x6f')]||{}};_0x44ff02(null,_0x30c181);})[_0x3452('0x19')](function(_0x4dc2ab){var _0x189fe1={'statusCode':_0x4dc2ab['statusCode']||0x1f4,'statusMessage':_0x4dc2ab[_0x3452('0x73')]||_0x3452('0x74'),'headers':_0x4dc2ab[_0x3452('0x75')]['headers']||{},'body':_0x4dc2ab['options'][_0x3452('0x6f')]||{}};_0x44ff02(null,_0x189fe1);});};AGIVertices[_0x3452('0x13')][_0x3452('0x76')]=function(_0x4a5b14,_0x25df66){scripts[_0x3452('0x76')](this['channel'][_0x3452('0x39')],_0x4a5b14[_0x3452('0x77')],_0x4a5b14[_0x3452('0x5a')],_0x4a5b14[_0x3452('0x78')]||'en')[_0x3452('0x17')](function(_0x48a95e){_0x25df66(null,_0x48a95e);})[_0x3452('0x19')](function(_0x44197b){_0x25df66(_0x44197b);});};AGIVertices[_0x3452('0x13')]['sestekNDA']=function(_0x2d0994,_0x3c8efa){scripts[_0x3452('0x79')](this[_0x3452('0x12')],_0x2d0994)[_0x3452('0x17')](function(_0x3a3f89){_0x3c8efa(null,_0x3a3f89);})[_0x3452('0x19')](function(_0x577e00){_0x3c8efa(_0x577e00);});};AGIVertices[_0x3452('0x13')][_0x3452('0x7a')]=function(_0x3a577f,_0x19a7f3){scripts[_0x3452('0x7a')](_0x3a577f[_0x3452('0x77')],_0x3a577f[_0x3452('0x5a')],_0x3a577f['ispeech_tts_language']||_0x3452('0x5b'),_0x3a577f[_0x3452('0x7b')])[_0x3452('0x17')](function(_0xbd7f42){_0x19a7f3(null,_0xbd7f42);})[_0x3452('0x19')](function(_0x45b430){_0x19a7f3(_0x45b430);});};AGIVertices[_0x3452('0x13')][_0x3452('0x7c')]=function(_0x24b806,_0x3ebac1,_0x28b1b4){scripts[_0x3452('0x7c')](_0x3ebac1,_0x24b806[_0x3452('0x77')],_0x24b806[_0x3452('0x7d')]||'en-US',this[_0x3452('0x7e')](_0x24b806[_0x3452('0x7f')])?_0x24b806[_0x3452('0x7f')]:undefined)[_0x3452('0x17')](function(_0x3ebdbd){_0x28b1b4(null,_0x3ebdbd);})['catch'](function(_0x306437){_0x28b1b4(_0x306437);});};AGIVertices[_0x3452('0x13')][_0x3452('0x80')]=function(_0x3ec856,_0x167126){scripts[_0x3452('0x80')](_0x3ec856['aws_access_key_id'],_0x3ec856[_0x3452('0x81')],_0x3ec856[_0x3452('0x82')],_0x3ec856['aws_polly_voice']||'Amy',_0x3ec856['text'],_0x3ec856['aws_text_type']||_0x3452('0x5a'))['then'](function(_0x3894bb){_0x167126(null,_0x3894bb);})[_0x3452('0x19')](function(_0x4dfccb){_0x167126(_0x4dfccb);});};AGIVertices[_0x3452('0x13')][_0x3452('0x83')]=function(_0x2d97e7,_0x522835){scripts['awsLex'](this[_0x3452('0x12')][_0x3452('0x39')],_0x2d97e7[_0x3452('0x84')],_0x2d97e7[_0x3452('0x81')],_0x2d97e7[_0x3452('0x85')],_0x2d97e7[_0x3452('0x5a')],_0x2d97e7[_0x3452('0x86')])[_0x3452('0x17')](function(_0x2ebfc0){_0x522835(null,_0x2ebfc0);})[_0x3452('0x19')](function(_0xe2724d){_0x522835(_0xe2724d);});};AGIVertices[_0x3452('0x13')][_0x3452('0x87')]=function(_0xdc7972,_0x5768dc,_0x3a5165){scripts[_0x3452('0x87')](_0x5768dc,_0xdc7972[_0x3452('0x77')],_0xdc7972[_0x3452('0x88')]||_0x3452('0x5b'))[_0x3452('0x17')](function(_0xf3a16b){_0x3a5165(null,_0xf3a16b);})[_0x3452('0x19')](function(_0x56cff9){_0x3a5165(_0x56cff9);});};AGIVertices[_0x3452('0x13')][_0x3452('0x89')]=function(_0x4d64da,_0x24fab1,_0x4895c7){scripts['tildeASR'](_0x24fab1,_0x4d64da['appid'],_0x4d64da[_0x3452('0x8a')],_0x4d64da['uri'])[_0x3452('0x17')](function(_0x4015d9){_0x4895c7(null,_0x4015d9);})[_0x3452('0x19')](function(_0x1ec39a){_0x4895c7(_0x1ec39a);});};AGIVertices['prototype'][_0x3452('0x8b')]=function(_0x524792){var _0x3e2b7c=_['includes'](verticesWithRetry,_0x524792[_0x3452('0x36')])?_0x524792:_[_0x3452('0x8c')](_0x524792);for(var _0x34580d in _0x3e2b7c){if(_0x3e2b7c['hasOwnProperty'](_0x34580d)){if(_0x3e2b7c[_0x34580d]&&_[_0x3452('0x8d')](_0x3e2b7c[_0x34580d])){if(_[_0x3452('0x64')](recursiveMapAttributes,_0x34580d)){_0x3e2b7c[_0x34580d]=this[_0x3452('0x8e')](_0x3e2b7c[_0x34580d]);}else{_0x3e2b7c[_0x34580d]=this[_0x3452('0x8f')](_0x3e2b7c[_0x34580d]);}}}}return _0x3e2b7c;};AGIVertices[_0x3452('0x13')][_0x3452('0x90')]=function(_0x32e0c2){for(var _0x2cbe8a in _0x32e0c2){if(_0x32e0c2[_0x3452('0x91')](_0x2cbe8a)){if(_[_0x3452('0x92')](_0x32e0c2[_0x2cbe8a])){this[_0x3452('0x90')](_0x32e0c2[_0x2cbe8a]);}else if(_['isArray'](_0x32e0c2[_0x2cbe8a])){for(var _0xc23e75=0x0;_0xc23e75<_0x32e0c2[_0x2cbe8a]['length'];_0xc23e75++){this['recursiveNodeIndex'](_0x32e0c2[_0x2cbe8a][_0xc23e75]);}}else if(_['isString'](_0x32e0c2[_0x2cbe8a])){_0x32e0c2[_0x2cbe8a]=this[_0x3452('0x8f')](_0x32e0c2[_0x2cbe8a]);}}}};AGIVertices[_0x3452('0x13')][_0x3452('0x93')]=function(_0x528b31,_0x43f772){for(var _0x57a7c8 in _0x528b31){if(_0x528b31[_0x3452('0x91')](_0x57a7c8)){if(_[_0x3452('0x92')](_0x528b31[_0x57a7c8])){if(!_[_0x3452('0x42')](_0x528b31[_0x57a7c8])){this['saveRestApiResult'](_0x528b31[_0x57a7c8],util[_0x3452('0x28')](_0x3452('0x94'),_0x43f772,_0x57a7c8));}}else if(_['isArray'](_0x528b31[_0x57a7c8])){for(var _0x4574f5=0x0;_0x4574f5<_0x528b31[_0x57a7c8][_0x3452('0x95')];_0x4574f5++){this[_0x3452('0x93')](_0x528b31[_0x57a7c8][_0x4574f5],util[_0x3452('0x28')](_0x3452('0x94'),_0x43f772,_0x57a7c8+'['+_0x4574f5+']'));}}else{if(!_[_0x3452('0x43')](_0x528b31[_0x57a7c8])){this[_0x3452('0x12')][_0x3452('0x96')](util['format'](_0x3452('0x94'),_0x43f772,_0x57a7c8),_0x528b31[_0x57a7c8]);}}}}};AGIVertices[_0x3452('0x13')][_0x3452('0x8e')]=function(_0x105551){try{var _0x1efe09=JSON['parse'](_0x105551);this[_0x3452('0x90')](_0x1efe09);return JSON[_0x3452('0x6e')](_0x1efe09);}catch(_0x3bf12d){return this[_0x3452('0x8f')](_0x105551);}};AGIVertices[_0x3452('0x13')][_0x3452('0x8f')]=function(_0x2d872c){var _0x396499=_0x2d872c[_0x3452('0x97')]('{');for(var _0xafde65=0x1;_0xafde65<_0x396499[_0x3452('0x95')];_0xafde65+=0x1){var _0x3856cf=_0x396499[_0xafde65][_0x3452('0x97')]('}');if(_0x3856cf['length']>0x1){_0x2d872c=_0x2d872c[_0x3452('0x98')]('{'+_0x3856cf[0x0]+'}',this[_0x3452('0x12')][_0x3452('0x14')](_0x3856cf[0x0])[_0x3452('0x99')]||_0x3856cf[0x0]);}}if(_0x396499[_0x3452('0x95')]===0x1){return _0x2d872c[_0x3452('0x4b')]();}return this[_0x3452('0x8f')](_0x2d872c);};AGIVertices['prototype'][_0x3452('0x9a')]=function(_0x2ef30a,_0x1f50d7){var _0x50fa9a=this['channel'][_0x3452('0x14')](_0x2ef30a);if(_0x50fa9a[_0x3452('0x9b')]===-0x1){return _0x50fa9a;}logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x9c'),_0x1f50d7,_0x50fa9a['extra']));return this[_0x3452('0x12')][_0x3452('0x96')](_0x1f50d7,_0x50fa9a[_0x3452('0x99')]);};AGIVertices[_0x3452('0x13')][_0x3452('0x7e')]=function(_0x1b07a3){return _0x1b07a3&&_0x1b07a3!=='0'&&_0x1b07a3!=='-1'&&_0x1b07a3!=='';};AGIVertices[_0x3452('0x13')][_0x3452('0x9d')]=function(_0x4260ca){this[_0x3452('0x34')]['sync'](this,_0x4260ca,'-');_0x4260ca[_0x3452('0x9e')]=_0x4260ca[_0x3452('0x9d')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3452('0x13')][_0x3452('0x9f')]=function(_0x2c0ad2){logger[_0x3452('0x2d')](util['format'](_0x3452('0xa0'),_0x2c0ad2[_0x3452('0x35')]));return this[_0x3452('0x12')][_0x3452('0x9f')]([_0x2c0ad2[_0x3452('0xa1')],_0x2c0ad2[_0x3452('0xa2')]]);};AGIVertices[_0x3452('0x13')][_0x3452('0xa3')]=function(_0x59ef7c){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x59ef7c[_0x3452('0x35')]));if(this[_0x3452('0x7e')](_0x59ef7c['timeout'])){logger[_0x3452('0x2d')](util['format'](_0x3452('0xa4'),_0x59ef7c['timeout']));var _0xd86cab=this['channel'][_0x3452('0xa5')](_0x59ef7c[_0x3452('0x62')]);if(_0xd86cab['result']===-0x1){return _0xd86cab;}}return this[_0x3452('0x12')]['answer']();};AGIVertices['prototype'][_0x3452('0x49')]=function(_0x4dd525){logger['info'](util[_0x3452('0x28')](_0x3452('0xa6'),_0x4dd525[_0x3452('0x35')]));if(!this['isConfigured'](_0x4dd525[_0x3452('0x47')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x4dd525,_0x3452('0xa7'));}_0x4dd525[_0x3452('0x48')]=moment();if(this[_0x3452('0x7e')](_0x4dd525[_0x3452('0xa8')])){_0x4dd525[_0x3452('0x48')]=moment()[_0x3452('0xa9')](_0x4dd525[_0x3452('0xa8')],_0x3452('0xaa'));}if(!this[_0x3452('0x7e')](_0x4dd525[_0x3452('0x4c')])){_0x4dd525['callback_priority']=0x2;}this['createCmContact'][_0x3452('0x6b')](this,_0x4dd525);return this[_0x3452('0x12')]['noop'](util[_0x3452('0x28')](_0x3452('0xab'),_0x4dd525[_0x3452('0x46')],_0x4dd525[_0x3452('0x47')],_0x4dd525[_0x3452('0x48')]));};AGIVertices[_0x3452('0x13')][_0x3452('0xac')]=function(_0x11ee05){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x11ee05[_0x3452('0x35')]));var _0x153ce4=this[_0x3452('0x12')][_0x3452('0xad')](_0x11ee05['application'],_0x11ee05[_0x3452('0x75')]);if(_0x153ce4[_0x3452('0x9b')]===-0x1){return _0x153ce4;}return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xaf'),_0x11ee05[_0x3452('0xb0')],_0x11ee05['options']));};AGIVertices[_0x3452('0x13')][_0x3452('0xb1')]=function(_0x888a58){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0xb2'),_0x888a58[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x888a58[_0x3452('0x5a')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0xb3'));}var _0x167d99='\x22'+_0x888a58['text']+'\x22';if(this[_0x3452('0x7e')](_0x888a58[_0x3452('0x75')])){_0x167d99+=','+_0x888a58[_0x3452('0x75')];}var _0x4a5501=this[_0x3452('0x12')][_0x3452('0xad')](_0x3452('0xb4'),_0x167d99);if(_0x4a5501[_0x3452('0x9b')]===-0x1){return _0x4a5501;}return this[_0x3452('0x12')][_0x3452('0xae')](util['format'](_0x3452('0xb5'),_0x167d99));};AGIVertices[_0x3452('0x13')][_0x3452('0xb6')]=function(_0x75d829){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x75d829[_0x3452('0x35')]));if(!this['isConfigured'](_0x75d829[_0x3452('0x5a')])){return this[_0x3452('0x12')][_0x3452('0xae')]('no\x20text\x20configured');}var _0x5db797='\x22'+_0x75d829['text']+'\x22';if(this[_0x3452('0x7e')](_0x75d829['options'])){_0x5db797+=','+_0x75d829['options'];}var _0x270d23=this[_0x3452('0x12')][_0x3452('0xad')](_0x3452('0xb4'),_0x5db797);if(_0x270d23[_0x3452('0x9b')]===-0x1){return _0x270d23;}return this[_0x3452('0x12')][_0x3452('0xae')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x5db797));};AGIVertices[_0x3452('0x13')][_0x3452('0xb7')]=function(_0x19a34c){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x19a34c[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x19a34c['grammar'])){return this[_0x3452('0x12')]['noop'](_0x3452('0xb8'));}var _0x4300a8=_0x19a34c[_0x3452('0xb9')];if(this['isConfigured'](_0x19a34c['options'])){_0x4300a8+=','+_0x19a34c['options'];}var _0x48d4fb=this[_0x3452('0x12')][_0x3452('0xad')]('MRCPRecog',_0x4300a8);if(_0x48d4fb[_0x3452('0x9b')]===-0x1){return _0x48d4fb;}var _0x5f569f=this[_0x3452('0x9a')](_0x3452('0xba'),_0x3452('0xbb'));if(_0x5f569f[_0x3452('0x9b')]===-0x1){return _0x5f569f;}var _0x1982a3=this['getAndSetVariable'](_0x3452('0xbc'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x1982a3[_0x3452('0x9b')]===-0x1){return _0x1982a3;}var _0x4a12bb=this[_0x3452('0x9a')](_0x3452('0xbd'),_0x3452('0xbe'));if(_0x4a12bb[_0x3452('0x9b')]===-0x1){return _0x4a12bb;}return this['channel'][_0x3452('0xae')](util[_0x3452('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4300a8));};AGIVertices[_0x3452('0x13')][_0x3452('0xbf')]=function(_0x205567){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0xc0'),_0x205567['label']));if(!this[_0x3452('0x7e')](_0x205567[_0x3452('0xb9')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x41dd2b=_0x205567[_0x3452('0xb9')];if(this[_0x3452('0x7e')](_0x205567[_0x3452('0x75')])){_0x41dd2b+=','+_0x205567['options'];}var _0x4d2b05=this[_0x3452('0x12')][_0x3452('0xad')](_0x3452('0xc1'),_0x41dd2b);if(_0x4d2b05[_0x3452('0x9b')]===-0x1){return _0x4d2b05;}var _0x570a16=this['getAndSetVariable'](_0x3452('0xba'),_0x3452('0xc2'));if(_0x570a16[_0x3452('0x9b')]===-0x1){return _0x570a16;}var _0x596626=this[_0x3452('0x9a')](_0x3452('0xbc'),_0x3452('0xc3'));if(_0x596626[_0x3452('0x9b')]===-0x1){return _0x596626;}var _0x599acf=this[_0x3452('0x9a')](_0x3452('0xbd'),_0x3452('0xc4'));if(_0x599acf['result']===-0x1){return _0x599acf;}return this['channel'][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xc5'),_0x41dd2b));};AGIVertices[_0x3452('0x13')][_0x3452('0xc6')]=function(_0x5912f2){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0xc7'),_0x5912f2[_0x3452('0x35')]));if(!this['isConfigured'](_0x5912f2['odbc_id'])){return this[_0x3452('0x12')]['error'](_0x5912f2,_0x3452('0xc8'));}var _0xbca05a=this[_0x3452('0xc9')][_0x3452('0x6b')](this,_0x5912f2[_0x3452('0xca')]);if(!_0xbca05a){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x5912f2,_0x3452('0xcb'));}if(!this['isConfigured'](_0x5912f2[_0x3452('0xcc')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x5912f2,_0x3452('0xcd'));}var _0x3df34b=_0x5912f2[_0x3452('0xcc')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x3452('0xae')](util[_0x3452('0x28')]('query:\x20%s',_0x3df34b));var _0x317d38=this[_0x3452('0x29')][_0x3452('0x6b')](this,_0xbca05a,_0x3df34b);this[_0x3452('0x34')]['sync'](this,_0x5912f2,_0x3df34b);if(!this[_0x3452('0x7e')](_0x5912f2[_0x3452('0xce')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0xcf'));}var _0x7e1566=this[_0x3452('0x14')][_0x3452('0x6b')](this,_0x5912f2[_0x3452('0xce')]);if(!_0x7e1566){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x5912f2,_0x3452('0xd0'));}var _0x5de2bb=this;_0x317d38['forEach'](function(_0x441174,_0x59ccc6){Object[_0x3452('0xd1')](_0x441174)[_0x3452('0xd2')](function(_0x15c42d){_0x5de2bb[_0x3452('0x12')][_0x3452('0x96')](util['format'](_0x3452('0xd3'),_0x7e1566,_0x59ccc6,_0x15c42d),_0x441174[_0x15c42d]);});});this[_0x3452('0x12')][_0x3452('0x96')](util['format']('%s_ROWS_COUNT',_0x7e1566),_0x317d38[_0x3452('0x95')]);return this[_0x3452('0x12')]['noop'](util[_0x3452('0x28')](_0x3452('0xd4'),_0x7e1566));};AGIVertices[_0x3452('0x13')][_0x3452('0xd5')]=function(_0x2c932a){logger[_0x3452('0xd6')](util['format'](_0x3452('0xd7'),_0x2c932a[_0x3452('0x35')]));if(!this['isConfigured'](_0x2c932a['sip_id'])){return this['channel'][_0x3452('0x2b')](_0x2c932a,_0x3452('0xd8'));}var _0x3342d0=this[_0x3452('0xd9')]['sync'](this,_0x2c932a[_0x3452('0xda')]);if(!_0x3342d0){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x2c932a,_0x3452('0xdb'));}var _0x17b219=this[_0x3452('0x12')]['exec']('DIAL',[util['format']('SIP/%s',_0x3342d0),_0x2c932a[_0x3452('0x62')],_0x2c932a[_0x3452('0xdc')],_0x2c932a[_0x3452('0xdd')]]);if(_0x17b219[_0x3452('0x9b')]===-0x1){return _0x17b219;}return this[_0x3452('0x12')]['noop'](util[_0x3452('0x28')](_0x3452('0xde'),_0x3452('0xdf')));};AGIVertices[_0x3452('0x13')][_0x3452('0xe0')]=function(_0x5561d0){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5561d0[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x5561d0[_0x3452('0x77')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0xe1'));}if(!this[_0x3452('0x7e')](_0x5561d0[_0x3452('0x5a')])){return this[_0x3452('0x12')][_0x3452('0xae')]('no\x20text\x20configured');}this[_0x3452('0x12')][_0x3452('0xe2')]=!![];this[_0x3452('0x34')](_0x5561d0);this['createSquareMessage'](_0x5561d0[_0x3452('0x5a')],'in');this[_0x3452('0x12')][_0x3452('0xae')](util['format'](_0x3452('0xe3'),_0x5561d0[_0x3452('0x5a')]));var _0x56ab74=this[_0x3452('0x76')][_0x3452('0x6b')](this,_0x5561d0);if(_0x56ab74){for(var _0x3fa775 in _0x56ab74){if(_0x56ab74[_0x3452('0x91')](_0x3fa775)){this['channel'][_0x3452('0x96')](util['format'](_0x3452('0xe4'),_0x3fa775[_0x3452('0xe5')]()),_0x56ab74[_0x3fa775]);}}this[_0x3452('0x40')](_0x56ab74['speech'],_0x3452('0xe6'));return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xe7'),_0x56ab74[_0x3452('0xe8')]));}return this[_0x3452('0x12')][_0x3452('0x2b')](_0x5561d0,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x3452('0x13')][_0x3452('0xe9')]=function(_0x158333){logger['info'](util[_0x3452('0x28')](_0x3452('0xea'),_0x158333[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x158333['ndauth_url'])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0xeb'));}if(!this[_0x3452('0x7e')](_0x158333['username'])){return this['channel']['noop'](_0x3452('0xec'));}if(!this['isConfigured'](_0x158333[_0x3452('0xed')])){return this[_0x3452('0x12')]['noop']('no\x20password\x20configured');}if(!this[_0x3452('0x7e')](_0x158333[_0x3452('0xee')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0xb3'));}this[_0x3452('0x12')][_0x3452('0xe2')]=!![];this[_0x3452('0x34')](_0x158333);this[_0x3452('0x40')](_0x158333[_0x3452('0x5a')],'in');this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xef'),_0x158333[_0x3452('0x5a')]));var _0x2e19f8=this[_0x3452('0x79')]['sync'](this,_0x158333);if(_0x2e19f8){for(var _0x14d02a in _0x2e19f8){if(_0x2e19f8[_0x3452('0x91')](_0x14d02a)){this[_0x3452('0x12')][_0x3452('0x96')](util[_0x3452('0x28')](_0x3452('0xf0'),_0x14d02a[_0x3452('0xe5')]()),_0x2e19f8[_0x14d02a]);}}this['createSquareMessage'](_0x2e19f8[_0x3452('0xe8')],_0x3452('0xe6'));if(_0x2e19f8[_0x3452('0xf1')]){this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xf2'),_0x2e19f8['audiofile']));var _0x403c6d=this[_0x3452('0x12')]['streamFile'](_0x2e19f8[_0x3452('0xf1')]);try{fs[_0x3452('0xf3')](_0x2e19f8[_0x3452('0xf1')]+_0x3452('0xf4'));}catch(_0x28180c){logger['error'](_0x28180c);}return _0x403c6d;}else{return this[_0x3452('0x12')][_0x3452('0xae')](util['format']('SestekNDA\x20Result\x20%s',_0x2e19f8[_0x3452('0xe8')]));}}return this[_0x3452('0x12')][_0x3452('0x2b')](_0x158333,_0x3452('0xf5'));};AGIVertices['prototype'][_0x3452('0xf6')]=function(_0x32f5fb){logger['info'](util['format'](_0x3452('0xf7'),_0x32f5fb['label']));return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0xf6'));};AGIVertices[_0x3452('0x13')][_0x3452('0xf8')]=function(_0x4ca0c9){logger['info'](util[_0x3452('0x28')](_0x3452('0xf9'),_0x4ca0c9[_0x3452('0x35')]));var _0x116386='';if(_0x4ca0c9[_0x3452('0xfa')]){if(!this[_0x3452('0x7e')](_0x4ca0c9[_0x3452('0xfa')])){return this[_0x3452('0x12')]['error'](_0x4ca0c9,_0x3452('0xfb'));}else{var _0x4a72ef=parseInt(_0x4ca0c9[_0x3452('0xfa')],0xa);if(isNaN(_0x4a72ef)){_0x116386=_0x4ca0c9[_0x3452('0xfa')];}else{_0x116386=this[_0x3452('0x1e')][_0x3452('0x6b')](this,_0x4ca0c9[_0x3452('0xfa')]);if(!_0x116386){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x4ca0c9,_0x3452('0xfc'));}}}}else if(_0x4ca0c9[_0x3452('0xfd')]){_0x116386=_0x4ca0c9[_0x3452('0xfd')];}else{return this[_0x3452('0x12')][_0x3452('0x2b')](_0x4ca0c9,'no\x20trunk\x20selected');}var _0xdced20=this['channel'][_0x3452('0xad')](_0x3452('0xdf'),[util[_0x3452('0x28')](_0x3452('0xfe'),_0x116386,_0x4ca0c9[_0x3452('0x46')]),_0x4ca0c9[_0x3452('0x62')],_0x4ca0c9[_0x3452('0xdc')],_0x4ca0c9[_0x3452('0xdd')]]);if(_0xdced20['result']===-0x1){return _0xdced20;}return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xde'),_0x3452('0xdf')));};AGIVertices[_0x3452('0x13')][_0x3452('0xff')]=function(_0x4e52e6){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x100'),_0x4e52e6['label']));return this['channel'][_0x3452('0xae')](_0x3452('0xff'));};AGIVertices['prototype'][_0x3452('0x10')]=function(_0x49b786){logger['info'](util[_0x3452('0x28')](_0x3452('0x101'),_0x49b786[_0x3452('0x35')]));if(_0x49b786[_0x3452('0x9e')]===0x0){return this[_0x3452('0x9d')](_0x49b786);}_0x49b786[_0x3452('0x9e')]-=0x1;if(!this[_0x3452('0x7e')](_0x49b786[_0x3452('0x102')])){return this['channel'][_0x3452('0x2b')](_0x49b786,_0x3452('0x103'));}var _0x3573c7=this[_0x3452('0x20')][_0x3452('0x6b')](this,_0x49b786[_0x3452('0x102')]);if(!_0x3573c7){return this[_0x3452('0x12')]['error'](_0x49b786,_0x3452('0x104'));}if(!this['isConfigured'](_0x49b786[_0x3452('0xce')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x3452('0xcf'));}var _0x5b8682=this[_0x3452('0x12')][_0x3452('0x105')](_0x3573c7,_0x49b786['response'],_0x49b786['maxdigit']);var _0x5c0215=_0x5b8682[_0x3452('0x9b')]?_0x5b8682[_0x3452('0x9b')][_0x3452('0x4b')]():'';logger[_0x3452('0x2d')](_0x3452('0x106'),JSON[_0x3452('0x6e')](_0x5b8682));if(_0x5b8682[_0x3452('0x9b')]===-0x1){this['createSquareDetailsReport'][_0x3452('0x6b')](this,_0x49b786,_0x5c0215);return _0x5b8682;}else if(_0x5b8682[_0x3452('0x99')]===_0x3452('0x62')){_0x5b8682['result']=_0x5c0215[_0x3452('0x95')]>=parseInt(_0x49b786['mindigit'])?'x':'i';}else{_0x5b8682[_0x3452('0x9b')]=_0x5c0215[_0x3452('0x95')]>=parseInt(_0x49b786[_0x3452('0x107')])&&_0x5c0215[_0x3452('0x95')]<=parseInt(_0x49b786[_0x3452('0x108')])?'x':'i';}var _0x247012=this['getVariable'][_0x3452('0x6b')](this,_0x49b786[_0x3452('0xce')]);if(!_0x247012){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x49b786,'no\x20variable\x20found');}this['channel']['setVariable'](_0x247012,_0x5c0215);if(this[_0x3452('0x7e')](_0x49b786['hiddendigitsnum'])){var _0x2f651f=parseInt(_0x49b786[_0x3452('0x109')],0xa);var _0x3577e4=rs[_0x3452('0x10a')]({'charset':'*','length':_0x2f651f});var _0x1a9da6=_0x5c0215[_0x3452('0x95')];if(_0x1a9da6>0x0){if(_0x1a9da6>_0x2f651f){this[_0x3452('0x34')]['sync'](this,_0x49b786,_0x49b786['hiddendigitspos']===_0x3452('0x10b')?_0x3577e4+_0x5c0215['substr'](_0x2f651f):_0x5c0215[_0x3452('0x10c')](0x0,_0x1a9da6-_0x2f651f)+_0x3577e4);}else{this[_0x3452('0x34')][_0x3452('0x6b')](this,_0x49b786,rs[_0x3452('0x10a')]({'charset':'*','length':_0x1a9da6}));}}else{this[_0x3452('0x34')]['sync'](this,_0x49b786,'');}}else{this[_0x3452('0x34')][_0x3452('0x6b')](this,_0x49b786,_0x5c0215);}return _0x5b8682;};AGIVertices['prototype'][_0x3452('0x11')]=function(_0x313f46){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x10d'),_0x313f46['label']));return this[_0x3452('0x10')](_0x313f46);};AGIVertices[_0x3452('0x13')]['goal']=function(_0xb40007){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x10e'),_0xb40007[_0x3452('0x35')]));this[_0x3452('0x34')][_0x3452('0x6b')](this,_0xb40007,_0xb40007[_0x3452('0x10f')]);return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x110'),_0xb40007[_0x3452('0x10f')]));};AGIVertices['prototype'][_0x3452('0x111')]=function(_0x11ce80){logger['info'](util[_0x3452('0x28')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x11ce80['label']));if(!this['isConfigured'](_0x11ce80[_0x3452('0x84')])||!this[_0x3452('0x7e')](_0x11ce80[_0x3452('0x81')])){return this[_0x3452('0x12')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x3452('0x7e')](_0x11ce80[_0x3452('0x5a')])){return this['channel'][_0x3452('0xae')](_0x3452('0xb3'));}this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x112'),_0x11ce80[_0x3452('0x5a')]));var _0x128948=this[_0x3452('0x80')][_0x3452('0x6b')](this,_0x11ce80);if(_0x128948){this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')]('aws\x20Polly\x20%s\x20file\x20created',_0x128948));var _0x2c7631=this[_0x3452('0x12')]['streamFile'](_0x128948);try{fs[_0x3452('0xf3')](_0x128948+_0x3452('0xf4'));}catch(_0x26de10){logger[_0x3452('0x2b')](_0x26de10);}return _0x2c7631;}return this[_0x3452('0x12')][_0x3452('0x2b')](_0x11ce80,_0x3452('0x113'));};AGIVertices[_0x3452('0x13')][_0x3452('0x114')]=function(_0xa8fbd1){logger['info'](util['format'](_0x3452('0x115'),_0xa8fbd1[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0xa8fbd1[_0x3452('0x84')])||!this[_0x3452('0x7e')](_0xa8fbd1[_0x3452('0x81')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0x116'));}if(!this[_0x3452('0x7e')](_0xa8fbd1[_0x3452('0x86')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0x117'));}if(!this[_0x3452('0x7e')](_0xa8fbd1['text'])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0xb3'));}this[_0x3452('0x12')][_0x3452('0xe2')]=!![];this[_0x3452('0x34')](_0xa8fbd1);this[_0x3452('0x40')](_0xa8fbd1[_0x3452('0x5a')],'in');this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x118'),_0xa8fbd1[_0x3452('0x5a')]));var _0x24909e=this[_0x3452('0x83')]['sync'](this,_0xa8fbd1);if(_0x24909e){for(var _0x807f31 in _0x24909e){if(_0x24909e[_0x3452('0x91')](_0x807f31)&&_['isString'](_0x24909e[_0x807f31])){this[_0x3452('0x12')][_0x3452('0x96')](util[_0x3452('0x28')](_0x3452('0x119'),_0x807f31[_0x3452('0xe5')]()),_0x24909e[_0x807f31]);}}if(_['isNil'](_0x24909e[_0x3452('0x73')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0x11a'));}else{this['createSquareMessage'](_0x24909e[_0x3452('0x73')],_0x3452('0xe6'));return this[_0x3452('0x12')][_0x3452('0xae')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x24909e[_0x3452('0x73')]));}}return this[_0x3452('0x12')][_0x3452('0x2b')](_0xa8fbd1,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x3452('0x11b')]=function(_0x1b4788){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x11c'),_0x1b4788['label'],_0x1b4788['timeout']));if(!this['isConfigured'](_0x1b4788[_0x3452('0x77')])){return this['channel']['noop']('no\x20key\x20configured');}var _0x29f770=_0x3452('0x11d');var _0x169057=util[_0x3452('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x3452('0x10a')](0x4));var _0x113b8f=util[_0x3452('0x28')](_0x3452('0x94'),_0x169057,_0x29f770);var _0x2ee042=!![];if(_0x1b4788[_0x3452('0x11e')]===_0x3452('0x11f')){_0x2ee042=![];}var _0x34b6fa=this[_0x3452('0x12')][_0x3452('0x120')](_0x169057,_0x29f770,_0x1b4788[_0x3452('0x121')],_0x1b4788[_0x3452('0x62')],undefined,_0x2ee042);if(_0x34b6fa[_0x3452('0x9b')]!==-0x1){this[_0x3452('0x12')]['noop'](util[_0x3452('0x28')](_0x3452('0x122'),_0x113b8f));var _0x425ba1=this[_0x3452('0x87')]['sync'](this,_0x1b4788,_0x113b8f);if(_0x425ba1){for(var _0x5b2470 in _0x425ba1){if(_0x425ba1[_0x3452('0x91')](_0x5b2470)){this['channel'][_0x3452('0x96')](util['format']('GOOGLE_ASR_%s',_0x5b2470['toUpperCase']()),_0x425ba1[_0x5b2470]);}}return this[_0x3452('0x12')][_0x3452('0xae')](util['format'](_0x3452('0x123'),JSON[_0x3452('0x6e')](_0x425ba1)));}}return _0x34b6fa;};AGIVertices['prototype'][_0x3452('0x124')]=function(_0x5d4f0f){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x5d4f0f[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x5d4f0f['appid'])){return this[_0x3452('0x12')][_0x3452('0xae')]('no\x20appid\x20configured');}if(!this[_0x3452('0x7e')](_0x5d4f0f[_0x3452('0x8a')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0x125'));}var _0xed9aa3=_0x3452('0x11d');var _0x2689b5=util[_0x3452('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x3452('0x10a')](0x4));var _0x1df2e7=util['format'](_0x3452('0x94'),_0x2689b5,_0xed9aa3);var _0x316970=!![];if(_0x5d4f0f[_0x3452('0x11e')]==='NOBEEP'){_0x316970=![];}var _0x2eaa53=this[_0x3452('0x12')][_0x3452('0x120')](_0x2689b5,_0xed9aa3,_0x5d4f0f[_0x3452('0x121')],_0x5d4f0f['timeout'],undefined,_0x316970);if(_0x2eaa53[_0x3452('0x9b')]!==-0x1){this[_0x3452('0x12')][_0x3452('0xae')](util['format'](_0x3452('0x126'),_0x1df2e7));var _0x17960d=this[_0x3452('0x89')][_0x3452('0x6b')](this,_0x5d4f0f,_0x1df2e7);if(_0x17960d){for(var _0x42874d in _0x17960d){if(_0x17960d[_0x3452('0x91')](_0x42874d)){this['channel'][_0x3452('0x96')](util['format']('TILDE_ASR_%s',_0x42874d[_0x3452('0xe5')]()),_0x17960d[_0x42874d]);}}return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x127'),JSON[_0x3452('0x6e')](_0x17960d)));}}return _0x2eaa53;};AGIVertices['prototype'][_0x3452('0x128')]=function(_0x20d67e){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x129'),_0x20d67e[_0x3452('0x35')]));return this[_0x3452('0x12')][_0x3452('0x12a')](_0x20d67e['context'],_0x20d67e['extension'],_0x20d67e[_0x3452('0x3c')]);};AGIVertices[_0x3452('0x13')][_0x3452('0x12b')]=function(_0x538dc5){logger[_0x3452('0x2d')](util['format'](_0x3452('0x12c'),_0x538dc5[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x538dc5[_0x3452('0x12d')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x538dc5,'no\x20condition\x20configured');}try{var _0x29bb11=eval(_0x538dc5['condition'])?_0x3452('0x12e'):_0x3452('0x12f');this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x130'),_0x538dc5[_0x3452('0x12d')],_0x29bb11));return{'code':0xc8,'result':_0x29bb11};}catch(_0xb8c396){return{'code':0xc8,'result':_0x3452('0x12f')};}};AGIVertices[_0x3452('0x13')][_0x3452('0x131')]=function(_0x1da6d3){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x132'),_0x1da6d3[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x1da6d3[_0x3452('0x133')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x1da6d3,_0x3452('0x134'));}var _0x16430e=this[_0x3452('0x135')]['sync'](this,_0x1da6d3[_0x3452('0x133')]);if(!_0x16430e){return this[_0x3452('0x12')]['error'](_0x1da6d3,_0x3452('0x136'));}for(var _0x2d2401=0x0;_0x2d2401<_0x16430e[_0x3452('0x95')];_0x2d2401+=0x1){var _0x21406e=this[_0x3452('0x12')]['getVariable'](util[_0x3452('0x28')](_0x3452('0x137'),_0x16430e[_0x2d2401]));if(_0x21406e[_0x3452('0x9b')]===-0x1){return _0x21406e;}logger[_0x3452('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0x16430e[_0x2d2401],_0x21406e[_0x3452('0x99')]));if(_0x21406e[_0x3452('0x99')]===_0x3452('0x12e')){logger[_0x3452('0x2d')](util['format'](_0x3452('0x138'),_0x16430e[_0x2d2401],_0x3452('0x12e')));this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x138'),_0x16430e[_0x2d2401],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x138'),_0x16430e[_0x2d2401],_0x3452('0x12f')));this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x138'),_0x16430e[_0x2d2401],'false'));}}return{'code':0xc8,'result':_0x3452('0x12f')};};AGIVertices['prototype'][_0x3452('0x139')]=function(_0x26651b){logger[_0x3452('0x2d')](util['format'](_0x3452('0x13a'),_0x26651b['label']));return this[_0x3452('0x12')][_0x3452('0x139')]();};AGIVertices[_0x3452('0x13')][_0x3452('0x13b')]=function(_0x3e9d3d){logger['info'](util[_0x3452('0x28')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x3e9d3d[_0x3452('0x35')]));if(!this['isConfigured'](_0x3e9d3d[_0x3452('0x77')])){return this[_0x3452('0x12')]['noop'](_0x3452('0xe1'));}var _0x2e3bd7='wav';var _0x2c4d86=util[_0x3452('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x3452('0x10a')](0x4));var _0x25ad0a=util[_0x3452('0x28')](_0x3452('0x94'),_0x2c4d86,_0x2e3bd7);var _0x37ac8f=!![];if(_0x3e9d3d[_0x3452('0x11e')]===_0x3452('0x11f')){_0x37ac8f=![];}var _0x26b9f5=this['channel'][_0x3452('0x120')](_0x2c4d86,_0x2e3bd7,_0x3e9d3d[_0x3452('0x121')],_0x3e9d3d['timeout'],undefined,_0x37ac8f);if(_0x26b9f5[_0x3452('0x9b')]!==-0x1){this[_0x3452('0x12')]['noop'](util[_0x3452('0x28')]('ispeech\x20%s\x20file\x20created',_0x25ad0a));var _0x2325de=this[_0x3452('0x7c')]['sync'](this,_0x3e9d3d,_0x25ad0a);if(_0x2325de){for(var _0x52d48e in _0x2325de){if(_0x2325de[_0x3452('0x91')](_0x52d48e)){this[_0x3452('0x12')][_0x3452('0x96')](util[_0x3452('0x28')](_0x3452('0x13c'),_0x52d48e[_0x3452('0xe5')]()),_0x2325de[_0x52d48e]);}}return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')]('IspeechASR\x20Result\x20%s',JSON[_0x3452('0x6e')](_0x2325de)));}}return _0x26b9f5;};AGIVertices[_0x3452('0x13')][_0x3452('0x13d')]=function(_0x2e4b08){logger['info'](util[_0x3452('0x28')](_0x3452('0x13e'),_0x2e4b08['label']));if(!this['isConfigured'](_0x2e4b08[_0x3452('0x77')])){return this['channel'][_0x3452('0xae')](_0x3452('0xe1'));}if(!this['isConfigured'](_0x2e4b08['text'])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0xb3'));}this[_0x3452('0x12')]['noop'](util['format'](_0x3452('0x13f'),_0x2e4b08['text']));var _0x15ba8b=this['ispeechTTS']['sync'](this,_0x2e4b08);if(_0x15ba8b){this[_0x3452('0x12')]['noop'](util['format'](_0x3452('0x140'),_0x15ba8b));var _0x5be459=this[_0x3452('0x12')][_0x3452('0x141')](_0x15ba8b,_0x2e4b08[_0x3452('0x121')]);try{fs['unlink'](_0x15ba8b+_0x3452('0xf4'));}catch(_0x3e41cd){logger[_0x3452('0x2b')](_0x3e41cd);}return _0x5be459;}return this[_0x3452('0x12')][_0x3452('0x2b')](_0x2e4b08,_0x3452('0x142'));};AGIVertices[_0x3452('0x13')]['login']=function(_0x5f5101){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x5f5101[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x5f5101['findBy'])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x5f5101,_0x3452('0x143'));}logger['info'](util['format'](_0x3452('0x144'),this[_0x3452('0x12')]['callerid'],_0x5f5101[_0x3452('0x145')]));var _0x4fb120=this[_0x3452('0x55')][_0x3452('0x6b')](this,_0x5f5101[_0x3452('0x145')]);if(_0x4fb120){logger['info'](util[_0x3452('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x3452('0x3a')],_0x5f5101['findBy']));this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x146'),this[_0x3452('0x12')]['callerid'],_0x5f5101['findBy']));return{'code':0xc8,'result':_0x3452('0x147')};}else{logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x148'),this[_0x3452('0x12')]['callerid'],_0x5f5101[_0x3452('0x145')]));this['channel'][_0x3452('0xae')](util['format'](_0x3452('0x148'),this[_0x3452('0x12')][_0x3452('0x3a')],_0x5f5101[_0x3452('0x145')]));return{'code':0xc8,'result':_0x3452('0x149')};}};AGIVertices[_0x3452('0x13')]['logout']=function(_0x20f392){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x14a'),_0x20f392[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x20f392[_0x3452('0x145')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x20f392,_0x3452('0x143'));}logger[_0x3452('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3452('0x12')]['callerid'],_0x20f392[_0x3452('0x145')]));var _0x38c819=this[_0x3452('0x52')][_0x3452('0x6b')](this,_0x20f392['findBy']);if(_0x38c819){logger[_0x3452('0x2d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x3452('0x12')]['callerid'],_0x20f392['findBy']));this['channel'][_0x3452('0xae')](util['format'](_0x3452('0x146'),this['channel'][_0x3452('0x3a')],_0x20f392['findBy']));return{'code':0xc8,'result':_0x3452('0x147')};}else{logger['info'](util[_0x3452('0x28')](_0x3452('0x148'),this['channel'][_0x3452('0x3a')],_0x20f392[_0x3452('0x145')]));this[_0x3452('0x12')][_0x3452('0xae')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3452('0x12')]['callerid'],_0x20f392['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x3452('0x14b')]=function(_0x51ca27){logger[_0x3452('0x2d')](util['format'](_0x3452('0x14c'),_0x51ca27['label']));if(!this[_0x3452('0x7e')](_0x51ca27[_0x3452('0x14d')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x51ca27,_0x3452('0x14e'));}this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x14f'),_0x51ca27[_0x3452('0x14d')]));var _0x2ada40=eval(_0x51ca27[_0x3452('0x14d')]);if(!this[_0x3452('0x7e')](_0x51ca27[_0x3452('0xce')])){return this[_0x3452('0x12')]['noop'](_0x3452('0xcf'));}var _0x5993f1=this[_0x3452('0x14')][_0x3452('0x6b')](this,_0x51ca27['variable_id']);if(!_0x5993f1){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x51ca27,_0x3452('0xd0'));}if(_[_0x3452('0x150')](_0x2ada40)){var _0x3e9e80=this;_0x2ada40['forEach'](function(_0x565e6b,_0x27fe11){_0x3e9e80[_0x3452('0x12')][_0x3452('0x96')](util[_0x3452('0x28')](_0x3452('0x151'),_0x5993f1,_0x27fe11),_0x565e6b);});return this['channel'][_0x3452('0xae')](util['format'](_0x3452('0x152'),_0x5993f1));}else{return this['channel'][_0x3452('0x96')](_0x5993f1,_0x2ada40);}};AGIVertices[_0x3452('0x13')]['menu']=function(_0x4c06da){logger[_0x3452('0x2d')](util['format'](_0x3452('0x153'),_0x4c06da['label']));if(_0x4c06da[_0x3452('0x9e')]===0x0){return this[_0x3452('0x9d')](_0x4c06da);}_0x4c06da[_0x3452('0x9e')]-=0x1;if(!this[_0x3452('0x7e')](_0x4c06da[_0x3452('0x102')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x4c06da,_0x3452('0x103'));}var _0x18dc6a=this[_0x3452('0x20')][_0x3452('0x6b')](this,_0x4c06da[_0x3452('0x102')]);if(!_0x18dc6a){return this['channel']['error'](_0x4c06da,_0x3452('0x104'));}var _0x20d4c4=this[_0x3452('0x12')][_0x3452('0x105')](_0x18dc6a,_0x4c06da['response'],_0x4c06da['digit']);var _0x59fdf4=_0x20d4c4[_0x3452('0x9b')];if(_0x20d4c4['result']===-0x1){this[_0x3452('0x34')]['sync'](this,_0x4c06da,'-1');return _0x20d4c4;}else if(_0x20d4c4[_0x3452('0x99')]===_0x3452('0x62')){_0x20d4c4[_0x3452('0x9b')]=_0x20d4c4[_0x3452('0x9b')][_0x3452('0x95')]>0x0?_0x20d4c4['result']:'t';}else if(_[_0x3452('0x42')](_0x20d4c4[_0x3452('0x9b')])){_0x20d4c4['result']='#';_0x59fdf4='#';}if(!this[_0x3452('0x7e')](_0x4c06da[_0x3452('0xce')])){this[_0x3452('0x12')][_0x3452('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2a13d1=this[_0x3452('0x14')]['sync'](this,_0x4c06da[_0x3452('0xce')]);if(!_0x2a13d1){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x4c06da,_0x3452('0xd0'));}this['channel'][_0x3452('0x96')](_0x2a13d1,_0x59fdf4);}this[_0x3452('0x34')][_0x3452('0x6b')](this,_0x4c06da,_0x59fdf4);return _0x20d4c4;};AGIVertices[_0x3452('0x13')][_0x3452('0xae')]=function(_0x30fdfe){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x154'),_0x30fdfe[_0x3452('0x35')]));return this[_0x3452('0x12')][_0x3452('0xae')](_0x30fdfe[_0x3452('0x155')]||_0x30fdfe[_0x3452('0x35')]);};AGIVertices[_0x3452('0x13')]['pause']=function(_0x3ea170){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x156'),_0x3ea170['label']));if(!this[_0x3452('0x7e')](_0x3ea170[_0x3452('0x145')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x3ea170,_0x3452('0x143'));}logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x144'),this[_0x3452('0x12')][_0x3452('0x3a')],_0x3ea170[_0x3452('0x145')]));var _0x490faf=this[_0x3452('0x4d')]['sync'](this,_0x3ea170[_0x3452('0x157')]);var _0x5e5f86=this[_0x3452('0x4f')][_0x3452('0x6b')](this,_0x3ea170[_0x3452('0x145')],_0x490faf);if(_0x5e5f86){logger[_0x3452('0x2d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x3452('0x12')][_0x3452('0x3a')],_0x3ea170[_0x3452('0x145')]));this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x146'),this[_0x3452('0x12')][_0x3452('0x3a')],_0x3ea170['findBy']));return{'code':0xc8,'result':_0x3452('0x147')};}else{logger['info'](util[_0x3452('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3452('0x12')][_0x3452('0x3a')],_0x3ea170[_0x3452('0x145')]));this[_0x3452('0x12')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x3452('0x12')]['callerid'],_0x3ea170[_0x3452('0x145')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x3452('0x13')][_0x3452('0x158')]=function(_0x58a183){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x159'),_0x58a183[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x58a183[_0x3452('0x102')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x58a183,_0x3452('0x103'));}var _0x310ac1=this[_0x3452('0x20')][_0x3452('0x6b')](this,_0x58a183[_0x3452('0x102')]);if(!_0x310ac1){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x58a183,_0x3452('0x104'));}var _0xddc32f=this[_0x3452('0x12')][_0x3452('0xad')](_0x3452('0x15a'),[_0x310ac1,_0x58a183['opts']]);if(_0xddc32f['result']===-0x1){return _0xddc32f;}return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xaf'),_0x3452('0x15a'),_0x310ac1));};AGIVertices[_0x3452('0x13')]['queue']=function(_0x37d25c){logger[_0x3452('0x2d')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x37d25c['label']));if(!this[_0x3452('0x7e')](_0x37d25c[_0x3452('0x15b')])){return this[_0x3452('0x12')]['error'](_0x37d25c,_0x3452('0x15c'));}var _0x1a9382='';var _0x550a50=parseInt(_0x37d25c[_0x3452('0x15b')],0xa);if(isNaN(_0x550a50)){_0x1a9382=_0x37d25c[_0x3452('0x15b')];}else{_0x1a9382=this[_0x3452('0x15d')][_0x3452('0x6b')](this,_0x37d25c[_0x3452('0x15b')]);if(!_0x1a9382){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x37d25c,_0x3452('0x15e'));}}var _0x3a4fc6='';if(this['isConfigured'](_0x37d25c[_0x3452('0x102')])){var _0x8144a2=this[_0x3452('0x20')]['sync'](this,_0x37d25c['file_id']);if(_0x8144a2){_0x3a4fc6=_0x8144a2;}}this[_0x3452('0x34')][_0x3452('0x6b')](this,_0x37d25c,_0x1a9382);if(_0x37d25c[_0x3452('0xdc')][_0x3452('0x15f')]('x')<0x0){_0x37d25c['opts']+='x';}if(_0x37d25c[_0x3452('0xdc')][_0x3452('0x15f')]('X')<0x0){_0x37d25c[_0x3452('0xdc')]+='X';}this[_0x3452('0x12')][_0x3452('0x96')](_0x3452('0x160'),_0x1a9382?_0x1a9382[_0x3452('0x161')]():'');var _0x1a03f1=this[_0x3452('0x12')]['exec'](_0x3452('0x162'),[_0x1a9382,_0x37d25c['opts'],_0x37d25c[_0x3452('0xdd')],_0x3a4fc6,_0x37d25c[_0x3452('0x62')],_0x37d25c[_0x3452('0x9f')],_0x37d25c[_0x3452('0x163')],_0x37d25c['gosub'],'',_0x37d25c[_0x3452('0x164')]]);if(_0x1a03f1[_0x3452('0x9b')]===-0x1){return _0x1a03f1;}return this[_0x3452('0x12')][_0x3452('0xae')](util['format'](_0x3452('0xaf'),_0x3452('0x162'),_0x1a9382));};AGIVertices[_0x3452('0x13')][_0x3452('0x165')]=function(_0x6c03e5){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x166'),_0x6c03e5[_0x3452('0x35')]));var _0x446af3=_0x6c03e5[_0x3452('0x167')]||'wav';var _0x113a58=util[_0x3452('0x28')](_0x3452('0x168'),this[_0x3452('0x12')][_0x3452('0x39')],rs['generate'](0x5));var _0x59332e=util[_0x3452('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x113a58,_0x446af3);var _0x1c674e=util[_0x3452('0x28')]('%s/recordings/%s',FILES_PATH,_0x113a58);this[_0x3452('0x38')][_0x3452('0x6b')](this,_0x6c03e5,_0x113a58,_0x59332e);this['channel']['setVariable']('RECORDING_SAVENAME',_0x113a58);logger[_0x3452('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x1c674e,_0x446af3,_0x6c03e5[_0x3452('0x169')],_0x6c03e5[_0x3452('0x62')]);return this['channel'][_0x3452('0x120')](_0x1c674e,_0x446af3,_0x6c03e5[_0x3452('0x169')],_0x6c03e5[_0x3452('0x62')],undefined,!![]);};AGIVertices[_0x3452('0x13')][_0x3452('0x16a')]=function(_0x1e4b07){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1e4b07['label']));if(!this[_0x3452('0x7e')](_0x1e4b07[_0x3452('0xdd')])){return this['channel'][_0x3452('0xae')](_0x3452('0x16b'));}var _0x476a4d=this[_0x3452('0x60')][_0x3452('0x6b')](this,_0x1e4b07);logger['info'](util[_0x3452('0x28')](_0x3452('0x16c'),util[_0x3452('0x16d')](_0x476a4d,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1e4b07[_0x3452('0xce')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0x16e'));}var _0xd7294e=this[_0x3452('0x14')][_0x3452('0x6b')](this,_0x1e4b07[_0x3452('0xce')]);if(!_0xd7294e){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x1e4b07,_0x3452('0xd0'));}this[_0x3452('0x12')][_0x3452('0x96')](util[_0x3452('0x28')](_0x3452('0x16f'),_0xd7294e),_0x476a4d[_0x3452('0x71')]?_0x476a4d[_0x3452('0x71')]:_0x3452('0x170'));this[_0x3452('0x12')]['setVariable'](util[_0x3452('0x28')](_0x3452('0x171'),_0xd7294e),_0x476a4d[_0x3452('0x72')]?_0x476a4d['statusMessage']:'OK');if(_0x476a4d['body']){try{this['saveRestApiResult'](_0x476a4d[_0x3452('0x6f')],_0xd7294e);}catch(_0x76a970){logger[_0x3452('0x2b')](util['format'](_0x3452('0x172'),_0xd7294e));}}return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xd4'),_0xd7294e));};AGIVertices['prototype'][_0x3452('0x173')]=function(_0x360b5d){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x174'),_0x360b5d[_0x3452('0x35')]));return this['channel'][_0x3452('0x175')](_0x360b5d['digits'][_0x3452('0x57')](/\s+/g,''),_0x360b5d[_0x3452('0x169')]);};AGIVertices[_0x3452('0x13')][_0x3452('0x176')]=function(_0x1d7614){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x1d7614[_0x3452('0x35')]));return this[_0x3452('0x12')][_0x3452('0x177')](_0x1d7614[_0x3452('0x63')][_0x3452('0x57')](/\s+/g,''),_0x1d7614[_0x3452('0x169')]);};AGIVertices[_0x3452('0x13')]['sayphonetic']=function(_0x2797a6){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x178'),_0x2797a6[_0x3452('0x35')]));return this['channel'][_0x3452('0x179')](_0x2797a6[_0x3452('0x5a')],_0x2797a6['escape_digits']);};AGIVertices[_0x3452('0x13')][_0x3452('0x17a')]=function(_0x2d7b84){logger['info'](util[_0x3452('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2d7b84[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x2d7b84[_0x3452('0x17b')])){return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0x17c'));}var _0x1f8cb6=this['getMailAccount'][_0x3452('0x6b')](this,_0x2d7b84[_0x3452('0x17b')]);if(!_0x1f8cb6||!_0x1f8cb6[_0x3452('0x17d')]){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x2d7b84,'no\x20mail\x20account\x20found');}var _0x2020f0={'from':util[_0x3452('0x28')](_0x3452('0x17e'),_0x1f8cb6[_0x3452('0x18')],_0x1f8cb6[_0x3452('0x17f')]||_0x1f8cb6[_0x3452('0x17d')][_0x3452('0x180')]),'to':_0x2d7b84['to']||'','cc':_0x2d7b84['cc']||'','bcc':_0x2d7b84[_0x3452('0x181')]||'','subject':_0x2d7b84[_0x3452('0x182')],'html':_0x2d7b84['text'],'text':_0x2d7b84[_0x3452('0x5a')]};var _0x5e5b49={'tls':{'rejectUnauthorized':![]}};if(_0x1f8cb6[_0x3452('0x17d')][_0x3452('0x183')]){_0x5e5b49[_0x3452('0x183')]=_0x1f8cb6[_0x3452('0x17d')][_0x3452('0x183')];}else{_0x5e5b49['host']=_0x1f8cb6[_0x3452('0x17d')][_0x3452('0x184')];_0x5e5b49[_0x3452('0x185')]=_0x1f8cb6['Smtp'][_0x3452('0x185')];_0x5e5b49[_0x3452('0x186')]=_0x1f8cb6['Smtp'][_0x3452('0x186')];}if(_0x1f8cb6[_0x3452('0x17d')][_0x3452('0x187')]){_0x5e5b49[_0x3452('0x188')]={'user':_0x1f8cb6['Smtp'][_0x3452('0x180')],'pass':_0x1f8cb6[_0x3452('0x17d')]['pass']};}if(this['isConfigured'](_0x2d7b84[_0x3452('0x189')])){}logger[_0x3452('0xd6')]('sendMail\x20message',JSON[_0x3452('0x6e')](_0x2020f0));this[_0x3452('0x34')][_0x3452('0x6b')](this,_0x2d7b84,_0x2d7b84[_0x3452('0x17b')]);this[_0x3452('0x12')][_0x3452('0xae')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x1f8cb6['name']));this[_0x3452('0x24')]['sync'](this,_0x5e5b49,_0x2020f0);return this['channel'][_0x3452('0xae')](_0x3452('0x18a'));};AGIVertices[_0x3452('0x13')][_0x3452('0x18b')]=function(_0x9d88ab){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x18c'),_0x9d88ab[_0x3452('0x35')]));return this['channel'][_0x3452('0xae')](_0x3452('0x18d'));};AGIVertices[_0x3452('0x13')]['sendSMS']=function(_0x555e41){logger[_0x3452('0x2d')](util['format'](_0x3452('0x18e'),_0x555e41[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x555e41['sms_account_id'])){return this[_0x3452('0x12')][_0x3452('0xae')]('no\x20sms\x20account\x20configured');}var _0x4e20ad=this[_0x3452('0x31')][_0x3452('0x6b')](this,_0x555e41[_0x3452('0x18f')]);if(!_0x4e20ad){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x555e41,'no\x20sms\x20account\x20found');}var _0x2479d2={'body':_0x555e41['sms_text'],'phone':_0x555e41['to']||'','SmsAccountId':_0x4e20ad['id']};logger[_0x3452('0xd6')]('sendSMS\x20message',JSON['stringify'](_0x2479d2));this['createSquareDetailsReport'][_0x3452('0x6b')](this,_0x555e41,_0x555e41['sms_account_id']);this['channel'][_0x3452('0xae')](util[_0x3452('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x4e20ad[_0x3452('0x18')]));this[_0x3452('0x33')]['sync'](this,_0x2479d2);return this[_0x3452('0x12')]['noop'](_0x3452('0x190'));};AGIVertices[_0x3452('0x13')][_0x3452('0x191')]=function(_0x49820f){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x192'),_0x49820f[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x49820f[_0x3452('0xce')])){return this[_0x3452('0x12')]['error'](_0x49820f,_0x3452('0x193'));}var _0x218b3e=this[_0x3452('0x14')][_0x3452('0x6b')](this,_0x49820f['variable_id']);if(!_0x218b3e){return this[_0x3452('0x12')]['error'](_0x49820f,'no\x20variable\x20found');}return this['channel'][_0x3452('0x96')](_0x218b3e,_0x49820f[_0x3452('0x194')]);};AGIVertices['prototype'][_0x3452('0x195')]=function(_0x3ce1f8){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3ce1f8[_0x3452('0x35')]));this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0x196'));if(_0x3ce1f8[_0x3452('0xa3')]===_0x3452('0x197')){this[_0x3452('0x12')][_0x3452('0xae')]('Answer');return this[_0x3452('0x12')]['answer']();}return this[_0x3452('0x12')][_0x3452('0xae')](_0x3452('0x198'));};AGIVertices[_0x3452('0x13')][_0x3452('0x199')]=function(_0x259581){logger['info'](util[_0x3452('0x28')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x259581[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x259581[_0x3452('0x19a')])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x259581,_0x3452('0x19b'));}var _0x4fcae9=this[_0x3452('0x1a')][_0x3452('0x6b')](this,_0x259581[_0x3452('0x19a')]);if(!this[_0x3452('0x7e')](_0x4fcae9)){return this['channel'][_0x3452('0x2b')](_0x259581,util[_0x3452('0x28')](_0x3452('0x19c'),_0x259581[_0x3452('0x19a')]));}if(_0x4fcae9===this[_0x3452('0x12')]['arg_1']){return this['channel'][_0x3452('0x2b')](_0x259581,_0x3452('0x19d'));}this[_0x3452('0x34')]['sync'](this,_0x259581,_0x4fcae9);var _0x1f02dc=this[_0x3452('0x12')][_0x3452('0xad')](_0x3452('0x19e'),util[_0x3452('0x28')](_0x3452('0x19f'),config[_0x3452('0x9f')]['host']||_0x3452('0x1a0'),_0x4fcae9,this[_0x3452('0x12')][_0x3452('0x37')]));if(_0x1f02dc[_0x3452('0x9b')]===-0x1){return _0x1f02dc;}return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xaf'),_0x3452('0x19e'),_0x4fcae9));};AGIVertices['prototype'][_0x3452('0x1a1')]=function(_0x500a25){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x1a2'),_0x500a25[_0x3452('0x35')]));var _0x12fd0f=this[_0x3452('0x56')]['sync'](this,_0x500a25[_0x3452('0xa1')]);this['createSquareDetailsReport'][_0x3452('0x6b')](this,_0x500a25,_0x500a25['command']);if(this[_0x3452('0x7e')](_0x500a25['variable_id'])){var _0x387c9b=this[_0x3452('0x14')][_0x3452('0x6b')](this,_0x500a25['variable_id']);if(_0x387c9b){this[_0x3452('0x12')]['setVariable'](_0x387c9b,_0x12fd0f);return this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x500a25['command'],_0x387c9b));}}return this[_0x3452('0x12')][_0x3452('0xae')](util['format'](_0x3452('0x1a3'),_0x500a25[_0x3452('0xa1')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x442275){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x1a4'),_0x442275[_0x3452('0x35')]));if(!this['isConfigured'](_0x442275[_0x3452('0x1a5')])){return this['channel']['noop'](_0x3452('0x1a6'));}if(!this[_0x3452('0x7e')](_0x442275['text'])){return this['channel'][_0x3452('0xae')]('no\x20text\x20configured');}this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x442275[_0x3452('0x5a')]));var _0x4b79d6=this[_0x3452('0x58')][_0x3452('0x6b')](this,_0x442275);if(_0x4b79d6){this[_0x3452('0x12')]['noop'](util[_0x3452('0x28')](_0x3452('0x1a7'),_0x4b79d6));var _0x17e720=this[_0x3452('0x12')][_0x3452('0x141')](_0x4b79d6);try{fs[_0x3452('0xf3')](_0x4b79d6+_0x3452('0xf4'));}catch(_0x18f7ac){logger[_0x3452('0x2b')](_0x18f7ac);}return _0x17e720;}return this[_0x3452('0x12')][_0x3452('0x2b')](_0x442275,_0x3452('0x1a8'));};AGIVertices[_0x3452('0x13')][_0x3452('0x1a9')]=function(_0x584297){logger['info'](util['format'](_0x3452('0x1aa'),_0x584297['label']));if(!this['isConfigured'](_0x584297[_0x3452('0x5a')])){return this[_0x3452('0x12')]['noop'](_0x3452('0xb3'));}this[_0x3452('0x12')][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0x1ab'),_0x584297[_0x3452('0x5a')]));var _0x3841a3=this['googleTTS'][_0x3452('0x6b')](this,_0x584297);if(_0x3841a3){this['channel']['noop'](util[_0x3452('0x28')](_0x3452('0x1ac'),_0x3841a3));var _0x19c2a4=this[_0x3452('0x12')][_0x3452('0x141')](_0x3841a3);try{fs[_0x3452('0xf3')](_0x3841a3+_0x3452('0xf4'));}catch(_0x828ba0){logger[_0x3452('0x2b')](_0x828ba0);}return _0x19c2a4;}return this[_0x3452('0x12')][_0x3452('0x2b')](_0x584297,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x3452('0x13')]['unpause']=function(_0x246693){logger[_0x3452('0x2d')](util['format'](_0x3452('0x1ad'),_0x246693[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x246693['findBy'])){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x246693,_0x3452('0x143'));}logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x144'),this['channel']['callerid'],_0x246693[_0x3452('0x145')]));var _0x25c791=this[_0x3452('0x51')][_0x3452('0x6b')](this,_0x246693[_0x3452('0x145')]);if(_0x25c791){logger[_0x3452('0x2d')](util[_0x3452('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x3452('0x3a')],_0x246693[_0x3452('0x145')]));this['channel'][_0x3452('0xae')](util[_0x3452('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3452('0x12')][_0x3452('0x3a')],_0x246693[_0x3452('0x145')]));return{'code':0xc8,'result':'success'};}else{logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x148'),this[_0x3452('0x12')][_0x3452('0x3a')],_0x246693[_0x3452('0x145')]));this[_0x3452('0x12')]['noop'](util[_0x3452('0x28')](_0x3452('0x148'),this['channel'][_0x3452('0x3a')],_0x246693[_0x3452('0x145')]));return{'code':0xc8,'result':_0x3452('0x149')};}};AGIVertices['prototype']['voicemail']=function(_0x44e7e3){logger['info'](util['format'](_0x3452('0x1ae'),_0x44e7e3[_0x3452('0x35')]));var _0x24eccd=this['channel'][_0x3452('0xad')](_0x3452('0x1af'),[_0x44e7e3[_0x3452('0x1b0')],_0x44e7e3[_0x3452('0x75')]]);if(_0x24eccd['result']===-0x1){return _0x24eccd;}return this['channel'][_0x3452('0xae')](util[_0x3452('0x28')](_0x3452('0xaf'),'VOICEMAIL',_0x44e7e3[_0x3452('0x1b0')]));};AGIVertices[_0x3452('0x13')][_0x3452('0x1b1')]=function(_0x26f500){logger[_0x3452('0x2d')](util[_0x3452('0x28')](_0x3452('0x1b2'),_0x26f500[_0x3452('0x35')]));if(!this[_0x3452('0x7e')](_0x26f500[_0x3452('0xce')])){return this['channel'][_0x3452('0x2b')](_0x26f500,_0x3452('0x193'));}var _0x1f062f=this[_0x3452('0x14')][_0x3452('0x6b')](this,_0x26f500['variable_id']);if(!_0x1f062f){return this[_0x3452('0x12')][_0x3452('0x2b')](_0x26f500,_0x3452('0xd0'));}var _0x77650=this['channel'][_0x3452('0x14')](_0x1f062f);return{'code':0xc8,'result':_0x77650[_0x3452('0x99')]?_0x77650[_0x3452('0x99')]:'-'};};String[_0x3452('0x13')]['replaceAll']=function(_0x146348,_0xe0d22d){return this[_0x3452('0x97')](_0x146348)[_0x3452('0x1b3')](_0xe0d22d);};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 939ba2f..cf08dc0 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 _0x98a8=['destlinkedid','savePause','acwTimeout','timer','stopAcw','uniqueid','updateAcw','lastPauseAt','update','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','prototype','syncAgentConnect','mandatoryDisposition','interface','syncAgentConnectPreview','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','startAcw','channels','queue','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]'];(function(_0x4c2537,_0x20afdf){var _0x94fb5c=function(_0x49e2f3){while(--_0x49e2f3){_0x4c2537['push'](_0x4c2537['shift']());}};_0x94fb5c(++_0x20afdf);}(_0x98a8,0x12c));var _0x898a=function(_0x357457,_0x4c6b02){_0x357457=_0x357457-0x0;var _0x1272eb=_0x98a8[_0x357457];return _0x1272eb;};'use strict';var util=require(_0x898a('0x0'));var _=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var ami=require(_0x898a('0x3'));var logger=require(_0x898a('0x4'))(_0x898a('0x5'));var RpcUser=require(_0x898a('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x2bb3e2){this[_0x898a('0x7')]=_0x2bb3e2[_0x898a('0x7')];this[_0x898a('0x8')]=_0x2bb3e2[_0x898a('0x8')];this['timers']=_0x2bb3e2[_0x898a('0x9')];this['channels']={};ami['on'](_0x898a('0xa'),this['syncAgentConnect'][_0x898a('0xb')](this));ami['on'](_0x898a('0xc'),this[_0x898a('0xd')][_0x898a('0xb')](this));ami['on'](_0x898a('0xe'),this[_0x898a('0xf')][_0x898a('0xb')](this));ami['on'](_0x898a('0x10'),this[_0x898a('0x11')]['bind'](this));ami['on'](_0x898a('0x12'),this['syncAttendedTransfer'][_0x898a('0xb')](this));ami['on']('blindtransfer',this[_0x898a('0x13')][_0x898a('0xb')](this));ami['on'](_0x898a('0x14'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x5b5c9c){var _0x373d53=moment()[_0x898a('0x15')](0x0);var _0xb24335=moment(_0x5b5c9c)[_0x898a('0x15')](0x0);return _0x373d53[_0x898a('0x16')](_0xb24335,_0x898a('0x17'));}Acw['prototype'][_0x898a('0x18')]=function(_0x53a4b8){try{var _0x3fec7a=this;var _0x5c96a6=this[_0x898a('0x19')][_0x53a4b8]['interface'];var _0x18d167=this['channels'][_0x53a4b8][_0x898a('0x1a')];var _0x3197f7=this[_0x898a('0x7')][_0x18d167];var _0x4ddd4d=![];var _0x1faf4c='ACW';if(_0x3197f7['mandatoryDisposition']){if(_0x3197f7[_0x898a('0x1b')][_0x898a('0x1c')]){_0x4ddd4d=!![];_0x1faf4c=_0x3197f7['mandatoryDispositionPause']['name'];}}ami[_0x898a('0x1d')]({'action':_0x898a('0x1e'),'interface':_0x5c96a6,'paused':!![],'reason':_0x1faf4c})[_0x898a('0x1f')](function(_0x2917ff){if(_0x3fec7a[_0x898a('0x8')][_0x5c96a6]){return RpcUser[_0x898a('0x20')](_0x3fec7a[_0x898a('0x8')][_0x5c96a6]['id'])['then'](function(_0x247cfc){if(_0x247cfc&&!_0x247cfc[_0x898a('0x21')]){logger[_0x898a('0x22')](_0x898a('0x23'),_0x53a4b8,_0x5c96a6,_0x18d167);var _0x30495a=_0x3fec7a[_0x898a('0x19')][_0x53a4b8]['attended']&&_0x3fec7a[_0x898a('0x19')][_0x53a4b8][_0x898a('0x24')]?_0x3fec7a[_0x898a('0x19')][_0x53a4b8][_0x898a('0x24')]:_0x53a4b8;return RpcUser[_0x898a('0x25')](_0x3fec7a[_0x898a('0x8')][_0x5c96a6],_0x1faf4c,_0x30495a)['then'](function(_0x20bde0){if(!_0x4ddd4d){_0x3fec7a['timers'][_0x5c96a6]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x53a4b8,_0x3fec7a[_0x898a('0x7')][_0x18d167][_0x898a('0x26')],_0x5c96a6,_0x18d167);_0x3fec7a[_0x898a('0x9')][_0x5c96a6][_0x898a('0x27')]=setTimeout(_0x3fec7a[_0x898a('0x28')][_0x898a('0xb')](_0x3fec7a,_0x5c96a6),_0x3fec7a[_0x898a('0x7')][_0x18d167][_0x898a('0x26')]*0x3e8);_0x3fec7a[_0x898a('0x9')][_0x5c96a6]['lastPauseAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3fec7a[_0x898a('0x9')][_0x5c96a6][_0x898a('0x29')]=_0x53a4b8;_0x3fec7a[_0x898a('0x9')][_0x5c96a6][_0x898a('0x1a')]=_0x18d167;_0x3fec7a[_0x898a('0x9')][_0x5c96a6][_0x898a('0x2a')]=function(){var _0xe3c983=getDiff(_0x3fec7a[_0x898a('0x9')][_0x5c96a6][_0x898a('0x2b')]);clearTimeout(_0x3fec7a[_0x898a('0x9')][_0x5c96a6][_0x898a('0x27')]);_0x3fec7a[_0x898a('0x9')][_0x5c96a6]['timer']=![];RpcVoiceAgentReport[_0x898a('0x2c')]({'acwtime':_0xe3c983},_0x3fec7a[_0x898a('0x9')][_0x5c96a6][_0x898a('0x29')],_0x5c96a6)[_0x898a('0x1f')](function(_0x2aa99e){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x53a4b8,_0xe3c983,_0x2aa99e);})[_0x898a('0x2d')](function(_0x1e2fd4){logger[_0x898a('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x53a4b8,_0x1e2fd4);});delete _0x3fec7a[_0x898a('0x9')][_0x5c96a6];};}});}else{logger[_0x898a('0x22')](_0x898a('0x2f'),_0x53a4b8,_0x5c96a6,_0x18d167);}});}})[_0x898a('0x2d')](function(_0x41cd46){logger[_0x898a('0x2e')](_0x898a('0x30'),_0x53a4b8,_0x3fec7a[_0x898a('0x7')][_0x18d167]['acwTimeout'],_0x5c96a6,_0x18d167);})[_0x898a('0x31')](function(){delete _0x3fec7a['channels'][_0x53a4b8];});}catch(_0x573eb3){logger[_0x898a('0x2e')]('[ACW][START]\x20%s',_0x573eb3[_0x898a('0x32')]);}};Acw['prototype'][_0x898a('0x28')]=function(_0x4f202c){try{var _0x299371=this;if(_0x299371[_0x898a('0x9')][_0x4f202c]){_0x299371[_0x898a('0x9')][_0x4f202c]['timer']=![];var _0x554897=_0x299371['timers'][_0x4f202c][_0x898a('0x29')];var _0x429c32=_0x299371['timers'][_0x4f202c][_0x898a('0x1a')];var _0x3d3463=_0x299371[_0x898a('0x7')][_0x429c32][_0x898a('0x26')];logger['info']('[TIMER][STOP][AGENT:%s]',_0x4f202c);RpcUser[_0x898a('0x33')](this[_0x898a('0x8')][_0x4f202c]);RpcVoiceAgentReport['update']({'acwtime':_0x3d3463,'agentacw':!![]},_0x554897,_0x4f202c)['then'](function(_0x168f92){logger[_0x898a('0x22')](_0x898a('0x34'),_0x554897,_0x3d3463,_0x168f92);})[_0x898a('0x2d')](function(_0x51681f){logger[_0x898a('0x2e')](_0x898a('0x35'),_0x554897,_0x51681f);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x4f202c);if(_0x299371['timers']){logger[_0x898a('0x22')](_0x898a('0x36'),JSON[_0x898a('0x37')](_0x299371[_0x898a('0x9')]));}}}catch(_0x20a6eb){logger[_0x898a('0x2e')](_0x898a('0x38'),_0x20a6eb[_0x898a('0x32')]);}};Acw[_0x898a('0x39')][_0x898a('0x3a')]=function(_0x246048){try{if(this[_0x898a('0x7')][_0x246048[_0x898a('0x1a')]]&&(this[_0x898a('0x7')][_0x246048[_0x898a('0x1a')]]['acw']||this[_0x898a('0x7')][_0x246048[_0x898a('0x1a')]][_0x898a('0x3b')])){if(this['agents'][_0x246048[_0x898a('0x3c')]]){this[_0x898a('0x19')][_0x246048[_0x898a('0x29')]]={'queue':_0x246048[_0x898a('0x1a')],'interface':_0x246048[_0x898a('0x3c')],'destlinkedid':_0x246048[_0x898a('0x24')]};}}}catch(_0x2d1323){logger[_0x898a('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x2d1323[_0x898a('0x32')]);}};Acw[_0x898a('0x39')][_0x898a('0x3d')]=function(_0x21a990){try{if(this['voiceQueues'][_0x21a990[_0x898a('0x1a')]]&&(this[_0x898a('0x7')][_0x21a990['queue']][_0x898a('0x5')]||this['voiceQueues'][_0x21a990[_0x898a('0x1a')]]['mandatoryDisposition'])){if(this['agents'][_0x21a990[_0x898a('0x3c')]]){this['channels'][_0x21a990[_0x898a('0x29')]]={'queue':_0x21a990[_0x898a('0x1a')],'interface':_0x21a990['interface']};}}}catch(_0x247347){logger[_0x898a('0x2e')]('[ACW][syncAgentConnectPreview]\x20%s',_0x247347[_0x898a('0x32')]);}};Acw[_0x898a('0x39')][_0x898a('0xd')]=function(_0x118240){try{if(this['channels'][_0x118240[_0x898a('0x29')]]&&_[_0x898a('0x3e')](this['channels'][_0x118240[_0x898a('0x29')]][_0x898a('0x3f')])){logger['info'](_0x898a('0x40'),_0x118240['uniqueid']);this[_0x898a('0x18')](_0x118240[_0x898a('0x29')]);}else if(this[_0x898a('0x19')][_0x118240['linkedid']]&&_[_0x898a('0x3e')](this[_0x898a('0x19')][_0x118240[_0x898a('0x41')]][_0x898a('0x3f')])){logger['info'](_0x898a('0x42'),_0x118240['linkedid']);this[_0x898a('0x18')](_0x118240[_0x898a('0x41')]);}}catch(_0x3159d0){logger['error'](_0x898a('0x43'),_0x3159d0[_0x898a('0x32')]);}};Acw[_0x898a('0x39')]['syncHangup']=function(_0x52f8c6){try{if(this[_0x898a('0x19')][_0x52f8c6[_0x898a('0x29')]]&&this[_0x898a('0x19')][_0x52f8c6[_0x898a('0x29')]][_0x898a('0x3f')]){logger[_0x898a('0x22')](_0x898a('0x44'),_0x52f8c6[_0x898a('0x29')]);this[_0x898a('0x18')](_0x52f8c6[_0x898a('0x29')]);}else if(this[_0x898a('0x19')][_0x52f8c6['linkedid']]&&this[_0x898a('0x19')][_0x52f8c6[_0x898a('0x41')]]['attended']){logger[_0x898a('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x52f8c6['linkedid']);this[_0x898a('0x18')](_0x52f8c6[_0x898a('0x41')]);}}catch(_0x209529){logger['error']('[ACW][syncHangup]\x20%s',_0x209529[_0x898a('0x32')]);}};Acw[_0x898a('0x39')]['syncAttendedTransfer']=function(_0xaa96f7){try{if(!_[_0x898a('0x45')](this['channels'][_0xaa96f7[_0x898a('0x46')]])){this[_0x898a('0x18')](_0xaa96f7[_0x898a('0x46')]);if(this['channels'][_0xaa96f7[_0x898a('0x47')]]){this[_0x898a('0x19')][_0xaa96f7[_0x898a('0x47')]][_0x898a('0x3f')]=!![];this[_0x898a('0x19')][_0xaa96f7[_0x898a('0x48')]]=this['channels'][_0xaa96f7[_0x898a('0x47')]];delete this['channels'][_0xaa96f7[_0x898a('0x47')]];}}else if(!_[_0x898a('0x45')](this[_0x898a('0x19')][_0xaa96f7[_0x898a('0x48')]])){this[_0x898a('0x18')](_0xaa96f7[_0x898a('0x48')]);if(this[_0x898a('0x19')][_0xaa96f7[_0x898a('0x49')]]){this[_0x898a('0x19')][_0xaa96f7['origtransfereruniqueid']][_0x898a('0x3f')]=!![];this[_0x898a('0x19')][_0xaa96f7[_0x898a('0x46')]]=this[_0x898a('0x19')][_0xaa96f7[_0x898a('0x49')]];delete this[_0x898a('0x19')][_0xaa96f7[_0x898a('0x49')]];}}}catch(_0x68fd81){logger[_0x898a('0x2e')](_0x898a('0x4a'),_0x68fd81[_0x898a('0x32')]);}};Acw[_0x898a('0x39')][_0x898a('0x13')]=function(_0x3f76e1){try{if(this[_0x898a('0x19')][_0x3f76e1['transfereruniqueid']]){logger[_0x898a('0x22')](_0x898a('0x4b'),JSON['stringify'](_0x3f76e1[_0x898a('0x4c')]));this[_0x898a('0x18')](_0x3f76e1['transfereruniqueid']);}else if(this[_0x898a('0x19')][_0x3f76e1[_0x898a('0x4d')]]){logger[_0x898a('0x22')](_0x898a('0x4e'),JSON['stringify'](_0x3f76e1[_0x898a('0x4d')]));this[_0x898a('0x18')](_0x3f76e1[_0x898a('0x4d')]);}}catch(_0xf86633){logger['error'](_0x898a('0x4f'),_0xf86633[_0x898a('0x32')]);}};Acw['prototype'][_0x898a('0x11')]=function(_0x3c0bf6){try{if(this['voiceQueues'][_0x3c0bf6[_0x898a('0x1a')]]&&this['voiceQueues'][_0x3c0bf6[_0x898a('0x1a')]]['autopause']==='all'){if(this['agents'][_0x3c0bf6[_0x898a('0x3c')]]){logger[_0x898a('0x22')](_0x898a('0x50'),_0x3c0bf6[_0x898a('0x29')],_0x3c0bf6['interface'],_0x3c0bf6['queue']);return RpcUser[_0x898a('0x25')](this[_0x898a('0x8')][_0x3c0bf6[_0x898a('0x3c')]],_0x898a('0x51'),_0x3c0bf6[_0x898a('0x29')]);}}}catch(_0x41cf94){logger[_0x898a('0x2e')](_0x898a('0x52'),_0x41cf94['message']);}};module[_0x898a('0x53')]=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(_0x53e9b3,_0x10ebad){var _0x1c394e=function(_0x4db673){while(--_0x4db673){_0x53e9b3['push'](_0x53e9b3['shift']());}};_0x1c394e(++_0x10ebad);}(_0xac31,0xca));var _0x1ac3=function(_0x4c6da4,_0x262c6f){_0x4c6da4=_0x4c6da4-0x0;var _0x19ac44=_0xac31[_0x4c6da4];return _0x19ac44;};'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 e38d36d..41c238e 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 _0x4e53=['keepConnected','promisify','action','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','format','actionSipShowRegistry','Action','actionDeviceStateList','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port','username','password'];(function(_0xaef30f,_0x20d822){var _0x54068e=function(_0x586538){while(--_0x586538){_0xaef30f['push'](_0xaef30f['shift']());}};_0x54068e(++_0x20d822);}(_0x4e53,0x115));var _0x34e5=function(_0x469eb9,_0x6c3137){_0x469eb9=_0x469eb9-0x0;var _0x435681=_0x4e53[_0x469eb9];return _0x435681;};'use strict';var Manager=require(_0x34e5('0x0'));var BPromise=require(_0x34e5('0x1'));var moment=require(_0x34e5('0x2'));var util=require(_0x34e5('0x3'));var _=require(_0x34e5('0x4'));var logger=require(_0x34e5('0x5'))('ami');var config=require(_0x34e5('0x6'));var ami=new Manager(config[_0x34e5('0x7')][_0x34e5('0x8')],config['asterisk']['ip'],config[_0x34e5('0x7')][_0x34e5('0x9')],config[_0x34e5('0x7')][_0x34e5('0xa')],!![]);ami[_0x34e5('0xb')]();ami['Action']=BPromise[_0x34e5('0xc')](ami[_0x34e5('0xd')]);function error(_0x225f19){logger['error'](util['format'](_0x34e5('0xe'),config[_0x34e5('0x7')][_0x34e5('0x9')],config[_0x34e5('0x7')]['ip'],config['asterisk'][_0x34e5('0x8')],util[_0x34e5('0xf')](_0x225f19,![],null)));}function close(){logger[_0x34e5('0x10')](util[_0x34e5('0x11')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x34e5('0x7')]['username'],config[_0x34e5('0x7')]['ip'],config[_0x34e5('0x7')][_0x34e5('0x8')]));}ami[_0x34e5('0x12')]=function(){return function(){return ami[_0x34e5('0x13')]({'action':'sipshowregistry'});};};ami[_0x34e5('0x14')]=function(){return function(){return ami[_0x34e5('0x13')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0x34e5('0x15')]=function(){return function(){return ami[_0x34e5('0x13')]({'action':_0x34e5('0x16')});};};ami[_0x34e5('0x17')]=function(){return function(){return ami[_0x34e5('0x13')]({'action':_0x34e5('0x18')});};};function connect(_0x4ff8a6){logger[_0x34e5('0x19')](util['format'](_0x34e5('0x1a'),config[_0x34e5('0x7')][_0x34e5('0x9')],config[_0x34e5('0x7')]['ip'],config['asterisk'][_0x34e5('0x8')]));ami[_0x34e5('0x1b')](_0x34e5('0x10'),error);ami[_0x34e5('0x1b')](_0x34e5('0x1c'),close);}ami['on'](_0x34e5('0x1d'),connect);ami['on'](_0x34e5('0x1e'),function(_0x5e77c8){logger[_0x34e5('0x19')](util[_0x34e5('0x11')](_0x34e5('0x1f'),config[_0x34e5('0x7')]['username'],config[_0x34e5('0x7')]['ip'],config[_0x34e5('0x7')][_0x34e5('0x8')],util[_0x34e5('0xf')](_0x5e77c8,![],null)));});ami['on']('fullybooted',function(_0x4461a6){logger[_0x34e5('0x19')](util[_0x34e5('0x11')](_0x34e5('0x20'),config['asterisk'][_0x34e5('0x9')],config['asterisk']['ip'],config[_0x34e5('0x7')][_0x34e5('0x8')]));return BPromise['resolve']()[_0x34e5('0x21')](ami['actionSipShowRegistry']())[_0x34e5('0x21')](ami[_0x34e5('0x14')]())['then'](ami['actionSipPeerStatus']())[_0x34e5('0x21')](ami[_0x34e5('0x15')]())[_0x34e5('0x21')](ami[_0x34e5('0x17')]())[_0x34e5('0x22')](function(_0x5225f0){console['log'](_0x5225f0);});});ami[_0x34e5('0x1b')](_0x34e5('0x10'),error);ami[_0x34e5('0x1b')]('close',close);module[_0x34e5('0x23')]=ami; \ No newline at end of file +var _0xe6e1=['keepConnected','promisify','action','error','inspect','format','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','exports','asterisk-manager','bluebird','util','lodash','../../config/logger','ami','../../config/environment','port','asterisk','username','password'];(function(_0x3bf174,_0x1621b3){var _0x4b1458=function(_0x1d7475){while(--_0x1d7475){_0x3bf174['push'](_0x3bf174['shift']());}};_0x4b1458(++_0x1621b3);}(_0xe6e1,0x1a2));var _0x1e6e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xe6e1[_0x2b4411];return _0x8e41ef;};'use strict';var Manager=require(_0x1e6e('0x0'));var BPromise=require(_0x1e6e('0x1'));var moment=require('moment');var util=require(_0x1e6e('0x2'));var _=require(_0x1e6e('0x3'));var logger=require(_0x1e6e('0x4'))(_0x1e6e('0x5'));var config=require(_0x1e6e('0x6'));var ami=new Manager(config['asterisk'][_0x1e6e('0x7')],config[_0x1e6e('0x8')]['ip'],config[_0x1e6e('0x8')][_0x1e6e('0x9')],config[_0x1e6e('0x8')][_0x1e6e('0xa')],!![]);ami[_0x1e6e('0xb')]();ami['Action']=BPromise[_0x1e6e('0xc')](ami[_0x1e6e('0xd')]);function error(_0x44bc68){logger[_0x1e6e('0xe')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x1e6e('0x8')][_0x1e6e('0x9')],config[_0x1e6e('0x8')]['ip'],config[_0x1e6e('0x8')][_0x1e6e('0x7')],util[_0x1e6e('0xf')](_0x44bc68,![],null)));}function close(){logger['error'](util[_0x1e6e('0x10')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x1e6e('0x8')]['username'],config[_0x1e6e('0x8')]['ip'],config['asterisk'][_0x1e6e('0x7')]));}ami[_0x1e6e('0x11')]=function(){return function(){return ami['Action']({'action':_0x1e6e('0x12')});};};ami[_0x1e6e('0x13')]=function(){return function(){return ami[_0x1e6e('0x14')]({'action':_0x1e6e('0x15')});};};ami[_0x1e6e('0x16')]=function(){return function(){return ami[_0x1e6e('0x14')]({'action':_0x1e6e('0x17')});};};ami[_0x1e6e('0x18')]=function(){return function(){return ami[_0x1e6e('0x14')]({'action':_0x1e6e('0x19')});};};ami[_0x1e6e('0x1a')]=function(){return function(){return ami['Action']({'action':_0x1e6e('0x1b')});};};function connect(_0xf11541){logger[_0x1e6e('0x1c')](util[_0x1e6e('0x10')](_0x1e6e('0x1d'),config[_0x1e6e('0x8')]['username'],config[_0x1e6e('0x8')]['ip'],config[_0x1e6e('0x8')]['port']));ami[_0x1e6e('0x1e')](_0x1e6e('0xe'),error);ami['once'](_0x1e6e('0x1f'),close);}ami['on'](_0x1e6e('0x20'),connect);ami['on'](_0x1e6e('0x21'),function(_0x43c0e1){logger['info'](util[_0x1e6e('0x10')](_0x1e6e('0x22'),config['asterisk']['username'],config[_0x1e6e('0x8')]['ip'],config[_0x1e6e('0x8')][_0x1e6e('0x7')],util['inspect'](_0x43c0e1,![],null)));});ami['on']('fullybooted',function(_0x47f2e4){logger[_0x1e6e('0x1c')](util[_0x1e6e('0x10')](_0x1e6e('0x23'),config[_0x1e6e('0x8')][_0x1e6e('0x9')],config[_0x1e6e('0x8')]['ip'],config[_0x1e6e('0x8')][_0x1e6e('0x7')]));return BPromise[_0x1e6e('0x24')]()['then'](ami[_0x1e6e('0x11')]())['then'](ami[_0x1e6e('0x13')]())[_0x1e6e('0x25')](ami['actionSipPeerStatus']())[_0x1e6e('0x25')](ami[_0x1e6e('0x18')]())['then'](ami[_0x1e6e('0x1a')]())['catch'](function(_0x175546){console['log'](_0x175546);});});ami['once'](_0x1e6e('0xe'),error);ami['once'](_0x1e6e('0x1f'),close);module[_0x1e6e('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index cbd2f6a..c6d2194 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 _0x42ef=['Request','request','then','debug','rpc','memberReport','error','message','exports','jayson/promise','bluebird','../../config/logger','ami','client','http'];(function(_0x1826d4,_0x4c167){var _0x3f84cf=function(_0x22889e){while(--_0x22889e){_0x1826d4['push'](_0x1826d4['shift']());}};_0x3f84cf(++_0x4c167);}(_0x42ef,0x162));var _0xf42e=function(_0x10ebae,_0x5ec179){_0x10ebae=_0x10ebae-0x0;var _0x3b982d=_0x42ef[_0x10ebae];return _0x3b982d;};'use strict';var jayson=require(_0xf42e('0x0'));var BPromise=require(_0xf42e('0x1'));var logger=require(_0xf42e('0x2'))(_0xf42e('0x3'));var client=jayson[_0xf42e('0x4')][_0xf42e('0x5')]({'port':0x2329});client[_0xf42e('0x6')]=function(_0x22d7c7,_0x42a8b7){return new BPromise(function(_0x2f521a,_0x2f2c62){return client[_0xf42e('0x7')](_0x22d7c7,_0x42a8b7)[_0xf42e('0x8')](function(_0x243fc6){logger[_0xf42e('0x9')](_0xf42e('0xa'),_0xf42e('0xb'),_0x22d7c7,_0x42a8b7,_0x243fc6);if(_0x243fc6[_0xf42e('0xc')]){logger[_0xf42e('0xc')](_0xf42e('0xa'),_0xf42e('0xb'),_0x22d7c7,_0x243fc6[_0xf42e('0xc')]['message'],_0x42a8b7);return _0x2f2c62(_0x243fc6[_0xf42e('0xc')][_0xf42e('0xd')]);}else{return _0x2f521a(_0x243fc6['result']);}})['catch'](function(_0xbbdba7){logger['error'](_0xf42e('0xa'),'memberReport',_0x22d7c7,_0xbbdba7,_0x42a8b7);return _0x2f2c62(_0xbbdba7);});});};module[_0xf42e('0xe')]=client; \ No newline at end of file +var _0x9819=['error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','Request','request','debug','rpc','memberReport'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9819,0x163));var _0x9981=function(_0x38aebf,_0x3395c1){_0x38aebf=_0x38aebf-0x0;var _0x282192=_0x9819[_0x38aebf];return _0x282192;};'use strict';var jayson=require(_0x9981('0x0'));var BPromise=require(_0x9981('0x1'));var logger=require(_0x9981('0x2'))(_0x9981('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0x9981('0x4')]=function(_0x5ddaca,_0x53e01d){return new BPromise(function(_0x30185f,_0x5db8ce){return client[_0x9981('0x5')](_0x5ddaca,_0x53e01d)['then'](function(_0x3c7fbc){logger[_0x9981('0x6')](_0x9981('0x7'),_0x9981('0x8'),_0x5ddaca,_0x53e01d,_0x3c7fbc);if(_0x3c7fbc[_0x9981('0x9')]){logger['error'](_0x9981('0x7'),_0x9981('0x8'),_0x5ddaca,_0x3c7fbc[_0x9981('0x9')][_0x9981('0xa')],_0x53e01d);return _0x5db8ce(_0x3c7fbc[_0x9981('0x9')]['message']);}else{return _0x30185f(_0x3c7fbc[_0x9981('0xb')]);}})[_0x9981('0xc')](function(_0x44a8a4){logger['error']('rpc',_0x9981('0x8'),_0x5ddaca,_0x44a8a4,_0x53e01d);return _0x5db8ce(_0x44a8a4);});});};module[_0x9981('0xd')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 88fa4f1..790e500 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 _0x4d41=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','name','dialCutDigit','number','substring','exports','util','lodash','moment','isNil','string','voiceQueue','phone','Contact','firstName','queue','active','type','dialQueueTimeout'];(function(_0xa1ae5c,_0x44beef){var _0x4573c1=function(_0x2580ec){while(--_0x2580ec){_0xa1ae5c['push'](_0xa1ae5c['shift']());}};_0x4573c1(++_0x44beef);}(_0x4d41,0x153));var _0x14d4=function(_0x80bea0,_0x4c30f4){_0x80bea0=_0x80bea0-0x0;var _0x50fb90=_0x4d41[_0x80bea0];return _0x50fb90;};'use strict';var util=require(_0x14d4('0x0'));var _=require(_0x14d4('0x1'));var moment=require(_0x14d4('0x2'));function checkNameSurname(_0x5aa925,_0x34268e,_0x3b9fa3){var _0x24ca1a='';if(!_[_0x14d4('0x3')](_0x34268e)&&_0x14d4('0x4')===typeof _0x34268e){_0x24ca1a+=_0x34268e;}if(!_[_0x14d4('0x3')](_0x3b9fa3)&&'string'===typeof _0x3b9fa3){_0x24ca1a+='\x20'+_0x3b9fa3;}if(_0x24ca1a!==''){return _0x24ca1a;}return _0x5aa925;}function Action(_0x579772,_0x21f1f2,_0x35eabb){this[_0x14d4('0x5')]=_0x579772;this['uniqueid']=_0x35eabb||undefined;this['name']=checkNameSurname(_0x21f1f2['Contact'][_0x14d4('0x6')],_0x21f1f2[_0x14d4('0x7')][_0x14d4('0x8')],_0x21f1f2[_0x14d4('0x7')]['lastName']);this['number']=_0x21f1f2[_0x14d4('0x7')][_0x14d4('0x6')];this[_0x14d4('0x9')]=_0x579772['name'];this['active']=_0x21f1f2[_0x14d4('0xa')]||![];this['type']=_0x579772[_0x14d4('0xb')];this[_0x14d4('0xc')]=_0x579772['dialQueueTimeout']||0x3;this[_0x14d4('0xd')]=_0x21f1f2[_0x14d4('0xd')];this[_0x14d4('0xe')]=_0x21f1f2[_0x14d4('0xe')];this[_0x14d4('0xf')]=_0x21f1f2[_0x14d4('0xf')];this[_0x14d4('0x10')]=_0x21f1f2[_0x14d4('0x10')];this[_0x14d4('0x11')]=_0x21f1f2['countnosuchnumberretry'];this[_0x14d4('0x12')]=_0x21f1f2[_0x14d4('0x12')];this[_0x14d4('0x13')]=_0x21f1f2['countabandonedretry'];this[_0x14d4('0x14')]=_0x21f1f2[_0x14d4('0x14')];this[_0x14d4('0x15')]=_0x21f1f2[_0x14d4('0x15')];this[_0x14d4('0x16')]=_0x21f1f2[_0x14d4('0x16')];this[_0x14d4('0x17')]=_0x21f1f2[_0x14d4('0x17')];this[_0x14d4('0x18')]=_0x21f1f2[_0x14d4('0x18')];this[_0x14d4('0x19')]=_0x21f1f2[_0x14d4('0x19')];this['CampaignId']=_0x21f1f2[_0x14d4('0x1a')];this[_0x14d4('0x1b')]=_0x21f1f2['id'];this[_0x14d4('0x1c')]=_0x21f1f2['Contact'][_0x14d4('0x8')]||'';this['starttime']=moment()[_0x14d4('0x1d')](_0x14d4('0x1e'));this[_0x14d4('0x1f')]=_0x21f1f2[_0x14d4('0x1f')];this[_0x14d4('0x20')]=_0x21f1f2['callbackuniqueid'];this[_0x14d4('0x21')]=_0x21f1f2[_0x14d4('0x21')];this[_0x14d4('0x22')]=_0x21f1f2['recallme'];this['originatecalleridnum']='';this[_0x14d4('0x23')]='';}Action[_0x14d4('0x24')][_0x14d4('0x25')]=function(){return util['format'](_0x14d4('0x26'),this[_0x14d4('0x27')],this['voiceQueue'][_0x14d4('0x28')]>0x0?this[_0x14d4('0x29')][_0x14d4('0x2a')](this[_0x14d4('0x5')]['dialCutDigit']):this[_0x14d4('0x29')]);};Action['prototype']['getQueue']=function(){return this[_0x14d4('0x9')];};module[_0x14d4('0x2b')]=Action; \ No newline at end of file +var _0xe5fb=['type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','prototype','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active'];(function(_0x472ad1,_0x5dbfef){var _0x416d54=function(_0x4bb71a){while(--_0x4bb71a){_0x472ad1['push'](_0x472ad1['shift']());}};_0x416d54(++_0x5dbfef);}(_0xe5fb,0xce));var _0xbe5f=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xe5fb[_0x2d994d];return _0xd54be4;};'use strict';var util=require(_0xbe5f('0x0'));var _=require(_0xbe5f('0x1'));var moment=require('moment');function checkNameSurname(_0x3d9c18,_0x25796f,_0x2ec447){var _0x534aec='';if(!_[_0xbe5f('0x2')](_0x25796f)&&_0xbe5f('0x3')===typeof _0x25796f){_0x534aec+=_0x25796f;}if(!_[_0xbe5f('0x2')](_0x2ec447)&&_0xbe5f('0x3')===typeof _0x2ec447){_0x534aec+='\x20'+_0x2ec447;}if(_0x534aec!==''){return _0x534aec;}return _0x3d9c18;}function Action(_0x2b1a47,_0x5b0452,_0x26347a){this[_0xbe5f('0x4')]=_0x2b1a47;this[_0xbe5f('0x5')]=_0x26347a||undefined;this[_0xbe5f('0x6')]=checkNameSurname(_0x5b0452[_0xbe5f('0x7')][_0xbe5f('0x8')],_0x5b0452['Contact'][_0xbe5f('0x9')],_0x5b0452[_0xbe5f('0x7')][_0xbe5f('0xa')]);this[_0xbe5f('0xb')]=_0x5b0452[_0xbe5f('0x7')][_0xbe5f('0x8')];this[_0xbe5f('0xc')]=_0x2b1a47[_0xbe5f('0x6')];this[_0xbe5f('0xd')]=_0x5b0452[_0xbe5f('0xd')]||![];this[_0xbe5f('0xe')]=_0x2b1a47[_0xbe5f('0xe')];this['dialQueueTimeout']=_0x2b1a47[_0xbe5f('0xf')]||0x3;this[_0xbe5f('0x10')]=_0x5b0452[_0xbe5f('0x10')];this[_0xbe5f('0x11')]=_0x5b0452[_0xbe5f('0x11')];this[_0xbe5f('0x12')]=_0x5b0452[_0xbe5f('0x12')];this[_0xbe5f('0x13')]=_0x5b0452[_0xbe5f('0x13')];this[_0xbe5f('0x14')]=_0x5b0452[_0xbe5f('0x14')];this[_0xbe5f('0x15')]=_0x5b0452[_0xbe5f('0x15')];this[_0xbe5f('0x16')]=_0x5b0452[_0xbe5f('0x16')];this[_0xbe5f('0x17')]=_0x5b0452[_0xbe5f('0x17')];this[_0xbe5f('0x18')]=_0x5b0452['countagentrejectretry'];this['ContactId']=_0x5b0452['ContactId'];this['ListId']=_0x5b0452[_0xbe5f('0x19')];this[_0xbe5f('0x1a')]=_0x5b0452[_0xbe5f('0x1a')];this['VoiceQueueId']=_0x5b0452['VoiceQueueId'];this['CampaignId']=_0x5b0452[_0xbe5f('0x1b')];this[_0xbe5f('0x1c')]=_0x5b0452['id'];this[_0xbe5f('0x1d')]=_0x5b0452[_0xbe5f('0x7')][_0xbe5f('0x9')]||'';this[_0xbe5f('0x1e')]=moment()[_0xbe5f('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xbe5f('0x20')]=_0x5b0452[_0xbe5f('0x20')];this[_0xbe5f('0x21')]=_0x5b0452[_0xbe5f('0x21')];this[_0xbe5f('0x22')]=_0x5b0452[_0xbe5f('0x22')];this[_0xbe5f('0x23')]=_0x5b0452['recallme'];this[_0xbe5f('0x24')]='';this[_0xbe5f('0x25')]='';}Action['prototype'][_0xbe5f('0x26')]=function(){return util[_0xbe5f('0x1f')](_0xbe5f('0x27'),this[_0xbe5f('0x6')],this[_0xbe5f('0x4')][_0xbe5f('0x28')]>0x0?this[_0xbe5f('0xb')]['substring'](this['voiceQueue']['dialCutDigit']):this['number']);};Action[_0xbe5f('0x29')][_0xbe5f('0x2a')]=function(){return this[_0xbe5f('0xc')];};module[_0xbe5f('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 8f29c82..141a22f 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 _0x5ad9=['starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','number'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0x5ad9,0x6f));var _0x95ad=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5ad9[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0x95ad('0x0'));var _=require('lodash');var moment=require(_0x95ad('0x1'));function getSeconds(_0x40cbe4,_0x50328c){var _0x406da7=moment(_0x40cbe4)[_0x95ad('0x2')](0x0);var _0x5214cd=moment(_0x50328c)[_0x95ad('0x2')](0x0);return _0x406da7[_0x95ad('0x3')](_0x5214cd,_0x95ad('0x4'));}function AgentComplete(_0x380dd8,_0x288a54){this[_0x95ad('0x5')]=0x4;this[_0x95ad('0x6')]=_0x95ad('0x7');this[_0x95ad('0x8')]=_0x380dd8[_0x95ad('0x8')];this['type']=_0x380dd8['type'];this['campaigntype']=_0x380dd8[_0x95ad('0x9')]===_0x95ad('0xa')?_0x95ad('0xb'):_0x380dd8[_0x95ad('0x9')];this[_0x95ad('0xc')]=_0x380dd8[_0x95ad('0xc')];this[_0x95ad('0xd')]=_0x380dd8['countcongestionretry'];this[_0x95ad('0xe')]=_0x380dd8[_0x95ad('0xe')];this[_0x95ad('0xf')]=_0x380dd8[_0x95ad('0xc')]+_0x380dd8[_0x95ad('0xd')]+_0x380dd8[_0x95ad('0xe')]+_0x380dd8[_0x95ad('0x10')]+_0x380dd8[_0x95ad('0x11')]+_0x380dd8[_0x95ad('0x12')]+_0x380dd8['countmachineretry']+_0x380dd8[_0x95ad('0x13')];this['countnosuchnumberretry']=_0x380dd8[_0x95ad('0x10')];this[_0x95ad('0x11')]=_0x380dd8[_0x95ad('0x11')];this['countabandonedretry']=_0x380dd8['countabandonedretry'];this[_0x95ad('0x14')]=_0x380dd8[_0x95ad('0x14')];this[_0x95ad('0x13')]=_0x380dd8[_0x95ad('0x13')];this['uniqueid']=_0x288a54['uniqueid'];this[_0x95ad('0x15')]=_0x380dd8[_0x95ad('0x16')];this['calleridnum']=_0x380dd8[_0x95ad('0x17')];this[_0x95ad('0x18')]=_0x380dd8[_0x95ad('0x18')];this['responsetime']=_0x380dd8[_0x95ad('0x19')];this[_0x95ad('0x1a')]=_0x380dd8[_0x95ad('0x1a')];this['endtime']=moment()[_0x95ad('0x1b')](_0x95ad('0x1c'));this['ringtime']=getSeconds(_0x380dd8[_0x95ad('0x19')],_0x380dd8[_0x95ad('0x18')]);this[_0x95ad('0x1d')]=getSeconds(_0x380dd8[_0x95ad('0x1a')],_0x380dd8[_0x95ad('0x19')]);this[_0x95ad('0x1e')]=getSeconds(this['endtime'],_0x380dd8[_0x95ad('0x1a')]);this[_0x95ad('0xb')]=_0x288a54[_0x95ad('0xb')];this[_0x95ad('0x1f')]=_0x288a54[_0x95ad('0x1f')];this[_0x95ad('0x20')]=_0x288a54['reason'];this[_0x95ad('0x21')]=_0x380dd8[_0x95ad('0x21')];this[_0x95ad('0x22')]=_0x380dd8[_0x95ad('0x22')];this[_0x95ad('0x23')]=_0x380dd8[_0x95ad('0x23')];this['recallme']=_0x380dd8[_0x95ad('0x24')];this[_0x95ad('0x25')]=_0x380dd8[_0x95ad('0x25')];this[_0x95ad('0x26')]=_0x380dd8[_0x95ad('0x26')];this[_0x95ad('0x27')]=_0x380dd8['UserId'];this[_0x95ad('0x28')]=_0x380dd8[_0x95ad('0x28')];this[_0x95ad('0x29')]=_0x380dd8[_0x95ad('0x29')];this[_0x95ad('0x2a')]=_0x380dd8[_0x95ad('0x2a')]||'';this[_0x95ad('0x2b')]=_0x380dd8[_0x95ad('0x2b')]||'';}module[_0x95ad('0x2c')]=AgentComplete; \ No newline at end of file +var _0x9683=['calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','campaigntype','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid'];(function(_0x3879e5,_0x15d7c9){var _0x335eda=function(_0xc65998){while(--_0xc65998){_0x3879e5['push'](_0x3879e5['shift']());}};_0x335eda(++_0x15d7c9);}(_0x9683,0xee));var _0x3968=function(_0x2fc599,_0xaad50a){_0x2fc599=_0x2fc599-0x0;var _0x3fce84=_0x9683[_0x2fc599];return _0x3fce84;};'use strict';var util=require('util');var _=require(_0x3968('0x0'));var moment=require(_0x3968('0x1'));function getSeconds(_0x5c9f99,_0xafd577){var _0x5c25e3=moment(_0x5c9f99)[_0x3968('0x2')](0x0);var _0x5c7db9=moment(_0xafd577)[_0x3968('0x2')](0x0);return _0x5c25e3[_0x3968('0x3')](_0x5c7db9,_0x3968('0x4'));}function AgentComplete(_0x32c424,_0x48f93c){this[_0x3968('0x5')]=0x4;this['statedesc']=_0x3968('0x6');this['scheduledat']=_0x32c424[_0x3968('0x7')];this['type']=_0x32c424['type'];this[_0x3968('0x8')]=_0x32c424[_0x3968('0x9')]==='outbound'?_0x3968('0xa'):_0x32c424[_0x3968('0x9')];this[_0x3968('0xb')]=_0x32c424[_0x3968('0xb')];this['countcongestionretry']=_0x32c424[_0x3968('0xc')];this['countnoanswerretry']=_0x32c424[_0x3968('0xd')];this['countglobal']=_0x32c424['countbusyretry']+_0x32c424[_0x3968('0xc')]+_0x32c424[_0x3968('0xd')]+_0x32c424['countnosuchnumberretry']+_0x32c424['countdropretry']+_0x32c424[_0x3968('0xe')]+_0x32c424[_0x3968('0xf')]+_0x32c424[_0x3968('0x10')];this[_0x3968('0x11')]=_0x32c424['countnosuchnumberretry'];this[_0x3968('0x12')]=_0x32c424['countdropretry'];this[_0x3968('0xe')]=_0x32c424[_0x3968('0xe')];this['countmachineretry']=_0x32c424[_0x3968('0xf')];this[_0x3968('0x10')]=_0x32c424[_0x3968('0x10')];this[_0x3968('0x13')]=_0x48f93c[_0x3968('0x13')];this[_0x3968('0x14')]=_0x32c424[_0x3968('0x15')];this['calleridnum']=_0x32c424[_0x3968('0x16')];this[_0x3968('0x17')]=_0x32c424[_0x3968('0x17')];this['responsetime']=_0x32c424[_0x3968('0x18')];this[_0x3968('0x19')]=_0x32c424['answertime'];this[_0x3968('0x1a')]=moment()[_0x3968('0x1b')](_0x3968('0x1c'));this['ringtime']=getSeconds(_0x32c424[_0x3968('0x18')],_0x32c424[_0x3968('0x17')]);this['holdtime']=getSeconds(_0x32c424[_0x3968('0x19')],_0x32c424['responsetime']);this['talktime']=getSeconds(this['endtime'],_0x32c424[_0x3968('0x19')]);this[_0x3968('0xa')]=_0x48f93c[_0x3968('0xa')];this[_0x3968('0x1d')]=_0x48f93c['membername'];this[_0x3968('0x1e')]=_0x48f93c[_0x3968('0x1e')];this[_0x3968('0x1f')]=_0x32c424[_0x3968('0x1f')];this[_0x3968('0x20')]=_0x32c424['callbackuniqueid'];this[_0x3968('0x21')]=_0x32c424[_0x3968('0x21')];this[_0x3968('0x22')]=_0x32c424[_0x3968('0x22')];this[_0x3968('0x23')]=_0x32c424['ContactId'];this[_0x3968('0x24')]=_0x32c424[_0x3968('0x24')];this[_0x3968('0x25')]=_0x32c424[_0x3968('0x25')];this[_0x3968('0x26')]=_0x32c424['VoiceQueueId'];this[_0x3968('0x27')]=_0x32c424[_0x3968('0x27')];this['originatecalleridnum']=_0x32c424[_0x3968('0x28')]||'';this['originatecalleridname']=_0x32c424[_0x3968('0x29')]||'';}module[_0x3968('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 7d9b90b..d5c47d1 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 _0x8052=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x2b03bb,_0x7c7142){var _0x3f9480=function(_0x3f8dbc){while(--_0x3f8dbc){_0x2b03bb['push'](_0x2b03bb['shift']());}};_0x3f9480(++_0x7c7142);}(_0x8052,0x84));var _0x2805=function(_0x2445ce,_0x2a3870){_0x2445ce=_0x2445ce-0x0;var _0x28b673=_0x8052[_0x2445ce];return _0x28b673;};'use strict';var util=require('util');var _=require(_0x2805('0x0'));var moment=require(_0x2805('0x1'));function getSeconds(_0x501c36,_0x31b79e){var _0x325fb0=moment(_0x501c36)[_0x2805('0x2')](0x0);var _0x12fddf=moment(_0x31b79e)[_0x2805('0x2')](0x0);return _0x325fb0[_0x2805('0x3')](_0x12fddf,'seconds');}function Final(_0xed621b){this[_0x2805('0x4')]=_0xed621b[_0x2805('0x4')];this[_0x2805('0x5')]=_0xed621b[_0x2805('0x5')];this[_0x2805('0x6')]=_0xed621b[_0x2805('0x6')];this[_0x2805('0x7')]=_0xed621b['type']===_0x2805('0x8')?_0x2805('0x9'):_0xed621b[_0x2805('0x6')];this[_0x2805('0xa')]=_0xed621b[_0x2805('0xa')];this[_0x2805('0xb')]=_0xed621b[_0x2805('0xb')];this['countnoanswerretry']=_0xed621b['countnoanswerretry'];this[_0x2805('0xc')]=_0xed621b[_0x2805('0xa')]+_0xed621b['countcongestionretry']+_0xed621b[_0x2805('0xd')]+_0xed621b['countnosuchnumberretry']+_0xed621b[_0x2805('0xe')]+_0xed621b[_0x2805('0xf')]+_0xed621b[_0x2805('0x10')]+_0xed621b[_0x2805('0x11')];this[_0x2805('0x12')]=_0xed621b['countnosuchnumberretry'];this[_0x2805('0xe')]=_0xed621b[_0x2805('0xe')];this[_0x2805('0xf')]=_0xed621b[_0x2805('0xf')];this[_0x2805('0x10')]=_0xed621b['countmachineretry'];this['countagentrejectretry']=_0xed621b['countagentrejectretry'];this[_0x2805('0x9')]=_0xed621b[_0x2805('0x9')];this[_0x2805('0x13')]=_0xed621b[_0x2805('0x13')];this['calleridnum']=_0xed621b[_0x2805('0x14')];this[_0x2805('0x15')]=_0xed621b[_0x2805('0x15')];this['responsetime']=_0xed621b[_0x2805('0x16')];this[_0x2805('0x17')]=_0xed621b[_0x2805('0x16')];this[_0x2805('0x18')]=_0xed621b[_0x2805('0x18')]||0x0;this[_0x2805('0x19')]=_0xed621b[_0x2805('0x19')]||0x0;this[_0x2805('0x1a')]=_0xed621b[_0x2805('0x1a')]||0x0;this[_0x2805('0x1b')]=_0xed621b[_0x2805('0x1b')];this[_0x2805('0x1c')]=_0xed621b['callbackuniqueid'];this[_0x2805('0x1d')]=_0xed621b[_0x2805('0x1d')];this[_0x2805('0x1e')]=_0xed621b[_0x2805('0x1e')];this[_0x2805('0x1f')]=_0xed621b['ContactId'];this[_0x2805('0x20')]=_0xed621b[_0x2805('0x20')];this[_0x2805('0x21')]=_0xed621b[_0x2805('0x21')];this[_0x2805('0x22')]=_0xed621b[_0x2805('0x22')];this[_0x2805('0x23')]=_0xed621b[_0x2805('0x23')];this[_0x2805('0x24')]=_0xed621b[_0x2805('0x24')]||'';this[_0x2805('0x25')]=_0xed621b['originatecalleridname']||'';}module[_0x2805('0x26')]=Final; \ No newline at end of file +var _0xeaf5=['scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid'];(function(_0xec531a,_0x529107){var _0x3d3bc=function(_0x382421){while(--_0x382421){_0xec531a['push'](_0xec531a['shift']());}};_0x3d3bc(++_0x529107);}(_0xeaf5,0xfd));var _0x5eaf=function(_0x575a31,_0x56336f){_0x575a31=_0x575a31-0x0;var _0x5d7dad=_0xeaf5[_0x575a31];return _0x5d7dad;};'use strict';var util=require(_0x5eaf('0x0'));var _=require(_0x5eaf('0x1'));var moment=require(_0x5eaf('0x2'));function getSeconds(_0x431aa9,_0x2da634){var _0x42ab60=moment(_0x431aa9)['milliseconds'](0x0);var _0x4d3d42=moment(_0x2da634)[_0x5eaf('0x3')](0x0);return _0x42ab60[_0x5eaf('0x4')](_0x4d3d42,'seconds');}function Final(_0x25ccd7){this['uniqueid']=_0x25ccd7[_0x5eaf('0x5')];this['scheduledat']=_0x25ccd7[_0x5eaf('0x6')];this[_0x5eaf('0x7')]=_0x25ccd7['type'];this[_0x5eaf('0x8')]=_0x25ccd7[_0x5eaf('0x7')]===_0x5eaf('0x9')?'queue':_0x25ccd7[_0x5eaf('0x7')];this[_0x5eaf('0xa')]=_0x25ccd7[_0x5eaf('0xa')];this[_0x5eaf('0xb')]=_0x25ccd7[_0x5eaf('0xb')];this[_0x5eaf('0xc')]=_0x25ccd7[_0x5eaf('0xc')];this[_0x5eaf('0xd')]=_0x25ccd7[_0x5eaf('0xa')]+_0x25ccd7[_0x5eaf('0xb')]+_0x25ccd7['countnoanswerretry']+_0x25ccd7[_0x5eaf('0xe')]+_0x25ccd7[_0x5eaf('0xf')]+_0x25ccd7[_0x5eaf('0x10')]+_0x25ccd7[_0x5eaf('0x11')]+_0x25ccd7['countagentrejectretry'];this['countnosuchnumberretry']=_0x25ccd7[_0x5eaf('0xe')];this['countdropretry']=_0x25ccd7[_0x5eaf('0xf')];this[_0x5eaf('0x10')]=_0x25ccd7[_0x5eaf('0x10')];this[_0x5eaf('0x11')]=_0x25ccd7[_0x5eaf('0x11')];this['countagentrejectretry']=_0x25ccd7[_0x5eaf('0x12')];this[_0x5eaf('0x13')]=_0x25ccd7[_0x5eaf('0x13')];this['calleridname']=_0x25ccd7['calleridname'];this[_0x5eaf('0x14')]=_0x25ccd7[_0x5eaf('0x14')];this[_0x5eaf('0x15')]=_0x25ccd7[_0x5eaf('0x15')];this[_0x5eaf('0x16')]=_0x25ccd7['responsetime'];this['endtime']=_0x25ccd7[_0x5eaf('0x16')];this[_0x5eaf('0x17')]=_0x25ccd7['ringtime']||0x0;this[_0x5eaf('0x18')]=_0x25ccd7[_0x5eaf('0x18')]||0x0;this[_0x5eaf('0x19')]=_0x25ccd7['talktime']||0x0;this[_0x5eaf('0x1a')]=_0x25ccd7[_0x5eaf('0x1a')];this['callbackuniqueid']=_0x25ccd7['callbackuniqueid'];this[_0x5eaf('0x1b')]=_0x25ccd7['callbackat'];this['recallme']=_0x25ccd7[_0x5eaf('0x1c')];this[_0x5eaf('0x1d')]=_0x25ccd7[_0x5eaf('0x1d')];this[_0x5eaf('0x1e')]=_0x25ccd7['ListId'];this[_0x5eaf('0x1f')]=_0x25ccd7[_0x5eaf('0x1f')];this[_0x5eaf('0x20')]=_0x25ccd7[_0x5eaf('0x20')];this['CampaignId']=_0x25ccd7[_0x5eaf('0x21')];this['originatecalleridnum']=_0x25ccd7[_0x5eaf('0x22')]||'';this[_0x5eaf('0x23')]=_0x25ccd7['originatecalleridname']||'';}module[_0x5eaf('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 5ea7224..caa0955 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 _0x9590=['countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x1156f4,_0x24d852){var _0x2c1a05=function(_0x15ba8f){while(--_0x15ba8f){_0x1156f4['push'](_0x1156f4['shift']());}};_0x2c1a05(++_0x24d852);}(_0x9590,0xc4));var _0x0959=function(_0x373279,_0x498af0){_0x373279=_0x373279-0x0;var _0x13e6a0=_0x9590[_0x373279];return _0x13e6a0;};'use strict';var util=require(_0x0959('0x0'));var _=require('lodash');var moment=require(_0x0959('0x1'));function getSeconds(_0x1685bb,_0x57a681){var _0x19e89f=moment(_0x1685bb)[_0x0959('0x2')](0x0);var _0x3e854e=moment(_0x57a681)[_0x0959('0x2')](0x0);return _0x19e89f['diff'](_0x3e854e,_0x0959('0x3'));}function Hangup(_0x1f035f,_0x3347c7){this[_0x0959('0x4')]=0x4;this[_0x0959('0x5')]=_0x0959('0x6');this[_0x0959('0x7')]=_0x1f035f['scheduledat'];this['type']=_0x1f035f[_0x0959('0x8')];this['campaigntype']=_0x1f035f[_0x0959('0x8')]===_0x0959('0x9')?'queue':_0x1f035f[_0x0959('0x8')];this[_0x0959('0xa')]=_0x1f035f['countbusyretry'];this['countcongestionretry']=_0x1f035f[_0x0959('0xb')];this[_0x0959('0xc')]=_0x1f035f[_0x0959('0xc')];this[_0x0959('0xd')]=_0x1f035f[_0x0959('0xa')]+_0x1f035f[_0x0959('0xb')]+_0x1f035f[_0x0959('0xc')]+_0x1f035f[_0x0959('0xe')]+_0x1f035f['countdropretry']+_0x1f035f[_0x0959('0xf')]+_0x1f035f[_0x0959('0x10')]+_0x1f035f[_0x0959('0x11')];this[_0x0959('0xe')]=_0x1f035f['countnosuchnumberretry'];this[_0x0959('0x12')]=_0x1f035f[_0x0959('0x12')];this[_0x0959('0xf')]=_0x1f035f[_0x0959('0xf')];this[_0x0959('0x10')]=_0x1f035f['countmachineretry'];this[_0x0959('0x11')]=_0x1f035f[_0x0959('0x11')];this[_0x0959('0x13')]=_0x3347c7[_0x0959('0x13')];this[_0x0959('0x14')]=_0x1f035f[_0x0959('0x15')];this[_0x0959('0x16')]=_0x1f035f[_0x0959('0x17')];this[_0x0959('0x18')]=_0x1f035f[_0x0959('0x18')];this[_0x0959('0x19')]=_0x1f035f['responsetime'];this[_0x0959('0x1a')]=moment()['format'](_0x0959('0x1b'));this['ringtime']=getSeconds(_0x1f035f[_0x0959('0x19')],_0x1f035f[_0x0959('0x18')]);this['holdtime']=0x0;this[_0x0959('0x1c')]=getSeconds(this[_0x0959('0x1a')],_0x1f035f[_0x0959('0x19')]);this[_0x0959('0x1d')]=_0x1f035f['queue'];this[_0x0959('0x1e')]=_0x0959('0x1f');this[_0x0959('0x20')]=_0x3347c7[_0x0959('0x21')];this[_0x0959('0x22')]=_0x1f035f[_0x0959('0x22')];this['callbackuniqueid']=_0x1f035f[_0x0959('0x23')];this[_0x0959('0x24')]=_0x1f035f[_0x0959('0x24')];this['recallme']=_0x1f035f['recallme'];this['ContactId']=_0x1f035f['ContactId'];this[_0x0959('0x25')]=_0x1f035f[_0x0959('0x25')];this[_0x0959('0x26')]=_0x1f035f['UserId'];this[_0x0959('0x27')]=_0x1f035f[_0x0959('0x27')];this['CampaignId']=_0x1f035f[_0x0959('0x28')];}module[_0x0959('0x29')]=Hangup; \ No newline at end of file +var _0xe247=['countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xe247,0xfb));var _0x7e24=function(_0x579b27,_0x3b5692){_0x579b27=_0x579b27-0x0;var _0xe6f741=_0xe247[_0x579b27];return _0xe6f741;};'use strict';var util=require(_0x7e24('0x0'));var _=require(_0x7e24('0x1'));var moment=require(_0x7e24('0x2'));function getSeconds(_0x298418,_0x258dfa){var _0x530309=moment(_0x298418)['milliseconds'](0x0);var _0x43617f=moment(_0x258dfa)[_0x7e24('0x3')](0x0);return _0x530309[_0x7e24('0x4')](_0x43617f,'seconds');}function Hangup(_0x3f7920,_0x57d1a){this['state']=0x4;this['statedesc']=_0x7e24('0x5');this[_0x7e24('0x6')]=_0x3f7920['scheduledat'];this[_0x7e24('0x7')]=_0x3f7920[_0x7e24('0x7')];this[_0x7e24('0x8')]=_0x3f7920[_0x7e24('0x7')]==='outbound'?_0x7e24('0x9'):_0x3f7920[_0x7e24('0x7')];this[_0x7e24('0xa')]=_0x3f7920[_0x7e24('0xa')];this[_0x7e24('0xb')]=_0x3f7920[_0x7e24('0xb')];this[_0x7e24('0xc')]=_0x3f7920[_0x7e24('0xc')];this[_0x7e24('0xd')]=_0x3f7920['countbusyretry']+_0x3f7920[_0x7e24('0xb')]+_0x3f7920[_0x7e24('0xc')]+_0x3f7920[_0x7e24('0xe')]+_0x3f7920[_0x7e24('0xf')]+_0x3f7920['countabandonedretry']+_0x3f7920[_0x7e24('0x10')]+_0x3f7920['countagentrejectretry'];this[_0x7e24('0xe')]=_0x3f7920[_0x7e24('0xe')];this[_0x7e24('0xf')]=_0x3f7920[_0x7e24('0xf')];this['countabandonedretry']=_0x3f7920[_0x7e24('0x11')];this['countmachineretry']=_0x3f7920[_0x7e24('0x10')];this[_0x7e24('0x12')]=_0x3f7920[_0x7e24('0x12')];this['uniqueid']=_0x57d1a[_0x7e24('0x13')];this['calleridname']=_0x3f7920[_0x7e24('0x14')];this[_0x7e24('0x15')]=_0x3f7920[_0x7e24('0x16')];this[_0x7e24('0x17')]=_0x3f7920[_0x7e24('0x17')];this[_0x7e24('0x18')]=_0x3f7920[_0x7e24('0x18')];this['endtime']=moment()[_0x7e24('0x19')](_0x7e24('0x1a'));this[_0x7e24('0x1b')]=getSeconds(_0x3f7920['responsetime'],_0x3f7920[_0x7e24('0x17')]);this[_0x7e24('0x1c')]=0x0;this[_0x7e24('0x1d')]=getSeconds(this['endtime'],_0x3f7920[_0x7e24('0x18')]);this[_0x7e24('0x9')]=_0x3f7920[_0x7e24('0x9')];this[_0x7e24('0x1e')]=_0x7e24('0x1f');this[_0x7e24('0x20')]=_0x57d1a[_0x7e24('0x21')];this[_0x7e24('0x22')]=_0x3f7920[_0x7e24('0x22')];this[_0x7e24('0x23')]=_0x3f7920[_0x7e24('0x23')];this[_0x7e24('0x24')]=_0x3f7920[_0x7e24('0x24')];this['recallme']=_0x3f7920[_0x7e24('0x25')];this[_0x7e24('0x26')]=_0x3f7920[_0x7e24('0x26')];this[_0x7e24('0x27')]=_0x3f7920[_0x7e24('0x27')];this[_0x7e24('0x28')]=_0x3f7920[_0x7e24('0x28')];this[_0x7e24('0x29')]=_0x3f7920['VoiceQueueId'];this[_0x7e24('0x2a')]=_0x3f7920[_0x7e24('0x2a')];}module[_0x7e24('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 591ca50..df1a794 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 _0xed95=['holdtime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name','calleridnum','responsetime','endtime','ringtime','starttime'];(function(_0x5497a8,_0x4b17ae){var _0x5a819d=function(_0x59bcc3){while(--_0x59bcc3){_0x5497a8['push'](_0x5497a8['shift']());}};_0x5a819d(++_0x4b17ae);}(_0xed95,0xb9));var _0x5ed9=function(_0x254ecf,_0x426451){_0x254ecf=_0x254ecf-0x0;var _0xd61d76=_0xed95[_0x254ecf];return _0xd61d76;};'use strict';var util=require(_0x5ed9('0x0'));var _=require(_0x5ed9('0x1'));var moment=require(_0x5ed9('0x2'));function getSeconds(_0x1f8d72,_0x43e62c){var _0x7b6960=moment(_0x1f8d72)[_0x5ed9('0x3')](0x0);var _0x3e2272=moment(_0x43e62c)[_0x5ed9('0x3')](0x0);return _0x7b6960[_0x5ed9('0x4')](_0x3e2272,_0x5ed9('0x5'));}function History(_0x15b734){this['uniqueid']=_0x15b734['uniqueid'];this[_0x5ed9('0x6')]=_0x15b734[_0x5ed9('0x6')]||undefined;this[_0x5ed9('0x7')]=_0x15b734[_0x5ed9('0x7')];this[_0x5ed9('0x8')]=_0x15b734[_0x5ed9('0x7')]==='outbound'?'queue':_0x15b734[_0x5ed9('0x7')];this[_0x5ed9('0x9')]=_0x15b734[_0x5ed9('0x9')];this[_0x5ed9('0xa')]=_0x15b734['countcongestionretry'];this['countnoanswerretry']=_0x15b734[_0x5ed9('0xb')];this[_0x5ed9('0xc')]=_0x15b734[_0x5ed9('0x9')]+_0x15b734[_0x5ed9('0xa')]+_0x15b734['countnoanswerretry']+_0x15b734[_0x5ed9('0xd')]+_0x15b734[_0x5ed9('0xe')]+_0x15b734[_0x5ed9('0xf')]+_0x15b734['countmachineretry']+_0x15b734['countagentrejectretry'];this[_0x5ed9('0xd')]=_0x15b734[_0x5ed9('0xd')];this['countdropretry']=_0x15b734[_0x5ed9('0xe')];this[_0x5ed9('0xf')]=_0x15b734['countabandonedretry'];this['countmachineretry']=_0x15b734[_0x5ed9('0x10')];this[_0x5ed9('0x11')]=_0x15b734['countagentrejectretry'];this[_0x5ed9('0x12')]=_0x15b734[_0x5ed9('0x12')];this['calleridname']=_0x15b734[_0x5ed9('0x13')];this[_0x5ed9('0x14')]=_0x15b734['number'];this['starttime']=_0x15b734['starttime'];this['responsetime']=_0x15b734[_0x5ed9('0x15')];this[_0x5ed9('0x16')]=_0x15b734[_0x5ed9('0x15')];this[_0x5ed9('0x17')]=getSeconds(_0x15b734['responsetime'],_0x15b734[_0x5ed9('0x18')]);this[_0x5ed9('0x19')]=0x0;this['talktime']=0x0;this['callback']=_0x15b734['callback'];this[_0x5ed9('0x1a')]=_0x15b734[_0x5ed9('0x1a')];this['callbackat']=_0x15b734[_0x5ed9('0x1b')];this[_0x5ed9('0x1c')]=_0x15b734[_0x5ed9('0x1c')];this[_0x5ed9('0x1d')]=_0x15b734['ContactId'];this[_0x5ed9('0x1e')]=_0x15b734[_0x5ed9('0x1e')];this[_0x5ed9('0x1f')]=_0x15b734[_0x5ed9('0x1f')];this[_0x5ed9('0x20')]=_0x15b734[_0x5ed9('0x20')];this['CampaignId']=_0x15b734['CampaignId'];this[_0x5ed9('0x21')]=_0x15b734[_0x5ed9('0x21')]||'';this[_0x5ed9('0x22')]=_0x15b734['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file +var _0xafab=['type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash','milliseconds','diff','uniqueid','scheduledat'];(function(_0x3773c1,_0x388303){var _0x5bea29=function(_0x2f528b){while(--_0x2f528b){_0x3773c1['push'](_0x3773c1['shift']());}};_0x5bea29(++_0x388303);}(_0xafab,0x122));var _0xbafa=function(_0x3e4d40,_0x346a54){_0x3e4d40=_0x3e4d40-0x0;var _0x593d40=_0xafab[_0x3e4d40];return _0x593d40;};'use strict';var util=require(_0xbafa('0x0'));var _=require(_0xbafa('0x1'));var moment=require('moment');function getSeconds(_0x52d1ad,_0x186154){var _0x56a6c9=moment(_0x52d1ad)[_0xbafa('0x2')](0x0);var _0x45b4c2=moment(_0x186154)[_0xbafa('0x2')](0x0);return _0x56a6c9[_0xbafa('0x3')](_0x45b4c2,'seconds');}function History(_0xaa6ef3){this[_0xbafa('0x4')]=_0xaa6ef3[_0xbafa('0x4')];this[_0xbafa('0x5')]=_0xaa6ef3[_0xbafa('0x5')]||undefined;this[_0xbafa('0x6')]=_0xaa6ef3[_0xbafa('0x6')];this[_0xbafa('0x7')]=_0xaa6ef3[_0xbafa('0x6')]==='outbound'?_0xbafa('0x8'):_0xaa6ef3['type'];this[_0xbafa('0x9')]=_0xaa6ef3[_0xbafa('0x9')];this['countcongestionretry']=_0xaa6ef3[_0xbafa('0xa')];this['countnoanswerretry']=_0xaa6ef3[_0xbafa('0xb')];this[_0xbafa('0xc')]=_0xaa6ef3[_0xbafa('0x9')]+_0xaa6ef3[_0xbafa('0xa')]+_0xaa6ef3[_0xbafa('0xb')]+_0xaa6ef3[_0xbafa('0xd')]+_0xaa6ef3['countdropretry']+_0xaa6ef3[_0xbafa('0xe')]+_0xaa6ef3[_0xbafa('0xf')]+_0xaa6ef3[_0xbafa('0x10')];this[_0xbafa('0xd')]=_0xaa6ef3['countnosuchnumberretry'];this['countdropretry']=_0xaa6ef3['countdropretry'];this[_0xbafa('0xe')]=_0xaa6ef3[_0xbafa('0xe')];this['countmachineretry']=_0xaa6ef3[_0xbafa('0xf')];this[_0xbafa('0x10')]=_0xaa6ef3[_0xbafa('0x10')];this[_0xbafa('0x8')]=_0xaa6ef3['queue'];this[_0xbafa('0x11')]=_0xaa6ef3[_0xbafa('0x12')];this[_0xbafa('0x13')]=_0xaa6ef3[_0xbafa('0x14')];this['starttime']=_0xaa6ef3[_0xbafa('0x15')];this[_0xbafa('0x16')]=_0xaa6ef3[_0xbafa('0x16')];this[_0xbafa('0x17')]=_0xaa6ef3[_0xbafa('0x16')];this[_0xbafa('0x18')]=getSeconds(_0xaa6ef3[_0xbafa('0x16')],_0xaa6ef3[_0xbafa('0x15')]);this[_0xbafa('0x19')]=0x0;this[_0xbafa('0x1a')]=0x0;this['callback']=_0xaa6ef3[_0xbafa('0x1b')];this[_0xbafa('0x1c')]=_0xaa6ef3[_0xbafa('0x1c')];this[_0xbafa('0x1d')]=_0xaa6ef3['callbackat'];this[_0xbafa('0x1e')]=_0xaa6ef3[_0xbafa('0x1e')];this[_0xbafa('0x1f')]=_0xaa6ef3[_0xbafa('0x1f')];this['ListId']=_0xaa6ef3[_0xbafa('0x20')];this[_0xbafa('0x21')]=_0xaa6ef3[_0xbafa('0x21')];this['VoiceQueueId']=_0xaa6ef3[_0xbafa('0x22')];this[_0xbafa('0x23')]=_0xaa6ef3[_0xbafa('0x23')];this[_0xbafa('0x24')]=_0xaa6ef3[_0xbafa('0x24')]||'';this['originatecalleridname']=_0xaa6ef3['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index bc2d044..129dbee 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 _0x80f0=['seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','waiting','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','statedesc','endtime','starttime','prototype','loopClearZombieChannels','uniqueId','[uniqueid]','clearZombieChannels','[actions]','Action','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','merge','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','active','reachable','SIP/%s','status','unmonitored','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','state','HangupInAMD','membername','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','amd','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','countdropretry','dialDropMaxRetry','dialDropRetryFrequency','ContactId','Abandoned','CALLEREXIT','countabandonedretry','add','dialAbandonedRetryFrequency','minutes','[rescheduleContact][Abandoned]','strategy','actionid','locked','paused','stateinterface','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','preview','finally','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','launchHandleIvr','dialActive','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','tags','updatedAt','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','syncOriginateResponse','getQueue','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','dialGlobalMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialMachineRetryFrequency','[rescheduleContact][Machine]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','outboundReCallsDay','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','dialLimitQueue','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Error','p\x20=\x20','Amax\x20=\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','../ami','defaults','redis','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','syncQueueSummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','stringify','milliseconds','emit','type','outbound','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','loggedInDb','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','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','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','---------------------------','isUndefined','History\x20information\x20are\x20empty','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','diff'];(function(_0x39157f,_0x3d8c1e){var _0x1ae4e2=function(_0x3429af){while(--_0x3429af){_0x39157f['push'](_0x39157f['shift']());}};_0x1ae4e2(++_0x3d8c1e);}(_0x80f0,0x195));var _0x080f=function(_0x33446e,_0x3c3a4d){_0x33446e=_0x33446e-0x0;var _0x3ffffd=_0x80f0[_0x33446e];return _0x3ffffd;};'use strict';var util=require(_0x080f('0x0'));var _=require(_0x080f('0x1'));var BPromise=require(_0x080f('0x2'));var uuid=require('uuid');var moment=require(_0x080f('0x3'));var rr=require('rr');var md5=require(_0x080f('0x4'));var Redis=require(_0x080f('0x5'));var config=require(_0x080f('0x6'));var logger=require(_0x080f('0x7'))('dialer');var loggerBooked=require(_0x080f('0x7'))(_0x080f('0x8'));var loggerPredictive=require(_0x080f('0x7'))(_0x080f('0x9'));var loggerPredictiveCalls=require(_0x080f('0x7'))(_0x080f('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x080f('0xb'));config['redis']=_[_0x080f('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x080f('0xd')]));var cmHopper=require(_0x080f('0xe'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x080f('0xf'));var cmHopperBlack=require(_0x080f('0x10'));var voiceQueueRt=require(_0x080f('0x11'));var Action=require(_0x080f('0x12'));var History=require(_0x080f('0x13'));var Final=require(_0x080f('0x14'));var AgentComplete=require(_0x080f('0x15'));var QueueCallerAbandon=require(_0x080f('0x16'));var Hangup=require(_0x080f('0x17'));var ipAgi=process[_0x080f('0x18')][_0x080f('0x19')]||'127.0.0.1';var strategy={'rrmemory':_0x080f('0x1a'),'roundrobin':_0x080f('0x1b')};var Sequence=function(){};Sequence['prototype'][_0x080f('0x1c')]=function(_0x59da2a){this['tail']=this[_0x080f('0x1d')]?this[_0x080f('0x1d')]['finally'](_0x59da2a):_0x59da2a();};function Dialer(_0x3468f7,_0x3d305a){this[_0x080f('0x1e')]=new Sequence();this['preview']=_0x3d305a;this[_0x080f('0x1f')]=_0x3468f7[_0x080f('0x1f')];this[_0x080f('0x20')]=_0x3468f7[_0x080f('0x20')];this[_0x080f('0x21')]=_0x3468f7['agents'];this[_0x080f('0x22')]=_0x3468f7[_0x080f('0x22')];this[_0x080f('0x23')]=config['maxNumberOriginate']||0x2;this[_0x080f('0x24')]={};this[_0x080f('0x25')]={};this['contactsId']={};this['uniqueId']={};this[_0x080f('0x26')]={};this['startPredictive']={};this[_0x080f('0x27')]={};this[_0x080f('0x28')]={};this['queueBooked']={};this[_0x080f('0x29')]={};ami['on'](_0x080f('0x2a'),this[_0x080f('0x2b')]['bind'](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x080f('0x2c')](this));ami['on'](_0x080f('0x2d'),this['syncOriginateResponse'][_0x080f('0x2c')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x080f('0x2c')](this));ami['on']('custom:queuesummary',this[_0x080f('0x2e')]['bind'](this));ami['on'](_0x080f('0x2f'),this[_0x080f('0x30')]['bind'](this));ami['on']('newexten',this[_0x080f('0x31')][_0x080f('0x2c')](this));ami['on'](_0x080f('0x32'),this[_0x080f('0x33')][_0x080f('0x2c')](this));ami['on'](_0x080f('0x34'),this[_0x080f('0x35')][_0x080f('0x2c')](this));ami['on'](_0x080f('0x36'),this[_0x080f('0x37')][_0x080f('0x2c')](this));this[_0x080f('0x38')]();this['loopClearZombieChannels']();}function isNotNull(_0xaf6fd2){return _0xaf6fd2!==null&&!_['isUndefined'](_0xaf6fd2);}function checkIsLoggedIn(_0x4b8c01,_0x51ede9){return function(){if(_0x51ede9<=0x0){_0x4b8c01[_0x080f('0x39')]=_0x080f('0x3a');throw _0x4b8c01[_0x080f('0x3b')]+_0x080f('0x3c');}};}function isActive(_0x1c092a){return _0x1c092a;}function checkIsActive(_0x33e329,_0x3af217){return function(){if(!isActive(_0x3af217)){_0x33e329['message']='NOT_ACTIVE';throw _0x33e329['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x273235){return function(){if(!isNotNull(_0x273235[_0x080f('0x3d')])){_0x273235['message']=_0x080f('0x3e');throw _0x273235['name']+_0x080f('0x3f');}if(!isNotNull(_0x273235['Interval'][_0x080f('0x40')])){_0x273235[_0x080f('0x39')]='INTERVAL_IS_NULL';throw _0x273235[_0x080f('0x3b')]+_0x080f('0x3f');}if(!isNotNull(_['isEmpty'](_0x273235[_0x080f('0x3d')][_0x080f('0x40')]))){_0x273235['message']=_0x080f('0x3e');throw _0x273235[_0x080f('0x3b')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x34e884,_0x3a529d,_0x14671e){return{'action':_0x34e884,'response':_0x3a529d,'message':_0x14671e,'stack':_0x14671e};}function myreject(_0x785b01){return function(_0x4e5621){return _0x785b01(msgResponse(_0x080f('0x41'),'Error',JSON[_0x080f('0x42')](_0x4e5621)));};}function getSeconds(_0x28488c,_0x2b073e){var _0x50fc46=moment(_0x28488c)[_0x080f('0x43')](0x0);var _0x4ccfc5=moment(_0x2b073e)[_0x080f('0x43')](0x0);return _0x50fc46['diff'](_0x4ccfc5,'seconds');}function emit(_0x118803,_0x34b160,_0x103948){io['to'](_0x118803)[_0x080f('0x44')](_0x34b160,_0x103948);}function emitVoiceQueueSummary(_0x423e7c){if(_0x423e7c[_0x080f('0x45')]===_0x080f('0x46')){var _0x4414c0={'id':_0x423e7c['id'],'name':_0x423e7c[_0x080f('0x3b')],'strategy':_0x423e7c['strategy'],'answered':_0x423e7c[_0x080f('0x47')],'available':_0x423e7c[_0x080f('0x48')],'loggedIn':_0x423e7c[_0x080f('0x49')],'pTalking':_0x423e7c[_0x080f('0x4a')],'sumBillable':_0x423e7c[_0x080f('0x4b')],'sumDuration':_0x423e7c[_0x080f('0x4c')],'sumHoldTime':_0x423e7c[_0x080f('0x4d')]||0x0,'talking':_0x423e7c[_0x080f('0x4e')],'total':_0x423e7c[_0x080f('0x4f')],'type':_0x423e7c[_0x080f('0x45')],'unmanaged':_0x423e7c['unmanaged'],'abandoned':_0x423e7c['abandoned'],'waiting':_0x423e7c['waiting'],'loggedInDb':_0x423e7c[_0x080f('0x50')],'dialActive':_0x423e7c['dialActive'],'dialMethod':_0x423e7c[_0x080f('0x51')],'dialOriginateCallerIdName':_0x423e7c['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x423e7c['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x423e7c[_0x080f('0x52')],'dialPrefix':_0x423e7c[_0x080f('0x53')],'outboundAnswerAgiCallsDay':_0x423e7c[_0x080f('0x54')],'outboundAnswerCallsDay':_0x423e7c[_0x080f('0x55')],'outboundBlacklistCallsDay':_0x423e7c[_0x080f('0x56')],'outboundBusyCallsDay':_0x423e7c[_0x080f('0x57')],'outboundCongestionCallsDay':_0x423e7c[_0x080f('0x58')],'outboundDropCallsDayACS':_0x423e7c[_0x080f('0x59')],'outboundDropCallsDayCallersExit':_0x423e7c[_0x080f('0x5a')],'outboundDropCallsDayTimeout':_0x423e7c[_0x080f('0x5b')],'outboundNoAnswerCallsDay':_0x423e7c['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x423e7c['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x423e7c['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x423e7c['outboundReCallsDay'],'outboundRejectCallsDay':_0x423e7c[_0x080f('0x5c')],'outboundUnknownCallsDay':_0x423e7c[_0x080f('0x5d')],'predictiveIntervalAnsweredCalls':_0x423e7c[_0x080f('0x5e')],'predictiveIntervalAvgHoldtime':_0x423e7c[_0x080f('0x5f')],'predictiveIntervalAvgTalktime':_0x423e7c['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x423e7c['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x423e7c[_0x080f('0x60')],'predictiveIntervalErlangCalls':_0x423e7c[_0x080f('0x61')],'predictiveIntervalErlangCallsDroppedCalls':_0x423e7c['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x423e7c[_0x080f('0x62')],'predictiveIntervalMultiplicativeFactor':_0x423e7c['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x423e7c[_0x080f('0x63')],'predictiveIntervalAvailable':_0x423e7c['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x423e7c[_0x080f('0x64')],'message':_0x423e7c[_0x080f('0x39')],'originated':_0x423e7c[_0x080f('0x65')],'erlangCalls':_0x423e7c[_0x080f('0x66')],'erlangCallToSecond':_0x423e7c[_0x080f('0x67')],'erlangAbandonmentRate':_0x423e7c[_0x080f('0x68')],'erlangBusyFactor':_0x423e7c[_0x080f('0x69')],'startPredictive':_0x423e7c[_0x080f('0x6a')],'startProgressive':_0x423e7c[_0x080f('0x27')]};if(_0x423e7c[_0x080f('0x6b')]){_0x4414c0[_0x080f('0x6b')]={'id':_0x423e7c[_0x080f('0x6b')]['id'],'name':_0x423e7c['Trunk'][_0x080f('0x3b')],'active':_0x423e7c[_0x080f('0x6b')]['active'],'callerid':_0x423e7c[_0x080f('0x6b')]['callerid']};}if(_0x423e7c[_0x080f('0x3d')]){_0x4414c0[_0x080f('0x3d')]={'id':_0x423e7c[_0x080f('0x3d')]['id'],'name':_0x423e7c[_0x080f('0x3d')][_0x080f('0x3b')]};}var _0x2c49af=md5(JSON[_0x080f('0x42')](_0x4414c0));if(_0x423e7c['md5']!==_0x2c49af){_0x423e7c[_0x080f('0x4')]=_0x2c49af;emit(util[_0x080f('0x6c')](_0x080f('0x6d'),_0x4414c0[_0x080f('0x3b')]),_0x080f('0x6e'),_0x4414c0);}}}function emitCampaignSummary(_0x552b17){if(_0x552b17[_0x080f('0x45')]==='ivr'){emit(util[_0x080f('0x6c')](_0x080f('0x6f'),_0x552b17[_0x080f('0x3b')]),_0x080f('0x70'),_0x552b17);}}function checkGetDataPredictive(_0x5a76da){if(isNotNull(_0x5a76da)){if(!_[_0x080f('0x71')](_0x5a76da)){loggerPredictive[_0x080f('0x72')](_0x080f('0x73'));loggerPredictive[_0x080f('0x72')](_0x080f('0x74'),_0x5a76da['predictiveIntervalTotalCalls']);loggerPredictive[_0x080f('0x72')](_0x080f('0x75'),_0x5a76da[_0x080f('0x5e')]);loggerPredictive[_0x080f('0x72')](_0x080f('0x76'),_0x5a76da[_0x080f('0x60')]);loggerPredictive[_0x080f('0x72')](_0x080f('0x77'),_0x5a76da[_0x080f('0x78')]);loggerPredictive[_0x080f('0x72')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a76da[_0x080f('0x5f')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a76da[_0x080f('0x79')]);loggerPredictive[_0x080f('0x72')](_0x080f('0x7a'));if(_0x5a76da[_0x080f('0x64')]>0x0){if(!_[_0x080f('0x7b')](_0x5a76da[_0x080f('0x79')])&&_0x5a76da[_0x080f('0x79')]>0x0){return!![];}else{loggerPredictive[_0x080f('0x72')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x080f('0x7b')](_0x5a76da['predictiveIntervalAvgHoldtime'])&&_0x5a76da[_0x080f('0x5f')]>0x0){return!![];}else{loggerPredictive[_0x080f('0x72')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x080f('0x72')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x080f('0x72')](_0x080f('0x7c'));}}else{loggerPredictive['info'](_0x080f('0x7c'));}return![];}function mergeDataErlangB(_0x134919){return function(_0x24c049){loggerPredictive[_0x080f('0x72')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x080f('0x72')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24c049[_0x080f('0x66')]);loggerPredictive['info'](_0x080f('0x7d'),_0x24c049[_0x080f('0x67')]);loggerPredictive[_0x080f('0x72')](_0x080f('0x7e'),_0x24c049[_0x080f('0x68')]);loggerPredictive[_0x080f('0x72')](_0x080f('0x7f'),_0x24c049[_0x080f('0x69')]);loggerPredictive[_0x080f('0x72')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24c049[_0x080f('0x68')]);loggerPredictive[_0x080f('0x72')](_0x080f('0x7a'));_['merge'](_0x134919,_0x24c049);};}function getDiff(_0x27ae2f){var _0x10ecf7=moment()[_0x080f('0x43')](0x0);var _0x106c45=moment(_0x27ae2f)[_0x080f('0x43')](0x0);return _0x10ecf7[_0x080f('0x80')](_0x106c45,_0x080f('0x81'));}function ifInterval(_0x5359ef,_0xd45f6){if(_['isUndefined'](_0xd45f6)){return![];}if(getDiff(_0xd45f6)<_0x5359ef*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xc2faf3){if(isNotNull(_0xc2faf3)){if(!_[_0x080f('0x7b')](_0xc2faf3[_0x080f('0x27')])){_0xc2faf3[_0x080f('0x27')]=undefined;loggerPredictive[_0x080f('0x72')](_0xc2faf3[_0x080f('0x3b')],_0x080f('0x82'));}if(!_['isUndefined'](_0xc2faf3[_0x080f('0x6a')])){_0xc2faf3[_0x080f('0x6a')]=undefined;loggerPredictive['info'](_0xc2faf3[_0x080f('0x3b')],_0x080f('0x83'));}if(!_[_0x080f('0x7b')](_0xc2faf3[_0x080f('0x84')])){clearInterval(_0xc2faf3[_0x080f('0x84')]);_0xc2faf3[_0x080f('0x84')]=undefined;loggerPredictive[_0x080f('0x72')](_0xc2faf3[_0x080f('0x3b')],_0x080f('0x85'));}}}function erlangb(_0x1f3167,_0xaa1b0e){if(_0xaa1b0e===0x0){return 0x0;}var _0x1010ac=0x1;for(var _0x173870=0x1;_0x173870<=_0xaa1b0e;_0x173870+=0x1){_0x1010ac=0x1+_0x1010ac*_0x173870/_0x1f3167;}return 0x1/_0x1010ac;}function isVoiceQueueOutbound(_0x537b4a){return _0x537b4a===_0x080f('0x46');}function isNotPreview(_0x4f0dc8){return _0x4f0dc8!=='preview';}function isCampaignIvr(_0x606b2f){return _0x606b2f===_0x080f('0x86');}function getCallerId(_0x402ae6,_0xeb0adc,_0x4532f7){if(!_[_0x080f('0x7b')](_0x4532f7)&&_0x080f('0x87')===typeof _0x4532f7&&!_['isEmpty'](_0x4532f7)){if(!_['isUndefined'](_0xeb0adc)&&_0x080f('0x87')===typeof _0xeb0adc&&!_[_0x080f('0x71')](_0xeb0adc)){return util['format'](_0x080f('0x88'),_0xeb0adc,_0x4532f7);}return util[_0x080f('0x6c')]('\x22%s\x22\x20<%s>',_0x4532f7,_0x4532f7);}if(!_[_0x080f('0x7b')](_0x402ae6)&&_0x080f('0x87')===typeof _0x402ae6&&!_[_0x080f('0x71')](_0x402ae6)){return _0x402ae6;}return _0x080f('0x89');}function loggerCatchQueueSummary(_0x5aecd8,_0x3c0469){return function(_0x16d12e){freeVariablesPredictive(_0x3c0469);emitVoiceQueueSummary(_0x3c0469);emitCampaignSummary(_0x3c0469);loggerSyncQueueSummary[_0x080f('0x8a')](_0x5aecd8,util[_0x080f('0x8b')](_0x16d12e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2493a8,_0x4f9b1b){return function(_0x2b3d2b){loggerPredictive[_0x080f('0x8a')](_0x4f9b1b[_0x080f('0x3b')],_0x2493a8);loggerPredictive[_0x080f('0x8a')](_0x2b3d2b[_0x080f('0x8c')]);freeVariablesPredictive(_0x4f9b1b);};}function loggerCatch(_0x5419c6){return function(_0x4db823){logger[_0x080f('0x8a')](_0x5419c6,util[_0x080f('0x8b')](_0x4db823,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5a8240){return _0x5a8240&&!_[_0x080f('0x7b')](_0x5a8240)&&_0x5a8240[_0x080f('0x8d')]>0x0;}function decremetOriginate(_0x1bb311){if(!_[_0x080f('0x7b')](_0x1bb311)&&_0x1bb311!==null){if(_0x1bb311[_0x080f('0x8e')](_0x080f('0x65'))){if(_0x1bb311[_0x080f('0x65')]>0x0){_0x1bb311[_0x080f('0x65')]-=0x1;}else{logger['error'](_0x080f('0x8f'));}}}else{logger[_0x080f('0x8a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x3ce058,_0x139db8,_0x2915a2){if(_0x139db8>_0x2915a2){for(var _0x2b96b=0x0;_0x2b96b<_0x139db8-_0x2915a2;_0x2b96b+=0x1){decremetOriginate(_0x3ce058);}}}function loggerGetContactDialer(_0x31f63a,_0x1e4442,_0x1f65b1){return function(_0x4d5047){checkContactLowerLimitOriginate(_0x1e4442,_0x1f65b1,0x0);logger[_0x080f('0x8a')](_0x31f63a,util[_0x080f('0x8b')](_0x4d5047,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x102560){return function(_0x506fd7){if(isNotNull(_0x506fd7)&&isNotNull(_0x506fd7[0x0])){if(_0x506fd7[0x0][_0x080f('0x90')]>0x0){_0x102560[_0x080f('0x39')]=_0x080f('0x91');logger['info']('[getContactDialer2][ReScheduled]'+_0x102560[_0x080f('0x3b')],_0x506fd7[0x0][_0x080f('0x90')],_0x080f('0x92'));}else{_0x102560[_0x080f('0x39')]=_0x080f('0x93');logger[_0x080f('0x72')]('[getContactDialer2][Empty]'+_0x102560[_0x080f('0x3b')]);}}};}function notSendMessagesQueue(_0x471b7d){if(_0x471b7d['sendMessageOneNotActive']){freeVariablesPredictive(_0x471b7d);if(_0x471b7d[_0x080f('0x65')]===0x0&&_0x471b7d[_0x080f('0x4e')]===0x0&&_0x471b7d[_0x080f('0x94')]===0x0&&(_0x471b7d[_0x080f('0x4a')]||0x0)===0x0){_0x471b7d[_0x080f('0x95')]=![];_0x471b7d[_0x080f('0x48')]=0x0;_0x471b7d[_0x080f('0x39')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x080f('0x8a')](_0x080f('0x96'),_0x471b7d['name'],_0x080f('0x97'));}else{_0x471b7d['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x080f('0x8a')](_0x080f('0x96'),_0x471b7d[_0x080f('0x3b')],_0x080f('0x98'));}emitVoiceQueueSummary(_0x471b7d);}}function notSendMessagesCampaign(_0x31e28f){if(_0x31e28f[_0x080f('0x95')]){if(_0x31e28f[_0x080f('0x65')]===0x0){_0x31e28f[_0x080f('0x95')]=![];_0x31e28f[_0x080f('0x39')]=_0x080f('0x99');loggerSyncQueueSummary[_0x080f('0x8a')](_0x080f('0x9a'),_0x31e28f[_0x080f('0x3b')],_0x080f('0x97'));}else{_0x31e28f[_0x080f('0x39')]=_0x080f('0x9b');loggerSyncQueueSummary['error'](_0x080f('0x9a'),_0x31e28f[_0x080f('0x3b')],_0x080f('0x98'));}emitCampaignSummary(_0x31e28f);}}function createObjHistory(_0x50b30c,_0xe2d145,_0x5df94a,_0x40f8b0,_0x5c18a3){_0x50b30c['message']=_0x5df94a;var _0x33c75f=new Action(_0x50b30c,_0xe2d145);var _0x569f1e=new History(_0x33c75f);_0x569f1e['state']=_0x40f8b0;_0x569f1e[_0x080f('0x9c')]=_0x5c18a3;_0x569f1e[_0x080f('0x9d')]=_0x33c75f[_0x080f('0x9e')];return _0x569f1e;}Dialer[_0x080f('0x9f')][_0x080f('0xa0')]=function(){var _0x5d5b33=this;setInterval(function(){_0x5d5b33['clearZombieChannels'](_0x5d5b33[_0x080f('0xa1')],_0x080f('0xa2'));_0x5d5b33[_0x080f('0xa3')](_0x5d5b33[_0x080f('0x25')],_0x080f('0xa4'));},0x32c8);};Dialer[_0x080f('0x9f')][_0x080f('0xa3')]=function(_0x1273e3,_0x3ae01e){var _0x1ba70c=this;for(var _0x3464f3 in _0x1273e3){if(_0x1273e3[_0x080f('0x8e')](_0x3464f3)){this[_0x080f('0x1e')]['enqueue'](function(){if(!_['isNil'](_0x1273e3[_0x3464f3])){return ami[_0x080f('0xa5')]({'action':'status','channel':_0x1273e3[_0x3464f3][_0x080f('0xa6')]})[_0x080f('0xa7')](function(_0x3ab99b){if(_0x3ab99b[_0x080f('0x39')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1273e3[_0x3464f3]&&_0x1273e3[_0x3464f3][_0x080f('0x45')]!=='ivr'){_0x1ba70c[_0x080f('0xa8')](_0x1ba70c[_0x080f('0x1f')][_0x1273e3[_0x3464f3][_0x080f('0xa9')]]);logger[_0x080f('0x8a')](_0x080f('0xaa'),_0x3ae01e,_0x3464f3,_0x1273e3[_0x3464f3][_0x080f('0xa9')]);delete _0x1273e3[_0x3464f3];}if(_0x1273e3[_0x3464f3]&&_0x1273e3[_0x3464f3][_0x080f('0x45')]===_0x080f('0x86')){_0x1ba70c[_0x080f('0xa8')](_0x1ba70c[_0x080f('0x20')][_0x1273e3[_0x3464f3][_0x080f('0xa9')]]);logger[_0x080f('0x8a')](_0x080f('0xab'),_0x3ae01e,_0x3464f3,_0x1273e3[_0x3464f3]['queue']);delete _0x1273e3[_0x3464f3];}},0x2328);}});}});}}};Dialer['prototype'][_0x080f('0xac')]=function(_0x4e10a2){return BPromise['resolve']()[_0x080f('0xad')](cmHopper[_0x080f('0xac')](_0x4e10a2))['catch'](loggerCatch(_0x080f('0xae')));};Dialer[_0x080f('0x9f')][_0x080f('0xaf')]=function(_0x18100c){return BPromise['resolve']()['then'](cmHopperBlack[_0x080f('0xaf')](_0x18100c))[_0x080f('0xa7')](loggerCatch(_0x080f('0xb0')));};Dialer['prototype'][_0x080f('0xb1')]=function(_0xf05442){return BPromise[_0x080f('0xb2')]()[_0x080f('0xad')](cmHopperBlack['checkIsBlackListIvr'](_0xf05442))[_0x080f('0xa7')](loggerCatch(_0x080f('0xb3')));};Dialer[_0x080f('0x9f')][_0x080f('0xb4')]=function(_0x31212e){return BPromise[_0x080f('0xb2')]()[_0x080f('0xad')](cmHopperHistory[_0x080f('0xb5')](_0x31212e))[_0x080f('0xa7')](loggerCatch(_0x080f('0xb6')));};Dialer['prototype'][_0x080f('0xb7')]=function(_0x324123){return BPromise[_0x080f('0xb2')]()[_0x080f('0xad')](cmHopper[_0x080f('0xb7')](_0x324123))[_0x080f('0xa7')](loggerCatch(_0x080f('0xb8')));};Dialer[_0x080f('0x9f')][_0x080f('0xb9')]=function(_0x331edc,_0x314c1c,_0x5213dc){return BPromise['resolve']()[_0x080f('0xad')](cmHopper[_0x080f('0xb9')](_0x331edc,_0x314c1c,_0x5213dc))[_0x080f('0xa7')](loggerCatch(_0x080f('0xba')));};Dialer[_0x080f('0x9f')][_0x080f('0xbb')]=function(_0x29484f,_0x483bbf,_0xbbe256,_0x198db7){return BPromise[_0x080f('0xb2')]()[_0x080f('0xad')](cmHopper[_0x080f('0xbb')](_0x29484f,_0x483bbf,_0xbbe256,_0x198db7))[_0x080f('0xa7')](loggerCatch(_0x080f('0xbc')));};Dialer['prototype']['getContactDialerIvr']=function(_0x47630d,_0x2bd518,_0x56352f){return BPromise['resolve']()[_0x080f('0xad')](cmHopper[_0x080f('0xbd')](_0x47630d,_0x2bd518,_0x56352f))[_0x080f('0xa7')](loggerCatch(_0x080f('0xbc')));};Dialer[_0x080f('0x9f')][_0x080f('0xbe')]=function(_0xa64d3){return BPromise[_0x080f('0xb2')]()[_0x080f('0xad')](voiceQueueRt[_0x080f('0xbe')](_0xa64d3))['catch'](loggerCatch(_0x080f('0xbf')));};Dialer[_0x080f('0x9f')][_0x080f('0xc0')]=function(_0x5e7bd9){return BPromise[_0x080f('0xb2')]()[_0x080f('0xad')](cmHopper[_0x080f('0xc0')](_0x5e7bd9))[_0x080f('0xa7')](loggerCatch(_0x080f('0xc1')));};Dialer[_0x080f('0x9f')][_0x080f('0xc2')]=function(_0x10a06e){return BPromise[_0x080f('0xb2')]()[_0x080f('0xad')](cmHopperHistory[_0x080f('0xc2')](_0x10a06e))[_0x080f('0xa7')](loggerCatch(_0x080f('0xc3')));};Dialer[_0x080f('0x9f')]['updateOriginated']=function(_0x20348a){if(!_[_0x080f('0x7b')](_0x20348a)&&_0x20348a!==null){if(_0x20348a[_0x080f('0x8e')](_0x080f('0x65'))){if(_0x20348a[_0x080f('0x65')]>0x0){_0x20348a['originated']-=0x1;}else{logger[_0x080f('0x8a')](_0x080f('0xc4'));}}}else{logger[_0x080f('0x8a')](_0x080f('0xc5'));}};Dialer['prototype'][_0x080f('0xc6')]=function(_0x27494b,_0x411ba9){var _0x23a6f6=this;return function(_0x569145){_0x23a6f6[_0x080f('0xa8')](_0x411ba9);logger[_0x080f('0x8a')](_0x27494b,util[_0x080f('0x8b')](_0x569145,{'showHidden':![],'depth':null}));};};Dialer[_0x080f('0x9f')][_0x080f('0xc7')]=function(_0x200c44,_0x5192f0,_0x4045d5){var _0x37a170={'state':0x19,'statedesc':_0x080f('0xc8')};this[_0x080f('0xa8')](_0x5192f0);this[_0x080f('0xc9')](_[_0x080f('0xca')](_0x37a170,_[_0x080f('0xcb')](_0x4045d5,['ContactId',_0x080f('0xcc'),_0x080f('0xcd'),_0x080f('0xce'),_0x080f('0xcf')])),_0x080f('0xd0'),'[emptyContact]');logger[_0x080f('0x8a')](_0x200c44);};Dialer['prototype'][_0x080f('0xd1')]=function(_0x53f85e){return _0x53f85e===_0x080f('0xd2');};Dialer[_0x080f('0x9f')][_0x080f('0xd3')]=function(_0x48da4d){return!_[_0x080f('0x7b')](_0x48da4d)&&_0x48da4d&&!_['isUndefined'](_0x48da4d[_0x080f('0x3b')])&&!_[_0x080f('0x7b')](_0x48da4d[_0x080f('0xd4')])&&_0x48da4d[_0x080f('0xd4')]&&(this[_0x080f('0x22')][util[_0x080f('0x6c')]('SIP/%s',_0x48da4d[_0x080f('0x3b')])]['status']===_0x080f('0xd5')||this[_0x080f('0x22')][util[_0x080f('0x6c')](_0x080f('0xd6'),_0x48da4d[_0x080f('0x3b')])][_0x080f('0xd7')]===_0x080f('0xd8'));};Dialer['prototype'][_0x080f('0xc9')]=function(_0x4ba3d9,_0x2e2586,_0x3ccf49){this['createHistory'](_0x4ba3d9)[_0x080f('0xa7')](loggerCatch(_0x2e2586));this[_0x080f('0xc0')](_0x4ba3d9)[_0x080f('0xa7')](loggerCatch(_0x3ccf49));};Dialer[_0x080f('0x9f')][_0x080f('0x33')]=function(_0x4c8ab0){var _0x28df6f=this[_0x080f('0xa1')][_0x4c8ab0['uniqueid']];var _0x1b0719;if(!_[_0x080f('0xd9')](_0x4c8ab0)&&!_[_0x080f('0xd9')](_0x4c8ab0['variable'])&&!_[_0x080f('0xd9')](_0x4c8ab0[_0x080f('0xda')][_0x080f('0xdb')])&&_0x4c8ab0[_0x080f('0xdc')]===_0x080f('0xdd')&&_0x28df6f){if(_0x28df6f[_0x080f('0x45')]!=='ivr'&&this[_0x080f('0x1f')][_0x28df6f['queue']][_0x080f('0xde')]&&_0x4c8ab0[_0x080f('0xdf')]===_0x080f('0xe0')){delete this[_0x080f('0xa1')][_0x4c8ab0[_0x080f('0xe1')]];this['updateOriginated'](this['voiceQueues'][_0x28df6f[_0x080f('0xa9')]]);this[_0x080f('0x1f')][_0x28df6f[_0x080f('0xa9')]][_0x080f('0x55')]+=0x1;this[_0x080f('0x1f')][_0x28df6f[_0x080f('0xa9')]][_0x080f('0x54')]+=0x1;_0x1b0719=new Hangup(_0x28df6f,_0x4c8ab0);_0x1b0719[_0x080f('0xe2')]=0x12;_0x1b0719['statedesc']=_0x080f('0xe3');_0x1b0719[_0x080f('0xe4')]='AMD';this[_0x080f('0xc9')](_0x1b0719,_0x080f('0xe5'),_0x080f('0xe6'));}if(_0x28df6f[_0x080f('0x45')]!==_0x080f('0x86')&&this['voiceQueues'][_0x28df6f['queue']][_0x080f('0xde')]&&_0x4c8ab0[_0x080f('0xdf')]===_0x080f('0xe7')){delete this['uniqueId'][_0x4c8ab0[_0x080f('0xe1')]];this['updateOriginated'](this[_0x080f('0x1f')][_0x28df6f[_0x080f('0xa9')]]);this[_0x080f('0x1f')][_0x28df6f[_0x080f('0xa9')]][_0x080f('0x55')]+=0x1;this['voiceQueues'][_0x28df6f[_0x080f('0xa9')]][_0x080f('0x54')]+=0x1;_0x1b0719=new Hangup(_0x28df6f,_0x4c8ab0);_0x1b0719['state']=0x13;_0x1b0719[_0x080f('0x9c')]=_0x080f('0xe8');_0x1b0719[_0x080f('0xe4')]=_0x080f('0xe9');_0x1b0719['amd']=!![];this[_0x080f('0xc9')](_0x1b0719,_0x080f('0xea'),_0x080f('0xeb'));}if(_0x28df6f[_0x080f('0x45')]===_0x080f('0x86')&&this['campaigns'][_0x28df6f[_0x080f('0xa9')]][_0x080f('0xde')]&&_0x4c8ab0[_0x080f('0xdf')]===_0x080f('0xe0')){delete this[_0x080f('0xa1')][_0x4c8ab0[_0x080f('0xe1')]];this[_0x080f('0xa8')](this[_0x080f('0x20')][_0x28df6f[_0x080f('0xa9')]]);_0x1b0719=new Hangup(_0x28df6f,_0x4c8ab0);_0x1b0719[_0x080f('0xe2')]=0x12;_0x1b0719[_0x080f('0x9c')]=_0x080f('0xe3');_0x1b0719[_0x080f('0xe4')]='AMD';this[_0x080f('0xc9')](_0x1b0719,_0x080f('0xec'),_0x080f('0xed'));}if(_0x28df6f[_0x080f('0x45')]==='ivr'&&this[_0x080f('0x20')][_0x28df6f[_0x080f('0xa9')]][_0x080f('0xde')]&&_0x4c8ab0[_0x080f('0xdf')]===_0x080f('0xe7')){delete this[_0x080f('0xa1')][_0x4c8ab0[_0x080f('0xe1')]];this['updateOriginated'](this['campaigns'][_0x28df6f[_0x080f('0xa9')]]);_0x1b0719=new Hangup(_0x28df6f,_0x4c8ab0);_0x1b0719['state']=0x13;_0x1b0719['statedesc']=_0x080f('0xe8');_0x1b0719[_0x080f('0xe4')]=_0x080f('0xe9');_0x1b0719[_0x080f('0xee')]=!![];this[_0x080f('0xc9')](_0x1b0719,_0x080f('0xef'),_0x080f('0xf0'));}}};Dialer[_0x080f('0x9f')]['syncHangup']=function(_0x2eb36b){var _0x5a4caa=this[_0x080f('0xa1')][_0x2eb36b[_0x080f('0xe1')]];var _0x5ea0e1=this;var _0x4a9ee7;if(_0x5a4caa&&_0x5a4caa[_0x080f('0x45')]===_0x080f('0x86')){delete this[_0x080f('0xa1')][_0x2eb36b[_0x080f('0xe1')]];this[_0x080f('0xa8')](this[_0x080f('0x20')][_0x5a4caa['queue']]);this[_0x080f('0x20')][_0x5a4caa[_0x080f('0xa9')]][_0x080f('0xf1')]+=0x1;_0x4a9ee7=new Hangup(_0x5a4caa,_0x2eb36b);this[_0x080f('0xc2')](_0x4a9ee7)[_0x080f('0xa7')](loggerCatch(_0x080f('0xf2')));this['moveContactManagedDialer'](_0x4a9ee7)[_0x080f('0xa7')](loggerCatch(_0x080f('0xf3')));}if(_0x5a4caa&&_0x5a4caa[_0x080f('0x45')]!==_0x080f('0x86')&&isNotNull(this[_0x080f('0x1f')][_0x5a4caa[_0x080f('0xa9')]][_0x080f('0xf4')])){delete this['uniqueId'][_0x2eb36b[_0x080f('0xe1')]];this[_0x080f('0xa8')](this['voiceQueues'][_0x5a4caa[_0x080f('0xa9')]]);this['voiceQueues'][_0x5a4caa[_0x080f('0xa9')]][_0x080f('0x55')]+=0x1;this[_0x080f('0x1f')][_0x5a4caa[_0x080f('0xa9')]][_0x080f('0x54')]+=0x1;_0x4a9ee7=new Hangup(_0x5a4caa,_0x2eb36b);_0x4a9ee7[_0x080f('0xe2')]=0x10;_0x4a9ee7[_0x080f('0x9c')]='AnswerAGI';_0x4a9ee7[_0x080f('0xe4')]='AGI';this[_0x080f('0xc2')](_0x4a9ee7)[_0x080f('0xa7')](loggerCatch(_0x080f('0xf2')));this[_0x080f('0xc0')](_0x4a9ee7)[_0x080f('0xa7')](loggerCatch('[syncHangupIvr]'));}if(_0x5a4caa&&_0x5a4caa['type']!=='ivr'&&!isNotNull(this['voiceQueues'][_0x5a4caa[_0x080f('0xa9')]]['dialQueueProject'])){delete this['uniqueId'][_0x2eb36b[_0x080f('0xe1')]];this[_0x080f('0xa8')](this[_0x080f('0x1f')][_0x5a4caa['queue']]);this[_0x080f('0x1f')][_0x5a4caa['queue']][_0x080f('0x5d')]+=0x1;_0x4a9ee7=new Hangup(_0x5a4caa,_0x2eb36b);_0x4a9ee7[_0x080f('0xe2')]=0xc;_0x4a9ee7[_0x080f('0x9c')]=_0x2eb36b['cause-txt'];_0x4a9ee7[_0x080f('0xe4')]=_0x080f('0xf5');this[_0x080f('0xc2')](_0x4a9ee7)[_0x080f('0xa7')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x080f('0xc0')](_0x4a9ee7)[_0x080f('0xa7')](loggerCatch(_0x080f('0xf3')));}};Dialer[_0x080f('0x9f')]['syncAgentComplete']=function(_0x302c73){var _0x5ae7e2=this[_0x080f('0xa1')][_0x302c73[_0x080f('0xe1')]];var _0x451b1e=this;if(this['voiceQueues'][_0x302c73[_0x080f('0xa9')]]){if(_0x5ae7e2&&_0x5ae7e2[_0x080f('0x45')]!==_0x080f('0x86')){delete this[_0x080f('0xa1')][_0x302c73[_0x080f('0xe1')]];this[_0x080f('0x1f')][_0x302c73[_0x080f('0xa9')]][_0x080f('0x55')]+=0x1;var _0x197b99=new AgentComplete(_0x5ae7e2,_0x302c73);if(_0x302c73[_0x080f('0xf6')]===_0x080f('0xf7')){_0x197b99[_0x080f('0xf8')]=this[_0x080f('0x1f')][_0x302c73[_0x080f('0xa9')]][_0x080f('0xf9')]&&this[_0x080f('0x1f')][_0x302c73[_0x080f('0xa9')]][_0x080f('0xfa')]?moment()[_0x080f('0x6c')](_0x080f('0xfb')):undefined;}this[_0x080f('0xc2')](_0x197b99)[_0x080f('0xa7')](loggerCatch(_0x080f('0xfc')));this[_0x080f('0xc0')](_0x197b99)[_0x080f('0xa7')](loggerCatch(_0x080f('0xfd')));}}};Dialer[_0x080f('0x9f')][_0x080f('0x2b')]=function(_0x590e1a){if(this[_0x080f('0x1f')][_0x590e1a[_0x080f('0xa9')]]){if(this[_0x080f('0xa1')][_0x590e1a['uniqueid']]&&this[_0x080f('0xa1')][_0x590e1a[_0x080f('0xe1')]][_0x080f('0x45')]!==_0x080f('0x86')){this['updateOriginated'](this[_0x080f('0x1f')][_0x590e1a[_0x080f('0xa9')]]);this[_0x080f('0xa1')][_0x590e1a['uniqueid']][_0x080f('0xfe')]=moment()[_0x080f('0x6c')](_0x080f('0xfb'));}}};Dialer[_0x080f('0x9f')][_0x080f('0xff')]=function(_0x3fa090){this[_0x080f('0xc2')](_0x3fa090)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x080f('0xc0')](_0x3fa090)[_0x080f('0xa7')](loggerCatch(_0x080f('0x100')));};Dialer[_0x080f('0x9f')]['syncQueueCallerAbandon']=function(_0x4b34f7){var _0x1656bd=this[_0x080f('0xa1')][_0x4b34f7['uniqueid']];var _0x44e9a1=this;if(this[_0x080f('0x1f')][_0x4b34f7['queue']]){if(_0x1656bd&&_0x1656bd['type']!==_0x080f('0x86')){delete this[_0x080f('0xa1')][_0x4b34f7[_0x080f('0xe1')]];this[_0x080f('0xa8')](this['voiceQueues'][_0x4b34f7[_0x080f('0xa9')]]);_0x1656bd[_0x080f('0x101')]=moment()[_0x080f('0x6c')](_0x080f('0xfb'));var _0x11eba2=new QueueCallerAbandon(_0x1656bd,_0x4b34f7);if(getSeconds(_0x1656bd[_0x080f('0x101')],_0x1656bd[_0x080f('0x102')])>=_0x1656bd[_0x080f('0x103')]){this['voiceQueues'][_0x4b34f7[_0x080f('0xa9')]][_0x080f('0x60')]+=0x1;this[_0x080f('0x1f')][_0x4b34f7[_0x080f('0xa9')]][_0x080f('0x5b')]+=0x1;this[_0x080f('0x1f')][_0x4b34f7[_0x080f('0xa9')]][_0x080f('0x104')]+=0x1;_0x11eba2['state']=0xa;_0x11eba2[_0x080f('0x9c')]='Drop';_0x11eba2[_0x080f('0x105')]=_0x080f('0x106');_0x11eba2[_0x080f('0xf8')]=this[_0x080f('0x1f')][_0x4b34f7['queue']][_0x080f('0xf9')]?moment()[_0x080f('0x6c')](_0x080f('0xfb')):undefined;if(_0x11eba2[_0x080f('0x107')]>=this['voiceQueues'][_0x4b34f7[_0x080f('0xa9')]][_0x080f('0x108')]-0x1){this['queueCallerAbandonCreateState'](_0x11eba2);}else{this[_0x080f('0xb7')]({'active':![],'countdropretry':_0x11eba2['countdropretry']+=0x1,'scheduledat':moment()['add'](this['voiceQueues'][_0x4b34f7[_0x080f('0xa9')]][_0x080f('0x109')],'minutes')['format'](_0x080f('0xfb')),'ContactId':_0x1656bd[_0x080f('0x10a')],'ListId':_0x1656bd[_0x080f('0xcc')],'VoiceQueueId':_0x1656bd[_0x080f('0xce')]||undefined,'CampaignId':_0x1656bd['CampaignId']||undefined})[_0x080f('0xa7')](loggerCatch('[rescheduleContact][Drop]'));}}else{this[_0x080f('0x1f')][_0x4b34f7[_0x080f('0xa9')]][_0x080f('0x78')]+=0x1;this[_0x080f('0x1f')][_0x4b34f7[_0x080f('0xa9')]][_0x080f('0x5a')]+=0x1;_0x11eba2[_0x080f('0xe2')]=0xb;_0x11eba2[_0x080f('0x9c')]=_0x080f('0x10b');_0x11eba2['dropreason']=_0x080f('0x10c');if(_0x11eba2[_0x080f('0x10d')]>=this[_0x080f('0x1f')][_0x4b34f7['queue']]['dialAbandonedMaxRetry']-0x1){this['queueCallerAbandonCreateState'](_0x11eba2);}else{this[_0x080f('0xb7')]({'active':![],'countabandonedretry':_0x11eba2[_0x080f('0x10d')]+=0x1,'scheduledat':moment()[_0x080f('0x10e')](this[_0x080f('0x1f')][_0x4b34f7[_0x080f('0xa9')]][_0x080f('0x10f')],_0x080f('0x110'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1656bd[_0x080f('0x10a')],'ListId':_0x1656bd['ListId'],'VoiceQueueId':_0x1656bd[_0x080f('0xce')]||undefined,'CampaignId':_0x1656bd[_0x080f('0xcf')]||undefined})['catch'](loggerCatch(_0x080f('0x111')));}}}}};Dialer['prototype'][_0x080f('0x31')]=function(_0x409f2e){if(this[_0x080f('0x25')][_0x409f2e['uniqueid']]){this['actions'][_0x409f2e[_0x080f('0xe1')]]['channel']=_0x409f2e[_0x080f('0xa6')];}if(this['uniqueId'][_0x409f2e[_0x080f('0xe1')]]){this['uniqueId'][_0x409f2e[_0x080f('0xe1')]][_0x080f('0xa6')]=_0x409f2e[_0x080f('0xa6')];}};Dialer[_0x080f('0x9f')][_0x080f('0x35')]=function(_0x3cfeb0){if(strategy[this[_0x080f('0x1f')][this[_0x080f('0x25')][_0x3cfeb0['actionid']][_0x080f('0xa9')]][_0x080f('0x112')]]===_0x080f('0x1b')){if(this[_0x080f('0x25')][_0x3cfeb0['actionid']]&&_['isNil'](this['actions'][_0x3cfeb0[_0x080f('0x113')]][_0x080f('0x114')])&&_0x3cfeb0[_0x080f('0xd7')]==='1'&&_0x3cfeb0[_0x080f('0x115')]==='0'){if(this[_0x080f('0x21')][_0x3cfeb0[_0x080f('0x116')]]){if(!this[_0x080f('0x21')][_0x3cfeb0[_0x080f('0x116')]][_0x080f('0x114')]){this[_0x080f('0x21')][_0x3cfeb0['stateinterface']][_0x080f('0x114')]=!![];this[_0x080f('0x25')][_0x3cfeb0['actionid']][_0x080f('0x114')]=!![];this[_0x080f('0x25')][_0x3cfeb0[_0x080f('0x113')]][_0x080f('0x116')]=_0x3cfeb0[_0x080f('0x116')];}}}}else if((strategy[this[_0x080f('0x1f')][this[_0x080f('0x25')][_0x3cfeb0[_0x080f('0x113')]][_0x080f('0xa9')]][_0x080f('0x112')]]||_0x080f('0x1a'))===_0x080f('0x1a')){if(this[_0x080f('0x25')][_0x3cfeb0['actionid']]){if(this[_0x080f('0x21')][_0x3cfeb0[_0x080f('0x116')]]){this[_0x080f('0x25')][_0x3cfeb0[_0x080f('0x113')]][_0x080f('0x116')]=_0x3cfeb0['stateinterface'];if(_[_0x080f('0xd9')](this[_0x080f('0x117')][this[_0x080f('0x25')][_0x3cfeb0[_0x080f('0x113')]][_0x080f('0xa9')]])){this[_0x080f('0x117')][this[_0x080f('0x25')][_0x3cfeb0['actionid']][_0x080f('0xa9')]]=[];}this[_0x080f('0x117')][this[_0x080f('0x25')][_0x3cfeb0[_0x080f('0x113')]][_0x080f('0xa9')]][_0x080f('0x118')](_[_0x080f('0xca')](_[_0x080f('0xcb')](this['actions'][_0x3cfeb0[_0x080f('0x113')]],[_0x080f('0x119'),_0x080f('0x116')]),{'status':_0x3cfeb0[_0x080f('0xd7')],'paused':_0x3cfeb0[_0x080f('0x115')]}));}}}};function unlockQueueStatus(_0x1a0753,_0x3819e2){setTimeout(function(){if(_['isUndefined'](_0x1a0753[_0x080f('0x11a')])){loggerBooked['error'](_0x080f('0x11b'),_0x3819e2);}_0x1a0753[_0x080f('0x11a')]=!![];loggerBooked[_0x080f('0x72')]('[booked][unlockQueueStatus]',_0x3819e2,JSON[_0x080f('0x42')](_[_0x080f('0xcb')](_0x1a0753,['name',_0x080f('0x11a')])));},0x1f3);}Dialer[_0x080f('0x9f')][_0x080f('0x37')]=function(_0x997e91){var _0x43accd=this;var _0x461006=_0x43accd['voiceQueues'][_0x43accd[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0xa9')]];if(strategy[this[_0x080f('0x1f')][this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0xa9')]][_0x080f('0x112')]]==='roundrobin'){if(this['actions'][_0x997e91['actionid']]&&this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0x116')]){this['preview'][_0x080f('0x11c')](this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0x119')],this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0x116')])['catch'](function(_0x5235ea){logger[_0x080f('0x8a')](_0x080f('0x11d'),util[_0x080f('0x8b')](_0x5235ea,{'showHidden':![],'depth':null}));})['finally'](function(){_0x43accd[_0x080f('0xa8')](_0x43accd['voiceQueues'][_0x43accd[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]]['queue']]);_0x43accd[_0x080f('0x21')][_0x43accd['actions'][_0x997e91[_0x080f('0x113')]]['stateinterface']][_0x080f('0x114')]=![];delete _0x43accd['actions'][_0x997e91['actionid']];unlockQueueStatus(_0x461006);});}else{this[_0x080f('0xa8')](this[_0x080f('0x1f')][this['actions'][_0x997e91['actionid']][_0x080f('0xa9')]]);this[_0x080f('0xb7')]({'active':![],'ContactId':this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0x10a')],'ListId':this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0xcc')],'VoiceQueueId':this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x997e91['actionid']][_0x080f('0xcf')]||undefined})[_0x080f('0xa7')](loggerCatch(_0x080f('0x11e')));delete this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]];unlockQueueStatus(_0x461006);}}else if((strategy[this['voiceQueues'][this[_0x080f('0x25')][_0x997e91['actionid']][_0x080f('0xa9')]][_0x080f('0x112')]]||_0x080f('0x1a'))==='rrmemory'){var _0x3a8a3f;if(this['actions'][_0x997e91[_0x080f('0x113')]]&&!_[_0x080f('0x71')](this[_0x080f('0x117')][this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0xa9')]])){if(this[_0x080f('0x29')][_0x43accd[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0xa9')]]){this[_0x080f('0x29')][_0x43accd['actions'][_0x997e91[_0x080f('0x113')]][_0x080f('0xa9')]]=this['queueBookedRR'][this['actions'][_0x997e91[_0x080f('0x113')]]['queue']]?this[_0x080f('0x29')][this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]][_0x080f('0xa9')]]:this[_0x080f('0x117')][this['actions'][_0x997e91[_0x080f('0x113')]][_0x080f('0xa9')]]?this['queueBooked'][this[_0x080f('0x25')][_0x997e91[_0x080f('0x113')]]['queue']][_0x080f('0x11f')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x997e91[_0x080f('0x113')]]['queue']]['_rr']=this['queueBookedRR'][this['actions'][_0x997e91['actionid']]['queue']];for(var _0x1b4e95=0x0;_0x1b4e95=0x0?!![]:![];})['catch'](myreject(_0x245d8b)));}}else{_0x354741[_0x080f('0x118')](ami[_0x080f('0xa5')]({'action':_0x080f('0x136'),'command':util[_0x080f('0x6c')](_0x080f('0x137'),_0x243304,!_[_0x080f('0x7b')](config[_0x080f('0x139')][_0xef50a4])?_0xef50a4:'')})['then'](function(_0x16440e){return _0x16440e[_0x080f('0x13a')]['indexOf']('true')>=0x0?!![]:![];})['catch'](myreject(_0x245d8b)));}BPromise['all'](_0x354741)[_0x080f('0xad')](function(_0x3c931b){var _0x506e21=_[_0x080f('0x13d')](_0x3c931b);if(_0x506e21){return _0x51af3e(_0x506e21);}else{_0x30553e[_0x080f('0x39')]=_0x3185c0?_0x080f('0x13e'):_0x080f('0x13f');return _0x245d8b(msgResponse('[ifTime][promiseAll]',_0x080f('0x131'),'Global:\x20'+_0x3185c0+'\x20'+_0x5e4cc2+_0x080f('0x140')+util['inspect'](_0x243304,{'showHidden':![],'depth':null})+_0x080f('0x141')+_0xef50a4));}})[_0x080f('0xa7')](function(_0x4cc083){return _0x245d8b(msgResponse('ifTime','Failure',JSON[_0x080f('0x42')](_0x4cc083)));});});};Dialer[_0x080f('0x9f')][_0x080f('0x142')]=function(_0x3b5d1e){var _0x263528=this;return function(){switch(_0x3b5d1e[_0x080f('0x51')]){case _0x080f('0x143'):freeVariablesPredictive(_0x3b5d1e);_0x263528[_0x080f('0x144')](_0x3b5d1e,0x1);break;case _0x080f('0x145'):freeVariablesPredictive(_0x3b5d1e);_0x263528[_0x080f('0x144')](_0x3b5d1e,_0x3b5d1e[_0x080f('0x146')]);break;case'predictive':_0x263528[_0x080f('0x9')](_0x3b5d1e);break;case _0x080f('0x8'):freeVariablesPredictive(_0x3b5d1e);_0x263528[_0x080f('0x144')](_0x3b5d1e,0x1);break;default:freeVariablesPredictive(_0x3b5d1e);logger[_0x080f('0x8a')](_0x080f('0x147'),_0x3b5d1e[_0x080f('0x3b')],'method\x20not\x20recognized');}};};Dialer[_0x080f('0x9f')][_0x080f('0x148')]=function(_0x187c8f){var _0x5caeb5=this;return function(){_0x5caeb5['handleIvr'](_0x187c8f);};};Dialer[_0x080f('0x9f')][_0x080f('0x2e')]=function(_0x5ce9ba){var _0x34fb47=this;if(isNotPreview(_0x5ce9ba[_0x080f('0x51')])){if(isVoiceQueueOutbound(_0x5ce9ba[_0x080f('0x45')])&&isActive(_0x5ce9ba[_0x080f('0x149')])){_0x5ce9ba[_0x080f('0x95')]=!![];BPromise[_0x080f('0xb2')]()['then'](checkIsLoggedIn(_0x5ce9ba,_0x5ce9ba['loggedIn']))[_0x080f('0xad')](checkIsActive(_0x5ce9ba,_0x5ce9ba['dialActive']))[_0x080f('0xad')](checkInterval(_0x5ce9ba))['then'](_0x34fb47[_0x080f('0x14a')](_0x5ce9ba))[_0x080f('0xad')](_0x34fb47[_0x080f('0x12f')](_0x5ce9ba[_0x080f('0x14b')],_0x5ce9ba[_0x080f('0x14c')],_0x5ce9ba['name'],_0x5ce9ba))['then'](_0x34fb47[_0x080f('0x14d')](_0x5ce9ba[_0x080f('0x3d')],_0x5ce9ba[_0x080f('0x14c')],_0x5ce9ba[_0x080f('0x3b')],_0x5ce9ba))[_0x080f('0xad')](_0x34fb47[_0x080f('0x142')](_0x5ce9ba))['catch'](loggerCatchQueueSummary(_0x080f('0x14e'),_0x5ce9ba));}else{notSendMessagesQueue(_0x5ce9ba);}}else{freeVariablesPredictive(_0x5ce9ba);}};Dialer['prototype']['syncCampaigns']=function(){var _0x208d9=this;var _0x39f948;for(var _0x2e2ad0 in this[_0x080f('0x20')]){if(this[_0x080f('0x20')][_0x080f('0x8e')](_0x2e2ad0)){_0x39f948=this[_0x080f('0x20')][_0x2e2ad0];if(isCampaignIvr(_0x39f948[_0x080f('0x45')])&&isActive(_0x39f948[_0x080f('0xd4')])){_0x39f948['sendMessageOneNotActive']=!![];BPromise[_0x080f('0xb2')]()['then'](checkIsActive(_0x39f948,_0x39f948[_0x080f('0xd4')]))[_0x080f('0xad')](checkInterval(_0x39f948))[_0x080f('0xad')](_0x208d9[_0x080f('0x14a')](_0x39f948))[_0x080f('0xad')](_0x208d9['checkIfTime'](_0x39f948['dialGlobalInterval'],_0x39f948['dialTimezone'],_0x39f948['name'],_0x39f948))[_0x080f('0xad')](_0x208d9[_0x080f('0x14d')](_0x39f948[_0x080f('0x3d')],_0x39f948['dialTimezone'],_0x39f948[_0x080f('0x3b')],_0x39f948))['then'](_0x208d9[_0x080f('0x148')](_0x39f948))['catch'](loggerCatchQueueSummary(_0x080f('0x14f'),_0x39f948));}else{notSendMessagesCampaign(_0x39f948);}}}};function getCallerIdRandom(_0x3a7bb7,_0x26fe82){var _0x56b15d,_0x1bfc53,_0x3f0405;if(_0x26fe82<=0x0){_0x26fe82=0x1;}_0x56b15d=new RegExp(_0x080f('0x150')+_0x26fe82+'}$');_0x1bfc53=Math[_0x080f('0x151')](0xa,_0x26fe82-0x1);_0x3f0405=Math[_0x080f('0x151')](0xa,_0x26fe82)-0x1;return util[_0x080f('0x6c')]('%s',_[_0x080f('0x152')](_0x3a7bb7,_0x56b15d,_[_0x080f('0x153')](_0x1bfc53,_0x3f0405)));}function extractCalleridName(_0x46e5d7){var _0x10c562=_0x46e5d7[_0x080f('0x154')](/"(.*?)"/);return _0x10c562?_0x10c562[0x1]:_0x46e5d7;}function extractCalleridNumber(_0x5998e2){var _0x41897d=_0x5998e2[_0x080f('0x154')](/<(.*?)>/);return _0x41897d?_0x41897d[0x1]:_0x5998e2;}Dialer[_0x080f('0x9f')][_0x080f('0x155')]=function(_0x1e2080,_0x3921d6){var _0x1c25be=this;var _0x1e8db9=uuid['v4']();this[_0x080f('0x25')][_0x1e8db9]=new Action(_0x1e2080,_0x3921d6,_0x1e8db9);return new BPromise(function(_0x3c57f3,_0xcbf2ed){if(_[_0x080f('0x7b')](_0x1e2080)&&_0x080f('0x156')!==typeof _0x1e2080){return _0xcbf2ed(msgResponse('originate',_0x080f('0x131'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x3921d6[_0x080f('0x157')][_0x080f('0x158')])||_0x3921d6[_0x080f('0x157')][_0x080f('0x158')]===null){return _0xcbf2ed(msgResponse(_0x080f('0x159'),_0x080f('0x131'),_0x080f('0x15a')));}var _0x496217={'XMD-CALLERID':_0x1c25be[_0x080f('0x25')][_0x1e8db9][_0x080f('0x15b')](),'XMD-AGI':_0x1e2080[_0x080f('0xf4')]?util[_0x080f('0x6c')](_0x080f('0x15c'),ipAgi,_0x1e2080[_0x080f('0xf4')]):_0x080f('0x15d'),'XMD-AGIAFTER':_0x1e2080[_0x080f('0xf9')]?util[_0x080f('0x6c')](_0x080f('0x15c'),ipAgi,_0x1e2080[_0x080f('0xf9')]):_0x080f('0x15d'),'XMD-QUEUE':_0x1e2080[_0x080f('0x45')]===_0x080f('0x46')?util[_0x080f('0x6c')](_0x080f('0x15e'),_0x1e2080[_0x080f('0x3b')],_0x1e2080[_0x080f('0x15f')]||'',_0x1e2080[_0x080f('0xfa')]?'c':'',_0x1e2080[_0x080f('0x103')]||0x3):_0x080f('0x15d'),'XMD-CONTACTID':_0x3921d6[_0x080f('0x10a')],'XMD-CDRTYPE':_0x080f('0x160'),'CALLERID(all)':_0x1c25be[_0x080f('0x25')][_0x1e8db9]['getCaller'](),'XMD-AMD':_0x1e2080['dialAMDActive']?_0x080f('0x161'):_0x080f('0x15d'),'XMD-DESTINATION':_0x080f('0xdd')};if(_0x1e2080['dialAMDActive']){_0x496217[_0x080f('0x162')]=_0x1e2080[_0x080f('0x163')]||0x9c4;_0x496217[_0x080f('0x164')]=_0x1e2080[_0x080f('0x165')]||0x5dc;_0x496217[_0x080f('0x166')]=_0x1e2080[_0x080f('0x167')]||0x320;_0x496217['XMD-AMDTOTALANALYSISTIME']=_0x1e2080[_0x080f('0x168')]||0x1388;_0x496217[_0x080f('0x169')]=_0x1e2080[_0x080f('0x16a')]||0x64;_0x496217['XMD-AMDBETWEENWORDSSILENCE']=_0x1e2080['dialAMDBetweenWordsSilence']||0x32;_0x496217[_0x080f('0x16b')]=_0x1e2080[_0x080f('0x16c')]||0x3;_0x496217[_0x080f('0x16d')]=_0x1e2080[_0x080f('0x16e')]||0x100;_0x496217[_0x080f('0x16f')]=_0x1e2080[_0x080f('0x170')]||0x1388;}if(_0x1e2080[_0x080f('0x45')]===_0x080f('0x46')){_0x496217['XMD-VOICEQUEUEID']=_0x3921d6['VoiceQueueId'];}else{_0x496217['XMD-CAMPAIGNID']=_0x3921d6[_0x080f('0xcf')];}for(var _0x71ce3c in _0x3921d6[_0x080f('0x157')]){if(_0x3921d6[_0x080f('0x157')]['hasOwnProperty'](_0x71ce3c)){if(isNotNull(_0x3921d6[_0x080f('0x157')][_0x71ce3c])&&_0x71ce3c!=='id'&&_0x71ce3c!==_0x080f('0x171')&&_0x71ce3c!=='createdAt'&&_0x71ce3c!==_0x080f('0x172')){_0x496217[util[_0x080f('0x6c')]('%s%s',_0x080f('0x173'),_[_0x080f('0x174')](_0x71ce3c))]=_0x3921d6[_0x080f('0x157')][_0x71ce3c];}}}var _0x10c6ce=_0x1c25be[_0x080f('0xd3')](_0x1e2080['Trunk'])?getCallerId(_0x1e2080[_0x080f('0x6b')]['callerid'],_0x1e2080[_0x080f('0x175')],_0x1e2080[_0x080f('0x176')]>0x0?getCallerIdRandom(_0x1e2080[_0x080f('0x177')],_0x1e2080['dialRandomLastDigitCallerIdNumber']):_0x1e2080[_0x080f('0x177')]):getCallerId(_[_0x080f('0xd9')](_0x1e2080[_0x080f('0x12d')])?_0x1e2080['Trunk'][_0x080f('0x178')]:_0x1e2080['TrunkBackup'][_0x080f('0x178')],_0x1e2080[_0x080f('0x175')],_0x1e2080[_0x080f('0x176')]>0x0?getCallerIdRandom(_0x1e2080['dialOriginateCallerIdNumber'],_0x1e2080[_0x080f('0x176')]):_0x1e2080['dialOriginateCallerIdNumber']);if(_0x10c6ce){_0x496217[_0x080f('0x179')]=_0x1c25be[_0x080f('0x25')][_0x1e8db9]['originatecalleridname']=extractCalleridName(_0x10c6ce);_0x496217[_0x080f('0x17a')]=_0x1c25be[_0x080f('0x25')][_0x1e8db9][_0x080f('0x17b')]=extractCalleridNumber(_0x10c6ce);}return ami['Action']({'actionid':_0x1e8db9,'action':'originate','channel':_0x1c25be[_0x080f('0xd3')](_0x1e2080[_0x080f('0x6b')])?util[_0x080f('0x6c')](_0x080f('0x17c'),_0x1e2080['Trunk'][_0x080f('0x3b')],isNotNull(_0x1e2080['dialPrefix'])?_0x1e2080[_0x080f('0x53')]['trim']()||'':'',_0x1e2080[_0x080f('0x17d')]>0x0?_0x3921d6[_0x080f('0x157')][_0x080f('0x158')][_0x080f('0x17e')](_0x1e2080['dialCutDigit']):_0x3921d6[_0x080f('0x157')][_0x080f('0x158')]):util[_0x080f('0x6c')](_0x080f('0x17c'),_[_0x080f('0xd9')](_0x1e2080['TrunkBackup'])?_0x1e2080[_0x080f('0x6b')][_0x080f('0x3b')]:_0x1e2080[_0x080f('0x12d')][_0x080f('0x3b')],isNotNull(_0x1e2080[_0x080f('0x53')])?_0x1e2080[_0x080f('0x53')][_0x080f('0x17f')]()||'':'',_0x1e2080['dialCutDigit']>0x0?_0x3921d6[_0x080f('0x157')][_0x080f('0x158')][_0x080f('0x17e')](_0x1e2080[_0x080f('0x17d')]):_0x3921d6[_0x080f('0x157')][_0x080f('0x158')]),'callerid':_0x10c6ce,'Exten':_0x080f('0xdd'),'Context':_0x080f('0x180'),'Priority':'1','variable':_0x496217,'timeout':(_0x1e2080[_0x080f('0x52')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1e8db9})[_0x080f('0xad')](function(_0xc9dfb){return _0x3c57f3(_0xc9dfb);})[_0x080f('0xa7')](function(_0x578381){_0x1e2080[_0x080f('0x181')]+=0x1;var _0x3fc3eb=new History(_0x1c25be[_0x080f('0x25')][_0x1e8db9]);logger[_0x080f('0x8a')](util[_0x080f('0x6c')](_0x080f('0x182'),JSON['stringify'](_0x578381)));_0x3fc3eb[_0x080f('0xe2')]=0xe;_0x3fc3eb[_0x080f('0x9c')]=_0x080f('0x183');_0x3fc3eb[_0x080f('0x9e')]=moment()[_0x080f('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fc3eb[_0x080f('0x9d')]=_0x3fc3eb[_0x080f('0x9e')];_0x1c25be[_0x080f('0xc2')](_0x3fc3eb)[_0x080f('0xa7')](loggerCatch(_0x080f('0x184')));_0x1c25be[_0x080f('0xc0')](_0x3fc3eb)[_0x080f('0xa7')](loggerCatch(_0x080f('0x184')))[_0x080f('0x125')](function(){delete _0x1c25be[_0x080f('0x25')][_0x1e8db9];return _0xcbf2ed(msgResponse(_0x080f('0x159'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x080f('0x9f')][_0x080f('0x185')]=function(_0xf8c1aa){var _0x5993c6=this[_0x080f('0x25')][_0xf8c1aa[_0x080f('0x113')]];var _0x2becd8=this;if(_0x5993c6){delete this[_0x080f('0x25')][_0xf8c1aa[_0x080f('0x113')]];_0x5993c6[_0x080f('0x102')]=moment()[_0x080f('0x6c')](_0x080f('0xfb'));var _0x426482=_0x5993c6[_0x080f('0x45')]===_0x080f('0x86')?this[_0x080f('0x20')][_0x5993c6['queue']]:this[_0x080f('0x1f')][_0x5993c6[_0x080f('0x186')]()];if(!this[_0x080f('0xd1')](_0xf8c1aa['response'])){this[_0x080f('0xa8')](_0x426482);return this[_0x080f('0x187')](_0x5993c6,_0x426482,_0xf8c1aa)[_0x080f('0xad')](function(_0x34bc12){})[_0x080f('0xa7')](loggerCatch(_0x080f('0x188')));}else{this[_0x080f('0xa1')][_0xf8c1aa[_0x080f('0xe1')]]=_0x5993c6;}}};Dialer[_0x080f('0x9f')]['checkRetriveMax']=function(_0x351d5a,_0x9c5d56,_0x3cab8c){var _0x5a9315=new History(_0x9c5d56);if(_0x5a9315[_0x080f('0x189')]+_0x5a9315[_0x080f('0x18a')]+_0x5a9315[_0x080f('0x18b')]+_0x5a9315[_0x080f('0x18c')]+_0x5a9315['countdropretry']+_0x5a9315[_0x080f('0x10d')]+_0x5a9315[_0x080f('0x18d')]+_0x5a9315['countagentrejectretry']>=_0x3cab8c[_0x080f('0x18e')]-0x1){return!![];}switch(_0x351d5a){case 0x3:if(_0x5a9315[_0x080f('0x18b')]>=_0x3cab8c['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0x080f('0xb7')]({'active':![],'countnoanswerretry':_0x5a9315['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x080f('0x10e')](_0x3cab8c[_0x080f('0x18f')],_0x080f('0x110'))['format'](_0x080f('0xfb')),'ContactId':_0x5a9315[_0x080f('0x10a')],'ListId':_0x5a9315[_0x080f('0xcc')],'VoiceQueueId':_0x5a9315['VoiceQueueId']||undefined,'CampaignId':_0x5a9315['CampaignId']||undefined})[_0x080f('0xa7')](loggerCatch(_0x080f('0x190')));}break;case 0x5:if(_0x5a9315['countbusyretry']>=_0x3cab8c[_0x080f('0x191')]-0x1){return!![];}else{this[_0x080f('0xb7')]({'active':![],'countbusyretry':_0x5a9315[_0x080f('0x189')]+=0x1,'scheduledat':moment()['add'](_0x3cab8c['dialBusyRetryFrequency'],_0x080f('0x110'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5a9315[_0x080f('0x10a')],'ListId':_0x5a9315[_0x080f('0xcc')],'VoiceQueueId':_0x5a9315[_0x080f('0xce')]||undefined,'CampaignId':_0x5a9315[_0x080f('0xcf')]||undefined})[_0x080f('0xa7')](loggerCatch(_0x080f('0x192')));}break;case 0x8:if(_0x5a9315[_0x080f('0x18a')]>=_0x3cab8c[_0x080f('0x193')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x5a9315[_0x080f('0x18a')]+=0x1,'scheduledat':moment()['add'](_0x3cab8c['dialCongestionRetryFrequency'],_0x080f('0x110'))[_0x080f('0x6c')](_0x080f('0xfb')),'ContactId':_0x5a9315['ContactId'],'ListId':_0x5a9315[_0x080f('0xcc')],'VoiceQueueId':_0x5a9315[_0x080f('0xce')]||undefined,'CampaignId':_0x5a9315[_0x080f('0xcf')]||undefined})['catch'](loggerCatch(_0x080f('0x194')));}break;case 0x0:if(_0x5a9315[_0x080f('0x18c')]>=_0x3cab8c['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x080f('0xb7')]({'active':![],'countnosuchnumberretry':_0x5a9315[_0x080f('0x18c')]+=0x1,'scheduledat':moment()[_0x080f('0x10e')](_0x3cab8c[_0x080f('0x195')],_0x080f('0x110'))['format'](_0x080f('0xfb')),'ContactId':_0x5a9315['ContactId'],'ListId':_0x5a9315['ListId'],'VoiceQueueId':_0x5a9315[_0x080f('0xce')]||undefined,'CampaignId':_0x5a9315[_0x080f('0xcf')]||undefined})[_0x080f('0xa7')](loggerCatch(_0x080f('0x196')));}break;case 0xa:if(_0x5a9315['countdropretry']>=_0x3cab8c[_0x080f('0x108')]-0x1){return!![];}else{this[_0x080f('0xb7')]({'active':![],'countdropretry':_0x5a9315['countdropretry']+=0x1,'scheduledat':moment()[_0x080f('0x10e')](_0x3cab8c[_0x080f('0x109')],_0x080f('0x110'))[_0x080f('0x6c')](_0x080f('0xfb')),'ContactId':_0x5a9315[_0x080f('0x10a')],'ListId':_0x5a9315['ListId'],'VoiceQueueId':_0x5a9315[_0x080f('0xce')]||undefined,'CampaignId':_0x5a9315[_0x080f('0xcf')]||undefined})[_0x080f('0xa7')](loggerCatch(_0x080f('0x197')));}break;case 0xb:if(_0x5a9315['countabandonedretry']>=_0x3cab8c['dialAbandonedMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x5a9315[_0x080f('0x10d')]+=0x1,'scheduledat':moment()['add'](_0x3cab8c[_0x080f('0x10f')],_0x080f('0x110'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5a9315[_0x080f('0x10a')],'ListId':_0x5a9315['ListId'],'VoiceQueueId':_0x5a9315[_0x080f('0xce')]||undefined,'CampaignId':_0x5a9315['CampaignId']||undefined})[_0x080f('0xa7')](loggerCatch(_0x080f('0x111')));}break;case 0x13:if(_0x5a9315[_0x080f('0x18d')]>=_0x3cab8c['dialMachineMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0x5a9315[_0x080f('0x18d')]+=0x1,'scheduledat':moment()[_0x080f('0x10e')](_0x3cab8c[_0x080f('0x198')],_0x080f('0x110'))[_0x080f('0x6c')](_0x080f('0xfb')),'ContactId':_0x5a9315['ContactId'],'ListId':_0x5a9315[_0x080f('0xcc')],'VoiceQueueId':_0x5a9315[_0x080f('0xce')]||undefined,'CampaignId':_0x5a9315[_0x080f('0xcf')]||undefined})[_0x080f('0xa7')](loggerCatch(_0x080f('0x199')));}break;case 0x14:if(_0x5a9315[_0x080f('0x19a')]>=_0x3cab8c[_0x080f('0x19b')]-0x1){return!![];}else{this[_0x080f('0xb7')]({'active':![],'countagentrejectretry':_0x5a9315[_0x080f('0x19a')]+=0x1,'scheduledat':moment()['add'](_0x3cab8c[_0x080f('0x19c')],_0x080f('0x110'))[_0x080f('0x6c')](_0x080f('0xfb')),'ContactId':_0x5a9315['ContactId'],'ListId':_0x5a9315[_0x080f('0xcc')],'VoiceQueueId':_0x5a9315[_0x080f('0xce')]||undefined,'CampaignId':_0x5a9315[_0x080f('0xcf')]||undefined})['catch'](loggerCatch(_0x080f('0x19d')));}break;default:return!![];}};Dialer['prototype'][_0x080f('0x187')]=function(_0x365bbf,_0x4f6cf1,_0x5b7050){var _0x219d89=this;var _0x5edb19=new History(_0x365bbf);return new BPromise(function(_0x33d75b,_0x4534e0){if(_[_0x080f('0x7b')](_0x4f6cf1)&&_0x080f('0x156')!==typeof _0x4f6cf1){return _0x4534e0(msgResponse(_0x080f('0x19e'),_0x080f('0x131'),_0x080f('0x19f')));}if(_[_0x080f('0x7b')](_0x5b7050)&&_0x080f('0x156')!==typeof _0x5b7050){return _0x4534e0(msgResponse(_0x080f('0x19e'),'Failure',_0x080f('0x1a0')));}switch(_0x5b7050[_0x080f('0xf6')]){case'0':_0x4f6cf1['outboundNoSuchCallsDay']+=0x1;_0x5edb19[_0x080f('0xe2')]=0x0;_0x5edb19[_0x080f('0x9c')]=_0x080f('0x1a1');_0x219d89['createHistory'](_0x5edb19)[_0x080f('0xa7')](loggerCatch(_0x080f('0x1a2')));if(_0x219d89['checkRetriveMax'](0x0,_0x365bbf,_0x4f6cf1)){if(_0x5edb19[_0x080f('0x189')]+_0x5edb19[_0x080f('0x18a')]+_0x5edb19['countnoanswerretry']+_0x5edb19[_0x080f('0x18c')]+_0x5edb19['countdropretry']+_0x5edb19[_0x080f('0x10d')]+_0x5edb19[_0x080f('0x18d')]+_0x5edb19[_0x080f('0x19a')]>=_0x4f6cf1[_0x080f('0x18e')]){_0x219d89[_0x080f('0x1a3')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1a4'));}else{_0x219d89[_0x080f('0x1a5')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1a4'));}}break;case'3':_0x4f6cf1['outboundNoAnswerCallsDay']+=0x1;_0x5edb19[_0x080f('0xe2')]=0x3;_0x5edb19[_0x080f('0x9c')]=_0x080f('0x1a6');_0x5edb19[_0x080f('0x18b')]+=0x1;_0x5edb19[_0x080f('0x1a7')]+=0x1;_0x219d89['createHistory'](_0x5edb19)[_0x080f('0xa7')](loggerCatch(_0x080f('0x1a8')));if(_0x219d89[_0x080f('0x1a9')](0x3,_0x365bbf,_0x4f6cf1)){if(_0x5edb19[_0x080f('0x18b')]>=_0x4f6cf1['dialNoAnswerMaxRetry']){_0x219d89[_0x080f('0x1a5')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1aa'));}else{_0x219d89[_0x080f('0x1a3')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1aa'));}}break;case'5':_0x4f6cf1[_0x080f('0x57')]+=0x1;_0x5edb19[_0x080f('0xe2')]=0x5;_0x5edb19[_0x080f('0x9c')]=_0x080f('0x1ab');_0x5edb19[_0x080f('0x189')]+=0x1;_0x5edb19[_0x080f('0x1a7')]+=0x1;_0x219d89[_0x080f('0xc2')](_0x5edb19)[_0x080f('0xa7')](loggerCatch(_0x080f('0x1ac')));if(_0x219d89[_0x080f('0x1a9')](0x5,_0x365bbf,_0x4f6cf1)){if(_0x5edb19[_0x080f('0x189')]>=_0x4f6cf1[_0x080f('0x191')]){_0x219d89[_0x080f('0x1a5')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1ad'));}else{_0x219d89[_0x080f('0x1a3')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1ad'));}}break;case'8':_0x4f6cf1[_0x080f('0x58')]+=0x1;_0x5edb19[_0x080f('0xe2')]=0x8;_0x5edb19['statedesc']=_0x080f('0x1ae');_0x5edb19['countcongestionretry']+=0x1;_0x5edb19[_0x080f('0x1a7')]+=0x1;_0x219d89[_0x080f('0xc2')](_0x5edb19)[_0x080f('0xa7')](loggerCatch(_0x080f('0x1af')));if(_0x219d89['checkRetriveMax'](0x8,_0x365bbf,_0x4f6cf1)){if(_0x5edb19[_0x080f('0x18a')]>=_0x4f6cf1['dialCongestionMaxRetry']){_0x219d89['createStateFinal'](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1b0'));}else{_0x219d89['stateGlobal'](_0x5edb19,_0x33d75b,_0x4534e0,'reason\x208\x20congestion');}}break;case'11':_0x4f6cf1[_0x080f('0x1b1')]+=0x1;_0x5edb19[_0x080f('0xe2')]=0xb;_0x5edb19['statedesc']='Abandoned';_0x5edb19[_0x080f('0x10d')]+=0x1;_0x5edb19[_0x080f('0x1a7')]+=0x1;_0x219d89[_0x080f('0xc2')](_0x5edb19)[_0x080f('0xa7')](loggerCatch(_0x080f('0x1b2')));if(_0x219d89['checkRetriveMax'](0xb,_0x365bbf,_0x4f6cf1)){if(_0x5edb19[_0x080f('0x10d')]>=_0x4f6cf1[_0x080f('0x1b3')]){_0x219d89[_0x080f('0x1a5')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1b4'));}else{_0x219d89[_0x080f('0x1a3')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1b4'));}}break;case'20':_0x4f6cf1[_0x080f('0x5c')]+=0x1;_0x5edb19[_0x080f('0xe2')]=0x14;_0x5edb19[_0x080f('0x9c')]=_0x080f('0x1b5');_0x5edb19[_0x080f('0x19a')]+=0x1;_0x5edb19['countglobal']+=0x1;_0x219d89[_0x080f('0xc2')](_0x5edb19)['catch'](loggerCatch(_0x080f('0x1b6')));if(_0x219d89['checkRetriveMax'](0x14,_0x365bbf,_0x4f6cf1)){if(_0x5edb19['countagentrejectretry']>=_0x4f6cf1[_0x080f('0x19b')]){_0x219d89[_0x080f('0x1a5')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1b7'));}else{_0x219d89[_0x080f('0x1a3')](_0x5edb19,_0x33d75b,_0x4534e0,_0x080f('0x1b7'));}}break;default:_0x4f6cf1[_0x080f('0x5d')]+=0x1;_0x5edb19[_0x080f('0xe2')]=0xc;_0x5edb19[_0x080f('0x9c')]=_0x5b7050['reason'];_0x219d89[_0x080f('0xc2')](_0x5edb19)['catch'](loggerCatch(_0x080f('0x1b8')));if(_0x219d89[_0x080f('0x1a9')](_0x5b7050[_0x080f('0xf6')],_0x365bbf,_0x4f6cf1)){if(_0x5edb19[_0x080f('0x189')]+_0x5edb19[_0x080f('0x18a')]+_0x5edb19[_0x080f('0x18b')]+_0x5edb19[_0x080f('0x18c')]+_0x5edb19[_0x080f('0x107')]+_0x5edb19[_0x080f('0x10d')]+_0x5edb19[_0x080f('0x18d')]+_0x5edb19[_0x080f('0x19a')]>=_0x4f6cf1[_0x080f('0x18e')]){_0x219d89[_0x080f('0x1a3')](_0x5edb19,_0x33d75b,_0x4534e0,_0x5b7050[_0x080f('0xf6')]);}else{_0x219d89['createStateFinal'](_0x5edb19,_0x33d75b,_0x4534e0,_0x5b7050[_0x080f('0xf6')]);}}}});};Dialer[_0x080f('0x9f')][_0x080f('0x1a3')]=function(_0x4acb48,_0x2a7ab7,_0x13d5e8,_0x1d42db){var _0x12e81e=new Final(_0x4acb48);_0x12e81e[_0x080f('0xe2')]=0xf;_0x12e81e[_0x080f('0x9c')]=_0x080f('0x1b9');this[_0x080f('0x1a5')](_0x12e81e,_0x2a7ab7,_0x13d5e8,_0x1d42db);};Dialer['prototype'][_0x080f('0x1a5')]=function(_0x133772,_0x35fad0,_0x24d751,_0x1100f8){this[_0x080f('0xc0')](_0x133772)['then'](function(_0x57c8b9){return _0x35fad0(msgResponse(_0x080f('0x19e'),_0x080f('0xd2'),_0x1100f8));})['catch'](function(_0x279eeb){return _0x24d751(msgResponse(_0x080f('0x1ba'),_0x080f('0x131'),'contact\x20not\x20moved'));});};Dialer[_0x080f('0x9f')]['predictive']=function(_0xa5a83d){var _0x11ace2=this;var _0x11d7e5=_0xa5a83d['dialPredictiveOptimizationPercentage']/0x64;var _0x2c048f=_0xa5a83d[_0x080f('0x5b')]/(_0xa5a83d[_0x080f('0x5b')]+_0xa5a83d[_0x080f('0x55')]);var _0x129453=Math[_0x080f('0x1bb')](_0xa5a83d[_0x080f('0x1bc')]*(_0xa5a83d[_0x080f('0x1bd')]/0x64));var _0x31e18=Math[_0x080f('0x1bb')](_0xa5a83d[_0x080f('0x1bc')]*(_0xa5a83d['predictiveIntervalMinThreshold']/0x64));var _0x2d9dd5=_0xa5a83d['available']+_0xa5a83d['talking'];var _0x42e744=Math[_0x080f('0x1be')](_0xa5a83d[_0x080f('0x66')]*_0xa5a83d[_0x080f('0x68')]*_0xa5a83d[_0x080f('0x62')]*_0xa5a83d[_0x080f('0x1bf')]);if(_[_0x080f('0x7b')](_0xa5a83d[_0x080f('0x27')])){if(!_[_0x080f('0x7b')](_0xa5a83d[_0x080f('0x6a')])){_0xa5a83d[_0x080f('0x6a')]=undefined;loggerPredictive['error'](_0x080f('0x1c0'),_0x080f('0x1c1'));}if(!_[_0x080f('0x7b')](_0xa5a83d[_0x080f('0x84')])){loggerPredictive[_0x080f('0x8a')](_0x080f('0x1c0'),_0x080f('0x1c2'));clearInterval(_0xa5a83d['handlePredictive']);_0xa5a83d[_0x080f('0x84')]=undefined;}_0xa5a83d[_0x080f('0x27')]=moment()[_0x080f('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0xa5a83d[_0x080f('0x3b')],_0x080f('0x1c3'),_0xa5a83d[_0x080f('0x27')]);this[_0x080f('0x144')](_0xa5a83d,0x1);}else if(ifInterval(_0xa5a83d['dialPredictiveInterval'],_0xa5a83d['startProgressive'])){this[_0x080f('0x144')](_0xa5a83d,0x1);loggerPredictiveCalls[_0x080f('0x72')](_0x080f('0x1c4'),_0xa5a83d[_0x080f('0x27')],_0xa5a83d[_0x080f('0x3b')]);_0xa5a83d[_0x080f('0x66')]=0x0;_0xa5a83d[_0x080f('0x104')]=0x0;}else if(_0x11d7e5<_0x2c048f&&_0xa5a83d[_0x080f('0x1c5')]===_0x080f('0x1c6')){freeVariablesPredictive(_0xa5a83d);loggerPredictive[_0x080f('0x72')](_0x080f('0x1c7'),_0x080f('0x1c8'),_0x2c048f,_0x080f('0x27'),_0xa5a83d[_0x080f('0x3b')]);}else if(_0x42e744<_0xa5a83d[_0x080f('0x104')]&&_0xa5a83d[_0x080f('0x1c5')]==='dropRate'){freeVariablesPredictive(_0xa5a83d);loggerPredictive[_0x080f('0x72')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x080f('0x1c9'),_0x42e744,_0x080f('0x1ca'),_0xa5a83d[_0x080f('0x104')],_0x080f('0x27'),_0xa5a83d['name']);}else if(!ifInterval(_0xa5a83d['dialPredictiveInterval'],_0xa5a83d[_0x080f('0x27')])&&_[_0x080f('0x7b')](_0xa5a83d[_0x080f('0x6a')])&&!_[_0x080f('0x7b')](_0xa5a83d[_0x080f('0x27')])){_0xa5a83d[_0x080f('0x6a')]=moment()[_0x080f('0x6c')](_0x080f('0xfb'));loggerPredictive[_0x080f('0x72')](_0xa5a83d[_0x080f('0x3b')],_0x080f('0x1cb'),_0xa5a83d[_0x080f('0x6a')]);this[_0x080f('0xb4')](_0xa5a83d[_0x080f('0x1cc')])[_0x080f('0xad')](this[_0x080f('0x1cd')](_0xa5a83d))[_0x080f('0xad')](mergeDataErlangB(_0xa5a83d))[_0x080f('0xad')](this[_0x080f('0x1ce')](_0xa5a83d))['catch'](loggerCatchPredictive(_0x080f('0x1cf'),_0xa5a83d));}else if(!ifInterval(_0xa5a83d['dialPredictiveInterval'],_0xa5a83d[_0x080f('0x6a')])){_0xa5a83d[_0x080f('0x104')]=0x0;_0xa5a83d['startPredictive']=moment()[_0x080f('0x6c')](_0x080f('0xfb'));loggerPredictive[_0x080f('0x72')](_0xa5a83d[_0x080f('0x3b')],_0x080f('0x1d0'),_0xa5a83d[_0x080f('0x6a')]);clearInterval(_0xa5a83d[_0x080f('0x84')]);_0xa5a83d[_0x080f('0x84')]=undefined;this[_0x080f('0xb4')](_0xa5a83d['dialPredictiveInterval'])['then'](this[_0x080f('0x1cd')](_0xa5a83d))[_0x080f('0xad')](mergeDataErlangB(_0xa5a83d))[_0x080f('0xad')](this[_0x080f('0x1ce')](_0xa5a83d))[_0x080f('0xa7')](loggerCatchPredictive(_0x080f('0x1d1'),_0xa5a83d));}else if(_0xa5a83d[_0x080f('0x1bc')]&&_0x2d9dd5<_0xa5a83d[_0x080f('0x1bc')]-_0x31e18){freeVariablesPredictive(_0xa5a83d);loggerPredictive['info'](_0xa5a83d[_0x080f('0x3b')],_0x080f('0x1d2'),_0x2d9dd5,')\x20are\x20less\x20than\x20threshold\x20(',_0xa5a83d['predictiveIntervalAvailable'],'-',_0x31e18,'=',_0xa5a83d['predictiveIntervalAvailable']-_0x31e18,')');}else if(_0xa5a83d[_0x080f('0x1bc')]&&_0x2d9dd5>_0xa5a83d[_0x080f('0x1bc')]+_0x129453){freeVariablesPredictive(_0xa5a83d);loggerPredictive[_0x080f('0x72')](_0xa5a83d[_0x080f('0x3b')],_0x080f('0x1d2'),_0x2d9dd5,_0x080f('0x1d3'),_0xa5a83d[_0x080f('0x1bc')],'+',_0x129453,'=',_0xa5a83d[_0x080f('0x1bc')]+_0x129453,')');}};Dialer[_0x080f('0x9f')][_0x080f('0x1cd')]=function(_0x1cedc9){var _0x4ad0bd=this;return function(_0x347252){return new BPromise(function(_0x1f3c41,_0x4dc04c){_[_0x080f('0xca')](_0x1cedc9,_0x347252[0x0]);if(checkGetDataPredictive(_0x347252[0x0])){var _0x3e12c6=_0x1cedc9[_0x080f('0x1bc')]=_0x1cedc9[_0x080f('0x4e')]+_0x1cedc9[_0x080f('0x48')];var _0x558dba=_0x1cedc9[_0x080f('0x1cc')]*0x3c;var _0x1d3f52=_0x347252[0x0]['predictiveIntervalAvgTalktime']+_0x347252[0x0][_0x080f('0x5f')];var _0x50c38f=(_0x347252[0x0][_0x080f('0x5e')]+_0x347252[0x0][_0x080f('0x60')]+_0x347252[0x0][_0x080f('0x78')])/_0x347252[0x0][_0x080f('0x64')];_0x1cedc9[_0x080f('0x62')]=_0x50c38f>0x0?_0x50c38f:0x1;switch(_0x1cedc9[_0x080f('0x1c5')]){case'dropRate':var _0x50b40b=_0x1cedc9[_0x080f('0x1d4')]/0x64;return _0x4ad0bd['abandonmentRate'](_0x3e12c6,_0x558dba,_0x1d3f52,_0x50c38f,_0x50b40b)['then'](function(_0x353336){return _0x1f3c41(_0x353336);});case _0x080f('0x1d5'):var _0x2ab927=_0x1cedc9[_0x080f('0x1d4')]/0x64;return _0x4ad0bd[_0x080f('0x1d6')](_0x3e12c6,_0x558dba,_0x1d3f52,_0x50c38f,_0x2ab927)['then'](function(_0x38534c){return _0x1f3c41(_0x38534c);});default:return _0x4dc04c(msgResponse(_0x080f('0x1d7'),_0x080f('0x131'),_0x080f('0x1d8')));}}else{return _0x4dc04c(msgResponse(_0x080f('0x1d7'),_0x080f('0x131'),_0x080f('0x1d9')));}});};};Dialer[_0x080f('0x9f')][_0x080f('0x1da')]=function(_0x4e13e1){var _0x26f700=this;return function(_0x2a0902){return new BPromise(function(_0x42b228,_0x2e68db){_[_0x080f('0xca')](_0x4e13e1,_0x2a0902[0x0]);if(checkGetDataPredictive(_0x2a0902[0x0])){loggerPredictive[_0x080f('0x72')](JSON[_0x080f('0x42')](_0x2a0902[0x0]));if(_0x4e13e1[_0x080f('0x1c5')]===_0x080f('0x1c6')){return _0x26f700[_0x080f('0xbe')](_0x4e13e1['id'])[_0x080f('0xad')](function(_0x283eaa){var _0x421c02=_0x4e13e1[_0x080f('0x49')]-_0x283eaa[0x0]['outboundQueuePauses'];var _0x530d1a=_0x4e13e1['dialPredictiveInterval']*0x3c;var _0x3c1b62=_0x2a0902[0x0][_0x080f('0x79')]+_0x2a0902[0x0][_0x080f('0x5f')];var _0x4d8c1c=(_0x2a0902[0x0][_0x080f('0x5e')]+_0x2a0902[0x0][_0x080f('0x60')]+_0x2a0902[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2a0902[0x0]['predictiveIntervalTotalCalls'];var _0x174396=_0x4e13e1[_0x080f('0x1d4')]/0x64;_0x4e13e1['predictiveIntervalPauses']=_0x283eaa[0x0][_0x080f('0x1db')]||0x0;_0x4e13e1[_0x080f('0x62')]=_0x4d8c1c>0x0?_0x4d8c1c:0x1;return _0x26f700[_0x080f('0x1dc')](_0x421c02,_0x530d1a,_0x3c1b62,_0x4d8c1c,_0x174396);})[_0x080f('0xad')](function(_0x10ac54){return _0x42b228(_0x10ac54);})[_0x080f('0xa7')](function(_0x4162e9){return _0x2e68db(msgResponse(_0x080f('0x1dd'),_0x080f('0x131'),JSON[_0x080f('0x42')](_0x4162e9)));});}if(_0x4e13e1[_0x080f('0x1c5')]==='agentBusyFactor'){return _0x26f700['getVoiceQueueRtPauses'](_0x4e13e1['id'])[_0x080f('0xad')](function(_0x27d61a){var _0x43ca17=_0x4e13e1[_0x080f('0x49')]-_0x27d61a[0x0]['outboundQueuePauses'];var _0xdab3a7=_0x4e13e1['dialPredictiveInterval']*0x3c;var _0x2b7422=_0x2a0902[0x0][_0x080f('0x79')]+_0x2a0902[0x0][_0x080f('0x5f')];var _0x24dc16=(_0x2a0902[0x0][_0x080f('0x5e')]+_0x2a0902[0x0][_0x080f('0x60')]+_0x2a0902[0x0][_0x080f('0x78')])/_0x2a0902[0x0][_0x080f('0x64')];var _0x48a513=_0x4e13e1[_0x080f('0x1d4')]/0x64;_0x4e13e1[_0x080f('0x63')]=_0x27d61a[0x0][_0x080f('0x1db')]||0x0;_0x4e13e1['predictiveIntervalHitRate']=_0x24dc16>0x0?_0x24dc16:0x1;return _0x26f700[_0x080f('0x1d6')](_0x43ca17,_0xdab3a7,_0x2b7422,_0x24dc16,_0x48a513);})[_0x080f('0xad')](function(_0x4ec2e6){return _0x42b228(_0x4ec2e6);})['catch'](function(_0x5a18ee){return _0x2e68db(msgResponse(_0x080f('0x1dd'),_0x080f('0x131'),JSON['stringify'](_0x5a18ee)));});}}else{return _0x2e68db(msgResponse(_0x080f('0x1d7'),'Failure',_0x080f('0x1d9')));}});};};Dialer[_0x080f('0x9f')][_0x080f('0x1ce')]=function(_0x399622){var _0x375fbe=this;return function(){var _0x4f82e3=0x0;var _0xe690b3=Math['floor'](_0x399622[_0x080f('0x67')]*0x3e8);if(_0xe690b3>0x0){_0xe690b3=_0xe690b3<0x64?0x64:_0xe690b3;loggerPredictive['info'](_0x399622[_0x080f('0x3b')],_0x080f('0x1de'),_0xe690b3,_0x080f('0x43'));_0x399622['handlePredictive']=setInterval(function(){_0x375fbe[_0x080f('0x84')](_0x399622);loggerPredictiveCalls[_0x080f('0x72')](_0x080f('0x1df'),_0x4f82e3+=0x1);},_0xe690b3);}else{loggerPredictive[_0x080f('0x72')](_0x399622[_0x080f('0x3b')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x080f('0x1e0')]=function(_0x1f426e,_0x438cb1){var _0x361583=this;return function(_0x2cf080){if(_[_0x080f('0x71')](_0x2cf080)){if(_['isNil'](_0x438cb1['UserId'])||!_0x438cb1['recallme']){if(_0x1f426e['dialMethod']===_0x080f('0x8')){_0x1f426e[_0x080f('0x11a')]=_[_0x080f('0x7b')](_0x1f426e[_0x080f('0x11a')])?!![]:_0x1f426e[_0x080f('0x11a')];var _0x37dae0=uuid['v4']();_0x361583['actions'][_0x37dae0]=new Action(_0x1f426e,_0x438cb1,_0x37dae0);loggerBooked[_0x080f('0x72')](_0x080f('0x1e1'),_0x37dae0,'queueStatusComplete:\x20',JSON[_0x080f('0x42')](_0x1f426e[_0x080f('0x11a')]),_0x080f('0x1e2'),_0x1f426e[_0x080f('0x3b')]);if(_0x1f426e[_0x080f('0x11a')]){_0x1f426e[_0x080f('0x11a')]=![];_0x361583[_0x080f('0x117')][_0x361583[_0x080f('0x25')][_0x37dae0]['queue']]=[];ami[_0x080f('0xa5')]({'actionid':_0x37dae0,'action':_0x080f('0x1e3'),'queue':_0x1f426e[_0x080f('0x3b')]})[_0x080f('0xa7')](function(_0x146326){_0x361583['updateOriginated'](_0x1f426e);_0x361583[_0x080f('0xb7')]({'active':![],'ContactId':_0x361583[_0x080f('0x25')][_0x37dae0][_0x080f('0x10a')],'ListId':_0x361583[_0x080f('0x25')][_0x37dae0][_0x080f('0xcc')],'VoiceQueueId':_0x361583['actions'][_0x37dae0][_0x080f('0xce')]||undefined,'CampaignId':_0x361583[_0x080f('0x25')][_0x37dae0]['CampaignId']||undefined})['catch'](loggerCatch(_0x080f('0x1e4')));delete _0x361583[_0x080f('0x25')][_0x37dae0];});}else{loggerBooked['info'](_0x080f('0x1e5'),JSON[_0x080f('0x42')](_0x1f426e[_0x080f('0x11a')]),_0x080f('0x1e2'),_0x1f426e[_0x080f('0x3b')]);_0x361583[_0x080f('0xa8')](_0x1f426e);_0x361583[_0x080f('0xb7')]({'active':![],'ContactId':_0x361583[_0x080f('0x25')][_0x37dae0][_0x080f('0x10a')],'ListId':_0x361583['actions'][_0x37dae0][_0x080f('0xcc')],'VoiceQueueId':_0x361583[_0x080f('0x25')][_0x37dae0][_0x080f('0xce')]||undefined,'CampaignId':_0x361583[_0x080f('0x25')][_0x37dae0][_0x080f('0xcf')]||undefined})['catch'](loggerCatch(_0x080f('0x1e4')));delete _0x361583[_0x080f('0x25')][_0x37dae0];}}else{return _0x361583[_0x080f('0x155')](_0x1f426e,_0x438cb1);}}else{if(getDiff(_0x438cb1[_0x080f('0x1e6')])<_0x1f426e[_0x080f('0x1e7')]*0x3c){if(_0x438cb1['Agent']&&!_0x438cb1[_0x080f('0x1e8')][_0x080f('0x1e9')]){_0x361583[_0x080f('0x124')][_0x080f('0x11c')](_0x438cb1['id'])[_0x080f('0x125')](function(){_0x361583['updateOriginated'](_0x1f426e);});}else{_0x361583[_0x080f('0xb9')]({'active':![]},_0x438cb1['id'],0x1)['finally'](function(){console[_0x080f('0x1ea')]('Contact\x20updated');_0x361583[_0x080f('0xa8')](_0x1f426e);});}}else{_0x1f426e[_0x080f('0x1eb')]+=0x1;_0x361583['updateOriginated'](_0x1f426e);if(_0x1f426e[_0x080f('0x1ec')]){_0x361583[_0x080f('0xb7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x438cb1[_0x080f('0x10a')],'ListId':_0x438cb1[_0x080f('0xcc')],'VoiceQueueId':_0x438cb1[_0x080f('0xce')]||undefined,'CampaignId':_0x438cb1['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x361583[_0x080f('0xc2')](createObjHistory(_0x1f426e,_0x438cb1,_0x080f('0x1ed'),0x17,_0x080f('0x1ee')))[_0x080f('0xa7')](loggerCatch(_0x080f('0x1ef')));}else{_0x361583['saveInDb'](createObjHistory(_0x1f426e,_0x438cb1,_0x080f('0x1f0'),0x16,_0x080f('0x1f1')),_0x080f('0x1f2'),_0x080f('0x1f3'));}}}}else{_0x1f426e['outboundBlacklistCallsDay']+=0x1;_0x361583[_0x080f('0xc9')](createObjHistory(_0x1f426e,_0x438cb1,_0x080f('0x1f4'),0xd,'Blacklist'),_0x080f('0x1f5'),_0x080f('0x1f6'));throw _0x080f('0x1f7');}};};Dialer['prototype']['handleIvr']=function(_0x5b75d4){var _0xaf58b=this;var _0x533501=[];var _0x3bed4d=_0x5b75d4[_0x080f('0x1f8')]-_0x5b75d4['originated']-_0x5b75d4[_0x080f('0x1f9')];emitCampaignSummary(_0x5b75d4);if(_0x3bed4d>0x0){if(_0x3bed4d>this[_0x080f('0x23')]){_0x3bed4d=this[_0x080f('0x23')];}_0x5b75d4['temp']+=_0x3bed4d;this[_0x080f('0xbd')](_0x5b75d4['id'],_0x3bed4d,_0x5b75d4[_0x080f('0x1fa')])[_0x080f('0xad')](function(_0x103496){_0x5b75d4[_0x080f('0x1f9')]-=_0x3bed4d;_0x5b75d4['temp']=_0x5b75d4[_0x080f('0x1f9')]>0x0?_0x5b75d4[_0x080f('0x1f9')]:0x0;if(!checkContactEmpty(_0x103496)){_0x5b75d4['message']=_0x080f('0x93');logger[_0x080f('0x72')]('[getContactCampaign2][Empty]'+_0x5b75d4[_0x080f('0x3b')]);}else{_0x5b75d4[_0x080f('0x65')]+=_0x103496[_0x080f('0x8d')];_0x5b75d4[_0x080f('0x39')]=_0x080f('0x1fb');for(var _0x3936ff=0x0;_0x3936ff<_0x103496['length'];_0x3936ff+=0x1){_0x5b75d4[_0x080f('0x1fc')]+=0x1;if(_[_0x080f('0xd9')](_0x103496[_0x3936ff])||_['isNil'](_0x103496[_0x3936ff]['Contact'])||_[_0x080f('0xd9')](_0x103496[_0x3936ff][_0x080f('0x157')][_0x080f('0x158')])){_0xaf58b[_0x080f('0xc7')](_0x080f('0x1fd'),_0x5b75d4,_0x103496[_0x3936ff]);}else{_0xaf58b[_0x080f('0xb1')](_[_0x080f('0xcb')](_0x103496[_0x3936ff],['CampaignId','Contact.phone']))[_0x080f('0xad')](_0xaf58b['checkContactBlack'](_0x5b75d4,_0x103496[_0x3936ff]))[_0x080f('0xa7')](_0xaf58b[_0x080f('0xc6')]('[actionOriginateIvr]\x20',_0x5b75d4));}}}})[_0x080f('0xa7')](loggerGetContactDialer('[getContactCampaign2]',_0x5b75d4,_0x3bed4d));}};Dialer['prototype'][_0x080f('0x144')]=function(_0x48dccf,_0x6da322){var _0x36d2ea=this;var _0x3246bd=[];var _0x414dc3=_0x6da322>=0x1?_0x6da322:0x1;var _0x3dda29=[];if(_0x48dccf[_0x080f('0x51')]===_0x080f('0x8')){_0x414dc3=0x1;}var _0x397add=Math[_0x080f('0x1be')](_0x48dccf[_0x080f('0x48')]*_0x414dc3)-_0x48dccf['originated']-_0x48dccf[_0x080f('0x1f9')];emitVoiceQueueSummary(_0x48dccf);if(_0x48dccf[_0x080f('0x1fe')]>0x0){var _0x22d25b=_0x48dccf['dialLimitQueue']-_0x48dccf['originated']-_0x48dccf[_0x080f('0x4e')]-_0x48dccf[_0x080f('0x1f9')]-_0x48dccf[_0x080f('0x4a')];if(_0x397add>_0x22d25b){_0x397add=_0x22d25b;}}if(_0x397add>0x0){if(_0x48dccf[_0x080f('0x51')]===_0x080f('0x8')){_0x397add=0x1;}if(_0x397add>this['maxNumberOriginate']){_0x397add=this[_0x080f('0x23')];}_0x48dccf[_0x080f('0x1f9')]+=_0x397add;for(var _0x57fd58 in this[_0x080f('0x21')]){if(this['agents']['hasOwnProperty'](_0x57fd58)){if(this[_0x080f('0x21')][_0x57fd58][_0x080f('0xe2')]==='not_inuse'&&this['agents'][_0x57fd58]['status']===_0x080f('0xd5')){_0x3246bd[_0x080f('0x118')](this[_0x080f('0x21')][_0x57fd58]['id']);}}}this[_0x080f('0xbb')](_0x48dccf['id'],_0x3246bd,_0x397add,_0x48dccf['dialOrderByScheduledAt'])['then'](function(_0x490ba6){_0x48dccf[_0x080f('0x1f9')]-=_0x397add;_0x48dccf[_0x080f('0x1f9')]=_0x48dccf[_0x080f('0x1f9')]>0x0?_0x48dccf['temp']:0x0;if(!checkContactEmpty(_0x490ba6)){_0x36d2ea['countReScheduled'](_0x48dccf)[_0x080f('0xad')](sendMessageReschedule(_0x48dccf))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x48dccf['originated']+=_0x490ba6[_0x080f('0x8d')];_0x48dccf['message']=_0x48dccf[_0x080f('0x51')]===_0x080f('0x8')?_0x080f('0x161'):_0x080f('0x1fb');for(var _0x1ea8e1=0x0;_0x1ea8e1<_0x490ba6['length'];_0x1ea8e1+=0x1){if(_[_0x080f('0xd9')](_0x490ba6[_0x1ea8e1])||_['isNil'](_0x490ba6[_0x1ea8e1][_0x080f('0x157')])||_[_0x080f('0xd9')](_0x490ba6[_0x1ea8e1][_0x080f('0x157')][_0x080f('0x158')])){_0x36d2ea[_0x080f('0xc7')]('[actionOriginate]\x20',_0x48dccf,_0x490ba6[_0x1ea8e1]);}else{_0x36d2ea[_0x080f('0xaf')](_['pick'](_0x490ba6[_0x1ea8e1],[_0x080f('0xce'),_0x080f('0x1ff')]))[_0x080f('0xad')](_0x36d2ea[_0x080f('0x1e0')](_0x48dccf,_0x490ba6[_0x1ea8e1]))[_0x080f('0xa7')](_0x36d2ea[_0x080f('0xc6')]('[actionOriginate]\x20',_0x48dccf));}}}})['catch'](loggerGetContactDialer(_0x080f('0x200'),_0x48dccf,_0x397add));}};Dialer[_0x080f('0x9f')]['handlePredictive']=function(_0x32121c){var _0x5f34c2=this;if(_0x32121c[_0x080f('0x1fe')]>0x0){var _0x235cda=_0x32121c['dialLimitQueue']-_0x32121c[_0x080f('0x65')]-_0x32121c['talking'];if(_0x235cda>0x0){this[_0x080f('0x201')](_0x32121c);}else{loggerPredictiveCalls[_0x080f('0x72')](_0x080f('0x202'));}}else{this[_0x080f('0x201')](_0x32121c);}};Dialer[_0x080f('0x9f')][_0x080f('0x201')]=function(_0x50bb67){var _0x416ff2=this;var _0x6b9b9d=[];_0x50bb67[_0x080f('0x65')]+=0x1;for(var _0x358e53 in this[_0x080f('0x21')]){if(this[_0x080f('0x21')][_0x080f('0x8e')](_0x358e53)){if(this[_0x080f('0x21')][_0x358e53][_0x080f('0xe2')]===_0x080f('0x203')&&this['agents'][_0x358e53][_0x080f('0xd7')]===_0x080f('0xd5')){_0x6b9b9d[_0x080f('0x118')](this[_0x080f('0x21')][_0x358e53]['id']);}}}this[_0x080f('0xbb')](_0x50bb67['id'],_0x6b9b9d,0x1,_0x50bb67[_0x080f('0x1fa')])[_0x080f('0xad')](function(_0x21c473){if(!checkContactEmpty(_0x21c473)){checkContactLowerLimitOriginate(_0x50bb67,0x1,0x0);_0x416ff2[_0x080f('0xac')](_0x50bb67)['then'](sendMessageReschedule(_0x50bb67))[_0x080f('0xa7')](loggerCatch(_0x080f('0xae')));}else{_0x50bb67['message']=_0x080f('0x1fb');if(_['isNil'](_0x21c473[0x0])||_[_0x080f('0xd9')](_0x21c473[0x0][_0x080f('0x157')])||_['isNil'](_0x21c473[0x0][_0x080f('0x157')][_0x080f('0x158')])){_0x416ff2[_0x080f('0xc7')]('[actionOriginate]\x20',_0x50bb67,_0x21c473[0x0]);}else{_0x416ff2[_0x080f('0xaf')](_[_0x080f('0xcb')](_0x21c473[0x0],[_0x080f('0xce'),'Contact.phone']))[_0x080f('0xad')](_0x416ff2[_0x080f('0x1e0')](_0x50bb67,_0x21c473[0x0]))[_0x080f('0xa7')](_0x416ff2['loggerHandler'](_0x080f('0x204'),_0x50bb67));}}})['catch'](loggerGetContactDialer(_0x080f('0x205'),_0x50bb67,0x1));emitVoiceQueueSummary(_0x50bb67);};Dialer[_0x080f('0x9f')][_0x080f('0x1dc')]=function(_0x2e1429,_0x432f7f,_0x40046d,_0x2499b0,_0x4e133a,_0x529fc0){loggerPredictive['info'](_0x080f('0x206'));loggerPredictive[_0x080f('0x72')](_0x080f('0x207'),_0x2e1429);loggerPredictive['info'](_0x080f('0x208'),_0x432f7f);loggerPredictive['info'](_0x080f('0x209'),_0x40046d);loggerPredictive[_0x080f('0x72')]('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',_0x2499b0);loggerPredictive[_0x080f('0x72')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e133a);loggerPredictive[_0x080f('0x72')](_0x080f('0x7a'));return new BPromise(function(_0x357861,_0x10f915){if(_0x2e1429<=0x0||isNaN(_0x2e1429)){return _0x10f915(msgResponse(_0x080f('0x20a'),'Error',_0x080f('0x20b')+_0x2e1429));}if(_0x40046d<=0x0||isNaN(_0x40046d)){return _0x10f915(msgResponse(_0x080f('0x20a'),_0x080f('0x20c'),'Ts\x20=\x20'+_0x40046d));}if(_0x2499b0<=0x0||isNaN(_0x2499b0)){return _0x10f915(msgResponse('[abandonmentRate]',_0x080f('0x20c'),_0x080f('0x20d')+_0x2499b0));}if(_0x432f7f<=0x0||isNaN(_0x432f7f)){return _0x10f915(msgResponse(_0x080f('0x20a'),'Error','interval\x20=\x20'+_0x432f7f));}if(_0x4e133a<=0x0||isNaN(_0x4e133a)){return _0x10f915(msgResponse('[abandonmentRate]','Error',_0x080f('0x20e')+_0x4e133a));}_0x529fc0=_0x529fc0||0x0;var _0x5336e4=0x1/_0x40046d;var _0x2f76c8=0x0;var _0x39ce83=0x0;var _0xa8d341=0x0;var _0x2e782b=0x0;for(var _0x4b0ffb=0x0;_0xa8d341<_0x4e133a;_0x4b0ffb+=0x1){_0x39ce83=_0x4b0ffb/_0x432f7f;_0x2f76c8=(_0x2499b0*_0x39ce83+_0x529fc0)/_0x5336e4;_0xa8d341=erlangb(_0x2f76c8,_0x2e1429);_0x2e782b=_0x2f76c8/_0x2e1429*(0x1-erlangb(_0x2f76c8,_0x2e1429));}return _0x357861({'erlangCalls':_0x4b0ffb,'erlangCallToSecond':_0x432f7f/_0x4b0ffb,'erlangAbandonmentRate':_0xa8d341,'erlangBusyFactor':_0x2e782b});});};Dialer['prototype'][_0x080f('0x1d6')]=function(_0x3353d9,_0x54c38c,_0x38dd2c,_0x4bfe4c,_0x1930b4,_0xc3a457){loggerPredictive[_0x080f('0x72')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x080f('0x72')](_0x080f('0x207'),_0x3353d9);loggerPredictive[_0x080f('0x72')](_0x080f('0x208'),_0x54c38c);loggerPredictive[_0x080f('0x72')](_0x080f('0x209'),_0x38dd2c);loggerPredictive[_0x080f('0x72')](_0x080f('0x20f'),_0x4bfe4c);loggerPredictive[_0x080f('0x72')](_0x080f('0x210'),_0x1930b4);loggerPredictive[_0x080f('0x72')](_0x080f('0x7a'));return new BPromise(function(_0x4f4ce2,_0x3d40f5){if(_0x3353d9<=0x0||isNaN(_0x3353d9)){return _0x3d40f5(msgResponse(_0x080f('0x211'),_0x080f('0x20c'),_0x080f('0x20b')+_0x3353d9));}if(_0x38dd2c<=0x0||isNaN(_0x38dd2c)){return _0x3d40f5(msgResponse(_0x080f('0x211'),_0x080f('0x20c'),_0x080f('0x212')+_0x38dd2c));}if(_0x4bfe4c<=0x0||isNaN(_0x4bfe4c)){return _0x3d40f5(msgResponse(_0x080f('0x211'),_0x080f('0x20c'),'p\x20=\x20'+_0x4bfe4c));}if(_0x54c38c<=0x0||isNaN(_0x54c38c)){return _0x3d40f5(msgResponse('[busyFactor]',_0x080f('0x20c'),_0x080f('0x213')+_0x54c38c));}if(_0x1930b4<=0x0||isNaN(_0x1930b4)){return _0x3d40f5(msgResponse('[busyFactor]',_0x080f('0x20c'),_0x080f('0x214')+_0x1930b4));}_0xc3a457=_0xc3a457||0x0;var _0x420295=0x1/_0x38dd2c;var _0x59fb5a=0x0;var _0x997097=0x0;var _0x6ad10d=0x0;var _0x2b7cad=0x0;for(var _0x5938f4=0x0;_0x2b7cad<_0x1930b4;_0x5938f4+=0x1){_0x997097=_0x5938f4/_0x54c38c;_0x59fb5a=(_0x4bfe4c*_0x997097+_0xc3a457)/_0x420295;_0x6ad10d=erlangb(_0x59fb5a,_0x3353d9);_0x2b7cad=_0x59fb5a/_0x3353d9*(0x1-erlangb(_0x59fb5a,_0x3353d9));}return _0x4f4ce2({'erlangCalls':_0x5938f4,'erlangCallToSecond':_0x54c38c/_0x5938f4,'erlangAbandonmentRate':_0x6ad10d,'erlangBusyFactor':_0x2b7cad});});};module[_0x080f('0x215')]=Dialer; \ No newline at end of file +var _0xaee2=['outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','md5','format','voice:queue:%s','ivr','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\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','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','starttime','loopClearZombieChannels','uniqueId','[uniqueid]','clearZombieChannels','actions','[actions]','isNil','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ListId','UserId','VoiceQueueId','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','dialAMDActive','HANGUP','state','HangupInAMD','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','membername','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialDropMaxRetry','countdropretry','add','dialDropRetryFrequency','minutes','ContactId','CampaignId','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','actionid','locked','paused','stateinterface','queueBooked','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Intervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','indexOf','true','Action','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','handlePower','power','predictive','Queue','launchHandleIvr','handleIvr','loggedIn','checkIfTime','dialGlobalInterval','[syncQueueSummary]','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','endtime','[originate][error]','getQueue','callProgressDetecting','[callProgressDetecting]\x20','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','countbusyretry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[rescheduleContact][Drop]','countmachineretry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','createStateFinal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','stateGlobal','Busy','countglobal','[syncAgentComplete][createHistory][5]','checkRetriveMax','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','busyFactor','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Error','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startProgressive','ivrOriginated','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','custom:queuesummary','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay'];(function(_0x1d47ab,_0x436b1b){var _0x8b7c4b=function(_0x48ba3c){while(--_0x48ba3c){_0x1d47ab['push'](_0x1d47ab['shift']());}};_0x8b7c4b(++_0x436b1b);}(_0xaee2,0x1b6));var _0x2aee=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xaee2[_0x349367];return _0x14179b;};'use strict';var util=require(_0x2aee('0x0'));var _=require(_0x2aee('0x1'));var BPromise=require(_0x2aee('0x2'));var uuid=require(_0x2aee('0x3'));var moment=require(_0x2aee('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x2aee('0x5'));var config=require('../../../config/environment/');var logger=require(_0x2aee('0x6'))(_0x2aee('0x7'));var loggerBooked=require(_0x2aee('0x6'))(_0x2aee('0x8'));var loggerPredictive=require(_0x2aee('0x6'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x2aee('0x9'));var loggerSyncQueueSummary=require(_0x2aee('0x6'))(_0x2aee('0xa'));var ami=require('../ami');config[_0x2aee('0xb')]=_[_0x2aee('0xc')](config[_0x2aee('0xb')],{'host':_0x2aee('0xd'),'port':0x18eb});var io=require(_0x2aee('0xe'))(new Redis(config[_0x2aee('0xb')]));var cmHopper=require(_0x2aee('0xf'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x2aee('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require('./history');var Final=require(_0x2aee('0x11'));var AgentComplete=require(_0x2aee('0x12'));var QueueCallerAbandon=require(_0x2aee('0x13'));var Hangup=require('./hangup');var ipAgi=process[_0x2aee('0x14')][_0x2aee('0x15')]||_0x2aee('0x16');var strategy={'rrmemory':_0x2aee('0x17'),'roundrobin':_0x2aee('0x18')};var Sequence=function(){};Sequence[_0x2aee('0x19')][_0x2aee('0x1a')]=function(_0x27d751){this[_0x2aee('0x1b')]=this['tail']?this[_0x2aee('0x1b')][_0x2aee('0x1c')](_0x27d751):_0x27d751();};function Dialer(_0x5dd1a0,_0x3efb33){this[_0x2aee('0x1d')]=new Sequence();this['preview']=_0x3efb33;this[_0x2aee('0x1e')]=_0x5dd1a0['voiceQueues'];this[_0x2aee('0x1f')]=_0x5dd1a0[_0x2aee('0x1f')];this[_0x2aee('0x20')]=_0x5dd1a0[_0x2aee('0x20')];this['trunks']=_0x5dd1a0[_0x2aee('0x21')];this['maxNumberOriginate']=config[_0x2aee('0x22')]||0x2;this[_0x2aee('0x23')]={};this['actions']={};this[_0x2aee('0x24')]={};this['uniqueId']={};this[_0x2aee('0x25')]={};this['startPredictive']={};this[_0x2aee('0x26')]={};this[_0x2aee('0x27')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0x2aee('0x28'),this[_0x2aee('0x29')]['bind'](this));ami['on'](_0x2aee('0x2a'),this[_0x2aee('0x2b')]['bind'](this));ami['on'](_0x2aee('0x2c'),this[_0x2aee('0x2d')][_0x2aee('0x2e')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x2aee('0x2e')](this));ami['on'](_0x2aee('0x2f'),this['syncQueueSummary'][_0x2aee('0x2e')](this));ami['on']('hangup',this[_0x2aee('0x30')][_0x2aee('0x2e')](this));ami['on']('newexten',this[_0x2aee('0x31')][_0x2aee('0x2e')](this));ami['on'](_0x2aee('0x32'),this[_0x2aee('0x33')][_0x2aee('0x2e')](this));ami['on'](_0x2aee('0x34'),this[_0x2aee('0x35')][_0x2aee('0x2e')](this));ami['on'](_0x2aee('0x36'),this['syncQueueStatusComplete'][_0x2aee('0x2e')](this));this[_0x2aee('0x37')]();this['loopClearZombieChannels']();}function isNotNull(_0x5ce4cd){return _0x5ce4cd!==null&&!_[_0x2aee('0x38')](_0x5ce4cd);}function checkIsLoggedIn(_0x5d36a9,_0x22c9b0){return function(){if(_0x22c9b0<=0x0){_0x5d36a9[_0x2aee('0x39')]=_0x2aee('0x3a');throw _0x5d36a9[_0x2aee('0x3b')]+_0x2aee('0x3c');}};}function isActive(_0x3eeb57){return _0x3eeb57;}function checkIsActive(_0x70cf51,_0x457621){return function(){if(!isActive(_0x457621)){_0x70cf51[_0x2aee('0x39')]=_0x2aee('0x3d');throw _0x70cf51['name']+_0x2aee('0x3e');}};}function checkInterval(_0x3a12b7){return function(){if(!isNotNull(_0x3a12b7[_0x2aee('0x3f')])){_0x3a12b7[_0x2aee('0x39')]=_0x2aee('0x40');throw _0x3a12b7['name']+_0x2aee('0x41');}if(!isNotNull(_0x3a12b7[_0x2aee('0x3f')]['Intervals'])){_0x3a12b7[_0x2aee('0x39')]=_0x2aee('0x40');throw _0x3a12b7[_0x2aee('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x2aee('0x42')](_0x3a12b7['Interval']['Intervals']))){_0x3a12b7[_0x2aee('0x39')]=_0x2aee('0x40');throw _0x3a12b7[_0x2aee('0x3b')]+_0x2aee('0x41');}};}function msgResponse(_0x33407f,_0x2e13fb,_0x8791c2){return{'action':_0x33407f,'response':_0x2e13fb,'message':_0x8791c2,'stack':_0x8791c2};}function myreject(_0x51a206){return function(_0x567427){return _0x51a206(msgResponse(_0x2aee('0x43'),'Error',JSON[_0x2aee('0x44')](_0x567427)));};}function getSeconds(_0x40a354,_0x27ddd7){var _0x3b65a0=moment(_0x40a354)[_0x2aee('0x45')](0x0);var _0x25c41e=moment(_0x27ddd7)[_0x2aee('0x45')](0x0);return _0x3b65a0[_0x2aee('0x46')](_0x25c41e,_0x2aee('0x47'));}function emit(_0x5c8041,_0x54ac9a,_0x3536ee){io['to'](_0x5c8041)[_0x2aee('0x48')](_0x54ac9a,_0x3536ee);}function emitVoiceQueueSummary(_0x10b1fd){if(_0x10b1fd[_0x2aee('0x49')]==='outbound'){var _0xa00ef0={'id':_0x10b1fd['id'],'name':_0x10b1fd[_0x2aee('0x3b')],'strategy':_0x10b1fd[_0x2aee('0x4a')],'answered':_0x10b1fd[_0x2aee('0x4b')],'available':_0x10b1fd['available'],'loggedIn':_0x10b1fd['loggedIn'],'pTalking':_0x10b1fd['pTalking'],'sumBillable':_0x10b1fd[_0x2aee('0x4c')],'sumDuration':_0x10b1fd[_0x2aee('0x4d')],'sumHoldTime':_0x10b1fd[_0x2aee('0x4e')]||0x0,'talking':_0x10b1fd[_0x2aee('0x4f')],'total':_0x10b1fd[_0x2aee('0x50')],'type':_0x10b1fd[_0x2aee('0x49')],'unmanaged':_0x10b1fd['unmanaged'],'abandoned':_0x10b1fd[_0x2aee('0x51')],'waiting':_0x10b1fd['waiting'],'loggedInDb':_0x10b1fd[_0x2aee('0x52')],'dialActive':_0x10b1fd[_0x2aee('0x53')],'dialMethod':_0x10b1fd[_0x2aee('0x54')],'dialOriginateCallerIdName':_0x10b1fd[_0x2aee('0x55')],'dialOriginateCallerIdNumber':_0x10b1fd[_0x2aee('0x56')],'dialOriginateTimeout':_0x10b1fd['dialOriginateTimeout'],'dialPrefix':_0x10b1fd[_0x2aee('0x57')],'outboundAnswerAgiCallsDay':_0x10b1fd[_0x2aee('0x58')],'outboundAnswerCallsDay':_0x10b1fd[_0x2aee('0x59')],'outboundBlacklistCallsDay':_0x10b1fd[_0x2aee('0x5a')],'outboundBusyCallsDay':_0x10b1fd['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x10b1fd['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x10b1fd[_0x2aee('0x5b')],'outboundDropCallsDayCallersExit':_0x10b1fd[_0x2aee('0x5c')],'outboundDropCallsDayTimeout':_0x10b1fd[_0x2aee('0x5d')],'outboundNoAnswerCallsDay':_0x10b1fd[_0x2aee('0x5e')],'outboundNoSuchCallsDay':_0x10b1fd['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x10b1fd[_0x2aee('0x5f')],'outboundReCallsDay':_0x10b1fd[_0x2aee('0x60')],'outboundRejectCallsDay':_0x10b1fd[_0x2aee('0x61')],'outboundUnknownCallsDay':_0x10b1fd[_0x2aee('0x62')],'predictiveIntervalAnsweredCalls':_0x10b1fd['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x10b1fd[_0x2aee('0x63')],'predictiveIntervalAvgTalktime':_0x10b1fd[_0x2aee('0x64')],'predictiveIntervalDroppedCallsCallersExit':_0x10b1fd['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x10b1fd[_0x2aee('0x65')],'predictiveIntervalErlangCalls':_0x10b1fd[_0x2aee('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x10b1fd[_0x2aee('0x67')],'predictiveIntervalHitRate':_0x10b1fd['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x10b1fd[_0x2aee('0x68')],'predictiveIntervalPauses':_0x10b1fd[_0x2aee('0x69')],'predictiveIntervalAvailable':_0x10b1fd[_0x2aee('0x6a')],'predictiveIntervalTotalCalls':_0x10b1fd[_0x2aee('0x6b')],'message':_0x10b1fd['message'],'originated':_0x10b1fd['originated'],'erlangCalls':_0x10b1fd[_0x2aee('0x6c')],'erlangCallToSecond':_0x10b1fd[_0x2aee('0x6d')],'erlangAbandonmentRate':_0x10b1fd[_0x2aee('0x6e')],'erlangBusyFactor':_0x10b1fd[_0x2aee('0x6f')],'startPredictive':_0x10b1fd[_0x2aee('0x70')],'startProgressive':_0x10b1fd[_0x2aee('0x26')]};if(_0x10b1fd[_0x2aee('0x71')]){_0xa00ef0[_0x2aee('0x71')]={'id':_0x10b1fd[_0x2aee('0x71')]['id'],'name':_0x10b1fd['Trunk'][_0x2aee('0x3b')],'active':_0x10b1fd[_0x2aee('0x71')][_0x2aee('0x72')],'callerid':_0x10b1fd['Trunk'][_0x2aee('0x73')]};}if(_0x10b1fd['Interval']){_0xa00ef0[_0x2aee('0x3f')]={'id':_0x10b1fd[_0x2aee('0x3f')]['id'],'name':_0x10b1fd[_0x2aee('0x3f')][_0x2aee('0x3b')]};}var _0x132255=md5(JSON[_0x2aee('0x44')](_0xa00ef0));if(_0x10b1fd[_0x2aee('0x74')]!==_0x132255){_0x10b1fd[_0x2aee('0x74')]=_0x132255;emit(util[_0x2aee('0x75')](_0x2aee('0x76'),_0xa00ef0[_0x2aee('0x3b')]),'voice_queue:save',_0xa00ef0);}}}function emitCampaignSummary(_0x1a7c6e){if(_0x1a7c6e[_0x2aee('0x49')]===_0x2aee('0x77')){emit(util[_0x2aee('0x75')]('campaign:ivr:%s',_0x1a7c6e['name']),'campaign:save',_0x1a7c6e);}}function checkGetDataPredictive(_0x1b0ecb){if(isNotNull(_0x1b0ecb)){if(!_[_0x2aee('0x42')](_0x1b0ecb)){loggerPredictive[_0x2aee('0x78')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x2aee('0x78')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1b0ecb[_0x2aee('0x6b')]);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x79'),_0x1b0ecb[_0x2aee('0x7a')]);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x7b'),_0x1b0ecb[_0x2aee('0x65')]);loggerPredictive['info'](_0x2aee('0x7c'),_0x1b0ecb[_0x2aee('0x7d')]);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x7e'),_0x1b0ecb[_0x2aee('0x63')]);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x7f'),_0x1b0ecb[_0x2aee('0x64')]);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x80'));if(_0x1b0ecb[_0x2aee('0x6b')]>0x0){if(!_[_0x2aee('0x38')](_0x1b0ecb[_0x2aee('0x64')])&&_0x1b0ecb['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x2aee('0x78')](_0x2aee('0x81'));}if(!_[_0x2aee('0x38')](_0x1b0ecb['predictiveIntervalAvgHoldtime'])&&_0x1b0ecb[_0x2aee('0x63')]>0x0){return!![];}else{loggerPredictive[_0x2aee('0x78')](_0x2aee('0x82'));}}else{loggerPredictive['info'](_0x2aee('0x83'));}}else{loggerPredictive[_0x2aee('0x78')](_0x2aee('0x84'));}}else{loggerPredictive[_0x2aee('0x78')](_0x2aee('0x84'));}return![];}function mergeDataErlangB(_0x2c319b){return function(_0x29c845){loggerPredictive[_0x2aee('0x78')](_0x2aee('0x85'));loggerPredictive[_0x2aee('0x78')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x29c845['erlangCalls']);loggerPredictive[_0x2aee('0x78')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x29c845[_0x2aee('0x6d')]);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x86'),_0x29c845[_0x2aee('0x6e')]);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x87'),_0x29c845[_0x2aee('0x6f')]);loggerPredictive[_0x2aee('0x78')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x29c845[_0x2aee('0x6e')]);loggerPredictive[_0x2aee('0x78')]('---------------------------');_[_0x2aee('0x88')](_0x2c319b,_0x29c845);};}function getDiff(_0x2a0627){var _0x39a652=moment()[_0x2aee('0x45')](0x0);var _0x53de97=moment(_0x2a0627)[_0x2aee('0x45')](0x0);return _0x39a652[_0x2aee('0x46')](_0x53de97,_0x2aee('0x47'));}function ifInterval(_0x2880d0,_0x27b9a8){if(_['isUndefined'](_0x27b9a8)){return![];}if(getDiff(_0x27b9a8)<_0x2880d0*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x47fcec){if(isNotNull(_0x47fcec)){if(!_[_0x2aee('0x38')](_0x47fcec['startProgressive'])){_0x47fcec[_0x2aee('0x26')]=undefined;loggerPredictive[_0x2aee('0x78')](_0x47fcec[_0x2aee('0x3b')],_0x2aee('0x89'));}if(!_[_0x2aee('0x38')](_0x47fcec[_0x2aee('0x70')])){_0x47fcec[_0x2aee('0x70')]=undefined;loggerPredictive[_0x2aee('0x78')](_0x47fcec[_0x2aee('0x3b')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x2aee('0x38')](_0x47fcec[_0x2aee('0x8a')])){clearInterval(_0x47fcec[_0x2aee('0x8a')]);_0x47fcec['handlePredictive']=undefined;loggerPredictive['info'](_0x47fcec[_0x2aee('0x3b')],_0x2aee('0x8b'));}}}function erlangb(_0x2a81f7,_0x528c6a){if(_0x528c6a===0x0){return 0x0;}var _0x421a81=0x1;for(var _0x5fd2ca=0x1;_0x5fd2ca<=_0x528c6a;_0x5fd2ca+=0x1){_0x421a81=0x1+_0x421a81*_0x5fd2ca/_0x2a81f7;}return 0x1/_0x421a81;}function isVoiceQueueOutbound(_0xf6845c){return _0xf6845c==='outbound';}function isNotPreview(_0x57432f){return _0x57432f!==_0x2aee('0x8c');}function isCampaignIvr(_0x516fe8){return _0x516fe8===_0x2aee('0x77');}function getCallerId(_0x169ccd,_0x40c0d0,_0x41e21a){if(!_[_0x2aee('0x38')](_0x41e21a)&&_0x2aee('0x8d')===typeof _0x41e21a&&!_[_0x2aee('0x42')](_0x41e21a)){if(!_[_0x2aee('0x38')](_0x40c0d0)&&'string'===typeof _0x40c0d0&&!_[_0x2aee('0x42')](_0x40c0d0)){return util['format'](_0x2aee('0x8e'),_0x40c0d0,_0x41e21a);}return util[_0x2aee('0x75')](_0x2aee('0x8e'),_0x41e21a,_0x41e21a);}if(!_[_0x2aee('0x38')](_0x169ccd)&&_0x2aee('0x8d')===typeof _0x169ccd&&!_['isEmpty'](_0x169ccd)){return _0x169ccd;}return _0x2aee('0x8f');}function loggerCatchQueueSummary(_0x1cd1ed,_0x478e4a){return function(_0x4055fc){freeVariablesPredictive(_0x478e4a);emitVoiceQueueSummary(_0x478e4a);emitCampaignSummary(_0x478e4a);loggerSyncQueueSummary[_0x2aee('0x90')](_0x1cd1ed,util[_0x2aee('0x91')](_0x4055fc,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4f86ae,_0x249216){return function(_0xe1b859){loggerPredictive[_0x2aee('0x90')](_0x249216['name'],_0x4f86ae);loggerPredictive[_0x2aee('0x90')](_0xe1b859[_0x2aee('0x92')]);freeVariablesPredictive(_0x249216);};}function loggerCatch(_0x4f5191){return function(_0x164e2d){logger[_0x2aee('0x90')](_0x4f5191,util[_0x2aee('0x91')](_0x164e2d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x29fbc2){return _0x29fbc2&&!_[_0x2aee('0x38')](_0x29fbc2)&&_0x29fbc2[_0x2aee('0x93')]>0x0;}function decremetOriginate(_0x4fbc29){if(!_[_0x2aee('0x38')](_0x4fbc29)&&_0x4fbc29!==null){if(_0x4fbc29[_0x2aee('0x94')](_0x2aee('0x95'))){if(_0x4fbc29[_0x2aee('0x95')]>0x0){_0x4fbc29['originated']-=0x1;}else{logger[_0x2aee('0x90')](_0x2aee('0x96'));}}}else{logger[_0x2aee('0x90')](_0x2aee('0x97'));}}function checkContactLowerLimitOriginate(_0x5707be,_0x5173d8,_0x44e5df){if(_0x5173d8>_0x44e5df){for(var _0x537897=0x0;_0x537897<_0x5173d8-_0x44e5df;_0x537897+=0x1){decremetOriginate(_0x5707be);}}}function loggerGetContactDialer(_0x136a8b,_0x2da799,_0x290cbb){return function(_0x4133ed){checkContactLowerLimitOriginate(_0x2da799,_0x290cbb,0x0);logger[_0x2aee('0x90')](_0x136a8b,util[_0x2aee('0x91')](_0x4133ed,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x33535f){return function(_0x35fccf){if(isNotNull(_0x35fccf)&&isNotNull(_0x35fccf[0x0])){if(_0x35fccf[0x0][_0x2aee('0x98')]>0x0){_0x33535f[_0x2aee('0x39')]=_0x2aee('0x99');logger[_0x2aee('0x78')](_0x2aee('0x9a')+_0x33535f[_0x2aee('0x3b')],_0x35fccf[0x0]['contactsRescheduled'],'contacts');}else{_0x33535f[_0x2aee('0x39')]=_0x2aee('0x9b');logger[_0x2aee('0x78')](_0x2aee('0x9c')+_0x33535f[_0x2aee('0x3b')]);}}};}function notSendMessagesQueue(_0x5baf62){if(_0x5baf62[_0x2aee('0x9d')]){freeVariablesPredictive(_0x5baf62);if(_0x5baf62[_0x2aee('0x95')]===0x0&&_0x5baf62[_0x2aee('0x4f')]===0x0&&_0x5baf62['waiting']===0x0&&(_0x5baf62[_0x2aee('0x9e')]||0x0)===0x0){_0x5baf62[_0x2aee('0x9d')]=![];_0x5baf62[_0x2aee('0x9f')]=0x0;_0x5baf62[_0x2aee('0x39')]=_0x2aee('0x3d');loggerSyncQueueSummary['error'](_0x2aee('0xa0'),_0x5baf62[_0x2aee('0x3b')],'is\x20not\x20active');}else{_0x5baf62['message']='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0x2aee('0xa0'),_0x5baf62['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x5baf62);}}function notSendMessagesCampaign(_0x385524){if(_0x385524['sendMessageOneNotActive']){if(_0x385524['originated']===0x0){_0x385524['sendMessageOneNotActive']=![];_0x385524[_0x2aee('0x39')]=_0x2aee('0x3d');loggerSyncQueueSummary[_0x2aee('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x385524['name'],_0x2aee('0xa1'));}else{_0x385524[_0x2aee('0x39')]=_0x2aee('0xa2');loggerSyncQueueSummary[_0x2aee('0x90')](_0x2aee('0xa3'),_0x385524[_0x2aee('0x3b')],'is\x20disactive');}emitCampaignSummary(_0x385524);}}function createObjHistory(_0x218a8b,_0x47713d,_0x2c537c,_0x489ef4,_0x1109c4){_0x218a8b[_0x2aee('0x39')]=_0x2c537c;var _0x11baab=new Action(_0x218a8b,_0x47713d);var _0x397a98=new History(_0x11baab);_0x397a98['state']=_0x489ef4;_0x397a98[_0x2aee('0xa4')]=_0x1109c4;_0x397a98['endtime']=_0x11baab[_0x2aee('0xa5')];return _0x397a98;}Dialer[_0x2aee('0x19')][_0x2aee('0xa6')]=function(){var _0x14590f=this;setInterval(function(){_0x14590f['clearZombieChannels'](_0x14590f[_0x2aee('0xa7')],_0x2aee('0xa8'));_0x14590f[_0x2aee('0xa9')](_0x14590f[_0x2aee('0xaa')],_0x2aee('0xab'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x129cc4,_0x415a5b){var _0x1ebfb6=this;for(var _0x38f243 in _0x129cc4){if(_0x129cc4[_0x2aee('0x94')](_0x38f243)){this[_0x2aee('0x1d')][_0x2aee('0x1a')](function(){if(!_[_0x2aee('0xac')](_0x129cc4[_0x38f243])){return ami['Action']({'action':_0x2aee('0xad'),'channel':_0x129cc4[_0x38f243][_0x2aee('0xae')]})[_0x2aee('0xaf')](function(_0x17be93){if(_0x17be93[_0x2aee('0x39')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x129cc4[_0x38f243]&&_0x129cc4[_0x38f243][_0x2aee('0x49')]!==_0x2aee('0x77')){_0x1ebfb6[_0x2aee('0xb0')](_0x1ebfb6[_0x2aee('0x1e')][_0x129cc4[_0x38f243][_0x2aee('0xb1')]]);logger['error'](_0x2aee('0xb2'),_0x415a5b,_0x38f243,_0x129cc4[_0x38f243][_0x2aee('0xb1')]);delete _0x129cc4[_0x38f243];}if(_0x129cc4[_0x38f243]&&_0x129cc4[_0x38f243][_0x2aee('0x49')]==='ivr'){_0x1ebfb6[_0x2aee('0xb0')](_0x1ebfb6[_0x2aee('0x1f')][_0x129cc4[_0x38f243][_0x2aee('0xb1')]]);logger[_0x2aee('0x90')](_0x2aee('0xb3'),_0x415a5b,_0x38f243,_0x129cc4[_0x38f243]['queue']);delete _0x129cc4[_0x38f243];}},0x2328);}});}});}}};Dialer[_0x2aee('0x19')][_0x2aee('0xb4')]=function(_0x538b7d){return BPromise[_0x2aee('0xb5')]()[_0x2aee('0xb6')](cmHopper['countReScheduled'](_0x538b7d))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xb7')));};Dialer[_0x2aee('0x19')]['checkIsBlackList']=function(_0x2f447c){return BPromise[_0x2aee('0xb5')]()[_0x2aee('0xb6')](cmHopperBlack[_0x2aee('0xb8')](_0x2f447c))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xb9')));};Dialer[_0x2aee('0x19')]['checkIsBlackListIvr']=function(_0x5c7eaa){return BPromise[_0x2aee('0xb5')]()[_0x2aee('0xb6')](cmHopperBlack[_0x2aee('0xba')](_0x5c7eaa))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xbb')));};Dialer[_0x2aee('0x19')]['averageHandleTime']=function(_0x563080){return BPromise['resolve']()[_0x2aee('0xb6')](cmHopperHistory[_0x2aee('0xbc')](_0x563080))[_0x2aee('0xaf')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x2aee('0x19')][_0x2aee('0xbd')]=function(_0x52b402){return BPromise[_0x2aee('0xb5')]()['then'](cmHopper[_0x2aee('0xbd')](_0x52b402))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xbe')));};Dialer[_0x2aee('0x19')][_0x2aee('0xbf')]=function(_0x31a586,_0x6b4425,_0x4e2e31){return BPromise[_0x2aee('0xb5')]()[_0x2aee('0xb6')](cmHopper['unlockContact'](_0x31a586,_0x6b4425,_0x4e2e31))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xc0')));};Dialer[_0x2aee('0x19')][_0x2aee('0xc1')]=function(_0x51316a,_0x263e88,_0x3d08cf,_0xfb9280){return BPromise['resolve']()[_0x2aee('0xb6')](cmHopper['getContactDialer'](_0x51316a,_0x263e88,_0x3d08cf,_0xfb9280))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xc2')));};Dialer[_0x2aee('0x19')][_0x2aee('0xc3')]=function(_0x12c82f,_0x55f09b,_0x94c8b0){return BPromise[_0x2aee('0xb5')]()[_0x2aee('0xb6')](cmHopper[_0x2aee('0xc3')](_0x12c82f,_0x55f09b,_0x94c8b0))[_0x2aee('0xaf')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x2aee('0x19')][_0x2aee('0xc4')]=function(_0x7710a3){return BPromise['resolve']()[_0x2aee('0xb6')](voiceQueueRt[_0x2aee('0xc4')](_0x7710a3))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xc5')));};Dialer[_0x2aee('0x19')][_0x2aee('0xc6')]=function(_0xe4232f){return BPromise[_0x2aee('0xb5')]()[_0x2aee('0xb6')](cmHopper[_0x2aee('0xc6')](_0xe4232f))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xc7')));};Dialer[_0x2aee('0x19')]['createHistory']=function(_0x272469){return BPromise[_0x2aee('0xb5')]()[_0x2aee('0xb6')](cmHopperHistory[_0x2aee('0xc8')](_0x272469))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xc9')));};Dialer[_0x2aee('0x19')]['updateOriginated']=function(_0x550f7a){if(!_[_0x2aee('0x38')](_0x550f7a)&&_0x550f7a!==null){if(_0x550f7a['hasOwnProperty']('originated')){if(_0x550f7a[_0x2aee('0x95')]>0x0){_0x550f7a[_0x2aee('0x95')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x2aee('0x90')](_0x2aee('0xca'));}};Dialer[_0x2aee('0x19')][_0x2aee('0xcb')]=function(_0x188bf2,_0x5203b6){var _0x54f64e=this;return function(_0x3b178b){_0x54f64e[_0x2aee('0xb0')](_0x5203b6);logger[_0x2aee('0x90')](_0x188bf2,util[_0x2aee('0x91')](_0x3b178b,{'showHidden':![],'depth':null}));};};Dialer[_0x2aee('0x19')][_0x2aee('0xcc')]=function(_0x144a3f,_0x147909,_0x410a43){var _0x5f3448={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x147909);this[_0x2aee('0xcd')](_[_0x2aee('0x88')](_0x5f3448,_[_0x2aee('0xce')](_0x410a43,['ContactId',_0x2aee('0xcf'),_0x2aee('0xd0'),_0x2aee('0xd1'),'CampaignId'])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x2aee('0x90')](_0x144a3f);};Dialer['prototype'][_0x2aee('0xd2')]=function(_0x17c0d7){return _0x17c0d7===_0x2aee('0xd3');};Dialer['prototype'][_0x2aee('0xd4')]=function(_0x403525){return!_[_0x2aee('0x38')](_0x403525)&&_0x403525&&!_['isUndefined'](_0x403525[_0x2aee('0x3b')])&&!_[_0x2aee('0x38')](_0x403525[_0x2aee('0x72')])&&_0x403525[_0x2aee('0x72')]&&(this[_0x2aee('0x21')][util[_0x2aee('0x75')]('SIP/%s',_0x403525[_0x2aee('0x3b')])][_0x2aee('0xad')]==='reachable'||this[_0x2aee('0x21')][util[_0x2aee('0x75')](_0x2aee('0xd5'),_0x403525[_0x2aee('0x3b')])]['status']===_0x2aee('0xd6'));};Dialer['prototype'][_0x2aee('0xcd')]=function(_0xe40fab,_0x3cb2e3,_0x55bd12){this[_0x2aee('0xc8')](_0xe40fab)['catch'](loggerCatch(_0x3cb2e3));this['moveContactManagedDialer'](_0xe40fab)[_0x2aee('0xaf')](loggerCatch(_0x55bd12));};Dialer['prototype'][_0x2aee('0x33')]=function(_0x55bb74){var _0x46f927=this[_0x2aee('0xa7')][_0x55bb74[_0x2aee('0xd7')]];var _0x197fb3;if(!_[_0x2aee('0xac')](_0x55bb74)&&!_[_0x2aee('0xac')](_0x55bb74[_0x2aee('0xd8')])&&!_[_0x2aee('0xac')](_0x55bb74[_0x2aee('0xd8')][_0x2aee('0xd9')])&&_0x55bb74['exten']===_0x2aee('0xda')&&_0x46f927){if(_0x46f927[_0x2aee('0x49')]!==_0x2aee('0x77')&&this[_0x2aee('0x1e')][_0x46f927[_0x2aee('0xb1')]][_0x2aee('0xdb')]&&_0x55bb74['value']===_0x2aee('0xdc')){delete this[_0x2aee('0xa7')][_0x55bb74['uniqueid']];this[_0x2aee('0xb0')](this[_0x2aee('0x1e')][_0x46f927[_0x2aee('0xb1')]]);this[_0x2aee('0x1e')][_0x46f927[_0x2aee('0xb1')]]['outboundAnswerCallsDay']+=0x1;this[_0x2aee('0x1e')][_0x46f927['queue']][_0x2aee('0x58')]+=0x1;_0x197fb3=new Hangup(_0x46f927,_0x55bb74);_0x197fb3[_0x2aee('0xdd')]=0x12;_0x197fb3[_0x2aee('0xa4')]=_0x2aee('0xde');_0x197fb3['membername']=_0x2aee('0xdf');this[_0x2aee('0xcd')](_0x197fb3,_0x2aee('0xe0'),_0x2aee('0xe1'));}if(_0x46f927[_0x2aee('0x49')]!==_0x2aee('0x77')&&this[_0x2aee('0x1e')][_0x46f927[_0x2aee('0xb1')]][_0x2aee('0xdb')]&&_0x55bb74[_0x2aee('0xe2')]==='MACHINE'){delete this[_0x2aee('0xa7')][_0x55bb74[_0x2aee('0xd7')]];this[_0x2aee('0xb0')](this[_0x2aee('0x1e')][_0x46f927[_0x2aee('0xb1')]]);this[_0x2aee('0x1e')][_0x46f927[_0x2aee('0xb1')]]['outboundAnswerCallsDay']+=0x1;this[_0x2aee('0x1e')][_0x46f927[_0x2aee('0xb1')]][_0x2aee('0x58')]+=0x1;_0x197fb3=new Hangup(_0x46f927,_0x55bb74);_0x197fb3[_0x2aee('0xdd')]=0x13;_0x197fb3['statedesc']='Machine';_0x197fb3[_0x2aee('0xe3')]=_0x2aee('0xdf');_0x197fb3[_0x2aee('0xe4')]=!![];this['saveInDb'](_0x197fb3,_0x2aee('0xe5'),_0x2aee('0xe6'));}if(_0x46f927['type']==='ivr'&&this[_0x2aee('0x1f')][_0x46f927[_0x2aee('0xb1')]][_0x2aee('0xdb')]&&_0x55bb74[_0x2aee('0xe2')]===_0x2aee('0xdc')){delete this['uniqueId'][_0x55bb74[_0x2aee('0xd7')]];this[_0x2aee('0xb0')](this['campaigns'][_0x46f927[_0x2aee('0xb1')]]);_0x197fb3=new Hangup(_0x46f927,_0x55bb74);_0x197fb3[_0x2aee('0xdd')]=0x12;_0x197fb3[_0x2aee('0xa4')]=_0x2aee('0xde');_0x197fb3[_0x2aee('0xe3')]=_0x2aee('0xdf');this['saveInDb'](_0x197fb3,_0x2aee('0xe7'),_0x2aee('0xe8'));}if(_0x46f927[_0x2aee('0x49')]==='ivr'&&this[_0x2aee('0x1f')][_0x46f927[_0x2aee('0xb1')]]['dialAMDActive']&&_0x55bb74[_0x2aee('0xe2')]==='MACHINE'){delete this[_0x2aee('0xa7')][_0x55bb74[_0x2aee('0xd7')]];this['updateOriginated'](this['campaigns'][_0x46f927['queue']]);_0x197fb3=new Hangup(_0x46f927,_0x55bb74);_0x197fb3[_0x2aee('0xdd')]=0x13;_0x197fb3[_0x2aee('0xa4')]='Machine';_0x197fb3['membername']=_0x2aee('0xdf');_0x197fb3[_0x2aee('0xe4')]=!![];this[_0x2aee('0xcd')](_0x197fb3,_0x2aee('0xe9'),_0x2aee('0xea'));}}};Dialer['prototype']['syncHangup']=function(_0x58fa66){var _0x44a302=this['uniqueId'][_0x58fa66[_0x2aee('0xd7')]];var _0x270f5d=this;var _0x3c19e7;if(_0x44a302&&_0x44a302[_0x2aee('0x49')]==='ivr'){delete this['uniqueId'][_0x58fa66['uniqueid']];this['updateOriginated'](this[_0x2aee('0x1f')][_0x44a302[_0x2aee('0xb1')]]);this[_0x2aee('0x1f')][_0x44a302[_0x2aee('0xb1')]][_0x2aee('0xeb')]+=0x1;_0x3c19e7=new Hangup(_0x44a302,_0x58fa66);this['createHistory'](_0x3c19e7)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xec')));this[_0x2aee('0xc6')](_0x3c19e7)['catch'](loggerCatch(_0x2aee('0xed')));}if(_0x44a302&&_0x44a302[_0x2aee('0x49')]!==_0x2aee('0x77')&&isNotNull(this['voiceQueues'][_0x44a302[_0x2aee('0xb1')]][_0x2aee('0xee')])){delete this[_0x2aee('0xa7')][_0x58fa66[_0x2aee('0xd7')]];this['updateOriginated'](this[_0x2aee('0x1e')][_0x44a302[_0x2aee('0xb1')]]);this[_0x2aee('0x1e')][_0x44a302[_0x2aee('0xb1')]][_0x2aee('0x59')]+=0x1;this[_0x2aee('0x1e')][_0x44a302[_0x2aee('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3c19e7=new Hangup(_0x44a302,_0x58fa66);_0x3c19e7[_0x2aee('0xdd')]=0x10;_0x3c19e7[_0x2aee('0xa4')]=_0x2aee('0xef');_0x3c19e7['membername']=_0x2aee('0xf0');this['createHistory'](_0x3c19e7)[_0x2aee('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x3c19e7)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xed')));}if(_0x44a302&&_0x44a302[_0x2aee('0x49')]!=='ivr'&&!isNotNull(this[_0x2aee('0x1e')][_0x44a302['queue']]['dialQueueProject'])){delete this[_0x2aee('0xa7')][_0x58fa66[_0x2aee('0xd7')]];this[_0x2aee('0xb0')](this[_0x2aee('0x1e')][_0x44a302[_0x2aee('0xb1')]]);this[_0x2aee('0x1e')][_0x44a302['queue']]['outboundUnknownCallsDay']+=0x1;_0x3c19e7=new Hangup(_0x44a302,_0x58fa66);_0x3c19e7[_0x2aee('0xdd')]=0xc;_0x3c19e7['statedesc']=_0x58fa66[_0x2aee('0xf1')];_0x3c19e7[_0x2aee('0xe3')]=_0x2aee('0xf2');this[_0x2aee('0xc8')](_0x3c19e7)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xec')));this[_0x2aee('0xc6')](_0x3c19e7)['catch'](loggerCatch(_0x2aee('0xed')));}};Dialer['prototype'][_0x2aee('0xf3')]=function(_0x2fb9dd){var _0x5057b5=this[_0x2aee('0xa7')][_0x2fb9dd[_0x2aee('0xd7')]];var _0x2a6af4=this;if(this['voiceQueues'][_0x2fb9dd[_0x2aee('0xb1')]]){if(_0x5057b5&&_0x5057b5[_0x2aee('0x49')]!=='ivr'){delete this[_0x2aee('0xa7')][_0x2fb9dd['uniqueid']];this['voiceQueues'][_0x2fb9dd[_0x2aee('0xb1')]][_0x2aee('0x59')]+=0x1;var _0x43e814=new AgentComplete(_0x5057b5,_0x2fb9dd);if(_0x2fb9dd[_0x2aee('0xf4')]===_0x2aee('0xf5')){_0x43e814[_0x2aee('0xf6')]=this[_0x2aee('0x1e')][_0x2fb9dd[_0x2aee('0xb1')]][_0x2aee('0xf7')]&&this[_0x2aee('0x1e')][_0x2fb9dd[_0x2aee('0xb1')]][_0x2aee('0xf8')]?moment()[_0x2aee('0x75')](_0x2aee('0xf9')):undefined;}this[_0x2aee('0xc8')](_0x43e814)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xfa')));this[_0x2aee('0xc6')](_0x43e814)['catch'](loggerCatch(_0x2aee('0xfb')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x46c8e8){if(this[_0x2aee('0x1e')][_0x46c8e8[_0x2aee('0xb1')]]){if(this[_0x2aee('0xa7')][_0x46c8e8['uniqueid']]&&this['uniqueId'][_0x46c8e8[_0x2aee('0xd7')]][_0x2aee('0x49')]!==_0x2aee('0x77')){this[_0x2aee('0xb0')](this[_0x2aee('0x1e')][_0x46c8e8[_0x2aee('0xb1')]]);this[_0x2aee('0xa7')][_0x46c8e8[_0x2aee('0xd7')]][_0x2aee('0xfc')]=moment()['format'](_0x2aee('0xf9'));}}};Dialer['prototype'][_0x2aee('0xfd')]=function(_0x48c9ab){this[_0x2aee('0xc8')](_0x48c9ab)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xfa')));this[_0x2aee('0xc6')](_0x48c9ab)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xfe')));};Dialer[_0x2aee('0x19')][_0x2aee('0x2b')]=function(_0x50d88d){var _0x51e358=this[_0x2aee('0xa7')][_0x50d88d[_0x2aee('0xd7')]];var _0x5e3b8b=this;if(this['voiceQueues'][_0x50d88d[_0x2aee('0xb1')]]){if(_0x51e358&&_0x51e358['type']!==_0x2aee('0x77')){delete this[_0x2aee('0xa7')][_0x50d88d['uniqueid']];this[_0x2aee('0xb0')](this['voiceQueues'][_0x50d88d[_0x2aee('0xb1')]]);_0x51e358[_0x2aee('0xff')]=moment()[_0x2aee('0x75')](_0x2aee('0xf9'));var _0x1e6050=new QueueCallerAbandon(_0x51e358,_0x50d88d);if(getSeconds(_0x51e358['droptime'],_0x51e358[_0x2aee('0x100')])>=_0x51e358['dialQueueTimeout']){this[_0x2aee('0x1e')][_0x50d88d['queue']][_0x2aee('0x65')]+=0x1;this['voiceQueues'][_0x50d88d[_0x2aee('0xb1')]][_0x2aee('0x5d')]+=0x1;this[_0x2aee('0x1e')][_0x50d88d[_0x2aee('0xb1')]][_0x2aee('0x67')]+=0x1;_0x1e6050['state']=0xa;_0x1e6050[_0x2aee('0xa4')]=_0x2aee('0x101');_0x1e6050[_0x2aee('0x102')]=_0x2aee('0x103');_0x1e6050['agiafterat']=this[_0x2aee('0x1e')][_0x50d88d[_0x2aee('0xb1')]]['dialQueueProject2']?moment()[_0x2aee('0x75')](_0x2aee('0xf9')):undefined;if(_0x1e6050['countdropretry']>=this[_0x2aee('0x1e')][_0x50d88d[_0x2aee('0xb1')]][_0x2aee('0x104')]-0x1){this[_0x2aee('0xfd')](_0x1e6050);}else{this[_0x2aee('0xbd')]({'active':![],'countdropretry':_0x1e6050[_0x2aee('0x105')]+=0x1,'scheduledat':moment()[_0x2aee('0x106')](this[_0x2aee('0x1e')][_0x50d88d['queue']][_0x2aee('0x107')],_0x2aee('0x108'))[_0x2aee('0x75')](_0x2aee('0xf9')),'ContactId':_0x51e358[_0x2aee('0x109')],'ListId':_0x51e358[_0x2aee('0xcf')],'VoiceQueueId':_0x51e358[_0x2aee('0xd1')]||undefined,'CampaignId':_0x51e358[_0x2aee('0x10a')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));}}else{this[_0x2aee('0x1e')][_0x50d88d[_0x2aee('0xb1')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x50d88d[_0x2aee('0xb1')]][_0x2aee('0x5c')]+=0x1;_0x1e6050[_0x2aee('0xdd')]=0xb;_0x1e6050[_0x2aee('0xa4')]=_0x2aee('0x10b');_0x1e6050[_0x2aee('0x102')]=_0x2aee('0x10c');if(_0x1e6050[_0x2aee('0x10d')]>=this[_0x2aee('0x1e')][_0x50d88d[_0x2aee('0xb1')]]['dialAbandonedMaxRetry']-0x1){this[_0x2aee('0xfd')](_0x1e6050);}else{this[_0x2aee('0xbd')]({'active':![],'countabandonedretry':_0x1e6050['countabandonedretry']+=0x1,'scheduledat':moment()[_0x2aee('0x106')](this['voiceQueues'][_0x50d88d['queue']][_0x2aee('0x10e')],_0x2aee('0x108'))[_0x2aee('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51e358[_0x2aee('0x109')],'ListId':_0x51e358[_0x2aee('0xcf')],'VoiceQueueId':_0x51e358[_0x2aee('0xd1')]||undefined,'CampaignId':_0x51e358[_0x2aee('0x10a')]||undefined})[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x10f')));}}}}};Dialer[_0x2aee('0x19')][_0x2aee('0x31')]=function(_0x278994){if(this[_0x2aee('0xaa')][_0x278994[_0x2aee('0xd7')]]){this[_0x2aee('0xaa')][_0x278994[_0x2aee('0xd7')]][_0x2aee('0xae')]=_0x278994[_0x2aee('0xae')];}if(this[_0x2aee('0xa7')][_0x278994[_0x2aee('0xd7')]]){this['uniqueId'][_0x278994[_0x2aee('0xd7')]][_0x2aee('0xae')]=_0x278994[_0x2aee('0xae')];}};Dialer['prototype'][_0x2aee('0x35')]=function(_0x5c2425){if(strategy[this[_0x2aee('0x1e')][this['actions'][_0x5c2425[_0x2aee('0x110')]][_0x2aee('0xb1')]][_0x2aee('0x4a')]]===_0x2aee('0x18')){if(this[_0x2aee('0xaa')][_0x5c2425[_0x2aee('0x110')]]&&_['isNil'](this[_0x2aee('0xaa')][_0x5c2425[_0x2aee('0x110')]][_0x2aee('0x111')])&&_0x5c2425[_0x2aee('0xad')]==='1'&&_0x5c2425[_0x2aee('0x112')]==='0'){if(this[_0x2aee('0x20')][_0x5c2425[_0x2aee('0x113')]]){if(!this[_0x2aee('0x20')][_0x5c2425[_0x2aee('0x113')]]['locked']){this[_0x2aee('0x20')][_0x5c2425[_0x2aee('0x113')]][_0x2aee('0x111')]=!![];this[_0x2aee('0xaa')][_0x5c2425[_0x2aee('0x110')]][_0x2aee('0x111')]=!![];this[_0x2aee('0xaa')][_0x5c2425[_0x2aee('0x110')]][_0x2aee('0x113')]=_0x5c2425[_0x2aee('0x113')];}}}}else if((strategy[this['voiceQueues'][this[_0x2aee('0xaa')][_0x5c2425[_0x2aee('0x110')]][_0x2aee('0xb1')]][_0x2aee('0x4a')]]||_0x2aee('0x17'))===_0x2aee('0x17')){if(this[_0x2aee('0xaa')][_0x5c2425[_0x2aee('0x110')]]){if(this[_0x2aee('0x20')][_0x5c2425['stateinterface']]){this['actions'][_0x5c2425[_0x2aee('0x110')]][_0x2aee('0x113')]=_0x5c2425[_0x2aee('0x113')];if(_[_0x2aee('0xac')](this[_0x2aee('0x114')][this[_0x2aee('0xaa')][_0x5c2425['actionid']]['queue']])){this[_0x2aee('0x114')][this[_0x2aee('0xaa')][_0x5c2425[_0x2aee('0x110')]][_0x2aee('0xb1')]]=[];}this['queueBooked'][this['actions'][_0x5c2425[_0x2aee('0x110')]][_0x2aee('0xb1')]]['push'](_[_0x2aee('0x88')](_[_0x2aee('0xce')](this[_0x2aee('0xaa')][_0x5c2425['actionid']],[_0x2aee('0x115'),_0x2aee('0x113')]),{'status':_0x5c2425['status'],'paused':_0x5c2425[_0x2aee('0x112')]}));}}}};function unlockQueueStatus(_0x1defd8,_0x1462b6){setTimeout(function(){if(_[_0x2aee('0x38')](_0x1defd8[_0x2aee('0x116')])){loggerBooked[_0x2aee('0x90')](_0x2aee('0x117'),_0x1462b6);}_0x1defd8[_0x2aee('0x116')]=!![];loggerBooked[_0x2aee('0x78')](_0x2aee('0x118'),_0x1462b6,JSON[_0x2aee('0x44')](_['pick'](_0x1defd8,[_0x2aee('0x3b'),_0x2aee('0x116')])));},0x1f3);}Dialer[_0x2aee('0x19')][_0x2aee('0x119')]=function(_0x236021){var _0xf42f31=this;var _0x4d442f=_0xf42f31[_0x2aee('0x1e')][_0xf42f31[_0x2aee('0xaa')][_0x236021['actionid']]['queue']];if(strategy[this[_0x2aee('0x1e')][this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]]['queue']][_0x2aee('0x4a')]]===_0x2aee('0x18')){if(this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]]&&this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]][_0x2aee('0x113')]){this[_0x2aee('0x8c')]['run'](this[_0x2aee('0xaa')][_0x236021['actionid']]['idHopper'],this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]]['stateinterface'])['catch'](function(_0x1d9914){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x2aee('0x91')](_0x1d9914,{'showHidden':![],'depth':null}));})[_0x2aee('0x1c')](function(){_0xf42f31[_0x2aee('0xb0')](_0xf42f31[_0x2aee('0x1e')][_0xf42f31[_0x2aee('0xaa')][_0x236021['actionid']]['queue']]);_0xf42f31[_0x2aee('0x20')][_0xf42f31['actions'][_0x236021[_0x2aee('0x110')]][_0x2aee('0x113')]][_0x2aee('0x111')]=![];delete _0xf42f31[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]];unlockQueueStatus(_0x4d442f);});}else{this[_0x2aee('0xb0')](this[_0x2aee('0x1e')][this[_0x2aee('0xaa')][_0x236021['actionid']][_0x2aee('0xb1')]]);this[_0x2aee('0xbd')]({'active':![],'ContactId':this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]]['ContactId'],'ListId':this['actions'][_0x236021[_0x2aee('0x110')]]['ListId'],'VoiceQueueId':this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x2aee('0xaa')][_0x236021['actionid']][_0x2aee('0x10a')]||undefined})[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x11a')));delete this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]];unlockQueueStatus(_0x4d442f);}}else if((strategy[this[_0x2aee('0x1e')][this[_0x2aee('0xaa')][_0x236021['actionid']]['queue']]['strategy']]||_0x2aee('0x17'))===_0x2aee('0x17')){var _0x2555c1;if(this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]]&&!_[_0x2aee('0x42')](this['queueBooked'][this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]][_0x2aee('0xb1')]])){if(this['queueBookedRR'][_0xf42f31[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]][_0x2aee('0xb1')]]){this[_0x2aee('0x11b')][_0xf42f31[_0x2aee('0xaa')][_0x236021['actionid']][_0x2aee('0xb1')]]=this[_0x2aee('0x11b')][this[_0x2aee('0xaa')][_0x236021['actionid']][_0x2aee('0xb1')]]?this['queueBookedRR'][this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]][_0x2aee('0xb1')]]:this[_0x2aee('0x114')][this[_0x2aee('0xaa')][_0x236021['actionid']][_0x2aee('0xb1')]]?this[_0x2aee('0x114')][this['actions'][_0x236021[_0x2aee('0x110')]][_0x2aee('0xb1')]][_0x2aee('0x11c')]||0x0:0x0;}this[_0x2aee('0x114')][this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]]['queue']][_0x2aee('0x11c')]=this[_0x2aee('0x11b')][this[_0x2aee('0xaa')][_0x236021[_0x2aee('0x110')]][_0x2aee('0xb1')]];for(var _0x276881=0x0;_0x276881=0x0?!![]:![];})[_0x2aee('0xaf')](myreject(_0x20c0f5)));}}else{_0xfc687b[_0x2aee('0x135')](ami[_0x2aee('0x13a')]({'action':_0x2aee('0x136'),'command':util[_0x2aee('0x75')]('iftime\x20%s,%s',_0x5dafdf,!_[_0x2aee('0x38')](config[_0x2aee('0x131')][_0x5b5292])?_0x5b5292:'')})['then'](function(_0x4408cc){return _0x4408cc[_0x2aee('0x13b')][_0x2aee('0x138')](_0x2aee('0x139'))>=0x0?!![]:![];})[_0x2aee('0xaf')](myreject(_0x20c0f5)));}BPromise[_0x2aee('0x13c')](_0xfc687b)['then'](function(_0x45e650){var _0x5d5fc6=_[_0x2aee('0x13d')](_0x45e650);if(_0x5d5fc6){return _0x1cd51f(_0x5d5fc6);}else{_0x917df5['message']=_0x483429?_0x2aee('0x13e'):_0x2aee('0x13f');return _0x20c0f5(msgResponse(_0x2aee('0x140'),_0x2aee('0x12d'),_0x2aee('0x141')+_0x483429+'\x20'+_0x9b9330+_0x2aee('0x142')+util[_0x2aee('0x91')](_0x5dafdf,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x5b5292));}})[_0x2aee('0xaf')](function(_0x379c05){return _0x20c0f5(msgResponse('ifTime','Failure',JSON['stringify'](_0x379c05)));});});};Dialer[_0x2aee('0x19')][_0x2aee('0x143')]=function(_0x415acf){var _0x3fa13a=this;return function(){switch(_0x415acf['dialMethod']){case'progressive':freeVariablesPredictive(_0x415acf);_0x3fa13a[_0x2aee('0x144')](_0x415acf,0x1);break;case _0x2aee('0x145'):freeVariablesPredictive(_0x415acf);_0x3fa13a[_0x2aee('0x144')](_0x415acf,_0x415acf['dialPowerLevel']);break;case _0x2aee('0x146'):_0x3fa13a[_0x2aee('0x146')](_0x415acf);break;case _0x2aee('0x8'):freeVariablesPredictive(_0x415acf);_0x3fa13a[_0x2aee('0x144')](_0x415acf,0x1);break;default:freeVariablesPredictive(_0x415acf);logger[_0x2aee('0x90')](_0x2aee('0x147'),_0x415acf[_0x2aee('0x3b')],'method\x20not\x20recognized');}};};Dialer['prototype'][_0x2aee('0x148')]=function(_0x31f186){var _0x4b2522=this;return function(){_0x4b2522[_0x2aee('0x149')](_0x31f186);};};Dialer[_0x2aee('0x19')]['syncQueueSummary']=function(_0x2710c0){var _0x3a27a0=this;if(isNotPreview(_0x2710c0[_0x2aee('0x54')])){if(isVoiceQueueOutbound(_0x2710c0['type'])&&isActive(_0x2710c0[_0x2aee('0x53')])){_0x2710c0[_0x2aee('0x9d')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x2710c0,_0x2710c0[_0x2aee('0x14a')]))[_0x2aee('0xb6')](checkIsActive(_0x2710c0,_0x2710c0[_0x2aee('0x53')]))[_0x2aee('0xb6')](checkInterval(_0x2710c0))[_0x2aee('0xb6')](_0x3a27a0[_0x2aee('0x127')](_0x2710c0))[_0x2aee('0xb6')](_0x3a27a0[_0x2aee('0x14b')](_0x2710c0[_0x2aee('0x14c')],_0x2710c0['dialTimezone'],_0x2710c0[_0x2aee('0x3b')],_0x2710c0))[_0x2aee('0xb6')](_0x3a27a0[_0x2aee('0x12b')](_0x2710c0[_0x2aee('0x3f')],_0x2710c0['dialTimezone'],_0x2710c0['name'],_0x2710c0))[_0x2aee('0xb6')](_0x3a27a0[_0x2aee('0x143')](_0x2710c0))[_0x2aee('0xaf')](loggerCatchQueueSummary(_0x2aee('0x14d'),_0x2710c0));}else{notSendMessagesQueue(_0x2710c0);}}else{freeVariablesPredictive(_0x2710c0);}};Dialer[_0x2aee('0x19')][_0x2aee('0x126')]=function(){var _0x5c17a8=this;var _0x16302e;for(var _0x3d374a in this[_0x2aee('0x1f')]){if(this[_0x2aee('0x1f')][_0x2aee('0x94')](_0x3d374a)){_0x16302e=this[_0x2aee('0x1f')][_0x3d374a];if(isCampaignIvr(_0x16302e[_0x2aee('0x49')])&&isActive(_0x16302e[_0x2aee('0x72')])){_0x16302e[_0x2aee('0x9d')]=!![];BPromise[_0x2aee('0xb5')]()[_0x2aee('0xb6')](checkIsActive(_0x16302e,_0x16302e[_0x2aee('0x72')]))[_0x2aee('0xb6')](checkInterval(_0x16302e))['then'](_0x5c17a8[_0x2aee('0x127')](_0x16302e))[_0x2aee('0xb6')](_0x5c17a8[_0x2aee('0x14b')](_0x16302e['dialGlobalInterval'],_0x16302e[_0x2aee('0x14e')],_0x16302e[_0x2aee('0x3b')],_0x16302e))[_0x2aee('0xb6')](_0x5c17a8[_0x2aee('0x12b')](_0x16302e[_0x2aee('0x3f')],_0x16302e['dialTimezone'],_0x16302e['name'],_0x16302e))['then'](_0x5c17a8[_0x2aee('0x148')](_0x16302e))[_0x2aee('0xaf')](loggerCatchQueueSummary(_0x2aee('0x14f'),_0x16302e));}else{notSendMessagesCampaign(_0x16302e);}}}};function getCallerIdRandom(_0x1c8dd8,_0x4b1109){var _0xc79fc3,_0x4bad8e,_0x5567e5;if(_0x4b1109<=0x0){_0x4b1109=0x1;}_0xc79fc3=new RegExp(_0x2aee('0x150')+_0x4b1109+'}$');_0x4bad8e=Math[_0x2aee('0x151')](0xa,_0x4b1109-0x1);_0x5567e5=Math['pow'](0xa,_0x4b1109)-0x1;return util[_0x2aee('0x75')]('%s',_['replace'](_0x1c8dd8,_0xc79fc3,_['random'](_0x4bad8e,_0x5567e5)));}function extractCalleridName(_0x22b6ef){var _0x50bf70=_0x22b6ef[_0x2aee('0x152')](/"(.*?)"/);return _0x50bf70?_0x50bf70[0x1]:_0x22b6ef;}function extractCalleridNumber(_0x5b9c3e){var _0x47c412=_0x5b9c3e[_0x2aee('0x152')](/<(.*?)>/);return _0x47c412?_0x47c412[0x1]:_0x5b9c3e;}Dialer[_0x2aee('0x19')][_0x2aee('0x153')]=function(_0x571939,_0x5b0a98){var _0x1433c7=this;var _0x5cf66f=uuid['v4']();this[_0x2aee('0xaa')][_0x5cf66f]=new Action(_0x571939,_0x5b0a98,_0x5cf66f);return new BPromise(function(_0x3fe94c,_0x1faf4c){if(_[_0x2aee('0x38')](_0x571939)&&_0x2aee('0x154')!==typeof _0x571939){return _0x1faf4c(msgResponse(_0x2aee('0x155'),_0x2aee('0x12d'),_0x2aee('0x156')));}if(_[_0x2aee('0x38')](_0x5b0a98[_0x2aee('0x157')][_0x2aee('0x158')])||_0x5b0a98[_0x2aee('0x157')][_0x2aee('0x158')]===null){return _0x1faf4c(msgResponse('originate',_0x2aee('0x12d'),_0x2aee('0x159')));}var _0x4c17b6={'XMD-CALLERID':_0x1433c7[_0x2aee('0xaa')][_0x5cf66f][_0x2aee('0x15a')](),'XMD-AGI':_0x571939['dialQueueProject']?util['format'](_0x2aee('0x15b'),ipAgi,_0x571939['dialQueueProject']):_0x2aee('0x15c'),'XMD-AGIAFTER':_0x571939['dialQueueProject2']?util['format'](_0x2aee('0x15b'),ipAgi,_0x571939[_0x2aee('0xf7')]):_0x2aee('0x15c'),'XMD-QUEUE':_0x571939[_0x2aee('0x49')]===_0x2aee('0x15d')?util[_0x2aee('0x75')](_0x2aee('0x15e'),_0x571939[_0x2aee('0x3b')],_0x571939[_0x2aee('0x15f')]||'',_0x571939[_0x2aee('0xf8')]?'c':'',_0x571939[_0x2aee('0x160')]||0x3):_0x2aee('0x15c'),'XMD-CONTACTID':_0x5b0a98[_0x2aee('0x109')],'XMD-CDRTYPE':_0x2aee('0x7'),'CALLERID(all)':_0x1433c7['actions'][_0x5cf66f][_0x2aee('0x15a')](),'XMD-AMD':_0x571939[_0x2aee('0xdb')]?_0x2aee('0x161'):_0x2aee('0x15c'),'XMD-DESTINATION':_0x2aee('0xda')};if(_0x571939[_0x2aee('0xdb')]){_0x4c17b6[_0x2aee('0x162')]=_0x571939[_0x2aee('0x163')]||0x9c4;_0x4c17b6[_0x2aee('0x164')]=_0x571939[_0x2aee('0x165')]||0x5dc;_0x4c17b6[_0x2aee('0x166')]=_0x571939[_0x2aee('0x167')]||0x320;_0x4c17b6[_0x2aee('0x168')]=_0x571939[_0x2aee('0x169')]||0x1388;_0x4c17b6[_0x2aee('0x16a')]=_0x571939['dialAMDMinWordLength']||0x64;_0x4c17b6[_0x2aee('0x16b')]=_0x571939[_0x2aee('0x16c')]||0x32;_0x4c17b6[_0x2aee('0x16d')]=_0x571939[_0x2aee('0x16e')]||0x3;_0x4c17b6[_0x2aee('0x16f')]=_0x571939[_0x2aee('0x170')]||0x100;_0x4c17b6['XMD-AMDMAXIMUMWORDLENGTH']=_0x571939[_0x2aee('0x171')]||0x1388;}if(_0x571939[_0x2aee('0x49')]===_0x2aee('0x15d')){_0x4c17b6[_0x2aee('0x172')]=_0x5b0a98[_0x2aee('0xd1')];}else{_0x4c17b6[_0x2aee('0x173')]=_0x5b0a98['CampaignId'];}for(var _0x2b968e in _0x5b0a98[_0x2aee('0x157')]){if(_0x5b0a98[_0x2aee('0x157')][_0x2aee('0x94')](_0x2b968e)){if(isNotNull(_0x5b0a98[_0x2aee('0x157')][_0x2b968e])&&_0x2b968e!=='id'&&_0x2b968e!==_0x2aee('0x174')&&_0x2b968e!==_0x2aee('0x175')&&_0x2b968e!==_0x2aee('0x176')){_0x4c17b6[util['format'](_0x2aee('0x177'),_0x2aee('0x178'),_['toUpper'](_0x2b968e))]=_0x5b0a98[_0x2aee('0x157')][_0x2b968e];}}}var _0xe67a55=_0x1433c7['isTrunkReachable'](_0x571939['Trunk'])?getCallerId(_0x571939[_0x2aee('0x71')][_0x2aee('0x73')],_0x571939[_0x2aee('0x55')],_0x571939[_0x2aee('0x179')]>0x0?getCallerIdRandom(_0x571939['dialOriginateCallerIdNumber'],_0x571939[_0x2aee('0x179')]):_0x571939[_0x2aee('0x56')]):getCallerId(_[_0x2aee('0xac')](_0x571939[_0x2aee('0x128')])?_0x571939['Trunk'][_0x2aee('0x73')]:_0x571939[_0x2aee('0x128')][_0x2aee('0x73')],_0x571939[_0x2aee('0x55')],_0x571939[_0x2aee('0x179')]>0x0?getCallerIdRandom(_0x571939['dialOriginateCallerIdNumber'],_0x571939['dialRandomLastDigitCallerIdNumber']):_0x571939[_0x2aee('0x56')]);if(_0xe67a55){_0x4c17b6['XMD-ORIGINATECALLERIDNAME']=_0x1433c7[_0x2aee('0xaa')][_0x5cf66f][_0x2aee('0x17a')]=extractCalleridName(_0xe67a55);_0x4c17b6['XMD-ORIGINATECALLERIDNUM']=_0x1433c7['actions'][_0x5cf66f][_0x2aee('0x17b')]=extractCalleridNumber(_0xe67a55);}return ami['Action']({'actionid':_0x5cf66f,'action':_0x2aee('0x155'),'channel':_0x1433c7[_0x2aee('0xd4')](_0x571939['Trunk'])?util[_0x2aee('0x75')](_0x2aee('0x17c'),_0x571939[_0x2aee('0x71')]['name'],isNotNull(_0x571939[_0x2aee('0x57')])?_0x571939[_0x2aee('0x57')][_0x2aee('0x17d')]()||'':'',_0x571939[_0x2aee('0x17e')]>0x0?_0x5b0a98[_0x2aee('0x157')]['phone'][_0x2aee('0x17f')](_0x571939[_0x2aee('0x17e')]):_0x5b0a98[_0x2aee('0x157')]['phone']):util[_0x2aee('0x75')](_0x2aee('0x17c'),_[_0x2aee('0xac')](_0x571939[_0x2aee('0x128')])?_0x571939[_0x2aee('0x71')][_0x2aee('0x3b')]:_0x571939[_0x2aee('0x128')][_0x2aee('0x3b')],isNotNull(_0x571939[_0x2aee('0x57')])?_0x571939['dialPrefix'][_0x2aee('0x17d')]()||'':'',_0x571939[_0x2aee('0x17e')]>0x0?_0x5b0a98[_0x2aee('0x157')]['phone'][_0x2aee('0x17f')](_0x571939['dialCutDigit']):_0x5b0a98[_0x2aee('0x157')]['phone']),'callerid':_0xe67a55,'Exten':_0x2aee('0xda'),'Context':_0x2aee('0x180'),'Priority':'1','variable':_0x4c17b6,'timeout':(_0x571939['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5cf66f})[_0x2aee('0xb6')](function(_0x198a4b){return _0x3fe94c(_0x198a4b);})['catch'](function(_0x383673){_0x571939[_0x2aee('0x5f')]+=0x1;var _0x37a7e2=new History(_0x1433c7[_0x2aee('0xaa')][_0x5cf66f]);logger[_0x2aee('0x90')](util[_0x2aee('0x75')](_0x2aee('0x181'),JSON[_0x2aee('0x44')](_0x383673)));_0x37a7e2[_0x2aee('0xdd')]=0xe;_0x37a7e2[_0x2aee('0xa4')]='OriginateError';_0x37a7e2[_0x2aee('0xa5')]=moment()[_0x2aee('0x75')](_0x2aee('0xf9'));_0x37a7e2[_0x2aee('0x182')]=_0x37a7e2['starttime'];_0x1433c7[_0x2aee('0xc8')](_0x37a7e2)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x183')));_0x1433c7[_0x2aee('0xc6')](_0x37a7e2)[_0x2aee('0xaf')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x1433c7[_0x2aee('0xaa')][_0x5cf66f];return _0x1faf4c(msgResponse('originate','Error','originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x2aee('0x2d')]=function(_0x5d0dbb){var _0x480c3e=this[_0x2aee('0xaa')][_0x5d0dbb[_0x2aee('0x110')]];var _0x25fa9a=this;if(_0x480c3e){delete this[_0x2aee('0xaa')][_0x5d0dbb['actionid']];_0x480c3e[_0x2aee('0x100')]=moment()[_0x2aee('0x75')](_0x2aee('0xf9'));var _0x12b37b=_0x480c3e[_0x2aee('0x49')]===_0x2aee('0x77')?this[_0x2aee('0x1f')][_0x480c3e['queue']]:this[_0x2aee('0x1e')][_0x480c3e[_0x2aee('0x184')]()];if(!this['isSuccess'](_0x5d0dbb['response'])){this[_0x2aee('0xb0')](_0x12b37b);return this[_0x2aee('0x185')](_0x480c3e,_0x12b37b,_0x5d0dbb)[_0x2aee('0xb6')](function(_0x287fea){})[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x186')));}else{this[_0x2aee('0xa7')][_0x5d0dbb['uniqueid']]=_0x480c3e;}}};Dialer[_0x2aee('0x19')]['checkRetriveMax']=function(_0x24f71b,_0x5281f5,_0x1b23f4){var _0x17fe35=new History(_0x5281f5);if(_0x17fe35['countbusyretry']+_0x17fe35[_0x2aee('0x187')]+_0x17fe35[_0x2aee('0x188')]+_0x17fe35[_0x2aee('0x189')]+_0x17fe35[_0x2aee('0x105')]+_0x17fe35[_0x2aee('0x10d')]+_0x17fe35['countmachineretry']+_0x17fe35[_0x2aee('0x18a')]>=_0x1b23f4[_0x2aee('0x18b')]-0x1){return!![];}switch(_0x24f71b){case 0x3:if(_0x17fe35['countnoanswerretry']>=_0x1b23f4[_0x2aee('0x18c')]-0x1){return!![];}else{this[_0x2aee('0xbd')]({'active':![],'countnoanswerretry':_0x17fe35['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x1b23f4['dialNoAnswerRetryFrequency'],_0x2aee('0x108'))[_0x2aee('0x75')](_0x2aee('0xf9')),'ContactId':_0x17fe35[_0x2aee('0x109')],'ListId':_0x17fe35[_0x2aee('0xcf')],'VoiceQueueId':_0x17fe35[_0x2aee('0xd1')]||undefined,'CampaignId':_0x17fe35[_0x2aee('0x10a')]||undefined})['catch'](loggerCatch(_0x2aee('0x18d')));}break;case 0x5:if(_0x17fe35[_0x2aee('0x18e')]>=_0x1b23f4['dialBusyMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x17fe35['countbusyretry']+=0x1,'scheduledat':moment()[_0x2aee('0x106')](_0x1b23f4['dialBusyRetryFrequency'],_0x2aee('0x108'))[_0x2aee('0x75')](_0x2aee('0xf9')),'ContactId':_0x17fe35['ContactId'],'ListId':_0x17fe35['ListId'],'VoiceQueueId':_0x17fe35[_0x2aee('0xd1')]||undefined,'CampaignId':_0x17fe35[_0x2aee('0x10a')]||undefined})['catch'](loggerCatch(_0x2aee('0x18f')));}break;case 0x8:if(_0x17fe35['countcongestionretry']>=_0x1b23f4['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0x2aee('0xbd')]({'active':![],'countcongestionretry':_0x17fe35['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x1b23f4[_0x2aee('0x190')],'minutes')[_0x2aee('0x75')](_0x2aee('0xf9')),'ContactId':_0x17fe35['ContactId'],'ListId':_0x17fe35[_0x2aee('0xcf')],'VoiceQueueId':_0x17fe35[_0x2aee('0xd1')]||undefined,'CampaignId':_0x17fe35[_0x2aee('0x10a')]||undefined})[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x191')));}break;case 0x0:if(_0x17fe35['countnosuchnumberretry']>=_0x1b23f4['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x2aee('0xbd')]({'active':![],'countnosuchnumberretry':_0x17fe35[_0x2aee('0x189')]+=0x1,'scheduledat':moment()[_0x2aee('0x106')](_0x1b23f4['dialNoSuchNumberRetryFrequency'],'minutes')[_0x2aee('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17fe35[_0x2aee('0x109')],'ListId':_0x17fe35[_0x2aee('0xcf')],'VoiceQueueId':_0x17fe35[_0x2aee('0xd1')]||undefined,'CampaignId':_0x17fe35['CampaignId']||undefined})[_0x2aee('0xaf')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x17fe35[_0x2aee('0x105')]>=_0x1b23f4['dialDropMaxRetry']-0x1){return!![];}else{this[_0x2aee('0xbd')]({'active':![],'countdropretry':_0x17fe35['countdropretry']+=0x1,'scheduledat':moment()[_0x2aee('0x106')](_0x1b23f4['dialDropRetryFrequency'],'minutes')[_0x2aee('0x75')](_0x2aee('0xf9')),'ContactId':_0x17fe35[_0x2aee('0x109')],'ListId':_0x17fe35[_0x2aee('0xcf')],'VoiceQueueId':_0x17fe35[_0x2aee('0xd1')]||undefined,'CampaignId':_0x17fe35[_0x2aee('0x10a')]||undefined})['catch'](loggerCatch(_0x2aee('0x192')));}break;case 0xb:if(_0x17fe35[_0x2aee('0x10d')]>=_0x1b23f4['dialAbandonedMaxRetry']-0x1){return!![];}else{this[_0x2aee('0xbd')]({'active':![],'countabandonedretry':_0x17fe35[_0x2aee('0x10d')]+=0x1,'scheduledat':moment()[_0x2aee('0x106')](_0x1b23f4[_0x2aee('0x10e')],_0x2aee('0x108'))[_0x2aee('0x75')](_0x2aee('0xf9')),'ContactId':_0x17fe35[_0x2aee('0x109')],'ListId':_0x17fe35[_0x2aee('0xcf')],'VoiceQueueId':_0x17fe35[_0x2aee('0xd1')]||undefined,'CampaignId':_0x17fe35[_0x2aee('0x10a')]||undefined})[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x10f')));}break;case 0x13:if(_0x17fe35[_0x2aee('0x193')]>=_0x1b23f4[_0x2aee('0x194')]-0x1){return!![];}else{this[_0x2aee('0xbd')]({'active':![],'countmachineretry':_0x17fe35[_0x2aee('0x193')]+=0x1,'scheduledat':moment()[_0x2aee('0x106')](_0x1b23f4[_0x2aee('0x195')],_0x2aee('0x108'))[_0x2aee('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17fe35[_0x2aee('0x109')],'ListId':_0x17fe35[_0x2aee('0xcf')],'VoiceQueueId':_0x17fe35[_0x2aee('0xd1')]||undefined,'CampaignId':_0x17fe35[_0x2aee('0x10a')]||undefined})[_0x2aee('0xaf')](loggerCatch('[rescheduleContact][Machine]'));}break;case 0x14:if(_0x17fe35[_0x2aee('0x18a')]>=_0x1b23f4['dialAgentRejectMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countagentrejectretry':_0x17fe35[_0x2aee('0x18a')]+=0x1,'scheduledat':moment()[_0x2aee('0x106')](_0x1b23f4[_0x2aee('0x196')],_0x2aee('0x108'))[_0x2aee('0x75')](_0x2aee('0xf9')),'ContactId':_0x17fe35[_0x2aee('0x109')],'ListId':_0x17fe35[_0x2aee('0xcf')],'VoiceQueueId':_0x17fe35['VoiceQueueId']||undefined,'CampaignId':_0x17fe35['CampaignId']||undefined})[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x197')));}break;default:return!![];}};Dialer[_0x2aee('0x19')][_0x2aee('0x185')]=function(_0x7733bc,_0x1d9c78,_0x479bc5){var _0x4dfd09=this;var _0x285dcb=new History(_0x7733bc);return new BPromise(function(_0x1b1a2c,_0x554b9c){if(_[_0x2aee('0x38')](_0x1d9c78)&&'object'!==typeof _0x1d9c78){return _0x554b9c(msgResponse(_0x2aee('0x198'),_0x2aee('0x12d'),_0x2aee('0x199')));}if(_[_0x2aee('0x38')](_0x479bc5)&&_0x2aee('0x154')!==typeof _0x479bc5){return _0x554b9c(msgResponse(_0x2aee('0x198'),_0x2aee('0x12d'),_0x2aee('0x19a')));}switch(_0x479bc5[_0x2aee('0xf4')]){case'0':_0x1d9c78[_0x2aee('0x19b')]+=0x1;_0x285dcb[_0x2aee('0xdd')]=0x0;_0x285dcb[_0x2aee('0xa4')]=_0x2aee('0x19c');_0x4dfd09[_0x2aee('0xc8')](_0x285dcb)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x19d')));if(_0x4dfd09['checkRetriveMax'](0x0,_0x7733bc,_0x1d9c78)){if(_0x285dcb[_0x2aee('0x18e')]+_0x285dcb[_0x2aee('0x187')]+_0x285dcb[_0x2aee('0x188')]+_0x285dcb[_0x2aee('0x189')]+_0x285dcb[_0x2aee('0x105')]+_0x285dcb[_0x2aee('0x10d')]+_0x285dcb['countmachineretry']+_0x285dcb[_0x2aee('0x18a')]>=_0x1d9c78[_0x2aee('0x18b')]){_0x4dfd09['stateGlobal'](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x19e'));}else{_0x4dfd09[_0x2aee('0x19f')](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x19e'));}}break;case'3':_0x1d9c78['outboundNoAnswerCallsDay']+=0x1;_0x285dcb[_0x2aee('0xdd')]=0x3;_0x285dcb[_0x2aee('0xa4')]='NoAnswer';_0x285dcb[_0x2aee('0x188')]+=0x1;_0x285dcb['countglobal']+=0x1;_0x4dfd09[_0x2aee('0xc8')](_0x285dcb)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1a0')));if(_0x4dfd09['checkRetriveMax'](0x3,_0x7733bc,_0x1d9c78)){if(_0x285dcb[_0x2aee('0x188')]>=_0x1d9c78['dialNoAnswerMaxRetry']){_0x4dfd09[_0x2aee('0x19f')](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x1a1'));}else{_0x4dfd09[_0x2aee('0x1a2')](_0x285dcb,_0x1b1a2c,_0x554b9c,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x1d9c78['outboundBusyCallsDay']+=0x1;_0x285dcb['state']=0x5;_0x285dcb['statedesc']=_0x2aee('0x1a3');_0x285dcb['countbusyretry']+=0x1;_0x285dcb[_0x2aee('0x1a4')]+=0x1;_0x4dfd09[_0x2aee('0xc8')](_0x285dcb)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1a5')));if(_0x4dfd09[_0x2aee('0x1a6')](0x5,_0x7733bc,_0x1d9c78)){if(_0x285dcb['countbusyretry']>=_0x1d9c78[_0x2aee('0x1a7')]){_0x4dfd09[_0x2aee('0x19f')](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x1a8'));}else{_0x4dfd09['stateGlobal'](_0x285dcb,_0x1b1a2c,_0x554b9c,'reason\x205\x20busy');}}break;case'8':_0x1d9c78[_0x2aee('0x1a9')]+=0x1;_0x285dcb[_0x2aee('0xdd')]=0x8;_0x285dcb[_0x2aee('0xa4')]='Congestion';_0x285dcb['countcongestionretry']+=0x1;_0x285dcb[_0x2aee('0x1a4')]+=0x1;_0x4dfd09[_0x2aee('0xc8')](_0x285dcb)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1aa')));if(_0x4dfd09['checkRetriveMax'](0x8,_0x7733bc,_0x1d9c78)){if(_0x285dcb['countcongestionretry']>=_0x1d9c78[_0x2aee('0x1ab')]){_0x4dfd09[_0x2aee('0x19f')](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x1ac'));}else{_0x4dfd09['stateGlobal'](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x1ac'));}}break;case'11':_0x1d9c78['outboundAbandonedCallsDay']+=0x1;_0x285dcb[_0x2aee('0xdd')]=0xb;_0x285dcb[_0x2aee('0xa4')]=_0x2aee('0x10b');_0x285dcb[_0x2aee('0x10d')]+=0x1;_0x285dcb[_0x2aee('0x1a4')]+=0x1;_0x4dfd09['createHistory'](_0x285dcb)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1ad')));if(_0x4dfd09['checkRetriveMax'](0xb,_0x7733bc,_0x1d9c78)){if(_0x285dcb[_0x2aee('0x10d')]>=_0x1d9c78[_0x2aee('0x1ae')]){_0x4dfd09['createStateFinal'](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x1af'));}else{_0x4dfd09[_0x2aee('0x1a2')](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x1af'));}}break;case'20':_0x1d9c78[_0x2aee('0x61')]+=0x1;_0x285dcb['state']=0x14;_0x285dcb['statedesc']=_0x2aee('0x1b0');_0x285dcb[_0x2aee('0x18a')]+=0x1;_0x285dcb[_0x2aee('0x1a4')]+=0x1;_0x4dfd09[_0x2aee('0xc8')](_0x285dcb)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1b1')));if(_0x4dfd09['checkRetriveMax'](0x14,_0x7733bc,_0x1d9c78)){if(_0x285dcb[_0x2aee('0x18a')]>=_0x1d9c78[_0x2aee('0x1b2')]){_0x4dfd09[_0x2aee('0x19f')](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x1b3'));}else{_0x4dfd09[_0x2aee('0x1a2')](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x2aee('0x1b3'));}}break;default:_0x1d9c78[_0x2aee('0x62')]+=0x1;_0x285dcb['state']=0xc;_0x285dcb['statedesc']=_0x479bc5['reason'];_0x4dfd09[_0x2aee('0xc8')](_0x285dcb)[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1b4')));if(_0x4dfd09['checkRetriveMax'](_0x479bc5[_0x2aee('0xf4')],_0x7733bc,_0x1d9c78)){if(_0x285dcb['countbusyretry']+_0x285dcb[_0x2aee('0x187')]+_0x285dcb['countnoanswerretry']+_0x285dcb[_0x2aee('0x189')]+_0x285dcb[_0x2aee('0x105')]+_0x285dcb[_0x2aee('0x10d')]+_0x285dcb[_0x2aee('0x193')]+_0x285dcb[_0x2aee('0x18a')]>=_0x1d9c78[_0x2aee('0x18b')]){_0x4dfd09[_0x2aee('0x1a2')](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x479bc5[_0x2aee('0xf4')]);}else{_0x4dfd09[_0x2aee('0x19f')](_0x285dcb,_0x1b1a2c,_0x554b9c,_0x479bc5[_0x2aee('0xf4')]);}}}});};Dialer[_0x2aee('0x19')]['stateGlobal']=function(_0x40e8b1,_0x383a46,_0x2966fb,_0x3d6cd5){var _0x1b8065=new Final(_0x40e8b1);_0x1b8065[_0x2aee('0xdd')]=0xf;_0x1b8065[_0x2aee('0xa4')]=_0x2aee('0x1b5');this[_0x2aee('0x19f')](_0x1b8065,_0x383a46,_0x2966fb,_0x3d6cd5);};Dialer[_0x2aee('0x19')][_0x2aee('0x19f')]=function(_0x3c1aa7,_0x1d48c3,_0x2f8cd2,_0x48e4ac){this[_0x2aee('0xc6')](_0x3c1aa7)['then'](function(_0x8b8fcb){return _0x1d48c3(msgResponse(_0x2aee('0x198'),_0x2aee('0xd3'),_0x48e4ac));})['catch'](function(_0x409bbd){return _0x2f8cd2(msgResponse(_0x2aee('0x1b6'),_0x2aee('0x12d'),'contact\x20not\x20moved'));});};Dialer['prototype']['predictive']=function(_0x1222d9){var _0x29afb4=this;var _0x39b497=_0x1222d9[_0x2aee('0x1b7')]/0x64;var _0x3876e9=_0x1222d9['outboundDropCallsDayTimeout']/(_0x1222d9[_0x2aee('0x5d')]+_0x1222d9[_0x2aee('0x59')]);var _0x2388d4=Math[_0x2aee('0x1b8')](_0x1222d9[_0x2aee('0x6a')]*(_0x1222d9[_0x2aee('0x1b9')]/0x64));var _0x413cc8=Math[_0x2aee('0x1b8')](_0x1222d9[_0x2aee('0x6a')]*(_0x1222d9[_0x2aee('0x1ba')]/0x64));var _0xcfeb4f=_0x1222d9[_0x2aee('0x9f')]+_0x1222d9['talking'];var _0x41282b=Math[_0x2aee('0x1bb')](_0x1222d9[_0x2aee('0x6c')]*_0x1222d9[_0x2aee('0x6e')]*_0x1222d9[_0x2aee('0x1bc')]*_0x1222d9[_0x2aee('0x68')]);if(_['isUndefined'](_0x1222d9[_0x2aee('0x26')])){if(!_[_0x2aee('0x38')](_0x1222d9['startPredictive'])){_0x1222d9['startPredictive']=undefined;loggerPredictive['error'](_0x2aee('0x1bd'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x1222d9[_0x2aee('0x8a')])){loggerPredictive[_0x2aee('0x90')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x1222d9[_0x2aee('0x8a')]);_0x1222d9[_0x2aee('0x8a')]=undefined;}_0x1222d9[_0x2aee('0x26')]=moment()[_0x2aee('0x75')](_0x2aee('0xf9'));loggerPredictive[_0x2aee('0x78')](_0x1222d9[_0x2aee('0x3b')],_0x2aee('0x1be'),_0x1222d9[_0x2aee('0x26')]);this[_0x2aee('0x144')](_0x1222d9,0x1);}else if(ifInterval(_0x1222d9[_0x2aee('0x1bf')],_0x1222d9[_0x2aee('0x26')])){this[_0x2aee('0x144')](_0x1222d9,0x1);loggerPredictiveCalls[_0x2aee('0x78')]('[startMethodPredictive][StartProgressive][Loop]',_0x1222d9[_0x2aee('0x26')],_0x1222d9[_0x2aee('0x3b')]);_0x1222d9[_0x2aee('0x6c')]=0x0;_0x1222d9[_0x2aee('0x67')]=0x0;}else if(_0x39b497<_0x3876e9&&_0x1222d9[_0x2aee('0x1c0')]===_0x2aee('0x1c1')){freeVariablesPredictive(_0x1222d9);loggerPredictive['info'](_0x2aee('0x1c2'),'Dropped\x20calls\x20day',_0x3876e9,'startProgressive',_0x1222d9['name']);}else if(_0x41282b<_0x1222d9[_0x2aee('0x67')]&&_0x1222d9[_0x2aee('0x1c0')]===_0x2aee('0x1c1')){freeVariablesPredictive(_0x1222d9);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x1c3'),_0x2aee('0x1c4'),_0x41282b,_0x2aee('0x1c5'),_0x1222d9[_0x2aee('0x67')],_0x2aee('0x26'),_0x1222d9[_0x2aee('0x3b')]);}else if(!ifInterval(_0x1222d9[_0x2aee('0x1bf')],_0x1222d9['startProgressive'])&&_[_0x2aee('0x38')](_0x1222d9[_0x2aee('0x70')])&&!_[_0x2aee('0x38')](_0x1222d9[_0x2aee('0x26')])){_0x1222d9['startPredictive']=moment()[_0x2aee('0x75')](_0x2aee('0xf9'));loggerPredictive[_0x2aee('0x78')](_0x1222d9[_0x2aee('0x3b')],'started\x20in\x20predictive\x20at',_0x1222d9[_0x2aee('0x70')]);this[_0x2aee('0x1c6')](_0x1222d9['dialPredictiveInterval'])[_0x2aee('0xb6')](this[_0x2aee('0x1c7')](_0x1222d9))['then'](mergeDataErlangB(_0x1222d9))[_0x2aee('0xb6')](this[_0x2aee('0x1c8')](_0x1222d9))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1222d9));}else if(!ifInterval(_0x1222d9[_0x2aee('0x1bf')],_0x1222d9['startPredictive'])){_0x1222d9[_0x2aee('0x67')]=0x0;_0x1222d9[_0x2aee('0x70')]=moment()[_0x2aee('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x1222d9['name'],_0x2aee('0x1c9'),_0x1222d9[_0x2aee('0x70')]);clearInterval(_0x1222d9[_0x2aee('0x8a')]);_0x1222d9['handlePredictive']=undefined;this[_0x2aee('0x1c6')](_0x1222d9[_0x2aee('0x1bf')])['then'](this[_0x2aee('0x1c7')](_0x1222d9))[_0x2aee('0xb6')](mergeDataErlangB(_0x1222d9))['then'](this[_0x2aee('0x1c8')](_0x1222d9))[_0x2aee('0xaf')](loggerCatchPredictive(_0x2aee('0x1ca'),_0x1222d9));}else if(_0x1222d9['predictiveIntervalAvailable']&&_0xcfeb4f<_0x1222d9['predictiveIntervalAvailable']-_0x413cc8){freeVariablesPredictive(_0x1222d9);loggerPredictive[_0x2aee('0x78')](_0x1222d9[_0x2aee('0x3b')],_0x2aee('0x1cb'),_0xcfeb4f,_0x2aee('0x1cc'),_0x1222d9[_0x2aee('0x6a')],'-',_0x413cc8,'=',_0x1222d9[_0x2aee('0x6a')]-_0x413cc8,')');}else if(_0x1222d9['predictiveIntervalAvailable']&&_0xcfeb4f>_0x1222d9['predictiveIntervalAvailable']+_0x2388d4){freeVariablesPredictive(_0x1222d9);loggerPredictive[_0x2aee('0x78')](_0x1222d9[_0x2aee('0x3b')],_0x2aee('0x1cb'),_0xcfeb4f,_0x2aee('0x1cd'),_0x1222d9[_0x2aee('0x6a')],'+',_0x2388d4,'=',_0x1222d9['predictiveIntervalAvailable']+_0x2388d4,')');}};Dialer['prototype'][_0x2aee('0x1c7')]=function(_0x53716b){var _0x37d66f=this;return function(_0x3e8039){return new BPromise(function(_0x3518e4,_0x4adc39){_[_0x2aee('0x88')](_0x53716b,_0x3e8039[0x0]);if(checkGetDataPredictive(_0x3e8039[0x0])){var _0x31307d=_0x53716b[_0x2aee('0x6a')]=_0x53716b['talking']+_0x53716b['available'];var _0x110ec2=_0x53716b[_0x2aee('0x1bf')]*0x3c;var _0x468744=_0x3e8039[0x0]['predictiveIntervalAvgTalktime']+_0x3e8039[0x0][_0x2aee('0x63')];var _0x2460b6=(_0x3e8039[0x0][_0x2aee('0x7a')]+_0x3e8039[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3e8039[0x0][_0x2aee('0x7d')])/_0x3e8039[0x0][_0x2aee('0x6b')];_0x53716b[_0x2aee('0x1bc')]=_0x2460b6>0x0?_0x2460b6:0x1;switch(_0x53716b['dialPredictiveOptimization']){case _0x2aee('0x1c1'):var _0x42271a=_0x53716b[_0x2aee('0x1b7')]/0x64;return _0x37d66f['abandonmentRate'](_0x31307d,_0x110ec2,_0x468744,_0x2460b6,_0x42271a)[_0x2aee('0xb6')](function(_0x1a99c8){return _0x3518e4(_0x1a99c8);});case _0x2aee('0x1ce'):var _0x21412b=_0x53716b[_0x2aee('0x1b7')]/0x64;return _0x37d66f['busyFactor'](_0x31307d,_0x110ec2,_0x468744,_0x2460b6,_0x21412b)[_0x2aee('0xb6')](function(_0x2536d3){return _0x3518e4(_0x2536d3);});default:return _0x4adc39(msgResponse(_0x2aee('0x1cf'),_0x2aee('0x12d'),_0x2aee('0x1d0')));}}else{return _0x4adc39(msgResponse(_0x2aee('0x1cf'),'Failure',_0x2aee('0x1d1')));}});};};Dialer[_0x2aee('0x19')][_0x2aee('0x1d2')]=function(_0x55699e){var _0x31b5b9=this;return function(_0x2f87ac){return new BPromise(function(_0x5a538e,_0xc62a7f){_[_0x2aee('0x88')](_0x55699e,_0x2f87ac[0x0]);if(checkGetDataPredictive(_0x2f87ac[0x0])){loggerPredictive[_0x2aee('0x78')](JSON[_0x2aee('0x44')](_0x2f87ac[0x0]));if(_0x55699e['dialPredictiveOptimization']===_0x2aee('0x1c1')){return _0x31b5b9[_0x2aee('0xc4')](_0x55699e['id'])[_0x2aee('0xb6')](function(_0x128550){var _0x4b874a=_0x55699e[_0x2aee('0x14a')]-_0x128550[0x0][_0x2aee('0x1d3')];var _0x1fd1b2=_0x55699e[_0x2aee('0x1bf')]*0x3c;var _0x3952ed=_0x2f87ac[0x0][_0x2aee('0x64')]+_0x2f87ac[0x0][_0x2aee('0x63')];var _0x1de9a2=(_0x2f87ac[0x0][_0x2aee('0x7a')]+_0x2f87ac[0x0][_0x2aee('0x65')]+_0x2f87ac[0x0][_0x2aee('0x7d')])/_0x2f87ac[0x0][_0x2aee('0x6b')];var _0x1f573b=_0x55699e['dialPredictiveOptimizationPercentage']/0x64;_0x55699e[_0x2aee('0x69')]=_0x128550[0x0][_0x2aee('0x1d3')]||0x0;_0x55699e[_0x2aee('0x1bc')]=_0x1de9a2>0x0?_0x1de9a2:0x1;return _0x31b5b9[_0x2aee('0x1d4')](_0x4b874a,_0x1fd1b2,_0x3952ed,_0x1de9a2,_0x1f573b);})[_0x2aee('0xb6')](function(_0x2545de){return _0x5a538e(_0x2545de);})[_0x2aee('0xaf')](function(_0x96923c){return _0xc62a7f(msgResponse('[CatchErlangB]',_0x2aee('0x12d'),JSON['stringify'](_0x96923c)));});}if(_0x55699e[_0x2aee('0x1c0')]==='agentBusyFactor'){return _0x31b5b9['getVoiceQueueRtPauses'](_0x55699e['id'])['then'](function(_0x5985c1){var _0x464b60=_0x55699e[_0x2aee('0x14a')]-_0x5985c1[0x0][_0x2aee('0x1d3')];var _0x4ed955=_0x55699e[_0x2aee('0x1bf')]*0x3c;var _0x245df0=_0x2f87ac[0x0]['predictiveIntervalAvgTalktime']+_0x2f87ac[0x0][_0x2aee('0x63')];var _0x20cda7=(_0x2f87ac[0x0][_0x2aee('0x7a')]+_0x2f87ac[0x0][_0x2aee('0x65')]+_0x2f87ac[0x0][_0x2aee('0x7d')])/_0x2f87ac[0x0][_0x2aee('0x6b')];var _0x2a8f1f=_0x55699e['dialPredictiveOptimizationPercentage']/0x64;_0x55699e[_0x2aee('0x69')]=_0x5985c1[0x0]['outboundQueuePauses']||0x0;_0x55699e[_0x2aee('0x1bc')]=_0x20cda7>0x0?_0x20cda7:0x1;return _0x31b5b9[_0x2aee('0x1d5')](_0x464b60,_0x4ed955,_0x245df0,_0x20cda7,_0x2a8f1f);})[_0x2aee('0xb6')](function(_0xdce031){return _0x5a538e(_0xdce031);})[_0x2aee('0xaf')](function(_0xcbde1){return _0xc62a7f(msgResponse(_0x2aee('0x1d6'),'Failure',JSON[_0x2aee('0x44')](_0xcbde1)));});}}else{return _0xc62a7f(msgResponse('[getDataPredictive]',_0x2aee('0x12d'),_0x2aee('0x1d1')));}});};};Dialer['prototype'][_0x2aee('0x1c8')]=function(_0x397e39){var _0x33352f=this;return function(){var _0x57d862=0x0;var _0x4eaaf2=Math['floor'](_0x397e39[_0x2aee('0x6d')]*0x3e8);if(_0x4eaaf2>0x0){_0x4eaaf2=_0x4eaaf2<0x64?0x64:_0x4eaaf2;loggerPredictive[_0x2aee('0x78')](_0x397e39[_0x2aee('0x3b')],_0x2aee('0x1d7'),_0x4eaaf2,_0x2aee('0x45'));_0x397e39[_0x2aee('0x8a')]=setInterval(function(){_0x33352f[_0x2aee('0x8a')](_0x397e39);loggerPredictiveCalls[_0x2aee('0x78')](_0x2aee('0x1d8'),_0x57d862+=0x1);},_0x4eaaf2);}else{loggerPredictive[_0x2aee('0x78')](_0x397e39[_0x2aee('0x3b')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x2aee('0x19')]['checkContactBlack']=function(_0x6f2a68,_0x2c2ae7){var _0x3c4f35=this;return function(_0x4d2c73){if(_['isEmpty'](_0x4d2c73)){if(_[_0x2aee('0xac')](_0x2c2ae7['UserId'])||!_0x2c2ae7['recallme']){if(_0x6f2a68['dialMethod']==='booked'){_0x6f2a68[_0x2aee('0x116')]=_['isUndefined'](_0x6f2a68['queueStatusComplete'])?!![]:_0x6f2a68['queueStatusComplete'];var _0x23070e=uuid['v4']();_0x3c4f35['actions'][_0x23070e]=new Action(_0x6f2a68,_0x2c2ae7,_0x23070e);loggerBooked[_0x2aee('0x78')](_0x2aee('0x1d9'),_0x23070e,_0x2aee('0x1da'),JSON['stringify'](_0x6f2a68[_0x2aee('0x116')]),_0x2aee('0x1db'),_0x6f2a68[_0x2aee('0x3b')]);if(_0x6f2a68['queueStatusComplete']){_0x6f2a68[_0x2aee('0x116')]=![];_0x3c4f35[_0x2aee('0x114')][_0x3c4f35[_0x2aee('0xaa')][_0x23070e][_0x2aee('0xb1')]]=[];ami[_0x2aee('0x13a')]({'actionid':_0x23070e,'action':'queuestatus','queue':_0x6f2a68[_0x2aee('0x3b')]})[_0x2aee('0xaf')](function(_0x4af961){_0x3c4f35['updateOriginated'](_0x6f2a68);_0x3c4f35[_0x2aee('0xbd')]({'active':![],'ContactId':_0x3c4f35[_0x2aee('0xaa')][_0x23070e][_0x2aee('0x109')],'ListId':_0x3c4f35[_0x2aee('0xaa')][_0x23070e][_0x2aee('0xcf')],'VoiceQueueId':_0x3c4f35[_0x2aee('0xaa')][_0x23070e][_0x2aee('0xd1')]||undefined,'CampaignId':_0x3c4f35[_0x2aee('0xaa')][_0x23070e][_0x2aee('0x10a')]||undefined})[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1dc')));delete _0x3c4f35[_0x2aee('0xaa')][_0x23070e];});}else{loggerBooked[_0x2aee('0x78')]('[booked][checkContactBlack][else]',JSON[_0x2aee('0x44')](_0x6f2a68[_0x2aee('0x116')]),_0x2aee('0x1db'),_0x6f2a68['name']);_0x3c4f35[_0x2aee('0xb0')](_0x6f2a68);_0x3c4f35[_0x2aee('0xbd')]({'active':![],'ContactId':_0x3c4f35[_0x2aee('0xaa')][_0x23070e][_0x2aee('0x109')],'ListId':_0x3c4f35[_0x2aee('0xaa')][_0x23070e][_0x2aee('0xcf')],'VoiceQueueId':_0x3c4f35[_0x2aee('0xaa')][_0x23070e][_0x2aee('0xd1')]||undefined,'CampaignId':_0x3c4f35[_0x2aee('0xaa')][_0x23070e][_0x2aee('0x10a')]||undefined})[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1dc')));delete _0x3c4f35['actions'][_0x23070e];}}else{return _0x3c4f35['actionOriginate'](_0x6f2a68,_0x2c2ae7);}}else{if(getDiff(_0x2c2ae7[_0x2aee('0x1dd')])<_0x6f2a68[_0x2aee('0x1de')]*0x3c){if(_0x2c2ae7['Agent']&&!_0x2c2ae7[_0x2aee('0x1df')][_0x2aee('0x1e0')]){_0x3c4f35['preview'][_0x2aee('0x121')](_0x2c2ae7['id'])['finally'](function(){_0x3c4f35[_0x2aee('0xb0')](_0x6f2a68);});}else{_0x3c4f35[_0x2aee('0xbf')]({'active':![]},_0x2c2ae7['id'],0x1)['finally'](function(){console[_0x2aee('0x1e1')](_0x2aee('0x1e2'));_0x3c4f35['updateOriginated'](_0x6f2a68);});}}else{_0x6f2a68['outboundReCallsDay']+=0x1;_0x3c4f35[_0x2aee('0xb0')](_0x6f2a68);if(_0x6f2a68[_0x2aee('0x1e3')]){_0x3c4f35[_0x2aee('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2c2ae7[_0x2aee('0x109')],'ListId':_0x2c2ae7[_0x2aee('0xcf')],'VoiceQueueId':_0x2c2ae7[_0x2aee('0xd1')]||undefined,'CampaignId':_0x2c2ae7[_0x2aee('0x10a')]||undefined})[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1e4')));_0x3c4f35[_0x2aee('0xc8')](createObjHistory(_0x6f2a68,_0x2c2ae7,'RECALLINQUEUE',0x17,_0x2aee('0x1e5')))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0x1e6')));}else{_0x3c4f35[_0x2aee('0xcd')](createObjHistory(_0x6f2a68,_0x2c2ae7,_0x2aee('0x1e7'),0x16,_0x2aee('0x1e8')),_0x2aee('0x1e9'),'[Originate][HistoryRecallClose]');}}}}else{_0x6f2a68[_0x2aee('0x5a')]+=0x1;_0x3c4f35[_0x2aee('0xcd')](createObjHistory(_0x6f2a68,_0x2c2ae7,_0x2aee('0x1ea'),0xd,_0x2aee('0x1eb')),_0x2aee('0x1ec'),_0x2aee('0x1ed'));throw _0x2aee('0x1ee');}};};Dialer[_0x2aee('0x19')][_0x2aee('0x149')]=function(_0x30177a){var _0x52b57a=this;var _0x240a72=[];var _0x1ca5d0=_0x30177a[_0x2aee('0x1ef')]-_0x30177a[_0x2aee('0x95')]-_0x30177a[_0x2aee('0x1f0')];emitCampaignSummary(_0x30177a);if(_0x1ca5d0>0x0){if(_0x1ca5d0>this[_0x2aee('0x22')]){_0x1ca5d0=this[_0x2aee('0x22')];}_0x30177a[_0x2aee('0x1f0')]+=_0x1ca5d0;this[_0x2aee('0xc3')](_0x30177a['id'],_0x1ca5d0,_0x30177a['dialOrderByScheduledAt'])['then'](function(_0xa4e525){_0x30177a[_0x2aee('0x1f0')]-=_0x1ca5d0;_0x30177a[_0x2aee('0x1f0')]=_0x30177a[_0x2aee('0x1f0')]>0x0?_0x30177a[_0x2aee('0x1f0')]:0x0;if(!checkContactEmpty(_0xa4e525)){_0x30177a[_0x2aee('0x39')]=_0x2aee('0x9b');logger[_0x2aee('0x78')](_0x2aee('0x1f1')+_0x30177a[_0x2aee('0x3b')]);}else{_0x30177a[_0x2aee('0x95')]+=_0xa4e525[_0x2aee('0x93')];_0x30177a[_0x2aee('0x39')]=_0x2aee('0x1f2');for(var _0x52463b=0x0;_0x52463b<_0xa4e525[_0x2aee('0x93')];_0x52463b+=0x1){_0x30177a[_0x2aee('0x1f3')]+=0x1;if(_[_0x2aee('0xac')](_0xa4e525[_0x52463b])||_['isNil'](_0xa4e525[_0x52463b][_0x2aee('0x157')])||_[_0x2aee('0xac')](_0xa4e525[_0x52463b][_0x2aee('0x157')][_0x2aee('0x158')])){_0x52b57a[_0x2aee('0xcc')](_0x2aee('0x1f4'),_0x30177a,_0xa4e525[_0x52463b]);}else{_0x52b57a['checkIsBlackListIvr'](_['pick'](_0xa4e525[_0x52463b],['CampaignId',_0x2aee('0x1f5')]))[_0x2aee('0xb6')](_0x52b57a[_0x2aee('0x1f6')](_0x30177a,_0xa4e525[_0x52463b]))[_0x2aee('0xaf')](_0x52b57a[_0x2aee('0xcb')](_0x2aee('0x1f7'),_0x30177a));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x30177a,_0x1ca5d0));}};Dialer['prototype']['handlePower']=function(_0x55c743,_0x4cdd43){var _0x266ea9=this;var _0x5acaad=[];var _0x57b95e=_0x4cdd43>=0x1?_0x4cdd43:0x1;var _0x38e3ea=[];if(_0x55c743[_0x2aee('0x54')]===_0x2aee('0x8')){_0x57b95e=0x1;}var _0x5849fd=Math[_0x2aee('0x1bb')](_0x55c743[_0x2aee('0x9f')]*_0x57b95e)-_0x55c743['originated']-_0x55c743['temp'];emitVoiceQueueSummary(_0x55c743);if(_0x55c743['dialLimitQueue']>0x0){var _0x15df60=_0x55c743[_0x2aee('0x1f8')]-_0x55c743['originated']-_0x55c743['talking']-_0x55c743[_0x2aee('0x1f0')]-_0x55c743[_0x2aee('0x9e')];if(_0x5849fd>_0x15df60){_0x5849fd=_0x15df60;}}if(_0x5849fd>0x0){if(_0x55c743[_0x2aee('0x54')]==='booked'){_0x5849fd=0x1;}if(_0x5849fd>this['maxNumberOriginate']){_0x5849fd=this['maxNumberOriginate'];}_0x55c743['temp']+=_0x5849fd;for(var _0xc0755c in this[_0x2aee('0x20')]){if(this[_0x2aee('0x20')]['hasOwnProperty'](_0xc0755c)){if(this[_0x2aee('0x20')][_0xc0755c][_0x2aee('0xdd')]===_0x2aee('0x1f9')&&this[_0x2aee('0x20')][_0xc0755c][_0x2aee('0xad')]==='reachable'){_0x5acaad[_0x2aee('0x135')](this[_0x2aee('0x20')][_0xc0755c]['id']);}}}this[_0x2aee('0xc1')](_0x55c743['id'],_0x5acaad,_0x5849fd,_0x55c743[_0x2aee('0x1fa')])[_0x2aee('0xb6')](function(_0x5d28c8){_0x55c743[_0x2aee('0x1f0')]-=_0x5849fd;_0x55c743['temp']=_0x55c743[_0x2aee('0x1f0')]>0x0?_0x55c743[_0x2aee('0x1f0')]:0x0;if(!checkContactEmpty(_0x5d28c8)){_0x266ea9['countReScheduled'](_0x55c743)[_0x2aee('0xb6')](sendMessageReschedule(_0x55c743))['catch'](loggerCatch(_0x2aee('0xb7')));}else{_0x55c743[_0x2aee('0x95')]+=_0x5d28c8[_0x2aee('0x93')];_0x55c743['message']=_0x55c743[_0x2aee('0x54')]===_0x2aee('0x8')?'ACTIVE':_0x2aee('0x1f2');for(var _0x3e5189=0x0;_0x3e5189<_0x5d28c8[_0x2aee('0x93')];_0x3e5189+=0x1){if(_[_0x2aee('0xac')](_0x5d28c8[_0x3e5189])||_[_0x2aee('0xac')](_0x5d28c8[_0x3e5189][_0x2aee('0x157')])||_['isNil'](_0x5d28c8[_0x3e5189][_0x2aee('0x157')][_0x2aee('0x158')])){_0x266ea9[_0x2aee('0xcc')]('[actionOriginate]\x20',_0x55c743,_0x5d28c8[_0x3e5189]);}else{_0x266ea9['checkIsBlackList'](_[_0x2aee('0xce')](_0x5d28c8[_0x3e5189],[_0x2aee('0xd1'),'Contact.phone']))[_0x2aee('0xb6')](_0x266ea9['checkContactBlack'](_0x55c743,_0x5d28c8[_0x3e5189]))['catch'](_0x266ea9['loggerHandler'](_0x2aee('0x1f4'),_0x55c743));}}}})['catch'](loggerGetContactDialer(_0x2aee('0x1fb'),_0x55c743,_0x5849fd));}};Dialer['prototype'][_0x2aee('0x8a')]=function(_0xe17798){var _0x3c9c84=this;if(_0xe17798[_0x2aee('0x1f8')]>0x0){var _0x4b3d9d=_0xe17798[_0x2aee('0x1f8')]-_0xe17798[_0x2aee('0x95')]-_0xe17798[_0x2aee('0x4f')];if(_0x4b3d9d>0x0){this[_0x2aee('0x1fc')](_0xe17798);}else{loggerPredictiveCalls[_0x2aee('0x78')](_0x2aee('0x1fd'));}}else{this[_0x2aee('0x1fc')](_0xe17798);}};Dialer[_0x2aee('0x19')][_0x2aee('0x1fc')]=function(_0x5e0474){var _0x53d07e=this;var _0x2f022b=[];_0x5e0474[_0x2aee('0x95')]+=0x1;for(var _0x2b8d86 in this[_0x2aee('0x20')]){if(this[_0x2aee('0x20')][_0x2aee('0x94')](_0x2b8d86)){if(this[_0x2aee('0x20')][_0x2b8d86]['state']===_0x2aee('0x1f9')&&this[_0x2aee('0x20')][_0x2b8d86][_0x2aee('0xad')]==='reachable'){_0x2f022b[_0x2aee('0x135')](this[_0x2aee('0x20')][_0x2b8d86]['id']);}}}this[_0x2aee('0xc1')](_0x5e0474['id'],_0x2f022b,0x1,_0x5e0474[_0x2aee('0x1fa')])[_0x2aee('0xb6')](function(_0x5a9e89){if(!checkContactEmpty(_0x5a9e89)){checkContactLowerLimitOriginate(_0x5e0474,0x1,0x0);_0x53d07e['countReScheduled'](_0x5e0474)[_0x2aee('0xb6')](sendMessageReschedule(_0x5e0474))[_0x2aee('0xaf')](loggerCatch(_0x2aee('0xb7')));}else{_0x5e0474[_0x2aee('0x39')]='RUNNING';if(_['isNil'](_0x5a9e89[0x0])||_['isNil'](_0x5a9e89[0x0][_0x2aee('0x157')])||_['isNil'](_0x5a9e89[0x0][_0x2aee('0x157')][_0x2aee('0x158')])){_0x53d07e[_0x2aee('0xcc')](_0x2aee('0x1f4'),_0x5e0474,_0x5a9e89[0x0]);}else{_0x53d07e[_0x2aee('0xb8')](_[_0x2aee('0xce')](_0x5a9e89[0x0],['VoiceQueueId',_0x2aee('0x1f5')]))[_0x2aee('0xb6')](_0x53d07e['checkContactBlack'](_0x5e0474,_0x5a9e89[0x0]))[_0x2aee('0xaf')](_0x53d07e[_0x2aee('0xcb')]('[actionOriginatePredictive]\x20',_0x5e0474));}}})[_0x2aee('0xaf')](loggerGetContactDialer(_0x2aee('0x1fe'),_0x5e0474,0x1));emitVoiceQueueSummary(_0x5e0474);};Dialer[_0x2aee('0x19')][_0x2aee('0x1d4')]=function(_0x224105,_0x5426ba,_0x49eacb,_0x3a1e2d,_0x13b6d6,_0x51fb49){loggerPredictive[_0x2aee('0x78')](_0x2aee('0x1ff'));loggerPredictive[_0x2aee('0x78')](_0x2aee('0x200'),_0x224105);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x201'),_0x5426ba);loggerPredictive['info'](_0x2aee('0x202'),_0x49eacb);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x203'),_0x3a1e2d);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x204'),_0x13b6d6);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x80'));return new BPromise(function(_0x406ae9,_0x45041f){if(_0x224105<=0x0||isNaN(_0x224105)){return _0x45041f(msgResponse(_0x2aee('0x205'),_0x2aee('0x206'),'m\x20=\x20'+_0x224105));}if(_0x49eacb<=0x0||isNaN(_0x49eacb)){return _0x45041f(msgResponse(_0x2aee('0x205'),_0x2aee('0x206'),'Ts\x20=\x20'+_0x49eacb));}if(_0x3a1e2d<=0x0||isNaN(_0x3a1e2d)){return _0x45041f(msgResponse(_0x2aee('0x205'),_0x2aee('0x206'),'p\x20=\x20'+_0x3a1e2d));}if(_0x5426ba<=0x0||isNaN(_0x5426ba)){return _0x45041f(msgResponse('[abandonmentRate]','Error',_0x2aee('0x207')+_0x5426ba));}if(_0x13b6d6<=0x0||isNaN(_0x13b6d6)){return _0x45041f(msgResponse(_0x2aee('0x205'),_0x2aee('0x206'),'Amax\x20=\x20'+_0x13b6d6));}_0x51fb49=_0x51fb49||0x0;var _0x2e033a=0x1/_0x49eacb;var _0xd3f582=0x0;var _0x113e90=0x0;var _0x569553=0x0;var _0x4564cd=0x0;for(var _0x5b79d4=0x0;_0x569553<_0x13b6d6;_0x5b79d4+=0x1){_0x113e90=_0x5b79d4/_0x5426ba;_0xd3f582=(_0x3a1e2d*_0x113e90+_0x51fb49)/_0x2e033a;_0x569553=erlangb(_0xd3f582,_0x224105);_0x4564cd=_0xd3f582/_0x224105*(0x1-erlangb(_0xd3f582,_0x224105));}return _0x406ae9({'erlangCalls':_0x5b79d4,'erlangCallToSecond':_0x5426ba/_0x5b79d4,'erlangAbandonmentRate':_0x569553,'erlangBusyFactor':_0x4564cd});});};Dialer[_0x2aee('0x19')][_0x2aee('0x1d5')]=function(_0xc3b894,_0x12c4a0,_0x2061ab,_0x180f12,_0x51d8dd,_0x33e2f2){loggerPredictive[_0x2aee('0x78')](_0x2aee('0x208'));loggerPredictive[_0x2aee('0x78')](_0x2aee('0x200'),_0xc3b894);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x201'),_0x12c4a0);loggerPredictive[_0x2aee('0x78')]('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',_0x2061ab);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x203'),_0x180f12);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x209'),_0x51d8dd);loggerPredictive[_0x2aee('0x78')](_0x2aee('0x80'));return new BPromise(function(_0x260f13,_0x4594b1){if(_0xc3b894<=0x0||isNaN(_0xc3b894)){return _0x4594b1(msgResponse(_0x2aee('0x20a'),_0x2aee('0x206'),_0x2aee('0x20b')+_0xc3b894));}if(_0x2061ab<=0x0||isNaN(_0x2061ab)){return _0x4594b1(msgResponse(_0x2aee('0x20a'),_0x2aee('0x206'),_0x2aee('0x20c')+_0x2061ab));}if(_0x180f12<=0x0||isNaN(_0x180f12)){return _0x4594b1(msgResponse(_0x2aee('0x20a'),_0x2aee('0x206'),_0x2aee('0x20d')+_0x180f12));}if(_0x12c4a0<=0x0||isNaN(_0x12c4a0)){return _0x4594b1(msgResponse(_0x2aee('0x20a'),_0x2aee('0x206'),'interval\x20=\x20'+_0x12c4a0));}if(_0x51d8dd<=0x0||isNaN(_0x51d8dd)){return _0x4594b1(msgResponse('[busyFactor]',_0x2aee('0x206'),_0x2aee('0x20e')+_0x51d8dd));}_0x33e2f2=_0x33e2f2||0x0;var _0x2f2217=0x1/_0x2061ab;var _0x5d3205=0x0;var _0x3840ad=0x0;var _0x50e96d=0x0;var _0xced6f1=0x0;for(var _0x383a87=0x0;_0xced6f1<_0x51d8dd;_0x383a87+=0x1){_0x3840ad=_0x383a87/_0x12c4a0;_0x5d3205=(_0x180f12*_0x3840ad+_0x33e2f2)/_0x2f2217;_0x50e96d=erlangb(_0x5d3205,_0xc3b894);_0xced6f1=_0x5d3205/_0xc3b894*(0x1-erlangb(_0x5d3205,_0xc3b894));}return _0x260f13({'erlangCalls':_0x383a87,'erlangCallToSecond':_0x12c4a0/_0x383a87,'erlangAbandonmentRate':_0x50e96d,'erlangBusyFactor':_0xced6f1});});};module[_0x2aee('0x20f')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5460f5e..71c28aa 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 _0x40d4=['starttime','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','number','responsetime','droptime','endtime','ringtime'];(function(_0x568039,_0x570f8e){var _0x1595fc=function(_0x50ac8f){while(--_0x50ac8f){_0x568039['push'](_0x568039['shift']());}};_0x1595fc(++_0x570f8e);}(_0x40d4,0x180));var _0x440d=function(_0x53d417,_0x3d183e){_0x53d417=_0x53d417-0x0;var _0x105e40=_0x40d4[_0x53d417];return _0x105e40;};'use strict';var util=require(_0x440d('0x0'));var _=require('lodash');var moment=require(_0x440d('0x1'));function getSeconds(_0x38fbd3,_0x2a5311){var _0x949a07=moment(_0x38fbd3)[_0x440d('0x2')](0x0);var _0x4ae496=moment(_0x2a5311)['milliseconds'](0x0);return _0x949a07[_0x440d('0x3')](_0x4ae496,'seconds');}function QueueCallerAbandon(_0x14c41b,_0x3212e0){this[_0x440d('0x4')]=_0x14c41b['scheduledat'];this[_0x440d('0x5')]=_0x14c41b[_0x440d('0x5')];this[_0x440d('0x6')]=_0x14c41b[_0x440d('0x5')]===_0x440d('0x7')?_0x440d('0x8'):_0x14c41b[_0x440d('0x5')];this[_0x440d('0x9')]=_0x14c41b[_0x440d('0x9')];this['countcongestionretry']=_0x14c41b[_0x440d('0xa')];this[_0x440d('0xb')]=_0x14c41b[_0x440d('0xb')];this[_0x440d('0xc')]=_0x14c41b[_0x440d('0x9')]+_0x14c41b[_0x440d('0xa')]+_0x14c41b[_0x440d('0xb')]+_0x14c41b['countnosuchnumberretry']+_0x14c41b[_0x440d('0xd')]+_0x14c41b[_0x440d('0xe')]+_0x14c41b['countmachineretry']+_0x14c41b[_0x440d('0xf')];this['countnosuchnumberretry']=_0x14c41b[_0x440d('0x10')];this[_0x440d('0xd')]=_0x14c41b[_0x440d('0xd')];this[_0x440d('0xe')]=_0x14c41b[_0x440d('0xe')];this['countmachineretry']=_0x14c41b[_0x440d('0x11')];this[_0x440d('0xf')]=_0x14c41b[_0x440d('0xf')];this[_0x440d('0x12')]=_0x3212e0[_0x440d('0x12')];this[_0x440d('0x13')]=_0x14c41b[_0x440d('0x14')];this['calleridnum']=_0x14c41b[_0x440d('0x15')];this['starttime']=_0x14c41b['starttime'];this[_0x440d('0x16')]=_0x14c41b[_0x440d('0x16')];this[_0x440d('0x17')]=_0x14c41b[_0x440d('0x17')];this[_0x440d('0x18')]=this['droptime'];this[_0x440d('0x19')]=getSeconds(_0x14c41b[_0x440d('0x16')],_0x14c41b[_0x440d('0x1a')]);this[_0x440d('0x1b')]=getSeconds(this[_0x440d('0x17')],_0x14c41b[_0x440d('0x16')]);this[_0x440d('0x1c')]=0x0;this[_0x440d('0x8')]=_0x3212e0[_0x440d('0x8')];this['membername']=_0x3212e0['connectedlinename'];this[_0x440d('0x1d')]=_0x3212e0[_0x440d('0x1d')];this[_0x440d('0x1e')]=_0x14c41b[_0x440d('0x1e')];this[_0x440d('0x1f')]=_0x14c41b[_0x440d('0x1f')];this[_0x440d('0x20')]=_0x14c41b['callbackat'];this[_0x440d('0x21')]=_0x14c41b[_0x440d('0x21')];this['ContactId']=_0x14c41b[_0x440d('0x22')];this[_0x440d('0x23')]=_0x14c41b[_0x440d('0x23')];this['UserId']=_0x14c41b[_0x440d('0x24')];this[_0x440d('0x25')]=_0x14c41b[_0x440d('0x25')];this['CampaignId']=_0x14c41b[_0x440d('0x26')];this[_0x440d('0x27')]=_0x14c41b[_0x440d('0x27')]||'';this['originatecalleridname']=_0x14c41b[_0x440d('0x28')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xeb93=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','talktime','membername','connectedlinename','reason','callback'];(function(_0x2c4d31,_0x21f3a8){var _0x3a9785=function(_0x1fb5b8){while(--_0x1fb5b8){_0x2c4d31['push'](_0x2c4d31['shift']());}};_0x3a9785(++_0x21f3a8);}(_0xeb93,0xd1));var _0x3eb9=function(_0x1be584,_0xcb595){_0x1be584=_0x1be584-0x0;var _0x5c60d2=_0xeb93[_0x1be584];return _0x5c60d2;};'use strict';var util=require(_0x3eb9('0x0'));var _=require(_0x3eb9('0x1'));var moment=require('moment');function getSeconds(_0x40b229,_0x45e628){var _0x2a8c06=moment(_0x40b229)[_0x3eb9('0x2')](0x0);var _0x273ae5=moment(_0x45e628)[_0x3eb9('0x2')](0x0);return _0x2a8c06['diff'](_0x273ae5,_0x3eb9('0x3'));}function QueueCallerAbandon(_0x30ecaa,_0x1a6785){this[_0x3eb9('0x4')]=_0x30ecaa[_0x3eb9('0x4')];this['type']=_0x30ecaa[_0x3eb9('0x5')];this[_0x3eb9('0x6')]=_0x30ecaa[_0x3eb9('0x5')]===_0x3eb9('0x7')?_0x3eb9('0x8'):_0x30ecaa[_0x3eb9('0x5')];this['countbusyretry']=_0x30ecaa['countbusyretry'];this[_0x3eb9('0x9')]=_0x30ecaa[_0x3eb9('0x9')];this[_0x3eb9('0xa')]=_0x30ecaa[_0x3eb9('0xa')];this['countglobal']=_0x30ecaa[_0x3eb9('0xb')]+_0x30ecaa[_0x3eb9('0x9')]+_0x30ecaa[_0x3eb9('0xa')]+_0x30ecaa[_0x3eb9('0xc')]+_0x30ecaa['countdropretry']+_0x30ecaa[_0x3eb9('0xd')]+_0x30ecaa[_0x3eb9('0xe')]+_0x30ecaa[_0x3eb9('0xf')];this[_0x3eb9('0xc')]=_0x30ecaa[_0x3eb9('0xc')];this[_0x3eb9('0x10')]=_0x30ecaa['countdropretry'];this[_0x3eb9('0xd')]=_0x30ecaa[_0x3eb9('0xd')];this[_0x3eb9('0xe')]=_0x30ecaa[_0x3eb9('0xe')];this[_0x3eb9('0xf')]=_0x30ecaa[_0x3eb9('0xf')];this[_0x3eb9('0x11')]=_0x1a6785['uniqueid'];this[_0x3eb9('0x12')]=_0x30ecaa[_0x3eb9('0x13')];this[_0x3eb9('0x14')]=_0x30ecaa[_0x3eb9('0x15')];this[_0x3eb9('0x16')]=_0x30ecaa[_0x3eb9('0x16')];this[_0x3eb9('0x17')]=_0x30ecaa[_0x3eb9('0x17')];this[_0x3eb9('0x18')]=_0x30ecaa[_0x3eb9('0x18')];this[_0x3eb9('0x19')]=this[_0x3eb9('0x18')];this['ringtime']=getSeconds(_0x30ecaa[_0x3eb9('0x17')],_0x30ecaa['starttime']);this['holdtime']=getSeconds(this[_0x3eb9('0x18')],_0x30ecaa[_0x3eb9('0x17')]);this[_0x3eb9('0x1a')]=0x0;this[_0x3eb9('0x8')]=_0x1a6785[_0x3eb9('0x8')];this[_0x3eb9('0x1b')]=_0x1a6785[_0x3eb9('0x1c')];this[_0x3eb9('0x1d')]=_0x1a6785[_0x3eb9('0x1d')];this[_0x3eb9('0x1e')]=_0x30ecaa['callback'];this[_0x3eb9('0x1f')]=_0x30ecaa[_0x3eb9('0x1f')];this['callbackat']=_0x30ecaa[_0x3eb9('0x20')];this['recallme']=_0x30ecaa[_0x3eb9('0x21')];this[_0x3eb9('0x22')]=_0x30ecaa[_0x3eb9('0x22')];this[_0x3eb9('0x23')]=_0x30ecaa[_0x3eb9('0x23')];this[_0x3eb9('0x24')]=_0x30ecaa['UserId'];this[_0x3eb9('0x25')]=_0x30ecaa[_0x3eb9('0x25')];this[_0x3eb9('0x26')]=_0x30ecaa[_0x3eb9('0x26')];this[_0x3eb9('0x27')]=_0x30ecaa['originatecalleridnum']||'';this['originatecalleridname']=_0x30ecaa['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 26d96ea..67a33a3 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 _0x4b7c=['lodash','moment','uniqueid','channel','format','tech','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId','exports','util'];(function(_0x5650d7,_0x51f443){var _0x42431d=function(_0x5262c2){while(--_0x5262c2){_0x5650d7['push'](_0x5650d7['shift']());}};_0x42431d(++_0x51f443);}(_0x4b7c,0x1df));var _0xc4b7=function(_0x2aaa25,_0x2490db){_0x2aaa25=_0x2aaa25-0x0;var _0x5daac3=_0x4b7c[_0x2aaa25];return _0x5daac3;};'use strict';var util=require(_0xc4b7('0x0'));var _=require(_0xc4b7('0x1'));var moment=require(_0xc4b7('0x2'));function Action(_0x3fa093,_0x188177,_0xed1125){this[_0xc4b7('0x3')]=_0x3fa093||undefined;this[_0xc4b7('0x4')]=util[_0xc4b7('0x5')]('%s/%s/%s',_0x188177[_0xc4b7('0x6')],_0x188177[_0xc4b7('0x7')][_0xc4b7('0x8')],_0xed1125[_0xc4b7('0x9')]);this[_0xc4b7('0xa')]=_0x188177[_0xc4b7('0xa')];this[_0xc4b7('0xb')]=_0x188177[_0xc4b7('0xb')];this[_0xc4b7('0xc')]=_0xed1125[_0xc4b7('0xc')];this['AttachmentId']=_0xed1125[_0xc4b7('0xd')];}module[_0xc4b7('0xe')]=Action; \ No newline at end of file +var _0x993e=['util','lodash','moment','channel','format','tech','Trunk','fax','localstationid','headerinfo','path','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x993e,0x150));var _0xe993=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x993e[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0xe993('0x0'));var _=require(_0xe993('0x1'));var moment=require(_0xe993('0x2'));function Action(_0x42180a,_0x2eda02,_0x200f16){this['uniqueid']=_0x42180a||undefined;this[_0xe993('0x3')]=util[_0xe993('0x4')]('%s/%s/%s',_0x2eda02[_0xe993('0x5')],_0x2eda02[_0xe993('0x6')]['name'],_0x200f16[_0xe993('0x7')]);this['localstationid']=_0x2eda02[_0xe993('0x8')];this[_0xe993('0x9')]=_0x2eda02[_0xe993('0x9')];this[_0xe993('0xa')]=_0x200f16[_0xe993('0xa')];this['AttachmentId']=_0x200f16['AttachmentId'];}module[_0xe993('0xb')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index cfdda5d..ede57d9 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 _0xf272=['SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','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','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','trunks','actions','newchannel','syncNewchannel','varset','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','context','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','application/pdf','notify','catch','\x20notify\x20','\x20receiveFax\x20','stringify','syncOriginateResponse','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0xf272,0x9f));var _0x2f27=function(_0x3c6c43,_0x390ad8){_0x3c6c43=_0x3c6c43-0x0;var _0x351e19=_0xf272[_0x3c6c43];return _0x351e19;};'use strict';var util=require(_0x2f27('0x0'));var _=require(_0x2f27('0x1'));var BPromise=require(_0x2f27('0x2'));var uuid=require('uuid');var moment=require(_0x2f27('0x3'));var path=require(_0x2f27('0x4'));var tiff2pdf=require(_0x2f27('0x5'));var gs=require('./util/gs');var logger=require(_0x2f27('0x6'))(_0x2f27('0x7'));var ami=require(_0x2f27('0x8'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x2f27('0x9'));var Action=require(_0x2f27('0xa'));var faxAccount=require(_0x2f27('0xb'));var attachment=require(_0x2f27('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x3e9bee){this[_0x2f27('0xd')]={};this['faxAccounts']=_0x3e9bee['faxAccounts'];this[_0x2f27('0xe')]=_0x3e9bee[_0x2f27('0xe')];this[_0x2f27('0xf')]={};ami['on'](_0x2f27('0x10'),this[_0x2f27('0x11')]['bind'](this));ami['on'](_0x2f27('0x12'),this['syncVarSet'][_0x2f27('0x13')](this));ami['on'](_0x2f27('0x14'),this[_0x2f27('0x15')][_0x2f27('0x13')](this));ami['on'](_0x2f27('0x16'),this[_0x2f27('0x17')][_0x2f27('0x13')](this));ami['on'](_0x2f27('0x18'),this[_0x2f27('0x19')]['bind'](this));ami['on'](_0x2f27('0x1a'),this[_0x2f27('0x1b')][_0x2f27('0x13')](this));ami['on'](_0x2f27('0x1c'),this[_0x2f27('0x1d')][_0x2f27('0x13')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x2f27('0x13')](this));}Fax[_0x2f27('0x1e')][_0x2f27('0x11')]=function(_0x472489){if(_0x472489[_0x2f27('0x1f')]==='from-voip-provider'){for(var _0xa7988e in this[_0x2f27('0x20')]){if(this[_0x2f27('0x20')][_0x2f27('0x21')](_0xa7988e)){if(_0x472489[_0x2f27('0x22')]===this[_0x2f27('0x20')][_0xa7988e][_0x2f27('0x23')]){this['channels'][_0x472489[_0x2f27('0x24')]]={};this[_0x2f27('0xd')][_0x472489[_0x2f27('0x24')]][_0x2f27('0x25')]=_0x472489['channel'];this[_0x2f27('0xd')][_0x472489['uniqueid']]['id']=this[_0x2f27('0x20')][_0xa7988e]['id'];this['channels'][_0x472489[_0x2f27('0x24')]][_0x2f27('0x26')]=this[_0x2f27('0x20')][_0xa7988e][_0x2f27('0x26')];logger[_0x2f27('0x27')](_0x472489[_0x2f27('0x24')],'\x20syncNewchannel\x20');}}}}if(this[_0x2f27('0xf')][_0x472489[_0x2f27('0x24')]]){this[_0x2f27('0xd')][_0x472489[_0x2f27('0x24')]]={};this[_0x2f27('0xd')][_0x472489[_0x2f27('0x24')]][_0x2f27('0x25')]=_0x472489[_0x2f27('0x25')];logger[_0x2f27('0x27')](_0x472489[_0x2f27('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x2f27('0x1e')][_0x2f27('0x28')]=function(_0x23f53f){if(this[_0x2f27('0xd')][_0x23f53f[_0x2f27('0x24')]]){for(var _0x5958e0 in _0x23f53f['variable']){if(_0x23f53f[_0x2f27('0x29')][_0x2f27('0x21')](_0x5958e0)){this[_0x2f27('0xd')][_0x23f53f[_0x2f27('0x24')]][_0x5958e0]=_0x23f53f[_0x2f27('0x2a')];}}}};Fax[_0x2f27('0x1e')]['syncNewState']=function(_0x3d920c){if(this[_0x2f27('0xd')][_0x3d920c[_0x2f27('0x24')]]){this[_0x2f27('0xd')][_0x3d920c[_0x2f27('0x24')]]['channelstate']=_0x3d920c[_0x2f27('0x2b')];this[_0x2f27('0xd')][_0x3d920c['uniqueid']][_0x2f27('0x2c')]=_0x3d920c[_0x2f27('0x2c')];}};Fax[_0x2f27('0x1e')][_0x2f27('0x17')]=function(_0x3737ca){if(this[_0x2f27('0xd')][_0x3737ca['uniqueid']]){for(var _0x23ba51 in _0x3737ca['variable']){if(_0x3737ca[_0x2f27('0x29')][_0x2f27('0x21')](_0x23ba51)){this[_0x2f27('0xd')][_0x3737ca[_0x2f27('0x24')]][_0x23ba51]=_0x3737ca[_0x2f27('0x2a')];}}}};Fax[_0x2f27('0x1e')][_0x2f27('0x19')]=function(_0x1544c1){if(this['channels'][_0x1544c1[_0x2f27('0x24')]]){this['channels'][_0x1544c1[_0x2f27('0x24')]][_0x2f27('0x2d')]=_0x1544c1[_0x2f27('0x2d')];this[_0x2f27('0xd')][_0x1544c1[_0x2f27('0x24')]][_0x2f27('0x2e')]=_0x1544c1[_0x2f27('0x2e')];this[_0x2f27('0xd')][_0x1544c1[_0x2f27('0x24')]][_0x2f27('0x23')]=_0x1544c1[_0x2f27('0x23')];this[_0x2f27('0xd')][_0x1544c1[_0x2f27('0x24')]][_0x2f27('0x2f')]=_0x1544c1['filename'];logger['info'](_0x1544c1[_0x2f27('0x24')],_0x2f27('0x30'));}};Fax[_0x2f27('0x1e')]['syncReceiveFax']=function(_0x4b3b30){var _0x249f7f=this;if(this['channels'][_0x4b3b30[_0x2f27('0x24')]]){var _0x59e51f=this[_0x2f27('0xd')][_0x4b3b30['uniqueid']]['id'];this[_0x2f27('0xd')][_0x4b3b30[_0x2f27('0x24')]][_0x2f27('0x31')]=_0x4b3b30[_0x2f27('0x31')];this[_0x2f27('0xd')][_0x4b3b30[_0x2f27('0x24')]][_0x2f27('0x32')]=_0x4b3b30[_0x2f27('0x32')];this['channels'][_0x4b3b30['uniqueid']][_0x2f27('0x23')]=_0x4b3b30[_0x2f27('0x23')];this[_0x2f27('0xd')][_0x4b3b30[_0x2f27('0x24')]]['resolution']=_0x4b3b30[_0x2f27('0x33')];this[_0x2f27('0xd')][_0x4b3b30['uniqueid']]['transferrate']=_0x4b3b30[_0x2f27('0x34')];this[_0x2f27('0xd')][_0x4b3b30[_0x2f27('0x24')]][_0x2f27('0x2f')]=_0x4b3b30[_0x2f27('0x2f')];this['channels'][_0x4b3b30['uniqueid']][_0x2f27('0x35')]=_0x4b3b30[_0x2f27('0x35')];if(this[_0x2f27('0xd')][_0x4b3b30[_0x2f27('0x24')]][_0x2f27('0x32')]>0x0){tiff2pdf(_0x4b3b30['filename'],_0x2f27('0x36'),function(_0x57ccc4){logger[_0x2f27('0x27')](_0x4b3b30[_0x2f27('0x24')],_0x2f27('0x37'),_0x57ccc4[_0x2f27('0x38')]);attachment['create']({'name':path[_0x2f27('0x39')](_0x4b3b30[_0x2f27('0x2f')])[_0x2f27('0x26')],'basename':path[_0x2f27('0x39')](_0x4b3b30['filename'])[_0x2f27('0x26')]+'.pdf','type':_0x2f27('0x3a')})['then'](function(_0x276207){faxAccount[_0x2f27('0x3b')](_0x59e51f,{'from':_0x4b3b30[_0x2f27('0x35')],'mapKey':_0x2f27('0x7'),'body':path[_0x2f27('0x39')](_0x4b3b30[_0x2f27('0x2f')])['name']+'.pdf','AttachmentId':_0x276207['id']})[_0x2f27('0x3c')](function(_0x4f8c26){logger['error'](_0x4b3b30[_0x2f27('0x24')],_0x2f27('0x3d'),JSON['stringify'](_0x4f8c26));});})[_0x2f27('0x3c')](function(_0x32a10c){logger['error'](_0x4b3b30['uniqueid'],_0x2f27('0x3e'),JSON[_0x2f27('0x3f')](_0x32a10c));});});}logger[_0x2f27('0x27')](_0x4b3b30[_0x2f27('0x24')],_0x2f27('0x3e'));}};Fax['prototype'][_0x2f27('0x40')]=function(_0x51b1da){if(this['actions'][_0x51b1da[_0x2f27('0x24')]]){_['merge'](this[_0x2f27('0xd')][_0x51b1da[_0x2f27('0x24')]],_[_0x2f27('0x41')](_0x51b1da,[_0x2f27('0x42'),_0x2f27('0x43')]));}};function updateStatus(_0x52496a){if(_0x52496a[_0x2f27('0x44')]){faxMessage['update'](_0x52496a[_0x2f27('0x44')],{'failMessage':_0x2f27('0x45')})[_0x2f27('0x46')](function(_0x456c45){ut['logger']('[Fax][Message][Error][Updated]',_0x456c45);})[_0x2f27('0x3c')](function(_0x4127c6){ut[_0x2f27('0x47')](_0x2f27('0x48'),_0x4127c6);});}else{ut[_0x2f27('0x47')](_0x2f27('0x49'));}}Fax[_0x2f27('0x1e')][_0x2f27('0x4a')]=function(_0x246cc5,_0x4c91b2,_0x2ac705){var _0x59e31e=this;var _0x1902e5={};if(_0x4c91b2){_0x1902e5={'read':_0x4c91b2};}else{_0x1902e5={'failMessage':_0x2ac705};}if(this[_0x2f27('0xf')][_0x246cc5]['AttachmentId']){faxMessage[_0x2f27('0x4b')](this['actions'][_0x246cc5][_0x2f27('0x44')],_0x1902e5)[_0x2f27('0x46')](function(_0xd85247){ut[_0x2f27('0x47')](_0x2f27('0x4c'),_0xd85247);})['catch'](function(_0x161040){ut[_0x2f27('0x47')](_0x2f27('0x4d'),_0x161040);})[_0x2f27('0x4e')](function(){delete _0x59e31e[_0x2f27('0xd')][_0x246cc5];delete _0x59e31e[_0x2f27('0xf')][_0x246cc5];});}else{ut[_0x2f27('0x47')](_0x2f27('0x4f'));delete this[_0x2f27('0xd')][_0x246cc5];delete this[_0x2f27('0xf')][_0x246cc5];}};Fax[_0x2f27('0x1e')][_0x2f27('0x1d')]=function(_0x212e94){var _0x28009f=this;if(this[_0x2f27('0xd')][_0x212e94[_0x2f27('0x24')]]){if(this[_0x2f27('0xf')][_0x212e94[_0x2f27('0x24')]]){this['channels'][_0x212e94[_0x2f27('0x24')]]['id']=this[_0x2f27('0xf')][_0x212e94[_0x2f27('0x24')]]['id'];this[_0x2f27('0xd')][_0x212e94[_0x2f27('0x24')]]['name']=this[_0x2f27('0xf')][_0x212e94[_0x2f27('0x24')]]['name'];}logger[_0x2f27('0x27')](_0x212e94[_0x2f27('0x24')],this[_0x2f27('0xf')][_0x212e94[_0x2f27('0x24')]]?_0x2f27('0x50'):_0x2f27('0x51'),JSON['stringify'](this[_0x2f27('0xd')][_0x212e94[_0x2f27('0x24')]]));if(this['actions'][_0x212e94[_0x2f27('0x24')]]){if(this[_0x2f27('0xd')][_0x212e94[_0x2f27('0x24')]][_0x2f27('0x52')]>0x0&&this[_0x2f27('0xd')][_0x212e94[_0x2f27('0x24')]]['faxstatus']===_0x2f27('0x53')){this[_0x2f27('0x4a')](_0x212e94['uniqueid'],!![]);}else{this[_0x2f27('0x4a')](_0x212e94[_0x2f27('0x24')],![],this[_0x2f27('0xd')][_0x212e94[_0x2f27('0x24')]][_0x2f27('0x54')]?_0x2f27('0x55')+this[_0x2f27('0xd')][_0x212e94[_0x2f27('0x24')]][_0x2f27('0x54')]:'SENDING\x20FAILED');}}}};Fax[_0x2f27('0x1e')][_0x2f27('0x56')]=function(_0x1e3cd6){var _0x10a524=this;return new BPromise(function(_0x966cc5,_0x51a9c5){_0x10a524[_0x2f27('0x57')](_0x1e3cd6,_0x10a524['faxAccounts'][_0x1e3cd6['FaxAccountId']])['then'](function(_0x5e9d6c){ut[_0x2f27('0x47')](_0x2f27('0x58'),_0x5e9d6c);_0x966cc5(ut[_0x2f27('0x38')]('Fax\x20received'));})[_0x2f27('0x3c')](function(_0x26ef71){ut[_0x2f27('0x47')](_0x2f27('0x59'),_0x26ef71);updateStatus(_0x1e3cd6);_0x51a9c5(ut[_0x2f27('0x38')](_0x2f27('0x5a')));});});};Fax[_0x2f27('0x1e')][_0x2f27('0x5b')]=function(_0x51f13c){var _0x39d33a=this;return new BPromise(function(_0x30c812,_0x3ddbf3){var _0x345930=_0x39d33a[_0x2f27('0x5c')](_0x39d33a[_0x2f27('0x20')][_0x51f13c[_0x2f27('0x5d')]][_0x2f27('0x5e')],_0x51f13c);if(_0x345930[_0x2f27('0x5f')]){_0x30c812(ut[_0x2f27('0x38')](_0x2f27('0x60')));}else{_0x3ddbf3(ut['message'](_0x345930[_0x2f27('0x38')]));}});};function originate(_0x55569d,_0x3c397b,_0x31de4a){return new BPromise(function(_0x3814eb,_0xfcff90){if(_0x31de4a){var _0x3c8b57=util['format'](_0x2f27('0x61'),path['parse'](_0x55569d['path'])['name'],_0x55569d[_0x2f27('0x4')]);gs[_0x2f27('0x62')](_0x3c8b57)[_0x2f27('0x46')](function(){_0x55569d[_0x2f27('0x4')]=util[_0x2f27('0x63')](_0x2f27('0x64'),path[_0x2f27('0x39')](_0x55569d['path'])[_0x2f27('0x65')],path[_0x2f27('0x39')](_0x55569d['path'])[_0x2f27('0x26')]);_0x3c397b[_0x2f27('0x66')]=_0x55569d[_0x2f27('0x4')];ut['logger'](_0x2f27('0x67'),'');ami[_0x2f27('0x68')](ut[_0x2f27('0x69')](_0x55569d,_0x3c397b))['then'](function(_0x1fe2a1){_0x3814eb(_0x1fe2a1);})[_0x2f27('0x3c')](function(_0x435ff8){_0xfcff90(_0x435ff8);});})[_0x2f27('0x3c')](function(_0x1c3b70){_0xfcff90(_0x1c3b70);});}else{ami[_0x2f27('0x68')](ut[_0x2f27('0x69')](_0x55569d,_0x3c397b))['then'](function(_0x436245){_0x3814eb(_0x436245);})[_0x2f27('0x3c')](function(_0x5bdc32){_0xfcff90(_0x5bdc32);});}});}Fax[_0x2f27('0x1e')]['execOriginate']=function(_0x1defe6,_0x44e153){var _0x5a42af=this;return new BPromise(function(_0x35ed0f,_0x283c58){var _0x417d6b=uuid['v4']();var _0x114b72=ut[_0x2f27('0x6a')](_0x1defe6,_0x44e153);_0x5a42af[_0x2f27('0xf')][_0x417d6b]=new Action(_0x417d6b,_0x44e153,_0x1defe6);var _0x1e1b20=_0x5a42af[_0x2f27('0xf')][_0x417d6b];if(path[_0x2f27('0x39')](_0x1defe6['path'])[_0x2f27('0x6b')]==='.pdf'){originate(_0x1e1b20,_0x114b72,!![])[_0x2f27('0x46')](function(_0x2e0a84){_0x35ed0f(_0x2e0a84);})[_0x2f27('0x3c')](function(_0x459c1a){_0x283c58(_0x459c1a);});}else{originate(_0x1e1b20,_0x114b72,![])['then'](function(_0x4f80d3){_0x35ed0f(_0x4f80d3);})['catch'](function(_0x48a3c8){_0x283c58(_0x48a3c8);});}});};Fax[_0x2f27('0x1e')][_0x2f27('0x6c')]=function(_0x5049b8){return!_[_0x2f27('0x6d')](_0x5049b8)&&!_[_0x2f27('0x6d')](_0x5049b8[_0x2f27('0x26')])&&!_['isNil'](_0x5049b8['active'])&&_0x5049b8[_0x2f27('0x6e')]&&!_[_0x2f27('0x6d')](this[_0x2f27('0xe')][util['format'](_0x2f27('0x6f'),_0x5049b8[_0x2f27('0x26')])])&&!_[_0x2f27('0x6d')](this['trunks'][util[_0x2f27('0x63')](_0x2f27('0x6f'),_0x5049b8['name'])][_0x2f27('0x2e')])&&(this[_0x2f27('0xe')][util[_0x2f27('0x63')]('SIP/%s',_0x5049b8['name'])]['status']===_0x2f27('0x70')||this[_0x2f27('0xe')][util[_0x2f27('0x63')](_0x2f27('0x6f'),_0x5049b8[_0x2f27('0x26')])]['status']===_0x2f27('0x71'));};Fax[_0x2f27('0x1e')][_0x2f27('0x5c')]=function(_0x1a2221,_0x39f9df){if(!this['isTrunkReachable'](_0x1a2221)){ut[_0x2f27('0x47')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x2f27('0x6d')](_0x1a2221)?'':_0x1a2221['name']+_0x2f27('0x72'));return{'isValid':![],'message':_0x2f27('0x73')};}if(_[_0x2f27('0x6d')](_0x39f9df[_0x2f27('0x7')])){ut['logger'](_0x2f27('0x74'),JSON[_0x2f27('0x3f')](_0x39f9df));return{'isValid':![],'message':_0x2f27('0x75')};}if(_['isNil'](_0x39f9df[_0x2f27('0x4')])){ut[_0x2f27('0x47')](_0x2f27('0x76'),JSON[_0x2f27('0x3f')](_0x39f9df));return{'isValid':![],'message':_0x2f27('0x77')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x2f27('0x78')]=Fax; \ No newline at end of file +var _0x9efa=['XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','lodash','bluebird','uuid','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','context','from-voip-provider','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','prototype','channelstate','channelstatedesc','value','operation','status','filename','remotestationid','resolution','calleridnum','pagestransferred','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','error','\x20notify\x20','stringify','catch','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','update','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','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','%s/%s.tif','dir'];(function(_0x5533b8,_0x43577b){var _0x5e1510=function(_0x3e868a){while(--_0x3e868a){_0x5533b8['push'](_0x5533b8['shift']());}};_0x5e1510(++_0x43577b);}(_0x9efa,0x83));var _0xa9ef=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x9efa[_0x502c7d];return _0x30b7ed;};'use strict';var util=require('util');var _=require(_0xa9ef('0x0'));var BPromise=require(_0xa9ef('0x1'));var uuid=require(_0xa9ef('0x2'));var moment=require('moment');var path=require(_0xa9ef('0x3'));var tiff2pdf=require(_0xa9ef('0x4'));var gs=require('./util/gs');var logger=require(_0xa9ef('0x5'))(_0xa9ef('0x6'));var ami=require(_0xa9ef('0x7'));var rpcDb=require(_0xa9ef('0x8'));var Channel=require(_0xa9ef('0x9'));var ut=require(_0xa9ef('0xa'));var Action=require(_0xa9ef('0xb'));var faxAccount=require(_0xa9ef('0xc'));var attachment=require(_0xa9ef('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x21cbcc){this['channels']={};this[_0xa9ef('0xe')]=_0x21cbcc['faxAccounts'];this[_0xa9ef('0xf')]=_0x21cbcc[_0xa9ef('0xf')];this[_0xa9ef('0x10')]={};ami['on']('newchannel',this[_0xa9ef('0x11')]['bind'](this));ami['on'](_0xa9ef('0x12'),this[_0xa9ef('0x13')][_0xa9ef('0x14')](this));ami['on'](_0xa9ef('0x15'),this[_0xa9ef('0x16')][_0xa9ef('0x14')](this));ami['on'](_0xa9ef('0x17'),this[_0xa9ef('0x18')][_0xa9ef('0x14')](this));ami['on'](_0xa9ef('0x19'),this[_0xa9ef('0x1a')][_0xa9ef('0x14')](this));ami['on'](_0xa9ef('0x1b'),this[_0xa9ef('0x1c')][_0xa9ef('0x14')](this));ami['on']('hangup',this[_0xa9ef('0x1d')]['bind'](this));ami['on']('originateresponse',this[_0xa9ef('0x1e')]['bind'](this));}Fax['prototype'][_0xa9ef('0x11')]=function(_0x4e6b48){if(_0x4e6b48[_0xa9ef('0x1f')]===_0xa9ef('0x20')){for(var _0x591ddf in this[_0xa9ef('0xe')]){if(this[_0xa9ef('0xe')]['hasOwnProperty'](_0x591ddf)){if(_0x4e6b48[_0xa9ef('0x21')]===this['faxAccounts'][_0x591ddf][_0xa9ef('0x22')]){this[_0xa9ef('0x23')][_0x4e6b48[_0xa9ef('0x24')]]={};this[_0xa9ef('0x23')][_0x4e6b48['uniqueid']]['channel']=_0x4e6b48[_0xa9ef('0x25')];this[_0xa9ef('0x23')][_0x4e6b48['uniqueid']]['id']=this[_0xa9ef('0xe')][_0x591ddf]['id'];this[_0xa9ef('0x23')][_0x4e6b48[_0xa9ef('0x24')]][_0xa9ef('0x26')]=this[_0xa9ef('0xe')][_0x591ddf][_0xa9ef('0x26')];logger[_0xa9ef('0x27')](_0x4e6b48[_0xa9ef('0x24')],_0xa9ef('0x28'));}}}}if(this[_0xa9ef('0x10')][_0x4e6b48[_0xa9ef('0x24')]]){this[_0xa9ef('0x23')][_0x4e6b48[_0xa9ef('0x24')]]={};this[_0xa9ef('0x23')][_0x4e6b48[_0xa9ef('0x24')]][_0xa9ef('0x25')]=_0x4e6b48['channel'];logger[_0xa9ef('0x27')](_0x4e6b48[_0xa9ef('0x24')],_0xa9ef('0x28'));}};Fax['prototype'][_0xa9ef('0x13')]=function(_0x2418af){if(this[_0xa9ef('0x23')][_0x2418af['uniqueid']]){for(var _0x181c20 in _0x2418af[_0xa9ef('0x29')]){if(_0x2418af['variable']['hasOwnProperty'](_0x181c20)){this[_0xa9ef('0x23')][_0x2418af[_0xa9ef('0x24')]][_0x181c20]=_0x2418af['value'];}}}};Fax[_0xa9ef('0x2a')]['syncNewState']=function(_0x390d5a){if(this[_0xa9ef('0x23')][_0x390d5a[_0xa9ef('0x24')]]){this[_0xa9ef('0x23')][_0x390d5a['uniqueid']][_0xa9ef('0x2b')]=_0x390d5a['channelstate'];this[_0xa9ef('0x23')][_0x390d5a[_0xa9ef('0x24')]]['channelstatedesc']=_0x390d5a[_0xa9ef('0x2c')];}};Fax[_0xa9ef('0x2a')][_0xa9ef('0x18')]=function(_0x10ac14){if(this[_0xa9ef('0x23')][_0x10ac14[_0xa9ef('0x24')]]){for(var _0x238f7f in _0x10ac14[_0xa9ef('0x29')]){if(_0x10ac14[_0xa9ef('0x29')]['hasOwnProperty'](_0x238f7f)){this[_0xa9ef('0x23')][_0x10ac14[_0xa9ef('0x24')]][_0x238f7f]=_0x10ac14[_0xa9ef('0x2d')];}}}};Fax[_0xa9ef('0x2a')][_0xa9ef('0x1a')]=function(_0xb14a0b){if(this[_0xa9ef('0x23')][_0xb14a0b['uniqueid']]){this[_0xa9ef('0x23')][_0xb14a0b[_0xa9ef('0x24')]][_0xa9ef('0x2e')]=_0xb14a0b[_0xa9ef('0x2e')];this[_0xa9ef('0x23')][_0xb14a0b[_0xa9ef('0x24')]][_0xa9ef('0x2f')]=_0xb14a0b[_0xa9ef('0x2f')];this['channels'][_0xb14a0b[_0xa9ef('0x24')]][_0xa9ef('0x22')]=_0xb14a0b['localstationid'];this[_0xa9ef('0x23')][_0xb14a0b['uniqueid']][_0xa9ef('0x30')]=_0xb14a0b[_0xa9ef('0x30')];logger['info'](_0xb14a0b['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xa9ef('0x2a')]['syncReceiveFax']=function(_0x50103d){var _0x185342=this;if(this[_0xa9ef('0x23')][_0x50103d[_0xa9ef('0x24')]]){var _0x5ea129=this[_0xa9ef('0x23')][_0x50103d[_0xa9ef('0x24')]]['id'];this[_0xa9ef('0x23')][_0x50103d[_0xa9ef('0x24')]][_0xa9ef('0x31')]=_0x50103d[_0xa9ef('0x31')];this[_0xa9ef('0x23')][_0x50103d[_0xa9ef('0x24')]]['pagestransferred']=_0x50103d['pagestransferred'];this[_0xa9ef('0x23')][_0x50103d[_0xa9ef('0x24')]]['localstationid']=_0x50103d['localstationid'];this[_0xa9ef('0x23')][_0x50103d[_0xa9ef('0x24')]][_0xa9ef('0x32')]=_0x50103d[_0xa9ef('0x32')];this[_0xa9ef('0x23')][_0x50103d[_0xa9ef('0x24')]]['transferrate']=_0x50103d['transferrate'];this[_0xa9ef('0x23')][_0x50103d['uniqueid']][_0xa9ef('0x30')]=_0x50103d[_0xa9ef('0x30')];this['channels'][_0x50103d[_0xa9ef('0x24')]]['calleridnum']=_0x50103d[_0xa9ef('0x33')];if(this[_0xa9ef('0x23')][_0x50103d[_0xa9ef('0x24')]][_0xa9ef('0x34')]>0x0){tiff2pdf(_0x50103d[_0xa9ef('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x1b97bf){logger[_0xa9ef('0x27')](_0x50103d[_0xa9ef('0x24')],_0xa9ef('0x35'),_0x1b97bf[_0xa9ef('0x36')]);attachment[_0xa9ef('0x37')]({'name':path[_0xa9ef('0x38')](_0x50103d['filename'])['name'],'basename':path[_0xa9ef('0x38')](_0x50103d[_0xa9ef('0x30')])[_0xa9ef('0x26')]+_0xa9ef('0x39'),'type':_0xa9ef('0x3a')})[_0xa9ef('0x3b')](function(_0x45c706){faxAccount['notify'](_0x5ea129,{'from':_0x50103d[_0xa9ef('0x33')],'mapKey':'fax','body':path[_0xa9ef('0x38')](_0x50103d[_0xa9ef('0x30')])[_0xa9ef('0x26')]+_0xa9ef('0x39'),'AttachmentId':_0x45c706['id']})['catch'](function(_0x240f08){logger[_0xa9ef('0x3c')](_0x50103d[_0xa9ef('0x24')],_0xa9ef('0x3d'),JSON[_0xa9ef('0x3e')](_0x240f08));});})[_0xa9ef('0x3f')](function(_0x2ac745){logger[_0xa9ef('0x3c')](_0x50103d['uniqueid'],'\x20receiveFax\x20',JSON[_0xa9ef('0x3e')](_0x2ac745));});});}logger[_0xa9ef('0x27')](_0x50103d[_0xa9ef('0x24')],'\x20receiveFax\x20');}};Fax[_0xa9ef('0x2a')][_0xa9ef('0x1e')]=function(_0x4321c6){if(this['actions'][_0x4321c6[_0xa9ef('0x24')]]){_['merge'](this[_0xa9ef('0x23')][_0x4321c6[_0xa9ef('0x24')]],_[_0xa9ef('0x40')](_0x4321c6,[_0xa9ef('0x41'),'reason']));}};function updateStatus(_0x55db37){if(_0x55db37[_0xa9ef('0x42')]){faxMessage['update'](_0x55db37['AttachmentId'],{'failMessage':_0xa9ef('0x43')})['then'](function(_0x46af0a){ut[_0xa9ef('0x44')](_0xa9ef('0x45'),_0x46af0a);})[_0xa9ef('0x3f')](function(_0x4a350c){ut[_0xa9ef('0x44')](_0xa9ef('0x46'),_0x4a350c);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xa9ef('0x2a')]['updateStatus']=function(_0x2258a9,_0x14aa49,_0x1f3115){var _0x1afc1b=this;var _0x44677b={};if(_0x14aa49){_0x44677b={'read':_0x14aa49};}else{_0x44677b={'failMessage':_0x1f3115};}if(this[_0xa9ef('0x10')][_0x2258a9][_0xa9ef('0x42')]){faxMessage[_0xa9ef('0x47')](this[_0xa9ef('0x10')][_0x2258a9][_0xa9ef('0x42')],_0x44677b)['then'](function(_0xf898e4){ut['logger']('[Fax][Message][Updated]',_0xf898e4);})[_0xa9ef('0x3f')](function(_0x57a041){ut[_0xa9ef('0x44')]('[Fax][Message][NoUpdate1]',_0x57a041);})[_0xa9ef('0x48')](function(){delete _0x1afc1b['channels'][_0x2258a9];delete _0x1afc1b[_0xa9ef('0x10')][_0x2258a9];});}else{ut[_0xa9ef('0x44')](_0xa9ef('0x49'));delete this[_0xa9ef('0x23')][_0x2258a9];delete this['actions'][_0x2258a9];}};Fax[_0xa9ef('0x2a')]['syncHangup']=function(_0xa05a6a){var _0x2973f7=this;if(this['channels'][_0xa05a6a[_0xa9ef('0x24')]]){if(this['actions'][_0xa05a6a[_0xa9ef('0x24')]]){this[_0xa9ef('0x23')][_0xa05a6a[_0xa9ef('0x24')]]['id']=this[_0xa9ef('0x10')][_0xa05a6a['uniqueid']]['id'];this['channels'][_0xa05a6a[_0xa9ef('0x24')]]['name']=this[_0xa9ef('0x10')][_0xa05a6a['uniqueid']][_0xa9ef('0x26')];}logger[_0xa9ef('0x27')](_0xa05a6a['uniqueid'],this[_0xa9ef('0x10')][_0xa05a6a[_0xa9ef('0x24')]]?_0xa9ef('0x4a'):_0xa9ef('0x4b'),JSON['stringify'](this[_0xa9ef('0x23')][_0xa05a6a[_0xa9ef('0x24')]]));if(this[_0xa9ef('0x10')][_0xa05a6a[_0xa9ef('0x24')]]){if(this[_0xa9ef('0x23')][_0xa05a6a[_0xa9ef('0x24')]]['faxpages']>0x0&&this['channels'][_0xa05a6a[_0xa9ef('0x24')]][_0xa9ef('0x19')]===_0xa9ef('0x4c')){this['updateStatus'](_0xa05a6a[_0xa9ef('0x24')],!![]);}else{this[_0xa9ef('0x4d')](_0xa05a6a[_0xa9ef('0x24')],![],this[_0xa9ef('0x23')][_0xa05a6a[_0xa9ef('0x24')]][_0xa9ef('0x4e')]?_0xa9ef('0x4f')+this[_0xa9ef('0x23')][_0xa05a6a[_0xa9ef('0x24')]][_0xa9ef('0x4e')]:_0xa9ef('0x50'));}}}};Fax[_0xa9ef('0x2a')]['send']=function(_0x43d1f3){var _0x3b0081=this;return new BPromise(function(_0x445a5b,_0x4d816c){_0x3b0081[_0xa9ef('0x51')](_0x43d1f3,_0x3b0081[_0xa9ef('0xe')][_0x43d1f3[_0xa9ef('0x52')]])[_0xa9ef('0x3b')](function(_0x592bbd){ut[_0xa9ef('0x44')](_0xa9ef('0x53'),_0x592bbd);_0x445a5b(ut[_0xa9ef('0x36')](_0xa9ef('0x54')));})[_0xa9ef('0x3f')](function(_0x1591a5){ut[_0xa9ef('0x44')](_0xa9ef('0x55'),_0x1591a5);updateStatus(_0x43d1f3);_0x4d816c(ut[_0xa9ef('0x36')]('Fax\x20failed'));});});};Fax['prototype'][_0xa9ef('0x56')]=function(_0x36a186){var _0x2c5d55=this;return new BPromise(function(_0x10e883,_0x47565d){var _0x37c1c3=_0x2c5d55[_0xa9ef('0x57')](_0x2c5d55[_0xa9ef('0xe')][_0x36a186['FaxAccountId']][_0xa9ef('0x58')],_0x36a186);if(_0x37c1c3[_0xa9ef('0x59')]){_0x10e883(ut[_0xa9ef('0x36')](_0xa9ef('0x5a')));}else{_0x47565d(ut['message'](_0x37c1c3[_0xa9ef('0x36')]));}});};function originate(_0x222def,_0x55850e,_0x1c077e){return new BPromise(function(_0x3d7f51,_0x58338c){if(_0x1c077e){var _0x4134b8=util[_0xa9ef('0x5b')](_0xa9ef('0x5c'),path[_0xa9ef('0x38')](_0x222def[_0xa9ef('0x3')])[_0xa9ef('0x26')],_0x222def[_0xa9ef('0x3')]);gs['execute'](_0x4134b8)['then'](function(){_0x222def['path']=util[_0xa9ef('0x5b')](_0xa9ef('0x5d'),path[_0xa9ef('0x38')](_0x222def['path'])[_0xa9ef('0x5e')],path['parse'](_0x222def['path'])[_0xa9ef('0x26')]);_0x55850e[_0xa9ef('0x5f')]=_0x222def['path'];ut[_0xa9ef('0x44')](_0xa9ef('0x60'),'');ami[_0xa9ef('0x61')](ut['variablesAction'](_0x222def,_0x55850e))[_0xa9ef('0x3b')](function(_0x51850e){_0x3d7f51(_0x51850e);})[_0xa9ef('0x3f')](function(_0x18e760){_0x58338c(_0x18e760);});})[_0xa9ef('0x3f')](function(_0x1689f1){_0x58338c(_0x1689f1);});}else{ami['Action'](ut[_0xa9ef('0x62')](_0x222def,_0x55850e))[_0xa9ef('0x3b')](function(_0x38b8c6){_0x3d7f51(_0x38b8c6);})[_0xa9ef('0x3f')](function(_0xa7241e){_0x58338c(_0xa7241e);});}});}Fax[_0xa9ef('0x2a')][_0xa9ef('0x51')]=function(_0x4e6aa5,_0x371aad){var _0x5f5bb3=this;return new BPromise(function(_0x37d2f4,_0x2e7669){var _0x5e868a=uuid['v4']();var _0x4f2bf2=ut[_0xa9ef('0x63')](_0x4e6aa5,_0x371aad);_0x5f5bb3[_0xa9ef('0x10')][_0x5e868a]=new Action(_0x5e868a,_0x371aad,_0x4e6aa5);var _0x27e500=_0x5f5bb3[_0xa9ef('0x10')][_0x5e868a];if(path[_0xa9ef('0x38')](_0x4e6aa5['path'])['ext']===_0xa9ef('0x39')){originate(_0x27e500,_0x4f2bf2,!![])[_0xa9ef('0x3b')](function(_0x221bf7){_0x37d2f4(_0x221bf7);})[_0xa9ef('0x3f')](function(_0x5ec62f){_0x2e7669(_0x5ec62f);});}else{originate(_0x27e500,_0x4f2bf2,![])[_0xa9ef('0x3b')](function(_0x5bd2f3){_0x37d2f4(_0x5bd2f3);})[_0xa9ef('0x3f')](function(_0x2ff363){_0x2e7669(_0x2ff363);});}});};Fax['prototype'][_0xa9ef('0x64')]=function(_0x25a523){return!_['isNil'](_0x25a523)&&!_['isNil'](_0x25a523['name'])&&!_[_0xa9ef('0x65')](_0x25a523[_0xa9ef('0x66')])&&_0x25a523['active']&&!_['isNil'](this[_0xa9ef('0xf')][util[_0xa9ef('0x5b')]('SIP/%s',_0x25a523[_0xa9ef('0x26')])])&&!_[_0xa9ef('0x65')](this[_0xa9ef('0xf')][util['format'](_0xa9ef('0x67'),_0x25a523[_0xa9ef('0x26')])][_0xa9ef('0x2f')])&&(this[_0xa9ef('0xf')][util[_0xa9ef('0x5b')](_0xa9ef('0x67'),_0x25a523[_0xa9ef('0x26')])]['status']===_0xa9ef('0x68')||this[_0xa9ef('0xf')][util[_0xa9ef('0x5b')](_0xa9ef('0x67'),_0x25a523[_0xa9ef('0x26')])][_0xa9ef('0x2f')]===_0xa9ef('0x69'));};Fax['prototype'][_0xa9ef('0x57')]=function(_0x58641d,_0x423db6){if(!this['isTrunkReachable'](_0x58641d)){ut[_0xa9ef('0x44')](_0xa9ef('0x6a'),_[_0xa9ef('0x65')](_0x58641d)?'':_0x58641d[_0xa9ef('0x26')]+_0xa9ef('0x6b'));return{'isValid':![],'message':_0xa9ef('0x6c')};}if(_[_0xa9ef('0x65')](_0x423db6[_0xa9ef('0x6')])){ut[_0xa9ef('0x44')](_0xa9ef('0x6d'),JSON['stringify'](_0x423db6));return{'isValid':![],'message':_0xa9ef('0x6e')};}if(_['isNil'](_0x423db6[_0xa9ef('0x3')])){ut[_0xa9ef('0x44')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x423db6));return{'isValid':![],'message':_0xa9ef('0x6f')};}return{'isValid':!![],'message':_0xa9ef('0x70')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index aedae03..4c416b8 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 _0xc2e8=['resolve','then','util','bluebird','../../../config/logger','lodash','error','inspect','notify'];(function(_0x4cf30c,_0x230aa5){var _0x24802e=function(_0x94c2ce){while(--_0x94c2ce){_0x4cf30c['push'](_0x4cf30c['shift']());}};_0x24802e(++_0x230aa5);}(_0xc2e8,0x146));var _0x8c2e=function(_0x20f2fb,_0x78fdaa){_0x20f2fb=_0x20f2fb-0x0;var _0x7861ad=_0xc2e8[_0x20f2fb];return _0x7861ad;};'use strict';var util=require(_0x8c2e('0x0'));var BPromise=require(_0x8c2e('0x1'));var logger=require(_0x8c2e('0x2'))('preview');var _=require(_0x8c2e('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x15ad80){return function(_0x4afe6){logger[_0x8c2e('0x4')](_0x15ad80,util[_0x8c2e('0x5')](_0x4afe6,{'showHidden':![],'depth':null}));};}exports[_0x8c2e('0x6')]=function(_0x3c838d,_0x25a00b){return BPromise[_0x8c2e('0x7')]()[_0x8c2e('0x8')](faxAccount[_0x8c2e('0x6')](_0x3c838d,_0x25a00b))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xcf97=['notify','then','catch','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0x422b61,_0x4b96a1){var _0xd10bbe=function(_0x5137c5){while(--_0x5137c5){_0x422b61['push'](_0x422b61['shift']());}};_0xd10bbe(++_0x4b96a1);}(_0xcf97,0xeb));var _0x7cf9=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xcf97[_0x2a5099];return _0x2802f1;};'use strict';var util=require(_0x7cf9('0x0'));var BPromise=require('bluebird');var logger=require(_0x7cf9('0x1'))(_0x7cf9('0x2'));var _=require(_0x7cf9('0x3'));var faxAccount=require(_0x7cf9('0x4'));function loggerCatch(_0x36b0e3){return function(_0xb7d255){logger[_0x7cf9('0x5')](_0x36b0e3,util[_0x7cf9('0x6')](_0xb7d255,{'showHidden':![],'depth':null}));};}exports[_0x7cf9('0x7')]=function(_0x221b98,_0x572109){return BPromise['resolve']()[_0x7cf9('0x8')](faxAccount[_0x7cf9('0x7')](_0x221b98,_0x572109))[_0x7cf9('0x9')](loggerCatch(_0x7cf9('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index eee86ba..75eebbd 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 _0x124b=['child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0x4d9481,_0x38ba4a){var _0x4b0381=function(_0x25d9e5){while(--_0x25d9e5){_0x4d9481['push'](_0x4d9481['shift']());}};_0x4b0381(++_0x38ba4a);}(_0x124b,0x9f));var _0xb124=function(_0x5b3300,_0x3f7b35){_0x5b3300=_0x5b3300-0x0;var _0xe6e6bf=_0x124b[_0x5b3300];return _0xe6e6bf;};'use strict';var util=require(_0xb124('0x0'));var logger=require(_0xb124('0x1'))(_0xb124('0x2'));var BPromise=require('bluebird');var exec=require(_0xb124('0x3'))['exec'];exports[_0xb124('0x4')]=function(_0x5b7c04){return new BPromise(function(_0x1cf097,_0xbb350){exec(_0x5b7c04,function(_0x207d79,_0x48ea0b,_0x58e504){logger[_0xb124('0x5')]('Exec\x20gs',_0x48ea0b);if(_0x207d79){logger[_0xb124('0x5')](_0xb124('0x6'),_0xb124('0x7'),util[_0xb124('0x8')](_0x207d79,{'showHidden':![],'depth':null}),_0x48ea0b,_0x58e504);_0xbb350(_0x207d79);}_0x1cf097(_0x48ea0b);});});}; \ No newline at end of file +var _0x7683=['execute','info','Exec\x20gs','../../../../config/logger','fax','bluebird','child_process'];(function(_0x285735,_0x962484){var _0x144e31=function(_0x7d7da3){while(--_0x7d7da3){_0x285735['push'](_0x285735['shift']());}};_0x144e31(++_0x962484);}(_0x7683,0x1f4));var _0x3768=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x7683[_0x14a0a0];return _0x56b651;};'use strict';var util=require('util');var logger=require(_0x3768('0x0'))(_0x3768('0x1'));var BPromise=require(_0x3768('0x2'));var exec=require(_0x3768('0x3'))['exec'];exports[_0x3768('0x4')]=function(_0x20c400){return new BPromise(function(_0x5f204c,_0x128c13){exec(_0x20c400,function(_0x4bf9b3,_0x5c8719,_0x595eba){logger[_0x3768('0x5')](_0x3768('0x6'),_0x5c8719);if(_0x4bf9b3){logger['info'](_0x3768('0x6'),'\x20Error\x20:',util['inspect'](_0x4bf9b3,{'showHidden':![],'depth':null}),_0x5c8719,_0x595eba);_0x128c13(_0x4bf9b3);}_0x5f204c(_0x5c8719);});});}; \ 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 ee8fee8..3a26c9d 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 _0xb332=['message','logger','inspect','addVariables','headerinfo','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger'];(function(_0x4c1bc0,_0x2f14a4){var _0x4ed71b=function(_0x244d17){while(--_0x244d17){_0x4c1bc0['push'](_0x4c1bc0['shift']());}};_0x4ed71b(++_0x2f14a4);}(_0xb332,0xd9));var _0x2b33=function(_0x3048ea,_0x3838c2){_0x3048ea=_0x3048ea-0x0;var _0x1a13c4=_0xb332[_0x3048ea];return _0x1a13c4;};'use strict';var util=require(_0x2b33('0x0'));var _=require('lodash');var moment=require(_0x2b33('0x1'));var logger=require(_0x2b33('0x2'))('fax');exports[_0x2b33('0x3')]=function(_0x548a70){return{'message':_0x548a70};};exports[_0x2b33('0x4')]=function(_0x4c6634,_0x34b111){logger['info'](_0x4c6634,util[_0x2b33('0x5')](_0x34b111,{'showHidden':![],'depth':null}));};exports[_0x2b33('0x6')]=function(_0x478214,_0x461d44){var _0x5a7a3f={'XMF-ECM':_0x461d44['ecm'],'XMF-HEADERINFO':_0x461d44[_0x2b33('0x7')],'XMF-MINRATE':_0x461d44['minrate'],'XMF-MAXRATE':_0x461d44[_0x2b33('0x8')],'XMF-MODEM':util[_0x2b33('0x9')](_0x2b33('0xa'),_0x461d44[_0x2b33('0xb')]),'XMF-GATEWAY':_0x461d44['gateway'],'XMF-FAXDETECT':_0x461d44[_0x2b33('0xc')],'XMF-T38TIMEOUT':_0x461d44[_0x2b33('0xd')],'XMF-LOCALSTATIONID':_0x461d44[_0x2b33('0xe')],'XMF-PATH':_0x478214[_0x2b33('0xf')]};return _0x5a7a3f;};exports[_0x2b33('0x10')]=function(_0xf1e5e5,_0x5251b){return{'actionid':_0xf1e5e5[_0x2b33('0x11')],'action':_0x2b33('0x12'),'channel':_0xf1e5e5[_0x2b33('0x13')],'Exten':_0x2b33('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0x2b33('0x9')](_0x2b33('0x15'),_0xf1e5e5[_0x2b33('0x7')]?_0xf1e5e5['headerinfo']:'',_0xf1e5e5[_0x2b33('0xe')]),'variable':_0x5251b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xf1e5e5['uniqueid']};}; \ No newline at end of file +var _0xaa88=['message','logger','info','ecm','headerinfo','minrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaa88,0x137));var _0x8aa8=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0xaa88[_0x5aef17];return _0x43f9d0;};'use strict';var util=require(_0x8aa8('0x0'));var _=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var logger=require(_0x8aa8('0x3'))('fax');exports[_0x8aa8('0x4')]=function(_0x3a5b12){return{'message':_0x3a5b12};};exports[_0x8aa8('0x5')]=function(_0x3b2c88,_0x3e3b70){logger[_0x8aa8('0x6')](_0x3b2c88,util['inspect'](_0x3e3b70,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x460042,_0x5264ff){var _0x449d2d={'XMF-ECM':_0x5264ff[_0x8aa8('0x7')],'XMF-HEADERINFO':_0x5264ff[_0x8aa8('0x8')],'XMF-MINRATE':_0x5264ff[_0x8aa8('0x9')],'XMF-MAXRATE':_0x5264ff['maxrate'],'XMF-MODEM':util[_0x8aa8('0xa')](_0x8aa8('0xb'),_0x5264ff[_0x8aa8('0xc')]),'XMF-GATEWAY':_0x5264ff['gateway'],'XMF-FAXDETECT':_0x5264ff[_0x8aa8('0xd')],'XMF-T38TIMEOUT':_0x5264ff[_0x8aa8('0xe')],'XMF-LOCALSTATIONID':_0x5264ff[_0x8aa8('0xf')],'XMF-PATH':_0x460042[_0x8aa8('0x10')]};return _0x449d2d;};exports['variablesAction']=function(_0x3f8100,_0x30c114){return{'actionid':_0x3f8100['uniqueid'],'action':_0x8aa8('0x11'),'channel':_0x3f8100[_0x8aa8('0x12')],'Exten':_0x8aa8('0x13'),'Context':'from-sip','Priority':'1','callerid':util[_0x8aa8('0xa')](_0x8aa8('0x14'),_0x3f8100[_0x8aa8('0x8')]?_0x3f8100['headerinfo']:'',_0x3f8100[_0x8aa8('0xf')]),'variable':_0x30c114,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3f8100['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 48f80fa..09a91e0 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 _0x78f4=['initAgents','getTelephones','initTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','util','moment','./server','./realtime','./acw','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x78f4,0x1c8));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0x478f('0x0'));var moment=require(_0x478f('0x1'));var server=require(_0x478f('0x2'));var Realtime=require(_0x478f('0x3'));var Report=require('./report');var Acw=require(_0x478f('0x4'));var Trigger=require('./trigger');var Dialer=require(_0x478f('0x5'));var Preview=require(_0x478f('0x6'));var Fax=require(_0x478f('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0x478f('0x8'));var voiceQueueReport=require(_0x478f('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x478f('0xa'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x478f('0xb'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x478f('0xc'));var faxAccount=require(_0x478f('0xd'));var zendesk=require(_0x478f('0xe'));var salesforce=require(_0x478f('0xf'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x478f('0x10'));var zoho=require(_0x478f('0x11'));var vtiger=require(_0x478f('0x12'));var freshsales=require(_0x478f('0x13'));var servicenow=require(_0x478f('0x14'));var dynamics365=require(_0x478f('0x15'));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()[_0x478f('0x16')](_0x478f('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x478f('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x478f('0x18')]()[_0x478f('0x19')](user[_0x478f('0x1a')]())[_0x478f('0x19')](realtime[_0x478f('0x1b')]())[_0x478f('0x19')](user[_0x478f('0x1c')]())['then'](realtime[_0x478f('0x1d')]())[_0x478f('0x19')](trunk[_0x478f('0x1e')]())[_0x478f('0x19')](realtime['initTrunks']())[_0x478f('0x19')](voiceQueue['getVoiceQueues']())[_0x478f('0x19')](realtime[_0x478f('0x1f')]())['then'](trigger[_0x478f('0x20')]())['then'](realtime[_0x478f('0x21')]())[_0x478f('0x19')](template[_0x478f('0x22')]())[_0x478f('0x19')](realtime[_0x478f('0x23')]())[_0x478f('0x19')](zendesk[_0x478f('0x24')]())[_0x478f('0x19')](realtime[_0x478f('0x25')]())[_0x478f('0x19')](salesforce[_0x478f('0x26')]())[_0x478f('0x19')](realtime[_0x478f('0x27')]())[_0x478f('0x19')](sugarcrm[_0x478f('0x28')]())[_0x478f('0x19')](realtime[_0x478f('0x29')]())[_0x478f('0x19')](freshdesk[_0x478f('0x2a')]())[_0x478f('0x19')](realtime['initFreshdeskAccounts']())['then'](desk[_0x478f('0x2b')]())['then'](realtime[_0x478f('0x2c')]())[_0x478f('0x19')](zoho[_0x478f('0x2d')]())[_0x478f('0x19')](realtime[_0x478f('0x2e')]())[_0x478f('0x19')](vtiger['getVtigerAccounts']())[_0x478f('0x19')](realtime[_0x478f('0x2f')]())['then'](freshsales[_0x478f('0x30')]())['then'](realtime[_0x478f('0x31')]())['then'](servicenow[_0x478f('0x32')]())[_0x478f('0x19')](realtime[_0x478f('0x33')]())[_0x478f('0x19')](dynamics365[_0x478f('0x34')]())[_0x478f('0x19')](realtime[_0x478f('0x35')]())[_0x478f('0x19')](campaign[_0x478f('0x36')]())[_0x478f('0x19')](realtime[_0x478f('0x37')]())[_0x478f('0x19')](voiceExtension[_0x478f('0x38')]())[_0x478f('0x19')](realtime[_0x478f('0x39')]())[_0x478f('0x19')](faxAccount[_0x478f('0x3a')]())[_0x478f('0x19')](realtime['initFaxAccounts']())[_0x478f('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0x478f('0x18')]()['then'](voiceQueueReport[_0x478f('0x3b')]())[_0x478f('0x19')](realtime[_0x478f('0x3c')]())[_0x478f('0x19')](cmHopperHistory[_0x478f('0x3d')]())[_0x478f('0x19')](realtime['initVoiceQueueHopperHistory']())[_0x478f('0x19')](cmHopperHistory[_0x478f('0x3e')]())[_0x478f('0x19')](realtime[_0x478f('0x3f')]())[_0x478f('0x19')](voiceCallReport[_0x478f('0x40')]())[_0x478f('0x19')](realtime['initVoiceCallReports']())[_0x478f('0x19')](function(_0x250c92){})[_0x478f('0x41')](function(_0x25abab){console[_0x478f('0x42')](_0x25abab);});}function main(){return server[_0x478f('0x43')](realtime,preview,fax)[_0x478f('0x19')](function(_0x39a006){return initRealtime();})['then'](function(){return initParams();})[_0x478f('0x19')](function(){report[_0x478f('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x13c80b){console['log'](_0x13c80b);});}main(); \ No newline at end of file +var _0x7924=['getDeskAccounts','initDeskAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','log','listen','sync','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts'];(function(_0x53dd6f,_0x1baf6c){var _0x5659bd=function(_0x16e4cd){while(--_0x16e4cd){_0x53dd6f['push'](_0x53dd6f['shift']());}};_0x5659bd(++_0x1baf6c);}(_0x7924,0x19c));var _0x4792=function(_0x2f31b1,_0x17daa8){_0x2f31b1=_0x2f31b1-0x0;var _0x448988=_0x7924[_0x2f31b1];return _0x448988;};'use strict';var BPromise=require(_0x4792('0x0'));var util=require('util');var moment=require(_0x4792('0x1'));var server=require(_0x4792('0x2'));var Realtime=require(_0x4792('0x3'));var Report=require(_0x4792('0x4'));var Acw=require(_0x4792('0x5'));var Trigger=require(_0x4792('0x6'));var Dialer=require(_0x4792('0x7'));var Preview=require(_0x4792('0x8'));var Fax=require(_0x4792('0x9'));var user=require(_0x4792('0xa'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x4792('0xb'));var voiceCallReport=require(_0x4792('0xc'));var trunk=require(_0x4792('0xd'));var trigger=require(_0x4792('0xe'));var template=require(_0x4792('0xf'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x4792('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x4792('0x11'));var salesforce=require(_0x4792('0x12'));var sugarcrm=require(_0x4792('0x13'));var freshdesk=require(_0x4792('0x14'));var desk=require(_0x4792('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x4792('0x16'));var freshsales=require(_0x4792('0x17'));var servicenow=require(_0x4792('0x18'));var dynamics365=require(_0x4792('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4792('0x1a')](_0x4792('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4792('0x1a')](_0x4792('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x4792('0x1c')]()[_0x4792('0x1d')](user[_0x4792('0x1e')]())[_0x4792('0x1d')](realtime['initAgents']())[_0x4792('0x1d')](user[_0x4792('0x1f')]())[_0x4792('0x1d')](realtime[_0x4792('0x20')]())[_0x4792('0x1d')](trunk['getTrunks']())[_0x4792('0x1d')](realtime[_0x4792('0x21')]())['then'](voiceQueue[_0x4792('0x22')]())[_0x4792('0x1d')](realtime[_0x4792('0x23')]())[_0x4792('0x1d')](trigger[_0x4792('0x24')]())[_0x4792('0x1d')](realtime['initTriggers']())['then'](template['getTemplates']())['then'](realtime[_0x4792('0x25')]())[_0x4792('0x1d')](zendesk['getZendeskAccounts']())[_0x4792('0x1d')](realtime[_0x4792('0x26')]())['then'](salesforce[_0x4792('0x27')]())[_0x4792('0x1d')](realtime['initSalesforceAccounts']())[_0x4792('0x1d')](sugarcrm['getSugarcrmAccounts']())[_0x4792('0x1d')](realtime[_0x4792('0x28')]())['then'](freshdesk[_0x4792('0x29')]())['then'](realtime[_0x4792('0x2a')]())[_0x4792('0x1d')](desk[_0x4792('0x2b')]())[_0x4792('0x1d')](realtime[_0x4792('0x2c')]())[_0x4792('0x1d')](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())[_0x4792('0x1d')](vtiger['getVtigerAccounts']())[_0x4792('0x1d')](realtime[_0x4792('0x2d')]())[_0x4792('0x1d')](freshsales[_0x4792('0x2e')]())[_0x4792('0x1d')](realtime[_0x4792('0x2f')]())[_0x4792('0x1d')](servicenow[_0x4792('0x30')]())[_0x4792('0x1d')](realtime[_0x4792('0x31')]())['then'](dynamics365[_0x4792('0x32')]())['then'](realtime[_0x4792('0x33')]())['then'](campaign[_0x4792('0x34')]())['then'](realtime[_0x4792('0x35')]())[_0x4792('0x1d')](voiceExtension['getVoiceExtensions']())[_0x4792('0x1d')](realtime['initVoiceExtensions']())[_0x4792('0x1d')](faxAccount[_0x4792('0x36')]())[_0x4792('0x1d')](realtime[_0x4792('0x37')]())[_0x4792('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x4792('0x1c')]()[_0x4792('0x1d')](voiceQueueReport[_0x4792('0x38')]())['then'](realtime['initVoiceQueueReports']())[_0x4792('0x1d')](cmHopperHistory[_0x4792('0x39')]())['then'](realtime[_0x4792('0x3a')]())[_0x4792('0x1d')](cmHopperHistory[_0x4792('0x3b')]())['then'](realtime[_0x4792('0x3c')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x4792('0x1d')](realtime['initVoiceCallReports']())[_0x4792('0x1d')](function(_0x3a7a6c){})[_0x4792('0x3d')](function(_0x1e0b1e){console[_0x4792('0x3e')](_0x1e0b1e);});}function main(){return server[_0x4792('0x3f')](realtime,preview,fax)[_0x4792('0x1d')](function(_0x8ae31e){return initRealtime();})[_0x4792('0x1d')](function(){return initParams();})[_0x4792('0x1d')](function(){report[_0x4792('0x40')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x19f2ad){console[_0x4792('0x3e')](_0x19f2ad);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 37decea..cd1f5a3 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 _0xf5a1=['emit','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','stateTime','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','status','onhold','stringify'];(function(_0x4716a7,_0x74d5da){var _0x5c1f7c=function(_0x42a557){while(--_0x42a557){_0x4716a7['push'](_0x4716a7['shift']());}};_0x5c1f7c(++_0x74d5da);}(_0xf5a1,0x129));var _0x1f5a=function(_0xbc98f5,_0x3e8d59){_0xbc98f5=_0xbc98f5-0x0;var _0x4302cc=_0xf5a1[_0xbc98f5];return _0x4302cc;};'use strict';var _=require(_0x1f5a('0x0'));var util=require(_0x1f5a('0x1'));var moment=require(_0x1f5a('0x2'));var md5=require(_0x1f5a('0x3'));var Redis=require(_0x1f5a('0x4'));var config=require(_0x1f5a('0x5'));config[_0x1f5a('0x6')]=_[_0x1f5a('0x7')](config['redis'],{'host':_0x1f5a('0x8'),'port':0x18eb});var io=require(_0x1f5a('0x9'))(new Redis(config['redis']));function Agent(_0x3e1642){this['id']=_0x3e1642['id']||0x0;this[_0x1f5a('0xa')]=_0x3e1642[_0x1f5a('0xa')]||'';this['email']=_0x3e1642[_0x1f5a('0xb')]||'';this[_0x1f5a('0xc')]=_0x3e1642[_0x1f5a('0xc')]||'';this[_0x1f5a('0xd')]=_0x3e1642['fullname']||'';this['state']='unknown';this[_0x1f5a('0xe')]=0x0;this['status']=_0x1f5a('0xf');this[_0x1f5a('0x10')]='';this[_0x1f5a('0x11')]='';this[_0x1f5a('0x12')]='';this[_0x1f5a('0x13')]='';this['online']=_0x3e1642[_0x1f5a('0x14')]||![];this[_0x1f5a('0x15')]=_0x1f5a('0xf');this[_0x1f5a('0x16')]=0x0;this[_0x1f5a('0x17')]='';this[_0x1f5a('0x18')]='';this['onhold']=![];this[_0x1f5a('0x19')]=![];this['md5']='';}Agent['prototype'][_0x1f5a('0x1a')]=function(_0x46598f){var _0x466748;if(_0x46598f&&_0x46598f[_0x1f5a('0x1b')]){_0x466748=_0x46598f[_0x1f5a('0x1b')][_0x1f5a('0x1c')]();switch(_0x466748){case _0x1f5a('0x1d'):_0x466748=_0x1f5a('0x1e');break;case _0x1f5a('0x1f'):_0x466748=_0x1f5a('0x20');break;}}if(_0x466748&&this['voiceStatus']!==_0x466748||_0x46598f[_0x1f5a('0x21')]){this[_0x1f5a('0x16')]=_[_0x1f5a('0x22')](moment()[_0x1f5a('0x23')]('x'));}if(_0x466748){this['voiceStatus']=_0x466748;}var _0x2efad0={'id':this['id'],'name':this[_0x1f5a('0xa')],'email':this[_0x1f5a('0xb')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0x1f5a('0xe')],'status':this[_0x1f5a('0x24')],'address':this['address'],'online':this[_0x1f5a('0x14')],'voiceStatus':this[_0x1f5a('0x15')],'voiceStatusTime':this[_0x1f5a('0x16')],'voiceStatusCallerIdNumber':this[_0x1f5a('0x17')],'voiceStatusQueue':this[_0x1f5a('0x18')],'interface':this[_0x1f5a('0x13')],'onhold':this[_0x1f5a('0x25')]};var _0x2b6f52=md5(JSON[_0x1f5a('0x26')](_0x2efad0));if(this[_0x1f5a('0x3')]!==_0x2b6f52){this['md5']=_0x2b6f52;io['to'](util[_0x1f5a('0x23')]('user:%s',_0x2efad0[_0x1f5a('0xa')]))[_0x1f5a('0x27')](_0x1f5a('0x28'),_0x2efad0);}};module[_0x1f5a('0x29')]=Agent; \ No newline at end of file +var _0x0e2f=['redis','defaults','socket.io-emitter','name','email','fullname','unknown','status','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','voiceStatus','statePause','toNumber','format','accountcode','emit','exports','lodash','util','moment','md5','ioredis','../../../config/environment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0e2f,0x1db));var _0xf0e2=function(_0x5e055e,_0x36b550){_0x5e055e=_0x5e055e-0x0;var _0x4ce50d=_0x0e2f[_0x5e055e];return _0x4ce50d;};'use strict';var _=require(_0xf0e2('0x0'));var util=require(_0xf0e2('0x1'));var moment=require(_0xf0e2('0x2'));var md5=require(_0xf0e2('0x3'));var Redis=require(_0xf0e2('0x4'));var config=require(_0xf0e2('0x5'));config[_0xf0e2('0x6')]=_[_0xf0e2('0x7')](config[_0xf0e2('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xf0e2('0x8'))(new Redis(config[_0xf0e2('0x6')]));function Agent(_0x433757){this['id']=_0x433757['id']||0x0;this[_0xf0e2('0x9')]=_0x433757['name']||'';this['email']=_0x433757[_0xf0e2('0xa')]||'';this['accountcode']=_0x433757['accountcode']||'';this[_0xf0e2('0xb')]=_0x433757[_0xf0e2('0xb')]||'';this['state']=_0xf0e2('0xc');this['stateTime']=0x0;this[_0xf0e2('0xd')]=_0xf0e2('0xc');this[_0xf0e2('0xe')]='';this[_0xf0e2('0xf')]='';this[_0xf0e2('0x10')]='';this[_0xf0e2('0x11')]='';this[_0xf0e2('0x12')]=_0x433757[_0xf0e2('0x12')]||![];this['voiceStatus']=_0xf0e2('0xc');this[_0xf0e2('0x13')]=0x0;this[_0xf0e2('0x14')]='';this[_0xf0e2('0x15')]='';this[_0xf0e2('0x16')]=![];this[_0xf0e2('0x17')]=![];this['md5']='';}Agent[_0xf0e2('0x18')][_0xf0e2('0x19')]=function(_0x24d752){var _0x5399d4;if(_0x24d752&&_0x24d752['state']){_0x5399d4=_0x24d752['state'][_0xf0e2('0x1a')]();switch(_0x5399d4){case _0xf0e2('0x1b'):_0x5399d4=_0xf0e2('0x1c');break;case _0xf0e2('0x1d'):_0x5399d4='talking';break;}}if(_0x5399d4&&this[_0xf0e2('0x1e')]!==_0x5399d4||_0x24d752[_0xf0e2('0x1f')]){this[_0xf0e2('0x13')]=_[_0xf0e2('0x20')](moment()[_0xf0e2('0x21')]('x'));}if(_0x5399d4){this[_0xf0e2('0x1e')]=_0x5399d4;}var _0xe5018f={'id':this['id'],'name':this['name'],'email':this[_0xf0e2('0xa')],'accountcode':this[_0xf0e2('0x22')],'fullname':this[_0xf0e2('0xb')],'state':this['state'],'stateTime':this['stateTime'],'status':this[_0xf0e2('0xd')],'address':this[_0xf0e2('0xe')],'online':this[_0xf0e2('0x12')],'voiceStatus':this[_0xf0e2('0x1e')],'voiceStatusTime':this[_0xf0e2('0x13')],'voiceStatusCallerIdNumber':this[_0xf0e2('0x14')],'voiceStatusQueue':this[_0xf0e2('0x15')],'interface':this['interface'],'onhold':this[_0xf0e2('0x16')]};var _0x213291=md5(JSON['stringify'](_0xe5018f));if(this[_0xf0e2('0x3')]!==_0x213291){this[_0xf0e2('0x3')]=_0x213291;io['to'](util[_0xf0e2('0x21')]('user:%s',_0xe5018f['name']))[_0xf0e2('0x23')]('user:save',_0xe5018f);}};module[_0xf0e2('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index b0673f8..c65091c 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 _0xbaf0=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x5f37de,_0x1a5921){var _0x114e32=function(_0x4c25f9){while(--_0x4c25f9){_0x5f37de['push'](_0x5f37de['shift']());}};_0x114e32(++_0x1a5921);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';function Campaign(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=0x0;this['temp']=0x0;this[_0x0baf('0x4')]=0x0;this[_0x0baf('0x5')]=0x0;this[_0x0baf('0x6')]='';this[_0x0baf('0x7')]=!![];this[_0x0baf('0x8')]=_0x61caa9[_0x0baf('0x8')];this[_0x0baf('0x9')]=_0x61caa9[_0x0baf('0x9')];this[_0x0baf('0xa')]=_0x61caa9['dialTimezone']||null;this[_0x0baf('0xb')]=_0x61caa9['dialGlobalInterval']?_0x61caa9[_0x0baf('0xb')]:null;this[_0x0baf('0xc')]=_0x61caa9[_0x0baf('0xc')];this[_0x0baf('0xd')]=_0x61caa9[_0x0baf('0xd')];this[_0x0baf('0xe')]=_0x61caa9[_0x0baf('0xe')]||0x1e;this[_0x0baf('0xf')]=_0x61caa9[_0x0baf('0xf')];this[_0x0baf('0x10')]=_0x61caa9[_0x0baf('0x10')];this['dialBusyMaxRetry']=_0x61caa9['dialBusyMaxRetry'];this[_0x0baf('0x11')]=_0x61caa9[_0x0baf('0x11')];this[_0x0baf('0x12')]=_0x61caa9[_0x0baf('0x12')];this['dialNoAnswerRetryFrequency']=_0x61caa9[_0x0baf('0x13')];this['dialGlobalMaxRetry']=_0x61caa9[_0x0baf('0x14')];this[_0x0baf('0x15')]=_0x61caa9[_0x0baf('0x15')]||_0x0baf('0x16');this[_0x0baf('0x17')]=_0x61caa9[_0x0baf('0x17')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x61caa9['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x0baf('0x18')]=_0x61caa9[_0x0baf('0x18')]||undefined;this[_0x0baf('0x19')]=_0x61caa9[_0x0baf('0x19')]?_0x61caa9[_0x0baf('0x19')]:undefined;this[_0x0baf('0x1a')]=_0x61caa9['Trunk']?_0x61caa9[_0x0baf('0x1a')]:undefined;this[_0x0baf('0x1b')]=_0x61caa9[_0x0baf('0x1b')]?_0x61caa9[_0x0baf('0x1b')]:undefined;this[_0x0baf('0x1c')]=_0x61caa9[_0x0baf('0x1c')]?_0x61caa9['SquareProject']:undefined;this['dialQueueProject']=_0x61caa9[_0x0baf('0x1c')]?_0x61caa9[_0x0baf('0x1c')][_0x0baf('0x0')]:undefined;this[_0x0baf('0x1d')]=_0x61caa9[_0x0baf('0x1d')]||![];this[_0x0baf('0x1e')]=_0x61caa9[_0x0baf('0x1e')];this[_0x0baf('0x1f')]=_0x61caa9[_0x0baf('0x1f')];this[_0x0baf('0x20')]=_0x61caa9['dialAMDAfterGreetingSilence'];this[_0x0baf('0x21')]=_0x61caa9['dialAMDTotalAnalysisTime'];this[_0x0baf('0x22')]=_0x61caa9['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x61caa9[_0x0baf('0x23')];this['dialAMDMaximumNumberOfWords']=_0x61caa9['dialAMDMaximumNumberOfWords'];this[_0x0baf('0x24')]=_0x61caa9[_0x0baf('0x24')];this[_0x0baf('0x25')]=_0x61caa9[_0x0baf('0x25')];}module[_0x0baf('0x26')]=Campaign; \ No newline at end of file +var _0xd8b0=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';function Campaign(_0x5d04de){this['id']=_0x5d04de['id']||0x0;this[_0x0d8b('0x0')]=_0x5d04de['name']||'';this['type']=_0x5d04de['type']||_0x0d8b('0x1');this[_0x0d8b('0x2')]=0x0;this[_0x0d8b('0x3')]=0x0;this[_0x0d8b('0x4')]=0x0;this[_0x0d8b('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x0d8b('0x6')]=_0x5d04de[_0x0d8b('0x6')];this[_0x0d8b('0x7')]=_0x5d04de['limitCalls'];this[_0x0d8b('0x8')]=_0x5d04de[_0x0d8b('0x8')]||null;this['dialGlobalInterval']=_0x5d04de[_0x0d8b('0x9')]?_0x5d04de[_0x0d8b('0x9')]:null;this[_0x0d8b('0xa')]=_0x5d04de[_0x0d8b('0xa')];this[_0x0d8b('0xb')]=_0x5d04de[_0x0d8b('0xb')];this[_0x0d8b('0xc')]=_0x5d04de[_0x0d8b('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x5d04de[_0x0d8b('0xd')];this['dialCongestionRetryFrequency']=_0x5d04de[_0x0d8b('0xe')];this[_0x0d8b('0xf')]=_0x5d04de[_0x0d8b('0xf')];this[_0x0d8b('0x10')]=_0x5d04de[_0x0d8b('0x10')];this[_0x0d8b('0x11')]=_0x5d04de[_0x0d8b('0x11')];this[_0x0d8b('0x12')]=_0x5d04de[_0x0d8b('0x12')];this[_0x0d8b('0x13')]=_0x5d04de[_0x0d8b('0x13')];this[_0x0d8b('0x14')]=_0x5d04de[_0x0d8b('0x14')]||_0x0d8b('0x15');this['dialPrefix']=_0x5d04de[_0x0d8b('0x16')]||undefined;this[_0x0d8b('0x17')]=_0x5d04de[_0x0d8b('0x17')]||undefined;this[_0x0d8b('0x18')]=_0x5d04de[_0x0d8b('0x18')]||undefined;this['TrunkBackup']=_0x5d04de[_0x0d8b('0x19')]?_0x5d04de[_0x0d8b('0x19')]:undefined;this[_0x0d8b('0x1a')]=_0x5d04de[_0x0d8b('0x1a')]?_0x5d04de[_0x0d8b('0x1a')]:undefined;this[_0x0d8b('0x1b')]=_0x5d04de[_0x0d8b('0x1b')]?_0x5d04de[_0x0d8b('0x1b')]:undefined;this['SquareProject']=_0x5d04de[_0x0d8b('0x1c')]?_0x5d04de[_0x0d8b('0x1c')]:undefined;this[_0x0d8b('0x1d')]=_0x5d04de[_0x0d8b('0x1c')]?_0x5d04de[_0x0d8b('0x1c')][_0x0d8b('0x0')]:undefined;this[_0x0d8b('0x1e')]=_0x5d04de[_0x0d8b('0x1e')]||![];this['dialAMDInitialSilence']=_0x5d04de['dialAMDInitialSilence'];this[_0x0d8b('0x1f')]=_0x5d04de['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x5d04de['dialAMDAfterGreetingSilence'];this[_0x0d8b('0x20')]=_0x5d04de[_0x0d8b('0x20')];this[_0x0d8b('0x21')]=_0x5d04de[_0x0d8b('0x21')];this[_0x0d8b('0x22')]=_0x5d04de[_0x0d8b('0x22')];this[_0x0d8b('0x23')]=_0x5d04de[_0x0d8b('0x23')];this[_0x0d8b('0x24')]=_0x5d04de['dialAMDSilenceThreshold'];this[_0x0d8b('0x25')]=_0x5d04de[_0x0d8b('0x25')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 642ef6b..727d03f 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 _0xa468=['mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','context','uniqueid','linkedid','exten','answered','answertime','endtime','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum'];(function(_0x3d15a4,_0x24af46){var _0x1c7b80=function(_0x5bf72e){while(--_0x5bf72e){_0x3d15a4['push'](_0x3d15a4['shift']());}};_0x1c7b80(++_0x24af46);}(_0xa468,0x1b1));var _0x8a46=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa468[_0x1ac595];return _0x455fff;};'use strict';function Channel(){this[_0x8a46('0x0')]=null;this[_0x8a46('0x1')]='';this[_0x8a46('0x2')]='';this[_0x8a46('0x3')]=0x0;this[_0x8a46('0x4')]='';this[_0x8a46('0x5')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x8a46('0x6')]='';this[_0x8a46('0x7')]=0x0;this[_0x8a46('0x8')]=0x0;this[_0x8a46('0x9')]=0x0;this[_0x8a46('0xa')]=![];this[_0x8a46('0xb')]=null;this[_0x8a46('0xc')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x8a46('0xd')]='';this[_0x8a46('0xe')]='';this['duration']=0x0;this[_0x8a46('0xf')]=0x0;this[_0x8a46('0x10')]=0x0;this[_0x8a46('0x11')]=null;this[_0x8a46('0x12')]=null;this[_0x8a46('0x13')]=null;this[_0x8a46('0x14')]=![];this[_0x8a46('0x15')]=null;this[_0x8a46('0x16')]=null;this[_0x8a46('0x17')]=[];this[_0x8a46('0x18')]=undefined;this[_0x8a46('0x19')]=undefined;this[_0x8a46('0x1a')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x129f=['context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','lastdata','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode'];(function(_0x5a9c04,_0x5a3974){var _0x2ef87e=function(_0x5c71fc){while(--_0x5c71fc){_0x5a9c04['push'](_0x5a9c04['shift']());}};_0x2ef87e(++_0x5a3974);}(_0x129f,0x13f));var _0xf129=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x129f[_0x1694f5];return _0x5b4321;};'use strict';function Channel(){this[_0xf129('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0xf129('0x1')]=0x0;this[_0xf129('0x2')]='';this[_0xf129('0x3')]=undefined;this[_0xf129('0x4')]=undefined;this[_0xf129('0x5')]=0x0;this[_0xf129('0x6')]='';this[_0xf129('0x7')]=0x0;this[_0xf129('0x8')]=0x0;this['exten']=0x0;this[_0xf129('0x9')]=![];this[_0xf129('0xa')]=null;this[_0xf129('0xb')]=null;this[_0xf129('0xc')]=![];this['abandoned']=![];this['lastapplication']='';this[_0xf129('0xd')]='';this['duration']=0x0;this[_0xf129('0xe')]=0x0;this[_0xf129('0xf')]=0x0;this[_0xf129('0x10')]=null;this[_0xf129('0x11')]=null;this[_0xf129('0x12')]=null;this['monitor']=![];this[_0xf129('0x13')]=null;this[_0xf129('0x14')]=null;this[_0xf129('0x15')]=[];this['transfercalleridnum']=undefined;this[_0xf129('0x16')]=undefined;this[_0xf129('0x17')]=0x0;}module[_0xf129('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index fe973d0..a905184 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 _0xf842=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username'];(function(_0x7287c8,_0x6b636d){var _0x427702=function(_0x3ff7dc){while(--_0x3ff7dc){_0x7287c8['push'](_0x7287c8['shift']());}};_0x427702(++_0x6b636d);}(_0xf842,0x172));var _0x2f84=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xf842[_0x36c5b0];return _0xf19333;};'use strict';function DeskAccount(_0x3344){this['id']=_0x3344['id']||0x0;this[_0x2f84('0x0')]=_0x3344[_0x2f84('0x0')]||'';this[_0x2f84('0x1')]=_0x3344['username']||'';this[_0x2f84('0x2')]=_0x3344[_0x2f84('0x2')]||'';this[_0x2f84('0x3')]=_0x3344[_0x2f84('0x3')]||'';this[_0x2f84('0x4')]=_0x3344['password']||'';this[_0x2f84('0x5')]=_0x3344[_0x2f84('0x5')]||'';this[_0x2f84('0x6')]=_0x3344['consumerSecret']||'';this[_0x2f84('0x7')]=_0x3344[_0x2f84('0x7')]||'';this[_0x2f84('0x8')]=_0x3344[_0x2f84('0x8')]||'';this[_0x2f84('0x9')]=_0x3344[_0x2f84('0x9')]||'';this[_0x2f84('0xa')]=_0x3344[_0x2f84('0xa')]||'';this[_0x2f84('0xb')]=_0x3344[_0x2f84('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x1629=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','name'];(function(_0x441b96,_0x55bcdb){var _0x485498=function(_0x473d69){while(--_0x473d69){_0x441b96['push'](_0x441b96['shift']());}};_0x485498(++_0x55bcdb);}(_0x1629,0x1d8));var _0x9162=function(_0x47774d,_0x15fff5){_0x47774d=_0x47774d-0x0;var _0x460b45=_0x1629[_0x47774d];return _0x460b45;};'use strict';function DeskAccount(_0x5d286b){this['id']=_0x5d286b['id']||0x0;this[_0x9162('0x0')]=_0x5d286b[_0x9162('0x0')]||'';this[_0x9162('0x1')]=_0x5d286b['username']||'';this[_0x9162('0x2')]=_0x5d286b['remoteUri']||'';this['authType']=_0x5d286b[_0x9162('0x3')]||'';this[_0x9162('0x4')]=_0x5d286b['password']||'';this['consumerKey']=_0x5d286b[_0x9162('0x5')]||'';this[_0x9162('0x6')]=_0x5d286b[_0x9162('0x6')]||'';this[_0x9162('0x7')]=_0x5d286b[_0x9162('0x7')]||'';this[_0x9162('0x8')]=_0x5d286b['tokenSecret']||'';this['type']=_0x5d286b['type']||'';this[_0x9162('0x9')]=_0x5d286b[_0x9162('0x9')]||'';this[_0x9162('0xa')]=_0x5d286b[_0x9162('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index e731c7f..b7b8408 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 _0x64de=['exports','name','username','password','remoteUri','clientId','clientSecret','serverUrl','Configurations'];(function(_0x16ed46,_0xdd86cd){var _0x5459be=function(_0x357657){while(--_0x357657){_0x16ed46['push'](_0x16ed46['shift']());}};_0x5459be(++_0xdd86cd);}(_0x64de,0xac));var _0xe64d=function(_0x537535,_0x5d9846){_0x537535=_0x537535-0x0;var _0x5088f5=_0x64de[_0x537535];return _0x5088f5;};'use strict';function Dynamics365Account(_0x91ee9f){this['id']=_0x91ee9f['id']||0x0;this[_0xe64d('0x0')]=_0x91ee9f[_0xe64d('0x0')]||'';this[_0xe64d('0x1')]=_0x91ee9f['username']||'';this[_0xe64d('0x2')]=_0x91ee9f[_0xe64d('0x2')]||'';this[_0xe64d('0x3')]=_0x91ee9f[_0xe64d('0x3')]||'';this['tenantId']=_0x91ee9f['tenantId']||'';this['clientId']=_0x91ee9f[_0xe64d('0x4')]||'';this[_0xe64d('0x5')]=_0x91ee9f['clientSecret']||{};this['serverUrl']=_0x91ee9f[_0xe64d('0x6')]||'';this[_0xe64d('0x7')]=_0x91ee9f[_0xe64d('0x7')]||{};}module[_0xe64d('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x43d5=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name','username'];(function(_0x58cee1,_0x4528b4){var _0x3063bb=function(_0xbe912e){while(--_0xbe912e){_0x58cee1['push'](_0x58cee1['shift']());}};_0x3063bb(++_0x4528b4);}(_0x43d5,0x15d));var _0x543d=function(_0x18496e,_0x4ca16e){_0x18496e=_0x18496e-0x0;var _0x5ec01f=_0x43d5[_0x18496e];return _0x5ec01f;};'use strict';function Dynamics365Account(_0x288ed6){this['id']=_0x288ed6['id']||0x0;this[_0x543d('0x0')]=_0x288ed6[_0x543d('0x0')]||'';this[_0x543d('0x1')]=_0x288ed6['username']||'';this[_0x543d('0x2')]=_0x288ed6[_0x543d('0x2')]||'';this['remoteUri']=_0x288ed6[_0x543d('0x3')]||'';this[_0x543d('0x4')]=_0x288ed6[_0x543d('0x4')]||'';this[_0x543d('0x5')]=_0x288ed6[_0x543d('0x5')]||'';this[_0x543d('0x6')]=_0x288ed6[_0x543d('0x6')]||{};this[_0x543d('0x7')]=_0x288ed6[_0x543d('0x7')]||'';this['Configurations']=_0x288ed6[_0x543d('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 923167e..1adc45f 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 _0x2838=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech'];(function(_0x1b235b,_0x2f57b4){var _0x58e667=function(_0x471a49){while(--_0x471a49){_0x1b235b['push'](_0x1b235b['shift']());}};_0x58e667(++_0x2f57b4);}(_0x2838,0x1bf));var _0x8283=function(_0x136628,_0xdd3206){_0x136628=_0x136628-0x0;var _0x35aad7=_0x2838[_0x136628];return _0x35aad7;};'use strict';function FaxAccount(_0x469cd8){this['id']=_0x469cd8['id']||0x0;this['name']=_0x469cd8[_0x8283('0x0')]||'';this[_0x8283('0x1')]=_0x469cd8['description'];this[_0x8283('0x2')]=_0x469cd8['ecm'];this[_0x8283('0x3')]=_0x469cd8[_0x8283('0x3')];this[_0x8283('0x4')]=_0x469cd8[_0x8283('0x4')];this['minrate']=_0x469cd8[_0x8283('0x5')]||0x960;this[_0x8283('0x6')]=_0x469cd8['maxrate']||0x3840;this[_0x8283('0x7')]=_0x469cd8['modem']||'v17,v27,v29';this[_0x8283('0x8')]=_0x469cd8[_0x8283('0x8')]||'no';this[_0x8283('0x9')]=_0x469cd8[_0x8283('0x9')]||'no';this['t38timeout']=_0x469cd8[_0x8283('0xa')]||0x1388;this['tech']=_0x469cd8[_0x8283('0xb')]||_0x8283('0xc');this[_0x8283('0xd')]=_0x469cd8[_0x8283('0xd')]?_0x469cd8[_0x8283('0xd')]:undefined;this[_0x8283('0xe')]=_0x469cd8[_0x8283('0xe')];this[_0x8283('0xf')]=_0x469cd8[_0x8283('0xf')];}module[_0x8283('0x10')]=FaxAccount; \ No newline at end of file +var _0x76b5=['key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','faxdetect','t38timeout','tech','Trunk','ListId'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x76b5,0x82));var _0x576b=function(_0x36ed6c,_0x302b25){_0x36ed6c=_0x36ed6c-0x0;var _0x13a7e4=_0x76b5[_0x36ed6c];return _0x13a7e4;};'use strict';function FaxAccount(_0x727bd6){this['id']=_0x727bd6['id']||0x0;this[_0x576b('0x0')]=_0x727bd6[_0x576b('0x0')]||'';this[_0x576b('0x1')]=_0x727bd6['description'];this[_0x576b('0x2')]=_0x727bd6[_0x576b('0x2')];this[_0x576b('0x3')]=_0x727bd6['headerinfo'];this[_0x576b('0x4')]=_0x727bd6[_0x576b('0x4')];this[_0x576b('0x5')]=_0x727bd6['minrate']||0x960;this['maxrate']=_0x727bd6[_0x576b('0x6')]||0x3840;this[_0x576b('0x7')]=_0x727bd6[_0x576b('0x7')]||_0x576b('0x8');this['gateway']=_0x727bd6['gateway']||'no';this[_0x576b('0x9')]=_0x727bd6[_0x576b('0x9')]||'no';this['t38timeout']=_0x727bd6[_0x576b('0xa')]||0x1388;this['tech']=_0x727bd6[_0x576b('0xb')]||'SIP';this[_0x576b('0xc')]=_0x727bd6['Trunk']?_0x727bd6[_0x576b('0xc')]:undefined;this['ListId']=_0x727bd6[_0x576b('0xd')];this[_0x576b('0xe')]=_0x727bd6[_0x576b('0xe')];}module[_0x576b('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 1318fa2..ad5bf2c 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 _0x09d8=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x9e19e8,_0x266306){var _0xfec078=function(_0x9ff438){while(--_0x9ff438){_0x9e19e8['push'](_0x9e19e8['shift']());}};_0xfec078(++_0x266306);}(_0x09d8,0xd8));var _0x809d=function(_0x54be98,_0x5c571f){_0x54be98=_0x54be98-0x0;var _0x1980df=_0x09d8[_0x54be98];return _0x1980df;};'use strict';function FreshdeskAccount(_0x3d7e99){this['id']=_0x3d7e99['id']||0x0;this[_0x809d('0x0')]=_0x3d7e99[_0x809d('0x0')]||'';this[_0x809d('0x1')]=_0x3d7e99['username']||'';this[_0x809d('0x2')]=_0x3d7e99[_0x809d('0x3')]||'';this[_0x809d('0x4')]=_0x3d7e99['remoteUri']||'';this[_0x809d('0x5')]=_0x3d7e99[_0x809d('0x5')]||'';this[_0x809d('0x6')]=_0x3d7e99[_0x809d('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x03a3=['exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x03a3,0x197));var _0x303a=function(_0x269fba,_0xa68777){_0x269fba=_0x269fba-0x0;var _0x1eeb74=_0x03a3[_0x269fba];return _0x1eeb74;};'use strict';function FreshdeskAccount(_0x47b25d){this['id']=_0x47b25d['id']||0x0;this[_0x303a('0x0')]=_0x47b25d['name']||'';this[_0x303a('0x1')]=_0x47b25d[_0x303a('0x1')]||'';this[_0x303a('0x2')]=_0x47b25d[_0x303a('0x3')]||'';this[_0x303a('0x4')]=_0x47b25d[_0x303a('0x4')]||'';this['serverUrl']=_0x47b25d[_0x303a('0x5')]||'';this['Configurations']=_0x47b25d['Configurations']||{};}module[_0x303a('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 99c2417..080e406 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc59=['exports','name','username','apiKey','token','remoteUri','Configurations'];(function(_0x513f58,_0xc43a7){var _0x142e79=function(_0x24494b){while(--_0x24494b){_0x513f58['push'](_0x513f58['shift']());}};_0x142e79(++_0xc43a7);}(_0xcc59,0x1ba));var _0x9cc5=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0xcc59[_0x561f25];return _0x150e4c;};'use strict';function FreshsalesAccount(_0x24d10d){this['id']=_0x24d10d['id']||0x0;this[_0x9cc5('0x0')]=_0x24d10d[_0x9cc5('0x0')]||'';this[_0x9cc5('0x1')]=_0x24d10d['username']||'';this[_0x9cc5('0x2')]=_0x24d10d[_0x9cc5('0x3')]||'';this[_0x9cc5('0x4')]=_0x24d10d[_0x9cc5('0x4')]||'';this['serverUrl']=_0x24d10d['serverUrl']||'';this[_0x9cc5('0x5')]=_0x24d10d['Configurations']||{};}module[_0x9cc5('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xd954=['username','remoteUri','serverUrl','Configurations','name'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0xd954,0x7c));var _0x4d95=function(_0x9516c6,_0x217446){_0x9516c6=_0x9516c6-0x0;var _0x5a9a4d=_0xd954[_0x9516c6];return _0x5a9a4d;};'use strict';function FreshsalesAccount(_0x32d3c5){this['id']=_0x32d3c5['id']||0x0;this[_0x4d95('0x0')]=_0x32d3c5[_0x4d95('0x0')]||'';this['username']=_0x32d3c5[_0x4d95('0x1')]||'';this['apiKey']=_0x32d3c5['token']||'';this['remoteUri']=_0x32d3c5[_0x4d95('0x2')]||'';this[_0x4d95('0x3')]=_0x32d3c5[_0x4d95('0x3')]||'';this[_0x4d95('0x4')]=_0x32d3c5[_0x4d95('0x4')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 2d367cb..0fcce3a 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 _0xc2ea=['mohtime','exports','type','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','assigned','lastAssignedTo'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0xc2ea,0x191));var _0xac2e=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xc2ea[_0x4b7895];return _0x264180;};'use strict';function QueueReport(){this[_0xac2e('0x0')]='inbound';this['uniqueid']='';this[_0xac2e('0x1')]='';this['calleridname']='';this[_0xac2e('0x2')]='';this[_0xac2e('0x3')]=null;this[_0xac2e('0x4')]=null;this[_0xac2e('0x5')]=0x1;this[_0xac2e('0x6')]=0x1;this[_0xac2e('0x7')]=![];this[_0xac2e('0x8')]=null;this[_0xac2e('0x9')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xac2e('0xa')]=null;this[_0xac2e('0xb')]=0x1;this[_0xac2e('0xc')]='';this[_0xac2e('0xd')]='';this[_0xac2e('0xe')]='';this[_0xac2e('0xf')]='';this['context']='';this[_0xac2e('0x10')]='';this['priority']='';this['holdtime']=0x0;this[_0xac2e('0x11')]=![];this[_0xac2e('0x12')]='';this[_0xac2e('0x13')]=0x0;this['variables']={};}module[_0xac2e('0x14')]=QueueReport; \ No newline at end of file +var _0x7b22=['assigned','mohtime','variables','exports','type','inbound','uniqueid','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority'];(function(_0x326146,_0x4f7def){var _0x1c5002=function(_0x3c66dc){while(--_0x3c66dc){_0x326146['push'](_0x326146['shift']());}};_0x1c5002(++_0x4f7def);}(_0x7b22,0x13c));var _0x27b2=function(_0x2cd8d0,_0x5ddefb){_0x2cd8d0=_0x2cd8d0-0x0;var _0x49a221=_0x7b22[_0x2cd8d0];return _0x49a221;};'use strict';function QueueReport(){this[_0x27b2('0x0')]=_0x27b2('0x1');this[_0x27b2('0x2')]='';this['calleridnum']='';this['calleridname']='';this['queue']='';this[_0x27b2('0x3')]=null;this[_0x27b2('0x4')]=null;this[_0x27b2('0x5')]=0x1;this[_0x27b2('0x6')]=0x1;this[_0x27b2('0x7')]=![];this[_0x27b2('0x8')]=null;this[_0x27b2('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x27b2('0xa')]=![];this[_0x27b2('0xb')]=null;this[_0x27b2('0xc')]=0x1;this[_0x27b2('0xd')]='';this[_0x27b2('0xe')]='';this[_0x27b2('0xf')]='';this[_0x27b2('0x10')]='';this[_0x27b2('0x11')]='';this[_0x27b2('0x12')]='';this[_0x27b2('0x13')]='';this['holdtime']=0x0;this[_0x27b2('0x14')]=![];this['lastAssignedTo']='';this[_0x27b2('0x15')]=0x0;this[_0x27b2('0x16')]={};}module[_0x27b2('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 0f38799..f86f12e 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 _0xff8b=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xff8b,0x105));var _0xbff8=function(_0xbb4715,_0x2409cf){_0xbb4715=_0xbb4715-0x0;var _0x312639=_0xff8b[_0xbb4715];return _0x312639;};'use strict';function SalesforceAccount(_0x17de07){this['id']=_0x17de07['id']||0x0;this[_0xbff8('0x0')]=_0x17de07[_0xbff8('0x0')]||'';this[_0xbff8('0x1')]=_0x17de07[_0xbff8('0x1')]||'';this[_0xbff8('0x2')]=_0x17de07[_0xbff8('0x2')]||'';this[_0xbff8('0x3')]=_0x17de07[_0xbff8('0x3')]||'';this[_0xbff8('0x4')]=_0x17de07[_0xbff8('0x4')]||'';this[_0xbff8('0x5')]=_0x17de07[_0xbff8('0x5')]||'';this[_0xbff8('0x6')]=_0x17de07[_0xbff8('0x6')]||'';this[_0xbff8('0x7')]=_0x17de07['type']||_0xbff8('0x8');this[_0xbff8('0x9')]=_0x17de07[_0xbff8('0x9')]||'';this[_0xbff8('0xa')]=_0x17de07['Configurations']||{};}module[_0xbff8('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x2ea3=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x2ea3,0x7f));var _0x32ea=function(_0x2c1301,_0x52ecab){_0x2c1301=_0x2c1301-0x0;var _0x561c56=_0x2ea3[_0x2c1301];return _0x561c56;};'use strict';function SalesforceAccount(_0x12f6dc){this['id']=_0x12f6dc['id']||0x0;this['name']=_0x12f6dc[_0x32ea('0x0')]||'';this['username']=_0x12f6dc[_0x32ea('0x1')]||'';this[_0x32ea('0x2')]=_0x12f6dc['remoteUri']||'';this[_0x32ea('0x3')]=_0x12f6dc['password']||'';this[_0x32ea('0x4')]=_0x12f6dc[_0x32ea('0x4')]||'';this['clientSecret']=_0x12f6dc[_0x32ea('0x5')]||'';this[_0x32ea('0x6')]=_0x12f6dc[_0x32ea('0x6')]||'';this[_0x32ea('0x7')]=_0x12f6dc['type']||_0x32ea('0x8');this[_0x32ea('0x9')]=_0x12f6dc[_0x32ea('0x9')]||'';this[_0x32ea('0xa')]=_0x12f6dc[_0x32ea('0xa')]||{};}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 0ba3913..f440c60 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 _0x48ce=['username','password','remoteUri','serverUrl','exports','name'];(function(_0x1e3128,_0x44f7b6){var _0x55755f=function(_0x3a0210){while(--_0x3a0210){_0x1e3128['push'](_0x1e3128['shift']());}};_0x55755f(++_0x44f7b6);}(_0x48ce,0x83));var _0xe48c=function(_0x3b9bca,_0x42d6df){_0x3b9bca=_0x3b9bca-0x0;var _0x13090b=_0x48ce[_0x3b9bca];return _0x13090b;};'use strict';function ServicenowAccount(_0x586aa3){this['id']=_0x586aa3['id']||0x0;this[_0xe48c('0x0')]=_0x586aa3['name']||'';this[_0xe48c('0x1')]=_0x586aa3['username']||'';this[_0xe48c('0x2')]=_0x586aa3[_0xe48c('0x2')]||'';this[_0xe48c('0x3')]=_0x586aa3[_0xe48c('0x3')]||'';this[_0xe48c('0x4')]=_0x586aa3[_0xe48c('0x4')]||'';this['Configurations']=_0x586aa3['Configurations']||{};}module[_0xe48c('0x5')]=ServicenowAccount; \ No newline at end of file +var _0xcf1c=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x11b6e9,_0x144376){var _0x20e413=function(_0x54f6fd){while(--_0x54f6fd){_0x11b6e9['push'](_0x11b6e9['shift']());}};_0x20e413(++_0x144376);}(_0xcf1c,0x1ea));var _0xccf1=function(_0x1fb9d2,_0x57a208){_0x1fb9d2=_0x1fb9d2-0x0;var _0x4a8916=_0xcf1c[_0x1fb9d2];return _0x4a8916;};'use strict';function ServicenowAccount(_0x5c8df1){this['id']=_0x5c8df1['id']||0x0;this[_0xccf1('0x0')]=_0x5c8df1[_0xccf1('0x0')]||'';this['username']=_0x5c8df1[_0xccf1('0x1')]||'';this[_0xccf1('0x2')]=_0x5c8df1[_0xccf1('0x2')]||'';this[_0xccf1('0x3')]=_0x5c8df1['remoteUri']||'';this[_0xccf1('0x4')]=_0x5c8df1[_0xccf1('0x4')]||'';this[_0xccf1('0x5')]=_0x5c8df1['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 7475712..09c6f9e 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 _0x9665=['serverUrl','Configurations','exports','username','password','remoteUri'];(function(_0x2c5987,_0x101621){var _0x55773d=function(_0x1ba37c){while(--_0x1ba37c){_0x2c5987['push'](_0x2c5987['shift']());}};_0x55773d(++_0x101621);}(_0x9665,0x12f));var _0x5966=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9665[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x3817b5){this['id']=_0x3817b5['id']||0x0;this['name']=_0x3817b5['name']||'';this[_0x5966('0x0')]=_0x3817b5[_0x5966('0x0')]||'';this[_0x5966('0x1')]=_0x3817b5['password']||'';this[_0x5966('0x2')]=_0x3817b5[_0x5966('0x2')]||'';this[_0x5966('0x3')]=_0x3817b5[_0x5966('0x3')]||'';this[_0x5966('0x4')]=_0x3817b5[_0x5966('0x4')]||{};}module[_0x5966('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x819e=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x214c3f,_0x267455){var _0x42ac13=function(_0x4e4475){while(--_0x4e4475){_0x214c3f['push'](_0x214c3f['shift']());}};_0x42ac13(++_0x267455);}(_0x819e,0x1a0));var _0xe819=function(_0x1499c4,_0x57c5c3){_0x1499c4=_0x1499c4-0x0;var _0x3cf45a=_0x819e[_0x1499c4];return _0x3cf45a;};'use strict';function SugarcrmAccount(_0x284ed2){this['id']=_0x284ed2['id']||0x0;this[_0xe819('0x0')]=_0x284ed2['name']||'';this[_0xe819('0x1')]=_0x284ed2[_0xe819('0x1')]||'';this[_0xe819('0x2')]=_0x284ed2[_0xe819('0x2')]||'';this[_0xe819('0x3')]=_0x284ed2['remoteUri']||'';this[_0xe819('0x4')]=_0x284ed2[_0xe819('0x4')]||'';this[_0xe819('0x5')]=_0x284ed2[_0xe819('0x5')]||{};}module[_0xe819('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 28819f9..00363e2 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 _0x30be=['name','accountcode','state','unknown','stateTime','exports'];(function(_0x582650,_0x30f113){var _0x50c24d=function(_0x2a631c){while(--_0x2a631c){_0x582650['push'](_0x582650['shift']());}};_0x50c24d(++_0x30f113);}(_0x30be,0xa8));var _0xe30b=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x30be[_0x4fc80b];return _0x119dba;};'use strict';function Telephone(_0x3482aa){this['id']=_0x3482aa['id']||0x0;this[_0xe30b('0x0')]=_0x3482aa[_0xe30b('0x0')]||'';this[_0xe30b('0x1')]=_0x3482aa[_0xe30b('0x1')]||'';this[_0xe30b('0x2')]=_0xe30b('0x3');this[_0xe30b('0x4')]=0x0;this['status']='unknown';this['address']='';}module[_0xe30b('0x5')]=Telephone; \ No newline at end of file +var _0xbdbe=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x3d6dee,_0x3ab84f){var _0x3a6731=function(_0x1a3373){while(--_0x1a3373){_0x3d6dee['push'](_0x3d6dee['shift']());}};_0x3a6731(++_0x3ab84f);}(_0xbdbe,0x1a0));var _0xebdb=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xbdbe[_0x4a53d];return _0x27410e;};'use strict';function Telephone(_0xc9e41b){this['id']=_0xc9e41b['id']||0x0;this[_0xebdb('0x0')]=_0xc9e41b['name']||'';this['accountcode']=_0xc9e41b[_0xebdb('0x1')]||'';this[_0xebdb('0x2')]=_0xebdb('0x3');this[_0xebdb('0x4')]=0x0;this[_0xebdb('0x5')]=_0xebdb('0x3');this[_0xebdb('0x6')]='';}module[_0xebdb('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index fc2b62e..d7eab2a 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 _0x19df=['exports','name','html'];(function(_0x3be27c,_0x24f9ea){var _0x4d620a=function(_0x5b2192){while(--_0x5b2192){_0x3be27c['push'](_0x3be27c['shift']());}};_0x4d620a(++_0x24f9ea);}(_0x19df,0x10f));var _0xf19d=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x19df[_0x191154];return _0x3dcd73;};'use strict';function template(_0x18acb7){this['id']=_0x18acb7['id']||0x0;this[_0xf19d('0x0')]=_0x18acb7[_0xf19d('0x0')]||'';this[_0xf19d('0x1')]=_0x18acb7[_0xf19d('0x1')]||'';}module[_0xf19d('0x2')]=template; \ No newline at end of file +var _0x4713=['exports','name','html'];(function(_0x3d9278,_0xfcf8f2){var _0x8bc09f=function(_0x47e471){while(--_0x47e471){_0x3d9278['push'](_0x3d9278['shift']());}};_0x8bc09f(++_0xfcf8f2);}(_0x4713,0x18d));var _0x3471=function(_0x25dd3b,_0x27e043){_0x25dd3b=_0x25dd3b-0x0;var _0x3084aa=_0x4713[_0x25dd3b];return _0x3084aa;};'use strict';function template(_0xf805c){this['id']=_0xf805c['id']||0x0;this[_0x3471('0x0')]=_0xf805c[_0x3471('0x0')]||'';this[_0x3471('0x1')]=_0xf805c[_0x3471('0x1')]||'';}module[_0x3471('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index c180882..179012b 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 _0x7217=['voice','status','AllConditions','AnyConditions','Actions','exports','name','channel'];(function(_0x32dfa0,_0x238507){var _0x276b9d=function(_0x58bff7){while(--_0x58bff7){_0x32dfa0['push'](_0x32dfa0['shift']());}};_0x276b9d(++_0x238507);}(_0x7217,0x19e));var _0x7721=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x7217[_0x24237f];return _0x48298e;};'use strict';function Trigger(_0x516f0e){this['id']=_0x516f0e['id']||0x0;this['name']=_0x516f0e[_0x7721('0x0')]||'';this[_0x7721('0x1')]=_0x516f0e[_0x7721('0x1')]||_0x7721('0x2');this[_0x7721('0x3')]=_0x516f0e['status']||![];this['AllConditions']=_0x516f0e[_0x7721('0x4')]||[];this[_0x7721('0x5')]=_0x516f0e[_0x7721('0x5')]||[];this[_0x7721('0x6')]=_0x516f0e[_0x7721('0x6')]||[];}module[_0x7721('0x7')]=Trigger; \ No newline at end of file +var _0x4b84=['name','channel','status','AllConditions','Actions'];(function(_0x13bf21,_0x2ab2eb){var _0x3e3481=function(_0x52c6ca){while(--_0x52c6ca){_0x13bf21['push'](_0x13bf21['shift']());}};_0x3e3481(++_0x2ab2eb);}(_0x4b84,0x1cc));var _0x44b8=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0x4b84[_0x43fdf8];return _0x1160c6;};'use strict';function Trigger(_0x90ff31){this['id']=_0x90ff31['id']||0x0;this[_0x44b8('0x0')]=_0x90ff31['name']||'';this['channel']=_0x90ff31[_0x44b8('0x1')]||'voice';this['status']=_0x90ff31[_0x44b8('0x2')]||![];this[_0x44b8('0x3')]=_0x90ff31[_0x44b8('0x3')]||[];this['AnyConditions']=_0x90ff31['AnyConditions']||[];this['Actions']=_0x90ff31[_0x44b8('0x4')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 662b00d..c458e02 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 _0x360e=['unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','exports','active','name','state'];(function(_0x2233be,_0xd10120){var _0x1a6468=function(_0x4b0270){while(--_0x4b0270){_0x2233be['push'](_0x2233be['shift']());}};_0x1a6468(++_0xd10120);}(_0x360e,0x1bf));var _0xe360=function(_0x4851ff,_0x1c9a8d){_0x4851ff=_0x4851ff-0x0;var _0x26773b=_0x360e[_0x4851ff];return _0x26773b;};'use strict';function Trunk(_0x1e9945){this['id']=_0x1e9945['id']||0x0;this[_0xe360('0x0')]=_0x1e9945['active']||![];this[_0xe360('0x1')]=_0x1e9945[_0xe360('0x1')]||'';this[_0xe360('0x2')]=_0xe360('0x3');this[_0xe360('0x4')]=0x0;this[_0xe360('0x5')]=_0xe360('0x3');this['registry']=_0x1e9945[_0xe360('0x6')]&&_0x1e9945[_0xe360('0x6')][_0xe360('0x7')](':')?_0x1e9945[_0xe360('0x6')][_0xe360('0x8')](':')[0x0]:'';this[_0xe360('0x9')]='';this[_0xe360('0xa')]='';this[_0xe360('0xb')]='';this[_0xe360('0xc')]='';this[_0xe360('0xd')]='';this[_0xe360('0xe')]=_0xe360('0x3');this[_0xe360('0xf')]='';this[_0xe360('0x10')]='';}module[_0xe360('0x11')]=Trunk; \ No newline at end of file +var _0xab5e=['stateRegistry','address','active','name','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh'];(function(_0x417779,_0xca1d2f){var _0x1fe1f1=function(_0x32067b){while(--_0x32067b){_0x417779['push'](_0x417779['shift']());}};_0x1fe1f1(++_0xca1d2f);}(_0xab5e,0x110));var _0xeab5=function(_0x5b2489,_0x443f55){_0x5b2489=_0x5b2489-0x0;var _0x18298e=_0xab5e[_0x5b2489];return _0x18298e;};'use strict';function Trunk(_0x5bd075){this['id']=_0x5bd075['id']||0x0;this[_0xeab5('0x0')]=_0x5bd075[_0xeab5('0x0')]||![];this[_0xeab5('0x1')]=_0x5bd075[_0xeab5('0x1')]||'';this['state']=_0xeab5('0x2');this[_0xeab5('0x3')]=0x0;this[_0xeab5('0x4')]=_0xeab5('0x2');this[_0xeab5('0x5')]=_0x5bd075['registry']&&_0x5bd075[_0xeab5('0x5')][_0xeab5('0x6')](':')?_0x5bd075[_0xeab5('0x5')][_0xeab5('0x7')](':')[0x0]:'';this[_0xeab5('0x8')]='';this[_0xeab5('0x9')]='';this[_0xeab5('0xa')]='';this[_0xeab5('0xb')]='';this[_0xeab5('0xc')]='';this[_0xeab5('0xd')]=_0xeab5('0x2');this['registrationtime']='';this[_0xeab5('0xe')]='';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 6b000d6..6224b62 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 _0x0bd1=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x389c47,_0x5c391a){var _0x1a1d45=function(_0x55599b){while(--_0x55599b){_0x389c47['push'](_0x389c47['shift']());}};_0x1a1d45(++_0x5c391a);}(_0x0bd1,0xd1));var _0x10bd=function(_0x32d788,_0xbaa65e){_0x32d788=_0x32d788-0x0;var _0x1b671a=_0x0bd1[_0x32d788];return _0x1b671a;};'use strict';function voiceExtension(_0x402216){this['id']=_0x402216['id']||0x0;this['exten']=_0x402216[_0x10bd('0x0')]||'';this[_0x10bd('0x1')]=_0x402216['recordingFormat']||'none';this[_0x10bd('0x2')]=_0x402216['mandatoryDisposition']||![];}module[_0x10bd('0x3')]=voiceExtension; \ No newline at end of file +var _0x42ee=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x42ee,0x19e));var _0xe42e=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x42ee[_0x287a47];return _0x3fb726;};'use strict';function voiceExtension(_0x1bbf19){this['id']=_0x1bbf19['id']||0x0;this[_0xe42e('0x0')]=_0x1bbf19[_0xe42e('0x0')]||'';this[_0xe42e('0x1')]=_0x1bbf19['recordingFormat']||_0xe42e('0x2');this[_0xe42e('0x3')]=_0x1bbf19[_0xe42e('0x3')]||![];}module[_0xe42e('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 8421eb8..17bfa8c 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 _0x0b93=['dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient'];(function(_0x2a1275,_0x20c2d2){var _0x2e4ed9=function(_0x2a2d1e){while(--_0x2a2d1e){_0x2a1275['push'](_0x2a1275['shift']());}};_0x2e4ed9(++_0x20c2d2);}(_0x0b93,0x1e4));var _0x30b9=function(_0x3f4d8f,_0x14b1c4){_0x3f4d8f=_0x3f4d8f-0x0;var _0x5bafa5=_0x0b93[_0x3f4d8f];return _0x5bafa5;};'use strict';var statusDesc=[_0x30b9('0x0'),_0x30b9('0x1'),_0x30b9('0x2'),_0x30b9('0x3'),_0x30b9('0x4'),_0x30b9('0x5'),_0x30b9('0x6'),'ringinuse',_0x30b9('0x7')];var monitorFormat={'wav':_0x30b9('0x8'),'wav49':_0x30b9('0x9'),'gsm':_0x30b9('0xa')};var strategy={'rrmemory':_0x30b9('0xb'),'roundrobin':_0x30b9('0xc')};function VoiceQueue(_0x4150ac){this['id']=_0x4150ac['id']||0x0;this['name']=_0x4150ac[_0x30b9('0xd')]||'';this[_0x30b9('0xe')]=_0x4150ac[_0x30b9('0xe')]||'';this['type']=_0x4150ac[_0x30b9('0xf')]||_0x30b9('0x10');this[_0x30b9('0x11')]=0x0;this['talking']=0x0;this['total']=0x0;this[_0x30b9('0x12')]=0x0;this[_0x30b9('0x13')]=0x0;this[_0x30b9('0x14')]=0x0;this[_0x30b9('0x15')]=0x0;this['unmanaged']=0x0;this[_0x30b9('0x16')]=0x0;this[_0x30b9('0x17')]=0x0;this['available']=0x0;this[_0x30b9('0x18')]=_0x4150ac['acw']||![];this['acwTimeout']=_0x4150ac[_0x30b9('0x19')]||0xa;this[_0x30b9('0x1a')]=_0x4150ac[_0x30b9('0x1a')]||'no';this[_0x30b9('0x1b')]=!![];this[_0x30b9('0x1c')]='';this[_0x30b9('0x1d')]=0x0;this[_0x30b9('0x1e')]=0x0;this[_0x30b9('0x1f')]=_0x4150ac['dialTimezone']||null;this[_0x30b9('0x20')]=_0x4150ac[_0x30b9('0x20')]?_0x4150ac['dialGlobalInterval']:null;this['dialActive']=_0x4150ac[_0x30b9('0x21')];this[_0x30b9('0x22')]=_0x4150ac[_0x30b9('0x22')]||_0x30b9('0x23');this['dialLimitChannel']=_0x4150ac[_0x30b9('0x24')]||0x0;this[_0x30b9('0x25')]=_0x4150ac[_0x30b9('0x25')]||0x0;this[_0x30b9('0x26')]=_0x4150ac['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x4150ac[_0x30b9('0x27')]||_0x30b9('0x28');this['dialPredictiveOptimizationPercentage']=_0x4150ac['dialPredictiveOptimizationPercentage']||0.03;this[_0x30b9('0x29')]=_0x4150ac[_0x30b9('0x29')]||0x258;this[_0x30b9('0x2a')]=_0x4150ac[_0x30b9('0x2a')]||'anonymous';this[_0x30b9('0x2b')]=_0x4150ac[_0x30b9('0x2b')]||_0x30b9('0x2c');this[_0x30b9('0x2d')]=_0x4150ac[_0x30b9('0x2d')]||0x1e;this[_0x30b9('0x2e')]=_0x4150ac['dialQueueOptions']||_0x30b9('0x2f');this[_0x30b9('0x30')]=_0x4150ac[_0x30b9('0x30')]||0x3;this[_0x30b9('0x31')]=_0x4150ac[_0x30b9('0x31')]||undefined;this['dialCongestionMaxRetry']=_0x4150ac[_0x30b9('0x32')]||0x3;this[_0x30b9('0x33')]=_0x4150ac[_0x30b9('0x33')]||0x96;this['dialBusyMaxRetry']=_0x4150ac[_0x30b9('0x34')]||0x3;this['dialBusyRetryFrequency']=_0x4150ac['dialBusyRetryFrequency']||0x96;this[_0x30b9('0x35')]=_0x4150ac[_0x30b9('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4150ac['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x4150ac['dialNoSuchNumberMaxRetry']||0x3;this[_0x30b9('0x36')]=_0x4150ac[_0x30b9('0x36')]||0x96;this[_0x30b9('0x37')]=_0x4150ac[_0x30b9('0x37')]||0x3;this[_0x30b9('0x38')]=_0x4150ac[_0x30b9('0x38')]||0x96;this[_0x30b9('0x39')]=_0x4150ac[_0x30b9('0x39')]||0x3;this['dialAbandonedRetryFrequency']=_0x4150ac[_0x30b9('0x3a')]||0x96;this[_0x30b9('0x3b')]=_0x4150ac['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x4150ac[_0x30b9('0x3c')]||0x96;this[_0x30b9('0x3d')]=_0x4150ac[_0x30b9('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x4150ac[_0x30b9('0x3e')]||0x96;this[_0x30b9('0x3f')]=_0x4150ac[_0x30b9('0x3f')]||0x4;this[_0x30b9('0x40')]=_0x4150ac[_0x30b9('0x40')]?_0x4150ac[_0x30b9('0x40')]:undefined;this[_0x30b9('0x41')]=_0x4150ac['TrunkBackup']?_0x4150ac[_0x30b9('0x41')]:undefined;this[_0x30b9('0x42')]=_0x4150ac[_0x30b9('0x42')]||undefined;this[_0x30b9('0x43')]=_0x4150ac['Interval']?_0x4150ac[_0x30b9('0x43')]:undefined;this['dialOrderByScheduledAt']=_0x4150ac[_0x30b9('0x44')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x4150ac[_0x30b9('0x45')]||undefined;this['dialCutDigit']=_0x4150ac[_0x30b9('0x46')]||undefined;this[_0x30b9('0x47')]=strategy[_0x4150ac['strategy']]||'rrmemory';this[_0x30b9('0x48')]=!![];this[_0x30b9('0x49')]=_0x4150ac['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x4150ac[_0x30b9('0x4a')];this[_0x30b9('0x4b')]=_0x4150ac[_0x30b9('0x4b')];this[_0x30b9('0x4c')]=_0x4150ac['dialAMDAfterGreetingSilence'];this[_0x30b9('0x4d')]=_0x4150ac[_0x30b9('0x4d')];this['dialAMDMinWordLength']=_0x4150ac['dialAMDMinWordLength'];this[_0x30b9('0x4e')]=_0x4150ac[_0x30b9('0x4e')];this[_0x30b9('0x4f')]=_0x4150ac['dialAMDMaximumNumberOfWords'];this[_0x30b9('0x50')]=_0x4150ac[_0x30b9('0x50')];this[_0x30b9('0x51')]=_0x4150ac['dialAMDMaximumWordLength'];this[_0x30b9('0x52')]=0x0;this[_0x30b9('0x53')]=0x0;this['timeout']=_0x4150ac[_0x30b9('0x54')];this[_0x30b9('0x55')]=0x0;this[_0x30b9('0x56')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x30b9('0x57')]=0x0;this[_0x30b9('0x58')]=0x0;this[_0x30b9('0x59')]=0x0;this[_0x30b9('0x5a')]=0x0;this[_0x30b9('0x5b')]=0x0;this[_0x30b9('0x5c')]=0x0;this[_0x30b9('0x5d')]=0x0;this[_0x30b9('0x5e')]=0x0;this[_0x30b9('0x5f')]=0x0;this[_0x30b9('0x60')]=0x0;this[_0x30b9('0x61')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x30b9('0x62')]=undefined;this[_0x30b9('0x63')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x30b9('0x64')]=0x0;this[_0x30b9('0x65')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x30b9('0x66')]=0x0;this[_0x30b9('0x67')]=_0x4150ac[_0x30b9('0x68')]||0x14;this[_0x30b9('0x69')]=_0x4150ac[_0x30b9('0x68')]||0xa;this[_0x30b9('0x6a')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x30b9('0x6b')]=0x1;this[_0x30b9('0x6c')]=0x0;this[_0x30b9('0x6d')]=0x0;this[_0x30b9('0x6e')]=0x0;this[_0x30b9('0x6f')]=0x0;this[_0x30b9('0x70')]=_0x4150ac[_0x30b9('0x70')]||0x1e;this['dialRecallInQueue']=_0x4150ac[_0x30b9('0x71')]||![];this['dialQueueProject2']=_0x4150ac[_0x30b9('0x72')]||undefined;this[_0x30b9('0x73')]=_0x4150ac['dialAgiAfterHangupClient']||![];this[_0x30b9('0x74')]=_0x4150ac[_0x30b9('0x74')]||![];this[_0x30b9('0xe')]=monitorFormat[_0x4150ac['monitor_format']]?monitorFormat[_0x4150ac['monitor_format']]:undefined;this[_0x30b9('0x75')]=_0x4150ac[_0x30b9('0x75')]||![];this[_0x30b9('0x76')]=_0x4150ac['mandatoryDispositionPause']?_0x4150ac[_0x30b9('0x76')]:undefined;}module[_0x30b9('0x77')]=VoiceQueue; \ No newline at end of file +var _0xad95=['roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','unavailable','ringinuse','onhold','wav','rrmemory'];(function(_0xded8a7,_0x286c68){var _0x105b99=function(_0x53b4fa){while(--_0x53b4fa){_0xded8a7['push'](_0xded8a7['shift']());}};_0x105b99(++_0x286c68);}(_0xad95,0x14f));var _0x5ad9=function(_0x5efc23,_0x31cd84){_0x5efc23=_0x5efc23-0x0;var _0x15e707=_0xad95[_0x5efc23];return _0x15e707;};'use strict';var statusDesc=['unknown',_0x5ad9('0x0'),_0x5ad9('0x1'),'busy','invalid',_0x5ad9('0x2'),'ringing',_0x5ad9('0x3'),_0x5ad9('0x4')];var monitorFormat={'wav':_0x5ad9('0x5'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0x5ad9('0x6'),'roundrobin':_0x5ad9('0x7')};function VoiceQueue(_0x5ebb9d){this['id']=_0x5ebb9d['id']||0x0;this[_0x5ad9('0x8')]=_0x5ebb9d['name']||'';this[_0x5ad9('0x9')]=_0x5ebb9d[_0x5ad9('0x9')]||'';this[_0x5ad9('0xa')]=_0x5ebb9d['type']||_0x5ad9('0xb');this[_0x5ad9('0xc')]=0x0;this['talking']=0x0;this[_0x5ad9('0xd')]=0x0;this[_0x5ad9('0xe')]=0x0;this['sumDuration']=0x0;this[_0x5ad9('0xf')]=0x0;this[_0x5ad9('0x10')]=0x0;this[_0x5ad9('0x11')]=0x0;this['abandoned']=0x0;this[_0x5ad9('0x12')]=0x0;this[_0x5ad9('0x13')]=0x0;this[_0x5ad9('0x14')]=_0x5ebb9d[_0x5ad9('0x14')]||![];this['acwTimeout']=_0x5ebb9d[_0x5ad9('0x15')]||0xa;this[_0x5ad9('0x16')]=_0x5ebb9d[_0x5ad9('0x16')]||'no';this[_0x5ad9('0x17')]=!![];this[_0x5ad9('0x18')]='';this['originated']=0x0;this[_0x5ad9('0x19')]=0x0;this[_0x5ad9('0x1a')]=_0x5ebb9d['dialTimezone']||null;this[_0x5ad9('0x1b')]=_0x5ebb9d[_0x5ad9('0x1b')]?_0x5ebb9d[_0x5ad9('0x1b')]:null;this['dialActive']=_0x5ebb9d[_0x5ad9('0x1c')];this[_0x5ad9('0x1d')]=_0x5ebb9d['dialMethod']||_0x5ad9('0x1e');this[_0x5ad9('0x1f')]=_0x5ebb9d[_0x5ad9('0x1f')]||0x0;this[_0x5ad9('0x20')]=_0x5ebb9d[_0x5ad9('0x20')]||0x0;this[_0x5ad9('0x21')]=_0x5ebb9d[_0x5ad9('0x21')]||0x1;this[_0x5ad9('0x22')]=_0x5ebb9d[_0x5ad9('0x22')]||_0x5ad9('0x23');this['dialPredictiveOptimizationPercentage']=_0x5ebb9d[_0x5ad9('0x24')]||0.03;this[_0x5ad9('0x25')]=_0x5ebb9d[_0x5ad9('0x25')]||0x258;this[_0x5ad9('0x26')]=_0x5ebb9d['dialOriginateCallerIdName']||_0x5ad9('0x27');this[_0x5ad9('0x28')]=_0x5ebb9d[_0x5ad9('0x28')]||_0x5ad9('0x27');this['dialOriginateTimeout']=_0x5ebb9d[_0x5ad9('0x29')]||0x1e;this[_0x5ad9('0x2a')]=_0x5ebb9d[_0x5ad9('0x2a')]||_0x5ad9('0x2b');this[_0x5ad9('0x2c')]=_0x5ebb9d[_0x5ad9('0x2c')]||0x3;this[_0x5ad9('0x2d')]=_0x5ebb9d[_0x5ad9('0x2d')]||undefined;this[_0x5ad9('0x2e')]=_0x5ebb9d[_0x5ad9('0x2e')]||0x3;this['dialCongestionRetryFrequency']=_0x5ebb9d['dialCongestionRetryFrequency']||0x96;this[_0x5ad9('0x2f')]=_0x5ebb9d['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x5ebb9d['dialBusyRetryFrequency']||0x96;this[_0x5ad9('0x30')]=_0x5ebb9d[_0x5ad9('0x30')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5ebb9d[_0x5ad9('0x31')]||0x96;this[_0x5ad9('0x32')]=_0x5ebb9d[_0x5ad9('0x32')]||0x3;this[_0x5ad9('0x33')]=_0x5ebb9d[_0x5ad9('0x33')]||0x96;this['dialDropMaxRetry']=_0x5ebb9d['dialDropMaxRetry']||0x3;this[_0x5ad9('0x34')]=_0x5ebb9d[_0x5ad9('0x34')]||0x96;this[_0x5ad9('0x35')]=_0x5ebb9d[_0x5ad9('0x35')]||0x3;this[_0x5ad9('0x36')]=_0x5ebb9d[_0x5ad9('0x36')]||0x96;this['dialMachineMaxRetry']=_0x5ebb9d[_0x5ad9('0x37')]||0x3;this[_0x5ad9('0x38')]=_0x5ebb9d[_0x5ad9('0x38')]||0x96;this[_0x5ad9('0x39')]=_0x5ebb9d[_0x5ad9('0x39')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5ebb9d[_0x5ad9('0x3a')]||0x96;this[_0x5ad9('0x3b')]=_0x5ebb9d[_0x5ad9('0x3b')]||0x4;this['Trunk']=_0x5ebb9d[_0x5ad9('0x3c')]?_0x5ebb9d[_0x5ad9('0x3c')]:undefined;this[_0x5ad9('0x3d')]=_0x5ebb9d[_0x5ad9('0x3d')]?_0x5ebb9d[_0x5ad9('0x3d')]:undefined;this[_0x5ad9('0x3e')]=_0x5ebb9d['dialPrefix']||undefined;this[_0x5ad9('0x3f')]=_0x5ebb9d['Interval']?_0x5ebb9d[_0x5ad9('0x3f')]:undefined;this['dialOrderByScheduledAt']=_0x5ebb9d[_0x5ad9('0x40')]||'DESC';this[_0x5ad9('0x41')]=_0x5ebb9d[_0x5ad9('0x41')]||undefined;this[_0x5ad9('0x42')]=_0x5ebb9d[_0x5ad9('0x42')]||undefined;this[_0x5ad9('0x43')]=strategy[_0x5ebb9d['strategy']]||_0x5ad9('0x6');this['queueStatusComplete']=!![];this[_0x5ad9('0x44')]=_0x5ebb9d[_0x5ad9('0x44')]||![];this[_0x5ad9('0x45')]=_0x5ebb9d[_0x5ad9('0x45')];this[_0x5ad9('0x46')]=_0x5ebb9d[_0x5ad9('0x46')];this[_0x5ad9('0x47')]=_0x5ebb9d[_0x5ad9('0x47')];this[_0x5ad9('0x48')]=_0x5ebb9d[_0x5ad9('0x48')];this[_0x5ad9('0x49')]=_0x5ebb9d[_0x5ad9('0x49')];this[_0x5ad9('0x4a')]=_0x5ebb9d[_0x5ad9('0x4a')];this['dialAMDMaximumNumberOfWords']=_0x5ebb9d[_0x5ad9('0x4b')];this[_0x5ad9('0x4c')]=_0x5ebb9d[_0x5ad9('0x4c')];this[_0x5ad9('0x4d')]=_0x5ebb9d[_0x5ad9('0x4d')];this[_0x5ad9('0x4e')]=0x0;this[_0x5ad9('0x4f')]=0x0;this[_0x5ad9('0x50')]=_0x5ebb9d['timeout'];this[_0x5ad9('0x51')]=0x0;this[_0x5ad9('0x52')]=0x0;this[_0x5ad9('0x53')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x5ad9('0x54')]=0x0;this[_0x5ad9('0x55')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x5ad9('0x56')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x5ad9('0x57')]=0x0;this[_0x5ad9('0x58')]=0x0;this[_0x5ad9('0x59')]=undefined;this[_0x5ad9('0x5a')]=undefined;this[_0x5ad9('0x5b')]=undefined;this[_0x5ad9('0x5c')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x5ad9('0x5d')]=0x0;this[_0x5ad9('0x5e')]=0x0;this[_0x5ad9('0x5f')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x5ad9('0x60')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x5ad9('0x61')]=0x0;this[_0x5ad9('0x62')]=_0x5ebb9d[_0x5ad9('0x63')]||0x14;this[_0x5ad9('0x64')]=_0x5ebb9d['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x5ad9('0x65')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x5ad9('0x66')]=0x1;this[_0x5ad9('0x67')]=0x0;this[_0x5ad9('0x68')]=0x0;this[_0x5ad9('0x69')]=0x0;this['erlangBusyFactor']=0x0;this[_0x5ad9('0x6a')]=_0x5ebb9d[_0x5ad9('0x6a')]||0x1e;this[_0x5ad9('0x6b')]=_0x5ebb9d['dialRecallInQueue']||![];this[_0x5ad9('0x6c')]=_0x5ebb9d[_0x5ad9('0x6c')]||undefined;this[_0x5ad9('0x6d')]=_0x5ebb9d['dialAgiAfterHangupClient']||![];this[_0x5ad9('0x6e')]=_0x5ebb9d['dialAgiAfterHangupAgent']||![];this[_0x5ad9('0x9')]=monitorFormat[_0x5ebb9d[_0x5ad9('0x9')]]?monitorFormat[_0x5ebb9d['monitor_format']]:undefined;this[_0x5ad9('0x6f')]=_0x5ebb9d[_0x5ad9('0x6f')]||![];this[_0x5ad9('0x70')]=_0x5ebb9d[_0x5ad9('0x70')]?_0x5ebb9d[_0x5ad9('0x70')]:undefined;}module[_0x5ad9('0x71')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index cf81a31..d21e6c4 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 _0x2eb1=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2eb1,0xb0));var _0x12eb=function(_0x49203e,_0x71c771){_0x49203e=_0x49203e-0x0;var _0x3e189e=_0x2eb1[_0x49203e];return _0x3e189e;};'use strict';function VtigerAccount(_0x21deb4){this['id']=_0x21deb4['id']||0x0;this[_0x12eb('0x0')]=_0x21deb4['name']||'';this[_0x12eb('0x1')]=_0x21deb4[_0x12eb('0x1')]||'';this[_0x12eb('0x2')]=_0x21deb4[_0x12eb('0x2')]||'';this[_0x12eb('0x3')]=_0x21deb4['remoteUri']||'';this[_0x12eb('0x4')]=_0x21deb4['serverUrl']||'';this[_0x12eb('0x5')]=_0x21deb4[_0x12eb('0x5')]||{};}module[_0x12eb('0x6')]=VtigerAccount; \ No newline at end of file +var _0x3011=['Configurations','name','accessKey','remoteUri','serverUrl'];(function(_0x2c333a,_0x5aa7e7){var _0xbc6bdc=function(_0x53c2e6){while(--_0x53c2e6){_0x2c333a['push'](_0x2c333a['shift']());}};_0xbc6bdc(++_0x5aa7e7);}(_0x3011,0xd8));var _0x1301=function(_0xa3d4b6,_0x44d5e8){_0xa3d4b6=_0xa3d4b6-0x0;var _0x49d9d5=_0x3011[_0xa3d4b6];return _0x49d9d5;};'use strict';function VtigerAccount(_0x3ddbdb){this['id']=_0x3ddbdb['id']||0x0;this[_0x1301('0x0')]=_0x3ddbdb['name']||'';this['username']=_0x3ddbdb['username']||'';this['accessKey']=_0x3ddbdb[_0x1301('0x1')]||'';this[_0x1301('0x2')]=_0x3ddbdb[_0x1301('0x2')]||'';this[_0x1301('0x3')]=_0x3ddbdb['serverUrl']||'';this[_0x1301('0x4')]=_0x3ddbdb[_0x1301('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 141802a..c120ba7 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 _0xdb28=['Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x58bd8d,_0x47e0f7){_0x58bd8d=_0x58bd8d-0x0;var _0x1c82cb=_0xdb28[_0x58bd8d];return _0x1c82cb;};'use strict';function ZendeskAccount(_0x2f1285){this['id']=_0x2f1285['id']||0x0;this[_0x8db2('0x0')]=_0x2f1285[_0x8db2('0x0')]||'';this[_0x8db2('0x1')]=_0x2f1285['username']||'';this[_0x8db2('0x2')]=_0x2f1285[_0x8db2('0x2')]||'';this[_0x8db2('0x3')]=_0x2f1285[_0x8db2('0x3')]||'';this[_0x8db2('0x4')]=_0x2f1285['remoteUri']||'';this[_0x8db2('0x5')]=_0x2f1285[_0x8db2('0x5')]||'';this['type']=_0x2f1285['type']||_0x8db2('0x6');this[_0x8db2('0x7')]=_0x2f1285[_0x8db2('0x7')]||'';this[_0x8db2('0x8')]=_0x2f1285[_0x8db2('0x8')]||{};}module[_0x8db2('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x7a54=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0x7a54,0x106));var _0x47a5=function(_0xaa4b6d,_0x19ca7d){_0xaa4b6d=_0xaa4b6d-0x0;var _0x492b62=_0x7a54[_0xaa4b6d];return _0x492b62;};'use strict';function ZendeskAccount(_0xe384a5){this['id']=_0xe384a5['id']||0x0;this[_0x47a5('0x0')]=_0xe384a5[_0x47a5('0x0')]||'';this['username']=_0xe384a5[_0x47a5('0x1')]||'';this[_0x47a5('0x2')]=_0xe384a5['password']||'';this[_0x47a5('0x3')]=_0xe384a5[_0x47a5('0x3')]||'';this[_0x47a5('0x4')]=_0xe384a5[_0x47a5('0x4')]||'';this[_0x47a5('0x5')]=_0xe384a5['authType']||'';this[_0x47a5('0x6')]=_0xe384a5['type']||_0x47a5('0x7');this[_0x47a5('0x8')]=_0xe384a5['serverUrl']||'';this[_0x47a5('0x9')]=_0xe384a5['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 845adfe..692bb4d 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 _0x29b1=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x508f18,_0x2ef952){var _0x2e3565=function(_0x39dc27){while(--_0x39dc27){_0x508f18['push'](_0x508f18['shift']());}};_0x2e3565(++_0x2ef952);}(_0x29b1,0x16d));var _0x129b=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x29b1[_0x16d10f];return _0x50c823;};'use strict';function ZohoAccount(_0x51b041){this['id']=_0x51b041['id']||0x0;this[_0x129b('0x0')]=_0x51b041[_0x129b('0x0')]||'';this[_0x129b('0x1')]=_0x51b041[_0x129b('0x1')]||'';this['host']=_0x51b041[_0x129b('0x2')]||'';this[_0x129b('0x3')]=_0x51b041[_0x129b('0x3')]||'';this[_0x129b('0x4')]=_0x51b041[_0x129b('0x4')]||'';this[_0x129b('0x5')]=_0x51b041[_0x129b('0x5')]||'';this[_0x129b('0x6')]=_0x51b041['serverUrl']||'';this[_0x129b('0x7')]=_0x51b041['code']||'';this[_0x129b('0x8')]=_0x51b041[_0x129b('0x8')]||'';this['Configurations']=_0x51b041[_0x129b('0x9')]||{};}module[_0x129b('0xa')]=ZohoAccount; \ No newline at end of file +var _0x110f=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','host','zone','clientId'];(function(_0x14520e,_0x4d5e5a){var _0x280304=function(_0x57f839){while(--_0x57f839){_0x14520e['push'](_0x14520e['shift']());}};_0x280304(++_0x4d5e5a);}(_0x110f,0x1e6));var _0xf110=function(_0x33ab65,_0x1de6ab){_0x33ab65=_0x33ab65-0x0;var _0x49517b=_0x110f[_0x33ab65];return _0x49517b;};'use strict';function ZohoAccount(_0x3d193d){this['id']=_0x3d193d['id']||0x0;this[_0xf110('0x0')]=_0x3d193d['name']||'';this['description']=_0x3d193d['description']||'';this[_0xf110('0x1')]=_0x3d193d['host']||'';this[_0xf110('0x2')]=_0x3d193d[_0xf110('0x2')]||'';this[_0xf110('0x3')]=_0x3d193d['clientId']||'';this[_0xf110('0x4')]=_0x3d193d[_0xf110('0x4')]||'';this[_0xf110('0x5')]=_0x3d193d['serverUrl']||'';this[_0xf110('0x6')]=_0x3d193d[_0xf110('0x6')]||'';this[_0xf110('0x7')]=_0x3d193d['refreshToken']||'';this[_0xf110('0x8')]=_0x3d193d[_0xf110('0x8')]||{};}module[_0xf110('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index be69dcd..008fd71 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 _0x9f4c=['Agent','channelAgent','membername','format','calleridname','phone','Contact','firstName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer'];(function(_0x5d0b54,_0x2b2115){var _0x27c235=function(_0x4329a2){while(--_0x4329a2){_0x5d0b54['push'](_0x5d0b54['shift']());}};_0x27c235(++_0x2b2115);}(_0x9f4c,0xfd));var _0xc9f4=function(_0x2abd4e,_0x273eb7){_0x2abd4e=_0x2abd4e-0x0;var _0x4be7e5=_0x9f4c[_0x2abd4e];return _0x4be7e5;};'use strict';var util=require(_0xc9f4('0x0'));var _=require(_0xc9f4('0x1'));var moment=require('moment');function checkNameSurname(_0x5584db,_0x5257ed,_0x58697e){var _0x202c67='';if(!_[_0xc9f4('0x2')](_0x5257ed)&&'string'===typeof _0x5257ed){_0x202c67+=_0x5257ed;}if(!_[_0xc9f4('0x2')](_0x58697e)&&_0xc9f4('0x3')===typeof _0x58697e){_0x202c67+='\x20'+_0x58697e;}if(_0x202c67!==''){return _0x202c67;}return _0x5584db;}function Action(_0xe86470,_0x1dbc2c,_0x5b71e9,_0x3f5ee9,_0xa9797b){this[_0xc9f4('0x4')]=_0x5b71e9||undefined;this[_0xc9f4('0x5')]=_0xe86470['id'];this[_0xc9f4('0x6')]=_0x1dbc2c[_0xc9f4('0x7')];this[_0xc9f4('0x8')]=_0x1dbc2c['type'];this[_0xc9f4('0x9')]='queue';this[_0xc9f4('0xa')]=![];this['membername']=_[_0xc9f4('0x2')](_0xe86470[_0xc9f4('0xb')])?undefined:_0xe86470['Agent'][_0xc9f4('0x7')];this[_0xc9f4('0xc')]=this[_0xc9f4('0xd')]?util[_0xc9f4('0xe')]('SIP/%s',this[_0xc9f4('0xd')]):_0x3f5ee9||undefined;this[_0xc9f4('0xf')]=checkNameSurname(_0xe86470['Contact'][_0xc9f4('0x10')],_0xe86470[_0xc9f4('0x11')][_0xc9f4('0x12')],_0xe86470[_0xc9f4('0x11')]['lastName']);this[_0xc9f4('0x13')]=_0xe86470[_0xc9f4('0x13')]||![];this['calleridnum']=_0xe86470[_0xc9f4('0x11')][_0xc9f4('0x10')];this[_0xc9f4('0x14')]=_0xe86470['scheduledat'];this[_0xc9f4('0x15')]=_0xe86470['countbusyretry']||0x0;this['countcongestionretry']=_0xe86470[_0xc9f4('0x16')]||0x0;this[_0xc9f4('0x17')]=_0xe86470[_0xc9f4('0x17')]||0x0;this['countglobal']=(_0xe86470[_0xc9f4('0x15')]||0x0)+(_0xe86470[_0xc9f4('0x16')]||0x0)+(_0xe86470[_0xc9f4('0x17')]||0x0);this[_0xc9f4('0x18')]=_0xe86470['countnosuchnumberretry']||0x0;this[_0xc9f4('0x19')]=_0xe86470[_0xc9f4('0x19')]||0x0;this[_0xc9f4('0x1a')]=_0xe86470[_0xc9f4('0x1a')]||0x0;this[_0xc9f4('0x1b')]=_0xe86470[_0xc9f4('0x1b')]||0x0;this[_0xc9f4('0x1c')]=_0xe86470[_0xc9f4('0x1c')]||0x0;this[_0xc9f4('0x1d')]=_0xe86470[_0xc9f4('0x1d')];this[_0xc9f4('0x1e')]=_0xe86470[_0xc9f4('0x1e')];this[_0xc9f4('0x1f')]=_0xe86470['callbackat'];this[_0xc9f4('0x20')]=_0xe86470[_0xc9f4('0x20')];this[_0xc9f4('0x21')]=_0xe86470[_0xc9f4('0x21')];this[_0xc9f4('0x22')]=_0xe86470[_0xc9f4('0x22')];this[_0xc9f4('0x23')]=_[_0xc9f4('0x2')](_0xe86470[_0xc9f4('0xb')])?_0xe86470[_0xc9f4('0x23')]:_0xe86470[_0xc9f4('0xb')]['id'];this[_0xc9f4('0x24')]=_0xe86470[_0xc9f4('0x24')];this[_0xc9f4('0x25')]='';this[_0xc9f4('0x26')]='';}Action[_0xc9f4('0x27')][_0xc9f4('0x28')]=function(){return util[_0xc9f4('0xe')](_0xc9f4('0x29'),this['calleridname'],this[_0xc9f4('0x2a')]);};module[_0xc9f4('0x2b')]=Action; \ No newline at end of file +var _0x8324=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','phone','Contact','active','calleridnum'];(function(_0x5ce4cf,_0x4517b0){var _0x2a1f9b=function(_0x364de7){while(--_0x364de7){_0x5ce4cf['push'](_0x5ce4cf['shift']());}};_0x2a1f9b(++_0x4517b0);}(_0x8324,0x1c5));var _0x4832=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x8324[_0x5774be];return _0x4914b4;};'use strict';var util=require(_0x4832('0x0'));var _=require('lodash');var moment=require(_0x4832('0x1'));function checkNameSurname(_0x4d74b5,_0x47ced5,_0x23fbb0){var _0x548279='';if(!_[_0x4832('0x2')](_0x47ced5)&&'string'===typeof _0x47ced5){_0x548279+=_0x47ced5;}if(!_[_0x4832('0x2')](_0x23fbb0)&&_0x4832('0x3')===typeof _0x23fbb0){_0x548279+='\x20'+_0x23fbb0;}if(_0x548279!==''){return _0x548279;}return _0x4d74b5;}function Action(_0x152b24,_0x639623,_0x1a1add,_0x440b53,_0xfd6934){this[_0x4832('0x4')]=_0x1a1add||undefined;this['idContact']=_0x152b24['id'];this[_0x4832('0x5')]=_0x639623[_0x4832('0x6')];this[_0x4832('0x7')]=_0x639623[_0x4832('0x7')];this[_0x4832('0x8')]=_0x4832('0x5');this[_0x4832('0x9')]=![];this[_0x4832('0xa')]=_[_0x4832('0x2')](_0x152b24['Agent'])?undefined:_0x152b24[_0x4832('0xb')]['name'];this[_0x4832('0xc')]=this['membername']?util[_0x4832('0xd')](_0x4832('0xe'),this[_0x4832('0xa')]):_0x440b53||undefined;this[_0x4832('0xf')]=checkNameSurname(_0x152b24['Contact'][_0x4832('0x10')],_0x152b24['Contact']['firstName'],_0x152b24[_0x4832('0x11')]['lastName']);this[_0x4832('0x12')]=_0x152b24[_0x4832('0x12')]||![];this[_0x4832('0x13')]=_0x152b24[_0x4832('0x11')][_0x4832('0x10')];this['scheduledat']=_0x152b24[_0x4832('0x14')];this[_0x4832('0x15')]=_0x152b24['countbusyretry']||0x0;this[_0x4832('0x16')]=_0x152b24[_0x4832('0x16')]||0x0;this[_0x4832('0x17')]=_0x152b24[_0x4832('0x17')]||0x0;this[_0x4832('0x18')]=(_0x152b24['countbusyretry']||0x0)+(_0x152b24['countcongestionretry']||0x0)+(_0x152b24['countnoanswerretry']||0x0);this[_0x4832('0x19')]=_0x152b24[_0x4832('0x19')]||0x0;this[_0x4832('0x1a')]=_0x152b24[_0x4832('0x1a')]||0x0;this[_0x4832('0x1b')]=_0x152b24[_0x4832('0x1b')]||0x0;this[_0x4832('0x1c')]=_0x152b24[_0x4832('0x1c')]||0x0;this[_0x4832('0x1d')]=_0x152b24['countagentrejectretry']||0x0;this[_0x4832('0x1e')]=_0x152b24[_0x4832('0x1e')];this['callbackuniqueid']=_0x152b24[_0x4832('0x1f')];this[_0x4832('0x20')]=_0x152b24['callbackat'];this['recallme']=_0x152b24[_0x4832('0x21')];this[_0x4832('0x22')]=_0x152b24[_0x4832('0x22')];this['ListId']=_0x152b24['ListId'];this[_0x4832('0x23')]=_[_0x4832('0x2')](_0x152b24['Agent'])?_0x152b24[_0x4832('0x23')]:_0x152b24['Agent']['id'];this[_0x4832('0x24')]=_0x152b24[_0x4832('0x24')];this[_0x4832('0x25')]='';this[_0x4832('0x26')]='';}Action[_0x4832('0x27')][_0x4832('0x28')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x4832('0xf')],this[_0x4832('0x29')]);};module[_0x4832('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 6f00e91..75c6ba2 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 _0x4bd2=['syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','name','answered','available','pTalking','sumBillable','talking','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','prototype','hasOwnProperty','booked','outbound','clearZombieChannels','type','dialActive','setMessage','clearZombieChannel','isNil','Queue','actions','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','size','recallMe','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','totalGlobal','NoSuchNumber','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','NOANSWER','countglobal','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','unlockAgent','CONGESTION','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countcongestionretry','[syncHangupRequest][logAgentReject]','unlockContact','idContact','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','linkedid','updateOriginated','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','lookAgent','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][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','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','toLowerVariables','variablesAction','[originated][increment]','OriginateError','actionid','logLookAgent','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse'];(function(_0x1f1074,_0xf7500f){var _0x5db936=function(_0xba1215){while(--_0xba1215){_0x1f1074['push'](_0x1f1074['shift']());}};_0x5db936(++_0xf7500f);}(_0x4bd2,0x11d));var _0x24bd=function(_0x4b3f94,_0x1ba210){_0x4b3f94=_0x4b3f94-0x0;var _0x39bc1=_0x4bd2[_0x4b3f94];return _0x39bc1;};'use strict';var util=require(_0x24bd('0x0'));var _=require(_0x24bd('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x24bd('0x2'));var md5=require(_0x24bd('0x3'));var Redis=require(_0x24bd('0x4'));var config=require(_0x24bd('0x5'));var logger=require(_0x24bd('0x6'))(_0x24bd('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x24bd('0x8'));var rpcDb=require(_0x24bd('0x9'));var Action=require(_0x24bd('0xa'));var ut=require(_0x24bd('0xb'));config['redis']=_[_0x24bd('0xc')](config[_0x24bd('0xd')],{'host':_0x24bd('0xe'),'port':0x18eb});var io=require(_0x24bd('0xf'))(new Redis(config[_0x24bd('0xd')]));var Sequence=function(){};Sequence['prototype'][_0x24bd('0x10')]=function(_0x4903b3){this[_0x24bd('0x11')]=this[_0x24bd('0x11')]?this[_0x24bd('0x11')][_0x24bd('0x12')](_0x4903b3):_0x4903b3();};function Preview(_0x18131a){this[_0x24bd('0x13')]=new Sequence();this[_0x24bd('0x14')]=_0x18131a[_0x24bd('0x15')];this[_0x24bd('0x16')]=_0x18131a[_0x24bd('0x16')];this['actions']={};this[_0x24bd('0x17')]=_0x18131a[_0x24bd('0x17')];this[_0x24bd('0x18')]=0x0;ami['on'](_0x24bd('0x19'),this[_0x24bd('0x1a')]['bind'](this));ami['on'](_0x24bd('0x1b'),this[_0x24bd('0x1c')][_0x24bd('0x1d')](this));ami['on'](_0x24bd('0x1e'),this[_0x24bd('0x1f')]['bind'](this));ami['on']('dialend',this[_0x24bd('0x20')][_0x24bd('0x1d')](this));ami['on'](_0x24bd('0x21'),this[_0x24bd('0x22')][_0x24bd('0x1d')](this));ami['on']('varset',this[_0x24bd('0x23')][_0x24bd('0x1d')](this));ami['on'](_0x24bd('0x24'),this[_0x24bd('0x25')]['bind'](this));ami['on'](_0x24bd('0x26'),this[_0x24bd('0x27')][_0x24bd('0x1d')](this));this['loopCampaigns'](this[_0x24bd('0x14')]);}function emit(_0x10a45f,_0x5b6756,_0x34fbf7){io['to'](_0x10a45f)[_0x24bd('0x28')](_0x5b6756,_0x34fbf7);}function emitCampaignPreview(_0x153c91){if(_0x153c91['type']==='outbound'){var _0x44af8b={'id':_0x153c91['id'],'name':_0x153c91[_0x24bd('0x29')],'strategy':_0x153c91['strategy'],'answered':_0x153c91[_0x24bd('0x2a')],'available':_0x153c91[_0x24bd('0x2b')],'loggedIn':_0x153c91['loggedIn'],'pTalking':_0x153c91[_0x24bd('0x2c')],'sumBillable':_0x153c91[_0x24bd('0x2d')],'sumDuration':_0x153c91['sumDuration'],'sumHoldTime':_0x153c91['sumHoldTime']||0x0,'talking':_0x153c91[_0x24bd('0x2e')],'total':_0x153c91['total'],'type':_0x153c91['type'],'unmanaged':_0x153c91['unmanaged'],'abandoned':_0x153c91['abandoned'],'waiting':_0x153c91[_0x24bd('0x2f')],'loggedInDb':_0x153c91['loggedInDb'],'dialActive':_0x153c91['dialActive'],'dialMethod':_0x153c91[_0x24bd('0x30')],'dialOriginateCallerIdName':_0x153c91[_0x24bd('0x31')],'dialOriginateCallerIdNumber':_0x153c91[_0x24bd('0x32')],'dialOriginateTimeout':_0x153c91[_0x24bd('0x33')],'dialPrefix':_0x153c91['dialPrefix'],'outboundAnswerAgiCallsDay':_0x153c91['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x153c91[_0x24bd('0x34')],'outboundBlacklistCallsDay':_0x153c91['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x153c91[_0x24bd('0x35')],'outboundCongestionCallsDay':_0x153c91[_0x24bd('0x36')],'outboundDropCallsDayACS':_0x153c91['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x153c91['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x153c91['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x153c91['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x153c91['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x153c91[_0x24bd('0x37')],'outboundReCallsDay':_0x153c91[_0x24bd('0x38')],'outboundRejectCallsDay':_0x153c91[_0x24bd('0x39')],'outboundUnknownCallsDay':_0x153c91[_0x24bd('0x3a')],'outboundAbandonedCallsDay':_0x153c91['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x153c91[_0x24bd('0x3b')],'predictiveIntervalAvgHoldtime':_0x153c91['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x153c91[_0x24bd('0x3c')],'predictiveIntervalDroppedCallsCallersExit':_0x153c91[_0x24bd('0x3d')],'predictiveIntervalDroppedCallsTimeout':_0x153c91[_0x24bd('0x3e')],'predictiveIntervalErlangCalls':_0x153c91['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x153c91[_0x24bd('0x3f')],'predictiveIntervalHitRate':_0x153c91['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x153c91[_0x24bd('0x40')],'predictiveIntervalPauses':_0x153c91['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x153c91['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x153c91[_0x24bd('0x41')],'message':_0x153c91[_0x24bd('0x42')],'originated':_0x153c91[_0x24bd('0x43')],'erlangCalls':_0x153c91[_0x24bd('0x44')],'erlangCallToSecond':_0x153c91[_0x24bd('0x45')],'erlangAbandonmentRate':_0x153c91[_0x24bd('0x46')],'erlangBusyFactor':_0x153c91['erlangBusyFactor'],'startPredictive':_0x153c91['startPredictive'],'startProgressive':_0x153c91[_0x24bd('0x47')]};if(_0x153c91[_0x24bd('0x48')]){_0x44af8b['Trunk']={'id':_0x153c91['Trunk']['id'],'name':_0x153c91[_0x24bd('0x48')]['name'],'active':_0x153c91[_0x24bd('0x48')][_0x24bd('0x49')],'callerid':_0x153c91[_0x24bd('0x48')][_0x24bd('0x4a')]};}if(_0x153c91[_0x24bd('0x4b')]){_0x44af8b[_0x24bd('0x4b')]={'id':_0x153c91[_0x24bd('0x4b')]['id'],'name':_0x153c91[_0x24bd('0x4b')][_0x24bd('0x29')]};}var _0x32928f=md5(JSON[_0x24bd('0x4c')](_0x44af8b));if(_0x153c91[_0x24bd('0x3')]!==_0x32928f){_0x153c91[_0x24bd('0x3')]=_0x32928f;emit(util[_0x24bd('0x4d')](_0x24bd('0x4e'),_0x44af8b[_0x24bd('0x29')]),_0x24bd('0x4f'),_0x44af8b);}}}function emitVoiceQueueChannelRemove(_0x592ca8){logger[_0x24bd('0x50')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x592ca8));emit(util['format'](_0x24bd('0x4e'),_0x592ca8[_0x24bd('0x29')]),'voice_queue_channel:remove',_0x592ca8);}function notSendMessagesQueue(_0x19b9c1){if(_0x19b9c1['sendMessageOneNotActive']){if(_0x19b9c1['originated']===0x0&&_0x19b9c1['pTalking']===0x0){_0x19b9c1[_0x24bd('0x51')]=![];_0x19b9c1[_0x24bd('0x2b')]=0x0;_0x19b9c1[_0x24bd('0x52')]=0x0;_0x19b9c1[_0x24bd('0x42')]=_0x24bd('0x53');ut[_0x24bd('0x54')](_0x24bd('0x55'),_0x19b9c1['name']+_0x24bd('0x56'));}else{_0x19b9c1[_0x24bd('0x42')]=_0x24bd('0x57');ut[_0x24bd('0x54')](_0x24bd('0x55'),_0x19b9c1['name']+_0x24bd('0x58'));}emitCampaignPreview(_0x19b9c1);}}Preview['prototype'][_0x24bd('0x59')]=function(){var _0x443742=this;setInterval(function(){_0x443742[_0x24bd('0x5a')]();},0x7cf);};Preview[_0x24bd('0x5b')][_0x24bd('0x5a')]=function(){var _0xe221cb=this[_0x24bd('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x5752b3 in _0xe221cb){if(_0xe221cb[_0x24bd('0x5c')](_0x5752b3)&&(_0xe221cb[_0x5752b3][_0x24bd('0x30')]===_0x24bd('0x7')||_0xe221cb[_0x5752b3][_0x24bd('0x30')]===_0x24bd('0x5d'))&&_0xe221cb[_0x5752b3]['type']===_0x24bd('0x5e')){if(this[_0x24bd('0x18')]>0x7){this[_0x24bd('0x18')]=0x0;this[_0x24bd('0x5f')]();}}if(_0xe221cb['hasOwnProperty'](_0x5752b3)&&_0xe221cb[_0x5752b3]['dialMethod']===_0x24bd('0x7')&&_0xe221cb[_0x5752b3][_0x24bd('0x60')]==='outbound'){if(_0xe221cb[_0x5752b3][_0x24bd('0x61')]){this[_0x24bd('0x62')](_0xe221cb[_0x5752b3]);this['recallMe'](_0xe221cb[_0x5752b3]);}else{notSendMessagesQueue(_0xe221cb[_0x5752b3]);}}}};Preview[_0x24bd('0x5b')][_0x24bd('0x63')]=function(_0x4d18c3){var _0x3aabf8=this;this[_0x24bd('0x13')][_0x24bd('0x10')](function(){if(!_[_0x24bd('0x64')](_0x3aabf8['actions'][_0x4d18c3])){loggerAction[_0x24bd('0x50')]('[clearZombieChannels][talking]',_0x4d18c3,_0x24bd('0x65'),_0x3aabf8[_0x24bd('0x66')][_0x4d18c3][_0x24bd('0x67')],_0x24bd('0x68'),JSON[_0x24bd('0x4c')](_0x3aabf8[_0x24bd('0x14')][_0x3aabf8['actions'][_0x4d18c3][_0x24bd('0x67')]][_0x24bd('0x43')]),_0x24bd('0x69'),JSON[_0x24bd('0x4c')](_0x3aabf8[_0x24bd('0x14')][_0x3aabf8[_0x24bd('0x66')][_0x4d18c3]['queue']][_0x24bd('0x2c')]),JSON[_0x24bd('0x4c')](_0x3aabf8[_0x24bd('0x66')][_0x4d18c3][_0x24bd('0x6a')]),JSON[_0x24bd('0x4c')](_[_0x24bd('0x6b')](_0x3aabf8['actions'][_0x4d18c3],[_0x24bd('0x6c'),_0x24bd('0x6d'),_0x24bd('0x6e'),_0x24bd('0x6f')])));return ami[_0x24bd('0x70')]({'action':_0x24bd('0x71'),'channel':_0x3aabf8['actions'][_0x4d18c3][_0x24bd('0x72')]})['catch'](function(_0x441a37){if(_0x441a37[_0x24bd('0x42')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3aabf8[_0x24bd('0x66')][_0x4d18c3]){ut['updateOriginated'](_0x3aabf8[_0x24bd('0x14')][_0x3aabf8[_0x24bd('0x66')][_0x4d18c3]['queue']],_0x24bd('0x73'));if(_0x3aabf8['actions'][_0x4d18c3][_0x24bd('0x6a')]===!![]){ut[_0x24bd('0x74')](_0x3aabf8[_0x24bd('0x14')][_0x3aabf8[_0x24bd('0x66')][_0x4d18c3][_0x24bd('0x67')]],'[clearZombieChannel]');ut[_0x24bd('0x75')]('[Dialer][checkChannel][pTalking][Preview]'+_0x4d18c3,_0x3aabf8[_0x24bd('0x66')][_0x4d18c3]['queue']);}ut[_0x24bd('0x75')](_0x24bd('0x76')+_0x4d18c3,_0x3aabf8['actions'][_0x4d18c3][_0x24bd('0x67')]);delete _0x3aabf8[_0x24bd('0x66')][_0x4d18c3];}},0x2328);}});}});};Preview[_0x24bd('0x5b')]['clearZombieChannels']=function(){var _0x4b6201=this;loggerAction[_0x24bd('0x50')]('[action]',_[_0x24bd('0x77')](this['actions']));for(var _0x367041 in this['actions']){if(_0x4b6201['actions'][_0x24bd('0x5c')](_0x367041)){_0x4b6201[_0x24bd('0x63')](_0x367041);}}};Preview['prototype'][_0x24bd('0x78')]=function(_0x5145c0){var _0x37cbe3=this;rpcDb['getContactRecallMe'](_0x5145c0['id'],ut['agentReadyId'](this['agents']))[_0x24bd('0x79')](function(_0x1f67a7){if(!_[_0x24bd('0x64')](_0x1f67a7)){for(var _0x38d237=0x0;_0x38d237<_0x1f67a7['length'];_0x38d237+=0x1){if(ut[_0x24bd('0x7a')](_0x1f67a7[_0x38d237][_0x24bd('0x7b')])<_0x5145c0[_0x24bd('0x7c')]*0x3c){if(_0x1f67a7[_0x38d237]['Agent']&&!_0x1f67a7[_0x38d237][_0x24bd('0x7d')][_0x24bd('0x7e')]){_0x37cbe3[_0x24bd('0x7f')](_0x1f67a7[_0x38d237]['id'])[_0x24bd('0x79')](ut[_0x24bd('0x80')](_0x24bd('0x81')))[_0x24bd('0x82')](ut[_0x24bd('0x80')](_0x24bd('0x81')));}else{rpcDb[_0x24bd('0x83')](_0x1f67a7[_0x38d237]['id']);}}else{var _0x54a192=new Action(_0x1f67a7[_0x38d237],_0x5145c0);_0x54a192[_0x24bd('0x84')]=moment()[_0x24bd('0x4d')](_0x24bd('0x85'));_0x5145c0[_0x24bd('0x38')]+=0x1;ut[_0x24bd('0x86')](_0x54a192,0x17,_0x24bd('0x87'));if(_0x5145c0[_0x24bd('0x88')]){rpcDb['rescheduleContactInQueue'](ut[_0x24bd('0x89')](_0x1f67a7[_0x38d237]));rpcDb[_0x24bd('0x8a')](_0x54a192,_0x24bd('0x8b'));}else{ut[_0x24bd('0x86')](_0x54a192,0x16,_0x24bd('0x8c'));rpcDb[_0x24bd('0x8a')](_0x54a192,_0x24bd('0x8d'));rpcDb['createCustomerFinal'](_0x54a192,_0x24bd('0x8d'));}}}}})[_0x24bd('0x82')](ut[_0x24bd('0x80')]('[getContactRecallMe]'));};Preview[_0x24bd('0x5b')][_0x24bd('0x62')]=function(_0xaa3881){_0xaa3881['sendMessageOneNotActive']=!![];if(ut[_0x24bd('0x8e')](_0xaa3881[_0x24bd('0x8f')])){_0xaa3881[_0x24bd('0x42')]=_0x24bd('0x90');}else if(!ut[_0x24bd('0x91')](_0xaa3881[_0x24bd('0x61')])){_0xaa3881[_0x24bd('0x42')]=_0x24bd('0x53');}else if(!this['isTrunkReachable'](_0xaa3881[_0x24bd('0x48')])){if(!this[_0x24bd('0x92')](_0xaa3881[_0x24bd('0x93')])){_0xaa3881[_0x24bd('0x42')]=_0x24bd('0x94');}else{_0xaa3881[_0x24bd('0x42')]='ACTIVE';}}else{_0xaa3881[_0x24bd('0x42')]=_0x24bd('0x95');}emitCampaignPreview(_0xaa3881);};Preview[_0x24bd('0x5b')][_0x24bd('0x96')]=function(_0x415435,_0xa36eaa,_0x241695){var _0x3d7600=this;var _0x446ac6=this[_0x24bd('0x66')][_0xa36eaa];var _0x22840c=this[_0x24bd('0x14')][_0x446ac6[_0x24bd('0x67')]];var _0x492a76;if(_0x22840c){switch(_0x241695){case'1':_0x22840c[_0x24bd('0x97')]+=0x1;_0x446ac6['countnosuchnumberretry']+=0x1;_0x446ac6['countglobal']=ut[_0x24bd('0x98')](_0x446ac6);ut[_0x24bd('0x86')](_0x446ac6,0x0,_0x24bd('0x99'));rpcDb[_0x24bd('0x8a')](_0x446ac6,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x446ac6)>=_0x22840c[_0x24bd('0x9a')]){_0x492a76=ut[_0x24bd('0x9b')](_0x446ac6,0xf,_0x24bd('0x9c'));rpcDb[_0x24bd('0x9d')](_0x492a76,_0x24bd('0x9e'));}else{if(_0x446ac6['countnosuchnumberretry']>=_0x22840c[_0x24bd('0x9f')]){rpcDb[_0x24bd('0x9d')](_0x446ac6,_0x24bd('0x9e'));}else{rpcDb[_0x24bd('0xa0')](ut[_0x24bd('0xa1')](_0x446ac6,'countnosuchnumberretry',_0x22840c[_0x24bd('0xa2')]),_0x446ac6['unlockAgent'],_0x446ac6[_0x24bd('0xa3')]);}}delete this[_0x24bd('0x66')][_0x415435['linkedid']];break;case _0x24bd('0xa4'):var _0x34b303=moment()[_0x24bd('0x4d')](_0x24bd('0x85'));_0x446ac6[_0x24bd('0xa5')]=_0x34b303;_0x446ac6[_0x24bd('0xa6')]=_0x34b303;_0x446ac6[_0x24bd('0x6a')]=!![];_0x22840c[_0x24bd('0x2c')]+=0x1;logger[_0x24bd('0x50')](_0x24bd('0xa7'),_0x446ac6[_0x24bd('0xa8')],'\x20Queue',_0x22840c[_0x24bd('0x29')],_0x24bd('0x69'),_0x22840c[_0x24bd('0x2c')]);ami['emit'](_0x24bd('0xa9'),ut[_0x24bd('0xaa')](_0x446ac6,_0x24bd('0xab')));if(_0x22840c[_0x24bd('0xac')]){ami[_0x24bd('0x28')](_0x24bd('0xad'),ut[_0x24bd('0xae')](_0x446ac6));}break;case'16':ami['emit'](_0x24bd('0xaf'),ut['buildObj'](_0x446ac6,_0x24bd('0xb0')));emitVoiceQueueChannelRemove(ut[_0x24bd('0xaa')](_0x446ac6,_0x24bd('0xb0')));_0x22840c[_0x24bd('0x34')]+=0x1;_0x22840c[_0x24bd('0xb1')]+=0x1;_0x22840c['answered']+=0x1;ut['decrementTalkink'](_0x22840c,_0x24bd('0xb2'));_0x446ac6['countglobal']=ut[_0x24bd('0x98')](_0x446ac6);ut['logCustomer'](_0x446ac6,0x4,_0x24bd('0xb3'));rpcDb[_0x24bd('0x8a')](_0x446ac6,_0x24bd('0xb4'));rpcDb[_0x24bd('0x9d')](_0x446ac6,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x24bd('0xb5')](_0x446ac6);_0x22840c[_0x24bd('0xb6')]+=_0x446ac6['talktime'];_0x22840c[_0x24bd('0x2d')]+=_0x446ac6['talktime'];logger[_0x24bd('0x50')](_0x24bd('0xb7'),_0x446ac6[_0x24bd('0xa8')],_0x24bd('0xb8'),_0x22840c[_0x24bd('0x29')],_0x24bd('0x69'),_0x22840c[_0x24bd('0x2c')]);delete this['actions'][_0x415435['linkedid']];break;case _0x24bd('0xb9'):_0x22840c[_0x24bd('0x35')]+=0x1;_0x446ac6[_0x24bd('0xba')]+=0x1;_0x446ac6['countglobal']=ut[_0x24bd('0x98')](_0x446ac6);ut['logCustomer'](_0x446ac6,0x5,'Busy');rpcDb[_0x24bd('0x8a')](_0x446ac6,_0x24bd('0xbb'));if(ut['totalGlobal'](_0x446ac6)>=_0x22840c['dialGlobalMaxRetry']){_0x492a76=ut[_0x24bd('0x9b')](_0x446ac6,0xf,'Global');rpcDb['createCustomerFinal'](_0x492a76,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x446ac6[_0x24bd('0xba')]>=_0x22840c['dialBusyMaxRetry']){rpcDb[_0x24bd('0x9d')](_0x446ac6,_0x24bd('0xbb'));}else{rpcDb[_0x24bd('0xa0')](ut[_0x24bd('0xa1')](_0x446ac6,_0x24bd('0xba'),_0x22840c[_0x24bd('0xbc')]),_0x446ac6['unlockAgent'],_0x446ac6[_0x24bd('0xa3')]);}}break;case _0x24bd('0xbd'):_0x22840c['outboundNoAnswerCallsDay']+=0x1;_0x446ac6['countnoanswerretry']+=0x1;_0x446ac6[_0x24bd('0xbe')]=ut['totalGlobal'](_0x446ac6);ut[_0x24bd('0x86')](_0x446ac6,0x3,_0x24bd('0xbf'));rpcDb[_0x24bd('0x8a')](_0x446ac6,_0x24bd('0xc0'));if(ut['totalGlobal'](_0x446ac6)>=_0x22840c[_0x24bd('0x9a')]){_0x492a76=ut[_0x24bd('0x9b')](_0x446ac6,0xf,_0x24bd('0x9c'));rpcDb[_0x24bd('0x9d')](_0x492a76,_0x24bd('0xc1'));}else{if(_0x446ac6[_0x24bd('0xc2')]>=_0x22840c[_0x24bd('0xc3')]){rpcDb[_0x24bd('0x9d')](_0x446ac6,_0x24bd('0xc0'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x446ac6,_0x24bd('0xc2'),_0x22840c[_0x24bd('0xc4')]),_0x446ac6[_0x24bd('0xc5')],_0x446ac6[_0x24bd('0xa3')]);}}break;case _0x24bd('0xc6'):_0x22840c[_0x24bd('0x36')]+=0x1;_0x446ac6['countcongestionretry']+=0x1;_0x446ac6['countglobal']=ut['totalGlobal'](_0x446ac6);ut['logCustomer'](_0x446ac6,0x8,_0x24bd('0xc7'));rpcDb[_0x24bd('0x8a')](_0x446ac6,_0x24bd('0xc8'));if(ut[_0x24bd('0x98')](_0x446ac6)>=_0x22840c[_0x24bd('0x9a')]){_0x492a76=ut[_0x24bd('0x9b')](_0x446ac6,0xf,_0x24bd('0x9c'));rpcDb['createCustomerFinal'](_0x492a76,_0x24bd('0xc9'));}else{if(_0x446ac6['countcongestionretry']>=_0x22840c[_0x24bd('0xca')]){rpcDb[_0x24bd('0x9d')](_0x446ac6,_0x24bd('0xc8'));}else{rpcDb[_0x24bd('0xa0')](ut['scheduledAt'](_0x446ac6,_0x24bd('0xcb'),_0x22840c[_0x24bd('0xbc')]),_0x446ac6[_0x24bd('0xc5')],_0x446ac6[_0x24bd('0xa3')]);}}break;case'CANCEL':_0x22840c[_0x24bd('0x39')]+=0x1;_0x446ac6[_0x24bd('0xbe')]=ut[_0x24bd('0x98')](_0x446ac6);ut[_0x24bd('0x86')](_0x446ac6,0x14,'AgentReject');rpcDb['createCustomerHistory'](_0x446ac6,_0x24bd('0xcc'));if(_0x446ac6[_0x24bd('0xc5')]){rpcDb[_0x24bd('0xcd')](_0x446ac6[_0x24bd('0xce')]);}if(_0x446ac6[_0x24bd('0xa3')]){rpcDb[_0x24bd('0x83')](_0x446ac6[_0x24bd('0xce')]);}break;case _0x24bd('0xcf'):_0x22840c[_0x24bd('0xd0')]+=0x1;_0x446ac6[_0x24bd('0xd1')]+=0x1;_0x446ac6['countglobal']=ut[_0x24bd('0x98')](_0x446ac6);ut[_0x24bd('0x86')](_0x446ac6,0xb,_0x24bd('0xd2'));rpcDb['createCustomerHistory'](_0x446ac6,_0x24bd('0xd3'));if(ut[_0x24bd('0x98')](_0x446ac6)>=_0x22840c[_0x24bd('0x9a')]){_0x492a76=ut[_0x24bd('0x9b')](_0x446ac6,0xf,_0x24bd('0x9c'));rpcDb['createCustomerFinal'](_0x492a76,_0x24bd('0xd3'));}else{if(_0x446ac6[_0x24bd('0xd4')]>=_0x22840c[_0x24bd('0xd5')]){rpcDb[_0x24bd('0x9d')](_0x446ac6,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x24bd('0xa0')](ut['scheduledAt'](_0x446ac6,_0x24bd('0xd1'),_0x22840c[_0x24bd('0xd6')]),_0x446ac6[_0x24bd('0xc5')],_0x446ac6[_0x24bd('0xa3')]);}}break;default:if(_0x446ac6[_0x24bd('0x6a')]){ut['decrementTalkink'](_0x22840c,'[default]');ut[_0x24bd('0x75')](_0x24bd('0xd7')+_0x22840c[_0x24bd('0x29')],_0x415435);}_0x22840c[_0x24bd('0x3a')]+=0x1;_0x446ac6[_0x24bd('0xbe')]=ut['totalGlobal'](_0x446ac6);ut[_0x24bd('0x86')](_0x446ac6,0xc,_0x415435['cause-txt']||_0x415435[_0x24bd('0xd8')]);rpcDb['createCustomerHistory'](_0x446ac6,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x24bd('0x98')](_0x446ac6)>=_0x22840c[_0x24bd('0x9a')]){_0x492a76=ut['cloneAction'](_0x446ac6,0xf,_0x24bd('0x9c'));rpcDb[_0x24bd('0x9d')](_0x492a76,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x24bd('0x9d')](_0x446ac6,_0x24bd('0xd9'));}delete this['actions'][_0x415435[_0x24bd('0xda')]];}if(!(_0x446ac6[_0x24bd('0x6a')]&&_0x241695==='16')){ut[_0x24bd('0xdb')](_0x22840c,_0x24bd('0xdc'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x446ac6[_0x24bd('0xa8')],'\x20Queue',_0x22840c['name'],_0x24bd('0x68'),_0x22840c['originated']);}if(_0x241695!==_0x24bd('0xa4')){delete this[_0x24bd('0x66')][_0x415435[_0x24bd('0xda')]];delete this[_0x24bd('0x66')][_0x415435[_0x24bd('0xdd')]];}}};Preview[_0x24bd('0x5b')][_0x24bd('0xde')]=function(_0x2e530e,_0x54b864,_0x4f2300){if(_[_0x24bd('0xdf')](_0x54b864)&&_0x24bd('0xe0')!==typeof _0x54b864){return;}if(_[_0x24bd('0xdf')](_0x4f2300)&&'object'!==typeof _0x4f2300){return;}switch(_0x4f2300[_0x24bd('0xe1')]){case'0':ut[_0x24bd('0xe2')](_0x2e530e,0x0,_0x24bd('0x99'));rpcDb[_0x24bd('0xe3')](_0x2e530e,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x2e530e,0x3,_0x24bd('0xbf'));rpcDb['createAgentHistory'](_0x2e530e,_0x24bd('0xe4'));break;case'5':ut[_0x24bd('0xe2')](_0x2e530e,0x5,_0x24bd('0xe5'));rpcDb[_0x24bd('0xe3')](_0x2e530e,_0x24bd('0xe6'));break;case'8':ut[_0x24bd('0xe2')](_0x2e530e,0x8,'Congestion');rpcDb[_0x24bd('0xe3')](_0x2e530e,_0x24bd('0xe7'));break;case'22':ut[_0x24bd('0xe2')](_0x2e530e,0x16,_0x24bd('0xe8'));rpcDb[_0x24bd('0xe3')](_0x2e530e,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x24bd('0xe2')](_0x2e530e,0xc,_0x4f2300[_0x24bd('0xe1')]);rpcDb[_0x24bd('0xe3')](_0x2e530e,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x54b864,_0x24bd('0xe9'));logger[_0x24bd('0x50')]('[originated][decrement][callProgressDetectingAgent]',_0x2e530e[_0x24bd('0xa8')],'\x20Queue',_0x54b864[_0x24bd('0x29')],_0x24bd('0x68'),_0x54b864[_0x24bd('0x43')]);delete this[_0x24bd('0x66')][_0x2e530e['uniqueid']];};Preview[_0x24bd('0x5b')]['checkInBlack']=function(_0x815818,_0x1618ce,_0x49b68e,_0x21d1a5,_0xe1601f){var _0x1509f2=this;return new BPromise(function(_0x14f56c,_0x2956fd){if(_[_0x24bd('0x64')](_0x1618ce)||_[_0x24bd('0x64')](_0x1618ce[_0x24bd('0xea')])||_['isNil'](_0x1618ce['Contact'][_0x24bd('0xeb')])||_[_0x24bd('0x64')](_0x1618ce[_0x24bd('0x6e')])){_0x2956fd(ut[_0x24bd('0x42')](_0x24bd('0xec'),_0x21d1a5,_0xe1601f));return;}var _0x24662d=uuid['v4']();var _0x59face=_0x1509f2['campaignsPreview'][_0x1618ce['Queue']['name']];var _0x278140=_0x49b68e?_0x1509f2[_0x24bd('0x17')][_0x49b68e]['id']:undefined;_0x1509f2[_0x24bd('0x66')][_0x24662d]=new Action(_0x1618ce,_0x59face,_0x24662d,_0x49b68e,_0x278140);var _0x3456fd=_0x1509f2['actions'][_0x24662d];_0x3456fd['unlockAgent']=_0x21d1a5;_0x3456fd[_0x24bd('0xa3')]=_0xe1601f;_0x3456fd[_0x24bd('0xed')]=_0x49b68e;if(_['isEmpty'](_0x815818)){_0x1509f2['execCall'](_0x3456fd,_0x59face,_0x1618ce,_0x49b68e)[_0x24bd('0x79')](function(_0x42357f){logger['info'](_0x24bd('0xee'),_0x24bd('0xef')+_0x3456fd['queue']+_0x24bd('0xf0')+_0x3456fd[_0x24bd('0xce')],JSON[_0x24bd('0x4c')](_0x42357f));ami[_0x24bd('0x28')](_0x24bd('0xf1'),ut[_0x24bd('0xaa')](_0x3456fd,_0x24bd('0xf2')));_0x14f56c(ut[_0x24bd('0x42')](_0x24bd('0xf3')));})[_0x24bd('0x82')](function(_0x4164a7){ut[_0x24bd('0x54')](_0x24bd('0xf4'),_0x4164a7);_0x2956fd(ut['message'](_0x24bd('0xf5'),_0x21d1a5,_0xe1601f));});}else{_0x59face[_0x24bd('0xf6')]+=0x1;ut['logBlacklist'](_0x3456fd);rpcDb[_0x24bd('0xf7')](_0x3456fd,_0x24bd('0xf8'));delete _0x1509f2[_0x24bd('0x66')][_0x24662d];_0x2956fd(ut[_0x24bd('0x42')](_0x24bd('0xf9'),_0x21d1a5,_0xe1601f));}});};Preview[_0x24bd('0x5b')]['isTrunkReachable']=function(_0xb177b5){return!_['isNil'](_0xb177b5)&&!_[_0x24bd('0x64')](_0xb177b5[_0x24bd('0x29')])&&!_[_0x24bd('0x64')](_0xb177b5['active'])&&_0xb177b5[_0x24bd('0x49')]&&!_[_0x24bd('0x64')](this['trunks'][util[_0x24bd('0x4d')](_0x24bd('0xfa'),_0xb177b5[_0x24bd('0x29')])])&&!_[_0x24bd('0x64')](this[_0x24bd('0x16')][util['format'](_0x24bd('0xfa'),_0xb177b5[_0x24bd('0x29')])][_0x24bd('0x71')])&&(this[_0x24bd('0x16')][util[_0x24bd('0x4d')]('SIP/%s',_0xb177b5[_0x24bd('0x29')])][_0x24bd('0x71')]===_0x24bd('0xfb')||this[_0x24bd('0x16')][util[_0x24bd('0x4d')]('SIP/%s',_0xb177b5[_0x24bd('0x29')])][_0x24bd('0x71')]===_0x24bd('0xfc'));};Preview['prototype']['run']=function(_0x2530cc,_0x259232){var _0x340898=this;return new BPromise(function(_0x5bf982,_0x72d05){_0x340898['execRun'](_0x2530cc,_0x259232)[_0x24bd('0x79')](function(_0x22a231){_0x5bf982(_[_0x24bd('0x6b')](_0x22a231,['message']));})['catch'](function(_0x102aae){if(_0x102aae['unlock']){rpcDb[_0x24bd('0xcd')](_0x2530cc);}if(_0x102aae['active']){rpcDb[_0x24bd('0x83')](_0x2530cc);}_0x72d05(_[_0x24bd('0x6b')](_0x102aae,[_0x24bd('0x42')]));});});};Preview[_0x24bd('0x5b')]['execRun']=function(_0x353bc9,_0x3becf5){var _0x467ad2=this;return new BPromise(function(_0x957054,_0x5112f3){var _0x8eac1c,_0x34187e;rpcDb[_0x24bd('0xfd')](_0x353bc9)['then'](function(_0x2b463f){if(!_['isNil'](_0x2b463f[0x0])){_0x34187e=_0x2b463f[0x0][_0x24bd('0xfe')]?![]:!![];_0x8eac1c=_0x2b463f[0x0][_0x24bd('0xfe')]?!![]:![];_0x8eac1c=_0x3becf5?!![]:_0x8eac1c;}var _0x439ba8=_0x467ad2[_0x24bd('0xff')](_0x2b463f);if(_0x439ba8[_0x24bd('0x100')]){rpcDb[_0x24bd('0x101')](_[_0x24bd('0x6b')](_0x2b463f[0x0],[_0x24bd('0x6e'),_0x24bd('0x102')]))[_0x24bd('0x79')](function(_0x561a27){_0x467ad2[_0x24bd('0x103')](_0x561a27,_0x2b463f[0x0],_0x3becf5,_0x34187e,_0x8eac1c)[_0x24bd('0x79')](function(_0x1c4acf){_0x957054(_0x1c4acf);})[_0x24bd('0x82')](function(_0xcc36f3){_0x5112f3(_0xcc36f3);});})[_0x24bd('0x82')](function(_0xed1be2){ut[_0x24bd('0x54')]('[Preview][checkIsBlackList]',_0xed1be2);_0x5112f3(ut[_0x24bd('0x42')](_0x24bd('0x104'),_0x34187e,_0x8eac1c));});}else{_0x5112f3(ut['message'](_0x439ba8[_0x24bd('0x42')],_0x34187e,_0x8eac1c));}})[_0x24bd('0x82')](function(_0x280b85){ut['logger'](_0x24bd('0x105'),_0x280b85);_0x5112f3(ut[_0x24bd('0x42')](_0x24bd('0x104'),![],!![]));});});};Preview['prototype'][_0x24bd('0xff')]=function(_0x8fe3e7){if(_[_0x24bd('0x64')](_0x8fe3e7)||_[_0x24bd('0x106')](_0x8fe3e7)||!_['isNil'](_0x8fe3e7[0x0][_0x24bd('0x7d')])&&_[_0x24bd('0x64')](_0x8fe3e7[0x0]['Agent'][_0x24bd('0x29')])){ut[_0x24bd('0x54')](_0x24bd('0x107'),_0x8fe3e7);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x670132=this[_0x24bd('0x14')][_0x8fe3e7[0x0]['Queue'][_0x24bd('0x29')]];_0x670132[_0x24bd('0x42')]='ACTIVE';if(_['isNil'](_0x670132)){ut[_0x24bd('0x54')](_0x24bd('0x108'),_0x670132);return{'isValid':![],'message':_0x24bd('0x109')};}if(!this['isTrunkReachable'](_0x670132[_0x24bd('0x48')])){ut[_0x24bd('0x54')](_0x24bd('0x10a'),_0x24bd('0x10b')+_0x670132['name']+_0x24bd('0x10c'));if(!this[_0x24bd('0x92')](_0x670132['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x670132[_0x24bd('0x29')]+_0x24bd('0x10d'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x670132[_0x24bd('0x61')])){ut[_0x24bd('0x54')]('[Preview][validateContact][Campaign\x20Active]',_0x670132[_0x24bd('0x29')]+_0x24bd('0x10e'));return{'isValid':![],'message':_0x24bd('0x10b')+_0x670132[_0x24bd('0x29')]+_0x24bd('0x10e')};}return{'isValid':!![],'message':_0x24bd('0x10f')};};Preview[_0x24bd('0x5b')][_0x24bd('0x110')]=function(_0x2cd791,_0x353234,_0x2c8a85,_0x2f0973){var _0x5ca65c=this;return new BPromise(function(_0x11fc38,_0x319a2c){var _0x55712d=_0x2cd791['uniqueid'];var _0x5573db=_0x5ca65c[_0x24bd('0x92')](_0x353234[_0x24bd('0x48')])?util['format'](_0x24bd('0x111'),_0x353234['Trunk'][_0x24bd('0x29')],_[_0x24bd('0x64')](_0x353234[_0x24bd('0x112')])?'':_0x353234[_0x24bd('0x112')][_0x24bd('0x113')]()||'',_0x353234[_0x24bd('0x114')]>0x0?_0x2c8a85[_0x24bd('0xea')][_0x24bd('0xeb')][_0x24bd('0x115')](_0x353234[_0x24bd('0x114')]):_0x2c8a85['Contact'][_0x24bd('0xeb')]):util['format'](_0x24bd('0x111'),_[_0x24bd('0x64')](_0x353234[_0x24bd('0x93')])?_0x353234[_0x24bd('0x48')][_0x24bd('0x29')]:_0x353234['TrunkBackup']['name'],_[_0x24bd('0x64')](_0x353234['dialPrefix'])?'':_0x353234[_0x24bd('0x112')]['trim']()||'',_0x353234['dialCutDigit']>0x0?_0x2c8a85['Contact'][_0x24bd('0xeb')][_0x24bd('0x115')](_0x353234['dialCutDigit']):_0x2c8a85[_0x24bd('0xea')][_0x24bd('0xeb')]);var _0x581274=_0x5ca65c[_0x24bd('0x92')](_0x353234[_0x24bd('0x48')])?ut[_0x24bd('0x116')](_0x353234['Trunk'][_0x24bd('0x4a')],_0x353234[_0x24bd('0x31')],_0x353234[_0x24bd('0x117')]>0x0?ut['getCallerIdRandom'](_0x353234[_0x24bd('0x32')],_0x353234['dialRandomLastDigitCallerIdNumber']):_0x353234[_0x24bd('0x32')]):ut[_0x24bd('0x116')](_['isNil'](_0x353234[_0x24bd('0x93')])?_0x353234[_0x24bd('0x48')]['callerid']:_0x353234['TrunkBackup']['callerid'],_0x353234[_0x24bd('0x31')],_0x353234['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x24bd('0x118')](_0x353234[_0x24bd('0x32')],_0x353234[_0x24bd('0x117')]):_0x353234[_0x24bd('0x32')]);if(_0x581274){_0x2cd791[_0x24bd('0x119')]=ut[_0x24bd('0x11a')](_0x581274);_0x2cd791['originatecalleridnum']=ut[_0x24bd('0x11b')](_0x581274);}var _0x1722f1=ut['addVariables'](_0x353234,_0x2c8a85,_0x5573db,_0x581274,_0x55712d,_0x2cd791);_['merge'](_0x2cd791,ut[_0x24bd('0x11c')](_0x1722f1));_0x2cd791[_0x24bd('0x84')]=moment()['format'](_0x24bd('0x85'));ami[_0x24bd('0x70')](ut[_0x24bd('0x11d')](_0x2cd791,_0x353234,_0x1722f1,_0x2cd791[_0x24bd('0xa3')],_0x2f0973))[_0x24bd('0x79')](function(_0x2e1e13){_0x353234['originated']+=0x1;logger[_0x24bd('0x50')](_0x24bd('0x11e'),_0x55712d,'\x20Queue',_0x353234[_0x24bd('0x29')],_0x24bd('0x68'),_0x353234['originated']);_0x11fc38(_0x2e1e13);})[_0x24bd('0x82')](function(_0x479aa3){ut[_0x24bd('0xe2')](_0x2cd791,0xe,_0x24bd('0x11f'));rpcDb[_0x24bd('0xe3')](_0x2cd791,'[originateFailure][logOriginateFailure]');_0x319a2c(_0x479aa3);});});};Preview[_0x24bd('0x5b')][_0x24bd('0x22')]=function(_0x5b4859){if(this[_0x24bd('0x66')][_0x5b4859[_0x24bd('0xda')]]){this[_0x24bd('0x66')][_0x5b4859[_0x24bd('0xda')]][_0x24bd('0x72')]=_0x5b4859[_0x24bd('0x72')];}};Preview[_0x24bd('0x5b')]['syncOriginateResponse']=function(_0x364254){var _0x20dfa9=this;var _0x2ec1b3=this[_0x24bd('0x66')][_0x364254[_0x24bd('0x120')]];if(_0x2ec1b3){if(_0x2ec1b3[_0x24bd('0xed')]&&this[_0x24bd('0x17')][_0x2ec1b3[_0x24bd('0xed')]]){ut[_0x24bd('0x121')](_0x2ec1b3,this[_0x24bd('0x17')][_0x2ec1b3['lookAgent']][_0x24bd('0x29')],this[_0x24bd('0x17')][_0x2ec1b3[_0x24bd('0xed')]]['id']);}var _0x112cfd=_['clone'](_0x2ec1b3);_0x112cfd[_0x24bd('0xa5')]=moment()[_0x24bd('0x4d')](_0x24bd('0x85'));var _0x141919=_0x20dfa9[_0x24bd('0x14')][_0x2ec1b3['queue']];if(ut[_0x24bd('0x122')](_0x364254[_0x24bd('0x123')])){if(_0x2ec1b3['unlockAgent']){rpcDb[_0x24bd('0xcd')](_0x2ec1b3[_0x24bd('0xce')]);}if(_0x2ec1b3[_0x24bd('0xa3')]){rpcDb[_0x24bd('0x83')](_0x2ec1b3['idContact']);}ami[_0x24bd('0x28')](_0x24bd('0x124'),ut[_0x24bd('0xaa')](_0x2ec1b3,'rejected'));this[_0x24bd('0xde')](_0x112cfd,_0x141919,_0x364254);}else{_0x2ec1b3[_0x24bd('0x84')]=moment()[_0x24bd('0x4d')](_0x24bd('0x85'));ut['logAgent'](_0x112cfd,0x4,_0x24bd('0xb3'));rpcDb[_0x24bd('0xe3')](_0x112cfd,_0x24bd('0x125'));}}};Preview[_0x24bd('0x5b')]['syncHangup']=function(_0x1e0cd4){var _0xf6c015=this;var _0x622037=this[_0x24bd('0x66')][_0x1e0cd4[_0x24bd('0xda')]];var _0x5df5e7;if(_0x622037){_0x5df5e7=this[_0x24bd('0x14')][_0x622037[_0x24bd('0x67')]];logger[_0x24bd('0x50')](_0x24bd('0x126'),_0x1e0cd4[_0x24bd('0xda')],_0x24bd('0xb8'),_0x5df5e7[_0x24bd('0x29')],_0x24bd('0x69'),_0x5df5e7[_0x24bd('0x2c')]);}if(this[_0x24bd('0x66')][_0x1e0cd4[_0x24bd('0xda')]]&&_0x1e0cd4['linkedid']!==_0x1e0cd4['uniqueid']){if(_0x1e0cd4['cause']==='16'&&this['actions'][_0x1e0cd4[_0x24bd('0xda')]][_0x24bd('0x6a')]){this[_0x24bd('0x96')](_0x1e0cd4,_0x1e0cd4[_0x24bd('0xda')],_0x1e0cd4[_0x24bd('0x127')]);}else if(this['actions'][_0x1e0cd4[_0x24bd('0xda')]][_0x24bd('0x6a')]){logger['info'](_0x24bd('0x128'),_0x1e0cd4[_0x24bd('0xda')],_0x1e0cd4[_0x24bd('0x127')],'\x20Queue',_0x5df5e7['name'],_0x24bd('0x69'),_0x5df5e7[_0x24bd('0x2c')]);this['callProgressDetectingCustomer'](_0x1e0cd4,_0x1e0cd4[_0x24bd('0xda')],_0x1e0cd4[_0x24bd('0x127')]);}}else if(_0x622037&&_[_0x24bd('0x64')](_0x622037['statedesc'])&&_0x5df5e7[_0x24bd('0x129')]&&_0x1e0cd4[_0x24bd('0xda')]===_0x1e0cd4[_0x24bd('0xa8')]&&_[_0x24bd('0x64')](_0x1e0cd4[_0x24bd('0xe1')])&&_0x1e0cd4[_0x24bd('0x127')]==='16'&&_0x1e0cd4[_0x24bd('0x12a')]==='6'&&_[_0x24bd('0xdf')](_0x622037['transfer'])){if(_0x622037['unlockAgent']){rpcDb[_0x24bd('0xcd')](_0x622037[_0x24bd('0xce')]);}if(_0x622037[_0x24bd('0xa3')]){rpcDb['disableContact'](_0x622037['idContact']);}_0x1e0cd4[_0x24bd('0xe1')]='22';this[_0x24bd('0xde')](_0x622037,_0x5df5e7,_0x1e0cd4);}else if(_0x622037&&_0x622037[_0x24bd('0x12b')]){if(_0x1e0cd4[_0x24bd('0x127')]==='16'&&this['actions'][_0x1e0cd4[_0x24bd('0xda')]][_0x24bd('0x6a')]){logger[_0x24bd('0x50')](_0x24bd('0x12c'),_0x1e0cd4[_0x24bd('0xda')],_0x1e0cd4[_0x24bd('0x127')],_0x24bd('0xb8'),_0x5df5e7[_0x24bd('0x29')],_0x24bd('0x69'),_0x5df5e7['pTalking']);this[_0x24bd('0x96')](_0x1e0cd4,_0x1e0cd4['linkedid'],_0x1e0cd4[_0x24bd('0x127')]);}else if(this['actions'][_0x1e0cd4[_0x24bd('0xda')]][_0x24bd('0x6a')]){logger[_0x24bd('0x50')]('[syncHangup][talking][cause]',_0x1e0cd4['linkedid'],_0x1e0cd4[_0x24bd('0x127')],_0x24bd('0xb8'),_0x5df5e7[_0x24bd('0x29')],_0x24bd('0x69'),_0x5df5e7[_0x24bd('0x2c')]);this['callProgressDetectingCustomer'](_0x1e0cd4,_0x1e0cd4[_0x24bd('0xda')],_0x1e0cd4[_0x24bd('0x127')]);}}};Preview['prototype'][_0x24bd('0x20')]=function(_0x26f33e){if(this[_0x24bd('0x66')][_0x26f33e[_0x24bd('0xdd')]]&&_0x26f33e['destlinkedid']!==_0x26f33e[_0x24bd('0x12d')]){this[_0x24bd('0x96')](_0x26f33e,_0x26f33e[_0x24bd('0xdd')],_0x26f33e[_0x24bd('0xd8')]);}};Preview[_0x24bd('0x5b')][_0x24bd('0x1f')]=function(_0x5e697c){if(this[_0x24bd('0x66')][_0x5e697c[_0x24bd('0xda')]]&&_0x5e697c[_0x24bd('0xda')]!==_0x5e697c['uniqueid']&&!this[_0x24bd('0x66')][_0x5e697c[_0x24bd('0xda')]][_0x24bd('0x6a')]){if(_0x5e697c[_0x24bd('0x127')]==='1'){this[_0x24bd('0x96')](_0x5e697c,_0x5e697c[_0x24bd('0xda')],_0x5e697c[_0x24bd('0x127')]);}}};Preview[_0x24bd('0x5b')][_0x24bd('0x12e')]=function(_0x2b59ab,_0x1a38d5,_0x590a53){if(this[_0x24bd('0x66')][_0x2b59ab]){if(_[_0x24bd('0x64')](this[_0x24bd('0x66')][_0x2b59ab][_0x24bd('0x12f')])){this['actions'][_0x2b59ab]['variables']={};}this['actions'][_0x2b59ab][_0x24bd('0x12f')][_0x1a38d5]=_0x590a53;}};Preview[_0x24bd('0x5b')]['syncVarSet']=function(_0xb83eaf){try{if(!_[_0x24bd('0x64')](_0xb83eaf)){if(ut[_0x24bd('0x130')](_[_0x24bd('0x131')](_0xb83eaf[_0x24bd('0x132')])[0x0])){this['addVariable'](_0xb83eaf[_0x24bd('0xa8')],_['keys'](_0xb83eaf[_0x24bd('0x132')])[0x0],_0xb83eaf[_0x24bd('0x133')]);}}}catch(_0x24489d){logger['error']('[syncVarSet][Preview]',util['inspect'](_0x24489d,{'showHidden':![],'depth':null}));}};Preview[_0x24bd('0x5b')]['syncAttendedTransfer']=function(_0x3a356e){if(_0x3a356e){if(this[_0x24bd('0x66')][_0x3a356e[_0x24bd('0x134')]]){this[_0x24bd('0x66')][_0x3a356e['transfertargetlinkedid']][_0x24bd('0x12b')]=!![];}}};Preview[_0x24bd('0x5b')]['syncBlindTransfer']=function(_0x61bf3e){if(_0x61bf3e){if(this['actions'][_0x61bf3e[_0x24bd('0x135')]]){this[_0x24bd('0x66')][_0x61bf3e['transfererlinkedid']]['transfer']=!![];}}};module[_0x24bd('0x136')]=Preview; \ No newline at end of file +var _0x7e89=['[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','BUSY','Busy','dialGlobalMaxRetry','cloneAction','Global','countbusyretry','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','unlockAgent','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countagentrejectretry','[syncHangupRequest][logAgentReject]','unlockContact','idContact','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','callProgressDetectingAgent','object','isUndefined','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','Congestion','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','SIP/%s','execRun','pick','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','lookAgent','logLookAgent','clone','isFailure','rejected','Answer','syncHangup','[syncHangup][talking]','callProgressDetectingCustomer','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','dialstatus','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','lodash','bluebird','uuid','moment','md5','ioredis','preview','actionPreview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hanguprequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','name','callerid','Interval','stringify','format','voice:queue:%s','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','clearZombieChannel','sequence','info','[clearZombieChannels][talking]','queue','originated:\x20','dialAnswer','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','recallMe','agentReadyId','then','isNil','getDiff','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','[16]'];(function(_0x2d4a69,_0x4dda8c){var _0x477209=function(_0x270b04){while(--_0x270b04){_0x2d4a69['push'](_0x2d4a69['shift']());}};_0x477209(++_0x4dda8c);}(_0x7e89,0x8a));var _0x97e8=function(_0x2bf3ef,_0x1f97a8){_0x2bf3ef=_0x2bf3ef-0x0;var _0x2315ce=_0x7e89[_0x2bf3ef];return _0x2315ce;};'use strict';var util=require('util');var _=require(_0x97e8('0x0'));var BPromise=require(_0x97e8('0x1'));var uuid=require(_0x97e8('0x2'));var moment=require(_0x97e8('0x3'));var md5=require(_0x97e8('0x4'));var Redis=require(_0x97e8('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x97e8('0x6'));var loggerAction=require('../../../config/logger')(_0x97e8('0x7'));var ami=require(_0x97e8('0x8'));var rpcDb=require(_0x97e8('0x9'));var Action=require('./action');var ut=require(_0x97e8('0xa'));config[_0x97e8('0xb')]=_[_0x97e8('0xc')](config[_0x97e8('0xb')],{'host':_0x97e8('0xd'),'port':0x18eb});var io=require(_0x97e8('0xe'))(new Redis(config[_0x97e8('0xb')]));var Sequence=function(){};Sequence[_0x97e8('0xf')][_0x97e8('0x10')]=function(_0x90d419){this[_0x97e8('0x11')]=this[_0x97e8('0x11')]?this[_0x97e8('0x11')][_0x97e8('0x12')](_0x90d419):_0x90d419();};function Preview(_0x45be7f){this['sequence']=new Sequence();this[_0x97e8('0x13')]=_0x45be7f[_0x97e8('0x14')];this[_0x97e8('0x15')]=_0x45be7f['trunks'];this[_0x97e8('0x16')]={};this[_0x97e8('0x17')]=_0x45be7f[_0x97e8('0x17')];this[_0x97e8('0x18')]=0x0;ami['on'](_0x97e8('0x19'),this[_0x97e8('0x1a')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x97e8('0x1b')](this));ami['on'](_0x97e8('0x1c'),this['syncHangupRequest'][_0x97e8('0x1b')](this));ami['on']('dialend',this[_0x97e8('0x1d')][_0x97e8('0x1b')](this));ami['on'](_0x97e8('0x1e'),this['syncNewExten']['bind'](this));ami['on'](_0x97e8('0x1f'),this[_0x97e8('0x20')]['bind'](this));ami['on'](_0x97e8('0x21'),this[_0x97e8('0x22')][_0x97e8('0x1b')](this));ami['on'](_0x97e8('0x23'),this['syncBlindTransfer']['bind'](this));this[_0x97e8('0x24')](this[_0x97e8('0x13')]);}function emit(_0x44100a,_0x28e321,_0x232f9a){io['to'](_0x44100a)[_0x97e8('0x25')](_0x28e321,_0x232f9a);}function emitCampaignPreview(_0x142f04){if(_0x142f04[_0x97e8('0x26')]===_0x97e8('0x27')){var _0x289a8d={'id':_0x142f04['id'],'name':_0x142f04['name'],'strategy':_0x142f04[_0x97e8('0x28')],'answered':_0x142f04[_0x97e8('0x29')],'available':_0x142f04[_0x97e8('0x2a')],'loggedIn':_0x142f04[_0x97e8('0x2b')],'pTalking':_0x142f04[_0x97e8('0x2c')],'sumBillable':_0x142f04[_0x97e8('0x2d')],'sumDuration':_0x142f04[_0x97e8('0x2e')],'sumHoldTime':_0x142f04[_0x97e8('0x2f')]||0x0,'talking':_0x142f04[_0x97e8('0x30')],'total':_0x142f04[_0x97e8('0x31')],'type':_0x142f04[_0x97e8('0x26')],'unmanaged':_0x142f04['unmanaged'],'abandoned':_0x142f04[_0x97e8('0x32')],'waiting':_0x142f04[_0x97e8('0x33')],'loggedInDb':_0x142f04[_0x97e8('0x34')],'dialActive':_0x142f04[_0x97e8('0x35')],'dialMethod':_0x142f04[_0x97e8('0x36')],'dialOriginateCallerIdName':_0x142f04['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x142f04['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x142f04[_0x97e8('0x37')],'dialPrefix':_0x142f04[_0x97e8('0x38')],'outboundAnswerAgiCallsDay':_0x142f04[_0x97e8('0x39')],'outboundAnswerCallsDay':_0x142f04[_0x97e8('0x3a')],'outboundBlacklistCallsDay':_0x142f04['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x142f04[_0x97e8('0x3b')],'outboundCongestionCallsDay':_0x142f04[_0x97e8('0x3c')],'outboundDropCallsDayACS':_0x142f04[_0x97e8('0x3d')],'outboundDropCallsDayCallersExit':_0x142f04[_0x97e8('0x3e')],'outboundDropCallsDayTimeout':_0x142f04[_0x97e8('0x3f')],'outboundNoAnswerCallsDay':_0x142f04[_0x97e8('0x40')],'outboundNoSuchCallsDay':_0x142f04['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x142f04[_0x97e8('0x41')],'outboundReCallsDay':_0x142f04[_0x97e8('0x42')],'outboundRejectCallsDay':_0x142f04[_0x97e8('0x43')],'outboundUnknownCallsDay':_0x142f04['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x142f04[_0x97e8('0x44')],'predictiveIntervalAnsweredCalls':_0x142f04[_0x97e8('0x45')],'predictiveIntervalAvgHoldtime':_0x142f04[_0x97e8('0x46')],'predictiveIntervalAvgTalktime':_0x142f04[_0x97e8('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x142f04[_0x97e8('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x142f04['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x142f04[_0x97e8('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x142f04[_0x97e8('0x4a')],'predictiveIntervalHitRate':_0x142f04[_0x97e8('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x142f04[_0x97e8('0x4c')],'predictiveIntervalPauses':_0x142f04[_0x97e8('0x4d')],'predictiveIntervalAvailable':_0x142f04[_0x97e8('0x4e')],'predictiveIntervalTotalCalls':_0x142f04['predictiveIntervalTotalCalls'],'message':_0x142f04[_0x97e8('0x4f')],'originated':_0x142f04[_0x97e8('0x50')],'erlangCalls':_0x142f04['erlangCalls'],'erlangCallToSecond':_0x142f04[_0x97e8('0x51')],'erlangAbandonmentRate':_0x142f04[_0x97e8('0x52')],'erlangBusyFactor':_0x142f04['erlangBusyFactor'],'startPredictive':_0x142f04[_0x97e8('0x53')],'startProgressive':_0x142f04[_0x97e8('0x54')]};if(_0x142f04['Trunk']){_0x289a8d[_0x97e8('0x55')]={'id':_0x142f04['Trunk']['id'],'name':_0x142f04[_0x97e8('0x55')][_0x97e8('0x56')],'active':_0x142f04[_0x97e8('0x55')]['active'],'callerid':_0x142f04['Trunk'][_0x97e8('0x57')]};}if(_0x142f04[_0x97e8('0x58')]){_0x289a8d[_0x97e8('0x58')]={'id':_0x142f04[_0x97e8('0x58')]['id'],'name':_0x142f04[_0x97e8('0x58')][_0x97e8('0x56')]};}var _0x51df11=md5(JSON[_0x97e8('0x59')](_0x289a8d));if(_0x142f04['md5']!==_0x51df11){_0x142f04['md5']=_0x51df11;emit(util[_0x97e8('0x5a')](_0x97e8('0x5b'),_0x289a8d[_0x97e8('0x56')]),'voice_queue:save',_0x289a8d);}}}function emitVoiceQueueChannelRemove(_0x4680ba){logger['info'](_0x97e8('0x5c'),JSON[_0x97e8('0x59')](_0x4680ba));emit(util[_0x97e8('0x5a')](_0x97e8('0x5b'),_0x4680ba['name']),_0x97e8('0x5d'),_0x4680ba);}function notSendMessagesQueue(_0x3f97ff){if(_0x3f97ff[_0x97e8('0x5e')]){if(_0x3f97ff[_0x97e8('0x50')]===0x0&&_0x3f97ff[_0x97e8('0x2c')]===0x0){_0x3f97ff[_0x97e8('0x5e')]=![];_0x3f97ff[_0x97e8('0x2a')]=0x0;_0x3f97ff[_0x97e8('0x5f')]=0x0;_0x3f97ff[_0x97e8('0x4f')]=_0x97e8('0x60');ut[_0x97e8('0x61')](_0x97e8('0x62'),_0x3f97ff[_0x97e8('0x56')]+'\x20is\x20not\x20active');}else{_0x3f97ff[_0x97e8('0x4f')]=_0x97e8('0x63');ut[_0x97e8('0x61')](_0x97e8('0x62'),_0x3f97ff[_0x97e8('0x56')]+_0x97e8('0x64'));}emitCampaignPreview(_0x3f97ff);}}Preview[_0x97e8('0xf')]['loopCampaigns']=function(){var _0x5aab51=this;setInterval(function(){_0x5aab51[_0x97e8('0x65')]();},0x7cf);};Preview[_0x97e8('0xf')][_0x97e8('0x65')]=function(){var _0x17c7f9=this['campaignsPreview'];this[_0x97e8('0x18')]+=0x1;for(var _0x435a36 in _0x17c7f9){if(_0x17c7f9[_0x97e8('0x66')](_0x435a36)&&(_0x17c7f9[_0x435a36][_0x97e8('0x36')]===_0x97e8('0x6')||_0x17c7f9[_0x435a36][_0x97e8('0x36')]===_0x97e8('0x67'))&&_0x17c7f9[_0x435a36][_0x97e8('0x26')]===_0x97e8('0x27')){if(this['clockClearZombieChannels']>0x7){this[_0x97e8('0x18')]=0x0;this[_0x97e8('0x68')]();}}if(_0x17c7f9['hasOwnProperty'](_0x435a36)&&_0x17c7f9[_0x435a36][_0x97e8('0x36')]===_0x97e8('0x6')&&_0x17c7f9[_0x435a36]['type']==='outbound'){if(_0x17c7f9[_0x435a36][_0x97e8('0x35')]){this[_0x97e8('0x69')](_0x17c7f9[_0x435a36]);this['recallMe'](_0x17c7f9[_0x435a36]);}else{notSendMessagesQueue(_0x17c7f9[_0x435a36]);}}}};Preview[_0x97e8('0xf')][_0x97e8('0x6a')]=function(_0x13d6f4){var _0x108375=this;this[_0x97e8('0x6b')][_0x97e8('0x10')](function(){if(!_['isNil'](_0x108375[_0x97e8('0x16')][_0x13d6f4])){loggerAction[_0x97e8('0x6c')](_0x97e8('0x6d'),_0x13d6f4,'Queue',_0x108375[_0x97e8('0x16')][_0x13d6f4][_0x97e8('0x6e')],_0x97e8('0x6f'),JSON[_0x97e8('0x59')](_0x108375[_0x97e8('0x13')][_0x108375[_0x97e8('0x16')][_0x13d6f4][_0x97e8('0x6e')]][_0x97e8('0x50')]),'pTalking:\x20',JSON['stringify'](_0x108375[_0x97e8('0x13')][_0x108375[_0x97e8('0x16')][_0x13d6f4]['queue']]['pTalking']),JSON['stringify'](_0x108375[_0x97e8('0x16')][_0x13d6f4][_0x97e8('0x70')]),JSON[_0x97e8('0x59')](_['pick'](_0x108375[_0x97e8('0x16')][_0x13d6f4],['contactId',_0x97e8('0x71'),_0x97e8('0x72'),_0x97e8('0x73')])));return ami[_0x97e8('0x74')]({'action':_0x97e8('0x75'),'channel':_0x108375['actions'][_0x13d6f4][_0x97e8('0x76')]})['catch'](function(_0x5f925c){if(_0x5f925c['message']===_0x97e8('0x77')){setTimeout(function(){if(_0x108375[_0x97e8('0x16')][_0x13d6f4]){ut['updateOriginated'](_0x108375[_0x97e8('0x13')][_0x108375[_0x97e8('0x16')][_0x13d6f4][_0x97e8('0x6e')]],_0x97e8('0x78'));if(_0x108375[_0x97e8('0x16')][_0x13d6f4]['dialAnswer']===!![]){ut['decrementTalkink'](_0x108375[_0x97e8('0x13')][_0x108375[_0x97e8('0x16')][_0x13d6f4][_0x97e8('0x6e')]],_0x97e8('0x78'));ut[_0x97e8('0x79')]('[Dialer][checkChannel][pTalking][Preview]'+_0x13d6f4,_0x108375[_0x97e8('0x16')][_0x13d6f4]['queue']);}ut[_0x97e8('0x79')](_0x97e8('0x7a')+_0x13d6f4,_0x108375['actions'][_0x13d6f4][_0x97e8('0x6e')]);delete _0x108375[_0x97e8('0x16')][_0x13d6f4];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x599d74=this;loggerAction[_0x97e8('0x6c')](_0x97e8('0x7b'),_['size'](this[_0x97e8('0x16')]));for(var _0x2f7981 in this[_0x97e8('0x16')]){if(_0x599d74[_0x97e8('0x16')]['hasOwnProperty'](_0x2f7981)){_0x599d74[_0x97e8('0x6a')](_0x2f7981);}}};Preview[_0x97e8('0xf')][_0x97e8('0x7c')]=function(_0x2929af){var _0x57f75f=this;rpcDb['getContactRecallMe'](_0x2929af['id'],ut[_0x97e8('0x7d')](this[_0x97e8('0x17')]))[_0x97e8('0x7e')](function(_0x56794e){if(!_[_0x97e8('0x7f')](_0x56794e)){for(var _0x38bd74=0x0;_0x38bd74<_0x56794e['length'];_0x38bd74+=0x1){if(ut[_0x97e8('0x80')](_0x56794e[_0x38bd74]['scheduledat'])<_0x2929af[_0x97e8('0x81')]*0x3c){if(_0x56794e[_0x38bd74][_0x97e8('0x82')]&&!_0x56794e[_0x38bd74]['Agent'][_0x97e8('0x83')]){_0x57f75f[_0x97e8('0x84')](_0x56794e[_0x38bd74]['id'])[_0x97e8('0x7e')](ut['logger2'](_0x97e8('0x85')))[_0x97e8('0x86')](ut[_0x97e8('0x87')](_0x97e8('0x85')));}else{rpcDb[_0x97e8('0x88')](_0x56794e[_0x38bd74]['id']);}}else{var _0x5034c1=new Action(_0x56794e[_0x38bd74],_0x2929af);_0x5034c1['starttime']=moment()[_0x97e8('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2929af[_0x97e8('0x42')]+=0x1;ut[_0x97e8('0x89')](_0x5034c1,0x17,_0x97e8('0x8a'));if(_0x2929af[_0x97e8('0x8b')]){rpcDb[_0x97e8('0x8c')](ut[_0x97e8('0x8d')](_0x56794e[_0x38bd74]));rpcDb[_0x97e8('0x8e')](_0x5034c1,_0x97e8('0x8f'));}else{ut['logCustomer'](_0x5034c1,0x16,_0x97e8('0x90'));rpcDb[_0x97e8('0x8e')](_0x5034c1,_0x97e8('0x91'));rpcDb[_0x97e8('0x92')](_0x5034c1,_0x97e8('0x91'));}}}}})['catch'](ut['logger2'](_0x97e8('0x93')));};Preview[_0x97e8('0xf')]['setMessage']=function(_0x28ab30){_0x28ab30[_0x97e8('0x5e')]=!![];if(ut['IsNotLoggedIn'](_0x28ab30[_0x97e8('0x2b')])){_0x28ab30['message']=_0x97e8('0x94');}else if(!ut[_0x97e8('0x95')](_0x28ab30['dialActive'])){_0x28ab30[_0x97e8('0x4f')]='NOT_ACTIVE';}else if(!this[_0x97e8('0x96')](_0x28ab30[_0x97e8('0x55')])){if(!this['isTrunkReachable'](_0x28ab30[_0x97e8('0x97')])){_0x28ab30[_0x97e8('0x4f')]='TRUNK_IS_NOT_REACHABLE';}else{_0x28ab30[_0x97e8('0x4f')]=_0x97e8('0x98');}}else{_0x28ab30[_0x97e8('0x4f')]=_0x97e8('0x98');}emitCampaignPreview(_0x28ab30);};Preview[_0x97e8('0xf')]['callProgressDetectingCustomer']=function(_0x26b1bd,_0x2361c3,_0x550a87){var _0x13f274=this;var _0x373ad1=this['actions'][_0x2361c3];var _0x5a27cc=this[_0x97e8('0x13')][_0x373ad1[_0x97e8('0x6e')]];var _0x21a7fd;if(_0x5a27cc){switch(_0x550a87){case'1':_0x5a27cc['outboundNoSuchCallsDay']+=0x1;_0x373ad1['countnosuchnumberretry']+=0x1;_0x373ad1[_0x97e8('0x99')]=ut[_0x97e8('0x9a')](_0x373ad1);ut[_0x97e8('0x89')](_0x373ad1,0x0,_0x97e8('0x9b'));rpcDb['createCustomerHistory'](_0x373ad1,_0x97e8('0x9c'));if(ut[_0x97e8('0x9a')](_0x373ad1)>=_0x5a27cc['dialGlobalMaxRetry']){_0x21a7fd=ut['cloneAction'](_0x373ad1,0xf,'Global');rpcDb[_0x97e8('0x92')](_0x21a7fd,_0x97e8('0x9d'));}else{if(_0x373ad1[_0x97e8('0x9e')]>=_0x5a27cc[_0x97e8('0x9f')]){rpcDb['createCustomerFinal'](_0x373ad1,_0x97e8('0x9d'));}else{rpcDb[_0x97e8('0xa0')](ut[_0x97e8('0xa1')](_0x373ad1,_0x97e8('0x9e'),_0x5a27cc[_0x97e8('0xa2')]),_0x373ad1['unlockAgent'],_0x373ad1[_0x97e8('0xa3')]);}}delete this[_0x97e8('0x16')][_0x26b1bd['linkedid']];break;case'ANSWER':var _0x1e3466=moment()['format'](_0x97e8('0xa4'));_0x373ad1[_0x97e8('0xa5')]=_0x1e3466;_0x373ad1[_0x97e8('0xa6')]=_0x1e3466;_0x373ad1[_0x97e8('0x70')]=!![];_0x5a27cc[_0x97e8('0x2c')]+=0x1;logger[_0x97e8('0x6c')](_0x97e8('0xa7'),_0x373ad1['uniqueid'],_0x97e8('0xa8'),_0x5a27cc[_0x97e8('0x56')],_0x97e8('0xa9'),_0x5a27cc[_0x97e8('0x2c')]);ami['emit'](_0x97e8('0xaa'),ut[_0x97e8('0xab')](_0x373ad1,_0x97e8('0xac')));if(_0x5a27cc[_0x97e8('0xad')]){ami[_0x97e8('0x25')](_0x97e8('0xae'),ut[_0x97e8('0xaf')](_0x373ad1));}break;case'16':ami['emit'](_0x97e8('0xb0'),ut['buildObj'](_0x373ad1,_0x97e8('0xb1')));emitVoiceQueueChannelRemove(ut[_0x97e8('0xab')](_0x373ad1,_0x97e8('0xb1')));_0x5a27cc[_0x97e8('0x3a')]+=0x1;_0x5a27cc[_0x97e8('0x31')]+=0x1;_0x5a27cc[_0x97e8('0x29')]+=0x1;ut[_0x97e8('0xb2')](_0x5a27cc,_0x97e8('0xb3'));_0x373ad1[_0x97e8('0x99')]=ut[_0x97e8('0x9a')](_0x373ad1);ut[_0x97e8('0x89')](_0x373ad1,0x4,'Answer');rpcDb['createCustomerHistory'](_0x373ad1,_0x97e8('0xb4'));rpcDb['createCustomerFinal'](_0x373ad1,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x97e8('0xb5')](_0x373ad1);_0x5a27cc[_0x97e8('0x2e')]+=_0x373ad1[_0x97e8('0xb6')];_0x5a27cc[_0x97e8('0x2d')]+=_0x373ad1[_0x97e8('0xb6')];logger[_0x97e8('0x6c')](_0x97e8('0xb7'),_0x373ad1[_0x97e8('0xb8')],_0x97e8('0xa8'),_0x5a27cc[_0x97e8('0x56')],_0x97e8('0xa9'),_0x5a27cc[_0x97e8('0x2c')]);delete this[_0x97e8('0x16')][_0x26b1bd[_0x97e8('0xb9')]];break;case _0x97e8('0xba'):_0x5a27cc[_0x97e8('0x3b')]+=0x1;_0x373ad1['countbusyretry']+=0x1;_0x373ad1[_0x97e8('0x99')]=ut[_0x97e8('0x9a')](_0x373ad1);ut[_0x97e8('0x89')](_0x373ad1,0x5,_0x97e8('0xbb'));rpcDb['createCustomerHistory'](_0x373ad1,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x373ad1)>=_0x5a27cc[_0x97e8('0xbc')]){_0x21a7fd=ut[_0x97e8('0xbd')](_0x373ad1,0xf,_0x97e8('0xbe'));rpcDb[_0x97e8('0x92')](_0x21a7fd,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x373ad1[_0x97e8('0xbf')]>=_0x5a27cc[_0x97e8('0xc0')]){rpcDb['createCustomerFinal'](_0x373ad1,_0x97e8('0xc1'));}else{rpcDb['rescheduleContact'](ut[_0x97e8('0xa1')](_0x373ad1,_0x97e8('0xbf'),_0x5a27cc['dialBusyRetryFrequency']),_0x373ad1[_0x97e8('0xc2')],_0x373ad1[_0x97e8('0xa3')]);}}break;case'NOANSWER':_0x5a27cc[_0x97e8('0x40')]+=0x1;_0x373ad1[_0x97e8('0xc3')]+=0x1;_0x373ad1[_0x97e8('0x99')]=ut[_0x97e8('0x9a')](_0x373ad1);ut[_0x97e8('0x89')](_0x373ad1,0x3,_0x97e8('0xc4'));rpcDb['createCustomerHistory'](_0x373ad1,_0x97e8('0xc5'));if(ut[_0x97e8('0x9a')](_0x373ad1)>=_0x5a27cc[_0x97e8('0xbc')]){_0x21a7fd=ut['cloneAction'](_0x373ad1,0xf,_0x97e8('0xbe'));rpcDb[_0x97e8('0x92')](_0x21a7fd,_0x97e8('0xc6'));}else{if(_0x373ad1[_0x97e8('0xc3')]>=_0x5a27cc['dialNoAnswerMaxRetry']){rpcDb[_0x97e8('0x92')](_0x373ad1,_0x97e8('0xc5'));}else{rpcDb[_0x97e8('0xa0')](ut[_0x97e8('0xa1')](_0x373ad1,'countnoanswerretry',_0x5a27cc[_0x97e8('0xc7')]),_0x373ad1['unlockAgent'],_0x373ad1[_0x97e8('0xa3')]);}}break;case _0x97e8('0xc8'):_0x5a27cc[_0x97e8('0x3c')]+=0x1;_0x373ad1[_0x97e8('0xc9')]+=0x1;_0x373ad1['countglobal']=ut['totalGlobal'](_0x373ad1);ut[_0x97e8('0x89')](_0x373ad1,0x8,'Congestion');rpcDb[_0x97e8('0x8e')](_0x373ad1,_0x97e8('0xca'));if(ut[_0x97e8('0x9a')](_0x373ad1)>=_0x5a27cc[_0x97e8('0xbc')]){_0x21a7fd=ut[_0x97e8('0xbd')](_0x373ad1,0xf,_0x97e8('0xbe'));rpcDb['createCustomerFinal'](_0x21a7fd,_0x97e8('0xcb'));}else{if(_0x373ad1[_0x97e8('0xc9')]>=_0x5a27cc['dialCongestionMaxRetry']){rpcDb[_0x97e8('0x92')](_0x373ad1,_0x97e8('0xca'));}else{rpcDb[_0x97e8('0xa0')](ut[_0x97e8('0xa1')](_0x373ad1,_0x97e8('0xc9'),_0x5a27cc['dialBusyRetryFrequency']),_0x373ad1['unlockAgent'],_0x373ad1[_0x97e8('0xa3')]);}}break;case'CANCEL':_0x5a27cc[_0x97e8('0x43')]+=0x1;_0x373ad1[_0x97e8('0xcc')]+=0x1;_0x373ad1['countglobal']=ut[_0x97e8('0x9a')](_0x373ad1);ut[_0x97e8('0x89')](_0x373ad1,0x14,'AgentReject');rpcDb[_0x97e8('0x8e')](_0x373ad1,_0x97e8('0xcd'));if(_0x373ad1[_0x97e8('0xc2')]){rpcDb[_0x97e8('0xce')](_0x373ad1[_0x97e8('0xcf')]);}if(_0x373ad1[_0x97e8('0xa3')]){rpcDb[_0x97e8('0x88')](_0x373ad1['idContact']);}break;case _0x97e8('0xd0'):_0x5a27cc[_0x97e8('0x44')]+=0x1;_0x373ad1['countabandonedretry']+=0x1;_0x373ad1[_0x97e8('0x99')]=ut[_0x97e8('0x9a')](_0x373ad1);ut[_0x97e8('0x89')](_0x373ad1,0xb,_0x97e8('0xd1'));rpcDb['createCustomerHistory'](_0x373ad1,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x97e8('0x9a')](_0x373ad1)>=_0x5a27cc[_0x97e8('0xbc')]){_0x21a7fd=ut['cloneAction'](_0x373ad1,0xf,_0x97e8('0xbe'));rpcDb[_0x97e8('0x92')](_0x21a7fd,_0x97e8('0xd2'));}else{if(_0x373ad1[_0x97e8('0xd3')]>=_0x5a27cc[_0x97e8('0xd4')]){rpcDb[_0x97e8('0x92')](_0x373ad1,_0x97e8('0xd2'));}else{rpcDb[_0x97e8('0xa0')](ut[_0x97e8('0xa1')](_0x373ad1,'countabandonedretry',_0x5a27cc['dialAbandonedRetryFrequency']),_0x373ad1['unlockAgent'],_0x373ad1[_0x97e8('0xa3')]);}}break;default:if(_0x373ad1[_0x97e8('0x70')]){ut[_0x97e8('0xb2')](_0x5a27cc,_0x97e8('0xd5'));ut[_0x97e8('0x79')](_0x97e8('0xd6')+_0x5a27cc[_0x97e8('0x56')],_0x26b1bd);}_0x5a27cc[_0x97e8('0xd7')]+=0x1;_0x373ad1[_0x97e8('0x99')]=ut['totalGlobal'](_0x373ad1);ut[_0x97e8('0x89')](_0x373ad1,0xc,_0x26b1bd[_0x97e8('0xd8')]||_0x26b1bd['dialstatus']);rpcDb[_0x97e8('0x8e')](_0x373ad1,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x97e8('0x9a')](_0x373ad1)>=_0x5a27cc['dialGlobalMaxRetry']){_0x21a7fd=ut[_0x97e8('0xbd')](_0x373ad1,0xf,_0x97e8('0xbe'));rpcDb['createCustomerFinal'](_0x21a7fd,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x373ad1,_0x97e8('0xd9'));}delete this[_0x97e8('0x16')][_0x26b1bd['linkedid']];}if(!(_0x373ad1[_0x97e8('0x70')]&&_0x550a87==='16')){ut[_0x97e8('0xda')](_0x5a27cc,_0x97e8('0xdb'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x373ad1[_0x97e8('0xb8')],_0x97e8('0xa8'),_0x5a27cc[_0x97e8('0x56')],_0x97e8('0x6f'),_0x5a27cc[_0x97e8('0x50')]);}if(_0x550a87!=='ANSWER'){delete this[_0x97e8('0x16')][_0x26b1bd[_0x97e8('0xb9')]];delete this['actions'][_0x26b1bd['destlinkedid']];}}};Preview[_0x97e8('0xf')][_0x97e8('0xdc')]=function(_0x58cedf,_0x3a3d01,_0x41effa){if(_['isUndefined'](_0x3a3d01)&&_0x97e8('0xdd')!==typeof _0x3a3d01){return;}if(_[_0x97e8('0xde')](_0x41effa)&&'object'!==typeof _0x41effa){return;}switch(_0x41effa[_0x97e8('0xdf')]){case'0':ut['logAgent'](_0x58cedf,0x0,_0x97e8('0x9b'));rpcDb[_0x97e8('0xe0')](_0x58cedf,_0x97e8('0xe1'));break;case'3':ut[_0x97e8('0xe2')](_0x58cedf,0x3,_0x97e8('0xc4'));rpcDb['createAgentHistory'](_0x58cedf,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x97e8('0xe2')](_0x58cedf,0x5,_0x97e8('0xbb'));rpcDb[_0x97e8('0xe0')](_0x58cedf,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x97e8('0xe2')](_0x58cedf,0x8,_0x97e8('0xe3'));rpcDb['createAgentHistory'](_0x58cedf,_0x97e8('0xe4'));break;case'22':ut['logAgent'](_0x58cedf,0x16,'AnswerAGI');rpcDb[_0x97e8('0xe0')](_0x58cedf,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x97e8('0xe2')](_0x58cedf,0xc,_0x41effa['reason']);rpcDb[_0x97e8('0xe0')](_0x58cedf,_0x97e8('0xe4'));}ut[_0x97e8('0xda')](_0x3a3d01,_0x97e8('0xe5'));logger[_0x97e8('0x6c')](_0x97e8('0xe6'),_0x58cedf[_0x97e8('0xb8')],_0x97e8('0xa8'),_0x3a3d01['name'],_0x97e8('0x6f'),_0x3a3d01['originated']);delete this[_0x97e8('0x16')][_0x58cedf['uniqueid']];};Preview[_0x97e8('0xf')][_0x97e8('0xe7')]=function(_0x10cac8,_0x55970d,_0x3f1713,_0x563ac9,_0x50cfdc){var _0x2dfa7b=this;return new BPromise(function(_0x2ba4c6,_0x32a3c2){if(_[_0x97e8('0x7f')](_0x55970d)||_[_0x97e8('0x7f')](_0x55970d[_0x97e8('0xe8')])||_[_0x97e8('0x7f')](_0x55970d[_0x97e8('0xe8')][_0x97e8('0xe9')])||_[_0x97e8('0x7f')](_0x55970d[_0x97e8('0x72')])){_0x32a3c2(ut[_0x97e8('0x4f')](_0x97e8('0xea'),_0x563ac9,_0x50cfdc));return;}var _0xb4ec30=uuid['v4']();var _0xc54ac7=_0x2dfa7b[_0x97e8('0x13')][_0x55970d[_0x97e8('0xeb')]['name']];var _0x3f54ae=_0x3f1713?_0x2dfa7b['agents'][_0x3f1713]['id']:undefined;_0x2dfa7b[_0x97e8('0x16')][_0xb4ec30]=new Action(_0x55970d,_0xc54ac7,_0xb4ec30,_0x3f1713,_0x3f54ae);var _0x42712a=_0x2dfa7b[_0x97e8('0x16')][_0xb4ec30];_0x42712a[_0x97e8('0xc2')]=_0x563ac9;_0x42712a[_0x97e8('0xa3')]=_0x50cfdc;_0x42712a['lookAgent']=_0x3f1713;if(_[_0x97e8('0xec')](_0x10cac8)){_0x2dfa7b[_0x97e8('0xed')](_0x42712a,_0xc54ac7,_0x55970d,_0x3f1713)[_0x97e8('0x7e')](function(_0x1d40fe){logger[_0x97e8('0x6c')](_0x97e8('0xee'),_0x97e8('0xef')+_0x42712a[_0x97e8('0x6e')]+_0x97e8('0xf0')+_0x42712a[_0x97e8('0xcf')],JSON[_0x97e8('0x59')](_0x1d40fe));ami[_0x97e8('0x25')]('custom:agentcalled',ut[_0x97e8('0xab')](_0x42712a,'called'));_0x2ba4c6(ut['message'](_0x97e8('0xf1')));})[_0x97e8('0x86')](function(_0x1cb59a){ut[_0x97e8('0x61')](_0x97e8('0xf2'),_0x1cb59a);_0x32a3c2(ut[_0x97e8('0x4f')](_0x97e8('0xf3'),_0x563ac9,_0x50cfdc));});}else{_0xc54ac7['outboundBlacklistCallsDay']+=0x1;ut[_0x97e8('0xf4')](_0x42712a);rpcDb[_0x97e8('0xf5')](_0x42712a,'[Blacklist][error]');delete _0x2dfa7b[_0x97e8('0x16')][_0xb4ec30];_0x32a3c2(ut[_0x97e8('0x4f')](_0x97e8('0xf6'),_0x563ac9,_0x50cfdc));}});};Preview[_0x97e8('0xf')][_0x97e8('0x96')]=function(_0x1ff2f3){return!_['isNil'](_0x1ff2f3)&&!_[_0x97e8('0x7f')](_0x1ff2f3[_0x97e8('0x56')])&&!_[_0x97e8('0x7f')](_0x1ff2f3[_0x97e8('0xf7')])&&_0x1ff2f3[_0x97e8('0xf7')]&&!_['isNil'](this[_0x97e8('0x15')][util['format'](_0x97e8('0xf8'),_0x1ff2f3['name'])])&&!_[_0x97e8('0x7f')](this['trunks'][util['format']('SIP/%s',_0x1ff2f3[_0x97e8('0x56')])][_0x97e8('0x75')])&&(this[_0x97e8('0x15')][util['format'](_0x97e8('0xf8'),_0x1ff2f3[_0x97e8('0x56')])][_0x97e8('0x75')]==='reachable'||this[_0x97e8('0x15')][util[_0x97e8('0x5a')](_0x97e8('0xf8'),_0x1ff2f3[_0x97e8('0x56')])][_0x97e8('0x75')]==='unmonitored');};Preview[_0x97e8('0xf')]['run']=function(_0x573c41,_0x837065){var _0x77f9cd=this;return new BPromise(function(_0x5d1ef3,_0x1ae5a5){_0x77f9cd[_0x97e8('0xf9')](_0x573c41,_0x837065)[_0x97e8('0x7e')](function(_0x69b2bd){_0x5d1ef3(_[_0x97e8('0xfa')](_0x69b2bd,[_0x97e8('0x4f')]));})[_0x97e8('0x86')](function(_0x10dd47){if(_0x10dd47[_0x97e8('0xfb')]){rpcDb[_0x97e8('0xce')](_0x573c41);}if(_0x10dd47[_0x97e8('0xf7')]){rpcDb['disableContact'](_0x573c41);}_0x1ae5a5(_[_0x97e8('0xfa')](_0x10dd47,[_0x97e8('0x4f')]));});});};Preview[_0x97e8('0xf')][_0x97e8('0xf9')]=function(_0x5abc51,_0x9ec5c2){var _0x3d029a=this;return new BPromise(function(_0x1bb328,_0xd40137){var _0x16d9e1,_0x24c647;rpcDb[_0x97e8('0xfc')](_0x5abc51)[_0x97e8('0x7e')](function(_0x1975ee){if(!_[_0x97e8('0x7f')](_0x1975ee[0x0])){_0x24c647=_0x1975ee[0x0][_0x97e8('0xfd')]?![]:!![];_0x16d9e1=_0x1975ee[0x0]['recallme']?!![]:![];_0x16d9e1=_0x9ec5c2?!![]:_0x16d9e1;}var _0x64e847=_0x3d029a[_0x97e8('0xfe')](_0x1975ee);if(_0x64e847[_0x97e8('0xff')]){rpcDb[_0x97e8('0x100')](_[_0x97e8('0xfa')](_0x1975ee[0x0],[_0x97e8('0x72'),_0x97e8('0x101')]))['then'](function(_0x5ce160){_0x3d029a[_0x97e8('0xe7')](_0x5ce160,_0x1975ee[0x0],_0x9ec5c2,_0x24c647,_0x16d9e1)[_0x97e8('0x7e')](function(_0x2ec516){_0x1bb328(_0x2ec516);})[_0x97e8('0x86')](function(_0x1ff9ac){_0xd40137(_0x1ff9ac);});})[_0x97e8('0x86')](function(_0x1454b2){ut['logger']('[Preview][checkIsBlackList]',_0x1454b2);_0xd40137(ut[_0x97e8('0x4f')](_0x97e8('0x102'),_0x24c647,_0x16d9e1));});}else{_0xd40137(ut['message'](_0x64e847[_0x97e8('0x4f')],_0x24c647,_0x16d9e1));}})['catch'](function(_0x2a73c4){ut[_0x97e8('0x61')](_0x97e8('0x103'),_0x2a73c4);_0xd40137(ut[_0x97e8('0x4f')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x97e8('0xf')][_0x97e8('0xfe')]=function(_0x3e5b8a){if(_[_0x97e8('0x7f')](_0x3e5b8a)||_[_0x97e8('0xec')](_0x3e5b8a)||!_[_0x97e8('0x7f')](_0x3e5b8a[0x0][_0x97e8('0x82')])&&_[_0x97e8('0x7f')](_0x3e5b8a[0x0][_0x97e8('0x82')][_0x97e8('0x56')])){ut[_0x97e8('0x61')](_0x97e8('0x104'),_0x3e5b8a);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x552326=this[_0x97e8('0x13')][_0x3e5b8a[0x0][_0x97e8('0xeb')]['name']];_0x552326['message']=_0x97e8('0x98');if(_[_0x97e8('0x7f')](_0x552326)){ut['logger'](_0x97e8('0x105'),_0x552326);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x97e8('0x96')](_0x552326[_0x97e8('0x55')])){ut[_0x97e8('0x61')](_0x97e8('0x106'),_0x97e8('0x107')+_0x552326['name']+_0x97e8('0x108'));if(!this['isTrunkReachable'](_0x552326[_0x97e8('0x97')])){ut[_0x97e8('0x61')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x552326[_0x97e8('0x56')]+_0x97e8('0x109'));return{'isValid':![],'message':_0x97e8('0x10a')};}}if(!ut['isActive'](_0x552326[_0x97e8('0x35')])){ut[_0x97e8('0x61')](_0x97e8('0x10b'),_0x552326[_0x97e8('0x56')]+_0x97e8('0x10c'));return{'isValid':![],'message':_0x97e8('0x107')+_0x552326[_0x97e8('0x56')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x97e8('0x10d')};};Preview[_0x97e8('0xf')][_0x97e8('0xed')]=function(_0x55b5c2,_0x1a2765,_0x43bfcf,_0x4f57df){var _0x103a5d=this;return new BPromise(function(_0x1b200d,_0x2c818e){var _0x5bd56f=_0x55b5c2[_0x97e8('0xb8')];var _0x4caa59=_0x103a5d['isTrunkReachable'](_0x1a2765['Trunk'])?util[_0x97e8('0x5a')](_0x97e8('0x10e'),_0x1a2765[_0x97e8('0x55')][_0x97e8('0x56')],_['isNil'](_0x1a2765['dialPrefix'])?'':_0x1a2765[_0x97e8('0x38')][_0x97e8('0x10f')]()||'',_0x1a2765[_0x97e8('0x110')]>0x0?_0x43bfcf[_0x97e8('0xe8')][_0x97e8('0xe9')]['substring'](_0x1a2765[_0x97e8('0x110')]):_0x43bfcf[_0x97e8('0xe8')][_0x97e8('0xe9')]):util[_0x97e8('0x5a')](_0x97e8('0x10e'),_[_0x97e8('0x7f')](_0x1a2765['TrunkBackup'])?_0x1a2765['Trunk'][_0x97e8('0x56')]:_0x1a2765[_0x97e8('0x97')][_0x97e8('0x56')],_[_0x97e8('0x7f')](_0x1a2765['dialPrefix'])?'':_0x1a2765[_0x97e8('0x38')][_0x97e8('0x10f')]()||'',_0x1a2765[_0x97e8('0x110')]>0x0?_0x43bfcf[_0x97e8('0xe8')][_0x97e8('0xe9')]['substring'](_0x1a2765[_0x97e8('0x110')]):_0x43bfcf['Contact']['phone']);var _0x4c1305=_0x103a5d[_0x97e8('0x96')](_0x1a2765[_0x97e8('0x55')])?ut[_0x97e8('0x111')](_0x1a2765[_0x97e8('0x55')]['callerid'],_0x1a2765[_0x97e8('0x112')],_0x1a2765[_0x97e8('0x113')]>0x0?ut['getCallerIdRandom'](_0x1a2765[_0x97e8('0x114')],_0x1a2765[_0x97e8('0x113')]):_0x1a2765[_0x97e8('0x114')]):ut['getCallerId'](_['isNil'](_0x1a2765[_0x97e8('0x97')])?_0x1a2765[_0x97e8('0x55')][_0x97e8('0x57')]:_0x1a2765['TrunkBackup']['callerid'],_0x1a2765[_0x97e8('0x112')],_0x1a2765['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x1a2765[_0x97e8('0x114')],_0x1a2765['dialRandomLastDigitCallerIdNumber']):_0x1a2765['dialOriginateCallerIdNumber']);if(_0x4c1305){_0x55b5c2['originatecalleridname']=ut[_0x97e8('0x115')](_0x4c1305);_0x55b5c2['originatecalleridnum']=ut[_0x97e8('0x116')](_0x4c1305);}var _0x10af8f=ut[_0x97e8('0x117')](_0x1a2765,_0x43bfcf,_0x4caa59,_0x4c1305,_0x5bd56f,_0x55b5c2);_[_0x97e8('0x118')](_0x55b5c2,ut[_0x97e8('0x119')](_0x10af8f));_0x55b5c2[_0x97e8('0x11a')]=moment()[_0x97e8('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x97e8('0x74')](ut[_0x97e8('0x11b')](_0x55b5c2,_0x1a2765,_0x10af8f,_0x55b5c2['activeContact'],_0x4f57df))[_0x97e8('0x7e')](function(_0x3995cd){_0x1a2765['originated']+=0x1;logger[_0x97e8('0x6c')](_0x97e8('0x11c'),_0x5bd56f,'\x20Queue',_0x1a2765['name'],_0x97e8('0x6f'),_0x1a2765['originated']);_0x1b200d(_0x3995cd);})['catch'](function(_0x343edb){ut[_0x97e8('0xe2')](_0x55b5c2,0xe,_0x97e8('0x11d'));rpcDb['createAgentHistory'](_0x55b5c2,_0x97e8('0x11e'));_0x2c818e(_0x343edb);});});};Preview[_0x97e8('0xf')][_0x97e8('0x11f')]=function(_0xbbc1b2){if(this[_0x97e8('0x16')][_0xbbc1b2[_0x97e8('0xb9')]]){this[_0x97e8('0x16')][_0xbbc1b2[_0x97e8('0xb9')]][_0x97e8('0x76')]=_0xbbc1b2[_0x97e8('0x76')];}};Preview[_0x97e8('0xf')][_0x97e8('0x1a')]=function(_0x128991){var _0x70689f=this;var _0x1048d5=this[_0x97e8('0x16')][_0x128991['actionid']];if(_0x1048d5){if(_0x1048d5[_0x97e8('0x120')]&&this['agents'][_0x1048d5[_0x97e8('0x120')]]){ut[_0x97e8('0x121')](_0x1048d5,this['agents'][_0x1048d5[_0x97e8('0x120')]][_0x97e8('0x56')],this[_0x97e8('0x17')][_0x1048d5[_0x97e8('0x120')]]['id']);}var _0x27f65f=_[_0x97e8('0x122')](_0x1048d5);_0x27f65f[_0x97e8('0xa5')]=moment()[_0x97e8('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x45ff3e=_0x70689f[_0x97e8('0x13')][_0x1048d5[_0x97e8('0x6e')]];if(ut[_0x97e8('0x123')](_0x128991['response'])){if(_0x1048d5[_0x97e8('0xc2')]){rpcDb[_0x97e8('0xce')](_0x1048d5['idContact']);}if(_0x1048d5['activeContact']){rpcDb[_0x97e8('0x88')](_0x1048d5[_0x97e8('0xcf')]);}ami['emit']('custom:agentringnoanswer',ut['buildObj'](_0x1048d5,_0x97e8('0x124')));this[_0x97e8('0xdc')](_0x27f65f,_0x45ff3e,_0x128991);}else{_0x1048d5[_0x97e8('0x11a')]=moment()['format'](_0x97e8('0xa4'));ut[_0x97e8('0xe2')](_0x27f65f,0x4,_0x97e8('0x125'));rpcDb[_0x97e8('0xe0')](_0x27f65f,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x97e8('0xf')][_0x97e8('0x126')]=function(_0x591be9){var _0x36c739=this;var _0x5e554b=this[_0x97e8('0x16')][_0x591be9[_0x97e8('0xb9')]];var _0x3a28bd;if(_0x5e554b){_0x3a28bd=this[_0x97e8('0x13')][_0x5e554b[_0x97e8('0x6e')]];logger[_0x97e8('0x6c')](_0x97e8('0x127'),_0x591be9['linkedid'],'\x20Queue',_0x3a28bd[_0x97e8('0x56')],_0x97e8('0xa9'),_0x3a28bd[_0x97e8('0x2c')]);}if(this[_0x97e8('0x16')][_0x591be9[_0x97e8('0xb9')]]&&_0x591be9[_0x97e8('0xb9')]!==_0x591be9[_0x97e8('0xb8')]){if(_0x591be9['cause']==='16'&&this[_0x97e8('0x16')][_0x591be9['linkedid']]['dialAnswer']){this[_0x97e8('0x128')](_0x591be9,_0x591be9['linkedid'],_0x591be9[_0x97e8('0x129')]);}else if(this[_0x97e8('0x16')][_0x591be9[_0x97e8('0xb9')]][_0x97e8('0x70')]){logger['info']('[syncHangup][talking][cause]',_0x591be9[_0x97e8('0xb9')],_0x591be9['cause'],'\x20Queue',_0x3a28bd[_0x97e8('0x56')],_0x97e8('0xa9'),_0x3a28bd[_0x97e8('0x2c')]);this['callProgressDetectingCustomer'](_0x591be9,_0x591be9[_0x97e8('0xb9')],_0x591be9['cause']);}}else if(_0x5e554b&&_[_0x97e8('0x7f')](_0x5e554b[_0x97e8('0x12a')])&&_0x3a28bd[_0x97e8('0x12b')]&&_0x591be9[_0x97e8('0xb9')]===_0x591be9[_0x97e8('0xb8')]&&_[_0x97e8('0x7f')](_0x591be9[_0x97e8('0xdf')])&&_0x591be9[_0x97e8('0x129')]==='16'&&_0x591be9[_0x97e8('0x12c')]==='6'&&_[_0x97e8('0xde')](_0x5e554b['transfer'])){if(_0x5e554b['unlockAgent']){rpcDb[_0x97e8('0xce')](_0x5e554b[_0x97e8('0xcf')]);}if(_0x5e554b[_0x97e8('0xa3')]){rpcDb[_0x97e8('0x88')](_0x5e554b[_0x97e8('0xcf')]);}_0x591be9[_0x97e8('0xdf')]='22';this[_0x97e8('0xdc')](_0x5e554b,_0x3a28bd,_0x591be9);}else if(_0x5e554b&&_0x5e554b[_0x97e8('0x12d')]){if(_0x591be9['cause']==='16'&&this[_0x97e8('0x16')][_0x591be9['linkedid']]['dialAnswer']){logger[_0x97e8('0x6c')](_0x97e8('0x12e'),_0x591be9[_0x97e8('0xb9')],_0x591be9[_0x97e8('0x129')],_0x97e8('0xa8'),_0x3a28bd[_0x97e8('0x56')],_0x97e8('0xa9'),_0x3a28bd['pTalking']);this[_0x97e8('0x128')](_0x591be9,_0x591be9['linkedid'],_0x591be9['cause']);}else if(this[_0x97e8('0x16')][_0x591be9[_0x97e8('0xb9')]][_0x97e8('0x70')]){logger[_0x97e8('0x6c')](_0x97e8('0x12f'),_0x591be9[_0x97e8('0xb9')],_0x591be9[_0x97e8('0x129')],_0x97e8('0xa8'),_0x3a28bd[_0x97e8('0x56')],_0x97e8('0xa9'),_0x3a28bd[_0x97e8('0x2c')]);this[_0x97e8('0x128')](_0x591be9,_0x591be9[_0x97e8('0xb9')],_0x591be9[_0x97e8('0x129')]);}}};Preview[_0x97e8('0xf')]['syncDialEnd']=function(_0x2ac04e){if(this[_0x97e8('0x16')][_0x2ac04e['destlinkedid']]&&_0x2ac04e[_0x97e8('0x130')]!==_0x2ac04e[_0x97e8('0x131')]){this[_0x97e8('0x128')](_0x2ac04e,_0x2ac04e['destlinkedid'],_0x2ac04e[_0x97e8('0x132')]);}};Preview[_0x97e8('0xf')]['syncHangupRequest']=function(_0x570f65){if(this[_0x97e8('0x16')][_0x570f65[_0x97e8('0xb9')]]&&_0x570f65[_0x97e8('0xb9')]!==_0x570f65[_0x97e8('0xb8')]&&!this[_0x97e8('0x16')][_0x570f65[_0x97e8('0xb9')]][_0x97e8('0x70')]){if(_0x570f65[_0x97e8('0x129')]==='1'){this['callProgressDetectingCustomer'](_0x570f65,_0x570f65[_0x97e8('0xb9')],_0x570f65[_0x97e8('0x129')]);}}};Preview[_0x97e8('0xf')][_0x97e8('0x133')]=function(_0x965a1a,_0x1a03a7,_0x420887){if(this['actions'][_0x965a1a]){if(_[_0x97e8('0x7f')](this[_0x97e8('0x16')][_0x965a1a]['variables'])){this['actions'][_0x965a1a][_0x97e8('0x134')]={};}this[_0x97e8('0x16')][_0x965a1a][_0x97e8('0x134')][_0x1a03a7]=_0x420887;}};Preview['prototype'][_0x97e8('0x20')]=function(_0x3943e8){try{if(!_[_0x97e8('0x7f')](_0x3943e8)){if(ut[_0x97e8('0x135')](_[_0x97e8('0x136')](_0x3943e8[_0x97e8('0x137')])[0x0])){this['addVariable'](_0x3943e8['uniqueid'],_[_0x97e8('0x136')](_0x3943e8[_0x97e8('0x137')])[0x0],_0x3943e8[_0x97e8('0x138')]);}}}catch(_0x8c8232){logger['error'](_0x97e8('0x139'),util['inspect'](_0x8c8232,{'showHidden':![],'depth':null}));}};Preview[_0x97e8('0xf')][_0x97e8('0x22')]=function(_0x2c5281){if(_0x2c5281){if(this['actions'][_0x2c5281[_0x97e8('0x13a')]]){this[_0x97e8('0x16')][_0x2c5281[_0x97e8('0x13a')]]['transfer']=!![];}}};Preview[_0x97e8('0xf')][_0x97e8('0x13b')]=function(_0x541ab3){if(_0x541ab3){if(this['actions'][_0x541ab3[_0x97e8('0x13c')]]){this[_0x97e8('0x16')][_0x541ab3[_0x97e8('0x13c')]][_0x97e8('0x12d')]=!![];}}};module[_0x97e8('0x13d')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index bc17cf7..898e1d3 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 _0x3435=['moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','[activeContact]\x20','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','[createHistory]\x20','catch'];(function(_0x423a9a,_0x2ec223){var _0x564475=function(_0x33b25a){while(--_0x33b25a){_0x423a9a['push'](_0x423a9a['shift']());}};_0x564475(++_0x2ec223);}(_0x3435,0xfa));var _0x5343=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x3435[_0x26462c];return _0x509a42;};'use strict';var util=require(_0x5343('0x0'));var BPromise=require(_0x5343('0x1'));var logger=require(_0x5343('0x2'))(_0x5343('0x3'));var _=require(_0x5343('0x4'));var cmHopper=require(_0x5343('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x5343('0x6'));var cmHopperBlack=require(_0x5343('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x5343('0x8'));function loggerCatch(_0x28f0f3){return function(_0x4d26b5){logger['error'](_0x28f0f3,util[_0x5343('0x9')](_0x4d26b5,{'showHidden':![],'depth':null}));};}function create(_0x1e1911){return BPromise[_0x5343('0xa')]()[_0x5343('0xb')](cmHopperHistory[_0x5343('0xc')](_0x1e1911))['catch'](loggerCatch(_0x5343('0xd')));}function createAgent(_0x50d857){return BPromise[_0x5343('0xa')]()[_0x5343('0xb')](agentReportPreview[_0x5343('0xc')](_0x50d857))[_0x5343('0xe')](loggerCatch(_0x5343('0xd')));}function moveContact(_0x4ef57c){return BPromise[_0x5343('0xa')]()[_0x5343('0xb')](cmHopper[_0x5343('0xf')](_0x4ef57c,!![]))['catch'](loggerCatch(_0x5343('0x10')));}exports['checkIsBlackList']=function(_0x82074d){return BPromise[_0x5343('0xa')]()['then'](cmHopperBlack[_0x5343('0x11')](_0x82074d))['catch'](loggerCatch(_0x5343('0x12')));};exports[_0x5343('0x13')]=function(_0x28239a){return BPromise[_0x5343('0xa')]()['then'](cmHopper[_0x5343('0x13')](_0x28239a))[_0x5343('0xe')](loggerCatch(_0x5343('0x14')));};exports[_0x5343('0xc')]=function(_0x45cade,_0x2913e8){create(_0x45cade)[_0x5343('0xe')](loggerCatch(_0x2913e8));moveContact(_0x45cade)[_0x5343('0xe')](loggerCatch(_0x2913e8));};exports['createAgentHistory']=function(_0x432992,_0xec1ba0){createAgent(_0x432992)[_0x5343('0xe')](loggerCatch(_0xec1ba0));};exports['createCustomerHistory']=function(_0x1eb3bd,_0x399eec){create(_0x1eb3bd)[_0x5343('0xe')](loggerCatch(_0x399eec));};exports[_0x5343('0x15')]=function(_0x35e68c,_0xd93241){moveContact(_0x35e68c)[_0x5343('0xe')](loggerCatch(_0xd93241));};exports[_0x5343('0x16')]=function(_0x35d41d,_0x4796ae,_0x287304){if(_0x4796ae){_0x35d41d[_0x5343('0x17')]=null;}if(_0x287304){_0x35d41d[_0x5343('0x18')]=![];}return BPromise[_0x5343('0xa')]()[_0x5343('0xb')](cmHopper['rescheduleContact'](_0x35d41d))[_0x5343('0xe')](loggerCatch(_0x5343('0x19')));};exports[_0x5343('0x1a')]=function(_0x380aae){return BPromise[_0x5343('0xa')]()['then'](cmHopper[_0x5343('0x1a')](_0x380aae))[_0x5343('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x5343('0x1b')]=function(_0x96bbf6){return BPromise[_0x5343('0xa')]()['then'](cmHopper['unlockContact']({'UserId':null},_0x96bbf6,0x1))[_0x5343('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x5343('0x1c')]=function(_0x5e4b38){return BPromise[_0x5343('0xa')]()['then'](cmHopper['unlockContact']({'active':![]},_0x5e4b38,0x1))[_0x5343('0xe')](loggerCatch(_0x5343('0x1d')));};exports['crateCustomerReportQueue']=function(_0x5d597e){var _0x1202bb={};_0x1202bb['type']=_0x5d597e[_0x5343('0x1e')];_0x1202bb['uniqueid']=_0x5d597e['uniqueid'];_0x1202bb[_0x5343('0x1f')]=_0x5d597e['calleridnum'];_0x1202bb['calleridname']=_0x5d597e[_0x5343('0x20')];_0x1202bb[_0x5343('0x21')]=_0x5d597e[_0x5343('0x21')];_0x1202bb[_0x5343('0x22')]=_0x5d597e['answertime'];_0x1202bb['queuecallerleaveAt']=_0x5d597e[_0x5343('0x23')];_0x1202bb[_0x5343('0x24')]=0x1;_0x1202bb[_0x5343('0x25')]=_0x5d597e[_0x5343('0x26')];_0x1202bb[_0x5343('0x27')]=_0x5d597e[_0x5343('0x28')];_0x1202bb[_0x5343('0x29')]=_0x5343('0x2a');_0x1202bb[_0x5343('0x2b')]=_0x5343('0x2c');_0x1202bb[_0x5343('0x2d')]=0x0;_0x1202bb[_0x5343('0x2e')]=0x1;_0x1202bb['lastAssignedTo']=_0x5d597e['membername'];_0x1202bb[_0x5343('0x2f')]=_0x5343('0x30');return BPromise['resolve']()[_0x5343('0xb')](voiceQueueReport['create'](_0x1202bb))[_0x5343('0xe')](loggerCatch(_0x5343('0x31')));};exports[_0x5343('0x32')]=function(_0xcb89df,_0x5da4fa){return BPromise['resolve']()[_0x5343('0xb')](cmHopper['getContactRecallMe'](_0xcb89df,_0x5da4fa))[_0x5343('0xe')](loggerCatch(_0x5343('0x33')));};exports['rescheduleContactInQueue']=function(_0x1a8d12){return BPromise['resolve']()['then'](cmHopper[_0x5343('0x16')](_0x1a8d12,!![],!![]))[_0x5343('0xe')](loggerCatch(_0x5343('0x34')));}; \ No newline at end of file +var _0x5fd1=['[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','util','../../../config/logger','preview','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact'];(function(_0x230843,_0x5f3d61){var _0x468c40=function(_0x22fea6){while(--_0x22fea6){_0x230843['push'](_0x230843['shift']());}};_0x468c40(++_0x5f3d61);}(_0x5fd1,0x155));var _0x15fd=function(_0x1b6413,_0x1cb4dd){_0x1b6413=_0x1b6413-0x0;var _0x20ebbd=_0x5fd1[_0x1b6413];return _0x20ebbd;};'use strict';var util=require(_0x15fd('0x0'));var BPromise=require('bluebird');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var _=require(_0x15fd('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x15fd('0x4'));var cmHopperBlack=require(_0x15fd('0x5'));var voiceQueueRt=require(_0x15fd('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x15fd('0x7'));function loggerCatch(_0x386441){return function(_0x18450c){logger[_0x15fd('0x8')](_0x386441,util[_0x15fd('0x9')](_0x18450c,{'showHidden':![],'depth':null}));};}function create(_0x534e63){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopperHistory[_0x15fd('0xc')](_0x534e63))['catch'](loggerCatch(_0x15fd('0xd')));}function createAgent(_0x5c9c63){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](agentReportPreview['createHistory'](_0x5c9c63))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3dd2af){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0xe')](_0x3dd2af,!![]))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x10')));}exports[_0x15fd('0x11')]=function(_0x2660db){return BPromise[_0x15fd('0xa')]()['then'](cmHopperBlack['checkIsBlackList'](_0x2660db))['catch'](loggerCatch(_0x15fd('0x12')));};exports[_0x15fd('0x13')]=function(_0x624e9b){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0x13')](_0x624e9b))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x14')));};exports['createHistory']=function(_0x4c7080,_0x25f139){create(_0x4c7080)['catch'](loggerCatch(_0x25f139));moveContact(_0x4c7080)[_0x15fd('0xf')](loggerCatch(_0x25f139));};exports['createAgentHistory']=function(_0x917fe4,_0x318f47){createAgent(_0x917fe4)[_0x15fd('0xf')](loggerCatch(_0x318f47));};exports['createCustomerHistory']=function(_0x367c36,_0x2ad0de){create(_0x367c36)[_0x15fd('0xf')](loggerCatch(_0x2ad0de));};exports[_0x15fd('0x15')]=function(_0x2fb919,_0x36a90e){moveContact(_0x2fb919)[_0x15fd('0xf')](loggerCatch(_0x36a90e));};exports[_0x15fd('0x16')]=function(_0x1b8b9f,_0x1eab55,_0x3ff307){if(_0x1eab55){_0x1b8b9f['UserId']=null;}if(_0x3ff307){_0x1b8b9f['active']=![];}return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0x16')](_0x1b8b9f))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x17')));};exports[_0x15fd('0x18')]=function(_0x2073da){return BPromise['resolve']()[_0x15fd('0xb')](cmHopper[_0x15fd('0x18')](_0x2073da))[_0x15fd('0xf')](loggerCatch('[countReScheduled]\x20'));};exports[_0x15fd('0x19')]=function(_0x49062f){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0x19')]({'UserId':null},_0x49062f,0x1))['catch'](loggerCatch(_0x15fd('0x1a')));};exports[_0x15fd('0x1b')]=function(_0x24c541){return BPromise['resolve']()[_0x15fd('0xb')](cmHopper['unlockContact']({'active':![]},_0x24c541,0x1))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x1c')));};exports[_0x15fd('0x1d')]=function(_0x27d2c4){var _0x233ed3={};_0x233ed3[_0x15fd('0x1e')]=_0x27d2c4[_0x15fd('0x1e')];_0x233ed3[_0x15fd('0x1f')]=_0x27d2c4[_0x15fd('0x1f')];_0x233ed3[_0x15fd('0x20')]=_0x27d2c4[_0x15fd('0x20')];_0x233ed3['calleridname']=_0x27d2c4[_0x15fd('0x21')];_0x233ed3[_0x15fd('0x22')]=_0x27d2c4['queue'];_0x233ed3[_0x15fd('0x23')]=_0x27d2c4[_0x15fd('0x24')];_0x233ed3['queuecallerleaveAt']=_0x27d2c4[_0x15fd('0x24')];_0x233ed3[_0x15fd('0x25')]=0x1;_0x233ed3['queuecallercompleteAt']=_0x27d2c4[_0x15fd('0x26')];_0x233ed3[_0x15fd('0x27')]=_0x27d2c4[_0x15fd('0x28')];_0x233ed3[_0x15fd('0x29')]=_0x15fd('0x2a');_0x233ed3[_0x15fd('0x2b')]='xcally-motion-preview';_0x233ed3[_0x15fd('0x2c')]=0x0;_0x233ed3[_0x15fd('0x2d')]=0x1;_0x233ed3[_0x15fd('0x2e')]=_0x27d2c4[_0x15fd('0x28')];_0x233ed3['queuecallerexitreason']=_0x15fd('0x2f');return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](voiceQueueReport[_0x15fd('0x30')](_0x233ed3))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x31')));};exports['getContactRecallMe']=function(_0x3b80a6,_0xaae2d0){return BPromise['resolve']()[_0x15fd('0xb')](cmHopper[_0x15fd('0x32')](_0x3b80a6,_0xaae2d0))[_0x15fd('0xf')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x15fd('0x33')]=function(_0x309851){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0x16')](_0x309851,!![],!![]))[_0x15fd('0xf')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 284b82b..5e6792d 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 _0x4a99=['calleridnum','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','util','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','seconds','loggerCatch','error','logger','info','inspect','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isActive','Queue','name','calleridname','ContactId','dialer','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','logLookAgent','membername','UserId','talktime','answertime','Failure','variablesAction','RECALL','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','active','scheduledat','add','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','buildObj','lastevent','interface','buildAcw','uniqueid','status','reachable','push','getDiff','diff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4a99,0x1aa));var _0x94a9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4a99[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x94a9('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x94a9('0x1'))(_0x94a9('0x2'));var ipAgi=process['env'][_0x94a9('0x3')]||'127.0.0.1';function getSeconds(_0x229b97,_0x46dcc3){var _0xa3185e=moment(_0x229b97)['milliseconds'](0x0);var _0x3cad6a=moment(_0x46dcc3)[_0x94a9('0x4')](0x0);return _0xa3185e['diff'](_0x3cad6a,_0x94a9('0x5'));}exports[_0x94a9('0x6')]=function(_0x5a2175){return function(_0x523bc0){logger[_0x94a9('0x7')](_0x5a2175,util['inspect'](_0x523bc0,{'showHidden':![],'depth':null}));};};exports[_0x94a9('0x8')]=function(_0x4218f2,_0x3a3b0b){logger[_0x94a9('0x9')](_0x4218f2,util[_0x94a9('0xa')](_0x3a3b0b,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3b83af,_0x41f92a){logger[_0x94a9('0x7')](_0x3b83af,util[_0x94a9('0xa')](_0x41f92a,{'showHidden':![],'depth':null}));};exports[_0x94a9('0xb')]=function(_0xd6bb11){return function(_0x458862){logger['info'](_0xd6bb11,util['inspect'](_0x458862,{'showHidden':![],'depth':null}));};};exports[_0x94a9('0xc')]=function(_0x45a8da,_0x1eeb6f,_0x1fecdc){return{'message':_0x45a8da,'unlock':_0x1eeb6f,'active':_0x1fecdc};};exports[_0x94a9('0xd')]=function(_0xb1794d,_0x365273,_0x4fe4cb){if(!_['isUndefined'](_0x4fe4cb)&&_0x94a9('0xe')===typeof _0x4fe4cb&&!_[_0x94a9('0xf')](_0x4fe4cb)){if(!_['isUndefined'](_0x365273)&&'string'===typeof _0x365273&&!_[_0x94a9('0xf')](_0x365273)){return util[_0x94a9('0x10')](_0x94a9('0x11'),_0x365273,_0x4fe4cb);}return util[_0x94a9('0x10')](_0x94a9('0x11'),_0x4fe4cb,_0x4fe4cb);}if(!_[_0x94a9('0x12')](_0xb1794d)&&_0x94a9('0xe')===typeof _0xb1794d&&!_['isEmpty'](_0xb1794d)){return _0xb1794d;}return _0x94a9('0x13');};exports[_0x94a9('0x14')]=function(_0x1f2e3d){if(_['isNil'](_0x1f2e3d)){return![];}return _0x1f2e3d;};exports['addVariables']=function(_0x28d4b3,_0x114b35,_0x5bf008,_0x369210,_0x1fb178,_0x14272e){var _0x346ee1={'XMD-QUEUE':_0x114b35[_0x94a9('0x15')]?_0x114b35[_0x94a9('0x15')][_0x94a9('0x16')]:'','XMD-CALLERID':_0x369210,'XMD-CALLERID-PREVIEW':_0x14272e?util[_0x94a9('0x10')]('\x22%s\x22\x20<%s>',_0x14272e[_0x94a9('0x17')],_0x14272e['calleridnum']):_0x369210,'XMD-DIALID':_0x1fb178,'XMD-CONTACTID':_0x114b35[_0x94a9('0x18')],'XMD-CDRTYPE':_0x94a9('0x19'),'CALLERID(all)':_0x369210,'XMD-VOICEQUEUEID':_0x114b35['VoiceQueueId'],'XMD-DIALCHANNEL':_0x5bf008,'XMD-DIALTIMEOUT':_0x28d4b3['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x94a9('0x10')]('\x22rtTxX%s%s\x22',_0x28d4b3['dialQueueProject2']?'g':'',_[_0x94a9('0xf')](_0x28d4b3[_0x94a9('0x1a')])?'':_0x94a9('0x1b')),'XMD-DIALURL':_0x28d4b3[_0x94a9('0x1c')]||'','XMD-AGI':_0x28d4b3[_0x94a9('0x1d')]?util['format'](_0x94a9('0x1e'),ipAgi,_0x28d4b3[_0x94a9('0x1d')]):_0x94a9('0x1f'),'XMD-AGIAFTER':_0x28d4b3[_0x94a9('0x20')]?util[_0x94a9('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x28d4b3[_0x94a9('0x20')]):_0x94a9('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x14272e?_0x14272e[_0x94a9('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x14272e?_0x14272e[_0x94a9('0x22')]:'','XMD-DESTINATION':_0x94a9('0x23')};if(!_[_0x94a9('0xf')](_0x28d4b3[_0x94a9('0x1a')])){_0x346ee1[util['format']('%s',_0x94a9('0x24'))]=_0x28d4b3['monitor_format'];_0x346ee1[util[_0x94a9('0x10')]('%s',_0x94a9('0x25'))]=_0x1fb178;}if(_0x114b35&&_0x114b35[_0x94a9('0x26')]){for(var _0x3ed257 in _0x114b35[_0x94a9('0x26')]){if(_0x114b35[_0x94a9('0x26')][_0x94a9('0x27')](_0x3ed257)){if(!_[_0x94a9('0x28')](_0x114b35[_0x94a9('0x26')][_0x3ed257])&&_0x3ed257!=='id'&&_0x3ed257!==_0x94a9('0x29')&&_0x3ed257!==_0x94a9('0x2a')&&_0x3ed257!=='updatedAt'){_0x346ee1[util[_0x94a9('0x10')](_0x94a9('0x2b'),_0x94a9('0x2c'),_[_0x94a9('0x2d')](_0x3ed257))]=_0x114b35[_0x94a9('0x26')][_0x3ed257];}}}}return _0x346ee1;};exports[_0x94a9('0x2e')]=function(_0x5a0556){var _0x4058df={};for(var _0xb5fcb7 in _0x5a0556){if(_0x5a0556[_0x94a9('0x27')](_0xb5fcb7)){_0x4058df[util[_0x94a9('0x10')]('%s',_[_0x94a9('0x2f')](_0xb5fcb7))]=_0x5a0556[_0xb5fcb7];}}return{'variables':_0x4058df};};exports['updateOriginated']=function(_0xedac85,_0x274de8){if(!_['isNil'](_0xedac85)){if(_0xedac85[_0x94a9('0x27')](_0x94a9('0x30'))){if(_0xedac85[_0x94a9('0x30')]>0x0){_0xedac85[_0x94a9('0x30')]-=0x1;}else{logger['error'](_0x94a9('0x31'),_0x274de8);}}}else{logger[_0x94a9('0x7')](_0x94a9('0x32'),_0x274de8);}};exports[_0x94a9('0x33')]=function(_0x561ca4){var _0x12ca65=moment()[_0x94a9('0x10')](_0x94a9('0x34'));_0x561ca4['state']=0xd;_0x561ca4[_0x94a9('0x35')]=_0x94a9('0x36');_0x561ca4[_0x94a9('0x37')]=_0x12ca65;_0x561ca4[_0x94a9('0x38')]=_0x12ca65;_0x561ca4[_0x94a9('0x39')]=_0x12ca65;};exports[_0x94a9('0x3a')]=function(_0x106090,_0xda958c,_0x3b673f){var _0x185a81=moment()[_0x94a9('0x10')](_0x94a9('0x34'));_0x106090[_0x94a9('0x3b')]=_0xda958c;_0x106090[_0x94a9('0x35')]=_0x3b673f;_0x106090[_0x94a9('0x38')]=_0x185a81;_0x106090[_0x94a9('0x3c')]=getSeconds(_0x106090[_0x94a9('0x38')],_0x106090['starttime']);};exports[_0x94a9('0x3d')]=function(_0x531f6d,_0x346e09,_0x360ec8){_0x531f6d[_0x94a9('0x3e')]=_0x346e09;_0x531f6d[_0x94a9('0x3f')]=_0x360ec8;};exports['logCustomer']=function(_0x11a453,_0x21970a,_0x36d9dd){var _0x4534f8=moment()['format'](_0x94a9('0x34'));_0x11a453[_0x94a9('0x3b')]=_0x21970a;_0x11a453[_0x94a9('0x35')]=_0x36d9dd;_0x11a453['responsetime']=_0x11a453[_0x94a9('0x38')]?_0x11a453[_0x94a9('0x38')]:_0x4534f8;_0x11a453[_0x94a9('0x39')]=_0x11a453[_0x94a9('0x39')]?_0x11a453[_0x94a9('0x39')]:_0x4534f8;_0x11a453[_0x94a9('0x3c')]=getSeconds(_0x11a453[_0x94a9('0x38')]||0x0,_0x11a453['starttime']||0x0);_0x11a453[_0x94a9('0x40')]=_0x11a453[_0x94a9('0x41')]?getSeconds(_0x11a453[_0x94a9('0x39')],_0x11a453[_0x94a9('0x41')]):0x0;};exports['isFailure']=function(_0x2feae9){return _0x2feae9===_0x94a9('0x42');};exports[_0x94a9('0x43')]=function(_0x3694ae,_0x40804d,_0x1b146f,_0x2031cc,_0x3b8a7d){var _0x33c659=_0x2031cc?_0x94a9('0x44'):_0x3694ae[_0x94a9('0x17')];_0x33c659=_0x3b8a7d?'BOOKED':_0x33c659;return{'actionid':_0x3694ae['uniqueid'],'action':_0x94a9('0x45'),'channel':_0x3694ae[_0x94a9('0x46')],'callerid':util[_0x94a9('0x10')](_0x94a9('0x11'),_0x33c659,_0x3694ae['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x1b146f,'timeout':(_0x40804d[_0x94a9('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3694ae['uniqueid']};};exports[_0x94a9('0x48')]=function(_0x18d9da){return _0x18d9da[_0x94a9('0x49')]+_0x18d9da[_0x94a9('0x4a')]+_0x18d9da[_0x94a9('0x4b')];};exports[_0x94a9('0x4c')]=function(_0x1293ae){var _0x3a0457=_[_0x94a9('0x4d')](_0x1293ae);_0x3a0457[_0x94a9('0x3b')]=0xf;_0x3a0457['statedesc']=_0x94a9('0x4e');return _0x3a0457;};exports['scheduledAt']=function(_0x5383cf,_0x34ddcd,_0xd28312){var _0x4e617c={};_0x4e617c[_0x34ddcd]=_0x5383cf[_0x34ddcd];_0x4e617c[_0x94a9('0x4f')]=![];_0x4e617c[_0x94a9('0x50')]=moment()[_0x94a9('0x51')](_0xd28312,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4e617c[_0x94a9('0x18')]=_0x5383cf[_0x94a9('0x18')];_0x4e617c['ListId']=_0x5383cf[_0x94a9('0x52')];_0x4e617c[_0x94a9('0x53')]=_0x5383cf[_0x94a9('0x53')]||undefined;return _0x4e617c;};exports['decrementTalkink']=function(_0x3e77f2,_0x35df49){if(!_['isNil'](_0x3e77f2)){if(_0x3e77f2[_0x94a9('0x54')]>0x0){_0x3e77f2[_0x94a9('0x54')]-=0x1;}else{logger[_0x94a9('0x7')](_0x35df49,_0x94a9('0x55'));}}else{logger[_0x94a9('0x7')](_0x35df49,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x3d5bd5){if(_0x3d5bd5<=0x0){return!![];}return![];};exports[_0x94a9('0x56')]=function(_0x28f447,_0x160314){_0x28f447[_0x94a9('0x57')]=_0x160314;_0x28f447['name']=_0x28f447['queue'];_0x28f447[_0x94a9('0x58')]=_0x28f447['channelAgent'];return _0x28f447;};exports[_0x94a9('0x59')]=function(_0x1829df){var _0x34575f={};_0x34575f['queue']=_0x1829df['queue'];_0x34575f['interface']=_0x1829df[_0x94a9('0x46')];_0x34575f[_0x94a9('0x5a')]=_0x1829df[_0x94a9('0x5a')];return _0x34575f;};exports['agentReadyId']=function(_0x13adc6){var _0xfd9608=[];for(var _0x28ffd7 in _0x13adc6){if(_0x13adc6[_0x94a9('0x27')](_0x28ffd7)){if(!_['isNil'](_0x13adc6[_0x28ffd7])&&_0x13adc6[_0x28ffd7]['state']==='not_inuse'&&_0x13adc6[_0x28ffd7][_0x94a9('0x5b')]===_0x94a9('0x5c')){_0xfd9608[_0x94a9('0x5d')](_0x13adc6[_0x28ffd7]['id']);}}}return _0xfd9608;};exports[_0x94a9('0x5e')]=function(_0x4f3d65){var _0x4151f7=moment()[_0x94a9('0x4')](0x0);var _0x50cf9c=moment(_0x4f3d65)[_0x94a9('0x4')](0x0);return _0x4151f7[_0x94a9('0x5f')](_0x50cf9c,'seconds');};exports[_0x94a9('0x60')]=function(_0x323fbe){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x323fbe[_0x94a9('0x18')],'ListId':_0x323fbe['ListId'],'VoiceQueueId':_0x323fbe[_0x94a9('0x53')]||undefined,'CampaignId':_0x323fbe[_0x94a9('0x61')]||undefined};};exports[_0x94a9('0x62')]=function(_0x52cd56){if(_0x52cd56==='uniqueid'||_0x52cd56===_0x94a9('0x63')||_0x52cd56==='queue'||_0x52cd56==='type'||_0x52cd56===_0x94a9('0x64')||_0x52cd56===_0x94a9('0x65')||_0x52cd56==='membername'||_0x52cd56===_0x94a9('0x46')||_0x52cd56===_0x94a9('0x17')||_0x52cd56===_0x94a9('0x4f')||_0x52cd56===_0x94a9('0x66')||_0x52cd56===_0x94a9('0x50')||_0x52cd56===_0x94a9('0x49')||_0x52cd56===_0x94a9('0x4a')||_0x52cd56===_0x94a9('0x4b')||_0x52cd56==='countglobal'||_0x52cd56==='callback'||_0x52cd56===_0x94a9('0x67')||_0x52cd56===_0x94a9('0x68')||_0x52cd56==='recallme'||_0x52cd56===_0x94a9('0x18')||_0x52cd56===_0x94a9('0x52')||_0x52cd56===_0x94a9('0x3f')||_0x52cd56===_0x94a9('0x53')||_0x52cd56===_0x94a9('0x69')||_0x52cd56===_0x94a9('0x6a')||_0x52cd56==='xmd-queue'||_0x52cd56===_0x94a9('0x6b')||_0x52cd56===_0x94a9('0x6c')||_0x52cd56===_0x94a9('0x6d')||_0x52cd56===_0x94a9('0x6e')||_0x52cd56===_0x94a9('0x6f')||_0x52cd56===_0x94a9('0x70')||_0x52cd56===_0x94a9('0x71')||_0x52cd56===_0x94a9('0x72')||_0x52cd56==='xmd-cdrtype'||_0x52cd56==='xmd-callerid'||_0x52cd56==='xmd-agiafter'||_0x52cd56===_0x94a9('0x73')||_0x52cd56==='rtpaudioqos'||_0x52cd56===_0x94a9('0x74')||_0x52cd56===_0x94a9('0x75')||_0x52cd56===_0x94a9('0x76')||_0x52cd56===_0x94a9('0x77')||_0x52cd56===_0x94a9('0x78')||_0x52cd56===_0x94a9('0x79')||_0x52cd56===_0x94a9('0x7a')||_0x52cd56===_0x94a9('0x7b')||_0x52cd56===_0x94a9('0x74')||_0x52cd56===_0x94a9('0x75')||_0x52cd56===_0x94a9('0x76')||_0x52cd56==='rtpaudioqosloss'||_0x52cd56===_0x94a9('0x78')||_0x52cd56===_0x94a9('0x79')||_0x52cd56===_0x94a9('0x7a')||_0x52cd56==='bridgepeer'||_0x52cd56==='bridgepvtcallid'||_0x52cd56===_0x94a9('0x3b')||_0x52cd56===_0x94a9('0x35')){return![];}return!![];};exports[_0x94a9('0x7c')]=function(_0xe46a42,_0x34fc61){var _0x1f948c,_0x1718f0,_0x1ba9db;if(_0x34fc61<=0x0){_0x34fc61=0x1;}_0x1f948c=new RegExp(_0x94a9('0x7d')+_0x34fc61+'}$');_0x1718f0=Math['pow'](0xa,_0x34fc61-0x1);_0x1ba9db=Math[_0x94a9('0x7e')](0xa,_0x34fc61)-0x1;return util[_0x94a9('0x10')]('%s',_[_0x94a9('0x7f')](_0xe46a42,_0x1f948c,_[_0x94a9('0x80')](_0x1718f0,_0x1ba9db)));};exports[_0x94a9('0x81')]=function(_0xab00f0){var _0x1ca882=_0xab00f0['match'](/"(.*?)"/);return _0x1ca882?_0x1ca882[0x1]:_0xab00f0;};exports[_0x94a9('0x82')]=function(_0x32fec7){var _0x1c4d75=_0x32fec7[_0x94a9('0x83')](/<(.*?)>/);return _0x1c4d75?_0x1c4d75[0x1]:_0x32fec7;}; \ No newline at end of file +var _0x44ae=['isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','endtime','talktime','answertime','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','active','scheduledat','add','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','buildAcw','interface','agentReadyId','status','reachable','getDiff','createBody','ListId','filterKey','type','campaigntype','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined'];(function(_0xc5e0e3,_0x5f82f6){var _0x3dce24=function(_0x42097c){while(--_0x42097c){_0xc5e0e3['push'](_0xc5e0e3['shift']());}};_0x3dce24(++_0x5f82f6);}(_0x44ae,0x17d));var _0xe44a=function(_0x5dfba5,_0x2caa21){_0x5dfba5=_0x5dfba5-0x0;var _0x3083a0=_0x44ae[_0x5dfba5];return _0x3083a0;};'use strict';var util=require(_0xe44a('0x0'));var _=require(_0xe44a('0x1'));var moment=require(_0xe44a('0x2'));var logger=require(_0xe44a('0x3'))('preview');var ipAgi=process[_0xe44a('0x4')]['XCALLY_IP_AGI']||_0xe44a('0x5');function getSeconds(_0x18455c,_0x174a3f){var _0x2f653c=moment(_0x18455c)[_0xe44a('0x6')](0x0);var _0x3f9763=moment(_0x174a3f)['milliseconds'](0x0);return _0x2f653c[_0xe44a('0x7')](_0x3f9763,_0xe44a('0x8'));}exports[_0xe44a('0x9')]=function(_0x202eaf){return function(_0x4cb089){logger[_0xe44a('0xa')](_0x202eaf,util[_0xe44a('0xb')](_0x4cb089,{'showHidden':![],'depth':null}));};};exports[_0xe44a('0xc')]=function(_0x30a104,_0x4c52ee){logger[_0xe44a('0xd')](_0x30a104,util[_0xe44a('0xb')](_0x4c52ee,{'showHidden':![],'depth':null}));};exports[_0xe44a('0xe')]=function(_0x1d7db0,_0xe19628){logger[_0xe44a('0xa')](_0x1d7db0,util[_0xe44a('0xb')](_0xe19628,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x529967){return function(_0x5f1150){logger[_0xe44a('0xd')](_0x529967,util[_0xe44a('0xb')](_0x5f1150,{'showHidden':![],'depth':null}));};};exports[_0xe44a('0xf')]=function(_0x56cee6,_0x2263ba,_0x3ab707){return{'message':_0x56cee6,'unlock':_0x2263ba,'active':_0x3ab707};};exports[_0xe44a('0x10')]=function(_0x14c1a8,_0x14334d,_0x170f1e){if(!_[_0xe44a('0x11')](_0x170f1e)&&'string'===typeof _0x170f1e&&!_[_0xe44a('0x12')](_0x170f1e)){if(!_[_0xe44a('0x11')](_0x14334d)&&'string'===typeof _0x14334d&&!_['isEmpty'](_0x14334d)){return util['format']('\x22%s\x22\x20<%s>',_0x14334d,_0x170f1e);}return util[_0xe44a('0x13')](_0xe44a('0x14'),_0x170f1e,_0x170f1e);}if(!_[_0xe44a('0x11')](_0x14c1a8)&&'string'===typeof _0x14c1a8&&!_[_0xe44a('0x12')](_0x14c1a8)){return _0x14c1a8;}return _0xe44a('0x15');};exports[_0xe44a('0x16')]=function(_0x20193c){if(_[_0xe44a('0x17')](_0x20193c)){return![];}return _0x20193c;};exports[_0xe44a('0x18')]=function(_0x4f3baf,_0x1c4d90,_0x5c01c1,_0x295ceb,_0x6656a8,_0x35f878){var _0x2663bb={'XMD-QUEUE':_0x1c4d90[_0xe44a('0x19')]?_0x1c4d90[_0xe44a('0x19')][_0xe44a('0x1a')]:'','XMD-CALLERID':_0x295ceb,'XMD-CALLERID-PREVIEW':_0x35f878?util['format'](_0xe44a('0x14'),_0x35f878['calleridname'],_0x35f878[_0xe44a('0x1b')]):_0x295ceb,'XMD-DIALID':_0x6656a8,'XMD-CONTACTID':_0x1c4d90[_0xe44a('0x1c')],'XMD-CDRTYPE':_0xe44a('0x1d'),'CALLERID(all)':_0x295ceb,'XMD-VOICEQUEUEID':_0x1c4d90[_0xe44a('0x1e')],'XMD-DIALCHANNEL':_0x5c01c1,'XMD-DIALTIMEOUT':_0x4f3baf[_0xe44a('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xe44a('0x13')](_0xe44a('0x20'),_0x4f3baf[_0xe44a('0x21')]?'g':'',_[_0xe44a('0x12')](_0x4f3baf[_0xe44a('0x22')])?'':_0xe44a('0x23')),'XMD-DIALURL':_0x4f3baf[_0xe44a('0x24')]||'','XMD-AGI':_0x4f3baf[_0xe44a('0x25')]?util[_0xe44a('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4f3baf[_0xe44a('0x25')]):'NONE','XMD-AGIAFTER':_0x4f3baf[_0xe44a('0x21')]?util[_0xe44a('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4f3baf[_0xe44a('0x21')]):_0xe44a('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x35f878?_0x35f878[_0xe44a('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x35f878?_0x35f878['originatecalleridname']:'','XMD-DESTINATION':_0xe44a('0x28')};if(!_['isEmpty'](_0x4f3baf[_0xe44a('0x22')])){_0x2663bb[util['format']('%s',_0xe44a('0x29'))]=_0x4f3baf['monitor_format'];_0x2663bb[util['format']('%s',_0xe44a('0x2a'))]=_0x6656a8;}if(_0x1c4d90&&_0x1c4d90['Contact']){for(var _0x74869b in _0x1c4d90['Contact']){if(_0x1c4d90[_0xe44a('0x2b')][_0xe44a('0x2c')](_0x74869b)){if(!_[_0xe44a('0x17')](_0x1c4d90['Contact'][_0x74869b])&&_0x74869b!=='id'&&_0x74869b!==_0xe44a('0x2d')&&_0x74869b!==_0xe44a('0x2e')&&_0x74869b!=='updatedAt'){_0x2663bb[util['format'](_0xe44a('0x2f'),'XMD-',_['toUpper'](_0x74869b))]=_0x1c4d90[_0xe44a('0x2b')][_0x74869b];}}}}return _0x2663bb;};exports[_0xe44a('0x30')]=function(_0x1d2c8e){var _0x220f10={};for(var _0x1cc637 in _0x1d2c8e){if(_0x1d2c8e[_0xe44a('0x2c')](_0x1cc637)){_0x220f10[util[_0xe44a('0x13')]('%s',_[_0xe44a('0x31')](_0x1cc637))]=_0x1d2c8e[_0x1cc637];}}return{'variables':_0x220f10};};exports[_0xe44a('0x32')]=function(_0x16c1ba,_0x2ace0f){if(!_[_0xe44a('0x17')](_0x16c1ba)){if(_0x16c1ba[_0xe44a('0x2c')](_0xe44a('0x33'))){if(_0x16c1ba[_0xe44a('0x33')]>0x0){_0x16c1ba[_0xe44a('0x33')]-=0x1;}else{logger['error'](_0xe44a('0x34'),_0x2ace0f);}}}else{logger[_0xe44a('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x2ace0f);}};exports[_0xe44a('0x35')]=function(_0x443d20){var _0x5b945d=moment()['format'](_0xe44a('0x36'));_0x443d20[_0xe44a('0x37')]=0xd;_0x443d20[_0xe44a('0x38')]=_0xe44a('0x39');_0x443d20[_0xe44a('0x3a')]=_0x5b945d;_0x443d20[_0xe44a('0x3b')]=_0x5b945d;_0x443d20['endtime']=_0x5b945d;};exports[_0xe44a('0x3c')]=function(_0xabdd53,_0x2e2fe0,_0x370202){var _0x44cf8b=moment()[_0xe44a('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0xabdd53[_0xe44a('0x37')]=_0x2e2fe0;_0xabdd53['statedesc']=_0x370202;_0xabdd53[_0xe44a('0x3b')]=_0x44cf8b;_0xabdd53[_0xe44a('0x3d')]=getSeconds(_0xabdd53[_0xe44a('0x3b')],_0xabdd53['starttime']);};exports[_0xe44a('0x3e')]=function(_0x5587fa,_0x4b374b,_0x2dd3fc){_0x5587fa[_0xe44a('0x3f')]=_0x4b374b;_0x5587fa['UserId']=_0x2dd3fc;};exports['logCustomer']=function(_0xc131b6,_0x10bdb7,_0x2c0493){var _0x2d4f96=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xc131b6[_0xe44a('0x37')]=_0x10bdb7;_0xc131b6['statedesc']=_0x2c0493;_0xc131b6[_0xe44a('0x3b')]=_0xc131b6[_0xe44a('0x3b')]?_0xc131b6[_0xe44a('0x3b')]:_0x2d4f96;_0xc131b6[_0xe44a('0x40')]=_0xc131b6[_0xe44a('0x40')]?_0xc131b6[_0xe44a('0x40')]:_0x2d4f96;_0xc131b6[_0xe44a('0x3d')]=getSeconds(_0xc131b6[_0xe44a('0x3b')]||0x0,_0xc131b6['starttime']||0x0);_0xc131b6[_0xe44a('0x41')]=_0xc131b6['answertime']?getSeconds(_0xc131b6[_0xe44a('0x40')],_0xc131b6[_0xe44a('0x42')]):0x0;};exports['isFailure']=function(_0x590576){return _0x590576===_0xe44a('0x43');};exports[_0xe44a('0x44')]=function(_0x4656f3,_0x2294fc,_0x56e905,_0x49c4ea,_0x4c3541){var _0x122ae8=_0x49c4ea?_0xe44a('0x45'):_0x4656f3[_0xe44a('0x46')];_0x122ae8=_0x4c3541?_0xe44a('0x47'):_0x122ae8;return{'actionid':_0x4656f3[_0xe44a('0x48')],'action':_0xe44a('0x49'),'channel':_0x4656f3[_0xe44a('0x4a')],'callerid':util[_0xe44a('0x13')](_0xe44a('0x14'),_0x122ae8,_0x4656f3[_0xe44a('0x1b')]),'Exten':_0xe44a('0x28'),'Context':_0xe44a('0x4b'),'Priority':'1','variable':_0x56e905,'timeout':(_0x2294fc[_0xe44a('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4656f3[_0xe44a('0x48')]};};exports[_0xe44a('0x4d')]=function(_0x50a23d){return _0x50a23d[_0xe44a('0x4e')]+_0x50a23d[_0xe44a('0x4f')]+_0x50a23d[_0xe44a('0x50')];};exports[_0xe44a('0x51')]=function(_0x502e7e){var _0x53b170=_[_0xe44a('0x52')](_0x502e7e);_0x53b170[_0xe44a('0x37')]=0xf;_0x53b170[_0xe44a('0x38')]=_0xe44a('0x53');return _0x53b170;};exports['scheduledAt']=function(_0x5ca6e3,_0x5347ee,_0x216344){var _0x2d12a1={};_0x2d12a1[_0x5347ee]=_0x5ca6e3[_0x5347ee];_0x2d12a1[_0xe44a('0x54')]=![];_0x2d12a1[_0xe44a('0x55')]=moment()[_0xe44a('0x56')](_0x216344,_0xe44a('0x57'))[_0xe44a('0x13')](_0xe44a('0x36'));_0x2d12a1[_0xe44a('0x1c')]=_0x5ca6e3[_0xe44a('0x1c')];_0x2d12a1['ListId']=_0x5ca6e3['ListId'];_0x2d12a1['VoiceQueueId']=_0x5ca6e3[_0xe44a('0x1e')]||undefined;return _0x2d12a1;};exports[_0xe44a('0x58')]=function(_0x5d561e,_0xe6db2b){if(!_[_0xe44a('0x17')](_0x5d561e)){if(_0x5d561e[_0xe44a('0x59')]>0x0){_0x5d561e[_0xe44a('0x59')]-=0x1;}else{logger[_0xe44a('0xa')](_0xe6db2b,_0xe44a('0x5a'));}}else{logger[_0xe44a('0xa')](_0xe6db2b,_0xe44a('0x5b'));}};exports[_0xe44a('0x5c')]=function(_0x5dc6ef){if(_0x5dc6ef<=0x0){return!![];}return![];};exports['buildObj']=function(_0xef56cf,_0x913c3e){_0xef56cf['lastevent']=_0x913c3e;_0xef56cf[_0xe44a('0x1a')]=_0xef56cf[_0xe44a('0x5d')];_0xef56cf['interface']=_0xef56cf[_0xe44a('0x4a')];return _0xef56cf;};exports[_0xe44a('0x5e')]=function(_0x399b13){var _0x4e8445={};_0x4e8445['queue']=_0x399b13['queue'];_0x4e8445[_0xe44a('0x5f')]=_0x399b13['channelAgent'];_0x4e8445[_0xe44a('0x48')]=_0x399b13[_0xe44a('0x48')];return _0x4e8445;};exports[_0xe44a('0x60')]=function(_0x5c9aab){var _0x39513f=[];for(var _0x418ab3 in _0x5c9aab){if(_0x5c9aab['hasOwnProperty'](_0x418ab3)){if(!_[_0xe44a('0x17')](_0x5c9aab[_0x418ab3])&&_0x5c9aab[_0x418ab3][_0xe44a('0x37')]==='not_inuse'&&_0x5c9aab[_0x418ab3][_0xe44a('0x61')]===_0xe44a('0x62')){_0x39513f['push'](_0x5c9aab[_0x418ab3]['id']);}}}return _0x39513f;};exports[_0xe44a('0x63')]=function(_0x22a58c){var _0x49514d=moment()[_0xe44a('0x6')](0x0);var _0x3e0616=moment(_0x22a58c)[_0xe44a('0x6')](0x0);return _0x49514d['diff'](_0x3e0616,_0xe44a('0x8'));};exports[_0xe44a('0x64')]=function(_0xe4296){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xe4296[_0xe44a('0x1c')],'ListId':_0xe4296[_0xe44a('0x65')],'VoiceQueueId':_0xe4296[_0xe44a('0x1e')]||undefined,'CampaignId':_0xe4296['CampaignId']||undefined};};exports[_0xe44a('0x66')]=function(_0x156b49){if(_0x156b49===_0xe44a('0x48')||_0x156b49==='idContact'||_0x156b49===_0xe44a('0x5d')||_0x156b49===_0xe44a('0x67')||_0x156b49===_0xe44a('0x68')||_0x156b49==='dialAnswer'||_0x156b49==='membername'||_0x156b49===_0xe44a('0x4a')||_0x156b49===_0xe44a('0x46')||_0x156b49===_0xe44a('0x54')||_0x156b49===_0xe44a('0x1b')||_0x156b49===_0xe44a('0x55')||_0x156b49===_0xe44a('0x4e')||_0x156b49===_0xe44a('0x4f')||_0x156b49===_0xe44a('0x50')||_0x156b49==='countglobal'||_0x156b49===_0xe44a('0x69')||_0x156b49===_0xe44a('0x6a')||_0x156b49===_0xe44a('0x6b')||_0x156b49==='recallme'||_0x156b49===_0xe44a('0x1c')||_0x156b49===_0xe44a('0x65')||_0x156b49==='UserId'||_0x156b49===_0xe44a('0x1e')||_0x156b49===_0xe44a('0x6c')||_0x156b49==='xmd-voicequeueid'||_0x156b49===_0xe44a('0x6d')||_0x156b49===_0xe44a('0x6e')||_0x156b49===_0xe44a('0x6f')||_0x156b49===_0xe44a('0x70')||_0x156b49===_0xe44a('0x71')||_0x156b49==='xmd-dialoptions'||_0x156b49===_0xe44a('0x72')||_0x156b49==='xmd-dialchannel'||_0x156b49===_0xe44a('0x73')||_0x156b49===_0xe44a('0x74')||_0x156b49==='xmd-callerid'||_0x156b49===_0xe44a('0x75')||_0x156b49==='xmd-agi'||_0x156b49==='rtpaudioqos'||_0x156b49===_0xe44a('0x76')||_0x156b49===_0xe44a('0x77')||_0x156b49===_0xe44a('0x78')||_0x156b49===_0xe44a('0x79')||_0x156b49===_0xe44a('0x7a')||_0x156b49===_0xe44a('0x7b')||_0x156b49===_0xe44a('0x7c')||_0x156b49===_0xe44a('0x7d')||_0x156b49===_0xe44a('0x76')||_0x156b49===_0xe44a('0x77')||_0x156b49===_0xe44a('0x78')||_0x156b49===_0xe44a('0x79')||_0x156b49===_0xe44a('0x7a')||_0x156b49===_0xe44a('0x7b')||_0x156b49===_0xe44a('0x7c')||_0x156b49==='bridgepeer'||_0x156b49===_0xe44a('0x7e')||_0x156b49===_0xe44a('0x37')||_0x156b49===_0xe44a('0x38')){return![];}return!![];};exports[_0xe44a('0x7f')]=function(_0x16940a,_0x1423c1){var _0x175ded,_0x1fc696,_0x18e2bf;if(_0x1423c1<=0x0){_0x1423c1=0x1;}_0x175ded=new RegExp(_0xe44a('0x80')+_0x1423c1+'}$');_0x1fc696=Math[_0xe44a('0x81')](0xa,_0x1423c1-0x1);_0x18e2bf=Math[_0xe44a('0x81')](0xa,_0x1423c1)-0x1;return util[_0xe44a('0x13')]('%s',_[_0xe44a('0x82')](_0x16940a,_0x175ded,_['random'](_0x1fc696,_0x18e2bf)));};exports['extractCalleridName']=function(_0x1907a4){var _0x278b1b=_0x1907a4[_0xe44a('0x83')](/"(.*?)"/);return _0x278b1b?_0x278b1b[0x1]:_0x1907a4;};exports[_0xe44a('0x84')]=function(_0x124552){var _0x23e9c4=_0x124552[_0xe44a('0x83')](/<(.*?)>/);return _0x23e9c4?_0x23e9c4[0x1]:_0x124552;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index e90fe0b..4dfb145 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0xdd1cb,_0x5aa8f0){var _0x38a8c3=function(_0x2083bd){while(--_0x2083bd){_0xdd1cb['push'](_0xdd1cb['shift']());}};_0x38a8c3(++_0x5aa8f0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x744fd2,_0x393b40){_0x744fd2=_0x744fd2-0x0;var _0x742cc5=_0x5f2f[_0x744fd2];return _0x742cc5;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x46512d,_0x458654){var _0x58a052=function(_0x7792f1){while(--_0x7792f1){_0x46512d['push'](_0x46512d['shift']());}};_0x58a052(++_0x458654);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18a638,_0x3234f6){_0x18a638=_0x18a638-0x0;var _0x3600cb=_0x5f2f[_0x18a638];return _0x3600cb;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 5228921..afc1ff5 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 _0x1a59=['zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','initTelephones','length','isUndefined','initVoiceQueues','voiceQueues','initTriggers','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','total','initVoiceCallReports','duration','billableseconds','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','triggers','campaigns','outbound','channels','outboundChannels'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0x1a59,0x11a));var _0x91a5=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0x1a59[_0x119cd8];return _0x7072a3;};'use strict';var BPromise=require('bluebird');var util=require(_0x91a5('0x0'));var _=require(_0x91a5('0x1'));var moment=require(_0x91a5('0x2'));var Agent=require(_0x91a5('0x3'));var Telephone=require(_0x91a5('0x4'));var Trunk=require(_0x91a5('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x91a5('0x6'));var Template=require(_0x91a5('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x91a5('0x8'));var ZendeskAccount=require(_0x91a5('0x9'));var SalesforceAccount=require(_0x91a5('0xa'));var FreshdeskAccount=require(_0x91a5('0xb'));var SugarcrmAccount=require(_0x91a5('0xc'));var ZohoAccount=require(_0x91a5('0xd'));var DeskAccount=require(_0x91a5('0xe'));var VtigerAccount=require(_0x91a5('0xf'));var ServicenowAccount=require(_0x91a5('0x10'));var Dynamics365Account=require(_0x91a5('0x11'));var FreshsalesAccount=require(_0x91a5('0x12'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x91a5('0x13')]={};this[_0x91a5('0x14')]={};this[_0x91a5('0x15')]={};this['voiceQueues']={};this[_0x91a5('0x16')]={};this[_0x91a5('0x17')]={};this['templates']={};this[_0x91a5('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x91a5('0x19')]={};this['queueChannels']={};this[_0x91a5('0x1a')]={};this['timers']={};this[_0x91a5('0x1b')]={};this[_0x91a5('0x1c')]={};this[_0x91a5('0x1d')]={};this[_0x91a5('0x1e')]={};this[_0x91a5('0x1f')]={};this[_0x91a5('0x20')]={};this[_0x91a5('0x21')]={};this[_0x91a5('0x22')]={};this[_0x91a5('0x23')]={};this[_0x91a5('0x24')]={};this[_0x91a5('0x25')]={};};function freeIsNotKey(_0xb5a7a4,_0xd68bc0,_0x565b48){var _0x3e7c7c=_[_0x91a5('0x26')](_0xb5a7a4,function(_0x2ecf90,_0x1ec0bd){return _0x2ecf90[_0x565b48];});for(var _0x164a4b in _0xd68bc0){if(_0xd68bc0[_0x91a5('0x27')](_0x164a4b)){if(!_0x3e7c7c[_0x164a4b]){delete _0xd68bc0[_0x164a4b];}}}}function freeIsNotKeySip(_0x4ce9ca,_0x367247){var _0x4f68e1=_[_0x91a5('0x26')](_0x4ce9ca,function(_0x565d8e,_0x3912f5){return util[_0x91a5('0x28')](_0x91a5('0x29'),_0x565d8e[_0x91a5('0x2a')]);});for(var _0x4b92e9 in _0x367247){if(_0x367247[_0x91a5('0x27')](_0x4b92e9)){if(!_0x4f68e1[_0x4b92e9]){delete _0x367247[_0x4b92e9];}}}}function freeIsNotKeyAgent(_0x33bf64,_0x24c447){var _0x5d494b=_[_0x91a5('0x26')](_0x33bf64,function(_0x2725b6,_0x49cf5c){var _0x3b4526=_[_0x91a5('0x2b')](_0x2725b6['interface'])?util[_0x91a5('0x28')](_0x91a5('0x29'),_0x2725b6['name']):_0x2725b6[_0x91a5('0x2c')];return _0x3b4526;});for(var _0x7f4ecd in _0x24c447){if(_0x24c447[_0x91a5('0x27')](_0x7f4ecd)){if(!_0x5d494b[_0x7f4ecd]){delete _0x24c447[_0x7f4ecd];}}}}function clearVoiceCallReports(_0x83718d){_0x83718d['total']=0x0;_0x83718d['answered']=0x0;_0x83718d[_0x91a5('0x2d')]=0x0;_0x83718d[_0x91a5('0x2e')]=0x0;_0x83718d[_0x91a5('0x2f')]=0x0;}function clearCampaigns(_0x1be085){if(!_[_0x91a5('0x30')](_0x1be085)){for(var _0x483cd1 in _0x1be085){if(_0x1be085[_0x91a5('0x27')](_0x483cd1)){_0x1be085[_0x483cd1][_0x91a5('0x31')]=0x0;_0x1be085[_0x483cd1][_0x91a5('0x32')]=0x0;}}}}function clearVoiceQueues(_0x5e5124){if(!_[_0x91a5('0x30')](_0x5e5124)){for(var _0x16b857 in _0x5e5124){if(_0x5e5124[_0x91a5('0x27')](_0x16b857)){_0x5e5124[_0x16b857]['total']=0x0;_0x5e5124[_0x16b857][_0x91a5('0x33')]=0x0;_0x5e5124[_0x16b857][_0x91a5('0x34')]=0x0;_0x5e5124[_0x16b857]['abandoned']=0x0;_0x5e5124[_0x16b857]['sumHoldTime']=0x0;_0x5e5124[_0x16b857]['sumDuration']=0x0;_0x5e5124[_0x16b857][_0x91a5('0x2f')]=0x0;_0x5e5124[_0x16b857][_0x91a5('0x35')]=0x0;_0x5e5124[_0x16b857][_0x91a5('0x36')]=0x0;_0x5e5124[_0x16b857]['outboundBusyCallsDay']=0x0;_0x5e5124[_0x16b857][_0x91a5('0x37')]=0x0;_0x5e5124[_0x16b857]['outboundNoSuchCallsDay']=0x0;_0x5e5124[_0x16b857][_0x91a5('0x38')]=0x0;_0x5e5124[_0x16b857][_0x91a5('0x39')]=0x0;_0x5e5124[_0x16b857]['outboundDropCallsDayCallersExit']=0x0;_0x5e5124[_0x16b857]['outboundBlacklistCallsDay']=0x0;_0x5e5124[_0x16b857][_0x91a5('0x3a')]=0x0;_0x5e5124[_0x16b857][_0x91a5('0x3b')]=0x0;_0x5e5124[_0x16b857][_0x91a5('0x3c')]=0x0;_0x5e5124[_0x16b857]['outboundAnswerAgiCallsDay']=0x0;_0x5e5124[_0x16b857][_0x91a5('0x3d')]=0x0;_0x5e5124[_0x16b857][_0x91a5('0x3e')]=!![];}}}}Realtime[_0x91a5('0x3f')][_0x91a5('0x40')]=function(_0x285197,_0x5b1bdd){for(var _0x2de10a in _0x5b1bdd){if(_0x285197[_0x91a5('0x27')](_0x2de10a)){_0x285197[_0x2de10a]=_0x5b1bdd[_0x2de10a];}}};Realtime['prototype'][_0x91a5('0x41')]=function(){var _0x14373d=this;return function(_0x5d1187){if(_0x5d1187){freeIsNotKeyAgent(_0x5d1187,_0x14373d[_0x91a5('0x13')]);for(var _0x47d07a=0x0,_0x507a00={},_0x5f39d9={};_0x47d07a<_0x5d1187['length'];_0x47d07a+=0x1){_0x507a00=_0x5d1187[_0x47d07a];var _0x12d331=_[_0x91a5('0x2b')](_0x507a00[_0x91a5('0x2c')])?util[_0x91a5('0x28')]('SIP/%s',_0x507a00[_0x91a5('0x2a')]):_0x507a00[_0x91a5('0x2c')];if(_['isUndefined'](_0x14373d[_0x91a5('0x13')][_0x12d331])){_0x14373d[_0x91a5('0x13')][_0x12d331]=new Agent(_0x507a00);}else{_0x14373d[_0x91a5('0x40')](_0x14373d[_0x91a5('0x13')][_0x12d331],_0x507a00);}}}return _0x14373d['agents'];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x42')]=function(){var _0x6a093d=this;return function(_0x1b7d37){if(_0x1b7d37){freeIsNotKeySip(_0x1b7d37,_0x6a093d[_0x91a5('0x14')]);for(var _0x43431b=0x0,_0x161ac0={},_0x1a423e={};_0x43431b<_0x1b7d37[_0x91a5('0x43')];_0x43431b+=0x1){_0x161ac0=_0x1b7d37[_0x43431b];if(_[_0x91a5('0x44')](_0x6a093d[_0x91a5('0x14')][util[_0x91a5('0x28')](_0x91a5('0x29'),_0x161ac0['name'])])){_0x6a093d[_0x91a5('0x14')][util[_0x91a5('0x28')]('SIP/%s',_0x161ac0[_0x91a5('0x2a')])]=new Telephone(_0x161ac0);}else{_0x6a093d['mergeFromDatabase'](_0x6a093d[_0x91a5('0x14')][util[_0x91a5('0x28')](_0x91a5('0x29'),_0x161ac0[_0x91a5('0x2a')])],_0x161ac0);}}}return _0x6a093d[_0x91a5('0x14')];};};Realtime[_0x91a5('0x3f')]['initTrunks']=function(){var _0x1cfa39=this;return function(_0x548c46){if(_0x548c46){freeIsNotKeySip(_0x548c46,_0x1cfa39[_0x91a5('0x15')]);for(var _0x298892=0x0,_0x99c7d={},_0x5d0530={};_0x298892<_0x548c46[_0x91a5('0x43')];_0x298892+=0x1){_0x99c7d=_0x548c46[_0x298892];if(_['isUndefined'](_0x1cfa39['trunks'][util[_0x91a5('0x28')](_0x91a5('0x29'),_0x99c7d[_0x91a5('0x2a')])])){_0x1cfa39[_0x91a5('0x15')][util['format']('SIP/%s',_0x99c7d[_0x91a5('0x2a')])]=new Trunk(_0x99c7d);}else{_0x1cfa39[_0x91a5('0x40')](_0x1cfa39[_0x91a5('0x15')][util[_0x91a5('0x28')](_0x91a5('0x29'),_0x99c7d['name'])],_0x99c7d);}}}return _0x1cfa39[_0x91a5('0x15')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x45')]=function(){var _0x47df02=this;return function(_0x4d5a2f){if(_0x4d5a2f){freeIsNotKey(_0x4d5a2f,_0x47df02[_0x91a5('0x46')],_0x91a5('0x2a'));for(var _0x3e595e=0x0,_0x52c9bf={},_0x5db439={};_0x3e595e<_0x4d5a2f[_0x91a5('0x43')];_0x3e595e+=0x1){_0x52c9bf=_0x4d5a2f[_0x3e595e];if(_[_0x91a5('0x44')](_0x47df02['voiceQueues'][_0x52c9bf[_0x91a5('0x2a')]])){_0x47df02[_0x91a5('0x46')][_0x52c9bf['name']]=new VoiceQueue(_0x52c9bf);}else{_0x47df02[_0x91a5('0x40')](_0x47df02[_0x91a5('0x46')][_0x52c9bf[_0x91a5('0x2a')]],_0x52c9bf);}}}return _0x47df02[_0x91a5('0x46')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x47')]=function(){var _0x5c197c=this;return function(_0x177a2c){if(_0x177a2c){freeIsNotKey(_0x177a2c,_0x5c197c[_0x91a5('0x16')],'id');for(var _0x1779b7=0x0,_0x934381={},_0x286a74={};_0x1779b7<_0x177a2c['length'];_0x1779b7+=0x1){_0x934381=_0x177a2c[_0x1779b7];if(_[_0x91a5('0x44')](_0x5c197c[_0x91a5('0x16')][_0x934381['id']])){_0x5c197c['triggers'][_0x934381['id']]=new Trigger(_0x934381);}else{_0x5c197c['mergeFromDatabase'](_0x5c197c[_0x91a5('0x16')][_0x934381['id']],_0x934381);}}}return _0x5c197c[_0x91a5('0x16')];};};Realtime['prototype']['initTemplates']=function(){var _0x565616=this;return function(_0x1a0f88){if(_0x1a0f88){freeIsNotKey(_0x1a0f88,_0x565616[_0x91a5('0x48')],'id');for(var _0x4b2bc7=0x0,_0x5a19e7={},_0x421f6c={};_0x4b2bc7<_0x1a0f88[_0x91a5('0x43')];_0x4b2bc7+=0x1){_0x5a19e7=_0x1a0f88[_0x4b2bc7];if(_[_0x91a5('0x44')](_0x565616[_0x91a5('0x48')][_0x5a19e7['id']])){_0x565616[_0x91a5('0x48')][_0x5a19e7['id']]=new Template(_0x5a19e7);}else{_0x565616[_0x91a5('0x40')](_0x565616[_0x91a5('0x48')][_0x5a19e7['id']],_0x5a19e7);}}}return _0x565616[_0x91a5('0x48')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x49')]=function(){var _0x11aeb0=this;return function(_0x57c7e5){if(_0x57c7e5){freeIsNotKey(_0x57c7e5,_0x11aeb0[_0x91a5('0x1b')],'id');for(var _0x5a9fce=0x0,_0x2e6a0d={},_0x21bef2={};_0x5a9fce<_0x57c7e5[_0x91a5('0x43')];_0x5a9fce+=0x1){_0x2e6a0d=_0x57c7e5[_0x5a9fce];if(_[_0x91a5('0x44')](_0x11aeb0[_0x91a5('0x1b')][_0x2e6a0d['id']])){_0x11aeb0[_0x91a5('0x1b')][_0x2e6a0d['id']]=new ZendeskAccount(_0x2e6a0d);}else{_0x11aeb0['mergeFromDatabase'](_0x11aeb0[_0x91a5('0x1b')][_0x2e6a0d['id']],_0x2e6a0d);}}}return _0x11aeb0[_0x91a5('0x1b')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x4a')]=function(){var _0x273ab8=this;return function(_0x1cca79){if(_0x1cca79){freeIsNotKey(_0x1cca79,_0x273ab8[_0x91a5('0x1c')],'id');for(var _0xb1c7d6=0x0,_0x5f4447={},_0x2c4031={};_0xb1c7d6<_0x1cca79[_0x91a5('0x43')];_0xb1c7d6+=0x1){_0x5f4447=_0x1cca79[_0xb1c7d6];if(_[_0x91a5('0x44')](_0x273ab8[_0x91a5('0x1c')][_0x5f4447['id']])){_0x273ab8[_0x91a5('0x1c')][_0x5f4447['id']]=new SalesforceAccount(_0x5f4447);}else{_0x273ab8[_0x91a5('0x40')](_0x273ab8[_0x91a5('0x1c')][_0x5f4447['id']],_0x5f4447);}}}return _0x273ab8['salesforceAccounts'];};};Realtime['prototype'][_0x91a5('0x4b')]=function(){var _0x5983c5=this;return function(_0x10a847){if(_0x10a847){freeIsNotKey(_0x10a847,_0x5983c5[_0x91a5('0x1e')],'id');for(var _0x4e37db=0x0,_0x10bee9={},_0x529b01={};_0x4e37db<_0x10a847[_0x91a5('0x43')];_0x4e37db+=0x1){_0x10bee9=_0x10a847[_0x4e37db];if(_[_0x91a5('0x44')](_0x5983c5['freshdeskAccounts'][_0x10bee9['id']])){_0x5983c5['freshdeskAccounts'][_0x10bee9['id']]=new FreshdeskAccount(_0x10bee9);}else{_0x5983c5['mergeFromDatabase'](_0x5983c5['freshdeskAccounts'][_0x10bee9['id']],_0x10bee9);}}}return _0x5983c5[_0x91a5('0x1e')];};};Realtime[_0x91a5('0x3f')]['initZohoAccounts']=function(){var _0x8c84ec=this;return function(_0x47edc2){if(_0x47edc2){freeIsNotKey(_0x47edc2,_0x8c84ec['zohoAccounts'],'id');for(var _0x37de44=0x0,_0x2d7c96={},_0x430114={};_0x37de44<_0x47edc2['length'];_0x37de44+=0x1){_0x2d7c96=_0x47edc2[_0x37de44];if(_['isUndefined'](_0x8c84ec[_0x91a5('0x1f')][_0x2d7c96['id']])){_0x8c84ec[_0x91a5('0x1f')][_0x2d7c96['id']]=new ZohoAccount(_0x2d7c96);}else{_0x8c84ec[_0x91a5('0x40')](_0x8c84ec[_0x91a5('0x1f')][_0x2d7c96['id']],_0x2d7c96);}}}return _0x8c84ec[_0x91a5('0x1f')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x4c')]=function(){var _0xb585c5=this;return function(_0x3afc0b){if(_0x3afc0b){freeIsNotKey(_0x3afc0b,_0xb585c5['deskAccounts'],'id');for(var _0x30270b=0x0,_0x5c5f74={},_0x45fdd7={};_0x30270b<_0x3afc0b[_0x91a5('0x43')];_0x30270b+=0x1){_0x5c5f74=_0x3afc0b[_0x30270b];if(_[_0x91a5('0x44')](_0xb585c5['deskAccounts'][_0x5c5f74['id']])){_0xb585c5[_0x91a5('0x20')][_0x5c5f74['id']]=new DeskAccount(_0x5c5f74);}else{_0xb585c5['mergeFromDatabase'](_0xb585c5[_0x91a5('0x20')][_0x5c5f74['id']],_0x5c5f74);}}}return _0xb585c5[_0x91a5('0x20')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x4d')]=function(){var _0x2b243c=this;return function(_0x5d7068){if(_0x5d7068){freeIsNotKey(_0x5d7068,_0x2b243c[_0x91a5('0x1d')],'id');for(var _0x5201f8=0x0,_0x3e2e2b={},_0x298382={};_0x5201f8<_0x5d7068['length'];_0x5201f8+=0x1){_0x3e2e2b=_0x5d7068[_0x5201f8];if(_[_0x91a5('0x44')](_0x2b243c['sugarcrmAccounts'][_0x3e2e2b['id']])){_0x2b243c[_0x91a5('0x1d')][_0x3e2e2b['id']]=new SugarcrmAccount(_0x3e2e2b);}else{_0x2b243c['mergeFromDatabase'](_0x2b243c['sugarcrmAccounts'][_0x3e2e2b['id']],_0x3e2e2b);}}}return _0x2b243c['sugarcrmAccounts'];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x4e')]=function(){var _0x6fcb4=this;return function(_0x251c59){if(_0x251c59){freeIsNotKey(_0x251c59,_0x6fcb4['vtigerAccounts'],'id');for(var _0x37fed1=0x0,_0x1059b9={},_0x5c845b={};_0x37fed1<_0x251c59[_0x91a5('0x43')];_0x37fed1+=0x1){_0x1059b9=_0x251c59[_0x37fed1];if(_[_0x91a5('0x44')](_0x6fcb4[_0x91a5('0x21')][_0x1059b9['id']])){_0x6fcb4[_0x91a5('0x21')][_0x1059b9['id']]=new VtigerAccount(_0x1059b9);}else{_0x6fcb4[_0x91a5('0x40')](_0x6fcb4[_0x91a5('0x21')][_0x1059b9['id']],_0x1059b9);}}}return _0x6fcb4[_0x91a5('0x21')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x4f')]=function(){var _0x3ace44=this;return function(_0x10c3be){if(_0x10c3be){freeIsNotKey(_0x10c3be,_0x3ace44[_0x91a5('0x22')],'id');for(var _0x37fe3a=0x0,_0x5d03c9={},_0x450b79={};_0x37fe3a<_0x10c3be[_0x91a5('0x43')];_0x37fe3a+=0x1){_0x5d03c9=_0x10c3be[_0x37fe3a];if(_[_0x91a5('0x44')](_0x3ace44[_0x91a5('0x22')][_0x5d03c9['id']])){_0x3ace44['servicenowAccounts'][_0x5d03c9['id']]=new ServicenowAccount(_0x5d03c9);}else{_0x3ace44[_0x91a5('0x40')](_0x3ace44[_0x91a5('0x22')][_0x5d03c9['id']],_0x5d03c9);}}}return _0x3ace44[_0x91a5('0x22')];};};Realtime['prototype'][_0x91a5('0x50')]=function(){var _0x3a4630=this;return function(_0x773694){if(_0x773694){freeIsNotKey(_0x773694,_0x3a4630[_0x91a5('0x23')],'id');for(var _0x5db76b=0x0,_0x46f87e={},_0x10a0a1={};_0x5db76b<_0x773694[_0x91a5('0x43')];_0x5db76b+=0x1){_0x46f87e=_0x773694[_0x5db76b];if(_['isUndefined'](_0x3a4630[_0x91a5('0x23')][_0x46f87e['id']])){_0x3a4630['dynamics365Accounts'][_0x46f87e['id']]=new Dynamics365Account(_0x46f87e);}else{_0x3a4630[_0x91a5('0x40')](_0x3a4630[_0x91a5('0x23')][_0x46f87e['id']],_0x46f87e);}}}return _0x3a4630['dynamics365Accounts'];};};Realtime['prototype'][_0x91a5('0x51')]=function(){var _0xc5cdbc=this;return function(_0x2e0644){if(_0x2e0644){freeIsNotKey(_0x2e0644,_0xc5cdbc[_0x91a5('0x24')],'id');for(var _0x2bc417=0x0,_0x248f48={},_0x22a1e0={};_0x2bc417<_0x2e0644[_0x91a5('0x43')];_0x2bc417+=0x1){_0x248f48=_0x2e0644[_0x2bc417];if(_[_0x91a5('0x44')](_0xc5cdbc[_0x91a5('0x24')][_0x248f48['id']])){_0xc5cdbc[_0x91a5('0x24')][_0x248f48['id']]=new FreshsalesAccount(_0x248f48);}else{_0xc5cdbc[_0x91a5('0x40')](_0xc5cdbc['freshsalesAccounts'][_0x248f48['id']],_0x248f48);}}}return _0xc5cdbc[_0x91a5('0x24')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x52')]=function(){var _0x2f174=this;return function(_0x1b9830){for(var _0x3dc005=0x0;_0x3dc005<_0x1b9830['length'];_0x3dc005+=0x1){_[_0x91a5('0x53')](_0x2f174[_0x91a5('0x46')][_0x1b9830[_0x3dc005][_0x91a5('0x2a')]],_0x1b9830[_0x3dc005]);}return _0x2f174[_0x91a5('0x46')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x54')]=function(){var _0x1f617d=this;return function(_0x1d3f66){clearVoiceQueues(_0x1f617d[_0x91a5('0x46')]);if(_0x1d3f66){_0x1d3f66=_['groupBy'](_0x1d3f66,_0x91a5('0x55'));for(var _0x232011 in _0x1d3f66){if(_0x1d3f66[_0x91a5('0x27')](_0x232011)){var _0x42d876={};for(var _0x17d826=0x0;_0x17d826<_0x1d3f66[_0x232011]['length'];_0x17d826+=0x1){var _0x33d490=_0x1d3f66[_0x232011][_0x17d826]['queue'];if(_0x1f617d[_0x91a5('0x46')][_0x33d490]){if(_0x1d3f66[_0x232011][_0x17d826][_0x91a5('0x56')]){_0x1f617d[_0x91a5('0x46')][_0x33d490][_0x91a5('0x34')]+=0x1;}if(_0x1d3f66[_0x232011][_0x17d826][_0x91a5('0x57')]){_0x1f617d[_0x91a5('0x46')][_0x33d490][_0x91a5('0x58')]+=0x1;}_0x1f617d[_0x91a5('0x46')][_0x33d490]['sumHoldTime']+=moment(_0x1d3f66[_0x232011][_0x17d826][_0x91a5('0x59')])[_0x91a5('0x5a')](moment(_0x1d3f66[_0x232011][_0x17d826][_0x91a5('0x5b')]),_0x91a5('0x5c'))||0x0;if(_0x17d826===_0x1d3f66[_0x232011][_0x91a5('0x43')]-0x1){_0x1f617d[_0x91a5('0x46')][_0x33d490][_0x91a5('0x2e')]+=moment(_0x1d3f66[_0x232011][_0x17d826][_0x91a5('0x5d')]||_0x1d3f66[_0x232011][_0x17d826][_0x91a5('0x5e')]||_0x1d3f66[_0x232011][_0x17d826][_0x91a5('0x5f')])[_0x91a5('0x5a')](moment(_0x1d3f66[_0x232011][_0x17d826]['queuecallerjoinAt']),_0x91a5('0x5c'))||0x0;_0x1f617d[_0x91a5('0x46')][_0x33d490][_0x91a5('0x60')]+=0x1;if(_0x1d3f66[_0x232011][_0x17d826]['queuecallercomplete']){_0x1f617d[_0x91a5('0x46')][_0x33d490][_0x91a5('0x33')]+=0x1;_0x1f617d[_0x91a5('0x46')][_0x33d490]['sumBillable']+=moment(_0x1d3f66[_0x232011][_0x17d826][_0x91a5('0x5d')])[_0x91a5('0x5a')](moment(_0x1d3f66[_0x232011][_0x17d826][_0x91a5('0x59')]),_0x91a5('0x5c'))||0x0;}}else{_0x1f617d[_0x91a5('0x46')][_0x33d490][_0x91a5('0x2e')]+=_0x1f617d[_0x91a5('0x46')][_0x33d490][_0x91a5('0x2d')]||0x0;}}}}}}return _0x1f617d['voiceQueues'];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x61')]=function(){var _0x5aa527=this;return function(_0x4cebf9){clearVoiceCallReports(_0x5aa527[_0x91a5('0x18')]);if(_0x4cebf9){for(var _0x13e8a6=0x0;_0x13e8a6<_0x4cebf9[_0x91a5('0x43')];_0x13e8a6+=0x1){_0x5aa527[_0x91a5('0x18')][_0x91a5('0x60')]+=0x1;_0x5aa527[_0x91a5('0x18')][_0x91a5('0x2e')]+=_0x4cebf9[_0x13e8a6][_0x91a5('0x62')];if(_0x4cebf9[_0x13e8a6]['disposition']==='ANSWERED'){_0x5aa527[_0x91a5('0x18')][_0x91a5('0x33')]+=0x1;_0x5aa527[_0x91a5('0x18')][_0x91a5('0x2d')]+=_0x4cebf9[_0x13e8a6][_0x91a5('0x62')]-_0x4cebf9[_0x13e8a6][_0x91a5('0x63')]||0x0;_0x5aa527[_0x91a5('0x18')][_0x91a5('0x2f')]+=_0x4cebf9[_0x13e8a6][_0x91a5('0x63')];}}}return _0x5aa527[_0x91a5('0x18')];};};Realtime[_0x91a5('0x3f')]['initCampaigns']=function(){var _0x3d2cc4=this;return function(_0x219724){if(_0x219724){freeIsNotKey(_0x219724,_0x3d2cc4['campaigns'],'name');for(var _0x1accc0=0x0,_0x1f3e73={};_0x1accc0<_0x219724[_0x91a5('0x43')];_0x1accc0+=0x1){_0x1f3e73=_0x219724[_0x1accc0];if(_['isUndefined'](_0x3d2cc4[_0x91a5('0x17')][_0x1f3e73[_0x91a5('0x2a')]])){_0x3d2cc4['campaigns'][_0x1f3e73[_0x91a5('0x2a')]]=new Campaign(_0x1f3e73);}else{_0x3d2cc4[_0x91a5('0x40')](_0x3d2cc4[_0x91a5('0x17')][_0x1f3e73[_0x91a5('0x2a')]],_0x1f3e73);}}}return _0x3d2cc4[_0x91a5('0x17')];};};Realtime[_0x91a5('0x3f')]['initVoiceExtensions']=function(){var _0x225ff0=this;return function(_0x151896){if(_0x151896){freeIsNotKey(_0x151896,_0x225ff0['voiceExtensions'],'id');for(var _0x236148=0x0,_0x256ed4={};_0x236148<_0x151896[_0x91a5('0x43')];_0x236148+=0x1){_0x256ed4=_0x151896[_0x236148];if(_[_0x91a5('0x44')](_0x225ff0[_0x91a5('0x64')][_0x256ed4['id']])){_0x225ff0[_0x91a5('0x64')][_0x256ed4['id']]=new VoiceExtension(_0x256ed4);}else{_0x225ff0[_0x91a5('0x40')](_0x225ff0[_0x91a5('0x64')][_0x256ed4['id']],_0x256ed4);}}}return _0x225ff0['voiceExtensions'];};};Realtime['prototype'][_0x91a5('0x65')]=function(){var _0x2396e1=this;return function(_0x4b175e){clearCampaigns(_0x2396e1[_0x91a5('0x17')]);for(var _0x150ae0=0x0;_0x150ae0<_0x4b175e['length'];_0x150ae0+=0x1){_[_0x91a5('0x53')](_0x2396e1[_0x91a5('0x17')][_0x4b175e[_0x150ae0][_0x91a5('0x2a')]],_0x4b175e[_0x150ae0]);}return _0x2396e1[_0x91a5('0x17')];};};Realtime[_0x91a5('0x3f')][_0x91a5('0x66')]=function(){var _0x5f439a=this;return function(_0x17b1f7){if(_0x17b1f7){freeIsNotKey(_0x17b1f7,_0x5f439a[_0x91a5('0x25')],'id');for(var _0x5bb557=0x0,_0x11c3fe={},_0x148182={};_0x5bb557<_0x17b1f7[_0x91a5('0x43')];_0x5bb557+=0x1){_0x11c3fe=_0x17b1f7[_0x5bb557];if(_[_0x91a5('0x44')](_0x5f439a['faxAccounts'][_0x11c3fe['id']])){_0x5f439a[_0x91a5('0x25')][_0x11c3fe['id']]=new FaxAccount(_0x11c3fe);}else{_0x5f439a[_0x91a5('0x40')](_0x5f439a[_0x91a5('0x25')][_0x11c3fe['id']],_0x11c3fe);}}}return _0x5f439a[_0x91a5('0x25')];};};module['exports']=Realtime; \ No newline at end of file +var _0x731d=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','isNil','isUndefined','telephones','initTrunks','initVoiceQueues','voiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','trunks','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','interface','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x731d,0x107));var _0xd731=function(_0x3d1db4,_0x1b7929){_0x3d1db4=_0x3d1db4-0x0;var _0x3aea2c=_0x731d[_0x3d1db4];return _0x3aea2c;};'use strict';var BPromise=require(_0xd731('0x0'));var util=require(_0xd731('0x1'));var _=require(_0xd731('0x2'));var moment=require(_0xd731('0x3'));var Agent=require('../model/agent');var Telephone=require(_0xd731('0x4'));var Trunk=require(_0xd731('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xd731('0x6'));var Template=require(_0xd731('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xd731('0x8'));var ZendeskAccount=require(_0xd731('0x9'));var SalesforceAccount=require(_0xd731('0xa'));var FreshdeskAccount=require(_0xd731('0xb'));var SugarcrmAccount=require(_0xd731('0xc'));var ZohoAccount=require(_0xd731('0xd'));var DeskAccount=require(_0xd731('0xe'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xd731('0xf'));var Dynamics365Account=require(_0xd731('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this['telephones']={};this[_0xd731('0x11')]={};this['voiceQueues']={};this[_0xd731('0x12')]={};this[_0xd731('0x13')]={};this[_0xd731('0x14')]={};this[_0xd731('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xd731('0x16')]={};this[_0xd731('0x17')]={};this[_0xd731('0x18')]={};this[_0xd731('0x19')]={};this[_0xd731('0x1a')]={};this[_0xd731('0x1b')]={};this['salesforceAccounts']={};this[_0xd731('0x1c')]={};this[_0xd731('0x1d')]={};this[_0xd731('0x1e')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0xd731('0x1f')]={};this[_0xd731('0x20')]={};this[_0xd731('0x21')]={};this[_0xd731('0x22')]={};};function freeIsNotKey(_0x3702a2,_0x22768f,_0xfd2aae){var _0x8a767e=_[_0xd731('0x23')](_0x3702a2,function(_0x594e5f,_0x216b0b){return _0x594e5f[_0xfd2aae];});for(var _0x413de9 in _0x22768f){if(_0x22768f[_0xd731('0x24')](_0x413de9)){if(!_0x8a767e[_0x413de9]){delete _0x22768f[_0x413de9];}}}}function freeIsNotKeySip(_0xee4ea3,_0x4be295){var _0x8b03d6=_[_0xd731('0x23')](_0xee4ea3,function(_0x1ce0a4,_0x4c6213){return util[_0xd731('0x25')](_0xd731('0x26'),_0x1ce0a4['name']);});for(var _0x4df886 in _0x4be295){if(_0x4be295[_0xd731('0x24')](_0x4df886)){if(!_0x8b03d6[_0x4df886]){delete _0x4be295[_0x4df886];}}}}function freeIsNotKeyAgent(_0x4c02ad,_0x4cbd1b){var _0x82ddea=_[_0xd731('0x23')](_0x4c02ad,function(_0xe39dfe,_0x3d4b0d){var _0x558303=_['isNil'](_0xe39dfe[_0xd731('0x27')])?util['format']('SIP/%s',_0xe39dfe[_0xd731('0x28')]):_0xe39dfe['interface'];return _0x558303;});for(var _0x8b6a52 in _0x4cbd1b){if(_0x4cbd1b[_0xd731('0x24')](_0x8b6a52)){if(!_0x82ddea[_0x8b6a52]){delete _0x4cbd1b[_0x8b6a52];}}}}function clearVoiceCallReports(_0x2cdd4f){_0x2cdd4f[_0xd731('0x29')]=0x0;_0x2cdd4f[_0xd731('0x2a')]=0x0;_0x2cdd4f[_0xd731('0x2b')]=0x0;_0x2cdd4f[_0xd731('0x2c')]=0x0;_0x2cdd4f[_0xd731('0x2d')]=0x0;}function clearCampaigns(_0x5b9d77){if(!_[_0xd731('0x2e')](_0x5b9d77)){for(var _0x16fc6a in _0x5b9d77){if(_0x5b9d77['hasOwnProperty'](_0x16fc6a)){_0x5b9d77[_0x16fc6a][_0xd731('0x2f')]=0x0;_0x5b9d77[_0x16fc6a][_0xd731('0x30')]=0x0;}}}}function clearVoiceQueues(_0x3b42dd){if(!_[_0xd731('0x2e')](_0x3b42dd)){for(var _0x372c3f in _0x3b42dd){if(_0x3b42dd[_0xd731('0x24')](_0x372c3f)){_0x3b42dd[_0x372c3f]['total']=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x2a')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x31')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x32')]=0x0;_0x3b42dd[_0x372c3f]['sumHoldTime']=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x2c')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x2d')]=0x0;_0x3b42dd[_0x372c3f]['outboundAnswerAgiCallsDay']=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x33')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x34')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x35')]=0x0;_0x3b42dd[_0x372c3f]['outboundNoSuchCallsDay']=0x0;_0x3b42dd[_0x372c3f]['outboundUnknownCallsDay']=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x36')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x37')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x38')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x39')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x3a')]=0x0;_0x3b42dd[_0x372c3f]['outboundReCallsDay']=0x0;_0x3b42dd[_0x372c3f]['outboundAnswerAgiCallsDay']=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x3b')]=0x0;_0x3b42dd[_0x372c3f][_0xd731('0x3c')]=!![];}}}}Realtime[_0xd731('0x3d')][_0xd731('0x3e')]=function(_0x573b95,_0x58633d){for(var _0x576ef0 in _0x58633d){if(_0x573b95[_0xd731('0x24')](_0x576ef0)){_0x573b95[_0x576ef0]=_0x58633d[_0x576ef0];}}};Realtime[_0xd731('0x3d')][_0xd731('0x3f')]=function(){var _0x982a0f=this;return function(_0x38fc87){if(_0x38fc87){freeIsNotKeyAgent(_0x38fc87,_0x982a0f[_0xd731('0x40')]);for(var _0x19be6e=0x0,_0x59a28c={},_0x6e2b6b={};_0x19be6e<_0x38fc87[_0xd731('0x41')];_0x19be6e+=0x1){_0x59a28c=_0x38fc87[_0x19be6e];var _0x5638af=_[_0xd731('0x42')](_0x59a28c['interface'])?util['format'](_0xd731('0x26'),_0x59a28c[_0xd731('0x28')]):_0x59a28c[_0xd731('0x27')];if(_[_0xd731('0x43')](_0x982a0f[_0xd731('0x40')][_0x5638af])){_0x982a0f[_0xd731('0x40')][_0x5638af]=new Agent(_0x59a28c);}else{_0x982a0f[_0xd731('0x3e')](_0x982a0f['agents'][_0x5638af],_0x59a28c);}}}return _0x982a0f[_0xd731('0x40')];};};Realtime[_0xd731('0x3d')]['initTelephones']=function(){var _0x564e24=this;return function(_0x3d4f5f){if(_0x3d4f5f){freeIsNotKeySip(_0x3d4f5f,_0x564e24['telephones']);for(var _0x283573=0x0,_0x3317fc={},_0x93e595={};_0x283573<_0x3d4f5f[_0xd731('0x41')];_0x283573+=0x1){_0x3317fc=_0x3d4f5f[_0x283573];if(_[_0xd731('0x43')](_0x564e24['telephones'][util['format'](_0xd731('0x26'),_0x3317fc[_0xd731('0x28')])])){_0x564e24[_0xd731('0x44')][util[_0xd731('0x25')](_0xd731('0x26'),_0x3317fc[_0xd731('0x28')])]=new Telephone(_0x3317fc);}else{_0x564e24[_0xd731('0x3e')](_0x564e24['telephones'][util[_0xd731('0x25')]('SIP/%s',_0x3317fc[_0xd731('0x28')])],_0x3317fc);}}}return _0x564e24[_0xd731('0x44')];};};Realtime[_0xd731('0x3d')][_0xd731('0x45')]=function(){var _0x497efb=this;return function(_0x274325){if(_0x274325){freeIsNotKeySip(_0x274325,_0x497efb['trunks']);for(var _0x4a4d97=0x0,_0x356881={},_0x53e040={};_0x4a4d97<_0x274325['length'];_0x4a4d97+=0x1){_0x356881=_0x274325[_0x4a4d97];if(_[_0xd731('0x43')](_0x497efb[_0xd731('0x11')][util['format'](_0xd731('0x26'),_0x356881[_0xd731('0x28')])])){_0x497efb[_0xd731('0x11')][util[_0xd731('0x25')](_0xd731('0x26'),_0x356881[_0xd731('0x28')])]=new Trunk(_0x356881);}else{_0x497efb['mergeFromDatabase'](_0x497efb['trunks'][util['format'](_0xd731('0x26'),_0x356881[_0xd731('0x28')])],_0x356881);}}}return _0x497efb[_0xd731('0x11')];};};Realtime[_0xd731('0x3d')][_0xd731('0x46')]=function(){var _0x1a035e=this;return function(_0x26eeb2){if(_0x26eeb2){freeIsNotKey(_0x26eeb2,_0x1a035e[_0xd731('0x47')],'name');for(var _0x566bf4=0x0,_0x4061a8={},_0x17c978={};_0x566bf4<_0x26eeb2[_0xd731('0x41')];_0x566bf4+=0x1){_0x4061a8=_0x26eeb2[_0x566bf4];if(_['isUndefined'](_0x1a035e[_0xd731('0x47')][_0x4061a8[_0xd731('0x28')]])){_0x1a035e['voiceQueues'][_0x4061a8[_0xd731('0x28')]]=new VoiceQueue(_0x4061a8);}else{_0x1a035e['mergeFromDatabase'](_0x1a035e[_0xd731('0x47')][_0x4061a8[_0xd731('0x28')]],_0x4061a8);}}}return _0x1a035e[_0xd731('0x47')];};};Realtime['prototype']['initTriggers']=function(){var _0x1e50ca=this;return function(_0x3419d3){if(_0x3419d3){freeIsNotKey(_0x3419d3,_0x1e50ca['triggers'],'id');for(var _0x573271=0x0,_0x1e8f26={},_0x387ebf={};_0x573271<_0x3419d3[_0xd731('0x41')];_0x573271+=0x1){_0x1e8f26=_0x3419d3[_0x573271];if(_['isUndefined'](_0x1e50ca[_0xd731('0x12')][_0x1e8f26['id']])){_0x1e50ca[_0xd731('0x12')][_0x1e8f26['id']]=new Trigger(_0x1e8f26);}else{_0x1e50ca[_0xd731('0x3e')](_0x1e50ca[_0xd731('0x12')][_0x1e8f26['id']],_0x1e8f26);}}}return _0x1e50ca[_0xd731('0x12')];};};Realtime[_0xd731('0x3d')][_0xd731('0x48')]=function(){var _0x55bee0=this;return function(_0x2e29dd){if(_0x2e29dd){freeIsNotKey(_0x2e29dd,_0x55bee0['templates'],'id');for(var _0x50bda0=0x0,_0x1855f1={},_0x55ccf3={};_0x50bda0<_0x2e29dd['length'];_0x50bda0+=0x1){_0x1855f1=_0x2e29dd[_0x50bda0];if(_['isUndefined'](_0x55bee0[_0xd731('0x14')][_0x1855f1['id']])){_0x55bee0[_0xd731('0x14')][_0x1855f1['id']]=new Template(_0x1855f1);}else{_0x55bee0['mergeFromDatabase'](_0x55bee0['templates'][_0x1855f1['id']],_0x1855f1);}}}return _0x55bee0[_0xd731('0x14')];};};Realtime[_0xd731('0x3d')][_0xd731('0x49')]=function(){var _0x43a2b1=this;return function(_0x2aa194){if(_0x2aa194){freeIsNotKey(_0x2aa194,_0x43a2b1[_0xd731('0x1b')],'id');for(var _0x49d9b2=0x0,_0x1e55bc={},_0x5bc9a3={};_0x49d9b2<_0x2aa194['length'];_0x49d9b2+=0x1){_0x1e55bc=_0x2aa194[_0x49d9b2];if(_[_0xd731('0x43')](_0x43a2b1[_0xd731('0x1b')][_0x1e55bc['id']])){_0x43a2b1[_0xd731('0x1b')][_0x1e55bc['id']]=new ZendeskAccount(_0x1e55bc);}else{_0x43a2b1[_0xd731('0x3e')](_0x43a2b1[_0xd731('0x1b')][_0x1e55bc['id']],_0x1e55bc);}}}return _0x43a2b1[_0xd731('0x1b')];};};Realtime[_0xd731('0x3d')][_0xd731('0x4a')]=function(){var _0x3e1b8f=this;return function(_0x272549){if(_0x272549){freeIsNotKey(_0x272549,_0x3e1b8f[_0xd731('0x4b')],'id');for(var _0x40f4a0=0x0,_0x386a5d={},_0x24a118={};_0x40f4a0<_0x272549[_0xd731('0x41')];_0x40f4a0+=0x1){_0x386a5d=_0x272549[_0x40f4a0];if(_['isUndefined'](_0x3e1b8f[_0xd731('0x4b')][_0x386a5d['id']])){_0x3e1b8f[_0xd731('0x4b')][_0x386a5d['id']]=new SalesforceAccount(_0x386a5d);}else{_0x3e1b8f[_0xd731('0x3e')](_0x3e1b8f[_0xd731('0x4b')][_0x386a5d['id']],_0x386a5d);}}}return _0x3e1b8f[_0xd731('0x4b')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x17adb1=this;return function(_0x1fe667){if(_0x1fe667){freeIsNotKey(_0x1fe667,_0x17adb1[_0xd731('0x1d')],'id');for(var _0x3030ac=0x0,_0x33f950={},_0x54e3bb={};_0x3030ac<_0x1fe667[_0xd731('0x41')];_0x3030ac+=0x1){_0x33f950=_0x1fe667[_0x3030ac];if(_[_0xd731('0x43')](_0x17adb1[_0xd731('0x1d')][_0x33f950['id']])){_0x17adb1[_0xd731('0x1d')][_0x33f950['id']]=new FreshdeskAccount(_0x33f950);}else{_0x17adb1[_0xd731('0x3e')](_0x17adb1[_0xd731('0x1d')][_0x33f950['id']],_0x33f950);}}}return _0x17adb1[_0xd731('0x1d')];};};Realtime[_0xd731('0x3d')][_0xd731('0x4c')]=function(){var _0x3f78b9=this;return function(_0x304b63){if(_0x304b63){freeIsNotKey(_0x304b63,_0x3f78b9['zohoAccounts'],'id');for(var _0x4e6be0=0x0,_0x59dc52={},_0xb83914={};_0x4e6be0<_0x304b63['length'];_0x4e6be0+=0x1){_0x59dc52=_0x304b63[_0x4e6be0];if(_[_0xd731('0x43')](_0x3f78b9[_0xd731('0x1e')][_0x59dc52['id']])){_0x3f78b9[_0xd731('0x1e')][_0x59dc52['id']]=new ZohoAccount(_0x59dc52);}else{_0x3f78b9[_0xd731('0x3e')](_0x3f78b9[_0xd731('0x1e')][_0x59dc52['id']],_0x59dc52);}}}return _0x3f78b9[_0xd731('0x1e')];};};Realtime['prototype'][_0xd731('0x4d')]=function(){var _0x58de6c=this;return function(_0x3bd532){if(_0x3bd532){freeIsNotKey(_0x3bd532,_0x58de6c[_0xd731('0x4e')],'id');for(var _0x74c8ad=0x0,_0x1268d7={},_0x26e03b={};_0x74c8ad<_0x3bd532[_0xd731('0x41')];_0x74c8ad+=0x1){_0x1268d7=_0x3bd532[_0x74c8ad];if(_[_0xd731('0x43')](_0x58de6c[_0xd731('0x4e')][_0x1268d7['id']])){_0x58de6c[_0xd731('0x4e')][_0x1268d7['id']]=new DeskAccount(_0x1268d7);}else{_0x58de6c[_0xd731('0x3e')](_0x58de6c[_0xd731('0x4e')][_0x1268d7['id']],_0x1268d7);}}}return _0x58de6c[_0xd731('0x4e')];};};Realtime[_0xd731('0x3d')]['initSugarcrmAccounts']=function(){var _0x243281=this;return function(_0x292814){if(_0x292814){freeIsNotKey(_0x292814,_0x243281[_0xd731('0x1c')],'id');for(var _0x1187a4=0x0,_0x2cafd1={},_0x9b32f8={};_0x1187a4<_0x292814[_0xd731('0x41')];_0x1187a4+=0x1){_0x2cafd1=_0x292814[_0x1187a4];if(_[_0xd731('0x43')](_0x243281[_0xd731('0x1c')][_0x2cafd1['id']])){_0x243281[_0xd731('0x1c')][_0x2cafd1['id']]=new SugarcrmAccount(_0x2cafd1);}else{_0x243281[_0xd731('0x3e')](_0x243281[_0xd731('0x1c')][_0x2cafd1['id']],_0x2cafd1);}}}return _0x243281[_0xd731('0x1c')];};};Realtime['prototype'][_0xd731('0x4f')]=function(){var _0x3ebed8=this;return function(_0x38997b){if(_0x38997b){freeIsNotKey(_0x38997b,_0x3ebed8[_0xd731('0x50')],'id');for(var _0x4d4949=0x0,_0x5964e2={},_0x2d9f80={};_0x4d4949<_0x38997b[_0xd731('0x41')];_0x4d4949+=0x1){_0x5964e2=_0x38997b[_0x4d4949];if(_[_0xd731('0x43')](_0x3ebed8[_0xd731('0x50')][_0x5964e2['id']])){_0x3ebed8['vtigerAccounts'][_0x5964e2['id']]=new VtigerAccount(_0x5964e2);}else{_0x3ebed8[_0xd731('0x3e')](_0x3ebed8[_0xd731('0x50')][_0x5964e2['id']],_0x5964e2);}}}return _0x3ebed8[_0xd731('0x50')];};};Realtime[_0xd731('0x3d')][_0xd731('0x51')]=function(){var _0x3873f4=this;return function(_0xa815f2){if(_0xa815f2){freeIsNotKey(_0xa815f2,_0x3873f4[_0xd731('0x1f')],'id');for(var _0x272434=0x0,_0x5aa20c={},_0x6a4479={};_0x272434<_0xa815f2[_0xd731('0x41')];_0x272434+=0x1){_0x5aa20c=_0xa815f2[_0x272434];if(_[_0xd731('0x43')](_0x3873f4[_0xd731('0x1f')][_0x5aa20c['id']])){_0x3873f4[_0xd731('0x1f')][_0x5aa20c['id']]=new ServicenowAccount(_0x5aa20c);}else{_0x3873f4[_0xd731('0x3e')](_0x3873f4[_0xd731('0x1f')][_0x5aa20c['id']],_0x5aa20c);}}}return _0x3873f4[_0xd731('0x1f')];};};Realtime['prototype'][_0xd731('0x52')]=function(){var _0x1cd81b=this;return function(_0x12dd8e){if(_0x12dd8e){freeIsNotKey(_0x12dd8e,_0x1cd81b[_0xd731('0x20')],'id');for(var _0x3ee7e5=0x0,_0x165407={},_0x58f7f8={};_0x3ee7e5<_0x12dd8e[_0xd731('0x41')];_0x3ee7e5+=0x1){_0x165407=_0x12dd8e[_0x3ee7e5];if(_[_0xd731('0x43')](_0x1cd81b['dynamics365Accounts'][_0x165407['id']])){_0x1cd81b[_0xd731('0x20')][_0x165407['id']]=new Dynamics365Account(_0x165407);}else{_0x1cd81b['mergeFromDatabase'](_0x1cd81b[_0xd731('0x20')][_0x165407['id']],_0x165407);}}}return _0x1cd81b['dynamics365Accounts'];};};Realtime[_0xd731('0x3d')][_0xd731('0x53')]=function(){var _0xf7d164=this;return function(_0x1effea){if(_0x1effea){freeIsNotKey(_0x1effea,_0xf7d164['freshsalesAccounts'],'id');for(var _0x57617c=0x0,_0xe658ee={},_0x5ce9dc={};_0x57617c<_0x1effea['length'];_0x57617c+=0x1){_0xe658ee=_0x1effea[_0x57617c];if(_[_0xd731('0x43')](_0xf7d164['freshsalesAccounts'][_0xe658ee['id']])){_0xf7d164[_0xd731('0x21')][_0xe658ee['id']]=new FreshsalesAccount(_0xe658ee);}else{_0xf7d164['mergeFromDatabase'](_0xf7d164[_0xd731('0x21')][_0xe658ee['id']],_0xe658ee);}}}return _0xf7d164[_0xd731('0x21')];};};Realtime[_0xd731('0x3d')][_0xd731('0x54')]=function(){var _0x404e76=this;return function(_0x1a3889){for(var _0x4ccba8=0x0;_0x4ccba8<_0x1a3889[_0xd731('0x41')];_0x4ccba8+=0x1){_[_0xd731('0x55')](_0x404e76[_0xd731('0x47')][_0x1a3889[_0x4ccba8][_0xd731('0x28')]],_0x1a3889[_0x4ccba8]);}return _0x404e76[_0xd731('0x47')];};};Realtime[_0xd731('0x3d')]['initVoiceQueueReports']=function(){var _0x423036=this;return function(_0x375356){clearVoiceQueues(_0x423036[_0xd731('0x47')]);if(_0x375356){_0x375356=_[_0xd731('0x56')](_0x375356,'uniqueid');for(var _0x2da13e in _0x375356){if(_0x375356[_0xd731('0x24')](_0x2da13e)){var _0x1aaba8={};for(var _0x32d5c4=0x0;_0x32d5c4<_0x375356[_0x2da13e]['length'];_0x32d5c4+=0x1){var _0x4cd491=_0x375356[_0x2da13e][_0x32d5c4]['queue'];if(_0x423036[_0xd731('0x47')][_0x4cd491]){if(_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x57')]){_0x423036['voiceQueues'][_0x4cd491][_0xd731('0x31')]+=0x1;}if(_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x58')]){_0x423036[_0xd731('0x47')][_0x4cd491][_0xd731('0x32')]+=0x1;}_0x423036[_0xd731('0x47')][_0x4cd491][_0xd731('0x2b')]+=moment(_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x59')])[_0xd731('0x5a')](moment(_0x375356[_0x2da13e][_0x32d5c4]['queuecallerjoinAt']),_0xd731('0x5b'))||0x0;if(_0x32d5c4===_0x375356[_0x2da13e][_0xd731('0x41')]-0x1){_0x423036[_0xd731('0x47')][_0x4cd491][_0xd731('0x2c')]+=moment(_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x5c')]||_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x5d')]||_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x5e')])[_0xd731('0x5a')](moment(_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x5f')]),_0xd731('0x5b'))||0x0;_0x423036['voiceQueues'][_0x4cd491][_0xd731('0x29')]+=0x1;if(_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x60')]){_0x423036[_0xd731('0x47')][_0x4cd491]['answered']+=0x1;_0x423036['voiceQueues'][_0x4cd491]['sumBillable']+=moment(_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x5c')])[_0xd731('0x5a')](moment(_0x375356[_0x2da13e][_0x32d5c4][_0xd731('0x59')]),_0xd731('0x5b'))||0x0;}}else{_0x423036[_0xd731('0x47')][_0x4cd491][_0xd731('0x2c')]+=_0x423036[_0xd731('0x47')][_0x4cd491][_0xd731('0x2b')]||0x0;}}}}}}return _0x423036['voiceQueues'];};};Realtime[_0xd731('0x3d')]['initVoiceCallReports']=function(){var _0x9352aa=this;return function(_0x3e2a59){clearVoiceCallReports(_0x9352aa['outbound']);if(_0x3e2a59){for(var _0x4ed990=0x0;_0x4ed990<_0x3e2a59[_0xd731('0x41')];_0x4ed990+=0x1){_0x9352aa['outbound'][_0xd731('0x29')]+=0x1;_0x9352aa[_0xd731('0x15')][_0xd731('0x2c')]+=_0x3e2a59[_0x4ed990][_0xd731('0x61')];if(_0x3e2a59[_0x4ed990][_0xd731('0x62')]===_0xd731('0x63')){_0x9352aa[_0xd731('0x15')][_0xd731('0x2a')]+=0x1;_0x9352aa[_0xd731('0x15')][_0xd731('0x2b')]+=_0x3e2a59[_0x4ed990][_0xd731('0x61')]-_0x3e2a59[_0x4ed990][_0xd731('0x64')]||0x0;_0x9352aa['outbound'][_0xd731('0x2d')]+=_0x3e2a59[_0x4ed990][_0xd731('0x64')];}}}return _0x9352aa['outbound'];};};Realtime[_0xd731('0x3d')][_0xd731('0x65')]=function(){var _0x165e20=this;return function(_0x321968){if(_0x321968){freeIsNotKey(_0x321968,_0x165e20[_0xd731('0x13')],_0xd731('0x28'));for(var _0x3d64e6=0x0,_0x5bff23={};_0x3d64e6<_0x321968[_0xd731('0x41')];_0x3d64e6+=0x1){_0x5bff23=_0x321968[_0x3d64e6];if(_['isUndefined'](_0x165e20[_0xd731('0x13')][_0x5bff23[_0xd731('0x28')]])){_0x165e20[_0xd731('0x13')][_0x5bff23[_0xd731('0x28')]]=new Campaign(_0x5bff23);}else{_0x165e20[_0xd731('0x3e')](_0x165e20[_0xd731('0x13')][_0x5bff23['name']],_0x5bff23);}}}return _0x165e20[_0xd731('0x13')];};};Realtime[_0xd731('0x3d')][_0xd731('0x66')]=function(){var _0x55dc3f=this;return function(_0x401e05){if(_0x401e05){freeIsNotKey(_0x401e05,_0x55dc3f[_0xd731('0x16')],'id');for(var _0x5b0758=0x0,_0x5636b7={};_0x5b0758<_0x401e05[_0xd731('0x41')];_0x5b0758+=0x1){_0x5636b7=_0x401e05[_0x5b0758];if(_[_0xd731('0x43')](_0x55dc3f[_0xd731('0x16')][_0x5636b7['id']])){_0x55dc3f[_0xd731('0x16')][_0x5636b7['id']]=new VoiceExtension(_0x5636b7);}else{_0x55dc3f[_0xd731('0x3e')](_0x55dc3f[_0xd731('0x16')][_0x5636b7['id']],_0x5636b7);}}}return _0x55dc3f[_0xd731('0x16')];};};Realtime[_0xd731('0x3d')]['initCampaignHopperHistory']=function(){var _0x3141b3=this;return function(_0x2717a9){clearCampaigns(_0x3141b3[_0xd731('0x13')]);for(var _0x521f67=0x0;_0x521f67<_0x2717a9[_0xd731('0x41')];_0x521f67+=0x1){_[_0xd731('0x55')](_0x3141b3[_0xd731('0x13')][_0x2717a9[_0x521f67]['name']],_0x2717a9[_0x521f67]);}return _0x3141b3[_0xd731('0x13')];};};Realtime[_0xd731('0x3d')][_0xd731('0x67')]=function(){var _0x20fa58=this;return function(_0x5213f8){if(_0x5213f8){freeIsNotKey(_0x5213f8,_0x20fa58[_0xd731('0x22')],'id');for(var _0x27f916=0x0,_0x337325={},_0x6b733e={};_0x27f916<_0x5213f8['length'];_0x27f916+=0x1){_0x337325=_0x5213f8[_0x27f916];if(_[_0xd731('0x43')](_0x20fa58[_0xd731('0x22')][_0x337325['id']])){_0x20fa58[_0xd731('0x22')][_0x337325['id']]=new FaxAccount(_0x337325);}else{_0x20fa58[_0xd731('0x3e')](_0x20fa58[_0xd731('0x22')][_0x337325['id']],_0x337325);}}}return _0x20fa58[_0xd731('0x22')];};};module[_0xd731('0x68')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 1678a9a..4df2231 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 _0x7c7d=['voiceCallReport','bind','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','find','accountcode','name','isNil','interface','format','findAgent','assigned','SIP/%s','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','match','destination','exten','dialer','lastapplication','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','create','monitor','monitors','monitorFilename','createdAt','xcally-motion-preview','connectedlinename','connectedlinenum','xcally-motion-dialer','voiceAgentReport','isArray','Local','indexOf','phone','substring','lastIndexOf','exports','bluebird','moment','../../../config/logger','ami','../ami','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','agents','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport'];(function(_0x446829,_0x16a8d1){var _0x11b2b7=function(_0xdd5476){while(--_0xdd5476){_0x446829['push'](_0x446829['shift']());}};_0x11b2b7(++_0x16a8d1);}(_0x7c7d,0x163));var _0xd7c7=function(_0x3fa81c,_0x4d9cc5){_0x3fa81c=_0x3fa81c-0x0;var _0x558741=_0x7c7d[_0x3fa81c];return _0x558741;};'use strict';var BPromise=require(_0xd7c7('0x0'));var _=require('lodash');var moment=require(_0xd7c7('0x1'));var util=require('util');var config=require('../../../config/environment');var logger=require(_0xd7c7('0x2'))(_0xd7c7('0x3'));var ami=require(_0xd7c7('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xd7c7('0x5'));var RpcVoiceQueueReport=require(_0xd7c7('0x6'));var RpcVoiceRecording=require(_0xd7c7('0x7'));var RpcVoiceTransferReport=require(_0xd7c7('0x8'));var VoiceQueueReport=require(_0xd7c7('0x9'));var VoiceCallReport=require(_0xd7c7('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xd7c7('0xb'));var UserReport=require('./userReport');function Report(_0x2be0fb){this['realtime']=_0x2be0fb;this[_0xd7c7('0xc')]=_0x2be0fb[_0xd7c7('0xc')];this[_0xd7c7('0xd')]=_0x2be0fb[_0xd7c7('0xd')];}Report[_0xd7c7('0xe')][_0xd7c7('0xf')]=function(_0x3c7a87){var _0x1b0aa8=new VoiceQueueReport(this[_0xd7c7('0x10')]);var _0x5932b3=new VoiceAgentReport(this[_0xd7c7('0x10')]);var _0x38dad4=new VoiceDialReport(this[_0xd7c7('0x10')]);var _0x2104ed=new VoiceCallReport(this[_0xd7c7('0x10')]);var _0x9993=new UserReport(this['realtime']);if(config[_0xd7c7('0x11')]&&config['xdr']['disabled']){ami['on'](_0xd7c7('0x12'),this[_0xd7c7('0x13')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0xd7c7('0x14')]['bind'](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport'][_0xd7c7('0x15')](this));ami['on']('custom:voiceDialReport',this[_0xd7c7('0x16')][_0xd7c7('0x15')](this));ami['on'](_0xd7c7('0x17'),this[_0xd7c7('0x18')]['bind'](this));ami['on'](_0xd7c7('0x19'),this[_0xd7c7('0x1a')][_0xd7c7('0x15')](this));}};Report['prototype']['findAgent']=function(_0x34d389){var _0x712134=undefined;_0x712134=_[_0xd7c7('0x1b')](this[_0xd7c7('0xc')],function(_0x5def34){return _0x5def34[_0xd7c7('0x1c')]==_0x34d389||_0x5def34[_0xd7c7('0x1d')]==_0x34d389;});if(_[_0xd7c7('0x1e')](_0x712134)){var _0x1f8fc5=_[_0xd7c7('0x1b')](this[_0xd7c7('0xd')],function(_0x25d205){return _0x25d205['accountcode']==_0x34d389||_0x25d205['name']==_0x34d389;});if(_0x1f8fc5){_0x712134=_[_0xd7c7('0x1b')](this[_0xd7c7('0xc')],function(_0x141287){return _0x141287[_0xd7c7('0x1f')]==util[_0xd7c7('0x20')]('SIP/%s',_0x1f8fc5['name']);});}}return _0x712134;};Report['prototype'][_0xd7c7('0x13')]=function(_0x3c1a9c){for(var _0x53986f=0x0;_0x53986f<_0x3c1a9c['length'];_0x53986f+=0x1){var _0x395076=this[_0xd7c7('0x21')](_0x3c1a9c[_0x53986f]['connectedlinenum']);if(_0x395076){_0x3c1a9c[_0x53986f][_0xd7c7('0x1c')]=_0x395076[_0xd7c7('0x1c')];_0x3c1a9c[_0x53986f][_0xd7c7('0x22')]=!![];_0x3c1a9c[_0x53986f]['lastAssignedTo']=_0x395076[_0xd7c7('0x1d')];_0x3c1a9c[_0x53986f][_0xd7c7('0x1f')]=_[_0xd7c7('0x1e')](_0x395076[_0xd7c7('0x1f')])?util[_0xd7c7('0x20')](_0xd7c7('0x23'),_0x395076[_0xd7c7('0x1d')]):_0x395076[_0xd7c7('0x1f')];if(_0x3c1a9c[_0x53986f]['queuecallercomplete']){_0x3c1a9c[_0x53986f][_0xd7c7('0x24')]=moment()[_0xd7c7('0x20')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3c1a9c[_0x53986f][_0xd7c7('0x25')]){_0x3c1a9c[_0x53986f][_0xd7c7('0x26')]=moment()[_0xd7c7('0x20')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xd7c7('0x13')](_0x3c1a9c[_0x53986f]);}RpcVoiceQueueReport['create'](_0x3c1a9c[_0x53986f]);}};function extractCalleridNumber(_0x221f19){var _0x16c5b6=_0x221f19[_0xd7c7('0x27')](/<(.*?)>/);return _0x16c5b6?_0x16c5b6[0x1]:_0x221f19;}Report[_0xd7c7('0xe')]['voiceCallReport']=function(_0x38f1f0){_0x38f1f0[_0xd7c7('0x28')]=_0x38f1f0[_0xd7c7('0x28')]||_0x38f1f0[_0xd7c7('0x29')];if(_0x38f1f0['type']==_0xd7c7('0x2a')){_0x38f1f0[_0xd7c7('0x2b')]='queue';_0x38f1f0[_0xd7c7('0x2c')]=_0x38f1f0['queue'];if(_0x38f1f0[_0xd7c7('0x2d')]==_0xd7c7('0x2e')){_0x38f1f0[_0xd7c7('0x1c')]='';_0x38f1f0[_0xd7c7('0x28')]=extractCalleridNumber(_0x38f1f0[_0xd7c7('0x2f')]);}else if(_0x38f1f0[_0xd7c7('0x2d')]==_0xd7c7('0x30')){if(_0x38f1f0['destination']=='xcally-motion-preview'){_0x38f1f0[_0xd7c7('0x28')]=extractCalleridNumber(_0x38f1f0[_0xd7c7('0x31')]);_0x38f1f0[_0xd7c7('0x32')]=_0x38f1f0[_0xd7c7('0x33')];_0x38f1f0[_0xd7c7('0x34')]=[_0x38f1f0[_0xd7c7('0x35')],_0x38f1f0['channel']=_0x38f1f0[_0xd7c7('0x34')]][0x0];_0x38f1f0[_0xd7c7('0x2f')]=_0x38f1f0[_0xd7c7('0x31')];}else{_0x38f1f0[_0xd7c7('0x28')]=_0x38f1f0[_0xd7c7('0x32')];_0x38f1f0[_0xd7c7('0x32')]=_0x38f1f0[_0xd7c7('0x33')];if(_0x38f1f0[_0xd7c7('0x36')]==_0xd7c7('0x37')){_0x38f1f0[_0xd7c7('0x1c')]=_0x38f1f0['connectedlinenum'];}else{_0x38f1f0[_0xd7c7('0x1c')]='';}}}}else{_0x38f1f0['callerid']=util[_0xd7c7('0x20')](_0xd7c7('0x38'),_0x38f1f0[_0xd7c7('0x39')],_0x38f1f0['calleridnum']);}RpcVoiceCallReport[_0xd7c7('0x3a')](_0x38f1f0);if(_0x38f1f0[_0xd7c7('0x3b')]){for(var _0x2d1655=0x0;_0x2d1655<_0x38f1f0[_0xd7c7('0x3c')]['length'];_0x2d1655+=0x1){_0x38f1f0[_0xd7c7('0x3d')]=_0x38f1f0['monitors'][_0x2d1655]['filename'];_0x38f1f0[_0xd7c7('0x3e')]=_0x38f1f0[_0xd7c7('0x3c')][_0x2d1655][_0xd7c7('0x3e')];if(_0x38f1f0[_0xd7c7('0x29')]==_0xd7c7('0x3f')){_0x38f1f0[_0xd7c7('0x32')]=_0x38f1f0['connectedlinenum'];_0x38f1f0[_0xd7c7('0x39')]=_0x38f1f0[_0xd7c7('0x40')];_0x38f1f0[_0xd7c7('0x41')]=_0x38f1f0[_0xd7c7('0x1c')];_0x38f1f0[_0xd7c7('0x40')]=_0x38f1f0['membername'];_0x38f1f0[_0xd7c7('0x29')]=_0x38f1f0['originatecalleridnum'];}else if(_0x38f1f0[_0xd7c7('0x29')]==_0xd7c7('0x42')){_0x38f1f0['calleridnum']=_0x38f1f0[_0xd7c7('0x28')];_0x38f1f0[_0xd7c7('0x29')]=_0x38f1f0['originatecalleridnum'];}RpcVoiceRecording[_0xd7c7('0x3a')](_0x38f1f0);}}};Report['prototype'][_0xd7c7('0x43')]=function(_0xe8c71d){if(_[_0xd7c7('0x44')](_0xe8c71d)){_0xe8c71d['forEach'](function(_0x457077){RpcVoiceAgentReport[_0xd7c7('0x3a')](_0x457077);});}else{RpcVoiceAgentReport['create'](_0xe8c71d);}};Report[_0xd7c7('0xe')]['voiceDialReport']=function(_0x1cf1c1){RpcVoiceDialReport[_0xd7c7('0x3a')](_0x1cf1c1);var _0x529ffc=undefined;var _0x31b6ec=_0x1cf1c1[_0xd7c7('0x35')];if(_['startsWith'](_0x31b6ec,_0xd7c7('0x45'))){var _0x1f6752=_0x31b6ec['substring'](_0x31b6ec[_0xd7c7('0x46')]('/')+0x1,_0x31b6ec[_0xd7c7('0x46')]('@'));_0x529ffc=_[_0xd7c7('0x1b')](this[_0xd7c7('0xc')],function(_0x4e6620){return _0x4e6620['mobile']==_0x1f6752||_0x4e6620[_0xd7c7('0x47')]==_0x1f6752||_0x4e6620[_0xd7c7('0x1c')]==_0x1f6752;});}else{var _0x1f6752=_0x31b6ec[_0xd7c7('0x48')](_0x31b6ec['indexOf']('/')+0x1,_0x31b6ec[_0xd7c7('0x49')]('-'));_0x529ffc=this[_0xd7c7('0x21')](_0x1f6752);}if(_0x529ffc){_0x1cf1c1['interface']=_[_0xd7c7('0x1e')](_0x529ffc['interface'])?util[_0xd7c7('0x20')](_0xd7c7('0x23'),_0x529ffc['name']):_0x529ffc['interface'];_0x1cf1c1['membername']=_0x529ffc[_0xd7c7('0x1d')];_0x1cf1c1['accountcode']=_0x529ffc[_0xd7c7('0x1c')];RpcMemberReport[_0xd7c7('0x16')](_0x1cf1c1);}};Report[_0xd7c7('0xe')][_0xd7c7('0x18')]=function(_0x4f6892){RpcVoiceTransferReport[_0xd7c7('0x18')](_0x4f6892);};Report[_0xd7c7('0xe')][_0xd7c7('0x1a')]=function(_0x4f9948){RpcVoiceTransferReport[_0xd7c7('0x1a')](_0x4f9948);};module[_0xd7c7('0x4a')]=Report; \ No newline at end of file +var _0x97ec=['callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','calleridname','monitor','monitorFilename','monitors','filename','createdAt','exten','connectedlinename','startsWith','Local','substring','indexOf','phone','lastIndexOf','membername','exports','bluebird','moment','util','../../../config/environment','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','destination','type','lastapplication','queue','lastdata','context','from-voip-provider','accountcode'];(function(_0x20a1cd,_0x4d076e){var _0x23052d=function(_0x52b55){while(--_0x52b55){_0x20a1cd['push'](_0x20a1cd['shift']());}};_0x23052d(++_0x4d076e);}(_0x97ec,0xb4));var _0xc97e=function(_0x44dd35,_0x7d5c99){_0x44dd35=_0x44dd35-0x0;var _0x4d8288=_0x97ec[_0x44dd35];return _0x4d8288;};'use strict';var BPromise=require(_0xc97e('0x0'));var _=require('lodash');var moment=require(_0xc97e('0x1'));var util=require(_0xc97e('0x2'));var config=require(_0xc97e('0x3'));var logger=require('../../../config/logger')(_0xc97e('0x4'));var ami=require(_0xc97e('0x5'));var RpcVoiceAgentReport=require(_0xc97e('0x6'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xc97e('0x7'));var RpcMemberReport=require(_0xc97e('0x8'));var RpcVoiceQueueReport=require(_0xc97e('0x9'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xc97e('0xa'));var VoiceAgentReport=require(_0xc97e('0xb'));var VoiceDialReport=require(_0xc97e('0xc'));var UserReport=require(_0xc97e('0xd'));function Report(_0x3a34eb){this[_0xc97e('0xe')]=_0x3a34eb;this['agents']=_0x3a34eb[_0xc97e('0xf')];this[_0xc97e('0x10')]=_0x3a34eb[_0xc97e('0x10')];}Report[_0xc97e('0x11')][_0xc97e('0x12')]=function(_0x53348a){var _0x5d3189=new VoiceQueueReport(this[_0xc97e('0xe')]);var _0x356466=new VoiceAgentReport(this[_0xc97e('0xe')]);var _0x405523=new VoiceDialReport(this[_0xc97e('0xe')]);var _0x2c8e7f=new VoiceCallReport(this['realtime']);var _0x55cd9c=new UserReport(this[_0xc97e('0xe')]);if(config[_0xc97e('0x13')]&&config[_0xc97e('0x13')][_0xc97e('0x14')]){ami['on'](_0xc97e('0x15'),this[_0xc97e('0x16')][_0xc97e('0x17')](this));ami['on'](_0xc97e('0x18'),this[_0xc97e('0x19')][_0xc97e('0x17')](this));ami['on'](_0xc97e('0x1a'),this['voiceAgentReport'][_0xc97e('0x17')](this));ami['on'](_0xc97e('0x1b'),this['voiceDialReport'][_0xc97e('0x17')](this));ami['on'](_0xc97e('0x1c'),this[_0xc97e('0x1d')]['bind'](this));ami['on']('attendedtransfer',this[_0xc97e('0x1e')][_0xc97e('0x17')](this));}};Report['prototype'][_0xc97e('0x1f')]=function(_0x47eaf2){var _0x4561f4=undefined;_0x4561f4=_[_0xc97e('0x20')](this[_0xc97e('0xf')],function(_0x18a7ad){return _0x18a7ad['accountcode']==_0x47eaf2||_0x18a7ad[_0xc97e('0x21')]==_0x47eaf2;});if(_[_0xc97e('0x22')](_0x4561f4)){var _0x1b0bdd=_[_0xc97e('0x20')](this[_0xc97e('0x10')],function(_0x5037f5){return _0x5037f5['accountcode']==_0x47eaf2||_0x5037f5['name']==_0x47eaf2;});if(_0x1b0bdd){_0x4561f4=_[_0xc97e('0x20')](this[_0xc97e('0xf')],function(_0x2eeed7){return _0x2eeed7[_0xc97e('0x23')]==util[_0xc97e('0x24')](_0xc97e('0x25'),_0x1b0bdd['name']);});}}return _0x4561f4;};Report['prototype']['voiceQueueReport']=function(_0x5a74ab){for(var _0x445ebe=0x0;_0x445ebe<_0x5a74ab[_0xc97e('0x26')];_0x445ebe+=0x1){var _0x1f7989=this[_0xc97e('0x1f')](_0x5a74ab[_0x445ebe][_0xc97e('0x27')]);if(_0x1f7989){_0x5a74ab[_0x445ebe]['accountcode']=_0x1f7989['accountcode'];_0x5a74ab[_0x445ebe][_0xc97e('0x28')]=!![];_0x5a74ab[_0x445ebe][_0xc97e('0x29')]=_0x1f7989['name'];_0x5a74ab[_0x445ebe][_0xc97e('0x23')]=_['isNil'](_0x1f7989[_0xc97e('0x23')])?util[_0xc97e('0x24')](_0xc97e('0x25'),_0x1f7989[_0xc97e('0x21')]):_0x1f7989[_0xc97e('0x23')];if(_0x5a74ab[_0x445ebe][_0xc97e('0x2a')]){_0x5a74ab[_0x445ebe]['queuecallercompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5a74ab[_0x445ebe]['queuecallerexit']){_0x5a74ab[_0x445ebe][_0xc97e('0x2b')]=moment()[_0xc97e('0x24')](_0xc97e('0x2c'));}RpcMemberReport[_0xc97e('0x16')](_0x5a74ab[_0x445ebe]);}RpcVoiceQueueReport[_0xc97e('0x2d')](_0x5a74ab[_0x445ebe]);}};function extractCalleridNumber(_0x303c00){var _0x3417ba=_0x303c00['match'](/<(.*?)>/);return _0x3417ba?_0x3417ba[0x1]:_0x303c00;}Report[_0xc97e('0x11')][_0xc97e('0x19')]=function(_0x3f20a3){_0x3f20a3[_0xc97e('0x2e')]=_0x3f20a3[_0xc97e('0x2e')]||_0x3f20a3['exten'];if(_0x3f20a3[_0xc97e('0x2f')]=='dialer'){_0x3f20a3[_0xc97e('0x30')]=_0xc97e('0x31');_0x3f20a3[_0xc97e('0x32')]=_0x3f20a3[_0xc97e('0x31')];if(_0x3f20a3[_0xc97e('0x33')]==_0xc97e('0x34')){_0x3f20a3[_0xc97e('0x35')]='';_0x3f20a3[_0xc97e('0x2e')]=extractCalleridNumber(_0x3f20a3[_0xc97e('0x36')]);}else if(_0x3f20a3[_0xc97e('0x33')]==_0xc97e('0x37')){if(_0x3f20a3[_0xc97e('0x2e')]==_0xc97e('0x38')){_0x3f20a3['destination']=extractCalleridNumber(_0x3f20a3[_0xc97e('0x39')]);_0x3f20a3[_0xc97e('0x3a')]=_0x3f20a3['originatecalleridnum'];_0x3f20a3[_0xc97e('0x3b')]=[_0x3f20a3[_0xc97e('0x3c')],_0x3f20a3[_0xc97e('0x3c')]=_0x3f20a3[_0xc97e('0x3b')]][0x0];_0x3f20a3['callerid']=_0x3f20a3[_0xc97e('0x39')];}else{_0x3f20a3[_0xc97e('0x2e')]=_0x3f20a3[_0xc97e('0x3a')];_0x3f20a3[_0xc97e('0x3a')]=_0x3f20a3[_0xc97e('0x3d')];if(_0x3f20a3['disposition']=='ANSWERED'){_0x3f20a3[_0xc97e('0x35')]=_0x3f20a3[_0xc97e('0x27')];}else{_0x3f20a3[_0xc97e('0x35')]='';}}}}else{_0x3f20a3[_0xc97e('0x36')]=util[_0xc97e('0x24')]('\x22%s\x22\x20<%s>',_0x3f20a3[_0xc97e('0x3e')],_0x3f20a3[_0xc97e('0x3a')]);}RpcVoiceCallReport['create'](_0x3f20a3);if(_0x3f20a3[_0xc97e('0x3f')]){for(var _0xb8083=0x0;_0xb8083<_0x3f20a3['monitors']['length'];_0xb8083+=0x1){_0x3f20a3[_0xc97e('0x40')]=_0x3f20a3[_0xc97e('0x41')][_0xb8083][_0xc97e('0x42')];_0x3f20a3[_0xc97e('0x43')]=_0x3f20a3[_0xc97e('0x41')][_0xb8083][_0xc97e('0x43')];if(_0x3f20a3[_0xc97e('0x44')]==_0xc97e('0x38')){_0x3f20a3['calleridnum']=_0x3f20a3['connectedlinenum'];_0x3f20a3[_0xc97e('0x3e')]=_0x3f20a3[_0xc97e('0x45')];_0x3f20a3[_0xc97e('0x27')]=_0x3f20a3[_0xc97e('0x35')];_0x3f20a3[_0xc97e('0x45')]=_0x3f20a3['membername'];_0x3f20a3[_0xc97e('0x44')]=_0x3f20a3[_0xc97e('0x3d')];}else if(_0x3f20a3[_0xc97e('0x44')]=='xcally-motion-dialer'){_0x3f20a3['calleridnum']=_0x3f20a3['destination'];_0x3f20a3[_0xc97e('0x44')]=_0x3f20a3['originatecalleridnum'];}RpcVoiceRecording['create'](_0x3f20a3);}}};Report['prototype']['voiceAgentReport']=function(_0x3a0b06){if(_['isArray'](_0x3a0b06)){_0x3a0b06['forEach'](function(_0x1db3a5){RpcVoiceAgentReport[_0xc97e('0x2d')](_0x1db3a5);});}else{RpcVoiceAgentReport[_0xc97e('0x2d')](_0x3a0b06);}};Report[_0xc97e('0x11')]['voiceDialReport']=function(_0x19ca3b){RpcVoiceDialReport['create'](_0x19ca3b);var _0x11417a=undefined;var _0x3f15cc=_0x19ca3b[_0xc97e('0x3c')];if(_[_0xc97e('0x46')](_0x3f15cc,_0xc97e('0x47'))){var _0x16d3c6=_0x3f15cc[_0xc97e('0x48')](_0x3f15cc['indexOf']('/')+0x1,_0x3f15cc[_0xc97e('0x49')]('@'));_0x11417a=_[_0xc97e('0x20')](this['agents'],function(_0x47e1e5){return _0x47e1e5['mobile']==_0x16d3c6||_0x47e1e5[_0xc97e('0x4a')]==_0x16d3c6||_0x47e1e5['accountcode']==_0x16d3c6;});}else{var _0x16d3c6=_0x3f15cc['substring'](_0x3f15cc[_0xc97e('0x49')]('/')+0x1,_0x3f15cc[_0xc97e('0x4b')]('-'));_0x11417a=this[_0xc97e('0x1f')](_0x16d3c6);}if(_0x11417a){_0x19ca3b[_0xc97e('0x23')]=_[_0xc97e('0x22')](_0x11417a[_0xc97e('0x23')])?util[_0xc97e('0x24')](_0xc97e('0x25'),_0x11417a['name']):_0x11417a['interface'];_0x19ca3b[_0xc97e('0x4c')]=_0x11417a[_0xc97e('0x21')];_0x19ca3b[_0xc97e('0x35')]=_0x11417a[_0xc97e('0x35')];RpcMemberReport['voiceDialReport'](_0x19ca3b);}};Report[_0xc97e('0x11')][_0xc97e('0x1d')]=function(_0x1edcfd){RpcVoiceTransferReport[_0xc97e('0x1d')](_0x1edcfd);};Report[_0xc97e('0x11')]['attendedTransfer']=function(_0xf11deb){RpcVoiceTransferReport[_0xc97e('0x1e')](_0xf11deb);};module[_0xc97e('0x4d')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index f8b6376..110b28a 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 _0xe3f1=['ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','actionSipShowRegistry','then','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','loopSyncRealTimeShow','resolve','isUndefined','emit','isNotNull','find','username','stateRegistry','state','merge','omit','event','format','trunk:%s','[syncRegistry][UserReport]','device','local','toLowerCase','stateTime','telephone:%s','telephone:save','name','startsWith','Queue','Local','indexOf','mobile','phone','accountcode','updateStatusRealtime','[syncDeviceState][UserReport]','syncPeerStatus','peer','registered','status','address','trunk:save','[syncPeerStatus][UserReport]','exports','lodash','moment','util'];(function(_0x3ed0bf,_0x5bb8a9){var _0x1e618e=function(_0x4230b6){while(--_0x4230b6){_0x3ed0bf['push'](_0x3ed0bf['shift']());}};_0x1e618e(++_0x5bb8a9);}(_0xe3f1,0x15b));var _0x1e3f=function(_0x41b2b7,_0x5a0fac){_0x41b2b7=_0x41b2b7-0x0;var _0x4db3f9=_0xe3f1[_0x41b2b7];return _0x4db3f9;};'use strict';var _=require(_0x1e3f('0x0'));var moment=require(_0x1e3f('0x1'));var BPromise=require('bluebird');var util=require(_0x1e3f('0x2'));var Redis=require(_0x1e3f('0x3'));var config=require(_0x1e3f('0x4'));var logger=require(_0x1e3f('0x5'))(_0x1e3f('0x6'));var ami=require(_0x1e3f('0x7'));config[_0x1e3f('0x8')]=_[_0x1e3f('0x9')](config[_0x1e3f('0x8')],{'host':_0x1e3f('0xa'),'port':0x18eb});var io=require(_0x1e3f('0xb'))(new Redis(config[_0x1e3f('0x8')]));function UserReport(_0x347bf4){this[_0x1e3f('0xc')]=_0x347bf4[_0x1e3f('0xc')];this[_0x1e3f('0xd')]=_0x347bf4[_0x1e3f('0xd')];this[_0x1e3f('0xe')]=_0x347bf4[_0x1e3f('0xe')];ami['on'](_0x1e3f('0xf'),this[_0x1e3f('0x10')]['bind'](this));ami['on'](_0x1e3f('0x11'),this[_0x1e3f('0x10')][_0x1e3f('0x12')](this));ami['on'](_0x1e3f('0x13'),this[_0x1e3f('0x14')][_0x1e3f('0x12')](this));ami['on'](_0x1e3f('0x15'),this['syncPeerStatus'][_0x1e3f('0x12')](this));this['loopSyncRealTimeShow']();return BPromise['resolve']()['then'](ami[_0x1e3f('0x16')]())[_0x1e3f('0x17')](ami[_0x1e3f('0x18')]())[_0x1e3f('0x17')](ami[_0x1e3f('0x19')]())[_0x1e3f('0x1a')](loggerCatch(_0x1e3f('0x1b')));}function loggerCatch(_0x155d00){return function(_0x29e269){logger[_0x1e3f('0x1c')](_0x155d00,util[_0x1e3f('0x1d')](_0x29e269,{'showHidden':![],'depth':null}));};}UserReport[_0x1e3f('0x1e')][_0x1e3f('0x1f')]=function(){setInterval(function(){BPromise[_0x1e3f('0x20')]()[_0x1e3f('0x17')](ami[_0x1e3f('0x16')]())['then'](ami[_0x1e3f('0x18')]())[_0x1e3f('0x17')](ami[_0x1e3f('0x19')]())[_0x1e3f('0x1a')](loggerCatch(_0x1e3f('0x1b')));},0x32c8);};UserReport[_0x1e3f('0x1e')]['isNotNull']=function(_0x1f1530){return _0x1f1530!==null&&!_[_0x1e3f('0x21')](_0x1f1530);};UserReport[_0x1e3f('0x1e')][_0x1e3f('0x22')]=function(_0x39eb63,_0x57fadf,_0x5ace5e){io['to'](_0x39eb63)[_0x1e3f('0x22')](_0x57fadf,_0x5ace5e);};UserReport[_0x1e3f('0x1e')][_0x1e3f('0x10')]=function(_0x33fa2f){try{if(this[_0x1e3f('0x23')](_0x33fa2f)){var _0x37f289=_[_0x1e3f('0x24')](this['trunks'],{'registry':_0x33fa2f[_0x1e3f('0x25')]});if(_0x37f289){_0x33fa2f[_0x1e3f('0x26')]=_0x33fa2f[_0x1e3f('0x27')];_[_0x1e3f('0x28')](_0x37f289,_[_0x1e3f('0x29')](_0x33fa2f,[_0x1e3f('0x2a'),'actionid','username',_0x1e3f('0x27')]));this[_0x1e3f('0x22')](util[_0x1e3f('0x2b')](_0x1e3f('0x2c'),_0x37f289['name']),'trunk:save',_0x37f289);}}}catch(_0x522f01){logger[_0x1e3f('0x1c')](_0x1e3f('0x2d'),util['inspect'](_0x522f01,{'showHidden':![],'depth':null}));}};UserReport[_0x1e3f('0x1e')][_0x1e3f('0x14')]=function(_0x20078c){try{if(this[_0x1e3f('0x23')](_0x20078c)){if(this[_0x1e3f('0xd')][_0x20078c['device']]){if(!this[_0x1e3f('0xd')][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x2f')]||_0x20078c[_0x1e3f('0x27')][_0x1e3f('0x30')]()=='inuse'){this[_0x1e3f('0xd')][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x2f')]=![];if(this[_0x1e3f('0xd')][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x27')]!==_0x20078c[_0x1e3f('0x27')][_0x1e3f('0x30')]()){this['agents'][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x31')]=_['toNumber'](moment()[_0x1e3f('0x2b')]('x'));}this['agents'][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x27')]=_0x20078c[_0x1e3f('0x27')]['toLowerCase']();this[_0x1e3f('0xd')][_0x20078c[_0x1e3f('0x2e')]]['updateStatusRealtime'](_0x20078c);}}else if(this[_0x1e3f('0xe')][_0x20078c[_0x1e3f('0x2e')]]){if(this[_0x1e3f('0xe')][_0x20078c['device']][_0x1e3f('0x27')]!==_0x20078c['state'][_0x1e3f('0x30')]()){this[_0x1e3f('0xe')][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x31')]=_['toNumber'](moment()['format']('x'));}this[_0x1e3f('0xe')][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x27')]=_0x20078c['state'][_0x1e3f('0x30')]();this['emit'](util[_0x1e3f('0x2b')](_0x1e3f('0x32'),this[_0x1e3f('0xe')][_0x20078c['device']]['name']),_0x1e3f('0x33'),this['telephones'][_0x20078c[_0x1e3f('0x2e')]]);}else if(this[_0x1e3f('0xc')][_0x20078c[_0x1e3f('0x2e')]]){if(this[_0x1e3f('0xc')][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x27')]!==_0x20078c[_0x1e3f('0x27')][_0x1e3f('0x30')]()){this[_0x1e3f('0xc')][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x31')]=_['toNumber'](moment()[_0x1e3f('0x2b')]('x'));}this['trunks'][_0x20078c['device']][_0x1e3f('0x27')]=_0x20078c[_0x1e3f('0x27')][_0x1e3f('0x30')]();this[_0x1e3f('0x22')](util[_0x1e3f('0x2b')](_0x1e3f('0x2c'),this[_0x1e3f('0xc')][_0x20078c[_0x1e3f('0x2e')]][_0x1e3f('0x34')]),'trunk:save',this[_0x1e3f('0xc')][_0x20078c['device']]);}else if(_[_0x1e3f('0x35')](_0x20078c[_0x1e3f('0x2e')],_0x1e3f('0x36'))){}else if(_[_0x1e3f('0x35')](_0x20078c[_0x1e3f('0x2e')],_0x1e3f('0x37'))){var _0x14288d=_0x20078c['device'];var _0x310ad8=_0x14288d['substring'](_0x14288d[_0x1e3f('0x38')]('/')+0x1,_0x14288d[_0x1e3f('0x38')]('@'));var _0xe07fcf=_[_0x1e3f('0x24')](this[_0x1e3f('0xd')],function(_0x33ff74){return _0x33ff74[_0x1e3f('0x39')]==_0x310ad8||_0x33ff74[_0x1e3f('0x3a')]==_0x310ad8||_0x33ff74[_0x1e3f('0x3b')]==_0x310ad8;});if(_0xe07fcf){if(_0xe07fcf[_0x1e3f('0x27')]!==_0x20078c[_0x1e3f('0x27')][_0x1e3f('0x30')]()){_0xe07fcf[_0x1e3f('0x31')]=_['toNumber'](moment()[_0x1e3f('0x2b')]('x'));}_0xe07fcf[_0x1e3f('0x27')]=_0x20078c['state'][_0x1e3f('0x30')]();_0xe07fcf[_0x1e3f('0x2f')]=!![];_0xe07fcf[_0x1e3f('0x3c')](_0x20078c);}}else{}}}catch(_0x1ed4ec){logger['error'](_0x1e3f('0x3d'),util[_0x1e3f('0x1d')](_0x1ed4ec,{'showHidden':![],'depth':null}));}};UserReport[_0x1e3f('0x1e')][_0x1e3f('0x3e')]=function(_0x208e56){try{if(this['isNotNull'](_0x208e56)&&this[_0x1e3f('0x23')](_0x208e56[_0x1e3f('0x15')])){if(this['agents'][_0x208e56[_0x1e3f('0x3f')]]){if(!this[_0x1e3f('0xd')][_0x208e56['peer']]['local']||_0x208e56['peerstatus'][_0x1e3f('0x30')]()==_0x1e3f('0x40')){this[_0x1e3f('0xd')][_0x208e56[_0x1e3f('0x3f')]][_0x1e3f('0x2f')]=![];this[_0x1e3f('0xd')][_0x208e56[_0x1e3f('0x3f')]][_0x1e3f('0x41')]=_0x208e56['peerstatus'][_0x1e3f('0x30')]();this[_0x1e3f('0xd')][_0x208e56[_0x1e3f('0x3f')]]['address']=_0x208e56['address'];this[_0x1e3f('0xd')][_0x208e56[_0x1e3f('0x3f')]][_0x1e3f('0x3c')](_0x208e56);}}else if(this[_0x1e3f('0xe')][_0x208e56[_0x1e3f('0x3f')]]){this[_0x1e3f('0xe')][_0x208e56[_0x1e3f('0x3f')]][_0x1e3f('0x41')]=_0x208e56[_0x1e3f('0x15')]['toLowerCase']();this['telephones'][_0x208e56[_0x1e3f('0x3f')]][_0x1e3f('0x42')]=_0x208e56[_0x1e3f('0x42')];this[_0x1e3f('0x22')](util[_0x1e3f('0x2b')](_0x1e3f('0x32'),this[_0x1e3f('0xe')][_0x208e56[_0x1e3f('0x3f')]][_0x1e3f('0x34')]),'telephone:save',this[_0x1e3f('0xe')][_0x208e56[_0x1e3f('0x3f')]]);}else if(this[_0x1e3f('0xc')][_0x208e56[_0x1e3f('0x3f')]]){this[_0x1e3f('0xc')][_0x208e56['peer']]['status']=_0x208e56[_0x1e3f('0x15')][_0x1e3f('0x30')]();this[_0x1e3f('0xc')][_0x208e56['peer']][_0x1e3f('0x42')]=_0x208e56[_0x1e3f('0x42')];this['emit'](util[_0x1e3f('0x2b')](_0x1e3f('0x2c'),this[_0x1e3f('0xc')][_0x208e56[_0x1e3f('0x3f')]][_0x1e3f('0x34')]),_0x1e3f('0x43'),this['trunks'][_0x208e56['peer']]);}else{}}}catch(_0xe8168e){logger[_0x1e3f('0x1c')](_0x1e3f('0x44'),util['inspect'](_0xe8168e,{'showHidden':![],'depth':null}));}};module[_0x1e3f('0x45')]=UserReport; \ No newline at end of file +var _0x966a=['syncPeerStatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','inspect','prototype','resolve','isNotNull','isUndefined','emit','stateRegistry','merge','actionid','username','trunk:%s','name','trunk:save','error','agents','device','local','state','toLowerCase','inuse','stateTime','toNumber','format','telephone:save','startsWith','Queue','Local','indexOf','mobile','[syncDeviceState][UserReport]','peer','registered','status','address','updateStatusRealtime','telephone:%s','exports','lodash','util','ioredis','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','telephones','registryentry','syncRegistry','bind','syncDeviceState','peerstatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x966a,0x19b));var _0xa966=function(_0x48dbc4,_0x595805){_0x48dbc4=_0x48dbc4-0x0;var _0x3ed58d=_0x966a[_0x48dbc4];return _0x3ed58d;};'use strict';var _=require(_0xa966('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xa966('0x1'));var Redis=require(_0xa966('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa966('0x3'));var ami=require(_0xa966('0x4'));config[_0xa966('0x5')]=_[_0xa966('0x6')](config['redis'],{'host':_0xa966('0x7'),'port':0x18eb});var io=require(_0xa966('0x8'))(new Redis(config[_0xa966('0x5')]));function UserReport(_0xbcaf62){this[_0xa966('0x9')]=_0xbcaf62[_0xa966('0x9')];this['agents']=_0xbcaf62['agents'];this[_0xa966('0xa')]=_0xbcaf62[_0xa966('0xa')];ami['on'](_0xa966('0xb'),this[_0xa966('0xc')][_0xa966('0xd')](this));ami['on']('registry',this[_0xa966('0xc')][_0xa966('0xd')](this));ami['on']('devicestatechange',this[_0xa966('0xe')][_0xa966('0xd')](this));ami['on'](_0xa966('0xf'),this[_0xa966('0x10')]['bind'](this));this[_0xa966('0x11')]();return BPromise['resolve']()[_0xa966('0x12')](ami[_0xa966('0x13')]())[_0xa966('0x12')](ami[_0xa966('0x14')]())[_0xa966('0x12')](ami[_0xa966('0x15')]())[_0xa966('0x16')](loggerCatch(_0xa966('0x17')));}function loggerCatch(_0x5adce5){return function(_0x9646ec){logger['error'](_0x5adce5,util[_0xa966('0x18')](_0x9646ec,{'showHidden':![],'depth':null}));};}UserReport[_0xa966('0x19')][_0xa966('0x11')]=function(){setInterval(function(){BPromise[_0xa966('0x1a')]()['then'](ami['actionSipShowRegistry']())[_0xa966('0x12')](ami[_0xa966('0x14')]())['then'](ami[_0xa966('0x15')]())[_0xa966('0x16')](loggerCatch(_0xa966('0x17')));},0x32c8);};UserReport[_0xa966('0x19')][_0xa966('0x1b')]=function(_0x2025e9){return _0x2025e9!==null&&!_[_0xa966('0x1c')](_0x2025e9);};UserReport[_0xa966('0x19')][_0xa966('0x1d')]=function(_0x4f7cc3,_0x5f363d,_0x953a95){io['to'](_0x4f7cc3)[_0xa966('0x1d')](_0x5f363d,_0x953a95);};UserReport['prototype'][_0xa966('0xc')]=function(_0x3ba3ea){try{if(this[_0xa966('0x1b')](_0x3ba3ea)){var _0x3ed03a=_['find'](this[_0xa966('0x9')],{'registry':_0x3ba3ea['username']});if(_0x3ed03a){_0x3ba3ea[_0xa966('0x1e')]=_0x3ba3ea['state'];_[_0xa966('0x1f')](_0x3ed03a,_['omit'](_0x3ba3ea,['event',_0xa966('0x20'),_0xa966('0x21'),'state']));this['emit'](util['format'](_0xa966('0x22'),_0x3ed03a[_0xa966('0x23')]),_0xa966('0x24'),_0x3ed03a);}}}catch(_0x32d1d9){logger[_0xa966('0x25')]('[syncRegistry][UserReport]',util['inspect'](_0x32d1d9,{'showHidden':![],'depth':null}));}};UserReport[_0xa966('0x19')][_0xa966('0xe')]=function(_0x3b3e72){try{if(this[_0xa966('0x1b')](_0x3b3e72)){if(this[_0xa966('0x26')][_0x3b3e72[_0xa966('0x27')]]){if(!this[_0xa966('0x26')][_0x3b3e72[_0xa966('0x27')]][_0xa966('0x28')]||_0x3b3e72[_0xa966('0x29')][_0xa966('0x2a')]()==_0xa966('0x2b')){this[_0xa966('0x26')][_0x3b3e72['device']][_0xa966('0x28')]=![];if(this[_0xa966('0x26')][_0x3b3e72[_0xa966('0x27')]][_0xa966('0x29')]!==_0x3b3e72[_0xa966('0x29')]['toLowerCase']()){this[_0xa966('0x26')][_0x3b3e72[_0xa966('0x27')]][_0xa966('0x2c')]=_[_0xa966('0x2d')](moment()[_0xa966('0x2e')]('x'));}this[_0xa966('0x26')][_0x3b3e72[_0xa966('0x27')]][_0xa966('0x29')]=_0x3b3e72['state'][_0xa966('0x2a')]();this[_0xa966('0x26')][_0x3b3e72[_0xa966('0x27')]]['updateStatusRealtime'](_0x3b3e72);}}else if(this[_0xa966('0xa')][_0x3b3e72['device']]){if(this['telephones'][_0x3b3e72['device']][_0xa966('0x29')]!==_0x3b3e72[_0xa966('0x29')]['toLowerCase']()){this[_0xa966('0xa')][_0x3b3e72[_0xa966('0x27')]][_0xa966('0x2c')]=_[_0xa966('0x2d')](moment()[_0xa966('0x2e')]('x'));}this[_0xa966('0xa')][_0x3b3e72[_0xa966('0x27')]]['state']=_0x3b3e72[_0xa966('0x29')][_0xa966('0x2a')]();this['emit'](util[_0xa966('0x2e')]('telephone:%s',this[_0xa966('0xa')][_0x3b3e72[_0xa966('0x27')]][_0xa966('0x23')]),_0xa966('0x2f'),this[_0xa966('0xa')][_0x3b3e72['device']]);}else if(this[_0xa966('0x9')][_0x3b3e72[_0xa966('0x27')]]){if(this[_0xa966('0x9')][_0x3b3e72[_0xa966('0x27')]]['state']!==_0x3b3e72[_0xa966('0x29')]['toLowerCase']()){this[_0xa966('0x9')][_0x3b3e72['device']][_0xa966('0x2c')]=_[_0xa966('0x2d')](moment()[_0xa966('0x2e')]('x'));}this[_0xa966('0x9')][_0x3b3e72[_0xa966('0x27')]][_0xa966('0x29')]=_0x3b3e72['state'][_0xa966('0x2a')]();this[_0xa966('0x1d')](util[_0xa966('0x2e')](_0xa966('0x22'),this[_0xa966('0x9')][_0x3b3e72['device']][_0xa966('0x23')]),_0xa966('0x24'),this[_0xa966('0x9')][_0x3b3e72[_0xa966('0x27')]]);}else if(_[_0xa966('0x30')](_0x3b3e72[_0xa966('0x27')],_0xa966('0x31'))){}else if(_[_0xa966('0x30')](_0x3b3e72['device'],_0xa966('0x32'))){var _0xccaad2=_0x3b3e72[_0xa966('0x27')];var _0x432eec=_0xccaad2['substring'](_0xccaad2[_0xa966('0x33')]('/')+0x1,_0xccaad2['indexOf']('@'));var _0x22353c=_['find'](this[_0xa966('0x26')],function(_0x5d1e4b){return _0x5d1e4b[_0xa966('0x34')]==_0x432eec||_0x5d1e4b['phone']==_0x432eec||_0x5d1e4b['accountcode']==_0x432eec;});if(_0x22353c){if(_0x22353c[_0xa966('0x29')]!==_0x3b3e72['state'][_0xa966('0x2a')]()){_0x22353c[_0xa966('0x2c')]=_['toNumber'](moment()[_0xa966('0x2e')]('x'));}_0x22353c[_0xa966('0x29')]=_0x3b3e72[_0xa966('0x29')][_0xa966('0x2a')]();_0x22353c[_0xa966('0x28')]=!![];_0x22353c['updateStatusRealtime'](_0x3b3e72);}}else{}}}catch(_0x357818){logger[_0xa966('0x25')](_0xa966('0x35'),util[_0xa966('0x18')](_0x357818,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x5b7f6b){try{if(this[_0xa966('0x1b')](_0x5b7f6b)&&this[_0xa966('0x1b')](_0x5b7f6b[_0xa966('0xf')])){if(this[_0xa966('0x26')][_0x5b7f6b[_0xa966('0x36')]]){if(!this[_0xa966('0x26')][_0x5b7f6b[_0xa966('0x36')]][_0xa966('0x28')]||_0x5b7f6b[_0xa966('0xf')][_0xa966('0x2a')]()==_0xa966('0x37')){this['agents'][_0x5b7f6b[_0xa966('0x36')]][_0xa966('0x28')]=![];this['agents'][_0x5b7f6b['peer']][_0xa966('0x38')]=_0x5b7f6b[_0xa966('0xf')][_0xa966('0x2a')]();this[_0xa966('0x26')][_0x5b7f6b[_0xa966('0x36')]][_0xa966('0x39')]=_0x5b7f6b[_0xa966('0x39')];this[_0xa966('0x26')][_0x5b7f6b[_0xa966('0x36')]][_0xa966('0x3a')](_0x5b7f6b);}}else if(this['telephones'][_0x5b7f6b[_0xa966('0x36')]]){this[_0xa966('0xa')][_0x5b7f6b[_0xa966('0x36')]][_0xa966('0x38')]=_0x5b7f6b[_0xa966('0xf')]['toLowerCase']();this[_0xa966('0xa')][_0x5b7f6b[_0xa966('0x36')]][_0xa966('0x39')]=_0x5b7f6b['address'];this[_0xa966('0x1d')](util[_0xa966('0x2e')](_0xa966('0x3b'),this['telephones'][_0x5b7f6b[_0xa966('0x36')]][_0xa966('0x23')]),_0xa966('0x2f'),this['telephones'][_0x5b7f6b['peer']]);}else if(this['trunks'][_0x5b7f6b['peer']]){this[_0xa966('0x9')][_0x5b7f6b[_0xa966('0x36')]][_0xa966('0x38')]=_0x5b7f6b[_0xa966('0xf')][_0xa966('0x2a')]();this[_0xa966('0x9')][_0x5b7f6b[_0xa966('0x36')]][_0xa966('0x39')]=_0x5b7f6b['address'];this[_0xa966('0x1d')](util[_0xa966('0x2e')](_0xa966('0x22'),this[_0xa966('0x9')][_0x5b7f6b['peer']][_0xa966('0x23')]),'trunk:save',this[_0xa966('0x9')][_0x5b7f6b[_0xa966('0x36')]]);}else{}}}catch(_0x1138ad){logger[_0xa966('0x25')]('[syncPeerStatus][UserReport]',util['inspect'](_0x1138ad,{'showHidden':![],'depth':null}));}};module[_0xa966('0x3c')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 46d003c..97f5d3c 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 _0x74d4=['onhold','lodash','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','omit','event','privilege','custom:agentcalled','user:%s','membername','user:called','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinename','destchannelstatedesc','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswer','agentcomplete','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','inspect','agentringnoanswerAt','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','agent','acw','agentacw','acwtime','interface','custom:agentcomplete','error','addVariable','variable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','syncBlindTransfer','transfereruniqueid','channel','substring','lastIndexOf'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x74d4,0x15d));var _0x474d=function(_0x470c50,_0x27f5b0){_0x470c50=_0x470c50-0x0;var _0x2ad38e=_0x74d4[_0x470c50];return _0x2ad38e;};'use strict';var _=require(_0x474d('0x0'));var moment=require('moment');var util=require('util');var Redis=require('ioredis');var config=require(_0x474d('0x1'));var logger=require(_0x474d('0x2'))(_0x474d('0x3'));var ami=require(_0x474d('0x4'));config[_0x474d('0x5')]=_[_0x474d('0x6')](config['redis'],{'host':_0x474d('0x7'),'port':0x18eb});var io=require(_0x474d('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0x886fe6){this[_0x474d('0x9')]={};this[_0x474d('0xa')]=_0x886fe6[_0x474d('0xa')];this[_0x474d('0xb')]=_0x886fe6['agents'];this[_0x474d('0xc')]={};ami['on']('agentcalled',this['syncAgentCalled'][_0x474d('0xd')](this));ami['on'](_0x474d('0xe'),this[_0x474d('0xf')][_0x474d('0xd')](this));ami['on']('agentringnoanswer',this[_0x474d('0x10')]['bind'](this));ami['on'](_0x474d('0x11'),this[_0x474d('0x12')][_0x474d('0xd')](this));ami['on']('agentcomplete',this[_0x474d('0x13')][_0x474d('0xd')](this));ami['on'](_0x474d('0x14'),this[_0x474d('0x15')]['bind'](this));ami['on'](_0x474d('0x16'),this[_0x474d('0x17')]['bind'](this));ami['on'](_0x474d('0x18'),this[_0x474d('0x19')][_0x474d('0xd')](this));ami['on'](_0x474d('0x1a'),this[_0x474d('0x1b')][_0x474d('0xd')](this));ami['on']('attendedtransfer',this[_0x474d('0x1c')][_0x474d('0xd')](this));ami['on'](_0x474d('0x1d'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0x474d('0x1e')]['emit']=function(_0x1de9c7,_0xcf68f3,_0x5655c5){io['to'](_0x1de9c7)[_0x474d('0x1f')](_0xcf68f3,_0x5655c5);};VoiceAgentReport['prototype'][_0x474d('0x20')]=function(_0x4c24f1){return _0x4c24f1!==null&&!_[_0x474d('0x21')](_0x4c24f1);};VoiceAgentReport[_0x474d('0x1e')][_0x474d('0x22')]=function(_0x22b77c){try{if(this[_0x474d('0x20')](_0x22b77c)){if(_[_0x474d('0x21')](this[_0x474d('0x9')][_0x22b77c[_0x474d('0x23')]])){this['channels'][_0x22b77c['uniqueid']]={};}if(_[_0x474d('0x21')](this['channels'][_0x22b77c[_0x474d('0x23')]][_0x22b77c[_0x474d('0x24')]])){this[_0x474d('0x9')][_0x22b77c['uniqueid']][_0x22b77c['destuniqueid']]={'agentcalledAt':moment()[_0x474d('0x25')](_0x474d('0x26')),'lastevent':'called','variables':this['variables'][_0x22b77c[_0x474d('0x23')]],'type':this[_0x474d('0xa')][_0x22b77c[_0x474d('0x27')]]?this['voiceQueues'][_0x22b77c[_0x474d('0x27')]][_0x474d('0x28')]||'inbound':_0x474d('0x29')};}_['merge'](this[_0x474d('0x9')][_0x22b77c[_0x474d('0x23')]][_0x22b77c[_0x474d('0x24')]],_[_0x474d('0x2a')](_0x22b77c,[_0x474d('0x2b'),_0x474d('0x2c')]));ami['emit'](_0x474d('0x2d'),this[_0x474d('0x9')][_0x22b77c[_0x474d('0x23')]][_0x22b77c[_0x474d('0x24')]]);this[_0x474d('0x1f')](util[_0x474d('0x25')](_0x474d('0x2e'),_0x22b77c[_0x474d('0x2f')]),_0x474d('0x30'),this[_0x474d('0x9')][_0x22b77c['uniqueid']][_0x22b77c[_0x474d('0x24')]]);}}catch(_0x40dc83){logger['error']('[syncAgentCalled][VoiceAgentReport]',util['inspect'](_0x40dc83,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x474d('0x1e')]['syncAgentConnect']=function(_0x94ab5a){try{if(this[_0x474d('0x20')](_0x94ab5a)){if(this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]]){for(var _0x4b7c67 in this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]]){if(this[_0x474d('0x9')][_0x94ab5a['uniqueid']][_0x474d('0x31')](_0x4b7c67)){if(_0x94ab5a['destuniqueid']===_0x4b7c67){this['channels'][_0x94ab5a['uniqueid']][_0x4b7c67][_0x474d('0x32')]=moment()['format'](_0x474d('0x26'));this['channels'][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67][_0x474d('0x33')]=_0x474d('0x34');this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67][_0x474d('0x35')]=_0x94ab5a[_0x474d('0x35')];this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67]['connectedlinenum']=_0x94ab5a['connectedlinenum'];this['channels'][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67]['connectedlinename']=_0x94ab5a[_0x474d('0x36')];this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67]['destchannelstate']=_0x94ab5a['destchannelstate'];this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67][_0x474d('0x37')]=_0x94ab5a[_0x474d('0x37')];_['merge'](this[_0x474d('0xb')][_0x94ab5a['interface']],_[_0x474d('0x38')](_0x94ab5a,['queue',_0x474d('0x39')]));this[_0x474d('0x1f')](util[_0x474d('0x25')](_0x474d('0x2e'),_0x94ab5a[_0x474d('0x2f')]),_0x474d('0x3a'),this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x94ab5a[_0x474d('0x24')]]);ami[_0x474d('0x1f')](_0x474d('0x3b'),this['channels'][_0x94ab5a['uniqueid']][_0x4b7c67]);}else if(!this['channels'][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67][_0x474d('0x3c')]&&!this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67][_0x474d('0x3d')]){this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67][_0x474d('0x3c')]=!![];this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67]['agentringnoanswerAt']=moment()[_0x474d('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67][_0x474d('0x3e')]=_0x474d('0x3f');this['channels'][_0x94ab5a['uniqueid']][_0x4b7c67][_0x474d('0x33')]=_0x474d('0x3f');this[_0x474d('0x9')][_0x94ab5a[_0x474d('0x23')]][_0x4b7c67][_0x474d('0x40')]=_0x94ab5a[_0x474d('0x24')];this['channels'][_0x94ab5a['uniqueid']][_0x4b7c67]['answeredelsewheremembername']=_0x94ab5a['membername'];ami[_0x474d('0x1f')](_0x474d('0x41'),this[_0x474d('0x9')][_0x94ab5a['uniqueid']][_0x4b7c67]);}}}}}}catch(_0x497965){logger['error'](_0x474d('0x42'),util[_0x474d('0x43')](_0x497965,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x474d('0x1e')][_0x474d('0x10')]=function(_0x508e00){try{if(this[_0x474d('0x20')](_0x508e00)){if(this[_0x474d('0x9')][_0x508e00['uniqueid']]&&this[_0x474d('0x9')][_0x508e00[_0x474d('0x23')]][_0x508e00['destuniqueid']]){this[_0x474d('0x9')][_0x508e00[_0x474d('0x23')]][_0x508e00[_0x474d('0x24')]][_0x474d('0x3c')]=!![];this['channels'][_0x508e00[_0x474d('0x23')]][_0x508e00[_0x474d('0x24')]][_0x474d('0x44')]=moment()[_0x474d('0x25')](_0x474d('0x26'));this[_0x474d('0x9')][_0x508e00[_0x474d('0x23')]][_0x508e00['destuniqueid']][_0x474d('0x3e')]=_0x474d('0x45');this[_0x474d('0x9')][_0x508e00['uniqueid']][_0x508e00[_0x474d('0x24')]]['lastevent']=_0x474d('0x45');ami['emit'](_0x474d('0x46'),this[_0x474d('0x9')][_0x508e00[_0x474d('0x23')]][_0x508e00[_0x474d('0x24')]]);}}}catch(_0x3685e0){logger['error'](_0x474d('0x47'),util['inspect'](_0x3685e0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x474d('0x1e')]['syncQueueCallerAbandon']=function(_0x43febf){try{if(this[_0x474d('0x20')](_0x43febf)){if(this[_0x474d('0x9')][_0x43febf[_0x474d('0x23')]]){for(var _0xbf6acb in this[_0x474d('0x9')][_0x43febf[_0x474d('0x23')]]){if(this[_0x474d('0x9')][_0x43febf[_0x474d('0x23')]][_0x474d('0x31')](_0xbf6acb)&&!this[_0x474d('0x9')][_0x43febf[_0x474d('0x23')]][_0xbf6acb]['agentringnoanswer']&&!this['channels'][_0x43febf[_0x474d('0x23')]][_0xbf6acb]['agentcomplete']){this[_0x474d('0x9')][_0x43febf['uniqueid']][_0xbf6acb][_0x474d('0x3c')]=!![];this['channels'][_0x43febf[_0x474d('0x23')]][_0xbf6acb]['agentringnoanswerAt']=moment()[_0x474d('0x25')](_0x474d('0x26'));this[_0x474d('0x9')][_0x43febf[_0x474d('0x23')]][_0xbf6acb][_0x474d('0x3e')]=_0x474d('0x48');this[_0x474d('0x9')][_0x43febf[_0x474d('0x23')]][_0xbf6acb][_0x474d('0x33')]=_0x474d('0x48');ami[_0x474d('0x1f')]('custom:agentqueuecallerabandon',this[_0x474d('0x9')][_0x43febf[_0x474d('0x23')]][_0xbf6acb]);}}}}}catch(_0x30a4ca){logger['error'](_0x474d('0x49'),util[_0x474d('0x43')](_0x30a4ca,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x474d('0x1e')]['syncAgentComplete']=function(_0x30e4a5){try{if(this[_0x474d('0x20')](_0x30e4a5)){if(this[_0x474d('0x9')][_0x30e4a5[_0x474d('0x23')]]){for(var _0x27d5cf in this[_0x474d('0x9')][_0x30e4a5[_0x474d('0x23')]]){if(this[_0x474d('0x9')][_0x30e4a5[_0x474d('0x23')]][_0x474d('0x31')](_0x27d5cf)){if(this[_0x474d('0x9')][_0x30e4a5['uniqueid']][_0x27d5cf]['agentconnectAt']&&!this['channels'][_0x30e4a5[_0x474d('0x23')]][_0x27d5cf][_0x474d('0x3d')]){this[_0x474d('0x9')][_0x30e4a5[_0x474d('0x23')]][_0x27d5cf]['agentcomplete']=!![];this['channels'][_0x30e4a5[_0x474d('0x23')]][_0x27d5cf][_0x474d('0x4a')]=moment()['format'](_0x474d('0x26'));this[_0x474d('0x9')][_0x30e4a5['uniqueid']][_0x27d5cf][_0x474d('0x33')]=_0x474d('0x4b');this['channels'][_0x30e4a5[_0x474d('0x23')]][_0x27d5cf]['talktime']=_0x30e4a5[_0x474d('0x4c')];this[_0x474d('0x9')][_0x30e4a5[_0x474d('0x23')]][_0x27d5cf][_0x474d('0x3e')]=_0x30e4a5['reason']==_0x474d('0x4d')?_0x474d('0x4e'):_0x30e4a5[_0x474d('0x3e')];if(this[_0x474d('0xa')][_0x30e4a5[_0x474d('0x27')]]&&this['voiceQueues'][_0x30e4a5[_0x474d('0x27')]][_0x474d('0x4f')]){this[_0x474d('0x9')][_0x30e4a5[_0x474d('0x23')]][_0x27d5cf][_0x474d('0x50')]=!![];this['channels'][_0x30e4a5[_0x474d('0x23')]][_0x27d5cf][_0x474d('0x51')]=this[_0x474d('0xa')][_0x30e4a5[_0x474d('0x27')]]['acwTimeout'];}this[_0x474d('0xb')][_0x30e4a5[_0x474d('0x52')]]=_[_0x474d('0x2a')](this['agents'][_0x30e4a5[_0x474d('0x52')]],[_0x474d('0x27'),_0x474d('0x39')]);this[_0x474d('0x1f')](util[_0x474d('0x25')](_0x474d('0x2e'),_0x30e4a5[_0x474d('0x2f')]),'user:agentcomplete',this[_0x474d('0x9')][_0x30e4a5[_0x474d('0x23')]][_0x27d5cf]);ami[_0x474d('0x1f')](_0x474d('0x53'),this[_0x474d('0x9')][_0x30e4a5[_0x474d('0x23')]][_0x27d5cf]);}}}}}}catch(_0x1ac811){logger[_0x474d('0x54')]('[syncAgentComplete][VoiceAgentReport]',util[_0x474d('0x43')](_0x1ac811,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x474d('0x1e')][_0x474d('0x15')]=function(_0x1d7136){try{if(this['isNotNull'](_0x1d7136)){this[_0x474d('0x55')](_0x1d7136[_0x474d('0x23')],_['keys'](_0x1d7136[_0x474d('0x56')])[0x0],_0x1d7136['value']);if(this[_0x474d('0x9')][_0x1d7136['uniqueid']]){for(var _0x1fed09 in this[_0x474d('0x9')][_0x1d7136['uniqueid']]){if(this[_0x474d('0x9')][_0x1d7136[_0x474d('0x23')]][_0x474d('0x31')](_0x1fed09)){if(_['isUndefined'](this[_0x474d('0x9')][_0x1d7136[_0x474d('0x23')]][_0x1fed09][_0x474d('0xc')])){this[_0x474d('0x9')][_0x1d7136[_0x474d('0x23')]][_0x1fed09]['variables']={};}this[_0x474d('0x9')][_0x1d7136[_0x474d('0x23')]][_0x1fed09][_0x474d('0xc')]=this[_0x474d('0xc')][_0x1d7136[_0x474d('0x23')]];}}}}}catch(_0x4cbf92){logger['error']('[syncVarSet][VoiceAgentReport]',util[_0x474d('0x43')](_0x4cbf92,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x474d('0x1e')][_0x474d('0x55')]=function(_0x3c16f9,_0x56055c,_0xa398ee){var _0x3f2f06=['rtpaudioqos',_0x474d('0x57'),_0x474d('0x58'),_0x474d('0x59'),_0x474d('0x5a'),_0x474d('0x5b'),_0x474d('0x5c'),_0x474d('0x5d'),'sipcallid',_0x474d('0x5e'),_0x474d('0x5f'),'bridgepvtcallid',_0x474d('0x60'),_0x474d('0x61'),'memberinterface',_0x474d('0x62'),_0x474d('0x2f'),_0x474d('0x63'),_0x474d('0x64')];if(!_[_0x474d('0x65')](_0x56055c)&&!_['includes'](_0x3f2f06,_0x56055c)){if(_[_0x474d('0x21')](this[_0x474d('0xc')][_0x3c16f9])){this[_0x474d('0xc')][_0x3c16f9]={};}this['variables'][_0x3c16f9][_0x56055c]=_0xa398ee;}};VoiceAgentReport[_0x474d('0x1e')][_0x474d('0x17')]=function(_0x5628d){try{if(this[_0x474d('0x20')](_0x5628d)){if(this[_0x474d('0x9')][_0x5628d[_0x474d('0x23')]]){for(var _0xf060a0 in this[_0x474d('0x9')][_0x5628d[_0x474d('0x23')]]){if(this[_0x474d('0x9')][_0x5628d['uniqueid']][_0x474d('0x31')](_0xf060a0)){if(this[_0x474d('0x9')][_0x5628d[_0x474d('0x23')]][_0xf060a0]['reason']==_0x474d('0x4d')&&this[_0x474d('0x9')][_0x5628d[_0x474d('0x23')]][_0xf060a0][_0x474d('0x3d')]){this[_0x474d('0x9')][_0x5628d[_0x474d('0x23')]][_0xf060a0][_0x474d('0x4a')]=moment()[_0x474d('0x25')](_0x474d('0x26'));}}}ami[_0x474d('0x1f')](_0x474d('0x66'),_[_0x474d('0x67')](this[_0x474d('0x9')][_0x5628d['uniqueid']]));delete this[_0x474d('0x9')][_0x5628d[_0x474d('0x23')]];}if(this[_0x474d('0xc')][_0x5628d[_0x474d('0x23')]]){delete this[_0x474d('0xc')][_0x5628d[_0x474d('0x23')]];}}}catch(_0x9605de){logger[_0x474d('0x54')](_0x474d('0x68'),util['inspect'](_0x9605de,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x474d('0x1c')]=function(_0x3903a3){try{if(this['isNotNull'](_0x3903a3)){if(this[_0x474d('0x9')][_0x3903a3['transfereeuniqueid']]){for(var _0x30f52f in this['channels'][_0x3903a3[_0x474d('0x69')]]){if(this['channels'][_0x3903a3[_0x474d('0x69')]]['hasOwnProperty'](_0x30f52f)){if(_0x3903a3[_0x474d('0x6a')]===_0x30f52f){var _0x4ae091=moment();this[_0x474d('0x9')][_0x3903a3[_0x474d('0x69')]][_0x30f52f]['agentcomplete']=!![];this[_0x474d('0x9')][_0x3903a3[_0x474d('0x69')]][_0x30f52f]['agentcompleteAt']=moment()[_0x474d('0x25')](_0x474d('0x26'));this['channels'][_0x3903a3[_0x474d('0x69')]][_0x30f52f][_0x474d('0x3e')]='transfer';this['channels'][_0x3903a3[_0x474d('0x69')]][_0x30f52f][_0x474d('0x33')]='complete';this[_0x474d('0x9')][_0x3903a3[_0x474d('0x69')]][_0x30f52f][_0x474d('0x4c')]=_0x4ae091[_0x474d('0x6b')](this[_0x474d('0x9')][_0x3903a3[_0x474d('0x69')]][_0x30f52f][_0x474d('0x32')],_0x474d('0x6c'));}}}}if(this[_0x474d('0x9')][_0x3903a3['secondtransfereruniqueid']]){var _0x1b10f3=this[_0x474d('0x9')][_0x3903a3[_0x474d('0x6d')]];this['channels'][_0x3903a3[_0x474d('0x6d')]]=this[_0x474d('0x9')][_0x3903a3['transfereeuniqueid']];this['channels'][_0x3903a3[_0x474d('0x69')]]=_0x1b10f3;}}}catch(_0x2df531){logger[_0x474d('0x54')]('[syncAttendedTransfer][VoiceAgentReport]',util[_0x474d('0x43')](_0x2df531,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x474d('0x1e')][_0x474d('0x6e')]=function(_0x281c21){try{if(this['isNotNull'](_0x281c21)){if(this[_0x474d('0x9')][_0x281c21[_0x474d('0x69')]]){for(var _0x127d80 in this[_0x474d('0x9')][_0x281c21['transfereeuniqueid']]){if(this[_0x474d('0x9')][_0x281c21[_0x474d('0x69')]][_0x474d('0x31')](_0x127d80)){if(_0x281c21[_0x474d('0x6f')]===_0x127d80){var _0x14c222=moment();this[_0x474d('0x9')][_0x281c21['transfereeuniqueid']][_0x127d80][_0x474d('0x3d')]=!![];this['channels'][_0x281c21['transfereeuniqueid']][_0x127d80][_0x474d('0x4a')]=_0x14c222;this[_0x474d('0x9')][_0x281c21['transfereeuniqueid']][_0x127d80][_0x474d('0x3e')]=_0x474d('0x4d');this[_0x474d('0x9')][_0x281c21[_0x474d('0x69')]][_0x127d80][_0x474d('0x33')]=_0x474d('0x4b');this['channels'][_0x281c21[_0x474d('0x69')]][_0x127d80][_0x474d('0x4c')]=_0x14c222[_0x474d('0x6b')](this[_0x474d('0x9')][_0x281c21[_0x474d('0x69')]][_0x127d80][_0x474d('0x32')],'seconds');}}}}}}catch(_0x5561fc){logger[_0x474d('0x54')]('[syncBlindTransfer][VoiceAgentReport]',util['inspect'](_0x5561fc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x474d('0x1e')]['syncMusicOnHoldStart']=function(_0x4dfbc3){var _0x10c550='';try{if(this[_0x474d('0x20')](_0x4dfbc3)){if(_0x4dfbc3['channel']){_0x10c550=_0x4dfbc3[_0x474d('0x70')][_0x474d('0x71')](0x0,_0x4dfbc3['channel'][_0x474d('0x72')]('-'));if(this[_0x474d('0xb')][_0x10c550]){this[_0x474d('0xb')][_0x10c550][_0x474d('0x73')]=!![];}}}}catch(_0x412f01){logger['error']('[syncMusicOnHoldStart][VoiceAgentReport]',util[_0x474d('0x43')](_0x412f01,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x474d('0x1e')][_0x474d('0x1b')]=function(_0x212941){var _0x4f673e='';try{if(this[_0x474d('0x20')](_0x212941)){if(_0x212941[_0x474d('0x70')]){_0x4f673e=_0x212941['channel'][_0x474d('0x71')](0x0,_0x212941[_0x474d('0x70')][_0x474d('0x72')]('-'));if(this[_0x474d('0xb')][_0x4f673e]){this[_0x474d('0xb')][_0x4f673e][_0x474d('0x73')]=![];}}}}catch(_0x5de970){logger[_0x474d('0x54')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x474d('0x43')](_0x5de970,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xa792=['acwtime','acwTimeout','destconnectedlinenum','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','value','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberrealtime','includes','syncHangup','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','channel','lastIndexOf','onhold','substring','exports','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isUndefined','isNotNull','uniqueid','destuniqueid','format','called','voiceQueues','type','inbound','merge','privilege','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','queue','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','agentcompleteAt','complete','talktime','transfer','agent','acw','agentacw'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xa792,0x11f));var _0x2a79=function(_0x585d51,_0x24d0c2){_0x585d51=_0x585d51-0x0;var _0x129e96=_0xa792[_0x585d51];return _0x129e96;};'use strict';var _=require('lodash');var moment=require(_0x2a79('0x0'));var util=require(_0x2a79('0x1'));var Redis=require('ioredis');var config=require(_0x2a79('0x2'));var logger=require(_0x2a79('0x3'))(_0x2a79('0x4'));var ami=require(_0x2a79('0x5'));config[_0x2a79('0x6')]=_[_0x2a79('0x7')](config['redis'],{'host':_0x2a79('0x8'),'port':0x18eb});var io=require(_0x2a79('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x3f60c8){this[_0x2a79('0xa')]={};this['voiceQueues']=_0x3f60c8['voiceQueues'];this[_0x2a79('0xb')]=_0x3f60c8[_0x2a79('0xb')];this[_0x2a79('0xc')]={};ami['on']('agentcalled',this[_0x2a79('0xd')][_0x2a79('0xe')](this));ami['on'](_0x2a79('0xf'),this[_0x2a79('0x10')][_0x2a79('0xe')](this));ami['on'](_0x2a79('0x11'),this[_0x2a79('0x12')][_0x2a79('0xe')](this));ami['on'](_0x2a79('0x13'),this[_0x2a79('0x14')][_0x2a79('0xe')](this));ami['on'](_0x2a79('0x15'),this[_0x2a79('0x16')][_0x2a79('0xe')](this));ami['on'](_0x2a79('0x17'),this[_0x2a79('0x18')][_0x2a79('0xe')](this));ami['on'](_0x2a79('0x19'),this['syncHangup'][_0x2a79('0xe')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x2a79('0xe')](this));ami['on'](_0x2a79('0x1a'),this[_0x2a79('0x1b')][_0x2a79('0xe')](this));ami['on']('attendedtransfer',this[_0x2a79('0x1c')][_0x2a79('0xe')](this));ami['on'](_0x2a79('0x1d'),this[_0x2a79('0x1e')][_0x2a79('0xe')](this));}VoiceAgentReport['prototype'][_0x2a79('0x1f')]=function(_0x1f66ae,_0x51a224,_0x4a4edf){io['to'](_0x1f66ae)['emit'](_0x51a224,_0x4a4edf);};VoiceAgentReport[_0x2a79('0x20')]['isNotNull']=function(_0x276eec){return _0x276eec!==null&&!_[_0x2a79('0x21')](_0x276eec);};VoiceAgentReport['prototype'][_0x2a79('0xd')]=function(_0x4ccae3){try{if(this[_0x2a79('0x22')](_0x4ccae3)){if(_['isUndefined'](this[_0x2a79('0xa')][_0x4ccae3['uniqueid']])){this['channels'][_0x4ccae3[_0x2a79('0x23')]]={};}if(_['isUndefined'](this[_0x2a79('0xa')][_0x4ccae3['uniqueid']][_0x4ccae3[_0x2a79('0x24')]])){this[_0x2a79('0xa')][_0x4ccae3[_0x2a79('0x23')]][_0x4ccae3[_0x2a79('0x24')]]={'agentcalledAt':moment()[_0x2a79('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x2a79('0x26'),'variables':this['variables'][_0x4ccae3['uniqueid']],'type':this['voiceQueues'][_0x4ccae3['queue']]?this[_0x2a79('0x27')][_0x4ccae3['queue']][_0x2a79('0x28')]||_0x2a79('0x29'):_0x2a79('0x29')};}_[_0x2a79('0x2a')](this['channels'][_0x4ccae3[_0x2a79('0x23')]][_0x4ccae3['destuniqueid']],_['omit'](_0x4ccae3,['event',_0x2a79('0x2b')]));ami[_0x2a79('0x1f')](_0x2a79('0x2c'),this[_0x2a79('0xa')][_0x4ccae3[_0x2a79('0x23')]][_0x4ccae3['destuniqueid']]);this[_0x2a79('0x1f')](util[_0x2a79('0x25')](_0x2a79('0x2d'),_0x4ccae3[_0x2a79('0x2e')]),_0x2a79('0x2f'),this[_0x2a79('0xa')][_0x4ccae3[_0x2a79('0x23')]][_0x4ccae3[_0x2a79('0x24')]]);}}catch(_0x11bfdd){logger[_0x2a79('0x30')](_0x2a79('0x31'),util[_0x2a79('0x32')](_0x11bfdd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a79('0x20')][_0x2a79('0x10')]=function(_0x19205c){try{if(this[_0x2a79('0x22')](_0x19205c)){if(this[_0x2a79('0xa')][_0x19205c['uniqueid']]){for(var _0x32bdc6 in this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]]){if(this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x2a79('0x33')](_0x32bdc6)){if(_0x19205c[_0x2a79('0x24')]===_0x32bdc6){this['channels'][_0x19205c[_0x2a79('0x23')]][_0x32bdc6][_0x2a79('0x34')]=moment()[_0x2a79('0x25')](_0x2a79('0x35'));this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6][_0x2a79('0x36')]=_0x2a79('0x37');this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6][_0x2a79('0x38')]=_0x19205c[_0x2a79('0x38')];this[_0x2a79('0xa')][_0x19205c['uniqueid']][_0x32bdc6][_0x2a79('0x39')]=_0x19205c['connectedlinenum'];this[_0x2a79('0xa')][_0x19205c['uniqueid']][_0x32bdc6][_0x2a79('0x3a')]=_0x19205c[_0x2a79('0x3a')];this[_0x2a79('0xa')][_0x19205c['uniqueid']][_0x32bdc6][_0x2a79('0x3b')]=_0x19205c['destchannelstate'];this['channels'][_0x19205c[_0x2a79('0x23')]][_0x32bdc6][_0x2a79('0x3c')]=_0x19205c['destchannelstatedesc'];_[_0x2a79('0x2a')](this[_0x2a79('0xb')][_0x19205c[_0x2a79('0x3d')]],_[_0x2a79('0x3e')](_0x19205c,[_0x2a79('0x3f'),'destconnectedlinenum']));this[_0x2a79('0x1f')](util[_0x2a79('0x25')]('user:%s',_0x19205c[_0x2a79('0x2e')]),_0x2a79('0x40'),this['channels'][_0x19205c['uniqueid']][_0x19205c[_0x2a79('0x24')]]);ami[_0x2a79('0x1f')](_0x2a79('0x41'),this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6]);}else if(!this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6]['agentringnoanswer']&&!this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6]['agentcomplete']){this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6]['agentringnoanswer']=!![];this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6][_0x2a79('0x42')]=moment()['format'](_0x2a79('0x35'));this['channels'][_0x19205c['uniqueid']][_0x32bdc6][_0x2a79('0x43')]=_0x2a79('0x44');this[_0x2a79('0xa')][_0x19205c['uniqueid']][_0x32bdc6]['lastevent']=_0x2a79('0x44');this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6][_0x2a79('0x45')]=_0x19205c[_0x2a79('0x24')];this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6][_0x2a79('0x46')]=_0x19205c['membername'];ami[_0x2a79('0x1f')](_0x2a79('0x47'),this[_0x2a79('0xa')][_0x19205c[_0x2a79('0x23')]][_0x32bdc6]);}}}}}}catch(_0x4bb958){logger[_0x2a79('0x30')](_0x2a79('0x48'),util[_0x2a79('0x32')](_0x4bb958,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a79('0x20')]['syncAgentRingNoAnswer']=function(_0x15ccc3){try{if(this[_0x2a79('0x22')](_0x15ccc3)){if(this[_0x2a79('0xa')][_0x15ccc3[_0x2a79('0x23')]]&&this[_0x2a79('0xa')][_0x15ccc3['uniqueid']][_0x15ccc3[_0x2a79('0x24')]]){this[_0x2a79('0xa')][_0x15ccc3['uniqueid']][_0x15ccc3['destuniqueid']][_0x2a79('0x11')]=!![];this[_0x2a79('0xa')][_0x15ccc3[_0x2a79('0x23')]][_0x15ccc3['destuniqueid']]['agentringnoanswerAt']=moment()[_0x2a79('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x15ccc3['uniqueid']][_0x15ccc3['destuniqueid']][_0x2a79('0x43')]=_0x2a79('0x49');this['channels'][_0x15ccc3[_0x2a79('0x23')]][_0x15ccc3[_0x2a79('0x24')]][_0x2a79('0x36')]='rejected';ami['emit'](_0x2a79('0x4a'),this['channels'][_0x15ccc3[_0x2a79('0x23')]][_0x15ccc3[_0x2a79('0x24')]]);}}}catch(_0x1de6cd){logger[_0x2a79('0x30')](_0x2a79('0x4b'),util[_0x2a79('0x32')](_0x1de6cd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2a79('0x14')]=function(_0x168141){try{if(this['isNotNull'](_0x168141)){if(this[_0x2a79('0xa')][_0x168141[_0x2a79('0x23')]]){for(var _0x4d1370 in this[_0x2a79('0xa')][_0x168141[_0x2a79('0x23')]]){if(this[_0x2a79('0xa')][_0x168141['uniqueid']][_0x2a79('0x33')](_0x4d1370)&&!this[_0x2a79('0xa')][_0x168141['uniqueid']][_0x4d1370]['agentringnoanswer']&&!this[_0x2a79('0xa')][_0x168141[_0x2a79('0x23')]][_0x4d1370][_0x2a79('0x15')]){this[_0x2a79('0xa')][_0x168141[_0x2a79('0x23')]][_0x4d1370]['agentringnoanswer']=!![];this['channels'][_0x168141[_0x2a79('0x23')]][_0x4d1370]['agentringnoanswerAt']=moment()[_0x2a79('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2a79('0xa')][_0x168141['uniqueid']][_0x4d1370][_0x2a79('0x43')]='abandoned';this[_0x2a79('0xa')][_0x168141[_0x2a79('0x23')]][_0x4d1370][_0x2a79('0x36')]=_0x2a79('0x4c');ami['emit'](_0x2a79('0x4d'),this[_0x2a79('0xa')][_0x168141[_0x2a79('0x23')]][_0x4d1370]);}}}}}catch(_0x1b08d7){logger[_0x2a79('0x30')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0x2a79('0x32')](_0x1b08d7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2a79('0x16')]=function(_0x3d0010){try{if(this[_0x2a79('0x22')](_0x3d0010)){if(this[_0x2a79('0xa')][_0x3d0010['uniqueid']]){for(var _0x534031 in this['channels'][_0x3d0010[_0x2a79('0x23')]]){if(this[_0x2a79('0xa')][_0x3d0010[_0x2a79('0x23')]][_0x2a79('0x33')](_0x534031)){if(this[_0x2a79('0xa')][_0x3d0010[_0x2a79('0x23')]][_0x534031][_0x2a79('0x34')]&&!this[_0x2a79('0xa')][_0x3d0010['uniqueid']][_0x534031]['agentcomplete']){this[_0x2a79('0xa')][_0x3d0010[_0x2a79('0x23')]][_0x534031][_0x2a79('0x15')]=!![];this[_0x2a79('0xa')][_0x3d0010[_0x2a79('0x23')]][_0x534031][_0x2a79('0x4e')]=moment()[_0x2a79('0x25')](_0x2a79('0x35'));this[_0x2a79('0xa')][_0x3d0010[_0x2a79('0x23')]][_0x534031]['lastevent']=_0x2a79('0x4f');this[_0x2a79('0xa')][_0x3d0010[_0x2a79('0x23')]][_0x534031][_0x2a79('0x50')]=_0x3d0010['talktime'];this[_0x2a79('0xa')][_0x3d0010[_0x2a79('0x23')]][_0x534031][_0x2a79('0x43')]=_0x3d0010[_0x2a79('0x43')]==_0x2a79('0x51')?_0x2a79('0x52'):_0x3d0010[_0x2a79('0x43')];if(this['voiceQueues'][_0x3d0010[_0x2a79('0x3f')]]&&this['voiceQueues'][_0x3d0010['queue']][_0x2a79('0x53')]){this['channels'][_0x3d0010[_0x2a79('0x23')]][_0x534031][_0x2a79('0x54')]=!![];this[_0x2a79('0xa')][_0x3d0010['uniqueid']][_0x534031][_0x2a79('0x55')]=this['voiceQueues'][_0x3d0010[_0x2a79('0x3f')]][_0x2a79('0x56')];}this[_0x2a79('0xb')][_0x3d0010[_0x2a79('0x3d')]]=_['omit'](this[_0x2a79('0xb')][_0x3d0010['interface']],['queue',_0x2a79('0x57')]);this[_0x2a79('0x1f')](util[_0x2a79('0x25')]('user:%s',_0x3d0010[_0x2a79('0x2e')]),_0x2a79('0x58'),this[_0x2a79('0xa')][_0x3d0010['uniqueid']][_0x534031]);ami[_0x2a79('0x1f')](_0x2a79('0x59'),this[_0x2a79('0xa')][_0x3d0010['uniqueid']][_0x534031]);}}}}}}catch(_0x3ec0f4){logger['error'](_0x2a79('0x5a'),util[_0x2a79('0x32')](_0x3ec0f4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a79('0x20')][_0x2a79('0x18')]=function(_0xad95ce){try{if(this[_0x2a79('0x22')](_0xad95ce)){this[_0x2a79('0x5b')](_0xad95ce[_0x2a79('0x23')],_[_0x2a79('0x5c')](_0xad95ce['variable'])[0x0],_0xad95ce[_0x2a79('0x5d')]);if(this[_0x2a79('0xa')][_0xad95ce[_0x2a79('0x23')]]){for(var _0x4fa800 in this[_0x2a79('0xa')][_0xad95ce[_0x2a79('0x23')]]){if(this[_0x2a79('0xa')][_0xad95ce[_0x2a79('0x23')]][_0x2a79('0x33')](_0x4fa800)){if(_[_0x2a79('0x21')](this[_0x2a79('0xa')][_0xad95ce[_0x2a79('0x23')]][_0x4fa800][_0x2a79('0xc')])){this[_0x2a79('0xa')][_0xad95ce[_0x2a79('0x23')]][_0x4fa800]['variables']={};}this['channels'][_0xad95ce[_0x2a79('0x23')]][_0x4fa800][_0x2a79('0xc')]=this['variables'][_0xad95ce['uniqueid']];}}}}}catch(_0x4099d6){logger[_0x2a79('0x30')]('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x4099d6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a79('0x20')][_0x2a79('0x5b')]=function(_0x42d3a3,_0x4ed98c,_0x3df3a4){var _0x1127dd=['rtpaudioqos',_0x2a79('0x5e'),_0x2a79('0x5f'),_0x2a79('0x60'),'rtpaudioqosloss',_0x2a79('0x61'),'rtpaudioqosrtt',_0x2a79('0x62'),_0x2a79('0x63'),_0x2a79('0x64'),_0x2a79('0x65'),_0x2a79('0x66'),_0x2a79('0x67'),_0x2a79('0x68'),_0x2a79('0x69'),'memberlastcall','membername','memberpenalty',_0x2a79('0x6a')];if(!_['isNil'](_0x4ed98c)&&!_[_0x2a79('0x6b')](_0x1127dd,_0x4ed98c)){if(_[_0x2a79('0x21')](this[_0x2a79('0xc')][_0x42d3a3])){this[_0x2a79('0xc')][_0x42d3a3]={};}this['variables'][_0x42d3a3][_0x4ed98c]=_0x3df3a4;}};VoiceAgentReport[_0x2a79('0x20')][_0x2a79('0x6c')]=function(_0x2808d7){try{if(this[_0x2a79('0x22')](_0x2808d7)){if(this[_0x2a79('0xa')][_0x2808d7[_0x2a79('0x23')]]){for(var _0x58e43c in this[_0x2a79('0xa')][_0x2808d7[_0x2a79('0x23')]]){if(this['channels'][_0x2808d7[_0x2a79('0x23')]][_0x2a79('0x33')](_0x58e43c)){if(this[_0x2a79('0xa')][_0x2808d7['uniqueid']][_0x58e43c][_0x2a79('0x43')]=='transfer'&&this[_0x2a79('0xa')][_0x2808d7[_0x2a79('0x23')]][_0x58e43c][_0x2a79('0x15')]){this[_0x2a79('0xa')][_0x2808d7[_0x2a79('0x23')]][_0x58e43c][_0x2a79('0x4e')]=moment()[_0x2a79('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami['emit'](_0x2a79('0x6d'),_[_0x2a79('0x6e')](this[_0x2a79('0xa')][_0x2808d7[_0x2a79('0x23')]]));delete this[_0x2a79('0xa')][_0x2808d7[_0x2a79('0x23')]];}if(this['variables'][_0x2808d7[_0x2a79('0x23')]]){delete this[_0x2a79('0xc')][_0x2808d7[_0x2a79('0x23')]];}}}catch(_0x1f82ab){logger['error'](_0x2a79('0x6f'),util[_0x2a79('0x32')](_0x1f82ab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a79('0x20')]['syncAttendedTransfer']=function(_0x51cfa1){try{if(this[_0x2a79('0x22')](_0x51cfa1)){if(this['channels'][_0x51cfa1['transfereeuniqueid']]){for(var _0x2fb12f in this[_0x2a79('0xa')][_0x51cfa1['transfereeuniqueid']]){if(this['channels'][_0x51cfa1[_0x2a79('0x70')]][_0x2a79('0x33')](_0x2fb12f)){if(_0x51cfa1[_0x2a79('0x71')]===_0x2fb12f){var _0x52e2be=moment();this['channels'][_0x51cfa1['transfereeuniqueid']][_0x2fb12f][_0x2a79('0x15')]=!![];this[_0x2a79('0xa')][_0x51cfa1[_0x2a79('0x70')]][_0x2fb12f]['agentcompleteAt']=moment()['format'](_0x2a79('0x35'));this[_0x2a79('0xa')][_0x51cfa1[_0x2a79('0x70')]][_0x2fb12f][_0x2a79('0x43')]=_0x2a79('0x51');this['channels'][_0x51cfa1[_0x2a79('0x70')]][_0x2fb12f][_0x2a79('0x36')]=_0x2a79('0x4f');this['channels'][_0x51cfa1[_0x2a79('0x70')]][_0x2fb12f][_0x2a79('0x50')]=_0x52e2be[_0x2a79('0x72')](this['channels'][_0x51cfa1[_0x2a79('0x70')]][_0x2fb12f][_0x2a79('0x34')],_0x2a79('0x73'));}}}}if(this[_0x2a79('0xa')][_0x51cfa1['secondtransfereruniqueid']]){var _0x58a094=this['channels'][_0x51cfa1[_0x2a79('0x74')]];this['channels'][_0x51cfa1[_0x2a79('0x74')]]=this[_0x2a79('0xa')][_0x51cfa1[_0x2a79('0x70')]];this['channels'][_0x51cfa1[_0x2a79('0x70')]]=_0x58a094;}}}catch(_0x767cf9){logger[_0x2a79('0x30')](_0x2a79('0x75'),util[_0x2a79('0x32')](_0x767cf9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a79('0x20')][_0x2a79('0x1e')]=function(_0x4611eb){try{if(this[_0x2a79('0x22')](_0x4611eb)){if(this[_0x2a79('0xa')][_0x4611eb[_0x2a79('0x70')]]){for(var _0x303ac6 in this[_0x2a79('0xa')][_0x4611eb[_0x2a79('0x70')]]){if(this['channels'][_0x4611eb[_0x2a79('0x70')]][_0x2a79('0x33')](_0x303ac6)){if(_0x4611eb[_0x2a79('0x76')]===_0x303ac6){var _0xa4386b=moment();this[_0x2a79('0xa')][_0x4611eb['transfereeuniqueid']][_0x303ac6]['agentcomplete']=!![];this['channels'][_0x4611eb['transfereeuniqueid']][_0x303ac6][_0x2a79('0x4e')]=_0xa4386b;this['channels'][_0x4611eb[_0x2a79('0x70')]][_0x303ac6]['reason']=_0x2a79('0x51');this[_0x2a79('0xa')][_0x4611eb[_0x2a79('0x70')]][_0x303ac6]['lastevent']='complete';this[_0x2a79('0xa')][_0x4611eb[_0x2a79('0x70')]][_0x303ac6][_0x2a79('0x50')]=_0xa4386b[_0x2a79('0x72')](this[_0x2a79('0xa')][_0x4611eb[_0x2a79('0x70')]][_0x303ac6][_0x2a79('0x34')],_0x2a79('0x73'));}}}}}}catch(_0x95fad3){logger[_0x2a79('0x30')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x2a79('0x32')](_0x95fad3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a79('0x20')]['syncMusicOnHoldStart']=function(_0x3ec1a8){var _0x221321='';try{if(this[_0x2a79('0x22')](_0x3ec1a8)){if(_0x3ec1a8[_0x2a79('0x77')]){_0x221321=_0x3ec1a8['channel']['substring'](0x0,_0x3ec1a8['channel'][_0x2a79('0x78')]('-'));if(this[_0x2a79('0xb')][_0x221321]){this[_0x2a79('0xb')][_0x221321][_0x2a79('0x79')]=!![];}}}}catch(_0x38136f){logger['error']('[syncMusicOnHoldStart][VoiceAgentReport]',util[_0x2a79('0x32')](_0x38136f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a79('0x20')]['syncMusicOnHoldStop']=function(_0x2bb1b0){var _0xb6145='';try{if(this[_0x2a79('0x22')](_0x2bb1b0)){if(_0x2bb1b0[_0x2a79('0x77')]){_0xb6145=_0x2bb1b0[_0x2a79('0x77')][_0x2a79('0x7a')](0x0,_0x2bb1b0['channel'][_0x2a79('0x78')]('-'));if(this[_0x2a79('0xb')][_0xb6145]){this[_0x2a79('0xb')][_0xb6145]['onhold']=![];}}}}catch(_0x3231dd){logger[_0x2a79('0x30')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x2a79('0x32')](_0x3231dd,{'showHidden':![],'depth':null}));}};module[_0x2a79('0x7b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 34d9371..8a72ea8 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 _0xa600=['secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','transfertargetcalleridnum','origtransfereruniqueid','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','bluebird','lodash','moment','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','not_inuse','inuse','busy','invalid','unavailable','ringinuse','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','syncNewState','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','catch','log','prototype','isUndefined','emit','uniqueid','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','isNotNull','linkedid','channel','OutgoingSpoolFailed','format','disposition','toNumber','context','split','destconnectedlinenum','exten','user:%s','name','accountcode','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','starttime','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','applicationdata','cdr(','match','answered','answertime','diff','calleridnum','connectedlinename','calleridname','destinationchannel','channelstate','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','.wav49','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','callerid','xmd-cdrtype','type','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','holdtime','from-sip','omit','user:agentcomplete','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum'];(function(_0x43255a,_0x4fdb33){var _0x2a1b4e=function(_0x39c617){while(--_0x39c617){_0x43255a['push'](_0x43255a['shift']());}};_0x2a1b4e(++_0x4fdb33);}(_0xa600,0x1c7));var _0x0a60=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xa600[_0x5e36d1];return _0x950b9e;};'use strict';var BPromise=require(_0x0a60('0x0'));var _=require(_0x0a60('0x1'));var moment=require(_0x0a60('0x2'));var util=require('util');var path=require(_0x0a60('0x3'));var Redis=require(_0x0a60('0x4'));var config=require(_0x0a60('0x5'));var logger=require(_0x0a60('0x6'))('ami');var ami=require(_0x0a60('0x7'));var Channel=require(_0x0a60('0x8'));var statusDesc=['unknown',_0x0a60('0x9'),_0x0a60('0xa'),_0x0a60('0xb'),_0x0a60('0xc'),_0x0a60('0xd'),'ringing',_0x0a60('0xe'),'onhold'];var applications=[_0x0a60('0xf'),_0x0a60('0x10'),_0x0a60('0x11'),_0x0a60('0x12'),_0x0a60('0x13'),_0x0a60('0x14')];var dispositions=[_0x0a60('0x15'),_0x0a60('0x16'),_0x0a60('0x16'),_0x0a60('0x15'),'NO\x20ANSWER',_0x0a60('0x15'),'ANSWERED',_0x0a60('0x17'),_0x0a60('0x16'),_0x0a60('0x16'),'FAILED'];var actions={};config['redis']=_['defaults'](config[_0x0a60('0x18')],{'host':_0x0a60('0x19'),'port':0x18eb});var io=require(_0x0a60('0x1a'))(new Redis(config[_0x0a60('0x18')]));function VoiceCallReport(_0xf0f6e4){this[_0x0a60('0x1b')]=_0xf0f6e4[_0x0a60('0x1b')];this['agents']=_0xf0f6e4[_0x0a60('0x1c')];ami['on'](_0x0a60('0x1d'),this[_0x0a60('0x1e')][_0x0a60('0x1f')](this));ami['on']('newexten',this['syncNewExten'][_0x0a60('0x1f')](this));ami['on'](_0x0a60('0x20'),this[_0x0a60('0x21')]['bind'](this));ami['on']('newstate',this[_0x0a60('0x22')]['bind'](this));ami['on']('varset',this[_0x0a60('0x23')][_0x0a60('0x1f')](this));ami['on'](_0x0a60('0x24'),this[_0x0a60('0x25')][_0x0a60('0x1f')](this));ami['on']('newcallerid',this[_0x0a60('0x26')][_0x0a60('0x1f')](this));ami['on'](_0x0a60('0x27'),this[_0x0a60('0x28')][_0x0a60('0x1f')](this));ami['on'](_0x0a60('0x29'),this[_0x0a60('0x2a')][_0x0a60('0x1f')](this));ami['on'](_0x0a60('0x2b'),this[_0x0a60('0x2c')]['bind'](this));ami['on'](_0x0a60('0x2d'),this[_0x0a60('0x2e')][_0x0a60('0x1f')](this));return BPromise[_0x0a60('0x2f')]()['then'](ami['actionCoreShowChannels']())[_0x0a60('0x30')](function(_0x1ad71d){console[_0x0a60('0x31')](_0x1ad71d);});}VoiceCallReport[_0x0a60('0x32')]['isNotNull']=function(_0x247e96){return _0x247e96!==null&&!_[_0x0a60('0x33')](_0x247e96);};VoiceCallReport[_0x0a60('0x32')][_0x0a60('0x34')]=function(_0x49d9f7,_0x300c99,_0x55df96){io['to'](_0x49d9f7)[_0x0a60('0x34')](_0x300c99,_0x55df96);};VoiceCallReport[_0x0a60('0x32')][_0x0a60('0x26')]=function(_0x578992){try{if(this['isNotNull'](_0x578992)){if(_0x578992[_0x0a60('0x35')]===_0x578992['linkedid']){if(!_[_0x0a60('0x33')](this[_0x0a60('0x1b')][_0x578992['uniqueid']])){_[_0x0a60('0x36')](this[_0x0a60('0x1b')][_0x578992[_0x0a60('0x35')]],_[_0x0a60('0x37')](_0x578992,_[_0x0a60('0x38')](this[_0x0a60('0x1b')][_0x578992[_0x0a60('0x35')]])));}}}}catch(_0x3642c8){logger[_0x0a60('0x39')](_0x0a60('0x3a'),util['inspect'](_0x3642c8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0a60('0x32')]['syncNewChannel']=function(_0x49d988){try{if(this[_0x0a60('0x3b')](_0x49d988)){if(_0x49d988[_0x0a60('0x35')]===_0x49d988[_0x0a60('0x3c')]&&_0x49d988[_0x0a60('0x3d')]!=_0x0a60('0x3e')){if(_[_0x0a60('0x33')](this[_0x0a60('0x1b')][_0x49d988['uniqueid']])){this[_0x0a60('0x1b')][_0x49d988[_0x0a60('0x35')]]=new Channel();this[_0x0a60('0x1b')][_0x49d988['uniqueid']]['starttime']=moment()[_0x0a60('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a60('0x1b')][_0x49d988[_0x0a60('0x35')]][_0x0a60('0x40')]=dispositions[_[_0x0a60('0x41')](_0x49d988['channelstate'])];_[_0x0a60('0x36')](this[_0x0a60('0x1b')][_0x49d988[_0x0a60('0x35')]],_[_0x0a60('0x37')](_0x49d988,_[_0x0a60('0x38')](this['channels'][_0x49d988[_0x0a60('0x35')]])));if(_0x49d988[_0x0a60('0x42')]==='from-sip'){if(this[_0x0a60('0x1c')][_0x49d988[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]]){this['agents'][_0x49d988[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]][_0x0a60('0x44')]=_0x49d988[_0x0a60('0x45')];this[_0x0a60('0x34')](util[_0x0a60('0x3f')](_0x0a60('0x46'),this[_0x0a60('0x1c')][_0x49d988[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]][_0x0a60('0x47')]),'user:agentconnect',{'destaccountcode':this[_0x0a60('0x1c')][_0x49d988[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]][_0x0a60('0x48')],'destconnectedlinenum':_0x49d988[_0x0a60('0x45')]});}}}}}}catch(_0x534b24){logger[_0x0a60('0x39')](_0x0a60('0x49'),util[_0x0a60('0x4a')](_0x534b24,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0a60('0x32')][_0x0a60('0x1e')]=function(_0x550575){try{if(this[_0x0a60('0x3b')](_0x550575)){if(_0x550575[_0x0a60('0x35')]===_0x550575[_0x0a60('0x3c')]&&_0x550575[_0x0a60('0x45')]!='h'&&_0x550575[_0x0a60('0x3d')]!=_0x0a60('0x3e')){_0x550575[_0x0a60('0x4b')]=_0x550575[_0x0a60('0x4b')][_0x0a60('0x4c')]();_0x550575['applicationdata']=(_0x550575['appdata']||_0x550575['applicationdata'])[_0x0a60('0x4c')]();if(_[_0x0a60('0x33')](this['channels'][_0x550575[_0x0a60('0x35')]])){this['channels'][_0x550575[_0x0a60('0x35')]]=new Channel();this[_0x0a60('0x1b')][_0x550575[_0x0a60('0x35')]][_0x0a60('0x4d')]=_0x550575[_0x0a60('0x4e')]?moment()[_0x0a60('0x4f')](moment[_0x0a60('0x4e')](_0x550575[_0x0a60('0x4e')])[_0x0a60('0x50')](),_0x0a60('0x50'))[_0x0a60('0x3f')](_0x0a60('0x51')):moment()[_0x0a60('0x3f')](_0x0a60('0x51'));this[_0x0a60('0x1b')][_0x550575['uniqueid']][_0x0a60('0x40')]=_0x0a60('0x15');}_[_0x0a60('0x36')](this['channels'][_0x550575[_0x0a60('0x35')]],_[_0x0a60('0x37')](_0x550575,_[_0x0a60('0x38')](this[_0x0a60('0x1b')][_0x550575[_0x0a60('0x35')]])));if(_[_0x0a60('0x52')](applications,_0x550575['application'])){this['channels'][_0x550575['uniqueid']][_0x0a60('0x53')]=_0x550575['application'];this['channels'][_0x550575[_0x0a60('0x35')]][_0x0a60('0x54')]=_0x550575[_0x0a60('0x55')];if(_0x550575['application']==='set'&&_['startsWith'](_0x550575['applicationdata'],_0x0a60('0x56'))){var _0x4bb64b=_0x550575[_0x0a60('0x55')]['split']('=');var _0x5cfd80=_0x4bb64b[0x0][_0x0a60('0x57')](/cdr\((.*)\)/);if(_0x5cfd80){this[_0x0a60('0x1b')][_0x550575[_0x0a60('0x35')]][_0x5cfd80[0x1]]=_0x4bb64b[0x1];}}else if(_0x550575[_0x0a60('0x4b')]===_0x0a60('0x10')){this[_0x0a60('0x1b')][_0x550575[_0x0a60('0x35')]][_0x0a60('0x10')]=_0x550575['applicationdata']['split'](',')[0x0];}}}}}catch(_0x3749be){logger[_0x0a60('0x39')]('[syncNewExten][VoiceCallReport]',util['inspect'](_0x3749be,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0a60('0x32')][_0x0a60('0x22')]=function(_0x483aba){try{if(this[_0x0a60('0x3b')](_0x483aba)){if(_0x483aba['uniqueid']!==_0x483aba[_0x0a60('0x3c')]){if(this[_0x0a60('0x1b')][_0x483aba[_0x0a60('0x3c')]]){if(_0x483aba['channelstate']==='6'){if(!this['channels'][_0x483aba[_0x0a60('0x3c')]][_0x0a60('0x58')]){var _0x270f4d=moment();this[_0x0a60('0x1b')][_0x483aba['linkedid']][_0x0a60('0x58')]=!![];this[_0x0a60('0x1b')][_0x483aba[_0x0a60('0x3c')]][_0x0a60('0x59')]=_0x270f4d['format']('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x0a60('0x1b')][_0x483aba[_0x0a60('0x3c')]][_0x0a60('0x4d')]){this[_0x0a60('0x1b')][_0x483aba['linkedid']]['holdtime']=_0x270f4d[_0x0a60('0x5a')](this[_0x0a60('0x1b')][_0x483aba[_0x0a60('0x3c')]][_0x0a60('0x4d')],_0x0a60('0x50'));}}this[_0x0a60('0x1b')][_0x483aba[_0x0a60('0x3c')]][_0x0a60('0x3c')]=_0x483aba['uniqueid'];if(_0x483aba[_0x0a60('0x5b')]!=='xcally-motion-preview'){this[_0x0a60('0x1b')][_0x483aba['linkedid']]['connectedlinenum']=_0x483aba[_0x0a60('0x5b')];}this[_0x0a60('0x1b')][_0x483aba[_0x0a60('0x3c')]][_0x0a60('0x5c')]=_0x483aba[_0x0a60('0x5d')];this[_0x0a60('0x1b')][_0x483aba['linkedid']][_0x0a60('0x5e')]=_0x483aba[_0x0a60('0x3d')];this['channels'][_0x483aba['linkedid']][_0x0a60('0x40')]=dispositions[_['toNumber'](_0x483aba[_0x0a60('0x5f')])];if(this[_0x0a60('0x1c')][_0x483aba[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]]){this[_0x0a60('0x1b')][_0x483aba[_0x0a60('0x3c')]][_0x0a60('0x60')]=this[_0x0a60('0x1c')][_0x483aba[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]]['id'];this[_0x0a60('0x1b')][_0x483aba['linkedid']][_0x0a60('0x61')]=this[_0x0a60('0x1c')][_0x483aba[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]][_0x0a60('0x47')];}}}}else{if(this[_0x0a60('0x1b')][_0x483aba[_0x0a60('0x35')]]){if(_0x483aba[_0x0a60('0x5f')]==='6'){if(this[_0x0a60('0x1c')][_0x483aba['channel']['split']('-')[0x0]]){this[_0x0a60('0x1b')][_0x483aba['uniqueid']][_0x0a60('0x60')]=this[_0x0a60('0x1c')][_0x483aba['channel'][_0x0a60('0x43')]('-')[0x0]]['id'];this[_0x0a60('0x1b')][_0x483aba['uniqueid']][_0x0a60('0x61')]=this[_0x0a60('0x1c')][_0x483aba[_0x0a60('0x3d')]['split']('-')[0x0]][_0x0a60('0x47')];}}}}}}catch(_0xaa9de7){logger['error'](_0x0a60('0x62'),util[_0x0a60('0x4a')](_0xaa9de7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0a60('0x32')][_0x0a60('0x63')]=function(_0x5ddbe6,_0x5a1a83){if(this[_0x0a60('0x1b')][_0x5ddbe6]){this[_0x0a60('0x1b')][_0x5ddbe6]['monitor']=!![];if(_[_0x0a60('0x64')](_0x5a1a83,_0x0a60('0x65'))){_0x5a1a83=_0x5a1a83['replace'](_0x0a60('0x65'),'.WAV');}this['channels'][_0x5ddbe6][_0x0a60('0x66')]=_0x5a1a83;var _0x1d57ab=_[_0x0a60('0x67')](this['channels'][_0x5ddbe6][_0x0a60('0x68')],{'filename':_0x5a1a83});if(_[_0x0a60('0x69')](_0x1d57ab)){this[_0x0a60('0x1b')][_0x5ddbe6][_0x0a60('0x68')][_0x0a60('0x6a')]({'filename':_0x5a1a83,'createdAt':moment()[_0x0a60('0x3f')](_0x0a60('0x51')),'mixmonitorid':'','status':_0x0a60('0x6b')});}}};VoiceCallReport['prototype']['syncVarSet']=function(_0x205ff5){try{if(this[_0x0a60('0x3b')](_0x205ff5)){if(this[_0x0a60('0x1b')][_0x205ff5[_0x0a60('0x35')]]&&_0x205ff5[_0x0a60('0x3d')]!=_0x0a60('0x3e')){if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')])){if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')][_0x0a60('0x6d')])){this[_0x0a60('0x63')](_0x205ff5['uniqueid'],_0x205ff5[_0x0a60('0x6e')]);}else if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')][_0x0a60('0x6f')])){this[_0x0a60('0x1b')][_0x205ff5[_0x0a60('0x35')]][_0x0a60('0x5b')]=_0x205ff5[_0x0a60('0x6e')];}else if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')]['xmd-callerid'])){this[_0x0a60('0x1b')][_0x205ff5[_0x0a60('0x35')]][_0x0a60('0x70')]=_0x205ff5[_0x0a60('0x6e')];}else if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')][_0x0a60('0x71')])){this[_0x0a60('0x1b')][_0x205ff5['uniqueid']][_0x0a60('0x72')]=_0x205ff5[_0x0a60('0x6e')];}else if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')]['xmd-queue'])){this[_0x0a60('0x1b')][_0x205ff5[_0x0a60('0x35')]]['queue']=_0x205ff5[_0x0a60('0x6e')]['split'](',')[0x0];}else if(this[_0x0a60('0x3b')](_0x205ff5['variable'][_0x0a60('0x73')])){this[_0x0a60('0x1b')][_0x205ff5[_0x0a60('0x35')]][_0x0a60('0x74')]=_0x205ff5[_0x0a60('0x6e')];}else if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')][_0x0a60('0x75')])){this[_0x0a60('0x1b')][_0x205ff5[_0x0a60('0x35')]][_0x0a60('0x76')]=_0x205ff5['value'];}else if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')][_0x0a60('0x77')])){this['channels'][_0x205ff5[_0x0a60('0x35')]][_0x0a60('0x78')]=_0x205ff5['value'];}else if(this['isNotNull'](_0x205ff5[_0x0a60('0x6c')][_0x0a60('0x79')])){this[_0x0a60('0x1b')][_0x205ff5['uniqueid']][_0x0a60('0x10')]=_0x205ff5[_0x0a60('0x6e')];}else if(this[_0x0a60('0x3b')](_0x205ff5['variable'][_0x0a60('0x7a')])){this[_0x0a60('0x1b')][_0x205ff5[_0x0a60('0x35')]][_0x0a60('0x7b')]=_0x205ff5[_0x0a60('0x6e')];}}}else if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')][_0x0a60('0x6d')])){if(_0x205ff5[_0x0a60('0x6e')]){var _0x438054=path[_0x0a60('0x7c')](_0x205ff5['value'])[_0x0a60('0x47')];this['syncMixMonitorFilename'](_0x438054,_0x205ff5[_0x0a60('0x6e')]);}}else if(this['channels'][_0x205ff5[_0x0a60('0x3c')]]){if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')])){if(this[_0x0a60('0x3b')](_0x205ff5[_0x0a60('0x6c')][_0x0a60('0x7a')])){this['channels'][_0x205ff5['linkedid']][_0x0a60('0x7d')]=_0x205ff5[_0x0a60('0x6e')];}}}}}catch(_0x11007a){logger[_0x0a60('0x39')](_0x0a60('0x7e'),util['inspect'](_0x11007a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0a60('0x32')][_0x0a60('0x25')]=function(_0x37dd54){try{if(this[_0x0a60('0x3b')](_0x37dd54)){if(this['channels'][_0x37dd54[_0x0a60('0x35')]]){var _0x493044=moment();this[_0x0a60('0x1b')][_0x37dd54['uniqueid']][_0x0a60('0x7f')]=_0x493044[_0x0a60('0x3f')](_0x0a60('0x51'));this[_0x0a60('0x1b')][_0x37dd54['uniqueid']][_0x0a60('0x4e')]=_0x493044['diff'](this[_0x0a60('0x1b')][_0x37dd54[_0x0a60('0x35')]][_0x0a60('0x4d')],_0x0a60('0x50'));if(this[_0x0a60('0x1b')][_0x37dd54['uniqueid']][_0x0a60('0x58')]){this['channels'][_0x37dd54['uniqueid']][_0x0a60('0x80')]=_0x493044[_0x0a60('0x5a')](this[_0x0a60('0x1b')][_0x37dd54[_0x0a60('0x35')]][_0x0a60('0x59')],_0x0a60('0x50'));this[_0x0a60('0x1b')][_0x37dd54[_0x0a60('0x35')]][_0x0a60('0x81')]=this[_0x0a60('0x1b')][_0x37dd54[_0x0a60('0x35')]]['duration']-this[_0x0a60('0x1b')][_0x37dd54['uniqueid']]['billableseconds'];}if(_0x37dd54[_0x0a60('0x42')]===_0x0a60('0x82')){if(this[_0x0a60('0x1c')][_0x37dd54[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]]){this[_0x0a60('0x1c')][_0x37dd54[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]]=_[_0x0a60('0x83')](this[_0x0a60('0x1c')][_0x37dd54[_0x0a60('0x3d')][_0x0a60('0x43')]('-')[0x0]],['destconnectedlinenum']);this[_0x0a60('0x34')](util[_0x0a60('0x3f')](_0x0a60('0x46'),this[_0x0a60('0x1c')][_0x37dd54[_0x0a60('0x3d')]['split']('-')[0x0]][_0x0a60('0x47')]),_0x0a60('0x84'),{'destaccountcode':this[_0x0a60('0x1c')][_0x37dd54['channel'][_0x0a60('0x43')]('-')[0x0]][_0x0a60('0x48')]});}}ami[_0x0a60('0x34')]('custom:voiceCallReport',this[_0x0a60('0x1b')][_0x37dd54['uniqueid']]);delete this[_0x0a60('0x1b')][_0x37dd54[_0x0a60('0x35')]];}}}catch(_0x44cf02){logger[_0x0a60('0x39')](_0x0a60('0x85'),util['inspect'](_0x44cf02,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x5cd2b0){try{if(this[_0x0a60('0x3b')](_0x5cd2b0)){if(this[_0x0a60('0x1b')][_0x5cd2b0[_0x0a60('0x86')]]){this[_0x0a60('0x1b')][_0x5cd2b0[_0x0a60('0x86')]]['transfercalleridnum']=_0x5cd2b0[_0x0a60('0x87')];this['channels'][_0x5cd2b0[_0x0a60('0x86')]][_0x0a60('0x88')]=_0x5cd2b0['transfertargetcalleridnum'];if(this[_0x0a60('0x1b')][_0x5cd2b0[_0x0a60('0x89')]]){var _0x8c7219=this['channels'][_0x5cd2b0[_0x0a60('0x89')]];this[_0x0a60('0x1b')][_0x5cd2b0['secondtransfereruniqueid']]=this[_0x0a60('0x1b')][_0x5cd2b0[_0x0a60('0x86')]];this[_0x0a60('0x1b')][_0x5cd2b0[_0x0a60('0x86')]]=_0x8c7219;}}else if(this[_0x0a60('0x1b')][_0x5cd2b0[_0x0a60('0x8a')]]){this[_0x0a60('0x1b')][_0x5cd2b0[_0x0a60('0x8a')]][_0x0a60('0x8b')]=_0x5cd2b0[_0x0a60('0x87')];this[_0x0a60('0x1b')][_0x5cd2b0['transfertargetuniqueid']][_0x0a60('0x88')]=_0x5cd2b0[_0x0a60('0x8c')];if(this['channels'][_0x5cd2b0['origtransfereruniqueid']]){var _0x8c7219=this[_0x0a60('0x1b')][_0x5cd2b0[_0x0a60('0x8d')]];this[_0x0a60('0x1b')][_0x5cd2b0['origtransfereruniqueid']]=this[_0x0a60('0x1b')][_0x5cd2b0['transfertargetuniqueid']];this[_0x0a60('0x1b')][_0x5cd2b0[_0x0a60('0x8a')]]=_0x8c7219;}}}}catch(_0x554f6d){logger[_0x0a60('0x39')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x0a60('0x4a')](_0x554f6d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0a60('0x32')][_0x0a60('0x2a')]=function(_0x1242dc){try{if(this[_0x0a60('0x3b')](_0x1242dc)){if(this[_0x0a60('0x1b')][_0x1242dc[_0x0a60('0x86')]]){this[_0x0a60('0x1b')][_0x1242dc[_0x0a60('0x86')]][_0x0a60('0x8b')]=_0x1242dc['transfereecalleridnum'];this[_0x0a60('0x1b')][_0x1242dc[_0x0a60('0x86')]][_0x0a60('0x88')]=_0x1242dc['extension'];this[_0x0a60('0x25')]({'event':_0x0a60('0x8e'),'uniqueid':_0x1242dc[_0x0a60('0x86')],'context':_0x1242dc[_0x0a60('0x42')],'channel':_0x1242dc[_0x0a60('0x8f')]});}}}catch(_0x3e1bb4){logger[_0x0a60('0x39')](_0x0a60('0x90'),util[_0x0a60('0x4a')](_0x3e1bb4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0a60('0x32')]['syncMusicOnHoldStart']=function(_0xb38f26){try{if(this['isNotNull'](_0xb38f26)){if(this[_0x0a60('0x1b')][_0xb38f26[_0x0a60('0x35')]]){if(!_['isNil'](this[_0x0a60('0x1b')][_0xb38f26[_0x0a60('0x35')]][_0x0a60('0x59')])){this['channels'][_0xb38f26[_0x0a60('0x35')]][_0x0a60('0x91')]=moment()[_0x0a60('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x2413c0){logger[_0x0a60('0x39')](_0x0a60('0x92'),util[_0x0a60('0x4a')](_0x2413c0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0a60('0x32')]['syncMusicOnHoldStop']=function(_0x21e1ee){try{if(this['isNotNull'](_0x21e1ee)){if(this['channels'][_0x21e1ee[_0x0a60('0x35')]]){if(!_[_0x0a60('0x69')](this['channels'][_0x21e1ee[_0x0a60('0x35')]][_0x0a60('0x91')])){this[_0x0a60('0x1b')][_0x21e1ee[_0x0a60('0x35')]]['mohtime']+=moment()[_0x0a60('0x93')](0x0)['diff'](this['channels'][_0x21e1ee[_0x0a60('0x35')]][_0x0a60('0x91')],_0x0a60('0x50'));delete this[_0x0a60('0x1b')][_0x21e1ee['uniqueid']][_0x0a60('0x91')];}}}}catch(_0x18c689){logger[_0x0a60('0x39')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x0a60('0x4a')](_0x18c689,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xb271=['omit','emit','accountcode','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','agi','playback','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','bind','hangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','prototype','isUndefined','syncNewCallerId','isNotNull','uniqueid','linkedid','merge','pick','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','starttime','disposition','keys','context','split','destconnectedlinenum','exten','format','user:%s','application','toLowerCase','appdata','applicationdata','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','startsWith','cdr(','match','channelstate','answered','answertime','diff','calleridnum','xcally-motion-preview','connectedlinename','calleridname','destinationchannel','toNumber','membername','name','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','replace','.WAV','monitorFilename','find','isNil','push','rec','variable','mixmonitor_filename','value','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','endtime','billableseconds','holdtime'];(function(_0x5e7913,_0x3d4099){var _0x1d50a2=function(_0x749a9b){while(--_0x749a9b){_0x5e7913['push'](_0x5e7913['shift']());}};_0x1d50a2(++_0x3d4099);}(_0xb271,0x145));var _0x1b27=function(_0x3f9429,_0x4ca31f){_0x3f9429=_0x3f9429-0x0;var _0x468149=_0xb271[_0x3f9429];return _0x468149;};'use strict';var BPromise=require(_0x1b27('0x0'));var _=require('lodash');var moment=require(_0x1b27('0x1'));var util=require(_0x1b27('0x2'));var path=require(_0x1b27('0x3'));var Redis=require(_0x1b27('0x4'));var config=require(_0x1b27('0x5'));var logger=require(_0x1b27('0x6'))(_0x1b27('0x7'));var ami=require(_0x1b27('0x8'));var Channel=require(_0x1b27('0x9'));var statusDesc=[_0x1b27('0xa'),_0x1b27('0xb'),_0x1b27('0xc'),_0x1b27('0xd'),_0x1b27('0xe'),_0x1b27('0xf'),_0x1b27('0x10'),_0x1b27('0x11'),_0x1b27('0x12')];var applications=[_0x1b27('0x13'),'queue',_0x1b27('0x14'),'dial',_0x1b27('0x15'),'voicemail'];var dispositions=['NO\x20ANSWER',_0x1b27('0x16'),_0x1b27('0x16'),_0x1b27('0x17'),'NO\x20ANSWER','NO\x20ANSWER',_0x1b27('0x18'),_0x1b27('0x19'),'FAILED',_0x1b27('0x16'),_0x1b27('0x16')];var actions={};config[_0x1b27('0x1a')]=_[_0x1b27('0x1b')](config[_0x1b27('0x1a')],{'host':_0x1b27('0x1c'),'port':0x18eb});var io=require(_0x1b27('0x1d'))(new Redis(config[_0x1b27('0x1a')]));function VoiceCallReport(_0x4a52e2){this['channels']=_0x4a52e2[_0x1b27('0x1e')];this['agents']=_0x4a52e2[_0x1b27('0x1f')];ami['on'](_0x1b27('0x20'),this[_0x1b27('0x21')]['bind'](this));ami['on'](_0x1b27('0x22'),this[_0x1b27('0x21')]['bind'](this));ami['on'](_0x1b27('0x23'),this[_0x1b27('0x24')]['bind'](this));ami['on'](_0x1b27('0x25'),this[_0x1b27('0x26')]['bind'](this));ami['on'](_0x1b27('0x27'),this['syncVarSet'][_0x1b27('0x28')](this));ami['on'](_0x1b27('0x29'),this['syncHangup'][_0x1b27('0x28')](this));ami['on'](_0x1b27('0x2a'),this['syncNewCallerId']['bind'](this));ami['on'](_0x1b27('0x2b'),this[_0x1b27('0x2c')][_0x1b27('0x28')](this));ami['on'](_0x1b27('0x2d'),this['syncBlindTransfer'][_0x1b27('0x28')](this));ami['on'](_0x1b27('0x2e'),this['syncMusicOnHoldStart'][_0x1b27('0x28')](this));ami['on'](_0x1b27('0x2f'),this[_0x1b27('0x30')]['bind'](this));return BPromise[_0x1b27('0x31')]()[_0x1b27('0x32')](ami[_0x1b27('0x33')]())['catch'](function(_0x5a289c){console['log'](_0x5a289c);});}VoiceCallReport[_0x1b27('0x34')]['isNotNull']=function(_0x42306d){return _0x42306d!==null&&!_[_0x1b27('0x35')](_0x42306d);};VoiceCallReport[_0x1b27('0x34')]['emit']=function(_0x4e9533,_0x229f7d,_0x586227){io['to'](_0x4e9533)['emit'](_0x229f7d,_0x586227);};VoiceCallReport[_0x1b27('0x34')][_0x1b27('0x36')]=function(_0x622064){try{if(this[_0x1b27('0x37')](_0x622064)){if(_0x622064[_0x1b27('0x38')]===_0x622064[_0x1b27('0x39')]){if(!_[_0x1b27('0x35')](this[_0x1b27('0x1e')][_0x622064[_0x1b27('0x38')]])){_[_0x1b27('0x3a')](this['channels'][_0x622064[_0x1b27('0x38')]],_[_0x1b27('0x3b')](_0x622064,_['keys'](this['channels'][_0x622064['uniqueid']])));}}}}catch(_0x45e1b6){logger[_0x1b27('0x3c')](_0x1b27('0x3d'),util[_0x1b27('0x3e')](_0x45e1b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b27('0x34')]['syncNewChannel']=function(_0x586385){try{if(this[_0x1b27('0x37')](_0x586385)){if(_0x586385['uniqueid']===_0x586385[_0x1b27('0x39')]&&_0x586385[_0x1b27('0x3f')]!=_0x1b27('0x40')){if(_[_0x1b27('0x35')](this['channels'][_0x586385[_0x1b27('0x38')]])){this[_0x1b27('0x1e')][_0x586385['uniqueid']]=new Channel();this[_0x1b27('0x1e')][_0x586385[_0x1b27('0x38')]][_0x1b27('0x41')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x1b27('0x1e')][_0x586385[_0x1b27('0x38')]][_0x1b27('0x42')]=dispositions[_['toNumber'](_0x586385['channelstate'])];_[_0x1b27('0x3a')](this[_0x1b27('0x1e')][_0x586385['uniqueid']],_['pick'](_0x586385,_[_0x1b27('0x43')](this[_0x1b27('0x1e')][_0x586385[_0x1b27('0x38')]])));if(_0x586385[_0x1b27('0x44')]==='from-sip'){if(this[_0x1b27('0x1f')][_0x586385[_0x1b27('0x3f')][_0x1b27('0x45')]('-')[0x0]]){this[_0x1b27('0x1f')][_0x586385[_0x1b27('0x3f')]['split']('-')[0x0]][_0x1b27('0x46')]=_0x586385[_0x1b27('0x47')];this['emit'](util[_0x1b27('0x48')](_0x1b27('0x49'),this[_0x1b27('0x1f')][_0x586385[_0x1b27('0x3f')]['split']('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x1b27('0x1f')][_0x586385[_0x1b27('0x3f')][_0x1b27('0x45')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x586385['exten']});}}}}}}catch(_0x2db2f9){logger[_0x1b27('0x3c')]('[syncNewChannel][VoiceCallReport]',util['inspect'](_0x2db2f9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b27('0x34')][_0x1b27('0x21')]=function(_0x36e2a1){try{if(this['isNotNull'](_0x36e2a1)){if(_0x36e2a1[_0x1b27('0x38')]===_0x36e2a1['linkedid']&&_0x36e2a1['exten']!='h'&&_0x36e2a1[_0x1b27('0x3f')]!=_0x1b27('0x40')){_0x36e2a1[_0x1b27('0x4a')]=_0x36e2a1['application'][_0x1b27('0x4b')]();_0x36e2a1['applicationdata']=(_0x36e2a1[_0x1b27('0x4c')]||_0x36e2a1[_0x1b27('0x4d')])[_0x1b27('0x4b')]();if(_[_0x1b27('0x35')](this['channels'][_0x36e2a1[_0x1b27('0x38')]])){this[_0x1b27('0x1e')][_0x36e2a1[_0x1b27('0x38')]]=new Channel();this[_0x1b27('0x1e')][_0x36e2a1[_0x1b27('0x38')]]['starttime']=_0x36e2a1[_0x1b27('0x4e')]?moment()['subtract'](moment[_0x1b27('0x4e')](_0x36e2a1['duration'])[_0x1b27('0x4f')](),'seconds')['format'](_0x1b27('0x50')):moment()[_0x1b27('0x48')](_0x1b27('0x50'));this[_0x1b27('0x1e')][_0x36e2a1[_0x1b27('0x38')]][_0x1b27('0x42')]=_0x1b27('0x17');}_[_0x1b27('0x3a')](this['channels'][_0x36e2a1['uniqueid']],_[_0x1b27('0x3b')](_0x36e2a1,_[_0x1b27('0x43')](this[_0x1b27('0x1e')][_0x36e2a1['uniqueid']])));if(_[_0x1b27('0x51')](applications,_0x36e2a1[_0x1b27('0x4a')])){this[_0x1b27('0x1e')][_0x36e2a1[_0x1b27('0x38')]][_0x1b27('0x52')]=_0x36e2a1[_0x1b27('0x4a')];this[_0x1b27('0x1e')][_0x36e2a1[_0x1b27('0x38')]]['lastdata']=_0x36e2a1[_0x1b27('0x4d')];if(_0x36e2a1[_0x1b27('0x4a')]===_0x1b27('0x13')&&_[_0x1b27('0x53')](_0x36e2a1[_0x1b27('0x4d')],_0x1b27('0x54'))){var _0x1c5260=_0x36e2a1[_0x1b27('0x4d')][_0x1b27('0x45')]('=');var _0x26bd40=_0x1c5260[0x0][_0x1b27('0x55')](/cdr\((.*)\)/);if(_0x26bd40){this[_0x1b27('0x1e')][_0x36e2a1[_0x1b27('0x38')]][_0x26bd40[0x1]]=_0x1c5260[0x1];}}else if(_0x36e2a1[_0x1b27('0x4a')]==='queue'){this[_0x1b27('0x1e')][_0x36e2a1[_0x1b27('0x38')]]['queue']=_0x36e2a1[_0x1b27('0x4d')][_0x1b27('0x45')](',')[0x0];}}}}}catch(_0x20c4fc){logger['error']('[syncNewExten][VoiceCallReport]',util[_0x1b27('0x3e')](_0x20c4fc,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x451a3e){try{if(this[_0x1b27('0x37')](_0x451a3e)){if(_0x451a3e[_0x1b27('0x38')]!==_0x451a3e['linkedid']){if(this[_0x1b27('0x1e')][_0x451a3e['linkedid']]){if(_0x451a3e[_0x1b27('0x56')]==='6'){if(!this[_0x1b27('0x1e')][_0x451a3e['linkedid']][_0x1b27('0x57')]){var _0x12e278=moment();this[_0x1b27('0x1e')][_0x451a3e[_0x1b27('0x39')]][_0x1b27('0x57')]=!![];this[_0x1b27('0x1e')][_0x451a3e[_0x1b27('0x39')]][_0x1b27('0x58')]=_0x12e278[_0x1b27('0x48')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x1b27('0x1e')][_0x451a3e[_0x1b27('0x39')]][_0x1b27('0x41')]){this[_0x1b27('0x1e')][_0x451a3e[_0x1b27('0x39')]]['holdtime']=_0x12e278[_0x1b27('0x59')](this['channels'][_0x451a3e[_0x1b27('0x39')]]['starttime'],_0x1b27('0x4f'));}}this[_0x1b27('0x1e')][_0x451a3e[_0x1b27('0x39')]][_0x1b27('0x39')]=_0x451a3e['uniqueid'];if(_0x451a3e[_0x1b27('0x5a')]!==_0x1b27('0x5b')){this[_0x1b27('0x1e')][_0x451a3e[_0x1b27('0x39')]]['connectedlinenum']=_0x451a3e[_0x1b27('0x5a')];}this[_0x1b27('0x1e')][_0x451a3e['linkedid']][_0x1b27('0x5c')]=_0x451a3e[_0x1b27('0x5d')];this[_0x1b27('0x1e')][_0x451a3e['linkedid']][_0x1b27('0x5e')]=_0x451a3e['channel'];this[_0x1b27('0x1e')][_0x451a3e[_0x1b27('0x39')]][_0x1b27('0x42')]=dispositions[_[_0x1b27('0x5f')](_0x451a3e[_0x1b27('0x56')])];if(this[_0x1b27('0x1f')][_0x451a3e[_0x1b27('0x3f')][_0x1b27('0x45')]('-')[0x0]]){this['channels'][_0x451a3e['linkedid']]['UserId']=this[_0x1b27('0x1f')][_0x451a3e[_0x1b27('0x3f')][_0x1b27('0x45')]('-')[0x0]]['id'];this['channels'][_0x451a3e[_0x1b27('0x39')]][_0x1b27('0x60')]=this[_0x1b27('0x1f')][_0x451a3e['channel'][_0x1b27('0x45')]('-')[0x0]][_0x1b27('0x61')];}}}}else{if(this['channels'][_0x451a3e[_0x1b27('0x38')]]){if(_0x451a3e['channelstate']==='6'){if(this['agents'][_0x451a3e[_0x1b27('0x3f')]['split']('-')[0x0]]){this[_0x1b27('0x1e')][_0x451a3e['uniqueid']][_0x1b27('0x62')]=this[_0x1b27('0x1f')][_0x451a3e[_0x1b27('0x3f')][_0x1b27('0x45')]('-')[0x0]]['id'];this['channels'][_0x451a3e[_0x1b27('0x38')]][_0x1b27('0x60')]=this[_0x1b27('0x1f')][_0x451a3e[_0x1b27('0x3f')][_0x1b27('0x45')]('-')[0x0]][_0x1b27('0x61')];}}}}}}catch(_0x11bd6c){logger[_0x1b27('0x3c')](_0x1b27('0x63'),util[_0x1b27('0x3e')](_0x11bd6c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b27('0x34')][_0x1b27('0x64')]=function(_0x3ab97d,_0x573b21){if(this[_0x1b27('0x1e')][_0x3ab97d]){this[_0x1b27('0x1e')][_0x3ab97d]['monitor']=!![];if(_['endsWith'](_0x573b21,'.wav49')){_0x573b21=_0x573b21[_0x1b27('0x65')]('.wav49',_0x1b27('0x66'));}this[_0x1b27('0x1e')][_0x3ab97d][_0x1b27('0x67')]=_0x573b21;var _0x5ad840=_[_0x1b27('0x68')](this['channels'][_0x3ab97d]['monitors'],{'filename':_0x573b21});if(_[_0x1b27('0x69')](_0x5ad840)){this[_0x1b27('0x1e')][_0x3ab97d]['monitors'][_0x1b27('0x6a')]({'filename':_0x573b21,'createdAt':moment()[_0x1b27('0x48')](_0x1b27('0x50')),'mixmonitorid':'','status':_0x1b27('0x6b')});}}};VoiceCallReport[_0x1b27('0x34')]['syncVarSet']=function(_0x3264fa){try{if(this['isNotNull'](_0x3264fa)){if(this[_0x1b27('0x1e')][_0x3264fa[_0x1b27('0x38')]]&&_0x3264fa['channel']!=_0x1b27('0x40')){if(this[_0x1b27('0x37')](_0x3264fa['variable'])){if(this[_0x1b27('0x37')](_0x3264fa[_0x1b27('0x6c')][_0x1b27('0x6d')])){this['syncMixMonitorFilename'](_0x3264fa[_0x1b27('0x38')],_0x3264fa['value']);}else if(this['isNotNull'](_0x3264fa[_0x1b27('0x6c')]['xmd-phone'])){this[_0x1b27('0x1e')][_0x3264fa['uniqueid']][_0x1b27('0x5a')]=_0x3264fa[_0x1b27('0x6e')];}else if(this[_0x1b27('0x37')](_0x3264fa[_0x1b27('0x6c')][_0x1b27('0x6f')])){this[_0x1b27('0x1e')][_0x3264fa['uniqueid']][_0x1b27('0x70')]=_0x3264fa[_0x1b27('0x6e')];}else if(this[_0x1b27('0x37')](_0x3264fa[_0x1b27('0x6c')][_0x1b27('0x71')])){this[_0x1b27('0x1e')][_0x3264fa[_0x1b27('0x38')]][_0x1b27('0x72')]=_0x3264fa[_0x1b27('0x6e')];}else if(this[_0x1b27('0x37')](_0x3264fa[_0x1b27('0x6c')][_0x1b27('0x73')])){this[_0x1b27('0x1e')][_0x3264fa[_0x1b27('0x38')]][_0x1b27('0x74')]=_0x3264fa[_0x1b27('0x6e')][_0x1b27('0x45')](',')[0x0];}else if(this[_0x1b27('0x37')](_0x3264fa['variable'][_0x1b27('0x75')])){this['channels'][_0x3264fa[_0x1b27('0x38')]][_0x1b27('0x76')]=_0x3264fa[_0x1b27('0x6e')];}else if(this[_0x1b27('0x37')](_0x3264fa[_0x1b27('0x6c')][_0x1b27('0x77')])){this[_0x1b27('0x1e')][_0x3264fa[_0x1b27('0x38')]][_0x1b27('0x78')]=_0x3264fa[_0x1b27('0x6e')];}else if(this['isNotNull'](_0x3264fa[_0x1b27('0x6c')]['xmd-callerid-preview'])){this['channels'][_0x3264fa[_0x1b27('0x38')]][_0x1b27('0x79')]=_0x3264fa[_0x1b27('0x6e')];}else if(this['isNotNull'](_0x3264fa[_0x1b27('0x6c')][_0x1b27('0x7a')])){this[_0x1b27('0x1e')][_0x3264fa[_0x1b27('0x38')]]['queue']=_0x3264fa[_0x1b27('0x6e')];}else if(this[_0x1b27('0x37')](_0x3264fa[_0x1b27('0x6c')][_0x1b27('0x7b')])){this[_0x1b27('0x1e')][_0x3264fa['uniqueid']][_0x1b27('0x7c')]=_0x3264fa['value'];}}}else if(this[_0x1b27('0x37')](_0x3264fa[_0x1b27('0x6c')]['mixmonitor_filename'])){if(_0x3264fa[_0x1b27('0x6e')]){var _0x28da6d=path['parse'](_0x3264fa[_0x1b27('0x6e')])[_0x1b27('0x61')];this[_0x1b27('0x64')](_0x28da6d,_0x3264fa[_0x1b27('0x6e')]);}}else if(this[_0x1b27('0x1e')][_0x3264fa[_0x1b27('0x39')]]){if(this[_0x1b27('0x37')](_0x3264fa[_0x1b27('0x6c')])){if(this[_0x1b27('0x37')](_0x3264fa[_0x1b27('0x6c')][_0x1b27('0x7b')])){this['channels'][_0x3264fa['linkedid']][_0x1b27('0x7d')]=_0x3264fa[_0x1b27('0x6e')];}}}}}catch(_0xcfe15f){logger[_0x1b27('0x3c')](_0x1b27('0x7e'),util[_0x1b27('0x3e')](_0xcfe15f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1b27('0x7f')]=function(_0x3fd772){try{if(this[_0x1b27('0x37')](_0x3fd772)){if(this['channels'][_0x3fd772['uniqueid']]){var _0x2086c6=moment();this[_0x1b27('0x1e')][_0x3fd772['uniqueid']][_0x1b27('0x80')]=_0x2086c6[_0x1b27('0x48')](_0x1b27('0x50'));this[_0x1b27('0x1e')][_0x3fd772['uniqueid']][_0x1b27('0x4e')]=_0x2086c6['diff'](this[_0x1b27('0x1e')][_0x3fd772[_0x1b27('0x38')]][_0x1b27('0x41')],_0x1b27('0x4f'));if(this[_0x1b27('0x1e')][_0x3fd772[_0x1b27('0x38')]][_0x1b27('0x57')]){this[_0x1b27('0x1e')][_0x3fd772[_0x1b27('0x38')]][_0x1b27('0x81')]=_0x2086c6[_0x1b27('0x59')](this[_0x1b27('0x1e')][_0x3fd772[_0x1b27('0x38')]]['answertime'],_0x1b27('0x4f'));this['channels'][_0x3fd772[_0x1b27('0x38')]][_0x1b27('0x82')]=this['channels'][_0x3fd772['uniqueid']][_0x1b27('0x4e')]-this['channels'][_0x3fd772[_0x1b27('0x38')]][_0x1b27('0x81')];}if(_0x3fd772[_0x1b27('0x44')]==='from-sip'){if(this[_0x1b27('0x1f')][_0x3fd772[_0x1b27('0x3f')][_0x1b27('0x45')]('-')[0x0]]){this[_0x1b27('0x1f')][_0x3fd772[_0x1b27('0x3f')]['split']('-')[0x0]]=_[_0x1b27('0x83')](this['agents'][_0x3fd772[_0x1b27('0x3f')][_0x1b27('0x45')]('-')[0x0]],[_0x1b27('0x46')]);this[_0x1b27('0x84')](util['format'](_0x1b27('0x49'),this[_0x1b27('0x1f')][_0x3fd772['channel'][_0x1b27('0x45')]('-')[0x0]][_0x1b27('0x61')]),'user:agentcomplete',{'destaccountcode':this['agents'][_0x3fd772[_0x1b27('0x3f')]['split']('-')[0x0]][_0x1b27('0x85')]});}}ami[_0x1b27('0x84')]('custom:voiceCallReport',this[_0x1b27('0x1e')][_0x3fd772['uniqueid']]);delete this[_0x1b27('0x1e')][_0x3fd772[_0x1b27('0x38')]];}}}catch(_0x4476bf){logger['error'](_0x1b27('0x86'),util[_0x1b27('0x3e')](_0x4476bf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b27('0x34')][_0x1b27('0x2c')]=function(_0x30ace9){try{if(this['isNotNull'](_0x30ace9)){if(this[_0x1b27('0x1e')][_0x30ace9[_0x1b27('0x87')]]){this[_0x1b27('0x1e')][_0x30ace9[_0x1b27('0x87')]][_0x1b27('0x88')]=_0x30ace9[_0x1b27('0x89')];this[_0x1b27('0x1e')][_0x30ace9[_0x1b27('0x87')]][_0x1b27('0x8a')]=_0x30ace9[_0x1b27('0x8b')];if(this[_0x1b27('0x1e')][_0x30ace9[_0x1b27('0x8c')]]){var _0x438e9f=this[_0x1b27('0x1e')][_0x30ace9[_0x1b27('0x8c')]];this[_0x1b27('0x1e')][_0x30ace9[_0x1b27('0x8c')]]=this['channels'][_0x30ace9[_0x1b27('0x87')]];this['channels'][_0x30ace9[_0x1b27('0x87')]]=_0x438e9f;}}else if(this['channels'][_0x30ace9[_0x1b27('0x8d')]]){this[_0x1b27('0x1e')][_0x30ace9['transfertargetuniqueid']]['transfercalleridnum']=_0x30ace9[_0x1b27('0x89')];this[_0x1b27('0x1e')][_0x30ace9[_0x1b27('0x8d')]][_0x1b27('0x8a')]=_0x30ace9[_0x1b27('0x8b')];if(this[_0x1b27('0x1e')][_0x30ace9[_0x1b27('0x8e')]]){var _0x438e9f=this['channels'][_0x30ace9[_0x1b27('0x8e')]];this[_0x1b27('0x1e')][_0x30ace9['origtransfereruniqueid']]=this[_0x1b27('0x1e')][_0x30ace9[_0x1b27('0x8d')]];this[_0x1b27('0x1e')][_0x30ace9['transfertargetuniqueid']]=_0x438e9f;}}}}catch(_0x3d406a){logger[_0x1b27('0x3c')](_0x1b27('0x8f'),util['inspect'](_0x3d406a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b27('0x34')]['syncBlindTransfer']=function(_0x1f1273){try{if(this[_0x1b27('0x37')](_0x1f1273)){if(this[_0x1b27('0x1e')][_0x1f1273[_0x1b27('0x87')]]){this[_0x1b27('0x1e')][_0x1f1273[_0x1b27('0x87')]][_0x1b27('0x88')]=_0x1f1273[_0x1b27('0x90')];this['channels'][_0x1f1273[_0x1b27('0x87')]][_0x1b27('0x8a')]=_0x1f1273[_0x1b27('0x91')];this[_0x1b27('0x7f')]({'event':_0x1b27('0x92'),'uniqueid':_0x1f1273[_0x1b27('0x87')],'context':_0x1f1273[_0x1b27('0x44')],'channel':_0x1f1273['transfererchannel']});}}}catch(_0x3f045a){logger[_0x1b27('0x3c')](_0x1b27('0x93'),util['inspect'](_0x3f045a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b27('0x34')]['syncMusicOnHoldStart']=function(_0x34fcd1){try{if(this[_0x1b27('0x37')](_0x34fcd1)){if(this[_0x1b27('0x1e')][_0x34fcd1[_0x1b27('0x38')]]){if(!_[_0x1b27('0x69')](this['channels'][_0x34fcd1[_0x1b27('0x38')]][_0x1b27('0x58')])){this['channels'][_0x34fcd1[_0x1b27('0x38')]][_0x1b27('0x94')]=moment()[_0x1b27('0x48')](_0x1b27('0x50'));}}}}catch(_0x4a8527){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util['inspect'](_0x4a8527,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b27('0x34')][_0x1b27('0x30')]=function(_0x320a3f){try{if(this['isNotNull'](_0x320a3f)){if(this[_0x1b27('0x1e')][_0x320a3f[_0x1b27('0x38')]]){if(!_[_0x1b27('0x69')](this['channels'][_0x320a3f['uniqueid']]['mohstarttime'])){this['channels'][_0x320a3f[_0x1b27('0x38')]][_0x1b27('0x95')]+=moment()[_0x1b27('0x96')](0x0)[_0x1b27('0x59')](this[_0x1b27('0x1e')][_0x320a3f[_0x1b27('0x38')]][_0x1b27('0x94')],_0x1b27('0x4f'));delete this['channels'][_0x320a3f[_0x1b27('0x38')]]['mohstarttime'];}}}}catch(_0xbd2b8b){logger['error'](_0x1b27('0x97'),util['inspect'](_0xbd2b8b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 25f5bd7..b81f414 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 _0xf4af=['syncDialBegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','channels','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','substring','omit','event','voice:outbound','voice_outbound_channel:save','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','connectedlinenum','connectedlinename','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','keys','variable','value','variables','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberrealtime','includes','endtime','duration','starttime','complete','total','answertime','answered','holdtime','diff','seconds','billableseconds','sumDuration','custom:voiceDialReport','custom:dialend','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','outboundChannels','outbound','dialbegin'];(function(_0x4a5946,_0x262f3a){var _0x3b7562=function(_0x1054e9){while(--_0x1054e9){_0x4a5946['push'](_0x4a5946['shift']());}};_0x3b7562(++_0x262f3a);}(_0xf4af,0xa4));var _0xff4a=function(_0xf23ae0,_0x13041f){_0xf23ae0=_0xf23ae0-0x0;var _0x441c81=_0xf4af[_0xf23ae0];return _0x441c81;};'use strict';var _=require(_0xff4a('0x0'));var moment=require(_0xff4a('0x1'));var util=require(_0xff4a('0x2'));var Redis=require(_0xff4a('0x3'));var config=require(_0xff4a('0x4'));var logger=require(_0xff4a('0x5'))('ami');var ami=require('../ami');config[_0xff4a('0x6')]=_[_0xff4a('0x7')](config[_0xff4a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xff4a('0x8'))(new Redis(config[_0xff4a('0x6')]));function VoiceDialReport(_0x494eda){this['channels']=_0x494eda[_0xff4a('0x9')];this[_0xff4a('0xa')]=_0x494eda[_0xff4a('0xa')];this['variables']={};ami['on'](_0xff4a('0xb'),this[_0xff4a('0xc')][_0xff4a('0xd')](this));ami['on']('dialend',this[_0xff4a('0xe')][_0xff4a('0xd')](this));ami['on'](_0xff4a('0xf'),this[_0xff4a('0x10')][_0xff4a('0xd')](this));ami['on'](_0xff4a('0x11'),this[_0xff4a('0x12')][_0xff4a('0xd')](this));}VoiceDialReport[_0xff4a('0x13')][_0xff4a('0x14')]=function(_0x3d4ef6){return _0x3d4ef6!==null&&!_[_0xff4a('0x15')](_0x3d4ef6);};VoiceDialReport[_0xff4a('0x13')][_0xff4a('0x16')]=function(_0x4ce94b,_0x368ac4,_0x25a4e5){io['to'](_0x4ce94b)['emit'](_0x368ac4,_0x25a4e5);};VoiceDialReport[_0xff4a('0x13')][_0xff4a('0xc')]=function(_0x254ce5){try{if(this['isNotNull'](_0x254ce5)){if(this[_0xff4a('0x17')][_0x254ce5['uniqueid']]){_[_0xff4a('0x18')](this[_0xff4a('0x17')][_0x254ce5[_0xff4a('0x19')]],{'starttime':moment()[_0xff4a('0x1a')](_0xff4a('0x1b')),'lastevent':_0xff4a('0x1c'),'interface':_0x254ce5['channel']['substring'](0x0,_0x254ce5[_0xff4a('0x1d')][_0xff4a('0x1e')]('-')),'membername':_0x254ce5[_0xff4a('0x1d')][_0xff4a('0x1f')](_0x254ce5['channel'][_0xff4a('0x1e')]('/')+0x1,_0x254ce5['channel'][_0xff4a('0x1e')]('-'))},_[_0xff4a('0x20')](_0x254ce5,[_0xff4a('0x21'),'privilege']));this[_0xff4a('0x16')](_0xff4a('0x22'),_0xff4a('0x23'),this['channels'][_0x254ce5['uniqueid']]);ami['emit']('custom:dialbegin',this[_0xff4a('0x17')][_0x254ce5[_0xff4a('0x19')]]);}}}catch(_0x81ba7b){logger[_0xff4a('0x24')](_0xff4a('0x25'),util[_0xff4a('0x26')](_0x81ba7b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xff4a('0x13')][_0xff4a('0xe')]=function(_0x5a5af6){try{if(this['isNotNull'](_0x5a5af6)){if(this['channels'][_0x5a5af6['uniqueid']]){this[_0xff4a('0x17')][_0x5a5af6[_0xff4a('0x19')]][_0xff4a('0x27')]=_0x5a5af6[_0xff4a('0x27')];if(_0x5a5af6[_0xff4a('0x27')]==='ANSWER'){this['channels'][_0x5a5af6[_0xff4a('0x19')]][_0xff4a('0x28')]=_0x5a5af6[_0xff4a('0x28')];this[_0xff4a('0x17')][_0x5a5af6[_0xff4a('0x19')]][_0xff4a('0x29')]=_0x5a5af6[_0xff4a('0x29')];this[_0xff4a('0x17')][_0x5a5af6[_0xff4a('0x19')]]['answertime']=moment()[_0xff4a('0x1a')](_0xff4a('0x1b'));this[_0xff4a('0x17')][_0x5a5af6['uniqueid']][_0xff4a('0x2a')]=_0xff4a('0x2b');ami['emit'](_0xff4a('0x2c'),this['channels'][_0x5a5af6[_0xff4a('0x19')]]);}this[_0xff4a('0x16')]('voice:outbound',_0xff4a('0x23'),this[_0xff4a('0x17')][_0x5a5af6[_0xff4a('0x19')]]);}}}catch(_0x486c01){logger[_0xff4a('0x24')](_0xff4a('0x2d'),util[_0xff4a('0x26')](_0x486c01,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xff4a('0x10')]=function(_0x3e851f){try{if(this[_0xff4a('0x14')](_0x3e851f)){this['addVariable'](_0x3e851f[_0xff4a('0x19')],_[_0xff4a('0x2e')](_0x3e851f[_0xff4a('0x2f')])[0x0],_0x3e851f[_0xff4a('0x30')]);if(this[_0xff4a('0x14')](_0x3e851f[_0xff4a('0x2f')])&&this['isNotNull'](_0x3e851f[_0xff4a('0x2f')]['outboundrouteid'])){if(_[_0xff4a('0x15')](this[_0xff4a('0x17')][_0x3e851f[_0xff4a('0x19')]])){this[_0xff4a('0x17')][_0x3e851f[_0xff4a('0x19')]]={'routeId':_0x3e851f['value'],'variables':this[_0xff4a('0x31')][_0x3e851f[_0xff4a('0x19')]]};this['emit'](_0xff4a('0x22'),_0xff4a('0x23'),this['channels'][_0x3e851f['uniqueid']]);}}}}catch(_0x3c9b0b){logger['error'](_0xff4a('0x32'),util[_0xff4a('0x26')](_0x3c9b0b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xff4a('0x13')][_0xff4a('0x33')]=function(_0x39a3f1,_0x541b53,_0x1c9634){var _0x10a7d8=[_0xff4a('0x34'),'rtpaudioqosbridged',_0xff4a('0x35'),_0xff4a('0x36'),_0xff4a('0x37'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xff4a('0x38'),_0xff4a('0x39'),_0xff4a('0x3a'),_0xff4a('0x3b'),_0xff4a('0x3c'),_0xff4a('0x3d'),_0xff4a('0x3e'),_0xff4a('0x3f'),_0xff4a('0x40'),_0xff4a('0x41'),'memberpenalty',_0xff4a('0x42')];if(!_['isNil'](_0x541b53)&&!_[_0xff4a('0x43')](_0x10a7d8,_0x541b53)){if(_[_0xff4a('0x15')](this[_0xff4a('0x31')][_0x39a3f1])){this[_0xff4a('0x31')][_0x39a3f1]={};}this['variables'][_0x39a3f1][_0x541b53]=_0x1c9634;}};VoiceDialReport[_0xff4a('0x13')][_0xff4a('0x12')]=function(_0x15d083){try{if(this[_0xff4a('0x14')](_0x15d083)){if(this['channels'][_0x15d083[_0xff4a('0x19')]]){this['channels'][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x44')]=moment()[_0xff4a('0x1a')](_0xff4a('0x1b'));this[_0xff4a('0x17')][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x45')]=moment(this[_0xff4a('0x17')][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x44')])['diff'](this['channels'][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x46')],'seconds');this['channels'][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x2a')]=_0xff4a('0x47');this['outbound'][_0xff4a('0x48')]+=0x1;if(this[_0xff4a('0x17')][_0x15d083['uniqueid']][_0xff4a('0x49')]){this['outbound'][_0xff4a('0x4a')]+=0x1;this['channels'][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x4b')]=moment(this[_0xff4a('0x17')][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x49')])[_0xff4a('0x4c')](this[_0xff4a('0x17')][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x46')],_0xff4a('0x4d'));this[_0xff4a('0x17')][_0x15d083['uniqueid']][_0xff4a('0x4e')]=moment(this[_0xff4a('0x17')][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x44')])[_0xff4a('0x4c')](this[_0xff4a('0x17')][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x49')],_0xff4a('0x4d'));this[_0xff4a('0xa')]['sumHoldTime']+=this[_0xff4a('0x17')][_0x15d083['uniqueid']][_0xff4a('0x4b')]||0x0;this[_0xff4a('0xa')]['sumBillable']+=this['channels'][_0x15d083[_0xff4a('0x19')]][_0xff4a('0x4e')];}this[_0xff4a('0xa')][_0xff4a('0x4f')]+=this[_0xff4a('0x17')][_0x15d083[_0xff4a('0x19')]]['duration'];ami[_0xff4a('0x16')](_0xff4a('0x50'),this[_0xff4a('0x17')][_0x15d083['uniqueid']]);ami[_0xff4a('0x16')](_0xff4a('0x51'),this[_0xff4a('0x17')][_0x15d083[_0xff4a('0x19')]]);this[_0xff4a('0x16')](_0xff4a('0x22'),'voice_outbound:save',this[_0xff4a('0xa')]);logger[_0xff4a('0x52')](_0xff4a('0x53'),JSON[_0xff4a('0x54')](this[_0xff4a('0x17')][_0x15d083[_0xff4a('0x19')]]));this[_0xff4a('0x16')]('voice:outbound',_0xff4a('0x55'),this['channels'][_0x15d083[_0xff4a('0x19')]]);delete this['channels'][_0x15d083[_0xff4a('0x19')]];}if(this[_0xff4a('0x31')][_0x15d083[_0xff4a('0x19')]]){delete this['variables'][_0x15d083['uniqueid']];}}}catch(_0x46b2d2){logger[_0xff4a('0x24')](_0xff4a('0x56'),util[_0xff4a('0x26')](_0x46b2d2,{'showHidden':![],'depth':null}));}};module[_0xff4a('0x57')]=VoiceDialReport; \ No newline at end of file +var _0x46b9=['prototype','emit','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','custom:dialbegin','error','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','format','lastevent','custom:dialconnect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','keys','variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','endtime','duration','diff','starttime','seconds','complete','answertime','answered','sumHoldTime','sumBillable','billableseconds','sumDuration','custom:dialend','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','syncDialBegin','bind','dialend','syncDialEnd','hangup','syncHangup','isNotNull','isUndefined'];(function(_0x480b2f,_0x34fb03){var _0x5757ff=function(_0x3b12e9){while(--_0x3b12e9){_0x480b2f['push'](_0x480b2f['shift']());}};_0x5757ff(++_0x34fb03);}(_0x46b9,0x13e));var _0x946b=function(_0x72e02f,_0x239589){_0x72e02f=_0x72e02f-0x0;var _0x9ff02c=_0x46b9[_0x72e02f];return _0x9ff02c;};'use strict';var _=require(_0x946b('0x0'));var moment=require(_0x946b('0x1'));var util=require('util');var Redis=require(_0x946b('0x2'));var config=require(_0x946b('0x3'));var logger=require(_0x946b('0x4'))(_0x946b('0x5'));var ami=require(_0x946b('0x6'));config[_0x946b('0x7')]=_['defaults'](config[_0x946b('0x7')],{'host':_0x946b('0x8'),'port':0x18eb});var io=require(_0x946b('0x9'))(new Redis(config['redis']));function VoiceDialReport(_0x464863){this[_0x946b('0xa')]=_0x464863[_0x946b('0xb')];this[_0x946b('0xc')]=_0x464863[_0x946b('0xc')];this[_0x946b('0xd')]={};ami['on']('dialbegin',this[_0x946b('0xe')][_0x946b('0xf')](this));ami['on'](_0x946b('0x10'),this[_0x946b('0x11')][_0x946b('0xf')](this));ami['on']('varset',this['syncVarSet'][_0x946b('0xf')](this));ami['on'](_0x946b('0x12'),this[_0x946b('0x13')][_0x946b('0xf')](this));}VoiceDialReport['prototype'][_0x946b('0x14')]=function(_0xdf92aa){return _0xdf92aa!==null&&!_[_0x946b('0x15')](_0xdf92aa);};VoiceDialReport[_0x946b('0x16')][_0x946b('0x17')]=function(_0x445239,_0x22b532,_0x543b14){io['to'](_0x445239)['emit'](_0x22b532,_0x543b14);};VoiceDialReport[_0x946b('0x16')]['syncDialBegin']=function(_0x45b6d0){try{if(this[_0x946b('0x14')](_0x45b6d0)){if(this['channels'][_0x45b6d0[_0x946b('0x18')]]){_[_0x946b('0x19')](this[_0x946b('0xa')][_0x45b6d0[_0x946b('0x18')]],{'starttime':moment()['format'](_0x946b('0x1a')),'lastevent':_0x946b('0x1b'),'interface':_0x45b6d0[_0x946b('0x1c')][_0x946b('0x1d')](0x0,_0x45b6d0[_0x946b('0x1c')][_0x946b('0x1e')]('-')),'membername':_0x45b6d0['channel'][_0x946b('0x1d')](_0x45b6d0[_0x946b('0x1c')][_0x946b('0x1e')]('/')+0x1,_0x45b6d0[_0x946b('0x1c')][_0x946b('0x1e')]('-'))},_[_0x946b('0x1f')](_0x45b6d0,[_0x946b('0x20'),_0x946b('0x21')]));this[_0x946b('0x17')](_0x946b('0x22'),'voice_outbound_channel:save',this[_0x946b('0xa')][_0x45b6d0[_0x946b('0x18')]]);ami[_0x946b('0x17')](_0x946b('0x23'),this[_0x946b('0xa')][_0x45b6d0[_0x946b('0x18')]]);}}}catch(_0x221516){logger[_0x946b('0x24')]('[syncDialBegin][VoiceDialReport]',util[_0x946b('0x25')](_0x221516,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x946b('0x16')][_0x946b('0x11')]=function(_0x22e026){try{if(this['isNotNull'](_0x22e026)){if(this[_0x946b('0xa')][_0x22e026[_0x946b('0x18')]]){this['channels'][_0x22e026[_0x946b('0x18')]]['dialstatus']=_0x22e026[_0x946b('0x26')];if(_0x22e026[_0x946b('0x26')]===_0x946b('0x27')){this[_0x946b('0xa')][_0x22e026['uniqueid']][_0x946b('0x28')]=_0x22e026['connectedlinenum'];this['channels'][_0x22e026[_0x946b('0x18')]][_0x946b('0x29')]=_0x22e026[_0x946b('0x29')];this[_0x946b('0xa')][_0x22e026[_0x946b('0x18')]]['answertime']=moment()[_0x946b('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x22e026['uniqueid']][_0x946b('0x2b')]='connect';ami['emit'](_0x946b('0x2c'),this[_0x946b('0xa')][_0x22e026['uniqueid']]);}this['emit'](_0x946b('0x22'),_0x946b('0x2d'),this[_0x946b('0xa')][_0x22e026[_0x946b('0x18')]]);}}}catch(_0x53683b){logger[_0x946b('0x24')](_0x946b('0x2e'),util['inspect'](_0x53683b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x946b('0x16')]['syncVarSet']=function(_0x2e22ea){try{if(this[_0x946b('0x14')](_0x2e22ea)){this['addVariable'](_0x2e22ea['uniqueid'],_[_0x946b('0x2f')](_0x2e22ea[_0x946b('0x30')])[0x0],_0x2e22ea[_0x946b('0x31')]);if(this[_0x946b('0x14')](_0x2e22ea[_0x946b('0x30')])&&this[_0x946b('0x14')](_0x2e22ea[_0x946b('0x30')]['outboundrouteid'])){if(_[_0x946b('0x15')](this[_0x946b('0xa')][_0x2e22ea[_0x946b('0x18')]])){this[_0x946b('0xa')][_0x2e22ea[_0x946b('0x18')]]={'routeId':_0x2e22ea[_0x946b('0x31')],'variables':this['variables'][_0x2e22ea[_0x946b('0x18')]]};this['emit'](_0x946b('0x22'),'voice_outbound_channel:save',this['channels'][_0x2e22ea['uniqueid']]);}}}}catch(_0x4de239){logger[_0x946b('0x24')]('[syncVarSet][VoiceDialReport]',util[_0x946b('0x25')](_0x4de239,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x946b('0x16')]['addVariable']=function(_0x54eb85,_0x48e3a7,_0x42d148){var _0x918dd8=[_0x946b('0x32'),_0x946b('0x33'),_0x946b('0x34'),_0x946b('0x35'),_0x946b('0x36'),_0x946b('0x37'),'rtpaudioqosrtt',_0x946b('0x38'),_0x946b('0x39'),_0x946b('0x3a'),_0x946b('0x3b'),'bridgepvtcallid',_0x946b('0x3c'),'memberdynamic',_0x946b('0x3d'),_0x946b('0x3e'),_0x946b('0x3f'),_0x946b('0x40'),'memberrealtime'];if(!_[_0x946b('0x41')](_0x48e3a7)&&!_[_0x946b('0x42')](_0x918dd8,_0x48e3a7)){if(_[_0x946b('0x15')](this[_0x946b('0xd')][_0x54eb85])){this[_0x946b('0xd')][_0x54eb85]={};}this['variables'][_0x54eb85][_0x48e3a7]=_0x42d148;}};VoiceDialReport[_0x946b('0x16')][_0x946b('0x13')]=function(_0x46bdf8){try{if(this['isNotNull'](_0x46bdf8)){if(this[_0x946b('0xa')][_0x46bdf8['uniqueid']]){this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]][_0x946b('0x43')]=moment()[_0x946b('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]][_0x946b('0x44')]=moment(this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]][_0x946b('0x43')])[_0x946b('0x45')](this[_0x946b('0xa')][_0x46bdf8['uniqueid']][_0x946b('0x46')],_0x946b('0x47'));this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]][_0x946b('0x2b')]=_0x946b('0x48');this[_0x946b('0xc')]['total']+=0x1;if(this[_0x946b('0xa')][_0x46bdf8['uniqueid']][_0x946b('0x49')]){this['outbound'][_0x946b('0x4a')]+=0x1;this['channels'][_0x46bdf8[_0x946b('0x18')]]['holdtime']=moment(this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]]['answertime'])[_0x946b('0x45')](this['channels'][_0x46bdf8[_0x946b('0x18')]][_0x946b('0x46')],_0x946b('0x47'));this['channels'][_0x46bdf8['uniqueid']]['billableseconds']=moment(this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]][_0x946b('0x43')])[_0x946b('0x45')](this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]][_0x946b('0x49')],_0x946b('0x47'));this['outbound'][_0x946b('0x4b')]+=this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]]['holdtime']||0x0;this[_0x946b('0xc')][_0x946b('0x4c')]+=this['channels'][_0x46bdf8[_0x946b('0x18')]][_0x946b('0x4d')];}this['outbound'][_0x946b('0x4e')]+=this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]][_0x946b('0x44')];ami[_0x946b('0x17')]('custom:voiceDialReport',this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]]);ami[_0x946b('0x17')](_0x946b('0x4f'),this[_0x946b('0xa')][_0x46bdf8[_0x946b('0x18')]]);this[_0x946b('0x17')](_0x946b('0x22'),_0x946b('0x50'),this[_0x946b('0xc')]);logger[_0x946b('0x51')](_0x946b('0x52'),JSON['stringify'](this['channels'][_0x46bdf8[_0x946b('0x18')]]));this[_0x946b('0x17')](_0x946b('0x22'),_0x946b('0x53'),this[_0x946b('0xa')][_0x46bdf8['uniqueid']]);delete this[_0x946b('0xa')][_0x46bdf8['uniqueid']];}if(this[_0x946b('0xd')][_0x46bdf8[_0x946b('0x18')]]){delete this['variables'][_0x46bdf8['uniqueid']];}}}catch(_0x209b4b){logger['error'](_0x946b('0x54'),util['inspect'](_0x209b4b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 9939b76..3d8ecf1 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 _0x8ad7=['queuecallerexit','reason','transfer','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferuniqueid','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','queuestatus','CONTINUE','queuecallerexitAt','EXITWITHKEY','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','length','abandoned','sumDuration','diff','lastevent','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','context','transfererchannel','[syncMusicOnHoldStart][VoiceQueueReport]','syncMusicOnHoldStop','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceQueueReport]','lodash','moment','bluebird','util','md5','../../../config/environment','../../../config/logger','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','channels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','blindtransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','clearZombieChannels','switch','enqueue','isNil','Action','status','channel','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','variables','[voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','emit','format','voice:queue:%s','name','voice_queue_channel:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','total','unmanaged','Trunk','callerid','Interval','voice_queue:save','isNotNull','isUndefined','queues','[queues]','then','queue','countBy','toNumber','loggedin','callers','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','inspect','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','emitVoiceQueueChannelSave','syncQueueCallerAbandon','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','lastAssignedTo','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','[syncQueueCallerLeave][VoiceQueueReport]','queuecallerexitreason','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','membername'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8ad7,0x100));var _0x78ad=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8ad7[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x78ad('0x0'));var moment=require(_0x78ad('0x1'));var BPromise=require(_0x78ad('0x2'));var util=require(_0x78ad('0x3'));var md5=require(_0x78ad('0x4'));var Redis=require('ioredis');var config=require(_0x78ad('0x5'));var logger=require(_0x78ad('0x6'))('ami');var ami=require('../ami');var QueueReport=require(_0x78ad('0x7'));config[_0x78ad('0x8')]=_[_0x78ad('0x9')](config[_0x78ad('0x8')],{'host':_0x78ad('0xa'),'port':0x18eb});var io=require(_0x78ad('0xb'))(new Redis(config[_0x78ad('0x8')]));var Sequence=function(){};Sequence[_0x78ad('0xc')]['enqueue']=function(_0x47fa5f){this[_0x78ad('0xd')]=this[_0x78ad('0xd')]?this[_0x78ad('0xd')][_0x78ad('0xe')](_0x47fa5f):_0x47fa5f();};function VoiceQueueReport(_0x1e4a6c){this[_0x78ad('0xf')]=new Sequence();this[_0x78ad('0x10')]={};this[_0x78ad('0x11')]=_0x1e4a6c[_0x78ad('0x11')];this[_0x78ad('0x12')]=_0x1e4a6c['queueChannels'];this[_0x78ad('0x13')]=_0x1e4a6c['voiceQueues'];this[_0x78ad('0x14')]=!![];this[_0x78ad('0x15')]=_0x1e4a6c[_0x78ad('0x15')];this['variables']={};ami['on'](_0x78ad('0x16'),this[_0x78ad('0x17')][_0x78ad('0x18')](this));ami['on']('queuesummarycomplete',this[_0x78ad('0x19')][_0x78ad('0x18')](this));ami['on'](_0x78ad('0x1a'),this[_0x78ad('0x1b')][_0x78ad('0x18')](this));ami['on'](_0x78ad('0x1c'),this['syncQueueCallerAbandon'][_0x78ad('0x18')](this));ami['on'](_0x78ad('0x1d'),this['syncQueueCallerLeave'][_0x78ad('0x18')](this));ami['on'](_0x78ad('0x1e'),this[_0x78ad('0x1f')][_0x78ad('0x18')](this));ami['on']('agentconnect',this[_0x78ad('0x20')][_0x78ad('0x18')](this));ami['on'](_0x78ad('0x21'),this[_0x78ad('0x22')][_0x78ad('0x18')](this));ami['on']('hangup',this[_0x78ad('0x23')]['bind'](this));ami['on'](_0x78ad('0x24'),this[_0x78ad('0x25')][_0x78ad('0x18')](this));ami['on']('musiconholdstart',this[_0x78ad('0x26')][_0x78ad('0x18')](this));ami['on'](_0x78ad('0x27'),this['syncMusicOnHoldStop'][_0x78ad('0x18')](this));ami['on']('attendedtransfer',this[_0x78ad('0x28')][_0x78ad('0x18')](this));ami['on'](_0x78ad('0x29'),this['syncBlindTransfer'][_0x78ad('0x18')](this));this[_0x78ad('0x2a')]();this[_0x78ad('0x2b')]();}function isNotNull(_0x414f04){return _0x414f04!==null&&!_['isUndefined'](_0x414f04);}function clearChannels(_0x4dd0b2){if(!_[_0x78ad('0x2c')](_0x4dd0b2)){for(var _0x59a568 in _0x4dd0b2){if(_0x4dd0b2[_0x78ad('0x2d')](_0x59a568)){delete _0x4dd0b2[_0x59a568];}}}}function clearCampaigns(_0x3b7c53){if(!_['isEmpty'](_0x3b7c53)){for(var _0xf7a2df in _0x3b7c53){if(_0x3b7c53[_0x78ad('0x2d')](_0xf7a2df)){_0x3b7c53[_0xf7a2df][_0x78ad('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x5c8dbd){if(!_[_0x78ad('0x2c')](_0x5c8dbd)){for(var _0x316b14 in _0x5c8dbd){if(_0x5c8dbd[_0x78ad('0x2d')](_0x316b14)){_0x5c8dbd[_0x316b14][_0x78ad('0x2e')]=0x0;_0x5c8dbd[_0x316b14][_0x78ad('0x2f')]=0x0;_0x5c8dbd[_0x316b14][_0x78ad('0x30')]=0x0;_0x5c8dbd[_0x316b14][_0x78ad('0x31')]=0x0;_0x5c8dbd[_0x316b14]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x32dd1f){if(!_['isEmpty'](_0x32dd1f)){for(var _0x1d3220 in _0x32dd1f){if(_0x32dd1f['hasOwnProperty'](_0x1d3220)){_0x32dd1f[_0x1d3220][_0x78ad('0x32')]=!![];}}}}VoiceQueueReport['prototype'][_0x78ad('0x33')]=function(){var _0x88e67d=this;for(var _0x4645f2 in this[_0x78ad('0x12')]){if(this['channels'][_0x78ad('0x2d')](_0x4645f2)&&!this[_0x78ad('0x12')][_0x4645f2][_0x78ad('0x34')]){this['sequence'][_0x78ad('0x35')](function(){if(!_[_0x78ad('0x36')](_0x88e67d[_0x78ad('0x12')][_0x4645f2])){return ami[_0x78ad('0x37')]({'action':_0x78ad('0x38'),'channel':_0x88e67d[_0x78ad('0x12')][_0x4645f2][_0x78ad('0x39')]})['catch'](function(_0x30100e){if(_0x30100e['message']===_0x78ad('0x3a')){setTimeout(function(){if(_0x88e67d[_0x78ad('0x12')][_0x4645f2]){delete _0x88e67d[_0x78ad('0x12')][_0x4645f2];logger[_0x78ad('0x3b')](_0x78ad('0x3c'),_0x4645f2);}if(_0x88e67d[_0x78ad('0x10')][_0x4645f2]){delete _0x88e67d['queueReports'][_0x4645f2];logger['error'](_0x78ad('0x3d'),_0x4645f2);}if(_0x88e67d[_0x78ad('0x3e')][_0x4645f2]){delete _0x88e67d['variables'][_0x4645f2];logger['error'](_0x78ad('0x3f'),_0x4645f2);}},0x1f40);}});}});}}};VoiceQueueReport[_0x78ad('0xc')]['syncFullyBooted']=function(){logger[_0x78ad('0x3b')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x78ad('0x12')]);this[_0x78ad('0x40')](this[_0x78ad('0x10')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x40')]=function(_0x27c4f5){var _0x379716=this;if(!_[_0x78ad('0x2c')](_0x27c4f5)){for(var _0x15c751 in _0x27c4f5){if(_0x27c4f5['hasOwnProperty'](_0x15c751)){_0x379716[_0x78ad('0x41')](_0x27c4f5[_0x15c751]);delete _0x27c4f5[_0x15c751];}}}};function loggerCatch(_0x21efc0){return function(_0x113ee9){logger[_0x78ad('0x3b')](_0x21efc0,util['inspect'](_0x113ee9,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x42')]=function(_0x36eaf5,_0x5d9d55,_0x200f83){io['to'](_0x36eaf5)[_0x78ad('0x42')](_0x5d9d55,_0x200f83);};VoiceQueueReport[_0x78ad('0xc')]['emitVoiceQueueChannelSave']=function(_0x19fa97){this[_0x78ad('0x42')](util[_0x78ad('0x43')](_0x78ad('0x44'),_0x19fa97[_0x78ad('0x45')]),_0x78ad('0x46'),_0x19fa97);};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x41')]=function(_0x3da094){logger[_0x78ad('0x47')](_0x78ad('0x48'),JSON[_0x78ad('0x49')](_0x3da094));this[_0x78ad('0x42')](util[_0x78ad('0x43')](_0x78ad('0x44'),_0x3da094[_0x78ad('0x45')]),_0x78ad('0x4a'),_0x3da094);};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x4b')]=function(_0x31e0c6){if(_0x31e0c6[_0x78ad('0x4c')]===_0x78ad('0x4d')){var _0x5008ba={'id':_0x31e0c6['id'],'name':_0x31e0c6[_0x78ad('0x45')],'strategy':_0x31e0c6[_0x78ad('0x4e')],'answered':_0x31e0c6[_0x78ad('0x4f')],'available':_0x31e0c6[_0x78ad('0x50')],'loggedIn':_0x31e0c6[_0x78ad('0x51')],'pTalking':_0x31e0c6['pTalking'],'sumBillable':_0x31e0c6[_0x78ad('0x52')],'sumDuration':_0x31e0c6['sumDuration'],'sumHoldTime':_0x31e0c6[_0x78ad('0x53')]||0x0,'talking':_0x31e0c6[_0x78ad('0x2f')],'total':_0x31e0c6[_0x78ad('0x54')],'type':_0x31e0c6[_0x78ad('0x4c')],'unmanaged':_0x31e0c6[_0x78ad('0x55')],'abandoned':_0x31e0c6['abandoned'],'waiting':_0x31e0c6[_0x78ad('0x31')]};if(_0x31e0c6[_0x78ad('0x56')]){_0x5008ba[_0x78ad('0x56')]={'id':_0x31e0c6['Trunk']['id'],'name':_0x31e0c6[_0x78ad('0x56')][_0x78ad('0x45')],'active':_0x31e0c6['Trunk']['active'],'callerid':_0x31e0c6[_0x78ad('0x56')][_0x78ad('0x57')]};}if(_0x31e0c6['Interval']){_0x5008ba['Interval']={'id':_0x31e0c6[_0x78ad('0x58')]['id'],'name':_0x31e0c6['Interval'][_0x78ad('0x45')]};}var _0xdf9316=md5(JSON[_0x78ad('0x49')](_0x5008ba));if(_0x31e0c6[_0x78ad('0x4')]!==_0xdf9316){_0x31e0c6['md5']=_0xdf9316;this[_0x78ad('0x42')](util[_0x78ad('0x43')](_0x78ad('0x44'),_0x5008ba[_0x78ad('0x45')]),_0x78ad('0x59'),_0x5008ba);}}};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x5a')]=function(_0x6f05ae){return _0x6f05ae!==null&&!_[_0x78ad('0x5b')](_0x6f05ae);};VoiceQueueReport['prototype'][_0x78ad('0x2b')]=function(){var _0x22bd01=this;setInterval(function(){_0x22bd01['clearZombieChannels']();ami[_0x78ad('0x37')]({'action':_0x78ad('0x5c')})['catch'](loggerCatch(_0x78ad('0x5d')));},0x2710);};VoiceQueueReport[_0x78ad('0xc')]['loopQueueSummary']=function(){var _0x21a126=this;setInterval(function(){if(_0x21a126[_0x78ad('0x14')]){return ami[_0x78ad('0x37')]({'action':_0x78ad('0x16')})[_0x78ad('0x5e')](function(_0xd6efe1){_0x21a126[_0x78ad('0x14')]=![];})['catch'](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport['prototype'][_0x78ad('0x17')]=function(_0x46f63e){try{if(this[_0x78ad('0x5a')](_0x46f63e)&&this['isNotNull'](_0x46f63e[_0x78ad('0x5f')])){if(this['voiceQueues'][_0x46f63e[_0x78ad('0x5f')]]){var _0x138a69=_[_0x78ad('0x60')](this[_0x78ad('0x12')],_0x78ad('0x5f'))[_0x46f63e[_0x78ad('0x5f')]]||0x0;var _0x16cf98=_0x138a69-_0x46f63e['callers'];if(this[_0x78ad('0x13')][_0x46f63e[_0x78ad('0x5f')]]['waiting']!==_[_0x78ad('0x61')](_0x46f63e['callers'])||this[_0x78ad('0x13')][_0x46f63e[_0x78ad('0x5f')]][_0x78ad('0x51')]!==_[_0x78ad('0x61')](_0x46f63e[_0x78ad('0x62')])||this['voiceQueues'][_0x46f63e[_0x78ad('0x5f')]][_0x78ad('0x50')]!==_[_0x78ad('0x61')](_0x46f63e[_0x78ad('0x50')])||this[_0x78ad('0x13')][_0x46f63e['queue']]['talking']!==_0x16cf98){this[_0x78ad('0x13')][_0x46f63e[_0x78ad('0x5f')]][_0x78ad('0x31')]=_[_0x78ad('0x61')](_0x46f63e[_0x78ad('0x63')]);this[_0x78ad('0x13')][_0x46f63e[_0x78ad('0x5f')]][_0x78ad('0x51')]=_[_0x78ad('0x61')](_0x46f63e['loggedin']);this[_0x78ad('0x13')][_0x46f63e[_0x78ad('0x5f')]]['available']=_['toNumber'](_0x46f63e[_0x78ad('0x50')]);this['voiceQueues'][_0x46f63e[_0x78ad('0x5f')]][_0x78ad('0x2f')]=_0x16cf98>0x0?_0x16cf98:0x0;this[_0x78ad('0x13')][_0x46f63e[_0x78ad('0x5f')]][_0x78ad('0x2f')]=this['voiceQueues'][_0x46f63e[_0x78ad('0x5f')]][_0x78ad('0x2f')]>_['toNumber'](_0x46f63e[_0x78ad('0x62')])?_[_0x78ad('0x61')](_0x46f63e[_0x78ad('0x62')]):this[_0x78ad('0x13')][_0x46f63e[_0x78ad('0x5f')]][_0x78ad('0x2f')];this[_0x78ad('0x4b')](this[_0x78ad('0x13')][_0x46f63e[_0x78ad('0x5f')]]);}ami[_0x78ad('0x42')](_0x78ad('0x64'),this[_0x78ad('0x13')][_0x46f63e['queue']]);}}}catch(_0x4dd1dd){logger[_0x78ad('0x3b')](_0x78ad('0x65'),util[_0x78ad('0x66')](_0x4dd1dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x78ad('0x19')]=function(_0x430dab){this[_0x78ad('0x14')]=!![];};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x67')]=function(_0x34211d){};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x1b')]=function(_0x4dd98b){try{if(this[_0x78ad('0x5a')](_0x4dd98b)){if(_[_0x78ad('0x5b')](this[_0x78ad('0x10')][_0x4dd98b[_0x78ad('0x68')]])){this['queueReports'][_0x4dd98b[_0x78ad('0x68')]]=[];this[_0x78ad('0x12')][_0x4dd98b['uniqueid']]={};}var _0x5ba804=new QueueReport();_0x5ba804[_0x78ad('0x45')]=_0x4dd98b[_0x78ad('0x5f')];_0x5ba804[_0x78ad('0x4c')]=this['voiceQueues'][_0x5ba804[_0x78ad('0x45')]]&&this['voiceQueues'][_0x5ba804['name']][_0x78ad('0x4c')]?this[_0x78ad('0x13')][_0x5ba804[_0x78ad('0x45')]][_0x78ad('0x4c')]||_0x78ad('0x4d'):_0x78ad('0x4d');_0x5ba804['queue']=_0x4dd98b[_0x78ad('0x5f')];_0x5ba804[_0x78ad('0x69')]=moment()[_0x78ad('0x43')](_0x78ad('0x6a'));_0x5ba804[_0x78ad('0x6b')]=_0x4dd98b[_0x78ad('0x6b')];_0x5ba804[_0x78ad('0x6c')]=_0x4dd98b[_0x78ad('0x6c')];_[_0x78ad('0x6d')](_0x5ba804,_[_0x78ad('0x6e')](_0x4dd98b,_[_0x78ad('0x6f')](_0x5ba804)));this[_0x78ad('0x10')][_0x4dd98b['uniqueid']][_0x78ad('0x70')](_0x5ba804);this['channels'][_0x4dd98b[_0x78ad('0x68')]]=_0x5ba804;this[_0x78ad('0x71')](_0x5ba804);}}catch(_0x3983d1){logger[_0x78ad('0x3b')]('[syncQueueCallerJoin][VoiceQueueReport]',util['inspect'](_0x3983d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x72')]=function(_0x535a05){try{if(this[_0x78ad('0x5a')](_0x535a05)){if(this[_0x78ad('0x10')][_0x535a05[_0x78ad('0x68')]]){var _0xc716e1=_[_0x78ad('0x73')](this['queueReports'][_0x535a05[_0x78ad('0x68')]]);_0xc716e1[_0x78ad('0x74')]=![];_0xc716e1[_0x78ad('0x75')]=null;_0xc716e1[_0x78ad('0x76')]=_0x535a05['holdtime'];_0xc716e1['originalposition']=_0x535a05[_0x78ad('0x77')];_0xc716e1['queuecallerabandon']=!![];_0xc716e1[_0x78ad('0x78')]=moment()[_0x78ad('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0xc716e1['queuecallerexitreason']='ABANDONED';_0xc716e1[_0x78ad('0x79')]=null;this[_0x78ad('0x12')][_0x535a05[_0x78ad('0x68')]]=_0xc716e1;this['emitVoiceQueueChannelRemove'](_0xc716e1);}}}catch(_0x553677){logger[_0x78ad('0x3b')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x78ad('0x66')](_0x553677,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x7a')]=function(_0xfb902b){try{if(this[_0x78ad('0x5a')](_0xfb902b)){if(this[_0x78ad('0x10')][_0xfb902b[_0x78ad('0x68')]]){var _0x442648=_[_0x78ad('0x73')](this['queueReports'][_0xfb902b[_0x78ad('0x68')]]);_0x442648[_0x78ad('0x7b')]=moment()[_0x78ad('0x43')](_0x78ad('0x6a'));_0x442648[_0x78ad('0x7c')]=_0xfb902b[_0x78ad('0x7c')];_0x442648['connectedlinename']=_0xfb902b['connectedlinename'];this['channels'][_0xfb902b[_0x78ad('0x68')]]=_0x442648;this[_0x78ad('0x71')](_0x442648);}}}catch(_0x398907){logger['error'](_0x78ad('0x7d'),util[_0x78ad('0x66')](_0x398907,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x78ad('0x20')]=function(_0x5c5174){try{if(this['isNotNull'](_0x5c5174)){if(this[_0x78ad('0x10')][_0x5c5174[_0x78ad('0x68')]]){var _0x3c6cfe=_['last'](this[_0x78ad('0x10')][_0x5c5174[_0x78ad('0x68')]]);_0x3c6cfe[_0x78ad('0x74')]=!![];_0x3c6cfe[_0x78ad('0x7e')]=_0x78ad('0x7f');}}}catch(_0x24713c){logger[_0x78ad('0x3b')](_0x78ad('0x80'),util[_0x78ad('0x66')](_0x24713c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78ad('0xc')]['syncAgentComplete']=function(_0x68b14c){try{if(this[_0x78ad('0x5a')](_0x68b14c)){if(this[_0x78ad('0x10')][_0x68b14c[_0x78ad('0x68')]]){var _0x1e7e00=_[_0x78ad('0x73')](this[_0x78ad('0x10')][_0x68b14c[_0x78ad('0x68')]]);_0x1e7e00[_0x78ad('0x1c')]=![];_0x1e7e00[_0x78ad('0x78')]=null;_0x1e7e00['assigned']=!![];_0x1e7e00['lastAssignedTo']=_0x68b14c[_0x78ad('0x81')];_0x1e7e00[_0x78ad('0x76')]=_0x68b14c[_0x78ad('0x76')];_0x1e7e00[_0x78ad('0x74')]=!![];_0x1e7e00[_0x78ad('0x82')]=![];_0x1e7e00['queuecallerexitAt']=null;if(!_0x1e7e00['transfer']){if(_0x68b14c[_0x78ad('0x83')]==_0x78ad('0x84')){_0x1e7e00['queuecallerexitreason']='COMPLETED';}else{if(_[_0x78ad('0x85')](_0x68b14c[_0x78ad('0x39')][_0x78ad('0x86')](),_0x78ad('0x87'))){if(this[_0x78ad('0x10')][_0x68b14c[_0x78ad('0x88')]]){var _0x1c6650=_[_0x78ad('0x73')](this[_0x78ad('0x10')][_0x68b14c[_0x78ad('0x88')]]);_0x1c6650[_0x78ad('0x74')]=![];_0x1c6650['queuecallerexit']=!![];_0x1c6650['queuecallerexitAt']=moment(_0x1e7e00[_0x78ad('0x69')])[_0x78ad('0x89')](_0x68b14c[_0x78ad('0x76')],_0x78ad('0x8a'))['format'](_0x78ad('0x6a'));_0x1c6650[_0x78ad('0x7e')]=_0x78ad('0x8b');_0x1c6650[_0x78ad('0x84')]=!![];_0x1c6650[_0x78ad('0x8c')]='FORWARD';_0x1c6650['transferexten']=_0x68b14c['destexten'];_0x1c6650[_0x78ad('0x8d')]=_0x68b14c[_0x78ad('0x68')];var _0x1bf68f=this[_0x78ad('0x10')][_0x68b14c[_0x78ad('0x88')]];this[_0x78ad('0x10')][_0x68b14c[_0x78ad('0x88')]]=this['queueReports'][_0x68b14c[_0x78ad('0x68')]];this[_0x78ad('0x10')][_0x68b14c[_0x78ad('0x68')]]=_0x1bf68f;}}else{_0x1e7e00[_0x78ad('0x7e')]='COMPLETEDBY'+_0x68b14c[_0x78ad('0x83')][_0x78ad('0x8e')]();}}}this[_0x78ad('0x12')][_0x68b14c[_0x78ad('0x68')]]=_0x1e7e00;this['emitVoiceQueueChannelRemove'](_0x1e7e00);}}}catch(_0x1e4216){logger['error'](_0x78ad('0x8f'),util['inspect'](_0x1e4216,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78ad('0xc')]['syncVarSet']=function(_0x4cf306){try{if(this['isNotNull'](_0x4cf306)){this[_0x78ad('0x90')](_0x4cf306[_0x78ad('0x68')],_[_0x78ad('0x6f')](_0x4cf306[_0x78ad('0x91')])[0x0],_0x4cf306[_0x78ad('0x92')]);if(this[_0x78ad('0x10')][_0x4cf306[_0x78ad('0x68')]]){var _0x559500=_[_0x78ad('0x73')](this[_0x78ad('0x10')][_0x4cf306[_0x78ad('0x68')]]);if(_0x559500){if(this[_0x78ad('0x5a')](_0x4cf306[_0x78ad('0x91')])&&this['isNotNull'](_0x4cf306[_0x78ad('0x91')][_0x78ad('0x93')])){switch(_0x4cf306['value']){case _0x78ad('0x94'):_0x559500[_0x78ad('0x82')]=![];_0x559500['queuecallerexitAt']=null;break;default:_0x559500[_0x78ad('0x82')]=!![];_0x559500[_0x78ad('0x95')]=moment()[_0x78ad('0x43')](_0x78ad('0x6a'));_0x559500[_0x78ad('0x7b')]=moment()['format'](_0x78ad('0x6a'));}_0x559500[_0x78ad('0x1c')]=![];_0x559500['queuecallerabandonAt']=null;_0x559500['queuecallerexitreason']=_0x4cf306[_0x78ad('0x92')];this[_0x78ad('0x12')][_0x4cf306[_0x78ad('0x68')]]=_0x559500;this[_0x78ad('0x41')](_0x559500);}else if(this[_0x78ad('0x5a')](_0x4cf306[_0x78ad('0x91')])&&this['isNotNull'](_0x4cf306[_0x78ad('0x91')]['queueposition'])){if(!_0x559500['queuecallerabandon']){_0x559500[_0x78ad('0x82')]=!![];_0x559500[_0x78ad('0x95')]=moment()['format'](_0x78ad('0x6a'));_0x559500['queuecallerexitreason']=_0x78ad('0x96');_0x559500['queuecallerleaveAt']=moment()[_0x78ad('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4cf306['uniqueid']]=_0x559500;}}_0x559500[_0x78ad('0x3e')]=this[_0x78ad('0x3e')][_0x4cf306[_0x78ad('0x68')]];}}}}catch(_0x3533ca){logger[_0x78ad('0x3b')]('[syncVarSet][VoiceQueueReport]',util[_0x78ad('0x66')](_0x3533ca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x90')]=function(_0x4d9610,_0x365326,_0x130e98){var _0x1585e6=[_0x78ad('0x97'),'rtpaudioqosbridged',_0x78ad('0x98'),_0x78ad('0x99'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x78ad('0x9a'),_0x78ad('0x9b'),_0x78ad('0x9c'),_0x78ad('0x9d'),_0x78ad('0x9e'),'bridgepvtcallid',_0x78ad('0x9f'),_0x78ad('0xa0'),_0x78ad('0xa1'),_0x78ad('0xa2'),_0x78ad('0x81'),'memberpenalty',_0x78ad('0xa3')];if(!_[_0x78ad('0x36')](_0x365326)&&!_['includes'](_0x1585e6,_0x365326)){if(_[_0x78ad('0x5b')](this[_0x78ad('0x3e')][_0x4d9610])){this[_0x78ad('0x3e')][_0x4d9610]={};}this[_0x78ad('0x3e')][_0x4d9610][_0x365326]=_0x130e98;}};VoiceQueueReport[_0x78ad('0xc')][_0x78ad('0x23')]=function(_0x29d969){try{if(this[_0x78ad('0x5a')](_0x29d969)){if(this[_0x78ad('0x10')][_0x29d969['uniqueid']]){for(var _0x4293ca=0x0,_0xb618ab={};_0x4293ca0x0?_0x80e2b9:0x0;this[_0x63c8('0xf')][_0x12319a['queue']]['talking']=this[_0x63c8('0xf')][_0x12319a['queue']]['talking']>_[_0x63c8('0x63')](_0x12319a[_0x63c8('0x64')])?_['toNumber'](_0x12319a['loggedin']):this[_0x63c8('0xf')][_0x12319a[_0x63c8('0x60')]][_0x63c8('0x2e')];this[_0x63c8('0x4c')](this[_0x63c8('0xf')][_0x12319a['queue']]);}ami['emit'](_0x63c8('0x65'),this[_0x63c8('0xf')][_0x12319a[_0x63c8('0x60')]]);}}}catch(_0x450676){logger['error']('[syncQueueSummary][VoiceQueueReport]',util['inspect'](_0x450676,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x63c8('0x15')]=function(_0x11e786){this[_0x63c8('0x10')]=!![];};VoiceQueueReport[_0x63c8('0x33')]['syncNewExten']=function(_0x25e20b){};VoiceQueueReport[_0x63c8('0x33')]['syncQueueCallerJoin']=function(_0x4ef472){try{if(this['isNotNull'](_0x4ef472)){if(_[_0x63c8('0x2a')](this[_0x63c8('0x3d')][_0x4ef472[_0x63c8('0x66')]])){this[_0x63c8('0x3d')][_0x4ef472['uniqueid']]=[];this['channels'][_0x4ef472[_0x63c8('0x66')]]={};}var _0xdca655=new QueueReport();_0xdca655[_0x63c8('0x47')]=_0x4ef472[_0x63c8('0x60')];_0xdca655[_0x63c8('0x67')]=this[_0x63c8('0xf')][_0xdca655['name']]&&this[_0x63c8('0xf')][_0xdca655['name']]['type']?this[_0x63c8('0xf')][_0xdca655['name']]['type']||_0x63c8('0x4d'):'inbound';_0xdca655[_0x63c8('0x60')]=_0x4ef472[_0x63c8('0x60')];_0xdca655[_0x63c8('0x68')]=moment()[_0x63c8('0x45')](_0x63c8('0x69'));_0xdca655[_0x63c8('0x6a')]=_0x4ef472[_0x63c8('0x6a')];_0xdca655['count']=_0x4ef472[_0x63c8('0x6b')];_['merge'](_0xdca655,_['pick'](_0x4ef472,_[_0x63c8('0x6c')](_0xdca655)));this[_0x63c8('0x3d')][_0x4ef472[_0x63c8('0x66')]][_0x63c8('0x6d')](_0xdca655);this[_0x63c8('0xd')][_0x4ef472['uniqueid']]=_0xdca655;this[_0x63c8('0x44')](_0xdca655);}}catch(_0x43c690){logger[_0x63c8('0x3b')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x63c8('0x6e')](_0x43c690,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x63c8('0x33')][_0x63c8('0x18')]=function(_0x5536db){try{if(this[_0x63c8('0x5c')](_0x5536db)){if(this['queueReports'][_0x5536db[_0x63c8('0x66')]]){var _0x2dfb23=_[_0x63c8('0x6f')](this[_0x63c8('0x3d')][_0x5536db[_0x63c8('0x66')]]);_0x2dfb23[_0x63c8('0x70')]=![];_0x2dfb23[_0x63c8('0x71')]=null;_0x2dfb23[_0x63c8('0x72')]=_0x5536db[_0x63c8('0x72')];_0x2dfb23[_0x63c8('0x73')]=_0x5536db[_0x63c8('0x73')];_0x2dfb23[_0x63c8('0x17')]=!![];_0x2dfb23[_0x63c8('0x74')]=moment()[_0x63c8('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x2dfb23['queuecallerexitreason']=_0x63c8('0x75');_0x2dfb23[_0x63c8('0x76')]=null;this['channels'][_0x5536db[_0x63c8('0x66')]]=_0x2dfb23;this[_0x63c8('0x42')](_0x2dfb23);}}}catch(_0x5a64c5){logger[_0x63c8('0x3b')](_0x63c8('0x77'),util[_0x63c8('0x6e')](_0x5a64c5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x63c8('0x33')][_0x63c8('0x19')]=function(_0x11bb96){try{if(this[_0x63c8('0x5c')](_0x11bb96)){if(this[_0x63c8('0x3d')][_0x11bb96[_0x63c8('0x66')]]){var _0x44b9c3=_['last'](this[_0x63c8('0x3d')][_0x11bb96[_0x63c8('0x66')]]);_0x44b9c3[_0x63c8('0x78')]=moment()[_0x63c8('0x45')](_0x63c8('0x69'));_0x44b9c3[_0x63c8('0x79')]=_0x11bb96[_0x63c8('0x79')];_0x44b9c3[_0x63c8('0x7a')]=_0x11bb96[_0x63c8('0x7a')];this[_0x63c8('0xd')][_0x11bb96['uniqueid']]=_0x44b9c3;this[_0x63c8('0x44')](_0x44b9c3);}}}catch(_0x45a95f){logger[_0x63c8('0x3b')](_0x63c8('0x7b'),util[_0x63c8('0x6e')](_0x45a95f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x63c8('0x33')]['syncAgentConnect']=function(_0x41bcc8){try{if(this['isNotNull'](_0x41bcc8)){if(this['queueReports'][_0x41bcc8[_0x63c8('0x66')]]){var _0x2cc7fb=_[_0x63c8('0x6f')](this[_0x63c8('0x3d')][_0x41bcc8[_0x63c8('0x66')]]);_0x2cc7fb['queuecallercomplete']=!![];_0x2cc7fb[_0x63c8('0x7c')]=_0x63c8('0x7d');}}}catch(_0x4ae27d){logger[_0x63c8('0x3b')](_0x63c8('0x7e'),util[_0x63c8('0x6e')](_0x4ae27d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x63c8('0x33')][_0x63c8('0x1b')]=function(_0x6444d1){try{if(this[_0x63c8('0x5c')](_0x6444d1)){if(this[_0x63c8('0x3d')][_0x6444d1[_0x63c8('0x66')]]){var _0xcfb44a=_[_0x63c8('0x6f')](this[_0x63c8('0x3d')][_0x6444d1[_0x63c8('0x66')]]);_0xcfb44a[_0x63c8('0x17')]=![];_0xcfb44a[_0x63c8('0x74')]=null;_0xcfb44a[_0x63c8('0x7f')]=!![];_0xcfb44a['lastAssignedTo']=_0x6444d1[_0x63c8('0x80')];_0xcfb44a[_0x63c8('0x72')]=_0x6444d1['holdtime'];_0xcfb44a[_0x63c8('0x70')]=!![];_0xcfb44a['queuecallerexit']=![];_0xcfb44a[_0x63c8('0x81')]=null;if(!_0xcfb44a[_0x63c8('0x82')]){if(_0x6444d1[_0x63c8('0x83')]==_0x63c8('0x82')){_0xcfb44a[_0x63c8('0x7c')]=_0x63c8('0x84');}else{if(_[_0x63c8('0x85')](_0x6444d1['channel']['toLowerCase'](),_0x63c8('0x86'))){if(this[_0x63c8('0x3d')][_0x6444d1[_0x63c8('0x87')]]){var _0x12cb83=_[_0x63c8('0x6f')](this[_0x63c8('0x3d')][_0x6444d1[_0x63c8('0x87')]]);_0x12cb83[_0x63c8('0x70')]=![];_0x12cb83[_0x63c8('0x88')]=!![];_0x12cb83['queuecallerexitAt']=moment(_0xcfb44a['queuecallerjoinAt'])[_0x63c8('0x89')](_0x6444d1[_0x63c8('0x72')],_0x63c8('0x8a'))[_0x63c8('0x45')](_0x63c8('0x69'));_0x12cb83[_0x63c8('0x7c')]=_0x63c8('0x8b');_0x12cb83['transfer']=!![];_0x12cb83[_0x63c8('0x8c')]='FORWARD';_0x12cb83['transferexten']=_0x6444d1[_0x63c8('0x8d')];_0x12cb83[_0x63c8('0x8e')]=_0x6444d1[_0x63c8('0x66')];var _0x585fd0=this[_0x63c8('0x3d')][_0x6444d1[_0x63c8('0x87')]];this[_0x63c8('0x3d')][_0x6444d1[_0x63c8('0x87')]]=this[_0x63c8('0x3d')][_0x6444d1[_0x63c8('0x66')]];this['queueReports'][_0x6444d1[_0x63c8('0x66')]]=_0x585fd0;}}else{_0xcfb44a[_0x63c8('0x7c')]=_0x63c8('0x8f')+_0x6444d1[_0x63c8('0x83')]['toUpperCase']();}}}this[_0x63c8('0xd')][_0x6444d1[_0x63c8('0x66')]]=_0xcfb44a;this['emitVoiceQueueChannelRemove'](_0xcfb44a);}}}catch(_0x33abf9){logger['error'](_0x63c8('0x90'),util[_0x63c8('0x6e')](_0x33abf9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x63c8('0x33')]['syncVarSet']=function(_0x393d84){try{if(this[_0x63c8('0x5c')](_0x393d84)){this[_0x63c8('0x91')](_0x393d84[_0x63c8('0x66')],_[_0x63c8('0x6c')](_0x393d84[_0x63c8('0x92')])[0x0],_0x393d84['value']);if(this[_0x63c8('0x3d')][_0x393d84[_0x63c8('0x66')]]){var _0x2a670f=_[_0x63c8('0x6f')](this[_0x63c8('0x3d')][_0x393d84[_0x63c8('0x66')]]);if(_0x2a670f){if(this[_0x63c8('0x5c')](_0x393d84[_0x63c8('0x92')])&&this[_0x63c8('0x5c')](_0x393d84[_0x63c8('0x92')][_0x63c8('0x93')])){switch(_0x393d84['value']){case _0x63c8('0x94'):_0x2a670f[_0x63c8('0x88')]=![];_0x2a670f['queuecallerexitAt']=null;break;default:_0x2a670f[_0x63c8('0x88')]=!![];_0x2a670f['queuecallerexitAt']=moment()['format'](_0x63c8('0x69'));_0x2a670f['queuecallerleaveAt']=moment()[_0x63c8('0x45')](_0x63c8('0x69'));}_0x2a670f[_0x63c8('0x17')]=![];_0x2a670f[_0x63c8('0x74')]=null;_0x2a670f[_0x63c8('0x7c')]=_0x393d84[_0x63c8('0x95')];this[_0x63c8('0xd')][_0x393d84[_0x63c8('0x66')]]=_0x2a670f;this[_0x63c8('0x42')](_0x2a670f);}else if(this[_0x63c8('0x5c')](_0x393d84[_0x63c8('0x92')])&&this[_0x63c8('0x5c')](_0x393d84['variable']['queueposition'])){if(!_0x2a670f['queuecallerabandon']){_0x2a670f['queuecallerexit']=!![];_0x2a670f[_0x63c8('0x81')]=moment()[_0x63c8('0x45')](_0x63c8('0x69'));_0x2a670f[_0x63c8('0x7c')]=_0x63c8('0x96');_0x2a670f[_0x63c8('0x78')]=moment()[_0x63c8('0x45')](_0x63c8('0x69'));this[_0x63c8('0xd')][_0x393d84[_0x63c8('0x66')]]=_0x2a670f;}}_0x2a670f[_0x63c8('0x3f')]=this[_0x63c8('0x3f')][_0x393d84['uniqueid']];}}}}catch(_0x406ffe){logger[_0x63c8('0x3b')](_0x63c8('0x97'),util['inspect'](_0x406ffe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x63c8('0x33')][_0x63c8('0x91')]=function(_0x24448c,_0x4e8b27,_0xf7d5e8){var _0x2aa9ce=['rtpaudioqos','rtpaudioqosbridged',_0x63c8('0x98'),_0x63c8('0x99'),_0x63c8('0x9a'),'rtpaudioqoslossbridged',_0x63c8('0x9b'),_0x63c8('0x9c'),_0x63c8('0x9d'),_0x63c8('0x9e'),_0x63c8('0x9f'),'bridgepvtcallid',_0x63c8('0xa0'),_0x63c8('0xa1'),'memberinterface','memberlastcall',_0x63c8('0x80'),_0x63c8('0xa2'),_0x63c8('0xa3')];if(!_[_0x63c8('0x35')](_0x4e8b27)&&!_[_0x63c8('0xa4')](_0x2aa9ce,_0x4e8b27)){if(_[_0x63c8('0x2a')](this['variables'][_0x24448c])){this[_0x63c8('0x3f')][_0x24448c]={};}this[_0x63c8('0x3f')][_0x24448c][_0x4e8b27]=_0xf7d5e8;}};VoiceQueueReport[_0x63c8('0x33')][_0x63c8('0xa5')]=function(_0x55dadd){try{if(this[_0x63c8('0x5c')](_0x55dadd)){if(this[_0x63c8('0x3d')][_0x55dadd[_0x63c8('0x66')]]){for(var _0x3031b9=0x0,_0xddcf29={};_0x3031b9=0x0?moment(_0x54715f[_0x646f('0x18')])[_0x646f('0xc')](_0x54715f[_0x646f('0x17')],_0x646f('0xd')):null,'data1':'outbound','data2':_0x54715f[_0x646f('0x13')],'data3':_0x54715f['exten'],'data4':_0x54715f[_0x646f('0x19')]||null,'role':'agent','internal':_0x54715f[_0x646f('0x13')]?_[_0x646f('0x1a')](_0x54715f['accountcode']):undefined,'uniqueid':_0x54715f[_0x646f('0x1b')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xa8e0=['Request','lastAssignedTo','isNil','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','voice','membername','interface','endtime','starttime','dialstring','lodash','queuecallerexitAt'];(function(_0x115696,_0x5d6795){var _0x212d02=function(_0x582e37){while(--_0x582e37){_0x115696['push'](_0x115696['shift']());}};_0x212d02(++_0x5d6795);}(_0xa8e0,0x1d9));var _0x0a8e=function(_0x454f20,_0x59efa2){_0x454f20=_0x454f20-0x0;var _0x18331c=_0xa8e0[_0x454f20];return _0x18331c;};'use strict';var moment=require('moment');var _=require(_0x0a8e('0x0'));var util=require('util');var client=require('../client');exports['voiceQueueReport']=function(_0x45dfb2){var _0x3214a2=_0x45dfb2['queuecallercompleteAt']||_0x45dfb2[_0x0a8e('0x1')];return client[_0x0a8e('0x2')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x45dfb2[_0x0a8e('0x3')],'interface':_[_0x0a8e('0x4')](_0x45dfb2['interface'])?util['format'](_0x0a8e('0x5'),_0x45dfb2['lastAssignedTo']):_0x45dfb2['interface'],'type':_0x0a8e('0x6'),'enterAt':_0x45dfb2[_0x0a8e('0x7')],'exitAt':_0x3214a2,'duration':moment(_0x3214a2)[_0x0a8e('0x8')](_0x45dfb2[_0x0a8e('0x7')],_0x0a8e('0x9')),'data1':_0x0a8e('0xa'),'data2':_0x45dfb2[_0x0a8e('0xb')],'data3':_0x45dfb2[_0x0a8e('0xc')],'data4':null,'data5':_0x45dfb2['queue'],'role':_0x0a8e('0xd'),'internal':_0x45dfb2[_0x0a8e('0xe')]?_[_0x0a8e('0xf')](_0x45dfb2[_0x0a8e('0xe')]):undefined,'uniqueid':_0x45dfb2[_0x0a8e('0x10')]},'log':_0x0a8e('0x11')});};exports[_0x0a8e('0x12')]=function(_0x977752){return client[_0x0a8e('0x2')]('CreateMemberReport',{'body':{'channel':_0x0a8e('0x13'),'membername':_0x977752[_0x0a8e('0x14')],'interface':_0x977752[_0x0a8e('0x15')],'type':_0x0a8e('0x6'),'enterAt':_0x977752['starttime'],'exitAt':_0x977752[_0x0a8e('0x16')],'duration':moment(_0x977752[_0x0a8e('0x16')])[_0x0a8e('0x8')](_0x977752[_0x0a8e('0x17')],_0x0a8e('0x9'))>=0x0?moment(_0x977752['endtime'])[_0x0a8e('0x8')](_0x977752[_0x0a8e('0x17')],_0x0a8e('0x9')):null,'data1':'outbound','data2':_0x977752[_0x0a8e('0xe')],'data3':_0x977752[_0x0a8e('0xc')],'data4':_0x977752[_0x0a8e('0x18')]||null,'role':_0x0a8e('0xd'),'internal':_0x977752[_0x0a8e('0xe')]?_[_0x0a8e('0xf')](_0x977752[_0x0a8e('0xe')]):undefined,'uniqueid':_0x977752[_0x0a8e('0x10')]},'log':_0x0a8e('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index bf7eb7d..1c02bd0 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 _0x5b02=['GetTemplate','../client','getTemplates','name'];(function(_0x244a5f,_0x3652c3){var _0x115943=function(_0x3f21bc){while(--_0x3f21bc){_0x244a5f['push'](_0x244a5f['shift']());}};_0x115943(++_0x3652c3);}(_0x5b02,0xe9));var _0x25b0=function(_0x2dccaf,_0x35d0d2){_0x2dccaf=_0x2dccaf-0x0;var _0x389e50=_0x5b02[_0x2dccaf];return _0x389e50;};'use strict';var client=require(_0x25b0('0x0'));exports[_0x25b0('0x1')]=function(_0x428458){return function(_0x1c3295){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x25b0('0x2'),'html']},'log':_0x25b0('0x3')});};}; \ No newline at end of file +var _0x8130=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x4c8f56,_0x19d0c6){var _0x22565a=function(_0x1309c2){while(--_0x1309c2){_0x4c8f56['push'](_0x4c8f56['shift']());}};_0x22565a(++_0x19d0c6);}(_0x8130,0x146));var _0x0813=function(_0x35d26b,_0x1e3e64){_0x35d26b=_0x35d26b-0x0;var _0x10f1be=_0x8130[_0x35d26b];return _0x10f1be;};'use strict';var client=require(_0x0813('0x0'));exports[_0x0813('0x1')]=function(_0x5038a7){return function(_0xb7d498){return client[_0x0813('0x2')](_0x0813('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0813('0x4'),_0x0813('0x5')]},'log':_0x0813('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 4db02ca..8736302 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 _0xf037=['data2','data3','data4','data5','data6','GetTrigger','Request','name','channel','Condition','field','operator','value','Action','Actions','action','data1'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xf037,0x138));var _0x7f03=function(_0x2730da,_0x1098bd){_0x2730da=_0x2730da-0x0;var _0xfe9991=_0xf037[_0x2730da];return _0xfe9991;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x79ebc9){return function(_0x14d2f9){return client[_0x7f03('0x0')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x7f03('0x1'),_0x7f03('0x2'),'status'],'include':[{'model':_0x7f03('0x3'),'as':'AllConditions','attributes':['id',_0x7f03('0x4'),_0x7f03('0x5'),'value']},{'model':'Condition','as':'AnyConditions','attributes':['id',_0x7f03('0x4'),_0x7f03('0x5'),_0x7f03('0x6')]},{'model':_0x7f03('0x7'),'as':_0x7f03('0x8'),'attributes':['id',_0x7f03('0x9'),_0x7f03('0xa'),_0x7f03('0xb'),_0x7f03('0xc'),_0x7f03('0xd'),_0x7f03('0xe'),_0x7f03('0xf'),'data7']}]},'log':_0x7f03('0x10')});};}; \ No newline at end of file +var _0x899e=['data3','data5','data6','data7','../client','Request','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data2'];(function(_0x4078e8,_0xf6f8a4){var _0x5a3e41=function(_0x4cc129){while(--_0x4cc129){_0x4078e8['push'](_0x4078e8['shift']());}};_0x5a3e41(++_0xf6f8a4);}(_0x899e,0x1cc));var _0xe899=function(_0x435c69,_0x438fa2){_0x435c69=_0x435c69-0x0;var _0x35a980=_0x899e[_0x435c69];return _0x35a980;};'use strict';var client=require(_0xe899('0x0'));exports['getTriggers']=function(_0x52171d){return function(_0x2f2c44){return client[_0xe899('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xe899('0x2'),_0xe899('0x3'),_0xe899('0x4')],'include':[{'model':_0xe899('0x5'),'as':_0xe899('0x6'),'attributes':['id',_0xe899('0x7'),_0xe899('0x8'),_0xe899('0x9')]},{'model':'Condition','as':_0xe899('0xa'),'attributes':['id',_0xe899('0x7'),_0xe899('0x8'),_0xe899('0x9')]},{'model':_0xe899('0xb'),'as':_0xe899('0xc'),'attributes':['id',_0xe899('0xd'),'data1',_0xe899('0xe'),_0xe899('0xf'),'data4',_0xe899('0x10'),_0xe899('0x11'),_0xe899('0x12')]}]},'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 50b2e20..2622d10 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 _0x6ee7=['../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x4e6ef9,_0x22a04e){var _0x331c37=function(_0x3d2811){while(--_0x3d2811){_0x4e6ef9['push'](_0x4e6ef9['shift']());}};_0x331c37(++_0x22a04e);}(_0x6ee7,0x78));var _0x76ee=function(_0x420f28,_0x718d82){_0x420f28=_0x420f28-0x0;var _0x38973a=_0x6ee7[_0x420f28];return _0x38973a;};'use strict';var client=require(_0x76ee('0x0'));exports[_0x76ee('0x1')]=function(_0x394635){return function(_0x43ea09){return client[_0x76ee('0x2')](_0x76ee('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x76ee('0x4'),_0x76ee('0x5')]},'log':_0x76ee('0x3')});};}; \ No newline at end of file +var _0x9f90=['Request','GetTrunk','../client','getTrunks'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x9f90,0x12a));var _0x09f9=function(_0x216579,_0x9fbc87){_0x216579=_0x216579-0x0;var _0x4f2812=_0x9f90[_0x216579];return _0x4f2812;};'use strict';var client=require(_0x09f9('0x0'));exports[_0x09f9('0x1')]=function(_0x5e7c03){return function(_0x3961a1){return client[_0x09f9('0x2')](_0x09f9('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry']},'log':_0x09f9('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 2e8a968..ec4f25b 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 _0xf95f=['online','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','savePause','saveUnpause','UnpauseUser','getAgent','pauseType','../client','getAgents','Request','GetUser','agent','name','email','accountcode','fullname'];(function(_0x45dbe2,_0x3e0483){var _0x50fbdd=function(_0x5008a0){while(--_0x5008a0){_0x45dbe2['push'](_0x45dbe2['shift']());}};_0x50fbdd(++_0x3e0483);}(_0xf95f,0x1da));var _0xff95=function(_0x5d68ba,_0x33be44){_0x5d68ba=_0x5d68ba-0x0;var _0x17cee3=_0xf95f[_0x5d68ba];return _0x17cee3;};'use strict';var client=require(_0xff95('0x0'));exports[_0xff95('0x1')]=function(){return function(){return client[_0xff95('0x2')](_0xff95('0x3'),{'options':{'raw':![],'where':{'role':_0xff95('0x4')},'attributes':['id',_0xff95('0x5'),_0xff95('0x6'),_0xff95('0x7'),_0xff95('0x8'),_0xff95('0x9'),_0xff95('0xa'),'pauseType',_0xff95('0xb'),_0xff95('0xc'),_0xff95('0xd'),_0xff95('0xe'),_0xff95('0xf')]},'log':'getAgents'});};};exports[_0xff95('0x10')]=function(){return function(){return client[_0xff95('0x2')](_0xff95('0x3'),{'options':{'raw':!![],'where':{'role':_0xff95('0x11')},'attributes':['id','name',_0xff95('0x7'),'internal']},'log':_0xff95('0x10')});};};exports[_0xff95('0x12')]=function(_0x41794c,_0x12ff1a,_0x3a1611){return client['Request']('PauseUser',{'body':{'type':_0x12ff1a,'uniqueid':_0x3a1611},'options':{'where':{'id':_0x41794c['id']}},'log':'savePause'});};exports[_0xff95('0x13')]=function(_0x54f353){return client[_0xff95('0x2')](_0xff95('0x14'),{'body':{},'options':{'where':{'id':_0x54f353['id']}},'log':_0xff95('0x12')});};exports[_0xff95('0x15')]=function(_0x23e256){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':'agent','id':_0x23e256},'attributes':['id','name',_0xff95('0x6'),_0xff95('0x7'),'fullname','online','lastLoginAt',_0xff95('0x16'),_0xff95('0xb'),_0xff95('0xc'),'interface']},'log':_0xff95('0x15')});}; \ No newline at end of file +var _0xbab8=['Request','GetUser','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','telephone','name','internal','PauseUser','UnpauseUser','savePause','getAgent','ShowUser','agent','interface','getAgents'];(function(_0x32102a,_0x2fa229){var _0xb8cb0d=function(_0x9bcdb7){while(--_0x9bcdb7){_0x32102a['push'](_0x32102a['shift']());}};_0xb8cb0d(++_0x2fa229);}(_0xbab8,0x1b8));var _0x8bab=function(_0x1f0464,_0x74c830){_0x1f0464=_0x1f0464-0x0;var _0x3b8414=_0xbab8[_0x1f0464];return _0x3b8414;};'use strict';var client=require('../client');exports[_0x8bab('0x0')]=function(){return function(){return client[_0x8bab('0x1')](_0x8bab('0x2'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id','name',_0x8bab('0x3'),_0x8bab('0x4'),_0x8bab('0x5'),_0x8bab('0x6'),_0x8bab('0x7'),_0x8bab('0x8'),_0x8bab('0x9'),_0x8bab('0xa'),'phone','mobile','interface']},'log':_0x8bab('0x0')});};};exports['getTelephones']=function(){return function(){return client['Request'](_0x8bab('0x2'),{'options':{'raw':!![],'where':{'role':_0x8bab('0xb')},'attributes':['id',_0x8bab('0xc'),_0x8bab('0x4'),_0x8bab('0xd')]},'log':'getTelephones'});};};exports['savePause']=function(_0x144589,_0x38002d,_0x19acf4){return client['Request'](_0x8bab('0xe'),{'body':{'type':_0x38002d,'uniqueid':_0x19acf4},'options':{'where':{'id':_0x144589['id']}},'log':'savePause'});};exports['saveUnpause']=function(_0x68682c){return client['Request'](_0x8bab('0xf'),{'body':{},'options':{'where':{'id':_0x68682c['id']}},'log':_0x8bab('0x10')});};exports[_0x8bab('0x11')]=function(_0x27386e){return client[_0x8bab('0x1')](_0x8bab('0x12'),{'options':{'raw':![],'where':{'role':_0x8bab('0x13'),'id':_0x27386e},'attributes':['id',_0x8bab('0xc'),_0x8bab('0x3'),'accountcode',_0x8bab('0x5'),_0x8bab('0x6'),'lastLoginAt',_0x8bab('0x8'),_0x8bab('0x9'),_0x8bab('0xa'),_0x8bab('0x14')]},'log':_0x8bab('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 20a4a9c..2b13be5 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 _0x1af7=['../client','create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x1af7,0x1b8));var _0x71af=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1af7[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x71af('0x0'));exports[_0x71af('0x1')]=function(_0x45833e){return client[_0x71af('0x2')]('CreateVoiceAgentReport',{'body':_0x45833e,'log':_0x71af('0x3')});};exports['update']=function(_0x3e116f,_0x45094d,_0x581327){return client['Request']('UpdateVoiceAgentReport',{'body':_0x3e116f,'options':{'where':{'uniqueid':_0x45094d,'interface':_0x581327,'agentcomplete':!![]}},'log':_0x71af('0x4')});}; \ No newline at end of file +var _0x2dae=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x442535,_0x451f9a){var _0x2860b9=function(_0x471dbb){while(--_0x471dbb){_0x442535['push'](_0x442535['shift']());}};_0x2860b9(++_0x451f9a);}(_0x2dae,0xc3));var _0xe2da=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0x2dae[_0x543242];return _0x4c99b6;};'use strict';var client=require(_0xe2da('0x0'));exports['create']=function(_0x11ec30){return client[_0xe2da('0x1')](_0xe2da('0x2'),{'body':_0x11ec30,'log':_0xe2da('0x2')});};exports[_0xe2da('0x3')]=function(_0x481d97,_0x25b9f2,_0x439b5d){return client[_0xe2da('0x1')](_0xe2da('0x4'),{'body':_0x481d97,'options':{'where':{'uniqueid':_0x25b9f2,'interface':_0x439b5d,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 1305944..06131d3 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 _0x8993=['lodash','../client','create','Request','merge','calleridnum','context','callerid','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','util'];(function(_0x1de641,_0x44d464){var _0xccacbc=function(_0x1ed9fb){while(--_0x1ed9fb){_0x1de641['push'](_0x1de641['shift']());}};_0xccacbc(++_0x44d464);}(_0x8993,0x1e3));var _0x3899=function(_0x483004,_0x2d35a4){_0x483004=_0x483004-0x0;var _0x3ce916=_0x8993[_0x483004];return _0x3ce916;};'use strict';var moment=require('moment');var util=require(_0x3899('0x0'));var _=require(_0x3899('0x1'));var client=require(_0x3899('0x2'));exports[_0x3899('0x3')]=function(_0x4b7889){return client[_0x3899('0x4')]('CreateVoiceCallReport',{'body':_[_0x3899('0x5')](_0x4b7889,{'source':_0x4b7889[_0x3899('0x6')],'destinationcontext':_0x4b7889[_0x3899('0x7')],'callerid':_0x4b7889[_0x3899('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x3899('0x9')});};exports[_0x3899('0xa')]=function(){return function(){return client['Request'](_0x3899('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x3899('0xc')](_0x3899('0xd'))[_0x3899('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x3899('0xf')](_0x3899('0xd'))[_0x3899('0xe')](_0x3899('0x10'))]}},'attributes':[_0x3899('0x11'),_0x3899('0x12'),_0x3899('0x13'),_0x3899('0x14')]},'log':_0x3899('0x15')});};}; \ No newline at end of file +var _0x35ad=['calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','merge'];(function(_0x663fe1,_0x1f290a){var _0x44da5e=function(_0x37e861){while(--_0x37e861){_0x663fe1['push'](_0x663fe1['shift']());}};_0x44da5e(++_0x1f290a);}(_0x35ad,0x10a));var _0xd35a=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x35ad[_0x25e7cb];return _0x375d92;};'use strict';var moment=require(_0xd35a('0x0'));var util=require(_0xd35a('0x1'));var _=require(_0xd35a('0x2'));var client=require('../client');exports[_0xd35a('0x3')]=function(_0x4010b7){return client[_0xd35a('0x4')](_0xd35a('0x5'),{'body':_[_0xd35a('0x6')](_0x4010b7,{'source':_0x4010b7[_0xd35a('0x7')],'destinationcontext':_0x4010b7[_0xd35a('0x8')],'callerid':_0x4010b7['callerid'],'amaflags':_0xd35a('0x9')}),'log':_0xd35a('0x5')});};exports[_0xd35a('0xa')]=function(){return function(){return client[_0xd35a('0x4')](_0xd35a('0xb'),{'options':{'where':{'type':[_0xd35a('0xc')],'createdAt':{'$between':[moment()[_0xd35a('0xd')](_0xd35a('0xe'))[_0xd35a('0xf')](_0xd35a('0x10')),moment()[_0xd35a('0x11')](_0xd35a('0xe'))[_0xd35a('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xd35a('0x12'),'disposition',_0xd35a('0x13'),'billableseconds']},'log':_0xd35a('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index ecb14ea..82df57a 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 _0xf2c0=['Request','CreateVoiceDialReport','../client','create'];(function(_0x52aac9,_0x3ede9d){var _0x31f5bf=function(_0x158c10){while(--_0x158c10){_0x52aac9['push'](_0x52aac9['shift']());}};_0x31f5bf(++_0x3ede9d);}(_0xf2c0,0x106));var _0x0f2c=function(_0x2d4103,_0xc97975){_0x2d4103=_0x2d4103-0x0;var _0xa1e49a=_0xf2c0[_0x2d4103];return _0xa1e49a;};'use strict';var client=require(_0x0f2c('0x0'));exports[_0x0f2c('0x1')]=function(_0x504871){return client[_0x0f2c('0x2')](_0x0f2c('0x3'),{'body':_0x504871,'log':_0x0f2c('0x3')});}; \ No newline at end of file +var _0x5581=['../client','create','Request','CreateVoiceDialReport'];(function(_0x256da0,_0x2f0d26){var _0x43dcb0=function(_0x2222ce){while(--_0x2222ce){_0x256da0['push'](_0x256da0['shift']());}};_0x43dcb0(++_0x2f0d26);}(_0x5581,0xa8));var _0x1558=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x5581[_0xbf8ebe];return _0x1e25e8;};'use strict';var client=require(_0x1558('0x0'));exports[_0x1558('0x1')]=function(_0x160394){return client[_0x1558('0x2')](_0x1558('0x3'),{'body':_0x160394,'log':_0x1558('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index b1d3ac2..03550bf 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 _0xbb58=['Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbb58,0x17b));var _0x8bb5=function(_0x17440e,_0x57ca1d){_0x17440e=_0x17440e-0x0;var _0x171a54=_0xbb58[_0x17440e];return _0x171a54;};'use strict';var client=require('../client');exports[_0x8bb5('0x0')]=function(){return function(){return client[_0x8bb5('0x1')](_0x8bb5('0x2'),{'options':{'raw':!![],'attributes':['id',_0x8bb5('0x3'),_0x8bb5('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x135b=['../client','getVoiceExtensions','Request','GetVoiceExtension','recordingFormat'];(function(_0x4de894,_0x2845d8){var _0x56eb9b=function(_0x426ab0){while(--_0x426ab0){_0x4de894['push'](_0x4de894['shift']());}};_0x56eb9b(++_0x2845d8);}(_0x135b,0xaf));var _0xb135=function(_0x39767f,_0xdf30e6){_0x39767f=_0x39767f-0x0;var _0x54ff20=_0x135b[_0x39767f];return _0x54ff20;};'use strict';var client=require(_0xb135('0x0'));exports[_0xb135('0x1')]=function(){return function(){return client[_0xb135('0x2')](_0xb135('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xb135('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xb135('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 9aa52ad..3850bc2 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 _0xfa25=['callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','Trunk'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xfa25,0xf8));var _0x5fa2=function(_0x34ddc1,_0x853f0){_0x34ddc1=_0x34ddc1-0x0;var _0x913f4e=_0xfa25[_0x34ddc1];return _0x913f4e;};'use strict';var client=require(_0x5fa2('0x0'));exports[_0x5fa2('0x1')]=function(){return function(){return client[_0x5fa2('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x5fa2('0x3'),_0x5fa2('0x4'),_0x5fa2('0x5'),_0x5fa2('0x6'),'monitor_format',_0x5fa2('0x7'),_0x5fa2('0x8'),_0x5fa2('0x9'),'dialLimitChannel',_0x5fa2('0xa'),_0x5fa2('0xb'),_0x5fa2('0xc'),_0x5fa2('0xd'),_0x5fa2('0xe'),'dialOriginateCallerIdName',_0x5fa2('0xf'),_0x5fa2('0x10'),_0x5fa2('0x11'),_0x5fa2('0x12'),'dialQueueProject',_0x5fa2('0x13'),_0x5fa2('0x14'),_0x5fa2('0x15'),_0x5fa2('0x16'),_0x5fa2('0x17'),_0x5fa2('0x18'),_0x5fa2('0x19'),'dialTimezone',_0x5fa2('0x1a'),'dialPrefix',_0x5fa2('0x1b'),_0x5fa2('0x1c'),'dialAMDInitialSilence','dialAMDGreeting',_0x5fa2('0x1d'),_0x5fa2('0x1e'),_0x5fa2('0x1f'),_0x5fa2('0x20'),_0x5fa2('0x21'),'dialAMDSilenceThreshold',_0x5fa2('0x22'),_0x5fa2('0x23'),_0x5fa2('0x24'),'dialRecallInQueue',_0x5fa2('0x25'),_0x5fa2('0x26'),_0x5fa2('0x27'),'dialQueueProject2',_0x5fa2('0x28'),_0x5fa2('0x29'),_0x5fa2('0x2a'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0x5fa2('0x2b'),_0x5fa2('0x2c'),_0x5fa2('0x2d'),_0x5fa2('0x2e'),_0x5fa2('0x2f'),_0x5fa2('0x30'),_0x5fa2('0x31'),'dialAgentRejectMaxRetry',_0x5fa2('0x32'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x5fa2('0x33'),'as':_0x5fa2('0x33'),'attributes':['id',_0x5fa2('0x3'),_0x5fa2('0x34'),_0x5fa2('0x35')]},{'model':_0x5fa2('0x36'),'as':_0x5fa2('0x37'),'attributes':['id',_0x5fa2('0x3')]},{'model':_0x5fa2('0x33'),'as':_0x5fa2('0x38'),'attributes':['id','name','callerid',_0x5fa2('0x35')]},{'model':_0x5fa2('0x39'),'as':_0x5fa2('0x39'),'attributes':['id',_0x5fa2('0x3')],'include':[{'model':'Interval','as':_0x5fa2('0x3a'),'attributes':['id',_0x5fa2('0x3'),_0x5fa2('0x3b')]}]}]},'log':_0x5fa2('0x1')});};}; \ No newline at end of file +var _0xbed1=['dialGlobalMaxRetry','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x1acb6b,_0x29a2ab){var _0x11f0ef=function(_0x226310){while(--_0x226310){_0x1acb6b['push'](_0x1acb6b['shift']());}};_0x11f0ef(++_0x29a2ab);}(_0xbed1,0xac));var _0x1bed=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0xbed1[_0x24875d];return _0x181471;};'use strict';var client=require(_0x1bed('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x1bed('0x1')](_0x1bed('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1bed('0x3'),_0x1bed('0x4'),_0x1bed('0x5'),_0x1bed('0x6'),_0x1bed('0x7'),_0x1bed('0x8'),_0x1bed('0x9'),_0x1bed('0xa'),_0x1bed('0xb'),_0x1bed('0xc'),_0x1bed('0xd'),_0x1bed('0xe'),_0x1bed('0xf'),_0x1bed('0x10'),_0x1bed('0x11'),'dialOriginateTimeout',_0x1bed('0x12'),'dialQueueTimeout',_0x1bed('0x13'),_0x1bed('0x14'),_0x1bed('0x15'),_0x1bed('0x16'),_0x1bed('0x17'),_0x1bed('0x18'),_0x1bed('0x19'),_0x1bed('0x1a'),'dialTimezone',_0x1bed('0x1b'),'dialPrefix',_0x1bed('0x1c'),_0x1bed('0x1d'),_0x1bed('0x1e'),'dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x1bed('0x1f'),_0x1bed('0x20'),_0x1bed('0x21'),_0x1bed('0x22'),_0x1bed('0x23'),_0x1bed('0x24'),_0x1bed('0x25'),_0x1bed('0x26'),'dialOrderByScheduledAt',_0x1bed('0x27'),_0x1bed('0x28'),_0x1bed('0x29'),_0x1bed('0x6'),_0x1bed('0x2a'),_0x1bed('0x2b'),_0x1bed('0x2c'),_0x1bed('0x2d'),_0x1bed('0x2e'),_0x1bed('0x2f'),_0x1bed('0x30'),'dialAbandonedMaxRetry',_0x1bed('0x31'),_0x1bed('0x32'),'dialMachineRetryFrequency',_0x1bed('0x33'),_0x1bed('0x34'),_0x1bed('0x35'),_0x1bed('0x36'),_0x1bed('0x37')],'include':[{'model':_0x1bed('0x38'),'as':_0x1bed('0x38'),'attributes':['id',_0x1bed('0x39'),_0x1bed('0x3a'),_0x1bed('0x3b')]},{'model':_0x1bed('0x3c'),'as':_0x1bed('0x3d'),'attributes':['id',_0x1bed('0x39')]},{'model':_0x1bed('0x38'),'as':'TrunkBackup','attributes':['id',_0x1bed('0x39'),_0x1bed('0x3a'),_0x1bed('0x3b')]},{'model':_0x1bed('0x3e'),'as':'Interval','attributes':['id',_0x1bed('0x39')],'include':[{'model':'Interval','as':_0x1bed('0x3f'),'attributes':['id',_0x1bed('0x39'),_0x1bed('0x40')]}]}]},'log':_0x1bed('0x41')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 319818b..1959f6d 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 _0x4d02=['queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','moment','lodash','../client','create','Request','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x28d722,_0x436fa9){var _0x14cc52=function(_0x30ee3d){while(--_0x30ee3d){_0x28d722['push'](_0x28d722['shift']());}};_0x14cc52(++_0x436fa9);}(_0x4d02,0x10c));var _0x24d0=function(_0x1bdf0e,_0x1d5bb6){_0x1bdf0e=_0x1bdf0e-0x0;var _0x31f2f6=_0x4d02[_0x1bdf0e];return _0x31f2f6;};'use strict';var moment=require(_0x24d0('0x0'));var _=require(_0x24d0('0x1'));var client=require(_0x24d0('0x2'));exports[_0x24d0('0x3')]=function(_0x473909){return client[_0x24d0('0x4')]('CreateVoiceQueueReport',{'body':_0x473909,'log':'CreateVoiceQueueReport'});};exports[_0x24d0('0x5')]=function(){return function(){return client[_0x24d0('0x4')](_0x24d0('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x24d0('0x7')](_0x24d0('0x8'))[_0x24d0('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x24d0('0xa')](_0x24d0('0x8'))[_0x24d0('0x9')](_0x24d0('0xb'))]}},'attributes':[_0x24d0('0xc'),_0x24d0('0xd'),_0x24d0('0xe'),_0x24d0('0xf'),_0x24d0('0x10'),_0x24d0('0x11'),_0x24d0('0x12'),_0x24d0('0x13'),_0x24d0('0x14'),'queuecallerabandonAt']},'log':_0x24d0('0x15')});};}; \ No newline at end of file +var _0x1d11=['CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerabandon','queuecallerabandonAt','moment','lodash','../client','create','Request'];(function(_0x32f53,_0x50be78){var _0x9b8ba8=function(_0x147be8){while(--_0x147be8){_0x32f53['push'](_0x32f53['shift']());}};_0x9b8ba8(++_0x50be78);}(_0x1d11,0xb6));var _0x11d1=function(_0x56ff5e,_0x257c79){_0x56ff5e=_0x56ff5e-0x0;var _0x26d7c6=_0x1d11[_0x56ff5e];return _0x26d7c6;};'use strict';var moment=require(_0x11d1('0x0'));var _=require(_0x11d1('0x1'));var client=require(_0x11d1('0x2'));exports[_0x11d1('0x3')]=function(_0x444b12){return client[_0x11d1('0x4')](_0x11d1('0x5'),{'body':_0x444b12,'log':_0x11d1('0x5')});};exports[_0x11d1('0x6')]=function(){return function(){return client[_0x11d1('0x4')](_0x11d1('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x11d1('0x8'))['format'](_0x11d1('0x9')),moment()[_0x11d1('0xa')]('day')['format'](_0x11d1('0x9'))]}},'attributes':[_0x11d1('0xb'),'queue','queuecallerjoinAt',_0x11d1('0xc'),_0x11d1('0xd'),_0x11d1('0xe'),'queuecallerexit','queuecallerexitAt',_0x11d1('0xf'),_0x11d1('0x10')]},'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 4e9cbe4..167714a 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 _0x3515=['../client','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x26299e,_0x394ad1){var _0x6c4f4a=function(_0x539ae9){while(--_0x539ae9){_0x26299e['push'](_0x26299e['shift']());}};_0x6c4f4a(++_0x394ad1);}(_0x3515,0xfc));var _0x5351=function(_0x2320fb,_0x57f439){_0x2320fb=_0x2320fb-0x0;var _0x6d7936=_0x3515[_0x2320fb];return _0x6d7936;};'use strict';var client=require(_0x5351('0x0'));exports['getVoiceQueueRtPauses']=function(_0x4d00d5){return function(){return client['Request'](_0x5351('0x1'),{'options':{'where':{'VoiceQueueId':_0x4d00d5,'paused':!![]},'raw':!![]},'log':_0x5351('0x2')});};}; \ No newline at end of file +var _0x9cdb=['Request','../client','getVoiceQueueRtPauses'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0x9cdb,0x1ed));var _0xb9cd=function(_0x496bf8,_0x3b8e85){_0x496bf8=_0x496bf8-0x0;var _0x394c90=_0x9cdb[_0x496bf8];return _0x394c90;};'use strict';var client=require(_0xb9cd('0x0'));exports[_0xb9cd('0x1')]=function(_0x38e656){return function(){return client[_0xb9cd('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x38e656,'paused':!![]},'raw':!![]},'log':_0xb9cd('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 2ae8104..8272397 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 _0xcc54=['CreateVoiceRecording','merge','monitorFilename','lodash','create','Request'];(function(_0xb27308,_0x2e1866){var _0x47e2d9=function(_0x3c25ba){while(--_0x3c25ba){_0xb27308['push'](_0xb27308['shift']());}};_0x47e2d9(++_0x2e1866);}(_0xcc54,0x14d));var _0x4cc5=function(_0x43fd72,_0x5efcc1){_0x43fd72=_0x43fd72-0x0;var _0x2c3d15=_0xcc54[_0x43fd72];return _0x2c3d15;};'use strict';var _=require(_0x4cc5('0x0'));var client=require('../client');exports[_0x4cc5('0x1')]=function(_0x7f3811){return client[_0x4cc5('0x2')](_0x4cc5('0x3'),{'body':_[_0x4cc5('0x4')](_0x7f3811,{'value':_0x7f3811[_0x4cc5('0x5')]}),'log':_0x4cc5('0x3')});}; \ No newline at end of file +var _0x5ebb=['create','Request','CreateVoiceRecording','merge','monitorFilename','../client'];(function(_0x250540,_0x48e7db){var _0x54c7da=function(_0x1220fe){while(--_0x1220fe){_0x250540['push'](_0x250540['shift']());}};_0x54c7da(++_0x48e7db);}(_0x5ebb,0xb9));var _0xb5eb=function(_0x326d34,_0x3ade6c){_0x326d34=_0x326d34-0x0;var _0x53839d=_0x5ebb[_0x326d34];return _0x53839d;};'use strict';var _=require('lodash');var client=require(_0xb5eb('0x0'));exports[_0xb5eb('0x1')]=function(_0x18ed51){return client[_0xb5eb('0x2')](_0xb5eb('0x3'),{'body':_[_0xb5eb('0x4')](_0x18ed51,{'value':_0x18ed51[_0xb5eb('0x5')]}),'log':_0xb5eb('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index b201efe..7bf1ac2 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 _0xc311=['context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','isexternal'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0xc311,0x83));var _0x1c31=function(_0x438179,_0x136a2b){_0x438179=_0x438179-0x0;var _0x2632cd=_0xc311[_0x438179];return _0x2632cd;};'use strict';var client=require('../client');exports[_0x1c31('0x0')]=function(_0x4475b0){return client[_0x1c31('0x1')](_0x1c31('0x2'),{'body':{'result':_0x4475b0[_0x1c31('0x3')],'transfererchannel':_0x4475b0[_0x1c31('0x4')],'transferercalleridnum':_0x4475b0['transferercalleridnum'],'transferercalleridname':_0x4475b0[_0x1c31('0x5')],'transfererconnectedlinenum':_0x4475b0[_0x1c31('0x6')],'transfererconnectedlinename':_0x4475b0['transfererconnectedlinename'],'transfereraccountcode':_0x4475b0[_0x1c31('0x7')],'transferercontext':_0x4475b0[_0x1c31('0x8')],'transfererexten':_0x4475b0['transfererexten'],'transfererlinkedid':_0x4475b0[_0x1c31('0x9')],'transfereechannel':_0x4475b0[_0x1c31('0xa')],'transfereecalleridnum':_0x4475b0[_0x1c31('0xb')],'transfereecalleridname':_0x4475b0['transfereecalleridname'],'transfereeconnectedlinenum':_0x4475b0[_0x1c31('0xc')],'transfereeconnectedlinename':_0x4475b0[_0x1c31('0xd')],'transfereeaccountcode':_0x4475b0['transfereeaccountcode'],'transfereecontext':_0x4475b0[_0x1c31('0xe')],'transfereeexten':_0x4475b0['transfereeexten'],'transfereelinkedid':_0x4475b0[_0x1c31('0xf')],'isexternal':_0x4475b0[_0x1c31('0x10')],'context':_0x4475b0[_0x1c31('0x11')],'extension':_0x4475b0[_0x1c31('0x12')],'type':_0x1c31('0x13')},'log':_0x1c31('0x2')});};exports[_0x1c31('0x14')]=function(_0x1e878a){return client['Request'](_0x1c31('0x2'),{'body':{'result':_0x1e878a[_0x1c31('0x3')],'transfererchannel':_0x1e878a[_0x1c31('0x15')],'transferercalleridnum':_0x1e878a[_0x1c31('0x16')],'transferercalleridname':_0x1e878a[_0x1c31('0x17')],'transfererconnectedlinenum':_0x1e878a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1e878a['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1e878a[_0x1c31('0x18')],'transferercontext':_0x1e878a[_0x1c31('0x19')],'transfererexten':_0x1e878a[_0x1c31('0x1a')],'transfererlinkedid':_0x1e878a[_0x1c31('0x1b')],'transfereechannel':_0x1e878a[_0x1c31('0x1c')],'transfereecalleridnum':_0x1e878a[_0x1c31('0x1d')],'transfereecalleridname':_0x1e878a[_0x1c31('0x1e')],'transfereeconnectedlinenum':_0x1e878a['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1e878a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1e878a['transfertargetaccountcode'],'transfereecontext':_0x1e878a[_0x1c31('0x1f')],'transfereeexten':_0x1e878a[_0x1c31('0x20')],'transfereelinkedid':_0x1e878a[_0x1c31('0x21')],'isexternal':_0x1e878a[_0x1c31('0x10')],'context':_0x1e878a[_0x1c31('0x22')],'extension':_0x1e878a[_0x1c31('0x23')],'type':_0x1c31('0x24')},'log':_0x1c31('0x2')});}; \ No newline at end of file +var _0x21c5=['result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','Request','CreateVoiceTransferReport'];(function(_0x5454e2,_0x576f66){var _0x5b9409=function(_0x52b3dd){while(--_0x52b3dd){_0x5454e2['push'](_0x5454e2['shift']());}};_0x5b9409(++_0x576f66);}(_0x21c5,0x1c5));var _0x521c=function(_0x3b164e,_0x19d969){_0x3b164e=_0x3b164e-0x0;var _0x4c6a52=_0x21c5[_0x3b164e];return _0x4c6a52;};'use strict';var client=require('../client');exports['blindTransfer']=function(_0x1c1488){return client[_0x521c('0x0')](_0x521c('0x1'),{'body':{'result':_0x1c1488[_0x521c('0x2')],'transfererchannel':_0x1c1488['transfererchannel'],'transferercalleridnum':_0x1c1488[_0x521c('0x3')],'transferercalleridname':_0x1c1488[_0x521c('0x4')],'transfererconnectedlinenum':_0x1c1488[_0x521c('0x5')],'transfererconnectedlinename':_0x1c1488[_0x521c('0x6')],'transfereraccountcode':_0x1c1488[_0x521c('0x7')],'transferercontext':_0x1c1488[_0x521c('0x8')],'transfererexten':_0x1c1488[_0x521c('0x9')],'transfererlinkedid':_0x1c1488[_0x521c('0xa')],'transfereechannel':_0x1c1488[_0x521c('0xb')],'transfereecalleridnum':_0x1c1488[_0x521c('0xc')],'transfereecalleridname':_0x1c1488[_0x521c('0xd')],'transfereeconnectedlinenum':_0x1c1488['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1c1488[_0x521c('0xe')],'transfereeaccountcode':_0x1c1488['transfereeaccountcode'],'transfereecontext':_0x1c1488[_0x521c('0xf')],'transfereeexten':_0x1c1488[_0x521c('0x10')],'transfereelinkedid':_0x1c1488[_0x521c('0x11')],'isexternal':_0x1c1488[_0x521c('0x12')],'context':_0x1c1488[_0x521c('0x13')],'extension':_0x1c1488[_0x521c('0x14')],'type':_0x521c('0x15')},'log':_0x521c('0x1')});};exports[_0x521c('0x16')]=function(_0x2150f9){return client[_0x521c('0x0')](_0x521c('0x1'),{'body':{'result':_0x2150f9[_0x521c('0x2')],'transfererchannel':_0x2150f9[_0x521c('0x17')],'transferercalleridnum':_0x2150f9[_0x521c('0x18')],'transferercalleridname':_0x2150f9['origtransferercalleridname'],'transfererconnectedlinenum':_0x2150f9['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2150f9[_0x521c('0x19')],'transfereraccountcode':_0x2150f9[_0x521c('0x1a')],'transferercontext':_0x2150f9['secondtransferercontext'],'transfererexten':_0x2150f9['secondtransfererexten'],'transfererlinkedid':_0x2150f9[_0x521c('0x1b')],'transfereechannel':_0x2150f9['transfertargetchannel'],'transfereecalleridnum':_0x2150f9[_0x521c('0x1c')],'transfereecalleridname':_0x2150f9[_0x521c('0x1d')],'transfereeconnectedlinenum':_0x2150f9['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2150f9['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2150f9[_0x521c('0x1e')],'transfereecontext':_0x2150f9[_0x521c('0x1f')],'transfereeexten':_0x2150f9[_0x521c('0x20')],'transfereelinkedid':_0x2150f9['transfertargetlinkedid'],'isexternal':_0x2150f9['isexternal'],'context':_0x2150f9[_0x521c('0x21')],'extension':_0x2150f9[_0x521c('0x22')],'type':'attended'},'log':_0x521c('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index cddad69..e858d52 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 _0x7e46=['/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','context','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','checkAfterSend','server','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Action','then','message','command','content','catch','voiceQueues','hasOwnProperty','answered','available','loggedIn','pTalking','talking','total','type','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','push','length','values','channels','map','find','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors'];(function(_0x23be40,_0xa67d16){var _0xe8b6bb=function(_0x41593f){while(--_0x41593f){_0x23be40['push'](_0x23be40['shift']());}};_0xe8b6bb(++_0xa67d16);}(_0x7e46,0x11e));var _0x67e4=function(_0x162627,_0xdc5211){_0x162627=_0x162627-0x0;var _0x4fc15a=_0x7e46[_0x162627];return _0x4fc15a;};'use strict';var _=require(_0x67e4('0x0'));var util=require(_0x67e4('0x1'));var jayson=require(_0x67e4('0x2'));var schema=require(_0x67e4('0x3'));var BPromise=require(_0x67e4('0x4'));var moment=require(_0x67e4('0x5'));var config=require(_0x67e4('0x6'));var properties=require(_0x67e4('0x7'));var ami=require(_0x67e4('0x8'));exports[_0x67e4('0x9')]=function(_0x416db8,_0x5a1989,_0x41f526){return new BPromise(function(_0x38b548,_0x5e7560){var _0x31e0c4={'QueuePause':function(_0xf24d55){return new Promise(function(_0x4fce6b,_0x47f203){var _0x55625b=util[_0x67e4('0xa')](_0x67e4('0xb'),'SIP',_0xf24d55['name']);if(_0x416db8[_0x67e4('0xc')]&&_0x416db8[_0x67e4('0xc')][_0x55625b]&&_0x416db8[_0x67e4('0xc')][_0x55625b][_0x67e4('0xd')]){_0x416db8[_0x67e4('0xc')][_0x55625b][_0x67e4('0xe')]();}if(_0x416db8[_0x67e4('0xf')][_0x55625b]){_0x416db8['agents'][_0x55625b][_0x67e4('0x10')]({'statePause':_0xf24d55[_0x67e4('0x11')]?!![]:![]});}_0x4fce6b({'code':0xc8,'message':_0x67e4('0x12')});});},'Reload':function(_0x6de1e1){var _0x1966f4=this;return new Promise(function(_0x1fcd8c,_0x24f2aa){if(ami[_0x67e4('0x13')]()==![]){return _0x24f2aa(_0x1966f4[_0x67e4('0x14')](0x1f4,[config[_0x67e4('0x15')]['ip'],config[_0x67e4('0x15')][_0x67e4('0x16')],_0x67e4('0x17')][_0x67e4('0x18')]('\x20')));}_0x6de1e1=_[_0x67e4('0x19')](_0x6de1e1,_[_0x67e4('0x1a')](properties[_0x67e4('0x1b')]));_0x6de1e1[_0x67e4('0x1c')]='Reload';return ami[_0x67e4('0x1d')](_0x6de1e1)[_0x67e4('0x1e')](function(_0x49bb4e){_0x1fcd8c({'code':0xc8,'message':_0x49bb4e[_0x67e4('0x1f')]});})['catch'](function(_0x503235){_0x24f2aa(_0x1966f4[_0x67e4('0x14')](0x1f5,_0x503235[_0x67e4('0x1f')]));});});},'Command':function(_0x4fbd63){var _0x297c1f=this;return new Promise(function(_0x2ea85f,_0xe9d59d){if(ami[_0x67e4('0x13')]()==![]){return _0xe9d59d(_0x297c1f[_0x67e4('0x14')](0x1f4,[config[_0x67e4('0x15')]['ip'],config[_0x67e4('0x15')][_0x67e4('0x16')],_0x67e4('0x17')][_0x67e4('0x18')]('\x20')));}_0x4fbd63=_[_0x67e4('0x19')](_0x4fbd63,_0x67e4('0x20'));_0x4fbd63['action']='Command';return ami[_0x67e4('0x1d')](_0x4fbd63)[_0x67e4('0x1e')](function(_0x12e070){_0x2ea85f({'code':0xc8,'message':_0x12e070[_0x67e4('0x21')]});})[_0x67e4('0x22')](function(_0x741cb3){_0xe9d59d(_0x297c1f[_0x67e4('0x14')](0x1f5,_0x741cb3[_0x67e4('0x1f')]));});});},'VoiceQueues':function(_0x2fd114){return new Promise(function(_0x5b5823,_0x5e1c0d){var _0x4358cc=[];for(var _0x47cec0 in _0x416db8[_0x67e4('0x23')]){if(_0x416db8['voiceQueues'][_0x67e4('0x24')](_0x47cec0)){var _0x3bf782=_0x416db8['voiceQueues'][_0x47cec0];var _0x3db8d0={'id':_0x3bf782['id'],'name':_0x3bf782['name'],'strategy':_0x3bf782['strategy'],'answered':_0x3bf782[_0x67e4('0x25')],'available':_0x3bf782[_0x67e4('0x26')],'loggedIn':_0x3bf782[_0x67e4('0x27')],'pTalking':_0x3bf782[_0x67e4('0x28')],'sumBillable':_0x3bf782['sumBillable'],'sumDuration':_0x3bf782['sumDuration'],'sumHoldTime':_0x3bf782['sumHoldTime']||0x0,'talking':_0x3bf782[_0x67e4('0x29')],'total':_0x3bf782[_0x67e4('0x2a')],'type':_0x3bf782[_0x67e4('0x2b')],'unmanaged':_0x3bf782['unmanaged'],'abandoned':_0x3bf782[_0x67e4('0x2c')],'waiting':_0x3bf782[_0x67e4('0x2d')],'loggedInDb':_0x3bf782['loggedInDb']};if(_0x3bf782[_0x67e4('0x2b')]==='outbound'){_0x3db8d0[_0x67e4('0x2e')]=_0x3bf782[_0x67e4('0x2e')];_0x3db8d0[_0x67e4('0x2f')]=_0x3bf782['dialMethod'];_0x3db8d0[_0x67e4('0x30')]=_0x3bf782['dialOriginateCallerIdName'];_0x3db8d0['dialOriginateCallerIdNumber']=_0x3bf782[_0x67e4('0x31')];_0x3db8d0[_0x67e4('0x32')]=_0x3bf782[_0x67e4('0x32')];_0x3db8d0[_0x67e4('0x33')]=_0x3bf782[_0x67e4('0x33')];_0x3db8d0['outboundAnswerAgiCallsDay']=_0x3bf782[_0x67e4('0x34')];_0x3db8d0[_0x67e4('0x35')]=_0x3bf782['outboundAnswerCallsDay'];_0x3db8d0['outboundBlacklistCallsDay']=_0x3bf782['outboundBlacklistCallsDay'];_0x3db8d0[_0x67e4('0x36')]=_0x3bf782[_0x67e4('0x36')];_0x3db8d0[_0x67e4('0x37')]=_0x3bf782[_0x67e4('0x37')];_0x3db8d0[_0x67e4('0x38')]=_0x3bf782[_0x67e4('0x38')];_0x3db8d0[_0x67e4('0x39')]=_0x3bf782[_0x67e4('0x39')];_0x3db8d0[_0x67e4('0x3a')]=_0x3bf782[_0x67e4('0x3a')];_0x3db8d0[_0x67e4('0x3b')]=_0x3bf782[_0x67e4('0x3b')];_0x3db8d0[_0x67e4('0x3c')]=_0x3bf782[_0x67e4('0x3c')];_0x3db8d0[_0x67e4('0x3d')]=_0x3bf782[_0x67e4('0x3d')];_0x3db8d0[_0x67e4('0x3e')]=_0x3bf782[_0x67e4('0x3e')];_0x3db8d0['outboundRejectCallsDay']=_0x3bf782[_0x67e4('0x3f')];_0x3db8d0[_0x67e4('0x40')]=_0x3bf782['outboundUnknownCallsDay'];_0x3db8d0['predictiveIntervalAnsweredCalls']=_0x3bf782[_0x67e4('0x41')];_0x3db8d0['predictiveIntervalAvgHoldtime']=_0x3bf782[_0x67e4('0x42')];_0x3db8d0[_0x67e4('0x43')]=_0x3bf782[_0x67e4('0x43')];_0x3db8d0['predictiveIntervalDroppedCallsCallersExit']=_0x3bf782[_0x67e4('0x44')];_0x3db8d0[_0x67e4('0x45')]=_0x3bf782['predictiveIntervalDroppedCallsTimeout'];_0x3db8d0[_0x67e4('0x46')]=_0x3bf782['predictiveIntervalErlangCalls'];_0x3db8d0[_0x67e4('0x47')]=_0x3bf782['predictiveIntervalErlangCallsDroppedCalls'];_0x3db8d0[_0x67e4('0x48')]=_0x3bf782[_0x67e4('0x48')];_0x3db8d0['predictiveIntervalMultiplicativeFactor']=_0x3bf782[_0x67e4('0x49')];_0x3db8d0[_0x67e4('0x4a')]=_0x3bf782['predictiveIntervalPauses'];_0x3db8d0[_0x67e4('0x4b')]=_0x3bf782[_0x67e4('0x4b')];_0x3db8d0['predictiveIntervalTotalCalls']=_0x3bf782['predictiveIntervalTotalCalls'];_0x3db8d0['message']=_0x3bf782[_0x67e4('0x1f')];_0x3db8d0[_0x67e4('0x4c')]=_0x3bf782['originated'];_0x3db8d0[_0x67e4('0x4d')]=_0x3bf782[_0x67e4('0x4d')];_0x3db8d0[_0x67e4('0x4e')]=_0x3bf782[_0x67e4('0x4e')];_0x3db8d0[_0x67e4('0x4f')]=_0x3bf782[_0x67e4('0x4f')];_0x3db8d0['erlangBusyFactor']=_0x3bf782['erlangBusyFactor'];_0x3db8d0[_0x67e4('0x50')]=_0x3bf782[_0x67e4('0x50')];_0x3db8d0[_0x67e4('0x51')]=_0x3bf782[_0x67e4('0x51')];}if(_0x3bf782[_0x67e4('0x52')]){_0x3db8d0['Trunk']={'id':_0x3bf782[_0x67e4('0x52')]['id'],'name':_0x3bf782['Trunk'][_0x67e4('0x53')],'active':_0x3bf782[_0x67e4('0x52')][_0x67e4('0x54')],'callerid':_0x3bf782['Trunk'][_0x67e4('0x55')]};}if(_0x3bf782['Interval']){_0x3db8d0[_0x67e4('0x56')]={'id':_0x3bf782[_0x67e4('0x56')]['id'],'name':_0x3bf782['Interval'][_0x67e4('0x53')]};}_0x4358cc[_0x67e4('0x57')](_0x3db8d0);}}_0x5b5823({'count':_0x4358cc[_0x67e4('0x58')],'rows':_0x4358cc});});},'VoiceChannels':function(_0x2db9e3){return new Promise(function(_0x195b7e,_0x4bc237){var _0x49afab=_[_0x67e4('0x59')](_0x416db8[_0x67e4('0x5a')]);_0x195b7e({'count':_0x49afab[_0x67e4('0x58')],'rows':_0x49afab});});},'VoiceChannelMixMonitor':function(_0x3bb89d){var _0x4a6250=this;return new Promise(function(_0x2cd9d8,_0xbb3f99){if(ami[_0x67e4('0x13')]()==![]){return _0xbb3f99(_0x4a6250[_0x67e4('0x14')](0x1f4,[config[_0x67e4('0x15')]['ip'],config['asterisk'][_0x67e4('0x16')],_0x67e4('0x17')][_0x67e4('0x18')]('\x20')));}var _0x13628e=schema(properties['voicechannel'])[_0x67e4('0x3')](_0x3bb89d);if(_0x13628e[_0x67e4('0x58')]>0x0){return _0xbb3f99(_0x4a6250[_0x67e4('0x14')](0x1f4,_[_0x67e4('0x5b')](_0x13628e,_0x67e4('0x1f'))[_0x67e4('0x18')](',\x20')));}var _0x52fad9=_[_0x67e4('0x5c')](_0x416db8[_0x67e4('0x5a')],{'uniqueid':_0x3bb89d[_0x67e4('0x5d')]});if(_0x52fad9&&_0x52fad9[_0x67e4('0x5e')]){var _0x2ffd17=util[_0x67e4('0xa')](_0x67e4('0x5f'),_0x3bb89d[_0x67e4('0x60')]||_0x3bb89d['uniqueid'],_0x3bb89d['format']||_0x67e4('0x61'));return ami[_0x67e4('0x1d')]({'action':_0x67e4('0x62'),'channel':_0x52fad9[_0x67e4('0x5e')],'file':_0x2ffd17,'options':_0x67e4('0x63')})[_0x67e4('0x1e')](function(_0x2ae939){var _0x2e7322=_[_0x67e4('0x5c')](_0x52fad9[_0x67e4('0x64')],{'filename':_0x67e4('0x65')+_0x2ffd17[_0x67e4('0x66')]()});if(_[_0x67e4('0x67')](_0x2e7322)){_0x52fad9[_0x67e4('0x64')][_0x67e4('0x57')]({'filename':'/var/spool/asterisk/monitor/'+_0x2ffd17['toLowerCase'](),'createdAt':moment()[_0x67e4('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x2ae939[_0x67e4('0x68')],'status':_0x67e4('0x69')});}else{_0x2e7322[_0x67e4('0x68')]=_0x2ae939[_0x67e4('0x68')];_0x2e7322[_0x67e4('0x6a')]=_0x67e4('0x69');}_0x2cd9d8({'code':0xc8,'message':[_0x3bb89d[_0x67e4('0x5d')],_0x67e4('0x6b'),_0x2ae939[_0x67e4('0x68')]]['join']('\x20'),'mixmonitorid':_0x2ae939[_0x67e4('0x68')]});})['catch'](function(_0x582a5d){_0xbb3f99(_0x4a6250[_0x67e4('0x14')](0x1f5,[_0x3bb89d[_0x67e4('0x5d')],_0x582a5d[_0x67e4('0x1f')][_0x67e4('0x66')]()][_0x67e4('0x18')]('\x20')));});}else{return _0xbb3f99(_0x4a6250[_0x67e4('0x14')](0x1f5,_0x67e4('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x38e0cd){var _0x245c23=this;return new Promise(function(_0x54e94f,_0x344f9f){if(ami['isConnected']()==![]){return _0x344f9f(_0x245c23[_0x67e4('0x14')](0x1f4,[config[_0x67e4('0x15')]['ip'],config[_0x67e4('0x15')][_0x67e4('0x16')],_0x67e4('0x17')][_0x67e4('0x18')]('\x20')));}var _0x5303ea=schema(properties['voicechannel'])['validate'](_0x38e0cd);if(_0x5303ea[_0x67e4('0x58')]>0x0){return _0x344f9f(_0x245c23[_0x67e4('0x14')](0x1f4,_['map'](_0x5303ea,_0x67e4('0x1f'))[_0x67e4('0x18')](',\x20')));}var _0x23c920=_[_0x67e4('0x5c')](_0x416db8['channels'],{'uniqueid':_0x38e0cd[_0x67e4('0x5d')]});if(_0x23c920){return BPromise['resolve']()['then'](function(){if(_0x23c920[_0x67e4('0x5e')]){return ami['Action']({'action':_0x67e4('0x6d'),'channel':_0x23c920[_0x67e4('0x5e')],'mixmonitorid':_0x38e0cd['mixmonitorid']})['catch'](function(_0x264b23){});}})['then'](function(){if(_0x23c920[_0x67e4('0x6e')]){return ami[_0x67e4('0x1d')]({'action':_0x67e4('0x6d'),'channel':_0x23c920[_0x67e4('0x6e')],'mixmonitorid':_0x38e0cd[_0x67e4('0x68')]})[_0x67e4('0x22')](function(_0x2b965c){});}})['then'](function(_0x3eda2b){var _0x3addd6=_[_0x67e4('0x5c')](_0x23c920[_0x67e4('0x64')],{'mixmonitorid':_0x38e0cd[_0x67e4('0x68')]});if(_0x3addd6){_0x3addd6[_0x67e4('0x6a')]=_0x67e4('0x6f');}})[_0x67e4('0x1e')](function(){var _0x37615e=util[_0x67e4('0xa')]('%s.%s',_0x38e0cd['filename']||_0x38e0cd[_0x67e4('0x5d')],_0x38e0cd['format']||_0x67e4('0x61'));var _0x38bf69=_[_0x67e4('0x5c')](_0x23c920[_0x67e4('0x64')],{'filename':_0x67e4('0x65')+_0x37615e[_0x67e4('0x66')]()});if(_0x38bf69){_0x38bf69[_0x67e4('0x6a')]=_0x67e4('0x6f');}})[_0x67e4('0x1e')](function(){_0x54e94f({'code':0xc8,'message':[_0x38e0cd[_0x67e4('0x5d')],_0x67e4('0x70')]['join']('\x20')});})[_0x67e4('0x22')](function(_0x16bf84){_0x344f9f(_0x245c23['error'](0x1f5,[_0x38e0cd[_0x67e4('0x5d')],_0x16bf84[_0x67e4('0x1f')]['toLowerCase']()][_0x67e4('0x18')]('\x20')));});}else{return _0x344f9f(_0x245c23[_0x67e4('0x14')](0x1f5,_0x67e4('0x6c')));}});},'VoiceQueuesChannels':function(_0x25b3fd){return new Promise(function(_0x3cf701,_0x1a3893){var _0x26ebd9=_[_0x67e4('0x59')](_0x416db8[_0x67e4('0x71')]);_0x3cf701({'count':_0x26ebd9[_0x67e4('0x58')],'rows':_0x26ebd9});});},'VoiceQueuesChannel':function(_0xec5e3f){var _0x4b998f=this;return new Promise(function(_0x32de82,_0x47faa9){var _0x333a70=schema(properties[_0x67e4('0x72')])[_0x67e4('0x3')](_0xec5e3f);if(_0x333a70[_0x67e4('0x58')]>0x0){return _0x47faa9(_0x4b998f[_0x67e4('0x14')](0x1f4,_['map'](_0x333a70,_0x67e4('0x1f'))[_0x67e4('0x18')](',\x20')));}var _0x3416c8=_['find'](_0x416db8[_0x67e4('0x71')],{'uniqueid':_0xec5e3f[_0x67e4('0x5d')]});if(_0x3416c8){_0x32de82(_0x3416c8);}else{return _0x47faa9(_0x4b998f['error'](0x1f5,_0x67e4('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x37d027){var _0x3cd5bd=this;return new Promise(function(_0x170623,_0x320c42){if(ami[_0x67e4('0x13')]()==![]){return _0x320c42(_0x3cd5bd[_0x67e4('0x14')](0x1f4,[config[_0x67e4('0x15')]['ip'],config[_0x67e4('0x15')]['username'],'ami\x20disconnected'][_0x67e4('0x18')]('\x20')));}var _0x3b9083=schema(properties[_0x67e4('0x73')])[_0x67e4('0x3')](_0x37d027);if(_0x3b9083[_0x67e4('0x58')]>0x0){return _0x320c42(_0x3cd5bd[_0x67e4('0x14')](0x1f4,_['map'](_0x3b9083,_0x67e4('0x1f'))[_0x67e4('0x18')](',\x20')));}var _0x35c29d=_[_0x67e4('0x5c')](_0x416db8[_0x67e4('0x71')],{'uniqueid':_0x37d027[_0x67e4('0x5d')]});if(_0x35c29d&&_0x35c29d['channel']){return ami[_0x67e4('0x1d')]({'action':_0x67e4('0x74'),'channel':_0x35c29d[_0x67e4('0x5e')]})[_0x67e4('0x1e')](function(_0x3e843f){_0x170623({'code':0xc8,'message':[_0x37d027[_0x67e4('0x5d')],_0x3e843f['message'][_0x67e4('0x66')]()][_0x67e4('0x18')]('\x20')});})[_0x67e4('0x22')](function(_0x2536ff){_0x320c42(_0x3cd5bd[_0x67e4('0x14')](0x1f5,[_0x37d027[_0x67e4('0x5d')],_0x2536ff[_0x67e4('0x1f')]['toLowerCase']()][_0x67e4('0x18')]('\x20')));});}else{return _0x320c42(_0x3cd5bd[_0x67e4('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x398c0f){var _0x9ca28e=this;return new Promise(function(_0x1b87c8,_0x24ee40){if(ami[_0x67e4('0x13')]()==![]){return _0x24ee40(_0x9ca28e[_0x67e4('0x14')](0x1f4,[config[_0x67e4('0x15')]['ip'],config[_0x67e4('0x15')][_0x67e4('0x16')],_0x67e4('0x17')][_0x67e4('0x18')]('\x20')));}var _0x19efed=schema(properties[_0x67e4('0x75')])['validate'](_0x398c0f);if(_0x19efed[_0x67e4('0x58')]>0x0){return _0x24ee40(_0x9ca28e[_0x67e4('0x14')](0x1f4,_[_0x67e4('0x5b')](_0x19efed,_0x67e4('0x1f'))['join'](',\x20')));}var _0xb7bb5a=_[_0x67e4('0x5c')](_0x416db8['queueChannels'],{'uniqueid':_0x398c0f[_0x67e4('0x5d')]});if(_0xb7bb5a&&_0xb7bb5a[_0x67e4('0x5e')]){return ami[_0x67e4('0x1d')]({'action':'Redirect','channel':_0xb7bb5a['channel'],'exten':_0x398c0f['exten'],'context':_0x398c0f[_0x67e4('0x76')]||_0xb7bb5a['context'],'priority':0x1})[_0x67e4('0x1e')](function(_0x389b74){_0x1b87c8({'code':0xc8,'message':[_0x398c0f[_0x67e4('0x5d')],_0x389b74[_0x67e4('0x1f')][_0x67e4('0x66')]()]['join']('\x20')});})[_0x67e4('0x22')](function(_0x4cb2aa){_0x24ee40(_0x9ca28e[_0x67e4('0x14')](0x1f5,[_0x398c0f[_0x67e4('0x5d')],_0x4cb2aa[_0x67e4('0x1f')][_0x67e4('0x66')]()][_0x67e4('0x18')]('\x20')));});}else{return _0x24ee40(_0x9ca28e[_0x67e4('0x14')](0x1f5,_0x67e4('0x6c')));}});},'Agents':function(_0x1511fd){return new Promise(function(_0x33c153,_0x236a30){var _0x2a893e=_[_0x67e4('0x59')](_0x416db8['agents']);_0x33c153({'count':_0x2a893e[_0x67e4('0x58')],'rows':_0x2a893e});});},'Telephones':function(_0x3b5002){return new Promise(function(_0x3ec1f1,_0x3a6742){var _0x41ddf2=_[_0x67e4('0x59')](_0x416db8['telephones']);_0x3ec1f1({'count':_0x41ddf2[_0x67e4('0x58')],'rows':_0x41ddf2});});},'Trunks':function(_0x53670f){return new Promise(function(_0x318eb4,_0x58e49e){var _0x380294=_[_0x67e4('0x59')](_0x416db8['trunks']);_0x318eb4({'count':_0x380294['length'],'rows':_0x380294});});},'OutboundChannels':function(_0x51a17f){return new Promise(function(_0x5e13ce,_0x5b680a){var _0x423c68=_[_0x67e4('0x59')](_0x416db8['outboundChannels']);_0x5e13ce({'count':_0x423c68[_0x67e4('0x58')],'rows':_0x423c68});});},'Outbound':function(_0x9e5b5e){return new Promise(function(_0x525780,_0x4c5910){_0x525780(_0x416db8['outbound']);});},'Campaigns':function(_0x325b82){return new Promise(function(_0x58c119,_0x55bb90){var _0xd7ffb5=_[_0x67e4('0x59')](_0x416db8['campaigns']);_0x58c119({'count':_0xd7ffb5[_0x67e4('0x58')],'rows':_0xd7ffb5});});},'VoiceQueuesPreview':function(_0x843bf1){var _0x4d77f5=this;return new Promise(function(_0x4ef76a,_0x296c5c){_0x5a1989[_0x67e4('0x77')](_0x843bf1['id'])[_0x67e4('0x1e')](function(_0x33db4b){_0x4ef76a({'code':0xc8,'message':_0x33db4b[_0x67e4('0x1f')]});})[_0x67e4('0x22')](function(_0x33f3ae){_0x296c5c(_0x4d77f5[_0x67e4('0x14')](0x1f4,_0x33f3ae[_0x67e4('0x1f')]));});});},'EventManager':function(_0x3444e0){var _0x3b1815=this;return new Promise(function(_0x295b1a,_0x49b51e){if(!_0x3444e0['event']){return _0x49b51e(_0x3b1815[_0x67e4('0x14')](0x1f4,_0x67e4('0x78')));}ami[_0x67e4('0x79')](_0x67e4('0x7a')+_0x3444e0[_0x67e4('0x7b')],_0x3444e0[_0x67e4('0x1f')]);_0x295b1a({'code':0xc8,'message':_0x3444e0});});},'FaxAccounts':function(_0x35ee49){return new Promise(function(_0xff75a0,_0x4c2314){var _0x157914=_[_0x67e4('0x59')](_0x416db8[_0x67e4('0x7c')]);_0xff75a0({'count':_0x157914['length'],'rows':_0x157914});});},'SendFax':function(_0x1b6062){var _0x553ca3=this;return new Promise(function(_0xfe863,_0x47ab81){_0x41f526['send'](_0x1b6062)[_0x67e4('0x1e')](function(_0x193042){_0xfe863({'code':0xc8,'message':_0x193042[_0x67e4('0x1f')]});})[_0x67e4('0x22')](function(_0x2c1178){_0x47ab81(_0x553ca3[_0x67e4('0x14')](0x1f4,_0x2c1178[_0x67e4('0x1f')]));});});},'CheckAfterSend':function(_0x44f40b){var _0x2e9a42=this;return new Promise(function(_0x436ada,_0x2e57de){_0x41f526[_0x67e4('0x7d')](_0x44f40b)[_0x67e4('0x1e')](function(_0xc51fbe){_0x436ada({'code':0xc8,'message':_0xc51fbe[_0x67e4('0x1f')]});})['catch'](function(_0x54f2a0){_0x2e57de(_0x2e9a42[_0x67e4('0x14')](0x1f4,_0x54f2a0[_0x67e4('0x1f')]));});});}};var _0x1f0f71=jayson[_0x67e4('0x7e')](_0x31e0c4)['http']();_0x1f0f71['on'](_0x67e4('0x14'),function(_0x54b161){return _0x5e7560(_0x54b161);});_0x1f0f71[_0x67e4('0x9')](0x232a,_0x67e4('0x7f'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x38b548(_0x67e4('0x80')+0x232a);});});}; \ No newline at end of file +var _0x6507=['join','pick','keys','action','Reload','Action','then','message','username','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','values','channels','voicechannel','map','find','channel','%s.%s','filename','wav','ai(mixmonitorid)','toLowerCase','isNil','monitors','push','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','uniqueid','MixMonitor\x20Success','catch','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','moment','../properties','../ami','listen','format','name','timers','timer','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','ami\x20disconnected'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0x6507,0x182));var _0x7650=function(_0x596142,_0x1ebb4b){_0x596142=_0x596142-0x0;var _0x583f99=_0x6507[_0x596142];return _0x583f99;};'use strict';var _=require(_0x7650('0x0'));var util=require(_0x7650('0x1'));var jayson=require(_0x7650('0x2'));var schema=require(_0x7650('0x3'));var BPromise=require('bluebird');var moment=require(_0x7650('0x4'));var config=require('../../../config/environment');var properties=require(_0x7650('0x5'));var ami=require(_0x7650('0x6'));exports[_0x7650('0x7')]=function(_0x34313f,_0x1c44a0,_0x2086eb){return new BPromise(function(_0x21aa96,_0x1d1e8f){var _0x4b2cf8={'QueuePause':function(_0x146ee8){return new Promise(function(_0x1371d8,_0x4a53dc){var _0x58e8f7=util[_0x7650('0x8')]('%s/%s','SIP',_0x146ee8[_0x7650('0x9')]);if(_0x34313f[_0x7650('0xa')]&&_0x34313f[_0x7650('0xa')][_0x58e8f7]&&_0x34313f['timers'][_0x58e8f7][_0x7650('0xb')]){_0x34313f[_0x7650('0xa')][_0x58e8f7]['updateAcw']();}if(_0x34313f[_0x7650('0xc')][_0x58e8f7]){_0x34313f[_0x7650('0xc')][_0x58e8f7][_0x7650('0xd')]({'statePause':_0x146ee8['pause']?!![]:![]});}_0x1371d8({'code':0xc8,'message':_0x7650('0xe')});});},'Reload':function(_0x359703){var _0x365e57=this;return new Promise(function(_0x5a5d36,_0x3f04aa){if(ami[_0x7650('0xf')]()==![]){return _0x3f04aa(_0x365e57[_0x7650('0x10')](0x1f4,[config[_0x7650('0x11')]['ip'],config[_0x7650('0x11')]['username'],_0x7650('0x12')][_0x7650('0x13')]('\x20')));}_0x359703=_[_0x7650('0x14')](_0x359703,_[_0x7650('0x15')](properties['module']));_0x359703[_0x7650('0x16')]=_0x7650('0x17');return ami[_0x7650('0x18')](_0x359703)[_0x7650('0x19')](function(_0x3620e7){_0x5a5d36({'code':0xc8,'message':_0x3620e7[_0x7650('0x1a')]});})['catch'](function(_0x4f8e26){_0x3f04aa(_0x365e57[_0x7650('0x10')](0x1f5,_0x4f8e26['message']));});});},'Command':function(_0x396375){var _0x5df266=this;return new Promise(function(_0x443fb6,_0x94b66d){if(ami[_0x7650('0xf')]()==![]){return _0x94b66d(_0x5df266['error'](0x1f4,[config[_0x7650('0x11')]['ip'],config[_0x7650('0x11')][_0x7650('0x1b')],_0x7650('0x12')][_0x7650('0x13')]('\x20')));}_0x396375=_['pick'](_0x396375,_0x7650('0x1c'));_0x396375[_0x7650('0x16')]=_0x7650('0x1d');return ami['Action'](_0x396375)['then'](function(_0x28731e){_0x443fb6({'code':0xc8,'message':_0x28731e[_0x7650('0x1e')]});})['catch'](function(_0x525042){_0x94b66d(_0x5df266[_0x7650('0x10')](0x1f5,_0x525042[_0x7650('0x1a')]));});});},'VoiceQueues':function(_0x14867d){return new Promise(function(_0x5c04f9,_0x441dd1){var _0x431875=[];for(var _0x50bb22 in _0x34313f[_0x7650('0x1f')]){if(_0x34313f['voiceQueues'][_0x7650('0x20')](_0x50bb22)){var _0x1e5923=_0x34313f[_0x7650('0x1f')][_0x50bb22];var _0x19c599={'id':_0x1e5923['id'],'name':_0x1e5923[_0x7650('0x9')],'strategy':_0x1e5923[_0x7650('0x21')],'answered':_0x1e5923[_0x7650('0x22')],'available':_0x1e5923[_0x7650('0x23')],'loggedIn':_0x1e5923[_0x7650('0x24')],'pTalking':_0x1e5923['pTalking'],'sumBillable':_0x1e5923[_0x7650('0x25')],'sumDuration':_0x1e5923[_0x7650('0x26')],'sumHoldTime':_0x1e5923[_0x7650('0x27')]||0x0,'talking':_0x1e5923[_0x7650('0x28')],'total':_0x1e5923[_0x7650('0x29')],'type':_0x1e5923['type'],'unmanaged':_0x1e5923[_0x7650('0x2a')],'abandoned':_0x1e5923['abandoned'],'waiting':_0x1e5923[_0x7650('0x2b')],'loggedInDb':_0x1e5923[_0x7650('0x2c')]};if(_0x1e5923[_0x7650('0x2d')]===_0x7650('0x2e')){_0x19c599[_0x7650('0x2f')]=_0x1e5923[_0x7650('0x2f')];_0x19c599[_0x7650('0x30')]=_0x1e5923['dialMethod'];_0x19c599['dialOriginateCallerIdName']=_0x1e5923[_0x7650('0x31')];_0x19c599[_0x7650('0x32')]=_0x1e5923['dialOriginateCallerIdNumber'];_0x19c599[_0x7650('0x33')]=_0x1e5923[_0x7650('0x33')];_0x19c599[_0x7650('0x34')]=_0x1e5923[_0x7650('0x34')];_0x19c599[_0x7650('0x35')]=_0x1e5923[_0x7650('0x35')];_0x19c599[_0x7650('0x36')]=_0x1e5923[_0x7650('0x36')];_0x19c599[_0x7650('0x37')]=_0x1e5923['outboundBlacklistCallsDay'];_0x19c599[_0x7650('0x38')]=_0x1e5923[_0x7650('0x38')];_0x19c599[_0x7650('0x39')]=_0x1e5923[_0x7650('0x39')];_0x19c599[_0x7650('0x3a')]=_0x1e5923[_0x7650('0x3a')];_0x19c599[_0x7650('0x3b')]=_0x1e5923[_0x7650('0x3b')];_0x19c599[_0x7650('0x3c')]=_0x1e5923[_0x7650('0x3c')];_0x19c599[_0x7650('0x3d')]=_0x1e5923['outboundNoAnswerCallsDay'];_0x19c599['outboundNoSuchCallsDay']=_0x1e5923[_0x7650('0x3e')];_0x19c599[_0x7650('0x3f')]=_0x1e5923[_0x7650('0x3f')];_0x19c599[_0x7650('0x40')]=_0x1e5923[_0x7650('0x40')];_0x19c599[_0x7650('0x41')]=_0x1e5923[_0x7650('0x41')];_0x19c599[_0x7650('0x42')]=_0x1e5923[_0x7650('0x42')];_0x19c599[_0x7650('0x43')]=_0x1e5923[_0x7650('0x43')];_0x19c599[_0x7650('0x44')]=_0x1e5923[_0x7650('0x44')];_0x19c599['predictiveIntervalAvgTalktime']=_0x1e5923['predictiveIntervalAvgTalktime'];_0x19c599[_0x7650('0x45')]=_0x1e5923[_0x7650('0x45')];_0x19c599[_0x7650('0x46')]=_0x1e5923[_0x7650('0x46')];_0x19c599[_0x7650('0x47')]=_0x1e5923[_0x7650('0x47')];_0x19c599[_0x7650('0x48')]=_0x1e5923['predictiveIntervalErlangCallsDroppedCalls'];_0x19c599[_0x7650('0x49')]=_0x1e5923[_0x7650('0x49')];_0x19c599['predictiveIntervalMultiplicativeFactor']=_0x1e5923[_0x7650('0x4a')];_0x19c599[_0x7650('0x4b')]=_0x1e5923[_0x7650('0x4b')];_0x19c599[_0x7650('0x4c')]=_0x1e5923['predictiveIntervalAvailable'];_0x19c599[_0x7650('0x4d')]=_0x1e5923[_0x7650('0x4d')];_0x19c599[_0x7650('0x1a')]=_0x1e5923[_0x7650('0x1a')];_0x19c599[_0x7650('0x4e')]=_0x1e5923[_0x7650('0x4e')];_0x19c599[_0x7650('0x4f')]=_0x1e5923[_0x7650('0x4f')];_0x19c599['erlangCallToSecond']=_0x1e5923[_0x7650('0x50')];_0x19c599[_0x7650('0x51')]=_0x1e5923[_0x7650('0x51')];_0x19c599[_0x7650('0x52')]=_0x1e5923[_0x7650('0x52')];_0x19c599[_0x7650('0x53')]=_0x1e5923[_0x7650('0x53')];_0x19c599[_0x7650('0x54')]=_0x1e5923['startProgressive'];}if(_0x1e5923['Trunk']){_0x19c599['Trunk']={'id':_0x1e5923[_0x7650('0x55')]['id'],'name':_0x1e5923[_0x7650('0x55')][_0x7650('0x9')],'active':_0x1e5923[_0x7650('0x55')][_0x7650('0x56')],'callerid':_0x1e5923[_0x7650('0x55')]['callerid']};}if(_0x1e5923[_0x7650('0x57')]){_0x19c599['Interval']={'id':_0x1e5923[_0x7650('0x57')]['id'],'name':_0x1e5923[_0x7650('0x57')][_0x7650('0x9')]};}_0x431875['push'](_0x19c599);}}_0x5c04f9({'count':_0x431875[_0x7650('0x58')],'rows':_0x431875});});},'VoiceChannels':function(_0x24bba6){return new Promise(function(_0x591d41,_0x4228b7){var _0x568821=_[_0x7650('0x59')](_0x34313f[_0x7650('0x5a')]);_0x591d41({'count':_0x568821[_0x7650('0x58')],'rows':_0x568821});});},'VoiceChannelMixMonitor':function(_0x1440af){var _0x546935=this;return new Promise(function(_0x273914,_0x303312){if(ami[_0x7650('0xf')]()==![]){return _0x303312(_0x546935[_0x7650('0x10')](0x1f4,[config[_0x7650('0x11')]['ip'],config[_0x7650('0x11')]['username'],_0x7650('0x12')][_0x7650('0x13')]('\x20')));}var _0xa84b35=schema(properties[_0x7650('0x5b')])[_0x7650('0x3')](_0x1440af);if(_0xa84b35[_0x7650('0x58')]>0x0){return _0x303312(_0x546935['error'](0x1f4,_[_0x7650('0x5c')](_0xa84b35,_0x7650('0x1a'))[_0x7650('0x13')](',\x20')));}var _0x174872=_[_0x7650('0x5d')](_0x34313f['channels'],{'uniqueid':_0x1440af['uniqueid']});if(_0x174872&&_0x174872[_0x7650('0x5e')]){var _0x15130=util[_0x7650('0x8')](_0x7650('0x5f'),_0x1440af[_0x7650('0x60')]||_0x1440af['uniqueid'],_0x1440af[_0x7650('0x8')]||_0x7650('0x61'));return ami['Action']({'action':'MixMonitor','channel':_0x174872['channel'],'file':_0x15130,'options':_0x7650('0x62')})[_0x7650('0x19')](function(_0x3caede){var _0x2a9134=_[_0x7650('0x5d')](_0x174872['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x15130[_0x7650('0x63')]()});if(_[_0x7650('0x64')](_0x2a9134)){_0x174872[_0x7650('0x65')][_0x7650('0x66')]({'filename':_0x7650('0x67')+_0x15130['toLowerCase'](),'createdAt':moment()['format'](_0x7650('0x68')),'mixmonitorid':_0x3caede[_0x7650('0x69')],'status':_0x7650('0x6a')});}else{_0x2a9134[_0x7650('0x69')]=_0x3caede[_0x7650('0x69')];_0x2a9134[_0x7650('0x6b')]=_0x7650('0x6a');}_0x273914({'code':0xc8,'message':[_0x1440af[_0x7650('0x6c')],_0x7650('0x6d'),_0x3caede['mixmonitorid']][_0x7650('0x13')]('\x20'),'mixmonitorid':_0x3caede['mixmonitorid']});})[_0x7650('0x6e')](function(_0x4e4c4a){_0x303312(_0x546935[_0x7650('0x10')](0x1f5,[_0x1440af['uniqueid'],_0x4e4c4a[_0x7650('0x1a')][_0x7650('0x63')]()][_0x7650('0x13')]('\x20')));});}else{return _0x303312(_0x546935[_0x7650('0x10')](0x1f5,_0x7650('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x2c4a47){var _0x4b57b4=this;return new Promise(function(_0xbeaf6d,_0x392fca){if(ami['isConnected']()==![]){return _0x392fca(_0x4b57b4['error'](0x1f4,[config[_0x7650('0x11')]['ip'],config[_0x7650('0x11')][_0x7650('0x1b')],'ami\x20disconnected'][_0x7650('0x13')]('\x20')));}var _0xf3dbef=schema(properties[_0x7650('0x5b')])[_0x7650('0x3')](_0x2c4a47);if(_0xf3dbef[_0x7650('0x58')]>0x0){return _0x392fca(_0x4b57b4[_0x7650('0x10')](0x1f4,_[_0x7650('0x5c')](_0xf3dbef,_0x7650('0x1a'))[_0x7650('0x13')](',\x20')));}var _0x391403=_['find'](_0x34313f[_0x7650('0x5a')],{'uniqueid':_0x2c4a47[_0x7650('0x6c')]});if(_0x391403){return BPromise[_0x7650('0x70')]()['then'](function(){if(_0x391403['channel']){return ami[_0x7650('0x18')]({'action':_0x7650('0x71'),'channel':_0x391403[_0x7650('0x5e')],'mixmonitorid':_0x2c4a47[_0x7650('0x69')]})[_0x7650('0x6e')](function(_0x3e9173){});}})[_0x7650('0x19')](function(){if(_0x391403[_0x7650('0x72')]){return ami[_0x7650('0x18')]({'action':'StopMixMonitor','channel':_0x391403[_0x7650('0x72')],'mixmonitorid':_0x2c4a47['mixmonitorid']})[_0x7650('0x6e')](function(_0x424147){});}})['then'](function(_0x10c533){var _0x15ab6b=_[_0x7650('0x5d')](_0x391403[_0x7650('0x65')],{'mixmonitorid':_0x2c4a47[_0x7650('0x69')]});if(_0x15ab6b){_0x15ab6b[_0x7650('0x6b')]=_0x7650('0x73');}})[_0x7650('0x19')](function(){var _0x2b44f4=util[_0x7650('0x8')](_0x7650('0x5f'),_0x2c4a47['filename']||_0x2c4a47[_0x7650('0x6c')],_0x2c4a47[_0x7650('0x8')]||_0x7650('0x61'));var _0x3a12da=_[_0x7650('0x5d')](_0x391403[_0x7650('0x65')],{'filename':_0x7650('0x67')+_0x2b44f4[_0x7650('0x63')]()});if(_0x3a12da){_0x3a12da[_0x7650('0x6b')]=_0x7650('0x73');}})['then'](function(){_0xbeaf6d({'code':0xc8,'message':[_0x2c4a47[_0x7650('0x6c')],'StopMixMonitor\x20Success'][_0x7650('0x13')]('\x20')});})[_0x7650('0x6e')](function(_0x28d3bd){_0x392fca(_0x4b57b4[_0x7650('0x10')](0x1f5,[_0x2c4a47[_0x7650('0x6c')],_0x28d3bd[_0x7650('0x1a')][_0x7650('0x63')]()][_0x7650('0x13')]('\x20')));});}else{return _0x392fca(_0x4b57b4[_0x7650('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0xbcf695){return new Promise(function(_0x9eb913,_0x295f3c){var _0x5bc294=_[_0x7650('0x59')](_0x34313f['queueChannels']);_0x9eb913({'count':_0x5bc294[_0x7650('0x58')],'rows':_0x5bc294});});},'VoiceQueuesChannel':function(_0x23d15f){var _0x14f6f0=this;return new Promise(function(_0x110c44,_0x1c61cb){var _0x3a23bb=schema(properties[_0x7650('0x74')])[_0x7650('0x3')](_0x23d15f);if(_0x3a23bb[_0x7650('0x58')]>0x0){return _0x1c61cb(_0x14f6f0[_0x7650('0x10')](0x1f4,_[_0x7650('0x5c')](_0x3a23bb,_0x7650('0x1a'))[_0x7650('0x13')](',\x20')));}var _0x3bb803=_['find'](_0x34313f[_0x7650('0x75')],{'uniqueid':_0x23d15f[_0x7650('0x6c')]});if(_0x3bb803){_0x110c44(_0x3bb803);}else{return _0x1c61cb(_0x14f6f0[_0x7650('0x10')](0x1f5,_0x7650('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x9cf11e){var _0x2ee74c=this;return new Promise(function(_0x12e5d0,_0x1f410f){if(ami[_0x7650('0xf')]()==![]){return _0x1f410f(_0x2ee74c[_0x7650('0x10')](0x1f4,[config[_0x7650('0x11')]['ip'],config[_0x7650('0x11')][_0x7650('0x1b')],_0x7650('0x12')][_0x7650('0x13')]('\x20')));}var _0x1d8482=schema(properties['voicequeuechannelhangup'])[_0x7650('0x3')](_0x9cf11e);if(_0x1d8482['length']>0x0){return _0x1f410f(_0x2ee74c[_0x7650('0x10')](0x1f4,_[_0x7650('0x5c')](_0x1d8482,_0x7650('0x1a'))['join'](',\x20')));}var _0x8fddcc=_[_0x7650('0x5d')](_0x34313f[_0x7650('0x75')],{'uniqueid':_0x9cf11e['uniqueid']});if(_0x8fddcc&&_0x8fddcc[_0x7650('0x5e')]){return ami[_0x7650('0x18')]({'action':_0x7650('0x76'),'channel':_0x8fddcc['channel']})[_0x7650('0x19')](function(_0x33cd48){_0x12e5d0({'code':0xc8,'message':[_0x9cf11e[_0x7650('0x6c')],_0x33cd48['message'][_0x7650('0x63')]()]['join']('\x20')});})[_0x7650('0x6e')](function(_0xbcffb7){_0x1f410f(_0x2ee74c[_0x7650('0x10')](0x1f5,[_0x9cf11e[_0x7650('0x6c')],_0xbcffb7[_0x7650('0x1a')][_0x7650('0x63')]()][_0x7650('0x13')]('\x20')));});}else{return _0x1f410f(_0x2ee74c['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x232dfa){var _0x5af586=this;return new Promise(function(_0x45c1a9,_0xba84a){if(ami[_0x7650('0xf')]()==![]){return _0xba84a(_0x5af586[_0x7650('0x10')](0x1f4,[config[_0x7650('0x11')]['ip'],config[_0x7650('0x11')]['username'],_0x7650('0x12')]['join']('\x20')));}var _0x4779f1=schema(properties[_0x7650('0x77')])[_0x7650('0x3')](_0x232dfa);if(_0x4779f1[_0x7650('0x58')]>0x0){return _0xba84a(_0x5af586[_0x7650('0x10')](0x1f4,_[_0x7650('0x5c')](_0x4779f1,'message')['join'](',\x20')));}var _0x38bc5d=_[_0x7650('0x5d')](_0x34313f[_0x7650('0x75')],{'uniqueid':_0x232dfa['uniqueid']});if(_0x38bc5d&&_0x38bc5d['channel']){return ami[_0x7650('0x18')]({'action':_0x7650('0x78'),'channel':_0x38bc5d[_0x7650('0x5e')],'exten':_0x232dfa[_0x7650('0x79')],'context':_0x232dfa[_0x7650('0x7a')]||_0x38bc5d[_0x7650('0x7a')],'priority':0x1})[_0x7650('0x19')](function(_0x263d35){_0x45c1a9({'code':0xc8,'message':[_0x232dfa[_0x7650('0x6c')],_0x263d35['message'][_0x7650('0x63')]()][_0x7650('0x13')]('\x20')});})['catch'](function(_0x622293){_0xba84a(_0x5af586[_0x7650('0x10')](0x1f5,[_0x232dfa[_0x7650('0x6c')],_0x622293['message']['toLowerCase']()]['join']('\x20')));});}else{return _0xba84a(_0x5af586[_0x7650('0x10')](0x1f5,_0x7650('0x6f')));}});},'Agents':function(_0x44dd54){return new Promise(function(_0x1e7f1e,_0xff7bf9){var _0x2a6d17=_['values'](_0x34313f[_0x7650('0xc')]);_0x1e7f1e({'count':_0x2a6d17[_0x7650('0x58')],'rows':_0x2a6d17});});},'Telephones':function(_0x5898d1){return new Promise(function(_0x5ff0ad,_0x169f06){var _0x3dbfd2=_[_0x7650('0x59')](_0x34313f[_0x7650('0x7b')]);_0x5ff0ad({'count':_0x3dbfd2[_0x7650('0x58')],'rows':_0x3dbfd2});});},'Trunks':function(_0xf40789){return new Promise(function(_0x3573b0,_0x3a08b5){var _0x281a0b=_[_0x7650('0x59')](_0x34313f['trunks']);_0x3573b0({'count':_0x281a0b[_0x7650('0x58')],'rows':_0x281a0b});});},'OutboundChannels':function(_0x4faeef){return new Promise(function(_0x56839d,_0x3c857a){var _0x3e60b1=_['values'](_0x34313f[_0x7650('0x7c')]);_0x56839d({'count':_0x3e60b1[_0x7650('0x58')],'rows':_0x3e60b1});});},'Outbound':function(_0x1f815f){return new Promise(function(_0x20728b,_0x3f45de){_0x20728b(_0x34313f[_0x7650('0x2e')]);});},'Campaigns':function(_0x425ef6){return new Promise(function(_0x305c13,_0x2f7d61){var _0x4fef11=_[_0x7650('0x59')](_0x34313f[_0x7650('0x7d')]);_0x305c13({'count':_0x4fef11['length'],'rows':_0x4fef11});});},'VoiceQueuesPreview':function(_0x5cd655){var _0x1e936a=this;return new Promise(function(_0x12abe7,_0x153976){_0x1c44a0['run'](_0x5cd655['id'])[_0x7650('0x19')](function(_0x20f1e1){_0x12abe7({'code':0xc8,'message':_0x20f1e1[_0x7650('0x1a')]});})['catch'](function(_0x4c3d61){_0x153976(_0x1e936a[_0x7650('0x10')](0x1f4,_0x4c3d61['message']));});});},'EventManager':function(_0x3e86d){var _0x20bc2f=this;return new Promise(function(_0x225edb,_0x2ec4b3){if(!_0x3e86d[_0x7650('0x7e')]){return _0x2ec4b3(_0x20bc2f['error'](0x1f4,_0x7650('0x7f')));}ami[_0x7650('0x80')](_0x7650('0x81')+_0x3e86d['event'],_0x3e86d[_0x7650('0x1a')]);_0x225edb({'code':0xc8,'message':_0x3e86d});});},'FaxAccounts':function(_0x2f3a94){return new Promise(function(_0x54a500,_0x173c5b){var _0x270f2c=_[_0x7650('0x59')](_0x34313f['faxAccounts']);_0x54a500({'count':_0x270f2c[_0x7650('0x58')],'rows':_0x270f2c});});},'SendFax':function(_0x1230b5){var _0x437513=this;return new Promise(function(_0x4e12db,_0x3f35d0){_0x2086eb[_0x7650('0x82')](_0x1230b5)[_0x7650('0x19')](function(_0x25f4f7){_0x4e12db({'code':0xc8,'message':_0x25f4f7[_0x7650('0x1a')]});})[_0x7650('0x6e')](function(_0x3ce713){_0x3f35d0(_0x437513[_0x7650('0x10')](0x1f4,_0x3ce713[_0x7650('0x1a')]));});});},'CheckAfterSend':function(_0x5372b4){var _0x5d6ebc=this;return new Promise(function(_0x38e82d,_0x2a7830){_0x2086eb[_0x7650('0x83')](_0x5372b4)[_0x7650('0x19')](function(_0x22aaec){_0x38e82d({'code':0xc8,'message':_0x22aaec['message']});})['catch'](function(_0x36672e){_0x2a7830(_0x5d6ebc[_0x7650('0x10')](0x1f4,_0x36672e[_0x7650('0x1a')]));});});}};var _0x13d069=jayson[_0x7650('0x84')](_0x4b2cf8)['http']();_0x13d069['on'](_0x7650('0x10'),function(_0x471f74){return _0x1d1e8f(_0x471f74);});_0x13d069[_0x7650('0x7')](0x232a,'127.0.0.1',function(){console[_0x7650('0x85')](_0x7650('0x86'),0x232a);return _0x21aa96('RPC\x20listening\x20on\x20port:'+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 fa97177..21f463a 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 _0x2dd8=['catch','error','Error\x20creating\x20contact','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','stringify','emit','exec','data2','data1','calleridnum','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','then','showContact','omit','xmd-contactid2','format','user:%s','name','action','toLowerCase','merge','createContact','trigger:%s'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2dd8,0x143));var _0x82dd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2dd8[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var _=require('lodash');var Redis=require('ioredis');var config=require(_0x82dd('0x2'));var logger=require(_0x82dd('0x3'))(_0x82dd('0x4'));var cmContactRpc=require(_0x82dd('0x5'));config[_0x82dd('0x6')]=_[_0x82dd('0x7')](config[_0x82dd('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x82dd('0x8'))(new Redis(config[_0x82dd('0x6')]));function emit(_0x416be0,_0x2e9d89,_0x54fb28){logger[_0x82dd('0x9')](_0x416be0,_0x2e9d89,JSON[_0x82dd('0xa')](_0x54fb28));io['to'](_0x416be0)[_0x82dd('0xb')](_0x2e9d89,_0x54fb28);}exports[_0x82dd('0xc')]=function(_0x488126,_0x4a2fa6,_0x332c36){_0x332c36['autoCreate']=0x0;if(_0x4a2fa6[_0x82dd('0xd')]&&parseInt(_0x4a2fa6[_0x82dd('0xd')],0xa)){var _0x17b31e={'ListId':parseInt(_0x4a2fa6[_0x82dd('0xe')],0xa),'phone':_0x332c36[_0x82dd('0xf')]};if(_['isNil'](_0x332c36[_0x82dd('0x10')])){_0x17b31e[_0x82dd('0x11')]=_0x332c36[_0x82dd('0x12')]&&_0x332c36[_0x82dd('0x12')]!==_0x82dd('0x13')?_0x332c36['calleridname']:_0x332c36['calleridnum']||_0x332c36[_0x82dd('0x14')];}else{_0x17b31e[_0x82dd('0x11')]=_0x332c36[_0x82dd('0x15')]&&_0x332c36[_0x82dd('0x15')]!==_0x82dd('0x13')?_0x332c36[_0x82dd('0x15')]:_0x332c36[_0x82dd('0x16')]||_0x332c36[_0x82dd('0x14')];_0x17b31e[_0x82dd('0x17')]=_0x332c36[_0x82dd('0x15')]&&_0x332c36[_0x82dd('0x15')]!==_0x82dd('0x13')?_0x332c36[_0x82dd('0x15')]:_0x332c36['destcalleridnum']||_0x332c36[_0x82dd('0x14')];}BPromise[_0x82dd('0x18')]()[_0x82dd('0x19')](cmContactRpc[_0x82dd('0x1a')]({'where':_[_0x82dd('0x1b')](_0x17b31e,[_0x82dd('0x11')])}))[_0x82dd('0x19')](function(_0x1e8ea2){if(_0x1e8ea2){_0x332c36[_0x82dd('0x1c')]=_0x1e8ea2['id'];emit(util[_0x82dd('0x1d')](_0x82dd('0x1e'),_0x488126[_0x82dd('0x1f')]),util[_0x82dd('0x1d')]('trigger:%s',_0x4a2fa6[_0x82dd('0x20')][_0x82dd('0x21')]()),_[_0x82dd('0x22')](_0x332c36,{'ListId':parseInt(_0x4a2fa6[_0x82dd('0xe')],0xa)}));return;}else{return BPromise[_0x82dd('0x18')]()[_0x82dd('0x19')](cmContactRpc[_0x82dd('0x23')](_0x17b31e));}})[_0x82dd('0x19')](function(_0x4c8c7f){if(_0x4c8c7f){_0x332c36['xmd-contactid2']=_0x4c8c7f['id'];emit(util[_0x82dd('0x1d')](_0x82dd('0x1e'),_0x488126['name']),util['format'](_0x82dd('0x24'),_0x4a2fa6[_0x82dd('0x20')][_0x82dd('0x21')]()),_[_0x82dd('0x22')](_0x332c36,{'ListId':parseInt(_0x4a2fa6[_0x82dd('0xe')],0xa)}));}})[_0x82dd('0x25')](function(_0x17eb32){logger[_0x82dd('0x26')](_0x82dd('0x27'),JSON[_0x82dd('0xa')](_0x17eb32));});}else{if(_0x488126){emit(util[_0x82dd('0x1d')](_0x82dd('0x1e'),_0x488126[_0x82dd('0x1f')]),util[_0x82dd('0x1d')]('trigger:%s',_0x4a2fa6[_0x82dd('0x20')][_0x82dd('0x21')]()),_[_0x82dd('0x22')]({'ListId':parseInt(_0x4a2fa6['data1'],0xa)},_0x332c36));}}}; \ No newline at end of file +var _0xa5c1=['../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','exec','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','destcalleridname','','destcalleridnum','uniqueid','then','showContact','omit','xmd-contactid2','user:%s','name','format','action','toLowerCase','merge','resolve','createContact','trigger:%s','catch','error','bluebird','util','lodash'];(function(_0x2c3df4,_0x22b905){var _0x21fcad=function(_0x127f4f){while(--_0x127f4f){_0x2c3df4['push'](_0x2c3df4['shift']());}};_0x21fcad(++_0x22b905);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x43b934,_0x4ee0cd){_0x43b934=_0x43b934-0x0;var _0x1dbf70=_0xa5c1[_0x43b934];return _0x1dbf70;};'use strict';var BPromise=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var _=require(_0x1a5c('0x2'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x1a5c('0x3'))('trigger');var cmContactRpc=require(_0x1a5c('0x4'));config[_0x1a5c('0x5')]=_[_0x1a5c('0x6')](config[_0x1a5c('0x5')],{'host':_0x1a5c('0x7'),'port':0x18eb});var io=require(_0x1a5c('0x8'))(new Redis(config['redis']));function emit(_0x9853,_0x580a2e,_0x438f8f){logger[_0x1a5c('0x9')](_0x9853,_0x580a2e,JSON[_0x1a5c('0xa')](_0x438f8f));io['to'](_0x9853)['emit'](_0x580a2e,_0x438f8f);}exports[_0x1a5c('0xb')]=function(_0x4c0bd2,_0x211e4b,_0x4edb10){_0x4edb10['autoCreate']=0x0;if(_0x211e4b[_0x1a5c('0xc')]&&parseInt(_0x211e4b[_0x1a5c('0xc')],0xa)){var _0x5b3de2={'ListId':parseInt(_0x211e4b[_0x1a5c('0xd')],0xa),'phone':_0x4edb10[_0x1a5c('0xe')]};if(_[_0x1a5c('0xf')](_0x4edb10[_0x1a5c('0x10')])){_0x5b3de2[_0x1a5c('0x11')]=_0x4edb10[_0x1a5c('0x12')]&&_0x4edb10[_0x1a5c('0x12')]!==''?_0x4edb10[_0x1a5c('0x12')]:_0x4edb10[_0x1a5c('0xe')]||_0x4edb10['uniqueid'];}else{_0x5b3de2[_0x1a5c('0x11')]=_0x4edb10[_0x1a5c('0x13')]&&_0x4edb10['destcalleridname']!==_0x1a5c('0x14')?_0x4edb10[_0x1a5c('0x13')]:_0x4edb10[_0x1a5c('0x15')]||_0x4edb10[_0x1a5c('0x16')];_0x5b3de2['phone']=_0x4edb10[_0x1a5c('0x13')]&&_0x4edb10['destcalleridname']!==_0x1a5c('0x14')?_0x4edb10[_0x1a5c('0x13')]:_0x4edb10[_0x1a5c('0x15')]||_0x4edb10['uniqueid'];}BPromise['resolve']()[_0x1a5c('0x17')](cmContactRpc[_0x1a5c('0x18')]({'where':_[_0x1a5c('0x19')](_0x5b3de2,[_0x1a5c('0x11')])}))[_0x1a5c('0x17')](function(_0x57edcd){if(_0x57edcd){_0x4edb10[_0x1a5c('0x1a')]=_0x57edcd['id'];emit(util['format'](_0x1a5c('0x1b'),_0x4c0bd2[_0x1a5c('0x1c')]),util[_0x1a5c('0x1d')]('trigger:%s',_0x211e4b[_0x1a5c('0x1e')][_0x1a5c('0x1f')]()),_[_0x1a5c('0x20')](_0x4edb10,{'ListId':parseInt(_0x211e4b[_0x1a5c('0xd')],0xa)}));return;}else{return BPromise[_0x1a5c('0x21')]()['then'](cmContactRpc[_0x1a5c('0x22')](_0x5b3de2));}})[_0x1a5c('0x17')](function(_0x8e81fa){if(_0x8e81fa){_0x4edb10[_0x1a5c('0x1a')]=_0x8e81fa['id'];emit(util[_0x1a5c('0x1d')](_0x1a5c('0x1b'),_0x4c0bd2[_0x1a5c('0x1c')]),util[_0x1a5c('0x1d')](_0x1a5c('0x23'),_0x211e4b[_0x1a5c('0x1e')][_0x1a5c('0x1f')]()),_[_0x1a5c('0x20')](_0x4edb10,{'ListId':parseInt(_0x211e4b['data1'],0xa)}));}})[_0x1a5c('0x24')](function(_0x501397){logger[_0x1a5c('0x25')]('Error\x20creating\x20contact',JSON[_0x1a5c('0xa')](_0x501397));});}else{if(_0x4c0bd2){emit(util[_0x1a5c('0x1d')](_0x1a5c('0x1b'),_0x4c0bd2[_0x1a5c('0x1c')]),util[_0x1a5c('0x1d')](_0x1a5c('0x23'),_0x211e4b[_0x1a5c('0x1e')][_0x1a5c('0x1f')]()),_[_0x1a5c('0x20')]({'ListId':parseInt(_0x211e4b[_0x1a5c('0xd')],0xa)},_0x4edb10));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index dd9323b..2d0c207 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 _0xc1fe=['./cmContact','../rpc/cmContact','../../../config/logger','trigger','../ami','redis','defaults','localhost','triggers','agents','templates','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','zendeskAccounts','sugarcrmAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','syncAgentDial','custom:dialconnect','custom:dialend','custom:outgoingmessage','custom:acceptmessage','emit','info','stringify','clone','prototype','interface','status','checkTrigger','merge','variables','length','Actions','action','toLowerCase','contactmanager','browser','data1','popup','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','data6','600','winApplication','winArguments','user:%s','trigger:%s:%s','format','name','trigger:%s','exec','voiceQueues','queue','voiceExtensions','routeId','urlforward','script','parse','replace','AllConditions','every','checkConditions','AnyConditions','some','field','account','chat','ChatWebsiteId','value','upperFirst','AccountId','operator','message','channel','event','agent','membername','lastevent','exports','util','url','mustache','ioredis','./urlforward','./integration'];(function(_0x4c8890,_0x34c779){var _0x2e7ed5=function(_0x6ba2c6){while(--_0x6ba2c6){_0x4c8890['push'](_0x4c8890['shift']());}};_0x2e7ed5(++_0x34c779);}(_0xc1fe,0xd4));var _0xec1f=function(_0x489f89,_0x241edf){_0x489f89=_0x489f89-0x0;var _0x1ae31a=_0xc1fe[_0x489f89];return _0x1ae31a;};'use strict';var util=require(_0xec1f('0x0'));var _=require('lodash');var url=require(_0xec1f('0x1'));var Mustache=require(_0xec1f('0x2'));var Redis=require(_0xec1f('0x3'));var urlforward=require(_0xec1f('0x4'));var integration=require(_0xec1f('0x5'));var cmContact=require(_0xec1f('0x6'));var script=require('./script');var cmContactRpc=require(_0xec1f('0x7'));var config=require('../../../config/environment');var logger=require(_0xec1f('0x8'))(_0xec1f('0x9'));var ami=require(_0xec1f('0xa'));config[_0xec1f('0xb')]=_[_0xec1f('0xc')](config[_0xec1f('0xb')],{'host':_0xec1f('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xec1f('0xb')]));var operators={'equals':function(_0x5329a8,_0x65fd46){return _0x5329a8==_0x65fd46;},'not_equals':function(_0x486b9c,_0x1f7cb2){return _0x486b9c!=_0x1f7cb2;}};var barAndWebActions=['popup','url','winapp'];function Trigger(_0x5cc5cd){this[_0xec1f('0xe')]=_0x5cc5cd[_0xec1f('0xe')];this[_0xec1f('0xf')]=_0x5cc5cd[_0xec1f('0xf')];this['voiceQueues']=_0x5cc5cd['voiceQueues'];this[_0xec1f('0x10')]=_0x5cc5cd[_0xec1f('0x10')];this['voiceExtensions']=_0x5cc5cd['voiceExtensions'];this['zendeskAccounts']=_0x5cc5cd['zendeskAccounts'];this[_0xec1f('0x11')]=_0x5cc5cd['freshdeskAccounts'];this[_0xec1f('0x12')]=_0x5cc5cd[_0xec1f('0x12')];this['sugarcrmAccounts']=_0x5cc5cd['sugarcrmAccounts'];this[_0xec1f('0x13')]=_0x5cc5cd['zohoAccounts'];this[_0xec1f('0x14')]=_0x5cc5cd[_0xec1f('0x14')];this[_0xec1f('0x15')]=_0x5cc5cd[_0xec1f('0x15')];this['servicenowAccounts']=_0x5cc5cd[_0xec1f('0x16')];this[_0xec1f('0x17')]=_0x5cc5cd[_0xec1f('0x17')];this[_0xec1f('0x18')]=_0x5cc5cd['freshsalesAccounts'];this['accounts']={'zendesk':this[_0xec1f('0x19')],'salesforce':this[_0xec1f('0x12')],'freshdesk':this[_0xec1f('0x11')],'sugarcrm':this[_0xec1f('0x1a')],'zoho':this[_0xec1f('0x13')],'desk':this[_0xec1f('0x14')],'vtiger':this[_0xec1f('0x15')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xec1f('0x18')],'servicenow':this[_0xec1f('0x16')]};ami['on'](_0xec1f('0x1b'),this[_0xec1f('0x1c')][_0xec1f('0x1d')](this));ami['on'](_0xec1f('0x1e'),this[_0xec1f('0x1c')][_0xec1f('0x1d')](this));ami['on'](_0xec1f('0x1f'),this['syncCustomEvent'][_0xec1f('0x1d')](this));ami['on'](_0xec1f('0x20'),this[_0xec1f('0x1c')][_0xec1f('0x1d')](this));ami['on']('custom:queuecallerabandon',this[_0xec1f('0x1c')][_0xec1f('0x1d')](this));ami['on']('custom:dialbegin',this[_0xec1f('0x21')][_0xec1f('0x1d')](this));ami['on'](_0xec1f('0x22'),this['syncAgentDial'][_0xec1f('0x1d')](this));ami['on'](_0xec1f('0x23'),this[_0xec1f('0x21')]['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0xec1f('0x1d')](this));ami['on']('custom:closedinteraction',this[_0xec1f('0x1c')][_0xec1f('0x1d')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent']['bind'](this));ami['on'](_0xec1f('0x24'),this[_0xec1f('0x1c')][_0xec1f('0x1d')](this));ami['on'](_0xec1f('0x25'),this[_0xec1f('0x1c')][_0xec1f('0x1d')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0xec1f('0x1d')](this));}Trigger['prototype'][_0xec1f('0x26')]=function(_0x3a91f2,_0x132d2,_0x4918b8){logger[_0xec1f('0x27')](_0x3a91f2,_0x132d2,JSON[_0xec1f('0x28')](_0x4918b8));io['to'](_0x3a91f2)[_0xec1f('0x26')](_0x132d2,_0x4918b8);};Trigger['prototype']['syncCustomEvent']=function(_0xaec47f){var _0x198ca9=_[_0xec1f('0x29')](_0xaec47f);this['checkTriggers'](_0x198ca9);};Trigger[_0xec1f('0x2a')][_0xec1f('0x21')]=function(_0x2c6730){if(this[_0xec1f('0xf')][_0x2c6730[_0xec1f('0x2b')]]){this[_0xec1f('0x1c')](_0x2c6730);}};Trigger['prototype']['checkTriggers']=function(_0x21676d){var _0x4a0227;for(var _0x148ccf in this['triggers']){if(this['triggers']['hasOwnProperty'](_0x148ccf)){if(this[_0xec1f('0xe')][_0x148ccf][_0xec1f('0x2c')]){_0x4a0227=this[_0xec1f('0x2d')](this['triggers'][_0x148ccf],_0x21676d);if(_0x4a0227){_[_0xec1f('0x2e')](_0x21676d,_0x21676d[_0xec1f('0x2f')]);for(var _0x342361=0x0,_0x27c4a2,_0x33952b,_0x318e55;_0x3423610x0){_0x2ea8e9=_[_0xdeff('0x28')](_0x4dd366,_0x830be4);}return _0x2ea8e9;}function getCustomFields(_0x533069,_0xf9b278){var _0xbc75ee=[];var _0x4e0ff2={'custom_fields':{}};if(_0x533069[_0xdeff('0x27')]>0x0){_[_0xdeff('0x29')](_0x533069,function(_0x34e258){if(_0x34e258['type']==='string'&&_0x34e258[_0xdeff('0x2a')]&&!_0x34e258['customField']){_0x4e0ff2[_0x34e258[_0xdeff('0x2a')][_0xdeff('0x2b')]()]=_0x34e258[_0xdeff('0x2c')]['toString']();}else if(_0x34e258[_0xdeff('0x2d')]==='string'&&_0x34e258['idField']&&_0x34e258[_0xdeff('0x2e')]){_0x4e0ff2[_0xdeff('0x2f')][_0x34e258[_0xdeff('0x30')]]=_0x34e258[_0xdeff('0x2c')]['toString']();}else if(_0x34e258[_0xdeff('0x2d')]===_0xdeff('0x31')&&_0x34e258[_0xdeff('0x32')]&&_0x34e258[_0xdeff('0x30')]&&_0x34e258[_0xdeff('0x2e')]){_0xf9b278[_0x34e258[_0xdeff('0x32')]]&&(_0x4e0ff2[_0xdeff('0x2f')][_0x34e258['idField']]=_0xf9b278[_0x34e258[_0xdeff('0x32')]]['toString']());}else if(_0x34e258[_0xdeff('0x2d')]===_0xdeff('0x33')&&_0x34e258[_0xdeff('0x34')]&&_0x34e258[_0xdeff('0x34')][_0xdeff('0x35')]&&_0x34e258[_0xdeff('0x30')]&&_0x34e258['customField']){_0xf9b278[_0x34e258[_0xdeff('0x34')][_0xdeff('0x35')]['toLowerCase']()]&&(_0x4e0ff2[_0xdeff('0x2f')][_0x34e258[_0xdeff('0x30')]]=_0xf9b278[_0x34e258[_0xdeff('0x34')][_0xdeff('0x35')][_0xdeff('0x2b')]()][_0xdeff('0x21')]());}});}if(_0x4e0ff2[_0xdeff('0x36')]){_0x4e0ff2[_0xdeff('0x36')]=Number(_0x4e0ff2['priority']);}return _0x4e0ff2;}function getTicket(_0x118752,_0x4ad39d,_0x231893,_0x345032,_0x30f442){logger['info'](_0xdeff('0x37'));var _0x280a86=_[_0xdeff('0x38')]({'subject':intUtil[_0xdeff('0x39')](_0x345032[_0xdeff('0x3a')],_0x30f442,'\x20'),'type':'phone','status':_0xdeff('0x3b'),'labels':['xCALLY',_0xdeff('0x3c'),_0xdeff('0x3d')]['concat'](getTags(_0x345032[_0xdeff('0x3e')],_0xdeff('0x35'))),'description':intUtil[_0xdeff('0x39')](_0x345032[_0xdeff('0x3f')],_0x30f442,'\x0a'),'_links':{'assigned_user':{'href':util[_0xdeff('0x10')]('/api/v2/users/%d',_0x4ad39d['id']),'class':_0xdeff('0x40')}},'message':{'direction':'in','body':intUtil[_0xdeff('0x39')](_0x345032[_0xdeff('0x3f')],_0x30f442,'\x0a')}},getCustomFields(_0x345032[_0xdeff('0x41')],_0x30f442));return request({'uri':util[_0xdeff('0x10')]('%s/customers/%d/cases',_0x118752['remoteUri'],_0x231893['id']),'method':_0xdeff('0x26'),'body':_0x280a86});}exports[_0xdeff('0x42')]=function(_0x226db3,_0x318e77,_0x3c4fd2,_0x289f70,_0x2cd68a,_0x4f02f5){var _0x336762,_0x11be83;_0x4f02f5[_0xdeff('0x12')]=intUtil['stripTrailingSlash'](_0x4f02f5[_0xdeff('0x12')]);_0x4f02f5[_0xdeff('0x43')]=intUtil[_0xdeff('0x44')](_0x4f02f5[_0xdeff('0x43')]);if(_0x2cd68a&&_0x2cd68a['monitor_format']){logger[_0xdeff('0xe')](_0xdeff('0x45'),_0xdeff('0x46'));_0x318e77[_0xdeff('0x47')]=util[_0xdeff('0x10')](_0xdeff('0x48'),_0x4f02f5[_0xdeff('0x43')],_0x318e77[_0xdeff('0x49')],md5(_0x318e77['uniqueid']));}else{_0x318e77[_0xdeff('0x47')]='';}headers[_0xdeff('0x4a')]=getAuth(_0x4f02f5);return getUser(_0x4f02f5,_0x289f70[_0xdeff('0x4b')])[_0xdeff('0x13')](function(_0x21c18a){_0x336762=_0x21c18a;logger['info'](_0xdeff('0x4c'),_0x336762['id']);return getEndUser(_0x4f02f5,_0x318e77[_0xdeff('0x4d')],_0x318e77[_0xdeff('0x4e')]);})[_0xdeff('0x13')](function(_0x62a7df){_0x11be83=_0x62a7df;logger['info'](_0xdeff('0x4f'),_0x11be83['id']);return getTicket(_0x4f02f5,_0x336762,_0x11be83,_0x3c4fd2,_0x318e77);})['then'](function(_0x42c435){if(_0x42c435){logger[_0xdeff('0xe')](_0xdeff('0x50'));logger[_0xdeff('0xe')](_0xdeff('0x51'),_0x42c435['id']);switch(_0x4f02f5[_0xdeff('0x2d')]){case'integrationTab':logger['info'](_0xdeff('0x45'),_0xdeff('0x52'));emit(util[_0xdeff('0x10')]('user:%s',_0x289f70['name']),_0xdeff('0x53'),{'recordId':_0x42c435['id']});break;case _0xdeff('0x54'):logger['info'](_0xdeff('0x45'),_0xdeff('0x55'));emit(util[_0xdeff('0x10')]('user:%s',_0x289f70[_0xdeff('0x35')]),_0xdeff('0x56'),{'uri':util[_0xdeff('0x10')]('https://xcally.desk.com/web/agent/case/%d',_0x42c435['id'])});break;default:logger[_0xdeff('0x57')](_0xdeff('0x45'),_0xdeff('0x58'));}}})[_0xdeff('0x59')](function(_0x450c5d){console[_0xdeff('0x57')](_0x450c5d);logger[_0xdeff('0x57')]('[QUEUE]',JSON[_0xdeff('0x1a')](_0x450c5d));});};exports[_0xdeff('0x5a')]=function(_0x5e0c60,_0xe5a773,_0x1b676b,_0x2967b4,_0x33482b,_0x352c6e,_0xfb097c){var _0x473d9d,_0x2d6110;_0x352c6e['remoteUri']=intUtil[_0xdeff('0x44')](_0x352c6e[_0xdeff('0x12')]);_0x352c6e[_0xdeff('0x43')]=intUtil['stripTrailingSlash'](_0x352c6e['serverUrl']);if(_0xfb097c&&_0xfb097c[_0xdeff('0x5b')]&&_0xfb097c[_0xdeff('0x5b')]!==_0xdeff('0x5c')){logger[_0xdeff('0xe')](_0xdeff('0x5d'),_0xdeff('0x46'));_0xe5a773['recordingURL']=util['format'](_0xdeff('0x48'),_0x352c6e[_0xdeff('0x43')],_0xe5a773['uniqueid'],md5(_0xe5a773['uniqueid']));}headers[_0xdeff('0x4a')]=getAuth(_0x352c6e);return getUser(_0x352c6e,_0x2967b4[_0xdeff('0x4b')])['then'](function(_0x4107cf){_0x473d9d=_0x4107cf;logger[_0xdeff('0xe')]('The\x20User\x20ID\x20is:',_0x473d9d['id']);return getEndUser(_0x352c6e,_0xe5a773[_0xdeff('0x5e')],_0xe5a773[_0xdeff('0x5f')]);})['then'](function(_0x3087ea){_0x2d6110=_0x3087ea;logger[_0xdeff('0xe')]('The\x20Enduser\x20ID\x20is:',_0x2d6110['id']);return getTicket(_0x352c6e,_0x473d9d,_0x2d6110,_0x1b676b,_0xe5a773);})[_0xdeff('0x13')](function(_0x152187){if(_0x152187){logger[_0xdeff('0xe')]('Ticket\x20created!');logger['info'](_0xdeff('0x51'),_0x152187['id']);switch(_0x352c6e['type']){case _0xdeff('0x60'):logger[_0xdeff('0xe')](_0xdeff('0x45'),_0xdeff('0x52'));emit(util[_0xdeff('0x10')]('user:%s',_0x2967b4['name']),_0xdeff('0x53'),{'recordId':_0x152187['id']});break;case _0xdeff('0x54'):logger[_0xdeff('0xe')](_0xdeff('0x45'),_0xdeff('0x55'));emit(util[_0xdeff('0x10')]('user:%s',_0x2967b4[_0xdeff('0x35')]),'trigger:browser:url',{'uri':util[_0xdeff('0x10')](_0xdeff('0x61'),_0x352c6e[_0xdeff('0x12')],_0x152187['id'])});break;default:logger[_0xdeff('0x57')](_0xdeff('0x5d'),_0xdeff('0x58'));}}})[_0xdeff('0x59')](function(_0x1e6488){logger[_0xdeff('0x57')]('[OUTBOUND]',JSON[_0xdeff('0x1a')](_0x1e6488));});};exports['abandoned']=function(_0x3d4411,_0x19c9a1,_0x5a51d4,_0x286e4d,_0x492372,_0x2148fa){var _0x5dd5e4,_0x52bc12;_0x2148fa[_0xdeff('0x12')]=intUtil[_0xdeff('0x44')](_0x2148fa['remoteUri']);_0x2148fa[_0xdeff('0x43')]=intUtil[_0xdeff('0x44')](_0x2148fa[_0xdeff('0x43')]);if(_0x492372&&_0x492372[_0xdeff('0x62')]){logger[_0xdeff('0xe')](_0xdeff('0x63'),_0xdeff('0x46'));_0x19c9a1[_0xdeff('0x47')]=util[_0xdeff('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2148fa[_0xdeff('0x43')],_0x19c9a1[_0xdeff('0x49')],md5(_0x19c9a1['uniqueid']));}else{_0x19c9a1['recordingURL']='';}headers[_0xdeff('0x4a')]=getAuth(_0x2148fa);return getUser(_0x2148fa)[_0xdeff('0x13')](function(_0x5c1e22){_0x5dd5e4=_0x5c1e22;logger[_0xdeff('0xe')](_0xdeff('0x4c'),_0x5dd5e4['id']);return getEndUser(_0x2148fa,_0x19c9a1[_0xdeff('0x4d')],_0x19c9a1[_0xdeff('0x4e')]);})[_0xdeff('0x13')](function(_0x41dc90){_0x52bc12=_0x41dc90;logger[_0xdeff('0xe')](_0xdeff('0x4f'),_0x52bc12['id']);return getTicket(_0x2148fa,_0x5dd5e4,_0x52bc12,_0x5a51d4,_0x19c9a1);})[_0xdeff('0x13')](function(_0x403d8b){if(_0x403d8b){logger['info'](_0xdeff('0x50'));logger[_0xdeff('0xe')](_0xdeff('0x51'),_0x403d8b['id']);}})[_0xdeff('0x59')](function(_0x4539c8){logger['error']('[ABANDONED]',JSON['stringify'](_0x4539c8));});}; \ No newline at end of file +var _0x373d=['authType','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','forEach','string','nameField','customField','toLowerCase','type','idField','custom_fields','content','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','Subjects','phone','new','xCALLY','Tags','getString','Descriptions','Fields','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','catch','error','outbound','recordingFormat','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','[OUTBOUND]','abandoned','[ABANDONED]','lodash','md5','util','ioredis','./util','../../../../config/logger','desk','redis','localhost','socket.io-emitter','info','Getting\x20agent\x20with\x20email','remoteUri','then','total_entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET'];(function(_0x5d4b1a,_0x30243f){var _0x3444c1=function(_0x24dbcd){while(--_0x24dbcd){_0x5d4b1a['push'](_0x5d4b1a['shift']());}};_0x3444c1(++_0x30243f);}(_0x373d,0x1e2));var _0xd373=function(_0x4ab4a8,_0x360357){_0x4ab4a8=_0x4ab4a8-0x0;var _0x586b5d=_0x373d[_0x4ab4a8];return _0x586b5d;};'use strict';var _=require(_0xd373('0x0'));var rp=require('request-promise');var md5=require(_0xd373('0x1'));var util=require(_0xd373('0x2'));var Redis=require(_0xd373('0x3'));var intUtil=require(_0xd373('0x4'));var config=require('../../../../config/environment');var logger=require(_0xd373('0x5'))(_0xd373('0x6'));config[_0xd373('0x7')]=_['defaults'](config['redis'],{'host':_0xd373('0x8'),'port':0x18eb});var io=require(_0xd373('0x9'))(new Redis(config[_0xd373('0x7')]));function emit(_0x4008c5,_0x48d977,_0xe79819){io['to'](_0x4008c5)['emit'](_0x48d977,_0xe79819);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x14472a,_0x42b834){if(intUtil['validateEmail'](_0x42b834)===!![]){logger[_0xd373('0xa')](_0xd373('0xb'),_0x42b834);return request({'uri':util['format']('%s/users',_0x14472a[_0xd373('0xc')])})[_0xd373('0xd')](function(_0x21e970){if(_0x21e970[_0xd373('0xe')]){return _['find'](_0x21e970['_embedded']['entries'],{'email':_0x42b834});}})[_0xd373('0xd')](function(_0x14a0ee){if(_0x14a0ee){logger['info'](_0xd373('0xf'));return _0x14a0ee;}else{logger[_0xd373('0xa')](_0xd373('0x10'));return request({'uri':util[_0xd373('0x11')](_0xd373('0x12'),_0x14472a[_0xd373('0xc')])});}});}else{logger[_0xd373('0xa')](_0xd373('0x13'));return request({'uri':util[_0xd373('0x11')](_0xd373('0x12'),_0x14472a[_0xd373('0xc')])});}}function request(_0x263ae3){logger[_0xd373('0x14')]('[HTTP]',JSON[_0xd373('0x15')](_0x263ae3));return rp(_['defaults'](_0x263ae3,{'method':_0xd373('0x16'),'headers':headers,'json':!![]}));}function getAuth(_0x36d47a){var _0x55c5c7;if(_0x36d47a[_0xd373('0x17')]==='basic'){_0x55c5c7=util['format'](_0xd373('0x18'),_0x36d47a[_0xd373('0x19')],_0x36d47a[_0xd373('0x1a')]);}else if(_0x36d47a[_0xd373('0x17')]===_0xd373('0x1b')){_0x55c5c7=util[_0xd373('0x11')]('%s/token:%s',_0x36d47a[_0xd373('0x19')],_0x36d47a[_0xd373('0x1b')]);}return util[_0xd373('0x11')](_0xd373('0x1c'),new Buffer(_0x55c5c7)[_0xd373('0x1d')](_0xd373('0x1e')));}function getEndUser(_0x4f64bd,_0x355fca,_0x43937d){logger[_0xd373('0xa')](_0xd373('0x1f'),_0x43937d);return request({'uri':util[_0xd373('0x11')](_0xd373('0x20'),_0x4f64bd[_0xd373('0xc')]),'qs':{'phone':_0x43937d}})[_0xd373('0xd')](function(_0x1ab540){if(_0x1ab540[_0xd373('0xe')]){logger[_0xd373('0xa')](_0xd373('0x21'));return _0x1ab540[_0xd373('0x22')][_0xd373('0x23')][0x0];}else{logger[_0xd373('0xa')](_0xd373('0x24'));return request({'uri':util[_0xd373('0x11')](_0xd373('0x25'),_0x4f64bd[_0xd373('0xc')]),'method':_0xd373('0x26'),'body':{'first_name':_0x355fca,'title':_0x355fca,'phone_numbers':[{'type':_0xd373('0x27'),'value':_0x43937d}]}});}});}function getTags(_0x3ad8c,_0x71c5c){var _0x3384a5=[];if(_0x3ad8c&&_0x3ad8c[_0xd373('0x28')]>0x0){_0x3384a5=_[_0xd373('0x29')](_0x3ad8c,_0x71c5c);}return _0x3384a5;}function getCustomFields(_0x158825,_0xbc420b){var _0x2ee37c=[];var _0x7dad3e={'custom_fields':{}};if(_0x158825['length']>0x0){_[_0xd373('0x2a')](_0x158825,function(_0x490842){if(_0x490842['type']===_0xd373('0x2b')&&_0x490842[_0xd373('0x2c')]&&!_0x490842[_0xd373('0x2d')]){_0x7dad3e[_0x490842[_0xd373('0x2c')][_0xd373('0x2e')]()]=_0x490842['content'][_0xd373('0x1d')]();}else if(_0x490842[_0xd373('0x2f')]==='string'&&_0x490842[_0xd373('0x30')]&&_0x490842[_0xd373('0x2d')]){_0x7dad3e[_0xd373('0x31')][_0x490842[_0xd373('0x30')]]=_0x490842[_0xd373('0x32')][_0xd373('0x1d')]();}else if(_0x490842[_0xd373('0x2f')]===_0xd373('0x33')&&_0x490842[_0xd373('0x34')]&&_0x490842['idField']&&_0x490842[_0xd373('0x2d')]){_0xbc420b[_0x490842[_0xd373('0x34')]]&&(_0x7dad3e[_0xd373('0x31')][_0x490842[_0xd373('0x30')]]=_0xbc420b[_0x490842[_0xd373('0x34')]][_0xd373('0x1d')]());}else if(_0x490842[_0xd373('0x2f')]===_0xd373('0x35')&&_0x490842[_0xd373('0x36')]&&_0x490842[_0xd373('0x36')][_0xd373('0x37')]&&_0x490842[_0xd373('0x30')]&&_0x490842[_0xd373('0x2d')]){_0xbc420b[_0x490842[_0xd373('0x36')][_0xd373('0x37')]['toLowerCase']()]&&(_0x7dad3e[_0xd373('0x31')][_0x490842[_0xd373('0x30')]]=_0xbc420b[_0x490842[_0xd373('0x36')][_0xd373('0x37')]['toLowerCase']()][_0xd373('0x1d')]());}});}if(_0x7dad3e[_0xd373('0x38')]){_0x7dad3e[_0xd373('0x38')]=Number(_0x7dad3e[_0xd373('0x38')]);}return _0x7dad3e;}function getTicket(_0x38d8ec,_0x104fa6,_0x4aab80,_0x4a2fc5,_0x10368d){logger['info'](_0xd373('0x39'));var _0xe19d5b=_[_0xd373('0x3a')]({'subject':intUtil['getString'](_0x4a2fc5[_0xd373('0x3b')],_0x10368d,'\x20'),'type':_0xd373('0x3c'),'status':_0xd373('0x3d'),'labels':[_0xd373('0x3e'),'Motion','CTI']['concat'](getTags(_0x4a2fc5[_0xd373('0x3f')],'name')),'description':intUtil[_0xd373('0x40')](_0x4a2fc5[_0xd373('0x41')],_0x10368d,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x104fa6['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0xd373('0x40')](_0x4a2fc5[_0xd373('0x41')],_0x10368d,'\x0a')}},getCustomFields(_0x4a2fc5[_0xd373('0x42')],_0x10368d));return request({'uri':util['format']('%s/customers/%d/cases',_0x38d8ec[_0xd373('0xc')],_0x4aab80['id']),'method':_0xd373('0x26'),'body':_0xe19d5b});}exports['queue']=function(_0x121486,_0x2ee75f,_0x1e3de1,_0x9989e4,_0x2d8c7d,_0x4e8bc6){var _0x5825e5,_0x1a4853;_0x4e8bc6[_0xd373('0xc')]=intUtil[_0xd373('0x43')](_0x4e8bc6[_0xd373('0xc')]);_0x4e8bc6['serverUrl']=intUtil[_0xd373('0x43')](_0x4e8bc6['serverUrl']);if(_0x2d8c7d&&_0x2d8c7d[_0xd373('0x44')]){logger[_0xd373('0xa')](_0xd373('0x45'),_0xd373('0x46'));_0x2ee75f[_0xd373('0x47')]=util['format'](_0xd373('0x48'),_0x4e8bc6[_0xd373('0x49')],_0x2ee75f['uniqueid'],md5(_0x2ee75f[_0xd373('0x4a')]));}else{_0x2ee75f[_0xd373('0x47')]='';}headers[_0xd373('0x4b')]=getAuth(_0x4e8bc6);return getUser(_0x4e8bc6,_0x9989e4[_0xd373('0x4c')])[_0xd373('0xd')](function(_0x3910e9){_0x5825e5=_0x3910e9;logger[_0xd373('0xa')](_0xd373('0x4d'),_0x5825e5['id']);return getEndUser(_0x4e8bc6,_0x2ee75f[_0xd373('0x4e')],_0x2ee75f[_0xd373('0x4f')]);})['then'](function(_0x47a6cc){_0x1a4853=_0x47a6cc;logger[_0xd373('0xa')]('The\x20Enduser\x20ID\x20is:',_0x1a4853['id']);return getTicket(_0x4e8bc6,_0x5825e5,_0x1a4853,_0x1e3de1,_0x2ee75f);})[_0xd373('0xd')](function(_0x55bcd4){if(_0x55bcd4){logger['info']('Ticket\x20created!');logger[_0xd373('0xa')](_0xd373('0x50'),_0x55bcd4['id']);switch(_0x4e8bc6[_0xd373('0x2f')]){case _0xd373('0x51'):logger[_0xd373('0xa')](_0xd373('0x45'),_0xd373('0x52'));emit(util['format'](_0xd373('0x53'),_0x9989e4['name']),_0xd373('0x54'),{'recordId':_0x55bcd4['id']});break;case _0xd373('0x55'):logger['info'](_0xd373('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd373('0x11')](_0xd373('0x53'),_0x9989e4[_0xd373('0x37')]),_0xd373('0x56'),{'uri':util[_0xd373('0x11')]('https://xcally.desk.com/web/agent/case/%d',_0x55bcd4['id'])});break;default:logger['error']('[QUEUE]',_0xd373('0x57'));}}})[_0xd373('0x58')](function(_0x5b0801){console[_0xd373('0x59')](_0x5b0801);logger[_0xd373('0x59')]('[QUEUE]',JSON[_0xd373('0x15')](_0x5b0801));});};exports[_0xd373('0x5a')]=function(_0x102101,_0x473af2,_0x3b5e70,_0xa2758,_0xc255ec,_0x43410f,_0x3d1a9c){var _0x391565,_0x383e7f;_0x43410f['remoteUri']=intUtil['stripTrailingSlash'](_0x43410f['remoteUri']);_0x43410f['serverUrl']=intUtil['stripTrailingSlash'](_0x43410f['serverUrl']);if(_0x3d1a9c&&_0x3d1a9c[_0xd373('0x5b')]&&_0x3d1a9c[_0xd373('0x5b')]!=='none'){logger['info']('[OUTBOUND]',_0xd373('0x46'));_0x473af2[_0xd373('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x43410f[_0xd373('0x49')],_0x473af2[_0xd373('0x4a')],md5(_0x473af2[_0xd373('0x4a')]));}headers[_0xd373('0x4b')]=getAuth(_0x43410f);return getUser(_0x43410f,_0xa2758[_0xd373('0x4c')])['then'](function(_0xf53307){_0x391565=_0xf53307;logger[_0xd373('0xa')](_0xd373('0x4d'),_0x391565['id']);return getEndUser(_0x43410f,_0x473af2[_0xd373('0x5c')],_0x473af2[_0xd373('0x5d')]);})[_0xd373('0xd')](function(_0x232e87){_0x383e7f=_0x232e87;logger[_0xd373('0xa')](_0xd373('0x5e'),_0x383e7f['id']);return getTicket(_0x43410f,_0x391565,_0x383e7f,_0x3b5e70,_0x473af2);})[_0xd373('0xd')](function(_0x1c21d2){if(_0x1c21d2){logger[_0xd373('0xa')](_0xd373('0x5f'));logger[_0xd373('0xa')](_0xd373('0x50'),_0x1c21d2['id']);switch(_0x43410f['type']){case _0xd373('0x51'):logger[_0xd373('0xa')](_0xd373('0x45'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xd373('0x11')]('user:%s',_0xa2758[_0xd373('0x37')]),'trigger:desk:display',{'recordId':_0x1c21d2['id']});break;case _0xd373('0x55'):logger[_0xd373('0xa')](_0xd373('0x45'),_0xd373('0x60'));emit(util[_0xd373('0x11')](_0xd373('0x53'),_0xa2758[_0xd373('0x37')]),_0xd373('0x56'),{'uri':util[_0xd373('0x11')](_0xd373('0x61'),_0x43410f[_0xd373('0xc')],_0x1c21d2['id'])});break;default:logger[_0xd373('0x59')](_0xd373('0x62'),_0xd373('0x57'));}}})[_0xd373('0x58')](function(_0x2e7edb){logger[_0xd373('0x59')](_0xd373('0x62'),JSON[_0xd373('0x15')](_0x2e7edb));});};exports[_0xd373('0x63')]=function(_0x295e09,_0x12f62a,_0x296242,_0x5133,_0x2ada2f,_0x3eb2ca){var _0x547a8a,_0x18f0e9;_0x3eb2ca[_0xd373('0xc')]=intUtil[_0xd373('0x43')](_0x3eb2ca['remoteUri']);_0x3eb2ca[_0xd373('0x49')]=intUtil[_0xd373('0x43')](_0x3eb2ca[_0xd373('0x49')]);if(_0x2ada2f&&_0x2ada2f[_0xd373('0x44')]){logger[_0xd373('0xa')](_0xd373('0x64'),_0xd373('0x46'));_0x12f62a['recordingURL']=util[_0xd373('0x11')](_0xd373('0x48'),_0x3eb2ca[_0xd373('0x49')],_0x12f62a[_0xd373('0x4a')],md5(_0x12f62a[_0xd373('0x4a')]));}else{_0x12f62a[_0xd373('0x47')]='';}headers[_0xd373('0x4b')]=getAuth(_0x3eb2ca);return getUser(_0x3eb2ca)[_0xd373('0xd')](function(_0x4fbf72){_0x547a8a=_0x4fbf72;logger[_0xd373('0xa')]('The\x20User\x20ID\x20is:',_0x547a8a['id']);return getEndUser(_0x3eb2ca,_0x12f62a[_0xd373('0x4e')],_0x12f62a[_0xd373('0x4f')]);})[_0xd373('0xd')](function(_0x2a9582){_0x18f0e9=_0x2a9582;logger[_0xd373('0xa')](_0xd373('0x5e'),_0x18f0e9['id']);return getTicket(_0x3eb2ca,_0x547a8a,_0x18f0e9,_0x296242,_0x12f62a);})[_0xd373('0xd')](function(_0x3317b1){if(_0x3317b1){logger['info'](_0xd373('0x5f'));logger['info'](_0xd373('0x50'),_0x3317b1['id']);}})[_0xd373('0x58')](function(_0x310a65){logger[_0xd373('0x59')](_0xd373('0x64'),JSON[_0xd373('0x15')](_0x310a65));});}; \ 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 80f9b9d..cf26641 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 _0x068e=['abandoned','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','request-promise','util','./util','ioredis','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','access_token','error',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','isNil','validateEmail','email','userEmail','length','isdisabled','toUpperCase',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','userId','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','headers','substring','lastIndexOf','enduserId','contacts?$select=telephone1','value','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','indexOf','content','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','callDirection','queue','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s'];(function(_0xfa699f,_0x2621fb){var _0x282eb3=function(_0x3dd823){while(--_0x3dd823){_0xfa699f['push'](_0xfa699f['shift']());}};_0x282eb3(++_0x2621fb);}(_0x068e,0x66));var _0xe068=function(_0x45f064,_0xbcfc7c){_0x45f064=_0x45f064-0x0;var _0x4fdba3=_0x068e[_0x45f064];return _0x4fdba3;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0xe068('0x0'));var util=require(_0xe068('0x1'));var intUtil=require(_0xe068('0x2'));var md5=require('md5');var Redis=require(_0xe068('0x3'));var logger=require('../../../../config/logger')(_0xe068('0x4'));var config=require('../../../../config/environment');config[_0xe068('0x5')]=_[_0xe068('0x6')](config[_0xe068('0x5')],{'host':_0xe068('0x7'),'port':0x18eb});var io=require(_0xe068('0x8'))(new Redis(config[_0xe068('0x5')]));function getAuthToken(_0x34dfd0,_0xef3d4a,_0x548c81){var _0x5d2102={'method':_0xe068('0x9'),'uri':_0xef3d4a,'form':{'client_id':_0x34dfd0[_0xe068('0xa')],'resource':_0x34dfd0[_0xe068('0xb')],'username':_0x34dfd0[_0xe068('0xc')],'password':_0x34dfd0[_0xe068('0xd')],'grant_type':_0xe068('0xd'),'client_secret':_0x34dfd0[_0xe068('0xe')]},'json':!![]};return rp(_0x5d2102)['then'](function(_0x1435f2){return _0x1435f2[_0xe068('0xf')];})['catch'](function(_0x425bc9){logger[_0xe068('0x10')]('['+[_0x548c81['toUpperCase']()]+_0xe068('0x11'));return _0x425bc9[_0xe068('0x12')];});}function getUser(_0x8ffccb,_0x3649d1,_0x4a1225,_0x302780,_0x1ef97d,_0x27599c){return new BPromise(function(_0xd1e2fb,_0x33f62d){return getAuthToken(_0x3649d1,_0x302780,_0x27599c)[_0xe068('0x13')](function(_0x2eaf9b){var _0x53741f={'method':_0xe068('0x14'),'uri':_0x1ef97d+_0xe068('0x15'),'headers':{'Authorization':_0xe068('0x16')+_0x2eaf9b,'OData-Version':'4.0'},'json':!![]};return rp(_0x53741f);})[_0xe068('0x13')](function(_0x1b5307){var _0x1432f2=_0x1b5307['value'];var _0x10ab07=![];var _0x587f65=null;if(!_[_0xe068('0x17')](_0x4a1225)){if(intUtil[_0xe068('0x18')](_0x4a1225[_0xe068('0x19')])){_0x8ffccb[_0xe068('0x1a')]=_0x4a1225[_0xe068('0x19')];for(_0x587f65=0x0;_0x587f65<_0x1432f2[_0xe068('0x1b')];_0x587f65++){if(_0x1432f2[_0x587f65]['internalemailaddress']===_0x4a1225[_0xe068('0x19')]&&!_0x1432f2[_0x587f65][_0xe068('0x1c')]){_0x10ab07=!![];logger['info']('['+[_0x27599c[_0xe068('0x1d')]()]+_0xe068('0x1e')+_0x1432f2[_0x587f65][_0xe068('0x1f')]+'!');_0x8ffccb['userId']=_0x1432f2[_0x587f65][_0xe068('0x1f')];}}}}if(!_0x10ab07){logger[_0xe068('0x20')]('['+[_0x27599c[_0xe068('0x1d')]()]+_0xe068('0x21'));_0x8ffccb['userEmail']=_0x3649d1[_0xe068('0xc')];for(_0x587f65=0x0;_0x587f65<_0x1432f2[_0xe068('0x1b')];_0x587f65++){if(_0x1432f2[_0x587f65][_0xe068('0x22')]===_0x3649d1['username']){_0x8ffccb[_0xe068('0x23')]=_0x1432f2[_0x587f65]['systemuserid'];}}}_0xd1e2fb(_0x8ffccb);})[_0xe068('0x24')](function(_0x45661c){_0x33f62d(_0x45661c[_0xe068('0x12')]);});});}function createEndUser(_0x5ddb38,_0xa1126b,_0x5a3afe,_0x3ad244,_0x5274d9,_0x2bfeda){return new BPromise(function(_0x3f8dd8,_0x4dd9ac){return getAuthToken(_0xa1126b,_0x5a3afe,_0x2bfeda)['then'](function(_0x460a09){var _0x2b87b1=_0x2bfeda[_0xe068('0x25')]()===_0xe068('0x26')?_0x5274d9[_0xe068('0x27')]:_0x5274d9[_0xe068('0x28')];var _0x9e9316={'method':_0xe068('0x9'),'uri':_0x3ad244+_0xe068('0x29'),'body':{'telephone1':_0x2b87b1,'fullname':_0x2b87b1,'firstname':_0x2b87b1,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe068('0x2a')+_0x5ddb38['userId']+')'},'headers':{'Authorization':_0xe068('0x16')+_0x460a09,'OData-Version':_0xe068('0x2b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x9e9316);})[_0xe068('0x13')](function(_0x2d7f45){var _0x1acb1c=_0x2d7f45[_0xe068('0x2c')]['odata-entityid'];var _0x50d884=_0x1acb1c[_0xe068('0x2d')](_0x1acb1c[_0xe068('0x2e')]('(')+0x1,_0x1acb1c[_0xe068('0x2e')](')'));_0x5ddb38[_0xe068('0x2f')]=_0x50d884;_0x3f8dd8(_0x5ddb38);})[_0xe068('0x24')](function(_0x21fc9c){_0x4dd9ac(_0x21fc9c['message']);});});}function getEndUser(_0x480dbf,_0x3d83c6,_0x187e91,_0x318cfd,_0x4ce638,_0x5870e0){return new BPromise(function(_0x543553,_0x3a2eab){return getAuthToken(_0x3d83c6,_0x187e91,_0x5870e0)['then'](function(_0x39cc3f){var _0x41829c={'method':_0xe068('0x14'),'uri':_0x318cfd+_0xe068('0x30'),'headers':{'Authorization':_0xe068('0x16')+_0x39cc3f,'If-None-Match':null,'OData-Version':_0xe068('0x2b')},'json':!![]};return rp(_0x41829c);})[_0xe068('0x13')](function(_0xd1101d){var _0x59c5c0=null;if(_0xd1101d){var _0x4c3ce1=_0xd1101d[_0xe068('0x31')];var _0xc3b890=![];for(_0x59c5c0=0x0;_0x59c5c0<_0x4c3ce1[_0xe068('0x1b')];_0x59c5c0++){var _0x1a2f58=_0x5870e0[_0xe068('0x25')]()==='outbound'?_0x4ce638['destcalleridnum']:_0x4ce638[_0xe068('0x28')];if(_0x4c3ce1[_0x59c5c0]['telephone1']===_0x1a2f58){_0xc3b890=!![];_0x480dbf[_0xe068('0x2f')]=_0x4c3ce1[_0x59c5c0][_0xe068('0x32')];}}if(_0xc3b890){_0x543553(_0x480dbf);}else{return createEndUser(_0x480dbf,_0x3d83c6,_0x187e91,_0x318cfd,_0x4ce638,_0x5870e0)[_0xe068('0x13')](function(_0x1d746d){logger[_0xe068('0x20')]('['+[_0x5870e0['toUpperCase']()]+_0xe068('0x33'),_0x1d746d[_0xe068('0x2f')]);_0x543553(_0x1d746d);});}}else{return createEndUser(_0x480dbf,_0x3d83c6,_0x187e91,_0x318cfd,_0x4ce638,_0x5870e0)[_0xe068('0x13')](function(_0x4e72a1){logger['info']('['+[_0x5870e0[_0xe068('0x1d')]()]+_0xe068('0x34'),_0x4e72a1[_0xe068('0x2f')]);_0x543553(_0x4e72a1);});}});});}function getCustomFields(_0x417fd0,_0x347886,_0x297224){var _0x33f412={};if(_0x417fd0[_0xe068('0x1b')]>0x0){_[_0xe068('0x35')](_0x417fd0,function(_0x410076){if(_0x410076[_0xe068('0x36')]===_0xe068('0x37')&&_0x410076[_0xe068('0x38')]&&!_0x410076[_0xe068('0x39')]){var _0x408daf=_0x410076['idField'][_0xe068('0x25')]();var _0x486f68=_0x408daf[_0xe068('0x2d')](0x0,_0x408daf[_0xe068('0x3a')]('_'));var _0x865172=_0x408daf['substring'](_0x408daf['indexOf']('_')+0x1);if(_0x486f68===_0x297224){_0x33f412[_0x865172]=_0x410076[_0xe068('0x3b')];}}});}return _0x33f412;}function getTicket(_0x1e10d3,_0x3eb543,_0x5b92c3,_0x574341,_0x26c43a,_0x34adb9,_0x285f68){return new BPromise(function(_0x48f029,_0x349311){var _0x59c42d;return getAuthToken(_0x3eb543,_0x5b92c3,_0x285f68)[_0xe068('0x13')](function(_0xff3700){if(_0x34adb9['ticketType']===_0xe068('0x3c')){_0x59c42d={'method':'POST','uri':_0x574341+_0xe068('0x3d'),'body':Object[_0xe068('0x3e')]({},{'title':intUtil[_0xe068('0x3f')](_0x34adb9['Subjects'],_0x26c43a,'\x20'),'description':intUtil[_0xe068('0x3f')](_0x34adb9[_0xe068('0x40')],_0x26c43a,'\x0a'),'customerid_contact@odata.bind':_0xe068('0x41')+_0x1e10d3[_0xe068('0x2f')]+')','ownerid@odata.bind':_0xe068('0x2a')+_0x1e10d3['userId']+')','caseorigincode':'1'},getCustomFields(_0x34adb9[_0xe068('0x42')],_0x26c43a,_0x34adb9['ticketType'])),'headers':{'Authorization':_0xe068('0x16')+_0xff3700,'OData-Version':_0xe068('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x34adb9[_0xe068('0x43')]===_0xe068('0x44')){_0x59c42d={'method':_0xe068('0x9'),'uri':_0x574341+_0xe068('0x45'),'body':Object[_0xe068('0x3e')]({},{'subject':intUtil[_0xe068('0x3f')](_0x34adb9['Subjects'],_0x26c43a,'\x20'),'phonenumber':String(_0x26c43a[_0xe068('0x28')]),'description':intUtil['getString'](_0x34adb9[_0xe068('0x40')],_0x26c43a,'\x0a'),'regardingobjectid_contact@odata.bind':_0xe068('0x41')+_0x1e10d3[_0xe068('0x2f')]+')','ownerid@odata.bind':'/systemusers('+_0x1e10d3[_0xe068('0x23')]+')','directioncode':_0x1e10d3[_0xe068('0x46')]===_0xe068('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1e10d3[_0xe068('0x23')]+')','participationtypemask':_0x1e10d3[_0xe068('0x46')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xe068('0x41')+_0x1e10d3[_0xe068('0x2f')]+')','participationtypemask':_0x1e10d3[_0xe068('0x46')]===_0xe068('0x47')?0x1:0x2}]},getCustomFields(_0x34adb9['Fields'],_0x26c43a,_0x34adb9[_0xe068('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0xff3700,'OData-Version':_0xe068('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x59c42d);})[_0xe068('0x13')](function(_0x31314e){var _0x17b797=_0x31314e[_0xe068('0x2c')][_0xe068('0x48')];var _0x1b417f=_0x17b797[_0xe068('0x2d')](_0x17b797[_0xe068('0x2e')]('(')+0x1,_0x17b797[_0xe068('0x2e')](')'));_0x1e10d3['ticketId']=_0x1b417f;_0x48f029(_0x1e10d3);})['catch'](function(_0x2eff79){_0x349311(_0x2eff79[_0xe068('0x12')]);});});}function emit(_0x34037c,_0x468ee3,_0x3159f8,_0x20c4c0){var _0x2cdd2e={'uri':util[_0xe068('0x49')](_0xe068('0x4a'),_0x34037c,_0x3159f8,_0x20c4c0)};io['to'](util[_0xe068('0x49')]('user:%s',_0x468ee3))[_0xe068('0x4b')](_0xe068('0x4c'),_0x2cdd2e);}exports['cs']=function(_0x1d0870,_0x59aea2,_0x1f0c49,_0x105303,_0x32147e,_0x9625e4,_0x340dd0,_0x2d32aa){var _0x122ee8={};_0x9625e4[_0xe068('0xb')]=intUtil['stripTrailingSlash'](_0x9625e4['remoteUri']);_0x9625e4[_0xe068('0x4d')]=intUtil['stripTrailingSlash'](_0x9625e4[_0xe068('0x4d')]);_0x122ee8[_0xe068('0x46')]=_0x2d32aa==='queue'||_0x2d32aa==='abandoned'?'queue':_0xe068('0x26');var _0x518057=util['format'](_0xe068('0x4e'),_0x9625e4[_0xe068('0xb')]);var _0x50c619=util[_0xe068('0x49')](_0xe068('0x4f'),_0x9625e4[_0xe068('0x50')]);var _0x516729=util['format'](_0xe068('0x51'),_0x9625e4['serverUrl'],_0x59aea2[_0xe068('0x52')],md5(_0x59aea2['uniqueid']));if(_0x32147e&&_0x32147e['monitor_format']){logger[_0xe068('0x20')](_0xe068('0x53'),_0xe068('0x54'));_0x59aea2[_0xe068('0x55')]=_0x516729;}else if(_0x340dd0&&_0x340dd0[_0xe068('0x56')]&&_0x340dd0[_0xe068('0x56')]!=='none'){logger[_0xe068('0x20')](_0xe068('0x57'),_0xe068('0x54'));_0x59aea2['recordingURL']=_0x516729;}else{_0x59aea2[_0xe068('0x55')]='';}return getUser(_0x122ee8,_0x9625e4,_0x105303,_0x50c619,_0x518057,_0x2d32aa)[_0xe068('0x13')](function(_0xc8bccf){logger['info']('['+_0x2d32aa[_0xe068('0x1d')]()+_0xe068('0x58'),_0xc8bccf['userId']);logger[_0xe068('0x20')]('['+_0x2d32aa['toUpperCase']()+_0xe068('0x59'),_0xc8bccf['userEmail']);return getEndUser(_0xc8bccf,_0x9625e4,_0x50c619,_0x518057,_0x59aea2,_0x2d32aa);})[_0xe068('0x13')](function(_0x3bbf58){logger[_0xe068('0x20')]('['+_0x2d32aa[_0xe068('0x1d')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3bbf58[_0xe068('0x2f')]);logger[_0xe068('0x20')]('['+_0x2d32aa[_0xe068('0x1d')]()+_0xe068('0x5a'),_0x59aea2[_0xe068('0x28')]);return getTicket(_0x3bbf58,_0x9625e4,_0x50c619,_0x518057,_0x59aea2,_0x1f0c49,_0x2d32aa);})[_0xe068('0x13')](function(_0x3cc410){logger[_0xe068('0x20')](util[_0xe068('0x49')]('['+_0x2d32aa[_0xe068('0x1d')]()+_0xe068('0x5b'),_0x1f0c49['ticketType'],_0x3cc410[_0xe068('0x5c')]));logger[_0xe068('0x20')](util[_0xe068('0x49')]('['+_0x2d32aa[_0xe068('0x1d')]()+_0xe068('0x5d'),_0x2d32aa));if(_0x2d32aa!==_0xe068('0x5e')){logger[_0xe068('0x20')]('['+_0x2d32aa[_0xe068('0x1d')]()+']',_0xe068('0x5f'));emit(_0x9625e4[_0xe068('0xb')],_0x105303['name'],_0x1f0c49['ticketType'],_0x3cc410[_0xe068('0x5c')]);}})[_0xe068('0x24')](function(_0x5978db){logger['error']('['+_0x2d32aa[_0xe068('0x1d')]()+_0xe068('0x60'),util[_0xe068('0x61')](_0x5978db,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1728=['indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecalls','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','./util','md5','dynamics365','../../../../config/environment','redis','defaults','localhost','POST','remoteUri','password','clientSecret','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','username','catch','then','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','headers','substring','lastIndexOf','enduserId','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','nameField','customField'];(function(_0x107aa6,_0x56428b){var _0x254083=function(_0x4fdeed){while(--_0x4fdeed){_0x107aa6['push'](_0x107aa6['shift']());}};_0x254083(++_0x56428b);}(_0x1728,0x19a));var _0x8172=function(_0x390894,_0x35eb63){_0x390894=_0x390894-0x0;var _0x18009c=_0x1728[_0x390894];return _0x18009c;};'use strict';var _=require(_0x8172('0x0'));var BPromise=require(_0x8172('0x1'));var rp=require(_0x8172('0x2'));var util=require('util');var intUtil=require(_0x8172('0x3'));var md5=require(_0x8172('0x4'));var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x8172('0x5'));var config=require(_0x8172('0x6'));config[_0x8172('0x7')]=_[_0x8172('0x8')](config[_0x8172('0x7')],{'host':_0x8172('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8172('0x7')]));function getAuthToken(_0x39660a,_0x204c44,_0x1660cb){var _0x2f5245={'method':_0x8172('0xa'),'uri':_0x204c44,'form':{'client_id':_0x39660a['clientId'],'resource':_0x39660a[_0x8172('0xb')],'username':_0x39660a['username'],'password':_0x39660a[_0x8172('0xc')],'grant_type':_0x8172('0xc'),'client_secret':_0x39660a[_0x8172('0xd')]},'json':!![]};return rp(_0x2f5245)['then'](function(_0x306738){return _0x306738[_0x8172('0xe')];})['catch'](function(_0xdc0eb9){logger[_0x8172('0xf')]('['+[_0x1660cb[_0x8172('0x10')]()]+_0x8172('0x11'));return _0xdc0eb9[_0x8172('0x12')];});}function getUser(_0x445950,_0x4ac678,_0x9fabc8,_0x12ea3d,_0x5b844c,_0x391d78){return new BPromise(function(_0x10c334,_0x389087){return getAuthToken(_0x4ac678,_0x12ea3d,_0x391d78)['then'](function(_0x344a80){var _0x4cdeee={'method':_0x8172('0x13'),'uri':_0x5b844c+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x344a80,'OData-Version':_0x8172('0x14')},'json':!![]};return rp(_0x4cdeee);})['then'](function(_0x4e4da2){var _0x356f8c=_0x4e4da2[_0x8172('0x15')];var _0x2e8c3e=![];var _0x45ffea=null;if(!_[_0x8172('0x16')](_0x9fabc8)){if(intUtil[_0x8172('0x17')](_0x9fabc8[_0x8172('0x18')])){_0x445950[_0x8172('0x19')]=_0x9fabc8[_0x8172('0x18')];for(_0x45ffea=0x0;_0x45ffea<_0x356f8c['length'];_0x45ffea++){if(_0x356f8c[_0x45ffea][_0x8172('0x1a')]===_0x9fabc8[_0x8172('0x18')]&&!_0x356f8c[_0x45ffea][_0x8172('0x1b')]){_0x2e8c3e=!![];logger[_0x8172('0x1c')]('['+[_0x391d78[_0x8172('0x10')]()]+_0x8172('0x1d')+_0x356f8c[_0x45ffea][_0x8172('0x1e')]+'!');_0x445950[_0x8172('0x1f')]=_0x356f8c[_0x45ffea][_0x8172('0x1e')];}}}}if(!_0x2e8c3e){logger['info']('['+[_0x391d78[_0x8172('0x10')]()]+_0x8172('0x20'));_0x445950[_0x8172('0x19')]=_0x4ac678['username'];for(_0x45ffea=0x0;_0x45ffea<_0x356f8c[_0x8172('0x21')];_0x45ffea++){if(_0x356f8c[_0x45ffea][_0x8172('0x1a')]===_0x4ac678[_0x8172('0x22')]){_0x445950[_0x8172('0x1f')]=_0x356f8c[_0x45ffea][_0x8172('0x1e')];}}}_0x10c334(_0x445950);})[_0x8172('0x23')](function(_0x2d1dba){_0x389087(_0x2d1dba[_0x8172('0x12')]);});});}function createEndUser(_0x3770be,_0x11fabd,_0x20e250,_0x14403a,_0x2d9db3,_0x42ddb4){return new BPromise(function(_0x122d94,_0x17a7b9){return getAuthToken(_0x11fabd,_0x20e250,_0x42ddb4)[_0x8172('0x24')](function(_0x38395b){var _0x19f956=_0x42ddb4[_0x8172('0x25')]()===_0x8172('0x26')?_0x2d9db3[_0x8172('0x27')]:_0x2d9db3[_0x8172('0x28')];var _0x45b6c2={'method':_0x8172('0xa'),'uri':_0x14403a+_0x8172('0x29'),'body':{'telephone1':_0x19f956,'fullname':_0x19f956,'firstname':_0x19f956,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8172('0x2a')+_0x3770be[_0x8172('0x1f')]+')'},'headers':{'Authorization':_0x8172('0x2b')+_0x38395b,'OData-Version':_0x8172('0x14')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x45b6c2);})[_0x8172('0x24')](function(_0xf6a3c2){var _0x4e15cb=_0xf6a3c2[_0x8172('0x2c')]['odata-entityid'];var _0x5b1d47=_0x4e15cb[_0x8172('0x2d')](_0x4e15cb[_0x8172('0x2e')]('(')+0x1,_0x4e15cb['lastIndexOf'](')'));_0x3770be[_0x8172('0x2f')]=_0x5b1d47;_0x122d94(_0x3770be);})[_0x8172('0x23')](function(_0x47c906){_0x17a7b9(_0x47c906['message']);});});}function getEndUser(_0x229f4b,_0x5a6580,_0x2d2abe,_0x6e8b2b,_0x227dd4,_0x418f9b){return new BPromise(function(_0x2ff99f,_0x3f6887){return getAuthToken(_0x5a6580,_0x2d2abe,_0x418f9b)[_0x8172('0x24')](function(_0x42354a){var _0x3dc76d={'method':_0x8172('0x13'),'uri':_0x6e8b2b+'contacts?$select=telephone1','headers':{'Authorization':_0x8172('0x2b')+_0x42354a,'If-None-Match':null,'OData-Version':_0x8172('0x14')},'json':!![]};return rp(_0x3dc76d);})[_0x8172('0x24')](function(_0x59c733){var _0x3d43a4=null;if(_0x59c733){var _0x221ee8=_0x59c733[_0x8172('0x15')];var _0x4343ca=![];for(_0x3d43a4=0x0;_0x3d43a4<_0x221ee8[_0x8172('0x21')];_0x3d43a4++){var _0x31487c=_0x418f9b[_0x8172('0x25')]()===_0x8172('0x26')?_0x227dd4[_0x8172('0x27')]:_0x227dd4[_0x8172('0x28')];if(_0x221ee8[_0x3d43a4][_0x8172('0x30')]===_0x31487c){_0x4343ca=!![];_0x229f4b[_0x8172('0x2f')]=_0x221ee8[_0x3d43a4]['contactid'];}}if(_0x4343ca){_0x2ff99f(_0x229f4b);}else{return createEndUser(_0x229f4b,_0x5a6580,_0x2d2abe,_0x6e8b2b,_0x227dd4,_0x418f9b)['then'](function(_0x4b68d8){logger[_0x8172('0x1c')]('['+[_0x418f9b[_0x8172('0x10')]()]+_0x8172('0x31'),_0x4b68d8['enduserId']);_0x2ff99f(_0x4b68d8);});}}else{return createEndUser(_0x229f4b,_0x5a6580,_0x2d2abe,_0x6e8b2b,_0x227dd4,_0x418f9b)[_0x8172('0x24')](function(_0x139335){logger[_0x8172('0x1c')]('['+[_0x418f9b['toUpperCase']()]+_0x8172('0x32'),_0x139335['enduserId']);_0x2ff99f(_0x139335);});}});});}function getCustomFields(_0x23a04a,_0x5cb178,_0x33b0f0){var _0xc14fb7={};if(_0x23a04a[_0x8172('0x21')]>0x0){_[_0x8172('0x33')](_0x23a04a,function(_0x2cdea0){if(_0x2cdea0[_0x8172('0x34')]==='string'&&_0x2cdea0[_0x8172('0x35')]&&!_0x2cdea0[_0x8172('0x36')]){var _0x1b7627=_0x2cdea0['idField']['toLowerCase']();var _0x39f079=_0x1b7627[_0x8172('0x2d')](0x0,_0x1b7627[_0x8172('0x37')]('_'));var _0x5f521e=_0x1b7627[_0x8172('0x2d')](_0x1b7627[_0x8172('0x37')]('_')+0x1);if(_0x39f079===_0x33b0f0){_0xc14fb7[_0x5f521e]=_0x2cdea0[_0x8172('0x38')];}}});}return _0xc14fb7;}function getTicket(_0x4ae82b,_0x2df8ea,_0x518fa1,_0x3815d4,_0x36792e,_0x542151,_0x2761e5){return new BPromise(function(_0x45ea48,_0x54cc1f){var _0x3095b6;return getAuthToken(_0x2df8ea,_0x518fa1,_0x2761e5)[_0x8172('0x24')](function(_0x1529cd){if(_0x542151[_0x8172('0x39')]===_0x8172('0x3a')){_0x3095b6={'method':_0x8172('0xa'),'uri':_0x3815d4+_0x8172('0x3b'),'body':Object[_0x8172('0x3c')]({},{'title':intUtil[_0x8172('0x3d')](_0x542151[_0x8172('0x3e')],_0x36792e,'\x20'),'description':intUtil[_0x8172('0x3d')](_0x542151[_0x8172('0x3f')],_0x36792e,'\x0a'),'customerid_contact@odata.bind':_0x8172('0x40')+_0x4ae82b['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x4ae82b['userId']+')','caseorigincode':'1'},getCustomFields(_0x542151[_0x8172('0x41')],_0x36792e,_0x542151['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x1529cd,'OData-Version':_0x8172('0x14')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x542151[_0x8172('0x39')]==='phonecall'){_0x3095b6={'method':_0x8172('0xa'),'uri':_0x3815d4+_0x8172('0x42'),'body':Object[_0x8172('0x3c')]({},{'subject':intUtil[_0x8172('0x3d')](_0x542151[_0x8172('0x3e')],_0x36792e,'\x20'),'phonenumber':String(_0x36792e['calleridnum']),'description':intUtil['getString'](_0x542151[_0x8172('0x3f')],_0x36792e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x8172('0x40')+_0x4ae82b[_0x8172('0x2f')]+')','ownerid@odata.bind':'/systemusers('+_0x4ae82b[_0x8172('0x1f')]+')','directioncode':_0x4ae82b[_0x8172('0x43')]===_0x8172('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x8172('0x2a')+_0x4ae82b[_0x8172('0x1f')]+')','participationtypemask':_0x4ae82b[_0x8172('0x43')]===_0x8172('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x8172('0x40')+_0x4ae82b['enduserId']+')','participationtypemask':_0x4ae82b[_0x8172('0x43')]===_0x8172('0x44')?0x1:0x2}]},getCustomFields(_0x542151[_0x8172('0x41')],_0x36792e,_0x542151[_0x8172('0x39')])),'headers':{'Authorization':_0x8172('0x2b')+_0x1529cd,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3095b6);})[_0x8172('0x24')](function(_0x677fd){var _0xf5ce2d=_0x677fd[_0x8172('0x2c')]['odata-entityid'];var _0x26d660=_0xf5ce2d['substring'](_0xf5ce2d['lastIndexOf']('(')+0x1,_0xf5ce2d[_0x8172('0x2e')](')'));_0x4ae82b[_0x8172('0x45')]=_0x26d660;_0x45ea48(_0x4ae82b);})['catch'](function(_0x15df88){_0x54cc1f(_0x15df88['message']);});});}function emit(_0x50eabc,_0x14cfb1,_0x1e09d2,_0x5d73c8){var _0x5881c8={'uri':util[_0x8172('0x46')](_0x8172('0x47'),_0x50eabc,_0x1e09d2,_0x5d73c8)};io['to'](util[_0x8172('0x46')]('user:%s',_0x14cfb1))[_0x8172('0x48')](_0x8172('0x49'),_0x5881c8);}exports['cs']=function(_0x197b64,_0xaedf47,_0x4104e0,_0x2d19f3,_0x25246a,_0x5ee7d0,_0x3c4003,_0x15c906){var _0x3f6f00={};_0x5ee7d0[_0x8172('0xb')]=intUtil[_0x8172('0x4a')](_0x5ee7d0[_0x8172('0xb')]);_0x5ee7d0[_0x8172('0x4b')]=intUtil['stripTrailingSlash'](_0x5ee7d0[_0x8172('0x4b')]);_0x3f6f00[_0x8172('0x43')]=_0x15c906===_0x8172('0x44')||_0x15c906===_0x8172('0x4c')?_0x8172('0x44'):_0x8172('0x26');var _0xa44095=util['format']('%s/api/data/v9.0/',_0x5ee7d0[_0x8172('0xb')]);var _0x23bda2=util[_0x8172('0x46')](_0x8172('0x4d'),_0x5ee7d0[_0x8172('0x4e')]);var _0x3f5685=util[_0x8172('0x46')](_0x8172('0x4f'),_0x5ee7d0[_0x8172('0x4b')],_0xaedf47[_0x8172('0x50')],md5(_0xaedf47[_0x8172('0x50')]));if(_0x25246a&&_0x25246a[_0x8172('0x51')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0xaedf47[_0x8172('0x52')]=_0x3f5685;}else if(_0x3c4003&&_0x3c4003[_0x8172('0x53')]&&_0x3c4003[_0x8172('0x53')]!=='none'){logger[_0x8172('0x1c')](_0x8172('0x54'),_0x8172('0x55'));_0xaedf47[_0x8172('0x52')]=_0x3f5685;}else{_0xaedf47[_0x8172('0x52')]='';}return getUser(_0x3f6f00,_0x5ee7d0,_0x2d19f3,_0x23bda2,_0xa44095,_0x15c906)[_0x8172('0x24')](function(_0x2d57ae){logger[_0x8172('0x1c')]('['+_0x15c906[_0x8172('0x10')]()+']\x20The\x20User\x20ID\x20is:',_0x2d57ae[_0x8172('0x1f')]);logger[_0x8172('0x1c')]('['+_0x15c906[_0x8172('0x10')]()+_0x8172('0x56'),_0x2d57ae['userEmail']);return getEndUser(_0x2d57ae,_0x5ee7d0,_0x23bda2,_0xa44095,_0xaedf47,_0x15c906);})[_0x8172('0x24')](function(_0x2e2dee){logger['info']('['+_0x15c906[_0x8172('0x10')]()+_0x8172('0x57'),_0x2e2dee[_0x8172('0x2f')]);logger['info']('['+_0x15c906['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0xaedf47[_0x8172('0x28')]);return getTicket(_0x2e2dee,_0x5ee7d0,_0x23bda2,_0xa44095,_0xaedf47,_0x4104e0,_0x15c906);})['then'](function(_0x4f2bbd){logger[_0x8172('0x1c')](util[_0x8172('0x46')]('['+_0x15c906[_0x8172('0x10')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x4104e0[_0x8172('0x39')],_0x4f2bbd[_0x8172('0x45')]));logger[_0x8172('0x1c')](util[_0x8172('0x46')]('['+_0x15c906['toUpperCase']()+_0x8172('0x58'),_0x15c906));if(_0x15c906!==_0x8172('0x4c')){logger['info']('['+_0x15c906[_0x8172('0x10')]()+']',_0x8172('0x59'));emit(_0x5ee7d0[_0x8172('0xb')],_0x2d19f3[_0x8172('0x5a')],_0x4104e0[_0x8172('0x39')],_0x4f2bbd[_0x8172('0x45')]);}})[_0x8172('0x23')](function(_0x1b66b2){logger[_0x8172('0xf')]('['+_0x15c906[_0x8172('0x10')]()+_0x8172('0x5b'),util[_0x8172('0x5c')](_0x1b66b2,{'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 d5d6f78..05994ab 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 _0x6664=['recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','abandoned','calleridname','[ABANDONED]','lodash','request-promise','./util','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','getString','Subjects','Tags','name','Fields','custom_fields','mapValues','keyBy','value','then','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','stringify','defaults','GET','forEach','type','string','nameField','toLowerCase','idField','customField','push','content','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','catch','error'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x6664,0xad));var _0x4666=function(_0x4471ec,_0x350f69){_0x4471ec=_0x4471ec-0x0;var _0x2a5854=_0x6664[_0x4471ec];return _0x2a5854;};'use strict';var _=require(_0x4666('0x0'));var rp=require(_0x4666('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x4666('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x4666('0x3'));config[_0x4666('0x4')]=_['defaults'](config[_0x4666('0x4')],{'host':_0x4666('0x5'),'port':0x18eb});var io=require(_0x4666('0x6'))(new Redis(config[_0x4666('0x4')]));var headers={'Content-Type':_0x4666('0x7'),'Accept':'application/json'};function emit(_0x360769,_0xb2146f,_0xb4442e){io['to'](_0x360769)[_0x4666('0x8')](_0xb2146f,_0xb4442e);}function getTicket(_0x402678,_0x45d2e3,_0x1b8980,_0x34f6cd,_0x38f3ea){logger[_0x4666('0x9')](_0x4666('0xa'));var _0x4b7511=_[_0x4666('0xb')]({'responder_id':_0x45d2e3['id'],'requester_id':_0x1b8980['id'],'name':util[_0x4666('0xc')]('Caller\x20-\x20%s',_0x38f3ea['calleridname']),'phone':_0x38f3ea['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4666('0xd')](_0x34f6cd[_0x4666('0xe')],_0x38f3ea,'\x20'),'description':intUtil[_0x4666('0xd')](_0x34f6cd['Descriptions'],_0x38f3ea,'
'),'tags':getTags(_0x34f6cd[_0x4666('0xf')],_0x4666('0x10'))},getCustomFields(_0x34f6cd[_0x4666('0x11')],_0x38f3ea));_0x4b7511[_0x4666('0x12')]=_[_0x4666('0x13')](_[_0x4666('0x14')](_0x4b7511['custom_fields'],'id'),_0x4666('0x15'));return request({'uri':util[_0x4666('0xc')]('%s/api/v2/tickets',_0x402678['remoteUri']),'method':'POST','body':_0x4b7511})[_0x4666('0x16')](function(_0x5dccd5){logger['info'](_0x4666('0x17'));return _0x5dccd5;});}function getUser(_0x253d7b,_0x5d7560){if(intUtil['validateEmail'](_0x5d7560)){return request({'uri':util['format'](_0x4666('0x18'),_0x253d7b[_0x4666('0x19')]),'qs':{'email':_0x5d7560}})['then'](function(_0x2945b8){if(_0x2945b8[_0x4666('0x1a')]){logger[_0x4666('0x9')]('Agent\x20found!');return _['find'](_0x2945b8,function(_0x3af7b7){return _0x3af7b7['contact']['email']===_0x5d7560;});}else{logger['info'](_0x4666('0x1b'));return request({'uri':util['format'](_0x4666('0x1c'),_0x253d7b['remoteUri'])})[_0x4666('0x16')](function(_0x4d5a8c){logger[_0x4666('0x9')]('Admin\x20account\x20selected.');return _0x4d5a8c;});}});}else{logger[_0x4666('0x9')](_0x4666('0x1d'));return request({'uri':util[_0x4666('0xc')](_0x4666('0x1c'),_0x253d7b['remoteUri'])})[_0x4666('0x16')](function(_0x2e760f){logger[_0x4666('0x9')](_0x4666('0x1e'));return _0x2e760f;});}}function getEndUser(_0x41d90d,_0x4991d7,_0x40f86d){logger[_0x4666('0x9')](_0x4666('0x1f'),_0x40f86d);return request({'uri':util[_0x4666('0xc')]('%s/api/v2/contacts',_0x41d90d[_0x4666('0x19')]),'qs':{'phone':_0x40f86d}})['then'](function(_0x39c250){if(_0x39c250['length']){logger['info'](_0x4666('0x20'));return _[_0x4666('0x21')](_0x39c250,{'phone':_0x40f86d});}else{logger[_0x4666('0x9')](_0x4666('0x22'));return request({'uri':util[_0x4666('0xc')]('%s/api/v2/contacts',_0x41d90d['remoteUri']),'method':'POST','body':{'name':_0x4991d7,'phone':_0x40f86d}})[_0x4666('0x16')](function(_0x3a5899){logger[_0x4666('0x9')](_0x4666('0x23'));return _0x3a5899;});}});}function getAuth(_0x53287f){return util['format'](_0x4666('0x24'),new Buffer(_0x53287f['apiKey']+':X')[_0x4666('0x25')](_0x4666('0x26')));}function request(_0x1f27eb){logger[_0x4666('0x27')]('[HTTP]',JSON[_0x4666('0x28')](_0x1f27eb));return rp(_[_0x4666('0x29')](_0x1f27eb,{'method':_0x4666('0x2a'),'headers':headers,'json':!![]}));}function getTags(_0x4a8c2c,_0x2a46f0){var _0x5309c6=[];if(_0x4a8c2c&&_0x4a8c2c[_0x4666('0x1a')]>0x0){_0x5309c6=_['map'](_0x4a8c2c,_0x2a46f0);}return _0x5309c6;}function getCustomFields(_0x384f8d,_0x5a4d4c){var _0x8960f9=[];var _0x5b29c1={'custom_fields':[]};if(_0x384f8d['length']>0x0){_[_0x4666('0x2b')](_0x384f8d,function(_0x4e7a27){if(_0x4e7a27[_0x4666('0x2c')]===_0x4666('0x2d')&&_0x4e7a27[_0x4666('0x2e')]&&!_0x4e7a27['customField']){_0x5b29c1[_0x4e7a27[_0x4666('0x2e')][_0x4666('0x2f')]()]=_0x4e7a27['content'][_0x4666('0x25')]();}else if(_0x4e7a27[_0x4666('0x2c')]==='string'&&_0x4e7a27[_0x4666('0x30')]&&_0x4e7a27[_0x4666('0x31')]){_0x5b29c1[_0x4666('0x12')][_0x4666('0x32')]({'id':_0x4e7a27[_0x4666('0x30')],'value':_0x4e7a27[_0x4666('0x33')][_0x4666('0x25')]()});}else if(_0x4e7a27[_0x4666('0x2c')]==='variable'&&_0x4e7a27[_0x4666('0x34')]&&_0x4e7a27[_0x4666('0x30')]&&_0x4e7a27[_0x4666('0x31')]){_0x5a4d4c[_0x4e7a27['variableName']]&&_0x5b29c1['custom_fields'][_0x4666('0x32')]({'id':_0x4e7a27['idField'],'value':_0x5a4d4c[_0x4e7a27[_0x4666('0x34')]][_0x4666('0x25')]()});}else if(_0x4e7a27[_0x4666('0x2c')]===_0x4666('0x35')&&_0x4e7a27[_0x4666('0x36')]&&_0x4e7a27[_0x4666('0x36')]['name']&&_0x4e7a27['idField']&&_0x4e7a27[_0x4666('0x31')]){_0x5a4d4c[_0x4e7a27[_0x4666('0x36')][_0x4666('0x10')][_0x4666('0x2f')]()]&&_0x5b29c1['custom_fields'][_0x4666('0x32')]({'id':_0x4e7a27['idField'],'value':_0x5a4d4c[_0x4e7a27[_0x4666('0x36')][_0x4666('0x10')]['toLowerCase']()][_0x4666('0x25')]()});}});}return _0x5b29c1;}exports[_0x4666('0x37')]=function(_0x670606,_0x20a5e6,_0x14c741,_0x4f34a5,_0x1c33cd,_0x56d6f0){var _0xc3a7c8,_0x27dba4;_0x56d6f0['remoteUri']=intUtil[_0x4666('0x38')](_0x56d6f0['remoteUri']);_0x56d6f0[_0x4666('0x39')]=intUtil[_0x4666('0x38')](_0x56d6f0[_0x4666('0x39')]);if(_0x1c33cd&&_0x1c33cd[_0x4666('0x3a')]){logger[_0x4666('0x9')](_0x4666('0x3b'),_0x4666('0x3c'));_0x20a5e6[_0x4666('0x3d')]=util[_0x4666('0xc')](_0x4666('0x3e'),_0x56d6f0[_0x4666('0x39')],_0x20a5e6[_0x4666('0x3f')],md5(_0x20a5e6[_0x4666('0x3f')]));}else{_0x20a5e6[_0x4666('0x3d')]='';}headers[_0x4666('0x40')]=getAuth(_0x56d6f0);return getUser(_0x56d6f0,_0x4f34a5[_0x4666('0x41')])['then'](function(_0x35092d){_0xc3a7c8=_0x35092d;logger['info'](_0x4666('0x42'),_0xc3a7c8['id']);return getEndUser(_0x56d6f0,_0x20a5e6['calleridname'],_0x20a5e6[_0x4666('0x43')]);})['then'](function(_0x2852cd){_0x27dba4=_0x2852cd;logger['info']('The\x20Enduser\x20ID\x20is:',_0x27dba4['id']);return getTicket(_0x56d6f0,_0xc3a7c8,_0x27dba4,_0x14c741,_0x20a5e6);})[_0x4666('0x16')](function(_0x2b6644){if(_0x2b6644&&_0x2b6644['id']){logger[_0x4666('0x9')](_0x4666('0x17'));logger[_0x4666('0x9')](_0x4666('0x44'),_0x2b6644['id']);logger[_0x4666('0x9')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4666('0xc')](_0x4666('0x45'),_0x4f34a5[_0x4666('0x10')]),_0x4666('0x46'),{'uri':util[_0x4666('0xc')]('%s/helpdesk/tickets/%d',_0x56d6f0[_0x4666('0x19')],_0x2b6644['id'])});}})[_0x4666('0x47')](function(_0x78b32b){logger[_0x4666('0x48')]('[QUEUE]',JSON[_0x4666('0x28')](_0x78b32b));});};exports['outbound']=function(_0x4d6bbc,_0x6a856f,_0x49eeb1,_0x48ba7a,_0x4b979a,_0x221930,_0x4bae66){var _0x36a0cc,_0x3cb46a;_0x221930[_0x4666('0x19')]=intUtil['stripTrailingSlash'](_0x221930['remoteUri']);_0x221930[_0x4666('0x39')]=intUtil[_0x4666('0x38')](_0x221930[_0x4666('0x39')]);if(_0x4bae66&&_0x4bae66[_0x4666('0x49')]&&_0x4bae66['recordingFormat']!==_0x4666('0x4a')){logger[_0x4666('0x9')]('[OUTBOUND]',_0x4666('0x3c'));_0x6a856f[_0x4666('0x3d')]=util[_0x4666('0xc')](_0x4666('0x3e'),_0x221930[_0x4666('0x39')],_0x6a856f['uniqueid'],md5(_0x6a856f['uniqueid']));}headers[_0x4666('0x40')]=getAuth(_0x221930);return getUser(_0x221930,_0x48ba7a[_0x4666('0x41')])[_0x4666('0x16')](function(_0x49fe46){_0x36a0cc=_0x49fe46;logger['info'](_0x4666('0x42'),_0x36a0cc['id']);return getEndUser(_0x221930,_0x6a856f[_0x4666('0x4b')],_0x6a856f[_0x4666('0x4c')]);})[_0x4666('0x16')](function(_0x4463df){_0x3cb46a=_0x4463df;logger[_0x4666('0x9')](_0x4666('0x4d'),_0x3cb46a['id']);return getTicket(_0x221930,_0x36a0cc,_0x3cb46a,_0x49eeb1,_0x6a856f);})['then'](function(_0x2d2441){if(_0x2d2441&&_0x2d2441['id']){logger[_0x4666('0x9')](_0x4666('0x17'));logger[_0x4666('0x9')](_0x4666('0x44'),_0x2d2441['id']);logger['info'](_0x4666('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4666('0xc')](_0x4666('0x45'),_0x48ba7a[_0x4666('0x10')]),_0x4666('0x46'),{'uri':util[_0x4666('0xc')]('%s/helpdesk/tickets/%d',_0x221930[_0x4666('0x19')],_0x2d2441['id'])});}})[_0x4666('0x47')](function(_0x510003){logger[_0x4666('0x48')](_0x4666('0x4e'),JSON[_0x4666('0x28')](_0x510003));});};exports[_0x4666('0x4f')]=function(_0x334d90,_0x2fdc66,_0x1bf555,_0x3dc909,_0x4d22e6,_0x2bdcab){var _0x168523,_0x2c207e;_0x2bdcab[_0x4666('0x19')]=intUtil['stripTrailingSlash'](_0x2bdcab[_0x4666('0x19')]);_0x2bdcab['serverUrl']=intUtil[_0x4666('0x38')](_0x2bdcab['serverUrl']);if(_0x4d22e6&&_0x4d22e6[_0x4666('0x3a')]){logger[_0x4666('0x9')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x2fdc66[_0x4666('0x3d')]=util['format'](_0x4666('0x3e'),_0x2bdcab[_0x4666('0x39')],_0x2fdc66[_0x4666('0x3f')],md5(_0x2fdc66[_0x4666('0x3f')]));}else{_0x2fdc66['recordingURL']='';}headers[_0x4666('0x40')]=getAuth(_0x2bdcab);return getUser(_0x2bdcab,'')['then'](function(_0x10a356){_0x168523=_0x10a356;logger[_0x4666('0x9')](_0x4666('0x42'),_0x168523['id']);return getEndUser(_0x2bdcab,_0x2fdc66[_0x4666('0x50')],_0x2fdc66[_0x4666('0x43')]);})[_0x4666('0x16')](function(_0x415ee8){_0x2c207e=_0x415ee8;logger[_0x4666('0x9')](_0x4666('0x4d'),_0x2c207e['id']);return getTicket(_0x2bdcab,_0x168523,_0x2c207e,_0x1bf555,_0x2fdc66);})[_0x4666('0x16')](function(_0x5bfe19){if(_0x5bfe19){logger[_0x4666('0x9')]('Ticket\x20created!');logger[_0x4666('0x9')](_0x4666('0x44'),_0x5bfe19['id']);}})['catch'](function(_0x255b9c){logger[_0x4666('0x48')](_0x4666('0x51'),JSON[_0x4666('0x28')](_0x255b9c));});}; \ No newline at end of file +var _0x4b37=['
','Tags','name','mapValues','custom_fields','%s/api/v2/tickets','remoteUri','then','validateEmail','%s/api/v2/agents','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','POST','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','stringify','defaults','GET','length','map','type','string','nameField','customField','toLowerCase','content','toString','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','[ABANDONED]','calleridnum','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','localhost','socket.io-emitter','redis','application/json','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions'];(function(_0x4fdfbe,_0x198a28){var _0x585ad8=function(_0x1e5386){while(--_0x1e5386){_0x4fdfbe['push'](_0x4fdfbe['shift']());}};_0x585ad8(++_0x198a28);}(_0x4b37,0x155));var _0x74b3=function(_0x3979d3,_0x2994b3){_0x3979d3=_0x3979d3-0x0;var _0x60d445=_0x4b37[_0x3979d3];return _0x60d445;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x74b3('0x0'));var util=require(_0x74b3('0x1'));var Redis=require(_0x74b3('0x2'));var intUtil=require(_0x74b3('0x3'));var config=require(_0x74b3('0x4'));var logger=require(_0x74b3('0x5'))(_0x74b3('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x74b3('0x7'),'port':0x18eb});var io=require(_0x74b3('0x8'))(new Redis(config[_0x74b3('0x9')]));var headers={'Content-Type':_0x74b3('0xa'),'Accept':'application/json'};function emit(_0x5885a5,_0x588b9f,_0xfa5c09){io['to'](_0x5885a5)['emit'](_0x588b9f,_0xfa5c09);}function getTicket(_0x1c12b2,_0x53ecf0,_0x50fea3,_0x44f89a,_0x26e25b){logger[_0x74b3('0xb')](_0x74b3('0xc'));var _0x2f2d94=_['merge']({'responder_id':_0x53ecf0['id'],'requester_id':_0x50fea3['id'],'name':util[_0x74b3('0xd')](_0x74b3('0xe'),_0x26e25b[_0x74b3('0xf')]),'phone':_0x26e25b['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x74b3('0x10')](_0x44f89a[_0x74b3('0x11')],_0x26e25b,'\x20'),'description':intUtil[_0x74b3('0x10')](_0x44f89a[_0x74b3('0x12')],_0x26e25b,_0x74b3('0x13')),'tags':getTags(_0x44f89a[_0x74b3('0x14')],_0x74b3('0x15'))},getCustomFields(_0x44f89a['Fields'],_0x26e25b));_0x2f2d94['custom_fields']=_[_0x74b3('0x16')](_['keyBy'](_0x2f2d94[_0x74b3('0x17')],'id'),'value');return request({'uri':util['format'](_0x74b3('0x18'),_0x1c12b2[_0x74b3('0x19')]),'method':'POST','body':_0x2f2d94})[_0x74b3('0x1a')](function(_0x279431){logger['info']('Ticket\x20created!');return _0x279431;});}function getUser(_0x269660,_0x35fb15){if(intUtil[_0x74b3('0x1b')](_0x35fb15)){return request({'uri':util['format'](_0x74b3('0x1c'),_0x269660[_0x74b3('0x19')]),'qs':{'email':_0x35fb15}})[_0x74b3('0x1a')](function(_0x7e923b){if(_0x7e923b['length']){logger[_0x74b3('0xb')]('Agent\x20found!');return _['find'](_0x7e923b,function(_0x1d7895){return _0x1d7895['contact'][_0x74b3('0x1d')]===_0x35fb15;});}else{logger[_0x74b3('0xb')](_0x74b3('0x1e'));return request({'uri':util[_0x74b3('0xd')]('%s/api/v2/agents/me',_0x269660[_0x74b3('0x19')])})[_0x74b3('0x1a')](function(_0x51f6fe){logger[_0x74b3('0xb')]('Admin\x20account\x20selected.');return _0x51f6fe;});}});}else{logger[_0x74b3('0xb')](_0x74b3('0x1f'));return request({'uri':util[_0x74b3('0xd')](_0x74b3('0x20'),_0x269660[_0x74b3('0x19')])})['then'](function(_0x273437){logger[_0x74b3('0xb')](_0x74b3('0x21'));return _0x273437;});}}function getEndUser(_0x88926b,_0x3f6970,_0x188ca1){logger['info'](_0x74b3('0x22'),_0x188ca1);return request({'uri':util[_0x74b3('0xd')](_0x74b3('0x23'),_0x88926b[_0x74b3('0x19')]),'qs':{'phone':_0x188ca1}})[_0x74b3('0x1a')](function(_0x43e80a){if(_0x43e80a['length']){logger[_0x74b3('0xb')](_0x74b3('0x24'));return _[_0x74b3('0x25')](_0x43e80a,{'phone':_0x188ca1});}else{logger[_0x74b3('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x74b3('0xd')]('%s/api/v2/contacts',_0x88926b['remoteUri']),'method':_0x74b3('0x26'),'body':{'name':_0x3f6970,'phone':_0x188ca1}})[_0x74b3('0x1a')](function(_0x11d3f4){logger['info'](_0x74b3('0x27'));return _0x11d3f4;});}});}function getAuth(_0x511018){return util[_0x74b3('0xd')](_0x74b3('0x28'),new Buffer(_0x511018[_0x74b3('0x29')]+':X')['toString'](_0x74b3('0x2a')));}function request(_0x1f0fa1){logger[_0x74b3('0x2b')]('[HTTP]',JSON[_0x74b3('0x2c')](_0x1f0fa1));return rp(_[_0x74b3('0x2d')](_0x1f0fa1,{'method':_0x74b3('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x3dd9c8,_0x24b48b){var _0x34b35e=[];if(_0x3dd9c8&&_0x3dd9c8[_0x74b3('0x2f')]>0x0){_0x34b35e=_[_0x74b3('0x30')](_0x3dd9c8,_0x24b48b);}return _0x34b35e;}function getCustomFields(_0x36d1d1,_0x261491){var _0x3c2c4c=[];var _0x2c5a7d={'custom_fields':[]};if(_0x36d1d1[_0x74b3('0x2f')]>0x0){_['forEach'](_0x36d1d1,function(_0x3eb71e){if(_0x3eb71e[_0x74b3('0x31')]===_0x74b3('0x32')&&_0x3eb71e[_0x74b3('0x33')]&&!_0x3eb71e[_0x74b3('0x34')]){_0x2c5a7d[_0x3eb71e[_0x74b3('0x33')][_0x74b3('0x35')]()]=_0x3eb71e[_0x74b3('0x36')][_0x74b3('0x37')]();}else if(_0x3eb71e[_0x74b3('0x31')]===_0x74b3('0x32')&&_0x3eb71e[_0x74b3('0x38')]&&_0x3eb71e['customField']){_0x2c5a7d[_0x74b3('0x17')][_0x74b3('0x39')]({'id':_0x3eb71e['idField'],'value':_0x3eb71e[_0x74b3('0x36')][_0x74b3('0x37')]()});}else if(_0x3eb71e[_0x74b3('0x31')]===_0x74b3('0x3a')&&_0x3eb71e[_0x74b3('0x3b')]&&_0x3eb71e[_0x74b3('0x38')]&&_0x3eb71e[_0x74b3('0x34')]){_0x261491[_0x3eb71e[_0x74b3('0x3b')]]&&_0x2c5a7d[_0x74b3('0x17')][_0x74b3('0x39')]({'id':_0x3eb71e['idField'],'value':_0x261491[_0x3eb71e[_0x74b3('0x3b')]][_0x74b3('0x37')]()});}else if(_0x3eb71e['type']===_0x74b3('0x3c')&&_0x3eb71e[_0x74b3('0x3d')]&&_0x3eb71e[_0x74b3('0x3d')]['name']&&_0x3eb71e[_0x74b3('0x38')]&&_0x3eb71e[_0x74b3('0x34')]){_0x261491[_0x3eb71e[_0x74b3('0x3d')][_0x74b3('0x15')][_0x74b3('0x35')]()]&&_0x2c5a7d[_0x74b3('0x17')][_0x74b3('0x39')]({'id':_0x3eb71e[_0x74b3('0x38')],'value':_0x261491[_0x3eb71e[_0x74b3('0x3d')][_0x74b3('0x15')][_0x74b3('0x35')]()]['toString']()});}});}return _0x2c5a7d;}exports[_0x74b3('0x3e')]=function(_0x4780da,_0x3bc996,_0x39b9c7,_0x30e78b,_0x4aea6e,_0x196e55){var _0x3a5d85,_0x3296e4;_0x196e55[_0x74b3('0x19')]=intUtil[_0x74b3('0x3f')](_0x196e55['remoteUri']);_0x196e55[_0x74b3('0x40')]=intUtil[_0x74b3('0x3f')](_0x196e55['serverUrl']);if(_0x4aea6e&&_0x4aea6e[_0x74b3('0x41')]){logger['info']('[QUEUE]',_0x74b3('0x42'));_0x3bc996[_0x74b3('0x43')]=util[_0x74b3('0xd')](_0x74b3('0x44'),_0x196e55[_0x74b3('0x40')],_0x3bc996['uniqueid'],md5(_0x3bc996[_0x74b3('0x45')]));}else{_0x3bc996[_0x74b3('0x43')]='';}headers[_0x74b3('0x46')]=getAuth(_0x196e55);return getUser(_0x196e55,_0x30e78b[_0x74b3('0x1d')])['then'](function(_0x531676){_0x3a5d85=_0x531676;logger['info'](_0x74b3('0x47'),_0x3a5d85['id']);return getEndUser(_0x196e55,_0x3bc996[_0x74b3('0xf')],_0x3bc996['calleridnum']);})['then'](function(_0x2916ef){_0x3296e4=_0x2916ef;logger[_0x74b3('0xb')](_0x74b3('0x48'),_0x3296e4['id']);return getTicket(_0x196e55,_0x3a5d85,_0x3296e4,_0x39b9c7,_0x3bc996);})[_0x74b3('0x1a')](function(_0x2521c1){if(_0x2521c1&&_0x2521c1['id']){logger[_0x74b3('0xb')](_0x74b3('0x49'));logger[_0x74b3('0xb')](_0x74b3('0x4a'),_0x2521c1['id']);logger[_0x74b3('0xb')](_0x74b3('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x74b3('0xd')](_0x74b3('0x4c'),_0x30e78b[_0x74b3('0x15')]),_0x74b3('0x4d'),{'uri':util['format'](_0x74b3('0x4e'),_0x196e55[_0x74b3('0x19')],_0x2521c1['id'])});}})[_0x74b3('0x4f')](function(_0x27efd9){logger['error'](_0x74b3('0x4b'),JSON[_0x74b3('0x2c')](_0x27efd9));});};exports[_0x74b3('0x50')]=function(_0x4bbf16,_0x463568,_0x531274,_0x17ea70,_0x58647a,_0x1d2ce3,_0x140bcf){var _0x27be9f,_0x6324c6;_0x1d2ce3[_0x74b3('0x19')]=intUtil[_0x74b3('0x3f')](_0x1d2ce3[_0x74b3('0x19')]);_0x1d2ce3[_0x74b3('0x40')]=intUtil[_0x74b3('0x3f')](_0x1d2ce3[_0x74b3('0x40')]);if(_0x140bcf&&_0x140bcf[_0x74b3('0x51')]&&_0x140bcf[_0x74b3('0x51')]!==_0x74b3('0x52')){logger[_0x74b3('0xb')](_0x74b3('0x53'),_0x74b3('0x42'));_0x463568[_0x74b3('0x43')]=util[_0x74b3('0xd')](_0x74b3('0x44'),_0x1d2ce3[_0x74b3('0x40')],_0x463568[_0x74b3('0x45')],md5(_0x463568['uniqueid']));}headers[_0x74b3('0x46')]=getAuth(_0x1d2ce3);return getUser(_0x1d2ce3,_0x17ea70[_0x74b3('0x1d')])[_0x74b3('0x1a')](function(_0x4992bc){_0x27be9f=_0x4992bc;logger['info'](_0x74b3('0x47'),_0x27be9f['id']);return getEndUser(_0x1d2ce3,_0x463568[_0x74b3('0x54')],_0x463568[_0x74b3('0x55')]);})[_0x74b3('0x1a')](function(_0xc65ff7){_0x6324c6=_0xc65ff7;logger[_0x74b3('0xb')](_0x74b3('0x48'),_0x6324c6['id']);return getTicket(_0x1d2ce3,_0x27be9f,_0x6324c6,_0x531274,_0x463568);})['then'](function(_0x5b4a12){if(_0x5b4a12&&_0x5b4a12['id']){logger['info']('Ticket\x20created!');logger[_0x74b3('0xb')](_0x74b3('0x4a'),_0x5b4a12['id']);logger[_0x74b3('0xb')]('[OUTBOUND]',_0x74b3('0x56'));emit(util[_0x74b3('0xd')]('user:%s',_0x17ea70[_0x74b3('0x15')]),_0x74b3('0x4d'),{'uri':util['format'](_0x74b3('0x4e'),_0x1d2ce3[_0x74b3('0x19')],_0x5b4a12['id'])});}})['catch'](function(_0x38d74b){logger[_0x74b3('0x57')](_0x74b3('0x53'),JSON[_0x74b3('0x2c')](_0x38d74b));});};exports['abandoned']=function(_0x53f7bd,_0x56906e,_0x4ef3db,_0x2e0950,_0x420f8f,_0x2a7766){var _0xbfc4a3,_0x5b0b93;_0x2a7766[_0x74b3('0x19')]=intUtil[_0x74b3('0x3f')](_0x2a7766[_0x74b3('0x19')]);_0x2a7766['serverUrl']=intUtil['stripTrailingSlash'](_0x2a7766[_0x74b3('0x40')]);if(_0x420f8f&&_0x420f8f[_0x74b3('0x41')]){logger[_0x74b3('0xb')](_0x74b3('0x58'),_0x74b3('0x42'));_0x56906e[_0x74b3('0x43')]=util[_0x74b3('0xd')](_0x74b3('0x44'),_0x2a7766[_0x74b3('0x40')],_0x56906e[_0x74b3('0x45')],md5(_0x56906e[_0x74b3('0x45')]));}else{_0x56906e[_0x74b3('0x43')]='';}headers[_0x74b3('0x46')]=getAuth(_0x2a7766);return getUser(_0x2a7766,'')[_0x74b3('0x1a')](function(_0x30a52e){_0xbfc4a3=_0x30a52e;logger[_0x74b3('0xb')]('The\x20User\x20ID\x20is:',_0xbfc4a3['id']);return getEndUser(_0x2a7766,_0x56906e[_0x74b3('0xf')],_0x56906e[_0x74b3('0x59')]);})[_0x74b3('0x1a')](function(_0x415769){_0x5b0b93=_0x415769;logger[_0x74b3('0xb')](_0x74b3('0x48'),_0x5b0b93['id']);return getTicket(_0x2a7766,_0xbfc4a3,_0x5b0b93,_0x4ef3db,_0x56906e);})[_0x74b3('0x1a')](function(_0x11066b){if(_0x11066b){logger[_0x74b3('0xb')](_0x74b3('0x49'));logger[_0x74b3('0xb')]('The\x20Ticket\x20ID\x20is:',_0x11066b['id']);}})['catch'](function(_0x374052){logger[_0x74b3('0x57')](_0x74b3('0x58'),JSON[_0x74b3('0x2c')](_0x374052));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 933a191..b7a5acd 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ec7=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','bluebird','ioredis','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','catch','message','Getting\x20contacts\x20filter','filters','forEach','name','All\x20Contacts','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Contact','format','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','ticketId','/contacts/','emit','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x1b0e7f,_0x29236a){var _0x1973f3=function(_0x30da1a){while(--_0x30da1a){_0x1b0e7f['push'](_0x1b0e7f['shift']());}};_0x1973f3(++_0x29236a);}(_0x6ec7,0x1af));var _0x76ec=function(_0x11b29b,_0x4ddf11){_0x11b29b=_0x11b29b-0x0;var _0x2fbae6=_0x6ec7[_0x11b29b];return _0x2fbae6;};'use strict';var _=require('lodash');var rp=require(_0x76ec('0x0'));var md5=require(_0x76ec('0x1'));var util=require(_0x76ec('0x2'));var moment=require('moment');var Promise=require(_0x76ec('0x3'));var Redis=require(_0x76ec('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x76ec('0x5'));config['redis']=_['defaults'](config[_0x76ec('0x6')],{'host':_0x76ec('0x7'),'port':0x18eb});var io=require(_0x76ec('0x8'))(new Redis(config[_0x76ec('0x6')]));function getAdminId(_0x1027ea,_0x445c53,_0x2c0aaf,_0xfcddc6){return new Promise(function(_0x231b92,_0x5e821b){var _0x57994e=![];var _0x5657cb={'method':_0x76ec('0x9'),'uri':_0xfcddc6+_0x76ec('0xa'),'json':!![]};_0x5657cb[_0x76ec('0xb')]=_0x2c0aaf;logger['info'](_0x76ec('0xc'));return rp(_0x5657cb)[_0x76ec('0xd')](function(_0x2ccede){if(_0x2ccede){var _0x2a5389=_0x2ccede['users'];var _0xba49ef=null;for(_0xba49ef=0x0;_0xba49ef<_0x2a5389[_0x76ec('0xe')];_0xba49ef++){if(_0x2a5389[_0xba49ef][_0x76ec('0xf')]===_0x1027ea[_0x76ec('0x10')]){_0x1027ea[_0x76ec('0x11')]=_0x2a5389[_0xba49ef]['id'];_0x57994e=!![];}}if(_0x57994e){logger[_0x76ec('0x12')](_0x76ec('0x13'),_0x1027ea[_0x76ec('0x11')]);_0x231b92(_0x1027ea);}else{_0x5e821b({'statusCode':0x194,'message':_0x76ec('0x14')});}}else{_0x5e821b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x4985ee){logger[_0x76ec('0x15')]('['+[_0x445c53[_0x76ec('0x16')]()]+']',_0x4985ee['message']);_0x5e821b(_0x4985ee);});});}function getUser(_0x12680a,_0x135a9,_0x19e60b){return function(_0x66f2a5){return new Promise(function(_0x5cdd4b,_0x140c15){var _0x15efd8={'method':_0x76ec('0x9'),'uri':_0x19e60b+_0x76ec('0xa'),'json':!![]};_0x15efd8['headers']=_0x135a9;logger[_0x76ec('0x12')](_0x76ec('0x17'));return rp(_0x15efd8)['then'](function(_0x3ef5b9){if(_0x3ef5b9){var _0x110c71=_0x3ef5b9['users'];var _0x8469d0=![];var _0x4896be=null;if(_0x66f2a5[_0x76ec('0x18')]!==null){logger[_0x76ec('0x12')](_0x76ec('0x19'),_0x66f2a5[_0x76ec('0x18')]);_0x66f2a5[_0x76ec('0x1a')]=_0x66f2a5[_0x76ec('0x18')];for(_0x4896be=0x0;_0x4896be<_0x110c71[_0x76ec('0xe')];_0x4896be++){if(_0x110c71[_0x4896be][_0x76ec('0xf')]===_0x66f2a5[_0x76ec('0x18')]){_0x8469d0=!![];_0x66f2a5[_0x76ec('0x1b')]=_0x110c71[_0x4896be]['id'];logger[_0x76ec('0x12')](_0x76ec('0x1c'),_0x66f2a5[_0x76ec('0x1b')]);}}}if(!_0x8469d0){logger[_0x76ec('0x12')]('Admin\x20selected');_0x66f2a5[_0x76ec('0x1a')]=_0x66f2a5[_0x76ec('0x10')];_0x66f2a5[_0x76ec('0x1b')]=_0x66f2a5[_0x76ec('0x11')];_0x8469d0=!![];}if(_0x8469d0){_0x5cdd4b(_0x66f2a5);}else{_0x140c15({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x140c15({'statusCode':0x194,'message':_0x76ec('0x14')});}})[_0x76ec('0x1d')](function(_0x3f640e){logger['error']('['+[_0x12680a['toUpperCase']()]+']',_0x3f640e[_0x76ec('0x1e')]);_0x140c15(_0x3f640e);});});};}function getEndUser(_0xb8fe32,_0x297273,_0x480b44){return function(_0x1533df){return new Promise(function(_0x58c0e7,_0x2b2f42){var _0x455d7a=0x0;var _0x232cdb={'method':_0x76ec('0x9'),'uri':_0x480b44+'/api/contacts/filters','json':!![]};_0x232cdb[_0x76ec('0xb')]=_0x297273;logger[_0x76ec('0x12')](_0x76ec('0x1f'));return rp(_0x232cdb)[_0x76ec('0xd')](function(_0x36f3b5){_0x36f3b5[_0x76ec('0x20')][_0x76ec('0x21')](function(_0x21156c){if(_0x21156c[_0x76ec('0x22')]===_0x76ec('0x23')){_0x455d7a=_0x21156c['id'];}});})['then'](function(){logger[_0x76ec('0x12')]('Getting\x20contact\x20list');var _0x10a7ce={'method':_0x76ec('0x9'),'uri':_0x480b44+_0x76ec('0x24')+_0x455d7a,'json':!![]};_0x10a7ce['headers']=_0x297273;return rp(_0x10a7ce);})[_0x76ec('0xd')](function(_0x32a12f){logger[_0x76ec('0x12')](_0x76ec('0x25'),_0x1533df[_0x76ec('0x26')]);if(_0x32a12f[_0x76ec('0x27')][_0x76ec('0xe')]>0x0){var _0x12dd73=_['find'](_0x32a12f['contacts'],function(_0x3c4e65){if(_0x3c4e65['work_number']===_0x1533df[_0x76ec('0x26')]||_0x3c4e65[_0x76ec('0x28')]===_0x1533df['contactNumber']){return _0x3c4e65;}});if(_0x12dd73){_0x1533df[_0x76ec('0x29')]=_0x12dd73['id'];logger['info'](_0x76ec('0x2a'),_0x1533df[_0x76ec('0x29')]);_0x58c0e7(_0x1533df);}else{return createEndUser(_0x1533df,_0xb8fe32,_0x297273,_0x480b44)[_0x76ec('0xd')](function(_0x59d114){logger['info'](_0x76ec('0x2b'),_0x1533df[_0x76ec('0x29')]);_0x58c0e7(_0x59d114);});}}else{return createEndUser(_0x1533df,_0xb8fe32,_0x297273,_0x480b44)[_0x76ec('0xd')](function(_0x27f841){logger[_0x76ec('0x12')](_0x76ec('0x2b'),_0x1533df['endUserId']);_0x58c0e7(_0x27f841);});}})[_0x76ec('0x1d')](function(_0x5a5338){throw new Error(_0x5a5338[_0x76ec('0x1e')]);});});};}function createEndUser(_0xb7b178,_0x59f230,_0x42086d,_0x124c83){return new Promise(function(_0x5c257a,_0x586834){var _0x4800cf=moment();var _0x95ccef={'method':_0x76ec('0x2c'),'uri':_0x124c83+_0x76ec('0x2d'),'body':{'contact':{'last_name':_0xb7b178[_0x76ec('0x26')],'work_number':_0xb7b178['contactNumber'],'mobile_number':_0xb7b178[_0x76ec('0x26')],'owner_id':_0xb7b178[_0x76ec('0x1b')],'created_at':_0x4800cf['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x95ccef[_0x76ec('0xb')]=_0x42086d;logger[_0x76ec('0x12')](_0x76ec('0x2e'));return rp(_0x95ccef)[_0x76ec('0xd')](function(_0x191e12){_0xb7b178['endUserId']=_0x191e12[_0x76ec('0x2f')]['id'];_0x5c257a(_0xb7b178);})[_0x76ec('0x1d')](function(_0x50e80f){logger[_0x76ec('0x15')]('['+[_0x59f230[_0x76ec('0x16')]()]+']',_0x50e80f['message']);_0x586834(_0x50e80f[_0x76ec('0x1e')]);});});}function getTicket(_0xb602ba,_0x3c908b,_0xe0e3f,_0x252f10,_0xc13b89){return function(_0xad8d9b){logger[_0x76ec('0x12')](_0x76ec('0x30'));return new Promise(function(_0x57e09e,_0x4e7b2b){var _0xe6da1c=moment();var _0x4de8d9={'method':_0x76ec('0x2c'),'uri':_0xe0e3f+'/api/tasks','body':{'title':intUtil[_0x76ec('0x31')](_0x252f10[_0x76ec('0x32')],_0xc13b89,'\x20'),'description':intUtil[_0x76ec('0x31')](_0x252f10['Descriptions'],_0xc13b89,'\x0a'),'owner_id':_0xad8d9b[_0x76ec('0x1b')],'creater_id':_0xad8d9b['adminId'],'targetable_id':_0xad8d9b['endUserId'],'targetable_type':_0x76ec('0x33'),'created_at':_0xe6da1c[_0x76ec('0x34')](_0x76ec('0x35')),'due_date':_0xe6da1c[_0x76ec('0x36')](0x1e,'m')[_0x76ec('0x34')](_0x76ec('0x35'))},'json':!![]};_0x4de8d9[_0x76ec('0xb')]=_0x3c908b;return rp(_0x4de8d9)[_0x76ec('0xd')](function(_0x2f2e2b){_0xad8d9b['ticketId']=_0x2f2e2b[_0x76ec('0x37')]['id'];logger[_0x76ec('0x12')](_0x76ec('0x38'),_0xad8d9b[_0x76ec('0x39')]);_0x57e09e(_0xad8d9b);})[_0x76ec('0x1d')](function(_0x4fd582){logger[_0x76ec('0x15')]('['+[_0xb602ba[_0x76ec('0x16')]()]+']',_0x4fd582[_0x76ec('0x1e')]);_0x4e7b2b(_0x4fd582[_0x76ec('0x1e')]);});});};}function emit(_0x21fe83,_0x3c61cf,_0x48d807){var _0x2c7042={'uri':_0x21fe83+_0x76ec('0x3a')+_0x48d807};io['to'](util['format']('user:%s',_0x3c61cf))[_0x76ec('0x3b')]('trigger:browser:url',_0x2c7042);}exports['cs']=function(_0x345196,_0x3a8202,_0x2c70cc,_0x3de94c,_0x2b4c17,_0x141f01,_0x4c52f5,_0x14e50c){var _0x4c22b6={};var _0x14cc5f={'Authorization':'Token\x20token='+_0x141f01[_0x76ec('0x3c')]};_0x141f01[_0x76ec('0x3d')]=intUtil[_0x76ec('0x3e')](_0x141f01[_0x76ec('0x3d')]);_0x141f01[_0x76ec('0x3f')]=intUtil[_0x76ec('0x3e')](_0x141f01[_0x76ec('0x3f')]);var _0x43cd34=_0x141f01['remoteUri'];_0x4c22b6[_0x76ec('0x10')]=_0x141f01[_0x76ec('0x40')];_0x4c22b6[_0x76ec('0x26')]=_0x14e50c[_0x76ec('0x41')]()===_0x76ec('0x42')?_0x3a8202[_0x76ec('0x43')]:_0x3a8202[_0x76ec('0x44')];_0x4c22b6[_0x76ec('0x45')]=_0x14e50c===_0x76ec('0x46')||_0x14e50c===_0x76ec('0x47')?_0x76ec('0x46'):_0x76ec('0x42');if(_0x3de94c){_0x4c22b6[_0x76ec('0x18')]=_0x3de94c[_0x76ec('0xf')];}var _0x121b52=util['format'](_0x76ec('0x48'),_0x141f01[_0x76ec('0x3f')],_0x3a8202[_0x76ec('0x49')],md5(_0x3a8202[_0x76ec('0x49')]));if(_0x2b4c17&&_0x2b4c17[_0x76ec('0x4a')]){logger[_0x76ec('0x12')](_0x76ec('0x4b'),_0x76ec('0x4c'));_0x3a8202[_0x76ec('0x4d')]=_0x121b52;}else if(_0x4c52f5&&_0x4c52f5['recordingFormat']&&_0x4c52f5[_0x76ec('0x4e')]!==_0x76ec('0x4f')){logger[_0x76ec('0x12')](_0x76ec('0x50'),_0x76ec('0x4c'));_0x3a8202[_0x76ec('0x4d')]=_0x121b52;}else{_0x3a8202[_0x76ec('0x4d')]='';}return getAdminId(_0x4c22b6,_0x14e50c,_0x14cc5f,_0x43cd34)[_0x76ec('0xd')](getUser(_0x14e50c,_0x14cc5f,_0x43cd34))['then'](getEndUser(_0x14e50c,_0x14cc5f,_0x43cd34))[_0x76ec('0xd')](getTicket(_0x14e50c,_0x14cc5f,_0x43cd34,_0x2c70cc,_0x3a8202))[_0x76ec('0xd')](function(_0x10228a){logger[_0x76ec('0x12')](util[_0x76ec('0x34')](_0x76ec('0x51'),_0x10228a['ticketId']));if(_0x14e50c!=='abandoned'){logger[_0x76ec('0x12')]('['+[_0x14e50c['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x43cd34,_0x3de94c[_0x76ec('0x22')],_0x10228a['endUserId']);}})[_0x76ec('0x1d')](function(_0x537272){logger['error']('['+[_0x14e50c['toUpperCase']()]+_0x76ec('0x52'),util[_0x76ec('0x53')](_0x537272,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1adb=['../../../../config/logger','freshsales','redis','defaults','localhost','headers','info','Getting\x20admin\x20information','then','length','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','users','agentEmail','Getting\x20user\x20with\x20email','email','userId','User\x20found:','/api/contacts/filters','filters','forEach','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','find','work_number','mobile_number','contactNumber','Contact\x20found:','endUserId','Contact\x20created:','POST','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','bluebird','ioredis','./util','../../../../config/environment'];(function(_0x42cedc,_0x3b34a2){var _0xed196e=function(_0x57127f){while(--_0x57127f){_0x42cedc['push'](_0x42cedc['shift']());}};_0xed196e(++_0x3b34a2);}(_0x1adb,0xfe));var _0xb1ad=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1adb[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb1ad('0x0'));var rp=require('request-promise');var md5=require(_0xb1ad('0x1'));var util=require(_0xb1ad('0x2'));var moment=require('moment');var Promise=require(_0xb1ad('0x3'));var Redis=require(_0xb1ad('0x4'));var intUtil=require(_0xb1ad('0x5'));var config=require(_0xb1ad('0x6'));var logger=require(_0xb1ad('0x7'))(_0xb1ad('0x8'));config[_0xb1ad('0x9')]=_[_0xb1ad('0xa')](config[_0xb1ad('0x9')],{'host':_0xb1ad('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x3ada4a,_0x3a3934,_0x3466e5,_0x192303){return new Promise(function(_0x1474fb,_0x4b7670){var _0x5be712=![];var _0x5bdec5={'method':'GET','uri':_0x192303+'/api/selector/owners','json':!![]};_0x5bdec5[_0xb1ad('0xc')]=_0x3466e5;logger[_0xb1ad('0xd')](_0xb1ad('0xe'));return rp(_0x5bdec5)[_0xb1ad('0xf')](function(_0x4515fc){if(_0x4515fc){var _0x1ca013=_0x4515fc['users'];var _0x2ce914=null;for(_0x2ce914=0x0;_0x2ce914<_0x1ca013[_0xb1ad('0x10')];_0x2ce914++){if(_0x1ca013[_0x2ce914]['email']===_0x3ada4a['adminEmail']){_0x3ada4a['adminId']=_0x1ca013[_0x2ce914]['id'];_0x5be712=!![];}}if(_0x5be712){logger['info']('Admin\x20found:',_0x3ada4a[_0xb1ad('0x11')]);_0x1474fb(_0x3ada4a);}else{_0x4b7670({'statusCode':0x194,'message':_0xb1ad('0x12')});}}else{_0x4b7670({'statusCode':0x194,'message':_0xb1ad('0x12')});}})[_0xb1ad('0x13')](function(_0x3de580){logger[_0xb1ad('0x14')]('['+[_0x3a3934[_0xb1ad('0x15')]()]+']',_0x3de580[_0xb1ad('0x16')]);_0x4b7670(_0x3de580);});});}function getUser(_0x542f74,_0x5223f4,_0x280f43){return function(_0x189385){return new Promise(function(_0x3b76c1,_0x3c9522){var _0x11c502={'method':_0xb1ad('0x17'),'uri':_0x280f43+'/api/selector/owners','json':!![]};_0x11c502[_0xb1ad('0xc')]=_0x5223f4;logger[_0xb1ad('0xd')]('Getting\x20user\x20list');return rp(_0x11c502)['then'](function(_0x5a4b68){if(_0x5a4b68){var _0xa26fbc=_0x5a4b68[_0xb1ad('0x18')];var _0x1ec8b9=![];var _0x1fefd3=null;if(_0x189385[_0xb1ad('0x19')]!==null){logger['info'](_0xb1ad('0x1a'),_0x189385[_0xb1ad('0x19')]);_0x189385['userEmail']=_0x189385[_0xb1ad('0x19')];for(_0x1fefd3=0x0;_0x1fefd3<_0xa26fbc[_0xb1ad('0x10')];_0x1fefd3++){if(_0xa26fbc[_0x1fefd3][_0xb1ad('0x1b')]===_0x189385[_0xb1ad('0x19')]){_0x1ec8b9=!![];_0x189385[_0xb1ad('0x1c')]=_0xa26fbc[_0x1fefd3]['id'];logger[_0xb1ad('0xd')](_0xb1ad('0x1d'),_0x189385['userId']);}}}if(!_0x1ec8b9){logger['info']('Admin\x20selected');_0x189385['userEmail']=_0x189385['adminEmail'];_0x189385[_0xb1ad('0x1c')]=_0x189385[_0xb1ad('0x11')];_0x1ec8b9=!![];}if(_0x1ec8b9){_0x3b76c1(_0x189385);}else{_0x3c9522({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3c9522({'statusCode':0x194,'message':_0xb1ad('0x12')});}})[_0xb1ad('0x13')](function(_0x333a12){logger[_0xb1ad('0x14')]('['+[_0x542f74[_0xb1ad('0x15')]()]+']',_0x333a12[_0xb1ad('0x16')]);_0x3c9522(_0x333a12);});});};}function getEndUser(_0x3a4f4b,_0x28605e,_0x2aed99){return function(_0x2429bb){return new Promise(function(_0x41e80b,_0x2dd4e9){var _0x49eeab=0x0;var _0x1f57fd={'method':_0xb1ad('0x17'),'uri':_0x2aed99+_0xb1ad('0x1e'),'json':!![]};_0x1f57fd[_0xb1ad('0xc')]=_0x28605e;logger[_0xb1ad('0xd')]('Getting\x20contacts\x20filter');return rp(_0x1f57fd)['then'](function(_0x36ce0c){_0x36ce0c[_0xb1ad('0x1f')][_0xb1ad('0x20')](function(_0x1a815f){if(_0x1a815f['name']===_0xb1ad('0x21')){_0x49eeab=_0x1a815f['id'];}});})[_0xb1ad('0xf')](function(){logger[_0xb1ad('0xd')](_0xb1ad('0x22'));var _0x5cb8da={'method':'GET','uri':_0x2aed99+_0xb1ad('0x23')+_0x49eeab,'json':!![]};_0x5cb8da[_0xb1ad('0xc')]=_0x28605e;return rp(_0x5cb8da);})[_0xb1ad('0xf')](function(_0x3c48de){logger[_0xb1ad('0xd')](_0xb1ad('0x24'),_0x2429bb['contactNumber']);if(_0x3c48de['contacts'][_0xb1ad('0x10')]>0x0){var _0x508279=_[_0xb1ad('0x25')](_0x3c48de['contacts'],function(_0xf7b617){if(_0xf7b617[_0xb1ad('0x26')]===_0x2429bb['contactNumber']||_0xf7b617[_0xb1ad('0x27')]===_0x2429bb[_0xb1ad('0x28')]){return _0xf7b617;}});if(_0x508279){_0x2429bb['endUserId']=_0x508279['id'];logger[_0xb1ad('0xd')](_0xb1ad('0x29'),_0x2429bb[_0xb1ad('0x2a')]);_0x41e80b(_0x2429bb);}else{return createEndUser(_0x2429bb,_0x3a4f4b,_0x28605e,_0x2aed99)['then'](function(_0x378fed){logger[_0xb1ad('0xd')](_0xb1ad('0x2b'),_0x2429bb[_0xb1ad('0x2a')]);_0x41e80b(_0x378fed);});}}else{return createEndUser(_0x2429bb,_0x3a4f4b,_0x28605e,_0x2aed99)[_0xb1ad('0xf')](function(_0x345fbd){logger['info']('Contact\x20created:',_0x2429bb[_0xb1ad('0x2a')]);_0x41e80b(_0x345fbd);});}})[_0xb1ad('0x13')](function(_0x1de62c){throw new Error(_0x1de62c[_0xb1ad('0x16')]);});});};}function createEndUser(_0x14f181,_0x1af74f,_0x3f244f,_0xeb5662){return new Promise(function(_0x369a87,_0x520a0b){var _0x52cbdb=moment();var _0x1a20af={'method':_0xb1ad('0x2c'),'uri':_0xeb5662+'/api/contacts','body':{'contact':{'last_name':_0x14f181['contactNumber'],'work_number':_0x14f181[_0xb1ad('0x28')],'mobile_number':_0x14f181[_0xb1ad('0x28')],'owner_id':_0x14f181[_0xb1ad('0x1c')],'created_at':_0x52cbdb[_0xb1ad('0x2d')](_0xb1ad('0x2e'))}},'json':!![]};_0x1a20af[_0xb1ad('0xc')]=_0x3f244f;logger[_0xb1ad('0xd')](_0xb1ad('0x2f'));return rp(_0x1a20af)['then'](function(_0x1be275){_0x14f181[_0xb1ad('0x2a')]=_0x1be275[_0xb1ad('0x30')]['id'];_0x369a87(_0x14f181);})[_0xb1ad('0x13')](function(_0x22944f){logger[_0xb1ad('0x14')]('['+[_0x1af74f[_0xb1ad('0x15')]()]+']',_0x22944f[_0xb1ad('0x16')]);_0x520a0b(_0x22944f[_0xb1ad('0x16')]);});});}function getTicket(_0x1935af,_0x3f7735,_0x43ef6e,_0x193c22,_0x107652){return function(_0x2dd7c7){logger[_0xb1ad('0xd')](_0xb1ad('0x31'));return new Promise(function(_0x10d615,_0x503d38){var _0x5ae9e5=moment();var _0x49b49d={'method':_0xb1ad('0x2c'),'uri':_0x43ef6e+_0xb1ad('0x32'),'body':{'title':intUtil[_0xb1ad('0x33')](_0x193c22[_0xb1ad('0x34')],_0x107652,'\x20'),'description':intUtil[_0xb1ad('0x33')](_0x193c22[_0xb1ad('0x35')],_0x107652,'\x0a'),'owner_id':_0x2dd7c7[_0xb1ad('0x1c')],'creater_id':_0x2dd7c7[_0xb1ad('0x11')],'targetable_id':_0x2dd7c7[_0xb1ad('0x2a')],'targetable_type':_0xb1ad('0x36'),'created_at':_0x5ae9e5[_0xb1ad('0x2d')](_0xb1ad('0x2e')),'due_date':_0x5ae9e5[_0xb1ad('0x37')](0x1e,'m')[_0xb1ad('0x2d')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x49b49d[_0xb1ad('0xc')]=_0x3f7735;return rp(_0x49b49d)[_0xb1ad('0xf')](function(_0x3f0c1c){_0x2dd7c7[_0xb1ad('0x38')]=_0x3f0c1c[_0xb1ad('0x39')]['id'];logger[_0xb1ad('0xd')]('Task\x20created:',_0x2dd7c7[_0xb1ad('0x38')]);_0x10d615(_0x2dd7c7);})[_0xb1ad('0x13')](function(_0x21dffe){logger[_0xb1ad('0x14')]('['+[_0x1935af[_0xb1ad('0x15')]()]+']',_0x21dffe[_0xb1ad('0x16')]);_0x503d38(_0x21dffe[_0xb1ad('0x16')]);});});};}function emit(_0x5079e9,_0x2c1f0c,_0x39917e){var _0xa63c24={'uri':_0x5079e9+_0xb1ad('0x3a')+_0x39917e};io['to'](util[_0xb1ad('0x2d')]('user:%s',_0x2c1f0c))[_0xb1ad('0x3b')](_0xb1ad('0x3c'),_0xa63c24);}exports['cs']=function(_0x53e063,_0x47625b,_0x150809,_0x5380c4,_0xa906f,_0x5b4b7f,_0x31b702,_0x4233fb){var _0x22a592={};var _0x2ab8cb={'Authorization':_0xb1ad('0x3d')+_0x5b4b7f[_0xb1ad('0x3e')]};_0x5b4b7f[_0xb1ad('0x3f')]=intUtil[_0xb1ad('0x40')](_0x5b4b7f[_0xb1ad('0x3f')]);_0x5b4b7f[_0xb1ad('0x41')]=intUtil[_0xb1ad('0x40')](_0x5b4b7f[_0xb1ad('0x41')]);var _0x1352d3=_0x5b4b7f[_0xb1ad('0x3f')];_0x22a592['adminEmail']=_0x5b4b7f[_0xb1ad('0x42')];_0x22a592[_0xb1ad('0x28')]=_0x4233fb[_0xb1ad('0x43')]()===_0xb1ad('0x44')?_0x47625b['destcalleridnum']:_0x47625b[_0xb1ad('0x45')];_0x22a592[_0xb1ad('0x46')]=_0x4233fb===_0xb1ad('0x47')||_0x4233fb===_0xb1ad('0x48')?_0xb1ad('0x47'):_0xb1ad('0x44');if(_0x5380c4){_0x22a592[_0xb1ad('0x19')]=_0x5380c4[_0xb1ad('0x1b')];}var _0x339c7b=util[_0xb1ad('0x2d')](_0xb1ad('0x49'),_0x5b4b7f['serverUrl'],_0x47625b[_0xb1ad('0x4a')],md5(_0x47625b[_0xb1ad('0x4a')]));if(_0xa906f&&_0xa906f[_0xb1ad('0x4b')]){logger[_0xb1ad('0xd')](_0xb1ad('0x4c'),_0xb1ad('0x4d'));_0x47625b[_0xb1ad('0x4e')]=_0x339c7b;}else if(_0x31b702&&_0x31b702['recordingFormat']&&_0x31b702[_0xb1ad('0x4f')]!==_0xb1ad('0x50')){logger['info'](_0xb1ad('0x51'),'Recording\x20is\x20enabled!');_0x47625b['recordingURL']=_0x339c7b;}else{_0x47625b[_0xb1ad('0x4e')]='';}return getAdminId(_0x22a592,_0x4233fb,_0x2ab8cb,_0x1352d3)[_0xb1ad('0xf')](getUser(_0x4233fb,_0x2ab8cb,_0x1352d3))[_0xb1ad('0xf')](getEndUser(_0x4233fb,_0x2ab8cb,_0x1352d3))[_0xb1ad('0xf')](getTicket(_0x4233fb,_0x2ab8cb,_0x1352d3,_0x150809,_0x47625b))[_0xb1ad('0xf')](function(_0x1c1988){logger['info'](util['format'](_0xb1ad('0x52'),_0x1c1988[_0xb1ad('0x38')]));if(_0x4233fb!==_0xb1ad('0x48')){logger[_0xb1ad('0xd')]('['+[_0x4233fb[_0xb1ad('0x15')]()]+']',_0xb1ad('0x53'));emit(_0x1352d3,_0x5380c4[_0xb1ad('0x54')],_0x1c1988[_0xb1ad('0x2a')]);}})[_0xb1ad('0x13')](function(_0x40e524){logger[_0xb1ad('0x14')]('['+[_0x4233fb[_0xb1ad('0x15')]()]+_0xb1ad('0x55'),util[_0xb1ad('0x56')](_0x40e524,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index b8c9e11..3308936 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x19f453,_0x3df19a){var _0x548816=function(_0x17c893){while(--_0x17c893){_0x19f453['push'](_0x19f453['shift']());}};_0x548816(++_0x3df19a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file +var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x2db350,_0x54ff9b){var _0xa40cc9=function(_0x41514f){while(--_0x41514f){_0x2db350['push'](_0x2db350['shift']());}};_0xa40cc9(++_0x54ff9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index 6954895..3c2f598 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 _0xb90f=['moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','create','type','string','idField','variable','variableName','customVariable','Variable','name','toLowerCase','toString','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','format','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','request-promise','jsforce','util','./util','../../../../config/environment','../../../../config/logger','defaults','socket.io-emitter','Task','utc','getString','Subjects','Descriptions','WhoId','ticketType','assign','sobject','isNil','validateEmail','then','length','find','Email','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','execute','Lead','contact','lead','Case','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.'];(function(_0x214b79,_0x2b7146){var _0x38bfdc=function(_0x3b1698){while(--_0x3b1698){_0x214b79['push'](_0x214b79['shift']());}};_0x38bfdc(++_0x2b7146);}(_0xb90f,0x103));var _0xfb90=function(_0x5f1caa,_0x2a9868){_0x5f1caa=_0x5f1caa-0x0;var _0x2671e4=_0xb90f[_0x5f1caa];return _0x2671e4;};'use strict';var _=require('lodash');var rp=require(_0xfb90('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0xfb90('0x1'));var util=require(_0xfb90('0x2'));var Redis=require('ioredis');var intUtil=require(_0xfb90('0x3'));var config=require(_0xfb90('0x4'));var logger=require(_0xfb90('0x5'))('salesforce');config['redis']=_[_0xfb90('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xfb90('0x7'))(new Redis(config['redis']));function emit(_0x25383c,_0x16951e,_0x577daf){io['to'](_0x25383c)['emit'](_0x16951e,_0x577daf);}function getTicket(_0x249e17,_0x1c0140,_0xbb8ef1,_0xc8a5fa,_0x300653,_0x3da30,_0x42cfd0,_0x3b144f){var _0x348a23={};if(_0xc8a5fa['ticketType']===_0xfb90('0x8')){_0x348a23=Object['assign']({},{'OwnerId':_0x1c0140['id'],'ActivityDate':moment[_0xfb90('0x9')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xfb90('0xa')](_0xc8a5fa[_0xfb90('0xb')],_0x300653,'\x20'),'Description':intUtil[_0xfb90('0xa')](_0xc8a5fa[_0xfb90('0xc')],_0x300653,'\x0a')},getCustomFields(_0x3da30,_0x300653));if(_0xbb8ef1){_0x348a23[_0xfb90('0xd')]=_0xbb8ef1['id'];}}else if(_0xc8a5fa[_0xfb90('0xe')]==='Case'){_0x348a23=Object[_0xfb90('0xf')]({},{'OwnerId':_0x1c0140['id'],'Subject':intUtil[_0xfb90('0xa')](_0xc8a5fa[_0xfb90('0xb')],_0x300653,'\x20'),'Description':intUtil[_0xfb90('0xa')](_0xc8a5fa[_0xfb90('0xc')],_0x300653,'\x0a')},getCustomFields(_0x3da30,_0x300653));if(_0xbb8ef1){_0x348a23['ContactId']=_0xbb8ef1['id'];}}return _0x42cfd0[_0xfb90('0x10')](_0xc8a5fa[_0xfb90('0xe')])['create'](_0x348a23);}function getUser(_0x34bfe0,_0xed9b4f,_0x2d43e8){if(!_[_0xfb90('0x11')](_0xed9b4f)&&intUtil[_0xfb90('0x12')](_0xed9b4f)){var _0x2cf67f={'Email':_0xed9b4f};var _0x4ba175={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2d43e8[_0xfb90('0x10')]('User')['find'](_0x2cf67f,_0x4ba175)['execute']()[_0xfb90('0x13')](function(_0xa4a7b8){if(_0xa4a7b8[_0xfb90('0x14')]){var _0x260d1d=_[_0xfb90('0x15')](_0xa4a7b8,function(_0x135d93){return _0x135d93[_0xfb90('0x16')]===_0xed9b4f;});if(_0x260d1d){logger[_0xfb90('0x17')]('Agent\x20%s\x20found.',_0xed9b4f);return BPromise[_0xfb90('0x18')]({'id':_0x260d1d['Id'],'name':_0x260d1d[_0xfb90('0x19')]});}}else{logger[_0xfb90('0x17')](_0xfb90('0x1a'),_0xed9b4f);return _0x2d43e8[_0xfb90('0x1b')]()[_0xfb90('0x13')](function(_0x55435f){return BPromise[_0xfb90('0x18')]({'id':_0x55435f[_0xfb90('0x1c')],'name':_0x55435f[_0xfb90('0x1d')]});});}});}else{logger[_0xfb90('0x17')](_0xfb90('0x1a'),_0xed9b4f);return _0x2d43e8['identity']()[_0xfb90('0x13')](function(_0x5cc766){return BPromise[_0xfb90('0x18')]({'id':_0x5cc766['user_id'],'name':_0x5cc766['display_name']});});}}function getEndUser(_0x434eec,_0x5cd481,_0x2a60c7,_0x261b9b,_0x150584){var _0x178151={'Phone':_0x261b9b};var _0x2007e3={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xfb90('0x18')]()[_0xfb90('0x13')](function(){if(_0x5cd481[_0xfb90('0xe')]==='Task'){logger[_0xfb90('0x17')](_0xfb90('0x1e'),_0x261b9b,_0x5cd481[_0xfb90('0x1f')]);switch(_0x5cd481[_0xfb90('0x1f')]){case'contact_lead':return _0x150584[_0xfb90('0x10')](_0xfb90('0x20'))[_0xfb90('0x15')](_0x178151,_0x2007e3)[_0xfb90('0x21')]()[_0xfb90('0x13')](function(_0x4f867a){if(_0x4f867a&&_0x4f867a['length']){return _0x4f867a;}else{return _0x150584[_0xfb90('0x10')](_0xfb90('0x22'))[_0xfb90('0x15')](_0x178151,_0x2007e3);}});case _0xfb90('0x23'):return _0x150584[_0xfb90('0x10')](_0xfb90('0x20'))[_0xfb90('0x15')](_0x178151,_0x2007e3)['execute']();case _0xfb90('0x24'):return _0x150584[_0xfb90('0x10')](_0xfb90('0x22'))['find'](_0x178151,_0x2007e3);default:return null;}}else if(_0x5cd481['ticketType']===_0xfb90('0x25')){logger[_0xfb90('0x17')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x261b9b,_0xfb90('0x23'));return _0x150584[_0xfb90('0x10')](_0xfb90('0x20'))[_0xfb90('0x15')](_0x178151,_0x2007e3)['execute']();}})[_0xfb90('0x13')](function(_0x26540d){if(_0x26540d&&_0x26540d[_0xfb90('0x14')]){var _0x459d61=_[_0xfb90('0x15')](_0x26540d,function(_0x45d2d7){return _0x45d2d7[_0xfb90('0x26')]===_0x261b9b;});if(_0x459d61){return BPromise['resolve']({'id':_0x459d61['Id'],'name':_0x459d61[_0xfb90('0x19')],'phone':_0x459d61['Phone']});}}})[_0xfb90('0x13')](function(_0x578609){if(_0x578609){logger[_0xfb90('0x17')](_0xfb90('0x27'),_0x261b9b);return BPromise[_0xfb90('0x18')](_0x578609);}else{logger['info'](_0xfb90('0x28'),_0x261b9b);var _0x45f83c={'LastName':_0x2a60c7!==''?_0x2a60c7:util['format']('Caller\x20-\x20%s',_0x261b9b),'Phone':_0x261b9b};if(_0x5cd481['moduleCreate']){if(_0x5cd481[_0xfb90('0x29')]===_0xfb90('0x23')){logger['info'](_0xfb90('0x2a'),_0x261b9b,_0x5cd481['moduleCreate']);}else if(_0x5cd481[_0xfb90('0x29')]==='lead'&&_0x5cd481['ticketType']===_0xfb90('0x8')){logger[_0xfb90('0x17')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x261b9b,_0x5cd481[_0xfb90('0x29')]);_0x45f83c[_0xfb90('0x2b')]=_0xfb90('0x2c');}else{return null;}}return _0x150584[_0xfb90('0x10')](_[_0xfb90('0x2d')](_0x5cd481['moduleCreate']))[_0xfb90('0x2e')](_0x45f83c);}});}function getCustomFields(_0xa6caf4,_0x13cc62){var _0x33e1ae={};if(_0xa6caf4[_0xfb90('0x14')]>0x0){_['forEach'](_0xa6caf4,function(_0x292ded){if(_0x292ded[_0xfb90('0x2f')]===_0xfb90('0x30')&&_0x292ded[_0xfb90('0x31')]){_0x33e1ae[_0x292ded[_0xfb90('0x31')]]=_0x292ded['content']['toString']();}else if(_0x292ded['type']===_0xfb90('0x32')&&_0x292ded['variableName']&&_0x292ded['idField']){_0x13cc62[_0x292ded[_0xfb90('0x33')]]&&(_0x33e1ae[_0x292ded[_0xfb90('0x31')]]=_0x13cc62[_0x292ded[_0xfb90('0x33')]]['toString']());}else if(_0x292ded[_0xfb90('0x2f')]===_0xfb90('0x34')&&_0x292ded[_0xfb90('0x35')]&&_0x292ded[_0xfb90('0x35')][_0xfb90('0x36')]&&_0x292ded[_0xfb90('0x31')]){_0x13cc62[_0x292ded[_0xfb90('0x35')][_0xfb90('0x36')][_0xfb90('0x37')]()]&&(_0x33e1ae[_0x292ded[_0xfb90('0x31')]]=_0x13cc62[_0x292ded[_0xfb90('0x35')][_0xfb90('0x36')]['toLowerCase']()][_0xfb90('0x38')]());}});}return _0x33e1ae;}function getConnection(_0x4413e9){var _0x13b699=_0x4413e9[_0xfb90('0x39')][_0xfb90('0x3a')](_0x4413e9[_0xfb90('0x3b')]);var _0x267ef1=new jsforce[(_0xfb90('0x3c'))]({'oauth2':{'loginUrl':_0x4413e9[_0xfb90('0x3d')]||_0xfb90('0x3e'),'clientId':_0x4413e9[_0xfb90('0x3f')],'clientSecret':_0x4413e9[_0xfb90('0x40')]}});return _0x267ef1['login'](_0x4413e9[_0xfb90('0x41')],_0x13b699)[_0xfb90('0x13')](function(){logger[_0xfb90('0x17')](_0xfb90('0x42'));return _0x267ef1;});}exports[_0xfb90('0x43')]=function(_0x9e401d,_0x18f1d0,_0x42d6ee,_0x39c4cd,_0x30b333,_0x9c84e5){var _0x27a448,_0x1f6a46,_0x567457,_0x3e27ca;_0x9c84e5[_0xfb90('0x44')]=intUtil['stripTrailingSlash'](_0x9c84e5[_0xfb90('0x44')]);_0x9c84e5['remoteUri']=intUtil[_0xfb90('0x45')](_0x9c84e5['remoteUri']);if(_0x30b333&&_0x30b333[_0xfb90('0x46')]){logger[_0xfb90('0x17')](_0xfb90('0x47'),_0xfb90('0x48'));_0x18f1d0[_0xfb90('0x49')]=util[_0xfb90('0x4a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9c84e5[_0xfb90('0x44')],_0x18f1d0['uniqueid'],md5(_0x18f1d0[_0xfb90('0x4b')]));}else{_0x18f1d0[_0xfb90('0x49')]='';}return getConnection(_0x9c84e5)[_0xfb90('0x13')](function(_0x12e05a){_0x3e27ca=_0x12e05a;return getUser(_0x9c84e5,_0x39c4cd[_0xfb90('0x4c')],_0x3e27ca);})[_0xfb90('0x13')](function(_0x12771e){_0x27a448=_0x12771e;return getEndUser(_0x9c84e5,_0x42d6ee,_0x18f1d0['calleridname'],_0x18f1d0[_0xfb90('0x4d')],_0x3e27ca);})['then'](function(_0x44462a){_0x1f6a46=_0x44462a;return getTicket(_0x9c84e5,_0x27a448,_0x1f6a46,_0x42d6ee,_0x18f1d0,_0x42d6ee[_0xfb90('0x4e')],_0x3e27ca,_0xfb90('0x43'));})[_0xfb90('0x13')](function(_0x3eb705){_0x567457=_0x3eb705;logger[_0xfb90('0x17')](_0xfb90('0x4f'),_0x567457['id']);logger[_0xfb90('0x17')](_0xfb90('0x50'),_0x567457['id'],_0x39c4cd[_0xfb90('0x36')],_0x9c84e5[_0xfb90('0x2f')]);switch(_0x9c84e5[_0xfb90('0x2f')]){case _0xfb90('0x51'):emit(util[_0xfb90('0x4a')](_0xfb90('0x52'),_0x39c4cd[_0xfb90('0x36')]),_0xfb90('0x53'),{'recordId':_0x567457['id']});break;case'newTab':emit(util['format'](_0xfb90('0x52'),_0x39c4cd['name']),_0xfb90('0x54'),{'uri':util[_0xfb90('0x4a')](_0xfb90('0x55'),_0x3e27ca['instanceUrl'],_0x567457['id'])});break;default:logger[_0xfb90('0x56')](_0xfb90('0x57'));}})[_0xfb90('0x58')](function(_0x2707f7){logger['error'](_0xfb90('0x47'),JSON['stringify'](_0x2707f7));});};exports[_0xfb90('0x59')]=function(_0x406c0b,_0x4d9fae,_0x21df15,_0xb5a41d,_0x113ec8,_0x27d689,_0x84461d){var _0x4c678e,_0x2acb3e,_0xa6c574,_0x18849e;_0x27d689['serverUrl']=intUtil[_0xfb90('0x45')](_0x27d689['serverUrl']);_0x27d689['remoteUri']=intUtil[_0xfb90('0x45')](_0x27d689[_0xfb90('0x3d')]);if(_0x84461d&&_0x84461d['recordingFormat']&&_0x84461d[_0xfb90('0x5a')]!=='none'){logger[_0xfb90('0x17')](_0xfb90('0x5b'),_0xfb90('0x48'));_0x4d9fae[_0xfb90('0x49')]=util['format'](_0xfb90('0x5c'),_0x27d689[_0xfb90('0x44')],_0x4d9fae[_0xfb90('0x4b')],md5(_0x4d9fae[_0xfb90('0x4b')]));}return getConnection(_0x27d689)[_0xfb90('0x13')](function(_0x541815){_0x18849e=_0x541815;return getUser(_0x27d689,_0xb5a41d['email'],_0x18849e);})[_0xfb90('0x13')](function(_0x381383){_0x4c678e=_0x381383;return getEndUser(_0x27d689,_0x21df15,_0x4d9fae['destcalleridname'],_0x4d9fae['destcalleridnum'],_0x18849e);})[_0xfb90('0x13')](function(_0x2369bc){_0x2acb3e=_0x2369bc;return getTicket(_0x27d689,_0x4c678e,_0x2acb3e,_0x21df15,_0x4d9fae,_0x21df15['Fields'],_0x18849e,_0xfb90('0x59'));})[_0xfb90('0x13')](function(_0x211e24){_0xa6c574=_0x211e24;logger[_0xfb90('0x17')](_0xfb90('0x5d'),_0xa6c574['id']);logger[_0xfb90('0x17')](_0xfb90('0x5e'),_0xa6c574['id'],_0xb5a41d[_0xfb90('0x36')],_0x27d689[_0xfb90('0x2f')]);switch(_0x27d689[_0xfb90('0x2f')]){case _0xfb90('0x51'):emit(util['format']('user:%s',_0xb5a41d[_0xfb90('0x36')]),'trigger:salesforce:display',{'recordId':_0xa6c574['id']});break;case _0xfb90('0x5f'):emit(util[_0xfb90('0x4a')](_0xfb90('0x52'),_0xb5a41d['name']),_0xfb90('0x54'),{'uri':util[_0xfb90('0x4a')]('%s/%s/e',_0x18849e['instanceUrl'],_0xa6c574['id'])});break;default:logger['error'](_0xfb90('0x5b'),_0xfb90('0x60'));}})[_0xfb90('0x58')](function(_0x29b32d){logger['error'](_0xfb90('0x5b'),JSON[_0xfb90('0x61')](_0x29b32d));});};exports[_0xfb90('0x62')]=function(_0x1c88cf,_0x1a07cb,_0x56b6bc,_0x5b4acd,_0x4bf48a,_0x1a9f6e){var _0x14b338,_0x1c4695,_0x42e261,_0x3475af;_0x1a9f6e[_0xfb90('0x44')]=intUtil[_0xfb90('0x45')](_0x1a9f6e[_0xfb90('0x44')]);_0x1a9f6e[_0xfb90('0x3d')]=intUtil[_0xfb90('0x45')](_0x1a9f6e[_0xfb90('0x3d')]);if(_0x4bf48a&&_0x4bf48a[_0xfb90('0x46')]){logger['info'](_0xfb90('0x63'),_0xfb90('0x48'));_0x1a07cb[_0xfb90('0x49')]=util[_0xfb90('0x4a')](_0xfb90('0x5c'),_0x1a9f6e[_0xfb90('0x44')],_0x1a07cb['uniqueid'],md5(_0x1a07cb[_0xfb90('0x4b')]));}else{_0x1a07cb[_0xfb90('0x49')]='';}return getConnection(_0x1a9f6e)[_0xfb90('0x13')](function(_0xe094da){_0x3475af=_0xe094da;if(!_[_0xfb90('0x11')](_0x5b4acd)){return getUser(_0x1a9f6e,_0x5b4acd['name'],_0x3475af);}else{return getUser(_0x1a9f6e,null,_0x3475af);}})[_0xfb90('0x13')](function(_0x33f284){_0x14b338=_0x33f284;return getEndUser(_0x1a9f6e,_0x56b6bc,_0x1a07cb['calleridname'],_0x1a07cb[_0xfb90('0x4d')],_0x3475af);})[_0xfb90('0x13')](function(_0x1dfb07){_0x1c4695=_0x1dfb07;return getTicket(_0x1a9f6e,_0x14b338,_0x1c4695,_0x56b6bc,_0x1a07cb,_0x56b6bc['Fields'],_0x3475af);})[_0xfb90('0x13')](function(_0x5efe0a){_0x42e261=_0x5efe0a;logger[_0xfb90('0x17')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x42e261['id']);logger[_0xfb90('0x17')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x1a9f6e['type']);})[_0xfb90('0x58')](function(_0x3614ee){logger[_0xfb90('0x56')](_0xfb90('0x63'),JSON['stringify'](_0x3614ee));});}; \ No newline at end of file +var _0x7e09=['https://login.salesforce.com','clientId','clientSecret','login','username','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','instanceUrl','error','stringify','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','catch','[ABANDONED]','calleridnum','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','ticketType','Task','assign','utc','getString','Subjects','Descriptions','Case','sobject','isNil','validateEmail','User','find','execute','then','Email','info','Agent\x20%s\x20found.','resolve','Name','identity','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','moduleSearch','contact_lead','Contact','length','contact','lead','Lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','forEach','type','string','idField','toString','variableName','name','Variable','toLowerCase','concat','Connection','remoteUri'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7e09,0xf2));var _0x97e0=function(_0x1b61e0,_0x1cbd04){_0x1b61e0=_0x1b61e0-0x0;var _0x7945e0=_0x7e09[_0x1b61e0];return _0x7945e0;};'use strict';var _=require('lodash');var rp=require(_0x97e0('0x0'));var moment=require(_0x97e0('0x1'));var BPromise=require(_0x97e0('0x2'));var md5=require(_0x97e0('0x3'));var jsforce=require(_0x97e0('0x4'));var util=require('util');var Redis=require(_0x97e0('0x5'));var intUtil=require(_0x97e0('0x6'));var config=require('../../../../config/environment');var logger=require(_0x97e0('0x7'))('salesforce');config[_0x97e0('0x8')]=_['defaults'](config['redis'],{'host':_0x97e0('0x9'),'port':0x18eb});var io=require(_0x97e0('0xa'))(new Redis(config[_0x97e0('0x8')]));function emit(_0x56a32e,_0x176b64,_0x324b76){io['to'](_0x56a32e)['emit'](_0x176b64,_0x324b76);}function getTicket(_0x4b402c,_0x4be569,_0x1aedc6,_0x2fdea7,_0x5cb27a,_0x5ebad6,_0x44f437,_0x21af91){var _0x219f6e={};if(_0x2fdea7[_0x97e0('0xb')]===_0x97e0('0xc')){_0x219f6e=Object[_0x97e0('0xd')]({},{'OwnerId':_0x4be569['id'],'ActivityDate':moment[_0x97e0('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x97e0('0xf')](_0x2fdea7[_0x97e0('0x10')],_0x5cb27a,'\x20'),'Description':intUtil[_0x97e0('0xf')](_0x2fdea7[_0x97e0('0x11')],_0x5cb27a,'\x0a')},getCustomFields(_0x5ebad6,_0x5cb27a));if(_0x1aedc6){_0x219f6e['WhoId']=_0x1aedc6['id'];}}else if(_0x2fdea7[_0x97e0('0xb')]===_0x97e0('0x12')){_0x219f6e=Object[_0x97e0('0xd')]({},{'OwnerId':_0x4be569['id'],'Subject':intUtil[_0x97e0('0xf')](_0x2fdea7[_0x97e0('0x10')],_0x5cb27a,'\x20'),'Description':intUtil[_0x97e0('0xf')](_0x2fdea7[_0x97e0('0x11')],_0x5cb27a,'\x0a')},getCustomFields(_0x5ebad6,_0x5cb27a));if(_0x1aedc6){_0x219f6e['ContactId']=_0x1aedc6['id'];}}return _0x44f437[_0x97e0('0x13')](_0x2fdea7[_0x97e0('0xb')])['create'](_0x219f6e);}function getUser(_0x7fd5bf,_0x56c867,_0x59a1a1){if(!_[_0x97e0('0x14')](_0x56c867)&&intUtil[_0x97e0('0x15')](_0x56c867)){var _0x56923d={'Email':_0x56c867};var _0x534355={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x59a1a1['sobject'](_0x97e0('0x16'))[_0x97e0('0x17')](_0x56923d,_0x534355)[_0x97e0('0x18')]()[_0x97e0('0x19')](function(_0x15493d){if(_0x15493d['length']){var _0x5329a1=_[_0x97e0('0x17')](_0x15493d,function(_0x5a45ac){return _0x5a45ac[_0x97e0('0x1a')]===_0x56c867;});if(_0x5329a1){logger[_0x97e0('0x1b')](_0x97e0('0x1c'),_0x56c867);return BPromise[_0x97e0('0x1d')]({'id':_0x5329a1['Id'],'name':_0x5329a1[_0x97e0('0x1e')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x56c867);return _0x59a1a1[_0x97e0('0x1f')]()[_0x97e0('0x19')](function(_0x4096f5){return BPromise[_0x97e0('0x1d')]({'id':_0x4096f5['user_id'],'name':_0x4096f5['display_name']});});}});}else{logger[_0x97e0('0x1b')](_0x97e0('0x20'),_0x56c867);return _0x59a1a1[_0x97e0('0x1f')]()[_0x97e0('0x19')](function(_0x5b46f8){return BPromise['resolve']({'id':_0x5b46f8[_0x97e0('0x21')],'name':_0x5b46f8[_0x97e0('0x22')]});});}}function getEndUser(_0x240445,_0x29d8e2,_0x383414,_0x3fd8cd,_0x512369){var _0x3784bc={'Phone':_0x3fd8cd};var _0x2a69ce={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x97e0('0x19')](function(){if(_0x29d8e2[_0x97e0('0xb')]==='Task'){logger[_0x97e0('0x1b')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x3fd8cd,_0x29d8e2[_0x97e0('0x23')]);switch(_0x29d8e2[_0x97e0('0x23')]){case _0x97e0('0x24'):return _0x512369[_0x97e0('0x13')](_0x97e0('0x25'))['find'](_0x3784bc,_0x2a69ce)[_0x97e0('0x18')]()['then'](function(_0x3a8c24){if(_0x3a8c24&&_0x3a8c24[_0x97e0('0x26')]){return _0x3a8c24;}else{return _0x512369['sobject']('Lead')[_0x97e0('0x17')](_0x3784bc,_0x2a69ce);}});case _0x97e0('0x27'):return _0x512369[_0x97e0('0x13')](_0x97e0('0x25'))[_0x97e0('0x17')](_0x3784bc,_0x2a69ce)[_0x97e0('0x18')]();case _0x97e0('0x28'):return _0x512369[_0x97e0('0x13')](_0x97e0('0x29'))[_0x97e0('0x17')](_0x3784bc,_0x2a69ce);default:return null;}}else if(_0x29d8e2['ticketType']==='Case'){logger[_0x97e0('0x1b')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x3fd8cd,'contact');return _0x512369[_0x97e0('0x13')]('Contact')['find'](_0x3784bc,_0x2a69ce)[_0x97e0('0x18')]();}})['then'](function(_0x415fb2){if(_0x415fb2&&_0x415fb2['length']){var _0x5990ec=_[_0x97e0('0x17')](_0x415fb2,function(_0x8fcee4){return _0x8fcee4[_0x97e0('0x2a')]===_0x3fd8cd;});if(_0x5990ec){return BPromise['resolve']({'id':_0x5990ec['Id'],'name':_0x5990ec['Name'],'phone':_0x5990ec[_0x97e0('0x2a')]});}}})['then'](function(_0xf9eaae){if(_0xf9eaae){logger['info'](_0x97e0('0x2b'),_0x3fd8cd);return BPromise['resolve'](_0xf9eaae);}else{logger[_0x97e0('0x1b')](_0x97e0('0x2c'),_0x3fd8cd);var _0x1801d3={'LastName':_0x383414!==_0x97e0('0x2d')?_0x383414:util[_0x97e0('0x2e')](_0x97e0('0x2f'),_0x3fd8cd),'Phone':_0x3fd8cd};if(_0x29d8e2[_0x97e0('0x30')]){if(_0x29d8e2[_0x97e0('0x30')]===_0x97e0('0x27')){logger[_0x97e0('0x1b')](_0x97e0('0x31'),_0x3fd8cd,_0x29d8e2[_0x97e0('0x30')]);}else if(_0x29d8e2[_0x97e0('0x30')]===_0x97e0('0x28')&&_0x29d8e2['ticketType']===_0x97e0('0xc')){logger['info'](_0x97e0('0x31'),_0x3fd8cd,_0x29d8e2['moduleCreate']);_0x1801d3[_0x97e0('0x32')]=_0x97e0('0x33');}else{return null;}}return _0x512369[_0x97e0('0x13')](_['upperFirst'](_0x29d8e2[_0x97e0('0x30')]))['create'](_0x1801d3);}});}function getCustomFields(_0x2174f3,_0x164601){var _0x29c7a1={};if(_0x2174f3[_0x97e0('0x26')]>0x0){_[_0x97e0('0x34')](_0x2174f3,function(_0x58bf2b){if(_0x58bf2b[_0x97e0('0x35')]===_0x97e0('0x36')&&_0x58bf2b['idField']){_0x29c7a1[_0x58bf2b[_0x97e0('0x37')]]=_0x58bf2b['content'][_0x97e0('0x38')]();}else if(_0x58bf2b[_0x97e0('0x35')]==='variable'&&_0x58bf2b[_0x97e0('0x39')]&&_0x58bf2b[_0x97e0('0x37')]){_0x164601[_0x58bf2b[_0x97e0('0x39')]]&&(_0x29c7a1[_0x58bf2b[_0x97e0('0x37')]]=_0x164601[_0x58bf2b[_0x97e0('0x39')]][_0x97e0('0x38')]());}else if(_0x58bf2b[_0x97e0('0x35')]==='customVariable'&&_0x58bf2b['Variable']&&_0x58bf2b['Variable'][_0x97e0('0x3a')]&&_0x58bf2b[_0x97e0('0x37')]){_0x164601[_0x58bf2b[_0x97e0('0x3b')][_0x97e0('0x3a')][_0x97e0('0x3c')]()]&&(_0x29c7a1[_0x58bf2b[_0x97e0('0x37')]]=_0x164601[_0x58bf2b['Variable'][_0x97e0('0x3a')][_0x97e0('0x3c')]()]['toString']());}});}return _0x29c7a1;}function getConnection(_0x46c2f8){var _0x44a0a5=_0x46c2f8['password'][_0x97e0('0x3d')](_0x46c2f8['securityToken']);var _0x347d71=new jsforce[(_0x97e0('0x3e'))]({'oauth2':{'loginUrl':_0x46c2f8[_0x97e0('0x3f')]||_0x97e0('0x40'),'clientId':_0x46c2f8[_0x97e0('0x41')],'clientSecret':_0x46c2f8[_0x97e0('0x42')]}});return _0x347d71[_0x97e0('0x43')](_0x46c2f8[_0x97e0('0x44')],_0x44a0a5)[_0x97e0('0x19')](function(){logger['info']('Connection\x20established.');return _0x347d71;});}exports['queue']=function(_0x3be8a7,_0xdf6518,_0x438d17,_0x34ec9d,_0x33e8b3,_0x4fc34d){var _0x49ec14,_0x2dfd28,_0x20b7d8,_0xc7cf75;_0x4fc34d[_0x97e0('0x45')]=intUtil[_0x97e0('0x46')](_0x4fc34d[_0x97e0('0x45')]);_0x4fc34d[_0x97e0('0x3f')]=intUtil[_0x97e0('0x46')](_0x4fc34d[_0x97e0('0x3f')]);if(_0x33e8b3&&_0x33e8b3[_0x97e0('0x47')]){logger['info'](_0x97e0('0x48'),'Recording\x20is\x20enabled!');_0xdf6518[_0x97e0('0x49')]=util[_0x97e0('0x2e')](_0x97e0('0x4a'),_0x4fc34d['serverUrl'],_0xdf6518['uniqueid'],md5(_0xdf6518[_0x97e0('0x4b')]));}else{_0xdf6518[_0x97e0('0x49')]='';}return getConnection(_0x4fc34d)[_0x97e0('0x19')](function(_0x42e55c){_0xc7cf75=_0x42e55c;return getUser(_0x4fc34d,_0x34ec9d['email'],_0xc7cf75);})[_0x97e0('0x19')](function(_0xfd6519){_0x49ec14=_0xfd6519;return getEndUser(_0x4fc34d,_0x438d17,_0xdf6518[_0x97e0('0x4c')],_0xdf6518['calleridnum'],_0xc7cf75);})[_0x97e0('0x19')](function(_0x3f7a92){_0x2dfd28=_0x3f7a92;return getTicket(_0x4fc34d,_0x49ec14,_0x2dfd28,_0x438d17,_0xdf6518,_0x438d17['Fields'],_0xc7cf75,'queue');})['then'](function(_0x2c7975){_0x20b7d8=_0x2c7975;logger[_0x97e0('0x1b')](_0x97e0('0x4d'),_0x20b7d8['id']);logger[_0x97e0('0x1b')](_0x97e0('0x4e'),_0x20b7d8['id'],_0x34ec9d[_0x97e0('0x3a')],_0x4fc34d['type']);switch(_0x4fc34d[_0x97e0('0x35')]){case _0x97e0('0x4f'):emit(util[_0x97e0('0x2e')](_0x97e0('0x50'),_0x34ec9d[_0x97e0('0x3a')]),'trigger:salesforce:display',{'recordId':_0x20b7d8['id']});break;case _0x97e0('0x51'):emit(util[_0x97e0('0x2e')]('user:%s',_0x34ec9d['name']),_0x97e0('0x52'),{'uri':util[_0x97e0('0x2e')]('%s/%s/e',_0xc7cf75[_0x97e0('0x53')],_0x20b7d8['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x53b70b){logger[_0x97e0('0x54')]('[QUEUE]',JSON[_0x97e0('0x55')](_0x53b70b));});};exports[_0x97e0('0x56')]=function(_0x4b32e4,_0xea5868,_0x35a812,_0x37f64f,_0x38ea44,_0x10c45c,_0x1bb76d){var _0x5934a3,_0x5cb77b,_0x48024d,_0x28f14b;_0x10c45c[_0x97e0('0x45')]=intUtil['stripTrailingSlash'](_0x10c45c[_0x97e0('0x45')]);_0x10c45c['remoteUri']=intUtil[_0x97e0('0x46')](_0x10c45c[_0x97e0('0x3f')]);if(_0x1bb76d&&_0x1bb76d['recordingFormat']&&_0x1bb76d['recordingFormat']!==_0x97e0('0x57')){logger['info'](_0x97e0('0x58'),_0x97e0('0x59'));_0xea5868[_0x97e0('0x49')]=util['format'](_0x97e0('0x4a'),_0x10c45c[_0x97e0('0x45')],_0xea5868[_0x97e0('0x4b')],md5(_0xea5868[_0x97e0('0x4b')]));}return getConnection(_0x10c45c)[_0x97e0('0x19')](function(_0x490dc9){_0x28f14b=_0x490dc9;return getUser(_0x10c45c,_0x37f64f['email'],_0x28f14b);})[_0x97e0('0x19')](function(_0x31e81a){_0x5934a3=_0x31e81a;return getEndUser(_0x10c45c,_0x35a812,_0xea5868[_0x97e0('0x5a')],_0xea5868[_0x97e0('0x5b')],_0x28f14b);})[_0x97e0('0x19')](function(_0x1ddfcb){_0x5cb77b=_0x1ddfcb;return getTicket(_0x10c45c,_0x5934a3,_0x5cb77b,_0x35a812,_0xea5868,_0x35a812[_0x97e0('0x5c')],_0x28f14b,'outbound');})['then'](function(_0x3917e5){_0x48024d=_0x3917e5;logger[_0x97e0('0x1b')](_0x97e0('0x5d'),_0x48024d['id']);logger['info'](_0x97e0('0x5e'),_0x48024d['id'],_0x37f64f[_0x97e0('0x3a')],_0x10c45c['type']);switch(_0x10c45c['type']){case _0x97e0('0x4f'):emit(util[_0x97e0('0x2e')](_0x97e0('0x50'),_0x37f64f[_0x97e0('0x3a')]),_0x97e0('0x5f'),{'recordId':_0x48024d['id']});break;case'newTab':emit(util['format']('user:%s',_0x37f64f[_0x97e0('0x3a')]),'trigger:browser:url',{'uri':util[_0x97e0('0x2e')](_0x97e0('0x60'),_0x28f14b[_0x97e0('0x53')],_0x48024d['id'])});break;default:logger[_0x97e0('0x54')](_0x97e0('0x58'),_0x97e0('0x61'));}})[_0x97e0('0x62')](function(_0x95045c){logger['error']('[OUTBOUND]',JSON['stringify'](_0x95045c));});};exports['abandoned']=function(_0x53c23a,_0x1ed0a2,_0x1ef823,_0x4db948,_0x407b90,_0x55d153){var _0x5f4499,_0x38793a,_0xed64a3,_0x480131;_0x55d153[_0x97e0('0x45')]=intUtil[_0x97e0('0x46')](_0x55d153['serverUrl']);_0x55d153[_0x97e0('0x3f')]=intUtil['stripTrailingSlash'](_0x55d153[_0x97e0('0x3f')]);if(_0x407b90&&_0x407b90[_0x97e0('0x47')]){logger[_0x97e0('0x1b')](_0x97e0('0x63'),_0x97e0('0x59'));_0x1ed0a2[_0x97e0('0x49')]=util[_0x97e0('0x2e')](_0x97e0('0x4a'),_0x55d153[_0x97e0('0x45')],_0x1ed0a2[_0x97e0('0x4b')],md5(_0x1ed0a2[_0x97e0('0x4b')]));}else{_0x1ed0a2[_0x97e0('0x49')]='';}return getConnection(_0x55d153)['then'](function(_0x413338){_0x480131=_0x413338;if(!_['isNil'](_0x4db948)){return getUser(_0x55d153,_0x4db948[_0x97e0('0x3a')],_0x480131);}else{return getUser(_0x55d153,null,_0x480131);}})[_0x97e0('0x19')](function(_0x47dce7){_0x5f4499=_0x47dce7;return getEndUser(_0x55d153,_0x1ef823,_0x1ed0a2[_0x97e0('0x4c')],_0x1ed0a2[_0x97e0('0x64')],_0x480131);})[_0x97e0('0x19')](function(_0x2da545){_0x38793a=_0x2da545;return getTicket(_0x55d153,_0x5f4499,_0x38793a,_0x1ef823,_0x1ed0a2,_0x1ef823[_0x97e0('0x5c')],_0x480131);})['then'](function(_0x117a47){_0xed64a3=_0x117a47;logger[_0x97e0('0x1b')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0xed64a3['id']);logger[_0x97e0('0x1b')](_0x97e0('0x65'),_0x55d153[_0x97e0('0x35')]);})[_0x97e0('0x62')](function(_0x31dc8c){logger[_0x97e0('0x54')](_0x97e0('0x63'),JSON[_0x97e0('0x55')](_0x31dc8c));});}; \ 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 3ed599d..0d30d0a 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index d2e61fc..ccccbed 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 _0x369c=['slice','replace','duration_hours','duration_minutes','Contacts','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','toString','custom_fields','idField','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','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...','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','contacts','user:%s','monitor_format','[ABANDONED]','isNil','Fields','users','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','description','Descriptions'];(function(_0x5271f6,_0x4b6649){var _0x4ec935=function(_0x251db4){while(--_0x251db4){_0x5271f6['push'](_0x5271f6['shift']());}};_0x4ec935(++_0x4b6649);}(_0x369c,0xdb));var _0xc369=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x369c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0xc369('0x0'));var BPromise=require(_0xc369('0x1'));var md5=require(_0xc369('0x2'));var util=require(_0xc369('0x3'));var Redis=require(_0xc369('0x4'));var intUtil=require(_0xc369('0x5'));var config=require(_0xc369('0x6'));var logger=require(_0xc369('0x7'))(_0xc369('0x8'));config[_0xc369('0x9')]=_[_0xc369('0xa')](config[_0xc369('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xc369('0xb'))(new Redis(config['redis']));var def={'method':_0xc369('0xc'),'json':!![]};function emit(_0x4dbd8c,_0x333c1a,_0x4534b0){io['to'](_0x4dbd8c)[_0xc369('0xd')](_0x333c1a,_0x4534b0);}function getTicket(_0x41d5db,_0x188e53,_0x344c98,_0xf1f9da,_0x3f5e17,_0x22cd6b,_0x182bf9,_0x21dcf6){logger[_0xc369('0xe')](_0xc369('0xf'));var _0x1cd70c=new Date();var _0x5a5181=[{'name':_0xc369('0x10'),'value':intUtil[_0xc369('0x11')](_0xf1f9da[_0xc369('0x12')],_0x3f5e17,'\x20')},{'name':'assigned_user_id','value':_0x188e53['id']},{'name':'created_by','value':_0x188e53['id']},{'name':_0xc369('0x13'),'value':intUtil[_0xc369('0x11')](_0xf1f9da[_0xc369('0x14')],_0x3f5e17,'\x0a')},{'name':'date_start','value':_0x1cd70c['toISOString']()[_0xc369('0x15')](0x0,0x13)[_0xc369('0x16')]('T','\x20')},{'name':_0xc369('0x17'),'value':'0'},{'name':_0xc369('0x18'),'value':'15'},{'name':'parent_id','value':_0x344c98['id']},{'name':'parent_type','value':_0xc369('0x19')},{'name':'parent_name','value':_0x344c98[_0xc369('0x10')]},{'name':_0xc369('0x1a'),'value':_0x21dcf6}];if(_0x22cd6b[_0xc369('0x1b')]){_[_0xc369('0x1c')](_0x22cd6b,function(_0x14803b){if(_0x3f5e17[_0x14803b[_0xc369('0x1d')]]){_0x5a5181[_0xc369('0x1e')]({'name':_0x14803b['idField'],'value':_0x3f5e17[_0x14803b[_0xc369('0x1d')]]});}});}return request({'form':{'method':_0xc369('0x1f'),'input_type':_0xc369('0x20'),'response_type':_0xc369('0x20'),'rest_data':JSON[_0xc369('0x21')]({'session':_0x182bf9['id'],'module_name':_0xc369('0x22'),'name_value_list':_0x5a5181})}});}function getAuth(_0x1a28f3){return util[_0xc369('0x23')](_0xc369('0x24'),new Buffer(_0x1a28f3[_0xc369('0x25')]+':X')['toString'](_0xc369('0x26')));}function getServerInfo(_0x69fb96){return request({'form':{'method':_0xc369('0x27'),'input_type':'JSON','response_type':_0xc369('0x20'),'rest_data':JSON[_0xc369('0x21')]({'session':_0x69fb96['id']})}});}function getUser(_0x20d36d,_0x21feac,_0x1e7ad2){if(!_['isNil'](_0x21feac)){logger['info'](_0xc369('0x28'),_0x21feac);return request({'form':{'method':_0xc369('0x29'),'input_type':'JSON','response_type':_0xc369('0x20'),'rest_data':JSON[_0xc369('0x21')]({'session':_0x1e7ad2['id'],'module_name':_0xc369('0x2a'),'query':util[_0xc369('0x23')](_0xc369('0x2b'),_0x21feac),'order_by':'','offset':'0','select_fields':['id',_0xc369('0x10'),_0xc369('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc369('0x2d')](function(_0x21a368){if(_0x21a368[_0xc369('0x2e')][_0xc369('0x1b')]){var _0x281b33=_[_0xc369('0x2f')](_0x21a368[_0xc369('0x2e')],function(_0xe9324d){return _0xe9324d['name_value_list'][_0xc369('0x2c')][_0xc369('0x30')]===_0x21feac;});if(_0x281b33){logger['info'](_0xc369('0x31'));return BPromise[_0xc369('0x32')]({'id':_0x281b33[_0xc369('0x33')]['id'][_0xc369('0x30')],'name':_0x281b33['name_value_list'][_0xc369('0x10')][_0xc369('0x30')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc369('0x32')]({'id':_0x1e7ad2['name_value_list'][_0xc369('0x34')]['value'],'name':_0x1e7ad2['name_value_list'][_0xc369('0x2c')]['value']});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc369('0x32')]({'id':_0x1e7ad2[_0xc369('0x33')]['user_id']['value'],'name':_0x1e7ad2[_0xc369('0x33')][_0xc369('0x2c')][_0xc369('0x30')]});}}function getEndUser(_0x37016e,_0x1fd486,_0x279c5d,_0x44687e){logger[_0xc369('0xe')](_0xc369('0x35'),_0x279c5d);return request({'form':{'method':_0xc369('0x29'),'input_type':_0xc369('0x20'),'response_type':_0xc369('0x20'),'rest_data':JSON['stringify']({'session':_0x44687e['id'],'module_name':_0xc369('0x19'),'query':util[_0xc369('0x23')](_0xc369('0x36'),_0x279c5d),'order_by':'','offset':'0','select_fields':['id',_0xc369('0x10'),_0xc369('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3ce690){if(_0x3ce690[_0xc369('0x2e')][_0xc369('0x1b')]){var _0x2ced6b=_['find'](_0x3ce690[_0xc369('0x2e')],function(_0x1ce551){return _0x1ce551[_0xc369('0x33')][_0xc369('0x37')][_0xc369('0x30')]===_0x279c5d;});if(_0x2ced6b){logger[_0xc369('0xe')](_0xc369('0x38'));return BPromise[_0xc369('0x32')]({'id':_0x2ced6b['name_value_list']['id'][_0xc369('0x30')],'name':_0x2ced6b['name_value_list']['name']['value'],'phone':_0x2ced6b[_0xc369('0x33')][_0xc369('0x37')]['value']});}}else{logger[_0xc369('0xe')](_0xc369('0x39'));return request({'form':{'method':'set_entry','input_type':_0xc369('0x20'),'response_type':_0xc369('0x20'),'rest_data':JSON[_0xc369('0x21')]({'session':_0x44687e['id'],'module_name':'Contacts','name_value_list':[{'name':_0xc369('0x3a'),'value':_0x1fd486!==''?_0x1fd486:util[_0xc369('0x23')](_0xc369('0x3b'),_0x279c5d)},{'name':_0xc369('0x37'),'value':_0x279c5d}]})}})[_0xc369('0x2d')](function(_0x29576c){logger[_0xc369('0xe')]('Enduser\x20created.');return BPromise[_0xc369('0x32')]({'id':_0x29576c['id'],'name':_0x29576c['entry_list'][_0xc369('0x3a')]['value'],'phone':_0x29576c[_0xc369('0x2e')][_0xc369('0x37')][_0xc369('0x30')]});});}});}function request(_0x4d9d8d){logger[_0xc369('0x3c')](_0xc369('0x3d'),JSON[_0xc369('0x21')](_0x4d9d8d));return rp(_[_0xc369('0x3e')](def,_0x4d9d8d));}function getTags(_0x252cfa,_0x106ac8){var _0x184d20=[];if(_0x252cfa&&_0x252cfa['length']>0x0){_0x184d20=_[_0xc369('0x3f')](_0x252cfa,_0x106ac8);}return _0x184d20;}function getCustomFields(_0x124ba2,_0x31dab8){var _0x1fd3e8=[];var _0x565a2e={'custom_fields':[]};if(_0x124ba2['length']>0x0){_[_0xc369('0x1c')](_0x124ba2,function(_0x5dc7a7){if(_0x5dc7a7[_0xc369('0x40')]===_0xc369('0x41')&&_0x5dc7a7[_0xc369('0x42')]&&!_0x5dc7a7[_0xc369('0x43')]){_0x565a2e[_0x5dc7a7[_0xc369('0x42')][_0xc369('0x44')]()]=_0x5dc7a7[_0xc369('0x45')][_0xc369('0x46')]();}else if(_0x5dc7a7['type']===_0xc369('0x41')&&_0x5dc7a7['idField']&&_0x5dc7a7[_0xc369('0x43')]){_0x565a2e[_0xc369('0x47')]['push']({'id':_0x5dc7a7[_0xc369('0x48')],'value':_0x5dc7a7['content']['toString']()});}else if(_0x5dc7a7[_0xc369('0x40')]==='variable'&&_0x5dc7a7[_0xc369('0x1d')]&&_0x5dc7a7['idField']&&_0x5dc7a7[_0xc369('0x43')]){_0x31dab8[_0x5dc7a7[_0xc369('0x1d')]]&&_0x565a2e['custom_fields'][_0xc369('0x1e')]({'id':_0x5dc7a7[_0xc369('0x48')],'value':_0x31dab8[_0x5dc7a7[_0xc369('0x1d')]][_0xc369('0x46')]()});}else if(_0x5dc7a7['type']===_0xc369('0x49')&&_0x5dc7a7[_0xc369('0x4a')]&&_0x5dc7a7[_0xc369('0x4a')][_0xc369('0x10')]&&_0x5dc7a7[_0xc369('0x48')]&&_0x5dc7a7[_0xc369('0x43')]){_0x31dab8[_0x5dc7a7[_0xc369('0x4a')][_0xc369('0x10')][_0xc369('0x44')]()]&&_0x565a2e[_0xc369('0x47')]['push']({'id':_0x5dc7a7[_0xc369('0x48')],'value':_0x31dab8[_0x5dc7a7[_0xc369('0x4a')]['name']['toLowerCase']()][_0xc369('0x46')]()});}});}return _0x565a2e;}function getConnection(_0x46c4dc){return request({'method':'POST','form':{'method':'login','input_type':_0xc369('0x20'),'response_type':_0xc369('0x20'),'rest_data':JSON[_0xc369('0x21')]({'user_auth':{'user_name':_0x46c4dc[_0xc369('0x4b')],'password':_0x46c4dc[_0xc369('0x4c')],'encryption':_0xc369('0x4d')},'application':_0xc369('0x4e')})}})['then'](function(_0x565a5c){var _0x30575d=_0x565a5c;if(_0x30575d['id']){def['sessionID']=_0x30575d['id'];return BPromise[_0xc369('0x32')](_0x30575d);}else{throw new Error(util[_0xc369('0x23')](_0xc369('0x4f'),_0x46c4dc['id']));}});}function setRelationship(_0x310de5,_0xff9882,_0x135806,_0x23373e){return request({'form':{'method':_0xc369('0x50'),'input_type':_0xc369('0x20'),'response_type':_0xc369('0x20'),'rest_data':JSON[_0xc369('0x21')]({'session':_0x310de5['id'],'module_name':_0xc369('0x22'),'module_id':_0x135806['id'],'link_field_name':_0x23373e,'related_ids':[_0xff9882['id']]})}});}exports['queue']=function(_0x35d5bd,_0x3fc45a,_0x544e58,_0x2b1e54,_0x342dc1,_0x321633){var _0x3462ba,_0x504ccb,_0x2956b0,_0x205864;_0x321633['remoteUri']=intUtil['stripTrailingSlash'](_0x321633[_0xc369('0x51')]);_0x321633['serverUrl']=intUtil[_0xc369('0x52')](_0x321633[_0xc369('0x53')]);def['uri']=util[_0xc369('0x23')](_0xc369('0x54'),_0x321633['remoteUri']);if(_0x342dc1&&_0x342dc1['monitor_format']){logger[_0xc369('0xe')](_0xc369('0x55'),_0xc369('0x56'));_0x3fc45a[_0xc369('0x57')]=util['format'](_0xc369('0x58'),_0x321633[_0xc369('0x53')],_0x3fc45a[_0xc369('0x59')],md5(_0x3fc45a[_0xc369('0x59')]));}else{_0x3fc45a[_0xc369('0x57')]='';}return getConnection(_0x321633)[_0xc369('0x2d')](function(_0x24dbd2){_0x205864=_0x24dbd2;return getUser(_0x321633,_0x2b1e54[_0xc369('0x10')],_0x205864);})[_0xc369('0x2d')](function(_0x21ee6a){_0x3462ba=_0x21ee6a;logger[_0xc369('0xe')](_0xc369('0x5a'),_0x3462ba['id']);return getEndUser(_0x321633,_0x3fc45a[_0xc369('0x5b')],_0x3fc45a[_0xc369('0x5c')],_0x205864);})[_0xc369('0x2d')](function(_0x2c7838){_0x504ccb=_0x2c7838;logger['info'](_0xc369('0x5d'),_0x504ccb['id']);return getTicket(_0x321633,_0x3462ba,_0x504ccb,_0x544e58,_0x3fc45a,_0x544e58['Fields'],_0x205864,_0xc369('0x5e'));})[_0xc369('0x2d')](function(_0x2ab482){_0x2956b0=_0x2ab482;logger[_0xc369('0xe')](_0xc369('0x5f'));logger[_0xc369('0xe')]('The\x20Ticket\x20ID\x20is:',_0x2956b0['id']);return setRelationship(_0x205864,_0x3462ba,_0x2956b0,'users');})[_0xc369('0x2d')](function(){return setRelationship(_0x205864,_0x504ccb,_0x2956b0,'contacts');})[_0xc369('0x2d')](function(){return getServerInfo(_0x205864);})[_0xc369('0x2d')](function(_0x3be7e3){var _0x5a31ec=parseInt(_0x3be7e3[_0xc369('0x60')][_0xc369('0x61')](0x0));var _0x2e9272=util[_0xc369('0x23')](_0xc369('0x62'),_0x321633[_0xc369('0x51')],_0x2956b0['id']);if(_0x5a31ec>0x6){_0x2e9272=util[_0xc369('0x23')](_0xc369('0x63'),_0x321633[_0xc369('0x51')],_0x2956b0['id']);}logger[_0xc369('0xe')](_0xc369('0x55'),_0xc369('0x64'));emit(util[_0xc369('0x23')]('user:%s',_0x2b1e54['name']),_0xc369('0x65'),{'uri':_0x2e9272});})[_0xc369('0x66')](function(_0x2a255e){logger[_0xc369('0x67')](_0xc369('0x55'),JSON[_0xc369('0x21')](_0x2a255e));});};exports[_0xc369('0x68')]=function(_0x373dd0,_0x45812a,_0x29a023,_0x64e734,_0x27d9e0,_0x4a3907,_0xb736c4){var _0x214fa9,_0x228655,_0x40b39e,_0x43c117;_0x4a3907[_0xc369('0x51')]=intUtil[_0xc369('0x52')](_0x4a3907[_0xc369('0x51')]);_0x4a3907[_0xc369('0x53')]=intUtil[_0xc369('0x52')](_0x4a3907[_0xc369('0x53')]);def[_0xc369('0x69')]=util[_0xc369('0x23')](_0xc369('0x54'),_0x4a3907['remoteUri']);if(_0xb736c4&&_0xb736c4[_0xc369('0x6a')]&&_0xb736c4['recordingFormat']!==_0xc369('0x6b')){logger['info'](_0xc369('0x6c'),_0xc369('0x56'));_0x45812a[_0xc369('0x57')]=util[_0xc369('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a3907[_0xc369('0x53')],_0x45812a[_0xc369('0x59')],md5(_0x45812a[_0xc369('0x59')]));}return getConnection(_0x4a3907)[_0xc369('0x2d')](function(_0x117789){_0x43c117=_0x117789;return getUser(_0x4a3907,_0x64e734[_0xc369('0x10')],_0x43c117);})[_0xc369('0x2d')](function(_0x182de2){_0x214fa9=_0x182de2;logger[_0xc369('0xe')](_0xc369('0x5a'),_0x214fa9['id']);return getEndUser(_0x4a3907,_0x45812a[_0xc369('0x6d')],_0x45812a[_0xc369('0x6e')],_0x43c117);})[_0xc369('0x2d')](function(_0x1ce6d4){_0x228655=_0x1ce6d4;logger['info'](_0xc369('0x5d'),_0x228655['id']);return getTicket(_0x4a3907,_0x214fa9,_0x228655,_0x29a023,_0x45812a,_0x29a023['Fields'],_0x43c117,_0xc369('0x6f'));})[_0xc369('0x2d')](function(_0x443b58){_0x40b39e=_0x443b58;logger[_0xc369('0xe')](_0xc369('0x5f'));logger[_0xc369('0xe')](_0xc369('0x70'),_0x40b39e['id']);return setRelationship(_0x43c117,_0x214fa9,_0x40b39e,'users');})[_0xc369('0x2d')](function(){return setRelationship(_0x43c117,_0x228655,_0x40b39e,_0xc369('0x71'));})[_0xc369('0x2d')](function(){return getServerInfo(_0x43c117);})[_0xc369('0x2d')](function(_0x1c7c4c){var _0x22c292=parseInt(_0x1c7c4c[_0xc369('0x60')]['charAt'](0x0));var _0x86f3b7=util[_0xc369('0x23')](_0xc369('0x62'),_0x4a3907[_0xc369('0x51')],_0x40b39e['id']);if(_0x22c292>0x6){_0x86f3b7=util[_0xc369('0x23')](_0xc369('0x63'),_0x4a3907[_0xc369('0x51')],_0x40b39e['id']);}logger['info'](_0xc369('0x6c'),_0xc369('0x64'));emit(util[_0xc369('0x23')](_0xc369('0x72'),_0x64e734['name']),'trigger:browser:url',{'uri':_0x86f3b7});})[_0xc369('0x66')](function(_0x2dd0d1){logger[_0xc369('0x67')](_0xc369('0x6c'),JSON[_0xc369('0x21')](_0x2dd0d1));});};exports['abandoned']=function(_0x5ca19e,_0x2700b8,_0x2e3c54,_0x4f4285,_0x1a463c,_0x31744d){var _0x366e9a,_0x429b1e,_0x28aef0,_0x2b950c;_0x31744d[_0xc369('0x51')]=intUtil[_0xc369('0x52')](_0x31744d[_0xc369('0x51')]);_0x31744d[_0xc369('0x53')]=intUtil[_0xc369('0x52')](_0x31744d[_0xc369('0x53')]);def[_0xc369('0x69')]=util[_0xc369('0x23')]('%s/service/v4_1/rest.php',_0x31744d[_0xc369('0x51')]);if(_0x1a463c&&_0x1a463c[_0xc369('0x73')]){logger['info'](_0xc369('0x74'),_0xc369('0x56'));_0x2700b8['recordingURL']=util[_0xc369('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x31744d['serverUrl'],_0x2700b8[_0xc369('0x59')],md5(_0x2700b8[_0xc369('0x59')]));}else{_0x2700b8[_0xc369('0x57')]='';}return getConnection(_0x31744d)[_0xc369('0x2d')](function(_0x599a3e){_0x2b950c=_0x599a3e;if(!_[_0xc369('0x75')](_0x4f4285)){return getUser(_0x31744d,_0x4f4285[_0xc369('0x10')],_0x2b950c);}else{return getUser(_0x31744d,null,_0x2b950c);}})[_0xc369('0x2d')](function(_0xaa4903){_0x366e9a=_0xaa4903;logger['info'](_0xc369('0x5a'),_0x366e9a['id']);return getEndUser(_0x31744d,_0x2700b8[_0xc369('0x5b')],_0x2700b8[_0xc369('0x5c')],_0x2b950c);})[_0xc369('0x2d')](function(_0x4d4c9e){_0x429b1e=_0x4d4c9e;logger[_0xc369('0xe')](_0xc369('0x5d'),_0x429b1e['id']);return getTicket(_0x31744d,_0x366e9a,_0x429b1e,_0x2e3c54,_0x2700b8,_0x2e3c54[_0xc369('0x76')],_0x2b950c,_0xc369('0x5e'));})['then'](function(_0x3ae09b){_0x28aef0=_0x3ae09b;logger['info'](_0xc369('0x5f'));logger[_0xc369('0xe')](_0xc369('0x70'),_0x28aef0['id']);return setRelationship(_0x2b950c,_0x366e9a,_0x28aef0,_0xc369('0x77'));})[_0xc369('0x2d')](function(){return setRelationship(_0x2b950c,_0x429b1e,_0x28aef0,_0xc369('0x71'));})['then'](function(){return getServerInfo(_0x2b950c);})['catch'](function(_0x538388){logger['error'](_0xc369('0x74'),JSON[_0xc369('0x21')](_0x538388));});}; \ No newline at end of file +var _0x28a4=['[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','custom_fields','content','variable','customVariable','Variable','login','sessionID','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%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','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','charAt','catch','Inbound','[ABANDONED]','lodash','request-promise','bluebird','../../../../config/environment','../../../../config/logger','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','format','Basic\x20%s','apiKey','toString','base64','stringify','isNil','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x28a4,0x124));var _0x428a=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x28a4[_0x37756b];return _0x46efec;};'use strict';var _=require(_0x428a('0x0'));var rp=require(_0x428a('0x1'));var BPromise=require(_0x428a('0x2'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x428a('0x3'));var logger=require(_0x428a('0x4'))('sugarcrm');config[_0x428a('0x5')]=_['defaults'](config[_0x428a('0x5')],{'host':_0x428a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x428a('0x5')]));var def={'method':_0x428a('0x7'),'json':!![]};function emit(_0x51703b,_0x5cc69c,_0x2bdc34){io['to'](_0x51703b)[_0x428a('0x8')](_0x5cc69c,_0x2bdc34);}function getTicket(_0x28a96c,_0xd24c5e,_0x52e4e0,_0x13d986,_0x38ebf3,_0xe1fd59,_0x5a1386,_0x85eec0){logger[_0x428a('0x9')](_0x428a('0xa'));var _0x2e7b2d=new Date();var _0x3eaeee=[{'name':_0x428a('0xb'),'value':intUtil[_0x428a('0xc')](_0x13d986[_0x428a('0xd')],_0x38ebf3,'\x20')},{'name':_0x428a('0xe'),'value':_0xd24c5e['id']},{'name':_0x428a('0xf'),'value':_0xd24c5e['id']},{'name':_0x428a('0x10'),'value':intUtil[_0x428a('0xc')](_0x13d986[_0x428a('0x11')],_0x38ebf3,'\x0a')},{'name':_0x428a('0x12'),'value':_0x2e7b2d[_0x428a('0x13')]()[_0x428a('0x14')](0x0,0x13)[_0x428a('0x15')]('T','\x20')},{'name':_0x428a('0x16'),'value':'0'},{'name':_0x428a('0x17'),'value':'15'},{'name':_0x428a('0x18'),'value':_0x52e4e0['id']},{'name':_0x428a('0x19'),'value':'Contacts'},{'name':_0x428a('0x1a'),'value':_0x52e4e0[_0x428a('0xb')]},{'name':_0x428a('0x1b'),'value':_0x85eec0}];if(_0xe1fd59[_0x428a('0x1c')]){_[_0x428a('0x1d')](_0xe1fd59,function(_0x34e8ca){if(_0x38ebf3[_0x34e8ca[_0x428a('0x1e')]]){_0x3eaeee[_0x428a('0x1f')]({'name':_0x34e8ca[_0x428a('0x20')],'value':_0x38ebf3[_0x34e8ca['variableName']]});}});}return request({'form':{'method':_0x428a('0x21'),'input_type':_0x428a('0x22'),'response_type':_0x428a('0x22'),'rest_data':JSON['stringify']({'session':_0x5a1386['id'],'module_name':'Calls','name_value_list':_0x3eaeee})}});}function getAuth(_0x1bf6a5){return util[_0x428a('0x23')](_0x428a('0x24'),new Buffer(_0x1bf6a5[_0x428a('0x25')]+':X')[_0x428a('0x26')](_0x428a('0x27')));}function getServerInfo(_0x175ac9){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x428a('0x28')]({'session':_0x175ac9['id']})}});}function getUser(_0x2b45a0,_0x3ec922,_0x51b779){if(!_[_0x428a('0x29')](_0x3ec922)){logger[_0x428a('0x9')]('Getting\x20agent\x20with\x20name',_0x3ec922);return request({'form':{'method':_0x428a('0x2a'),'input_type':_0x428a('0x22'),'response_type':_0x428a('0x22'),'rest_data':JSON[_0x428a('0x28')]({'session':_0x51b779['id'],'module_name':'Employees','query':util[_0x428a('0x23')](_0x428a('0x2b'),_0x3ec922),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x428a('0x2c')](function(_0x196994){if(_0x196994[_0x428a('0x2d')][_0x428a('0x1c')]){var _0x343ac1=_[_0x428a('0x2e')](_0x196994['entry_list'],function(_0x3ce526){return _0x3ce526[_0x428a('0x2f')][_0x428a('0x30')][_0x428a('0x31')]===_0x3ec922;});if(_0x343ac1){logger['info'](_0x428a('0x32'));return BPromise[_0x428a('0x33')]({'id':_0x343ac1[_0x428a('0x2f')]['id']['value'],'name':_0x343ac1['name_value_list'][_0x428a('0xb')][_0x428a('0x31')]});}}logger['info'](_0x428a('0x34'));return BPromise['resolve']({'id':_0x51b779[_0x428a('0x2f')][_0x428a('0x35')]['value'],'name':_0x51b779[_0x428a('0x2f')]['user_name'][_0x428a('0x31')]});});}else{logger[_0x428a('0x9')](_0x428a('0x36'));return BPromise[_0x428a('0x33')]({'id':_0x51b779[_0x428a('0x2f')][_0x428a('0x35')][_0x428a('0x31')],'name':_0x51b779[_0x428a('0x2f')][_0x428a('0x30')]['value']});}}function getEndUser(_0x4cbd2b,_0x22a408,_0x4ef714,_0x7ca446){logger[_0x428a('0x9')](_0x428a('0x37'),_0x4ef714);return request({'form':{'method':'get_entry_list','input_type':_0x428a('0x22'),'response_type':_0x428a('0x22'),'rest_data':JSON[_0x428a('0x28')]({'session':_0x7ca446['id'],'module_name':_0x428a('0x38'),'query':util[_0x428a('0x23')](_0x428a('0x39'),_0x4ef714),'order_by':'','offset':'0','select_fields':['id',_0x428a('0xb'),_0x428a('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x428a('0x2c')](function(_0x10d655){if(_0x10d655[_0x428a('0x2d')][_0x428a('0x1c')]){var _0x543266=_['find'](_0x10d655[_0x428a('0x2d')],function(_0x3025c4){return _0x3025c4[_0x428a('0x2f')][_0x428a('0x3a')][_0x428a('0x31')]===_0x4ef714;});if(_0x543266){logger['info']('Enduser\x20found!');return BPromise[_0x428a('0x33')]({'id':_0x543266[_0x428a('0x2f')]['id'][_0x428a('0x31')],'name':_0x543266[_0x428a('0x2f')]['name'][_0x428a('0x31')],'phone':_0x543266[_0x428a('0x2f')][_0x428a('0x3a')][_0x428a('0x31')]});}}else{logger['info'](_0x428a('0x3b'));return request({'form':{'method':'set_entry','input_type':_0x428a('0x22'),'response_type':_0x428a('0x22'),'rest_data':JSON[_0x428a('0x28')]({'session':_0x7ca446['id'],'module_name':_0x428a('0x38'),'name_value_list':[{'name':_0x428a('0x3c'),'value':_0x22a408!==_0x428a('0x3d')?_0x22a408:util['format'](_0x428a('0x3e'),_0x4ef714)},{'name':'phone_home','value':_0x4ef714}]})}})[_0x428a('0x2c')](function(_0xbf4685){logger[_0x428a('0x9')](_0x428a('0x3f'));return BPromise[_0x428a('0x33')]({'id':_0xbf4685['id'],'name':_0xbf4685[_0x428a('0x2d')]['first_name'][_0x428a('0x31')],'phone':_0xbf4685[_0x428a('0x2d')][_0x428a('0x3a')][_0x428a('0x31')]});});}});}function request(_0xbd8114){logger[_0x428a('0x40')](_0x428a('0x41'),JSON[_0x428a('0x28')](_0xbd8114));return rp(_[_0x428a('0x42')](def,_0xbd8114));}function getTags(_0x3de985,_0x7f381d){var _0x403bd1=[];if(_0x3de985&&_0x3de985[_0x428a('0x1c')]>0x0){_0x403bd1=_[_0x428a('0x43')](_0x3de985,_0x7f381d);}return _0x403bd1;}function getCustomFields(_0x4dae5c,_0x5e29ca){var _0x5bb122=[];var _0x55c60f={'custom_fields':[]};if(_0x4dae5c[_0x428a('0x1c')]>0x0){_['forEach'](_0x4dae5c,function(_0x49152e){if(_0x49152e[_0x428a('0x44')]===_0x428a('0x45')&&_0x49152e[_0x428a('0x46')]&&!_0x49152e[_0x428a('0x47')]){_0x55c60f[_0x49152e[_0x428a('0x46')][_0x428a('0x48')]()]=_0x49152e['content'][_0x428a('0x26')]();}else if(_0x49152e[_0x428a('0x44')]===_0x428a('0x45')&&_0x49152e[_0x428a('0x20')]&&_0x49152e[_0x428a('0x47')]){_0x55c60f[_0x428a('0x49')][_0x428a('0x1f')]({'id':_0x49152e['idField'],'value':_0x49152e[_0x428a('0x4a')][_0x428a('0x26')]()});}else if(_0x49152e['type']===_0x428a('0x4b')&&_0x49152e['variableName']&&_0x49152e[_0x428a('0x20')]&&_0x49152e[_0x428a('0x47')]){_0x5e29ca[_0x49152e[_0x428a('0x1e')]]&&_0x55c60f['custom_fields'][_0x428a('0x1f')]({'id':_0x49152e[_0x428a('0x20')],'value':_0x5e29ca[_0x49152e['variableName']]['toString']()});}else if(_0x49152e[_0x428a('0x44')]===_0x428a('0x4c')&&_0x49152e['Variable']&&_0x49152e[_0x428a('0x4d')][_0x428a('0xb')]&&_0x49152e['idField']&&_0x49152e[_0x428a('0x47')]){_0x5e29ca[_0x49152e[_0x428a('0x4d')]['name'][_0x428a('0x48')]()]&&_0x55c60f[_0x428a('0x49')]['push']({'id':_0x49152e[_0x428a('0x20')],'value':_0x5e29ca[_0x49152e['Variable'][_0x428a('0xb')][_0x428a('0x48')]()][_0x428a('0x26')]()});}});}return _0x55c60f;}function getConnection(_0x272706){return request({'method':_0x428a('0x7'),'form':{'method':_0x428a('0x4e'),'input_type':_0x428a('0x22'),'response_type':_0x428a('0x22'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x272706['username'],'password':_0x272706['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x21ae17){var _0x26af3f=_0x21ae17;if(_0x26af3f['id']){def[_0x428a('0x4f')]=_0x26af3f['id'];return BPromise[_0x428a('0x33')](_0x26af3f);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x272706['id']));}});}function setRelationship(_0x468cf4,_0x141a4d,_0x318134,_0x48a8a0){return request({'form':{'method':_0x428a('0x50'),'input_type':_0x428a('0x22'),'response_type':_0x428a('0x22'),'rest_data':JSON['stringify']({'session':_0x468cf4['id'],'module_name':_0x428a('0x51'),'module_id':_0x318134['id'],'link_field_name':_0x48a8a0,'related_ids':[_0x141a4d['id']]})}});}exports[_0x428a('0x52')]=function(_0x445081,_0x2f68e4,_0x40a3a4,_0x54471a,_0x5b4000,_0xa74187){var _0x5e81aa,_0xd2563b,_0x309a8b,_0x2ab820;_0xa74187[_0x428a('0x53')]=intUtil[_0x428a('0x54')](_0xa74187[_0x428a('0x53')]);_0xa74187[_0x428a('0x55')]=intUtil['stripTrailingSlash'](_0xa74187[_0x428a('0x55')]);def[_0x428a('0x56')]=util[_0x428a('0x23')](_0x428a('0x57'),_0xa74187['remoteUri']);if(_0x5b4000&&_0x5b4000[_0x428a('0x58')]){logger['info'](_0x428a('0x59'),_0x428a('0x5a'));_0x2f68e4['recordingURL']=util[_0x428a('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa74187[_0x428a('0x55')],_0x2f68e4[_0x428a('0x5b')],md5(_0x2f68e4[_0x428a('0x5b')]));}else{_0x2f68e4[_0x428a('0x5c')]='';}return getConnection(_0xa74187)[_0x428a('0x2c')](function(_0x23ffad){_0x2ab820=_0x23ffad;return getUser(_0xa74187,_0x54471a[_0x428a('0xb')],_0x2ab820);})[_0x428a('0x2c')](function(_0x4b24ed){_0x5e81aa=_0x4b24ed;logger[_0x428a('0x9')](_0x428a('0x5d'),_0x5e81aa['id']);return getEndUser(_0xa74187,_0x2f68e4['calleridname'],_0x2f68e4[_0x428a('0x5e')],_0x2ab820);})[_0x428a('0x2c')](function(_0x3252e3){_0xd2563b=_0x3252e3;logger[_0x428a('0x9')](_0x428a('0x5f'),_0xd2563b['id']);return getTicket(_0xa74187,_0x5e81aa,_0xd2563b,_0x40a3a4,_0x2f68e4,_0x40a3a4['Fields'],_0x2ab820,'Inbound');})[_0x428a('0x2c')](function(_0x48bde3){_0x309a8b=_0x48bde3;logger[_0x428a('0x9')](_0x428a('0x60'));logger[_0x428a('0x9')](_0x428a('0x61'),_0x309a8b['id']);return setRelationship(_0x2ab820,_0x5e81aa,_0x309a8b,_0x428a('0x62'));})[_0x428a('0x2c')](function(){return setRelationship(_0x2ab820,_0xd2563b,_0x309a8b,_0x428a('0x63'));})[_0x428a('0x2c')](function(){return getServerInfo(_0x2ab820);})[_0x428a('0x2c')](function(_0x253382){var _0x159077=parseInt(_0x253382[_0x428a('0x64')]['charAt'](0x0));var _0x15c0f9=util['format'](_0x428a('0x65'),_0xa74187[_0x428a('0x53')],_0x309a8b['id']);if(_0x159077>0x6){_0x15c0f9=util[_0x428a('0x23')](_0x428a('0x66'),_0xa74187[_0x428a('0x53')],_0x309a8b['id']);}logger[_0x428a('0x9')](_0x428a('0x59'),_0x428a('0x67'));emit(util[_0x428a('0x23')](_0x428a('0x68'),_0x54471a[_0x428a('0xb')]),_0x428a('0x69'),{'uri':_0x15c0f9});})['catch'](function(_0x2fef7b){logger[_0x428a('0x6a')](_0x428a('0x59'),JSON['stringify'](_0x2fef7b));});};exports[_0x428a('0x6b')]=function(_0x4ae97d,_0x4dbe34,_0x143389,_0x4553ae,_0x2c10ca,_0x5f2b54,_0x54669f){var _0x7ab980,_0x534381,_0x2a98fe,_0x293457;_0x5f2b54[_0x428a('0x53')]=intUtil['stripTrailingSlash'](_0x5f2b54['remoteUri']);_0x5f2b54['serverUrl']=intUtil[_0x428a('0x54')](_0x5f2b54[_0x428a('0x55')]);def[_0x428a('0x56')]=util[_0x428a('0x23')]('%s/service/v4_1/rest.php',_0x5f2b54[_0x428a('0x53')]);if(_0x54669f&&_0x54669f[_0x428a('0x6c')]&&_0x54669f[_0x428a('0x6c')]!==_0x428a('0x6d')){logger[_0x428a('0x9')](_0x428a('0x6e'),'Recording\x20is\x20enabled!');_0x4dbe34['recordingURL']=util[_0x428a('0x23')](_0x428a('0x6f'),_0x5f2b54[_0x428a('0x55')],_0x4dbe34[_0x428a('0x5b')],md5(_0x4dbe34[_0x428a('0x5b')]));}return getConnection(_0x5f2b54)['then'](function(_0x2c1608){_0x293457=_0x2c1608;return getUser(_0x5f2b54,_0x4553ae[_0x428a('0xb')],_0x293457);})['then'](function(_0x56a85a){_0x7ab980=_0x56a85a;logger['info'](_0x428a('0x5d'),_0x7ab980['id']);return getEndUser(_0x5f2b54,_0x4dbe34[_0x428a('0x70')],_0x4dbe34[_0x428a('0x71')],_0x293457);})[_0x428a('0x2c')](function(_0x505b21){_0x534381=_0x505b21;logger[_0x428a('0x9')]('The\x20Enduser\x20ID\x20is:',_0x534381['id']);return getTicket(_0x5f2b54,_0x7ab980,_0x534381,_0x143389,_0x4dbe34,_0x143389[_0x428a('0x72')],_0x293457,'Outbound');})[_0x428a('0x2c')](function(_0x512f5d){_0x2a98fe=_0x512f5d;logger[_0x428a('0x9')]('Ticket\x20created!');logger['info'](_0x428a('0x61'),_0x2a98fe['id']);return setRelationship(_0x293457,_0x7ab980,_0x2a98fe,_0x428a('0x62'));})[_0x428a('0x2c')](function(){return setRelationship(_0x293457,_0x534381,_0x2a98fe,'contacts');})['then'](function(){return getServerInfo(_0x293457);})[_0x428a('0x2c')](function(_0x1330f5){var _0x3039e1=parseInt(_0x1330f5[_0x428a('0x64')][_0x428a('0x73')](0x0));var _0x49fbb2=util[_0x428a('0x23')](_0x428a('0x65'),_0x5f2b54[_0x428a('0x53')],_0x2a98fe['id']);if(_0x3039e1>0x6){_0x49fbb2=util[_0x428a('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5f2b54['remoteUri'],_0x2a98fe['id']);}logger[_0x428a('0x9')](_0x428a('0x6e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x428a('0x23')](_0x428a('0x68'),_0x4553ae[_0x428a('0xb')]),_0x428a('0x69'),{'uri':_0x49fbb2});})[_0x428a('0x74')](function(_0x1554f8){logger[_0x428a('0x6a')]('[OUTBOUND]',JSON[_0x428a('0x28')](_0x1554f8));});};exports['abandoned']=function(_0x11449a,_0x23dba6,_0x18e710,_0xb152a4,_0x371957,_0x8b7fcb){var _0x1c20e6,_0x1c4347,_0x4f80ca,_0x1337af;_0x8b7fcb['remoteUri']=intUtil[_0x428a('0x54')](_0x8b7fcb[_0x428a('0x53')]);_0x8b7fcb['serverUrl']=intUtil[_0x428a('0x54')](_0x8b7fcb[_0x428a('0x55')]);def[_0x428a('0x56')]=util[_0x428a('0x23')](_0x428a('0x57'),_0x8b7fcb[_0x428a('0x53')]);if(_0x371957&&_0x371957[_0x428a('0x58')]){logger[_0x428a('0x9')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x23dba6['recordingURL']=util[_0x428a('0x23')](_0x428a('0x6f'),_0x8b7fcb[_0x428a('0x55')],_0x23dba6[_0x428a('0x5b')],md5(_0x23dba6['uniqueid']));}else{_0x23dba6[_0x428a('0x5c')]='';}return getConnection(_0x8b7fcb)[_0x428a('0x2c')](function(_0x5ea917){_0x1337af=_0x5ea917;if(!_[_0x428a('0x29')](_0xb152a4)){return getUser(_0x8b7fcb,_0xb152a4[_0x428a('0xb')],_0x1337af);}else{return getUser(_0x8b7fcb,null,_0x1337af);}})[_0x428a('0x2c')](function(_0x5cb13f){_0x1c20e6=_0x5cb13f;logger['info'](_0x428a('0x5d'),_0x1c20e6['id']);return getEndUser(_0x8b7fcb,_0x23dba6['calleridname'],_0x23dba6['calleridnum'],_0x1337af);})['then'](function(_0x40b127){_0x1c4347=_0x40b127;logger[_0x428a('0x9')](_0x428a('0x5f'),_0x1c4347['id']);return getTicket(_0x8b7fcb,_0x1c20e6,_0x1c4347,_0x18e710,_0x23dba6,_0x18e710[_0x428a('0x72')],_0x1337af,_0x428a('0x75'));})[_0x428a('0x2c')](function(_0x3c7689){_0x4f80ca=_0x3c7689;logger[_0x428a('0x9')](_0x428a('0x60'));logger[_0x428a('0x9')](_0x428a('0x61'),_0x4f80ca['id']);return setRelationship(_0x1337af,_0x1c20e6,_0x4f80ca,_0x428a('0x62'));})[_0x428a('0x2c')](function(){return setRelationship(_0x1337af,_0x1c4347,_0x4f80ca,_0x428a('0x63'));})['then'](function(){return getServerInfo(_0x1337af);})[_0x428a('0x74')](function(_0x8aa7c9){logger[_0x428a('0x6a')](_0x428a('0x76'),JSON[_0x428a('0x28')](_0x8aa7c9));});}; \ 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 845f37a..4942424 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 _0x3674=['type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','key','keyContent','%s:\x20%s','stripTrailingSlash','slice','validateEmail','lodash','util','getString','sortBy'];(function(_0x2d03c6,_0x127ee0){var _0x25c6d2=function(_0x1826d0){while(--_0x1826d0){_0x2d03c6['push'](_0x2d03c6['shift']());}};_0x25c6d2(++_0x127ee0);}(_0x3674,0x74));var _0x4367=function(_0x1ce834,_0x48dac9){_0x1ce834=_0x1ce834-0x0;var _0x248554=_0x3674[_0x1ce834];return _0x248554;};'use strict';var _=require(_0x4367('0x0'));var util=require(_0x4367('0x1'));exports[_0x4367('0x2')]=function(_0x57555b,_0x196126,_0x1952ed){var _0x384e38=[];if(_0x57555b['length']>0x0){var _0x51a12d=_[_0x4367('0x3')](_0x57555b,['id']);for(var _0x2e453f=0x0;_0x2e453f<_0x51a12d['length'];_0x2e453f++){var _0x563182=_0x51a12d[_0x2e453f];if(_0x563182[_0x4367('0x4')]===_0x4367('0x5')){_0x384e38[_0x4367('0x6')](_0x563182[_0x4367('0x7')]);}else if(_0x563182['type']===_0x4367('0x8')&&_0x563182[_0x4367('0x9')]){_0x196126[_0x563182[_0x4367('0x9')]]&&_0x384e38['push'](_0x196126[_0x563182[_0x4367('0x9')]][_0x4367('0xa')]());}else if(_0x563182[_0x4367('0x4')]===_0x4367('0xb')&&_0x563182[_0x4367('0xc')]&&_0x563182[_0x4367('0xc')][_0x4367('0xd')]){_0x196126[_0x563182[_0x4367('0xc')][_0x4367('0xd')][_0x4367('0xe')]()]&&_0x384e38[_0x4367('0x6')](_0x196126[_0x563182[_0x4367('0xc')][_0x4367('0xd')][_0x4367('0xe')]()]['toString']());}else if(_0x563182[_0x4367('0x4')]===_0x4367('0xf')){if(_0x563182[_0x4367('0x10')]===_0x4367('0x5')&&_0x563182['key']){_0x384e38['push'](util[_0x4367('0x11')]('%s:\x20%s',_0x563182[_0x4367('0x12')],_0x563182[_0x4367('0x13')]));}else if(_0x563182[_0x4367('0x10')]==='variable'&&_0x563182[_0x4367('0x9')]&&_0x563182[_0x4367('0x12')]){_0x196126[_0x563182[_0x4367('0x9')]]&&_0x384e38[_0x4367('0x6')](util[_0x4367('0x11')](_0x4367('0x14'),_0x563182[_0x4367('0x12')],_0x196126[_0x563182[_0x4367('0x9')]]));}else if(_0x563182[_0x4367('0x10')]==='customVariable'&&_0x563182['Variable']&&_0x563182[_0x4367('0xc')]['name']&&_0x563182['key']){_0x196126[_0x563182[_0x4367('0xc')]['name'][_0x4367('0xe')]()]&&_0x384e38[_0x4367('0x6')](util[_0x4367('0x11')]('%s:\x20%s',_0x563182[_0x4367('0x12')],_0x196126[_0x563182[_0x4367('0xc')][_0x4367('0xd')][_0x4367('0xe')]()]));}}}}return _0x384e38['join'](_0x1952ed);};exports[_0x4367('0x15')]=function(_0x23c594){var _0x3ce15d=_0x23c594[_0x4367('0x16')](-0x1);if(_0x3ce15d==='/'){_0x23c594=_0x23c594['substring'](0x0,_0x23c594['lastIndexOf'](_0x3ce15d));}return _0x23c594;};exports[_0x4367('0x17')]=function(_0xa18695){if(!_['isNil'](_0xa18695)&&_0xa18695!==''){var _0x455477=/^(([^<>()\[\]\\.,;:\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 _0x455477['test'](String(_0xa18695)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x9ebf=['lastIndexOf','isNil','test','lodash','length','sortBy','type','string','push','variable','variableName','toString','Variable','name','toLowerCase','keyValue','key','%s:\x20%s','keyContent','format','keyType','customVariable','stripTrailingSlash','slice','substring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ebf,0xe4));var _0xf9eb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9ebf[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf9eb('0x0'));var util=require('util');exports['getString']=function(_0xd4ce19,_0x4efa52,_0x6c985f){var _0x117e5c=[];if(_0xd4ce19[_0xf9eb('0x1')]>0x0){var _0x49db44=_[_0xf9eb('0x2')](_0xd4ce19,['id']);for(var _0x3626af=0x0;_0x3626af<_0x49db44['length'];_0x3626af++){var _0xa85822=_0x49db44[_0x3626af];if(_0xa85822[_0xf9eb('0x3')]===_0xf9eb('0x4')){_0x117e5c[_0xf9eb('0x5')](_0xa85822['content']);}else if(_0xa85822[_0xf9eb('0x3')]===_0xf9eb('0x6')&&_0xa85822['variableName']){_0x4efa52[_0xa85822[_0xf9eb('0x7')]]&&_0x117e5c[_0xf9eb('0x5')](_0x4efa52[_0xa85822[_0xf9eb('0x7')]][_0xf9eb('0x8')]());}else if(_0xa85822[_0xf9eb('0x3')]==='customVariable'&&_0xa85822['Variable']&&_0xa85822[_0xf9eb('0x9')]['name']){_0x4efa52[_0xa85822[_0xf9eb('0x9')][_0xf9eb('0xa')][_0xf9eb('0xb')]()]&&_0x117e5c[_0xf9eb('0x5')](_0x4efa52[_0xa85822[_0xf9eb('0x9')][_0xf9eb('0xa')]['toLowerCase']()]['toString']());}else if(_0xa85822[_0xf9eb('0x3')]===_0xf9eb('0xc')){if(_0xa85822['keyType']===_0xf9eb('0x4')&&_0xa85822[_0xf9eb('0xd')]){_0x117e5c[_0xf9eb('0x5')](util['format'](_0xf9eb('0xe'),_0xa85822[_0xf9eb('0xd')],_0xa85822[_0xf9eb('0xf')]));}else if(_0xa85822['keyType']===_0xf9eb('0x6')&&_0xa85822['variableName']&&_0xa85822[_0xf9eb('0xd')]){_0x4efa52[_0xa85822[_0xf9eb('0x7')]]&&_0x117e5c[_0xf9eb('0x5')](util[_0xf9eb('0x10')](_0xf9eb('0xe'),_0xa85822[_0xf9eb('0xd')],_0x4efa52[_0xa85822[_0xf9eb('0x7')]]));}else if(_0xa85822[_0xf9eb('0x11')]===_0xf9eb('0x12')&&_0xa85822[_0xf9eb('0x9')]&&_0xa85822[_0xf9eb('0x9')][_0xf9eb('0xa')]&&_0xa85822[_0xf9eb('0xd')]){_0x4efa52[_0xa85822['Variable'][_0xf9eb('0xa')][_0xf9eb('0xb')]()]&&_0x117e5c[_0xf9eb('0x5')](util[_0xf9eb('0x10')](_0xf9eb('0xe'),_0xa85822[_0xf9eb('0xd')],_0x4efa52[_0xa85822[_0xf9eb('0x9')][_0xf9eb('0xa')][_0xf9eb('0xb')]()]));}}}}return _0x117e5c['join'](_0x6c985f);};exports[_0xf9eb('0x13')]=function(_0x33bad4){var _0x24c302=_0x33bad4[_0xf9eb('0x14')](-0x1);if(_0x24c302==='/'){_0x33bad4=_0x33bad4[_0xf9eb('0x15')](0x0,_0x33bad4[_0xf9eb('0x16')](_0x24c302));}return _0x33bad4;};exports['validateEmail']=function(_0x53338d){if(!_[_0xf9eb('0x17')](_0x53338d)&&_0x53338d!==''){var _0xfbf2a2=/^(([^<>()\[\]\\.,;:\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 _0xfbf2a2[_0xf9eb('0x18')](String(_0x53338d)[_0xf9eb('0xb')]());}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 3b21bdd..173805c 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 _0xedd9=['success','resolve','result','stringify','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','GET','%s/webservice.php','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','getEndUser','accessKey','login','token','getConnection','[HTTP]','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','abandoned','calleridname','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','getString','Subjects','POST','format','remoteUri','create','username','sessionName','HelpDesk','then'];(function(_0x270cd7,_0x1b65f4){var _0x4e3f32=function(_0x4513c6){while(--_0x4513c6){_0x270cd7['push'](_0x270cd7['shift']());}};_0x4e3f32(++_0x1b65f4);}(_0xedd9,0xfc));var _0x9edd=function(_0x4b45bc,_0x2193ca){_0x4b45bc=_0x4b45bc-0x0;var _0x11d660=_0xedd9[_0x4b45bc];return _0x11d660;};'use strict';var _=require('lodash');var rp=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var util=require(_0x9edd('0x3'));var Redis=require(_0x9edd('0x4'));var intUtil=require(_0x9edd('0x5'));var config=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('vTiger');config[_0x9edd('0x8')]=_[_0x9edd('0x9')](config[_0x9edd('0x8')],{'host':_0x9edd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0x8')]));function emit(_0x571af9,_0x172522,_0x190185){io['to'](_0x571af9)[_0x9edd('0xb')](_0x172522,_0x190185);}function getCustomFields(_0x3280fd,_0x49d5e3){var _0x494a24={};if(_0x3280fd['length']>0x0){_[_0x9edd('0xc')](_0x3280fd,function(_0x138767){if(_0x138767['type']===_0x9edd('0xd')&&_0x138767[_0x9edd('0xe')]){_0x494a24[_0x138767['idField']]=_0x138767[_0x9edd('0xf')][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x12')&&_0x138767[_0x9edd('0x13')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x13')]]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767['variableName']][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x14')&&_0x138767[_0x9edd('0x15')]&&_0x138767[_0x9edd('0x15')][_0x9edd('0x16')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()][_0x9edd('0x10')]();}});}return _0x494a24;}function createTicket(_0x40ba32,_0x4d8f33,_0x43dc70,_0x5d879c,_0x2cdcef,_0x1083e4,_0x4bdb88){logger['info'](_0x9edd('0x18'));var _0x50338f=_[_0x9edd('0x19')]({'parent_id':'','assigned_user_id':_0x4d8f33['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x9edd('0x1a')](_0x5d879c[_0x9edd('0x1b')],_0x2cdcef,'\x20'),'description':intUtil['getString'](_0x5d879c['Descriptions'],_0x2cdcef,'\x0a'),'contact_id':_0x43dc70['id']},getCustomFields(_0x1083e4,_0x2cdcef));var _0x341d67={'method':_0x9edd('0x1c'),'uri':util[_0x9edd('0x1d')]('%s/webservice.php',_0x40ba32[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'username':_0x40ba32[_0x9edd('0x20')],'sessionName':_0x4bdb88[_0x9edd('0x21')],'elementType':_0x9edd('0x22'),'element':JSON['stringify'](_0x50338f)},'json':!![]};return request(_0x341d67)[_0x9edd('0x23')](function(_0xeaf55a){if(_0xeaf55a[_0x9edd('0x24')]){return BPromise[_0x9edd('0x25')]({'id':_0xeaf55a[_0x9edd('0x26')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x9edd('0x27')](_0xeaf55a[_0x9edd('0x28')])));}})[_0x9edd('0x29')](function(_0x25e135){var _0x3c2227=_0x25e135['statusCode']||0x1f4;logger['error'](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x3c2227,JSON[_0x9edd('0x27')](_0x25e135));});}function getUser(_0x52746a,_0x238b22,_0x28cfae){if(intUtil[_0x9edd('0x2c')](_0x238b22)){logger[_0x9edd('0x2d')]('Getting\x20agent\x20with\x20email',_0x238b22);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x52746a[_0x9edd('0x1e')]),'qs':{'operation':_0x9edd('0x30'),'username':_0x52746a[_0x9edd('0x20')],'sessionName':_0x28cfae[_0x9edd('0x21')],'query':util[_0x9edd('0x1d')](_0x9edd('0x31'),_0x238b22)},'json':!![]})[_0x9edd('0x23')](function(_0x4fd03f){if(_0x4fd03f[_0x9edd('0x24')]&&_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x32')]){logger[_0x9edd('0x2d')]('Agent\x20found!');return BPromise[_0x9edd('0x25')]({'id':_0x4fd03f[_0x9edd('0x26')][0x0]['id'],'email':_0x4fd03f[_0x9edd('0x26')][0x0]['email1'],'name':_0x4fd03f[_0x9edd('0x26')][0x0][_0x9edd('0x33')]+'\x20'+_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x34')]});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a[_0x9edd('0x20')],'name':_0x9edd('0x37')});}})[_0x9edd('0x29')](function(_0x42c1d9){var _0x27eb7e=_0x42c1d9[_0x9edd('0x38')]||0x1f4;logger['error'](_0x9edd('0x2a'),'getUser',_0x27eb7e,JSON[_0x9edd('0x27')](_0x42c1d9));});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a['username'],'name':_0x9edd('0x37')})[_0x9edd('0x29')](function(_0x2b3469){var _0x38e9be=_0x2b3469[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x39'),_0x38e9be,JSON[_0x9edd('0x27')](_0x2b3469));});}}function getEndUser(_0x35c16f,_0x51a54a,_0x231604,_0x56a228){logger[_0x9edd('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0x231604);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x35c16f['remoteUri']),'qs':{'operation':_0x9edd('0x30'),'username':_0x35c16f[_0x9edd('0x20')],'sessionName':_0x56a228[_0x9edd('0x21')],'query':util['format'](_0x9edd('0x3a'),_0x231604,_0x231604,_0x231604,_0x231604,_0x231604)},'json':!![]})['then'](function(_0x1fc4fb){if(_0x1fc4fb[_0x9edd('0x24')]&&_0x1fc4fb['result'][_0x9edd('0x32')]){logger[_0x9edd('0x2d')](_0x9edd('0x3b'));return BPromise[_0x9edd('0x25')]({'id':_0x1fc4fb['result'][0x0]['id'],'name':_0x1fc4fb[_0x9edd('0x26')][0x0]['firstname']+'\x20'+_0x1fc4fb[_0x9edd('0x26')][0x0][_0x9edd('0x3c')],'phone':_0x231604});}else{logger['info'](_0x9edd('0x3d'));return request({'method':'POST','uri':util['format'](_0x9edd('0x2f'),_0x35c16f[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'sessionName':_0x56a228[_0x9edd('0x21')],'elementType':_0x9edd('0x3e'),'element':JSON[_0x9edd('0x27')]({'lastname':_0x51a54a,'phone':_0x231604,'assigned_user_id':'\x20'})},'json':!![]})[_0x9edd('0x23')](function(_0x75efbe){logger[_0x9edd('0x2d')](_0x9edd('0x3f'));return BPromise[_0x9edd('0x25')]({'id':_0x75efbe[_0x9edd('0x26')]['id'],'name':_0x75efbe[_0x9edd('0x26')][_0x9edd('0x3c')],'phone':_0x75efbe[_0x9edd('0x26')]['phone']});})[_0x9edd('0x29')](function(_0x2570e3){var _0x2231c1=_0x2570e3[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x40'),_0x2231c1,JSON['stringify'](_0x2570e3));});}});}function getConnection(_0x4a4656){var _0x4bc7a1=_0x4a4656[_0x9edd('0x20')];var _0x58a1dd=_0x4a4656[_0x9edd('0x41')];return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'qs':{'operation':'getchallenge','username':_0x4bc7a1},'json':!![]})[_0x9edd('0x23')](function(_0x35e63c){if(_0x35e63c[_0x9edd('0x24')]){return request({'method':'POST','uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x42'),'username':_0x4bc7a1,'accessKey':md5(_0x35e63c[_0x9edd('0x26')][_0x9edd('0x43')]+_0x58a1dd)},'json':!![]});}})['then'](function(_0x441e4a){if(_0x441e4a[_0x9edd('0x24')]){return BPromise['resolve'](_0x441e4a[_0x9edd('0x26')]);}else{throw new Error(util[_0x9edd('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x4a4656['id']));}})[_0x9edd('0x29')](function(_0x8134cd){var _0x468239=_0x8134cd['statusCode']||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x44'),_0x468239,JSON[_0x9edd('0x27')](_0x8134cd));});}function request(_0x53f6e3){logger[_0x9edd('0x2d')](_0x9edd('0x45'),JSON[_0x9edd('0x27')](_0x53f6e3));return rp(_0x53f6e3);}exports['queue']=function(_0x16951a,_0x21f6ce,_0x57db43,_0x8e59bd,_0x4e2aaf,_0x336494){var _0xe6b20c,_0x24245f,_0x3fcdf5,_0x1e3c19;_0x336494[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x336494[_0x9edd('0x1e')]);if(_0x4e2aaf&&_0x4e2aaf[_0x9edd('0x47')]){logger[_0x9edd('0x2d')](_0x9edd('0x48'),'Recording\x20is\x20enabled!');_0x21f6ce[_0x9edd('0x49')]=util[_0x9edd('0x1d')](_0x9edd('0x4a'),_0x336494['serverUrl'],_0x21f6ce[_0x9edd('0x4b')],md5(_0x21f6ce['uniqueid']));}else{_0x21f6ce['recordingURL']='';}return getConnection(_0x336494)['then'](function(_0x1348a7){_0x1e3c19=_0x1348a7;return getUser(_0x336494,_0x8e59bd[_0x9edd('0x4c')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x35ddb3){_0xe6b20c=_0x35ddb3;logger['info']('The\x20User\x20ID\x20is:',_0xe6b20c['id']);return getEndUser(_0x336494,_0x21f6ce['calleridname'],_0x21f6ce[_0x9edd('0x4d')],_0x1e3c19);})[_0x9edd('0x23')](function(_0xd5090a){_0x24245f=_0xd5090a;logger[_0x9edd('0x2d')](_0x9edd('0x4e'),_0x24245f['id']);return createTicket(_0x336494,_0xe6b20c,_0x24245f,_0x57db43,_0x21f6ce,_0x57db43[_0x9edd('0x4f')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x1e3087){_0x3fcdf5=_0x1e3087;logger['info'](_0x9edd('0x50'));logger['info'](_0x9edd('0x51'),_0x3fcdf5['id']);var _0x6a1cfc=util['format'](_0x9edd('0x52'),_0x336494[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x3fcdf5['id'],'x')[0x1]);logger['info'](_0x9edd('0x48'),_0x9edd('0x54'));emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x8e59bd[_0x9edd('0x16')]),_0x9edd('0x56'),{'uri':_0x6a1cfc});})['catch'](function(_0x4aa337){logger[_0x9edd('0x28')]('[QUEUE]',JSON[_0x9edd('0x27')](_0x4aa337));});};exports[_0x9edd('0x57')]=function(_0x439083,_0x17d2f2,_0x5df1d7,_0x21ead2,_0x507cce,_0x3e5dca,_0x344692){var _0xc6bde6,_0x5ca123,_0x2651a2,_0x57da5b;_0x3e5dca[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x3e5dca['remoteUri']);_0x3e5dca[_0x9edd('0x58')]=intUtil['stripTrailingSlash'](_0x3e5dca[_0x9edd('0x58')]);if(_0x344692&&_0x344692[_0x9edd('0x59')]&&_0x344692[_0x9edd('0x59')]!=='none'){logger[_0x9edd('0x2d')](_0x9edd('0x5a'),_0x9edd('0x5b'));_0x17d2f2[_0x9edd('0x49')]=util[_0x9edd('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e5dca['serverUrl'],_0x17d2f2[_0x9edd('0x4b')],md5(_0x17d2f2[_0x9edd('0x4b')]));}return getConnection(_0x3e5dca)['then'](function(_0x5496e9){_0x57da5b=_0x5496e9;return getUser(_0x3e5dca,_0x21ead2['email'],_0x57da5b);})[_0x9edd('0x23')](function(_0x4e003a){_0xc6bde6=_0x4e003a;logger['info'](_0x9edd('0x5c'),_0xc6bde6['id']);return getEndUser(_0x3e5dca,_0x17d2f2[_0x9edd('0x5d')],_0x17d2f2['destcalleridnum'],_0x57da5b);})[_0x9edd('0x23')](function(_0x11e082){_0x5ca123=_0x11e082;logger[_0x9edd('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x5ca123['id']);return createTicket(_0x3e5dca,_0xc6bde6,_0x5ca123,_0x5df1d7,_0x17d2f2,_0x5df1d7[_0x9edd('0x4f')],_0x57da5b);})['then'](function(_0x37b018){_0x2651a2=_0x37b018;logger[_0x9edd('0x2d')]('Ticket\x20created!');logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x2651a2['id']);var _0x5c1746=util[_0x9edd('0x1d')](_0x9edd('0x52'),_0x3e5dca[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x2651a2['id'],'x')[0x1]);logger['info'](_0x9edd('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x21ead2[_0x9edd('0x16')]),'trigger:browser:url',{'uri':_0x5c1746});})[_0x9edd('0x29')](function(_0x286593){logger[_0x9edd('0x28')](_0x9edd('0x5a'),JSON[_0x9edd('0x27')](_0x286593));});};exports[_0x9edd('0x5e')]=function(_0x3fa4a9,_0x512d3a,_0x5e29d0,_0x322165,_0x3c7874,_0x13254e){var _0x171403,_0x1e2126,_0x52f6f3,_0x2e40c8;_0x13254e[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x13254e['remoteUri']);_0x13254e[_0x9edd('0x58')]=intUtil[_0x9edd('0x46')](_0x13254e['serverUrl']);if(_0x3c7874&&_0x3c7874[_0x9edd('0x47')]){logger[_0x9edd('0x2d')]('[ABANDONED]',_0x9edd('0x5b'));_0x512d3a[_0x9edd('0x49')]=util['format'](_0x9edd('0x4a'),_0x13254e['serverUrl'],_0x512d3a['uniqueid'],md5(_0x512d3a[_0x9edd('0x4b')]));}else{_0x512d3a[_0x9edd('0x49')]='';}return getConnection(_0x13254e)[_0x9edd('0x23')](function(_0x5b56c7){_0x2e40c8=_0x5b56c7;return getUser(_0x13254e,'',_0x2e40c8);})[_0x9edd('0x23')](function(_0x286e47){_0x171403=_0x286e47;logger['info'](_0x9edd('0x5c'),_0x171403['id']);return getEndUser(_0x13254e,_0x512d3a[_0x9edd('0x5f')],_0x512d3a[_0x9edd('0x4d')],_0x2e40c8);})[_0x9edd('0x23')](function(_0x54ac71){_0x1e2126=_0x54ac71;logger['info'](_0x9edd('0x4e'),_0x1e2126['id']);return createTicket(_0x13254e,_0x171403,_0x1e2126,_0x5e29d0,_0x512d3a,_0x5e29d0['Fields'],_0x2e40c8);})[_0x9edd('0x23')](function(_0x2c71ce){_0x52f6f3=_0x2c71ce;logger[_0x9edd('0x2d')](_0x9edd('0x50'));logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x52f6f3['id']);})[_0x9edd('0x29')](function(_0x5a4d4b){logger[_0x9edd('0x28')]('[ABANDONED]',JSON[_0x9edd('0x27')](_0x5a4d4b));});}; \ No newline at end of file +var _0x3e74=['Normal','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','username','stringify','then','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','Agent\x20found!','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','userId','admin','getUser','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','create','Enduser\x20created.','lastname','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','Ticket\x20created!','[OUTBOUND]','user:%s','abandoned','[ABANDONED]','lodash','bluebird','md5','util','../../../../config/environment','vTiger','redis','defaults','localhost','emit','forEach','string','idField','content','type','variable','variableName','toString','Variable','name','info','Creating\x20new\x20ticket...','merge'];(function(_0x139cd0,_0xd19a72){var _0x51c0f1=function(_0x145e75){while(--_0x145e75){_0x139cd0['push'](_0x139cd0['shift']());}};_0x51c0f1(++_0xd19a72);}(_0x3e74,0x175));var _0x43e7=function(_0x1bb29a,_0x4b5d98){_0x1bb29a=_0x1bb29a-0x0;var _0x3187b6=_0x3e74[_0x1bb29a];return _0x3187b6;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var BPromise=require(_0x43e7('0x1'));var md5=require(_0x43e7('0x2'));var util=require(_0x43e7('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x43e7('0x4'));var logger=require('../../../../config/logger')(_0x43e7('0x5'));config[_0x43e7('0x6')]=_[_0x43e7('0x7')](config[_0x43e7('0x6')],{'host':_0x43e7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0x6')]));function emit(_0x3491d6,_0x2ede2d,_0x8528fc){io['to'](_0x3491d6)[_0x43e7('0x9')](_0x2ede2d,_0x8528fc);}function getCustomFields(_0x516b4d,_0x212c6c){var _0x554d44={};if(_0x516b4d['length']>0x0){_[_0x43e7('0xa')](_0x516b4d,function(_0x4139c9){if(_0x4139c9['type']===_0x43e7('0xb')&&_0x4139c9['idField']){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x4139c9[_0x43e7('0xd')]['toString']();}else if(_0x4139c9[_0x43e7('0xe')]===_0x43e7('0xf')&&_0x4139c9[_0x43e7('0x10')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9['variableName']]){_0x554d44[_0x4139c9['idField']]=_0x212c6c[_0x4139c9[_0x43e7('0x10')]][_0x43e7('0x11')]();}else if(_0x4139c9[_0x43e7('0xe')]==='customVariable'&&_0x4139c9['Variable']&&_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9[_0x43e7('0x12')]['name']['toLowerCase']()]){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x212c6c[_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]['toLowerCase']()]['toString']();}});}return _0x554d44;}function createTicket(_0x446986,_0x1ca758,_0x9037d3,_0x140657,_0x3776f5,_0x1f24fb,_0x619236){logger[_0x43e7('0x14')](_0x43e7('0x15'));var _0xab63cf=_[_0x43e7('0x16')]({'parent_id':'','assigned_user_id':_0x1ca758['id'],'ticketpriorities':_0x43e7('0x17'),'ticketstatus':'Open','ticket_title':intUtil[_0x43e7('0x18')](_0x140657[_0x43e7('0x19')],_0x3776f5,'\x20'),'description':intUtil['getString'](_0x140657[_0x43e7('0x1a')],_0x3776f5,'\x0a'),'contact_id':_0x9037d3['id']},getCustomFields(_0x1f24fb,_0x3776f5));var _0x3e281e={'method':_0x43e7('0x1b'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986[_0x43e7('0x1e')]),'form':{'operation':'create','username':_0x446986[_0x43e7('0x1f')],'sessionName':_0x619236['sessionName'],'elementType':'HelpDesk','element':JSON[_0x43e7('0x20')](_0xab63cf)},'json':!![]};return request(_0x3e281e)[_0x43e7('0x21')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x22')]){return BPromise['resolve']({'id':_0x4b2b9f[_0x43e7('0x23')]['id']});}else{throw new Error(util['format'](_0x43e7('0x24'),JSON[_0x43e7('0x20')](_0x4b2b9f[_0x43e7('0x25')])));}})[_0x43e7('0x26')](function(_0x51f4d7){var _0x52b7b3=_0x51f4d7[_0x43e7('0x27')]||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x29'),_0x52b7b3,JSON[_0x43e7('0x20')](_0x51f4d7));});}function getUser(_0xb1fc63,_0x5087d7,_0x33a1a5){if(intUtil[_0x43e7('0x2a')](_0x5087d7)){logger[_0x43e7('0x14')](_0x43e7('0x2b'),_0x5087d7);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0xb1fc63[_0x43e7('0x1e')]),'qs':{'operation':_0x43e7('0x2d'),'username':_0xb1fc63[_0x43e7('0x1f')],'sessionName':_0x33a1a5[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x2f'),_0x5087d7)},'json':!![]})[_0x43e7('0x21')](function(_0x4bdb17){if(_0x4bdb17[_0x43e7('0x22')]&&_0x4bdb17[_0x43e7('0x23')][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x31'));return BPromise['resolve']({'id':_0x4bdb17[_0x43e7('0x23')][0x0]['id'],'email':_0x4bdb17[_0x43e7('0x23')][0x0][_0x43e7('0x32')],'name':_0x4bdb17[_0x43e7('0x23')][0x0]['first_name']+'\x20'+_0x4bdb17['result']['last_name']});}else{logger[_0x43e7('0x14')](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')});}})['catch'](function(_0x47baee){var _0x4ac23d=_0x47baee['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x4ac23d,JSON[_0x43e7('0x20')](_0x47baee));});}else{logger['info'](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')})[_0x43e7('0x26')](function(_0x101d45){var _0x4f1a5f=_0x101d45['statusCode']||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x37'),_0x4f1a5f,JSON[_0x43e7('0x20')](_0x101d45));});}}function getEndUser(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589){logger[_0x43e7('0x14')]('Searching\x20end\x20user\x20with\x20phone',_0x1ed538);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x16cdba[_0x43e7('0x1e')]),'qs':{'operation':'query','username':_0x16cdba[_0x43e7('0x1f')],'sessionName':_0x1d4589[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x38'),_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538)},'json':!![]})[_0x43e7('0x21')](function(_0x234d8f){if(_0x234d8f['success']&&_0x234d8f['result'][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x39'));return BPromise[_0x43e7('0x34')]({'id':_0x234d8f[_0x43e7('0x23')][0x0]['id'],'name':_0x234d8f['result'][0x0][_0x43e7('0x3a')]+'\x20'+_0x234d8f[_0x43e7('0x23')][0x0]['lastname'],'phone':_0x1ed538});}else{logger[_0x43e7('0x14')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x43e7('0x1b'),'uri':util['format'](_0x43e7('0x1d'),_0x16cdba[_0x43e7('0x1e')]),'form':{'operation':_0x43e7('0x3b'),'sessionName':_0x1d4589[_0x43e7('0x2e')],'elementType':'Contacts','element':JSON['stringify']({'lastname':_0x1b1440,'phone':_0x1ed538,'assigned_user_id':'\x20'})},'json':!![]})[_0x43e7('0x21')](function(_0x40c509){logger[_0x43e7('0x14')](_0x43e7('0x3c'));return BPromise['resolve']({'id':_0x40c509['result']['id'],'name':_0x40c509['result'][_0x43e7('0x3d')],'phone':_0x40c509['result'][_0x43e7('0x3e')]});})['catch'](function(_0x5b28db){var _0x46b2e6=_0x5b28db['statusCode']||0x1f4;logger[_0x43e7('0x25')](_0x43e7('0x28'),_0x43e7('0x3f'),_0x46b2e6,JSON[_0x43e7('0x20')](_0x5b28db));});}});}function getConnection(_0x4fc5e8){var _0x91f1e4=_0x4fc5e8[_0x43e7('0x1f')];var _0x23a611=_0x4fc5e8[_0x43e7('0x40')];return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x4fc5e8['remoteUri']),'qs':{'operation':_0x43e7('0x41'),'username':_0x91f1e4},'json':!![]})[_0x43e7('0x21')](function(_0x212841){if(_0x212841['success']){return request({'method':'POST','uri':util['format'](_0x43e7('0x1d'),_0x4fc5e8[_0x43e7('0x1e')]),'form':{'operation':'login','username':_0x91f1e4,'accessKey':md5(_0x212841[_0x43e7('0x23')][_0x43e7('0x42')]+_0x23a611)},'json':!![]});}})[_0x43e7('0x21')](function(_0x560329){if(_0x560329['success']){return BPromise['resolve'](_0x560329['result']);}else{throw new Error(util[_0x43e7('0x1c')](_0x43e7('0x43'),_0x4fc5e8['id']));}})['catch'](function(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x27')]||0x1f4;logger[_0x43e7('0x25')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x43e7('0x44'),_0x82d32f,JSON['stringify'](_0x23e7cb));});}function request(_0x4bebd4){logger[_0x43e7('0x14')](_0x43e7('0x45'),JSON[_0x43e7('0x20')](_0x4bebd4));return rp(_0x4bebd4);}exports[_0x43e7('0x46')]=function(_0x13503c,_0x2351cf,_0x1cd87c,_0x256ddd,_0x473fca,_0x2b5515){var _0x58dfd0,_0x119d34,_0x46c910,_0x499c03;_0x2b5515[_0x43e7('0x1e')]=intUtil['stripTrailingSlash'](_0x2b5515[_0x43e7('0x1e')]);if(_0x473fca&&_0x473fca[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x48'),_0x43e7('0x49'));_0x2351cf['recordingURL']=util['format'](_0x43e7('0x4a'),_0x2b5515[_0x43e7('0x4b')],_0x2351cf[_0x43e7('0x4c')],md5(_0x2351cf[_0x43e7('0x4c')]));}else{_0x2351cf[_0x43e7('0x4d')]='';}return getConnection(_0x2b5515)[_0x43e7('0x21')](function(_0xa47464){_0x499c03=_0xa47464;return getUser(_0x2b5515,_0x256ddd[_0x43e7('0x4e')],_0x499c03);})[_0x43e7('0x21')](function(_0x24e758){_0x58dfd0=_0x24e758;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x58dfd0['id']);return getEndUser(_0x2b5515,_0x2351cf[_0x43e7('0x4f')],_0x2351cf[_0x43e7('0x50')],_0x499c03);})['then'](function(_0x4314d8){_0x119d34=_0x4314d8;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x119d34['id']);return createTicket(_0x2b5515,_0x58dfd0,_0x119d34,_0x1cd87c,_0x2351cf,_0x1cd87c['Fields'],_0x499c03);})['then'](function(_0x459c13){_0x46c910=_0x459c13;logger[_0x43e7('0x14')]('Ticket\x20created!');logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x46c910['id']);var _0x49a6ce=util[_0x43e7('0x1c')](_0x43e7('0x52'),_0x2b5515[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x46c910['id'],'x')[0x1]);logger[_0x43e7('0x14')]('[QUEUE]',_0x43e7('0x54'));emit(util[_0x43e7('0x1c')]('user:%s',_0x256ddd[_0x43e7('0x13')]),_0x43e7('0x55'),{'uri':_0x49a6ce});})[_0x43e7('0x26')](function(_0x5bb536){logger['error']('[QUEUE]',JSON[_0x43e7('0x20')](_0x5bb536));});};exports[_0x43e7('0x56')]=function(_0x323cf7,_0x3a6404,_0x52ea9c,_0x5a50fc,_0x1b27da,_0x8b50bb,_0x140438){var _0x5dd349,_0x5ea0db,_0x4438c0,_0x1a7cb5;_0x8b50bb[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x1e')]);_0x8b50bb[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x4b')]);if(_0x140438&&_0x140438[_0x43e7('0x58')]&&_0x140438[_0x43e7('0x58')]!==_0x43e7('0x59')){logger['info']('[OUTBOUND]',_0x43e7('0x49'));_0x3a6404['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8b50bb[_0x43e7('0x4b')],_0x3a6404[_0x43e7('0x4c')],md5(_0x3a6404['uniqueid']));}return getConnection(_0x8b50bb)[_0x43e7('0x21')](function(_0x135791){_0x1a7cb5=_0x135791;return getUser(_0x8b50bb,_0x5a50fc[_0x43e7('0x4e')],_0x1a7cb5);})['then'](function(_0x2b7406){_0x5dd349=_0x2b7406;logger[_0x43e7('0x14')](_0x43e7('0x5a'),_0x5dd349['id']);return getEndUser(_0x8b50bb,_0x3a6404[_0x43e7('0x5b')],_0x3a6404[_0x43e7('0x5c')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x1e02fa){_0x5ea0db=_0x1e02fa;logger['info'](_0x43e7('0x51'),_0x5ea0db['id']);return createTicket(_0x8b50bb,_0x5dd349,_0x5ea0db,_0x52ea9c,_0x3a6404,_0x52ea9c[_0x43e7('0x5d')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x549f4e){_0x4438c0=_0x549f4e;logger['info'](_0x43e7('0x5e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4438c0['id']);var _0x1b793d=util[_0x43e7('0x1c')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x8b50bb[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x4438c0['id'],'x')[0x1]);logger[_0x43e7('0x14')](_0x43e7('0x5f'),_0x43e7('0x54'));emit(util[_0x43e7('0x1c')](_0x43e7('0x60'),_0x5a50fc['name']),_0x43e7('0x55'),{'uri':_0x1b793d});})[_0x43e7('0x26')](function(_0x4e5956){logger[_0x43e7('0x25')]('[OUTBOUND]',JSON[_0x43e7('0x20')](_0x4e5956));});};exports[_0x43e7('0x61')]=function(_0x37301b,_0x1ca24b,_0x506361,_0x2d25b5,_0x2646c2,_0xf929a5){var _0x556001,_0x17889c,_0x38fa5b,_0x219dc6;_0xf929a5[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0xf929a5['remoteUri']);_0xf929a5[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0xf929a5[_0x43e7('0x4b')]);if(_0x2646c2&&_0x2646c2[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x62'),_0x43e7('0x49'));_0x1ca24b['recordingURL']=util['format'](_0x43e7('0x4a'),_0xf929a5['serverUrl'],_0x1ca24b['uniqueid'],md5(_0x1ca24b['uniqueid']));}else{_0x1ca24b[_0x43e7('0x4d')]='';}return getConnection(_0xf929a5)[_0x43e7('0x21')](function(_0x230fda){_0x219dc6=_0x230fda;return getUser(_0xf929a5,'',_0x219dc6);})[_0x43e7('0x21')](function(_0x18713b){_0x556001=_0x18713b;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x556001['id']);return getEndUser(_0xf929a5,_0x1ca24b[_0x43e7('0x4f')],_0x1ca24b[_0x43e7('0x50')],_0x219dc6);})[_0x43e7('0x21')](function(_0x5b4c76){_0x17889c=_0x5b4c76;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x17889c['id']);return createTicket(_0xf929a5,_0x556001,_0x17889c,_0x506361,_0x1ca24b,_0x506361[_0x43e7('0x5d')],_0x219dc6);})[_0x43e7('0x21')](function(_0x1afea6){_0x38fa5b=_0x1afea6;logger[_0x43e7('0x14')](_0x43e7('0x5e'));logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x38fa5b['id']);})['catch'](function(_0x55990c){logger[_0x43e7('0x25')](_0x43e7('0x62'),JSON['stringify'](_0x55990c));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 7dc7d4b..1879a43 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 _0x5ee7=['%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','Authorization','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[ABANDONED]','The\x20Enduser\x20ID\x20is:','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','zendesk','localhost','socket.io-emitter','redis','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','merge','Tags','name','Subjects','Descriptions','getString','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','defaults','map','forEach','type','nameField','customField','toLowerCase','content','string','custom_fields','push','idField','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url'];(function(_0x51ffc8,_0x5f16b3){var _0x206334=function(_0x2faf96){while(--_0x2faf96){_0x51ffc8['push'](_0x51ffc8['shift']());}};_0x206334(++_0x5f16b3);}(_0x5ee7,0xdc));var _0x75ee=function(_0x3367d0,_0x44f510){_0x3367d0=_0x3367d0-0x0;var _0x19e45b=_0x5ee7[_0x3367d0];return _0x19e45b;};'use strict';var _=require(_0x75ee('0x0'));var rp=require(_0x75ee('0x1'));var md5=require(_0x75ee('0x2'));var util=require('util');var Redis=require(_0x75ee('0x3'));var intUtil=require('./util');var config=require(_0x75ee('0x4'));var logger=require(_0x75ee('0x5'))(_0x75ee('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x75ee('0x7'),'port':0x18eb});var io=require(_0x75ee('0x8'))(new Redis(config[_0x75ee('0x9')]));function emit(_0x5a3126,_0x677dd2,_0x2c5537){io['to'](_0x5a3126)[_0x75ee('0xa')](_0x677dd2,_0x2c5537);}var headers={'Content-Type':_0x75ee('0xb'),'Accept':_0x75ee('0xb')};function getTicket(_0x1e1f97,_0x3419f1,_0x1e3cfa,_0x447d94,_0x1ca197){logger[_0x75ee('0xc')](_0x75ee('0xd'));return request({'uri':util[_0x75ee('0xe')](_0x75ee('0xf'),_0x1e1f97['remoteUri']),'method':'POST','body':{'ticket':_[_0x75ee('0x10')]({'requester_id':_0x1e3cfa['id'],'submitter_id':_0x3419f1?_0x3419f1['id']:undefined,'assignee_id':_0x3419f1?_0x3419f1['id']:undefined,'tags':getTags(_0x447d94[_0x75ee('0x11')],_0x75ee('0x12')),'subject':intUtil['getString'](_0x447d94[_0x75ee('0x13')],_0x1ca197,'\x20'),'description':intUtil['getString'](_0x447d94[_0x75ee('0x14')],_0x1ca197,'\x0a'),'comment':{'public':![],'body':intUtil[_0x75ee('0x15')](_0x447d94[_0x75ee('0x14')],_0x1ca197,'\x0a')}},getCustomFields(_0x447d94['Fields'],_0x1ca197))}})[_0x75ee('0x16')](function(_0x163fa9){logger[_0x75ee('0xc')](_0x75ee('0x17'));return _0x163fa9['ticket'];});}function getUser(_0x4597da,_0x70be9e){if(intUtil[_0x75ee('0x18')](_0x70be9e)){logger['info'](_0x75ee('0x19'),_0x70be9e);return request({'uri':util['format'](_0x75ee('0x1a'),_0x4597da[_0x75ee('0x1b')]),'qs':{'query':util['format'](_0x75ee('0x1c'),_0x70be9e)}})[_0x75ee('0x16')](function(_0x2267e9){if(_0x2267e9[_0x75ee('0x1d')]){logger[_0x75ee('0xc')](_0x75ee('0x1e'));return _[_0x75ee('0x1f')](_0x2267e9[_0x75ee('0x20')],{'email':_0x70be9e,'role':_0x75ee('0x21')});}else{logger[_0x75ee('0xc')](_0x75ee('0x22'));return request({'uri':util['format'](_0x75ee('0x23'),_0x4597da[_0x75ee('0x1b')])})[_0x75ee('0x16')](function(_0xa281f5){logger[_0x75ee('0xc')](_0x75ee('0x24'));return _0xa281f5[_0x75ee('0x25')];});}});}else{logger[_0x75ee('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x75ee('0xe')]('%s/users/me.json',_0x4597da[_0x75ee('0x1b')])})['then'](function(_0x550e68){logger[_0x75ee('0xc')]('Admin\x20account\x20selected.');return _0x550e68[_0x75ee('0x25')];});}}function getEndUser(_0x442ad,_0x4f7d12,_0x23160f){logger[_0x75ee('0xc')](_0x75ee('0x26'),_0x23160f);return request({'uri':util[_0x75ee('0xe')](_0x75ee('0x1a'),_0x442ad[_0x75ee('0x1b')]),'qs':{'query':util['format'](_0x75ee('0x27'),_0x23160f)}})[_0x75ee('0x16')](function(_0x2a7743){var _0x25af7d;if(_0x2a7743[_0x75ee('0x20')][_0x75ee('0x28')]){_0x2a7743[_0x75ee('0x20')]=_[_0x75ee('0x29')](_0x2a7743['results'],{'suspended':![],'role':_0x75ee('0x2a')});if(_0x2a7743[_0x75ee('0x20')][_0x75ee('0x28')]){_0x25af7d=_['first'](_0x2a7743[_0x75ee('0x20')]);}}if(_0x25af7d){logger[_0x75ee('0xc')](_0x75ee('0x2b'));return _0x25af7d;}else{logger[_0x75ee('0xc')](_0x75ee('0x2c'));return request({'uri':util[_0x75ee('0xe')](_0x75ee('0x2d'),_0x442ad[_0x75ee('0x1b')]),'method':_0x75ee('0x2e'),'body':{'user':{'role':_0x75ee('0x2a'),'name':util[_0x75ee('0xe')]('Caller\x20-\x20%s',_0x4f7d12||_0x23160f),'phone':_0x23160f}}})[_0x75ee('0x16')](function(_0x3769e1){logger[_0x75ee('0xc')]('Enduser\x20created.');return _0x3769e1[_0x75ee('0x25')];});}});}function getAuth(_0x42b59e){var _0x118788;if(_0x42b59e['authType']===_0x75ee('0x2f')){_0x118788=util[_0x75ee('0xe')](_0x75ee('0x30'),_0x42b59e[_0x75ee('0x31')],_0x42b59e['password']);}else if(_0x42b59e[_0x75ee('0x32')]===_0x75ee('0x33')){_0x118788=util['format'](_0x75ee('0x34'),_0x42b59e[_0x75ee('0x31')],_0x42b59e[_0x75ee('0x33')]);}return util[_0x75ee('0xe')](_0x75ee('0x35'),new Buffer(_0x118788)[_0x75ee('0x36')]('base64'));}function request(_0x81260b){logger['debug']('[HTTP]',JSON['stringify'](_0x81260b));return rp(_[_0x75ee('0x37')](_0x81260b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1101b,_0x3c2407){var _0x4eee1b=[];if(_0x1101b&&_0x1101b[_0x75ee('0x28')]>0x0){_0x4eee1b=_[_0x75ee('0x38')](_0x1101b,_0x3c2407);}return _0x4eee1b;}function getCustomFields(_0x1ebcbf,_0x27acef){var _0x57d797=[];var _0x24ff20={'custom_fields':[]};if(_0x1ebcbf[_0x75ee('0x28')]>0x0){_[_0x75ee('0x39')](_0x1ebcbf,function(_0x1a69c8){if(_0x1a69c8[_0x75ee('0x3a')]==='string'&&_0x1a69c8[_0x75ee('0x3b')]&&!_0x1a69c8[_0x75ee('0x3c')]){_0x24ff20[_0x1a69c8[_0x75ee('0x3b')][_0x75ee('0x3d')]()]=_0x1a69c8[_0x75ee('0x3e')][_0x75ee('0x36')]();}else if(_0x1a69c8[_0x75ee('0x3a')]===_0x75ee('0x3f')&&_0x1a69c8['idField']&&_0x1a69c8['customField']){_0x24ff20[_0x75ee('0x40')][_0x75ee('0x41')]({'id':_0x1a69c8[_0x75ee('0x42')],'value':_0x1a69c8[_0x75ee('0x3e')][_0x75ee('0x36')]()});}else if(_0x1a69c8[_0x75ee('0x3a')]==='variable'&&_0x1a69c8['variableName']&&_0x1a69c8[_0x75ee('0x42')]&&_0x1a69c8['customField']){_0x27acef[_0x1a69c8['variableName']]&&_0x24ff20['custom_fields']['push']({'id':_0x1a69c8[_0x75ee('0x42')],'value':_0x27acef[_0x1a69c8[_0x75ee('0x43')]][_0x75ee('0x36')]()});}else if(_0x1a69c8[_0x75ee('0x3a')]==='customVariable'&&_0x1a69c8[_0x75ee('0x44')]&&_0x1a69c8['Variable'][_0x75ee('0x12')]&&_0x1a69c8[_0x75ee('0x42')]&&_0x1a69c8['customField']){_0x27acef[_0x1a69c8[_0x75ee('0x44')][_0x75ee('0x12')][_0x75ee('0x3d')]()]&&_0x24ff20[_0x75ee('0x40')][_0x75ee('0x41')]({'id':_0x1a69c8[_0x75ee('0x42')],'value':_0x27acef[_0x1a69c8['Variable'][_0x75ee('0x12')]['toLowerCase']()][_0x75ee('0x36')]()});}});}return _0x24ff20;}exports[_0x75ee('0x45')]=function(_0x4b73ba,_0x50cda0,_0x2e7971,_0x416eea,_0x16ac86,_0x15ad7f){var _0x1347f8,_0x31fb95;_0x15ad7f['remoteUri']=intUtil['stripTrailingSlash'](_0x15ad7f[_0x75ee('0x1b')]);_0x15ad7f[_0x75ee('0x46')]=intUtil[_0x75ee('0x47')](_0x15ad7f[_0x75ee('0x46')]);if(_0x16ac86&&_0x16ac86[_0x75ee('0x48')]){logger[_0x75ee('0xc')](_0x75ee('0x49'),_0x75ee('0x4a'));_0x50cda0[_0x75ee('0x4b')]=util[_0x75ee('0xe')](_0x75ee('0x4c'),_0x15ad7f[_0x75ee('0x46')],_0x50cda0[_0x75ee('0x4d')],md5(_0x50cda0[_0x75ee('0x4d')]));}else{_0x50cda0[_0x75ee('0x4b')]='';}headers['Authorization']=getAuth(_0x15ad7f);return getUser(_0x15ad7f,_0x416eea[_0x75ee('0x4e')])[_0x75ee('0x16')](function(_0x1644ec){_0x1347f8=_0x1644ec;logger[_0x75ee('0xc')](_0x75ee('0x4f'),_0x1347f8['id']);return getEndUser(_0x15ad7f,_0x50cda0[_0x75ee('0x50')],_0x50cda0[_0x75ee('0x51')]);})[_0x75ee('0x16')](function(_0x2963ce){_0x31fb95=_0x2963ce;logger[_0x75ee('0xc')]('The\x20Enduser\x20ID\x20is:',_0x31fb95['id']);return getTicket(_0x15ad7f,_0x1347f8,_0x31fb95,_0x2e7971,_0x50cda0);})['then'](function(_0x1a7f81){if(_0x1a7f81){logger[_0x75ee('0xc')](_0x75ee('0x52'),_0x1a7f81['id']);switch(_0x15ad7f[_0x75ee('0x3a')]){case _0x75ee('0x53'):logger[_0x75ee('0xc')](_0x75ee('0x49'),_0x75ee('0x54'));return request({'uri':util[_0x75ee('0xe')](_0x75ee('0x55'),_0x15ad7f[_0x75ee('0x1b')],_0x1347f8['id'],_0x1a7f81['id']),'method':_0x75ee('0x2e')});case _0x75ee('0x56'):logger[_0x75ee('0xc')](_0x75ee('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x75ee('0xe')](_0x75ee('0x57'),_0x416eea[_0x75ee('0x12')]),_0x75ee('0x58'),{'uri':util['format'](_0x75ee('0x59'),_0x15ad7f[_0x75ee('0x1b')],_0x1a7f81['id'])});break;default:logger[_0x75ee('0x5a')](_0x75ee('0x49'),_0x75ee('0x5b'));}}})[_0x75ee('0x5c')](function(_0x525478){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x75ee('0x5d')](_0x525478,{'showHidden':!![],'depth':null}));});};exports[_0x75ee('0x5e')]=function(_0x151153,_0x361f5b,_0x127708,_0x1aea56,_0x5f2b79,_0x1e47cc,_0xb130a1){var _0x549422,_0x203a8b;_0x1e47cc['remoteUri']=intUtil[_0x75ee('0x47')](_0x1e47cc[_0x75ee('0x1b')]);_0x1e47cc[_0x75ee('0x46')]=intUtil[_0x75ee('0x47')](_0x1e47cc[_0x75ee('0x46')]);if(_0xb130a1&&_0xb130a1[_0x75ee('0x5f')]&&_0xb130a1[_0x75ee('0x5f')]!==_0x75ee('0x60')){logger[_0x75ee('0xc')](_0x75ee('0x61'),_0x75ee('0x4a'));_0x361f5b[_0x75ee('0x4b')]=util[_0x75ee('0xe')](_0x75ee('0x4c'),_0x1e47cc['serverUrl'],_0x361f5b['uniqueid'],md5(_0x361f5b[_0x75ee('0x4d')]));}headers[_0x75ee('0x62')]=getAuth(_0x1e47cc);return getUser(_0x1e47cc,_0x1aea56[_0x75ee('0x4e')])[_0x75ee('0x16')](function(_0x355948){_0x549422=_0x355948;logger['info'](_0x75ee('0x4f'),_0x549422['id']);return getEndUser(_0x1e47cc,_0x361f5b['destcalleridname'],_0x361f5b['destcalleridnum']);})['then'](function(_0x2c2ac7){_0x203a8b=_0x2c2ac7;logger['info']('The\x20Enduser\x20ID\x20is:',_0x203a8b['id']);return getTicket(_0x1e47cc,_0x549422,_0x203a8b,_0x127708,_0x361f5b);})[_0x75ee('0x16')](function(_0x1a6861){if(_0x1a6861){logger[_0x75ee('0xc')](_0x75ee('0x52'),_0x1a6861['id']);switch(_0x1e47cc['type']){case _0x75ee('0x53'):logger[_0x75ee('0xc')](_0x75ee('0x61'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x75ee('0xe')](_0x75ee('0x55'),_0x1e47cc[_0x75ee('0x1b')],_0x549422['id'],_0x1a6861['id']),'method':'POST'});case _0x75ee('0x56'):logger[_0x75ee('0xc')](_0x75ee('0x61'),_0x75ee('0x63'));emit(util[_0x75ee('0xe')](_0x75ee('0x57'),_0x1aea56['name']),'trigger:browser:url',{'uri':util['format'](_0x75ee('0x59'),_0x1e47cc[_0x75ee('0x1b')],_0x1a6861['id'])});break;default:logger[_0x75ee('0x5a')]('[OUTBOUND]',_0x75ee('0x5b'));}}})[_0x75ee('0x5c')](function(_0x46843f){logger[_0x75ee('0x5a')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x46843f,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x1fc70c,_0x22e306,_0x1c1d39,_0x3bedc7,_0x577541,_0x4be02f){var _0x41f10b,_0x22e1a9;_0x4be02f[_0x75ee('0x1b')]=intUtil['stripTrailingSlash'](_0x4be02f[_0x75ee('0x1b')]);_0x4be02f['serverUrl']=intUtil[_0x75ee('0x47')](_0x4be02f['serverUrl']);if(_0x577541&&_0x577541[_0x75ee('0x48')]){logger[_0x75ee('0xc')](_0x75ee('0x64'),_0x75ee('0x4a'));_0x22e306['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4be02f[_0x75ee('0x46')],_0x22e306['uniqueid'],md5(_0x22e306['uniqueid']));}else{_0x22e306[_0x75ee('0x4b')]='';}headers[_0x75ee('0x62')]=getAuth(_0x4be02f);return getUser(_0x4be02f)['then'](function(_0x15f549){_0x41f10b=_0x15f549;logger[_0x75ee('0xc')](_0x75ee('0x4f'),_0x41f10b['id']);return getEndUser(_0x4be02f,_0x22e306[_0x75ee('0x50')],_0x22e306[_0x75ee('0x51')]);})[_0x75ee('0x16')](function(_0x412b10){_0x22e1a9=_0x412b10;logger[_0x75ee('0xc')](_0x75ee('0x65'),_0x22e1a9['id']);return getTicket(_0x4be02f,_0x41f10b,_0x22e1a9,_0x1c1d39,_0x22e306);})[_0x75ee('0x16')](function(_0x148a69){if(_0x148a69){logger['info'](_0x75ee('0x52'),_0x148a69['id']);}})['catch'](function(_0x28dabb){logger[_0x75ee('0x5a')](_0x75ee('0x66'),util[_0x75ee('0x5d')](_0x28dabb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe829=['user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','monitor_format','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','agent','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','customField','nameField','toLowerCase','content','idField','custom_fields','push','type','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json'];(function(_0x420282,_0x1f941f){var _0x535480=function(_0x18cddc){while(--_0x18cddc){_0x420282['push'](_0x420282['shift']());}};_0x535480(++_0x1f941f);}(_0xe829,0x1d8));var _0x9e82=function(_0x115966,_0x47faf0){_0x115966=_0x115966-0x0;var _0x54b11b=_0xe829[_0x115966];return _0x54b11b;};'use strict';var _=require(_0x9e82('0x0'));var rp=require(_0x9e82('0x1'));var md5=require(_0x9e82('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x9e82('0x3'));var config=require(_0x9e82('0x4'));var logger=require(_0x9e82('0x5'))(_0x9e82('0x6'));config[_0x9e82('0x7')]=_[_0x9e82('0x8')](config['redis'],{'host':_0x9e82('0x9'),'port':0x18eb});var io=require(_0x9e82('0xa'))(new Redis(config[_0x9e82('0x7')]));function emit(_0x7cebd4,_0x2d91ba,_0x5c4c57){io['to'](_0x7cebd4)[_0x9e82('0xb')](_0x2d91ba,_0x5c4c57);}var headers={'Content-Type':'application/json','Accept':_0x9e82('0xc')};function getTicket(_0x13070b,_0x51ab6d,_0x5965b0,_0x4513a8,_0x4622c5){logger[_0x9e82('0xd')](_0x9e82('0xe'));return request({'uri':util[_0x9e82('0xf')](_0x9e82('0x10'),_0x13070b[_0x9e82('0x11')]),'method':_0x9e82('0x12'),'body':{'ticket':_[_0x9e82('0x13')]({'requester_id':_0x5965b0['id'],'submitter_id':_0x51ab6d?_0x51ab6d['id']:undefined,'assignee_id':_0x51ab6d?_0x51ab6d['id']:undefined,'tags':getTags(_0x4513a8[_0x9e82('0x14')],_0x9e82('0x15')),'subject':intUtil[_0x9e82('0x16')](_0x4513a8['Subjects'],_0x4622c5,'\x20'),'description':intUtil['getString'](_0x4513a8[_0x9e82('0x17')],_0x4622c5,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9e82('0x16')](_0x4513a8[_0x9e82('0x17')],_0x4622c5,'\x0a')}},getCustomFields(_0x4513a8[_0x9e82('0x18')],_0x4622c5))}})['then'](function(_0x1319cc){logger[_0x9e82('0xd')](_0x9e82('0x19'));return _0x1319cc[_0x9e82('0x1a')];});}function getUser(_0x51aa1e,_0x11b7ea){if(intUtil[_0x9e82('0x1b')](_0x11b7ea)){logger[_0x9e82('0xd')](_0x9e82('0x1c'),_0x11b7ea);return request({'uri':util['format']('%s/search.json',_0x51aa1e['remoteUri']),'qs':{'query':util[_0x9e82('0xf')](_0x9e82('0x1d'),_0x11b7ea)}})[_0x9e82('0x1e')](function(_0x44b6c0){if(_0x44b6c0[_0x9e82('0x1f')]){logger['info'](_0x9e82('0x20'));return _[_0x9e82('0x21')](_0x44b6c0[_0x9e82('0x22')],{'email':_0x11b7ea,'role':_0x9e82('0x23')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x9e82('0xf')](_0x9e82('0x24'),_0x51aa1e[_0x9e82('0x11')])})[_0x9e82('0x1e')](function(_0x177155){logger[_0x9e82('0xd')]('Admin\x20account\x20selected.');return _0x177155[_0x9e82('0x25')];});}});}else{logger[_0x9e82('0xd')](_0x9e82('0x26'));return request({'uri':util[_0x9e82('0xf')](_0x9e82('0x24'),_0x51aa1e['remoteUri'])})[_0x9e82('0x1e')](function(_0x4a628c){logger[_0x9e82('0xd')]('Admin\x20account\x20selected.');return _0x4a628c[_0x9e82('0x25')];});}}function getEndUser(_0x3911cb,_0x2ff9ae,_0x9b36c5){logger[_0x9e82('0xd')](_0x9e82('0x27'),_0x9b36c5);return request({'uri':util[_0x9e82('0xf')](_0x9e82('0x28'),_0x3911cb[_0x9e82('0x11')]),'qs':{'query':util[_0x9e82('0xf')](_0x9e82('0x29'),_0x9b36c5)}})['then'](function(_0x3d7932){var _0x280939;if(_0x3d7932[_0x9e82('0x22')][_0x9e82('0x2a')]){_0x3d7932[_0x9e82('0x22')]=_[_0x9e82('0x2b')](_0x3d7932[_0x9e82('0x22')],{'suspended':![],'role':_0x9e82('0x2c')});if(_0x3d7932[_0x9e82('0x22')][_0x9e82('0x2a')]){_0x280939=_[_0x9e82('0x2d')](_0x3d7932[_0x9e82('0x22')]);}}if(_0x280939){logger[_0x9e82('0xd')](_0x9e82('0x2e'));return _0x280939;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x9e82('0xf')](_0x9e82('0x2f'),_0x3911cb[_0x9e82('0x11')]),'method':_0x9e82('0x12'),'body':{'user':{'role':_0x9e82('0x2c'),'name':util[_0x9e82('0xf')](_0x9e82('0x30'),_0x2ff9ae||_0x9b36c5),'phone':_0x9b36c5}}})[_0x9e82('0x1e')](function(_0x16ceae){logger[_0x9e82('0xd')]('Enduser\x20created.');return _0x16ceae[_0x9e82('0x25')];});}});}function getAuth(_0x428cb1){var _0x5747a5;if(_0x428cb1[_0x9e82('0x31')]===_0x9e82('0x32')){_0x5747a5=util[_0x9e82('0xf')](_0x9e82('0x33'),_0x428cb1[_0x9e82('0x34')],_0x428cb1[_0x9e82('0x32')]);}else if(_0x428cb1[_0x9e82('0x31')]==='token'){_0x5747a5=util[_0x9e82('0xf')]('%s/token:%s',_0x428cb1['username'],_0x428cb1[_0x9e82('0x35')]);}return util[_0x9e82('0xf')](_0x9e82('0x36'),new Buffer(_0x5747a5)[_0x9e82('0x37')]('base64'));}function request(_0x5f11c0){logger[_0x9e82('0x38')](_0x9e82('0x39'),JSON[_0x9e82('0x3a')](_0x5f11c0));return rp(_[_0x9e82('0x8')](_0x5f11c0,{'method':_0x9e82('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x151ee5,_0x26b921){var _0x191725=[];if(_0x151ee5&&_0x151ee5[_0x9e82('0x2a')]>0x0){_0x191725=_[_0x9e82('0x3c')](_0x151ee5,_0x26b921);}return _0x191725;}function getCustomFields(_0x56973f,_0x3f0ded){var _0x1f42da=[];var _0x345670={'custom_fields':[]};if(_0x56973f[_0x9e82('0x2a')]>0x0){_[_0x9e82('0x3d')](_0x56973f,function(_0x51d435){if(_0x51d435['type']==='string'&&_0x51d435['nameField']&&!_0x51d435[_0x9e82('0x3e')]){_0x345670[_0x51d435[_0x9e82('0x3f')][_0x9e82('0x40')]()]=_0x51d435[_0x9e82('0x41')][_0x9e82('0x37')]();}else if(_0x51d435['type']==='string'&&_0x51d435[_0x9e82('0x42')]&&_0x51d435[_0x9e82('0x3e')]){_0x345670[_0x9e82('0x43')][_0x9e82('0x44')]({'id':_0x51d435['idField'],'value':_0x51d435[_0x9e82('0x41')][_0x9e82('0x37')]()});}else if(_0x51d435[_0x9e82('0x45')]==='variable'&&_0x51d435['variableName']&&_0x51d435[_0x9e82('0x42')]&&_0x51d435['customField']){_0x3f0ded[_0x51d435[_0x9e82('0x46')]]&&_0x345670[_0x9e82('0x43')]['push']({'id':_0x51d435[_0x9e82('0x42')],'value':_0x3f0ded[_0x51d435[_0x9e82('0x46')]][_0x9e82('0x37')]()});}else if(_0x51d435[_0x9e82('0x45')]===_0x9e82('0x47')&&_0x51d435[_0x9e82('0x48')]&&_0x51d435['Variable'][_0x9e82('0x15')]&&_0x51d435['idField']&&_0x51d435[_0x9e82('0x3e')]){_0x3f0ded[_0x51d435[_0x9e82('0x48')][_0x9e82('0x15')][_0x9e82('0x40')]()]&&_0x345670['custom_fields'][_0x9e82('0x44')]({'id':_0x51d435[_0x9e82('0x42')],'value':_0x3f0ded[_0x51d435[_0x9e82('0x48')]['name'][_0x9e82('0x40')]()][_0x9e82('0x37')]()});}});}return _0x345670;}exports[_0x9e82('0x49')]=function(_0x7c97e0,_0x2d3a78,_0x545db3,_0x282ae7,_0x42243a,_0xca10b4){var _0x2164ca,_0x52a7a8;_0xca10b4['remoteUri']=intUtil[_0x9e82('0x4a')](_0xca10b4[_0x9e82('0x11')]);_0xca10b4[_0x9e82('0x4b')]=intUtil[_0x9e82('0x4a')](_0xca10b4[_0x9e82('0x4b')]);if(_0x42243a&&_0x42243a['monitor_format']){logger[_0x9e82('0xd')](_0x9e82('0x4c'),_0x9e82('0x4d'));_0x2d3a78[_0x9e82('0x4e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xca10b4[_0x9e82('0x4b')],_0x2d3a78['uniqueid'],md5(_0x2d3a78['uniqueid']));}else{_0x2d3a78[_0x9e82('0x4e')]='';}headers[_0x9e82('0x4f')]=getAuth(_0xca10b4);return getUser(_0xca10b4,_0x282ae7[_0x9e82('0x50')])[_0x9e82('0x1e')](function(_0x11cf8c){_0x2164ca=_0x11cf8c;logger[_0x9e82('0xd')](_0x9e82('0x51'),_0x2164ca['id']);return getEndUser(_0xca10b4,_0x2d3a78[_0x9e82('0x52')],_0x2d3a78[_0x9e82('0x53')]);})[_0x9e82('0x1e')](function(_0x14ef67){_0x52a7a8=_0x14ef67;logger[_0x9e82('0xd')]('The\x20Enduser\x20ID\x20is:',_0x52a7a8['id']);return getTicket(_0xca10b4,_0x2164ca,_0x52a7a8,_0x545db3,_0x2d3a78);})[_0x9e82('0x1e')](function(_0x555719){if(_0x555719){logger[_0x9e82('0xd')](_0x9e82('0x54'),_0x555719['id']);switch(_0xca10b4['type']){case _0x9e82('0x55'):logger[_0x9e82('0xd')]('[QUEUE]',_0x9e82('0x56'));return request({'uri':util[_0x9e82('0xf')](_0x9e82('0x57'),_0xca10b4[_0x9e82('0x11')],_0x2164ca['id'],_0x555719['id']),'method':_0x9e82('0x12')});case'newTab':logger['info'](_0x9e82('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x9e82('0x58'),_0x282ae7[_0x9e82('0x15')]),_0x9e82('0x59'),{'uri':util[_0x9e82('0xf')](_0x9e82('0x5a'),_0xca10b4[_0x9e82('0x11')],_0x555719['id'])});break;default:logger[_0x9e82('0x5b')]('[QUEUE]',_0x9e82('0x5c'));}}})[_0x9e82('0x5d')](function(_0x563314){logger['error'](_0x9e82('0x5e'),util[_0x9e82('0x5f')](_0x563314,{'showHidden':!![],'depth':null}));});};exports[_0x9e82('0x60')]=function(_0xf2060a,_0x163947,_0xf2723,_0x13a50a,_0x334512,_0x4ef528,_0x4da3aa){var _0x812b6c,_0x32543a;_0x4ef528[_0x9e82('0x11')]=intUtil[_0x9e82('0x4a')](_0x4ef528[_0x9e82('0x11')]);_0x4ef528['serverUrl']=intUtil[_0x9e82('0x4a')](_0x4ef528[_0x9e82('0x4b')]);if(_0x4da3aa&&_0x4da3aa[_0x9e82('0x61')]&&_0x4da3aa[_0x9e82('0x61')]!==_0x9e82('0x62')){logger[_0x9e82('0xd')]('[OUTBOUND]',_0x9e82('0x4d'));_0x163947[_0x9e82('0x4e')]=util[_0x9e82('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4ef528['serverUrl'],_0x163947[_0x9e82('0x63')],md5(_0x163947[_0x9e82('0x63')]));}headers['Authorization']=getAuth(_0x4ef528);return getUser(_0x4ef528,_0x13a50a[_0x9e82('0x50')])['then'](function(_0x366492){_0x812b6c=_0x366492;logger['info'](_0x9e82('0x51'),_0x812b6c['id']);return getEndUser(_0x4ef528,_0x163947[_0x9e82('0x64')],_0x163947[_0x9e82('0x65')]);})[_0x9e82('0x1e')](function(_0x4661f0){_0x32543a=_0x4661f0;logger[_0x9e82('0xd')](_0x9e82('0x66'),_0x32543a['id']);return getTicket(_0x4ef528,_0x812b6c,_0x32543a,_0xf2723,_0x163947);})[_0x9e82('0x1e')](function(_0xc57647){if(_0xc57647){logger[_0x9e82('0xd')](_0x9e82('0x54'),_0xc57647['id']);switch(_0x4ef528[_0x9e82('0x45')]){case _0x9e82('0x55'):logger[_0x9e82('0xd')](_0x9e82('0x67'),_0x9e82('0x56'));return request({'uri':util[_0x9e82('0xf')](_0x9e82('0x57'),_0x4ef528[_0x9e82('0x11')],_0x812b6c['id'],_0xc57647['id']),'method':_0x9e82('0x12')});case _0x9e82('0x68'):logger[_0x9e82('0xd')](_0x9e82('0x67'),_0x9e82('0x69'));emit(util['format']('user:%s',_0x13a50a[_0x9e82('0x15')]),'trigger:browser:url',{'uri':util['format'](_0x9e82('0x5a'),_0x4ef528[_0x9e82('0x11')],_0xc57647['id'])});break;default:logger[_0x9e82('0x5b')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x9e82('0x5d')](function(_0x541f28){logger[_0x9e82('0x5b')](_0x9e82('0x6a'),util['inspect'](_0x541f28,{'showHidden':!![],'depth':null}));});};exports[_0x9e82('0x6b')]=function(_0x1eeddc,_0xe37d07,_0x137168,_0x35f6bc,_0x1de8f5,_0xd856f1){var _0x502d2c,_0x5c1bcd;_0xd856f1[_0x9e82('0x11')]=intUtil['stripTrailingSlash'](_0xd856f1[_0x9e82('0x11')]);_0xd856f1[_0x9e82('0x4b')]=intUtil['stripTrailingSlash'](_0xd856f1['serverUrl']);if(_0x1de8f5&&_0x1de8f5[_0x9e82('0x6c')]){logger[_0x9e82('0xd')](_0x9e82('0x6d'),_0x9e82('0x4d'));_0xe37d07[_0x9e82('0x4e')]=util[_0x9e82('0xf')](_0x9e82('0x6e'),_0xd856f1['serverUrl'],_0xe37d07[_0x9e82('0x63')],md5(_0xe37d07[_0x9e82('0x63')]));}else{_0xe37d07[_0x9e82('0x4e')]='';}headers[_0x9e82('0x4f')]=getAuth(_0xd856f1);return getUser(_0xd856f1)[_0x9e82('0x1e')](function(_0x3403e3){_0x502d2c=_0x3403e3;logger['info'](_0x9e82('0x51'),_0x502d2c['id']);return getEndUser(_0xd856f1,_0xe37d07[_0x9e82('0x52')],_0xe37d07[_0x9e82('0x53')]);})['then'](function(_0x4c1c2b){_0x5c1bcd=_0x4c1c2b;logger[_0x9e82('0xd')](_0x9e82('0x66'),_0x5c1bcd['id']);return getTicket(_0xd856f1,_0x502d2c,_0x5c1bcd,_0x137168,_0xe37d07);})[_0x9e82('0x1e')](function(_0x338adc){if(_0x338adc){logger[_0x9e82('0xd')](_0x9e82('0x54'),_0x338adc['id']);}})[_0x9e82('0x5d')](function(_0x3e4a85){logger[_0x9e82('0x5b')](_0x9e82('0x6f'),util[_0x9e82('0x5f')](_0x3e4a85,{'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 eda56d8..39c75ce 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 _0x5074=['stringify','length','type','string','idField','content','variableName','toString','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','catch','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','findIndex','profile','Administrator','user','error','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Leads','Owner','administrator','Subject','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','called','Called','complete','connect','Answered','rejected','Abandoned','Call_Start_Time','outbound','starttime','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','stack','host','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','abandoned','[ABANDONED]','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug'];(function(_0x4a728e,_0x1adcf5){var _0x131f1d=function(_0x3fe66b){while(--_0x3fe66b){_0x4a728e['push'](_0x4a728e['shift']());}};_0x131f1d(++_0x1adcf5);}(_0x5074,0x1af));var _0x4507=function(_0x5224ba,_0x3fb4e1){_0x5224ba=_0x5224ba-0x0;var _0x459bd2=_0x5074[_0x5224ba];return _0x459bd2;};'use strict';var _=require(_0x4507('0x0'));var rp=require(_0x4507('0x1'));var md5=require(_0x4507('0x2'));var util=require(_0x4507('0x3'));var intUtil=require(_0x4507('0x4'));var moment=require(_0x4507('0x5'));var Redis=require(_0x4507('0x6'));var BPromise=require(_0x4507('0x7'));var config=require(_0x4507('0x8'));var logger=require(_0x4507('0x9'))(_0x4507('0xa'));config[_0x4507('0xb')]=_[_0x4507('0xc')](config[_0x4507('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x4507('0xd'))(new Redis(config[_0x4507('0xb')]));function emit(_0x334bcf,_0x5449fa,_0x19ef97){io['to'](_0x334bcf)[_0x4507('0xe')](_0x5449fa,_0x19ef97);}function request(_0x189635){logger[_0x4507('0xf')]('[HTTP]',JSON[_0x4507('0x10')](_0x189635));return rp(_0x189635);}function getCustomFields(_0xdbc97c,_0x56cc4e){var _0x53ad6e={};if(_0xdbc97c[_0x4507('0x11')]>0x0){_['forEach'](_0xdbc97c,function(_0x27da3b){if(_0x27da3b[_0x4507('0x12')]===_0x4507('0x13')&&_0x27da3b[_0x4507('0x14')]){_0x53ad6e[_0x27da3b['idField']]=_0x27da3b[_0x4507('0x15')]['toString']();}else if(_0x27da3b[_0x4507('0x12')]==='variable'&&_0x27da3b[_0x4507('0x16')]&&_0x27da3b[_0x4507('0x14')]&&_0x56cc4e[_0x27da3b[_0x4507('0x16')]]){_0x53ad6e[_0x27da3b[_0x4507('0x14')]]=_0x56cc4e[_0x27da3b[_0x4507('0x16')]][_0x4507('0x17')]();}else if(_0x27da3b['type']==='customVariable'&&_0x27da3b[_0x4507('0x18')]&&_0x27da3b[_0x4507('0x18')]['name']&&_0x27da3b['idField']&&_0x56cc4e[_0x27da3b[_0x4507('0x18')]['name']['toLowerCase']()]){_0x53ad6e[_0x27da3b[_0x4507('0x14')]]=_0x56cc4e[_0x27da3b[_0x4507('0x18')][_0x4507('0x19')][_0x4507('0x1a')]()][_0x4507('0x17')]();}});}return _0x53ad6e;}function getName(_0x3140a5){if(_0x3140a5['indexOf']('\x20')>0x0){var _0x1a00c8=_0x3140a5[_0x4507('0x1b')](/ (.+)/);if(_0x1a00c8[0x1]){return _0x1a00c8;}}return[_0x3140a5,_0x3140a5];}var accountsTokens={};function getAccessToken(_0x5f2d50){return new Promise(function(_0x2e3236,_0x1f5929){if(!_[_0x4507('0x1c')](accountsTokens[_0x5f2d50['id']])&&!_['isNil'](accountsTokens[_0x5f2d50['id']]['access_token'])){if(moment()[_0x4507('0x1d')](accountsTokens[_0x5f2d50['id']][_0x4507('0x1e')])){_0x2e3236(accountsTokens[_0x5f2d50['id']][_0x4507('0x1f')]);}}var _0x17f379;switch(_0x5f2d50[_0x4507('0x20')]){case'US':_0x17f379=_0x4507('0x21');break;case'AU':_0x17f379=_0x4507('0x22');break;case'EU':_0x17f379=_0x4507('0x23');break;case'IN':_0x17f379=_0x4507('0x24');break;case'CN':_0x17f379=_0x4507('0x25');break;default:_0x17f379=_0x4507('0x23');break;}var _0x3b02cb={'method':_0x4507('0x26'),'uri':_0x17f379+_0x4507('0x27'),'qs':{'refresh_token':_0x5f2d50[_0x4507('0x28')],'client_id':_0x5f2d50[_0x4507('0x29')],'client_secret':_0x5f2d50[_0x4507('0x2a')],'grant_type':_0x4507('0x2b')},'json':!![]};return rp(_0x3b02cb)[_0x4507('0x2c')](function(_0x5a8587){accountsTokens[_0x5f2d50['id']]={'access_token':_0x5a8587['access_token'],'expires_in':moment()['add'](_0x5a8587[_0x4507('0x1e')],'seconds')};_0x2e3236(_0x5a8587[_0x4507('0x1f')]);})[_0x4507('0x2d')](function(_0x163664){logger['error'](_0x4507('0x2e'),_0x163664['stack']);_0x1f5929(_0x163664);});});}function getUser(_0x18f3ce,_0x24a65a,_0x120f84,_0x11f8a7){logger[_0x4507('0x2f')](_0x4507('0x30'));return request({'method':_0x4507('0x31'),'uri':util[_0x4507('0x32')]('https://www.zohoapis.%s/crm/v2/users',_0x24a65a),'qs':{'type':_0x4507('0x33')},'headers':{'Authorization':_0x4507('0x34')+_0x18f3ce},'json':!![]})[_0x4507('0x2c')](function(_0x2a388f){if(_0x2a388f[_0x4507('0x35')]){var _0x177e77=-0x1;if(_[_0x4507('0x36')](_0x2a388f['users'])){if(!_['isNil'](_0x11f8a7)){_0x177e77=_['findIndex'](_0x2a388f['users'],function(_0x128a0a){return _0x128a0a[_0x4507('0x37')]===_0x11f8a7;});}if(_0x177e77>=0x0){logger['info']('Agent\x20found!');}else{logger['info']('Using\x20the\x20admin\x20account!');_0x177e77=_[_0x4507('0x38')](_0x2a388f['users'],function(_0x11d0f4){return _0x11d0f4[_0x4507('0x39')][_0x4507('0x19')]===_0x4507('0x3a');});}return _0x2a388f[_0x4507('0x35')][_0x177e77];}else{if(_0x2a388f[_0x4507('0x3b')][_0x4507('0x39')][_0x4507('0x19')]===_0x4507('0x3a')){logger[_0x4507('0x2f')]('Using\x20the\x20admin\x20account!');user=_0x2a388f[_0x4507('0x3b')];return user;}else{logger[_0x4507('0x3c')](_0x4507('0x3d'),JSON[_0x4507('0x10')](_0x2a388f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x4507('0x10')](_0x2a388f));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x4507('0x10')](_0x2a388f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x4507('0x10')](_0x2a388f));}})['catch'](function(_0x10b111){console['error'](_0x10b111);});}function getZohoUser(_0x2007bf,_0x514b16){return new BPromise(function(_0x2bd110,_0x6ad431){request(_0x2007bf)[_0x4507('0x2c')](function(_0x45d9da){var _0x59cedd=null;if(_0x45d9da){_0x59cedd=_0x45d9da[_0x4507('0x3e')][0x0];_0x59cedd[_0x4507('0x3f')]=_0x514b16;}_0x2bd110(_0x59cedd);})[_0x4507('0x2d')](function(_0x49ce71){_0x6ad431(_0x49ce71);});});}function createEndUser(_0x25c188,_0x76e6a2,_0x140fc0,_0x33c70b,_0x288458,_0x4ea24b){var _0x140fc0=getName(_0x140fc0);return request({'method':_0x4507('0x26'),'uri':_0x4507('0x40')+_0x76e6a2+_0x4507('0x41')+_[_0x4507('0x42')](_0x4ea24b[_0x4507('0x43')])+'s','body':{'data':[{'Last_Name':_0x140fc0[0x1],'First_Name':_0x140fc0[0x0],'Phone':_0x33c70b,'Owner':{'name':!_[_0x4507('0x1c')](_0x288458['role'][_0x4507('0x19')])?_0x288458[_0x4507('0x44')][_0x4507('0x19')]:!_[_0x4507('0x1c')](_0x288458[_0x4507('0x45')])?_0x288458[_0x4507('0x45')]+'\x20'+_0x288458[_0x4507('0x46')]:_0x288458[_0x4507('0x46')],'id':_0x288458['id']}}]},'headers':{'Authorization':_0x4507('0x34')+_0x25c188},'json':!![]})[_0x4507('0x2c')](function(_0x58aac5){if(_0x58aac5&&_0x58aac5['data'][0x0][_0x4507('0x47')]==='SUCCESS'){var _0x14e1aa=_0x58aac5[_0x4507('0x3e')][0x0][_0x4507('0x48')];_0x14e1aa[_0x4507('0x3f')]=_[_0x4507('0x42')](_0x4ea24b[_0x4507('0x43')])+'s';return _0x14e1aa;}logger['error'](_0x4507('0x3d'),JSON[_0x4507('0x10')](data));throw new Error(_0x4507('0x49')+JSON[_0x4507('0x10')](data));})['catch'](function(_0x1e6cea){console[_0x4507('0x4a')](_0x4507('0x4b'),_0x1e6cea);});}function getEndUser(_0x21ddfe,_0x1c073a,_0x326398,_0x18860d,_0x42c3f8,_0x3c5f82,_0x247c6f){var _0x3b270a={'method':_0x4507('0x31'),'uri':'','headers':{'Authorization':_0x4507('0x34')+_0x21ddfe},'json':!![]};switch(_0x247c6f[_0x4507('0x4c')]){case'contact_lead':_0x3b270a['uri']='https://www.zohoapis.'+_0x1c073a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x42c3f8+'))';return getZohoUser(_0x3b270a,_0x4507('0x4d'))['then'](function(_0x1d1418){if(_0x1d1418)return _0x1d1418;_0x3b270a[_0x4507('0x4e')]=_0x4507('0x40')+_0x1c073a+_0x4507('0x4f')+_0x42c3f8+'))';return getZohoUser(_0x3b270a,'Leads')[_0x4507('0x2c')](function(_0x401782){if(_0x401782)return _0x401782;if(_0x247c6f[_0x4507('0x43')]!=_0x4507('0x50')){return createEndUser(_0x21ddfe,_0x1c073a,_0x18860d,_0x42c3f8,_0x3c5f82,_0x247c6f);}else{return{};}});});break;case _0x4507('0x51'):_0x3b270a[_0x4507('0x4e')]='https://www.zohoapis.'+_0x1c073a+_0x4507('0x52')+_0x42c3f8+'))';return getZohoUser(_0x3b270a,_0x4507('0x4d'))[_0x4507('0x2c')](function(_0xad3b63){if(_0xad3b63)return _0xad3b63;if(_0x247c6f['moduleCreate']!=_0x4507('0x50')){return createEndUser(_0x21ddfe,_0x1c073a,_0x18860d,_0x42c3f8,_0x3c5f82,_0x247c6f);}else{return{};}});break;case'lead':_0x3b270a[_0x4507('0x4e')]=_0x4507('0x40')+_0x1c073a+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x42c3f8+'))';return getZohoUser(_0x3b270a,_0x4507('0x53'))[_0x4507('0x2c')](function(_0x239ecf){if(_0x239ecf)return _0x239ecf;if(_0x247c6f[_0x4507('0x43')]!=_0x4507('0x50')){return createEndUser(_0x21ddfe,_0x1c073a,_0x18860d,_0x42c3f8,_0x3c5f82,_0x247c6f);}else{return{};}});break;}}function getCall(_0x43fd42,_0x5aa4bf,_0x331215,_0x5f41b1,_0x1a6c66,_0x4ad482,_0x5abb38,_0x2b629d){logger[_0x4507('0x2f')]('Creating\x20new\x20call...');var _0xe04ed8={};_0xe04ed8[_0x4507('0x54')]={'name':!_[_0x4507('0x1c')](_0x5f41b1[_0x4507('0x44')][_0x4507('0x19')])&&!_[_0x4507('0x1c')](_0x5f41b1['profile'][_0x4507('0x19')])&&_0x5f41b1['profile'][_0x4507('0x19')]===_0x4507('0x55')?_0x5f41b1[_0x4507('0x44')]['name']:!_['isNil'](_0x5f41b1[_0x4507('0x45')])?_0x5f41b1[_0x4507('0x45')]+'\x20'+_0x5f41b1[_0x4507('0x46')]:_0x5f41b1[_0x4507('0x46')],'id':_0x5f41b1['id']};_0xe04ed8[_0x4507('0x56')]=intUtil[_0x4507('0x57')](_0x4ad482['Subjects'],_0x5abb38,'\x20');_0xe04ed8[_0x4507('0x58')]=intUtil['getString'](_0x4ad482['Descriptions'],_0x5abb38,'\x0a');if(_0x1a6c66['enduserType']===_0x4507('0x4d')){_0xe04ed8[_0x4507('0x59')]={'name':!_[_0x4507('0x1c')](_0x1a6c66[_0x4507('0x5a')])?_0x1a6c66[_0x4507('0x5a')]:!_['isNil'](_0x1a6c66[_0x4507('0x5b')])?_0x1a6c66[_0x4507('0x5b')]+'\x20'+_0x1a6c66[_0x4507('0x5c')]:_0x1a6c66[_0x4507('0x5c')],'id':_0x1a6c66['id']};}if(_0x1a6c66[_0x4507('0x3f')]==='Leads'){_0xe04ed8[_0x4507('0x5d')]={'name':!_['isNil'](_0x1a6c66['Full_Name'])?_0x1a6c66[_0x4507('0x5a')]:!_['isNil'](_0x1a6c66[_0x4507('0x5b')])?_0x1a6c66['First_Name']+'\x20'+_0x1a6c66[_0x4507('0x5c')]:_0x1a6c66[_0x4507('0x5c')],'id':_0x1a6c66['id']};_0xe04ed8[_0x4507('0x5e')]=_[_0x4507('0x42')](_0x1a6c66[_0x4507('0x3f')]);}if(_0x5abb38[_0x4507('0x5f')]){_0xe04ed8[_0x4507('0x60')]=moment['utc'](parseInt(_0x5abb38[_0x4507('0x5f')])*0x3e8)[_0x4507('0x32')](_0x4507('0x61'));}else if(_0x5abb38[_0x4507('0x62')]&&_0x5abb38[_0x4507('0x63')]){_0xe04ed8[_0x4507('0x60')]=moment[_0x4507('0x64')](moment(_0x5abb38['endtime'],_0x4507('0x65'))['diff'](moment(_0x5abb38['starttime'],_0x4507('0x65'))))[_0x4507('0x32')]('mm:ss');}switch(_0x5abb38['lastevent']){case _0x4507('0x66'):_0xe04ed8['Call_Result']=_0x4507('0x67');break;case _0x4507('0x68'):case _0x4507('0x69'):_0xe04ed8['Call_Result']=_0x4507('0x6a');break;case _0x4507('0x6b'):_0xe04ed8['Call_Result']='Rejected';break;case'abandoned':_0xe04ed8['Call_Result']=_0x4507('0x6c');break;default:}_0xe04ed8[_0x4507('0x6d')]=(_0x2b629d===_0x4507('0x6e')?moment(_0x5abb38[_0x4507('0x6f')])['format'](_0x4507('0x65')):moment(_0x5abb38['agentcalledAt'])[_0x4507('0x32')](_0x4507('0x65')))||moment()['format'](_0x4507('0x65'));_0xe04ed8[_0x4507('0x70')]=_0x2b629d||_0x4507('0x71');_0xe04ed8=_['merge'](_0xe04ed8,getCustomFields(_0x4ad482[_0x4507('0x72')],_0x5abb38));return request({'method':_0x4507('0x26'),'uri':_0x4507('0x40')+_0x5aa4bf+_0x4507('0x73'),'headers':{'Authorization':_0x4507('0x34')+_0x43fd42},'body':{'data':[_0xe04ed8]},'json':!![]})[_0x4507('0x2c')](function(_0x554117){if(_0x554117&&_0x554117[_0x4507('0x3e')][0x0][_0x4507('0x47')]===_0x4507('0x74')){logger[_0x4507('0x2f')](_0x4507('0x75'));return{'id':_0x554117[_0x4507('0x3e')][0x0][_0x4507('0x48')]['id']};}})[_0x4507('0x2d')](function(_0x5a3ebd){logger['info'](_0x4507('0x76'),_0x5a3ebd[_0x4507('0x77')]);console[_0x4507('0x4a')]('err',_0x5a3ebd);});}exports['queue']=function(_0x172be0,_0xd14666,_0x7d4beb,_0x4e6d8a,_0x482c6a,_0x5a3e9a){var _0x46d11d,_0x55ab4b,_0x102c29;_0x5a3e9a[_0x4507('0x78')]=intUtil['stripTrailingSlash'](_0x5a3e9a[_0x4507('0x78')]);_0x5a3e9a[_0x4507('0x79')]=intUtil[_0x4507('0x7a')](_0x5a3e9a[_0x4507('0x79')]);if(_0x482c6a&&_0x482c6a[_0x4507('0x7b')]){logger['info']('[QUEUE]',_0x4507('0x7c'));_0xd14666[_0x4507('0x7d')]=_0x5a3e9a[_0x4507('0x79')]+_0x4507('0x7e')+_0xd14666[_0x4507('0x7f')]+'/downloads?type=uniqueid&token='+md5(_0xd14666[_0x4507('0x7f')]);}else{_0xd14666[_0x4507('0x7d')]='';}var _0x13de03=_0x5a3e9a[_0x4507('0x78')]==='zoho.eu'?'eu':_0x4507('0x80');return getAccessToken(_0x5a3e9a)[_0x4507('0x2c')](function(_0x5ec053){_0x102c29=_0x5ec053;return getUser(_0x102c29,_0x13de03,_0x5a3e9a,_0x4e6d8a['email']);})[_0x4507('0x2c')](function(_0x3ff28a){_0x46d11d=_0x3ff28a;logger[_0x4507('0x2f')](_0x4507('0x81'),_0x46d11d['id']);return getEndUser(_0x102c29,_0x13de03,_0x5a3e9a,_0xd14666[_0x4507('0x82')],_0xd14666[_0x4507('0x83')],_0x46d11d,_0x7d4beb);})[_0x4507('0x2c')](function(_0x5a9efc){_0x55ab4b=_0x5a9efc;return getCall(_0x102c29,_0x13de03,_0x5a3e9a,_0x46d11d,_0x55ab4b,_0x7d4beb,_0xd14666,'Inbound');})['then'](function(_0x1f8217){if(_0x1f8217){logger[_0x4507('0x2f')](_0x4507('0x84'),_0x1f8217['id']);logger[_0x4507('0x2f')](_0x4507('0x85'),_0x4507('0x86'));emit(util[_0x4507('0x32')](_0x4507('0x87'),_0x4e6d8a[_0x4507('0x19')]),'trigger:browser:url',{'uri':_0x4507('0x88')+_0x5a3e9a['host']+_0x4507('0x89')+_0x1f8217['id']});}})[_0x4507('0x2d')](function(_0x109897){logger[_0x4507('0x3c')](_0x4507('0x85'),JSON[_0x4507('0x10')](_0x109897));});};exports['outbound']=function(_0x3c652d,_0x7fb7fa,_0x5d6138,_0x3db512,_0x3a136d,_0x5c5726,_0x54623d){var _0x4fb03c,_0x2c6fc9,_0x2ac3d6;_0x5c5726[_0x4507('0x78')]=intUtil[_0x4507('0x7a')](_0x5c5726[_0x4507('0x78')]);_0x5c5726[_0x4507('0x79')]=intUtil[_0x4507('0x7a')](_0x5c5726[_0x4507('0x79')]);if(_0x54623d&&_0x54623d[_0x4507('0x8a')]&&_0x54623d[_0x4507('0x8a')]!==_0x4507('0x8b')){logger[_0x4507('0x2f')]('[OUTBOUND]',_0x4507('0x7c'));_0x7fb7fa[_0x4507('0x7d')]=_0x5c5726['serverUrl']+_0x4507('0x7e')+_0x7fb7fa['uniqueid']+_0x4507('0x8c')+md5(_0x7fb7fa[_0x4507('0x7f')]);}var _0x566201=_0x5c5726[_0x4507('0x78')]===_0x4507('0x8d')?'eu':_0x4507('0x80');return getAccessToken(_0x5c5726)['then'](function(_0x9de0c2){_0x2ac3d6=_0x9de0c2;return getUser(_0x2ac3d6,_0x566201,_0x5c5726,_0x3db512[_0x4507('0x37')]);})[_0x4507('0x2c')](function(_0x530c5d){_0x4fb03c=_0x530c5d;logger['info']('The\x20User\x20ID\x20is:',_0x4fb03c['id']);return getEndUser(_0x2ac3d6,_0x566201,_0x5c5726,_0x7fb7fa[_0x4507('0x8e')],_0x7fb7fa[_0x4507('0x8f')],_0x4fb03c,_0x5d6138);})['then'](function(_0x3e1862){_0x2c6fc9=_0x3e1862;return getCall(_0x2ac3d6,_0x566201,_0x5c5726,_0x4fb03c,_0x2c6fc9,_0x5d6138,_0x7fb7fa,_0x4507('0x90'));})['then'](function(_0x9c649d){if(_0x9c649d){logger[_0x4507('0x2f')](_0x4507('0x84'),_0x9c649d['id']);logger[_0x4507('0x2f')](_0x4507('0x91'),_0x4507('0x86'));emit(util['format']('user:%s',_0x3db512[_0x4507('0x19')]),_0x4507('0x92'),{'uri':_0x4507('0x88')+_0x5c5726[_0x4507('0x78')]+_0x4507('0x89')+_0x9c649d['id']});}})['catch'](function(_0x49f010){logger['error'](_0x4507('0x91'),JSON[_0x4507('0x10')](_0x49f010));});};exports[_0x4507('0x93')]=function(_0x37d051,_0x4b859f,_0x3b951d,_0x47dfa8,_0x4b488a,_0x2464d3){var _0x20a4b4,_0x484295,_0x3f4879;_0x2464d3[_0x4507('0x78')]=intUtil[_0x4507('0x7a')](_0x2464d3[_0x4507('0x78')]);_0x2464d3[_0x4507('0x79')]=intUtil['stripTrailingSlash'](_0x2464d3[_0x4507('0x79')]);if(_0x4b488a&&_0x4b488a['monitor_format']){logger[_0x4507('0x2f')](_0x4507('0x94'),'Recording\x20is\x20enabled!');_0x4b859f[_0x4507('0x7d')]=_0x2464d3[_0x4507('0x79')]+_0x4507('0x7e')+_0x4b859f[_0x4507('0x7f')]+_0x4507('0x8c')+md5(_0x4b859f[_0x4507('0x7f')]);}else{_0x4b859f[_0x4507('0x7d')]='';}var _0x504ec5=_0x2464d3['host']==='zoho.eu'?'eu':_0x4507('0x80');return getAccessToken(_0x2464d3)[_0x4507('0x2c')](function(_0x376dae){_0x3f4879=_0x376dae;return getUser(_0x3f4879,_0x504ec5,_0x2464d3);})[_0x4507('0x2c')](function(_0x447b83){_0x20a4b4=_0x447b83;logger[_0x4507('0x2f')]('The\x20User\x20ID\x20is:',_0x20a4b4['id']);return getEndUser(_0x3f4879,_0x504ec5,_0x2464d3,_0x4b859f[_0x4507('0x82')],_0x4b859f[_0x4507('0x83')],_0x20a4b4,_0x3b951d);})['then'](function(_0x501977){_0x484295=_0x501977;return getCall(_0x3f4879,_0x504ec5,_0x2464d3,_0x20a4b4,_0x484295,_0x3b951d,_0x4b859f,_0x4507('0x71'));})[_0x4507('0x2c')](function(_0x44a94d){if(_0x44a94d){logger[_0x4507('0x2f')]('The\x20Call\x20ID\x20is:',_0x44a94d['id']);}})[_0x4507('0x2d')](function(_0x592e85){logger[_0x4507('0x3c')](_0x4507('0x94'),JSON['stringify'](_0x592e85));});}; \ No newline at end of file +var _0x194b=['https://crm.','recordingFormat','none','[OUTBOUND]','com','destcalleridnum','Outbound','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','[ABANDONED]','Recording\x20is\x20enabled!','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','type','string','content','variable','variableName','idField','toString','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientSecret','add','seconds','catch','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','isArrayLikeObject','users','findIndex','email','Agent\x20found!','profile','Administrator','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','lead','nothing','administrator','Subject','getString','Subjects','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','Called','complete','connect','Call_Result','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x2fbdda,_0x3e935a){var _0x48defb=function(_0x41f4b9){while(--_0x41f4b9){_0x2fbdda['push'](_0x2fbdda['shift']());}};_0x48defb(++_0x3e935a);}(_0x194b,0x9f));var _0xb194=function(_0x564ea2,_0x36b870){_0x564ea2=_0x564ea2-0x0;var _0x44008c=_0x194b[_0x564ea2];return _0x44008c;};'use strict';var _=require(_0xb194('0x0'));var rp=require(_0xb194('0x1'));var md5=require(_0xb194('0x2'));var util=require(_0xb194('0x3'));var intUtil=require('./util');var moment=require(_0xb194('0x4'));var Redis=require(_0xb194('0x5'));var BPromise=require(_0xb194('0x6'));var config=require(_0xb194('0x7'));var logger=require(_0xb194('0x8'))(_0xb194('0x9'));config[_0xb194('0xa')]=_[_0xb194('0xb')](config[_0xb194('0xa')],{'host':_0xb194('0xc'),'port':0x18eb});var io=require(_0xb194('0xd'))(new Redis(config[_0xb194('0xa')]));function emit(_0x1659ee,_0x1ebbc0,_0xbd607c){io['to'](_0x1659ee)[_0xb194('0xe')](_0x1ebbc0,_0xbd607c);}function request(_0x37d90b){logger[_0xb194('0xf')]('[HTTP]',JSON[_0xb194('0x10')](_0x37d90b));return rp(_0x37d90b);}function getCustomFields(_0x1f4c60,_0x3eae8b){var _0xae2f2e={};if(_0x1f4c60[_0xb194('0x11')]>0x0){_['forEach'](_0x1f4c60,function(_0x27e78d){if(_0x27e78d[_0xb194('0x12')]===_0xb194('0x13')&&_0x27e78d['idField']){_0xae2f2e[_0x27e78d['idField']]=_0x27e78d[_0xb194('0x14')]['toString']();}else if(_0x27e78d['type']===_0xb194('0x15')&&_0x27e78d[_0xb194('0x16')]&&_0x27e78d[_0xb194('0x17')]&&_0x3eae8b[_0x27e78d[_0xb194('0x16')]]){_0xae2f2e[_0x27e78d[_0xb194('0x17')]]=_0x3eae8b[_0x27e78d[_0xb194('0x16')]][_0xb194('0x18')]();}else if(_0x27e78d[_0xb194('0x12')]==='customVariable'&&_0x27e78d[_0xb194('0x19')]&&_0x27e78d['Variable'][_0xb194('0x1a')]&&_0x27e78d['idField']&&_0x3eae8b[_0x27e78d[_0xb194('0x19')][_0xb194('0x1a')][_0xb194('0x1b')]()]){_0xae2f2e[_0x27e78d[_0xb194('0x17')]]=_0x3eae8b[_0x27e78d[_0xb194('0x19')]['name'][_0xb194('0x1b')]()]['toString']();}});}return _0xae2f2e;}function getName(_0x4d9843){if(_0x4d9843[_0xb194('0x1c')]('\x20')>0x0){var _0x245c96=_0x4d9843[_0xb194('0x1d')](/ (.+)/);if(_0x245c96[0x1]){return _0x245c96;}}return[_0x4d9843,_0x4d9843];}var accountsTokens={};function getAccessToken(_0x22e1c3){return new Promise(function(_0x4c5bd7,_0x10626f){if(!_[_0xb194('0x1e')](accountsTokens[_0x22e1c3['id']])&&!_[_0xb194('0x1e')](accountsTokens[_0x22e1c3['id']][_0xb194('0x1f')])){if(moment()['isBefore'](accountsTokens[_0x22e1c3['id']][_0xb194('0x20')])){_0x4c5bd7(accountsTokens[_0x22e1c3['id']][_0xb194('0x1f')]);}}var _0x3013d0;switch(_0x22e1c3[_0xb194('0x21')]){case'US':_0x3013d0='https://accounts.zoho.com';break;case'AU':_0x3013d0='https://accounts.zoho.com.au';break;case'EU':_0x3013d0=_0xb194('0x22');break;case'IN':_0x3013d0=_0xb194('0x23');break;case'CN':_0x3013d0=_0xb194('0x24');break;default:_0x3013d0=_0xb194('0x22');break;}var _0x31ad6c={'method':_0xb194('0x25'),'uri':_0x3013d0+'/oauth/v2/token','qs':{'refresh_token':_0x22e1c3['refreshToken'],'client_id':_0x22e1c3['clientId'],'client_secret':_0x22e1c3[_0xb194('0x26')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x31ad6c)['then'](function(_0x5b4bdd){accountsTokens[_0x22e1c3['id']]={'access_token':_0x5b4bdd[_0xb194('0x1f')],'expires_in':moment()[_0xb194('0x27')](_0x5b4bdd[_0xb194('0x20')],_0xb194('0x28'))};_0x4c5bd7(_0x5b4bdd[_0xb194('0x1f')]);})[_0xb194('0x29')](function(_0x1fc0fc){logger['error']('Failing\x20creating\x20the\x20access_token',_0x1fc0fc[_0xb194('0x2a')]);_0x10626f(_0x1fc0fc);});});}function getUser(_0x476b4c,_0x5ea98e,_0x5b40cd,_0x27b540){logger[_0xb194('0x2b')](_0xb194('0x2c'));return request({'method':_0xb194('0x2d'),'uri':util[_0xb194('0x2e')](_0xb194('0x2f'),_0x5ea98e),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xb194('0x30')+_0x476b4c},'json':!![]})[_0xb194('0x31')](function(_0x452ebd){if(_0x452ebd['users']){var _0x538e89=-0x1;if(_[_0xb194('0x32')](_0x452ebd[_0xb194('0x33')])){if(!_[_0xb194('0x1e')](_0x27b540)){_0x538e89=_[_0xb194('0x34')](_0x452ebd[_0xb194('0x33')],function(_0x4b64ba){return _0x4b64ba[_0xb194('0x35')]===_0x27b540;});}if(_0x538e89>=0x0){logger['info'](_0xb194('0x36'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x538e89=_[_0xb194('0x34')](_0x452ebd[_0xb194('0x33')],function(_0x2453f7){return _0x2453f7[_0xb194('0x37')]['name']===_0xb194('0x38');});}return _0x452ebd['users'][_0x538e89];}else{if(_0x452ebd['user']['profile'][_0xb194('0x1a')]===_0xb194('0x38')){logger['info'](_0xb194('0x39'));user=_0x452ebd[_0xb194('0x3a')];return user;}else{logger['error'](_0xb194('0x3b'),JSON[_0xb194('0x10')](_0x452ebd));throw new Error(_0xb194('0x3c')+JSON[_0xb194('0x10')](_0x452ebd));}}}else{logger[_0xb194('0x3d')](_0xb194('0x3b'),JSON[_0xb194('0x10')](_0x452ebd));throw new Error(_0xb194('0x3c')+JSON[_0xb194('0x10')](_0x452ebd));}})[_0xb194('0x29')](function(_0x1d5319){console[_0xb194('0x3d')](_0x1d5319);});}function getZohoUser(_0x315a9c,_0x1eb502){return new BPromise(function(_0x35c22d,_0x8b4953){request(_0x315a9c)[_0xb194('0x31')](function(_0x226a9a){var _0x531ba1=null;if(_0x226a9a){_0x531ba1=_0x226a9a[_0xb194('0x3e')][0x0];_0x531ba1[_0xb194('0x3f')]=_0x1eb502;}_0x35c22d(_0x531ba1);})[_0xb194('0x29')](function(_0x5ead42){_0x8b4953(_0x5ead42);});});}function createEndUser(_0x3f3a1e,_0x317009,_0x5bfe37,_0x45bbc2,_0x2b0597,_0x3aae75){var _0x5bfe37=getName(_0x5bfe37);return request({'method':_0xb194('0x25'),'uri':_0xb194('0x40')+_0x317009+'/crm/v2/'+_[_0xb194('0x41')](_0x3aae75[_0xb194('0x42')])+'s','body':{'data':[{'Last_Name':_0x5bfe37[0x1],'First_Name':_0x5bfe37[0x0],'Phone':_0x45bbc2,'Owner':{'name':!_[_0xb194('0x1e')](_0x2b0597[_0xb194('0x43')][_0xb194('0x1a')])?_0x2b0597['role'][_0xb194('0x1a')]:!_['isNil'](_0x2b0597[_0xb194('0x44')])?_0x2b0597[_0xb194('0x44')]+'\x20'+_0x2b0597['last_name']:_0x2b0597[_0xb194('0x45')],'id':_0x2b0597['id']}}]},'headers':{'Authorization':_0xb194('0x30')+_0x3f3a1e},'json':!![]})[_0xb194('0x31')](function(_0x3232bf){if(_0x3232bf&&_0x3232bf[_0xb194('0x3e')][0x0][_0xb194('0x46')]===_0xb194('0x47')){var _0x25cd14=_0x3232bf['data'][0x0][_0xb194('0x48')];_0x25cd14['enduserType']=_[_0xb194('0x41')](_0x3aae75[_0xb194('0x42')])+'s';return _0x25cd14;}logger[_0xb194('0x3d')](_0xb194('0x3b'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0xb194('0x10')](data));})[_0xb194('0x29')](function(_0x45dff4){console[_0xb194('0x49')](_0xb194('0x4a'),_0x45dff4);});}function getEndUser(_0x4fe31c,_0x54d575,_0x37f3c6,_0x4b7442,_0x5ae4d7,_0x1b922f,_0x5e11c5){var _0x1d7fb5={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4fe31c},'json':!![]};switch(_0x5e11c5[_0xb194('0x4b')]){case _0xb194('0x4c'):_0x1d7fb5[_0xb194('0x4d')]='https://www.zohoapis.'+_0x54d575+_0xb194('0x4e')+_0x5ae4d7+'))';return getZohoUser(_0x1d7fb5,_0xb194('0x4f'))['then'](function(_0x5d3659){if(_0x5d3659)return _0x5d3659;_0x1d7fb5[_0xb194('0x4d')]=_0xb194('0x40')+_0x54d575+_0xb194('0x50')+_0x5ae4d7+'))';return getZohoUser(_0x1d7fb5,_0xb194('0x51'))[_0xb194('0x31')](function(_0x3242f7){if(_0x3242f7)return _0x3242f7;if(_0x5e11c5[_0xb194('0x42')]!='nothing'){return createEndUser(_0x4fe31c,_0x54d575,_0x4b7442,_0x5ae4d7,_0x1b922f,_0x5e11c5);}else{return{};}});});break;case _0xb194('0x52'):_0x1d7fb5[_0xb194('0x4d')]='https://www.zohoapis.'+_0x54d575+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x5ae4d7+'))';return getZohoUser(_0x1d7fb5,_0xb194('0x4f'))[_0xb194('0x31')](function(_0xd21b6e){if(_0xd21b6e)return _0xd21b6e;if(_0x5e11c5['moduleCreate']!='nothing'){return createEndUser(_0x4fe31c,_0x54d575,_0x4b7442,_0x5ae4d7,_0x1b922f,_0x5e11c5);}else{return{};}});break;case _0xb194('0x53'):_0x1d7fb5[_0xb194('0x4d')]=_0xb194('0x40')+_0x54d575+_0xb194('0x50')+_0x5ae4d7+'))';return getZohoUser(_0x1d7fb5,_0xb194('0x51'))['then'](function(_0x59783f){if(_0x59783f)return _0x59783f;if(_0x5e11c5[_0xb194('0x42')]!=_0xb194('0x54')){return createEndUser(_0x4fe31c,_0x54d575,_0x4b7442,_0x5ae4d7,_0x1b922f,_0x5e11c5);}else{return{};}});break;}}function getCall(_0x137f99,_0x346ee2,_0x857224,_0x7da2a7,_0x4b3986,_0x58dc08,_0x43233c,_0x26fbb6){logger[_0xb194('0x2b')]('Creating\x20new\x20call...');var _0x476747={};_0x476747['Owner']={'name':!_['isNil'](_0x7da2a7[_0xb194('0x43')]['name'])&&!_[_0xb194('0x1e')](_0x7da2a7[_0xb194('0x37')][_0xb194('0x1a')])&&_0x7da2a7[_0xb194('0x37')][_0xb194('0x1a')]===_0xb194('0x55')?_0x7da2a7['role'][_0xb194('0x1a')]:!_[_0xb194('0x1e')](_0x7da2a7[_0xb194('0x44')])?_0x7da2a7['first_name']+'\x20'+_0x7da2a7[_0xb194('0x45')]:_0x7da2a7['last_name'],'id':_0x7da2a7['id']};_0x476747[_0xb194('0x56')]=intUtil[_0xb194('0x57')](_0x58dc08[_0xb194('0x58')],_0x43233c,'\x20');_0x476747['Description']=intUtil['getString'](_0x58dc08['Descriptions'],_0x43233c,'\x0a');if(_0x4b3986[_0xb194('0x3f')]===_0xb194('0x4f')){_0x476747[_0xb194('0x59')]={'name':!_[_0xb194('0x1e')](_0x4b3986[_0xb194('0x5a')])?_0x4b3986['Full_Name']:!_['isNil'](_0x4b3986[_0xb194('0x5b')])?_0x4b3986['First_Name']+'\x20'+_0x4b3986['Last_Name']:_0x4b3986[_0xb194('0x5c')],'id':_0x4b3986['id']};}if(_0x4b3986[_0xb194('0x3f')]===_0xb194('0x51')){_0x476747[_0xb194('0x5d')]={'name':!_[_0xb194('0x1e')](_0x4b3986[_0xb194('0x5a')])?_0x4b3986['Full_Name']:!_[_0xb194('0x1e')](_0x4b3986[_0xb194('0x5b')])?_0x4b3986[_0xb194('0x5b')]+'\x20'+_0x4b3986[_0xb194('0x5c')]:_0x4b3986[_0xb194('0x5c')],'id':_0x4b3986['id']};_0x476747[_0xb194('0x5e')]=_[_0xb194('0x41')](_0x4b3986[_0xb194('0x3f')]);}if(_0x43233c[_0xb194('0x5f')]){_0x476747[_0xb194('0x60')]=moment[_0xb194('0x61')](parseInt(_0x43233c['talktime'])*0x3e8)[_0xb194('0x2e')](_0xb194('0x62'));}else if(_0x43233c[_0xb194('0x63')]&&_0x43233c['endtime']){_0x476747[_0xb194('0x60')]=moment['utc'](moment(_0x43233c[_0xb194('0x64')],_0xb194('0x65'))['diff'](moment(_0x43233c['starttime'],_0xb194('0x65'))))[_0xb194('0x2e')](_0xb194('0x62'));}switch(_0x43233c[_0xb194('0x66')]){case'called':_0x476747['Call_Result']=_0xb194('0x67');break;case _0xb194('0x68'):case _0xb194('0x69'):_0x476747[_0xb194('0x6a')]='Answered';break;case _0xb194('0x6b'):_0x476747['Call_Result']=_0xb194('0x6c');break;case _0xb194('0x6d'):_0x476747[_0xb194('0x6a')]=_0xb194('0x6e');break;default:}_0x476747[_0xb194('0x6f')]=(_0x26fbb6===_0xb194('0x70')?moment(_0x43233c[_0xb194('0x71')])[_0xb194('0x2e')](_0xb194('0x65')):moment(_0x43233c[_0xb194('0x72')])['format'](_0xb194('0x65')))||moment()[_0xb194('0x2e')](_0xb194('0x65'));_0x476747[_0xb194('0x73')]=_0x26fbb6||_0xb194('0x74');_0x476747=_[_0xb194('0x75')](_0x476747,getCustomFields(_0x58dc08[_0xb194('0x76')],_0x43233c));return request({'method':_0xb194('0x25'),'uri':_0xb194('0x40')+_0x346ee2+_0xb194('0x77'),'headers':{'Authorization':_0xb194('0x30')+_0x137f99},'body':{'data':[_0x476747]},'json':!![]})[_0xb194('0x31')](function(_0xd96ed5){if(_0xd96ed5&&_0xd96ed5[_0xb194('0x3e')][0x0]['code']==='SUCCESS'){logger[_0xb194('0x2b')]('Call\x20created!');return{'id':_0xd96ed5['data'][0x0]['details']['id']};}})[_0xb194('0x29')](function(_0x4a5ba8){logger[_0xb194('0x2b')](_0xb194('0x78'),_0x4a5ba8[_0xb194('0x2a')]);console['log'](_0xb194('0x78'),_0x4a5ba8);});}exports['queue']=function(_0x5ef278,_0x207415,_0xcfee69,_0x567437,_0x1027c4,_0x54446d){var _0x92174,_0x2b4167,_0x43daaf;_0x54446d[_0xb194('0x79')]=intUtil[_0xb194('0x7a')](_0x54446d['host']);_0x54446d['serverUrl']=intUtil['stripTrailingSlash'](_0x54446d[_0xb194('0x7b')]);if(_0x1027c4&&_0x1027c4[_0xb194('0x7c')]){logger['info'](_0xb194('0x7d'),'Recording\x20is\x20enabled!');_0x207415['recordingURL']=_0x54446d[_0xb194('0x7b')]+_0xb194('0x7e')+_0x207415[_0xb194('0x7f')]+_0xb194('0x80')+md5(_0x207415[_0xb194('0x7f')]);}else{_0x207415[_0xb194('0x81')]='';}var _0x2a59bd=_0x54446d[_0xb194('0x79')]===_0xb194('0x82')?'eu':'com';return getAccessToken(_0x54446d)[_0xb194('0x31')](function(_0x3212d2){_0x43daaf=_0x3212d2;return getUser(_0x43daaf,_0x2a59bd,_0x54446d,_0x567437['email']);})[_0xb194('0x31')](function(_0x3c4594){_0x92174=_0x3c4594;logger[_0xb194('0x2b')](_0xb194('0x83'),_0x92174['id']);return getEndUser(_0x43daaf,_0x2a59bd,_0x54446d,_0x207415[_0xb194('0x84')],_0x207415[_0xb194('0x85')],_0x92174,_0xcfee69);})[_0xb194('0x31')](function(_0xc56781){_0x2b4167=_0xc56781;return getCall(_0x43daaf,_0x2a59bd,_0x54446d,_0x92174,_0x2b4167,_0xcfee69,_0x207415,_0xb194('0x74'));})['then'](function(_0x4ab8ef){if(_0x4ab8ef){logger[_0xb194('0x2b')](_0xb194('0x86'),_0x4ab8ef['id']);logger['info'](_0xb194('0x7d'),_0xb194('0x87'));emit(util['format'](_0xb194('0x88'),_0x567437['name']),'trigger:browser:url',{'uri':_0xb194('0x89')+_0x54446d[_0xb194('0x79')]+'/crm/EntityInfo.do?module=Calls&id='+_0x4ab8ef['id']});}})[_0xb194('0x29')](function(_0x227599){logger[_0xb194('0x3d')]('[QUEUE]',JSON[_0xb194('0x10')](_0x227599));});};exports['outbound']=function(_0x30137f,_0x2e280c,_0x1d134e,_0x437766,_0x722176,_0x163456,_0x29f431){var _0x2e6e75,_0x40c0e9,_0x2210ee;_0x163456['host']=intUtil[_0xb194('0x7a')](_0x163456[_0xb194('0x79')]);_0x163456['serverUrl']=intUtil[_0xb194('0x7a')](_0x163456[_0xb194('0x7b')]);if(_0x29f431&&_0x29f431[_0xb194('0x8a')]&&_0x29f431[_0xb194('0x8a')]!==_0xb194('0x8b')){logger[_0xb194('0x2b')](_0xb194('0x8c'),'Recording\x20is\x20enabled!');_0x2e280c[_0xb194('0x81')]=_0x163456[_0xb194('0x7b')]+_0xb194('0x7e')+_0x2e280c[_0xb194('0x7f')]+_0xb194('0x80')+md5(_0x2e280c[_0xb194('0x7f')]);}var _0x236817=_0x163456[_0xb194('0x79')]===_0xb194('0x82')?'eu':_0xb194('0x8d');return getAccessToken(_0x163456)[_0xb194('0x31')](function(_0x1ae8d8){_0x2210ee=_0x1ae8d8;return getUser(_0x2210ee,_0x236817,_0x163456,_0x437766['email']);})['then'](function(_0x217e10){_0x2e6e75=_0x217e10;logger['info'](_0xb194('0x83'),_0x2e6e75['id']);return getEndUser(_0x2210ee,_0x236817,_0x163456,_0x2e280c['destcalleridname'],_0x2e280c[_0xb194('0x8e')],_0x2e6e75,_0x1d134e);})[_0xb194('0x31')](function(_0x42f1c4){_0x40c0e9=_0x42f1c4;return getCall(_0x2210ee,_0x236817,_0x163456,_0x2e6e75,_0x40c0e9,_0x1d134e,_0x2e280c,_0xb194('0x8f'));})[_0xb194('0x31')](function(_0x2dba20){if(_0x2dba20){logger[_0xb194('0x2b')](_0xb194('0x86'),_0x2dba20['id']);logger['info'](_0xb194('0x8c'),_0xb194('0x87'));emit(util[_0xb194('0x2e')](_0xb194('0x88'),_0x437766['name']),_0xb194('0x90'),{'uri':'https://crm.'+_0x163456[_0xb194('0x79')]+_0xb194('0x91')+_0x2dba20['id']});}})['catch'](function(_0x2d0709){logger['error']('[OUTBOUND]',JSON[_0xb194('0x10')](_0x2d0709));});};exports['abandoned']=function(_0x6c49e6,_0x2ecd32,_0x5b97c7,_0x4a49ec,_0x53a2d5,_0x562d8f){var _0x2e4692,_0x5a33d1,_0xc4e89c;_0x562d8f[_0xb194('0x79')]=intUtil[_0xb194('0x7a')](_0x562d8f[_0xb194('0x79')]);_0x562d8f['serverUrl']=intUtil[_0xb194('0x7a')](_0x562d8f[_0xb194('0x7b')]);if(_0x53a2d5&&_0x53a2d5[_0xb194('0x7c')]){logger[_0xb194('0x2b')](_0xb194('0x92'),_0xb194('0x93'));_0x2ecd32[_0xb194('0x81')]=_0x562d8f[_0xb194('0x7b')]+_0xb194('0x7e')+_0x2ecd32[_0xb194('0x7f')]+_0xb194('0x80')+md5(_0x2ecd32['uniqueid']);}else{_0x2ecd32[_0xb194('0x81')]='';}var _0x4ecb7d=_0x562d8f[_0xb194('0x79')]===_0xb194('0x82')?'eu':_0xb194('0x8d');return getAccessToken(_0x562d8f)[_0xb194('0x31')](function(_0x307182){_0xc4e89c=_0x307182;return getUser(_0xc4e89c,_0x4ecb7d,_0x562d8f);})[_0xb194('0x31')](function(_0x15733a){_0x2e4692=_0x15733a;logger['info']('The\x20User\x20ID\x20is:',_0x2e4692['id']);return getEndUser(_0xc4e89c,_0x4ecb7d,_0x562d8f,_0x2ecd32[_0xb194('0x84')],_0x2ecd32[_0xb194('0x85')],_0x2e4692,_0x5b97c7);})['then'](function(_0x5f4681){_0x5a33d1=_0x5f4681;return getCall(_0xc4e89c,_0x4ecb7d,_0x562d8f,_0x2e4692,_0x5a33d1,_0x5b97c7,_0x2ecd32,_0xb194('0x74'));})[_0xb194('0x31')](function(_0x2aba76){if(_0x2aba76){logger[_0xb194('0x2b')](_0xb194('0x86'),_0x2aba76['id']);}})[_0xb194('0x29')](function(_0x45bf5e){logger[_0xb194('0x3d')](_0xb194('0x92'),JSON[_0xb194('0x10')](_0x45bf5e));});}; \ 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 5964bd2..5f0ee38 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(_0x44030e,_0x416c23){var _0x6051f6=function(_0x267ec3){while(--_0x267ec3){_0x44030e['push'](_0x44030e['shift']());}};_0x6051f6(++_0x416c23);}(_0x7a54,0x106));var _0x47a5=function(_0x182473,_0x30ebf3){_0x182473=_0x182473-0x0;var _0x3e984e=_0x7a54[_0x182473];return _0x3e984e;};'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(_0xeeb2bd,_0x128de5){var _0x594f4b=function(_0x59416f){while(--_0x59416f){_0xeeb2bd['push'](_0xeeb2bd['shift']());}};_0x594f4b(++_0x128de5);}(_0x7a54,0x106));var _0x47a5=function(_0x107f81,_0x10f02e){_0x107f81=_0x107f81-0x0;var _0x19dd8d=_0x7a54[_0x107f81];return _0x19dd8d;};'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 33a64d1..aaef475 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 _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x1cd921,_0x3a0f7e){var _0x58f586=function(_0x49e7ab){while(--_0x49e7ab){_0x1cd921['push'](_0x1cd921['shift']());}};_0x58f586(++_0x3a0f7e);}(_0xb10b,0x12a));var _0xbb10=function(_0x3fd531,_0x538738){_0x3fd531=_0x3fd531-0x0;var _0x5bd9db=_0xb10b[_0x3fd531];return _0x5bd9db;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});}; \ No newline at end of file +var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x147bfd,_0x5da8c4){var _0x290485=function(_0x5b10b1){while(--_0x5b10b1){_0x147bfd['push'](_0x147bfd['shift']());}};_0x290485(++_0x5da8c4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x269bbf,_0x42dcac){_0x269bbf=_0x269bbf-0x0;var _0x23caa3=_0x5f2f[_0x269bbf];return _0x23caa3;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 080a6da..4963851 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 _0xb2b5=['catch','client','http','request','debug','error','rpc','routing','message'];(function(_0x5e8fb9,_0x15b163){var _0x53b285=function(_0x757b14){while(--_0x757b14){_0x5e8fb9['push'](_0x5e8fb9['shift']());}};_0x53b285(++_0x15b163);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xb2b5[_0x2064e5];return _0x21a233;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require('../../config/logger')('routing');var client=jayson[_0x5b2b('0x0')][_0x5b2b('0x1')]({'port':0x2329});client['Request']=function(_0x4eee87,_0x31784d){return new BPromise(function(_0x11fae1,_0x51e747){return client[_0x5b2b('0x2')](_0x4eee87,_0x31784d)['then'](function(_0x30c3e2){logger[_0x5b2b('0x3')]('rpc','routing',_0x4eee87,_0x31784d,_0x30c3e2);if(_0x30c3e2[_0x5b2b('0x4')]){logger[_0x5b2b('0x4')](_0x5b2b('0x5'),_0x5b2b('0x6'),_0x4eee87,_0x30c3e2[_0x5b2b('0x4')][_0x5b2b('0x7')],_0x31784d);return _0x51e747(_0x30c3e2[_0x5b2b('0x4')][_0x5b2b('0x7')]);}else{return _0x11fae1(_0x30c3e2['result']);}})[_0x5b2b('0x8')](function(_0x4732cd){logger['error'](_0x5b2b('0x5'),_0x5b2b('0x6'),_0x4eee87,_0x4732cd,_0x31784d);return _0x51e747(_0x4732cd);});});};module['exports']=client; \ No newline at end of file +var _0x85d8=['message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','Request','then','debug','rpc','error'];(function(_0x53637f,_0x19d4b0){var _0x2fb103=function(_0xd60ff8){while(--_0xd60ff8){_0x53637f['push'](_0x53637f['shift']());}};_0x2fb103(++_0x19d4b0);}(_0x85d8,0x1b0));var _0x885d=function(_0x75c2b9,_0x1ab379){_0x75c2b9=_0x75c2b9-0x0;var _0x3ab0fb=_0x85d8[_0x75c2b9];return _0x3ab0fb;};'use strict';var jayson=require(_0x885d('0x0'));var BPromise=require(_0x885d('0x1'));var logger=require(_0x885d('0x2'))(_0x885d('0x3'));var client=jayson[_0x885d('0x4')]['http']({'port':0x2329});client[_0x885d('0x5')]=function(_0x212c26,_0x320d7d){return new BPromise(function(_0x3fe8a0,_0x50cb53){return client['request'](_0x212c26,_0x320d7d)[_0x885d('0x6')](function(_0x30dcc2){logger[_0x885d('0x7')](_0x885d('0x8'),_0x885d('0x3'),_0x212c26,_0x320d7d,_0x30dcc2);if(_0x30dcc2[_0x885d('0x9')]){logger[_0x885d('0x9')](_0x885d('0x8'),_0x885d('0x3'),_0x212c26,_0x30dcc2[_0x885d('0x9')][_0x885d('0xa')],_0x320d7d);return _0x50cb53(_0x30dcc2[_0x885d('0x9')][_0x885d('0xa')]);}else{return _0x3fe8a0(_0x30dcc2[_0x885d('0xb')]);}})[_0x885d('0xc')](function(_0x46bd88){logger[_0x885d('0x9')](_0x885d('0x8'),_0x885d('0x3'),_0x212c26,_0x46bd88,_0x320d7d);return _0x50cb53(_0x46bd88);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 2ed7db1..f673596 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 _0x7edb=['initMailAccounts','refresh','mailAccounts','listen','Setting','loginMailFrequency','catch','log','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','then'];(function(_0x5b63c4,_0x4e73a8){var _0x4609b0=function(_0x332e68){while(--_0x332e68){_0x5b63c4['push'](_0x5b63c4['shift']());}};_0x4609b0(++_0x4e73a8);}(_0x7edb,0x158));var _0xb7ed=function(_0x7a932b,_0x4b1bd9){_0x7a932b=_0x7a932b-0x0;var _0x30baff=_0x7edb[_0x7a932b];return _0x30baff;};'use strict';var BPromise=require('bluebird');var server=require(_0xb7ed('0x0'));var Realtime=require(_0xb7ed('0x1'));var EmailChannel=require(_0xb7ed('0x2'));var mailAccount=require(_0xb7ed('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xb7ed('0x4'))['db'];function initRealtime(){return BPromise['resolve']()[_0xb7ed('0x5')](mailAccount['getMailAccounts']())['then'](realtime[_0xb7ed('0x6')]())[_0xb7ed('0x5')](function(){email[_0xb7ed('0x7')](realtime[_0xb7ed('0x8')]);return realtime;});}function main(){return server[_0xb7ed('0x9')](realtime,email)[_0xb7ed('0x5')](function(_0xac7ffe){return initRealtime();})[_0xb7ed('0x5')](function(_0x3aee5b){return db[_0xb7ed('0xa')]['findOne']({'attributes':['id',_0xb7ed('0xb')],'raw':!![]});})[_0xb7ed('0x5')](function(_0x183666){return setInterval(initRealtime,_0x183666[_0xb7ed('0xb')]*0x3e8);})[_0xb7ed('0xc')](function(_0x4104bb){console[_0xb7ed('0xd')](_0x4104bb);});}main(); \ No newline at end of file +var _0x2a3a=['refresh','mailAccounts','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','then','getMailAccounts','initMailAccounts'];(function(_0x2db863,_0x1181d7){var _0x5f5883=function(_0x376663){while(--_0x376663){_0x2db863['push'](_0x2db863['shift']());}};_0x5f5883(++_0x1181d7);}(_0x2a3a,0x1bf));var _0xa2a3=function(_0x54769c,_0x3405a9){_0x54769c=_0x54769c-0x0;var _0x48e106=_0x2a3a[_0x54769c];return _0x48e106;};'use strict';var BPromise=require(_0xa2a3('0x0'));var server=require(_0xa2a3('0x1'));var Realtime=require(_0xa2a3('0x2'));var EmailChannel=require(_0xa2a3('0x3'));var mailAccount=require(_0xa2a3('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise['resolve']()[_0xa2a3('0x5')](mailAccount[_0xa2a3('0x6')]())[_0xa2a3('0x5')](realtime[_0xa2a3('0x7')]())[_0xa2a3('0x5')](function(){email[_0xa2a3('0x8')](realtime[_0xa2a3('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xa2a3('0x5')](function(_0x196c96){return initRealtime();})[_0xa2a3('0x5')](function(_0x5c900c){return db['Setting']['findOne']({'attributes':['id',_0xa2a3('0xa')],'raw':!![]});})[_0xa2a3('0x5')](function(_0x2877fc){return setInterval(initRealtime,_0x2877fc['loginMailFrequency']*0x3e8);})[_0xa2a3('0xb')](function(_0x271b9f){console[_0xa2a3('0xc')](_0x271b9f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 3a0146a..8a0a2c7 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 _0x1e2c=['smtp','send','verifySmtp','Smtp','verify','then','verified','lodash','md5','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','name','key','active','status','Imap','messageStatus','total','isNil','stringify','emit','mailAccount:update','hasOwnProperty','box','handleImapBox','bind','handleImapEnd','error','handleImapError','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail'];(function(_0x5b8499,_0x131622){var _0x50aa33=function(_0x1f97fd){while(--_0x1f97fd){_0x5b8499['push'](_0x5b8499['shift']());}};_0x50aa33(++_0x131622);}(_0x1e2c,0x9a));var _0xc1e2=function(_0xd9ae89,_0x373d81){_0xd9ae89=_0xd9ae89-0x0;var _0x24d744=_0x1e2c[_0xd9ae89];return _0x24d744;};'use strict';var _=require(_0xc1e2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0xc1e2('0x1'));var Redis=require('ioredis');var config=require(_0xc1e2('0x2'));var logger=require('../../../config/logger')(_0xc1e2('0x3'));config[_0xc1e2('0x4')]=_[_0xc1e2('0x5')](config[_0xc1e2('0x4')],{'host':_0xc1e2('0x6'),'port':0x18eb});var io=require(_0xc1e2('0x7'))(new Redis(config[_0xc1e2('0x4')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xc1e2('0x8'));var mailAccount=require(_0xc1e2('0x9'));var md5Accounts={};function EmailChannel(_0xa320a7){logger['info'](_0xc1e2('0xa'));this[_0xc1e2('0xb')]=_0xa320a7[_0xc1e2('0xb')];this[_0xc1e2('0xc')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xc1e2('0xd')]['emit']=function(_0x5d3d43){var _0x503615=this['mailAccounts'][_0x5d3d43];var _0x3cc93b={'id':_0x503615['id'],'name':_0x503615[_0xc1e2('0xe')],'key':_0x503615[_0xc1e2('0xf')],'active':_0x503615[_0xc1e2('0x10')],'Imap':{'status':_0x503615['Imap'][_0xc1e2('0x11')],'messageStatus':_0x503615[_0xc1e2('0x12')][_0xc1e2('0x13')],'total':_0x503615[_0xc1e2('0x12')][_0xc1e2('0x14')]}};if(_[_0xc1e2('0x15')](md5Accounts[_0x5d3d43])){md5Accounts[_0x5d3d43]={};}var _0x70a08d=md5(JSON[_0xc1e2('0x16')](_0x3cc93b));if(md5Accounts[_0x5d3d43][_0xc1e2('0x1')]!==_0x70a08d){md5Accounts[_0x5d3d43]['md5']=_0x70a08d;io[_0xc1e2('0x17')](_0xc1e2('0x18'),_0x3cc93b);}};EmailChannel[_0xc1e2('0xd')]['refresh']=function(_0x2ce4b0){for(var _0x3cbe4a in _0x2ce4b0){if(_0x2ce4b0[_0xc1e2('0x19')](_0x3cbe4a)){if(_0x2ce4b0[_0x3cbe4a]['Imap']&&_0x2ce4b0[_0x3cbe4a][_0xc1e2('0x10')]){var _0x54e921=_0x2ce4b0[_0x3cbe4a][_0xc1e2('0x12')];if(!this[_0xc1e2('0xc')][_0xc1e2('0x19')](_0x54e921['id'])){this[_0xc1e2('0xc')][_0x54e921['id']]=new EmailImap(_0x54e921,_0x2ce4b0[_0x3cbe4a][_0xc1e2('0x3')]);this['imapAccounts'][_0x54e921['id']]['on'](_0xc1e2('0x1a'),this[_0xc1e2('0x1b')][_0xc1e2('0x1c')](this,_0x3cbe4a));this[_0xc1e2('0xc')][_0x54e921['id']]['on'](_0xc1e2('0x3'),this['handleImapEmail']['bind'](this,_0x3cbe4a));this[_0xc1e2('0xc')][_0x54e921['id']]['on']('end',this[_0xc1e2('0x1d')]['bind'](this,_0x3cbe4a));this[_0xc1e2('0xc')][_0x54e921['id']]['on'](_0xc1e2('0x1e'),this[_0xc1e2('0x1f')][_0xc1e2('0x1c')](this,_0x3cbe4a));}}else{if(_['isNil'](this[_0xc1e2('0xb')][_0x3cbe4a][_0xc1e2('0x12')])){this[_0xc1e2('0xb')][_0x3cbe4a]['Imap']={};}this['mailAccounts'][_0x3cbe4a][_0xc1e2('0x12')][_0xc1e2('0x11')]=_0xc1e2('0x20');this[_0xc1e2('0xb')][_0x3cbe4a]['Imap'][_0xc1e2('0x13')]='';this['emit'](_0x3cbe4a);}}}};EmailChannel[_0xc1e2('0xd')][_0xc1e2('0x1b')]=function(_0x2e3e54,_0x457372){if(this[_0xc1e2('0xb')][_0x2e3e54]){this[_0xc1e2('0xb')][_0x2e3e54][_0xc1e2('0x12')][_0xc1e2('0x11')]='connected';this['mailAccounts'][_0x2e3e54][_0xc1e2('0x12')]['messageStatus']=_0x457372[_0xc1e2('0xe')];if(_0x457372[_0xc1e2('0x21')]){this[_0xc1e2('0xb')][_0x2e3e54][_0xc1e2('0x12')][_0xc1e2('0x14')]=_0x457372[_0xc1e2('0x21')][_0xc1e2('0x14')];}return this[_0xc1e2('0x17')](_0x2e3e54);}};EmailChannel[_0xc1e2('0xd')]['handleImapEmail']=function(_0x18b153,_0x3e9c74){logger['info'](_0xc1e2('0x22'),_0x3e9c74[_0xc1e2('0x23')],_0x3e9c74[_0xc1e2('0x24')],_0x3e9c74[_0xc1e2('0x25')],_0x18b153);if(this[_0xc1e2('0xb')][_0x18b153]){return mailAccount[_0xc1e2('0x26')](_0x18b153,_0x3e9c74)['then'](function(_0x59c708){if(_0x59c708){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0xc1e2('0x27')](function(_0xba0e8f){logger[_0xc1e2('0x1e')](_0xc1e2('0x28'),JSON[_0xc1e2('0x16')](_0xba0e8f));});}};EmailChannel[_0xc1e2('0xd')][_0xc1e2('0x1d')]=function(_0x37b1af){if(this[_0xc1e2('0xb')][_0x37b1af]&&this[_0xc1e2('0xb')][_0x37b1af][_0xc1e2('0x12')]){if(this[_0xc1e2('0xc')][this['mailAccounts'][_0x37b1af][_0xc1e2('0x12')]['id']]){delete this[_0xc1e2('0xc')][this[_0xc1e2('0xb')][_0x37b1af][_0xc1e2('0x12')]['id']];}this[_0xc1e2('0xb')][_0x37b1af][_0xc1e2('0x12')]['lastSync']=moment();this[_0xc1e2('0x17')](_0x37b1af);}};EmailChannel[_0xc1e2('0xd')][_0xc1e2('0x1f')]=function(_0x5a9066,_0x27147c){if(this['mailAccounts'][_0x5a9066]){this['mailAccounts'][_0x5a9066][_0xc1e2('0x12')][_0xc1e2('0x11')]=_0xc1e2('0x1e');this['mailAccounts'][_0x5a9066]['Imap']['messageStatus']=_0x27147c;return this[_0xc1e2('0x17')](_0x5a9066);}};EmailChannel['prototype'][_0xc1e2('0x29')]=function(_0x3e9138,_0xc5a43f){return this[_0xc1e2('0x2a')][_0xc1e2('0x2b')](_0x3e9138,_0xc5a43f);};EmailChannel[_0xc1e2('0xd')][_0xc1e2('0x2c')]=function(_0x14dfc2){var _0x58db3d=this;if(this[_0xc1e2('0xb')][_0x14dfc2['id']]){if(_[_0xc1e2('0x15')](this[_0xc1e2('0xb')][_0x14dfc2['id']][_0xc1e2('0x2d')])){this[_0xc1e2('0xb')][_0x14dfc2['id']][_0xc1e2('0x2d')]={};}this[_0xc1e2('0xb')][_0x14dfc2['id']][_0xc1e2('0x2d')]['lastSync']=moment();return new BPromise(function(_0x4b8d5b,_0x518743){return _0x58db3d[_0xc1e2('0x2a')][_0xc1e2('0x2e')](_0x14dfc2)[_0xc1e2('0x2f')](function(_0x35f2a3){_0x58db3d[_0xc1e2('0xb')][_0x14dfc2['id']]['Smtp'][_0xc1e2('0x11')]=_0xc1e2('0x30');_0x58db3d[_0xc1e2('0xb')][_0x14dfc2['id']][_0xc1e2('0x2d')]['messageStatus']='';_0x58db3d[_0xc1e2('0x17')](_0x14dfc2['id']);_0x4b8d5b(_0x35f2a3);})[_0xc1e2('0x27')](function(_0x15e2d7){_0x58db3d[_0xc1e2('0xb')][_0x14dfc2['id']][_0xc1e2('0x2d')][_0xc1e2('0x11')]=_0xc1e2('0x1e');_0x58db3d[_0xc1e2('0xb')][_0x14dfc2['id']]['Smtp'][_0xc1e2('0x13')]=_0x15e2d7;_0x58db3d[_0xc1e2('0x17')](_0x14dfc2['id']);_0x518743(_0x15e2d7);});});}return this['smtp'][_0xc1e2('0x2e')](_0x14dfc2);};module['exports']=EmailChannel; \ No newline at end of file +var _0x3f1e=['ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','key','active','status','Imap','messageStatus','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','disabled','connected','name','total','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','catch','stringify','handleImapEnd','lastSync','sendMail','smtp','send','isNil','Smtp','verify','verified','exports','lodash','moment','md5'];(function(_0x5be407,_0x16fd68){var _0x1b3ba5=function(_0x4aaa2f){while(--_0x4aaa2f){_0x5be407['push'](_0x5be407['shift']());}};_0x1b3ba5(++_0x16fd68);}(_0x3f1e,0x67));var _0xe3f1=function(_0x219632,_0x476c58){_0x219632=_0x219632-0x0;var _0x192b37=_0x3f1e[_0x219632];return _0x192b37;};'use strict';var _=require(_0xe3f1('0x0'));var moment=require(_0xe3f1('0x1'));var BPromise=require('bluebird');var md5=require(_0xe3f1('0x2'));var Redis=require(_0xe3f1('0x3'));var config=require(_0xe3f1('0x4'));var logger=require(_0xe3f1('0x5'))(_0xe3f1('0x6'));config[_0xe3f1('0x7')]=_[_0xe3f1('0x8')](config[_0xe3f1('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe3f1('0x7')]));var EmailImap=require(_0xe3f1('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xe3f1('0xa'));var md5Accounts={};function EmailChannel(_0x22141d){logger[_0xe3f1('0xb')](_0xe3f1('0xc'));this[_0xe3f1('0xd')]=_0x22141d[_0xe3f1('0xd')];this[_0xe3f1('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xe3f1('0xf')][_0xe3f1('0x10')]=function(_0x1a3c37){var _0xa18b1a=this['mailAccounts'][_0x1a3c37];var _0xebd590={'id':_0xa18b1a['id'],'name':_0xa18b1a['name'],'key':_0xa18b1a[_0xe3f1('0x11')],'active':_0xa18b1a[_0xe3f1('0x12')],'Imap':{'status':_0xa18b1a['Imap'][_0xe3f1('0x13')],'messageStatus':_0xa18b1a[_0xe3f1('0x14')][_0xe3f1('0x15')],'total':_0xa18b1a['Imap']['total']}};if(_['isNil'](md5Accounts[_0x1a3c37])){md5Accounts[_0x1a3c37]={};}var _0x5ebe92=md5(JSON['stringify'](_0xebd590));if(md5Accounts[_0x1a3c37][_0xe3f1('0x2')]!==_0x5ebe92){md5Accounts[_0x1a3c37][_0xe3f1('0x2')]=_0x5ebe92;io[_0xe3f1('0x10')](_0xe3f1('0x16'),_0xebd590);}};EmailChannel[_0xe3f1('0xf')][_0xe3f1('0x17')]=function(_0x571b80){for(var _0x572908 in _0x571b80){if(_0x571b80[_0xe3f1('0x18')](_0x572908)){if(_0x571b80[_0x572908][_0xe3f1('0x14')]&&_0x571b80[_0x572908][_0xe3f1('0x12')]){var _0x1ecb66=_0x571b80[_0x572908][_0xe3f1('0x14')];if(!this[_0xe3f1('0xe')][_0xe3f1('0x18')](_0x1ecb66['id'])){this['imapAccounts'][_0x1ecb66['id']]=new EmailImap(_0x1ecb66,_0x571b80[_0x572908][_0xe3f1('0x6')]);this['imapAccounts'][_0x1ecb66['id']]['on'](_0xe3f1('0x19'),this[_0xe3f1('0x1a')][_0xe3f1('0x1b')](this,_0x572908));this['imapAccounts'][_0x1ecb66['id']]['on']('email',this[_0xe3f1('0x1c')][_0xe3f1('0x1b')](this,_0x572908));this['imapAccounts'][_0x1ecb66['id']]['on'](_0xe3f1('0x1d'),this['handleImapEnd'][_0xe3f1('0x1b')](this,_0x572908));this['imapAccounts'][_0x1ecb66['id']]['on'](_0xe3f1('0x1e'),this[_0xe3f1('0x1f')]['bind'](this,_0x572908));}}else{if(_['isNil'](this['mailAccounts'][_0x572908]['Imap'])){this[_0xe3f1('0xd')][_0x572908][_0xe3f1('0x14')]={};}this['mailAccounts'][_0x572908][_0xe3f1('0x14')][_0xe3f1('0x13')]=_0xe3f1('0x20');this[_0xe3f1('0xd')][_0x572908][_0xe3f1('0x14')][_0xe3f1('0x15')]='';this[_0xe3f1('0x10')](_0x572908);}}}};EmailChannel[_0xe3f1('0xf')][_0xe3f1('0x1a')]=function(_0x5c612b,_0x552d09){if(this[_0xe3f1('0xd')][_0x5c612b]){this[_0xe3f1('0xd')][_0x5c612b]['Imap']['status']=_0xe3f1('0x21');this['mailAccounts'][_0x5c612b]['Imap'][_0xe3f1('0x15')]=_0x552d09[_0xe3f1('0x22')];if(_0x552d09['messages']){this[_0xe3f1('0xd')][_0x5c612b][_0xe3f1('0x14')][_0xe3f1('0x23')]=_0x552d09[_0xe3f1('0x24')][_0xe3f1('0x23')];}return this[_0xe3f1('0x10')](_0x5c612b);}};EmailChannel[_0xe3f1('0xf')][_0xe3f1('0x1c')]=function(_0x31983e,_0x187b18){logger['info'](_0xe3f1('0x25'),_0x187b18['firstName'],_0x187b18['lastName'],_0x187b18[_0xe3f1('0x26')],_0x31983e);if(this[_0xe3f1('0xd')][_0x31983e]){return mailAccount[_0xe3f1('0x27')](_0x31983e,_0x187b18)[_0xe3f1('0x28')](function(_0x2bfcda){if(_0x2bfcda){logger[_0xe3f1('0xb')]('Mail\x20accepted\x20from\x20routing');}})[_0xe3f1('0x29')](function(_0x2875e0){logger[_0xe3f1('0x1e')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xe3f1('0x2a')](_0x2875e0));});}};EmailChannel[_0xe3f1('0xf')][_0xe3f1('0x2b')]=function(_0x2561c4){if(this[_0xe3f1('0xd')][_0x2561c4]&&this[_0xe3f1('0xd')][_0x2561c4][_0xe3f1('0x14')]){if(this['imapAccounts'][this[_0xe3f1('0xd')][_0x2561c4][_0xe3f1('0x14')]['id']]){delete this[_0xe3f1('0xe')][this['mailAccounts'][_0x2561c4][_0xe3f1('0x14')]['id']];}this['mailAccounts'][_0x2561c4]['Imap'][_0xe3f1('0x2c')]=moment();this[_0xe3f1('0x10')](_0x2561c4);}};EmailChannel[_0xe3f1('0xf')][_0xe3f1('0x1f')]=function(_0xa273db,_0x2c276e){if(this[_0xe3f1('0xd')][_0xa273db]){this[_0xe3f1('0xd')][_0xa273db]['Imap'][_0xe3f1('0x13')]=_0xe3f1('0x1e');this[_0xe3f1('0xd')][_0xa273db][_0xe3f1('0x14')][_0xe3f1('0x15')]=_0x2c276e;return this[_0xe3f1('0x10')](_0xa273db);}};EmailChannel['prototype'][_0xe3f1('0x2d')]=function(_0x4c7475,_0x1fc3d8){return this[_0xe3f1('0x2e')][_0xe3f1('0x2f')](_0x4c7475,_0x1fc3d8);};EmailChannel[_0xe3f1('0xf')]['verifySmtp']=function(_0x5a2a93){var _0x47eecc=this;if(this['mailAccounts'][_0x5a2a93['id']]){if(_[_0xe3f1('0x30')](this['mailAccounts'][_0x5a2a93['id']]['Smtp'])){this[_0xe3f1('0xd')][_0x5a2a93['id']][_0xe3f1('0x31')]={};}this['mailAccounts'][_0x5a2a93['id']][_0xe3f1('0x31')]['lastSync']=moment();return new BPromise(function(_0x1fa7f2,_0x260341){return _0x47eecc[_0xe3f1('0x2e')][_0xe3f1('0x32')](_0x5a2a93)[_0xe3f1('0x28')](function(_0x5213cf){_0x47eecc[_0xe3f1('0xd')][_0x5a2a93['id']][_0xe3f1('0x31')][_0xe3f1('0x13')]=_0xe3f1('0x33');_0x47eecc[_0xe3f1('0xd')][_0x5a2a93['id']][_0xe3f1('0x31')][_0xe3f1('0x15')]='';_0x47eecc[_0xe3f1('0x10')](_0x5a2a93['id']);_0x1fa7f2(_0x5213cf);})[_0xe3f1('0x29')](function(_0x162af3){_0x47eecc['mailAccounts'][_0x5a2a93['id']][_0xe3f1('0x31')]['status']='error';_0x47eecc[_0xe3f1('0xd')][_0x5a2a93['id']][_0xe3f1('0x31')][_0xe3f1('0x15')]=_0x162af3;_0x47eecc[_0xe3f1('0x10')](_0x5a2a93['id']);_0x260341(_0x162af3);});});}return this['smtp']['verify'](_0x5a2a93);};module[_0xe3f1('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 13d9355..f034624 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 _0xa766=['email','prototype','handleReady','openBox','handleOpenBox','emit','box','readUnseen','UNSEEN','fetch','handleFetchMessage','handleFetchError','end','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','handleFetchEnd','handleCloseBox','handleEnd','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','mailbox','account','getAccount','once','ready','bind','error','handleError','inherits','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','service'];(function(_0x41c6e6,_0x2e5869){var _0x1e9404=function(_0x59c7d1){while(--_0x59c7d1){_0x41c6e6['push'](_0x41c6e6['shift']());}};_0x1e9404(++_0x2e5869);}(_0xa766,0x17c));var _0x6a76=function(_0x439272,_0x2f0ab3){_0x439272=_0x439272-0x0;var _0x2de4ec=_0xa766[_0x439272];return _0x2de4ec;};'use strict';var fs=require('fs');var path=require(_0x6a76('0x0'));var util=require(_0x6a76('0x1'));var Imap=require(_0x6a76('0x2'));var _=require(_0x6a76('0x3'));var rs=require(_0x6a76('0x4'));var simpleParser=require(_0x6a76('0x5'))[_0x6a76('0x6')];var Iconv=require(_0x6a76('0x7'))[_0x6a76('0x8')];var EventEmitter=require(_0x6a76('0x9'))[_0x6a76('0xa')];var utils=require('./utils');var logger=require(_0x6a76('0xb'))('email');function EmailImap(_0x30dfd4,_0x585d64){this[_0x6a76('0xc')]='INBOX';this[_0x6a76('0xd')]=this[_0x6a76('0xe')](_0x30dfd4,_0x585d64);this[_0x6a76('0x2')]=new Imap(this[_0x6a76('0xd')]);this[_0x6a76('0x2')][_0x6a76('0xf')](_0x6a76('0x10'),this['handleReady'][_0x6a76('0x11')](this));this[_0x6a76('0x2')]['once']('end',this['handleEnd'][_0x6a76('0x11')](this));this['imap']['on'](_0x6a76('0x12'),this[_0x6a76('0x13')]['bind'](this));this['imap']['connect']();}util[_0x6a76('0x14')](EmailImap,EventEmitter);EmailImap['prototype'][_0x6a76('0xe')]=function(_0x33c2df,_0x3a3cad){var _0x28f6f8={'connTimeout':_0x33c2df[_0x6a76('0x15')]?_0x33c2df['connTimeout']*0x3e8:0x2710,'authTimeout':_0x33c2df[_0x6a76('0x16')]?_0x33c2df[_0x6a76('0x16')]*0x3e8:0x1388};if(_[_0x6a76('0x17')](_0x33c2df['service'])){if(_0x33c2df[_0x6a76('0x18')]){_0x28f6f8[_0x6a76('0x19')]=_0x33c2df[_0x6a76('0x19')];_0x28f6f8[_0x6a76('0x1a')]=_0x33c2df[_0x6a76('0x1a')];}_0x28f6f8[_0x6a76('0x1b')]=_0x33c2df[_0x6a76('0x1b')];_0x28f6f8[_0x6a76('0x1c')]=_0x33c2df[_0x6a76('0x1c')]||0x3e1;if(_0x33c2df[_0x6a76('0x1d')]){_0x28f6f8[_0x6a76('0x1d')]=!![];}else{_0x28f6f8[_0x6a76('0x1d')]=![];_0x28f6f8[_0x6a76('0x1e')]=_0x6a76('0x1f');}}else{_0x28f6f8['user']=_0x33c2df['user'];_0x28f6f8['password']=_0x33c2df['password'];_0x28f6f8[_0x6a76('0x1b')]=utils['getHost'](_0x33c2df[_0x6a76('0x20')]);_0x28f6f8[_0x6a76('0x1c')]=0x3e1;_0x28f6f8['tls']=!![];}_0x28f6f8[_0x6a76('0x21')]=_0x3a3cad||_0x33c2df[_0x6a76('0x19')]||'anonymous@xcally.com';return _0x28f6f8;};EmailImap[_0x6a76('0x22')][_0x6a76('0x23')]=function(){this['imap'][_0x6a76('0x24')](this[_0x6a76('0xc')],![],this[_0x6a76('0x25')][_0x6a76('0x11')](this));};EmailImap[_0x6a76('0x22')]['handleOpenBox']=function(_0x9088cf,_0x53ec03){if(_0x9088cf){this[_0x6a76('0x13')](_0x9088cf,!![]);}else{this[_0x6a76('0x26')](_0x6a76('0x27'),_0x53ec03);this['readUnseen']();}};EmailImap[_0x6a76('0x22')]['handleCloseBox']=function(_0x3c8d40){if(_0x3c8d40){this[_0x6a76('0x13')](_0x3c8d40,!![]);}else{this['imap']['end']();}};EmailImap[_0x6a76('0x22')][_0x6a76('0x28')]=function(){this[_0x6a76('0x2')]['search']([_0x6a76('0x29')],this['handleReadUnseen'][_0x6a76('0x11')](this));};EmailImap[_0x6a76('0x22')]['handleReadUnseen']=function(_0x2867b7,_0x5bbab2){if(_0x2867b7){this['handleError'](_0x2867b7,!![]);}else{if(_0x5bbab2['length']){try{var _0x2ed98d=this[_0x6a76('0x2')][_0x6a76('0x2a')](_0x5bbab2,{'bodies':'','markSeen':!![]});_0x2ed98d['on']('message',this[_0x6a76('0x2b')][_0x6a76('0x11')](this));_0x2ed98d[_0x6a76('0xf')](_0x6a76('0x12'),this[_0x6a76('0x2c')][_0x6a76('0x11')](this));_0x2ed98d['once'](_0x6a76('0x2d'),this['handleFetchEnd'][_0x6a76('0x11')](this));}catch(_0x53e2b6){logger['error'](_0x53e2b6);}}else{this[_0x6a76('0x2')][_0x6a76('0x2e')](!![],this['handleCloseBox'][_0x6a76('0x11')](this));}}};EmailImap[_0x6a76('0x22')]['handleFetchMessage']=function(_0x504c6c,_0x47021c){_0x504c6c['on']('body',this[_0x6a76('0x2f')]['bind'](this));_0x504c6c['once'](_0x6a76('0x30'),this[_0x6a76('0x31')][_0x6a76('0x11')](this));_0x504c6c[_0x6a76('0xf')](_0x6a76('0x2d'),this['handleMessageEnd'][_0x6a76('0x11')](this));};EmailImap[_0x6a76('0x22')][_0x6a76('0x2f')]=function(_0x1de46f,_0x3ecd84){simpleParser(_0x1de46f,{'Iconv':Iconv},this[_0x6a76('0x32')]['bind'](this));};EmailImap[_0x6a76('0x22')][_0x6a76('0x31')]=function(_0x393303){};EmailImap['prototype'][_0x6a76('0x33')]=function(){};EmailImap[_0x6a76('0x22')]['handleSimpleParser']=function(_0x3e75de,_0x5047e6){if(_0x3e75de){logger['error'](_0x3e75de);}else{var _0x12eb7b=this;utils['parser'](this['account'],_0x5047e6,function(_0x3e503a){_0x12eb7b[_0x6a76('0x26')](_0x6a76('0x21'),_0x3e503a);});}};EmailImap['prototype'][_0x6a76('0x34')]=function(){this[_0x6a76('0x2')][_0x6a76('0x2e')](!![],this['handleCloseBox'][_0x6a76('0x11')](this));};EmailImap[_0x6a76('0x22')]['handleFetchError']=function(_0x579192){this[_0x6a76('0x13')](_0x579192);this['imap']['closeBox'](!![],this[_0x6a76('0x35')]['bind'](this));};EmailImap[_0x6a76('0x22')][_0x6a76('0x36')]=function(){this[_0x6a76('0x26')](_0x6a76('0x2d'));};EmailImap['prototype'][_0x6a76('0x13')]=function(_0x5d18fc,_0x92a21c){logger[_0x6a76('0x12')]('handleError',this[_0x6a76('0xd')]['email'],JSON['stringify'](_0x5d18fc));var _0x2a1e85='';if(_0x5d18fc){if(_0x5d18fc[_0x6a76('0x37')]){_0x2a1e85=_0x5d18fc['textCode'];}else{for(var _0x270528 in _0x5d18fc){if(_0x5d18fc[_0x6a76('0x38')](_0x270528)){_0x2a1e85+=_[_0x6a76('0x39')](_0x270528)+':\x20'+_0x5d18fc[_0x270528]+'\x0a';}}}}if(_0x92a21c){this['imap'][_0x6a76('0x2d')]();}else{this[_0x6a76('0x26')]('error',_0x2a1e85);this[_0x6a76('0x26')]('end');}};module[_0x6a76('0x3a')]=EmailImap; \ No newline at end of file +var _0x3409=['inherits','connTimeout','authTimeout','isNil','authentication','user','password','port','tls','required','host','getHost','service','email','anonymous@xcally.com','prototype','mailbox','handleOpenBox','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','end','handleFetchEnd','closeBox','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','randomstring','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','INBOX','account','getAccount','imap','once','handleReady','handleEnd','bind','error','handleError','connect'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3409,0x6b));var _0x9340=function(_0x5a437c,_0x5d825d){_0x5a437c=_0x5a437c-0x0;var _0x35f0f3=_0x3409[_0x5a437c];return _0x35f0f3;};'use strict';var fs=require('fs');var path=require(_0x9340('0x0'));var util=require(_0x9340('0x1'));var Imap=require('imap');var _=require(_0x9340('0x2'));var rs=require(_0x9340('0x3'));var simpleParser=require('mailparser')[_0x9340('0x4')];var Iconv=require(_0x9340('0x5'))[_0x9340('0x6')];var EventEmitter=require('events')[_0x9340('0x7')];var utils=require(_0x9340('0x8'));var logger=require(_0x9340('0x9'))('email');function EmailImap(_0x580443,_0x3f848e){this['mailbox']=_0x9340('0xa');this[_0x9340('0xb')]=this[_0x9340('0xc')](_0x580443,_0x3f848e);this[_0x9340('0xd')]=new Imap(this[_0x9340('0xb')]);this[_0x9340('0xd')][_0x9340('0xe')]('ready',this[_0x9340('0xf')]['bind'](this));this[_0x9340('0xd')][_0x9340('0xe')]('end',this[_0x9340('0x10')][_0x9340('0x11')](this));this[_0x9340('0xd')]['on'](_0x9340('0x12'),this[_0x9340('0x13')]['bind'](this));this[_0x9340('0xd')][_0x9340('0x14')]();}util[_0x9340('0x15')](EmailImap,EventEmitter);EmailImap['prototype'][_0x9340('0xc')]=function(_0x3ba174,_0xff8867){var _0xf59320={'connTimeout':_0x3ba174[_0x9340('0x16')]?_0x3ba174[_0x9340('0x16')]*0x3e8:0x2710,'authTimeout':_0x3ba174[_0x9340('0x17')]?_0x3ba174[_0x9340('0x17')]*0x3e8:0x1388};if(_[_0x9340('0x18')](_0x3ba174['service'])){if(_0x3ba174[_0x9340('0x19')]){_0xf59320[_0x9340('0x1a')]=_0x3ba174[_0x9340('0x1a')];_0xf59320['password']=_0x3ba174[_0x9340('0x1b')];}_0xf59320['host']=_0x3ba174['host'];_0xf59320[_0x9340('0x1c')]=_0x3ba174[_0x9340('0x1c')]||0x3e1;if(_0x3ba174[_0x9340('0x1d')]){_0xf59320[_0x9340('0x1d')]=!![];}else{_0xf59320[_0x9340('0x1d')]=![];_0xf59320['autotls']=_0x9340('0x1e');}}else{_0xf59320[_0x9340('0x1a')]=_0x3ba174[_0x9340('0x1a')];_0xf59320['password']=_0x3ba174[_0x9340('0x1b')];_0xf59320[_0x9340('0x1f')]=utils[_0x9340('0x20')](_0x3ba174[_0x9340('0x21')]);_0xf59320[_0x9340('0x1c')]=0x3e1;_0xf59320[_0x9340('0x1d')]=!![];}_0xf59320[_0x9340('0x22')]=_0xff8867||_0x3ba174[_0x9340('0x1a')]||_0x9340('0x23');return _0xf59320;};EmailImap[_0x9340('0x24')]['handleReady']=function(){this[_0x9340('0xd')]['openBox'](this[_0x9340('0x25')],![],this[_0x9340('0x26')]['bind'](this));};EmailImap[_0x9340('0x24')][_0x9340('0x26')]=function(_0xf3486c,_0x15ded2){if(_0xf3486c){this['handleError'](_0xf3486c,!![]);}else{this['emit'](_0x9340('0x27'),_0x15ded2);this[_0x9340('0x28')]();}};EmailImap[_0x9340('0x24')][_0x9340('0x29')]=function(_0x1aa734){if(_0x1aa734){this[_0x9340('0x13')](_0x1aa734,!![]);}else{this[_0x9340('0xd')]['end']();}};EmailImap[_0x9340('0x24')][_0x9340('0x28')]=function(){this[_0x9340('0xd')]['search']([_0x9340('0x2a')],this['handleReadUnseen'][_0x9340('0x11')](this));};EmailImap['prototype'][_0x9340('0x2b')]=function(_0x56c104,_0x159b55){if(_0x56c104){this['handleError'](_0x56c104,!![]);}else{if(_0x159b55[_0x9340('0x2c')]){try{var _0x11a008=this[_0x9340('0xd')][_0x9340('0x2d')](_0x159b55,{'bodies':'','markSeen':!![]});_0x11a008['on'](_0x9340('0x2e'),this[_0x9340('0x2f')][_0x9340('0x11')](this));_0x11a008['once']('error',this[_0x9340('0x30')][_0x9340('0x11')](this));_0x11a008[_0x9340('0xe')](_0x9340('0x31'),this[_0x9340('0x32')][_0x9340('0x11')](this));}catch(_0x219179){logger[_0x9340('0x12')](_0x219179);}}else{this[_0x9340('0xd')][_0x9340('0x33')](!![],this[_0x9340('0x29')][_0x9340('0x11')](this));}}};EmailImap[_0x9340('0x24')]['handleFetchMessage']=function(_0x5d3d4b,_0x21b59f){_0x5d3d4b['on']('body',this['handleMessageBody']['bind'](this));_0x5d3d4b[_0x9340('0xe')](_0x9340('0x34'),this[_0x9340('0x35')][_0x9340('0x11')](this));_0x5d3d4b['once'](_0x9340('0x31'),this[_0x9340('0x36')][_0x9340('0x11')](this));};EmailImap[_0x9340('0x24')][_0x9340('0x37')]=function(_0x23dcec,_0x2b2bee){simpleParser(_0x23dcec,{'Iconv':Iconv},this[_0x9340('0x38')]['bind'](this));};EmailImap[_0x9340('0x24')]['handleMessageAttributes']=function(_0x2cb6f8){};EmailImap[_0x9340('0x24')][_0x9340('0x36')]=function(){};EmailImap['prototype'][_0x9340('0x38')]=function(_0x21552a,_0x4791a2){if(_0x21552a){logger[_0x9340('0x12')](_0x21552a);}else{var _0x2ba11f=this;utils[_0x9340('0x39')](this['account'],_0x4791a2,function(_0x3bf0d8){_0x2ba11f[_0x9340('0x3a')](_0x9340('0x22'),_0x3bf0d8);});}};EmailImap[_0x9340('0x24')][_0x9340('0x32')]=function(){this[_0x9340('0xd')][_0x9340('0x33')](!![],this[_0x9340('0x29')][_0x9340('0x11')](this));};EmailImap[_0x9340('0x24')][_0x9340('0x30')]=function(_0x30b975){this[_0x9340('0x13')](_0x30b975);this[_0x9340('0xd')][_0x9340('0x33')](!![],this[_0x9340('0x29')][_0x9340('0x11')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0x9340('0x31'));};EmailImap[_0x9340('0x24')][_0x9340('0x13')]=function(_0xa66722,_0x29f2bf){logger['error'](_0x9340('0x13'),this[_0x9340('0xb')][_0x9340('0x22')],JSON[_0x9340('0x3b')](_0xa66722));var _0x43c62a='';if(_0xa66722){if(_0xa66722['textCode']){_0x43c62a=_0xa66722[_0x9340('0x3c')];}else{for(var _0x713a30 in _0xa66722){if(_0xa66722[_0x9340('0x3d')](_0x713a30)){_0x43c62a+=_[_0x9340('0x3e')](_0x713a30)+':\x20'+_0xa66722[_0x713a30]+'\x0a';}}}}if(_0x29f2bf){this['imap'][_0x9340('0x31')]();}else{this[_0x9340('0x3a')](_0x9340('0x12'),_0x43c62a);this[_0x9340('0x3a')]('end');}};module[_0x9340('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 3d563f3..832b28e 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 _0xe569=['nodemailer-plugin-inline-base64','prototype','createTransport','compile','sendMail','toString','verify','exports','nodemailer','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe569,0x10c));var _0x9e56=function(_0x1bdb82,_0x50e7a5){_0x1bdb82=_0x1bdb82-0x0;var _0x11a52b=_0xe569[_0x1bdb82];return _0x11a52b;};'use strict';var nodemailer=require(_0x9e56('0x0'));var BPromise=require(_0x9e56('0x1'));var inlineBase64=require(_0x9e56('0x2'));function EmailSmtp(){}EmailSmtp[_0x9e56('0x3')]['send']=function(_0x327fbe,_0xf2f93d){return new BPromise(function(_0x490ad8,_0x298fc2){var _0x5d876b=nodemailer[_0x9e56('0x4')](_0x327fbe);_0x5d876b['use'](_0x9e56('0x5'),inlineBase64());_0x5d876b[_0x9e56('0x6')](_0xf2f93d,function(_0x414040,_0x41e752){if(_0x414040){_0x298fc2(_0x414040[_0x9e56('0x7')]());}else{_0x490ad8(_0x41e752);}});});};EmailSmtp[_0x9e56('0x3')][_0x9e56('0x8')]=function(_0x3a9034){return new BPromise(function(_0x56c780,_0x5a99ae){var _0x54209c=nodemailer[_0x9e56('0x4')](_0x3a9034);_0x54209c[_0x9e56('0x8')](function(_0x39df03,_0x545c4e){if(_0x39df03){_0x5a99ae(_0x39df03[_0x9e56('0x7')]());}else{if(_0x545c4e){_0x56c780(_0x545c4e);}else{_0x5a99ae('Not\x20verifired');}}});});};module[_0x9e56('0x9')]=EmailSmtp; \ No newline at end of file +var _0x9928=['createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','nodemailer','bluebird','prototype','send'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9928,0xc2));var _0x8992=function(_0x4bf5fd,_0x21a61f){_0x4bf5fd=_0x4bf5fd-0x0;var _0xaa79ab=_0x9928[_0x4bf5fd];return _0xaa79ab;};'use strict';var nodemailer=require(_0x8992('0x0'));var BPromise=require(_0x8992('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8992('0x2')][_0x8992('0x3')]=function(_0x268b16,_0x92239){return new BPromise(function(_0x4f2ea1,_0x16a5ab){var _0x2f3c81=nodemailer[_0x8992('0x4')](_0x268b16);_0x2f3c81[_0x8992('0x5')](_0x8992('0x6'),inlineBase64());_0x2f3c81[_0x8992('0x7')](_0x92239,function(_0xea3e09,_0x40648c){if(_0xea3e09){_0x16a5ab(_0xea3e09[_0x8992('0x8')]());}else{_0x4f2ea1(_0x40648c);}});});};EmailSmtp['prototype'][_0x8992('0x9')]=function(_0x340ed3){return new BPromise(function(_0x43765f,_0x4321a2){var _0x11acc4=nodemailer[_0x8992('0x4')](_0x340ed3);_0x11acc4[_0x8992('0x9')](function(_0xf1dc09,_0x7f9bbc){if(_0xf1dc09){_0x4321a2(_0xf1dc09[_0x8992('0x8')]());}else{if(_0x7f9bbc){_0x43765f(_0x7f9bbc);}else{_0x4321a2(_0x8992('0xa'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 41a4602..ad420da 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 _0x4a61=['message','originCc','email','includes','attachments','type','attachment','filename','%s-%s','now','root','server/files/attachments/','writeFileSync','content','push','contentType','parser','from','messageId','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','@xcally.com','name','split','slice','join','Anonymous','length','pop','isEmpty','generate','html','test','replace','body','textAsHtml','0x1?_0x326903[_0x14a6('0x13')]():'';}return'';}function getMails(_0x1d5c6d,_0x4b2616){var _0x4b7e49='';for(var _0x5f118f=0x0;_0x5f118f<_0x4b2616['value'][_0x14a6('0x12')];_0x5f118f+=0x1){if(_0x4b2616[_0x14a6('0x9')][_0x5f118f][_0x14a6('0xa')]!==_0x1d5c6d){if(!_[_0x14a6('0x14')](_0x4b7e49)){_0x4b7e49+=',';}_0x4b7e49+=_0x4b2616[_0x14a6('0x9')][_0x5f118f]['name']||_0x4b2616[_0x14a6('0x9')][_0x5f118f][_0x14a6('0xa')]||'';_0x4b7e49+='\x20<';_0x4b7e49+=_0x4b2616[_0x14a6('0x9')][_0x5f118f][_0x14a6('0xa')]?_0x4b2616[_0x14a6('0x9')][_0x5f118f][_0x14a6('0xa')]:_0x14a6('0xb')+random[_0x14a6('0x15')](0x6)+_0x14a6('0xc');_0x4b7e49+='>';}}return _0x4b7e49;}function parseEmail(_0x472078,_0x1f7a5c,_0x3db1dd){if(_0x1f7a5c[_0x14a6('0x16')]){var _0x5ec20f=/)<[^<]*)*<\/script>/gi;while(_0x5ec20f[_0x14a6('0x17')](_0x1f7a5c[_0x14a6('0x16')])){_0x1f7a5c['html']=_0x1f7a5c['html'][_0x14a6('0x18')](_0x5ec20f,'');}_0x3db1dd['body']=_0x1f7a5c['html'];}else{_0x3db1dd[_0x14a6('0x19')]=_0x1f7a5c[_0x14a6('0x1a')];}if(_0x3db1dd[_0x14a6('0x19')]){_0x3db1dd[_0x14a6('0x19')]=_0x3db1dd[_0x14a6('0x19')][_0x14a6('0x18')](/Empty\x20message

','Attachments','getHost','gmail'];(function(_0x19b9d1,_0x4f603f){var _0x1ca4f7=function(_0x2d1ea7){while(--_0x2d1ea7){_0x19b9d1['push'](_0x19b9d1['shift']());}};_0x1ca4f7(++_0x4f603f);}(_0xb694,0x1e7));var _0x4b69=function(_0x403408,_0x5f304c){_0x403408=_0x403408-0x0;var _0x5d8f90=_0xb694[_0x403408];return _0x5d8f90;};'use strict';var _=require(_0x4b69('0x0'));var moment=require(_0x4b69('0x1'));var random=require(_0x4b69('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x4b69('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')('email');var config=require('../../../config/environment');function getAddress(_0x1ec46f){var _0x2a4eda=_[_0x4b69('0x4')](_0x1ec46f[_0x4b69('0x5')]);return _0x2a4eda&&_0x2a4eda[_0x4b69('0x6')]?_0x2a4eda['address']:_0x4b69('0x7')+random[_0x4b69('0x8')](0x6)+_0x4b69('0x9');}function getFirstName(_0x4e1d82){var _0x259a41=_['head'](_0x4e1d82[_0x4b69('0x5')]);if(_0x259a41&&_0x259a41[_0x4b69('0xa')]){var _0x53680e=_0x259a41[_0x4b69('0xa')][_0x4b69('0xb')](/\s+/);return _0x53680e[_0x4b69('0xc')]?_0x53680e[_0x4b69('0xd')](0x0,-0x1)[_0x4b69('0xe')]('\x20'):_0x259a41[_0x4b69('0xa')];}return _0x4b69('0xf');}function getLastName(_0x267069){var _0x44dd94=_[_0x4b69('0x4')](_0x267069[_0x4b69('0x5')]);if(_0x44dd94&&_0x44dd94[_0x4b69('0xa')]){var _0x4c0fda=_0x44dd94[_0x4b69('0xa')][_0x4b69('0xb')](/\s+/);return _0x4c0fda['length']>0x1?_0x4c0fda[_0x4b69('0x10')]():'';}return'';}function getMails(_0x2b8181,_0x2f3e7d){var _0x57ca9f='';for(var _0x411f31=0x0;_0x411f31<_0x2f3e7d['value'][_0x4b69('0xc')];_0x411f31+=0x1){if(_0x2f3e7d['value'][_0x411f31][_0x4b69('0x6')]!==_0x2b8181){if(!_[_0x4b69('0x11')](_0x57ca9f)){_0x57ca9f+=',';}_0x57ca9f+=_0x2f3e7d['value'][_0x411f31][_0x4b69('0xa')]||_0x2f3e7d[_0x4b69('0x5')][_0x411f31][_0x4b69('0x6')]||'';_0x57ca9f+='\x20<';_0x57ca9f+=_0x2f3e7d[_0x4b69('0x5')][_0x411f31][_0x4b69('0x6')]?_0x2f3e7d[_0x4b69('0x5')][_0x411f31]['address']:'anonymous'+random[_0x4b69('0x8')](0x6)+_0x4b69('0x9');_0x57ca9f+='>';}}return _0x57ca9f;}function parseEmail(_0x4ae734,_0x49f542,_0x940707){if(_0x49f542[_0x4b69('0x12')]){var _0x313aad=/)<[^<]*)*<\/script>/gi;while(_0x313aad[_0x4b69('0x13')](_0x49f542[_0x4b69('0x12')])){_0x49f542[_0x4b69('0x12')]=_0x49f542['html'][_0x4b69('0x14')](_0x313aad,'');}_0x940707[_0x4b69('0x15')]=_0x49f542[_0x4b69('0x12')];}else{_0x940707[_0x4b69('0x15')]=_0x49f542[_0x4b69('0x16')];}if(_0x940707[_0x4b69('0x15')]){_0x940707[_0x4b69('0x15')]=_0x940707[_0x4b69('0x15')][_0x4b69('0x14')](/0x0){if(this[_0xd3e23d+_0x3071('0x23')]>0x0&&this[_0xd3e23d+'CurrentCapacity']>=this[_0xd3e23d+_0x3071('0x23')]){return _0x3071('0x24');}else{return _0x3071('0x25');}}else{return _0x3071('0x26');}};Agent[_0x3071('0x21')][_0x3071('0x27')]=function(){var _0x3c5cef=[_0x3071('0x28'),'chat','openchannel',_0x3071('0x29'),_0x3071('0x2a')];for(var _0x412652=0x0;_0x412652<_0x3c5cef[_0x3071('0x2b')];_0x412652+=0x1){var _0x2793ef=this[_0x3071('0x22')](_0x3c5cef[_0x412652]);if(this[_0x3c5cef[_0x412652]+_0x3071('0x2c')]!==_0x2793ef){this[_0x3c5cef[_0x412652]+_0x3071('0x2d')]=_[_0x3071('0x2e')](moment()['format']('x'));}this[_0x3c5cef[_0x412652]+_0x3071('0x2c')]=_0x2793ef;}var _0x3f1e6e={'id':this['id'],'name':this[_0x3071('0x7')],'online':this['online'],'voicePause':this[_0x3071('0x9')],'chatPause':this[_0x3071('0xa')],'mailPause':this[_0x3071('0xb')],'smsPause':this[_0x3071('0xd')],'faxPause':this[_0x3071('0xc')],'openchannelPause':this[_0x3071('0xe')],'chatStatus':this[_0x3071('0xf')],'chatStatusTime':this[_0x3071('0x11')],'chatCapacity':this[_0x3071('0x12')],'chatCurrentCapacity':this[_0x3071('0x2f')],'mailStatus':this[_0x3071('0x30')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x3071('0x31')],'faxStatus':this[_0x3071('0x14')],'faxStatusTime':this[_0x3071('0x15')],'faxCapacity':this[_0x3071('0x16')],'faxCurrentCapacity':this[_0x3071('0x17')],'smsStatus':this[_0x3071('0x18')],'smsStatusTime':this[_0x3071('0x19')],'smsCapacity':this[_0x3071('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x3071('0x1d')],'openchannelCurrentCapacity':this[_0x3071('0x1e')],'busy':this['busy'],'busyQueue':this[_0x3071('0x20')]};var _0x28747d=md5(JSON[_0x3071('0x32')](_0x3f1e6e));if(this[_0x3071('0x0')]!==_0x28747d){this['md5']=_0x28747d;io[_0x3071('0x33')](_0x3071('0x34'),_0x3f1e6e);}};module[_0x3071('0x35')]=Agent; \ No newline at end of file +var _0xe13a=['chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','chat','fax','sms','Status','StatusTime','toNumber','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','busyQueue','stringify','emit','user:save','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe13a,0x178));var _0xae13=function(_0x380a24,_0x4471e9){_0x380a24=_0x380a24-0x0;var _0x5eda83=_0xe13a[_0x380a24];return _0x5eda83;};'use strict';var _=require('lodash');var moment=require(_0xae13('0x0'));var md5=require(_0xae13('0x1'));var Redis=require(_0xae13('0x2'));var config=require(_0xae13('0x3'));config['redis']=_[_0xae13('0x4')](config[_0xae13('0x5')],{'host':_0xae13('0x6'),'port':0x18eb});var io=require(_0xae13('0x7'))(new Redis(config[_0xae13('0x5')]));function Agent(_0x248e53){this['id']=_0x248e53['id']||0x0;this[_0xae13('0x8')]=_0x248e53[_0xae13('0x8')]||'';this[_0xae13('0x9')]=_0x248e53['online']||!![];this[_0xae13('0xa')]=_0x248e53[_0xae13('0xa')]||![];this[_0xae13('0xb')]=_0x248e53[_0xae13('0xb')]||![];this[_0xae13('0xc')]=_0x248e53[_0xae13('0xc')]||![];this[_0xae13('0xd')]=_0x248e53[_0xae13('0xd')]||![];this[_0xae13('0xe')]=_0x248e53['smsPause']||![];this[_0xae13('0xf')]=_0x248e53[_0xae13('0xf')]||![];this[_0xae13('0x10')]=_0xae13('0x11');this[_0xae13('0x12')]=0x0;this[_0xae13('0x13')]=_0x248e53[_0xae13('0x13')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xae13('0x14')]=_0xae13('0x11');this['mailStatusTime']=0x0;this['mailCapacity']=_0x248e53['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0xae13('0x11');this[_0xae13('0x15')]=0x0;this[_0xae13('0x16')]=_0x248e53[_0xae13('0x16')]||0x0;this[_0xae13('0x17')]=0x0;this[_0xae13('0x18')]='unknown';this[_0xae13('0x19')]=0x0;this['smsCapacity']=_0x248e53[_0xae13('0x1a')]||0x0;this[_0xae13('0x1b')]=0x0;this[_0xae13('0x1c')]=_0xae13('0x11');this[_0xae13('0x1d')]=0x0;this[_0xae13('0x1e')]=_0x248e53[_0xae13('0x1e')]||0x0;this[_0xae13('0x1f')]=0x0;this[_0xae13('0x20')]=![];this['busyQueue']=undefined;this[_0xae13('0x1')]='';this['updateRealtime']();}Agent[_0xae13('0x21')][_0xae13('0x22')]=function(_0x49c7d5){if(this[_0x49c7d5+_0xae13('0x23')]>0x0){if(this[_0x49c7d5+_0xae13('0x24')]>0x0&&this[_0x49c7d5+_0xae13('0x23')]>=this[_0x49c7d5+_0xae13('0x24')]){return _0xae13('0x25');}else{return _0xae13('0x26');}}else{return'idle';}};Agent['prototype'][_0xae13('0x27')]=function(){var _0x290fb9=['mail',_0xae13('0x28'),'openchannel',_0xae13('0x29'),_0xae13('0x2a')];for(var _0x3f12b0=0x0;_0x3f12b0<_0x290fb9['length'];_0x3f12b0+=0x1){var _0x57124a=this['getChannelStatus'](_0x290fb9[_0x3f12b0]);if(this[_0x290fb9[_0x3f12b0]+_0xae13('0x2b')]!==_0x57124a){this[_0x290fb9[_0x3f12b0]+_0xae13('0x2c')]=_[_0xae13('0x2d')](moment()['format']('x'));}this[_0x290fb9[_0x3f12b0]+_0xae13('0x2b')]=_0x57124a;}var _0x517e71={'id':this['id'],'name':this[_0xae13('0x8')],'online':this['online'],'voicePause':this[_0xae13('0xa')],'chatPause':this[_0xae13('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xae13('0xe')],'faxPause':this[_0xae13('0xd')],'openchannelPause':this[_0xae13('0xf')],'chatStatus':this[_0xae13('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xae13('0x13')],'chatCurrentCapacity':this[_0xae13('0x2e')],'mailStatus':this[_0xae13('0x14')],'mailStatusTime':this[_0xae13('0x2f')],'mailCapacity':this[_0xae13('0x30')],'mailCurrentCapacity':this[_0xae13('0x31')],'faxStatus':this[_0xae13('0x32')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xae13('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xae13('0x18')],'smsStatusTime':this[_0xae13('0x19')],'smsCapacity':this[_0xae13('0x1a')],'smsCurrentCapacity':this[_0xae13('0x1b')],'openchannelStatus':this[_0xae13('0x1c')],'openchannelStatusTime':this[_0xae13('0x1d')],'openchannelCapacity':this[_0xae13('0x1e')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0xae13('0x33')]};var _0x233896=md5(JSON[_0xae13('0x34')](_0x517e71));if(this[_0xae13('0x1')]!==_0x233896){this[_0xae13('0x1')]=_0x233896;io[_0xae13('0x35')](_0xae13('0x36'),_0x517e71);}};module[_0xae13('0x37')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 6e215c3..0556d7f 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 _0x19ce=['util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','available','name','waiting','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5'];(function(_0x3ac312,_0x5d3903){var _0x36b673=function(_0x254b25){while(--_0x254b25){_0x3ac312['push'](_0x3ac312['shift']());}};_0x36b673(++_0x5d3903);}(_0x19ce,0x72));var _0xe19c=function(_0x4bd5ab,_0x51aed0){_0x4bd5ab=_0x4bd5ab-0x0;var _0x49ade8=_0x19ce[_0x4bd5ab];return _0x49ade8;};'use strict';var _=require(_0xe19c('0x0'));var md5=require(_0xe19c('0x1'));var util=require(_0xe19c('0x2'));var Redis=require('ioredis');var config=require(_0xe19c('0x3'));config[_0xe19c('0x4')]=_[_0xe19c('0x5')](config[_0xe19c('0x4')],{'host':_0xe19c('0x6'),'port':0x18eb});var io=require(_0xe19c('0x7'))(new Redis(config[_0xe19c('0x4')]));function ChatQueue(_0x3e4baa){this['id']=_0x3e4baa['id']||0x0;this['name']=_0x3e4baa['name']||'';this[_0xe19c('0x8')]=_0x3e4baa[_0xe19c('0x8')]||0xa;this[_0xe19c('0x9')]=_0x3e4baa[_0xe19c('0x9')]||_0xe19c('0xa');this['Agents']=_0x3e4baa[_0xe19c('0xb')];this[_0xe19c('0xc')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0xe19c('0xd')]();}ChatQueue[_0xe19c('0xe')][_0xe19c('0xf')]=function(){var _0x5468e6=this[_0xe19c('0xc')][_0xe19c('0x10')];this[_0xe19c('0xc')]=_[_0xe19c('0x11')](this[_0xe19c('0xb')],'id');this[_0xe19c('0xc')][_0xe19c('0x10')]=_0x5468e6;};ChatQueue['prototype'][_0xe19c('0xd')]=function(){this[_0xe19c('0x12')]=0x0;this[_0xe19c('0x13')]=0x0;for(var _0x2a94b7=0x0;_0x2a94b7=0x0?this[_0xe19c('0x16')]:0x0;var _0x9c8e98={'id':this['id'],'available':this[_0xe19c('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xe19c('0x17')],'paused':this[_0xe19c('0x13')],'waiting':this[_0xe19c('0x18')]};var _0x405124=md5(JSON['stringify'](_0x9c8e98));if(this[_0xe19c('0x1')]!==_0x405124){this[_0xe19c('0x1')]=_0x405124;io['to'](util['format'](_0xe19c('0x19'),_0x9c8e98[_0xe19c('0x17')]))[_0xe19c('0x1a')](_0xe19c('0x1b'),_0x9c8e98);}};module[_0xe19c('0x1c')]=ChatQueue; \ No newline at end of file +var _0x66b6=['chatPause','available','name','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online'];(function(_0x36bf46,_0x3d8db9){var _0x1d0a72=function(_0x328e8d){while(--_0x328e8d){_0x36bf46['push'](_0x36bf46['shift']());}};_0x1d0a72(++_0x3d8db9);}(_0x66b6,0x1ca));var _0x666b=function(_0x512973,_0x564e8b){_0x512973=_0x512973-0x0;var _0x32f2e1=_0x66b6[_0x512973];return _0x32f2e1;};'use strict';var _=require(_0x666b('0x0'));var md5=require(_0x666b('0x1'));var util=require(_0x666b('0x2'));var Redis=require(_0x666b('0x3'));var config=require(_0x666b('0x4'));config[_0x666b('0x5')]=_[_0x666b('0x6')](config[_0x666b('0x5')],{'host':_0x666b('0x7'),'port':0x18eb});var io=require(_0x666b('0x8'))(new Redis(config['redis']));function ChatQueue(_0xb483fe){this['id']=_0xb483fe['id']||0x0;this['name']=_0xb483fe['name']||'';this['timeout']=_0xb483fe[_0x666b('0x9')]||0xa;this['strategy']=_0xb483fe[_0x666b('0xa')]||'beepall';this[_0x666b('0xb')]=_0xb483fe[_0x666b('0xb')];this[_0x666b('0xc')]={};this['waiting']=0x0;this[_0x666b('0x1')]='';this[_0x666b('0xd')]();this[_0x666b('0xe')]();}ChatQueue[_0x666b('0xf')]['updateRouting']=function(){var _0x502e6b=this[_0x666b('0xc')]['_rr'];this['mapAgentsId']=_[_0x666b('0x10')](this[_0x666b('0xb')],'id');this['mapAgentsId'][_0x666b('0x11')]=_0x502e6b;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x666b('0x12')]=0x0;this[_0x666b('0x13')]=0x0;for(var _0x94ae5a=0x0;_0x94ae5a=0x0?this['available']:0x0;var _0x27b1cf={'id':this['id'],'available':this[_0x666b('0x17')],'loggedIn':this[_0x666b('0x12')],'name':this[_0x666b('0x18')],'paused':this['paused'],'waiting':this['waiting']};var _0x11c672=md5(JSON['stringify'](_0x27b1cf));if(this[_0x666b('0x1')]!==_0x11c672){this[_0x666b('0x1')]=_0x11c672;io['to'](util[_0x666b('0x19')](_0x666b('0x1a'),_0x27b1cf[_0x666b('0x18')]))[_0x666b('0x1b')](_0x666b('0x1c'),_0x27b1cf);}};module[_0x666b('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 2e6c9fd..da5ffac 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x3c5db8,_0x110185){var _0x3e6e16=function(_0x55747d){while(--_0x55747d){_0x3c5db8['push'](_0x3c5db8['shift']());}};_0x3e6e16(++_0x110185);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x191cb2,_0x1ead93){var _0x416338=function(_0x3e6b5b){while(--_0x3e6b5b){_0x191cb2['push'](_0x191cb2['shift']());}};_0x416338(++_0x1ead93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 500d1f5..584e7f1 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 _0xa31c=['name','Intervals','exports'];(function(_0x4f6794,_0x2252f7){var _0x5aecdd=function(_0x15971f){while(--_0x15971f){_0x4f6794['push'](_0x4f6794['shift']());}};_0x5aecdd(++_0x2252f7);}(_0xa31c,0x19b));var _0xca31=function(_0x22889a,_0x4b75f7){_0x22889a=_0x22889a-0x0;var _0x763d34=_0xa31c[_0x22889a];return _0x763d34;};'use strict';function Interval(_0xf10647){this['id']=_0xf10647['id']||0x0;this[_0xca31('0x0')]=_0xf10647[_0xca31('0x0')]||'';this[_0xca31('0x1')]=_0xf10647[_0xca31('0x1')]||{};}module[_0xca31('0x2')]=Interval; \ No newline at end of file +var _0x9f20=['exports','name','Intervals'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x9f20,0xc1));var _0x09f2=function(_0x18e0e7,_0xafa137){_0x18e0e7=_0x18e0e7-0x0;var _0x4c758d=_0x9f20[_0x18e0e7];return _0x4c758d;};'use strict';function Interval(_0x4fdd80){this['id']=_0x4fdd80['id']||0x0;this[_0x09f2('0x0')]=_0x4fdd80[_0x09f2('0x0')]||'';this['Intervals']=_0x4fdd80[_0x09f2('0x1')]||{};}module[_0x09f2('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 35d3156..5cd8f96 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 _0x597c=['updateRealtime','loggedIn','paused','length','online','available','stringify','mail:queue:%s','emit','mail_queue:save','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map'];(function(_0x3d7ee9,_0x290bae){var _0x2a20cf=function(_0x375221){while(--_0x375221){_0x3d7ee9['push'](_0x3d7ee9['shift']());}};_0x2a20cf(++_0x290bae);}(_0x597c,0x1da));var _0xc597=function(_0x164175,_0x231986){_0x164175=_0x164175-0x0;var _0x2be054=_0x597c[_0x164175];return _0x2be054;};'use strict';var _=require('lodash');var md5=require(_0xc597('0x0'));var util=require(_0xc597('0x1'));var Redis=require(_0xc597('0x2'));var config=require(_0xc597('0x3'));config['redis']=_[_0xc597('0x4')](config[_0xc597('0x5')],{'host':_0xc597('0x6'),'port':0x18eb});var io=require(_0xc597('0x7'))(new Redis(config[_0xc597('0x5')]));function MailQueue(_0x44fd10){this['id']=_0x44fd10['id']||0x0;this[_0xc597('0x8')]=_0x44fd10[_0xc597('0x8')]||'';this[_0xc597('0x9')]=_0x44fd10[_0xc597('0x9')]||0xa;this[_0xc597('0xa')]=_0x44fd10['strategy']||_0xc597('0xb');this[_0xc597('0xc')]=_0x44fd10['Agents'];this[_0xc597('0xd')]={};this[_0xc597('0xe')]=0x0;this['md5']='';this[_0xc597('0xf')]();this['updateRealtime']();}MailQueue[_0xc597('0x10')][_0xc597('0xf')]=function(){var _0x5e48d3=this[_0xc597('0xd')][_0xc597('0x11')];this['mapAgentsId']=_[_0xc597('0x12')](this[_0xc597('0xc')],'id');this[_0xc597('0xd')][_0xc597('0x11')]=_0x5e48d3;};MailQueue[_0xc597('0x10')][_0xc597('0x13')]=function(){this[_0xc597('0x14')]=0x0;this[_0xc597('0x15')]=0x0;for(var _0x401324=0x0;_0x401324=0x0?this[_0xc597('0x18')]:0x0;var _0x46484a={'id':this['id'],'available':this[_0xc597('0x18')],'loggedIn':this[_0xc597('0x14')],'name':this[_0xc597('0x8')],'paused':this[_0xc597('0x15')],'waiting':this[_0xc597('0xe')]};var _0x5660b4=md5(JSON[_0xc597('0x19')](_0x46484a));if(this[_0xc597('0x0')]!==_0x5660b4){this['md5']=_0x5660b4;io['to'](util['format'](_0xc597('0x1a'),_0x46484a[_0xc597('0x8')]))[_0xc597('0x1b')](_0xc597('0x1c'),_0x46484a);}};module['exports']=MailQueue; \ No newline at end of file +var _0xe205=['online','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused'];(function(_0x2cbbe6,_0x1cbfaa){var _0x2d137a=function(_0x27ffd1){while(--_0x27ffd1){_0x2cbbe6['push'](_0x2cbbe6['shift']());}};_0x2d137a(++_0x1cbfaa);}(_0xe205,0xb0));var _0x5e20=function(_0x3cdbc7,_0x2a7cb3){_0x3cdbc7=_0x3cdbc7-0x0;var _0x422d20=_0xe205[_0x3cdbc7];return _0x422d20;};'use strict';var _=require(_0x5e20('0x0'));var md5=require(_0x5e20('0x1'));var util=require('util');var Redis=require(_0x5e20('0x2'));var config=require('../../../config/environment');config[_0x5e20('0x3')]=_[_0x5e20('0x4')](config['redis'],{'host':_0x5e20('0x5'),'port':0x18eb});var io=require(_0x5e20('0x6'))(new Redis(config[_0x5e20('0x3')]));function MailQueue(_0x35f7f5){this['id']=_0x35f7f5['id']||0x0;this[_0x5e20('0x7')]=_0x35f7f5['name']||'';this[_0x5e20('0x8')]=_0x35f7f5[_0x5e20('0x8')]||0xa;this[_0x5e20('0x9')]=_0x35f7f5[_0x5e20('0x9')]||'beepall';this[_0x5e20('0xa')]=_0x35f7f5[_0x5e20('0xa')];this['mapAgentsId']={};this[_0x5e20('0xb')]=0x0;this[_0x5e20('0x1')]='';this[_0x5e20('0xc')]();this[_0x5e20('0xd')]();}MailQueue[_0x5e20('0xe')][_0x5e20('0xc')]=function(){var _0x2d0530=this[_0x5e20('0xf')][_0x5e20('0x10')];this[_0x5e20('0xf')]=_[_0x5e20('0x11')](this['Agents'],'id');this[_0x5e20('0xf')][_0x5e20('0x10')]=_0x2d0530;};MailQueue[_0x5e20('0xe')]['updateRealtime']=function(){this[_0x5e20('0x12')]=0x0;this[_0x5e20('0x13')]=0x0;for(var _0x6e6a5=0x0;_0x6e6a5=0x0?this[_0x5e20('0x16')]:0x0;var _0x547204={'id':this['id'],'available':this[_0x5e20('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x5e20('0x7')],'paused':this[_0x5e20('0x13')],'waiting':this[_0x5e20('0xb')]};var _0x318ccd=md5(JSON[_0x5e20('0x17')](_0x547204));if(this[_0x5e20('0x1')]!==_0x318ccd){this[_0x5e20('0x1')]=_0x318ccd;io['to'](util['format'](_0x5e20('0x18'),_0x547204['name']))[_0x5e20('0x19')](_0x5e20('0x1a'),_0x547204);}};module[_0x5e20('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e97bd65..a1b168c 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 _0x5c32=['redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','paused','length','online','loggedIn','openchannelPause','available','stringify','format','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment'];(function(_0x12270f,_0x3f1c41){var _0x10849f=function(_0x246913){while(--_0x246913){_0x12270f['push'](_0x12270f['shift']());}};_0x10849f(++_0x3f1c41);}(_0x5c32,0x1a0));var _0x25c3=function(_0x581741,_0x1209cc){_0x581741=_0x581741-0x0;var _0x2902c0=_0x5c32[_0x581741];return _0x2902c0;};'use strict';var _=require('lodash');var md5=require(_0x25c3('0x0'));var util=require(_0x25c3('0x1'));var Redis=require(_0x25c3('0x2'));var config=require(_0x25c3('0x3'));config[_0x25c3('0x4')]=_[_0x25c3('0x5')](config[_0x25c3('0x4')],{'host':_0x25c3('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function OpenchannelQueue(_0x5c7a15){this['id']=_0x5c7a15['id']||0x0;this[_0x25c3('0x7')]=_0x5c7a15[_0x25c3('0x7')]||'';this[_0x25c3('0x8')]=_0x5c7a15[_0x25c3('0x8')]||0xa;this[_0x25c3('0x9')]=_0x5c7a15[_0x25c3('0x9')]||_0x25c3('0xa');this[_0x25c3('0xb')]=_0x5c7a15[_0x25c3('0xb')];this['mapAgentsId']={};this[_0x25c3('0xc')]=0x0;this[_0x25c3('0x0')]='';this[_0x25c3('0xd')]();this[_0x25c3('0xe')]();}OpenchannelQueue[_0x25c3('0xf')]['updateRouting']=function(){var _0x57b970=this[_0x25c3('0x10')]['_rr'];this[_0x25c3('0x10')]=_['map'](this[_0x25c3('0xb')],'id');this[_0x25c3('0x10')][_0x25c3('0x11')]=_0x57b970;};OpenchannelQueue[_0x25c3('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x25c3('0x12')]=0x0;for(var _0x4d02ae=0x0;_0x4d02ae=0x0?this['available']:0x0;var _0xfd8ec0={'id':this['id'],'available':this['available'],'loggedIn':this[_0x25c3('0x15')],'name':this['name'],'paused':this[_0x25c3('0x12')],'waiting':this[_0x25c3('0xc')]};var _0x1a7d1f=md5(JSON[_0x25c3('0x18')](_0xfd8ec0));if(this[_0x25c3('0x0')]!==_0x1a7d1f){this[_0x25c3('0x0')]=_0x1a7d1f;io['to'](util[_0x25c3('0x19')]('openchannel:queue:%s',_0xfd8ec0[_0x25c3('0x7')]))['emit'](_0x25c3('0x1a'),_0xfd8ec0);}};module[_0x25c3('0x1b')]=OpenchannelQueue; \ No newline at end of file +var _0x768b=['emit','openchannel_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','openchannelPause','available','format','openchannel:queue:%s'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0x768b,0x1e2));var _0xb768=function(_0x4a01d1,_0x72a2c8){_0x4a01d1=_0x4a01d1-0x0;var _0x385fdd=_0x768b[_0x4a01d1];return _0x385fdd;};'use strict';var _=require(_0xb768('0x0'));var md5=require('md5');var util=require(_0xb768('0x1'));var Redis=require(_0xb768('0x2'));var config=require(_0xb768('0x3'));config[_0xb768('0x4')]=_[_0xb768('0x5')](config[_0xb768('0x4')],{'host':_0xb768('0x6'),'port':0x18eb});var io=require(_0xb768('0x7'))(new Redis(config['redis']));function OpenchannelQueue(_0x23838f){this['id']=_0x23838f['id']||0x0;this[_0xb768('0x8')]=_0x23838f[_0xb768('0x8')]||'';this[_0xb768('0x9')]=_0x23838f[_0xb768('0x9')]||0xa;this[_0xb768('0xa')]=_0x23838f[_0xb768('0xa')]||_0xb768('0xb');this['Agents']=_0x23838f[_0xb768('0xc')];this[_0xb768('0xd')]={};this[_0xb768('0xe')]=0x0;this[_0xb768('0xf')]='';this[_0xb768('0x10')]();this[_0xb768('0x11')]();}OpenchannelQueue[_0xb768('0x12')][_0xb768('0x10')]=function(){var _0x191a3a=this[_0xb768('0xd')][_0xb768('0x13')];this['mapAgentsId']=_[_0xb768('0x14')](this[_0xb768('0xc')],'id');this[_0xb768('0xd')][_0xb768('0x13')]=_0x191a3a;};OpenchannelQueue['prototype']['updateRealtime']=function(){this[_0xb768('0x15')]=0x0;this[_0xb768('0x16')]=0x0;for(var _0x1af15c=0x0;_0x1af15c=0x0?this['available']:0x0;var _0x465e9f={'id':this['id'],'available':this[_0xb768('0x19')],'loggedIn':this[_0xb768('0x15')],'name':this[_0xb768('0x8')],'paused':this['paused'],'waiting':this[_0xb768('0xe')]};var _0x1f3d30=md5(JSON['stringify'](_0x465e9f));if(this[_0xb768('0xf')]!==_0x1f3d30){this[_0xb768('0xf')]=_0x1f3d30;io['to'](util[_0xb768('0x1a')](_0xb768('0x1b'),_0x465e9f[_0xb768('0x8')]))[_0xb768('0x1c')](_0xb768('0x1d'),_0x465e9f);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index aa46a21..a86c8cf 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 _0xd8b0=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x1bf811,_0x4ea6da){var _0x39b951=function(_0x52d747){while(--_0x52d747){_0x1bf811['push'](_0x1bf811['shift']());}};_0x39b951(++_0x4ea6da);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var md5=require(_0x0d8b('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0d8b('0x2')]=_[_0x0d8b('0x3')](config[_0x0d8b('0x2')],{'host':_0x0d8b('0x4'),'port':0x18eb});var io=require(_0x0d8b('0x5'))(new Redis(config['redis']));function SmsQueue(_0x5e15e6){this['id']=_0x5e15e6['id']||0x0;this[_0x0d8b('0x6')]=_0x5e15e6[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5e15e6['timeout']||0xa;this[_0x0d8b('0x8')]=_0x5e15e6[_0x0d8b('0x8')]||'beepall';this[_0x0d8b('0x9')]=_0x5e15e6[_0x0d8b('0x9')];this[_0x0d8b('0xa')]={};this[_0x0d8b('0xb')]=0x0;this[_0x0d8b('0x1')]='';this[_0x0d8b('0xc')]();this[_0x0d8b('0xd')]();}SmsQueue[_0x0d8b('0xe')]['updateRouting']=function(){var _0x3c4bfa=this['mapAgentsId'][_0x0d8b('0xf')];this[_0x0d8b('0xa')]=_[_0x0d8b('0x10')](this[_0x0d8b('0x9')],'id');this[_0x0d8b('0xa')][_0x0d8b('0xf')]=_0x3c4bfa;};SmsQueue[_0x0d8b('0xe')][_0x0d8b('0xd')]=function(){this[_0x0d8b('0x11')]=0x0;this[_0x0d8b('0x12')]=0x0;for(var _0x5ad086=0x0;_0x5ad086=0x0?this[_0x0d8b('0x15')]:0x0;var _0x333674={'id':this['id'],'available':this[_0x0d8b('0x15')],'loggedIn':this[_0x0d8b('0x11')],'name':this[_0x0d8b('0x6')],'paused':this['paused'],'waiting':this[_0x0d8b('0xb')]};var _0x23d58f=md5(JSON[_0x0d8b('0x16')](_0x333674));if(this[_0x0d8b('0x1')]!==_0x23d58f){this[_0x0d8b('0x1')]=_0x23d58f;io['to'](util[_0x0d8b('0x17')](_0x0d8b('0x18'),_0x333674[_0x0d8b('0x6')]))['emit']('sms_queue:save',_0x333674);}};module[_0x0d8b('0x19')]=SmsQueue; \ No newline at end of file +var _0xe706=['prototype','_rr','map','online','loggedIn','smsPause','available','paused','stringify','format','sms:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0xe706,0xa3));var _0x6e70=function(_0x13256a,_0x44d0a2){_0x13256a=_0x13256a-0x0;var _0x59ad3b=_0xe706[_0x13256a];return _0x59ad3b;};'use strict';var _=require(_0x6e70('0x0'));var md5=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var Redis=require('ioredis');var config=require(_0x6e70('0x3'));config[_0x6e70('0x4')]=_[_0x6e70('0x5')](config[_0x6e70('0x4')],{'host':_0x6e70('0x6'),'port':0x18eb});var io=require(_0x6e70('0x7'))(new Redis(config[_0x6e70('0x4')]));function SmsQueue(_0x506db9){this['id']=_0x506db9['id']||0x0;this[_0x6e70('0x8')]=_0x506db9[_0x6e70('0x8')]||'';this[_0x6e70('0x9')]=_0x506db9[_0x6e70('0x9')]||0xa;this[_0x6e70('0xa')]=_0x506db9[_0x6e70('0xa')]||_0x6e70('0xb');this[_0x6e70('0xc')]=_0x506db9[_0x6e70('0xc')];this[_0x6e70('0xd')]={};this[_0x6e70('0xe')]=0x0;this[_0x6e70('0x1')]='';this[_0x6e70('0xf')]();this[_0x6e70('0x10')]();}SmsQueue[_0x6e70('0x11')][_0x6e70('0xf')]=function(){var _0x5b3d07=this['mapAgentsId'][_0x6e70('0x12')];this[_0x6e70('0xd')]=_[_0x6e70('0x13')](this[_0x6e70('0xc')],'id');this[_0x6e70('0xd')][_0x6e70('0x12')]=_0x5b3d07;};SmsQueue[_0x6e70('0x11')][_0x6e70('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x48bc72=0x0;_0x48bc72=0x0?this['available']:0x0;var _0x28a21f={'id':this['id'],'available':this[_0x6e70('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x6e70('0x18')],'waiting':this[_0x6e70('0xe')]};var _0x2368eb=md5(JSON[_0x6e70('0x19')](_0x28a21f));if(this[_0x6e70('0x1')]!==_0x2368eb){this[_0x6e70('0x1')]=_0x2368eb;io['to'](util[_0x6e70('0x1a')](_0x6e70('0x1b'),_0x28a21f[_0x6e70('0x8')]))[_0x6e70('0x1c')]('sms_queue:save',_0x28a21f);}};module[_0x6e70('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 51a6286..a55209d 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 _0x49c0=['initChatQueues','chatQueues','initMailQueues','initFaxQueues','exports','bluebird','lodash','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/faxQueue','agents','intervals','openchannelQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initOpenchannelQueues','updateRouting','updateRealtime'];(function(_0x1f91aa,_0x4d64f5){var _0x3d0f2e=function(_0x181442){while(--_0x181442){_0x1f91aa['push'](_0x1f91aa['shift']());}};_0x3d0f2e(++_0x4d64f5);}(_0x49c0,0x165));var _0x049c=function(_0x20148f,_0x3e94c9){_0x20148f=_0x20148f-0x0;var _0x116349=_0x49c0[_0x20148f];return _0x116349;};'use strict';var BPromise=require(_0x049c('0x0'));var util=require('util');var _=require(_0x049c('0x1'));var moment=require(_0x049c('0x2'));var Agent=require(_0x049c('0x3'));var Interval=require(_0x049c('0x4'));var OpenchannelQueue=require(_0x049c('0x5'));var ChatQueue=require(_0x049c('0x6'));var SmsQueue=require(_0x049c('0x7'));var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0x049c('0x8'));var Realtime=function(){this[_0x049c('0x9')]={};this[_0x049c('0xa')]={};this[_0x049c('0xb')]={};this['chatQueues']={};this[_0x049c('0xc')]={};this[_0x049c('0xd')]={};this[_0x049c('0xe')]={};this[_0x049c('0xf')]={};this['mailQueuesWaitingInteractions']={};this[_0x049c('0x10')]={};this['smsQueuesWaitingInteractions']={};this[_0x049c('0x11')]={};};function freeIsNotKey(_0x138173,_0x15daf2,_0x13f868){var _0x4b492d=_['mapKeys'](_0x138173,function(_0x16433b,_0x1909b4){return _0x16433b[_0x13f868];});for(var _0xbacda5 in _0x15daf2){if(_0x15daf2[_0x049c('0x12')](_0xbacda5)){if(!_0x4b492d[_0xbacda5]){delete _0x15daf2[_0xbacda5];}}}}Realtime[_0x049c('0x13')][_0x049c('0x14')]=function(_0x50c65a,_0x1a417c){for(var _0x3a6f59 in _0x1a417c){if(_0x50c65a[_0x049c('0x12')](_0x3a6f59)){_0x50c65a[_0x3a6f59]=_0x1a417c[_0x3a6f59];}}};Realtime[_0x049c('0x13')][_0x049c('0x15')]=function(){var _0xc2245c=this;return function(_0x404e98){if(_0x404e98){freeIsNotKey(_0x404e98,_0xc2245c['agents'],'id');for(var _0xe90237=0x0,_0x5379fd={},_0xa2f355={};_0xe90237<_0x404e98[_0x049c('0x16')];_0xe90237+=0x1){_0x5379fd=_0x404e98[_0xe90237];if(_[_0x049c('0x17')](_0xc2245c['agents'][_0x5379fd['id']])){_0xc2245c[_0x049c('0x9')][_0x5379fd['id']]=new Agent(_0x5379fd);}else{_0xc2245c[_0x049c('0x14')](_0xc2245c['agents'][_0x5379fd['id']],_0x5379fd);}}}return _0xc2245c['agents'];};};Realtime[_0x049c('0x13')]['initIntervals']=function(){var _0x275a4a=this;return function(_0x29aa97){if(_0x29aa97){freeIsNotKey(_0x29aa97,_0x275a4a[_0x049c('0xa')],'id');for(var _0x5e2936=0x0,_0x2f8d7d={},_0x1c3a79={};_0x5e2936<_0x29aa97[_0x049c('0x16')];_0x5e2936+=0x1){_0x2f8d7d=_0x29aa97[_0x5e2936];if(_['isUndefined'](_0x275a4a[_0x049c('0xa')][_0x2f8d7d['id']])){_0x275a4a['intervals'][_0x2f8d7d['id']]=new Interval(_0x2f8d7d);}else{_0x275a4a[_0x049c('0x14')](_0x275a4a[_0x049c('0xa')][_0x2f8d7d['id']],_0x2f8d7d);}}}return _0x275a4a[_0x049c('0xa')];};};Realtime[_0x049c('0x13')][_0x049c('0x18')]=function(){var _0x454564=this;return function(_0x293a30){if(_0x293a30){freeIsNotKey(_0x293a30,_0x454564['openchannelQueues'],'id');for(var _0x465e08=0x0,_0x5b124d={},_0x4f3a7c={};_0x465e08<_0x293a30['length'];_0x465e08+=0x1){_0x5b124d=_0x293a30[_0x465e08];if(_[_0x049c('0x17')](_0x454564[_0x049c('0xb')][_0x5b124d['id']])){_0x454564[_0x049c('0xb')][_0x5b124d['id']]=new OpenchannelQueue(_0x5b124d);}else{_0x454564[_0x049c('0x14')](_0x454564[_0x049c('0xb')][_0x5b124d['id']],_0x5b124d);}_0x454564[_0x049c('0xb')][_0x5b124d['id']][_0x049c('0x19')]();_0x454564[_0x049c('0xb')][_0x5b124d['id']][_0x049c('0x1a')]();}}return _0x454564['openchannelQueues'];};};Realtime[_0x049c('0x13')][_0x049c('0x1b')]=function(){var _0x125f17=this;return function(_0x144fc5){if(_0x144fc5){freeIsNotKey(_0x144fc5,_0x125f17['chatQueues'],'id');for(var _0xe38e47=0x0,_0x1e643e={},_0x5e7589={};_0xe38e47<_0x144fc5[_0x049c('0x16')];_0xe38e47+=0x1){_0x1e643e=_0x144fc5[_0xe38e47];if(_[_0x049c('0x17')](_0x125f17['chatQueues'][_0x1e643e['id']])){_0x125f17[_0x049c('0x1c')][_0x1e643e['id']]=new ChatQueue(_0x1e643e);}else{_0x125f17[_0x049c('0x14')](_0x125f17[_0x049c('0x1c')][_0x1e643e['id']],_0x1e643e);}_0x125f17[_0x049c('0x1c')][_0x1e643e['id']][_0x049c('0x19')]();_0x125f17[_0x049c('0x1c')][_0x1e643e['id']][_0x049c('0x1a')]();}}return _0x125f17[_0x049c('0x1c')];};};Realtime[_0x049c('0x13')]['initSmsQueues']=function(){var _0x4054b4=this;return function(_0x176241){if(_0x176241){freeIsNotKey(_0x176241,_0x4054b4[_0x049c('0xc')],'id');for(var _0x2dec48=0x0,_0x38b73a={},_0x9e29df={};_0x2dec48<_0x176241[_0x049c('0x16')];_0x2dec48+=0x1){_0x38b73a=_0x176241[_0x2dec48];if(_['isUndefined'](_0x4054b4[_0x049c('0xc')][_0x38b73a['id']])){_0x4054b4[_0x049c('0xc')][_0x38b73a['id']]=new SmsQueue(_0x38b73a);}else{_0x4054b4[_0x049c('0x14')](_0x4054b4[_0x049c('0xc')][_0x38b73a['id']],_0x38b73a);}_0x4054b4[_0x049c('0xc')][_0x38b73a['id']][_0x049c('0x19')]();_0x4054b4[_0x049c('0xc')][_0x38b73a['id']][_0x049c('0x1a')]();}}return _0x4054b4[_0x049c('0xc')];};};Realtime[_0x049c('0x13')][_0x049c('0x1d')]=function(){var _0x2b1ddb=this;return function(_0x51e52f){if(_0x51e52f){freeIsNotKey(_0x51e52f,_0x2b1ddb[_0x049c('0xd')],'id');for(var _0x480a1a=0x0,_0x209213={},_0x733821={};_0x480a1a<_0x51e52f[_0x049c('0x16')];_0x480a1a+=0x1){_0x209213=_0x51e52f[_0x480a1a];if(_[_0x049c('0x17')](_0x2b1ddb[_0x049c('0xd')][_0x209213['id']])){_0x2b1ddb[_0x049c('0xd')][_0x209213['id']]=new MailQueue(_0x209213);}else{_0x2b1ddb[_0x049c('0x14')](_0x2b1ddb[_0x049c('0xd')][_0x209213['id']],_0x209213);}_0x2b1ddb[_0x049c('0xd')][_0x209213['id']][_0x049c('0x19')]();_0x2b1ddb['mailQueues'][_0x209213['id']]['updateRealtime']();}}return _0x2b1ddb[_0x049c('0xd')];};};Realtime['prototype'][_0x049c('0x1e')]=function(){var _0x3f5bb1=this;return function(_0x449e22){if(_0x449e22){freeIsNotKey(_0x449e22,_0x3f5bb1[_0x049c('0xe')],'id');for(var _0x179154=0x0,_0x58633f={},_0x59f55b={};_0x179154<_0x449e22['length'];_0x179154+=0x1){_0x58633f=_0x449e22[_0x179154];if(_[_0x049c('0x17')](_0x3f5bb1[_0x049c('0xe')][_0x58633f['id']])){_0x3f5bb1[_0x049c('0xe')][_0x58633f['id']]=new FaxQueue(_0x58633f);}else{_0x3f5bb1[_0x049c('0x14')](_0x3f5bb1[_0x049c('0xe')][_0x58633f['id']],_0x58633f);}_0x3f5bb1[_0x049c('0xe')][_0x58633f['id']]['updateRouting']();_0x3f5bb1[_0x049c('0xe')][_0x58633f['id']][_0x049c('0x1a')]();}}return _0x3f5bb1[_0x049c('0xe')];};};module[_0x049c('0x1f')]=Realtime; \ No newline at end of file +var _0xcc59=['util','moment','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','initAgents','length','isUndefined','mergeFromDatabase','initIntervals','updateRouting','updateRealtime','initChatQueues','initSmsQueues','initMailQueues','initFaxQueues','faxQueues'];(function(_0x255e42,_0x1b8f05){var _0x36151c=function(_0x342cdc){while(--_0x342cdc){_0x255e42['push'](_0x255e42['shift']());}};_0x36151c(++_0x1b8f05);}(_0xcc59,0x186));var _0x9cc5=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xcc59[_0x2341c6];return _0x54c34d;};'use strict';var BPromise=require('bluebird');var util=require(_0x9cc5('0x0'));var _=require('lodash');var moment=require(_0x9cc5('0x1'));var Agent=require('../model/agent');var Interval=require(_0x9cc5('0x2'));var OpenchannelQueue=require(_0x9cc5('0x3'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x9cc5('0x4'));var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0x9cc5('0x5'));var Realtime=function(){this[_0x9cc5('0x6')]={};this[_0x9cc5('0x7')]={};this[_0x9cc5('0x8')]={};this[_0x9cc5('0x9')]={};this[_0x9cc5('0xa')]={};this[_0x9cc5('0xb')]={};this['faxQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x9cc5('0xc')]={};this[_0x9cc5('0xd')]={};this[_0x9cc5('0xe')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x105e52,_0x10d49e,_0x5b9bec){var _0x37dd81=_[_0x9cc5('0xf')](_0x105e52,function(_0x8abd8d,_0x12f6b1){return _0x8abd8d[_0x5b9bec];});for(var _0x413ccc in _0x10d49e){if(_0x10d49e[_0x9cc5('0x10')](_0x413ccc)){if(!_0x37dd81[_0x413ccc]){delete _0x10d49e[_0x413ccc];}}}}Realtime[_0x9cc5('0x11')]['mergeFromDatabase']=function(_0x3c0408,_0x1108a9){for(var _0x8a541b in _0x1108a9){if(_0x3c0408[_0x9cc5('0x10')](_0x8a541b)){_0x3c0408[_0x8a541b]=_0x1108a9[_0x8a541b];}}};Realtime[_0x9cc5('0x11')][_0x9cc5('0x12')]=function(){var _0x362aa7=this;return function(_0x177c43){if(_0x177c43){freeIsNotKey(_0x177c43,_0x362aa7[_0x9cc5('0x6')],'id');for(var _0x3427ea=0x0,_0x115e04={},_0x30f5e4={};_0x3427ea<_0x177c43[_0x9cc5('0x13')];_0x3427ea+=0x1){_0x115e04=_0x177c43[_0x3427ea];if(_[_0x9cc5('0x14')](_0x362aa7[_0x9cc5('0x6')][_0x115e04['id']])){_0x362aa7[_0x9cc5('0x6')][_0x115e04['id']]=new Agent(_0x115e04);}else{_0x362aa7[_0x9cc5('0x15')](_0x362aa7[_0x9cc5('0x6')][_0x115e04['id']],_0x115e04);}}}return _0x362aa7[_0x9cc5('0x6')];};};Realtime[_0x9cc5('0x11')][_0x9cc5('0x16')]=function(){var _0xbbe623=this;return function(_0x119110){if(_0x119110){freeIsNotKey(_0x119110,_0xbbe623[_0x9cc5('0x7')],'id');for(var _0xa1b49=0x0,_0xdaeffc={},_0x2644e6={};_0xa1b49<_0x119110[_0x9cc5('0x13')];_0xa1b49+=0x1){_0xdaeffc=_0x119110[_0xa1b49];if(_[_0x9cc5('0x14')](_0xbbe623[_0x9cc5('0x7')][_0xdaeffc['id']])){_0xbbe623[_0x9cc5('0x7')][_0xdaeffc['id']]=new Interval(_0xdaeffc);}else{_0xbbe623[_0x9cc5('0x15')](_0xbbe623[_0x9cc5('0x7')][_0xdaeffc['id']],_0xdaeffc);}}}return _0xbbe623[_0x9cc5('0x7')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x5dd420=this;return function(_0x3750b9){if(_0x3750b9){freeIsNotKey(_0x3750b9,_0x5dd420[_0x9cc5('0x8')],'id');for(var _0x44dda=0x0,_0xc92763={},_0xc91b31={};_0x44dda<_0x3750b9['length'];_0x44dda+=0x1){_0xc92763=_0x3750b9[_0x44dda];if(_[_0x9cc5('0x14')](_0x5dd420['openchannelQueues'][_0xc92763['id']])){_0x5dd420['openchannelQueues'][_0xc92763['id']]=new OpenchannelQueue(_0xc92763);}else{_0x5dd420[_0x9cc5('0x15')](_0x5dd420[_0x9cc5('0x8')][_0xc92763['id']],_0xc92763);}_0x5dd420[_0x9cc5('0x8')][_0xc92763['id']][_0x9cc5('0x17')]();_0x5dd420[_0x9cc5('0x8')][_0xc92763['id']][_0x9cc5('0x18')]();}}return _0x5dd420[_0x9cc5('0x8')];};};Realtime[_0x9cc5('0x11')][_0x9cc5('0x19')]=function(){var _0x4f3921=this;return function(_0x2ce069){if(_0x2ce069){freeIsNotKey(_0x2ce069,_0x4f3921[_0x9cc5('0x9')],'id');for(var _0x24ac05=0x0,_0xdf0b03={},_0x4633eb={};_0x24ac05<_0x2ce069[_0x9cc5('0x13')];_0x24ac05+=0x1){_0xdf0b03=_0x2ce069[_0x24ac05];if(_[_0x9cc5('0x14')](_0x4f3921[_0x9cc5('0x9')][_0xdf0b03['id']])){_0x4f3921[_0x9cc5('0x9')][_0xdf0b03['id']]=new ChatQueue(_0xdf0b03);}else{_0x4f3921['mergeFromDatabase'](_0x4f3921[_0x9cc5('0x9')][_0xdf0b03['id']],_0xdf0b03);}_0x4f3921[_0x9cc5('0x9')][_0xdf0b03['id']][_0x9cc5('0x17')]();_0x4f3921[_0x9cc5('0x9')][_0xdf0b03['id']]['updateRealtime']();}}return _0x4f3921[_0x9cc5('0x9')];};};Realtime['prototype'][_0x9cc5('0x1a')]=function(){var _0x40077f=this;return function(_0x20563f){if(_0x20563f){freeIsNotKey(_0x20563f,_0x40077f[_0x9cc5('0xa')],'id');for(var _0x7bfc8=0x0,_0x591eee={},_0x22a8e1={};_0x7bfc8<_0x20563f[_0x9cc5('0x13')];_0x7bfc8+=0x1){_0x591eee=_0x20563f[_0x7bfc8];if(_['isUndefined'](_0x40077f['smsQueues'][_0x591eee['id']])){_0x40077f[_0x9cc5('0xa')][_0x591eee['id']]=new SmsQueue(_0x591eee);}else{_0x40077f[_0x9cc5('0x15')](_0x40077f[_0x9cc5('0xa')][_0x591eee['id']],_0x591eee);}_0x40077f['smsQueues'][_0x591eee['id']]['updateRouting']();_0x40077f[_0x9cc5('0xa')][_0x591eee['id']][_0x9cc5('0x18')]();}}return _0x40077f[_0x9cc5('0xa')];};};Realtime[_0x9cc5('0x11')][_0x9cc5('0x1b')]=function(){var _0x328875=this;return function(_0x277c1d){if(_0x277c1d){freeIsNotKey(_0x277c1d,_0x328875['mailQueues'],'id');for(var _0x2e4f9a=0x0,_0x4bd176={},_0xf15b86={};_0x2e4f9a<_0x277c1d['length'];_0x2e4f9a+=0x1){_0x4bd176=_0x277c1d[_0x2e4f9a];if(_[_0x9cc5('0x14')](_0x328875[_0x9cc5('0xb')][_0x4bd176['id']])){_0x328875['mailQueues'][_0x4bd176['id']]=new MailQueue(_0x4bd176);}else{_0x328875[_0x9cc5('0x15')](_0x328875['mailQueues'][_0x4bd176['id']],_0x4bd176);}_0x328875['mailQueues'][_0x4bd176['id']][_0x9cc5('0x17')]();_0x328875[_0x9cc5('0xb')][_0x4bd176['id']][_0x9cc5('0x18')]();}}return _0x328875['mailQueues'];};};Realtime[_0x9cc5('0x11')][_0x9cc5('0x1c')]=function(){var _0x45ccbd=this;return function(_0x1ff8b6){if(_0x1ff8b6){freeIsNotKey(_0x1ff8b6,_0x45ccbd[_0x9cc5('0x1d')],'id');for(var _0x37e542=0x0,_0x9129a7={},_0x4b1eae={};_0x37e542<_0x1ff8b6[_0x9cc5('0x13')];_0x37e542+=0x1){_0x9129a7=_0x1ff8b6[_0x37e542];if(_[_0x9cc5('0x14')](_0x45ccbd[_0x9cc5('0x1d')][_0x9129a7['id']])){_0x45ccbd[_0x9cc5('0x1d')][_0x9129a7['id']]=new FaxQueue(_0x9129a7);}else{_0x45ccbd[_0x9cc5('0x15')](_0x45ccbd['faxQueues'][_0x9129a7['id']],_0x9129a7);}_0x45ccbd['faxQueues'][_0x9129a7['id']][_0x9cc5('0x17')]();_0x45ccbd[_0x9cc5('0x1d')][_0x9129a7['id']][_0x9cc5('0x18')]();}}return _0x45ccbd[_0x9cc5('0x1d')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index fe95358..2821873 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 _0x7dac=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7dac,0xbc));var _0xc7da=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7dac[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0xc7da('0x0'));exports[_0xc7da('0x1')]=function(_0x3aca82,_0xb057e8){return client[_0xc7da('0x2')](_0xc7da('0x3'),{'body':_0xb057e8,'options':{'where':{'id':_0x3aca82}},'log':_0xc7da('0x4')});};exports[_0xc7da('0x5')]=function(_0x2c9c8d,_0x503353){return client[_0xc7da('0x2')](_0xc7da('0x6'),{'body':_0x503353,'options':{'where':{'id':_0x2c9c8d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x2ca9=['AddTagsToChatInteraction','addTagsToChatInteraction','update','updateChatInteraction','Request'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x2ca9,0x11a));var _0x92ca=function(_0x4d3d41,_0x5f41d9){_0x4d3d41=_0x4d3d41-0x0;var _0x43244d=_0x2ca9[_0x4d3d41];return _0x43244d;};'use strict';var client=require('../client');exports[_0x92ca('0x0')]=function(_0x592aae,_0x47a97d){return client['Request']('UpdateChatInteraction',{'body':_0x47a97d,'options':{'where':{'id':_0x592aae}},'log':_0x92ca('0x1')});};exports['addTags']=function(_0x1befcb,_0x449bf2){return client[_0x92ca('0x2')](_0x92ca('0x3'),{'body':_0x449bf2,'options':{'where':{'id':_0x1befcb}},'log':_0x92ca('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 58a629b..ad6d075 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 _0xb7e5=['create','Request','CreateChatMessage','createChatMessage'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0xb7e5,0x1f0));var _0x5b7e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb7e5[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x5b7e('0x0')]=function(_0x65ec7c){return client[_0x5b7e('0x1')](_0x5b7e('0x2'),{'body':_0x65ec7c,'log':_0x5b7e('0x3')});}; \ No newline at end of file +var _0x5cc7=['Request','createChatMessage'];(function(_0x153ef2,_0x58fade){var _0x4c6cae=function(_0x12fb90){while(--_0x12fb90){_0x153ef2['push'](_0x153ef2['shift']());}};_0x4c6cae(++_0x58fade);}(_0x5cc7,0xa0));var _0x75cc=function(_0x28f0e6,_0x1fc6e4){_0x28f0e6=_0x28f0e6-0x0;var _0x17b357=_0x5cc7[_0x28f0e6];return _0x17b357;};'use strict';var client=require('../client');exports['create']=function(_0x31ca11){return client[_0x75cc('0x0')]('CreateChatMessage',{'body':_0x31ca11,'log':_0x75cc('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index a1d7bbc..faf97cb 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 _0x32f4=['Request','GetChatQueue','name','timeout','User','Agents','online','chatPause','../client','getChatQueues'];(function(_0xef4022,_0x46199c){var _0xaf9621=function(_0x528415){while(--_0x528415){_0xef4022['push'](_0xef4022['shift']());}};_0xaf9621(++_0x46199c);}(_0x32f4,0x18e));var _0x432f=function(_0x1d5ccd,_0x1f7b5c){_0x1d5ccd=_0x1d5ccd-0x0;var _0x3130dc=_0x32f4[_0x1d5ccd];return _0x3130dc;};'use strict';var client=require(_0x432f('0x0'));exports[_0x432f('0x1')]=function(){return function(){return client[_0x432f('0x2')](_0x432f('0x3'),{'options':{'raw':![],'attributes':['id',_0x432f('0x4'),_0x432f('0x5'),'strategy'],'include':[{'model':_0x432f('0x6'),'as':_0x432f('0x7'),'attributes':['id',_0x432f('0x4'),_0x432f('0x8'),_0x432f('0x9')]}]},'log':_0x432f('0x1')});};}; \ No newline at end of file +var _0xc0f5=['User','Agents','online','chatPause','../client','getChatQueues','Request','name','timeout','strategy'];(function(_0x4acc3,_0x33700c){var _0x53470e=function(_0xd23f9f){while(--_0xd23f9f){_0x4acc3['push'](_0x4acc3['shift']());}};_0x53470e(++_0x33700c);}(_0xc0f5,0x1d0));var _0x5c0f=function(_0x53b533,_0x55c824){_0x53b533=_0x53b533-0x0;var _0x5d3201=_0xc0f5[_0x53b533];return _0x5d3201;};'use strict';var client=require(_0x5c0f('0x0'));exports[_0x5c0f('0x1')]=function(){return function(){return client[_0x5c0f('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x5c0f('0x3'),_0x5c0f('0x4'),_0x5c0f('0x5')],'include':[{'model':_0x5c0f('0x6'),'as':_0x5c0f('0x7'),'attributes':['id',_0x5c0f('0x3'),_0x5c0f('0x8'),_0x5c0f('0x9')]}]},'log':_0x5c0f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 345cdba..55b06ae 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 _0x956a=['DESC','UpdateChatQueueReport','create','Request','CreateChatQueueReport','update'];(function(_0x36d8a1,_0x4c1b92){var _0xb20f6b=function(_0x5e1216){while(--_0x5e1216){_0x36d8a1['push'](_0x36d8a1['shift']());}};_0xb20f6b(++_0x4c1b92);}(_0x956a,0xb6));var _0xa956=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x956a[_0x502c7d];return _0x30b7ed;};'use strict';var client=require('../client');exports[_0xa956('0x0')]=function(_0x238805){return client[_0xa956('0x1')](_0xa956('0x2'),{'body':_0x238805,'log':_0xa956('0x2')});};exports[_0xa956('0x3')]=function(_0x331696,_0x38c808){return client['Request']('UpdateChatQueueReport',{'body':_0x38c808,'options':{'where':{'uniqueid':_0x331696},'order':[['id',_0xa956('0x4')]],'limit':0x1},'log':_0xa956('0x5')});}; \ No newline at end of file +var _0x2621=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0xdbc5d,_0x2f34a0){var _0x18717a=function(_0x4fcd0e){while(--_0x4fcd0e){_0xdbc5d['push'](_0xdbc5d['shift']());}};_0x18717a(++_0x2f34a0);}(_0x2621,0x1d2));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x1262('0x0'));exports[_0x1262('0x1')]=function(_0x450648){return client[_0x1262('0x2')](_0x1262('0x3'),{'body':_0x450648,'log':_0x1262('0x3')});};exports[_0x1262('0x4')]=function(_0xbabce3,_0x192339){return client[_0x1262('0x2')](_0x1262('0x5'),{'body':_0x192339,'options':{'where':{'uniqueid':_0xbabce3},'order':[['id',_0x1262('0x6')]],'limit':0x1},'log':_0x1262('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 57975b1..ca06d80 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 _0x47b8=['addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','Request'];(function(_0x4f4e95,_0x472c60){var _0x223720=function(_0xbd45d6){while(--_0xbd45d6){_0x4f4e95['push'](_0x4f4e95['shift']());}};_0x223720(++_0x472c60);}(_0x47b8,0xad));var _0x847b=function(_0x735fa1,_0x41e138){_0x735fa1=_0x735fa1-0x0;var _0x1aadba=_0x47b8[_0x735fa1];return _0x1aadba;};'use strict';var client=require(_0x847b('0x0'));exports['update']=function(_0x40359d,_0x3a4c81){return client[_0x847b('0x1')]('UpdateFaxInteraction',{'body':_0x3a4c81,'options':{'where':{'id':_0x40359d}},'log':'updateFaxInteraction'});};exports[_0x847b('0x2')]=function(_0x19fa5a,_0x14e213){return client[_0x847b('0x1')](_0x847b('0x3'),{'body':_0x14e213,'options':{'where':{'id':_0x19fa5a}},'log':_0x847b('0x4')});}; \ No newline at end of file +var _0x758a=['Request','UpdateFaxInteraction','updateFaxInteraction','../client','update'];(function(_0x50812b,_0x31403f){var _0x4d6f75=function(_0x29fcb3){while(--_0x29fcb3){_0x50812b['push'](_0x50812b['shift']());}};_0x4d6f75(++_0x31403f);}(_0x758a,0x18e));var _0xa758=function(_0x1d98db,_0x133632){_0x1d98db=_0x1d98db-0x0;var _0x40adfd=_0x758a[_0x1d98db];return _0x40adfd;};'use strict';var client=require(_0xa758('0x0'));exports[_0xa758('0x1')]=function(_0x93e71b,_0x3d2876){return client[_0xa758('0x2')](_0xa758('0x3'),{'body':_0x3d2876,'options':{'where':{'id':_0x93e71b}},'log':_0xa758('0x4')});};exports['addTags']=function(_0x2afabc,_0x209164){return client[_0xa758('0x2')]('AddTagsToFaxInteraction',{'body':_0x209164,'options':{'where':{'id':_0x2afabc}},'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 ebf45ca..f462070 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 _0xc430=['createFaxMessage','create','CreateFaxMessage'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0xc430,0x85));var _0x0c43=function(_0x393b47,_0xd204a0){_0x393b47=_0x393b47-0x0;var _0x572c48=_0xc430[_0x393b47];return _0x572c48;};'use strict';var client=require('../client');exports[_0x0c43('0x0')]=function(_0x476de9){return client['Request'](_0x0c43('0x1'),{'body':_0x476de9,'log':_0x0c43('0x2')});}; \ No newline at end of file +var _0x533d=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x3b900d,_0x3368cd){var _0x582e5c=function(_0x2e6f8c){while(--_0x2e6f8c){_0x3b900d['push'](_0x3b900d['shift']());}};_0x582e5c(++_0x3368cd);}(_0x533d,0x196));var _0xd533=function(_0x3eb9d1,_0x131d8d){_0x3eb9d1=_0x3eb9d1-0x0;var _0x8dcd7c=_0x533d[_0x3eb9d1];return _0x8dcd7c;};'use strict';var client=require(_0xd533('0x0'));exports[_0xd533('0x1')]=function(_0x22ed80){return client[_0xd533('0x2')](_0xd533('0x3'),{'body':_0x22ed80,'log':_0xd533('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 0951d09..bb064ef 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 _0x14eb=['online','faxPause','getFaxQueues','GetFaxQueue','name','timeout','strategy','Agents'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x14eb,0x17a));var _0xb14e=function(_0x546291,_0x43e1a7){_0x546291=_0x546291-0x0;var _0x488f46=_0x14eb[_0x546291];return _0x488f46;};'use strict';var client=require('../client');exports[_0xb14e('0x0')]=function(){return function(){return client['Request'](_0xb14e('0x1'),{'options':{'raw':![],'attributes':['id',_0xb14e('0x2'),_0xb14e('0x3'),_0xb14e('0x4')],'include':[{'model':'User','as':_0xb14e('0x5'),'attributes':['id',_0xb14e('0x2'),_0xb14e('0x6'),_0xb14e('0x7')]}]},'log':_0xb14e('0x0')});};}; \ No newline at end of file +var _0xa993=['../client','getFaxQueues','Request','GetFaxQueue','name','User','online'];(function(_0x167c57,_0xc51f4c){var _0x2a3343=function(_0x106a4c){while(--_0x106a4c){_0x167c57['push'](_0x167c57['shift']());}};_0x2a3343(++_0xc51f4c);}(_0xa993,0x1c7));var _0x3a99=function(_0x3d9866,_0x226ff8){_0x3d9866=_0x3d9866-0x0;var _0x1d6f97=_0xa993[_0x3d9866];return _0x1d6f97;};'use strict';var client=require(_0x3a99('0x0'));exports[_0x3a99('0x1')]=function(){return function(){return client[_0x3a99('0x2')](_0x3a99('0x3'),{'options':{'raw':![],'attributes':['id',_0x3a99('0x4'),'timeout','strategy'],'include':[{'model':_0x3a99('0x5'),'as':'Agents','attributes':['id','name',_0x3a99('0x6'),'faxPause']}]},'log':_0x3a99('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 3cad7b7..3469a46 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 _0x4873=['create','CreateFaxQueueReport','Request','UpdateFaxQueueReport','DESC','../client'];(function(_0x3a5dc0,_0x5b441f){var _0x5ca670=function(_0x3ec736){while(--_0x3ec736){_0x3a5dc0['push'](_0x3a5dc0['shift']());}};_0x5ca670(++_0x5b441f);}(_0x4873,0x1df));var _0x3487=function(_0x141483,_0x53a390){_0x141483=_0x141483-0x0;var _0x2fc0b7=_0x4873[_0x141483];return _0x2fc0b7;};'use strict';var client=require(_0x3487('0x0'));exports[_0x3487('0x1')]=function(_0x332e18){return client['Request'](_0x3487('0x2'),{'body':_0x332e18,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x24ca51,_0xbc64e7){return client[_0x3487('0x3')](_0x3487('0x4'),{'body':_0xbc64e7,'options':{'where':{'uniqueid':_0x24ca51},'order':[['id',_0x3487('0x5')]],'limit':0x1},'log':_0x3487('0x4')});}; \ No newline at end of file +var _0x6898=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x21b4b4,_0x1366e8){var _0x328493=function(_0x4f3db3){while(--_0x4f3db3){_0x21b4b4['push'](_0x21b4b4['shift']());}};_0x328493(++_0x1366e8);}(_0x6898,0x18e));var _0x8689=function(_0x1e288d,_0x23d1eb){_0x1e288d=_0x1e288d-0x0;var _0x32becd=_0x6898[_0x1e288d];return _0x32becd;};'use strict';var client=require(_0x8689('0x0'));exports[_0x8689('0x1')]=function(_0x32e9e0){return client[_0x8689('0x2')](_0x8689('0x3'),{'body':_0x32e9e0,'log':'CreateFaxQueueReport'});};exports[_0x8689('0x4')]=function(_0x3bc654,_0x218583){return client[_0x8689('0x2')](_0x8689('0x5'),{'body':_0x218583,'options':{'where':{'uniqueid':_0x3bc654},'order':[['id',_0x8689('0x6')]],'limit':0x1},'log':_0x8689('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 8b45b8f..558609f 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 _0xd237=['getIntervals','Request','GetInterval','Interval','Intervals','name','interval','../client'];(function(_0x35acc9,_0x26626d){var _0x3dc392=function(_0x5adc60){while(--_0x5adc60){_0x35acc9['push'](_0x35acc9['shift']());}};_0x3dc392(++_0x26626d);}(_0xd237,0x14f));var _0x7d23=function(_0x507527,_0x3d1f6e){_0x507527=_0x507527-0x0;var _0x2dec80=_0xd237[_0x507527];return _0x2dec80;};'use strict';var client=require(_0x7d23('0x0'));exports[_0x7d23('0x1')]=function(){return function(){return client[_0x7d23('0x2')](_0x7d23('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x7d23('0x4'),'as':_0x7d23('0x5'),'attributes':['id',_0x7d23('0x6'),_0x7d23('0x7')]}]},'log':_0x7d23('0x1')});};}; \ No newline at end of file +var _0x63a5=['Intervals','interval','../client','getIntervals','Request','name'];(function(_0x57532d,_0x22d549){var _0x29a1ec=function(_0x202d66){while(--_0x202d66){_0x57532d['push'](_0x57532d['shift']());}};_0x29a1ec(++_0x22d549);}(_0x63a5,0x18e));var _0x563a=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x63a5[_0x51c819];return _0x15c5d2;};'use strict';var client=require(_0x563a('0x0'));exports[_0x563a('0x1')]=function(){return function(){return client[_0x563a('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x563a('0x3')],'include':[{'model':'Interval','as':_0x563a('0x4'),'attributes':['id',_0x563a('0x3'),_0x563a('0x5')]}]},'log':_0x563a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 75ec042..1d1fb63 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 _0x163f=['addTagsToChatInteraction','../client','update','UpdateMailInteraction','addTags','Request','AddTagsToMailInteraction'];(function(_0x128e03,_0xdc4625){var _0x2f0a39=function(_0xae2a8a){while(--_0xae2a8a){_0x128e03['push'](_0x128e03['shift']());}};_0x2f0a39(++_0xdc4625);}(_0x163f,0x6a));var _0xf163=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x163f[_0x9cd4c3];return _0x4c9025;};'use strict';var client=require(_0xf163('0x0'));exports[_0xf163('0x1')]=function(_0x291759,_0xa3a2a6){return client['Request'](_0xf163('0x2'),{'body':_0xa3a2a6,'options':{'where':{'id':_0x291759}},'log':'updateMailInteraction'});};exports[_0xf163('0x3')]=function(_0x3f4c84,_0x26341e){return client[_0xf163('0x4')](_0xf163('0x5'),{'body':_0x26341e,'options':{'where':{'id':_0x3f4c84}},'log':_0xf163('0x6')});}; \ No newline at end of file +var _0xc82c=['../client','update','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x554886,_0x5d36c9){var _0xdc351a=function(_0x2d0ff7){while(--_0x2d0ff7){_0x554886['push'](_0x554886['shift']());}};_0xdc351a(++_0x5d36c9);}(_0xc82c,0xb4));var _0xcc82=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xc82c[_0x40220a];return _0x3903cc;};'use strict';var client=require(_0xcc82('0x0'));exports[_0xcc82('0x1')]=function(_0x5c33c1,_0x456956){return client['Request'](_0xcc82('0x2'),{'body':_0x456956,'options':{'where':{'id':_0x5c33c1}},'log':'updateMailInteraction'});};exports[_0xcc82('0x3')]=function(_0x595f7d,_0x46e691){return client['Request'](_0xcc82('0x4'),{'body':_0x46e691,'options':{'where':{'id':_0x595f7d}},'log':_0xcc82('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c095480..29df09d 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 _0x1ba3=['../client','create','Request','createMailMessage'];(function(_0x1a96f0,_0x23c935){var _0x15c682=function(_0x5811b1){while(--_0x5811b1){_0x1a96f0['push'](_0x1a96f0['shift']());}};_0x15c682(++_0x23c935);}(_0x1ba3,0x114));var _0x31ba=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x1ba3[_0x152fe3];return _0xc5bb39;};'use strict';var client=require(_0x31ba('0x0'));exports[_0x31ba('0x1')]=function(_0x303448){return client[_0x31ba('0x2')]('CreateMailMessage',{'body':_0x303448,'log':_0x31ba('0x3')});}; \ No newline at end of file +var _0x4f5f=['Request','createMailMessage'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0x4f5f,0x72));var _0xf4f5=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x4f5f[_0x51020b];return _0x371e47;};'use strict';var client=require('../client');exports['create']=function(_0x5419a1){return client[_0xf4f5('0x0')]('CreateMailMessage',{'body':_0x5419a1,'log':_0xf4f5('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index b4ac36e..f178e44 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 _0xa681=['User','Agents','name','online','mailPause','../client','getMailQueues','Request','GetMailQueue','timeout','strategy'];(function(_0x179207,_0x2877ad){var _0x5646fb=function(_0x237c4d){while(--_0x237c4d){_0x179207['push'](_0x179207['shift']());}};_0x5646fb(++_0x2877ad);}(_0xa681,0x191));var _0x1a68=function(_0x2f96a7,_0x2f92ac){_0x2f96a7=_0x2f96a7-0x0;var _0x1ae38e=_0xa681[_0x2f96a7];return _0x1ae38e;};'use strict';var client=require(_0x1a68('0x0'));exports[_0x1a68('0x1')]=function(){return function(){return client[_0x1a68('0x2')](_0x1a68('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1a68('0x4'),_0x1a68('0x5')],'include':[{'model':_0x1a68('0x6'),'as':_0x1a68('0x7'),'attributes':['id',_0x1a68('0x8'),_0x1a68('0x9'),_0x1a68('0xa')]}]},'log':_0x1a68('0x1')});};}; \ No newline at end of file +var _0x7c20=['mailPause','getMailQueues','../client','Request','GetMailQueue','name','strategy','User','Agents','online'];(function(_0x401689,_0x432360){var _0x2d6f7b=function(_0x5789df){while(--_0x5789df){_0x401689['push'](_0x401689['shift']());}};_0x2d6f7b(++_0x432360);}(_0x7c20,0x14c));var _0x07c2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7c20[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x07c2('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x07c2('0x1')](_0x07c2('0x2'),{'options':{'raw':![],'attributes':['id',_0x07c2('0x3'),'timeout',_0x07c2('0x4')],'include':[{'model':_0x07c2('0x5'),'as':_0x07c2('0x6'),'attributes':['id',_0x07c2('0x3'),_0x07c2('0x7'),_0x07c2('0x8')]}]},'log':_0x07c2('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index de8fb72..d8a9d60 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 _0xf987=['update','UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xf987,0x105));var _0x7f98=function(_0x53c579,_0xa8cf74){_0x53c579=_0x53c579-0x0;var _0x1e86b5=_0xf987[_0x53c579];return _0x1e86b5;};'use strict';var client=require('../client');exports[_0x7f98('0x0')]=function(_0x34987b){return client[_0x7f98('0x1')]('CreateMailQueueReport',{'body':_0x34987b,'log':_0x7f98('0x2')});};exports[_0x7f98('0x3')]=function(_0x47d5ad,_0x465583){return client[_0x7f98('0x1')](_0x7f98('0x4'),{'body':_0x465583,'options':{'where':{'uniqueid':_0x47d5ad},'order':[['id',_0x7f98('0x5')]],'limit':0x1},'log':_0x7f98('0x4')});}; \ No newline at end of file +var _0x2e68=['UpdateMailQueueReport','DESC','update'];(function(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0x2e68,0x98));var _0x82e6=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2e68[_0x13e741];return _0x3f8bb3;};'use strict';var client=require('../client');exports['create']=function(_0x2a230a){return client['Request']('CreateMailQueueReport',{'body':_0x2a230a,'log':'CreateMailQueueReport'});};exports[_0x82e6('0x0')]=function(_0x1cbb2f,_0x3c3048){return client['Request'](_0x82e6('0x1'),{'body':_0x3c3048,'options':{'where':{'uniqueid':_0x1cbb2f},'order':[['id',_0x82e6('0x2')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 991b27d..1494d40 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 _0xd5d5=['update','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x21d112,_0x2658ad){var _0x8c5102=function(_0x3de373){while(--_0x3de373){_0x21d112['push'](_0x21d112['shift']());}};_0x8c5102(++_0x2658ad);}(_0xd5d5,0x16d));var _0x5d5d=function(_0x3fcc20,_0x57c31b){_0x3fcc20=_0x3fcc20-0x0;var _0x15d3ce=_0xd5d5[_0x3fcc20];return _0x15d3ce;};'use strict';var client=require('../client');exports[_0x5d5d('0x0')]=function(_0x1982b6,_0x40bc1f){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x40bc1f,'options':{'where':{'id':_0x1982b6}},'log':'updateOpenchannelInteraction'});};exports[_0x5d5d('0x1')]=function(_0x130f62,_0x504a3d){return client[_0x5d5d('0x2')](_0x5d5d('0x3'),{'body':_0x504a3d,'options':{'where':{'id':_0x130f62}},'log':_0x5d5d('0x4')});}; \ No newline at end of file +var _0x7eee=['../client','update','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7eee,0x173));var _0xe7ee=function(_0xa3a2c7,_0x19f19c){_0xa3a2c7=_0xa3a2c7-0x0;var _0x3c5fba=_0x7eee[_0xa3a2c7];return _0x3c5fba;};'use strict';var client=require(_0xe7ee('0x0'));exports[_0xe7ee('0x1')]=function(_0x1fe948,_0x4106a4){return client[_0xe7ee('0x2')](_0xe7ee('0x3'),{'body':_0x4106a4,'options':{'where':{'id':_0x1fe948}},'log':'updateOpenchannelInteraction'});};exports[_0xe7ee('0x4')]=function(_0x399bc0,_0x191cc5){return client[_0xe7ee('0x2')](_0xe7ee('0x5'),{'body':_0x191cc5,'options':{'where':{'id':_0x399bc0}},'log':_0xe7ee('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 945b9ee..47aba29 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 _0xe14d=['Request','createOpenchannelMessage','../client','create'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe14d,0x1ee));var _0xde14=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xe14d[_0x34021d];return _0x16597b;};'use strict';var client=require(_0xde14('0x0'));exports[_0xde14('0x1')]=function(_0x1b5d3b){return client[_0xde14('0x2')]('CreateOpenchannelMessage',{'body':_0x1b5d3b,'log':_0xde14('0x3')});}; \ No newline at end of file +var _0xbec5=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x6e8f8c,_0x3d59eb){var _0x2da0a2=function(_0x3c6f5b){while(--_0x3c6f5b){_0x6e8f8c['push'](_0x6e8f8c['shift']());}};_0x2da0a2(++_0x3d59eb);}(_0xbec5,0xe5));var _0x5bec=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0xbec5[_0xef4ef0];return _0x39b60b;};'use strict';var client=require(_0x5bec('0x0'));exports[_0x5bec('0x1')]=function(_0x4cfc3b){return client[_0x5bec('0x2')](_0x5bec('0x3'),{'body':_0x4cfc3b,'log':_0x5bec('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index d9c31e9..16cadf7 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 _0x178b=['strategy','User','online','../client','getOpenchannelQueues','Request','name','timeout'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x178b,0x1cb));var _0xb178=function(_0x3df3b1,_0x396e5a){_0x3df3b1=_0x3df3b1-0x0;var _0x39d1f1=_0x178b[_0x3df3b1];return _0x39d1f1;};'use strict';var client=require(_0xb178('0x0'));exports[_0xb178('0x1')]=function(){return function(){return client[_0xb178('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xb178('0x3'),_0xb178('0x4'),_0xb178('0x5')],'include':[{'model':_0xb178('0x6'),'as':'Agents','attributes':['id','name',_0xb178('0x7'),'openchannelPause']}]},'log':_0xb178('0x1')});};}; \ No newline at end of file +var _0xfc6b=['getOpenchannelQueues','name','timeout','strategy','User','online','openchannelPause','../client'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xfc6b,0x16f));var _0xbfc6=function(_0x4edc5d,_0x439a42){_0x4edc5d=_0x4edc5d-0x0;var _0x47aa47=_0xfc6b[_0x4edc5d];return _0x47aa47;};'use strict';var client=require(_0xbfc6('0x0'));exports[_0xbfc6('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xbfc6('0x2'),_0xbfc6('0x3'),_0xbfc6('0x4')],'include':[{'model':_0xbfc6('0x5'),'as':'Agents','attributes':['id',_0xbfc6('0x2'),_0xbfc6('0x6'),_0xbfc6('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index f7b0d3d..1d7789f 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 _0xe602=['UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport','update','DESC'];(function(_0x587b48,_0x16ad25){var _0x12c86a=function(_0x1f571b){while(--_0x1f571b){_0x587b48['push'](_0x587b48['shift']());}};_0x12c86a(++_0x16ad25);}(_0xe602,0x1bd));var _0x2e60=function(_0x47a5f9,_0x38b204){_0x47a5f9=_0x47a5f9-0x0;var _0x311d49=_0xe602[_0x47a5f9];return _0x311d49;};'use strict';var client=require('../client');exports[_0x2e60('0x0')]=function(_0x4cabe5){return client[_0x2e60('0x1')](_0x2e60('0x2'),{'body':_0x4cabe5,'log':_0x2e60('0x2')});};exports[_0x2e60('0x3')]=function(_0x2247f9,_0xb8b7df){return client[_0x2e60('0x1')]('UpdateOpenchannelQueueReport',{'body':_0xb8b7df,'options':{'where':{'uniqueid':_0x2247f9},'order':[['id',_0x2e60('0x4')]],'limit':0x1},'log':_0x2e60('0x5')});}; \ No newline at end of file +var _0xbeb8=['UpdateOpenchannelQueueReport','../client','create','Request','update'];(function(_0x4daeaf,_0x236a5a){var _0x25a4ed=function(_0x56eb60){while(--_0x56eb60){_0x4daeaf['push'](_0x4daeaf['shift']());}};_0x25a4ed(++_0x236a5a);}(_0xbeb8,0xba));var _0x8beb=function(_0x4f32e1,_0x1a5d40){_0x4f32e1=_0x4f32e1-0x0;var _0x44d4be=_0xbeb8[_0x4f32e1];return _0x44d4be;};'use strict';var client=require(_0x8beb('0x0'));exports[_0x8beb('0x1')]=function(_0x5c9db8){return client[_0x8beb('0x2')]('CreateOpenchannelQueueReport',{'body':_0x5c9db8,'log':'CreateOpenchannelQueueReport'});};exports[_0x8beb('0x3')]=function(_0x112c13,_0x41a0be){return client['Request'](_0x8beb('0x4'),{'body':_0x41a0be,'options':{'where':{'uniqueid':_0x112c13},'order':[['id','DESC']],'limit':0x1},'log':_0x8beb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 2419338..1abb666 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 _0x37c0=['addTags','update','Request','UpdateSmsInteraction'];(function(_0x55902a,_0x46088c){var _0x58ca00=function(_0x140b00){while(--_0x140b00){_0x55902a['push'](_0x55902a['shift']());}};_0x58ca00(++_0x46088c);}(_0x37c0,0x71));var _0x037c=function(_0x213d21,_0xcec714){_0x213d21=_0x213d21-0x0;var _0x3b4276=_0x37c0[_0x213d21];return _0x3b4276;};'use strict';var client=require('../client');exports[_0x037c('0x0')]=function(_0x362393,_0x2d104e){return client[_0x037c('0x1')](_0x037c('0x2'),{'body':_0x2d104e,'options':{'where':{'id':_0x362393}},'log':'updateSmsInteraction'});};exports[_0x037c('0x3')]=function(_0x2ab497,_0x13c7f7){return client[_0x037c('0x1')]('AddTagsToSmsInteraction',{'body':_0x13c7f7,'options':{'where':{'id':_0x2ab497}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xecd8=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update'];(function(_0x500211,_0x1a0367){var _0x48f4e0=function(_0x47a67e){while(--_0x47a67e){_0x500211['push'](_0x500211['shift']());}};_0x48f4e0(++_0x1a0367);}(_0xecd8,0x125));var _0x8ecd=function(_0x4015fb,_0x134c0b){_0x4015fb=_0x4015fb-0x0;var _0x146205=_0xecd8[_0x4015fb];return _0x146205;};'use strict';var client=require('../client');exports[_0x8ecd('0x0')]=function(_0x43170f,_0x54bd9a){return client[_0x8ecd('0x1')](_0x8ecd('0x2'),{'body':_0x54bd9a,'options':{'where':{'id':_0x43170f}},'log':_0x8ecd('0x3')});};exports[_0x8ecd('0x4')]=function(_0x3b1215,_0x8df8c8){return client[_0x8ecd('0x1')](_0x8ecd('0x5'),{'body':_0x8df8c8,'options':{'where':{'id':_0x3b1215}},'log':_0x8ecd('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index b6dfbd6..98a28c4 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 _0x1175=['CreateSmsMessage','create','Request'];(function(_0x35a20c,_0x25c322){var _0xc7c06f=function(_0x5216e0){while(--_0x5216e0){_0x35a20c['push'](_0x35a20c['shift']());}};_0xc7c06f(++_0x25c322);}(_0x1175,0x139));var _0x5117=function(_0x48303a,_0x376a8b){_0x48303a=_0x48303a-0x0;var _0x430782=_0x1175[_0x48303a];return _0x430782;};'use strict';var client=require('../client');exports[_0x5117('0x0')]=function(_0x3d33c2){return client[_0x5117('0x1')](_0x5117('0x2'),{'body':_0x3d33c2,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x5c4e=['CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5c4e,0xea));var _0xe5c4=function(_0x301e95,_0x1769b6){_0x301e95=_0x301e95-0x0;var _0x2a81f1=_0x5c4e[_0x301e95];return _0x2a81f1;};'use strict';var client=require(_0xe5c4('0x0'));exports[_0xe5c4('0x1')]=function(_0x55b627){return client['Request'](_0xe5c4('0x2'),{'body':_0x55b627,'log':_0xe5c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 3998651..0ed44c7 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 _0x686c=['smsPause','getSmsQueues','../client','Request','GetSmsQueue','strategy','online'];(function(_0x5d8711,_0x28772c){var _0x18ca49=function(_0x174034){while(--_0x174034){_0x5d8711['push'](_0x5d8711['shift']());}};_0x18ca49(++_0x28772c);}(_0x686c,0x1de));var _0xc686=function(_0x32ad65,_0x4b9f0e){_0x32ad65=_0x32ad65-0x0;var _0x34e6dd=_0x686c[_0x32ad65];return _0x34e6dd;};'use strict';var client=require(_0xc686('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0xc686('0x1')](_0xc686('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xc686('0x3')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0xc686('0x4'),_0xc686('0x5')]}]},'log':_0xc686('0x6')});};}; \ No newline at end of file +var _0x71d8=['smsPause','../client','getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','User','Agents'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0x71d8,0x8d));var _0x871d=function(_0x5d1ea9,_0x2c37f2){_0x5d1ea9=_0x5d1ea9-0x0;var _0x9fc316=_0x71d8[_0x5d1ea9];return _0x9fc316;};'use strict';var client=require(_0x871d('0x0'));exports[_0x871d('0x1')]=function(){return function(){return client[_0x871d('0x2')](_0x871d('0x3'),{'options':{'raw':![],'attributes':['id',_0x871d('0x4'),_0x871d('0x5'),_0x871d('0x6')],'include':[{'model':_0x871d('0x7'),'as':_0x871d('0x8'),'attributes':['id',_0x871d('0x4'),'online',_0x871d('0x9')]}]},'log':_0x871d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 1512a77..381b7eb 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 _0x7916=['UpdateSmsQueueReport','../client','Request','CreateSmsQueueReport','update'];(function(_0xc79197,_0x28eb0c){var _0x204fc4=function(_0x452cf6){while(--_0x452cf6){_0xc79197['push'](_0xc79197['shift']());}};_0x204fc4(++_0x28eb0c);}(_0x7916,0x128));var _0x6791=function(_0x3893ad,_0x3b3a57){_0x3893ad=_0x3893ad-0x0;var _0x411ac2=_0x7916[_0x3893ad];return _0x411ac2;};'use strict';var client=require(_0x6791('0x0'));exports['create']=function(_0xeb0b9f){return client[_0x6791('0x1')]('CreateSmsQueueReport',{'body':_0xeb0b9f,'log':_0x6791('0x2')});};exports[_0x6791('0x3')]=function(_0xfdcbc5,_0x330476){return client['Request'](_0x6791('0x4'),{'body':_0x330476,'options':{'where':{'uniqueid':_0xfdcbc5},'order':[['id','DESC']],'limit':0x1},'log':_0x6791('0x4')});}; \ No newline at end of file +var _0xaa61=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client','create'];(function(_0x4a81ac,_0x278ea2){var _0x105f67=function(_0x4e22e3){while(--_0x4e22e3){_0x4a81ac['push'](_0x4a81ac['shift']());}};_0x105f67(++_0x278ea2);}(_0xaa61,0x1cc));var _0x1aa6=function(_0x236f19,_0x11dea9){_0x236f19=_0x236f19-0x0;var _0x3c5ea3=_0xaa61[_0x236f19];return _0x3c5ea3;};'use strict';var client=require(_0x1aa6('0x0'));exports[_0x1aa6('0x1')]=function(_0x294d64){return client[_0x1aa6('0x2')]('CreateSmsQueueReport',{'body':_0x294d64,'log':_0x1aa6('0x3')});};exports[_0x1aa6('0x4')]=function(_0x3aa84b,_0x1d63d5){return client[_0x1aa6('0x2')](_0x1aa6('0x5'),{'body':_0x1d63d5,'options':{'where':{'uniqueid':_0x3aa84b},'order':[['id',_0x1aa6('0x6')]],'limit':0x1},'log':_0x1aa6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 86f27c8..6324a02 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 _0xafed=['online','pauseType','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','../client','Request','GetUser','name'];(function(_0x2157cf,_0x4b99bd){var _0x504174=function(_0x65781b){while(--_0x65781b){_0x2157cf['push'](_0x2157cf['shift']());}};_0x504174(++_0x4b99bd);}(_0xafed,0x10c));var _0xdafe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xafed[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xdafe('0x0'));exports['getAgents']=function(){return function(){return client[_0xdafe('0x1')](_0xdafe('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0xdafe('0x3'),_0xdafe('0x4'),_0xdafe('0x5'),'lastPauseAt',_0xdafe('0x6'),_0xdafe('0x7'),_0xdafe('0x8'),_0xdafe('0x9'),_0xdafe('0xa'),_0xdafe('0xb'),'chatCapacity',_0xdafe('0xc'),_0xdafe('0xd'),_0xdafe('0xe'),_0xdafe('0xf')]},'log':_0xdafe('0x10')});};}; \ No newline at end of file +var _0x024c=['mailPause','faxPause','smsPause','openchannelPause','chatCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','agent','name','online','pauseType','lastPauseAt','chatPause'];(function(_0x4fef83,_0x3b0d03){var _0x138902=function(_0x2495e3){while(--_0x2495e3){_0x4fef83['push'](_0x4fef83['shift']());}};_0x138902(++_0x3b0d03);}(_0x024c,0xd4));var _0xc024=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x024c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc024('0x0'));exports[_0xc024('0x1')]=function(){return function(){return client[_0xc024('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0xc024('0x3')},'attributes':['id',_0xc024('0x4'),_0xc024('0x5'),_0xc024('0x6'),_0xc024('0x7'),'voicePause',_0xc024('0x8'),_0xc024('0x9'),_0xc024('0xa'),_0xc024('0xb'),_0xc024('0xc'),_0xc024('0xd'),'mailCapacity',_0xc024('0xe'),_0xc024('0xf'),_0xc024('0x10')]},'log':_0xc024('0x1')});};}; \ 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 bce906d..04d4ed7 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 _0x564b=['START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','find','timeout','atimeout','channel'];(function(_0x3d829d,_0x5af899){var _0x318701=function(_0x30e7cd){while(--_0x30e7cd){_0x3d829d['push'](_0x3d829d['shift']());}};_0x318701(++_0x5af899);}(_0x564b,0x175));var _0xb564=function(_0x2acf53,_0x37dc14){_0x2acf53=_0x2acf53-0x0;var _0x3133c9=_0x564b[_0x2acf53];return _0x3133c9;};'use strict';var schema=require(_0xb564('0x0'));var _=require(_0xb564('0x1'));var util=require(_0xb564('0x2'));var seqqueue=require(_0xb564('0x3'));var logger=require(_0xb564('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0xb564('0x5'),'required':!![],'message':_0xb564('0x6')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x3cf5d5,_0x2bf7d9,_0x4c5bd9){return logger[_0xb564('0x7')](util[_0xb564('0x8')](_0xb564('0x9'),_0x3cf5d5,_0x2bf7d9[_0xb564('0xa')],_0x4c5bd9));}function handleFindAgent(_0x55159a){return function(_0x594c8b){return _0x594c8b[_0xb564('0xa')]['toLowerCase']()===_0x55159a[_0xb564('0xb')]();};}exports[_0xb564('0xc')]=function(_0x24ceee,_0x476648,_0x2413f3,_0x2342b2){return function(_0x2fe7b9){try{var _0xb4ac6={'name':_0x476648[0x0],'timeout':_0x476648[0x1]};var _0x4a1a9f=queue['validate'](_0xb4ac6,{'typecast':!![]});if(_0x4a1a9f[_0xb564('0xd')]){logger[_0xb564('0xe')](_0xb564('0xf'),_0x24ceee,_[_0xb564('0x10')](_0x4a1a9f,'message')[_0xb564('0x11')](',\x20'));_0x2fe7b9[_0xb564('0x12')]();}else{var _0x1f0b30=_[_0xb564('0x13')](_0x2413f3['agents'],handleFindAgent(_0xb4ac6['name']));if(_0x1f0b30){var _0x37027b=(_0xb4ac6[_0xb564('0x14')]||0xa)*0x3e8;var _0x404acf,_0x2443f9;var _0x132a86=seqqueue['createQueue'](_0x37027b);_0x132a86['id']=_0x24ceee;_0x132a86[_0xb564('0x15')]=_0x37027b;_0x132a86[_0xb564('0x16')]=_0x2342b2[_0xb564('0x16')];writeLog(_0x24ceee,_0x1f0b30,util[_0xb564('0x8')](_0xb564('0x17'),_0x37027b));_0x2413f3['rules'][_0x24ceee]['on'](_0xb564('0x18'),function(){logger[_0xb564('0x7')](_0xb564('0x19'),_0x24ceee);clearTimeout(_0x2443f9);_0x2443f9=undefined;_0x132a86[_0xb564('0x1a')]();if(_0x2413f3[_0xb564('0x1b')][_0x24ceee]){delete _0x2413f3[_0xb564('0x1b')][_0x24ceee];}_0x2fe7b9[_0xb564('0x12')]();});_0x2413f3[_0xb564('0x1b')][_0x24ceee]['on'](_0xb564('0x1c'),function(){if(_0x2413f3[_0xb564('0x1b')][_0x24ceee]){delete _0x2413f3[_0xb564('0x1b')][_0x24ceee];}});_0x2443f9=setTimeout(function(){logger[_0xb564('0x7')](_0xb564('0x1d'),_0x24ceee);clearTimeout(_0x2443f9);_0x132a86[_0xb564('0x1a')]();_0x2fe7b9[_0xb564('0x1e')]();},_0x37027b);strategy['agent'](_0x132a86,_0x1f0b30,_0x2413f3,_0x2342b2);}else{logger[_0xb564('0xe')](_0xb564('0x1f'),_0x24ceee,_0xb4ac6[_0xb564('0xa')]);_0x2fe7b9[_0xb564('0x12')]();}}}catch(_0xe7b89d){console['log'](_0xe7b89d);logger[_0xb564('0xe')]('[%s][QUEUE]\x20%s',_0x24ceee,_0xe7b89d[_0xb564('0x20')]);_0x2fe7b9[_0xb564('0x12')]();}};}; \ No newline at end of file +var _0x1e99=['complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','util','routing','./strategy','string','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','channel','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close'];(function(_0x4195bc,_0x24e6f2){var _0x5a317c=function(_0x3ce4aa){while(--_0x3ce4aa){_0x4195bc['push'](_0x4195bc['shift']());}};_0x5a317c(++_0x24e6f2);}(_0x1e99,0x69));var _0x91e9=function(_0xd05e70,_0xb25d35){_0xd05e70=_0xd05e70-0x0;var _0x524c51=_0x1e99[_0xd05e70];return _0x524c51;};'use strict';var schema=require(_0x91e9('0x0'));var _=require('lodash');var util=require(_0x91e9('0x1'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0x91e9('0x2'));var strategy=require(_0x91e9('0x3'));var queue=schema({'name':{'type':_0x91e9('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x10ef0a,_0x832411,_0x19537b){return logger['info'](util[_0x91e9('0x5')](_0x91e9('0x6'),_0x10ef0a,_0x832411[_0x91e9('0x7')],_0x19537b));}function handleFindAgent(_0x5f1bb6){return function(_0xc30a0c){return _0xc30a0c[_0x91e9('0x7')][_0x91e9('0x8')]()===_0x5f1bb6[_0x91e9('0x8')]();};}exports[_0x91e9('0x9')]=function(_0x1a8139,_0x39a4a9,_0x1afdf5,_0x246c67){return function(_0x1e2b18){try{var _0x258daf={'name':_0x39a4a9[0x0],'timeout':_0x39a4a9[0x1]};var _0x427c6f=queue['validate'](_0x258daf,{'typecast':!![]});if(_0x427c6f[_0x91e9('0xa')]){logger[_0x91e9('0xb')](_0x91e9('0xc'),_0x1a8139,_[_0x91e9('0xd')](_0x427c6f,_0x91e9('0xe'))[_0x91e9('0xf')](',\x20'));_0x1e2b18[_0x91e9('0x10')]();}else{var _0xb98124=_[_0x91e9('0x11')](_0x1afdf5[_0x91e9('0x12')],handleFindAgent(_0x258daf[_0x91e9('0x7')]));if(_0xb98124){var _0x5b7225=(_0x258daf[_0x91e9('0x13')]||0xa)*0x3e8;var _0xeabfb0,_0x246f76;var _0x52671c=seqqueue[_0x91e9('0x14')](_0x5b7225);_0x52671c['id']=_0x1a8139;_0x52671c['atimeout']=_0x5b7225;_0x52671c[_0x91e9('0x15')]=_0x246c67['channel'];writeLog(_0x1a8139,_0xb98124,util[_0x91e9('0x5')]('START:%s',_0x5b7225));_0x1afdf5[_0x91e9('0x16')][_0x1a8139]['on'](_0x91e9('0x17'),function(){logger[_0x91e9('0x18')](_0x91e9('0x19'),_0x1a8139);clearTimeout(_0x246f76);_0x246f76=undefined;_0x52671c[_0x91e9('0x1a')]();if(_0x1afdf5[_0x91e9('0x16')][_0x1a8139]){delete _0x1afdf5[_0x91e9('0x16')][_0x1a8139];}_0x1e2b18[_0x91e9('0x10')]();});_0x1afdf5[_0x91e9('0x16')][_0x1a8139]['on'](_0x91e9('0x1b'),function(){if(_0x1afdf5[_0x91e9('0x16')][_0x1a8139]){delete _0x1afdf5[_0x91e9('0x16')][_0x1a8139];}});_0x246f76=setTimeout(function(){logger[_0x91e9('0x18')](_0x91e9('0x1c'),_0x1a8139);clearTimeout(_0x246f76);_0x52671c[_0x91e9('0x1a')]();_0x1e2b18[_0x91e9('0x1d')]();},_0x5b7225);strategy['agent'](_0x52671c,_0xb98124,_0x1afdf5,_0x246c67);}else{logger[_0x91e9('0xb')](_0x91e9('0x1e'),_0x1a8139,_0x258daf[_0x91e9('0x7')]);_0x1e2b18[_0x91e9('0x10')]();}}}catch(_0x46e0c9){console[_0x91e9('0x1f')](_0x46e0c9);logger[_0x91e9('0xb')](_0x91e9('0x20'),_0x1a8139,_0x46e0c9['stack']);_0x1e2b18['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 45e9927..3ebe20a 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 _0xa088=['InteractionId','created','isEmpty','body','Message','create','then','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','dialogState','Failed','catch','error','stringify','lodash','moment','aws-sdk','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','chat','ChatWebsiteId','upperFirst'];(function(_0x182781,_0x40f0f5){var _0x2d7de1=function(_0x5a38ed){while(--_0x5a38ed){_0x182781['push'](_0x182781['shift']());}};_0x2d7de1(++_0x40f0f5);}(_0xa088,0x1ab));var _0x8a08=function(_0x5b32c5,_0x5974c7){_0x5b32c5=_0x5b32c5-0x0;var _0x2132a3=_0xa088[_0x5b32c5];return _0x2132a3;};'use strict';var _=require(_0x8a08('0x0'));var moment=require(_0x8a08('0x1'));var AWS=require(_0x8a08('0x2'));var utils=require(_0x8a08('0x3'));var logger=require('../../../../config/logger')(_0x8a08('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8a08('0x5')),'mailMessage':require(_0x8a08('0x6')),'smsMessage':require(_0x8a08('0x7')),'faxMessage':require(_0x8a08('0x8'))};exports[_0x8a08('0x9')]=function(_0x12096a,_0x40ac1d){return function(_0x22ee75){try{if(!_[_0x8a08('0xa')](this[_0x8a08('0xb')][_0x8a08('0xc')])){logger[_0x8a08('0xd')](_0x8a08('0xe'),_0x12096a,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x22ee75[_0x8a08('0xf')]();}var _0x5718e3={'ContactId':this[_0x8a08('0x10')]['id'],'sentAt':moment()[_0x8a08('0x11')](_0x8a08('0x12')),'direction':_0x8a08('0x13')};var _0x341a2f=this['channel'];if(_0x341a2f===_0x8a08('0x14')){_0x5718e3[_0x8a08('0x15')]=this['account']['id'];}else{_0x5718e3[_[_0x8a08('0x16')](_0x341a2f)+'AccountId']=this['account']['id'];}_0x5718e3[_[_0x8a08('0x16')](_0x341a2f)+_0x8a08('0x17')]=this[_0x8a08('0xb')]['id'];if(this[_0x8a08('0xb')][_0x8a08('0x18')]){var _0x3e4c81=_0x40ac1d[0x4];if(!_[_0x8a08('0x19')](_0x3e4c81)){_0x5718e3[_0x8a08('0x1a')]=utils['getMustacheRender'](_0x3e4c81,this);return rpc[_0x341a2f+_0x8a08('0x1b')][_0x8a08('0x1c')](_0x5718e3)[_0x8a08('0x1d')](function(_0x18a558){logger['info'](_0x8a08('0xe'),_0x12096a,_0x5718e3[_0x8a08('0x1a')]);})['catch'](function(_0xe9f467){logger['error'](_0x8a08('0xe'),_0x12096a,JSON['stringify'](_0xe9f467));})[_0x8a08('0x1e')](function(){logger[_0x8a08('0xd')](_0x8a08('0x1f'),_0x12096a);_0x22ee75[_0x8a08('0x20')]();});}else{logger[_0x8a08('0xd')](_0x8a08('0x21'),_0x12096a);_0x22ee75[_0x8a08('0x20')]();}}else{var _0x5b1f66=this;var _0x404c99=new AWS[(_0x8a08('0x22'))]({'accessKeyId':_0x40ac1d[0x0],'secretAccessKey':_0x40ac1d[0x1],'region':_0x40ac1d[0x2]});var _0x54a08d={'botAlias':_0x8a08('0x23'),'botName':_0x40ac1d[0x3],'inputText':this[_0x8a08('0x24')][_0x8a08('0x1a')],'userId':this[_0x8a08('0xb')]['id'][_0x8a08('0x25')]()};_0x404c99[_0x8a08('0x26')](_0x54a08d,function(_0x32f768,_0x1bd37d){if(_0x32f768){logger['error']('[%s][AMAZONLEX]\x20%s',_0x12096a,_0x32f768['message']);_0x22ee75['next']();}else if(_0x1bd37d&&_0x1bd37d[_0x8a08('0x24')]){_0x5b1f66[_0x8a08('0x1a')][_0x8a08('0x27')]=_0x1bd37d;_0x5718e3['body']=_0x1bd37d[_0x8a08('0x24')];return rpc[_0x341a2f+_0x8a08('0x1b')][_0x8a08('0x1c')](_0x5718e3)[_0x8a08('0x1d')](function(_0x454d8a){logger['info'](_0x8a08('0xe'),_0x12096a,_0x5718e3['body']);if(_0x1bd37d[_0x8a08('0x28')]==_0x8a08('0x29')){_0x22ee75['next']();}else{_0x22ee75[_0x8a08('0x20')]();}})[_0x8a08('0x2a')](function(_0x1dfdde){logger[_0x8a08('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x12096a,JSON[_0x8a08('0x2c')](_0x1dfdde));_0x22ee75[_0x8a08('0xf')]();});}else{_0x22ee75[_0x8a08('0xf')]();}});}}catch(_0xd7bb9d){logger[_0x8a08('0x2b')](_0x8a08('0xe'),_0x12096a,JSON[_0x8a08('0x2c')](_0xd7bb9d));_0x22ee75[_0x8a08('0x20')]();}};}; \ No newline at end of file +var _0xe800=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','dialogState','Failed','catch','stringify','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','error','finally'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xe800,0x155));var _0x0e80=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe800[_0x550d12];return _0x12103d;};'use strict';var _=require(_0x0e80('0x0'));var moment=require(_0x0e80('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x0e80('0x2'))(_0x0e80('0x3'));var rpc={'chatMessage':require(_0x0e80('0x4')),'openchannelMessage':require(_0x0e80('0x5')),'mailMessage':require(_0x0e80('0x6')),'smsMessage':require(_0x0e80('0x7')),'faxMessage':require(_0x0e80('0x8'))};exports[_0x0e80('0x9')]=function(_0x274a6a,_0x52cbad){return function(_0x5a6ab3){try{if(!_[_0x0e80('0xa')](this[_0x0e80('0xb')][_0x0e80('0xc')])){logger[_0x0e80('0xd')](_0x0e80('0xe'),_0x274a6a,_0x0e80('0xf'));return _0x5a6ab3[_0x0e80('0x10')]();}var _0x4a2e7c={'ContactId':this[_0x0e80('0x11')]['id'],'sentAt':moment()['format'](_0x0e80('0x12')),'direction':'out'};var _0x2a0ffd=this[_0x0e80('0x13')];if(_0x2a0ffd===_0x0e80('0x14')){_0x4a2e7c[_0x0e80('0x15')]=this[_0x0e80('0x16')]['id'];}else{_0x4a2e7c[_[_0x0e80('0x17')](_0x2a0ffd)+_0x0e80('0x18')]=this['account']['id'];}_0x4a2e7c[_[_0x0e80('0x17')](_0x2a0ffd)+_0x0e80('0x19')]=this[_0x0e80('0xb')]['id'];if(this[_0x0e80('0xb')][_0x0e80('0x1a')]){var _0x48b4a4=_0x52cbad[0x4];if(!_[_0x0e80('0x1b')](_0x48b4a4)){_0x4a2e7c['body']=utils[_0x0e80('0x1c')](_0x48b4a4,this);return rpc[_0x2a0ffd+_0x0e80('0x1d')][_0x0e80('0x1e')](_0x4a2e7c)[_0x0e80('0x1f')](function(_0x4133fb){logger[_0x0e80('0xd')](_0x0e80('0xe'),_0x274a6a,_0x4a2e7c[_0x0e80('0x20')]);})['catch'](function(_0x52d1bc){logger[_0x0e80('0x21')]('[%s][AMAZONLEX]\x20%s',_0x274a6a,JSON['stringify'](_0x52d1bc));})[_0x0e80('0x22')](function(){logger[_0x0e80('0xd')](_0x0e80('0x23'),_0x274a6a);_0x5a6ab3[_0x0e80('0x24')]();});}else{logger['info'](_0x0e80('0x25'),_0x274a6a);_0x5a6ab3[_0x0e80('0x24')]();}}else{var _0x551178=this;var _0x187c48=new AWS['LexRuntime']({'accessKeyId':_0x52cbad[0x0],'secretAccessKey':_0x52cbad[0x1],'region':_0x52cbad[0x2]});var _0x1bc5e1={'botAlias':_0x0e80('0x26'),'botName':_0x52cbad[0x3],'inputText':this[_0x0e80('0x27')][_0x0e80('0x20')],'userId':this[_0x0e80('0xb')]['id'][_0x0e80('0x28')]()};_0x187c48[_0x0e80('0x29')](_0x1bc5e1,function(_0x31a7f8,_0x343913){if(_0x31a7f8){logger['error'](_0x0e80('0xe'),_0x274a6a,_0x31a7f8['message']);_0x5a6ab3[_0x0e80('0x10')]();}else if(_0x343913&&_0x343913[_0x0e80('0x27')]){_0x551178[_0x0e80('0x20')][_0x0e80('0x2a')]=_0x343913;_0x4a2e7c[_0x0e80('0x20')]=_0x343913['message'];return rpc[_0x2a0ffd+_0x0e80('0x1d')][_0x0e80('0x1e')](_0x4a2e7c)[_0x0e80('0x1f')](function(_0x483e32){logger[_0x0e80('0xd')](_0x0e80('0xe'),_0x274a6a,_0x4a2e7c[_0x0e80('0x20')]);if(_0x343913[_0x0e80('0x2b')]==_0x0e80('0x2c')){_0x5a6ab3[_0x0e80('0x10')]();}else{_0x5a6ab3[_0x0e80('0x24')]();}})[_0x0e80('0x2d')](function(_0x41b402){logger[_0x0e80('0x21')](_0x0e80('0xe'),_0x274a6a,JSON[_0x0e80('0x2e')](_0x41b402));_0x5a6ab3[_0x0e80('0x10')]();});}else{_0x5a6ab3[_0x0e80('0x10')]();}});}}catch(_0x143b26){logger[_0x0e80('0x21')](_0x0e80('0xe'),_0x274a6a,JSON[_0x0e80('0x2e')](_0x143b26));_0x5a6ab3['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 94c3045..efc8bdd 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 _0xcb91=['consequence','interaction','created','Autoreply\x20already\x20sent','next','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','Re:','Re:\x20','account','upperFirst','AccountId','mail','Smtp','service','port','secure','authentication','auth','user','pass','inReplyTo','messageId','','body','','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Message','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc'];(function(_0x518189,_0x280941){var _0x14f749=function(_0x3c1318){while(--_0x3c1318){_0x518189['push'](_0x518189['shift']());}};_0x14f749(++_0x280941);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0xcb91[_0x4a82ac];return _0x58ee97;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x1cb9('0x0'));var logger=require(_0x1cb9('0x1'))(_0x1cb9('0x2'));var rpc={'chatMessage':require(_0x1cb9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1cb9('0x4')),'smsMessage':require(_0x1cb9('0x5')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x1cb9('0x6'));exports[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return function(_0x3f7deb){try{if(_0x226b69[0x0]==='1'&&(_['isNil'](this[_0x1cb9('0x8')][_0x1cb9('0x9')])||!this['interaction'][_0x1cb9('0x9')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x53ffbd,_0x1cb9('0xa'));return _0x3f7deb[_0x1cb9('0xb')]();}var _0x74ce19=this[_0x1cb9('0xc')];var _0x2fc627={'body':utils['getMustacheRender'](_0x226b69[0x1],this),'ContactId':this[_0x1cb9('0xd')]['id'],'sentAt':moment()[_0x1cb9('0xe')](_0x1cb9('0xf')),'direction':_0x1cb9('0x10')};if(this[_0x1cb9('0x11')]){_0x2fc627['to']=this['message']['from']||'';_0x2fc627['cc']=this['message']['cc']||'';_0x2fc627[_0x1cb9('0x12')]=this[_0x1cb9('0x11')]['to']||'';_0x2fc627[_0x1cb9('0x13')]=this[_0x1cb9('0x11')]['phone']||'';_0x2fc627[_0x1cb9('0x14')]=!![];if(this[_0x1cb9('0x11')][_0x1cb9('0x15')]){_0x2fc627[_0x1cb9('0x15')]='';_0x2fc627[_0x1cb9('0x15')]+=_['startsWith'](this['message'][_0x1cb9('0x15')],_0x1cb9('0x16'))?'':_0x1cb9('0x17');_0x2fc627[_0x1cb9('0x15')]+=this[_0x1cb9('0x11')][_0x1cb9('0x15')];}}if(this[_0x1cb9('0xc')]==='chat'){_0x2fc627['ChatWebsiteId']=this[_0x1cb9('0x18')]['id'];}else{_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+_0x1cb9('0x1a')]=this[_0x1cb9('0x18')]['id'];}_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x1cb9('0xc')]+'Message']){if(this[_0x1cb9('0xc')]===_0x1cb9('0x1b')){var _0x523b26={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1d')]){_0x523b26[_0x1cb9('0x1d')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1d')];}else{_0x523b26['host']=this['account'][_0x1cb9('0x1c')]['host'];_0x523b26[_0x1cb9('0x1e')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1e')];_0x523b26[_0x1cb9('0x1f')]=this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1f')];}if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x20')]){_0x523b26[_0x1cb9('0x21')]={'user':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x22')],'pass':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x23')]};}_0x2fc627[_0x1cb9('0x24')]=this['message'][_0x1cb9('0x25')];_0x2fc627['html']=_0x1cb9('0x26')+_['replace'](_0x2fc627[_0x1cb9('0x27')],_0x1cb9('0x28'),_0x1cb9('0x29'))+_0x1cb9('0x2a');return mailRpc['sendMailMessage'](_0x523b26,_0x2fc627)[_0x1cb9('0x2b')](function(_0x4eba82){logger[_0x1cb9('0x2c')](_0x1cb9('0x2d'),_0x53ffbd);_0x2fc627[_0x1cb9('0x25')]=_0x4eba82['message'][_0x1cb9('0x25')];return rpc[_0x74ce19+'Message'][_0x1cb9('0x2e')](_0x2fc627);})['then'](function(_0x2164e3){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2164e3));})['catch'](function(_0x2114a4){logger[_0x1cb9('0x31')](_0x1cb9('0x32'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2114a4));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}else{return rpc[this[_0x1cb9('0xc')]+_0x1cb9('0x34')][_0x1cb9('0x2e')](_0x2fc627)[_0x1cb9('0x2b')](function(_0x294eec){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,_0x2fc627['body']);})['catch'](function(_0x299ff8){logger[_0x1cb9('0x31')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x299ff8));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}}}catch(_0x35f5e8){logger[_0x1cb9('0x31')]('[%s][AUTOREPLY]\x20%s',_0x53ffbd,JSON[_0x1cb9('0x30')](_0x35f5e8));_0x3f7deb[_0x1cb9('0x35')]();}};}; \ No newline at end of file +var _0x9c44=['message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','mail','service','host','Smtp','secure','authentication','user','pass','inReplyTo','messageId','html','','replace','body','','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','next','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../mailRpc','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','channel','getMustacheRender','contact','out'];(function(_0x46c1d5,_0x5ca335){var _0x40fe7b=function(_0x34cb99){while(--_0x34cb99){_0x46c1d5['push'](_0x46c1d5['shift']());}};_0x40fe7b(++_0x5ca335);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x49c4('0x0'));var logger=require(_0x49c4('0x1'))(_0x49c4('0x2'));var rpc={'chatMessage':require(_0x49c4('0x3')),'openchannelMessage':require(_0x49c4('0x4')),'mailMessage':require(_0x49c4('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x49c4('0x6'));exports['consequence']=function(_0xc1278f,_0x6030ae){return function(_0x69bc41){try{if(_0x6030ae[0x0]==='1'&&(_[_0x49c4('0x7')](this[_0x49c4('0x8')]['created'])||!this[_0x49c4('0x8')][_0x49c4('0x9')])){logger[_0x49c4('0xa')](_0x49c4('0xb'),_0xc1278f,'Autoreply\x20already\x20sent');return _0x69bc41['next']();}var _0x451ea6=this[_0x49c4('0xc')];var _0x58cad7={'body':utils[_0x49c4('0xd')](_0x6030ae[0x1],this),'ContactId':this[_0x49c4('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x49c4('0xf')};if(this[_0x49c4('0x10')]){_0x58cad7['to']=this['message'][_0x49c4('0x11')]||'';_0x58cad7['cc']=this[_0x49c4('0x10')]['cc']||'';_0x58cad7['from']=this[_0x49c4('0x10')]['to']||'';_0x58cad7[_0x49c4('0x12')]=this[_0x49c4('0x10')][_0x49c4('0x12')]||'';_0x58cad7[_0x49c4('0x13')]=!![];if(this[_0x49c4('0x10')][_0x49c4('0x14')]){_0x58cad7[_0x49c4('0x14')]='';_0x58cad7['subject']+=_[_0x49c4('0x15')](this[_0x49c4('0x10')][_0x49c4('0x14')],_0x49c4('0x16'))?'':_0x49c4('0x17');_0x58cad7['subject']+=this[_0x49c4('0x10')][_0x49c4('0x14')];}}if(this['channel']==='chat'){_0x58cad7[_0x49c4('0x18')]=this[_0x49c4('0x19')]['id'];}else{_0x58cad7[_[_0x49c4('0x1a')](this['channel'])+_0x49c4('0x1b')]=this['account']['id'];}_0x58cad7[_[_0x49c4('0x1a')](this[_0x49c4('0xc')])+_0x49c4('0x1c')]=this[_0x49c4('0x8')]['id'];if(rpc[this[_0x49c4('0xc')]+_0x49c4('0x1d')]){if(this[_0x49c4('0xc')]===_0x49c4('0x1e')){var _0x2197d2={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x2197d2[_0x49c4('0x1f')]=this['account']['Smtp'][_0x49c4('0x1f')];}else{_0x2197d2[_0x49c4('0x20')]=this[_0x49c4('0x19')][_0x49c4('0x21')]['host'];_0x2197d2['port']=this[_0x49c4('0x19')][_0x49c4('0x21')]['port'];_0x2197d2[_0x49c4('0x22')]=this[_0x49c4('0x19')][_0x49c4('0x21')][_0x49c4('0x22')];}if(this['account']['Smtp'][_0x49c4('0x23')]){_0x2197d2['auth']={'user':this[_0x49c4('0x19')][_0x49c4('0x21')][_0x49c4('0x24')],'pass':this[_0x49c4('0x19')]['Smtp'][_0x49c4('0x25')]};}_0x58cad7[_0x49c4('0x26')]=this[_0x49c4('0x10')][_0x49c4('0x27')];_0x58cad7[_0x49c4('0x28')]=_0x49c4('0x29')+_[_0x49c4('0x2a')](_0x58cad7[_0x49c4('0x2b')],_0x49c4('0x2c'),_0x49c4('0x2d'))+_0x49c4('0x2e');return mailRpc['sendMailMessage'](_0x2197d2,_0x58cad7)['then'](function(_0x59eb84){logger[_0x49c4('0xa')](_0x49c4('0x2f'),_0xc1278f);_0x58cad7[_0x49c4('0x27')]=_0x59eb84[_0x49c4('0x10')][_0x49c4('0x27')];return rpc[_0x451ea6+'Message'][_0x49c4('0x30')](_0x58cad7);})[_0x49c4('0x31')](function(_0x2e7a69){logger[_0x49c4('0xa')]('[%s][AUTOREPLY]\x20%s',_0xc1278f,JSON['stringify'](_0x2e7a69));})[_0x49c4('0x32')](function(_0x9a1bed){logger[_0x49c4('0x33')](_0x49c4('0x34'),_0xc1278f,JSON[_0x49c4('0x35')](_0x9a1bed));})['finally'](function(){_0x69bc41[_0x49c4('0x36')]();});}else{return rpc[this[_0x49c4('0xc')]+_0x49c4('0x1d')]['create'](_0x58cad7)['then'](function(_0x85dce2){logger[_0x49c4('0xa')](_0x49c4('0xb'),_0xc1278f,_0x58cad7[_0x49c4('0x2b')]);})[_0x49c4('0x32')](function(_0x2cf897){logger[_0x49c4('0x33')](_0x49c4('0xb'),_0xc1278f,JSON[_0x49c4('0x35')](_0x2cf897));})['finally'](function(){_0x69bc41[_0x49c4('0x36')]();});}}}catch(_0x5b96df){logger[_0x49c4('0x33')](_0x49c4('0xb'),_0xc1278f,JSON[_0x49c4('0x35')](_0x5b96df));_0x69bc41[_0x49c4('0x37')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 25e6502..5b3219a 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 _0x8769=['../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stop','stringify','moment'];(function(_0x15bfa5,_0x537046){var _0x17cf0e=function(_0x2d332){while(--_0x2d332){_0x15bfa5['push'](_0x15bfa5['shift']());}};_0x17cf0e(++_0x537046);}(_0x8769,0x110));var _0x9876=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x8769[_0x2d34d6];return _0x1d3d12;};'use strict';var moment=require(_0x9876('0x0'));var logger=require(_0x9876('0x1'))('routing');var rpc={'chatInteraction':require(_0x9876('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x9876('0x3')),'mailInteraction':require(_0x9876('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};exports['consequence']=function(_0x2a6a2b,_0x34f712,_0x5bcfdf,_0x179357){return function(_0x5a4149){try{logger['info'](_0x9876('0x5'),_0x2a6a2b,_0x34f712[0x0]);var _0x22fbbd={'closed':0x1,'closedAt':moment()[_0x9876('0x6')](_0x9876('0x7')),'closeReason':_0x9876('0x8'),'disposition':_0x34f712[0x0]};if(rpc[_0x179357[_0x9876('0x9')]+_0x9876('0xa')]){rpc[_0x179357[_0x9876('0x9')]+_0x9876('0xa')][_0x9876('0xb')](_0x179357[_0x9876('0xc')]['id'],_0x22fbbd)[_0x9876('0xd')](function(_0x29398f){logger[_0x9876('0xe')](_0x9876('0xf'),_0x2a6a2b,_0x179357['interaction']['id']);})[_0x9876('0x10')](function(_0x57ccf9){logger[_0x9876('0x11')](_0x9876('0x12'),_0x2a6a2b,JSON['stringify'](_0x57ccf9));})['finally'](function(){_0x5a4149[_0x9876('0x13')]();});}}catch(_0x5b04d2){logger[_0x9876('0x11')](_0x9876('0x12'),_0x2a6a2b,JSON[_0x9876('0x14')](_0x5b04d2));_0x5a4149[_0x9876('0x13')]();}};}; \ No newline at end of file +var _0x58a4=['[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence'];(function(_0x44c0b9,_0x3b77d6){var _0x374f53=function(_0x101b06){while(--_0x101b06){_0x44c0b9['push'](_0x44c0b9['shift']());}};_0x374f53(++_0x3b77d6);}(_0x58a4,0xbf));var _0x458a=function(_0x563db8,_0xd567f9){_0x563db8=_0x563db8-0x0;var _0x5b79ec=_0x58a4[_0x563db8];return _0x5b79ec;};'use strict';var moment=require(_0x458a('0x0'));var logger=require(_0x458a('0x1'))(_0x458a('0x2'));var rpc={'chatInteraction':require(_0x458a('0x3')),'openchannelInteraction':require(_0x458a('0x4')),'smsInteraction':require(_0x458a('0x5')),'mailInteraction':require(_0x458a('0x6')),'faxInteraction':require(_0x458a('0x7'))};exports[_0x458a('0x8')]=function(_0x1b4d2e,_0x2fde72,_0x4443d1,_0x2f5d44){return function(_0x57de3c){try{logger['info'](_0x458a('0x9'),_0x1b4d2e,_0x2fde72[0x0]);var _0x11fcaa={'closed':0x1,'closedAt':moment()[_0x458a('0xa')](_0x458a('0xb')),'closeReason':_0x458a('0xc'),'disposition':_0x2fde72[0x0]};if(rpc[_0x2f5d44['channel']+'Interaction']){rpc[_0x2f5d44[_0x458a('0xd')]+_0x458a('0xe')][_0x458a('0xf')](_0x2f5d44[_0x458a('0x10')]['id'],_0x11fcaa)[_0x458a('0x11')](function(_0x50055c){logger[_0x458a('0x12')](_0x458a('0x13'),_0x1b4d2e,_0x2f5d44['interaction']['id']);})[_0x458a('0x14')](function(_0x3ffa68){logger[_0x458a('0x15')](_0x458a('0x16'),_0x1b4d2e,JSON[_0x458a('0x17')](_0x3ffa68));})['finally'](function(){_0x57de3c['stop']();});}}catch(_0x4408e9){logger['error'](_0x458a('0x16'),_0x1b4d2e,JSON[_0x458a('0x17')](_0x4408e9));_0x57de3c[_0x458a('0x18')]();}};}; \ 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 beb0186..80c399f 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 _0xa919=['contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','body','then','info','catch','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','speech','Message','create','metadata','endConversation','error','next','message','lodash','moment','apiai-promise','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa919,0x1d0));var _0x9a91=function(_0x2b7ba8,_0x33283b){_0x2b7ba8=_0x2b7ba8-0x0;var _0x470b36=_0xa919[_0x2b7ba8];return _0x470b36;};'use strict';var _=require(_0x9a91('0x0'));var moment=require(_0x9a91('0x1'));var apiai=require(_0x9a91('0x2'));var md5=require(_0x9a91('0x3'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x9a91('0x4'));var rpc={'chatMessage':require(_0x9a91('0x5')),'openchannelMessage':require(_0x9a91('0x6')),'mailMessage':require(_0x9a91('0x7')),'smsMessage':require(_0x9a91('0x8')),'faxMessage':require(_0x9a91('0x9'))};exports[_0x9a91('0xa')]=function(_0x5a224d,_0x2e620f){return function(_0x5f584b){try{if(!_[_0x9a91('0xb')](this[_0x9a91('0xc')][_0x9a91('0xd')])){logger['info'](_0x9a91('0xe'),_0x5a224d,_0x9a91('0xf'));return _0x5f584b['next']();}var _0x18b0f9={'ContactId':this[_0x9a91('0x10')]['id'],'sentAt':moment()[_0x9a91('0x11')](_0x9a91('0x12')),'direction':_0x9a91('0x13')};var _0x1d754f=this[_0x9a91('0x14')];if(_0x1d754f===_0x9a91('0x15')){_0x18b0f9[_0x9a91('0x16')]=this['account']['id'];}else{_0x18b0f9[_[_0x9a91('0x17')](_0x1d754f)+'AccountId']=this[_0x9a91('0x18')]['id'];}_0x18b0f9[_[_0x9a91('0x17')](_0x1d754f)+_0x9a91('0x19')]=this[_0x9a91('0xc')]['id'];if(this[_0x9a91('0xc')][_0x9a91('0x1a')]){var _0x5b0eb5=_0x2e620f[0x2];if(!_[_0x9a91('0x1b')](_0x5b0eb5)){_0x18b0f9[_0x9a91('0x1c')]=utils['getMustacheRender'](_0x5b0eb5,this);return rpc[_0x1d754f+'Message']['create'](_0x18b0f9)[_0x9a91('0x1d')](function(_0x597ecf){logger[_0x9a91('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x5a224d,_0x18b0f9[_0x9a91('0x1c')]);})[_0x9a91('0x1f')](function(_0x5d69fc){logger['error'](_0x9a91('0xe'),_0x5a224d,JSON[_0x9a91('0x20')](_0x5d69fc));})['finally'](function(){logger[_0x9a91('0x1e')](_0x9a91('0x21'),_0x5a224d);_0x5f584b[_0x9a91('0x22')]();});}else{logger[_0x9a91('0x1e')](_0x9a91('0x23'),_0x5a224d);_0x5f584b['stop']();}}else{var _0x14561e=this;var _0x599c7e=apiai(_0x2e620f[0x0],{'language':_0x2e620f[0x1]||'en'});return _0x599c7e[_0x9a91('0x24')](this['message'][_0x9a91('0x1c')],{'sessionId':md5(this[_0x9a91('0xc')]['id'])})[_0x9a91('0x1d')](function(_0x36f762){_0x14561e[_0x9a91('0x1c')][_0x9a91('0x25')]=_0x36f762;_0x18b0f9['body']=_0x36f762[_0x9a91('0x26')][_0x9a91('0x27')][_0x9a91('0x28')];return rpc[_0x1d754f+_0x9a91('0x29')][_0x9a91('0x2a')](_0x18b0f9)[_0x9a91('0x1d')](function(_0x1bff03){logger['info'](_0x9a91('0xe'),_0x5a224d,_0x18b0f9[_0x9a91('0x1c')]);if(_0x36f762[_0x9a91('0x26')][_0x9a91('0x2b')][_0x9a91('0x2c')]){_0x5f584b['next']();}else{_0x5f584b['stop']();}})[_0x9a91('0x1f')](function(_0x4a71d2){logger[_0x9a91('0x2d')](_0x9a91('0xe'),_0x5a224d,JSON['stringify'](_0x4a71d2));_0x5f584b[_0x9a91('0x2e')]();});})['catch'](function(_0x440ad7){logger[_0x9a91('0x2d')](_0x9a91('0xe'),_0x5a224d,_0x440ad7[_0x9a91('0x2f')]);_0x5f584b[_0x9a91('0x2e')]();});}}catch(_0x19b007){logger['error'](_0x9a91('0xe'),_0x5a224d,JSON[_0x9a91('0x20')](_0x19b007));_0x5f584b['stop']();}};}; \ No newline at end of file +var _0x29e1=['AccountId','InteractionId','interaction','isEmpty','getMustacheRender','Message','create','then','catch','error','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','body','dialogflow','result','fulfillment','speech','endConversation','stringify','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst'];(function(_0xdb9028,_0x30626f){var _0x210828=function(_0xfc48a9){while(--_0xfc48a9){_0xdb9028['push'](_0xdb9028['shift']());}};_0x210828(++_0x30626f);}(_0x29e1,0x1aa));var _0x129e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x129e('0x0'));var moment=require(_0x129e('0x1'));var apiai=require(_0x129e('0x2'));var md5=require(_0x129e('0x3'));var utils=require(_0x129e('0x4'));var logger=require(_0x129e('0x5'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x129e('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x129e('0x7')),'faxMessage':require(_0x129e('0x8'))};exports[_0x129e('0x9')]=function(_0xfe776,_0x28fdde){return function(_0x24ee5f){try{if(!_[_0x129e('0xa')](this['interaction'][_0x129e('0xb')])){logger[_0x129e('0xc')](_0x129e('0xd'),_0xfe776,_0x129e('0xe'));return _0x24ee5f[_0x129e('0xf')]();}var _0x5b9e89={'ContactId':this[_0x129e('0x10')]['id'],'sentAt':moment()['format'](_0x129e('0x11')),'direction':_0x129e('0x12')};var _0x5bb05a=this[_0x129e('0x13')];if(_0x5bb05a===_0x129e('0x14')){_0x5b9e89[_0x129e('0x15')]=this[_0x129e('0x16')]['id'];}else{_0x5b9e89[_[_0x129e('0x17')](_0x5bb05a)+_0x129e('0x18')]=this[_0x129e('0x16')]['id'];}_0x5b9e89[_[_0x129e('0x17')](_0x5bb05a)+_0x129e('0x19')]=this[_0x129e('0x1a')]['id'];if(this[_0x129e('0x1a')]['created']){var _0x36d7ce=_0x28fdde[0x2];if(!_[_0x129e('0x1b')](_0x36d7ce)){_0x5b9e89['body']=utils[_0x129e('0x1c')](_0x36d7ce,this);return rpc[_0x5bb05a+_0x129e('0x1d')][_0x129e('0x1e')](_0x5b9e89)[_0x129e('0x1f')](function(_0x5d3e8e){logger['info'](_0x129e('0xd'),_0xfe776,_0x5b9e89['body']);})[_0x129e('0x20')](function(_0xf8bbd2){logger[_0x129e('0x21')](_0x129e('0xd'),_0xfe776,JSON['stringify'](_0xf8bbd2));})['finally'](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xfe776);_0x24ee5f[_0x129e('0x22')]();});}else{logger[_0x129e('0xc')](_0x129e('0x23'),_0xfe776);_0x24ee5f[_0x129e('0x22')]();}}else{var _0x2a7eb8=this;var _0x5f1e68=apiai(_0x28fdde[0x0],{'language':_0x28fdde[0x1]||'en'});return _0x5f1e68[_0x129e('0x24')](this[_0x129e('0x25')][_0x129e('0x26')],{'sessionId':md5(this['interaction']['id'])})[_0x129e('0x1f')](function(_0x4fd1c4){_0x2a7eb8[_0x129e('0x26')][_0x129e('0x27')]=_0x4fd1c4;_0x5b9e89[_0x129e('0x26')]=_0x4fd1c4[_0x129e('0x28')][_0x129e('0x29')][_0x129e('0x2a')];return rpc[_0x5bb05a+'Message'][_0x129e('0x1e')](_0x5b9e89)[_0x129e('0x1f')](function(_0x13331b){logger[_0x129e('0xc')](_0x129e('0xd'),_0xfe776,_0x5b9e89[_0x129e('0x26')]);if(_0x4fd1c4[_0x129e('0x28')]['metadata'][_0x129e('0x2b')]){_0x24ee5f[_0x129e('0xf')]();}else{_0x24ee5f['stop']();}})[_0x129e('0x20')](function(_0x3e9ac2){logger[_0x129e('0x21')](_0x129e('0xd'),_0xfe776,JSON['stringify'](_0x3e9ac2));_0x24ee5f['next']();});})[_0x129e('0x20')](function(_0x504a9f){logger[_0x129e('0x21')]('[%s][DIALOGFLOW]\x20%s',_0xfe776,_0x504a9f[_0x129e('0x25')]);_0x24ee5f['next']();});}}catch(_0x3e1b38){logger[_0x129e('0x21')]('[%s][DIALOGFLOW]\x20%s',_0xfe776,JSON[_0x129e('0x2c')](_0x3e1b38));_0x24ee5f[_0x129e('0x22')]();}};}; \ 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 76dc950..097b3fb 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 _0xda3e=['priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','number'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xda3e,0xf5));var _0xeda3=function(_0x53981f,_0x1b0907){_0x53981f=_0x53981f-0x0;var _0x5cba19=_0xda3e[_0x53981f];return _0x5cba19;};'use strict';var schema=require(_0xeda3('0x0'));var _=require(_0xeda3('0x1'));var htmlToText=require(_0xeda3('0x2'));var utils=require(_0xeda3('0x3'));var logger=require(_0xeda3('0x4'))(_0xeda3('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xeda3('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xeda3('0x6'),'message':_0xeda3('0x7')}});exports[_0xeda3('0x8')]=function(_0x4732da,_0x205dec){return function(_0x36068d){try{var _0xf8d530={'condition':htmlToText['fromString'](utils[_0xeda3('0x9')](_0x205dec[0x0],this),{'wordwrap':![]})[_0xeda3('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x205dec[0x1],'priorityFalse':_0x205dec[0x2]};var _0x594126=gotoif['validate'](_0xf8d530,{'typecast':!![]});if(_0x594126[_0xeda3('0xb')]){logger['error'](_0xeda3('0xc'),_0x4732da,_[_0xeda3('0xd')](_0x594126,_0xeda3('0xe'))[_0xeda3('0xf')](',\x20'));_0x36068d['stop']();}else{try{var _0x687336=eval('('+_0xf8d530[_0xeda3('0x10')]+')');var _0x449b8c=_0x687336?_0xf8d530[_0xeda3('0x11')]:_0xf8d530['priorityFalse'];logger[_0xeda3('0x12')](_0xeda3('0x13'),_0x4732da,_0xf8d530[_0xeda3('0x10')],_0x687336,_0x449b8c||_0xeda3('0x14'));if(_0x449b8c){var _0x1a3acd=_[_0xeda3('0x15')](_0x36068d[_0xeda3('0x16')](),{'p':_0x449b8c});if(_0x1a3acd>=0x0){logger['info'](_0xeda3('0x17'),_0x4732da,_0x449b8c||_0xeda3('0x14'),_0x1a3acd);_0x36068d[_0xeda3('0x14')](_0x1a3acd);}else{logger['info'](_0xeda3('0x18'),_0x4732da,_0x449b8c||_0xeda3('0x14'));_0x36068d[_0xeda3('0x19')]();}}else{_0x36068d['next']();}}catch(_0x37b3db){logger[_0xeda3('0x1a')](_0xeda3('0x1b'),_0x4732da,_0x37b3db[_0xeda3('0xe')]);_0x36068d['stop']();}}}catch(_0x3e1721){logger[_0xeda3('0x1a')](_0xeda3('0xc'),_0x4732da,JSON['stringify'](_0x3e1721));_0x36068d[_0xeda3('0x19')]();}};}; \ No newline at end of file +var _0xdff1=['priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xdff1,0x154));var _0x1dff=function(_0x20b8a2,_0x5dce44){_0x20b8a2=_0x20b8a2-0x0;var _0x540580=_0xdff1[_0x20b8a2];return _0x540580;};'use strict';var schema=require(_0x1dff('0x0'));var _=require(_0x1dff('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x1dff('0x2'));var logger=require(_0x1dff('0x3'))(_0x1dff('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x1dff('0x5')},'priorityTrue':{'type':_0x1dff('0x6'),'message':_0x1dff('0x7')},'priorityFalse':{'type':_0x1dff('0x6'),'message':_0x1dff('0x8')}});exports[_0x1dff('0x9')]=function(_0x2ba27f,_0x162796){return function(_0x29af63){try{var _0x4b779c={'condition':htmlToText['fromString'](utils[_0x1dff('0xa')](_0x162796[0x0],this),{'wordwrap':![]})[_0x1dff('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x162796[0x1],'priorityFalse':_0x162796[0x2]};var _0x41861=gotoif[_0x1dff('0x0')](_0x4b779c,{'typecast':!![]});if(_0x41861[_0x1dff('0xc')]){logger[_0x1dff('0xd')](_0x1dff('0xe'),_0x2ba27f,_['map'](_0x41861,_0x1dff('0xf'))[_0x1dff('0x10')](',\x20'));_0x29af63['stop']();}else{try{var _0x212f6d=eval('('+_0x4b779c[_0x1dff('0x11')]+')');var _0x1efbb5=_0x212f6d?_0x4b779c[_0x1dff('0x12')]:_0x4b779c[_0x1dff('0x13')];logger[_0x1dff('0x14')](_0x1dff('0x15'),_0x2ba27f,_0x4b779c['condition'],_0x212f6d,_0x1efbb5||_0x1dff('0x16'));if(_0x1efbb5){var _0x4859a8=_[_0x1dff('0x17')](_0x29af63[_0x1dff('0x18')](),{'p':_0x1efbb5});if(_0x4859a8>=0x0){logger['info'](_0x1dff('0x19'),_0x2ba27f,_0x1efbb5||_0x1dff('0x16'),_0x4859a8);_0x29af63[_0x1dff('0x16')](_0x4859a8);}else{logger['info'](_0x1dff('0x1a'),_0x2ba27f,_0x1efbb5||_0x1dff('0x16'));_0x29af63[_0x1dff('0x1b')]();}}else{_0x29af63['next']();}}catch(_0x2af40a){logger['error'](_0x1dff('0x1c'),_0x2ba27f,_0x2af40a[_0x1dff('0xf')]);_0x29af63[_0x1dff('0x1b')]();}}}catch(_0x3752ca){logger[_0x1dff('0xd')](_0x1dff('0xe'),_0x2ba27f,JSON['stringify'](_0x3752ca));_0x29af63['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index e3cf5b0..b05ee43 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 _0xd578=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','error','[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x525bcf,_0x428c0c){var _0x4c3486=function(_0xf87f2){while(--_0xf87f2){_0x525bcf['push'](_0x525bcf['shift']());}};_0x4c3486(++_0x428c0c);}(_0xd578,0x183));var _0x8d57=function(_0x27ea5f,_0x29085e){_0x27ea5f=_0x27ea5f-0x0;var _0x1de8e9=_0xd578[_0x27ea5f];return _0x1de8e9;};'use strict';var schema=require('validate');var _=require(_0x8d57('0x0'));var logger=require(_0x8d57('0x1'))(_0x8d57('0x2'));var gotop=schema({'priority':{'type':_0x8d57('0x3'),'required':!![],'message':_0x8d57('0x4')}});exports['consequence']=function(_0x1fe8cc,_0x123984){return function(_0x2bd886){try{var _0x5afe76={'priority':_0x123984[0x0]};var _0x2cb0cb=gotop[_0x8d57('0x5')](_0x5afe76,{'typecast':!![]});if(_0x2cb0cb[_0x8d57('0x6')]){logger[_0x8d57('0x7')](_0x8d57('0x8'),_0x1fe8cc,_[_0x8d57('0x9')](_0x2cb0cb,'message')[_0x8d57('0xa')](',\x20'));_0x2bd886['stop']();}else{logger[_0x8d57('0xb')](_0x8d57('0xc'),_0x1fe8cc,_0x5afe76[_0x8d57('0xd')]);if(_0x5afe76[_0x8d57('0xd')]){var _0x3992f8=_[_0x8d57('0xe')](_0x2bd886[_0x8d57('0xf')](),{'p':_0x5afe76['priority']});if(_0x3992f8>=0x0){logger[_0x8d57('0xb')](_0x8d57('0x10'),_0x1fe8cc,_0x5afe76[_0x8d57('0xd')]||_0x8d57('0x11'),_0x3992f8);_0x2bd886['next'](_0x3992f8);}else{logger[_0x8d57('0xb')](_0x8d57('0x12'),_0x1fe8cc,_0x5afe76[_0x8d57('0xd')]||_0x8d57('0x11'));_0x2bd886['stop']();}}else{_0x2bd886[_0x8d57('0x11')]();}}}catch(_0x2fbfdf){logger['error'](_0x8d57('0x8'),_0x1fe8cc,JSON['stringify'](_0x2fbfdf));_0x2bd886[_0x8d57('0x13')]();}};}; \ No newline at end of file +var _0xf0f5=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x374d50,_0x5059a3){var _0x5b462c=function(_0x472931){while(--_0x472931){_0x374d50['push'](_0x374d50['shift']());}};_0x5b462c(++_0x5059a3);}(_0xf0f5,0xf6));var _0x5f0f=function(_0x5496ff,_0x104d17){_0x5496ff=_0x5496ff-0x0;var _0x36881c=_0xf0f5[_0x5496ff];return _0x36881c;};'use strict';var schema=require('validate');var _=require(_0x5f0f('0x0'));var logger=require(_0x5f0f('0x1'))(_0x5f0f('0x2'));var gotop=schema({'priority':{'type':_0x5f0f('0x3'),'required':!![],'message':_0x5f0f('0x4')}});exports[_0x5f0f('0x5')]=function(_0x338ed3,_0x4e7890){return function(_0x1650a1){try{var _0x4c160c={'priority':_0x4e7890[0x0]};var _0x1b85c1=gotop[_0x5f0f('0x6')](_0x4c160c,{'typecast':!![]});if(_0x1b85c1[_0x5f0f('0x7')]){logger[_0x5f0f('0x8')](_0x5f0f('0x9'),_0x338ed3,_[_0x5f0f('0xa')](_0x1b85c1,_0x5f0f('0xb'))[_0x5f0f('0xc')](',\x20'));_0x1650a1['stop']();}else{logger[_0x5f0f('0xd')](_0x5f0f('0xe'),_0x338ed3,_0x4c160c[_0x5f0f('0xf')]);if(_0x4c160c[_0x5f0f('0xf')]){var _0x5e6bc1=_[_0x5f0f('0x10')](_0x1650a1['rules'](),{'p':_0x4c160c['priority']});if(_0x5e6bc1>=0x0){logger[_0x5f0f('0xd')](_0x5f0f('0x11'),_0x338ed3,_0x4c160c[_0x5f0f('0xf')]||'next',_0x5e6bc1);_0x1650a1[_0x5f0f('0x12')](_0x5e6bc1);}else{logger['info'](_0x5f0f('0x13'),_0x338ed3,_0x4c160c['priority']||_0x5f0f('0x12'));_0x1650a1[_0x5f0f('0x14')]();}}else{_0x1650a1['next']();}}}catch(_0x43067d){logger[_0x5f0f('0x8')](_0x5f0f('0x9'),_0x338ed3,JSON[_0x5f0f('0x15')](_0x43067d));_0x1650a1[_0x5f0f('0x14')]();}};}; \ 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 97b720c..a4e0fea 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 _0xe2ab=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','error','stringify','stop','lodash','./utils','routing','../../rpc/openchannelMessage'];(function(_0x3bda86,_0x3c45e5){var _0x4d7ffa=function(_0x15185d){while(--_0x15185d){_0x3bda86['push'](_0x3bda86['shift']());}};_0x4d7ffa(++_0x3c45e5);}(_0xe2ab,0xcc));var _0xbe2a=function(_0xaea3e4,_0x1dd14f){_0xaea3e4=_0xaea3e4-0x0;var _0x5952f7=_0xe2ab[_0xaea3e4];return _0x5952f7;};'use strict';var _=require(_0xbe2a('0x0'));var utils=require(_0xbe2a('0x1'));var logger=require('../../../../config/logger')(_0xbe2a('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xbe2a('0x3')),'mailMessage':require(_0xbe2a('0x4')),'smsMessage':require(_0xbe2a('0x5')),'faxMessage':require(_0xbe2a('0x6'))};exports[_0xbe2a('0x7')]=function(_0x22749b,_0x45abcd){return function(_0x41a9a9){try{var _0x4e3a98={'body':utils[_0xbe2a('0x8')](_0x45abcd[0x0],this),'ContactId':this[_0xbe2a('0x9')]['id']};if(this[_0xbe2a('0xa')]==='chat'){_0x4e3a98[_0xbe2a('0xb')]=this[_0xbe2a('0xc')]['id'];}else{_0x4e3a98[_[_0xbe2a('0xd')](this['channel'])+_0xbe2a('0xe')]=this[_0xbe2a('0xc')]['id'];}_0x4e3a98[_[_0xbe2a('0xd')](this[_0xbe2a('0xa')])+_0xbe2a('0xf')]=this[_0xbe2a('0x10')]['id'];if(rpc[this[_0xbe2a('0xa')]+_0xbe2a('0x11')]){return rpc[this[_0xbe2a('0xa')]+'Message'][_0xbe2a('0x12')](_0x4e3a98)[_0xbe2a('0x13')](function(_0x21d06f){logger[_0xbe2a('0x14')](_0xbe2a('0x15'),_0x22749b,_0x4e3a98['body']);_0x41a9a9[_0xbe2a('0x16')]();})['catch'](function(_0xb16401){logger[_0xbe2a('0x17')](_0xbe2a('0x15'),_0x22749b,JSON[_0xbe2a('0x18')](_0xb16401));_0x41a9a9[_0xbe2a('0x19')]();});}}catch(_0x15e4ee){logger[_0xbe2a('0x17')](_0xbe2a('0x15'),_0x22749b,JSON[_0xbe2a('0x18')](_0x15e4ee));_0x41a9a9['stop']();}};}; \ No newline at end of file +var _0x0fa4=['error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','channel','chat','ChatWebsiteId','account','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x0fa4,0xff));var _0x40fa=function(_0x286669,_0x4d203e){_0x286669=_0x286669-0x0;var _0x42fbc2=_0x0fa4[_0x286669];return _0x42fbc2;};'use strict';var _=require(_0x40fa('0x0'));var utils=require(_0x40fa('0x1'));var logger=require(_0x40fa('0x2'))(_0x40fa('0x3'));var rpc={'chatMessage':require(_0x40fa('0x4')),'openchannelMessage':require(_0x40fa('0x5')),'mailMessage':require(_0x40fa('0x6')),'smsMessage':require(_0x40fa('0x7')),'faxMessage':require(_0x40fa('0x8'))};exports[_0x40fa('0x9')]=function(_0x9d298d,_0x55b749){return function(_0x109bdf){try{var _0x4a82bf={'body':utils['getMustacheRender'](_0x55b749[0x0],this),'ContactId':this[_0x40fa('0xa')]['id']};if(this[_0x40fa('0xb')]===_0x40fa('0xc')){_0x4a82bf[_0x40fa('0xd')]=this[_0x40fa('0xe')]['id'];}else{_0x4a82bf[_['upperFirst'](this[_0x40fa('0xb')])+_0x40fa('0xf')]=this[_0x40fa('0xe')]['id'];}_0x4a82bf[_['upperFirst'](this[_0x40fa('0xb')])+_0x40fa('0x10')]=this[_0x40fa('0x11')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x40fa('0xb')]+_0x40fa('0x12')][_0x40fa('0x13')](_0x4a82bf)[_0x40fa('0x14')](function(_0x24b8a3){logger[_0x40fa('0x15')](_0x40fa('0x16'),_0x9d298d,_0x4a82bf['body']);_0x109bdf[_0x40fa('0x17')]();})[_0x40fa('0x18')](function(_0x42193f){logger[_0x40fa('0x19')]('[%s][MESSAGE]\x20%s',_0x9d298d,JSON[_0x40fa('0x1a')](_0x42193f));_0x109bdf[_0x40fa('0x1b')]();});}}catch(_0x4b131a){logger['error']('[%s][MESSAGE]\x20%s',_0x9d298d,JSON[_0x40fa('0x1a')](_0x4b131a));_0x109bdf[_0x40fa('0x1b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 422f3f3..f72b8bd 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 _0x7df4=['stop','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x39ac50,_0x3c226f){var _0x5e2242=function(_0x172400){while(--_0x172400){_0x39ac50['push'](_0x39ac50['shift']());}};_0x5e2242(++_0x3c226f);}(_0x7df4,0x97));var _0x47df=function(_0x18f052,_0x5c8347){_0x18f052=_0x18f052-0x0;var _0x4d594b=_0x7df4[_0x18f052];return _0x4d594b;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x47df('0x0'));exports[_0x47df('0x1')]=function(_0xbdb88c,_0xcbf2d9){return function(_0x26bd4d){try{logger['info'](_0x47df('0x2'),_0xbdb88c,utils[_0x47df('0x3')](_0xcbf2d9[0x0],this));_0x26bd4d[_0x47df('0x4')]();}catch(_0x229e7b){logger['error']('[%s][NOOP]\x20%s',_0xbdb88c,JSON['stringify'](_0x229e7b));_0x26bd4d[_0x47df('0x5')]();}};}; \ No newline at end of file +var _0x05e3=['./utils','../../../../config/logger','routing','consequence','getMustacheRender','next','stringify','stop'];(function(_0x2bf749,_0x430c2c){var _0x5b11cf=function(_0xf042ef){while(--_0xf042ef){_0x2bf749['push'](_0x2bf749['shift']());}};_0x5b11cf(++_0x430c2c);}(_0x05e3,0x198));var _0x305e=function(_0x2000e1,_0x4dc44c){_0x2000e1=_0x2000e1-0x0;var _0x571c2a=_0x05e3[_0x2000e1];return _0x571c2a;};'use strict';var utils=require(_0x305e('0x0'));var logger=require(_0x305e('0x1'))(_0x305e('0x2'));exports[_0x305e('0x3')]=function(_0x4c0c1b,_0x31f668){return function(_0x5bbfca){try{logger['info']('[%s][NOOP]\x20%s',_0x4c0c1b,utils[_0x305e('0x4')](_0x31f668[0x0],this));_0x5bbfca[_0x305e('0x5')]();}catch(_0x537a6e){logger['error']('[%s][NOOP]\x20%s',_0x4c0c1b,JSON[_0x305e('0x6')](_0x537a6e));_0x5bbfca[_0x305e('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 3ec2edb..b2a3c03 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 _0xa74f=['atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','util','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','localhost','socket.io-emitter','queue_id','account','queue','joinAt','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','interaction','upperFirst','message','channel','chat','AccountId','info','name','QueueReport','catch','error','create\x20queue\x20report','waiting','[%s][STOP:QUEUE][NAME:%s]','update','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','createQueue'];(function(_0x4975f8,_0x3a226c){var _0x86d59f=function(_0x17a8d4){while(--_0x17a8d4){_0x4975f8['push'](_0x4975f8['shift']());}};_0x86d59f(++_0x3a226c);}(_0xa74f,0x9a));var _0xfa74=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xa74f[_0x1fa759];return _0x2da9f4;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xfa74('0x0'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xfa74('0x1'));var config=require(_0xfa74('0x2'));var logger=require(_0xfa74('0x3'))(_0xfa74('0x4'));var strategy=require('./strategy');config[_0xfa74('0x5')]=_['defaults'](config['redis'],{'host':_0xfa74('0x6'),'port':0x18eb});var io=require(_0xfa74('0x7'))(new Redis(config[_0xfa74('0x5')]));var attributes=['id',_0xfa74('0x8'),_0xfa74('0x9'),_0xfa74('0xa'),'from',_0xfa74('0xb')];function emit(_0x37d4d8,_0x355e37,_0x2a405e){io['to'](_0x37d4d8)['emit'](_0x355e37,_0x2a405e);}function emitChannelQueueInteraction(_0x46117e,_0x4f8891,_0x48695c,_0x335056,_0x1d919d,_0x30b2d5,_0x307d35,_0x5bc6b7){var _0x23591a=_[_0xfa74('0xc')](_0x48695c);_0x23591a[_0xfa74('0x8')]=_0x5bc6b7;_0x23591a[_0xfa74('0xa')]=_0x4f8891;_0x23591a['account']=_0x335056;_0x23591a['id']=_0x1d919d;if(_0x30b2d5){_0x307d35[util[_0xfa74('0xd')](_0xfa74('0xe'),_0x46117e)][_0x1d919d]=_[_0xfa74('0xf')](_0x23591a,attributes);}else{delete _0x307d35[util[_0xfa74('0xd')](_0xfa74('0xe'),_0x46117e)][_0x1d919d];}emit(util['format'](_0xfa74('0x10'),_0x46117e,_0x4f8891),util[_0xfa74('0xd')](_0xfa74('0x11'),_0x46117e,_0x30b2d5?_0xfa74('0x12'):_0xfa74('0x13')),_[_0xfa74('0xf')](_0x23591a,attributes));}var rpc={'openchannelQueueReport':require(_0xfa74('0x14')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xfa74('0x15')),'smsQueueReport':require(_0xfa74('0x16')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xfa74('0x17')},'timeout':{'type':_0xfa74('0x18'),'message':_0xfa74('0x19')}});function startRouting(_0x5a863f,_0x3bede6,_0x2edebb,_0x3f9f40){if(_0x5a863f&&_0x3bede6&&_0x2edebb){_0x3bede6['waiting']+=0x1;var _0xd35110={'uniqueid':_0x5a863f,'from':_0x2edebb[_0xfa74('0x1a')]?_0x2edebb[_0xfa74('0x1a')]['from']:'','joinAt':moment()['format'](_0xfa74('0x1b')),'ContactId':_0x2edebb[_0xfa74('0x1c')]?_0x2edebb[_0xfa74('0x1c')]['id']:null,'ListId':_0x2edebb[_0xfa74('0x1d')]?_0x2edebb[_0xfa74('0x1d')]['id']:null};_0xd35110[_['upperFirst'](_0x2edebb['channel'])+_0xfa74('0x1e')]=_0x3bede6['id']||null;_0xd35110[_['upperFirst'](_0x2edebb['channel'])+'InteractionId']=_0x2edebb[_0xfa74('0x1f')]?_0x2edebb[_0xfa74('0x1f')]['id']:null;_0xd35110[_[_0xfa74('0x20')](_0x2edebb['channel'])+'MessageId']=_0x2edebb[_0xfa74('0x21')]?_0x2edebb[_0xfa74('0x21')]['id']:null;_0xd35110[_['upperFirst'](_0x2edebb[_0xfa74('0x22')])+(_0x2edebb['channel']!==_0xfa74('0x23')?_0xfa74('0x24'):'WebsiteId')]=_0x2edebb[_0xfa74('0x9')]?_0x2edebb[_0xfa74('0x9')]['id']:null;logger[_0xfa74('0x25')](util[_0xfa74('0xd')]('[%s][START:QUEUE][NAME:%s]',_0x5a863f,_0x3bede6[_0xfa74('0x26')]));emitChannelQueueInteraction(_0x2edebb[_0xfa74('0x22')],_0x3bede6[_0xfa74('0x26')],_0xd35110,_0x2edebb['account']['name'],_0x2edebb[_0xfa74('0x21')]['id'],!![],_0x3f9f40,_0x3bede6['id']);if(rpc[_0x2edebb[_0xfa74('0x22')]+'QueueReport']){return rpc[_0x2edebb['channel']+_0xfa74('0x27')]['create'](_0xd35110)[_0xfa74('0x28')](function(_0x4d6d0a){logger[_0xfa74('0x29')](_0xfa74('0x2a'));});}}}function stopRouting(_0x3c4cd1,_0xdd93e5,_0x4c506f,_0x25e1fb){if(_0x3c4cd1&&_0xdd93e5){_0xdd93e5[_0xfa74('0x2b')]-=0x1;var _0x317180={'leaveAt':moment()[_0xfa74('0xd')](_0xfa74('0x1b')),'acceptAt':moment()[_0xfa74('0xd')](_0xfa74('0x1b')),'reason':'accepted'};logger[_0xfa74('0x25')](util['format'](_0xfa74('0x2c'),_0x3c4cd1,_0xdd93e5[_0xfa74('0x26')]));emitChannelQueueInteraction(_0x4c506f[_0xfa74('0x22')],_0xdd93e5[_0xfa74('0x26')],_0x4c506f['body'],_0x4c506f['account'][_0xfa74('0x26')],_0x4c506f[_0xfa74('0x21')]['id'],![],_0x25e1fb,_0xdd93e5['id']);if(rpc[_0x4c506f[_0xfa74('0x22')]+_0xfa74('0x27')]){return rpc[_0x4c506f['channel']+_0xfa74('0x27')][_0xfa74('0x2d')](_0x3c4cd1,_0x317180)['catch'](function(_0x56c23a){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x5d20a7,_0x8e7612,_0x1c3b44,_0x3dcda3){if(_0x5d20a7&&_0x8e7612){_0x8e7612[_0xfa74('0x2b')]-=0x1;var _0x2ab5a9={'leaveAt':moment()[_0xfa74('0xd')](_0xfa74('0x1b')),'exitAt':moment()[_0xfa74('0xd')](_0xfa74('0x1b')),'reason':'timeout'};logger[_0xfa74('0x25')](util[_0xfa74('0xd')](_0xfa74('0x2e'),_0x5d20a7,_0x8e7612[_0xfa74('0x26')]));emitChannelQueueInteraction(_0x1c3b44[_0xfa74('0x22')],_0x8e7612[_0xfa74('0x26')],_0x1c3b44['body'],_0x1c3b44[_0xfa74('0x9')][_0xfa74('0x26')],_0x1c3b44[_0xfa74('0x21')]['id'],![],_0x3dcda3);if(rpc[_0x1c3b44[_0xfa74('0x22')]+'QueueReport']){return rpc[_0x1c3b44[_0xfa74('0x22')]+_0xfa74('0x27')][_0xfa74('0x2d')](_0x5d20a7,_0x2ab5a9)[_0xfa74('0x28')](function(_0x565b5d){logger[_0xfa74('0x29')](_0xfa74('0x2f'));});}}}function handleFindQueue(_0x3dacc2){return function(_0x482b42){return _0x482b42['name'][_0xfa74('0x30')]()===_0x3dacc2[_0xfa74('0x30')]();};}exports[_0xfa74('0x31')]=function(_0x2851fc,_0x55f4e3,_0x1ab026,_0x171923){return function(_0x54e66d){try{var _0x5d60f7={'name':_0x55f4e3[0x0],'timeout':_0x55f4e3[0x1]};var _0x523b25=queue['validate'](_0x5d60f7,{'typecast':!![]});if(_0x523b25[_0xfa74('0x32')]){logger[_0xfa74('0x29')](_0xfa74('0x33'),_0x2851fc,_[_0xfa74('0x34')](_0x523b25,_0xfa74('0x21'))[_0xfa74('0x35')](',\x20'));_0x54e66d[_0xfa74('0x36')]();}else{var _0x5aac45=_[_0xfa74('0x37')](_0x1ab026[_0x171923[_0xfa74('0x22')]+_0xfa74('0x38')],handleFindQueue(_0x5d60f7[_0xfa74('0x26')]));if(_0x5aac45){startRouting(_0x2851fc,_0x5aac45,_0x171923,_0x1ab026);var _0x6dca09=(_0x5aac45['timeout']||0xa)*0x3e8;var _0x3eebec=(_0x5d60f7[_0xfa74('0x39')]||0x14)*0x3e8;var _0x107a60,_0x412d00;if(_0x6dca09>_0x3eebec){_0x3eebec=_0x6dca09;}var _0xcc408c=seqqueue[_0xfa74('0x3a')](_0x6dca09);_0xcc408c['id']=_0x2851fc;_0xcc408c[_0xfa74('0x3b')]=_0x6dca09;_0xcc408c[_0xfa74('0x3c')]=_0x3eebec;_0xcc408c[_0xfa74('0x22')]=_0x171923[_0xfa74('0x22')];_0x1ab026['rules'][_0x2851fc]['on'](_0xfa74('0x3d'),function(){logger['info'](_0xfa74('0x3e'),_0x2851fc);stopRouting(_0x2851fc,_0x5aac45,_0x171923,_0x1ab026);clearTimeout(_0x107a60);_0x107a60=undefined;_0xcc408c[_0xfa74('0x3f')](!![]);if(_0x1ab026[_0xfa74('0x40')][_0x2851fc]){delete _0x1ab026[_0xfa74('0x40')][_0x2851fc];}_0x54e66d['stop']();});_0x1ab026[_0xfa74('0x40')][_0x2851fc]['on'](_0xfa74('0x41'),function(){if(_0x1ab026['rules'][_0x2851fc]){delete _0x1ab026[_0xfa74('0x40')][_0x2851fc];}});_0x107a60=setTimeout(function(){logger[_0xfa74('0x25')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x2851fc);endRouting(_0x2851fc,_0x5aac45,_0x171923,_0x1ab026);clearTimeout(_0x107a60);_0xcc408c[_0xfa74('0x3f')](!![]);_0x54e66d[_0xfa74('0x42')]();},_0x3eebec);switch(_0x5aac45[_0xfa74('0x43')]){case _0xfa74('0x44'):strategy[_0xfa74('0x44')](_0xcc408c,_0x5aac45,_0x1ab026,_0x171923);break;default:strategy['beepall'](_0xcc408c,_0x5aac45,_0x1ab026,_0x171923);}}else{logger['error'](_0xfa74('0x45'),_0x2851fc,_0x5d60f7[_0xfa74('0x26')]);_0x54e66d['stop']();}}}catch(_0x32e440){console[_0xfa74('0x46')](_0x32e440);logger[_0xfa74('0x29')]('[%s][QUEUE]\x20%s',_0x2851fc,_0x32e440['stack']);_0x54e66d[_0xfa74('0x36')]();}};}; \ No newline at end of file +var _0x9c00=['queue_id','account','queue','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','find','timeout','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','log','stack','validate','lodash','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter'];(function(_0x3ade49,_0x5ce9b6){var _0x318cf7=function(_0x436900){while(--_0x436900){_0x3ade49['push'](_0x3ade49['shift']());}};_0x318cf7(++_0x5ce9b6);}(_0x9c00,0x1a0));var _0x09c0=function(_0x233e6f,_0x4019ac){_0x233e6f=_0x233e6f-0x0;var _0x1deeb0=_0x9c00[_0x233e6f];return _0x1deeb0;};'use strict';var schema=require(_0x09c0('0x0'));var _=require(_0x09c0('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0x09c0('0x2'));var Redis=require(_0x09c0('0x3'));var config=require('../../../../config/environment');var logger=require(_0x09c0('0x4'))(_0x09c0('0x5'));var strategy=require(_0x09c0('0x6'));config[_0x09c0('0x7')]=_[_0x09c0('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x09c0('0x9'))(new Redis(config[_0x09c0('0x7')]));var attributes=['id',_0x09c0('0xa'),_0x09c0('0xb'),_0x09c0('0xc'),'from',_0x09c0('0xd')];function emit(_0x1c1246,_0xa20b5c,_0x1feb1d){io['to'](_0x1c1246)[_0x09c0('0xe')](_0xa20b5c,_0x1feb1d);}function emitChannelQueueInteraction(_0x1e16f4,_0x1fec4f,_0x36f26d,_0x278f8b,_0x4523ea,_0x179b1b,_0x2a8262,_0x2929f1){var _0x144271=_[_0x09c0('0xf')](_0x36f26d);_0x144271[_0x09c0('0xa')]=_0x2929f1;_0x144271[_0x09c0('0xc')]=_0x1fec4f;_0x144271[_0x09c0('0xb')]=_0x278f8b;_0x144271['id']=_0x4523ea;if(_0x179b1b){_0x2a8262[util[_0x09c0('0x10')](_0x09c0('0x11'),_0x1e16f4)][_0x4523ea]=_[_0x09c0('0x12')](_0x144271,attributes);}else{delete _0x2a8262[util[_0x09c0('0x10')](_0x09c0('0x11'),_0x1e16f4)][_0x4523ea];}emit(util[_0x09c0('0x10')](_0x09c0('0x13'),_0x1e16f4,_0x1fec4f),util[_0x09c0('0x10')]('%s_queue_waiting_interaction:%s',_0x1e16f4,_0x179b1b?'save':'remove'),_[_0x09c0('0x12')](_0x144271,attributes));}var rpc={'openchannelQueueReport':require(_0x09c0('0x14')),'mailQueueReport':require(_0x09c0('0x15')),'chatQueueReport':require(_0x09c0('0x16')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x09c0('0x17'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x09c0('0x18'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2cda5e,_0x319c36,_0x2da257,_0x49064c){if(_0x2cda5e&&_0x319c36&&_0x2da257){_0x319c36[_0x09c0('0x19')]+=0x1;var _0x44f714={'uniqueid':_0x2cda5e,'from':_0x2da257[_0x09c0('0x1a')]?_0x2da257[_0x09c0('0x1a')][_0x09c0('0x1b')]:'','joinAt':moment()[_0x09c0('0x10')](_0x09c0('0x1c')),'ContactId':_0x2da257['contact']?_0x2da257[_0x09c0('0x1d')]['id']:null,'ListId':_0x2da257[_0x09c0('0x1e')]?_0x2da257[_0x09c0('0x1e')]['id']:null};_0x44f714[_[_0x09c0('0x1f')](_0x2da257['channel'])+'QueueId']=_0x319c36['id']||null;_0x44f714[_[_0x09c0('0x1f')](_0x2da257[_0x09c0('0x20')])+_0x09c0('0x21')]=_0x2da257[_0x09c0('0x22')]?_0x2da257['interaction']['id']:null;_0x44f714[_[_0x09c0('0x1f')](_0x2da257[_0x09c0('0x20')])+'MessageId']=_0x2da257[_0x09c0('0x23')]?_0x2da257[_0x09c0('0x23')]['id']:null;_0x44f714[_[_0x09c0('0x1f')](_0x2da257[_0x09c0('0x20')])+(_0x2da257[_0x09c0('0x20')]!==_0x09c0('0x24')?_0x09c0('0x25'):_0x09c0('0x26'))]=_0x2da257[_0x09c0('0xb')]?_0x2da257[_0x09c0('0xb')]['id']:null;logger[_0x09c0('0x27')](util['format'](_0x09c0('0x28'),_0x2cda5e,_0x319c36[_0x09c0('0x29')]));emitChannelQueueInteraction(_0x2da257['channel'],_0x319c36[_0x09c0('0x29')],_0x44f714,_0x2da257['account'][_0x09c0('0x29')],_0x2da257['message']['id'],!![],_0x49064c,_0x319c36['id']);if(rpc[_0x2da257[_0x09c0('0x20')]+_0x09c0('0x2a')]){return rpc[_0x2da257[_0x09c0('0x20')]+_0x09c0('0x2a')]['create'](_0x44f714)['catch'](function(_0x17c374){logger[_0x09c0('0x2b')](_0x09c0('0x2c'));});}}}function stopRouting(_0x5c93ca,_0x321ee6,_0x4bdae9,_0x350cd3){if(_0x5c93ca&&_0x321ee6){_0x321ee6[_0x09c0('0x19')]-=0x1;var _0x16cf08={'leaveAt':moment()['format'](_0x09c0('0x1c')),'acceptAt':moment()[_0x09c0('0x10')](_0x09c0('0x1c')),'reason':_0x09c0('0x2d')};logger[_0x09c0('0x27')](util[_0x09c0('0x10')](_0x09c0('0x2e'),_0x5c93ca,_0x321ee6['name']));emitChannelQueueInteraction(_0x4bdae9[_0x09c0('0x20')],_0x321ee6[_0x09c0('0x29')],_0x4bdae9[_0x09c0('0x1a')],_0x4bdae9[_0x09c0('0xb')][_0x09c0('0x29')],_0x4bdae9['message']['id'],![],_0x350cd3,_0x321ee6['id']);if(rpc[_0x4bdae9[_0x09c0('0x20')]+_0x09c0('0x2a')]){return rpc[_0x4bdae9[_0x09c0('0x20')]+_0x09c0('0x2a')][_0x09c0('0x2f')](_0x5c93ca,_0x16cf08)['catch'](function(_0x149684){logger[_0x09c0('0x2b')](_0x09c0('0x30'));});}}}function endRouting(_0x16f81e,_0x419d1c,_0x3e8b74,_0x21c48c){if(_0x16f81e&&_0x419d1c){_0x419d1c['waiting']-=0x1;var _0x363b5c={'leaveAt':moment()[_0x09c0('0x10')](_0x09c0('0x1c')),'exitAt':moment()[_0x09c0('0x10')](_0x09c0('0x1c')),'reason':'timeout'};logger['info'](util['format']('[%s][END:QUEUE][NAME:%s]',_0x16f81e,_0x419d1c[_0x09c0('0x29')]));emitChannelQueueInteraction(_0x3e8b74[_0x09c0('0x20')],_0x419d1c[_0x09c0('0x29')],_0x3e8b74[_0x09c0('0x1a')],_0x3e8b74[_0x09c0('0xb')]['name'],_0x3e8b74[_0x09c0('0x23')]['id'],![],_0x21c48c);if(rpc[_0x3e8b74[_0x09c0('0x20')]+'QueueReport']){return rpc[_0x3e8b74[_0x09c0('0x20')]+'QueueReport'][_0x09c0('0x2f')](_0x16f81e,_0x363b5c)['catch'](function(_0x3a68c9){logger[_0x09c0('0x2b')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x26a21c){return function(_0x17fed6){return _0x17fed6['name'][_0x09c0('0x31')]()===_0x26a21c[_0x09c0('0x31')]();};}exports[_0x09c0('0x32')]=function(_0x27e4fb,_0xeb8191,_0x34326c,_0x4ce427){return function(_0x24bb97){try{var _0x3e0686={'name':_0xeb8191[0x0],'timeout':_0xeb8191[0x1]};var _0x2d6344=queue['validate'](_0x3e0686,{'typecast':!![]});if(_0x2d6344[_0x09c0('0x33')]){logger[_0x09c0('0x2b')](_0x09c0('0x34'),_0x27e4fb,_['map'](_0x2d6344,_0x09c0('0x23'))[_0x09c0('0x35')](',\x20'));_0x24bb97['stop']();}else{var _0x5bbf4e=_[_0x09c0('0x36')](_0x34326c[_0x4ce427[_0x09c0('0x20')]+'Queues'],handleFindQueue(_0x3e0686[_0x09c0('0x29')]));if(_0x5bbf4e){startRouting(_0x27e4fb,_0x5bbf4e,_0x4ce427,_0x34326c);var _0x35dca5=(_0x5bbf4e['timeout']||0xa)*0x3e8;var _0xbabba1=(_0x3e0686[_0x09c0('0x37')]||0x14)*0x3e8;var _0x2e7d4f,_0x33fc26;if(_0x35dca5>_0xbabba1){_0xbabba1=_0x35dca5;}var _0x2cef94=seqqueue['createQueue'](_0x35dca5);_0x2cef94['id']=_0x27e4fb;_0x2cef94[_0x09c0('0x38')]=_0x35dca5;_0x2cef94['qtimeout']=_0xbabba1;_0x2cef94['channel']=_0x4ce427[_0x09c0('0x20')];_0x34326c[_0x09c0('0x39')][_0x27e4fb]['on'](_0x09c0('0x3a'),function(){logger[_0x09c0('0x27')](_0x09c0('0x3b'),_0x27e4fb);stopRouting(_0x27e4fb,_0x5bbf4e,_0x4ce427,_0x34326c);clearTimeout(_0x2e7d4f);_0x2e7d4f=undefined;_0x2cef94[_0x09c0('0x3c')](!![]);if(_0x34326c['rules'][_0x27e4fb]){delete _0x34326c['rules'][_0x27e4fb];}_0x24bb97['stop']();});_0x34326c[_0x09c0('0x39')][_0x27e4fb]['on'](_0x09c0('0x3d'),function(){if(_0x34326c[_0x09c0('0x39')][_0x27e4fb]){delete _0x34326c['rules'][_0x27e4fb];}});_0x2e7d4f=setTimeout(function(){logger[_0x09c0('0x27')](_0x09c0('0x3e'),_0x27e4fb);endRouting(_0x27e4fb,_0x5bbf4e,_0x4ce427,_0x34326c);clearTimeout(_0x2e7d4f);_0x2cef94[_0x09c0('0x3c')](!![]);_0x24bb97[_0x09c0('0x3f')]();},_0xbabba1);switch(_0x5bbf4e[_0x09c0('0x40')]){case _0x09c0('0x41'):strategy[_0x09c0('0x41')](_0x2cef94,_0x5bbf4e,_0x34326c,_0x4ce427);break;default:strategy[_0x09c0('0x42')](_0x2cef94,_0x5bbf4e,_0x34326c,_0x4ce427);}}else{logger[_0x09c0('0x2b')](_0x09c0('0x43'),_0x27e4fb,_0x3e0686[_0x09c0('0x29')]);_0x24bb97[_0x09c0('0x44')]();}}}catch(_0x28bd8a){console[_0x09c0('0x45')](_0x28bd8a);logger[_0x09c0('0x2b')](_0x09c0('0x34'),_0x27e4fb,_0x28bd8a[_0x09c0('0x46')]);_0x24bb97[_0x09c0('0x44')]();}};}; \ 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 1f2c1c9..b5e4948 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 _0x5fec=['showNotification','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','realtime','squeue','push','bind','timeout','handleTimeout','drained','handleDrained','handleRun','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0x5fec,0x6b));var _0xc5fe=function(_0x1ced67,_0x4352ea){_0x1ced67=_0x1ced67-0x0;var _0x219ef0=_0x5fec[_0x1ced67];return _0x219ef0;};'use strict';var _=require(_0xc5fe('0x0'));var uuid=require('uuid');var util=require(_0xc5fe('0x1'));var logger=require(_0xc5fe('0x2'))(_0xc5fe('0x3'));var Agent=function(_0x23504f,_0x46ef7c,_0x4fe294,_0x460af0){this[_0xc5fe('0x4')]=uuid['v4']();this['squeue']=_0x23504f;this['agent']=_0x46ef7c;this[_0xc5fe('0x5')]=_0x4fe294;this[_0xc5fe('0x3')]=_0x460af0;this[_0xc5fe('0x6')][_0xc5fe('0x7')](this['handleRun'][_0xc5fe('0x8')](this),this['handleTimeout'][_0xc5fe('0x8')](this));this[_0xc5fe('0x6')]['on'](_0xc5fe('0x9'),this[_0xc5fe('0xa')]['bind'](this));this[_0xc5fe('0x6')]['on'](_0xc5fe('0xb'),this[_0xc5fe('0xc')][_0xc5fe('0x8')](this));};Agent['prototype'][_0xc5fe('0x7')]=function(){this[_0xc5fe('0x6')][_0xc5fe('0x7')](this[_0xc5fe('0xd')][_0xc5fe('0x8')](this),this[_0xc5fe('0xa')][_0xc5fe('0x8')](this));};Agent[_0xc5fe('0xe')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent[_0xc5fe('0xe')]['handleRun']=function(_0x4fa49b){logger[_0xc5fe('0xf')](_0xc5fe('0x10'),this[_0xc5fe('0x6')]['id'],this[_0xc5fe('0x11')]['id']);if(_[_0xc5fe('0x12')](this[_0xc5fe('0x5')][_0xc5fe('0x13')][this[_0xc5fe('0x11')]['id']])){logger[_0xc5fe('0xf')](_0xc5fe('0x14'),this[_0xc5fe('0x6')]['id'],this[_0xc5fe('0x11')]['id']);setTimeout(this[_0xc5fe('0x7')][_0xc5fe('0x8')](this),0x3e8);}else{if(this['routing'][_0xc5fe('0x15')]||util['isAgentAvailable'](this['squeue']['id'],this['realtime'][_0xc5fe('0x13')][this[_0xc5fe('0x11')]['id']],this[_0xc5fe('0x6')][_0xc5fe('0x16')],![])){this[_0xc5fe('0x5')][_0xc5fe('0x13')][this[_0xc5fe('0x11')]['id']][_0xc5fe('0x17')]=!![];this[_0xc5fe('0x5')][_0xc5fe('0x13')][this[_0xc5fe('0x11')]['id']][_0xc5fe('0x18')]=undefined;util[_0xc5fe('0x19')](this[_0xc5fe('0x4')],this[_0xc5fe('0x6')]['id'],this[_0xc5fe('0x5')]['agents'][this[_0xc5fe('0x11')]['id']],null,this['routing']);util['writeLog'](this['squeue']['id'],this['realtime']['agents'][this[_0xc5fe('0x11')]['id']],_0xc5fe('0x1a')+(this[_0xc5fe('0x3')][_0xc5fe('0x15')]?':FORCED':''));}else{logger['info'](_0xc5fe('0x1b'),this[_0xc5fe('0x6')]['id'],this[_0xc5fe('0x11')]['id']);setTimeout(this[_0xc5fe('0x7')][_0xc5fe('0x8')](this),0x3e8);}}};Agent[_0xc5fe('0xe')][_0xc5fe('0xa')]=function(_0x100ed5){if(_[_0xc5fe('0x12')](this[_0xc5fe('0x5')]['agents'][this[_0xc5fe('0x11')]['id']])){return logger[_0xc5fe('0xf')](_0xc5fe('0x14'),this[_0xc5fe('0x6')]['id'],this[_0xc5fe('0x11')]['id']);}else{logger[_0xc5fe('0xf')](_0xc5fe('0x1c'),this[_0xc5fe('0x6')]['id'],this[_0xc5fe('0x11')]['id']);util[_0xc5fe('0x1d')](this[_0xc5fe('0x4')],this[_0xc5fe('0x6')]['id'],this[_0xc5fe('0x5')]['agents'][this[_0xc5fe('0x11')]['id']],null,this[_0xc5fe('0x3')]);this[_0xc5fe('0x5')][_0xc5fe('0x13')][this[_0xc5fe('0x11')]['id']][_0xc5fe('0x17')]=![];this[_0xc5fe('0x5')][_0xc5fe('0x13')][this[_0xc5fe('0x11')]['id']][_0xc5fe('0x18')]=undefined;util[_0xc5fe('0x1e')](this[_0xc5fe('0x6')]['id'],this[_0xc5fe('0x5')][_0xc5fe('0x13')][this[_0xc5fe('0x11')]['id']],_0x100ed5?'STOP':_0xc5fe('0x1f'));}if(!_0x100ed5){setTimeout(this['push'][_0xc5fe('0x8')](this),0x3e8);}};function agent(_0x44bc3b,_0x5d0135,_0x41fa39,_0x1b9031){return new Agent(_0x44bc3b,_0x5d0135,_0x41fa39,_0x1b9031);}module[_0xc5fe('0x20')]=agent; \ No newline at end of file +var _0x5d7b=['isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','showNotification','notificationId','RINGING','forcedOwnership','hideNotification','busyQueue','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','bind','timeout','handleTimeout','drained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x37d172,_0x55b556){var _0xc6dac3=function(_0x2a5742){while(--_0x2a5742){_0x37d172['push'](_0x37d172['shift']());}};_0xc6dac3(++_0x55b556);}(_0x5d7b,0x182));var _0xb5d7=function(_0x19d6f2,_0x38aee2){_0x19d6f2=_0x19d6f2-0x0;var _0x3a44b2=_0x5d7b[_0x19d6f2];return _0x3a44b2;};'use strict';var _=require(_0xb5d7('0x0'));var uuid=require(_0xb5d7('0x1'));var util=require(_0xb5d7('0x2'));var logger=require(_0xb5d7('0x3'))(_0xb5d7('0x4'));var Agent=function(_0x329f32,_0x24d3f1,_0x2cf39a,_0x53f0d7){this['notificationId']=uuid['v4']();this[_0xb5d7('0x5')]=_0x329f32;this[_0xb5d7('0x6')]=_0x24d3f1;this[_0xb5d7('0x7')]=_0x2cf39a;this[_0xb5d7('0x4')]=_0x53f0d7;this['squeue'][_0xb5d7('0x8')](this[_0xb5d7('0x9')]['bind'](this),this['handleTimeout'][_0xb5d7('0xa')](this));this[_0xb5d7('0x5')]['on'](_0xb5d7('0xb'),this[_0xb5d7('0xc')][_0xb5d7('0xa')](this));this[_0xb5d7('0x5')]['on'](_0xb5d7('0xd'),this['handleDrained'][_0xb5d7('0xa')](this));};Agent['prototype'][_0xb5d7('0x8')]=function(){this[_0xb5d7('0x5')]['push'](this['handleRun'][_0xb5d7('0xa')](this),this[_0xb5d7('0xc')][_0xb5d7('0xa')](this));};Agent[_0xb5d7('0xe')]['handleDrained']=function(){this[_0xb5d7('0xc')](!![]);};Agent['prototype'][_0xb5d7('0x9')]=function(_0x2ac4a2){logger[_0xb5d7('0xf')](_0xb5d7('0x10'),this[_0xb5d7('0x5')]['id'],this['agent']['id']);if(_[_0xb5d7('0x11')](this['realtime'][_0xb5d7('0x12')][this[_0xb5d7('0x6')]['id']])){logger[_0xb5d7('0xf')](_0xb5d7('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0xb5d7('0x8')]['bind'](this),0x3e8);}else{if(this[_0xb5d7('0x4')]['forcedOwnership']||util[_0xb5d7('0x14')](this['squeue']['id'],this[_0xb5d7('0x7')][_0xb5d7('0x12')][this[_0xb5d7('0x6')]['id']],this[_0xb5d7('0x5')][_0xb5d7('0x15')],![])){this[_0xb5d7('0x7')][_0xb5d7('0x12')][this['agent']['id']][_0xb5d7('0x16')]=!![];this[_0xb5d7('0x7')][_0xb5d7('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0xb5d7('0x17')](this[_0xb5d7('0x18')],this[_0xb5d7('0x5')]['id'],this[_0xb5d7('0x7')][_0xb5d7('0x12')][this[_0xb5d7('0x6')]['id']],null,this['routing']);util['writeLog'](this[_0xb5d7('0x5')]['id'],this[_0xb5d7('0x7')][_0xb5d7('0x12')][this['agent']['id']],_0xb5d7('0x19')+(this[_0xb5d7('0x4')][_0xb5d7('0x1a')]?':FORCED':''));}else{logger[_0xb5d7('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xb5d7('0x5')]['id'],this[_0xb5d7('0x6')]['id']);setTimeout(this[_0xb5d7('0x8')]['bind'](this),0x3e8);}}};Agent[_0xb5d7('0xe')][_0xb5d7('0xc')]=function(_0xb0caf8){if(_[_0xb5d7('0x11')](this['realtime'][_0xb5d7('0x12')][this['agent']['id']])){return logger[_0xb5d7('0xf')](_0xb5d7('0x13'),this[_0xb5d7('0x5')]['id'],this[_0xb5d7('0x6')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xb5d7('0x5')]['id'],this[_0xb5d7('0x6')]['id']);util[_0xb5d7('0x1b')](this[_0xb5d7('0x18')],this[_0xb5d7('0x5')]['id'],this[_0xb5d7('0x7')]['agents'][this['agent']['id']],null,this[_0xb5d7('0x4')]);this[_0xb5d7('0x7')][_0xb5d7('0x12')][this[_0xb5d7('0x6')]['id']][_0xb5d7('0x16')]=![];this[_0xb5d7('0x7')]['agents'][this[_0xb5d7('0x6')]['id']][_0xb5d7('0x1c')]=undefined;util['writeLog'](this[_0xb5d7('0x5')]['id'],this['realtime'][_0xb5d7('0x12')][this[_0xb5d7('0x6')]['id']],_0xb0caf8?'STOP':_0xb5d7('0x1d'));}if(!_0xb0caf8){setTimeout(this[_0xb5d7('0x8')]['bind'](this),0x3e8);}};function agent(_0x5344ce,_0x5c23e9,_0x1c093f,_0x4ce622){return new Agent(_0x5344ce,_0x5c23e9,_0x1c093f,_0x4ce622);}module[_0xb5d7('0x1e')]=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 e1756d6..83ba196 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 _0x4d5c=['prototype','isNil','Agents','length','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','TIMEOUT','exports','lodash','uuid','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained'];(function(_0xb1afc3,_0xe7d00b){var _0x1f6ca7=function(_0x5cef80){while(--_0x5cef80){_0xb1afc3['push'](_0xb1afc3['shift']());}};_0x1f6ca7(++_0xe7d00b);}(_0x4d5c,0x1d3));var _0xc4d5=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0x4d5c[_0xfb0cfd];return _0x2fd8aa;};'use strict';var _=require(_0xc4d5('0x0'));var uuid=require(_0xc4d5('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0xc4d5('0x2'));var Beepall=function(_0x4bf78d,_0x468308,_0x174f6a,_0x1d30b7){this[_0xc4d5('0x3')]=uuid['v4']();this[_0xc4d5('0x4')]=_0x4bf78d;this[_0xc4d5('0x5')]=_0x468308;this[_0xc4d5('0x6')]=_0x174f6a;this[_0xc4d5('0x2')]=_0x1d30b7;this[_0xc4d5('0x4')][_0xc4d5('0x7')](this[_0xc4d5('0x8')][_0xc4d5('0x9')](this),this['handleTimeout'][_0xc4d5('0x9')](this));this['squeue']['on']('timeout',this[_0xc4d5('0xa')][_0xc4d5('0x9')](this));this[_0xc4d5('0x4')]['on'](_0xc4d5('0xb'),this[_0xc4d5('0xc')][_0xc4d5('0x9')](this));};Beepall[_0xc4d5('0xd')][_0xc4d5('0x7')]=function(){this['squeue'][_0xc4d5('0x7')](this[_0xc4d5('0x8')][_0xc4d5('0x9')](this),this['handleTimeout']['bind'](this));};Beepall[_0xc4d5('0xd')][_0xc4d5('0xc')]=function(_0x3ca210){this[_0xc4d5('0xa')](!![]);};Beepall[_0xc4d5('0xd')][_0xc4d5('0x8')]=function(_0x21bbf5){var _0xf5f5d=!![];if(!_['isNil'](this['queue'])&&!_[_0xc4d5('0xe')](this['queue'][_0xc4d5('0xf')])&&this[_0xc4d5('0x5')][_0xc4d5('0xf')][_0xc4d5('0x10')]>0x0){for(var _0x44c2fd=0x0,_0x4a87fd;_0x44c2fd0x0){for(var _0x54c0e0=0x0,_0x5106b3;_0x54c0e00x0&&_0x37edcc[_0xa39019+_0x7eae('0x26')]>=_0x37edcc[_0xa39019+'Capacity']){writeLog(_0x2135bf,_0x37edcc,_0xa39019[_0x7eae('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x7eae('0x28')]=function(_0x4e35ea,_0x1f34f8,_0x15fa5f,_0x2acd9b,_0x4b9cbe){return sendNotification(!![],_0x4e35ea,_0x1f34f8,_0x15fa5f,_0x2acd9b,_0x4b9cbe);};exports[_0x7eae('0x29')]=function(_0x377ca7,_0x2a110c,_0x2a90fe,_0x5826e0,_0x3e69aa){return sendNotification(![],_0x377ca7,_0x2a110c,_0x2a90fe,_0x5826e0,_0x3e69aa);};exports[_0x7eae('0x2a')]=writeLog; \ No newline at end of file +var _0x7035=['emit','format','user:save','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','user:%s','save','remove','info','isAgentAvailable','BUSY','online','OFFLINE','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter'];(function(_0x2a8494,_0x37a1b9){var _0x26d6ed=function(_0x484865){while(--_0x484865){_0x2a8494['push'](_0x2a8494['shift']());}};_0x26d6ed(++_0x37a1b9);}(_0x7035,0x15e));var _0x5703=function(_0x397d04,_0x47cdb5){_0x397d04=_0x397d04-0x0;var _0x3ccf02=_0x7035[_0x397d04];return _0x3ccf02;};'use strict';var _=require(_0x5703('0x0'));var util=require('util');var utils=require(_0x5703('0x1'));var Mustache=require(_0x5703('0x2'));var Redis=require('ioredis');var config=require(_0x5703('0x3'));var logger=require(_0x5703('0x4'))(_0x5703('0x5'));config[_0x5703('0x6')]=_[_0x5703('0x7')](config['redis'],{'host':_0x5703('0x8'),'port':0x18eb});var io=require(_0x5703('0x9'))(new Redis(config['redis']));function emit(_0x2e2e90,_0x1b1ee9,_0x401d33){io['to'](_0x2e2e90)[_0x5703('0xa')](_0x1b1ee9,_0x401d33);}function sendNotification(_0x1afe73,_0x4690de,_0x58ca67,_0x58a04c,_0x169e83,_0x5775d8){io['to'](util[_0x5703('0xb')]('user:%s',_0x58a04c['name']))[_0x5703('0xa')](_0x5703('0xc'),_0x58a04c);var _0xfcbc9e=_0x5775d8||{};var _0x4c7efc=_0x58ca67[_0x5703('0xd')]('.');var _0x4b39aa={'uniqueid':_0x4690de,'channel':_0x4c7efc[0x0],'id':_0x4c7efc[0x1],'title':_0x4c7efc[0x0]+_0x5703('0xe'),'interactionId':_0x4c7efc[0x2],'queue':_0x169e83?_0x169e83[_0x5703('0xf')]:null,'sound':_0xfcbc9e[_0x5703('0x10')][_0x5703('0x11')],'shake':_0xfcbc9e[_0x5703('0x10')][_0x5703('0x12')]};try{if(!_0xfcbc9e[_0x5703('0x13')]){_0xfcbc9e[_0x5703('0x13')]={};}if(_0x169e83){_0xfcbc9e[_0x5703('0x13')][_0x5703('0x14')]=_0x169e83;}else if(_0xfcbc9e[_0x5703('0x13')]['queue']){delete _0xfcbc9e[_0x5703('0x13')][_0x5703('0x14')];}_0x4b39aa[_0x5703('0x15')]=utils[_0x5703('0x16')](_0xfcbc9e[_0x5703('0x10')][_0x5703('0x17')],_0xfcbc9e);}catch(_0x1d6836){_0x4b39aa[_0x5703('0x15')]=_0x5703('0x18');logger['error'](util[_0x5703('0xb')](_0x5703('0x19'),_0x4690de,_0x1d6836['message']));}io['to'](util['format'](_0x5703('0x1a'),_0x58a04c[_0x5703('0xf')]))['emit'](util[_0x5703('0xb')]('notification:%s',_0x1afe73?_0x5703('0x1b'):_0x5703('0x1c')),_0x4b39aa);}function writeLog(_0x1d5a40,_0x1b5418,_0x2a23a3){return logger[_0x5703('0x1d')](util[_0x5703('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1d5a40,_0x1b5418['name'],_0x2a23a3));}exports[_0x5703('0x1e')]=function(_0x44bc80,_0x48368b,_0x28ff84,_0x245abf){if(_0x48368b['busy']){writeLog(_0x44bc80,_0x48368b,_0x5703('0x1f'));return![];}if(!_0x48368b[_0x5703('0x20')]){writeLog(_0x44bc80,_0x48368b,_0x5703('0x21'));return![];}if(_0x48368b[_0x28ff84+'Pause']){writeLog(_0x44bc80,_0x48368b,'PAUSE');return![];}if(_0x245abf&&_0x48368b['hasOwnProperty'](_0x28ff84+_0x5703('0x22'))&&_0x48368b['hasOwnProperty'](_0x28ff84+_0x5703('0x23'))){if(_0x48368b[_0x28ff84+_0x5703('0x22')]>0x0&&_0x48368b[_0x28ff84+_0x5703('0x23')]>=_0x48368b[_0x28ff84+_0x5703('0x22')]){writeLog(_0x44bc80,_0x48368b,_0x28ff84[_0x5703('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x5703('0x25')]=function(_0x492016,_0xe38e94,_0xe4207f,_0x3fb380,_0x4b23ed){return sendNotification(!![],_0x492016,_0xe38e94,_0xe4207f,_0x3fb380,_0x4b23ed);};exports[_0x5703('0x26')]=function(_0x2e2a25,_0x4c1bcd,_0x3bd1f7,_0x1356f4,_0x10193a){return sendNotification(![],_0x2e2a25,_0x4c1bcd,_0x3bd1f7,_0x1356f4,_0x10193a);};exports[_0x5703('0x27')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index fc82dfd..d7bf776 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 _0x7fd2=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','lodash','./utils','string'];(function(_0x5232c7,_0x438b90){var _0xec5538=function(_0x413469){while(--_0x413469){_0x5232c7['push'](_0x5232c7['shift']());}};_0xec5538(++_0x438b90);}(_0x7fd2,0x18d));var _0x27fd=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x7fd2[_0x62c958];return _0x57ec61;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x27fd('0x0'));var utils=require(_0x27fd('0x1'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0x27fd('0x2'),'required':!![],'message':_0x27fd('0x3')}});exports[_0x27fd('0x4')]=function(_0x299865,_0x27f32d){return function(_0x928405){try{var _0x54f4c4={'command':_0x27f32d[0x0]};var _0xdf6b8b=system[_0x27fd('0x5')](_0x54f4c4,{'typecast':!![]});if(_0xdf6b8b[_0x27fd('0x6')]){logger[_0x27fd('0x7')](_0x27fd('0x8'),_0x299865,_[_0x27fd('0x9')](_0xdf6b8b,'message')[_0x27fd('0xa')](',\x20'));logger[_0x27fd('0xb')](_0x27fd('0xc'),_0x299865);_0x928405[_0x27fd('0xd')]();}else{var _0x174bf7=this;var _0x8e2779=utils['getMustacheRender'](_0x27f32d[0x0],this);logger[_0x27fd('0xb')](_0x27fd('0xe'),_0x299865,_0x8e2779);sh[_0x27fd('0xf')](_[_0x27fd('0x10')](_0x8e2779),function(_0x85f120,_0x65528f){logger[_0x27fd('0xb')](_0x27fd('0x11'),_0x299865,_0x85f120);if(_0x85f120==0x0){var _0x33e3c6=_0x65528f['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x27fd('0x12')](_0x27f32d[0x1])||_[_0x27fd('0x13')](_0x27f32d[0x1])){logger[_0x27fd('0xb')](_0x27fd('0x14'),_0x299865);_0x174bf7[_0x27fd('0x15')][_0x27f32d[0x1]]=_0x33e3c6;}else{logger[_0x27fd('0xb')](_0x27fd('0x16'),_0x299865,_0x27f32d[0x1],_0x33e3c6);_0x174bf7[_0x27fd('0x15')][_0x27f32d[0x1]]=_0x33e3c6;}}_0x928405[_0x27fd('0xd')]();});}}catch(_0x2b756f){logger[_0x27fd('0x7')](_0x27fd('0x8'),_0x299865,_[_0x27fd('0x17')](_0x2b756f)?JSON[_0x27fd('0x18')](_0x2b756f):_0x2b756f);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x299865);_0x928405[_0x27fd('0xd')]();}};}; \ No newline at end of file +var _0x5a23=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5a23,0xdc));var _0x35a2=function(_0x32a234,_0x256ffc){_0x32a234=_0x32a234-0x0;var _0x4f2b44=_0x5a23[_0x32a234];return _0x4f2b44;};'use strict';var schema=require(_0x35a2('0x0'));var sh=require(_0x35a2('0x1'));var _=require(_0x35a2('0x2'));var utils=require(_0x35a2('0x3'));var logger=require(_0x35a2('0x4'))('routing');var system=schema({'command':{'type':_0x35a2('0x5'),'required':!![],'message':_0x35a2('0x6')}});exports['consequence']=function(_0x207440,_0x5616f9){return function(_0x48da82){try{var _0x3671fc={'command':_0x5616f9[0x0]};var _0x11a28f=system[_0x35a2('0x0')](_0x3671fc,{'typecast':!![]});if(_0x11a28f[_0x35a2('0x7')]){logger[_0x35a2('0x8')](_0x35a2('0x9'),_0x207440,_[_0x35a2('0xa')](_0x11a28f,'message')[_0x35a2('0xb')](',\x20'));logger[_0x35a2('0xc')](_0x35a2('0xd'),_0x207440);_0x48da82['next']();}else{var _0xb65506=this;var _0x2b4fd4=utils[_0x35a2('0xe')](_0x5616f9[0x0],this);logger[_0x35a2('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x207440,_0x2b4fd4);sh['exec'](_[_0x35a2('0xf')](_0x2b4fd4),function(_0x401fd8,_0x519194){logger[_0x35a2('0xc')](_0x35a2('0x10'),_0x207440,_0x401fd8);if(_0x401fd8==0x0){var _0x2fb10f=_0x519194['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x35a2('0x11')](_0x5616f9[0x1])||_[_0x35a2('0x12')](_0x5616f9[0x1])){logger[_0x35a2('0xc')](_0x35a2('0x13'),_0x207440);_0xb65506[_0x35a2('0x14')][_0x5616f9[0x1]]=_0x2fb10f;}else{logger[_0x35a2('0xc')](_0x35a2('0x15'),_0x207440,_0x5616f9[0x1],_0x2fb10f);_0xb65506[_0x35a2('0x14')][_0x5616f9[0x1]]=_0x2fb10f;}}_0x48da82[_0x35a2('0x16')]();});}}catch(_0xe00375){logger[_0x35a2('0x8')](_0x35a2('0x9'),_0x207440,_[_0x35a2('0x17')](_0xe00375)?JSON[_0x35a2('0x18')](_0xe00375):_0xe00375);logger[_0x35a2('0xc')](_0x35a2('0xd'),_0x207440);_0x48da82['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 52bbc80..5b49276 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(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(_0x52abed,_0x4e6380){var _0x3dba06=function(_0x2ed385){while(--_0x2ed385){_0x52abed['push'](_0x52abed['shift']());}};_0x3dba06(++_0x4e6380);}(_0x7a54,0x106));var _0x47a5=function(_0x358baf,_0x1bccc3){_0x358baf=_0x358baf-0x0;var _0x1a0452=_0x7a54[_0x358baf];return _0x1a0452;};'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 5c6be30..4753616 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 _0x202c=['body','contact','message','account','list','mustache','render'];(function(_0x17dcd1,_0x3b7ccb){var _0x12af77=function(_0x5c3bac){while(--_0x5c3bac){_0x17dcd1['push'](_0x17dcd1['shift']());}};_0x12af77(++_0x3b7ccb);}(_0x202c,0x178));var _0xc202=function(_0x2a71d2,_0x35bcda){_0x2a71d2=_0x2a71d2-0x0;var _0x200112=_0x202c[_0x2a71d2];return _0x200112;};'use strict';var Mustache=require(_0xc202('0x0'));var _=require('lodash');module['exports']={'getMustacheRender':function(_0x1cf3fd,_0x1ab6a1){return Mustache[_0xc202('0x1')](_0x1cf3fd,_['merge'](_0x1ab6a1[_0xc202('0x2')],{'contact':_0x1ab6a1[_0xc202('0x3')],'message':_0x1ab6a1[_0xc202('0x4')],'account':_0x1ab6a1[_0xc202('0x5')],'interaction':_0x1ab6a1['interaction'],'list':_0x1ab6a1[_0xc202('0x6')]}))||'';}}; \ No newline at end of file +var _0xde64=['body','contact','interaction','list','mustache','lodash','exports','render'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xde64,0x17c));var _0x4de6=function(_0x3a96b1,_0x433d36){_0x3a96b1=_0x3a96b1-0x0;var _0x5b0ada=_0xde64[_0x3a96b1];return _0x5b0ada;};'use strict';var Mustache=require(_0x4de6('0x0'));var _=require(_0x4de6('0x1'));module[_0x4de6('0x2')]={'getMustacheRender':function(_0x2433d5,_0x252bfc){return Mustache[_0x4de6('0x3')](_0x2433d5,_['merge'](_0x252bfc[_0x4de6('0x4')],{'contact':_0x252bfc[_0x4de6('0x5')],'message':_0x252bfc['message'],'account':_0x252bfc['account'],'interaction':_0x252bfc[_0x4de6('0x6')],'list':_0x252bfc[_0x4de6('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index daa5966..cea866f 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 _0xf1c6=['TagId','format','%s:%s:%s','./interval','condition','priority','info','Push\x20new\x20rule','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','error','end','channel','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busyQueue','stack','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','interval','message','interaction','applications','isArray','length','app','.js','toLowerCase','autoreply','appdata','split','dialogflow','push','slice','join','tag'];(function(_0x32983e,_0x165534){var _0x4c201c=function(_0x5b1110){while(--_0x5b1110){_0x32983e['push'](_0x32983e['shift']());}};_0x4c201c(++_0x165534);}(_0xf1c6,0xed));var _0x6f1c=function(_0x50359a,_0x207077){_0x50359a=_0x50359a-0x0;var _0x16147e=_0xf1c6[_0x50359a];return _0x16147e;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x6f1c('0x0'));var fs=require('fs');var jayson=require(_0x6f1c('0x1'));var BPromise=require(_0x6f1c('0x2'));var uuid=require(_0x6f1c('0x3'));var config=require(_0x6f1c('0x4'));var logger=require(_0x6f1c('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0x6f1c('0x6'))};var rpc={'openchannelQueueReport':require(_0x6f1c('0x6')),'mailQueueReport':require(_0x6f1c('0x7')),'chatQueueReport':require(_0x6f1c('0x8')),'smsQueueReport':require(_0x6f1c('0x9')),'faxQueueReport':require(_0x6f1c('0xa'))};var RuleEngine=require(_0x6f1c('0xb'));function getId(_0x20956f,_0xfc3ceb,_0x4b5ebe){return util['format'](_0x6f1c('0xc'),_0x20956f,_0xfc3ceb||0x0,_0x4b5ebe||0x0);}function getIntervals(_0x557556,_0x318076){var _0x4459a9=[];if(!_[_0x6f1c('0xd')](_0x318076[_0x6f1c('0xe')])&&!_[_0x6f1c('0xd')](_0x557556[_0x318076['IntervalId']])&&!_['isNil'](_0x557556[_0x318076['IntervalId']][_0x6f1c('0xf')])){_0x4459a9=_['map'](_0x557556[_0x318076[_0x6f1c('0xe')]][_0x6f1c('0xf')],_0x6f1c('0x10'));}else if(!_['isNil'](_0x318076[_0x6f1c('0x10')])){_0x4459a9=[_0x318076['interval']];}return _0x4459a9;}exports['listen']=function(_0x549430){_0x549430['rules']={};return new BPromise(function(_0x404312,_0x182c9d){var _0x116ac4={'Start':function(_0x1ade1b){var _0x2ccd6e=this;return new Promise(function(_0x3856bd,_0x1437b5){if(_0x1ade1b){try{var _0x56f5fa=[];var _0x279e06=getId(_0x1ade1b['channel'],_0x1ade1b[_0x6f1c('0x11')]?_0x1ade1b[_0x6f1c('0x11')]['id']:0x0,_0x1ade1b['interaction']?_0x1ade1b[_0x6f1c('0x12')]['id']:0x0);if(_0x1ade1b[_0x6f1c('0x13')]&&_[_0x6f1c('0x14')](_0x1ade1b[_0x6f1c('0x13')])&&_0x1ade1b[_0x6f1c('0x13')][_0x6f1c('0x15')]){for(var _0x55edff=0x0;_0x55edff<_0x1ade1b[_0x6f1c('0x13')]['length'];_0x55edff+=0x1){var _0x33ec7c=_0x1ade1b[_0x6f1c('0x13')][_0x55edff];if(fs['existsSync'](path['join'](__dirname,_0x6f1c('0x13'),_0x33ec7c[_0x6f1c('0x16')]+_0x6f1c('0x17')))){var _0x4ce0eb=[];switch(_0x33ec7c['app'][_0x6f1c('0x18')]()){case _0x6f1c('0x19'):var _0x42334c=_0x33ec7c[_0x6f1c('0x1a')][_0x6f1c('0x1b')](',');_0x4ce0eb['push'](_0x42334c[0x0]);_0x4ce0eb['push'](_0x42334c['slice'](0x1,_0x42334c['length'])['join'](','));break;case _0x6f1c('0x1c'):var _0x219638=_0x33ec7c[_0x6f1c('0x1a')]['split'](',');_0x4ce0eb['push'](_0x219638[0x0]);_0x4ce0eb[_0x6f1c('0x1d')](_0x219638[0x1]);_0x4ce0eb['push'](_0x219638[_0x6f1c('0x1e')](0x2,_0x219638['length'])[_0x6f1c('0x1f')](','));break;case'amazonlex':var _0x23903d=_0x33ec7c[_0x6f1c('0x1a')][_0x6f1c('0x1b')](',');_0x4ce0eb[_0x6f1c('0x1d')](_0x23903d[0x0]);_0x4ce0eb[_0x6f1c('0x1d')](_0x23903d[0x1]);_0x4ce0eb[_0x6f1c('0x1d')](_0x23903d[0x2]);_0x4ce0eb[_0x6f1c('0x1d')](_0x23903d[0x3]);_0x4ce0eb[_0x6f1c('0x1d')](_0x23903d[_0x6f1c('0x1e')](0x4,_0x23903d[_0x6f1c('0x15')])['join'](','));break;case _0x6f1c('0x11'):_0x4ce0eb[_0x6f1c('0x1d')](_0x33ec7c[_0x6f1c('0x1a')]);break;case _0x6f1c('0x20'):_0x4ce0eb[_0x6f1c('0x1d')](_0x33ec7c[_0x6f1c('0x21')]);_0x4ce0eb['push'](_0x33ec7c[_0x6f1c('0x1a')]);break;default:_0x4ce0eb=_[_0x6f1c('0xd')](_0x33ec7c[_0x6f1c('0x1a')])?[]:_0x33ec7c['appdata'][_0x6f1c('0x1b')](',');}var _0x14ba99={'id':util[_0x6f1c('0x22')](_0x6f1c('0x23'),_0x279e06,_0x33ec7c['id'],_0x33ec7c[_0x6f1c('0x16')]),'condition':require(_0x6f1c('0x24'))[_0x6f1c('0x25')](_0x279e06,getIntervals(_0x549430['intervals'],_0x33ec7c),_0x549430),'consequence':require('./applications/'+_0x33ec7c['app'])['consequence'](_0x279e06,_0x4ce0eb,_0x549430,_0x1ade1b),'p':_0x33ec7c[_0x6f1c('0x26')]||0x0};logger[_0x6f1c('0x27')](_0x6f1c('0x28'),_0x14ba99['id'],'on\x20interval',getIntervals(_0x549430[_0x6f1c('0x29')],_0x33ec7c)[_0x6f1c('0x1f')](_0x6f1c('0x2a')));_0x56f5fa[_0x6f1c('0x1d')](_0x14ba99);}else{logger['error'](_0x6f1c('0x2b'),path[_0x6f1c('0x1f')](__dirname,_0x6f1c('0x13'),_0x33ec7c[_0x6f1c('0x16')]+'.js'));}}_0x549430[_0x6f1c('0x2c')][_0x279e06]=new RuleEngine(_0x56f5fa);_0x549430[_0x6f1c('0x2c')][_0x279e06][_0x6f1c('0x2d')](_0x1ade1b,function(_0x51f203){logger['info']('Applications\x20executed',JSON[_0x6f1c('0x2e')](_0x51f203[_0x6f1c('0x2f')]));if(_0x549430[_0x6f1c('0x2c')][_0x279e06]){_0x549430[_0x6f1c('0x2c')][_0x279e06][_0x6f1c('0x30')](_0x6f1c('0x31'));}});return _0x3856bd({'code':0xc8,'message':_0x1ade1b});}else{logger[_0x6f1c('0x27')](_0x6f1c('0x32'));return _0x3856bd({'code':0xc8,'message':_0x1ade1b});}}catch(_0x57ac36){logger[_0x6f1c('0x33')](_0x57ac36['stack']);return _0x1437b5(_0x2ccd6e[_0x6f1c('0x33')](0x1f4,_0x57ac36));}}return _0x1437b5('routing\x20is\x20empty');});},'AcceptMessage':function(_0x130baa){var _0x4fa9cd=this;return new Promise(function(_0x488a12,_0x1e54a2){if(_0x130baa[_0x6f1c('0x11')]&&_0x130baa[_0x6f1c('0x11')]['id']){try{var _0x210350=getId(_0x130baa['channel'],_0x130baa[_0x6f1c('0x11')]?_0x130baa[_0x6f1c('0x11')]['id']:0x0,_0x130baa['interaction']?_0x130baa['interaction']['id']:0x0);if(_0x549430['rules'][_0x210350]){_0x549430['rules'][_0x210350][_0x6f1c('0x30')](_0x6f1c('0x34'));if(rpc[_0x130baa[_0x6f1c('0x35')]+_0x6f1c('0x36')]){rpc[_0x130baa[_0x6f1c('0x35')]+_0x6f1c('0x36')][_0x6f1c('0x37')](_0x210350,{'UserId':_0x130baa[_0x6f1c('0x11')][_0x6f1c('0x38')]})['catch'](function(_0x567193){logger['error'](_0x6f1c('0x39'));});}}return _0x488a12({'code':0xc8,'message':_0x130baa});}catch(_0x1274bb){logger[_0x6f1c('0x33')](_0x1274bb['stack']);return _0x1e54a2(_0x4fa9cd[_0x6f1c('0x33')](0x1f4,_0x1274bb));}}logger[_0x6f1c('0x33')](_0x6f1c('0x3a'));return _0x1e54a2(_0x4fa9cd[_0x6f1c('0x33')](0x1f4,_0x6f1c('0x3a')));});},'RejectMessage':function(_0x7bce5b){var _0x16c26d=this;return new Promise(function(_0x39f817,_0x345dfb){if(_0x7bce5b[_0x6f1c('0x3b')]&&_0x7bce5b[_0x6f1c('0x3b')]['id']){try{if(_0x549430['agents'][_0x7bce5b[_0x6f1c('0x3b')]['id']]){_0x549430['agents'][_0x7bce5b['agent']['id']]['busy']=![];_0x549430[_0x6f1c('0x3c')][_0x7bce5b[_0x6f1c('0x3b')]['id']][_0x6f1c('0x3d')]=undefined;}return _0x39f817({'code':0xc8,'message':_0x7bce5b});}catch(_0x1ebdd8){logger[_0x6f1c('0x33')](_0x1ebdd8[_0x6f1c('0x3e')]);return _0x345dfb(_0x16c26d[_0x6f1c('0x33')](0x1f4,_0x1ebdd8));}}logger[_0x6f1c('0x33')]('message\x20is\x20empty');return _0x345dfb(_0x16c26d[_0x6f1c('0x33')](0x1f4,_0x6f1c('0x3a')));});},'AbandonInteraction':function(_0xbad09c){var _0x30a56a=this;return new Promise(function(_0x33d9d5,_0x349746){if(_0xbad09c[_0x6f1c('0x35')]&&_0xbad09c['interaction']&&_0xbad09c[_0x6f1c('0x12')]['id']){try{var _0xa7ade1=getId(_0xbad09c[_0x6f1c('0x35')],_0xbad09c[_0x6f1c('0x11')]?_0xbad09c[_0x6f1c('0x11')]['id']:0x0,_0xbad09c[_0x6f1c('0x12')]?_0xbad09c[_0x6f1c('0x12')]['id']:0x0);if(_0x549430[_0x6f1c('0x2c')][_0xa7ade1]){_0x549430[_0x6f1c('0x2c')][_0xa7ade1][_0x6f1c('0x30')](_0x6f1c('0x34'));}return _0x33d9d5({'code':0xc8,'message':_0xbad09c});}catch(_0xc1e1dd){logger[_0x6f1c('0x33')](_0xc1e1dd[_0x6f1c('0x3e')]);return _0x349746(_0x30a56a[_0x6f1c('0x33')](0x1f4,_0xc1e1dd));}}logger[_0x6f1c('0x33')]('message\x20is\x20empty');return _0x349746(_0x30a56a['error'](0x1f4,_0x6f1c('0x3a')));});},'AgentCapacity':function(_0x23710e){var _0x10d374=this;return new Promise(function(_0x53896f,_0x126de5){if(_0x549430['agents'][_0x6f1c('0x3f')](_0x23710e['id'])){for(var _0x18ba22 in _0x23710e[_0x6f1c('0x40')]){if(_0x23710e['capacity'][_0x6f1c('0x3f')](_0x18ba22)){if(_0x549430[_0x6f1c('0x3c')][_0x23710e['id']][_0x6f1c('0x3f')](_0x18ba22+'CurrentCapacity')){_0x549430[_0x6f1c('0x3c')][_0x23710e['id']][_0x18ba22+_0x6f1c('0x41')]=parseInt(_0x23710e['capacity'][_0x18ba22],0xa);}}}_0x549430[_0x6f1c('0x3c')][_0x23710e['id']][_0x6f1c('0x42')]();return _0x53896f({'code':0xc8,'message':_0x549430['agents'][_0x23710e['id']]});}else{return _0x126de5(_0x10d374[_0x6f1c('0x33')](0x1f4,_0x6f1c('0x43')));}});},'Agents':function(_0x5329cd){return new Promise(function(_0x555291,_0x19f8bf){var _0x410ab1=_[_0x6f1c('0x44')](_0x549430['agents']);_0x555291({'count':_0x410ab1[_0x6f1c('0x15')],'rows':_0x410ab1});});},'ChatQueues':function(_0x5db802){return new Promise(function(_0x289515,_0x345103){var _0x420fae=[];for(var _0x8e46d0 in _0x549430[_0x6f1c('0x45')]){if(_0x549430['chatQueues']['hasOwnProperty'](_0x8e46d0)){var _0x3e73cf=_0x549430[_0x6f1c('0x45')][_0x8e46d0];var _0x112827={'id':_0x3e73cf['id'],'available':_0x3e73cf['available'],'loggedIn':_0x3e73cf[_0x6f1c('0x46')],'name':_0x3e73cf[_0x6f1c('0x47')],'paused':_0x3e73cf[_0x6f1c('0x48')],'waiting':_0x3e73cf[_0x6f1c('0x49')]};_0x420fae[_0x6f1c('0x1d')](_0x112827);}}_0x289515({'count':_0x420fae['length'],'rows':_0x420fae});});},'MailQueues':function(_0x1e4d02){return new Promise(function(_0x21bdcb,_0x9825bd){var _0x9d105a=[];for(var _0x37bf78 in _0x549430[_0x6f1c('0x4a')]){if(_0x549430[_0x6f1c('0x4a')]['hasOwnProperty'](_0x37bf78)){var _0x591e33=_0x549430[_0x6f1c('0x4a')][_0x37bf78];var _0x4c72bc={'id':_0x591e33['id'],'available':_0x591e33[_0x6f1c('0x4b')],'loggedIn':_0x591e33['loggedIn'],'name':_0x591e33['name'],'paused':_0x591e33['paused'],'waiting':_0x591e33[_0x6f1c('0x49')]};_0x9d105a[_0x6f1c('0x1d')](_0x4c72bc);}}_0x21bdcb({'count':_0x9d105a[_0x6f1c('0x15')],'rows':_0x9d105a});});},'OpenchannelQueues':function(_0x4749de){return new Promise(function(_0x56ce00,_0x133baa){var _0x551a5f=[];for(var _0x1db865 in _0x549430['openchannelQueues']){if(_0x549430[_0x6f1c('0x4c')][_0x6f1c('0x3f')](_0x1db865)){var _0x3ab3e7=_0x549430['openchannelQueues'][_0x1db865];var _0x5da1c8={'id':_0x3ab3e7['id'],'available':_0x3ab3e7['available'],'loggedIn':_0x3ab3e7[_0x6f1c('0x46')],'name':_0x3ab3e7[_0x6f1c('0x47')],'paused':_0x3ab3e7[_0x6f1c('0x48')],'waiting':_0x3ab3e7[_0x6f1c('0x49')]};_0x551a5f[_0x6f1c('0x1d')](_0x5da1c8);}}_0x56ce00({'count':_0x551a5f[_0x6f1c('0x15')],'rows':_0x551a5f});});},'SmsQueues':function(_0x224e33){return new Promise(function(_0x575804,_0x52ee1f){var _0x279ef3=[];for(var _0xd8b19c in _0x549430['smsQueues']){if(_0x549430[_0x6f1c('0x4d')][_0x6f1c('0x3f')](_0xd8b19c)){var _0x73f6bd=_0x549430[_0x6f1c('0x4d')][_0xd8b19c];var _0x3d98fe={'id':_0x73f6bd['id'],'available':_0x73f6bd['available'],'loggedIn':_0x73f6bd[_0x6f1c('0x46')],'name':_0x73f6bd['name'],'paused':_0x73f6bd['paused'],'waiting':_0x73f6bd[_0x6f1c('0x49')]};_0x279ef3[_0x6f1c('0x1d')](_0x3d98fe);}}_0x575804({'count':_0x279ef3[_0x6f1c('0x15')],'rows':_0x279ef3});});},'FaxQueues':function(_0x35f4aa){return new Promise(function(_0x40d4a3,_0x55086d){var _0x1a550c=[];for(var _0xc071d1 in _0x549430[_0x6f1c('0x4e')]){if(_0x549430['faxQueues']['hasOwnProperty'](_0xc071d1)){var _0x244b42=_0x549430[_0x6f1c('0x4e')][_0xc071d1];var _0x27343a={'id':_0x244b42['id'],'available':_0x244b42[_0x6f1c('0x4b')],'loggedIn':_0x244b42[_0x6f1c('0x46')],'name':_0x244b42[_0x6f1c('0x47')],'paused':_0x244b42['paused'],'waiting':_0x244b42[_0x6f1c('0x49')]};_0x1a550c[_0x6f1c('0x1d')](_0x27343a);}}_0x40d4a3({'count':_0x1a550c[_0x6f1c('0x15')],'rows':_0x1a550c});});},'ChatQueuesWaitingInteractions':function(_0xed9fc3){return new Promise(function(_0x491a27,_0x1756ee){var _0x206265=_['values'](_0x549430['chatQueuesWaitingInteractions']);_0x491a27({'count':_0x206265['length'],'rows':_0x206265});});},'MailQueuesWaitingInteractions':function(_0x248d8a){return new Promise(function(_0x7afd5a,_0x235423){var _0x411c88=_[_0x6f1c('0x44')](_0x549430[_0x6f1c('0x4f')]);_0x7afd5a({'count':_0x411c88[_0x6f1c('0x15')],'rows':_0x411c88});});},'OpenchannelQueuesWaitingInteractions':function(_0x1dbf91){return new Promise(function(_0x150e73,_0x35bc8d){var _0x3aadbe=_[_0x6f1c('0x44')](_0x549430[_0x6f1c('0x50')]);_0x150e73({'count':_0x3aadbe[_0x6f1c('0x15')],'rows':_0x3aadbe});});},'SmsQueuesWaitingInteractions':function(_0x5e24ad){return new Promise(function(_0x177a7e,_0x48f8ba){var _0x5988be=_[_0x6f1c('0x44')](_0x549430[_0x6f1c('0x51')]);_0x177a7e({'count':_0x5988be['length'],'rows':_0x5988be});});},'FaxQueuesWaitingInteractions':function(_0x573d12){return new Promise(function(_0x5ee02a,_0xdaca90){var _0x504b4c=_[_0x6f1c('0x44')](_0x549430[_0x6f1c('0x52')]);_0x5ee02a({'count':_0x504b4c[_0x6f1c('0x15')],'rows':_0x504b4c});});}};var _0x3d2744=jayson[_0x6f1c('0x53')](_0x116ac4)[_0x6f1c('0x54')]();_0x3d2744['on'](_0x6f1c('0x33'),function(_0x12f24d){logger[_0x6f1c('0x33')](JSON[_0x6f1c('0x2e')](_0x12f24d));return _0x182c9d(_0x12f24d);});_0x3d2744[_0x6f1c('0x55')](0x232c,_0x6f1c('0x56'),function(){console[_0x6f1c('0x57')](_0x6f1c('0x58'),0x232c);return _0x404312(_0x6f1c('0x59')+0x232c);});});}; \ No newline at end of file +var _0x0c24=['%s:%s:%s','./interval','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','emit','end','QueueReport','update','UserId','catch','error','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','waiting','mailQueues','paused','openchannelQueues','smsQueues','name','faxQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','listen','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','uuid','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','format','IntervalId','isNil','Intervals','interval','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','TagId'];(function(_0x4b0a6b,_0x5f569e){var _0x2d2357=function(_0xb2e5f0){while(--_0xb2e5f0){_0x4b0a6b['push'](_0x4b0a6b['shift']());}};_0x2d2357(++_0x5f569e);}(_0x0c24,0x1dd));var _0x40c2=function(_0x227e24,_0x573dd6){_0x227e24=_0x227e24-0x0;var _0x2ccc99=_0x0c24[_0x227e24];return _0x2ccc99;};'use strict';var _=require(_0x40c2('0x0'));var util=require(_0x40c2('0x1'));var path=require(_0x40c2('0x2'));var fs=require('fs');var jayson=require(_0x40c2('0x3'));var BPromise=require('bluebird');var uuid=require(_0x40c2('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x40c2('0x5'))};var rpc={'openchannelQueueReport':require(_0x40c2('0x5')),'mailQueueReport':require(_0x40c2('0x6')),'chatQueueReport':require(_0x40c2('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x40c2('0x8'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x5501e0,_0x25e1ad,_0x1b1c9f){return util[_0x40c2('0x9')]('%s.%s.%s',_0x5501e0,_0x25e1ad||0x0,_0x1b1c9f||0x0);}function getIntervals(_0x3dc70a,_0x239938){var _0x2954de=[];if(!_['isNil'](_0x239938[_0x40c2('0xa')])&&!_[_0x40c2('0xb')](_0x3dc70a[_0x239938[_0x40c2('0xa')]])&&!_['isNil'](_0x3dc70a[_0x239938['IntervalId']]['Intervals'])){_0x2954de=_['map'](_0x3dc70a[_0x239938[_0x40c2('0xa')]][_0x40c2('0xc')],_0x40c2('0xd'));}else if(!_['isNil'](_0x239938[_0x40c2('0xd')])){_0x2954de=[_0x239938[_0x40c2('0xd')]];}return _0x2954de;}exports['listen']=function(_0x4eca48){_0x4eca48[_0x40c2('0xe')]={};return new BPromise(function(_0x5c7135,_0x185f42){var _0x26679b={'Start':function(_0x176475){var _0xdbdeaf=this;return new Promise(function(_0x50bd79,_0x1b5a34){if(_0x176475){try{var _0x39aab3=[];var _0x30cbfb=getId(_0x176475[_0x40c2('0xf')],_0x176475[_0x40c2('0x10')]?_0x176475[_0x40c2('0x10')]['id']:0x0,_0x176475[_0x40c2('0x11')]?_0x176475['interaction']['id']:0x0);if(_0x176475[_0x40c2('0x12')]&&_[_0x40c2('0x13')](_0x176475[_0x40c2('0x12')])&&_0x176475[_0x40c2('0x12')][_0x40c2('0x14')]){for(var _0xfe305c=0x0;_0xfe305c<_0x176475[_0x40c2('0x12')]['length'];_0xfe305c+=0x1){var _0x3d1c5b=_0x176475[_0x40c2('0x12')][_0xfe305c];if(fs[_0x40c2('0x15')](path[_0x40c2('0x16')](__dirname,_0x40c2('0x12'),_0x3d1c5b[_0x40c2('0x17')]+_0x40c2('0x18')))){var _0x5bd979=[];switch(_0x3d1c5b[_0x40c2('0x17')][_0x40c2('0x19')]()){case _0x40c2('0x1a'):var _0x38c21b=_0x3d1c5b[_0x40c2('0x1b')][_0x40c2('0x1c')](',');_0x5bd979[_0x40c2('0x1d')](_0x38c21b[0x0]);_0x5bd979[_0x40c2('0x1d')](_0x38c21b[_0x40c2('0x1e')](0x1,_0x38c21b[_0x40c2('0x14')])[_0x40c2('0x16')](','));break;case _0x40c2('0x1f'):var _0x33ab33=_0x3d1c5b[_0x40c2('0x1b')]['split'](',');_0x5bd979[_0x40c2('0x1d')](_0x33ab33[0x0]);_0x5bd979[_0x40c2('0x1d')](_0x33ab33[0x1]);_0x5bd979[_0x40c2('0x1d')](_0x33ab33[_0x40c2('0x1e')](0x2,_0x33ab33[_0x40c2('0x14')])[_0x40c2('0x16')](','));break;case'amazonlex':var _0x4ff7c7=_0x3d1c5b[_0x40c2('0x1b')][_0x40c2('0x1c')](',');_0x5bd979[_0x40c2('0x1d')](_0x4ff7c7[0x0]);_0x5bd979['push'](_0x4ff7c7[0x1]);_0x5bd979[_0x40c2('0x1d')](_0x4ff7c7[0x2]);_0x5bd979[_0x40c2('0x1d')](_0x4ff7c7[0x3]);_0x5bd979[_0x40c2('0x1d')](_0x4ff7c7[_0x40c2('0x1e')](0x4,_0x4ff7c7['length'])[_0x40c2('0x16')](','));break;case'message':_0x5bd979[_0x40c2('0x1d')](_0x3d1c5b[_0x40c2('0x1b')]);break;case'tag':_0x5bd979[_0x40c2('0x1d')](_0x3d1c5b[_0x40c2('0x20')]);_0x5bd979[_0x40c2('0x1d')](_0x3d1c5b[_0x40c2('0x1b')]);break;default:_0x5bd979=_[_0x40c2('0xb')](_0x3d1c5b[_0x40c2('0x1b')])?[]:_0x3d1c5b[_0x40c2('0x1b')]['split'](',');}var _0xcc2a1a={'id':util[_0x40c2('0x9')](_0x40c2('0x21'),_0x30cbfb,_0x3d1c5b['id'],_0x3d1c5b['app']),'condition':require(_0x40c2('0x22'))['condition'](_0x30cbfb,getIntervals(_0x4eca48['intervals'],_0x3d1c5b),_0x4eca48),'consequence':require(_0x40c2('0x23')+_0x3d1c5b[_0x40c2('0x17')])[_0x40c2('0x24')](_0x30cbfb,_0x5bd979,_0x4eca48,_0x176475),'p':_0x3d1c5b[_0x40c2('0x25')]||0x0};logger[_0x40c2('0x26')](_0x40c2('0x27'),_0xcc2a1a['id'],_0x40c2('0x28'),getIntervals(_0x4eca48[_0x40c2('0x29')],_0x3d1c5b)[_0x40c2('0x16')](_0x40c2('0x2a')));_0x39aab3[_0x40c2('0x1d')](_0xcc2a1a);}else{logger['error'](_0x40c2('0x2b'),path[_0x40c2('0x16')](__dirname,'applications',_0x3d1c5b[_0x40c2('0x17')]+_0x40c2('0x18')));}}_0x4eca48[_0x40c2('0xe')][_0x30cbfb]=new RuleEngine(_0x39aab3);_0x4eca48['rules'][_0x30cbfb][_0x40c2('0x2c')](_0x176475,function(_0x5c3126){logger[_0x40c2('0x26')](_0x40c2('0x2d'),JSON[_0x40c2('0x2e')](_0x5c3126['matchPath']));if(_0x4eca48[_0x40c2('0xe')][_0x30cbfb]){_0x4eca48[_0x40c2('0xe')][_0x30cbfb]['emit'](_0x40c2('0x2f'));}});return _0x50bd79({'code':0xc8,'message':_0x176475});}else{logger[_0x40c2('0x26')](_0x40c2('0x30'));return _0x50bd79({'code':0xc8,'message':_0x176475});}}catch(_0x4341b3){logger['error'](_0x4341b3[_0x40c2('0x31')]);return _0x1b5a34(_0xdbdeaf['error'](0x1f4,_0x4341b3));}}return _0x1b5a34(_0x40c2('0x32'));});},'AcceptMessage':function(_0x9a616e){var _0x5939eb=this;return new Promise(function(_0x1619cf,_0x4890cf){if(_0x9a616e['message']&&_0x9a616e[_0x40c2('0x10')]['id']){try{var _0x13d889=getId(_0x9a616e[_0x40c2('0xf')],_0x9a616e[_0x40c2('0x10')]?_0x9a616e[_0x40c2('0x10')]['id']:0x0,_0x9a616e['interaction']?_0x9a616e[_0x40c2('0x11')]['id']:0x0);if(_0x4eca48[_0x40c2('0xe')][_0x13d889]){_0x4eca48[_0x40c2('0xe')][_0x13d889][_0x40c2('0x33')](_0x40c2('0x34'));if(rpc[_0x9a616e[_0x40c2('0xf')]+_0x40c2('0x35')]){rpc[_0x9a616e[_0x40c2('0xf')]+_0x40c2('0x35')][_0x40c2('0x36')](_0x13d889,{'UserId':_0x9a616e['message'][_0x40c2('0x37')]})[_0x40c2('0x38')](function(_0x4186ad){logger[_0x40c2('0x39')](_0x40c2('0x3a'));});}}return _0x1619cf({'code':0xc8,'message':_0x9a616e});}catch(_0x576abb){logger[_0x40c2('0x39')](_0x576abb['stack']);return _0x4890cf(_0x5939eb['error'](0x1f4,_0x576abb));}}logger['error'](_0x40c2('0x3b'));return _0x4890cf(_0x5939eb[_0x40c2('0x39')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x1023cd){var _0x19ec8f=this;return new Promise(function(_0x3dfb0e,_0x4097d8){if(_0x1023cd[_0x40c2('0x3c')]&&_0x1023cd[_0x40c2('0x3c')]['id']){try{if(_0x4eca48[_0x40c2('0x3d')][_0x1023cd[_0x40c2('0x3c')]['id']]){_0x4eca48[_0x40c2('0x3d')][_0x1023cd[_0x40c2('0x3c')]['id']]['busy']=![];_0x4eca48[_0x40c2('0x3d')][_0x1023cd[_0x40c2('0x3c')]['id']][_0x40c2('0x3e')]=undefined;}return _0x3dfb0e({'code':0xc8,'message':_0x1023cd});}catch(_0x2afc88){logger[_0x40c2('0x39')](_0x2afc88[_0x40c2('0x31')]);return _0x4097d8(_0x19ec8f[_0x40c2('0x39')](0x1f4,_0x2afc88));}}logger['error'](_0x40c2('0x3b'));return _0x4097d8(_0x19ec8f[_0x40c2('0x39')](0x1f4,_0x40c2('0x3b')));});},'AbandonInteraction':function(_0x1b920e){var _0x595712=this;return new Promise(function(_0x51304c,_0x596471){if(_0x1b920e[_0x40c2('0xf')]&&_0x1b920e[_0x40c2('0x11')]&&_0x1b920e[_0x40c2('0x11')]['id']){try{var _0x81cae6=getId(_0x1b920e['channel'],_0x1b920e['message']?_0x1b920e[_0x40c2('0x10')]['id']:0x0,_0x1b920e[_0x40c2('0x11')]?_0x1b920e[_0x40c2('0x11')]['id']:0x0);if(_0x4eca48[_0x40c2('0xe')][_0x81cae6]){_0x4eca48[_0x40c2('0xe')][_0x81cae6][_0x40c2('0x33')](_0x40c2('0x34'));}return _0x51304c({'code':0xc8,'message':_0x1b920e});}catch(_0x5be8ca){logger[_0x40c2('0x39')](_0x5be8ca['stack']);return _0x596471(_0x595712[_0x40c2('0x39')](0x1f4,_0x5be8ca));}}logger[_0x40c2('0x39')](_0x40c2('0x3b'));return _0x596471(_0x595712[_0x40c2('0x39')](0x1f4,_0x40c2('0x3b')));});},'AgentCapacity':function(_0x332ce2){var _0x45c7a4=this;return new Promise(function(_0x54cfb8,_0x3ae840){if(_0x4eca48['agents'][_0x40c2('0x3f')](_0x332ce2['id'])){for(var _0x4bdb14 in _0x332ce2[_0x40c2('0x40')]){if(_0x332ce2[_0x40c2('0x40')][_0x40c2('0x3f')](_0x4bdb14)){if(_0x4eca48[_0x40c2('0x3d')][_0x332ce2['id']][_0x40c2('0x3f')](_0x4bdb14+'CurrentCapacity')){_0x4eca48[_0x40c2('0x3d')][_0x332ce2['id']][_0x4bdb14+_0x40c2('0x41')]=parseInt(_0x332ce2[_0x40c2('0x40')][_0x4bdb14],0xa);}}}_0x4eca48['agents'][_0x332ce2['id']]['updateRealtime']();return _0x54cfb8({'code':0xc8,'message':_0x4eca48['agents'][_0x332ce2['id']]});}else{return _0x3ae840(_0x45c7a4['error'](0x1f4,_0x40c2('0x42')));}});},'Agents':function(_0x4cb9bb){return new Promise(function(_0x4f2f03,_0x114f23){var _0x5a875c=_[_0x40c2('0x43')](_0x4eca48['agents']);_0x4f2f03({'count':_0x5a875c['length'],'rows':_0x5a875c});});},'ChatQueues':function(_0x3b35f9){return new Promise(function(_0x54e20a,_0x17e3fb){var _0x11bc69=[];for(var _0x20f07e in _0x4eca48['chatQueues']){if(_0x4eca48[_0x40c2('0x44')][_0x40c2('0x3f')](_0x20f07e)){var _0x98ee0d=_0x4eca48['chatQueues'][_0x20f07e];var _0x4b52a3={'id':_0x98ee0d['id'],'available':_0x98ee0d[_0x40c2('0x45')],'loggedIn':_0x98ee0d[_0x40c2('0x46')],'name':_0x98ee0d['name'],'paused':_0x98ee0d['paused'],'waiting':_0x98ee0d[_0x40c2('0x47')]};_0x11bc69[_0x40c2('0x1d')](_0x4b52a3);}}_0x54e20a({'count':_0x11bc69[_0x40c2('0x14')],'rows':_0x11bc69});});},'MailQueues':function(_0x2af54e){return new Promise(function(_0x34b2d9,_0x5ea175){var _0x3d3c5f=[];for(var _0x5b4403 in _0x4eca48[_0x40c2('0x48')]){if(_0x4eca48[_0x40c2('0x48')]['hasOwnProperty'](_0x5b4403)){var _0x543a58=_0x4eca48['mailQueues'][_0x5b4403];var _0x45071d={'id':_0x543a58['id'],'available':_0x543a58[_0x40c2('0x45')],'loggedIn':_0x543a58['loggedIn'],'name':_0x543a58['name'],'paused':_0x543a58[_0x40c2('0x49')],'waiting':_0x543a58[_0x40c2('0x47')]};_0x3d3c5f[_0x40c2('0x1d')](_0x45071d);}}_0x34b2d9({'count':_0x3d3c5f[_0x40c2('0x14')],'rows':_0x3d3c5f});});},'OpenchannelQueues':function(_0x153259){return new Promise(function(_0x2606d9,_0x3d35e2){var _0x395c86=[];for(var _0x29ae05 in _0x4eca48[_0x40c2('0x4a')]){if(_0x4eca48[_0x40c2('0x4a')][_0x40c2('0x3f')](_0x29ae05)){var _0x2f24cf=_0x4eca48['openchannelQueues'][_0x29ae05];var _0x3d81f2={'id':_0x2f24cf['id'],'available':_0x2f24cf[_0x40c2('0x45')],'loggedIn':_0x2f24cf[_0x40c2('0x46')],'name':_0x2f24cf['name'],'paused':_0x2f24cf[_0x40c2('0x49')],'waiting':_0x2f24cf[_0x40c2('0x47')]};_0x395c86['push'](_0x3d81f2);}}_0x2606d9({'count':_0x395c86[_0x40c2('0x14')],'rows':_0x395c86});});},'SmsQueues':function(_0x28b712){return new Promise(function(_0x2055d6,_0x4f8587){var _0x1fa97a=[];for(var _0x93ae41 in _0x4eca48['smsQueues']){if(_0x4eca48[_0x40c2('0x4b')]['hasOwnProperty'](_0x93ae41)){var _0x5ed9a7=_0x4eca48[_0x40c2('0x4b')][_0x93ae41];var _0x211e87={'id':_0x5ed9a7['id'],'available':_0x5ed9a7[_0x40c2('0x45')],'loggedIn':_0x5ed9a7['loggedIn'],'name':_0x5ed9a7[_0x40c2('0x4c')],'paused':_0x5ed9a7['paused'],'waiting':_0x5ed9a7[_0x40c2('0x47')]};_0x1fa97a[_0x40c2('0x1d')](_0x211e87);}}_0x2055d6({'count':_0x1fa97a[_0x40c2('0x14')],'rows':_0x1fa97a});});},'FaxQueues':function(_0x44a87e){return new Promise(function(_0x45c227,_0x2770ca){var _0x11aac5=[];for(var _0x15d031 in _0x4eca48['faxQueues']){if(_0x4eca48[_0x40c2('0x4d')][_0x40c2('0x3f')](_0x15d031)){var _0x543e15=_0x4eca48[_0x40c2('0x4d')][_0x15d031];var _0x3254f7={'id':_0x543e15['id'],'available':_0x543e15[_0x40c2('0x45')],'loggedIn':_0x543e15[_0x40c2('0x46')],'name':_0x543e15[_0x40c2('0x4c')],'paused':_0x543e15[_0x40c2('0x49')],'waiting':_0x543e15[_0x40c2('0x47')]};_0x11aac5[_0x40c2('0x1d')](_0x3254f7);}}_0x45c227({'count':_0x11aac5[_0x40c2('0x14')],'rows':_0x11aac5});});},'ChatQueuesWaitingInteractions':function(_0xc2fe78){return new Promise(function(_0x38c884,_0x4b258a){var _0x45a151=_[_0x40c2('0x43')](_0x4eca48['chatQueuesWaitingInteractions']);_0x38c884({'count':_0x45a151[_0x40c2('0x14')],'rows':_0x45a151});});},'MailQueuesWaitingInteractions':function(_0x288053){return new Promise(function(_0x3dbf0a,_0x5a653d){var _0x370a97=_['values'](_0x4eca48[_0x40c2('0x4e')]);_0x3dbf0a({'count':_0x370a97[_0x40c2('0x14')],'rows':_0x370a97});});},'OpenchannelQueuesWaitingInteractions':function(_0x445a4b){return new Promise(function(_0x4c2e92,_0x4f1281){var _0x16cc02=_['values'](_0x4eca48['openchannelQueuesWaitingInteractions']);_0x4c2e92({'count':_0x16cc02['length'],'rows':_0x16cc02});});},'SmsQueuesWaitingInteractions':function(_0x21d9af){return new Promise(function(_0x3b6481,_0x34dd28){var _0x5077c3=_[_0x40c2('0x43')](_0x4eca48[_0x40c2('0x4f')]);_0x3b6481({'count':_0x5077c3[_0x40c2('0x14')],'rows':_0x5077c3});});},'FaxQueuesWaitingInteractions':function(_0x1e44e5){return new Promise(function(_0x5a06ea,_0x5e451b){var _0x57993e=_[_0x40c2('0x43')](_0x4eca48[_0x40c2('0x50')]);_0x5a06ea({'count':_0x57993e[_0x40c2('0x14')],'rows':_0x57993e});});}};var _0x7dce40=jayson[_0x40c2('0x51')](_0x26679b)['http']();_0x7dce40['on'](_0x40c2('0x39'),function(_0x1aefb3){logger[_0x40c2('0x39')](JSON['stringify'](_0x1aefb3));return _0x185f42(_0x1aefb3);});_0x7dce40[_0x40c2('0x52')](0x232c,'127.0.0.1',function(){console['log'](_0x40c2('0x53'),0x232c);return _0x5c7135(_0x40c2('0x54')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 4961a28..24a4f55 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 _0xda60=['[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','then','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info'];(function(_0x401c30,_0x3097a2){var _0x1b3fd0=function(_0x117d74){while(--_0x117d74){_0x401c30['push'](_0x401c30['shift']());}};_0x1b3fd0(++_0x3097a2);}(_0xda60,0x106));var _0x0da6=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0xda60[_0x565fed];return _0x3e018f;};'use strict';var util=require(_0x0da6('0x0'));var BPromise=require(_0x0da6('0x1'));var jayson=require(_0x0da6('0x2'));var _=require(_0x0da6('0x3'));var logger=require(_0x0da6('0x4'))(_0x0da6('0x5'));var client=jayson[_0x0da6('0x6')][_0x0da6('0x7')]({'port':0x232a});function request(_0xa4dae9,_0x5629d3){return new BPromise(function(_0x59b6b4,_0x36a7b1){return client['request'](_0xa4dae9,_0x5629d3)[_0x0da6('0x8')](function(_0x45a99f){if(_0x45a99f['error']){return _0x36a7b1(_0x45a99f['error'][_0x0da6('0x9')]);}else{return _0x59b6b4(_0x45a99f[_0x0da6('0xa')]);}})[_0x0da6('0xb')](function(_0x2e87e0){return _0x36a7b1(_0x2e87e0);});});}exports[_0x0da6('0xc')]=function(_0x461baf,_0x50fc64,_0x33c61b){return function(_0x1da6ea){if(_0x33c61b['rules']&&!_0x33c61b[_0x0da6('0xd')][_0x461baf]){logger['info'](_0x0da6('0xe'),_0x461baf);return _0x1da6ea[_0x0da6('0xf')]();}var _0x651430=[];for(var _0x29cd26=0x0;_0x29cd26<_0x50fc64[_0x0da6('0x10')];_0x29cd26+=0x1){_0x651430['push'](request(_0x0da6('0x11'),{'command':util[_0x0da6('0x12')](_0x0da6('0x13'),_0x50fc64[_0x29cd26])})[_0x0da6('0x8')](function(_0x3a8a1e){return _0x3a8a1e&&_0x3a8a1e['message']&&_0x3a8a1e[_0x0da6('0x9')][_0x0da6('0x14')](_0x0da6('0x15'))>=0x0?!![]:![];})['catch'](function(_0x1dd844){logger['error'](_0x0da6('0x16'),_0x461baf,_0x50fc64[_0x29cd26]);}));}BPromise[_0x0da6('0x17')](_0x651430)['then'](function(_0x31d738){var _0x46d397=_[_0x0da6('0x18')](_0x31d738);logger[_0x0da6('0x19')](_0x0da6('0x1a'),_0x461baf,_0x50fc64['join'](_0x0da6('0x1b')),_0x46d397);_0x1da6ea[_0x0da6('0x1c')](_0x46d397);})[_0x0da6('0xb')](function(_0x48160a){console[_0x0da6('0x1d')](_0x48160a);logger['error'](_0x0da6('0x1a'),_0x461baf,_0x50fc64[_0x0da6('0x1e')]('\x20|\x20'),_0x48160a[_0x0da6('0x1f')]);_0x1da6ea['stop']();});};}; \ No newline at end of file +var _0xe593=['http','request','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash'];(function(_0x30e070,_0x215962){var _0x3099f3=function(_0x47f607){while(--_0x47f607){_0x30e070['push'](_0x30e070['shift']());}};_0x3099f3(++_0x215962);}(_0xe593,0x11c));var _0x3e59=function(_0x3bef0c,_0x5b0eaa){_0x3bef0c=_0x3bef0c-0x0;var _0x2edd54=_0xe593[_0x3bef0c];return _0x2edd54;};'use strict';var util=require(_0x3e59('0x0'));var BPromise=require(_0x3e59('0x1'));var jayson=require(_0x3e59('0x2'));var _=require(_0x3e59('0x3'));var logger=require('../../../config/logger')('routing');var client=jayson['client'][_0x3e59('0x4')]({'port':0x232a});function request(_0x178692,_0x3ebf0f){return new BPromise(function(_0x59704d,_0x2a1000){return client[_0x3e59('0x5')](_0x178692,_0x3ebf0f)['then'](function(_0x47378a){if(_0x47378a[_0x3e59('0x6')]){return _0x2a1000(_0x47378a[_0x3e59('0x6')][_0x3e59('0x7')]);}else{return _0x59704d(_0x47378a[_0x3e59('0x8')]);}})[_0x3e59('0x9')](function(_0x478317){return _0x2a1000(_0x478317);});});}exports[_0x3e59('0xa')]=function(_0x3e517d,_0x359854,_0x4141f0){return function(_0x48c9f8){if(_0x4141f0[_0x3e59('0xb')]&&!_0x4141f0['rules'][_0x3e517d]){logger[_0x3e59('0xc')](_0x3e59('0xd'),_0x3e517d);return _0x48c9f8[_0x3e59('0xe')]();}var _0x1ff0d1=[];for(var _0x3c8fac=0x0;_0x3c8fac<_0x359854[_0x3e59('0xf')];_0x3c8fac+=0x1){_0x1ff0d1[_0x3e59('0x10')](request(_0x3e59('0x11'),{'command':util[_0x3e59('0x12')](_0x3e59('0x13'),_0x359854[_0x3c8fac])})[_0x3e59('0x14')](function(_0x3aeafa){return _0x3aeafa&&_0x3aeafa[_0x3e59('0x7')]&&_0x3aeafa[_0x3e59('0x7')][_0x3e59('0x15')](_0x3e59('0x16'))>=0x0?!![]:![];})[_0x3e59('0x9')](function(_0x279529){logger[_0x3e59('0x6')](_0x3e59('0x17'),_0x3e517d,_0x359854[_0x3c8fac]);}));}BPromise[_0x3e59('0x18')](_0x1ff0d1)[_0x3e59('0x14')](function(_0x3f0d38){var _0x4b879d=_[_0x3e59('0x19')](_0x3f0d38);logger[_0x3e59('0xc')](_0x3e59('0x1a'),_0x3e517d,_0x359854[_0x3e59('0x1b')](_0x3e59('0x1c')),_0x4b879d);_0x48c9f8[_0x3e59('0x1d')](_0x4b879d);})[_0x3e59('0x9')](function(_0x4d5dc1){console[_0x3e59('0x1e')](_0x4d5dc1);logger[_0x3e59('0x6')](_0x3e59('0x1a'),_0x3e517d,_0x359854[_0x3e59('0x1b')]('\x20|\x20'),_0x4d5dc1[_0x3e59('0x1f')]);_0x48c9f8[_0x3e59('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 77bc8bb..1cd8a73 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 _0x6a58=['lastevent','called','error','stack','isNil','agentringnoanswer','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','agentconnectAt','connect','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','agentcompleteAt','diffTime','complete','transfereruniqueid','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','hangup','lodash','util','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalledAt','now'];(function(_0xd8049b,_0xdfe3c4){var _0xbaf036=function(_0x3f1077){while(--_0x3f1077){_0xd8049b['push'](_0xd8049b['shift']());}};_0xbaf036(++_0xdfe3c4);}(_0x6a58,0x120));var _0x86a5=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x6a58[_0x511bd1];return _0x4c48ec;};'use strict';var _=require(_0x86a5('0x0'));var util=require(_0x86a5('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x2c02b9,_0x561822){utils[_0x86a5('0x2')](util['format'](_0x86a5('0x3'),_0x2c02b9[_0x86a5('0x4')],_0x2c02b9[_0x86a5('0x5')],_0x2c02b9[_0x86a5('0x6')],_0x2c02b9[_0x86a5('0x7')],_0x2c02b9['interface'],_0x2c02b9[_0x86a5('0x8')],_0x2c02b9[_0x86a5('0x9')],_0x2c02b9['lastevent']));if(_0x2c02b9[_0x86a5('0x6')]){utils[_0x86a5('0xa')](_0x2c02b9[_0x86a5('0x6')])[_0x86a5('0xb')](function(_0x2b257a){if(_0x2b257a){_0x2c02b9[_0x86a5('0xc')]=_0x2b257a[_0x86a5('0xc')];_0x2c02b9[_0x86a5('0xd')]=_0x2c02b9[_0x86a5('0xe')]?_0x2b257a[_0x86a5('0xf')]:![];_0x2c02b9['acwtime']=_0x2c02b9['agentacw']?_0x2b257a[_0x86a5('0x10')]:0x0;}utils['request'](_0x86a5('0x11'),_0x2c02b9);});}else{utils[_0x86a5('0x12')]('CreateVoiceAgentReport',_0x2c02b9);}if(_0x561822){delete transfers[_0x2c02b9[_0x86a5('0x4')]];}else{delete agents[_0x2c02b9[_0x86a5('0x13')]];}}exports['agentcalled']=function(_0x14b1c0){try{agents[_0x14b1c0[_0x86a5('0x13')]]=_0x14b1c0;agents[_0x14b1c0['destuniqueid']][_0x86a5('0x14')]=utils[_0x86a5('0x15')]();agents[_0x14b1c0[_0x86a5('0x13')]][_0x86a5('0x16')]=_0x86a5('0x17');agents[_0x14b1c0['destuniqueid']]['connectedlinenum']=null;agents[_0x14b1c0[_0x86a5('0x13')]]['connectedlinename']=null;}catch(_0x61d809){utils[_0x86a5('0x18')](_0x61d809[_0x86a5('0x19')]);}};exports['agentringnoanswer']=function(_0x497fce){try{if(!_[_0x86a5('0x1a')](agents[_0x497fce[_0x86a5('0x13')]])){agents[_0x497fce[_0x86a5('0x13')]][_0x86a5('0x1b')]=!![];agents[_0x497fce[_0x86a5('0x13')]]['agentringnoanswerAt']=utils[_0x86a5('0x15')]();agents[_0x497fce['destuniqueid']][_0x86a5('0x16')]=_0x86a5('0x1c');agents[_0x497fce[_0x86a5('0x13')]][_0x86a5('0x1d')]=_0x86a5('0x1c');agents[_0x497fce[_0x86a5('0x13')]][_0x86a5('0x1e')]=_0x497fce[_0x86a5('0x1f')]?parseInt(_0x497fce['ringtime'])/0x3e8:0x0;agents[_0x497fce['destuniqueid']][_0x86a5('0x20')]=0x0;writeDB(agents[_0x497fce[_0x86a5('0x13')]]);}}catch(_0x54ffc0){utils['error'](_0x54ffc0['stack']);}};exports[_0x86a5('0x21')]=function(_0x2960f7){try{_[_0x86a5('0x22')](agents,function(_0x512df9,_0x5bd200){if(_0x512df9[_0x86a5('0x4')]==_0x2960f7[_0x86a5('0x4')]){_0x512df9[_0x86a5('0x1b')]=!![];_0x512df9['agentringnoanswerAt']=utils[_0x86a5('0x15')]();_0x512df9['lastevent']=_0x86a5('0x23');_0x512df9['reason']=_0x86a5('0x23');_0x512df9[_0x86a5('0x1e')]=_0x2960f7[_0x86a5('0x1e')];_0x512df9[_0x86a5('0x20')]=0x0;writeDB(_0x512df9);}});}catch(_0x3af4a5){utils[_0x86a5('0x18')](_0x3af4a5['stack']);}};exports['agentconnect']=function(_0xef1c69){try{if(agents[_0xef1c69[_0x86a5('0x13')]]){agents[_0xef1c69[_0x86a5('0x13')]][_0x86a5('0x24')]=utils[_0x86a5('0x15')]();agents[_0xef1c69[_0x86a5('0x13')]][_0x86a5('0x9')]=_0xef1c69['connectedlinenum'];agents[_0xef1c69[_0x86a5('0x13')]]['connectedlinename']=_0xef1c69['connectedlinename'];agents[_0xef1c69[_0x86a5('0x13')]]['holdtime']=_0xef1c69[_0x86a5('0x1f')];agents[_0xef1c69[_0x86a5('0x13')]][_0x86a5('0x16')]=_0x86a5('0x25');_[_0x86a5('0x22')](agents,function(_0x3fe03e,_0x20a77b){if(_0x3fe03e[_0x86a5('0x13')]!=_0xef1c69[_0x86a5('0x13')]&&_0x3fe03e[_0x86a5('0x4')]==_0xef1c69[_0x86a5('0x4')]){_0x3fe03e[_0x86a5('0x20')]=0x0;_0x3fe03e[_0x86a5('0x1e')]=_0xef1c69[_0x86a5('0x1f')];_0x3fe03e['agentringnoanswer']=!![];_0x3fe03e[_0x86a5('0x26')]=utils[_0x86a5('0x15')]();_0x3fe03e[_0x86a5('0x16')]=_0x86a5('0x27');_0x3fe03e[_0x86a5('0x1d')]=_0x86a5('0x27');_0x3fe03e[_0x86a5('0x28')]=_0xef1c69['destuniqueid'];_0x3fe03e['answeredelsewheremembername']=_0xef1c69[_0x86a5('0x7')];writeDB(_0x3fe03e);}});}}catch(_0x17312d){utils[_0x86a5('0x18')](_0x17312d[_0x86a5('0x19')]);}};exports[_0x86a5('0xe')]=function(_0x11ef52){try{if(!_['isNil'](agents[_0x11ef52[_0x86a5('0x13')]])){agents[_0x11ef52[_0x86a5('0x13')]]['agentcomplete']=!![];agents[_0x11ef52[_0x86a5('0x13')]][_0x86a5('0x29')]=utils['now']();agents[_0x11ef52['destuniqueid']][_0x86a5('0x20')]=utils[_0x86a5('0x2a')](agents[_0x11ef52[_0x86a5('0x13')]][_0x86a5('0x29')],agents[_0x11ef52['destuniqueid']][_0x86a5('0x24')]);agents[_0x11ef52[_0x86a5('0x13')]][_0x86a5('0x1d')]=_0x11ef52[_0x86a5('0x1d')];agents[_0x11ef52[_0x86a5('0x13')]]['lastevent']=_0x86a5('0x2b');writeDB(agents[_0x11ef52[_0x86a5('0x13')]]);}}catch(_0x46fb24){utils['error'](_0x46fb24[_0x86a5('0x19')]);}};exports['blindtransfer']=function(_0x4c84a0){try{if(!_['isNil'](agents[_0x4c84a0[_0x86a5('0x2c')]])){agents[_0x4c84a0[_0x86a5('0x2c')]]['transfer']=!![];agents[_0x4c84a0[_0x86a5('0x2c')]][_0x86a5('0x2d')]='blind';agents[_0x4c84a0[_0x86a5('0x2c')]][_0x86a5('0x2e')]=_0x4c84a0[_0x86a5('0x2f')];agents[_0x4c84a0[_0x86a5('0x2c')]][_0x86a5('0x30')]=agents[_0x4c84a0[_0x86a5('0x2c')]][_0x86a5('0x4')];}}catch(_0x4d4cb3){utils[_0x86a5('0x18')](_0x4d4cb3[_0x86a5('0x19')]);}};exports[_0x86a5('0x31')]=function(_0x2180d3){try{if(_0x2180d3[_0x86a5('0x32')]==_0x2180d3['origtransfererlinkedid']){if(!_[_0x86a5('0x1a')](agents[_0x2180d3['secondtransfereruniqueid']])){agents[_0x2180d3[_0x86a5('0x33')]][_0x86a5('0x34')]=!![];agents[_0x2180d3[_0x86a5('0x33')]][_0x86a5('0x2d')]=_0x86a5('0x35');agents[_0x2180d3['secondtransfereruniqueid']][_0x86a5('0x2e')]=_0x2180d3[_0x86a5('0x36')];agents[_0x2180d3['secondtransfereruniqueid']][_0x86a5('0x30')]=_0x2180d3[_0x86a5('0x32')];}if(_0x2180d3[_0x86a5('0x37')]&&agents[_0x2180d3[_0x86a5('0x37')]]){agents[_0x2180d3[_0x86a5('0x37')]][_0x86a5('0x38')]=0x1;transfers[_0x2180d3[_0x86a5('0x37')]]=_[_0x86a5('0x39')](agents[_0x2180d3[_0x86a5('0x37')]]);transfers[_0x2180d3[_0x86a5('0x37')]][_0x86a5('0x8')]=agents[_0x2180d3['secondtransfereruniqueid']]['calleridnum'];transfers[_0x2180d3['transfereeuniqueid']][_0x86a5('0x3a')]=agents[_0x2180d3[_0x86a5('0x33')]][_0x86a5('0x3a')];transfers[_0x2180d3[_0x86a5('0x37')]][_0x86a5('0x14')]=utils[_0x86a5('0x15')]();transfers[_0x2180d3['transfereeuniqueid']][_0x86a5('0x24')]=utils[_0x86a5('0x15')]();transfers[_0x2180d3['transfereeuniqueid']][_0x86a5('0x1e')]=0x0;transfers[_0x2180d3[_0x86a5('0x37')]][_0x86a5('0x38')]=0x2;}}else if(_0x2180d3[_0x86a5('0x33')]==_0x2180d3[_0x86a5('0x3b')]){if(!_[_0x86a5('0x1a')](agents[_0x2180d3['origtransfereruniqueid']])){agents[_0x2180d3[_0x86a5('0x32')]][_0x86a5('0x34')]=!![];agents[_0x2180d3[_0x86a5('0x32')]][_0x86a5('0x2d')]=_0x86a5('0x35');agents[_0x2180d3[_0x86a5('0x32')]][_0x86a5('0x2e')]=_0x2180d3['secondtransfererexten'];agents[_0x2180d3['origtransfereruniqueid']][_0x86a5('0x30')]=_0x2180d3['secondtransfereruniqueid'];}if(_0x2180d3['transfertargetuniqueid']&&agents[_0x2180d3[_0x86a5('0x3c')]]){agents[_0x2180d3[_0x86a5('0x3c')]][_0x86a5('0x38')]=0x1;transfers[_0x2180d3[_0x86a5('0x3c')]]=_[_0x86a5('0x39')](agents[_0x2180d3['transfertargetuniqueid']]);transfers[_0x2180d3['transfertargetuniqueid']][_0x86a5('0x8')]=agents[_0x2180d3[_0x86a5('0x32')]][_0x86a5('0x8')];transfers[_0x2180d3[_0x86a5('0x3c')]]['calleridname']=agents[_0x2180d3[_0x86a5('0x32')]][_0x86a5('0x3a')];transfers[_0x2180d3[_0x86a5('0x3c')]][_0x86a5('0x14')]=utils[_0x86a5('0x15')]();transfers[_0x2180d3[_0x86a5('0x3c')]][_0x86a5('0x24')]=utils[_0x86a5('0x15')]();transfers[_0x2180d3['transfertargetuniqueid']][_0x86a5('0x1e')]=0x0;transfers[_0x2180d3[_0x86a5('0x3c')]][_0x86a5('0x38')]=0x2;}}}catch(_0x3e0ff9){utils[_0x86a5('0x18')](_0x3e0ff9[_0x86a5('0x19')]);}};exports[_0x86a5('0x3d')]=function(_0x35e097){try{if(transfers[_0x35e097[_0x86a5('0x4')]]){transfers[_0x35e097['uniqueid']]['agentcomplete']=!![];transfers[_0x35e097[_0x86a5('0x4')]][_0x86a5('0x29')]=utils[_0x86a5('0x15')]();transfers[_0x35e097[_0x86a5('0x4')]][_0x86a5('0x20')]=utils[_0x86a5('0x2a')](transfers[_0x35e097[_0x86a5('0x4')]][_0x86a5('0x29')],transfers[_0x35e097[_0x86a5('0x4')]][_0x86a5('0x24')]);transfers[_0x35e097['uniqueid']][_0x86a5('0x1d')]='agent';transfers[_0x35e097[_0x86a5('0x4')]][_0x86a5('0x16')]=_0x86a5('0x2b');writeDB(transfers[_0x35e097['uniqueid']],!![]);}if(agents[_0x35e097[_0x86a5('0x4')]]&&agents[_0x35e097['uniqueid']][_0x86a5('0x24')]){agents[_0x35e097[_0x86a5('0x4')]][_0x86a5('0xe')]=!![];agents[_0x35e097[_0x86a5('0x4')]]['agentcompleteAt']=utils[_0x86a5('0x15')]();agents[_0x35e097['uniqueid']][_0x86a5('0x20')]=utils[_0x86a5('0x2a')](agents[_0x35e097[_0x86a5('0x4')]]['agentcompleteAt'],agents[_0x35e097['uniqueid']][_0x86a5('0x24')]);agents[_0x35e097['uniqueid']][_0x86a5('0x1d')]=agents[_0x35e097[_0x86a5('0x4')]][_0x86a5('0x34')]?_0x86a5('0x34'):'agent';agents[_0x35e097[_0x86a5('0x4')]][_0x86a5('0x16')]='complete';writeDB(agents[_0x35e097[_0x86a5('0x4')]]);}}catch(_0x8475a3){utils[_0x86a5('0x18')](_0x8475a3[_0x86a5('0x19')]);}}; \ No newline at end of file +var _0x9dfc=['lodash','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinenum','connectedlinename','error','stack','agentringnoanswer','isNil','timeout','reason','holdtime','ringtime','talktime','forIn','agentringnoanswerAt','abandoned','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfertype','transferexten','extension','transferuniqueid','origtransfereruniqueid','secondtransfereruniqueid','transfer','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','agent'];(function(_0x280931,_0xe3c14a){var _0x18dfba=function(_0x58e8a3){while(--_0x58e8a3){_0x280931['push'](_0x280931['shift']());}};_0x18dfba(++_0xe3c14a);}(_0x9dfc,0x140));var _0xc9df=function(_0x4ba13e,_0x550592){_0x4ba13e=_0x4ba13e-0x0;var _0x44c85d=_0x9dfc[_0x4ba13e];return _0x44c85d;};'use strict';var _=require(_0xc9df('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x5dec06,_0x33fa36){utils[_0xc9df('0x1')](util[_0xc9df('0x2')](_0xc9df('0x3'),_0x5dec06[_0xc9df('0x4')],_0x5dec06[_0xc9df('0x5')],_0x5dec06[_0xc9df('0x6')],_0x5dec06[_0xc9df('0x7')],_0x5dec06[_0xc9df('0x8')],_0x5dec06[_0xc9df('0x9')],_0x5dec06['connectedlinenum'],_0x5dec06[_0xc9df('0xa')]));if(_0x5dec06[_0xc9df('0x6')]){utils[_0xc9df('0xb')](_0x5dec06[_0xc9df('0x6')])[_0xc9df('0xc')](function(_0x59ce91){if(_0x59ce91){_0x5dec06[_0xc9df('0xd')]=_0x59ce91['type'];_0x5dec06[_0xc9df('0xe')]=_0x5dec06[_0xc9df('0xf')]?_0x59ce91['acw']:![];_0x5dec06[_0xc9df('0x10')]=_0x5dec06[_0xc9df('0xe')]?_0x59ce91['acwTimeout']:0x0;}utils[_0xc9df('0x11')](_0xc9df('0x12'),_0x5dec06);});}else{utils[_0xc9df('0x11')](_0xc9df('0x12'),_0x5dec06);}if(_0x33fa36){delete transfers[_0x5dec06[_0xc9df('0x4')]];}else{delete agents[_0x5dec06[_0xc9df('0x13')]];}}exports[_0xc9df('0x14')]=function(_0x2b56bb){try{agents[_0x2b56bb['destuniqueid']]=_0x2b56bb;agents[_0x2b56bb[_0xc9df('0x13')]][_0xc9df('0x15')]=utils[_0xc9df('0x16')]();agents[_0x2b56bb[_0xc9df('0x13')]]['lastevent']=_0xc9df('0x17');agents[_0x2b56bb[_0xc9df('0x13')]][_0xc9df('0x18')]=null;agents[_0x2b56bb[_0xc9df('0x13')]][_0xc9df('0x19')]=null;}catch(_0x49715b){utils[_0xc9df('0x1a')](_0x49715b[_0xc9df('0x1b')]);}};exports[_0xc9df('0x1c')]=function(_0x472c4b){try{if(!_[_0xc9df('0x1d')](agents[_0x472c4b['destuniqueid']])){agents[_0x472c4b[_0xc9df('0x13')]][_0xc9df('0x1c')]=!![];agents[_0x472c4b[_0xc9df('0x13')]]['agentringnoanswerAt']=utils[_0xc9df('0x16')]();agents[_0x472c4b[_0xc9df('0x13')]][_0xc9df('0xa')]=_0xc9df('0x1e');agents[_0x472c4b[_0xc9df('0x13')]][_0xc9df('0x1f')]='timeout';agents[_0x472c4b[_0xc9df('0x13')]][_0xc9df('0x20')]=_0x472c4b[_0xc9df('0x21')]?parseInt(_0x472c4b[_0xc9df('0x21')])/0x3e8:0x0;agents[_0x472c4b[_0xc9df('0x13')]][_0xc9df('0x22')]=0x0;writeDB(agents[_0x472c4b['destuniqueid']]);}}catch(_0x2acb81){utils[_0xc9df('0x1a')](_0x2acb81[_0xc9df('0x1b')]);}};exports['queuecallerabandon']=function(_0x957ec6){try{_[_0xc9df('0x23')](agents,function(_0x574474,_0x149a2f){if(_0x574474[_0xc9df('0x4')]==_0x957ec6[_0xc9df('0x4')]){_0x574474[_0xc9df('0x1c')]=!![];_0x574474[_0xc9df('0x24')]=utils['now']();_0x574474['lastevent']=_0xc9df('0x25');_0x574474[_0xc9df('0x1f')]=_0xc9df('0x25');_0x574474['holdtime']=_0x957ec6[_0xc9df('0x20')];_0x574474[_0xc9df('0x22')]=0x0;writeDB(_0x574474);}});}catch(_0x5d2bf4){utils[_0xc9df('0x1a')](_0x5d2bf4[_0xc9df('0x1b')]);}};exports['agentconnect']=function(_0x5dee02){try{if(agents[_0x5dee02[_0xc9df('0x13')]]){agents[_0x5dee02[_0xc9df('0x13')]][_0xc9df('0x26')]=utils[_0xc9df('0x16')]();agents[_0x5dee02[_0xc9df('0x13')]][_0xc9df('0x18')]=_0x5dee02[_0xc9df('0x18')];agents[_0x5dee02[_0xc9df('0x13')]][_0xc9df('0x19')]=_0x5dee02['connectedlinename'];agents[_0x5dee02[_0xc9df('0x13')]][_0xc9df('0x20')]=_0x5dee02[_0xc9df('0x21')];agents[_0x5dee02[_0xc9df('0x13')]][_0xc9df('0xa')]=_0xc9df('0x27');_['forIn'](agents,function(_0x61fb04,_0x5e44d5){if(_0x61fb04[_0xc9df('0x13')]!=_0x5dee02[_0xc9df('0x13')]&&_0x61fb04[_0xc9df('0x4')]==_0x5dee02[_0xc9df('0x4')]){_0x61fb04[_0xc9df('0x22')]=0x0;_0x61fb04['holdtime']=_0x5dee02['ringtime'];_0x61fb04[_0xc9df('0x1c')]=!![];_0x61fb04[_0xc9df('0x24')]=utils[_0xc9df('0x16')]();_0x61fb04['lastevent']='answered_elsewhere';_0x61fb04[_0xc9df('0x1f')]=_0xc9df('0x28');_0x61fb04[_0xc9df('0x29')]=_0x5dee02[_0xc9df('0x13')];_0x61fb04[_0xc9df('0x2a')]=_0x5dee02[_0xc9df('0x7')];writeDB(_0x61fb04);}});}}catch(_0x233437){utils['error'](_0x233437['stack']);}};exports[_0xc9df('0xf')]=function(_0x52d5f6){try{if(!_['isNil'](agents[_0x52d5f6[_0xc9df('0x13')]])){agents[_0x52d5f6[_0xc9df('0x13')]][_0xc9df('0xf')]=!![];agents[_0x52d5f6[_0xc9df('0x13')]][_0xc9df('0x2b')]=utils[_0xc9df('0x16')]();agents[_0x52d5f6[_0xc9df('0x13')]]['talktime']=utils[_0xc9df('0x2c')](agents[_0x52d5f6['destuniqueid']][_0xc9df('0x2b')],agents[_0x52d5f6[_0xc9df('0x13')]][_0xc9df('0x26')]);agents[_0x52d5f6['destuniqueid']][_0xc9df('0x1f')]=_0x52d5f6[_0xc9df('0x1f')];agents[_0x52d5f6[_0xc9df('0x13')]][_0xc9df('0xa')]=_0xc9df('0x2d');writeDB(agents[_0x52d5f6[_0xc9df('0x13')]]);}}catch(_0x151394){utils[_0xc9df('0x1a')](_0x151394[_0xc9df('0x1b')]);}};exports[_0xc9df('0x2e')]=function(_0x292739){try{if(!_[_0xc9df('0x1d')](agents[_0x292739['transfereruniqueid']])){agents[_0x292739[_0xc9df('0x2f')]]['transfer']=!![];agents[_0x292739['transfereruniqueid']][_0xc9df('0x30')]='blind';agents[_0x292739[_0xc9df('0x2f')]][_0xc9df('0x31')]=_0x292739[_0xc9df('0x32')];agents[_0x292739[_0xc9df('0x2f')]][_0xc9df('0x33')]=agents[_0x292739[_0xc9df('0x2f')]][_0xc9df('0x4')];}}catch(_0x424198){utils[_0xc9df('0x1a')](_0x424198['stack']);}};exports['attendedtransfer']=function(_0x191af6){try{if(_0x191af6[_0xc9df('0x34')]==_0x191af6['origtransfererlinkedid']){if(!_[_0xc9df('0x1d')](agents[_0x191af6[_0xc9df('0x35')]])){agents[_0x191af6[_0xc9df('0x35')]][_0xc9df('0x36')]=!![];agents[_0x191af6[_0xc9df('0x35')]][_0xc9df('0x30')]='ATTENDED';agents[_0x191af6[_0xc9df('0x35')]][_0xc9df('0x31')]=_0x191af6['origtransfererexten'];agents[_0x191af6[_0xc9df('0x35')]][_0xc9df('0x33')]=_0x191af6['origtransfereruniqueid'];}if(_0x191af6['transfereeuniqueid']&&agents[_0x191af6[_0xc9df('0x37')]]){agents[_0x191af6[_0xc9df('0x37')]][_0xc9df('0x38')]=0x1;transfers[_0x191af6['transfereeuniqueid']]=_[_0xc9df('0x39')](agents[_0x191af6['transfereeuniqueid']]);transfers[_0x191af6[_0xc9df('0x37')]]['calleridnum']=agents[_0x191af6['secondtransfereruniqueid']][_0xc9df('0x9')];transfers[_0x191af6[_0xc9df('0x37')]][_0xc9df('0x3a')]=agents[_0x191af6[_0xc9df('0x35')]]['calleridname'];transfers[_0x191af6[_0xc9df('0x37')]]['agentcalledAt']=utils['now']();transfers[_0x191af6[_0xc9df('0x37')]][_0xc9df('0x26')]=utils['now']();transfers[_0x191af6[_0xc9df('0x37')]]['holdtime']=0x0;transfers[_0x191af6[_0xc9df('0x37')]][_0xc9df('0x38')]=0x2;}}else if(_0x191af6[_0xc9df('0x35')]==_0x191af6[_0xc9df('0x3b')]){if(!_[_0xc9df('0x1d')](agents[_0x191af6[_0xc9df('0x34')]])){agents[_0x191af6[_0xc9df('0x34')]][_0xc9df('0x36')]=!![];agents[_0x191af6[_0xc9df('0x34')]][_0xc9df('0x30')]='ATTENDED';agents[_0x191af6[_0xc9df('0x34')]][_0xc9df('0x31')]=_0x191af6[_0xc9df('0x3c')];agents[_0x191af6[_0xc9df('0x34')]]['transferuniqueid']=_0x191af6[_0xc9df('0x35')];}if(_0x191af6[_0xc9df('0x3d')]&&agents[_0x191af6[_0xc9df('0x3d')]]){agents[_0x191af6[_0xc9df('0x3d')]]['agententerreason']=0x1;transfers[_0x191af6[_0xc9df('0x3d')]]=_[_0xc9df('0x39')](agents[_0x191af6[_0xc9df('0x3d')]]);transfers[_0x191af6['transfertargetuniqueid']][_0xc9df('0x9')]=agents[_0x191af6['origtransfereruniqueid']][_0xc9df('0x9')];transfers[_0x191af6[_0xc9df('0x3d')]][_0xc9df('0x3a')]=agents[_0x191af6[_0xc9df('0x34')]][_0xc9df('0x3a')];transfers[_0x191af6[_0xc9df('0x3d')]][_0xc9df('0x15')]=utils[_0xc9df('0x16')]();transfers[_0x191af6[_0xc9df('0x3d')]][_0xc9df('0x26')]=utils[_0xc9df('0x16')]();transfers[_0x191af6[_0xc9df('0x3d')]]['holdtime']=0x0;transfers[_0x191af6[_0xc9df('0x3d')]]['agententerreason']=0x2;}}}catch(_0x35c865){utils['error'](_0x35c865[_0xc9df('0x1b')]);}};exports[_0xc9df('0x3e')]=function(_0xaf4464){try{if(transfers[_0xaf4464[_0xc9df('0x4')]]){transfers[_0xaf4464['uniqueid']][_0xc9df('0xf')]=!![];transfers[_0xaf4464['uniqueid']][_0xc9df('0x2b')]=utils[_0xc9df('0x16')]();transfers[_0xaf4464['uniqueid']][_0xc9df('0x22')]=utils['diffTime'](transfers[_0xaf4464['uniqueid']][_0xc9df('0x2b')],transfers[_0xaf4464[_0xc9df('0x4')]][_0xc9df('0x26')]);transfers[_0xaf4464[_0xc9df('0x4')]][_0xc9df('0x1f')]=_0xc9df('0x3f');transfers[_0xaf4464['uniqueid']]['lastevent']='complete';writeDB(transfers[_0xaf4464[_0xc9df('0x4')]],!![]);}if(agents[_0xaf4464[_0xc9df('0x4')]]&&agents[_0xaf4464[_0xc9df('0x4')]][_0xc9df('0x26')]){agents[_0xaf4464[_0xc9df('0x4')]][_0xc9df('0xf')]=!![];agents[_0xaf4464[_0xc9df('0x4')]][_0xc9df('0x2b')]=utils[_0xc9df('0x16')]();agents[_0xaf4464[_0xc9df('0x4')]][_0xc9df('0x22')]=utils[_0xc9df('0x2c')](agents[_0xaf4464[_0xc9df('0x4')]]['agentcompleteAt'],agents[_0xaf4464['uniqueid']]['agentconnectAt']);agents[_0xaf4464[_0xc9df('0x4')]][_0xc9df('0x1f')]=agents[_0xaf4464[_0xc9df('0x4')]][_0xc9df('0x36')]?_0xc9df('0x36'):_0xc9df('0x3f');agents[_0xaf4464[_0xc9df('0x4')]][_0xc9df('0xa')]=_0xc9df('0x2d');writeDB(agents[_0xaf4464[_0xc9df('0x4')]]);}}catch(_0x37714f){utils[_0xc9df('0x1a')](_0x37714f[_0xc9df('0x1b')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 7014714..aa01e4a 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 _0xb7df=['newstate','isNil','channelstate','transfer','answertime','stack','hangup','callerid','calleridname','endtime','now','duration','starttime','billableseconds','localtwolinkedid','destinationchannel','secondtransfererchannel','userfield','origtransfererchannel','musiconholdstartAt','mohtime','varset','variable','value','xmd-phone','\x22\x20<','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','xmd-contactid','xmd-cdrtype','sipcallid','application','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','includes','noop','gotoif','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','disposition','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','DOCUMENTATION','error'];(function(_0x4e548b,_0x569d33){var _0x316f82=function(_0x356678){while(--_0x356678){_0x4e548b['push'](_0x4e548b['shift']());}};_0x316f82(++_0x569d33);}(_0xb7df,0x10f));var _0xfb7d=function(_0x58450a,_0x267ad0){_0x58450a=_0x58450a-0x0;var _0x103169=_0xb7df[_0x58450a];return _0x103169;};'use strict';var _=require(_0xfb7d('0x0'));var util=require(_0xfb7d('0x1'));var utils=require(_0xfb7d('0x2'));var dispositions=[_0xfb7d('0x3'),'FAILED',_0xfb7d('0x4'),_0xfb7d('0x3'),'NO\x20ANSWER',_0xfb7d('0x3'),_0xfb7d('0x5'),_0xfb7d('0x6'),_0xfb7d('0x4'),_0xfb7d('0x4'),_0xfb7d('0x4')];var channels={};function writeDB(_0x44d2b4){utils[_0xfb7d('0x7')](util[_0xfb7d('0x8')](_0xfb7d('0x9'),_0x44d2b4[_0xfb7d('0xa')],_0x44d2b4[_0xfb7d('0xb')],_0x44d2b4[_0xfb7d('0xc')],_0x44d2b4[_0xfb7d('0xd')],_0x44d2b4[_0xfb7d('0xe')],_0x44d2b4[_0xfb7d('0xf')],_0x44d2b4['callerid'],_0x44d2b4[_0xfb7d('0x10')]));if(_0x44d2b4[_0xfb7d('0xd')]){utils[_0xfb7d('0x11')](_0x44d2b4[_0xfb7d('0xd')])['then'](function(_0x3e46db){if(_0x3e46db){_0x44d2b4[_0xfb7d('0x12')]=_0x3e46db['id'];}utils[_0xfb7d('0x13')]('CreateVoiceCallReport',_0x44d2b4);});}else{utils[_0xfb7d('0x13')](_0xfb7d('0x14'),_0x44d2b4);}if(channels[_0x44d2b4[_0xfb7d('0xa')]]){delete channels[_0x44d2b4[_0xfb7d('0xa')]];}}exports[_0xfb7d('0x15')]=function(_0x3f7e9f){try{if(_0x3f7e9f[_0xfb7d('0xa')]==_0x3f7e9f[_0xfb7d('0x16')]&&_0x3f7e9f[_0xfb7d('0xb')]!=_0xfb7d('0x17')){channels[_0x3f7e9f[_0xfb7d('0xa')]]={'uniqueid':_0x3f7e9f[_0xfb7d('0xa')],'accountcode':_0x3f7e9f[_0xfb7d('0xd')],'source':_0x3f7e9f[_0xfb7d('0x18')],'destination':_0x3f7e9f[_0xfb7d('0x19')],'destinationcontext':_0x3f7e9f[_0xfb7d('0x1a')],'channel':_0x3f7e9f[_0xfb7d('0xb')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xfb7d('0x1b')};}}catch(_0x27de85){utils[_0xfb7d('0x1c')](_0x27de85['stack']);}};exports[_0xfb7d('0x1d')]=function(_0x5acf9f){try{if(!_[_0xfb7d('0x1e')](channels[_0x5acf9f[_0xfb7d('0xa')]])&&_0x5acf9f[_0xfb7d('0x1f')]==0x6){if(_[_0xfb7d('0x1e')](channels[_0x5acf9f[_0xfb7d('0xa')]]['systemanswertime'])){channels[_0x5acf9f['uniqueid']]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0x5acf9f[_0xfb7d('0x16')]])&&_0x5acf9f[_0xfb7d('0x1f')]==0x6&&_0x5acf9f['context']!=_0xfb7d('0x20')){channels[_0x5acf9f[_0xfb7d('0x16')]][_0xfb7d('0xd')]=_0x5acf9f[_0xfb7d('0xd')];channels[_0x5acf9f[_0xfb7d('0x16')]]['destinationchannel']=_0x5acf9f[_0xfb7d('0xb')];if(_[_0xfb7d('0x1e')](channels[_0x5acf9f[_0xfb7d('0x16')]][_0xfb7d('0x21')])){channels[_0x5acf9f[_0xfb7d('0x16')]][_0xfb7d('0x21')]=utils['now']();}channels[_0x5acf9f[_0xfb7d('0x16')]][_0xfb7d('0x10')]=dispositions[_['toNumber'](_0x5acf9f[_0xfb7d('0x1f')])]||_0xfb7d('0x5');}}catch(_0x23539a){utils[_0xfb7d('0x1c')](_0x23539a[_0xfb7d('0x22')]);}};exports[_0xfb7d('0x23')]=function(_0x248347){try{if(!_[_0xfb7d('0x1e')](channels[_0x248347[_0xfb7d('0xa')]])){if(_[_0xfb7d('0x1e')](channels[_0x248347[_0xfb7d('0xa')]]['callerid'])){channels[_0x248347[_0xfb7d('0xa')]][_0xfb7d('0x24')]=_0x248347[_0xfb7d('0x25')]+'\x20<'+_0x248347[_0xfb7d('0x18')]+'>';}channels[_0x248347[_0xfb7d('0xa')]][_0xfb7d('0x26')]=utils[_0xfb7d('0x27')]();channels[_0x248347[_0xfb7d('0xa')]][_0xfb7d('0x28')]=utils['diffTime'](channels[_0x248347['uniqueid']][_0xfb7d('0x26')],channels[_0x248347[_0xfb7d('0xa')]][_0xfb7d('0x29')]);channels[_0x248347[_0xfb7d('0xa')]][_0xfb7d('0x2a')]=channels[_0x248347[_0xfb7d('0xa')]][_0xfb7d('0x21')]?utils['diffTime'](channels[_0x248347[_0xfb7d('0xa')]][_0xfb7d('0x26')],channels[_0x248347[_0xfb7d('0xa')]]['answertime']):0x0;writeDB(channels[_0x248347[_0xfb7d('0xa')]]);}}catch(_0x5e4a1d){utils[_0xfb7d('0x1c')](_0x5e4a1d[_0xfb7d('0x22')]);}};exports['attendedtransfer']=function(_0xda8eea){try{if(!_['isNil'](channels[_0xda8eea[_0xfb7d('0x2b')]])){if(channels[_0xda8eea[_0xfb7d('0x2b')]]['channel']==_0xda8eea['transfereechannel']){channels[_0xda8eea[_0xfb7d('0x2b')]][_0xfb7d('0x2c')]=_0xda8eea[_0xfb7d('0x2d')];channels[_0xda8eea[_0xfb7d('0x2b')]][_0xfb7d('0x2e')]='_attended';}else if(channels[_0xda8eea[_0xfb7d('0x2b')]][_0xfb7d('0xb')]=_0xda8eea['transfertargetchannel']){channels[_0xda8eea['localtwolinkedid']]['destinationchannel']=_0xda8eea[_0xfb7d('0x2f')];channels[_0xda8eea[_0xfb7d('0x2b')]][_0xfb7d('0x2e')]='_attended';}}}catch(_0x203634){utils[_0xfb7d('0x1c')](_0x203634[_0xfb7d('0x22')]);}};exports['musiconholdstart']=function(_0x5d4cc7){try{if(!_[_0xfb7d('0x1e')](channels[_0x5d4cc7[_0xfb7d('0xa')]])){channels[_0x5d4cc7[_0xfb7d('0xa')]][_0xfb7d('0x30')]=utils['now']();}}catch(_0xa0da65){utils['error'](_0xa0da65['stack']);}};exports['musiconholdstop']=function(_0x453f4b){try{if(!_[_0xfb7d('0x1e')](channels[_0x453f4b['uniqueid']])){if(!_[_0xfb7d('0x1e')](channels[_0x453f4b[_0xfb7d('0xa')]][_0xfb7d('0x30')])){channels[_0x453f4b[_0xfb7d('0xa')]][_0xfb7d('0x31')]+=utils['diffTime'](utils[_0xfb7d('0x27')](),channels[_0x453f4b[_0xfb7d('0xa')]][_0xfb7d('0x30')]);delete channels[_0x453f4b['uniqueid']]['musiconholdstartAt'];}}}catch(_0x461140){utils[_0xfb7d('0x1c')](_0x461140['stack']);}};exports[_0xfb7d('0x32')]=function(_0x327502){try{if(!_['isNil'](channels[_0x327502[_0xfb7d('0xa')]])){if(!_['isNil'](_0x327502[_0xfb7d('0x33')]['xmd-originatecalleridnum'])){channels[_0x327502[_0xfb7d('0xa')]]['source']=_0x327502[_0xfb7d('0x34')];}if(!_[_0xfb7d('0x1e')](_0x327502[_0xfb7d('0x33')][_0xfb7d('0x35')])){channels[_0x327502['uniqueid']][_0xfb7d('0xf')]=_0x327502[_0xfb7d('0x34')];channels[_0x327502['uniqueid']][_0xfb7d('0x24')]='\x22'+_0x327502[_0xfb7d('0x34')]+_0xfb7d('0x36')+_0x327502[_0xfb7d('0x34')]+'>';}if(!_[_0xfb7d('0x1e')](_0x327502[_0xfb7d('0x33')]['xmd-callerid-preview'])||!_['isNil'](_0x327502['variable'][_0xfb7d('0x37')])){channels[_0x327502[_0xfb7d('0xa')]][_0xfb7d('0x24')]=_0x327502[_0xfb7d('0x34')];}if(!_['isNil'](_0x327502[_0xfb7d('0x33')][_0xfb7d('0x38')])||!_['isNil'](_0x327502['variable'][_0xfb7d('0x39')])){channels[_0x327502[_0xfb7d('0xa')]][_0xfb7d('0x3a')]='Queue';channels[_0x327502['uniqueid']][_0xfb7d('0x3b')]=_0x327502[_0xfb7d('0x34')];channels[_0x327502[_0xfb7d('0xa')]][_0xfb7d('0x3c')]=!![];}if(!_[_0xfb7d('0x1e')](_0x327502[_0xfb7d('0x33')][_0xfb7d('0x3d')])){channels[_0x327502[_0xfb7d('0xa')]]['ContactId']=_0x327502['value'];}if(!_[_0xfb7d('0x1e')](_0x327502[_0xfb7d('0x33')][_0xfb7d('0x3e')])){channels[_0x327502[_0xfb7d('0xa')]][_0xfb7d('0xc')]=_0x327502['value'];}if(!_[_0xfb7d('0x1e')](_0x327502['variable']['outboundrouteid'])){channels[_0x327502['uniqueid']]['routeid']=_0x327502[_0xfb7d('0x34')];}if(!_[_0xfb7d('0x1e')](_0x327502['variable']['sipcallid'])){channels[_0x327502['uniqueid']][_0xfb7d('0x3f')]=_0x327502['value'];}}}catch(_0x483012){utils[_0xfb7d('0x1c')](_0x483012[_0xfb7d('0x22')]);}};exports['newexten']=function(_0x281525){try{if(!_[_0xfb7d('0x1e')](channels[_0x281525[_0xfb7d('0xa')]])){if(_0x281525[_0xfb7d('0x40')][_0xfb7d('0x41')]()==_0xfb7d('0x42')&&_[_0xfb7d('0x43')](_0x281525[_0xfb7d('0x44')][_0xfb7d('0x41')](),'cdr')){var _0x4551dd=_0x281525[_0xfb7d('0x44')][_0xfb7d('0x45')]('=');var _0x4d2212=_0x4551dd[0x0][_0xfb7d('0x46')](_0x4551dd[0x0]['lastIndexOf']('(')+0x1,_0x4551dd[0x0][_0xfb7d('0x47')](')'));var _0x5f43ce=_0x4551dd[0x1];channels[_0x281525[_0xfb7d('0xa')]][_0x4d2212]=_0x5f43ce;}if(!_[_0xfb7d('0x48')]([_0xfb7d('0x23'),_0xfb7d('0x49'),'execif',_0xfb7d('0x42'),_0xfb7d('0x4a')],_0x281525[_0xfb7d('0x40')]['toLowerCase']())){channels[_0x281525[_0xfb7d('0xa')]][_0xfb7d('0x3a')]=_0x281525['application'];channels[_0x281525['uniqueid']][_0xfb7d('0x3b')]=_0x281525['appdata'];}}}catch(_0x371f58){utils['error'](_0x371f58[_0xfb7d('0x22')]);}}; \ No newline at end of file +var _0x66aa=['transfereechannel','userfield','_attended','origtransfererchannel','musiconholdstartAt','mohtime','varset','variable','value','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','sipcallid','newexten','application','toLowerCase','startsWith','appdata','cdr','split','lastIndexOf','includes','hangup','noop','execif','set','gotoif','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','source','disposition','getUserByInternal','then','request','linkedid','OutgoingSpoolFailed','error','stack','newstate','isNil','channelstate','now','destinationchannel','answertime','callerid','calleridnum','endtime','duration','diffTime','starttime','attendedtransfer','localtwolinkedid'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x66aa,0x18e));var _0xa66a=function(_0x5544e1,_0x32afaf){_0x5544e1=_0x5544e1-0x0;var _0x233c4c=_0x66aa[_0x5544e1];return _0x233c4c;};'use strict';var _=require('lodash');var util=require(_0xa66a('0x0'));var utils=require(_0xa66a('0x1'));var dispositions=['NO\x20ANSWER',_0xa66a('0x2'),'FAILED',_0xa66a('0x3'),_0xa66a('0x3'),_0xa66a('0x3'),_0xa66a('0x4'),'BUSY','FAILED',_0xa66a('0x2'),'FAILED'];var channels={};function writeDB(_0x3c29de){utils[_0xa66a('0x5')](util[_0xa66a('0x6')](_0xa66a('0x7'),_0x3c29de[_0xa66a('0x8')],_0x3c29de[_0xa66a('0x9')],_0x3c29de['type'],_0x3c29de[_0xa66a('0xa')],_0x3c29de[_0xa66a('0xb')],_0x3c29de['destination'],_0x3c29de['callerid'],_0x3c29de[_0xa66a('0xc')]));if(_0x3c29de['accountcode']){utils[_0xa66a('0xd')](_0x3c29de[_0xa66a('0xa')])[_0xa66a('0xe')](function(_0xcb63f7){if(_0xcb63f7){_0x3c29de['UserId']=_0xcb63f7['id'];}utils[_0xa66a('0xf')]('CreateVoiceCallReport',_0x3c29de);});}else{utils[_0xa66a('0xf')]('CreateVoiceCallReport',_0x3c29de);}if(channels[_0x3c29de[_0xa66a('0x8')]]){delete channels[_0x3c29de[_0xa66a('0x8')]];}}exports['newchannel']=function(_0x561b87){try{if(_0x561b87[_0xa66a('0x8')]==_0x561b87[_0xa66a('0x10')]&&_0x561b87[_0xa66a('0x9')]!=_0xa66a('0x11')){channels[_0x561b87['uniqueid']]={'uniqueid':_0x561b87[_0xa66a('0x8')],'accountcode':_0x561b87['accountcode'],'source':_0x561b87['calleridnum'],'destination':_0x561b87['exten'],'destinationcontext':_0x561b87['context'],'channel':_0x561b87['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa66a('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x2de82e){utils[_0xa66a('0x12')](_0x2de82e[_0xa66a('0x13')]);}};exports[_0xa66a('0x14')]=function(_0x2e0b64){try{if(!_[_0xa66a('0x15')](channels[_0x2e0b64[_0xa66a('0x8')]])&&_0x2e0b64[_0xa66a('0x16')]==0x6){if(_[_0xa66a('0x15')](channels[_0x2e0b64[_0xa66a('0x8')]]['systemanswertime'])){channels[_0x2e0b64[_0xa66a('0x8')]]['systemanswertime']=utils[_0xa66a('0x17')]();}}else if(!_[_0xa66a('0x15')](channels[_0x2e0b64[_0xa66a('0x10')]])&&_0x2e0b64['channelstate']==0x6&&_0x2e0b64['context']!='transfer'){channels[_0x2e0b64[_0xa66a('0x10')]]['accountcode']=_0x2e0b64['accountcode'];channels[_0x2e0b64[_0xa66a('0x10')]][_0xa66a('0x18')]=_0x2e0b64['channel'];if(_[_0xa66a('0x15')](channels[_0x2e0b64[_0xa66a('0x10')]][_0xa66a('0x19')])){channels[_0x2e0b64[_0xa66a('0x10')]]['answertime']=utils[_0xa66a('0x17')]();}channels[_0x2e0b64[_0xa66a('0x10')]]['disposition']=dispositions[_['toNumber'](_0x2e0b64[_0xa66a('0x16')])]||_0xa66a('0x4');}}catch(_0x22ff84){utils[_0xa66a('0x12')](_0x22ff84[_0xa66a('0x13')]);}};exports['hangup']=function(_0x5554d4){try{if(!_[_0xa66a('0x15')](channels[_0x5554d4[_0xa66a('0x8')]])){if(_[_0xa66a('0x15')](channels[_0x5554d4[_0xa66a('0x8')]][_0xa66a('0x1a')])){channels[_0x5554d4[_0xa66a('0x8')]][_0xa66a('0x1a')]=_0x5554d4['calleridname']+'\x20<'+_0x5554d4[_0xa66a('0x1b')]+'>';}channels[_0x5554d4[_0xa66a('0x8')]][_0xa66a('0x1c')]=utils[_0xa66a('0x17')]();channels[_0x5554d4[_0xa66a('0x8')]][_0xa66a('0x1d')]=utils[_0xa66a('0x1e')](channels[_0x5554d4['uniqueid']]['endtime'],channels[_0x5554d4['uniqueid']][_0xa66a('0x1f')]);channels[_0x5554d4[_0xa66a('0x8')]]['billableseconds']=channels[_0x5554d4[_0xa66a('0x8')]][_0xa66a('0x19')]?utils[_0xa66a('0x1e')](channels[_0x5554d4[_0xa66a('0x8')]][_0xa66a('0x1c')],channels[_0x5554d4[_0xa66a('0x8')]][_0xa66a('0x19')]):0x0;writeDB(channels[_0x5554d4[_0xa66a('0x8')]]);}}catch(_0x3ed45f){utils[_0xa66a('0x12')](_0x3ed45f[_0xa66a('0x13')]);}};exports[_0xa66a('0x20')]=function(_0x428eb8){try{if(!_['isNil'](channels[_0x428eb8[_0xa66a('0x21')]])){if(channels[_0x428eb8[_0xa66a('0x21')]]['channel']==_0x428eb8[_0xa66a('0x22')]){channels[_0x428eb8[_0xa66a('0x21')]][_0xa66a('0x18')]=_0x428eb8['secondtransfererchannel'];channels[_0x428eb8['localtwolinkedid']][_0xa66a('0x23')]=_0xa66a('0x24');}else if(channels[_0x428eb8[_0xa66a('0x21')]]['channel']=_0x428eb8['transfertargetchannel']){channels[_0x428eb8[_0xa66a('0x21')]]['destinationchannel']=_0x428eb8[_0xa66a('0x25')];channels[_0x428eb8['localtwolinkedid']][_0xa66a('0x23')]='_attended';}}}catch(_0x22c8e2){utils[_0xa66a('0x12')](_0x22c8e2[_0xa66a('0x13')]);}};exports['musiconholdstart']=function(_0x560d05){try{if(!_[_0xa66a('0x15')](channels[_0x560d05[_0xa66a('0x8')]])){channels[_0x560d05[_0xa66a('0x8')]]['musiconholdstartAt']=utils[_0xa66a('0x17')]();}}catch(_0x2e8202){utils[_0xa66a('0x12')](_0x2e8202[_0xa66a('0x13')]);}};exports['musiconholdstop']=function(_0x2699d1){try{if(!_[_0xa66a('0x15')](channels[_0x2699d1['uniqueid']])){if(!_['isNil'](channels[_0x2699d1['uniqueid']][_0xa66a('0x26')])){channels[_0x2699d1[_0xa66a('0x8')]][_0xa66a('0x27')]+=utils[_0xa66a('0x1e')](utils[_0xa66a('0x17')](),channels[_0x2699d1[_0xa66a('0x8')]][_0xa66a('0x26')]);delete channels[_0x2699d1[_0xa66a('0x8')]][_0xa66a('0x26')];}}}catch(_0x384cad){utils['error'](_0x384cad[_0xa66a('0x13')]);}};exports[_0xa66a('0x28')]=function(_0x24c3a7){try{if(!_[_0xa66a('0x15')](channels[_0x24c3a7[_0xa66a('0x8')]])){if(!_['isNil'](_0x24c3a7[_0xa66a('0x29')]['xmd-originatecalleridnum'])){channels[_0x24c3a7[_0xa66a('0x8')]][_0xa66a('0xb')]=_0x24c3a7[_0xa66a('0x2a')];}if(!_[_0xa66a('0x15')](_0x24c3a7[_0xa66a('0x29')][_0xa66a('0x2b')])){channels[_0x24c3a7[_0xa66a('0x8')]][_0xa66a('0x2c')]=_0x24c3a7[_0xa66a('0x2a')];channels[_0x24c3a7[_0xa66a('0x8')]][_0xa66a('0x1a')]='\x22'+_0x24c3a7['value']+_0xa66a('0x2d')+_0x24c3a7['value']+'>';}if(!_['isNil'](_0x24c3a7[_0xa66a('0x29')][_0xa66a('0x2e')])||!_['isNil'](_0x24c3a7[_0xa66a('0x29')][_0xa66a('0x2f')])){channels[_0x24c3a7[_0xa66a('0x8')]][_0xa66a('0x1a')]=_0x24c3a7['value'];}if(!_['isNil'](_0x24c3a7[_0xa66a('0x29')]['xmd-queue'])||!_['isNil'](_0x24c3a7[_0xa66a('0x29')][_0xa66a('0x30')])){channels[_0x24c3a7[_0xa66a('0x8')]][_0xa66a('0x31')]=_0xa66a('0x32');channels[_0x24c3a7[_0xa66a('0x8')]][_0xa66a('0x33')]=_0x24c3a7[_0xa66a('0x2a')];channels[_0x24c3a7[_0xa66a('0x8')]]['queue']=!![];}if(!_[_0xa66a('0x15')](_0x24c3a7[_0xa66a('0x29')][_0xa66a('0x34')])){channels[_0x24c3a7[_0xa66a('0x8')]][_0xa66a('0x35')]=_0x24c3a7[_0xa66a('0x2a')];}if(!_[_0xa66a('0x15')](_0x24c3a7[_0xa66a('0x29')][_0xa66a('0x36')])){channels[_0x24c3a7[_0xa66a('0x8')]][_0xa66a('0x37')]=_0x24c3a7[_0xa66a('0x2a')];}if(!_[_0xa66a('0x15')](_0x24c3a7[_0xa66a('0x29')][_0xa66a('0x38')])){channels[_0x24c3a7['uniqueid']]['routeid']=_0x24c3a7[_0xa66a('0x2a')];}if(!_['isNil'](_0x24c3a7[_0xa66a('0x29')][_0xa66a('0x39')])){channels[_0x24c3a7[_0xa66a('0x8')]][_0xa66a('0x39')]=_0x24c3a7[_0xa66a('0x2a')];}}}catch(_0x2473fb){utils[_0xa66a('0x12')](_0x2473fb[_0xa66a('0x13')]);}};exports[_0xa66a('0x3a')]=function(_0x5c1f2c){try{if(!_[_0xa66a('0x15')](channels[_0x5c1f2c['uniqueid']])){if(_0x5c1f2c[_0xa66a('0x3b')][_0xa66a('0x3c')]()=='set'&&_[_0xa66a('0x3d')](_0x5c1f2c[_0xa66a('0x3e')][_0xa66a('0x3c')](),_0xa66a('0x3f'))){var _0x4bb3ba=_0x5c1f2c[_0xa66a('0x3e')][_0xa66a('0x40')]('=');var _0x3f89e5=_0x4bb3ba[0x0]['substring'](_0x4bb3ba[0x0][_0xa66a('0x41')]('(')+0x1,_0x4bb3ba[0x0][_0xa66a('0x41')](')'));var _0x50fffa=_0x4bb3ba[0x1];channels[_0x5c1f2c[_0xa66a('0x8')]][_0x3f89e5]=_0x50fffa;}if(!_[_0xa66a('0x42')]([_0xa66a('0x43'),_0xa66a('0x44'),_0xa66a('0x45'),_0xa66a('0x46'),_0xa66a('0x47')],_0x5c1f2c[_0xa66a('0x3b')][_0xa66a('0x3c')]())){channels[_0x5c1f2c[_0xa66a('0x8')]]['lastapplication']=_0x5c1f2c[_0xa66a('0x3b')];channels[_0x5c1f2c[_0xa66a('0x8')]][_0xa66a('0x33')]=_0x5c1f2c[_0xa66a('0x3e')];}}}catch(_0x313e03){utils[_0xa66a('0x12')](_0x313e03[_0xa66a('0x13')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1a0de3c..f61ddeb 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 _0xf072=['SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent','./utils','lodash','connect','CONNECTED','info'];(function(_0x5443af,_0x339ac9){var _0x4d9611=function(_0x261038){while(--_0x261038){_0x5443af['push'](_0x5443af['shift']());}};_0x4d9611(++_0x339ac9);}(_0xf072,0x1cf));var _0x2f07=function(_0x43322d,_0x35a93c){_0x43322d=_0x43322d-0x0;var _0x133bd3=_0xf072[_0x43322d];return _0x133bd3;};'use strict';var utils=require(_0x2f07('0x0'));var _=require(_0x2f07('0x1'));exports[_0x2f07('0x2')]=function(){utils['info'](_0x2f07('0x3'));};exports['shutdown']=function(){utils[_0x2f07('0x4')](_0x2f07('0x5'));};exports[_0x2f07('0x6')]=function(){utils['info'](_0x2f07('0x7'));};exports[_0x2f07('0x8')]=function(_0x3643bb){utils[_0x2f07('0x8')](_0x3643bb);};exports[_0x2f07('0x9')]=function(){utils[_0x2f07('0x4')](_0x2f07('0xa'));};exports[_0x2f07('0xb')]=function(_0x4746c2){}; \ No newline at end of file +var _0xb091=['CONNECTED','FULLYBOOTED','error','close','CLOSE','managerevent','lodash','connect','info'];(function(_0x1bcb9d,_0x196e3d){var _0x5651f2=function(_0x3e8151){while(--_0x3e8151){_0x1bcb9d['push'](_0x1bcb9d['shift']());}};_0x5651f2(++_0x196e3d);}(_0xb091,0x16e));var _0x1b09=function(_0x4e4472,_0x633027){_0x4e4472=_0x4e4472-0x0;var _0x1c9b77=_0xb091[_0x4e4472];return _0x1c9b77;};'use strict';var utils=require('./utils');var _=require(_0x1b09('0x0'));exports[_0x1b09('0x1')]=function(){utils[_0x1b09('0x2')](_0x1b09('0x3'));};exports['shutdown']=function(){utils[_0x1b09('0x2')]('SHUTDOWN');};exports['fullybooted']=function(){utils[_0x1b09('0x2')](_0x1b09('0x4'));};exports['error']=function(_0xda8caa){utils[_0x1b09('0x5')](_0xda8caa);};exports[_0x1b09('0x6')]=function(){utils['info'](_0x1b09('0x7'));};exports[_0x1b09('0x8')]=function(_0x2f359f){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index fa36fc8..1ce296e 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 _0xd0ae=['./utils','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','application','toLowerCase','set','appdata','split','error','stack','isNil','outboundrouteid','value','dialbegin','assign','lastevent','called','dialend','ANSWER','now','connect','duration','diffTime','starttime','answertime','endtime','billableseconds','lodash','util'];(function(_0x7d5f97,_0x55fc70){var _0x3ba58f=function(_0x10a800){while(--_0x10a800){_0x7d5f97['push'](_0x7d5f97['shift']());}};_0x3ba58f(++_0x55fc70);}(_0xd0ae,0x1ae));var _0xed0a=function(_0xef371e,_0x1291e6){_0xef371e=_0xef371e-0x0;var _0x5a56d0=_0xd0ae[_0xef371e];return _0x5a56d0;};'use strict';var _=require(_0xed0a('0x0'));var util=require(_0xed0a('0x1'));var utils=require(_0xed0a('0x2'));var dials={};function writeDB(_0x1838e7){utils['info'](util[_0xed0a('0x3')]('DIAL|%s|%s|%s|%s|%s|%s',_0x1838e7[_0xed0a('0x4')],_0x1838e7[_0xed0a('0x5')],_0x1838e7[_0xed0a('0x6')],_0x1838e7[_0xed0a('0x7')],_0x1838e7[_0xed0a('0x8')],_0x1838e7[_0xed0a('0x9')]));utils['request'](_0xed0a('0xa'),_0x1838e7);delete dials[_0x1838e7[_0xed0a('0x4')]];}exports[_0xed0a('0xb')]=function(_0x10cc6c){try{if(_0x10cc6c[_0xed0a('0xc')][_0xed0a('0xd')]()==_0xed0a('0xe')&&_['startsWith'](_0x10cc6c['appdata']['toLowerCase'](),'cdr(routeid)')){var _0xdd4a9f=_0x10cc6c[_0xed0a('0xf')][_0xed0a('0x10')]('=');dials[_0x10cc6c[_0xed0a('0x4')]]={'routeId':_0xdd4a9f[0x1]};}}catch(_0x5ed5e0){utils[_0xed0a('0x11')](_0x5ed5e0[_0xed0a('0x12')]);}};exports['varset']=function(_0xafe388){try{if(!_[_0xed0a('0x13')](_0xafe388['variable'][_0xed0a('0x14')])){dials[_0xafe388[_0xed0a('0x4')]]={'routeId':_0xafe388[_0xed0a('0x15')]};}}catch(_0x71a23e){utils[_0xed0a('0x11')](_0x71a23e['stack']);}};exports[_0xed0a('0x16')]=function(_0x5c035c){try{if(!_[_0xed0a('0x13')](dials[_0x5c035c['uniqueid']])){dials[_0x5c035c[_0xed0a('0x4')]]=_[_0xed0a('0x17')](dials[_0x5c035c['uniqueid']],_0x5c035c);dials[_0x5c035c[_0xed0a('0x4')]]['starttime']=utils['now']();dials[_0x5c035c[_0xed0a('0x4')]][_0xed0a('0x18')]=_0xed0a('0x19');}}catch(_0x3beaff){utils[_0xed0a('0x11')](_0x3beaff[_0xed0a('0x12')]);}};exports[_0xed0a('0x1a')]=function(_0x334ad8){try{if(!_['isNil'](dials[_0x334ad8[_0xed0a('0x4')]])){dials[_0x334ad8[_0xed0a('0x4')]][_0xed0a('0x9')]=_0x334ad8[_0xed0a('0x9')];if(_0x334ad8[_0xed0a('0x9')]==_0xed0a('0x1b')){dials[_0x334ad8[_0xed0a('0x4')]]=_[_0xed0a('0x17')](dials[_0x334ad8['uniqueid']],_0x334ad8);dials[_0x334ad8[_0xed0a('0x4')]]['answertime']=utils[_0xed0a('0x1c')]();dials[_0x334ad8['uniqueid']][_0xed0a('0x18')]=_0xed0a('0x1d');}}}catch(_0x503d53){utils[_0xed0a('0x11')](_0x503d53[_0xed0a('0x12')]);}};exports['hangup']=function(_0x347073){try{if(!_[_0xed0a('0x13')](dials[_0x347073[_0xed0a('0x4')]])){dials[_0x347073[_0xed0a('0x4')]]=_[_0xed0a('0x17')](dials[_0x347073[_0xed0a('0x4')]],{'endtime':utils[_0xed0a('0x1c')](),'lastevent':'complete'});dials[_0x347073[_0xed0a('0x4')]][_0xed0a('0x1e')]=utils[_0xed0a('0x1f')](dials[_0x347073[_0xed0a('0x4')]]['endtime'],dials[_0x347073['uniqueid']][_0xed0a('0x20')]);dials[_0x347073[_0xed0a('0x4')]]['holdtime']=utils['diffTime'](dials[_0x347073[_0xed0a('0x4')]][_0xed0a('0x21')]||dials[_0x347073[_0xed0a('0x4')]][_0xed0a('0x22')],dials[_0x347073['uniqueid']][_0xed0a('0x20')]);dials[_0x347073[_0xed0a('0x4')]][_0xed0a('0x23')]=dials[_0x347073[_0xed0a('0x4')]][_0xed0a('0x21')]?utils[_0xed0a('0x1f')](dials[_0x347073[_0xed0a('0x4')]]['endtime'],dials[_0x347073['uniqueid']][_0xed0a('0x21')]):0x0;writeDB(dials[_0x347073[_0xed0a('0x4')]]);}}catch(_0x473dfc){utils[_0xed0a('0x11')](_0x473dfc[_0xed0a('0x12')]);}}; \ No newline at end of file +var _0x2eda=['diffTime','endtime','holdtime','lodash','util','./utils','format','DIAL|%s|%s|%s|%s|%s|%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','set','startsWith','appdata','toLowerCase','cdr(routeid)','split','uniqueid','error','stack','variable','outboundrouteid','dialbegin','isNil','assign','starttime','called','dialend','ANSWER','answertime','now','lastevent','hangup','complete','duration'];(function(_0x1e3870,_0x373b28){var _0x2c46fc=function(_0x2511cd){while(--_0x2511cd){_0x1e3870['push'](_0x1e3870['shift']());}};_0x2c46fc(++_0x373b28);}(_0x2eda,0x9f));var _0xa2ed=function(_0xa5db89,_0x59922e){_0xa5db89=_0xa5db89-0x0;var _0x34c10e=_0x2eda[_0xa5db89];return _0x34c10e;};'use strict';var _=require(_0xa2ed('0x0'));var util=require(_0xa2ed('0x1'));var utils=require(_0xa2ed('0x2'));var dials={};function writeDB(_0x368cff){utils['info'](util[_0xa2ed('0x3')](_0xa2ed('0x4'),_0x368cff['uniqueid'],_0x368cff[_0xa2ed('0x5')],_0x368cff[_0xa2ed('0x6')],_0x368cff[_0xa2ed('0x7')],_0x368cff[_0xa2ed('0x8')],_0x368cff[_0xa2ed('0x9')]));utils[_0xa2ed('0xa')]('CreateVoiceDialReport',_0x368cff);delete dials[_0x368cff['uniqueid']];}exports[_0xa2ed('0xb')]=function(_0xbdfc0b){try{if(_0xbdfc0b['application']['toLowerCase']()==_0xa2ed('0xc')&&_[_0xa2ed('0xd')](_0xbdfc0b[_0xa2ed('0xe')][_0xa2ed('0xf')](),_0xa2ed('0x10'))){var _0xd3c016=_0xbdfc0b[_0xa2ed('0xe')][_0xa2ed('0x11')]('=');dials[_0xbdfc0b[_0xa2ed('0x12')]]={'routeId':_0xd3c016[0x1]};}}catch(_0x4a20fa){utils[_0xa2ed('0x13')](_0x4a20fa[_0xa2ed('0x14')]);}};exports['varset']=function(_0x275104){try{if(!_['isNil'](_0x275104[_0xa2ed('0x15')][_0xa2ed('0x16')])){dials[_0x275104[_0xa2ed('0x12')]]={'routeId':_0x275104['value']};}}catch(_0x4bf7e8){utils[_0xa2ed('0x13')](_0x4bf7e8['stack']);}};exports[_0xa2ed('0x17')]=function(_0x4d44ca){try{if(!_[_0xa2ed('0x18')](dials[_0x4d44ca['uniqueid']])){dials[_0x4d44ca[_0xa2ed('0x12')]]=_[_0xa2ed('0x19')](dials[_0x4d44ca['uniqueid']],_0x4d44ca);dials[_0x4d44ca['uniqueid']][_0xa2ed('0x1a')]=utils['now']();dials[_0x4d44ca['uniqueid']]['lastevent']=_0xa2ed('0x1b');}}catch(_0x46c8c9){utils['error'](_0x46c8c9['stack']);}};exports[_0xa2ed('0x1c')]=function(_0x144d5b){try{if(!_['isNil'](dials[_0x144d5b['uniqueid']])){dials[_0x144d5b[_0xa2ed('0x12')]][_0xa2ed('0x9')]=_0x144d5b[_0xa2ed('0x9')];if(_0x144d5b[_0xa2ed('0x9')]==_0xa2ed('0x1d')){dials[_0x144d5b[_0xa2ed('0x12')]]=_['assign'](dials[_0x144d5b[_0xa2ed('0x12')]],_0x144d5b);dials[_0x144d5b['uniqueid']][_0xa2ed('0x1e')]=utils[_0xa2ed('0x1f')]();dials[_0x144d5b['uniqueid']][_0xa2ed('0x20')]='connect';}}}catch(_0x390913){utils[_0xa2ed('0x13')](_0x390913[_0xa2ed('0x14')]);}};exports[_0xa2ed('0x21')]=function(_0x468d86){try{if(!_['isNil'](dials[_0x468d86['uniqueid']])){dials[_0x468d86['uniqueid']]=_[_0xa2ed('0x19')](dials[_0x468d86[_0xa2ed('0x12')]],{'endtime':utils[_0xa2ed('0x1f')](),'lastevent':_0xa2ed('0x22')});dials[_0x468d86[_0xa2ed('0x12')]][_0xa2ed('0x23')]=utils[_0xa2ed('0x24')](dials[_0x468d86[_0xa2ed('0x12')]][_0xa2ed('0x25')],dials[_0x468d86[_0xa2ed('0x12')]][_0xa2ed('0x1a')]);dials[_0x468d86['uniqueid']][_0xa2ed('0x26')]=utils[_0xa2ed('0x24')](dials[_0x468d86[_0xa2ed('0x12')]]['answertime']||dials[_0x468d86[_0xa2ed('0x12')]][_0xa2ed('0x25')],dials[_0x468d86['uniqueid']]['starttime']);dials[_0x468d86[_0xa2ed('0x12')]]['billableseconds']=dials[_0x468d86[_0xa2ed('0x12')]][_0xa2ed('0x1e')]?utils[_0xa2ed('0x24')](dials[_0x468d86[_0xa2ed('0x12')]][_0xa2ed('0x25')],dials[_0x468d86[_0xa2ed('0x12')]][_0xa2ed('0x1e')]):0x0;writeDB(dials[_0x468d86[_0xa2ed('0x12')]]);}}catch(_0x592ac3){utils[_0xa2ed('0x13')](_0x592ac3[_0xa2ed('0x14')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index f4d5096..3696537 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 _0x2f6b=['hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','password','keepConnected','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate'];(function(_0x2d2b91,_0x2b32dc){var _0x4d41f=function(_0x12dc0f){while(--_0x12dc0f){_0x2d2b91['push'](_0x2d2b91['shift']());}};_0x4d41f(++_0x2b32dc);}(_0x2f6b,0x10c));var _0xb2f6=function(_0x3d391b,_0x139db6){_0x3d391b=_0x3d391b-0x0;var _0x34adb6=_0x2f6b[_0x3d391b];return _0x34adb6;};var AsteriskManager=require(_0xb2f6('0x0'));var config=require(_0xb2f6('0x1'));var utils=require(_0xb2f6('0x2'));var ami=new AsteriskManager(config[_0xb2f6('0x3')]['port'],config[_0xb2f6('0x3')]['ip'],config[_0xb2f6('0x3')]['username'],config[_0xb2f6('0x3')][_0xb2f6('0x4')],!![]);ami[_0xb2f6('0x5')]();if(config['xdr']&&config['xdr']['disabled']){utils[_0xb2f6('0x6')](_0xb2f6('0x7'));}else{var agents=require(_0xb2f6('0x8'));var calls=require(_0xb2f6('0x9'));var queues=require('./queues.controller');var recordings=require(_0xb2f6('0xa'));var members=require(_0xb2f6('0xb'));var dials=require(_0xb2f6('0xc'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on']('connect',core[_0xb2f6('0xd')]);ami['on'](_0xb2f6('0xe'),core[_0xb2f6('0xe')]);ami['on'](_0xb2f6('0xf'),core[_0xb2f6('0xf')]);ami['on'](_0xb2f6('0x10'),core[_0xb2f6('0x10')]);ami['on']('close',core['close']);ami['on']('managerevent',core[_0xb2f6('0x11')]);ami['on'](_0xb2f6('0x12'),function(_0x1f033a){try{members[_0xb2f6('0x12')](_0x1f033a);}catch(_0x546c17){utils[_0xb2f6('0x10')](_0x546c17);}});ami['on']('agentcalled',function(_0x56b533){try{agents['agentcalled'](_0x56b533);}catch(_0x1f7617){utils['error'](_0x1f7617);}});ami['on'](_0xb2f6('0x13'),function(_0x36ee4a){try{agents[_0xb2f6('0x13')](_0x36ee4a);}catch(_0x5c656e){utils[_0xb2f6('0x10')](_0x5c656e);}});ami['on']('agentconnect',function(_0x6fad25){try{agents[_0xb2f6('0x14')](_0x6fad25);queues[_0xb2f6('0x14')](_0x6fad25);}catch(_0x54473d){utils[_0xb2f6('0x10')](_0x54473d);}});ami['on'](_0xb2f6('0x15'),function(_0x2ac806){try{agents[_0xb2f6('0x15')](_0x2ac806);queues['agentcomplete'](_0x2ac806);members[_0xb2f6('0x15')](_0x2ac806);}catch(_0x8a8fa9){utils[_0xb2f6('0x10')](_0x8a8fa9);}});ami['on'](_0xb2f6('0x16'),function(_0x1dd499){try{agents[_0xb2f6('0x16')](_0x1dd499);queues[_0xb2f6('0x16')](_0x1dd499);}catch(_0x2baefe){utils[_0xb2f6('0x10')](_0x2baefe);}});ami['on'](_0xb2f6('0x17'),function(_0x174a0d){try{queues[_0xb2f6('0x17')](_0x174a0d);recordings['queuecallerjoin'](_0x174a0d);}catch(_0x1f16a0){utils[_0xb2f6('0x10')](_0x1f16a0);}});ami['on'](_0xb2f6('0x18'),function(_0x47fedd){try{queues[_0xb2f6('0x18')](_0x47fedd);}catch(_0x46724e){utils[_0xb2f6('0x10')](_0x46724e);}});ami['on'](_0xb2f6('0x19'),function(_0x4ac672){try{queues['musiconholdstart'](_0x4ac672);calls[_0xb2f6('0x19')](_0x4ac672);}catch(_0x55cdf8){utils[_0xb2f6('0x10')](_0x55cdf8);}});ami['on'](_0xb2f6('0x1a'),function(_0x50c642){try{queues['musiconholdstop'](_0x50c642);calls[_0xb2f6('0x1a')](_0x50c642);}catch(_0x334cce){utils[_0xb2f6('0x10')](_0x334cce);}});ami['on'](_0xb2f6('0x1b'),function(_0xddd5fe){try{calls[_0xb2f6('0x1b')](_0xddd5fe);recordings[_0xb2f6('0x1b')](_0xddd5fe);}catch(_0x15ab67){utils['error'](_0x15ab67);}});ami['on'](_0xb2f6('0x1c'),function(_0x987a69){try{calls[_0xb2f6('0x1c')](_0x987a69);recordings['hangup'](_0x987a69);dials[_0xb2f6('0x1c')](_0x987a69);agents['hangup'](_0x987a69);queues[_0xb2f6('0x1c')](_0x987a69);}catch(_0x47eaef){utils[_0xb2f6('0x10')](_0x47eaef);}});ami['on'](_0xb2f6('0x1d'),function(_0x2483d6){try{members[_0xb2f6('0x1d')](_0x2483d6);}catch(_0x3a0bbd){utils[_0xb2f6('0x10')](_0x3a0bbd);}});ami['on'](_0xb2f6('0x1e'),function(_0x1b7e7d){try{queues[_0xb2f6('0x1e')](_0x1b7e7d);agents['blindtransfer'](_0x1b7e7d);transfers[_0xb2f6('0x1e')](_0x1b7e7d);}catch(_0x3615c0){utils[_0xb2f6('0x10')](_0x3615c0);}});ami['on'](_0xb2f6('0x1f'),function(_0x352310){try{queues['attendedtransfer'](_0x352310);transfers[_0xb2f6('0x1f')](_0x352310);agents[_0xb2f6('0x1f')](_0x352310);calls['attendedtransfer'](_0x352310);}catch(_0x3cebb5){utils[_0xb2f6('0x10')](_0x3cebb5);}});ami['on'](_0xb2f6('0x20'),function(_0x346bb0){try{queues['varset'](_0x346bb0);recordings[_0xb2f6('0x20')](_0x346bb0);calls[_0xb2f6('0x20')](_0x346bb0);dials['varset'](_0x346bb0);}catch(_0x2a4ac5){utils[_0xb2f6('0x10')](_0x2a4ac5);}});ami['on'](_0xb2f6('0x21'),function(_0x41b098){try{calls[_0xb2f6('0x21')](_0x41b098);recordings[_0xb2f6('0x21')](_0x41b098);dials[_0xb2f6('0x21')](_0x41b098);}catch(_0x3b71a9){utils[_0xb2f6('0x10')](_0x3b71a9);}});ami['on'](_0xb2f6('0x22'),function(_0x209953){try{calls[_0xb2f6('0x22')](_0x209953);recordings[_0xb2f6('0x22')](_0x209953);}catch(_0x2de49f){utils['error'](_0x2de49f);}});ami['on'](_0xb2f6('0x23'),function(_0x3a95da){try{dials[_0xb2f6('0x23')](_0x3a95da);}catch(_0x429e6e){utils['error'](_0x429e6e);}});ami['on'](_0xb2f6('0x24'),function(_0x2cc47c){try{dials[_0xb2f6('0x24')](_0x2cc47c);}catch(_0x5ec939){utils['error'](_0x5ec939);}});} \ No newline at end of file +var _0x3ae3=['agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','port','asterisk','password','xdr','disabled','info','XDR\x20DISABLED','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x3ae3,0x167));var _0x33ae=function(_0x3021f2,_0x4c6975){_0x3021f2=_0x3021f2-0x0;var _0x228297=_0x3ae3[_0x3021f2];return _0x228297;};var AsteriskManager=require(_0x33ae('0x0'));var config=require('../../config/environment');var utils=require('./utils');var ami=new AsteriskManager(config['asterisk'][_0x33ae('0x1')],config['asterisk']['ip'],config[_0x33ae('0x2')]['username'],config[_0x33ae('0x2')][_0x33ae('0x3')],!![]);ami['keepConnected']();if(config[_0x33ae('0x4')]&&config[_0x33ae('0x4')][_0x33ae('0x5')]){utils[_0x33ae('0x6')](_0x33ae('0x7'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0x33ae('0x8'));var recordings=require(_0x33ae('0x9'));var members=require('./members.controller');var dials=require(_0x33ae('0xa'));var transfers=require(_0x33ae('0xb'));var core=require('./core.controller');ami['on'](_0x33ae('0xc'),core[_0x33ae('0xc')]);ami['on'](_0x33ae('0xd'),core['shutdown']);ami['on'](_0x33ae('0xe'),core[_0x33ae('0xe')]);ami['on'](_0x33ae('0xf'),core[_0x33ae('0xf')]);ami['on'](_0x33ae('0x10'),core[_0x33ae('0x10')]);ami['on'](_0x33ae('0x11'),core['managerevent']);ami['on'](_0x33ae('0x12'),function(_0x5e6bf9){try{members[_0x33ae('0x12')](_0x5e6bf9);}catch(_0x529703){utils['error'](_0x529703);}});ami['on']('agentcalled',function(_0x126c3f){try{agents[_0x33ae('0x13')](_0x126c3f);}catch(_0xeedd94){utils['error'](_0xeedd94);}});ami['on'](_0x33ae('0x14'),function(_0x4e225e){try{agents[_0x33ae('0x14')](_0x4e225e);}catch(_0x4f1512){utils[_0x33ae('0xf')](_0x4f1512);}});ami['on']('agentconnect',function(_0x3b4e95){try{agents['agentconnect'](_0x3b4e95);queues[_0x33ae('0x15')](_0x3b4e95);}catch(_0x7c4255){utils[_0x33ae('0xf')](_0x7c4255);}});ami['on'](_0x33ae('0x16'),function(_0x1c4369){try{agents[_0x33ae('0x16')](_0x1c4369);queues['agentcomplete'](_0x1c4369);members['agentcomplete'](_0x1c4369);}catch(_0x24f705){utils['error'](_0x24f705);}});ami['on'](_0x33ae('0x17'),function(_0x5004d5){try{agents[_0x33ae('0x17')](_0x5004d5);queues['queuecallerabandon'](_0x5004d5);}catch(_0x471934){utils['error'](_0x471934);}});ami['on']('queuecallerjoin',function(_0xa7029e){try{queues['queuecallerjoin'](_0xa7029e);recordings[_0x33ae('0x18')](_0xa7029e);}catch(_0x2de615){utils[_0x33ae('0xf')](_0x2de615);}});ami['on'](_0x33ae('0x19'),function(_0x3bbc18){try{queues[_0x33ae('0x19')](_0x3bbc18);}catch(_0x42adbd){utils['error'](_0x42adbd);}});ami['on'](_0x33ae('0x1a'),function(_0x3d923b){try{queues[_0x33ae('0x1a')](_0x3d923b);calls[_0x33ae('0x1a')](_0x3d923b);}catch(_0x2c0374){utils[_0x33ae('0xf')](_0x2c0374);}});ami['on']('musiconholdstop',function(_0x45f966){try{queues['musiconholdstop'](_0x45f966);calls[_0x33ae('0x1b')](_0x45f966);}catch(_0x42a78e){utils[_0x33ae('0xf')](_0x42a78e);}});ami['on']('newstate',function(_0x135c76){try{calls[_0x33ae('0x1c')](_0x135c76);recordings[_0x33ae('0x1c')](_0x135c76);}catch(_0x36888b){utils['error'](_0x36888b);}});ami['on'](_0x33ae('0x1d'),function(_0x32f58b){try{calls['hangup'](_0x32f58b);recordings['hangup'](_0x32f58b);dials['hangup'](_0x32f58b);agents[_0x33ae('0x1d')](_0x32f58b);queues[_0x33ae('0x1d')](_0x32f58b);}catch(_0x475e5b){utils[_0x33ae('0xf')](_0x475e5b);}});ami['on'](_0x33ae('0x1e'),function(_0x1ac4c6){try{members[_0x33ae('0x1e')](_0x1ac4c6);}catch(_0xbcfa57){utils['error'](_0xbcfa57);}});ami['on'](_0x33ae('0x1f'),function(_0x2899bf){try{queues[_0x33ae('0x1f')](_0x2899bf);agents[_0x33ae('0x1f')](_0x2899bf);transfers[_0x33ae('0x1f')](_0x2899bf);}catch(_0x4d96e4){utils[_0x33ae('0xf')](_0x4d96e4);}});ami['on']('attendedtransfer',function(_0x550c23){try{queues['attendedtransfer'](_0x550c23);transfers[_0x33ae('0x20')](_0x550c23);agents[_0x33ae('0x20')](_0x550c23);calls[_0x33ae('0x20')](_0x550c23);}catch(_0x1dcc27){utils[_0x33ae('0xf')](_0x1dcc27);}});ami['on'](_0x33ae('0x21'),function(_0x1f9a15){try{queues['varset'](_0x1f9a15);recordings[_0x33ae('0x21')](_0x1f9a15);calls[_0x33ae('0x21')](_0x1f9a15);dials[_0x33ae('0x21')](_0x1f9a15);}catch(_0x352f08){utils['error'](_0x352f08);}});ami['on'](_0x33ae('0x22'),function(_0x405f32){try{calls[_0x33ae('0x22')](_0x405f32);recordings['newexten'](_0x405f32);dials[_0x33ae('0x22')](_0x405f32);}catch(_0x53c843){utils['error'](_0x53c843);}});ami['on'](_0x33ae('0x23'),function(_0x4c87b1){try{calls[_0x33ae('0x23')](_0x4c87b1);recordings['newchannel'](_0x4c87b1);}catch(_0x1e1671){utils['error'](_0x1e1671);}});ami['on'](_0x33ae('0x24'),function(_0x353ef6){try{dials[_0x33ae('0x24')](_0x353ef6);}catch(_0x113142){utils[_0x33ae('0xf')](_0x113142);}});ami['on'](_0x33ae('0x25'),function(_0x1cd005){try{dials[_0x33ae('0x25')](_0x1cd005);}catch(_0xd85ad7){utils[_0x33ae('0xf')](_0xd85ad7);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c9e4a6b..88148a2 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 _0x08c7=['state','INUSE','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','assign','queue','cdr','data1','type','data3','destination','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','getUserByInterface','name','internal','CreateMemberReport','getUserByName','split','then','catch','error','some','startsWith','devicestatechange'];(function(_0x3808f5,_0x10b93c){var _0x4746fb=function(_0x3abd46){while(--_0x3abd46){_0x3808f5['push'](_0x3808f5['shift']());}};_0x4746fb(++_0x10b93c);}(_0x08c7,0x150));var _0x708c=function(_0x41d57b,_0x5ec19a){_0x41d57b=_0x41d57b-0x0;var _0x5f2c93=_0x08c7[_0x41d57b];return _0x5f2c93;};'use strict';var _=require(_0x708c('0x0'));var util=require(_0x708c('0x1'));var utils=require(_0x708c('0x2'));var members={};var exclude=[_0x708c('0x3'),'Queue:'];function writeDB(_0x42590c){utils[_0x708c('0x4')](util[_0x708c('0x5')](_0x708c('0x6'),_0x42590c[_0x708c('0x7')],_0x42590c[_0x708c('0x8')],_0x42590c[_0x708c('0x9')],_0x42590c[_0x708c('0xa')],_0x42590c[_0x708c('0xb')],_0x42590c['type']));if(_0x42590c['interface']){utils[_0x708c('0xc')](_0x42590c[_0x708c('0x8')])['then'](function(_0x51f1de){if(_0x51f1de){_0x42590c[_0x708c('0xb')]=_0x51f1de[_0x708c('0xd')];_0x42590c[_0x708c('0xe')]=_0x51f1de[_0x708c('0xe')];utils['request'](_0x708c('0xf'),_0x42590c);}else{utils[_0x708c('0x10')](_0x42590c[_0x708c('0x8')][_0x708c('0x11')]('/')[0x1])[_0x708c('0x12')](function(_0x5196b4){if(_0x5196b4){_0x42590c[_0x708c('0xb')]=_0x5196b4[_0x708c('0xd')];_0x42590c[_0x708c('0xe')]=_0x5196b4[_0x708c('0xe')];utils['request'](_0x708c('0xf'),_0x42590c);}});}})[_0x708c('0x13')](function(_0x24498e){utils[_0x708c('0x14')](_0x24498e);});}delete members[_0x42590c[_0x708c('0x8')]];}function startsWith(_0x4cbcfe,_0x378caa){return _[_0x708c('0x15')](_0x4cbcfe,function(_0x5c47ed){return _[_0x708c('0x16')](_0x378caa,_0x5c47ed);});}exports[_0x708c('0x17')]=function(_0x48f7e7){switch(_0x48f7e7[_0x708c('0x18')]){case _0x708c('0x19'):case _0x708c('0x1a'):if(!startsWith(exclude,_0x48f7e7[_0x708c('0x1b')])){members[_0x48f7e7['device']]={'channel':_0x708c('0x1c'),'interface':_0x48f7e7[_0x708c('0x1b')],'type':_0x708c('0x1d'),'enterAt':utils[_0x708c('0x1e')](),'role':_0x708c('0x1f')};}break;case _0x708c('0x20'):if(!_[_0x708c('0x21')](members[_0x48f7e7[_0x708c('0x1b')]])){members[_0x48f7e7[_0x708c('0x1b')]][_0x708c('0x22')]=utils[_0x708c('0x1e')]();members[_0x48f7e7[_0x708c('0x1b')]]['duration']=utils[_0x708c('0x23')](members[_0x48f7e7[_0x708c('0x1b')]][_0x708c('0x22')],members[_0x48f7e7['device']]['enterAt']);if(members[_0x48f7e7['device']][_0x708c('0x7')]){writeDB(members[_0x48f7e7['device']]);}}default:break;}};exports['agentcomplete']=function(_0x540888){if(!_[_0x708c('0x21')](members[_0x540888[_0x708c('0x8')]])){members[_0x540888['interface']]=_[_0x708c('0x24')](members[_0x540888[_0x708c('0x8')]],{'data4':_0x540888[_0x708c('0x25')],'uniqueid':_0x540888[_0x708c('0x7')]});}};exports[_0x708c('0x26')]=function(_0x1be1de){if(_0x1be1de['channel']){var _0x2fd489=_0x1be1de[_0x708c('0x9')][_0x708c('0x11')]('-')[0x0];if(!_[_0x708c('0x21')](members[_0x2fd489])){members[_0x2fd489]=_[_0x708c('0x24')](members[_0x2fd489],{'data1':members[_0x2fd489][_0x708c('0x27')]||_0x1be1de[_0x708c('0x28')],'data2':members[_0x2fd489]['data2']||_0x1be1de['source'],'data3':members[_0x2fd489][_0x708c('0x29')]||_0x1be1de[_0x708c('0x2a')],'uniqueid':members[_0x2fd489][_0x708c('0x7')]||_0x1be1de[_0x708c('0x7')]});if(members[_0x2fd489]['exitAt']){writeDB(members[_0x2fd489]);}}}if(_0x1be1de[_0x708c('0x2b')]){var _0x28b376=_0x1be1de['destinationchannel'][_0x708c('0x11')]('-')[0x0];if(!_[_0x708c('0x21')](members[_0x28b376])){members[_0x28b376]=_['assign'](members[_0x28b376],{'data1':members[_0x28b376][_0x708c('0x27')]||_0x1be1de[_0x708c('0x28')],'data2':members[_0x28b376]['data2']||_0x1be1de[_0x708c('0x2c')],'data3':members[_0x28b376][_0x708c('0x29')]||_0x1be1de[_0x708c('0x2a')],'uniqueid':members[_0x28b376][_0x708c('0x7')]||_0x1be1de[_0x708c('0x7')]});if(members[_0x28b376][_0x708c('0x22')]){writeDB(members[_0x28b376]);}}}}; \ No newline at end of file +var _0x34b0=['channel','assign','data1','source','data3','destination','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','data2','membername','type','interface','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','split','catch','error','some','startsWith','devicestatechange','state','INUSE','device','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','queue','uniqueid','cdr'];(function(_0x3e4e84,_0x11c51c){var _0x52d5b1=function(_0x5dab63){while(--_0x5dab63){_0x3e4e84['push'](_0x3e4e84['shift']());}};_0x52d5b1(++_0x11c51c);}(_0x34b0,0x109));var _0x034b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x34b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x034b('0x0'));var util=require(_0x034b('0x1'));var utils=require('./utils');var members={};var exclude=[_0x034b('0x2'),_0x034b('0x3')];function writeDB(_0x395d8a){utils[_0x034b('0x4')](util['format'](_0x034b('0x5'),_0x395d8a['uniqueid'],_0x395d8a['interface'],_0x395d8a['channel'],_0x395d8a[_0x034b('0x6')],_0x395d8a[_0x034b('0x7')],_0x395d8a[_0x034b('0x8')]));if(_0x395d8a[_0x034b('0x9')]){utils[_0x034b('0xa')](_0x395d8a[_0x034b('0x9')])[_0x034b('0xb')](function(_0x5c9ca0){if(_0x5c9ca0){_0x395d8a['membername']=_0x5c9ca0['name'];_0x395d8a[_0x034b('0xc')]=_0x5c9ca0[_0x034b('0xc')];utils[_0x034b('0xd')](_0x034b('0xe'),_0x395d8a);}else{utils[_0x034b('0xf')](_0x395d8a[_0x034b('0x9')][_0x034b('0x10')]('/')[0x1])[_0x034b('0xb')](function(_0xd98dca){if(_0xd98dca){_0x395d8a['membername']=_0xd98dca['name'];_0x395d8a[_0x034b('0xc')]=_0xd98dca['internal'];utils['request'](_0x034b('0xe'),_0x395d8a);}});}})[_0x034b('0x11')](function(_0x190d16){utils[_0x034b('0x12')](_0x190d16);});}delete members[_0x395d8a[_0x034b('0x9')]];}function startsWith(_0x214870,_0x5695d9){return _[_0x034b('0x13')](_0x214870,function(_0x457a1f){return _[_0x034b('0x14')](_0x5695d9,_0x457a1f);});}exports[_0x034b('0x15')]=function(_0x5ce4ad){switch(_0x5ce4ad[_0x034b('0x16')]){case _0x034b('0x17'):case'BUSY':if(!startsWith(exclude,_0x5ce4ad[_0x034b('0x18')])){members[_0x5ce4ad[_0x034b('0x18')]]={'channel':'voice','interface':_0x5ce4ad[_0x034b('0x18')],'type':'TALKING','enterAt':utils[_0x034b('0x19')](),'role':_0x034b('0x1a')};}break;case _0x034b('0x1b'):if(!_[_0x034b('0x1c')](members[_0x5ce4ad['device']])){members[_0x5ce4ad['device']][_0x034b('0x1d')]=utils['now']();members[_0x5ce4ad[_0x034b('0x18')]][_0x034b('0x1e')]=utils[_0x034b('0x1f')](members[_0x5ce4ad[_0x034b('0x18')]][_0x034b('0x1d')],members[_0x5ce4ad[_0x034b('0x18')]][_0x034b('0x20')]);if(members[_0x5ce4ad[_0x034b('0x18')]]['uniqueid']){writeDB(members[_0x5ce4ad[_0x034b('0x18')]]);}}default:break;}};exports['agentcomplete']=function(_0xe72b0){if(!_[_0x034b('0x1c')](members[_0xe72b0[_0x034b('0x9')]])){members[_0xe72b0[_0x034b('0x9')]]=_['assign'](members[_0xe72b0[_0x034b('0x9')]],{'data4':_0xe72b0[_0x034b('0x21')],'uniqueid':_0xe72b0[_0x034b('0x22')]});}};exports[_0x034b('0x23')]=function(_0x30d5d5){if(_0x30d5d5[_0x034b('0x24')]){var _0x6053d8=_0x30d5d5[_0x034b('0x24')][_0x034b('0x10')]('-')[0x0];if(!_[_0x034b('0x1c')](members[_0x6053d8])){members[_0x6053d8]=_[_0x034b('0x25')](members[_0x6053d8],{'data1':members[_0x6053d8][_0x034b('0x26')]||_0x30d5d5[_0x034b('0x8')],'data2':members[_0x6053d8][_0x034b('0x6')]||_0x30d5d5[_0x034b('0x27')],'data3':members[_0x6053d8][_0x034b('0x28')]||_0x30d5d5[_0x034b('0x29')],'uniqueid':members[_0x6053d8]['uniqueid']||_0x30d5d5[_0x034b('0x22')]});if(members[_0x6053d8][_0x034b('0x1d')]){writeDB(members[_0x6053d8]);}}}if(_0x30d5d5[_0x034b('0x2a')]){var _0x5999f6=_0x30d5d5[_0x034b('0x2a')][_0x034b('0x10')]('-')[0x0];if(!_[_0x034b('0x1c')](members[_0x5999f6])){members[_0x5999f6]=_[_0x034b('0x25')](members[_0x5999f6],{'data1':members[_0x5999f6]['data1']||_0x30d5d5[_0x034b('0x8')],'data2':members[_0x5999f6]['data2']||_0x30d5d5['source'],'data3':members[_0x5999f6][_0x034b('0x28')]||_0x30d5d5[_0x034b('0x29')],'uniqueid':members[_0x5999f6][_0x034b('0x22')]||_0x30d5d5[_0x034b('0x22')]});if(members[_0x5999f6][_0x034b('0x1d')]){writeDB(members[_0x5999f6]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index df975b6..ed14872 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 _0x03b5=['queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','varset','queuestatus','value','CONTINUE','queuecallerexitAt','toUpperCase','variable','queuecallerabandonAt','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','membername','transfer','TRANSFER','COMPLETEDBY','reason','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','position','now','isNil','queuecallerleaveAt','queuecallerabandon'];(function(_0x112176,_0x1963d5){var _0x5a0727=function(_0x37cab4){while(--_0x37cab4){_0x112176['push'](_0x112176['shift']());}};_0x5a0727(++_0x1963d5);}(_0x03b5,0x17d));var _0x503b=function(_0x205f41,_0x4770be){_0x205f41=_0x205f41-0x0;var _0x46fc04=_0x03b5[_0x205f41];return _0x46fc04;};'use strict';var _=require(_0x503b('0x0'));var util=require(_0x503b('0x1'));var utils=require(_0x503b('0x2'));var queues={};function writeDB(_0x5080a8){utils[_0x503b('0x3')](util[_0x503b('0x4')](_0x503b('0x5'),_0x5080a8[_0x503b('0x6')],_0x5080a8[_0x503b('0x7')],_0x5080a8[_0x503b('0x8')],_0x5080a8[_0x503b('0x9')],_0x5080a8['calleridnum'],_0x5080a8[_0x503b('0xa')],_0x5080a8[_0x503b('0xb')]));if(_0x5080a8['queue']){utils[_0x503b('0xc')](_0x5080a8['queue'])[_0x503b('0xd')](function(_0x222ab7){if(_0x222ab7){_0x5080a8[_0x503b('0xe')]=_0x222ab7[_0x503b('0xe')];}utils[_0x503b('0xf')](_0x503b('0x10'),_0x5080a8);});}else{utils[_0x503b('0xf')](_0x503b('0x10'),_0x5080a8);}if(_0x5080a8[_0x503b('0x11')]){delete queues[_0x5080a8[_0x503b('0x11')]];}else{delete queues[_0x5080a8[_0x503b('0x6')]];}}exports[_0x503b('0x12')]=function(_0x27a7e8){queues[_0x27a7e8['uniqueid']]=_['assign'](_0x27a7e8,{'originalposition':_0x27a7e8[_0x503b('0x13')],'queuecallerjoinAt':utils[_0x503b('0x14')](),'mohtime':0x0});};exports['hangup']=function(_0xbcfbd){if(!_[_0x503b('0x15')](queues[_0xbcfbd['uniqueid']])){if(queues[_0xbcfbd[_0x503b('0x6')]][_0x503b('0x16')]){if(!queues[_0xbcfbd[_0x503b('0x6')]][_0x503b('0x17')]&&!queues[_0xbcfbd[_0x503b('0x6')]][_0x503b('0x18')]){queues[_0xbcfbd['uniqueid']][_0x503b('0x19')]=!![];queues[_0xbcfbd['uniqueid']][_0x503b('0x1a')]=utils[_0x503b('0x14')]();queues[_0xbcfbd[_0x503b('0x6')]][_0x503b('0xb')]=_0x503b('0x1b');}writeDB(queues[_0xbcfbd['uniqueid']]);}else{if(queues[_0xbcfbd['uniqueid']][_0x503b('0x11')]){queues[queues[_0xbcfbd['uniqueid']][_0x503b('0x11')]]=queues[_0xbcfbd['uniqueid']];queues[queues[_0xbcfbd['uniqueid']][_0x503b('0x11')]]['queuecallerenterreason']=0x2;delete queues[_0xbcfbd[_0x503b('0x6')]];}}}};exports[_0x503b('0x1c')]=function(_0x13c9cb){if(!_['isNil'](_0x13c9cb['variable'][_0x503b('0x1d')])&&_0x13c9cb[_0x503b('0x1e')]['toUpperCase']()!==_0x503b('0x1f')){if(!_[_0x503b('0x15')](queues[_0x13c9cb[_0x503b('0x6')]])){queues[_0x13c9cb['uniqueid']][_0x503b('0x17')]=![];queues[_0x13c9cb[_0x503b('0x6')]]['queuecallerabandonAt']=null;queues[_0x13c9cb[_0x503b('0x6')]][_0x503b('0x18')]=!![];queues[_0x13c9cb[_0x503b('0x6')]][_0x503b('0x20')]=utils['now']();queues[_0x13c9cb[_0x503b('0x6')]][_0x503b('0xb')]=_0x13c9cb[_0x503b('0x1e')][_0x503b('0x21')]();writeDB(queues[_0x13c9cb[_0x503b('0x6')]]);}}else if(!_[_0x503b('0x15')](_0x13c9cb[_0x503b('0x22')]['queueposition'])){if(!_[_0x503b('0x15')](queues[_0x13c9cb[_0x503b('0x6')]])&&!queues[_0x13c9cb[_0x503b('0x6')]]['queuecallerabandon']){queues[_0x13c9cb[_0x503b('0x6')]][_0x503b('0x17')]=![];queues[_0x13c9cb[_0x503b('0x6')]][_0x503b('0x23')]=null;queues[_0x13c9cb[_0x503b('0x6')]][_0x503b('0x18')]=!![];queues[_0x13c9cb[_0x503b('0x6')]][_0x503b('0x20')]=utils['now']();queues[_0x13c9cb[_0x503b('0x6')]]['queuecallerexitreason']=_0x503b('0x24');}}};exports[_0x503b('0x17')]=function(_0x1c43ea){if(!_['isNil'](queues[_0x1c43ea[_0x503b('0x6')]])){queues[_0x1c43ea[_0x503b('0x6')]][_0x503b('0x18')]=![];queues[_0x1c43ea['uniqueid']][_0x503b('0x20')]=null;queues[_0x1c43ea[_0x503b('0x6')]]['queuecallerabandon']=!![];queues[_0x1c43ea[_0x503b('0x6')]][_0x503b('0x23')]=utils[_0x503b('0x14')]();queues[_0x1c43ea[_0x503b('0x6')]][_0x503b('0xb')]=_0x503b('0x25');}};exports[_0x503b('0x26')]=function(_0x400223){if(!_['isNil'](queues[_0x400223[_0x503b('0x6')]])){queues[_0x400223[_0x503b('0x6')]][_0x503b('0x26')]=!![];queues[_0x400223[_0x503b('0x6')]][_0x503b('0x16')]=utils['now']();queues[_0x400223[_0x503b('0x6')]][_0x503b('0x27')]=utils[_0x503b('0x28')](queues[_0x400223[_0x503b('0x6')]][_0x503b('0x16')],queues[_0x400223[_0x503b('0x6')]][_0x503b('0x29')]);queues[_0x400223['uniqueid']][_0x503b('0x13')]=_0x400223[_0x503b('0x13')];queues[_0x400223[_0x503b('0x6')]][_0x503b('0x2a')]=_0x400223['count'];queues[_0x400223[_0x503b('0x6')]][_0x503b('0x2b')]=_0x400223[_0x503b('0x2b')];queues[_0x400223[_0x503b('0x6')]][_0x503b('0x2c')]=_0x400223[_0x503b('0x2c')];}};exports[_0x503b('0x2d')]=function(_0x3b1732){if(!_[_0x503b('0x15')](queues[_0x3b1732[_0x503b('0x6')]])){queues[_0x3b1732[_0x503b('0x6')]][_0x503b('0x17')]=![];queues[_0x3b1732[_0x503b('0x6')]]['queuecallerabandon']=![];queues[_0x3b1732['uniqueid']][_0x503b('0x23')]=null;queues[_0x3b1732['uniqueid']][_0x503b('0x18')]=![];queues[_0x3b1732[_0x503b('0x6')]]['queuecallerexitreason']=null;queues[_0x3b1732[_0x503b('0x6')]][_0x503b('0x20')]=null;queues[_0x3b1732[_0x503b('0x6')]][_0x503b('0x2e')]=!![];queues[_0x3b1732[_0x503b('0x6')]][_0x503b('0xa')]=_0x3b1732[_0x503b('0x2f')];queues[_0x3b1732['uniqueid']][_0x503b('0x9')]=_0x3b1732[_0x503b('0x30')];}};exports['agentcomplete']=function(_0x581e87){if(!_['isNil'](queues[_0x581e87[_0x503b('0x6')]])){if(queues[_0x581e87['uniqueid']][_0x503b('0x16')]){queues[_0x581e87['uniqueid']][_0x503b('0x17')]=![];queues[_0x581e87[_0x503b('0x6')]][_0x503b('0x17')]=![];queues[_0x581e87['uniqueid']][_0x503b('0x23')]=null;queues[_0x581e87[_0x503b('0x6')]]['queuecallerexit']=![];queues[_0x581e87[_0x503b('0x6')]][_0x503b('0x20')]=null;queues[_0x581e87[_0x503b('0x6')]][_0x503b('0x2e')]=!![];queues[_0x581e87[_0x503b('0x6')]][_0x503b('0x9')]=_0x581e87[_0x503b('0x30')];queues[_0x581e87['uniqueid']][_0x503b('0x19')]=!![];queues[_0x581e87[_0x503b('0x6')]][_0x503b('0x1a')]=utils[_0x503b('0x14')]();if(_0x581e87['reason']==_0x503b('0x31')){if(!queues[_0x581e87[_0x503b('0x6')]][_0x503b('0x31')]){queues[_0x581e87[_0x503b('0x6')]][_0x503b('0xb')]=_0x503b('0x32');}}else{queues[_0x581e87[_0x503b('0x6')]][_0x503b('0xb')]=_0x503b('0x33')+_0x581e87[_0x503b('0x34')][_0x503b('0x21')]();}writeDB(queues[_0x581e87[_0x503b('0x6')]]);}}};exports[_0x503b('0x35')]=function(_0x3b3f6e){if(!_['isNil'](queues[_0x3b3f6e['transfereeuniqueid']])){queues[_0x3b3f6e['transfereeuniqueid']][_0x503b('0x31')]=!![];queues[_0x3b3f6e[_0x503b('0x36')]][_0x503b('0x37')]=_0x503b('0x38');queues[_0x3b3f6e[_0x503b('0x36')]][_0x503b('0x39')]=_0x3b3f6e[_0x503b('0x3a')];queues[_0x3b3f6e[_0x503b('0x36')]][_0x503b('0x3b')]=_0x3b3f6e['transfereeuniqueid'];queues[_0x3b3f6e[_0x503b('0x36')]][_0x503b('0xb')]='BLINDTRANSFER';}};exports[_0x503b('0x3c')]=function(_0x59d2e8){try{if(_0x59d2e8[_0x503b('0x3d')]==_0x59d2e8[_0x503b('0x3e')]){if(!_[_0x503b('0x15')](queues[_0x59d2e8[_0x503b('0x3f')]])){queues[_0x59d2e8['secondtransfererlinkedid']]['transfer']=!![];queues[_0x59d2e8[_0x503b('0x3f')]][_0x503b('0x37')]=_0x503b('0x40');queues[_0x59d2e8[_0x503b('0x3f')]][_0x503b('0x39')]=_0x59d2e8[_0x503b('0x41')];queues[_0x59d2e8[_0x503b('0x3f')]]['transferuniqueid']=_0x59d2e8[_0x503b('0x3d')];queues[_0x59d2e8['secondtransfererlinkedid']][_0x503b('0xb')]=_0x503b('0x42');}if(!_[_0x503b('0x15')](queues[_0x59d2e8[_0x503b('0x3e')]])){if(_0x59d2e8['transfereelinkedid']&&queues[_0x59d2e8[_0x503b('0x43')]]){queues[_0x59d2e8[_0x503b('0x43')]][_0x503b('0x44')]=0x1;queues[_0x59d2e8[_0x503b('0x36')]]=_[_0x503b('0x45')](queues[_0x59d2e8[_0x503b('0x43')]]);queues[_0x59d2e8[_0x503b('0x36')]][_0x503b('0x11')]=_0x59d2e8[_0x503b('0x46')];queues[_0x59d2e8[_0x503b('0x36')]][_0x503b('0x44')]=0x2;queues[_0x59d2e8[_0x503b('0x36')]][_0x503b('0x47')]=queues[_0x59d2e8[_0x503b('0x3f')]][_0x503b('0x47')];queues[_0x59d2e8[_0x503b('0x36')]][_0x503b('0x48')]=queues[_0x59d2e8[_0x503b('0x3f')]][_0x503b('0x48')];queues[_0x59d2e8[_0x503b('0x36')]][_0x503b('0x29')]=utils[_0x503b('0x14')]();queues[_0x59d2e8['transfereeuniqueid']][_0x503b('0x16')]=utils['now']();queues[_0x59d2e8['transfereeuniqueid']]['holdtime']=0x0;queues[_0x59d2e8[_0x503b('0x36')]][_0x503b('0x49')]=0x0;}else{queues[_0x59d2e8[_0x503b('0x3e')]]['transfereduniqueid']=_0x59d2e8[_0x503b('0x3f')];}}}else if(_0x59d2e8[_0x503b('0x4a')]==_0x59d2e8['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x59d2e8['origtransfererlinkedid']])){queues[_0x59d2e8[_0x503b('0x3e')]][_0x503b('0x31')]=!![];queues[_0x59d2e8['origtransfererlinkedid']][_0x503b('0x37')]=_0x503b('0x40');queues[_0x59d2e8[_0x503b('0x3e')]]['transferexten']=_0x59d2e8[_0x503b('0x4b')];queues[_0x59d2e8['origtransfererlinkedid']]['transferuniqueid']=_0x59d2e8[_0x503b('0x4a')];queues[_0x59d2e8[_0x503b('0x3e')]][_0x503b('0xb')]=_0x503b('0x42');}if(!_[_0x503b('0x15')](queues[_0x59d2e8[_0x503b('0x3f')]])){if(_0x59d2e8[_0x503b('0x4c')]&&queues[_0x59d2e8[_0x503b('0x4c')]]){queues[_0x59d2e8[_0x503b('0x4c')]][_0x503b('0x44')]=0x1;queues[_0x59d2e8[_0x503b('0x46')]]=_[_0x503b('0x45')](queues[_0x59d2e8[_0x503b('0x4c')]]);queues[_0x59d2e8[_0x503b('0x46')]][_0x503b('0x11')]=_0x59d2e8['transfertargetuniqueid'];queues[_0x59d2e8[_0x503b('0x46')]][_0x503b('0x44')]=0x2;queues[_0x59d2e8[_0x503b('0x46')]][_0x503b('0x47')]=queues[_0x59d2e8[_0x503b('0x3e')]][_0x503b('0x47')];queues[_0x59d2e8['transfertargetuniqueid']][_0x503b('0x48')]=queues[_0x59d2e8[_0x503b('0x3e')]][_0x503b('0x48')];queues[_0x59d2e8[_0x503b('0x46')]][_0x503b('0x29')]=utils[_0x503b('0x14')]();queues[_0x59d2e8[_0x503b('0x46')]][_0x503b('0x16')]=utils[_0x503b('0x14')]();queues[_0x59d2e8[_0x503b('0x46')]][_0x503b('0x27')]=0x0;queues[_0x59d2e8['transfertargetuniqueid']]['mohtime']=0x0;}else{queues[_0x59d2e8[_0x503b('0x3f')]][_0x503b('0x11')]=_0x59d2e8[_0x503b('0x3e')];}}}}catch(_0x1b5da0){utils[_0x503b('0x4d')](_0x1b5da0[_0x503b('0x4e')]);}};exports[_0x503b('0x4f')]=function(_0x5324c8){if(!_['isNil'](queues[_0x5324c8['uniqueid']])){queues[_0x5324c8[_0x503b('0x6')]][_0x503b('0x50')]=utils[_0x503b('0x14')]();}};exports['musiconholdstop']=function(_0x5e623a){if(!_['isNil'](queues[_0x5e623a[_0x503b('0x6')]])){if(!_[_0x503b('0x15')](queues[_0x5e623a[_0x503b('0x6')]][_0x503b('0x50')])){queues[_0x5e623a['uniqueid']][_0x503b('0x49')]+=utils['diffTime'](utils['now'](),queues[_0x5e623a['uniqueid']][_0x503b('0x50')]);delete queues[_0x5e623a[_0x503b('0x6')]][_0x503b('0x50')];}}}; \ No newline at end of file +var _0xc030=['uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','COMPLETEDBYAGENT','queuecallerenterreason','varset','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt','variable','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','assigned','accountcode','membername','agentcomplete','queuecallercomplete','queuecallercompleteAt','transfer','COMPLETEDBY','reason','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transferuniqueid','transfertargetlinkedid','clone','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','util','info','QUEUE|%s|%s|%s|%s|%s|%s|%s'];(function(_0x25069b,_0x53135c){var _0x63e65d=function(_0x307713){while(--_0x307713){_0x25069b['push'](_0x25069b['shift']());}};_0x63e65d(++_0x53135c);}(_0xc030,0x9c));var _0x0c03=function(_0x56d20e,_0x217c31){_0x56d20e=_0x56d20e-0x0;var _0x18b27a=_0xc030[_0x56d20e];return _0x18b27a;};'use strict';var _=require(_0x0c03('0x0'));var util=require(_0x0c03('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1d029d){utils[_0x0c03('0x2')](util['format'](_0x0c03('0x3'),_0x1d029d[_0x0c03('0x4')],_0x1d029d[_0x0c03('0x5')],_0x1d029d[_0x0c03('0x6')],_0x1d029d[_0x0c03('0x7')],_0x1d029d[_0x0c03('0x8')],_0x1d029d['accountcode'],_0x1d029d[_0x0c03('0x9')]));if(_0x1d029d[_0x0c03('0x6')]){utils[_0x0c03('0xa')](_0x1d029d[_0x0c03('0x6')])[_0x0c03('0xb')](function(_0x5e71f0){if(_0x5e71f0){_0x1d029d[_0x0c03('0xc')]=_0x5e71f0[_0x0c03('0xc')];}utils[_0x0c03('0xd')](_0x0c03('0xe'),_0x1d029d);});}else{utils[_0x0c03('0xd')](_0x0c03('0xe'),_0x1d029d);}if(_0x1d029d[_0x0c03('0xf')]){delete queues[_0x1d029d[_0x0c03('0xf')]];}else{delete queues[_0x1d029d['uniqueid']];}}exports[_0x0c03('0x10')]=function(_0x2da249){queues[_0x2da249[_0x0c03('0x4')]]=_[_0x0c03('0x11')](_0x2da249,{'originalposition':_0x2da249['position'],'queuecallerjoinAt':utils[_0x0c03('0x12')](),'mohtime':0x0});};exports[_0x0c03('0x13')]=function(_0x48417c){if(!_[_0x0c03('0x14')](queues[_0x48417c[_0x0c03('0x4')]])){if(queues[_0x48417c['uniqueid']][_0x0c03('0x15')]){if(!queues[_0x48417c[_0x0c03('0x4')]][_0x0c03('0x16')]&&!queues[_0x48417c[_0x0c03('0x4')]][_0x0c03('0x17')]){queues[_0x48417c[_0x0c03('0x4')]]['queuecallercomplete']=!![];queues[_0x48417c['uniqueid']]['queuecallercompleteAt']=utils[_0x0c03('0x12')]();queues[_0x48417c['uniqueid']][_0x0c03('0x9')]=_0x0c03('0x18');}writeDB(queues[_0x48417c[_0x0c03('0x4')]]);}else{if(queues[_0x48417c[_0x0c03('0x4')]][_0x0c03('0xf')]){queues[queues[_0x48417c[_0x0c03('0x4')]]['transfereduniqueid']]=queues[_0x48417c[_0x0c03('0x4')]];queues[queues[_0x48417c['uniqueid']][_0x0c03('0xf')]][_0x0c03('0x19')]=0x2;delete queues[_0x48417c[_0x0c03('0x4')]];}}}};exports[_0x0c03('0x1a')]=function(_0x29fb17){if(!_['isNil'](_0x29fb17['variable'][_0x0c03('0x1b')])&&_0x29fb17[_0x0c03('0x1c')][_0x0c03('0x1d')]()!=='CONTINUE'){if(!_[_0x0c03('0x14')](queues[_0x29fb17[_0x0c03('0x4')]])){queues[_0x29fb17[_0x0c03('0x4')]][_0x0c03('0x16')]=![];queues[_0x29fb17[_0x0c03('0x4')]][_0x0c03('0x1e')]=null;queues[_0x29fb17['uniqueid']][_0x0c03('0x17')]=!![];queues[_0x29fb17[_0x0c03('0x4')]][_0x0c03('0x1f')]=utils[_0x0c03('0x12')]();queues[_0x29fb17[_0x0c03('0x4')]][_0x0c03('0x9')]=_0x29fb17[_0x0c03('0x1c')][_0x0c03('0x1d')]();writeDB(queues[_0x29fb17[_0x0c03('0x4')]]);}}else if(!_['isNil'](_0x29fb17[_0x0c03('0x20')][_0x0c03('0x21')])){if(!_[_0x0c03('0x14')](queues[_0x29fb17[_0x0c03('0x4')]])&&!queues[_0x29fb17[_0x0c03('0x4')]]['queuecallerabandon']){queues[_0x29fb17[_0x0c03('0x4')]][_0x0c03('0x16')]=![];queues[_0x29fb17[_0x0c03('0x4')]][_0x0c03('0x1e')]=null;queues[_0x29fb17[_0x0c03('0x4')]]['queuecallerexit']=!![];queues[_0x29fb17[_0x0c03('0x4')]]['queuecallerexitAt']=utils['now']();queues[_0x29fb17[_0x0c03('0x4')]][_0x0c03('0x9')]=_0x0c03('0x22');}}};exports['queuecallerabandon']=function(_0x2a0e49){if(!_['isNil'](queues[_0x2a0e49['uniqueid']])){queues[_0x2a0e49[_0x0c03('0x4')]][_0x0c03('0x17')]=![];queues[_0x2a0e49[_0x0c03('0x4')]][_0x0c03('0x1f')]=null;queues[_0x2a0e49[_0x0c03('0x4')]][_0x0c03('0x16')]=!![];queues[_0x2a0e49[_0x0c03('0x4')]][_0x0c03('0x1e')]=utils['now']();queues[_0x2a0e49['uniqueid']][_0x0c03('0x9')]=_0x0c03('0x23');}};exports[_0x0c03('0x24')]=function(_0x3d999b){if(!_[_0x0c03('0x14')](queues[_0x3d999b[_0x0c03('0x4')]])){queues[_0x3d999b[_0x0c03('0x4')]][_0x0c03('0x24')]=!![];queues[_0x3d999b['uniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x3d999b[_0x0c03('0x4')]][_0x0c03('0x25')]=utils[_0x0c03('0x26')](queues[_0x3d999b[_0x0c03('0x4')]]['queuecallerleaveAt'],queues[_0x3d999b[_0x0c03('0x4')]][_0x0c03('0x27')]);queues[_0x3d999b['uniqueid']][_0x0c03('0x28')]=_0x3d999b[_0x0c03('0x28')];queues[_0x3d999b[_0x0c03('0x4')]][_0x0c03('0x29')]=_0x3d999b[_0x0c03('0x29')];queues[_0x3d999b[_0x0c03('0x4')]][_0x0c03('0x2a')]=_0x3d999b[_0x0c03('0x2a')];queues[_0x3d999b[_0x0c03('0x4')]][_0x0c03('0x2b')]=_0x3d999b[_0x0c03('0x2b')];}};exports['agentconnect']=function(_0x3f6be4){if(!_[_0x0c03('0x14')](queues[_0x3f6be4[_0x0c03('0x4')]])){queues[_0x3f6be4[_0x0c03('0x4')]][_0x0c03('0x16')]=![];queues[_0x3f6be4[_0x0c03('0x4')]][_0x0c03('0x16')]=![];queues[_0x3f6be4[_0x0c03('0x4')]][_0x0c03('0x1e')]=null;queues[_0x3f6be4[_0x0c03('0x4')]]['queuecallerexit']=![];queues[_0x3f6be4[_0x0c03('0x4')]][_0x0c03('0x9')]=null;queues[_0x3f6be4[_0x0c03('0x4')]][_0x0c03('0x1f')]=null;queues[_0x3f6be4[_0x0c03('0x4')]][_0x0c03('0x2c')]=!![];queues[_0x3f6be4[_0x0c03('0x4')]][_0x0c03('0x2d')]=_0x3f6be4['destaccountcode'];queues[_0x3f6be4['uniqueid']][_0x0c03('0x7')]=_0x3f6be4[_0x0c03('0x2e')];}};exports[_0x0c03('0x2f')]=function(_0x3ce6a3){if(!_[_0x0c03('0x14')](queues[_0x3ce6a3[_0x0c03('0x4')]])){if(queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x15')]){queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x16')]=![];queues[_0x3ce6a3['uniqueid']][_0x0c03('0x16')]=![];queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x1e')]=null;queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x17')]=![];queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x1f')]=null;queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x2c')]=!![];queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x7')]=_0x3ce6a3[_0x0c03('0x2e')];queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x30')]=!![];queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x31')]=utils[_0x0c03('0x12')]();if(_0x3ce6a3['reason']=='transfer'){if(!queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x32')]){queues[_0x3ce6a3[_0x0c03('0x4')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x3ce6a3[_0x0c03('0x4')]][_0x0c03('0x9')]=_0x0c03('0x33')+_0x3ce6a3[_0x0c03('0x34')][_0x0c03('0x1d')]();}writeDB(queues[_0x3ce6a3['uniqueid']]);}}};exports['blindtransfer']=function(_0x5ae53b){if(!_[_0x0c03('0x14')](queues[_0x5ae53b[_0x0c03('0x35')]])){queues[_0x5ae53b[_0x0c03('0x35')]][_0x0c03('0x32')]=!![];queues[_0x5ae53b['transfereeuniqueid']][_0x0c03('0x36')]=_0x0c03('0x37');queues[_0x5ae53b['transfereeuniqueid']][_0x0c03('0x38')]=_0x5ae53b[_0x0c03('0x39')];queues[_0x5ae53b[_0x0c03('0x35')]]['transferuniqueid']=_0x5ae53b['transfereeuniqueid'];queues[_0x5ae53b[_0x0c03('0x35')]][_0x0c03('0x9')]=_0x0c03('0x3a');}};exports[_0x0c03('0x3b')]=function(_0x104847){try{if(_0x104847['origtransfereruniqueid']==_0x104847[_0x0c03('0x3c')]){if(!_['isNil'](queues[_0x104847[_0x0c03('0x3d')]])){queues[_0x104847[_0x0c03('0x3d')]][_0x0c03('0x32')]=!![];queues[_0x104847['secondtransfererlinkedid']][_0x0c03('0x36')]=_0x0c03('0x3e');queues[_0x104847[_0x0c03('0x3d')]][_0x0c03('0x38')]=_0x104847[_0x0c03('0x3f')];queues[_0x104847['secondtransfererlinkedid']]['transferuniqueid']=_0x104847[_0x0c03('0x40')];queues[_0x104847['secondtransfererlinkedid']][_0x0c03('0x9')]=_0x0c03('0x41');}if(!_[_0x0c03('0x14')](queues[_0x104847[_0x0c03('0x3c')]])){if(_0x104847[_0x0c03('0x42')]&&queues[_0x104847[_0x0c03('0x42')]]){queues[_0x104847['transfereelinkedid']][_0x0c03('0x19')]=0x1;queues[_0x104847[_0x0c03('0x35')]]=_['clone'](queues[_0x104847['transfereelinkedid']]);queues[_0x104847['transfereeuniqueid']][_0x0c03('0xf')]=_0x104847[_0x0c03('0x43')];queues[_0x104847[_0x0c03('0x35')]][_0x0c03('0x19')]=0x2;queues[_0x104847[_0x0c03('0x35')]][_0x0c03('0x8')]=queues[_0x104847[_0x0c03('0x3d')]][_0x0c03('0x8')];queues[_0x104847[_0x0c03('0x35')]][_0x0c03('0x44')]=queues[_0x104847[_0x0c03('0x3d')]][_0x0c03('0x44')];queues[_0x104847['transfereeuniqueid']][_0x0c03('0x27')]=utils[_0x0c03('0x12')]();queues[_0x104847[_0x0c03('0x35')]]['queuecallerleaveAt']=utils[_0x0c03('0x12')]();queues[_0x104847[_0x0c03('0x35')]][_0x0c03('0x25')]=0x0;queues[_0x104847[_0x0c03('0x35')]][_0x0c03('0x45')]=0x0;}else{queues[_0x104847[_0x0c03('0x3c')]][_0x0c03('0xf')]=_0x104847[_0x0c03('0x3d')];}}}else if(_0x104847[_0x0c03('0x46')]==_0x104847[_0x0c03('0x3d')]){if(!_[_0x0c03('0x14')](queues[_0x104847['origtransfererlinkedid']])){queues[_0x104847['origtransfererlinkedid']]['transfer']=!![];queues[_0x104847[_0x0c03('0x3c')]]['transfertype']=_0x0c03('0x3e');queues[_0x104847['origtransfererlinkedid']][_0x0c03('0x38')]=_0x104847[_0x0c03('0x47')];queues[_0x104847['origtransfererlinkedid']][_0x0c03('0x48')]=_0x104847[_0x0c03('0x46')];queues[_0x104847[_0x0c03('0x3c')]][_0x0c03('0x9')]=_0x0c03('0x41');}if(!_[_0x0c03('0x14')](queues[_0x104847[_0x0c03('0x3d')]])){if(_0x104847['transfertargetlinkedid']&&queues[_0x104847[_0x0c03('0x49')]]){queues[_0x104847['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x104847[_0x0c03('0x43')]]=_[_0x0c03('0x4a')](queues[_0x104847[_0x0c03('0x49')]]);queues[_0x104847[_0x0c03('0x43')]]['transfereduniqueid']=_0x104847[_0x0c03('0x43')];queues[_0x104847[_0x0c03('0x43')]][_0x0c03('0x19')]=0x2;queues[_0x104847[_0x0c03('0x43')]]['calleridnum']=queues[_0x104847[_0x0c03('0x3c')]]['calleridnum'];queues[_0x104847[_0x0c03('0x43')]][_0x0c03('0x44')]=queues[_0x104847[_0x0c03('0x3c')]][_0x0c03('0x44')];queues[_0x104847['transfertargetuniqueid']][_0x0c03('0x27')]=utils[_0x0c03('0x12')]();queues[_0x104847['transfertargetuniqueid']][_0x0c03('0x15')]=utils[_0x0c03('0x12')]();queues[_0x104847[_0x0c03('0x43')]][_0x0c03('0x25')]=0x0;queues[_0x104847[_0x0c03('0x43')]][_0x0c03('0x45')]=0x0;}else{queues[_0x104847['secondtransfererlinkedid']][_0x0c03('0xf')]=_0x104847['origtransfererlinkedid'];}}}}catch(_0x144390){utils[_0x0c03('0x4b')](_0x144390[_0x0c03('0x4c')]);}};exports[_0x0c03('0x4d')]=function(_0x3d28da){if(!_[_0x0c03('0x14')](queues[_0x3d28da[_0x0c03('0x4')]])){queues[_0x3d28da['uniqueid']][_0x0c03('0x4e')]=utils[_0x0c03('0x12')]();}};exports[_0x0c03('0x4f')]=function(_0x1a02e7){if(!_['isNil'](queues[_0x1a02e7['uniqueid']])){if(!_[_0x0c03('0x14')](queues[_0x1a02e7[_0x0c03('0x4')]][_0x0c03('0x4e')])){queues[_0x1a02e7[_0x0c03('0x4')]][_0x0c03('0x45')]+=utils[_0x0c03('0x26')](utils['now'](),queues[_0x1a02e7[_0x0c03('0x4')]][_0x0c03('0x4e')]);delete queues[_0x1a02e7[_0x0c03('0x4')]][_0x0c03('0x4e')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d3dea28..a03adbc 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','uniqueid','linkedid','context','channel','error','stack','isNil','transfer','variable','endsWith','value','replace','.wav49','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode'];(function(_0x226869,_0x504085){var _0x191747=function(_0x4bde70){while(--_0x4bde70){_0x226869['push'](_0x226869['shift']());}};_0x191747(++_0x504085);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x1ffbbf){utils[_0x49c4('0x0')](_0x1ffbbf);if(_0x1ffbbf[_0x49c4('0x1')]){utils[_0x49c4('0x2')](_0x1ffbbf[_0x49c4('0x1')])[_0x49c4('0x3')](function(_0x4e0313){if(_0x4e0313){_0x1ffbbf['membername']=_0x4e0313[_0x49c4('0x4')];_0x1ffbbf['UserId']=_0x4e0313['id'];}utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);});}else{utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);}}exports[_0x49c4('0x7')]=function(_0x511d53){try{if(_0x511d53[_0x49c4('0x8')]==_0x511d53[_0x49c4('0x9')]){recordings[_0x511d53[_0x49c4('0x8')]]={'uniqueid':_0x511d53[_0x49c4('0x8')],'accountcode':_0x511d53['accountcode'],'exten':_0x511d53['exten'],'context':_0x511d53[_0x49c4('0xa')],'channel':_0x511d53[_0x49c4('0xb')],'monitors':[]};}}catch(_0x58cad7){utils[_0x49c4('0xc')](_0x58cad7[_0x49c4('0xd')]);}};exports['newstate']=function(_0x536d42){try{if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x8')]])&&_0x536d42['channelstate']==0x6){}else if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x9')]])&&_0x536d42['channelstate']==0x6&&_0x536d42[_0x49c4('0xa')]!=_0x49c4('0xf')){recordings[_0x536d42[_0x49c4('0x9')]][_0x49c4('0x1')]=_0x536d42[_0x49c4('0x1')];}}catch(_0x18211c){utils[_0x49c4('0xc')](_0x18211c[_0x49c4('0xd')]);}};exports['varset']=function(_0x3acd06){try{if(!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')])&&!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')]['mixmonitor_filename'])){if(_[_0x49c4('0x11')](_0x3acd06[_0x49c4('0x12')],'.wav49')){_0x3acd06['value']=_0x3acd06[_0x49c4('0x12')][_0x49c4('0x13')](_0x49c4('0x14'),'.WAV');}if(recordings[_0x3acd06[_0x49c4('0x9')]]){var _0x50b151=_[_0x49c4('0x15')](recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')],{'value':_0x3acd06[_0x49c4('0x12')]});if(_[_0x49c4('0xe')](_0x50b151)){recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')][_0x49c4('0x17')]({'value':_0x3acd06[_0x49c4('0x12')]});}}}}catch(_0x578447){utils['error'](_0x578447['stack']);}};exports[_0x49c4('0x18')]=function(_0x4f0b62){try{if(!_['isNil'](recordings[_0x4f0b62[_0x49c4('0x8')]])){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x19')]=_0x4f0b62[_0x49c4('0x19')];recordings[_0x4f0b62['uniqueid']]['calleridname']=_0x4f0b62[_0x49c4('0x1a')];recordings[_0x4f0b62[_0x49c4('0x8')]]['connectedlinenum']=_0x4f0b62[_0x49c4('0x1b')];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]=_0x4f0b62[_0x49c4('0x1c')];if(recordings[_0x4f0b62['uniqueid']]['type']==_0x49c4('0x1d')&&recordings[_0x4f0b62['uniqueid']][_0x49c4('0x1')]){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1b')]=recordings[_0x4f0b62[_0x49c4('0x8')]]['accountcode'];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]='';}recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x16')][_0x49c4('0x1e')](_0x29f835=>{var _0x26ba17=_[_0x49c4('0x1f')](recordings[_0x4f0b62[_0x49c4('0x8')]]);_0x26ba17[_0x49c4('0x12')]=_0x29f835[_0x49c4('0x12')];writeDB(_0x26ba17);});delete recordings[_0x4f0b62['uniqueid']];}}catch(_0x4f4495){utils['error'](_0x4f4495[_0x49c4('0xd')]);}};exports[_0x49c4('0x20')]=function(_0x1eb035){try{if(!_[_0x49c4('0xe')](recordings[_0x1eb035[_0x49c4('0x8')]])){if(_0x1eb035['application'][_0x49c4('0x21')]()==_0x49c4('0x22')&&_[_0x49c4('0x23')](_0x1eb035[_0x49c4('0x24')]['toLowerCase'](),'cdr')){var _0xce57ef=_0x1eb035[_0x49c4('0x24')][_0x49c4('0x25')]('=');var _0x13b3b4=_0xce57ef[0x0][_0x49c4('0x26')](_0xce57ef[0x0]['lastIndexOf']('(')+0x1,_0xce57ef[0x0][_0x49c4('0x27')](')'));var _0x84c621=_0xce57ef[0x1];recordings[_0x1eb035[_0x49c4('0x8')]][_0x13b3b4]=_0x84c621;}}}catch(_0x512d02){utils['error'](_0x512d02[_0x49c4('0xd')]);}};exports[_0x49c4('0x28')]=function(_0x3bec0a){try{if(!_[_0x49c4('0xe')](recordings[_0x3bec0a[_0x49c4('0x8')]])){recordings[_0x3bec0a[_0x49c4('0x8')]][_0x49c4('0x29')]=_0x3bec0a[_0x49c4('0x29')];}}catch(_0x3209cd){utils['error'](_0x3209cd[_0x49c4('0xd')]);}}; \ No newline at end of file +var _0xedd9=['UserId','request','CreateVoiceRecording','uniqueid','linkedid','context','channel','error','stack','isNil','channelstate','varset','variable','endsWith','value','.wav49','.WAV','find','monitors','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','./utils','debug','accountcode','getUserByInternal','then','name'];(function(_0xd189ab,_0x478a2a){var _0x5268f=function(_0x5a1b40){while(--_0x5a1b40){_0xd189ab['push'](_0xd189ab['shift']());}};_0x5268f(++_0x478a2a);}(_0xedd9,0xfc));var _0x9edd=function(_0x1b9aa3,_0x28f818){_0x1b9aa3=_0x1b9aa3-0x0;var _0x29880f=_0xedd9[_0x1b9aa3];return _0x29880f;};'use strict';var _=require('lodash');var utils=require(_0x9edd('0x0'));var recordings={};function writeDB(_0x2d7989){utils[_0x9edd('0x1')](_0x2d7989);if(_0x2d7989[_0x9edd('0x2')]){utils[_0x9edd('0x3')](_0x2d7989[_0x9edd('0x2')])[_0x9edd('0x4')](function(_0x36b53f){if(_0x36b53f){_0x2d7989['membername']=_0x36b53f[_0x9edd('0x5')];_0x2d7989[_0x9edd('0x6')]=_0x36b53f['id'];}utils[_0x9edd('0x7')](_0x9edd('0x8'),_0x2d7989);});}else{utils['request'](_0x9edd('0x8'),_0x2d7989);}}exports['newchannel']=function(_0x172522){try{if(_0x172522[_0x9edd('0x9')]==_0x172522[_0x9edd('0xa')]){recordings[_0x172522[_0x9edd('0x9')]]={'uniqueid':_0x172522['uniqueid'],'accountcode':_0x172522[_0x9edd('0x2')],'exten':_0x172522['exten'],'context':_0x172522[_0x9edd('0xb')],'channel':_0x172522[_0x9edd('0xc')],'monitors':[]};}}catch(_0x523026){utils[_0x9edd('0xd')](_0x523026[_0x9edd('0xe')]);}};exports['newstate']=function(_0x30c0d7){try{if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0x9')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6){}else if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0xa')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6&&_0x30c0d7[_0x9edd('0xb')]!='transfer'){recordings[_0x30c0d7[_0x9edd('0xa')]][_0x9edd('0x2')]=_0x30c0d7[_0x9edd('0x2')];}}catch(_0x4d9a7){utils[_0x9edd('0xd')](_0x4d9a7[_0x9edd('0xe')]);}};exports[_0x9edd('0x11')]=function(_0x75a4ab){try{if(!_['isNil'](_0x75a4ab[_0x9edd('0x12')])&&!_[_0x9edd('0xf')](_0x75a4ab[_0x9edd('0x12')]['mixmonitor_filename'])){if(_[_0x9edd('0x13')](_0x75a4ab[_0x9edd('0x14')],_0x9edd('0x15'))){_0x75a4ab['value']=_0x75a4ab[_0x9edd('0x14')]['replace'](_0x9edd('0x15'),_0x9edd('0x16'));}if(recordings[_0x75a4ab['linkedid']]){var _0x498977=_[_0x9edd('0x17')](recordings[_0x75a4ab['linkedid']][_0x9edd('0x18')],{'value':_0x75a4ab['value']});if(_['isNil'](_0x498977)){recordings[_0x75a4ab[_0x9edd('0xa')]][_0x9edd('0x18')]['push']({'value':_0x75a4ab['value']});}}}}catch(_0x341d67){utils[_0x9edd('0xd')](_0x341d67[_0x9edd('0xe')]);}};exports['hangup']=function(_0x3741c8){try{if(!_[_0x9edd('0xf')](recordings[_0x3741c8[_0x9edd('0x9')]])){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x19')]=_0x3741c8['calleridnum'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1a')]=_0x3741c8[_0x9edd('0x1a')];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=_0x3741c8['connectedlinenum'];recordings[_0x3741c8['uniqueid']][_0x9edd('0x1c')]=_0x3741c8[_0x9edd('0x1c')];if(recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1d')]==_0x9edd('0x1e')&&recordings[_0x3741c8['uniqueid']]['accountcode']){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=recordings[_0x3741c8[_0x9edd('0x9')]]['accountcode'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1c')]='';}recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x18')]['forEach'](_0x2155a1=>{var _0x3fb556=_[_0x9edd('0x1f')](recordings[_0x3741c8[_0x9edd('0x9')]]);_0x3fb556[_0x9edd('0x14')]=_0x2155a1[_0x9edd('0x14')];writeDB(_0x3fb556);});delete recordings[_0x3741c8[_0x9edd('0x9')]];}}catch(_0x1fba7b){utils[_0x9edd('0xd')](_0x1fba7b[_0x9edd('0xe')]);}};exports[_0x9edd('0x20')]=function(_0x138002){try{if(!_[_0x9edd('0xf')](recordings[_0x138002[_0x9edd('0x9')]])){if(_0x138002[_0x9edd('0x21')]['toLowerCase']()==_0x9edd('0x22')&&_[_0x9edd('0x23')](_0x138002[_0x9edd('0x24')]['toLowerCase'](),_0x9edd('0x25'))){var _0x3990fb=_0x138002[_0x9edd('0x24')][_0x9edd('0x26')]('=');var _0x21bc30=_0x3990fb[0x0][_0x9edd('0x27')](_0x3990fb[0x0][_0x9edd('0x28')]('(')+0x1,_0x3990fb[0x0][_0x9edd('0x28')](')'));var _0xd0fd74=_0x3990fb[0x1];recordings[_0x138002[_0x9edd('0x9')]][_0x21bc30]=_0xd0fd74;}}}catch(_0x29e789){utils[_0x9edd('0xd')](_0x29e789[_0x9edd('0xe')]);}};exports[_0x9edd('0x29')]=function(_0x5757fc){try{if(!_[_0x9edd('0xf')](recordings[_0x5757fc['uniqueid']])){recordings[_0x5757fc[_0x9edd('0x9')]][_0x9edd('0x2a')]=_0x5757fc[_0x9edd('0x2a')];}}catch(_0x434d26){utils[_0x9edd('0xd')](_0x434d26['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 7ffaf90..f5b77e9 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 _0x9917=['attendedtransfer','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','lodash','./utils','info','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind','stack'];(function(_0x5a3407,_0x3e3f06){var _0x19c53b=function(_0x34dd6e){while(--_0x34dd6e){_0x5a3407['push'](_0x5a3407['shift']());}};_0x19c53b(++_0x3e3f06);}(_0x9917,0xe6));var _0x7991=function(_0x1a6f96,_0x2b09fe){_0x1a6f96=_0x1a6f96-0x0;var _0x4240aa=_0x9917[_0x1a6f96];return _0x4240aa;};'use strict';var _=require(_0x7991('0x0'));var util=require('util');var utils=require(_0x7991('0x1'));function writeDB(_0x476027){utils[_0x7991('0x2')](util['format'](_0x7991('0x3'),_0x476027[_0x7991('0x4')]));utils[_0x7991('0x5')](_0x7991('0x6'),_0x476027);}exports[_0x7991('0x7')]=function(_0x3ed217){try{_0x3ed217[_0x7991('0x4')]=_0x7991('0x8');writeDB(_0x3ed217);}catch(_0x29e6c7){utils['error'](_0x29e6c7[_0x7991('0x9')]);}};exports[_0x7991('0xa')]=function(_0x499e7c){try{_0x499e7c=_[_0x7991('0xb')](_0x499e7c,{'transfererchannel':_0x499e7c[_0x7991('0xc')],'transferercalleridnum':_0x499e7c['origtransferercalleridnum'],'transferercalleridname':_0x499e7c[_0x7991('0xd')],'transfererconnectedlinenum':_0x499e7c[_0x7991('0xe')],'transfererconnectedlinename':_0x499e7c[_0x7991('0xf')],'transfereraccountcode':_0x499e7c['origtransfereraccountcode'],'transferercontext':_0x499e7c[_0x7991('0x10')],'transfererexten':_0x499e7c[_0x7991('0x11')],'transfererlinkedid':_0x499e7c[_0x7991('0x12')],'context':_0x499e7c['origtransferercontext'],'extension':_0x499e7c[_0x7991('0x13')],'type':_0x7991('0x14')});if(_[_0x7991('0x15')](_0x499e7c[_0x7991('0x16')])){_0x499e7c=_[_0x7991('0xb')](_0x499e7c,{'transfereechannel':_0x499e7c[_0x7991('0x17')],'transfereecalleridnum':_0x499e7c[_0x7991('0x18')],'transfereecalleridname':_0x499e7c[_0x7991('0x19')],'transfereeconnectedlinenum':_0x499e7c[_0x7991('0x1a')],'transfereeconnectedlinename':_0x499e7c[_0x7991('0x1b')],'transfereeaccountcode':_0x499e7c['transfertargetaccountcode'],'transfereecontext':_0x499e7c[_0x7991('0x1c')],'transfereeexten':_0x499e7c['transfertargetexten'],'transfereelinkedid':_0x499e7c[_0x7991('0x1d')]});}writeDB(_0x499e7c);}catch(_0x25030c){utils['error'](_0x25030c['stack']);}}; \ No newline at end of file +var _0xc14d=['origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetexten','error','./utils','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','stack','attendedtransfer'];(function(_0x19e2d2,_0xe4cce5){var _0x50c56a=function(_0x470f04){while(--_0x470f04){_0x19e2d2['push'](_0x19e2d2['shift']());}};_0x50c56a(++_0xe4cce5);}(_0xc14d,0x1ea));var _0xdc14=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc14d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xdc14('0x0'));function writeDB(_0x2ccc9b){utils[_0xdc14('0x1')](util[_0xdc14('0x2')](_0xdc14('0x3'),_0x2ccc9b[_0xdc14('0x4')]));utils[_0xdc14('0x5')](_0xdc14('0x6'),_0x2ccc9b);}exports[_0xdc14('0x7')]=function(_0x344488){try{_0x344488[_0xdc14('0x4')]='blind';writeDB(_0x344488);}catch(_0x3ccbeb){utils['error'](_0x3ccbeb[_0xdc14('0x8')]);}};exports[_0xdc14('0x9')]=function(_0xeed4e1){try{_0xeed4e1=_['assign'](_0xeed4e1,{'transfererchannel':_0xeed4e1[_0xdc14('0xa')],'transferercalleridnum':_0xeed4e1[_0xdc14('0xb')],'transferercalleridname':_0xeed4e1[_0xdc14('0xc')],'transfererconnectedlinenum':_0xeed4e1[_0xdc14('0xd')],'transfererconnectedlinename':_0xeed4e1['secondtransfererconnectedlinename'],'transfereraccountcode':_0xeed4e1['origtransfereraccountcode'],'transferercontext':_0xeed4e1['secondtransferercontext'],'transfererexten':_0xeed4e1[_0xdc14('0xe')],'transfererlinkedid':_0xeed4e1[_0xdc14('0xf')],'context':_0xeed4e1[_0xdc14('0x10')],'extension':_0xeed4e1['origtransfererexten'],'type':_0xdc14('0x11')});if(_[_0xdc14('0x12')](_0xeed4e1[_0xdc14('0x13')])){_0xeed4e1=_['assign'](_0xeed4e1,{'transfereechannel':_0xeed4e1[_0xdc14('0x14')],'transfereecalleridnum':_0xeed4e1[_0xdc14('0x15')],'transfereecalleridname':_0xeed4e1['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xeed4e1['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xeed4e1[_0xdc14('0x16')],'transfereeaccountcode':_0xeed4e1['transfertargetaccountcode'],'transfereecontext':_0xeed4e1['transfertargetcontext'],'transfereeexten':_0xeed4e1[_0xdc14('0x17')],'transfereelinkedid':_0xeed4e1['transfertargetlinkedid']});}writeDB(_0xeed4e1);}catch(_0x1782fe){utils[_0xdc14('0x18')](_0x1782fe['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 82a5095..bf39e1a 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 _0xeadd=['YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','isAfter','moment','bluebird','client','http','../../config/logger','info','debug','stringify','error','request','then','catch','stack','GetUser','internal','name','interface','GETUSER|','result','length','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','acw','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format'];(function(_0x52b86f,_0x153496){var _0x2d2271=function(_0x10e52b){while(--_0x10e52b){_0x52b86f['push'](_0x52b86f['shift']());}};_0x2d2271(++_0x153496);}(_0xeadd,0x182));var _0xdead=function(_0x2e124c,_0x2f0649){_0x2e124c=_0x2e124c-0x0;var _0x356dfd=_0xeadd[_0x2e124c];return _0x356dfd;};'use strict';var jayson=require('jayson/promise');var moment=require(_0xdead('0x0'));var BPromise=require(_0xdead('0x1'));var client=jayson[_0xdead('0x2')][_0xdead('0x3')]({'port':0x2329});var logger=require(_0xdead('0x4'))('xdr');exports[_0xdead('0x5')]=function(_0x462380){logger[_0xdead('0x5')](_0x462380);};exports[_0xdead('0x6')]=function(_0x4febd4){logger[_0xdead('0x6')](JSON[_0xdead('0x7')](_0x4febd4));};exports[_0xdead('0x8')]=function(_0x33c05a){logger[_0xdead('0x8')](_0x33c05a['stack']);};exports[_0xdead('0x9')]=function(_0x5342c7,_0x4414e1){return client['request'](_0x5342c7,{'body':_0x4414e1})[_0xdead('0xa')](function(_0x492db2){logger[_0xdead('0x6')](JSON['stringify'](_0x492db2));})[_0xdead('0xb')](function(_0x175bd3){logger[_0xdead('0x8')](_0x175bd3[_0xdead('0xc')]);});};function getUser(_0x35e8d5){return client[_0xdead('0x9')](_0xdead('0xd'),{'options':{'raw':!![],'attributes':['id',_0xdead('0xe'),_0xdead('0xf'),_0xdead('0x10')],'where':_0x35e8d5,'limit':0x1}})['then'](function(_0x289586){logger[_0xdead('0x5')](_0xdead('0x11')+JSON[_0xdead('0x7')](_0x35e8d5)+'|'+(_0x289586[_0xdead('0x12')][_0xdead('0x13')]?'FOUND':_0xdead('0x14')));return _0x289586[_0xdead('0x12')][_0xdead('0x13')]?_0x289586[_0xdead('0x12')][0x0]:null;});}exports[_0xdead('0x15')]=function(_0x4115fa){return new BPromise(function(_0x2fdd61,_0x5e27b6){if(_0x4115fa){return getUser({'internal':_0x4115fa})[_0xdead('0xa')](function(_0xaccd21){return _0x2fdd61(_0xaccd21);})[_0xdead('0xb')](function(_0x2153fa){logger[_0xdead('0x8')](_0x2153fa[_0xdead('0xc')]);return _0x2fdd61(null);});}else{return _0x2fdd61(null);}});};exports[_0xdead('0x16')]=function(_0x4662fb){return new BPromise(function(_0x44fc24,_0x2349d0){if(_0x4662fb){return getUser({'interface':_0x4662fb})['then'](function(_0x2dd995){return _0x44fc24(_0x2dd995);})[_0xdead('0xb')](function(_0x31559a){logger[_0xdead('0x8')](_0x31559a['stack']);return _0x44fc24(null);});}else{return _0x44fc24(null);}});};exports[_0xdead('0x17')]=function(_0x3ff35b){return new BPromise(function(_0x5483b6,_0x424ade){if(_0x3ff35b){return getUser({'name':_0x3ff35b})[_0xdead('0xa')](function(_0x3a0088){return _0x5483b6(_0x3a0088);})['catch'](function(_0x599354){logger[_0xdead('0x8')](_0x599354[_0xdead('0xc')]);return _0x5483b6(null);});}else{return _0x5483b6(null);}});};exports[_0xdead('0x18')]=function(_0x890bbf){return new BPromise(function(_0x51d031,_0x21b376){if(_0x890bbf){return client['request'](_0xdead('0x19'),{'options':{'raw':!![],'attributes':['id','name','type',_0xdead('0x1a'),'acwTimeout'],'where':{'name':_0x890bbf},'limit':0x1}})[_0xdead('0xa')](function(_0x4da0fc){logger[_0xdead('0x5')](_0xdead('0x1b')+_0x890bbf+'|'+(_0x4da0fc[_0xdead('0x12')][_0xdead('0x13')]?'FOUND':_0xdead('0x14')));return _0x51d031(_0x4da0fc[_0xdead('0x12')][_0xdead('0x13')]?_0x4da0fc[_0xdead('0x12')][0x0]:null);})[_0xdead('0xb')](function(_0x4a5cfa){logger['error'](_0x4a5cfa[_0xdead('0xc')]);return _0x51d031(null);});}else{return _0x51d031(null);}});};exports[_0xdead('0x1c')]=function(_0x4452fd,_0x1d43c0){return moment(_0x4452fd)[_0xdead('0x1d')](_0x1d43c0,_0xdead('0x1e'))[_0xdead('0x1f')](_0xdead('0x20'));};exports[_0xdead('0x21')]=function(_0x4f0e3a,_0x587437){return moment(_0x4f0e3a)[_0xdead('0x22')](_0x587437,_0xdead('0x1e'))['format'](_0xdead('0x20'));};exports[_0xdead('0x23')]=function(_0x4e4d74,_0x381695){return moment(_0x4e4d74)[_0xdead('0x24')](moment(_0x381695),_0xdead('0x1e'));};exports['sumTime']=function(_0x16be9e,_0x51e68f){return parseInt(_0x16be9e,0xa)+parseInt(_0x51e68f,0xa);};exports['now']=function(){return moment()[_0xdead('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xdead('0x25')]=function(_0x11cb48,_0x3c50e3){if(_0x3c50e3){return moment(_0x11cb48)[_0xdead('0x25')](_0x3c50e3);}else{return!![];}};exports['isBefore']=function(_0x390e1d,_0x2a7137){if(_0x2a7137){return moment(_0x390e1d)['isBefore'](_0x2a7137);}else if(_0x390e1d){return!![];}else{return![];}}; \ No newline at end of file +var _0xb7e7=['then','internal','name','interface','GETUSER|','length','FOUND','result','getUserByInternal','catch','getUserByInterface','getVoiceQueueByName','type','acw','GETVOICEQUEUEBYNAME|','NOTFOUND','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','seconds','sumTime','now','isAfter','isBefore','bluebird','../../config/logger','xdr','info','debug','stringify','error','stack','request'];(function(_0x336178,_0x29a931){var _0x8bab3a=function(_0x5db51c){while(--_0x5db51c){_0x336178['push'](_0x336178['shift']());}};_0x8bab3a(++_0x29a931);}(_0xb7e7,0x1d8));var _0x7b7e=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xb7e7[_0x166d93];return _0xba708;};'use strict';var jayson=require('jayson/promise');var moment=require('moment');var BPromise=require(_0x7b7e('0x0'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x7b7e('0x1'))(_0x7b7e('0x2'));exports['info']=function(_0xa46906){logger[_0x7b7e('0x3')](_0xa46906);};exports['debug']=function(_0x4115e0){logger[_0x7b7e('0x4')](JSON[_0x7b7e('0x5')](_0x4115e0));};exports[_0x7b7e('0x6')]=function(_0x4ae7f9){logger[_0x7b7e('0x6')](_0x4ae7f9[_0x7b7e('0x7')]);};exports[_0x7b7e('0x8')]=function(_0x8eaabc,_0x294daf){return client['request'](_0x8eaabc,{'body':_0x294daf})[_0x7b7e('0x9')](function(_0x6184f4){logger['debug'](JSON[_0x7b7e('0x5')](_0x6184f4));})['catch'](function(_0xc38fa4){logger['error'](_0xc38fa4[_0x7b7e('0x7')]);});};function getUser(_0x94c103){return client[_0x7b7e('0x8')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x7b7e('0xa'),_0x7b7e('0xb'),_0x7b7e('0xc')],'where':_0x94c103,'limit':0x1}})['then'](function(_0xe4f300){logger[_0x7b7e('0x3')](_0x7b7e('0xd')+JSON[_0x7b7e('0x5')](_0x94c103)+'|'+(_0xe4f300['result'][_0x7b7e('0xe')]?_0x7b7e('0xf'):'NOTFOUND'));return _0xe4f300['result'][_0x7b7e('0xe')]?_0xe4f300[_0x7b7e('0x10')][0x0]:null;});}exports[_0x7b7e('0x11')]=function(_0x54ae73){return new BPromise(function(_0x4c3ab2,_0x39a547){if(_0x54ae73){return getUser({'internal':_0x54ae73})[_0x7b7e('0x9')](function(_0x1f63e8){return _0x4c3ab2(_0x1f63e8);})[_0x7b7e('0x12')](function(_0x3f442a){logger[_0x7b7e('0x6')](_0x3f442a[_0x7b7e('0x7')]);return _0x4c3ab2(null);});}else{return _0x4c3ab2(null);}});};exports[_0x7b7e('0x13')]=function(_0x35b95f){return new BPromise(function(_0x1fd6e4,_0x27c4de){if(_0x35b95f){return getUser({'interface':_0x35b95f})[_0x7b7e('0x9')](function(_0x125dad){return _0x1fd6e4(_0x125dad);})[_0x7b7e('0x12')](function(_0xd1d83d){logger[_0x7b7e('0x6')](_0xd1d83d[_0x7b7e('0x7')]);return _0x1fd6e4(null);});}else{return _0x1fd6e4(null);}});};exports['getUserByName']=function(_0x3a1796){return new BPromise(function(_0x39a2ea,_0x5135a4){if(_0x3a1796){return getUser({'name':_0x3a1796})[_0x7b7e('0x9')](function(_0x1ef443){return _0x39a2ea(_0x1ef443);})['catch'](function(_0x168c22){logger['error'](_0x168c22['stack']);return _0x39a2ea(null);});}else{return _0x39a2ea(null);}});};exports[_0x7b7e('0x14')]=function(_0x3cd859){return new BPromise(function(_0x4ee2d8,_0x5a9801){if(_0x3cd859){return client[_0x7b7e('0x8')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0x7b7e('0x15'),_0x7b7e('0x16'),'acwTimeout'],'where':{'name':_0x3cd859},'limit':0x1}})['then'](function(_0x52e359){logger['info'](_0x7b7e('0x17')+_0x3cd859+'|'+(_0x52e359['result'][_0x7b7e('0xe')]?'FOUND':_0x7b7e('0x18')));return _0x4ee2d8(_0x52e359[_0x7b7e('0x10')]['length']?_0x52e359[_0x7b7e('0x10')][0x0]:null);})[_0x7b7e('0x12')](function(_0x430d32){logger[_0x7b7e('0x6')](_0x430d32[_0x7b7e('0x7')]);return _0x4ee2d8(null);});}else{return _0x4ee2d8(null);}});};exports[_0x7b7e('0x19')]=function(_0x4e60ba,_0x15549b){return moment(_0x4e60ba)[_0x7b7e('0x1a')](_0x15549b,'seconds')[_0x7b7e('0x1b')](_0x7b7e('0x1c'));};exports['subtractTime']=function(_0x26f73d,_0x1f60c7){return moment(_0x26f73d)[_0x7b7e('0x1d')](_0x1f60c7,'seconds')[_0x7b7e('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7b7e('0x1e')]=function(_0x28a8fa,_0x1be5f1){return moment(_0x28a8fa)[_0x7b7e('0x1f')](moment(_0x1be5f1),_0x7b7e('0x20'));};exports[_0x7b7e('0x21')]=function(_0x537f7a,_0x3a304d){return parseInt(_0x537f7a,0xa)+parseInt(_0x3a304d,0xa);};exports[_0x7b7e('0x22')]=function(){return moment()[_0x7b7e('0x1b')](_0x7b7e('0x1c'));};exports['isAfter']=function(_0x4e34ab,_0x5ccfb2){if(_0x5ccfb2){return moment(_0x4e34ab)[_0x7b7e('0x23')](_0x5ccfb2);}else{return!![];}};exports['isBefore']=function(_0x4e54c9,_0x4e395e){if(_0x4e395e){return moment(_0x4e54c9)[_0x7b7e('0x24')](_0x4e395e);}else if(_0x4e54c9){return!![];}else{return![];}}; \ No newline at end of file